summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhitAd <adlakhshobhit@gmail.com>2018-10-11 07:31:44 -0700
committerShobhitAd <adlakhshobhit@gmail.com>2018-10-11 07:31:44 -0700
commit5e5c4299dbac4edac0c59983e274b502c702ec47 (patch)
treebcb064c761739e6c22e444cb41fe9bc035219ad0
parentab2b23a553acc63427f9c39e31b4cdc16317982f (diff)
parent74a6624e3d87ab3c0a6606f4d825a8e8b9c57041 (diff)
downloadsdl_core-5e5c4299dbac4edac0c59983e274b502c702ec47.tar.gz
Merge branch 'release/5.0.0' of github.com:smartdevicelink/sdl_core into fix/crushes_with_DCHECK_set_sizes_equal
-rw-r--r--.github/CONTRIBUTING.md38
-rw-r--r--.github/ISSUE_TEMPLATE.md23
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md33
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml53
-rw-r--r--CHANGELOG.md61
-rw-r--r--CMakeLists.txt126
-rw-r--r--COMMITTERS.md95
-rw-r--r--CONTRIBUTING.md35
-rw-r--r--Doxyfile2
-rwxr-xr-xFindQt.sh174
-rw-r--r--LICENSE2
-rw-r--r--README.md67
-rw-r--r--docs/FORD.OpenSDL.SDD.TPL.dox355
-rw-r--r--docs/SDL.SDD.Template.dox355
-rw-r--r--docs/mainpage.dox5
-rw-r--r--src/3rd_party-static/CMakeLists.txt12
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/CMakeLists.txt30
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/config.h135
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-core.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-darwin_usb.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-descriptor.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-hotplug.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-io.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_netlink.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_udev.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_usbfs.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-openbsd_usb.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_posix.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_windows.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-strerror.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-sync.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_posix.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_windows.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-windows_usb.Plo1
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.am68
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.in860
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/core.c2228
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/descriptor.c1197
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.c320
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.h82
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/io.c2566
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.def158
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.rc61
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/libusb.h1941
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/libusbi.h1004
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.c1903
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.h162
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_netlink.c254
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_udev.c273
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.c2568
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.h181
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/openbsd_usb.c734
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.c51
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.h11
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.c726
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.h125
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.c80
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.h50
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.c212
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.h87
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.c1015
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.h131
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_common.h108
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.c4393
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.h918
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/strerror.c184
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/sync.c307
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/version.h18
-rw-r--r--src/3rd_party-static/libusbx-1.0.16/libusb/version_nano.h1
-rw-r--r--src/3rd_party-static/message_broker/CMakeLists.txt78
-rw-r--r--src/3rd_party-static/message_broker/include/CMessageBroker.hpp108
-rw-r--r--src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp113
-rw-r--r--src/3rd_party-static/message_broker/include/CSender.hpp53
-rw-r--r--src/3rd_party-static/message_broker/include/MBDebugHelper.h40
-rw-r--r--src/3rd_party-static/message_broker/include/mb_client.hpp135
-rw-r--r--src/3rd_party-static/message_broker/include/mb_controller.hpp253
-rw-r--r--src/3rd_party-static/message_broker/include/mb_server.hpp121
-rw-r--r--src/3rd_party-static/message_broker/include/mb_tcpclient.hpp58
-rw-r--r--src/3rd_party-static/message_broker/include/mb_tcpserver.hpp150
-rw-r--r--src/3rd_party-static/message_broker/include/networking.h139
-rw-r--r--src/3rd_party-static/message_broker/include/system.h320
-rw-r--r--src/3rd_party-static/message_broker/include/websocket_handler.hpp226
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_client.cpp75
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_controller.cpp352
-rw-r--r--src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp58
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp59
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp68
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp125
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp96
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp191
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp117
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp245
-rw-r--r--src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp19
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp958
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp191
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h43
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp373
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h93
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp267
-rw-r--r--src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp667
-rw-r--r--src/3rd_party-static/message_broker/src/server/mb_server.cpp46
-rw-r--r--src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp331
-rw-r--r--src/3rd_party-static/message_broker/src/server/networking.cpp189
-rw-r--r--src/3rd_party/CMakeLists.txt186
-rw-r--r--src/3rd_party/FindBSON.cmake26
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.021759
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests78
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.01131
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp6
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp6
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp10
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp10
-rw-r--r--src/3rd_party/dbus-1.7.8/AUTHORS122
-rw-r--r--src/3rd_party/dbus-1.7.8/COPYING552
-rw-r--r--src/3rd_party/dbus-1.7.8/ChangeLog5
-rw-r--r--src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-015146
-rw-r--r--src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-22027
-rw-r--r--src/3rd_party/dbus-1.7.8/Doxyfile.in180
-rw-r--r--src/3rd_party/dbus-1.7.8/HACKING351
-rw-r--r--src/3rd_party/dbus-1.7.8/INSTALL248
-rw-r--r--src/3rd_party/dbus-1.7.8/Makefile.am36
-rw-r--r--src/3rd_party/dbus-1.7.8/Makefile.in1072
-rw-r--r--src/3rd_party/dbus-1.7.8/NEWS988
-rw-r--r--src/3rd_party/dbus-1.7.8/NEWS.pre-1-0614
-rw-r--r--src/3rd_party/dbus-1.7.8/NEWS.pre-1-2153
-rw-r--r--src/3rd_party/dbus-1.7.8/README165
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/README.cygwin6
-rw-r--r--src/3rd_party/dbus-1.7.8/README.launchd61
-rw-r--r--src/3rd_party/dbus-1.7.8/README.valgrind24
-rw-r--r--src/3rd_party/dbus-1.7.8/README.win111
-rw-r--r--src/3rd_party/dbus-1.7.8/README.wince81
-rw-r--r--src/3rd_party/dbus-1.7.8/aclocal.m41335
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/autogen.sh105
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/Makefile.am283
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/Makefile.in1475
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation-exit-codes.h45
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation-helper-bin.c103
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation-helper.c549
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation-helper.h31
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation.c2595
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/activation.h69
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/bus.c1648
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/bus.h129
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-loader-expat.c294
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser-common.c190
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser-common.h59
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.c716
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.h72
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser.c3641
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/config-parser.h87
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/connection.c2387
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/connection.h154
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dbus.service.in8
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dbus.socket.in5
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/desktop-file.c808
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/desktop-file.h56
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dir-watch-default.c35
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dir-watch-inotify.c281
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dir-watch-kqueue.c250
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dir-watch.h40
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dispatch.c4917
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/dispatch.h38
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/driver.c2068
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/driver.h52
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/expirelist.c402
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/expirelist.h80
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/main.c654
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/messagebus-config.in178
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/bus/messagebus.in92
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/org.freedesktop.dbus-session.plist.in33
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/policy.c1313
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/policy.h169
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/rc.messagebus.in79
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/selinux.c1092
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/selinux.h72
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/services.c1304
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/services.h94
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/session.conf.in63
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/signals.c2841
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/signals.h100
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/stats.c218
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/stats.h38
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/system.conf.in83
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/test-launch-helper.c148
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/test-main.c190
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/test-system.c107
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/test.c315
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/test.h57
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/utils.c48
-rw-r--r--src/3rd_party/dbus-1.7.8/bus/utils.h36
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/cleanup-man-pages.sh86
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/CMakeLists.txt601
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/ConfigureChecks.cmake157
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/bus-test.bat.cmake14
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/bus/CMakeLists.txt189
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/bus/service.cmake3
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/bus/system.conf.cmake62
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/config.h.cmake250
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/dbus-env.bat.cmake8
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/dbus/CMakeLists.txt316
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/doc/CMakeLists.txt154
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/doc/index.html.cmake55
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/CPackInstallConfig.cmake37
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/CheckForAbstractSockets.c33
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/CheckPrototypeExists.cmake35
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/CheckStructMember.cmake36
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/FindDoxygen.cmake3
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/FindGLIB.cmake42
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/FindLibIconv.cmake52
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/MacroGetenvWinPath.cmake5
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/MacroLibrary.cmake9
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/MacroOptionalFindPackage.cmake22
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/Macros.cmake12
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/MacrosAutotools.cmake100
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/ProjectSourceGroup.cmake18
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/modules/Win32Macros.cmake44
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/test/CMakeLists.txt155
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/test/name-test/CMakeLists.txt39
-rw-r--r--src/3rd_party/dbus-1.7.8/cmake/tools/CMakeLists.txt49
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/compile347
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/config.guess1558
-rw-r--r--src/3rd_party/dbus-1.7.8/config.h.in498
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/config.sub1791
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/configure25685
-rw-r--r--src/3rd_party/dbus-1.7.8/configure.ac1875
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus-1-uninstalled.pc.in17
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus-1.pc.in17
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/Makefile.am329
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/Makefile.in2374
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-address.c828
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-address.h67
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-arch-deps.h.in61
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.c260
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.h46
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.c803
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.h37
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-auth-util.c170
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-auth.c2810
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-auth.h83
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-bus.c1602
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-bus.h95
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-connection-internal.h136
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-connection.c6295
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-connection.h496
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-credentials-util.c206
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.c550
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.h79
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.c462
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.h98
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-errors.c421
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-errors.h90
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-file-unix.c417
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-file-win.c407
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-file.c28
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-file.h63
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-hash.c1831
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-hash.h134
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-init-win.cpp52
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-internals.c1037
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-internals.h374
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.c1160
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.h52
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-list.c1350
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-list.h100
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-macros.h196
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.c919
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.h66
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.c1922
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.h226
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap-util.c105
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.c248
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.h37
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.c1514
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.h128
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive-util.c3552
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.c2752
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.h181
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate-util.c588
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.c1259
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.h206
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-memory.c952
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-memory.h73
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.c647
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.h50
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.c1305
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.h61
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message-internal.h106
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message-private.h143
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message-util.c1724
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message.c4840
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-message.h309
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-misc.c248
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-misc.h56
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.c430
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.h72
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.c2333
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.h63
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call-internal.h67
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.c843
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.h79
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-unix.c83
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-win.c90
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.c85
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.h59
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-protocol.h470
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-resources.c290
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-resources.h61
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.c431
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.h47
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.c210
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.h36
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-protected.h176
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.c589
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.h54
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.c312
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.h37
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.c96
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.h36
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server.c1241
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-server.h106
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sha.c969
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sha.h55
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-shared.h131
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-shell.c641
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-shell.h41
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-signature.c589
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-signature.h95
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-epoll.c371
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-poll.c320
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.c47
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.h122
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sockets-win.h66
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-spawn-win.c1046
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.c1684
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.h68
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-string-private.h133
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-string-util.c938
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-string.c2675
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-string.h314
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.c309
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.h58
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-pthread.c302
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-thread-win.c302
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.c4099
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.h149
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-unix.c1358
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-win.c1736
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util.c199
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.c3723
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.h93
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.c1165
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.h246
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.c776
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.h569
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-test-main.c58
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-test.c173
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-test.h80
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-threads-internal.h95
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-threads.c454
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-threads.h189
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.c491
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.h75
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-protected.h146
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.c1431
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.h46
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.c442
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.h37
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.c58
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.h33
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport.c1537
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-transport.h110
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-types.h156
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-userdb-util.c489
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.c687
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.h121
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.c130
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.h47
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-valgrind-internal.h67
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-watch.c706
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus-watch.h89
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/dbus.h104
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/sd-daemon.c520
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/sd-daemon.h282
-rw-r--r--src/3rd_party/dbus-1.7.8/dbus/versioninfo.rc.in52
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/depcomp791
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/Makefile.am161
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/Makefile.in809
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/TODO155
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/busconfig.dtd65
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-cleanup-sockets.1.xml.in65
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-daemon.1.xml.in926
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-faq.xml674
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-launch.1.xml.in288
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-monitor.1.xml.in122
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-run-session.1.xml.in151
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-send.1.xml.in164
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-specification.xml6116
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-test-plan.xml232
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-tutorial.xml1667
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dbus-uuidgen.1.xml.in126
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/dcop-howto.txt559
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/diagram.pngbin78762 -> 0 bytes
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/diagram.svg590
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/doxygen_to_devhelp.xsl40
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/file-boilerplate.c27
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/introspect.dtd37
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/introspect.xsl106
-rw-r--r--src/3rd_party/dbus-1.7.8/doc/system-activation.txt80
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/install-sh527
-rw-r--r--src/3rd_party/dbus-1.7.8/ltmain.sh9661
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/as-ac-expand.m449
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/compiler.m467
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/libtool.m47991
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/ltoptions.m4384
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/ltsugar.m4123
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/ltversion.m423
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/lt~obsolete.m498
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/pkg.m4155
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/tp-compiler-flag.m443
-rw-r--r--src/3rd_party/dbus-1.7.8/m4/tp-compiler-warnings.m449
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/missing215
-rw-r--r--src/3rd_party/dbus-1.7.8/test/Makefile.am375
-rw-r--r--src/3rd_party/dbus-1.7.8/test/Makefile.in1648
-rw-r--r--src/3rd_party/dbus-1.7.8/test/corrupt.c397
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-client-successful.auth-script16
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-server-successful.auth-script13
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/cancel.auth-script19
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/client-out-of-mechanisms.auth-script7
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/external-failed.auth-script11
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/external-root.auth-script11
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/external-silly.auth-script12
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/external-successful.auth-script12
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/extra-bytes.auth-script10
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/fail-after-n-attempts.auth-script34
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/fallback.auth-script17
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command-client.auth-script8
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command.auth-script7
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/invalid-hex-encoding.auth-script6
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/auth/mechanisms.auth-script8
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-1.conf25
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-2.conf5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic.d/basic.conf13
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/basic.d/basic.conf13
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-1.conf14
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-2.conf5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/incomplete-messages/missing-body.message19
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-1.conf10
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-2.conf10
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-1.conf4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-2.conf4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-3.conf4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/not-well-formed.conf5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/truncated-file.conf9
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-of-nil.message31
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-with-mixed-types.message52
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean-array.message27
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean.message22
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-endian.message25
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-header-field-alignment.message38
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/boolean-has-no-value.message-rawbin102 -> 0 bytes
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/local-namespace.message21
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/no-dot-in-name.message19
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/not-nul-header-padding.message25
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/overlong-name.message20
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-little-header-padding.message24
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding-by-far.message26
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding.message23
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-short-dict.message28
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in3
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/sha-1/Readme.txt83
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-hashes.sha11239
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-messages.sha14009
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-hashes.sha1343
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-messages.sha12294
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-fail.conf.in17
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-pass.conf.in17
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.conf32
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.d/basic.conf13
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all-sha1.conf.in16
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all.conf.in15
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/entities.conf14
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/incoming-limit.conf.in18
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/many-rules.conf61
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-config-files/system.d/test.conf20
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/array-of-array-of-uint32.message33
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict-simple.message15
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict.message47
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/emptiness.message63
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/lots-of-arguments.message65
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/no-padding.message22
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/opposite-endian.message30
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/recursive-types.message99
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest-manual.message30
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest.message10
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-acquire-service.message26
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-hello.message22
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-list-services.message22
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-service-exists.message24
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-messages/unknown-header-field.message19
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in5
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in3
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in3
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in3
-rw-r--r--src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in4
-rw-r--r--src/3rd_party/dbus-1.7.8/test/dbus-daemon-eavesdrop.c562
-rw-r--r--src/3rd_party/dbus-1.7.8/test/dbus-daemon.c502
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/test/dbus-test-runner43
-rw-r--r--src/3rd_party/dbus-1.7.8/test/internals/printf.c88
-rw-r--r--src/3rd_party/dbus-1.7.8/test/internals/refs.c607
-rw-r--r--src/3rd_party/dbus-1.7.8/test/internals/syslog.c99
-rw-r--r--src/3rd_party/dbus-1.7.8/test/loopback.c282
-rw-r--r--src/3rd_party/dbus-1.7.8/test/manual-authz.c409
-rw-r--r--src/3rd_party/dbus-1.7.8/test/marshal.c273
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/Makefile.am46
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in797
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/test/name-test/run-test-systemserver.sh51
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/test/name-test/run-test.sh60
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-activation-forking.py60
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-autolaunch.c53
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-ids.c56
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-dispatch.c124
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-timeout.c103
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-privserver-client.c168
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-privserver.c123
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-shutdown.c68
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/test-threads-init.c184
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/test/name-test/test-wait-for-echo.py41
-rw-r--r--src/3rd_party/dbus-1.7.8/test/name-test/tmp-session-like-system.conf91
-rw-r--r--src/3rd_party/dbus-1.7.8/test/relay.c327
-rw-r--r--src/3rd_party/dbus-1.7.8/test/shell-test.c109
-rw-r--r--src/3rd_party/dbus-1.7.8/test/spawn-test.c42
-rw-r--r--src/3rd_party/dbus-1.7.8/test/syntax.c291
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-exit.c9
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-names.c78
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-segfault.c30
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-service.c505
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-shell-service.c203
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-sleep-forever.c22
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-utils.c392
-rw-r--r--src/3rd_party/dbus-1.7.8/test/test-utils.h38
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/Makefile.am88
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/Makefile.in785
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-cleanup-sockets.c448
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-launch-win.c171
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-launch-x11.c468
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-launch.c1325
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-launch.h57
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-monitor.c423
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-print-message.c409
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-print-message.h31
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-run-session.c464
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-send.c591
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/dbus-uuidgen.c161
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/lcov.am43
-rwxr-xr-xsrc/3rd_party/dbus-1.7.8/tools/run-with-tmp-session-bus.sh62
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/strtoll.c167
-rw-r--r--src/3rd_party/dbus-1.7.8/tools/strtoull.c145
-rw-r--r--src/3rd_party/dbus-cmake/CMakeLists.txt98
-rw-r--r--src/3rd_party/iap.armv7-qnx.runtime.tar.bz2bin21769 -> 0 bytes
-rw-r--r--src/3rd_party/iap.build.tar.bz2bin19659 -> 0 bytes
-rw-r--r--src/appMain/CMakeLists.txt87
-rw-r--r--src/appMain/audio.8bit.wavbin88244 -> 44144 bytes
-rwxr-xr-xsrc/appMain/hmi_capabilities.json1383
-rw-r--r--src/appMain/life_cycle.cc450
-rw-r--r--src/appMain/life_cycle.h117
-rw-r--r--src/appMain/life_cycle_impl.cc352
-rw-r--r--src/appMain/life_cycle_impl.h113
-rw-r--r--src/appMain/low_voltage_signals_handler.cc165
-rw-r--r--src/appMain/low_voltage_signals_handler.h132
-rw-r--r--src/appMain/main.cc70
-rw-r--r--src/appMain/sample_policy_manager.py123
-rw-r--r--src/appMain/sdl_preloaded_pt.json114
-rw-r--r--src/appMain/signal_handlers.cc4
-rw-r--r--src/appMain/smartDeviceLink.ini124
-rw-r--r--src/appMain/start.sh2
-rw-r--r--src/appMain/start_external_proprietary.sh21
-rw-r--r--src/appMain/test/CMakeLists.txt46
-rw-r--r--src/appMain/test/low_voltage_signals_handler_test.cc138
-rw-r--r--src/appMain/test/mock_life_cycle.h54
-rw-r--r--src/components/CMakeLists.txt6
-rw-r--r--src/components/application_manager/CMakeLists.txt290
-rw-r--r--src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox76
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h79
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/apps_launcher.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h34
-rw-r--r--src/components/application_manager/include/application_manager/application.h231
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h36
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h214
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h895
-rw-r--r--src/components/application_manager/include/application_manager/command_factory.h216
-rw-r--r--src/components/application_manager/include/application_manager/command_holder.h84
-rw-r--r--src/components/application_manager/include/application_manager/command_holder_impl.h111
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h24
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h8
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h139
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_response_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h31
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h83
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h79
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h64
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h60
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h79
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h97
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h63
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h110
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h93
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h160
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h106
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_request.h157
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h176
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h265
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h110
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h84
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h100
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/generic_response.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h87
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h83
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h152
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h241
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h199
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h144
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h96
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h112
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h154
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h87
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_request.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h100
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h152
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h127
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h98
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/notification_from_hmi.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/notification_to_hmi.h63
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_hmi.h100
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_to_hmi.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_from_hmi.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_to_hmi.h66
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager.h96
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager_impl.h197
-rw-r--r--src/components/application_manager/include/application_manager/helpers/application_helper.h87
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h93
-rw-r--r--src/components/application_manager/include/application_manager/hmi_command_factory.h64
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h3
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h159
-rw-r--r--src/components/application_manager/include/application_manager/message.h38
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h264
-rw-r--r--src/components/application_manager/include/application_manager/mobile_command_factory.h67
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h2
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h125
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h83
-rw-r--r--src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h79
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h2
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h265
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h4
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h9
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h64
-rw-r--r--src/components/application_manager/include/application_manager/request_tracker.h2
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h49
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h133
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h33
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h22
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_json.h14
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h7
-rw-r--r--src/components/application_manager/include/application_manager/rpc_handler_impl.h182
-rw-r--r--src/components/application_manager/include/application_manager/rpc_service_impl.h149
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h91
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h84
-rw-r--r--src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h160
-rw-r--r--src/components/application_manager/include/application_manager/telemetry_observer.h10
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h8
-rw-r--r--src/components/application_manager/rpc_plugins/CMakeLists.txt34
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt80
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h70
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h72
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h68
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h69
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h96
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h101
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h67
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h137
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h60
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h172
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h86
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h86
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h122
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h94
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h88
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h96
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h278
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h113
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h178
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h224
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc58
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc57
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc71
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc290
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc379
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc56
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc778
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc25
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc268
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc158
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc250
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc141
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc507
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt77
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt62
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc326
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc593
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc152
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc248
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc234
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h54
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h74
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc160
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc668
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h114
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h169
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h110
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h154
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h191
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h278
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h119
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h109
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h92
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h91
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h189
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h251
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h224
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h149
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h116
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h158
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h94
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc58
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc93
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc230
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc192
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc193
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc182
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc142
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc124
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc68
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc113
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc101
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc69
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc294
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc59
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc81
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc627
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc186
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc291
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc453
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc684
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc483
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc235
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc132
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc203
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc143
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc116
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc60
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc191
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc199
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc87
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc229
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc453
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc1068
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc324
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc1429
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc131
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc336
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc163
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc108
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc284
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc301
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc173
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc568
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc166
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc292
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc413
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc207
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc184
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc123
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc700
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc48
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc126
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc74
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc117
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc243
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc847
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc442
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt37
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc123
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc76
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc95
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc72
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc112
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc73
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc540
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc98
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc88
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc334
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc1856
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc100
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc216
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc120
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc105
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc159
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc176
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc131
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc500
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc85
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc111
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc160
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc78
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc96
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc265
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc324
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc103
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc102
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc97
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc311
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc122
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc199
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc171
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc86
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc106
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc122
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc182
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc1154
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc158
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc256
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc809
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc559
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc923
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc272
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc250
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc296
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc375
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc187
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc315
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc120
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc282
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc145
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc337
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc137
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc284
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc166
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc167
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc273
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc138
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc148
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc115
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc834
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc261
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc406
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc536
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc575
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc285
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc164
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc421
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc173
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc249
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc1375
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc365
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc974
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc99
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc189
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc340
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc406
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc263
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc130
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc236
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc201
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc171
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc352
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt72
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h81
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h93
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h77
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h82
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h88
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h85
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h78
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h158
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h120
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h80
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h135
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h73
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h82
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc75
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc89
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc112
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc62
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc130
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc119
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc147
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc136
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc134
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc360
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc287
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc125
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc156
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc144
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc167
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt64
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc153
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc169
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc185
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc142
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc256
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc114
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc164
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc301
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc114
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc3
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc5
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc12
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_sql_queries.cc2
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc7
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc122
-rw-r--r--src/components/application_manager/src/application_data_impl.cc92
-rw-r--r--src/components/application_manager/src/application_impl.cc313
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc2543
-rw-r--r--src/components/application_manager/src/application_state.cc1
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc142
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc77
-rw-r--r--src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/command_notification_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc401
-rw-r--r--src/components/application_manager/src/commands/command_response_impl.cc15
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_request.cc69
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_response.cc64
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc31
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc68
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/dial_number_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/dial_number_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_response.cc84
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc229
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc176
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc79
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc176
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc25
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_from_hmi.cc101
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_to_hmi.cc67
-rw-r--r--src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc92
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_event_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_press_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc115
-rw-r--r--src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc92
-rw-r--r--src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc114
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc105
-rw-r--r--src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_find_applications.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_policy_update.cc51
-rw-r--r--src/components/application_manager/src/commands/hmi/on_put_file_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ready_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc69
-rw-r--r--src/components/application_manager/src/commands/hmi/on_record_start_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_status_update_notification.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_context_notification.cc79
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_error_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc117
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc93
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc29
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc92
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_update_device_list.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc104
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc91
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc108
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc89
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/response_to_hmi.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc285
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc87
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc50
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_response.cc71
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc86
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_response.cc72
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_request.cc94
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc80
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc103
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_response.cc72
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc106
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc611
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc157
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc241
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc426
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc597
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc440
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc216
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc114
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc157
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc188
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc119
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_request.cc145
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_response.cc53
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc88
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/generic_response.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc108
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc304
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_request.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc107
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc51
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc174
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc181
-rw-r--r--src/components/application_manager/src/commands/mobile/on_command_notification.cc78
-rw-r--r--src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc86
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc119
-rw-r--r--src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc87
-rw-r--r--src/components/application_manager/src/commands/mobile/on_language_change_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc194
-rw-r--r--src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc70
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc70
-rw-r--r--src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc112
-rw-r--r--src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc370
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc950
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_request.cc272
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_response.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc123
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc1154
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc99
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc337
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc153
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_response.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc274
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc277
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc112
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_response.cc55
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc559
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_request.cc139
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_response.cc55
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc155
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc283
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc343
-rw-r--r--src/components/application_manager/src/commands/mobile/show_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc197
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc159
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc150
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_response.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc454
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc79
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/system_request.cc653
-rw-r--r--src/components/application_manager/src/commands/mobile/system_response.cc54
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc47
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc91
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc406
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc72
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc233
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_response.cc56
-rw-r--r--src/components/application_manager/src/commands/notification_from_hmi.cc111
-rw-r--r--src/components/application_manager/src/commands/notification_to_hmi.cc74
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc115
-rw-r--r--src/components/application_manager/src/commands/request_to_hmi.cc97
-rw-r--r--src/components/application_manager/src/commands/response_from_hmi.cc114
-rw-r--r--src/components/application_manager/src/commands/response_to_hmi.cc71
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc12
-rw-r--r--src/components/application_manager/src/help_prompt_manager_impl.cc388
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc129
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc235
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc2259
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc21
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc12
-rw-r--r--src/components/application_manager/src/hmi_state.cc168
-rw-r--r--src/components/application_manager/src/message.cc60
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc1457
-rw-r--r--src/components/application_manager/src/mobile_command_factory.cc702
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc33
-rw-r--r--src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc111
-rw-r--r--src/components/application_manager/src/policies/delegates/app_permission_delegate.cc18
-rw-r--r--src/components/application_manager/src/policies/delegates/statistics_delegate.cc12
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc9
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc728
-rw-r--r--src/components/application_manager/src/policies/policy_retry_sequence.cc1
-rw-r--r--src/components/application_manager/src/request_controller.cc71
-rw-r--r--src/components/application_manager/src/request_info.cc23
-rw-r--r--src/components/application_manager/src/request_tracker.cc15
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc507
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc16
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc122
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc76
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc42
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc426
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc629
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc85
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc577
-rw-r--r--src/components/application_manager/src/system_time/system_time_handler_impl.cc174
-rw-r--r--src/components/application_manager/src/usage_statistics.cc7
-rwxr-xr-x[-rw-r--r--]src/components/application_manager/test/CMakeLists.txt38
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc14
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc10
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc44
-rw-r--r--src/components/application_manager/test/application_helper_test.cc260
-rw-r--r--src/components/application_manager/test/application_impl_test.cc190
-rw-r--r--src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc274
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc1286
-rw-r--r--src/components/application_manager/test/application_state_test.cc113
-rw-r--r--src/components/application_manager/test/command_holder_test.cc176
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt23
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc57
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc256
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc27
-rw-r--r--src/components/application_manager/test/commands/hmi/activate_app_request_test.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.cc1926
-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.cc285
-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.cc132
-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.cc183
-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.cc2
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc369
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json1085
-rw-r--r--src/components/application_manager/test/hmi_capabilities_sc1.json9
-rw-r--r--src/components/application_manager/test/hmi_capabilities_sc2.json14
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc227
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc35
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h115
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h81
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_helper.h57
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_command_factory.h61
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h61
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h27
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h71
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h13
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h6
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h27
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt2
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc316
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc35
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc13
-rw-r--r--src/components/application_manager/test/mock_application_helper.cc55
-rw-r--r--src/components/application_manager/test/mock_hmi_command_factory.cc58
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc127
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc1099
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc401
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc48
-rw-r--r--src/components/application_manager/test/request_info_test.cc127
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc787
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc66
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc61
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc26
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc239
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json19
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json21
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc499
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc19
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc2
-rw-r--r--src/components/config_profile/include/config_profile/profile.h218
-rw-r--r--src/components/config_profile/src/ini_file.cc10
-rw-r--r--src/components/config_profile/src/profile.cc506
-rw-r--r--src/components/config_profile/test/profile_test.cc26
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h74
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h183
-rw-r--r--src/components/connection_handler/include/connection_handler/device.h5
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h4
-rw-r--r--src/components/connection_handler/src/connection.cc183
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc704
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc21
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc1077
-rw-r--r--src/components/connection_handler/test/connection_test.cc217
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc226
-rw-r--r--src/components/dbus/CMakeLists.txt83
-rw-r--r--src/components/dbus/codegen/code_formatter.py58
-rw-r--r--src/components/dbus/codegen/ford_xml_parser.py231
-rwxr-xr-xsrc/components/dbus/codegen/make_hmi_requests.py343
-rwxr-xr-xsrc/components/dbus/codegen/make_introspection_c.py126
-rwxr-xr-xsrc/components/dbus/codegen/make_message_descriptions.py273
-rwxr-xr-xsrc/components/dbus/codegen/make_notifications_qml.py387
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_cpp.py736
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_qml.py217
-rw-r--r--src/components/dbus/codegen/make_qml_requests_cpp.py253
-rwxr-xr-xsrc/components/dbus/codegen/make_request_to_sdl.py335
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h374
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h179
-rw-r--r--src/components/dbus/include/dbus/dbus_message_controller.h84
-rw-r--r--src/components/dbus/include/dbus/dbus_message_inl.h214
-rw-r--r--src/components/dbus/include/dbus/message_descriptions.h73
-rw-r--r--src/components/dbus/include/dbus/schema.h98
-rw-r--r--src/components/dbus/src/dbus_adapter.cc933
-rw-r--r--src/components/dbus/src/dbus_message.cc217
-rw-r--r--src/components/dbus/src/dbus_message_controller.cc81
-rw-r--r--src/components/dbus/src/schema.cc145
-rw-r--r--src/components/dbus/test/CMakeLists.txt52
-rw-r--r--src/components/dbus/test/dbus_adapter_test.cc59
-rw-r--r--src/components/dbus/test/dbus_message_controller_test.cc116
-rw-r--r--src/components/dbus/test/schema_test.cc118
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.h12
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h30
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h44
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h62
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h46
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h16
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h18
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cc34
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cc10
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cc10
-rw-r--r--src/components/formatters/src/CSmartFactory.cc34
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc57
-rw-r--r--src/components/formatters/src/generic_json_formatter.cc16
-rw-r--r--src/components/formatters/src/meta_formatter.cc10
-rw-r--r--src/components/formatters/test/CFormatterJsonBase_test.cc4
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc84
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc21
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc25
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc10
-rw-r--r--src/components/formatters/test/generic_json_formatter_test.cc8
-rw-r--r--src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h14
-rw-r--r--src/components/formatters/test/include/formatters/create_smartSchema.h6
-rw-r--r--src/components/formatters/test/include/formatters/meta_formatter_test_helper.h14
-rw-r--r--src/components/formatters/test/meta_formatter_test.cc43
-rw-r--r--src/components/formatters/test/src/SmartFactoryTestHelper.cc31
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc7
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc31
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt18
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h98
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h19
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h186
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h9
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h208
-rw-r--r--src/components/hmi_message_handler/mock_hmi_message_handler.h4
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc222
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc3
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc504
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc15
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc322
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt21
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc12
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc15
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h76
-rw-r--r--src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h62
-rw-r--r--src/components/hmi_message_handler/test/mock_subscriber.cc71
-rw-r--r--src/components/include/application_manager/application_manager.h225
-rw-r--r--src/components/include/application_manager/application_manager_settings.h14
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h90
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h197
-rw-r--r--src/components/include/application_manager/policies/policy_handler_observer.h4
-rw-r--r--src/components/include/application_manager/rpc_handler.h60
-rw-r--r--src/components/include/application_manager/rpc_service.h90
-rw-r--r--src/components/include/application_manager/state_controller.h17
-rw-r--r--src/components/include/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/include/connection_handler/connection_handler.h96
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h56
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_adapter.h6
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler_settings.h2
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h7
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h3
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h72
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h228
-rw-r--r--src/components/include/policy/policy_external/policy/policy_settings.h2
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h8
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h42
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h152
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h220
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_settings.h2
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_types.h338
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h50
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h42
-rw-r--r--src/components/include/protocol/bson_object_keys.h54
-rw-r--r--src/components/include/protocol/common.h27
-rw-r--r--src/components/include/protocol/raw_message.h4
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h30
-rw-r--r--src/components/include/protocol_handler/protocol_handler_settings.h29
-rw-r--r--src/components/include/protocol_handler/session_observer.h118
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h10
-rw-r--r--src/components/include/rpc_base/validation_report.h125
-rw-r--r--src/components/include/security_manager/crypto_manager.h13
-rw-r--r--src/components/include/security_manager/security_manager.h67
-rw-r--r--src/components/include/security_manager/security_manager_listener.h18
-rw-r--r--src/components/include/security_manager/security_manager_settings.h14
-rw-r--r--src/components/include/security_manager/security_query.h4
-rw-r--r--src/components/include/security_manager/ssl_context.h14
-rw-r--r--src/components/include/test/application_manager/mock_app_extension.h62
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h133
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h12
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin.h30
-rw-r--r--src/components/include/test/application_manager/mock_rpc_plugin_manager.h24
-rw-r--r--src/components/include/test/application_manager/mock_rpc_service.h34
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h17
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h85
-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.h28
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h20
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h2
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h4
-rw-r--r--src/components/include/test/media_manager/mock_media_manager.h2
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h266
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h23
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h52
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h229
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h102
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h56
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h9
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler_settings.h15
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h33
-rw-r--r--src/components/include/test/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/include/test/security_manager/mock_crypto_manager.h4
-rw-r--r--src/components/include/test/security_manager/mock_security_manager.h12
-rw-r--r--src/components/include/test/security_manager/mock_security_manager_listener.h2
-rw-r--r--src/components/include/test/security_manager/mock_security_manager_settings.h4
-rw-r--r--src/components/include/test/security_manager/mock_ssl_context.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h6
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h4
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h9
-rw-r--r--src/components/include/test/utils/mock_system_time_handler.h69
-rw-r--r--src/components/include/test/utils/test_async_waiter.h4
-rw-r--r--src/components/include/transport_manager/common.h10
-rw-r--r--src/components/include/transport_manager/error.h4
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h34
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h61
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h27
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h26
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h25
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h18
-rw-r--r--src/components/include/utils/atomic_object.h112
-rw-r--r--src/components/include/utils/conditional_variable.h19
-rw-r--r--src/components/include/utils/data_accessor.h19
-rw-r--r--src/components/include/utils/date_time.h95
-rw-r--r--src/components/include/utils/lock.h153
-rw-r--r--src/components/include/utils/macro.h27
-rw-r--r--src/components/include/utils/make_shared.h191
-rw-r--r--src/components/include/utils/messagemeter.h35
-rw-r--r--src/components/include/utils/semantic_version.h124
-rw-r--r--src/components/include/utils/shared_ptr.h390
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h2
-rw-r--r--src/components/include/utils/typed_enum_print.h52
-rw-r--r--src/components/interfaces/CMakeLists.txt29
-rw-r--r--src/components/interfaces/HMI_API.xml1826
-rw-r--r--src/components/interfaces/Json_HMI_message_specification.txt7
-rw-r--r--src/components/interfaces/MOBILE_API.xml12382
-rw-r--r--src/components/interfaces/QT_HMI_API.xml4156
-rw-r--r--src/components/interfaces/v4_protocol_v1_2_no_extra.xml186
-rw-r--r--src/components/media_manager/CMakeLists.txt4
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h18
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h1
-rw-r--r--src/components/media_manager/include/media_manager/file_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_impl.h4
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h7
-rw-r--r--src/components/media_manager/include/media_manager/pipe_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/socket_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/streamer_adapter.h9
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc12
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc64
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_listener.cc5
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc77
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc43
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc8
-rw-r--r--src/components/media_manager/src/streamer_adapter.cc5
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h5
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc424
-rw-r--r--src/components/policy/policy_external/.gitignore8
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt1
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt34
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt12
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt10
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt8
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt60
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt8
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote.h139
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h174
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h152
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h140
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h173
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h993
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table.h7
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h411
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h52
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml10
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h155
-rw-r--r--src/components/policy/policy_external/include/policy/pt_ext_representation.h14
-rw-r--r--src/components/policy/policy_external/include/policy/pt_representation.h2
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h7
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h11
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_queries.h18
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h32
-rw-r--r--src/components/policy/policy_external/include/policy/status.h15
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h22
-rw-r--r--src/components/policy/policy_external/include/policy/usage_statistics/counter.h20
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc261
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc692
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc305
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc1002
-rw-r--r--src/components/policy/policy_external/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc494
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc207
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc104
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_queries.cc36
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc206
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc199
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc558
-rw-r--r--src/components/policy/policy_external/src/status.cc23
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc28
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_external/test/counter_test.cc19
-rw-r--r--src/components/policy/policy_external/test/generated_code_test.cc88
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h53
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_cache_manager.h241
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h3
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h3
-rw-r--r--src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h73
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json18
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json20
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json20
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json18
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json18
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json18
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json22
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json22
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json19
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json20
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc602
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc84
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc918
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc323
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc296
-rw-r--r--src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc557
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc22
-rw-r--r--src/components/policy/policy_external/test/update_status_manager_test.cc42
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt4
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote.h122
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h169
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h93
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h77
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h17
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_listener.h104
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h835
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h434
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h61
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h497
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_ext_representation.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_representation.h4
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h2
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_queries.h16
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h23
-rw-r--r--src/components/policy/policy_regular/include/policy/status.h15
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h35
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager_interface.h14
-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.h20
-rw-r--r--src/components/policy/policy_regular/policy_table_interface_ext.xml11
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc247
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc301
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc97
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc471
-rw-r--r--src/components/policy/policy_regular/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc787
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc137
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc111
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc140
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc453
-rw-r--r--src/components/policy/policy_regular/src/status.cc25
-rw-r--r--src/components/policy/policy_regular/src/update_status_manager.cc102
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt1
-rw-r--r--src/components/policy/policy_regular/test/PTU.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json18
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json18
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc95
-rw-r--r--src/components/policy/policy_regular/test/counter_test.cc18
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h214
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h81
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h183
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h4
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc157
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json22
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json22
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json19
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json20
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc52
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc25
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json20
-rw-r--r--src/components/protocol/src/bson_object_keys.cc24
-rw-r--r--src/components/protocol_handler/CMakeLists.txt12
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h123
-rw-r--r--src/components/protocol_handler/include/protocol_handler/multiframe_builder.h2
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h221
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h29
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc196
-rw-r--r--src/components/protocol_handler/src/incoming_data_handler.cc1
-rw-r--r--src/components/protocol_handler/src/multiframe_builder.cc10
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc1366
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc129
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc447
-rw-r--r--src/components/protocol_handler/test/multiframe_builder_test.cc12
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc2186
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc99
-rw-r--r--src/components/protocol_handler/test/protocol_packet_test.cc12
-rw-r--r--src/components/qt_hmi/CMakeLists.txt42
-rw-r--r--src/components/qt_hmi/Readme.txt7
-rw-r--r--src/components/qt_hmi/References/Look/.DS_Storebin15364 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttfbin246000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttfbin246040 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttfbin260780 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttfbin380840 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttfbin314564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttfbin332128 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/ImageHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml378
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml9
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml69
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml111
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml57
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayout.qml217
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml152
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ListLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml130
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml547
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/OffLayout.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml123
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml195
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/StartLayout.qml30
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml76
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml107
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayout.qml132
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml155
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml373
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject20
-rw-r--r--src/components/qt_hmi/References/Look/Resources/CButton.pngbin4607 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psdbin1111637 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.pngbin40425 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Map.pngbin335952 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.pngbin5760 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.pngbin10538 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.pngbin10625 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/compass.pngbin3528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.pngbin2892 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.pngbin2898 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIcon.pngbin3097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.pngbin3000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.pngbin2894 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/OButton.pngbin5287 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.pngbin2861 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.pngbin3859 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.pngbin3911 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.pngbin42473 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.pngbin5292 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.pngbin5251 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.pngbin5059 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/blueBall.pngbin2874 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.pngbin2850 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.pngbin13194 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.pngbin2866 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.pngbin11177 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.pngbin11472 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.pngbin11089 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.pngbin11325 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/albumArt.pngbin45068 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause.pngbin3276 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.pngbin12559 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.pngbin13816 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.pngbin12335 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/play_9_9.pngbin13219 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/cal.pngbin3699 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/folders.pngbin3337 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.pngbin4426 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/sun.pngbin4773 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.pngbin10154 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keySelected.pngbin4396 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.pngbin9590 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteActive.pngbin5614 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.pngbin4903 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.pngbin10510 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.pngbin11248 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.pngbin8915 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.pngbin4017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.pngbin8401 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.pngbin8107 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.pngbin3611 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.pngbin8490 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.pngbin5166 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.pngbin4264 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.pngbin13064 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.pngbin12252 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ring.pngbin10987 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/dn-arrow.pngbin1097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g136p.pngbin274 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g137p.pngbin357 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/arrow.pngbin3745 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/car.pngbin4114 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/gear.pngbin4806 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/notes.pngbin1962 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/phone.pngbin2528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/snow.pngbin3976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDoff.pngbin7073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDon.pngbin5564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/contacts.pngbin4036 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/keypad.pngbin3200 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/messages.pngbin2576 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/more.pngbin3447 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/recent.pngbin3104 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/texts.pngbin3917 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/scrollbar.pngbin1008 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/slider.pngbin1017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/up-arrow.pngbin1101 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/TextHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Views/AM.qml86
-rw-r--r--src/components/qt_hmi/References/Look/Views/AMPCA.qml122
-rw-r--r--src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml151
-rw-r--r--src/components/qt_hmi/References/Look/Views/AuxPCA.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/CDPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Chrome.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/ClimatePCA.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/ControlMirror.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/FM.qml94
-rw-r--r--src/components/qt_hmi/References/Look/Views/FMPCA.qml175
-rw-r--r--src/components/qt_hmi/References/Look/Views/GenListHandling.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml87
-rw-r--r--src/components/qt_hmi/References/Look/Views/Home.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Views/List.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavInRoute.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml159
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavMenu.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavNoRoute.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Views/Off.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Views/On.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml104
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhonePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Sirius.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Views/SiriusPCA.qml115
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChange.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml105
-rw-r--r--src/components/qt_hmi/References/Look/Views/Start.qml43
-rw-r--r--src/components/qt_hmi/References/Look/Views/USB.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Views/USBPCA.qml49
-rw-r--r--src/components/qt_hmi/References/Look/Views/iPodPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml25
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml56
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml22
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml97
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml143
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml95
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml325
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/BaseText.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/CondText.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml45
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml60
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml28
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton.qml77
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml18
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dllbin335360 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dllbin974848 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdbbin5516288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes682
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml40
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml8
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml35
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml43
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml104
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js12
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml14
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml25
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml51
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js132
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml28
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml56
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml41
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml19
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml15
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir35
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas64.pngbin3400 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas80.pngbin4945 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/README.md37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject19
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh8
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/load_env.sh1
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/main.cpp16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir2
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.pngbin4369 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.pngbin2975 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.pngbin6876 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.pngbin10475 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.pngbin16926 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.pngbin13849 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.pngbin4471 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.pngbin3848 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.pngbin49513 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.pngbin1035032 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.pngbin16044 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.pngbin5932 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.pngbin2890 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.pngbin8217 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.pngbin7355 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.pngbin6218 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.pngbin3072 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.pngbin5305 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.pngbin4473 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.pngbin5374 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.pngbin5073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.pngbin6456 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.pngbin3115 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.pngbin3992 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.pngbin4974 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.pngbin55017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.pngbin4821 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.pngbin6918 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.pngbin2826 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.pngbin4156 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.pngbin7277 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.pngbin4759 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.pngbin5748 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.pngbin3020 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.pngbin4517 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.pngbin9198 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.pngbin5831 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.pngbin5807 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.pngbin3092 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.pngbin8684 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.pngbin6611 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.pngbin395 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.pngbin7897 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.pngbin5832 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.pngbin3149 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.pngbin6570 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.pngbin5976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.pngbin3592 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.pngbin31003 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.pngbin4741 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.pngbin7070 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.pngbin7500 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.pngbin4767 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.pngbin8214 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.pngbin4698 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml32
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml36
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml24
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml7
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml129
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml43
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml30
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml5
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml72
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml14
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swpbin12288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swpbin12288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml64
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml63
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml57
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml205
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml20
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml23
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml62
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml60
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml68
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml144
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml51
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml133
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml49
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml17
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml79
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp64
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h33
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro48
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp456
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h98
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp749
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h181
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro21
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj328
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp30
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h14
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp3
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h16
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp4
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h47
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp386
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h80
-rw-r--r--src/components/qt_hmi/qml_model_qt4/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/MainWindow.qml356
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml143
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml134
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml240
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml104
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml127
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml115
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml449
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml749
-rw-r--r--src/components/qt_hmi/qml_model_qt4/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml57
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml91
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Constants.js249
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml510
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml58
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Internal.js163
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml52
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml285
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml81
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml149
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml214
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml111
-rw-r--r--src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml123
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml173
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml325
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml194
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml120
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml216
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml284
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml201
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_model_qt5/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/MainWindow.qml462
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml133
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml97
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml187
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml38
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml203
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml730
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml170
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml764
-rw-r--r--src/components/qt_hmi/qml_model_qt5/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml59
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Constants.js250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml660
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Internal.js176
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml117
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml50
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml401
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml290
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml153
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml150
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml217
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml110
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml113
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml158
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml126
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml302
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml117
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml179
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml181
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml293
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml202
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_plugins/CMakeLists.txt41
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt164
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc95
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h67
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc97
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h69
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc45
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h63
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h61
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h90
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h259
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h48
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc68
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h42
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt85
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc39
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h64
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc58
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h58
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc153
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h89
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h48
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt86
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc108
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h78
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt84
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc60
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h67
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc52
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h59
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h48
-rw-r--r--src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST2
-rw-r--r--src/components/qt_hmi/res/SPT.pngbin11718 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/album_art.pngbin45068 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/app_911_assist.pngbin6982 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/app_vehicle_info.pngbin4842 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/apps.pngbin5957 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/arrow.pngbin3745 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/blue_ball.pngbin2874 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_btn.pngbin5251 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_pressed_btn.pngbin5042 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn.pngbin5292 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.pngbin4977 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_bottom.pngbin2817 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_left.pngbin3893 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_left.pngbin3735 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_right.pngbin3755 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_right.pngbin3881 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_top.pngbin2814 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_btn.pngbin11472 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_pressed_btn.pngbin11177 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_btn.pngbin6666 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_pressed_btn.pngbin6268 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_btn.pngbin13219 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_pressed_btn.pngbin12335 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_btn.pngbin11325 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_pressed_btn.pngbin11089 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_btn.pngbin8401 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_pressed_btn.pngbin8915 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_btn.pngbin9590 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_pressed_btn.pngbin10154 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn.pngbin5059 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn_pressed.pngbin4733 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom.pngbin8490 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom_pressed.pngbin8107 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/car.pngbin4114 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/change_devices.pngbin5188 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_off.pngbin3566 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_on.pngbin3871 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_off_btn.pngbin12252 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_on_btn.pngbin13064 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_off.pngbin3887 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_on.pngbin3509 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_off.pngbin3593 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_on.pngbin3931 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_off.pngbin3568 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_on.pngbin3878 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_off.pngbin3638 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_on.pngbin3326 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_off.pngbin3967 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_on.pngbin4406 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_off.pngbin3807 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_on.pngbin4272 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton.pngbin4688 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton_pressed.pngbin4612 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton.pngbin5170 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton_pressed.pngbin5269 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton.pngbin4497 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton_pressed.pngbin4622 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton.pngbin5242 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton_pressed.pngbin5138 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton.pngbin4553 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton_pressed.pngbin4681 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/backGroundControllButtons.pngbin3157 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton.pngbin5429 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton_pressed.pngbin6165 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrImage.pngbin2461 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/find_apps.pngbin4085 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/gear.pngbin4806 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_off.pngbin3543 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_on.pngbin3609 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/initial.wavbin46834 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/install_apps.pngbin6517 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/compass.pngbin3552 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/current_street.pngbin5491 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon.pngbin2892 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon_black.pngbin2898 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon.pngbin3097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon_black.pngbin3000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/map.pngbin332637 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_off.pngbin11248 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_on.pngbin4334 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options.pngbin10625 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_in_active.pngbin5760 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_pressed.pngbin10538 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/turnArrow.pngbin2894 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/notes.pngbin1962 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/contacts.pngbin4036 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_off.pngbin7073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_on.pngbin5564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/keypad.pngbin3200 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/messages.pngbin2576 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/more.pngbin3447 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/phone.pngbin2528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/recent.pngbin3104 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/texts.pngbin3917 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/snow.pngbin3976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/cal.pngbin3699 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/folders.pngbin3337 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/key_car.pngbin4426 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/sun.pngbin4773 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/warning.pngbin7546 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/white_ball.pngbin2866 -> 0 bytes
-rw-r--r--src/components/qt_hmi/test/CMakeLists.txt67
-rw-r--r--src/components/qt_hmi/test/qt_hmi_test.cc33
-rw-r--r--src/components/qt_hmi/test/readme.txt14
-rw-r--r--src/components/qt_hmi/test/src/tst_AddCommand.qml320
-rw-r--r--src/components/qt_hmi/test/src/tst_AddSubMenu.qml328
-rw-r--r--src/components/qt_hmi/test/src/tst_DeleteCommand.qml210
-rw-r--r--src/components/qt_hmi/test/src/tst_ScrollableMessage.qml421
-rw-r--r--src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml292
-rw-r--r--src/components/qt_hmi/test/src/tst_Show.qml363
-rw-r--r--src/components/qt_hmi/test/src/tst_Slider.qml204
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h24
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h501
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h6
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h3
-rw-r--r--src/components/rpc_base/include/rpc_base/validation_report.h122
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt14
-rw-r--r--src/components/rpc_base/test/rpc_base_dbus_test.cc682
-rw-r--r--src/components/rpc_base/test/rpc_base_test.cc22
-rw-r--r--src/components/rpc_base/test/validation_report_test.cc2
-rw-r--r--src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox241
-rw-r--r--src/components/security_manager/docs/SDL.SDD.Security.dox241
-rw-r--r--src/components/security_manager/docs/assets/sm_class_diagram.png (renamed from src/components/security_manager/docs/assets/sm_class_digram.png)bin368935 -> 368935 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png)bin28014 -> 28014 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png)bin22326 -> 22326 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_init.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_init.png)bin119018 -> 119018 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_verify.png)bin39820 -> 39820 bytes
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h87
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h29
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h99
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc319
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc214
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc228
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc74
-rw-r--r--src/components/security_manager/test/security_manager_test.cc320
-rw-r--r--src/components/security_manager/test/ssl_certificate_handshake_test.cc368
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc275
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h21
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h21
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/bool_schema_item.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h35
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h195
-rw-r--r--src/components/smart_objects/include/smart_objects/errors.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h73
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h59
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h38
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item_parameter.h8
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h51
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h27
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h22
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc21
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc19
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc60
-rw-r--r--src/components/smart_objects/src/bool_schema_item.cc12
-rw-r--r--src/components/smart_objects/src/number_schema_item.cc10
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc148
-rw-r--r--src/components/smart_objects/src/schema_item.cc18
-rw-r--r--src/components/smart_objects/src/smart_object.cc19
-rw-r--r--src/components/smart_objects/src/smart_schema.cc20
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc41
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc39
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc39
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc186
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc100
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc196
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc69
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc424
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc57
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc8
-rw-r--r--src/components/smart_objects/test/SmartObjectInvalid_test.cc4
-rw-r--r--src/components/smart_objects/test/SmartObjectStress_test.cc14
-rw-r--r--src/components/smart_objects/test/SmartObjectUnit_test.cc2
-rw-r--r--src/components/smart_objects/test/StringSchemaItem_test.cc151
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc2
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt1
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h12
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h3
-rw-r--r--src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc7
-rw-r--r--src/components/telemetry_monitor/src/application_manager_observer.cc6
-rw-r--r--src/components/telemetry_monitor/src/metric_wrapper.cc1
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_observer.cc10
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc27
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_observer.cc14
-rw-r--r--src/components/telemetry_monitor/test/CMakeLists.txt2
-rw-r--r--src/components/telemetry_monitor/test/application_manager_metric_test.cc49
-rw-r--r--src/components/telemetry_monitor/test/application_manager_observer_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h3
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_metric_test.cc34
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_observer_test.cc14
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc13
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_metric_test.cc32
-rw-r--r--src/components/test_main.cc4
-rw-r--r--src/components/transport_manager/CMakeLists.txt33
-rw-r--r--src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h183
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h41
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h63
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h201
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h70
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h48
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_device.h12
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h25
-rw-r--r--src/components/transport_manager/include/transport_manager/telemetry_observer.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/connection.h3
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h42
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h17
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h38
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h178
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/common.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h1
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device.h2
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc8
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc14
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc4
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc186
-rw-r--r--src/components/transport_manager/src/tcp/network_interface_listener_impl.cc42
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc673
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc38
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc572
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/tcp/tcp_device.cc17
-rw-r--r--src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc2
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc35
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc3
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc100
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc203
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc21
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc407
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc22
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc4
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc21
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt9
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h34
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h5
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h4
-rw-r--r--src/components/transport_manager/test/network_interface_listener_test.cc57
-rw-r--r--src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc567
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc499
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc71
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc164
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc119
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc56
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc629
-rw-r--r--src/components/utils/CMakeLists.txt15
-rw-r--r--src/components/utils/include/utils/file_system.h231
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h10
-rw-r--r--src/components/utils/include/utils/optional.h83
-rw-r--r--src/components/utils/include/utils/signals.h54
-rw-r--r--src/components/utils/include/utils/system_time_handler.h151
-rw-r--r--src/components/utils/include/utils/timer.h2
-rw-r--r--src/components/utils/src/conditional_variable_boost.cc135
-rw-r--r--src/components/utils/src/conditional_variable_posix.cc149
-rw-r--r--src/components/utils/src/date_time.cc123
-rw-r--r--src/components/utils/src/file_system.cc346
-rw-r--r--src/components/utils/src/lock_boost.cc127
-rw-r--r--src/components/utils/src/lock_posix.cc146
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc5
-rw-r--r--src/components/utils/src/logger.cc3
-rw-r--r--src/components/utils/src/semantic_version.cc38
-rw-r--r--src/components/utils/src/signals_posix.cc44
-rw-r--r--src/components/utils/src/system_time_handler.cc62
-rw-r--r--src/components/utils/src/threads/thread_delegate.cc1
-rw-r--r--src/components/utils/src/timer.cc2
-rw-r--r--src/components/utils/test/async_runner_test.cc110
-rw-r--r--src/components/utils/test/atomic_object_test.cc57
-rw-r--r--src/components/utils/test/conditional_variable_test.cc11
-rw-r--r--src/components/utils/test/data_accessor_test.cc36
-rw-r--r--src/components/utils/test/date_time_test.cc331
-rw-r--r--src/components/utils/test/file_system_test.cc11
-rw-r--r--src/components/utils/test/generated_code_with_sqlite_test.cc6
-rw-r--r--src/components/utils/test/include/utils/mock_signals_posix.h59
-rw-r--r--src/components/utils/test/lock_boost_test.cc103
-rw-r--r--src/components/utils/test/lock_posix_test.cc123
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc2
-rw-r--r--src/components/utils/test/message_queue_test.cc3
-rw-r--r--src/components/utils/test/messagemeter_test.cc52
-rw-r--r--src/components/utils/test/mock_signals_posix.cc76
-rw-r--r--src/components/utils/test/policy.sql32
-rw-r--r--src/components/utils/test/scope_guard_test.cc18
-rw-r--r--src/components/utils/test/shared_ptr_test.cc542
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_query_test.cc4
-rw-r--r--third_party.md104
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/InterfaceGenerator/MsgVersionGenerate.py34
-rwxr-xr-xtools/InterfaceGenerator/generator/Model.py58
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryBase.py334
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py30
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py10
-rwxr-xr-xtools/InterfaceGenerator/generator/parsers/RPCBase.py166
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py48
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py10
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc78
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h22
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc58
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h22
-rwxr-xr-xtools/Utils/generate_test_certificates.py31
-rw-r--r--tools/cmake/modules/FindQt5DBus.cmake10
-rwxr-xr-xtools/infrastructure/check_style.sh15
-rw-r--r--tools/intergen/GenerateInterfaceLibrary.cmake10
-rw-r--r--tools/intergen/cppgen/CMakeLists.txt2
-rw-r--r--tools/intergen/cppgen/include/cppgen/generator_preferences.h5
-rw-r--r--tools/intergen/cppgen/include/cppgen/message_factory_function.h3
-rw-r--r--tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h88
-rw-r--r--tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc3
-rw-r--r--tools/intergen/cppgen/src/cppgen/declaration_generator.cc38
-rw-r--r--tools/intergen/cppgen/src/cppgen/definition_generator.cc29
-rw-r--r--tools/intergen/cppgen/src/cppgen/generator_preferences.cc9
-rw-r--r--tools/intergen/cppgen/src/cppgen/handler_interface.cc4
-rw-r--r--tools/intergen/cppgen/src/cppgen/message_factory_function.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/module_manager.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc177
-rw-r--r--tools/intergen/model/src/model/composite_type.cc1
-rw-r--r--tools/intergen/test/CMakeLists.txt23
-rw-r--r--tools/intergen/test/generated_interface_dbus_tests.cc127
-rw-r--r--tools/intergen/test/generated_interface_json_tests.cc6
-rw-r--r--tools/intergen/test/test_hmi_interface.xml1141
-rw-r--r--tools/intergen/tool/intergen.cc7
3793 files changed, 175271 insertions, 467459 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000000..672768add7
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Contributing to SDL Projects
+
+Third party contributions are essential for making SDL great. However, we do have a few guidelines we need contributors to follow.
+
+## Environment
+Currently supported:
+* Ubuntu Linux 14.04 with GCC 4.9.x
+* Ubuntu Linux 16.04 with GCC 5.4.x
+* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)
+
+### Issues
+If writing a bug report, please make sure [you follow the issue template](https://github.com/smartdevicelink/sdl_core/blob/master/.github/ISSUE_TEMPLATE.md). Include all relevant information.
+
+If requesting a feature, understand that we appreciate the input! However, it may not immediately fit our roadmap, and it may take a while for us to get to your request.
+
+### Gitflow
+We use [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/) as our branch management system. Please follow GitFlow's guidelines while contributing to any SDL project.
+
+### Pull Requests
+* Please follow the repository's [Style Guide](https://github.com/smartdevicelink/sdl_core/wiki/SDL-Coding-Style-Guide) for all code and documentation.
+* All pull requests should be sent to `smartdevicelink/sdl_core/`, to `develop` or `master` branch.
+* All feature branches should be based on `develop` and have the format `feature/branch_name`.
+* All fix branches should be based on `develop` and have the format `fix/branch_name`.
+* All new functionality requests should be provided only for `develop` branch.
+* In case an issue should be fixed in a short time (after release), open a pull request to `master` with a branch name of `hotfix/branch_name`.
+* In case an issue exists in both the `develop` and `master` branches, open a pull request to `develop` only. Do not open the same pull request against the `master` branch.
+* All pull requests should implement a single feature or fix a single bug. Pull Requests that involve multiple changes (it is our discretion what precisely this means) will be rejected with a reason.
+* All commits should be separated into logical units, i.e. unrelated changes should be in different commits within a pull request.
+* Work in progress pull requests should have "[WIP]" in front of the Pull Request title. When you believe the pull request is ready to merge, remove this tag and @mention the appropriate SDL team to schedule a review.
+* All new code *must* include unit tests. Bug fixes should have a test that fails previously and now passes. All new features should be covered. If your code does not have tests, or regresses old tests, it will be rejected.
+* 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:theresa@livio.io).
+
+## Additional Resources
+* [General GitHub documentation](https://help.github.com/)
+* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000000..1b58b20e86
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,23 @@
+[Delete any non-applicable sections, but we may ask for more information.]
+
+### Bug Report
+[Summary]
+
+##### Reproduction Steps
+1. [Step 1]
+2. [Step 2]
+3. [Step 3]
+
+##### Expected Behavior
+[Some expected behavior]
+
+##### Observed Behavior
+[Some observed behavior]
+
+##### OS & Version Information
+* OS/Version: [The OS/Version you were running when the bug occurred]
+* SDL Core Version: [The version of SDL Core you were using when the bug occurred]
+* Testing Against: [What you tested with to observe this behavior. Proxy, App, HMI etc.]
+
+##### Test Case, Sample Code, and / or Example App
+[Paste a link to a PR, gist, or other code that exemplifies this behavior] \ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000..83c3261f9b
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,33 @@
+[Things to note: Pull Requests **must** fix an issue. Discussion about the feature / bug takes place in the issue, discussion of the implementation takes place in the PR. Please also see the [Contributing Guide](https://github.com/smartdevicelink/sdl_core/blob/master/.github/CONTRIBUTING.md) for information on branch naming and the CLA.
+
+Delete the above section when you've read it.]
+
+Fixes #[issue number]
+
+This PR is **[ready / not ready]** for review.
+
+### Risk
+This PR makes **[no / minor / major]** API changes.
+
+### Testing Plan
+[Describe how you plan to unit test the changes in this PR]
+
+### Summary
+[Summary of PR changes]
+
+### Changelog
+##### Breaking Changes
+* [Breaking change info]
+
+##### Enhancements
+* [Enhancement info]
+
+##### Bug Fixes
+* [Bug Fix Info]
+
+### Tasks Remaining:
+- [ ] [Task 1]
+- [ ] [Task 2]
+
+### CLA
+- [ ] I have signed [the CLA](https://docs.google.com/forms/d/e/1FAIpQLSdsgJY33VByaX482zHzi-xUm49JNnmuJOyAM6uegPQ2LXYVfA/viewform) \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index c552e22d6c..ec291473fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ CMakeCache.txt
CMakeFiles/
*.pyc
.idea
+src/appMain/build_config.txt
diff --git a/.travis.yml b/.travis.yml
index 69db195531..7f7df359b4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,53 +13,20 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- packages:
- - gcc-4.9
- - g++-4.9
- - libssl-dev
- - libbluetooth3
- - libbluetooth-dev
- - libudev-dev
- - libusb-1.0
- - cmake
- - html2text
- - clang-format-3.6
- - binutils
+
before_install:
- - sudo apt-get -qq update
- - sudo apt-get -q -y install bluez-tools sqlite3 libsqlite3-dev automake1.11
- - wget http://archive.ubuntu.com/ubuntu/pool/main/l/lcov/lcov_1.11-3_all.deb
- - sudo dpkg -i lcov_1.11-3_all.deb
+ - sudo apt-get update
+ - sudo apt-get install libssl-dev libbluetooth3 libbluetooth-dev libudev-dev cmake html2text lcov git cmake automake1.11 build-essential libavahi-client-dev sqlite3 libsqlite3-dev libgtest-dev bluez-tools libpulse-dev libusb-1.0.0-dev cppcheck
+ - sudo apt-get install -f clang-format-3.6
+
script:
- - sudo ln -sf /usr/bin/gcov-4.9 /usr/bin/gcov
- - bash -e tools/infrastructure/check_style.sh
- - echo "Number of processing units available ${PROCESSING_UNITS_COUNT}"
- - mkdir build && cd build && cmake ../ -DBUILD_TESTS=ON -DENABLE_GCOV=ON && make install -j${PROCESSING_UNITS_COUNT}
- - sudo ldconfig
- - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bin/lib ; make test
- - bash ../tools/infrastructure/show_disabled.sh
- - bash -ex ../tools/infrastructure/collect_coverage.sh ./
+ - cppcheck --force -isrc/3rd_party -isrc/3rd_party-static --quiet --error-exitcode=1 src
+ - ./tools/infrastructure/check_style.sh
+ - mkdir build && cd build
+ - cmake ../ -DBUILD_TESTS=ON
+ - make install-3rd_party && make -j `nproc` install && sudo ldconfig && make test
env:
global:
- LC_CTYPE=en_US.UTF-8
- CTEST_OUTPUT_ON_FAILURE=TRUE
- - CMAKE_CXX_COMPILER=g++-4.9
- - CMAKE_C_COMPILER=gcc-4.9
- LD_LIBRARY_PATH=.
- - PROCESSING_UNITS_COUNT=$("nproc")
-after_success:
- - pwd ; bash <(curl -s https://codecov.io/bash) -f ./coverage/coverage.info || echo "Codecov did not collect coverage reports"
-deploy:
- provider: releases
- api-key: "uw8e4USTAS6c9LFhRMYOvw"
- file:
- - "coverage_report.tar.gz"
- skip_cleanup: true
- on:
- tags: true
-notifications:
- email:
- - AKutsan@luxoft.com
- - NSnitsar@luxoft.com
- - MGhiumiusliu@luxoft.com
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000000..481f63a805
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,61 @@
+# Release 4.5.0
+
+## Supported Specifications
+- SDL Mobile RPC Spec: [Version 4.5.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/4.5.0)
+- SDL Protocol Spec: [Version 5.0.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.0.0)
+
+## Implemented Proposals
+
+[Connectivity via iAP-BT and Transport Switch](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0053-Connectivity-via-iAP-BT-and-Transport-Switch.md) - Implementation of a mechanism to change a registered app connected over one transport to another seamlessly.
+
+[Mark public deprecated methods](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0092-Deprecated-interfaces-markup.md) - Implemented a DEPRECATED macro for marking deprecated methods in the project. Using methods marked with this macro will result in a warning being generated.
+
+[Remove QT HMI from SDL Core (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0110-remove-qt-hmi-from-sdl-core.md) - The `qt_hmi` component was removed from SDL Core, the QT_HMI_API interface and dbus adapter will be removed in the next major release, due to this aspect of the proposal requiring breaking changes.
+
+[Use Boost Library (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0044-use-Boost-library.md) - The `boost` library is now installed as a 3rd party library, this library is currently only used in the refactored message broker component.
+
+## Enhancements
+- `DBus` and `libusb` are now dynamically linked, instead of being installed as 3rd-party libraries during the SDL Core build - #2004
+
+## Bug Fixes
+- [Remove OEM Specific references in SDL policy table preload file](https://github.com/smartdevicelink/sdl_core/issues/1252)
+- ["resultCode" should be more descriptive than "INVALID_DATA"](https://github.com/smartdevicelink/sdl_core/issues/31)
+- [SDL doesn't apply sequence SUSPEND -> OnSDLAwake -> SUSPEND -> IGN_OFF for saving resumption data](https://github.com/smartdevicelink/sdl_core/issues/1395)
+- [SDL responds "resultCode: SUCCESS" while dataType:VEHICLEDATA_EXTERNTEMP is VEHICLE_DATA_NOT_AVAILABLE and not in subscribed list store](https://github.com/smartdevicelink/sdl_core/issues/982)
+- [Policies SDL should be case-insensetive to "AppID" against listed in policies manager](https://github.com/smartdevicelink/sdl_core/issues/992)
+- [App is disconnected due to PROTOCOL_VIOLATION when start audio streaming after rejected 2 times then accepted](https://github.com/smartdevicelink/sdl_core/issues/1004)
+- [SDL doesn't set unsuccessful "message" value to "info" param in case HMI responds via single UI.RPC when Interface.IsReady missing](https://github.com/smartdevicelink/sdl_core/issues/997)
+- [Navigation SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HMI](https://github.com/smartdevicelink/sdl_core/issues/990)
+- [SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HM](https://github.com/smartdevicelink/sdl_core/issues/1012)
+- [SDL doesn't send info parameter when result of ResetGlobalProperties is GENERIC_ERROR](https://github.com/smartdevicelink/sdl_core/issues/1016)
+- [SDL does not send StopAudioStream() if exit app while Video service and Audio service are starting.](https://github.com/smartdevicelink/sdl_core/issues/1002)
+- [APIs AlertManeuver: SDL responds GENERIC_ERROR instead of INVALID_DATA when soft button has Type is Image or Both and Text is whitespace or \t or \n or empty](https://github.com/smartdevicelink/sdl_core/issues/980)
+- [IVSU SDL doesn't reject SystemRequest with filenam=IVSU but w/o binary data.](https://github.com/smartdevicelink/sdl_core/issues/976)
+- [Memory leaks: SDL does not release memory after sending AddCommand limit exhausted](https://github.com/smartdevicelink/sdl_core/issues/1029)
+- [Negative result code send instead of IGNORED for UnsubscribedVehicleData when VehicleInfo IsReady Missing](https://github.com/smartdevicelink/sdl_core/issues/996)
+- [API SDL responds "UNSUPPORTED_RESOURCE", success= false in case only have "UNSUPPORTED_RESOURCE" to Navigation.AlertManeuver](https://github.com/smartdevicelink/sdl_core/issues/989)
+- [Default app policies are never updated after a PTU](https://github.com/smartdevicelink/sdl_core/issues/1772)
+- [Build fails with GCC6+](https://github.com/smartdevicelink/sdl_core/issues/1975)
+- [Remote Control test suite fails](https://github.com/smartdevicelink/sdl_core/issues/1993)
+- [PoliciesManager allows all requested params in case "parameters" field is empty](https://github.com/smartdevicelink/sdl_core/issues/1873)
+- [OnDriverDistraction SDL does not send notification to app right after this app changes level from NONE to any other](https://github.com/smartdevicelink/sdl_core/issues/1881)
+- [Protect access to Resumption data during LastState::SaveStateToFileSystem](https://github.com/smartdevicelink/sdl_core/issues/1953)
+- [Need to protect cache manager "pt_" from concurrent access](https://github.com/smartdevicelink/sdl_core/issues/1961)
+- [Prevent deadlock in EventDispatcherIimpl::raise_event](https://github.com/smartdevicelink/sdl_core/issues/1949)
+- [Bluetooth StartService fail after Core restarted](https://github.com/smartdevicelink/sdl_core/issues/1932)
+- [Silent error caused by implicit conversion of SmartPointer to integer](https://github.com/smartdevicelink/sdl_core/issues/1834)
+- [AOA USB transport buffer size too small](https://github.com/smartdevicelink/sdl_core/issues/1863)
+- [Lock screen icon URL should be updated](https://github.com/smartdevicelink/sdl_core/issues/1646)
+- [Broken link in README.md for Software Architecture Documentation](https://github.com/smartdevicelink/sdl_core/issues/2091)
+- [SDL doesn't send OnPermissionsChange in case of external user consent](https://github.com/smartdevicelink/sdl_core/issues/2072)
+- [Build fails when ENABLE_SECURITY=OFF](https://github.com/smartdevicelink/sdl_core/issues/2073)
+
+### Security Related Fixes
+- [SDL must start PTU for navi app right after app successfully registration](https://github.com/smartdevicelink/sdl_core/issues/1925)
+- [SDL must start PTU for any app except navi right after app successfully request to start first secure service](https://github.com/smartdevicelink/sdl_core/issues/1924)
+- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1923)
+- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1922)
+- [SDL must respond NACK in case navigation app connected over protocol v2 sends StartService for audio service](https://github.com/smartdevicelink/sdl_core/issues/1912)
+- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1894)
+- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1891)
+- [PolicyTableUpdate is valid and brings "certificate"](https://github.com/smartdevicelink/sdl_core/issues/1888)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a813b98a1c..1a180b6cf9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,6 @@ 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!!!
set (HMI "web" CACHE STRING "HMI type")
-option(HMI2 "Use Qt HMI" OFF)
option(EXTENDED_MEDIA_MODE "Turn on and off extended Madia Manager features relates to PulseAudio A2DP and GStreamer" OFF)
option(BUILD_SHARED_LIBS "Build all libraries as shared (if ON) or static (if OFF)" OFF)
option(BUILD_BT_SUPPORT "Bluetooth support" ON)
@@ -52,11 +51,10 @@ option(ENABLE_GCOV "gcov code coverage feature" OFF)
option(ENABLE_SANITIZE "Sanitize tool" OFF)
option(ENABLE_SECURITY "Security Ford protocol protection" ON)
option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON)
-option(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)
+option(USE_DISTCC "Turn on distributed build_usage" OFF)
set (EXTENDED_POLICY "PROPRIETARY" CACHE STRING "Policy mode (PROPRIETARY, HTTP or EXTERNAL_PROPRIETARY)")
set_property(CACHE EXTENDED_POLICY PROPERTY STRINGS PROPRIETARY HTTP EXTERNAL_PROPRIETARY)
@@ -90,15 +88,12 @@ else ()
endif()
if (HMI_TYPE_OPTION)
- if (${HMI_TYPE_OPTION} STREQUAL "HTML5")
- message(STATUS "Jenkins integration: select HTML5 HMI")
- set (HMI "web")
- elseif (${HMI_TYPE_OPTION} STREQUAL "NONE")
+ if (${HMI_TYPE_OPTION} STREQUAL "NONE")
message(STATUS "Jenkins integration: select HMI none")
set (HMI "no")
else ()
- message(STATUS "Jenkins integration: select QML HMI none")
- set (HMI "qt")
+ message(STATUS "Jenkins integration: select HTML5 HMI")
+ set (HMI "web")
endif()
endif()
@@ -117,9 +112,6 @@ if (HMI_ADAPTER_OPTION)
if (${HMI_ADAPTER_OPTION} STREQUAL "MESSAGEBROKER")
message(STATUS "Jenkins integration: selected HMI adapter MESSAGEBROKER")
set (HMIADAPTER "messagebroker")
- elseif (${HMI_ADAPTER_OPTION} STREQUAL "DBUS")
- message(STATUS "Jenkins integration: selected HMI adapter DBUS")
- set (HMIADAPTER "dbus")
endif()
endif()
@@ -162,6 +154,59 @@ endif()
#Jenkins integration section end
+#Deliver Build Configuration
+
+set(build_config_path "src/appMain/build_config.txt")
+FILE(WRITE "${build_config_path}" "")
+
+get_property(cHelpString CACHE EXTENDED_POLICY PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_POLICY PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_POLICY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_POLICY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_BT_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_BT_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_BT_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_BT_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_USB_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_USB_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_USB_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_USB_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_SECURITY PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_SECURITY PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_SECURITY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_SECURITY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE EXTENDED_MEDIA_MODE PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_MEDIA_MODE PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_MEDIA_MODE PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_MEDIA_MODE:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE TELEMETRY_MONITOR PROPERTY HELPSTRING)
+get_property(cType CACHE TELEMETRY_MONITOR PROPERTY TYPE)
+get_property(cValue CACHE TELEMETRY_MONITOR PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "TELEMETRY_MONITOR:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE HMI PROPERTY HELPSTRING)
+get_property(cType CACHE HMI PROPERTY TYPE)
+get_property(cValue CACHE HMI PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "HMI:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_HMI_PTU_DECRYPTION:${cType}=${cValue}\n")
+
add_custom_target(pasa-tarball
COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} pasa
COMMAND tar -cz -C /tmp/PASA -f ${CMAKE_BINARY_DIR}/pasa.tar.gz .
@@ -179,7 +224,6 @@ add_custom_target(genivi-tarball
COMMAND tar -cz -C /tmp/GENIVI -f ${CMAKE_BINARY_DIR}/genivi.tar.gz .
)
-
project (${PROJECT})
#ADD_DEPENDENCIES(${PROJECT} Policy)
@@ -191,7 +235,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla")
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla")
if (USE_GOLD_LD)
execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
@@ -282,6 +326,8 @@ if(ENABLE_LOG)
message(STATUS "Logger enabled")
endif()
+set(install-bson_c_lib "install-bson_c_lib")
+
if (TELEMETRY_MONITOR)
add_definitions(-DTELEMETRY_MONITOR)
message(STATUS "Telemetry monitor enabled")
@@ -317,38 +363,10 @@ if (EXTENDED_MEDIA_MODE)
add_definitions(${GLIB2_CFLAGS})
endif()
-if(HMI STREQUAL "qt")
- 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()
-
# Building application
# --- Type HMI
-if (HMI STREQUAL "qt")
- set(QT_HMI ON)
- add_definitions(-DQT_HMI)
-elseif (HMI STREQUAL "web")
+if (HMI STREQUAL "web")
set(WEB_HMI ON)
add_definitions(-DWEB_HMI)
else ()
@@ -356,19 +374,10 @@ else ()
add_definitions(-DNO_HMI)
endif ()
-if (HMI STREQUAL "qt" AND NOT DEFINED HMIADAPTER)
- set(HMIADAPTER "dbus")
-endif()
if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "messagebroker")
endif()
-if (HMIADAPTER STREQUAL "dbus")
- set(HMI_DBUS_API ON)
- add_definitions(-DDBUS_HMIADAPTER)
- add_definitions(-DHMI_DBUS_API)
- set(install-3rd_party_dbus "install-3rd_party_dbus")
-endif()
if (HMIADAPTER STREQUAL "messagebroker")
set(HMI_JSON_API ON)
add_definitions(-DMESSAGEBROKER_HMIADAPTER)
@@ -407,6 +416,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(RTLIB )
endif()
+SET(RPATH_DIRECTORIES
+ ${CMAKE_INSTALL_PREFIX}/bin/plugins
+ /usr/local/lib
+ /usr/local
+ ${CMAKE_INSTALL_PREFIX}/bin
+)
+SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}")
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+
# Building tests
if(BUILD_TESTS)
enable_testing()
@@ -459,4 +480,3 @@ find_package(Doxygen)
message(STATUS "To enable processing of MscGen comments please install mscgen")
message(STATUS "sudo apt-get install mscgen")
endif()
-
diff --git a/COMMITTERS.md b/COMMITTERS.md
deleted file mode 100644
index 284351aff1..0000000000
--- a/COMMITTERS.md
+++ /dev/null
@@ -1,95 +0,0 @@
-#Committing changes to SDL
-
-We would like to make it easier for community members to contribute to SDL
-using pull requests. This makes the process of contributing a little easier for the contributor since they don't
-need to concern themselves with the question, "What branch do I base my changes
-on?" This is already called out in the CONTRIBUTING.md.
-
-##Terminology
-Many of these terms have more than one meaning. For the purposes of this
-document, the following terms refer to specific things.
-
-**contributor** - A person who makes a change to SDL and submits a change
-set in the form of a pull request.
-
-**reviewer** - A person responsible for reviewing a pull request.
-
-**master branch** - [The base branch](https://github.com/smartdevicelink/sdl_core/tree/master).
-
-**develop branch** - [The branch](https://github.com/LuxoftSDL/sdl_core/tree/develop) where bug fixes against the latest release or release candidate are merged.
-
-## Pre-commit hook installation
-* Go to tools/infrastructure/
-* Run install-hooks.py
-* or : Just run "python tools/infrastructure/install-hooks.py"
-
-##Pull request checklist
-* Add Unit tests.
-* All tests pass (see Run all tests section).
-* Check component design
-* Check amount of required memory, memory leaks.
-* Assertion must be used in the right way.
-* Are there cyclic dependencies?
-* Level of abstraction adequate?
-* Are there any platform gotchas? (Does a change make an assumption about
- platform specific behavior that is incompatible with other platforms? e.g.
- Windows paths vs. POSIX paths).
-* Thread safe code.
-* No deadlocks.
-* Is Doxygen API documentation available?
-* Do you have thread specific comment provided? (if another thread uses added method/classes,
- there must be comment which explains: When method will be called by thread? Which thread calls the method? e.g.)
-* Do you have specific realization code comments?
-* Add log messages.
-* There are no Google code style errors. (You can download Google [cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py))
-* Check branch naming.
-* Check correct commit messages in commits (see Pull request message section).
-* Check correct pull request target (`master` or `develop`)
-* Check correct pull request message
-* Add reviewers
-
-##Run all tests
-* Run in root build directory `make test`
-
-##Branch naming
-Branch name should be:
-* `hotfix/<task name>` or
-* `feature/<task name>` or
-* `fix/<task name>`
-
-##Pull request message
-* Describe the reason why you created pull request and what changes there are.
-* Add related Jira ticket as link.
- ( EXAMPLE:
- `Related: [APPLINK-xxxxx](put direct link here)`)
-* If there was an old pull request, add link. ( EXAMPLE: `Old pull request is [here](put direct link here)`)
-
-##Adding reviewers:
-* Add one domain expert
-* Add your mentor (for junior developers only)
-* Add all junior developers (for junior developers only)
-
-`Note`: Everyone from SDL team developers can review any pull request (“reviewed” comment is not required)
-
-##Review process
-* Reviewers can leave comments to code only in `commits` tab.
-* Contributor must answer each comment (Contributor should specify addressee in comment).
-* In case contributor is disagree with reviewer, contributor writes his opinion
-* In case contributor is agree with reviewer, contributor leaves link to new commit with changes.
-* When reviewer is agree with all changes in pull request, he must leave `Reviewed` comment.
-
-##Successfully passed review:
-* Contributor answered to all comments
-* Contributor fixed all mistakes
-* All reviewers left `Reviewed` comment
-
-##Merging
-* Successfully passed review.
-* Rebase in case of existing conflicts.
-* Contributor can squash commits in case of adding same code in different commits.
-* Contact @AGaliuzov or @anosach-luxoft to merge pull request.
-
-##Additional sources
-* [Google cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)
-* [Git commit best practices](http://chris.beams.io/posts/git-commit/)
-* [GitHub Working with formatting](https://help.github.com/articles/working-with-advanced-formatting/)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 42cf5d0898..0000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Contributing to SDL Projects
-
-Third party contributions are essential for making SDL great. However, we do have a few guidelines we need contributors to follow.
-
-### Issues
-If writing a bug report, please make sure <a href="http://yourbugreportneedsmore.info" target="_blank">it has enough info</a>. Include all relevant information.
-
-If requesting a feature, understand that we appreciate the input! However, it may not immediately fit our roadmap, and it may take a while for us to get to your request.
-
-### Gitflow
-We use <a href="http://nvie.com/posts/a-successful-git-branching-model/">Gitflow</a> as our branch management system. Please follow gitflow's guidelines while contributing to any SDL project.
-
-### Pull Requests
-* Please follow the repository's for all code and documentation.
-* All pull requests should be sent to `smartdevicelink/sdl_core/`, to `develop` or `master` branch.
-* All feature branches should be based on `develop` and have the format `feature/branch_name`.
-* All fix branches should be based on `develop` and have the format `fix/branch_name`.
-* All new functionality requests should be provided only for `develop` branch.
-* In case defect should be fixed in short time (after release), send pull request to `master` and have the format `hotfix/branch_name`.
-* In case defect exists in `develop` and `master` branches, send pull request to `develop` only. Do not send the same pull request to the `master` branch.
-* All pull requests should implement a single feature or fix a single bug. Pull Requests that involve multiple changes (it is our discretion what precisely this means) will be rejected with a reason.
-* All commits should be separated into logical units, i.e. unrelated changes should be in different commits within a pull request.
-* Work in progress pull requests should have "[WIP]" in front of the Pull Request title. When you believe the pull request is ready to merge, remove this tag and @mention the appropriate SDL team to schedule a review.
-* All new code *must* include unit tests. Bug fixes should have a test that fails previously and now passes. All new features should be covered. If your code does not have tests, or regresses old tests, it will be rejected.
-* 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:theresa@livio.io).
-
-## Additional Resources
-* [General GitHub documentation](https://help.github.com/)
-* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
-* [Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform)
-* [Committers.md](https://github.com/LuxoftSDL/sdl_core/blob/feature/Add_Committers_file/COMMITTERS.md)
-
diff --git a/Doxyfile b/Doxyfile
index 0b46c939b6..36155e37a7 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -838,7 +838,7 @@ RECURSIVE = YES
# run.
EXCLUDE = **/CMakeLists.txt \
- docs/FORD.OpenSDL.SDD.TPL.dox
+ docs/SDL.SDD.Template.dox
src/components/test_main.cc
src/thirdPartyLibs \
tools/FlexeLint \
diff --git a/FindQt.sh b/FindQt.sh
deleted file mode 100755
index 71a7b10a12..0000000000
--- a/FindQt.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-usage() {
- echo "Usage: $0 [-v <version>] [-b] [<file name>]"
- echo
- echo " Look for file in Qt directory."
- echo " If file name isn't set then look for bin directory."
- echo
- echo " -v <version> look for Qt specific version x.x.x"
- echo " -b look for binary file"
- echo
-}
-
-version2int() {
- IFS="."
- local ver=0
- for i in $1; do
- ver=$(( $ver * 32 + $i ))
- done
- echo $ver
-}
-
-version_match() {
- v1=$(version2int $1)
- v2=$(version2int $2)
- # It's bash way to say "if ((version1 < version2) and (major1 == major2))
- if [[ ( $v1 -le $v2 ) && ( $(( ($v1 / 1024) - ($v2 / 1024) )) == 0 ) ]]; then
- return 0;
- else
- return 1;
- fi
-}
-
-qmake_data() {
- $1 --version 2>/dev/null | grep "Using Qt version" | sed "s/.*Qt version \\([0-9\\.]*\\) in \\(.*\\)$/\\$2/"
-}
-
-find_binary() {
- local qt_binary="$1/$2" # check specified binary
- if [[ -x $qt_binary && ! -d $qt_binary ]]; then # to be executable and not to be directory
- echo -n $qt_binary # output without newline
- return 0
- fi
- return 1
-}
-
-find_file() {
- local qt_file=$(find $1 -name "$2" -type f -print0 -quit 2>/dev/null) # check specified binary
- if [[ -n $qt_file && ! -d $qt_file ]]; then # if found
- echo -n $qt_file #output without newline
- return 0
- fi
- return 1
-}
-
-type=file
-version="0.0.0"
-while getopts :v:b option; do
- case "$option" in
- v) version=$OPTARG ;;
- b) type=binary ;;
- *) usage; exit 1; ;;
- esac
-done
-
-shift $(( OPTIND - 1 ))
-if [[ -z $1 ]]; then
- type=bindir
-else
- file_name=$1
-fi
-
-## First attempt - using locate
-if command -v locate > /dev/null; then
- for searchloc in $CUSTOM_QT_DIR ~ /opt /usr/local; do
- qmake_list=$(locate $searchloc/*/bin/qmake)
- for qmake in $qmake_list; do
- if [[ ! -x $qmake || -d $qmake ]]; then
- continue
- fi
- # called with "qmake 1" return qmake version
- qt_version=$(qmake_data $qmake 1)
- if ! version_match $version $qt_version; then
- continue
- fi
-
- case $type in
- binary)
- qt_dir=$(dirname $qmake 2> /dev/null)
- if find_binary $qt_dir $file_name; then
- exit 0
- fi
- ;;
- file)
- # called with "qmake 2" return Qt installation dir
- qt_installdir=$(qmake_data $qmake 2)
- if find_file $qt_installdir $file_name; then
- exit 0
- fi
- ;;
- bindir)
- echo -n $(dirname $qmake 2>/dev/null)
- exit 0
- ;;
- esac
- done
- done
-fi
-
-## Second attempt - using find
-export -f find_file
-export -f qmake_data
-export -f version_match
-export -f version2int
-
-qmake=$(find -L $CUSTOM_QT_DIR ~ /opt /usr/local -name '.*' -prune \
- -o -name qmake -type f \
- -executable \
- -exec /bin/bash -c "version_qt=\$(qmake_data {} 1);version_match $version \$version_qt" {} \; -print -quit > /dev/null)
-if ! [ $? ]; then
- exit 1;
-fi
-
-case $type in
- binary)
- qt_dir=$(dirname $qmake 2>/dev/null)
- if find_binary $qt_dir $file_name; then
- exit 0
- fi
- ;;
- file)
- # called with "qmake 2" return Qt installation dir
- qt_installdir=$(qmake_data $qmake 2)
- if find_file $qt_installdir $file_name; then
- exit 0
- fi
- ;;
- bindir)
- echo -n $(dirname $qmake 2>/dev/null)
- exit 0
- ;;
-esac
-
-exit 1
diff --git a/LICENSE b/LICENSE
index 0a2b1298bc..ae3e57d852 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2017 SmartDeviceLink Consortium, Inc.
+Copyright (c) 2017 - 2018 SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
index ee1d4fc57b..86d07c3d83 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
-
-[![Build Status](https://travis-ci.org/smartdevicelink/sdl_core.svg?branch=master)](https://travis-ci.org/smartdevicelink/sdl_core)
-
- [![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop)
+[![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop)
+[![Build Status](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/badge/icon)](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/)
# SmartDeviceLink (SDL)
@@ -16,7 +14,7 @@ Pull Requests Welcome!
## Documentation
- * [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+ * [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
* [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/)
@@ -33,7 +31,7 @@ We're ramping up our efforts to get SmartDeviceLink developed and maintained dir
A quick guide to installing, configuring, and running an instance of the SDL Core on a linux OS.
1. Clone this repository
- 2. Create a folder for your build and run `cmake ../sdl_core`
+ 2. Create a folder for your build outside of the source folder and run `cmake {path_to_sdl_core_source_folder}` from the build folder you created
3. If there are any dependency issues, install missing dependencies
4. Run the following commands to compile and install smartdevicelink
@@ -49,7 +47,7 @@ Once SDL Core is compiled and installed you can start it from the executable in
```
%cd bin/
-%LD_LIBRARY_PATH=. ./smartDeviceLinkCore
+%./start.sh
```
## Start WEB HMI
@@ -67,12 +65,17 @@ The dependencies for SDL Core vary based on the configuration. You can change SD
| Flag | Description | Dependencies |
|------|-------------|--------------|
|Web HMI|Use HTML5 HMI|chromium-browser|
-|HMI2|Build with QT HMI|QT5, dbus-*dev|
|EXTENDED_MEDIA_MODE|Support Video and Audio Streaming|Opengl es2, gstreamer1.0*|
|Bluetooth|Enable bluetooth transport adapter|libbluetooth3, libbluetooth-dev, bluez-tools|
+|USB|Enable USB transport adapter|libusb-dev|
|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
@@ -116,53 +119,9 @@ There are several RPCs that are "required" to be implemented in order for SDL to
* OnSystemRequest
* Speak
-## App Launching
-
-Below are instructions for testing app launching and query with a full system set up.
-
-### SDL Server
-The app querying specification defines an endpoint within Policies where sdl_core will reach out to receive a list of applications that can be launched. The SDL Server provides the back end functionality for app launching and querying.
-
-You can find the SDL Server on [GitHub](https://github.com/smartdevicelink/sdl_server). The README contains detailed instructions for installing and launching the server. Launch the server on your local machine, and direct your browser to http://localhost:3000.
-
-The [App Launching Server Specification](https://github.com/smartdevicelink/sdl_server/blob/master/docs/application_launching_v1.0.md) defines an endpoint `/applications/available/:moduleId.json` which return a list of applications available for launching to the handset for filtering.
-
-To check if there is a module already available you can go to http://localhost:3000/modules.json. If there is a module available, there will be one or more objects in the response array. Keep this response, you'll need the "_id" field for later.
-
-If there is not a module already available, go to http://localhost:3000/cars and define a new vehicle, then check http://localhost:3000/modules.json.
-
-Next, you'll need to define applications that can be launched. Go to http://localhost:3000/apps and define some applications. Make sure that you define a url scheme under the iOS tab of the application. This is required for an application to be launched from SDL. A URL scheme has the format `someScheme://`. Save the URL Scheme you used for later steps.
-
-You'll also need the local ip address of your machine
-
-At the end of the SDL Server set up you should have
- 1. SDL Server running on your local machine connected to mongo db
- 2. Your machine's local IP Address
- 3. The module id of your vehicle
- 4. The URL Scheme of the app you want to launch
-
-### Mobile
-You need at least one app installed on the test device (presumably an iPhone), which we have built for you, the [V4Tester application](https://app.box.com/s/eeloquc0fhqfmxjjubw7kousf12f3pzg). This application implements SDL 4.0 and will respond to SDL Core's QUERY_APPS system request, as well as filter the response for available applications. If you do not have any other applications on the device, you can only test QUERY_APPS functionality, in which no applications will be sent to sdl core which can be launched.
-
-In order to support the launching of an application, you'll have to create an additional app which responds to the URL Scheme of the application that you set up on the SDL Server. To do so, go to Xcode, select File>New>Project... and under ios/application create a Single View Application. Open the application's Info.plist file (under the Supporting Files section of the project explorer by default). Highlight the Information Property List item and click the plus button to add a new entry to the Property List. From the drop down menu, select URL Types as the key. In the Item 0 dictionary add a "URL Schemes" Array, and make Item 0 in the array the prefix to the URL you previously defined (So if you defined `someScheme://` then Item 0 should be "someScheme"). Make sure the URL identifier matches your application's identifier. When you're finished you should have something that looks like the following. Install this application on your test device. **Note** - this application will only launch during this process, since it is not SDL Connected it will not register with the head unit.
-
-![Plist Example](http://i.imgur.com/AFyJlZQ.png)
-
-At the end of the Mobile device set up you should have
- 1. The V4 Tester Application installed on your device
- 2. An application for launching that matches the application submitted to SDL Server
- 3. Your iPhone should be on the same network as the machine running SDL Server
-
-### SDL Core
-Take the following steps to launch applications from sdl core.
+## Frequently Asked Questions
- 1. Install the [correct version of SDL Core](https://github.com/smartdevicelink/sdl_core/pull/39)
- 2. Add the queryAppsUrl that you saved during sdl server set up in the src/appMain/preloaded_pt.json under the "endpoints" property in the format `http://[local machine ip]:3000/applications/available[moduleId].json`. For example `http://192.168.0.150:3000/applications/available/789b739c47c7490321058200.json`.
- 3. Run SDL Core
- 4. Launch the V4 Tester application on the iPhone
- 5. Connect the application via wifi by entering the IP address of Core into the V4 tester
- 6. Both applications should show up on the head unit for launching
- 7. Select the other application, and you should see it launched and brought to the foreground on the phone
+If you have any questions regarding the setup of SDL Core or regarding the integration of SDL into an infotainment system, first visit our [SDL Core FAQ](https://smartdevicelink.com/en/guides/core/faq/). If you still have questions, you can post a question in the `core-help` channel of our Slack group (sign up [here](http://slack.smartdevicelink.com/))
## Test Coverage
### Used technologies
diff --git a/docs/FORD.OpenSDL.SDD.TPL.dox b/docs/FORD.OpenSDL.SDD.TPL.dox
deleted file mode 100644
index c0106df5d4..0000000000
--- a/docs/FORD.OpenSDL.SDD.TPL.dox
+++ /dev/null
@@ -1,355 +0,0 @@
-/**
-\cond FALSE
------- Design document template explanation -------
-This is a SW Detailed Design template for each SDl component update.
-The original QCA template with more detail description is available at Luxoft portal
-https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Template
-
----------------------- HOWTO -----------------------
-For adding new component documentation please follow this steps:
-1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
- - Example:
- + src/components/transport_manager/docs/FORD.OpenSDL.SDD.TM.dox
- + src/components/utils/docs/FORD.OpenSDL.SDD.Utils.dox
- - https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
-2. Replace <!Component Name> with a correct naming according to SAD naming
- - Name examples:
- Application Manager, Connection Handler
- - Replace examples:
- ~ sed -i 's/<!Component Name>/Utils/g' FORD.OpenSDL.SDD.Utils.dox
-3. Replace <!Component_Id> with a shot unique name
- - Something like app_manage, connection_handler, policy
- - It shall be one word without spaces and special symbols except '_'
- - Replace examples:
- ~ sed -i 's/<!Component_Id>/connection_handler/g' FORD.OpenSDL.SDD.Utils.dox
- Note: After that step all Doxygen tags becomes working well and IDE could be used
-4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
-5. Replace blocks marked as following with a content according to instructions in these blocks
- - Each block starts as <!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
- - Each block ends as <!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
- - If chapter content is not applicable for a Component update it with "Not applicable, since/because of <Reason>."
-6. Update source code doxygen comments for mentioning entities in the following SDD chapter:
- - Public and private interfaces from chapter 3
- - Data types from chapter 4.2
-7. Update project Doxygen file with path to new images
- * IMAGE_PATH parameter
-8. Remove this template explanation from cond to endcond tags
-
-General notes/reminders:
-- Commit both: images and them source to the git repository
-- SDD file extension shall be 'dox'
-- the preferable path for SDD is src/components/COMPONENT/docs
-- the preferable path for SDD images is src/components/COMPONENT/docs/assets
-
-For more information, please follow:
-- Doxygen documentation
- http://www.stack.nl/~dimitri/doxygen/manual/index.html
-- Markdown support by doxygen
- http://www.stack.nl/~dimitri/doxygen/manual/markdown.html
-- Text-base UML tool
- http://plantuml.com/
-- Article "Providing design documentation with code changes"
- https://github.com/smartdevicelink/sdl_core/wiki/Providing-design-documentation-with-code-changes
-
----------------------------------------------
-\endcond
-\page <!Component_Id> <!Component Name> Detailed Design
-## Table of contents
-- \subpage <!Component_Id>_intoduction
- + \ref <!Component_Id>_rationale "1.1 Rationale"
- + \ref <!Component_Id>_scope "1.2 Scope"
- + \ref <!Component_Id>_abbreviations "1.3 Abbreviations"
-- \subpage <!Component_Id>_detail_design
- + \ref <!Component_Id>_design_solutions "2.1 Design solutions"
- + \ref <!Component_Id>_class_structure "2.2 Class Structure"
- + \ref <!Component_Id>_sequence_diagram "2.3 Sequence diagram"
- + \ref <!Component_Id>_state_chart "2.4 State chart diagram"
-- \subpage <!Component_Id>_interfaces
- + \ref <!Component_Id>_public_interfaces "3.1 Public interfaces description"
- + \ref <!Component_Id>_internal_interfaces "3.2 Internal interfaces description"
- + \ref <!Component_Id>_derived_interfaces "3.3 Derived interfaces and dependencies"
-- \subpage <!Component_Id>_data_structure_resources
- + \ref <!Component_Id>_data_structure "4.1 Element Data Structure"
- + \ref <!Component_Id>_resources "4.2 Resource usage"
-- \subpage <!Component_Id>_references_and_history
- + \ref <!Component_Id>_references "5.1 References"
- + \ref <!Component_Id>_history "5.2 Document history change and approve"
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_intoduction 1. Introduction
-The document is intended to support software developers,
-maintenance and integration engineers with sufficient,
-detailed information concerning the design, development and
-deployment concepts, to accomplish their respective tasks without reliance on the authors.
-
-\anchor <!Component_Id>_rationale
-## 1.1 Rationale
-<!Component Name> implements SDL Architectural Solution according to:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be a link SAD Components View and Requirements if applicable)
-Example:
- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#hmi-message-handler
-<!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_scope
-## 1.2 Scope
-<!Component Name> extracted as a separate component for
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a reason and short description of the components functionality
-Example:
- Security Manager component extracted as a separate module for
- Ford channel data protection.
- This components is used to :
- - Provide security communications
- - Protect income and outcome business layer data from interception
- - Verify the relation between a mobile application certificate and its owner
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_abbreviations
-## 1.3 Abbreviations
-Abbreviations used in this document please find in the table below.
-| Abbreviation | Expansion |
-|------------------|----------------------------------|
-| | |
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all component-specific terms, as
-| TA | Transport Adapter |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-Definitions used in this document are in the table below.
-
-| Definition | Description |
-|------------------|-----------------------------------|
-| | |
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all component-specific terms, as
-| WebSocket | a protocol providing full-duplex communication channels over a single TCP connection |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_detail_design 2. Component detail design
-\anchor <!Component_Id>_design_solutions
-### 2.1 Design solutions
-The following design approaches and pattern was used for <!Component Name>:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added GoF (or other) SW design patterns,
-technologies and approaches with short description
-Example:
- - Command design pattern is used to treat requests as an object that provides
- possibility to add new request without existing code modification
- - Factory method pattern design used for SSLContext objects creation
- + It also guaranty correctness of SSLContext destruction by the
- same Compiled SecurityManger object
- - All database reading are cached by CacheManager class, which
- guaranty meeting timing contrariness
- - SQLite database was chosen as a lightweight, embedded, transactional SQL database engine
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_class_structure
-### 2.2 Class Structure
-The following UML class digram shows the component classes structure.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added class diagram
-Example:
- ![Security Manager class diagram](sm_class_digram.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/classes.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about class digram follow:
-- http://www.uml-diagrams.org/class-diagrams-overview.html
-- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
-
-\anchor <!Component_Id>_sequence_diagram
-### 2.3 Sequence diagram
-The following UML sequence digram shows how objects operate with one another and in what order.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added sequence diagram
-Example:
- Short description
- ![Connection](connection.png)
- ![job](job.png)
- ![disconnection](disconnection.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/sequence.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about sequence digram follow:
-- http://www.uml-diagrams.org/sequence-diagrams.html
-- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
-
-\anchor <!Component_Id>_state_chart
-### 2.4 State chart diagram
-The following UML state digram shows the component life cycle states.
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added state diagram
-Example:
- ![StateControllerImpl state](state_contoroller_states.png)
-For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
-https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
-OR plantuml diagram
-http://plantuml.com/state.html
-Note: Source files of diagram and output images need to be also committed to git.
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more information about class digram follow:
-- http://www.uml-diagrams.org/state-machine-diagrams.html
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_interfaces 3. Component Interfaces
-\anchor <!Component_Id>_public_interfaces
-### 3.1 Public interfaces description
-<!Component Name> provides functionality with following interfaces:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of external interfaces
-Example:
- - security_manager::SecurityManager
- - security_manager::SecurityManagerListener
- - security_manager::SSLContext
-(!) All link will be auto-added by doxygen
-For more auto-linking follow - https://www.stack.nl/~dimitri/doxygen/manual/autolink.html#linkclass
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_internal_interfaces
-### 3.2 Internal interfaces description
-The following interfaces are provided by component for internal usage only:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of internal interfaces
-Example:
- - security_manager::CryptoManager
- - security_manager::CryptoManagerSettings
- - security_manager::SecurityQuery
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_derived_interfaces
-### 3.3 Derived interfaces and dependencies
-<!Component Name> required following 3d-party libraries:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of libraries
-Example:
- - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-The following interfaces are required by component:
-- \ref src/components/include/utils Utils
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of external interfaces
-Example:
- - protocol_handler::ProtocolObserver for getting Protocol notifications
- - implements protocol_handler::SessionObserver for providing SSLContext object managing
- - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) :
- + SSL_library_init() - registers the available SSL/TLS ciphers and digests.
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_data_structure_resources 4. Component data and resources
-\anchor <!Component_Id>_data_structure
-### 4.1 Element Data Structure
-The following data types are used by the Component:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of component data types
-Example:
- - security_manager::SecurityQuery
- - protocol_handler::ProtocolPacket
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-The format of processing/saving/loading data is:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of formats
-Example:
- - Json data according to APPLINK-19421
- - Binary data array according to Ford Protocol Specification
- + https://github.com/smartdevicelink/protocol_spec
- - PEM certificates according to APPLINK-21512
-All link will be auto-added by doxygen
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_resources
-### 4.2 Resource usage
-The following system resources are used by the Component:
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added all resource-related information
-All file, database or network reading
-An amount of processing by component data
-Example:
- Resumption uses QBD/JSON database with configurable limitation 10 Mb
- Request Controller Handle a configured amount of RPCs:
- - A XXX count of messages from application in NONE level
- + <LINK_TO_REQURMENT_XXX>
- - A YYY count of messages per second for each application
- + <LINK_TO_REQURMENT_YYY>
- (!) In case of no such restrict it need to be clarified (!)
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/
-//-----------------------------------------------------------
-/**
-\page <!Component_Id>_references_and_history 5. References and history
-\anchor <!Component_Id>_references
-### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
-
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Here need to be added a list of all related to component functionality
-references, including 3d-party libraries, documentation, requirements
-Example:
- - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
- - [SQLite Documents](https://www.sqlite.org/docs.html)
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-\anchor <!Component_Id>_history
-### 5.2 Document history
-Document change history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example:
-| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
-For more details follow
-https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentVersion
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-Document approve history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example:
-| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-
-For more precise document change history follow github history -
-<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
-Example for this template:
-- https://github.com/smartdevicelink/sdl_core/commits/master/docs/software_detailed_design_template.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/software_detailed_design_template.dox
-<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-*/ \ No newline at end of file
diff --git a/docs/SDL.SDD.Template.dox b/docs/SDL.SDD.Template.dox
new file mode 100644
index 0000000000..435da665db
--- /dev/null
+++ b/docs/SDL.SDD.Template.dox
@@ -0,0 +1,355 @@
+/**
+\cond FALSE
+------ Design document template explanation -------
+This is a SW Detailed Design template for each SDl component update.
+The original QCA template with more detail description is available at Luxoft portal
+https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Template
+
+---------------------- HOWTO -----------------------
+For adding new component documentation please follow this steps:
+1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
+ - Example:
+ + src/components/transport_manager/docs/SDL.SDD.TM.dox
+ + src/components/utils/docs/SDL.SDD.Utils.dox
+ - https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
+2. Replace <!Component Name> with a correct naming according to SAD naming
+ - Name examples:
+ Application Manager, Connection Handler
+ - Replace examples:
+ ~ sed -i 's/<!Component Name>/Utils/g' SDL.SDD.Utils.dox
+3. Replace <!Component_Id> with a shot unique name
+ - Something like app_manage, connection_handler, policy
+ - It shall be one word without spaces and special symbols except '_'
+ - Replace examples:
+ ~ sed -i 's/<!Component_Id>/connection_handler/g' SDL.SDD.Utils.dox
+ Note: After that step all Doxygen tags becomes working well and IDE could be used
+4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
+5. Replace blocks marked as following with a content according to instructions in these blocks
+ - Each block starts as <!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+ - Each block ends as <!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+ - If chapter content is not applicable for a Component update it with "Not applicable, since/because of <Reason>."
+6. Update source code doxygen comments for mentioning entities in the following SDD chapter:
+ - Public and private interfaces from chapter 3
+ - Data types from chapter 4.2
+7. Update project Doxygen file with path to new images
+ * IMAGE_PATH parameter
+8. Remove this template explanation from cond to endcond tags
+
+General notes/reminders:
+- Commit both: images and them source to the git repository
+- SDD file extension shall be 'dox'
+- the preferable path for SDD is src/components/COMPONENT/docs
+- the preferable path for SDD images is src/components/COMPONENT/docs/assets
+
+For more information, please follow:
+- Doxygen documentation
+ http://www.stack.nl/~dimitri/doxygen/manual/index.html
+- Markdown support by doxygen
+ http://www.stack.nl/~dimitri/doxygen/manual/markdown.html
+- Text-base UML tool
+ http://plantuml.com/
+- Article "Providing design documentation with code changes"
+ https://github.com/smartdevicelink/sdl_core/wiki/Providing-design-documentation-with-code-changes
+
+---------------------------------------------
+\endcond
+\page <!Component_Id> <!Component Name> Detailed Design
+## Table of contents
+- \subpage <!Component_Id>_intoduction
+ + \ref <!Component_Id>_rationale "1.1 Rationale"
+ + \ref <!Component_Id>_scope "1.2 Scope"
+ + \ref <!Component_Id>_abbreviations "1.3 Abbreviations"
+- \subpage <!Component_Id>_detail_design
+ + \ref <!Component_Id>_design_solutions "2.1 Design solutions"
+ + \ref <!Component_Id>_class_structure "2.2 Class Structure"
+ + \ref <!Component_Id>_sequence_diagram "2.3 Sequence diagram"
+ + \ref <!Component_Id>_state_chart "2.4 State chart diagram"
+- \subpage <!Component_Id>_interfaces
+ + \ref <!Component_Id>_public_interfaces "3.1 Public interfaces description"
+ + \ref <!Component_Id>_internal_interfaces "3.2 Internal interfaces description"
+ + \ref <!Component_Id>_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage <!Component_Id>_data_structure_resources
+ + \ref <!Component_Id>_data_structure "4.1 Element Data Structure"
+ + \ref <!Component_Id>_resources "4.2 Resource usage"
+- \subpage <!Component_Id>_references_and_history
+ + \ref <!Component_Id>_references "5.1 References"
+ + \ref <!Component_Id>_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_intoduction 1. Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor <!Component_Id>_rationale
+## 1.1 Rationale
+<!Component Name> implements SDL Architectural Solution according to:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be a link SAD Components View and Requirements if applicable)
+Example:
+ https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#hmi-message-handler
+<!!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_scope
+## 1.2 Scope
+<!Component Name> extracted as a separate component for
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a reason and short description of the components functionality
+Example:
+ Security Manager component extracted as a separate module for
+ SDL channel data protection.
+ This components is used to :
+ - Provide security communications
+ - Protect income and outcome business layer data from interception
+ - Verify the relation between a mobile application certificate and its owner
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| TA | Transport Adapter |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|------------------|-----------------------------------|
+| | |
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all component-specific terms, as
+| WebSocket | a protocol providing full-duplex communication channels over a single TCP connection |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_detail_design 2. Component detail design
+\anchor <!Component_Id>_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for <!Component Name>:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added GoF (or other) SW design patterns,
+technologies and approaches with short description
+Example:
+ - Command design pattern is used to treat requests as an object that provides
+ possibility to add new request without existing code modification
+ - Factory method pattern design used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManger object
+ - All database reading are cached by CacheManager class, which
+ guaranty meeting timing contrariness
+ - SQLite database was chosen as a lightweight, embedded, transactional SQL database engine
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_class_structure
+### 2.2 Class Structure
+The following UML class diagram shows the component classes structure.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added class diagram
+Example:
+ ![Security Manager class diagram](sm_class_diagram.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/classes.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.html
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor <!Component_Id>_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence diagram shows how objects operate with one another and in what order.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added sequence diagram
+Example:
+ Short description
+ ![Connection](connection.png)
+ ![job](job.png)
+ ![disconnection](disconnection.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/sequence.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about sequence diagram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+\anchor <!Component_Id>_state_chart
+### 2.4 State chart diagram
+The following UML state diagram shows the component life cycle states.
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added state diagram
+Example:
+ ![StateControllerImpl state](state_contoroller_states.png)
+For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
+As a tool for image preparing could be used Gliffy diagram
+https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
+OR plantuml diagram
+http://plantuml.com/state.html
+Note: Source files of diagram and output images need to be also committed to git.
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/state-machine-diagrams.html
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_interfaces 3. Component Interfaces
+\anchor <!Component_Id>_public_interfaces
+### 3.1 Public interfaces description
+<!Component Name> provides functionality with following interfaces:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - security_manager::SecurityManager
+ - security_manager::SecurityManagerListener
+ - security_manager::SSLContext
+(!) All link will be auto-added by doxygen
+For more auto-linking follow - https://www.stack.nl/~dimitri/doxygen/manual/autolink.html#linkclass
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of internal interfaces
+Example:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+ - security_manager::SecurityQuery
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+<!Component Name> required following 3d-party libraries:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of libraries
+Example:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of external interfaces
+Example:
+ - protocol_handler::ProtocolObserver for getting Protocol notifications
+ - implements protocol_handler::SessionObserver for providing SSLContext object managing
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/) :
+ + SSL_library_init() - registers the available SSL/TLS ciphers and digests.
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_data_structure_resources 4. Component data and resources
+\anchor <!Component_Id>_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of component data types
+Example:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+The format of processing/saving/loading data is:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of formats
+Example:
+ - Json data according to APPLINK-19421
+ - Binary data array according to SDL Protocol Specification
+ + https://github.com/smartdevicelink/protocol_spec
+ - PEM certificates according to APPLINK-21512
+All link will be auto-added by doxygen
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_resources
+### 4.2 Resource usage
+The following system resources are used by the Component:
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added all resource-related information
+All file, database or network reading
+An amount of processing by component data
+Example:
+ Resumption uses QBD/JSON database with configurable limitation 10 Mb
+ Request Controller Handle a configured amount of RPCs:
+ - A XXX count of messages from application in NONE level
+ + <LINK_TO_REQURMENT_XXX>
+ - A YYY count of messages per second for each application
+ + <LINK_TO_REQURMENT_YYY>
+ (!) In case of no such restrict it need to be clarified (!)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/
+//-----------------------------------------------------------
+/**
+\page <!Component_Id>_references_and_history 5. References and history
+\anchor <!Component_Id>_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
+
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Here need to be added a list of all related to component functionality
+references, including 3d-party libraries, documentation, requirements
+Example:
+ - [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ - [SQLite Documents](https://www.sqlite.org/docs.html)
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+\anchor <!Component_Id>_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+For more details follow
+https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentVersion
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example:
+| 0.1 | MM/DD/YYYY | [Name](Github account link) | Initially created |
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+
+For more precise document change history follow github history -
+<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
+Example for this template:
+- https://github.com/smartdevicelink/sdl_core/commits/master/docs/SDL.SDD.Template.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/SDL.SDD.Template.dox
+<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
+*/ \ No newline at end of file
diff --git a/docs/mainpage.dox b/docs/mainpage.dox
index 91ee95fc26..01b9034151 100644
--- a/docs/mainpage.dox
+++ b/docs/mainpage.dox
@@ -1,11 +1,12 @@
/**
* \mainpage Software Detail Design Documentation
*
- * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/).
+ * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/).
*
- * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/core/master/software-architecture-document/table-of-contents/)
+ * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
*
* ##Table of contents
* - \ref security_manager
+ * - \ref application_manager
*/
//-----------------------------------------------------------
diff --git a/src/3rd_party-static/CMakeLists.txt b/src/3rd_party-static/CMakeLists.txt
index 2acd7be27c..029c0b3d8d 100644
--- a/src/3rd_party-static/CMakeLists.txt
+++ b/src/3rd_party-static/CMakeLists.txt
@@ -32,22 +32,10 @@
add_subdirectory(./jsoncpp)
set(JSONCPP_INCLUDE_DIRECTORY ${JSONCPP_INCLUDE_DIRECTORY} PARENT_SCOPE)
-# --- Message Broker
-add_subdirectory(./message_broker)
-set(MESSAGE_BROKER_INCLUDE_DIRECTORY ${MESSAGE_BROKER_INCLUDE_DIRECTORY} PARENT_SCOPE)
-
# --- encryption
add_subdirectory(./encryption)
set(ENCRYPTION_INCLUDE_DIRECTORY ${ENCRYPTION_INCLUDE_DIRECTORY} PARENT_SCOPE)
-if (BUILD_USB_SUPPORT)
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_subdirectory(./libusbx-1.0.16)
- set(LIBUSB_INCLUDE_DIRECTORY ${LIBUSB_INCLUDE_DIRECTORY} PARENT_SCOPE)
- set(LIBUSB_LIBS_DIRECTORY ${LIBUSB_LIBS_DIRECTORY} PARENT_SCOPE)
- endif()
-endif()
-
# --- gmock
if(BUILD_TESTS)
add_subdirectory(./gmock-1.7.0)
diff --git a/src/3rd_party-static/libusbx-1.0.16/CMakeLists.txt b/src/3rd_party-static/libusbx-1.0.16/CMakeLists.txt
deleted file mode 100644
index 105406c44e..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-set(LIBUSB_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-set(LIBUSB_INCLUDE_DIRECTORY ${LIBUSB_INCLUDE_DIRECTORY} PARENT_SCOPE)
-
-set(LIBUSB_LIBS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBUSB_LIBS_DIRECTORY ${LIBUSB_LIBS_DIRECTORY} PARENT_SCOPE)
-
-include_directories (
- ./libusb/os/
- ./libusb/
- ./
-)
-
-set (LIBUSB_SOURCES
- ./libusb/core.c
- ./libusb/descriptor.c
- ./libusb/hotplug.c
- ./libusb/io.c
- ./libusb/strerror.c
- ./libusb/sync.c
- ./libusb/os/linux_udev.c
- ./libusb/os/linux_netlink.c
- ./libusb/os/linux_usbfs.c
- ./libusb/os/poll_posix.c
- ./libusb/os/threads_posix.c
-)
-
-add_library("Libusb-1.0.16" ${LIBUSB_SOURCES})
-
-
-target_link_libraries("Libusb-1.0.16" udev)
diff --git a/src/3rd_party-static/libusbx-1.0.16/config.h b/src/3rd_party-static/libusbx-1.0.16/config.h
deleted file mode 100644
index 3c4543f2f1..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/config.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Default visibility */
-#define DEFAULT_VISIBILITY __attribute__((visibility("default")))
-
-/* Start with debug message logging enabled */
-/* #undef ENABLE_DEBUG_LOGGING */
-
-/* Message logging */
-#define ENABLE_LOGGING 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `udev' library (-ludev). */
-#define HAVE_LIBUDEV 1
-
-/* Define to 1 if you have the <libudev.h> header file. */
-#define HAVE_LIBUDEV_H 1
-
-/* Define to 1 if you have the <linux/filter.h> header file. */
-/* #undef HAVE_LINUX_FILTER_H */
-
-/* Define to 1 if you have the <linux/netlink.h> header file. */
-/* #undef HAVE_LINUX_NETLINK_H */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define to 1 if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if the system has the type `struct timespec'. */
-#define HAVE_STRUCT_TIMESPEC 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
-/* Darwin backend */
-/* #undef OS_DARWIN */
-
-/* Linux backend */
-#define OS_LINUX 1
-
-/* OpenBSD/NetBSD backend */
-/* #undef OS_OPENBSD */
-
-/* Windows backend */
-/* #undef OS_WINDOWS */
-
-/* Name of package */
-#define PACKAGE "libusbx"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "libusbx-devel@lists.sourceforge.net"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libusbx"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libusbx 1.0.16"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libusbx"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL "http://libusbx.org"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.0.16"
-
-/* type of second poll() argument */
-#define POLL_NFDS_TYPE nfds_t
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Use POSIX Threads */
-#define THREADS_POSIX 1
-
-/* timerfd headers available */
-#define USBI_TIMERFD_AVAILABLE 1
-
-/* Use udev for device enumeration/hotplug */
-#define USE_UDEV 1
-
-/* Version number of package */
-#define VERSION "1.0.16"
-
-/* Use GNU extensions */
-#define _GNU_SOURCE 1
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-core.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-core.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-core.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-darwin_usb.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-darwin_usb.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-darwin_usb.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-descriptor.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-descriptor.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-descriptor.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-hotplug.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-hotplug.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-hotplug.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-io.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-io.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-io.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_netlink.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_netlink.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_netlink.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_udev.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_udev.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_udev.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_usbfs.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_usbfs.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-linux_usbfs.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-openbsd_usb.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-openbsd_usb.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-openbsd_usb.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_posix.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_posix.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_posix.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_windows.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_windows.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-poll_windows.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-strerror.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-strerror.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-strerror.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-sync.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-sync.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-sync.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_posix.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_posix.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_posix.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_windows.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_windows.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-threads_windows.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-windows_usb.Plo b/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-windows_usb.Plo
deleted file mode 100644
index 9ce06a81ea..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/.deps/libusb_1_0_la-windows_usb.Plo
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.am b/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.am
deleted file mode 100644
index 7f9c1f9093..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.am
+++ /dev/null
@@ -1,68 +0,0 @@
-all: libusb-1.0.la libusb-1.0.dll
-
-lib_LTLIBRARIES = libusb-1.0.la
-
-POSIX_POLL_SRC = os/poll_posix.c
-LINUX_USBFS_SRC = os/linux_usbfs.c
-DARWIN_USB_SRC = os/darwin_usb.c
-OPENBSD_USB_SRC = os/openbsd_usb.c
-WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def
-WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h
-
-EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \
- $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \
- $(POSIX_POLL_SRC) \
- os/threads_posix.c os/threads_windows.c \
- os/linux_udev.c os/linux_netlink.c
-
-if OS_LINUX
-
-if USE_UDEV
-OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
- os/linux_udev.c
-else
-OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
- os/linux_netlink.c
-endif
-
-endif
-
-if OS_DARWIN
-OS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)
-AM_CFLAGS_EXT = -no-cpp-precomp
-endif
-
-if OS_OPENBSD
-OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)
-endif
-
-if OS_WINDOWS
-OS_SRC = $(WINDOWS_USB_SRC)
-
-.rc.lo:
- $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
-
-libusb-1.0.rc: version.h version_nano.h
-endif
-
-libusb-1.0.dll: libusb-1.0.def
-if CREATE_IMPORT_LIB
-# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged
- $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a
-endif
-
-if THREADS_POSIX
-THREADS_SRC = os/threads_posix.h os/threads_posix.c
-else
-THREADS_SRC = os/threads_windows.h os/threads_windows.c
-endif
-
-libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
-libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
-libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c strerror.c sync.c \
- os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h os/windows_common.h \
- hotplug.h hotplug.c $(THREADS_SRC) $(OS_SRC) \
- os/poll_posix.h os/poll_windows.h
-
-hdrdir = $(includedir)/libusb-1.0
-hdr_HEADERS = libusb.h
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.in b/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.in
deleted file mode 100644
index 2461c45a80..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/Makefile.in
+++ /dev/null
@@ -1,860 +0,0 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = libusb
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp $(hdr_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/libusb/version.h $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libusb_1_0_la_LIBADD =
-am__libusb_1_0_la_SOURCES_DIST = libusbi.h core.c descriptor.c io.c \
- strerror.c sync.c os/linux_usbfs.h os/darwin_usb.h \
- os/windows_usb.h os/windows_common.h hotplug.h hotplug.c \
- os/threads_windows.h os/threads_windows.c os/threads_posix.h \
- os/threads_posix.c os/darwin_usb.c os/poll_posix.c \
- os/linux_usbfs.c os/linux_netlink.c os/linux_udev.c \
- os/openbsd_usb.c os/poll_windows.c os/windows_usb.c \
- libusb-1.0.rc libusb-1.0.def os/poll_posix.h os/poll_windows.h
-@THREADS_POSIX_FALSE@am__objects_1 = libusb_1_0_la-threads_windows.lo
-@THREADS_POSIX_TRUE@am__objects_1 = libusb_1_0_la-threads_posix.lo
-am__objects_2 = libusb_1_0_la-darwin_usb.lo
-am__objects_3 = libusb_1_0_la-poll_posix.lo
-am__objects_4 = libusb_1_0_la-linux_usbfs.lo
-am__objects_5 = libusb_1_0_la-openbsd_usb.lo
-am__objects_6 = libusb_1_0_la-poll_windows.lo \
- libusb_1_0_la-windows_usb.lo libusb-1.0.lo
-@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_FALSE@@OS_WINDOWS_TRUE@am__objects_7 = $(am__objects_6)
-@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@am__objects_7 = $(am__objects_5) \
-@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@ $(am__objects_3)
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@am__objects_7 = $(am__objects_4) \
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ $(am__objects_3) \
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ libusb_1_0_la-linux_netlink.lo
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@am__objects_7 = $(am__objects_4) \
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ $(am__objects_3) \
-@OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ libusb_1_0_la-linux_udev.lo
-@OS_DARWIN_TRUE@am__objects_7 = $(am__objects_2) $(am__objects_3)
-am_libusb_1_0_la_OBJECTS = libusb_1_0_la-core.lo \
- libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo \
- libusb_1_0_la-strerror.lo libusb_1_0_la-sync.lo \
- libusb_1_0_la-hotplug.lo $(am__objects_1) $(am__objects_7)
-libusb_1_0_la_OBJECTS = $(am_libusb_1_0_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libusb_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libusb_1_0_la_CFLAGS) \
- $(CFLAGS) $(libusb_1_0_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libusb_1_0_la_SOURCES)
-DIST_SOURCES = $(am__libusb_1_0_la_SOURCES_DIST)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-HEADERS = $(hdr_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLDFLAGS = @LTLDFLAGS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS_DARWIN = @OS_DARWIN@
-OS_LINUX = @OS_LINUX@
-OS_OPENBSD = @OS_OPENBSD@
-OS_WINDOWS = @OS_WINDOWS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-RC = @RC@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_UDEV = @USE_UDEV@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-lib_LTLIBRARIES = libusb-1.0.la
-POSIX_POLL_SRC = os/poll_posix.c
-LINUX_USBFS_SRC = os/linux_usbfs.c
-DARWIN_USB_SRC = os/darwin_usb.c
-OPENBSD_USB_SRC = os/openbsd_usb.c
-WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def
-WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h
-EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \
- $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \
- $(POSIX_POLL_SRC) \
- os/threads_posix.c os/threads_windows.c \
- os/linux_udev.c os/linux_netlink.c
-
-@OS_DARWIN_TRUE@OS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)
-@OS_LINUX_TRUE@@USE_UDEV_FALSE@OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
-@OS_LINUX_TRUE@@USE_UDEV_FALSE@ os/linux_netlink.c
-
-@OS_LINUX_TRUE@@USE_UDEV_TRUE@OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
-@OS_LINUX_TRUE@@USE_UDEV_TRUE@ os/linux_udev.c
-
-@OS_OPENBSD_TRUE@OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)
-@OS_WINDOWS_TRUE@OS_SRC = $(WINDOWS_USB_SRC)
-@OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp
-@THREADS_POSIX_FALSE@THREADS_SRC = os/threads_windows.h os/threads_windows.c
-@THREADS_POSIX_TRUE@THREADS_SRC = os/threads_posix.h os/threads_posix.c
-libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
-libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
-libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c strerror.c sync.c \
- os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h os/windows_common.h \
- hotplug.h hotplug.c $(THREADS_SRC) $(OS_SRC) \
- os/poll_posix.h os/poll_windows.h
-
-hdrdir = $(includedir)/libusb-1.0
-hdr_HEADERS = libusb.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj .rc
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libusb/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu libusb/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
- }
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) $(EXTRA_libusb_1_0_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libusb_1_0_la_LINK) -rpath $(libdir) $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-core.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-descriptor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-hotplug.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-io.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_udev.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-strerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-sync.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-windows_usb.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-libusb_1_0_la-core.lo: core.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-core.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-core.Tpo -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-core.Tpo $(DEPDIR)/libusb_1_0_la-core.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core.c' object='libusb_1_0_la-core.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c
-
-libusb_1_0_la-descriptor.lo: descriptor.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-descriptor.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-descriptor.Tpo -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-descriptor.Tpo $(DEPDIR)/libusb_1_0_la-descriptor.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='descriptor.c' object='libusb_1_0_la-descriptor.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c
-
-libusb_1_0_la-io.lo: io.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-io.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-io.Tpo -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-io.Tpo $(DEPDIR)/libusb_1_0_la-io.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='libusb_1_0_la-io.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c
-
-libusb_1_0_la-strerror.lo: strerror.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-strerror.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-strerror.Tpo -c -o libusb_1_0_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-strerror.Tpo $(DEPDIR)/libusb_1_0_la-strerror.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libusb_1_0_la-strerror.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
-
-libusb_1_0_la-sync.lo: sync.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-sync.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-sync.Tpo -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-sync.Tpo $(DEPDIR)/libusb_1_0_la-sync.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync.c' object='libusb_1_0_la-sync.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
-
-libusb_1_0_la-hotplug.lo: hotplug.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-hotplug.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-hotplug.Tpo -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-hotplug.Tpo $(DEPDIR)/libusb_1_0_la-hotplug.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hotplug.c' object='libusb_1_0_la-hotplug.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c
-
-libusb_1_0_la-threads_windows.lo: os/threads_windows.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo $(DEPDIR)/libusb_1_0_la-threads_windows.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_windows.c' object='libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c
-
-libusb_1_0_la-threads_posix.lo: os/threads_posix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo $(DEPDIR)/libusb_1_0_la-threads_posix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_posix.c' object='libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c
-
-libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo $(DEPDIR)/libusb_1_0_la-darwin_usb.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/darwin_usb.c' object='libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c
-
-libusb_1_0_la-poll_posix.lo: os/poll_posix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_posix.Tpo -c -o libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_posix.Tpo $(DEPDIR)/libusb_1_0_la-poll_posix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_posix.c' object='libusb_1_0_la-poll_posix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c
-
-libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_usbfs.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo $(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_usbfs.c' object='libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c
-
-libusb_1_0_la-linux_netlink.lo: os/linux_netlink.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_netlink.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo $(DEPDIR)/libusb_1_0_la-linux_netlink.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_netlink.c' object='libusb_1_0_la-linux_netlink.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c
-
-libusb_1_0_la-linux_udev.lo: os/linux_udev.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_udev.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo $(DEPDIR)/libusb_1_0_la-linux_udev.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_udev.c' object='libusb_1_0_la-linux_udev.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c
-
-libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-openbsd_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo $(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/openbsd_usb.c' object='libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c
-
-libusb_1_0_la-poll_windows.lo: os/poll_windows.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo $(DEPDIR)/libusb_1_0_la-poll_windows.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_windows.c' object='libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c
-
-libusb_1_0_la-windows_usb.lo: os/windows_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-windows_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo $(DEPDIR)/libusb_1_0_la-windows_usb.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_usb.c' object='libusb_1_0_la-windows_usb.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-hdrHEADERS: $(hdr_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(hdrdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(hdrdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(hdrdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(hdrdir)" || exit $$?; \
- done
-
-uninstall-hdrHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(hdrdir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-hdrHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-hdrHEADERS uninstall-libLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-hdrHEADERS install-html \
- install-html-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am uninstall-hdrHEADERS \
- uninstall-libLTLIBRARIES
-
-all: libusb-1.0.la libusb-1.0.dll
-
-@OS_WINDOWS_TRUE@.rc.lo:
-@OS_WINDOWS_TRUE@ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
-
-@OS_WINDOWS_TRUE@libusb-1.0.rc: version.h version_nano.h
-
-libusb-1.0.dll: libusb-1.0.def
-# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged
-@CREATE_IMPORT_LIB_TRUE@ $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/core.c b/src/3rd_party-static/libusbx-1.0.16/libusb/core.c
deleted file mode 100644
index e29e8df254..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/core.c
+++ /dev/null
@@ -1,2228 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
-/*
- * Core functions for libusbx
- * Copyright © 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu>
- * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef __ANDROID__
-#include <android/log.h>
-#endif
-
-#include "libusbi.h"
-#include "hotplug.h"
-
-#if defined(OS_LINUX)
-const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;
-#elif defined(OS_DARWIN)
-const struct usbi_os_backend * const usbi_backend = &darwin_backend;
-#elif defined(OS_OPENBSD)
-const struct usbi_os_backend * const usbi_backend = &openbsd_backend;
-#elif defined(OS_WINDOWS)
-const struct usbi_os_backend * const usbi_backend = &windows_backend;
-#elif defined(OS_WINCE)
-const struct usbi_os_backend * const usbi_backend = &wince_backend;
-#else
-#error "Unsupported OS"
-#endif
-
-struct libusb_context *usbi_default_context = NULL;
-const struct libusb_version libusb_version_internal =
- { LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO,
- LIBUSB_RC, "http://libusbx.org" };
-static int default_context_refcnt = 0;
-static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;
-static struct timeval timestamp_origin = { 0, 0 };
-
-usbi_mutex_static_t active_contexts_lock = USBI_MUTEX_INITIALIZER;
-struct list_head active_contexts_list;
-
-/**
- * \mainpage libusbx-1.0 API Reference
- *
- * \section intro Introduction
- *
- * libusbx is an open source library that allows you to communicate with USB
- * devices from userspace. For more info, see the
- * <a href="http://libusbx.org">libusbx homepage</a>.
- *
- * This documentation is aimed at application developers wishing to
- * communicate with USB peripherals from their own software. After reviewing
- * this documentation, feedback and questions can be sent to the
- * <a href="http://mailing-list.libusbx.org">libusbx-devel mailing list</a>.
- *
- * This documentation assumes knowledge of how to operate USB devices from
- * a software standpoint (descriptors, configurations, interfaces, endpoints,
- * control/bulk/interrupt/isochronous transfers, etc). Full information
- * can be found in the <a href="http://www.usb.org/developers/docs/">USB 3.0
- * Specification</a> which is available for free download. You can probably
- * find less verbose introductions by searching the web.
- *
- * \section features Library features
- *
- * - All transfer types supported (control/bulk/interrupt/isochronous)
- * - 2 transfer interfaces:
- * -# Synchronous (simple)
- * -# Asynchronous (more complicated, but more powerful)
- * - Thread safe (although the asynchronous interface means that you
- * usually won't need to thread)
- * - Lightweight with lean API
- * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer
- * - Hotplug support (on some platforms). See \ref hotplug.
- *
- * \section gettingstarted Getting Started
- *
- * To begin reading the API documentation, start with the Modules page which
- * links to the different categories of libusbx's functionality.
- *
- * One decision you will have to make is whether to use the synchronous
- * or the asynchronous data transfer interface. The \ref io documentation
- * provides some insight into this topic.
- *
- * Some example programs can be found in the libusbx source distribution under
- * the "examples" subdirectory. The libusbx homepage includes a list of
- * real-life project examples which use libusbx.
- *
- * \section errorhandling Error handling
- *
- * libusbx functions typically return 0 on success or a negative error code
- * on failure. These negative error codes relate to LIBUSB_ERROR constants
- * which are listed on the \ref misc "miscellaneous" documentation page.
- *
- * \section msglog Debug message logging
- *
- * libusbx uses stderr for all logging. By default, logging is set to NONE,
- * which means that no output will be produced. However, unless the library
- * has been compiled with logging disabled, then any application calls to
- * libusb_set_debug(), or the setting of the environmental variable
- * LIBUSB_DEBUG outside of the application, can result in logging being
- * produced. Your application should therefore not close stderr, but instead
- * direct it to the null device if its output is undesireable.
- *
- * The libusb_set_debug() function can be used to enable logging of certain
- * messages. Under standard configuration, libusbx doesn't really log much
- * so you are advised to use this function to enable all error/warning/
- * informational messages. It will help debug problems with your software.
- *
- * The logged messages are unstructured. There is no one-to-one correspondence
- * between messages being logged and success or failure return codes from
- * libusbx functions. There is no format to the messages, so you should not
- * try to capture or parse them. They are not and will not be localized.
- * These messages are not intended to being passed to your application user;
- * instead, you should interpret the error codes returned from libusbx functions
- * and provide appropriate notification to the user. The messages are simply
- * there to aid you as a programmer, and if you're confused because you're
- * getting a strange error code from a libusbx function, enabling message
- * logging may give you a suitable explanation.
- *
- * The LIBUSB_DEBUG environment variable can be used to enable message logging
- * at run-time. This environment variable should be set to a log level number,
- * which is interpreted the same as the libusb_set_debug() parameter. When this
- * environment variable is set, the message logging verbosity level is fixed
- * and libusb_set_debug() effectively does nothing.
- *
- * libusbx can be compiled without any logging functions, useful for embedded
- * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment
- * variable have no effects.
- *
- * libusbx can also be compiled with verbose debugging messages always. When
- * the library is compiled in this way, all messages of all verbosities are
- * always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable
- * have no effects.
- *
- * \section remarks Other remarks
- *
- * libusbx does have imperfections. The \ref caveats "caveats" page attempts
- * to document these.
- */
-
-/**
- * \page caveats Caveats
- *
- * \section devresets Device resets
- *
- * The libusb_reset_device() function allows you to reset a device. If your
- * program has to call such a function, it should obviously be aware that
- * the reset will cause device state to change (e.g. register values may be
- * reset).
- *
- * The problem is that any other program could reset the device your program
- * is working with, at any time. libusbx does not offer a mechanism to inform
- * you when this has happened, so if someone else resets your device it will
- * not be clear to your own program why the device state has changed.
- *
- * Ultimately, this is a limitation of writing drivers in userspace.
- * Separation from the USB stack in the underlying kernel makes it difficult
- * for the operating system to deliver such notifications to your program.
- * The Linux kernel USB stack allows such reset notifications to be delivered
- * to in-kernel USB drivers, but it is not clear how such notifications could
- * be delivered to second-class drivers that live in userspace.
- *
- * \section blockonly Blocking-only functionality
- *
- * The functionality listed below is only available through synchronous,
- * blocking functions. There are no asynchronous/non-blocking alternatives,
- * and no clear ways of implementing these.
- *
- * - Configuration activation (libusb_set_configuration())
- * - Interface/alternate setting activation (libusb_set_interface_alt_setting())
- * - Releasing of interfaces (libusb_release_interface())
- * - Clearing of halt/stall condition (libusb_clear_halt())
- * - Device resets (libusb_reset_device())
- *
- * \section configsel Configuration selection and handling
- *
- * When libusbx presents a device handle to an application, there is a chance
- * that the corresponding device may be in unconfigured state. For devices
- * with multiple configurations, there is also a chance that the configuration
- * currently selected is not the one that the application wants to use.
- *
- * The obvious solution is to add a call to libusb_set_configuration() early
- * on during your device initialization routines, but there are caveats to
- * be aware of:
- * -# If the device is already in the desired configuration, calling
- * libusb_set_configuration() using the same configuration value will cause
- * a lightweight device reset. This may not be desirable behaviour.
- * -# libusbx will be unable to change configuration if the device is in
- * another configuration and other programs or drivers have claimed
- * interfaces under that configuration.
- * -# In the case where the desired configuration is already active, libusbx
- * may not even be able to perform a lightweight device reset. For example,
- * take my USB keyboard with fingerprint reader: I'm interested in driving
- * the fingerprint reader interface through libusbx, but the kernel's
- * USB-HID driver will almost always have claimed the keyboard interface.
- * Because the kernel has claimed an interface, it is not even possible to
- * perform the lightweight device reset, so libusb_set_configuration() will
- * fail. (Luckily the device in question only has a single configuration.)
- *
- * One solution to some of the above problems is to consider the currently
- * active configuration. If the configuration we want is already active, then
- * we don't have to select any configuration:
-\code
-cfg = libusb_get_configuration(dev);
-if (cfg != desired)
- libusb_set_configuration(dev, desired);
-\endcode
- *
- * This is probably suitable for most scenarios, but is inherently racy:
- * another application or driver may change the selected configuration
- * <em>after</em> the libusb_get_configuration() call.
- *
- * Even in cases where libusb_set_configuration() succeeds, consider that other
- * applications or drivers may change configuration after your application
- * calls libusb_set_configuration().
- *
- * One possible way to lock your device into a specific configuration is as
- * follows:
- * -# Set the desired configuration (or use the logic above to realise that
- * it is already in the desired configuration)
- * -# Claim the interface that you wish to use
- * -# Check that the currently active configuration is the one that you want
- * to use.
- *
- * The above method works because once an interface is claimed, no application
- * or driver is able to select another configuration.
- *
- * \section earlycomp Early transfer completion
- *
- * NOTE: This section is currently Linux-centric. I am not sure if any of these
- * considerations apply to Darwin or other platforms.
- *
- * When a transfer completes early (i.e. when less data is received/sent in
- * any one packet than the transfer buffer allows for) then libusbx is designed
- * to terminate the transfer immediately, not transferring or receiving any
- * more data unless other transfers have been queued by the user.
- *
- * On legacy platforms, libusbx is unable to do this in all situations. After
- * the incomplete packet occurs, "surplus" data may be transferred. For recent
- * versions of libusbx, this information is kept (the data length of the
- * transfer is updated) and, for device-to-host transfers, any surplus data was
- * added to the buffer. Still, this is not a nice solution because it loses the
- * information about the end of the short packet, and the user probably wanted
- * that surplus data to arrive in the next logical transfer.
- *
- *
- * \section zlp Zero length packets
- *
- * - libusbx is able to send a packet of zero length to an endpoint simply by
- * submitting a transfer of zero length.
- * - The \ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET
- * "LIBUSB_TRANSFER_ADD_ZERO_PACKET" flag is currently only supported on Linux.
- */
-
-/**
- * \page contexts Contexts
- *
- * It is possible that libusbx may be used simultaneously from two independent
- * libraries linked into the same executable. For example, if your application
- * has a plugin-like system which allows the user to dynamically load a range
- * of modules into your program, it is feasible that two independently
- * developed modules may both use libusbx.
- *
- * libusbx is written to allow for these multiple user scenarios. The two
- * "instances" of libusbx will not interfere: libusb_set_debug() calls
- * from one user will not affect the same settings for other users, other
- * users can continue using libusbx after one of them calls libusb_exit(), etc.
- *
- * This is made possible through libusbx's <em>context</em> concept. When you
- * call libusb_init(), you are (optionally) given a context. You can then pass
- * this context pointer back into future libusbx functions.
- *
- * In order to keep things simple for more simplistic applications, it is
- * legal to pass NULL to all functions requiring a context pointer (as long as
- * you're sure no other code will attempt to use libusbx from the same process).
- * When you pass NULL, the default context will be used. The default context
- * is created the first time a process calls libusb_init() when no other
- * context is alive. Contexts are destroyed during libusb_exit().
- *
- * The default context is reference-counted and can be shared. That means that
- * if libusb_init(NULL) is called twice within the same process, the two
- * users end up sharing the same context. The deinitialization and freeing of
- * the default context will only happen when the last user calls libusb_exit().
- * In other words, the default context is created and initialized when its
- * reference count goes from 0 to 1, and is deinitialized and destroyed when
- * its reference count goes from 1 to 0.
- *
- * You may be wondering why only a subset of libusbx functions require a
- * context pointer in their function definition. Internally, libusbx stores
- * context pointers in other objects (e.g. libusb_device instances) and hence
- * can infer the context from those objects.
- */
-
-/**
- * @defgroup lib Library initialization/deinitialization
- * This page details how to initialize and deinitialize libusbx. Initialization
- * must be performed before using any libusbx functionality, and similarly you
- * must not call any libusbx functions after deinitialization.
- */
-
-/**
- * @defgroup dev Device handling and enumeration
- * The functionality documented below is designed to help with the following
- * operations:
- * - Enumerating the USB devices currently attached to the system
- * - Choosing a device to operate from your software
- * - Opening and closing the chosen device
- *
- * \section nutshell In a nutshell...
- *
- * The description below really makes things sound more complicated than they
- * actually are. The following sequence of function calls will be suitable
- * for almost all scenarios and does not require you to have such a deep
- * understanding of the resource management issues:
- * \code
-// discover devices
-libusb_device **list;
-libusb_device *found = NULL;
-ssize_t cnt = libusb_get_device_list(NULL, &list);
-ssize_t i = 0;
-int err = 0;
-if (cnt < 0)
- error();
-
-for (i = 0; i < cnt; i++) {
- libusb_device *device = list[i];
- if (is_interesting(device)) {
- found = device;
- break;
- }
-}
-
-if (found) {
- libusb_device_handle *handle;
-
- err = libusb_open(found, &handle);
- if (err)
- error();
- // etc
-}
-
-libusb_free_device_list(list, 1);
-\endcode
- *
- * The two important points:
- * - You asked libusb_free_device_list() to unreference the devices (2nd
- * parameter)
- * - You opened the device before freeing the list and unreferencing the
- * devices
- *
- * If you ended up with a handle, you can now proceed to perform I/O on the
- * device.
- *
- * \section devshandles Devices and device handles
- * libusbx has a concept of a USB device, represented by the
- * \ref libusb_device opaque type. A device represents a USB device that
- * is currently or was previously connected to the system. Using a reference
- * to a device, you can determine certain information about the device (e.g.
- * you can read the descriptor data).
- *
- * The libusb_get_device_list() function can be used to obtain a list of
- * devices currently connected to the system. This is known as device
- * discovery.
- *
- * Just because you have a reference to a device does not mean it is
- * necessarily usable. The device may have been unplugged, you may not have
- * permission to operate such device, or another program or driver may be
- * using the device.
- *
- * When you've found a device that you'd like to operate, you must ask
- * libusbx to open the device using the libusb_open() function. Assuming
- * success, libusbx then returns you a <em>device handle</em>
- * (a \ref libusb_device_handle pointer). All "real" I/O operations then
- * operate on the handle rather than the original device pointer.
- *
- * \section devref Device discovery and reference counting
- *
- * Device discovery (i.e. calling libusb_get_device_list()) returns a
- * freshly-allocated list of devices. The list itself must be freed when
- * you are done with it. libusbx also needs to know when it is OK to free
- * the contents of the list - the devices themselves.
- *
- * To handle these issues, libusbx provides you with two separate items:
- * - A function to free the list itself
- * - A reference counting system for the devices inside
- *
- * New devices presented by the libusb_get_device_list() function all have a
- * reference count of 1. You can increase and decrease reference count using
- * libusb_ref_device() and libusb_unref_device(). A device is destroyed when
- * its reference count reaches 0.
- *
- * With the above information in mind, the process of opening a device can
- * be viewed as follows:
- * -# Discover devices using libusb_get_device_list().
- * -# Choose the device that you want to operate, and call libusb_open().
- * -# Unref all devices in the discovered device list.
- * -# Free the discovered device list.
- *
- * The order is important - you must not unreference the device before
- * attempting to open it, because unreferencing it may destroy the device.
- *
- * For convenience, the libusb_free_device_list() function includes a
- * parameter to optionally unreference all the devices in the list before
- * freeing the list itself. This combines steps 3 and 4 above.
- *
- * As an implementation detail, libusb_open() actually adds a reference to
- * the device in question. This is because the device remains available
- * through the handle via libusb_get_device(). The reference is deleted during
- * libusb_close().
- */
-
-/** @defgroup misc Miscellaneous */
-
-/* we traverse usbfs without knowing how many devices we are going to find.
- * so we create this discovered_devs model which is similar to a linked-list
- * which grows when required. it can be freed once discovery has completed,
- * eliminating the need for a list node in the libusb_device structure
- * itself. */
-#define DISCOVERED_DEVICES_SIZE_STEP 8
-
-static struct discovered_devs *discovered_devs_alloc(void)
-{
- struct discovered_devs *ret =
- malloc(sizeof(*ret) + (sizeof(void *) * DISCOVERED_DEVICES_SIZE_STEP));
-
- if (ret) {
- ret->len = 0;
- ret->capacity = DISCOVERED_DEVICES_SIZE_STEP;
- }
- return ret;
-}
-
-/* append a device to the discovered devices collection. may realloc itself,
- * returning new discdevs. returns NULL on realloc failure. */
-struct discovered_devs *discovered_devs_append(
- struct discovered_devs *discdevs, struct libusb_device *dev)
-{
- size_t len = discdevs->len;
- size_t capacity;
-
- /* if there is space, just append the device */
- if (len < discdevs->capacity) {
- discdevs->devices[len] = libusb_ref_device(dev);
- discdevs->len++;
- return discdevs;
- }
-
- /* exceeded capacity, need to grow */
- usbi_dbg("need to increase capacity");
- capacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP;
- discdevs = usbi_reallocf(discdevs,
- sizeof(*discdevs) + (sizeof(void *) * capacity));
- if (discdevs) {
- discdevs->capacity = capacity;
- discdevs->devices[len] = libusb_ref_device(dev);
- discdevs->len++;
- }
-
- return discdevs;
-}
-
-static void discovered_devs_free(struct discovered_devs *discdevs)
-{
- size_t i;
-
- for (i = 0; i < discdevs->len; i++)
- libusb_unref_device(discdevs->devices[i]);
-
- free(discdevs);
-}
-
-/* Allocate a new device with a specific session ID. The returned device has
- * a reference count of 1. */
-struct libusb_device *usbi_alloc_device(struct libusb_context *ctx,
- unsigned long session_id)
-{
- size_t priv_size = usbi_backend->device_priv_size;
- struct libusb_device *dev = calloc(1, sizeof(*dev) + priv_size);
- int r;
-
- if (!dev)
- return NULL;
-
- r = usbi_mutex_init(&dev->lock, NULL);
- if (r) {
- free(dev);
- return NULL;
- }
-
- dev->ctx = ctx;
- dev->refcnt = 1;
- dev->session_data = session_id;
- dev->speed = LIBUSB_SPEED_UNKNOWN;
-
- if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- usbi_connect_device (dev);
- }
-
- return dev;
-}
-
-void usbi_connect_device(struct libusb_device *dev)
-{
- libusb_hotplug_message message;
- ssize_t ret;
-
- memset(&message, 0, sizeof(message));
- message.event = LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED;
- message.device = dev;
- dev->attached = 1;
-
- usbi_mutex_lock(&dev->ctx->usb_devs_lock);
- list_add(&dev->list, &dev->ctx->usb_devs);
- usbi_mutex_unlock(&dev->ctx->usb_devs_lock);
-
- /* Signal that an event has occurred for this device if we support hotplug AND
- * the hotplug pipe is ready. This prevents an event from getting raised during
- * initial enumeration. */
- if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) {
- ret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));
- if (sizeof (message) != ret) {
- usbi_err(DEVICE_CTX(dev), "error writing hotplug message");
- }
- }
-}
-
-void usbi_disconnect_device(struct libusb_device *dev)
-{
- libusb_hotplug_message message;
- struct libusb_context *ctx = dev->ctx;
- ssize_t ret;
-
- memset(&message, 0, sizeof(message));
- message.event = LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT;
- message.device = dev;
- usbi_mutex_lock(&dev->lock);
- dev->attached = 0;
- usbi_mutex_unlock(&dev->lock);
-
- /* Signal that an event has occurred for this device if we support hotplug AND
- * the hotplug pipe is ready. This prevents an event from getting raised during
- * initial enumeration. libusb_handle_events will take care of dereferencing the
- * device. */
- if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) {
- ret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));
- if (sizeof(message) != ret) {
- usbi_err(DEVICE_CTX(dev), "error writing hotplug message");
- }
- }
-
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_del(&dev->list);
- usbi_mutex_unlock(&ctx->usb_devs_lock);
-}
-
-/* Perform some final sanity checks on a newly discovered device. If this
- * function fails (negative return code), the device should not be added
- * to the discovered device list. */
-int usbi_sanitize_device(struct libusb_device *dev)
-{
- int r;
- uint8_t num_configurations;
-
- r = usbi_device_cache_descriptor(dev);
- if (r < 0)
- return r;
-
- num_configurations = dev->device_descriptor.bNumConfigurations;
- if (num_configurations > USB_MAXCONFIG) {
- usbi_err(DEVICE_CTX(dev), "too many configurations");
- return LIBUSB_ERROR_IO;
- } else if (0 == num_configurations)
- usbi_dbg("zero configurations, maybe an unauthorized device");
-
- dev->num_configurations = num_configurations;
- return 0;
-}
-
-/* Examine libusbx's internal list of known devices, looking for one with
- * a specific session ID. Returns the matching device if it was found, and
- * NULL otherwise. */
-struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,
- unsigned long session_id)
-{
- struct libusb_device *dev;
- struct libusb_device *ret = NULL;
-
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device)
- if (dev->session_data == session_id) {
- ret = dev;
- break;
- }
- usbi_mutex_unlock(&ctx->usb_devs_lock);
-
- return ret;
-}
-
-/** @ingroup dev
- * Returns a list of USB devices currently attached to the system. This is
- * your entry point into finding a USB device to operate.
- *
- * You are expected to unreference all the devices when you are done with
- * them, and then free the list with libusb_free_device_list(). Note that
- * libusb_free_device_list() can unref all the devices for you. Be careful
- * not to unreference a device you are about to open until after you have
- * opened it.
- *
- * This return value of this function indicates the number of devices in
- * the resultant list. The list is actually one element larger, as it is
- * NULL-terminated.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param list output location for a list of devices. Must be later freed with
- * libusb_free_device_list().
- * \returns the number of devices in the outputted list, or any
- * \ref libusb_error according to errors encountered by the backend.
- */
-ssize_t API_EXPORTED libusb_get_device_list(libusb_context *ctx,
- libusb_device ***list)
-{
- struct discovered_devs *discdevs = discovered_devs_alloc();
- struct libusb_device **ret;
- int r = 0;
- ssize_t i, len;
- USBI_GET_CONTEXT(ctx);
- usbi_dbg("");
-
- if (!discdevs)
- return LIBUSB_ERROR_NO_MEM;
-
- if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- /* backend provides hotplug support */
- struct libusb_device *dev;
-
- if (usbi_backend->hotplug_poll)
- usbi_backend->hotplug_poll();
-
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) {
- discdevs = discovered_devs_append(discdevs, dev);
-
- if (!discdevs) {
- r = LIBUSB_ERROR_NO_MEM;
- break;
- }
- }
- usbi_mutex_unlock(&ctx->usb_devs_lock);
- } else {
- /* backend does not provide hotplug support */
- r = usbi_backend->get_device_list(ctx, &discdevs);
- }
-
- if (r < 0) {
- len = r;
- goto out;
- }
-
- /* convert discovered_devs into a list */
- len = discdevs->len;
- ret = calloc(len + 1, sizeof(struct libusb_device *));
- if (!ret) {
- len = LIBUSB_ERROR_NO_MEM;
- goto out;
- }
-
- ret[len] = NULL;
- for (i = 0; i < len; i++) {
- struct libusb_device *dev = discdevs->devices[i];
- ret[i] = libusb_ref_device(dev);
- }
- *list = ret;
-
-out:
- discovered_devs_free(discdevs);
- return len;
-}
-
-/** \ingroup dev
- * Frees a list of devices previously discovered using
- * libusb_get_device_list(). If the unref_devices parameter is set, the
- * reference count of each device in the list is decremented by 1.
- * \param list the list to free
- * \param unref_devices whether to unref the devices in the list
- */
-void API_EXPORTED libusb_free_device_list(libusb_device **list,
- int unref_devices)
-{
- if (!list)
- return;
-
- if (unref_devices) {
- int i = 0;
- struct libusb_device *dev;
-
- while ((dev = list[i++]) != NULL)
- libusb_unref_device(dev);
- }
- free(list);
-}
-
-/** \ingroup dev
- * Get the number of the bus that a device is connected to.
- * \param dev a device
- * \returns the bus number
- */
-uint8_t API_EXPORTED libusb_get_bus_number(libusb_device *dev)
-{
- return dev->bus_number;
-}
-
-/** \ingroup dev
- * Get the number of the port that a device is connected to.
- * Unless the OS does something funky, or you are hot-plugging USB extension cards,
- * the port number returned by this call is usually guaranteed to be uniquely tied
- * to a physical port, meaning that different devices plugged on the same physical
- * port should return the same port number.
- *
- * But outside of this, there is no guarantee that the port number returned by this
- * call will remain the same, or even match the order in which ports have been
- * numbered by the HUB/HCD manufacturer.
- *
- * \param dev a device
- * \returns the port number (0 if not available)
- */
-uint8_t API_EXPORTED libusb_get_port_number(libusb_device *dev)
-{
- return dev->port_number;
-}
-
-/** \ingroup dev
- * Get the list of all port numbers from root for the specified device
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- * \param dev a device
- * \param port_numbers the array that should contain the port numbers
- * \param port_numbers_len the maximum length of the array. As per the USB 3.0
- * specs, the current maximum limit for the depth is 7.
- * \returns the number of elements filled
- * \returns LIBUSB_ERROR_OVERFLOW if the array is too small
- */
-int API_EXPORTED libusb_get_port_numbers(libusb_device *dev,
- uint8_t* port_numbers, int port_numbers_len)
-{
- int i = port_numbers_len;
-
- while(dev) {
- // HCDs can be listed as devices and would have port #0
- // TODO: see how the other backends want to implement HCDs as parents
- if (dev->port_number == 0)
- break;
- i--;
- if (i < 0) {
- usbi_warn(DEVICE_CTX(dev),
- "port numbers array too small");
- return LIBUSB_ERROR_OVERFLOW;
- }
- port_numbers[i] = dev->port_number;
- dev = dev->parent_dev;
- }
- memmove(port_numbers, &port_numbers[i], port_numbers_len - i);
- return port_numbers_len - i;
-}
-
-/** \ingroup dev
- * Deprecated please use libusb_get_port_numbers instead.
- */
-int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,
- uint8_t* port_numbers, uint8_t port_numbers_len)
-{
- UNUSED(ctx);
-
- return libusb_get_port_numbers(dev, port_numbers, port_numbers_len);
-}
-
-/** \ingroup dev
- * Get the the parent from the specified device.
- * \param dev a device
- * \returns the device parent or NULL if not available
- * You should issue a \ref libusb_get_device_list() before calling this
- * function and make sure that you only access the parent before issuing
- * \ref libusb_free_device_list(). The reason is that libusbx currently does
- * not maintain a permanent list of device instances, and therefore can
- * only guarantee that parents are fully instantiated within a
- * libusb_get_device_list() - libusb_free_device_list() block.
- */
-DEFAULT_VISIBILITY
-libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev)
-{
- return dev->parent_dev;
-}
-
-/** \ingroup dev
- * Get the address of the device on the bus it is connected to.
- * \param dev a device
- * \returns the device address
- */
-uint8_t API_EXPORTED libusb_get_device_address(libusb_device *dev)
-{
- return dev->device_address;
-}
-
-/** \ingroup dev
- * Get the negotiated connection speed for a device.
- * \param dev a device
- * \returns a \ref libusb_speed code, where LIBUSB_SPEED_UNKNOWN means that
- * the OS doesn't know or doesn't support returning the negotiated speed.
- */
-int API_EXPORTED libusb_get_device_speed(libusb_device *dev)
-{
- return dev->speed;
-}
-
-static const struct libusb_endpoint_descriptor *find_endpoint(
- struct libusb_config_descriptor *config, unsigned char endpoint)
-{
- int iface_idx;
- for (iface_idx = 0; iface_idx < config->bNumInterfaces; iface_idx++) {
- const struct libusb_interface *iface = &config->interface[iface_idx];
- int altsetting_idx;
-
- for (altsetting_idx = 0; altsetting_idx < iface->num_altsetting;
- altsetting_idx++) {
- const struct libusb_interface_descriptor *altsetting
- = &iface->altsetting[altsetting_idx];
- int ep_idx;
-
- for (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {
- const struct libusb_endpoint_descriptor *ep =
- &altsetting->endpoint[ep_idx];
- if (ep->bEndpointAddress == endpoint)
- return ep;
- }
- }
- }
- return NULL;
-}
-
-/** \ingroup dev
- * Convenience function to retrieve the wMaxPacketSize value for a particular
- * endpoint in the active device configuration.
- *
- * This function was originally intended to be of assistance when setting up
- * isochronous transfers, but a design mistake resulted in this function
- * instead. It simply returns the wMaxPacketSize value without considering
- * its contents. If you're dealing with isochronous transfers, you probably
- * want libusb_get_max_iso_packet_size() instead.
- *
- * \param dev a device
- * \param endpoint address of the endpoint in question
- * \returns the wMaxPacketSize value
- * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
- * \returns LIBUSB_ERROR_OTHER on other failure
- */
-int API_EXPORTED libusb_get_max_packet_size(libusb_device *dev,
- unsigned char endpoint)
-{
- struct libusb_config_descriptor *config;
- const struct libusb_endpoint_descriptor *ep;
- int r;
-
- r = libusb_get_active_config_descriptor(dev, &config);
- if (r < 0) {
- usbi_err(DEVICE_CTX(dev),
- "could not retrieve active config descriptor");
- return LIBUSB_ERROR_OTHER;
- }
-
- ep = find_endpoint(config, endpoint);
- if (!ep)
- return LIBUSB_ERROR_NOT_FOUND;
-
- r = ep->wMaxPacketSize;
- libusb_free_config_descriptor(config);
- return r;
-}
-
-/** \ingroup dev
- * Calculate the maximum packet size which a specific endpoint is capable is
- * sending or receiving in the duration of 1 microframe
- *
- * Only the active configuration is examined. The calculation is based on the
- * wMaxPacketSize field in the endpoint descriptor as described in section
- * 9.6.6 in the USB 2.0 specifications.
- *
- * If acting on an isochronous or interrupt endpoint, this function will
- * multiply the value found in bits 0:10 by the number of transactions per
- * microframe (determined by bits 11:12). Otherwise, this function just
- * returns the numeric value found in bits 0:10.
- *
- * This function is useful for setting up isochronous transfers, for example
- * you might pass the return value from this function to
- * libusb_set_iso_packet_lengths() in order to set the length field of every
- * isochronous packet in a transfer.
- *
- * Since v1.0.3.
- *
- * \param dev a device
- * \param endpoint address of the endpoint in question
- * \returns the maximum packet size which can be sent/received on this endpoint
- * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
- * \returns LIBUSB_ERROR_OTHER on other failure
- */
-int API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev,
- unsigned char endpoint)
-{
- struct libusb_config_descriptor *config;
- const struct libusb_endpoint_descriptor *ep;
- enum libusb_transfer_type ep_type;
- uint16_t val;
- int r;
-
- r = libusb_get_active_config_descriptor(dev, &config);
- if (r < 0) {
- usbi_err(DEVICE_CTX(dev),
- "could not retrieve active config descriptor");
- return LIBUSB_ERROR_OTHER;
- }
-
- ep = find_endpoint(config, endpoint);
- if (!ep)
- return LIBUSB_ERROR_NOT_FOUND;
-
- val = ep->wMaxPacketSize;
- ep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3);
- libusb_free_config_descriptor(config);
-
- r = val & 0x07ff;
- if (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
- || ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT)
- r *= (1 + ((val >> 11) & 3));
- return r;
-}
-
-/** \ingroup dev
- * Increment the reference count of a device.
- * \param dev the device to reference
- * \returns the same device
- */
-DEFAULT_VISIBILITY
-libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev)
-{
- usbi_mutex_lock(&dev->lock);
- dev->refcnt++;
- usbi_mutex_unlock(&dev->lock);
- return dev;
-}
-
-/** \ingroup dev
- * Decrement the reference count of a device. If the decrement operation
- * causes the reference count to reach zero, the device shall be destroyed.
- * \param dev the device to unreference
- */
-void API_EXPORTED libusb_unref_device(libusb_device *dev)
-{
- int refcnt;
-
- if (!dev)
- return;
-
- usbi_mutex_lock(&dev->lock);
- refcnt = --dev->refcnt;
- usbi_mutex_unlock(&dev->lock);
-
- if (refcnt == 0) {
- usbi_dbg("destroy device %d.%d", dev->bus_number, dev->device_address);
-
- libusb_unref_device(dev->parent_dev);
-
- if (usbi_backend->destroy_device)
- usbi_backend->destroy_device(dev);
-
- if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- /* backend does not support hotplug */
- usbi_disconnect_device(dev);
- }
-
- usbi_mutex_destroy(&dev->lock);
- free(dev);
- }
-}
-
-/*
- * Interrupt the iteration of the event handling thread, so that it picks
- * up the new fd.
- */
-void usbi_fd_notification(struct libusb_context *ctx)
-{
- unsigned char dummy = 1;
- ssize_t r;
-
- if (ctx == NULL)
- return;
-
- /* record that we are messing with poll fds */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify++;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
-
- /* write some data on control pipe to interrupt event handlers */
- r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
- if (r <= 0) {
- usbi_warn(ctx, "internal signalling write failed");
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify--;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
- return;
- }
-
- /* take event handling lock */
- libusb_lock_events(ctx);
-
- /* read the dummy data */
- r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));
- if (r <= 0)
- usbi_warn(ctx, "internal signalling read failed");
-
- /* we're done with modifying poll fds */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify--;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
-
- /* Release event handling lock and wake up event waiters */
- libusb_unlock_events(ctx);
-}
-
-/** \ingroup dev
- * Open a device and obtain a device handle. A handle allows you to perform
- * I/O on the device in question.
- *
- * Internally, this function adds a reference to the device and makes it
- * available to you through libusb_get_device(). This reference is removed
- * during libusb_close().
- *
- * This is a non-blocking function; no requests are sent over the bus.
- *
- * \param dev the device to open
- * \param handle output location for the returned device handle pointer. Only
- * populated when the return code is 0.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NO_MEM on memory allocation failure
- * \returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_open(libusb_device *dev,
- libusb_device_handle **handle)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev);
- struct libusb_device_handle *_handle;
- size_t priv_size = usbi_backend->device_handle_priv_size;
- int r;
- usbi_dbg("open %d.%d", dev->bus_number, dev->device_address);
-
- if (!dev->attached) {
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- _handle = malloc(sizeof(*_handle) + priv_size);
- if (!_handle)
- return LIBUSB_ERROR_NO_MEM;
-
- r = usbi_mutex_init(&_handle->lock, NULL);
- if (r) {
- free(_handle);
- return LIBUSB_ERROR_OTHER;
- }
-
- _handle->dev = libusb_ref_device(dev);
- _handle->auto_detach_kernel_driver = 0;
- _handle->claimed_interfaces = 0;
- memset(&_handle->os_priv, 0, priv_size);
-
- r = usbi_backend->open(_handle);
- if (r < 0) {
- usbi_dbg("open %d.%d returns %d", dev->bus_number, dev->device_address, r);
- libusb_unref_device(dev);
- usbi_mutex_destroy(&_handle->lock);
- free(_handle);
- return r;
- }
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- list_add(&_handle->list, &ctx->open_devs);
- usbi_mutex_unlock(&ctx->open_devs_lock);
- *handle = _handle;
-
- /* At this point, we want to interrupt any existing event handlers so
- * that they realise the addition of the new device's poll fd. One
- * example when this is desirable is if the user is running a separate
- * dedicated libusbx events handling thread, which is running with a long
- * or infinite timeout. We want to interrupt that iteration of the loop,
- * so that it picks up the new fd, and then continues. */
- usbi_fd_notification(ctx);
-
- return 0;
-}
-
-/** \ingroup dev
- * Convenience function for finding a device with a particular
- * <tt>idVendor</tt>/<tt>idProduct</tt> combination. This function is intended
- * for those scenarios where you are using libusbx to knock up a quick test
- * application - it allows you to avoid calling libusb_get_device_list() and
- * worrying about traversing/freeing the list.
- *
- * This function has limitations and is hence not intended for use in real
- * applications: if multiple devices have the same IDs it will only
- * give you the first one, etc.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param vendor_id the idVendor value to search for
- * \param product_id the idProduct value to search for
- * \returns a handle for the first found device, or NULL on error or if the
- * device could not be found. */
-DEFAULT_VISIBILITY
-libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(
- libusb_context *ctx, uint16_t vendor_id, uint16_t product_id)
-{
- struct libusb_device **devs;
- struct libusb_device *found = NULL;
- struct libusb_device *dev;
- struct libusb_device_handle *handle = NULL;
- size_t i = 0;
- int r;
-
- if (libusb_get_device_list(ctx, &devs) < 0)
- return NULL;
-
- while ((dev = devs[i++]) != NULL) {
- struct libusb_device_descriptor desc;
- r = libusb_get_device_descriptor(dev, &desc);
- if (r < 0)
- goto out;
- if (desc.idVendor == vendor_id && desc.idProduct == product_id) {
- found = dev;
- break;
- }
- }
-
- if (found) {
- r = libusb_open(found, &handle);
- if (r < 0)
- handle = NULL;
- }
-
-out:
- libusb_free_device_list(devs, 1);
- return handle;
-}
-
-static void do_close(struct libusb_context *ctx,
- struct libusb_device_handle *dev_handle)
-{
- struct usbi_transfer *itransfer;
- struct usbi_transfer *tmp;
-
- libusb_lock_events(ctx);
-
- /* remove any transfers in flight that are for this device */
- usbi_mutex_lock(&ctx->flying_transfers_lock);
-
- /* safe iteration because transfers may be being deleted */
- list_for_each_entry_safe(itransfer, tmp, &ctx->flying_transfers, list, struct usbi_transfer) {
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- if (transfer->dev_handle != dev_handle)
- continue;
-
- if (!(itransfer->flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) {
- usbi_err(ctx, "Device handle closed while transfer was still being processed, but the device is still connected as far as we know");
-
- if (itransfer->flags & USBI_TRANSFER_CANCELLING)
- usbi_warn(ctx, "A cancellation for an in-flight transfer hasn't completed but closing the device handle");
- else
- usbi_err(ctx, "A cancellation hasn't even been scheduled on the transfer for which the device is closing");
- }
-
- /* remove from the list of in-flight transfers and make sure
- * we don't accidentally use the device handle in the future
- * (or that such accesses will be easily caught and identified as a crash)
- */
- usbi_mutex_lock(&itransfer->lock);
- list_del(&itransfer->list);
- transfer->dev_handle = NULL;
- usbi_mutex_unlock(&itransfer->lock);
-
- /* it is up to the user to free up the actual transfer struct. this is
- * just making sure that we don't attempt to process the transfer after
- * the device handle is invalid
- */
- usbi_dbg("Removed transfer %p from the in-flight list because device handle %p closed",
- transfer, dev_handle);
- }
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
-
- libusb_unlock_events(ctx);
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- list_del(&dev_handle->list);
- usbi_mutex_unlock(&ctx->open_devs_lock);
-
- usbi_backend->close(dev_handle);
- libusb_unref_device(dev_handle->dev);
- usbi_mutex_destroy(&dev_handle->lock);
- free(dev_handle);
-}
-
-/** \ingroup dev
- * Close a device handle. Should be called on all open handles before your
- * application exits.
- *
- * Internally, this function destroys the reference that was added by
- * libusb_open() on the given device.
- *
- * This is a non-blocking function; no requests are sent over the bus.
- *
- * \param dev_handle the handle to close
- */
-void API_EXPORTED libusb_close(libusb_device_handle *dev_handle)
-{
- struct libusb_context *ctx;
- unsigned char dummy = 1;
- ssize_t r;
-
- if (!dev_handle)
- return;
- usbi_dbg("");
-
- ctx = HANDLE_CTX(dev_handle);
-
- /* Similarly to libusb_open(), we want to interrupt all event handlers
- * at this point. More importantly, we want to perform the actual close of
- * the device while holding the event handling lock (preventing any other
- * thread from doing event handling) because we will be removing a file
- * descriptor from the polling loop. */
-
- /* record that we are messing with poll fds */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify++;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
-
- /* write some data on control pipe to interrupt event handlers */
- r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
- if (r <= 0) {
- usbi_warn(ctx, "internal signalling write failed, closing anyway");
- do_close(ctx, dev_handle);
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify--;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
- return;
- }
-
- /* take event handling lock */
- libusb_lock_events(ctx);
-
- /* read the dummy data */
- r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));
- if (r <= 0)
- usbi_warn(ctx, "internal signalling read failed, closing anyway");
-
- /* Close the device */
- do_close(ctx, dev_handle);
-
- /* we're done with modifying poll fds */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ctx->pollfd_modify--;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
-
- /* Release event handling lock and wake up event waiters */
- libusb_unlock_events(ctx);
-}
-
-/** \ingroup dev
- * Get the underlying device for a handle. This function does not modify
- * the reference count of the returned device, so do not feel compelled to
- * unreference it when you are done.
- * \param dev_handle a device handle
- * \returns the underlying device
- */
-DEFAULT_VISIBILITY
-libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle)
-{
- return dev_handle->dev;
-}
-
-/** \ingroup dev
- * Determine the bConfigurationValue of the currently active configuration.
- *
- * You could formulate your own control request to obtain this information,
- * but this function has the advantage that it may be able to retrieve the
- * information from operating system caches (no I/O involved).
- *
- * If the OS does not cache this information, then this function will block
- * while a control transfer is submitted to retrieve the information.
- *
- * This function will return a value of 0 in the <tt>config</tt> output
- * parameter if the device is in unconfigured state.
- *
- * \param dev a device handle
- * \param config output location for the bConfigurationValue of the active
- * configuration (only valid for return code 0)
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_get_configuration(libusb_device_handle *dev,
- int *config)
-{
- int r = LIBUSB_ERROR_NOT_SUPPORTED;
-
- usbi_dbg("");
- if (usbi_backend->get_configuration)
- r = usbi_backend->get_configuration(dev, config);
-
- if (r == LIBUSB_ERROR_NOT_SUPPORTED) {
- uint8_t tmp = 0;
- usbi_dbg("falling back to control message");
- r = libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
- LIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000);
- if (r == 0) {
- usbi_err(HANDLE_CTX(dev), "zero bytes returned in ctrl transfer?");
- r = LIBUSB_ERROR_IO;
- } else if (r == 1) {
- r = 0;
- *config = tmp;
- } else {
- usbi_dbg("control failed, error %d", r);
- }
- }
-
- if (r == 0)
- usbi_dbg("active config %d", *config);
-
- return r;
-}
-
-/** \ingroup dev
- * Set the active configuration for a device.
- *
- * The operating system may or may not have already set an active
- * configuration on the device. It is up to your application to ensure the
- * correct configuration is selected before you attempt to claim interfaces
- * and perform other operations.
- *
- * If you call this function on a device already configured with the selected
- * configuration, then this function will act as a lightweight device reset:
- * it will issue a SET_CONFIGURATION request using the current configuration,
- * causing most USB-related device state to be reset (altsetting reset to zero,
- * endpoint halts cleared, toggles reset).
- *
- * You cannot change/reset configuration if your application has claimed
- * interfaces. It is advised to set the desired configuration before claiming
- * interfaces.
- *
- * Alternatively you can call libusb_release_interface() first. Note if you
- * do things this way you must ensure that auto_detach_kernel_driver for
- * <tt>dev</tt> is 0, otherwise the kernel driver will be re-attached when you
- * release the interface(s).
- *
- * You cannot change/reset configuration if other applications or drivers have
- * claimed interfaces.
- *
- * A configuration value of -1 will put the device in unconfigured state.
- * The USB specifications state that a configuration value of 0 does this,
- * however buggy devices exist which actually have a configuration 0.
- *
- * You should always use this function rather than formulating your own
- * SET_CONFIGURATION control request. This is because the underlying operating
- * system needs to know when such changes happen.
- *
- * This is a blocking function.
- *
- * \param dev a device handle
- * \param configuration the bConfigurationValue of the configuration you
- * wish to activate, or -1 if you wish to put the device in unconfigured state
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist
- * \returns LIBUSB_ERROR_BUSY if interfaces are currently claimed
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- * \see libusb_set_auto_detach_kernel_driver()
- */
-int API_EXPORTED libusb_set_configuration(libusb_device_handle *dev,
- int configuration)
-{
- usbi_dbg("configuration %d", configuration);
- return usbi_backend->set_configuration(dev, configuration);
-}
-
-/** \ingroup dev
- * Claim an interface on a given device handle. You must claim the interface
- * you wish to use before you can perform I/O on any of its endpoints.
- *
- * It is legal to attempt to claim an already-claimed interface, in which
- * case libusbx just returns 0 without doing anything.
- *
- * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel driver
- * will be detached if necessary, on failure the detach error is returned.
- *
- * Claiming of interfaces is a purely logical operation; it does not cause
- * any requests to be sent over the bus. Interface claiming is used to
- * instruct the underlying operating system that your application wishes
- * to take ownership of the interface.
- *
- * This is a non-blocking function.
- *
- * \param dev a device handle
- * \param interface_number the <tt>bInterfaceNumber</tt> of the interface you
- * wish to claim
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist
- * \returns LIBUSB_ERROR_BUSY if another program or driver has claimed the
- * interface
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns a LIBUSB_ERROR code on other failure
- * \see libusb_set_auto_detach_kernel_driver()
- */
-int API_EXPORTED libusb_claim_interface(libusb_device_handle *dev,
- int interface_number)
-{
- int r = 0;
-
- usbi_dbg("interface %d", interface_number);
- if (interface_number >= USB_MAXINTERFACES)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_mutex_lock(&dev->lock);
- if (dev->claimed_interfaces & (1 << interface_number))
- goto out;
-
- r = usbi_backend->claim_interface(dev, interface_number);
- if (r == 0)
- dev->claimed_interfaces |= 1 << interface_number;
-
-out:
- usbi_mutex_unlock(&dev->lock);
- return r;
-}
-
-/** \ingroup dev
- * Release an interface previously claimed with libusb_claim_interface(). You
- * should release all claimed interfaces before closing a device handle.
- *
- * This is a blocking function. A SET_INTERFACE control request will be sent
- * to the device, resetting interface state to the first alternate setting.
- *
- * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel
- * driver will be re-attached after releasing the interface.
- *
- * \param dev a device handle
- * \param interface_number the <tt>bInterfaceNumber</tt> of the
- * previously-claimed interface
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- * \see libusb_set_auto_detach_kernel_driver()
- */
-int API_EXPORTED libusb_release_interface(libusb_device_handle *dev,
- int interface_number)
-{
- int r;
-
- usbi_dbg("interface %d", interface_number);
- if (interface_number >= USB_MAXINTERFACES)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- usbi_mutex_lock(&dev->lock);
- if (!(dev->claimed_interfaces & (1 << interface_number))) {
- r = LIBUSB_ERROR_NOT_FOUND;
- goto out;
- }
-
- r = usbi_backend->release_interface(dev, interface_number);
- if (r == 0)
- dev->claimed_interfaces &= ~(1 << interface_number);
-
-out:
- usbi_mutex_unlock(&dev->lock);
- return r;
-}
-
-/** \ingroup dev
- * Activate an alternate setting for an interface. The interface must have
- * been previously claimed with libusb_claim_interface().
- *
- * You should always use this function rather than formulating your own
- * SET_INTERFACE control request. This is because the underlying operating
- * system needs to know when such changes happen.
- *
- * This is a blocking function.
- *
- * \param dev a device handle
- * \param interface_number the <tt>bInterfaceNumber</tt> of the
- * previously-claimed interface
- * \param alternate_setting the <tt>bAlternateSetting</tt> of the alternate
- * setting to activate
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the
- * requested alternate setting does not exist
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev,
- int interface_number, int alternate_setting)
-{
- usbi_dbg("interface %d altsetting %d",
- interface_number, alternate_setting);
- if (interface_number >= USB_MAXINTERFACES)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- usbi_mutex_lock(&dev->lock);
- if (!dev->dev->attached) {
- usbi_mutex_unlock(&dev->lock);
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- if (!(dev->claimed_interfaces & (1 << interface_number))) {
- usbi_mutex_unlock(&dev->lock);
- return LIBUSB_ERROR_NOT_FOUND;
- }
- usbi_mutex_unlock(&dev->lock);
-
- return usbi_backend->set_interface_altsetting(dev, interface_number,
- alternate_setting);
-}
-
-/** \ingroup dev
- * Clear the halt/stall condition for an endpoint. Endpoints with halt status
- * are unable to receive or transmit data until the halt condition is stalled.
- *
- * You should cancel all pending transfers before attempting to clear the halt
- * condition.
- *
- * This is a blocking function.
- *
- * \param dev a device handle
- * \param endpoint the endpoint to clear halt status
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_clear_halt(libusb_device_handle *dev,
- unsigned char endpoint)
-{
- usbi_dbg("endpoint %x", endpoint);
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- return usbi_backend->clear_halt(dev, endpoint);
-}
-
-/** \ingroup dev
- * Perform a USB port reset to reinitialize a device. The system will attempt
- * to restore the previous configuration and alternate settings after the
- * reset has completed.
- *
- * If the reset fails, the descriptors change, or the previous state cannot be
- * restored, the device will appear to be disconnected and reconnected. This
- * means that the device handle is no longer valid (you should close it) and
- * rediscover the device. A return code of LIBUSB_ERROR_NOT_FOUND indicates
- * when this is the case.
- *
- * This is a blocking function which usually incurs a noticeable delay.
- *
- * \param dev a handle of the device to reset
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the
- * device has been disconnected
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_reset_device(libusb_device_handle *dev)
-{
- usbi_dbg("");
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- return usbi_backend->reset_device(dev);
-}
-
-/** \ingroup dev
- * Determine if a kernel driver is active on an interface. If a kernel driver
- * is active, you cannot claim the interface, and libusbx will be unable to
- * perform I/O.
- *
- * This functionality is not available on Windows.
- *
- * \param dev a device handle
- * \param interface_number the interface to check
- * \returns 0 if no kernel driver is active
- * \returns 1 if a kernel driver is active
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality
- * is not available
- * \returns another LIBUSB_ERROR code on other failure
- * \see libusb_detach_kernel_driver()
- */
-int API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev,
- int interface_number)
-{
- usbi_dbg("interface %d", interface_number);
-
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- if (usbi_backend->kernel_driver_active)
- return usbi_backend->kernel_driver_active(dev, interface_number);
- else
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-/** \ingroup dev
- * Detach a kernel driver from an interface. If successful, you will then be
- * able to claim the interface and perform I/O.
- *
- * This functionality is not available on Darwin or Windows.
- *
- * Note that libusbx itself also talks to the device through a special kernel
- * driver, if this driver is already attached to the device, this call will
- * not detach it and return LIBUSB_ERROR_NOT_FOUND.
- *
- * \param dev a device handle
- * \param interface_number the interface to detach the driver from
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
- * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality
- * is not available
- * \returns another LIBUSB_ERROR code on other failure
- * \see libusb_kernel_driver_active()
- */
-int API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev,
- int interface_number)
-{
- usbi_dbg("interface %d", interface_number);
-
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- if (usbi_backend->detach_kernel_driver)
- return usbi_backend->detach_kernel_driver(dev, interface_number);
- else
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-/** \ingroup dev
- * Re-attach an interface's kernel driver, which was previously detached
- * using libusb_detach_kernel_driver(). This call is only effective on
- * Linux and returns LIBUSB_ERROR_NOT_SUPPORTED on all other platforms.
- *
- * This functionality is not available on Darwin or Windows.
- *
- * \param dev a device handle
- * \param interface_number the interface to attach the driver from
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
- * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality
- * is not available
- * \returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the
- * interface is claimed by a program or driver
- * \returns another LIBUSB_ERROR code on other failure
- * \see libusb_kernel_driver_active()
- */
-int API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev,
- int interface_number)
-{
- usbi_dbg("interface %d", interface_number);
-
- if (!dev->dev->attached)
- return LIBUSB_ERROR_NO_DEVICE;
-
- if (usbi_backend->attach_kernel_driver)
- return usbi_backend->attach_kernel_driver(dev, interface_number);
- else
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-/** \ingroup dev
- * Enable/disable libusbx's automatic kernel driver detachment. When this is
- * enabled libusbx will automatically detach the kernel driver on an interface
- * when claiming the interface, and attach it when releasing the interface.
- *
- * Automatic kernel driver detachment is disabled on newly opened device
- * handles by default.
- *
- * On platforms which do not have LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER
- * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusbx will
- * continue as if this function was never called.
- *
- * \param dev a device handle
- * \param enable whether to enable or disable auto kernel driver detachment
- *
- * \returns LIBUSB_SUCCESS on success
- * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality
- * is not available
- * \see libusb_claim_interface()
- * \see libusb_release_interface()
- * \see libusb_set_configuration()
- */
-int API_EXPORTED libusb_set_auto_detach_kernel_driver(
- libusb_device_handle *dev, int enable)
-{
- if (!(usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER))
- return LIBUSB_ERROR_NOT_SUPPORTED;
-
- dev->auto_detach_kernel_driver = enable;
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup lib
- * Set log message verbosity.
- *
- * The default level is LIBUSB_LOG_LEVEL_NONE, which means no messages are ever
- * printed. If you choose to increase the message verbosity level, ensure
- * that your application does not close the stdout/stderr file descriptors.
- *
- * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusbx is conservative
- * with its message logging and most of the time, will only log messages that
- * explain error conditions and other oddities. This will help you debug
- * your software.
- *
- * If the LIBUSB_DEBUG environment variable was set when libusbx was
- * initialized, this function does nothing: the message verbosity is fixed
- * to the value in the environment variable.
- *
- * If libusbx was compiled without any message logging, this function does
- * nothing: you'll never get any messages.
- *
- * If libusbx was compiled with verbose debug message logging, this function
- * does nothing: you'll always get messages from all levels.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param level debug level to set
- */
-void API_EXPORTED libusb_set_debug(libusb_context *ctx, int level)
-{
- USBI_GET_CONTEXT(ctx);
- if (!ctx->debug_fixed)
- ctx->debug = level;
-}
-
-/** \ingroup lib
- * Initialize libusb. This function must be called before calling any other
- * libusbx function.
- *
- * If you do not provide an output location for a context pointer, a default
- * context will be created. If there was already a default context, it will
- * be reused (and nothing will be initialized/reinitialized).
- *
- * \param context Optional output location for context pointer.
- * Only valid on return code 0.
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- * \see contexts
- */
-int API_EXPORTED libusb_init(libusb_context **context)
-{
- struct libusb_device *dev, *next;
- char *dbg = getenv("LIBUSB_DEBUG");
- struct libusb_context *ctx;
- static int first_init = 1;
- int r = 0;
-
- usbi_mutex_static_lock(&default_context_lock);
-
- if (!timestamp_origin.tv_sec) {
- usbi_gettimeofday(&timestamp_origin, NULL);
- }
-
- if (!context && usbi_default_context) {
- usbi_dbg("reusing default context");
- default_context_refcnt++;
- usbi_mutex_static_unlock(&default_context_lock);
- return 0;
- }
-
- ctx = calloc(1, sizeof(*ctx));
- if (!ctx) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err_unlock;
- }
-
-#ifdef ENABLE_DEBUG_LOGGING
- ctx->debug = LIBUSB_LOG_LEVEL_DEBUG;
-#endif
-
- if (dbg) {
- ctx->debug = atoi(dbg);
- if (ctx->debug)
- ctx->debug_fixed = 1;
- }
-
- /* default context should be initialized before calling usbi_dbg */
- if (!usbi_default_context) {
- usbi_default_context = ctx;
- default_context_refcnt++;
- usbi_dbg("created default context");
- }
-
- usbi_dbg("libusbx v%d.%d.%d.%d", libusb_version_internal.major, libusb_version_internal.minor,
- libusb_version_internal.micro, libusb_version_internal.nano);
-
- usbi_mutex_init(&ctx->usb_devs_lock, NULL);
- usbi_mutex_init(&ctx->open_devs_lock, NULL);
- usbi_mutex_init(&ctx->hotplug_cbs_lock, NULL);
- list_init(&ctx->usb_devs);
- list_init(&ctx->open_devs);
- list_init(&ctx->hotplug_cbs);
-
- usbi_mutex_static_lock(&active_contexts_lock);
- if (first_init) {
- first_init = 0;
- list_init (&active_contexts_list);
- }
- list_add (&ctx->list, &active_contexts_list);
- usbi_mutex_static_unlock(&active_contexts_lock);
-
- if (usbi_backend->init) {
- r = usbi_backend->init(ctx);
- if (r)
- goto err_free_ctx;
- }
-
- r = usbi_io_init(ctx);
- if (r < 0)
- goto err_backend_exit;
-
- usbi_mutex_static_unlock(&default_context_lock);
-
- if (context)
- *context = ctx;
-
- return 0;
-
-err_backend_exit:
- if (usbi_backend->exit)
- usbi_backend->exit();
-err_free_ctx:
- if (ctx == usbi_default_context)
- usbi_default_context = NULL;
-
- usbi_mutex_destroy(&ctx->open_devs_lock);
- usbi_mutex_destroy(&ctx->usb_devs_lock);
- usbi_mutex_destroy(&ctx->hotplug_cbs_lock);
-
- usbi_mutex_static_lock(&active_contexts_lock);
- list_del (&ctx->list);
- usbi_mutex_static_unlock(&active_contexts_lock);
-
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) {
- list_del(&dev->list);
- libusb_unref_device(dev);
- }
- usbi_mutex_unlock(&ctx->usb_devs_lock);
-
- free(ctx);
-err_unlock:
- usbi_mutex_static_unlock(&default_context_lock);
- return r;
-}
-
-/** \ingroup lib
- * Deinitialize libusb. Should be called after closing all open devices and
- * before your application terminates.
- * \param ctx the context to deinitialize, or NULL for the default context
- */
-void API_EXPORTED libusb_exit(struct libusb_context *ctx)
-{
- struct libusb_device *dev, *next;
-
- usbi_dbg("");
- USBI_GET_CONTEXT(ctx);
-
- /* if working with default context, only actually do the deinitialization
- * if we're the last user */
- usbi_mutex_static_lock(&default_context_lock);
- if (ctx == usbi_default_context) {
- if (--default_context_refcnt > 0) {
- usbi_dbg("not destroying default context");
- usbi_mutex_static_unlock(&default_context_lock);
- return;
- }
- usbi_dbg("destroying default context");
- usbi_default_context = NULL;
- }
- usbi_mutex_static_unlock(&default_context_lock);
-
- usbi_mutex_static_lock(&active_contexts_lock);
- list_del (&ctx->list);
- usbi_mutex_static_unlock(&active_contexts_lock);
-
- if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- usbi_hotplug_deregister_all(ctx);
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) {
- list_del(&dev->list);
- libusb_unref_device(dev);
- }
- usbi_mutex_unlock(&ctx->usb_devs_lock);
- }
-
- /* a few sanity checks. don't bother with locking because unless
- * there is an application bug, nobody will be accessing these. */
- if (!list_empty(&ctx->usb_devs))
- usbi_warn(ctx, "some libusb_devices were leaked");
- if (!list_empty(&ctx->open_devs))
- usbi_warn(ctx, "application left some devices open");
-
- usbi_io_exit(ctx);
- if (usbi_backend->exit)
- usbi_backend->exit();
-
- usbi_mutex_destroy(&ctx->open_devs_lock);
- usbi_mutex_destroy(&ctx->usb_devs_lock);
- usbi_mutex_destroy(&ctx->hotplug_cbs_lock);
- free(ctx);
-}
-
-/** \ingroup misc
- * Check at runtime if the loaded library has a given capability.
- * This call should be performed after \ref libusb_init(), to ensure the
- * backend has updated its capability set.
- *
- * \param capability the \ref libusb_capability to check for
- * \returns nonzero if the running library has the capability, 0 otherwise
- */
-int API_EXPORTED libusb_has_capability(uint32_t capability)
-{
- switch (capability) {
- case LIBUSB_CAP_HAS_CAPABILITY:
- return 1;
- case LIBUSB_CAP_HAS_HOTPLUG:
- return !(usbi_backend->get_device_list);
- case LIBUSB_CAP_HAS_HID_ACCESS:
- return (usbi_backend->caps & USBI_CAP_HAS_HID_ACCESS);
- case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER:
- return (usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER);
- }
- return 0;
-}
-
-/* this is defined in libusbi.h if needed */
-#ifdef LIBUSB_GETTIMEOFDAY_WIN32
-/*
- * gettimeofday
- * Implementation according to:
- * The Open Group Base Specifications Issue 6
- * IEEE Std 1003.1, 2004 Edition
- */
-
-/*
- * THIS SOFTWARE IS NOT COPYRIGHTED
- *
- * This source code is offered for use in the public domain. You may
- * use, modify or distribute it freely.
- *
- * This code is distributed in the hope that it will be useful but
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAIMED. This includes but is not limited to warranties of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Contributed by:
- * Danny Smith <dannysmith@users.sourceforge.net>
- */
-
-/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
-#define _W32_FT_OFFSET (116444736000000000)
-
-int usbi_gettimeofday(struct timeval *tp, void *tzp)
-{
- union {
- unsigned __int64 ns100; /* Time since 1 Jan 1601, in 100ns units */
- FILETIME ft;
- } _now;
- UNUSED(tzp);
-
- if(tp) {
-#if defined(OS_WINCE)
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, &_now.ft);
-#else
- GetSystemTimeAsFileTime (&_now.ft);
-#endif
- tp->tv_usec=(long)((_now.ns100 / 10) % 1000000 );
- tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000);
- }
- /* Always return 0 as per Open Group Base Specifications Issue 6.
- Do not set errno on error. */
- return 0;
-}
-#endif
-
-static void usbi_log_str(struct libusb_context *ctx, const char * str)
-{
- UNUSED(ctx);
- fputs(str, stderr);
-}
-
-void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
- const char *function, const char *format, va_list args)
-{
- const char *prefix = "";
- char buf[USBI_MAX_LOG_LEN];
- struct timeval now;
- int global_debug, header_len, text_len;
- static int has_debug_header_been_displayed = 0;
-
-#ifdef ENABLE_DEBUG_LOGGING
- global_debug = 1;
- UNUSED(ctx);
-#else
- USBI_GET_CONTEXT(ctx);
- if (ctx == NULL)
- return;
- global_debug = (ctx->debug == LIBUSB_LOG_LEVEL_DEBUG);
- if (!ctx->debug)
- return;
- if (level == LIBUSB_LOG_LEVEL_WARNING && ctx->debug < LIBUSB_LOG_LEVEL_WARNING)
- return;
- if (level == LIBUSB_LOG_LEVEL_INFO && ctx->debug < LIBUSB_LOG_LEVEL_INFO)
- return;
- if (level == LIBUSB_LOG_LEVEL_DEBUG && ctx->debug < LIBUSB_LOG_LEVEL_DEBUG)
- return;
-#endif
-
-#ifdef __ANDROID__
- int prio;
- switch (level) {
- case LOG_LEVEL_INFO:
- prio = ANDROID_LOG_INFO;
- break;
- case LOG_LEVEL_WARNING:
- prio = ANDROID_LOG_WARN;
- break;
- case LOG_LEVEL_ERROR:
- prio = ANDROID_LOG_ERROR;
- break;
- case LOG_LEVEL_DEBUG:
- prio = ANDROID_LOG_DEBUG;
- break;
- default:
- prio = ANDROID_LOG_UNKNOWN;
- break;
- }
-
- __android_log_vprint(prio, "LibUsb", format, args);
-#else
- usbi_gettimeofday(&now, NULL);
- if ((global_debug) && (!has_debug_header_been_displayed)) {
- has_debug_header_been_displayed = 1;
- usbi_log_str(ctx, "[timestamp] [threadID] facility level [function call] <message>\n");
- usbi_log_str(ctx, "--------------------------------------------------------------------------------\n");
- }
- if (now.tv_usec < timestamp_origin.tv_usec) {
- now.tv_sec--;
- now.tv_usec += 1000000;
- }
- now.tv_sec -= timestamp_origin.tv_sec;
- now.tv_usec -= timestamp_origin.tv_usec;
-
- switch (level) {
- case LIBUSB_LOG_LEVEL_INFO:
- prefix = "info";
- break;
- case LIBUSB_LOG_LEVEL_WARNING:
- prefix = "warning";
- break;
- case LIBUSB_LOG_LEVEL_ERROR:
- prefix = "error";
- break;
- case LIBUSB_LOG_LEVEL_DEBUG:
- prefix = "debug";
- break;
- case LIBUSB_LOG_LEVEL_NONE:
- break;
- default:
- prefix = "unknown";
- break;
- }
-
- if (global_debug) {
- header_len = snprintf(buf, sizeof(buf),
- "[%2d.%06d] [%08x] libusbx: %s [%s] ",
- (int)now.tv_sec, (int)now.tv_usec, usbi_get_tid(), prefix, function);
- } else {
- header_len = snprintf(buf, sizeof(buf),
- "libusbx: %s [%s] ", prefix, function);
- }
-
- if (header_len < 0 || header_len >= sizeof(buf)) {
- /* Somehow snprintf failed to write to the buffer,
- * remove the header so something useful is output. */
- header_len = 0;
- }
- /* Make sure buffer is NUL terminated */
- buf[header_len] = '\0';
- text_len = vsnprintf(buf + header_len, sizeof(buf) - header_len,
- format, args);
- if (text_len < 0 || text_len + header_len >= sizeof(buf)) {
- /* Truncated log output. On some platforms a -1 return value means
- * that the output was truncated. */
- text_len = sizeof(buf) - header_len;
- }
- if (header_len + text_len + sizeof(USBI_LOG_LINE_END) >= sizeof(buf)) {
- /* Need to truncate the text slightly to fit on the terminator. */
- text_len -= (header_len + text_len + sizeof(USBI_LOG_LINE_END)) - sizeof(buf);
- }
- strcpy(buf + header_len + text_len, USBI_LOG_LINE_END);
-
- usbi_log_str(ctx, buf);
-#endif
-}
-
-void usbi_log(struct libusb_context *ctx, enum libusb_log_level level,
- const char *function, const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- usbi_log_v(ctx, level, function, format, args);
- va_end (args);
-}
-
-/** \ingroup misc
- * Returns a constant NULL-terminated string with the ASCII name of a libusbx
- * error or transfer status code. The caller must not free() the returned
- * string.
- *
- * \param error_code The \ref libusb_error or libusb_transfer_status code to
- * return the name of.
- * \returns The error name, or the string **UNKNOWN** if the value of
- * error_code is not a known error / status code.
- */
-DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code)
-{
- switch (error_code) {
- case LIBUSB_ERROR_IO:
- return "LIBUSB_ERROR_IO";
- case LIBUSB_ERROR_INVALID_PARAM:
- return "LIBUSB_ERROR_INVALID_PARAM";
- case LIBUSB_ERROR_ACCESS:
- return "LIBUSB_ERROR_ACCESS";
- case LIBUSB_ERROR_NO_DEVICE:
- return "LIBUSB_ERROR_NO_DEVICE";
- case LIBUSB_ERROR_NOT_FOUND:
- return "LIBUSB_ERROR_NOT_FOUND";
- case LIBUSB_ERROR_BUSY:
- return "LIBUSB_ERROR_BUSY";
- case LIBUSB_ERROR_TIMEOUT:
- return "LIBUSB_ERROR_TIMEOUT";
- case LIBUSB_ERROR_OVERFLOW:
- return "LIBUSB_ERROR_OVERFLOW";
- case LIBUSB_ERROR_PIPE:
- return "LIBUSB_ERROR_PIPE";
- case LIBUSB_ERROR_INTERRUPTED:
- return "LIBUSB_ERROR_INTERRUPTED";
- case LIBUSB_ERROR_NO_MEM:
- return "LIBUSB_ERROR_NO_MEM";
- case LIBUSB_ERROR_NOT_SUPPORTED:
- return "LIBUSB_ERROR_NOT_SUPPORTED";
- case LIBUSB_ERROR_OTHER:
- return "LIBUSB_ERROR_OTHER";
-
- case LIBUSB_TRANSFER_ERROR:
- return "LIBUSB_TRANSFER_ERROR";
- case LIBUSB_TRANSFER_TIMED_OUT:
- return "LIBUSB_TRANSFER_TIMED_OUT";
- case LIBUSB_TRANSFER_CANCELLED:
- return "LIBUSB_TRANSFER_CANCELLED";
- case LIBUSB_TRANSFER_STALL:
- return "LIBUSB_TRANSFER_STALL";
- case LIBUSB_TRANSFER_NO_DEVICE:
- return "LIBUSB_TRANSFER_NO_DEVICE";
- case LIBUSB_TRANSFER_OVERFLOW:
- return "LIBUSB_TRANSFER_OVERFLOW";
-
- case 0:
- return "LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED";
- default:
- return "**UNKNOWN**";
- }
-}
-
-/** \ingroup misc
- * Returns a pointer to const struct libusb_version with the version
- * (major, minor, micro, nano and rc) of the running library.
- */
-DEFAULT_VISIBILITY
-const struct libusb_version * LIBUSB_CALL libusb_get_version(void)
-{
- return &libusb_version_internal;
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/descriptor.c b/src/3rd_party-static/libusbx-1.0.16/libusb/descriptor.c
deleted file mode 100644
index ba6d1467d7..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/descriptor.c
+++ /dev/null
@@ -1,1197 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
-/*
- * USB descriptor handling functions for libusbx
- * Copyright © 2007 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libusbi.h"
-
-#define DESC_HEADER_LENGTH 2
-#define DEVICE_DESC_LENGTH 18
-#define CONFIG_DESC_LENGTH 9
-#define INTERFACE_DESC_LENGTH 9
-#define ENDPOINT_DESC_LENGTH 7
-#define ENDPOINT_AUDIO_DESC_LENGTH 9
-
-/** @defgroup desc USB descriptors
- * This page details how to examine the various standard USB descriptors
- * for detected devices
- */
-
-/* set host_endian if the w values are already in host endian format,
- * as opposed to bus endian. */
-int usbi_parse_descriptor(const unsigned char *source, const char *descriptor,
- void *dest, int host_endian)
-{
- const unsigned char *sp = source;
- unsigned char *dp = dest;
- uint16_t w;
- const char *cp;
- uint32_t d;
-
- for (cp = descriptor; *cp; cp++) {
- switch (*cp) {
- case 'b': /* 8-bit byte */
- *dp++ = *sp++;
- break;
- case 'w': /* 16-bit word, convert from little endian to CPU */
- dp += ((uintptr_t)dp & 1); /* Align to word boundary */
-
- if (host_endian) {
- memcpy(dp, sp, 2);
- } else {
- w = (sp[1] << 8) | sp[0];
- *((uint16_t *)dp) = w;
- }
- sp += 2;
- dp += 2;
- break;
- case 'd': /* 32-bit word, convert from little endian to CPU */
- dp += ((uintptr_t)dp & 1); /* Align to word boundary */
-
- if (host_endian) {
- memcpy(dp, sp, 4);
- } else {
- d = (sp[3] << 24) | (sp[2] << 16) |
- (sp[1] << 8) | sp[0];
- *((uint32_t *)dp) = d;
- }
- sp += 4;
- dp += 4;
- break;
- case 'u': /* 16 byte UUID */
- memcpy(dp, sp, 16);
- sp += 16;
- dp += 16;
- break;
- }
- }
-
- return (int) (sp - source);
-}
-
-static void clear_endpoint(struct libusb_endpoint_descriptor *endpoint)
-{
- if (endpoint->extra)
- free((unsigned char *) endpoint->extra);
-}
-
-static int parse_endpoint(struct libusb_context *ctx,
- struct libusb_endpoint_descriptor *endpoint, unsigned char *buffer,
- int size, int host_endian)
-{
- struct usb_descriptor_header header;
- unsigned char *extra;
- unsigned char *begin;
- int parsed = 0;
- int len;
-
- if (size < DESC_HEADER_LENGTH) {
- usbi_err(ctx, "short endpoint descriptor read %d/%d",
- size, DESC_HEADER_LENGTH);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(buffer, "bb", &header, 0);
- if (header.bDescriptorType != LIBUSB_DT_ENDPOINT) {
- usbi_err(ctx, "unexpected descriptor %x (expected %x)",
- header.bDescriptorType, LIBUSB_DT_ENDPOINT);
- return parsed;
- }
- if (header.bLength > size) {
- usbi_warn(ctx, "short endpoint descriptor read %d/%d",
- size, header.bLength);
- return parsed;
- }
- if (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH)
- usbi_parse_descriptor(buffer, "bbbbwbbb", endpoint, host_endian);
- else if (header.bLength >= ENDPOINT_DESC_LENGTH)
- usbi_parse_descriptor(buffer, "bbbbwb", endpoint, host_endian);
- else {
- usbi_err(ctx, "invalid endpoint bLength (%d)", header.bLength);
- return LIBUSB_ERROR_IO;
- }
-
- buffer += header.bLength;
- size -= header.bLength;
- parsed += header.bLength;
-
- /* Skip over the rest of the Class Specific or Vendor Specific */
- /* descriptors */
- begin = buffer;
- while (size >= DESC_HEADER_LENGTH) {
- usbi_parse_descriptor(buffer, "bb", &header, 0);
- if (header.bLength < DESC_HEADER_LENGTH) {
- usbi_err(ctx, "invalid extra ep desc len (%d)",
- header.bLength);
- return LIBUSB_ERROR_IO;
- } else if (header.bLength > size) {
- usbi_warn(ctx, "short extra ep desc read %d/%d",
- size, header.bLength);
- return parsed;
- }
-
- /* If we find another "proper" descriptor then we're done */
- if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
- (header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
- (header.bDescriptorType == LIBUSB_DT_CONFIG) ||
- (header.bDescriptorType == LIBUSB_DT_DEVICE))
- break;
-
- usbi_dbg("skipping descriptor %x", header.bDescriptorType);
- buffer += header.bLength;
- size -= header.bLength;
- parsed += header.bLength;
- }
-
- /* Copy any unknown descriptors into a storage area for drivers */
- /* to later parse */
- len = (int)(buffer - begin);
- if (!len) {
- endpoint->extra = NULL;
- endpoint->extra_length = 0;
- return parsed;
- }
-
- extra = malloc(len);
- endpoint->extra = extra;
- if (!extra) {
- endpoint->extra_length = 0;
- return LIBUSB_ERROR_NO_MEM;
- }
-
- memcpy(extra, begin, len);
- endpoint->extra_length = len;
-
- return parsed;
-}
-
-static void clear_interface(struct libusb_interface *usb_interface)
-{
- int i;
- int j;
-
- if (usb_interface->altsetting) {
- for (i = 0; i < usb_interface->num_altsetting; i++) {
- struct libusb_interface_descriptor *ifp =
- (struct libusb_interface_descriptor *)
- usb_interface->altsetting + i;
- if (ifp->extra)
- free((void *) ifp->extra);
- if (ifp->endpoint) {
- for (j = 0; j < ifp->bNumEndpoints; j++)
- clear_endpoint((struct libusb_endpoint_descriptor *)
- ifp->endpoint + j);
- free((void *) ifp->endpoint);
- }
- }
- free((void *) usb_interface->altsetting);
- usb_interface->altsetting = NULL;
- }
-
-}
-
-static int parse_interface(libusb_context *ctx,
- struct libusb_interface *usb_interface, unsigned char *buffer, int size,
- int host_endian)
-{
- int i;
- int len;
- int r;
- int parsed = 0;
- int interface_number = -1;
- size_t tmp;
- struct usb_descriptor_header header;
- struct libusb_interface_descriptor *ifp;
- unsigned char *begin;
-
- usb_interface->num_altsetting = 0;
-
- while (size >= INTERFACE_DESC_LENGTH) {
- struct libusb_interface_descriptor *altsetting =
- (struct libusb_interface_descriptor *) usb_interface->altsetting;
- altsetting = usbi_reallocf(altsetting,
- sizeof(struct libusb_interface_descriptor) *
- (usb_interface->num_altsetting + 1));
- if (!altsetting) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err;
- }
- usb_interface->altsetting = altsetting;
-
- ifp = altsetting + usb_interface->num_altsetting;
- usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp, 0);
- if (ifp->bDescriptorType != LIBUSB_DT_INTERFACE) {
- usbi_err(ctx, "unexpected descriptor %x (expected %x)",
- ifp->bDescriptorType, LIBUSB_DT_INTERFACE);
- return parsed;
- }
- if (ifp->bLength < INTERFACE_DESC_LENGTH) {
- usbi_err(ctx, "invalid interface bLength (%d)",
- ifp->bLength);
- r = LIBUSB_ERROR_IO;
- goto err;
- }
- if (ifp->bLength > size) {
- usbi_warn(ctx, "short intf descriptor read %d/%d",
- size, ifp->bLength);
- return parsed;
- }
- if (ifp->bNumEndpoints > USB_MAXENDPOINTS) {
- usbi_err(ctx, "too many endpoints (%d)", ifp->bNumEndpoints);
- r = LIBUSB_ERROR_IO;
- goto err;
- }
-
- usb_interface->num_altsetting++;
- ifp->extra = NULL;
- ifp->extra_length = 0;
- ifp->endpoint = NULL;
-
- if (interface_number == -1)
- interface_number = ifp->bInterfaceNumber;
-
- /* Skip over the interface */
- buffer += ifp->bLength;
- parsed += ifp->bLength;
- size -= ifp->bLength;
-
- begin = buffer;
-
- /* Skip over any interface, class or vendor descriptors */
- while (size >= DESC_HEADER_LENGTH) {
- usbi_parse_descriptor(buffer, "bb", &header, 0);
- if (header.bLength < DESC_HEADER_LENGTH) {
- usbi_err(ctx,
- "invalid extra intf desc len (%d)",
- header.bLength);
- r = LIBUSB_ERROR_IO;
- goto err;
- } else if (header.bLength > size) {
- usbi_warn(ctx,
- "short extra intf desc read %d/%d",
- size, header.bLength);
- return parsed;
- }
-
- /* If we find another "proper" descriptor then we're done */
- if ((header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
- (header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
- (header.bDescriptorType == LIBUSB_DT_CONFIG) ||
- (header.bDescriptorType == LIBUSB_DT_DEVICE))
- break;
-
- buffer += header.bLength;
- parsed += header.bLength;
- size -= header.bLength;
- }
-
- /* Copy any unknown descriptors into a storage area for */
- /* drivers to later parse */
- len = (int)(buffer - begin);
- if (len) {
- ifp->extra = malloc(len);
- if (!ifp->extra) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err;
- }
- memcpy((unsigned char *) ifp->extra, begin, len);
- ifp->extra_length = len;
- }
-
- if (ifp->bNumEndpoints > 0) {
- struct libusb_endpoint_descriptor *endpoint;
- tmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor);
- endpoint = malloc(tmp);
- ifp->endpoint = endpoint;
- if (!endpoint) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err;
- }
-
- memset(endpoint, 0, tmp);
- for (i = 0; i < ifp->bNumEndpoints; i++) {
- r = parse_endpoint(ctx, endpoint + i, buffer, size,
- host_endian);
- if (r < 0)
- goto err;
- if (r == 0) {
- ifp->bNumEndpoints = (uint8_t)i;
- break;;
- }
-
- buffer += r;
- parsed += r;
- size -= r;
- }
- }
-
- /* We check to see if it's an alternate to this one */
- ifp = (struct libusb_interface_descriptor *) buffer;
- if (size < LIBUSB_DT_INTERFACE_SIZE ||
- ifp->bDescriptorType != LIBUSB_DT_INTERFACE ||
- ifp->bInterfaceNumber != interface_number)
- return parsed;
- }
-
- return parsed;
-err:
- clear_interface(usb_interface);
- return r;
-}
-
-static void clear_configuration(struct libusb_config_descriptor *config)
-{
- if (config->interface) {
- int i;
- for (i = 0; i < config->bNumInterfaces; i++)
- clear_interface((struct libusb_interface *)
- config->interface + i);
- free((void *) config->interface);
- }
- if (config->extra)
- free((void *) config->extra);
-}
-
-static int parse_configuration(struct libusb_context *ctx,
- struct libusb_config_descriptor *config, unsigned char *buffer,
- int size, int host_endian)
-{
- int i;
- int r;
- size_t tmp;
- struct usb_descriptor_header header;
- struct libusb_interface *usb_interface;
-
- if (size < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(ctx, "short config descriptor read %d/%d",
- size, LIBUSB_DT_CONFIG_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(buffer, "bbwbbbbb", config, host_endian);
- if (config->bDescriptorType != LIBUSB_DT_CONFIG) {
- usbi_err(ctx, "unexpected descriptor %x (expected %x)",
- config->bDescriptorType, LIBUSB_DT_CONFIG);
- return LIBUSB_ERROR_IO;
- }
- if (config->bLength < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(ctx, "invalid config bLength (%d)", config->bLength);
- return LIBUSB_ERROR_IO;
- }
- if (config->bLength > size) {
- usbi_err(ctx, "short config descriptor read %d/%d",
- size, config->bLength);
- return LIBUSB_ERROR_IO;
- }
- if (config->bNumInterfaces > USB_MAXINTERFACES) {
- usbi_err(ctx, "too many interfaces (%d)", config->bNumInterfaces);
- return LIBUSB_ERROR_IO;
- }
-
- tmp = config->bNumInterfaces * sizeof(struct libusb_interface);
- usb_interface = malloc(tmp);
- config->interface = usb_interface;
- if (!config->interface)
- return LIBUSB_ERROR_NO_MEM;
-
- memset(usb_interface, 0, tmp);
- buffer += config->bLength;
- size -= config->bLength;
-
- config->extra = NULL;
- config->extra_length = 0;
-
- for (i = 0; i < config->bNumInterfaces; i++) {
- int len;
- unsigned char *begin;
-
- /* Skip over the rest of the Class Specific or Vendor */
- /* Specific descriptors */
- begin = buffer;
- while (size >= DESC_HEADER_LENGTH) {
- usbi_parse_descriptor(buffer, "bb", &header, 0);
-
- if (header.bLength < DESC_HEADER_LENGTH) {
- usbi_err(ctx,
- "invalid extra config desc len (%d)",
- header.bLength);
- r = LIBUSB_ERROR_IO;
- goto err;
- } else if (header.bLength > size) {
- usbi_warn(ctx,
- "short extra config desc read %d/%d",
- size, header.bLength);
- config->bNumInterfaces = (uint8_t)i;
- return size;
- }
-
- /* If we find another "proper" descriptor then we're done */
- if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
- (header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
- (header.bDescriptorType == LIBUSB_DT_CONFIG) ||
- (header.bDescriptorType == LIBUSB_DT_DEVICE))
- break;
-
- usbi_dbg("skipping descriptor 0x%x\n", header.bDescriptorType);
- buffer += header.bLength;
- size -= header.bLength;
- }
-
- /* Copy any unknown descriptors into a storage area for */
- /* drivers to later parse */
- len = (int)(buffer - begin);
- if (len) {
- /* FIXME: We should realloc and append here */
- if (!config->extra_length) {
- config->extra = malloc(len);
- if (!config->extra) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err;
- }
-
- memcpy((unsigned char *) config->extra, begin, len);
- config->extra_length = len;
- }
- }
-
- r = parse_interface(ctx, usb_interface + i, buffer, size, host_endian);
- if (r < 0)
- goto err;
- if (r == 0) {
- config->bNumInterfaces = (uint8_t)i;
- break;
- }
-
- buffer += r;
- size -= r;
- }
-
- return size;
-
-err:
- clear_configuration(config);
- return r;
-}
-
-static int raw_desc_to_config(struct libusb_context *ctx,
- unsigned char *buf, int size, int host_endian,
- struct libusb_config_descriptor **config)
-{
- struct libusb_config_descriptor *_config = malloc(sizeof(*_config));
- int r;
-
- if (!_config)
- return LIBUSB_ERROR_NO_MEM;
-
- r = parse_configuration(ctx, _config, buf, size, host_endian);
- if (r < 0) {
- usbi_err(ctx, "parse_configuration failed with error %d", r);
- free(_config);
- return r;
- } else if (r > 0) {
- usbi_warn(ctx, "still %d bytes of descriptor data left", r);
- }
-
- *config = _config;
- return LIBUSB_SUCCESS;
-}
-
-int usbi_device_cache_descriptor(libusb_device *dev)
-{
- int r, host_endian = 0;
-
- r = usbi_backend->get_device_descriptor(dev, (unsigned char *) &dev->device_descriptor,
- &host_endian);
- if (r < 0)
- return r;
-
- if (!host_endian) {
- dev->device_descriptor.bcdUSB = libusb_le16_to_cpu(dev->device_descriptor.bcdUSB);
- dev->device_descriptor.idVendor = libusb_le16_to_cpu(dev->device_descriptor.idVendor);
- dev->device_descriptor.idProduct = libusb_le16_to_cpu(dev->device_descriptor.idProduct);
- dev->device_descriptor.bcdDevice = libusb_le16_to_cpu(dev->device_descriptor.bcdDevice);
- }
-
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup desc
- * Get the USB device descriptor for a given device.
- *
- * This is a non-blocking function; the device descriptor is cached in memory.
- *
- * Note since libusbx-1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102, this
- * function always succeeds.
- *
- * \param dev the device
- * \param desc output location for the descriptor data
- * \returns 0 on success or a LIBUSB_ERROR code on failure
- */
-int API_EXPORTED libusb_get_device_descriptor(libusb_device *dev,
- struct libusb_device_descriptor *desc)
-{
- usbi_dbg("");
- memcpy((unsigned char *) desc, (unsigned char *) &dev->device_descriptor,
- sizeof (dev->device_descriptor));
- return 0;
-}
-
-/** \ingroup desc
- * Get the USB configuration descriptor for the currently active configuration.
- * This is a non-blocking function which does not involve any requests being
- * sent to the device.
- *
- * \param dev a device
- * \param config output location for the USB configuration descriptor. Only
- * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
- * after use.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
- * \returns another LIBUSB_ERROR code on error
- * \see libusb_get_config_descriptor
- */
-int API_EXPORTED libusb_get_active_config_descriptor(libusb_device *dev,
- struct libusb_config_descriptor **config)
-{
- struct libusb_config_descriptor _config;
- unsigned char tmp[LIBUSB_DT_CONFIG_SIZE];
- unsigned char *buf = NULL;
- int host_endian = 0;
- int r;
-
- r = usbi_backend->get_active_config_descriptor(dev, tmp,
- LIBUSB_DT_CONFIG_SIZE, &host_endian);
- if (r < 0)
- return r;
- if (r < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(dev->ctx, "short config descriptor read %d/%d",
- r, LIBUSB_DT_CONFIG_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(tmp, "bbw", &_config, host_endian);
- buf = malloc(_config.wTotalLength);
- if (!buf)
- return LIBUSB_ERROR_NO_MEM;
-
- r = usbi_backend->get_active_config_descriptor(dev, buf,
- _config.wTotalLength, &host_endian);
- if (r >= 0)
- r = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);
-
- free(buf);
- return r;
-}
-
-/** \ingroup desc
- * Get a USB configuration descriptor based on its index.
- * This is a non-blocking function which does not involve any requests being
- * sent to the device.
- *
- * \param dev a device
- * \param config_index the index of the configuration you wish to retrieve
- * \param config output location for the USB configuration descriptor. Only
- * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
- * after use.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
- * \returns another LIBUSB_ERROR code on error
- * \see libusb_get_active_config_descriptor()
- * \see libusb_get_config_descriptor_by_value()
- */
-int API_EXPORTED libusb_get_config_descriptor(libusb_device *dev,
- uint8_t config_index, struct libusb_config_descriptor **config)
-{
- struct libusb_config_descriptor _config;
- unsigned char tmp[LIBUSB_DT_CONFIG_SIZE];
- unsigned char *buf = NULL;
- int host_endian = 0;
- int r;
-
- usbi_dbg("index %d", config_index);
- if (config_index >= dev->num_configurations)
- return LIBUSB_ERROR_NOT_FOUND;
-
- r = usbi_backend->get_config_descriptor(dev, config_index, tmp,
- LIBUSB_DT_CONFIG_SIZE, &host_endian);
- if (r < 0)
- return r;
- if (r < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(dev->ctx, "short config descriptor read %d/%d",
- r, LIBUSB_DT_CONFIG_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(tmp, "bbw", &_config, host_endian);
- buf = malloc(_config.wTotalLength);
- if (!buf)
- return LIBUSB_ERROR_NO_MEM;
-
- r = usbi_backend->get_config_descriptor(dev, config_index, buf,
- _config.wTotalLength, &host_endian);
- if (r >= 0)
- r = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);
-
- free(buf);
- return r;
-}
-
-/* iterate through all configurations, returning the index of the configuration
- * matching a specific bConfigurationValue in the idx output parameter, or -1
- * if the config was not found.
- * returns 0 or a LIBUSB_ERROR code
- */
-int usbi_get_config_index_by_value(struct libusb_device *dev,
- uint8_t bConfigurationValue, int *idx)
-{
- uint8_t i;
-
- usbi_dbg("value %d", bConfigurationValue);
- for (i = 0; i < dev->num_configurations; i++) {
- unsigned char tmp[6];
- int host_endian;
- int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp),
- &host_endian);
- if (r < 0)
- return r;
- if (tmp[5] == bConfigurationValue) {
- *idx = i;
- return 0;
- }
- }
-
- *idx = -1;
- return 0;
-}
-
-/** \ingroup desc
- * Get a USB configuration descriptor with a specific bConfigurationValue.
- * This is a non-blocking function which does not involve any requests being
- * sent to the device.
- *
- * \param dev a device
- * \param bConfigurationValue the bConfigurationValue of the configuration you
- * wish to retrieve
- * \param config output location for the USB configuration descriptor. Only
- * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
- * after use.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
- * \returns another LIBUSB_ERROR code on error
- * \see libusb_get_active_config_descriptor()
- * \see libusb_get_config_descriptor()
- */
-int API_EXPORTED libusb_get_config_descriptor_by_value(libusb_device *dev,
- uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
-{
- int r, idx, host_endian;
- unsigned char *buf = NULL;
-
- if (usbi_backend->get_config_descriptor_by_value) {
- r = usbi_backend->get_config_descriptor_by_value(dev,
- bConfigurationValue, &buf, &host_endian);
- if (r < 0)
- return r;
- return raw_desc_to_config(dev->ctx, buf, r, host_endian, config);
- }
-
- r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx);
- if (r < 0)
- return r;
- else if (idx == -1)
- return LIBUSB_ERROR_NOT_FOUND;
- else
- return libusb_get_config_descriptor(dev, (uint8_t) idx, config);
-}
-
-/** \ingroup desc
- * Free a configuration descriptor obtained from
- * libusb_get_active_config_descriptor() or libusb_get_config_descriptor().
- * It is safe to call this function with a NULL config parameter, in which
- * case the function simply returns.
- *
- * \param config the configuration descriptor to free
- */
-void API_EXPORTED libusb_free_config_descriptor(
- struct libusb_config_descriptor *config)
-{
- if (!config)
- return;
-
- clear_configuration(config);
- free(config);
-}
-
-/** \ingroup desc
- * Get an endpoints superspeed endpoint companion descriptor (if any)
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param endpoint endpoint descriptor from which to get the superspeed
- * endpoint companion descriptor
- * \param ep_comp output location for the superspeed endpoint companion
- * descriptor. Only valid if 0 was returned. Must be freed with
- * libusb_free_ss_endpoint_companion_descriptor() after use.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
- * \returns another LIBUSB_ERROR code on error
- */
-int API_EXPORTED libusb_get_ss_endpoint_companion_descriptor(
- struct libusb_context *ctx,
- const struct libusb_endpoint_descriptor *endpoint,
- struct libusb_ss_endpoint_companion_descriptor **ep_comp)
-{
- struct usb_descriptor_header header;
- int size = endpoint->extra_length;
- const unsigned char *buffer = endpoint->extra;
-
- *ep_comp = NULL;
-
- while (size >= DESC_HEADER_LENGTH) {
- usbi_parse_descriptor(buffer, "bb", &header, 0);
- if (header.bLength < 2 || header.bLength > size) {
- usbi_err(ctx, "invalid descriptor length %d",
- header.bLength);
- return LIBUSB_ERROR_IO;
- }
- if (header.bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) {
- buffer += header.bLength;
- size -= header.bLength;
- continue;
- }
- if (header.bLength < LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE) {
- usbi_err(ctx, "invalid ss-ep-comp-desc length %d",
- header.bLength);
- return LIBUSB_ERROR_IO;
- }
- *ep_comp = malloc(sizeof(**ep_comp));
- if (*ep_comp == NULL)
- return LIBUSB_ERROR_NO_MEM;
- usbi_parse_descriptor(buffer, "bbbbw", *ep_comp, 0);
- return LIBUSB_SUCCESS;
- }
- return LIBUSB_ERROR_NOT_FOUND;
-}
-
-/** \ingroup desc
- * Free a superspeed endpoint companion descriptor obtained from
- * libusb_get_ss_endpoint_companion_descriptor().
- * It is safe to call this function with a NULL ep_comp parameter, in which
- * case the function simply returns.
- *
- * \param ep_comp the superspeed endpoint companion descriptor to free
- */
-void API_EXPORTED libusb_free_ss_endpoint_companion_descriptor(
- struct libusb_ss_endpoint_companion_descriptor *ep_comp)
-{
- free(ep_comp);
-}
-
-static int parse_bos(struct libusb_context *ctx,
- struct libusb_bos_descriptor **bos,
- unsigned char *buffer, int size, int host_endian)
-{
- struct libusb_bos_descriptor bos_header, *_bos;
- struct libusb_bos_dev_capability_descriptor dev_cap;
- int i;
-
- if (size < LIBUSB_DT_BOS_SIZE) {
- usbi_err(ctx, "short bos descriptor read %d/%d",
- size, LIBUSB_DT_BOS_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(buffer, "bbwb", &bos_header, host_endian);
- if (bos_header.bDescriptorType != LIBUSB_DT_BOS) {
- usbi_err(ctx, "unexpected descriptor %x (expected %x)",
- bos_header.bDescriptorType, LIBUSB_DT_BOS);
- return LIBUSB_ERROR_IO;
- }
- if (bos_header.bLength < LIBUSB_DT_BOS_SIZE) {
- usbi_err(ctx, "invalid bos bLength (%d)", bos_header.bLength);
- return LIBUSB_ERROR_IO;
- }
- if (bos_header.bLength > size) {
- usbi_err(ctx, "short bos descriptor read %d/%d",
- size, bos_header.bLength);
- return LIBUSB_ERROR_IO;
- }
-
- _bos = calloc (1,
- sizeof(*_bos) + bos_header.bNumDeviceCaps * sizeof(void *));
- if (!_bos)
- return LIBUSB_ERROR_NO_MEM;
-
- usbi_parse_descriptor(buffer, "bbwb", _bos, host_endian);
- buffer += bos_header.bLength;
- size -= bos_header.bLength;
-
- /* Get the device capability descriptors */
- for (i = 0; i < bos_header.bNumDeviceCaps; i++) {
- if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
- usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
- size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);
- break;
- }
- usbi_parse_descriptor(buffer, "bbb", &dev_cap, host_endian);
- if (dev_cap.bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {
- usbi_warn(ctx, "unexpected descriptor %x (expected %x)",
- dev_cap.bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);
- break;
- }
- if (dev_cap.bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
- usbi_err(ctx, "invalid dev-cap bLength (%d)",
- dev_cap.bLength);
- libusb_free_bos_descriptor(_bos);
- return LIBUSB_ERROR_IO;
- }
- if (dev_cap.bLength > size) {
- usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
- size, dev_cap.bLength);
- break;
- }
-
- _bos->dev_capability[i] = malloc(dev_cap.bLength);
- if (!_bos->dev_capability[i]) {
- libusb_free_bos_descriptor(_bos);
- return LIBUSB_ERROR_NO_MEM;
- }
- memcpy(_bos->dev_capability[i], buffer, dev_cap.bLength);
- buffer += dev_cap.bLength;
- size -= dev_cap.bLength;
- }
- _bos->bNumDeviceCaps = (uint8_t)i;
- *bos = _bos;
-
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup desc
- * Get a Binary Object Store (BOS) descriptor
- * This is a BLOCKING function, which will send requests to the device.
- *
- * \param handle the handle of an open libusb device
- * \param bos output location for the BOS descriptor. Only valid if 0 was returned.
- * Must be freed with \ref libusb_free_bos_descriptor() after use.
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the device doesn't have a BOS descriptor
- * \returns another LIBUSB_ERROR code on error
- */
-int API_EXPORTED libusb_get_bos_descriptor(libusb_device_handle *handle,
- struct libusb_bos_descriptor **bos)
-{
- struct libusb_bos_descriptor _bos;
- uint8_t bos_header[LIBUSB_DT_BOS_SIZE] = {0};
- unsigned char *bos_data = NULL;
- const int host_endian = 0;
- int r;
-
- /* Read the BOS. This generates 2 requests on the bus,
- * one for the header, and one for the full BOS */
- r = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_header,
- LIBUSB_DT_BOS_SIZE);
- if (r < 0) {
- if (r != LIBUSB_ERROR_PIPE)
- usbi_err(handle->dev->ctx, "failed to read BOS (%d)", r);
- return r;
- }
- if (r < LIBUSB_DT_BOS_SIZE) {
- usbi_err(handle->dev->ctx, "short BOS read %d/%d",
- r, LIBUSB_DT_BOS_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(bos_header, "bbwb", &_bos, host_endian);
- usbi_dbg("found BOS descriptor: size %d bytes, %d capabilities",
- _bos.wTotalLength, _bos.bNumDeviceCaps);
- bos_data = calloc(_bos.wTotalLength, 1);
- if (bos_data == NULL)
- return LIBUSB_ERROR_NO_MEM;
-
- r = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_data,
- _bos.wTotalLength);
- if (r >= 0)
- r = parse_bos(handle->dev->ctx, bos, bos_data, r, host_endian);
- else
- usbi_err(handle->dev->ctx, "failed to read BOS (%d)", r);
-
- free(bos_data);
- return r;
-}
-
-/** \ingroup desc
- * Free a BOS descriptor obtained from libusb_get_bos_descriptor().
- * It is safe to call this function with a NULL bos parameter, in which
- * case the function simply returns.
- *
- * \param bos the BOS descriptor to free
- */
-void API_EXPORTED libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)
-{
- int i;
-
- if (!bos)
- return;
-
- for (i = 0; i < bos->bNumDeviceCaps; i++)
- free(bos->dev_capability[i]);
- free(bos);
-}
-
-/** \ingroup desc
- * Get an USB 2.0 Extension descriptor
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param dev_cap Device Capability descriptor with a bDevCapabilityType of
- * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION
- * LIBUSB_BT_USB_2_0_EXTENSION
- * \param usb_2_0_extension output location for the USB 2.0 Extension
- * descriptor. Only valid if 0 was returned. Must be freed with
- * libusb_free_usb_2_0_extension_descriptor() after use.
- * \returns 0 on success
- * \returns a LIBUSB_ERROR code on error
- */
-int API_EXPORTED libusb_get_usb_2_0_extension_descriptor(
- struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension)
-{
- struct libusb_usb_2_0_extension_descriptor *_usb_2_0_extension;
- const int host_endian = 0;
-
- if (dev_cap->bDevCapabilityType != LIBUSB_BT_USB_2_0_EXTENSION) {
- usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)",
- dev_cap->bDevCapabilityType,
- LIBUSB_BT_USB_2_0_EXTENSION);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
- if (dev_cap->bLength < LIBUSB_BT_USB_2_0_EXTENSION_SIZE) {
- usbi_err(ctx, "short dev-cap descriptor read %d/%d",
- dev_cap->bLength, LIBUSB_BT_USB_2_0_EXTENSION_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- _usb_2_0_extension = malloc(sizeof(*_usb_2_0_extension));
- if (!_usb_2_0_extension)
- return LIBUSB_ERROR_NO_MEM;
-
- usbi_parse_descriptor((unsigned char *)dev_cap, "bbbd",
- _usb_2_0_extension, host_endian);
-
- *usb_2_0_extension = _usb_2_0_extension;
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup desc
- * Free a USB 2.0 Extension descriptor obtained from
- * libusb_get_usb_2_0_extension_descriptor().
- * It is safe to call this function with a NULL usb_2_0_extension parameter,
- * in which case the function simply returns.
- *
- * \param usb_2_0_extension the USB 2.0 Extension descriptor to free
- */
-void API_EXPORTED libusb_free_usb_2_0_extension_descriptor(
- struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension)
-{
- free(usb_2_0_extension);
-}
-
-/** \ingroup desc
- * Get a SuperSpeed USB Device Capability descriptor
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param dev_cap Device Capability descriptor with a bDevCapabilityType of
- * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
- * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
- * \param ss_usb_device_cap output location for the SuperSpeed USB Device
- * Capability descriptor. Only valid if 0 was returned. Must be freed with
- * libusb_free_ss_usb_device_capability_descriptor() after use.
- * \returns 0 on success
- * \returns a LIBUSB_ERROR code on error
- */
-int API_EXPORTED libusb_get_ss_usb_device_capability_descriptor(
- struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap)
-{
- struct libusb_ss_usb_device_capability_descriptor *_ss_usb_device_cap;
- const int host_endian = 0;
-
- if (dev_cap->bDevCapabilityType != LIBUSB_BT_SS_USB_DEVICE_CAPABILITY) {
- usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)",
- dev_cap->bDevCapabilityType,
- LIBUSB_BT_SS_USB_DEVICE_CAPABILITY);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
- if (dev_cap->bLength < LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) {
- usbi_err(ctx, "short dev-cap descriptor read %d/%d",
- dev_cap->bLength, LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- _ss_usb_device_cap = malloc(sizeof(*_ss_usb_device_cap));
- if (!_ss_usb_device_cap)
- return LIBUSB_ERROR_NO_MEM;
-
- usbi_parse_descriptor((unsigned char *)dev_cap, "bbbbwbbw",
- _ss_usb_device_cap, host_endian);
-
- *ss_usb_device_cap = _ss_usb_device_cap;
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup desc
- * Free a SuperSpeed USB Device Capability descriptor obtained from
- * libusb_get_ss_usb_device_capability_descriptor().
- * It is safe to call this function with a NULL ss_usb_device_cap
- * parameter, in which case the function simply returns.
- *
- * \param ss_usb_device_cap the USB 2.0 Extension descriptor to free
- */
-void API_EXPORTED libusb_free_ss_usb_device_capability_descriptor(
- struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)
-{
- free(ss_usb_device_cap);
-}
-
-/** \ingroup desc
- * Get a Container ID descriptor
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param dev_cap Device Capability descriptor with a bDevCapabilityType of
- * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID
- * LIBUSB_BT_CONTAINER_ID
- * \param container_id output location for the Container ID descriptor.
- * Only valid if 0 was returned. Must be freed with
- * libusb_free_container_id_descriptor() after use.
- * \returns 0 on success
- * \returns a LIBUSB_ERROR code on error
- */
-int API_EXPORTED libusb_get_container_id_descriptor(struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_container_id_descriptor **container_id)
-{
- struct libusb_container_id_descriptor *_container_id;
- const int host_endian = 0;
-
- if (dev_cap->bDevCapabilityType != LIBUSB_BT_CONTAINER_ID) {
- usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)",
- dev_cap->bDevCapabilityType,
- LIBUSB_BT_CONTAINER_ID);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
- if (dev_cap->bLength < LIBUSB_BT_CONTAINER_ID_SIZE) {
- usbi_err(ctx, "short dev-cap descriptor read %d/%d",
- dev_cap->bLength, LIBUSB_BT_CONTAINER_ID_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- _container_id = malloc(sizeof(*_container_id));
- if (!_container_id)
- return LIBUSB_ERROR_NO_MEM;
-
- usbi_parse_descriptor((unsigned char *)dev_cap, "bbbbu",
- _container_id, host_endian);
-
- *container_id = _container_id;
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup desc
- * Free a Container ID descriptor obtained from
- * libusb_get_container_id_descriptor().
- * It is safe to call this function with a NULL container_id parameter,
- * in which case the function simply returns.
- *
- * \param container_id the USB 2.0 Extension descriptor to free
- */
-void API_EXPORTED libusb_free_container_id_descriptor(
- struct libusb_container_id_descriptor *container_id)
-{
- free(container_id);
-}
-
-/** \ingroup desc
- * Retrieve a string descriptor in C style ASCII.
- *
- * Wrapper around libusb_get_string_descriptor(). Uses the first language
- * supported by the device.
- *
- * \param dev a device handle
- * \param desc_index the index of the descriptor to retrieve
- * \param data output buffer for ASCII string descriptor
- * \param length size of data buffer
- * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
- */
-int API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev,
- uint8_t desc_index, unsigned char *data, int length)
-{
- unsigned char tbuf[255]; /* Some devices choke on size > 255 */
- int r, si, di;
- uint16_t langid;
-
- /* Asking for the zero'th index is special - it returns a string
- * descriptor that contains all the language IDs supported by the
- * device. Typically there aren't many - often only one. Language
- * IDs are 16 bit numbers, and they start at the third byte in the
- * descriptor. There's also no point in trying to read descriptor 0
- * with this function. See USB 2.0 specification section 9.6.7 for
- * more information.
- */
-
- if (desc_index == 0)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- r = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf));
- if (r < 0)
- return r;
-
- if (r < 4)
- return LIBUSB_ERROR_IO;
-
- langid = tbuf[2] | (tbuf[3] << 8);
-
- r = libusb_get_string_descriptor(dev, desc_index, langid, tbuf,
- sizeof(tbuf));
- if (r < 0)
- return r;
-
- if (tbuf[1] != LIBUSB_DT_STRING)
- return LIBUSB_ERROR_IO;
-
- if (tbuf[0] > r)
- return LIBUSB_ERROR_IO;
-
- for (di = 0, si = 2; si < tbuf[0]; si += 2) {
- if (di >= (length - 1))
- break;
-
- if ((tbuf[si] & 0x80) || (tbuf[si + 1])) /* non-ASCII */
- data[di++] = '?';
- else
- data[di++] = tbuf[si];
- }
-
- data[di] = 0;
- return di;
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.c b/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.c
deleted file mode 100644
index 6b04342f08..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
-/*
- * Hotplug functions for libusbx
- * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>
- * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <config.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <assert.h>
-
-#include "libusbi.h"
-#include "hotplug.h"
-
-/**
- * @defgroup hotplug Device hotplug event notification
- * This page details how to use the libusb hotplug interface, where available.
- *
- * Be mindful that not all platforms currently implement hotplug notification and
- * that you should first call on \ref libusb_has_capability() with parameter
- * \ref LIBUSB_CAP_HAS_HOTPLUG to confirm that hotplug support is available.
- *
- * \page hotplug Device hotplug event notification
- *
- * \section intro Introduction
- *
- * Version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102, has added support
- * for hotplug events on <b>some</b> platforms (you should test if your platform
- * supports hotplug notification by calling \ref libusb_has_capability() with
- * parameter \ref LIBUSB_CAP_HAS_HOTPLUG).
- *
- * This interface allows you to request notification for the arrival and departure
- * of matching USB devices.
- *
- * To receive hotplug notification you register a callback by calling
- * \ref libusb_hotplug_register_callback(). This function will optionally return
- * a handle that can be passed to \ref libusb_hotplug_deregister_callback().
- *
- * A callback function must return an int (0 or 1) indicating whether the callback is
- * expecting additional events. Returning 0 will rearm the callback and 1 will cause
- * the callback to be deregistered.
- *
- * Callbacks for a particular context are automatically deregistered by libusb_exit().
- *
- * As of 1.0.16 there are two supported hotplug events:
- * - LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: A device has arrived and is ready to use
- * - LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: A device has left and is no longer available
- *
- * A hotplug event can listen for either or both of these events.
- *
- * Note: If you receive notification that a device has left and you have any
- * a libusb_device_handles for the device it is up to you to call libusb_close()
- * on each handle to free up any remaining resources associated with the device.
- * Once a device has left any libusb_device_handle associated with the device
- * are invalid and will remain so even if the device comes back.
- *
- * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED event it is considered
- * safe to call any libusbx function that takes a libusb_device. On the other hand,
- * when handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function
- * is libusb_get_device_descriptor().
- *
- * The following code provides an example of the usage of the hotplug interface:
-\code
-static int count = 0;
-
-int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
- libusb_hotplug_event event, void *user_data) {
- static libusb_device_handle *handle = NULL;
- struct libusb_device_descriptor desc;
- int rc;
-
- (void)libusb_get_device_descriptor(dev, &desc);
-
- if (LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED == event) {
- rc = libusb_open(dev, &handle);
- if (LIBUSB_SUCCESS != rc) {
- printf("Could not open USB device\n");
- }
- } else if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) {
- if (handle) {
- libusb_close(handle);
- handle = NULL;
- }
- } else {
- printf("Unhandled event %d\n", event);
- }
- count++;
-
- return 0;
-}
-
-int main (void) {
- libusb_hotplug_callback_handle handle;
- int rc;
-
- libusb_init(NULL);
-
- rc = libusb_hotplug_register_callback(NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
- LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, 0x045a, 0x5005,
- LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL,
- &handle);
- if (LIBUSB_SUCCESS != rc) {
- printf("Error creating a hotplug callback\n");
- libusb_exit(NULL);
- return EXIT_FAILURE;
- }
-
- while (count < 2) {
- usleep(10000);
- }
-
- libusb_hotplug_deregister_callback(handle);
- libusb_exit(NULL);
-
- return 0;
-}
-\endcode
- */
-
-static int usbi_hotplug_match_cb (struct libusb_context *ctx,
- struct libusb_device *dev, libusb_hotplug_event event,
- struct libusb_hotplug_callback *hotplug_cb)
-{
- /* Handle lazy deregistration of callback */
- if (hotplug_cb->needs_free) {
- /* Free callback */
- return 1;
- }
-
- if (!(hotplug_cb->events & event)) {
- return 0;
- }
-
- if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->vendor_id &&
- hotplug_cb->vendor_id != dev->device_descriptor.idVendor) {
- return 0;
- }
-
- if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->product_id &&
- hotplug_cb->product_id != dev->device_descriptor.idProduct) {
- return 0;
- }
-
- if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->dev_class &&
- hotplug_cb->dev_class != dev->device_descriptor.bDeviceClass) {
- return 0;
- }
-
- return hotplug_cb->cb (ctx == usbi_default_context ? NULL : ctx,
- dev, event, hotplug_cb->user_data);
-}
-
-void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,
- libusb_hotplug_event event)
-{
- struct libusb_hotplug_callback *hotplug_cb, *next;
- int ret;
-
- usbi_mutex_lock(&ctx->hotplug_cbs_lock);
-
- list_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list, struct libusb_hotplug_callback) {
- usbi_mutex_unlock(&ctx->hotplug_cbs_lock);
- ret = usbi_hotplug_match_cb (ctx, dev, event, hotplug_cb);
- usbi_mutex_lock(&ctx->hotplug_cbs_lock);
-
- if (ret) {
- list_del(&hotplug_cb->list);
- free(hotplug_cb);
- }
- }
-
- usbi_mutex_unlock(&ctx->hotplug_cbs_lock);
-
- /* loop through and disconnect all open handles for this device */
- if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) {
- struct libusb_device_handle *handle;
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) {
- if (dev == handle->dev) {
- usbi_handle_disconnect (handle);
- }
- }
- usbi_mutex_unlock(&ctx->open_devs_lock);
- }
-}
-
-int API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx,
- libusb_hotplug_event events, libusb_hotplug_flag flags,
- int vendor_id, int product_id, int dev_class,
- libusb_hotplug_callback_fn cb_fn, void *user_data,
- libusb_hotplug_callback_handle *handle)
-{
- libusb_hotplug_callback *new_callback;
- static int handle_id = 1;
-
- /* check for hotplug support */
- if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- return LIBUSB_ERROR_NOT_SUPPORTED;
- }
-
- /* check for sane values */
- if ((LIBUSB_HOTPLUG_MATCH_ANY != vendor_id && (~0xffff & vendor_id)) ||
- (LIBUSB_HOTPLUG_MATCH_ANY != product_id && (~0xffff & product_id)) ||
- (LIBUSB_HOTPLUG_MATCH_ANY != dev_class && (~0xff & dev_class)) ||
- !cb_fn) {
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- USBI_GET_CONTEXT(ctx);
-
- new_callback = (libusb_hotplug_callback *)calloc(1, sizeof (*new_callback));
- if (!new_callback) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- new_callback->ctx = ctx;
- new_callback->vendor_id = vendor_id;
- new_callback->product_id = product_id;
- new_callback->dev_class = dev_class;
- new_callback->flags = flags;
- new_callback->events = events;
- new_callback->cb = cb_fn;
- new_callback->user_data = user_data;
- new_callback->needs_free = 0;
-
- usbi_mutex_lock(&ctx->hotplug_cbs_lock);
-
- /* protect the handle by the context hotplug lock. it doesn't matter if the same handle
- * is used for different contexts only that the handle is unique for this context */
- new_callback->handle = handle_id++;
-
- list_add(&new_callback->list, &ctx->hotplug_cbs);
-
- if (flags & LIBUSB_HOTPLUG_ENUMERATE) {
- struct libusb_device *dev;
-
- usbi_mutex_lock(&ctx->usb_devs_lock);
-
- list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) {
- (void) usbi_hotplug_match_cb (ctx, dev, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, new_callback);
- }
-
- usbi_mutex_unlock(&ctx->usb_devs_lock);
- }
-
- usbi_mutex_unlock(&ctx->hotplug_cbs_lock);
-
- if (handle) {
- *handle = new_callback->handle;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-void API_EXPORTED libusb_hotplug_deregister_callback (struct libusb_context *ctx,
- libusb_hotplug_callback_handle handle)
-{
- struct libusb_hotplug_callback *hotplug_cb;
- libusb_hotplug_message message;
- ssize_t ret;
-
- /* check for hotplug support */
- if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
- return;
- }
-
- USBI_GET_CONTEXT(ctx);
-
- usbi_mutex_lock(&ctx->hotplug_cbs_lock);
- list_for_each_entry(hotplug_cb, &ctx->hotplug_cbs, list,
- struct libusb_hotplug_callback) {
- if (handle == hotplug_cb->handle) {
- /* Mark this callback for deregistration */
- hotplug_cb->needs_free = 1;
- }
- }
- usbi_mutex_unlock(&ctx->hotplug_cbs_lock);
-
- /* wakeup handle_events to do the actual free */
- memset(&message, 0, sizeof(message));
- ret = usbi_write(ctx->hotplug_pipe[1], &message, sizeof(message));
- if (sizeof(message) != ret) {
- usbi_err(ctx, "error writing hotplug message");
- }
-}
-
-void usbi_hotplug_deregister_all(struct libusb_context *ctx) {
- struct libusb_hotplug_callback *hotplug_cb, *next;
-
- usbi_mutex_lock(&ctx->hotplug_cbs_lock);
- list_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list,
- struct libusb_hotplug_callback) {
- list_del(&hotplug_cb->list);
- free(hotplug_cb);
- }
-
- usbi_mutex_unlock(&ctx->hotplug_cbs_lock);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.h b/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.h
deleted file mode 100644
index 614ddbcff0..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/hotplug.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
-/*
- * Hotplug support for libusbx
- * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>
- * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if !defined(USBI_HOTPLUG_H)
-#define USBI_HOTPLUG_H
-
-#ifndef LIBUSBI_H
-#include "libusbi.h"
-#endif
-
-/** \ingroup hotplug
- * The hotplug callback structure. The user populates this structure with
- * libusb_hotplug_prepare_callback() and then calls libusb_hotplug_register_callback()
- * to receive notification of hotplug events.
- */
-struct libusb_hotplug_callback {
- /** Context this callback is associated with */
- struct libusb_context *ctx;
-
- /** Vendor ID to match or LIBUSB_HOTPLUG_MATCH_ANY */
- int vendor_id;
-
- /** Product ID to match or LIBUSB_HOTPLUG_MATCH_ANY */
- int product_id;
-
- /** Device class to match or LIBUSB_HOTPLUG_MATCH_ANY */
- int dev_class;
-
- /** Hotplug callback flags */
- libusb_hotplug_flag flags;
-
- /** Event(s) that will trigger this callback */
- libusb_hotplug_event events;
-
- /** Callback function to invoke for matching event/device */
- libusb_hotplug_callback_fn cb;
-
- /** Handle for this callback (used to match on deregister) */
- libusb_hotplug_callback_handle handle;
-
- /** User data that will be passed to the callback function */
- void *user_data;
-
- /** Callback is marked for deletion */
- int needs_free;
-
- /** List this callback is registered in (ctx->hotplug_cbs) */
- struct list_head list;
-};
-
-typedef struct libusb_hotplug_callback libusb_hotplug_callback;
-
-struct libusb_hotplug_message {
- libusb_hotplug_event event;
- struct libusb_device *device;
-};
-
-typedef struct libusb_hotplug_message libusb_hotplug_message;
-
-void usbi_hotplug_deregister_all(struct libusb_context *ctx);
-void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,
- libusb_hotplug_event event);
-
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/io.c b/src/3rd_party-static/libusbx-1.0.16/libusb/io.c
deleted file mode 100644
index 4368b99457..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/io.c
+++ /dev/null
@@ -1,2566 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
-/*
- * I/O functions for libusbx
- * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef USBI_TIMERFD_AVAILABLE
-#include <sys/timerfd.h>
-#endif
-
-#include "libusbi.h"
-#include "hotplug.h"
-
-/**
- * \page io Synchronous and asynchronous device I/O
- *
- * \section intro Introduction
- *
- * If you're using libusbx in your application, you're probably wanting to
- * perform I/O with devices - you want to perform USB data transfers.
- *
- * libusbx offers two separate interfaces for device I/O. This page aims to
- * introduce the two in order to help you decide which one is more suitable
- * for your application. You can also choose to use both interfaces in your
- * application by considering each transfer on a case-by-case basis.
- *
- * Once you have read through the following discussion, you should consult the
- * detailed API documentation pages for the details:
- * - \ref syncio
- * - \ref asyncio
- *
- * \section theory Transfers at a logical level
- *
- * At a logical level, USB transfers typically happen in two parts. For
- * example, when reading data from a endpoint:
- * -# A request for data is sent to the device
- * -# Some time later, the incoming data is received by the host
- *
- * or when writing data to an endpoint:
- *
- * -# The data is sent to the device
- * -# Some time later, the host receives acknowledgement from the device that
- * the data has been transferred.
- *
- * There may be an indefinite delay between the two steps. Consider a
- * fictional USB input device with a button that the user can press. In order
- * to determine when the button is pressed, you would likely submit a request
- * to read data on a bulk or interrupt endpoint and wait for data to arrive.
- * Data will arrive when the button is pressed by the user, which is
- * potentially hours later.
- *
- * libusbx offers both a synchronous and an asynchronous interface to performing
- * USB transfers. The main difference is that the synchronous interface
- * combines both steps indicated above into a single function call, whereas
- * the asynchronous interface separates them.
- *
- * \section sync The synchronous interface
- *
- * The synchronous I/O interface allows you to perform a USB transfer with
- * a single function call. When the function call returns, the transfer has
- * completed and you can parse the results.
- *
- * If you have used the libusb-0.1 before, this I/O style will seem familar to
- * you. libusb-0.1 only offered a synchronous interface.
- *
- * In our input device example, to read button presses you might write code
- * in the following style:
-\code
-unsigned char data[4];
-int actual_length;
-int r = libusb_bulk_transfer(handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0);
-if (r == 0 && actual_length == sizeof(data)) {
- // results of the transaction can now be found in the data buffer
- // parse them here and report button press
-} else {
- error();
-}
-\endcode
- *
- * The main advantage of this model is simplicity: you did everything with
- * a single simple function call.
- *
- * However, this interface has its limitations. Your application will sleep
- * inside libusb_bulk_transfer() until the transaction has completed. If it
- * takes the user 3 hours to press the button, your application will be
- * sleeping for that long. Execution will be tied up inside the library -
- * the entire thread will be useless for that duration.
- *
- * Another issue is that by tieing up the thread with that single transaction
- * there is no possibility of performing I/O with multiple endpoints and/or
- * multiple devices simultaneously, unless you resort to creating one thread
- * per transaction.
- *
- * Additionally, there is no opportunity to cancel the transfer after the
- * request has been submitted.
- *
- * For details on how to use the synchronous API, see the
- * \ref syncio "synchronous I/O API documentation" pages.
- *
- * \section async The asynchronous interface
- *
- * Asynchronous I/O is the most significant new feature in libusb-1.0.
- * Although it is a more complex interface, it solves all the issues detailed
- * above.
- *
- * Instead of providing which functions that block until the I/O has complete,
- * libusbx's asynchronous interface presents non-blocking functions which
- * begin a transfer and then return immediately. Your application passes a
- * callback function pointer to this non-blocking function, which libusbx will
- * call with the results of the transaction when it has completed.
- *
- * Transfers which have been submitted through the non-blocking functions
- * can be cancelled with a separate function call.
- *
- * The non-blocking nature of this interface allows you to be simultaneously
- * performing I/O to multiple endpoints on multiple devices, without having
- * to use threads.
- *
- * This added flexibility does come with some complications though:
- * - In the interest of being a lightweight library, libusbx does not create
- * threads and can only operate when your application is calling into it. Your
- * application must call into libusbx from it's main loop when events are ready
- * to be handled, or you must use some other scheme to allow libusbx to
- * undertake whatever work needs to be done.
- * - libusbx also needs to be called into at certain fixed points in time in
- * order to accurately handle transfer timeouts.
- * - Memory handling becomes more complex. You cannot use stack memory unless
- * the function with that stack is guaranteed not to return until the transfer
- * callback has finished executing.
- * - You generally lose some linearity from your code flow because submitting
- * the transfer request is done in a separate function from where the transfer
- * results are handled. This becomes particularly obvious when you want to
- * submit a second transfer based on the results of an earlier transfer.
- *
- * Internally, libusbx's synchronous interface is expressed in terms of function
- * calls to the asynchronous interface.
- *
- * For details on how to use the asynchronous API, see the
- * \ref asyncio "asynchronous I/O API" documentation pages.
- */
-
-
-/**
- * \page packetoverflow Packets and overflows
- *
- * \section packets Packet abstraction
- *
- * The USB specifications describe how data is transmitted in packets, with
- * constraints on packet size defined by endpoint descriptors. The host must
- * not send data payloads larger than the endpoint's maximum packet size.
- *
- * libusbx and the underlying OS abstract out the packet concept, allowing you
- * to request transfers of any size. Internally, the request will be divided
- * up into correctly-sized packets. You do not have to be concerned with
- * packet sizes, but there is one exception when considering overflows.
- *
- * \section overflow Bulk/interrupt transfer overflows
- *
- * When requesting data on a bulk endpoint, libusbx requires you to supply a
- * buffer and the maximum number of bytes of data that libusbx can put in that
- * buffer. However, the size of the buffer is not communicated to the device -
- * the device is just asked to send any amount of data.
- *
- * There is no problem if the device sends an amount of data that is less than
- * or equal to the buffer size. libusbx reports this condition to you through
- * the \ref libusb_transfer::actual_length "libusb_transfer.actual_length"
- * field.
- *
- * Problems may occur if the device attempts to send more data than can fit in
- * the buffer. libusbx reports LIBUSB_TRANSFER_OVERFLOW for this condition but
- * other behaviour is largely undefined: actual_length may or may not be
- * accurate, the chunk of data that can fit in the buffer (before overflow)
- * may or may not have been transferred.
- *
- * Overflows are nasty, but can be avoided. Even though you were told to
- * ignore packets above, think about the lower level details: each transfer is
- * split into packets (typically small, with a maximum size of 512 bytes).
- * Overflows can only happen if the final packet in an incoming data transfer
- * is smaller than the actual packet that the device wants to transfer.
- * Therefore, you will never see an overflow if your transfer buffer size is a
- * multiple of the endpoint's packet size: the final packet will either
- * fill up completely or will be only partially filled.
- */
-
-/**
- * @defgroup asyncio Asynchronous device I/O
- *
- * This page details libusbx's asynchronous (non-blocking) API for USB device
- * I/O. This interface is very powerful but is also quite complex - you will
- * need to read this page carefully to understand the necessary considerations
- * and issues surrounding use of this interface. Simplistic applications
- * may wish to consider the \ref syncio "synchronous I/O API" instead.
- *
- * The asynchronous interface is built around the idea of separating transfer
- * submission and handling of transfer completion (the synchronous model
- * combines both of these into one). There may be a long delay between
- * submission and completion, however the asynchronous submission function
- * is non-blocking so will return control to your application during that
- * potentially long delay.
- *
- * \section asyncabstraction Transfer abstraction
- *
- * For the asynchronous I/O, libusbx implements the concept of a generic
- * transfer entity for all types of I/O (control, bulk, interrupt,
- * isochronous). The generic transfer object must be treated slightly
- * differently depending on which type of I/O you are performing with it.
- *
- * This is represented by the public libusb_transfer structure type.
- *
- * \section asynctrf Asynchronous transfers
- *
- * We can view asynchronous I/O as a 5 step process:
- * -# <b>Allocation</b>: allocate a libusb_transfer
- * -# <b>Filling</b>: populate the libusb_transfer instance with information
- * about the transfer you wish to perform
- * -# <b>Submission</b>: ask libusbx to submit the transfer
- * -# <b>Completion handling</b>: examine transfer results in the
- * libusb_transfer structure
- * -# <b>Deallocation</b>: clean up resources
- *
- *
- * \subsection asyncalloc Allocation
- *
- * This step involves allocating memory for a USB transfer. This is the
- * generic transfer object mentioned above. At this stage, the transfer
- * is "blank" with no details about what type of I/O it will be used for.
- *
- * Allocation is done with the libusb_alloc_transfer() function. You must use
- * this function rather than allocating your own transfers.
- *
- * \subsection asyncfill Filling
- *
- * This step is where you take a previously allocated transfer and fill it
- * with information to determine the message type and direction, data buffer,
- * callback function, etc.
- *
- * You can either fill the required fields yourself or you can use the
- * helper functions: libusb_fill_control_transfer(), libusb_fill_bulk_transfer()
- * and libusb_fill_interrupt_transfer().
- *
- * \subsection asyncsubmit Submission
- *
- * When you have allocated a transfer and filled it, you can submit it using
- * libusb_submit_transfer(). This function returns immediately but can be
- * regarded as firing off the I/O request in the background.
- *
- * \subsection asynccomplete Completion handling
- *
- * After a transfer has been submitted, one of four things can happen to it:
- *
- * - The transfer completes (i.e. some data was transferred)
- * - The transfer has a timeout and the timeout expires before all data is
- * transferred
- * - The transfer fails due to an error
- * - The transfer is cancelled
- *
- * Each of these will cause the user-specified transfer callback function to
- * be invoked. It is up to the callback function to determine which of the
- * above actually happened and to act accordingly.
- *
- * The user-specified callback is passed a pointer to the libusb_transfer
- * structure which was used to setup and submit the transfer. At completion
- * time, libusbx has populated this structure with results of the transfer:
- * success or failure reason, number of bytes of data transferred, etc. See
- * the libusb_transfer structure documentation for more information.
- *
- * \subsection Deallocation
- *
- * When a transfer has completed (i.e. the callback function has been invoked),
- * you are advised to free the transfer (unless you wish to resubmit it, see
- * below). Transfers are deallocated with libusb_free_transfer().
- *
- * It is undefined behaviour to free a transfer which has not completed.
- *
- * \section asyncresubmit Resubmission
- *
- * You may be wondering why allocation, filling, and submission are all
- * separated above where they could reasonably be combined into a single
- * operation.
- *
- * The reason for separation is to allow you to resubmit transfers without
- * having to allocate new ones every time. This is especially useful for
- * common situations dealing with interrupt endpoints - you allocate one
- * transfer, fill and submit it, and when it returns with results you just
- * resubmit it for the next interrupt.
- *
- * \section asynccancel Cancellation
- *
- * Another advantage of using the asynchronous interface is that you have
- * the ability to cancel transfers which have not yet completed. This is
- * done by calling the libusb_cancel_transfer() function.
- *
- * libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the
- * cancellation actually completes, the transfer's callback function will
- * be invoked, and the callback function should check the transfer status to
- * determine that it was cancelled.
- *
- * Freeing the transfer after it has been cancelled but before cancellation
- * has completed will result in undefined behaviour.
- *
- * When a transfer is cancelled, some of the data may have been transferred.
- * libusbx will communicate this to you in the transfer callback. Do not assume
- * that no data was transferred.
- *
- * \section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints
- *
- * If your device does not have predictable transfer sizes (or it misbehaves),
- * your application may submit a request for data on an IN endpoint which is
- * smaller than the data that the device wishes to send. In some circumstances
- * this will cause an overflow, which is a nasty condition to deal with. See
- * the \ref packetoverflow page for discussion.
- *
- * \section asyncctrl Considerations for control transfers
- *
- * The <tt>libusb_transfer</tt> structure is generic and hence does not
- * include specific fields for the control-specific setup packet structure.
- *
- * In order to perform a control transfer, you must place the 8-byte setup
- * packet at the start of the data buffer. To simplify this, you could
- * cast the buffer pointer to type struct libusb_control_setup, or you can
- * use the helper function libusb_fill_control_setup().
- *
- * The wLength field placed in the setup packet must be the length you would
- * expect to be sent in the setup packet: the length of the payload that
- * follows (or the expected maximum number of bytes to receive). However,
- * the length field of the libusb_transfer object must be the length of
- * the data buffer - i.e. it should be wLength <em>plus</em> the size of
- * the setup packet (LIBUSB_CONTROL_SETUP_SIZE).
- *
- * If you use the helper functions, this is simplified for you:
- * -# Allocate a buffer of size LIBUSB_CONTROL_SETUP_SIZE plus the size of the
- * data you are sending/requesting.
- * -# Call libusb_fill_control_setup() on the data buffer, using the transfer
- * request size as the wLength value (i.e. do not include the extra space you
- * allocated for the control setup).
- * -# If this is a host-to-device transfer, place the data to be transferred
- * in the data buffer, starting at offset LIBUSB_CONTROL_SETUP_SIZE.
- * -# Call libusb_fill_control_transfer() to associate the data buffer with
- * the transfer (and to set the remaining details such as callback and timeout).
- * - Note that there is no parameter to set the length field of the transfer.
- * The length is automatically inferred from the wLength field of the setup
- * packet.
- * -# Submit the transfer.
- *
- * The multi-byte control setup fields (wValue, wIndex and wLength) must
- * be given in little-endian byte order (the endianness of the USB bus).
- * Endianness conversion is transparently handled by
- * libusb_fill_control_setup() which is documented to accept host-endian
- * values.
- *
- * Further considerations are needed when handling transfer completion in
- * your callback function:
- * - As you might expect, the setup packet will still be sitting at the start
- * of the data buffer.
- * - If this was a device-to-host transfer, the received data will be sitting
- * at offset LIBUSB_CONTROL_SETUP_SIZE into the buffer.
- * - The actual_length field of the transfer structure is relative to the
- * wLength of the setup packet, rather than the size of the data buffer. So,
- * if your wLength was 4, your transfer's <tt>length</tt> was 12, then you
- * should expect an <tt>actual_length</tt> of 4 to indicate that the data was
- * transferred in entirity.
- *
- * To simplify parsing of setup packets and obtaining the data from the
- * correct offset, you may wish to use the libusb_control_transfer_get_data()
- * and libusb_control_transfer_get_setup() functions within your transfer
- * callback.
- *
- * Even though control endpoints do not halt, a completed control transfer
- * may have a LIBUSB_TRANSFER_STALL status code. This indicates the control
- * request was not supported.
- *
- * \section asyncintr Considerations for interrupt transfers
- *
- * All interrupt transfers are performed using the polling interval presented
- * by the bInterval value of the endpoint descriptor.
- *
- * \section asynciso Considerations for isochronous transfers
- *
- * Isochronous transfers are more complicated than transfers to
- * non-isochronous endpoints.
- *
- * To perform I/O to an isochronous endpoint, allocate the transfer by calling
- * libusb_alloc_transfer() with an appropriate number of isochronous packets.
- *
- * During filling, set \ref libusb_transfer::type "type" to
- * \ref libusb_transfer_type::LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
- * "LIBUSB_TRANSFER_TYPE_ISOCHRONOUS", and set
- * \ref libusb_transfer::num_iso_packets "num_iso_packets" to a value less than
- * or equal to the number of packets you requested during allocation.
- * libusb_alloc_transfer() does not set either of these fields for you, given
- * that you might not even use the transfer on an isochronous endpoint.
- *
- * Next, populate the length field for the first num_iso_packets entries in
- * the \ref libusb_transfer::iso_packet_desc "iso_packet_desc" array. Section
- * 5.6.3 of the USB2 specifications describe how the maximum isochronous
- * packet length is determined by the wMaxPacketSize field in the endpoint
- * descriptor.
- * Two functions can help you here:
- *
- * - libusb_get_max_iso_packet_size() is an easy way to determine the max
- * packet size for an isochronous endpoint. Note that the maximum packet
- * size is actually the maximum number of bytes that can be transmitted in
- * a single microframe, therefore this function multiplies the maximum number
- * of bytes per transaction by the number of transaction opportunities per
- * microframe.
- * - libusb_set_iso_packet_lengths() assigns the same length to all packets
- * within a transfer, which is usually what you want.
- *
- * For outgoing transfers, you'll obviously fill the buffer and populate the
- * packet descriptors in hope that all the data gets transferred. For incoming
- * transfers, you must ensure the buffer has sufficient capacity for
- * the situation where all packets transfer the full amount of requested data.
- *
- * Completion handling requires some extra consideration. The
- * \ref libusb_transfer::actual_length "actual_length" field of the transfer
- * is meaningless and should not be examined; instead you must refer to the
- * \ref libusb_iso_packet_descriptor::actual_length "actual_length" field of
- * each individual packet.
- *
- * The \ref libusb_transfer::status "status" field of the transfer is also a
- * little misleading:
- * - If the packets were submitted and the isochronous data microframes
- * completed normally, status will have value
- * \ref libusb_transfer_status::LIBUSB_TRANSFER_COMPLETED
- * "LIBUSB_TRANSFER_COMPLETED". Note that bus errors and software-incurred
- * delays are not counted as transfer errors; the transfer.status field may
- * indicate COMPLETED even if some or all of the packets failed. Refer to
- * the \ref libusb_iso_packet_descriptor::status "status" field of each
- * individual packet to determine packet failures.
- * - The status field will have value
- * \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR
- * "LIBUSB_TRANSFER_ERROR" only when serious errors were encountered.
- * - Other transfer status codes occur with normal behaviour.
- *
- * The data for each packet will be found at an offset into the buffer that
- * can be calculated as if each prior packet completed in full. The
- * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple()
- * functions may help you here.
- *
- * \section asyncmem Memory caveats
- *
- * In most circumstances, it is not safe to use stack memory for transfer
- * buffers. This is because the function that fired off the asynchronous
- * transfer may return before libusbx has finished using the buffer, and when
- * the function returns it's stack gets destroyed. This is true for both
- * host-to-device and device-to-host transfers.
- *
- * The only case in which it is safe to use stack memory is where you can
- * guarantee that the function owning the stack space for the buffer does not
- * return until after the transfer's callback function has completed. In every
- * other case, you need to use heap memory instead.
- *
- * \section asyncflags Fine control
- *
- * Through using this asynchronous interface, you may find yourself repeating
- * a few simple operations many times. You can apply a bitwise OR of certain
- * flags to a transfer to simplify certain things:
- * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_SHORT_NOT_OK
- * "LIBUSB_TRANSFER_SHORT_NOT_OK" results in transfers which transferred
- * less than the requested amount of data being marked with status
- * \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR "LIBUSB_TRANSFER_ERROR"
- * (they would normally be regarded as COMPLETED)
- * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER
- * "LIBUSB_TRANSFER_FREE_BUFFER" allows you to ask libusbx to free the transfer
- * buffer when freeing the transfer.
- * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER
- * "LIBUSB_TRANSFER_FREE_TRANSFER" causes libusbx to automatically free the
- * transfer after the transfer callback returns.
- *
- * \section asyncevent Event handling
- *
- * An asynchronous model requires that libusbx perform work at various
- * points in time - namely processing the results of previously-submitted
- * transfers and invoking the user-supplied callback function.
- *
- * This gives rise to the libusb_handle_events() function which your
- * application must call into when libusbx has work do to. This gives libusbx
- * the opportunity to reap pending transfers, invoke callbacks, etc.
- *
- * There are 2 different approaches to dealing with libusb_handle_events:
- *
- * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated
- * thread.
- * -# Integrate libusbx with your application's main event loop. libusbx
- * exposes a set of file descriptors which allow you to do this.
- *
- * The first approach has the big advantage that it will also work on Windows
- * were libusbx' poll API for select / poll integration is not available. So
- * if you want to support Windows and use the async API, you must use this
- * approach, see the \ref eventthread "Using an event handling thread" section
- * below for details.
- *
- * If you prefer a single threaded approach with a single central event loop,
- * see the \ref poll "polling and timing" section for how to integrate libusbx
- * into your application's main event loop.
- *
- * \section eventthread Using an event handling thread
- *
- * Lets begin with stating the obvious: If you're going to use a separate
- * thread for libusbx event handling, your callback functions MUST be
- * threadsafe.
- *
- * Other then that doing event handling from a separate thread, is mostly
- * simple. You can use an event thread function as follows:
-\code
-void *event_thread_func(void *ctx)
-{
- while (event_thread_run)
- libusb_handle_events(ctx);
-
- return NULL;
-}
-\endcode
- *
- * There is one caveat though, stopping this thread requires setting the
- * event_thread_run variable to 0, and after that libusb_handle_events() needs
- * to return control to event_thread_func. But unless some event happens,
- * libusb_handle_events() will not return.
- *
- * There are 2 different ways of dealing with this, depending on if your
- * application uses libusbx' \ref hotplug "hotplug" support or not.
- *
- * Applications which do not use hotplug support, should not start the event
- * thread until after their first call to libusb_open(), and should stop the
- * thread when closing the last open device as follows:
-\code
-void my_close_handle(libusb_device_handle *handle)
-{
- if (open_devs == 1)
- event_thread_run = 0;
-
- libusb_close(handle); // This wakes up libusb_handle_events()
-
- if (open_devs == 1)
- pthread_join(event_thread);
-
- open_devs--;
-}
-\endcode
- *
- * Applications using hotplug support should start the thread at program init,
- * after having successfully called libusb_hotplug_register_callback(), and
- * should stop the thread at program exit as follows:
-\code
-void my_libusb_exit(void)
-{
- event_thread_run = 0;
- libusb_hotplug_deregister_callback(ctx, hotplug_cb_handle); // This wakes up libusb_handle_events()
- pthread_join(event_thread);
- libusb_exit(ctx);
-}
-\endcode
- */
-
-/**
- * @defgroup poll Polling and timing
- *
- * This page documents libusbx's functions for polling events and timing.
- * These functions are only necessary for users of the
- * \ref asyncio "asynchronous API". If you are only using the simpler
- * \ref syncio "synchronous API" then you do not need to ever call these
- * functions.
- *
- * The justification for the functionality described here has already been
- * discussed in the \ref asyncevent "event handling" section of the
- * asynchronous API documentation. In summary, libusbx does not create internal
- * threads for event processing and hence relies on your application calling
- * into libusbx at certain points in time so that pending events can be handled.
- *
- * Your main loop is probably already calling poll() or select() or a
- * variant on a set of file descriptors for other event sources (e.g. keyboard
- * button presses, mouse movements, network sockets, etc). You then add
- * libusbx's file descriptors to your poll()/select() calls, and when activity
- * is detected on such descriptors you know it is time to call
- * libusb_handle_events().
- *
- * There is one final event handling complication. libusbx supports
- * asynchronous transfers which time out after a specified time period.
- *
- * On some platforms a timerfd is used, so the timeout handling is just another
- * fd, on other platforms this requires that libusbx is called into at or after
- * the timeout to handle it. So, in addition to considering libusbx's file
- * descriptors in your main event loop, you must also consider that libusbx
- * sometimes needs to be called into at fixed points in time even when there
- * is no file descriptor activity, see \ref polltime details.
- *
- * In order to know precisely when libusbx needs to be called into, libusbx
- * offers you a set of pollable file descriptors and information about when
- * the next timeout expires.
- *
- * If you are using the asynchronous I/O API, you must take one of the two
- * following options, otherwise your I/O will not complete.
- *
- * \section pollsimple The simple option
- *
- * If your application revolves solely around libusbx and does not need to
- * handle other event sources, you can have a program structure as follows:
-\code
-// initialize libusbx
-// find and open device
-// maybe fire off some initial async I/O
-
-while (user_has_not_requested_exit)
- libusb_handle_events(ctx);
-
-// clean up and exit
-\endcode
- *
- * With such a simple main loop, you do not have to worry about managing
- * sets of file descriptors or handling timeouts. libusb_handle_events() will
- * handle those details internally.
- *
- * \section pollmain The more advanced option
- *
- * \note This functionality is currently only available on Unix-like platforms.
- * On Windows, libusb_get_pollfds() simply returns NULL. Applications which
- * want to support Windows are advised to use an \ref eventthread
- * "event handling thread" instead.
- *
- * In more advanced applications, you will already have a main loop which
- * is monitoring other event sources: network sockets, X11 events, mouse
- * movements, etc. Through exposing a set of file descriptors, libusbx is
- * designed to cleanly integrate into such main loops.
- *
- * In addition to polling file descriptors for the other event sources, you
- * take a set of file descriptors from libusbx and monitor those too. When you
- * detect activity on libusbx's file descriptors, you call
- * libusb_handle_events_timeout() in non-blocking mode.
- *
- * What's more, libusbx may also need to handle events at specific moments in
- * time. No file descriptor activity is generated at these times, so your
- * own application needs to be continually aware of when the next one of these
- * moments occurs (through calling libusb_get_next_timeout()), and then it
- * needs to call libusb_handle_events_timeout() in non-blocking mode when
- * these moments occur. This means that you need to adjust your
- * poll()/select() timeout accordingly.
- *
- * libusbx provides you with a set of file descriptors to poll and expects you
- * to poll all of them, treating them as a single entity. The meaning of each
- * file descriptor in the set is an internal implementation detail,
- * platform-dependent and may vary from release to release. Don't try and
- * interpret the meaning of the file descriptors, just do as libusbx indicates,
- * polling all of them at once.
- *
- * In pseudo-code, you want something that looks like:
-\code
-// initialise libusbx
-
-libusb_get_pollfds(ctx)
-while (user has not requested application exit) {
- libusb_get_next_timeout(ctx);
- poll(on libusbx file descriptors plus any other event sources of interest,
- using a timeout no larger than the value libusbx just suggested)
- if (poll() indicated activity on libusbx file descriptors)
- libusb_handle_events_timeout(ctx, &zero_tv);
- if (time has elapsed to or beyond the libusbx timeout)
- libusb_handle_events_timeout(ctx, &zero_tv);
- // handle events from other sources here
-}
-
-// clean up and exit
-\endcode
- *
- * \subsection polltime Notes on time-based events
- *
- * The above complication with having to track time and call into libusbx at
- * specific moments is a bit of a headache. For maximum compatibility, you do
- * need to write your main loop as above, but you may decide that you can
- * restrict the supported platforms of your application and get away with
- * a more simplistic scheme.
- *
- * These time-based event complications are \b not required on the following
- * platforms:
- * - Darwin
- * - Linux, provided that the following version requirements are satisfied:
- * - Linux v2.6.27 or newer, compiled with timerfd support
- * - glibc v2.9 or newer
- * - libusbx v1.0.5 or newer
- *
- * Under these configurations, libusb_get_next_timeout() will \em always return
- * 0, so your main loop can be simplified to:
-\code
-// initialise libusbx
-
-libusb_get_pollfds(ctx)
-while (user has not requested application exit) {
- poll(on libusbx file descriptors plus any other event sources of interest,
- using any timeout that you like)
- if (poll() indicated activity on libusbx file descriptors)
- libusb_handle_events_timeout(ctx, &zero_tv);
- // handle events from other sources here
-}
-
-// clean up and exit
-\endcode
- *
- * Do remember that if you simplify your main loop to the above, you will
- * lose compatibility with some platforms (including legacy Linux platforms,
- * and <em>any future platforms supported by libusbx which may have time-based
- * event requirements</em>). The resultant problems will likely appear as
- * strange bugs in your application.
- *
- * You can use the libusb_pollfds_handle_timeouts() function to do a runtime
- * check to see if it is safe to ignore the time-based event complications.
- * If your application has taken the shortcut of ignoring libusbx's next timeout
- * in your main loop, then you are advised to check the return value of
- * libusb_pollfds_handle_timeouts() during application startup, and to abort
- * if the platform does suffer from these timing complications.
- *
- * \subsection fdsetchange Changes in the file descriptor set
- *
- * The set of file descriptors that libusbx uses as event sources may change
- * during the life of your application. Rather than having to repeatedly
- * call libusb_get_pollfds(), you can set up notification functions for when
- * the file descriptor set changes using libusb_set_pollfd_notifiers().
- *
- * \subsection mtissues Multi-threaded considerations
- *
- * Unfortunately, the situation is complicated further when multiple threads
- * come into play. If two threads are monitoring the same file descriptors,
- * the fact that only one thread will be woken up when an event occurs causes
- * some headaches.
- *
- * The events lock, event waiters lock, and libusb_handle_events_locked()
- * entities are added to solve these problems. You do not need to be concerned
- * with these entities otherwise.
- *
- * See the extra documentation: \ref mtasync
- */
-
-/** \page mtasync Multi-threaded applications and asynchronous I/O
- *
- * libusbx is a thread-safe library, but extra considerations must be applied
- * to applications which interact with libusbx from multiple threads.
- *
- * The underlying issue that must be addressed is that all libusbx I/O
- * revolves around monitoring file descriptors through the poll()/select()
- * system calls. This is directly exposed at the
- * \ref asyncio "asynchronous interface" but it is important to note that the
- * \ref syncio "synchronous interface" is implemented on top of the
- * asynchonrous interface, therefore the same considerations apply.
- *
- * The issue is that if two or more threads are concurrently calling poll()
- * or select() on libusbx's file descriptors then only one of those threads
- * will be woken up when an event arrives. The others will be completely
- * oblivious that anything has happened.
- *
- * Consider the following pseudo-code, which submits an asynchronous transfer
- * then waits for its completion. This style is one way you could implement a
- * synchronous interface on top of the asynchronous interface (and libusbx
- * does something similar, albeit more advanced due to the complications
- * explained on this page).
- *
-\code
-void cb(struct libusb_transfer *transfer)
-{
- int *completed = transfer->user_data;
- *completed = 1;
-}
-
-void myfunc() {
- struct libusb_transfer *transfer;
- unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE];
- int completed = 0;
-
- transfer = libusb_alloc_transfer(0);
- libusb_fill_control_setup(buffer,
- LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, 0x04, 0x01, 0, 0);
- libusb_fill_control_transfer(transfer, dev, buffer, cb, &completed, 1000);
- libusb_submit_transfer(transfer);
-
- while (!completed) {
- poll(libusbx file descriptors, 120*1000);
- if (poll indicates activity)
- libusb_handle_events_timeout(ctx, &zero_tv);
- }
- printf("completed!");
- // other code here
-}
-\endcode
- *
- * Here we are <em>serializing</em> completion of an asynchronous event
- * against a condition - the condition being completion of a specific transfer.
- * The poll() loop has a long timeout to minimize CPU usage during situations
- * when nothing is happening (it could reasonably be unlimited).
- *
- * If this is the only thread that is polling libusbx's file descriptors, there
- * is no problem: there is no danger that another thread will swallow up the
- * event that we are interested in. On the other hand, if there is another
- * thread polling the same descriptors, there is a chance that it will receive
- * the event that we were interested in. In this situation, <tt>myfunc()</tt>
- * will only realise that the transfer has completed on the next iteration of
- * the loop, <em>up to 120 seconds later.</em> Clearly a two-minute delay is
- * undesirable, and don't even think about using short timeouts to circumvent
- * this issue!
- *
- * The solution here is to ensure that no two threads are ever polling the
- * file descriptors at the same time. A naive implementation of this would
- * impact the capabilities of the library, so libusbx offers the scheme
- * documented below to ensure no loss of functionality.
- *
- * Before we go any further, it is worth mentioning that all libusb-wrapped
- * event handling procedures fully adhere to the scheme documented below.
- * This includes libusb_handle_events() and its variants, and all the
- * synchronous I/O functions - libusbx hides this headache from you.
- *
- * \section Using libusb_handle_events() from multiple threads
- *
- * Even when only using libusb_handle_events() and synchronous I/O functions,
- * you can still have a race condition. You might be tempted to solve the
- * above with libusb_handle_events() like so:
- *
-\code
- libusb_submit_transfer(transfer);
-
- while (!completed) {
- libusb_handle_events(ctx);
- }
- printf("completed!");
-\endcode
- *
- * This however has a race between the checking of completed and
- * libusb_handle_events() acquiring the events lock, so another thread
- * could have completed the transfer, resulting in this thread hanging
- * until either a timeout or another event occurs. See also commit
- * 6696512aade99bb15d6792af90ae329af270eba6 which fixes this in the
- * synchronous API implementation of libusb.
- *
- * Fixing this race requires checking the variable completed only after
- * taking the event lock, which defeats the concept of just calling
- * libusb_handle_events() without worrying about locking. This is why
- * libusb-1.0.9 introduces the new libusb_handle_events_timeout_completed()
- * and libusb_handle_events_completed() functions, which handles doing the
- * completion check for you after they have acquired the lock:
- *
-\code
- libusb_submit_transfer(transfer);
-
- while (!completed) {
- libusb_handle_events_completed(ctx, &completed);
- }
- printf("completed!");
-\endcode
- *
- * This nicely fixes the race in our example. Note that if all you want to
- * do is submit a single transfer and wait for its completion, then using
- * one of the synchronous I/O functions is much easier.
- *
- * \section eventlock The events lock
- *
- * The problem is when we consider the fact that libusbx exposes file
- * descriptors to allow for you to integrate asynchronous USB I/O into
- * existing main loops, effectively allowing you to do some work behind
- * libusbx's back. If you do take libusbx's file descriptors and pass them to
- * poll()/select() yourself, you need to be aware of the associated issues.
- *
- * The first concept to be introduced is the events lock. The events lock
- * is used to serialize threads that want to handle events, such that only
- * one thread is handling events at any one time.
- *
- * You must take the events lock before polling libusbx file descriptors,
- * using libusb_lock_events(). You must release the lock as soon as you have
- * aborted your poll()/select() loop, using libusb_unlock_events().
- *
- * \section threadwait Letting other threads do the work for you
- *
- * Although the events lock is a critical part of the solution, it is not
- * enough on it's own. You might wonder if the following is sufficient...
-\code
- libusb_lock_events(ctx);
- while (!completed) {
- poll(libusbx file descriptors, 120*1000);
- if (poll indicates activity)
- libusb_handle_events_timeout(ctx, &zero_tv);
- }
- libusb_unlock_events(ctx);
-\endcode
- * ...and the answer is that it is not. This is because the transfer in the
- * code shown above may take a long time (say 30 seconds) to complete, and
- * the lock is not released until the transfer is completed.
- *
- * Another thread with similar code that wants to do event handling may be
- * working with a transfer that completes after a few milliseconds. Despite
- * having such a quick completion time, the other thread cannot check that
- * status of its transfer until the code above has finished (30 seconds later)
- * due to contention on the lock.
- *
- * To solve this, libusbx offers you a mechanism to determine when another
- * thread is handling events. It also offers a mechanism to block your thread
- * until the event handling thread has completed an event (and this mechanism
- * does not involve polling of file descriptors).
- *
- * After determining that another thread is currently handling events, you
- * obtain the <em>event waiters</em> lock using libusb_lock_event_waiters().
- * You then re-check that some other thread is still handling events, and if
- * so, you call libusb_wait_for_event().
- *
- * libusb_wait_for_event() puts your application to sleep until an event
- * occurs, or until a thread releases the events lock. When either of these
- * things happen, your thread is woken up, and should re-check the condition
- * it was waiting on. It should also re-check that another thread is handling
- * events, and if not, it should start handling events itself.
- *
- * This looks like the following, as pseudo-code:
-\code
-retry:
-if (libusb_try_lock_events(ctx) == 0) {
- // we obtained the event lock: do our own event handling
- while (!completed) {
- if (!libusb_event_handling_ok(ctx)) {
- libusb_unlock_events(ctx);
- goto retry;
- }
- poll(libusbx file descriptors, 120*1000);
- if (poll indicates activity)
- libusb_handle_events_locked(ctx, 0);
- }
- libusb_unlock_events(ctx);
-} else {
- // another thread is doing event handling. wait for it to signal us that
- // an event has completed
- libusb_lock_event_waiters(ctx);
-
- while (!completed) {
- // now that we have the event waiters lock, double check that another
- // thread is still handling events for us. (it may have ceased handling
- // events in the time it took us to reach this point)
- if (!libusb_event_handler_active(ctx)) {
- // whoever was handling events is no longer doing so, try again
- libusb_unlock_event_waiters(ctx);
- goto retry;
- }
-
- libusb_wait_for_event(ctx, NULL);
- }
- libusb_unlock_event_waiters(ctx);
-}
-printf("completed!\n");
-\endcode
- *
- * A naive look at the above code may suggest that this can only support
- * one event waiter (hence a total of 2 competing threads, the other doing
- * event handling), because the event waiter seems to have taken the event
- * waiters lock while waiting for an event. However, the system does support
- * multiple event waiters, because libusb_wait_for_event() actually drops
- * the lock while waiting, and reaquires it before continuing.
- *
- * We have now implemented code which can dynamically handle situations where
- * nobody is handling events (so we should do it ourselves), and it can also
- * handle situations where another thread is doing event handling (so we can
- * piggyback onto them). It is also equipped to handle a combination of
- * the two, for example, another thread is doing event handling, but for
- * whatever reason it stops doing so before our condition is met, so we take
- * over the event handling.
- *
- * Four functions were introduced in the above pseudo-code. Their importance
- * should be apparent from the code shown above.
- * -# libusb_try_lock_events() is a non-blocking function which attempts
- * to acquire the events lock but returns a failure code if it is contended.
- * -# libusb_event_handling_ok() checks that libusbx is still happy for your
- * thread to be performing event handling. Sometimes, libusbx needs to
- * interrupt the event handler, and this is how you can check if you have
- * been interrupted. If this function returns 0, the correct behaviour is
- * for you to give up the event handling lock, and then to repeat the cycle.
- * The following libusb_try_lock_events() will fail, so you will become an
- * events waiter. For more information on this, read \ref fullstory below.
- * -# libusb_handle_events_locked() is a variant of
- * libusb_handle_events_timeout() that you can call while holding the
- * events lock. libusb_handle_events_timeout() itself implements similar
- * logic to the above, so be sure not to call it when you are
- * "working behind libusbx's back", as is the case here.
- * -# libusb_event_handler_active() determines if someone is currently
- * holding the events lock
- *
- * You might be wondering why there is no function to wake up all threads
- * blocked on libusb_wait_for_event(). This is because libusbx can do this
- * internally: it will wake up all such threads when someone calls
- * libusb_unlock_events() or when a transfer completes (at the point after its
- * callback has returned).
- *
- * \subsection fullstory The full story
- *
- * The above explanation should be enough to get you going, but if you're
- * really thinking through the issues then you may be left with some more
- * questions regarding libusbx's internals. If you're curious, read on, and if
- * not, skip to the next section to avoid confusing yourself!
- *
- * The immediate question that may spring to mind is: what if one thread
- * modifies the set of file descriptors that need to be polled while another
- * thread is doing event handling?
- *
- * There are 2 situations in which this may happen.
- * -# libusb_open() will add another file descriptor to the poll set,
- * therefore it is desirable to interrupt the event handler so that it
- * restarts, picking up the new descriptor.
- * -# libusb_close() will remove a file descriptor from the poll set. There
- * are all kinds of race conditions that could arise here, so it is
- * important that nobody is doing event handling at this time.
- *
- * libusbx handles these issues internally, so application developers do not
- * have to stop their event handlers while opening/closing devices. Here's how
- * it works, focusing on the libusb_close() situation first:
- *
- * -# During initialization, libusbx opens an internal pipe, and it adds the read
- * end of this pipe to the set of file descriptors to be polled.
- * -# During libusb_close(), libusbx writes some dummy data on this control pipe.
- * This immediately interrupts the event handler. libusbx also records
- * internally that it is trying to interrupt event handlers for this
- * high-priority event.
- * -# At this point, some of the functions described above start behaving
- * differently:
- * - libusb_event_handling_ok() starts returning 1, indicating that it is NOT
- * OK for event handling to continue.
- * - libusb_try_lock_events() starts returning 1, indicating that another
- * thread holds the event handling lock, even if the lock is uncontended.
- * - libusb_event_handler_active() starts returning 1, indicating that
- * another thread is doing event handling, even if that is not true.
- * -# The above changes in behaviour result in the event handler stopping and
- * giving up the events lock very quickly, giving the high-priority
- * libusb_close() operation a "free ride" to acquire the events lock. All
- * threads that are competing to do event handling become event waiters.
- * -# With the events lock held inside libusb_close(), libusbx can safely remove
- * a file descriptor from the poll set, in the safety of knowledge that
- * nobody is polling those descriptors or trying to access the poll set.
- * -# After obtaining the events lock, the close operation completes very
- * quickly (usually a matter of milliseconds) and then immediately releases
- * the events lock.
- * -# At the same time, the behaviour of libusb_event_handling_ok() and friends
- * reverts to the original, documented behaviour.
- * -# The release of the events lock causes the threads that are waiting for
- * events to be woken up and to start competing to become event handlers
- * again. One of them will succeed; it will then re-obtain the list of poll
- * descriptors, and USB I/O will then continue as normal.
- *
- * libusb_open() is similar, and is actually a more simplistic case. Upon a
- * call to libusb_open():
- *
- * -# The device is opened and a file descriptor is added to the poll set.
- * -# libusbx sends some dummy data on the control pipe, and records that it
- * is trying to modify the poll descriptor set.
- * -# The event handler is interrupted, and the same behaviour change as for
- * libusb_close() takes effect, causing all event handling threads to become
- * event waiters.
- * -# The libusb_open() implementation takes its free ride to the events lock.
- * -# Happy that it has successfully paused the events handler, libusb_open()
- * releases the events lock.
- * -# The event waiter threads are all woken up and compete to become event
- * handlers again. The one that succeeds will obtain the list of poll
- * descriptors again, which will include the addition of the new device.
- *
- * \subsection concl Closing remarks
- *
- * The above may seem a little complicated, but hopefully I have made it clear
- * why such complications are necessary. Also, do not forget that this only
- * applies to applications that take libusbx's file descriptors and integrate
- * them into their own polling loops.
- *
- * You may decide that it is OK for your multi-threaded application to ignore
- * some of the rules and locks detailed above, because you don't think that
- * two threads can ever be polling the descriptors at the same time. If that
- * is the case, then that's good news for you because you don't have to worry.
- * But be careful here; remember that the synchronous I/O functions do event
- * handling internally. If you have one thread doing event handling in a loop
- * (without implementing the rules and locking semantics documented above)
- * and another trying to send a synchronous USB transfer, you will end up with
- * two threads monitoring the same descriptors, and the above-described
- * undesirable behaviour occuring. The solution is for your polling thread to
- * play by the rules; the synchronous I/O functions do so, and this will result
- * in them getting along in perfect harmony.
- *
- * If you do have a dedicated thread doing event handling, it is perfectly
- * legal for it to take the event handling lock for long periods of time. Any
- * synchronous I/O functions you call from other threads will transparently
- * fall back to the "event waiters" mechanism detailed above. The only
- * consideration that your event handling thread must apply is the one related
- * to libusb_event_handling_ok(): you must call this before every poll(), and
- * give up the events lock if instructed.
- */
-
-int usbi_io_init(struct libusb_context *ctx)
-{
- int r;
-
- usbi_mutex_init(&ctx->flying_transfers_lock, NULL);
- usbi_mutex_init(&ctx->pollfds_lock, NULL);
- usbi_mutex_init(&ctx->pollfd_modify_lock, NULL);
- usbi_mutex_init_recursive(&ctx->events_lock, NULL);
- usbi_mutex_init(&ctx->event_waiters_lock, NULL);
- usbi_cond_init(&ctx->event_waiters_cond, NULL);
- list_init(&ctx->flying_transfers);
- list_init(&ctx->pollfds);
-
- /* FIXME should use an eventfd on kernels that support it */
- r = usbi_pipe(ctx->ctrl_pipe);
- if (r < 0) {
- r = LIBUSB_ERROR_OTHER;
- goto err;
- }
-
- r = usbi_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN);
- if (r < 0)
- goto err_close_pipe;
-
- /* create hotplug pipe */
- r = usbi_pipe(ctx->hotplug_pipe);
- if (r < 0) {
- r = LIBUSB_ERROR_OTHER;
- goto err;
- }
-
- r = usbi_add_pollfd(ctx, ctx->hotplug_pipe[0], POLLIN);
- if (r < 0)
- goto err_close_hp_pipe;
-
-#ifdef USBI_TIMERFD_AVAILABLE
- ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),
- TFD_NONBLOCK);
- if (ctx->timerfd >= 0) {
- usbi_dbg("using timerfd for timeouts");
- r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);
- if (r < 0) {
- usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);
- close(ctx->timerfd);
- goto err_close_hp_pipe;
- }
- } else {
- usbi_dbg("timerfd not available (code %d error %d)", ctx->timerfd, errno);
- ctx->timerfd = -1;
- }
-#endif
-
- return 0;
-
-err_close_hp_pipe:
- usbi_close(ctx->hotplug_pipe[0]);
- usbi_close(ctx->hotplug_pipe[1]);
-err_close_pipe:
- usbi_close(ctx->ctrl_pipe[0]);
- usbi_close(ctx->ctrl_pipe[1]);
-err:
- usbi_mutex_destroy(&ctx->flying_transfers_lock);
- usbi_mutex_destroy(&ctx->pollfds_lock);
- usbi_mutex_destroy(&ctx->pollfd_modify_lock);
- usbi_mutex_destroy(&ctx->events_lock);
- usbi_mutex_destroy(&ctx->event_waiters_lock);
- usbi_cond_destroy(&ctx->event_waiters_cond);
- return r;
-}
-
-void usbi_io_exit(struct libusb_context *ctx)
-{
- usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);
- usbi_close(ctx->ctrl_pipe[0]);
- usbi_close(ctx->ctrl_pipe[1]);
- usbi_remove_pollfd(ctx, ctx->hotplug_pipe[0]);
- usbi_close(ctx->hotplug_pipe[0]);
- usbi_close(ctx->hotplug_pipe[1]);
-#ifdef USBI_TIMERFD_AVAILABLE
- if (usbi_using_timerfd(ctx)) {
- usbi_remove_pollfd(ctx, ctx->timerfd);
- close(ctx->timerfd);
- }
-#endif
- usbi_mutex_destroy(&ctx->flying_transfers_lock);
- usbi_mutex_destroy(&ctx->pollfds_lock);
- usbi_mutex_destroy(&ctx->pollfd_modify_lock);
- usbi_mutex_destroy(&ctx->events_lock);
- usbi_mutex_destroy(&ctx->event_waiters_lock);
- usbi_cond_destroy(&ctx->event_waiters_cond);
-}
-
-static int calculate_timeout(struct usbi_transfer *transfer)
-{
- int r;
- struct timespec current_time;
- unsigned int timeout =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;
-
- if (!timeout)
- return 0;
-
- r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &current_time);
- if (r < 0) {
- usbi_err(ITRANSFER_CTX(transfer),
- "failed to read monotonic clock, errno=%d", errno);
- return r;
- }
-
- current_time.tv_sec += timeout / 1000;
- current_time.tv_nsec += (timeout % 1000) * 1000000;
-
- while (current_time.tv_nsec >= 1000000000) {
- current_time.tv_nsec -= 1000000000;
- current_time.tv_sec++;
- }
-
- TIMESPEC_TO_TIMEVAL(&transfer->timeout, &current_time);
- return 0;
-}
-
-/* add a transfer to the (timeout-sorted) active transfers list.
- * Callers of this function must hold the flying_transfers_lock.
- * This function *always* adds the transfer to the flying_transfers list,
- * it will return non 0 if it fails to update the timer, but even then the
- * transfer is added to the flying_transfers list. */
-static int add_to_flying_list(struct usbi_transfer *transfer)
-{
- struct usbi_transfer *cur;
- struct timeval *timeout = &transfer->timeout;
- struct libusb_context *ctx = ITRANSFER_CTX(transfer);
- int r = 0;
- int first = 1;
-
- /* if we have no other flying transfers, start the list with this one */
- if (list_empty(&ctx->flying_transfers)) {
- list_add(&transfer->list, &ctx->flying_transfers);
- goto out;
- }
-
- /* if we have infinite timeout, append to end of list */
- if (!timerisset(timeout)) {
- list_add_tail(&transfer->list, &ctx->flying_transfers);
- /* first is irrelevant in this case */
- goto out;
- }
-
- /* otherwise, find appropriate place in list */
- list_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) {
- /* find first timeout that occurs after the transfer in question */
- struct timeval *cur_tv = &cur->timeout;
-
- if (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) ||
- (cur_tv->tv_sec == timeout->tv_sec &&
- cur_tv->tv_usec > timeout->tv_usec)) {
- list_add_tail(&transfer->list, &cur->list);
- goto out;
- }
- first = 0;
- }
- /* first is 0 at this stage (list not empty) */
-
- /* otherwise we need to be inserted at the end */
- list_add_tail(&transfer->list, &ctx->flying_transfers);
-out:
-#ifdef USBI_TIMERFD_AVAILABLE
- if (first && usbi_using_timerfd(ctx) && timerisset(timeout)) {
- /* if this transfer has the lowest timeout of all active transfers,
- * rearm the timerfd with this transfer's timeout */
- const struct itimerspec it = { {0, 0},
- { timeout->tv_sec, timeout->tv_usec * 1000 } };
- usbi_dbg("arm timerfd for timeout in %dms (first in line)",
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);
- r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);
- if (r < 0) {
- usbi_warn(ctx, "failed to arm first timerfd (errno %d)", errno);
- r = LIBUSB_ERROR_OTHER;
- }
- }
-#else
- UNUSED(first);
-#endif
-
- return r;
-}
-
-/** \ingroup asyncio
- * Allocate a libusbx transfer with a specified number of isochronous packet
- * descriptors. The returned transfer is pre-initialized for you. When the new
- * transfer is no longer needed, it should be freed with
- * libusb_free_transfer().
- *
- * Transfers intended for non-isochronous endpoints (e.g. control, bulk,
- * interrupt) should specify an iso_packets count of zero.
- *
- * For transfers intended for isochronous endpoints, specify an appropriate
- * number of packet descriptors to be allocated as part of the transfer.
- * The returned transfer is not specially initialized for isochronous I/O;
- * you are still required to set the
- * \ref libusb_transfer::num_iso_packets "num_iso_packets" and
- * \ref libusb_transfer::type "type" fields accordingly.
- *
- * It is safe to allocate a transfer with some isochronous packets and then
- * use it on a non-isochronous endpoint. If you do this, ensure that at time
- * of submission, num_iso_packets is 0 and that type is set appropriately.
- *
- * \param iso_packets number of isochronous packet descriptors to allocate
- * \returns a newly allocated transfer, or NULL on error
- */
-DEFAULT_VISIBILITY
-struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(
- int iso_packets)
-{
- size_t os_alloc_size = usbi_backend->transfer_priv_size
- + (usbi_backend->add_iso_packet_size * iso_packets);
- size_t alloc_size = sizeof(struct usbi_transfer)
- + sizeof(struct libusb_transfer)
- + (sizeof(struct libusb_iso_packet_descriptor) * iso_packets)
- + os_alloc_size;
- struct usbi_transfer *itransfer = calloc(1, alloc_size);
- if (!itransfer)
- return NULL;
-
- itransfer->num_iso_packets = iso_packets;
- usbi_mutex_init(&itransfer->lock, NULL);
- return USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-}
-
-/** \ingroup asyncio
- * Free a transfer structure. This should be called for all transfers
- * allocated with libusb_alloc_transfer().
- *
- * If the \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER
- * "LIBUSB_TRANSFER_FREE_BUFFER" flag is set and the transfer buffer is
- * non-NULL, this function will also free the transfer buffer using the
- * standard system memory allocator (e.g. free()).
- *
- * It is legal to call this function with a NULL transfer. In this case,
- * the function will simply return safely.
- *
- * It is not legal to free an active transfer (one which has been submitted
- * and has not yet completed).
- *
- * \param transfer the transfer to free
- */
-void API_EXPORTED libusb_free_transfer(struct libusb_transfer *transfer)
-{
- struct usbi_transfer *itransfer;
- if (!transfer)
- return;
-
- if (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer)
- free(transfer->buffer);
-
- itransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
- usbi_mutex_destroy(&itransfer->lock);
- free(itransfer);
-}
-
-#ifdef USBI_TIMERFD_AVAILABLE
-static int disarm_timerfd(struct libusb_context *ctx)
-{
- const struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } };
- int r;
-
- usbi_dbg("");
- r = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL);
- if (r < 0)
- return LIBUSB_ERROR_OTHER;
- else
- return 0;
-}
-
-/* iterates through the flying transfers, and rearms the timerfd based on the
- * next upcoming timeout.
- * must be called with flying_list locked.
- * returns 0 if there was no timeout to arm, 1 if the next timeout was armed,
- * or a LIBUSB_ERROR code on failure.
- */
-static int arm_timerfd_for_next_timeout(struct libusb_context *ctx)
-{
- struct usbi_transfer *transfer;
-
- list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {
- struct timeval *cur_tv = &transfer->timeout;
-
- /* if we've reached transfers of infinite timeout, then we have no
- * arming to do */
- if (!timerisset(cur_tv))
- goto disarm;
-
- /* act on first transfer that is not already cancelled */
- if (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {
- int r;
- const struct itimerspec it = { {0, 0},
- { cur_tv->tv_sec, cur_tv->tv_usec * 1000 } };
- usbi_dbg("next timeout originally %dms", USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);
- r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);
- if (r < 0)
- return LIBUSB_ERROR_OTHER;
- return 1;
- }
- }
-
-disarm:
- return disarm_timerfd(ctx);
-}
-#else
-static int arm_timerfd_for_next_timeout(struct libusb_context *ctx)
-{
- (void)ctx;
- return 0;
-}
-#endif
-
-/** \ingroup asyncio
- * Submit a transfer. This function will fire off the USB transfer and then
- * return immediately.
- *
- * \param transfer the transfer to submit
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns LIBUSB_ERROR_BUSY if the transfer has already been submitted.
- * \returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported
- * by the operating system.
- * \returns another LIBUSB_ERROR code on other failure
- */
-int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer)
-{
- struct libusb_context *ctx = TRANSFER_CTX(transfer);
- struct usbi_transfer *itransfer =
- LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
- int r;
- int updated_fds;
-
- usbi_mutex_lock(&itransfer->lock);
- itransfer->transferred = 0;
- itransfer->flags = 0;
- r = calculate_timeout(itransfer);
- if (r < 0) {
- r = LIBUSB_ERROR_OTHER;
- goto out;
- }
-
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- r = add_to_flying_list(itransfer);
- if (r == LIBUSB_SUCCESS) {
- r = usbi_backend->submit_transfer(itransfer);
- }
- if (r != LIBUSB_SUCCESS) {
- list_del(&itransfer->list);
- arm_timerfd_for_next_timeout(ctx);
- }
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
-
-out:
- updated_fds = (itransfer->flags & USBI_TRANSFER_UPDATED_FDS);
- usbi_mutex_unlock(&itransfer->lock);
- if (updated_fds)
- usbi_fd_notification(ctx);
- return r;
-}
-
-/** \ingroup asyncio
- * Asynchronously cancel a previously submitted transfer.
- * This function returns immediately, but this does not indicate cancellation
- * is complete. Your callback function will be invoked at some later time
- * with a transfer status of
- * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED
- * "LIBUSB_TRANSFER_CANCELLED."
- *
- * \param transfer the transfer to cancel
- * \returns 0 on success
- * \returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or
- * cancelled.
- * \returns a LIBUSB_ERROR code on failure
- */
-int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer)
-{
- struct usbi_transfer *itransfer =
- LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
- int r;
-
- usbi_dbg("");
- usbi_mutex_lock(&itransfer->lock);
- r = usbi_backend->cancel_transfer(itransfer);
- if (r < 0) {
- if (r != LIBUSB_ERROR_NOT_FOUND &&
- r != LIBUSB_ERROR_NO_DEVICE)
- usbi_err(TRANSFER_CTX(transfer),
- "cancel transfer failed error %d", r);
- else
- usbi_dbg("cancel transfer failed error %d", r);
-
- if (r == LIBUSB_ERROR_NO_DEVICE)
- itransfer->flags |= USBI_TRANSFER_DEVICE_DISAPPEARED;
- }
-
- itransfer->flags |= USBI_TRANSFER_CANCELLING;
-
- usbi_mutex_unlock(&itransfer->lock);
- return r;
-}
-
-/* Handle completion of a transfer (completion might be an error condition).
- * This will invoke the user-supplied callback function, which may end up
- * freeing the transfer. Therefore you cannot use the transfer structure
- * after calling this function, and you should free all backend-specific
- * data before calling it.
- * Do not call this function with the usbi_transfer lock held. User-specified
- * callback functions may attempt to directly resubmit the transfer, which
- * will attempt to take the lock. */
-int usbi_handle_transfer_completion(struct usbi_transfer *itransfer,
- enum libusb_transfer_status status)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = TRANSFER_CTX(transfer);
- uint8_t flags;
- int r = 0;
-
- /* FIXME: could be more intelligent with the timerfd here. we don't need
- * to disarm the timerfd if there was no timer running, and we only need
- * to rearm the timerfd if the transfer that expired was the one with
- * the shortest timeout. */
-
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- list_del(&itransfer->list);
- if (usbi_using_timerfd(ctx))
- r = arm_timerfd_for_next_timeout(ctx);
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
- if (usbi_using_timerfd(ctx) && (r < 0))
- return r;
-
- if (status == LIBUSB_TRANSFER_COMPLETED
- && transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) {
- int rqlen = transfer->length;
- if (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL)
- rqlen -= LIBUSB_CONTROL_SETUP_SIZE;
- if (rqlen != itransfer->transferred) {
- usbi_dbg("interpreting short transfer as error");
- status = LIBUSB_TRANSFER_ERROR;
- }
- }
-
- flags = transfer->flags;
- transfer->status = status;
- transfer->actual_length = itransfer->transferred;
- usbi_dbg("transfer %p has callback %p", transfer, transfer->callback);
- if (transfer->callback)
- transfer->callback(transfer);
- /* transfer might have been freed by the above call, do not use from
- * this point. */
- if (flags & LIBUSB_TRANSFER_FREE_TRANSFER)
- libusb_free_transfer(transfer);
- usbi_mutex_lock(&ctx->event_waiters_lock);
- usbi_cond_broadcast(&ctx->event_waiters_cond);
- usbi_mutex_unlock(&ctx->event_waiters_lock);
- return 0;
-}
-
-/* Similar to usbi_handle_transfer_completion() but exclusively for transfers
- * that were asynchronously cancelled. The same concerns w.r.t. freeing of
- * transfers exist here.
- * Do not call this function with the usbi_transfer lock held. User-specified
- * callback functions may attempt to directly resubmit the transfer, which
- * will attempt to take the lock. */
-int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer)
-{
- /* if the URB was cancelled due to timeout, report timeout to the user */
- if (transfer->flags & USBI_TRANSFER_TIMED_OUT) {
- usbi_dbg("detected timeout cancellation");
- return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT);
- }
-
- /* otherwise its a normal async cancel */
- return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED);
-}
-
-/** \ingroup poll
- * Attempt to acquire the event handling lock. This lock is used to ensure that
- * only one thread is monitoring libusbx event sources at any one time.
- *
- * You only need to use this lock if you are developing an application
- * which calls poll() or select() on libusbx's file descriptors directly.
- * If you stick to libusbx's event handling loop functions (e.g.
- * libusb_handle_events()) then you do not need to be concerned with this
- * locking.
- *
- * While holding this lock, you are trusted to actually be handling events.
- * If you are no longer handling events, you must call libusb_unlock_events()
- * as soon as possible.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns 0 if the lock was obtained successfully
- * \returns 1 if the lock was not obtained (i.e. another thread holds the lock)
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_try_lock_events(libusb_context *ctx)
-{
- int r;
- unsigned int ru;
- USBI_GET_CONTEXT(ctx);
-
- /* is someone else waiting to modify poll fds? if so, don't let this thread
- * start event handling */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- ru = ctx->pollfd_modify;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
- if (ru) {
- usbi_dbg("someone else is modifying poll fds");
- return 1;
- }
-
- r = usbi_mutex_trylock(&ctx->events_lock);
- if (r)
- return 1;
-
- ctx->event_handler_active = 1;
- return 0;
-}
-
-/** \ingroup poll
- * Acquire the event handling lock, blocking until successful acquisition if
- * it is contended. This lock is used to ensure that only one thread is
- * monitoring libusbx event sources at any one time.
- *
- * You only need to use this lock if you are developing an application
- * which calls poll() or select() on libusbx's file descriptors directly.
- * If you stick to libusbx's event handling loop functions (e.g.
- * libusb_handle_events()) then you do not need to be concerned with this
- * locking.
- *
- * While holding this lock, you are trusted to actually be handling events.
- * If you are no longer handling events, you must call libusb_unlock_events()
- * as soon as possible.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \see \ref mtasync
- */
-void API_EXPORTED libusb_lock_events(libusb_context *ctx)
-{
- USBI_GET_CONTEXT(ctx);
- usbi_mutex_lock(&ctx->events_lock);
- ctx->event_handler_active = 1;
-}
-
-/** \ingroup poll
- * Release the lock previously acquired with libusb_try_lock_events() or
- * libusb_lock_events(). Releasing this lock will wake up any threads blocked
- * on libusb_wait_for_event().
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \see \ref mtasync
- */
-void API_EXPORTED libusb_unlock_events(libusb_context *ctx)
-{
- USBI_GET_CONTEXT(ctx);
- ctx->event_handler_active = 0;
- usbi_mutex_unlock(&ctx->events_lock);
-
- /* FIXME: perhaps we should be a bit more efficient by not broadcasting
- * the availability of the events lock when we are modifying pollfds
- * (check ctx->pollfd_modify)? */
- usbi_mutex_lock(&ctx->event_waiters_lock);
- usbi_cond_broadcast(&ctx->event_waiters_cond);
- usbi_mutex_unlock(&ctx->event_waiters_lock);
-}
-
-/** \ingroup poll
- * Determine if it is still OK for this thread to be doing event handling.
- *
- * Sometimes, libusbx needs to temporarily pause all event handlers, and this
- * is the function you should use before polling file descriptors to see if
- * this is the case.
- *
- * If this function instructs your thread to give up the events lock, you
- * should just continue the usual logic that is documented in \ref mtasync.
- * On the next iteration, your thread will fail to obtain the events lock,
- * and will hence become an event waiter.
- *
- * This function should be called while the events lock is held: you don't
- * need to worry about the results of this function if your thread is not
- * the current event handler.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns 1 if event handling can start or continue
- * \returns 0 if this thread must give up the events lock
- * \see \ref fullstory "Multi-threaded I/O: the full story"
- */
-int API_EXPORTED libusb_event_handling_ok(libusb_context *ctx)
-{
- unsigned int r;
- USBI_GET_CONTEXT(ctx);
-
- /* is someone else waiting to modify poll fds? if so, don't let this thread
- * continue event handling */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- r = ctx->pollfd_modify;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
- if (r) {
- usbi_dbg("someone else is modifying poll fds");
- return 0;
- }
-
- return 1;
-}
-
-
-/** \ingroup poll
- * Determine if an active thread is handling events (i.e. if anyone is holding
- * the event handling lock).
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns 1 if a thread is handling events
- * \returns 0 if there are no threads currently handling events
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_event_handler_active(libusb_context *ctx)
-{
- unsigned int r;
- USBI_GET_CONTEXT(ctx);
-
- /* is someone else waiting to modify poll fds? if so, don't let this thread
- * start event handling -- indicate that event handling is happening */
- usbi_mutex_lock(&ctx->pollfd_modify_lock);
- r = ctx->pollfd_modify;
- usbi_mutex_unlock(&ctx->pollfd_modify_lock);
- if (r) {
- usbi_dbg("someone else is modifying poll fds");
- return 1;
- }
-
- return ctx->event_handler_active;
-}
-
-/** \ingroup poll
- * Acquire the event waiters lock. This lock is designed to be obtained under
- * the situation where you want to be aware when events are completed, but
- * some other thread is event handling so calling libusb_handle_events() is not
- * allowed.
- *
- * You then obtain this lock, re-check that another thread is still handling
- * events, then call libusb_wait_for_event().
- *
- * You only need to use this lock if you are developing an application
- * which calls poll() or select() on libusbx's file descriptors directly,
- * <b>and</b> may potentially be handling events from 2 threads simultaenously.
- * If you stick to libusbx's event handling loop functions (e.g.
- * libusb_handle_events()) then you do not need to be concerned with this
- * locking.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \see \ref mtasync
- */
-void API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx)
-{
- USBI_GET_CONTEXT(ctx);
- usbi_mutex_lock(&ctx->event_waiters_lock);
-}
-
-/** \ingroup poll
- * Release the event waiters lock.
- * \param ctx the context to operate on, or NULL for the default context
- * \see \ref mtasync
- */
-void API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx)
-{
- USBI_GET_CONTEXT(ctx);
- usbi_mutex_unlock(&ctx->event_waiters_lock);
-}
-
-/** \ingroup poll
- * Wait for another thread to signal completion of an event. Must be called
- * with the event waiters lock held, see libusb_lock_event_waiters().
- *
- * This function will block until any of the following conditions are met:
- * -# The timeout expires
- * -# A transfer completes
- * -# A thread releases the event handling lock through libusb_unlock_events()
- *
- * Condition 1 is obvious. Condition 2 unblocks your thread <em>after</em>
- * the callback for the transfer has completed. Condition 3 is important
- * because it means that the thread that was previously handling events is no
- * longer doing so, so if any events are to complete, another thread needs to
- * step up and start event handling.
- *
- * This function releases the event waiters lock before putting your thread
- * to sleep, and reacquires the lock as it is being woken up.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param tv maximum timeout for this blocking function. A NULL value
- * indicates unlimited timeout.
- * \returns 0 after a transfer completes or another thread stops event handling
- * \returns 1 if the timeout expired
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
-{
- struct timespec timeout;
- int r;
-
- USBI_GET_CONTEXT(ctx);
- if (tv == NULL) {
- usbi_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock);
- return 0;
- }
-
- r = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout);
- if (r < 0) {
- usbi_err(ctx, "failed to read realtime clock, error %d", errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- timeout.tv_sec += tv->tv_sec;
- timeout.tv_nsec += tv->tv_usec * 1000;
- while (timeout.tv_nsec >= 1000000000) {
- timeout.tv_nsec -= 1000000000;
- timeout.tv_sec++;
- }
-
- r = usbi_cond_timedwait(&ctx->event_waiters_cond,
- &ctx->event_waiters_lock, &timeout);
- return (r == ETIMEDOUT);
-}
-
-static void handle_timeout(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- int r;
-
- itransfer->flags |= USBI_TRANSFER_TIMED_OUT;
- r = libusb_cancel_transfer(transfer);
- if (r < 0)
- usbi_warn(TRANSFER_CTX(transfer),
- "async cancel failed %d errno=%d", r, errno);
-}
-
-static int handle_timeouts_locked(struct libusb_context *ctx)
-{
- int r;
- struct timespec systime_ts;
- struct timeval systime;
- struct usbi_transfer *transfer;
-
- if (list_empty(&ctx->flying_transfers))
- return 0;
-
- /* get current time */
- r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &systime_ts);
- if (r < 0)
- return r;
-
- TIMESPEC_TO_TIMEVAL(&systime, &systime_ts);
-
- /* iterate through flying transfers list, finding all transfers that
- * have expired timeouts */
- list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {
- struct timeval *cur_tv = &transfer->timeout;
-
- /* if we've reached transfers of infinite timeout, we're all done */
- if (!timerisset(cur_tv))
- return 0;
-
- /* ignore timeouts we've already handled */
- if (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))
- continue;
-
- /* if transfer has non-expired timeout, nothing more to do */
- if ((cur_tv->tv_sec > systime.tv_sec) ||
- (cur_tv->tv_sec == systime.tv_sec &&
- cur_tv->tv_usec > systime.tv_usec))
- return 0;
-
- /* otherwise, we've got an expired timeout to handle */
- handle_timeout(transfer);
- }
- return 0;
-}
-
-static int handle_timeouts(struct libusb_context *ctx)
-{
- int r;
- USBI_GET_CONTEXT(ctx);
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- r = handle_timeouts_locked(ctx);
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
- return r;
-}
-
-#ifdef USBI_TIMERFD_AVAILABLE
-static int handle_timerfd_trigger(struct libusb_context *ctx)
-{
- int r;
-
- usbi_mutex_lock(&ctx->flying_transfers_lock);
-
- /* process the timeout that just happened */
- r = handle_timeouts_locked(ctx);
- if (r < 0)
- goto out;
-
- /* arm for next timeout*/
- r = arm_timerfd_for_next_timeout(ctx);
-
-out:
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
- return r;
-}
-#endif
-
-/* do the actual event handling. assumes that no other thread is concurrently
- * doing the same thing. */
-static int handle_events(struct libusb_context *ctx, struct timeval *tv)
-{
- int r;
- struct usbi_pollfd *ipollfd;
- POLL_NFDS_TYPE nfds = 0;
- struct pollfd *fds = NULL;
- int i = -1;
- int timeout_ms;
-
- usbi_mutex_lock(&ctx->pollfds_lock);
- list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)
- nfds++;
-
- /* TODO: malloc when number of fd's changes, not on every poll */
- if (nfds != 0)
- fds = malloc(sizeof(*fds) * nfds);
- if (!fds) {
- usbi_mutex_unlock(&ctx->pollfds_lock);
- return LIBUSB_ERROR_NO_MEM;
- }
-
- list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) {
- struct libusb_pollfd *pollfd = &ipollfd->pollfd;
- int fd = pollfd->fd;
- i++;
- fds[i].fd = fd;
- fds[i].events = pollfd->events;
- fds[i].revents = 0;
- }
- usbi_mutex_unlock(&ctx->pollfds_lock);
-
- timeout_ms = (int)(tv->tv_sec * 1000) + (tv->tv_usec / 1000);
-
- /* round up to next millisecond */
- if (tv->tv_usec % 1000)
- timeout_ms++;
-
- usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms);
- r = usbi_poll(fds, nfds, timeout_ms);
- usbi_dbg("poll() returned %d", r);
- if (r == 0) {
- free(fds);
- return handle_timeouts(ctx);
- } else if (r == -1 && errno == EINTR) {
- free(fds);
- return LIBUSB_ERROR_INTERRUPTED;
- } else if (r < 0) {
- free(fds);
- usbi_err(ctx, "poll failed %d err=%d\n", r, errno);
- return LIBUSB_ERROR_IO;
- }
-
- /* fd[0] is always the ctrl pipe */
- if (fds[0].revents) {
- /* another thread wanted to interrupt event handling, and it succeeded!
- * handle any other events that cropped up at the same time, and
- * simply return */
- usbi_dbg("caught a fish on the control pipe");
-
- if (r == 1) {
- r = 0;
- goto handled;
- } else {
- /* prevent OS backend from trying to handle events on ctrl pipe */
- fds[0].revents = 0;
- r--;
- }
- }
-
- /* fd[1] is always the hotplug pipe */
- if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && fds[1].revents) {
- libusb_hotplug_message message;
- ssize_t ret;
-
- usbi_dbg("caught a fish on the hotplug pipe");
-
- /* read the message from the hotplug thread */
- ret = usbi_read(ctx->hotplug_pipe[0], &message, sizeof (message));
- if (ret < sizeof(message)) {
- usbi_err(ctx, "hotplug pipe read error %d < %d",
- ret, sizeof(message));
- r = LIBUSB_ERROR_OTHER;
- goto handled;
- }
-
- usbi_hotplug_match(ctx, message.device, message.event);
-
- /* the device left. dereference the device */
- if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == message.event)
- libusb_unref_device(message.device);
-
- fds[1].revents = 0;
- if (1 == r--)
- goto handled;
- } /* else there shouldn't be anything on this pipe */
-
-#ifdef USBI_TIMERFD_AVAILABLE
- /* on timerfd configurations, fds[2] is the timerfd */
- if (usbi_using_timerfd(ctx) && fds[2].revents) {
- /* timerfd indicates that a timeout has expired */
- int ret;
- usbi_dbg("timerfd triggered");
-
- ret = handle_timerfd_trigger(ctx);
- if (ret < 0) {
- /* return error code */
- r = ret;
- goto handled;
- } else if (r == 1) {
- /* no more active file descriptors, nothing more to do */
- r = 0;
- goto handled;
- } else {
- /* more events pending...
- * prevent OS backend from trying to handle events on timerfd */
- fds[2].revents = 0;
- r--;
- }
- }
-#endif
-
- r = usbi_backend->handle_events(ctx, fds, nfds, r);
- if (r)
- usbi_err(ctx, "backend handle_events failed with error %d", r);
-
-handled:
- free(fds);
- return r;
-}
-
-/* returns the smallest of:
- * 1. timeout of next URB
- * 2. user-supplied timeout
- * returns 1 if there is an already-expired timeout, otherwise returns 0
- * and populates out
- */
-static int get_next_timeout(libusb_context *ctx, struct timeval *tv,
- struct timeval *out)
-{
- struct timeval timeout;
- int r = libusb_get_next_timeout(ctx, &timeout);
- if (r) {
- /* timeout already expired? */
- if (!timerisset(&timeout))
- return 1;
-
- /* choose the smallest of next URB timeout or user specified timeout */
- if (timercmp(&timeout, tv, <))
- *out = timeout;
- else
- *out = *tv;
- } else {
- *out = *tv;
- }
- return 0;
-}
-
-/** \ingroup poll
- * Handle any pending events.
- *
- * libusbx determines "pending events" by checking if any timeouts have expired
- * and by checking the set of file descriptors for activity.
- *
- * If a zero timeval is passed, this function will handle any already-pending
- * events and then immediately return in non-blocking style.
- *
- * If a non-zero timeval is passed and no events are currently pending, this
- * function will block waiting for events to handle up until the specified
- * timeout. If an event arrives or a signal is raised, this function will
- * return early.
- *
- * If the parameter completed is not NULL then <em>after obtaining the event
- * handling lock</em> this function will return immediately if the integer
- * pointed to is not 0. This allows for race free waiting for the completion
- * of a specific transfer.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param tv the maximum time to block waiting for events, or an all zero
- * timeval struct for non-blocking mode
- * \param completed pointer to completion integer to check, or NULL
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx,
- struct timeval *tv, int *completed)
-{
- int r;
- struct timeval poll_timeout;
-
- USBI_GET_CONTEXT(ctx);
- r = get_next_timeout(ctx, tv, &poll_timeout);
- if (r) {
- /* timeout already expired */
- return handle_timeouts(ctx);
- }
-
-retry:
- if (libusb_try_lock_events(ctx) == 0) {
- if (completed == NULL || !*completed) {
- /* we obtained the event lock: do our own event handling */
- usbi_dbg("doing our own event handling");
- r = handle_events(ctx, &poll_timeout);
- }
- libusb_unlock_events(ctx);
- return r;
- }
-
- /* another thread is doing event handling. wait for thread events that
- * notify event completion. */
- libusb_lock_event_waiters(ctx);
-
- if (completed && *completed)
- goto already_done;
-
- if (!libusb_event_handler_active(ctx)) {
- /* we hit a race: whoever was event handling earlier finished in the
- * time it took us to reach this point. try the cycle again. */
- libusb_unlock_event_waiters(ctx);
- usbi_dbg("event handler was active but went away, retrying");
- goto retry;
- }
-
- usbi_dbg("another thread is doing event handling");
- r = libusb_wait_for_event(ctx, &poll_timeout);
-
-already_done:
- libusb_unlock_event_waiters(ctx);
-
- if (r < 0)
- return r;
- else if (r == 1)
- return handle_timeouts(ctx);
- else
- return 0;
-}
-
-/** \ingroup poll
- * Handle any pending events
- *
- * Like libusb_handle_events_timeout_completed(), but without the completed
- * parameter, calling this function is equivalent to calling
- * libusb_handle_events_timeout_completed() with a NULL completed parameter.
- *
- * This function is kept primarily for backwards compatibility.
- * All new code should call libusb_handle_events_completed() or
- * libusb_handle_events_timeout_completed() to avoid race conditions.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param tv the maximum time to block waiting for events, or an all zero
- * timeval struct for non-blocking mode
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- */
-int API_EXPORTED libusb_handle_events_timeout(libusb_context *ctx,
- struct timeval *tv)
-{
- return libusb_handle_events_timeout_completed(ctx, tv, NULL);
-}
-
-/** \ingroup poll
- * Handle any pending events in blocking mode. There is currently a timeout
- * hardcoded at 60 seconds but we plan to make it unlimited in future. For
- * finer control over whether this function is blocking or non-blocking, or
- * for control over the timeout, use libusb_handle_events_timeout_completed()
- * instead.
- *
- * This function is kept primarily for backwards compatibility.
- * All new code should call libusb_handle_events_completed() or
- * libusb_handle_events_timeout_completed() to avoid race conditions.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- */
-int API_EXPORTED libusb_handle_events(libusb_context *ctx)
-{
- struct timeval tv;
- tv.tv_sec = 60;
- tv.tv_usec = 0;
- return libusb_handle_events_timeout_completed(ctx, &tv, NULL);
-}
-
-/** \ingroup poll
- * Handle any pending events in blocking mode.
- *
- * Like libusb_handle_events(), with the addition of a completed parameter
- * to allow for race free waiting for the completion of a specific transfer.
- *
- * See libusb_handle_events_timeout_completed() for details on the completed
- * parameter.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param completed pointer to completion integer to check, or NULL
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_handle_events_completed(libusb_context *ctx,
- int *completed)
-{
- struct timeval tv;
- tv.tv_sec = 60;
- tv.tv_usec = 0;
- return libusb_handle_events_timeout_completed(ctx, &tv, completed);
-}
-
-/** \ingroup poll
- * Handle any pending events by polling file descriptors, without checking if
- * any other threads are already doing so. Must be called with the event lock
- * held, see libusb_lock_events().
- *
- * This function is designed to be called under the situation where you have
- * taken the event lock and are calling poll()/select() directly on libusbx's
- * file descriptors (as opposed to using libusb_handle_events() or similar).
- * You detect events on libusbx's descriptors, so you then call this function
- * with a zero timeout value (while still holding the event lock).
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param tv the maximum time to block waiting for events, or zero for
- * non-blocking mode
- * \returns 0 on success, or a LIBUSB_ERROR code on failure
- * \see \ref mtasync
- */
-int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx,
- struct timeval *tv)
-{
- int r;
- struct timeval poll_timeout;
-
- USBI_GET_CONTEXT(ctx);
- r = get_next_timeout(ctx, tv, &poll_timeout);
- if (r) {
- /* timeout already expired */
- return handle_timeouts(ctx);
- }
-
- return handle_events(ctx, &poll_timeout);
-}
-
-/** \ingroup poll
- * Determines whether your application must apply special timing considerations
- * when monitoring libusbx's file descriptors.
- *
- * This function is only useful for applications which retrieve and poll
- * libusbx's file descriptors in their own main loop (\ref pollmain).
- *
- * Ordinarily, libusbx's event handler needs to be called into at specific
- * moments in time (in addition to times when there is activity on the file
- * descriptor set). The usual approach is to use libusb_get_next_timeout()
- * to learn about when the next timeout occurs, and to adjust your
- * poll()/select() timeout accordingly so that you can make a call into the
- * library at that time.
- *
- * Some platforms supported by libusbx do not come with this baggage - any
- * events relevant to timing will be represented by activity on the file
- * descriptor set, and libusb_get_next_timeout() will always return 0.
- * This function allows you to detect whether you are running on such a
- * platform.
- *
- * Since v1.0.5.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns 0 if you must call into libusbx at times determined by
- * libusb_get_next_timeout(), or 1 if all timeout events are handled internally
- * or through regular activity on the file descriptors.
- * \see \ref pollmain "Polling libusbx file descriptors for event handling"
- */
-int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx)
-{
-#if defined(USBI_TIMERFD_AVAILABLE)
- USBI_GET_CONTEXT(ctx);
- return usbi_using_timerfd(ctx);
-#else
- (void)ctx;
- return 0;
-#endif
-}
-
-/** \ingroup poll
- * Determine the next internal timeout that libusbx needs to handle. You only
- * need to use this function if you are calling poll() or select() or similar
- * on libusbx's file descriptors yourself - you do not need to use it if you
- * are calling libusb_handle_events() or a variant directly.
- *
- * You should call this function in your main loop in order to determine how
- * long to wait for select() or poll() to return results. libusbx needs to be
- * called into at this timeout, so you should use it as an upper bound on
- * your select() or poll() call.
- *
- * When the timeout has expired, call into libusb_handle_events_timeout()
- * (perhaps in non-blocking mode) so that libusbx can handle the timeout.
- *
- * This function may return 1 (success) and an all-zero timeval. If this is
- * the case, it indicates that libusbx has a timeout that has already expired
- * so you should call libusb_handle_events_timeout() or similar immediately.
- * A return code of 0 indicates that there are no pending timeouts.
- *
- * On some platforms, this function will always returns 0 (no pending
- * timeouts). See \ref polltime.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param tv output location for a relative time against the current
- * clock in which libusbx must be called into in order to process timeout events
- * \returns 0 if there are no pending timeouts, 1 if a timeout was returned,
- * or LIBUSB_ERROR_OTHER on failure
- */
-int API_EXPORTED libusb_get_next_timeout(libusb_context *ctx,
- struct timeval *tv)
-{
- struct usbi_transfer *transfer;
- struct timespec cur_ts;
- struct timeval cur_tv;
- struct timeval *next_timeout;
- int r;
- int found = 0;
-
- USBI_GET_CONTEXT(ctx);
- if (usbi_using_timerfd(ctx))
- return 0;
-
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- if (list_empty(&ctx->flying_transfers)) {
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
- usbi_dbg("no URBs, no timeout!");
- return 0;
- }
-
- /* find next transfer which hasn't already been processed as timed out */
- list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {
- if (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))
- continue;
-
- /* no timeout for this transfer? */
- if (!timerisset(&transfer->timeout))
- continue;
-
- found = 1;
- break;
- }
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
-
- if (!found) {
- usbi_dbg("no URB with timeout or all handled by OS; no timeout!");
- return 0;
- }
-
- next_timeout = &transfer->timeout;
-
- r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts);
- if (r < 0) {
- usbi_err(ctx, "failed to read monotonic clock, errno=%d", errno);
- return 0;
- }
- TIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts);
-
- if (!timercmp(&cur_tv, next_timeout, <)) {
- usbi_dbg("first timeout already expired");
- timerclear(tv);
- } else {
- timersub(next_timeout, &cur_tv, tv);
- usbi_dbg("next timeout in %d.%06ds", tv->tv_sec, tv->tv_usec);
- }
-
- return 1;
-}
-
-/** \ingroup poll
- * Register notification functions for file descriptor additions/removals.
- * These functions will be invoked for every new or removed file descriptor
- * that libusbx uses as an event source.
- *
- * To remove notifiers, pass NULL values for the function pointers.
- *
- * Note that file descriptors may have been added even before you register
- * these notifiers (e.g. at libusb_init() time).
- *
- * Additionally, note that the removal notifier may be called during
- * libusb_exit() (e.g. when it is closing file descriptors that were opened
- * and added to the poll set at libusb_init() time). If you don't want this,
- * remove the notifiers immediately before calling libusb_exit().
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \param added_cb pointer to function for addition notifications
- * \param removed_cb pointer to function for removal notifications
- * \param user_data User data to be passed back to callbacks (useful for
- * passing context information)
- */
-void API_EXPORTED libusb_set_pollfd_notifiers(libusb_context *ctx,
- libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,
- void *user_data)
-{
- USBI_GET_CONTEXT(ctx);
- ctx->fd_added_cb = added_cb;
- ctx->fd_removed_cb = removed_cb;
- ctx->fd_cb_user_data = user_data;
-}
-
-/* Add a file descriptor to the list of file descriptors to be monitored.
- * events should be specified as a bitmask of events passed to poll(), e.g.
- * POLLIN and/or POLLOUT. */
-int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events)
-{
- struct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd));
- if (!ipollfd)
- return LIBUSB_ERROR_NO_MEM;
-
- usbi_dbg("add fd %d events %d", fd, events);
- ipollfd->pollfd.fd = fd;
- ipollfd->pollfd.events = events;
- usbi_mutex_lock(&ctx->pollfds_lock);
- list_add_tail(&ipollfd->list, &ctx->pollfds);
- usbi_mutex_unlock(&ctx->pollfds_lock);
-
- if (ctx->fd_added_cb)
- ctx->fd_added_cb(fd, events, ctx->fd_cb_user_data);
- return 0;
-}
-
-/* Remove a file descriptor from the list of file descriptors to be polled. */
-void usbi_remove_pollfd(struct libusb_context *ctx, int fd)
-{
- struct usbi_pollfd *ipollfd;
- int found = 0;
-
- usbi_dbg("remove fd %d", fd);
- usbi_mutex_lock(&ctx->pollfds_lock);
- list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)
- if (ipollfd->pollfd.fd == fd) {
- found = 1;
- break;
- }
-
- if (!found) {
- usbi_dbg("couldn't find fd %d to remove", fd);
- usbi_mutex_unlock(&ctx->pollfds_lock);
- return;
- }
-
- list_del(&ipollfd->list);
- usbi_mutex_unlock(&ctx->pollfds_lock);
- free(ipollfd);
- if (ctx->fd_removed_cb)
- ctx->fd_removed_cb(fd, ctx->fd_cb_user_data);
-}
-
-/** \ingroup poll
- * Retrieve a list of file descriptors that should be polled by your main loop
- * as libusbx event sources.
- *
- * The returned list is NULL-terminated and should be freed with free() when
- * done. The actual list contents must not be touched.
- *
- * As file descriptors are a Unix-specific concept, this function is not
- * available on Windows and will always return NULL.
- *
- * \param ctx the context to operate on, or NULL for the default context
- * \returns a NULL-terminated list of libusb_pollfd structures
- * \returns NULL on error
- * \returns NULL on platforms where the functionality is not available
- */
-DEFAULT_VISIBILITY
-const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(
- libusb_context *ctx)
-{
-#ifndef OS_WINDOWS
- struct libusb_pollfd **ret = NULL;
- struct usbi_pollfd *ipollfd;
- size_t i = 0;
- size_t cnt = 0;
- USBI_GET_CONTEXT(ctx);
-
- usbi_mutex_lock(&ctx->pollfds_lock);
- list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)
- cnt++;
-
- ret = calloc(cnt + 1, sizeof(struct libusb_pollfd *));
- if (!ret)
- goto out;
-
- list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)
- ret[i++] = (struct libusb_pollfd *) ipollfd;
- ret[cnt] = NULL;
-
-out:
- usbi_mutex_unlock(&ctx->pollfds_lock);
- return (const struct libusb_pollfd **) ret;
-#else
- usbi_err(ctx, "external polling of libusbx's internal descriptors "\
- "is not yet supported on Windows platforms");
- return NULL;
-#endif
-}
-
-/* Backends may call this from handle_events to report disconnection of a
- * device. This function ensures transfers get cancelled appropriately.
- * Callers of this function must hold the events_lock.
- */
-void usbi_handle_disconnect(struct libusb_device_handle *handle)
-{
- struct usbi_transfer *cur;
- struct usbi_transfer *to_cancel;
-
- usbi_dbg("device %d.%d",
- handle->dev->bus_number, handle->dev->device_address);
-
- /* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE
- * status code.
- *
- * this is a bit tricky because:
- * 1. we can't do transfer completion while holding flying_transfers_lock
- * because the completion handler may try to re-submit the transfer
- * 2. the transfers list can change underneath us - if we were to build a
- * list of transfers to complete (while holding lock), the situation
- * might be different by the time we come to free them
- *
- * so we resort to a loop-based approach as below
- *
- * This is safe because transfers are only removed from the
- * flying_transfer list by usbi_handle_transfer_completion and
- * libusb_close, both of which hold the events_lock while doing so,
- * so usbi_handle_disconnect cannot be running at the same time.
- *
- * Note that libusb_submit_transfer also removes the transfer from
- * the flying_transfer list on submission failure, but it keeps the
- * flying_transfer list locked between addition and removal, so
- * usbi_handle_disconnect never sees such transfers.
- */
-
- while (1) {
- usbi_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock);
- to_cancel = NULL;
- list_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list, struct usbi_transfer)
- if (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) {
- to_cancel = cur;
- break;
- }
- usbi_mutex_unlock(&HANDLE_CTX(handle)->flying_transfers_lock);
-
- if (!to_cancel)
- break;
-
- usbi_dbg("cancelling transfer %p from disconnect",
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(to_cancel));
-
- usbi_backend->clear_transfer_priv(to_cancel);
- usbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE);
- }
-
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.def b/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.def
deleted file mode 100644
index cb0e32ab93..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.def
+++ /dev/null
@@ -1,158 +0,0 @@
-LIBRARY "libusb-1.0.dll"
-EXPORTS
- libusb_alloc_transfer
- libusb_alloc_transfer@4 = libusb_alloc_transfer
- libusb_attach_kernel_driver
- libusb_attach_kernel_driver@8 = libusb_attach_kernel_driver
- libusb_bulk_transfer
- libusb_bulk_transfer@24 = libusb_bulk_transfer
- libusb_cancel_transfer
- libusb_cancel_transfer@4 = libusb_cancel_transfer
- libusb_claim_interface
- libusb_claim_interface@8 = libusb_claim_interface
- libusb_clear_halt
- libusb_clear_halt@8 = libusb_clear_halt
- libusb_close
- libusb_close@4 = libusb_close
- libusb_control_transfer
- libusb_control_transfer@32 = libusb_control_transfer
- libusb_detach_kernel_driver
- libusb_detach_kernel_driver@8 = libusb_detach_kernel_driver
- libusb_error_name
- libusb_error_name@4 = libusb_error_name
- libusb_event_handler_active
- libusb_event_handler_active@4 = libusb_event_handler_active
- libusb_event_handling_ok
- libusb_event_handling_ok@4 = libusb_event_handling_ok
- libusb_exit
- libusb_exit@4 = libusb_exit
- libusb_free_bos_descriptor
- libusb_free_bos_descriptor@4 = libusb_free_bos_descriptor
- libusb_free_config_descriptor
- libusb_free_config_descriptor@4 = libusb_free_config_descriptor
- libusb_free_container_id_descriptor
- libusb_free_container_id_descriptor@4 = libusb_free_container_id_descriptor
- libusb_free_device_list
- libusb_free_device_list@8 = libusb_free_device_list
- libusb_free_ss_endpoint_companion_descriptor
- libusb_free_ss_endpoint_companion_descriptor@4 = libusb_free_ss_endpoint_companion_descriptor
- libusb_free_ss_usb_device_capability_descriptor
- libusb_free_ss_usb_device_capability_descriptor@4 = libusb_free_ss_usb_device_capability_descriptor
- libusb_free_transfer
- libusb_free_transfer@4 = libusb_free_transfer
- libusb_free_usb_2_0_extension_descriptor
- libusb_free_usb_2_0_extension_descriptor@4 = libusb_free_usb_2_0_extension_descriptor
- libusb_get_active_config_descriptor
- libusb_get_active_config_descriptor@8 = libusb_get_active_config_descriptor
- libusb_get_bos_descriptor
- libusb_get_bos_descriptor@8 = libusb_get_bos_descriptor
- libusb_get_bus_number
- libusb_get_bus_number@4 = libusb_get_bus_number
- libusb_get_config_descriptor
- libusb_get_config_descriptor@12 = libusb_get_config_descriptor
- libusb_get_config_descriptor_by_value
- libusb_get_config_descriptor_by_value@12 = libusb_get_config_descriptor_by_value
- libusb_get_configuration
- libusb_get_configuration@8 = libusb_get_configuration
- libusb_get_container_id_descriptor
- libusb_get_container_id_descriptor@12 = libusb_get_container_id_descriptor
- libusb_get_device
- libusb_get_device@4 = libusb_get_device
- libusb_get_device_address
- libusb_get_device_address@4 = libusb_get_device_address
- libusb_get_device_descriptor
- libusb_get_device_descriptor@8 = libusb_get_device_descriptor
- libusb_get_device_list
- libusb_get_device_list@8 = libusb_get_device_list
- libusb_get_device_speed
- libusb_get_device_speed@4 = libusb_get_device_speed
- libusb_get_max_iso_packet_size
- libusb_get_max_iso_packet_size@8 = libusb_get_max_iso_packet_size
- libusb_get_max_packet_size
- libusb_get_max_packet_size@8 = libusb_get_max_packet_size
- libusb_get_next_timeout
- libusb_get_next_timeout@8 = libusb_get_next_timeout
- libusb_get_parent
- libusb_get_parent@4 = libusb_get_parent
- libusb_get_pollfds
- libusb_get_pollfds@4 = libusb_get_pollfds
- libusb_get_port_number
- libusb_get_port_number@4 = libusb_get_port_number
- libusb_get_port_numbers
- libusb_get_port_numbers@12 = libusb_get_port_numbers
- libusb_get_port_path
- libusb_get_port_path@16 = libusb_get_port_path
- libusb_get_ss_endpoint_companion_descriptor
- libusb_get_ss_endpoint_companion_descriptor@12 = libusb_get_ss_endpoint_companion_descriptor
- libusb_get_ss_usb_device_capability_descriptor
- libusb_get_ss_usb_device_capability_descriptor@12 = libusb_get_ss_usb_device_capability_descriptor
- libusb_get_string_descriptor_ascii
- libusb_get_string_descriptor_ascii@16 = libusb_get_string_descriptor_ascii
- libusb_get_usb_2_0_extension_descriptor
- libusb_get_usb_2_0_extension_descriptor@12 = libusb_get_usb_2_0_extension_descriptor
- libusb_get_version
- libusb_get_version@0 = libusb_get_version
- libusb_handle_events
- libusb_handle_events@4 = libusb_handle_events
- libusb_handle_events_completed
- libusb_handle_events_completed@8 = libusb_handle_events_completed
- libusb_handle_events_locked
- libusb_handle_events_locked@8 = libusb_handle_events_locked
- libusb_handle_events_timeout
- libusb_handle_events_timeout@8 = libusb_handle_events_timeout
- libusb_handle_events_timeout_completed
- libusb_handle_events_timeout_completed@12 = libusb_handle_events_timeout_completed
- libusb_has_capability
- libusb_has_capability@4 = libusb_has_capability
- libusb_hotplug_deregister_callback
- libusb_hotplug_deregister_callback@8 = libusb_hotplug_deregister_callback
- libusb_hotplug_register_callback
- libusb_hotplug_register_callback@36 = libusb_hotplug_register_callback
- libusb_init
- libusb_init@4 = libusb_init
- libusb_interrupt_transfer
- libusb_interrupt_transfer@24 = libusb_interrupt_transfer
- libusb_kernel_driver_active
- libusb_kernel_driver_active@8 = libusb_kernel_driver_active
- libusb_lock_event_waiters
- libusb_lock_event_waiters@4 = libusb_lock_event_waiters
- libusb_lock_events
- libusb_lock_events@4 = libusb_lock_events
- libusb_open
- libusb_open@8 = libusb_open
- libusb_open_device_with_vid_pid
- libusb_open_device_with_vid_pid@12 = libusb_open_device_with_vid_pid
- libusb_pollfds_handle_timeouts
- libusb_pollfds_handle_timeouts@4 = libusb_pollfds_handle_timeouts
- libusb_ref_device
- libusb_ref_device@4 = libusb_ref_device
- libusb_release_interface
- libusb_release_interface@8 = libusb_release_interface
- libusb_reset_device
- libusb_reset_device@4 = libusb_reset_device
- libusb_set_auto_detach_kernel_driver
- libusb_set_auto_detach_kernel_driver@8 = libusb_set_auto_detach_kernel_driver
- libusb_set_configuration
- libusb_set_configuration@8 = libusb_set_configuration
- libusb_set_debug
- libusb_set_debug@8 = libusb_set_debug
- libusb_set_interface_alt_setting
- libusb_set_interface_alt_setting@12 = libusb_set_interface_alt_setting
- libusb_set_pollfd_notifiers
- libusb_set_pollfd_notifiers@16 = libusb_set_pollfd_notifiers
- libusb_setlocale
- libusb_setlocale@4 = libusb_setlocale
- libusb_strerror
- libusb_strerror@4 = libusb_strerror
- libusb_submit_transfer
- libusb_submit_transfer@4 = libusb_submit_transfer
- libusb_try_lock_events
- libusb_try_lock_events@4 = libusb_try_lock_events
- libusb_unlock_event_waiters
- libusb_unlock_event_waiters@4 = libusb_unlock_event_waiters
- libusb_unlock_events
- libusb_unlock_events@4 = libusb_unlock_events
- libusb_unref_device
- libusb_unref_device@4 = libusb_unref_device
- libusb_wait_for_event
- libusb_wait_for_event@8 = libusb_wait_for_event
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.rc b/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.rc
deleted file mode 100644
index ae49757cc1..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb-1.0.rc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * For Windows: input this file to the Resoure Compiler to produce a binary
- * .res file. This is then embedded in the resultant library (like any other
- * compilation object).
- * The information can then be queried using standard APIs and can also be
- * viewed with utilities such as Windows Explorer.
- */
-#ifndef _WIN32_WCE
-#include "winresrc.h"
-#endif
-
-#include "version.h"
-#ifndef LIBUSB_VERSIONSTRING
-#define LU_STR(s) #s
-#define LU_XSTR(s) LU_STR(s)
-#if LIBUSB_NANO > 0
-#define LIBUSB_VERSIONSTRING \
- LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." \
- LU_XSTR(LIBUSB_MICRO) "." LU_XSTR(LIBUSB_NANO) LIBUSB_RC "\0"
-#else
-#define LIBUSB_VERSIONSTRING \
- LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." \
- LU_XSTR(LIBUSB_MICRO) LIBUSB_RC "\0"
-#endif
-#endif
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO
- PRODUCTVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "libusbx.org\0"
- VALUE "FileDescription", "C library for writing portable USB drivers in userspace\0"
- VALUE "FileVersion", LIBUSB_VERSIONSTRING
- VALUE "InternalName", "libusb\0"
- VALUE "LegalCopyright", "See individual source files, GNU LGPL v2.1 or later.\0"
- VALUE "LegalTrademarks", "http://www.gnu.org/licenses/lgpl-2.1.html\0"
- VALUE "OriginalFilename", "libusb-1.0.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "libusb-1.0\0"
- VALUE "ProductVersion", LIBUSB_VERSIONSTRING
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb.h b/src/3rd_party-static/libusbx-1.0.16/libusb/libusb.h
deleted file mode 100644
index e8e120162f..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/libusb.h
+++ /dev/null
@@ -1,1941 +0,0 @@
-/*
- * Public libusbx header file
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2012 Pete Batard <pete@akeo.ie>
- * Copyright © 2012 Nathan Hjelm <hjelmn@cs.unm.edu>
- * For more information, please visit: http://libusbx.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBUSB_H
-#define LIBUSB_H
-
-#ifdef _MSC_VER
-/* on MS environments, the inline keyword is available in C++ only */
-#if !defined(__cplusplus)
-#define inline __inline
-#endif
-/* ssize_t is also not available (copy/paste from MinGW) */
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
- typedef __int64 ssize_t;
-#else
- typedef int ssize_t;
-#endif /* _WIN64 */
-#endif /* _SSIZE_T_DEFINED */
-#endif /* _MSC_VER */
-
-/* stdint.h is not available on older MSVC */
-#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-#else
-#include <stdint.h>
-#endif
-
-#if !defined(_WIN32_WCE)
-#include <sys/types.h>
-#endif
-
-#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
-#include <sys/time.h>
-#endif
-
-#include <time.h>
-#include <limits.h>
-
-/* 'interface' might be defined as a macro on Windows, so we need to
- * undefine it so as not to break the current libusbx API, because
- * libusb_config_descriptor has an 'interface' member
- * As this can be problematic if you include windows.h after libusb.h
- * in your sources, we force windows.h to be included first. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-#include <windows.h>
-#if defined(interface)
-#undef interface
-#endif
-#if !defined(__CYGWIN__)
-#include <winsock.h>
-#endif
-#endif
-
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define LIBUSB_DEPRECATED_FOR(f) \
- __attribute__((deprecated("Use " #f " instead")))
-#else
-#define LIBUSB_DEPRECATED_FOR(f)
-#endif /* __GNUC__ */
-
-/** \def LIBUSB_CALL
- * \ingroup misc
- * libusbx's Windows calling convention.
- *
- * Under Windows, the selection of available compilers and configurations
- * means that, unlike other platforms, there is not <em>one true calling
- * convention</em> (calling convention: the manner in which parameters are
- * passed to funcions in the generated assembly code).
- *
- * Matching the Windows API itself, libusbx uses the WINAPI convention (which
- * translates to the <tt>stdcall</tt> convention) and guarantees that the
- * library is compiled in this way. The public header file also includes
- * appropriate annotations so that your own software will use the right
- * convention, even if another convention is being used by default within
- * your codebase.
- *
- * The one consideration that you must apply in your software is to mark
- * all functions which you use as libusbx callbacks with this LIBUSB_CALL
- * annotation, so that they too get compiled for the correct calling
- * convention.
- *
- * On non-Windows operating systems, this macro is defined as nothing. This
- * means that you can apply it to your code without worrying about
- * cross-platform compatibility.
- */
-/* LIBUSB_CALL must be defined on both definition and declaration of libusbx
- * functions. You'd think that declaration would be enough, but cygwin will
- * complain about conflicting types unless both are marked this way.
- * The placement of this macro is important too; it must appear after the
- * return type, before the function name. See internal documentation for
- * API_EXPORTED.
- */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-#define LIBUSB_CALL WINAPI
-#else
-#define LIBUSB_CALL
-#endif
-
-/** \def LIBUSBX_API_VERSION
- * \ingroup misc
- * libusbx's API version.
- *
- * Since version 1.0.13, to help with feature detection, libusbx defines
- * a LIBUSBX_API_VERSION macro that gets increased every time there is a
- * significant change to the API, such as the introduction of a new call,
- * the definition of a new macro/enum member, or any other element that
- * libusbx applications may want to detect at compilation time.
- *
- * The macro is typically used in an application as follows:
- * \code
- * #if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01001234)
- * // Use one of the newer features from the libusbx API
- * #endif
- * \endcode
- *
- * Another feature of LIBUSBX_API_VERSION is that it can be used to detect
- * whether you are compiling against the libusb or the libusbx library.
- *
- * Internally, LIBUSBX_API_VERSION is defined as follows:
- * (libusbx major << 24) | (libusbx minor << 16) | (16 bit incremental)
- */
-#define LIBUSBX_API_VERSION 0x01000102
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** \def libusb_cpu_to_le16
- * \ingroup misc
- * Convert a 16-bit value from host-endian to little-endian format. On
- * little endian systems, this function does nothing. On big endian systems,
- * the bytes are swapped.
- * \param x the host-endian value to convert
- * \returns the value in little-endian byte order
- */
-static inline uint16_t libusb_cpu_to_le16(const uint16_t x)
-{
- union {
- uint8_t b8[2];
- uint16_t b16;
- } _tmp;
- _tmp.b8[1] = (uint8_t) (x >> 8);
- _tmp.b8[0] = (uint8_t) (x & 0xff);
- return _tmp.b16;
-}
-
-/** \def libusb_le16_to_cpu
- * \ingroup misc
- * Convert a 16-bit value from little-endian to host-endian format. On
- * little endian systems, this function does nothing. On big endian systems,
- * the bytes are swapped.
- * \param x the little-endian value to convert
- * \returns the value in host-endian byte order
- */
-#define libusb_le16_to_cpu libusb_cpu_to_le16
-
-/* standard USB stuff */
-
-/** \ingroup desc
- * Device and/or Interface Class codes */
-enum libusb_class_code {
- /** In the context of a \ref libusb_device_descriptor "device descriptor",
- * this bDeviceClass value indicates that each interface specifies its
- * own class information and all interfaces operate independently.
- */
- LIBUSB_CLASS_PER_INTERFACE = 0,
-
- /** Audio class */
- LIBUSB_CLASS_AUDIO = 1,
-
- /** Communications class */
- LIBUSB_CLASS_COMM = 2,
-
- /** Human Interface Device class */
- LIBUSB_CLASS_HID = 3,
-
- /** Physical */
- LIBUSB_CLASS_PHYSICAL = 5,
-
- /** Printer class */
- LIBUSB_CLASS_PRINTER = 7,
-
- /** Image class */
- LIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */
- LIBUSB_CLASS_IMAGE = 6,
-
- /** Mass storage class */
- LIBUSB_CLASS_MASS_STORAGE = 8,
-
- /** Hub class */
- LIBUSB_CLASS_HUB = 9,
-
- /** Data class */
- LIBUSB_CLASS_DATA = 10,
-
- /** Smart Card */
- LIBUSB_CLASS_SMART_CARD = 0x0b,
-
- /** Content Security */
- LIBUSB_CLASS_CONTENT_SECURITY = 0x0d,
-
- /** Video */
- LIBUSB_CLASS_VIDEO = 0x0e,
-
- /** Personal Healthcare */
- LIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f,
-
- /** Diagnostic Device */
- LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc,
-
- /** Wireless class */
- LIBUSB_CLASS_WIRELESS = 0xe0,
-
- /** Application class */
- LIBUSB_CLASS_APPLICATION = 0xfe,
-
- /** Class is vendor-specific */
- LIBUSB_CLASS_VENDOR_SPEC = 0xff
-};
-
-/** \ingroup desc
- * Descriptor types as defined by the USB specification. */
-enum libusb_descriptor_type {
- /** Device descriptor. See libusb_device_descriptor. */
- LIBUSB_DT_DEVICE = 0x01,
-
- /** Configuration descriptor. See libusb_config_descriptor. */
- LIBUSB_DT_CONFIG = 0x02,
-
- /** String descriptor */
- LIBUSB_DT_STRING = 0x03,
-
- /** Interface descriptor. See libusb_interface_descriptor. */
- LIBUSB_DT_INTERFACE = 0x04,
-
- /** Endpoint descriptor. See libusb_endpoint_descriptor. */
- LIBUSB_DT_ENDPOINT = 0x05,
-
- /** BOS descriptor */
- LIBUSB_DT_BOS = 0x0f,
-
- /** Device Capability descriptor */
- LIBUSB_DT_DEVICE_CAPABILITY = 0x10,
-
- /** HID descriptor */
- LIBUSB_DT_HID = 0x21,
-
- /** HID report descriptor */
- LIBUSB_DT_REPORT = 0x22,
-
- /** Physical descriptor */
- LIBUSB_DT_PHYSICAL = 0x23,
-
- /** Hub descriptor */
- LIBUSB_DT_HUB = 0x29,
-
- /** SuperSpeed Hub descriptor */
- LIBUSB_DT_SUPERSPEED_HUB = 0x2a,
-
- /** SuperSpeed Endpoint Companion descriptor */
- LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30
-};
-
-/* Descriptor sizes per descriptor type */
-#define LIBUSB_DT_DEVICE_SIZE 18
-#define LIBUSB_DT_CONFIG_SIZE 9
-#define LIBUSB_DT_INTERFACE_SIZE 9
-#define LIBUSB_DT_ENDPOINT_SIZE 7
-#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
-#define LIBUSB_DT_HUB_NONVAR_SIZE 7
-#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
-#define LIBUSB_DT_BOS_SIZE 5
-#define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
-
-/* BOS descriptor sizes */
-#define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
-#define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
-#define LIBUSB_BT_CONTAINER_ID_SIZE 20
-
-/* We unwrap the BOS => define its max size */
-#define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\
- (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\
- (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\
- (LIBUSB_BT_CONTAINER_ID_SIZE))
-
-#define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */
-#define LIBUSB_ENDPOINT_DIR_MASK 0x80
-
-/** \ingroup desc
- * Endpoint direction. Values for bit 7 of the
- * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme.
- */
-enum libusb_endpoint_direction {
- /** In: device-to-host */
- LIBUSB_ENDPOINT_IN = 0x80,
-
- /** Out: host-to-device */
- LIBUSB_ENDPOINT_OUT = 0x00
-};
-
-#define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */
-
-/** \ingroup desc
- * Endpoint transfer type. Values for bits 0:1 of the
- * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field.
- */
-enum libusb_transfer_type {
- /** Control endpoint */
- LIBUSB_TRANSFER_TYPE_CONTROL = 0,
-
- /** Isochronous endpoint */
- LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1,
-
- /** Bulk endpoint */
- LIBUSB_TRANSFER_TYPE_BULK = 2,
-
- /** Interrupt endpoint */
- LIBUSB_TRANSFER_TYPE_INTERRUPT = 3
-};
-
-/** \ingroup misc
- * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */
-enum libusb_standard_request {
- /** Request status of the specific recipient */
- LIBUSB_REQUEST_GET_STATUS = 0x00,
-
- /** Clear or disable a specific feature */
- LIBUSB_REQUEST_CLEAR_FEATURE = 0x01,
-
- /* 0x02 is reserved */
-
- /** Set or enable a specific feature */
- LIBUSB_REQUEST_SET_FEATURE = 0x03,
-
- /* 0x04 is reserved */
-
- /** Set device address for all future accesses */
- LIBUSB_REQUEST_SET_ADDRESS = 0x05,
-
- /** Get the specified descriptor */
- LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06,
-
- /** Used to update existing descriptors or add new descriptors */
- LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07,
-
- /** Get the current device configuration value */
- LIBUSB_REQUEST_GET_CONFIGURATION = 0x08,
-
- /** Set device configuration */
- LIBUSB_REQUEST_SET_CONFIGURATION = 0x09,
-
- /** Return the selected alternate setting for the specified interface */
- LIBUSB_REQUEST_GET_INTERFACE = 0x0A,
-
- /** Select an alternate interface for the specified interface */
- LIBUSB_REQUEST_SET_INTERFACE = 0x0B,
-
- /** Set then report an endpoint's synchronization frame */
- LIBUSB_REQUEST_SYNCH_FRAME = 0x0C,
-
- /** Sets both the U1 and U2 Exit Latency */
- LIBUSB_REQUEST_SET_SEL = 0x30,
-
- /** Delay from the time a host transmits a packet to the time it is
- * received by the device. */
- LIBUSB_SET_ISOCH_DELAY = 0x31,
-};
-
-/** \ingroup misc
- * Request type bits of the
- * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
- * transfers. */
-enum libusb_request_type {
- /** Standard */
- LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5),
-
- /** Class */
- LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5),
-
- /** Vendor */
- LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5),
-
- /** Reserved */
- LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5)
-};
-
-/** \ingroup misc
- * Recipient bits of the
- * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
- * transfers. Values 4 through 31 are reserved. */
-enum libusb_request_recipient {
- /** Device */
- LIBUSB_RECIPIENT_DEVICE = 0x00,
-
- /** Interface */
- LIBUSB_RECIPIENT_INTERFACE = 0x01,
-
- /** Endpoint */
- LIBUSB_RECIPIENT_ENDPOINT = 0x02,
-
- /** Other */
- LIBUSB_RECIPIENT_OTHER = 0x03,
-};
-
-#define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
-
-/** \ingroup desc
- * Synchronization type for isochronous endpoints. Values for bits 2:3 of the
- * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
- * libusb_endpoint_descriptor.
- */
-enum libusb_iso_sync_type {
- /** No synchronization */
- LIBUSB_ISO_SYNC_TYPE_NONE = 0,
-
- /** Asynchronous */
- LIBUSB_ISO_SYNC_TYPE_ASYNC = 1,
-
- /** Adaptive */
- LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2,
-
- /** Synchronous */
- LIBUSB_ISO_SYNC_TYPE_SYNC = 3
-};
-
-#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
-
-/** \ingroup desc
- * Usage type for isochronous endpoints. Values for bits 4:5 of the
- * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
- * libusb_endpoint_descriptor.
- */
-enum libusb_iso_usage_type {
- /** Data endpoint */
- LIBUSB_ISO_USAGE_TYPE_DATA = 0,
-
- /** Feedback endpoint */
- LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1,
-
- /** Implicit feedback Data endpoint */
- LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2,
-};
-
-/** \ingroup desc
- * A structure representing the standard USB device descriptor. This
- * descriptor is documented in section 9.6.1 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_device_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this
- * context. */
- uint8_t bDescriptorType;
-
- /** USB specification release number in binary-coded decimal. A value of
- * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */
- uint16_t bcdUSB;
-
- /** USB-IF class code for the device. See \ref libusb_class_code. */
- uint8_t bDeviceClass;
-
- /** USB-IF subclass code for the device, qualified by the bDeviceClass
- * value */
- uint8_t bDeviceSubClass;
-
- /** USB-IF protocol code for the device, qualified by the bDeviceClass and
- * bDeviceSubClass values */
- uint8_t bDeviceProtocol;
-
- /** Maximum packet size for endpoint 0 */
- uint8_t bMaxPacketSize0;
-
- /** USB-IF vendor ID */
- uint16_t idVendor;
-
- /** USB-IF product ID */
- uint16_t idProduct;
-
- /** Device release number in binary-coded decimal */
- uint16_t bcdDevice;
-
- /** Index of string descriptor describing manufacturer */
- uint8_t iManufacturer;
-
- /** Index of string descriptor describing product */
- uint8_t iProduct;
-
- /** Index of string descriptor containing device serial number */
- uint8_t iSerialNumber;
-
- /** Number of possible configurations */
- uint8_t bNumConfigurations;
-};
-
-/** \ingroup desc
- * A structure representing the standard USB endpoint descriptor. This
- * descriptor is documented in section 9.6.6 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_endpoint_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in
- * this context. */
- uint8_t bDescriptorType;
-
- /** The address of the endpoint described by this descriptor. Bits 0:3 are
- * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction,
- * see \ref libusb_endpoint_direction.
- */
- uint8_t bEndpointAddress;
-
- /** Attributes which apply to the endpoint when it is configured using
- * the bConfigurationValue. Bits 0:1 determine the transfer type and
- * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for
- * isochronous endpoints and correspond to \ref libusb_iso_sync_type.
- * Bits 4:5 are also only used for isochronous endpoints and correspond to
- * \ref libusb_iso_usage_type. Bits 6:7 are reserved.
- */
- uint8_t bmAttributes;
-
- /** Maximum packet size this endpoint is capable of sending/receiving. */
- uint16_t wMaxPacketSize;
-
- /** Interval for polling endpoint for data transfers. */
- uint8_t bInterval;
-
- /** For audio devices only: the rate at which synchronization feedback
- * is provided. */
- uint8_t bRefresh;
-
- /** For audio devices only: the address if the synch endpoint */
- uint8_t bSynchAddress;
-
- /** Extra descriptors. If libusbx encounters unknown endpoint descriptors,
- * it will store them here, should you wish to parse them. */
- const unsigned char *extra;
-
- /** Length of the extra descriptors, in bytes. */
- int extra_length;
-};
-
-/** \ingroup desc
- * A structure representing the standard USB interface descriptor. This
- * descriptor is documented in section 9.6.5 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_interface_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE
- * in this context. */
- uint8_t bDescriptorType;
-
- /** Number of this interface */
- uint8_t bInterfaceNumber;
-
- /** Value used to select this alternate setting for this interface */
- uint8_t bAlternateSetting;
-
- /** Number of endpoints used by this interface (excluding the control
- * endpoint). */
- uint8_t bNumEndpoints;
-
- /** USB-IF class code for this interface. See \ref libusb_class_code. */
- uint8_t bInterfaceClass;
-
- /** USB-IF subclass code for this interface, qualified by the
- * bInterfaceClass value */
- uint8_t bInterfaceSubClass;
-
- /** USB-IF protocol code for this interface, qualified by the
- * bInterfaceClass and bInterfaceSubClass values */
- uint8_t bInterfaceProtocol;
-
- /** Index of string descriptor describing this interface */
- uint8_t iInterface;
-
- /** Array of endpoint descriptors. This length of this array is determined
- * by the bNumEndpoints field. */
- const struct libusb_endpoint_descriptor *endpoint;
-
- /** Extra descriptors. If libusbx encounters unknown interface descriptors,
- * it will store them here, should you wish to parse them. */
- const unsigned char *extra;
-
- /** Length of the extra descriptors, in bytes. */
- int extra_length;
-};
-
-/** \ingroup desc
- * A collection of alternate settings for a particular USB interface.
- */
-struct libusb_interface {
- /** Array of interface descriptors. The length of this array is determined
- * by the num_altsetting field. */
- const struct libusb_interface_descriptor *altsetting;
-
- /** The number of alternate settings that belong to this interface */
- int num_altsetting;
-};
-
-/** \ingroup desc
- * A structure representing the standard USB configuration descriptor. This
- * descriptor is documented in section 9.6.3 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_config_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG
- * in this context. */
- uint8_t bDescriptorType;
-
- /** Total length of data returned for this configuration */
- uint16_t wTotalLength;
-
- /** Number of interfaces supported by this configuration */
- uint8_t bNumInterfaces;
-
- /** Identifier value for this configuration */
- uint8_t bConfigurationValue;
-
- /** Index of string descriptor describing this configuration */
- uint8_t iConfiguration;
-
- /** Configuration characteristics */
- uint8_t bmAttributes;
-
- /** Maximum power consumption of the USB device from this bus in this
- * configuration when the device is fully opreation. Expressed in units
- * of 2 mA. */
- uint8_t MaxPower;
-
- /** Array of interfaces supported by this configuration. The length of
- * this array is determined by the bNumInterfaces field. */
- const struct libusb_interface *interface;
-
- /** Extra descriptors. If libusbx encounters unknown configuration
- * descriptors, it will store them here, should you wish to parse them. */
- const unsigned char *extra;
-
- /** Length of the extra descriptors, in bytes. */
- int extra_length;
-};
-
-/** \ingroup desc
- * A structure representing the superspeed endpoint companion
- * descriptor. This descriptor is documented in section 9.6.7 of
- * the USB 3.0 specification. All multiple-byte fields are represented in
- * host-endian format.
- */
-struct libusb_ss_endpoint_companion_descriptor {
-
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in
- * this context. */
- uint8_t bDescriptorType;
-
-
- /** The maximum number of packets the endpoint can send or
- * recieve as part of a burst. */
- uint8_t bMaxBurst;
-
- /** In bulk EP: bits 4:0 represents the maximum number of
- * streams the EP supports. In isochronous EP: bits 1:0
- * represents the Mult - a zero based value that determines
- * the maximum number of packets within a service interval */
- uint8_t bmAttributes;
-
- /** The total number of bytes this EP will transfer every
- * service interval. valid only for periodic EPs. */
- uint16_t wBytesPerInterval;
-};
-
-/** \ingroup desc
- * A generic representation of a BOS Device Capability descriptor. It is
- * advised to check bDevCapabilityType and call the matching
- * libusb_get_*_descriptor function to get a structure fully matching the type.
- */
-struct libusb_bos_dev_capability_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
- * LIBUSB_DT_DEVICE_CAPABILITY in this context. */
- uint8_t bDescriptorType;
- /** Device Capability type */
- uint8_t bDevCapabilityType;
- /** Device Capability data (bLength - 3 bytes) */
- uint8_t dev_capability_data
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-/** \ingroup desc
- * A structure representing the Binary Device Object Store (BOS) descriptor.
- * This descriptor is documented in section 9.6.2 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_bos_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS
- * in this context. */
- uint8_t bDescriptorType;
-
- /** Length of this descriptor and all of its sub descriptors */
- uint16_t wTotalLength;
-
- /** The number of separate device capability descriptors in
- * the BOS */
- uint8_t bNumDeviceCaps;
-
- /** bNumDeviceCap Device Capability Descriptors */
- struct libusb_bos_dev_capability_descriptor *dev_capability
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-/** \ingroup desc
- * A structure representing the USB 2.0 Extension descriptor
- * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_usb_2_0_extension_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
- * LIBUSB_DT_DEVICE_CAPABILITY in this context. */
- uint8_t bDescriptorType;
-
- /** Capability type. Will have value
- * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION
- * LIBUSB_BT_USB_2_0_EXTENSION in this context. */
- uint8_t bDevCapabilityType;
-
- /** Bitmap encoding of supported device level features.
- * A value of one in a bit location indicates a feature is
- * supported; a value of zero indicates it is not supported.
- * See \ref libusb_usb_2_0_extension_attributes. */
- uint32_t bmAttributes;
-};
-
-/** \ingroup desc
- * A structure representing the SuperSpeed USB Device Capability descriptor
- * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification.
- * All multiple-byte fields are represented in host-endian format.
- */
-struct libusb_ss_usb_device_capability_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
- * LIBUSB_DT_DEVICE_CAPABILITY in this context. */
- uint8_t bDescriptorType;
-
- /** Capability type. Will have value
- * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
- * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */
- uint8_t bDevCapabilityType;
-
- /** Bitmap encoding of supported device level features.
- * A value of one in a bit location indicates a feature is
- * supported; a value of zero indicates it is not supported.
- * See \ref libusb_ss_usb_device_capability_attributes. */
- uint8_t bmAttributes;
-
- /** Bitmap encoding of the speed supported by this device when
- * operating in SuperSpeed mode. See \ref libusb_supported_speed. */
- uint16_t wSpeedSupported;
-
- /** The lowest speed at which all the functionality supported
- * by the device is available to the user. For example if the
- * device supports all its functionality when connected at
- * full speed and above then it sets this value to 1. */
- uint8_t bFunctionalitySupport;
-
- /** U1 Device Exit Latency. */
- uint8_t bU1DevExitLat;
-
- /** U2 Device Exit Latency. */
- uint16_t bU2DevExitLat;
-};
-
-/** \ingroup desc
- * A structure representing the Container ID descriptor.
- * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.
- * All multiple-byte fields, except UUIDs, are represented in host-endian format.
- */
-struct libusb_container_id_descriptor {
- /** Size of this descriptor (in bytes) */
- uint8_t bLength;
-
- /** Descriptor type. Will have value
- * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
- * LIBUSB_DT_DEVICE_CAPABILITY in this context. */
- uint8_t bDescriptorType;
-
- /** Capability type. Will have value
- * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID
- * LIBUSB_BT_CONTAINER_ID in this context. */
- uint8_t bDevCapabilityType;
-
- /** Reserved field */
- uint8_t bReserved;
-
- /** 128 bit UUID */
- uint8_t ContainerID[16];
-};
-
-/** \ingroup asyncio
- * Setup packet for control transfers. */
-struct libusb_control_setup {
- /** Request type. Bits 0:4 determine recipient, see
- * \ref libusb_request_recipient. Bits 5:6 determine type, see
- * \ref libusb_request_type. Bit 7 determines data transfer direction, see
- * \ref libusb_endpoint_direction.
- */
- uint8_t bmRequestType;
-
- /** Request. If the type bits of bmRequestType are equal to
- * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
- * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to
- * \ref libusb_standard_request. For other cases, use of this field is
- * application-specific. */
- uint8_t bRequest;
-
- /** Value. Varies according to request */
- uint16_t wValue;
-
- /** Index. Varies according to request, typically used to pass an index
- * or offset */
- uint16_t wIndex;
-
- /** Number of bytes to transfer */
- uint16_t wLength;
-};
-
-#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
-
-/* libusbx */
-
-struct libusb_context;
-struct libusb_device;
-struct libusb_device_handle;
-struct libusb_hotplug_callback;
-
-/** \ingroup lib
- * Structure providing the version of the libusbx runtime
- */
-struct libusb_version {
- /** Library major version. */
- const uint16_t major;
-
- /** Library minor version. */
- const uint16_t minor;
-
- /** Library micro version. */
- const uint16_t micro;
-
- /** Library nano version. */
- const uint16_t nano;
-
- /** Library release candidate suffix string, e.g. "-rc4". */
- const char *rc;
-
- /** For ABI compatibility only. */
- const char* describe;
-};
-
-/** \ingroup lib
- * Structure representing a libusbx session. The concept of individual libusbx
- * sessions allows for your program to use two libraries (or dynamically
- * load two modules) which both independently use libusb. This will prevent
- * interference between the individual libusbx users - for example
- * libusb_set_debug() will not affect the other user of the library, and
- * libusb_exit() will not destroy resources that the other user is still
- * using.
- *
- * Sessions are created by libusb_init() and destroyed through libusb_exit().
- * If your application is guaranteed to only ever include a single libusbx
- * user (i.e. you), you do not have to worry about contexts: pass NULL in
- * every function call where a context is required. The default context
- * will be used.
- *
- * For more information, see \ref contexts.
- */
-typedef struct libusb_context libusb_context;
-
-/** \ingroup dev
- * Structure representing a USB device detected on the system. This is an
- * opaque type for which you are only ever provided with a pointer, usually
- * originating from libusb_get_device_list().
- *
- * Certain operations can be performed on a device, but in order to do any
- * I/O you will have to first obtain a device handle using libusb_open().
- *
- * Devices are reference counted with libusb_ref_device() and
- * libusb_unref_device(), and are freed when the reference count reaches 0.
- * New devices presented by libusb_get_device_list() have a reference count of
- * 1, and libusb_free_device_list() can optionally decrease the reference count
- * on all devices in the list. libusb_open() adds another reference which is
- * later destroyed by libusb_close().
- */
-typedef struct libusb_device libusb_device;
-
-
-/** \ingroup dev
- * Structure representing a handle on a USB device. This is an opaque type for
- * which you are only ever provided with a pointer, usually originating from
- * libusb_open().
- *
- * A device handle is used to perform I/O and other operations. When finished
- * with a device handle, you should call libusb_close().
- */
-typedef struct libusb_device_handle libusb_device_handle;
-
-/** \ingroup dev
- * Speed codes. Indicates the speed at which the device is operating.
- */
-enum libusb_speed {
- /** The OS doesn't report or know the device speed. */
- LIBUSB_SPEED_UNKNOWN = 0,
-
- /** The device is operating at low speed (1.5MBit/s). */
- LIBUSB_SPEED_LOW = 1,
-
- /** The device is operating at full speed (12MBit/s). */
- LIBUSB_SPEED_FULL = 2,
-
- /** The device is operating at high speed (480MBit/s). */
- LIBUSB_SPEED_HIGH = 3,
-
- /** The device is operating at super speed (5000MBit/s). */
- LIBUSB_SPEED_SUPER = 4,
-};
-
-/** \ingroup dev
- * Supported speeds (wSpeedSupported) bitfield. Indicates what
- * speeds the device supports.
- */
-enum libusb_supported_speed {
- /** Low speed operation supported (1.5MBit/s). */
- LIBUSB_LOW_SPEED_OPERATION = 1,
-
- /** Full speed operation supported (12MBit/s). */
- LIBUSB_FULL_SPEED_OPERATION = 2,
-
- /** High speed operation supported (480MBit/s). */
- LIBUSB_HIGH_SPEED_OPERATION = 4,
-
- /** Superspeed operation supported (5000MBit/s). */
- LIBUSB_SUPER_SPEED_OPERATION = 8,
-};
-
-/** \ingroup dev
- * Masks for the bits of the
- * \ref libusb_usb_2_0_extension_descriptor::bmAttributes "bmAttributes" field
- * of the USB 2.0 Extension descriptor.
- */
-enum libusb_usb_2_0_extension_attributes {
- /** Supports Link Power Management (LPM) */
- LIBUSB_BM_LPM_SUPPORT = 2,
-};
-
-/** \ingroup dev
- * Masks for the bits of the
- * \ref libusb_ss_usb_device_capability_descriptor::bmAttributes "bmAttributes" field
- * field of the SuperSpeed USB Device Capability descriptor.
- */
-enum libusb_ss_usb_device_capability_attributes {
- /** Supports Latency Tolerance Messages (LTM) */
- LIBUSB_BM_LTM_SUPPORT = 2,
-};
-
-/** \ingroup dev
- * USB capability types
- */
-enum libusb_bos_type {
- /** Wireless USB device capability */
- LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1,
-
- /** USB 2.0 extensions */
- LIBUSB_BT_USB_2_0_EXTENSION = 2,
-
- /** SuperSpeed USB device capability */
- LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3,
-
- /** Container ID type */
- LIBUSB_BT_CONTAINER_ID = 4,
-};
-
-/** \ingroup misc
- * Error codes. Most libusbx functions return 0 on success or one of these
- * codes on failure.
- * You can call libusb_error_name() to retrieve a string representation of an
- * error code or libusb_strerror() to get an end-user suitable description of
- * an error code.
- */
-enum libusb_error {
- /** Success (no error) */
- LIBUSB_SUCCESS = 0,
-
- /** Input/output error */
- LIBUSB_ERROR_IO = -1,
-
- /** Invalid parameter */
- LIBUSB_ERROR_INVALID_PARAM = -2,
-
- /** Access denied (insufficient permissions) */
- LIBUSB_ERROR_ACCESS = -3,
-
- /** No such device (it may have been disconnected) */
- LIBUSB_ERROR_NO_DEVICE = -4,
-
- /** Entity not found */
- LIBUSB_ERROR_NOT_FOUND = -5,
-
- /** Resource busy */
- LIBUSB_ERROR_BUSY = -6,
-
- /** Operation timed out */
- LIBUSB_ERROR_TIMEOUT = -7,
-
- /** Overflow */
- LIBUSB_ERROR_OVERFLOW = -8,
-
- /** Pipe error */
- LIBUSB_ERROR_PIPE = -9,
-
- /** System call interrupted (perhaps due to signal) */
- LIBUSB_ERROR_INTERRUPTED = -10,
-
- /** Insufficient memory */
- LIBUSB_ERROR_NO_MEM = -11,
-
- /** Operation not supported or unimplemented on this platform */
- LIBUSB_ERROR_NOT_SUPPORTED = -12,
-
- /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the
- message strings in strerror.c when adding new error codes here. */
-
- /** Other error */
- LIBUSB_ERROR_OTHER = -99,
-};
-
-/* Total number of error codes in enum libusb_error */
-#define LIBUSB_ERROR_COUNT 14
-
-/** \ingroup asyncio
- * Transfer status codes */
-enum libusb_transfer_status {
- /** Transfer completed without error. Note that this does not indicate
- * that the entire amount of requested data was transferred. */
- LIBUSB_TRANSFER_COMPLETED,
-
- /** Transfer failed */
- LIBUSB_TRANSFER_ERROR,
-
- /** Transfer timed out */
- LIBUSB_TRANSFER_TIMED_OUT,
-
- /** Transfer was cancelled */
- LIBUSB_TRANSFER_CANCELLED,
-
- /** For bulk/interrupt endpoints: halt condition detected (endpoint
- * stalled). For control endpoints: control request not supported. */
- LIBUSB_TRANSFER_STALL,
-
- /** Device was disconnected */
- LIBUSB_TRANSFER_NO_DEVICE,
-
- /** Device sent more data than requested */
- LIBUSB_TRANSFER_OVERFLOW,
-
- /* NB! Remember to update libusb_error_name()
- when adding new status codes here. */
-};
-
-/** \ingroup asyncio
- * libusb_transfer.flags values */
-enum libusb_transfer_flags {
- /** Report short frames as errors */
- LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0,
-
- /** Automatically free() transfer buffer during libusb_free_transfer() */
- LIBUSB_TRANSFER_FREE_BUFFER = 1<<1,
-
- /** Automatically call libusb_free_transfer() after callback returns.
- * If this flag is set, it is illegal to call libusb_free_transfer()
- * from your transfer callback, as this will result in a double-free
- * when this flag is acted upon. */
- LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2,
-
- /** Terminate transfers that are a multiple of the endpoint's
- * wMaxPacketSize with an extra zero length packet. This is useful
- * when a device protocol mandates that each logical request is
- * terminated by an incomplete packet (i.e. the logical requests are
- * not separated by other means).
- *
- * This flag only affects host-to-device transfers to bulk and interrupt
- * endpoints. In other situations, it is ignored.
- *
- * This flag only affects transfers with a length that is a multiple of
- * the endpoint's wMaxPacketSize. On transfers of other lengths, this
- * flag has no effect. Therefore, if you are working with a device that
- * needs a ZLP whenever the end of the logical request falls on a packet
- * boundary, then it is sensible to set this flag on <em>every</em>
- * transfer (you do not have to worry about only setting it on transfers
- * that end on the boundary).
- *
- * This flag is currently only supported on Linux.
- * On other systems, libusb_submit_transfer() will return
- * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set.
- *
- * Available since libusb-1.0.9.
- */
- LIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3,
-};
-
-/** \ingroup asyncio
- * Isochronous packet descriptor. */
-struct libusb_iso_packet_descriptor {
- /** Length of data to request in this packet */
- unsigned int length;
-
- /** Amount of data that was actually transferred */
- unsigned int actual_length;
-
- /** Status code for this packet */
- enum libusb_transfer_status status;
-};
-
-struct libusb_transfer;
-
-/** \ingroup asyncio
- * Asynchronous transfer callback function type. When submitting asynchronous
- * transfers, you pass a pointer to a callback function of this type via the
- * \ref libusb_transfer::callback "callback" member of the libusb_transfer
- * structure. libusbx will call this function later, when the transfer has
- * completed or failed. See \ref asyncio for more information.
- * \param transfer The libusb_transfer struct the callback function is being
- * notified about.
- */
-typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);
-
-/** \ingroup asyncio
- * The generic USB transfer structure. The user populates this structure and
- * then submits it in order to request a transfer. After the transfer has
- * completed, the library populates the transfer with the results and passes
- * it back to the user.
- */
-struct libusb_transfer {
- /** Handle of the device that this transfer will be submitted to */
- libusb_device_handle *dev_handle;
-
- /** A bitwise OR combination of \ref libusb_transfer_flags. */
- uint8_t flags;
-
- /** Address of the endpoint where this transfer will be sent. */
- unsigned char endpoint;
-
- /** Type of the endpoint from \ref libusb_transfer_type */
- unsigned char type;
-
- /** Timeout for this transfer in millseconds. A value of 0 indicates no
- * timeout. */
- unsigned int timeout;
-
- /** The status of the transfer. Read-only, and only for use within
- * transfer callback function.
- *
- * If this is an isochronous transfer, this field may read COMPLETED even
- * if there were errors in the frames. Use the
- * \ref libusb_iso_packet_descriptor::status "status" field in each packet
- * to determine if errors occurred. */
- enum libusb_transfer_status status;
-
- /** Length of the data buffer */
- int length;
-
- /** Actual length of data that was transferred. Read-only, and only for
- * use within transfer callback function. Not valid for isochronous
- * endpoint transfers. */
- int actual_length;
-
- /** Callback function. This will be invoked when the transfer completes,
- * fails, or is cancelled. */
- libusb_transfer_cb_fn callback;
-
- /** User context data to pass to the callback function. */
- void *user_data;
-
- /** Data buffer */
- unsigned char *buffer;
-
- /** Number of isochronous packets. Only used for I/O with isochronous
- * endpoints. */
- int num_iso_packets;
-
- /** Isochronous packet descriptors, for isochronous transfers only. */
- struct libusb_iso_packet_descriptor iso_packet_desc
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-/** \ingroup misc
- * Capabilities supported by an instance of libusb on the current running
- * platform. Test if the loaded library supports a given capability by calling
- * \ref libusb_has_capability().
- */
-enum libusb_capability {
- /** The libusb_has_capability() API is available. */
- LIBUSB_CAP_HAS_CAPABILITY = 0x0000,
- /** Hotplug support is available on this platform. */
- LIBUSB_CAP_HAS_HOTPLUG = 0x0001,
- /** The library can access HID devices without requiring user intervention.
- * Note that before being able to actually access an HID device, you may
- * still have to call additional libusbx functions such as
- * \ref libusb_detach_kernel_driver(). */
- LIBUSB_CAP_HAS_HID_ACCESS = 0x0100,
- /** The library supports detaching of the default USB driver, using
- * \ref libusb_detach_kernel_driver(), if one is set by the OS kernel */
- LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101
-};
-
-/** \ingroup lib
- * Log message levels.
- * - LIBUSB_LOG_LEVEL_NONE (0) : no messages ever printed by the library (default)
- * - LIBUSB_LOG_LEVEL_ERROR (1) : error messages are printed to stderr
- * - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr
- * - LIBUSB_LOG_LEVEL_INFO (3) : informational messages are printed to stdout, warning
- * and error messages are printed to stderr
- * - LIBUSB_LOG_LEVEL_DEBUG (4) : debug and informational messages are printed to stdout,
- * warnings and errors to stderr
- */
-enum libusb_log_level {
- LIBUSB_LOG_LEVEL_NONE = 0,
- LIBUSB_LOG_LEVEL_ERROR,
- LIBUSB_LOG_LEVEL_WARNING,
- LIBUSB_LOG_LEVEL_INFO,
- LIBUSB_LOG_LEVEL_DEBUG,
-};
-
-int LIBUSB_CALL libusb_init(libusb_context **ctx);
-void LIBUSB_CALL libusb_exit(libusb_context *ctx);
-void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
-const struct libusb_version * LIBUSB_CALL libusb_get_version(void);
-int LIBUSB_CALL libusb_has_capability(uint32_t capability);
-const char * LIBUSB_CALL libusb_error_name(int errcode);
-int LIBUSB_CALL libusb_setlocale(const char *locale);
-const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode);
-
-ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx,
- libusb_device ***list);
-void LIBUSB_CALL libusb_free_device_list(libusb_device **list,
- int unref_devices);
-libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev);
-void LIBUSB_CALL libusb_unref_device(libusb_device *dev);
-
-int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev,
- int *config);
-int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev,
- struct libusb_device_descriptor *desc);
-int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev,
- struct libusb_config_descriptor **config);
-int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev,
- uint8_t config_index, struct libusb_config_descriptor **config);
-int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev,
- uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
-void LIBUSB_CALL libusb_free_config_descriptor(
- struct libusb_config_descriptor *config);
-int LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor(
- struct libusb_context *ctx,
- const struct libusb_endpoint_descriptor *endpoint,
- struct libusb_ss_endpoint_companion_descriptor **ep_comp);
-void LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor(
- struct libusb_ss_endpoint_companion_descriptor *ep_comp);
-int LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *handle,
- struct libusb_bos_descriptor **bos);
-void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos);
-int LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor(
- struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension);
-void LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor(
- struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension);
-int LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor(
- struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap);
-void LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor(
- struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap);
-int LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx,
- struct libusb_bos_dev_capability_descriptor *dev_cap,
- struct libusb_container_id_descriptor **container_id);
-void LIBUSB_CALL libusb_free_container_id_descriptor(
- struct libusb_container_id_descriptor *container_id);
-uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev);
-uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev);
-int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len);
-LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)
-int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length);
-libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev);
-uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev);
-int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev);
-int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev,
- unsigned char endpoint);
-int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev,
- unsigned char endpoint);
-
-int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle);
-void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle);
-libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle);
-
-int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev,
- int configuration);
-int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev,
- int interface_number);
-int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev,
- int interface_number);
-
-libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(
- libusb_context *ctx, uint16_t vendor_id, uint16_t product_id);
-
-int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev,
- int interface_number, int alternate_setting);
-int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev,
- unsigned char endpoint);
-int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev);
-
-int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev,
- int interface_number);
-int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev,
- int interface_number);
-int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev,
- int interface_number);
-int LIBUSB_CALL libusb_set_auto_detach_kernel_driver(
- libusb_device_handle *dev, int enable);
-
-/* async I/O */
-
-/** \ingroup asyncio
- * Get the data section of a control transfer. This convenience function is here
- * to remind you that the data does not start until 8 bytes into the actual
- * buffer, as the setup packet comes first.
- *
- * Calling this function only makes sense from a transfer callback function,
- * or situations where you have already allocated a suitably sized buffer at
- * transfer->buffer.
- *
- * \param transfer a transfer
- * \returns pointer to the first byte of the data section
- */
-static inline unsigned char *libusb_control_transfer_get_data(
- struct libusb_transfer *transfer)
-{
- return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
-}
-
-/** \ingroup asyncio
- * Get the control setup packet of a control transfer. This convenience
- * function is here to remind you that the control setup occupies the first
- * 8 bytes of the transfer data buffer.
- *
- * Calling this function only makes sense from a transfer callback function,
- * or situations where you have already allocated a suitably sized buffer at
- * transfer->buffer.
- *
- * \param transfer a transfer
- * \returns a casted pointer to the start of the transfer data buffer
- */
-static inline struct libusb_control_setup *libusb_control_transfer_get_setup(
- struct libusb_transfer *transfer)
-{
- return (struct libusb_control_setup *) transfer->buffer;
-}
-
-/** \ingroup asyncio
- * Helper function to populate the setup packet (first 8 bytes of the data
- * buffer) for a control transfer. The wIndex, wValue and wLength values should
- * be given in host-endian byte order.
- *
- * \param buffer buffer to output the setup packet into
- * \param bmRequestType see the
- * \ref libusb_control_setup::bmRequestType "bmRequestType" field of
- * \ref libusb_control_setup
- * \param bRequest see the
- * \ref libusb_control_setup::bRequest "bRequest" field of
- * \ref libusb_control_setup
- * \param wValue see the
- * \ref libusb_control_setup::wValue "wValue" field of
- * \ref libusb_control_setup
- * \param wIndex see the
- * \ref libusb_control_setup::wIndex "wIndex" field of
- * \ref libusb_control_setup
- * \param wLength see the
- * \ref libusb_control_setup::wLength "wLength" field of
- * \ref libusb_control_setup
- */
-static inline void libusb_fill_control_setup(unsigned char *buffer,
- uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
- uint16_t wLength)
-{
- struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
- setup->bmRequestType = bmRequestType;
- setup->bRequest = bRequest;
- setup->wValue = libusb_cpu_to_le16(wValue);
- setup->wIndex = libusb_cpu_to_le16(wIndex);
- setup->wLength = libusb_cpu_to_le16(wLength);
-}
-
-struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets);
-int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer);
-int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer);
-void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer);
-
-/** \ingroup asyncio
- * Helper function to populate the required \ref libusb_transfer fields
- * for a control transfer.
- *
- * If you pass a transfer buffer to this function, the first 8 bytes will
- * be interpreted as a control setup packet, and the wLength field will be
- * used to automatically populate the \ref libusb_transfer::length "length"
- * field of the transfer. Therefore the recommended approach is:
- * -# Allocate a suitably sized data buffer (including space for control setup)
- * -# Call libusb_fill_control_setup()
- * -# If this is a host-to-device transfer with a data stage, put the data
- * in place after the setup packet
- * -# Call this function
- * -# Call libusb_submit_transfer()
- *
- * It is also legal to pass a NULL buffer to this function, in which case this
- * function will not attempt to populate the length field. Remember that you
- * must then populate the buffer and length fields later.
- *
- * \param transfer the transfer to populate
- * \param dev_handle handle of the device that will handle the transfer
- * \param buffer data buffer. If provided, this function will interpret the
- * first 8 bytes as a setup packet and infer the transfer length from that.
- * \param callback callback function to be invoked on transfer completion
- * \param user_data user data to pass to callback function
- * \param timeout timeout for the transfer in milliseconds
- */
-static inline void libusb_fill_control_transfer(
- struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
- unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,
- unsigned int timeout)
-{
- struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
- transfer->dev_handle = dev_handle;
- transfer->endpoint = 0;
- transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;
- transfer->timeout = timeout;
- transfer->buffer = buffer;
- if (setup)
- transfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE
- + libusb_le16_to_cpu(setup->wLength));
- transfer->user_data = user_data;
- transfer->callback = callback;
-}
-
-/** \ingroup asyncio
- * Helper function to populate the required \ref libusb_transfer fields
- * for a bulk transfer.
- *
- * \param transfer the transfer to populate
- * \param dev_handle handle of the device that will handle the transfer
- * \param endpoint address of the endpoint where this transfer will be sent
- * \param buffer data buffer
- * \param length length of data buffer
- * \param callback callback function to be invoked on transfer completion
- * \param user_data user data to pass to callback function
- * \param timeout timeout for the transfer in milliseconds
- */
-static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
- libusb_device_handle *dev_handle, unsigned char endpoint,
- unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
- void *user_data, unsigned int timeout)
-{
- transfer->dev_handle = dev_handle;
- transfer->endpoint = endpoint;
- transfer->type = LIBUSB_TRANSFER_TYPE_BULK;
- transfer->timeout = timeout;
- transfer->buffer = buffer;
- transfer->length = length;
- transfer->user_data = user_data;
- transfer->callback = callback;
-}
-
-/** \ingroup asyncio
- * Helper function to populate the required \ref libusb_transfer fields
- * for an interrupt transfer.
- *
- * \param transfer the transfer to populate
- * \param dev_handle handle of the device that will handle the transfer
- * \param endpoint address of the endpoint where this transfer will be sent
- * \param buffer data buffer
- * \param length length of data buffer
- * \param callback callback function to be invoked on transfer completion
- * \param user_data user data to pass to callback function
- * \param timeout timeout for the transfer in milliseconds
- */
-static inline void libusb_fill_interrupt_transfer(
- struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
- unsigned char endpoint, unsigned char *buffer, int length,
- libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
-{
- transfer->dev_handle = dev_handle;
- transfer->endpoint = endpoint;
- transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT;
- transfer->timeout = timeout;
- transfer->buffer = buffer;
- transfer->length = length;
- transfer->user_data = user_data;
- transfer->callback = callback;
-}
-
-/** \ingroup asyncio
- * Helper function to populate the required \ref libusb_transfer fields
- * for an isochronous transfer.
- *
- * \param transfer the transfer to populate
- * \param dev_handle handle of the device that will handle the transfer
- * \param endpoint address of the endpoint where this transfer will be sent
- * \param buffer data buffer
- * \param length length of data buffer
- * \param num_iso_packets the number of isochronous packets
- * \param callback callback function to be invoked on transfer completion
- * \param user_data user data to pass to callback function
- * \param timeout timeout for the transfer in milliseconds
- */
-static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer,
- libusb_device_handle *dev_handle, unsigned char endpoint,
- unsigned char *buffer, int length, int num_iso_packets,
- libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
-{
- transfer->dev_handle = dev_handle;
- transfer->endpoint = endpoint;
- transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;
- transfer->timeout = timeout;
- transfer->buffer = buffer;
- transfer->length = length;
- transfer->num_iso_packets = num_iso_packets;
- transfer->user_data = user_data;
- transfer->callback = callback;
-}
-
-/** \ingroup asyncio
- * Convenience function to set the length of all packets in an isochronous
- * transfer, based on the num_iso_packets field in the transfer structure.
- *
- * \param transfer a transfer
- * \param length the length to set in each isochronous packet descriptor
- * \see libusb_get_max_packet_size()
- */
-static inline void libusb_set_iso_packet_lengths(
- struct libusb_transfer *transfer, unsigned int length)
-{
- int i;
- for (i = 0; i < transfer->num_iso_packets; i++)
- transfer->iso_packet_desc[i].length = length;
-}
-
-/** \ingroup asyncio
- * Convenience function to locate the position of an isochronous packet
- * within the buffer of an isochronous transfer.
- *
- * This is a thorough function which loops through all preceding packets,
- * accumulating their lengths to find the position of the specified packet.
- * Typically you will assign equal lengths to each packet in the transfer,
- * and hence the above method is sub-optimal. You may wish to use
- * libusb_get_iso_packet_buffer_simple() instead.
- *
- * \param transfer a transfer
- * \param packet the packet to return the address of
- * \returns the base address of the packet buffer inside the transfer buffer,
- * or NULL if the packet does not exist.
- * \see libusb_get_iso_packet_buffer_simple()
- */
-static inline unsigned char *libusb_get_iso_packet_buffer(
- struct libusb_transfer *transfer, unsigned int packet)
-{
- int i;
- size_t offset = 0;
- int _packet;
-
- /* oops..slight bug in the API. packet is an unsigned int, but we use
- * signed integers almost everywhere else. range-check and convert to
- * signed to avoid compiler warnings. FIXME for libusb-2. */
- if (packet > INT_MAX)
- return NULL;
- _packet = (int) packet;
-
- if (_packet >= transfer->num_iso_packets)
- return NULL;
-
- for (i = 0; i < _packet; i++)
- offset += transfer->iso_packet_desc[i].length;
-
- return transfer->buffer + offset;
-}
-
-/** \ingroup asyncio
- * Convenience function to locate the position of an isochronous packet
- * within the buffer of an isochronous transfer, for transfers where each
- * packet is of identical size.
- *
- * This function relies on the assumption that every packet within the transfer
- * is of identical size to the first packet. Calculating the location of
- * the packet buffer is then just a simple calculation:
- * <tt>buffer + (packet_size * packet)</tt>
- *
- * Do not use this function on transfers other than those that have identical
- * packet lengths for each packet.
- *
- * \param transfer a transfer
- * \param packet the packet to return the address of
- * \returns the base address of the packet buffer inside the transfer buffer,
- * or NULL if the packet does not exist.
- * \see libusb_get_iso_packet_buffer()
- */
-static inline unsigned char *libusb_get_iso_packet_buffer_simple(
- struct libusb_transfer *transfer, unsigned int packet)
-{
- int _packet;
-
- /* oops..slight bug in the API. packet is an unsigned int, but we use
- * signed integers almost everywhere else. range-check and convert to
- * signed to avoid compiler warnings. FIXME for libusb-2. */
- if (packet > INT_MAX)
- return NULL;
- _packet = (int) packet;
-
- if (_packet >= transfer->num_iso_packets)
- return NULL;
-
- return transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet);
-}
-
-/* sync I/O */
-
-int LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle,
- uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
- unsigned char *data, uint16_t wLength, unsigned int timeout);
-
-int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle,
- unsigned char endpoint, unsigned char *data, int length,
- int *actual_length, unsigned int timeout);
-
-int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle,
- unsigned char endpoint, unsigned char *data, int length,
- int *actual_length, unsigned int timeout);
-
-/** \ingroup desc
- * Retrieve a descriptor from the default control pipe.
- * This is a convenience function which formulates the appropriate control
- * message to retrieve the descriptor.
- *
- * \param dev a device handle
- * \param desc_type the descriptor type, see \ref libusb_descriptor_type
- * \param desc_index the index of the descriptor to retrieve
- * \param data output buffer for descriptor
- * \param length size of data buffer
- * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
- */
-static inline int libusb_get_descriptor(libusb_device_handle *dev,
- uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
-{
- return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
- LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),
- 0, data, (uint16_t) length, 1000);
-}
-
-/** \ingroup desc
- * Retrieve a descriptor from a device.
- * This is a convenience function which formulates the appropriate control
- * message to retrieve the descriptor. The string returned is Unicode, as
- * detailed in the USB specifications.
- *
- * \param dev a device handle
- * \param desc_index the index of the descriptor to retrieve
- * \param langid the language ID for the string descriptor
- * \param data output buffer for descriptor
- * \param length size of data buffer
- * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
- * \see libusb_get_string_descriptor_ascii()
- */
-static inline int libusb_get_string_descriptor(libusb_device_handle *dev,
- uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
-{
- return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
- LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index),
- langid, data, (uint16_t) length, 1000);
-}
-
-int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev,
- uint8_t desc_index, unsigned char *data, int length);
-
-/* polling and timeouts */
-
-int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx);
-void LIBUSB_CALL libusb_lock_events(libusb_context *ctx);
-void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx);
-int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx);
-int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx);
-void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx);
-void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx);
-int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv);
-
-int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx,
- struct timeval *tv);
-int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx,
- struct timeval *tv, int *completed);
-int LIBUSB_CALL libusb_handle_events(libusb_context *ctx);
-int LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed);
-int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx,
- struct timeval *tv);
-int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx);
-int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx,
- struct timeval *tv);
-
-/** \ingroup poll
- * File descriptor for polling
- */
-struct libusb_pollfd {
- /** Numeric file descriptor */
- int fd;
-
- /** Event flags to poll for from <poll.h>. POLLIN indicates that you
- * should monitor this file descriptor for becoming ready to read from,
- * and POLLOUT indicates that you should monitor this file descriptor for
- * nonblocking write readiness. */
- short events;
-};
-
-/** \ingroup poll
- * Callback function, invoked when a new file descriptor should be added
- * to the set of file descriptors monitored for events.
- * \param fd the new file descriptor
- * \param events events to monitor for, see \ref libusb_pollfd for a
- * description
- * \param user_data User data pointer specified in
- * libusb_set_pollfd_notifiers() call
- * \see libusb_set_pollfd_notifiers()
- */
-typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events,
- void *user_data);
-
-/** \ingroup poll
- * Callback function, invoked when a file descriptor should be removed from
- * the set of file descriptors being monitored for events. After returning
- * from this callback, do not use that file descriptor again.
- * \param fd the file descriptor to stop monitoring
- * \param user_data User data pointer specified in
- * libusb_set_pollfd_notifiers() call
- * \see libusb_set_pollfd_notifiers()
- */
-typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data);
-
-const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(
- libusb_context *ctx);
-void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx,
- libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,
- void *user_data);
-
-/** \ingroup hotplug
- * Callback handle.
- *
- * Callbacks handles are generated by libusb_hotplug_register_callback()
- * and can be used to deregister callbacks. Callback handles are unique
- * per libusb_context and it is safe to call libusb_hotplug_deregister_callback()
- * on an already deregisted callback.
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * For more information, see \ref hotplug.
- */
-typedef int libusb_hotplug_callback_handle;
-
-/** \ingroup hotplug
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * Flags for hotplug events */
-typedef enum {
- /** Arm the callback and fire it for all matching currently attached devices. */
- LIBUSB_HOTPLUG_ENUMERATE = 1,
-} libusb_hotplug_flag;
-
-/** \ingroup hotplug
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * Hotplug events */
-typedef enum {
- /** A device has been plugged in and is ready to use */
- LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 0x01,
-
- /** A device has left and is no longer available.
- * It is the user's responsibility to call libusb_close on any handle associated with a disconnected device.
- * It is safe to call libusb_get_device_descriptor on a device that has left */
- LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 0x02,
-} libusb_hotplug_event;
-
-/** \ingroup hotplug
- * Wildcard matching for hotplug events */
-#define LIBUSB_HOTPLUG_MATCH_ANY -1
-
-/** \ingroup hotplug
- * Hotplug callback function type. When requesting hotplug event notifications,
- * you pass a pointer to a callback function of this type.
- *
- * This callback may be called by an internal event thread and as such it is
- * recommended the callback do minimal processing before returning.
- *
- * libusbx will call this function later, when a matching event had happened on
- * a matching device. See \ref hotplug for more information.
- *
- * It is safe to call either libusb_hotplug_register_callback() or
- * libusb_hotplug_deregister_callback() from within a callback function.
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * \param libusb_context context of this notification
- * \param device libusb_device this event occurred on
- * \param event event that occurred
- * \param user_data user data provided when this callback was registered
- * \returns bool whether this callback is finished processing events.
- * returning 1 will cause this callback to be deregistered
- */
-typedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx,
- libusb_device *device,
- libusb_hotplug_event event,
- void *user_data);
-
-/** \ingroup hotplug
- * Register a hotplug callback function
- *
- * Register a callback with the libusb_context. The callback will fire
- * when a matching event occurs on a matching device. The callback is
- * armed until either it is deregistered with libusb_hotplug_deregister_callback()
- * or the supplied callback returns 1 to indicate it is finished processing events.
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * \param[in] ctx context to register this callback with
- * \param[in] events bitwise or of events that will trigger this callback. See \ref
- * libusb_hotplug_event
- * \param[in] flags hotplug callback flags. See \ref libusb_hotplug_flag
- * \param[in] vendor_id the vendor id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
- * \param[in] product_id the product id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
- * \param[in] dev_class the device class to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
- * \param[in] cb_fn the function to be invoked on a matching event/device
- * \param[in] user_data user data to pass to the callback function
- * \param[out] handle pointer to store the handle of the allocated callback (can be NULL)
- * \returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure
- */
-int LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx,
- libusb_hotplug_event events,
- libusb_hotplug_flag flags,
- int vendor_id, int product_id,
- int dev_class,
- libusb_hotplug_callback_fn cb_fn,
- void *user_data,
- libusb_hotplug_callback_handle *handle);
-
-/** \ingroup hotplug
- * Deregisters a hotplug callback.
- *
- * Deregister a callback from a libusb_context. This function is safe to call from within
- * a hotplug callback.
- *
- * Since version 1.0.16, \ref LIBUSBX_API_VERSION >= 0x01000102
- *
- * \param[in] ctx context this callback is registered with
- * \param[in] handle the handle of the callback to deregister
- */
-void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx,
- libusb_hotplug_callback_handle handle);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/libusbi.h b/src/3rd_party-static/libusbx-1.0.16/libusb/libusbi.h
deleted file mode 100644
index 02efae300d..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/libusbi.h
+++ /dev/null
@@ -1,1004 +0,0 @@
-/*
- * Internal header for libusbx
- * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBUSBI_H
-#define LIBUSBI_H
-
-#include "config.h"
-
-#include <stddef.h>
-#include <stdint.h>
-#include <time.h>
-#include <stdarg.h>
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#endif
-
-#ifdef HAVE_MISSING_H
-#include "missing.h"
-#endif
-#include "libusb.h"
-#include "version.h"
-
-/* Inside the libusbx code, mark all public functions as follows:
- * return_type API_EXPORTED function_name(params) { ... }
- * But if the function returns a pointer, mark it as follows:
- * DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... }
- * In the libusbx public header, mark all declarations as:
- * return_type LIBUSB_CALL function_name(params);
- */
-#define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY
-
-#define DEVICE_DESC_LENGTH 18
-
-#define USB_MAXENDPOINTS 32
-#define USB_MAXINTERFACES 32
-#define USB_MAXCONFIG 8
-
-/* Backend specific capabilities */
-#define USBI_CAP_HAS_HID_ACCESS 0x00010000
-#define USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER 0x00020000
-
-/* Maximum number of bytes in a log line */
-#define USBI_MAX_LOG_LEN 1024
-/* Terminator for log lines */
-#define USBI_LOG_LINE_END "\n"
-
-/* The following is used to silence warnings for unused variables */
-#define UNUSED(var) do { (void)(var); } while(0)
-
-#if !defined(ARRAYSIZE)
-#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
-#endif
-
-struct list_head {
- struct list_head *prev, *next;
-};
-
-/* Get an entry from the list
- * ptr - the address of this list_head element in "type"
- * type - the data type that contains "member"
- * member - the list_head element in "type"
- */
-#define list_entry(ptr, type, member) \
- ((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))
-
-/* Get each entry from a list
- * pos - A structure pointer has a "member" element
- * head - list head
- * member - the list_head element in "pos"
- * type - the type of the first parameter
- */
-#define list_for_each_entry(pos, head, member, type) \
- for (pos = list_entry((head)->next, type, member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.next, type, member))
-
-#define list_for_each_entry_safe(pos, n, head, member, type) \
- for (pos = list_entry((head)->next, type, member), \
- n = list_entry(pos->member.next, type, member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, type, member))
-
-#define list_empty(entry) ((entry)->next == (entry))
-
-static inline void list_init(struct list_head *entry)
-{
- entry->prev = entry->next = entry;
-}
-
-static inline void list_add(struct list_head *entry, struct list_head *head)
-{
- entry->next = head->next;
- entry->prev = head;
-
- head->next->prev = entry;
- head->next = entry;
-}
-
-static inline void list_add_tail(struct list_head *entry,
- struct list_head *head)
-{
- entry->next = head;
- entry->prev = head->prev;
-
- head->prev->next = entry;
- head->prev = entry;
-}
-
-static inline void list_del(struct list_head *entry)
-{
- entry->next->prev = entry->prev;
- entry->prev->next = entry->next;
- entry->next = entry->prev = NULL;
-}
-
-static inline void *usbi_reallocf(void *ptr, size_t size)
-{
- void *ret = realloc(ptr, size);
- if (!ret)
- free(ptr);
- return ret;
-}
-
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *mptr = (ptr); \
- (type *)( (char *)mptr - offsetof(type,member) );})
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
-#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)
-
-void usbi_log(struct libusb_context *ctx, enum libusb_log_level level,
- const char *function, const char *format, ...);
-
-void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
- const char *function, const char *format, va_list args);
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1400
-
-#ifdef ENABLE_LOGGING
-#define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__)
-#define usbi_dbg(...) _usbi_log(NULL, LIBUSB_LOG_LEVEL_DEBUG, __VA_ARGS__)
-#else
-#define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0)
-#define usbi_dbg(...) do {} while(0)
-#endif
-
-#define usbi_info(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_INFO, __VA_ARGS__)
-#define usbi_warn(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_WARNING, __VA_ARGS__)
-#define usbi_err(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_ERROR, __VA_ARGS__)
-
-#else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */
-
-#ifdef ENABLE_LOGGING
-#define LOG_BODY(ctxt, level) \
-{ \
- va_list args; \
- va_start (args, format); \
- usbi_log_v(ctxt, level, "", format, args); \
- va_end(args); \
-}
-#else
-#define LOG_BODY(ctxt, level) do { (void)(ctxt); } while(0)
-#endif
-
-static inline void usbi_info(struct libusb_context *ctx, const char *format,
- ...)
- LOG_BODY(ctx,LIBUSB_LOG_LEVEL_INFO)
-static inline void usbi_warn(struct libusb_context *ctx, const char *format,
- ...)
- LOG_BODY(ctx,LIBUSB_LOG_LEVEL_WARNING)
-static inline void usbi_err( struct libusb_context *ctx, const char *format,
- ...)
- LOG_BODY(ctx,LIBUSB_LOG_LEVEL_ERROR)
-
-static inline void usbi_dbg(const char *format, ...)
- LOG_BODY(NULL,LIBUSB_LOG_LEVEL_DEBUG)
-
-#endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */
-
-#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context
-#define DEVICE_CTX(dev) ((dev)->ctx)
-#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev))
-#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle))
-#define ITRANSFER_CTX(transfer) \
- (TRANSFER_CTX(USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)))
-
-#define IS_EPIN(ep) (0 != ((ep) & LIBUSB_ENDPOINT_IN))
-#define IS_EPOUT(ep) (!IS_EPIN(ep))
-#define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN))
-#define IS_XFEROUT(xfer) (!IS_XFERIN(xfer))
-
-/* Internal abstraction for thread synchronization */
-#if defined(THREADS_POSIX)
-#include "os/threads_posix.h"
-#elif defined(OS_WINDOWS) || defined(OS_WINCE)
-#include <os/threads_windows.h>
-#endif
-
-extern struct libusb_context *usbi_default_context;
-
-struct libusb_context {
- int debug;
- int debug_fixed;
-
- /* internal control pipe, used for interrupting event handling when
- * something needs to modify poll fds. */
- int ctrl_pipe[2];
-
- struct list_head usb_devs;
- usbi_mutex_t usb_devs_lock;
-
- /* A list of open handles. Backends are free to traverse this if required.
- */
- struct list_head open_devs;
- usbi_mutex_t open_devs_lock;
-
- /* A list of registered hotplug callbacks */
- struct list_head hotplug_cbs;
- usbi_mutex_t hotplug_cbs_lock;
- int hotplug_pipe[2];
-
- /* this is a list of in-flight transfer handles, sorted by timeout
- * expiration. URBs to timeout the soonest are placed at the beginning of
- * the list, URBs that will time out later are placed after, and urbs with
- * infinite timeout are always placed at the very end. */
- struct list_head flying_transfers;
- usbi_mutex_t flying_transfers_lock;
-
- /* list of poll fds */
- struct list_head pollfds;
- usbi_mutex_t pollfds_lock;
-
- /* a counter that is set when we want to interrupt event handling, in order
- * to modify the poll fd set. and a lock to protect it. */
- unsigned int pollfd_modify;
- usbi_mutex_t pollfd_modify_lock;
-
- /* user callbacks for pollfd changes */
- libusb_pollfd_added_cb fd_added_cb;
- libusb_pollfd_removed_cb fd_removed_cb;
- void *fd_cb_user_data;
-
- /* ensures that only one thread is handling events at any one time */
- usbi_mutex_t events_lock;
-
- /* used to see if there is an active thread doing event handling */
- int event_handler_active;
-
- /* used to wait for event completion in threads other than the one that is
- * event handling */
- usbi_mutex_t event_waiters_lock;
- usbi_cond_t event_waiters_cond;
-
-#ifdef USBI_TIMERFD_AVAILABLE
- /* used for timeout handling, if supported by OS.
- * this timerfd is maintained to trigger on the next pending timeout */
- int timerfd;
-#endif
-
- struct list_head list;
-};
-
-#ifdef USBI_TIMERFD_AVAILABLE
-#define usbi_using_timerfd(ctx) ((ctx)->timerfd >= 0)
-#else
-#define usbi_using_timerfd(ctx) (0)
-#endif
-
-struct libusb_device {
- /* lock protects refcnt, everything else is finalized at initialization
- * time */
- usbi_mutex_t lock;
- int refcnt;
-
- struct libusb_context *ctx;
-
- uint8_t bus_number;
- uint8_t port_number;
- struct libusb_device* parent_dev;
- uint8_t device_address;
- uint8_t num_configurations;
- enum libusb_speed speed;
-
- struct list_head list;
- unsigned long session_data;
-
- struct libusb_device_descriptor device_descriptor;
- int attached;
-
- unsigned char os_priv
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-struct libusb_device_handle {
- /* lock protects claimed_interfaces */
- usbi_mutex_t lock;
- unsigned long claimed_interfaces;
-
- struct list_head list;
- struct libusb_device *dev;
- int auto_detach_kernel_driver;
- unsigned char os_priv
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-enum {
- USBI_CLOCK_MONOTONIC,
- USBI_CLOCK_REALTIME
-};
-
-/* in-memory transfer layout:
- *
- * 1. struct usbi_transfer
- * 2. struct libusb_transfer (which includes iso packets) [variable size]
- * 3. os private data [variable size]
- *
- * from a libusb_transfer, you can get the usbi_transfer by rewinding the
- * appropriate number of bytes.
- * the usbi_transfer includes the number of allocated packets, so you can
- * determine the size of the transfer and hence the start and length of the
- * OS-private data.
- */
-
-struct usbi_transfer {
- int num_iso_packets;
- struct list_head list;
- struct timeval timeout;
- int transferred;
- uint8_t flags;
-
- /* this lock is held during libusb_submit_transfer() and
- * libusb_cancel_transfer() (allowing the OS backend to prevent duplicate
- * cancellation, submission-during-cancellation, etc). the OS backend
- * should also take this lock in the handle_events path, to prevent the user
- * cancelling the transfer from another thread while you are processing
- * its completion (presumably there would be races within your OS backend
- * if this were possible). */
- usbi_mutex_t lock;
-};
-
-enum usbi_transfer_flags {
- /* The transfer has timed out */
- USBI_TRANSFER_TIMED_OUT = 1 << 0,
-
- /* Set by backend submit_transfer() if the OS handles timeout */
- USBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 1,
-
- /* Cancellation was requested via libusb_cancel_transfer() */
- USBI_TRANSFER_CANCELLING = 1 << 2,
-
- /* Operation on the transfer failed because the device disappeared */
- USBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 3,
-
- /* Set by backend submit_transfer() if the fds in use have been updated */
- USBI_TRANSFER_UPDATED_FDS = 1 << 4,
-};
-
-#define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \
- ((struct libusb_transfer *)(((unsigned char *)(transfer)) \
- + sizeof(struct usbi_transfer)))
-#define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \
- ((struct usbi_transfer *)(((unsigned char *)(transfer)) \
- - sizeof(struct usbi_transfer)))
-
-static inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer)
-{
- return ((unsigned char *)transfer) + sizeof(struct usbi_transfer)
- + sizeof(struct libusb_transfer)
- + (transfer->num_iso_packets
- * sizeof(struct libusb_iso_packet_descriptor));
-}
-
-/* bus structures */
-
-/* All standard descriptors have these 2 fields in common */
-struct usb_descriptor_header {
- uint8_t bLength;
- uint8_t bDescriptorType;
-};
-
-/* shared data and functions */
-
-int usbi_io_init(struct libusb_context *ctx);
-void usbi_io_exit(struct libusb_context *ctx);
-
-struct libusb_device *usbi_alloc_device(struct libusb_context *ctx,
- unsigned long session_id);
-struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,
- unsigned long session_id);
-int usbi_sanitize_device(struct libusb_device *dev);
-void usbi_handle_disconnect(struct libusb_device_handle *handle);
-
-int usbi_handle_transfer_completion(struct usbi_transfer *itransfer,
- enum libusb_transfer_status status);
-int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer);
-
-int usbi_parse_descriptor(const unsigned char *source, const char *descriptor,
- void *dest, int host_endian);
-int usbi_device_cache_descriptor(libusb_device *dev);
-int usbi_get_config_index_by_value(struct libusb_device *dev,
- uint8_t bConfigurationValue, int *idx);
-
-void usbi_connect_device (struct libusb_device *dev);
-void usbi_disconnect_device (struct libusb_device *dev);
-
-/* Internal abstraction for poll (needs struct usbi_transfer on Windows) */
-#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD)
-#include <unistd.h>
-#include "os/poll_posix.h"
-#elif defined(OS_WINDOWS) || defined(OS_WINCE)
-#include "os/poll_windows.h"
-#endif
-
-#if (defined(OS_WINDOWS) || defined(OS_WINCE)) && !defined(__GNUC__)
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-int usbi_gettimeofday(struct timeval *tp, void *tzp);
-#define LIBUSB_GETTIMEOFDAY_WIN32
-#define HAVE_USBI_GETTIMEOFDAY
-#else
-#ifdef HAVE_GETTIMEOFDAY
-#define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz))
-#define HAVE_USBI_GETTIMEOFDAY
-#endif
-#endif
-
-struct usbi_pollfd {
- /* must come first */
- struct libusb_pollfd pollfd;
-
- struct list_head list;
-};
-
-int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events);
-void usbi_remove_pollfd(struct libusb_context *ctx, int fd);
-void usbi_fd_notification(struct libusb_context *ctx);
-
-/* device discovery */
-
-/* we traverse usbfs without knowing how many devices we are going to find.
- * so we create this discovered_devs model which is similar to a linked-list
- * which grows when required. it can be freed once discovery has completed,
- * eliminating the need for a list node in the libusb_device structure
- * itself. */
-struct discovered_devs {
- size_t len;
- size_t capacity;
- struct libusb_device *devices
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
-};
-
-struct discovered_devs *discovered_devs_append(
- struct discovered_devs *discdevs, struct libusb_device *dev);
-
-/* OS abstraction */
-
-/* This is the interface that OS backends need to implement.
- * All fields are mandatory, except ones explicitly noted as optional. */
-struct usbi_os_backend {
- /* A human-readable name for your backend, e.g. "Linux usbfs" */
- const char *name;
-
- /* Binary mask for backend specific capabilities */
- uint32_t caps;
-
- /* Perform initialization of your backend. You might use this function
- * to determine specific capabilities of the system, allocate required
- * data structures for later, etc.
- *
- * This function is called when a libusbx user initializes the library
- * prior to use.
- *
- * Return 0 on success, or a LIBUSB_ERROR code on failure.
- */
- int (*init)(struct libusb_context *ctx);
-
- /* Deinitialization. Optional. This function should destroy anything
- * that was set up by init.
- *
- * This function is called when the user deinitializes the library.
- */
- void (*exit)(void);
-
- /* Enumerate all the USB devices on the system, returning them in a list
- * of discovered devices.
- *
- * Your implementation should enumerate all devices on the system,
- * regardless of whether they have been seen before or not.
- *
- * When you have found a device, compute a session ID for it. The session
- * ID should uniquely represent that particular device for that particular
- * connection session since boot (i.e. if you disconnect and reconnect a
- * device immediately after, it should be assigned a different session ID).
- * If your OS cannot provide a unique session ID as described above,
- * presenting a session ID of (bus_number << 8 | device_address) should
- * be sufficient. Bus numbers and device addresses wrap and get reused,
- * but that is an unlikely case.
- *
- * After computing a session ID for a device, call
- * usbi_get_device_by_session_id(). This function checks if libusbx already
- * knows about the device, and if so, it provides you with a libusb_device
- * structure for it.
- *
- * If usbi_get_device_by_session_id() returns NULL, it is time to allocate
- * a new device structure for the device. Call usbi_alloc_device() to
- * obtain a new libusb_device structure with reference count 1. Populate
- * the bus_number and device_address attributes of the new device, and
- * perform any other internal backend initialization you need to do. At
- * this point, you should be ready to provide device descriptors and so
- * on through the get_*_descriptor functions. Finally, call
- * usbi_sanitize_device() to perform some final sanity checks on the
- * device. Assuming all of the above succeeded, we can now continue.
- * If any of the above failed, remember to unreference the device that
- * was returned by usbi_alloc_device().
- *
- * At this stage we have a populated libusb_device structure (either one
- * that was found earlier, or one that we have just allocated and
- * populated). This can now be added to the discovered devices list
- * using discovered_devs_append(). Note that discovered_devs_append()
- * may reallocate the list, returning a new location for it, and also
- * note that reallocation can fail. Your backend should handle these
- * error conditions appropriately.
- *
- * This function should not generate any bus I/O and should not block.
- * If I/O is required (e.g. reading the active configuration value), it is
- * OK to ignore these suggestions :)
- *
- * This function is executed when the user wishes to retrieve a list
- * of USB devices connected to the system.
- *
- * If the backend has hotplug support, this function is not used!
- *
- * Return 0 on success, or a LIBUSB_ERROR code on failure.
- */
- int (*get_device_list)(struct libusb_context *ctx,
- struct discovered_devs **discdevs);
-
- /* Apps which were written before hotplug support, may listen for
- * hotplug events on their own and call libusb_get_device_list on
- * device addition. In this case libusb_get_device_list will likely
- * return a list without the new device in there, as the hotplug
- * event thread will still be busy enumerating the device, which may
- * take a while, or may not even have seen the event yet.
- *
- * To avoid this libusb_get_device_list will call this optional
- * function for backends with hotplug support before copying
- * ctx->usb_devs to the user. In this function the backend should
- * ensure any pending hotplug events are fully processed before
- * returning.
- *
- * Optional, should be implemented by backends with hotplug support.
- */
- void (*hotplug_poll)(void);
-
- /* Open a device for I/O and other USB operations. The device handle
- * is preallocated for you, you can retrieve the device in question
- * through handle->dev.
- *
- * Your backend should allocate any internal resources required for I/O
- * and other operations so that those operations can happen (hopefully)
- * without hiccup. This is also a good place to inform libusbx that it
- * should monitor certain file descriptors related to this device -
- * see the usbi_add_pollfd() function.
- *
- * This function should not generate any bus I/O and should not block.
- *
- * This function is called when the user attempts to obtain a device
- * handle for a device.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_ACCESS if the user has insufficient permissions
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since
- * discovery
- * - another LIBUSB_ERROR code on other failure
- *
- * Do not worry about freeing the handle on failed open, the upper layers
- * do this for you.
- */
- int (*open)(struct libusb_device_handle *handle);
-
- /* Close a device such that the handle cannot be used again. Your backend
- * should destroy any resources that were allocated in the open path.
- * This may also be a good place to call usbi_remove_pollfd() to inform
- * libusbx of any file descriptors associated with this device that should
- * no longer be monitored.
- *
- * This function is called when the user closes a device handle.
- */
- void (*close)(struct libusb_device_handle *handle);
-
- /* Retrieve the device descriptor from a device.
- *
- * The descriptor should be retrieved from memory, NOT via bus I/O to the
- * device. This means that you may have to cache it in a private structure
- * during get_device_list enumeration. Alternatively, you may be able
- * to retrieve it from a kernel interface (some Linux setups can do this)
- * still without generating bus I/O.
- *
- * This function is expected to write DEVICE_DESC_LENGTH (18) bytes into
- * buffer, which is guaranteed to be big enough.
- *
- * This function is called when sanity-checking a device before adding
- * it to the list of discovered devices, and also when the user requests
- * to read the device descriptor.
- *
- * This function is expected to return the descriptor in bus-endian format
- * (LE). If it returns the multi-byte values in host-endian format,
- * set the host_endian output parameter to "1".
- *
- * Return 0 on success or a LIBUSB_ERROR code on failure.
- */
- int (*get_device_descriptor)(struct libusb_device *device,
- unsigned char *buffer, int *host_endian);
-
- /* Get the ACTIVE configuration descriptor for a device.
- *
- * The descriptor should be retrieved from memory, NOT via bus I/O to the
- * device. This means that you may have to cache it in a private structure
- * during get_device_list enumeration. You may also have to keep track
- * of which configuration is active when the user changes it.
- *
- * This function is expected to write len bytes of data into buffer, which
- * is guaranteed to be big enough. If you can only do a partial write,
- * return an error code.
- *
- * This function is expected to return the descriptor in bus-endian format
- * (LE). If it returns the multi-byte values in host-endian format,
- * set the host_endian output parameter to "1".
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
- * - another LIBUSB_ERROR code on other failure
- */
- int (*get_active_config_descriptor)(struct libusb_device *device,
- unsigned char *buffer, size_t len, int *host_endian);
-
- /* Get a specific configuration descriptor for a device.
- *
- * The descriptor should be retrieved from memory, NOT via bus I/O to the
- * device. This means that you may have to cache it in a private structure
- * during get_device_list enumeration.
- *
- * The requested descriptor is expressed as a zero-based index (i.e. 0
- * indicates that we are requesting the first descriptor). The index does
- * not (necessarily) equal the bConfigurationValue of the configuration
- * being requested.
- *
- * This function is expected to write len bytes of data into buffer, which
- * is guaranteed to be big enough. If you can only do a partial write,
- * return an error code.
- *
- * This function is expected to return the descriptor in bus-endian format
- * (LE). If it returns the multi-byte values in host-endian format,
- * set the host_endian output parameter to "1".
- *
- * Return 0 on success or a LIBUSB_ERROR code on failure.
- */
- int (*get_config_descriptor)(struct libusb_device *device,
- uint8_t config_index, unsigned char *buffer, size_t len,
- int *host_endian);
-
- /* Like get_config_descriptor but then by bConfigurationValue instead
- * of by index.
- *
- * Optional, if not present the core will call get_config_descriptor
- * for all configs until it finds the desired bConfigurationValue.
- *
- * Returns a pointer to the raw-descriptor in *buffer, this memory
- * is valid as long as device is valid.
- *
- * Returns the length of the returned raw-descriptor on success,
- * or a LIBUSB_ERROR code on failure.
- */
- int (*get_config_descriptor_by_value)(struct libusb_device *device,
- uint8_t bConfigurationValue, unsigned char **buffer,
- int *host_endian);
-
- /* Get the bConfigurationValue for the active configuration for a device.
- * Optional. This should only be implemented if you can retrieve it from
- * cache (don't generate I/O).
- *
- * If you cannot retrieve this from cache, either do not implement this
- * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause
- * libusbx to retrieve the information through a standard control transfer.
- *
- * This function must be non-blocking.
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - LIBUSB_ERROR_NOT_SUPPORTED if the value cannot be retrieved without
- * blocking
- * - another LIBUSB_ERROR code on other failure.
- */
- int (*get_configuration)(struct libusb_device_handle *handle, int *config);
-
- /* Set the active configuration for a device.
- *
- * A configuration value of -1 should put the device in unconfigured state.
- *
- * This function can block.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
- * - LIBUSB_ERROR_BUSY if interfaces are currently claimed (and hence
- * configuration cannot be changed)
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure.
- */
- int (*set_configuration)(struct libusb_device_handle *handle, int config);
-
- /* Claim an interface. When claimed, the application can then perform
- * I/O to an interface's endpoints.
- *
- * This function should not generate any bus I/O and should not block.
- * Interface claiming is a logical operation that simply ensures that
- * no other drivers/applications are using the interface, and after
- * claiming, no other drivers/applicatiosn can use the interface because
- * we now "own" it.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if the interface does not exist
- * - LIBUSB_ERROR_BUSY if the interface is in use by another driver/app
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*claim_interface)(struct libusb_device_handle *handle, int interface_number);
-
- /* Release a previously claimed interface.
- *
- * This function should also generate a SET_INTERFACE control request,
- * resetting the alternate setting of that interface to 0. It's OK for
- * this function to block as a result.
- *
- * You will only ever be asked to release an interface which was
- * successfully claimed earlier.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*release_interface)(struct libusb_device_handle *handle, int interface_number);
-
- /* Set the alternate setting for an interface.
- *
- * You will only ever be asked to set the alternate setting for an
- * interface which was successfully claimed earlier.
- *
- * It's OK for this function to block.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if the alternate setting does not exist
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*set_interface_altsetting)(struct libusb_device_handle *handle,
- int interface_number, int altsetting);
-
- /* Clear a halt/stall condition on an endpoint.
- *
- * It's OK for this function to block.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*clear_halt)(struct libusb_device_handle *handle,
- unsigned char endpoint);
-
- /* Perform a USB port reset to reinitialize a device.
- *
- * If possible, the handle should still be usable after the reset
- * completes, assuming that the device descriptors did not change during
- * reset and all previous interface state can be restored.
- *
- * If something changes, or you cannot easily locate/verify the resetted
- * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application
- * to close the old handle and re-enumerate the device.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the device
- * has been disconnected since it was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*reset_device)(struct libusb_device_handle *handle);
-
- /* Determine if a kernel driver is active on an interface. Optional.
- *
- * The presence of a kernel driver on an interface indicates that any
- * calls to claim_interface would fail with the LIBUSB_ERROR_BUSY code.
- *
- * Return:
- * - 0 if no driver is active
- * - 1 if a driver is active
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*kernel_driver_active)(struct libusb_device_handle *handle,
- int interface_number);
-
- /* Detach a kernel driver from an interface. Optional.
- *
- * After detaching a kernel driver, the interface should be available
- * for claim.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
- * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - another LIBUSB_ERROR code on other failure
- */
- int (*detach_kernel_driver)(struct libusb_device_handle *handle,
- int interface_number);
-
- /* Attach a kernel driver to an interface. Optional.
- *
- * Reattach a kernel driver to the device.
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
- * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
- * was opened
- * - LIBUSB_ERROR_BUSY if a program or driver has claimed the interface,
- * preventing reattachment
- * - another LIBUSB_ERROR code on other failure
- */
- int (*attach_kernel_driver)(struct libusb_device_handle *handle,
- int interface_number);
-
- /* Destroy a device. Optional.
- *
- * This function is called when the last reference to a device is
- * destroyed. It should free any resources allocated in the get_device_list
- * path.
- */
- void (*destroy_device)(struct libusb_device *dev);
-
- /* Submit a transfer. Your implementation should take the transfer,
- * morph it into whatever form your platform requires, and submit it
- * asynchronously.
- *
- * This function must not block.
- *
- * This function gets called with the flying_transfers_lock locked!
- *
- * Return:
- * - 0 on success
- * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * - another LIBUSB_ERROR code on other failure
- */
- int (*submit_transfer)(struct usbi_transfer *itransfer);
-
- /* Cancel a previously submitted transfer.
- *
- * This function must not block. The transfer cancellation must complete
- * later, resulting in a call to usbi_handle_transfer_cancellation()
- * from the context of handle_events.
- */
- int (*cancel_transfer)(struct usbi_transfer *itransfer);
-
- /* Clear a transfer as if it has completed or cancelled, but do not
- * report any completion/cancellation to the library. You should free
- * all private data from the transfer as if you were just about to report
- * completion or cancellation.
- *
- * This function might seem a bit out of place. It is used when libusbx
- * detects a disconnected device - it calls this function for all pending
- * transfers before reporting completion (with the disconnect code) to
- * the user. Maybe we can improve upon this internal interface in future.
- */
- void (*clear_transfer_priv)(struct usbi_transfer *itransfer);
-
- /* Handle any pending events. This involves monitoring any active
- * transfers and processing their completion or cancellation.
- *
- * The function is passed an array of pollfd structures (size nfds)
- * as a result of the poll() system call. The num_ready parameter
- * indicates the number of file descriptors that have reported events
- * (i.e. the poll() return value). This should be enough information
- * for you to determine which actions need to be taken on the currently
- * active transfers.
- *
- * For any cancelled transfers, call usbi_handle_transfer_cancellation().
- * For completed transfers, call usbi_handle_transfer_completion().
- * For control/bulk/interrupt transfers, populate the "transferred"
- * element of the appropriate usbi_transfer structure before calling the
- * above functions. For isochronous transfers, populate the status and
- * transferred fields of the iso packet descriptors of the transfer.
- *
- * This function should also be able to detect disconnection of the
- * device, reporting that situation with usbi_handle_disconnect().
- *
- * When processing an event related to a transfer, you probably want to
- * take usbi_transfer.lock to prevent races. See the documentation for
- * the usbi_transfer structure.
- *
- * Return 0 on success, or a LIBUSB_ERROR code on failure.
- */
- int (*handle_events)(struct libusb_context *ctx,
- struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready);
-
- /* Get time from specified clock. At least two clocks must be implemented
- by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC.
-
- Description of clocks:
- USBI_CLOCK_REALTIME : clock returns time since system epoch.
- USBI_CLOCK_MONOTONIC: clock returns time since unspecified start
- time (usually boot).
- */
- int (*clock_gettime)(int clkid, struct timespec *tp);
-
-#ifdef USBI_TIMERFD_AVAILABLE
- /* clock ID of the clock that should be used for timerfd */
- clockid_t (*get_timerfd_clockid)(void);
-#endif
-
- /* Number of bytes to reserve for per-device private backend data.
- * This private data area is accessible through the "os_priv" field of
- * struct libusb_device. */
- size_t device_priv_size;
-
- /* Number of bytes to reserve for per-handle private backend data.
- * This private data area is accessible through the "os_priv" field of
- * struct libusb_device. */
- size_t device_handle_priv_size;
-
- /* Number of bytes to reserve for per-transfer private backend data.
- * This private data area is accessible by calling
- * usbi_transfer_get_os_priv() on the appropriate usbi_transfer instance.
- */
- size_t transfer_priv_size;
-
- /* Mumber of additional bytes for os_priv for each iso packet.
- * Can your backend use this? */
- /* FIXME: linux can't use this any more. if other OS's cannot either,
- * then remove this */
- size_t add_iso_packet_size;
-};
-
-extern const struct usbi_os_backend * const usbi_backend;
-
-extern const struct usbi_os_backend linux_usbfs_backend;
-extern const struct usbi_os_backend darwin_backend;
-extern const struct usbi_os_backend openbsd_backend;
-extern const struct usbi_os_backend windows_backend;
-extern const struct usbi_os_backend wince_backend;
-
-extern struct list_head active_contexts_list;
-extern usbi_mutex_static_t active_contexts_lock;
-
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.c
deleted file mode 100644
index a24558cb59..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.c
+++ /dev/null
@@ -1,1903 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode:nil -*- */
-/*
- * darwin backend for libusbx 1.0
- * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <ctype.h>
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <libkern/OSAtomic.h>
-
-#include <mach/clock.h>
-#include <mach/clock_types.h>
-#include <mach/mach_host.h>
-#include <mach/mach_port.h>
-
-#include <AvailabilityMacros.h>
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- #include <objc/objc-auto.h>
-#endif
-
-#include "darwin_usb.h"
-
-/* async event thread */
-static pthread_mutex_t libusb_darwin_at_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t libusb_darwin_at_cond = PTHREAD_COND_INITIALIZER;
-
-static clock_serv_t clock_realtime;
-static clock_serv_t clock_monotonic;
-
-static CFRunLoopRef libusb_darwin_acfl = NULL; /* event cf loop */
-static volatile int32_t initCount = 0;
-
-static usbi_mutex_t darwin_cached_devices_lock = PTHREAD_MUTEX_INITIALIZER;
-static struct list_head darwin_cached_devices = {&darwin_cached_devices, &darwin_cached_devices};
-
-#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
-
-/* async event thread */
-static pthread_t libusb_darwin_at;
-
-static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian);
-static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface);
-static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface);
-static int darwin_reset_device(struct libusb_device_handle *dev_handle);
-static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0);
-
-static int darwin_scan_devices(struct libusb_context *ctx);
-static int process_new_device (struct libusb_context *ctx, io_service_t service);
-
-#if defined(ENABLE_LOGGING)
-static const char *darwin_error_str (int result) {
- switch (result) {
- case kIOReturnSuccess:
- return "no error";
- case kIOReturnNotOpen:
- return "device not opened for exclusive access";
- case kIOReturnNoDevice:
- return "no connection to an IOService";
- case kIOUSBNoAsyncPortErr:
- return "no async port has been opened for interface";
- case kIOReturnExclusiveAccess:
- return "another process has device opened for exclusive access";
- case kIOUSBPipeStalled:
- return "pipe is stalled";
- case kIOReturnError:
- return "could not establish a connection to the Darwin kernel";
- case kIOUSBTransactionTimeout:
- return "transaction timed out";
- case kIOReturnBadArgument:
- return "invalid argument";
- case kIOReturnAborted:
- return "transaction aborted";
- case kIOReturnNotResponding:
- return "device not responding";
- case kIOReturnOverrun:
- return "data overrun";
- case kIOReturnCannotWire:
- return "physical memory can not be wired down";
- case kIOReturnNoResources:
- return "out of resources";
- case kIOUSBHighSpeedSplitError:
- return "high speed split error";
- default:
- return "unknown error";
- }
-}
-#endif
-
-static int darwin_to_libusb (int result) {
- switch (result) {
- case kIOReturnUnderrun:
- case kIOReturnSuccess:
- return LIBUSB_SUCCESS;
- case kIOReturnNotOpen:
- case kIOReturnNoDevice:
- return LIBUSB_ERROR_NO_DEVICE;
- case kIOReturnExclusiveAccess:
- return LIBUSB_ERROR_ACCESS;
- case kIOUSBPipeStalled:
- return LIBUSB_ERROR_PIPE;
- case kIOReturnBadArgument:
- return LIBUSB_ERROR_INVALID_PARAM;
- case kIOUSBTransactionTimeout:
- return LIBUSB_ERROR_TIMEOUT;
- case kIOReturnNotResponding:
- case kIOReturnAborted:
- case kIOReturnError:
- case kIOUSBNoAsyncPortErr:
- default:
- return LIBUSB_ERROR_OTHER;
- }
-}
-
-/* this function must be called with the darwin_cached_devices_lock held */
-static void darwin_deref_cached_device(struct darwin_cached_device *cached_dev) {
- cached_dev->refcount--;
- /* free the device and remove it from the cache */
- if (0 == cached_dev->refcount) {
- list_del(&cached_dev->list);
-
- (*(cached_dev->device))->Release(cached_dev->device);
- free (cached_dev);
- }
-}
-
-static void darwin_ref_cached_device(struct darwin_cached_device *cached_dev) {
- cached_dev->refcount++;
-}
-
-static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
-
- /* current interface */
- struct darwin_interface *cInterface;
-
- int8_t i, iface;
-
- usbi_dbg ("converting ep address 0x%02x to pipeRef and interface", ep);
-
- for (iface = 0 ; iface < USB_MAXINTERFACES ; iface++) {
- cInterface = &priv->interfaces[iface];
-
- if (dev_handle->claimed_interfaces & (1 << iface)) {
- for (i = 0 ; i < cInterface->num_endpoints ; i++) {
- if (cInterface->endpoint_addrs[i] == ep) {
- *pipep = i + 1;
- *ifcp = iface;
- usbi_dbg ("pipe %d on interface %d matches", *pipep, *ifcp);
- return 0;
- }
- }
- }
- }
-
- /* No pipe found with the correct endpoint address */
- usbi_warn (HANDLE_CTX(dev_handle), "no pipeRef found with endpoint address 0x%02x.", ep);
-
- return -1;
-}
-
-static int usb_setup_device_iterator (io_iterator_t *deviceIterator, UInt32 location) {
- CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOUSBDeviceClassName);
-
- if (!matchingDict)
- return kIOReturnError;
-
- if (location) {
- CFMutableDictionaryRef propertyMatchDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
- if (propertyMatchDict) {
- /* there are no unsigned CFNumber types so treat the value as signed. the os seems to do this
- internally (CFNumberType of locationID is 3) */
- CFTypeRef locationCF = CFNumberCreate (NULL, kCFNumberSInt32Type, &location);
-
- CFDictionarySetValue (propertyMatchDict, CFSTR(kUSBDevicePropertyLocationID), locationCF);
- /* release our reference to the CFNumber (CFDictionarySetValue retains it) */
- CFRelease (locationCF);
-
- CFDictionarySetValue (matchingDict, CFSTR(kIOPropertyMatchKey), propertyMatchDict);
- /* release out reference to the CFMutableDictionaryRef (CFDictionarySetValue retains it) */
- CFRelease (propertyMatchDict);
- }
- /* else we can still proceed as long as the caller accounts for the possibility of other devices in the iterator */
- }
-
- return IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, deviceIterator);
-}
-
-static int get_ioregistry_value_number (io_service_t service, CFStringRef property, CFNumberType type, void *p) {
- CFTypeRef cfNumber = IORegistryEntryCreateCFProperty (service, property, kCFAllocatorDefault, 0);
- int ret = 0;
-
- if (cfNumber) {
- if (CFGetTypeID(cfNumber) == CFNumberGetTypeID()) {
- ret = CFNumberGetValue(cfNumber, type, p);
- }
-
- CFRelease (cfNumber);
- }
-
- return ret;
-}
-
-static usb_device_t **darwin_device_from_service (io_service_t service)
-{
- io_cf_plugin_ref_t *plugInInterface = NULL;
- usb_device_t **device;
- kern_return_t result;
- SInt32 score;
-
- result = IOCreatePlugInInterfaceForService(service, kIOUSBDeviceUserClientTypeID,
- kIOCFPlugInInterfaceID, &plugInInterface,
- &score);
-
- if (kIOReturnSuccess != result || !plugInInterface) {
- usbi_dbg ("could not set up plugin for service: %s\n", darwin_error_str (result));
- return NULL;
- }
-
- (void)(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID),
- (LPVOID)&device);
- /* Use release instead of IODestroyPlugInInterface to avoid stopping IOServices associated with this device */
- (*plugInInterface)->Release (plugInInterface);
-
- return device;
-}
-
-static void darwin_devices_attached (void *ptr, io_iterator_t add_devices) {
- struct libusb_context *ctx;
- io_service_t service;
-
- usbi_mutex_lock(&active_contexts_lock);
-
- while ((service = IOIteratorNext(add_devices))) {
- /* add this device to each active context's device list */
- list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {
- process_new_device (ctx, service);;
- }
-
- IOObjectRelease(service);
- }
-
- usbi_mutex_unlock(&active_contexts_lock);
-}
-
-static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) {
- struct libusb_device *dev = NULL;
- struct libusb_context *ctx;
-
- io_service_t device;
- UInt64 session;
- int ret;
-
- while ((device = IOIteratorNext (rem_devices)) != 0) {
- /* get the location from the i/o registry */
- ret = get_ioregistry_value_number (device, CFSTR("sessionID"), kCFNumberSInt64Type, &session);
- IOObjectRelease (device);
- if (!ret)
- continue;
-
- usbi_mutex_lock(&active_contexts_lock);
-
- list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {
- usbi_dbg ("notifying context %p of device disconnect", ctx);
-
- dev = usbi_get_device_by_session_id(ctx, session);
- if (dev) {
- /* signal the core that this device has been disconnected. the core will tear down this device
- when the reference count reaches 0 */
- usbi_disconnect_device(dev);
- }
- }
-
- usbi_mutex_unlock(&active_contexts_lock);
- }
-}
-
-static void darwin_clear_iterator (io_iterator_t iter) {
- io_service_t device;
-
- while ((device = IOIteratorNext (iter)) != 0)
- IOObjectRelease (device);
-}
-
-static void *darwin_event_thread_main (void *arg0) {
- IOReturn kresult;
- struct libusb_context *ctx = (struct libusb_context *)arg0;
- CFRunLoopRef runloop;
-
- /* Set this thread's name, so it can be seen in the debugger
- and crash reports. */
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- pthread_setname_np ("org.libusb.device-hotplug");
-
- /* Tell the Objective-C garbage collector about this thread.
- This is required because, unlike NSThreads, pthreads are
- not automatically registered. Although we don't use
- Objective-C, we use CoreFoundation, which does. */
- objc_registerThreadWithCollector();
-#endif
-
- /* hotplug (device arrival/removal) sources */
- CFRunLoopSourceRef libusb_notification_cfsource;
- io_notification_port_t libusb_notification_port;
- io_iterator_t libusb_rem_device_iterator;
- io_iterator_t libusb_add_device_iterator;
-
- usbi_dbg ("creating hotplug event source");
-
- runloop = CFRunLoopGetCurrent ();
- CFRetain (runloop);
-
- /* add the notification port to the run loop */
- libusb_notification_port = IONotificationPortCreate (kIOMasterPortDefault);
- libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port);
- CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);
-
- /* create notifications for removed devices */
- kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification,
- IOServiceMatching(kIOUSBDeviceClassName),
- (IOServiceMatchingCallback)darwin_devices_detached,
- (void *)ctx, &libusb_rem_device_iterator);
-
- if (kresult != kIOReturnSuccess) {
- usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult));
-
- pthread_exit (NULL);
- }
-
- /* create notifications for attached devices */
- kresult = IOServiceAddMatchingNotification(libusb_notification_port, kIOFirstMatchNotification,
- IOServiceMatching(kIOUSBDeviceClassName),
- (IOServiceMatchingCallback)darwin_devices_attached,
- (void *)ctx, &libusb_add_device_iterator);
-
- if (kresult != kIOReturnSuccess) {
- usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult));
-
- pthread_exit (NULL);
- }
-
- /* arm notifiers */
- darwin_clear_iterator (libusb_rem_device_iterator);
- darwin_clear_iterator (libusb_add_device_iterator);
-
- usbi_dbg ("darwin event thread ready to receive events");
-
- /* signal the main thread that the hotplug runloop has been created. */
- pthread_mutex_lock (&libusb_darwin_at_mutex);
- libusb_darwin_acfl = runloop;
- pthread_cond_signal (&libusb_darwin_at_cond);
- pthread_mutex_unlock (&libusb_darwin_at_mutex);
-
- /* run the runloop */
- CFRunLoopRun();
-
- usbi_dbg ("darwin event thread exiting");
-
- /* remove the notification cfsource */
- CFRunLoopRemoveSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);
-
- /* delete notification port */
- IONotificationPortDestroy (libusb_notification_port);
-
- /* delete iterators */
- IOObjectRelease (libusb_rem_device_iterator);
- IOObjectRelease (libusb_add_device_iterator);
-
- CFRelease (runloop);
-
- libusb_darwin_acfl = NULL;
-
- pthread_exit (NULL);
-}
-
-static void _darwin_finalize(void) {
- struct darwin_cached_device *dev, *next;
-
- usbi_mutex_lock(&darwin_cached_devices_lock);
- list_for_each_entry_safe(dev, next, &darwin_cached_devices, list, struct darwin_cached_device) {
- darwin_deref_cached_device(dev);
- }
- usbi_mutex_unlock(&darwin_cached_devices_lock);
-}
-
-static int darwin_init(struct libusb_context *ctx) {
- host_name_port_t host_self;
- static int initted = 0;
- int rc;
-
- rc = darwin_scan_devices (ctx);
- if (LIBUSB_SUCCESS != rc) {
- return rc;
- }
-
- if (OSAtomicIncrement32Barrier(&initCount) == 1) {
- /* create the clocks that will be used */
-
- if (!initted) {
- initted = 1;
- atexit(_darwin_finalize);
- }
-
- host_self = mach_host_self();
- host_get_clock_service(host_self, CALENDAR_CLOCK, &clock_realtime);
- host_get_clock_service(host_self, SYSTEM_CLOCK, &clock_monotonic);
- mach_port_deallocate(mach_task_self(), host_self);
-
- pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, (void *)ctx);
-
- pthread_mutex_lock (&libusb_darwin_at_mutex);
- while (!libusb_darwin_acfl)
- pthread_cond_wait (&libusb_darwin_at_cond, &libusb_darwin_at_mutex);
- pthread_mutex_unlock (&libusb_darwin_at_mutex);
- }
-
- return rc;
-}
-
-static void darwin_exit (void) {
- if (OSAtomicDecrement32Barrier(&initCount) == 0) {
- mach_port_deallocate(mach_task_self(), clock_realtime);
- mach_port_deallocate(mach_task_self(), clock_monotonic);
-
- /* stop the event runloop and wait for the thread to terminate. */
- CFRunLoopStop (libusb_darwin_acfl);
- pthread_join (libusb_darwin_at, NULL);
- }
-}
-
-static int darwin_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian) {
- struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
-
- /* return cached copy */
- memmove (buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH);
-
- *host_endian = 0;
-
- return 0;
-}
-
-static int get_configuration_index (struct libusb_device *dev, int config_value) {
- struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
- UInt8 i, numConfig;
- IOUSBConfigurationDescriptorPtr desc;
- IOReturn kresult;
-
- /* is there a simpler way to determine the index? */
- kresult = (*(priv->device))->GetNumberOfConfigurations (priv->device, &numConfig);
- if (kresult != kIOReturnSuccess)
- return darwin_to_libusb (kresult);
-
- for (i = 0 ; i < numConfig ; i++) {
- (*(priv->device))->GetConfigurationDescriptorPtr (priv->device, i, &desc);
-
- if (desc->bConfigurationValue == config_value)
- return i;
- }
-
- /* configuration not found */
- return LIBUSB_ERROR_NOT_FOUND;
-}
-
-static int darwin_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) {
- struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
- int config_index;
-
- if (0 == priv->active_config)
- return LIBUSB_ERROR_NOT_FOUND;
-
- config_index = get_configuration_index (dev, priv->active_config);
- if (config_index < 0)
- return config_index;
-
- return darwin_get_config_descriptor (dev, config_index, buffer, len, host_endian);
-}
-
-static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) {
- struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
- IOUSBConfigurationDescriptorPtr desc;
- IOReturn kresult;
- int ret;
-
- if (!priv || !priv->device)
- return LIBUSB_ERROR_OTHER;
-
- kresult = (*priv->device)->GetConfigurationDescriptorPtr (priv->device, config_index, &desc);
- if (kresult == kIOReturnSuccess) {
- /* copy descriptor */
- if (libusb_le16_to_cpu(desc->wTotalLength) < len)
- len = libusb_le16_to_cpu(desc->wTotalLength);
-
- memmove (buffer, desc, len);
-
- /* GetConfigurationDescriptorPtr returns the descriptor in USB bus order */
- *host_endian = 0;
- }
-
- ret = darwin_to_libusb (kresult);
- if (ret != LIBUSB_SUCCESS)
- return ret;
-
- return len;
-}
-
-/* check whether the os has configured the device */
-static int darwin_check_configuration (struct libusb_context *ctx, struct darwin_cached_device *dev) {
- usb_device_t **darwin_device = dev->device;
-
- IOUSBConfigurationDescriptorPtr configDesc;
- IOUSBFindInterfaceRequest request;
- kern_return_t kresult;
- io_iterator_t interface_iterator;
- io_service_t firstInterface;
-
- if (dev->dev_descriptor.bNumConfigurations < 1) {
- usbi_err (ctx, "device has no configurations");
- return LIBUSB_ERROR_OTHER; /* no configurations at this speed so we can't use it */
- }
-
- /* find the first configuration */
- kresult = (*darwin_device)->GetConfigurationDescriptorPtr (darwin_device, 0, &configDesc);
- dev->first_config = (kIOReturnSuccess == kresult) ? configDesc->bConfigurationValue : 1;
-
- /* check if the device is already configured. there is probably a better way than iterating over the
- to accomplish this (the trick is we need to avoid a call to GetConfigurations since buggy devices
- might lock up on the device request) */
-
- /* Setup the Interface Request */
- request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
- request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
-
- kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator);
- if (kresult)
- return darwin_to_libusb (kresult);
-
- /* iterate once */
- firstInterface = IOIteratorNext(interface_iterator);
-
- /* done with the interface iterator */
- IOObjectRelease(interface_iterator);
-
- if (firstInterface) {
- IOObjectRelease (firstInterface);
-
- /* device is configured */
- if (dev->dev_descriptor.bNumConfigurations == 1)
- /* to avoid problems with some devices get the configurations value from the configuration descriptor */
- dev->active_config = dev->first_config;
- else
- /* devices with more than one configuration should work with GetConfiguration */
- (*darwin_device)->GetConfiguration (darwin_device, &dev->active_config);
- } else
- /* not configured */
- dev->active_config = 0;
-
- usbi_dbg ("active config: %u, first config: %u", dev->active_config, dev->first_config);
-
- return 0;
-}
-
-static int darwin_request_descriptor (usb_device_t **device, UInt8 desc, UInt8 desc_index, void *buffer, size_t buffer_size) {
- IOUSBDevRequestTO req;
-
- memset (buffer, 0, buffer_size);
-
- /* Set up request for descriptor/ */
- req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);
- req.bRequest = kUSBRqGetDescriptor;
- req.wValue = desc << 8;
- req.wIndex = desc_index;
- req.wLength = buffer_size;
- req.pData = buffer;
- req.noDataTimeout = 20;
- req.completionTimeout = 100;
-
- return (*device)->DeviceRequestTO (device, &req);
-}
-
-static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct darwin_cached_device *dev) {
- usb_device_t **device = dev->device;
- int retries = 1, delay = 30000;
- int unsuspended = 0, try_unsuspend = 1, try_reconfigure = 1;
- int is_open = 0;
- int ret = 0, ret2;
- UInt8 bDeviceClass;
- UInt16 idProduct, idVendor;
-
- dev->can_enumerate = 0;
-
- (*device)->GetDeviceClass (device, &bDeviceClass);
- (*device)->GetDeviceProduct (device, &idProduct);
- (*device)->GetDeviceVendor (device, &idVendor);
-
- /* According to Apple's documentation the device must be open for DeviceRequest but we may not be able to open some
- * devices and Apple's USB Prober doesn't bother to open the device before issuing a descriptor request. Still,
- * to follow the spec as closely as possible, try opening the device */
- is_open = ((*device)->USBDeviceOpenSeize(device) == kIOReturnSuccess);
-
- do {
- /**** retrieve device descriptor ****/
- ret = darwin_request_descriptor (device, kUSBDeviceDesc, 0, &dev->dev_descriptor, sizeof(dev->dev_descriptor));
-
- if (kIOReturnOverrun == ret && kUSBDeviceDesc == dev->dev_descriptor.bDescriptorType)
- /* received an overrun error but we still received a device descriptor */
- ret = kIOReturnSuccess;
-
- if (kIOUSBVendorIDAppleComputer == idVendor) {
- /* NTH: don't bother retrying or unsuspending Apple devices */
- break;
- }
-
- if (kIOReturnSuccess == ret && (0 == dev->dev_descriptor.bNumConfigurations ||
- 0 == dev->dev_descriptor.bcdUSB)) {
- /* work around for incorrectly configured devices */
- if (try_reconfigure && is_open) {
- usbi_dbg("descriptor appears to be invalid. resetting configuration before trying again...");
-
- /* set the first configuration */
- (*device)->SetConfiguration(device, 1);
-
- /* don't try to reconfigure again */
- try_reconfigure = 0;
- }
-
- ret = kIOUSBPipeStalled;
- }
-
- if (kIOReturnSuccess != ret && is_open && try_unsuspend) {
- /* device may be suspended. unsuspend it and try again */
-#if DeviceVersion >= 320
- UInt32 info = 0;
-
- /* IOUSBFamily 320+ provides a way to detect device suspension but earlier versions do not */
- (void)(*device)->GetUSBDeviceInformation (device, &info);
-
- /* note that the device was suspended */
- if (info & (1 << kUSBInformationDeviceIsSuspendedBit) || 0 == info)
- try_unsuspend = 1;
-#endif
-
- if (try_unsuspend) {
- /* try to unsuspend the device */
- ret2 = (*device)->USBDeviceSuspend (device, 0);
- if (kIOReturnSuccess != ret2) {
- /* prevent log spew from poorly behaving devices. this indicates the
- os actually had trouble communicating with the device */
- usbi_dbg("could not retrieve device descriptor. failed to unsuspend: %s",darwin_error_str(ret2));
- } else
- unsuspended = 1;
-
- try_unsuspend = 0;
- }
- }
-
- if (kIOReturnSuccess != ret) {
- usbi_dbg("kernel responded with code: 0x%08x. sleeping for %d ms before trying again", ret, delay/1000);
- /* sleep for a little while before trying again */
- usleep (delay);
- }
- } while (kIOReturnSuccess != ret && retries--);
-
- if (unsuspended)
- /* resuspend the device */
- (void)(*device)->USBDeviceSuspend (device, 1);
-
- if (is_open)
- (void) (*device)->USBDeviceClose (device);
-
- if (ret != kIOReturnSuccess) {
- /* a debug message was already printed out for this error */
- if (LIBUSB_CLASS_HUB == bDeviceClass)
- usbi_dbg ("could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device",
- idVendor, idProduct, darwin_error_str (ret), ret);
- else
- usbi_warn (ctx, "could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device",
- idVendor, idProduct, darwin_error_str (ret), ret);
- return -1;
- }
-
- /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */
- if (libusb_le16_to_cpu (dev->dev_descriptor.idProduct) != idProduct) {
- /* not a valid device */
- usbi_warn (ctx, "idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device",
- idProduct, libusb_le16_to_cpu (dev->dev_descriptor.idProduct));
- return -1;
- }
-
- usbi_dbg ("cached device descriptor:");
- usbi_dbg (" bDescriptorType: 0x%02x", dev->dev_descriptor.bDescriptorType);
- usbi_dbg (" bcdUSB: 0x%04x", dev->dev_descriptor.bcdUSB);
- usbi_dbg (" bDeviceClass: 0x%02x", dev->dev_descriptor.bDeviceClass);
- usbi_dbg (" bDeviceSubClass: 0x%02x", dev->dev_descriptor.bDeviceSubClass);
- usbi_dbg (" bDeviceProtocol: 0x%02x", dev->dev_descriptor.bDeviceProtocol);
- usbi_dbg (" bMaxPacketSize0: 0x%02x", dev->dev_descriptor.bMaxPacketSize0);
- usbi_dbg (" idVendor: 0x%04x", dev->dev_descriptor.idVendor);
- usbi_dbg (" idProduct: 0x%04x", dev->dev_descriptor.idProduct);
- usbi_dbg (" bcdDevice: 0x%04x", dev->dev_descriptor.bcdDevice);
- usbi_dbg (" iManufacturer: 0x%02x", dev->dev_descriptor.iManufacturer);
- usbi_dbg (" iProduct: 0x%02x", dev->dev_descriptor.iProduct);
- usbi_dbg (" iSerialNumber: 0x%02x", dev->dev_descriptor.iSerialNumber);
- usbi_dbg (" bNumConfigurations: 0x%02x", dev->dev_descriptor.bNumConfigurations);
-
- dev->can_enumerate = 1;
-
- return 0;
-}
-
-static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t service,
- struct darwin_cached_device **cached_out) {
- struct darwin_cached_device *new_device;
- UInt64 sessionID, parent_sessionID;
- int ret = LIBUSB_SUCCESS;
- usb_device_t **device;
- io_service_t parent;
- kern_return_t result;
- UInt8 port = 0;
-
- *cached_out = NULL;
-
- /* get some info from the io registry */
- (void) get_ioregistry_value_number (service, CFSTR("sessionID"), kCFNumberSInt64Type, &sessionID);
- (void) get_ioregistry_value_number (service, CFSTR("PortNum"), kCFNumberSInt8Type, &port);
-
- usbi_dbg("finding cached device for sessionID 0x\n" PRIx64, sessionID);
-
- result = IORegistryEntryGetParentEntry (service, kIOUSBPlane, &parent);
-
- if (kIOReturnSuccess == result) {
- (void) get_ioregistry_value_number (parent, CFSTR("sessionID"), kCFNumberSInt64Type, &parent_sessionID);
- IOObjectRelease(parent);
- }
-
- usbi_mutex_lock(&darwin_cached_devices_lock);
- do {
- list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) {
- usbi_dbg("matching sessionID 0x%x against cached device with sessionID 0x%x", sessionID, new_device->session);
- if (new_device->session == sessionID) {
- usbi_dbg("using cached device for device");
- *cached_out = new_device;
- break;
- }
- }
-
- if (*cached_out)
- break;
-
- usbi_dbg("caching new device with sessionID 0x%x\n", sessionID);
-
- new_device = calloc (1, sizeof (*new_device));
- if (!new_device) {
- ret = LIBUSB_ERROR_NO_MEM;
- break;
- }
-
- device = darwin_device_from_service (service);
- if (!device) {
- ret = LIBUSB_ERROR_NO_DEVICE;
- free (new_device);
- new_device = NULL;
- break;
- }
-
- /* add this device to the cached device list */
- list_add(&new_device->list, &darwin_cached_devices);
-
- (*device)->GetDeviceAddress (device, (USBDeviceAddress *)&new_device->address);
-
- /* keep a reference to this device */
- darwin_ref_cached_device(new_device);
-
- new_device->device = device;
- new_device->session = sessionID;
- (*device)->GetLocationID (device, &new_device->location);
- new_device->port = port;
- new_device->parent_session = parent_sessionID;
-
- /* cache the device descriptor */
- ret = darwin_cache_device_descriptor(ctx, new_device);
- if (ret)
- break;
-
- if (new_device->can_enumerate) {
- snprintf(new_device->sys_path, 20, "%03i-%04x-%04x-%02x-%02x", new_device->address,
- new_device->dev_descriptor.idVendor, new_device->dev_descriptor.idProduct,
- new_device->dev_descriptor.bDeviceClass, new_device->dev_descriptor.bDeviceSubClass);
- }
- } while (0);
-
- usbi_mutex_unlock(&darwin_cached_devices_lock);
-
- /* keep track of devices regardless of if we successfully enumerate them to
- prevent them from being enumerated multiple times */
-
- *cached_out = new_device;
-
- return ret;
-}
-
-static int process_new_device (struct libusb_context *ctx, io_service_t service) {
- struct darwin_device_priv *priv;
- struct libusb_device *dev = NULL;
- struct darwin_cached_device *cached_device;
- UInt8 devSpeed;
- int ret = 0;
-
- do {
- ret = darwin_get_cached_device (ctx, service, &cached_device);
-
- if (ret < 0 || (cached_device && !cached_device->can_enumerate)) {
- return ret;
- }
-
- /* check current active configuration (and cache the first configuration value--
- which may be used by claim_interface) */
- ret = darwin_check_configuration (ctx, cached_device);
- if (ret)
- break;
-
- usbi_dbg ("allocating new device in context %p for with session 0x%08x",
- ctx, cached_device->session);
-
- dev = usbi_alloc_device(ctx, cached_device->session);
- if (!dev) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- priv = (struct darwin_device_priv *)dev->os_priv;
-
- priv->dev = cached_device;
- darwin_ref_cached_device (priv->dev);
-
- if (cached_device->parent_session > 0) {
- dev->parent_dev = usbi_get_device_by_session_id (ctx, cached_device->parent_session);
- } else {
- dev->parent_dev = NULL;
- }
- dev->port_number = cached_device->port;
- dev->bus_number = cached_device->location >> 24;
- dev->device_address = cached_device->address;
-
- /* need to add a reference to the parent device */
- if (dev->parent_dev) {
- libusb_ref_device(dev->parent_dev);
- }
-
- (*(priv->dev->device))->GetDeviceSpeed (priv->dev->device, &devSpeed);
-
- switch (devSpeed) {
- case kUSBDeviceSpeedLow: dev->speed = LIBUSB_SPEED_LOW; break;
- case kUSBDeviceSpeedFull: dev->speed = LIBUSB_SPEED_FULL; break;
- case kUSBDeviceSpeedHigh: dev->speed = LIBUSB_SPEED_HIGH; break;
-#if DeviceVersion >= 500
- case kUSBDeviceSpeedSuper: dev->speed = LIBUSB_SPEED_SUPER; break;
-#endif
- default:
- usbi_warn (ctx, "Got unknown device speed %d", devSpeed);
- }
-
- ret = usbi_sanitize_device (dev);
- if (ret < 0)
- break;
-
- usbi_dbg ("found device with address %d port = %d parent = %p at %p", dev->device_address,
- dev->port_number, (void *) dev->parent_dev, priv->dev->sys_path);
- } while (0);
-
- if (0 == ret) {
- usbi_connect_device (dev);
- } else {
- libusb_unref_device (dev);
- }
-
- return ret;
-}
-
-static int darwin_scan_devices(struct libusb_context *ctx) {
- io_iterator_t deviceIterator;
- io_service_t service;
- kern_return_t kresult;
-
- kresult = usb_setup_device_iterator (&deviceIterator, 0);
- if (kresult != kIOReturnSuccess)
- return darwin_to_libusb (kresult);
-
- while ((service = IOIteratorNext (deviceIterator))) {
- (void) process_new_device (ctx, service);
-
- IOObjectRelease(service);
- }
-
- IOObjectRelease(deviceIterator);
-
- return 0;
-}
-
-static int darwin_open (struct libusb_device_handle *dev_handle) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- IOReturn kresult;
-
- if (0 == dpriv->open_count) {
- /* try to open the device */
- kresult = (*(dpriv->device))->USBDeviceOpenSeize (dpriv->device);
- if (kresult != kIOReturnSuccess) {
- usbi_warn (HANDLE_CTX (dev_handle), "USBDeviceOpen: %s", darwin_error_str(kresult));
-
- if (kIOReturnExclusiveAccess != kresult) {
- return darwin_to_libusb (kresult);
- }
-
- /* it is possible to perform some actions on a device that is not open so do not return an error */
- priv->is_open = 0;
- } else {
- priv->is_open = 1;
- }
-
- /* create async event source */
- kresult = (*(dpriv->device))->CreateDeviceAsyncEventSource (dpriv->device, &priv->cfSource);
- if (kresult != kIOReturnSuccess) {
- usbi_err (HANDLE_CTX (dev_handle), "CreateDeviceAsyncEventSource: %s", darwin_error_str(kresult));
-
- if (priv->is_open) {
- (*(dpriv->device))->USBDeviceClose (dpriv->device);
- }
-
- priv->is_open = 0;
-
- return darwin_to_libusb (kresult);
- }
-
- CFRetain (libusb_darwin_acfl);
-
- /* add the cfSource to the aync run loop */
- CFRunLoopAddSource(libusb_darwin_acfl, priv->cfSource, kCFRunLoopCommonModes);
- }
-
- /* device opened successfully */
- dpriv->open_count++;
-
- /* create a file descriptor for notifications */
- pipe (priv->fds);
-
- /* set the pipe to be non-blocking */
- fcntl (priv->fds[1], F_SETFD, O_NONBLOCK);
-
- usbi_add_pollfd(HANDLE_CTX(dev_handle), priv->fds[0], POLLIN);
-
- usbi_dbg ("device open for access");
-
- return 0;
-}
-
-static void darwin_close (struct libusb_device_handle *dev_handle) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- IOReturn kresult;
- int i;
-
- if (dpriv->open_count == 0) {
- /* something is probably very wrong if this is the case */
- usbi_err (HANDLE_CTX (dev_handle), "Close called on a device that was not open!\n");
- return;
- }
-
- dpriv->open_count--;
-
- /* make sure all interfaces are released */
- for (i = 0 ; i < USB_MAXINTERFACES ; i++)
- if (dev_handle->claimed_interfaces & (1 << i))
- libusb_release_interface (dev_handle, i);
-
- if (0 == dpriv->open_count) {
- /* delete the device's async event source */
- if (priv->cfSource) {
- CFRunLoopRemoveSource (libusb_darwin_acfl, priv->cfSource, kCFRunLoopDefaultMode);
- CFRelease (priv->cfSource);
- priv->cfSource = NULL;
- CFRelease (libusb_darwin_acfl);
- }
-
- if (priv->is_open) {
- /* close the device */
- kresult = (*(dpriv->device))->USBDeviceClose(dpriv->device);
- if (kresult) {
- /* Log the fact that we had a problem closing the file, however failing a
- * close isn't really an error, so return success anyway */
- usbi_warn (HANDLE_CTX (dev_handle), "USBDeviceClose: %s", darwin_error_str(kresult));
- }
- }
- }
-
- /* file descriptors are maintained per-instance */
- usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]);
- close (priv->fds[1]);
- close (priv->fds[0]);
-
- priv->fds[0] = priv->fds[1] = -1;
-}
-
-static int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) {
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
-
- *config = (int) dpriv->active_config;
-
- return 0;
-}
-
-static int darwin_set_configuration(struct libusb_device_handle *dev_handle, int config) {
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- IOReturn kresult;
- int i;
-
- /* Setting configuration will invalidate the interface, so we need
- to reclaim it. First, dispose of existing interfaces, if any. */
- for (i = 0 ; i < USB_MAXINTERFACES ; i++)
- if (dev_handle->claimed_interfaces & (1 << i))
- darwin_release_interface (dev_handle, i);
-
- kresult = (*(dpriv->device))->SetConfiguration (dpriv->device, config);
- if (kresult != kIOReturnSuccess)
- return darwin_to_libusb (kresult);
-
- /* Reclaim any interfaces. */
- for (i = 0 ; i < USB_MAXINTERFACES ; i++)
- if (dev_handle->claimed_interfaces & (1 << i))
- darwin_claim_interface (dev_handle, i);
-
- dpriv->active_config = config;
-
- return 0;
-}
-
-static int darwin_get_interface (usb_device_t **darwin_device, uint8_t ifc, io_service_t *usbInterfacep) {
- IOUSBFindInterfaceRequest request;
- kern_return_t kresult;
- io_iterator_t interface_iterator;
- UInt8 bInterfaceNumber;
- int ret;
-
- *usbInterfacep = IO_OBJECT_NULL;
-
- /* Setup the Interface Request */
- request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
- request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
-
- kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator);
- if (kresult)
- return kresult;
-
- while ((*usbInterfacep = IOIteratorNext(interface_iterator))) {
- /* find the interface number */
- ret = get_ioregistry_value_number (*usbInterfacep, CFSTR("bInterfaceNumber"), kCFNumberSInt8Type,
- &bInterfaceNumber);
-
- if (ret && bInterfaceNumber == ifc) {
- break;
- }
-
- (void) IOObjectRelease (*usbInterfacep);
- }
-
- /* done with the interface iterator */
- IOObjectRelease(interface_iterator);
-
- return 0;
-}
-
-static int get_endpoints (struct libusb_device_handle *dev_handle, int iface) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
-
- /* current interface */
- struct darwin_interface *cInterface = &priv->interfaces[iface];
-
- kern_return_t kresult;
-
- u_int8_t numep, direction, number;
- u_int8_t dont_care1, dont_care3;
- u_int16_t dont_care2;
- int i;
-
- usbi_dbg ("building table of endpoints.");
-
- /* retrieve the total number of endpoints on this interface */
- kresult = (*(cInterface->interface))->GetNumEndpoints(cInterface->interface, &numep);
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "can't get number of endpoints for interface: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
-
- /* iterate through pipe references */
- for (i = 1 ; i <= numep ; i++) {
- kresult = (*(cInterface->interface))->GetPipeProperties(cInterface->interface, i, &direction, &number, &dont_care1,
- &dont_care2, &dont_care3);
-
- if (kresult != kIOReturnSuccess) {
- usbi_err (HANDLE_CTX (dev_handle), "error getting pipe information for pipe %d: %s", i, darwin_error_str(kresult));
-
- return darwin_to_libusb (kresult);
- }
-
- usbi_dbg ("interface: %i pipe %i: dir: %i number: %i", iface, i, direction, number);
-
- cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK));
- }
-
- cInterface->num_endpoints = numep;
-
- return 0;
-}
-
-static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface) {
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
- io_service_t usbInterface = IO_OBJECT_NULL;
- IOReturn kresult;
- IOCFPlugInInterface **plugInInterface = NULL;
- SInt32 score;
-
- /* current interface */
- struct darwin_interface *cInterface = &priv->interfaces[iface];
-
- kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);
- if (kresult != kIOReturnSuccess)
- return darwin_to_libusb (kresult);
-
- /* make sure we have an interface */
- if (!usbInterface && dpriv->first_config != 0) {
- usbi_info (HANDLE_CTX (dev_handle), "no interface found; setting configuration: %d", dpriv->first_config);
-
- /* set the configuration */
- kresult = darwin_set_configuration (dev_handle, dpriv->first_config);
- if (kresult != LIBUSB_SUCCESS) {
- usbi_err (HANDLE_CTX (dev_handle), "could not set configuration");
- return kresult;
- }
-
- kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
- }
-
- if (!usbInterface) {
- usbi_err (HANDLE_CTX (dev_handle), "interface not found");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- /* get an interface to the device's interface */
- kresult = IOCreatePlugInInterfaceForService (usbInterface, kIOUSBInterfaceUserClientTypeID,
- kIOCFPlugInInterfaceID, &plugInInterface, &score);
-
- /* ignore release error */
- (void)IOObjectRelease (usbInterface);
-
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "IOCreatePlugInInterfaceForService: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
-
- if (!plugInInterface) {
- usbi_err (HANDLE_CTX (dev_handle), "plugin interface not found");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- /* Do the actual claim */
- kresult = (*plugInInterface)->QueryInterface(plugInInterface,
- CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID),
- (LPVOID)&cInterface->interface);
- /* We no longer need the intermediate plug-in */
- /* Use release instead of IODestroyPlugInInterface to avoid stopping IOServices associated with this device */
- (*plugInInterface)->Release (plugInInterface);
- if (kresult || !cInterface->interface) {
- usbi_err (HANDLE_CTX (dev_handle), "QueryInterface: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
-
- /* claim the interface */
- kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface);
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceOpen: %s", darwin_error_str(kresult));
- return darwin_to_libusb (kresult);
- }
-
- /* update list of endpoints */
- kresult = get_endpoints (dev_handle, iface);
- if (kresult) {
- /* this should not happen */
- darwin_release_interface (dev_handle, iface);
- usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table");
- return kresult;
- }
-
- cInterface->cfSource = NULL;
-
- /* create async event source */
- kresult = (*(cInterface->interface))->CreateInterfaceAsyncEventSource (cInterface->interface, &cInterface->cfSource);
- if (kresult != kIOReturnSuccess) {
- usbi_err (HANDLE_CTX (dev_handle), "could not create async event source");
-
- /* can't continue without an async event source */
- (void)darwin_release_interface (dev_handle, iface);
-
- return darwin_to_libusb (kresult);
- }
-
- /* add the cfSource to the async thread's run loop */
- CFRunLoopAddSource(libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);
-
- usbi_dbg ("interface opened");
-
- return 0;
-}
-
-static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
- IOReturn kresult;
-
- /* current interface */
- struct darwin_interface *cInterface = &priv->interfaces[iface];
-
- /* Check to see if an interface is open */
- if (!cInterface->interface)
- return LIBUSB_SUCCESS;
-
- /* clean up endpoint data */
- cInterface->num_endpoints = 0;
-
- /* delete the interface's async event source */
- if (cInterface->cfSource) {
- CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);
- CFRelease (cInterface->cfSource);
- }
-
- kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface);
- if (kresult)
- usbi_warn (HANDLE_CTX (dev_handle), "USBInterfaceClose: %s", darwin_error_str(kresult));
-
- kresult = (*(cInterface->interface))->Release(cInterface->interface);
- if (kresult != kIOReturnSuccess)
- usbi_warn (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult));
-
- cInterface->interface = IO_OBJECT_NULL;
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
- IOReturn kresult;
-
- /* current interface */
- struct darwin_interface *cInterface = &priv->interfaces[iface];
-
- if (!cInterface->interface)
- return LIBUSB_ERROR_NO_DEVICE;
-
- kresult = (*(cInterface->interface))->SetAlternateInterface (cInterface->interface, altsetting);
- if (kresult != kIOReturnSuccess)
- darwin_reset_device (dev_handle);
-
- /* update list of endpoints */
- kresult = get_endpoints (dev_handle, iface);
- if (kresult) {
- /* this should not happen */
- darwin_release_interface (dev_handle, iface);
- usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table");
- return kresult;
- }
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) {
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
-
- /* current interface */
- struct darwin_interface *cInterface;
- uint8_t pipeRef, iface;
- IOReturn kresult;
-
- /* determine the interface/endpoint to use */
- if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) {
- usbi_err (HANDLE_CTX (dev_handle), "endpoint not found on any open interface");
-
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- cInterface = &priv->interfaces[iface];
-
- /* newer versions of darwin support clearing additional bits on the device's endpoint */
- kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);
- if (kresult)
- usbi_warn (HANDLE_CTX (dev_handle), "ClearPipeStall: %s", darwin_error_str (kresult));
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_reset_device(struct libusb_device_handle *dev_handle) {
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- IOUSBDeviceDescriptor descriptor;
- IOUSBConfigurationDescriptorPtr cached_configuration;
- IOUSBConfigurationDescriptor configuration;
- bool reenumerate = false;
- IOReturn kresult;
- int i;
-
- kresult = (*(dpriv->device))->ResetDevice (dpriv->device);
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "ResetDevice: %s", darwin_error_str (kresult));
- return darwin_to_libusb (kresult);
- }
-
- do {
- usbi_dbg ("darwin/reset_device: checking if device descriptor changed");
-
- /* ignore return code. if we can't get a descriptor it might be worthwhile re-enumerating anway */
- (void) darwin_request_descriptor (dpriv->device, kUSBDeviceDesc, 0, &descriptor, sizeof (descriptor));
-
- /* check if the device descriptor has changed */
- if (0 != memcmp (&dpriv->dev_descriptor, &descriptor, sizeof (descriptor))) {
- reenumerate = true;
- break;
- }
-
- /* check if any configuration descriptor has changed */
- for (i = 0 ; i < descriptor.bNumConfigurations ; ++i) {
- usbi_dbg ("darwin/reset_device: checking if configuration descriptor %d changed", i);
-
- (void) darwin_request_descriptor (dpriv->device, kUSBConfDesc, i, &configuration, sizeof (configuration));
- (*(dpriv->device))->GetConfigurationDescriptorPtr (dpriv->device, i, &cached_configuration);
-
- if (!cached_configuration || 0 != memcmp (cached_configuration, &configuration, sizeof (configuration))) {
- reenumerate = true;
- break;
- }
- }
- } while (0);
-
- if (reenumerate) {
- usbi_dbg ("darwin/reset_device: device requires reenumeration");
- (void) (*(dpriv->device))->USBDeviceReEnumerate (dpriv->device, 0);
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg ("darwin/reset_device: device reset complete");
-
- return LIBUSB_SUCCESS;
-}
-
-static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, int interface) {
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
- io_service_t usbInterface;
- CFTypeRef driver;
- IOReturn kresult;
-
- kresult = darwin_get_interface (dpriv->device, interface, &usbInterface);
- if (kresult) {
- usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult));
-
- return darwin_to_libusb (kresult);
- }
-
- driver = IORegistryEntryCreateCFProperty (usbInterface, kIOBundleIdentifierKey, kCFAllocatorDefault, 0);
- IOObjectRelease (usbInterface);
-
- if (driver) {
- CFRelease (driver);
-
- return 1;
- }
-
- /* no driver */
- return 0;
-}
-
-/* attaching/detaching kernel drivers is not currently supported (maybe in the future?) */
-static int darwin_attach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {
- (void)dev_handle;
- (void)interface;
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {
- (void)dev_handle;
- (void)interface;
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static void darwin_destroy_device(struct libusb_device *dev) {
- struct darwin_device_priv *dpriv = (struct darwin_device_priv *) dev->os_priv;
-
- if (dpriv->dev) {
- /* need to hold the lock in case this is the last reference to the device */
- usbi_mutex_lock(&darwin_cached_devices_lock);
- darwin_deref_cached_device (dpriv->dev);
- dpriv->dev = NULL;
- usbi_mutex_unlock(&darwin_cached_devices_lock);
- }
-}
-
-static int submit_bulk_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
-
- IOReturn ret;
- uint8_t transferType;
- /* None of the values below are used in libusbx for bulk transfers */
- uint8_t direction, number, interval, pipeRef, iface;
- uint16_t maxPacketSize;
-
- struct darwin_interface *cInterface;
-
- if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
- usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
-
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- cInterface = &priv->interfaces[iface];
-
- (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,
- &transferType, &maxPacketSize, &interval);
-
- if (0 != (transfer->length % maxPacketSize)) {
- /* do not need a zero packet */
- transfer->flags &= ~LIBUSB_TRANSFER_ADD_ZERO_PACKET;
- }
-
- /* submit the request */
- /* timeouts are unavailable on interrupt endpoints */
- if (transferType == kUSBInterrupt) {
- if (IS_XFERIN(transfer))
- ret = (*(cInterface->interface))->ReadPipeAsync(cInterface->interface, pipeRef, transfer->buffer,
- transfer->length, darwin_async_io_callback, itransfer);
- else
- ret = (*(cInterface->interface))->WritePipeAsync(cInterface->interface, pipeRef, transfer->buffer,
- transfer->length, darwin_async_io_callback, itransfer);
- } else {
- itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;
-
- if (IS_XFERIN(transfer))
- ret = (*(cInterface->interface))->ReadPipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,
- transfer->length, transfer->timeout, transfer->timeout,
- darwin_async_io_callback, (void *)itransfer);
- else
- ret = (*(cInterface->interface))->WritePipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,
- transfer->length, transfer->timeout, transfer->timeout,
- darwin_async_io_callback, (void *)itransfer);
- }
-
- if (ret)
- usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out",
- darwin_error_str(ret), ret);
-
- return darwin_to_libusb (ret);
-}
-
-static int submit_iso_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
-
- IOReturn kresult;
- uint8_t direction, number, interval, pipeRef, iface, transferType;
- uint16_t maxPacketSize;
- UInt64 frame;
- AbsoluteTime atTime;
- int i;
-
- struct darwin_interface *cInterface;
-
- /* construct an array of IOUSBIsocFrames, reuse the old one if possible */
- if (tpriv->isoc_framelist && tpriv->num_iso_packets != transfer->num_iso_packets) {
- free(tpriv->isoc_framelist);
- tpriv->isoc_framelist = NULL;
- }
-
- if (!tpriv->isoc_framelist) {
- tpriv->num_iso_packets = transfer->num_iso_packets;
- tpriv->isoc_framelist = (IOUSBIsocFrame*) calloc (transfer->num_iso_packets, sizeof(IOUSBIsocFrame));
- if (!tpriv->isoc_framelist)
- return LIBUSB_ERROR_NO_MEM;
- }
-
- /* copy the frame list from the libusbx descriptor (the structures differ only is member order) */
- for (i = 0 ; i < transfer->num_iso_packets ; i++)
- tpriv->isoc_framelist[i].frReqCount = transfer->iso_packet_desc[i].length;
-
- /* determine the interface/endpoint to use */
- if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
- usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
-
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- cInterface = &priv->interfaces[iface];
-
- /* determine the properties of this endpoint and the speed of the device */
- (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,
- &transferType, &maxPacketSize, &interval);
-
- /* Last but not least we need the bus frame number */
- kresult = (*(cInterface->interface))->GetBusFrameNumber(cInterface->interface, &frame, &atTime);
- if (kresult) {
- usbi_err (TRANSFER_CTX (transfer), "failed to get bus frame number: %d", kresult);
- free(tpriv->isoc_framelist);
- tpriv->isoc_framelist = NULL;
-
- return darwin_to_libusb (kresult);
- }
-
- (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,
- &transferType, &maxPacketSize, &interval);
-
- /* schedule for a frame a little in the future */
- frame += 4;
-
- if (cInterface->frames[transfer->endpoint] && frame < cInterface->frames[transfer->endpoint])
- frame = cInterface->frames[transfer->endpoint];
-
- /* submit the request */
- if (IS_XFERIN(transfer))
- kresult = (*(cInterface->interface))->ReadIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,
- transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,
- itransfer);
- else
- kresult = (*(cInterface->interface))->WriteIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,
- transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,
- itransfer);
-
- if (LIBUSB_SPEED_FULL == transfer->dev_handle->dev->speed)
- /* Full speed */
- cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1));
- else
- /* High/super speed */
- cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1)) / 8;
-
- if (kresult != kIOReturnSuccess) {
- usbi_err (TRANSFER_CTX (transfer), "isochronous transfer failed (dir: %s): %s", IS_XFERIN(transfer) ? "In" : "Out",
- darwin_error_str(kresult));
- free (tpriv->isoc_framelist);
- tpriv->isoc_framelist = NULL;
- }
-
- return darwin_to_libusb (kresult);
-}
-
-static int submit_control_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer;
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
- struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
-
- IOReturn kresult;
-
- bzero(&tpriv->req, sizeof(tpriv->req));
-
- /* IOUSBDeviceInterface expects the request in cpu endianess */
- tpriv->req.bmRequestType = setup->bmRequestType;
- tpriv->req.bRequest = setup->bRequest;
- /* these values should be in bus order from libusb_fill_control_setup */
- tpriv->req.wValue = OSSwapLittleToHostInt16 (setup->wValue);
- tpriv->req.wIndex = OSSwapLittleToHostInt16 (setup->wIndex);
- tpriv->req.wLength = OSSwapLittleToHostInt16 (setup->wLength);
- /* data is stored after the libusbx control block */
- tpriv->req.pData = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
- tpriv->req.completionTimeout = transfer->timeout;
- tpriv->req.noDataTimeout = transfer->timeout;
-
- itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;
-
- /* all transfers in libusb-1.0 are async */
-
- if (transfer->endpoint) {
- struct darwin_interface *cInterface;
- uint8_t pipeRef, iface;
-
- if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
- usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
-
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- cInterface = &priv->interfaces[iface];
-
- kresult = (*(cInterface->interface))->ControlRequestAsyncTO (cInterface->interface, pipeRef, &(tpriv->req), darwin_async_io_callback, itransfer);
- } else
- /* control request on endpoint 0 */
- kresult = (*(dpriv->device))->DeviceRequestAsyncTO(dpriv->device, &(tpriv->req), darwin_async_io_callback, itransfer);
-
- if (kresult != kIOReturnSuccess)
- usbi_err (TRANSFER_CTX (transfer), "control request failed: %s", darwin_error_str(kresult));
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_submit_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return submit_control_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- return submit_bulk_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return submit_iso_transfer(itransfer);
- default:
- usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static int cancel_control_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
- IOReturn kresult;
-
- usbi_warn (ITRANSFER_CTX (itransfer), "aborting all transactions control pipe");
-
- if (!dpriv->device)
- return LIBUSB_ERROR_NO_DEVICE;
-
- kresult = (*(dpriv->device))->USBDeviceAbortPipeZero (dpriv->device);
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_abort_transfers (struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
- struct darwin_interface *cInterface;
- uint8_t pipeRef, iface;
- IOReturn kresult;
-
- if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
- usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
-
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- cInterface = &priv->interfaces[iface];
-
- if (!dpriv->device)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_warn (ITRANSFER_CTX (itransfer), "aborting all transactions on interface %d pipe %d", iface, pipeRef);
-
- /* abort transactions */
- (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef);
-
- usbi_dbg ("calling clear pipe stall to clear the data toggle bit");
-
- /* newer versions of darwin support clearing additional bits on the device's endpoint */
- kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);
-
- return darwin_to_libusb (kresult);
-}
-
-static int darwin_cancel_transfer(struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return cancel_control_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return darwin_abort_transfers (itransfer);
- default:
- usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static void darwin_clear_transfer_priv (struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
-
- if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS && tpriv->isoc_framelist) {
- free (tpriv->isoc_framelist);
- tpriv->isoc_framelist = NULL;
- }
-}
-
-static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) {
- struct usbi_transfer *itransfer = (struct usbi_transfer *)refcon;
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
- struct darwin_msg_async_io_complete message = {.itransfer = itransfer, .result = result,
- .size = (UInt32) (uintptr_t) arg0};
-
- usbi_dbg ("an async io operation has completed");
-
- /* if requested write a zero packet */
- if (kIOReturnSuccess == result && IS_XFEROUT(transfer) && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) {
- struct darwin_interface *cInterface;
- uint8_t iface, pipeRef;
-
- (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface);
- cInterface = &priv->interfaces[iface];
-
- (*(cInterface->interface))->WritePipe (cInterface->interface, pipeRef, transfer->buffer, 0);
- }
-
- /* send a completion message to the device's file descriptor */
- write (priv->fds[1], &message, sizeof (message));
-}
-
-static int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) {
- if (itransfer->flags & USBI_TRANSFER_TIMED_OUT)
- result = kIOUSBTransactionTimeout;
-
- switch (result) {
- case kIOReturnUnderrun:
- case kIOReturnSuccess:
- return LIBUSB_TRANSFER_COMPLETED;
- case kIOReturnAborted:
- return LIBUSB_TRANSFER_CANCELLED;
- case kIOUSBPipeStalled:
- usbi_dbg ("transfer error: pipe is stalled");
- return LIBUSB_TRANSFER_STALL;
- case kIOReturnOverrun:
- usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: data overrun");
- return LIBUSB_TRANSFER_OVERFLOW;
- case kIOUSBTransactionTimeout:
- usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: timed out");
- itransfer->flags |= USBI_TRANSFER_TIMED_OUT;
- return LIBUSB_TRANSFER_TIMED_OUT;
- default:
- usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: %s (value = 0x%08x)", darwin_error_str (result), result);
- return LIBUSB_TRANSFER_ERROR;
- }
-}
-
-static void darwin_handle_callback (struct usbi_transfer *itransfer, kern_return_t result, UInt32 io_size) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- int isIsoc = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type;
- int isBulk = LIBUSB_TRANSFER_TYPE_BULK == transfer->type;
- int isControl = LIBUSB_TRANSFER_TYPE_CONTROL == transfer->type;
- int isInterrupt = LIBUSB_TRANSFER_TYPE_INTERRUPT == transfer->type;
- int i;
-
- if (!isIsoc && !isBulk && !isControl && !isInterrupt) {
- usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
- return;
- }
-
- usbi_dbg ("handling %s completion with kernel status %d",
- isControl ? "control" : isBulk ? "bulk" : isIsoc ? "isoc" : "interrupt", result);
-
- if (kIOReturnSuccess == result || kIOReturnUnderrun == result) {
- if (isIsoc && tpriv->isoc_framelist) {
- /* copy isochronous results back */
-
- for (i = 0; i < transfer->num_iso_packets ; i++) {
- struct libusb_iso_packet_descriptor *lib_desc = &transfer->iso_packet_desc[i];
- lib_desc->status = darwin_to_libusb (tpriv->isoc_framelist[i].frStatus);
- lib_desc->actual_length = tpriv->isoc_framelist[i].frActCount;
- }
- } else if (!isIsoc)
- itransfer->transferred += io_size;
- }
-
- /* it is ok to handle cancelled transfers without calling usbi_handle_transfer_cancellation (we catch timeout transfers) */
- usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, result));
-}
-
-static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) {
- struct darwin_msg_async_io_complete message;
- POLL_NFDS_TYPE i = 0;
- ssize_t ret;
-
- usbi_mutex_lock(&ctx->open_devs_lock);
-
- for (i = 0; i < nfds && num_ready > 0; i++) {
- struct pollfd *pollfd = &fds[i];
-
- usbi_dbg ("checking fd %i with revents = %x", pollfd->fd, pollfd->revents);
-
- if (!pollfd->revents)
- continue;
-
- num_ready--;
-
- if (pollfd->revents & POLLERR) {
- /* this probably will never happen so ignore the error an move on. */
- continue;
- }
-
- /* there is only one type of message */
- ret = read (pollfd->fd, &message, sizeof (message));
- if (ret < (ssize_t) sizeof (message)) {
- usbi_dbg ("WARNING: short read on async io completion pipe\n");
- continue;
- }
-
- darwin_handle_callback (message.itransfer, message.result, message.size);
- }
-
- usbi_mutex_unlock(&ctx->open_devs_lock);
-
- return 0;
-}
-
-static int darwin_clock_gettime(int clk_id, struct timespec *tp) {
- mach_timespec_t sys_time;
- clock_serv_t clock_ref;
-
- switch (clk_id) {
- case USBI_CLOCK_REALTIME:
- /* CLOCK_REALTIME represents time since the epoch */
- clock_ref = clock_realtime;
- break;
- case USBI_CLOCK_MONOTONIC:
- /* use system boot time as reference for the monotonic clock */
- clock_ref = clock_monotonic;
- break;
- default:
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- clock_get_time (clock_ref, &sys_time);
-
- tp->tv_sec = sys_time.tv_sec;
- tp->tv_nsec = sys_time.tv_nsec;
-
- return 0;
-}
-
-const struct usbi_os_backend darwin_backend = {
- .name = "Darwin",
- .caps = 0,
- .init = darwin_init,
- .exit = darwin_exit,
- .get_device_list = NULL, /* not needed */
- .get_device_descriptor = darwin_get_device_descriptor,
- .get_active_config_descriptor = darwin_get_active_config_descriptor,
- .get_config_descriptor = darwin_get_config_descriptor,
-
- .open = darwin_open,
- .close = darwin_close,
- .get_configuration = darwin_get_configuration,
- .set_configuration = darwin_set_configuration,
- .claim_interface = darwin_claim_interface,
- .release_interface = darwin_release_interface,
-
- .set_interface_altsetting = darwin_set_interface_altsetting,
- .clear_halt = darwin_clear_halt,
- .reset_device = darwin_reset_device,
-
- .kernel_driver_active = darwin_kernel_driver_active,
- .detach_kernel_driver = darwin_detach_kernel_driver,
- .attach_kernel_driver = darwin_attach_kernel_driver,
-
- .destroy_device = darwin_destroy_device,
-
- .submit_transfer = darwin_submit_transfer,
- .cancel_transfer = darwin_cancel_transfer,
- .clear_transfer_priv = darwin_clear_transfer_priv,
-
- .handle_events = op_handle_events,
-
- .clock_gettime = darwin_clock_gettime,
-
- .device_priv_size = sizeof(struct darwin_device_priv),
- .device_handle_priv_size = sizeof(struct darwin_device_handle_priv),
- .transfer_priv_size = sizeof(struct darwin_transfer_priv),
- .add_iso_packet_size = 0,
-};
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.h
deleted file mode 100644
index 53b8542b13..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/darwin_usb.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * darwin backend for libusbx 1.0
- * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if !defined(LIBUSB_DARWIN_H)
-#define LIBUSB_DARWIN_H
-
-#include "libusbi.h"
-
-#include <IOKit/IOTypes.h>
-#include <IOKit/IOCFBundle.h>
-#include <IOKit/usb/IOUSBLib.h>
-#include <IOKit/IOCFPlugIn.h>
-
-/* IOUSBInterfaceInferface */
-#if defined (kIOUSBInterfaceInterfaceID550)
-
-#define usb_interface_t IOUSBInterfaceInterface550
-#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID550
-#define InterfaceVersion 550
-
-#elif defined (kIOUSBInterfaceInterfaceID500)
-
-#define usb_interface_t IOUSBInterfaceInterface500
-#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID500
-#define InterfaceVersion 500
-
-#elif defined (kIOUSBInterfaceInterfaceID300)
-
-#define usb_interface_t IOUSBInterfaceInterface300
-#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300
-#define InterfaceVersion 300
-
-#elif defined (kIOUSBInterfaceInterfaceID245)
-
-#define usb_interface_t IOUSBInterfaceInterface245
-#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245
-#define InterfaceVersion 245
-
-#elif defined (kIOUSBInterfaceInterfaceID220)
-
-#define usb_interface_t IOUSBInterfaceInterface220
-#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220
-#define InterfaceVersion 220
-
-#else
-
-#error "IOUSBFamily is too old. Please upgrade your OS"
-
-#endif
-
-/* IOUSBDeviceInterface */
-#if defined (kIOUSBDeviceInterfaceID500)
-
-#define usb_device_t IOUSBDeviceInterface500
-#define DeviceInterfaceID kIOUSBDeviceInterfaceID500
-#define DeviceVersion 500
-
-#elif defined (kIOUSBDeviceInterfaceID320)
-
-#define usb_device_t IOUSBDeviceInterface320
-#define DeviceInterfaceID kIOUSBDeviceInterfaceID320
-#define DeviceVersion 320
-
-#elif defined (kIOUSBDeviceInterfaceID300)
-
-#define usb_device_t IOUSBDeviceInterface300
-#define DeviceInterfaceID kIOUSBDeviceInterfaceID300
-#define DeviceVersion 300
-
-#elif defined (kIOUSBDeviceInterfaceID245)
-
-#define usb_device_t IOUSBDeviceInterface245
-#define DeviceInterfaceID kIOUSBDeviceInterfaceID245
-#define DeviceVersion 245
-
-#elif defined (kIOUSBDeviceInterfaceID220)
-#define usb_device_t IOUSBDeviceInterface197
-#define DeviceInterfaceID kIOUSBDeviceInterfaceID197
-#define DeviceVersion 197
-
-#else
-
-#error "IOUSBFamily is too old. Please upgrade your OS"
-
-#endif
-
-#if !defined(IO_OBJECT_NULL)
-#define IO_OBJECT_NULL ((io_object_t) 0)
-#endif
-
-typedef IOCFPlugInInterface *io_cf_plugin_ref_t;
-typedef IONotificationPortRef io_notification_port_t;
-
-/* private structures */
-struct darwin_cached_device {
- struct list_head list;
- IOUSBDeviceDescriptor dev_descriptor;
- UInt32 location;
- UInt64 parent_session;
- UInt64 session;
- UInt16 address;
- char sys_path[21];
- usb_device_t **device;
- int open_count;
- UInt8 first_config, active_config, port;
- int can_enumerate;
- int refcount;
-};
-
-struct darwin_device_priv {
- struct darwin_cached_device *dev;
-};
-
-struct darwin_device_handle_priv {
- int is_open;
- CFRunLoopSourceRef cfSource;
- int fds[2];
-
- struct darwin_interface {
- usb_interface_t **interface;
- uint8_t num_endpoints;
- CFRunLoopSourceRef cfSource;
- uint64_t frames[256];
- uint8_t endpoint_addrs[USB_MAXENDPOINTS];
- } interfaces[USB_MAXINTERFACES];
-};
-
-struct darwin_transfer_priv {
- /* Isoc */
- IOUSBIsocFrame *isoc_framelist;
- int num_iso_packets;
-
- /* Control */
- IOUSBDevRequestTO req;
-
- /* Bulk */
-};
-
-/* structure for signaling io completion */
-struct darwin_msg_async_io_complete {
- struct usbi_transfer *itransfer;
- IOReturn result;
- UInt32 size;
-};
-
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_netlink.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_netlink.c
deleted file mode 100644
index 3a68f69d9c..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_netlink.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */
-/*
- * Linux usbfs backend for libusb
- * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org>
- * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-
-#include "libusb.h"
-#include "libusbi.h"
-#include "linux_usbfs.h"
-
-#include <linux/netlink.h>
-#include <linux/filter.h>
-
-#define KERNEL 1
-
-static int linux_netlink_socket = -1;
-static pthread_t libusb_linux_event_thread;
-
-static void *linux_netlink_event_thread_main(void *arg);
-
-struct sockaddr_nl snl = { .nl_family=AF_NETLINK, .nl_groups=KERNEL };
-
-int linux_netlink_start_event_monitor(void)
-{
- int ret;
-
- snl.nl_groups = KERNEL;
-
- linux_netlink_socket = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT);
- if (-1 == linux_netlink_socket) {
- return LIBUSB_ERROR_OTHER;
- }
-
- ret = bind(linux_netlink_socket, (struct sockaddr *) &snl, sizeof(snl));
- if (0 != ret) {
- return LIBUSB_ERROR_OTHER;
- }
-
- /* TODO -- add authentication */
- /* setsockopt(linux_netlink_socket, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); */
-
- ret = pthread_create(&libusb_linux_event_thread, NULL, linux_netlink_event_thread_main, NULL);
- if (0 != ret) {
- return LIBUSB_ERROR_OTHER;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-int linux_netlink_stop_event_monitor(void)
-{
- int r;
-
- if (-1 == linux_netlink_socket) {
- /* already closed. nothing to do */
- return LIBUSB_SUCCESS;
- }
-
- r = close(linux_netlink_socket);
- if (0 > r) {
- usbi_err(NULL, "error closing netlink socket. %s", strerror(errno));
- return LIBUSB_ERROR_OTHER;
- }
-
- pthread_cancel(libusb_linux_event_thread);
-
- linux_netlink_socket = -1;
-
- return LIBUSB_SUCCESS;
-}
-
-static const char *netlink_message_parse (const char *buffer, size_t len, const char *key)
-{
- size_t keylen = strlen(key);
- size_t offset;
-
- for (offset = 0 ; offset < len && '\0' != buffer[offset] ; offset += strlen(buffer + offset) + 1) {
- if (0 == strncmp(buffer + offset, key, keylen) &&
- '=' == buffer[offset + keylen]) {
- return buffer + offset + keylen + 1;
- }
- }
-
- return NULL;
-}
-
-/* parse parts of netlink message common to both libudev and the kernel */
-static int linux_netlink_parse(char *buffer, size_t len, int *detached, const char **sys_name,
- uint8_t *busnum, uint8_t *devaddr) {
- const char *tmp;
- int i;
-
- errno = 0;
-
- *sys_name = NULL;
- *detached = 0;
- *busnum = 0;
- *devaddr = 0;
-
- tmp = netlink_message_parse((const char *) buffer, len, "ACTION");
- if (tmp == NULL)
- return -1;
- if (0 == strcmp(tmp, "remove")) {
- *detached = 1;
- } else if (0 != strcmp(tmp, "add")) {
- usbi_dbg("unknown device action %s", tmp);
- return -1;
- }
-
- /* check that this is a usb message */
- tmp = netlink_message_parse(buffer, len, "SUBSYSTEM");
- if (NULL == tmp || 0 != strcmp(tmp, "usb")) {
- /* not usb. ignore */
- return -1;
- }
-
- tmp = netlink_message_parse(buffer, len, "BUSNUM");
- if (NULL == tmp) {
- /* no bus number (likely a usb interface). ignore*/
- return -1;
- }
-
- *busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);
- if (errno) {
- errno = 0;
- return -1;
- }
-
- tmp = netlink_message_parse(buffer, len, "DEVNUM");
- if (NULL == tmp) {
- return -1;
- }
-
- *devaddr = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);
- if (errno) {
- errno = 0;
- return -1;
- }
-
- tmp = netlink_message_parse(buffer, len, "DEVPATH");
- if (NULL == tmp) {
- return -1;
- }
-
- for (i = strlen(tmp) - 1 ; i ; --i) {
- if ('/' ==tmp[i]) {
- *sys_name = tmp + i + 1;
- break;
- }
- }
-
- /* found a usb device */
- return 0;
-}
-
-static int linux_netlink_read_message(void)
-{
- unsigned char buffer[1024];
- struct iovec iov = {.iov_base = buffer, .iov_len = sizeof(buffer)};
- struct msghdr meh = { .msg_iov=&iov, .msg_iovlen=1,
- .msg_name=&snl, .msg_namelen=sizeof(snl) };
- const char *sys_name = NULL;
- uint8_t busnum, devaddr;
- int detached, r;
- size_t len;
-
- /* read netlink message */
- memset(buffer, 0, sizeof(buffer));
- len = recvmsg(linux_netlink_socket, &meh, 0);
- if (len < 32) {
- if (errno != EAGAIN)
- usbi_dbg("error recieving message from netlink");
- return -1;
- }
-
- /* TODO -- authenticate this message is from the kernel or udevd */
-
- r = linux_netlink_parse(buffer, len, &detached, &sys_name,
- &busnum, &devaddr);
- if (r)
- return r;
-
- usbi_dbg("netlink hotplug found device busnum: %hhu, devaddr: %hhu, sys_name: %s, removed: %s",
- busnum, devaddr, sys_name, detached ? "yes" : "no");
-
- /* signal device is available (or not) to all contexts */
- if (detached)
- linux_hotplug_disconnected(busnum, devaddr, sys_name);
- else
- linux_hotplug_enumerate(busnum, devaddr, sys_name);
-
- return 0;
-}
-
-static void *linux_netlink_event_thread_main(void *arg)
-{
- struct pollfd fds = {.fd = linux_netlink_socket,
- .events = POLLIN};
-
- /* silence compiler warning */
- (void) arg;
-
- while (1 == poll(&fds, 1, -1)) {
- if (POLLIN != fds.revents) {
- break;
- }
-
- usbi_mutex_static_lock(&linux_hotplug_lock);
- linux_netlink_read_message();
- usbi_mutex_static_unlock(&linux_hotplug_lock);
- }
-
- return NULL;
-}
-
-void linux_netlink_hotplug_poll(void)
-{
- int r;
-
- usbi_mutex_static_lock(&linux_hotplug_lock);
- do {
- r = linux_netlink_read_message();
- } while (r == 0);
- usbi_mutex_static_unlock(&linux_hotplug_lock);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_udev.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_udev.c
deleted file mode 100644
index 5a2aadfd44..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_udev.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */
-/*
- * Linux usbfs backend for libusb
- * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org>
- * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright (c) 2012-2013 Nathan Hjelm <hjelmn@mac.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <assert.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <libudev.h>
-
-#include "libusb.h"
-#include "libusbi.h"
-#include "linux_usbfs.h"
-
-/* udev context */
-static struct udev *udev_ctx = NULL;
-static int udev_monitor_fd = -1;
-static struct udev_monitor *udev_monitor = NULL;
-static pthread_t linux_event_thread;
-
-static void udev_hotplug_event(struct udev_device* udev_dev);
-static void *linux_udev_event_thread_main(void *arg);
-
-int linux_udev_start_event_monitor(void)
-{
- int r;
-
- assert(udev_ctx == NULL);
- udev_ctx = udev_new();
- if (!udev_ctx) {
- usbi_err(NULL, "could not create udev context");
- return LIBUSB_ERROR_OTHER;
- }
-
- udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev");
- if (!udev_monitor) {
- usbi_err(NULL, "could not initialize udev monitor");
- goto err_free_ctx;
- }
-
- r = udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "usb", 0);
- if (r) {
- usbi_err(NULL, "could not initialize udev monitor filter for \"usb\" subsystem");
- goto err_free_monitor;
- }
-
- if (udev_monitor_enable_receiving(udev_monitor)) {
- usbi_err(NULL, "failed to enable the udev monitor");
- goto err_free_monitor;
- }
-
- udev_monitor_fd = udev_monitor_get_fd(udev_monitor);
-
- /* Some older versions of udev are not non-blocking by default,
- * so make sure this is set */
- r = fcntl(udev_monitor_fd, F_GETFL);
- if (r == -1) {
- usbi_err(NULL, "getting udev monitor fd flags (%d)", errno);
- goto err_free_monitor;
- }
- r = fcntl(udev_monitor_fd, F_SETFL, r | O_NONBLOCK);
- if (r) {
- usbi_err(NULL, "setting udev monitor fd flags (%d)", errno);
- goto err_free_monitor;
- }
-
- r = pthread_create(&linux_event_thread, NULL, linux_udev_event_thread_main, NULL);
- if (r) {
- usbi_err(NULL, "creating hotplug event thread (%d)", r);
- goto err_free_monitor;
- }
-
- return LIBUSB_SUCCESS;
-
-err_free_monitor:
- udev_monitor_unref(udev_monitor);
- udev_monitor = NULL;
- udev_monitor_fd = -1;
-err_free_ctx:
- udev_unref(udev_ctx);
- udev_ctx = NULL;
- return LIBUSB_ERROR_OTHER;
-}
-
-int linux_udev_stop_event_monitor(void)
-{
- assert(udev_ctx != NULL);
- assert(udev_monitor != NULL);
- assert(udev_monitor_fd != -1);
-
- /* Cancel the event thread. This is the only way to guarantee the
- thread exits since closing the monitor fd won't necessarily cause
- poll to return. */
- pthread_cancel(linux_event_thread);
- pthread_join(linux_event_thread, NULL);
-
- /* Release the udev monitor */
- udev_monitor_unref(udev_monitor);
- udev_monitor = NULL;
- udev_monitor_fd = -1;
-
- /* Clean up the udev context */
- udev_unref(udev_ctx);
- udev_ctx = NULL;
-
- return LIBUSB_SUCCESS;
-}
-
-static void *linux_udev_event_thread_main(void *arg)
-{
- struct udev_device* udev_dev;
- struct pollfd fds = {.fd = udev_monitor_fd,
- .events = POLLIN};
-
- usbi_dbg("udev event thread entering.");
-
- while (1 == poll(&fds, 1, -1)) {
- if (NULL == udev_monitor || POLLIN != fds.revents) {
- break;
- }
-
- usbi_mutex_static_lock(&linux_hotplug_lock);
- udev_dev = udev_monitor_receive_device(udev_monitor);
- if (udev_dev)
- udev_hotplug_event(udev_dev);
- usbi_mutex_static_unlock(&linux_hotplug_lock);
- }
-
- usbi_dbg("udev event thread exiting");
-
- return NULL;
-}
-
-static int udev_device_info(struct libusb_context *ctx, int detached,
- struct udev_device *udev_dev, uint8_t *busnum,
- uint8_t *devaddr, const char **sys_name) {
- const char *dev_node;
-
- dev_node = udev_device_get_devnode(udev_dev);
- if (!dev_node) {
- return LIBUSB_ERROR_OTHER;
- }
-
- *sys_name = udev_device_get_sysname(udev_dev);
- if (!*sys_name) {
- return LIBUSB_ERROR_OTHER;
- }
-
- return linux_get_device_address(ctx, detached, busnum, devaddr,
- dev_node, *sys_name);
-}
-
-static void udev_hotplug_event(struct udev_device* udev_dev)
-{
- const char* udev_action;
- const char* sys_name = NULL;
- uint8_t busnum = 0, devaddr = 0;
- int detached;
- int r;
-
- do {
- udev_action = udev_device_get_action(udev_dev);
- if (!udev_action) {
- break;
- }
-
- detached = !strncmp(udev_action, "remove", 6);
-
- r = udev_device_info(NULL, detached, udev_dev, &busnum, &devaddr, &sys_name);
- if (LIBUSB_SUCCESS != r) {
- break;
- }
-
- usbi_dbg("udev hotplug event. action: %s.", udev_action);
-
- if (strncmp(udev_action, "add", 3) == 0) {
- linux_hotplug_enumerate(busnum, devaddr, sys_name);
- } else if (detached) {
- linux_hotplug_disconnected(busnum, devaddr, sys_name);
- } else {
- usbi_err(NULL, "ignoring udev action %s", udev_action);
- }
- } while (0);
-
- udev_device_unref(udev_dev);
-}
-
-int linux_udev_scan_devices(struct libusb_context *ctx)
-{
- struct udev_enumerate *enumerator;
- struct udev_list_entry *devices, *entry;
- struct udev_device *udev_dev;
- const char *sys_name;
- int r;
-
- assert(udev_ctx != NULL);
-
- enumerator = udev_enumerate_new(udev_ctx);
- if (NULL == enumerator) {
- usbi_err(ctx, "error creating udev enumerator");
- return LIBUSB_ERROR_OTHER;
- }
-
- udev_enumerate_add_match_subsystem(enumerator, "usb");
- udev_enumerate_scan_devices(enumerator);
- devices = udev_enumerate_get_list_entry(enumerator);
-
- udev_list_entry_foreach(entry, devices) {
- const char *path = udev_list_entry_get_name(entry);
- uint8_t busnum = 0, devaddr = 0;
-
- udev_dev = udev_device_new_from_syspath(udev_ctx, path);
-
- r = udev_device_info(ctx, 0, udev_dev, &busnum, &devaddr, &sys_name);
- if (r) {
- udev_device_unref(udev_dev);
- continue;
- }
-
- linux_enumerate_device(ctx, busnum, devaddr, sys_name);
- udev_device_unref(udev_dev);
- }
-
- udev_enumerate_unref(enumerator);
-
- return LIBUSB_SUCCESS;
-}
-
-void linux_udev_hotplug_poll(void)
-{
- struct udev_device* udev_dev;
-
- usbi_mutex_static_lock(&linux_hotplug_lock);
- do {
- udev_dev = udev_monitor_receive_device(udev_monitor);
- if (udev_dev) {
- usbi_dbg("Handling hotplug event from hotplug_poll");
- udev_hotplug_event(udev_dev);
- }
- } while (udev_dev);
- usbi_mutex_static_unlock(&linux_hotplug_lock);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.c
deleted file mode 100644
index 09288af719..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.c
+++ /dev/null
@@ -1,2568 +0,0 @@
-/*
- * Linux usbfs backend for libusbx
- * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- * Copyright © 2013 Nathan Hjelm <hjelmn@mac.com>
- * Copyright © 2012-2013 Hans de Goede <hdegoede@redhat.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <assert.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <unistd.h>
-
-#include "libusb.h"
-#include "libusbi.h"
-#include "linux_usbfs.h"
-
-/* sysfs vs usbfs:
- * opening a usbfs node causes the device to be resumed, so we attempt to
- * avoid this during enumeration.
- *
- * sysfs allows us to read the kernel's in-memory copies of device descriptors
- * and so forth, avoiding the need to open the device:
- * - The binary "descriptors" file contains all config descriptors since
- * 2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed
- * - The binary "descriptors" file was added in 2.6.23, commit
- * 69d42a78f935d19384d1f6e4f94b65bb162b36df, but it only contains the
- * active config descriptors
- * - The "busnum" file was added in 2.6.22, commit
- * 83f7d958eab2fbc6b159ee92bf1493924e1d0f72
- * - The "devnum" file has been present since pre-2.6.18
- * - the "bConfigurationValue" file has been present since pre-2.6.18
- *
- * If we have bConfigurationValue, busnum, and devnum, then we can determine
- * the active configuration without having to open the usbfs node in RDWR mode.
- * The busnum file is important as that is the only way we can relate sysfs
- * devices to usbfs nodes.
- *
- * If we also have all descriptors, we can obtain the device descriptor and
- * configuration without touching usbfs at all.
- */
-
-/* endianness for multi-byte fields:
- *
- * Descriptors exposed by usbfs have the multi-byte fields in the device
- * descriptor as host endian. Multi-byte fields in the other descriptors are
- * bus-endian. The kernel documentation says otherwise, but it is wrong.
- *
- * In sysfs all descriptors are bus-endian.
- */
-
-static const char *usbfs_path = NULL;
-
-/* use usbdev*.* device names in /dev instead of the usbfs bus directories */
-static int usbdev_names = 0;
-
-/* Linux 2.6.32 adds support for a bulk continuation URB flag. this basically
- * allows us to mark URBs as being part of a specific logical transfer when
- * we submit them to the kernel. then, on any error except a cancellation, all
- * URBs within that transfer will be cancelled and no more URBs will be
- * accepted for the transfer, meaning that no more data can creep in.
- *
- * The BULK_CONTINUATION flag must be set on all URBs within a bulk transfer
- * (in either direction) except the first.
- * For IN transfers, we must also set SHORT_NOT_OK on all URBs except the
- * last; it means that the kernel should treat a short reply as an error.
- * For OUT transfers, SHORT_NOT_OK must not be set. it isn't needed (OUT
- * transfers can't be short unless there's already some sort of error), and
- * setting this flag is disallowed (a kernel with USB debugging enabled will
- * reject such URBs).
- */
-static int supports_flag_bulk_continuation = -1;
-
-/* Linux 2.6.31 fixes support for the zero length packet URB flag. This
- * allows us to mark URBs that should be followed by a zero length data
- * packet, which can be required by device- or class-specific protocols.
- */
-static int supports_flag_zero_packet = -1;
-
-/* clock ID for monotonic clock, as not all clock sources are available on all
- * systems. appropriate choice made at initialization time. */
-static clockid_t monotonic_clkid = -1;
-
-/* Linux 2.6.22 (commit 83f7d958eab2fbc6b159ee92bf1493924e1d0f72) adds a busnum
- * to sysfs, so we can relate devices. This also implies that we can read
- * the active configuration through bConfigurationValue */
-static int sysfs_can_relate_devices = -1;
-
-/* Linux 2.6.26 (commit 217a9081d8e69026186067711131b77f0ce219ed) adds all
- * config descriptors (rather then just the active config) to the sysfs
- * descriptors file, so from then on we can use them. */
-static int sysfs_has_descriptors = -1;
-
-/* how many times have we initted (and not exited) ? */
-static volatile int init_count = 0;
-
-/* Serialize hotplug start/stop, scan-devices, event-thread, and poll */
-usbi_mutex_static_t linux_hotplug_lock = USBI_MUTEX_INITIALIZER;
-
-static int linux_start_event_monitor(void);
-static int linux_stop_event_monitor(void);
-static int linux_scan_devices(struct libusb_context *ctx);
-static int sysfs_scan_device(struct libusb_context *ctx, const char *devname);
-static int detach_kernel_driver_and_claim(struct libusb_device_handle *, int);
-
-#if !defined(USE_UDEV)
-static int linux_default_scan_devices (struct libusb_context *ctx);
-#endif
-
-struct linux_device_priv {
- char *sysfs_dir;
- unsigned char *descriptors;
- int descriptors_len;
- int active_config; /* cache val for !sysfs_can_relate_devices */
-};
-
-struct linux_device_handle_priv {
- int fd;
- uint32_t caps;
-};
-
-enum reap_action {
- NORMAL = 0,
- /* submission failed after the first URB, so await cancellation/completion
- * of all the others */
- SUBMIT_FAILED,
-
- /* cancelled by user or timeout */
- CANCELLED,
-
- /* completed multi-URB transfer in non-final URB */
- COMPLETED_EARLY,
-
- /* one or more urbs encountered a low-level error */
- ERROR,
-};
-
-struct linux_transfer_priv {
- union {
- struct usbfs_urb *urbs;
- struct usbfs_urb **iso_urbs;
- };
-
- enum reap_action reap_action;
- int num_urbs;
- int num_retired;
- enum libusb_transfer_status reap_status;
-
- /* next iso packet in user-supplied transfer to be populated */
- int iso_packet_offset;
-};
-
-static int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev);
- char path[PATH_MAX];
- int fd;
-
- if (usbdev_names)
- snprintf(path, PATH_MAX, "%s/usbdev%d.%d",
- usbfs_path, dev->bus_number, dev->device_address);
- else
- snprintf(path, PATH_MAX, "%s/%03d/%03d",
- usbfs_path, dev->bus_number, dev->device_address);
-
- fd = open(path, mode);
- if (fd != -1)
- return fd; /* Success */
-
- if (!silent) {
- usbi_err(ctx, "libusbx couldn't open USB device %s: %s",
- path, strerror(errno));
- if (errno == EACCES && mode == O_RDWR)
- usbi_err(ctx, "libusbx requires write access to USB "
- "device nodes.");
- }
-
- if (errno == EACCES)
- return LIBUSB_ERROR_ACCESS;
- if (errno == ENOENT)
- return LIBUSB_ERROR_NO_DEVICE;
- return LIBUSB_ERROR_IO;
-}
-
-static struct linux_device_priv *_device_priv(struct libusb_device *dev)
-{
- return (struct linux_device_priv *) dev->os_priv;
-}
-
-static struct linux_device_handle_priv *_device_handle_priv(
- struct libusb_device_handle *handle)
-{
- return (struct linux_device_handle_priv *) handle->os_priv;
-}
-
-/* check dirent for a /dev/usbdev%d.%d name
- * optionally return bus/device on success */
-static int _is_usbdev_entry(struct dirent *entry, int *bus_p, int *dev_p)
-{
- int busnum, devnum;
-
- if (sscanf(entry->d_name, "usbdev%d.%d", &busnum, &devnum) != 2)
- return 0;
-
- usbi_dbg("found: %s", entry->d_name);
- if (bus_p != NULL)
- *bus_p = busnum;
- if (dev_p != NULL)
- *dev_p = devnum;
- return 1;
-}
-
-static int check_usb_vfs(const char *dirname)
-{
- DIR *dir;
- struct dirent *entry;
- int found = 0;
-
- dir = opendir(dirname);
- if (!dir)
- return 0;
-
- while ((entry = readdir(dir)) != NULL) {
- if (entry->d_name[0] == '.')
- continue;
-
- /* We assume if we find any files that it must be the right place */
- found = 1;
- break;
- }
-
- closedir(dir);
- return found;
-}
-
-static const char *find_usbfs_path(void)
-{
- const char *path = "/dev/bus/usb";
- const char *ret = NULL;
-
- if (check_usb_vfs(path)) {
- ret = path;
- } else {
- path = "/proc/bus/usb";
- if (check_usb_vfs(path))
- ret = path;
- }
-
- /* look for /dev/usbdev*.* if the normal places fail */
- if (ret == NULL) {
- struct dirent *entry;
- DIR *dir;
-
- path = "/dev";
- dir = opendir(path);
- if (dir != NULL) {
- while ((entry = readdir(dir)) != NULL) {
- if (_is_usbdev_entry(entry, NULL, NULL)) {
- /* found one; that's enough */
- ret = path;
- usbdev_names = 1;
- break;
- }
- }
- closedir(dir);
- }
- }
-
- if (ret != NULL)
- usbi_dbg("found usbfs at %s", ret);
-
- return ret;
-}
-
-/* the monotonic clock is not usable on all systems (e.g. embedded ones often
- * seem to lack it). fall back to REALTIME if we have to. */
-static clockid_t find_monotonic_clock(void)
-{
-#ifdef CLOCK_MONOTONIC
- struct timespec ts;
- int r;
-
- /* Linux 2.6.28 adds CLOCK_MONOTONIC_RAW but we don't use it
- * because it's not available through timerfd */
- r = clock_gettime(CLOCK_MONOTONIC, &ts);
- if (r == 0)
- return CLOCK_MONOTONIC;
- usbi_dbg("monotonic clock doesn't work, errno %d", errno);
-#endif
-
- return CLOCK_REALTIME;
-}
-
-static int kernel_version_ge(int major, int minor, int sublevel)
-{
- struct utsname uts;
- int atoms, kmajor, kminor, ksublevel;
-
- if (uname(&uts) < 0)
- return -1;
- atoms = sscanf(uts.release, "%d.%d.%d", &kmajor, &kminor, &ksublevel);
- if (atoms < 1)
- return -1;
-
- if (kmajor > major)
- return 1;
- if (kmajor < major)
- return 0;
-
- /* kmajor == major */
- if (atoms < 2)
- return 0 == minor && 0 == sublevel;
- if (kminor > minor)
- return 1;
- if (kminor < minor)
- return 0;
-
- /* kminor == minor */
- if (atoms < 3)
- return 0 == sublevel;
-
- return ksublevel >= sublevel;
-}
-
-static int op_init(struct libusb_context *ctx)
-{
- struct stat statbuf;
- int r;
-
- usbfs_path = find_usbfs_path();
- if (!usbfs_path) {
- usbi_err(ctx, "could not find usbfs");
- return LIBUSB_ERROR_OTHER;
- }
-
- if (monotonic_clkid == -1)
- monotonic_clkid = find_monotonic_clock();
-
- if (supports_flag_bulk_continuation == -1) {
- /* bulk continuation URB flag available from Linux 2.6.32 */
- supports_flag_bulk_continuation = kernel_version_ge(2,6,32);
- if (supports_flag_bulk_continuation == -1) {
- usbi_err(ctx, "error checking for bulk continuation support");
- return LIBUSB_ERROR_OTHER;
- }
- }
-
- if (supports_flag_bulk_continuation)
- usbi_dbg("bulk continuation flag supported");
-
- if (-1 == supports_flag_zero_packet) {
- /* zero length packet URB flag fixed since Linux 2.6.31 */
- supports_flag_zero_packet = kernel_version_ge(2,6,31);
- if (-1 == supports_flag_zero_packet) {
- usbi_err(ctx, "error checking for zero length packet support");
- return LIBUSB_ERROR_OTHER;
- }
- }
-
- if (supports_flag_zero_packet)
- usbi_dbg("zero length packet flag supported");
-
- if (-1 == sysfs_has_descriptors) {
- /* sysfs descriptors has all descriptors since Linux 2.6.26 */
- sysfs_has_descriptors = kernel_version_ge(2,6,26);
- if (-1 == sysfs_has_descriptors) {
- usbi_err(ctx, "error checking for sysfs descriptors");
- return LIBUSB_ERROR_OTHER;
- }
- }
-
- if (-1 == sysfs_can_relate_devices) {
- /* sysfs has busnum since Linux 2.6.22 */
- sysfs_can_relate_devices = kernel_version_ge(2,6,22);
- if (-1 == sysfs_can_relate_devices) {
- usbi_err(ctx, "error checking for sysfs busnum");
- return LIBUSB_ERROR_OTHER;
- }
- }
-
- if (sysfs_can_relate_devices || sysfs_has_descriptors) {
- r = stat(SYSFS_DEVICE_PATH, &statbuf);
- if (r != 0 || !S_ISDIR(statbuf.st_mode)) {
- usbi_warn(ctx, "sysfs not mounted");
- sysfs_can_relate_devices = 0;
- sysfs_has_descriptors = 0;
- }
- }
-
- if (sysfs_can_relate_devices)
- usbi_dbg("sysfs can relate devices");
-
- if (sysfs_has_descriptors)
- usbi_dbg("sysfs has complete descriptors");
-
- usbi_mutex_static_lock(&linux_hotplug_lock);
- r = LIBUSB_SUCCESS;
- if (init_count == 0) {
- /* start up hotplug event handler */
- r = linux_start_event_monitor();
- }
- if (r == LIBUSB_SUCCESS) {
- r = linux_scan_devices(ctx);
- if (r == LIBUSB_SUCCESS)
- init_count++;
- else if (init_count == 0)
- linux_stop_event_monitor();
- } else
- usbi_err(ctx, "error starting hotplug event monitor");
- usbi_mutex_static_unlock(&linux_hotplug_lock);
-
- return r;
-}
-
-static void op_exit(void)
-{
- usbi_mutex_static_lock(&linux_hotplug_lock);
- assert(init_count != 0);
- if (!--init_count) {
- /* tear down event handler */
- (void)linux_stop_event_monitor();
- }
- usbi_mutex_static_unlock(&linux_hotplug_lock);
-}
-
-static int linux_start_event_monitor(void)
-{
-#if defined(USE_UDEV)
- return linux_udev_start_event_monitor();
-#else
- return linux_netlink_start_event_monitor();
-#endif
-}
-
-static int linux_stop_event_monitor(void)
-{
-#if defined(USE_UDEV)
- return linux_udev_stop_event_monitor();
-#else
- return linux_netlink_stop_event_monitor();
-#endif
-}
-
-static int linux_scan_devices(struct libusb_context *ctx)
-{
-#if defined(USE_UDEV)
- return linux_udev_scan_devices(ctx);
-#else
- return linux_default_scan_devices(ctx);
-#endif
-}
-
-static void op_hotplug_poll(void)
-{
-#if defined(USE_UDEV)
- linux_udev_hotplug_poll();
-#else
- linux_netlink_hotplug_poll();
-#endif
-}
-
-static int _open_sysfs_attr(struct libusb_device *dev, const char *attr)
-{
- struct linux_device_priv *priv = _device_priv(dev);
- char filename[PATH_MAX];
- int fd;
-
- snprintf(filename, PATH_MAX, "%s/%s/%s",
- SYSFS_DEVICE_PATH, priv->sysfs_dir, attr);
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
- usbi_err(DEVICE_CTX(dev),
- "open %s failed ret=%d errno=%d", filename, fd, errno);
- return LIBUSB_ERROR_IO;
- }
-
- return fd;
-}
-
-/* Note only suitable for attributes which always read >= 0, < 0 is error */
-static int __read_sysfs_attr(struct libusb_context *ctx,
- const char *devname, const char *attr)
-{
- char filename[PATH_MAX];
- FILE *f;
- int r, value;
-
- snprintf(filename, PATH_MAX, "%s/%s/%s", SYSFS_DEVICE_PATH,
- devname, attr);
- f = fopen(filename, "r");
- if (f == NULL) {
- if (errno == ENOENT) {
- /* File doesn't exist. Assume the device has been
- disconnected (see trac ticket #70). */
- return LIBUSB_ERROR_NO_DEVICE;
- }
- usbi_err(ctx, "open %s failed errno=%d", filename, errno);
- return LIBUSB_ERROR_IO;
- }
-
- r = fscanf(f, "%d", &value);
- fclose(f);
- if (r != 1) {
- usbi_err(ctx, "fscanf %s returned %d, errno=%d", attr, r, errno);
- return LIBUSB_ERROR_NO_DEVICE; /* For unplug race (trac #70) */
- }
- if (value < 0) {
- usbi_err(ctx, "%s contains a negative value", filename);
- return LIBUSB_ERROR_IO;
- }
-
- return value;
-}
-
-static int op_get_device_descriptor(struct libusb_device *dev,
- unsigned char *buffer, int *host_endian)
-{
- struct linux_device_priv *priv = _device_priv(dev);
-
- *host_endian = sysfs_has_descriptors ? 0 : 1;
- memcpy(buffer, priv->descriptors, DEVICE_DESC_LENGTH);
-
- return 0;
-}
-
-/* read the bConfigurationValue for a device */
-static int sysfs_get_active_config(struct libusb_device *dev, int *config)
-{
- char *endptr;
- char tmp[4] = {0, 0, 0, 0};
- long num;
- int fd;
- ssize_t r;
-
- fd = _open_sysfs_attr(dev, "bConfigurationValue");
- if (fd < 0)
- return fd;
-
- r = read(fd, tmp, sizeof(tmp));
- close(fd);
- if (r < 0) {
- usbi_err(DEVICE_CTX(dev),
- "read bConfigurationValue failed ret=%d errno=%d", r, errno);
- return LIBUSB_ERROR_IO;
- } else if (r == 0) {
- usbi_dbg("device unconfigured");
- *config = -1;
- return 0;
- }
-
- if (tmp[sizeof(tmp) - 1] != 0) {
- usbi_err(DEVICE_CTX(dev), "not null-terminated?");
- return LIBUSB_ERROR_IO;
- } else if (tmp[0] == 0) {
- usbi_err(DEVICE_CTX(dev), "no configuration value?");
- return LIBUSB_ERROR_IO;
- }
-
- num = strtol(tmp, &endptr, 10);
- if (endptr == tmp) {
- usbi_err(DEVICE_CTX(dev), "error converting '%s' to integer", tmp);
- return LIBUSB_ERROR_IO;
- }
-
- *config = (int) num;
- return 0;
-}
-
-int linux_get_device_address (struct libusb_context *ctx, int detached,
- uint8_t *busnum, uint8_t *devaddr,const char *dev_node,
- const char *sys_name)
-{
- usbi_dbg("getting address for device: %s detached: %d", sys_name, detached);
- /* can't use sysfs to read the bus and device number if the
- * device has been detached */
- if (!sysfs_can_relate_devices || detached || NULL == sys_name) {
- if (NULL == dev_node) {
- return LIBUSB_ERROR_OTHER;
- }
-
- /* will this work with all supported kernel versions? */
- if (!strncmp(dev_node, "/dev/bus/usb", 12)) {
- sscanf (dev_node, "/dev/bus/usb/%hhd/%hhd", busnum, devaddr);
- } else if (!strncmp(dev_node, "/proc/bus/usb", 13)) {
- sscanf (dev_node, "/proc/bus/usb/%hhd/%hhd", busnum, devaddr);
- }
-
- return LIBUSB_SUCCESS;
- }
-
- usbi_dbg("scan %s", sys_name);
-
- *busnum = __read_sysfs_attr(ctx, sys_name, "busnum");
- if (0 > *busnum)
- return *busnum;
-
- *devaddr = __read_sysfs_attr(ctx, sys_name, "devnum");
- if (0 > *devaddr)
- return *devaddr;
-
- usbi_dbg("bus=%d dev=%d", *busnum, *devaddr);
- if (*busnum > 255 || *devaddr > 255)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- return LIBUSB_SUCCESS;
-}
-
-/* Return offset of the next descriptor with the given type */
-static int seek_to_next_descriptor(struct libusb_context *ctx,
- uint8_t descriptor_type, unsigned char *buffer, int size)
-{
- struct usb_descriptor_header header;
- int i;
-
- for (i = 0; size >= 0; i += header.bLength, size -= header.bLength) {
- if (size == 0)
- return LIBUSB_ERROR_NOT_FOUND;
-
- if (size < 2) {
- usbi_err(ctx, "short descriptor read %d/2", size);
- return LIBUSB_ERROR_IO;
- }
- usbi_parse_descriptor(buffer + i, "bb", &header, 0);
-
- if (i && header.bDescriptorType == descriptor_type)
- return i;
- }
- usbi_err(ctx, "bLength overflow by %d bytes", -size);
- return LIBUSB_ERROR_IO;
-}
-
-/* Return offset to next config */
-static int seek_to_next_config(struct libusb_context *ctx,
- unsigned char *buffer, int size)
-{
- struct libusb_config_descriptor config;
-
- if (size == 0)
- return LIBUSB_ERROR_NOT_FOUND;
-
- if (size < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(ctx, "short descriptor read %d/%d",
- size, LIBUSB_DT_CONFIG_SIZE);
- return LIBUSB_ERROR_IO;
- }
-
- usbi_parse_descriptor(buffer, "bbwbbbbb", &config, 0);
- if (config.bDescriptorType != LIBUSB_DT_CONFIG) {
- usbi_err(ctx, "descriptor is not a config desc (type 0x%02x)",
- config.bDescriptorType);
- return LIBUSB_ERROR_IO;
- }
-
- /*
- * In usbfs the config descriptors are config.wTotalLength bytes apart,
- * with any short reads from the device appearing as holes in the file.
- *
- * In sysfs wTotalLength is ignored, instead the kernel returns a
- * config descriptor with verified bLength fields, with descriptors
- * with an invalid bLength removed.
- */
- if (sysfs_has_descriptors) {
- int next = seek_to_next_descriptor(ctx, LIBUSB_DT_CONFIG,
- buffer, size);
- if (next == LIBUSB_ERROR_NOT_FOUND)
- next = size;
- if (next < 0)
- return next;
-
- if (next != config.wTotalLength)
- usbi_warn(ctx, "config length mismatch wTotalLength "
- "%d real %d", config.wTotalLength, next);
- return next;
- } else {
- if (config.wTotalLength < LIBUSB_DT_CONFIG_SIZE) {
- usbi_err(ctx, "invalid wTotalLength %d",
- config.wTotalLength);
- return LIBUSB_ERROR_IO;
- } else if (config.wTotalLength > size) {
- usbi_warn(ctx, "short descriptor read %d/%d",
- size, config.wTotalLength);
- return size;
- } else
- return config.wTotalLength;
- }
-}
-
-static int op_get_config_descriptor_by_value(struct libusb_device *dev,
- uint8_t value, unsigned char **buffer, int *host_endian)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev);
- struct linux_device_priv *priv = _device_priv(dev);
- unsigned char *descriptors = priv->descriptors;
- int size = priv->descriptors_len;
- struct libusb_config_descriptor *config;
-
- *buffer = NULL;
- /* Unlike the device desc. config descs. are always in raw format */
- *host_endian = 0;
-
- /* Skip device header */
- descriptors += DEVICE_DESC_LENGTH;
- size -= DEVICE_DESC_LENGTH;
-
- /* Seek till the config is found, or till "EOF" */
- while (1) {
- int next = seek_to_next_config(ctx, descriptors, size);
- if (next < 0)
- return next;
- config = (struct libusb_config_descriptor *)descriptors;
- if (config->bConfigurationValue == value) {
- *buffer = descriptors;
- return next;
- }
- size -= next;
- descriptors += next;
- }
-}
-
-static int op_get_active_config_descriptor(struct libusb_device *dev,
- unsigned char *buffer, size_t len, int *host_endian)
-{
- int r, config;
- unsigned char *config_desc;
-
- if (sysfs_can_relate_devices) {
- r = sysfs_get_active_config(dev, &config);
- if (r < 0)
- return r;
- } else {
- /* Use cached bConfigurationValue */
- struct linux_device_priv *priv = _device_priv(dev);
- config = priv->active_config;
- }
- if (config == -1)
- return LIBUSB_ERROR_NOT_FOUND;
-
- r = op_get_config_descriptor_by_value(dev, config, &config_desc,
- host_endian);
- if (r < 0)
- return r;
-
- len = MIN(len, r);
- memcpy(buffer, config_desc, len);
- return len;
-}
-
-static int op_get_config_descriptor(struct libusb_device *dev,
- uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian)
-{
- struct linux_device_priv *priv = _device_priv(dev);
- unsigned char *descriptors = priv->descriptors;
- int i, r, size = priv->descriptors_len;
-
- /* Unlike the device desc. config descs. are always in raw format */
- *host_endian = 0;
-
- /* Skip device header */
- descriptors += DEVICE_DESC_LENGTH;
- size -= DEVICE_DESC_LENGTH;
-
- /* Seek till the config is found, or till "EOF" */
- for (i = 0; ; i++) {
- r = seek_to_next_config(DEVICE_CTX(dev), descriptors, size);
- if (r < 0)
- return r;
- if (i == config_index)
- break;
- size -= r;
- descriptors += r;
- }
-
- len = MIN(len, r);
- memcpy(buffer, descriptors, len);
- return len;
-}
-
-/* send a control message to retrieve active configuration */
-static int usbfs_get_active_config(struct libusb_device *dev, int fd)
-{
- unsigned char active_config = 0;
- int r;
-
- struct usbfs_ctrltransfer ctrl = {
- .bmRequestType = LIBUSB_ENDPOINT_IN,
- .bRequest = LIBUSB_REQUEST_GET_CONFIGURATION,
- .wValue = 0,
- .wIndex = 0,
- .wLength = 1,
- .timeout = 1000,
- .data = &active_config
- };
-
- r = ioctl(fd, IOCTL_USBFS_CONTROL, &ctrl);
- if (r < 0) {
- if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- /* we hit this error path frequently with buggy devices :( */
- usbi_warn(DEVICE_CTX(dev),
- "get_configuration failed ret=%d errno=%d", r, errno);
- return LIBUSB_ERROR_IO;
- }
-
- return active_config;
-}
-
-static int initialize_device(struct libusb_device *dev, uint8_t busnum,
- uint8_t devaddr, const char *sysfs_dir)
-{
- struct linux_device_priv *priv = _device_priv(dev);
- struct libusb_context *ctx = DEVICE_CTX(dev);
- int descriptors_size = 512; /* Begin with a 1024 byte alloc */
- int fd, speed;
- ssize_t r;
-
- dev->bus_number = busnum;
- dev->device_address = devaddr;
-
- if (sysfs_dir) {
- priv->sysfs_dir = malloc(strlen(sysfs_dir) + 1);
- if (!priv->sysfs_dir)
- return LIBUSB_ERROR_NO_MEM;
- strcpy(priv->sysfs_dir, sysfs_dir);
-
- /* Note speed can contain 1.5, in this case __read_sysfs_attr
- will stop parsing at the '.' and return 1 */
- speed = __read_sysfs_attr(DEVICE_CTX(dev), sysfs_dir, "speed");
- if (speed >= 0) {
- switch (speed) {
- case 1: dev->speed = LIBUSB_SPEED_LOW; break;
- case 12: dev->speed = LIBUSB_SPEED_FULL; break;
- case 480: dev->speed = LIBUSB_SPEED_HIGH; break;
- case 5000: dev->speed = LIBUSB_SPEED_SUPER; break;
- default:
- usbi_warn(DEVICE_CTX(dev), "Unknown device speed: %d Mbps", speed);
- }
- }
- }
-
- /* cache descriptors in memory */
- if (sysfs_has_descriptors)
- fd = _open_sysfs_attr(dev, "descriptors");
- else
- fd = _get_usbfs_fd(dev, O_RDONLY, 0);
- if (fd < 0)
- return fd;
-
- do {
- descriptors_size *= 2;
- priv->descriptors = usbi_reallocf(priv->descriptors,
- descriptors_size);
- if (!priv->descriptors) {
- close(fd);
- return LIBUSB_ERROR_NO_MEM;
- }
- /* usbfs has holes in the file */
- if (!sysfs_has_descriptors) {
- memset(priv->descriptors + priv->descriptors_len,
- 0, descriptors_size - priv->descriptors_len);
- }
- r = read(fd, priv->descriptors + priv->descriptors_len,
- descriptors_size - priv->descriptors_len);
- if (r < 0) {
- usbi_err(ctx, "read descriptor failed ret=%d errno=%d",
- fd, errno);
- close(fd);
- return LIBUSB_ERROR_IO;
- }
- priv->descriptors_len += r;
- } while (priv->descriptors_len == descriptors_size);
-
- close(fd);
-
- if (priv->descriptors_len < DEVICE_DESC_LENGTH) {
- usbi_err(ctx, "short descriptor read (%d)",
- priv->descriptors_len);
- return LIBUSB_ERROR_IO;
- }
-
- if (sysfs_can_relate_devices)
- return LIBUSB_SUCCESS;
-
- /* cache active config */
- fd = _get_usbfs_fd(dev, O_RDWR, 1);
- if (fd < 0) {
- /* cannot send a control message to determine the active
- * config. just assume the first one is active. */
- usbi_warn(ctx, "Missing rw usbfs access; cannot determine "
- "active configuration descriptor");
- if (priv->descriptors_len >=
- (DEVICE_DESC_LENGTH + LIBUSB_DT_CONFIG_SIZE)) {
- struct libusb_config_descriptor config;
- usbi_parse_descriptor(
- priv->descriptors + DEVICE_DESC_LENGTH,
- "bbwbbbbb", &config, 0);
- priv->active_config = config.bConfigurationValue;
- } else
- priv->active_config = -1; /* No config dt */
-
- return LIBUSB_SUCCESS;
- }
-
- r = usbfs_get_active_config(dev, fd);
- if (r > 0) {
- priv->active_config = r;
- r = LIBUSB_SUCCESS;
- } else if (r == 0) {
- /* some buggy devices have a configuration 0, but we're
- * reaching into the corner of a corner case here, so let's
- * not support buggy devices in these circumstances.
- * stick to the specs: a configuration value of 0 means
- * unconfigured. */
- usbi_dbg("active cfg 0? assuming unconfigured device");
- priv->active_config = -1;
- r = LIBUSB_SUCCESS;
- } else if (r == LIBUSB_ERROR_IO) {
- /* buggy devices sometimes fail to report their active config.
- * assume unconfigured and continue the probing */
- usbi_warn(ctx, "couldn't query active configuration, assuming"
- " unconfigured");
- priv->active_config = -1;
- r = LIBUSB_SUCCESS;
- } /* else r < 0, just return the error code */
-
- close(fd);
- return r;
-}
-
-static int linux_get_parent_info(struct libusb_device *dev, const char *sysfs_dir)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev);
- struct libusb_device *it;
- char *parent_sysfs_dir, *tmp;
- int ret, add_parent = 1;
-
- /* XXX -- can we figure out the topology when using usbfs? */
- if (NULL == sysfs_dir || 0 == strncmp(sysfs_dir, "usb", 3)) {
- /* either using usbfs or finding the parent of a root hub */
- return LIBUSB_SUCCESS;
- }
-
- parent_sysfs_dir = strdup(sysfs_dir);
- if (NULL != (tmp = strrchr(parent_sysfs_dir, '.')) ||
- NULL != (tmp = strrchr(parent_sysfs_dir, '-'))) {
- dev->port_number = atoi(tmp + 1);
- *tmp = '\0';
- } else {
- usbi_warn(ctx, "Can not parse sysfs_dir: %s, no parent info",
- parent_sysfs_dir);
- free (parent_sysfs_dir);
- return LIBUSB_SUCCESS;
- }
-
- /* is the parent a root hub? */
- if (NULL == strchr(parent_sysfs_dir, '-')) {
- tmp = parent_sysfs_dir;
- ret = asprintf (&parent_sysfs_dir, "usb%s", tmp);
- free (tmp);
- if (0 > ret) {
- return LIBUSB_ERROR_NO_MEM;
- }
- }
-
-retry:
- /* find the parent in the context */
- usbi_mutex_lock(&ctx->usb_devs_lock);
- list_for_each_entry(it, &ctx->usb_devs, list, struct libusb_device) {
- struct linux_device_priv *priv = _device_priv(it);
- if (0 == strcmp (priv->sysfs_dir, parent_sysfs_dir)) {
- dev->parent_dev = libusb_ref_device(it);
- break;
- }
- }
- usbi_mutex_unlock(&ctx->usb_devs_lock);
-
- if (!dev->parent_dev && add_parent) {
- usbi_dbg("parent_dev %s not enumerated yet, enumerating now",
- parent_sysfs_dir);
- sysfs_scan_device(ctx, parent_sysfs_dir);
- add_parent = 0;
- goto retry;
- }
-
- usbi_dbg("Dev %p (%s) has parent %p (%s) port %d", dev, sysfs_dir,
- dev->parent_dev, parent_sysfs_dir, dev->port_number);
-
- free (parent_sysfs_dir);
-
- return LIBUSB_SUCCESS;
-}
-
-int linux_enumerate_device(struct libusb_context *ctx,
- uint8_t busnum, uint8_t devaddr, const char *sysfs_dir)
-{
- unsigned long session_id;
- struct libusb_device *dev;
- int r = 0;
-
- /* FIXME: session ID is not guaranteed unique as addresses can wrap and
- * will be reused. instead we should add a simple sysfs attribute with
- * a session ID. */
- session_id = busnum << 8 | devaddr;
- usbi_dbg("busnum %d devaddr %d session_id %ld", busnum, devaddr,
- session_id);
-
- if (usbi_get_device_by_session_id(ctx, session_id)) {
- /* device already exists in the context */
- usbi_dbg("session_id %ld already exists", session_id);
- return LIBUSB_SUCCESS;
- }
-
- usbi_dbg("allocating new device for %d/%d (session %ld)",
- busnum, devaddr, session_id);
- dev = usbi_alloc_device(ctx, session_id);
- if (!dev)
- return LIBUSB_ERROR_NO_MEM;
-
- r = initialize_device(dev, busnum, devaddr, sysfs_dir);
- if (r < 0)
- goto out;
- r = usbi_sanitize_device(dev);
- if (r < 0)
- goto out;
-
- r = linux_get_parent_info(dev, sysfs_dir);
- if (r < 0)
- goto out;
-out:
- if (r < 0)
- libusb_unref_device(dev);
- else
- usbi_connect_device(dev);
-
- return r;
-}
-
-void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name)
-{
- struct libusb_context *ctx;
-
- usbi_mutex_static_lock(&active_contexts_lock);
- list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {
- linux_enumerate_device(ctx, busnum, devaddr, sys_name);
- }
- usbi_mutex_static_unlock(&active_contexts_lock);
-}
-
-void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name)
-{
- struct libusb_context *ctx;
- struct libusb_device *dev;
- unsigned long session_id = busnum << 8 | devaddr;
-
- usbi_mutex_static_lock(&active_contexts_lock);
- list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {
- dev = usbi_get_device_by_session_id (ctx, session_id);
- if (NULL != dev) {
- usbi_disconnect_device (dev);
- } else {
- usbi_dbg("device not found for session %x", session_id);
- }
- }
- usbi_mutex_static_unlock(&active_contexts_lock);
-}
-
-#if !defined(USE_UDEV)
-/* open a bus directory and adds all discovered devices to the context */
-static int usbfs_scan_busdir(struct libusb_context *ctx, uint8_t busnum)
-{
- DIR *dir;
- char dirpath[PATH_MAX];
- struct dirent *entry;
- int r = LIBUSB_ERROR_IO;
-
- snprintf(dirpath, PATH_MAX, "%s/%03d", usbfs_path, busnum);
- usbi_dbg("%s", dirpath);
- dir = opendir(dirpath);
- if (!dir) {
- usbi_err(ctx, "opendir '%s' failed, errno=%d", dirpath, errno);
- /* FIXME: should handle valid race conditions like hub unplugged
- * during directory iteration - this is not an error */
- return r;
- }
-
- while ((entry = readdir(dir))) {
- int devaddr;
-
- if (entry->d_name[0] == '.')
- continue;
-
- devaddr = atoi(entry->d_name);
- if (devaddr == 0) {
- usbi_dbg("unknown dir entry %s", entry->d_name);
- continue;
- }
-
- if (linux_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL)) {
- usbi_dbg("failed to enumerate dir entry %s", entry->d_name);
- continue;
- }
-
- r = 0;
- }
-
- closedir(dir);
- return r;
-}
-
-static int usbfs_get_device_list(struct libusb_context *ctx)
-{
- struct dirent *entry;
- DIR *buses = opendir(usbfs_path);
- int r = 0;
-
- if (!buses) {
- usbi_err(ctx, "opendir buses failed errno=%d", errno);
- return LIBUSB_ERROR_IO;
- }
-
- while ((entry = readdir(buses))) {
- int busnum;
-
- if (entry->d_name[0] == '.')
- continue;
-
- if (usbdev_names) {
- int devaddr;
- if (!_is_usbdev_entry(entry, &busnum, &devaddr))
- continue;
-
- r = linux_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL);
- if (r < 0) {
- usbi_dbg("failed to enumerate dir entry %s", entry->d_name);
- continue;
- }
- } else {
- busnum = atoi(entry->d_name);
- if (busnum == 0) {
- usbi_dbg("unknown dir entry %s", entry->d_name);
- continue;
- }
-
- r = usbfs_scan_busdir(ctx, busnum);
- if (r < 0)
- break;
- }
- }
-
- closedir(buses);
- return r;
-
-}
-#endif
-
-static int sysfs_scan_device(struct libusb_context *ctx, const char *devname)
-{
- uint8_t busnum, devaddr;
- int ret;
-
- ret = linux_get_device_address (ctx, 0, &busnum, &devaddr, NULL, devname);
- if (LIBUSB_SUCCESS != ret) {
- return ret;
- }
-
- return linux_enumerate_device(ctx, busnum & 0xff, devaddr & 0xff,
- devname);
-}
-
-#if !defined(USE_UDEV)
-static int sysfs_get_device_list(struct libusb_context *ctx)
-{
- DIR *devices = opendir(SYSFS_DEVICE_PATH);
- struct dirent *entry;
- int r = LIBUSB_ERROR_IO;
-
- if (!devices) {
- usbi_err(ctx, "opendir devices failed errno=%d", errno);
- return r;
- }
-
- while ((entry = readdir(devices))) {
- if ((!isdigit(entry->d_name[0]) && strncmp(entry->d_name, "usb", 3))
- || strchr(entry->d_name, ':'))
- continue;
-
- if (sysfs_scan_device(ctx, entry->d_name)) {
- usbi_dbg("failed to enumerate dir entry %s", entry->d_name);
- continue;
- }
-
- r = 0;
- }
-
- closedir(devices);
- return r;
-}
-
-static int linux_default_scan_devices (struct libusb_context *ctx)
-{
- /* we can retrieve device list and descriptors from sysfs or usbfs.
- * sysfs is preferable, because if we use usbfs we end up resuming
- * any autosuspended USB devices. however, sysfs is not available
- * everywhere, so we need a usbfs fallback too.
- *
- * as described in the "sysfs vs usbfs" comment at the top of this
- * file, sometimes we have sysfs but not enough information to
- * relate sysfs devices to usbfs nodes. op_init() determines the
- * adequacy of sysfs and sets sysfs_can_relate_devices.
- */
- if (sysfs_can_relate_devices != 0)
- return sysfs_get_device_list(ctx);
- else
- return usbfs_get_device_list(ctx);
-}
-#endif
-
-static int op_open(struct libusb_device_handle *handle)
-{
- struct linux_device_handle_priv *hpriv = _device_handle_priv(handle);
- int r;
-
- hpriv->fd = _get_usbfs_fd(handle->dev, O_RDWR, 0);
- if (hpriv->fd < 0)
- return hpriv->fd;
-
- r = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps);
- if (r < 0) {
- if (errno == ENOTTY)
- usbi_dbg("getcap not available");
- else
- usbi_err(HANDLE_CTX(handle), "getcap failed (%d)", errno);
- hpriv->caps = 0;
- if (supports_flag_zero_packet)
- hpriv->caps |= USBFS_CAP_ZERO_PACKET;
- if (supports_flag_bulk_continuation)
- hpriv->caps |= USBFS_CAP_BULK_CONTINUATION;
- }
-
- return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);
-}
-
-static void op_close(struct libusb_device_handle *dev_handle)
-{
- int fd = _device_handle_priv(dev_handle)->fd;
- usbi_remove_pollfd(HANDLE_CTX(dev_handle), fd);
- close(fd);
-}
-
-static int op_get_configuration(struct libusb_device_handle *handle,
- int *config)
-{
- int r;
-
- if (sysfs_can_relate_devices) {
- r = sysfs_get_active_config(handle->dev, config);
- } else {
- r = usbfs_get_active_config(handle->dev,
- _device_handle_priv(handle)->fd);
- }
- if (r < 0)
- return r;
-
- if (*config == -1) {
- usbi_err(HANDLE_CTX(handle), "device unconfigured");
- *config = 0;
- }
-
- return 0;
-}
-
-static int op_set_configuration(struct libusb_device_handle *handle, int config)
-{
- struct linux_device_priv *priv = _device_priv(handle->dev);
- int fd = _device_handle_priv(handle)->fd;
- int r = ioctl(fd, IOCTL_USBFS_SETCONFIG, &config);
- if (r) {
- if (errno == EINVAL)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == EBUSY)
- return LIBUSB_ERROR_BUSY;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle), "failed, error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- /* update our cached active config descriptor */
- priv->active_config = config;
-
- return LIBUSB_SUCCESS;
-}
-
-static int claim_interface(struct libusb_device_handle *handle, int iface)
-{
- int fd = _device_handle_priv(handle)->fd;
- int r = ioctl(fd, IOCTL_USBFS_CLAIMINTF, &iface);
- if (r) {
- if (errno == ENOENT)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == EBUSY)
- return LIBUSB_ERROR_BUSY;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "claim interface failed, error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
- return 0;
-}
-
-static int release_interface(struct libusb_device_handle *handle, int iface)
-{
- int fd = _device_handle_priv(handle)->fd;
- int r = ioctl(fd, IOCTL_USBFS_RELEASEINTF, &iface);
- if (r) {
- if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "release interface failed, error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
- return 0;
-}
-
-static int op_set_interface(struct libusb_device_handle *handle, int iface,
- int altsetting)
-{
- int fd = _device_handle_priv(handle)->fd;
- struct usbfs_setinterface setintf;
- int r;
-
- setintf.interface = iface;
- setintf.altsetting = altsetting;
- r = ioctl(fd, IOCTL_USBFS_SETINTF, &setintf);
- if (r) {
- if (errno == EINVAL)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "setintf failed error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- return 0;
-}
-
-static int op_clear_halt(struct libusb_device_handle *handle,
- unsigned char endpoint)
-{
- int fd = _device_handle_priv(handle)->fd;
- unsigned int _endpoint = endpoint;
- int r = ioctl(fd, IOCTL_USBFS_CLEAR_HALT, &_endpoint);
- if (r) {
- if (errno == ENOENT)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "clear_halt failed error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- return 0;
-}
-
-static int op_reset_device(struct libusb_device_handle *handle)
-{
- int fd = _device_handle_priv(handle)->fd;
- int i, r, ret = 0;
-
- /* Doing a device reset will cause the usbfs driver to get unbound
- from any interfaces it is bound to. By voluntarily unbinding
- the usbfs driver ourself, we stop the kernel from rebinding
- the interface after reset (which would end up with the interface
- getting bound to the in kernel driver if any). */
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if (handle->claimed_interfaces & (1L << i)) {
- release_interface(handle, i);
- }
- }
-
- usbi_mutex_lock(&handle->lock);
- r = ioctl(fd, IOCTL_USBFS_RESET, NULL);
- if (r) {
- if (errno == ENODEV) {
- ret = LIBUSB_ERROR_NOT_FOUND;
- goto out;
- }
-
- usbi_err(HANDLE_CTX(handle),
- "reset failed error %d errno %d", r, errno);
- ret = LIBUSB_ERROR_OTHER;
- goto out;
- }
-
- /* And re-claim any interfaces which were claimed before the reset */
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if (handle->claimed_interfaces & (1L << i)) {
- /*
- * A driver may have completed modprobing during
- * IOCTL_USBFS_RESET, and bound itself as soon as
- * IOCTL_USBFS_RESET released the device lock
- */
- r = detach_kernel_driver_and_claim(handle, i);
- if (r) {
- usbi_warn(HANDLE_CTX(handle),
- "failed to re-claim interface %d after reset: %s",
- i, libusb_error_name(r));
- handle->claimed_interfaces &= ~(1L << i);
- ret = LIBUSB_ERROR_NOT_FOUND;
- }
- }
- }
-out:
- usbi_mutex_unlock(&handle->lock);
- return ret;
-}
-
-static int op_kernel_driver_active(struct libusb_device_handle *handle,
- int interface)
-{
- int fd = _device_handle_priv(handle)->fd;
- struct usbfs_getdriver getdrv;
- int r;
-
- getdrv.interface = interface;
- r = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);
- if (r) {
- if (errno == ENODATA)
- return 0;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "get driver failed error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- return (strcmp(getdrv.driver, "usbfs") == 0) ? 0 : 1;
-}
-
-static int op_detach_kernel_driver(struct libusb_device_handle *handle,
- int interface)
-{
- int fd = _device_handle_priv(handle)->fd;
- struct usbfs_ioctl command;
- struct usbfs_getdriver getdrv;
- int r;
-
- command.ifno = interface;
- command.ioctl_code = IOCTL_USBFS_DISCONNECT;
- command.data = NULL;
-
- getdrv.interface = interface;
- r = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);
- if (r == 0 && strcmp(getdrv.driver, "usbfs") == 0)
- return LIBUSB_ERROR_NOT_FOUND;
-
- r = ioctl(fd, IOCTL_USBFS_IOCTL, &command);
- if (r) {
- if (errno == ENODATA)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == EINVAL)
- return LIBUSB_ERROR_INVALID_PARAM;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle),
- "detach failed error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- return 0;
-}
-
-static int op_attach_kernel_driver(struct libusb_device_handle *handle,
- int interface)
-{
- int fd = _device_handle_priv(handle)->fd;
- struct usbfs_ioctl command;
- int r;
-
- command.ifno = interface;
- command.ioctl_code = IOCTL_USBFS_CONNECT;
- command.data = NULL;
-
- r = ioctl(fd, IOCTL_USBFS_IOCTL, &command);
- if (r < 0) {
- if (errno == ENODATA)
- return LIBUSB_ERROR_NOT_FOUND;
- else if (errno == EINVAL)
- return LIBUSB_ERROR_INVALID_PARAM;
- else if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
- else if (errno == EBUSY)
- return LIBUSB_ERROR_BUSY;
-
- usbi_err(HANDLE_CTX(handle),
- "attach failed error %d errno %d", r, errno);
- return LIBUSB_ERROR_OTHER;
- } else if (r == 0) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- return 0;
-}
-
-static int detach_kernel_driver_and_claim(struct libusb_device_handle *handle,
- int interface)
-{
- struct usbfs_disconnect_claim dc;
- int r, fd = _device_handle_priv(handle)->fd;
-
- dc.interface = interface;
- strcpy(dc.driver, "usbfs");
- dc.flags = USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER;
- r = ioctl(fd, IOCTL_USBFS_DISCONNECT_CLAIM, &dc);
- if (r == 0 || (r != 0 && errno != ENOTTY)) {
- if (r == 0)
- return 0;
-
- switch (errno) {
- case EBUSY:
- return LIBUSB_ERROR_BUSY;
- case EINVAL:
- return LIBUSB_ERROR_INVALID_PARAM;
- case ENODEV:
- return LIBUSB_ERROR_NO_DEVICE;
- }
- usbi_err(HANDLE_CTX(handle),
- "disconnect-and-claim failed errno %d", errno);
- return LIBUSB_ERROR_OTHER;
- }
-
- /* Fallback code for kernels which don't support the
- disconnect-and-claim ioctl */
- r = op_detach_kernel_driver(handle, interface);
- if (r != 0 && r != LIBUSB_ERROR_NOT_FOUND)
- return r;
-
- return claim_interface(handle, interface);
-}
-
-static int op_claim_interface(struct libusb_device_handle *handle, int iface)
-{
- if (handle->auto_detach_kernel_driver)
- return detach_kernel_driver_and_claim(handle, iface);
- else
- return claim_interface(handle, iface);
-}
-
-static int op_release_interface(struct libusb_device_handle *handle, int iface)
-{
- int r;
-
- r = release_interface(handle, iface);
- if (r)
- return r;
-
- if (handle->auto_detach_kernel_driver)
- op_attach_kernel_driver(handle, iface);
-
- return 0;
-}
-
-static void op_destroy_device(struct libusb_device *dev)
-{
- struct linux_device_priv *priv = _device_priv(dev);
- if (priv->descriptors)
- free(priv->descriptors);
- if (priv->sysfs_dir)
- free(priv->sysfs_dir);
-}
-
-/* URBs are discarded in reverse order of submission to avoid races. */
-static int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plus_one)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_transfer_priv *tpriv =
- usbi_transfer_get_os_priv(itransfer);
- struct linux_device_handle_priv *dpriv =
- _device_handle_priv(transfer->dev_handle);
- int i, ret = 0;
- struct usbfs_urb *urb;
-
- for (i = last_plus_one - 1; i >= first; i--) {
- if (LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type)
- urb = tpriv->iso_urbs[i];
- else
- urb = &tpriv->urbs[i];
-
- if (0 == ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, urb))
- continue;
-
- if (EINVAL == errno) {
- usbi_dbg("URB not found --> assuming ready to be reaped");
- if (i == (last_plus_one - 1))
- ret = LIBUSB_ERROR_NOT_FOUND;
- } else if (ENODEV == errno) {
- usbi_dbg("Device not found for URB --> assuming ready to be reaped");
- ret = LIBUSB_ERROR_NO_DEVICE;
- } else {
- usbi_warn(TRANSFER_CTX(transfer),
- "unrecognised discard errno %d", errno);
- ret = LIBUSB_ERROR_OTHER;
- }
- }
- return ret;
-}
-
-static void free_iso_urbs(struct linux_transfer_priv *tpriv)
-{
- int i;
- for (i = 0; i < tpriv->num_urbs; i++) {
- struct usbfs_urb *urb = tpriv->iso_urbs[i];
- if (!urb)
- break;
- free(urb);
- }
-
- free(tpriv->iso_urbs);
- tpriv->iso_urbs = NULL;
-}
-
-static int submit_bulk_transfer(struct usbi_transfer *itransfer,
- unsigned char urb_type)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct linux_device_handle_priv *dpriv =
- _device_handle_priv(transfer->dev_handle);
- struct usbfs_urb *urbs;
- int is_out = (transfer->endpoint & LIBUSB_ENDPOINT_DIR_MASK)
- == LIBUSB_ENDPOINT_OUT;
- int bulk_buffer_len, use_bulk_continuation;
- int r;
- int i;
- size_t alloc_size;
-
- if (tpriv->urbs)
- return LIBUSB_ERROR_BUSY;
-
- if (is_out && (transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) &&
- !(dpriv->caps & USBFS_CAP_ZERO_PACKET))
- return LIBUSB_ERROR_NOT_SUPPORTED;
-
- /*
- * Older versions of usbfs place a 16kb limit on bulk URBs. We work
- * around this by splitting large transfers into 16k blocks, and then
- * submit all urbs at once. it would be simpler to submit one urb at
- * a time, but there is a big performance gain doing it this way.
- *
- * Newer versions lift the 16k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),
- * using arbritary large transfers can still be a bad idea though, as
- * the kernel needs to allocate physical contiguous memory for this,
- * which may fail for large buffers.
- *
- * The kernel solves this problem by splitting the transfer into
- * blocks itself when the host-controller is scatter-gather capable
- * (USBFS_CAP_BULK_SCATTER_GATHER), which most controllers are.
- *
- * Last, there is the issue of short-transfers when splitting, for
- * short split-transfers to work reliable USBFS_CAP_BULK_CONTINUATION
- * is needed, but this is not always available.
- */
- if (dpriv->caps & USBFS_CAP_BULK_SCATTER_GATHER) {
- /* Good! Just submit everything in one go */
- bulk_buffer_len = transfer->length ? transfer->length : 1;
- use_bulk_continuation = 0;
- } else if (dpriv->caps & USBFS_CAP_BULK_CONTINUATION) {
- /* Split the transfers and use bulk-continuation to
- avoid issues with short-transfers */
- bulk_buffer_len = MAX_BULK_BUFFER_LENGTH;
- use_bulk_continuation = 1;
- } else if (dpriv->caps & USBFS_CAP_NO_PACKET_SIZE_LIM) {
- /* Don't split, assume the kernel can alloc the buffer
- (otherwise the submit will fail with -ENOMEM) */
- bulk_buffer_len = transfer->length ? transfer->length : 1;
- use_bulk_continuation = 0;
- } else {
- /* Bad, splitting without bulk-continuation, short transfers
- which end before the last urb will not work reliable! */
- /* Note we don't warn here as this is "normal" on kernels <
- 2.6.32 and not a problem for most applications */
- bulk_buffer_len = MAX_BULK_BUFFER_LENGTH;
- use_bulk_continuation = 0;
- }
-
- int num_urbs = transfer->length / bulk_buffer_len;
- int last_urb_partial = 0;
-
- if (transfer->length == 0) {
- num_urbs = 1;
- } else if ((transfer->length % bulk_buffer_len) > 0) {
- last_urb_partial = 1;
- num_urbs++;
- }
- usbi_dbg("need %d urbs for new transfer with length %d", num_urbs,
- transfer->length);
- alloc_size = num_urbs * sizeof(struct usbfs_urb);
- urbs = calloc(1, alloc_size);
- if (!urbs)
- return LIBUSB_ERROR_NO_MEM;
- tpriv->urbs = urbs;
- tpriv->num_urbs = num_urbs;
- tpriv->num_retired = 0;
- tpriv->reap_action = NORMAL;
- tpriv->reap_status = LIBUSB_TRANSFER_COMPLETED;
-
- for (i = 0; i < num_urbs; i++) {
- struct usbfs_urb *urb = &urbs[i];
- urb->usercontext = itransfer;
- urb->type = urb_type;
- urb->endpoint = transfer->endpoint;
- urb->buffer = transfer->buffer + (i * bulk_buffer_len);
- /* don't set the short not ok flag for the last URB */
- if (use_bulk_continuation && !is_out && (i < num_urbs - 1))
- urb->flags = USBFS_URB_SHORT_NOT_OK;
- if (i == num_urbs - 1 && last_urb_partial)
- urb->buffer_length = transfer->length % bulk_buffer_len;
- else if (transfer->length == 0)
- urb->buffer_length = 0;
- else
- urb->buffer_length = bulk_buffer_len;
-
- if (i > 0 && use_bulk_continuation)
- urb->flags |= USBFS_URB_BULK_CONTINUATION;
-
- /* we have already checked that the flag is supported */
- if (is_out && i == num_urbs - 1 &&
- transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET)
- urb->flags |= USBFS_URB_ZERO_PACKET;
-
- r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);
- if (r < 0) {
- if (errno == ENODEV) {
- r = LIBUSB_ERROR_NO_DEVICE;
- } else {
- usbi_err(TRANSFER_CTX(transfer),
- "submiturb failed error %d errno=%d", r, errno);
- r = LIBUSB_ERROR_IO;
- }
-
- /* if the first URB submission fails, we can simply free up and
- * return failure immediately. */
- if (i == 0) {
- usbi_dbg("first URB failed, easy peasy");
- free(urbs);
- tpriv->urbs = NULL;
- return r;
- }
-
- /* if it's not the first URB that failed, the situation is a bit
- * tricky. we may need to discard all previous URBs. there are
- * complications:
- * - discarding is asynchronous - discarded urbs will be reaped
- * later. the user must not have freed the transfer when the
- * discarded URBs are reaped, otherwise libusbx will be using
- * freed memory.
- * - the earlier URBs may have completed successfully and we do
- * not want to throw away any data.
- * - this URB failing may be no error; EREMOTEIO means that
- * this transfer simply didn't need all the URBs we submitted
- * so, we report that the transfer was submitted successfully and
- * in case of error we discard all previous URBs. later when
- * the final reap completes we can report error to the user,
- * or success if an earlier URB was completed successfully.
- */
- tpriv->reap_action = EREMOTEIO == errno ? COMPLETED_EARLY : SUBMIT_FAILED;
-
- /* The URBs we haven't submitted yet we count as already
- * retired. */
- tpriv->num_retired += num_urbs - i;
-
- /* If we completed short then don't try to discard. */
- if (COMPLETED_EARLY == tpriv->reap_action)
- return 0;
-
- discard_urbs(itransfer, 0, i);
-
- usbi_dbg("reporting successful submission but waiting for %d "
- "discards before reporting error", i);
- return 0;
- }
- }
-
- return 0;
-}
-
-static int submit_iso_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct linux_device_handle_priv *dpriv =
- _device_handle_priv(transfer->dev_handle);
- struct usbfs_urb **urbs;
- size_t alloc_size;
- int num_packets = transfer->num_iso_packets;
- int i;
- int this_urb_len = 0;
- int num_urbs = 1;
- int packet_offset = 0;
- unsigned int packet_len;
- unsigned char *urb_buffer = transfer->buffer;
-
- if (tpriv->iso_urbs)
- return LIBUSB_ERROR_BUSY;
-
- /* usbfs places a 32kb limit on iso URBs. we divide up larger requests
- * into smaller units to meet such restriction, then fire off all the
- * units at once. it would be simpler if we just fired one unit at a time,
- * but there is a big performance gain through doing it this way.
- *
- * Newer kernels lift the 32k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),
- * using arbritary large transfers is still be a bad idea though, as
- * the kernel needs to allocate physical contiguous memory for this,
- * which may fail for large buffers.
- */
-
- /* calculate how many URBs we need */
- for (i = 0; i < num_packets; i++) {
- unsigned int space_remaining = MAX_ISO_BUFFER_LENGTH - this_urb_len;
- packet_len = transfer->iso_packet_desc[i].length;
-
- if (packet_len > space_remaining) {
- num_urbs++;
- this_urb_len = packet_len;
- } else {
- this_urb_len += packet_len;
- }
- }
- usbi_dbg("need %d 32k URBs for transfer", num_urbs);
-
- alloc_size = num_urbs * sizeof(*urbs);
- urbs = calloc(1, alloc_size);
- if (!urbs)
- return LIBUSB_ERROR_NO_MEM;
-
- tpriv->iso_urbs = urbs;
- tpriv->num_urbs = num_urbs;
- tpriv->num_retired = 0;
- tpriv->reap_action = NORMAL;
- tpriv->iso_packet_offset = 0;
-
- /* allocate + initialize each URB with the correct number of packets */
- for (i = 0; i < num_urbs; i++) {
- struct usbfs_urb *urb;
- unsigned int space_remaining_in_urb = MAX_ISO_BUFFER_LENGTH;
- int urb_packet_offset = 0;
- unsigned char *urb_buffer_orig = urb_buffer;
- int j;
- int k;
-
- /* swallow up all the packets we can fit into this URB */
- while (packet_offset < transfer->num_iso_packets) {
- packet_len = transfer->iso_packet_desc[packet_offset].length;
- if (packet_len <= space_remaining_in_urb) {
- /* throw it in */
- urb_packet_offset++;
- packet_offset++;
- space_remaining_in_urb -= packet_len;
- urb_buffer += packet_len;
- } else {
- /* it can't fit, save it for the next URB */
- break;
- }
- }
-
- alloc_size = sizeof(*urb)
- + (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc));
- urb = calloc(1, alloc_size);
- if (!urb) {
- free_iso_urbs(tpriv);
- return LIBUSB_ERROR_NO_MEM;
- }
- urbs[i] = urb;
-
- /* populate packet lengths */
- for (j = 0, k = packet_offset - urb_packet_offset;
- k < packet_offset; k++, j++) {
- packet_len = transfer->iso_packet_desc[k].length;
- urb->iso_frame_desc[j].length = packet_len;
- }
-
- urb->usercontext = itransfer;
- urb->type = USBFS_URB_TYPE_ISO;
- /* FIXME: interface for non-ASAP data? */
- urb->flags = USBFS_URB_ISO_ASAP;
- urb->endpoint = transfer->endpoint;
- urb->number_of_packets = urb_packet_offset;
- urb->buffer = urb_buffer_orig;
- }
-
- /* submit URBs */
- for (i = 0; i < num_urbs; i++) {
- int r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]);
- if (r < 0) {
- if (errno == ENODEV) {
- r = LIBUSB_ERROR_NO_DEVICE;
- } else {
- usbi_err(TRANSFER_CTX(transfer),
- "submiturb failed error %d errno=%d", r, errno);
- r = LIBUSB_ERROR_IO;
- }
-
- /* if the first URB submission fails, we can simply free up and
- * return failure immediately. */
- if (i == 0) {
- usbi_dbg("first URB failed, easy peasy");
- free_iso_urbs(tpriv);
- return r;
- }
-
- /* if it's not the first URB that failed, the situation is a bit
- * tricky. we must discard all previous URBs. there are
- * complications:
- * - discarding is asynchronous - discarded urbs will be reaped
- * later. the user must not have freed the transfer when the
- * discarded URBs are reaped, otherwise libusbx will be using
- * freed memory.
- * - the earlier URBs may have completed successfully and we do
- * not want to throw away any data.
- * so, in this case we discard all the previous URBs BUT we report
- * that the transfer was submitted successfully. then later when
- * the final discard completes we can report error to the user.
- */
- tpriv->reap_action = SUBMIT_FAILED;
-
- /* The URBs we haven't submitted yet we count as already
- * retired. */
- tpriv->num_retired = num_urbs - i;
- discard_urbs(itransfer, 0, i);
-
- usbi_dbg("reporting successful submission but waiting for %d "
- "discards before reporting error", i);
- return 0;
- }
- }
-
- return 0;
-}
-
-static int submit_control_transfer(struct usbi_transfer *itransfer)
-{
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_device_handle_priv *dpriv =
- _device_handle_priv(transfer->dev_handle);
- struct usbfs_urb *urb;
- int r;
-
- if (tpriv->urbs)
- return LIBUSB_ERROR_BUSY;
-
- if (transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- urb = calloc(1, sizeof(struct usbfs_urb));
- if (!urb)
- return LIBUSB_ERROR_NO_MEM;
- tpriv->urbs = urb;
- tpriv->num_urbs = 1;
- tpriv->reap_action = NORMAL;
-
- urb->usercontext = itransfer;
- urb->type = USBFS_URB_TYPE_CONTROL;
- urb->endpoint = transfer->endpoint;
- urb->buffer = transfer->buffer;
- urb->buffer_length = transfer->length;
-
- r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);
- if (r < 0) {
- free(urb);
- tpriv->urbs = NULL;
- if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(TRANSFER_CTX(transfer),
- "submiturb failed error %d errno=%d", r, errno);
- return LIBUSB_ERROR_IO;
- }
- return 0;
-}
-
-static int op_submit_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return submit_control_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_BULK:
- return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK);
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_INTERRUPT);
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return submit_iso_transfer(itransfer);
- default:
- usbi_err(TRANSFER_CTX(transfer),
- "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static int op_cancel_transfer(struct usbi_transfer *itransfer)
-{
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_BULK:
- if (tpriv->reap_action == ERROR)
- break;
- /* else, fall through */
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- tpriv->reap_action = CANCELLED;
- break;
- default:
- usbi_err(TRANSFER_CTX(transfer),
- "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- if (!tpriv->urbs)
- return LIBUSB_ERROR_NOT_FOUND;
-
- return discard_urbs(itransfer, 0, tpriv->num_urbs);
-}
-
-static void op_clear_transfer_priv(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
-
- /* urbs can be freed also in submit_transfer so lock mutex first */
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- usbi_mutex_lock(&itransfer->lock);
- if (tpriv->urbs)
- free(tpriv->urbs);
- tpriv->urbs = NULL;
- usbi_mutex_unlock(&itransfer->lock);
- break;
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- usbi_mutex_lock(&itransfer->lock);
- if (tpriv->iso_urbs)
- free_iso_urbs(tpriv);
- usbi_mutex_unlock(&itransfer->lock);
- break;
- default:
- usbi_err(TRANSFER_CTX(transfer),
- "unknown endpoint type %d", transfer->type);
- }
-}
-
-static int handle_bulk_completion(struct usbi_transfer *itransfer,
- struct usbfs_urb *urb)
-{
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- int urb_idx = urb - tpriv->urbs;
-
- usbi_mutex_lock(&itransfer->lock);
- usbi_dbg("handling completion status %d of bulk urb %d/%d", urb->status,
- urb_idx + 1, tpriv->num_urbs);
-
- tpriv->num_retired++;
-
- if (tpriv->reap_action != NORMAL) {
- /* cancelled, submit_fail, or completed early */
- usbi_dbg("abnormal reap: urb status %d", urb->status);
-
- /* even though we're in the process of cancelling, it's possible that
- * we may receive some data in these URBs that we don't want to lose.
- * examples:
- * 1. while the kernel is cancelling all the packets that make up an
- * URB, a few of them might complete. so we get back a successful
- * cancellation *and* some data.
- * 2. we receive a short URB which marks the early completion condition,
- * so we start cancelling the remaining URBs. however, we're too
- * slow and another URB completes (or at least completes partially).
- * (this can't happen since we always use BULK_CONTINUATION.)
- *
- * When this happens, our objectives are not to lose any "surplus" data,
- * and also to stick it at the end of the previously-received data
- * (closing any holes), so that libusbx reports the total amount of
- * transferred data and presents it in a contiguous chunk.
- */
- if (urb->actual_length > 0) {
- unsigned char *target = transfer->buffer + itransfer->transferred;
- usbi_dbg("received %d bytes of surplus data", urb->actual_length);
- if (urb->buffer != target) {
- usbi_dbg("moving surplus data from offset %d to offset %d",
- (unsigned char *) urb->buffer - transfer->buffer,
- target - transfer->buffer);
- memmove(target, urb->buffer, urb->actual_length);
- }
- itransfer->transferred += urb->actual_length;
- }
-
- if (tpriv->num_retired == tpriv->num_urbs) {
- usbi_dbg("abnormal reap: last URB handled, reporting");
- if (tpriv->reap_action != COMPLETED_EARLY &&
- tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
- tpriv->reap_status = LIBUSB_TRANSFER_ERROR;
- goto completed;
- }
- goto out_unlock;
- }
-
- itransfer->transferred += urb->actual_length;
-
- /* Many of these errors can occur on *any* urb of a multi-urb
- * transfer. When they do, we tear down the rest of the transfer.
- */
- switch (urb->status) {
- case 0:
- break;
- case -EREMOTEIO: /* short transfer */
- break;
- case -ENOENT: /* cancelled */
- case -ECONNRESET:
- break;
- case -ENODEV:
- case -ESHUTDOWN:
- usbi_dbg("device removed");
- tpriv->reap_status = LIBUSB_TRANSFER_NO_DEVICE;
- goto cancel_remaining;
- case -EPIPE:
- usbi_dbg("detected endpoint stall");
- if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
- tpriv->reap_status = LIBUSB_TRANSFER_STALL;
- goto cancel_remaining;
- case -EOVERFLOW:
- /* overflow can only ever occur in the last urb */
- usbi_dbg("overflow, actual_length=%d", urb->actual_length);
- if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
- tpriv->reap_status = LIBUSB_TRANSFER_OVERFLOW;
- goto completed;
- case -ETIME:
- case -EPROTO:
- case -EILSEQ:
- case -ECOMM:
- case -ENOSR:
- usbi_dbg("low level error %d", urb->status);
- tpriv->reap_action = ERROR;
- goto cancel_remaining;
- default:
- usbi_warn(ITRANSFER_CTX(itransfer),
- "unrecognised urb status %d", urb->status);
- tpriv->reap_action = ERROR;
- goto cancel_remaining;
- }
-
- /* if we're the last urb or we got less data than requested then we're
- * done */
- if (urb_idx == tpriv->num_urbs - 1) {
- usbi_dbg("last URB in transfer --> complete!");
- goto completed;
- } else if (urb->actual_length < urb->buffer_length) {
- usbi_dbg("short transfer %d/%d --> complete!",
- urb->actual_length, urb->buffer_length);
- if (tpriv->reap_action == NORMAL)
- tpriv->reap_action = COMPLETED_EARLY;
- } else
- goto out_unlock;
-
-cancel_remaining:
- if (ERROR == tpriv->reap_action && LIBUSB_TRANSFER_COMPLETED == tpriv->reap_status)
- tpriv->reap_status = LIBUSB_TRANSFER_ERROR;
-
- if (tpriv->num_retired == tpriv->num_urbs) /* nothing to cancel */
- goto completed;
-
- /* cancel remaining urbs and wait for their completion before
- * reporting results */
- discard_urbs(itransfer, urb_idx + 1, tpriv->num_urbs);
-
-out_unlock:
- usbi_mutex_unlock(&itransfer->lock);
- return 0;
-
-completed:
- free(tpriv->urbs);
- tpriv->urbs = NULL;
- usbi_mutex_unlock(&itransfer->lock);
- return CANCELLED == tpriv->reap_action ?
- usbi_handle_transfer_cancellation(itransfer) :
- usbi_handle_transfer_completion(itransfer, tpriv->reap_status);
-}
-
-static int handle_iso_completion(struct usbi_transfer *itransfer,
- struct usbfs_urb *urb)
-{
- struct libusb_transfer *transfer =
- USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- int num_urbs = tpriv->num_urbs;
- int urb_idx = 0;
- int i;
- enum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;
-
- usbi_mutex_lock(&itransfer->lock);
- for (i = 0; i < num_urbs; i++) {
- if (urb == tpriv->iso_urbs[i]) {
- urb_idx = i + 1;
- break;
- }
- }
- if (urb_idx == 0) {
- usbi_err(TRANSFER_CTX(transfer), "could not locate urb!");
- usbi_mutex_unlock(&itransfer->lock);
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg("handling completion status %d of iso urb %d/%d", urb->status,
- urb_idx, num_urbs);
-
- /* copy isochronous results back in */
-
- for (i = 0; i < urb->number_of_packets; i++) {
- struct usbfs_iso_packet_desc *urb_desc = &urb->iso_frame_desc[i];
- struct libusb_iso_packet_descriptor *lib_desc =
- &transfer->iso_packet_desc[tpriv->iso_packet_offset++];
- lib_desc->status = LIBUSB_TRANSFER_COMPLETED;
- switch (urb_desc->status) {
- case 0:
- break;
- case -ENOENT: /* cancelled */
- case -ECONNRESET:
- break;
- case -ENODEV:
- case -ESHUTDOWN:
- usbi_dbg("device removed");
- lib_desc->status = LIBUSB_TRANSFER_NO_DEVICE;
- break;
- case -EPIPE:
- usbi_dbg("detected endpoint stall");
- lib_desc->status = LIBUSB_TRANSFER_STALL;
- break;
- case -EOVERFLOW:
- usbi_dbg("overflow error");
- lib_desc->status = LIBUSB_TRANSFER_OVERFLOW;
- break;
- case -ETIME:
- case -EPROTO:
- case -EILSEQ:
- case -ECOMM:
- case -ENOSR:
- case -EXDEV:
- usbi_dbg("low-level USB error %d", urb_desc->status);
- lib_desc->status = LIBUSB_TRANSFER_ERROR;
- break;
- default:
- usbi_warn(TRANSFER_CTX(transfer),
- "unrecognised urb status %d", urb_desc->status);
- lib_desc->status = LIBUSB_TRANSFER_ERROR;
- break;
- }
- lib_desc->actual_length = urb_desc->actual_length;
- }
-
- tpriv->num_retired++;
-
- if (tpriv->reap_action != NORMAL) { /* cancelled or submit_fail */
- usbi_dbg("CANCEL: urb status %d", urb->status);
-
- if (tpriv->num_retired == num_urbs) {
- usbi_dbg("CANCEL: last URB handled, reporting");
- free_iso_urbs(tpriv);
- if (tpriv->reap_action == CANCELLED) {
- usbi_mutex_unlock(&itransfer->lock);
- return usbi_handle_transfer_cancellation(itransfer);
- } else {
- usbi_mutex_unlock(&itransfer->lock);
- return usbi_handle_transfer_completion(itransfer,
- LIBUSB_TRANSFER_ERROR);
- }
- }
- goto out;
- }
-
- switch (urb->status) {
- case 0:
- break;
- case -ENOENT: /* cancelled */
- case -ECONNRESET:
- break;
- case -ESHUTDOWN:
- usbi_dbg("device removed");
- status = LIBUSB_TRANSFER_NO_DEVICE;
- break;
- default:
- usbi_warn(TRANSFER_CTX(transfer),
- "unrecognised urb status %d", urb->status);
- status = LIBUSB_TRANSFER_ERROR;
- break;
- }
-
- /* if we're the last urb then we're done */
- if (urb_idx == num_urbs) {
- usbi_dbg("last URB in transfer --> complete!");
- free_iso_urbs(tpriv);
- usbi_mutex_unlock(&itransfer->lock);
- return usbi_handle_transfer_completion(itransfer, status);
- }
-
-out:
- usbi_mutex_unlock(&itransfer->lock);
- return 0;
-}
-
-static int handle_control_completion(struct usbi_transfer *itransfer,
- struct usbfs_urb *urb)
-{
- struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
- int status;
-
- usbi_mutex_lock(&itransfer->lock);
- usbi_dbg("handling completion status %d", urb->status);
-
- itransfer->transferred += urb->actual_length;
-
- if (tpriv->reap_action == CANCELLED) {
- if (urb->status != 0 && urb->status != -ENOENT)
- usbi_warn(ITRANSFER_CTX(itransfer),
- "cancel: unrecognised urb status %d", urb->status);
- free(tpriv->urbs);
- tpriv->urbs = NULL;
- usbi_mutex_unlock(&itransfer->lock);
- return usbi_handle_transfer_cancellation(itransfer);
- }
-
- switch (urb->status) {
- case 0:
- status = LIBUSB_TRANSFER_COMPLETED;
- break;
- case -ENOENT: /* cancelled */
- status = LIBUSB_TRANSFER_CANCELLED;
- break;
- case -ENODEV:
- case -ESHUTDOWN:
- usbi_dbg("device removed");
- status = LIBUSB_TRANSFER_NO_DEVICE;
- break;
- case -EPIPE:
- usbi_dbg("unsupported control request");
- status = LIBUSB_TRANSFER_STALL;
- break;
- case -EOVERFLOW:
- usbi_dbg("control overflow error");
- status = LIBUSB_TRANSFER_OVERFLOW;
- break;
- case -ETIME:
- case -EPROTO:
- case -EILSEQ:
- case -ECOMM:
- case -ENOSR:
- usbi_dbg("low-level bus error occurred");
- status = LIBUSB_TRANSFER_ERROR;
- break;
- default:
- usbi_warn(ITRANSFER_CTX(itransfer),
- "unrecognised urb status %d", urb->status);
- status = LIBUSB_TRANSFER_ERROR;
- break;
- }
-
- free(tpriv->urbs);
- tpriv->urbs = NULL;
- usbi_mutex_unlock(&itransfer->lock);
- return usbi_handle_transfer_completion(itransfer, status);
-}
-
-static int reap_for_handle(struct libusb_device_handle *handle)
-{
- struct linux_device_handle_priv *hpriv = _device_handle_priv(handle);
- int r;
- struct usbfs_urb *urb;
- struct usbi_transfer *itransfer;
- struct libusb_transfer *transfer;
-
- r = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb);
- if (r == -1 && errno == EAGAIN)
- return 1;
- if (r < 0) {
- if (errno == ENODEV)
- return LIBUSB_ERROR_NO_DEVICE;
-
- usbi_err(HANDLE_CTX(handle), "reap failed error %d errno=%d",
- r, errno);
- return LIBUSB_ERROR_IO;
- }
-
- itransfer = urb->usercontext;
- transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- usbi_dbg("urb type=%d status=%d transferred=%d", urb->type, urb->status,
- urb->actual_length);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return handle_iso_completion(itransfer, urb);
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- return handle_bulk_completion(itransfer, urb);
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return handle_control_completion(itransfer, urb);
- default:
- usbi_err(HANDLE_CTX(handle), "unrecognised endpoint type %x",
- transfer->type);
- return LIBUSB_ERROR_OTHER;
- }
-}
-
-static int op_handle_events(struct libusb_context *ctx,
- struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)
-{
- int r;
- unsigned int i = 0;
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- for (i = 0; i < nfds && num_ready > 0; i++) {
- struct pollfd *pollfd = &fds[i];
- struct libusb_device_handle *handle;
- struct linux_device_handle_priv *hpriv = NULL;
-
- if (!pollfd->revents)
- continue;
-
- num_ready--;
- list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) {
- hpriv = _device_handle_priv(handle);
- if (hpriv->fd == pollfd->fd)
- break;
- }
-
- if (pollfd->revents & POLLERR) {
- usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd);
- usbi_handle_disconnect(handle);
- continue;
- }
-
- do {
- r = reap_for_handle(handle);
- } while (r == 0);
- if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE)
- continue;
- else if (r < 0)
- goto out;
- }
-
- r = 0;
-out:
- usbi_mutex_unlock(&ctx->open_devs_lock);
- return r;
-}
-
-static int op_clock_gettime(int clk_id, struct timespec *tp)
-{
- switch (clk_id) {
- case USBI_CLOCK_MONOTONIC:
- return clock_gettime(monotonic_clkid, tp);
- case USBI_CLOCK_REALTIME:
- return clock_gettime(CLOCK_REALTIME, tp);
- default:
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-#ifdef USBI_TIMERFD_AVAILABLE
-static clockid_t op_get_timerfd_clockid(void)
-{
- return monotonic_clkid;
-
-}
-#endif
-
-const struct usbi_os_backend linux_usbfs_backend = {
- .name = "Linux usbfs",
- .caps = USBI_CAP_HAS_HID_ACCESS|USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER,
- .init = op_init,
- .exit = op_exit,
- .get_device_list = NULL,
- .hotplug_poll = op_hotplug_poll,
- .get_device_descriptor = op_get_device_descriptor,
- .get_active_config_descriptor = op_get_active_config_descriptor,
- .get_config_descriptor = op_get_config_descriptor,
- .get_config_descriptor_by_value = op_get_config_descriptor_by_value,
-
- .open = op_open,
- .close = op_close,
- .get_configuration = op_get_configuration,
- .set_configuration = op_set_configuration,
- .claim_interface = op_claim_interface,
- .release_interface = op_release_interface,
-
- .set_interface_altsetting = op_set_interface,
- .clear_halt = op_clear_halt,
- .reset_device = op_reset_device,
-
- .kernel_driver_active = op_kernel_driver_active,
- .detach_kernel_driver = op_detach_kernel_driver,
- .attach_kernel_driver = op_attach_kernel_driver,
-
- .destroy_device = op_destroy_device,
-
- .submit_transfer = op_submit_transfer,
- .cancel_transfer = op_cancel_transfer,
- .clear_transfer_priv = op_clear_transfer_priv,
-
- .handle_events = op_handle_events,
-
- .clock_gettime = op_clock_gettime,
-
-#ifdef USBI_TIMERFD_AVAILABLE
- .get_timerfd_clockid = op_get_timerfd_clockid,
-#endif
-
- .device_priv_size = sizeof(struct linux_device_priv),
- .device_handle_priv_size = sizeof(struct linux_device_handle_priv),
- .transfer_priv_size = sizeof(struct linux_transfer_priv),
- .add_iso_packet_size = 0,
-};
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.h
deleted file mode 100644
index 499bab78e8..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/linux_usbfs.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * usbfs header structures
- * Copyright © 2007 Daniel Drake <dsd@gentoo.org>
- * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBUSB_USBFS_H
-#define LIBUSB_USBFS_H
-
-#include <linux/types.h>
-
-#define SYSFS_DEVICE_PATH "/sys/bus/usb/devices"
-
-struct usbfs_ctrltransfer {
- /* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
- uint8_t bmRequestType;
- uint8_t bRequest;
- uint16_t wValue;
- uint16_t wIndex;
- uint16_t wLength;
-
- uint32_t timeout; /* in milliseconds */
-
- /* pointer to data */
- void *data;
-};
-
-struct usbfs_bulktransfer {
- /* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */
- unsigned int ep;
- unsigned int len;
- unsigned int timeout; /* in milliseconds */
-
- /* pointer to data */
- void *data;
-};
-
-struct usbfs_setinterface {
- /* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */
- unsigned int interface;
- unsigned int altsetting;
-};
-
-#define USBFS_MAXDRIVERNAME 255
-
-struct usbfs_getdriver {
- unsigned int interface;
- char driver[USBFS_MAXDRIVERNAME + 1];
-};
-
-#define USBFS_URB_SHORT_NOT_OK 0x01
-#define USBFS_URB_ISO_ASAP 0x02
-#define USBFS_URB_BULK_CONTINUATION 0x04
-#define USBFS_URB_QUEUE_BULK 0x10
-#define USBFS_URB_ZERO_PACKET 0x40
-
-enum usbfs_urb_type {
- USBFS_URB_TYPE_ISO = 0,
- USBFS_URB_TYPE_INTERRUPT = 1,
- USBFS_URB_TYPE_CONTROL = 2,
- USBFS_URB_TYPE_BULK = 3,
-};
-
-struct usbfs_iso_packet_desc {
- unsigned int length;
- unsigned int actual_length;
- unsigned int status;
-};
-
-#define MAX_ISO_BUFFER_LENGTH 32768
-#define MAX_BULK_BUFFER_LENGTH 16384
-#define MAX_CTRL_BUFFER_LENGTH 4096
-
-struct usbfs_urb {
- unsigned char type;
- unsigned char endpoint;
- int status;
- unsigned int flags;
- void *buffer;
- int buffer_length;
- int actual_length;
- int start_frame;
- int number_of_packets;
- int error_count;
- unsigned int signr;
- void *usercontext;
- struct usbfs_iso_packet_desc iso_frame_desc[0];
-};
-
-struct usbfs_connectinfo {
- unsigned int devnum;
- unsigned char slow;
-};
-
-struct usbfs_ioctl {
- int ifno; /* interface 0..N ; negative numbers reserved */
- int ioctl_code; /* MUST encode size + direction of data so the
- * macros in <asm/ioctl.h> give correct values */
- void *data; /* param buffer (in, or out) */
-};
-
-struct usbfs_hub_portinfo {
- unsigned char numports;
- unsigned char port[127]; /* port to device num mapping */
-};
-
-#define USBFS_CAP_ZERO_PACKET 0x01
-#define USBFS_CAP_BULK_CONTINUATION 0x02
-#define USBFS_CAP_NO_PACKET_SIZE_LIM 0x04
-#define USBFS_CAP_BULK_SCATTER_GATHER 0x08
-
-#define USBFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
-#define USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
-
-struct usbfs_disconnect_claim {
- unsigned int interface;
- unsigned int flags;
- char driver[USBFS_MAXDRIVERNAME + 1];
-};
-
-#define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer)
-#define IOCTL_USBFS_BULK _IOWR('U', 2, struct usbfs_bulktransfer)
-#define IOCTL_USBFS_RESETEP _IOR('U', 3, unsigned int)
-#define IOCTL_USBFS_SETINTF _IOR('U', 4, struct usbfs_setinterface)
-#define IOCTL_USBFS_SETCONFIG _IOR('U', 5, unsigned int)
-#define IOCTL_USBFS_GETDRIVER _IOW('U', 8, struct usbfs_getdriver)
-#define IOCTL_USBFS_SUBMITURB _IOR('U', 10, struct usbfs_urb)
-#define IOCTL_USBFS_DISCARDURB _IO('U', 11)
-#define IOCTL_USBFS_REAPURB _IOW('U', 12, void *)
-#define IOCTL_USBFS_REAPURBNDELAY _IOW('U', 13, void *)
-#define IOCTL_USBFS_CLAIMINTF _IOR('U', 15, unsigned int)
-#define IOCTL_USBFS_RELEASEINTF _IOR('U', 16, unsigned int)
-#define IOCTL_USBFS_CONNECTINFO _IOW('U', 17, struct usbfs_connectinfo)
-#define IOCTL_USBFS_IOCTL _IOWR('U', 18, struct usbfs_ioctl)
-#define IOCTL_USBFS_HUB_PORTINFO _IOR('U', 19, struct usbfs_hub_portinfo)
-#define IOCTL_USBFS_RESET _IO('U', 20)
-#define IOCTL_USBFS_CLEAR_HALT _IOR('U', 21, unsigned int)
-#define IOCTL_USBFS_DISCONNECT _IO('U', 22)
-#define IOCTL_USBFS_CONNECT _IO('U', 23)
-#define IOCTL_USBFS_CLAIM_PORT _IOR('U', 24, unsigned int)
-#define IOCTL_USBFS_RELEASE_PORT _IOR('U', 25, unsigned int)
-#define IOCTL_USBFS_GET_CAPABILITIES _IOR('U', 26, __u32)
-#define IOCTL_USBFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbfs_disconnect_claim)
-
-extern usbi_mutex_static_t linux_hotplug_lock;
-
-#if defined(HAVE_LIBUDEV)
-int linux_udev_start_event_monitor(void);
-int linux_udev_stop_event_monitor(void);
-int linux_udev_scan_devices(struct libusb_context *ctx);
-void linux_udev_hotplug_poll(void);
-#else
-int linux_netlink_start_event_monitor(void);
-int linux_netlink_stop_event_monitor(void);
-void linux_netlink_hotplug_poll(void);
-#endif
-
-void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name);
-void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name);
-
-int linux_get_device_address (struct libusb_context *ctx, int detached,
- uint8_t *busnum, uint8_t *devaddr, const char *dev_node,
- const char *sys_name);
-int linux_enumerate_device(struct libusb_context *ctx,
- uint8_t busnum, uint8_t devaddr, const char *sysfs_dir);
-
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/openbsd_usb.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/openbsd_usb.c
deleted file mode 100644
index f4fd4543a6..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/openbsd_usb.c
+++ /dev/null
@@ -1,734 +0,0 @@
-/*
- * Copyright © 2011 Martin Pieuchot <mpi@openbsd.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <sys/time.h>
-#include <sys/types.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <dev/usb/usb.h>
-
-#include "libusb.h"
-#include "libusbi.h"
-
-struct device_priv {
- char devnode[16];
- int fd;
-
- unsigned char *cdesc; /* active config descriptor */
- usb_device_descriptor_t ddesc; /* usb device descriptor */
-};
-
-struct handle_priv {
- int pipe[2]; /* for event notification */
- int endpoints[USB_MAX_ENDPOINTS];
-};
-
-/*
- * Backend functions
- */
-static int obsd_get_device_list(struct libusb_context *,
- struct discovered_devs **);
-static int obsd_open(struct libusb_device_handle *);
-static void obsd_close(struct libusb_device_handle *);
-
-static int obsd_get_device_descriptor(struct libusb_device *, unsigned char *,
- int *);
-static int obsd_get_active_config_descriptor(struct libusb_device *,
- unsigned char *, size_t, int *);
-static int obsd_get_config_descriptor(struct libusb_device *, uint8_t,
- unsigned char *, size_t, int *);
-
-static int obsd_get_configuration(struct libusb_device_handle *, int *);
-static int obsd_set_configuration(struct libusb_device_handle *, int);
-
-static int obsd_claim_interface(struct libusb_device_handle *, int);
-static int obsd_release_interface(struct libusb_device_handle *, int);
-
-static int obsd_set_interface_altsetting(struct libusb_device_handle *, int,
- int);
-static int obsd_clear_halt(struct libusb_device_handle *, unsigned char);
-static int obsd_reset_device(struct libusb_device_handle *);
-static void obsd_destroy_device(struct libusb_device *);
-
-static int obsd_submit_transfer(struct usbi_transfer *);
-static int obsd_cancel_transfer(struct usbi_transfer *);
-static void obsd_clear_transfer_priv(struct usbi_transfer *);
-static int obsd_handle_events(struct libusb_context *ctx, struct pollfd *,
- nfds_t, int);
-static int obsd_clock_gettime(int, struct timespec *);
-
-/*
- * Private functions
- */
-static int _errno_to_libusb(int);
-static int _cache_active_config_descriptor(struct libusb_device *, int);
-static int _sync_control_transfer(struct usbi_transfer *);
-static int _sync_gen_transfer(struct usbi_transfer *);
-static int _access_endpoint(struct libusb_transfer *);
-
-const struct usbi_os_backend openbsd_backend = {
- "Synchronous OpenBSD backend",
- 0,
- NULL, /* init() */
- NULL, /* exit() */
- obsd_get_device_list,
- NULL, /* hotplug_poll */
- obsd_open,
- obsd_close,
-
- obsd_get_device_descriptor,
- obsd_get_active_config_descriptor,
- obsd_get_config_descriptor,
- NULL, /* get_config_descriptor_by_value() */
-
- obsd_get_configuration,
- obsd_set_configuration,
-
- obsd_claim_interface,
- obsd_release_interface,
-
- obsd_set_interface_altsetting,
- obsd_clear_halt,
- obsd_reset_device,
-
- NULL, /* kernel_driver_active() */
- NULL, /* detach_kernel_driver() */
- NULL, /* attach_kernel_driver() */
-
- obsd_destroy_device,
-
- obsd_submit_transfer,
- obsd_cancel_transfer,
- obsd_clear_transfer_priv,
-
- obsd_handle_events,
-
- obsd_clock_gettime,
- sizeof(struct device_priv),
- sizeof(struct handle_priv),
- 0, /* transfer_priv_size */
- 0, /* add_iso_packet_size */
-};
-
-int
-obsd_get_device_list(struct libusb_context * ctx,
- struct discovered_devs **discdevs)
-{
- struct libusb_device *dev;
- struct device_priv *dpriv;
- struct usb_device_info di;
- unsigned long session_id;
- char devnode[16];
- int fd, err, i;
-
- usbi_dbg("");
-
- /* Only ugen(4) is supported */
- for (i = 0; i < USB_MAX_DEVICES; i++) {
- /* Control endpoint is always .00 */
- snprintf(devnode, sizeof(devnode), "/dev/ugen%d.00", i);
-
- if ((fd = open(devnode, O_RDONLY)) < 0) {
- if (errno != ENOENT && errno != ENXIO)
- usbi_err(ctx, "could not open %s", devnode);
- continue;
- }
-
- if (ioctl(fd, USB_GET_DEVICEINFO, &di) < 0)
- continue;
-
- session_id = (di.udi_bus << 8 | di.udi_addr);
- dev = usbi_get_device_by_session_id(ctx, session_id);
-
- if (dev) {
- dev = libusb_ref_device(dev);
- } else {
- dev = usbi_alloc_device(ctx, session_id);
- if (dev == NULL)
- return (LIBUSB_ERROR_NO_MEM);
-
- dev->bus_number = di.udi_bus;
- dev->device_address = di.udi_addr;
- dev->speed = di.udi_speed;
-
- dpriv = (struct device_priv *)dev->os_priv;
- strlcpy(dpriv->devnode, devnode, sizeof(devnode));
- dpriv->fd = -1;
-
- if (ioctl(fd, USB_GET_DEVICE_DESC, &dpriv->ddesc) < 0) {
- err = errno;
- goto error;
- }
-
- dpriv->cdesc = NULL;
- if (_cache_active_config_descriptor(dev, fd)) {
- err = errno;
- goto error;
- }
-
- if ((err = usbi_sanitize_device(dev)))
- goto error;
- }
- close(fd);
-
- if (discovered_devs_append(*discdevs, dev) == NULL)
- return (LIBUSB_ERROR_NO_MEM);
-
- libusb_unref_device(dev);
- }
-
- return (LIBUSB_SUCCESS);
-
-error:
- close(fd);
- libusb_unref_device(dev);
- return _errno_to_libusb(err);
-}
-
-int
-obsd_open(struct libusb_device_handle *handle)
-{
- struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
-
- dpriv->fd = open(dpriv->devnode, O_RDWR);
- if (dpriv->fd < 0) {
- dpriv->fd = open(dpriv->devnode, O_RDONLY);
- if (dpriv->fd < 0)
- return _errno_to_libusb(errno);
- }
-
- usbi_dbg("open %s: fd %d", dpriv->devnode, dpriv->fd);
-
- if (pipe(hpriv->pipe) < 0)
- return _errno_to_libusb(errno);
-
- return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN);
-}
-
-void
-obsd_close(struct libusb_device_handle *handle)
-{
- struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
-
- usbi_dbg("close: fd %d", dpriv->fd);
-
- close(dpriv->fd);
- dpriv->fd = -1;
-
- usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);
-
- close(hpriv->pipe[0]);
- close(hpriv->pipe[1]);
-}
-
-int
-obsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf,
- int *host_endian)
-{
- struct device_priv *dpriv = (struct device_priv *)dev->os_priv;
-
- usbi_dbg("");
-
- memcpy(buf, &dpriv->ddesc, DEVICE_DESC_LENGTH);
-
- *host_endian = 0;
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_get_active_config_descriptor(struct libusb_device *dev,
- unsigned char *buf, size_t len, int *host_endian)
-{
- struct device_priv *dpriv = (struct device_priv *)dev->os_priv;
- usb_config_descriptor_t *ucd;
-
- ucd = (usb_config_descriptor_t *) dpriv->cdesc;
- len = MIN(len, UGETW(ucd->wTotalLength));
-
- usbi_dbg("len %d", len);
-
- memcpy(buf, dpriv->cdesc, len);
-
- *host_endian = 0;
-
- return len;
-}
-
-int
-obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,
- unsigned char *buf, size_t len, int *host_endian)
-{
- struct device_priv *dpriv = (struct device_priv *)dev->os_priv;
- struct usb_full_desc ufd;
- int fd, err;
-
- usbi_dbg("index %d, len %d", idx, len);
-
- /* A config descriptor may be requested before opening the device */
- if (dpriv->fd >= 0) {
- fd = dpriv->fd;
- } else {
- fd = open(dpriv->devnode, O_RDONLY);
- if (fd < 0)
- return _errno_to_libusb(errno);
- }
-
- ufd.ufd_config_index = idx;
- ufd.ufd_size = len;
- ufd.ufd_data = buf;
-
- if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {
- err = errno;
- if (dpriv->fd < 0)
- close(fd);
- return _errno_to_libusb(err);
- }
-
- if (dpriv->fd < 0)
- close(fd);
-
- *host_endian = 0;
-
- return len;
-}
-
-int
-obsd_get_configuration(struct libusb_device_handle *handle, int *config)
-{
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
-
- usbi_dbg("");
-
- if (ioctl(dpriv->fd, USB_GET_CONFIG, config) < 0)
- return _errno_to_libusb(errno);
-
- usbi_dbg("configuration %d", *config);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_set_configuration(struct libusb_device_handle *handle, int config)
-{
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
-
- usbi_dbg("configuration %d", config);
-
- if (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0)
- return _errno_to_libusb(errno);
-
- return _cache_active_config_descriptor(handle->dev, dpriv->fd);
-}
-
-int
-obsd_claim_interface(struct libusb_device_handle *handle, int iface)
-{
- struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;
- int i;
-
- for (i = 0; i < USB_MAX_ENDPOINTS; i++)
- hpriv->endpoints[i] = -1;
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_release_interface(struct libusb_device_handle *handle, int iface)
-{
- struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;
- int i;
-
- for (i = 0; i < USB_MAX_ENDPOINTS; i++)
- if (hpriv->endpoints[i] >= 0)
- close(hpriv->endpoints[i]);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface,
- int altsetting)
-{
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
- struct usb_alt_interface intf;
-
- usbi_dbg("iface %d, setting %d", iface, altsetting);
-
- memset(&intf, 0, sizeof(intf));
-
- intf.uai_interface_index = iface;
- intf.uai_alt_no = altsetting;
-
- if (ioctl(dpriv->fd, USB_SET_ALTINTERFACE, &intf) < 0)
- return _errno_to_libusb(errno);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint)
-{
- struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;
- struct usb_ctl_request req;
-
- usbi_dbg("");
-
- req.ucr_request.bmRequestType = UT_WRITE_ENDPOINT;
- req.ucr_request.bRequest = UR_CLEAR_FEATURE;
- USETW(req.ucr_request.wValue, UF_ENDPOINT_HALT);
- USETW(req.ucr_request.wIndex, endpoint);
- USETW(req.ucr_request.wLength, 0);
-
- if (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0)
- return _errno_to_libusb(errno);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_reset_device(struct libusb_device_handle *handle)
-{
- usbi_dbg("");
-
- return (LIBUSB_ERROR_NOT_SUPPORTED);
-}
-
-void
-obsd_destroy_device(struct libusb_device *dev)
-{
- struct device_priv *dpriv = (struct device_priv *)dev->os_priv;
-
- usbi_dbg("");
-
- free(dpriv->cdesc);
-}
-
-int
-obsd_submit_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer;
- struct handle_priv *hpriv;
- int err = 0;
-
- usbi_dbg("");
-
- transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- hpriv = (struct handle_priv *)transfer->dev_handle->os_priv;
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- err = _sync_control_transfer(itransfer);
- break;
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- if (IS_XFEROUT(transfer)) {
- /* Isochronous write is not supported */
- err = LIBUSB_ERROR_NOT_SUPPORTED;
- break;
- }
- err = _sync_gen_transfer(itransfer);
- break;
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- if (IS_XFEROUT(transfer) &&
- transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) {
- err = LIBUSB_ERROR_NOT_SUPPORTED;
- break;
- }
- err = _sync_gen_transfer(itransfer);
- break;
- }
-
- if (err)
- return (err);
-
- if (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0)
- return _errno_to_libusb(errno);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_cancel_transfer(struct usbi_transfer *itransfer)
-{
- usbi_dbg("");
-
- return (LIBUSB_ERROR_NOT_SUPPORTED);
-}
-
-void
-obsd_clear_transfer_priv(struct usbi_transfer *itransfer)
-{
- usbi_dbg("");
-
- /* Nothing to do */
-}
-
-int
-obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds,
- int num_ready)
-{
- struct libusb_device_handle *handle;
- struct handle_priv *hpriv = NULL;
- struct usbi_transfer *itransfer;
- struct pollfd *pollfd;
- int i, err = 0;
-
- usbi_dbg("");
-
- pthread_mutex_lock(&ctx->open_devs_lock);
- for (i = 0; i < nfds && num_ready > 0; i++) {
- pollfd = &fds[i];
-
- if (!pollfd->revents)
- continue;
-
- hpriv = NULL;
- num_ready--;
- list_for_each_entry(handle, &ctx->open_devs, list,
- struct libusb_device_handle) {
- hpriv = (struct handle_priv *)handle->os_priv;
-
- if (hpriv->pipe[0] == pollfd->fd)
- break;
-
- hpriv = NULL;
- }
-
- if (NULL == hpriv) {
- usbi_dbg("fd %d is not an event pipe!", pollfd->fd);
- err = ENOENT;
- break;
- }
-
- if (pollfd->revents & POLLERR) {
- usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);
- usbi_handle_disconnect(handle);
- continue;
- }
-
- if (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) {
- err = errno;
- break;
- }
-
- if ((err = usbi_handle_transfer_completion(itransfer,
- LIBUSB_TRANSFER_COMPLETED)))
- break;
- }
- pthread_mutex_unlock(&ctx->open_devs_lock);
-
- if (err)
- return _errno_to_libusb(err);
-
- return (LIBUSB_SUCCESS);
-}
-
-int
-obsd_clock_gettime(int clkid, struct timespec *tp)
-{
- usbi_dbg("clock %d", clkid);
-
- if (clkid == USBI_CLOCK_REALTIME)
- return clock_gettime(CLOCK_REALTIME, tp);
-
- if (clkid == USBI_CLOCK_MONOTONIC)
- return clock_gettime(CLOCK_MONOTONIC, tp);
-
- return (LIBUSB_ERROR_INVALID_PARAM);
-}
-
-int
-_errno_to_libusb(int err)
-{
- switch (err) {
- case EIO:
- return (LIBUSB_ERROR_IO);
- case EACCES:
- return (LIBUSB_ERROR_ACCESS);
- case ENOENT:
- return (LIBUSB_ERROR_NO_DEVICE);
- case ENOMEM:
- return (LIBUSB_ERROR_NO_MEM);
- }
-
- usbi_dbg("error: %s", strerror(err));
-
- return (LIBUSB_ERROR_OTHER);
-}
-
-int
-_cache_active_config_descriptor(struct libusb_device *dev, int fd)
-{
- struct device_priv *dpriv = (struct device_priv *)dev->os_priv;
- struct usb_config_desc ucd;
- struct usb_full_desc ufd;
- unsigned char* buf;
- int len;
-
- usbi_dbg("fd %d", fd);
-
- ucd.ucd_config_index = USB_CURRENT_CONFIG_INDEX;
-
- if ((ioctl(fd, USB_GET_CONFIG_DESC, &ucd)) < 0)
- return _errno_to_libusb(errno);
-
- usbi_dbg("active bLength %d", ucd.ucd_desc.bLength);
-
- len = UGETW(ucd.ucd_desc.wTotalLength);
- buf = malloc(len);
- if (buf == NULL)
- return (LIBUSB_ERROR_NO_MEM);
-
- ufd.ufd_config_index = ucd.ucd_config_index;
- ufd.ufd_size = len;
- ufd.ufd_data = buf;
-
- usbi_dbg("index %d, len %d", ufd.ufd_config_index, len);
-
- if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {
- free(buf);
- return _errno_to_libusb(errno);
- }
-
- if (dpriv->cdesc)
- free(dpriv->cdesc);
- dpriv->cdesc = buf;
-
- return (0);
-}
-
-int
-_sync_control_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer;
- struct libusb_control_setup *setup;
- struct device_priv *dpriv;
- struct usb_ctl_request req;
-
- transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;
- setup = (struct libusb_control_setup *)transfer->buffer;
-
- usbi_dbg("type %d request %d value %d index %d length %d timeout %d",
- setup->bmRequestType, setup->bRequest,
- libusb_le16_to_cpu(setup->wValue),
- libusb_le16_to_cpu(setup->wIndex),
- libusb_le16_to_cpu(setup->wLength), transfer->timeout);
-
- req.ucr_request.bmRequestType = setup->bmRequestType;
- req.ucr_request.bRequest = setup->bRequest;
- /* Don't use USETW, libusbx already deals with the endianness */
- (*(uint16_t *)req.ucr_request.wValue) = setup->wValue;
- (*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex;
- (*(uint16_t *)req.ucr_request.wLength) = setup->wLength;
- req.ucr_data = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
-
- if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)
- req.ucr_flags = USBD_SHORT_XFER_OK;
-
- if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
- return _errno_to_libusb(errno);
-
- if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0)
- return _errno_to_libusb(errno);
-
- itransfer->transferred = req.ucr_actlen;
-
- usbi_dbg("transferred %d", itransfer->transferred);
-
- return (0);
-}
-
-int
-_access_endpoint(struct libusb_transfer *transfer)
-{
- struct handle_priv *hpriv;
- struct device_priv *dpriv;
- char *s, devnode[16];
- int fd, endpt;
- mode_t mode;
-
- hpriv = (struct handle_priv *)transfer->dev_handle->os_priv;
- dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;
-
- endpt = UE_GET_ADDR(transfer->endpoint);
- mode = IS_XFERIN(transfer) ? O_RDONLY : O_WRONLY;
-
- usbi_dbg("endpoint %d mode %d", endpt, mode);
-
- if (hpriv->endpoints[endpt] < 0) {
- /* Pick the right node given the control one */
- strlcpy(devnode, dpriv->devnode, sizeof(devnode));
- s = strchr(devnode, '.');
- snprintf(s, 4, ".%02d", endpt);
-
- /* We may need to read/write to the same endpoint later. */
- if (((fd = open(devnode, O_RDWR)) < 0) && (errno == ENXIO))
- if ((fd = open(devnode, mode)) < 0)
- return (-1);
-
- hpriv->endpoints[endpt] = fd;
- }
-
- return (hpriv->endpoints[endpt]);
-}
-
-int
-_sync_gen_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer;
- int fd, nr = 1;
-
- transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- /*
- * Bulk, Interrupt or Isochronous transfer depends on the
- * endpoint and thus the node to open.
- */
- if ((fd = _access_endpoint(transfer)) < 0)
- return _errno_to_libusb(errno);
-
- if ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
- return _errno_to_libusb(errno);
-
- if (IS_XFERIN(transfer)) {
- if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)
- if ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0)
- return _errno_to_libusb(errno);
-
- nr = read(fd, transfer->buffer, transfer->length);
- } else {
- nr = write(fd, transfer->buffer, transfer->length);
- }
-
- if (nr < 0)
- return _errno_to_libusb(errno);
-
- itransfer->transferred = nr;
-
- return (0);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.c
deleted file mode 100644
index eeaf5dce49..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * poll_posix: poll compatibility wrapper for POSIX systems
- * Copyright © 2013 RealVNC Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "libusbi.h"
-
-int usbi_pipe(int pipefd[2])
-{
- int ret = pipe(pipefd);
- if (ret != 0) {
- return ret;
- }
- ret = fcntl(pipefd[1], F_GETFL);
- if (ret == -1) {
- usbi_dbg("Failed to get pipe fd flags: %d", errno);
- goto err_close_pipe;
- }
- ret = fcntl(pipefd[1], F_SETFL, ret | O_NONBLOCK);
- if (ret != 0) {
- usbi_dbg("Failed to set non-blocking on new pipe: %d", errno);
- goto err_close_pipe;
- }
-
- return 0;
-
-err_close_pipe:
- usbi_close(pipefd[0]);
- usbi_close(pipefd[1]);
- return ret;
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.h
deleted file mode 100644
index 5b4b2c905e..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_posix.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef LIBUSB_POLL_POSIX_H
-#define LIBUSB_POLL_POSIX_H
-
-#define usbi_write write
-#define usbi_read read
-#define usbi_close close
-#define usbi_poll poll
-
-int usbi_pipe(int pipefd[2]);
-
-#endif /* LIBUSB_POLL_POSIX_H */
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.c
deleted file mode 100644
index 7ed19ba324..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/*
- * poll_windows: poll compatibility wrapper for Windows
- * Copyright © 2012-2013 RealVNC Ltd.
- * Copyright © 2009-2010 Pete Batard <pete@akeo.ie>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of poll implementation from libusb-win32, by Stephan Meyer et al.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * poll() and pipe() Windows compatibility layer for libusbx 1.0
- *
- * The way this layer works is by using OVERLAPPED with async I/O transfers, as
- * OVERLAPPED have an associated event which is flagged for I/O completion.
- *
- * For USB pollable async I/O, you would typically:
- * - obtain a Windows HANDLE to a file or device that has been opened in
- * OVERLAPPED mode
- * - call usbi_create_fd with this handle to obtain a custom fd.
- * Note that if you need simultaneous R/W access, you need to call create_fd
- * twice, once in RW_READ and once in RW_WRITE mode to obtain 2 separate
- * pollable fds
- * - leave the core functions call the poll routine and flag POLLIN/POLLOUT
- *
- * The pipe pollable synchronous I/O works using the overlapped event associated
- * with a fake pipe. The read/write functions are only meant to be used in that
- * context.
- */
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libusbi.h"
-
-// Uncomment to debug the polling layer
-//#define DEBUG_POLL_WINDOWS
-#if defined(DEBUG_POLL_WINDOWS)
-#define poll_dbg usbi_dbg
-#else
-// MSVC++ < 2005 cannot use a variadic argument and non MSVC
-// compilers produce warnings if parenthesis are ommitted.
-#if defined(_MSC_VER) && (_MSC_VER < 1400)
-#define poll_dbg
-#else
-#define poll_dbg(...)
-#endif
-#endif
-
-#if defined(_PREFAST_)
-#pragma warning(disable:28719)
-#endif
-
-#define CHECK_INIT_POLLING do {if(!is_polling_set) init_polling();} while(0)
-
-// public fd data
-const struct winfd INVALID_WINFD = {-1, INVALID_HANDLE_VALUE, NULL, NULL, NULL, RW_NONE};
-struct winfd poll_fd[MAX_FDS];
-// internal fd data
-struct {
- CRITICAL_SECTION mutex; // lock for fds
- // Additional variables for XP CancelIoEx partial emulation
- HANDLE original_handle;
- DWORD thread_id;
-} _poll_fd[MAX_FDS];
-
-// globals
-BOOLEAN is_polling_set = FALSE;
-LONG pipe_number = 0;
-static volatile LONG compat_spinlock = 0;
-
-#if !defined(_WIN32_WCE)
-// CancelIoEx, available on Vista and later only, provides the ability to cancel
-// a single transfer (OVERLAPPED) when used. As it may not be part of any of the
-// platform headers, we hook into the Kernel32 system DLL directly to seek it.
-static BOOL (__stdcall *pCancelIoEx)(HANDLE, LPOVERLAPPED) = NULL;
-#define Use_Duplicate_Handles (pCancelIoEx == NULL)
-
-static inline void setup_cancel_io(void)
-{
- HMODULE hKernel32 = GetModuleHandleA("KERNEL32");
- if (hKernel32 != NULL) {
- pCancelIoEx = (BOOL (__stdcall *)(HANDLE,LPOVERLAPPED))
- GetProcAddress(hKernel32, "CancelIoEx");
- }
- usbi_dbg("Will use CancelIo%s for I/O cancellation",
- Use_Duplicate_Handles?"":"Ex");
-}
-
-static inline BOOL cancel_io(int _index)
-{
- if ((_index < 0) || (_index >= MAX_FDS)) {
- return FALSE;
- }
-
- if ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)
- || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) {
- return TRUE;
- }
- if (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) {
- // Cancel outstanding transfer via the specific callback
- (*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer);
- return TRUE;
- }
- if (pCancelIoEx != NULL) {
- return (*pCancelIoEx)(poll_fd[_index].handle, poll_fd[_index].overlapped);
- }
- if (_poll_fd[_index].thread_id == GetCurrentThreadId()) {
- return CancelIo(poll_fd[_index].handle);
- }
- usbi_warn(NULL, "Unable to cancel I/O that was started from another thread");
- return FALSE;
-}
-#else
-#define Use_Duplicate_Handles FALSE
-
-static __inline void setup_cancel_io()
-{
- // No setup needed on WinCE
-}
-
-static __inline BOOL cancel_io(int _index)
-{
- if ((_index < 0) || (_index >= MAX_FDS)) {
- return FALSE;
- }
- if ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)
- || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) {
- return TRUE;
- }
- if (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) {
- // Cancel outstanding transfer via the specific callback
- (*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer);
- }
- return TRUE;
-}
-#endif
-
-// Init
-void init_polling(void)
-{
- int i;
-
- while (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) {
- SleepEx(0, TRUE);
- }
- if (!is_polling_set) {
- setup_cancel_io();
- for (i=0; i<MAX_FDS; i++) {
- poll_fd[i] = INVALID_WINFD;
- _poll_fd[i].original_handle = INVALID_HANDLE_VALUE;
- _poll_fd[i].thread_id = 0;
- InitializeCriticalSection(&_poll_fd[i].mutex);
- }
- is_polling_set = TRUE;
- }
- InterlockedExchange((LONG *)&compat_spinlock, 0);
-}
-
-// Internal function to retrieve the table index (and lock the fd mutex)
-static int _fd_to_index_and_lock(int fd)
-{
- int i;
-
- if (fd < 0)
- return -1;
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].fd == fd) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have changed before we got to critical
- if (poll_fd[i].fd != fd) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
- return i;
- }
- }
- return -1;
-}
-
-static OVERLAPPED *create_overlapped(void)
-{
- OVERLAPPED *overlapped = (OVERLAPPED*) calloc(1, sizeof(OVERLAPPED));
- if (overlapped == NULL) {
- return NULL;
- }
- overlapped->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- if(overlapped->hEvent == NULL) {
- free (overlapped);
- return NULL;
- }
- return overlapped;
-}
-
-static void free_overlapped(OVERLAPPED *overlapped)
-{
- if (overlapped == NULL)
- return;
-
- if ( (overlapped->hEvent != 0)
- && (overlapped->hEvent != INVALID_HANDLE_VALUE) ) {
- CloseHandle(overlapped->hEvent);
- }
- free(overlapped);
-}
-
-void exit_polling(void)
-{
- int i;
-
- while (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) {
- SleepEx(0, TRUE);
- }
- if (is_polling_set) {
- is_polling_set = FALSE;
-
- for (i=0; i<MAX_FDS; i++) {
- // Cancel any async I/O (handle can be invalid)
- cancel_io(i);
- // If anything was pending on that I/O, it should be
- // terminating, and we should be able to access the fd
- // mutex lock before too long
- EnterCriticalSection(&_poll_fd[i].mutex);
- free_overlapped(poll_fd[i].overlapped);
- if (Use_Duplicate_Handles) {
- // Close duplicate handle
- if (_poll_fd[i].original_handle != INVALID_HANDLE_VALUE) {
- CloseHandle(poll_fd[i].handle);
- }
- }
- poll_fd[i] = INVALID_WINFD;
- LeaveCriticalSection(&_poll_fd[i].mutex);
- DeleteCriticalSection(&_poll_fd[i].mutex);
- }
- }
- InterlockedExchange((LONG *)&compat_spinlock, 0);
-}
-
-/*
- * Create a fake pipe.
- * As libusbx only uses pipes for signaling, all we need from a pipe is an
- * event. To that extent, we create a single wfd and overlapped as a means
- * to access that event.
- */
-int usbi_pipe(int filedes[2])
-{
- int i;
- OVERLAPPED* overlapped;
-
- CHECK_INIT_POLLING;
-
- overlapped = create_overlapped();
-
- if (overlapped == NULL) {
- return -1;
- }
- // The overlapped must have status pending for signaling to work in poll
- overlapped->Internal = STATUS_PENDING;
- overlapped->InternalHigh = 0;
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].fd < 0) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have been allocated before we got to critical
- if (poll_fd[i].fd >= 0) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
-
- // Use index as the unique fd number
- poll_fd[i].fd = i;
- // Read end of the "pipe"
- filedes[0] = poll_fd[i].fd;
- // We can use the same handle for both ends
- filedes[1] = filedes[0];
-
- poll_fd[i].handle = DUMMY_HANDLE;
- poll_fd[i].overlapped = overlapped;
- // There's no polling on the write end, so we just use READ for our needs
- poll_fd[i].rw = RW_READ;
- _poll_fd[i].original_handle = INVALID_HANDLE_VALUE;
- LeaveCriticalSection(&_poll_fd[i].mutex);
- return 0;
- }
- }
- free_overlapped(overlapped);
- return -1;
-}
-
-/*
- * Create both an fd and an OVERLAPPED from an open Windows handle, so that
- * it can be used with our polling function
- * The handle MUST support overlapped transfers (usually requires CreateFile
- * with FILE_FLAG_OVERLAPPED)
- * Return a pollable file descriptor struct, or INVALID_WINFD on error
- *
- * Note that the fd returned by this function is a per-transfer fd, rather
- * than a per-session fd and cannot be used for anything else but our
- * custom functions (the fd itself points to the NUL: device)
- * if you plan to do R/W on the same handle, you MUST create 2 fds: one for
- * read and one for write. Using a single R/W fd is unsupported and will
- * produce unexpected results
- */
-struct winfd usbi_create_fd(HANDLE handle, int access_mode, struct usbi_transfer *itransfer, cancel_transfer *cancel_fn)
-{
- int i;
- struct winfd wfd = INVALID_WINFD;
- OVERLAPPED* overlapped = NULL;
-
- CHECK_INIT_POLLING;
-
- if ((handle == 0) || (handle == INVALID_HANDLE_VALUE)) {
- return INVALID_WINFD;
- }
-
- wfd.itransfer = itransfer;
- wfd.cancel_fn = cancel_fn;
-
- if ((access_mode != RW_READ) && (access_mode != RW_WRITE)) {
- usbi_warn(NULL, "only one of RW_READ or RW_WRITE are supported.\n"
- "If you want to poll for R/W simultaneously, create multiple fds from the same handle.");
- return INVALID_WINFD;
- }
- if (access_mode == RW_READ) {
- wfd.rw = RW_READ;
- } else {
- wfd.rw = RW_WRITE;
- }
-
- overlapped = create_overlapped();
- if(overlapped == NULL) {
- return INVALID_WINFD;
- }
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].fd < 0) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have been removed before we got to critical
- if (poll_fd[i].fd >= 0) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
- // Use index as the unique fd number
- wfd.fd = i;
- // Attempt to emulate some of the CancelIoEx behaviour on platforms
- // that don't have it
- if (Use_Duplicate_Handles) {
- _poll_fd[i].thread_id = GetCurrentThreadId();
- if (!DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(),
- &wfd.handle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
- usbi_dbg("could not duplicate handle for CancelIo - using original one");
- wfd.handle = handle;
- // Make sure we won't close the original handle on fd deletion then
- _poll_fd[i].original_handle = INVALID_HANDLE_VALUE;
- } else {
- _poll_fd[i].original_handle = handle;
- }
- } else {
- wfd.handle = handle;
- }
- wfd.overlapped = overlapped;
- memcpy(&poll_fd[i], &wfd, sizeof(struct winfd));
- LeaveCriticalSection(&_poll_fd[i].mutex);
- return wfd;
- }
- }
- free_overlapped(overlapped);
- return INVALID_WINFD;
-}
-
-static void _free_index(int _index)
-{
- // Cancel any async IO (Don't care about the validity of our handles for this)
- cancel_io(_index);
- // close the duplicate handle (if we have an actual duplicate)
- if (Use_Duplicate_Handles) {
- if (_poll_fd[_index].original_handle != INVALID_HANDLE_VALUE) {
- CloseHandle(poll_fd[_index].handle);
- }
- _poll_fd[_index].original_handle = INVALID_HANDLE_VALUE;
- _poll_fd[_index].thread_id = 0;
- }
- free_overlapped(poll_fd[_index].overlapped);
- poll_fd[_index] = INVALID_WINFD;
-}
-
-/*
- * Release a pollable file descriptor.
- *
- * Note that the associated Windows handle is not closed by this call
- */
-void usbi_free_fd(struct winfd *wfd)
-{
- int _index;
-
- CHECK_INIT_POLLING;
-
- _index = _fd_to_index_and_lock(wfd->fd);
- if (_index < 0) {
- return;
- }
- _free_index(_index);
- *wfd = INVALID_WINFD;
- LeaveCriticalSection(&_poll_fd[_index].mutex);
-}
-
-/*
- * The functions below perform various conversions between fd, handle and OVERLAPPED
- */
-struct winfd fd_to_winfd(int fd)
-{
- int i;
- struct winfd wfd;
-
- CHECK_INIT_POLLING;
-
- if (fd <= 0)
- return INVALID_WINFD;
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].fd == fd) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have been deleted before we got to critical
- if (poll_fd[i].fd != fd) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
- memcpy(&wfd, &poll_fd[i], sizeof(struct winfd));
- LeaveCriticalSection(&_poll_fd[i].mutex);
- return wfd;
- }
- }
- return INVALID_WINFD;
-}
-
-struct winfd handle_to_winfd(HANDLE handle)
-{
- int i;
- struct winfd wfd;
-
- CHECK_INIT_POLLING;
-
- if ((handle == 0) || (handle == INVALID_HANDLE_VALUE))
- return INVALID_WINFD;
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].handle == handle) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have been deleted before we got to critical
- if (poll_fd[i].handle != handle) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
- memcpy(&wfd, &poll_fd[i], sizeof(struct winfd));
- LeaveCriticalSection(&_poll_fd[i].mutex);
- return wfd;
- }
- }
- return INVALID_WINFD;
-}
-
-struct winfd overlapped_to_winfd(OVERLAPPED* overlapped)
-{
- int i;
- struct winfd wfd;
-
- CHECK_INIT_POLLING;
-
- if (overlapped == NULL)
- return INVALID_WINFD;
-
- for (i=0; i<MAX_FDS; i++) {
- if (poll_fd[i].overlapped == overlapped) {
- EnterCriticalSection(&_poll_fd[i].mutex);
- // fd might have been deleted before we got to critical
- if (poll_fd[i].overlapped != overlapped) {
- LeaveCriticalSection(&_poll_fd[i].mutex);
- continue;
- }
- memcpy(&wfd, &poll_fd[i], sizeof(struct winfd));
- LeaveCriticalSection(&_poll_fd[i].mutex);
- return wfd;
- }
- }
- return INVALID_WINFD;
-}
-
-/*
- * POSIX poll equivalent, using Windows OVERLAPPED
- * Currently, this function only accepts one of POLLIN or POLLOUT per fd
- * (but you can create multiple fds from the same handle for read and write)
- */
-int usbi_poll(struct pollfd *fds, unsigned int nfds, int timeout)
-{
- unsigned i;
- int _index, object_index, triggered;
- HANDLE *handles_to_wait_on;
- int *handle_to_index;
- DWORD nb_handles_to_wait_on = 0;
- DWORD ret;
-
- CHECK_INIT_POLLING;
-
- triggered = 0;
- handles_to_wait_on = (HANDLE*) calloc(nfds+1, sizeof(HANDLE)); // +1 for fd_update
- handle_to_index = (int*) calloc(nfds, sizeof(int));
- if ((handles_to_wait_on == NULL) || (handle_to_index == NULL)) {
- errno = ENOMEM;
- triggered = -1;
- goto poll_exit;
- }
-
- for (i = 0; i < nfds; ++i) {
- fds[i].revents = 0;
-
- // Only one of POLLIN or POLLOUT can be selected with this version of poll (not both)
- if ((fds[i].events & ~POLLIN) && (!(fds[i].events & POLLOUT))) {
- fds[i].revents |= POLLERR;
- errno = EACCES;
- usbi_warn(NULL, "unsupported set of events");
- triggered = -1;
- goto poll_exit;
- }
-
- _index = _fd_to_index_and_lock(fds[i].fd);
- poll_dbg("fd[%d]=%d: (overlapped=%p) got events %04X", i, poll_fd[_index].fd, poll_fd[_index].overlapped, fds[i].events);
-
- if ( (_index < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)
- || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL)) {
- fds[i].revents |= POLLNVAL | POLLERR;
- errno = EBADF;
- if (_index >= 0) {
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- }
- usbi_warn(NULL, "invalid fd");
- triggered = -1;
- goto poll_exit;
- }
-
- // IN or OUT must match our fd direction
- if ((fds[i].events & POLLIN) && (poll_fd[_index].rw != RW_READ)) {
- fds[i].revents |= POLLNVAL | POLLERR;
- errno = EBADF;
- usbi_warn(NULL, "attempted POLLIN on fd without READ access");
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- triggered = -1;
- goto poll_exit;
- }
-
- if ((fds[i].events & POLLOUT) && (poll_fd[_index].rw != RW_WRITE)) {
- fds[i].revents |= POLLNVAL | POLLERR;
- errno = EBADF;
- usbi_warn(NULL, "attempted POLLOUT on fd without WRITE access");
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- triggered = -1;
- goto poll_exit;
- }
-
- // The following macro only works if overlapped I/O was reported pending
- if ( (HasOverlappedIoCompleted(poll_fd[_index].overlapped))
- || (HasOverlappedIoCompletedSync(poll_fd[_index].overlapped)) ) {
- poll_dbg(" completed");
- // checks above should ensure this works:
- fds[i].revents = fds[i].events;
- triggered++;
- } else {
- handles_to_wait_on[nb_handles_to_wait_on] = poll_fd[_index].overlapped->hEvent;
- handle_to_index[nb_handles_to_wait_on] = i;
- nb_handles_to_wait_on++;
- }
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- }
-
- // If nothing was triggered, wait on all fds that require it
- if ((timeout != 0) && (triggered == 0) && (nb_handles_to_wait_on != 0)) {
- if (timeout < 0) {
- poll_dbg("starting infinite wait for %d handles...", (int)nb_handles_to_wait_on);
- } else {
- poll_dbg("starting %d ms wait for %d handles...", timeout, (int)nb_handles_to_wait_on);
- }
- ret = WaitForMultipleObjects(nb_handles_to_wait_on, handles_to_wait_on,
- FALSE, (timeout<0)?INFINITE:(DWORD)timeout);
- object_index = ret-WAIT_OBJECT_0;
- if ((object_index >= 0) && ((DWORD)object_index < nb_handles_to_wait_on)) {
- poll_dbg(" completed after wait");
- i = handle_to_index[object_index];
- _index = _fd_to_index_and_lock(fds[i].fd);
- fds[i].revents = fds[i].events;
- triggered++;
- if (_index >= 0) {
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- }
- } else if (ret == WAIT_TIMEOUT) {
- poll_dbg(" timed out");
- triggered = 0; // 0 = timeout
- } else {
- errno = EIO;
- triggered = -1; // error
- }
- }
-
-poll_exit:
- if (handles_to_wait_on != NULL) {
- free(handles_to_wait_on);
- }
- if (handle_to_index != NULL) {
- free(handle_to_index);
- }
- return triggered;
-}
-
-/*
- * close a fake pipe fd
- */
-int usbi_close(int fd)
-{
- int _index;
- int r = -1;
-
- CHECK_INIT_POLLING;
-
- _index = _fd_to_index_and_lock(fd);
-
- if (_index < 0) {
- errno = EBADF;
- } else {
- free_overlapped(poll_fd[_index].overlapped);
- poll_fd[_index] = INVALID_WINFD;
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- }
- return r;
-}
-
-/*
- * synchronous write for fake "pipe" signaling
- */
-ssize_t usbi_write(int fd, const void *buf, size_t count)
-{
- int _index;
- UNUSED(buf);
-
- CHECK_INIT_POLLING;
-
- if (count != sizeof(unsigned char)) {
- usbi_err(NULL, "this function should only used for signaling");
- return -1;
- }
-
- _index = _fd_to_index_and_lock(fd);
-
- if ( (_index < 0) || (poll_fd[_index].overlapped == NULL) ) {
- errno = EBADF;
- if (_index >= 0) {
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- }
- return -1;
- }
-
- poll_dbg("set pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId());
- SetEvent(poll_fd[_index].overlapped->hEvent);
- poll_fd[_index].overlapped->Internal = STATUS_WAIT_0;
- // If two threads write on the pipe at the same time, we need to
- // process two separate reads => use the overlapped as a counter
- poll_fd[_index].overlapped->InternalHigh++;
-
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- return sizeof(unsigned char);
-}
-
-/*
- * synchronous read for fake "pipe" signaling
- */
-ssize_t usbi_read(int fd, void *buf, size_t count)
-{
- int _index;
- ssize_t r = -1;
- UNUSED(buf);
-
- CHECK_INIT_POLLING;
-
- if (count != sizeof(unsigned char)) {
- usbi_err(NULL, "this function should only used for signaling");
- return -1;
- }
-
- _index = _fd_to_index_and_lock(fd);
-
- if (_index < 0) {
- errno = EBADF;
- return -1;
- }
-
- if (WaitForSingleObject(poll_fd[_index].overlapped->hEvent, INFINITE) != WAIT_OBJECT_0) {
- usbi_warn(NULL, "waiting for event failed: %d", (int)GetLastError());
- errno = EIO;
- goto out;
- }
-
- poll_dbg("clr pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId());
- poll_fd[_index].overlapped->InternalHigh--;
- // Don't reset unless we don't have any more events to process
- if (poll_fd[_index].overlapped->InternalHigh <= 0) {
- ResetEvent(poll_fd[_index].overlapped->hEvent);
- poll_fd[_index].overlapped->Internal = STATUS_PENDING;
- }
-
- r = sizeof(unsigned char);
-
-out:
- LeaveCriticalSection(&_poll_fd[_index].mutex);
- return r;
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.h
deleted file mode 100644
index deed206444..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/poll_windows.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Windows compat: POSIX compatibility wrapper
- * Copyright © 2012-2013 RealVNC Ltd.
- * Copyright © 2009-2010 Pete Batard <pete@akeo.ie>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of poll implementation from libusb-win32, by Stephan Meyer et al.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#pragma once
-
-#if defined(_MSC_VER)
-// disable /W4 MSVC warnings that are benign
-#pragma warning(disable:4127) // conditional expression is constant
-#endif
-
-// Handle synchronous completion through the overlapped structure
-#if !defined(STATUS_REPARSE) // reuse the REPARSE status code
-#define STATUS_REPARSE ((LONG)0x00000104L)
-#endif
-#define STATUS_COMPLETED_SYNCHRONOUSLY STATUS_REPARSE
-#if defined(_WIN32_WCE)
-// WinCE doesn't have a HasOverlappedIoCompleted() macro, so attempt to emulate it
-#define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) != STATUS_PENDING)
-#endif
-#define HasOverlappedIoCompletedSync(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) == STATUS_COMPLETED_SYNCHRONOUSLY)
-
-#define DUMMY_HANDLE ((HANDLE)(LONG_PTR)-2)
-
-enum windows_version {
- WINDOWS_UNSUPPORTED,
- WINDOWS_CE,
- WINDOWS_XP,
- WINDOWS_2003, // also includes XP 64
- WINDOWS_VISTA_AND_LATER,
-};
-extern enum windows_version windows_version;
-
-#define MAX_FDS 256
-
-#define POLLIN 0x0001 /* There is data to read */
-#define POLLPRI 0x0002 /* There is urgent data to read */
-#define POLLOUT 0x0004 /* Writing now will not block */
-#define POLLERR 0x0008 /* Error condition */
-#define POLLHUP 0x0010 /* Hung up */
-#define POLLNVAL 0x0020 /* Invalid request: fd not open */
-
-struct pollfd {
- int fd; /* file descriptor */
- short events; /* requested events */
- short revents; /* returned events */
-};
-
-// access modes
-enum rw_type {
- RW_NONE,
- RW_READ,
- RW_WRITE,
-};
-
-// fd struct that can be used for polling on Windows
-typedef int cancel_transfer(struct usbi_transfer *itransfer);
-
-struct winfd {
- int fd; // what's exposed to libusb core
- HANDLE handle; // what we need to attach overlapped to the I/O op, so we can poll it
- OVERLAPPED* overlapped; // what will report our I/O status
- struct usbi_transfer *itransfer; // Associated transfer, or NULL if completed
- cancel_transfer *cancel_fn; // Function pointer to cancel transfer API
- enum rw_type rw; // I/O transfer direction: read *XOR* write (NOT BOTH)
-};
-extern const struct winfd INVALID_WINFD;
-
-int usbi_pipe(int pipefd[2]);
-int usbi_poll(struct pollfd *fds, unsigned int nfds, int timeout);
-ssize_t usbi_write(int fd, const void *buf, size_t count);
-ssize_t usbi_read(int fd, void *buf, size_t count);
-int usbi_close(int fd);
-
-void init_polling(void);
-void exit_polling(void);
-struct winfd usbi_create_fd(HANDLE handle, int access_mode,
- struct usbi_transfer *transfer, cancel_transfer *cancel_fn);
-void usbi_free_fd(struct winfd* winfd);
-struct winfd fd_to_winfd(int fd);
-struct winfd handle_to_winfd(HANDLE handle);
-struct winfd overlapped_to_winfd(OVERLAPPED* overlapped);
-
-/*
- * Timeval operations
- */
-#if defined(DDKBUILD)
-#include <winsock.h> // defines timeval functions on DDK
-#endif
-
-#if !defined(TIMESPEC_TO_TIMEVAL)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (long)(ts)->tv_sec; \
- (tv)->tv_usec = (long)(ts)->tv_nsec / 1000; \
-}
-#endif
-#if !defined(timersub)
-#define timersub(a, b, result) \
-do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
-} while (0)
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.c
deleted file mode 100644
index 9769f58367..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * libusbx synchronization using POSIX Threads
- *
- * Copyright © 2011 Vitali Lovich <vlovich@aliph.com>
- * Copyright © 2011 Peter Stuge <peter@stuge.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if defined(__linux__) || defined(__OpenBSD__)
-# if defined(__linux__)
-# define _GNU_SOURCE
-# else
-# define _BSD_SOURCE
-# endif
-# include <unistd.h>
-# include <sys/syscall.h>
-#elif defined(__APPLE__)
-# include <mach/mach.h>
-#elif defined(__CYGWIN__)
-# include <windows.h>
-#endif
-
-#include "threads_posix.h"
-
-int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-{
- int err;
- pthread_mutexattr_t stack_attr;
- if (!attr) {
- attr = &stack_attr;
- err = pthread_mutexattr_init(&stack_attr);
- if (err != 0)
- return err;
- }
-
- /* mutexattr_settype requires _GNU_SOURCE or _XOPEN_SOURCE >= 500 on Linux */
- err = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE);
- if (err != 0)
- goto finish;
-
- err = pthread_mutex_init(mutex, attr);
-
-finish:
- if (attr == &stack_attr)
- pthread_mutexattr_destroy(&stack_attr);
-
- return err;
-}
-
-int usbi_get_tid(void)
-{
- int ret = -1;
-#if defined(__linux__)
- ret = syscall(SYS_gettid);
-#elif defined(__OpenBSD__)
- /* The following only works with OpenBSD > 5.1 as it requires
- real thread support. For 5.1 and earlier, -1 is returned. */
- ret = syscall(SYS_getthrid);
-#elif defined(__APPLE__)
- ret = mach_thread_self();
- mach_port_deallocate(mach_task_self(), ret);
-#elif defined(__CYGWIN__)
- ret = GetCurrentThreadId();
-#endif
-/* TODO: NetBSD thread ID support */
- return ret;
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.h
deleted file mode 100644
index 0b6a71a552..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_posix.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * libusbx synchronization using POSIX Threads
- *
- * Copyright © 2010 Peter Stuge <peter@stuge.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBUSB_THREADS_POSIX_H
-#define LIBUSB_THREADS_POSIX_H
-
-#include <pthread.h>
-
-#define usbi_mutex_static_t pthread_mutex_t
-#define USBI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#define usbi_mutex_static_lock pthread_mutex_lock
-#define usbi_mutex_static_unlock pthread_mutex_unlock
-
-#define usbi_mutex_t pthread_mutex_t
-#define usbi_mutex_init pthread_mutex_init
-#define usbi_mutex_lock pthread_mutex_lock
-#define usbi_mutex_unlock pthread_mutex_unlock
-#define usbi_mutex_trylock pthread_mutex_trylock
-#define usbi_mutex_destroy pthread_mutex_destroy
-
-#define usbi_cond_t pthread_cond_t
-#define usbi_cond_init pthread_cond_init
-#define usbi_cond_wait pthread_cond_wait
-#define usbi_cond_timedwait pthread_cond_timedwait
-#define usbi_cond_broadcast pthread_cond_broadcast
-#define usbi_cond_destroy pthread_cond_destroy
-#define usbi_cond_signal pthread_cond_signal
-
-extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
-
-int usbi_get_tid(void);
-
-#endif /* LIBUSB_THREADS_POSIX_H */
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.c
deleted file mode 100644
index cad27e9ea0..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * libusbx synchronization on Microsoft Windows
- *
- * Copyright © 2010 Michael Plante <michael.plante@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <config.h>
-#include <objbase.h>
-#include <errno.h>
-#include <stdarg.h>
-
-#include "libusbi.h"
-
-extern const uint64_t epoch_time;
-
-int usbi_mutex_init(usbi_mutex_t *mutex,
- const usbi_mutexattr_t *attr) {
- UNUSED(attr);
- if(! mutex) return ((errno=EINVAL));
- *mutex = CreateMutex(NULL, FALSE, NULL);
- if(!*mutex) return ((errno=ENOMEM));
- return 0;
-}
-int usbi_mutex_destroy(usbi_mutex_t *mutex) {
- // It is not clear if CloseHandle failure is due to failure to unlock.
- // If so, this should be errno=EBUSY.
- if(!mutex || !CloseHandle(*mutex)) return ((errno=EINVAL));
- *mutex = NULL;
- return 0;
-}
-int usbi_mutex_trylock(usbi_mutex_t *mutex) {
- DWORD result;
- if(!mutex) return ((errno=EINVAL));
- result = WaitForSingleObject(*mutex, 0);
- if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED)
- return 0; // acquired (ToDo: check that abandoned is ok)
- if(result == WAIT_TIMEOUT)
- return ((errno=EBUSY));
- return ((errno=EINVAL)); // don't know how this would happen
- // so don't know proper errno
-}
-int usbi_mutex_lock(usbi_mutex_t *mutex) {
- DWORD result;
- if(!mutex) return ((errno=EINVAL));
- result = WaitForSingleObject(*mutex, INFINITE);
- if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED)
- return 0; // acquired (ToDo: check that abandoned is ok)
- return ((errno=EINVAL)); // don't know how this would happen
- // so don't know proper errno
-}
-int usbi_mutex_unlock(usbi_mutex_t *mutex) {
- if(!mutex) return ((errno=EINVAL));
- if(!ReleaseMutex(*mutex)) return ((errno=EPERM ));
- return 0;
-}
-
-int usbi_mutex_static_lock(usbi_mutex_static_t *mutex) {
- if(!mutex) return ((errno=EINVAL));
- while (InterlockedExchange((LONG *)mutex, 1) == 1) {
- SleepEx(0, TRUE);
- }
- return 0;
-}
-int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) {
- if(!mutex) return ((errno=EINVAL));
- *mutex = 0;
- return 0;
-}
-
-int usbi_cond_init(usbi_cond_t *cond,
- const usbi_condattr_t *attr) {
- UNUSED(attr);
- if(!cond) return ((errno=EINVAL));
- list_init(&cond->waiters );
- list_init(&cond->not_waiting);
- return 0;
-}
-int usbi_cond_destroy(usbi_cond_t *cond) {
- // This assumes no one is using this anymore. The check MAY NOT BE safe.
- struct usbi_cond_perthread *pos, *next_pos = NULL;
- if(!cond) return ((errno=EINVAL));
- if(!list_empty(&cond->waiters)) return ((errno=EBUSY )); // (!see above!)
- list_for_each_entry_safe(pos, next_pos, &cond->not_waiting, list, struct usbi_cond_perthread) {
- CloseHandle(pos->event);
- list_del(&pos->list);
- free(pos);
- }
-
- return 0;
-}
-
-int usbi_cond_broadcast(usbi_cond_t *cond) {
- // Assumes mutex is locked; this is not in keeping with POSIX spec, but
- // libusb does this anyway, so we simplify by not adding more sync
- // primitives to the CV definition!
- int fail = 0;
- struct usbi_cond_perthread *pos;
- if(!cond) return ((errno=EINVAL));
- list_for_each_entry(pos, &cond->waiters, list, struct usbi_cond_perthread) {
- if(!SetEvent(pos->event))
- fail = 1;
- }
- // The wait function will remove its respective item from the list.
- return fail ? ((errno=EINVAL)) : 0;
-}
-int usbi_cond_signal(usbi_cond_t *cond) {
- // Assumes mutex is locked; this is not in keeping with POSIX spec, but
- // libusb does this anyway, so we simplify by not adding more sync
- // primitives to the CV definition!
- struct usbi_cond_perthread *pos;
- if(!cond) return ((errno=EINVAL));
- if(list_empty(&cond->waiters)) return 0; // no one to wakeup.
- pos = list_entry(&cond->waiters.next, struct usbi_cond_perthread, list);
- // The wait function will remove its respective item from the list.
- return SetEvent(pos->event) ? 0 : ((errno=EINVAL));
-}
-__inline static int usbi_cond_intwait(usbi_cond_t *cond,
- usbi_mutex_t *mutex,
- DWORD timeout_ms) {
- struct usbi_cond_perthread *pos;
- int found = 0, r;
- DWORD r2,tid = GetCurrentThreadId();
- if(!cond || !mutex) return ((errno=EINVAL));
- list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) {
- if(tid == pos->tid) {
- found = 1;
- break;
- }
- }
- if(!found) {
- pos = (struct usbi_cond_perthread*) calloc(1, sizeof(struct usbi_cond_perthread));
- if(!pos) return ((errno=ENOMEM)); // This errno is not POSIX-allowed.
- pos->tid = tid;
- pos->event = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset.
- if(!pos->event) {
- free(pos);
- return ((errno=ENOMEM));
- }
- list_add(&pos->list, &cond->not_waiting);
- }
-
- list_del(&pos->list); // remove from not_waiting list.
- list_add(&pos->list, &cond->waiters);
-
- r = usbi_mutex_unlock(mutex);
- if(r) return r;
- r2 = WaitForSingleObject(pos->event, timeout_ms);
- r = usbi_mutex_lock(mutex);
- if(r) return r;
-
- list_del(&pos->list);
- list_add(&pos->list, &cond->not_waiting);
-
- if(r2 == WAIT_TIMEOUT) return ((errno=ETIMEDOUT));
-
- return 0;
-}
-// N.B.: usbi_cond_*wait() can also return ENOMEM, even though pthread_cond_*wait cannot!
-int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex) {
- return usbi_cond_intwait(cond, mutex, INFINITE);
-}
-int usbi_cond_timedwait(usbi_cond_t *cond,
- usbi_mutex_t *mutex,
- const struct timespec *abstime) {
- FILETIME filetime;
- ULARGE_INTEGER rtime;
- struct timeval targ_time, cur_time, delta_time;
- struct timespec cur_time_ns;
- DWORD millis;
-
- // GetSystemTimeAsFileTime() is not available on CE
- SYSTEMTIME st;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, &filetime);
- rtime.LowPart = filetime.dwLowDateTime;
- rtime.HighPart = filetime.dwHighDateTime;
- rtime.QuadPart -= epoch_time;
- cur_time_ns.tv_sec = (long)(rtime.QuadPart / 10000000);
- cur_time_ns.tv_nsec = (long)((rtime.QuadPart % 10000000)*100);
- TIMESPEC_TO_TIMEVAL(&cur_time, &cur_time_ns);
-
- TIMESPEC_TO_TIMEVAL(&targ_time, abstime);
- timersub(&targ_time, &cur_time, &delta_time);
- if(delta_time.tv_sec < 0) // abstime already passed?
- millis = 0;
- else {
- millis = delta_time.tv_usec/1000;
- millis += delta_time.tv_sec *1000;
- if (delta_time.tv_usec % 1000) // round up to next millisecond
- millis++;
- }
-
- return usbi_cond_intwait(cond, mutex, millis);
-}
-
-int usbi_get_tid(void) {
- return GetCurrentThreadId();
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.h
deleted file mode 100644
index df8a0eeb03..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/threads_windows.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * libusbx synchronization on Microsoft Windows
- *
- * Copyright © 2010 Michael Plante <michael.plante@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBUSB_THREADS_WINDOWS_H
-#define LIBUSB_THREADS_WINDOWS_H
-
-#define usbi_mutex_static_t volatile LONG
-#define USBI_MUTEX_INITIALIZER 0
-
-#define usbi_mutex_t HANDLE
-
-struct usbi_cond_perthread {
- struct list_head list;
- DWORD tid;
- HANDLE event;
-};
-struct usbi_cond_t_ {
- // Every time a thread touches the CV, it winds up in one of these lists.
- // It stays there until the CV is destroyed, even if the thread
- // terminates.
- struct list_head waiters;
- struct list_head not_waiting;
-};
-typedef struct usbi_cond_t_ usbi_cond_t;
-
-// We *were* getting timespec from pthread.h:
-#if (!defined(HAVE_STRUCT_TIMESPEC) && !defined(_TIMESPEC_DEFINED))
-#define HAVE_STRUCT_TIMESPEC 1
-#define _TIMESPEC_DEFINED 1
-struct timespec {
- long tv_sec;
- long tv_nsec;
-};
-#endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */
-
-// We *were* getting ETIMEDOUT from pthread.h:
-#ifndef ETIMEDOUT
-# define ETIMEDOUT 10060 /* This is the value in winsock.h. */
-#endif
-
-#define usbi_mutexattr_t void
-#define usbi_condattr_t void
-
-// all Windows mutexes are recursive
-#define usbi_mutex_init_recursive(mutex, attr) usbi_mutex_init((mutex), (attr))
-
-int usbi_mutex_static_lock(usbi_mutex_static_t *mutex);
-int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex);
-
-
-int usbi_mutex_init(usbi_mutex_t *mutex,
- const usbi_mutexattr_t *attr);
-int usbi_mutex_lock(usbi_mutex_t *mutex);
-int usbi_mutex_unlock(usbi_mutex_t *mutex);
-int usbi_mutex_trylock(usbi_mutex_t *mutex);
-int usbi_mutex_destroy(usbi_mutex_t *mutex);
-
-int usbi_cond_init(usbi_cond_t *cond,
- const usbi_condattr_t *attr);
-int usbi_cond_destroy(usbi_cond_t *cond);
-int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex);
-int usbi_cond_timedwait(usbi_cond_t *cond,
- usbi_mutex_t *mutex,
- const struct timespec *abstime);
-int usbi_cond_broadcast(usbi_cond_t *cond);
-int usbi_cond_signal(usbi_cond_t *cond);
-
-int usbi_get_tid(void);
-
-#endif /* LIBUSB_THREADS_WINDOWS_H */
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.c
deleted file mode 100644
index e4a66331e5..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.c
+++ /dev/null
@@ -1,1015 +0,0 @@
-/*
- * Windows CE backend for libusbx 1.0
- * Copyright © 2011-2013 RealVNC Ltd.
- * Large portions taken from Windows backend, which is
- * Copyright © 2009-2010 Pete Batard <pbatard@gmail.com>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer
- * Major code testing contribution by Xiaofan Chen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <libusbi.h>
-
-#include <stdint.h>
-#include <errno.h>
-#include <inttypes.h>
-
-#include "wince_usb.h"
-
-// Forward declares
-static int wince_clock_gettime(int clk_id, struct timespec *tp);
-unsigned __stdcall wince_clock_gettime_threaded(void* param);
-
-// Global variables
-uint64_t hires_frequency, hires_ticks_to_ps;
-int errno;
-const uint64_t epoch_time = UINT64_C(116444736000000000); // 1970.01.01 00:00:000 in MS Filetime
-enum windows_version windows_version = WINDOWS_CE;
-static int concurrent_usage = -1;
-// Timer thread
-// NB: index 0 is for monotonic and 1 is for the thread exit event
-HANDLE timer_thread = NULL;
-HANDLE timer_mutex = NULL;
-struct timespec timer_tp;
-volatile LONG request_count[2] = {0, 1}; // last one must be > 0
-HANDLE timer_request[2] = { NULL, NULL };
-HANDLE timer_response = NULL;
-HANDLE driver_handle = INVALID_HANDLE_VALUE;
-
-/*
- * Converts a windows error to human readable string
- * uses retval as errorcode, or, if 0, use GetLastError()
- */
-#if defined(ENABLE_LOGGING)
-static char* windows_error_str(uint32_t retval)
-{
- static TCHAR wErr_string[ERR_BUFFER_SIZE];
- static char err_string[ERR_BUFFER_SIZE];
-
- DWORD size;
- size_t i;
- uint32_t error_code, format_error;
-
- error_code = retval?retval:GetLastError();
-
- safe_stprintf(wErr_string, ERR_BUFFER_SIZE, _T("[%d] "), error_code);
-
- size = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &wErr_string[safe_tcslen(wErr_string)],
- ERR_BUFFER_SIZE - (DWORD)safe_tcslen(wErr_string), NULL);
- if (size == 0) {
- format_error = GetLastError();
- if (format_error)
- safe_stprintf(wErr_string, ERR_BUFFER_SIZE,
- _T("Windows error code %u (FormatMessage error code %u)"), error_code, format_error);
- else
- safe_stprintf(wErr_string, ERR_BUFFER_SIZE, _T("Unknown error code %u"), error_code);
- } else {
- // Remove CR/LF terminators
- for (i=safe_tcslen(wErr_string)-1; ((wErr_string[i]==0x0A) || (wErr_string[i]==0x0D)); i--) {
- wErr_string[i] = 0;
- }
- }
- if (WideCharToMultiByte(CP_ACP, 0, wErr_string, -1, err_string, ERR_BUFFER_SIZE, NULL, NULL) < 0)
- {
- strcpy(err_string, "Unable to convert error string");
- }
- return err_string;
-}
-#endif
-
-static struct wince_device_priv *_device_priv(struct libusb_device *dev)
-{
- return (struct wince_device_priv *) dev->os_priv;
-}
-
-// ceusbkwrapper to libusb error code mapping
-static int translate_driver_error(int error)
-{
- switch (error) {
- case ERROR_INVALID_PARAMETER:
- return LIBUSB_ERROR_INVALID_PARAM;
- case ERROR_CALL_NOT_IMPLEMENTED:
- case ERROR_NOT_SUPPORTED:
- return LIBUSB_ERROR_NOT_SUPPORTED;
- case ERROR_NOT_ENOUGH_MEMORY:
- return LIBUSB_ERROR_NO_MEM;
- case ERROR_INVALID_HANDLE:
- return LIBUSB_ERROR_NO_DEVICE;
- case ERROR_BUSY:
- return LIBUSB_ERROR_BUSY;
-
- // Error codes that are either unexpected, or have
- // no suitable LIBUSB_ERROR equivilant.
- case ERROR_CANCELLED:
- case ERROR_INTERNAL_ERROR:
- default:
- return LIBUSB_ERROR_OTHER;
- }
-}
-
-static int init_dllimports()
-{
- DLL_LOAD(ceusbkwrapper.dll, UkwOpenDriver, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceList, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwReleaseDeviceList, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceAddress, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceDescriptor, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwGetConfigDescriptor, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwCloseDriver, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwCancelTransfer, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwIssueControlTransfer, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwClaimInterface, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwReleaseInterface, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwSetInterfaceAlternateSetting, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwClearHaltHost, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwClearHaltDevice, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwGetConfig, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwSetConfig, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwResetDevice, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwKernelDriverActive, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwAttachKernelDriver, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwDetachKernelDriver, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwIssueBulkTransfer, TRUE);
- DLL_LOAD(ceusbkwrapper.dll, UkwIsPipeHalted, TRUE);
- return LIBUSB_SUCCESS;
-}
-
-static int init_device(struct libusb_device *dev, UKW_DEVICE drv_dev,
- unsigned char bus_addr, unsigned char dev_addr)
-{
- struct wince_device_priv *priv = _device_priv(dev);
- int r = LIBUSB_SUCCESS;
-
- dev->bus_number = bus_addr;
- dev->device_address = dev_addr;
- priv->dev = drv_dev;
-
- if (!UkwGetDeviceDescriptor(priv->dev, &(priv->desc))) {
- r = translate_driver_error(GetLastError());
- }
- return r;
-}
-
-// Internal API functions
-static int wince_init(struct libusb_context *ctx)
-{
- int i, r = LIBUSB_ERROR_OTHER;
- HANDLE semaphore;
- TCHAR sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID)
-
- _stprintf(sem_name, _T("libusb_init%08X"), (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);
- semaphore = CreateSemaphore(NULL, 1, 1, sem_name);
- if (semaphore == NULL) {
- usbi_err(ctx, "could not create semaphore: %s", windows_error_str(0));
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // A successful wait brings our semaphore count to 0 (unsignaled)
- // => any concurent wait stalls until the semaphore's release
- if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {
- usbi_err(ctx, "failure to access semaphore: %s", windows_error_str(0));
- CloseHandle(semaphore);
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // NB: concurrent usage supposes that init calls are equally balanced with
- // exit calls. If init is called more than exit, we will not exit properly
- if ( ++concurrent_usage == 0 ) { // First init?
- // Initialize pollable file descriptors
- init_polling();
-
- // Load DLL imports
- if (init_dllimports() != LIBUSB_SUCCESS) {
- usbi_err(ctx, "could not resolve DLL functions");
- r = LIBUSB_ERROR_NOT_SUPPORTED;
- goto init_exit;
- }
-
- // try to open a handle to the driver
- driver_handle = UkwOpenDriver();
- if (driver_handle == INVALID_HANDLE_VALUE) {
- usbi_err(ctx, "could not connect to driver");
- r = LIBUSB_ERROR_NOT_SUPPORTED;
- goto init_exit;
- }
-
- // Windows CE doesn't have a way of specifying thread affinity, so this code
- // just has to hope QueryPerformanceCounter doesn't report different values when
- // running on different cores.
- r = LIBUSB_ERROR_NO_MEM;
- for (i = 0; i < 2; i++) {
- timer_request[i] = CreateEvent(NULL, TRUE, FALSE, NULL);
- if (timer_request[i] == NULL) {
- usbi_err(ctx, "could not create timer request event %d - aborting", i);
- goto init_exit;
- }
- }
- timer_response = CreateSemaphore(NULL, 0, MAX_TIMER_SEMAPHORES, NULL);
- if (timer_response == NULL) {
- usbi_err(ctx, "could not create timer response semaphore - aborting");
- goto init_exit;
- }
- timer_mutex = CreateMutex(NULL, FALSE, NULL);
- if (timer_mutex == NULL) {
- usbi_err(ctx, "could not create timer mutex - aborting");
- goto init_exit;
- }
- timer_thread = CreateThread(NULL, 0, wince_clock_gettime_threaded, NULL, 0, NULL);
- if (timer_thread == NULL) {
- usbi_err(ctx, "Unable to create timer thread - aborting");
- goto init_exit;
- }
- }
- // At this stage, either we went through full init successfully, or didn't need to
- r = LIBUSB_SUCCESS;
-
-init_exit: // Holds semaphore here.
- if (!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?
- if (driver_handle != INVALID_HANDLE_VALUE) {
- UkwCloseDriver(driver_handle);
- driver_handle = INVALID_HANDLE_VALUE;
- }
- if (timer_thread) {
- SetEvent(timer_request[1]); // actually the signal to quit the thread.
- if (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {
- usbi_warn(ctx, "could not wait for timer thread to quit");
- TerminateThread(timer_thread, 1); // shouldn't happen, but we're destroying
- // all objects it might have held anyway.
- }
- CloseHandle(timer_thread);
- timer_thread = NULL;
- }
- for (i = 0; i < 2; i++) {
- if (timer_request[i]) {
- CloseHandle(timer_request[i]);
- timer_request[i] = NULL;
- }
- }
- if (timer_response) {
- CloseHandle(timer_response);
- timer_response = NULL;
- }
- if (timer_mutex) {
- CloseHandle(timer_mutex);
- timer_mutex = NULL;
- }
- }
-
- if (r != LIBUSB_SUCCESS)
- --concurrent_usage; // Not expected to call libusb_exit if we failed.
-
- ReleaseSemaphore(semaphore, 1, NULL); // increase count back to 1
- CloseHandle(semaphore);
- return r;
-}
-
-static void wince_exit(void)
-{
- int i;
- HANDLE semaphore;
- TCHAR sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID)
-
- _stprintf(sem_name, _T("libusb_init%08X"), (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);
- semaphore = CreateSemaphore(NULL, 1, 1, sem_name);
- if (semaphore == NULL) {
- return;
- }
-
- // A successful wait brings our semaphore count to 0 (unsignaled)
- // => any concurent wait stalls until the semaphore release
- if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {
- CloseHandle(semaphore);
- return;
- }
-
- // Only works if exits and inits are balanced exactly
- if (--concurrent_usage < 0) { // Last exit
- exit_polling();
-
- if (timer_thread) {
- SetEvent(timer_request[1]); // actually the signal to quit the thread.
- if (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {
- usbi_dbg("could not wait for timer thread to quit");
- TerminateThread(timer_thread, 1);
- }
- CloseHandle(timer_thread);
- timer_thread = NULL;
- }
- for (i = 0; i < 2; i++) {
- if (timer_request[i]) {
- CloseHandle(timer_request[i]);
- timer_request[i] = NULL;
- }
- }
- if (timer_response) {
- CloseHandle(timer_response);
- timer_response = NULL;
- }
- if (timer_mutex) {
- CloseHandle(timer_mutex);
- timer_mutex = NULL;
- }
- if (driver_handle != INVALID_HANDLE_VALUE) {
- UkwCloseDriver(driver_handle);
- driver_handle = INVALID_HANDLE_VALUE;
- }
- }
-
- ReleaseSemaphore(semaphore, 1, NULL); // increase count back to 1
- CloseHandle(semaphore);
-}
-
-static int wince_get_device_list(
- struct libusb_context *ctx,
- struct discovered_devs **discdevs)
-{
- UKW_DEVICE devices[MAX_DEVICE_COUNT];
- struct discovered_devs * new_devices = *discdevs;
- DWORD count = 0, i;
- struct libusb_device *dev = NULL;
- unsigned char bus_addr, dev_addr;
- unsigned long session_id;
- BOOL success;
- DWORD release_list_offset = 0;
- int r = LIBUSB_SUCCESS;
-
- success = UkwGetDeviceList(driver_handle, devices, MAX_DEVICE_COUNT, &count);
- if (!success) {
- int libusbErr = translate_driver_error(GetLastError());
- usbi_err(ctx, "could not get devices: %s", windows_error_str(0));
- return libusbErr;
- }
- for(i = 0; i < count; ++i) {
- release_list_offset = i;
- success = UkwGetDeviceAddress(devices[i], &bus_addr, &dev_addr, &session_id);
- if (!success) {
- r = translate_driver_error(GetLastError());
- usbi_err(ctx, "could not get device address for %d: %s", i, windows_error_str(0));
- goto err_out;
- }
- dev = usbi_get_device_by_session_id(ctx, session_id);
- if (dev) {
- usbi_dbg("using existing device for %d/%d (session %ld)",
- bus_addr, dev_addr, session_id);
- libusb_ref_device(dev);
- // Release just this element in the device list (as we already hold a
- // reference to it).
- UkwReleaseDeviceList(driver_handle, &devices[i], 1);
- release_list_offset++;
- } else {
- usbi_dbg("allocating new device for %d/%d (session %ld)",
- bus_addr, dev_addr, session_id);
- dev = usbi_alloc_device(ctx, session_id);
- if (!dev) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err_out;
- }
- r = init_device(dev, devices[i], bus_addr, dev_addr);
- if (r < 0)
- goto err_out;
- r = usbi_sanitize_device(dev);
- if (r < 0)
- goto err_out;
- }
- new_devices = discovered_devs_append(new_devices, dev);
- if (!discdevs) {
- r = LIBUSB_ERROR_NO_MEM;
- goto err_out;
- }
- safe_unref_device(dev);
- }
- *discdevs = new_devices;
- return r;
-err_out:
- *discdevs = new_devices;
- safe_unref_device(dev);
- // Release the remainder of the unprocessed device list.
- // The devices added to new_devices already will still be passed up to libusb,
- // which can dispose of them at its leisure.
- UkwReleaseDeviceList(driver_handle, &devices[release_list_offset], count - release_list_offset);
- return r;
-}
-
-static int wince_open(struct libusb_device_handle *handle)
-{
- // Nothing to do to open devices as a handle to it has
- // been retrieved by wince_get_device_list
- return LIBUSB_SUCCESS;
-}
-
-static void wince_close(struct libusb_device_handle *handle)
-{
- // Nothing to do as wince_open does nothing.
-}
-
-static int wince_get_device_descriptor(
- struct libusb_device *device,
- unsigned char *buffer, int *host_endian)
-{
- struct wince_device_priv *priv = _device_priv(device);
-
- *host_endian = 1;
- memcpy(buffer, &priv->desc, DEVICE_DESC_LENGTH);
- return LIBUSB_SUCCESS;
-}
-
-static int wince_get_active_config_descriptor(
- struct libusb_device *device,
- unsigned char *buffer, size_t len, int *host_endian)
-{
- struct wince_device_priv *priv = _device_priv(device);
- DWORD actualSize = len;
- *host_endian = 0;
- if (!UkwGetConfigDescriptor(priv->dev, UKW_ACTIVE_CONFIGURATION, buffer, len, &actualSize)) {
- return translate_driver_error(GetLastError());
- }
- return actualSize;
-}
-
-static int wince_get_config_descriptor(
- struct libusb_device *device,
- uint8_t config_index,
- unsigned char *buffer, size_t len, int *host_endian)
-{
- struct wince_device_priv *priv = _device_priv(device);
- DWORD actualSize = len;
- *host_endian = 0;
- if (!UkwGetConfigDescriptor(priv->dev, config_index, buffer, len, &actualSize)) {
- return translate_driver_error(GetLastError());
- }
- return actualSize;
-}
-
-static int wince_get_configuration(
- struct libusb_device_handle *handle,
- int *config)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- UCHAR cv = 0;
- if (!UkwGetConfig(priv->dev, &cv)) {
- return translate_driver_error(GetLastError());
- }
- (*config) = cv;
- return LIBUSB_SUCCESS;
-}
-
-static int wince_set_configuration(
- struct libusb_device_handle *handle,
- int config)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- // Setting configuration 0 places the device in Address state.
- // This should correspond to the "unconfigured state" required by
- // libusb when the specified configuration is -1.
- UCHAR cv = (config < 0) ? 0 : config;
- if (!UkwSetConfig(priv->dev, cv)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_claim_interface(
- struct libusb_device_handle *handle,
- int interface_number)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwClaimInterface(priv->dev, interface_number)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_release_interface(
- struct libusb_device_handle *handle,
- int interface_number)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwSetInterfaceAlternateSetting(priv->dev, interface_number, 0)) {
- return translate_driver_error(GetLastError());
- }
- if (!UkwReleaseInterface(priv->dev, interface_number)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_set_interface_altsetting(
- struct libusb_device_handle *handle,
- int interface_number, int altsetting)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwSetInterfaceAlternateSetting(priv->dev, interface_number, altsetting)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_clear_halt(
- struct libusb_device_handle *handle,
- unsigned char endpoint)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwClearHaltHost(priv->dev, endpoint)) {
- return translate_driver_error(GetLastError());
- }
- if (!UkwClearHaltDevice(priv->dev, endpoint)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_reset_device(
- struct libusb_device_handle *handle)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwResetDevice(priv->dev)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_kernel_driver_active(
- struct libusb_device_handle *handle,
- int interface_number)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- BOOL result = FALSE;
- if (!UkwKernelDriverActive(priv->dev, interface_number, &result)) {
- return translate_driver_error(GetLastError());
- }
- return result ? 1 : 0;
-}
-
-static int wince_detach_kernel_driver(
- struct libusb_device_handle *handle,
- int interface_number)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwDetachKernelDriver(priv->dev, interface_number)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_attach_kernel_driver(
- struct libusb_device_handle *handle,
- int interface_number)
-{
- struct wince_device_priv *priv = _device_priv(handle->dev);
- if (!UkwAttachKernelDriver(priv->dev, interface_number)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static void wince_destroy_device(
- struct libusb_device *dev)
-{
- struct wince_device_priv *priv = _device_priv(dev);
- UkwReleaseDeviceList(driver_handle, &priv->dev, 1);
-}
-
-static void wince_clear_transfer_priv(
- struct usbi_transfer *itransfer)
-{
- struct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct winfd wfd = fd_to_winfd(transfer_priv->pollable_fd.fd);
- // No need to cancel transfer as it is either complete or abandoned
- wfd.itransfer = NULL;
- CloseHandle(wfd.handle);
- usbi_free_fd(&transfer_priv->pollable_fd);
-}
-
-static int wince_cancel_transfer(
- struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- struct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
-
- if (!UkwCancelTransfer(priv->dev, transfer_priv->pollable_fd.overlapped, UKW_TF_NO_WAIT)) {
- return translate_driver_error(GetLastError());
- }
- return LIBUSB_SUCCESS;
-}
-
-static int wince_submit_control_or_bulk_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- BOOL direction_in, ret;
- struct winfd wfd;
- DWORD flags;
- HANDLE eventHandle;
- PUKW_CONTROL_HEADER setup = NULL;
- const BOOL control_transfer = transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL;
-
- transfer_priv->pollable_fd = INVALID_WINFD;
- if (control_transfer) {
- setup = (PUKW_CONTROL_HEADER) transfer->buffer;
- direction_in = setup->bmRequestType & LIBUSB_ENDPOINT_IN;
- } else {
- direction_in = transfer->endpoint & LIBUSB_ENDPOINT_IN;
- }
- flags = direction_in ? UKW_TF_IN_TRANSFER : UKW_TF_OUT_TRANSFER;
- flags |= UKW_TF_SHORT_TRANSFER_OK;
-
- eventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (eventHandle == NULL) {
- usbi_err(ctx, "Failed to create event for async transfer");
- return LIBUSB_ERROR_NO_MEM;
- }
-
- wfd = usbi_create_fd(eventHandle, direction_in ? RW_READ : RW_WRITE, itransfer, &wince_cancel_transfer);
- if (wfd.fd < 0) {
- CloseHandle(eventHandle);
- return LIBUSB_ERROR_NO_MEM;
- }
-
- transfer_priv->pollable_fd = wfd;
- if (control_transfer) {
- // Split out control setup header and data buffer
- DWORD bufLen = transfer->length - sizeof(UKW_CONTROL_HEADER);
- PVOID buf = (PVOID) &transfer->buffer[sizeof(UKW_CONTROL_HEADER)];
-
- ret = UkwIssueControlTransfer(priv->dev, flags, setup, buf, bufLen, &transfer->actual_length, wfd.overlapped);
- } else {
- ret = UkwIssueBulkTransfer(priv->dev, flags, transfer->endpoint, transfer->buffer,
- transfer->length, &transfer->actual_length, wfd.overlapped);
- }
- if (!ret) {
- int libusbErr = translate_driver_error(GetLastError());
- usbi_err(ctx, "UkwIssue%sTransfer failed: error %d",
- control_transfer ? "Control" : "Bulk", GetLastError());
- wince_clear_transfer_priv(itransfer);
- return libusbErr;
- }
- usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, direction_in ? POLLIN : POLLOUT);
- itransfer->flags |= USBI_TRANSFER_UPDATED_FDS;
-
- return LIBUSB_SUCCESS;
-}
-
-static int wince_submit_iso_transfer(struct usbi_transfer *itransfer)
-{
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static int wince_submit_transfer(
- struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- return wince_submit_control_or_bulk_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return wince_submit_iso_transfer(itransfer);
- default:
- usbi_err(TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static void wince_transfer_callback(struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int status;
-
- usbi_dbg("handling I/O completion with errcode %d", io_result);
-
- if (io_result == ERROR_NOT_SUPPORTED &&
- transfer->type != LIBUSB_TRANSFER_TYPE_CONTROL) {
- /* For functional stalls, the WinCE USB layer (and therefore the USB Kernel Wrapper
- * Driver) will report USB_ERROR_STALL/ERROR_NOT_SUPPORTED in situations where the
- * endpoint isn't actually stalled.
- *
- * One example of this is that some devices will occasionally fail to reply to an IN
- * token. The WinCE USB layer carries on with the transaction until it is completed
- * (or cancelled) but then completes it with USB_ERROR_STALL.
- *
- * This code therefore needs to confirm that there really is a stall error, by both
- * checking the pipe status and requesting the endpoint status from the device.
- */
- BOOL halted = FALSE;
- usbi_dbg("checking I/O completion with errcode ERROR_NOT_SUPPORTED is really a stall");
- if (UkwIsPipeHalted(priv->dev, transfer->endpoint, &halted)) {
- /* Pipe status retrieved, so now request endpoint status by sending a GET_STATUS
- * control request to the device. This is done synchronously, which is a bit
- * naughty, but this is a special corner case.
- */
- WORD wStatus = 0;
- DWORD written = 0;
- UKW_CONTROL_HEADER ctrlHeader;
- ctrlHeader.bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD |
- LIBUSB_ENDPOINT_IN | LIBUSB_RECIPIENT_ENDPOINT;
- ctrlHeader.bRequest = LIBUSB_REQUEST_GET_STATUS;
- ctrlHeader.wValue = 0;
- ctrlHeader.wIndex = transfer->endpoint;
- ctrlHeader.wLength = sizeof(wStatus);
- if (UkwIssueControlTransfer(priv->dev,
- UKW_TF_IN_TRANSFER | UKW_TF_SEND_TO_ENDPOINT,
- &ctrlHeader, &wStatus, sizeof(wStatus), &written, NULL)) {
- if (written == sizeof(wStatus) &&
- (wStatus & STATUS_HALT_FLAG) == 0) {
- if (!halted || UkwClearHaltHost(priv->dev, transfer->endpoint)) {
- usbi_dbg("Endpoint doesn't appear to be stalled, overriding error with success");
- io_result = ERROR_SUCCESS;
- } else {
- usbi_dbg("Endpoint doesn't appear to be stalled, but the host is halted, changing error");
- io_result = ERROR_IO_DEVICE;
- }
- }
- }
- }
- }
-
- switch(io_result) {
- case ERROR_SUCCESS:
- itransfer->transferred += io_size;
- status = LIBUSB_TRANSFER_COMPLETED;
- break;
- case ERROR_CANCELLED:
- usbi_dbg("detected transfer cancel");
- status = LIBUSB_TRANSFER_CANCELLED;
- break;
- case ERROR_NOT_SUPPORTED:
- case ERROR_GEN_FAILURE:
- usbi_dbg("detected endpoint stall");
- status = LIBUSB_TRANSFER_STALL;
- break;
- case ERROR_SEM_TIMEOUT:
- usbi_dbg("detected semaphore timeout");
- status = LIBUSB_TRANSFER_TIMED_OUT;
- break;
- case ERROR_OPERATION_ABORTED:
- if (itransfer->flags & USBI_TRANSFER_TIMED_OUT) {
- usbi_dbg("detected timeout");
- status = LIBUSB_TRANSFER_TIMED_OUT;
- } else {
- usbi_dbg("detected operation aborted");
- status = LIBUSB_TRANSFER_CANCELLED;
- }
- break;
- default:
- usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error: %s", windows_error_str(io_result));
- status = LIBUSB_TRANSFER_ERROR;
- break;
- }
- wince_clear_transfer_priv(itransfer);
- if (status == LIBUSB_TRANSFER_CANCELLED) {
- usbi_handle_transfer_cancellation(itransfer);
- } else {
- usbi_handle_transfer_completion(itransfer, (enum libusb_transfer_status)status);
- }
-}
-
-static void wince_handle_callback (struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- wince_transfer_callback (itransfer, io_result, io_size);
- break;
- default:
- usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type);
- }
-}
-
-static int wince_handle_events(
- struct libusb_context *ctx,
- struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)
-{
- struct wince_transfer_priv* transfer_priv = NULL;
- POLL_NFDS_TYPE i = 0;
- BOOL found = FALSE;
- struct usbi_transfer *transfer;
- DWORD io_size, io_result;
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- for (i = 0; i < nfds && num_ready > 0; i++) {
-
- usbi_dbg("checking fd %d with revents = %04x", fds[i].fd, fds[i].revents);
-
- if (!fds[i].revents) {
- continue;
- }
-
- num_ready--;
-
- // Because a Windows OVERLAPPED is used for poll emulation,
- // a pollable fd is created and stored with each transfer
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {
- transfer_priv = usbi_transfer_get_os_priv(transfer);
- if (transfer_priv->pollable_fd.fd == fds[i].fd) {
- found = TRUE;
- break;
- }
- }
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
-
- if (found && HasOverlappedIoCompleted(transfer_priv->pollable_fd.overlapped)) {
- io_result = (DWORD)transfer_priv->pollable_fd.overlapped->Internal;
- io_size = (DWORD)transfer_priv->pollable_fd.overlapped->InternalHigh;
- usbi_remove_pollfd(ctx, transfer_priv->pollable_fd.fd);
- // let handle_callback free the event using the transfer wfd
- // If you don't use the transfer wfd, you run a risk of trying to free a
- // newly allocated wfd that took the place of the one from the transfer.
- wince_handle_callback(transfer, io_result, io_size);
- } else if (found) {
- usbi_err(ctx, "matching transfer for fd %x has not completed", fds[i]);
- return LIBUSB_ERROR_OTHER;
- } else {
- usbi_err(ctx, "could not find a matching transfer for fd %x", fds[i]);
- return LIBUSB_ERROR_NOT_FOUND;
- }
- }
-
- usbi_mutex_unlock(&ctx->open_devs_lock);
- return LIBUSB_SUCCESS;
-}
-
-/*
- * Monotonic and real time functions
- */
-unsigned __stdcall wince_clock_gettime_threaded(void* param)
-{
- LARGE_INTEGER hires_counter, li_frequency;
- LONG nb_responses;
- int timer_index;
-
- // Init - find out if we have access to a monotonic (hires) timer
- if (!QueryPerformanceFrequency(&li_frequency)) {
- usbi_dbg("no hires timer available on this platform");
- hires_frequency = 0;
- hires_ticks_to_ps = UINT64_C(0);
- } else {
- hires_frequency = li_frequency.QuadPart;
- // The hires frequency can go as high as 4 GHz, so we'll use a conversion
- // to picoseconds to compute the tv_nsecs part in clock_gettime
- hires_ticks_to_ps = UINT64_C(1000000000000) / hires_frequency;
- usbi_dbg("hires timer available (Frequency: %"PRIu64" Hz)", hires_frequency);
- }
-
- // Main loop - wait for requests
- while (1) {
- timer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0;
- if ( (timer_index != 0) && (timer_index != 1) ) {
- usbi_dbg("failure to wait on requests: %s", windows_error_str(0));
- continue;
- }
- if (request_count[timer_index] == 0) {
- // Request already handled
- ResetEvent(timer_request[timer_index]);
- // There's still a possiblity that a thread sends a request between the
- // time we test request_count[] == 0 and we reset the event, in which case
- // the request would be ignored. The simple solution to that is to test
- // request_count again and process requests if non zero.
- if (request_count[timer_index] == 0)
- continue;
- }
- switch (timer_index) {
- case 0:
- WaitForSingleObject(timer_mutex, INFINITE);
- // Requests to this thread are for hires always
- if (QueryPerformanceCounter(&hires_counter) != 0) {
- timer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency);
- timer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps);
- } else {
- // Fallback to real-time if we can't get monotonic value
- // Note that real-time clock does not wait on the mutex or this thread.
- wince_clock_gettime(USBI_CLOCK_REALTIME, &timer_tp);
- }
- ReleaseMutex(timer_mutex);
-
- nb_responses = InterlockedExchange((LONG*)&request_count[0], 0);
- if ( (nb_responses)
- && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) {
- usbi_dbg("unable to release timer semaphore %d: %s", windows_error_str(0));
- }
- continue;
- case 1: // time to quit
- usbi_dbg("timer thread quitting");
- return 0;
- }
- }
- usbi_dbg("ERROR: broken timer thread");
- return 1;
-}
-
-static int wince_clock_gettime(int clk_id, struct timespec *tp)
-{
- FILETIME filetime;
- ULARGE_INTEGER rtime;
- DWORD r;
- SYSTEMTIME st;
- switch(clk_id) {
- case USBI_CLOCK_MONOTONIC:
- if (hires_frequency != 0) {
- while (1) {
- InterlockedIncrement((LONG*)&request_count[0]);
- SetEvent(timer_request[0]);
- r = WaitForSingleObject(timer_response, TIMER_REQUEST_RETRY_MS);
- switch(r) {
- case WAIT_OBJECT_0:
- WaitForSingleObject(timer_mutex, INFINITE);
- *tp = timer_tp;
- ReleaseMutex(timer_mutex);
- return LIBUSB_SUCCESS;
- case WAIT_TIMEOUT:
- usbi_dbg("could not obtain a timer value within reasonable timeframe - too much load?");
- break; // Retry until successful
- default:
- usbi_dbg("WaitForSingleObject failed: %s", windows_error_str(0));
- return LIBUSB_ERROR_OTHER;
- }
- }
- }
- // Fall through and return real-time if monotonic was not detected @ timer init
- case USBI_CLOCK_REALTIME:
- // We follow http://msdn.microsoft.com/en-us/library/ms724928%28VS.85%29.aspx
- // with a predef epoch_time to have an epoch that starts at 1970.01.01 00:00
- // Note however that our resolution is bounded by the Windows system time
- // functions and is at best of the order of 1 ms (or, usually, worse)
- GetSystemTime(&st);
- SystemTimeToFileTime(&st, &filetime);
- rtime.LowPart = filetime.dwLowDateTime;
- rtime.HighPart = filetime.dwHighDateTime;
- rtime.QuadPart -= epoch_time;
- tp->tv_sec = (long)(rtime.QuadPart / 10000000);
- tp->tv_nsec = (long)((rtime.QuadPart % 10000000)*100);
- return LIBUSB_SUCCESS;
- default:
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-const struct usbi_os_backend wince_backend = {
- "Windows CE",
- 0,
- wince_init,
- wince_exit,
-
- wince_get_device_list,
- NULL, /* hotplug_poll */
- wince_open,
- wince_close,
-
- wince_get_device_descriptor,
- wince_get_active_config_descriptor,
- wince_get_config_descriptor,
- NULL, /* get_config_descriptor_by_value() */
-
- wince_get_configuration,
- wince_set_configuration,
- wince_claim_interface,
- wince_release_interface,
-
- wince_set_interface_altsetting,
- wince_clear_halt,
- wince_reset_device,
-
- wince_kernel_driver_active,
- wince_detach_kernel_driver,
- wince_attach_kernel_driver,
-
- wince_destroy_device,
-
- wince_submit_transfer,
- wince_cancel_transfer,
- wince_clear_transfer_priv,
-
- wince_handle_events,
-
- wince_clock_gettime,
- sizeof(struct wince_device_priv),
- sizeof(struct wince_device_handle_priv),
- sizeof(struct wince_transfer_priv),
- 0,
-};
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.h
deleted file mode 100644
index 3db9693a13..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/wince_usb.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Windows CE backend for libusbx 1.0
- * Copyright © 2011-2013 RealVNC Ltd.
- * Portions taken from Windows backend, which is
- * Copyright © 2009-2010 Pete Batard <pbatard@gmail.com>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer
- * Major code testing contribution by Xiaofan Chen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#pragma once
-
-#include "windows_common.h"
-
-#include <windows.h>
-#include "poll_windows.h"
-
-#define MAX_DEVICE_COUNT 256
-
-// This is a modified dump of the types in the ceusbkwrapper.h library header
-// with functions transformed into extern pointers.
-//
-// This backend dynamically loads ceusbkwrapper.dll and doesn't include
-// ceusbkwrapper.h directly to simplify the build process. The kernel
-// side wrapper driver is built using the platform image build tools,
-// which makes it difficult to reference directly from the libusbx build
-// system.
-struct UKW_DEVICE_PRIV;
-typedef struct UKW_DEVICE_PRIV *UKW_DEVICE;
-typedef UKW_DEVICE *PUKW_DEVICE, *LPUKW_DEVICE;
-
-typedef struct {
- UINT8 bLength;
- UINT8 bDescriptorType;
- UINT16 bcdUSB;
- UINT8 bDeviceClass;
- UINT8 bDeviceSubClass;
- UINT8 bDeviceProtocol;
- UINT8 bMaxPacketSize0;
- UINT16 idVendor;
- UINT16 idProduct;
- UINT16 bcdDevice;
- UINT8 iManufacturer;
- UINT8 iProduct;
- UINT8 iSerialNumber;
- UINT8 bNumConfigurations;
-} UKW_DEVICE_DESCRIPTOR, *PUKW_DEVICE_DESCRIPTOR, *LPUKW_DEVICE_DESCRIPTOR;
-
-typedef struct {
- UINT8 bmRequestType;
- UINT8 bRequest;
- UINT16 wValue;
- UINT16 wIndex;
- UINT16 wLength;
-} UKW_CONTROL_HEADER, *PUKW_CONTROL_HEADER, *LPUKW_CONTROL_HEADER;
-
-// Collection of flags which can be used when issuing transfer requests
-/* Indicates that the transfer direction is 'in' */
-#define UKW_TF_IN_TRANSFER 0x00000001
-/* Indicates that the transfer direction is 'out' */
-#define UKW_TF_OUT_TRANSFER 0x00000000
-/* Specifies that the transfer should complete as soon as possible,
- * even if no OVERLAPPED structure has been provided. */
-#define UKW_TF_NO_WAIT 0x00000100
-/* Indicates that transfers shorter than the buffer are ok */
-#define UKW_TF_SHORT_TRANSFER_OK 0x00000200
-#define UKW_TF_SEND_TO_DEVICE 0x00010000
-#define UKW_TF_SEND_TO_INTERFACE 0x00020000
-#define UKW_TF_SEND_TO_ENDPOINT 0x00040000
-/* Don't block when waiting for memory allocations */
-#define UKW_TF_DONT_BLOCK_FOR_MEM 0x00080000
-
-/* Value to use when dealing with configuration values, such as UkwGetConfigDescriptor,
- * to specify the currently active configuration for the device. */
-#define UKW_ACTIVE_CONFIGURATION -1
-
-DLL_DECLARE(WINAPI, HANDLE, UkwOpenDriver, ());
-DLL_DECLARE(WINAPI, BOOL, UkwGetDeviceList, (HANDLE, LPUKW_DEVICE, DWORD, LPDWORD));
-DLL_DECLARE(WINAPI, void, UkwReleaseDeviceList, (HANDLE, LPUKW_DEVICE, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwGetDeviceAddress, (UKW_DEVICE, unsigned char*, unsigned char*, unsigned long*));
-DLL_DECLARE(WINAPI, BOOL, UkwGetDeviceDescriptor, (UKW_DEVICE, LPUKW_DEVICE_DESCRIPTOR));
-DLL_DECLARE(WINAPI, BOOL, UkwGetConfigDescriptor, (UKW_DEVICE, DWORD, LPVOID, DWORD, LPDWORD));
-DLL_DECLARE(WINAPI, void, UkwCloseDriver, (HANDLE));
-DLL_DECLARE(WINAPI, BOOL, UkwCancelTransfer, (UKW_DEVICE, LPOVERLAPPED, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwIssueControlTransfer, (UKW_DEVICE, DWORD, LPUKW_CONTROL_HEADER, LPVOID, DWORD, LPDWORD, LPOVERLAPPED));
-DLL_DECLARE(WINAPI, BOOL, UkwClaimInterface, (UKW_DEVICE, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwReleaseInterface, (UKW_DEVICE, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwSetInterfaceAlternateSetting, (UKW_DEVICE, DWORD, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwClearHaltHost, (UKW_DEVICE, UCHAR));
-DLL_DECLARE(WINAPI, BOOL, UkwClearHaltDevice, (UKW_DEVICE, UCHAR));
-DLL_DECLARE(WINAPI, BOOL, UkwGetConfig, (UKW_DEVICE, PUCHAR));
-DLL_DECLARE(WINAPI, BOOL, UkwSetConfig, (UKW_DEVICE, UCHAR));
-DLL_DECLARE(WINAPI, BOOL, UkwResetDevice, (UKW_DEVICE));
-DLL_DECLARE(WINAPI, BOOL, UkwKernelDriverActive, (UKW_DEVICE, DWORD, PBOOL));
-DLL_DECLARE(WINAPI, BOOL, UkwAttachKernelDriver, (UKW_DEVICE, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwDetachKernelDriver, (UKW_DEVICE, DWORD));
-DLL_DECLARE(WINAPI, BOOL, UkwIssueBulkTransfer, (UKW_DEVICE, DWORD, UCHAR, LPVOID, DWORD, LPDWORD, LPOVERLAPPED));
-DLL_DECLARE(WINAPI, BOOL, UkwIsPipeHalted, (UKW_DEVICE, UCHAR, LPBOOL));
-
-// Used to determine if an endpoint status really is halted on a failed transfer.
-#define STATUS_HALT_FLAG 0x1
-
-struct wince_device_priv {
- UKW_DEVICE dev;
- UKW_DEVICE_DESCRIPTOR desc;
-};
-
-struct wince_device_handle_priv {
- // This member isn't used, but only exists to avoid an empty structure
- // for private data for the device handle.
- int reserved;
-};
-
-struct wince_transfer_priv {
- struct winfd pollable_fd;
- uint8_t interface_number;
-};
-
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_common.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_common.h
deleted file mode 100644
index 1da72bd9f8..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_common.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Windows backend common header for libusbx 1.0
- *
- * This file brings together header code common between
- * the desktop Windows and Windows CE backends.
- * Copyright © 2012-2013 RealVNC Ltd.
- * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer
- * Major code testing contribution by Xiaofan Chen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#pragma once
-
-// Windows API default is uppercase - ugh!
-#if !defined(bool)
-#define bool BOOL
-#endif
-#if !defined(true)
-#define true TRUE
-#endif
-#if !defined(false)
-#define false FALSE
-#endif
-
-#define safe_free(p) do {if (p != NULL) {free((void*)p); p = NULL;}} while(0)
-#define safe_closehandle(h) do {if (h != INVALID_HANDLE_VALUE) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0)
-#define safe_min(a, b) min((size_t)(a), (size_t)(b))
-#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \
- ((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0)
-#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1)
-#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1))
-#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1)
-#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
-#define safe_stricmp(str1, str2) _stricmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2))
-#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"<NULL>":str1), ((str2==NULL)?"<NULL>":str2), count)
-#define safe_strlen(str) ((str==NULL)?0:strlen(str))
-#define safe_sprintf(dst, count, ...) do {_snprintf(dst, count, __VA_ARGS__); (dst)[(count)-1] = 0; } while(0)
-#define safe_stprintf _sntprintf
-#define safe_tcslen(str) ((str==NULL)?0:_tcslen(str))
-#define safe_unref_device(dev) do {if (dev != NULL) {libusb_unref_device(dev); dev = NULL;}} while(0)
-#define wchar_to_utf8_ms(wstr, str, strlen) WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, strlen, NULL, NULL)
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
-#endif
-
-#define ERR_BUFFER_SIZE 256
-#define TIMER_REQUEST_RETRY_MS 100
-#define MAX_TIMER_SEMAPHORES 128
-
-
-/*
- * API macros - from libusb-win32 1.x
- */
-#define DLL_DECLARE_PREFIXNAME(api, ret, prefixname, name, args) \
- typedef ret (api * __dll_##name##_t)args; \
- static __dll_##name##_t prefixname = NULL
-
-#ifndef _WIN32_WCE
-#define DLL_STRINGIFY(dll) #dll
-#define DLL_GET_MODULE_HANDLE(dll) GetModuleHandleA(DLL_STRINGIFY(dll))
-#define DLL_LOAD_LIBRARY(dll) LoadLibraryA(DLL_STRINGIFY(dll))
-#else
-#define DLL_STRINGIFY(dll) L#dll
-#define DLL_GET_MODULE_HANDLE(dll) GetModuleHandle(DLL_STRINGIFY(dll))
-#define DLL_LOAD_LIBRARY(dll) LoadLibrary(DLL_STRINGIFY(dll))
-#endif
-
-#define DLL_LOAD_PREFIXNAME(dll, prefixname, name, ret_on_failure) \
- do { \
- HMODULE h = DLL_GET_MODULE_HANDLE(dll); \
- if (!h) \
- h = DLL_LOAD_LIBRARY(dll); \
- if (!h) { \
- if (ret_on_failure) { return LIBUSB_ERROR_NOT_FOUND; } \
- else { break; } \
- } \
- prefixname = (__dll_##name##_t)GetProcAddress(h, \
- DLL_STRINGIFY(name)); \
- if (prefixname) break; \
- prefixname = (__dll_##name##_t)GetProcAddress(h, \
- DLL_STRINGIFY(name) DLL_STRINGIFY(A)); \
- if (prefixname) break; \
- prefixname = (__dll_##name##_t)GetProcAddress(h, \
- DLL_STRINGIFY(name) DLL_STRINGIFY(W)); \
- if (prefixname) break; \
- if(ret_on_failure) \
- return LIBUSB_ERROR_NOT_FOUND; \
- } while(0)
-
-#define DLL_DECLARE(api, ret, name, args) DLL_DECLARE_PREFIXNAME(api, ret, name, name, args)
-#define DLL_LOAD(dll, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, name, name, ret_on_failure)
-#define DLL_DECLARE_PREFIXED(api, ret, prefix, name, args) DLL_DECLARE_PREFIXNAME(api, ret, prefix##name, name, args)
-#define DLL_LOAD_PREFIXED(dll, prefix, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, prefix##name, name, ret_on_failure)
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.c b/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.c
deleted file mode 100644
index 63357b1a21..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.c
+++ /dev/null
@@ -1,4393 +0,0 @@
-/*
- * windows backend for libusbx 1.0
- * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer
- * HID Reports IOCTLs inspired from HIDAPI by Alan Ott, Signal 11 Software
- * Hash table functions adapted from glibc, by Ulrich Drepper et al.
- * Major code testing contribution by Xiaofan Chen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <config.h>
-#include <windows.h>
-#include <setupapi.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <process.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <objbase.h>
-#include <winioctl.h>
-
-#include "libusbi.h"
-#include "poll_windows.h"
-#include "windows_usb.h"
-
-// The 2 macros below are used in conjunction with safe loops.
-#define LOOP_CHECK(fcall) { r=fcall; if (r != LIBUSB_SUCCESS) continue; }
-#define LOOP_BREAK(err) { r=err; continue; }
-
-// Helper prototypes
-static int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian);
-static int windows_clock_gettime(int clk_id, struct timespec *tp);
-unsigned __stdcall windows_clock_gettime_threaded(void* param);
-// Common calls
-static int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-
-// WinUSB-like API prototypes
-static int winusbx_init(int sub_api, struct libusb_context *ctx);
-static int winusbx_exit(int sub_api);
-static int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle);
-static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle);
-static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int winusbx_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
-static int winusbx_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
-static int winusbx_abort_transfers(int sub_api, struct usbi_transfer *itransfer);
-static int winusbx_abort_control(int sub_api, struct usbi_transfer *itransfer);
-static int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
-static int winusbx_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);
-// HID API prototypes
-static int hid_init(int sub_api, struct libusb_context *ctx);
-static int hid_exit(int sub_api);
-static int hid_open(int sub_api, struct libusb_device_handle *dev_handle);
-static void hid_close(int sub_api, struct libusb_device_handle *dev_handle);
-static int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
-static int hid_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int hid_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
-static int hid_abort_transfers(int sub_api, struct usbi_transfer *itransfer);
-static int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
-static int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);
-// Composite API prototypes
-static int composite_init(int sub_api, struct libusb_context *ctx);
-static int composite_exit(int sub_api);
-static int composite_open(int sub_api, struct libusb_device_handle *dev_handle);
-static void composite_close(int sub_api, struct libusb_device_handle *dev_handle);
-static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
-static int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
-static int composite_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int composite_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int composite_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer);
-static int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
-static int composite_abort_transfers(int sub_api, struct usbi_transfer *itransfer);
-static int composite_abort_control(int sub_api, struct usbi_transfer *itransfer);
-static int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
-static int composite_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);
-
-
-// Global variables
-uint64_t hires_frequency, hires_ticks_to_ps;
-const uint64_t epoch_time = UINT64_C(116444736000000000); // 1970.01.01 00:00:000 in MS Filetime
-enum windows_version windows_version = WINDOWS_UNSUPPORTED;
-// Concurrency
-static int concurrent_usage = -1;
-usbi_mutex_t autoclaim_lock;
-// Timer thread
-// NB: index 0 is for monotonic and 1 is for the thread exit event
-HANDLE timer_thread = NULL;
-HANDLE timer_mutex = NULL;
-struct timespec timer_tp;
-volatile LONG request_count[2] = {0, 1}; // last one must be > 0
-HANDLE timer_request[2] = { NULL, NULL };
-HANDLE timer_response = NULL;
-// API globals
-#define CHECK_WINUSBX_AVAILABLE(sub_api) do { if (sub_api == SUB_API_NOTSET) sub_api = priv->sub_api; \
- if (!WinUSBX[sub_api].initialized) return LIBUSB_ERROR_ACCESS; } while(0)
-static struct winusb_interface WinUSBX[SUB_API_MAX];
-const char* sub_api_name[SUB_API_MAX] = WINUSBX_DRV_NAMES;
-bool api_hid_available = false;
-#define CHECK_HID_AVAILABLE do { if (!api_hid_available) return LIBUSB_ERROR_ACCESS; } while (0)
-
-static inline BOOLEAN guid_eq(const GUID *guid1, const GUID *guid2) {
- if ((guid1 != NULL) && (guid2 != NULL)) {
- return (memcmp(guid1, guid2, sizeof(GUID)) == 0);
- }
- return false;
-}
-
-#if defined(ENABLE_LOGGING)
-static char* guid_to_string(const GUID* guid)
-{
- static char guid_string[MAX_GUID_STRING_LENGTH];
-
- if (guid == NULL) return NULL;
- sprintf(guid_string, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- (unsigned int)guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
- guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
- return guid_string;
-}
-#endif
-
-/*
- * Converts a windows error to human readable string
- * uses retval as errorcode, or, if 0, use GetLastError()
- */
-#if defined(ENABLE_LOGGING)
-static char *windows_error_str(uint32_t retval)
-{
-static char err_string[ERR_BUFFER_SIZE];
-
- DWORD size;
- ssize_t i;
- uint32_t error_code, format_error;
-
- error_code = retval?retval:GetLastError();
-
- safe_sprintf(err_string, ERR_BUFFER_SIZE, "[%u] ", error_code);
-
- size = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[safe_strlen(err_string)],
- ERR_BUFFER_SIZE - (DWORD)safe_strlen(err_string), NULL);
- if (size == 0) {
- format_error = GetLastError();
- if (format_error)
- safe_sprintf(err_string, ERR_BUFFER_SIZE,
- "Windows error code %u (FormatMessage error code %u)", error_code, format_error);
- else
- safe_sprintf(err_string, ERR_BUFFER_SIZE, "Unknown error code %u", error_code);
- } else {
- // Remove CR/LF terminators
- for (i=safe_strlen(err_string)-1; (i>=0) && ((err_string[i]==0x0A) || (err_string[i]==0x0D)); i--) {
- err_string[i] = 0;
- }
- }
- return err_string;
-}
-#endif
-
-/*
- * Sanitize Microsoft's paths: convert to uppercase, add prefix and fix backslashes.
- * Return an allocated sanitized string or NULL on error.
- */
-static char* sanitize_path(const char* path)
-{
- const char root_prefix[] = "\\\\.\\";
- size_t j, size, root_size;
- char* ret_path = NULL;
- size_t add_root = 0;
-
- if (path == NULL)
- return NULL;
-
- size = safe_strlen(path)+1;
- root_size = sizeof(root_prefix)-1;
-
- // Microsoft indiscriminatly uses '\\?\', '\\.\', '##?#" or "##.#" for root prefixes.
- if (!((size > 3) && (((path[0] == '\\') && (path[1] == '\\') && (path[3] == '\\')) ||
- ((path[0] == '#') && (path[1] == '#') && (path[3] == '#'))))) {
- add_root = root_size;
- size += add_root;
- }
-
- if ((ret_path = (char*) calloc(size, 1)) == NULL)
- return NULL;
-
- safe_strcpy(&ret_path[add_root], size-add_root, path);
-
- // Ensure consistancy with root prefix
- for (j=0; j<root_size; j++)
- ret_path[j] = root_prefix[j];
-
- // Same goes for '\' and '#' after the root prefix. Ensure '#' is used
- for(j=root_size; j<size; j++) {
- ret_path[j] = (char)toupper((int)ret_path[j]); // Fix case too
- if (ret_path[j] == '\\')
- ret_path[j] = '#';
- }
-
- return ret_path;
-}
-
-/*
- * Cfgmgr32, OLE32 and SetupAPI DLL functions
- */
-static int init_dlls(void)
-{
- DLL_LOAD(Cfgmgr32.dll, CM_Get_Parent, TRUE);
- DLL_LOAD(Cfgmgr32.dll, CM_Get_Child, TRUE);
- DLL_LOAD(Cfgmgr32.dll, CM_Get_Sibling, TRUE);
- DLL_LOAD(Cfgmgr32.dll, CM_Get_Device_IDA, TRUE);
- // Prefixed to avoid conflict with header files
- DLL_LOAD_PREFIXED(OLE32.dll, p, CLSIDFromString, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetClassDevsA, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInfo, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInterfaces, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceInterfaceDetailA, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiDestroyDeviceInfoList, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDevRegKey, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceRegistryPropertyA, TRUE);
- DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDeviceInterfaceRegKey, TRUE);
- DLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegQueryValueExW, TRUE);
- DLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegCloseKey, TRUE);
- return LIBUSB_SUCCESS;
-}
-
-/*
- * enumerate interfaces for the whole USB class
- *
- * Parameters:
- * dev_info: a pointer to a dev_info list
- * dev_info_data: a pointer to an SP_DEVINFO_DATA to be filled (or NULL if not needed)
- * usb_class: the generic USB class for which to retrieve interface details
- * index: zero based index of the interface in the device info list
- *
- * Note: it is the responsibility of the caller to free the DEVICE_INTERFACE_DETAIL_DATA
- * structure returned and call this function repeatedly using the same guid (with an
- * incremented index starting at zero) until all interfaces have been returned.
- */
-static bool get_devinfo_data(struct libusb_context *ctx,
- HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const char* usb_class, unsigned _index)
-{
- if (_index <= 0) {
- *dev_info = pSetupDiGetClassDevsA(NULL, usb_class, NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES);
- if (*dev_info == INVALID_HANDLE_VALUE) {
- return false;
- }
- }
-
- dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);
- if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {
- if (GetLastError() != ERROR_NO_MORE_ITEMS) {
- usbi_err(ctx, "Could not obtain device info data for index %u: %s",
- _index, windows_error_str(0));
- }
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return false;
- }
- return true;
-}
-
-/*
- * enumerate interfaces for a specific GUID
- *
- * Parameters:
- * dev_info: a pointer to a dev_info list
- * dev_info_data: a pointer to an SP_DEVINFO_DATA to be filled (or NULL if not needed)
- * guid: the GUID for which to retrieve interface details
- * index: zero based index of the interface in the device info list
- *
- * Note: it is the responsibility of the caller to free the DEVICE_INTERFACE_DETAIL_DATA
- * structure returned and call this function repeatedly using the same guid (with an
- * incremented index starting at zero) until all interfaces have been returned.
- */
-static SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context *ctx,
- HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const GUID* guid, unsigned _index)
-{
- SP_DEVICE_INTERFACE_DATA dev_interface_data;
- SP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;
- DWORD size;
-
- if (_index <= 0) {
- *dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);
- }
-
- if (dev_info_data != NULL) {
- dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);
- if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {
- if (GetLastError() != ERROR_NO_MORE_ITEMS) {
- usbi_err(ctx, "Could not obtain device info data for index %u: %s",
- _index, windows_error_str(0));
- }
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;
- }
- }
-
- dev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
- if (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) {
- if (GetLastError() != ERROR_NO_MORE_ITEMS) {
- usbi_err(ctx, "Could not obtain interface data for index %u: %s",
- _index, windows_error_str(0));
- }
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;
- }
-
- // Read interface data (dummy + actual) to access the device path
- if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) {
- // The dummy call should fail with ERROR_INSUFFICIENT_BUFFER
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- usbi_err(ctx, "could not access interface data (dummy) for index %u: %s",
- _index, windows_error_str(0));
- goto err_exit;
- }
- } else {
- usbi_err(ctx, "program assertion failed - http://msdn.microsoft.com/en-us/library/ms792901.aspx is wrong.");
- goto err_exit;
- }
-
- if ((dev_interface_details = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) calloc(size, 1)) == NULL) {
- usbi_err(ctx, "could not allocate interface data for index %u.", _index);
- goto err_exit;
- }
-
- dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);
- if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data,
- dev_interface_details, size, &size, NULL)) {
- usbi_err(ctx, "could not access interface data (actual) for index %u: %s",
- _index, windows_error_str(0));
- }
-
- return dev_interface_details;
-
-err_exit:
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;
-}
-
-/* For libusb0 filter */
-static SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details_filter(struct libusb_context *ctx,
- HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const GUID* guid, unsigned _index, char* filter_path){
- SP_DEVICE_INTERFACE_DATA dev_interface_data;
- SP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;
- DWORD size;
- if (_index <= 0) {
- *dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);
- }
- if (dev_info_data != NULL) {
- dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);
- if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {
- if (GetLastError() != ERROR_NO_MORE_ITEMS) {
- usbi_err(ctx, "Could not obtain device info data for index %u: %s",
- _index, windows_error_str(0));
- }
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;
- }
- }
- dev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
- if (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) {
- if (GetLastError() != ERROR_NO_MORE_ITEMS) {
- usbi_err(ctx, "Could not obtain interface data for index %u: %s",
- _index, windows_error_str(0));
- }
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;
- }
- // Read interface data (dummy + actual) to access the device path
- if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) {
- // The dummy call should fail with ERROR_INSUFFICIENT_BUFFER
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- usbi_err(ctx, "could not access interface data (dummy) for index %u: %s",
- _index, windows_error_str(0));
- goto err_exit;
- }
- } else {
- usbi_err(ctx, "program assertion failed - http://msdn.microsoft.com/en-us/library/ms792901.aspx is wrong.");
- goto err_exit;
- }
- if ((dev_interface_details = malloc(size)) == NULL) {
- usbi_err(ctx, "could not allocate interface data for index %u.", _index);
- goto err_exit;
- }
- dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);
- if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data,
- dev_interface_details, size, &size, NULL)) {
- usbi_err(ctx, "could not access interface data (actual) for index %u: %s",
- _index, windows_error_str(0));
- }
- // [trobinso] lookup the libusb0 symbolic index.
- if (dev_interface_details) {
- HKEY hkey_device_interface=pSetupDiOpenDeviceInterfaceRegKey(*dev_info,&dev_interface_data,0,KEY_READ);
- if (hkey_device_interface != INVALID_HANDLE_VALUE) {
- DWORD libusb0_symboliclink_index=0;
- DWORD value_length=sizeof(DWORD);
- DWORD value_type=0;
- LONG status;
- status = pRegQueryValueExW(hkey_device_interface, L"LUsb0", NULL, &value_type,
- (LPBYTE) &libusb0_symboliclink_index, &value_length);
- if (status == ERROR_SUCCESS) {
- if (libusb0_symboliclink_index < 256) {
- // libusb0.sys is connected to this device instance.
- // If the the device interface guid is {F9F3FF14-AE21-48A0-8A25-8011A7A931D9} then it's a filter.
- safe_sprintf(filter_path, sizeof("\\\\.\\libusb0-0000"), "\\\\.\\libusb0-%04d", libusb0_symboliclink_index);
- usbi_dbg("assigned libusb0 symbolic link %s", filter_path);
- } else {
- // libusb0.sys was connected to this device instance at one time; but not anymore.
- }
- }
- pRegCloseKey(hkey_device_interface);
- }
- }
- return dev_interface_details;
-err_exit:
- pSetupDiDestroyDeviceInfoList(*dev_info);
- *dev_info = INVALID_HANDLE_VALUE;
- return NULL;}
-
-/* Hash table functions - modified From glibc 2.3.2:
- [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
- [Knuth] The Art of Computer Programming, part 3 (6.4) */
-typedef struct htab_entry {
- unsigned long used;
- char* str;
-} htab_entry;
-htab_entry* htab_table = NULL;
-usbi_mutex_t htab_write_mutex = NULL;
-unsigned long htab_size, htab_filled;
-
-/* For the used double hash method the table size has to be a prime. To
- correct the user given table size we need a prime test. This trivial
- algorithm is adequate because the code is called only during init and
- the number is likely to be small */
-static int isprime(unsigned long number)
-{
- // no even number will be passed
- unsigned int divider = 3;
-
- while((divider * divider < number) && (number % divider != 0))
- divider += 2;
-
- return (number % divider != 0);
-}
-
-/* Before using the hash table we must allocate memory for it.
- We allocate one element more as the found prime number says.
- This is done for more effective indexing as explained in the
- comment for the hash function. */
-static int htab_create(struct libusb_context *ctx, unsigned long nel)
-{
- if (htab_table != NULL) {
- usbi_err(ctx, "hash table already allocated");
- }
-
- // Create a mutex
- usbi_mutex_init(&htab_write_mutex, NULL);
-
- // Change nel to the first prime number not smaller as nel.
- nel |= 1;
- while(!isprime(nel))
- nel += 2;
-
- htab_size = nel;
- usbi_dbg("using %d entries hash table", nel);
- htab_filled = 0;
-
- // allocate memory and zero out.
- htab_table = (htab_entry*) calloc(htab_size + 1, sizeof(htab_entry));
- if (htab_table == NULL) {
- usbi_err(ctx, "could not allocate space for hash table");
- return 0;
- }
-
- return 1;
-}
-
-/* After using the hash table it has to be destroyed. */
-static void htab_destroy(void)
-{
- size_t i;
- if (htab_table == NULL) {
- return;
- }
-
- for (i=0; i<htab_size; i++) {
- if (htab_table[i].used) {
- safe_free(htab_table[i].str);
- }
- }
- usbi_mutex_destroy(&htab_write_mutex);
- safe_free(htab_table);
-}
-
-/* This is the search function. It uses double hashing with open addressing.
- We use an trick to speed up the lookup. The table is created with one
- more element available. This enables us to use the index zero special.
- This index will never be used because we store the first hash index in
- the field used where zero means not used. Every other value means used.
- The used field can be used as a first fast comparison for equality of
- the stored and the parameter value. This helps to prevent unnecessary
- expensive calls of strcmp. */
-static unsigned long htab_hash(char* str)
-{
- unsigned long hval, hval2;
- unsigned long idx;
- unsigned long r = 5381;
- int c;
- char* sz = str;
-
- if (str == NULL)
- return 0;
-
- // Compute main hash value (algorithm suggested by Nokia)
- while ((c = *sz++) != 0)
- r = ((r << 5) + r) + c;
- if (r == 0)
- ++r;
-
- // compute table hash: simply take the modulus
- hval = r % htab_size;
- if (hval == 0)
- ++hval;
-
- // Try the first index
- idx = hval;
-
- if (htab_table[idx].used) {
- if ( (htab_table[idx].used == hval)
- && (safe_strcmp(str, htab_table[idx].str) == 0) ) {
- // existing hash
- return idx;
- }
- usbi_dbg("hash collision ('%s' vs '%s')", str, htab_table[idx].str);
-
- // Second hash function, as suggested in [Knuth]
- hval2 = 1 + hval % (htab_size - 2);
-
- do {
- // Because size is prime this guarantees to step through all available indexes
- if (idx <= hval2) {
- idx = htab_size + idx - hval2;
- } else {
- idx -= hval2;
- }
-
- // If we visited all entries leave the loop unsuccessfully
- if (idx == hval) {
- break;
- }
-
- // If entry is found use it.
- if ( (htab_table[idx].used == hval)
- && (safe_strcmp(str, htab_table[idx].str) == 0) ) {
- return idx;
- }
- }
- while (htab_table[idx].used);
- }
-
- // Not found => New entry
-
- // If the table is full return an error
- if (htab_filled >= htab_size) {
- usbi_err(NULL, "hash table is full (%d entries)", htab_size);
- return 0;
- }
-
- // Concurrent threads might be storing the same entry at the same time
- // (eg. "simultaneous" enums from different threads) => use a mutex
- usbi_mutex_lock(&htab_write_mutex);
- // Just free any previously allocated string (which should be the same as
- // new one). The possibility of concurrent threads storing a collision
- // string (same hash, different string) at the same time is extremely low
- safe_free(htab_table[idx].str);
- htab_table[idx].used = hval;
- htab_table[idx].str = (char*) malloc(safe_strlen(str)+1);
- if (htab_table[idx].str == NULL) {
- usbi_err(NULL, "could not duplicate string for hash table");
- usbi_mutex_unlock(&htab_write_mutex);
- return 0;
- }
- memcpy(htab_table[idx].str, str, safe_strlen(str)+1);
- ++htab_filled;
- usbi_mutex_unlock(&htab_write_mutex);
-
- return idx;
-}
-
-/*
- * Returns the session ID of a device's nth level ancestor
- * If there's no device at the nth level, return 0
- */
-static unsigned long get_ancestor_session_id(DWORD devinst, unsigned level)
-{
- DWORD parent_devinst;
- unsigned long session_id = 0;
- char* sanitized_path = NULL;
- char path[MAX_PATH_LENGTH];
- unsigned i;
-
- if (level < 1) return 0;
- for (i = 0; i<level; i++) {
- if (CM_Get_Parent(&parent_devinst, devinst, 0) != CR_SUCCESS) {
- return 0;
- }
- devinst = parent_devinst;
- }
- if (CM_Get_Device_IDA(devinst, path, MAX_PATH_LENGTH, 0) != CR_SUCCESS) {
- return 0;
- }
- // TODO: (post hotplug): try without sanitizing
- sanitized_path = sanitize_path(path);
- if (sanitized_path == NULL) {
- return 0;
- }
- session_id = htab_hash(sanitized_path);
- safe_free(sanitized_path);
- return session_id;
-}
-
-/*
- * Populate the endpoints addresses of the device_priv interface helper structs
- */
-static int windows_assign_endpoints(struct libusb_device_handle *dev_handle, int iface, int altsetting)
-{
- int i, r;
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct libusb_config_descriptor *conf_desc;
- const struct libusb_interface_descriptor *if_desc;
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
-
- r = libusb_get_config_descriptor(dev_handle->dev, 0, &conf_desc);
- if (r != LIBUSB_SUCCESS) {
- usbi_warn(ctx, "could not read config descriptor: error %d", r);
- return r;
- }
-
- if_desc = &conf_desc->interface[iface].altsetting[altsetting];
- safe_free(priv->usb_interface[iface].endpoint);
-
- if (if_desc->bNumEndpoints == 0) {
- usbi_dbg("no endpoints found for interface %d", iface);
- return LIBUSB_SUCCESS;
- }
-
- priv->usb_interface[iface].endpoint = (uint8_t*) malloc(if_desc->bNumEndpoints);
- if (priv->usb_interface[iface].endpoint == NULL) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- priv->usb_interface[iface].nb_endpoints = if_desc->bNumEndpoints;
- for (i=0; i<if_desc->bNumEndpoints; i++) {
- priv->usb_interface[iface].endpoint[i] = if_desc->endpoint[i].bEndpointAddress;
- usbi_dbg("(re)assigned endpoint %02X to interface %d", priv->usb_interface[iface].endpoint[i], iface);
- }
- libusb_free_config_descriptor(conf_desc);
-
- // Extra init may be required to configure endpoints
- return priv->apib->configure_endpoints(SUB_API_NOTSET, dev_handle, iface);
-}
-
-// Lookup for a match in the list of API driver names
-// return -1 if not found, driver match number otherwise
-static int get_sub_api(char* driver, int api){
- int i;
- const char sep_str[2] = {LIST_SEPARATOR, 0};
- char *tok, *tmp_str;
- size_t len = safe_strlen(driver);
-
- if (len == 0) return SUB_API_NOTSET;
- tmp_str = (char*) calloc(len+1, 1);
- if (tmp_str == NULL) return SUB_API_NOTSET;
- memcpy(tmp_str, driver, len+1);
- tok = strtok(tmp_str, sep_str);
- while (tok != NULL) {
- for (i=0; i<usb_api_backend[api].nb_driver_names; i++) {
- if (safe_stricmp(tok, usb_api_backend[api].driver_name_list[i]) == 0) {
- free(tmp_str);
- return i;
- }
- }
- tok = strtok(NULL, sep_str);
- }
- free (tmp_str);
- return SUB_API_NOTSET;
-}
-
-/*
- * auto-claiming and auto-release helper functions
- */
-static int auto_claim(struct libusb_transfer *transfer, int *interface_number, int api_type)
-{
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(
- transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int current_interface = *interface_number;
- int r = LIBUSB_SUCCESS;
-
- switch(api_type) {
- case USB_API_WINUSBX:
- case USB_API_HID:
- break;
- default:
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- usbi_mutex_lock(&autoclaim_lock);
- if (current_interface < 0) // No serviceable interface was found
- {
- for (current_interface=0; current_interface<USB_MAXINTERFACES; current_interface++) {
- // Must claim an interface of the same API type
- if ( (priv->usb_interface[current_interface].apib->id == api_type)
- && (libusb_claim_interface(transfer->dev_handle, current_interface) == LIBUSB_SUCCESS) ) {
- usbi_dbg("auto-claimed interface %d for control request", current_interface);
- if (handle_priv->autoclaim_count[current_interface] != 0) {
- usbi_warn(ctx, "program assertion failed - autoclaim_count was nonzero");
- }
- handle_priv->autoclaim_count[current_interface]++;
- break;
- }
- }
- if (current_interface == USB_MAXINTERFACES) {
- usbi_err(ctx, "could not auto-claim any interface");
- r = LIBUSB_ERROR_NOT_FOUND;
- }
- } else {
- // If we have a valid interface that was autoclaimed, we must increment
- // its autoclaim count so that we can prevent an early release.
- if (handle_priv->autoclaim_count[current_interface] != 0) {
- handle_priv->autoclaim_count[current_interface]++;
- }
- }
- usbi_mutex_unlock(&autoclaim_lock);
-
- *interface_number = current_interface;
- return r;
-
-}
-
-static void auto_release(struct usbi_transfer *itransfer)
-{
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- libusb_device_handle *dev_handle = transfer->dev_handle;
- struct windows_device_handle_priv* handle_priv = _device_handle_priv(dev_handle);
- int r;
-
- usbi_mutex_lock(&autoclaim_lock);
- if (handle_priv->autoclaim_count[transfer_priv->interface_number] > 0) {
- handle_priv->autoclaim_count[transfer_priv->interface_number]--;
- if (handle_priv->autoclaim_count[transfer_priv->interface_number] == 0) {
- r = libusb_release_interface(dev_handle, transfer_priv->interface_number);
- if (r == LIBUSB_SUCCESS) {
- usbi_dbg("auto-released interface %d", transfer_priv->interface_number);
- } else {
- usbi_dbg("failed to auto-release interface %d (%s)",
- transfer_priv->interface_number, libusb_error_name((enum libusb_error)r));
- }
- }
- }
- usbi_mutex_unlock(&autoclaim_lock);
-}
-
-/*
- * init: libusbx backend init function
- *
- * This function enumerates the HCDs (Host Controller Drivers) and populates our private HCD list
- * In our implementation, we equate Windows' "HCD" to libusbx's "bus". Note that bus is zero indexed.
- * HCDs are not expected to change after init (might not hold true for hot pluggable USB PCI card?)
- */
-static int windows_init(struct libusb_context *ctx)
-{
- int i, r = LIBUSB_ERROR_OTHER;
- OSVERSIONINFO os_version;
- HANDLE semaphore;
- char sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID)
-
- sprintf(sem_name, "libusb_init%08X", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);
- semaphore = CreateSemaphoreA(NULL, 1, 1, sem_name);
- if (semaphore == NULL) {
- usbi_err(ctx, "could not create semaphore: %s", windows_error_str(0));
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // A successful wait brings our semaphore count to 0 (unsignaled)
- // => any concurent wait stalls until the semaphore's release
- if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {
- usbi_err(ctx, "failure to access semaphore: %s", windows_error_str(0));
- CloseHandle(semaphore);
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // NB: concurrent usage supposes that init calls are equally balanced with
- // exit calls. If init is called more than exit, we will not exit properly
- if ( ++concurrent_usage == 0 ) { // First init?
- // Detect OS version
- memset(&os_version, 0, sizeof(OSVERSIONINFO));
- os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- windows_version = WINDOWS_UNSUPPORTED;
- if ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) {
- if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) {
- windows_version = WINDOWS_XP;
- } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) {
- windows_version = WINDOWS_2003; // also includes XP 64
- } else if (os_version.dwMajorVersion >= 6) {
- windows_version = WINDOWS_VISTA_AND_LATER;
- }
- }
- if (windows_version == WINDOWS_UNSUPPORTED) {
- usbi_err(ctx, "This version of Windows is NOT supported");
- r = LIBUSB_ERROR_NOT_SUPPORTED;
- goto init_exit;
- }
-
- // We need a lock for proper auto-release
- usbi_mutex_init(&autoclaim_lock, NULL);
-
- // Initialize pollable file descriptors
- init_polling();
-
- // Load DLL imports
- if (init_dlls() != LIBUSB_SUCCESS) {
- usbi_err(ctx, "could not resolve DLL functions");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- // Initialize the low level APIs (we don't care about errors at this stage)
- for (i=0; i<USB_API_MAX; i++) {
- usb_api_backend[i].init(SUB_API_NOTSET, ctx);
- }
-
- // Because QueryPerformanceCounter might report different values when
- // running on different cores, we create a separate thread for the timer
- // calls, which we glue to the first core always to prevent timing discrepancies.
- r = LIBUSB_ERROR_NO_MEM;
- for (i = 0; i < 2; i++) {
- timer_request[i] = CreateEvent(NULL, TRUE, FALSE, NULL);
- if (timer_request[i] == NULL) {
- usbi_err(ctx, "could not create timer request event %d - aborting", i);
- goto init_exit;
- }
- }
- timer_response = CreateSemaphore(NULL, 0, MAX_TIMER_SEMAPHORES, NULL);
- if (timer_response == NULL) {
- usbi_err(ctx, "could not create timer response semaphore - aborting");
- goto init_exit;
- }
- timer_mutex = CreateMutex(NULL, FALSE, NULL);
- if (timer_mutex == NULL) {
- usbi_err(ctx, "could not create timer mutex - aborting");
- goto init_exit;
- }
- timer_thread = (HANDLE)_beginthreadex(NULL, 0, windows_clock_gettime_threaded, NULL, 0, NULL);
- if (timer_thread == NULL) {
- usbi_err(ctx, "Unable to create timer thread - aborting");
- goto init_exit;
- }
- SetThreadAffinityMask(timer_thread, 0);
-
- // Create a hash table to store session ids. Second parameter is better if prime
- htab_create(ctx, HTAB_SIZE);
- }
- // At this stage, either we went through full init successfully, or didn't need to
- r = LIBUSB_SUCCESS;
-
-init_exit: // Holds semaphore here.
- if (!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?
- if (timer_thread) {
- SetEvent(timer_request[1]); // actually the signal to quit the thread.
- if (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {
- usbi_warn(ctx, "could not wait for timer thread to quit");
- TerminateThread(timer_thread, 1); // shouldn't happen, but we're destroying
- // all objects it might have held anyway.
- }
- CloseHandle(timer_thread);
- timer_thread = NULL;
- }
- for (i = 0; i < 2; i++) {
- if (timer_request[i]) {
- CloseHandle(timer_request[i]);
- timer_request[i] = NULL;
- }
- }
- if (timer_response) {
- CloseHandle(timer_response);
- timer_response = NULL;
- }
- if (timer_mutex) {
- CloseHandle(timer_mutex);
- timer_mutex = NULL;
- }
- htab_destroy();
- }
-
- if (r != LIBUSB_SUCCESS)
- --concurrent_usage; // Not expected to call libusb_exit if we failed.
-
- ReleaseSemaphore(semaphore, 1, NULL); // increase count back to 1
- CloseHandle(semaphore);
- return r;
-}
-
-/*
- * HCD (root) hubs need to have their device descriptor manually populated
- *
- * Note that, like Microsoft does in the device manager, we populate the
- * Vendor and Device ID for HCD hubs with the ones from the PCI HCD device.
- */
-static int force_hcd_device_descriptor(struct libusb_device *dev)
-{
- struct windows_device_priv *parent_priv, *priv = _device_priv(dev);
- struct libusb_context *ctx = DEVICE_CTX(dev);
- int vid, pid;
-
- dev->num_configurations = 1;
- priv->dev_descriptor.bLength = sizeof(USB_DEVICE_DESCRIPTOR);
- priv->dev_descriptor.bDescriptorType = USB_DEVICE_DESCRIPTOR_TYPE;
- priv->dev_descriptor.bNumConfigurations = 1;
- priv->active_config = 1;
-
- if (priv->parent_dev == NULL) {
- usbi_err(ctx, "program assertion failed - HCD hub has no parent");
- return LIBUSB_ERROR_NO_DEVICE;
- }
- parent_priv = _device_priv(priv->parent_dev);
- if (sscanf(parent_priv->path, "\\\\.\\PCI#VEN_%04x&DEV_%04x%*s", &vid, &pid) == 2) {
- priv->dev_descriptor.idVendor = (uint16_t)vid;
- priv->dev_descriptor.idProduct = (uint16_t)pid;
- } else {
- usbi_warn(ctx, "could not infer VID/PID of HCD hub from '%s'", parent_priv->path);
- priv->dev_descriptor.idVendor = 0x1d6b; // Linux Foundation root hub
- priv->dev_descriptor.idProduct = 1;
- }
- return LIBUSB_SUCCESS;
-}
-
-/*
- * fetch and cache all the config descriptors through I/O
- */
-static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle, char* device_id)
-{
- DWORD size, ret_size;
- struct libusb_context *ctx = DEVICE_CTX(dev);
- struct windows_device_priv *priv = _device_priv(dev);
- int r;
- uint8_t i;
-
- USB_CONFIGURATION_DESCRIPTOR_SHORT cd_buf_short; // dummy request
- PUSB_DESCRIPTOR_REQUEST cd_buf_actual = NULL; // actual request
- PUSB_CONFIGURATION_DESCRIPTOR cd_data = NULL;
-
- if (dev->num_configurations == 0)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- priv->config_descriptor = (unsigned char**) calloc(dev->num_configurations, sizeof(unsigned char*));
- if (priv->config_descriptor == NULL)
- return LIBUSB_ERROR_NO_MEM;
- for (i=0; i<dev->num_configurations; i++)
- priv->config_descriptor[i] = NULL;
-
- for (i=0, r=LIBUSB_SUCCESS; ; i++)
- {
- // safe loop: release all dynamic resources
- safe_free(cd_buf_actual);
-
- // safe loop: end of loop condition
- if ((i >= dev->num_configurations) || (r != LIBUSB_SUCCESS))
- break;
-
- size = sizeof(USB_CONFIGURATION_DESCRIPTOR_SHORT);
- memset(&cd_buf_short, 0, size);
-
- cd_buf_short.req.ConnectionIndex = (ULONG)priv->port;
- cd_buf_short.req.SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;
- cd_buf_short.req.SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;
- cd_buf_short.req.SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;
- cd_buf_short.req.SetupPacket.wIndex = i;
- cd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));
-
- // Dummy call to get the required data size. Initial failures are reported as info rather
- // than error as they can occur for non-penalizing situations, such as with some hubs.
- if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size,
- &cd_buf_short, size, &ret_size, NULL)) {
- usbi_info(ctx, "could not access configuration descriptor (dummy) for '%s': %s", device_id, windows_error_str(0));
- LOOP_BREAK(LIBUSB_ERROR_IO);
- }
-
- if ((ret_size != size) || (cd_buf_short.data.wTotalLength < sizeof(USB_CONFIGURATION_DESCRIPTOR))) {
- usbi_info(ctx, "unexpected configuration descriptor size (dummy) for '%s'.", device_id);
- LOOP_BREAK(LIBUSB_ERROR_IO);
- }
-
- size = sizeof(USB_DESCRIPTOR_REQUEST) + cd_buf_short.data.wTotalLength;
- if ((cd_buf_actual = (PUSB_DESCRIPTOR_REQUEST) calloc(1, size)) == NULL) {
- usbi_err(ctx, "could not allocate configuration descriptor buffer for '%s'.", device_id);
- LOOP_BREAK(LIBUSB_ERROR_NO_MEM);
- }
- memset(cd_buf_actual, 0, size);
-
- // Actual call
- cd_buf_actual->ConnectionIndex = (ULONG)priv->port;
- cd_buf_actual->SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;
- cd_buf_actual->SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;
- cd_buf_actual->SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;
- cd_buf_actual->SetupPacket.wIndex = i;
- cd_buf_actual->SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));
-
- if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, cd_buf_actual, size,
- cd_buf_actual, size, &ret_size, NULL)) {
- usbi_err(ctx, "could not access configuration descriptor (actual) for '%s': %s", device_id, windows_error_str(0));
- LOOP_BREAK(LIBUSB_ERROR_IO);
- }
-
- cd_data = (PUSB_CONFIGURATION_DESCRIPTOR)((UCHAR*)cd_buf_actual+sizeof(USB_DESCRIPTOR_REQUEST));
-
- if ((size != ret_size) || (cd_data->wTotalLength != cd_buf_short.data.wTotalLength)) {
- usbi_err(ctx, "unexpected configuration descriptor size (actual) for '%s'.", device_id);
- LOOP_BREAK(LIBUSB_ERROR_IO);
- }
-
- if (cd_data->bDescriptorType != USB_CONFIGURATION_DESCRIPTOR_TYPE) {
- usbi_err(ctx, "not a configuration descriptor for '%s'", device_id);
- LOOP_BREAK(LIBUSB_ERROR_IO);
- }
-
- usbi_dbg("cached config descriptor %d (bConfigurationValue=%d, %d bytes)",
- i, cd_data->bConfigurationValue, cd_data->wTotalLength);
-
- // Cache the descriptor
- priv->config_descriptor[i] = (unsigned char*) malloc(cd_data->wTotalLength);
- if (priv->config_descriptor[i] == NULL)
- return LIBUSB_ERROR_NO_MEM;
- memcpy(priv->config_descriptor[i], cd_data, cd_data->wTotalLength);
- }
- return LIBUSB_SUCCESS;
-}
-
-/*
- * Populate a libusbx device structure
- */
-static int init_device(struct libusb_device* dev, struct libusb_device* parent_dev,
- uint8_t port_number, char* device_id, DWORD devinst)
-{
- HANDLE handle;
- DWORD size;
- USB_NODE_CONNECTION_INFORMATION_EX conn_info;
- struct windows_device_priv *priv, *parent_priv;
- struct libusb_context *ctx = DEVICE_CTX(dev);
- struct libusb_device* tmp_dev;
- unsigned i;
-
- if ((dev == NULL) || (parent_dev == NULL)) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
- priv = _device_priv(dev);
- parent_priv = _device_priv(parent_dev);
- if (parent_priv->apib->id != USB_API_HUB) {
- usbi_warn(ctx, "parent for device '%s' is not a hub", device_id);
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- // It is possible for the parent hub not to have been initialized yet
- // If that's the case, lookup the ancestors to set the bus number
- if (parent_dev->bus_number == 0) {
- for (i=2; ; i++) {
- tmp_dev = usbi_get_device_by_session_id(ctx, get_ancestor_session_id(devinst, i));
- if (tmp_dev == NULL) break;
- if (tmp_dev->bus_number != 0) {
- usbi_dbg("got bus number from ancestor #%d", i);
- parent_dev->bus_number = tmp_dev->bus_number;
- break;
- }
- }
- }
- if (parent_dev->bus_number == 0) {
- usbi_err(ctx, "program assertion failed: unable to find ancestor bus number for '%s'", device_id);
- return LIBUSB_ERROR_NOT_FOUND;
- }
- dev->bus_number = parent_dev->bus_number;
- priv->port = port_number;
- dev->port_number = port_number;
- priv->depth = parent_priv->depth + 1;
- priv->parent_dev = parent_dev;
- dev->parent_dev = libusb_ref_device(parent_dev);
-
- // If the device address is already set, we can stop here
- if (dev->device_address != 0) {
- return LIBUSB_SUCCESS;
- }
- memset(&conn_info, 0, sizeof(conn_info));
- if (priv->depth != 0) { // Not a HCD hub
- handle = CreateFileA(parent_priv->path, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
- FILE_FLAG_OVERLAPPED, NULL);
- if (handle == INVALID_HANDLE_VALUE) {
- usbi_warn(ctx, "could not open hub %s: %s", parent_priv->path, windows_error_str(0));
- return LIBUSB_ERROR_ACCESS;
- }
- size = sizeof(conn_info);
- conn_info.ConnectionIndex = (ULONG)port_number;
- if (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &conn_info, size,
- &conn_info, size, &size, NULL)) {
- usbi_warn(ctx, "could not get node connection information for device '%s': %s",
- device_id, windows_error_str(0));
- safe_closehandle(handle);
- return LIBUSB_ERROR_NO_DEVICE;
- }
- if (conn_info.ConnectionStatus == NoDeviceConnected) {
- usbi_err(ctx, "device '%s' is no longer connected!", device_id);
- safe_closehandle(handle);
- return LIBUSB_ERROR_NO_DEVICE;
- }
- memcpy(&priv->dev_descriptor, &(conn_info.DeviceDescriptor), sizeof(USB_DEVICE_DESCRIPTOR));
- dev->num_configurations = priv->dev_descriptor.bNumConfigurations;
- priv->active_config = conn_info.CurrentConfigurationValue;
- usbi_dbg("found %d configurations (active conf: %d)", dev->num_configurations, priv->active_config);
- // If we can't read the config descriptors, just set the number of confs to zero
- if (cache_config_descriptors(dev, handle, device_id) != LIBUSB_SUCCESS) {
- dev->num_configurations = 0;
- priv->dev_descriptor.bNumConfigurations = 0;
- }
- safe_closehandle(handle);
-
- if (conn_info.DeviceAddress > UINT8_MAX) {
- usbi_err(ctx, "program assertion failed: device address overflow");
- }
- dev->device_address = (uint8_t)conn_info.DeviceAddress + 1;
- if (dev->device_address == 1) {
- usbi_err(ctx, "program assertion failed: device address collision with root hub");
- }
- switch (conn_info.Speed) {
- case 0: dev->speed = LIBUSB_SPEED_LOW; break;
- case 1: dev->speed = LIBUSB_SPEED_FULL; break;
- case 2: dev->speed = LIBUSB_SPEED_HIGH; break;
- case 3: dev->speed = LIBUSB_SPEED_SUPER; break;
- default:
- usbi_warn(ctx, "Got unknown device speed %d", conn_info.Speed);
- break;
- }
- } else {
- dev->device_address = 1; // root hubs are set to use device number 1
- force_hcd_device_descriptor(dev);
- }
-
- usbi_sanitize_device(dev);
-
- usbi_dbg("(bus: %d, addr: %d, depth: %d, port: %d): '%s'",
- dev->bus_number, dev->device_address, priv->depth, priv->port, device_id);
-
- return LIBUSB_SUCCESS;
-}
-
-// Returns the api type, or 0 if not found/unsupported
-static void get_api_type(struct libusb_context *ctx, HDEVINFO *dev_info,
- SP_DEVINFO_DATA *dev_info_data, int *api, int *sub_api)
-{
- // Precedence for filter drivers vs driver is in the order of this array
- struct driver_lookup lookup[3] = {
- {"\0\0", SPDRP_SERVICE, "driver"},
- {"\0\0", SPDRP_UPPERFILTERS, "upper filter driver"},
- {"\0\0", SPDRP_LOWERFILTERS, "lower filter driver"}
- };
- DWORD size, reg_type;
- unsigned k, l;
- int i, j;
-
- *api = USB_API_UNSUPPORTED;
- *sub_api = SUB_API_NOTSET;
- // Check the service & filter names to know the API we should use
- for (k=0; k<3; k++) {
- if (pSetupDiGetDeviceRegistryPropertyA(*dev_info, dev_info_data, lookup[k].reg_prop,
- &reg_type, (BYTE*)lookup[k].list, MAX_KEY_LENGTH, &size)) {
- // Turn the REG_SZ SPDRP_SERVICE into REG_MULTI_SZ
- if (lookup[k].reg_prop == SPDRP_SERVICE) {
- // our buffers are MAX_KEY_LENGTH+1 so we can overflow if needed
- lookup[k].list[safe_strlen(lookup[k].list)+1] = 0;
- }
- // MULTI_SZ is a pain to work with. Turn it into something much more manageable
- // NB: none of the driver names we check against contain LIST_SEPARATOR,
- // (currently ';'), so even if an unsuported one does, it's not an issue
- for (l=0; (lookup[k].list[l] != 0) || (lookup[k].list[l+1] != 0); l++) {
- if (lookup[k].list[l] == 0) {
- lookup[k].list[l] = LIST_SEPARATOR;
- }
- }
- usbi_dbg("%s(s): %s", lookup[k].designation, lookup[k].list);
- } else {
- if (GetLastError() != ERROR_INVALID_DATA) {
- usbi_dbg("could not access %s: %s", lookup[k].designation, windows_error_str(0));
- }
- lookup[k].list[0] = 0;
- }
- }
-
- for (i=1; i<USB_API_MAX; i++) {
- for (k=0; k<3; k++) {
- j = get_sub_api(lookup[k].list, i);
- if (j >= 0) {
- usbi_dbg("matched %s name against %s API",
- lookup[k].designation, (i!=USB_API_WINUSBX)?usb_api_backend[i].designation:sub_api_name[j]);
- *api = i;
- *sub_api = j;
- return;
- }
- }
- }
-}
-
-static int set_composite_interface(struct libusb_context* ctx, struct libusb_device* dev,
- char* dev_interface_path, char* device_id, int api, int sub_api)
-{
- unsigned i;
- struct windows_device_priv *priv = _device_priv(dev);
- int interface_number;
-
- if (priv->apib->id != USB_API_COMPOSITE) {
- usbi_err(ctx, "program assertion failed: '%s' is not composite", device_id);
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- // Because MI_## are not necessarily in sequential order (some composite
- // devices will have only MI_00 & MI_03 for instance), we retrieve the actual
- // interface number from the path's MI value
- interface_number = 0;
- for (i=0; device_id[i] != 0; ) {
- if ( (device_id[i++] == 'M') && (device_id[i++] == 'I')
- && (device_id[i++] == '_') ) {
- interface_number = (device_id[i++] - '0')*10;
- interface_number += device_id[i] - '0';
- break;
- }
- }
-
- if (device_id[i] == 0) {
- usbi_warn(ctx, "failure to read interface number for %s. Using default value %d",
- device_id, interface_number);
- }
-
- if (priv->usb_interface[interface_number].path != NULL) {
- if (api == USB_API_HID) {
- // HID devices can have multiple collections (COL##) for each MI_## interface
- usbi_dbg("interface[%d] already set - ignoring HID collection: %s",
- interface_number, device_id);
- return LIBUSB_ERROR_ACCESS;
- }
- // In other cases, just use the latest data
- safe_free(priv->usb_interface[interface_number].path);
- }
-
- usbi_dbg("interface[%d] = %s", interface_number, dev_interface_path);
- priv->usb_interface[interface_number].path = dev_interface_path;
- priv->usb_interface[interface_number].apib = &usb_api_backend[api];
- priv->usb_interface[interface_number].sub_api = sub_api;
- if ((api == USB_API_HID) && (priv->hid == NULL)) {
- priv->hid = (struct hid_device_priv*) calloc(1, sizeof(struct hid_device_priv));
- if (priv->hid == NULL)
- return LIBUSB_ERROR_NO_MEM;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static int set_hid_interface(struct libusb_context* ctx, struct libusb_device* dev,
- char* dev_interface_path)
-{
- int i;
- struct windows_device_priv *priv = _device_priv(dev);
-
- if (priv->hid == NULL) {
- usbi_err(ctx, "program assertion failed: parent is not HID");
- return LIBUSB_ERROR_NO_DEVICE;
- }
- if (priv->hid->nb_interfaces == USB_MAXINTERFACES) {
- usbi_err(ctx, "program assertion failed: max USB interfaces reached for HID device");
- return LIBUSB_ERROR_NO_DEVICE;
- }
- for (i=0; i<priv->hid->nb_interfaces; i++) {
- if (safe_strcmp(priv->usb_interface[i].path, dev_interface_path) == 0) {
- usbi_dbg("interface[%d] already set to %s", i, dev_interface_path);
- return LIBUSB_SUCCESS;
- }
- }
-
- priv->usb_interface[priv->hid->nb_interfaces].path = dev_interface_path;
- priv->usb_interface[priv->hid->nb_interfaces].apib = &usb_api_backend[USB_API_HID];
- usbi_dbg("interface[%d] = %s", priv->hid->nb_interfaces, dev_interface_path);
- priv->hid->nb_interfaces++;
- return LIBUSB_SUCCESS;
-}
-
-/*
- * get_device_list: libusbx backend device enumeration function
- */
-static int windows_get_device_list(struct libusb_context *ctx, struct discovered_devs **_discdevs)
-{
- struct discovered_devs *discdevs;
- HDEVINFO dev_info = { 0 };
- const char* usb_class[] = {"USB", "NUSB3", "IUSB3"};
- SP_DEVINFO_DATA dev_info_data = { 0 };
- SP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;
- GUID hid_guid;
-#define MAX_ENUM_GUIDS 64
- const GUID* guid[MAX_ENUM_GUIDS];
-#define HCD_PASS 0
-#define HUB_PASS 1
-#define GEN_PASS 2
-#define DEV_PASS 3
-#define HID_PASS 4
- int r = LIBUSB_SUCCESS;
- int api, sub_api;
- size_t class_index = 0;
- unsigned int nb_guids, pass, i, j, ancestor;
- char path[MAX_PATH_LENGTH];
- char strbuf[MAX_PATH_LENGTH];
- struct libusb_device *dev, *parent_dev;
- struct windows_device_priv *priv, *parent_priv;
- char* dev_interface_path = NULL;
- char* dev_id_path = NULL;
- unsigned long session_id;
- DWORD size, reg_type, port_nr, install_state;
- HKEY key;
- WCHAR guid_string_w[MAX_GUID_STRING_LENGTH];
- GUID* if_guid;
- LONG s;
- // Keep a list of newly allocated devs to unref
- libusb_device** unref_list;
- unsigned int unref_size = 64;
- unsigned int unref_cur = 0;
-
- // PASS 1 : (re)enumerate HCDs (allows for HCD hotplug)
- // PASS 2 : (re)enumerate HUBS
- // PASS 3 : (re)enumerate generic USB devices (including driverless)
- // and list additional USB device interface GUIDs to explore
- // PASS 4 : (re)enumerate master USB devices that have a device interface
- // PASS 5+: (re)enumerate device interfaced GUIDs (including HID) and
- // set the device interfaces.
-
- // Init the GUID table
- guid[HCD_PASS] = &GUID_DEVINTERFACE_USB_HOST_CONTROLLER;
- guid[HUB_PASS] = &GUID_DEVINTERFACE_USB_HUB;
- guid[GEN_PASS] = NULL;
- guid[DEV_PASS] = &GUID_DEVINTERFACE_USB_DEVICE;
- HidD_GetHidGuid(&hid_guid);
- guid[HID_PASS] = &hid_guid;
- nb_guids = HID_PASS+1;
-
- unref_list = (libusb_device**) calloc(unref_size, sizeof(libusb_device*));
- if (unref_list == NULL) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- for (pass = 0; ((pass < nb_guids) && (r == LIBUSB_SUCCESS)); pass++) {
-//#define ENUM_DEBUG
-#ifdef ENUM_DEBUG
- const char *passname[] = { "HCD", "HUB", "GEN", "DEV", "HID", "EXT" };
- usbi_dbg("\n#### PROCESSING %ss %s", passname[(pass<=HID_PASS)?pass:HID_PASS+1],
- (pass!=GEN_PASS)?guid_to_string(guid[pass]):"");
-#endif
- for (i = 0; ; i++) {
- // safe loop: free up any (unprotected) dynamic resource
- // NB: this is always executed before breaking the loop
- safe_free(dev_interface_details);
- safe_free(dev_interface_path);
- safe_free(dev_id_path);
- priv = parent_priv = NULL;
- dev = parent_dev = NULL;
-
- // Safe loop: end of loop conditions
- if (r != LIBUSB_SUCCESS) {
- break;
- }
- if ((pass == HCD_PASS) && (i == UINT8_MAX)) {
- usbi_warn(ctx, "program assertion failed - found more than %d buses, skipping the rest.", UINT8_MAX);
- break;
- }
- if (pass != GEN_PASS) {
- // Except for GEN, all passes deal with device interfaces
- dev_interface_details = get_interface_details(ctx, &dev_info, &dev_info_data, guid[pass], i);
- if (dev_interface_details == NULL) {
- break;
- } else {
- dev_interface_path = sanitize_path(dev_interface_details->DevicePath);
- if (dev_interface_path == NULL) {
- usbi_warn(ctx, "could not sanitize device interface path for '%s'", dev_interface_details->DevicePath);
- continue;
- }
- }
- } else {
- // Workaround for a Nec/Renesas USB 3.0 driver bug where root hubs are
- // being listed under the "NUSB3" PnP Symbolic Name rather than "USB".
- // The Intel USB 3.0 driver behaves similar, but uses "IUSB3"
- for (; class_index < ARRAYSIZE(usb_class); class_index++) {
- if (get_devinfo_data(ctx, &dev_info, &dev_info_data, usb_class[class_index], i))
- break;
- i = 0;
- }
- if (class_index >= ARRAYSIZE(usb_class))
- break;
- }
-
- // Read the Device ID path. This is what we'll use as UID
- // Note that if the device is plugged in a different port or hub, the Device ID changes
- if (CM_Get_Device_IDA(dev_info_data.DevInst, path, sizeof(path), 0) != CR_SUCCESS) {
- usbi_warn(ctx, "could not read the device id path for devinst %X, skipping",
- dev_info_data.DevInst);
- continue;
- }
- dev_id_path = sanitize_path(path);
- if (dev_id_path == NULL) {
- usbi_warn(ctx, "could not sanitize device id path for devinst %X, skipping",
- dev_info_data.DevInst);
- continue;
- }
-#ifdef ENUM_DEBUG
- usbi_dbg("PRO: %s", dev_id_path);
-#endif
-
- // The SPDRP_ADDRESS for USB devices is the device port number on the hub
- port_nr = 0;
- if ((pass >= HUB_PASS) && (pass <= GEN_PASS)) {
- if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS,
- &reg_type, (BYTE*)&port_nr, 4, &size))
- || (size != 4) ) {
- usbi_warn(ctx, "could not retrieve port number for device '%s', skipping: %s",
- dev_id_path, windows_error_str(0));
- continue;
- }
- }
-
- // Set API to use or get additional data from generic pass
- api = USB_API_UNSUPPORTED;
- sub_api = SUB_API_NOTSET;
- switch (pass) {
- case HCD_PASS:
- break;
- case GEN_PASS:
- // We use the GEN pass to detect driverless devices...
- size = sizeof(strbuf);
- if (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER,
- &reg_type, (BYTE*)strbuf, size, &size)) {
- usbi_info(ctx, "The following device has no driver: '%s'", dev_id_path);
- usbi_info(ctx, "libusbx will not be able to access it.");
- }
- // ...and to add the additional device interface GUIDs
- key = pSetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ);
- if (key != INVALID_HANDLE_VALUE) {
- size = sizeof(guid_string_w);
- s = pRegQueryValueExW(key, L"DeviceInterfaceGUIDs", NULL, &reg_type,
- (BYTE*)guid_string_w, &size);
- pRegCloseKey(key);
- if (s == ERROR_SUCCESS) {
- if (nb_guids >= MAX_ENUM_GUIDS) {
- // If this assert is ever reported, grow a GUID table dynamically
- usbi_err(ctx, "program assertion failed: too many GUIDs");
- LOOP_BREAK(LIBUSB_ERROR_OVERFLOW);
- }
- if_guid = (GUID*) calloc(1, sizeof(GUID));
- pCLSIDFromString(guid_string_w, if_guid);
- guid[nb_guids++] = if_guid;
- usbi_dbg("extra GUID: %s", guid_to_string(if_guid));
- }
- }
- break;
- case HID_PASS:
- api = USB_API_HID;
- break;
- default:
- // Get the API type (after checking that the driver installation is OK)
- if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_INSTALL_STATE,
- &reg_type, (BYTE*)&install_state, 4, &size))
- || (size != 4) ){
- usbi_warn(ctx, "could not detect installation state of driver for '%s': %s",
- dev_id_path, windows_error_str(0));
- } else if (install_state != 0) {
- usbi_warn(ctx, "driver for device '%s' is reporting an issue (code: %d) - skipping",
- dev_id_path, install_state);
- continue;
- }
- get_api_type(ctx, &dev_info, &dev_info_data, &api, &sub_api);
- break;
- }
-
- // Find parent device (for the passes that need it)
- switch (pass) {
- case HCD_PASS:
- case DEV_PASS:
- case HUB_PASS:
- break;
- default:
- // Go through the ancestors until we see a face we recognize
- parent_dev = NULL;
- for (ancestor = 1; parent_dev == NULL; ancestor++) {
- session_id = get_ancestor_session_id(dev_info_data.DevInst, ancestor);
- if (session_id == 0) {
- break;
- }
- parent_dev = usbi_get_device_by_session_id(ctx, session_id);
- }
- if (parent_dev == NULL) {
- usbi_dbg("unlisted ancestor for '%s' (non USB HID, newly connected, etc.) - ignoring", dev_id_path);
- continue;
- }
- parent_priv = _device_priv(parent_dev);
- // virtual USB devices are also listed during GEN - don't process these yet
- if ( (pass == GEN_PASS) && (parent_priv->apib->id != USB_API_HUB) ) {
- continue;
- }
- break;
- }
-
- // Create new or match existing device, using the (hashed) device_id as session id
- if (pass <= DEV_PASS) { // For subsequent passes, we'll lookup the parent
- // These are the passes that create "new" devices
- session_id = htab_hash(dev_id_path);
- dev = usbi_get_device_by_session_id(ctx, session_id);
- if (dev == NULL) {
- if (pass == DEV_PASS) {
- // This can occur if the OS only reports a newly plugged device after we started enum
- usbi_warn(ctx, "'%s' was only detected in late pass (newly connected device?)"
- " - ignoring", dev_id_path);
- continue;
- }
- usbi_dbg("allocating new device for session [%X]", session_id);
- if ((dev = usbi_alloc_device(ctx, session_id)) == NULL) {
- LOOP_BREAK(LIBUSB_ERROR_NO_MEM);
- }
- windows_device_priv_init(dev);
- // Keep track of devices that need unref
- unref_list[unref_cur++] = dev;
- if (unref_cur >= unref_size) {
- unref_size += 64;
- unref_list = usbi_reallocf(unref_list, unref_size*sizeof(libusb_device*));
- if (unref_list == NULL) {
- usbi_err(ctx, "could not realloc list for unref - aborting.");
- LOOP_BREAK(LIBUSB_ERROR_NO_MEM);
- }
- }
- } else {
- usbi_dbg("found existing device for session [%X] (%d.%d)",
- session_id, dev->bus_number, dev->device_address);
- }
- priv = _device_priv(dev);
- }
-
- // Setup device
- switch (pass) {
- case HCD_PASS:
- dev->bus_number = (uint8_t)(i + 1); // bus 0 is reserved for disconnected
- dev->device_address = 0;
- dev->num_configurations = 0;
- priv->apib = &usb_api_backend[USB_API_HUB];
- priv->sub_api = SUB_API_NOTSET;
- priv->depth = UINT8_MAX; // Overflow to 0 for HCD Hubs
- priv->path = dev_interface_path; dev_interface_path = NULL;
- break;
- case HUB_PASS:
- case DEV_PASS:
- // If the device has already been setup, don't do it again
- if (priv->path != NULL)
- break;
- // Take care of API initialization
- priv->path = dev_interface_path; dev_interface_path = NULL;
- priv->apib = &usb_api_backend[api];
- priv->sub_api = sub_api;
- switch(api) {
- case USB_API_COMPOSITE:
- case USB_API_HUB:
- break;
- case USB_API_HID:
- priv->hid = calloc(1, sizeof(struct hid_device_priv));
- if (priv->hid == NULL) {
- LOOP_BREAK(LIBUSB_ERROR_NO_MEM);
- }
- priv->hid->nb_interfaces = 0;
- break;
- default:
- // For other devices, the first interface is the same as the device
- priv->usb_interface[0].path = (char*) calloc(safe_strlen(priv->path)+1, 1);
- if (priv->usb_interface[0].path != NULL) {
- safe_strcpy(priv->usb_interface[0].path, safe_strlen(priv->path)+1, priv->path);
- } else {
- usbi_warn(ctx, "could not duplicate interface path '%s'", priv->path);
- }
- // The following is needed if we want API calls to work for both simple
- // and composite devices.
- for(j=0; j<USB_MAXINTERFACES; j++) {
- priv->usb_interface[j].apib = &usb_api_backend[api];
- }
- break;
- }
- break;
- case GEN_PASS:
- r = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path, dev_info_data.DevInst);
- if (r == LIBUSB_SUCCESS) {
- // Append device to the list of discovered devices
- discdevs = discovered_devs_append(*_discdevs, dev);
- if (!discdevs) {
- LOOP_BREAK(LIBUSB_ERROR_NO_MEM);
- }
- *_discdevs = discdevs;
- } else if (r == LIBUSB_ERROR_NO_DEVICE) {
- // This can occur if the device was disconnected but Windows hasn't
- // refreshed its enumeration yet - in that case, we ignore the device
- r = LIBUSB_SUCCESS;
- }
- break;
- default: // HID_PASS and later
- if (parent_priv->apib->id == USB_API_HID) {
- usbi_dbg("setting HID interface for [%lX]:", parent_dev->session_data);
- r = set_hid_interface(ctx, parent_dev, dev_interface_path);
- if (r != LIBUSB_SUCCESS) LOOP_BREAK(r);
- dev_interface_path = NULL;
- } else if (parent_priv->apib->id == USB_API_COMPOSITE) {
- usbi_dbg("setting composite interface for [%lX]:", parent_dev->session_data);
- switch (set_composite_interface(ctx, parent_dev, dev_interface_path, dev_id_path, api, sub_api)) {
- case LIBUSB_SUCCESS:
- dev_interface_path = NULL;
- break;
- case LIBUSB_ERROR_ACCESS:
- // interface has already been set => make sure dev_interface_path is freed then
- break;
- default:
- LOOP_BREAK(r);
- break;
- }
- }
- break;
- }
- }
- }
-
- // Free any additional GUIDs
- for (pass = HID_PASS+1; pass < nb_guids; pass++) {
- safe_free(guid[pass]);
- }
-
- // Unref newly allocated devs
- for (i=0; i<unref_cur; i++) {
- safe_unref_device(unref_list[i]);
- }
- safe_free(unref_list);
-
- return r;
-}
-
-/*
- * exit: libusbx backend deinitialization function
- */
-static void windows_exit(void)
-{
- int i;
- HANDLE semaphore;
- char sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID)
-
- sprintf(sem_name, "libusb_init%08X", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);
- semaphore = CreateSemaphoreA(NULL, 1, 1, sem_name);
- if (semaphore == NULL) {
- return;
- }
-
- // A successful wait brings our semaphore count to 0 (unsignaled)
- // => any concurent wait stalls until the semaphore release
- if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {
- CloseHandle(semaphore);
- return;
- }
-
- // Only works if exits and inits are balanced exactly
- if (--concurrent_usage < 0) { // Last exit
- for (i=0; i<USB_API_MAX; i++) {
- usb_api_backend[i].exit(SUB_API_NOTSET);
- }
- exit_polling();
-
- if (timer_thread) {
- SetEvent(timer_request[1]); // actually the signal to quit the thread.
- if (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {
- usbi_dbg("could not wait for timer thread to quit");
- TerminateThread(timer_thread, 1);
- }
- CloseHandle(timer_thread);
- timer_thread = NULL;
- }
- for (i = 0; i < 2; i++) {
- if (timer_request[i]) {
- CloseHandle(timer_request[i]);
- timer_request[i] = NULL;
- }
- }
- if (timer_response) {
- CloseHandle(timer_response);
- timer_response = NULL;
- }
- if (timer_mutex) {
- CloseHandle(timer_mutex);
- timer_mutex = NULL;
- }
- htab_destroy();
- }
-
- ReleaseSemaphore(semaphore, 1, NULL); // increase count back to 1
- CloseHandle(semaphore);
-}
-
-static int windows_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian)
-{
- struct windows_device_priv *priv = _device_priv(dev);
-
- memcpy(buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH);
- *host_endian = 0;
-
- return LIBUSB_SUCCESS;
-}
-
-static int windows_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian)
-{
- struct windows_device_priv *priv = _device_priv(dev);
- PUSB_CONFIGURATION_DESCRIPTOR config_header;
- size_t size;
-
- // config index is zero based
- if (config_index >= dev->num_configurations)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- if ((priv->config_descriptor == NULL) || (priv->config_descriptor[config_index] == NULL))
- return LIBUSB_ERROR_NOT_FOUND;
-
- config_header = (PUSB_CONFIGURATION_DESCRIPTOR)priv->config_descriptor[config_index];
-
- size = min(config_header->wTotalLength, len);
- memcpy(buffer, priv->config_descriptor[config_index], size);
- *host_endian = 0;
-
- return size;
-}
-
-/*
- * return the cached copy of the active config descriptor
- */
-static int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian)
-{
- struct windows_device_priv *priv = _device_priv(dev);
-
- if (priv->active_config == 0)
- return LIBUSB_ERROR_NOT_FOUND;
-
- // config index is zero based
- return windows_get_config_descriptor(dev, (uint8_t)(priv->active_config-1), buffer, len, host_endian);
-}
-
-static int windows_open(struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
-
- if (priv->apib == NULL) {
- usbi_err(ctx, "program assertion failed - device is not initialized");
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- return priv->apib->open(SUB_API_NOTSET, dev_handle);
-}
-
-static void windows_close(struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- priv->apib->close(SUB_API_NOTSET, dev_handle);
-}
-
-static int windows_get_configuration(struct libusb_device_handle *dev_handle, int *config)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- if (priv->active_config == 0) {
- *config = 0;
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- *config = priv->active_config;
- return LIBUSB_SUCCESS;
-}
-
-/*
- * from http://msdn.microsoft.com/en-us/library/ms793522.aspx: "The port driver
- * does not currently expose a service that allows higher-level drivers to set
- * the configuration."
- */
-static int windows_set_configuration(struct libusb_device_handle *dev_handle, int config)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- int r = LIBUSB_SUCCESS;
-
- if (config >= USB_MAXCONFIG)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- r = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_OUT |
- LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE,
- LIBUSB_REQUEST_SET_CONFIGURATION, (uint16_t)config,
- 0, NULL, 0, 1000);
-
- if (r == LIBUSB_SUCCESS) {
- priv->active_config = (uint8_t)config;
- }
- return r;
-}
-
-static int windows_claim_interface(struct libusb_device_handle *dev_handle, int iface)
-{
- int r = LIBUSB_SUCCESS;
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- if (iface >= USB_MAXINTERFACES)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- safe_free(priv->usb_interface[iface].endpoint);
- priv->usb_interface[iface].nb_endpoints= 0;
-
- r = priv->apib->claim_interface(SUB_API_NOTSET, dev_handle, iface);
-
- if (r == LIBUSB_SUCCESS) {
- r = windows_assign_endpoints(dev_handle, iface, 0);
- }
-
- return r;
-}
-
-static int windows_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting)
-{
- int r = LIBUSB_SUCCESS;
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- safe_free(priv->usb_interface[iface].endpoint);
- priv->usb_interface[iface].nb_endpoints= 0;
-
- r = priv->apib->set_interface_altsetting(SUB_API_NOTSET, dev_handle, iface, altsetting);
-
- if (r == LIBUSB_SUCCESS) {
- r = windows_assign_endpoints(dev_handle, iface, altsetting);
- }
-
- return r;
-}
-
-static int windows_release_interface(struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- return priv->apib->release_interface(SUB_API_NOTSET, dev_handle, iface);
-}
-
-static int windows_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- return priv->apib->clear_halt(SUB_API_NOTSET, dev_handle, endpoint);
-}
-
-static int windows_reset_device(struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- return priv->apib->reset_device(SUB_API_NOTSET, dev_handle);
-}
-
-// The 3 functions below are unlikely to ever get supported on Windows
-static int windows_kernel_driver_active(struct libusb_device_handle *dev_handle, int iface)
-{
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static int windows_attach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)
-{
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static int windows_detach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)
-{
- return LIBUSB_ERROR_NOT_SUPPORTED;
-}
-
-static void windows_destroy_device(struct libusb_device *dev)
-{
- windows_device_priv_release(dev);
-}
-
-static void windows_clear_transfer_priv(struct usbi_transfer *itransfer)
-{
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
-
- usbi_free_fd(&transfer_priv->pollable_fd);
- safe_free(transfer_priv->hid_buffer);
- // When auto claim is in use, attempt to release the auto-claimed interface
- auto_release(itransfer);
-}
-
-static int submit_bulk_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int r;
-
- r = priv->apib->submit_bulk_transfer(SUB_API_NOTSET, itransfer);
- if (r != LIBUSB_SUCCESS) {
- return r;
- }
-
- usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd,
- (short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT));
-
- itransfer->flags |= USBI_TRANSFER_UPDATED_FDS;
- return LIBUSB_SUCCESS;
-}
-
-static int submit_iso_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int r;
-
- r = priv->apib->submit_iso_transfer(SUB_API_NOTSET, itransfer);
- if (r != LIBUSB_SUCCESS) {
- return r;
- }
-
- usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd,
- (short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT));
-
- itransfer->flags |= USBI_TRANSFER_UPDATED_FDS;
- return LIBUSB_SUCCESS;
-}
-
-static int submit_control_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int r;
-
- r = priv->apib->submit_control_transfer(SUB_API_NOTSET, itransfer);
- if (r != LIBUSB_SUCCESS) {
- return r;
- }
-
- usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, POLLIN);
-
- itransfer->flags |= USBI_TRANSFER_UPDATED_FDS;
- return LIBUSB_SUCCESS;
-
-}
-
-static int windows_submit_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return submit_control_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- if (IS_XFEROUT(transfer) &&
- transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET)
- return LIBUSB_ERROR_NOT_SUPPORTED;
- return submit_bulk_transfer(itransfer);
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return submit_iso_transfer(itransfer);
- default:
- usbi_err(TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static int windows_abort_control(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
-
- return priv->apib->abort_control(SUB_API_NOTSET, itransfer);
-}
-
-static int windows_abort_transfers(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
-
- return priv->apib->abort_transfers(SUB_API_NOTSET, itransfer);
-}
-
-static int windows_cancel_transfer(struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- return windows_abort_control(itransfer);
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- return windows_abort_transfers(itransfer);
- default:
- usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-static void windows_transfer_callback(struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int status, istatus;
-
- usbi_dbg("handling I/O completion with errcode %d, size %d", io_result, io_size);
-
- switch(io_result) {
- case NO_ERROR:
- status = priv->apib->copy_transfer_data(SUB_API_NOTSET, itransfer, io_size);
- break;
- case ERROR_GEN_FAILURE:
- usbi_dbg("detected endpoint stall");
- status = LIBUSB_TRANSFER_STALL;
- break;
- case ERROR_SEM_TIMEOUT:
- usbi_dbg("detected semaphore timeout");
- status = LIBUSB_TRANSFER_TIMED_OUT;
- break;
- case ERROR_OPERATION_ABORTED:
- istatus = priv->apib->copy_transfer_data(SUB_API_NOTSET, itransfer, io_size);
- if (istatus != LIBUSB_TRANSFER_COMPLETED) {
- usbi_dbg("Failed to copy partial data in aborted operation: %d", istatus);
- }
- if (itransfer->flags & USBI_TRANSFER_TIMED_OUT) {
- usbi_dbg("detected timeout");
- status = LIBUSB_TRANSFER_TIMED_OUT;
- } else {
- usbi_dbg("detected operation aborted");
- status = LIBUSB_TRANSFER_CANCELLED;
- }
- break;
- default:
- usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error %d: %s", io_result, windows_error_str(0));
- status = LIBUSB_TRANSFER_ERROR;
- break;
- }
- windows_clear_transfer_priv(itransfer); // Cancel polling
- usbi_handle_transfer_completion(itransfer, (enum libusb_transfer_status)status);
-}
-
-static void windows_handle_callback (struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-
- switch (transfer->type) {
- case LIBUSB_TRANSFER_TYPE_CONTROL:
- case LIBUSB_TRANSFER_TYPE_BULK:
- case LIBUSB_TRANSFER_TYPE_INTERRUPT:
- case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
- windows_transfer_callback (itransfer, io_result, io_size);
- break;
- default:
- usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type);
- }
-}
-
-static int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)
-{
- struct windows_transfer_priv* transfer_priv = NULL;
- POLL_NFDS_TYPE i = 0;
- bool found = false;
- struct usbi_transfer *transfer;
- DWORD io_size, io_result;
-
- usbi_mutex_lock(&ctx->open_devs_lock);
- for (i = 0; i < nfds && num_ready > 0; i++) {
-
- usbi_dbg("checking fd %d with revents = %04x", fds[i].fd, fds[i].revents);
-
- if (!fds[i].revents) {
- continue;
- }
-
- num_ready--;
-
- // Because a Windows OVERLAPPED is used for poll emulation,
- // a pollable fd is created and stored with each transfer
- usbi_mutex_lock(&ctx->flying_transfers_lock);
- list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {
- transfer_priv = usbi_transfer_get_os_priv(transfer);
- if (transfer_priv->pollable_fd.fd == fds[i].fd) {
- found = true;
- break;
- }
- }
- usbi_mutex_unlock(&ctx->flying_transfers_lock);
-
- if (found) {
- // Handle async requests that completed synchronously first
- if (HasOverlappedIoCompletedSync(transfer_priv->pollable_fd.overlapped)) {
- io_result = NO_ERROR;
- io_size = (DWORD)transfer_priv->pollable_fd.overlapped->InternalHigh;
- // Regular async overlapped
- } else if (GetOverlappedResult(transfer_priv->pollable_fd.handle,
- transfer_priv->pollable_fd.overlapped, &io_size, false)) {
- io_result = NO_ERROR;
- } else {
- io_result = GetLastError();
- }
- usbi_remove_pollfd(ctx, transfer_priv->pollable_fd.fd);
- // let handle_callback free the event using the transfer wfd
- // If you don't use the transfer wfd, you run a risk of trying to free a
- // newly allocated wfd that took the place of the one from the transfer.
- windows_handle_callback(transfer, io_result, io_size);
- } else {
- usbi_err(ctx, "could not find a matching transfer for fd %x", fds[i]);
- return LIBUSB_ERROR_NOT_FOUND;
- }
- }
-
- usbi_mutex_unlock(&ctx->open_devs_lock);
- return LIBUSB_SUCCESS;
-}
-
-/*
- * Monotonic and real time functions
- */
-unsigned __stdcall windows_clock_gettime_threaded(void* param)
-{
- LARGE_INTEGER hires_counter, li_frequency;
- LONG nb_responses;
- int timer_index;
-
- // Init - find out if we have access to a monotonic (hires) timer
- if (!QueryPerformanceFrequency(&li_frequency)) {
- usbi_dbg("no hires timer available on this platform");
- hires_frequency = 0;
- hires_ticks_to_ps = UINT64_C(0);
- } else {
- hires_frequency = li_frequency.QuadPart;
- // The hires frequency can go as high as 4 GHz, so we'll use a conversion
- // to picoseconds to compute the tv_nsecs part in clock_gettime
- hires_ticks_to_ps = UINT64_C(1000000000000) / hires_frequency;
- usbi_dbg("hires timer available (Frequency: %"PRIu64" Hz)", hires_frequency);
- }
-
- // Main loop - wait for requests
- while (1) {
- timer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0;
- if ( (timer_index != 0) && (timer_index != 1) ) {
- usbi_dbg("failure to wait on requests: %s", windows_error_str(0));
- continue;
- }
- if (request_count[timer_index] == 0) {
- // Request already handled
- ResetEvent(timer_request[timer_index]);
- // There's still a possiblity that a thread sends a request between the
- // time we test request_count[] == 0 and we reset the event, in which case
- // the request would be ignored. The simple solution to that is to test
- // request_count again and process requests if non zero.
- if (request_count[timer_index] == 0)
- continue;
- }
- switch (timer_index) {
- case 0:
- WaitForSingleObject(timer_mutex, INFINITE);
- // Requests to this thread are for hires always
- if (QueryPerformanceCounter(&hires_counter) != 0) {
- timer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency);
- timer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps);
- } else {
- // Fallback to real-time if we can't get monotonic value
- // Note that real-time clock does not wait on the mutex or this thread.
- windows_clock_gettime(USBI_CLOCK_REALTIME, &timer_tp);
- }
- ReleaseMutex(timer_mutex);
-
- nb_responses = InterlockedExchange((LONG*)&request_count[0], 0);
- if ( (nb_responses)
- && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) {
- usbi_dbg("unable to release timer semaphore %d: %s", windows_error_str(0));
- }
- continue;
- case 1: // time to quit
- usbi_dbg("timer thread quitting");
- return 0;
- }
- }
-}
-
-static int windows_clock_gettime(int clk_id, struct timespec *tp)
-{
- FILETIME filetime;
- ULARGE_INTEGER rtime;
- DWORD r;
- switch(clk_id) {
- case USBI_CLOCK_MONOTONIC:
- if (hires_frequency != 0) {
- while (1) {
- InterlockedIncrement((LONG*)&request_count[0]);
- SetEvent(timer_request[0]);
- r = WaitForSingleObject(timer_response, TIMER_REQUEST_RETRY_MS);
- switch(r) {
- case WAIT_OBJECT_0:
- WaitForSingleObject(timer_mutex, INFINITE);
- *tp = timer_tp;
- ReleaseMutex(timer_mutex);
- return LIBUSB_SUCCESS;
- case WAIT_TIMEOUT:
- usbi_dbg("could not obtain a timer value within reasonable timeframe - too much load?");
- break; // Retry until successful
- default:
- usbi_dbg("WaitForSingleObject failed: %s", windows_error_str(0));
- return LIBUSB_ERROR_OTHER;
- }
- }
- }
- // Fall through and return real-time if monotonic was not detected @ timer init
- case USBI_CLOCK_REALTIME:
- // We follow http://msdn.microsoft.com/en-us/library/ms724928%28VS.85%29.aspx
- // with a predef epoch_time to have an epoch that starts at 1970.01.01 00:00
- // Note however that our resolution is bounded by the Windows system time
- // functions and is at best of the order of 1 ms (or, usually, worse)
- GetSystemTimeAsFileTime(&filetime);
- rtime.LowPart = filetime.dwLowDateTime;
- rtime.HighPart = filetime.dwHighDateTime;
- rtime.QuadPart -= epoch_time;
- tp->tv_sec = (long)(rtime.QuadPart / 10000000);
- tp->tv_nsec = (long)((rtime.QuadPart % 10000000)*100);
- return LIBUSB_SUCCESS;
- default:
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-}
-
-
-// NB: MSVC6 does not support named initializers.
-const struct usbi_os_backend windows_backend = {
- "Windows",
- USBI_CAP_HAS_HID_ACCESS,
- windows_init,
- windows_exit,
-
- windows_get_device_list,
- NULL, /* hotplug_poll */
- windows_open,
- windows_close,
-
- windows_get_device_descriptor,
- windows_get_active_config_descriptor,
- windows_get_config_descriptor,
- NULL, /* get_config_descriptor_by_value() */
-
- windows_get_configuration,
- windows_set_configuration,
- windows_claim_interface,
- windows_release_interface,
-
- windows_set_interface_altsetting,
- windows_clear_halt,
- windows_reset_device,
-
- windows_kernel_driver_active,
- windows_detach_kernel_driver,
- windows_attach_kernel_driver,
-
- windows_destroy_device,
-
- windows_submit_transfer,
- windows_cancel_transfer,
- windows_clear_transfer_priv,
-
- windows_handle_events,
-
- windows_clock_gettime,
-#if defined(USBI_TIMERFD_AVAILABLE)
- NULL,
-#endif
- sizeof(struct windows_device_priv),
- sizeof(struct windows_device_handle_priv),
- sizeof(struct windows_transfer_priv),
- 0,
-};
-
-
-/*
- * USB API backends
- */
-static int unsupported_init(int sub_api, struct libusb_context *ctx) {
- return LIBUSB_SUCCESS;
-}
-static int unsupported_exit(int sub_api) {
- return LIBUSB_SUCCESS;
-}
-static int unsupported_open(int sub_api, struct libusb_device_handle *dev_handle) {
- PRINT_UNSUPPORTED_API(open);
-}
-static void unsupported_close(int sub_api, struct libusb_device_handle *dev_handle) {
- usbi_dbg("unsupported API call for 'close'");
-}
-static int unsupported_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
- PRINT_UNSUPPORTED_API(configure_endpoints);
-}
-static int unsupported_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
- PRINT_UNSUPPORTED_API(claim_interface);
-}
-static int unsupported_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting) {
- PRINT_UNSUPPORTED_API(set_interface_altsetting);
-}
-static int unsupported_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
- PRINT_UNSUPPORTED_API(release_interface);
-}
-static int unsupported_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint) {
- PRINT_UNSUPPORTED_API(clear_halt);
-}
-static int unsupported_reset_device(int sub_api, struct libusb_device_handle *dev_handle) {
- PRINT_UNSUPPORTED_API(reset_device);
-}
-static int unsupported_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {
- PRINT_UNSUPPORTED_API(submit_bulk_transfer);
-}
-static int unsupported_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer) {
- PRINT_UNSUPPORTED_API(submit_iso_transfer);
-}
-static int unsupported_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer) {
- PRINT_UNSUPPORTED_API(submit_control_transfer);
-}
-static int unsupported_abort_control(int sub_api, struct usbi_transfer *itransfer) {
- PRINT_UNSUPPORTED_API(abort_control);
-}
-static int unsupported_abort_transfers(int sub_api, struct usbi_transfer *itransfer) {
- PRINT_UNSUPPORTED_API(abort_transfers);
-}
-static int unsupported_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size) {
- PRINT_UNSUPPORTED_API(copy_transfer_data);
-}
-static int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
- return LIBUSB_SUCCESS;
-}
-// These names must be uppercase
-const char* hub_driver_names[] = {"USBHUB", "USBHUB3", "NUSB3HUB", "RUSB3HUB", "FLXHCIH", "TIHUB3", "ETRONHUB3", "VIAHUB3", "ASMTHUB3", "IUSB3HUB"};
-const char* composite_driver_names[] = {"USBCCGP"};
-const char* winusbx_driver_names[] = WINUSBX_DRV_NAMES;
-const char* hid_driver_names[] = {"HIDUSB", "MOUHID", "KBDHID"};
-const struct windows_usb_api_backend usb_api_backend[USB_API_MAX] = {
- {
- USB_API_UNSUPPORTED,
- "Unsupported API",
- NULL,
- 0,
- unsupported_init,
- unsupported_exit,
- unsupported_open,
- unsupported_close,
- unsupported_configure_endpoints,
- unsupported_claim_interface,
- unsupported_set_interface_altsetting,
- unsupported_release_interface,
- unsupported_clear_halt,
- unsupported_reset_device,
- unsupported_submit_bulk_transfer,
- unsupported_submit_iso_transfer,
- unsupported_submit_control_transfer,
- unsupported_abort_control,
- unsupported_abort_transfers,
- unsupported_copy_transfer_data,
- }, {
- USB_API_HUB,
- "HUB API",
- hub_driver_names,
- ARRAYSIZE(hub_driver_names),
- unsupported_init,
- unsupported_exit,
- unsupported_open,
- unsupported_close,
- unsupported_configure_endpoints,
- unsupported_claim_interface,
- unsupported_set_interface_altsetting,
- unsupported_release_interface,
- unsupported_clear_halt,
- unsupported_reset_device,
- unsupported_submit_bulk_transfer,
- unsupported_submit_iso_transfer,
- unsupported_submit_control_transfer,
- unsupported_abort_control,
- unsupported_abort_transfers,
- unsupported_copy_transfer_data,
- }, {
- USB_API_COMPOSITE,
- "Composite API",
- composite_driver_names,
- ARRAYSIZE(composite_driver_names),
- composite_init,
- composite_exit,
- composite_open,
- composite_close,
- common_configure_endpoints,
- composite_claim_interface,
- composite_set_interface_altsetting,
- composite_release_interface,
- composite_clear_halt,
- composite_reset_device,
- composite_submit_bulk_transfer,
- composite_submit_iso_transfer,
- composite_submit_control_transfer,
- composite_abort_control,
- composite_abort_transfers,
- composite_copy_transfer_data,
- }, {
- USB_API_WINUSBX,
- "WinUSB-like APIs",
- winusbx_driver_names,
- ARRAYSIZE(winusbx_driver_names),
- winusbx_init,
- winusbx_exit,
- winusbx_open,
- winusbx_close,
- winusbx_configure_endpoints,
- winusbx_claim_interface,
- winusbx_set_interface_altsetting,
- winusbx_release_interface,
- winusbx_clear_halt,
- winusbx_reset_device,
- winusbx_submit_bulk_transfer,
- unsupported_submit_iso_transfer,
- winusbx_submit_control_transfer,
- winusbx_abort_control,
- winusbx_abort_transfers,
- winusbx_copy_transfer_data,
- }, {
- USB_API_HID,
- "HID API",
- hid_driver_names,
- ARRAYSIZE(hid_driver_names),
- hid_init,
- hid_exit,
- hid_open,
- hid_close,
- common_configure_endpoints,
- hid_claim_interface,
- hid_set_interface_altsetting,
- hid_release_interface,
- hid_clear_halt,
- hid_reset_device,
- hid_submit_bulk_transfer,
- unsupported_submit_iso_transfer,
- hid_submit_control_transfer,
- hid_abort_transfers,
- hid_abort_transfers,
- hid_copy_transfer_data,
- },
-};
-
-
-/*
- * WinUSB-like (WinUSB, libusb0/libusbK through libusbk DLL) API functions
- */
-#define WinUSBX_Set(fn) do { if (native_winusb) WinUSBX[i].fn = (WinUsb_##fn##_t) GetProcAddress(h, "WinUsb_" #fn); \
- else pLibK_GetProcAddress((PVOID*)&WinUSBX[i].fn, i, KUSB_FNID_##fn); } while (0)
-
-static int winusbx_init(int sub_api, struct libusb_context *ctx)
-{
- HMODULE h = NULL;
- bool native_winusb = false;
- int i;
- KLIB_VERSION LibK_Version;
- LibK_GetProcAddress_t pLibK_GetProcAddress = NULL;
- LibK_GetVersion_t pLibK_GetVersion = NULL;
-
- h = GetModuleHandleA("libusbK");
- if (h == NULL) {
- h = LoadLibraryA("libusbK");
- }
- if (h == NULL) {
- usbi_info(ctx, "libusbK DLL is not available, will use native WinUSB");
- h = GetModuleHandleA("WinUSB");
- if (h == NULL) {
- h = LoadLibraryA("WinUSB");
- } if (h == NULL) {
- usbi_warn(ctx, "WinUSB DLL is not available either,\n"
- "you will not be able to access devices outside of enumeration");
- return LIBUSB_ERROR_NOT_FOUND;
- }
- } else {
- usbi_dbg("using libusbK DLL for universal access");
- pLibK_GetVersion = (LibK_GetVersion_t) GetProcAddress(h, "LibK_GetVersion");
- if (pLibK_GetVersion != NULL) {
- pLibK_GetVersion(&LibK_Version);
- usbi_dbg("libusbK version: %d.%d.%d.%d", LibK_Version.Major, LibK_Version.Minor,
- LibK_Version.Micro, LibK_Version.Nano);
- }
- pLibK_GetProcAddress = (LibK_GetProcAddress_t) GetProcAddress(h, "LibK_GetProcAddress");
- if (pLibK_GetProcAddress == NULL) {
- usbi_err(ctx, "LibK_GetProcAddress() not found in libusbK DLL");
- return LIBUSB_ERROR_NOT_FOUND;
- }
- }
- native_winusb = (pLibK_GetProcAddress == NULL);
- for (i=SUB_API_LIBUSBK; i<SUB_API_MAX; i++) {
- WinUSBX_Set(AbortPipe);
- WinUSBX_Set(ControlTransfer);
- WinUSBX_Set(FlushPipe);
- WinUSBX_Set(Free);
- WinUSBX_Set(GetAssociatedInterface);
- WinUSBX_Set(GetCurrentAlternateSetting);
- WinUSBX_Set(GetDescriptor);
- WinUSBX_Set(GetOverlappedResult);
- WinUSBX_Set(GetPipePolicy);
- WinUSBX_Set(GetPowerPolicy);
- WinUSBX_Set(Initialize);
- WinUSBX_Set(QueryDeviceInformation);
- WinUSBX_Set(QueryInterfaceSettings);
- WinUSBX_Set(QueryPipe);
- WinUSBX_Set(ReadPipe);
- WinUSBX_Set(ResetPipe);
- WinUSBX_Set(SetCurrentAlternateSetting);
- WinUSBX_Set(SetPipePolicy);
- WinUSBX_Set(SetPowerPolicy);
- WinUSBX_Set(WritePipe);
- if (!native_winusb) {
- WinUSBX_Set(ResetDevice);
- }
- if (WinUSBX[i].Initialize != NULL) {
- WinUSBX[i].initialized = true;
- usbi_dbg("initalized sub API %s", sub_api_name[i]);
- } else {
- usbi_warn(ctx, "Failed to initalize sub API %s", sub_api_name[i]);
- WinUSBX[i].initialized = false;
- }
- }
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_exit(int sub_api)
-{
- return LIBUSB_SUCCESS;
-}
-
-// NB: open and close must ensure that they only handle interface of
-// the right API type, as these functions can be called wholesale from
-// composite_open(), with interfaces belonging to different APIs
-static int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
-
- HANDLE file_handle;
- int i;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- // WinUSB requires a seperate handle for each interface
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if ( (priv->usb_interface[i].path != NULL)
- && (priv->usb_interface[i].apib->id == USB_API_WINUSBX) ) {
- file_handle = CreateFileA(priv->usb_interface[i].path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
- if (file_handle == INVALID_HANDLE_VALUE) {
- usbi_err(ctx, "could not open device %s (interface %d): %s", priv->usb_interface[i].path, i, windows_error_str(0));
- switch(GetLastError()) {
- case ERROR_FILE_NOT_FOUND: // The device was disconnected
- return LIBUSB_ERROR_NO_DEVICE;
- case ERROR_ACCESS_DENIED:
- return LIBUSB_ERROR_ACCESS;
- default:
- return LIBUSB_ERROR_IO;
- }
- }
- handle_priv->interface_handle[i].dev_handle = file_handle;
- }
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE file_handle;
- int i;
-
- if (sub_api == SUB_API_NOTSET)
- sub_api = priv->sub_api;
- if (!WinUSBX[sub_api].initialized)
- return;
-
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if (priv->usb_interface[i].apib->id == USB_API_WINUSBX) {
- file_handle = handle_priv->interface_handle[i].dev_handle;
- if ( (file_handle != 0) && (file_handle != INVALID_HANDLE_VALUE)) {
- CloseHandle(file_handle);
- }
- }
- }
-}
-
-static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE winusb_handle = handle_priv->interface_handle[iface].api_handle;
- UCHAR policy;
- ULONG timeout = 0;
- uint8_t endpoint_address;
- int i;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- // With handle and enpoints set (in parent), we can setup the default pipe properties
- // see http://download.microsoft.com/download/D/1/D/D1DD7745-426B-4CC3-A269-ABBBE427C0EF/DVC-T705_DDC08.pptx
- for (i=-1; i<priv->usb_interface[iface].nb_endpoints; i++) {
- endpoint_address =(i==-1)?0:priv->usb_interface[iface].endpoint[i];
- if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
- PIPE_TRANSFER_TIMEOUT, sizeof(ULONG), &timeout)) {
- usbi_dbg("failed to set PIPE_TRANSFER_TIMEOUT for control endpoint %02X", endpoint_address);
- }
- if ((i == -1) || (sub_api == SUB_API_LIBUSB0)) {
- continue; // Other policies don't apply to control endpoint or libusb0
- }
- policy = false;
- if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
- SHORT_PACKET_TERMINATE, sizeof(UCHAR), &policy)) {
- usbi_dbg("failed to disable SHORT_PACKET_TERMINATE for endpoint %02X", endpoint_address);
- }
- if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
- IGNORE_SHORT_PACKETS, sizeof(UCHAR), &policy)) {
- usbi_dbg("failed to disable IGNORE_SHORT_PACKETS for endpoint %02X", endpoint_address);
- }
- policy = true;
- /* ALLOW_PARTIAL_READS must be enabled due to likely libusbK bug. See:
- https://sourceforge.net/mailarchive/message.php?msg_id=29736015 */
- if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
- ALLOW_PARTIAL_READS, sizeof(UCHAR), &policy)) {
- usbi_dbg("failed to enable ALLOW_PARTIAL_READS for endpoint %02X", endpoint_address);
- }
- if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
- AUTO_CLEAR_STALL, sizeof(UCHAR), &policy)) {
- usbi_dbg("failed to enable AUTO_CLEAR_STALL for endpoint %02X", endpoint_address);
- }
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);
- HANDLE file_handle, winusb_handle;
- DWORD err;
- int i;
- SP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;
- HDEVINFO dev_info = INVALID_HANDLE_VALUE;
- SP_DEVINFO_DATA dev_info_data;
- char* dev_path_no_guid = NULL;
- char filter_path[] = "\\\\.\\libusb0-0000";
- bool found_filter = false;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- // If the device is composite, but using the default Windows composite parent driver (usbccgp)
- // or if it's the first WinUSB-like interface, we get a handle through Initialize().
- if ((is_using_usbccgp) || (iface == 0)) {
- // composite device (independent interfaces) or interface 0
- file_handle = handle_priv->interface_handle[iface].dev_handle;
- if ((file_handle == 0) || (file_handle == INVALID_HANDLE_VALUE)) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- if (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {
- handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;
- err = GetLastError();
- switch(err) {
- case ERROR_BAD_COMMAND:
- // The device was disconnected
- usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(0));
- return LIBUSB_ERROR_NO_DEVICE;
- default:
- // it may be that we're using the libusb0 filter driver.
- // TODO: can we move this whole business into the K/0 DLL?
- for (i = 0; ; i++) {
- safe_free(dev_interface_details);
- safe_free(dev_path_no_guid);
- dev_interface_details = get_interface_details_filter(ctx, &dev_info, &dev_info_data, &GUID_DEVINTERFACE_LIBUSB0_FILTER, i, filter_path);
- if ((found_filter) || (dev_interface_details == NULL)) {
- break;
- }
- // ignore GUID part
- dev_path_no_guid = sanitize_path(strtok(dev_interface_details->DevicePath, "{"));
- if (safe_strncmp(dev_path_no_guid, priv->usb_interface[iface].path, safe_strlen(dev_path_no_guid)) == 0) {
- file_handle = CreateFileA(filter_path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
- if (file_handle == INVALID_HANDLE_VALUE) {
- usbi_err(ctx, "could not open device %s: %s", filter_path, windows_error_str(0));
- } else {
- WinUSBX[sub_api].Free(winusb_handle);
- if (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {
- continue;
- }
- found_filter = true;
- break;
- }
- }
- }
- if (!found_filter) {
- usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(err));
- return LIBUSB_ERROR_ACCESS;
- }
- }
- }
- handle_priv->interface_handle[iface].api_handle = winusb_handle;
- } else {
- // For all other interfaces, use GetAssociatedInterface()
- winusb_handle = handle_priv->interface_handle[0].api_handle;
- // It is a requirement for multiple interface devices on Windows that, to you
- // must first claim the first interface before you claim the others
- if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {
- file_handle = handle_priv->interface_handle[0].dev_handle;
- if (WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {
- handle_priv->interface_handle[0].api_handle = winusb_handle;
- usbi_warn(ctx, "auto-claimed interface 0 (required to claim %d with WinUSB)", iface);
- } else {
- usbi_warn(ctx, "failed to auto-claim interface 0 (required to claim %d with WinUSB): %s", iface, windows_error_str(0));
- return LIBUSB_ERROR_ACCESS;
- }
- }
- if (!WinUSBX[sub_api].GetAssociatedInterface(winusb_handle, (UCHAR)(iface-1),
- &handle_priv->interface_handle[iface].api_handle)) {
- handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;
- switch(GetLastError()) {
- case ERROR_NO_MORE_ITEMS: // invalid iface
- return LIBUSB_ERROR_NOT_FOUND;
- case ERROR_BAD_COMMAND: // The device was disconnected
- return LIBUSB_ERROR_NO_DEVICE;
- case ERROR_ALREADY_EXISTS: // already claimed
- return LIBUSB_ERROR_BUSY;
- default:
- usbi_err(ctx, "could not claim interface %d: %s", iface, windows_error_str(0));
- return LIBUSB_ERROR_ACCESS;
- }
- }
- }
- usbi_dbg("claimed interface %d", iface);
- handle_priv->active_interface = iface;
-
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE winusb_handle;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- winusb_handle = handle_priv->interface_handle[iface].api_handle;
- if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- WinUSBX[sub_api].Free(winusb_handle);
- handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;
-
- return LIBUSB_SUCCESS;
-}
-
-/*
- * Return the first valid interface (of the same API type), for control transfers
- */
-static int get_valid_interface(struct libusb_device_handle *dev_handle, int api_id)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- int i;
-
- if ((api_id < USB_API_WINUSBX) || (api_id > USB_API_HID)) {
- usbi_dbg("unsupported API ID");
- return -1;
- }
-
- for (i=0; i<USB_MAXINTERFACES; i++) {
- if ( (handle_priv->interface_handle[i].dev_handle != 0)
- && (handle_priv->interface_handle[i].dev_handle != INVALID_HANDLE_VALUE)
- && (handle_priv->interface_handle[i].api_handle != 0)
- && (handle_priv->interface_handle[i].api_handle != INVALID_HANDLE_VALUE)
- && (priv->usb_interface[i].apib->id == api_id) ) {
- return i;
- }
- }
- return -1;
-}
-
-/*
- * Lookup interface by endpoint address. -1 if not found
- */
-static int interface_by_endpoint(struct windows_device_priv *priv,
- struct windows_device_handle_priv *handle_priv, uint8_t endpoint_address)
-{
- int i, j;
- for (i=0; i<USB_MAXINTERFACES; i++) {
- if (handle_priv->interface_handle[i].api_handle == INVALID_HANDLE_VALUE)
- continue;
- if (handle_priv->interface_handle[i].api_handle == 0)
- continue;
- if (priv->usb_interface[i].endpoint == NULL)
- continue;
- for (j=0; j<priv->usb_interface[i].nb_endpoints; j++) {
- if (priv->usb_interface[i].endpoint[j] == endpoint_address) {
- return i;
- }
- }
- }
- return -1;
-}
-
-static int winusbx_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(
- transfer->dev_handle);
- WINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer;
- ULONG size;
- HANDLE winusb_handle;
- int current_interface;
- struct winfd wfd;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- transfer_priv->pollable_fd = INVALID_WINFD;
- size = transfer->length - LIBUSB_CONTROL_SETUP_SIZE;
-
- if (size > MAX_CTRL_BUFFER_LENGTH)
- return LIBUSB_ERROR_INVALID_PARAM;
-
- current_interface = get_valid_interface(transfer->dev_handle, USB_API_WINUSBX);
- if (current_interface < 0) {
- if (auto_claim(transfer, &current_interface, USB_API_WINUSBX) != LIBUSB_SUCCESS) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
- }
-
- usbi_dbg("will use interface %d", current_interface);
- winusb_handle = handle_priv->interface_handle[current_interface].api_handle;
-
- wfd = usbi_create_fd(winusb_handle, RW_READ, NULL, NULL);
- // Always use the handle returned from usbi_create_fd (wfd.handle)
- if (wfd.fd < 0) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // Sending of set configuration control requests from WinUSB creates issues
- if ( ((setup->request_type & (0x03 << 5)) == LIBUSB_REQUEST_TYPE_STANDARD)
- && (setup->request == LIBUSB_REQUEST_SET_CONFIGURATION) ) {
- if (setup->value != priv->active_config) {
- usbi_warn(ctx, "cannot set configuration other than the default one");
- usbi_free_fd(&wfd);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
- wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;
- wfd.overlapped->InternalHigh = 0;
- } else {
- if (!WinUSBX[sub_api].ControlTransfer(wfd.handle, *setup, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, size, NULL, wfd.overlapped)) {
- if(GetLastError() != ERROR_IO_PENDING) {
- usbi_warn(ctx, "ControlTransfer failed: %s", windows_error_str(0));
- usbi_free_fd(&wfd);
- return LIBUSB_ERROR_IO;
- }
- } else {
- wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;
- wfd.overlapped->InternalHigh = (DWORD)size;
- }
- }
-
- // Use priv_transfer to store data needed for async polling
- transfer_priv->pollable_fd = wfd;
- transfer_priv->interface_number = (uint8_t)current_interface;
-
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE winusb_handle;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- if (altsetting > 255) {
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- winusb_handle = handle_priv->interface_handle[iface].api_handle;
- if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {
- usbi_err(ctx, "interface must be claimed first");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- if (!WinUSBX[sub_api].SetCurrentAlternateSetting(winusb_handle, (UCHAR)altsetting)) {
- usbi_err(ctx, "SetCurrentAlternateSetting failed: %s", windows_error_str(0));
- return LIBUSB_ERROR_IO;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- HANDLE winusb_handle;
- bool ret;
- int current_interface;
- struct winfd wfd;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- transfer_priv->pollable_fd = INVALID_WINFD;
-
- current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg("matched endpoint %02X with interface %d", transfer->endpoint, current_interface);
-
- winusb_handle = handle_priv->interface_handle[current_interface].api_handle;
-
- wfd = usbi_create_fd(winusb_handle, IS_XFERIN(transfer) ? RW_READ : RW_WRITE, NULL, NULL);
- // Always use the handle returned from usbi_create_fd (wfd.handle)
- if (wfd.fd < 0) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- if (IS_XFERIN(transfer)) {
- usbi_dbg("reading %d bytes", transfer->length);
- ret = WinUSBX[sub_api].ReadPipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped);
- } else {
- usbi_dbg("writing %d bytes", transfer->length);
- ret = WinUSBX[sub_api].WritePipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped);
- }
- if (!ret) {
- if(GetLastError() != ERROR_IO_PENDING) {
- usbi_err(ctx, "ReadPipe/WritePipe failed: %s", windows_error_str(0));
- usbi_free_fd(&wfd);
- return LIBUSB_ERROR_IO;
- }
- } else {
- wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;
- wfd.overlapped->InternalHigh = (DWORD)transfer->length;
- }
-
- transfer_priv->pollable_fd = wfd;
- transfer_priv->interface_number = (uint8_t)current_interface;
-
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE winusb_handle;
- int current_interface;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- current_interface = interface_by_endpoint(priv, handle_priv, endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cannot clear");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg("matched endpoint %02X with interface %d", endpoint, current_interface);
- winusb_handle = handle_priv->interface_handle[current_interface].api_handle;
-
- if (!WinUSBX[sub_api].ResetPipe(winusb_handle, endpoint)) {
- usbi_err(ctx, "ResetPipe failed: %s", windows_error_str(0));
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-/*
- * from http://www.winvistatips.com/winusb-bugchecks-t335323.html (confirmed
- * through testing as well):
- * "You can not call WinUsb_AbortPipe on control pipe. You can possibly cancel
- * the control transfer using CancelIo"
- */
-static int winusbx_abort_control(int sub_api, struct usbi_transfer *itransfer)
-{
- // Cancelling of the I/O is done in the parent
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_abort_transfers(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- HANDLE winusb_handle;
- int current_interface;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- current_interface = transfer_priv->interface_number;
- if ((current_interface < 0) || (current_interface >= USB_MAXINTERFACES)) {
- usbi_err(ctx, "program assertion failed: invalid interface_number");
- return LIBUSB_ERROR_NOT_FOUND;
- }
- usbi_dbg("will use interface %d", current_interface);
-
- winusb_handle = handle_priv->interface_handle[current_interface].api_handle;
-
- if (!WinUSBX[sub_api].AbortPipe(winusb_handle, transfer->endpoint)) {
- usbi_err(ctx, "AbortPipe failed: %s", windows_error_str(0));
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-/*
- * from the "How to Use WinUSB to Communicate with a USB Device" Microsoft white paper
- * (http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx):
- * "WinUSB does not support host-initiated reset port and cycle port operations" and
- * IOCTL_INTERNAL_USB_CYCLE_PORT is only available in kernel mode and the
- * IOCTL_USB_HUB_CYCLE_PORT ioctl was removed from Vista => the best we can do is
- * cycle the pipes (and even then, the control pipe can not be reset using WinUSB)
- */
-// TODO: (post hotplug): see if we can force eject the device and redetect it (reuse hotplug?)
-static int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct winfd wfd;
- HANDLE winusb_handle;
- int i, j;
-
- CHECK_WINUSBX_AVAILABLE(sub_api);
-
- // Reset any available pipe (except control)
- for (i=0; i<USB_MAXINTERFACES; i++) {
- winusb_handle = handle_priv->interface_handle[i].api_handle;
- for (wfd = handle_to_winfd(winusb_handle); wfd.fd > 0;)
- {
- // Cancel any pollable I/O
- usbi_remove_pollfd(ctx, wfd.fd);
- usbi_free_fd(&wfd);
- wfd = handle_to_winfd(winusb_handle);
- }
-
- if ( (winusb_handle != 0) && (winusb_handle != INVALID_HANDLE_VALUE)) {
- for (j=0; j<priv->usb_interface[i].nb_endpoints; j++) {
- usbi_dbg("resetting ep %02X", priv->usb_interface[i].endpoint[j]);
- if (!WinUSBX[sub_api].AbortPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) {
- usbi_err(ctx, "AbortPipe (pipe address %02X) failed: %s",
- priv->usb_interface[i].endpoint[j], windows_error_str(0));
- }
- // FlushPipe seems to fail on OUT pipes
- if (IS_EPIN(priv->usb_interface[i].endpoint[j])
- && (!WinUSBX[sub_api].FlushPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) ) {
- usbi_err(ctx, "FlushPipe (pipe address %02X) failed: %s",
- priv->usb_interface[i].endpoint[j], windows_error_str(0));
- }
- if (!WinUSBX[sub_api].ResetPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) {
- usbi_err(ctx, "ResetPipe (pipe address %02X) failed: %s",
- priv->usb_interface[i].endpoint[j], windows_error_str(0));
- }
- }
- }
- }
-
- // libusbK & libusb0 have the ability to issue an actual device reset
- if (WinUSBX[sub_api].ResetDevice != NULL) {
- winusb_handle = handle_priv->interface_handle[0].api_handle;
- if ( (winusb_handle != 0) && (winusb_handle != INVALID_HANDLE_VALUE)) {
- WinUSBX[sub_api].ResetDevice(winusb_handle);
- }
- }
- return LIBUSB_SUCCESS;
-}
-
-static int winusbx_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size)
-{
- itransfer->transferred += io_size;
- return LIBUSB_TRANSFER_COMPLETED;
-}
-
-/*
- * Internal HID Support functions (from libusb-win32)
- * Note that functions that complete data transfer synchronously must return
- * LIBUSB_COMPLETED instead of LIBUSB_SUCCESS
- */
-static int _hid_get_hid_descriptor(struct hid_device_priv* dev, void *data, size_t *size);
-static int _hid_get_report_descriptor(struct hid_device_priv* dev, void *data, size_t *size);
-
-static int _hid_wcslen(WCHAR *str)
-{
- int i = 0;
- while (str[i] && (str[i] != 0x409)) {
- i++;
- }
- return i;
-}
-
-static int _hid_get_device_descriptor(struct hid_device_priv* dev, void *data, size_t *size)
-{
- struct libusb_device_descriptor d;
-
- d.bLength = LIBUSB_DT_DEVICE_SIZE;
- d.bDescriptorType = LIBUSB_DT_DEVICE;
- d.bcdUSB = 0x0200; /* 2.00 */
- d.bDeviceClass = 0;
- d.bDeviceSubClass = 0;
- d.bDeviceProtocol = 0;
- d.bMaxPacketSize0 = 64; /* fix this! */
- d.idVendor = (uint16_t)dev->vid;
- d.idProduct = (uint16_t)dev->pid;
- d.bcdDevice = 0x0100;
- d.iManufacturer = dev->string_index[0];
- d.iProduct = dev->string_index[1];
- d.iSerialNumber = dev->string_index[2];
- d.bNumConfigurations = 1;
-
- if (*size > LIBUSB_DT_DEVICE_SIZE)
- *size = LIBUSB_DT_DEVICE_SIZE;
- memcpy(data, &d, *size);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_get_config_descriptor(struct hid_device_priv* dev, void *data, size_t *size)
-{
- char num_endpoints = 0;
- size_t config_total_len = 0;
- char tmp[HID_MAX_CONFIG_DESC_SIZE];
- struct libusb_config_descriptor *cd;
- struct libusb_interface_descriptor *id;
- struct libusb_hid_descriptor *hd;
- struct libusb_endpoint_descriptor *ed;
- size_t tmp_size;
-
- if (dev->input_report_size)
- num_endpoints++;
- if (dev->output_report_size)
- num_endpoints++;
-
- config_total_len = LIBUSB_DT_CONFIG_SIZE + LIBUSB_DT_INTERFACE_SIZE
- + LIBUSB_DT_HID_SIZE + num_endpoints * LIBUSB_DT_ENDPOINT_SIZE;
-
-
- cd = (struct libusb_config_descriptor *)tmp;
- id = (struct libusb_interface_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE);
- hd = (struct libusb_hid_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE
- + LIBUSB_DT_INTERFACE_SIZE);
- ed = (struct libusb_endpoint_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE
- + LIBUSB_DT_INTERFACE_SIZE
- + LIBUSB_DT_HID_SIZE);
-
- cd->bLength = LIBUSB_DT_CONFIG_SIZE;
- cd->bDescriptorType = LIBUSB_DT_CONFIG;
- cd->wTotalLength = (uint16_t) config_total_len;
- cd->bNumInterfaces = 1;
- cd->bConfigurationValue = 1;
- cd->iConfiguration = 0;
- cd->bmAttributes = 1 << 7; /* bus powered */
- cd->MaxPower = 50;
-
- id->bLength = LIBUSB_DT_INTERFACE_SIZE;
- id->bDescriptorType = LIBUSB_DT_INTERFACE;
- id->bInterfaceNumber = 0;
- id->bAlternateSetting = 0;
- id->bNumEndpoints = num_endpoints;
- id->bInterfaceClass = 3;
- id->bInterfaceSubClass = 0;
- id->bInterfaceProtocol = 0;
- id->iInterface = 0;
-
- tmp_size = LIBUSB_DT_HID_SIZE;
- _hid_get_hid_descriptor(dev, hd, &tmp_size);
-
- if (dev->input_report_size) {
- ed->bLength = LIBUSB_DT_ENDPOINT_SIZE;
- ed->bDescriptorType = LIBUSB_DT_ENDPOINT;
- ed->bEndpointAddress = HID_IN_EP;
- ed->bmAttributes = 3;
- ed->wMaxPacketSize = dev->input_report_size - 1;
- ed->bInterval = 10;
- ed = (struct libusb_endpoint_descriptor *)((char*)ed + LIBUSB_DT_ENDPOINT_SIZE);
- }
-
- if (dev->output_report_size) {
- ed->bLength = LIBUSB_DT_ENDPOINT_SIZE;
- ed->bDescriptorType = LIBUSB_DT_ENDPOINT;
- ed->bEndpointAddress = HID_OUT_EP;
- ed->bmAttributes = 3;
- ed->wMaxPacketSize = dev->output_report_size - 1;
- ed->bInterval = 10;
- }
-
- if (*size > config_total_len)
- *size = config_total_len;
- memcpy(data, tmp, *size);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_get_string_descriptor(struct hid_device_priv* dev, int _index,
- void *data, size_t *size)
-{
- void *tmp = NULL;
- size_t tmp_size = 0;
- int i;
-
- /* language ID, EN-US */
- char string_langid[] = {
- 0x09,
- 0x04
- };
-
- if ((*size < 2) || (*size > 255)) {
- return LIBUSB_ERROR_OVERFLOW;
- }
-
- if (_index == 0) {
- tmp = string_langid;
- tmp_size = sizeof(string_langid)+2;
- } else {
- for (i=0; i<3; i++) {
- if (_index == (dev->string_index[i])) {
- tmp = dev->string[i];
- tmp_size = (_hid_wcslen(dev->string[i])+1) * sizeof(WCHAR);
- break;
- }
- }
- if (i == 3) { // not found
- return LIBUSB_ERROR_INVALID_PARAM;
- }
- }
-
- if(!tmp_size) {
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- if (tmp_size < *size) {
- *size = tmp_size;
- }
- // 2 byte header
- ((uint8_t*)data)[0] = (uint8_t)*size;
- ((uint8_t*)data)[1] = LIBUSB_DT_STRING;
- memcpy((uint8_t*)data+2, tmp, *size-2);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_get_hid_descriptor(struct hid_device_priv* dev, void *data, size_t *size)
-{
- struct libusb_hid_descriptor d;
- uint8_t tmp[MAX_HID_DESCRIPTOR_SIZE];
- size_t report_len = MAX_HID_DESCRIPTOR_SIZE;
-
- _hid_get_report_descriptor(dev, tmp, &report_len);
-
- d.bLength = LIBUSB_DT_HID_SIZE;
- d.bDescriptorType = LIBUSB_DT_HID;
- d.bcdHID = 0x0110; /* 1.10 */
- d.bCountryCode = 0;
- d.bNumDescriptors = 1;
- d.bClassDescriptorType = LIBUSB_DT_REPORT;
- d.wClassDescriptorLength = (uint16_t)report_len;
-
- if (*size > LIBUSB_DT_HID_SIZE)
- *size = LIBUSB_DT_HID_SIZE;
- memcpy(data, &d, *size);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_get_report_descriptor(struct hid_device_priv* dev, void *data, size_t *size)
-{
- uint8_t d[MAX_HID_DESCRIPTOR_SIZE];
- size_t i = 0;
-
- /* usage page (0xFFA0 == vendor defined) */
- d[i++] = 0x06; d[i++] = 0xA0; d[i++] = 0xFF;
- /* usage (vendor defined) */
- d[i++] = 0x09; d[i++] = 0x01;
- /* start collection (application) */
- d[i++] = 0xA1; d[i++] = 0x01;
- /* input report */
- if (dev->input_report_size) {
- /* usage (vendor defined) */
- d[i++] = 0x09; d[i++] = 0x01;
- /* logical minimum (0) */
- d[i++] = 0x15; d[i++] = 0x00;
- /* logical maximum (255) */
- d[i++] = 0x25; d[i++] = 0xFF;
- /* report size (8 bits) */
- d[i++] = 0x75; d[i++] = 0x08;
- /* report count */
- d[i++] = 0x95; d[i++] = (uint8_t)dev->input_report_size - 1;
- /* input (data, variable, absolute) */
- d[i++] = 0x81; d[i++] = 0x00;
- }
- /* output report */
- if (dev->output_report_size) {
- /* usage (vendor defined) */
- d[i++] = 0x09; d[i++] = 0x02;
- /* logical minimum (0) */
- d[i++] = 0x15; d[i++] = 0x00;
- /* logical maximum (255) */
- d[i++] = 0x25; d[i++] = 0xFF;
- /* report size (8 bits) */
- d[i++] = 0x75; d[i++] = 0x08;
- /* report count */
- d[i++] = 0x95; d[i++] = (uint8_t)dev->output_report_size - 1;
- /* output (data, variable, absolute) */
- d[i++] = 0x91; d[i++] = 0x00;
- }
- /* feature report */
- if (dev->feature_report_size) {
- /* usage (vendor defined) */
- d[i++] = 0x09; d[i++] = 0x03;
- /* logical minimum (0) */
- d[i++] = 0x15; d[i++] = 0x00;
- /* logical maximum (255) */
- d[i++] = 0x25; d[i++] = 0xFF;
- /* report size (8 bits) */
- d[i++] = 0x75; d[i++] = 0x08;
- /* report count */
- d[i++] = 0x95; d[i++] = (uint8_t)dev->feature_report_size - 1;
- /* feature (data, variable, absolute) */
- d[i++] = 0xb2; d[i++] = 0x02; d[i++] = 0x01;
- }
-
- /* end collection */
- d[i++] = 0xC0;
-
- if (*size > i)
- *size = i;
- memcpy(data, d, *size);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_get_descriptor(struct hid_device_priv* dev, HANDLE hid_handle, int recipient,
- int type, int _index, void *data, size_t *size)
-{
- switch(type) {
- case LIBUSB_DT_DEVICE:
- usbi_dbg("LIBUSB_DT_DEVICE");
- return _hid_get_device_descriptor(dev, data, size);
- case LIBUSB_DT_CONFIG:
- usbi_dbg("LIBUSB_DT_CONFIG");
- if (!_index)
- return _hid_get_config_descriptor(dev, data, size);
- return LIBUSB_ERROR_INVALID_PARAM;
- case LIBUSB_DT_STRING:
- usbi_dbg("LIBUSB_DT_STRING");
- return _hid_get_string_descriptor(dev, _index, data, size);
- case LIBUSB_DT_HID:
- usbi_dbg("LIBUSB_DT_HID");
- if (!_index)
- return _hid_get_hid_descriptor(dev, data, size);
- return LIBUSB_ERROR_INVALID_PARAM;
- case LIBUSB_DT_REPORT:
- usbi_dbg("LIBUSB_DT_REPORT");
- if (!_index)
- return _hid_get_report_descriptor(dev, data, size);
- return LIBUSB_ERROR_INVALID_PARAM;
- case LIBUSB_DT_PHYSICAL:
- usbi_dbg("LIBUSB_DT_PHYSICAL");
- if (HidD_GetPhysicalDescriptor(hid_handle, data, (ULONG)*size))
- return LIBUSB_COMPLETED;
- return LIBUSB_ERROR_OTHER;
- }
- usbi_dbg("unsupported");
- return LIBUSB_ERROR_INVALID_PARAM;
-}
-
-static int _hid_get_report(struct hid_device_priv* dev, HANDLE hid_handle, int id, void *data,
- struct windows_transfer_priv *tp, size_t *size, OVERLAPPED* overlapped,
- int report_type)
-{
- uint8_t *buf;
- DWORD ioctl_code, read_size, expected_size = (DWORD)*size;
- int r = LIBUSB_SUCCESS;
-
- if (tp->hid_buffer != NULL) {
- usbi_dbg("program assertion failed: hid_buffer is not NULL");
- }
-
- if ((*size == 0) || (*size > MAX_HID_REPORT_SIZE)) {
- usbi_dbg("invalid size (%d)", *size);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- switch (report_type) {
- case HID_REPORT_TYPE_INPUT:
- ioctl_code = IOCTL_HID_GET_INPUT_REPORT;
- break;
- case HID_REPORT_TYPE_FEATURE:
- ioctl_code = IOCTL_HID_GET_FEATURE;
- break;
- default:
- usbi_dbg("unknown HID report type %d", report_type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- // Add a trailing byte to detect overflows
- buf = (uint8_t*)calloc(expected_size+1, 1);
- if (buf == NULL) {
- return LIBUSB_ERROR_NO_MEM;
- }
- buf[0] = (uint8_t)id; // Must be set always
- usbi_dbg("report ID: 0x%02X", buf[0]);
-
- tp->hid_expected_size = expected_size;
- read_size = expected_size;
-
- // NB: The size returned by DeviceIoControl doesn't include report IDs when not in use (0)
- if (!DeviceIoControl(hid_handle, ioctl_code, buf, expected_size+1,
- buf, expected_size+1, &read_size, overlapped)) {
- if (GetLastError() != ERROR_IO_PENDING) {
- usbi_dbg("Failed to Read HID Report: %s", windows_error_str(0));
- safe_free(buf);
- return LIBUSB_ERROR_IO;
- }
- // Asynchronous wait
- tp->hid_buffer = buf;
- tp->hid_dest = (uint8_t*)data; // copy dest, as not necessarily the start of the transfer buffer
- return LIBUSB_SUCCESS;
- }
-
- // Transfer completed synchronously => copy and discard extra buffer
- if (read_size == 0) {
- usbi_warn(NULL, "program assertion failed - read completed synchronously, but no data was read");
- *size = 0;
- } else {
- if (buf[0] != id) {
- usbi_warn(NULL, "mismatched report ID (data is %02X, parameter is %02X)", buf[0], id);
- }
- if ((size_t)read_size > expected_size) {
- r = LIBUSB_ERROR_OVERFLOW;
- usbi_dbg("OVERFLOW!");
- } else {
- r = LIBUSB_COMPLETED;
- }
-
- *size = MIN((size_t)read_size, *size);
- if (id == 0) {
- // Discard report ID
- memcpy(data, buf+1, *size);
- } else {
- memcpy(data, buf, *size);
- }
- }
- safe_free(buf);
- return r;
-}
-
-static int _hid_set_report(struct hid_device_priv* dev, HANDLE hid_handle, int id, void *data,
- struct windows_transfer_priv *tp, size_t *size, OVERLAPPED* overlapped,
- int report_type)
-{
- uint8_t *buf = NULL;
- DWORD ioctl_code, write_size= (DWORD)*size;
-
- if (tp->hid_buffer != NULL) {
- usbi_dbg("program assertion failed: hid_buffer is not NULL");
- }
-
- if ((*size == 0) || (*size > MAX_HID_REPORT_SIZE)) {
- usbi_dbg("invalid size (%d)", *size);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- switch (report_type) {
- case HID_REPORT_TYPE_OUTPUT:
- ioctl_code = IOCTL_HID_SET_OUTPUT_REPORT;
- break;
- case HID_REPORT_TYPE_FEATURE:
- ioctl_code = IOCTL_HID_SET_FEATURE;
- break;
- default:
- usbi_dbg("unknown HID report type %d", report_type);
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- usbi_dbg("report ID: 0x%02X", id);
- // When report IDs are not used (i.e. when id == 0), we must add
- // a null report ID. Otherwise, we just use original data buffer
- if (id == 0) {
- write_size++;
- }
- buf = (uint8_t*) malloc(write_size);
- if (buf == NULL) {
- return LIBUSB_ERROR_NO_MEM;
- }
- if (id == 0) {
- buf[0] = 0;
- memcpy(buf + 1, data, *size);
- } else {
- // This seems like a waste, but if we don't duplicate the
- // data, we'll get issues when freeing hid_buffer
- memcpy(buf, data, *size);
- if (buf[0] != id) {
- usbi_warn(NULL, "mismatched report ID (data is %02X, parameter is %02X)", buf[0], id);
- }
- }
-
- // NB: The size returned by DeviceIoControl doesn't include report IDs when not in use (0)
- if (!DeviceIoControl(hid_handle, ioctl_code, buf, write_size,
- buf, write_size, &write_size, overlapped)) {
- if (GetLastError() != ERROR_IO_PENDING) {
- usbi_dbg("Failed to Write HID Output Report: %s", windows_error_str(0));
- safe_free(buf);
- return LIBUSB_ERROR_IO;
- }
- tp->hid_buffer = buf;
- tp->hid_dest = NULL;
- return LIBUSB_SUCCESS;
- }
-
- // Transfer completed synchronously
- *size = write_size;
- if (write_size == 0) {
- usbi_dbg("program assertion failed - write completed synchronously, but no data was written");
- }
- safe_free(buf);
- return LIBUSB_COMPLETED;
-}
-
-static int _hid_class_request(struct hid_device_priv* dev, HANDLE hid_handle, int request_type,
- int request, int value, int _index, void *data, struct windows_transfer_priv *tp,
- size_t *size, OVERLAPPED* overlapped)
-{
- int report_type = (value >> 8) & 0xFF;
- int report_id = value & 0xFF;
-
- if ( (LIBUSB_REQ_RECIPIENT(request_type) != LIBUSB_RECIPIENT_INTERFACE)
- && (LIBUSB_REQ_RECIPIENT(request_type) != LIBUSB_RECIPIENT_DEVICE) )
- return LIBUSB_ERROR_INVALID_PARAM;
-
- if (LIBUSB_REQ_OUT(request_type) && request == HID_REQ_SET_REPORT)
- return _hid_set_report(dev, hid_handle, report_id, data, tp, size, overlapped, report_type);
-
- if (LIBUSB_REQ_IN(request_type) && request == HID_REQ_GET_REPORT)
- return _hid_get_report(dev, hid_handle, report_id, data, tp, size, overlapped, report_type);
-
- return LIBUSB_ERROR_INVALID_PARAM;
-}
-
-
-/*
- * HID API functions
- */
-static int hid_init(int sub_api, struct libusb_context *ctx)
-{
- DLL_LOAD(hid.dll, HidD_GetAttributes, TRUE);
- DLL_LOAD(hid.dll, HidD_GetHidGuid, TRUE);
- DLL_LOAD(hid.dll, HidD_GetPreparsedData, TRUE);
- DLL_LOAD(hid.dll, HidD_FreePreparsedData, TRUE);
- DLL_LOAD(hid.dll, HidD_GetManufacturerString, TRUE);
- DLL_LOAD(hid.dll, HidD_GetProductString, TRUE);
- DLL_LOAD(hid.dll, HidD_GetSerialNumberString, TRUE);
- DLL_LOAD(hid.dll, HidP_GetCaps, TRUE);
- DLL_LOAD(hid.dll, HidD_SetNumInputBuffers, TRUE);
- DLL_LOAD(hid.dll, HidD_SetFeature, TRUE);
- DLL_LOAD(hid.dll, HidD_GetFeature, TRUE);
- DLL_LOAD(hid.dll, HidD_GetPhysicalDescriptor, TRUE);
- DLL_LOAD(hid.dll, HidD_GetInputReport, FALSE);
- DLL_LOAD(hid.dll, HidD_SetOutputReport, FALSE);
- DLL_LOAD(hid.dll, HidD_FlushQueue, TRUE);
- DLL_LOAD(hid.dll, HidP_GetValueCaps, TRUE);
-
- api_hid_available = true;
- return LIBUSB_SUCCESS;
-}
-
-static int hid_exit(int sub_api)
-{
- return LIBUSB_SUCCESS;
-}
-
-// NB: open and close must ensure that they only handle interface of
-// the right API type, as these functions can be called wholesale from
-// composite_open(), with interfaces belonging to different APIs
-static int hid_open(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
-
- HIDD_ATTRIBUTES hid_attributes;
- PHIDP_PREPARSED_DATA preparsed_data = NULL;
- HIDP_CAPS capabilities;
- HIDP_VALUE_CAPS *value_caps;
-
- HANDLE hid_handle = INVALID_HANDLE_VALUE;
- int i, j;
- // report IDs handling
- ULONG size[3];
- const char* type[3] = {"input", "output", "feature"};
- int nb_ids[2]; // zero and nonzero report IDs
-
- CHECK_HID_AVAILABLE;
- if (priv->hid == NULL) {
- usbi_err(ctx, "program assertion failed - private HID structure is unitialized");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if ( (priv->usb_interface[i].path != NULL)
- && (priv->usb_interface[i].apib->id == USB_API_HID) ) {
- hid_handle = CreateFileA(priv->usb_interface[i].path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
- /*
- * http://www.lvr.com/hidfaq.htm: Why do I receive "Access denied" when attempting to access my HID?
- * "Windows 2000 and later have exclusive read/write access to HIDs that are configured as a system
- * keyboards or mice. An application can obtain a handle to a system keyboard or mouse by not
- * requesting READ or WRITE access with CreateFile. Applications can then use HidD_SetFeature and
- * HidD_GetFeature (if the device supports Feature reports)."
- */
- if (hid_handle == INVALID_HANDLE_VALUE) {
- usbi_warn(ctx, "could not open HID device in R/W mode (keyboard or mouse?) - trying without");
- hid_handle = CreateFileA(priv->usb_interface[i].path, 0, FILE_SHARE_WRITE | FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
- if (hid_handle == INVALID_HANDLE_VALUE) {
- usbi_err(ctx, "could not open device %s (interface %d): %s", priv->path, i, windows_error_str(0));
- switch(GetLastError()) {
- case ERROR_FILE_NOT_FOUND: // The device was disconnected
- return LIBUSB_ERROR_NO_DEVICE;
- case ERROR_ACCESS_DENIED:
- return LIBUSB_ERROR_ACCESS;
- default:
- return LIBUSB_ERROR_IO;
- }
- }
- priv->usb_interface[i].restricted_functionality = true;
- }
- handle_priv->interface_handle[i].api_handle = hid_handle;
- }
- }
-
- hid_attributes.Size = sizeof(hid_attributes);
- do {
- if (!HidD_GetAttributes(hid_handle, &hid_attributes)) {
- usbi_err(ctx, "could not gain access to HID top collection (HidD_GetAttributes)");
- break;
- }
-
- priv->hid->vid = hid_attributes.VendorID;
- priv->hid->pid = hid_attributes.ProductID;
-
- // Set the maximum available input buffer size
- for (i=32; HidD_SetNumInputBuffers(hid_handle, i); i*=2);
- usbi_dbg("set maximum input buffer size to %d", i/2);
-
- // Get the maximum input and output report size
- if (!HidD_GetPreparsedData(hid_handle, &preparsed_data) || !preparsed_data) {
- usbi_err(ctx, "could not read HID preparsed data (HidD_GetPreparsedData)");
- break;
- }
- if (HidP_GetCaps(preparsed_data, &capabilities) != HIDP_STATUS_SUCCESS) {
- usbi_err(ctx, "could not parse HID capabilities (HidP_GetCaps)");
- break;
- }
-
- // Find out if interrupt will need report IDs
- size[0] = capabilities.NumberInputValueCaps;
- size[1] = capabilities.NumberOutputValueCaps;
- size[2] = capabilities.NumberFeatureValueCaps;
- for (j=HidP_Input; j<=HidP_Feature; j++) {
- usbi_dbg("%d HID %s report value(s) found", size[j], type[j]);
- priv->hid->uses_report_ids[j] = false;
- if (size[j] > 0) {
- value_caps = (HIDP_VALUE_CAPS*) calloc(size[j], sizeof(HIDP_VALUE_CAPS));
- if ( (value_caps != NULL)
- && (HidP_GetValueCaps((HIDP_REPORT_TYPE)j, value_caps, &size[j], preparsed_data) == HIDP_STATUS_SUCCESS)
- && (size[j] >= 1) ) {
- nb_ids[0] = 0;
- nb_ids[1] = 0;
- for (i=0; i<(int)size[j]; i++) {
- usbi_dbg(" Report ID: 0x%02X", value_caps[i].ReportID);
- if (value_caps[i].ReportID != 0) {
- nb_ids[1]++;
- } else {
- nb_ids[0]++;
- }
- }
- if (nb_ids[1] != 0) {
- if (nb_ids[0] != 0) {
- usbi_warn(ctx, "program assertion failed: zero and nonzero report IDs used for %s",
- type[j]);
- }
- priv->hid->uses_report_ids[j] = true;
- }
- } else {
- usbi_warn(ctx, " could not process %s report IDs", type[j]);
- }
- safe_free(value_caps);
- }
- }
-
- // Set the report sizes
- priv->hid->input_report_size = capabilities.InputReportByteLength;
- priv->hid->output_report_size = capabilities.OutputReportByteLength;
- priv->hid->feature_report_size = capabilities.FeatureReportByteLength;
-
- // Fetch string descriptors
- priv->hid->string_index[0] = priv->dev_descriptor.iManufacturer;
- if (priv->hid->string_index[0] != 0) {
- HidD_GetManufacturerString(hid_handle, priv->hid->string[0],
- sizeof(priv->hid->string[0]));
- } else {
- priv->hid->string[0][0] = 0;
- }
- priv->hid->string_index[1] = priv->dev_descriptor.iProduct;
- if (priv->hid->string_index[1] != 0) {
- HidD_GetProductString(hid_handle, priv->hid->string[1],
- sizeof(priv->hid->string[1]));
- } else {
- priv->hid->string[1][0] = 0;
- }
- priv->hid->string_index[2] = priv->dev_descriptor.iSerialNumber;
- if (priv->hid->string_index[2] != 0) {
- HidD_GetSerialNumberString(hid_handle, priv->hid->string[2],
- sizeof(priv->hid->string[2]));
- } else {
- priv->hid->string[2][0] = 0;
- }
- } while(0);
-
- if (preparsed_data) {
- HidD_FreePreparsedData(preparsed_data);
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static void hid_close(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- HANDLE file_handle;
- int i;
-
- if (!api_hid_available)
- return;
-
- for (i = 0; i < USB_MAXINTERFACES; i++) {
- if (priv->usb_interface[i].apib->id == USB_API_HID) {
- file_handle = handle_priv->interface_handle[i].api_handle;
- if ( (file_handle != 0) && (file_handle != INVALID_HANDLE_VALUE)) {
- CloseHandle(file_handle);
- }
- }
- }
-}
-
-static int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- CHECK_HID_AVAILABLE;
-
- // NB: Disconnection detection is not possible in this function
- if (priv->usb_interface[iface].path == NULL) {
- return LIBUSB_ERROR_NOT_FOUND; // invalid iface
- }
-
- // We use dev_handle as a flag for interface claimed
- if (handle_priv->interface_handle[iface].dev_handle == INTERFACE_CLAIMED) {
- return LIBUSB_ERROR_BUSY; // already claimed
- }
-
- handle_priv->interface_handle[iface].dev_handle = INTERFACE_CLAIMED;
-
- usbi_dbg("claimed interface %d", iface);
- handle_priv->active_interface = iface;
-
- return LIBUSB_SUCCESS;
-}
-
-static int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
-
- CHECK_HID_AVAILABLE;
-
- if (priv->usb_interface[iface].path == NULL) {
- return LIBUSB_ERROR_NOT_FOUND; // invalid iface
- }
-
- if (handle_priv->interface_handle[iface].dev_handle != INTERFACE_CLAIMED) {
- return LIBUSB_ERROR_NOT_FOUND; // invalid iface
- }
-
- handle_priv->interface_handle[iface].dev_handle = INVALID_HANDLE_VALUE;
-
- return LIBUSB_SUCCESS;
-}
-
-static int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
-
- CHECK_HID_AVAILABLE;
-
- if (altsetting > 255) {
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- if (altsetting != 0) {
- usbi_err(ctx, "set interface altsetting not supported for altsetting >0");
- return LIBUSB_ERROR_NOT_SUPPORTED;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-static int hid_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- WINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer;
- HANDLE hid_handle;
- struct winfd wfd;
- int current_interface, config;
- size_t size;
- int r = LIBUSB_ERROR_INVALID_PARAM;
-
- CHECK_HID_AVAILABLE;
-
- transfer_priv->pollable_fd = INVALID_WINFD;
- safe_free(transfer_priv->hid_buffer);
- transfer_priv->hid_dest = NULL;
- size = transfer->length - LIBUSB_CONTROL_SETUP_SIZE;
-
- if (size > MAX_CTRL_BUFFER_LENGTH) {
- return LIBUSB_ERROR_INVALID_PARAM;
- }
-
- current_interface = get_valid_interface(transfer->dev_handle, USB_API_HID);
- if (current_interface < 0) {
- if (auto_claim(transfer, &current_interface, USB_API_HID) != LIBUSB_SUCCESS) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
- }
-
- usbi_dbg("will use interface %d", current_interface);
- hid_handle = handle_priv->interface_handle[current_interface].api_handle;
- // Always use the handle returned from usbi_create_fd (wfd.handle)
- wfd = usbi_create_fd(hid_handle, RW_READ, NULL, NULL);
- if (wfd.fd < 0) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- switch(LIBUSB_REQ_TYPE(setup->request_type)) {
- case LIBUSB_REQUEST_TYPE_STANDARD:
- switch(setup->request) {
- case LIBUSB_REQUEST_GET_DESCRIPTOR:
- r = _hid_get_descriptor(priv->hid, wfd.handle, LIBUSB_REQ_RECIPIENT(setup->request_type),
- (setup->value >> 8) & 0xFF, setup->value & 0xFF, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, &size);
- break;
- case LIBUSB_REQUEST_GET_CONFIGURATION:
- r = windows_get_configuration(transfer->dev_handle, &config);
- if (r == LIBUSB_SUCCESS) {
- size = 1;
- ((uint8_t*)transfer->buffer)[LIBUSB_CONTROL_SETUP_SIZE] = (uint8_t)config;
- r = LIBUSB_COMPLETED;
- }
- break;
- case LIBUSB_REQUEST_SET_CONFIGURATION:
- if (setup->value == priv->active_config) {
- r = LIBUSB_COMPLETED;
- } else {
- usbi_warn(ctx, "cannot set configuration other than the default one");
- r = LIBUSB_ERROR_INVALID_PARAM;
- }
- break;
- case LIBUSB_REQUEST_GET_INTERFACE:
- size = 1;
- ((uint8_t*)transfer->buffer)[LIBUSB_CONTROL_SETUP_SIZE] = 0;
- r = LIBUSB_COMPLETED;
- break;
- case LIBUSB_REQUEST_SET_INTERFACE:
- r = hid_set_interface_altsetting(0, transfer->dev_handle, setup->index, setup->value);
- if (r == LIBUSB_SUCCESS) {
- r = LIBUSB_COMPLETED;
- }
- break;
- default:
- usbi_warn(ctx, "unsupported HID control request");
- r = LIBUSB_ERROR_INVALID_PARAM;
- break;
- }
- break;
- case LIBUSB_REQUEST_TYPE_CLASS:
- r =_hid_class_request(priv->hid, wfd.handle, setup->request_type, setup->request, setup->value,
- setup->index, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, transfer_priv,
- &size, wfd.overlapped);
- break;
- default:
- usbi_warn(ctx, "unsupported HID control request");
- r = LIBUSB_ERROR_INVALID_PARAM;
- break;
- }
-
- if (r == LIBUSB_COMPLETED) {
- // Force request to be completed synchronously. Transferred size has been set by previous call
- wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;
- // http://msdn.microsoft.com/en-us/library/ms684342%28VS.85%29.aspx
- // set InternalHigh to the number of bytes transferred
- wfd.overlapped->InternalHigh = (DWORD)size;
- r = LIBUSB_SUCCESS;
- }
-
- if (r == LIBUSB_SUCCESS) {
- // Use priv_transfer to store data needed for async polling
- transfer_priv->pollable_fd = wfd;
- transfer_priv->interface_number = (uint8_t)current_interface;
- } else {
- usbi_free_fd(&wfd);
- }
-
- return r;
-}
-
-static int hid_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- struct winfd wfd;
- HANDLE hid_handle;
- bool direction_in, ret;
- int current_interface, length;
- DWORD size;
- int r = LIBUSB_SUCCESS;
-
- CHECK_HID_AVAILABLE;
-
- transfer_priv->pollable_fd = INVALID_WINFD;
- transfer_priv->hid_dest = NULL;
- safe_free(transfer_priv->hid_buffer);
-
- current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg("matched endpoint %02X with interface %d", transfer->endpoint, current_interface);
-
- hid_handle = handle_priv->interface_handle[current_interface].api_handle;
- direction_in = transfer->endpoint & LIBUSB_ENDPOINT_IN;
-
- wfd = usbi_create_fd(hid_handle, direction_in?RW_READ:RW_WRITE, NULL, NULL);
- // Always use the handle returned from usbi_create_fd (wfd.handle)
- if (wfd.fd < 0) {
- return LIBUSB_ERROR_NO_MEM;
- }
-
- // If report IDs are not in use, an extra prefix byte must be added
- if ( ((direction_in) && (!priv->hid->uses_report_ids[0]))
- || ((!direction_in) && (!priv->hid->uses_report_ids[1])) ) {
- length = transfer->length+1;
- } else {
- length = transfer->length;
- }
- // Add a trailing byte to detect overflows on input
- transfer_priv->hid_buffer = (uint8_t*)calloc(length+1, 1);
- if (transfer_priv->hid_buffer == NULL) {
- return LIBUSB_ERROR_NO_MEM;
- }
- transfer_priv->hid_expected_size = length;
-
- if (direction_in) {
- transfer_priv->hid_dest = transfer->buffer;
- usbi_dbg("reading %d bytes (report ID: 0x00)", length);
- ret = ReadFile(wfd.handle, transfer_priv->hid_buffer, length+1, &size, wfd.overlapped);
- } else {
- if (!priv->hid->uses_report_ids[1]) {
- memcpy(transfer_priv->hid_buffer+1, transfer->buffer, transfer->length);
- } else {
- // We could actually do without the calloc and memcpy in this case
- memcpy(transfer_priv->hid_buffer, transfer->buffer, transfer->length);
- }
- usbi_dbg("writing %d bytes (report ID: 0x%02X)", length, transfer_priv->hid_buffer[0]);
- ret = WriteFile(wfd.handle, transfer_priv->hid_buffer, length, &size, wfd.overlapped);
- }
- if (!ret) {
- if (GetLastError() != ERROR_IO_PENDING) {
- usbi_err(ctx, "HID transfer failed: %s", windows_error_str(0));
- usbi_free_fd(&wfd);
- safe_free(transfer_priv->hid_buffer);
- return LIBUSB_ERROR_IO;
- }
- } else {
- // Only write operations that completed synchronously need to free up
- // hid_buffer. For reads, copy_transfer_data() handles that process.
- if (!direction_in) {
- safe_free(transfer_priv->hid_buffer);
- }
- if (size == 0) {
- usbi_err(ctx, "program assertion failed - no data was transferred");
- size = 1;
- }
- if (size > (size_t)length) {
- usbi_err(ctx, "OVERFLOW!");
- r = LIBUSB_ERROR_OVERFLOW;
- }
- wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;
- wfd.overlapped->InternalHigh = size;
- }
-
- transfer_priv->pollable_fd = wfd;
- transfer_priv->interface_number = (uint8_t)current_interface;
-
- return r;
-}
-
-static int hid_abort_transfers(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- HANDLE hid_handle;
- int current_interface;
-
- CHECK_HID_AVAILABLE;
-
- current_interface = transfer_priv->interface_number;
- hid_handle = handle_priv->interface_handle[current_interface].api_handle;
- CancelIo(hid_handle);
-
- return LIBUSB_SUCCESS;
-}
-
-static int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- HANDLE hid_handle;
- int current_interface;
-
- CHECK_HID_AVAILABLE;
-
- // Flushing the queues on all interfaces is the best we can achieve
- for (current_interface = 0; current_interface < USB_MAXINTERFACES; current_interface++) {
- hid_handle = handle_priv->interface_handle[current_interface].api_handle;
- if ((hid_handle != 0) && (hid_handle != INVALID_HANDLE_VALUE)) {
- HidD_FlushQueue(hid_handle);
- }
- }
- return LIBUSB_SUCCESS;
-}
-
-static int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- HANDLE hid_handle;
- int current_interface;
-
- CHECK_HID_AVAILABLE;
-
- current_interface = interface_by_endpoint(priv, handle_priv, endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cannot clear");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_dbg("matched endpoint %02X with interface %d", endpoint, current_interface);
- hid_handle = handle_priv->interface_handle[current_interface].api_handle;
-
- // No endpoint selection with Microsoft's implementation, so we try to flush the
- // whole interface. Should be OK for most case scenarios
- if (!HidD_FlushQueue(hid_handle)) {
- usbi_err(ctx, "Flushing of HID queue failed: %s", windows_error_str(0));
- // Device was probably disconnected
- return LIBUSB_ERROR_NO_DEVICE;
- }
-
- return LIBUSB_SUCCESS;
-}
-
-// This extra function is only needed for HID
-static int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);
- int r = LIBUSB_TRANSFER_COMPLETED;
- uint32_t corrected_size = io_size;
-
- if (transfer_priv->hid_buffer != NULL) {
- // If we have a valid hid_buffer, it means the transfer was async
- if (transfer_priv->hid_dest != NULL) { // Data readout
- // First, check for overflow
- if (corrected_size > transfer_priv->hid_expected_size) {
- usbi_err(ctx, "OVERFLOW!");
- corrected_size = (uint32_t)transfer_priv->hid_expected_size;
- r = LIBUSB_TRANSFER_OVERFLOW;
- }
-
- if (transfer_priv->hid_buffer[0] == 0) {
- // Discard the 1 byte report ID prefix
- corrected_size--;
- memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer+1, corrected_size);
- } else {
- memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, corrected_size);
- }
- transfer_priv->hid_dest = NULL;
- }
- // For write, we just need to free the hid buffer
- safe_free(transfer_priv->hid_buffer);
- }
- itransfer->transferred += corrected_size;
- return r;
-}
-
-
-/*
- * Composite API functions
- */
-static int composite_init(int sub_api, struct libusb_context *ctx)
-{
- return LIBUSB_SUCCESS;
-}
-
-static int composite_exit(int sub_api)
-{
- return LIBUSB_SUCCESS;
-}
-
-static int composite_open(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- int r = LIBUSB_ERROR_NOT_FOUND;
- uint8_t i;
- // SUB_API_MAX+1 as the SUB_API_MAX pos is used to indicate availability of HID
- bool available[SUB_API_MAX+1] = {0};
-
- for (i=0; i<USB_MAXINTERFACES; i++) {
- switch (priv->usb_interface[i].apib->id) {
- case USB_API_WINUSBX:
- if (priv->usb_interface[i].sub_api != SUB_API_NOTSET)
- available[priv->usb_interface[i].sub_api] = true;
- break;
- case USB_API_HID:
- available[SUB_API_MAX] = true;
- break;
- default:
- break;
- }
- }
-
- for (i=0; i<SUB_API_MAX; i++) { // WinUSB-like drivers
- if (available[i]) {
- r = usb_api_backend[USB_API_WINUSBX].open(i, dev_handle);
- if (r != LIBUSB_SUCCESS) {
- return r;
- }
- }
- }
- if (available[SUB_API_MAX]) { // HID driver
- r = hid_open(SUB_API_NOTSET, dev_handle);
- }
- return r;
-}
-
-static void composite_close(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- uint8_t i;
- bool available[SUB_API_MAX];
-
- for (i = 0; i<SUB_API_MAX; i++) {
- available[i] = false;
- }
-
- for (i=0; i<USB_MAXINTERFACES; i++) {
- if ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)
- && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {
- available[priv->usb_interface[i].sub_api] = true;
- }
- }
-
- for (i=0; i<SUB_API_MAX; i++) {
- if (available[i]) {
- usb_api_backend[USB_API_WINUSBX].close(i, dev_handle);
- }
- }
-}
-
-static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- return priv->usb_interface[iface].apib->
- claim_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);
-}
-
-static int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- return priv->usb_interface[iface].apib->
- set_interface_altsetting(priv->usb_interface[iface].sub_api, dev_handle, iface, altsetting);
-}
-
-static int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- return priv->usb_interface[iface].apib->
- release_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);
-}
-
-static int composite_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int i, pass;
-
- // Interface shouldn't matter for control, but it does in practice, with Windows'
- // restrictions with regards to accessing HID keyboards and mice. Try a 2 pass approach
- for (pass = 0; pass < 2; pass++) {
- for (i=0; i<USB_MAXINTERFACES; i++) {
- if (priv->usb_interface[i].path != NULL) {
- if ((pass == 0) && (priv->usb_interface[i].restricted_functionality)) {
- usbi_dbg("trying to skip restricted interface #%d (HID keyboard or mouse?)", i);
- continue;
- }
- usbi_dbg("using interface %d", i);
- return priv->usb_interface[i].apib->submit_control_transfer(priv->usb_interface[i].sub_api, itransfer);
- }
- }
- }
-
- usbi_err(ctx, "no libusbx supported interfaces to complete request");
- return LIBUSB_ERROR_NOT_FOUND;
-}
-
-static int composite_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int current_interface;
-
- current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- return priv->usb_interface[current_interface].apib->
- submit_bulk_transfer(priv->usb_interface[current_interface].sub_api, itransfer);}
-
-static int composite_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer) {
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
- int current_interface;
-
- current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- return priv->usb_interface[current_interface].apib->
- submit_iso_transfer(priv->usb_interface[current_interface].sub_api, itransfer);}
-
-static int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
-{
- struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
- struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- int current_interface;
-
- current_interface = interface_by_endpoint(priv, handle_priv, endpoint);
- if (current_interface < 0) {
- usbi_err(ctx, "unable to match endpoint to an open interface - cannot clear");
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- return priv->usb_interface[current_interface].apib->
- clear_halt(priv->usb_interface[current_interface].sub_api, dev_handle, endpoint);}
-
-static int composite_abort_control(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
-
- return priv->usb_interface[transfer_priv->interface_number].apib->
- abort_control(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer);}
-
-static int composite_abort_transfers(int sub_api, struct usbi_transfer *itransfer)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
-
- return priv->usb_interface[transfer_priv->interface_number].apib->
- abort_transfers(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer);}
-
-static int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
-{
- struct windows_device_priv *priv = _device_priv(dev_handle->dev);
- int r;
- uint8_t i;
- bool available[SUB_API_MAX];
- for (i = 0; i<SUB_API_MAX; i++) {
- available[i] = false;
- }
- for (i=0; i<USB_MAXINTERFACES; i++) {
- if ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)
- && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {
- available[priv->usb_interface[i].sub_api] = true;
- }
- }
- for (i=0; i<SUB_API_MAX; i++) {
- if (available[i]) {
- r = usb_api_backend[USB_API_WINUSBX].reset_device(i, dev_handle);
- if (r != LIBUSB_SUCCESS) {
- return r;
- }
- }
- }
- return LIBUSB_SUCCESS;
-}
-
-static int composite_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size)
-{
- struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
- struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);
- struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
-
- return priv->usb_interface[transfer_priv->interface_number].apib->
- copy_transfer_data(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer, io_size);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.h b/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.h
deleted file mode 100644
index 5d67a562e8..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/os/windows_usb.h
+++ /dev/null
@@ -1,918 +0,0 @@
-/*
- * Windows backend for libusbx 1.0
- * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>
- * With contributions from Michael Plante, Orin Eman et al.
- * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer
- * Major code testing contribution by Xiaofan Chen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#pragma once
-
-#include "windows_common.h"
-
-#if defined(_MSC_VER)
-// disable /W4 MSVC warnings that are benign
-#pragma warning(disable:4127) // conditional expression is constant
-#pragma warning(disable:4100) // unreferenced formal parameter
-#pragma warning(disable:4214) // bit field types other than int
-#pragma warning(disable:4201) // nameless struct/union
-#endif
-
-// Missing from MSVC6 setupapi.h
-#if !defined(SPDRP_ADDRESS)
-#define SPDRP_ADDRESS 28
-#endif
-#if !defined(SPDRP_INSTALL_STATE)
-#define SPDRP_INSTALL_STATE 34
-#endif
-
-#if defined(__CYGWIN__ )
-#define _stricmp stricmp
-// cygwin produces a warning unless these prototypes are defined
-extern int _snprintf(char *buffer, size_t count, const char *format, ...);
-extern char *_strdup(const char *strSource);
-// _beginthreadex is MSVCRT => unavailable for cygwin. Fallback to using CreateThread
-#define _beginthreadex(a, b, c, d, e, f) CreateThread(a, b, (LPTHREAD_START_ROUTINE)c, d, e, f)
-#endif
-
-#define MAX_CTRL_BUFFER_LENGTH 4096
-#define MAX_USB_DEVICES 256
-#define MAX_USB_STRING_LENGTH 128
-#define MAX_HID_REPORT_SIZE 1024
-#define MAX_HID_DESCRIPTOR_SIZE 256
-#define MAX_GUID_STRING_LENGTH 40
-#define MAX_PATH_LENGTH 128
-#define MAX_KEY_LENGTH 256
-#define LIST_SEPARATOR ';'
-#define HTAB_SIZE 1021
-
-// Handle code for HID interface that have been claimed ("dibs")
-#define INTERFACE_CLAIMED ((HANDLE)(intptr_t)0xD1B5)
-// Additional return code for HID operations that completed synchronously
-#define LIBUSB_COMPLETED (LIBUSB_SUCCESS + 1)
-
-// http://msdn.microsoft.com/en-us/library/ff545978.aspx
-// http://msdn.microsoft.com/en-us/library/ff545972.aspx
-// http://msdn.microsoft.com/en-us/library/ff545982.aspx
-#if !defined(GUID_DEVINTERFACE_USB_HOST_CONTROLLER)
-const GUID GUID_DEVINTERFACE_USB_HOST_CONTROLLER = { 0x3ABF6F2D, 0x71C4, 0x462A, {0x8A, 0x92, 0x1E, 0x68, 0x61, 0xE6, 0xAF, 0x27} };
-#endif
-#if !defined(GUID_DEVINTERFACE_USB_DEVICE)
-const GUID GUID_DEVINTERFACE_USB_DEVICE = { 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED} };
-#endif
-#if !defined(GUID_DEVINTERFACE_USB_HUB)
-const GUID GUID_DEVINTERFACE_USB_HUB = { 0xF18A0E88, 0xC30C, 0x11D0, {0x88, 0x15, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8} };
-#endif
-#if !defined(GUID_DEVINTERFACE_LIBUSB0_FILTER)
-const GUID GUID_DEVINTERFACE_LIBUSB0_FILTER = { 0xF9F3FF14, 0xAE21, 0x48A0, {0x8A, 0x25, 0x80, 0x11, 0xA7, 0xA9, 0x31, 0xD9} };
-#endif
-
-
-/*
- * Multiple USB API backend support
- */
-#define USB_API_UNSUPPORTED 0
-#define USB_API_HUB 1
-#define USB_API_COMPOSITE 2
-#define USB_API_WINUSBX 3
-#define USB_API_HID 4
-#define USB_API_MAX 5
-// The following is used to indicate if the HID or composite extra props have already been set.
-#define USB_API_SET (1<<USB_API_MAX)
-
-// Sub-APIs for WinUSB-like driver APIs (WinUSB, libusbK, libusb-win32 through the libusbK DLL)
-// Must have the same values as the KUSB_DRVID enum from libusbk.h
-#define SUB_API_NOTSET -1
-#define SUB_API_LIBUSBK 0
-#define SUB_API_LIBUSB0 1
-#define SUB_API_WINUSB 2
-#define SUB_API_MAX 3
-
-#define WINUSBX_DRV_NAMES { "libusbK", "libusb0", "WinUSB"}
-
-struct windows_usb_api_backend {
- const uint8_t id;
- const char* designation;
- const char **driver_name_list; // Driver name, without .sys, e.g. "usbccgp"
- const uint8_t nb_driver_names;
- int (*init)(int sub_api, struct libusb_context *ctx);
- int (*exit)(int sub_api);
- int (*open)(int sub_api, struct libusb_device_handle *dev_handle);
- void (*close)(int sub_api, struct libusb_device_handle *dev_handle);
- int (*configure_endpoints)(int sub_api, struct libusb_device_handle *dev_handle, int iface);
- int (*claim_interface)(int sub_api, struct libusb_device_handle *dev_handle, int iface);
- int (*set_interface_altsetting)(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
- int (*release_interface)(int sub_api, struct libusb_device_handle *dev_handle, int iface);
- int (*clear_halt)(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
- int (*reset_device)(int sub_api, struct libusb_device_handle *dev_handle);
- int (*submit_bulk_transfer)(int sub_api, struct usbi_transfer *itransfer);
- int (*submit_iso_transfer)(int sub_api, struct usbi_transfer *itransfer);
- int (*submit_control_transfer)(int sub_api, struct usbi_transfer *itransfer);
- int (*abort_control)(int sub_api, struct usbi_transfer *itransfer);
- int (*abort_transfers)(int sub_api, struct usbi_transfer *itransfer);
- int (*copy_transfer_data)(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);
-};
-
-extern const struct windows_usb_api_backend usb_api_backend[USB_API_MAX];
-
-#define PRINT_UNSUPPORTED_API(fname) \
- usbi_dbg("unsupported API call for '" \
- #fname "' (unrecognized device driver)"); \
- return LIBUSB_ERROR_NOT_SUPPORTED;
-
-/*
- * private structures definition
- * with inline pseudo constructors/destructors
- */
-
-// TODO (v2+): move hid desc to libusb.h?
-struct libusb_hid_descriptor {
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint16_t bcdHID;
- uint8_t bCountryCode;
- uint8_t bNumDescriptors;
- uint8_t bClassDescriptorType;
- uint16_t wClassDescriptorLength;
-};
-#define LIBUSB_DT_HID_SIZE 9
-#define HID_MAX_CONFIG_DESC_SIZE (LIBUSB_DT_CONFIG_SIZE + LIBUSB_DT_INTERFACE_SIZE \
- + LIBUSB_DT_HID_SIZE + 2 * LIBUSB_DT_ENDPOINT_SIZE)
-#define HID_MAX_REPORT_SIZE 1024
-#define HID_IN_EP 0x81
-#define HID_OUT_EP 0x02
-#define LIBUSB_REQ_RECIPIENT(request_type) ((request_type) & 0x1F)
-#define LIBUSB_REQ_TYPE(request_type) ((request_type) & (0x03 << 5))
-#define LIBUSB_REQ_IN(request_type) ((request_type) & LIBUSB_ENDPOINT_IN)
-#define LIBUSB_REQ_OUT(request_type) (!LIBUSB_REQ_IN(request_type))
-
-// The following are used for HID reports IOCTLs
-#define HID_CTL_CODE(id) \
- CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS)
-#define HID_BUFFER_CTL_CODE(id) \
- CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define HID_IN_CTL_CODE(id) \
- CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS)
-#define HID_OUT_CTL_CODE(id) \
- CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
-
-#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100)
-#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104)
-#define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100)
-#define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101)
-
-enum libusb_hid_request_type {
- HID_REQ_GET_REPORT = 0x01,
- HID_REQ_GET_IDLE = 0x02,
- HID_REQ_GET_PROTOCOL = 0x03,
- HID_REQ_SET_REPORT = 0x09,
- HID_REQ_SET_IDLE = 0x0A,
- HID_REQ_SET_PROTOCOL = 0x0B
-};
-
-enum libusb_hid_report_type {
- HID_REPORT_TYPE_INPUT = 0x01,
- HID_REPORT_TYPE_OUTPUT = 0x02,
- HID_REPORT_TYPE_FEATURE = 0x03
-};
-
-struct hid_device_priv {
- uint16_t vid;
- uint16_t pid;
- uint8_t config;
- uint8_t nb_interfaces;
- bool uses_report_ids[3]; // input, ouptput, feature
- uint16_t input_report_size;
- uint16_t output_report_size;
- uint16_t feature_report_size;
- WCHAR string[3][MAX_USB_STRING_LENGTH];
- uint8_t string_index[3]; // man, prod, ser
-};
-
-typedef struct libusb_device_descriptor USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;
-struct windows_device_priv {
- uint8_t depth; // distance to HCD
- uint8_t port; // port number on the hub
- uint8_t active_config;
- struct libusb_device *parent_dev; // access to parent is required for usermode ops
- struct windows_usb_api_backend const *apib;
- char *path; // device interface path
- int sub_api; // for WinUSB-like APIs
- struct {
- char *path; // each interface needs a device interface path,
- struct windows_usb_api_backend const *apib; // an API backend (multiple drivers support),
- int sub_api;
- int8_t nb_endpoints; // and a set of endpoint addresses (USB_MAXENDPOINTS)
- uint8_t *endpoint;
- bool restricted_functionality; // indicates if the interface functionality is restricted
- // by Windows (eg. HID keyboards or mice cannot do R/W)
- } usb_interface[USB_MAXINTERFACES];
- struct hid_device_priv *hid;
- USB_DEVICE_DESCRIPTOR dev_descriptor;
- unsigned char **config_descriptor; // list of pointers to the cached config descriptors
-};
-
-static inline struct windows_device_priv *_device_priv(struct libusb_device *dev) {
- return (struct windows_device_priv *)dev->os_priv;
-}
-
-static inline void windows_device_priv_init(libusb_device* dev) {
- struct windows_device_priv* p = _device_priv(dev);
- int i;
- p->depth = 0;
- p->port = 0;
- p->parent_dev = NULL;
- p->path = NULL;
- p->apib = &usb_api_backend[USB_API_UNSUPPORTED];
- p->sub_api = SUB_API_NOTSET;
- p->hid = NULL;
- p->active_config = 0;
- p->config_descriptor = NULL;
- memset(&(p->dev_descriptor), 0, sizeof(USB_DEVICE_DESCRIPTOR));
- for (i=0; i<USB_MAXINTERFACES; i++) {
- p->usb_interface[i].path = NULL;
- p->usb_interface[i].apib = &usb_api_backend[USB_API_UNSUPPORTED];
- p->usb_interface[i].sub_api = SUB_API_NOTSET;
- p->usb_interface[i].nb_endpoints = 0;
- p->usb_interface[i].endpoint = NULL;
- p->usb_interface[i].restricted_functionality = false;
- }
-}
-
-static inline void windows_device_priv_release(libusb_device* dev) {
- struct windows_device_priv* p = _device_priv(dev);
- int i;
- safe_free(p->path);
- if ((dev->num_configurations > 0) && (p->config_descriptor != NULL)) {
- for (i=0; i < dev->num_configurations; i++)
- safe_free(p->config_descriptor[i]);
- }
- safe_free(p->config_descriptor);
- safe_free(p->hid);
- for (i=0; i<USB_MAXINTERFACES; i++) {
- safe_free(p->usb_interface[i].path);
- safe_free(p->usb_interface[i].endpoint);
- }
-}
-
-struct interface_handle_t {
- HANDLE dev_handle; // WinUSB needs an extra handle for the file
- HANDLE api_handle; // used by the API to communicate with the device
-};
-
-struct windows_device_handle_priv {
- int active_interface;
- struct interface_handle_t interface_handle[USB_MAXINTERFACES];
- int autoclaim_count[USB_MAXINTERFACES]; // For auto-release
-};
-
-static inline struct windows_device_handle_priv *_device_handle_priv(
- struct libusb_device_handle *handle)
-{
- return (struct windows_device_handle_priv *) handle->os_priv;
-}
-
-// used for async polling functions
-struct windows_transfer_priv {
- struct winfd pollable_fd;
- uint8_t interface_number;
- uint8_t *hid_buffer; // 1 byte extended data buffer, required for HID
- uint8_t *hid_dest; // transfer buffer destination, required for HID
- size_t hid_expected_size;
-};
-
-// used to match a device driver (including filter drivers) against a supported API
-struct driver_lookup {
- char list[MAX_KEY_LENGTH+1];// REG_MULTI_SZ list of services (driver) names
- const DWORD reg_prop; // SPDRP registry key to use to retreive list
- const char* designation; // internal designation (for debug output)
-};
-
-/* OLE32 dependency */
-DLL_DECLARE_PREFIXED(WINAPI, HRESULT, p, CLSIDFromString, (LPCOLESTR, LPCLSID));
-
-/* SetupAPI dependencies */
-DLL_DECLARE_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (const GUID*, PCSTR, HWND, DWORD));
-DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA));
-DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInterfaces, (HDEVINFO, PSP_DEVINFO_DATA,
- const GUID*, DWORD, PSP_DEVICE_INTERFACE_DATA));
-DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInterfaceDetailA, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA,
- PSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA));
-DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiDestroyDeviceInfoList, (HDEVINFO));
-DLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDevRegKey, (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM));
-DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceRegistryPropertyA, (HDEVINFO,
- PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD));
-DLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDeviceInterfaceRegKey, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, DWORD, DWORD));
-DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegQueryValueExW, (HKEY, LPCWSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD));
-DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegCloseKey, (HKEY));
-
-/*
- * Windows DDK API definitions. Most of it copied from MinGW's includes
- */
-typedef DWORD DEVNODE, DEVINST;
-typedef DEVNODE *PDEVNODE, *PDEVINST;
-typedef DWORD RETURN_TYPE;
-typedef RETURN_TYPE CONFIGRET;
-
-#define CR_SUCCESS 0x00000000
-#define CR_NO_SUCH_DEVNODE 0x0000000D
-
-#define USB_DEVICE_DESCRIPTOR_TYPE LIBUSB_DT_DEVICE
-#define USB_CONFIGURATION_DESCRIPTOR_TYPE LIBUSB_DT_CONFIG
-#define USB_STRING_DESCRIPTOR_TYPE LIBUSB_DT_STRING
-#define USB_INTERFACE_DESCRIPTOR_TYPE LIBUSB_DT_INTERFACE
-#define USB_ENDPOINT_DESCRIPTOR_TYPE LIBUSB_DT_ENDPOINT
-
-#define USB_REQUEST_GET_STATUS LIBUSB_REQUEST_GET_STATUS
-#define USB_REQUEST_CLEAR_FEATURE LIBUSB_REQUEST_CLEAR_FEATURE
-#define USB_REQUEST_SET_FEATURE LIBUSB_REQUEST_SET_FEATURE
-#define USB_REQUEST_SET_ADDRESS LIBUSB_REQUEST_SET_ADDRESS
-#define USB_REQUEST_GET_DESCRIPTOR LIBUSB_REQUEST_GET_DESCRIPTOR
-#define USB_REQUEST_SET_DESCRIPTOR LIBUSB_REQUEST_SET_DESCRIPTOR
-#define USB_REQUEST_GET_CONFIGURATION LIBUSB_REQUEST_GET_CONFIGURATION
-#define USB_REQUEST_SET_CONFIGURATION LIBUSB_REQUEST_SET_CONFIGURATION
-#define USB_REQUEST_GET_INTERFACE LIBUSB_REQUEST_GET_INTERFACE
-#define USB_REQUEST_SET_INTERFACE LIBUSB_REQUEST_SET_INTERFACE
-#define USB_REQUEST_SYNC_FRAME LIBUSB_REQUEST_SYNCH_FRAME
-
-#define USB_GET_NODE_INFORMATION 258
-#define USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION 260
-#define USB_GET_NODE_CONNECTION_NAME 261
-#define USB_GET_HUB_CAPABILITIES 271
-#if !defined(USB_GET_NODE_CONNECTION_INFORMATION_EX)
-#define USB_GET_NODE_CONNECTION_INFORMATION_EX 274
-#endif
-#if !defined(USB_GET_HUB_CAPABILITIES_EX)
-#define USB_GET_HUB_CAPABILITIES_EX 276
-#endif
-
-#ifndef METHOD_BUFFERED
-#define METHOD_BUFFERED 0
-#endif
-#ifndef FILE_ANY_ACCESS
-#define FILE_ANY_ACCESS 0x00000000
-#endif
-#ifndef FILE_DEVICE_UNKNOWN
-#define FILE_DEVICE_UNKNOWN 0x00000022
-#endif
-#ifndef FILE_DEVICE_USB
-#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN
-#endif
-
-#ifndef CTL_CODE
-#define CTL_CODE(DeviceType, Function, Method, Access)( \
- ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
-#endif
-
-typedef enum USB_CONNECTION_STATUS {
- NoDeviceConnected,
- DeviceConnected,
- DeviceFailedEnumeration,
- DeviceGeneralFailure,
- DeviceCausedOvercurrent,
- DeviceNotEnoughPower,
- DeviceNotEnoughBandwidth,
- DeviceHubNestedTooDeeply,
- DeviceInLegacyHub
-} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS;
-
-typedef enum USB_HUB_NODE {
- UsbHub,
- UsbMIParent
-} USB_HUB_NODE;
-
-/* Cfgmgr32.dll interface */
-DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG));
-DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG));
-DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG));
-DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, PCHAR, ULONG, ULONG));
-
-#define IOCTL_USB_GET_HUB_CAPABILITIES_EX \
- CTL_CODE( FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_HUB_CAPABILITIES \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_ROOT_HUB_NAME \
- CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_NODE_INFORMATION \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#define IOCTL_USB_GET_NODE_CONNECTION_NAME \
- CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-// Most of the structures below need to be packed
-#pragma pack(push, 1)
-
-typedef struct USB_INTERFACE_DESCRIPTOR {
- UCHAR bLength;
- UCHAR bDescriptorType;
- UCHAR bInterfaceNumber;
- UCHAR bAlternateSetting;
- UCHAR bNumEndpoints;
- UCHAR bInterfaceClass;
- UCHAR bInterfaceSubClass;
- UCHAR bInterfaceProtocol;
- UCHAR iInterface;
-} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR;
-
-typedef struct USB_CONFIGURATION_DESCRIPTOR {
- UCHAR bLength;
- UCHAR bDescriptorType;
- USHORT wTotalLength;
- UCHAR bNumInterfaces;
- UCHAR bConfigurationValue;
- UCHAR iConfiguration;
- UCHAR bmAttributes;
- UCHAR MaxPower;
-} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR;
-
-typedef struct USB_CONFIGURATION_DESCRIPTOR_SHORT {
- struct {
- ULONG ConnectionIndex;
- struct {
- UCHAR bmRequest;
- UCHAR bRequest;
- USHORT wValue;
- USHORT wIndex;
- USHORT wLength;
- } SetupPacket;
- } req;
- USB_CONFIGURATION_DESCRIPTOR data;
-} USB_CONFIGURATION_DESCRIPTOR_SHORT;
-
-typedef struct USB_ENDPOINT_DESCRIPTOR {
- UCHAR bLength;
- UCHAR bDescriptorType;
- UCHAR bEndpointAddress;
- UCHAR bmAttributes;
- USHORT wMaxPacketSize;
- UCHAR bInterval;
-} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR;
-
-typedef struct USB_DESCRIPTOR_REQUEST {
- ULONG ConnectionIndex;
- struct {
- UCHAR bmRequest;
- UCHAR bRequest;
- USHORT wValue;
- USHORT wIndex;
- USHORT wLength;
- } SetupPacket;
-// UCHAR Data[0];
-} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST;
-
-typedef struct USB_HUB_DESCRIPTOR {
- UCHAR bDescriptorLength;
- UCHAR bDescriptorType;
- UCHAR bNumberOfPorts;
- USHORT wHubCharacteristics;
- UCHAR bPowerOnToPowerGood;
- UCHAR bHubControlCurrent;
- UCHAR bRemoveAndPowerMask[64];
-} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR;
-
-typedef struct USB_ROOT_HUB_NAME {
- ULONG ActualLength;
- WCHAR RootHubName[1];
-} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME;
-
-typedef struct USB_ROOT_HUB_NAME_FIXED {
- ULONG ActualLength;
- WCHAR RootHubName[MAX_PATH_LENGTH];
-} USB_ROOT_HUB_NAME_FIXED;
-
-typedef struct USB_NODE_CONNECTION_NAME {
- ULONG ConnectionIndex;
- ULONG ActualLength;
- WCHAR NodeName[1];
-} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME;
-
-typedef struct USB_NODE_CONNECTION_NAME_FIXED {
- ULONG ConnectionIndex;
- ULONG ActualLength;
- WCHAR NodeName[MAX_PATH_LENGTH];
-} USB_NODE_CONNECTION_NAME_FIXED;
-
-typedef struct USB_HUB_NAME_FIXED {
- union {
- USB_ROOT_HUB_NAME_FIXED root;
- USB_NODE_CONNECTION_NAME_FIXED node;
- } u;
-} USB_HUB_NAME_FIXED;
-
-typedef struct USB_HUB_INFORMATION {
- USB_HUB_DESCRIPTOR HubDescriptor;
- BOOLEAN HubIsBusPowered;
-} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION;
-
-typedef struct USB_MI_PARENT_INFORMATION {
- ULONG NumberOfInterfaces;
-} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION;
-
-typedef struct USB_NODE_INFORMATION {
- USB_HUB_NODE NodeType;
- union {
- USB_HUB_INFORMATION HubInformation;
- USB_MI_PARENT_INFORMATION MiParentInformation;
- } u;
-} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION;
-
-typedef struct USB_PIPE_INFO {
- USB_ENDPOINT_DESCRIPTOR EndpointDescriptor;
- ULONG ScheduleOffset;
-} USB_PIPE_INFO, *PUSB_PIPE_INFO;
-
-typedef struct USB_NODE_CONNECTION_INFORMATION_EX {
- ULONG ConnectionIndex;
- USB_DEVICE_DESCRIPTOR DeviceDescriptor;
- UCHAR CurrentConfigurationValue;
- UCHAR Speed;
- BOOLEAN DeviceIsHub;
- USHORT DeviceAddress;
- ULONG NumberOfOpenPipes;
- USB_CONNECTION_STATUS ConnectionStatus;
-// USB_PIPE_INFO PipeList[0];
-} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX;
-
-typedef struct USB_HUB_CAP_FLAGS {
- ULONG HubIsHighSpeedCapable:1;
- ULONG HubIsHighSpeed:1;
- ULONG HubIsMultiTtCapable:1;
- ULONG HubIsMultiTt:1;
- ULONG HubIsRoot:1;
- ULONG HubIsArmedWakeOnConnect:1;
- ULONG ReservedMBZ:26;
-} USB_HUB_CAP_FLAGS, *PUSB_HUB_CAP_FLAGS;
-
-typedef struct USB_HUB_CAPABILITIES {
- ULONG HubIs2xCapable : 1;
-} USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES;
-
-typedef struct USB_HUB_CAPABILITIES_EX {
- USB_HUB_CAP_FLAGS CapabilityFlags;
-} USB_HUB_CAPABILITIES_EX, *PUSB_HUB_CAPABILITIES_EX;
-
-#pragma pack(pop)
-
-/* winusb.dll interface */
-
-#define SHORT_PACKET_TERMINATE 0x01
-#define AUTO_CLEAR_STALL 0x02
-#define PIPE_TRANSFER_TIMEOUT 0x03
-#define IGNORE_SHORT_PACKETS 0x04
-#define ALLOW_PARTIAL_READS 0x05
-#define AUTO_FLUSH 0x06
-#define RAW_IO 0x07
-#define MAXIMUM_TRANSFER_SIZE 0x08
-#define AUTO_SUSPEND 0x81
-#define SUSPEND_DELAY 0x83
-#define DEVICE_SPEED 0x01
-#define LowSpeed 0x01
-#define FullSpeed 0x02
-#define HighSpeed 0x03
-
-typedef enum USBD_PIPE_TYPE {
- UsbdPipeTypeControl,
- UsbdPipeTypeIsochronous,
- UsbdPipeTypeBulk,
- UsbdPipeTypeInterrupt
-} USBD_PIPE_TYPE;
-
-typedef struct {
- USBD_PIPE_TYPE PipeType;
- UCHAR PipeId;
- USHORT MaximumPacketSize;
- UCHAR Interval;
-} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION;
-
-#pragma pack(1)
-typedef struct {
- UCHAR request_type;
- UCHAR request;
- USHORT value;
- USHORT index;
- USHORT length;
-} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET;
-#pragma pack()
-
-typedef void *WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE;
-
-typedef BOOL (WINAPI *WinUsb_AbortPipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID
-);
-typedef BOOL (WINAPI *WinUsb_ControlTransfer_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- WINUSB_SETUP_PACKET SetupPacket,
- PUCHAR Buffer,
- ULONG BufferLength,
- PULONG LengthTransferred,
- LPOVERLAPPED Overlapped
-);
-typedef BOOL (WINAPI *WinUsb_FlushPipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID
-);
-typedef BOOL (WINAPI *WinUsb_Free_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle
-);
-typedef BOOL (WINAPI *WinUsb_GetAssociatedInterface_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR AssociatedInterfaceIndex,
- PWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle
-);
-typedef BOOL (WINAPI *WinUsb_GetCurrentAlternateSetting_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- PUCHAR AlternateSetting
-);
-typedef BOOL (WINAPI *WinUsb_GetDescriptor_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR DescriptorType,
- UCHAR Index,
- USHORT LanguageID,
- PUCHAR Buffer,
- ULONG BufferLength,
- PULONG LengthTransferred
-);
-typedef BOOL (WINAPI *WinUsb_GetOverlappedResult_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- LPOVERLAPPED lpOverlapped,
- LPDWORD lpNumberOfBytesTransferred,
- BOOL bWait
-);
-typedef BOOL (WINAPI *WinUsb_GetPipePolicy_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID,
- ULONG PolicyType,
- PULONG ValueLength,
- PVOID Value
-);
-typedef BOOL (WINAPI *WinUsb_GetPowerPolicy_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- ULONG PolicyType,
- PULONG ValueLength,
- PVOID Value
-);
-typedef BOOL (WINAPI *WinUsb_Initialize_t)(
- HANDLE DeviceHandle,
- PWINUSB_INTERFACE_HANDLE InterfaceHandle
-);
-typedef BOOL (WINAPI *WinUsb_QueryDeviceInformation_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- ULONG InformationType,
- PULONG BufferLength,
- PVOID Buffer
-);
-typedef BOOL (WINAPI *WinUsb_QueryInterfaceSettings_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR AlternateSettingNumber,
- PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor
-);
-typedef BOOL (WINAPI *WinUsb_QueryPipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR AlternateInterfaceNumber,
- UCHAR PipeIndex,
- PWINUSB_PIPE_INFORMATION PipeInformation
-);
-typedef BOOL (WINAPI *WinUsb_ReadPipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID,
- PUCHAR Buffer,
- ULONG BufferLength,
- PULONG LengthTransferred,
- LPOVERLAPPED Overlapped
-);
-typedef BOOL (WINAPI *WinUsb_ResetPipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID
-);
-typedef BOOL (WINAPI *WinUsb_SetCurrentAlternateSetting_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR AlternateSetting
-);
-typedef BOOL (WINAPI *WinUsb_SetPipePolicy_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID,
- ULONG PolicyType,
- ULONG ValueLength,
- PVOID Value
-);
-typedef BOOL (WINAPI *WinUsb_SetPowerPolicy_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- ULONG PolicyType,
- ULONG ValueLength,
- PVOID Value
-);
-typedef BOOL (WINAPI *WinUsb_WritePipe_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle,
- UCHAR PipeID,
- PUCHAR Buffer,
- ULONG BufferLength,
- PULONG LengthTransferred,
- LPOVERLAPPED Overlapped
-);
-typedef BOOL (WINAPI *WinUsb_ResetDevice_t)(
- WINUSB_INTERFACE_HANDLE InterfaceHandle
-);
-
-/* /!\ These must match the ones from the official libusbk.h */
-typedef enum _KUSB_FNID
-{
- KUSB_FNID_Init,
- KUSB_FNID_Free,
- KUSB_FNID_ClaimInterface,
- KUSB_FNID_ReleaseInterface,
- KUSB_FNID_SetAltInterface,
- KUSB_FNID_GetAltInterface,
- KUSB_FNID_GetDescriptor,
- KUSB_FNID_ControlTransfer,
- KUSB_FNID_SetPowerPolicy,
- KUSB_FNID_GetPowerPolicy,
- KUSB_FNID_SetConfiguration,
- KUSB_FNID_GetConfiguration,
- KUSB_FNID_ResetDevice,
- KUSB_FNID_Initialize,
- KUSB_FNID_SelectInterface,
- KUSB_FNID_GetAssociatedInterface,
- KUSB_FNID_Clone,
- KUSB_FNID_QueryInterfaceSettings,
- KUSB_FNID_QueryDeviceInformation,
- KUSB_FNID_SetCurrentAlternateSetting,
- KUSB_FNID_GetCurrentAlternateSetting,
- KUSB_FNID_QueryPipe,
- KUSB_FNID_SetPipePolicy,
- KUSB_FNID_GetPipePolicy,
- KUSB_FNID_ReadPipe,
- KUSB_FNID_WritePipe,
- KUSB_FNID_ResetPipe,
- KUSB_FNID_AbortPipe,
- KUSB_FNID_FlushPipe,
- KUSB_FNID_IsoReadPipe,
- KUSB_FNID_IsoWritePipe,
- KUSB_FNID_GetCurrentFrameNumber,
- KUSB_FNID_GetOverlappedResult,
- KUSB_FNID_GetProperty,
- KUSB_FNID_COUNT,
-} KUSB_FNID;
-
-typedef struct _KLIB_VERSION {
- INT Major;
- INT Minor;
- INT Micro;
- INT Nano;
-} KLIB_VERSION;
-typedef KLIB_VERSION* PKLIB_VERSION;
-
-typedef BOOL (WINAPI *LibK_GetProcAddress_t)(
- PVOID* ProcAddress,
- ULONG DriverID,
- ULONG FunctionID
-);
-
-typedef VOID (WINAPI *LibK_GetVersion_t)(
- PKLIB_VERSION Version
-);
-
-struct winusb_interface {
- bool initialized;
- WinUsb_AbortPipe_t AbortPipe;
- WinUsb_ControlTransfer_t ControlTransfer;
- WinUsb_FlushPipe_t FlushPipe;
- WinUsb_Free_t Free;
- WinUsb_GetAssociatedInterface_t GetAssociatedInterface;
- WinUsb_GetCurrentAlternateSetting_t GetCurrentAlternateSetting;
- WinUsb_GetDescriptor_t GetDescriptor;
- WinUsb_GetOverlappedResult_t GetOverlappedResult;
- WinUsb_GetPipePolicy_t GetPipePolicy;
- WinUsb_GetPowerPolicy_t GetPowerPolicy;
- WinUsb_Initialize_t Initialize;
- WinUsb_QueryDeviceInformation_t QueryDeviceInformation;
- WinUsb_QueryInterfaceSettings_t QueryInterfaceSettings;
- WinUsb_QueryPipe_t QueryPipe;
- WinUsb_ReadPipe_t ReadPipe;
- WinUsb_ResetPipe_t ResetPipe;
- WinUsb_SetCurrentAlternateSetting_t SetCurrentAlternateSetting;
- WinUsb_SetPipePolicy_t SetPipePolicy;
- WinUsb_SetPowerPolicy_t SetPowerPolicy;
- WinUsb_WritePipe_t WritePipe;
- WinUsb_ResetDevice_t ResetDevice;
-};
-
-/* hid.dll interface */
-
-#define HIDP_STATUS_SUCCESS 0x110000
-typedef void* PHIDP_PREPARSED_DATA;
-
-#pragma pack(1)
-typedef struct {
- ULONG Size;
- USHORT VendorID;
- USHORT ProductID;
- USHORT VersionNumber;
-} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
-#pragma pack()
-
-typedef USHORT USAGE;
-typedef struct {
- USAGE Usage;
- USAGE UsagePage;
- USHORT InputReportByteLength;
- USHORT OutputReportByteLength;
- USHORT FeatureReportByteLength;
- USHORT Reserved[17];
- USHORT NumberLinkCollectionNodes;
- USHORT NumberInputButtonCaps;
- USHORT NumberInputValueCaps;
- USHORT NumberInputDataIndices;
- USHORT NumberOutputButtonCaps;
- USHORT NumberOutputValueCaps;
- USHORT NumberOutputDataIndices;
- USHORT NumberFeatureButtonCaps;
- USHORT NumberFeatureValueCaps;
- USHORT NumberFeatureDataIndices;
-} HIDP_CAPS, *PHIDP_CAPS;
-
-typedef enum _HIDP_REPORT_TYPE {
- HidP_Input,
- HidP_Output,
- HidP_Feature
-} HIDP_REPORT_TYPE;
-
-typedef struct _HIDP_VALUE_CAPS {
- USAGE UsagePage;
- UCHAR ReportID;
- BOOLEAN IsAlias;
- USHORT BitField;
- USHORT LinkCollection;
- USAGE LinkUsage;
- USAGE LinkUsagePage;
- BOOLEAN IsRange;
- BOOLEAN IsStringRange;
- BOOLEAN IsDesignatorRange;
- BOOLEAN IsAbsolute;
- BOOLEAN HasNull;
- UCHAR Reserved;
- USHORT BitSize;
- USHORT ReportCount;
- USHORT Reserved2[5];
- ULONG UnitsExp;
- ULONG Units;
- LONG LogicalMin, LogicalMax;
- LONG PhysicalMin, PhysicalMax;
- union {
- struct {
- USAGE UsageMin, UsageMax;
- USHORT StringMin, StringMax;
- USHORT DesignatorMin, DesignatorMax;
- USHORT DataIndexMin, DataIndexMax;
- } Range;
- struct {
- USAGE Usage, Reserved1;
- USHORT StringIndex, Reserved2;
- USHORT DesignatorIndex, Reserved3;
- USHORT DataIndex, Reserved4;
- } NotRange;
- } u;
-} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
-
-DLL_DECLARE(WINAPI, BOOL, HidD_GetAttributes, (HANDLE, PHIDD_ATTRIBUTES));
-DLL_DECLARE(WINAPI, VOID, HidD_GetHidGuid, (LPGUID));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetPreparsedData, (HANDLE, PHIDP_PREPARSED_DATA *));
-DLL_DECLARE(WINAPI, BOOL, HidD_FreePreparsedData, (PHIDP_PREPARSED_DATA));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetManufacturerString, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetProductString, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetSerialNumberString, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, LONG, HidP_GetCaps, (PHIDP_PREPARSED_DATA, PHIDP_CAPS));
-DLL_DECLARE(WINAPI, BOOL, HidD_SetNumInputBuffers, (HANDLE, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_SetFeature, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetFeature, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetPhysicalDescriptor, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_GetInputReport, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_SetOutputReport, (HANDLE, PVOID, ULONG));
-DLL_DECLARE(WINAPI, BOOL, HidD_FlushQueue, (HANDLE));
-DLL_DECLARE(WINAPI, BOOL, HidP_GetValueCaps, (HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PULONG, PHIDP_PREPARSED_DATA));
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/strerror.c b/src/3rd_party-static/libusbx-1.0.16/libusb/strerror.c
deleted file mode 100644
index a3c3afa3fc..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/strerror.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * libusb strerror code
- * Copyright © 2013 Hans de Goede <hdegoede@redhat.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "config.h"
-
-#include <locale.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libusb.h"
-#include "libusbi.h"
-
-#if defined(_MSC_VER)
-#define strncasecmp _strnicmp
-#endif
-
-static size_t usbi_locale = 0;
-
-/** \ingroup misc
- * How to add a new \ref libusb_strerror() translation:
- * <ol>
- * <li> Download the latest \c strerror.c from:<br>
- * https://raw.github.com/libusbx/libusbx/master/libusb/sterror.c </li>
- * <li> Open the file in an UTF-8 capable editor </li>
- * <li> Add the 2 letter <a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO 639-1</a>
- * code for your locale at the end of \c usbi_locale_supported[]<br>
- * Eg. for Chinese, you would add "zh" so that:
- * \code... usbi_locale_supported[] = { "en", "nl", "fr" };\endcode
- * becomes:
- * \code... usbi_locale_supported[] = { "en", "nl", "fr", "zh" };\endcode </li>
- * <li> Copy the <tt>{ / * English (en) * / ... }</tt> section and add it at the end of \c usbi_localized_errors<br>
- * Eg. for Chinese, the last section of \c usbi_localized_errors could look like:
- * \code
- * }, { / * Chinese (zh) * /
- * "Success",
- * ...
- * "Other error",
- * }
- * };\endcode </li>
- * <li> Translate each of the English messages from the section you copied into your language </li>
- * <li> Save the file (in UTF-8 format) and send it to \c libusbx-devel@lists.sourceforge.net </li>
- * </ol>
- */
-
-static const char* usbi_locale_supported[] = { "en", "nl", "fr" };
-static const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUSB_ERROR_COUNT] = {
- { /* English (en) */
- "Success",
- "Input/Output Error",
- "Invalid parameter",
- "Access denied (insufficient permissions)",
- "No such device (it may have been disconnected)",
- "Entity not found",
- "Resource busy",
- "Operation timed out",
- "Overflow",
- "Pipe error",
- "System call interrupted (perhaps due to signal)",
- "Insufficient memory",
- "Operation not supported or unimplemented on this platform",
- "Other error",
- }, { /* Dutch (nl) */
- "Gelukt",
- "Invoer-/uitvoerfout",
- "Ongeldig argument",
- "Toegang geweigerd (onvoldoende toegangsrechten)",
- "Apparaat bestaat niet (verbinding met apparaat verbroken?)",
- "Niet gevonden",
- "Apparaat of hulpbron is bezig",
- "Bewerking verlopen",
- "Waarde is te groot",
- "Gebroken pijp",
- "Onderbroken systeemaanroep",
- "Onvoldoende geheugen beschikbaar",
- "Bewerking wordt niet ondersteund",
- "Andere fout",
- }, { /* French (fr) */
- "Succès",
- "Erreur d'entrée/sortie",
- "Paramètre invalide",
- "Accès refusé (permissions insuffisantes)",
- "Périphérique introuvable (peut-être déconnecté)",
- "Elément introuvable",
- "Resource déjà occupée",
- "Operation expirée",
- "Débordement",
- "Erreur de pipe",
- "Appel système abandonné (peut-être à cause d’un signal)",
- "Mémoire insuffisante",
- "Opération non supportée or non implémentée sur cette plateforme",
- "Autre erreur"
- }
-};
-
-/** \ingroup misc
- * Set the language, and only the language, not the encoding! used for
- * translatable libusb messages.
- *
- * This takes a locale string in the default setlocale format: lang[-region]
- * or lang[_country_region][.codeset]. Only the lang part of the string is
- * used, and only 2 letter ISO 639-1 codes are accepted for it, such as "de".
- * The optional region, country_region or codeset parts are ignored. This
- * means that functions which return translatable strings will NOT honor the
- * specified encoding.
- * All strings returned are encoded as UTF-8 strings.
- *
- * If libusb_setlocale() is not called, all messages will be in English.
- *
- * The following functions return translatable strings: libusb_strerror().
- * Note that the libusb log messages controlled through libusb_set_debug()
- * are not translated, they are always in English.
- *
- * For POSIX UTF-8 environments if you want libusb to follow the standard
- * locale settings, call libusb_setlocale(setlocale(LC_MESSAGES, NULL)),
- * after your app has done its locale setup.
- *
- * \param locale locale-string in the form of lang[_country_region][.codeset]
- * or lang[-region], where lang is a 2 letter ISO 639-1 code
- * \returns LIBUSB_SUCCESS on success
- * \returns LIBUSB_ERROR_INVALID_PARAM if the locale doesn't meet the requirements
- * \returns LIBUSB_ERROR_NOT_FOUND if the requested language is not supported
- * \returns a LIBUSB_ERROR code on other errors
- */
-
-int API_EXPORTED libusb_setlocale(const char *locale)
-{
- size_t i;
-
- if ( (locale == NULL) || (strlen(locale) < 2)
- || ((strlen(locale) > 2) && (locale[2] != '-') && (locale[2] != '_') && (locale[2] != '.')) )
- return LIBUSB_ERROR_INVALID_PARAM;
-
- for (i=0; i<ARRAYSIZE(usbi_locale_supported); i++) {
- if (strncasecmp(usbi_locale_supported[i], locale, 2) == 0)
- break;
- }
- if (i >= ARRAYSIZE(usbi_locale_supported)) {
- return LIBUSB_ERROR_NOT_FOUND;
- }
-
- usbi_locale = i;
-
- return LIBUSB_SUCCESS;
-}
-
-/** \ingroup misc
- * Returns a constant string with a short description of the given error code,
- * this description is intended for displaying to the end user and will be in
- * the language set by libusb_setlocale().
- *
- * The returned string is encoded in UTF-8.
- *
- * The messages always start with a capital letter and end without any dot.
- * The caller must not free() the returned string.
- *
- * \param errcode the error code whose description is desired
- * \returns a short description of the error code in UTF-8 encoding
- */
-DEFAULT_VISIBILITY const char* LIBUSB_CALL libusb_strerror(enum libusb_error errcode)
-{
- int errcode_index = -errcode;
-
- if ((errcode_index < 0) || (errcode_index >= LIBUSB_ERROR_COUNT)) {
- /* "Other Error", which should always be our last message, is returned */
- errcode_index = LIBUSB_ERROR_COUNT - 1;
- }
-
- return usbi_localized_errors[usbi_locale][errcode_index];
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/sync.c b/src/3rd_party-static/libusbx-1.0.16/libusb/sync.c
deleted file mode 100644
index 42e486db39..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/sync.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Synchronous I/O functions for libusbx
- * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libusbi.h"
-
-/**
- * @defgroup syncio Synchronous device I/O
- *
- * This page documents libusbx's synchronous (blocking) API for USB device I/O.
- * This interface is easy to use but has some limitations. More advanced users
- * may wish to consider using the \ref asyncio "asynchronous I/O API" instead.
- */
-
-static void LIBUSB_CALL sync_transfer_cb(struct libusb_transfer *transfer)
-{
- int *completed = transfer->user_data;
- *completed = 1;
- usbi_dbg("actual_length=%d", transfer->actual_length);
- /* caller interprets result and frees transfer */
-}
-
-static void sync_transfer_wait_for_completion(struct libusb_transfer *transfer)
-{
- int r, *completed = transfer->user_data;
- struct libusb_context *ctx = HANDLE_CTX(transfer->dev_handle);
-
- while (!*completed) {
- r = libusb_handle_events_completed(ctx, completed);
- if (r < 0) {
- if (r == LIBUSB_ERROR_INTERRUPTED)
- continue;
- usbi_err(ctx, "libusb_handle_events failed: %s, cancelling transfer and retrying",
- libusb_error_name(r));
- libusb_cancel_transfer(transfer);
- continue;
- }
- }
-}
-
-/** \ingroup syncio
- * Perform a USB control transfer.
- *
- * The direction of the transfer is inferred from the bmRequestType field of
- * the setup packet.
- *
- * The wValue, wIndex and wLength fields values should be given in host-endian
- * byte order.
- *
- * \param dev_handle a handle for the device to communicate with
- * \param bmRequestType the request type field for the setup packet
- * \param bRequest the request field for the setup packet
- * \param wValue the value field for the setup packet
- * \param wIndex the index field for the setup packet
- * \param data a suitably-sized data buffer for either input or output
- * (depending on direction bits within bmRequestType)
- * \param wLength the length field for the setup packet. The data buffer should
- * be at least this size.
- * \param timeout timeout (in millseconds) that this function should wait
- * before giving up due to no response being received. For an unlimited
- * timeout, use value 0.
- * \returns on success, the number of bytes actually transferred
- * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out
- * \returns LIBUSB_ERROR_PIPE if the control request was not supported by the
- * device
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failures
- */
-int API_EXPORTED libusb_control_transfer(libusb_device_handle *dev_handle,
- uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
- unsigned char *data, uint16_t wLength, unsigned int timeout)
-{
- struct libusb_transfer *transfer = libusb_alloc_transfer(0);
- unsigned char *buffer;
- int completed = 0;
- int r;
-
- if (!transfer)
- return LIBUSB_ERROR_NO_MEM;
-
- buffer = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);
- if (!buffer) {
- libusb_free_transfer(transfer);
- return LIBUSB_ERROR_NO_MEM;
- }
-
- libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,
- wLength);
- if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
- memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
-
- libusb_fill_control_transfer(transfer, dev_handle, buffer,
- sync_transfer_cb, &completed, timeout);
- transfer->flags = LIBUSB_TRANSFER_FREE_BUFFER;
- r = libusb_submit_transfer(transfer);
- if (r < 0) {
- libusb_free_transfer(transfer);
- return r;
- }
-
- sync_transfer_wait_for_completion(transfer);
-
- if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
- memcpy(data, libusb_control_transfer_get_data(transfer),
- transfer->actual_length);
-
- switch (transfer->status) {
- case LIBUSB_TRANSFER_COMPLETED:
- r = transfer->actual_length;
- break;
- case LIBUSB_TRANSFER_TIMED_OUT:
- r = LIBUSB_ERROR_TIMEOUT;
- break;
- case LIBUSB_TRANSFER_STALL:
- r = LIBUSB_ERROR_PIPE;
- break;
- case LIBUSB_TRANSFER_NO_DEVICE:
- r = LIBUSB_ERROR_NO_DEVICE;
- break;
- case LIBUSB_TRANSFER_OVERFLOW:
- r = LIBUSB_ERROR_OVERFLOW;
- break;
- case LIBUSB_TRANSFER_ERROR:
- case LIBUSB_TRANSFER_CANCELLED:
- r = LIBUSB_ERROR_IO;
- break;
- default:
- usbi_warn(HANDLE_CTX(dev_handle),
- "unrecognised status code %d", transfer->status);
- r = LIBUSB_ERROR_OTHER;
- }
-
- libusb_free_transfer(transfer);
- return r;
-}
-
-static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle,
- unsigned char endpoint, unsigned char *buffer, int length,
- int *transferred, unsigned int timeout, unsigned char type)
-{
- struct libusb_transfer *transfer = libusb_alloc_transfer(0);
- int completed = 0;
- int r;
-
- if (!transfer)
- return LIBUSB_ERROR_NO_MEM;
-
- libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length,
- sync_transfer_cb, &completed, timeout);
- transfer->type = type;
-
- r = libusb_submit_transfer(transfer);
- if (r < 0) {
- libusb_free_transfer(transfer);
- return r;
- }
-
- sync_transfer_wait_for_completion(transfer);
-
- *transferred = transfer->actual_length;
- switch (transfer->status) {
- case LIBUSB_TRANSFER_COMPLETED:
- r = 0;
- break;
- case LIBUSB_TRANSFER_TIMED_OUT:
- r = LIBUSB_ERROR_TIMEOUT;
- break;
- case LIBUSB_TRANSFER_STALL:
- r = LIBUSB_ERROR_PIPE;
- break;
- case LIBUSB_TRANSFER_OVERFLOW:
- r = LIBUSB_ERROR_OVERFLOW;
- break;
- case LIBUSB_TRANSFER_NO_DEVICE:
- r = LIBUSB_ERROR_NO_DEVICE;
- break;
- case LIBUSB_TRANSFER_ERROR:
- case LIBUSB_TRANSFER_CANCELLED:
- r = LIBUSB_ERROR_IO;
- break;
- default:
- usbi_warn(HANDLE_CTX(dev_handle),
- "unrecognised status code %d", transfer->status);
- r = LIBUSB_ERROR_OTHER;
- }
-
- libusb_free_transfer(transfer);
- return r;
-}
-
-/** \ingroup syncio
- * Perform a USB bulk transfer. The direction of the transfer is inferred from
- * the direction bits of the endpoint address.
- *
- * For bulk reads, the <tt>length</tt> field indicates the maximum length of
- * data you are expecting to receive. If less data arrives than expected,
- * this function will return that data, so be sure to check the
- * <tt>transferred</tt> output parameter.
- *
- * You should also check the <tt>transferred</tt> parameter for bulk writes.
- * Not all of the data may have been written.
- *
- * Also check <tt>transferred</tt> when dealing with a timeout error code.
- * libusbx may have to split your transfer into a number of chunks to satisfy
- * underlying O/S requirements, meaning that the timeout may expire after
- * the first few chunks have completed. libusbx is careful not to lose any data
- * that may have been transferred; do not assume that timeout conditions
- * indicate a complete lack of I/O.
- *
- * \param dev_handle a handle for the device to communicate with
- * \param endpoint the address of a valid endpoint to communicate with
- * \param data a suitably-sized data buffer for either input or output
- * (depending on endpoint)
- * \param length for bulk writes, the number of bytes from data to be sent. for
- * bulk reads, the maximum number of bytes to receive into the data buffer.
- * \param transferred output location for the number of bytes actually
- * transferred.
- * \param timeout timeout (in millseconds) that this function should wait
- * before giving up due to no response being received. For an unlimited
- * timeout, use value 0.
- *
- * \returns 0 on success (and populates <tt>transferred</tt>)
- * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates
- * <tt>transferred</tt>)
- * \returns LIBUSB_ERROR_PIPE if the endpoint halted
- * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see
- * \ref packetoverflow
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other failures
- */
-int API_EXPORTED libusb_bulk_transfer(struct libusb_device_handle *dev_handle,
- unsigned char endpoint, unsigned char *data, int length, int *transferred,
- unsigned int timeout)
-{
- return do_sync_bulk_transfer(dev_handle, endpoint, data, length,
- transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK);
-}
-
-/** \ingroup syncio
- * Perform a USB interrupt transfer. The direction of the transfer is inferred
- * from the direction bits of the endpoint address.
- *
- * For interrupt reads, the <tt>length</tt> field indicates the maximum length
- * of data you are expecting to receive. If less data arrives than expected,
- * this function will return that data, so be sure to check the
- * <tt>transferred</tt> output parameter.
- *
- * You should also check the <tt>transferred</tt> parameter for interrupt
- * writes. Not all of the data may have been written.
- *
- * Also check <tt>transferred</tt> when dealing with a timeout error code.
- * libusbx may have to split your transfer into a number of chunks to satisfy
- * underlying O/S requirements, meaning that the timeout may expire after
- * the first few chunks have completed. libusbx is careful not to lose any data
- * that may have been transferred; do not assume that timeout conditions
- * indicate a complete lack of I/O.
- *
- * The default endpoint bInterval value is used as the polling interval.
- *
- * \param dev_handle a handle for the device to communicate with
- * \param endpoint the address of a valid endpoint to communicate with
- * \param data a suitably-sized data buffer for either input or output
- * (depending on endpoint)
- * \param length for bulk writes, the number of bytes from data to be sent. for
- * bulk reads, the maximum number of bytes to receive into the data buffer.
- * \param transferred output location for the number of bytes actually
- * transferred.
- * \param timeout timeout (in millseconds) that this function should wait
- * before giving up due to no response being received. For an unlimited
- * timeout, use value 0.
- *
- * \returns 0 on success (and populates <tt>transferred</tt>)
- * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out
- * \returns LIBUSB_ERROR_PIPE if the endpoint halted
- * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see
- * \ref packetoverflow
- * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
- * \returns another LIBUSB_ERROR code on other error
- */
-int API_EXPORTED libusb_interrupt_transfer(
- struct libusb_device_handle *dev_handle, unsigned char endpoint,
- unsigned char *data, int length, int *transferred, unsigned int timeout)
-{
- return do_sync_bulk_transfer(dev_handle, endpoint, data, length,
- transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT);
-}
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/version.h b/src/3rd_party-static/libusbx-1.0.16/libusb/version.h
deleted file mode 100644
index cf37de97a5..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/version.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */
-#include "version_nano.h"
-#ifndef LIBUSB_MAJOR
-#define LIBUSB_MAJOR 1
-#endif
-#ifndef LIBUSB_MINOR
-#define LIBUSB_MINOR 0
-#endif
-#ifndef LIBUSB_MICRO
-#define LIBUSB_MICRO 16
-#endif
-#ifndef LIBUSB_NANO
-#define LIBUSB_NANO 0
-#endif
-/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
-#ifndef LIBUSB_RC
-#define LIBUSB_RC ""
-#endif
diff --git a/src/3rd_party-static/libusbx-1.0.16/libusb/version_nano.h b/src/3rd_party-static/libusbx-1.0.16/libusb/version_nano.h
deleted file mode 100644
index 525cd7d52d..0000000000
--- a/src/3rd_party-static/libusbx-1.0.16/libusb/version_nano.h
+++ /dev/null
@@ -1 +0,0 @@
-#define LIBUSB_NANO 10774
diff --git a/src/3rd_party-static/message_broker/CMakeLists.txt b/src/3rd_party-static/message_broker/CMakeLists.txt
deleted file mode 100644
index 348d050887..0000000000
--- a/src/3rd_party-static/message_broker/CMakeLists.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2016, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-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/message_broker/include/CMessageBroker.hpp b/src/3rd_party-static/message_broker/include/CMessageBroker.hpp
deleted file mode 100644
index c542043796..0000000000
--- a/src/3rd_party-static/message_broker/include/CMessageBroker.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * \file CMessageBroker.hpp
- * \brief CMessageBroker singletone class header.
- * \author AKara
- */
-
-#ifndef CMESSAGEBROKER_H
-#define CMESSAGEBROKER_H
-
-#include <string>
-
-#include "CSender.hpp"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \enum ErrorCode
- * \brief MessageBroker error codes.
- * \note Value from -32099 to -32000 are reserved for implementation-defined server-errors.
- */
- enum ErrorCode
- {
- CONTROLLER_EXISTS = -32000, /**< Controller has been already registered. */
- SUBSCRIBTION_EXISTS = -32001, /**< Property has been already subscribed by this controller. */
- PARSING_ERROR = -32700, /**< Invalid JSON. An error occurred on the server while parsing the JSON text. */
- INVALID_REQUEST = -32600, /**< The received JSON not a valid MessageBroker Request. */
- METHOD_NOT_FOUND = -32601, /**< The requested remote-procedure does not exist / is not available. */
- INVALID_PARAMS = -32602, /**< Invalid method parameters. */
- INTERNAL_ERROR = -32603, /**< Internal MessageBroker error. */
- UNSUPPORTED_RESOURCE = 2 /**< Controller doesn't registered. */
- };
-
- /**
- * \brief Forward declaration of the private class.
- */
- class CMessageBroker_Private;
-
- /**
- * \class CMessageBroker
- * \brief Singletone CMessageBroker class implementation.
- */
- class CMessageBroker
- {
- public:
- /**
- * \brief Singletone instantiator.
- * \return pointer to CMessageBroker instance.
- */
- static CMessageBroker* getInstance();
-
- /**
- * \brief Destructor.
- */
- ~CMessageBroker();
-
- /**
- * \brief Receive data from TCP server (from client).
- * \param fd FileDescriptor of socket.
- * \param aJSONData JSON string.
- * \param tryHard give up on first JSON parse error or try to workaround it.
- */
- void onMessageReceived(int fd, std::string& aJSONData, bool tryHard);
-
- /**
- * \brief Test of buffer parsing.
- */
- void Test();
-
- /**
- * @brief OnSocketClosed should be called if socked is closed by HMI
- * @param fd socket descriptor
- */
- void OnSocketClosed(const int fd);
-
- /**
- * \brief Starts MessageBroker.
- */
- void startMessageBroker(CSender* pSender);
-
- /**
- * \brief Stops MessageBroker.
- */
- void stopMessageBroker();
-
- /**
- * \brief Method for thread with que processing.
- */
- void* MethodForThread(void * arg);
-
- private:
- /**
- * \brief Private constructor.
- */
- CMessageBroker();
-
- /**
- * \brief The PIMPL of the class.
- */
- CMessageBroker_Private *p;
- };
-} /* namespace NsMessageBroker */
-
-#endif // CMESSAGEBROKER_H
-
diff --git a/src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp b/src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp
deleted file mode 100644
index 001f978bbf..0000000000
--- a/src/3rd_party-static/message_broker/include/CMessageBrokerRegistry.hpp
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef CMESSAGEBROKERREGISTRY_H
-#define CMESSAGEBROKERREGISTRY_H
-
-#include <map>
-#include <vector>
-#include <iostream>
-#include <string>
-#include "utils/lock.h"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
- /**
- * \class CMessageBrokerRegistry
- * \brief Singletone CMessageBrokerRegistry class implementation.
- */
- class CMessageBrokerRegistry
- {
- public:
- /**
- * \brief Singletone instantiator.
- * \return pointer to CMessageBroker instance
- */
- static CMessageBrokerRegistry* getInstance();
-
- /**
- * \brief Destructor.
- */
- ~CMessageBrokerRegistry();
-
- /**
- * \brief adds controller to the registry.
- * \param fd file descriptor of controller.
- * \param name name of controller.
- * \return false if already exist.
- */
- bool addController(int fd, std::string name);
-
- /**
- * \brief deletes controller from the registry.
- * \param name name of controller.
- */
- void deleteController(std::string name);
-
- /**
- * \brief Remove all controllers by descriptor
- * \param fd descriptor
- */
- void removeControllersByDescriptor(const int fd);
-
- /**
- * \brief Remove all subscribers by descriptor
- * \param fd descriptor
- */
- void removeSubscribersByDescriptor(const int fd);
-
- /**
- * \brief adds notification subscriber to the registry.
- * \param fd file descriptor of controller.
- * \param name name of property which should be observed.
- * \return false if already exist.
- */
- bool addSubscriber(int fd, std::string name);
-
- /**
- * \brief deletes notification subscriber from the registry.
- * \param fd file descriptor of controller.
- * \param name name of property which should be observed.
- */
- void deleteSubscriber(int fd, std::string name);
-
- /**
- * \brief gets controller fd from the registry by name.
- * \param name name of controller.
- * \return file descriptor of controller.
- */
- int getDestinationFd(std::string name);
-
- /**
- * \brief gets subscribers fd's.
- * \param name name of property.
- * \param result vector for results.
- * \return count of subscribers.
- */
- int getSubscribersFd(std::string name, std::vector<int>& result);
- private:
- /**
- * \brief Constructor.
- */
- CMessageBrokerRegistry();
-
- /**
- * \brief Map to store controllers information like ComponentName:socketFd.
- * For example PhoneController:1080
- */
- std::map <std::string, int> mControllersList;
- sync_primitives::Lock mControllersListLock;
-
- /**
- * \brief Map to store subscribers information like ComponentName.PropertyName:socketFd:.
- * For example PhoneController.onPhoneBookChanged:1080
- */
- std::multimap <std::string, int> mSubscribersList;
- sync_primitives::Lock mSubscribersListLock;
- };
-} /* namespace NsMessageBroker */
-
-#endif // CMESSAGEBROKERREGISTRY_H
-
diff --git a/src/3rd_party-static/message_broker/include/CSender.hpp b/src/3rd_party-static/message_broker/include/CSender.hpp
deleted file mode 100644
index 78faf7dad2..0000000000
--- a/src/3rd_party-static/message_broker/include/CSender.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * \file CSender.hpp
- * \brief CSender class header.
- * \author AKara
- */
-
-#ifndef CSENDER_H
-#define CSENDER_H
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-typedef int ssize_t;
-#endif
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \class CSender
- * \brief CSender interface class implementation.
- */
- class CSender
- {
- public:
- /**
- * \brief Constructor.
- */
- CSender()
- {
- }
-
- /**
- * \brief Destructor.
- */
- ~CSender()
- {
- }
-
- /**
- * \brief Send data.
- * \param fd file descriptor of the client TCP socket
- * \param data data to send
- * \return number of bytes sent or -1 if error
- */
- virtual ssize_t Send(int fd, const std::string& data)=0;
- };
-} /* namespace NsMessageBroker */
-
-#endif // CSENDER_H
-
-
diff --git a/src/3rd_party-static/message_broker/include/MBDebugHelper.h b/src/3rd_party-static/message_broker/include/MBDebugHelper.h
deleted file mode 100644
index fa835da3f0..0000000000
--- a/src/3rd_party-static/message_broker/include/MBDebugHelper.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * \file MBDebugHelper.h
- * \brief DebugHelper.
- * \author AKara
- */
-
-#ifndef MB_DEBUG_HELPER_H
-#define MB_DEBUG_HELPER_H
-
-#include <cstdio>
-
-/**
-* \def DEBUG_ON
-* \brief Switches on debug messages.
-*/
-//#define DEBUG_ON
-
-#ifdef DEBUG_ON
-/**
-* \def DBG_MSG
-* \brief Debug message output with file name and line number.
-* \param x formatted debug message.
-* \return printf construction.
-*/
-#define DBG_MSG(x) printf("%s:%d ", __FILE__, __LINE__);\
- printf x
-#else
-#define DBG_MSG(x)
-#endif
-
-/**
-* \def DBG_MSG_ERROR
-* \brief Debug ERROR message output with file name and line number.
-* \param x formatted debug message.
-* \return printf construction.
-*/
-#define DBG_MSG_ERROR(x) printf("ERROR!!! %s:%d ", __FILE__, __LINE__);\
- printf x
-
-#endif /*MB_DEBUG_HELPER_H*/
diff --git a/src/3rd_party-static/message_broker/include/mb_client.hpp b/src/3rd_party-static/message_broker/include/mb_client.hpp
deleted file mode 100644
index cd70a31cd8..0000000000
--- a/src/3rd_party-static/message_broker/include/mb_client.hpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * \file mb_client.hpp
- * \brief MessageBroker client.
- * \author AKara
- */
-
-#ifndef MB_CLIENT_H
-#define MB_CLIENT_H
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-typedef int ssize_t;
-#endif
-
-#include "networking.h"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
- /**
- * \class Client
- * \brief Abstract MessageBroker client.
- */
- class Client
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN to contact
- * \param port remote local port to contact
- */
- Client(const std::string& address, uint16_t port);
-
- /**
- * \brief Destructor.
- */
- virtual ~Client();
-
- /**
- * \brief Get socket descriptor.
- * \return socket descriptor.
- */
- int GetSocket() const;
-
- /**
- * \brief Get the address.
- * \return address or FQDN
- */
- std::string GetAddress() const;
-
- /**
- * \brief Get the port.
- * \return local port
- */
- uint16_t GetPort() const;
-
- /**
- * \brief Connect to the remote machine
- * \return true if success, false otherwise
- * \note on connectionless protocol like UDP, this function
- * always returns true even if remote peer is not reachable.
- */
- virtual bool Connect();
-
- /**
- * \brief Receive data from the network.
- * \param data if data is received it will put in this reference
- * \return number of bytes received or -1 if error
- * \note This method will blocked until data comes.
- */
- virtual ssize_t Recv(std::string& data) = 0;
-
- /**
- * \brief Close socket.
- */
- virtual void Close();
-
- protected:
- /**
- * \brief Socket descriptor.
- */
- int m_sock;
-
- /**
- * \brief Transport protocol of the socket.
- */
- enum networking::TransportProtocol m_protocol;
-
- /**
- * \brief Remote socket address.
- */
- struct sockaddr_storage m_sockaddr;
-
- /**
- * \brief Remote socket address length.
- */
- socklen_t m_sockaddrlen;
-
- /**
- * \brief Protected constructor so our inherited classes
- * don't need to call the default constructor
- */
- Client();
-
- /**
- * \brief Protected SetAddress so out inherited classes
- * don't need to call the default constructor
- */
- void SetAddress(const std::string& address);
-
- /**
- * \brief Protected SetPort so out inherited classes
- * don't need to call the default constructor
- */
- void SetPort(uint16_t port);
-
- private:
-
- /**
- * \brief Network address or FQDN.
- */
- std::string m_address;
-
- /**
- * \brief Local port.
- */
- uint16_t m_port;
- };
-
-} /* namespace NsMessageBroker */
-
-#endif /* MB_CLIENT_H */
diff --git a/src/3rd_party-static/message_broker/include/mb_controller.hpp b/src/3rd_party-static/message_broker/include/mb_controller.hpp
deleted file mode 100644
index 2d196aced2..0000000000
--- a/src/3rd_party-static/message_broker/include/mb_controller.hpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * \file mb_controller.hpp
- * \brief MessageBroker Controller.
- * \author AKara
- */
-
-#ifndef MB_CONTROLLER_H
-#define MB_CONTROLLER_H
-
-#include <iostream>
-
-#include "json/json.h"
-
-#include "mb_tcpclient.hpp"
-#include "utils/lock.h"
-#include "utils/atomic_object.h"
-
-#include <cstring>
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
- /**
- *\class CMessageBrokerController
- * \brief MessageBroker Controller.
- */
- class CMessageBrokerController : public TcpClient
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN
- * \param port remote local port
- * \param name name of component
- */
- CMessageBrokerController(const std::string& address, uint16_t port, std::string name);
-
-
- /**
- * \brief Destructor.
- */
- ~CMessageBrokerController();
-
- /**
- * \brief Receive data from the network.
- * \param data if data is received it will put in this reference
- * \return number of bytes received or -1 if error
- * \note This method will blocked until data comes.
- */
- virtual ssize_t Recv(std::string& data);
-
- /**
- * \brief Send data.
- * \param data data to send
- * \return number of bytes sent or -1 if error
- */
- ssize_t Send(const std::string& data);
-
- /**
- * \brief send Json message.
- * \param message JSON message.
- */
- void sendJsonMessage(Json::Value& message);
-
- /**
- * \brief generates new message id from diapason mControllersIdStart - (mControllersIdStart+999).
- * \return next id for message
- */
- int getNextMessageId();
-
- /**
- * \brief generates new message with id, jsonrpc version.
- * \param root container for prepared message
- */
- void prepareMessage(Json::Value& root);
-
- /**
- * \brief generates new message with id, jsonrpc version.
- * \note Doesn't change/add fields id and jsonrpc
- * \param errCode error code
- * \param errMessage string of message
- * \param error container for prepared error message
- */
- void prepareErrorMessage(int errCode, std::string errMessage, Json::Value& error);
-
- /**
- * \brief gets destination component name.
- * \param root JSON message.
- * \return string destination component name.
- */
- std::string getDestinationComponentName(Json::Value& root);
-
- /**
- * \brief gets method name.
- * \param root JSON message.
- * \return string method name.
- */
- std::string getMethodName(Json::Value& root);
-
- /**
- * \brief checks is message notification or not.
- * \param root JSON message.
- * \return true if notification.
- */
- bool isNotification(Json::Value& root);
-
- /**
- * \brief checks is message response or not.
- * \param root JSON message.
- * \return true if response.
- */
- bool isResponse(Json::Value& root);
-
- /**
- * \brief searches Method by id in mWaitResponseQueue.
- * \param id id of incoming JSON message.
- * \return string method name or "" in case not found.
- */
- std::string findMethodById(std::string id);
-
- /**
- * \brief register controller on the server.
- * \param id message id for JSON message due the id diapason hasn't been received.
- */
- void registerController(int id = 0);
-
- /**
- * \brief unregister controller on the server.
- */
- void unregisterController();
-
- /**
- * \brief subscribes controller to the property changing.
- * \param property property name in format ComponentName.PropertyName.
- */
- void subscribeTo(std::string property);
-
- /**
- * \brief unsubscribes controller from the property changing.
- * \param property property name in format ComponentName.PropertyName.
- */
- void unsubscribeFrom(std::string property);
-
- /**
- * \brief pure virtual method to process response.
- * \param method method name which has been called.
- * \param root JSON message.
- */
- virtual void processResponse(std::string method, Json::Value& root) = 0;
-
- /**
- * \brief pure virtual method to process request.
- * \param root JSON message.
- */
- virtual void processRequest(Json::Value& root) = 0;
-
- /**
- * \brief Process notification message.
- * \brief Notify subscribers about property change.
- * expected notification format example:
- * \code
- * {"jsonrpc": "2.0", "method": "<ComponentName>.<NotificationName>", "params": <list of params>}
- * \endcode
- * \param root JSON message.
- */
- virtual void processNotification(Json::Value& root) = 0;
-
- /**
- * \brief Checks message.
- * \param root JSON message.
- * \param error JSON message to fill in case of any errors.
- * \return true if message is good.
- */
- bool checkMessage(Json::Value& root, Json::Value& error);
-
- /**
- * \brief Returns name of Controller.
- * \return name of controller.
- */
- std::string getControllersName();
-
- /**
- * \brief Method for receiving thread.
- */
- void* MethodForReceiverThread(void * arg);
-
- virtual void exitReceivingThread() {
- Close();
- stop = true;
- }
-
- protected:
- /**
- * @brief flag top stop thread
- */
- sync_primitives::atomic_bool stop;
-
- private:
- /**
- * \brief Method for receiving messages without tcp packeting.
- * \param message received data
- */
- void onMessageReceived(Json::Value message);
- /**
- * \brief Start value of id's diapason.
- */
- std::string m_receivingBuffer;
-
- /**
- * \brief Start value of id's diapason.
- */
- int mControllersIdStart;
-
- /**
- * \brief Current id's value.
- */
- int mControllersIdCurrent;
-
- /**
- * \brief Already sent messages Methods to recognize esponses: MessageId:MethodName.
- */
- std::map<std::string, std::string> mWaitResponseQueue;
-
- /**
- * \brief Name of component.
- */
- std::string mControllersName;
-
- /**
- * \brief JSON reader.
- */
- Json::Reader m_reader;
-
- /**
- * \brief JSON writer.
- */
- Json::FastWriter m_writer;
-
- /**
- * \brief JSON writer.
- */
- Json::FastWriter m_receiverWriter;
- /*
- * @brief mutex for mWaitResponseQueue
- */
- sync_primitives::Lock queue_lock_;
- };
-} /* namespace NsMessageBroker */
-#endif /* MB_CONTROLLER_H */
diff --git a/src/3rd_party-static/message_broker/include/mb_server.hpp b/src/3rd_party-static/message_broker/include/mb_server.hpp
deleted file mode 100644
index 684a89055a..0000000000
--- a/src/3rd_party-static/message_broker/include/mb_server.hpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * \file mb_server.hpp
- * \brief MessageBroker server.
- * \author AKara
- */
-
-#ifndef MB_SERVER_H
-#define MB_SERVER_H
-
-#include "networking.h"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
- /**
- * \class Server
- * \brief Abstract MessageBroker server.
- */
- class Server
- {
- public:
- /**
- * \brief Constructor.
- * \param address network address or FQDN to bind
- * \param port local port to bind
- */
- Server(const std::string& address, uint16_t port);
-
- /**
- * \brief Destructor.
- */
- virtual ~Server();
-
- /**
- * \brief Wait message.
- *
- * This function do a select() on the socket and Process() immediately
- * the message.
- * \param ms millisecond to wait (0 means infinite)
- */
- virtual void WaitMessage(uint32_t ms) = 0;
-
- /**
- * \brief Get socket descriptor.
- * \return socket descriptor.
- */
- int GetSocket() const;
-
- /**
- * \brief Get the address.
- * \return address or FQDN
- */
- std::string GetAddress() const;
-
- /**
- * \brief Get the port.
- * \return local port
- */
- uint16_t GetPort() const;
-
- /**
- * \brief Bind the socket.
- * \return true if success, false otherwise
- */
- bool Bind();
-
- /**
- * \brief Receive data from the network and process it.
- * \param fd file descriptor on which receive
- * \return true if message has been correctly received, processed and
- * response sent, false otherwise (mainly send/receive error)
- * \note This method will blocked until data comes.
- */
- virtual bool Recv(int fd) = 0;
-
- /**
- * \brief Close socket.
- * \note It should be overriden for connection-oriented protocol
- * like TCP to properly close all client sockets.
- */
- virtual void Close();
-
- protected:
- /**
- * \brief Socket descriptor.
- */
- int m_sock;
-
- /**
- * \brief Transport protocol of the socket.
- */
- enum networking::TransportProtocol m_protocol;
-
- /**
- * \brief Transport protocol of the socket.
- */
-
- private:
- /**
- * \brief Network address or FQDN.
- */
- std::string m_address;
-
- /**
- * \brief Local port.
- */
- uint16_t m_port;
-
- /**
- * \brief Encapsulated format.
- */
- };
-
-} /* namespace NsMessageBroker */
-
-#endif /* MB_SERVER_H */
-
diff --git a/src/3rd_party-static/message_broker/include/mb_tcpclient.hpp b/src/3rd_party-static/message_broker/include/mb_tcpclient.hpp
deleted file mode 100644
index 07697dbde7..0000000000
--- a/src/3rd_party-static/message_broker/include/mb_tcpclient.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * \file mb_tcpclient.hpp
- * \brief MessageBroker TCP client.
- * \author AKara
- */
-
-#ifndef MB_TCPCLIENT_H
-#define MB_TCPCLIENT_H
-
-#include <iostream>
-
-#include "mb_client.hpp"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
- /**
- * \class TcpClient
- * \brief MessageBroker TCP client.
- */
- class TcpClient : public Client
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN
- * \param port remote local port
- */
- TcpClient(const std::string& address, uint16_t port);
-
- /**
- * \brief Destructor.
- */
- virtual ~TcpClient();
-
- /**
- * \brief Receive data from the network.
- * \param data if data is received it will put in this reference
- * \return number of bytes received or -1 if error
- * \note This method will blocked until data comes.
- */
- virtual ssize_t Recv(std::string& data);
-
- /**
- * \brief Send data.
- * \param data data to send
- * \return number of bytes sent or -1 if error
- */
- ssize_t Send(const std::string& data);
- };
-
-} /* namespace NsMessageBroker */
-
-#endif /* MB_TCPCLIENT_H */
diff --git a/src/3rd_party-static/message_broker/include/mb_tcpserver.hpp b/src/3rd_party-static/message_broker/include/mb_tcpserver.hpp
deleted file mode 100644
index 8ab2ce6a6d..0000000000
--- a/src/3rd_party-static/message_broker/include/mb_tcpserver.hpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * \file mb_tcpserver.hpp
- * \brief MessageBroker TCP server.
- * \author AKara
- */
-
-#ifndef MB_TCPSERVER_H
-#define MB_TCPSERVER_H
-
-#include <list>
-#include <map>
-
-#include "mb_server.hpp"
-#include "CMessageBroker.hpp"
-#include "CSender.hpp"
-#include "websocket_handler.hpp"
-
-#define RECV_BUFFER_LENGTH 4097
-#define MAX_RECV_BUFFER_LENGTH 100000
-#define MAX_RECV_DATA 4096
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \class TcpServer
- * \brief MessageBroker TCP server implementation.
- */
- class TcpServer : public Server, public CSender
- {
- public:
- /**
- * \brief Constructor.
- * \param address network address or FQDN to bind
- * \param port local port to bind
- * \param pMessageBroker pointer to MessageBroker
- */
- TcpServer(const std::string& address, uint16_t port, NsMessageBroker::CMessageBroker* pMessageBroker);
-
- /**
- * \brief Destructor.
- */
- virtual ~TcpServer();
-
- /**
- * \brief Receive data from the network and process it.
- * \param fd socket descriptor to receive data
- * \return true if message has been correctly received, processed and
- * response sent, false otherwise (mainly send/recv error)
- * \note This method will blocked until data comes.
- */
- virtual bool Recv(int fd);
-
- /**
- * \brief Send data.
- * \param fd file descriptor of the client TCP socket
- * \param data data to send
- * \return number of bytes sent or -1 if error
- */
- virtual ssize_t Send(int fd, const std::string& data);
-
- /**
- * \brief Wait message.
- *
- * This function do a select() on the socket and Process() immediately
- * the message.
- * \param ms millisecond to wait (0 means infinite)
- */
- virtual void WaitMessage(uint32_t ms);
-
- /**
- * \brief Put the TCP socket in LISTEN state.
- */
- bool Listen() const;
-
- /**
- * \brief Accept a new client socket.
- * \return -1 if error, 0 otherwise
- */
- bool Accept();
-
- /**
- * \brief Close listen socket and all client sockets.
- */
- void Close();
-
- /**
- * \brief Method for thread with WaitMessage.
- */
- void* MethodForThread(void * arg);
-
- private:
- /**
- * \brief Checks if incoming messages are websocket request.
- * \param fd
- * \param pReceivingBuffer string receiving buffer pointer
- * \return true if it is a websocket handshake
- */
- bool checkWebSocketHandShake(int fd, std::string* pReceivingBuffer);
-
- /**
- * \brief Checks if incoming messages are websocket request.
- * \param fd file descriptor of the client TCP socket
- * \return true if it is a websocket
- */
- bool isWebSocket(int fd);
-
- /**
- * \brief Gets buffer for socket which received data.
- * \param fd socket file descriptor
- */
- std::string* getBufferFor(int fd);
- private:
- /**
- * \brief WebSocket clients fd's list.
- */
- std::list<int> m_WebSocketClients;
-
- /**
- * \brief Just accepted clients fd's list.
- */
- std::list<int> m_AcceptedClients;
-
- /**
- * \brief Receiving buffers map SocketFd:bufferPointer.
- */
- std::map <int, std::string*> m_receivingBuffers;
-
- /**
- * \brief List of disconnected sockets to be purged.
- */
- std::list<int> m_purge;
-
- /**
- * \brief MessageBroker pointer.
- */
- NsMessageBroker::CMessageBroker* mpMessageBroker;
-
- /**
- * \brief WebSocket handler.
- */
- CWebSocketHandler mWebSocketHandler;
- };
-
-} /* namespace NsMessageBroker */
-
-#endif /* MB_TCPSERVER_H */
diff --git a/src/3rd_party-static/message_broker/include/networking.h b/src/3rd_party-static/message_broker/include/networking.h
deleted file mode 100644
index a08853bb31..0000000000
--- a/src/3rd_party-static/message_broker/include/networking.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * JsonRpc-Cpp - JSON-RPC implementation.
- * Copyright (C) 2008-2011 Sebastien Vincent <sebastien.vincent@cppextrem.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * \file networking.h
- * \brief Networking utils.
- * \author Sebastien Vincent
- */
-
-#ifndef NETWORKING_H
-#define NETWORKING_H
-
-#ifdef _WIN32
-
-#ifndef _MSC_VER
-#include <stdint.h>
-#endif //_MSC_VER
-
-#include <winsock2.h>
-#include <windows.h>
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
-#define snprintf _snprintf
-#endif //_MSC_VER >= 1400
-
-/* to use getaddrinfo, _WIN32_WINNT have to
- * equal at least 0x0501
- */
-#define OLD_WIN32_WINNT _WIN32_WINNT
-
-#if (_WIN32_WINNT < 0x0501)
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x501
-#endif //(_WIN32_WINNT < 0x0501)
-
-#include <ws2tcpip.h>
-
-#if (_WIN32_WINNT != OLD_WIN32_WINNT)
-#undef _WIN32_WINNT
-#define _WIN32_WINNT OLD_WIN32_WINNT
-#endif //(_WIN32_WINNT != OLD_WIN32_WINNT)
-
-typedef int socklen_t;
-#define close closesocket
-
-#else //_WIN32
-
-#include <stdint.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <unistd.h>
-
-#include <netinet/in.h>
-
-#include <netdb.h>
-
-#endif //_WIN32
-
-#include <string>
-
-/**
- * \namespace networking
- * \brief Networking related functions.
- */
-namespace networking
-{
- /**
- * \enum TransportProtocol
- * \brief Transport protocol.
- */
- enum TransportProtocol
- {
- UDP = IPPROTO_UDP, /**< UDP protocol. */
- TCP = IPPROTO_TCP /**< TCP protocol. */
- };
-
- /**
- * \brief Initialize networking.
- * \return true if network is correctly initialized, false otherwise
- * \note On MS Windows, this step is mandatory to use
- * socket API (socket(), bind(), recvfrom(), ...).
- */
- bool init();
-
- /**
- * \brief Cleanup networking.
- * \note On MS Windows, after calling this function,
- * it will be impossible to use socket API.
- */
- void cleanup();
-
- /**
- * \brief Connect to remote machine.
- * \param protocol transport protocol used
- * \param address remote address
- * \param port remote port
- * \param sockaddr if function succeed, sockaddr
- * representation of address/port
- * \param addrlen if function succeed, length of sockaddr
- * \return socket descriptor if success, -1 otherwise
- */
- int connect(enum TransportProtocol protocol, const std::string& address, uint16_t port, struct sockaddr_storage* sockaddr, socklen_t* addrlen);
-
- /**
- * \brief Bind on a local address.
- * \param protocol transport protocol used
- * \param address local address
- * \param port local port
- * \param sockaddr if function succeed, sockaddr
- * representation of address/port
- * \param addrlen if function succeed, length of sockaddr
- * \return socket descriptor if success, -1 otherwise
- */
- int bind(enum TransportProtocol protocol, const std::string& address, uint16_t port, struct sockaddr_storage* sockaddr, socklen_t* addrlen);
-
-} /* namespace networking */
-
-#endif /* NETWORKING_H */
-
diff --git a/src/3rd_party-static/message_broker/include/system.h b/src/3rd_party-static/message_broker/include/system.h
deleted file mode 100644
index fac4f7926b..0000000000
--- a/src/3rd_party-static/message_broker/include/system.h
+++ /dev/null
@@ -1,320 +0,0 @@
-/**
- * \file system.h
- * \brief System utils.
- * \author Sebastien Vincent
- */
-
-#ifndef SYSTEM_H
-#define SYSTEM_H
-
-#ifdef _WIN32
-
-#include <windows.h>
-
-#else
-
-#include <pthread.h>
-
-#endif
-
-/**
- * \namespace System
- * \brief System related class (thread, ...).
- */
-namespace System
-{
-
- /**
- * \brief Sleep for x milliseconds
- * \param ms millisecond to sleep
- */
- void msleep(unsigned long ms);
-
- /**
- * \class ThreadArg
- * \brief Abstract class to represent thread argument.
- * \see ThreadArgImpl
- * \see Thread
- */
- class ThreadArg
- {
- public:
- /**
- * \brief Destructor.
- */
- virtual ~ThreadArg();
-
- /**
- * \brief Call the method.
- * \note Have to be implemented by subclasses
- */
- virtual void* Call() = 0;
- };
-
- /**
- * \class ThreadArgImpl
- * \brief Template class that represent thread argument.
- *
- * This class is used to provide callback function within
- * an object. The method which will be called during thread
- * execution must be of the form <code>void* MyMethod(void* arg)</code>.
- * Inside this method you are free to called any method of the object.
- *
- * \warning As class keep pointer of object reference, you should take
- * care at the lifetime of object you pass in ThreadArgImpl constructor,
- * else it could lead to crash your program.\n See Thread class documentation
- * for an example of how to use ThreadArgImpl class.
- * \see Thread
- */
- template<class T> class ThreadArgImpl : public ThreadArg
- {
- public:
- /**
- * \typedef Method
- * \brief T method signature.
- */
- typedef void* (T::*Method)(void*);
-
- /**
- * \brief Constructor.
- * \param obj object
- * \param method class method
- * \param arg argument to method
- */
- ThreadArgImpl(T& obj, Method method, void* arg)
- {
- m_obj = &obj;
- m_method = method;
- m_arg = arg;
- }
-
- /**
- * \brief Call the method.
- */
- virtual void* Call()
- {
- return (m_obj->*m_method)(m_arg);
- }
-
- private:
- /**
- * \brief Object pointer.
- */
- T* m_obj;
-
- /**
- * \brief Method of T class.
- */
- Method m_method;
-
- /**
- * \brief Argument of method.
- */
- void* m_arg;
- };
-
- /**
- * \class Thread
- * \brief Thread implementation.
- *
- * Preferred use of this class is to construct ThreadArgImpl inside
- * another class and pass <code>*this</code> as obj parameter:\n
- * \n
- * \code
- * class MyClass
- * {
- * public:
- * void MyMethod()
- * {
- * ThreadArg* arg = new ThreadArgImpl<MyClass>(*this, &MyClass::MethodForThread, NULL);
- * Thread th(arg);
- * th.Start();
- * }
- *
- * void* MethodForThread(void * arg)
- * {
- * // do stuff
- * }
- * };
- * \endcode
- *
- */
- class Thread
- {
- public:
- /**
- * \brief Constructor.
- * \param arg thread argument (MUST be dynamically allocated using new)
- * \note System::Thread object takes care of freeing method memory.\n
- * The way of calling constructor is:
- * <code>
- * Thread thread(new ThreadArgImpl<MyClass>(instanceOfMyClass, &MyClass::Method));
- * </code>
- * \warning You should take care of the object (instanceOfMyClass) lifetime pass
- * into ThreadArgImpl constructor, else it could lead to a crash because ThreadArgImpl
- * keep pointer of the reference.
- * \warning The "arg" parameter MUST be dynamically allocated (using new).
- * \see ThreadArgImpl
- */
- Thread(ThreadArg* arg);
-
- /**
- * \brief Destructor.
- */
- virtual ~Thread();
-
- /**
- * \brief Start thread.
- * \param detach if set to true, the thread will be in detach state so
- * you do not have to call join on this type of thread.
- * \return true if success, false otherwise
- * \warning Do NOT <code>Join</code> a detached thread.
- */
- bool Start(bool detach);
-
- /**
- * \brief Stop thread.
- * \return true if success, false otherwise
- * \warning Calling this method could lead callback object to an
- * incoherent state. You should call it really in desperate situations when
- * you really want to stop thread and do not care about the rest.
- * \warning With POSIX thread implementation, calling Stop (one or more times)
- * will leak 28 bytes of memory.
- */
- bool Stop();
-
- /**
- * \brief Join thread.
- * \param ret pointer to return code of the joined thread
- * \return true if success, false otherwise
- * \warning Do NOT <code>Join</code> a detached thread.
- */
- bool Join(void** ret = NULL);
-
-#ifdef _WIN32
- HANDLE
-#else
- pthread_t
-#endif
- GetId() const {
- return m_id;
- }
-
- private:
- /**
- * \brief Entry point of thread before calling specific
- * callback.
- * \param arg thread argument
- * \return result of ThreadArg callback
- */
-#ifdef _WIN32
- static DWORD WINAPI Call(LPVOID arg);
-#else
- static void* Call(void* arg);
-#endif
- /**
- * \brief Thread identifier.
- */
-#ifdef _WIN32 /* Win32 thread */
- HANDLE m_id;
-#else /* POSIX thread */
- pthread_t m_id;
-#endif
-
- /**
- * \brief Thread argument.
- */
- ThreadArg* m_arg;
- };
-
- /**
- * \class Mutex
- * \brief Mutex implementation.
- */
- class Mutex
- {
- public:
- /**
- * \brief Constructor.
- */
- Mutex();
-
- /**
- * \brief Destructor.
- */
- ~Mutex();
-
- /**
- * \brief Lock the mutex.
- * \return true if mutex is locked, false if error
- */
- bool Lock();
-
- /**
- * \brief Unlock the mutex.
- * \return true if mutex is unlocked, false if error
- */
- bool Unlock();
-
- private:
- /**
- * \brief The mutex.
- */
-#ifdef _WIN32
- HANDLE m_mutex;
-#else
- pthread_mutex_t m_mutex;
-#endif
- };
-
-#ifdef _WIN32
-#warning "BinarySemaphore is implemented for POSIX systems only"
-#else
- /**
- * \class BinarySemaphore
- * \brief Binary semaphore implementation.
- */
- class BinarySemaphore {
- public:
- /**
- * \brief Constructor.
- */
- BinarySemaphore();
-
- /**
- * \brief Destructor.
- */
- ~BinarySemaphore();
-
- /**
- * \brief Wait until the semaphore is unlocked.
- */
- void Wait();
-
- /**
- * \brief Notify the semaphore.
- */
- void Notify();
-
- private:
- /**
- * \brief Mutex to prevent concurrent access to the flag.
- */
- pthread_mutex_t m_mutex;
-
- /**
- * \brief Conditional variable to block threads.
- */
- pthread_cond_t m_cond;
-
- /**
- * \brief Semaphore state: false = down, true = up.
- */
- bool m_isUp;
- };
-#endif /* _WIN32 */
-
-} /* namespace System */
-
-#endif /* SYSTEM_H */
-
diff --git a/src/3rd_party-static/message_broker/include/websocket_handler.hpp b/src/3rd_party-static/message_broker/include/websocket_handler.hpp
deleted file mode 100644
index 8bed007436..0000000000
--- a/src/3rd_party-static/message_broker/include/websocket_handler.hpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * \file websocket_handler.hpp
- * \brief WebSocket Handler.
- * Supports RFC6455 standard of protocol
- * Protocol specification:
- * http://tools.ietf.org/html/rfc6455
- * \author AKara
- */
-
-#ifndef WEBSOCKET_HANDLER_H
-#define WEBSOCKET_HANDLER_H
-
-#include <cstring>
-#include <iostream>
-#include <vector>
-
-#define MAX_WEBSOCKET_04_KEY_LEN 128 /**< Max WS key length */
-
-#define K(t) _K[(t) / 20] /**< K(t) */
-#define F0(b, c, d) (((b) & (c)) | ((~(b)) & (d))) /**< F0(b, c, d) */
-#define F1(b, c, d) (((b) ^ (c)) ^ (d)) /**< F1(b, c, d) */
-#define F2(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d))) /**< F2(b, c, d) */
-#define F3(b, c, d) (((b) ^ (c)) ^ (d)) /**< F3(b, c, d) */
-
-#define S(n, x) (((x) << (n)) | ((x) >> (32 - n))) /**< S(n, x) */
-#define H(n) (ctxt->h.b32[(n)]) /**< H(n) */
-#define COUNT (ctxt->count) /**< COUNT */
-#define W(n) (ctxt->m.b32[(n)]) /**< W(n) */
-
-#define PUTPAD(x) { \
- ctxt->m.b8[(COUNT % 64)] = (x); \
- COUNT++; \
- COUNT %= 64; \
- if (COUNT % 64 == 0) \
- sha1_step(ctxt); \
- } /**< PUTPAD(x) */
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \brief sha1_ctxt txt structure.
- */
- struct sha1_ctxt
- {
- union {
- unsigned char b8[20];
- unsigned int b32[5];
- } h; /**< h */
- union {
- unsigned char b8[8];
- unsigned long long b64[1];
- } c; /**< c */
- union {
- unsigned char b8[64];
- unsigned int b32[16];
- } m; /**< m */
- unsigned char count; /**< count */
- };
-
-
- /**
- * \brief Constant table.
- */
- const unsigned int _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
-
- /**
- * \brief Constant table.
- */
- const char encode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz0123456789+/";
-
- /**
- * \brief Constant table.
- */
- const char decode[] = "|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW"
- "$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
-
- /**
- * \brief Type to present raw bytes.
- */
- typedef std::vector<char> rawBytes;
-
-
- /**
- * \class CWebSocketHandler
- * \brief WebSocket messages handler.
- */
- class CWebSocketHandler
- {
- public:
- /**
- * \brief Constructor.
- */
- CWebSocketHandler()
- {
- }
-
- /**
- * \brief Destructor.
- */
- ~CWebSocketHandler()
- {
- }
-
- /**
- * \brief Generates Sec-WebSocket-Accept key
- * \param key Sec-WebSocket-Key from client
- */
- void handshake_0405(std::string &key);
-
- /**
- * \brief Generates accept key for older (hybi-00) WebSocket protocol version.
- * \param key1 The first key of the client's handshake (a string)
- * \param key2 The second key of the client's handshake (a string)
- * \param key3 The third key of the client's handshake (raw bytes), must be 8 bytes long
- * \return Raw bytes of the generated accept key, or no bytes if error
- */
- rawBytes handshake_hybi00(const std::string &key1, const std::string &key2, const rawBytes &key3);
-
- /**
- * \brief Parses WebSocket data header to retrieve packet size
- * \param Buffer input buffer
- * \param b_size buffer size
- * \return Packet size
- */
- unsigned int parseWebSocketDataLength(const char* Buffer, unsigned int& b_size);
-
- /**
- * \brief Parses WebSocket data
- * \param Buffer input buffer
- * \param b_size buffer size
- * \return -1 in case of issues, data length in case of success
- */
- int parseWebSocketData(char* Buffer, unsigned int& b_size);
-
- /**
- * \brief Prepares WebSocket data
- * \param Buffer input buffer
- * \param b_size buffer size
- * \return -1 in case of issues, data length in case of success
- */
- int prepareWebSocketDataHeader(unsigned char* Buffer, unsigned long long b_size);
- private:
- /**
- * \brief SHA1 hash calculator.
- * \param d input buffer
- * \param n size of buffer
- * \param md mask buffer
- * \return pointer to result
- */
- unsigned char * SHA1(const unsigned char *d, size_t n, unsigned char *md);
-
- /**
- * \brief base 64 encode string.
- * \param in input buffer
- * \param in_len size of buffer
- * \param out output buffer
- * \param out_size size of buffer
- * \return -1 in case of errors
- */
- int lws_b64_encode_string(const char *in, int in_len, char *out, int out_size);
-
- /**
- * \brief base 64 decode string.
- * \param in input buffer
- * \param out output buffer
- * \param out_size size of buffer
- * \return -1 in case of errors
- */
- int lws_b64_decode_string(const char *in, char *out, int out_size);
-
- /**
- * \brief one step of SHA1.
- * \param ctxt input txt structure
- */
- void sha1_step(struct sha1_ctxt *ctxt);
-
- /**
- * \brief init step of SHA1.
- * \param ctxt input txt structure
- */
- void sha1_init(struct sha1_ctxt *ctxt);
-
- /**
- * \brief pad step of SHA1.
- * \param ctxt input txt structure
- */
- void sha1_pad(struct sha1_ctxt *ctxt);
-
- /**
- * \brief loop step of SHA1.
- * \param ctxt input txt structure
- * \param input input buffer buffer
- * \param len length of input buffer
- */
- void sha1_loop(struct sha1_ctxt *ctxt, const unsigned char *input, size_t len);
-
- /**
- * \brief result step of SHA1.
- * \param ctxt input txt structure
- * \param digest0 buffer
- */
- void sha1_result(struct sha1_ctxt *ctxt, unsigned char* digest0);
-
- /**
- * \brief base 64 test.
- * \return -1 in case of errors
- */
- int lws_b64_selftest(void);
-
- /**
- * \brief Extracts and processes the number from key,
- * according to the WebSocket hybi-00 specification.
- * \param key Key to extract the number from
- * \return The number, or 0 if error
- */
- unsigned long extractNumber(const std::string &key) const;
- };
-
-} /* namespace NsMessageBroker */
-
-#endif /* WEBSOCKET_HANDLER_H */
diff --git a/src/3rd_party-static/message_broker/src/client/mb_client.cpp b/src/3rd_party-static/message_broker/src/client/mb_client.cpp
deleted file mode 100644
index 6342c776a8..0000000000
--- a/src/3rd_party-static/message_broker/src/client/mb_client.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * \file mb_client.cpp
- * \brief MessageBroker client.
- * \author AKara
- */
-
-#include <cstring>
-
-#include "mb_client.hpp"
-
-namespace NsMessageBroker
-{
-
- Client::Client()
- {
- }
-
- Client::Client(const std::string& address, uint16_t port)
- {
- m_sock = -1;
- m_address = address;
- m_port = port;
- memset(&m_sockaddr, 0x00, sizeof(struct sockaddr_storage));
- m_sockaddrlen = 0;
- }
-
- Client::~Client()
- {
- if(m_sock != -1)
- {
- Close();
- }
- }
-
- int Client::GetSocket() const
- {
- return m_sock;
- }
-
- std::string Client::GetAddress() const
- {
- return m_address;
- }
-
- void Client::SetAddress(const std::string& address)
- {
- m_address = address;
- }
-
- void Client::SetPort(uint16_t port)
- {
- m_port = port;
- }
-
- uint16_t Client::GetPort() const
- {
- return m_port;
- }
-
- bool Client::Connect()
- {
- m_sock = networking::connect(m_protocol, GetAddress(), GetPort(), &m_sockaddr, &m_sockaddrlen);
-
- return (m_sock != -1) ? true : false;
- }
-
- void Client::Close()
- {
- shutdown(m_sock, SHUT_RDWR);
-
- close(m_sock);
- m_sock = -1;
- }
-
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/client/mb_controller.cpp b/src/3rd_party-static/message_broker/src/client/mb_controller.cpp
deleted file mode 100644
index 8a4a77cf30..0000000000
--- a/src/3rd_party-static/message_broker/src/client/mb_controller.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-/**
- * \file mb_controller.cpp
- * \brief MessageBroker Controller.
- * \author AKara
- */
-
-#include "mb_controller.hpp"
-
-#include "MBDebugHelper.h"
-#include "CMessageBroker.hpp"
-
-namespace NsMessageBroker
-{
- CMessageBrokerController::CMessageBrokerController(const std::string& address, uint16_t port, std::string name):
- TcpClient(address, port),
- stop(false),
- m_receivingBuffer(""),
- mControllersIdStart(-1),
- mControllersIdCurrent(0)
- {
- mControllersName = name;
- }
-
- std::string CMessageBrokerController::getControllersName()
- {
- return mControllersName;
- }
-
- CMessageBrokerController::~CMessageBrokerController()
- {
- }
-
- ssize_t CMessageBrokerController::Recv(std::string& data)
- {
- DBG_MSG(("CMessageBrokerController::Recv()\n"));
- ssize_t recv = TcpClient::Recv(data);
- DBG_MSG(("Received message: %s\n", data.c_str()));
- m_receivingBuffer += data;
- while (!stop)
- {
- Json::Value root;
- if (!m_reader.parse(m_receivingBuffer, root))
- {
- DBG_MSG(("Received not JSON string! %s\n", m_receivingBuffer.c_str()));
- return recv;
- }
- std::string wmes = m_receiverWriter.write(root);
- DBG_MSG(("Parsed JSON string:%s; length: %d\n", wmes.c_str(), wmes.length()));
- DBG_MSG(("Buffer is:%s\n", m_receivingBuffer.c_str()));
- ssize_t beginpos = m_receivingBuffer.find(wmes);
- if (-1 != beginpos)
- {
- m_receivingBuffer.erase(0, beginpos + wmes.length());
- DBG_MSG(("Buffer after cut is:%s\n", m_receivingBuffer.c_str()));
- } else
- {
- m_receivingBuffer.clear();
- }
- onMessageReceived(root);
- }
- return recv;
- }
-
- void CMessageBrokerController::onMessageReceived(Json::Value message)
- {
- // Determine message type and process...
- Json::Value error;
- if (checkMessage(message, error))
- {
- if (isNotification(message))
- {
- DBG_MSG(("Message is notification!\n"));
- processNotification(message);
- } else if (isResponse(message))
- {
- std::string id = message["id"].asString();
- std::string method = findMethodById(id);
- DBG_MSG(("Message is response on: %s\n", method.c_str()));
- if ("" != method)
- {
- if ("MB.registerComponent" == method)
- { // initialize mControllersIdStart
- if (message.isMember("result") && message["result"].isInt())
- {
- mControllersIdStart = message["result"].asInt();
- } else
- {
- DBG_MSG_ERROR(("Not possible to initialize mControllersIdStart!\n"));
- }
- } else if ("MB.subscribeTo" == method || "MB.unregisterComponent" == method || "MB.unsubscribeFrom" == method)
- {
- //nothing to do for now
- } else
- {
- processResponse(method, message);
- }
- } else
- {
- DBG_MSG_ERROR(("Request with id %s has not been found!\n", id.c_str()));
- }
- } else
- {
- DBG_MSG(("Message is request!\n"));
- processRequest(message);
- }
- } else
- {
- DBG_MSG_ERROR(("Message contains wrong data!\n"));
- }
- }
-
- ssize_t CMessageBrokerController::Send(const std::string& data)
- {
- return TcpClient::Send(data);
- }
-
- void CMessageBrokerController::sendJsonMessage(Json::Value& message)
- {
- DBG_MSG(("CMessageBrokerController::sendJsonMessage()\n"));
- sync_primitives::AutoLock auto_lock(queue_lock_);
- std::string mes = m_writer.write(message);
- if (!isNotification(message) && !isResponse(message))
- {// not notification, not a response, store id and method name to recognize an answer
- mWaitResponseQueue.insert(std::map<std::string, std::string>::value_type(message["id"].asString(), message["method"].asString()));
- }
- int bytesSent = Send(mes);
- bytesSent = bytesSent; // to prevent compiler warnings in case DBG_MSG off
- DBG_MSG(("Length:%d, Sent: %d bytes\n", mes.length(), bytesSent));
- }
-
- std::string CMessageBrokerController::findMethodById(std::string id)
- {
- DBG_MSG(("CMessageBrokerController::findMethodById()\n"));
- sync_primitives::AutoLock auto_lock(queue_lock_);
- std::string res = "";
- std::map <std::string, std::string>::iterator it;
- it = mWaitResponseQueue.find(id);
- if (it != mWaitResponseQueue.end())
- {
- res = (*it).second;
- mWaitResponseQueue.erase(it);
- }
- return res;
- }
-
- int CMessageBrokerController::getNextMessageId()
- {
- if (mControllersIdCurrent < (mControllersIdStart+1000))
- {
- return mControllersIdCurrent++;
- } else
- {
- return mControllersIdCurrent = mControllersIdStart;
- }
- }
-
- void CMessageBrokerController::prepareMessage(Json::Value& root)
- {
- root["jsonrpc"] = "2.0";
- root["id"] = getNextMessageId();
- }
-
- void CMessageBrokerController::prepareErrorMessage(int errCode, std::string errMessage, Json::Value& error)
- {
- DBG_MSG(("CMessageBrokerController::prepareErrorMessage()\n"));
- Json::Value err;
- err["code"] = errCode;
- err["message"] = errMessage;
- error["error"] = err;
- }
-
- std::string CMessageBrokerController::getDestinationComponentName(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerController::getDestinationComponentName()\n"));
- std::string ret = "";
- std::string method = root["method"].asString();
- int pos = method.find(".");
- if (-1 != pos)
- {
- ret = method.substr(0, pos);
- }
- DBG_MSG(("Destination component is: %s\n", ret.c_str()));
- return ret;
- }
-
- std::string CMessageBrokerController::getMethodName(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerController::getMethodName()\n"));
- std::string ret = "";
- std::string method = root["method"].asString();
- int pos = method.find(".");
- if (-1 != pos)
- {
- ret = method.substr(pos+1);
- }
- DBG_MSG(("Method is: %s\n", ret.c_str()));
- return ret;
- }
-
- bool CMessageBrokerController::isNotification(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerController::isNotification()\n"));
- bool ret = false;
- if (false == root.isMember("id"))
- {
- ret = true;
- }
- DBG_MSG(("Result: %d\n", ret));
- return ret;
- }
-
- bool CMessageBrokerController::isResponse(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerController::isResponse()\n"));
- bool ret = false;
- if ((true == root.isMember("result")) || (true == root.isMember("error")))
- {
- ret = true;
- }
- DBG_MSG(("Result: %d\n", ret));
- return ret;
- }
-
- void CMessageBrokerController::registerController(int id)
- {
- DBG_MSG(("CMessageBrokerController::registerController()\n"));
- Json::Value root;
- Json::Value params;
- prepareMessage(root);
- root["id"] = id;
- root["method"] = "MB.registerComponent";
- params["componentName"] = mControllersName;
- root["params"] = params;
- sendJsonMessage(root);
- }
-
- void CMessageBrokerController::unregisterController()
- {
- DBG_MSG(("CMessageBrokerController::unregisterController()\n"));
- Json::Value root;
- Json::Value params;
- prepareMessage(root);
- root["method"] = "MB.unregisterComponent";
- params["componentName"] = mControllersName;
- root["params"] = params;
- sendJsonMessage(root);
- }
-
- void CMessageBrokerController::subscribeTo(std::string property)
- {
- DBG_MSG(("CMessageBrokerController::subscribeTo()\n"));
- Json::Value root;
- Json::Value params;
- prepareMessage(root);
- root["method"] = "MB.subscribeTo";
- params["propertyName"] = property;
- root["params"] = params;
- sendJsonMessage(root);
- }
-
- void CMessageBrokerController::unsubscribeFrom(std::string property)
- {
- DBG_MSG(("CMessageBrokerController::unsubscribeFrom()\n"));
- Json::Value root;
- Json::Value params;
- prepareMessage(root);
- root["method"] = "MB.unsubscribeFrom";
- params["propertyName"] = property;
- root["params"] = params;
- sendJsonMessage(root);
- }
-
- void* CMessageBrokerController::MethodForReceiverThread(void * arg)
- {
- stop = false;
- arg = arg; // to avoid compiler warnings
- while(!stop)
- {
- std::string data = "";
- Recv(data);
- }
- return NULL;
- }
-
- bool CMessageBrokerController::checkMessage(Json::Value& root, Json::Value& error)
- {
- DBG_MSG(("CMessageBrokerController::checkMessage()\n"));
- Json::Value err;
-
- try
- {
- /* check the JSON-RPC version => 2.0 */
- if (!root.isObject() || !root.isMember("jsonrpc") || root["jsonrpc"] != "2.0")
- {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = NsMessageBroker::INVALID_REQUEST;
- err["message"] = "Invalid MessageBroker request.";
- error["error"] = err;
- return false;
- }
-
- if (root.isMember("id") && (root["id"].isArray() || root["id"].isObject()))
- {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = NsMessageBroker::INVALID_REQUEST;
- err["message"] = "Invalid MessageBroker request.";
- error["error"] = err;
- return false;
- }
-
- if (root.isMember("result") && root.isMember("error"))
- {
- /* message can't contain simultaneously result and error*/
- return false;
- }
-
- if (root.isMember("method"))
- {
- if (!root["method"].isString())
- {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = NsMessageBroker::INVALID_REQUEST;
- err["message"] = "Invalid MessageBroker request.";
- error["error"] = err;
- return false;
- }
- /* Check the params is an object*/
- if (root.isMember("params") && !root["params"].isObject())
- {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid JSONRPC params.";
- error["error"] = err;
- return false;
- }
- } else if (!root.isMember("result") && !root.isMember("error"))
- {
- return false;
- }
- return true;
- } catch (...)
- {
- DBG_MSG_ERROR(("CMessageBrokerController::checkMessage() EXCEPTION has been caught!\n"));
- return false;
- }
- }
-
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp b/src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp
deleted file mode 100644
index 02db417c26..0000000000
--- a/src/3rd_party-static/message_broker/src/client/mb_tcpclient.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * \file mb_tcpclient.cpp
- * \brief MessageBroker TCP client.
- * \author AKara
- */
-
-#include "mb_tcpclient.hpp"
-#include "MBDebugHelper.h"
-
-namespace NsMessageBroker
-{
-
- TcpClient::TcpClient(const std::string& address, uint16_t port) : Client(address, port)
- {
- m_protocol = networking::TCP;
- }
-
- TcpClient::~TcpClient()
- {
- }
-
- ssize_t TcpClient::Send(const std::string& data)
- {
- std::string rep = data;
- int bytesToSend = rep.length();
- const char* ptrBuffer = rep.c_str();
- do
- {
- int retVal = send(m_sock, ptrBuffer, bytesToSend, 0);
- if(retVal == -1)
- {
- return -1;
- }
- bytesToSend -= retVal;
- ptrBuffer += retVal;
- }while(bytesToSend > 0);
- return rep.length();
- }
-
- ssize_t TcpClient::Recv(std::string& data)
- {
- char buf[1500];
- ssize_t nb = -1;
-
- if((nb = ::recv(m_sock, buf, sizeof(buf), 0)) == -1)
- {
- std::cerr << "Error while receiving" << std::endl;
- return -1;
- }
-
- data = std::string(buf, nb);
- DBG_MSG(("Received from server: %s\n", data.c_str()));
-
- return nb;
- }
-
-} /* namespace NsMessageBroker */
-
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp
deleted file mode 100644
index 77ab1ca2c1..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * \file MessageBrokerControllerAVA.cpp
- * \brief MessageBroker Controller for Avatar.
- * \author AKara
- */
-
-#include <ctime>
-
-#include "MessageBrokerControllerAVA.hpp"
-
-#include "MBDebugHelper.h"
-
-extern int start;
-
-namespace NsMessageBroker
-{
- CMessageBrokerControllerAVA::CMessageBrokerControllerAVA(const std::string& address, uint16_t port):
- CMessageBrokerController(address, port, "AVA")
- {
- }
-
- CMessageBrokerControllerAVA::~CMessageBrokerControllerAVA()
- {
- }
-
- void CMessageBrokerControllerAVA::processRequest(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerAVA::processRequest()\n"));
- root=root;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerAVA::processNotification(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerAVA::processNotification()\n"));
- root=root;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerAVA::processResponse(std::string method, Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerAVA::processResponse()\n"));
- DWORD stop = GetTickCount();
- int diff = stop - start;
- std::string id = root["id"].asString();
- printf("Execution time for id %s is %d ms!\n", id.c_str(), diff);
- root=root;//to prevent compiler warning
- method=method;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerAVA::makeCall(std::string phoneNumber)
- {
- DBG_MSG(("CMessageBrokerControllerAVA::makeCall()\n"));
- Json::Value request, params;
- prepareMessage(request);
- request["method"] = "Phone.makeCall";
- params["phoneNumber"] = phoneNumber;
- request["params"] = params;
- sendJsonMessage(request);
- }
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp
deleted file mode 100644
index 47e684a7e4..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerAVA.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * \file MessageBrokerControllerAVA.hpp
- * \brief MessageBroker Controller AVA.
- * \author AKara
- */
-
-#ifndef MB_CONTROLLERAVA_H
-#define MB_CONTROLLERAVA_H
-
-#include <iostream>
-
-#include "json/json.h"
-
-#include "mb_controller.hpp"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \class CMessageBrokerControllerAVA
- * \brief MessageBroker Controller.
- */
- class CMessageBrokerControllerAVA : public CMessageBrokerController
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN
- * \param port remote local port
- */
- CMessageBrokerControllerAVA(const std::string& address, uint16_t port);
-
- /**
- * \brief Destructor.
- */
- ~CMessageBrokerControllerAVA();
-
- /**
- * \brief process request.
- * \param root JSON message.
- */
- void processRequest(Json::Value& root);
-
- /**
- * \brief process notification.
- * \param root JSON message.
- */
- void processNotification(Json::Value& root);
-
- /**
- * \brief process response.
- * \param method method name which has been called.
- * \param root JSON message.
- */
- void processResponse(std::string method, Json::Value& root);
-
- /**
- * \brief sends message to the phone to make call.
- * \param phoneNumber number for call.
- */
- void makeCall(std::string phoneNumber);
-
- };
-}/* namespace NsMessageBroker */
-#endif /* MB_CONTROLLERAVA_H */ \ No newline at end of file
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp
deleted file mode 100644
index cbbe39492b..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * \file MessageBrokerControllerBackend.cpp
- * \brief MessageBroker Controller for Backend.
- * \author AKara
- */
-
-#include "MessageBrokerControllerBackend.hpp"
-
-#include "MBDebugHelper.h"
-
-namespace NsMessageBroker
-{
- CMessageBrokerControllerBackend::CMessageBrokerControllerBackend(const std::string& address, unsigned short port):
-CMessageBrokerController(address, port, std::string("Backend"))
- {
- }
-
- CMessageBrokerControllerBackend::~CMessageBrokerControllerBackend()
- {
- }
-
- void CMessageBrokerControllerBackend::processRequest(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::processRequest()\n"));
- if (getControllersName() == getDestinationComponentName(root))
- {
- Json::Value response;
- response["jsonrpc"] = root["jsonrpc"];
- response["id"] = root["id"];
- if ("isFirstStart" == getMethodName(root))
- {
- isFirstStart(response);
- } else if ("isFullScreen" == getMethodName(root))
- {
- isFullScreen(response);
- } else if ("getWindowSize" == getMethodName(root))
- {
- getWindowSize(response);
- } else if ("getWindowDensity" == getMethodName(root))
- {
- getWindowDensity(response);
- } else if ("getOSInfo" == getMethodName(root))
- {
- getOSInfo(response);
- } else if ("logToOS" == getMethodName(root))
- {
- logToOS(response);
- } else
- {
- DBG_MSG_ERROR(("Method has not been found!\n"));
- Json::Value err;
- err["code"] = NsMessageBroker::INVALID_REQUEST;
- err["message"] = "Method has not been found.";
- response["error"] = err;
- }
- sendJsonMessage(response);
- } else
- {
- DBG_MSG_ERROR(("Wrong message destination!\n"));
- }
- }
-
- void CMessageBrokerControllerBackend::processNotification(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::processNotification()\n"));
- root=root;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerBackend::processResponse(std::string method, Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::processResponse()\n"));
- root=root;//to prevent compiler warning
- method=method;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerBackend::isFirstStart(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::isFirstStart()\n"));
- Json::Value res;
- res["isFirstStart"] = false;
- response["result"] = res;
- }
-
- void CMessageBrokerControllerBackend::isFullScreen(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::isFullScreen()\n"));
- Json::Value res;
- res["isFullScreen"] = false;
- response["result"] = res;
- }
-
- void CMessageBrokerControllerBackend::getWindowSize(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::getWindowSize()\n"));
- Json::Value res;
- res["width"] = 800;
- res["height"] = 480;
- response["result"] = res;
- }
-
- void CMessageBrokerControllerBackend::getWindowDensity(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::getWindowDensity()\n"));
- Json::Value res;
- res["windowDensity"] = 1;
- response["result"] = res;
- }
-
- void CMessageBrokerControllerBackend::getOSInfo(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::getOSInfo()\n"));
- Json::Value res;
- res["osType"] = "";
- res["osVersion"] = "";
- res["isNativeApplication"] = true;
- response["result"] = res;
- }
-
- void CMessageBrokerControllerBackend::logToOS(Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerBackend::logToOS()\n"));
- response["result"] = "";
- }
-
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp
deleted file mode 100644
index b79411dc98..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerBackend.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * \file MessageBrokerControllerBackend.hpp
- * \brief MessageBroker Controller Backend.
- * \author AKara
- */
-#pragma once
-
-#include <iostream>
-
-#include "json/json.h"
-
-#include "mb_controller.hpp"
-#include "CMessageBroker.hpp"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \class CMessageBrokerControllerBackend
- * \brief MessageBroker Controller.
- */
-
- class CMessageBrokerControllerBackend : public CMessageBrokerController
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN
- * \param port remote local port
- */
- CMessageBrokerControllerBackend(const std::string& address, unsigned short port);
-
- /**
- * \brief Destructor.
- */
- ~CMessageBrokerControllerBackend();
-
- /**
- * \brief process request.
- * \param root JSON message.
- */
- void processRequest(Json::Value& root);
-
- /**
- * \brief process notification.
- * \param root JSON message.
- */
- void processNotification(Json::Value& root);
-
- /**
- * \brief process response.
- * \param method method name which has been called.
- * \param root JSON message.
- */
- void processResponse(std::string method, Json::Value& root);
- private:
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void isFirstStart(Json::Value& response);
-
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void isFullScreen(Json::Value& response);
-
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void getWindowSize(Json::Value& response);
-
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void getWindowDensity(Json::Value& response);
-
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void getOSInfo(Json::Value& response);
-
- /**
- * \brief Checks first start.
- * \param response container for response
- */
- void logToOS(Json::Value& response);
- };
-}/* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp
deleted file mode 100644
index 6f308e71c2..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * \file MessageBrokerControllerPhone.cpp
- * \brief MessageBroker Controller for Phone.
- * \author AKara
- */
-
-#include "MessageBrokerControllerPhone.hpp"
-
-#include "CMessageBroker.hpp"
-
-#include "MBDebugHelper.h"
-
-namespace NsMessageBroker
-{
- CMessageBrokerControllerPhone::CMessageBrokerControllerPhone(const std::string& address, uint16_t port):
- CMessageBrokerController(address, port, "Phone")
- {
- }
-
- CMessageBrokerControllerPhone::~CMessageBrokerControllerPhone()
- {
- }
-
- void CMessageBrokerControllerPhone::processRequest(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::processRequest()\n"));
- if (getControllersName() == getDestinationComponentName(root))
- {
- Json::Value response;
- response["jsonrpc"] = root["jsonrpc"];
- response["id"] = root["id"];
- if ("makeCall" == getMethodName(root))
- {
- if (root.isMember("params"))
- {
- Json::Value params = root["params"];
- if (params.isMember("phoneNumber") && params["phoneNumber"].isString())
- {
- makeCall(params["phoneNumber"].asString(), response);
- } else
- {
- DBG_MSG_ERROR(("Wrong params!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Wrong params!", response);
- }
- } else
- {
- DBG_MSG_ERROR(("Not possible to parse phone number!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Not possible to parse phone number!", response);
- }
- } else if ("endCall" == getMethodName(root))
- {
- endCall(root["params"].asString(), response);
- } else if ("holdCall" == getMethodName(root))
- {
- holdCall(root["params"].asString(), response);
- } else if ("getContacts" == getMethodName(root))
- {
- if (root.isMember("params"))
- {
- Json::Value params = root["params"];
- if (params.isMember("firstLetter") && params["firstLetter"].isString()
- && params.isMember("offset") && params["offset"].isInt()
- && params.isMember("numberOfItems") && params["numberOfItems"].isInt())
- {
- getContacts(params["firstLetter"].asString(), params["offset"].asInt(), params["numberOfItems"].asInt(), response);
- } else
- {
- DBG_MSG_ERROR(("Wrong params of getContacts()!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Wrong params of getContacts()!", response);
- }
- } else
- {
- DBG_MSG_ERROR(("Params is not an object!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Params is not an object!", response);
- }
- } else if ("getHistory" == getMethodName(root))
- {
- if (root.isMember("params"))
- {
- Json::Value params = root["params"];
- if (params.isMember("typeOfContacts") && params["typeOfContacts"].isString()
- && params.isMember("offset") && params["offset"].isInt()
- && params.isMember("numberOfItems") && params["numberOfItems"].isInt())
- {
- getHistory(params["typeOfContacts"].asString(), params["offset"].asInt(), params["numberOfItems"].asInt(), response);
- } else
- {
- DBG_MSG_ERROR(("Wrong params of getHistory()!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Wrong params of getHistory()!", response);
- }
- } else
- {
- DBG_MSG_ERROR(("Params is not an object!\n"));
- prepareErrorMessage(NsMessageBroker::INVALID_PARAMS, "Params is not an object!", response);
- }
- } else
- {
- DBG_MSG_ERROR(("Method has not been found!\n"));
- Json::Value err;
- err["code"] = NsMessageBroker::INVALID_REQUEST;
- err["message"] = "Method has not been found.";
- response["error"] = err;
- }
- sendJsonMessage(response);
- } else
- {
- DBG_MSG_ERROR(("Wrong message destination!\n"));
- }
- }
-
- void CMessageBrokerControllerPhone::makeCall(std::string phoneNumber, Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::makeCall()\n"));
- phoneNumber = phoneNumber; // to avoid compiler's warning
- response["result"] = "OK";
- }
-
- void CMessageBrokerControllerPhone::endCall(std::string phoneNumber, Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::endCall()\n"));
- phoneNumber = phoneNumber; // to avoid compiler's warning
- response["result"] = "OK";
- }
-
- void CMessageBrokerControllerPhone::holdCall(std::string phoneNumber, Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::holdCall()\n"));
- phoneNumber = phoneNumber; // to avoid compiler's warning
- response["result"] = "OK";
- }
-
- void CMessageBrokerControllerPhone::getContacts(std::string firstLetter, int offset, int numberOfItems, Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::getContacts()\n"));
- firstLetter = firstLetter; // to avoid compiler's warning
- offset = offset; // to avoid compiler's warning
- numberOfItems = numberOfItems; // to avoid compiler's warning
- response["result"] = "OK";
- }
-
- void CMessageBrokerControllerPhone::getHistory(std::string firstLetter, int offset, int numberOfItems, Json::Value& response)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::getHistory()\n"));
- firstLetter = firstLetter; // to avoid compiler's warning
- offset = offset; // to avoid compiler's warning
- numberOfItems = numberOfItems; // to avoid compiler's warning
- response["result"] = "OK";
- }
-
- void CMessageBrokerControllerPhone::onCallStatusChanged(int callStatus)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::onCallStatusChanged()\n"));
- Json::Value request, params;
- request["jsonrpc"] = "2.0";
- request["method"] = "Phone.onCallStatusChanged";
- params["callStatus"] = callStatus;
- request["params"] = params;
- sendJsonMessage(request);
- }
-
- void CMessageBrokerControllerPhone::onContactsUpdated()
- {
- DBG_MSG(("CMessageBrokerControllerPhone::onContactsUpdated()\n"));
- Json::Value request;
- request["jsonrpc"] = "2.0";
- request["method"] = "Phone.onContactsUpdated";
- sendJsonMessage(request);
- }
-
- void CMessageBrokerControllerPhone::onHistoryUpdated()
- {
- DBG_MSG(("CMessageBrokerControllerPhone::onHistoryUpdated()\n"));
- Json::Value request;
- request["jsonrpc"] = "2.0";
- request["method"] = "Phone.onHistoryUpdated";
- sendJsonMessage(request);
- }
-
- void CMessageBrokerControllerPhone::processNotification(Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::processNotification()\n"));
- root=root;//to prevent compiler warning
- }
-
- void CMessageBrokerControllerPhone::processResponse(std::string method, Json::Value& root)
- {
- DBG_MSG(("CMessageBrokerControllerPhone::processResponse()\n"));
- root=root;//to prevent compiler warning
- method = method;
- }
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp
deleted file mode 100644
index e6f4898226..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerControllerPhone.hpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * \file MessageBrokerControllerPhone.hpp
- * \brief MessageBroker Controller Phone.
- * \author AKara
- */
-
-#ifndef MB_CONTROLLERPHONE_H
-#define MB_CONTROLLERPHONE_H
-
-#include <iostream>
-
-#include "json/json.h"
-
-#include "mb_controller.hpp"
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
- /**
- * \class CMessageBrokerControllerPhone
- * \brief MessageBroker Controller Phone.
- */
- class CMessageBrokerControllerPhone : public CMessageBrokerController
- {
- public:
- /**
- * \brief Constructor.
- * \param address remote network address or FQDN
- * \param port remote local port
- */
- CMessageBrokerControllerPhone(const std::string& address, uint16_t port);
-
- /**
- * \brief Destructor.
- */
- ~CMessageBrokerControllerPhone();
-
- /**
- * \brief process request.
- * \param root JSON message.
- */
- void processRequest(Json::Value& root);
-
- /**
- * \brief process notification.
- * \param root JSON message.
- */
- void processNotification(Json::Value& root);
-
- /**
- * \brief process response.
- * \param method method name which has been called.
- * \param root JSON message.
- */
- void processResponse(std::string method, Json::Value& root);
- public://Notifications
- /**
- * \brief Notifies Call Status changing.
- * \param callStatus status of current active call
- */
- void onCallStatusChanged(int callStatus);
-
- /**
- * \brief Notifies Contacts list updated.
- */
- void onContactsUpdated();
-
- /**
- * \brief Notifies History list updated.
- */
- void onHistoryUpdated();
- private:
- /**
- * \brief Makes call.
- * \param phoneNumber number for call.
- * \param response container for response
- */
- void makeCall(std::string phoneNumber, Json::Value& response);
-
- /**
- * \brief Ends call.
- * \param phoneNumber number of call.
- * \param response container for response
- */
- void endCall(std::string phoneNumber, Json::Value& response);
-
- /**
- * \brief Holds call.
- * \param phoneNumber number of call.
- * \param response container for response
- */
- void holdCall(std::string phoneNumber, Json::Value& response);
-
- /**
- * \brief Gets contacts.
- * \param firstLetter first letter of list.
- * \param offset offset from first item
- * \param numberOfItems number of expected items
- * \param response container for response
- */
- void getContacts(std::string firstLetter, int offset, int numberOfItems, Json::Value& response);
-
- /**
- * \brief Gets history.
- * \param typeOfContacts type of contacts (incoming/outgoing/missed/all calls).
- * \param offset offset from first item
- * \param numberOfItems number of expected items
- * \param response container for response
- */
- void getHistory(std::string typeOfContacts, int offset, int numberOfItems, Json::Value& response);
-
- };
-}/* namespace NsMessageBroker */
-#endif /* MB_CONTROLLERPHONE_H */ \ No newline at end of file
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp
deleted file mode 100644
index 405b3fcbd5..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * \file MessageBrokerServer.cpp
- * \brief MessageBrokerServer sources
- * \author AKara
- */
-
-#include <cstdio>
-#include <cstdlib>
-#include <csignal>
-#include <iostream>
-#include <ctime>
-
-#include "system.h"
-
-#include "MBDebugHelper.h"
-
-#include "mb_tcpserver.hpp"
-#include "mb_tcpclient.hpp"
-#include "CMessageBroker.hpp"
-
-#include "MessageBrokerControllerAVA.hpp"
-#include "MessageBrokerControllerPhone.hpp"
-#include "MessageBrokerControllerBackend.hpp"
-
-/**
- * \brief Signal management.
- * \param code signal code
- */
- static void signal_handler(int code)
- {
- switch(code)
- {
- case SIGINT:
- case SIGTERM:
- break;
- default:
- break;
- }
-}
-
-/**
- * \brief stores start time of test operation.
- */
-int start;
-
-/**
- * \brief Entry point of the program.
- * \param argc number of argument
- * \param argv array of arguments
- * \return EXIT_SUCCESS or EXIT_FAILURE
- */
-int main(int argc, char** argv)
-{
- NsMessageBroker::CMessageBroker* mpMessageBroker = NsMessageBroker::CMessageBroker::getInstance();
- if (!mpMessageBroker)
- {
- DBG_MSG_ERROR(("NULL pointer\n"));
- exit(EXIT_FAILURE);
- }
-
-
- NsMessageBroker::TcpServer server(std::string("127.0.0.1"), 8086, mpMessageBroker);
-
- DBG_MSG(("Start MessageBroker component\n"));
- mpMessageBroker->startMessageBroker(&server);
-
- NsMessageBroker::CMessageBrokerControllerAVA tcpControllerAVA(std::string("127.0.0.1"), 8086);
- NsMessageBroker::CMessageBrokerControllerPhone tcpControllerPhone(std::string("127.0.0.1"), 8086);
- NsMessageBroker::CMessageBrokerControllerBackend tcpControllerBackend(std::string("127.0.0.1"), 8086);
-
- /* avoid compilation warnings */
- argc = argc;
- argv = argv;
-
- if(!networking::init())
- {
- DBG_MSG_ERROR(("Networking initialization failed!\n"));
-
- }
-
- if(signal(SIGTERM, signal_handler) == SIG_ERR)
- {
- DBG_MSG_ERROR(("Error signal SIGTERM will not be handled!\n"));
- }
-
- if(signal(SIGINT, signal_handler) == SIG_ERR)
- {
- DBG_MSG_ERROR(("Error signal SIGINT will not be handled!\n"));
- }
-
- if(!server.Bind())
- {
- DBG_MSG_ERROR(("Bind failed!\n"));
- exit(EXIT_FAILURE);
- } else
- {
- DBG_MSG(("Bind successful!\n"));
- }
-
- if(!server.Listen())
- {
- DBG_MSG_ERROR(("Listen failed!\n"));
- exit(EXIT_FAILURE);
- } else
- {
- DBG_MSG(("Listen successful!\n"));
- }
-
- if(!tcpControllerAVA.Connect())
- {
- DBG_MSG_ERROR(("Cannot connect to remote peer!\n"));
- exit(EXIT_FAILURE);
- } else
- {
- DBG_MSG(("ClientAVA connected to the server! SocketID = %d\n", tcpControllerAVA.GetSocket()));
- }
-
- if(!tcpControllerPhone.Connect())
- {
- DBG_MSG_ERROR(("Cannot connect to remote peer!\n"));
- exit(EXIT_FAILURE);
- } else
- {
- DBG_MSG(("ClientPhone connected to the server! SocketID = %d\n",tcpControllerPhone.GetSocket()));
- }
-
- if(!tcpControllerBackend.Connect())
- {
- DBG_MSG_ERROR(("Cannot connect to remote peer!\n"));
- exit(EXIT_FAILURE);
- } else
- {
- DBG_MSG(("ClientBackend connected to the server! SocketID = %d\n",tcpControllerBackend.GetSocket()));
- }
-
- DBG_MSG(("Start CMessageBroker thread!\n"));
- System::Thread th1(new System::ThreadArgImpl<NsMessageBroker::CMessageBroker>(*mpMessageBroker, &NsMessageBroker::CMessageBroker::MethodForThread, NULL));
- th1.Start(false);
-
- DBG_MSG(("Start MessageBroker TCP server thread!\n"));
- System::Thread th2(new System::ThreadArgImpl<NsMessageBroker::TcpServer>(server, &NsMessageBroker::TcpServer::MethodForThread, NULL));
- th2.Start(false);
-
- DBG_MSG(("Start tcpControllerAVA receiver thread!\n"));
- System::Thread th3(new System::ThreadArgImpl<NsMessageBroker::CMessageBrokerControllerAVA>(tcpControllerAVA, &NsMessageBroker::CMessageBrokerControllerAVA::MethodForReceiverThread, NULL));
- th3.Start(false);
-
- DBG_MSG(("Start tcpControllerPhone receiver thread!\n"));
- System::Thread th4(new System::ThreadArgImpl<NsMessageBroker::CMessageBrokerControllerPhone>(tcpControllerPhone, &NsMessageBroker::CMessageBrokerControllerPhone::MethodForReceiverThread, NULL));
- th4.Start(false);
-
- DBG_MSG(("Start tcpControllerBackend receiver thread!\n"));
- System::Thread th5(new System::ThreadArgImpl<NsMessageBroker::CMessageBrokerControllerBackend>(tcpControllerBackend, &NsMessageBroker::CMessageBrokerControllerBackend::MethodForReceiverThread, NULL));
- th5.Start(false);
-
- bool loop = true;
- while(loop)
- {
- DBG_MSG(("Enter command code:\n"));
- int i;
- std::cin >> i;
- switch(i)
- {
- case 0:
- {
- DBG_MSG(("Exit!\n"));
- mpMessageBroker->stopMessageBroker();
- th1.Stop();
- th2.Stop();
- th3.Stop();
- th4.Stop();
- server.Close();
- loop = false;
- break;
- }
- case 1:// register component
- {
- DBG_MSG(("tcpControllerAVA.register()\n"));
- tcpControllerAVA.registerController(0);
- DBG_MSG(("tcpControllerPhone.register()\n"));
- tcpControllerPhone.registerController(1);
- DBG_MSG(("tcpControllerBackend.register()\n"));
- tcpControllerBackend.registerController(2);
- break;
- }
- case 2:// external message
- {
- DBG_MSG(("tcpControllerAVA.Phone.Call()\n"));
- start = GetTickCount();
- tcpControllerAVA.makeCall("+380677639550");
- break;
- }
- case 3://subscribe
- {
- DBG_MSG(("tcpControllerAVA.subscribeTo()\n"));
- tcpControllerAVA.subscribeTo("Phone.onContactsUpdated");
- break;
- }
- case 4://notify
- {
- DBG_MSG(("tcpControllerPhone.onContactsUpdated()\n"));
- tcpControllerPhone.onContactsUpdated();
- break;
- }
- case 5: //unsubscribe
- {
- DBG_MSG(("tcpControllerAVA.unsubscribeFrom()\n"));
- tcpControllerAVA.unsubscribeFrom("Phone.onContactsUpdated");
- break;
- }
- case 6: //unregister
- {
- DBG_MSG(("tcpControllerPhone.unregister()\n"));
- tcpControllerPhone.unregisterController();
- break;
- }
- case 7: //stress test
- {
-
- DBG_MSG(("tcpControllerAVA.Phone.Call() 500 times\n"));
- start = GetTickCount();
- for (int c =0; c<1000; c++)
- {
- tcpControllerAVA.makeCall("+380677639550");
- }
- int stop = GetTickCount();
- int diff = stop - start;
- printf("Requests execution time is %d ms!\n", diff);
- break;
- }
- case 8: //parser test
- {
- DBG_MSG(("Parser test\n"));
- mpMessageBroker->Test();
- break;
- }
- default:
- {
- DBG_MSG(("Entered: %d\n", i));
- break;
- }
- }
- }
- return EXIT_SUCCESS;
-} \ No newline at end of file
diff --git a/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp b/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp
deleted file mode 100644
index 884ed0309f..0000000000
--- a/src/3rd_party-static/message_broker/src/example/MessageBrokerServer.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * \file MessageBrokerServer.hpp
- * \brief MessageBrokerServer header
- * \author AKara
- */
-
-#ifndef MESSAGEBROKERSERVER_H
-#define MESSAGEBROKERSERVER_H
-
-/**
- * \namespace NsMessageBroker
- * \brief MessageBroker related functions.
- */
-namespace NsMessageBroker
-{
-
-} /* namespace NsMessageBroker */
-
-#endif /* MESSAGEBROKERSERVER_H */
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp
deleted file mode 100644
index 3b14489a8c..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp
+++ /dev/null
@@ -1,958 +0,0 @@
-/**
- * \file CMessageBroker.cpp
- * \brief CMessageBroker singletone class implementation.
- * \author AKara
- */
-
-#include <cassert>
-#include <stdio.h>
-#include <vector>
-
-#include <string>
-
-#include "CMessageBroker.hpp"
-#include "CMessageBrokerRegistry.hpp"
-
-#include "system.h"
-
-#include "json/json.h"
-
-#include "libMBDebugHelper.h"
-
-namespace NsMessageBroker {
-/**
- * \class CMessage
- * \brief CMessage class implementation.
- */
-class CMessage {
- public:
- /**
- * \brief Constructor.
- */
- CMessage(int aSenderFp, Json::Value aMessage) {
- mSenderFd = aSenderFp;
- mMessage = aMessage;
- }
-
- /**
- * \brief Destructor.
- */
- ~CMessage() {
- }
-
- /**
- * \brief getter for Json::Value message.
- * \return Json::Value message.
- */
- Json::Value getMessage() const {
- return mMessage;
- }
-
- /**
- * \brief getter for sender FileDescriptor.
- * \return sender FileDescriptor.
- */
- int getSenderFd() const {
- return mSenderFd;
- }
- private:
- /**
- * \brief sender FileDescriptor.
- */
- int mSenderFd;
-
- /**
- * \brief Json::Value message.
- */
- Json::Value mMessage;
-};
-
-
-class CMessageBroker_Private {
- public:
- /**
- * \brief Constructor.
- */
- CMessageBroker_Private();
-
- /**
- * \brief Check if que empty (Thread safe).
- * \return True when empty.
- */
- bool isEventQueueEmpty();
-
- /**
- * \brief Pop message from que (Thread safe).
- * \return Pointer to CMessage.
- */
- CMessage* popMessage();
-
- /**
- * \brief Push message to que (Thread safe).
- * \param pMessage pointer to new CMessage object.
- */
- void pushMessage(CMessage* pMessage);
-
- /**
- * \brief gets destination component name.
- * \param pMessage JSON message.
- * \return string destination component name.
- */
- std::string getDestinationComponentName(CMessage* pMessage);
-
- /**
- * \brief gets method name.
- * \param pMessage JSON message.
- * \return string method name.
- */
- std::string getMethodName(CMessage* pMessage);
-
- /**
- * \brief checks is message notification or not.
- * \param pMessage JSON message.
- * \return true if notification.
- */
- bool isNotification(CMessage* pMessage);
-
- /**
- * \brief checks is message response or not.
- * \param pMessage JSON message.
- * \return true if response.
- */
- bool isResponse(CMessage* pMessage);
-
- /**
- * \brief checks message.
- * \param pMessage JSON message.
- * \param error JSON message to fill in case of any errors.
- * \return true if message is good.
- */
- bool checkMessage(CMessage* pMessage, Json::Value& error);
-
- /**
- * \brief Process internal MessageBrocker message
- *
- * \brief Register controller in MessageBroker.
- * Use following JSON command to register new component:
- * \code
- * {"jsonrpc": "2.0", "method": "MB.registerComponent", "params": "<ComponentName>"}
- * \endcode
- *
- * \brief Unregister controller in MessageBroker.
- * Use following JSON command to unregister component:
- * \code
- * {"jsonrpc": "2.0", "method": "MB.unregisterComponent", "params": "<ComponentName>"}
- * \endcode
- *
- * \brief Subscribe controller on property change.
- * Use following JSON command to subscribe to notifications:
- * \code
- * {"jsonrpc": "2.0", "method": "MB.subscribeTo", "params": "<ComponentName>.<NotificationName>"}
- * \endcode
- *
- * \brief Unsubscribe controller from property change.
- * Use following JSON command to unsubscribe from notifications:
- * \code
- * {"jsonrpc": "2.0", "method": "MB.unsubscribeFrom", "params": "<ComponentName>.<NotificationName>"}
- * \endcode
- *
- * \param pMessage JSON message.
- */
- void processInternalMessage(CMessage* pMessage);
-
- /**
- * \brief process external message.
- * \param pMessage JSON message.
- */
- void processExternalMessage(CMessage* pMessage);
-
- /**
- * \brief process response.
- * \param pMessage JSON message.
- */
- void processResponse(CMessage* pMessage);
-
- /**
- * \brief Process notification message.
- * \brief Notify subscribers about property change.
- * expected notification format example:
- * \code
- * {"jsonrpc": "2.0", "method": "<ComponentName>.<NotificationName>", "params": <list of params>}
- * \endcode
- * \param pMessage JSON message.
- */
- void processNotification(CMessage* pMessage);
-
- /**
- * \brief send error message.
- * \param pMessage JSON message.
- */
- void processError(CMessage* pMessage);
-
- /**
- * \brief send Json message.
- * \param fd FileDescriptor of socket.
- * \param message JSON message.
- */
- void sendJsonMessage(int fd, Json::Value message);
-
- /**
- * \brief push message to wait response que.
- * \param pMessage JSON message.
- */
- void pushMessageToWaitQue(CMessage* pMessage);
-
- /**
- * \brief Returns start position for Id's generator of controller.
- * \return start position for Id's generator of controller (1000 id's).
- */
- int getNextControllerIdDiapason() {
- return 1000 * mControllersIdCounter++;
- }
-
- /**
- * \brief pop message from wait response que.
- * \param pMessage JSON message.
- */
- int popMessageFromWaitQue(CMessage* pMessage);
-
- /**
- * \brief Tries to remove the parsed part of the buffer
- * \param root Parsed JSON value
- * \param aJSONData The string buffer
- * \return true on success, false on failure
- */
- bool cutParsedJSON(const Json::Value& root, std::string& aJSONData);
-
- /**
- * \brief Finds the position just after a JSON object or array in a buffer
- * \param isObject Must be true for object, false for array
- * \param aJSONData The string buffer
- * \return The position in the buffer after the object or array on success,
- * std::strin::npos on failure
- */
- size_t jumpOverJSONObjectOrArray(bool isObject, const std::string& aJSONData);
-
- /**
- * \brief Finds the position just after a JSON string in a buffer
- * \param aJSONData The string buffer
- * \return The position in the buffer after the string on success,
- * std::strin::npos on failure
- */
- size_t jumpOverJSONString(const std::string& aJSONData);
-
- /**
- * \brief Que of messages.
- */
- std::deque<CMessage*> mMessagesQueue;
-
- /**
- * \brief Counter of messages Id's diapason for the next controllers
- * From mControllersIdCounter*1000 to mControllersIdCounter*1000+999.
- */
- int mControllersIdCounter;
-
- /**
- * \brief Que of messages which are waiting the response in format: MessageId:SenderFd.
- */
- std::map<int, int> mWaitResponseQueue;
-
- /**
- * \brief Pointer to sender.
- */
- CSender* mpSender;
-
- /**
- * \brief Pointer to registry.
- */
- CMessageBrokerRegistry* mpRegistry;
-
- /**
- * \brief JSON reader.
- */
- Json::Reader m_reader;
-
- /**
- * \brief JSON writer.
- */
- Json::FastWriter m_writer;
-
- /**
- * \brief JSON writer for receiver.
- */
- Json::FastWriter m_recieverWriter;
-
- /**
- * \brief Messages que mutex.
- */
- System::Mutex mMessagesQueueMutex;
-
- /**
- * \brief Binary semaphore that is used to notify the
- * messaging thread that a new message is available.
- */
- System::BinarySemaphore m_messageQueueSemaphore;
-};
-
-CMessageBroker_Private::CMessageBroker_Private() :
- mControllersIdCounter(1),
- mpSender(NULL) {
- mpRegistry = CMessageBrokerRegistry::getInstance();
-}
-
-
-CMessageBroker::CMessageBroker() :
- p(new CMessageBroker_Private()) {
-}
-
-CMessageBroker::~CMessageBroker() {
- delete p, p = 0;
-}
-
-CMessageBroker* CMessageBroker::getInstance() {
- static CMessageBroker instance;
- return &instance;
-}
-
-
-size_t CMessageBroker_Private::jumpOverJSONObjectOrArray(bool isObject,
- const std::string& aJSONData) {
- const char openBracket = isObject? '{' : '[';
- const char closeBracket = isObject? '}' : ']';
- int open_minus_close_brackets(1);
- size_t position = aJSONData.find(openBracket); // Find the beginning of the object
-
- while ((position != std::string::npos) && (open_minus_close_brackets > 0)) {
- position = aJSONData.find_first_of(std::string("\"")+openBracket+closeBracket,
- position+1);
- if (std::string::npos == position) {
- break;
- }
- if ('"' == aJSONData[position]) {
- // Ignore string interior, which might contain brackets and escaped "-s
- do {
- position = aJSONData.find('"', position+1); // Find the closing quote
- } while ((std::string::npos != position) && ('\\' == aJSONData[position-1]));
- } else if (openBracket == aJSONData[position]) {
- ++open_minus_close_brackets;
- } else if (closeBracket == aJSONData[position]) {
- --open_minus_close_brackets;
- }
- }
-
- if ((0 == open_minus_close_brackets) && (std::string::npos != position)) {
- ++position; // Move after the closing bracket
- } else {
- position = std::string::npos;
- }
-
- return position;
-}
-
-
-size_t CMessageBroker_Private::jumpOverJSONString(const std::string& aJSONData) {
- size_t position = aJSONData.find('"'); // Find the beginning of the string
-
- do {
- position = aJSONData.find('"', position+1); // Find the closing quote
- } while ((std::string::npos != position) && ('\\' == aJSONData[position-1]));
-
- if (std::string::npos != position) {
- ++position; // Move after the closing quote
- }
-
- return position;
-}
-
-
-bool CMessageBroker_Private::cutParsedJSON(const Json::Value& root,
- std::string& aJSONData) {
- if (root.isNull() || aJSONData.empty()) {
- DBG_MSG_ERROR(("JSON is null or the buffer is empty!\n"));
- return false;
- }
-
- std::string parsed_json_str = m_recieverWriter.write(root);
- DBG_MSG(("Parsed JSON string: '%s'\n", parsed_json_str.c_str()));
-
- // Trim front spaces (if any)
- const size_t nonempty_position = aJSONData.find_first_not_of(" \t\n\v\f\r");
- aJSONData.erase(0, nonempty_position);
- if (std::string::npos == nonempty_position) {
- DBG_MSG_ERROR(("Buffer contains only blanks!\n"));
- return false;
- }
-
- // JSON writer puts '\n' at the end. Remove it.
- const size_t final_lf_pos = parsed_json_str.rfind('\n');
- if (final_lf_pos == parsed_json_str.length()-1) {
- parsed_json_str.erase(final_lf_pos, 1);
- }
-
- /* RFC 4627: "A JSON value MUST be an object, array, number, or string, or
- * one of the following three literal names: false null true"
- * So we will try to find the borders of the parsed part based on its type. */
-
- size_t position(std::string::npos);
-
- if (0 == aJSONData.find(parsed_json_str)) {
- // If by chance parsed JSON is the same in the buffer and is at the beginning
- position = parsed_json_str.length();
- } else if (root.isObject() || root.isArray()) {
- position = jumpOverJSONObjectOrArray(root.isObject(), aJSONData);
- } else if (root.isString()) {
- position = jumpOverJSONString(aJSONData);
- } else if (root.isNumeric()) {
- position = aJSONData.find_first_not_of("+-0123456789.eE");
- } else if (root.isBool() || ("null" == parsed_json_str)) {
- position = aJSONData.find(parsed_json_str);
- if (std::string::npos != position) {
- position += parsed_json_str.length();
- }
- } else {
- DBG_MSG_ERROR(("Unknown JSON type!\n"));
- }
-
- if (std::string::npos == position) {
- DBG_MSG_ERROR(("Error finding JSON object boundaries!\n"));
- /* This should not happen, because the string is already parsed as a
- * valid JSON. If this happens then above code is wrong. It is better
- * to assert() than just return here, because otherwise we may enter an
- * endless cycle - fail to process one and the same message again and
- * again. Or we may clear the buffer and return, but in this way we will
- * loose the next messages, miss a bug here, and create another bug. */
- assert(std::string::npos != position);
- return false; // For release version
- }
-
- if ((position >= aJSONData.length()) ||
- ((position == aJSONData.length()-1) && isspace(aJSONData[position]))) {
- // No next object. Clear entire aJSONData.
- aJSONData = "";
- } else {
- // There is another object. Clear the current one.
- aJSONData.erase(0, position);
- }
-
- return true;
-}
-
-
-void CMessageBroker::onMessageReceived(int fd, std::string& aJSONData, bool tryHard) {
- DBG_MSG(("CMessageBroker::onMessageReceived(%d, '%s')\n", fd, aJSONData.c_str()));
-
- while (! aJSONData.empty()) {
- Json::Value root;
- if ((! p->m_reader.parse(aJSONData, root)) || root.isNull()) {
- DBG_MSG_ERROR(("Unable to parse JSON!"));
- if (! tryHard) {
- return;
- }
- uint8_t first_byte = static_cast<uint8_t>(aJSONData[0]);
- if ((first_byte <= 0x08) || ((first_byte >= 0x80) && (first_byte <= 0x88))) {
- DBG_MSG((" There is an unparsed websocket header probably.\n"));
- /* Websocket headers can have FIN flag set in the first byte (0x80).
- * Then there are 3 zero bits and 4 bits for opcode (from 0x00 to 0x0A).
- * But actually we don't use opcodes above 0x08.
- * Use this fact to distinguish websocket header from payload text data.
- * It can be a coincidence of course, but we have to give it a try. */
- return;
- } else if ('{' == aJSONData[0]) {
- DBG_MSG_ERROR((" Incomplete JSON object probably.\n"));
- return;
- } else {
- DBG_MSG_ERROR((" Step in the buffer and try again...\n"));
- aJSONData.erase(0, 1);
- DBG_MSG_ERROR(("Buffer after cut is: '%s'\n", aJSONData.c_str()));
- continue;
- }
-
- } else if (! root.isObject()) {
- /* JSON RPC 2.0 messages are objects. Batch calls must be pre-rpocessed,
- * so no need for "and !root.isArray()" */
- DBG_MSG_ERROR(("Parsed JSON is not an object!\n"));
- if (! tryHard) {
- return;
- }
- // Cut parsed data from the buffer below and continue
-
- } else if ((!root.isMember("jsonrpc")) || (root["jsonrpc"]!="2.0")) {
- DBG_MSG_ERROR(("'jsonrpc' is not set correctly in parsed JSON!\n"));
- if (! tryHard) {
- return;
- }
- // Cut parsed object from the buffer below and continue
-
- } else {
- // Parsing successful. Pass the message up.
- p->pushMessage(new CMessage(fd, root));
- }
-
- p->cutParsedJSON(root, aJSONData);
-
- DBG_MSG(("Buffer after cut is: '%s'\n", aJSONData.c_str()));
- }
-}
-
-void CMessageBroker::Test() {
- Json::Value root, err;
- std::string ReceivingBuffer =
- "{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"AVA\"}}123{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"AVA\"}}";
- DBG_MSG(("String is:%s\n", ReceivingBuffer.c_str()));
- while (1) {
- if (!p->m_reader.parse(ReceivingBuffer, root)) {
- DBG_MSG_ERROR(("Received not JSON string! %s\n", ReceivingBuffer.c_str()));
- return;
- }
- std::string wmes = p->m_recieverWriter.write(root);
- DBG_MSG(("Parsed JSON string:%s; length: %d\n", wmes.c_str(), wmes.length()));
- DBG_MSG(("Buffer is:%s\n", ReceivingBuffer.c_str()));
- ssize_t beginpos = ReceivingBuffer.find(wmes);
- ReceivingBuffer.erase(0, beginpos + wmes.length());
- DBG_MSG(("Buffer after cut is:%s\n", ReceivingBuffer.c_str()));
- CMessage message(0, root);
- if (p->checkMessage(&message, err)) {
- //here put message to que
- } else {
- DBG_MSG_ERROR(("Wrong message:%s\n", wmes.c_str()));
- }
- }
-}
-
-void CMessageBroker::OnSocketClosed(const int fd) {
- DBG_MSG(("CMessageBroker::OnSocketClosed(%d)\n", fd));
- if (p->mpRegistry) {
- p->mpRegistry->removeControllersByDescriptor(fd);
- }
-}
-
-void CMessageBroker::startMessageBroker(CSender* pSender) {
- DBG_MSG(("CMessageBroker::startMessageBroker()\n"));
- p->mpSender = pSender;
-}
-
-void CMessageBroker::stopMessageBroker() {
- p->mpSender = NULL;
- DBG_MSG(("CMessageBroker::stopMessageBroker()\n"));
-}
-
-CMessage* CMessageBroker_Private::popMessage() {
- CMessage* ret = NULL;
- DBG_MSG(("CMessageBroker::popMessage()\n"));
- mMessagesQueueMutex.Lock();
- if (false == mMessagesQueue.empty()) {
- ret = mMessagesQueue.front();
- mMessagesQueue.pop_front();// delete message from que
- } else {
- DBG_MSG(("Que is empty!\n"));
- }
- mMessagesQueueMutex.Unlock();
- return ret;
-}
-
-void CMessageBroker_Private::pushMessage(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::pushMessage()\n"));
- mMessagesQueueMutex.Lock();
- if (pMessage) {
- mMessagesQueue.push_back(pMessage);
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
- mMessagesQueueMutex.Unlock();
-
- m_messageQueueSemaphore.Notify();
-}
-
-bool CMessageBroker_Private::isEventQueueEmpty() {
- bool bResult = true;
- mMessagesQueueMutex.Lock();
- bResult = mMessagesQueue.empty();
- mMessagesQueueMutex.Unlock();
- return bResult;
-}
-
-std::string CMessageBroker_Private::getDestinationComponentName(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::getDestinationComponentName()\n"));
- std::string ret = "";
- if (pMessage) {
- Json::Value mes = pMessage->getMessage();
- std::string method = mes["method"].asString();
- int pos = method.find(".");
- if (-1 != pos) {
- ret = method.substr(0, pos);
- }
- DBG_MSG(("Destination component is: %s\n", ret.c_str()));
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
- return ret;
-}
-
-std::string CMessageBroker_Private::getMethodName(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::getMethodName()\n"));
- std::string ret = "";
- if (pMessage) {
- Json::Value mes = pMessage->getMessage();
- std::string method = mes["method"].asString();
- int pos = method.find(".");
- if (-1 != pos) {
- ret = method.substr(pos + 1);
- }
- DBG_MSG(("Method is: %s\n", ret.c_str()));
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
- return ret;
-}
-
-bool CMessageBroker_Private::isNotification(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::isNotification()\n"));
- bool ret = false;
- Json::Value mes = pMessage->getMessage();
- if (false == mes.isMember("id")) {
- ret = true;
- }
- DBG_MSG(("Result: %d\n", ret));
- return ret;
-}
-
-bool CMessageBroker_Private::isResponse(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::isResponse()\n"));
- bool ret = false;
- Json::Value mes = pMessage->getMessage();
- if ((true == mes.isMember("result")) || (true == mes.isMember("error"))) {
- ret = true;
- }
- DBG_MSG(("Result: %d\n", ret));
- return ret;
-}
-
-void CMessageBroker_Private::pushMessageToWaitQue(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::pushMessageToWaitQue()\n"));
- if (pMessage) {
- Json::Value root = pMessage->getMessage();
- mWaitResponseQueue.insert(std::map<int, int>::value_type(root["id"].asInt(), pMessage->getSenderFd()));
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
-}
-
-int CMessageBroker_Private::popMessageFromWaitQue(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::popMessageFromWaitQue()\n"));
- int result = -1;
- if (pMessage) {
- Json::Value root = pMessage->getMessage();
- int messageId = root["id"].asInt();
- std::map <int, int>::iterator it;
- it = mWaitResponseQueue.find(messageId);
- if (it != mWaitResponseQueue.end()) {
- result = (*it).second;
- mWaitResponseQueue.erase(it);
- }
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
- DBG_MSG(("Senders Fd: %d\n", result));
- return result;
-}
-
-void CMessageBroker_Private::processInternalMessage(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::processInternalMessage()\n"));
- if (pMessage) {
- std::string amethodName = getMethodName(pMessage);
- DBG_MSG(("Method: %s\n", amethodName.c_str()));
- Json::Value root = pMessage->getMessage();
- if ("registerComponent" == amethodName) {
- Json::Value params = root["params"];
- if (params.isMember("componentName") && params["componentName"].isString()) {
- std::string controllerName = params["componentName"].asString();
- if (mpRegistry->addController(pMessage->getSenderFd(), controllerName)) {
- Json::Value response;
- response["id"] = root["id"];
- response["jsonrpc"] = "2.0";
- response["result"] = getNextControllerIdDiapason();
- sendJsonMessage(pMessage->getSenderFd(), response);
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = CONTROLLER_EXISTS;
- err["message"] = "Controller has been already registered.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Wrong method parameter.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else if ("subscribeTo" == amethodName) {
- Json::Value params = root["params"];
- if (params.isMember("propertyName") && params["propertyName"].isString()) {
- std::string propertyName = params["propertyName"].asString();
- if (mpRegistry->addSubscriber(pMessage->getSenderFd(), propertyName)) {
- Json::Value response;
- response["id"] = root["id"];
- response["jsonrpc"] = "2.0";
- response["result"] = "OK";
- sendJsonMessage(pMessage->getSenderFd(), response);
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = CONTROLLER_EXISTS;
- err["message"] = "Subscribe has been already registered.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Wrong method parameter.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else if ("unregisterComponent" == amethodName) {
- Json::Value params = root["params"];
- if (params.isMember("componentName") && params["componentName"].isString()) {
- std::string controllerName = params["componentName"].asString();
- mpRegistry->deleteController(controllerName);
- Json::Value response;
- response["id"] = root["id"];
- response["jsonrpc"] = "2.0";
- response["result"] = "OK";
- sendJsonMessage(pMessage->getSenderFd(), response);
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Wrong method parameter.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else if ("unsubscribeFrom" == amethodName) {
- Json::Value params = root["params"];
- if (params.isMember("propertyName") && params["propertyName"].isString()) {
- std::string propertyName = params["propertyName"].asString();
- mpRegistry->deleteSubscriber(pMessage->getSenderFd(), propertyName);
- Json::Value response;
- response["id"] = root["id"];
- response["jsonrpc"] = "2.0";
- response["result"] = "OK";
- sendJsonMessage(pMessage->getSenderFd(), response);
- } else {
- Json::Value error, err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Wrong method parameter.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else {
- DBG_MSG(("Unknown method!\n"));
- Json::Value error;
- Json::Value err;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid MessageBroker method.";
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
-}
-
-void CMessageBroker_Private::processExternalMessage(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::processExternalMessage()\n"));
- if (pMessage) {
- std::string destComponentName = getDestinationComponentName(pMessage);
- int destFd = mpRegistry->getDestinationFd(destComponentName);
- Json::Value root = pMessage->getMessage();
- if (0 < destFd) {
- sendJsonMessage(destFd, root);
- pushMessageToWaitQue(pMessage);
- } else {
- // error, controller not found in the registry
- DBG_MSG(("Unknown method!\n"));
- Json::Value error;
- Json::Value err;
- Json::Value error_data;
- error["id"] = root["id"];
- error["jsonrpc"] = "2.0";
- err["code"] = UNSUPPORTED_RESOURCE;
- err["message"] = "Destination controller not found!";
- error_data["method"] = root["method"];
- err["data"] = error_data;
- error["error"] = err;
- processError(new CMessage(pMessage->getSenderFd(), error));
- }
- } else {
- DBG_MSG_ERROR(("NULL pointer\n"));
- }
-}
-
-void CMessageBroker_Private::processResponse(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::processResponse()\n"));
- if (pMessage) {
- int senderFd = popMessageFromWaitQue(pMessage);
- if (-1 != senderFd) {
- sendJsonMessage(senderFd, pMessage->getMessage());
- }
- } else {
- DBG_MSG_ERROR(("NULL pointer\n"));
- }
-}
-
-void CMessageBroker_Private::processNotification(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::processNotification()\n"));
- if (pMessage) {
- Json::Value root = pMessage->getMessage();
- std::string methodName = root["method"].asString();
- DBG_MSG(("Property: %s\n", methodName.c_str()));
- std::vector<int> result;
- int subscribersCount = mpRegistry->getSubscribersFd(methodName, result);
- if (0 < subscribersCount) {
- std::vector<int>::iterator it;
- for (it = result.begin(); it != result.end(); it++) {
- sendJsonMessage(*it, root);
- }
- } else {
- DBG_MSG(("No subscribers for this property!\n"));
- }
- } else {
- DBG_MSG_ERROR(("NULL pointer\n"));
- }
-}
-
-void CMessageBroker_Private::processError(CMessage* pMessage) {
- DBG_MSG(("CMessageBroker::processError()\n"));
- if (pMessage) {
- sendJsonMessage(pMessage->getSenderFd(), pMessage->getMessage());
- delete pMessage;// delete CMessage object with error description!!!
- } else {
- DBG_MSG_ERROR(("NULL pointer\n"));
- }
-}
-
-void CMessageBroker_Private::sendJsonMessage(int fd, Json::Value message) {
- DBG_MSG(("CMessageBroker::sendJsonMessage(%d)\n", fd));
- if (mpSender) {
- std::string mes = m_writer.write(message);
- int retVal = mpSender->Send(fd, mes);
- if (retVal == -1) {
- DBG_MSG_ERROR(("Message hasn't been sent!\n"));
- return;
- }
- DBG_MSG(("Length:%d, Sent: %d bytes\n", mes.length(), retVal));
- } else {
- DBG_MSG_ERROR(("mpSender NULL pointer\n"));
- }
-}
-
-void* CMessageBroker::MethodForThread(void* arg) {
- arg = arg; // to avoid compiler warnings
- while (1) {
- while (!p->isEventQueueEmpty()) {
- CMessage* message = p->popMessage();
- if (message) {
- Json::Value error;
- if (p->checkMessage(message, error)) {
- if (p->isNotification(message)) {
- DBG_MSG(("Message is notification!\n"));
- p->processNotification(message);
- } else if (p->isResponse(message)) {
- DBG_MSG(("Message is response!\n"));
- p->processResponse(message);
- } else {
- if ("MB" == p->getDestinationComponentName(message)) {
- DBG_MSG(("Internal MessageBroker method!\n"));
- p->processInternalMessage(message);
- } else {
- DBG_MSG(("Not MessageBroker method!\n"));
- p->processExternalMessage(message);
- }
- }
- } else {
- DBG_MSG_ERROR(("Message contains wrong data!\n"));
- CMessage* errMessage = new CMessage(message->getSenderFd(), error);
- if (NULL != errMessage) {
- p->processError(errMessage);
- } else {
- DBG_MSG_ERROR(("NULL pointer!\n"));
- }
- }
- delete message;// delete message object
- }
- }
- p->m_messageQueueSemaphore.Wait();
- }
-
- return NULL;
-}
-
-bool CMessageBroker_Private::checkMessage(CMessage* pMessage, Json::Value& error) {
- DBG_MSG(("CMessageBroker::checkMessage()\n"));
- Json::Value root;
- root = pMessage->getMessage();
- Json::Value err;
-
- /* check the JSON-RPC version => 2.0 */
- if (!root.isObject() || !root.isMember("jsonrpc") || root["jsonrpc"] != "2.0") {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid JSON RPC version.";
- error["error"] = err;
- return false;
- }
-
- /* Check the id of message */
- if (root.isMember("id") && (root["id"].isArray() || root["id"].isObject() || root["id"].isString())) {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid ID of message.";
- error["error"] = err;
- return false;
- }
-
- /* extract "method" attribute */
- if (root.isMember("method")) {
- if (!root["method"].isString()) {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid JSONRPC method.";
- error["error"] = err;
- return false;
- }
- /* Check the params is an object*/
- if (root.isMember("params") && !root["params"].isObject()) {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Invalid JSONRPC params.";
- error["error"] = err;
- return false;
- }
- } else if (!(root.isMember("result") || root.isMember("error"))) {
- error["id"] = Json::Value::null;
- error["jsonrpc"] = "2.0";
- err["code"] = INVALID_REQUEST;
- err["message"] = "Unknwn message type.";
- error["error"] = err;
- return false;
- }
- return true;
-}
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
deleted file mode 100644
index fb24d08f1c..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * \file CMessageBrokerRegistry.cpp
- * \brief CMessageBrokerRegistry singletone class implementation.
- * \author AKara
- */
-
-#include "CMessageBrokerRegistry.hpp"
-#include "libMBDebugHelper.h"
-
-#include <vector>
-#include <string>
-
-namespace NsMessageBroker
-{
- CMessageBrokerRegistry::CMessageBrokerRegistry()
- {
- }
-
- CMessageBrokerRegistry::~CMessageBrokerRegistry()
- {
- }
-
- CMessageBrokerRegistry* CMessageBrokerRegistry::getInstance()
- {
- static CMessageBrokerRegistry instance;
- return &instance;
- }
-
- bool CMessageBrokerRegistry::addController(int fd, std::string name)
- {
- DBG_MSG(("CMessageBrokerRegistry::addController()\n"));
- bool result = false;
- std::map <std::string, int>::iterator it;
-
- sync_primitives::AutoLock lock(mControllersListLock);
- it = mControllersList.find(name);
- if (it == mControllersList.end())
- {
- mControllersList.insert(std::map <std::string, int>::value_type(name, fd));
- result = true;
- } else
- {
- DBG_MSG(("Controller already exists!\n"));
- }
-
- DBG_MSG(("Count of controllers: %d\n", mControllersList.size()));
- return result;
- }
-
- void CMessageBrokerRegistry::deleteController(std::string name)
- {
- DBG_MSG(("CMessageBrokerRegistry::deleteController()\n"));
- std::map <std::string, int>::iterator it;
-
- int fd;
- {
- sync_primitives::AutoLock lock(mControllersListLock);
- it = mControllersList.find(name);
- if (it != mControllersList.end())
- {
- fd = it->second;
- mControllersList.erase(it);
- } else {
- DBG_MSG(("No such controller in the list!\n"));
- return;
- }
- DBG_MSG(("Count of controllers: %d\n", mControllersList.size()));
- }
- removeSubscribersByDescriptor(fd);
- }
-
- void CMessageBrokerRegistry::removeControllersByDescriptor(const int fd) {
- DBG_MSG(("CMessageBrokerRegistry::removeControllersByDescriptor(%d)\n",
- fd));
- {
- sync_primitives::AutoLock lock(mControllersListLock);
- std::map <std::string, int>::iterator it = mControllersList.begin();
- for (; it != mControllersList.end();) {
- if (it->second == fd) {
- mControllersList.erase(it++);
- } else {
- ++it;
- }
- }
- }
- removeSubscribersByDescriptor(fd);
- }
-
- void CMessageBrokerRegistry::removeSubscribersByDescriptor(const int fd) {
- DBG_MSG(("CMessageBrokerRegistry::removeSubscribersByDescriptor(%d)\n",
- fd));
- sync_primitives::AutoLock lock(mSubscribersListLock);
- std::multimap <std::string, int>::iterator it_s = mSubscribersList.begin();
- for (; it_s !=mSubscribersList.end(); ) {
- if (it_s->second == fd) {
- mSubscribersList.erase(it_s++);
- } else {
- ++it_s;
- }
- }
- }
-
- bool CMessageBrokerRegistry::addSubscriber(int fd, std::string name)
- {
- DBG_MSG(("CMessageBrokerRegistry::addSubscriber()\n"));
- bool result = true;
-
- sync_primitives::AutoLock lock(mSubscribersListLock);
- std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
- if (p.first != p.second)
- {
- std::multimap <std::string, int>::iterator itr;
- for (itr = p.first; itr != p.second; itr++)
- {
- if (fd == itr->second)
- {
- result = false;
- DBG_MSG(("Subscriber already exists!\n"));
- }
- }
- }
- if (result)
- {
- mSubscribersList.insert(std::map <std::string, int>::value_type(name, fd));
- }
-
- DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size()));
- return result;
- }
-
- void CMessageBrokerRegistry::deleteSubscriber(int fd, std::string name)
- {
- DBG_MSG(("CMessageBrokerRegistry::deleteSubscriber()\n"));
-
- sync_primitives::AutoLock lock(mSubscribersListLock);
- std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
- if (p.first != p.second) {
- std::multimap <std::string, int>::iterator itr;
- for (itr = p.first; itr != p.second; ) {
- DBG_MSG(("My for loop %s, %d", itr->first.c_str() ,itr->second));
- if (fd == itr->second) {
- mSubscribersList.erase(itr++);
- } else {
- ++itr;
- }
- }
- }
-
- DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size()));
- }
-
- int CMessageBrokerRegistry::getDestinationFd(std::string name)
- {
- DBG_MSG(("CMessageBrokerRegistry::getDestinationFd()\n"));
- int result = -1;
- std::map <std::string, int>::iterator it;
-
- sync_primitives::AutoLock lock(mControllersListLock);
- it = mControllersList.find(name);
- if (it != mControllersList.end())
- {
- result = it->second;
- }
-
- DBG_MSG(("Controllers Fd: %d\n", result));
- return result;
- }
-
- int CMessageBrokerRegistry::getSubscribersFd(std::string name, std::vector<int>& result)
- {
- DBG_MSG(("CMessageBrokerRegistry::getSubscribersFd()\n"));
- int res = 0;
- std::map <std::string, int>::iterator it;
-
- sync_primitives::AutoLock lock(mSubscribersListLock);
- std::pair<std::multimap <std::string, int>::iterator, std::multimap <std::string, int>::iterator> p = mSubscribersList.equal_range(name);
- if (p.first != p.second)
- {
- std::multimap <std::string, int>::iterator itr;
- for (itr = p.first; itr != p.second; itr++)
- {
- result.push_back(itr->second);
- DBG_MSG(("Controllers Fd: %d\n", itr->second));
- }
- }
-
- res = result.size();
- DBG_MSG(("Result vector size: %d\n", res));
- return res;
- }
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h b/src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h
deleted file mode 100644
index 0d5260cdda..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/libMBDebugHelper.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * \file libMBDebugHelper.h
- * \brief DebugHelper.
- * \author AKara
- */
-
-#ifndef MB_DEBUG_HELPER_H
-#define MB_DEBUG_HELPER_H
-
-#include <cstdio>
-
-/**
-* \def DEBUG_MB_ON
-* \brief Switches on MessageBroker debug messages.
-*/
-#ifdef DEBUG_MB_ON
-
-/**
-* \def DBG_MSG
-* \brief Debug message output with file name and line number.
-* \param x formatted debug message.
-* \return printf construction.
-*/
-#define DBG_MSG(x) printf("%s:%d_lib ", __FILE__, __LINE__);\
- printf x
-
-/**
- * \def DBG_MSG_ERROR
- * \brief Debug ERROR message output with file name and line number.
- * \param x formatted debug message.
- * \return printf construction.
- */
-#define DBG_MSG_ERROR(x) printf("ERROR!!! %s:%d_lib ", __FILE__, __LINE__);\
- printf x
-
-#else
-
-#define DBG_MSG(x)
-#define DBG_MSG_ERROR(x)
-
-#endif
-
-#endif /*MB_DEBUG_HELPER_H*/
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp
deleted file mode 100644
index b3e347d9d7..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-/* MD5
- converted to C++ class by Frank Thilo (thilo@unix-ag.org)
- for bzflag (http://www.bzflag.org)
-
- based on:
-
- md5.h and md5.c
- reference implemantion of RFC 1321
-
- Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
- rights reserved.
-
- License to copy and use this software is granted provided that it
- is identified as the "RSA Data Security, Inc. MD5 Message-Digest
- Algorithm" in all material mentioning or referencing this software
- or this function.
-
- License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
- RSA Data Security, Inc. makes no representations concerning either
- the merchantability of this software or the suitability of this
- software for any particular purpose. It is provided "as is"
- without express or implied warranty of any kind.
-
- These notices must be retained in any copies of any part of this
- documentation and/or software.
-
- */
-
-/* interface header */
-#include "md5.h"
-
-/* system implementation headers */
-#include <stdio.h>
-#include <memory.h>
-
-// Constants for MD5Transform routine.
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-///////////////////////////////////////////////
-
-// F, G, H and I are basic MD5 functions.
-inline MD5::uint4 MD5::F(uint4 x, uint4 y, uint4 z) {
- return (x&y) | (~x&z);
-}
-
-inline MD5::uint4 MD5::G(uint4 x, uint4 y, uint4 z) {
- return (x&z) | (y&~z);
-}
-
-inline MD5::uint4 MD5::H_(uint4 x, uint4 y, uint4 z) {
- return x^y^z;
-}
-
-inline MD5::uint4 MD5::I(uint4 x, uint4 y, uint4 z) {
- return y ^ (x | ~z);
-}
-
-// rotate_left rotates x left n bits.
-inline MD5::uint4 MD5::rotate_left(uint4 x, int n) {
- return (x << n) | (x >> (32-n));
-}
-
-// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
-// Rotation is separate from addition to prevent recomputation.
-inline void MD5::FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {
- a = rotate_left(a+ F(b,c,d) + x + ac, s) + b;
-}
-
-inline void MD5::GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {
- a = rotate_left(a + G(b,c,d) + x + ac, s) + b;
-}
-
-inline void MD5::HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {
- a = rotate_left(a + H_(b,c,d) + x + ac, s) + b;
-}
-
-inline void MD5::II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {
- a = rotate_left(a + I(b,c,d) + x + ac, s) + b;
-}
-
-//////////////////////////////////////////////
-
-// default ctor, just initailize
-MD5::MD5()
-{
- init();
-}
-
-//////////////////////////////////////////////
-
-// nifty shortcut ctor, compute MD5 for string and finalize it right away
-MD5::MD5(const std::string &text)
-{
- init();
- update(text.c_str(), text.length());
- finalize();
-}
-
-//////////////////////////////
-
-void MD5::init()
-{
- finalized=false;
-
- count[0] = 0;
- count[1] = 0;
-
- // load magic initialization constants.
- state[0] = 0x67452301;
- state[1] = 0xefcdab89;
- state[2] = 0x98badcfe;
- state[3] = 0x10325476;
-}
-
-//////////////////////////////
-
-// decodes input (unsigned char) into output (uint4). Assumes len is a multiple of 4.
-void MD5::decode(uint4 output[], const uint1 input[], size_type len)
-{
- for (unsigned int i = 0, j = 0; j < len; i++, j += 4)
- output[i] = ((uint4)input[j]) | (((uint4)input[j+1]) << 8) |
- (((uint4)input[j+2]) << 16) | (((uint4)input[j+3]) << 24);
-}
-
-//////////////////////////////
-
-// encodes input (uint4) into output (unsigned char). Assumes len is
-// a multiple of 4.
-void MD5::encode(uint1 output[], const uint4 input[], size_type len)
-{
- for (size_type i = 0, j = 0; j < len; i++, j += 4) {
- output[j] = input[i] & 0xff;
- output[j+1] = (input[i] >> 8) & 0xff;
- output[j+2] = (input[i] >> 16) & 0xff;
- output[j+3] = (input[i] >> 24) & 0xff;
- }
-}
-
-//////////////////////////////
-
-// apply MD5 algo on a block
-void MD5::transform(const uint1 block[blocksize])
-{
- uint4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
- decode (x, block, blocksize);
-
- /* Round 1 */
- FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
- FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
- FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
- FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
- FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
- FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
- FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
- FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
- FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
- FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
- GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
- GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
- GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
- GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
- GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
- GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
- GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
- GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
- HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
- HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
- HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
- HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
- HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
- II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
- II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
- II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
- II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
- II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
- II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
- II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
- II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
- II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
- II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
- II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
-
- // Zeroize sensitive information.
- memset(x, 0, sizeof x);
-}
-
-//////////////////////////////
-
-// MD5 block update operation. Continues an MD5 message-digest
-// operation, processing another message block
-void MD5::update(const unsigned char input[], size_type length)
-{
- // compute number of bytes mod 64
- size_type index = count[0] / 8 % blocksize;
-
- // Update number of bits
- if ((count[0] += (length << 3)) < (length << 3))
- count[1]++;
- count[1] += (length >> 29);
-
- // number of bytes we need to fill in buffer
- size_type firstpart = 64 - index;
-
- size_type i;
-
- // transform as many times as possible.
- if (length >= firstpart)
- {
- // fill buffer first, transform
- memcpy(&buffer[index], input, firstpart);
- transform(buffer);
-
- // transform chunks of blocksize (64 bytes)
- for (i = firstpart; i + blocksize <= length; i += blocksize)
- transform(&input[i]);
-
- index = 0;
- }
- else
- i = 0;
-
- // buffer remaining input
- memcpy(&buffer[index], &input[i], length-i);
-}
-
-//////////////////////////////
-
-// for convenience provide a verson with signed char
-void MD5::update(const char input[], size_type length)
-{
- update((const unsigned char*)input, length);
-}
-
-//////////////////////////////
-
-// MD5 finalization. Ends an MD5 message-digest operation, writing the
-// the message digest and zeroizing the context.
-MD5& MD5::finalize()
-{
- static unsigned char padding[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- if (!finalized) {
- // Save number of bits
- unsigned char bits[8];
- encode(bits, count, 8);
-
- // pad out to 56 mod 64.
- size_type index = count[0] / 8 % 64;
- size_type padLen = (index < 56) ? (56 - index) : (120 - index);
- update(padding, padLen);
-
- // Append length (before padding)
- update(bits, 8);
-
- // Store state in digest
- encode(digest, state, 16);
-
- // Zeroize sensitive information.
- memset(buffer, 0, sizeof buffer);
- memset(count, 0, sizeof count);
-
- finalized=true;
- }
-
- return *this;
-}
-
-//////////////////////////////
-
-void MD5::getdigest(char *digest) const
-{
- if (!finalized)
- return;
-
- if (digest == NULL)
- return;
-
- memcpy(digest, this->digest, 16);
-}
-
-// return hex representation of digest as string
-std::string MD5::hexdigest() const
-{
- if (!finalized)
- return "";
-
- char buf[33];
- for (int i=0; i<16; i++)
- sprintf(buf+i*2, "%02x", digest[i]);
- buf[32]=0;
-
- return std::string(buf);
-}
-
-//////////////////////////////
-
-std::ostream& operator<<(std::ostream& out, MD5 md5)
-{
- return out << md5.hexdigest();
-}
-
-//////////////////////////////
-
-std::string md5(const std::string str)
-{
- MD5 md5 = MD5(str);
-
- return md5.hexdigest();
-} \ No newline at end of file
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h b/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h
deleted file mode 100644
index 2c54c03b1b..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/md5.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* MD5
- converted to C++ class by Frank Thilo (thilo@unix-ag.org)
- for bzflag (http://www.bzflag.org)
-
- based on:
-
- md5.h and md5.c
- reference implementation of RFC 1321
-
- Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
- rights reserved.
-
- License to copy and use this software is granted provided that it
- is identified as the "RSA Data Security, Inc. MD5 Message-Digest
- Algorithm" in all material mentioning or referencing this software
- or this function.
-
- License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
- RSA Data Security, Inc. makes no representations concerning either
- the merchantability of this software or the suitability of this
- software for any particular purpose. It is provided "as is"
- without express or implied warranty of any kind.
-
- These notices must be retained in any copies of any part of this
- documentation and/or software.
-
- */
-
-#ifndef BZF_MD5_H
-#define BZF_MD5_H
-
-#include <string>
-#include <iostream>
-
-// a small class for calculating MD5 hashes of strings or byte arrays
-// it is not meant to be fast or secure
-//
-// usage: 1) feed it blocks of uchars with update()
-// 2) finalize()
-// 3) get hexdigest() string
-// or
-// MD5(std::string).hexdigest()
-//
-// assumes that char is 8 bit and int is 32 bit
-class MD5
-{
-public:
- typedef unsigned int size_type; // must be 32bit
-
- MD5();
- MD5(const std::string& text);
- void update(const unsigned char *buf, size_type length);
- void update(const char *buf, size_type length);
- MD5& finalize();
- void getdigest(char *digest) const; // digest must be 16 bytes long
- std::string hexdigest() const;
- friend std::ostream& operator<<(std::ostream&, MD5 md5);
-
-private:
- void init();
- typedef unsigned char uint1; // 8bit
- typedef unsigned int uint4; // 32bit
- enum {blocksize = 64}; // VC6 won't eat a const static int here
-
- void transform(const uint1 block[blocksize]);
- static void decode(uint4 output[], const uint1 input[], size_type len);
- static void encode(uint1 output[], const uint4 input[], size_type len);
-
- bool finalized;
- uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk
- uint4 count[2]; // 64bit counter for number of bits (lo, hi)
- uint4 state[4]; // digest so far
- uint1 digest[16]; // the result
-
- // low level logic operations
- static inline uint4 F(uint4 x, uint4 y, uint4 z);
- static inline uint4 G(uint4 x, uint4 y, uint4 z);
- static inline uint4 H_(uint4 x, uint4 y, uint4 z);
- static inline uint4 I(uint4 x, uint4 y, uint4 z);
- static inline uint4 rotate_left(uint4 x, int n);
- static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
- static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
- static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
- static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
-};
-
-std::string md5(const std::string str);
-
-#endif \ No newline at end of file
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp
deleted file mode 100644
index 456362f9d8..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/system.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * JsonRpc-Cpp - JSON-RPC implementation.
- * Copyright (C) 2008-2011 Sebastien Vincent <sebastien.vincent@cppextrem.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * \file system.cpp
- * \brief System utils.
- * \author Sebastien Vincent
- */
-
-#include <time.h>
-#include <signal.h>
-
-#include "system.h"
-
-namespace System {
-
-void msleep(unsigned long ms) {
-#ifdef _WIN32
- Sleep(ms);
-#else
- /* Unix */
- struct timespec req;
- req.tv_sec = ms / 1000;
- req.tv_nsec = (ms % 1000) * 1000000;
- nanosleep(&req, NULL);
-#endif
-}
-
-ThreadArg::~ThreadArg() {
-}
-
-#ifndef WIN32
-
-/* POSIX specific part for thread and mutex */
-
-Thread::Thread(ThreadArg* arg) {
- m_arg = arg;
-}
-
-Thread::~Thread() {
- delete m_arg;
-}
-
-bool Thread::Start(bool detach) {
- pthread_attr_t attr;
- int ret = -1;
-
- /* must have valid object argument */
- if (m_arg == NULL) {
- return false;
- }
-
- /* set the detach state value */
- if (pthread_attr_init(&attr) != 0) {
- return false;
- }
-
- if (pthread_attr_setdetachstate(&attr, detach ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE) != 0) {
- pthread_attr_destroy(&attr);
- return false;
- }
-
- /* create thread */
- ret = pthread_create(&m_id, &attr, &Thread::Call, this);
- pthread_setname_np(m_id, "MB Thread");
- pthread_attr_destroy(&attr);
- return ret == 0;
-}
-
-bool Thread::Stop() {
- pthread_cancel(m_id);
- return false;// Android does not support 'pthread_cancel';
-}
-
-bool Thread::Join(void** ret) {
- return pthread_join(m_id, ret) == 0;
-}
-
-void* Thread::Call(void* arg) {
- // Disable system signals receiving in thread
- // by setting empty signal mask
- // (system signals processes only in the main thread)
- sigset_t set;
- sigfillset(&set);
- pthread_sigmask(SIG_SETMASK, &set, NULL);
-
- Thread* thread = static_cast<Thread*>(arg);
-
- /* call our specific object method */
- return thread->m_arg->Call();
-}
-
-Mutex::Mutex() {
- pthread_mutexattr_t attr;
-
- pthread_mutexattr_init(&attr);
- pthread_mutex_init(&m_mutex, &attr);
- pthread_mutexattr_destroy(&attr);
-}
-
-Mutex::~Mutex() {
- pthread_mutex_destroy(&m_mutex);
-}
-
-bool Mutex::Lock() {
- return !pthread_mutex_lock(&m_mutex);
-}
-
-bool Mutex::Unlock() {
- return !pthread_mutex_unlock(&m_mutex);
-}
-
-
-// Based on Binary Semaphores example at
-// http://www.mathcs.emory.edu/~cheung/Courses/455/Syllabus/5c-pthreads/sync.html
-BinarySemaphore::BinarySemaphore() :
- m_mutex(PTHREAD_MUTEX_INITIALIZER),
- m_cond(PTHREAD_COND_INITIALIZER),
- m_isUp(false) {
- pthread_mutex_init(&m_mutex, NULL);
- pthread_cond_init(&m_cond, NULL);
-}
-
-BinarySemaphore::~BinarySemaphore() {
- pthread_cond_destroy(&m_cond);
- pthread_mutex_destroy(&m_mutex);
-}
-
-void BinarySemaphore::Wait() {
- // try to get exclusive access to the flag
- pthread_mutex_lock(&m_mutex);
- // success: no other thread can get here unless
- // the current thread unlocks the mutex
-
- // wait until the flag is up
- while (!m_isUp) {
- pthread_cond_wait(&m_cond, &m_mutex);
- // when the current thread executes this, it will be
- // blocked on m_cond, and automatically unlocks the
- // mutex! Unlocking the mutex will let other threads
- // in to test the flag.
- }
-
- // here we know that flag is upand this thread has now
- // successfully passed the semaphore
-
- // this will cause all other threads that execute the Wait()
- // call to wait in the above loop
- m_isUp = false;
-
- // release the exclusive access to the flag
- pthread_mutex_unlock(&m_mutex);
-}
-
-void BinarySemaphore::Notify() {
- // try to get exclusive access to the flag
- pthread_mutex_lock(&m_mutex);
-
- // this call may resume a thread that is blocked on m_cond
- // (in the Wait() call). if there was none, this does nothing
- pthread_cond_signal(&m_cond);
-
- // up the flag
- m_isUp = true;
-
- // release the exclusive access to the flag
- pthread_mutex_unlock(&m_mutex);
-}
-
-#else
-
-/* Windows specific part for thread and mutex */
-
-Thread::Thread(ThreadArg* arg) {
- m_arg = arg;
-}
-
-Thread::~Thread() {
- delete m_arg;
-}
-
-bool Thread::Start(bool detach) {
- detach = detach; /* unused parameter */
-
- m_id = CreateThread(NULL, /* default security attributes */
- 0, /* use default stack size */
- &Thread::Call, /* thread function name */
- this, /* argument to thread function */
- 0, /* use default creation flags */
- NULL); /* returns the thread identifier */
-
- return m_id != NULL;
-}
-
-bool Thread::Stop() {
- return TerminateThread(m_id, (DWORD) - 1);
-}
-
-bool Thread::Join(void** ret) {
- DWORD val = 0;
- WaitForSingleObject(m_id, INFINITE);
- GetExitCodeThread(m_id, &val);
- CloseHandle(m_id);
- m_id = NULL;
- *ret = (void*)val;
- return true;
-}
-
-DWORD WINAPI Thread::Call(LPVOID arg) {
- Thread* thread = static_cast<Thread*>(arg);
-
- /* call our specific object method */
-#ifdef _WIN64
- return (DWORD64)thread->m_arg->Call();
-#else
- return (DWORD)thread->m_arg->Call();
-#endif
-}
-
-Mutex::Mutex() {
- m_mutex = CreateMutex(NULL, /* no security attribute */
- 0, /* not initial owner (i.e. no first lock) */
- NULL); /* no name */
-}
-
-Mutex::~Mutex() {
- /* free mutex */
- if (m_mutex) {
- CloseHandle(m_mutex);
- }
-}
-
-bool Mutex::Lock() {
- if (!m_mutex) {
- return false;
- }
-
- return (WaitForSingleObject(m_mutex, INFINITE) == WAIT_OBJECT_0);
-}
-
-bool Mutex::Unlock() {
- if (!m_mutex) {
- return false;
- }
-
- return ReleaseMutex(m_mutex);
-}
-
-#endif
-
-} /* namespace System */
-
diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp
deleted file mode 100644
index 7d3890b7a8..0000000000
--- a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp
+++ /dev/null
@@ -1,667 +0,0 @@
-/**
- * \file websocket_handler.cpp
- * \brief WebSocket Handler.
- * \author AKara
- */
-
-#include <cstdio>
-
-#include <cstring>
-#include <sstream>
-#include <netinet/in.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#endif//_WIN32
-
-#include "websocket_handler.hpp"
-
-#include "libMBDebugHelper.h"
-#include "md5.h"
-
-namespace NsMessageBroker
-{
-
- unsigned int CWebSocketHandler::parseWebSocketDataLength(
- const char* Buffer, unsigned int& b_size) {
-
- unsigned char payload =
- (unsigned char)((Buffer[1] & 0x40) | (Buffer[1] & 0x20) |
- (Buffer[1] & 0x10) | (Buffer[1] & 0x08) | (Buffer[1] & 0x04) |
- (Buffer[1] & 0x02) | (Buffer[1] & 0x01));
- unsigned long length = 0;
- unsigned char position = 2; // current buffer position
-
- switch(payload) {
- case 126:
- {
- length = (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- break;
- }
- case 127:
- {
- length = (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- length <<=8;
- length |= (unsigned char)Buffer[position++];
- break;
- }
- default:
- {
- length = payload;
- return length;
- }
- }
-
- return length;
- }
-
- int CWebSocketHandler::parseWebSocketData(char* Buffer, unsigned int& b_size) {
- // Please see RFC6455 standard protocol specification:
- //http://tools.ietf.org/html/rfc6455
- // Chapter 5.2
- DBG_MSG(("CWebSocketHandler::parseWebSocketData()b_size = %d\n", b_size));
- char* recBuffer = Buffer;
- unsigned int parsedBufferPosition = 0;
- unsigned char position = 0; // current buffer position
- unsigned int size = b_size;
-
- static uint32_t minimum_heade_size = 4;
- while (minimum_heade_size < size) {
-
- bool fin = ((recBuffer[0] & 0x80) | (recBuffer[0] & 0x01)) == 0x81;
- bool rsv1 = (recBuffer[0] & 0x40) == 0x40;
- bool rsv2 = (recBuffer[0] & 0x20) == 0x20;
- bool rsv3 = (recBuffer[0] & 0x10) == 0x10;
- unsigned char opCode = ((recBuffer[0] & 0x08) | (recBuffer[0] & 0x04) |
- (recBuffer[0] & 0x02) | (recBuffer[0] & 0x01));
-
- bool mask = (recBuffer[1] & 0x80) == 0x80;
-
- DBG_MSG(("CWebSocketHandler::fin = %d recBuffer[0] = 0x%02X\n"
- " parsedlength = %d b_size= %d parsedBufferPosition = %d\n"
- "rsv1 = %d, rsv2 = %d, rsv3 = %d, opCode = %u\n",
- fin, recBuffer[0], parsedBufferPosition + position,
- size, parsedBufferPosition, rsv1, rsv2, rsv3, opCode));
-
- if ((rsv1)|(rsv2)|(rsv3)) {
- DBG_MSG(("rsv1 or rsv2 or rsv3 is 0 \n"));
- break;
- }
-
- switch(opCode) {
- case 0x0: break; //Continuation frame
- case 0x1: break; //Text Frame
- case 0x2: break; //Binary Frame
- case 0x8: break; //Connection close Frame
- case 0x9: break; //ping Frame
- case 0xA: break; //Pong Frame
- default: break; //Unknown frame
- }
-
- if (false == fin) {
- break;
- }
-
- unsigned char payload = (unsigned char)
- ((recBuffer[1] & 0x40) | (recBuffer[1] & 0x20) | (recBuffer[1] & 0x10) |
- (recBuffer[1] & 0x08) | (recBuffer[1] & 0x04) | (recBuffer[1] & 0x02) |
- (recBuffer[1] & 0x01));
-
- unsigned long length = parseWebSocketDataLength(recBuffer, size);
- position = 2;
-
- if (length > size) {
- DBG_MSG_ERROR(("Incomplete message"));
- break;
- }
-
- switch(payload) {
- case 126: {
- position +=2;
- break;
- }
- case 127: {
- position +=8;
- break;
- }
- default: {
- break;
- }
- }
-
- if (mask) {
- unsigned char maskKeys[4];
- maskKeys[0] = recBuffer[position++];
- maskKeys[1] = recBuffer[position++];
- maskKeys[2] = recBuffer[position++];
- maskKeys[3] = recBuffer[position++];
- DBG_MSG(("CWebSocketHandler::parseWebSocketData()maskKeys[0]:0x%02X;"
- "maskKeys[1]:0x%02X; maskKeys[2]:0x%02X; maskKeys[3]:0x%02X\n"
- , maskKeys[0], maskKeys[1], maskKeys[2], maskKeys[3]));
- for (unsigned long i = position; i < position+length; i++)
- {
- recBuffer[i] = recBuffer[i] ^ maskKeys[(i-position)%4];
- }
- }
- DBG_MSG(("CWebSocketHandler::parseWebSocketData()length:%d; size:%d;"
- " position:%d\n", (int)length, size, position));
-
- for (unsigned long i = 0; (i < size); i++) {
- Buffer[parsedBufferPosition + i] = recBuffer[i+position];
- }
- b_size -= position;
- parsedBufferPosition += length;
- recBuffer += length;
- size -= length+position;
- }
- return b_size;
- }
-
- int CWebSocketHandler::prepareWebSocketDataHeader(unsigned char* Buffer,
- unsigned long long b_size)
- {
- unsigned int headerLength = 2;
- unsigned char payload;
-
- memset(Buffer, 0, headerLength);
- Buffer[0] = 0x81; // 129
-
- if (b_size <= 125)
- {
- payload = b_size;
- Buffer[1] = b_size; // string length
- } else if (b_size >= 126 && b_size <= 65535)
- {
- headerLength += 2;
- payload = 126;
- Buffer[1] = 0x7E; // 126
- } else
- {
- headerLength += 8;
- payload = 127;
- Buffer[1] = 0x7F; // 127
- }
-
-
- if (payload == 126)
- {
- Buffer[2] = (b_size>>8);
- Buffer[3] = b_size;
- } else if (payload == 127)
- {
- Buffer[9] = (b_size & 0xFF);
- Buffer[8] = ((b_size>>8) & 0xFF);
- Buffer[7] = ((b_size>>16) & 0xFF);
- Buffer[6] = ((b_size>>24) & 0xFF);
- Buffer[5] = ((b_size>>32) & 0xFF);
- Buffer[4] = ((b_size>>40) & 0xFF);
- Buffer[3] = ((b_size>>48) & 0xFF);
- Buffer[2] = ((b_size>>56) & 0xFF);
- }
- return headerLength;
-}
-
- void CWebSocketHandler::handshake_0405(std::string &key)
- {
- static const char *websocket_magic_guid_04 =
- "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
- char accept_buf[MAX_WEBSOCKET_04_KEY_LEN + 37];
- unsigned char hash[20] = {0xb3, 0x7a, 0x4f, 0x2c, 0xc0, 0x62, 0x4f, 0x16, 0x90, 0xf6, 0x46, 0x06, 0xcf, 0x38, 0x59, 0x45, 0xb2, 0xbe, 0xc4, 0xea};
- int accept_len;
-
- strncpy(accept_buf, key.c_str(), MAX_WEBSOCKET_04_KEY_LEN + 37);
- strncpy(accept_buf + key.length(), websocket_magic_guid_04,
- MAX_WEBSOCKET_04_KEY_LEN + 37 - strlen(key.c_str()));
-
- SHA1((unsigned char *)accept_buf, key.length() + strlen(websocket_magic_guid_04), hash);
-
- accept_len = lws_b64_encode_string((char *)hash, 20, accept_buf, sizeof accept_buf);
- if (accept_len < 0)
- {
- fprintf(stderr, "Base64 encoded hash too long\n");
- }
- fprintf(stderr, "accept_buf: %s\n", accept_buf);
- key = accept_buf;
- }
-
- void CWebSocketHandler::sha1_step(struct sha1_ctxt *ctxt)
- {
- unsigned int a, b, c, d, e;
- size_t t, s;
- unsigned int tmp;
-
- struct sha1_ctxt tctxt;
-
- memcpy(&tctxt.m.b8[0], &ctxt->m.b8[0], 64);
- ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2];
- ctxt->m.b8[2] = tctxt.m.b8[1]; ctxt->m.b8[3] = tctxt.m.b8[0];
- ctxt->m.b8[4] = tctxt.m.b8[7]; ctxt->m.b8[5] = tctxt.m.b8[6];
- ctxt->m.b8[6] = tctxt.m.b8[5]; ctxt->m.b8[7] = tctxt.m.b8[4];
- ctxt->m.b8[8] = tctxt.m.b8[11]; ctxt->m.b8[9] = tctxt.m.b8[10];
- ctxt->m.b8[10] = tctxt.m.b8[9]; ctxt->m.b8[11] = tctxt.m.b8[8];
- ctxt->m.b8[12] = tctxt.m.b8[15]; ctxt->m.b8[13] = tctxt.m.b8[14];
- ctxt->m.b8[14] = tctxt.m.b8[13]; ctxt->m.b8[15] = tctxt.m.b8[12];
- ctxt->m.b8[16] = tctxt.m.b8[19]; ctxt->m.b8[17] = tctxt.m.b8[18];
- ctxt->m.b8[18] = tctxt.m.b8[17]; ctxt->m.b8[19] = tctxt.m.b8[16];
- ctxt->m.b8[20] = tctxt.m.b8[23]; ctxt->m.b8[21] = tctxt.m.b8[22];
- ctxt->m.b8[22] = tctxt.m.b8[21]; ctxt->m.b8[23] = tctxt.m.b8[20];
- ctxt->m.b8[24] = tctxt.m.b8[27]; ctxt->m.b8[25] = tctxt.m.b8[26];
- ctxt->m.b8[26] = tctxt.m.b8[25]; ctxt->m.b8[27] = tctxt.m.b8[24];
- ctxt->m.b8[28] = tctxt.m.b8[31]; ctxt->m.b8[29] = tctxt.m.b8[30];
- ctxt->m.b8[30] = tctxt.m.b8[29]; ctxt->m.b8[31] = tctxt.m.b8[28];
- ctxt->m.b8[32] = tctxt.m.b8[35]; ctxt->m.b8[33] = tctxt.m.b8[34];
- ctxt->m.b8[34] = tctxt.m.b8[33]; ctxt->m.b8[35] = tctxt.m.b8[32];
- ctxt->m.b8[36] = tctxt.m.b8[39]; ctxt->m.b8[37] = tctxt.m.b8[38];
- ctxt->m.b8[38] = tctxt.m.b8[37]; ctxt->m.b8[39] = tctxt.m.b8[36];
- ctxt->m.b8[40] = tctxt.m.b8[43]; ctxt->m.b8[41] = tctxt.m.b8[42];
- ctxt->m.b8[42] = tctxt.m.b8[41]; ctxt->m.b8[43] = tctxt.m.b8[40];
- ctxt->m.b8[44] = tctxt.m.b8[47]; ctxt->m.b8[45] = tctxt.m.b8[46];
- ctxt->m.b8[46] = tctxt.m.b8[45]; ctxt->m.b8[47] = tctxt.m.b8[44];
- ctxt->m.b8[48] = tctxt.m.b8[51]; ctxt->m.b8[49] = tctxt.m.b8[50];
- ctxt->m.b8[50] = tctxt.m.b8[49]; ctxt->m.b8[51] = tctxt.m.b8[48];
- ctxt->m.b8[52] = tctxt.m.b8[55]; ctxt->m.b8[53] = tctxt.m.b8[54];
- ctxt->m.b8[54] = tctxt.m.b8[53]; ctxt->m.b8[55] = tctxt.m.b8[52];
- ctxt->m.b8[56] = tctxt.m.b8[59]; ctxt->m.b8[57] = tctxt.m.b8[58];
- ctxt->m.b8[58] = tctxt.m.b8[57]; ctxt->m.b8[59] = tctxt.m.b8[56];
- ctxt->m.b8[60] = tctxt.m.b8[63]; ctxt->m.b8[61] = tctxt.m.b8[62];
- ctxt->m.b8[62] = tctxt.m.b8[61]; ctxt->m.b8[63] = tctxt.m.b8[60];
-
- a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
-
- for (t = 0; t < 20; t++)
- {
- s = t & 0x0f;
- if (t >= 16)
- W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^
- W((s+2) & 0x0f) ^ W(s));
-
- tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
- e = d; d = c; c = S(30, b); b = a; a = tmp;
- }
- for (t = 20; t < 40; t++)
- {
- s = t & 0x0f;
- W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^
- W((s+2) & 0x0f) ^ W(s));
- tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
- e = d; d = c; c = S(30, b); b = a; a = tmp;
- }
- for (t = 40; t < 60; t++)
- {
- s = t & 0x0f;
- W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^
- W((s+2) & 0x0f) ^ W(s));
- tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
- e = d; d = c; c = S(30, b); b = a; a = tmp;
- }
- for (t = 60; t < 80; t++)
- {
- s = t & 0x0f;
- W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^
- W((s+2) & 0x0f) ^ W(s));
- tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
- e = d; d = c; c = S(30, b); b = a; a = tmp;
- }
-
- H(0) = H(0) + a;
- H(1) = H(1) + b;
- H(2) = H(2) + c;
- H(3) = H(3) + d;
- H(4) = H(4) + e;
-
- memset(&ctxt->m.b8[0], 0, 64);
- }
-
- void CWebSocketHandler::sha1_init(struct sha1_ctxt *ctxt)
- {
- memset(ctxt, 0, sizeof(struct sha1_ctxt));
- H(0) = 0x67452301;
- H(1) = 0xefcdab89;
- H(2) = 0x98badcfe;
- H(3) = 0x10325476;
- H(4) = 0xc3d2e1f0;
- }
-
- void CWebSocketHandler::sha1_pad(struct sha1_ctxt *ctxt)
- {
- size_t padlen; /*pad length in bytes*/
- size_t padstart;
-
- PUTPAD(0x80);
-
- padstart = COUNT % 64;
- padlen = 64 - padstart;
- if (padlen < 8)
- {
- memset(&ctxt->m.b8[padstart], 0, padlen);
- COUNT += padlen;
- COUNT %= 64;
- sha1_step(ctxt);
- padstart = COUNT % 64; /* should be 0 */
- padlen = 64 - padstart; /* should be 64 */
- }
- memset(&ctxt->m.b8[padstart], 0, padlen - 8);
- COUNT += (padlen - 8);
- COUNT %= 64;
-
- PUTPAD(ctxt->c.b8[7]); PUTPAD(ctxt->c.b8[6]);
- PUTPAD(ctxt->c.b8[5]); PUTPAD(ctxt->c.b8[4]);
- PUTPAD(ctxt->c.b8[3]); PUTPAD(ctxt->c.b8[2]);
- PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]);
- }
-
- void CWebSocketHandler::sha1_loop(struct sha1_ctxt *ctxt, const unsigned char *input, size_t len)
- {
- size_t gaplen;
- size_t gapstart;
- size_t off;
- size_t copysiz;
-
- off = 0;
-
- while (off < len)
- {
- gapstart = COUNT % 64;
- gaplen = 64 - gapstart;
-
- copysiz = (gaplen < len - off) ? gaplen : len - off;
- memcpy(&ctxt->m.b8[gapstart], &input[off], copysiz);
- COUNT += copysiz;
- COUNT %= 64;
- ctxt->c.b64[0] += copysiz * 8;
- if (COUNT % 64 == 0)
- sha1_step(ctxt);
- off += copysiz;
- }
- }
-
- void CWebSocketHandler::sha1_result(struct sha1_ctxt *ctxt, unsigned char* digest0)
- {
- unsigned char *digest;
-
- digest = (unsigned char *)digest0;
- sha1_pad(ctxt);
- digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2];
- digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0];
- digest[4] = ctxt->h.b8[7]; digest[5] = ctxt->h.b8[6];
- digest[6] = ctxt->h.b8[5]; digest[7] = ctxt->h.b8[4];
- digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
- digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
- digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
- digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
- digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
- digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];
- }
-
- /*
- * This should look and work like the libcrypto implementation
- */
-
- unsigned char * CWebSocketHandler::SHA1(const unsigned char *d, size_t n, unsigned char *md)
- {
- struct sha1_ctxt ctx;
-
- sha1_init(&ctx);
- sha1_loop(&ctx, d, n);
- sha1_result(&ctx, (unsigned char*)md);
-
- return md;
- }
-
- int CWebSocketHandler::lws_b64_encode_string(const char *in, int in_len, char *out, int out_size)
- {
- unsigned char triple[3];
- int i;
- int len;
- int line = 0;
- int done = 0;
-
- while (in_len)
- {
- len = 0;
- for (i = 0; i < 3; i++)
- {
- if (in_len)
- {
- triple[i] = *in++;
- len++;
- in_len--;
- } else
- triple[i] = 0;
- }
- if (len)
- {
-
- if (done + 4 >= out_size)
- return -1;
-
- *out++ = encode[triple[0] >> 2];
- *out++ = encode[((triple[0] & 0x03) << 4) |
- ((triple[1] & 0xf0) >> 4)];
- *out++ = (len > 1 ? encode[((triple[1] & 0x0f) << 2) |
- ((triple[2] & 0xc0) >> 6)] : '=');
- *out++ = (len > 2 ? encode[triple[2] & 0x3f] : '=');
-
- done += 4;
- line += 4;
- }
- if (line >= 72)
- {
-
- if (done + 2 >= out_size)
- return -1;
-
- *out++ = '\r';
- *out++ = '\n';
- done += 2;
- line = 0;
- }
- }
-
- if (done + 1 >= out_size)
- return -1;
-
- *out++ = '\0';
-
- return done;
- }
-
- /*
- * returns length of decoded string in out, or -1 if out was too small
- * according to out_size
- */
-
- int CWebSocketHandler::lws_b64_decode_string(const char *in, char *out, int out_size)
- {
- int len;
- int i;
- int done = 0;
- unsigned char v;
- unsigned char quad[4];
-
- while (*in)
- {
-
- len = 0;
- for (i = 0; i < 4 && *in; i++)
- {
-
- v = 0;
- while (*in && !v)
- {
-
- v = *in++;
- v = (v < 43 || v > 122) ? 0 : decode[v - 43];
- if (v)
- v = (v == '$') ? 0 : v - 61;
- if (*in)
- {
- len++;
- if (v)
- quad[i] = v - 1;
- } else
- quad[i] = 0;
- }
- }
- if (!len)
- continue;
-
- if (out_size < (done + len - 1))
- /* out buffer is too small */
- return -1;
-
- if (len >= 2)
- *out++ = quad[0] << 2 | quad[1] >> 4;
- if (len >= 3)
- *out++ = quad[1] << 4 | quad[2] >> 2;
- if (len >= 4)
- *out++ = ((quad[2] << 6) & 0xc0) | quad[3];
-
- done += len - 1;
- }
-
- if (done + 1 >= out_size)
- return -1;
-
- *out++ = '\0';
-
- return done;
- }
-
- int CWebSocketHandler::lws_b64_selftest(void)
- {
- char buf[64];
- int n;
- unsigned int test;
- static const char *plaintext[] = {"sanity check base 64"};
- static const char *coded[] = {"c2FuaXR5IGNoZWNrIGJhc2UgNjQ="};
-
- for (test = 0; test < sizeof plaintext / sizeof(plaintext[0]); test++)
- {
-
- buf[sizeof(buf) - 1] = '\0';
- n = lws_b64_encode_string(plaintext[test],
- strlen(plaintext[test]), buf, sizeof buf);
- if (n != (int)strlen(coded[test]) || strcmp(buf, coded[test]))
- {
- fprintf(stderr, "Failed lws_b64 encode selftest "
- "%d result '%s' %d\n", test, buf, n);
- return -1;
- }
-
- buf[sizeof(buf) - 1] = '\0';
- n = lws_b64_decode_string(coded[test], buf, sizeof buf);
- if (n != (int)strlen(plaintext[test]) ||
- strcmp(buf, plaintext[test]))
- {
- fprintf(stderr, "Failed lws_b64 decode selftest "
- "%d result '%s' %d\n", test, buf, n);
- return -1;
- }
- }
-
- return 0;
- }
-
- rawBytes CWebSocketHandler::handshake_hybi00(const std::string &key1, const std::string &key2, const rawBytes &key3)
- {
- if (key3.size() < 8)
- {
- DBG_MSG_ERROR(("key3's size is %d, less than 8 bytes\n", key3.size()));
- return rawBytes();
- }
-
- unsigned long number1 = extractNumber(key1);
- unsigned long number2 = extractNumber(key2);
- DBG_MSG(("number1 is %ld, number2 is %ld\n", number1, number2));
-
- if ((number1 == 0) || (number2 == 0))
- {
- return rawBytes();
- }
-
- // represent the numbers in big-endian format (network-byte order)
- unsigned long bigEndianNumber1 = htonl(number1);
- unsigned long bigEndianNumber2 = htonl(number2);
-
- // the temporary key consists of bytes of the first and second numbers
- // and the key3
- rawBytes key(8);
- memcpy(&key[0], &bigEndianNumber1, 4);
- memcpy(&key[4], &bigEndianNumber2, 4);
- key.insert(key.end(), key3.begin(), key3.begin() + 8);
-
- MD5 md5(std::string(key.begin(), key.end()));
- char digest[16];
- md5.getdigest(digest);
- rawBytes resultBytes(&digest[0], &digest[16]);
-
- return resultBytes;
- }
-
- unsigned long CWebSocketHandler::extractNumber(const std::string &key) const
- {
- // leave digits only
- // and count the number of spaces in the key
- std::string keyDigits;
- int spacesCountKey = 0;
- for (unsigned int index = 0; index < key.length(); ++index)
- {
- char keyChar = key[index];
- if (keyChar == ' ')
- {
- ++spacesCountKey;
- }
- else if (isdigit(keyChar))
- {
- keyDigits += keyChar;
- }
- }
-
- unsigned long result = 0;
-
- // convert string to number
- long long numberKey;
- if (std::stringstream(keyDigits) >> numberKey)
- {
- if (spacesCountKey != 0)
- {
- if (numberKey % spacesCountKey == 0)
- {
- // divide the number by the count
- result = numberKey / spacesCountKey;
- }
- else
- {
- // key is not an integral multiple of spaces count
- }
- }
- else
- {
- // the denominator is 0
- }
- }
- else
- {
- // couldn't convert
- }
-
- return result;
- }
-
-} /* namespace NsMessageBroker */
-
diff --git a/src/3rd_party-static/message_broker/src/server/mb_server.cpp b/src/3rd_party-static/message_broker/src/server/mb_server.cpp
deleted file mode 100644
index 25ec7fc9f3..0000000000
--- a/src/3rd_party-static/message_broker/src/server/mb_server.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * \file mb_server.cpp
- * \brief MessageBroker server.
- * \author AKara
- */
-
-#include "mb_server.hpp"
-
-namespace NsMessageBroker {
-
-Server::Server(const std::string& address, uint16_t port) {
- m_sock = -1;
- m_address = address;
- m_port = port;
-}
-
-Server::~Server() {
- if (m_sock != -1) {
- Close();
- }
-}
-
-int Server::GetSocket() const {
- return m_sock;
-}
-
-std::string Server::GetAddress() const {
- return m_address;
-}
-
-uint16_t Server::GetPort() const {
- return m_port;
-}
-
-bool Server::Bind() {
- m_sock = networking::bind(m_protocol, m_address, m_port, NULL, NULL);
-
- return (m_sock != -1) ? true : false;
-}
-
-void Server::Close() {
- ::close(m_sock);
- m_sock = -1;
-}
-
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp b/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp
deleted file mode 100644
index bdd7b2bfdf..0000000000
--- a/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-/**
- * \file mb_tcpserver.cpp
- * \brief MessageBroker TCP server.
- * \author AKara
- */
-
-#include <cstring>
-#include <cerrno>
-#include <iostream>
-#include <algorithm>
-#include <vector>
-#include <assert.h>
-
-#include "MBDebugHelper.h"
-
-#include "mb_tcpserver.hpp"
-#include "CMessageBroker.hpp"
-
-namespace NsMessageBroker {
-
-TcpServer::TcpServer(const std::string& address, uint16_t port, NsMessageBroker::CMessageBroker* pMessageBroker) :
- Server(address, port) {
- m_protocol = networking::TCP;
- mpMessageBroker = pMessageBroker;
-}
-
-TcpServer::~TcpServer() {
- if (m_sock != -1) {
- Close();
- }
-}
-
-ssize_t TcpServer::Send(int fd, const std::string& data) {
- DBG_MSG(("Send to %d: %s\n", fd, data.c_str()));
- std::string rep = data;
- if (isWebSocket(fd)) {
- unsigned char buf[10] = {'\0'};
- ssize_t headerlen = mWebSocketHandler.prepareWebSocketDataHeader(
- (unsigned char*)buf, (unsigned long)rep.length());
- std::string header = std::string((char*)buf, headerlen);
- rep = header + rep;
- }
- int bytesToSend = rep.length();
- const char* ptrBuffer = rep.c_str();
- do {
- int retVal = send(fd, ptrBuffer, bytesToSend, MSG_NOSIGNAL);
- if (retVal == -1) {
- if (EPIPE == errno) {
- m_purge.push_back(fd);
- }
- return -1;
- }
- bytesToSend -= retVal;
- ptrBuffer += retVal;
- } while (bytesToSend > 0);
- return rep.length();
-}
-
-bool TcpServer::Recv(int fd) {
- DBG_MSG(("TcpServer::Recv(%d)\n", fd));
-
- std::string* pReceivingBuffer = getBufferFor(fd);
- bool buffer_was_not_empty = pReceivingBuffer->size() > 0;
-
- std::vector<char> buf;
- buf.reserve(RECV_BUFFER_LENGTH + pReceivingBuffer->size());
- DBG_MSG(("Left in pReceivingBuffer: %d \n",
- pReceivingBuffer->size()));
- buf.assign(pReceivingBuffer->c_str(),
- pReceivingBuffer->c_str() + pReceivingBuffer->size());
- buf.resize(RECV_BUFFER_LENGTH + pReceivingBuffer->size());
-
- int received_bytes = recv(fd, &buf[pReceivingBuffer->size()], MAX_RECV_DATA, 0);
- if (received_bytes <= 0) {
- DBG_MSG(("Received %d bytes from %d; error = %d\n",
- received_bytes, fd, errno));
- m_purge.push_back(fd);
- return false;
- }
-
- unsigned int nb = received_bytes;
- std::vector<char> last_msg_buf(buf.begin()+pReceivingBuffer->size(),
- buf.begin()+pReceivingBuffer->size()+nb);
- DBG_MSG(("Recieved %d from %d\n", nb, fd));
- nb += static_cast<unsigned int>(pReceivingBuffer->size());
- DBG_MSG(("Recieved with buffer %d from %d\n", nb, fd));
-
- if (nb > 0) { // This is redundant
- if (isWebSocket(fd)) {
- const unsigned int data_length =
- mWebSocketHandler.parseWebSocketDataLength(&buf[0], nb);
-
- DBG_MSG(("Received %d actual data length %d\n", nb, data_length));
-
- if (data_length > nb) {
- DBG_MSG_ERROR(("Received %d actual data length %d\n", nb, data_length));
- DBG_MSG_ERROR(("Incomplete message"));
- *pReceivingBuffer = std::string(&buf[0], nb);
- return false;
- }
- mWebSocketHandler.parseWebSocketData(&buf[0], nb);
- }
-
- *pReceivingBuffer = std::string(&buf[0], nb);
- DBG_MSG(("pReceivingBuffer before onMessageReceived:%d : %s\n",
- pReceivingBuffer->size(), pReceivingBuffer->c_str()));
-
- // we need to check for websocket handshake
- if (!checkWebSocketHandShake(fd, pReceivingBuffer))
- { //JSON MESSAGE received. Send data in CMessageBroker.
- if (mpMessageBroker) {
- size_t buffer_size_before = pReceivingBuffer->size();
- mpMessageBroker->onMessageReceived(fd, *pReceivingBuffer, true);
-
- if (buffer_was_not_empty && (pReceivingBuffer->size() == buffer_size_before)) {
- /* We couldn't parse the buffer (with the last message at the end)
- * Try to parse ONLY the last message */
- DBG_MSG_ERROR(("Couldn't parse the whole buffer! Try only the last message.\n"));
-
- nb = static_cast<unsigned int>(last_msg_buf.size());
- if (isWebSocket(fd)) {
- const unsigned int data_length =
- mWebSocketHandler.parseWebSocketDataLength(&last_msg_buf[0], nb);
- if (data_length > nb) {
- DBG_MSG_ERROR(("The last message may be incomplete. Don't do anything.\n"));
- /* Should we replace the buffer with the last message?
- * Probably not. It may not be a real websocket message.
- * Wait for a full message. */
- return false;
- }
- mWebSocketHandler.parseWebSocketData(&last_msg_buf[0], nb);
- }
-
- std::string last_message = std::string(&last_msg_buf[0], nb);
- buffer_size_before = last_message.size();
- mpMessageBroker->onMessageReceived(fd, last_message, false);
- if ( last_message.size() < buffer_size_before ) {
- /* Parsing last message successful! Discard the old data and
- * keep only what is left from the last message */
- DBG_MSG_ERROR(("Parsing last message successful! Discard the old data.\n"));
- *pReceivingBuffer = last_message;
- }
- }
- } else {
- return false;
- }
- } else { // message is a websocket handshake
- ssize_t webSocketKeyPos = pReceivingBuffer->find("Sec-WebSocket-Key: ");
- if (-1 != webSocketKeyPos) {
- std::string handshakeResponse =
- "HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\n"
- "Connection: Upgrade\r\nSec-WebSocket-Accept: ";
- std::string wsKey = pReceivingBuffer->substr(webSocketKeyPos + 19, 24);
- mWebSocketHandler.handshake_0405(wsKey);
- handshakeResponse += wsKey;
- handshakeResponse += "\r\n\r\n";
- pReceivingBuffer->clear();
- std::list<int>::iterator acceptedClientIt =
- find(m_AcceptedClients.begin(), m_AcceptedClients.end(), fd);
- if (m_AcceptedClients.end() != acceptedClientIt) {
- m_AcceptedClients.erase(acceptedClientIt);
- }
- Send(fd, handshakeResponse);
- m_WebSocketClients.push_back(fd);
- }
- }
- }
- return true;
-}
-
-bool TcpServer::checkWebSocketHandShake(int fd, std::string* pReceivingBuffer) {
- bool result = false;
- std::list<int>::iterator acceptedClientIt = find(m_AcceptedClients.begin(), m_AcceptedClients.end(), fd);
- if (m_AcceptedClients.end() != acceptedClientIt) {
- ssize_t httpheader = pReceivingBuffer->find("GET / HTTP/1.1");
- if (-1 != httpheader) { // here is a header
- DBG_MSG(("HTTP header detected!\n"));
- result = true;
- } else { // not winsocket client
- m_AcceptedClients.erase(acceptedClientIt);
- }
- }
- DBG_MSG(("TcpServer::checkWebSocket(): %d!\n", result));
- return result;
-}
-
-bool TcpServer::isWebSocket(int fd) {
- bool result = false;
- std::list<int>::iterator wsClientIt = find(m_WebSocketClients.begin(), m_WebSocketClients.end(), fd);
- if (m_WebSocketClients.end() != wsClientIt) {
- result = true;
- }
- return result;
-}
-
-std::string* TcpServer::getBufferFor(int fd) {
- std::string* res = 0;
- std::map <int, std::string*>::iterator it;
- it = m_receivingBuffers.find(fd);
- if (it != m_receivingBuffers.end()) {
- res = (*it).second;
- } else { // create a new buffer...
- res = new std::string("");
- printf("getBufferFor method!\n");
- m_receivingBuffers.insert(std::map<int, std::string*>::value_type(fd, res));
- }
-
- return res;
-}
-
-void TcpServer::WaitMessage(uint32_t ms) {
- fd_set fdsr;
- struct timeval tv;
- int max_sock = m_sock;
-
- tv.tv_sec = ms / 1000;
- tv.tv_usec = (ms % 1000) / 1000;
-
- FD_ZERO(&fdsr);
-
-#ifdef _WIN32
- /* on Windows, a socket is not an int but a SOCKET (unsigned int) */
- FD_SET((SOCKET)m_sock, &fdsr);
-#else
- FD_SET(m_sock, &fdsr);
-#endif
-
- for (std::map<int, std::string*>::iterator it = m_receivingBuffers.begin();
- it != m_receivingBuffers.end() ; it++) {
-#ifdef _WIN32
- FD_SET((SOCKET)((*it).first), &fdsr);
-#else
- FD_SET(((*it).first), &fdsr);
-#endif
-
- if (((*it).first) > max_sock) {
- max_sock = ((*it).first);
- }
- }
-
- max_sock++;
-
- if (select(max_sock, &fdsr, NULL, NULL, ms ? &tv : NULL) > 0) {
- if (FD_ISSET(m_sock, &fdsr)) {
- Accept();
- }
-
- for (std::map<int, std::string*>::iterator it = m_receivingBuffers.begin();
- it != m_receivingBuffers.end() ; it++) {
- if (FD_ISSET(((*it).first), &fdsr)) {
- Recv((*it).first);
- }
- }
-
- /* remove disconnect socket descriptor */
- for (std::list<int>::iterator it = m_purge.begin();
- it != m_purge.end() ; it++) {
- std::map <int, std::string*>::iterator itr;
- itr = m_receivingBuffers.find((*it));
- if (itr != m_receivingBuffers.end())
- { // delete receiving buffer of disconnected client
- mpMessageBroker->OnSocketClosed(itr->first);
- delete itr->second;
- m_receivingBuffers.erase(itr);
- }
- }
-
- /* purge disconnected list */
- m_purge.erase(m_purge.begin(), m_purge.end());
- }
- else {
- /* error */
- }
-}
-
-bool TcpServer::Listen() const {
- if (m_sock == -1) {
- return false;
- }
-
- if (listen(m_sock, 5) == -1) {
- return false;
- }
-
- return true;
-}
-
-bool TcpServer::Accept() {
-
- int client = -1;
- socklen_t addrlen = sizeof(struct sockaddr_storage);
-
- if (m_sock == -1) {
- return false;
- }
-
- client = accept(m_sock, 0, &addrlen);
-
- if (client == -1) {
- return false;
- }
-
- std::string* res = new std::string("");
- m_receivingBuffers.insert(std::map<int, std::string*>::value_type(client, res));
- m_AcceptedClients.push_back(client);
- return true;
-}
-
-void TcpServer::Close() {
- /* close all client sockets */
- for (std::map<int, std::string*>::iterator it = m_receivingBuffers.begin();
- it != m_receivingBuffers.end() ; it++) {
- ::close((*it).first);
- if ((*it).second) {
- delete(*it).second;
- }
- }
- m_receivingBuffers.clear();
- Server::Close();
- /* listen socket should be closed in Server destructor */
-}
-
-void* TcpServer::MethodForThread(void* arg) {
- arg = arg;
- while (1) {
- WaitMessage(1000);
- }
- return NULL;
-}
-
-} /* namespace NsMessageBroker */
diff --git a/src/3rd_party-static/message_broker/src/server/networking.cpp b/src/3rd_party-static/message_broker/src/server/networking.cpp
deleted file mode 100644
index f054431690..0000000000
--- a/src/3rd_party-static/message_broker/src/server/networking.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * JsonRpc-Cpp - JSON-RPC implementation.
- * Copyright (C) 2008-2011 Sebastien Vincent <sebastien.vincent@cppextrem.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * \file networking.cpp
- * \brief Networking utils.
- * \author Sebastien Vincent
- */
-
-#include <cstdio>
-#include <cstring>
-
-#include "networking.h"
-
-namespace networking {
-#ifdef _WIN32
-/**
- * \var wsaData
- * \brief MS Windows object to start
- * networking stuff.
- */
-static WSAData wsaData;
-#endif
-
-bool init() {
- bool ret = false;
-
-#ifdef _WIN32
- ret = (WSAStartup(MAKEWORD(2, 0), &wsaData) == 0);
-#else
- /* unix-like */
- ret = true;
-#endif
-
- return ret;
-}
-
-void cleanup() {
-#ifdef _WIN32
- WSACleanup();
-#endif
-}
-
-int connect(enum TransportProtocol protocol,
- const std::string& address,
- uint16_t port, struct sockaddr_storage* sockaddr,
- socklen_t* addrlen) {
- struct addrinfo hints;
- struct addrinfo* res = NULL;
- struct addrinfo* p = NULL;
- char service[8];
- int sock = -1;
-
- if (!port || address == "") {
- return -1;
- }
-
- snprintf(service, sizeof(service), "%u", port);
- service[sizeof(service) - 1] = 0x00;
-
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = protocol == UDP ? SOCK_DGRAM : SOCK_STREAM;
- hints.ai_protocol = protocol;
- hints.ai_flags = 0;
-
- if (getaddrinfo(address.c_str(),
- service, &hints, &res) != 0) {
- return -1;
- }
-
- for (p = res ; p ; p = p->ai_next) {
- sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
-
- if (sock == -1) {
- continue;
- }
-
- if (protocol == TCP && ::connect(sock, (struct sockaddr*)p->ai_addr, p->ai_addrlen) == -1) {
- ::close(sock);
- sock = -1;
- continue;
- }
-
- if (sockaddr) {
- memcpy(sockaddr, p->ai_addr, p->ai_addrlen);
- }
-
- if (addrlen) {
- *addrlen = p->ai_addrlen;
- }
-
- /* ok so now we have a socket bound, break the loop */
- break;
- }
-
- freeaddrinfo(res);
- p = NULL;
-
- return sock;
-}
-
-int bind(enum TransportProtocol protocol,
- const std::string& address, uint16_t port,
- struct sockaddr_storage* sockaddr, socklen_t* addrlen) {
- struct addrinfo hints;
- struct addrinfo* res = NULL;
- struct addrinfo* p = NULL;
- char service[8];
- int sock = -1;
-
- if (!port || address == "") {
- return -1;
- }
-
- snprintf(service, sizeof(service), "%u", port);
- service[sizeof(service) - 1] = 0x00;
-
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = protocol == UDP ? SOCK_DGRAM : SOCK_STREAM;
- hints.ai_protocol = protocol;
- hints.ai_flags = AI_PASSIVE;
-
- if (getaddrinfo(address.c_str(), service, &hints, &res) != 0) {
- return -1;
- }
-
- for (p = res ; p ; p = p->ai_next) {
- int on = 1;
- on = on;
-
- sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
-
- if (sock == -1) {
- continue;
- }
-
-#ifndef _WIN32
- setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
-
- /* accept IPv6 OR IPv4 on the same socket */
- on = 1;
- setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
-#else
- on = 0;
-#endif
-
- if (::bind(sock, p->ai_addr, p->ai_addrlen) == -1) {
- ::close(sock);
- sock = -1;
- continue;
- }
-
- if (sockaddr) {
- memcpy(sockaddr, p->ai_addr, p->ai_addrlen);
- }
-
- if (addrlen) {
- *addrlen = p->ai_addrlen;
- }
-
- /* ok so now we have a socket bound, break the loop */
- break;
- }
-
- freeaddrinfo(res);
- p = NULL;
-
- return sock;
-}
-
-} /* namespace networking */
-
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index cddc2d16b6..bdb96de417 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -30,15 +30,13 @@
include("./set_3rd_party_paths.cmake")
-set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set (install-3rd_party_logger_var "")
-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)
@@ -46,17 +44,14 @@ if(FORCE_3RD_PARTY)
message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
else()
set(FORCE_3RD_PARTY_LOGGER ON)
- set(FORCE_3RD_PARTY_DBUS ON)
endif()
endif()
-if(ENABLE_LOG OR HMI_DBUS_API)
+if(ENABLE_LOG)
# --- libexpat
add_subdirectory(expat-2.1.0)
set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
-endif()
-if(ENABLE_LOG)
if(NO_REBUILD_3RD_PARTY_LOGGER)
message(STATUS "Not rebuilding logger.")
else()
@@ -173,119 +168,80 @@ if(ENABLE_LOG)
add_subdirectory(apache-log4cxx-cmake)
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}
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
+set(CMAKE_SOURCE_PREFIX ${CMAKE_SOURCE_PREFIX} "${3RD_PARTY_INSTALL_PREFIX}")
+find_package (BSON)
+message (STATUS "bson installed in " ${BSON_LIBS_DIRECTORY} " , " ${BSON_INCLUDE_DIRECTORY})
+message (STATUS "emhashmap installed in " ${EMHASHMAP_LIBS_DIRECTORY} " , " ${EMHASHMAP_INCLUDE_DIRECTORY})
+
+if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND")
+ message (STATUS "Building bson required")
+ set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib CACHE INTERNAL "Sources of bson library" FORCE)
+ set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of bson libraries" FORCE)
+ set(BSON_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of bson headers" FORCE)
+ set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
+ set(EMHASHMAP_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of emashmap headers" FORCE)
+
+ set(BSON_INSTALL_COMMAND make install)
+ if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
+ set(BSON_INSTALL_COMMAND sudo make install)
+ endif()
+ include(ExternalProject)
+ ExternalProject_Add(libbson
+ GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git"
+ GIT_TAG "master"
+ BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY}
+ INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
+ DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY}
+ SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY}
+ CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure config.h.in && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_COMMAND make
+ INSTALL_COMMAND ${BSON_INSTALL_COMMAND})
+else()
+ get_filename_component(BSON_LIBS_DIRECTORY ${BSON_LIB} DIRECTORY)
+ get_filename_component(EMHASHMAP_LIBS_DIRECTORY ${EMHASHMAP_LIB} DIRECTORY)
+ set(BSON_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of bson libraries" FORCE)
+ set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
+ add_custom_target(
+ libbson
+ DEPENDS ${BSON_LIBS_DIRECTORY}
+ DEPENDS ${EMHASHMAP_LIBS_DIRECTORY}
)
+endif()
- #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()
+find_package(Boost 1.66.0 COMPONENTS system thread date_time filesystem)
+set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
+set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
+SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
+set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
+if (NOT ${Boost_FOUND})
+ message(STATUS "Did not find boost. Downloading and installing boost 1.66")
+ set(BOOST_INSTALL_COMMAND ./b2 install)
+ if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
+ set(BOOST_INSTALL_COMMAND sudo ./b2 install)
endif()
-
- # --- 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)
-
- add_subdirectory(dbus-cmake)
+ include(ExternalProject)
+ ExternalProject_Add(
+ Boost
+ URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
+ DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_COMMAND ./b2
+ INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --with-filesystem --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
+ INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_IN_SOURCE true
+ )
+
+ set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
+ set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
+else()
+add_custom_target(Boost) # empty target, Boost is already installed
endif()
add_custom_target(install-3rd_party
DEPENDS ${install-3rd_party_logger_var}
- DEPENDS ${install-3rd_party_dbus_var}
+ DEPENDS libbson
+ DEPENDS Boost
WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
)
-
diff --git a/src/3rd_party/FindBSON.cmake b/src/3rd_party/FindBSON.cmake
new file mode 100644
index 0000000000..91d53624f1
--- /dev/null
+++ b/src/3rd_party/FindBSON.cmake
@@ -0,0 +1,26 @@
+set(INCLUDE_PATH "${CMAKE_SOURCE_PREFIX}/include")
+set(LIB_PATH "${CMAKE_SOURCE_PREFIX}/lib")
+
+find_path(BSON_INCLUDE_DIRECTORY bson_object.h bson_array.h bson_util.h
+ PATHS "${INCLUDE_PATH}")
+
+find_library(BSON_LIB
+ NAMES bson
+ PATHS ${LIB_PATH})
+
+find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h
+ PATHS ${INCLUDE_PATH}
+ PATH_SUFFIXES emhashmap)
+
+find_library(EMHASHMAP_LIB
+ NAMES emhashmap
+ PATHS ${LIB_PATH})
+
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB
+ EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
+
+mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB)
+mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0 b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0
deleted file mode 100644
index 5feeff5217..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0
+++ /dev/null
@@ -1,21759 +0,0 @@
-@%:@! /bin/sh
-@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.69.
-@%:@
-@%:@
-@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-@%:@
-@%:@
-@%:@ This configure script is free software; the Free Software Foundation
-@%:@ gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in @%:@(
- *posix*) :
- set -o posix ;; @%:@(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in @%:@(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in @%:@((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in @%:@ ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in @%:@(
- *posix*) :
- set -o posix ;; @%:@(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in @%:@(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in @%:@ ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-@%:@ as_fn_unset VAR
-@%:@ ---------------
-@%:@ Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-@%:@ as_fn_set_status STATUS
-@%:@ -----------------------
-@%:@ Set @S|@? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} @%:@ as_fn_set_status
-
-@%:@ as_fn_exit STATUS
-@%:@ -----------------
-@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} @%:@ as_fn_exit
-
-@%:@ as_fn_mkdir_p
-@%:@ -------------
-@%:@ Create "@S|@as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} @%:@ as_fn_mkdir_p
-
-@%:@ as_fn_executable_p FILE
-@%:@ -----------------------
-@%:@ Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} @%:@ as_fn_executable_p
-@%:@ as_fn_append VAR VALUE
-@%:@ ----------------------
-@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take
-@%:@ advantage of any shell optimizations that allow amortized linear growth over
-@%:@ repeated appends, instead of the typical quadratic growth present in naive
-@%:@ implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-@%:@ as_fn_arith ARG...
-@%:@ ------------------
-@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the
-@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments
-@%:@ must be portable across @S|@(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD]
-@%:@ ----------------------------------------
-@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-@%:@ script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} @%:@ as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in @%:@(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIB@&t@OBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
-
-ac_unique_file="src/main/cpp/logger.cpp"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-LIB@&t@OBJS
-LOGCHAR_IS_UNICHAR
-LOGCHAR_IS_WCHAR
-LOGCHAR_IS_UTF8
-CHARSET_EBCDIC
-CHARSET_USASCII
-CHARSET_ISO88591
-CHARSET_UTF8
-CFSTRING_API
-UNICHAR_API
-WCHAR_T_API
-CHAR_API
-HAS_LIBESMTP
-CPPFLAGS_ODBC
-LIBS_ODBC
-IODBC_CONFIG
-HAS_ODBC
-HAS_FWIDE
-HAS_WCHAR_T
-HAS_STD_LOCALE
-HAS_SYSLOG
-HAS_WCSTOMBS
-HAS_MBSRTOWCS
-APU_LIBS
-APR_LIBS
-base_dir
-manual_dest
-enable_latex_docs
-enable_html_docs
-enable_dot
-LATEX_DOC_FALSE
-LATEX_DOC_TRUE
-DOC_FALSE
-DOC_TRUE
-DOT
-DOXYGEN
-LIBTOOL
-ac_ct_F77
-FFLAGS
-F77
-CXXCPP
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-CPP
-RANLIB
-AR
-ECHO
-LN_S
-EGREP
-GREP
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-LT_VERSION
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_shared
-enable_static
-enable_fast_install
-enable_dependency_tracking
-with_gnu_ld
-enable_libtool_lock
-with_pic
-with_tags
-enable_doxygen
-enable_dot
-enable_html_docs
-enable_latex_docs
-with_apr
-with_apr_util
-with_ODBC
-with_SMTP
-enable_char
-enable_wchar_t
-enable_unichar
-enable_cfstring
-with_charset
-with_logchar
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-F77
-FFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- @<:@@S|@ac_default_prefix@:>@
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- @<:@PREFIX@:>@
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-shared@<:@=PKGS@:>@ build shared libraries @<:@default=yes@:>@
- --enable-static@<:@=PKGS@:>@ build static libraries @<:@default=yes@:>@
- --enable-fast-install@<:@=PKGS@:>@
- optimize for fast installation @<:@default=yes@:>@
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-doxygen enable documentation generation with doxygen (auto)
- --enable-dot use 'dot' to generate graphs in doxygen (auto)
- --enable-html-docs enable HTML generation with doxygen (yes)
- --enable-latex-docs enable LaTeX documentation generation with doxygen
- (no)
- --enable-char enable char API (yes)
- --enable-wchar_t enable wchar_t API (yes if wchar_t available)
- --enable-unichar enable unichar API (no)
- --enable-cfstring enable cfstring API (no)
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@
- --with-pic try to use only PIC/non-PIC objects @<:@default=use
- both@:>@
- --with-tags@<:@=TAGS@:>@ include additional configurations @<:@automatic@:>@
- --with-apr=PATH prefix for installed APR or the full path to
- apr-config
- --with-apr-util=PATH prefix for installed APU or the full path to
- apu-config
- --with-ODBC ODBC support. Accepted arguments : unixODBC, iODBC,
- Microsoft, no (default=no)
- --with-SMTP SMTP support. Accepted arguments : libesmtp, no
- (default=no)
- --with-charset=TYPE locale charset. Accepted TYPE variants: auto, utf-8,
- iso-8859-1, usascii, ebcdic (default=auto)
- --with-logchar=TYPE type for logchar. Accepted TYPE variants: utf-8,
- wchar_t, unichar (default=utf-8)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-@%:@ ac_fn_c_try_compile LINENO
-@%:@ --------------------------
-@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_compile
-
-@%:@ ac_fn_c_try_link LINENO
-@%:@ -----------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_link
-
-@%:@ ac_fn_c_try_cpp LINENO
-@%:@ ----------------------
-@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_cpp
-
-@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-@%:@ -------------------------------------------------------
-@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using
-@%:@ the include files in INCLUDES and setting the cache variable VAR
-@%:@ accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-@%:@include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_c_check_header_mongrel
-
-@%:@ ac_fn_c_try_run LINENO
-@%:@ ----------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes
-@%:@ that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_c_try_run
-
-@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-@%:@ -------------------------------------------------------
-@%:@ Tests whether HEADER exists and can be compiled using the include files in
-@%:@ INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-@%:@include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_c_check_header_compile
-
-@%:@ ac_fn_c_check_func LINENO FUNC VAR
-@%:@ ----------------------------------
-@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_c_check_func
-
-@%:@ ac_fn_cxx_try_compile LINENO
-@%:@ ----------------------------
-@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_cxx_try_compile
-
-@%:@ ac_fn_cxx_try_cpp LINENO
-@%:@ ------------------------
-@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_cxx_try_cpp
-
-@%:@ ac_fn_cxx_try_link LINENO
-@%:@ -------------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_cxx_try_link
-
-@%:@ ac_fn_f77_try_compile LINENO
-@%:@ ----------------------------
-@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_f77_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_f77_try_compile
-
-@%:@ ac_fn_f77_try_link LINENO
-@%:@ -------------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_f77_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} @%:@ ac_fn_f77_try_link
-
-@%:@ ac_fn_cxx_check_func LINENO FUNC VAR
-@%:@ ------------------------------------
-@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_cxx_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_cxx_check_func
-
-@%:@ ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
-@%:@ ---------------------------------------------------------
-@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using
-@%:@ the include files in INCLUDES and setting the cache variable VAR
-@%:@ accordingly.
-ac_fn_cxx_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-@%:@include <$2>
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <$2>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} @%:@ ac_fn_cxx_check_header_mongrel
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in @%:@((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# autoconf 2.50 or higher to rebuild aclocal.m4, because the
-# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
-
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-#
-# +1 : ? : +1 == new interface that does not break old one
-# +1 : ? : 0 == new interface that breaks old one
-# ? : ? : 0 == no new interfaces, but breaks apps
-# ? :+1 : ? == just some internal changes, nothing breaks but might work
-# better
-# CURRENT : REVISION : AGE
-LT_VERSION=10:0:0
-
-
-
-
-
-am__api_version="1.9"
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in @%:@((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=log4cxx
- VERSION=0.10.0
-
-
-cat >>confdefs.h <<_ACEOF
-@%:@define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-@%:@define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-# Checks for programs
-# ----------------------------------------------------------------------------
-
-@%:@ Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-@%:@ Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-@%:@ Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-@%:@ Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $@%:@ != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${lt_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-
-fi
-
-SED=$lt_cv_path_SED
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
-$as_echo "$SED" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-
-@%:@ Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-compatible nm" >&5
-$as_echo_n "checking for BSD-compatible nm... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognise dependent libraries" >&5
-$as_echo_n "checking how to recognise dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix3*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-@%:@ Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line __oline__ "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-fi
-
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5
-$as_echo "$F77" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$F77" && break
- done
-fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5
-$as_echo "$ac_ct_F77" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_F77" && break
-done
-
- if test "x$ac_ct_F77" = x; then
- F77=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- F77=$ac_ct_F77
- fi
-fi
-
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5
-$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
-if ${ac_cv_f77_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-if ac_fn_f77_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5
-$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5
-$as_echo_n "checking whether $F77 accepts -g... " >&6; }
-if ${ac_cv_prog_f77_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- FFLAGS=-g
-cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_compile "$LINENO"; then :
- ac_cv_prog_f77_g=yes
-else
- ac_cv_prog_f77_g=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5
-$as_echo "$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
- fi
-fi
-
-if test $ac_compiler_gnu = yes; then
- G77=yes
-else
- G77=
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-
-
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-enable_dlopen=no
-enable_win32_dll=no
-
-@%:@ Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-@%:@ Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works" >&5
-$as_echo "$lt_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_prog_compiler_pic_works" = xyes; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
- fi
- else
- lt_prog_compiler_static_works=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works" >&5
-$as_echo "$lt_prog_compiler_static_works" >&6; }
-
-if test x"$lt_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag=
- enable_shared_with_static_runtimes=no
- archive_cmds=
- archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
- hardcode_libdir_separator=
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- link_all_deplibs=unknown
- hardcode_automatic=no
- module_cmds=
- module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- interix3*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs=no
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- freebsd1*)
- ld_shlibs=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- link_all_deplibs=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- openbsd*)
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- archive_cmds_need_lc=no
- else
- archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
- test "X$hardcode_automatic" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
-fi
-
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_svld_dlopen=yes
-else
- ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_dld_link=yes
-else
- ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-# Report which library types will actually be built
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5
-$as_echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-@%:@ Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then :
- withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist" >&5
-$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) as_fn_error $? "invalid tag name: $tagname" "$LINENO" 5
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- as_fn_error $? "tag name \"$tagname\" already exists" "$LINENO" 5
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
- lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-@%:@ Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_CXX=yes
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix3*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_prog_compiler_pic_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_prog_compiler_static_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- kfreebsd*-gnu)
- link_all_deplibs_CXX=no
- ;;
- linux*)
- link_all_deplibs_CXX=no
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5
-$as_echo "$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_F77" >&5
-$as_echo "$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
-if ${lt_prog_compiler_pic_works_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_F77" >&5
-$as_echo "$lt_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_prog_compiler_static_works_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_F77" >&5
-$as_echo "$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_F77=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs_F77=no
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_F77=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_F77=yes
- else
- # We have old collect2
- hardcode_direct_F77=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_F77=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- link_all_deplibs_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_F77=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5
-$as_echo "$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5
-$as_echo "$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
-$as_echo "$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix3*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_GCJ" >&5
-$as_echo "$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; }
-if ${lt_prog_compiler_pic_works_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_GCJ" >&5
-$as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_prog_compiler_static_works_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_GCJ" >&5
-$as_echo "$lt_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_GCJ=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs_GCJ=no
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_GCJ=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct_GCJ=yes
- else
- # We have old collect2
- hardcode_direct_GCJ=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_GCJ=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- link_all_deplibs_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_GCJ=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_GCJ" >&5
-$as_echo "$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_GCJ" >&5
-$as_echo "$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix3*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_GCJ" >&5
-$as_echo "$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- ;;
-
- *)
- as_fn_error $? "Unsupported tag name: $tagname" "$LINENO" 5
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- as_fn_error $? "unable to update list of available tagged configurations." "$LINENO" 5
- fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-@%:@include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-# CXX fine tuning
-case "$host" in
- *-dec-osf*)
- CXXFLAGS="$CXXFLAGS -std strict_ansi_errors"
- ;;
- *)
- ;;
-esac
-
-# Doxygen
-
-@%:@ Check whether --enable-doxygen was given.
-if test "${enable_doxygen+set}" = set; then :
- enableval=$enable_doxygen;
-fi
-
-
-@%:@ Check whether --enable-dot was given.
-if test "${enable_dot+set}" = set; then :
- enableval=$enable_dot;
-fi
-
-
-@%:@ Check whether --enable-html-docs was given.
-if test "${enable_html_docs+set}" = set; then :
- enableval=$enable_html_docs;
-else
- enable_html_docs=yes
-fi
-
-
-@%:@ Check whether --enable-latex-docs was given.
-if test "${enable_latex_docs+set}" = set; then :
- enableval=$enable_latex_docs;
-else
- enable_latex_docs=no
-fi
-
-
-if test "x$enable_doxygen" = xno; then
- enable_doc=no
-else
- # Extract the first word of "doxygen", so it can be a program name with args.
-set dummy doxygen; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DOXYGEN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $DOXYGEN in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-DOXYGEN=$ac_cv_path_DOXYGEN
-if test -n "$DOXYGEN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5
-$as_echo "$DOXYGEN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$DOXYGEN" = x; then
- if test "x$enable_doxygen" = xyes; then
- as_fn_error $? "could not find doxygen" "$LINENO" 5
- fi
- enable_doc=no
- else
- enable_doc=yes
- # Extract the first word of "dot", so it can be a program name with args.
-set dummy dot; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DOT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $DOT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-DOT=$ac_cv_path_DOT
-if test -n "$DOT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5
-$as_echo "$DOT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-
-
-if test x$enable_doc = xyes; then
- DOC_TRUE=
- DOC_FALSE='#'
-else
- DOC_TRUE='#'
- DOC_FALSE=
-fi
-
-
-
-if test x$enable_latex_docs = xyes; then
- LATEX_DOC_TRUE=
- LATEX_DOC_FALSE='#'
-else
- LATEX_DOC_TRUE='#'
- LATEX_DOC_FALSE=
-fi
-
-
-if test x$DOT = x; then
- if test "x$enable_dot" = xyes; then
- as_fn_error $? "could not find dot" "$LINENO" 5
- fi
- enable_dot=no
-else
- enable_dot=yes
-fi
-
-manual_dest="manual"
-base_dir=`(cd $srcdir && pwd)`
-
-
-
-
-
-
-
-
-
-
-# Checks header files
-# ----------------------------------------------------------------------------
-
- apr_found="no"
-
- if test "$target_os" = "os2-emx"; then
- # Scripts don't pass test -x on OS/2
- TEST_X="test -f"
- else
- TEST_X="test -x"
- fi
-
- acceptable_majors="1"
-
- apr_temp_acceptable_apr_config=""
- for apr_temp_major in $acceptable_majors
- do
- case $apr_temp_major in
- 0)
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config"
- ;;
- *)
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config"
- ;;
- esac
- done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APR" >&5
-$as_echo_n "checking for APR... " >&6; }
-
-@%:@ Check whether --with-apr was given.
-if test "${with_apr+set}" = set; then :
- withval=$with_apr;
- if test "$withval" = "no" || test "$withval" = "yes"; then
- as_fn_error $? "--with-apr requires a directory or file to be provided" "$LINENO" 5
- fi
-
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
- do
- for lookdir in "$withval/bin" "$withval"
- do
- if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
- apr_config="$lookdir/$apr_temp_apr_config_file"
-
- apr_found="yes"
- break 2
- fi
- done
- done
-
- if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
- apr_config="$withval"
- apr_found="yes"
- fi
-
- if test "$apr_found" != "yes"; then
- as_fn_error $? "the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file." "$LINENO" 5
- fi
-
-else
-
- if test -n "1" && test "1" = "1"; then
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
- do
- if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
- apr_config="$apr_temp_apr_config_file"
-
- apr_found="yes"
- break
- else
- for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
- if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
- apr_config="$lookdir/bin/$apr_temp_apr_config_file"
-
- apr_found="yes"
- break 2
- fi
- done
- fi
- done
- fi
- if test "$apr_found" = "no" && test -d ""; then
- apr_temp_abs_srcdir="`cd && pwd`"
- apr_found="reconfig"
- apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"/include/apr_version.h\"`"
- case $apr_bundled_major in
- "")
- as_fn_error $? "failed to find major version of bundled APR" "$LINENO" 5
- ;;
- 0)
- apr_temp_apr_config_file="apr-config"
- ;;
- *)
- apr_temp_apr_config_file="apr-$apr_bundled_major-config"
- ;;
- esac
- if test -n ""; then
- apr_config="/$apr_temp_apr_config_file"
- else
- apr_config="/$apr_temp_apr_config_file"
- fi
- fi
-
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_found" >&5
-$as_echo "$apr_found" >&6; }
-
-if test "$apr_found" = "no"; then
- as_fn_error $? "APR could not be located. Please use the --with-apr option." "$LINENO" 5
-fi
-
-CPPFLAGS="$CPPFLAGS `$apr_config --cppflags` `$apr_config --includes`"
-APR_LIBS="`$apr_config --link-ld --libs`"
-
-LDFLAGS="$LDFLAGS $APR_LIBS"
-
-
- apu_found="no"
-
- if test "$target_os" = "os2-emx"; then
- # Scripts don't pass test -x on OS/2
- TEST_X="test -f"
- else
- TEST_X="test -x"
- fi
-
- acceptable_majors="1"
-
- apu_temp_acceptable_apu_config=""
- for apu_temp_major in $acceptable_majors
- do
- case $apu_temp_major in
- 0)
- apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-config"
- ;;
- *)
- apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-$apu_temp_major-config"
- ;;
- esac
- done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APR-util" >&5
-$as_echo_n "checking for APR-util... " >&6; }
-
-@%:@ Check whether --with-apr-util was given.
-if test "${with_apr_util+set}" = set; then :
- withval=$with_apr_util;
- if test "$withval" = "no" || test "$withval" = "yes"; then
- as_fn_error $? "--with-apr-util requires a directory or file to be provided" "$LINENO" 5
- fi
-
- for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
- do
- for lookdir in "$withval/bin" "$withval"
- do
- if $TEST_X "$lookdir/$apu_temp_apu_config_file"; then
- apu_config="$lookdir/$apu_temp_apu_config_file"
-
- apu_found="yes"
- break 2
- fi
- done
- done
-
- if test "$apu_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
- apu_config="$withval"
- apu_found="yes"
- fi
-
- if test "$apu_found" != "yes"; then
- as_fn_error $? "the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file." "$LINENO" 5
- fi
-
-else
-
- if test -n "1" && test "1" = "1"; then
- for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
- do
- if $apu_temp_apu_config_file --help > /dev/null 2>&1 ; then
- apu_config="$apu_temp_apu_config_file"
-
- apu_found="yes"
- break
- else
- for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
- if $TEST_X "$lookdir/bin/$apu_temp_apu_config_file"; then
- apu_config="$lookdir/bin/$apu_temp_apu_config_file"
-
- apu_found="yes"
- break 2
- fi
- done
- fi
- done
- fi
- if test "$apu_found" = "no" && test -d ""; then
- apu_temp_abs_srcdir="`cd && pwd`"
- apu_found="reconfig"
- apu_bundled_major="`sed -n '/#define.*APU_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"/include/apu_version.h\"`"
- case $apu_bundled_major in
- "")
- as_fn_error $? "failed to find major version of bundled APU" "$LINENO" 5
- ;;
- 0)
- apu_temp_apu_config_file="apu-config"
- ;;
- *)
- apu_temp_apu_config_file="apu-$apu_bundled_major-config"
- ;;
- esac
- if test -n ""; then
- apu_config="/$apu_temp_apu_config_file"
- else
- apu_config="/$apu_temp_apu_config_file"
- fi
- fi
-
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $apu_found" >&5
-$as_echo "$apu_found" >&6; }
-
-if test "$apu_found" = "no"; then
- as_fn_error $? "APR-util could not be located. Please use the --with-apr-util option." "$LINENO" 5
-fi
-
-CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
-APU_LIBS="`$apu_config --link-ld --libs`"
-
-LDFLAGS="$LDFLAGS $APU_LIBS"
-
-# Checks local idioms
-# ----------------------------------------------------------------------------
-
-# for local syslog() function for SyslogAppender
-for ac_func in mbsrtowcs
-do :
- ac_fn_cxx_check_func "$LINENO" "mbsrtowcs" "ac_cv_func_mbsrtowcs"
-if test "x$ac_cv_func_mbsrtowcs" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_MBSRTOWCS 1
-_ACEOF
- have_mbsrtowcs=yes
-else
- have_mbsrtowcs=no
-fi
-done
-
-if test "$have_mbsrtowcs" = "yes"
-then
- HAS_MBSRTOWCS=1
-
-else
- HAS_MBSRTOWCS=0
-
-fi
-
-for ac_func in wcstombs
-do :
- ac_fn_cxx_check_func "$LINENO" "wcstombs" "ac_cv_func_wcstombs"
-if test "x$ac_cv_func_wcstombs" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_WCSTOMBS 1
-_ACEOF
- have_wcstombs=yes
-else
- have_wcstombs=no
-fi
-done
-
-if test "$have_wcstombs" = "yes"
-then
- HAS_WCSTOMBS=1
-
-else
- HAS_WCSTOMBS=0
-
-fi
-
-# for local syslog() function for SyslogAppender
-for ac_func in syslog
-do :
- ac_fn_cxx_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
-if test "x$ac_cv_func_syslog" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_SYSLOG 1
-_ACEOF
- have_syslog=yes
-else
- have_syslog=no
-fi
-done
-
-if test "$have_syslog" = "yes"
-then
- HAS_SYSLOG=1
-
-else
- HAS_SYSLOG=0
-
-fi
-
-
-ac_fn_cxx_check_header_mongrel "$LINENO" "locale" "ac_cv_header_locale" "$ac_includes_default"
-if test "x$ac_cv_header_locale" = xyes; then :
- have_locale=yes
-else
- have_locale=no
-fi
-
-
-if test "$have_locale" = "yes"
-then
- HAS_STD_LOCALE=1
-
-else
- HAS_STD_LOCALE=0
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <string>
- std::wstring w;
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- have_wchar_t=yes
-else
- have_wchar_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_wchar_t" >&5
-$as_echo "$have_wchar_t" >&6; }
-if test "$have_wchar_t" = "yes"
-then
- HAS_WCHAR_T=1
-
-else
- HAS_WCHAR_T=0
-
-fi
-
-for ac_func in fwide
-do :
- ac_fn_cxx_check_func "$LINENO" "fwide" "ac_cv_func_fwide"
-if test "x$ac_cv_func_fwide" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_FWIDE 1
-_ACEOF
- have_fwide=yes
-else
- have_fwide=no
-fi
-done
-
-if test "$have_fwide" = "yes"
-then
- HAS_FWIDE=1
-
-else
- HAS_FWIDE=0
-
-fi
-
-
-# Checks for libraries
-# ----------------------------------------------------------------------------
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
-
-#for ODBCAppender
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ODBC support" >&5
-$as_echo_n "checking for ODBC support... " >&6; }
-
-@%:@ Check whether --with-ODBC was given.
-if test "${with_ODBC+set}" = set; then :
- withval=$with_ODBC; ac_with_odbc=$withval
-else
- ac_with_odbc=no
-fi
-
-case "$ac_with_odbc" in
- Microsoft)
- HAS_ODBC=1
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Microsoft" >&5
-$as_echo "Microsoft" >&6; }
- LIBS_ODBC="-lodbc32"
- ;;
- unixODBC)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unixODBC" >&5
-$as_echo "unixODBC" >&6; }
- ac_fn_cxx_check_header_mongrel "$LINENO" "sqlext.h" "ac_cv_header_sqlext_h" "$ac_includes_default"
-if test "x$ac_cv_header_sqlext_h" = xyes; then :
-
-else
- as_fn_error $? "unixODBC not found !" "$LINENO" 5
-fi
-
-
- HAS_ODBC=1
-
- LIBS_ODBC="-lodbc"
- ;;
- iODBC)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: iODBC" >&5
-$as_echo "iODBC" >&6; }
- # Extract the first word of "iodbc-config", so it can be a program name with args.
-set dummy iodbc-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_IODBC_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$IODBC_CONFIG"; then
- ac_cv_prog_IODBC_CONFIG="$IODBC_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_IODBC_CONFIG="yes"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_IODBC_CONFIG" && ac_cv_prog_IODBC_CONFIG="no"
-fi
-fi
-IODBC_CONFIG=$ac_cv_prog_IODBC_CONFIG
-if test -n "$IODBC_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IODBC_CONFIG" >&5
-$as_echo "$IODBC_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$IODBC_CONFIG" = "xyes"
- then
- HAS_ODBC=1
-
- LIBS_ODBC="`iodbc-config --libs`"
- CPPFLAGS_ODBC="`iodbc-config --cflags`"
- else
- as_fn_error $? "iODBC not found !" "$LINENO" 5
- fi
- ;;
- no)
- HAS_ODBC=0
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Unknown option : $ac_with_odbc" "$LINENO" 5
- ;;
-esac
-
-
-
-
-#for SMTPAppender
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SMTP support" >&5
-$as_echo_n "checking for SMTP support... " >&6; }
-
-@%:@ Check whether --with-SMTP was given.
-if test "${with_SMTP+set}" = set; then :
- withval=$with_SMTP; ac_with_smtp=$withval
-else
- ac_with_smtp=no
-fi
-
-case "$ac_with_smtp" in
- libesmtp)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libesmtp" >&5
-$as_echo "libesmtp" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smtp_create_session in -lesmtp" >&5
-$as_echo_n "checking for smtp_create_session in -lesmtp... " >&6; }
-if ${ac_cv_lib_esmtp_smtp_create_session+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lesmtp -lesmtp $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char smtp_create_session ();
-int
-main ()
-{
-return smtp_create_session ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_esmtp_smtp_create_session=yes
-else
- ac_cv_lib_esmtp_smtp_create_session=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_esmtp_smtp_create_session" >&5
-$as_echo "$ac_cv_lib_esmtp_smtp_create_session" >&6; }
-if test "x$ac_cv_lib_esmtp_smtp_create_session" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_LIBESMTP 1
-_ACEOF
-
- LIBS="-lesmtp $LIBS"
-
-else
- as_fn_error $? "libesmtp library not found !" "$LINENO" 5
-fi
-
- HAS_LIBESMTP=1
-
- LIBS="-lesmtp $LIBS"
- ;;
- no)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- HAS_LIBESMTP=0
-
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Unknown option : $ac_with_smtp" "$LINENO" 5
- ;;
-esac
-
-#for char api
-@%:@ Check whether --enable-char was given.
-if test "${enable_char+set}" = set; then :
- enableval=$enable_char;
-fi
-
-if test "x$enable_char" = xno; then
- have_char_api=no
-else
- have_char_api=yes
-fi
-
-if test "$have_char_api" = "yes"
-then
- CHAR_API=1
-
-else
- CHAR_API=0
-
-fi
-
-#for wchar_t api
-@%:@ Check whether --enable-wchar_t was given.
-if test "${enable_wchar_t+set}" = set; then :
- enableval=$enable_wchar_t;
-fi
-
-if test "x$enable_wchar_t" = xno; then
- have_wchar_t_api=no
-else
- if test "$have_wchar_t" = "yes"
- then
- have_wchar_t_api=yes
- else
- have_wchar_t_api=no
- fi
-fi
-
-if test "$have_wchar_t_api" = "yes"
-then
- WCHAR_T_API=1
-
-else
- WCHAR_T_API=0
-
-fi
-
-#for unichar api
-@%:@ Check whether --enable-unichar was given.
-if test "${enable_unichar+set}" = set; then :
- enableval=$enable_unichar;
-fi
-
-if test "x$enable_unichar" = "yes"
-then
- UNICHAR_API=1
-
-else
- UNICHAR_API=0
-
-fi
-
-#for cfstring api
-@%:@ Check whether --enable-cfstring was given.
-if test "${enable_cfstring+set}" = set; then :
- enableval=$enable_cfstring;
-fi
-
-if test "x$enable_cfstring" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfstring" >&5
-$as_echo_n "checking for cfstring... " >&6; }
- CPPFLAGS="$CPPFLAGS -framework CoreFoundation"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <CoreFoundation/CFString.h>
- CFStringRef x = CFSTR("Hello");
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- have_cfstring_api=yes
-else
- have_cfstring_api=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cfstring_api" >&5
-$as_echo "$have_cfstring_api" >&6; }
-else
- have_cfstring_api=no
-fi
-
-if test "$have_cfstring_api" = "yes"
-then
- CFSTRING_API=1
-
-else
- CFSTRING_API=0
-
-fi
-
-#determine charset type
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking charset type" >&5
-$as_echo_n "checking charset type... " >&6; }
-
-@%:@ Check whether --with-charset was given.
-if test "${with_charset+set}" = set; then :
- withval=$with_charset; ac_with_charset=$withval
-else
- ac_with_charset=auto
-fi
-
-
-case "$ac_with_charset" in
- utf-8)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: utf-8" >&5
-$as_echo "utf-8" >&6; }
- CHARSET_UTF8=1
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- iso-8859-1)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: iso-8859-1" >&5
-$as_echo "iso-8859-1" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=1
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- usascii)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: usascii" >&5
-$as_echo "usascii" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=1
-
- CHARSET_EBCDIC=0
-
- ;;
-
- ebcdic)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: usascii" >&5
-$as_echo "usascii" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=1
-
- ;;
-
- auto)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5
-$as_echo "auto" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Invalid charset type: $ac_with_charset" "$LINENO" 5
- ;;
-esac
-
-
-
-#determine logchar type
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking logchar type" >&5
-$as_echo_n "checking logchar type... " >&6; }
-
-@%:@ Check whether --with-logchar was given.
-if test "${with_logchar+set}" = set; then :
- withval=$with_logchar; ac_with_logchar=$withval
-else
- ac_with_logchar=utf-8
-fi
-
-
-case "$ac_with_logchar" in
- utf-8)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: utf-8" >&5
-$as_echo "utf-8" >&6; }
- LOGCHAR_IS_UTF8=1
-
- LOGCHAR_IS_WCHAR=0
-
- LOGCHAR_IS_UNICHAR=0
-
- ;;
-
- wchar_t)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: wchar_t" >&5
-$as_echo "wchar_t" >&6; }
- LOGCHAR_IS_UTF8=0
-
- LOGCHAR_IS_WCHAR=1
-
- LOGCHAR_IS_UNICHAR=0
-
- ;;
-
- unichar)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unichar" >&5
-$as_echo "unichar" >&6; }
- LOGCHAR_IS_UTF8=0
-
- LOGCHAR_IS_WCHAR=0
-
- LOGCHAR_IS_UNICHAR=1
-
- ;;
-
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Invalid logchar type: $ac_with_logchar" "$LINENO" 5
- ;;
-esac
-
-
-
-# Create files
-# ----------------------------------------------------------------------------
-
-ac_config_files="$ac_config_files Makefile liblog4cxx.pc src/Makefile src/main/Makefile src/main/cpp/Makefile src/main/include/Makefile src/main/include/log4cxx/log4cxx.h src/main/include/log4cxx/private/log4cxx_private.h src/main/include/log4cxx/private/Makefile src/main/include/log4cxx/Makefile src/main/include/log4cxx/helpers/Makefile src/main/include/log4cxx/net/Makefile src/main/include/log4cxx/nt/Makefile src/main/include/log4cxx/spi/Makefile src/main/include/log4cxx/spi/location/Makefile src/main/include/log4cxx/varia/Makefile src/main/include/log4cxx/xml/Makefile src/main/include/log4cxx/config/Makefile src/main/include/log4cxx/db/Makefile src/main/include/log4cxx/rolling/Makefile src/main/include/log4cxx/pattern/Makefile src/main/include/log4cxx/filter/Makefile src/site/Makefile src/site/doxy/Makefile src/site/doxy/Doxyfile src/test/Makefile src/test/resources/Makefile src/test/resources/input/Makefile src/test/resources/input/ndc/Makefile src/test/resources/input/rolling/Makefile src/test/resources/input/xml/Makefile src/test/cpp/Makefile src/test/resources/witness/Makefile src/test/resources/witness/encoding/Makefile src/test/resources/witness/ndc/Makefile src/test/resources/witness/rolling/Makefile src/examples/Makefile src/examples/cpp/Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIB@&t@OBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DOC_TRUE}" && test -z "${DOC_FALSE}"; then
- as_fn_error $? "conditional \"DOC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LATEX_DOC_TRUE}" && test -z "${LATEX_DOC_FALSE}"; then
- as_fn_error $? "conditional \"LATEX_DOC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in @%:@(
- *posix*) :
- set -o posix ;; @%:@(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in @%:@(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in @%:@((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD]
-@%:@ ----------------------------------------
-@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-@%:@ script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} @%:@ as_fn_error
-
-
-@%:@ as_fn_set_status STATUS
-@%:@ -----------------------
-@%:@ Set @S|@? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} @%:@ as_fn_set_status
-
-@%:@ as_fn_exit STATUS
-@%:@ -----------------
-@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} @%:@ as_fn_exit
-
-@%:@ as_fn_unset VAR
-@%:@ ---------------
-@%:@ Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-@%:@ as_fn_append VAR VALUE
-@%:@ ----------------------
-@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take
-@%:@ advantage of any shell optimizations that allow amortized linear growth over
-@%:@ repeated appends, instead of the typical quadratic growth present in naive
-@%:@ implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-@%:@ as_fn_arith ARG...
-@%:@ ------------------
-@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the
-@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments
-@%:@ must be portable across @S|@(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in @%:@(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-@%:@ as_fn_mkdir_p
-@%:@ -------------
-@%:@ Create "@S|@as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} @%:@ as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-@%:@ as_fn_executable_p FILE
-@%:@ -----------------------
-@%:@ Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} @%:@ as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
-@%:@@%:@ Running $as_me. @%:@@%:@
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "liblog4cxx.pc") CONFIG_FILES="$CONFIG_FILES liblog4cxx.pc" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/main/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/Makefile" ;;
- "src/main/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/cpp/Makefile" ;;
- "src/main/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/Makefile" ;;
- "src/main/include/log4cxx/log4cxx.h") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/log4cxx.h" ;;
- "src/main/include/log4cxx/private/log4cxx_private.h") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/private/log4cxx_private.h" ;;
- "src/main/include/log4cxx/private/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/private/Makefile" ;;
- "src/main/include/log4cxx/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/Makefile" ;;
- "src/main/include/log4cxx/helpers/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/helpers/Makefile" ;;
- "src/main/include/log4cxx/net/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/net/Makefile" ;;
- "src/main/include/log4cxx/nt/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/nt/Makefile" ;;
- "src/main/include/log4cxx/spi/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/spi/Makefile" ;;
- "src/main/include/log4cxx/spi/location/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/spi/location/Makefile" ;;
- "src/main/include/log4cxx/varia/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/varia/Makefile" ;;
- "src/main/include/log4cxx/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/xml/Makefile" ;;
- "src/main/include/log4cxx/config/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/config/Makefile" ;;
- "src/main/include/log4cxx/db/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/db/Makefile" ;;
- "src/main/include/log4cxx/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/rolling/Makefile" ;;
- "src/main/include/log4cxx/pattern/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/pattern/Makefile" ;;
- "src/main/include/log4cxx/filter/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/filter/Makefile" ;;
- "src/site/Makefile") CONFIG_FILES="$CONFIG_FILES src/site/Makefile" ;;
- "src/site/doxy/Makefile") CONFIG_FILES="$CONFIG_FILES src/site/doxy/Makefile" ;;
- "src/site/doxy/Doxyfile") CONFIG_FILES="$CONFIG_FILES src/site/doxy/Doxyfile" ;;
- "src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
- "src/test/resources/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/Makefile" ;;
- "src/test/resources/input/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/Makefile" ;;
- "src/test/resources/input/ndc/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/ndc/Makefile" ;;
- "src/test/resources/input/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/rolling/Makefile" ;;
- "src/test/resources/input/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/xml/Makefile" ;;
- "src/test/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/cpp/Makefile" ;;
- "src/test/resources/witness/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/Makefile" ;;
- "src/test/resources/witness/encoding/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/encoding/Makefile" ;;
- "src/test/resources/witness/ndc/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/ndc/Makefile" ;;
- "src/test/resources/witness/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/rolling/Makefile" ;;
- "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;;
- "src/examples/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp/Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests
deleted file mode 100644
index 4230a26bbf..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file was generated by Autom4te Thu Apr 10 10:06:43 UTC 2014.
-# It contains the lists of macros which have been traced.
-# It can be safely removed.
-
-@request = (
- bless( [
- '0',
- 1,
- [
- '/usr/share/autoconf'
- ],
- [
- '/usr/share/autoconf/autoconf/autoconf.m4f',
- 'aclocal.m4',
- 'configure.in'
- ],
- {
- 'AM_MAKEFILE_INCLUDE' => 1,
- 'AC_CONFIG_HEADERS' => 1,
- 'sinclude' => 1,
- '_AM_SUBST_NOTMAKE' => 1,
- 'AM_GNU_GETTEXT' => 1,
- '_AM_COND_ELSE' => 1,
- 'AC_REQUIRE_AUX_FILE' => 1,
- 'AC_CONFIG_LINKS' => 1,
- 'm4_sinclude' => 1,
- 'AM_AUTOMAKE_VERSION' => 1,
- 'AM_PROG_CC_C_O' => 1,
- 'LT_SUPPORTED_TAG' => 1,
- 'AC_CANONICAL_TARGET' => 1,
- 'AM_SILENT_RULES' => 1,
- 'AM_PROG_F77_C_O' => 1,
- 'AC_SUBST' => 1,
- 'm4_pattern_forbid' => 1,
- 'AM_MAINTAINER_MODE' => 1,
- 'AC_CONFIG_LIBOBJ_DIR' => 1,
- 'AM_INIT_AUTOMAKE' => 1,
- 'AC_FC_FREEFORM' => 1,
- 'AM_POT_TOOLS' => 1,
- 'AC_CANONICAL_HOST' => 1,
- 'LT_INIT' => 1,
- 'AC_CONFIG_AUX_DIR' => 1,
- 'LT_CONFIG_LTDL_DIR' => 1,
- '_AM_MAKEFILE_INCLUDE' => 1,
- 'AC_FC_PP_SRCEXT' => 1,
- 'AC_CANONICAL_SYSTEM' => 1,
- '_LT_AC_TAGCONFIG' => 1,
- 'AM_PATH_GUILE' => 1,
- 'AC_CONFIG_FILES' => 1,
- 'AC_LIBSOURCE' => 1,
- 'AC_CANONICAL_BUILD' => 1,
- 'AC_INIT' => 1,
- 'AC_SUBST_TRACE' => 1,
- 'AM_PROG_AR' => 1,
- 'm4_include' => 1,
- 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
- 'AH_OUTPUT' => 1,
- 'AC_FC_PP_DEFINE' => 1,
- 'AC_DEFINE_TRACE_LITERAL' => 1,
- 'm4_pattern_allow' => 1,
- 'AM_CONDITIONAL' => 1,
- '_AM_COND_ENDIF' => 1,
- '_AM_COND_IF' => 1,
- 'AM_PROG_MOC' => 1,
- 'AM_PROG_CXX_C_O' => 1,
- 'AC_CONFIG_SUBDIRS' => 1,
- 'include' => 1,
- 'AM_PROG_FC_C_O' => 1,
- 'AM_XGETTEXT_OPTION' => 1,
- 'AM_NLS' => 1,
- 'AM_ENABLE_MULTILIB' => 1,
- 'AC_PROG_LIBTOOL' => 1,
- '_m4_warn' => 1,
- 'AC_FC_SRCEXT' => 1
- }
- ], 'Autom4te::Request' )
- );
-
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0 b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0
deleted file mode 100644
index e3e68a1a13..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0
+++ /dev/null
@@ -1,1131 +0,0 @@
-m4trace:aclocal.m4:7256: -1- m4_include([find_apr.m4])
-m4trace:aclocal.m4:7257: -1- m4_include([find_apu.m4])
-m4trace:configure.in:1: -1- AC_INIT([src/main/cpp/logger.cpp])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([_AC_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
-m4trace:configure.in:1: -1- m4_pattern_allow([^AS_FLAGS$])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?m4_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^dnl$])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?AS_])
-m4trace:configure.in:1: -1- AC_SUBST([SHELL])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([SHELL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^SHELL$])
-m4trace:configure.in:1: -1- AC_SUBST([PATH_SEPARATOR])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_NAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_STRING])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_URL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_URL$])
-m4trace:configure.in:1: -1- AC_SUBST([exec_prefix], [NONE])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([exec_prefix])
-m4trace:configure.in:1: -1- m4_pattern_allow([^exec_prefix$])
-m4trace:configure.in:1: -1- AC_SUBST([prefix], [NONE])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([prefix])
-m4trace:configure.in:1: -1- m4_pattern_allow([^prefix$])
-m4trace:configure.in:1: -1- AC_SUBST([program_transform_name], [s,x,x,])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([program_transform_name])
-m4trace:configure.in:1: -1- m4_pattern_allow([^program_transform_name$])
-m4trace:configure.in:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([bindir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^bindir$])
-m4trace:configure.in:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sbindir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sbindir$])
-m4trace:configure.in:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([libexecdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^libexecdir$])
-m4trace:configure.in:1: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([datarootdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^datarootdir$])
-m4trace:configure.in:1: -1- AC_SUBST([datadir], ['${datarootdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([datadir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^datadir$])
-m4trace:configure.in:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sysconfdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sysconfdir$])
-m4trace:configure.in:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sharedstatedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sharedstatedir$])
-m4trace:configure.in:1: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([localstatedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^localstatedir$])
-m4trace:configure.in:1: -1- AC_SUBST([includedir], ['${prefix}/include'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([includedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^includedir$])
-m4trace:configure.in:1: -1- AC_SUBST([oldincludedir], ['/usr/include'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([oldincludedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^oldincludedir$])
-m4trace:configure.in:1: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
- ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
- ['${datarootdir}/doc/${PACKAGE}'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([docdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^docdir$])
-m4trace:configure.in:1: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([infodir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^infodir$])
-m4trace:configure.in:1: -1- AC_SUBST([htmldir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([htmldir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^htmldir$])
-m4trace:configure.in:1: -1- AC_SUBST([dvidir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([dvidir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^dvidir$])
-m4trace:configure.in:1: -1- AC_SUBST([pdfdir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([pdfdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^pdfdir$])
-m4trace:configure.in:1: -1- AC_SUBST([psdir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([psdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^psdir$])
-m4trace:configure.in:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([libdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^libdir$])
-m4trace:configure.in:1: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([localedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^localedir$])
-m4trace:configure.in:1: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([mandir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^mandir$])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
-@%:@undef PACKAGE_NAME])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
-@%:@undef PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
-@%:@undef PACKAGE_VERSION])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
-@%:@undef PACKAGE_STRING])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
-@%:@undef PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_URL$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
-@%:@undef PACKAGE_URL])
-m4trace:configure.in:1: -1- AC_SUBST([DEFS])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([DEFS])
-m4trace:configure.in:1: -1- m4_pattern_allow([^DEFS$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_C])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_C])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_C$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_N])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_N])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_N$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_T])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_T])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_T$])
-m4trace:configure.in:1: -1- AC_SUBST([LIBS])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:1: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:1: -1- AC_SUBST([build_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([build_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^build_alias$])
-m4trace:configure.in:1: -1- AC_SUBST([host_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([host_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^host_alias$])
-m4trace:configure.in:1: -1- AC_SUBST([target_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([target_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^target_alias$])
-m4trace:configure.in:22: -1- AC_CANONICAL_HOST
-m4trace:configure.in:22: -1- AC_CANONICAL_BUILD
-m4trace:configure.in:22: -1- AC_REQUIRE_AUX_FILE([config.sub])
-m4trace:configure.in:22: -1- AC_REQUIRE_AUX_FILE([config.guess])
-m4trace:configure.in:22: -1- AC_SUBST([build], [$ac_cv_build])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build$])
-m4trace:configure.in:22: -1- AC_SUBST([build_cpu], [$[1]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_cpu])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_cpu$])
-m4trace:configure.in:22: -1- AC_SUBST([build_vendor], [$[2]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_vendor])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_vendor$])
-m4trace:configure.in:22: -1- AC_SUBST([build_os])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_os])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_os$])
-m4trace:configure.in:22: -1- AC_SUBST([host], [$ac_cv_host])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host$])
-m4trace:configure.in:22: -1- AC_SUBST([host_cpu], [$[1]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_cpu])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_cpu$])
-m4trace:configure.in:22: -1- AC_SUBST([host_vendor], [$[2]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_vendor])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_vendor$])
-m4trace:configure.in:22: -1- AC_SUBST([host_os])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_os])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_os$])
-m4trace:configure.in:23: -1- AC_CANONICAL_TARGET
-m4trace:configure.in:23: -1- AC_SUBST([target], [$ac_cv_target])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target$])
-m4trace:configure.in:23: -1- AC_SUBST([target_cpu], [$[1]])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_cpu])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_cpu$])
-m4trace:configure.in:23: -1- AC_SUBST([target_vendor], [$[2]])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_vendor])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_vendor$])
-m4trace:configure.in:23: -1- AC_SUBST([target_os])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_os])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_os$])
-m4trace:configure.in:34: -1- AC_SUBST([LT_VERSION])
-m4trace:configure.in:34: -1- AC_SUBST_TRACE([LT_VERSION])
-m4trace:configure.in:34: -1- m4_pattern_allow([^LT_VERSION$])
-m4trace:configure.in:36: -1- AH_OUTPUT([HAVE_NO_EXPLICIT_EXPORTS], [/* no explicit exports */
-#define LOG4CXX_EXPORT])
-m4trace:configure.in:40: -1- AM_INIT_AUTOMAKE([log4cxx], [0.10.0])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
-m4trace:configure.in:40: -1- AM_AUTOMAKE_VERSION([1.9.6])
-m4trace:configure.in:40: -1- AC_REQUIRE_AUX_FILE([install-sh])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_PROGRAM])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_SCRIPT])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_DATA])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_DATA])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_DATA$])
-m4trace:configure.in:40: -1- AC_SUBST([CYGPATH_W])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([CYGPATH_W])
-m4trace:configure.in:40: -1- m4_pattern_allow([^CYGPATH_W$])
-m4trace:configure.in:40: -1- AC_SUBST([PACKAGE], [log4cxx])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([PACKAGE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^PACKAGE$])
-m4trace:configure.in:40: -1- AC_SUBST([VERSION], [0.10.0])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([VERSION])
-m4trace:configure.in:40: -1- m4_pattern_allow([^VERSION$])
-m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^PACKAGE$])
-m4trace:configure.in:40: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
-@%:@undef PACKAGE])
-m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
-m4trace:configure.in:40: -1- m4_pattern_allow([^VERSION$])
-m4trace:configure.in:40: -1- AH_OUTPUT([VERSION], [/* Version number of package */
-@%:@undef VERSION])
-m4trace:configure.in:40: -1- AC_SUBST([ACLOCAL])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([ACLOCAL])
-m4trace:configure.in:40: -1- m4_pattern_allow([^ACLOCAL$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOCONF])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOCONF])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOCONF$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOMAKE])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOMAKE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOMAKE$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOHEADER])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOHEADER])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOHEADER$])
-m4trace:configure.in:40: -1- AC_SUBST([MAKEINFO])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([MAKEINFO])
-m4trace:configure.in:40: -1- m4_pattern_allow([^MAKEINFO$])
-m4trace:configure.in:40: -1- AC_SUBST([install_sh])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([install_sh])
-m4trace:configure.in:40: -1- m4_pattern_allow([^install_sh$])
-m4trace:configure.in:40: -1- AC_SUBST([STRIP])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([STRIP])
-m4trace:configure.in:40: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
-m4trace:configure.in:40: -1- AC_SUBST([mkdir_p])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([mkdir_p])
-m4trace:configure.in:40: -1- m4_pattern_allow([^mkdir_p$])
-m4trace:configure.in:40: -1- AC_SUBST([AWK])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AWK])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AWK$])
-m4trace:configure.in:40: -1- AC_SUBST([SET_MAKE])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([SET_MAKE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^SET_MAKE$])
-m4trace:configure.in:40: -1- AC_SUBST([am__leading_dot])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__leading_dot])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__leading_dot$])
-m4trace:configure.in:40: -1- AC_SUBST([AMTAR])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AMTAR])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AMTAR$])
-m4trace:configure.in:40: -1- AC_SUBST([am__tar])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__tar])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__tar$])
-m4trace:configure.in:40: -1- AC_SUBST([am__untar])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__untar])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__untar$])
-m4trace:configure.in:45: -1- AC_PROG_LIBTOOL
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:1927: AC_ENABLE_SHARED is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:1966: AC_ENABLE_STATIC is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:2005: AC_ENABLE_FAST_INSTALL is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_CC$])
-m4trace:configure.in:45: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([EXEEXT])
-m4trace:configure.in:45: -1- m4_pattern_allow([^EXEEXT$])
-m4trace:configure.in:45: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([OBJEXT])
-m4trace:configure.in:45: -1- m4_pattern_allow([^OBJEXT$])
-m4trace:configure.in:45: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([DEPDIR])
-m4trace:configure.in:45: -1- m4_pattern_allow([^DEPDIR$])
-m4trace:configure.in:45: -1- AC_SUBST([am__include])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__include])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__include$])
-m4trace:configure.in:45: -1- AC_SUBST([am__quote])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__quote])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__quote$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEP_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEP_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEP_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEP_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEP_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEP_FALSE$])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEPBACKSLASH])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
-m4trace:configure.in:45: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CCDEPMODE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CCDEPMODE$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([am__fastdepCC], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCC_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCC_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:2146: AC_PROG_LD is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([GREP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([GREP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.in:45: -1- AC_SUBST([EGREP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([EGREP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^EGREP$])
-m4trace:configure.in:45: -1- AC_SUBST([LN_S], [$as_ln_s])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LN_S])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LN_S$])
-m4trace:configure.in:45: -1- AC_SUBST([ECHO])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ECHO])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ECHO$])
-m4trace:configure.in:45: -1- AC_SUBST([AR])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AR])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AR$])
-m4trace:configure.in:45: -1- AC_SUBST([RANLIB])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.in:45: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.in:45: -1- AC_SUBST([STRIP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([STRIP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2687: AC_TRY_LINK is expanded from...
-../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
-../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:475: _LT_AC_LOCK is expanded from...
-aclocal.m4:1079: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
-@%:@undef HAVE_DLFCN_H])
-m4trace:configure.in:45: -1- AC_SUBST([CPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^STDC_HEADERS$])
-m4trace:configure.in:45: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
-@%:@undef STDC_HEADERS])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
-@%:@undef HAVE_SYS_TYPES_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
-@%:@undef HAVE_SYS_STAT_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
-@%:@undef HAVE_STDLIB_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
-@%:@undef HAVE_STRING_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
-@%:@undef HAVE_MEMORY_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
-@%:@undef HAVE_STRINGS_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
-@%:@undef HAVE_INTTYPES_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
-@%:@undef HAVE_STDINT_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
-@%:@undef HAVE_UNISTD_H])
-m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
-m4trace:configure.in:45: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
-m4trace:configure.in:45: -1- _LT_AC_TAGCONFIG
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: tag name \"$tagname\" already exists], [aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXDEPMODE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXDEPMODE$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([am__fastdepCXX], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCXX_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCXX_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^F77$])
-m4trace:configure.in:45: -1- AC_SUBST([FFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([FFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^FFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^F77$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_F77$])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:3909: _LT_AC_LANG_F77_CONFIG is expanded from...
-aclocal.m4:3908: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:3909: _LT_AC_LANG_F77_CONFIG is expanded from...
-aclocal.m4:3908: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:134: AC_LANG_RESTORE is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
-aclocal.m4:4067: _LT_AC_LANG_RC_CONFIG is expanded from...
-aclocal.m4:4066: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:134: AC_LANG_RESTORE is expanded from...
-aclocal.m4:4067: _LT_AC_LANG_RC_CONFIG is expanded from...
-aclocal.m4:4066: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([LIBTOOL])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBTOOL])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBTOOL$])
-m4trace:configure.in:47: -1- AC_SUBST([SET_MAKE])
-m4trace:configure.in:47: -1- AC_SUBST_TRACE([SET_MAKE])
-m4trace:configure.in:47: -1- m4_pattern_allow([^SET_MAKE$])
-m4trace:configure.in:49: -1- AC_SUBST([CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([LIBS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:49: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([ac_ct_CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([ac_ct_CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^ac_ct_CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXXDEPMODE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXXDEPMODE$])
-m4trace:configure.in:49: -1- AM_CONDITIONAL([am__fastdepCXX], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:49: -1- AC_SUBST([am__fastdepCXX_TRUE])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
-m4trace:configure.in:49: -1- AC_SUBST([am__fastdepCXX_FALSE])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
-m4trace:configure.in:51: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:51: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:51: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:66: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:66: the top level])
-m4trace:configure.in:70: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:70: the top level])
-m4trace:configure.in:74: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:74: the top level])
-m4trace:configure.in:80: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:80: the top level])
-m4trace:configure.in:88: -1- AC_SUBST([DOXYGEN])
-m4trace:configure.in:88: -1- AC_SUBST_TRACE([DOXYGEN])
-m4trace:configure.in:88: -1- m4_pattern_allow([^DOXYGEN$])
-m4trace:configure.in:96: -1- AC_SUBST([DOT])
-m4trace:configure.in:96: -1- AC_SUBST_TRACE([DOT])
-m4trace:configure.in:96: -1- m4_pattern_allow([^DOT$])
-m4trace:configure.in:99: -1- AM_CONDITIONAL([DOC], [test x$enable_doc = xyes])
-m4trace:configure.in:99: -1- AC_SUBST([DOC_TRUE])
-m4trace:configure.in:99: -1- AC_SUBST_TRACE([DOC_TRUE])
-m4trace:configure.in:99: -1- m4_pattern_allow([^DOC_TRUE$])
-m4trace:configure.in:99: -1- AC_SUBST([DOC_FALSE])
-m4trace:configure.in:99: -1- AC_SUBST_TRACE([DOC_FALSE])
-m4trace:configure.in:99: -1- m4_pattern_allow([^DOC_FALSE$])
-m4trace:configure.in:100: -1- AM_CONDITIONAL([LATEX_DOC], [test x$enable_latex_docs = xyes])
-m4trace:configure.in:100: -1- AC_SUBST([LATEX_DOC_TRUE])
-m4trace:configure.in:100: -1- AC_SUBST_TRACE([LATEX_DOC_TRUE])
-m4trace:configure.in:100: -1- m4_pattern_allow([^LATEX_DOC_TRUE$])
-m4trace:configure.in:100: -1- AC_SUBST([LATEX_DOC_FALSE])
-m4trace:configure.in:100: -1- AC_SUBST_TRACE([LATEX_DOC_FALSE])
-m4trace:configure.in:100: -1- m4_pattern_allow([^LATEX_DOC_FALSE$])
-m4trace:configure.in:114: -1- AC_SUBST([enable_dot])
-m4trace:configure.in:114: -1- AC_SUBST_TRACE([enable_dot])
-m4trace:configure.in:114: -1- m4_pattern_allow([^enable_dot$])
-m4trace:configure.in:115: -1- AC_SUBST([enable_html_docs])
-m4trace:configure.in:115: -1- AC_SUBST_TRACE([enable_html_docs])
-m4trace:configure.in:115: -1- m4_pattern_allow([^enable_html_docs$])
-m4trace:configure.in:116: -1- AC_SUBST([enable_latex_docs])
-m4trace:configure.in:116: -1- AC_SUBST_TRACE([enable_latex_docs])
-m4trace:configure.in:116: -1- m4_pattern_allow([^enable_latex_docs$])
-m4trace:configure.in:117: -1- AC_SUBST([manual_dest])
-m4trace:configure.in:117: -1- AC_SUBST_TRACE([manual_dest])
-m4trace:configure.in:117: -1- m4_pattern_allow([^manual_dest$])
-m4trace:configure.in:118: -1- AC_SUBST([base_dir])
-m4trace:configure.in:118: -1- AC_SUBST_TRACE([base_dir])
-m4trace:configure.in:118: -1- m4_pattern_allow([^base_dir$])
-m4trace:configure.in:132: -1- AC_SUBST([APR_LIBS])
-m4trace:configure.in:132: -1- AC_SUBST_TRACE([APR_LIBS])
-m4trace:configure.in:132: -1- m4_pattern_allow([^APR_LIBS$])
-m4trace:configure.in:142: -1- AC_SUBST([APU_LIBS])
-m4trace:configure.in:142: -1- AC_SUBST_TRACE([APU_LIBS])
-m4trace:configure.in:142: -1- m4_pattern_allow([^APU_LIBS$])
-m4trace:configure.in:149: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the `mbsrtowcs\' function. */
-@%:@undef HAVE_MBSRTOWCS])
-m4trace:configure.in:149: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBSRTOWCS])
-m4trace:configure.in:149: -1- m4_pattern_allow([^HAVE_MBSRTOWCS$])
-m4trace:configure.in:152: -1- AC_SUBST([HAS_MBSRTOWCS], [1])
-m4trace:configure.in:152: -1- AC_SUBST_TRACE([HAS_MBSRTOWCS])
-m4trace:configure.in:152: -1- m4_pattern_allow([^HAS_MBSRTOWCS$])
-m4trace:configure.in:154: -1- AC_SUBST([HAS_MBSRTOWCS], [0])
-m4trace:configure.in:154: -1- AC_SUBST_TRACE([HAS_MBSRTOWCS])
-m4trace:configure.in:154: -1- m4_pattern_allow([^HAS_MBSRTOWCS$])
-m4trace:configure.in:157: -1- AH_OUTPUT([HAVE_WCSTOMBS], [/* Define to 1 if you have the `wcstombs\' function. */
-@%:@undef HAVE_WCSTOMBS])
-m4trace:configure.in:157: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSTOMBS])
-m4trace:configure.in:157: -1- m4_pattern_allow([^HAVE_WCSTOMBS$])
-m4trace:configure.in:160: -1- AC_SUBST([HAS_WCSTOMBS], [1])
-m4trace:configure.in:160: -1- AC_SUBST_TRACE([HAS_WCSTOMBS])
-m4trace:configure.in:160: -1- m4_pattern_allow([^HAS_WCSTOMBS$])
-m4trace:configure.in:162: -1- AC_SUBST([HAS_WCSTOMBS], [0])
-m4trace:configure.in:162: -1- AC_SUBST_TRACE([HAS_WCSTOMBS])
-m4trace:configure.in:162: -1- m4_pattern_allow([^HAS_WCSTOMBS$])
-m4trace:configure.in:166: -1- AH_OUTPUT([HAVE_SYSLOG], [/* Define to 1 if you have the `syslog\' function. */
-@%:@undef HAVE_SYSLOG])
-m4trace:configure.in:166: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLOG])
-m4trace:configure.in:166: -1- m4_pattern_allow([^HAVE_SYSLOG$])
-m4trace:configure.in:169: -1- AC_SUBST([HAS_SYSLOG], [1])
-m4trace:configure.in:169: -1- AC_SUBST_TRACE([HAS_SYSLOG])
-m4trace:configure.in:169: -1- m4_pattern_allow([^HAS_SYSLOG$])
-m4trace:configure.in:171: -1- AC_SUBST([HAS_SYSLOG], [0])
-m4trace:configure.in:171: -1- AC_SUBST_TRACE([HAS_SYSLOG])
-m4trace:configure.in:171: -1- m4_pattern_allow([^HAS_SYSLOG$])
-m4trace:configure.in:177: -1- AC_SUBST([HAS_STD_LOCALE], [1])
-m4trace:configure.in:177: -1- AC_SUBST_TRACE([HAS_STD_LOCALE])
-m4trace:configure.in:177: -1- m4_pattern_allow([^HAS_STD_LOCALE$])
-m4trace:configure.in:179: -1- AC_SUBST([HAS_STD_LOCALE], [0])
-m4trace:configure.in:179: -1- AC_SUBST_TRACE([HAS_STD_LOCALE])
-m4trace:configure.in:179: -1- m4_pattern_allow([^HAS_STD_LOCALE$])
-m4trace:configure.in:183: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
-configure.in:183: the top level])
-m4trace:configure.in:189: -1- AC_SUBST([HAS_WCHAR_T], [1])
-m4trace:configure.in:189: -1- AC_SUBST_TRACE([HAS_WCHAR_T])
-m4trace:configure.in:189: -1- m4_pattern_allow([^HAS_WCHAR_T$])
-m4trace:configure.in:191: -1- AC_SUBST([HAS_WCHAR_T], [0])
-m4trace:configure.in:191: -1- AC_SUBST_TRACE([HAS_WCHAR_T])
-m4trace:configure.in:191: -1- m4_pattern_allow([^HAS_WCHAR_T$])
-m4trace:configure.in:194: -1- AH_OUTPUT([HAVE_FWIDE], [/* Define to 1 if you have the `fwide\' function. */
-@%:@undef HAVE_FWIDE])
-m4trace:configure.in:194: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FWIDE])
-m4trace:configure.in:194: -1- m4_pattern_allow([^HAVE_FWIDE$])
-m4trace:configure.in:197: -1- AC_SUBST([HAS_FWIDE], [1])
-m4trace:configure.in:197: -1- AC_SUBST_TRACE([HAS_FWIDE])
-m4trace:configure.in:197: -1- m4_pattern_allow([^HAS_FWIDE$])
-m4trace:configure.in:199: -1- AC_SUBST([HAS_FWIDE], [0])
-m4trace:configure.in:199: -1- AC_SUBST_TRACE([HAS_FWIDE])
-m4trace:configure.in:199: -1- m4_pattern_allow([^HAS_FWIDE$])
-m4trace:configure.in:206: -1- AC_SUBST([RANLIB])
-m4trace:configure.in:206: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.in:206: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.in:212: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:212: the top level])
-m4trace:configure.in:218: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:218: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:218: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:225: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:225: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:225: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:230: -1- AC_SUBST([IODBC_CONFIG])
-m4trace:configure.in:230: -1- AC_SUBST_TRACE([IODBC_CONFIG])
-m4trace:configure.in:230: -1- m4_pattern_allow([^IODBC_CONFIG$])
-m4trace:configure.in:233: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:233: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:233: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:241: -1- AC_SUBST([HAS_ODBC], [0], [No ODBC support])
-m4trace:configure.in:241: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:241: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:249: -1- AC_SUBST([LIBS_ODBC])
-m4trace:configure.in:249: -1- AC_SUBST_TRACE([LIBS_ODBC])
-m4trace:configure.in:249: -1- m4_pattern_allow([^LIBS_ODBC$])
-m4trace:configure.in:250: -1- AC_SUBST([CPPFLAGS_ODBC])
-m4trace:configure.in:250: -1- AC_SUBST_TRACE([CPPFLAGS_ODBC])
-m4trace:configure.in:250: -1- m4_pattern_allow([^CPPFLAGS_ODBC$])
-m4trace:configure.in:256: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:256: the top level])
-m4trace:configure.in:263: -1- AH_OUTPUT([HAVE_LIBESMTP], [/* Define to 1 if you have the `esmtp\' library (-lesmtp). */
-@%:@undef HAVE_LIBESMTP])
-m4trace:configure.in:263: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBESMTP])
-m4trace:configure.in:263: -1- m4_pattern_allow([^HAVE_LIBESMTP$])
-m4trace:configure.in:266: -1- AC_SUBST([HAS_LIBESMTP], [1], [SMTP support through libesmtp library.])
-m4trace:configure.in:266: -1- AC_SUBST_TRACE([HAS_LIBESMTP])
-m4trace:configure.in:266: -1- m4_pattern_allow([^HAS_LIBESMTP$])
-m4trace:configure.in:271: -1- AC_SUBST([HAS_LIBESMTP], [0], [SMTP support through libesmtp library.])
-m4trace:configure.in:271: -1- AC_SUBST_TRACE([HAS_LIBESMTP])
-m4trace:configure.in:271: -1- m4_pattern_allow([^HAS_LIBESMTP$])
-m4trace:configure.in:281: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:281: the top level])
-m4trace:configure.in:291: -1- AC_SUBST([CHAR_API], [1])
-m4trace:configure.in:291: -1- AC_SUBST_TRACE([CHAR_API])
-m4trace:configure.in:291: -1- m4_pattern_allow([^CHAR_API$])
-m4trace:configure.in:293: -1- AC_SUBST([CHAR_API], [0])
-m4trace:configure.in:293: -1- AC_SUBST_TRACE([CHAR_API])
-m4trace:configure.in:293: -1- m4_pattern_allow([^CHAR_API$])
-m4trace:configure.in:298: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:298: the top level])
-m4trace:configure.in:313: -1- AC_SUBST([WCHAR_T_API], [1])
-m4trace:configure.in:313: -1- AC_SUBST_TRACE([WCHAR_T_API])
-m4trace:configure.in:313: -1- m4_pattern_allow([^WCHAR_T_API$])
-m4trace:configure.in:315: -1- AC_SUBST([WCHAR_T_API], [0])
-m4trace:configure.in:315: -1- AC_SUBST_TRACE([WCHAR_T_API])
-m4trace:configure.in:315: -1- m4_pattern_allow([^WCHAR_T_API$])
-m4trace:configure.in:320: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:320: the top level])
-m4trace:configure.in:324: -1- AC_SUBST([UNICHAR_API], [1])
-m4trace:configure.in:324: -1- AC_SUBST_TRACE([UNICHAR_API])
-m4trace:configure.in:324: -1- m4_pattern_allow([^UNICHAR_API$])
-m4trace:configure.in:326: -1- AC_SUBST([UNICHAR_API], [0])
-m4trace:configure.in:326: -1- AC_SUBST_TRACE([UNICHAR_API])
-m4trace:configure.in:326: -1- m4_pattern_allow([^UNICHAR_API$])
-m4trace:configure.in:331: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:331: the top level])
-m4trace:configure.in:336: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
-configure.in:336: the top level])
-m4trace:configure.in:346: -1- AC_SUBST([CFSTRING_API], [1])
-m4trace:configure.in:346: -1- AC_SUBST_TRACE([CFSTRING_API])
-m4trace:configure.in:346: -1- m4_pattern_allow([^CFSTRING_API$])
-m4trace:configure.in:348: -1- AC_SUBST([CFSTRING_API], [0])
-m4trace:configure.in:348: -1- AC_SUBST_TRACE([CFSTRING_API])
-m4trace:configure.in:348: -1- m4_pattern_allow([^CFSTRING_API$])
-m4trace:configure.in:354: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:354: the top level])
-m4trace:configure.in:362: -1- AC_SUBST([CHARSET_UTF8], [1])
-m4trace:configure.in:362: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:362: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:363: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:363: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:363: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:364: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:364: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:364: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:365: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:365: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:365: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:370: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:370: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:370: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:371: -1- AC_SUBST([CHARSET_ISO88591], [1])
-m4trace:configure.in:371: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:371: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:372: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:372: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:372: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:373: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:373: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:373: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:378: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:378: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:378: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:379: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:379: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:379: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:380: -1- AC_SUBST([CHARSET_USASCII], [1])
-m4trace:configure.in:380: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:380: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:381: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:381: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:381: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:386: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:386: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:386: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:387: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:387: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:387: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:388: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:388: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:388: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:389: -1- AC_SUBST([CHARSET_EBCDIC], [1])
-m4trace:configure.in:389: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:389: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:394: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:394: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:394: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:395: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:395: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:395: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:396: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:396: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:396: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:397: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:397: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:397: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:411: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:411: the top level])
-m4trace:configure.in:419: -1- AC_SUBST([LOGCHAR_IS_UTF8], [1])
-m4trace:configure.in:419: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:419: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:420: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [0])
-m4trace:configure.in:420: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:420: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:421: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [0])
-m4trace:configure.in:421: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:421: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:426: -1- AC_SUBST([LOGCHAR_IS_UTF8], [0])
-m4trace:configure.in:426: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:426: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:427: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [1])
-m4trace:configure.in:427: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:427: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:428: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [0])
-m4trace:configure.in:428: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:428: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:433: -1- AC_SUBST([LOGCHAR_IS_UTF8], [0])
-m4trace:configure.in:433: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:433: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:434: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [0])
-m4trace:configure.in:434: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:434: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:435: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [1])
-m4trace:configure.in:435: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:435: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:449: -1- AC_CONFIG_FILES([
-Makefile
-liblog4cxx.pc
-src/Makefile
-src/main/Makefile
-src/main/cpp/Makefile
-src/main/include/Makefile
-src/main/include/log4cxx/log4cxx.h
-src/main/include/log4cxx/private/log4cxx_private.h
-src/main/include/log4cxx/private/Makefile
-src/main/include/log4cxx/Makefile
-src/main/include/log4cxx/helpers/Makefile
-src/main/include/log4cxx/net/Makefile
-src/main/include/log4cxx/nt/Makefile
-src/main/include/log4cxx/spi/Makefile
-src/main/include/log4cxx/spi/location/Makefile
-src/main/include/log4cxx/varia/Makefile
-src/main/include/log4cxx/xml/Makefile
-src/main/include/log4cxx/config/Makefile
-src/main/include/log4cxx/db/Makefile
-src/main/include/log4cxx/rolling/Makefile
-src/main/include/log4cxx/pattern/Makefile
-src/main/include/log4cxx/filter/Makefile
-src/site/Makefile
-src/site/doxy/Makefile
-src/site/doxy/Doxyfile
-src/test/Makefile
-src/test/resources/Makefile
-src/test/resources/input/Makefile
-src/test/resources/input/ndc/Makefile
-src/test/resources/input/rolling/Makefile
-src/test/resources/input/xml/Makefile
-src/test/cpp/Makefile
-src/test/resources/witness/Makefile
-src/test/resources/witness/encoding/Makefile
-src/test/resources/witness/ndc/Makefile
-src/test/resources/witness/rolling/Makefile
-src/examples/Makefile
-src/examples/cpp/Makefile
-])
-m4trace:configure.in:489: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
-m4trace:configure.in:489: -1- m4_pattern_allow([^LIB@&t@OBJS$])
-m4trace:configure.in:489: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.in:489: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([INSTALL])
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
index 9fda7c8eb4..157982e845 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <stdlib.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
index ea5a680a6c..0336b8dafa 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/charsetdecoder.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
index 6b1f564666..adb8f8526d 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/charsetencoder.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
index 2963b45619..40e3b67bd0 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <string.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
index e74d015335..654f9b0eb8 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/spi/location/locationinfo.h>
@@ -148,7 +150,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) {
os.writeNull(p);
} else {
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E,
0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
@@ -161,7 +163,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67,
0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
0x78, 0x70 };
- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
char* line = p.itoa(lineNumber);
//
// construct Java-like fullInfo (replace "::" with ".")
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
index 203cb5c346..37b57180a2 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
index 1faae3f702..f9730792cf 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/spi/loggingevent.h>
@@ -254,7 +256,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value)
void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
- char classDesc[] = {
+ unsigned char classDesc[] = {
0x72, 0x00, 0x21,
0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63,
0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
@@ -310,7 +312,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
0x3B, 0x78, 0x70 };
os.writeProlog("org.apache.log4j.spi.LoggingEvent",
- 8, classDesc, sizeof(classDesc), p);
+ 8, reinterpret_cast<char *>(classDesc), sizeof(classDesc), p);
}
void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const {
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
index 7cd696b842..29412c1a67 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#if defined(_MSC_VER)
#pragma warning ( disable: 4231 4251 4275 4786 )
@@ -36,8 +38,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
objectHandle(0x7E0000),
classDescriptions(new ClassDescriptionMap())
{
- char start[] = { 0xAC, 0xED, 0x00, 0x05 };
- ByteBuffer buf(start, sizeof(start));
+ unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 };
+ ByteBuffer buf(reinterpret_cast<char *>(start), sizeof(start));
os->write(buf, p);
}
@@ -81,7 +83,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
//
// TC_OBJECT and the classDesc for java.util.Hashtable
//
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
@@ -90,7 +92,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
0x6F, 0x6C, 0x64, 0x78, 0x70 };
- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+ writeProlog("java.util.Hashtable", 1, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
//
// loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
index f2b5de61c7..e5c1b29be9 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/helpers/serversocket.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
index 09f5d8ce31..5ef4b1b794 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#if defined(_MSC_VER)
#pragma warning ( disable: 4231 4251 4275 4786 )
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
index d5166dc8ec..a0e30aa6aa 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <string.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
index fffb43a66a..a40df3be94 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
index 5d82b36b39..8f5fac2341 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_LOGGER_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
index fc98121dce..f07216afe2 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_SPI_LOCATION_LOCATIONINFO_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
index 2c9c353f8b..58deb3694a 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_SPI_LOGGING_EVENT_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
index a500628180..903646048f 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
@@ -190,9 +192,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
#endif
File file;
file.setPath(fname);
@@ -209,9 +211,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
#endif
File file;
file.setPath(fname);
diff --git a/src/3rd_party/dbus-1.7.8/AUTHORS b/src/3rd_party/dbus-1.7.8/AUTHORS
deleted file mode 100644
index ed8afdf132..0000000000
--- a/src/3rd_party/dbus-1.7.8/AUTHORS
+++ /dev/null
@@ -1,122 +0,0 @@
-Alban Crequy <alban.crequy@collabora.co.uk>
-Alexander Larsson <alexl@redhat.com>
-Anders Carlsson <andersca@codefactory.se>
-Andre Heinecke <aheinecke@intevation.de>
-Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-Aurelien Jarno <aurel32@debian.org>
-Benjamin Reed <rangerrick@befunk.com>
-Brian Cameron <brian.cameron@oracle.com>
-Brian Cameron <brian.cameron@sun.com>
-Chris Mayo <aklhfex gmail com>
-Christian Dywan <christian.dywan@lanedo.com>
-Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
-Christian Persch (GNOME) <chpe@gnome.org>
-Colin Walters <walters@verbum.org>
-Colin Watson <cjwatson@ubuntu.com>
-Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
-Cristian Rodríguez <cristian.rodriguez@opensuse.org>
-Cyril Brulebois <kibi@debian.org>
-Daniel P. Berrange <dan@berrange.com>
-Daniel Reed <djr@redhat.com>
-David Zeuthen <davidz@redhat.com>
-Dennis Kaarsemaker <dennis@kaarsemaker.net>
-Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
-Eamon Walsh <ewalsh@tycho.nsa.gov>
-Federico Mena Quintero <federico@novell.com>
-Frank Osterfeld <frank@kdab.net>
-Frederic Crozat <fcrozat@mandriva.com>
-Fridrich Štrba <fridrich.strba@bluewin.ch>
-Grzegorz Dąbrowski <gdx@poczta.fm>
-Harald Fernengel <harry@kdevelop.org>
-Harri Porten <porten@kde.org>
-Hasso Tepper <hasso@estpak.ee>
-Havoc Pennington <hp@pobox.com>
-Havoc Pennington <hp@redhat.com>
-Hendrik Buschmeier <hbuschme@TechFak.Uni-Bielefeld.DE>
-James Carter <jwcart2@tycho.nsa.gov>
-James Westby <jw+debian@jameswestby.net>
-James Willcox <jwillcox@gnome.org>
-Jens Granseuer <jensgr@gmx.net>
-Jérémie Dimino <jeremie@dimino.org>
-Jiří Klimeš <jklimes@redhat.com>
-Joe Marcus Clarke <marcus@freedesktop.org>
-Joe Shaw <joeshaw@novell.com>
-Johan Gyllenspetz <johangy@axis.com>
-Johannes Carlsson <johannes.carlsson.x@sonyericsson.com>
-John (J5) Palmieri <johnp@redhat.com>
-Jon Gosting <yukarionsen@gmail.com>
-Jon Trowbridge <trow@ximian.com>
-Kay Sievers <kay.sievers@vrfy.org>
-Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
-Kjartan Maraas <kmaraas@gnome.org>
-Kristian Høgsberg <krh@redhat.com>
-Kristian Rietveld <kris@gtk.org>
-Kurt Miller <kurt@intricatesoftware.com>
-Lawrence R. Steeger <lsteeger@gmail.com>
-Lennart Poettering <lennart@poettering.net>
-Lennart Poettering <mzqohf@0pointer.de>
-Lionel Landwerlin <lionel.landwerlin@openwide.fr>
-Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
-Marc Brockschmidt <he@debian.org>
-Marc Mutz <marc@kdab.net>
-Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
-Mark Brand <mabrand@mabrand.nl>
-Mark McLoughlin <mark@skynet.ie>
-Matthias Clasen <mclasen@redhat.com>
-Matt McCutchen <matt@mattmccutchen.net>
-Michael Meeks <michael.meeks@novell.com>
-Michael Meeks <michael@ximian.com>
-Mikael Hallendal <micke@codefactory.se>
-Mikael Hallendal <micke@imendio.com>
-Mike McQuaid <mike@mikemcquaid.com>
-Miloslav Trmac <mitr@volny.cz>
-Murray Cumming <murrayc@murrayc.com>
-Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
-Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
-Olivier Andrieu <oliv__a@users.sourceforge.net>
-Oswald Buddenhagen <ossi@kde.org>
-Owen Fraser-Green <owen@discobabe.net>
-Patrick von Reth <patrick.vonreth@gmail.com>
-Pau Garcia i Quiles <pgquiles@elpauer.org>
-Paul Bolle <pebolle@tiscali.nl>
-Peter Breitenlohner <peb@mppmu.mpg.de>
-Peter Kümmel <syntheticpp@gmx.net>
-Peter McCurdy <pmccurdy@skeptopotamus>
-Philip Blundell <philb@gnu.org>
-Plácido Revilla <unknown@unknown.domain>
-Ralf Habacker <ralf.habacker@freenet.de>
-Ray Strode <rstrode@redhat.com>
-Richard A. Hankins <richard.a.hankins@gmail.com>
-Richard Hughes <richard@hughsie.com>
-Richard Hult <rhult@codefactory.se>
-Richard Hult <richard@imendio.com>
-Robert McQueen <robot101@debian.org>
-Roberto Guido <bob4job@gmail.com>
-Romain Pokrzywka <romain@kdab.com>
-Ross Burton <ross@openedhand.com>
-Ryan Lortie <desrt@desrt.ca>
-Sascha Silbe <sascha-pgp@silbe.org>
-Sascha Silbe <sascha-web-bugs.freedesktop.org@silbe.org>
-Scott James Remnant <scott@netsplit.com>
-Scott James Remnant <scott@ubuntu.com>
-Sebastian Sauer <sebsauer@kdab.net>
-Seth Nickell <seth@gnome.org>
-Simon McVittie <simon.mcvittie@collabora.co.uk>
-Sjoerd Simons <sjoerd@luon.net>
-Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
-Steve Grubb <sgrubb@redhat.com>
-Sven Herzberg <sven@imendio.com>
-Thiago Macieira <thiago@kde.org>
-Tim Dijkstra <tim@famdijkstra.org>
-Tobias Mueller <fdo-bugs@cryptobitch.de>
-Tomas Hoger <thoger@redhat.com>
-Tomas Pelka <tpelka@redhat.com>
-Tom Hughes <tom.hughes@palm.com>
-Tor Lillqvist <tml@iki.fi>
-Waldo Bastian <bastian@kde.org>
-William Lachance <wrlach@gmail.com>
-Will Thompson <will.thompson@collabora.co.uk>
-Wulf C. Krueger <philantrop@exherbo.org>
-Xan Lopez <xan@gnome.org>
-Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
-Zack Rusin <zack@kde.org>
diff --git a/src/3rd_party/dbus-1.7.8/COPYING b/src/3rd_party/dbus-1.7.8/COPYING
deleted file mode 100644
index 8260b10099..0000000000
--- a/src/3rd_party/dbus-1.7.8/COPYING
+++ /dev/null
@@ -1,552 +0,0 @@
-D-Bus is licensed to you under your choice of the Academic Free
-License version 2.1, or the GNU General Public License version 2
-(or, at your option any later version).
-
-Both licenses are included here. Some of the standalone binaries are
-under the GPL only; in particular, but not limited to,
-tools/dbus-cleanup-sockets.c and test/decode-gcov.c. Each source code
-file is marked with the proper copyright information - if you find a
-file that isn't marked please bring it to our attention.
-
-The Academic Free License
-v. 2.1
-
-This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
-
-Licensed under the Academic Free License version 2.1
-
-1) Grant of Copyright License. Licensor hereby grants You a
-world-wide, royalty-free, non-exclusive, perpetual, sublicenseable
-license to do the following:
-
-a) to reproduce the Original Work in copies;
-
-b) to prepare derivative works ("Derivative Works") based upon the Original Work;
-
-c) to distribute copies of the Original Work and Derivative Works to the public;
-
-d) to perform the Original Work publicly; and
-
-e) to display the Original Work publicly.
-
-2) Grant of Patent License. Licensor hereby grants You a world-wide,
-royalty-free, non-exclusive, perpetual, sublicenseable license, under
-patent claims owned or controlled by the Licensor that are embodied in
-the Original Work as furnished by the Licensor, to make, use, sell and
-offer for sale the Original Work and Derivative Works.
-
-3) Grant of Source Code License. The term "Source Code" means the
-preferred form of the Original Work for making modifications to it and
-all available documentation describing how to modify the Original
-Work. Licensor hereby agrees to provide a machine-readable copy of the
-Source Code of the Original Work along with each copy of the Original
-Work that Licensor distributes. Licensor reserves the right to satisfy
-this obligation by placing a machine-readable copy of the Source Code
-in an information repository reasonably calculated to permit
-inexpensive and convenient access by You for as long as Licensor
-continues to distribute the Original Work, and by publishing the
-address of that information repository in a notice immediately
-following the copyright notice that applies to the Original Work.
-
-4) Exclusions From License Grant. Neither the names of Licensor, nor
-the names of any contributors to the Original Work, nor any of their
-trademarks or service marks, may be used to endorse or promote
-products derived from this Original Work without express prior written
-permission of the Licensor. Nothing in this License shall be deemed to
-grant any rights to trademarks, copyrights, patents, trade secrets or
-any other intellectual property of Licensor except as expressly stated
-herein. No patent license is granted to make, use, sell or offer to
-sell embodiments of any patent claims other than the licensed claims
-defined in Section 2. No right is granted to the trademarks of
-Licensor even if such marks are included in the Original Work. Nothing
-in this License shall be interpreted to prohibit Licensor from
-licensing under different terms from this License any Original Work
-that Licensor otherwise would have a right to license.
-
-5) This section intentionally omitted.
-
-6) Attribution Rights. You must retain, in the Source Code of any
-Derivative Works that You create, all copyright, patent or trademark
-notices from the Source Code of the Original Work, as well as any
-notices of licensing and any descriptive text identified therein as an
-"Attribution Notice." You must cause the Source Code for any
-Derivative Works that You create to carry a prominent Attribution
-Notice reasonably calculated to inform recipients that You have
-modified the Original Work.
-
-7) Warranty of Provenance and Disclaimer of Warranty. Licensor
-warrants that the copyright in and to the Original Work and the patent
-rights granted herein by Licensor are owned by the Licensor or are
-sublicensed to You under the terms of this License with the permission
-of the contributor(s) of those copyrights and patent rights. Except as
-expressly stated in the immediately proceeding sentence, the Original
-Work is provided under this License on an "AS IS" BASIS and WITHOUT
-WARRANTY, either express or implied, including, without limitation,
-the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
-WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
-part of this License. No license to Original Work is granted hereunder
-except under this disclaimer.
-
-8) Limitation of Liability. Under no circumstances and under no legal
-theory, whether in tort (including negligence), contract, or
-otherwise, shall the Licensor be liable to any person for any direct,
-indirect, special, incidental, or consequential damages of any
-character arising as a result of this License or the use of the
-Original Work including, without limitation, damages for loss of
-goodwill, work stoppage, computer failure or malfunction, or any and
-all other commercial damages or losses. This limitation of liability
-shall not apply to liability for death or personal injury resulting
-from Licensor's negligence to the extent applicable law prohibits such
-limitation. Some jurisdictions do not allow the exclusion or
-limitation of incidental or consequential damages, so this exclusion
-and limitation may not apply to You.
-
-9) Acceptance and Termination. If You distribute copies of the
-Original Work or a Derivative Work, You must make a reasonable effort
-under the circumstances to obtain the express assent of recipients to
-the terms of this License. Nothing else but this License (or another
-written agreement between Licensor and You) grants You permission to
-create Derivative Works based upon the Original Work or to exercise
-any of the rights granted in Section 1 herein, and any attempt to do
-so except under the terms of this License (or another written
-agreement between Licensor and You) is expressly prohibited by
-U.S. copyright law, the equivalent laws of other countries, and by
-international treaty. Therefore, by exercising any of the rights
-granted to You in Section 1 herein, You indicate Your acceptance of
-this License and all of its terms and conditions.
-
-10) Termination for Patent Action. This License shall terminate
-automatically and You may no longer exercise any of the rights granted
-to You by this License as of the date You commence an action,
-including a cross-claim or counterclaim, against Licensor or any
-licensee alleging that the Original Work infringes a patent. This
-termination provision shall not apply for an action alleging patent
-infringement by combinations of the Original Work with other software
-or hardware.
-
-11) Jurisdiction, Venue and Governing Law. Any action or suit relating
-to this License may be brought only in the courts of a jurisdiction
-wherein the Licensor resides or in which Licensor conducts its primary
-business, and under the laws of that jurisdiction excluding its
-conflict-of-law provisions. The application of the United Nations
-Convention on Contracts for the International Sale of Goods is
-expressly excluded. Any use of the Original Work outside the scope of
-this License or after its termination shall be subject to the
-requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101
-et seq., the equivalent laws of other countries, and international
-treaty. This section shall survive the termination of this License.
-
-12) Attorneys Fees. In any action to enforce the terms of this License
-or seeking damages relating thereto, the prevailing party shall be
-entitled to recover its costs and expenses, including, without
-limitation, reasonable attorneys' fees and costs incurred in
-connection with such action, including any appeal of such action. This
-section shall survive the termination of this License.
-
-13) Miscellaneous. This License represents the complete agreement
-concerning the subject matter hereof. If any provision of this License
-is held to be unenforceable, such provision shall be reformed only to
-the extent necessary to make it enforceable.
-
-14) Definition of "You" in This License. "You" throughout this
-License, whether in upper or lower case, means an individual or a
-legal entity exercising rights under, and complying with all of the
-terms of, this License. For legal entities, "You" includes any entity
-that controls, is controlled by, or is under common control with
-you. For purposes of this definition, "control" means (i) the power,
-direct or indirect, to cause the direction or management of such
-entity, whether by contract or otherwise, or (ii) ownership of fifty
-percent (50%) or more of the outstanding shares, or (iii) beneficial
-ownership of such entity.
-
-15) Right to Use. You may use the Original Work in all ways not
-otherwise restricted or conditioned by this License or by law, and
-Licensor promises not to interfere with or be responsible for such
-uses by You.
-
-This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights
-reserved. Permission is hereby granted to copy and distribute this
-license without modification. This license may not be modified without
-the express written permission of its copyright owner.
-
-
---
-END OF ACADEMIC FREE LICENSE. The following is intended to describe the essential
-differences between the Academic Free License (AFL) version 1.0 and other
-open source licenses:
-
-The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache
-licenses in many respects but it is intended to solve a few problems with
-those licenses.
-
-* The AFL is written so as to make it clear what software is being
-licensed (by the inclusion of a statement following the copyright notice
-in the software). This way, the license functions better than a template
-license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
-
-* The AFL contains a complete copyright grant to the software. The BSD
-and Apache licenses are vague and incomplete in that respect.
-
-* The AFL contains a complete patent grant to the software. The BSD, MIT,
-UoI/NCSA and Apache licenses rely on an implied patent license and contain
-no explicit patent grant.
-
-* The AFL makes it clear that no trademark rights are granted to the
-licensor's trademarks. The Apache license contains such a provision, but the
-BSD, MIT and UoI/NCSA licenses do not.
-
-* The AFL includes the warranty by the licensor that it either owns the
-copyright or that it is distributing the software under a license. None of
-the other licenses contain that warranty. All other warranties are disclaimed,
-as is the case for the other licenses.
-
-* The AFL is itself copyrighted (with the right granted to copy and distribute
-without modification). This ensures that the owner of the copyright to the
-license will control changes. The Apache license contains a copyright notice,
-but the BSD, MIT and UoI/NCSA licenses do not.
---
-START OF GNU GENERAL PUBLIC LICENSE
---
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/src/3rd_party/dbus-1.7.8/ChangeLog b/src/3rd_party/dbus-1.7.8/ChangeLog
deleted file mode 100644
index 0bc33d458e..0000000000
--- a/src/3rd_party/dbus-1.7.8/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2008-04-16 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-monitor.c: take out the trailing comma in the
- ProfileAttributeFlags enum as it isn't in our style guides
- and causes some compilers to error out
diff --git a/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-0 b/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-0
deleted file mode 100644
index eab5982fba..0000000000
--- a/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-0
+++ /dev/null
@@ -1,15146 +0,0 @@
-2006-11-09 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.0.0
-
-2006-11-09 John (J5) Palmieri <johnp@redhat.com>
-
- * AUTHORS: added Peter and Tor of windows porting fame
-
-2006-11-08 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: add a note about protocol stability
-
- * doc/TODO: Remove "important for 1.0" section, replace with
- "important for 1.2" section
-
-2006-11-08 John (J5) Palmieri <johnp@redhat.com>
-
- * README: remove some of the out of date flags
-
- * doc/TODO: Remove todo items which are done
-
-2006-11-08 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-monitor.c: Handle sigint so we flush stdout
- (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
-
-2006-11-08 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-monitor.1: update the manpage for dbus-monitor
- (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
-
-2006-11-08 John (J5) Palmieri <johnp@redhat.com>
-
- * AUTHORS: Update with all people listed in the ChangeLog
-
-2006-11-08 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-monitor.c: add profiling tools to dbus-monitor
- (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
-
-2006-11-07 Havoc Pennington <hp@redhat.com>
-
- * HACKING: Update release instructions to include stuff about
- stable releases, branching, etc. May not be totally correct,
- please fix if needed, but keep instructions up-to-date so we do
- each stable release consistently in the future.
-
-2006-11-07 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml, doc/dbus-faq.xml, README: various
- documentation updates. Bump faq/spec versions (not to 1.0; I don't
- think the spec will be "finished"/1.0 when we ship the 1.0 library).
-
-2006-11-06 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/bus.c: Missed patch - pass in the context to the directory watch
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * Released D-Bus 1.0 RC 3(0.95)
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/activation.c (bus_activation_new): don't fail if we can not read
- the directory as it may not exist
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/config-parser.c (service_dirs_find_dir): use
- _dbus_list_get_next_link so we don't get stuck in an infinite loop
- (start_busconfig_child): move processing of standard_session_servicedirs
- tags here because they have no content
- (bus_config_parser_content): check we don't have content in
- standard_session_servicedirs tag
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/Makefile.am: Make sure the /var/lib/dbus directory is created
- Packagers need to own this directory
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/run-with-tmp-session-bus.sh: fixed script to replace the
- <standard_session_servicedirs> tag with a <sevicedir> tag that
- points to the test service directory
-
-2006-11-02 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Add a check for DIR *dirp->dd_fd
-
- * dbus/dbus-sysdeps-util-unix: if HAVE_DDFD is defined use
- DIR *dirp->dd_fd else use DIR *dirp->__dd_fd. This takes care
- of both Solaris and Irix
-
-2006-11-01 Havoc Pennington <hp@redhat.com>
-
- * bus/dbus-daemon.1.in: document standard_session_servicedirs
-
-2006-11-01 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: expose DBUS_DATADIR
-
- * bus/config-parser.c: add the standard_session_servicedirs element
- to the parser
- (bus_config_parser_content): process the standard_session_servicedirs
- element by getting the standard directories from sysdeps and merging
- them into the service directory list
- (test_default_session_servicedirs): make sure we get what we expect
-
- * bus/session.conf.in: replace the servicedir tag with the
- standard_session_servicedirs tag
-
- * dbus/dbus-list.h: remove the typedef of DBusList and place it in
- dbus-sysdeps.h to avoid circular header dependencies
-
- * dbus/dbus-sysdeps.h: add the typedef of DBusList
-
- * dbus/dbus-sysdeps-unix.c (split_paths_and_append): utility function
- which takes a string of directories delimited by colons, parses them
- out, appends a suffix and puts them in a list ignoring empty elements
- (_dbus_get_standard_session_servicedirs): returns the standard
- directories for a session bus to look for service activation files
- on Unix which includes the XDG_DATA_HOME, XDG_DATA_DIRS and
- DBUS_DATADIR directories
-
- * test/data/valid-config-files/many-rules.conf: add the
- standard_session_servicedirs tag to the valid config file tests
-
-2006-10-30 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-launch.1, doc/TODO: capture intent to change the
- command line options of dbus-launch a bit post 1.0
-
-2006-10-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_open_private): document
- how to choose shared vs. private connections
-
-2006-10-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-test.c: enclose more of the file in the
- DBUS_BUILD_TESTS check.
-
- * dbus/dbus-sysdeps-pthread.c (PTHREAD_CHECK): fix for
- DBUS_DISABLE_ASSERT case.
-
- * dbus/dbus-connection.c (dbus_connection_get_unix_user): document
- that it only works on the server side
-
- * dbus/dbus-bus.c: add a global lock covering the BusData we
- attach to each connection
- (internal_bus_get): lock our access to the BusData
- (dbus_bus_register): lock the entire registration process
- with _DBUS_LOCK(bus_datas). If we get the lock and
- registration is already complete, silently return (vs. previous
- behavior of aborting).
- (dbus_bus_set_unique_name): lock the BusData
- (dbus_bus_get_unique_name): lock the BusData
-
-2006-10-27 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/config-parser.c (service_dirs_find_dir,
- service_dirs_append_unique_or_free,
- service_dirs_append_link_unique_or_free): New static methods
- for only appending unique service directory names into
- the service directory list
- (merge_included, bus_config_parser_content): Only add unique
- service directory names into the list
-
-2006-10-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-pthread.c: make the "count" and "holder"
- variables volatile, suggested by Thiago. Document struct fields.
- (PTHREAD_CHECK): remove pthread error checking if assertions are
- disabled, should reduce the no-assertions case to the bare
- minimum code.
-
-2006-10-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-pthread.c (_dbus_pthread_mutex_lock): change
- to be recursive
- (_dbus_pthread_mutex_unlock): make it recursive
- (_dbus_pthread_condvar_wait): save/restore the recursion count
- (_dbus_pthread_condvar_wait_timeout): save/restore the recursion count
-
-2006-10-26 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: clarify the UUID text slightly
-
- * dbus/dbus-sysdeps-pthread.c: check for and mostly abort on
- pthread errors. Add DBusMutexPThread and DBusCondVarPThread
- in preparation for being able to extend them for e.g. recursive
- mutexes.
-
-2006-10-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-threads.[hc]: Documentation improvements. Clarify how
- condition variables relate to recursive mutexes.
-
- * dbus/dbus-sysdeps-pthread.c, dbus/dbus-sysdeps-win-thread.c,
- dbus/dbus-threads.c: Split the platforms-specific thread
- implementations into their own files.
-
- * dbus/dbus-sysdeps-pthread.c
- (_dbus_pthread_condvar_wait_timeout): invert the return value, it
- was backward. Not that anything uses it.
-
-2006-10-26 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up the
- LOCAL_CREDS vs CMSGCRED stuff a bit. Prefer CMSGCRED. This
- needs to be cleaned up more.
-
- * doc/TODO: Add a todo that *BSD hackers should look at cleaning
- up the CREDS issue.
-
-2006-10-26 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in, dbus-1.pc.in: Check to see if thread methods
- are in glibc or libpthread and add -lpthread to the link stage
- if it is the latter
-
-2006-10-26 Thiago Macieira <thiago@kde.org>
-
- * dbus/dbus-connection.c (_dbus_connection_open_internal): Fix
- bug 8780: the connection lock is only required while recording
- the shared connection, so protect only that code
- section. Don't require connection_lookup_shared to return a
- locked connection.
-
-2006-10-26 Thiago Macieira <thiago@kde.org>
-
- * tools/dbus-launch-x11.c (get_session_file, init_x_atoms):
- check if get_machine_uuid() returns NULL before proceeding any
- further: we can't init the X atoms or create a session file
- name if there is no machine ID.
- This solves a crash reported by some users if
- --exit-with-session was used without --autolaunch=<machine-id>
-
-2006-10-26 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-launch.c (main): run the dbus-daemon in the builddir
- if tests are enabled and the DBUS_USE_TEST_BINARY env variable is set
-
- * tools/run-with-tmp-session-bus.sh: set DBUS_USE_TEST_BINARY
- before we run dbus-launch
-
- * configure.in: define TEST_BUS_BINARY to be the full path to
- dbus-daemon in the build root
-
-2006-10-25 Sjoerd Simons <sjoerd@luon.net>
-
- * dbus/Makefile.am:
- * tools/Makefile.am:
- * toos/dbus-uuidgen.1:
- Move the machine-id file to /var/lib/dbus
-
-2006-10-24 David Zeuthen <davidz@redhat.com>
-
- * dbus/dbus-threads.c (init_uninitialized_locks): Fix typo so it's
- _dbus_assert (thread_init_generation != _dbus_current_generation)
- not _dbus_assert (thread_init_generation == _dbus_current_generation)
-
-2006-10-24 Thiago Macieira <thiago@kde.org>
-
- * dbus/dbus-sysdeps.h:
- * dbus/dbus-sysdeps-unix.c: Add function
- _dbus_make_file_world_readable that chmods a file to 0644.
-
- * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address):
- Avoid writing to the static "argv" array, thereby avoiding a
- COW on the child process.
-
- * dbus/dbus-internals.c (_dbus_create_uuid_file_exclusively):
- call _dbus_make_file_world_readable on the created file.
-
-2006-10-23 David Zeuthen <davidz@redhat.com>
-
- * dbus/dbus-memory.c: Use atomic variable to protect
- n_blocks_outstanding otherwise OOM will be reported using SMP on
- some arches
-
- * bus/dispatch.c: Add missing end of line characters
-
- * bus/desktop-file.c (parse_section_start, parse_key_value)
- (bus_desktop_file_load): Propertly handle OOM
-
- * dbus/dbus-threads.c (init_uninitialized_locks): Check that
- thread_init_generation equals _dbus_current_generation, not 0
-
-2006-10-22 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection-internal.h: move prototype of
- _dbus_bus_notify_shared_connection_disconnected_unlocked() here so
- it isn't in a public header and doesn't end up in the DBusBus
- group in Doxygen
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * Makefile.am (EXTRA_DIST): dist cleanup-man-pages.sh so it's in
- the tarball if packagers want to run it
-
- * cleanup-man-pages.sh: Add a script which munges all the internal
- API man pages out of the Doxygen output. This reduces the size of
- the installed man pages from 7 to 2 megs, and avoids
- namespace-polluting pages. Right now (like Doxygen) this script
- isn't in the build, it's something packagers can do manually.
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.h: don't include the watch/timeout
- functions in connection section
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * Documentation! Whee! Doxygen now 100% silent. If you make it
- angry again, you will be punished.
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * More documentation - all public API now documented according to
- Doxygen
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * Document a bunch of undocumented stuff
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * Clean up Doxygen group markers for public API so Doxygen finds
- everything (not comprehensively fixed for private API).
- Means all remaining Doxygen warnings are just about missing docs
- and thus pretty simple to resolve.
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-macros.h: add DBUS_GNUC_DEPRECATED macro
-
- * dbus/dbus-message.h: mark dbus_message_iter_get_array_len()
- as DBUS_GNUC_DEPRECATED
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * Move all private API into the private Doxygen group sections of
- the files, so they don't show up in the public API docs
-
-2006-10-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.h: put #ifndef DBUS_DISABLE_DEPRECATED around
- dbus_message_iter_get_array_len().
-
- * throughout: documentation improvements.
-
-2006-10-20 Havoc Pennington <hp@redhat.com>
-
- * doc/TODO: remove the int64 thing from 1.0 since it doesn't
- matter, and the message-loader-breaker thing since nobody is going
- to do it. Add an item to 1.0 about supporting recursive locks
- in dbus_threads_init_default() though, since it should be easy.
-
- * dbus/dbus-connection.c (_dbus_connection_read_write_dispatch):
- Fix this in the !dispatch case to avoid busy-looping after
- disconnection
-
- * More misc docs improvements
-
-2006-10-19 Havoc Pennington <hp@redhat.com>
-
- * more Doxygen-related fixes (lots of moving things from the
- public to internal section in dbus-connection.c)
-
-2006-10-19 Havoc Pennington <hp@redhat.com>
-
- * Fix a pile of Doxygen warnings and missing docs
-
-2006-10-19 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/dir-watch-default.c, bus/dir-watch-dnotify.c,
- bus/dir-watch-kqueue.c (bus_watch_directory): Pass in a BusContext
- instead of a void *. kqueue uses this to get the context's loop
- while the other modules ignore the parameter. This allows us to
- avoid platform conditionals
-
- * bus/bus.c (process_config_postinit): Pass in the context to the
- watch
-
-2006-10-19 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/messagebus.in, bus/rc.messagebus.in: run dbus-uuidgen --ensure
- when starting the system bus
-
-2006-10-18 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: More fixups for cross compile (Patch from
- Marco Pracucci <development at pracucci dot com>)
-
-2006-10-17 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-send.c (main): don't close shared connection, fix
- from Timo Hoenig
-
-2006-10-17 Havoc Pennington <hp@redhat.com>
-
- * configure.in (CPPFLAGS): don't do -DDBUS_API_SUBJECT_TO_CHANGE here
-
- * dbus/dbus.h: drop the DBUS_API_SUBJECT_TO_CHANGE requirement,
- since realistically it doesn't look like we'll be changing it
- anymore.
-
-2006-10-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.c (_dbus_warn_check_failed): new function to
- be used for return_if_fail type warnings; prefixes the pid, and
- fatal by default.
-
-2006-10-14 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Released 1.0 RC 2(0.94)
- Add check for -fPIC and enable it if available
-
-2006-10-14 John (J5) Palmieri <johnp@redhat.com>
-
- * doc/TODO: Remove the check TODO item
-
-2006-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-transport-socket.c (exchange_credentials):
- Print out more detailed errors if reading or sending
- credentials fail (Patch from Julio M. Merino Vidal
- <jmmv at NetBSD dot org>)
-
-2006-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: when checking for posix getpwnam_r assume true
- for cross compiles
-
-2006-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Check for gethostbyname first before we check for it
- in libnsl. On gnu systems it is implemeneted
-
-2006-10-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c
- (dbus_connection_send_with_reply_and_block): fix to handle closed
- connections, from Tambet Ingo bug #8631
-
-2006-10-11 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: use AC_TRY_COMPILE for dirfd instead of AC_TRY_RUN
-
-2006-10-11 John (J5) Palmieri <johnp@redhat.com>
-
- * test/name-test/Makefile.am: don't link against both libdbus and
- libdbus-convenience
-
-2006-10-11 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: check for dirfd even if it is a macro
- (Patch from Timothy Redaelli <drizzt at gufi dot org>)
-
-2006-10-08 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: define _POSIX_PTHREAD_SEMANTICS on solaris
- avoid using dirfd on systems that don't have dirfd
- (Patch by Brian Cameron <brian dot cameron at sun dot com>)
-
-2006-10-02 John (J5) Palmieir <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_abort): Remove from
- #ifndef DBUS_DISABLE_ASSERTS macro to fix distcheck
-
- * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): Remove from
- #if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_BUILD_TESTS)
- macro because _dbus_abort calls it
-
- * tools/Makefile.am: Add dbus-launch.h to the source list so distcheck
- works
-
-2006-10-02 John (J5) Palmieir <johnp@redhat.com>
-
- * dbus/dbus-sysdeps-util-unix.c (dirent_buf_size): Add check for
- MAXNAMELEN for Mac OSX. (Patch from Jonas B <sanoix at gmail dot com>)
-
-2006-10-02 Thiago Macieira <thiago@kde.org>
-
- * tools/dbus-launch.c (main): make it complain and abort
- execution in case an unknown option is given. Also, process
- the '--' argument as the end of arguments.
-
-2006-10-01 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-launch.c (print_variables): if no syntax is given,
- don't print something that's sort-of-half-sh-syntax, just print
- a plain key-value pairs thing.
-
- * tools/dbus-launch-x11.c: use machine ID rather than hostname for
- the local machine representation (but still have the hostname in
- the display). Remove the hostname from the display if it is
- localhost. Change session files to be named
- ~/.dbus/session-bus/machine-display. Change X atoms to be
- underscore-prefixed so nobody whines about ICCCM compliance.
- Otherwise name them the same as the env variables.
- Change session file format to include key-value pairs and an
- explanatory comment. Keys are the same as the env variables.
- (set_address_in_x11): X property format can't depend on
- sizeof(pid_t) on a particular machine, fix to always be 32 bits
-
- * tools/dbus-launch.c: make --autolaunch take a machine id
- argument. If --autolaunch is used with a program to run, complain
- for now (but add a FIXME). Also, don't look for existing bus if
- there's a program to run (but add a FIXME).
-
- * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): pass
- machine uuid to dbus-launch (avoids linking dbus-launch to libdbus
- just to get this, and avoids duplicating uuid-reading code).
-
- * tools/dbus-launch.1: clarify various things
-
-2006-10-01 Havoc Pennington <hp@redhat.com>
-
- * test/test-service.c (path_message_func): remove broken extra
- unref that was hidden by the bugs in dbus-connection.c/dbus-bus.c
-
- * test/test-shell-service.c (path_message_func): same fix
-
- * dbus/dbus-connection.c
- (_dbus_connection_get_dispatch_status_unlocked): break up the
- function a little for clarity and fix the notification of
- dbus-bus.c to not require dispatch to be complete
-
- * dbus/dbus-connection.c (dbus_connection_unref): improve the
- warning when you try to finalize an open connection.
-
-2006-10-01 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-bus.c
- (internal_bus_get): only weak ref the connection; this means
- _dbus_bus_notify_shared_connection_disconnected_unlocked can be
- called safely in any context
- (_dbus_bus_notify_shared_connection_disconnected_unlocked): don't
- unref
-
- * dbus/dbus-connection.c
- (_dbus_connection_get_dispatch_status_unlocked): move
- _dbus_bus_notify_shared_connection_disconnected_unlocked here
- when queuing Disconnected instead of when the Disconnected message
- arrives, so dbus_bus_get() won't return closed connections.
-
-2006-10-01 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref):
- Add a hack to make DBusNewConnectionFunction work right.
-
- * dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use
- the hack here. Also, fix the todo about refcount leak.
-
- * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
- and use the hack here
-
- * dbus/dbus-connection.c: Kill the "shared" flag vs. the
- "shareable" flag; this was completely broken, since it meant
- dbus_connection_open() returned a connection of unknown
- shared-ness. Now, we always hold a ref on anything opened
- as shareable.
-
- Move the call to notify dbus-bus.c into
- connection_forget_shared_unlocked, so libdbus consistently forgets
- all its knowledge of a connection at once. This exposed numerous
- places where things were totally broken if we dropped a ref inside
- get_dispatch_status_unlocked where
- connection_forget_shared_unlocked was previously, so move
- connection_forget_shared_unlocked into
- _dbus_connection_update_dispatch_status_and_unlock. Also move the
- exit_on_disconnect here.
-
- (shared_connections_shutdown): this assumed weak refs to the
- shared connections; since we have strong refs now, the assertion
- was failing and stuff was left in the hash. Fix it to close
- still-open shared connections.
-
- * bus/dispatch.c: fixup to use dbus_connection_open_private on the
- debug pipe connections
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): only notify
- dbus-bus.c if the closed connection is in fact shared
- (_dbus_connection_close_possibly_shared): rename from
- _dbus_connection_close_internal
- (dbus_connection_close, dbus_connection_open,
- dbus_connection_open_private): Improve docs to explain the deal
- with when you should close or unref or both
-
- * dbus/dbus-bus.c
- (_dbus_bus_notify_shared_connection_disconnected_unlocked): rename
- from _dbus_bus_check_connection_and_unref_unlocked and modify to
- loop over all connections
-
- * test/test-utils.c (test_connection_shutdown): don't try to close
- shared connections.
-
- * test/name-test/test-threads-init.c (main): fix warnings in here
-
- * dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT
- env variable to cause blocking waiting for gdb; drop
- DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace()
- unconditionally.
-
- * configure.in: add -export-dynamic to libtool flags if assertions enabled
- so _dbus_print_backtrace works.
-
- * dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf
- instead of _dbus_verbose to print the backtrace, and diagnose lack
- of -rdynamic/-export-dynamic
-
-2006-09-30 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-bus.c (dbus_bus_get_private, dbus_bus_get)
- (internal_bus_get): fix screwy code formatting. whoever committed
- that was not paying attention!
-
-2006-09-30 Havoc Pennington <hp@redhat.com>
-
- * configure.in (LT_CURRENT, LT_AGE): increment current and age to
- reflect addition of interfaces.
-
- * doc/dbus-specification.xml: describe a new
- org.freedesktop.DBus.Peer.GetMachineId method
-
- * dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function
- (_dbus_string_skip_white, _dbus_string_skip_blank): use new
- DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion
- at end of skip_white
- (_dbus_string_chop_white): new function
-
- * bus/connection.c (bus_connections_setup_connection): call
- dbus_connection_set_route_peer_messages.
-
- * dbus/dbus-connection.c
- (_dbus_connection_peer_filter_unlocked_no_update): modify to
- support a GetMachineId method.
-
- Also, support a new flag to let the bus pass peer methods through
- to apps on the bus, which can be set with
- dbus_connection_set_route_peer_messages.
-
- Finally, handle and return an error for anything unknown on the
- Peer interface, which will allow us to extend the Peer interface
- in the future without fear that we're now intercepting something
- apps were wanting to see.
-
- * tools/dbus-uuidgen.c: a thin wrapper around the functions in
- dbus/dbus-uuidgen.c
-
- * dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen
- binary here, since most of the code is already in libdbus
-
- * dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the
- uuid from the system config file
-
- * dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode)
- (_dbus_read_uuid_file_without_creating)
- (_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new
- uuid-related functions, partly factored out from dbus-server.c
-
- * dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to
- DBUS_ERROR_FILE_EXISTS instead of EEXIST
-
- * dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error
-
- * tools/dbus-cleanup-sockets.1: explain what the point of this
- thing is a bit more
-
- * autogen.sh (run_configure): add --config-cache to default
- configure args
-
- * dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the
- error set/clear assertions when DBUS_DISABLE_CHECKS is defined
-
- * tools/dbus-launch.c (main): if xdisplay hasn't been opened,
- don't try to save address, fixes crash in make check
-
-2006-09-30 Thiago Macieira <thiago@kde.org>
-
- * configure.in: add DBUS_BINDIR as a #define to C source code.
-
- * tools/dbus-launch.c
- * tools/dbus-launch.h
- * tools/dbus-launch-x11.c:
- * tools/dbus-launch.1: Add the --autolaunch option to
- dbus-launch, which makes it scan for an existing session
- started with --autolaunch. With that option, it also creates
- an X11 window and saves the bus address and PID to it.
-
- * dbus/dbus-sysdeps.h:
- * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Add
- a function that runs "dbus-launch --autolaunch" to retrieve
- the running D-Bus session address (or start one if none was running)
-
- * dbus/dbus-transport.c: Add the handler for the "autolaunch:"
- address protocol, which tries to get the running session from
- dbus-launch.
-
- * dbus/dbus-bus.c:
- * dbus/dbus-internals.h: Make "autolaunch:" be the default
- D-Bus session bus address.
-
- * dbus/dbus-connection.c: Fix horrible typo in error message.
-
-2006-09-18 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/Makefile.am: use @EXPANDED_DATADIR@ instead of @DATADIRNAME@
-
-2006-09-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
- fix so that if unix_user_function is set on windows, we still
- do the default check that the auth identity matches the bus identity
-
-2006-09-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport.c (_dbus_transport_open): modify to delegate
- to _dbus_transport_open_platform_specific,
- _dbus_transport_open_socket,
- and _dbus_transport_open_debug_pipe
-
- * dbus/dbus-transport-protected.h: add _dbus_transport_open_platform_specific
-
-2006-09-16 Havoc Pennington <hp@redhat.com>
-
- Attempt auditing public API to remove all cases where a Unix
- function returns weird emulated goo to Windows. This probably
- breaks the bus daemon on Windows, to fix it again we may
- need to stop processing unix-specific config options on Windows,
- and may need to add Windows-specific public API or config options.
-
- * configure.in (LT_CURRENT, LT_AGE): increment current and age,
- to reflect added interfaces; should not break soname.
-
- * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated): do
- not invoke unix user function on Windows. Kind of a hacky fix, but
- we don't want a "unix uid" leaking out on Windows.
-
- * dbus/dbus-connection.c (dbus_connection_get_socket): add new API
- to get the socket fd on Windows or UNIX
- (dbus_connection_get_unix_fd): make this always fail on Windows
-
-2006-09-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-server.c (dbus_server_listen): change how this works
- to be able to delegate to a set of handlers that can succeed,
- fail, or choose not to handle. Allows us to have
- dbus_server_listen_platform_specific.
-
- * dbus/dbus-server-socket.c (_dbus_server_new_for_tcp_socket):
- factor out the tcp socket stuff to be used on windows, leaving
- unix domain socket only in dbus-socket-unix.c
-
- * dbus/dbus-transport-socket.c
- (_dbus_transport_new_for_tcp_socket): factor out the tcp socket
- stuff to be used on windows, leaving unix domain socket only
- in dbus-transport-unix.c
-
- * dbus/dbus-connection.c (dbus_connection_get_unix_user): insert
- temporary hack to be sure this fails on windows
- (dbus_connection_get_unix_process_id): ditto
-
-2006-09-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c (_dbus_open_tcp_socket)
- (_dbus_open_unix_socket, _dbus_open_socket): change API for
- _dbus_open_socket so the domain/type/protocol from system headers
- are not required. This is kind of pointless though unless we move
- part of _dbus_connect_tcp_socket into sysdeps.c instead of
- sysdeps-unix.c, which would mean adding a wrapper around
- bind/listen/etc.
- Also, add DBusError to the socket-opening functions so they
- don't require use of errno.
-
-2006-09-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.h: small change to Peter's patch to make
- dbus-sysdeps-unix-util.c build, add unix-specific sysdeps header.
-
- * dbus/dbus-sysdeps.h, dbus-sysdeps-unix.c: patch from Peter
- Kümmel bug #8249 to make the sysdeps.h read/write/open/close
- functions specifically for sockets only, and move generic
- read/write/open/close into unix-specific code.
-
-2006-09-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration): fix a valgrind
- complaint about accessing revents when poll returns 0, from Julian Seward.
-
-2006-09-14 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.0 RC 1 (0.93)
-
-2006-09-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps-util-unix.c (_dbus_write_pid_file):
- use _dbus_close instead of close
-
-2006-09-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.c: Add support for LOCAL_CREDS socket
- credentials. Fixes "external" authentication under e.g. NetBSD
- which does not support any other socket credentials mechanism.
- (Patch from Julio M. Merino Vidal <jmmv at NetBSD dot org>)
-
-2006-09-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-threads.c: Allow recursive mutex's to be passed into
- dbus_threads_init and be used by the dbus mutex functions to
- avoid deadlocks.
-
- * doc/TODO: Remove recursive mutex dbus_connection_dispatch TODO item
-
-2006-09-13 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps-util-unix.c (_dbus_directory_get_next_file):
- use threadsafe readdir_r instead of readdir
-
-2006-09-13 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-threads.c (dbus_threads_init_default): New method for
- initializing the internal thread implementation (Patch from
- Alexander Larsson <alexl at redhat dot com>)
-
-2006-09-11 John (J5) Palmieri <johnp@redhat.com>
-
- * remove a bunch of todo items from the 1.0 list
-
-2006-09-11 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/activation.c, bus/desktop-file.c: Distinguish between OOM and
- key not found
-
-2006-09-11 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-internal.c: Add dbus_is_verbose so we can have more
- complex debugging code
-
- * dbus/dbus-marshal-basic.c (_dbus_marshal_read_fixed_multi): Move
- between the test suite ifdefs
- (_dbus_verbose_bytes): return if verbosity is not enabled
-
-2006-09-11 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-marshal-recursive-util.c, dbus/dbus-marshal-recursive.c:
- remove DBusMark
-
-2006-09-10 Havoc Pennington <hp@redhat.com>
-
- patch mostly by Peter Kümmel, bug #8211
-
- * dbus/dbus-sysdeps-unix.c: new file, which splits out
- unix-specific stuff in dbus-sysdeps.c
-
- * dbus/dbus-sysdeps.c: don't include any UNIX-only headers,
- and move unix-specific stuff to dbus-sysdeps-unix.c
-
- * configure.in: check HAVE_ERRNO_H
-
-2006-09-08 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/test-main.c (main): Initialize threading during tests
-
- * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
- Unlock connection on error
- (generate_local_error_message): static method for generating
- an error message when we don't have a message to reply to
- (_dbus_connection_block_pending_call): Send a disconnect error
- instead of just a timeout (NULL) when the bus gets disconnected
- while blocking for a reply.
-
-2006-09-08 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): Properly remove
- filters (Patch from Kimmo Hämäläinen
- <kimmo dot hamalainen at nokia dot com>)
-
-2006-09-07 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection-internal.h: Add prototype for
- _dbus_connection_test_get_locks to remove warning
-
-2006-09-07 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): Make sure we
- close child_err_report_pipe[WRITE_END] on exec (Patch from
- Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>)
-
-2006-09-07 John (J5) Palmieri <johnp@redhat.com>
-
- * Clean up close calls to use _dbus_close (Patch from
- Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>)
-
-2006-09-06 John (J5) Palmieri <johnp@redhat.com>
-
- * doc/TODO:
- - Remove pending call locking todo item
- - dbus_connection_open now holds hard ref. Remove todo item
- - do proper locking on _dbus_bus_check_connection_and_unref
- and handle DBUS_BUS_STARTER. Remove todo item
- - Warn on closing of a shared connection. Remove todo item
-
- * bus/bus.c, bus/connection.c, bus/dispatch.c, dbus/dbus-bus.c,
- dbus/dbus-connection.c: Use the dbus_connection_close_internal
- so we don't get the warning when closing shared connections
-
- * test/test-service.c, test/test-shell-service.c: Applications
- don't close shared connections themselves so we unref instead of
- close
-
- * test/test-utils.c (test_connection_shutdown): Close the connection
-
- * dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): Changed to
- _dbus_bus_check_connection_and_unref_unlocked since we only call this
- method on a locked connection.
- Make sure we call _dbus_connection_unref_unlocked instead of
- dbus_connection_unref also.
- Handle DBUS_BUS_STARTER correctly
-
- * dbus/dbus-connection.c (connection_record_shared_unlocked):
- Mark as shared and hard ref the connection
- (connection_forget_shared_unlocked): Remove the hard ref from the
- connection
- (_dbus_connection_close_internal_and_unlock): New internal function
- which takes a locked connection and unlocks it after closing it
- (_dbus_connection_close_internal): New internal function which acts
- like the origonal dbus_connection_close method by grabbing a connection
- lock and calling _dbus_connection_close_internal_and_unlock
- (dbus_connection_close): Public close method, warns when the app
- trys to close a shared connection
-
-2006-09-06 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/driver.c:
- (bus_driver_generate_introspect_string): New method for populating
- a DBusString with the introspect data
- (bus_driver_handle_introspect): Move introspect generation code to
- bus_driver_generate_introspect_string
-
- * bus/main.c:
- (introspect): New function which prints out the intropect data and
- exits
- (main): Add a --introspect switch
-
-2006-09-06 John (J5) Palmieri <johnp@redhat.com>
-
- * doc/TODO: Removed dtd publishing item.
- It seems the dtd has already been added at
- http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd
-
-2006-09-05 John (J5) Palmieri <johnp@redhat.com>
-
- * doc/TODO, various source files: Audited todo's and FIXME's and
- prepended the ones we should be looking at with 1.0. Those
- prepended with 1.0? need clerification or might not be needed
- for 1.0
-
-2006-09-05 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-pending-call.c: Add some checks so we don't crash on
- NULL in the public API (Patch from Kimmo Hämäläinen
- <kimmo dot hamalainen at nokia dot com>)
-
-2006-09-05 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Fix for OS-X compile time endian issues (patch from
- Benjamin Reed <ranger at befunk dot com>)
-
-2006-09-05 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Check for no-common compiler flag (OS-X fix from
- Benjamin Reed <ranger at befunk dot com>)
-
-2006-09-01 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-launch.c: Add a sigterm handler (patch from Frederic Crozat
- <fcrozat at mandriva dot com>)
-
-2006-08-29 Havoc Pennington <hp@redhat.com>
-
- * test/test-service.c (path_message_func): fix lack of return value
-
- * dbus/dbus-sysdeps.c (_dbus_printf_string_upper_bound): fix
- formatting, remove #ifdef, and fix docs. #ifdef doesn't make
- any more sense than on anything else in this file.
- (_dbus_get_tmpdir): add const to return value, and keep the
- results of the various getenv around in a static variable.
-
-2006-08-29 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-util.c, dbus/dbus-sysdeps-util-unix.c: change
- from Ralf Habacker to move UNIX-specific sysdeps into a separate file.
-
-2006-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * test/Makefile.am: change find to use syntax that works with non
- gnu versions of find
-
-2006-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-transport.c: fix invalid deref when checking if
- a vtable method exists (Patch from Christian Ehrlicher
- <ch dot ehrlicher at gmx dot de>)
-
-2006-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in, dbus/Makefile.am, test/name-test/run-test.sh,
- test/name-test/Makefile.am: Fixed some issues with getting get dbus
- to build with builddir != srcdir (Taken from a patch by Bernard Leak
- <bernard at brenda-arkle dot demon dot co dot uk>)
-
-2006-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Fix DBUS_DAEMONDIR to use EXPANDED_BINDIR for the
- default case
-
-2006-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.ac, bus/Makefile.am: Generalize kqueue support so that
- it works on any system providing this interface, not only FreeBSD.
- For example, NetBSD. (Patch by Julio M. Merino Vidal <jmmv at NetBSD dot org>)
-
-2006-08-20 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-faq.xml, doc/dbus-tutorial.xml: some improvements to
- the docs
-
-2006-08-18 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.92
-
-2006-08-18 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-threads.c (dbus_threads_init): change the documentation
- to reflect the init late change
-
- * bus/bus.c (bus_context_new): Check user before we fork so we can
- print out an error message a user will be able to see
-
-2006-08-18 John (J5) Palmieri <johnp@redhat.com>
-
- Patch provided by Ralf Habacker (ralf dot habacker at freenet dot de)
-
- * dbus/dbus-sysdeps.c, dbus/dbus-threads.c, dbus/dbus-internals.h:
- Add two more global locks for use on windows platforms. These are
- unused on non-windows platforms but are not ifdefed out to avoid
- potential bugs (i.e. the few bytes lost does not warrent the extra
- maintanence and complexity that having seperate sets of locks would
- cause)
-
-2006-08-18 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/services.c (bus_registry_acquire_service): Return an error
- when an application tries to register the org.freedesktop.DBus Bus Name
-
- * bus/services.c (bus_registry_release_service): Return an error
- when an application tries to release the org.freedesktop.DBus Bus Name
-
-2006-08-17 Alp Toker <alp@atoker.com>
-
- * doc/dbus-specification.xml: Fix some minor typos.
-
-2006-08-17 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: use $with_init_scripts instead of $operating_system
- to determine where to store the pid since the init scripts manipulate
- the pid file (patch from Marcelo Ricardo Leitner
- <marcelo dot leitner at terra dot com dot br>.
-
-2006-08-16 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-threads.c: Add static DBusList *uninitialized_mutex_list and
- static DBusList *uninitialized_condvar_list to support new late
- initialization threading model. In this model threads can be initialized
- even after the D-Bus API has been used but still needs to be initialized
- before the second thread has been started. Mutexes and condvar addresses
- are stored in the two static lists and are replaced with actuall locks
- when threads are initalized.
- (_dbus_mutex_new_at_location): New method for creating a mutex and placing
- the location into the static list
- (_dbus_mutex_free_at_location): New method for removing a mutex location
- from the static list and freeing the mutex
- (_dbus_condvar_new_at_location): New method for creating a conditional
- variable and placing the location into the static list
- (_dbus_condvar_free_at_location): New method for removing a conditional
- variable location from the static list and freeing the conditional variable
- (init_uninitialized_locks): Atomic method which goes through the static
- lists of mutex and condvar location and updates them with actuall locks
- (init_global_locks): changed to init_locks
-
- * dbus/dbus-connection.c:
- (_dbus_connection_test_get_locks): New method for tests to check connections
- (_dbus_connection_new_for_transport): Use the new at_location mutex and
- condvar API
- (dbus_connection_allocate_data_slot): Pass in the global lock address
- to _dbus_data_slot_allocator_alloc
-
- * dbus/dbus-dataslot.c:
- (_dbus_data_slot_allocator_alloc): Use the address of the mutex
- instead of the mutex itself
-
- * dbus/dbus-message.c:
- (dbus_message_allocate_data_slot): Pass in the global lock address
- to _dbus_data_slot_allocator_alloc
-
- * dbus/dbus-pending-call.c:
- (dbus_pending_call_allocate_data_slot): Pass in the global lock address
- to _dbus_data_slot_allocator_alloc
-
- * dbus/dbus-server.c:
- (_dbus_server_init_base): Use the new at_location mutex API
- (dbus_server_allocate_data_slot): Pass in the global lock address
- to _dbus_data_slot_allocator_alloc
-
- * test/name-test/test-threads-init.c: New test case for late thread
- initialization
-
-2006-08-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_alloc):
- Change _dbus_abort to _dbus_assert_not_reached because _dbus_abort
- causes compile problems when asserts are turned off
- Keeping _dbus_warn for printing out the message so even if
- asserts are turned off the user gets the messages that something is
- wrong
-
-2006-08-14 John (J5) Palmieri <johnp@redhat.com>
-
- Patches by Kjartan Maraas <kmaraas at gnome dot org>
-
- * bus/services.c (bus_service_list_queued_owners):
- Add a pointer cast to fix compiler warning
-
- * dbus/dbus-dataslot.c (_dbus_data_slot_list_get):
- return a NULL instead of FALSE since the return type
- is not expecting a boolean
-
- * dbus/dbus-marshal-basic.c (_dbus_marshal_test):
- Remove unused variable
-
- * dbus/dbus-marshal-recursive-util.c (node_new):
- return a NULL instead of FALSE since the return type
- is not expecting a boolean
-
- * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
- Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
- because we are expecting a pointer not a boolean
-
- * dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir):
- add void as the parameter so some compilers
- don't complain
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket,
- _dbus_transport_new_for_tcp_socket):
- Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
- because we are expecting a pointer not a boolean
-
- * test/shell-test.c (test_command_line):
- cast the second argument to _dbus_list_append to avoid compiler
- warnings
-
- * test/test-names.c (main): remove unused variable
-
- * test/test-service.c (check_hello_from_self_reply):
- Initialize echo_message and echo_reply to NULL
-
- * test/test-shell-service.c (handle_echo):
- Remove unused variable and cast the third parameter passed to
- dbus_connection_get_object_path_data to avoid compiler warrnings
-
- * test/name-test/test-names.c (clear_message_queue):
- Remove unused function
-
- * test/name-test/test-pending-call-dispatch.c:
- Fix format string in printf
-
-
-2006-08-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-bus.c:
- * test/name-test/test-names.c:
- Remove test method dbus_bus_connection_get_unique_name because
- we already have public method dbus_bus_get_unique_name that
- does the exact same thing
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-signature.c:
- fix typos in Julio's previous patch which cause make check to fail
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-address.c (_dbus_address_test): Revert leaking strcmp.
- In any case it was wrong since this is a test checking to see if
- address parsing is correct. There was no need to get the true
- tmp directory.
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-macros.h: Revert the addition of stddef.h
- as we should not be adding it to library headers
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-signature.c:
- Fix the unit tests so that they work if assertions are not enabled.
- (patch from Julio M. Merino Vidal <jmmv at NetBSD dot org>)
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/run-with-tmp-session-bus.sh:
- * test/name-test/run-test.sh:
- Remove bashisms (patch from Julio M. Merino Vidal
- <jmmv at NetBSD dot org>)
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: add a version (>= 2.6.0) check for libxml2
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: make sure the compiler supports -Wfloat-equal
-
- * bus/dir-watch-dnotify.c: move functional code after
- variable declerations (C99 fix) (patches from Jens Granseuer
- <jensgr at gmx dot net>
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-macros.h:
- add #include <stddef.h> so that Sun compilers don't complain about
- the defining NULL
-
-2006-08-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.c:
- * dbus/dbus-address.c:
- * bus/activation.c:
- * test/shell-test.c:
- don't hardcode tmp directory (patch from Dave Meikle
- <dmk at davemeikle dot co dot uk>)
-
-2006-08-09 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_alloc):
- Change an assert to a detailed warning and abort.
- When allocator->lock != mutex it indicates that the user has failed
- to initalize threads before using the D-Bus library. This warning
- helps the user identify the issue and fix their app.
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- These are all patches from Kjartan Maraas <kmaraas at gnome dot org>
- with cleanups of bugs found from Coverity reports:
-
- * dbus/dbus-sysdeps-util.c (_dbus_write_pid_file):
- close the file on error to avoid a leak
-
- * bus/expirelist.c (bus_expire_list_test):
- Check for NULL on dbus_new0
-
- * bus/activation.c (update_directory):
- remove dead code
-
- * bus/config-parser.c (merge_service_context_hash, start_selinux_child):
- Fix some leaks
-
- * bus/bus.c (process_config_every_time):
- Fixed a leak
-
- * bus/desktop-file.c (parse_key_value):
- Fixed leak
-
- * bus/selinux.c (bus_selinux_id_table_insert):
- Fixed leak
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-object-tree.c (_dbus_object_subtree_new):
- remove dead code
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/run-with-tmp-session-bus.sh: use #!/bin/sh instead of
- #!/bin/bash
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * Doxyfile.in: fix the INPUT line so we can generate docs
- when sourcedir != builddir (patch from Cygwin Ports maintainer
- <yselkowitz at users dot sourceforge dot net>
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.h:
- * dbus/dbus-sysdeps.c:
- * dbus/dbus-string.c:
- s/_dbus_printf_length/_dbus_printf_string_upper_bound to comform with
- GLib's function which does the same thing
-
- * configure.in:
- * bus/Makefile.am:
- * bus/dir-watch-default.c:
- * bus/dir-watch-dnotify.c:
- * bus/dir-watch-kqueue.c:
- Add kqueue directory watching for freebsd and split the directory
- watching code into seperate files per method/arch
- (patches from Timothy Redaelli <drizzt at gufi dotorg>)
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in:
- * tools/Makefile.am:
- * tools/dbus-launch.c:
- * bus/Makefile.am:
- allow --with-dbus-daemondir switch to be used to make the
- daemon install to a seperate bindir like /usr/libexec
- (patch from Brian Cameron <brian dot cameron at sun dot com)
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/Makefile.am (install-data-hook): removed the slash after
- $(DESTDIR) so we don't get the double slash which does not work
- in windows (patch from Andras Porjesz
- <andras dot porjesz at siemens dot com>)
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.h:
- * dbus/dbus-sysdeps.c:
- add _dbus_printf_length (patch from Peter Kümmel
- <syntheticpp at gmx dot net>)
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-internals.c: unistd.h is not used
- (_dbus_verbose_real): only enable verbose printing
- if DBUS_VERBOSE environment var is set to '1'
- (patch from Peter Kümmel <syntheticpp at gmx dot net>)
-
-2006-08-08 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: add a GCC flag check for -Wdeclaration-after-statement
- so we still compile on older gcc (patch from Frederic Peters
- <fpeters at 0d dot be>
-
-2006-08-04 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add -Wdeclaration-after-statement
-
- * dbus/dbus-connection.c: change all the pending call stuff to
- reflect the fact that pending call operations use the connection
- lock
-
- * dbus/dbus-pending-call.c: add locking here
-
- * dbus/dbus-errors.c (struct DBusRealError): don't make the name
- field const consistent with how message field is done
-
-2006-08-03 John (J5) Palmieri <johnp@redhat.com>
-
- * s/D-BUS/D-Bus/g
-
-2006-08-03 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-object-tree.c: Patch by Benjamin Otte
- <in7y118 at public.uni-hamburg dot de> - fix invalid
- read/write reported by valgrind
-
-2006-07-24 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.91
-
-2006-07-22 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c:
- (_dbus_connection_attach_pending_call_unlocked):
- (connection_timeout_and_complete_all_pending_calls_unlocked):
- Make sure we set timeout_added on pending calls to FALSE when
- we remove the timeout from the connection
-
-2006-07-21 John (J5) Palmieri <johnp@redhat.com>
-
- * Removed some extra bindings stuff lingering around (thanks timo)
- * dbus-pendingcall.c (_dbus_pending_call_new):
- s/dbus_connection_ref/_dbus_connection_ref_unlocked fixes assertion
- when we tried to take a lock on an already locked connection
-
-2006-07-17 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.90
-
-2006-07-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal-basic.c (_dbus_type_to_string): support 64-bit
- ints, reported by Owen Taylor
-
-2006-07-17 John (J5) Palmieri <johnp@redhat.com>
-
- * doc/TODO:
- * dbus/dbus-bus.c:
- * dbus-errors.c:
- * dbus/dbus-marshal-validate.c:
- Removed TODO items which were fixed or are no longer relevent
-
-2006-07-17 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-qt4-1.pc.in, dbus-sharp.pc.in:
- Remove stray files from the stripped bindings
-
-2006-07-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-pending-call.c (_dbus_pending_call_set_timeout_error):
- Improve the error message on reply timeout
-
-2006-07-14 John (J5) Palmieri <johnp@redhat.com>
-
- * Remove all bindings
-
-2006-07-13 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-connection.c (dbus_connection_send_with_reply): return TRUE
- and set pending_reply out arg to NULL is connection is disconnected
- (connection_timeout_and_complete_all_pending_calls_unlocked): New
- static method for cleaning up pending calls on disconnect
- (_dbus_connection_get_dispatch_status_unlocked): If we have pending
- calls queued timeouts on disconnect
-
- * dbus/dbus-pending-call.c (_dbus_pending_call_set_connection):
- Remove
-
-2006-07-13 Carlos Garcia Campos <carlosgc@gnome.org>
-
- * bus/activation.[ch] (bus_activation_list_services): new function to
- get the list of services that can be activated
-
- * bus/dispatch.c: test coverage for the new bus method
- ListActivatableNames
-
- * bus/driver.c: new bus method ListActivatableNames to get the list of
- services that can be activated
-
- * doc/dbus-specification.xml: ListActivatableNames method documentation
-
-2006-07-12 John (J5) Palmieri <johnp@redhat.com>
- * dbus/Makefile.am: add dbus-pending-call-internal.h to the list of
- source files
-
-2006-07-12 John (J5) Palmieri <johnp@redhat.com>
- * dbus/dbus-message-factory.c:
- Fix index into an array (patch by Peter Kümmel <syntheticpp at gmx.net>)
-
-2006-07-12 John (J5) Palmieri <johnp@redhat.com>
- * dbus/dbus-connection-internal.h:
- * dbus/dbus-connection.c:
- * file dbus/dbus-pending-call.c:
- * dbus/dbus-pending-call.h:
- Make DBusPendingCall an opaque type even to D-Bus internals
-
-2006-07-07 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.h: remove connection_disconnect and replace with
- connection_close
-
- * dbus/dbus-connection.c: include dbus-bus.h
- (_dbus_connection_read_write_dispatch): make static
-
-2006-07-07 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_close): removed deprecated
- function
- (dbus_connection_dispatch): On disconnect unref any shared connections
-
- * dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): new function
- for cleaning up shared connections on disconnect
- (internal_bus_get): get a hard refrence to shared connections when
- they are created
-
- * doc/TODO: Remove items which are no longer relevent or have been fixed
- Split 1.0 todo items with a 0.90 freeze todo list
-
-2006-06-14 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gobject.c:
- Free a leaking GArray (surely not!) in dbus_g_method_return.
-
-2006-06-14 Ross Burton <ross@openedhand.com>
-
- * tools/Makefile.am:
- * tools/dbus-monitor.c:
- Don't use the GLib bindings in dbus-monitor (patch from Ralf
- Habacker).
-
-2006-06-14 Ross Burton <ross@openedhand.com>
-
- * tools/dbus-print-message.c:
- Also print the object path when outputting signals or method calls.
-
-2006-06-13 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/src/Makefile.am: install the qdbus.h header.
- This allows people to actually use the installed code.
-
-2006-06-12 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gproxy.c:
- Don't leak a GArray when firing signals (thank Rob Taylor for review).
-
-2006-06-12 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * Released 0.62
-
-2006-06-12 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * dbus/dbus-arch-deps.h.in: Remove spurious semi-colons that
- break pedantic builds. Closes bug 6043 (patch approved by
- Havoc back in February).
-
-2006-06-12 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/src/qdbusintegrator.cpp: Fix bug in parsing async methods
- that took a QDBusMessage parameter.
- * qt/src/qdbusbus.h: Add a default flag for RequestName.
- * qt/tools/dbus.cpp: Don't use automatic call because we might
- be calling an async method: request a reply.
-
-2006-06-11 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * test/qt/*: Update the testcases, including testing the new
- functionality of sending null QByteArray and QString over the
- bus. Add new headertest test and restore the old
- qdbusxmlparser test.
-
-2006-06-11 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/tools/dbuscpp2xml.cpp: Compile on Windows.
- * qt/tools/dbusidl2cpp.cpp: Add missing newline.
-
- * qt/examples/Makefile.am:
- * qt/examples/chat.h: Use UI-generated files with the ui_*.h
- form.
-
- * qt/src/qdbusmarshall.cpp: Allow sending of QString() and
- QByteArray() (nulls) over the bus.
- * qt/src/qdbusabstractinterface.cpp: Use the correct variable,
- the one that has the signature suffix stripped.
- * qt/src/qdbusreply.h: Make some methods const.
-
-2006-06-09 Thiago Macieira <thiago.macieira@trolltech.com>
-
- Patch from Timo Hoenig <thoenig@suse.de>.
-
- * qt/dbus/Makefile.am: New file. Fix "make dist", add all headers
- required during build to EXTRA_DIST.
- * qt/src/Makefile.am: Fix "make dist", add 'qdbus.h' to EXTRA_DIST.
- * qt/Makefile.am: Fix "make dist", add 'dbus' to DIST_SUBDIRS.
- * configure.in: Fix "make dist", take care that the Makefile for
- qt/dbus is being generated.
-
-2006-06-07 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/bus.c: Fix eavesdropping on method calls
-
-2006-06-07 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in:
- * dbus/dbus-userdb-util.c:
- Add Solaris console owner patch from Artem Kachitchkine
-
-2006-06-07 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/Makfile.am:
- * qt/src/Makefile.am: Fix the EXTRA_DIST after the
- reorganisation. Thanks to Timo Hoenig for pointing this out.
-
-2006-06-06 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gtype-specialized.c: Fix obvious leak of GArray in every
- call to dbus_g_type_get_struct.
-
-2006-06-06 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue-utils.c: Fix the failing test where static string
- pointers were put into a GPtrArray-based specialised collection, and
- then freed along with the array. GValues which you add into
- collections or maps which have the NOCOPY flag set are assumed to not
- belong to the caller, so rather than the existing pointer-stealing
- semantics, they are copied instead. Given that the main consumers of
- this abstraction are the bindings themselves, I don't think this is
- too bad, but others should watch their choice of take vs set_static.
-
-2006-06-06 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue-utils.c: Spotted a warning about the return value
- of g_slist_prepend not being used. Fixed copying of slist-based
- specialised collections, then wrote a test case and found that it was
- all broken. Went on to fix iterating and appending too. Good thing
- nobody uses this code yet.
-
-2006-06-06 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue-utils.c: Remove duplicated code by having all of
- the iterators use gvalue_take_ptrarray_value (the GValues themselves
- are discarded without unsetting, so it makes no difference whether
- we take or set_static). Remove cases for G_TYPE_POINTER because
- there really is nothing useful we can do with them in our
- specialised types - we *need* boxed copy/free functions at the very
- least.
-
-2006-06-05 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/dbus: Add directory. I had forgotten to add this
- yesterday after the move...
-
- * qt/examples/Makefile.am:
- * qt/examples/dbus.cpp: Moved to qt/tools/dbus.cpp.
-
- * qt/tools/Makefile.am:
- * qt/tools/dbus.cpp: Moved from qt/examples/dbus.cpp.
- Added feature to get and set properties.
- Added validation of service, object path and interface names.
-
- * qt/tools/dbusidl2cpp.cpp: Two new features:
- 1) Allow specifying both the header and the source file names,
- by separating them with a colon.
- 2) Don't write an interface output if the -p switch wasn't
- given, but the -a was.
-
- * qt/src/*: Fix usage of Iterators and ConstIterators.
- Fix shadowing of variables by other variables (-Wshadow).
- Fix keyword-cleanliness in headers.
- Fix ASCII-cast (QLatin1String, QLatin1Char).
- Fix validation of member names.
- Add extra checking of introspection data during XML parsing.
- Various bug fixes.
-
-2006-06-04 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * dbus/Makefile.am:
- * dbus/qdbus.h: Remove unnecessary file. This is mirrored into
- qt/dbus/qdbus.h now.
-
-2006-06-04 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * configure.in: Make --disable-qt actually do
- something. Patch inspired by Zack Rusin.
-
-2006-06-04 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/: Update to Subversion r548032.
- This includes a big reorganisation of the files inside the
- subdir.
-
-2006-05-30 Sjoerd Simons <sjoerd@luon.net>
-
- * dbus/dbus-sysdeps.c: Make tcp socket connection error somewhat more
- clear:
- "Failed to connect to socket <host>:<port> <error>" instead of
- "Failed to connect to socket <host>: <error>:<port>"
-
- * dbus/dbus-transport-unix.c: Fix crash when no host option is given
- for a tcp transport.
-
-2006-05-29 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/*: Update the QtDBus bindings up to revision 546310 in
- Subversion.
- This adds the dbuscpp2xml tool, that parses a C++ header and
- outputs a D-BUS Introspection XML.
-
-2006-05-21 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c: Put in a pile of assertions that the proxy name
- is not NULL when it shouldn't be. Also a couple of possible fixes
- for #4637 though I don't understand why the bug happens, to be
- honest... also the object constructor has an assert name != NULL
- and the name is only currently NULL for peer-to-peer proxies that
- I don't think anyone uses? So it should be asserting.
- Anyway, for now at least see if we get an earlier assertion failure.
-
- * glib/dbus-gvalue-utils.c: Put in a couple of assertions for
- apparently broken code to be sure the tests fail and someone
- will fix them...
-
-2006-05-07 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusmarshall.cpp: Fix a problem of demarshalling lists
- and arrays when they had a single element: has_next returns
- false, even before you read the element. So, instead, check
- the array length.
-
-2006-05-06 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusmessage.cpp:
- * qt/qdbustypehelper_p.h:
- * qt/qdbusintegrator.cpp: gcc 3.4 doesn't like Q_FOREACH when
- the list is a const-reference
-
-2006-05-03 John (J5) Palmieri <johnp@redhat.com>
-
- * Adding old doc patch that never got applied
-
- * dbus/bus.c (dbus_bus_add_match): Add documentation
-
- * doc/dbus-specification.xml: Add documentation for the match rules
- and the AddMatch and RemoveMatch methods
-
-2006-05-02 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/dbusidl2cpp.cpp: There's no callAsync. Use the correct
- call (r535506)
-
- * qt/dbusidl2cpp.cpp:
- * qt/qdbusabstractadaptor.cpp:
- * qt/qdbusabstractadaptor.h: Make QDBusAdaptorConnector be a
- sibling of the QDBusAbstractAdaptor objects instead of the
- parent. (r535848)
-
- * qt/dbusidl2cpp.cpp:
- * qt/qdbusabstractinterface.cpp:
- * qt/qdbusabstractinterface.h:
- * qt/qdbusabstractinterface_p.h:
- * qt/qdbusinterface.cpp: Make properties in interfaces
- actually work. The code that was generated would not compile,
- due to moc calls to functions that did not exist. They now
- shall. (r536571)
-
-2006-04-30 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * Makefile.am:
- * configure.in:
- * dbus-qt4-1.pc.in: Add a pkg-config file for libdbus-qt4-1.
- Thanks to Brad Hards for providing the patch
-
-2006-04-29 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/dbusidl2cpp.cpp: There's no callAsync. Use the correct
- call. (r535506)
-
-2006-04-29 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/examples/dbus.cpp: Enhance error messages and use
- QDBusInterfacePtr.
-
-2006-04-29 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusinterface.h: Rename QDBusRef to QDBusInterfacePtr
- and disable the copy operators. (r533772, r534746)
-
- * qt/qdbuserror.h: Remove the automatic cast to bool. (r533929)
-
- * qt/qdbusabstractinterface.cpp:
- * qt/qdbusabstractinterface.h: Change the default call mode to
- not use the event loop. Add convenience call() methods that
- take a CallMode parameter. (r534042)
-
- * qt/qdbusconnection.h: Change the default call mode to not
- use the event loop. (r534042)
-
- * qt/qdbusinterface.cpp:
- * qt/qdbusinterface.h: Add a method to tell us if the
- interface is valid (since we don't return a null pointer
- anymore) (r534099)
-
- * qt/qdbusinterface_p.h: Don't crash if metaObject is 0
- (r534101)
-
- * qt/qdbusinternalfilters.cpp: Decouple the introspection
- function in two so taht we get the chance to introspect
- without having a QDBusMessage (r534102)
-
- * qt/qdbusbus.h:
- * qt/qdbusconnection.cpp:
- * qt/qdbusconnection_p.h:
- * qt/qdbusintegrator.cpp: Keep a list of our own names to
- avoid a round-trip to the server when attempting to introspect
- one of our own objects. Also make sure the filter functions
- match the empty interface as well. (r534108)
- Don't keep the connection names. Instead, trust the unique
- connection name (r534111)
- Remove event loop usage (r534112)
-
-2006-04-29 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusintegrator.cpp: Fix assertion failure spotted by
- Brad Hards.
-
-2006-04-28 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gproxy.c: Fix properties so that they can be given in
- any order, making it easier for people who inherit from this
- object.
-
-2006-04-28 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue-utils.c: Patch from Jakub Stachowski to fix leaking
- of memory from within pointer arrays and lists. Fixes bug #6300.
-
-2006-04-28 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue.c: Patch from Jakub Stachowski to fix a leak in
- generating struct signatures. Fixes bug #6083.
-
-2006-04-28 Robert McQueen <robot101@debian.org>
-
- * qt/Makefile.am: Tweak CLEANFILES from qdbusconnection.moc
- to qdbusconnection_p.moc.
-
-2006-04-24 John (J5) Palmieri <johnp@redhat.com>
-
- * README, INSTALL: Doc fixes
- Patch from Brad Hards <bradh at frogmouth.net>
-
-2006-04-23 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/examples/dbus.cpp: Use the new merged-interface mode for
- the dynamic meta object. No need to guess which interface to
- call.
-
-2006-04-23 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusconnection_p.h:
- * qt/qdbusmetaobject.cpp:
- * qt/qdbusmetaobject_p.h:
- * qt/qdbusintegrator.cpp: Use the new merged-interface mode
- for the dynamic meta object. No need to guess which
- interface to call.
- * qt/qdbusabstractinterface_p.h:
- * qt/qdbusconnection.cpp:
- * qt/qdbusintegrator.cpp:
- * qt/qdbusinterface.cpp:
- * qt/qdbusinterface.h: Make findInterface always return a non-null pointer.
- Add a QDBusRef that looks and behaves like DCOPRef.
-
-2006-04-23 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * dbus/dbus-connection.c: Interfaces are optional in method
- calls, so don't give up if the interface parameter is NULL.
- Patch reviewed by Havoc Pennington.
-
-2006-04-23 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusreply.h: Add default constructor and operator=
- (r532625)
- * qt/qdbustypehelper_p.h: Use a clean namespace: no foreach()
- in public headers (r532952)
- * qt/qdbusabstractinterface.cpp:
- * qt/qdbusabstractinterface_p.h: Add the AutoDetect mode and
- make it the default (r532951)
-
-2006-04-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c: Fix asserts
- Patch from Tim Moloney <t.moloney at verizon.net>
-
-2006-04-19 John (J5) Palmieri <johnp@redhat.com>
-
- * mono/Connection.cs, mono/Message.cs: Check Target type
- Patch from Aaron Bockover (abockover at novell.com)
-
-2006-04-13 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * INSTALL: fine-tune the requirements for the Qt4 binding.
-
-2006-04-16 Daniel P. Berrange <dan@berrange.com>
-
- * tools/dbus-print-message.c: Added support for printing of all
- remaining data types. Fixed logic for indentation of compound
- data types.
-
-2006-04-15 Daniel P. Berrange <dan@berrange.com>
-
- * INSTALL: fill out content of file providing DBus specific
- build installations, followed by generic Auto* INSTALL file
- content
-
-2006-04-13 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusintegrator.cpp: Work around g++ 3.3 bug.
- Patch by Stefan Eilers. (r529537)
-
-2006-04-13 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusinternalfilters.cpp: Don't show the parent's
- contents (r528208)
-
-2006-04-10 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/Makefile.am: fix the dependency for
- qdbusconnection_p.moc. It's included in qdbusintegrator.cpp,
- not in qdbusconnection.cpp.
- Thanks to Jakub Stachowski <stachowski@hypair.net> for
- spotting this.
-
-2006-04-10 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/examples/listnames.cpp:
- * qt/examples/Makefile.am: Three ways to list the names on the
- bus.
-
-2006-04-10 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * test/qt/tst_hal.cpp: Remove the waiting, since it's not
- needed anymore. Requires Qt 4.1.3 to work properly. (r528148)
-
-2006-04-10 Thiago Macieira <thiago.macieira@trolltech.com>
-
- Merge from Subversion:
- * qt/qt-dbus.qdocconf: Update Trolltech's webpage link to
- something that exists (r526315)
- * qt/qdbusinternalfilters.cpp: Correctly detect non-scriptable
- slots/signals (r526316)
- * qt/qdbusinternalfilters.cpp: Fix the setProperty call and
- also return an unknown-method error if the parameters don't
- match for org.freedesktop.DBus.Properties. (r526842)
- * qt/examples/dbus.cpp: Allow passing of QVariants (r526843)
- * qt/qdbusintegrator.cpp: Restore the proper order of
- delivery: don't make method returns be delivered on priority
- (r528150)
-
-2006-03-28 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * configure.in qt/Makefile.am: add qt/examples
- * qt/examples: Add QtDBus example programs:
- - hello: Hello, World
- - ping: Simple method-calling program
- - pong: Simple object-exporting program (not using adaptors)
- - complexping: Interactive method-calling program
- (also gets and sets properties).
- - complexpong: Sample program exporting methods, signals and
- properties, using adaptors.
- - dbus: Simple implementation of a generic method-calling
- program, similar to 'dbus-send', but with semantics
- similar to 'dcop'.
- - chat: Simplistic chat program, implemented using signals
- and the system bus. Looks like IRC.
-
-2006-03-28 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * configure.in: Detect QtGui (necessary for one of the
- example programs). Note: this increases the minimum required
- version of Qt to 4.1.3.
-
-2006-03-28 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * test/qt/*: Sync with KDE Subversion revision 523647.
- Update the testcases to the new API. Remove testcases for
- classes that are no longer public or have been removed.
-
-2006-03-28 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/*:
- * dbus/qdbus.h: Sync with KDE Subversion revision
- 523647. Hopefully, this will be the last of the
- source-incompatible changes. Documentation has been improved;
- support for QList<basic-types> has been added; QDBusObject is
- gone; QDBus(Abstract)Interface is now a QObject with
- auto-generated meta-object; QDBusIntrospection is marked
- private, since QMetaObject can be used now; lots of bugfixes.
-
-2006-03-16 John (J5) Palmieri <johnp@redhat.com>
-
- Patch from Milosz Derezynski <internalerror at gmail.com>
-
- * configure.in:
- Output the service directory in the configure summary
-
- * dbus-1.pc.in:
- Add session_bus_services_dir
-
-2006-03-10 Ross Burton <ross@openedhand.com>
-
- * tools/dbus-print-message.c:
- Add support for object paths and signatures.
-
-2006-03-06 Sjoerd Simons <sjoerd@luon.net>
-
- * bus/bus.c: (bus_context_reload_config): Flush the user database cache on
- config reload.
- * bus/dbus-daemon.1.in: Also note that SIGHUP flushes the user/group
- information caches
- * dbus/dbus-hash.c: (_dbus_hash_table_remove_all):
- * dbus/dbus-hash.h: Add function to remove all entries from a hash table
- * dbus/dbus-userdb.c: (_dbus_user_database_flush):
- * dbus/dbus-userdb.h: Add function to flush all user/group information
- caches.
-
-2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/dbusidl2cpp.cpp:
- * qt/Makefile.am: add the dbusidl2cpp tool, the replacement
- for dcopidl2cpp, found in the KDE installations (or the more
- modern kalyptus): generate Qt4 C++ code for the input XML
- introspection. Currently no IDL parsing.
-
-2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * test/qt/*: Update the self-tests.
-
-2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/*:
- * dbus/qdbus.h: Sync with KDE Subversion revision 516237. This
- represents the first feature-complete version of the Qt4
- bindings since I took ove maintainership.
-
-2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/Doxyfile: Adding a Doxyfile for the Qt4 bindings
- dir. This is C++, so we can't use the DBus ones.
-
-2006-03-02 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx: Remove refrence to sys/cdefs.h
- (Patch from Artem Kachitchkine <Artem.Kachitchkin at Sun.COM>)
-
-2006-03-02 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c:
- (_dbus_connection_block_pending_call):
- Check to see if our data has already been read off the connection
- by another blocking pending call before we block in poll.
- (check_for_reply_and_update_dispatch_unlocked):
- Code taken from _dbus_connection_block_pending_call - checks for
- an already read reply and updates the dispatch if there is one.
-
- * test/name-test/test-pending-call-dispatch.c:
- New test for making sure we don't get stuck polling a
- dbus connection which has no data on the socket when
- blocking out of order on two or more pending calls.
-
-2006-02-28 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/Makefile.am: Patch by Sjoerd Simons. More .moc issues:
- make/automake don't detect that we're talking about the same
- .lo file if I specify the full path to the source files.
-
-2006-02-26 Havoc Pennington <hp@redhat.com>
-
- * bus/dbus-daemon.1.in: improve the language in a couple spots I noticed
-
- * dbus/dbus-bus.c (internal_bus_get): in the error message if the
- session bus variable is unset, suggest "man dbus-launch" and "man
- dbus-daemon" to figure out how to fix the problem
-
-2006-02-25 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-glib-tool.c (usage): fix up the usage message, someone
- should make this thing use the new glib options parser
-
-2006-02-25 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/Makefile.am: Patch by Sjoerd Simons. Fix the path to the
- .lo files taking moc sources.
-
-2006-02-25 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus.h, dbus/Makefile.am: add dbus-signature.h to dbus.h
- and install it as a public header
-
-2006-02-24 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.61
-
-2006-02-24 John (J5) Palmieri <johnp@redhat.com>
-
- * proxies.py: Fix the callchain
-
-2006-02-24 John (J5) Palmieri <johnp@redhat.com>
-
- * patch from Sjoerd Simons <sjoerd at debian.org>:
-
- * dbus/dbus-sysdeps-util.c (_dbus_group_info_free): Moved to
- dbus/dbus-sysdeps.c
-
- * dbus/dbus-userdb.c (_dbus_group_info_free_allocated): Don't
- call _dbus_group_info_free_allocated which causes infinite loop,
- correctly call _dbus_group_info_free
-
-2006-02-20 Thiago Macieira <thiago.macieira@trolltech.com>
-
- * qt/qdbusinterface_p.h:
- * qt/qdbusinterface.cpp: Use the standard
- org.freedesktop.DBus.Method.NoReply annotation for the "async"
- calls instead of creating one for us.
-
- * qt/qdbusconnection_p.h:
- * qt/qdbusintegrator.cpp: Remove debugging code.
-
- * qt/qdbusintegrator.cpp:
- * qt/qdbusmessage.cpp:
- * qt/qdbusmessage_p.h:
- * qt/qdbusmessage.h: Change the behaviour of automatic
- reply-sending: now a reply is always sent, unless the caller
- didn't request one or if the user slot has already sent one.
-
-2006-02-16 Robert McQueen <robot101@debian.org>
-
- * configure.in: Patch from Debian packages by Sjoerd Simons
- <sjoerd@debian.org> to add --with-qt-moc and --with-qt3-moc
- arguments so it's possible to build both bindings in the
- same tree.
-
- * qt/Makefile.am: Fix truncated value so that make dist works.
-
-2006-02-16 Robert McQueen <robot101@debian.org>
-
- * acinclude.m4, configure.in: Patch from Brad Hards
- <bradh@frogmouth.net> to avoid warnings from autoconf 1.9 by
- improving quoting, re-ordering a few checks, and a few other
- aesthetic tidy-ups.
-
-2006-02-16 Robert McQueen <robot101@debian.org>
-
- * dbus/dbus-message.c (dbus_message_iter_get_fixed_array):
- Patch from Rob Taylor <rob.taylor@collabora.co.uk> to correct a bogus
- assertion that the next element to read from the iter is fixed in
- size. This is not the case when you are at the end of the iter,
- because the next element type is INVALID.
-
- * dbus/dbus-string.c (_dbus_string_init_const_len): Correct a
- a bogus assert which means that you may not initialise a 0-length
- string unless you provide a non-NULL pointer. This prevented
- you from marshalling messages containing zero-length arrays in
- some cases.
-
- * glib/dbus-gvalue.c (demarshal_collection_array): Another patch
- from Rob to correct bogus asserts when trying to demarshal an
- array and get_fixed_array got you 0 elements. Append nothing to
- the GArray in this case.
-
- * test/glib/test-dbus-glib.c: Add a test case for round-tripping
- an empty array via the glib bindings. Without all of the above
- patches, this new test fails.
-
-2006-02-16 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gmain.c: Make the previous commit compile.
-
- * python/_dbus.py, python/matchrules.py: Patch from Ole Andre
- Ravnaas <ole.andre.ravnaas@collabora.co.uk> to allow you to
- specify sender_keyword="foo", path_keyword="bar" when adding
- a signal listener, so that you can bind to signals generically
- but still do something useful in your callback.
-
- * python/dbus_bindings.pyx: Demarshal the byte type as unsigned
- chars so that they're not cast to chars and made negative. Thanks
- to Jakub Stachowski for reporting this and testing the fix.
-
-2006-02-15 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-glib.h:
- * glib/dbus-gmain.h:
- (dbus_g_connection_open): new method for openning
- a connection to an arbitrary address in the glib bindings
-
- * ChangeLog: checkin last entry which doesn't seem to be commited
-
-2006-02-13 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-launch.c: Fixed sh syntax output
-
-2006-02-13 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-binding-tool-glib.c, glib/dbus-gmain.c,
- glib/dbus-gsignature.c, glib/dbus-gtype-specialized.c,
- glib/dbus-gtype-specialized.h, glib/dbus-gvalue-utils.c,
- glib/dbus-gvalue-utils.h, glib/dbus-gvalue.c:
- Patch from Rob Taylor <rob.taylor@collabora.co.uk> to add a big
- missing piece of the glib bindings jigsaw puzzle. This modifies
- the existing specialised types to have N type parameters (rather
- than the current 1 or 2 for arrays and dictionaries respectively).
- You can then use this to get a glib type to represent any arbitrary
- D-Bus struct type using dbus_g_type_get_struct. The only
- implementation of these types is with GValueArrays as before,
- but it's now possible to store these in arrays, emit them in
- signals, etc.
-
-2006-02-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-signature.c (dbus_signature_iter_recurse): Correctly
- deal with nested arrays (Bug #5823) Patch by Thiago Macieira
- <thiago.macieira at trolltech.com>
-
-2006-02-10 John (J5) Palmieri <johnp@redhat.com>
-
- * mono/doc/Makefile.am: Fix parallel make problem with mono-doc
- (Bug #4213) Patch from Doug Goldstein <cardoe at gentoo.org>
-
-2006-02-10 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/connection.c (bus_connections_expect_reply): Make
- pending reply limit not common to all connections (Bug #5416)
- Patch from Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
-
-2006-02-10 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-launch.c: Fixed csh syntax output (Bug #5720)
-
-2006-02-10 John (J5) Palmieri <johnp@redhat.com>
-
- * gcj/Makefile.am: point to correct jar command (Bug #4529)
- patch from Doug Goldstein <cardoe at gentoo.org>
-
-2006-02-09 Joe Shaw <joeshaw@novell.com>
-
- * mono/Arguments.cs: Fix a magic number in the mono bindings
- that doesn't work on 64 bit arches. Patch from Peter Johanson.
-
-2006-01-27 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-binding-tool-glib.[ch]: Patch based on Ricardo Kekki's
- patch to use an annotation org.freedesktop.DBus.GLib.ClientCSymbol
- when generating the client-side methods, instead of overloading
- CSymbol which broke everything horribly. My apologies.
-
-2006-01-27 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gtype-specialized.[ch], glib/dbus-gvalue-utils.c: Patch
- by me and Rob Taylor to add a simple_free function to D-Bus map
- and collection types, which allows those types which can be freed
- with a GDestroyNotify (such as GHashTables and GArrays, but not
- GPtrArrays) to be stored as the values in hashtables.
-
- * test/glib/test-dbus-glib.c, test/glib/test-service-glib.{c,xml}:
- Patch by Rob Taylor to add nested dicts to the glib tests to check
- the above code works, and appears not to leak when called repeatedly.
-
-2006-01-27 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-gvalue.c (demarshal_valuearray): Patch from Rob Taylor
- to free a D-Bus allocated string with dbus_free () instead of
- g_free ().
-
-2006-01-27 Iain Holmes <iain@openedhand.com>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_dispose): Protect the dispose
- method from being called multiple times.
-
-2006-01-19 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-binding-tool-glib.c: Patch from Rob Taylor
- <rob.taylor@collabora.co.uk> to add support for generating bindings
- to arrays that are represented as GPtrArrays rather than GArrays (ie
- size-variable things, such as strings, objects, structs, etc).
-
-2006-01-05 Robert McQueen <robot101@debian.org>
-
- * dbus/dbus-glib.h, glib/dbus-gproxy.c: Patch from Ricardo Kekki
- <ricardo.kekki@movial.fi> to make it possible to inherit from
- DBusGProxy, by splitting the DBusGProxy struct into a public part and
- a private part, and moving the setting of the DBusGProxyManager into a
- connection property, allowing proper GObject construction.
-
-2006-01-05 Robert McQueen <robot101@debian.org>
-
- * glib/dbus-binding-tool-glib.c: Patch from Ricardo Kekki
- <ricardo.kekki@movial.fi> to make dbus-binding-tool heed C symbol name
- annotations when generating glib client bindings.
-
-2005-12-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-shared.h: Call it shared constants instead of shared macros
-
- * dbus/dbus-protocol.h: add DOxygen markup to quiet warnings
-
-2005-12-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-shared.h: add DOxygen markup to quiet warnings
-
-2005-12-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-macros.h: correct DOxygen end of section (s/}@/@})
-
-2005-12-19 Ross Burton <ross@openedhand.com>
-
- * doc/dbus-tutorial.xml:
- Document the Glib client-side bindings, and list all possible annotations.
-
-2005-12-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/bus.c (dbus_bus_release_name): Add documentation
-
-2005-12-06 Robert McQueen <robot101@debian.org>
-
- * python/service.py: s/sucessful/successful/ so we're allocating to
- and reading from the same variable. Oops.
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.60
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * test/qt/Makefile.am: build from srcdir
-
- * qt/qtconnection.cpp (requestName): Changed PROHIBIT_REPLACE to ALLOW_REPLACE
- Note - this code is wrong and needs to be fixed by the Qt binding
- developers. The flags should be treated as bitfields and not enums.
-
- * qt/qtconnection.h: Change ProhibitReplace to AllowReplace
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-list.c (_dbus_list_insert_after_link, _dbus_list_insert_after,
- link_after): remove #ifdef DBUS_BUILD_TESTS since we use these methods
- in production code
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_read_write): Add new
- method for getting messages off the bus in the absence of a
- mainloop. This method is much like
- dbus_connection_read_write_dispatch except it does not dispatch
- the messages to a registered filter function. Instead it
- allows a developer to process messages by directly popping
- them off the bus.
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/desktop-file.c (parse_key_value): Ignore locales allowing
- the parser to continue instead of returning error
- (bus_desktop_file_load): Do not free parser data when
- parse_section_start or parse_key_value fails because it was
- already freed by parser_free (patch from Carlos Garcia Campos
- <carlosgc at gnome.org>)
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,
- dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c
- glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c
- test/test-segfault.c, test/test-utils.c,
- test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c
- tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c:
- Various cleanup of dead code and compiler warnings (patch from
- Kjartan Maraas <kmaraas at gnome.org>)
-
-2005-11-30 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/dbus-gmain.c (connection_setup_add_watch): plugged a leak
- (patch from Carlos Garnacho Parro <carlosg at gnome.org>
-
-2005-11-27 Robert McQueen <robot101@debian.org>
-
- * python/dbus_bindings.pyx: Repair my previous commit which reverted
- part of the preceding one. Oops. Merge patch by Johan Hedberg
- <johan.hedberg@nokia.com> to fix marshalling of 16-bit integer values
- on big-endian platforms.
-
- * test/python/test-client.py: Add some 16-bit integers to the test
- values.
-
-2005-11-27 Carlos Garcia Campos <carlosgc@gnome.org>
-
- * glib/dbus-gobject.c: Append a GValue instead of a basic type in
- method return message for property getters
-
-2005-11-27 Robert McQueen <robot101@debian.org>
-
- * python/dbus_bindings.pyx: Fix a bug where doing a strict append
- with type v of an instance of dbus.Variant(foo, type='x') caused
- it to be boxed twice before sending over the bus.
-
- * python/dbus_bindings.pyx, python/service.py,
- test/python/test-client.py: Update the constants for the new
- request_name flags, and update comments/test cases now that queueing
- is the default action.
-
-2005-11-22 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in:
- - Change version to 0.60 for impending release
- - upped the sonames because of ABI and API breakage
-
-2005-11-22 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Add test/name-test/Makefile to the generated
- Makefile list
-
- * dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT):
- New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
- (#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying
- not to queue an ower if it can't be the primary owner
-
- * bus/bus.h: Add new internal BusOwner struct
-
- * bus/driver.c (bus_driver_handle_hello): Send flags (0 for default)
- to bus_registry_ensure and don't set the prohibit_replacement flag
- since they are now set per BusOwner and not per name.
- (bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners)
- that returns the list of connections in a name's connection queue
-
- * bus/services.c (struct BusService): remove prohibit_replacement field
- (struct BusOwner): new struct for keeping track of queued connections
- and their associated flags for the queue
- (struct BusRegistry): add a BusOwner memory pool
- (bus_registry_new): initialize the BusOwner memory pool
- (bus_registry_unref): free the BusOwner memory pool
- (_bus_service_find_owner_link): new internal method for
- searching the queue for a specific connection
- (bus_owner_set_flags): new method for adding setting the flags on a
- bus owner
- (bus_owner_new): new method that creates a BusOwner object from the
- pool and sets its flags
- (bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects
- (bus_registry_ensure): Add the flags parameter
- (bus_registry_acquire_service): Switch from using raw connections to
- using the BusOwner struct
- Add new state machine for dealing with the new set of flags
- (bus_registry_set_service_context_table, struct OwnershipCancelData,
- cancel_ownership, free_ownership_cancel_data,
- add_cancel_ownership_to_transaction, struct OwnershipRestoreData,
- restore_ownership, free_ownership_restore_data,
- add_restore_ownership_to_transaction): Switch to using BusOwner
- instead of raw connections
- (bus_service_add_owner): Add flags parameter
- Switch to using BusOwner instead of raw connections
- Add state machine for dealing with the new set of flags
- (bus_service_swap_owner): Swaps the first and second owners in the
- queue. Used to make sure proper signals are sent when a service looses
- or gains primary ownership. We never insert an owner at the top of the
- queue. Instead we insert it in the second position and then swap.
- (bus_service_remove_owner): Remove the owner from the queue sending
- out the NameLost and NameOwnerChanged signals if the we were the
- primary owner
- (bus_service_get_primary_owners_connection): New method that extracts
- the connection from the primary owner
- (bus_service_get_primary_owner): Returns the BusOwner instead of the
- connection
- (bus_service_get_allow_replacement): Changed from the old
- bus_service_get_prohibit_replacement method. Checks the flags of the
- primary owner and returns if it can be replaced or not
- (bus_service_set_prohibit_replacement): removed
- (bus_service_has_owner): returns TRUE if and owner with
- the specified connection exists in the queue
-
- * dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper
- method that only compiles if tests are enabled. Allows us to get the
- unique name of a connection so we can check it against the queue when
- doing regression tests
-
- * bus/activation.c (bus_activation_send_pending_auto_activate),
- bus/dispatch.c (bus_dispatch),
- bus/driver.c (bus_driver_handle_get_service_owner,
- bus_driver_handle_get_connection_unix_user,
- bus_driver_handle_get_connection_unix_process_id,
- bus_driver_handle_get_connection_selinux_security_context),
- bus/signals.c (connection_is_primary_owner):
- use bus_service_get_primary_owners_connection instead of
- bus_service_get_primary_owner
-
- * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket,
- _dbus_listen_unix_socket): Calculate the length of the socket
- path and use that instead of using a fixed length which was
- causing socket names to contain many trailing Nul bytes.
-
- * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c
- (dbus_g_method_get_sender): New method for extracting the sender
- from a DBusGMethodInvocation
- (dbus_g_method_return_get_reply): changed name to
- dbus_g_method_get_reply
- (dbus_g_method_return_send_reply): changed name to
- dbus_g_method_send reply
-
- * doc/dbus-specification.xml: New docs that describe how the new
- queueing system works and talks about the changes to the how
- we specify socket names
-
- * glib/examples/example-service.c,
- glib/examples/example-signal-emitter.c,
- glib/examples/statemachine/statemachine-server.c:
- Changed the RequestName flags to the new system
-
- * test/name-test/ (test-names.c, run-test.sh, Makefile.am): New
- regression test suite for testing various states of the new
- queueing system
-
-2005-11-15 Robert McQueen <robot101@debian.org>
-
- * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c: Patch from Rob
- Taylor to add two methods, dbus_g_method_return_get_reply and
- dbus_g_method_return_send_reply, to allow you to get the reply
- message from a DBusGMethodInvocation, append arbitrary stuff to it,
- and send it. The GLib bindings can't marshal a return value of
- something like a(s) if the array is empty - ultimately they should be
- made to heed the signature of the out arguments as the Python bindings
- now can, but this is a workable interim solution which might have
- other applications.
-
-2005-11-15 Robert McQueen <robot101@debian.org>
-
- * bus/driver.c, bus/services.c, bus/services.h: Add a ReleaseName
- method to org.freedesktop.DBus to release a bus name or give up
- waiting in the queue for it.
-
- * dbus/dbus-bus.c, dbus/dbus-bus.h, dbus/dbus-shared.h: Add a
- dbus_bus_release_name method to send the ReleaseName method calls.
- Add constants for the return values to dbus/dbus-shared.h.
-
- * doc/dbus-specification.xml: Document the new ReleaseName method
- in the specification.
-
- * python/dbus_bindings.pyx: Add a low-level python binding for the
- release name method.
-
- * python/exceptions.py, python/service.py: Make freeing BusName
- objects release the name. Add a NameExistsException, and fix a
- bug with creating UnknownMethodException.
-
- * test/python/test-client.py: Add tests for freeing BusName
- objects causing names to be released.
-
-2005-11-14 Robert McQueen <robot101@debian.org>
-
- * python/service.py: Include the traceback in the error reply when we
- send an exception over the bus. _BEST_ _PATCH_ _EVER_
-
-2005-11-14 David Zeuthen <davidz@redhat.com>
-
- Patch from Timo Hoenig <thoenig@suse.de>.
-
- * bus/bus.c: I've recently investigated why the automatic reload
- of configuration files does not work as expected.
-
- Currently, reloading configuration files does only work when
- running dbus-daemon with --nodaemon. If we are running as daemon
- we're hitting a dnotify bug once we fork the process.
-
- We're initializing the dnotify fds before calling fork(). Once
- the child process forked it does still have the fds (and they
- still show up in /proc/`pidof dbus-daemon`/fd/) but we're not
- getting SIGIO as changes are made to the configuration files.
-
- The attached patch moves the initialization of the dnotify fds to
- process_config_postinit(). This is safe for all current code
- paths and solves the dnotify disfunction. If we're running
- dbus-daemon as daemon the fds for dnotify are now being
- initialized after fork() for the child process.
-
- * configure.in: The current configure.in check for dnotify probes
- 'x$target_os' for being 'xlinux-gnu'. I've changed the check to
- match for 'xlinux', too. Additionally I have adapted the configure
- option's style to match with the others.
-
-2005-11-14 Robert McQueen <robot101@debian.org>
-
- * python/decorators.py, python/service.py: Add a new argument to the
- dbus.service.method decorator called sender_keyword, which if set,
- specifies the name of an argument which will be provided the bus
- name of the method caller.
-
- * test/python/test-client.py, test/python/test-service.py: Add a
- method and test to check the sender_keyword functionality.
-
-2005-11-07 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/driver.c (bus_driver_handle_reload_config): Make sure we send an
- empty reply so blocking calls don't block forever (Patch from Sjoerd
- Simons <sjoerd at luon.net>)
-
- * AUTHORS: Add Robert McQueen for his work on the Python
- Bindings and other parts of D-Bus
-
-2005-11-07 Robert McQueen <robot101@debian.org>
-
- * python/decorators.py: Change emit_signal function to use the
- signature annotation of the signal when marhsalling the arguments from
- the service. Fix a bug where the code checking signature length
- against argument length referenced the wrong variable.
-
- * python/introspect_parser.py: Avoid adding the type signature of
- signal arguments to any methods which occur after them in the
- introspection data (!) by making the parser a little more careful
- about its current state.
-
- * python/service.py: Remove debug prints from last commit (again :D).
-
- * test/python/test-client.py, test/python/test-service.py: Add test
- signals with signature decorators to test the strict marshalling code
- gives errors at the right time. Could do with checking the signals
- actually get emitted too, given that the test does nothing with
- signals at the moment...
-
-2005-11-07 Robert McQueen <robot101@debian.org>
-
- * python/_dbus.py: Add WeakReferenceDictionary cache of dbus.Bus
- instances to stop madness of creating new instances representing
- the same bus connection all the time, rendering any tracking of
- match rules and bus names quite meaningless. Caught a bug where
- the private argument to SessionBus() and friends was being passed
- in as use_default_mainloop by mistake. Still some problems with
- multiple dbus_binding.Connection instances representing the same
- low-level connection (eg when you use both SessionBus() and
- StarterBus() in same process), but it's a lot better now than it
- was.
-
- * python/dbus_bindings.pyx: Add constants with the return values
- for bus_request_name().
-
- * python/service.py: Store bus name instances in a per-dbus.Bus cache
- and retrieve the same instances for the same name, so deletion can be
- done with refcounting. Also now throws some kind of error if you
- don't actually get the name you requested, unlike previously...
-
- * test/python/test-client.py: Add tests for instance caching of buses
- and bus name objects.
-
-2005-11-04 Robert McQueen <robot101@debian.org>
-
- * python/dbus_bindings.pyx, test/python/test-client.py: Fix
- marshalling of boolean values. Add some booleans to the values in
- the test client.
-
- * python/decorators.py, python/service.py: Add an 'async_callbacks'
- argument to the dbus.service.method decorator, which allows you to
- name arguments to take two callback functions for replying with
- return values or an exception.
-
- * test/python/test-client.py, test/python/test-service.py: Add test
- case using asynchronous method reply functions, both return values and
- errors, and from within both the function itself and from a mainloop
- callback.
-
- * python/decorators.py, python/service.py: Perform checking that the
- number of method/signal arguments matches the number of types in the
- signature at class loading time, not when you first introspect the
- class.
-
- * python/service.py: Remove debug print left by the last commit.
-
-2005-11-03 Robert McQueen <robot101@debian.org>
-
- * python/service.py: Heavy refactoring of method invocation, with
- hopefully no effect on functionality. Nuked _dispatch_dbus_method_call
- in favour of a new _message_cb that uses seperate functions for
- looking up the method to call, marshalling the return values, and
- sending exceptions as errors, and is easier to follow as a
- consequence. Fixes some corner cases about returning things that
- don't match your declared out_signature, allows exceptions to define
- _dbus_error_name and have it be sent over the bus as the error name,
- and paves the way for cool stuff like heeding the message no reply
- flag, asynchronous method implementations, informing the method of the
- sender, and including backtraces in the error messages.
-
- * test/python/test-client.py: Catch and print exceptions thrown in the
- async callback tests, rather than passing them to the low-level
- bindings to be ignored in a noisy and frustrating manner.
-
-2005-11-03 Robert McQueen <robot101@debian.org>
-
- * python/_dbus.py, python/proxies.py, python/service.py: Add __repr__
- functions to dbus.Bus, dbus.service.BusName and dbus.service.Object,
- tweak others to be consistent.
-
- * test/python/test-client.py: Tweak output of testInheritance.
-
-2005-10-29 Robert McQueen <robot101@debian.org>
-
- * python/service.py: Major changes to allow multiple inheritance
- from classes that define D-Bus interfaces:
-
- 1. Create a new Interface class which is the parent class of
- Object, and make the ObjectType metaclass into InterfaceType.
-
- 2. Patch written with Rob Taylor to replace use of method_vtable
- with code that walks the class's __MRO__ (method resolution order)
- to behave like Python does when invoking methods and allow
- overriding as you'd expect. Code is quite tricky because
- we have to find two methods, the one to invoke which has the
- right name and isn't decorated with the /wrong/ interface,
- and the one to pick up the signatures from which is decorated
- with the right interface.
-
- The same caveats apply as to normal multiple inheritance -
- this has undefined behaviour if you try and inherit from two
- classes that define a method with the same name but are
- decorated with different interfaces. You should decorate
- your overriding method with the interface you want.
-
- 3. Replace grungy introspection XML generation code in the metaclass
- with dictionaries that cope correctly with multiple inheritance
- and the overriding of methods. This also uses the signature
- decorations to provide correct introspection data, including
- the debut appearance of the types of your return values. :D
-
- * test/python/test-client.py, test/python/test-service.py: Add a test
- case to try invoking an method that overrides one inherited from a
- D-Bus interface class.
-
-2005-10-29 Robert McQueen <robot101@debian.org>
-
- * python/dbus_bindings.pyx: Tweak 'raise AssertionError' to assert().
- Add checking for the end of struct character when marshalling a
- struct in MessageIter.append_strict.
-
- * python/examples/example-service.py,
- python/examples/gconf-proxy-service.py,
- python/examples/gconf-proxy-service2.py: Update to use gobject
- mainloop directly rather than appearing to depend on gtk.
-
- * python/test/test-client.py, python/test/test-server.py: Remove
- obsolete and broken test scripts for old bindings. We have up to date
- and working tests in test/python/.
-
-2005-10-29 Robert McQueen <robot101@debian.org>
-
- * python/decorators.py: Add optional arguments to the method and
- signal decorators to allow you to specify the signature of arguments
- and return values. Preserve the doc strings of signal functions in the
- decorated version, for pydoc and friends.
-
- * python/dbus_bindings.pyx, python/proxies.py: Replace the
- parse_signature_block function with an iterable dbus.Signature()
- type. Fix a bug in MessageIter.append_strict where you could append
- anything by claiming it was a string.
-
- * python/service.py: Use the out_signature decoration on methods to
- marshal return values, meaning you no longer require dbus.Array()
- or dbus.Dictionary() to indicate the type when returning empty
- arrays or dictionaries. Fix a bug where exceptions which are defined
- in __main__ are not turned into error replies.
-
- * test/python/test-client.py, test/python/test-service.py: Add test
- for correct marshalling of return values according to out_signature.
- Fix a bug in the async call test where the error_handler is missing a
- self argument.
-
-2005-10-29 Robert McQueen <robot101@debian.org>
-
- * glib/Makefile.am, glib/examples/Makefile.am,
- glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by
- Daniel Stone to replace explicit calls to libtool with $(LIBTOOL).
-
- * test/python/.cvsignore: Add run-with-tmp-session-bus.conf.
-
- * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch
- from Ubuntu by Daniel Silverstone to allow specifying match rules on
- the command line.
-
-2005-10-27 Ross Burton <ross@openedhand.com>
-
- * dbus/dbus-marshal-header.c:
- Remove dead code.
-
- * glib/dbus-gobject.c:
- Stop compiler warning.
-
-2005-10-25 Ross Burton <ross@openedhand.com>
-
- * dbus/dbus-auth.c:
- * dbus/dbus-server-unix.c:
- * dbus/dbus-transport-unix.c:
- * glib/dbus-gmain.c:
- * glib/dbus-gobject.c:
- Add some const keywords.
-
-2005-10-25 Ross Burton <ross@openedhand.com>
-
- * doc/dbus-specification.xml:
- Document the NoReply annotation.
-
- * glib/dbus-binding-tool-glib.h:
- * glib/dbus-binding-tool-glib.c:
- Respect the NoReply annotation.
-
-2005-10-24 Robert McQueen <robot101@debian.org>
-
- * python/dbus_bindings.pyx (String, MessageIter): make D-Bus strings
- derive from unicode instead of str, and encode/decode UTF-8 when
- marshalling/unmarshalling bus messages
-
- * python/introspect_parser.py: encode introspection data as UTF-8
- before passing the buffer into libxml2
-
- * test/python/test-client.py: add unicode test strings
-
- * test/data/valid-service-files/.cvsignore, test/python/.cvsignore:
- ignore generated python test files
-
-2005-10-17 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdouble
- and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT)
- (gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble
-
- * glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing
- DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters
- when constructing struct signatures
-
- * python/_dbus.py (Bus): handle private connections using the
- private keyword in the constructor. defaults to private=False
- (Bus::close): new method to close a connection to the bus
-
- * python/dbus_bindings.pyx (Connection::close): renamed method
- was previously called disconnect
- (bus_get): now supports getting a private connection
-
- * python/proxies.py (ProxyMethod::__call__): check if ignore_reply
- keyword is set to True. if it is, execute the method without waiting
- for a reply
- (ProxyObject::_introspect_execute_queue): new method for executing
- all the pending methods that were waiting for the introspect to
- finish. this is called when introspect either succeeds or fails
- (ProxyObject::_introspect_error_handler): call queued methods
-
-2005-10-14 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx (MessageIter::append_strict): check for
- STRUCT_BEGIN not TYPE_STRUCT in indicate we are marshalling a struct
-
- * python/service.py (Object::_message_cb): handle exceptions correctly
- by sending them over the wire to the calling app. This makes sure
- the client returns immediately instead of waiting the 15 seconds to
- timeout.
-
- * test/python/test-client.py (TestDBusBindings::testBenchmarkIntrospect):
- Add a test to benchmark how long it takes to introspect a service and
- call a method which returns a large element (pretty fast)
-
- * test/python/test-service.py (TestObject::GetComplexArray): new test
- method which pushes a lot of data
-
-2005-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * python/service.py(ObjectType::_reflect_on_signal, _reflect_on_method):
- reclaim memory outside of the loop and use del istead of just setting
- the key to None
-
-2005-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * python/service.py (ObjectType::_reflect_on_signal): Always close
- signal tag even when there are no arguments
-
-2005-10-13 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: Set mono, mono-docs and Qt3 to default
- to no instead of auto when building. These bindings do not
- have full time maintainers and will not be supported for the
- 1.0 release.
-
-2005-10-12 John (J5) Palmieri <johnp@redhat.com>
-
- patches from Michael Krivoruchko <misha at sun.com>:
-
- * dbus/dbus-connection.c (_dbus_connection_queue_received_message_link,
- _dbus_connection_message_sent,
- _dbus_connection_send_preallocated_unlocked_no_update,
- _dbus_connection_pop_message_link_unlocked): handle the case when path
- is NULL when calling _dbus_verbose
-
- * configure.in: check for functions getpeerucred and getpeereid
-
- * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): provides
- support of auth EXTERNAL on Solaris 10+ (getpeerucred), FreeBSD 4.6+,
- OpenBSD 3.0+ and FreeBSD 5.0+ as well as MacOSX 10.2+ (getpeereid).
- Patch was only tested on Solaris 10 x86 so it might be issues
- with other platforms (i.e. BSDs and MacOSX)
-
-
-2005-10-05 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/dbus-gvalue.c (marshal_variant): call _dbus_gvalue_marshal
- instead of marshal basic so we can handle recursive types in a variant
-
- * test/glib/test-dbus-glib.c: Add test for marshaling recurive types
- in variants
-
- * test/glib/test-service-glib.c, test-service-glib.xml
- (my_object_echo_variant [EchoVariant],
- my_object_process_variant_of_array_of_ints123
- [ProcessVariantOfArrayOfInts123]):
- Add two test methods
-
- * python/introspect_parser.py: New module for parsing introspect
- data.
-
- * python/dbus_bindings.pyx:
- (various places): when throwing errors fix to use errormsg instead
- of message local variable because Pyrex can get confused with other
- message variables (initial patch by Robert McQueen
- <robert.mcqueen at collabora.co.uk>)
- (MessageIter::parse_signature_block): new method for getting the next
- block in a signiture.
- (MessageIter::append_strict): new method for appending values strictly
- using the passed in signature instead of guessing at the type
- (MessageItter:: append_dict, append_struct, append_array): use
- signatures to marshal children if the signature is available
-
- * python/exceptions.py (IntrospectionParserException): new exception
-
- * python/proxies.py (ProxyMethod::__call__): Marshal args with
- introspected signatures if available, else we fall back to the
- old way of doing things.
- (ProxyObject::_introspect_reply_handler ): parse introspection data
-
- * python/service.py (ObjectType::_reflect_on_method): Properly
- terminate <method> if there are no args in the reflection data
-
- * test/python/test-client.py: add tests for talking with the GLib
- test server. This gives us better coverage for introspection since
- python to python will always generate arguments as variants. It also
- allows us to test the robustness of the GLib bindings and interlanguage
- communications.
-
-
-2005-10-03 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/driver.c (bus_driver_handle_introspect): Add signals
- to the introspect data. (patch from Daniel P. Berrange
- <dan at berrange.com>)
-
- * bus/dispatch.c (check_existent_ping): Add testcase for Ping
-
- * dbus/dbus-connection.c (_dbus_connection_peer_filter,
- _dbus_connection_run_builtin_filters): Changed these to
- be unlock_no_update functions and call
- _dbus_connection_send_unlocked_no_update instead of
- dbus_connection_send to avoid locking errors.
-
- * doc/TODO: Removed the make Ping test TODO
-
-2005-09-26 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/Python.pyx: Fixed memory leaks when throwing errors.
- We now copy the message from a DBusError and then free
- the error object befor throwing the error
-
- * glib/dbus-glib-tool.c: removed extra comma at the end of the
- DBusBindingOutputMode enum which was causing a warning.
- #include <time.h> so using time_t is explicitly defined
-
-2005-09-26 John (J5) Palmieri <johnp@redhat.com>
-
- * Integrate patches from Lennart Poettering <mzsqb at 0pointer.de>:
- - dbus/dbus-bus.c
- (internal_bus_get): new method that take over the heavy lifting
- of dbus_bus_get and adds the ability to get a private connection
- to the bus
- (dbus_bus_get): wrapper to internal_bus_get that provides the same
- interface as in previous versions
- (dbus_bus_get_private): new method that is a wrapper to
- internal_bus_get to get a private connection to the bus
-
- - dbus/dbus-bus.h
- (dbus_bus_get_private): add as a public libdbus interface
-
- - dbus-1.pc.in: output system_bus_default_address and
- sysconfdir variables so apps can use them when compiling
-
-2005-09-23 Harald Fernengel <harry@kdevelop.org>
- * dbus/qt: New Qt bindings
-
-2005-09-12 Waldo Bastian <bastian@kde.org>
-
- * dbus/dbus-marshal-validate.c,
- doc/dbus-specification.xml, test/Makefile.am,
- test/test-names.c: allow hyphens in bus names.
-
-2005-09-11 Mark McLoughlin <mark@skynet.ie>
-
- * test/data/auth/fallback.auth-script: we don't
- retry the EXTERNAL method when we know its going
- to fail anymore.
-
-2005-09-11 Mark McLoughlin <mark@skynet.ie>
-
- * dbus/dbus-connection-internal.h: rename
- (add|remove|toggle)_(watch|timeout) to unlocked()
-
- * dbus/dbus-connection.c: ditto.
-
- * dbus/dbus-timeout.c, dbus/dbus-transport-unix.c:
- Update some callers for the renaming.
-
-2005-09-10 Mark McLoughlin <mark@skynet.ie>
-
- * dbus/dbus-auth.c: (record_mechanisms): don't
- retry the first auth mechanism because we know
- we're just going to get rejected again.
-
- * dbus/dbus-keyring.c: (_dbus_keyring_reload):
- Fix thinko ... and what a nasty little bugger to
- track down you were ...
-
- * dbus/dbus-connection.c:
- (_dbus_connection_add_watch),
- (_dbus_connection_remove_watch): add note about
- these needing the connection to be locked.
- (_dbus_connection_get_dispatch_status_unlocked):
- set status to DATA_REMAINS when we queue the
- disconnected message.
-
- * bus/dispatch.c:
- (bus_dispatch): fix warning.
- (check_existent_service_no_auto_start):
- Expect ChildSignaled error too.
- (check_existent_hello_from_self): fix another
- couple of warnings.
-
-2005-09-08 Joe Shaw <joeshaw@novell.com>
-
- Patches from James Willcox <snorp@snorp.net>
-
- * mono/Makefile.am: Add Int16.cs and UInt16.cs
-
- * mono/DBusType/Array.cs: Handle multidimensional arrays, and
- support array "out" parameters.
-
- * mono/DBusType/Int16.cs, mono/DBusType/UInt16.cs: New files,
- for 16-bit int support.
-
-2005-09-06 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 0.50
-
- * Patch from Steve Grubb:
- - bus/activation.c (bus_activation_service_reload_test): clean up
- some indentation
- - dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional
- - dbus/dbus-message-factory.c (generate_special): fix a couple of
- buffer overflows in the test suite. This is non critical because
- it can not be exploited and this code is only run when doing a
- make check.
-
- * Patch from Yaakov Selkowitz: Build fixes for Cygwin
- - configure.in: Don't check and link against kdecore, only qt headers
- - dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS
- - gcj/org/freedesktop/dbus/Makefile.am:
- add libdbus_gcj_1_la_LDFLAGS = -no-undefined
- - glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS
- and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD
- - qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS
- - tools/Makefile.am: Add platform extentions to binaries
- (i.e. .exe on windows)
-
- * configure.in:
- - Make it so if no suitable version of python is found we only
- disable building python instead of exiting the configure script
- - Require version 2.4 of glib for glib bindings
- - Up version to 0.50
-
- * python/__init__.py: Sync version with libdbus to (0,50,0)
-
-2005-09-05 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-object-tree.c (find_subtree_recurse):
- a couple of optimizations (bug #710):
- - do a binary search in the tree
- - insert a new child at the right place directly, no need for
- qsort anymore
- - do the "double alloc" thing when allocating children
-
-2005-08-31 John (J5) Palmieri <johnp@redhat.com>
-
- * python/Makefile.am: Break on pyrexc errors instead of ignoring them
-
- * python/dbus_bindings.pyx: Memory management foo
- (global): remove hacky _user_data_references global list
- (GIL_safe_cunregister_function_handler): userdata now stuffed into
- tuples. Unref user_data
- (GIL_safe_cmessage_function_handler): userdata now stuffed into tuples
- (Connection::__del__): Remove and replace with __dealloc__ method
- (Connection::add_filter): Stuff user_data into a tuple. Use Py_INCREF
- to keep tuple from being deallocated instead of the global var hack
- (Connection::register_object_path): Stuff user_data into a tuple.
- Use Py_INCREF to keep tuple from being deallocated instead of the
- global var hack
- (Connection::register_fallback): Stuff user_data into a tuple.
- Use Py_INCREF to keep tuple from being deallocated instead of the
- global var hack
- (GIL_safe_pending_call_notification): Don't unref the message
- because it gets unreffed when going out of scope. Py_XDECREF
- the user_data
- (PendingCall::__del__): Remove and replace with __dealloc__ method
- (PendingCall::set_notify): ref the pending call because we will
- need it to stick around for when the notify callback gets called
- (Message::__del__): Remove and replace with __dealloc__ method
-
- * python/dbus_glib_bindings.pyx (init_gthreads): Changed to
- gthreads_init to match up with the dbus call
-
- * python/glib.py (init_threads): Changed to threads_init to match
- up with gobject.threads_init(). init_threads is kept for backwards
- compat but will most likely be deprecated in the future
-
- * test/python/test-client.py:
- - revamp to use Python's unittest functionality
- - add async call tests
- - setup threads in glib and dbus so we make sure locks are working
-
-2005-08-30 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx
- (_pending_call_notification, cunregister_function_handler,
- cmessage_function_handler): All callback functions have been rearranged
- to workaround a bug in Pyrex when working with the GIL which is Python's
- global lock when dealing with threads. They have been split into
- a wrapper function (which assumes the name of the old function) and
- a _GIL_safe_<function name> function which contains the functionality
- of the old function. This ensures that Pyrex does not write code
- the lock is released.
-
-
-2005-08-30 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx (_pending_call_notification): Obtain the
- GIL global lock when calling back into Python
-
-2005-08-29 John (J5) Palmieri <johnp@redhat.com>
-
- * Release 0.36.2
-
- * Add Havoc's patch that never got applied to HEAD (Bug #2436):
-
- * bus/policy.c (bus_policy_allow_user): change default "user is
- allowed" to be "user has same uid as the bus itself"; any
- allow/deny rules will override.
-
- * bus/session.conf.in: don't allow all users, since now by default
- the user that ran the bus can connect.
-
-2005-08-26 Colin Walters <walters@verbum.org>
-
- * tools/dbus-print-message.c (print_message): Flush stdout
- after printing a message, so that redirecting to a file, then
- hitting Ctrl-C works.
-
-2005-08-25 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx: Tracked down a major memleak and fixed it
- (EmptyMessage): new class that subclasses Message. This is a workaround
- to a Pyrex bug that fails to call __del__ when the Message object goes out
- of scope. For some reason subclassing Message fixes this bug
- (Bus::send_with_reply_and_block): use EmptyMessage instead of Message
- - s/Message(_create=0)/EmptyMessage everywhere else
-
- * test/python/test-{server|client}.py: add the python/.libs directory
- to the lookup path so dbus_bindings and dbus_glib_bindings don't
- get picked up from the system
-
-2005-08-25 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_call): Doc update, thanks
- to Ryan Lortie for the suggestion.
-
-2005-08-24 John (J5) Palmieri <johnp@redhat.com>
-
- * test/python: Add python regression test
-
- * configure.in: Add test/python/Makefile
-
- * test/Makefile.am: Add the python directory to SUBDIRS
-
-2005-08-24 John (J5) Palmieri <johnp@redhat.com>
-
- * Release 0.36.1
-
- * python/_dbus.py:
- (Interface::connect_to_signal): propigate keywords for match on args
- (Bus::add_signal_receiver): Fix typo s/dbus_inteface/dbus_interface
-
- * python/proxies.py (ProxyObject::connect_to_signal):
- propigate keywords for match on args
-
- * Makefile.am: point everything to pyexecdir since python borks
- on multilib
-
-2005-08-23 John (J5) Palmieri <johnp@redhat.com>
-
- * Release 0.36
-
-2005-08-23 Colin Walters <walters@verbum.org>
-
- * test/glib/Makefile.am: Don't multiply-define EXTRA_DIST.
-
-2005-08-23 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_glib_bindings.pyx: reorder imports and c definitions
- to fix some wranings. We now use dbus_bindings.DBusConnection instead
- of defining DBusConnection ourselves.
-
-2005-08-18 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus.pth: New path file to fix up problems when installing
- c libraries to lib64 and python files to lib.
-
- * python/Makefile.am: install dbus.pth in the correct spot
-
-2005-08-17 John (J5) Palmieri <johnp@redhat.com>
- * ChangeLog: clean up my last entry a bit
-
- * doc/introspect.xsl: New stylesheet for converting introspection data
- into browser renderable xhtml. Contributed by Lennart Poettering.
-
- * doc/introspect.dtd: Fixups in the introspect format from Lennart
- Poettering.
-
- * doc/dbus-tutorial.xml:
- - Add Colin Walter to the Authors section for authoring the GLib
- section
- - Add descriptions of the new signature and type functionality
- in the Python complex type mapping section
- - Add a sidenote on the new args matching functionality in
- the Python bindings
- - Fixed up some of the examples to use the gobject.MainLoop
- instead of gtk.main
-
- * python/_dbus.py:
- (Bus::_create_args_dict): New. Converts a hash of arg matches
- to a more useable format
- (Bus::add_signal_receiver): add a **keywords parameter for catching
- arg match parameters
- (Bus::remove_signal_receiver): add a **keywords parameter for catching
- arg match parameters
-
- * python/matchrules.py:
- (MatchTree::exec_matches): Check for arg matches
- (SignalMatchRule::add_args_match): New method
- (SignalMatchRule::execute): Added args_list parameter as an optimization
- so we don't have to marshal the args more than once
- (SignalMatchRule::match_args_from_list): New method that checks to see
- if the rule's arg matches match an argument list. Only arguments
- set in the rule are checked.
- (SignalMatchRule::match_args_from_rule): New method that checks to see
- if the rule's arg matches match another rule's. All args have to match
- in order for this method to return true. If either rule has more args
- then it is not a match.
- (SignalMatchRule::is_match): Add args match
- (SignalMatchRule::repr): Add args to the final output if they exist
-
-2005-08-17 Ross Burton <ross@burtonini.com>
-
- * glib/dbus-gproxy.c:
- (dbus_g_proxy_call_no_reply): unref the message once sent.
- (dbus_g_proxy_call): protect against NULL proxy.
-
-2005-08-16 John (J5) Palmieri <johnp@redhat.com>
-
- * python/__init__.py: Version updated (0, 43, 0)
-
- * python/dbus_bindings.pyx:
- - Fixed type objects to have self passed into __init__
- - Added the Variant type
- - Add the ability to specify types or signatures for Array, Variant
- and Dictionary
- (Connection::send_with_reply_handlers): return a PendingCall object
- (_pending_call_notification): handle the case when an error is returned
- without an error message in the body
- (MessageIter::get_boolean): return True or False instead of an integer
- (MessageIter::python_value_to_dbus_sig): add direct checking of types
- and add checks for objects with embeded signatures or types (Array,
- Variant and Dictionary)
- (MessageIter::append_byte): handle case when the value is a dbus.Byte
- (MessageIter::append_dict): handle embeded types or signatures
- (MessageIter::append_array): handle embeded types or signatures
- (MessageIter::append_variant): new method
-
- * python/proxies.py:
- (DeferedMethod): New. Dummy executable object used when queuing calls
- blocking on introspection data
- (ProxyMethod::__call__): add the timeout keyword for specifying longer
- or shorter timeouts for method calls
- (ProxyObject): Add first pass at an introspection state machine
- (ProxyObject::__init__): Add introspect keyword for turing off an on
- introspection.
- (ProxyObject::_Introspect): Internal Introspect call that bypasses
- the usual mechanisms for sending messages. This is to avoid a deadlock
- where the Intospect call would be queued waiting for the Introspect
- call to finish ;-)
- (ProxyObject::_introspect_reply_handler): New. This method is called
- when introspection returns with no error
- (ProxyObject::_introspect_error_handler): New. This method is called
- when introspection encounters an error
- (ProxyObject::__getattr__): Code to handle different introspection
- states. Queue async calls or block blocking calls if we are
- introspecting. Pass through as normal if we are not or are done with
- introspecting.
-
- * python/service.py: Import signal and method from decorators.py
-
- * python/types.py: Add Variant type
-
-2005-08-16 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gobject.c (dbus_set_g_error): Don't lose if the
- DBusError message is NULL.
-
-2005-08-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-errors.c: apply patch from Timo Teras to make a
- malloc'd copy of the name parameter
-
-2005-08-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_set_reply_serial): print
- warning if the reply serial is set to 0
-
-2005-08-04 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gvalue-utils.h (_dbus_g_type_specialized_builtins_init)
- (dbus_g_type_is_fixed, dbus_g_type_fixed_get_size)
- (dbus_gvalue_set_from_pointer, dbus_g_hash_table_value_foreach)
- (dbus_g_hash_table_insert_values, dbus_g_hash_table_insert_steal_values)
- (dbus_gtype_is_valid_hash_key, dbus_gtype_is_valid_hash_value)
- (dbus_g_hash_func_from_gtype, dbus_g_hash_free_from_gtype)
- (dbus_g_hash_equal_from_gtype, dbus_gvalue_stor, dbus_gvalue_take):
- * glib/dbus-gvalue.h (dbus_g_value_types_init)
- (dbus_gvalue_demarshal, dbus_gvalue_demarshal_variant)
- (dbus_gvalue_demarshal_message, dbus_gvalue_marshal):
-
- Prefix name with _ to ensure they're not exported. All callers
- updated.
-
- * glib/dbus-gvalue.c (typecode_to_gtype)
- (dbus_typecode_maps_to_basic, basic_typecode_to_gtype)
- (signature_iter_to_g_type_dict)
- (signature_iter_to_g_type_array)
- (dbus_gtype_from_signature_iter, dbus_gtype_from_signature)
- (dbus_gtypes_from_arg_signature):
- Move to dbus-gsignature.c.
-
- * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call
- dbus_g_type_specialized_builtins_init instead of dbus_g_value_types_init.
- (dbus_binding_tool_output_glib_client): Ditto.
-
- * glib/Makefile.am (DBUS_GLIB_INTERNALS): Add dbus-gsignature.c
- and dbus-gsignature.h
-
- * test/glib/test-service-glib.c (my_object_rec_arrays): Delete
- unused variable.
-
-2005-08-03 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gobject.c: Add tests on hardcoded object info; this should
- catch any incompatible changes accidentally made.
-
-2005-08-03 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): fix
- typo, from Julien Puydt
-
- * bus/connection.c (bus_connection_disconnected): we were always
- doing a wait_for_memory due to a buggy loop, found by Timo Hoenig
-
-2005-08-01 Colin Walters <walters@verbum.org>
-
- Patch from Joe Markus Clarke:
-
- * glib/dbus-gidl.c (property_info_unref, arg_info_unref): Fix
- use-after-free.
-
-2005-08-01 Colin Walters <walters@verbum.org>
-
- Patch from Joe Markus Clarke:
-
- * tools/dbus-send.c (main):
-
- Don't use C99 style initializers (bug #3933).
-
-2005-08-01 Colin Walters <walters@verbum.org>
-
- Patch from Joe Markus Clarke:
-
- * glib/dbus-gvalue.c (dbus_g_value_types_init):
- * glib/dbus-gvalue-utils.c (dbus_g_type_specialized_builtins_init)
- * glib/dbus-gobject.c (write_interface):
-
- Don't use C99 style initializers (bug #3933).
-
-2005-07-31 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-viewer.c (load_child_nodes): fix invocation of
- dbus_g_proxy_call, fix from Piotr Zielinski bug #3920
-
-2005-07-30 Havoc Pennington <hp@redhat.com>
-
- * fix a bunch of Doxygen warnings and mistakes
-
-2005-07-30 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_string_parse_uint): remove #ifdef
- DBUS_BUILD_TESTS since it's now used in production code
-
-2005-07-29 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c (write_junk): initialize the junk
- buffer so valgrind doesn't have a breakdown
-
-2005-07-29 Havoc Pennington <hp@redhat.com>
-
- * bus/signals.c (bus_signals_test): add match_rule_equal() tests
- (match_rule_matches): remove unused arg
- (test_matching): add tests for match_rule_matches()
-
- * bus/signals.c (bus_match_rule_parse_arg_match): add ability to
- do arg0='foo' arg5='bar' in the match rules
- (match_rule_matches): don't match if the arg0='foo' doesn't match.
-
- * dbus/dbus-protocol.h (DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER): add this
-
-2005-07-29 Ross Burton <ross@openedhand.com>
-
- * dbus/dbus-connection.c:
- Don't create a DBusCondVar which is never used.
-
-2005-07-27 Ross Burton <ross@openedhand.com>
-
- * dbus/dbus-message.c:
- Reduce the size of the maximum cached message to 10K.
-
-2005-07-25 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gproxy.c:
- Remove matches when all proxies are unregistered.
-
-2005-07-24 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gvalue.c (signature_iter_to_g_type_array): Don't require
- typedata; recursive arrays won't have it.
-
- * test/glib/test-dbus-glib.c:
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml: Add recursive arrays tests.
-
-2005-07-20 John (J5) Palmieir <johnp@redhat.com>
-
- * python/_dbus.py, _util.py, decorators.py, extract.py, matchrules.py.
- proxies.py, service.py: Cleanup of code after running it through the
- pyflakes code checker mostly dealing with undefined names.
- (Bug #3828, Patch from Anthony Baxter <anthony@interlink.com.au>)
-
-2005-07-17 John (J5) Palmieri <johnp@redhat.com>
-
- * NEWS: Update to 0.35.2
-
-2005-07-17 John (J5) Palmieri <johnp@redhat.com>
-
- * python/_dbus.py: Remove import of the dbus.services
- module as it no longer exists (patch from Dimitur Kirov)
-
- * python/service.py (Object::__init__): Fixed typo
- s/name/bus_name (patch from Dimitur Kirov)
-
- * python/examples/example-signal-emitter.py: import dbus.glib
- to get the main loop and use glib mainloop instead of gtk so
- X doesn't have to be running.
-
- * python/examples/example-signal-recipient.py: import dbus.glib
- to get the main loop and use glib mainloop instead of gtk so
- X doesn't have to be running. Import the decorators module
- directly.
-
- * test/glib/Makefile.am: Added DIST_EXTRA files that distcheck
- didn't pick up on but are needed to build
-
- * configure.in: upped version to 0.35.2
-
- * bus/driver.c, bus/selinux.c, bus/selinux.h, dbus/dbus-protocol.h:
- added Colin Walters' SELinux API rename patch from head
- s/unix sercurity context/selinux security context/
-
-2005-07-16 John (J5) Palmieri <johnp@redhat.com>
-
- * python/Makefile.am: dbus_binding.pxd.in should be included
- in EXTRA_DIST not dbus_binding.pxd
- fix up $(srcdir) hopefully for the last time
-
- * NEWS: Update to 0.35.1
-
-2005-07-16 Colin Walters <walters@verbum.org>
-
- * bus/driver.c (bus_driver_handle_get_connection_selinux_security_context): Renamed
- from bus_driver_handle_get_connection_unix_security_context. Update for
- error usage.
- (message_handlers): Update for renames.
-
- * bus/selinux.c (bus_selinux_allows_send): Handle OOM on
- _dbus_string_init failure correctly.
- (bus_selinux_append_context): Convert SID to context. Append it
- as a byte array.
- (bus_selinux_shutdown): Handle the case where bus_selinux_full_init
- hasn't been called.
-
- * bus/selinux.h: Update prototype.
-
- * dbus/dbus-protocol.h (DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN): Renamed
- from DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN.
-
-2005-07-15 Colin Walters <walters@verbum.org>
-
- * doc/TODO: Add note about convenience wrappers.
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * NEWS: Update to 0.35
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/Makefile.am: Add make-dbus-glib-error-switch.sh to EXTRA_DIST
- so distcheck doesn't fail
-
- * glib/examples/Makefile.am: Add example-service.xml and
- example-signal-emitter.xml to EXTRA_DIST so distcheck doesn't fail
-
- * glib/examples/statemachine/Makefile.am: Add statemachine.xml and
- statemachine-server.xml to EXTRA_DIST so distcheck doesn't fail
-
- * python/Makefile.am: Preprend $(srcdir)/ to source files so the
- compiler looks in the right places during distcheck
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/example/Makefile.am: Fix a typo which cause make distcheck
- to fail
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * python/examples/example-service.py,
- python/examples/example-signal-emitter.py: Fixed up examples
- for API changes
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * python/__init__.py: Upped to version (0,42,0) because of
- the API change
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * ChangeLog: fix date in last entry
-
- * configure.in, bus/system.conf.in: add the ability to configure
- the system bus user at compiletime with the --with-dbus-user flag
- (patch from Kristof Vansant)
-
-2005-07-15 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/dispatch.c, test/test-service.c: Add testcase
- for sending messages to oneself (TODO item).
-
- * python/service.py (class Object): Swap ordering of bus_name
- and object_path parameters to better support inheritance.
-
- * doc/dbus-tutorial.xml: change Python docs to reflect change
- in parameter ordering and fix the inheritance section.
-
- * doc/TODO: remove sending message to oneself TODO item
-
-2005-07-15 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gproxy.c:
- Fix a leak when calling methods via the proxy.
-
-2005-07-15 Colin Walters <walters@verbum.org>
-
- * bus/selinux.c (bus_selinux_append_context): Wrap in
- HAVE_SELINUX.
-
-2005-07-14 John (J5) Palmieri <johnp@redhat.com>
-
- * python/_dbus.py (Bus::remove_signal_receiver):
- don't add a callback to the match if none has been passed in
-
- * python/matchrules.py (SignalMatchTree::remove): if the rule
- being matched does not have a callback treat it as a wildcard
- fix matching logic
-
- * doc/dbus-tutorial.xml: Add Python tutorial
-
-2005-07-14 Colin Walters <walters@verbum.org>
-
- * bus/driver.c
- (bus_driver_handle_get_connection_unix_security_context): New function.
- (message_handlers): Add.
-
- * bus/selinux.c (bus_selinux_append_context): New function; appends
- security context to message.
-
- * bus/selinux.h: Prototype.
-
- * dbus/dbus-protocol.h (DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN): New.
-
-2005-07-14 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/activation.c: clean up all tabs to be 8 spaces
- (bus_activation_activate_service): make sure we clean up
- if activation fails
-
- * bus/dispatch.c: clean up all tabs to be 8 spaces
- (check_shell_fail_service_auto_start): New function
- tests to make sure we get fail properly when trying to auto start a service
- with a faulty command line
- (check_shell_service_success_auto_start): New function tests to make sure
- auto started services get the arguments on the command line
-
- * test/test-shell-service.c: Added service for testing auto-starting with
- command line arguments
-
- * test/data/valid-service-files/debug-shell-echo-fail.service.in,
- test/data/valid-service-files/debug-shell-echo-success.service.in:
- Added service files for testing auto-starting with command line arguments
-
- * */.cvsignore: added a bunch of generated files to various .cvsignore files
-
-2005-07-14 Rodrigo Moya <rodrigo@novell.com>
-
- * dbus/dbus-shell.[ch]: copy/pasted code from GLib.
-
- * dbus/Makefile.am: added new files to build.
-
- * bus/activation.c (bus_activation_activate_service): support
- activation commands with parameters.
-
- * test/shell-test.c: added test program for the shell parsing
- code.
-
-2005-07-13 David Zeuthen <davidz@redhat.com>
-
- * tools/dbus-send.c (append_arg, type_from_name): Also support 16 and
- 64 bit signed and unsigned parameters
-
-2005-07-13 John (J5) Palmieri <johnp@redhat.com>
-
- * python/.cvsignore: remove dbus_bindings.pyx, add dbus_bindings.pxd
-
- * python/service.py (class Name): renamed BusName to make it clearer
- what the object is for (a name on the bus)
-
- * python/examples/example-service.py,
- python/examples/example-signal-emitter.py: change the Name object to
- BusName
-
-2005-07-12 Colin Walters <walters@verbum.org>
-
- Patch from Jim Gettys <Jim.Gettys@hp.com>.
-
- * tools/dbus-launch.c: Include sys/select.h.
-
-2005-07-12 John (J5) Palmieri <johnp@redhat.com>
- * python/dbus_bindings.pyx.in: removed
-
- * python/dbus_bindings.pyx: Added.
- - Fixed some memleaks (patch from
- Sean Meiners <sean.meiners@linspireinc.com>)
- - Broke out the #include "dbus_h_wrapper.h" and put it in its
- own pxd file (Pyrex definition)
- - Broke out glib dependancies into its own pyx module
-
- * python/dbus_bindings.pdx: Added.
- - Defines C class Connection for exporting to other modules
-
- * python/dbus_glib_bindings.pyx: Added.
- - New module to handle lowlevel dbus-glib mainloop integration
-
- * python/glib.py: Added.
- - Registers the glib mainloop when you import this module
-
- * python/services.py: Removed (renamed to service.py)
-
- * python/service.py: Added.
- - (class Server): renamed Name
-
- * python/__init__.py: Bump ro version (0,41,0)
- -don't import the decorators or service module
- by default. These now reside in the dbus.service namespace
-
- * python/_dbus.py (Bus::__init__): Add code run the main loop
- setup function on creation
-
- * python/examples/example-service.py,
- python/examples/example-signal-emitter.py: update examples
-
- * python/examples/gconf-proxy-service.py,
- python/examples/gconf-proxy-service2.py: TODO fix these up
-
- * doc/TODO: Addition
- - Added a Python Bindings 1.0 section
- - added "Add match on args or match on details to match rules"
-
-
-2005-07-12 Colin Walters <walters@verbum.org>
-
- * glib/examples/statemachine/Makefile.am (statemachine-server-glue.h)
- (statemachine-glue.h):
- * glib/examples/Makefile.am (example-service-glue.h)
- (example-signal-emitter-glue.h):
- * glib/Makefile.am (dbus-glib-error-switch.h):
- Add libtool --mode=execute so we use the built library instead
- of any installed one.
-
-2005-07-11 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gvalue.c (struct _DBusGValue): Delete.
- (dbus_g_value_types_init): Remove assertion.
- (dbus_g_value_get_g_type, dbus_g_value_open)
- (dbus_g_value_iterator_get_values, dbus_g_value_get_signature)
- (dbus_g_value_copy, dbus_g_value_free): Delete unimplemented
- functions related to DBusGValue. Now we marshal/demarshal
- structures as GValueArray.
- (dbus_gtype_from_signature_iter): Return G_TYPE_VALUE_ARRAY for
- structures.
- (signature_iter_to_g_type_array): Don't call
- signature_iter_to_g_type_struct.
- (signature_iter_to_g_type_struct): Delete.
- (dbus_gvalue_to_signature): Delete.
- (dbus_gvalue_to_signature): New function with same name as other
- one; we can convert structures to signatures.
- (demarshal_valuearray): New function.
- (get_type_demarshaller): Use it.
- (demarshal_recurse): Delete.
- (marshal_proxy): New function.
- (marshal_map): Warn if we can't determine signature from type.
- (marshal_collection_ptrarray): Ditto.
- (marshal_collection_array): Ditto.
- (get_type_marshaller): Use marshal_valuearray.
- (marshal_recurse): Delete.
- (_dbus_gvalue_test): Add some tests.
-
- * dbus/dbus-glib.h (struct _DBusGValueIterator):
- (dbus_g_value_get_g_type, DBUS_TYPE_G_VALUE)
- (dbus_g_value_open, dbus_g_value_iterator_get_value)
- (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse)
- (dbus_g_value_free): Remove prototypes.
-
- * glib/dbus-binding-tool-glib.c (dbus_g_type_get_lookup_function): Handle
- G_TYPE_VALUE_ARRAY.
-
- * glib/examples/example-service.c:
- * glib/examples/example-client.c: Implement GetTuple.
-
- * test/glib/test-dbus-glib.c:
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml: Add structure tests.
-
-2005-07-10 Colin Walters <walters@verbum.org>
-
- * doc/TODO: Knock off some GLib items with this patch.
-
- * glib/dbus-gvalue-utils.c (_dbus_gtype_can_signal_error)
- (_dbus_gvalue_signals_error): New functions.
-
- * glib/dbus-gvalue-utils.h: Prototype them.
-
- * glib/dbus-gobject.c (arg_iterate): Update to handle return vals
- and change to not output const/retval flags for input args. All
- callers updated.
- (invoke_object_method): Refactor to handle return values. Add
- some more comments in various places. Remove debug g_print.
-
- * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_RETURNVAL): New.
-
- * glib/dbus-binding-tool-glib.c (dbus_g_type_get_marshal_name):
- Handle G_TYPE_NONE.
- (compute_gsignature): New function; refactored from code from
- compute_marshaller and compute_marshaller_name. Enhance to
- handle return values and async ops more cleanly. Update for
- async ops returning NONE instead of BOOLEAN.
- (compute_marshaller, compute_marshaller_name): Call compute_gsignature
- and output appropriate string.
- (generate_glue): Handle return value annotation. Also don't dump
- constness flag for input arguments.
-
- * glib/Makefile.am (DBUS_GLIB_INTERNALS): New variable; contains
- files shared between installed library and utilities.
- (libdbus_glib_1_la_SOURCES): Move some stuf into DBUS_GLIB_INTERNALS.
- (libdbus_gtool_la_SOURCES): Suck in DBUS_GLIB_INTERNALS so the
- binding tool can access gtype utility functions.
-
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml:
- * test/glib/test-dbus-glib.c: Add some tests for return values.
-
-2005-07-09 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gparser.c (parse_annotation): Add annotations to
- argument if available, not method.
-
- * glib/dbus-gobject.c (arg_iterate): More verbose warnings.
- (invoke_object_method): First, remove some redundant
- GValues (object_value, error_value) in favor of working on
- array directly. Second, rework constness to be less buggy.
- Now we iterate directly over the argument metadata instead
- of parallel iterating over output signature and metadata.
-
- * glib/dbus-glib-tool.h: Add INVALID_ANNOTATION error.
-
- * glib/dbus-binding-tool-glib.c (generate_glue): Barf on const
- annotation on input args.
-
-2005-07-09 Colin Walters <walters@verbum.org>
-
- * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_CONST):
- Define.
-
- * glib/dbus-binding-tool-glib.c (generate_glue): Handle Const
- annotation.
-
- * glib/dbus-gobject.c (arg_iterate): Update to parse constval too.
- (method_dir_signature_from_object_info): Handle arg_iterate change.
- (write_interface): Ditto.
- (lookup_object_info): Don't barf if format_version is > 0.
- (invoke_object_method): Handle arg constness.
-
- * glib/dbus-gidl.c (struct ArgInfo): Add annotations.
- (arg_info_new): Create.
- (arg_info_unref): Destroy.
- (arg_info_get_annotations, arg_info_get_annotation)
- (arg_info_add_annotation): New functions.
-
- * glib/dbus-gidl.h: Prototype them.
-
- * glib/dbus-gparser.c (parse_annotation): Allow annotations in
- args, disallow them in properties.
- (parse_annotation): Handle arg annotations.
-
- * test/glib/test-service-glib.xml:
- * test/glib/test-service-glib.c: Update to make some methods
- const.
-
-2005-07-08 Colin Walters <walters@verbum.org>
-
- * test/glib/test-service-glib.xml:
- * test/glib/test-service-glib.c:
- * test/glib/test-dbus-glib.c: Test a{sv}.
-
- * glib/examples/statemachine/statemachine.c:
- * glib/examples/statemachine/statemachine-server.c:
- * glib/examples/statemachine/statemachine-client.c: Fix some bugs,
- add progress bar, etc.
-
- * glib/dbus-gvalue.c (register_array, register_dict): Delete; not
- needed anymore due to generic array/map marshalling.
- (dbus_g_value_types_init): Don't register basic arrays or the
- string/string hash.
- (dbus_gtype_from_signature_iter): Don't try to recurse into
- variants.
- (dbus_gtype_to_signature): Check collection/map before type
- metadata.
- (demarshal_garray_basic): Renamed to demarshal_collection_array.
- (demarshal_ghashtable): Renamed to demarshal_map; fix to use new
- generic map creation/append functions instead of hash table
- specifically.
- (get_type_demarshaller): Handle maps.
- (demarshal_collection): Dispatch on collection type to either
- demarshal_collection_ptrarray or demarshal_collection_array.
- (get_type_marshaller): Handle maps.
- (marshal_collection): Dispatch collection type to either
- marshal_collection_ptrarray or marshal_collection_array.
- (_dbus_gvalue_test): New test.
-
- * glib/dbus-gvalue-utils.c (unset_and_free_g_value): New function.
- (hash_free_from_gtype): Use it to free GValues.
- (hashtable_append): New function.
- (ptrarray_append): Fix prototype.
- (slist_append): Ditto.
- (_dbus_gvalue_utils_test): Extend tests.
-
- * glib/dbus-gtype-specialized.c
- (dbus_g_type_specialized_init_append): Renamed from
- dbus_g_type_specialized_collection_init_append. Remove const from
- value, since we steal it.
- (dbus_g_type_specialized_map_append): New function.
-
- * glib/dbus-gtype-specialized.h: Update prototypes.
- Add DBusGTypeSpecializedMapAppendFunc.
-
- * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run
- _dbus_gvalue_test.
-
- * glib/dbus-gtest.h: Prototype it.
-
-2005-07-08 Ross Burton <ross@openedhand.com>
-
- * dbus/dbus-glib.h:
- Add DBysGAsyncData for the async bindings.
-
- * glib/dbus-binding-tool-glib.c:
- Re-enable the async bindings.
-
- * test/glib/test-dbus-glib.c:
- Add a test for the generated async bindings.
-
-2005-07-08 Colin Walters <walters@verbum.org>
-
- * doc/TODO: Update GLib todo bits, also add a post-1.0 TODO for a
- connection concept.
-
-2005-07-08 Colin Walters <walters@verbum.org>
-
- * tools/Makefile.am: Kill of print-introspect in favor of using
- dbus-send --print-reply=literal.
-
- * test/glib/test-service-glib.xml:
- * test/glib/test-service-glib.c (my_object_get_objs): New test
- for "ao".
-
- * test/glib/test-dbus-glib.c (echo_received_cb): Free echo data.
- (main): Test GetObjs.
-
- * glib/examples/statemachine/Makefile.am:
- * glib/examples/statemachine/sm-marshal.list:
- * glib/examples/statemachine/statemachine-client.c:
- * glib/examples/statemachine/statemachine-server.c:
- * glib/examples/statemachine/statemachine-server.xml:
- * glib/examples/statemachine/statemachine.c:
- * glib/examples/statemachine/statemachine.h:
- * glib/examples/statemachine/statemachine.xml:
-
- New example.
-
- * glib/examples/example-service.c (main): Move invocation
- of dbus_g_object_type_install_info earlier, to emphasize it
- should only be done once.
-
- * glib/examples/example-signal-emitter.c (main): Ditto.
-
- * glib/examples/Makefile.am (SUBDIRS): Include statemachine.
-
- * glib/dbus-gvalue.h (dbus_gtype_to_signature)
- (dbus_gvalue_marshal): Update prototypes.
-
- * glib/dbus-gvalue.c: Update all marshalling functions to take
- const GValue instead of GValue.
- (signature_iter_to_g_type_array): Return a GPtrArray for nonfixed
- types.
- (dbus_gvalue_to_signature): Update for dbus_gtype_to_signature
- change.
- (dbus_gtype_to_signature): Handle generic collecitons and maps.
- Return a newly-allocated string.
- (demarshal_proxy, demarshal_object_path, demarshal_object)
- (demarshal_strv, demarshal_ghashtable): Set error, don't assert if
- we get the wrong types from message.
- (get_type_demarshaller): New function, extracted from
- dbus_gvalue_demarshal.
- (demarshal_collection): New function, demarshals generic
- collection.
- (dbus_gvalue_demarshal): Just invoke result of
- get_type_demarshaller. Throw error if we don't have one.
- (marshal_garray_basic): Abort on OOM.
- (get_type_marshaller): New function, extracted from
- dbus_gvalue_marshal.
- (collection_marshal_iterator, marshal_collection): New functions;
- implements generic marshalling for an iteratable specialized
- collection.
- (dbus_gvalue_marshal): Just invoke result of get_type_marshaller.
-
- * glib/dbus-gvalue-utils.c (gvalue_from_ptrarray_value): Handle
- G_TYPE_STRING.
- (ptrarray_value_from_gvalue): Ditto.
- (ptrarray_append, ptrarray_free): New functions.
- (slist_constructor, slist_iterator, slist_copy_elt, slist_copy)
- (slist_append, slist_end_append, slist_free): New functions.
- (dbus_g_type_specialized_builtins_init): Add append fuctions
- for GPtrArray and GSList. Register GSList.
- (test_specialized_hash, _dbus_gvalue_utils_test): New functions.
-
- * glib/dbus-gtype-specialized.h (DBusGTypeSpecializedAppendContext):
- New.
- (dbus_g_type_specialized_collection_init_append)
- (dbus_g_type_specialized_collection_append)
- (dbus_g_type_specialized_collection_end_append): Prototype.
- (DBusGTypeSpecializedCollectionVtable): Add append_func and
- end_append_func.
-
- * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_collection_init_append)
- (dbus_g_type_specialized_collection_append)
- (dbus_g_type_specialized_collection_end_append): New functions.
- (dbus_g_type_map_value_iterate): Take const GValue.
- (dbus_g_type_collection_value_iterate): Ditto.
-
- * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run
- _dbus_gvalue_utils_test.
-
- * glib/dbus-gtest.h: Prototype it.
-
- * glib/dbus-gproxy.c (dbus_g_proxy_manager_filter): Avoid
- using uninitialized owner_list.
- (dbus_g_proxy_begin_call_internal): Move return_if_fail to
- public API.
- (dbus_g_proxy_end_call_internal): Update to use error set
- from dbus_gvalue_demarshal instead of setting it here.
- (dbus_g_proxy_begin_call): Move return_if_fail here.
-
- * glib/dbus-gobject.c (write_interface): Update for
- dbus_gtype_to_signature returning new string.
-
- * configure.in: Add glib/examples/statemachine.
-
-2005-07-08 Joe Shaw <joeshaw@novell.com>
-
- * configure.in: Add a configure option, --with-console-auth-dir
-
- * dbus/dbus-sysdeps-util.c (_dbus_user_at_console): Use the
- new setting. Patch from Kay Sievers.
-
-2005-07-06 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify)
- (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type)
- (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete.
- (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel):
- Delete in favor of dbus_g_proxy_begin_call and
- dbus_g_proxy_cancel_call.
- (DBusGProxyCall, DBusGProxyCallNotify): New.
- (dbus_g_proxy_begin_call): Change prototype to take callback, user
- data, and destroy function. This replaces
- dbus_g_pending_call_set_notify.
- (dbus_g_proxy_cancel_call): Prototype.
- (DBusGAsyncData): Delete, shouldn't be needed anymore.
-
- * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and
- pending_calls map.
- (struct _DBusGProxyManager): Add bus_proxy member, which is an
- internal proxy for calls to the bus. Remove
- pending_nameowner_calls, now the internal proxy keeps track.
- (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to
- pending_nameowner_calls.
- (got_name_owner_cb): Update prototype, and use
- dbus_g_proxy_end_call.
- (got_name_owner_cb): Remove reference to pending_nameowner_calls.
- (dbus_g_proxy_manager_register): Delete directly libdbus code in
- favor of using internal proxy.
- (dbus_g_proxy_manager_unregister): Update to use
- dbus_g_proxy_cancel_call for any pending GetNameOwner call.
- (dbus_g_proxy_init): Initialize pending calls map.
- (dbus_g_proxy_constructor): New.
- (dbus_g_proxy_class_init): Add get/set property functions,
- constructor, and add NAME, PATH, and INTERFACE properties.
- (cancel_pending_call): New function.
- (dbus_g_proxy_dispose): Iterate over any outstanding calls and
- cancel them.
- (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New.
- (GPendingNotifyClosure): New structure.
- (d_pending_call_notify, d_pending_call_free): Moved here from
- dbus-glib.c.
- (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function
- ordering.
- (manager_begin_bus_call): New internal function for talking to
- internal bus proxy.
- (dbus_g_proxy_new): Construct object using GObjet properties.
- (dbus_g_proxy_begin_call_internal): Update to take user data, etc.
- Create closure of same, and insert call into map of pending calls.
- (dbus_g_proxy_end_call_internal): Take call id instead of pending
- call. Look up pending call in current set. Remove it when we've
- completed.
- (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete.
- (dbus_g_proxy_begin_call): Change API to take callback, user data,
- and destroy function directly.
- (dbus_g_proxy_end_call): Update to take DBusGProxyCall.
- (dbus_g_proxy_call): Invoke with NULL callback.
- (dbus_g_proxy_cancel_call): New function, replaces
- dbus_g_pending_call_cancel.
-
- * glib/dbus-gparser.c (validate_signature): Fix call to
- dbus_set_g_error.
-
- * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark):
- New quark for attaching metadata to GType.
- (info_hash): Delete.
- (lookup_object_info): Look up using quark.
- (dbus_g_object_type_install_info): Check that a type is classed,
- not that it's an object. Also just install type data using quark
- instead of using global hash.
-
- * glib/dbus-glib.c (dbus_g_pending_call_ref)
- (dbus_g_pending_call_unref, dbus_pending_call_get_g_type)
- (GPendingNotifyClosure): Delete.
- (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c.
- (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete.
-
- * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async
- client method generation until we can fix it...
-
- * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call.
- (load_from_service_thread_func): Ditto.
-
- * tools/dbus-names-model.c (struct NamesModel): Hold
- DBusGProxyCall.
- (have_names_notify): Update prototype, use
- dbus_g_proxy_cancel_call.
- (names_model_reload): Update for new dbus_g_proxy_begin_call API.
-
- * tools/dbus-monitor.c (filter_func): Update for print_message
- API change.
-
- * test/glib/test-dbus-glib.c: Add more tests for async
- invocations. Update many begin_call/end_call pairs to just use
- dbus_g_proxy_call.
-
- * tools/dbus-send.c (main): Add --print-reply=literal mode. This
- allows us to dump print-introspect.c.
-
- * tools/dbus-print-message.h (print_message): Add literal argument
- to print_message which is intended to allow printing arguments without
- metadata like "string=".
-
- * tools/dbus-print-message.c (print_iter): Add literal argument.
- (print_message): Allow printing string messages literally.
-
-2005-07-05 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller):
- Remove value refcount leak, original patch from Jorn Baayen
- <jorn@openedhand.com>. Also remove useless extra value in favor
- of prepending to value array directly.
-
-2005-07-02 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gmain.c (_dbus_gmain_test): Fix test.
-
-2005-07-01 Colin Walters <walters@verbum.org>
-
- Patch from Jonathan Matthew <jonathan@kaolin.hn.org>
-
- * glib/dbus-gvalue.c (basic_typecode_to_gtype): Fix return type.
- (dbus_g_value_types_init): Marshal G_TYPE_CHAR as DBUS_TYPE_BYTE,
- G_TYPE_LONG as DBUS_TYPE_INT32, G_TYPE_ULONG as DBUS_TYPE_UINT32,
- and G_TYPE_FLOAT as DBUS_TYPE_DOUBLE.
-
-2005-06-30 Colin Walters <walters@verbum.org>
-
- * test/glib/test-dbus-glib.c:
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml: Update tests for new error
- setting bits, also add async tests (patch from Ross Burton).
-
- * test/glib/Makefile.am (test_service_glib_LDADD): Add
- DBUS_GLIB_THREADS_LIBS.
-
- * glib/dbus-gproxy.c (get_name_owner)
- (dbus_g_pending_call_end_valist): Ditto.
-
- * glib/dbus-gobject.c (error_metadata): New mapping from GError
- domain (GQuark) to DBusGErrorInfo.
- (gerror_domaincode_to_dbus_error_name): Attempt to look up error
- quark in error_metadata. Take message interface as default
- error message interface.
- (gerror_to_dbus_error_message): Pass message interface.
- (dbus_set_g_error): Resurrected.
- (dbus_g_error_info_free): New function.
- (dbus_g_object_type_install_info): Use g_type_class_ref instead
- of _peek to actually create the object class if it hasn't been
- created yet.
- (dbus_g_error_domain_register): New function.
-
- * glib/dbus-gmain.c (dbus_g_bus_get): Switch to dbus_set_g_error.
-
- * glib/dbus-gparser.c (validate_signature): Ditto.
-
- * dbus/dbus-glib.h (dbus_g_error_set): Delete.
- (dbus_g_error_domain_register): Prototype.
-
- * glib/dbus-glib.c (dbus_g_error_set): Delete.
- Update tests.
-
-2005-06-29 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-glib.h: Delete DBUS_TYPE_G_PROXY_ARRAY. Add
- DBUS_TYPE_G_OBJECT_PATH.
-
- * glib/dbus-gvalue.c (dbus_g_value_types_init): Remove marshallers
- for G_TYPE_OBJECT and DBUS_TYPE_G_PROXY_ARRAY (the latter should
- be handled more generically). Add DBUS_TYPE_G_OBJECT_PATH.
- (dbus_g_object_path_get_g_type): New function.
- (dbus_gtype_from_signature_iter): Map DBUS_TYPE_OBJECT_PATH
- to DBUS_TYPE_G_OBJECT_PATH by default.
- (demarshal_proxy): Remove unused name variable.
- (demarshal_object_path, marshal_object_path): New functions.
- (demarshal_proxy_array, marshal_proxy_array): Delete.
-
- * glib/dbus-binding-tool-glib.c (dbus_g_type_get_c_name): Map
- DBUS_TYPE_G_OBJECT_PATH to char *.
- (dbus_g_type_get_lookup_function): Map builtin
- DBUS_TYPE_G_OBJECT_PATH.
-
- * test/glib/test-dbus-glib.c
- * test/glib/test-service-glib.c (my_object_objpath):
- Adapt tests to new object path marshalling.
-
-2005-06-29 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: force check for Python >= 2.4
-
-2005-06-29 Colin Walters <walters@verbum.org>
-
- Patch from Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gobject.c (invoke_object_method): Unset object
- value in all cases, not only in async case.
-
-2005-06-29 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gproxy.c (struct _DBusGProxy): Add new member
- name_call for keeping track of any outgoing GetNameOwner call.
- Also add for_owner and associated.
- (struct _DBusGProxyManager): Add owner_names, which is hash table
- that maps a base name to a list of names it owns (that we're
- interested in). Add pending_nameowner_calls which is a list of
- all outstanding GetNameOwner; avoids us having to iterate over
- every proxy. Add unassociated_proxies which keeps track of name
- proxies with no associated name owner.
- (dbus_g_proxy_manager_unref): Destroy owner_names.
- (struct DBusGProxyNameOwnerInfo): New struct for keeping track of
- name refcounts.
- (find_name_in_info, name_owner_foreach)
- (dbus_g_proxy_manager_lookup_name_owner, insert_nameinfo)
- (dbus_g_proxy_manager_monitor_name_owner)
- (dbus_g_proxy_manager_unmonitor_name_owner)
- (unassociate_proxies, dbus_g_proxy_manager_replace_name_owner):
- New functions; they manipulate the owner_names mapping.
- (got_name_owner_cb): New function.
- (get_name_owner): New function, extracted from
- dbus_g_proxy_new_for_name_owner.
- (dbus_g_proxy_manager_register): For now we need to keep track of
- all NameOwnerChanged. Also if the proxy is for a name, if we
- don't already know the name owner, queue a new GetNameOwner
- request and add it to our list of unassociated proxies. Otherwise
- inc the refcount.
- (dbus_g_proxy_manager_unregister): If this proxy is for a name,
- cancel any pending GetNameOwner call, etc.
- (dbus_g_proxy_manager_filter): Handle NameOwnerChanged. Also use
- the owner_names mapping to look up the current names for the
- signal source, and dispatch to any proxies for that name.
- (dbus_g_proxy_new): Initialize new members.
- (dbus_g_proxy_new_for_name): Delete unused proxy variable.
- (dbus_g_proxy_new_for_name_owner): Use get_name_owner.
- (dbus_g_pending_call_end_valist): New function, extracted from
- dbus_g_proxy_end_call_internal. Useful when we don't have a proxy
- but want to use the GLib infrastructure. Also note how many
- arguments in reply were over.
- (dbus_g_pending_call_end): New function, just call
- dbus_g_pending_call_end_valist.
- (dbus_g_proxy_end_call_internal): Just call
- dbus_g_pending_call_end_valist.
-
- * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Fix lookup
- of builtin marshaller for STRING_STRING_STRING.
-
- * test/glib/test-dbus-glib.c:
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml:
- Extend tests to cover name proxies, destruction of owner proxies,
- etc.
-
- * glib/examples/example-signal-recipient.c
- (dbus_g_proxy_new_for_name_owner): Create a name proxy.
-
- * tools/dbus-send.c (main): Print D-BUS error name in addition
- to message.
-
-2005-06-28 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in (cunregister_function_handler,
- cmessage_function_handler): Patch from
- Anthony Baxter <anthony@interlink.com.au> fixes threading problems
- by using the Py_GILState_Ensure/Release to synchronize with the
- python runtime.
-
-2005-06-28 Ray Strode <rstrode@redhat.com>
-
- * dbus/dbus-spawn.c (_dbus_babysitter_unref): kill
- babysitter helper process on last unref, bug #2813.
-
-2005-06-27 Colin Walters <walters@verbum.org>
-
- * test/glib/test-dbus-glib.c:
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml:
- Test hash table signal emitting.
-
- * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Convert
- types to their fundamental basis types, since this is what
- marshallers operate on. Also add an entry for VOID__BOXED.
- (dbus_g_object_register_marshaller_array): Convert to fundamental.
-
-2005-06-26 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-tutorial.xml: fix names of interface/service/path, fix
- from Don Park
-
-2005-06-26 Colin Walters <walters@verbum.org>
-
- * glib/dbus-glib.c (dbus_set_g_error): Delete.
- (dbus_g_error_set): New public function from its ashes; used by
- both service-side method implementation and GLib bindings
- internals.
- (dbus_g_error_has_name, dbus_g_error_get_name): New function.
- (_dbus_glib_test): Add some tests.
-
- * test/glib/test-dbus-glib.c (main): Test dbus_g_error_has_name.
-
- * test/glib/test-service-glib.c (my_object_throw_error): Use
- dbus_g_error_set.
-
- * glib/dbus-gobject.c (gerror_to_dbus_error_message): Handle
- errors thrown by dbus_g_error_set.
-
- * glib/dbus-gmain.c (dbus_g_bus_get): Change to dbus_g_error_set.
-
- * glib/dbus-gparser.c (validate_signature): Ditto.
-
- * glib/dbus-gproxy.c (dbus_g_proxy_new_for_name_owner)
- (dbus_g_proxy_end_call_internal): Ditto.
-
- * glib/Makefile.am: Generate dbus-glib-error-switch.h, which
- converts DBUS_ERROR_x to DBUS_GERROR_x.
- (libdbus_glib_1_la_SOURCES, BUILT_SOURCES, CLEANFILES): Add it.
-
- * doc/TODO: Remove error TODO.
-
- * doc/dbus-tutorial.xml: Update with documentation about error
- handling.
-
- * dbus/make-dbus-glib-error-enum.sh: Tighten up regexp to make
- sure we only change DBUS_ERROR to DBUS_GERROR, not all ERROR to
- GERROR. Also add DBUS_GERROR_REMOTE_EXCEPTION.
-
-2005-06-22 Colin Walters <walters@verbum.org>
-
- Patch from Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gobject.c (dbus_g_method_return): Free out_sig.
-
-2005-06-20 Colin Walters <walters@verbum.org>
-
- * configure.in: Add glib/examples.
-
- * glib/Makefile.am: Add examples/
-
- * glib/examples/.cvsignore
- * glib/examples/Makefile.am
- * glib/examples/example-client.c
- * glib/examples/example-service.c
- * glib/examples/example-service.xml
- * glib/examples/example-signal-emitter.c
- * glib/examples/example-signal-emitter.xml
- * glib/examples/example-signal-recipient.c:
- New files; GLib binding examples, ported from
- python/examples.
-
-2005-06-20 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-glib.h:
- * glib/dbus-gproxy.c: Rename dbus_g_proxy_invoke to
- dbus_g_proxy_call.
-
- * glib/dbus-binding-tool-glib.c:
- * doc/dbus-tutorial.xml:
- * test/glib/test-dbus-glib.c: Update for rename.
-
-2005-06-20 Colin Walters <walters@verbum.org>
-
- Patch suggested by Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gobject.c (export_signals): Free signal name.
- (g_value_init): Use G_VALUE_NOCOPY_CONTENTS to plug
- memory leak. Add a bit of documentation.
- (dbus_g_method_return_error): Free context, and note we do
- so.
-
-2005-06-18 Murray Cumming <murrayc@murrayc.com>
-
- * dbus/dbus-glib.h:
- * glib/dbus-gobject.c:
- * glib/dbus-gproxy.c:
- * glib/dbus-gvalue.c: Predeclare structs as
- typedef struct _Something Something instead of
- typedef struct Something Something, so we can
- redeclare the prototypes. Other GNOME libraries
- do this already.
-
-2005-06-17 Colin Walters <walters@verbum.org>
-
- * tools/dbus-names-model.c (have_names_notify): Fix call
- to dbus_g_proxy_end_call.
-
-2005-06-17 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): Don't
- spew warnings if we get malformed remote signals.
-
- * glib/dbus-gobject.c (propsig_iterate): New function.
- (lookup_object_info): New function, extracted from
- lookup_object_and_method.
- (introspect_properties, introspect_signals): Delete; these
- are merged into write_interface.
- (write_interface): Write out signals and properties here;
- dump the org.gtk.object stuff and use the interface given
- in the introspection data blob. Also fix up property XML.
- (lookup_values): New function.
- (introspect_interfaces): Gather a mapping from interface to a
- list of its methods, signals, and properties, then write out
- each interface.
- (lookup_object_and_method): Use lookup_object_info.
- (struct DBusGSignalClosure): Add interface.
- (dbus_g_signal_closure_new): Add interface. Don't dup signame;
- we can just use the constant data.
- (dbus_g_signal_closure_finalize): Don't free signal name.
- (signal_emitter_marshaller): Use interface from signal closure.
- (export_signals): Only export signals mentioned in introspection
- blob.
- (dbus_g_connection_register_g_object): Warn if we have no
- introspection data for an object.
- (funcsig_equal): Remove unused variable.
- (dbus_g_object_register_marshaller): Take varargs instead of
- list.
- (dbus_g_object_register_marshaller_array): New function,
- extracted from old dbus_g_object_register_marshaller.
-
- * glib/dbus-binding-tool-glib.c (struct DBusBindingToolCData): Add
- signals and property data.
- (write_quoted_string): New function, extracted from generate_glue.
- (generate_glue): Write signals and properties to introspection
- blob.
-
- * dbus/dbus-glib.h (struct DBusGObjectInfo): Include
- exported_signals and exported_properties.
- (dbus_g_object_register_marshaller): Update prototype.
- (dbus_g_object_register_marshaller_array): Prototype.
-
- * test/glib/test-dbus-glib.c: Extend testing to cover new signals.
-
- * test/glib/test-service-glib.c: Add new test signals and method
- to emit them.
-
- * test/glib/test-service-glib.xml: Add some test signals.
-
- * test/glib/Makefile.am (BUILT_SOURCES): Add my-object-marshal.c
- and my-object-marshal.h
- (test_service_glib_SOURCES, test_dbus_glib_SOURCES): Add
- my-object-marshal.c.
- (my-object-marshal.c, my-object-marshal.h): Implement.
-
- * test/glib/.cvsignore: Update.
-
- * doc/TODO: Remove two GLib TODO items fixed by this
- patch.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * doc/TODO: Update for GLib bindings.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * glib/dbus-binding-tool-glib.c:
- * glib/dbus-gobject.c:
- * glib/dbus-gproxy.c: Add Nokia copyright; Patch
- from Ross Burton, for his GLib bindings work.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gobject.c (funcsig_hash, funcsig_equal): Use n_params
- to iterate instead of walking to G_TYPE_INVALID.
-
- Patch based on a patch from Ryan Gammon.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * bus/bus.c (bus_context_new): Set parser to NULL
- after we unref it (Patch from Chris Boscolo, #2174).
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * python/dbus_bindings.pyx.in: Import size_t,
- __int64_t, __uint64_t, and __signed.
-
- * dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (write_credentials_byte):
- Define cmsg struct, output it.
- (_dbus_read_credentials_unix_socket):
- Use cmsg struct.
-
- Patch from Joe Markus Clarke for FreeBSD support.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * tools/dbus-send.c (append_array): Use strtok.
- (append_dict): New function.
- (type_from_name): New function, extracted from main.
- (main): Handle sending dicts.
-
- * tools/dbus-print-message.c (print_iter): Print dict
- entries.
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gvalue.c (marshal_basic): Marshal NULL string
- values as the empty string (#2948).
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * dbus/Makefile.am:
- * mono/doc/Makefile.am:
- * test/glib/Makefile.am:
-
- Fix srcdir != builddir issues (Patch from Chris Wilson, #3477)
-
-2005-06-16 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-marshal-header.c (_dbus_header_load): Set
- header byte order from expected byte order (Patch from Chris Wilson, #3475).
-
- * dbus/dbus-marshal-byteswap.c (byteswap_body_helper):
- Increment pointer after swapping fixed array. Add assertion
- for array length.
-
-2005-06-15 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (_dbus_read_credentials_unix_socket):
- Fix call to dbus_set_error. (Patch from Michael Banck, #3461)
-
-2005-06-15 John (J5) Palmieri <johnp@redhat.com>
-
- * NEWS: Update to 0.34
-
-2005-06-15 David Zeuthen <davidz@redhat.com>
-
- * configure.in (LT_CURRENT): Revert back to 1 as the library
- hasn't changed and we've certainly not committed to protocol
- stability yet. All this does is to break ABI. See commit note
- from hp@redhat.com 2005-05-05 for details.
-
-2005-06-15 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c (_dbus_connection_peer_filter): New method
- (_dbus_connection_run_builtin_filters): New method
- (dbus_connection_dispatch): Run the builtin filters which in turn
- runs the peer filter which handles Ping messages.
-
- * doc/TODO:
- - Ping isn't handled: This patch fixes it
-
- - Add a test case for the Ping message: added TODO item
-
-2005-06-15 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-message.c:
- (dbus_message_has_path): New method
- (dbus_message_has_interface): New method
- (dbus_message_has_member): New method
-
- * dbus/dbus/dbus-sysdeps.c (_dbus_check_dir_is_private_to_user):
- New method
-
- * dbus/dbus-keyring.c (_dbus_keyring_reload): Check to see that
- the keyring directory is private to the user
-
- * doc/TODO:
- - The convenience functions in dbus-bus.h should perhaps have
- the signatures that they would have if they were autogenerated
- stubs. e.g. the acquire service function. We should also evaluate
- which of these functions to include, in light of the fact that
- GLib/Qt native stubs will probably also exist.: Punted
-
- - add dbus_message_has_path(), maybe has_member/interface:
- fixed in this patch
-
- - in dbus-keyring.c, enforce that the keyring dir is not
- world readable/writable: Fixed in this patch
-
-2005-06-15 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-marshal-validate.h: Added a new validation
- error code DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4 for
- out of memory errors when validating signitures
-
- * dbus/dbus-marshal-header.c: use DBUS_VALIDITY_UNKNOWN_OOM_ERROR
- in places where we previously used DBUS_VALID and a FALSE return
- value to indicate OOM
-
- * dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason):
- Use a stack to track the number of elements inside containers. The
- stack values are then used to validate that dict entries have only two
- elements within them.
- (validate_body_helper): check the reason for failure when validating
- varients
-
- * dbus/dbus-message.c (load_message): use
- DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used
- DBUS_VALID and a FALSE return value to indicate OOM
-
- * doc/TODO: remove "- validate dict entry number of fields" as this
- patch fixes it
-
-2005-06-14 David Zeuthen <davidz@redhat.com>
-
- * bus/bus.c (process_config_every_time): Drop existing conf-dir
- watches (if applicable) and add new watches
-
- * bus/main.c (signal_handler): Handle SIGIO if using D_NOTIFY
- (main): Setup SIGIO signal handler if using D_NOTIFY
-
- * bus/config-parser.h: Add prototype bus_config_parser_get_conf_dirs
-
- * bus/config-parser.c (struct BusConfigParser): Add conf_dirs list
- (merge_included): Also merge conf_dirs list
- (bus_config_parser_unref): Clear conf_dirs list
- (include_dir): Add directory to conf_dirs list
- (bus_config_parser_get_conf_dirs): New function
-
- * bus/dir-watch.[ch]: New files
-
- * bus/Makefile.am (BUS_SOURCES): Add dir-watch.[ch]
-
- * configure.in: Add checks for D_NOTIFY on Linux
-
-2005-06-14 Colin Walters <walters@verbum.org>
-
- * glib/dbus-binding-tool-glib.c:
- * glib/dbus-gobject.c:
- * glib/dbus-gvalue.c: Fix indentation and brace style.
-
-2005-06-14 Ross Burton <ross@openedhand.com>.
-
- * glib/dbus-glib.h: Make DBusGMethodInvocation
- a private structure. Rearrange prototypes a bit.
-
- * glib/dbus-gproxy.c (dbus_g_proxy_invoke): Add
- documentation for first_arg_type.
-
- * glib/dbus-gobject.c: Move DBusGMethodInvocation
- here, add documentation. Move dbus_g_method_return
- and dbus_g_method_return_error into public API
- section.
-
-2005-06-14 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller):
- Add missing return statements, noticed by Ross Burton.
-
-2005-06-13 Ross Burton <ross@openedhand.com>.
-
- * glib/dbus-gobject.c: Handle errors on message
- demarshalling by sending error message back.
- * glib/dbus-gvalue.c: Initialize return variables.
-
-2005-06-13 Colin Walters <walters@verbum.org>
-
- * glib/Makefile.am: Fix thinko in last patch.
-
-2005-06-13 Colin Walters <walters@verbum.org>
-
- * glib/Makefile.am: Move dbus-gtype-specialized.c
- and dbus-gtype-specialized.h into a _HEADERS variable,
- install them.
-
-2005-06-12 Colin Walters <walters@verbum.org>
-
- Async signals and various bugfixes and testing by
- Ross Burton <ross@openedhand.com>.
-
- * glib/dbus-gvalue.h: (struct DBusBasicGValue): Delete.
- (dbus_gvalue_genmarshal_name_from_type)
- (dbus_gvalue_ctype_from_type): Moved to dbus-binding-tool-glib.c.
- (dbus_gtype_to_dbus_type): Renamed to dbus_gtype_from_signature.
- (dbus_g_value_types_init, dbus_gtype_from_signature)
- (dbus_gtype_from_signature_iter, dbus_gtype_to_signature)
- (dbus_gtypes_from_arg_signature): New function prototypes.
- (dbus_gvalue_demarshal): Take context and error arguments.
- (dbus_gvalue_demarshal_variant): New function.
- (dbus_gvalue_demarshal_message): New function.
- (dbus_gvalue_store): Delete.
-
- * glib/dbus-gvalue.c:
-
- File has been almost entirely rewritten; now we special-case
- more types such as DBUS_TYPE_SIGNATURE, handle arrays and
- hash tables correctly, etc. Full support for recursive values
- is not yet complete.
-
- * glib/dbus-gproxy.c (dbus_g_proxy_class_init): Change last
- argument of signal to G_TYPE_POINTER since we now pass a
- structure.
- (lookup_g_marshaller): Delete in favor of
- _dbus_gobject_lookup_marshaller.
- (marshal_dbus_message_to_g_marshaller): Use
- _dbus_gobject_lookup_marshaller and dbus_gvalue_demarshal_message
- to handle remote signal callbacks.
- (dbus_g_proxy_new_from_proxy): New function; creates a new
- DBusGProxy by copying an existing one.
- (dbus_g_proxy_get_interface, dbus_g_proxy_set_interface)
- (dbus_g_proxy_get_path): New functions.
- (dbus_g_proxy_marshal_args_to_message): New function;
- factored out of existing code.
- (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Collect all arguments
- from a varargs array.
- (dbus_g_proxy_begin_call_internal): New function.
- (dbus_g_proxy_end_call_internal): New function.
- (dbus_g_proxy_begin_call): Take GTypes instead of DBus types
- as arguments; simply invoke dbus_g_proxy_begin_call_internal
- after collecting args into value array.
- (dbus_g_proxy_end_call): Take GTypes instead of DBus types;
- invoke dbus_g_proxy_end_call_internal.
- (dbus_g_proxy_invoke): Simply invoke begin_call_interanl and
- end_call_internal.
- (dbus_g_proxy_call_no_reply): Take GTypes instead of DBus
- types.
- (array_free_all): New function.
- (dbus_g_proxy_add_signal): Take GTypes.
-
- * glib/dbus-gobject.h:
- (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
- (_dbus_gobject_get_path, _dbus_gobject_lookup_marshaller):
- Prototype.
-
- * glib/dbus-gobject.c: Add a global marshal_table hash which
- stores mappings from type signatures to marshallers. Change lots
- of invocations of dbus_gtype_to_dbus_type to
- dbus_gtype_to_signature.
- (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
- (introspect_signals): Fix test for query.return_type.
- (set_object_property): Update invocation of dbus_gvalue_demarshal.
- (invoke_object_method): Many changes. Handle asynchronous
- invocations. Convert arguments with
- dbus_gvalue_demarshal_message. Handle errors. Use
- DBusSignatureIter instead of strlen on args. Handle all arguments
- generically. Special-case variants.
- (dbus_g_method_return, dbus_g_method_return_error): New function.
- (DBusGSignalClosure): New structure, closes over signal
- information.
- (dbus_g_signal_closure_new): New function.
- (dbus_g_signal_closure_finalize): New function.
- (signal_emitter_marshaller): New function; is special marshaller
- which emits signals on bus.
- (export_signals): New function; introspects object signals and
- connects to them.
- (dbus_g_object_type_install_info): Take GType instead of
- GObjectClass.
- (dbus_g_connection_register_g_object): Invoke export_signals.
- (dbus_g_connection_lookup_g_object): New function.
- (DBusGFuncSignature) New structure; used for mapping type
- signatures to marshallers.
- (funcsig_hash): New function; hashes DBusGFuncSignature.
- (funcsig_equal): New function; compares DBusGFuncSignature.
- (_dbus_gobject_lookup_marshaller): New function.
- (dbus_g_object_register_marshaller): New function; used to
- register a marshaller at runtime for a particular signature.
-
- * glib/dbus-gmain.c (_dbus_gmain_test): Add various tests.
-
- * glib/dbus-binding-tool-glib.h: Add DBUS_GLIB_ANNOTATION_ASYNC
- which notes a server method implementation should be
- asynchronous.
-
- * glib/dbus-binding-tool-glib.c
- (dbus_binding_tool_output_glib_server): Call
- dbus_g_value_types_init.
- (write_formal_parameters): Use dbus_gtype_from_signature. Handle
- variants specially.
- (dbus_g_type_get_lookup_function): Turn GType into an invocation
- of a lookup function.
- (write_args_for_direction): Use dbus_g_type_get_lookup_function.
- (write_untyped_out_args): New method; write output arguments.
- (write_formal_declarations_for_direction): Function for
- writing prototypes.
- (write_formal_parameters_for_direction): Function for
- writing implementations.
- (write_typed_args_for_direction): Function for writing
- arguments prefixed with GTypes.
- (write_async_method_client): Write out async version
- of method.
-
- * glib/dbus-binding-tool-glib.c: Include dbus-gvalue-utils.h.
- (dbus_g_type_get_marshal_name): Move mapping from GType
- to marshal name into here.
- (dbus_g_type_get_c_name): Move into here.
- (compute_marshaller): Convert signature to type with
- dbus_gtype_from_signature, use dbus_g_type_get_marshal_name.
- (compute_marshaller_name): Ditto.
- (compute_marshaller): Handle async signal annotations.
- (gather_marshallers): Return if we don't have a known
- prefix.
- (generate_glue): Collect introspection blob here, and
- write all of the blob at the end. This allows an object
- with multiple interfaces to work.
- Mark async methods in introspection blob.
-
- * glib/Makefile.am (libdbus_glib_1_la_SOURCES): Add
- dbus-gtype-specialized.c, dbus-gtype-specialized.h,
- dbus-gvalue-utils.h, dbus-gvalue-utils.c.
-
- * dbus/dbus-glib.h: Don't include dbus-protocol.h; this
- avoids people accidentally using DBUS_TYPE_* which should
- not be necessary anymore.
- Do include dbus-gtype-specialized.h, which are utilities
- for GLib container types.
- Add various #defines for types such as
- DBUS_TYPE_G_BOOLEAN_ARRAY.
- (DBusGValueIterator, DBusGValue): Define, not fully used
- yet.
- (dbus_g_value_get_g_type): Type for recursive value.
- (dbus_g_value_open, dbus_g_value_iterator_get_value)
- (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse)
- (dbus_g_value_free): Prototypes.
- (dbus_g_object_register_marshaller, dbus_g_proxy_new_from_proxy): Prototype.
- (dbus_g_proxy_set_interface): Prototype.
- (dbus_g_proxy_begin_call, dbus_g_proxy_end_call)
- (dbus_g_proxy_call_no_reply): Take GLib types instead of DBus
- types.
- (dbus_g_proxy_get_path, dbus_g_proxy_get_interface):
- Accessors.
- (DBusGAsyncData, DBusGMethodInvocation): Structures for
- doing async invocations.
- (dbus_g_method_return, dbus_g_method_return_error):
- Prototypes.
- * doc/dbus-tutorial.xml: Update GLib section.
-
- * tools/dbus-viewer.c (load_child_nodes): Update
- for new invocation type of dbus_g_proxy_end_call.
- (load_from_service_thread_func): Ditto.
-
- * tools/print-introspect.c (main): Ditto.
-
- * tools/dbus-names-model.c (have_names_notify)
- (names_model_reload, names_model_set_connection)
- Use GTypes.
-
- * python/Makefile.am (INCLUDES): Define DBUS_COMPILATION,
- needed since Python bindings use GLib bindings.
-
- * test/glib/Makefile.am (INCLUDES): Define DBUS_COMPILATION.
- Add --prefix argument.
-
- * tools/Makefile.am: Define DBUS_COMPILATION. Remove
- unneeded --ignore-unsupported arg.
-
- * test/glib/test-service-glib.c:
- * test/glib/test-service-glib.xml:
- * test/glib/test-dbus-glib.c: Add many more tests.
-
-2005-06-06 David Zeuthen <davidz@redhat.com>
-
- * doc/TODO: Add item about need to remove deprecated functions.
-
- * dbus/dbus-connection.h: Add prototype for dbus_connection_disconnect
-
- * dbus/dbus-connection.c (dbus_connection_disconnect): New function
- to repair the ABI which was broken with the last commit.
-
-2005-06-02 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c, dbus/dbus-connection.h
- (dbus_connection_disconnect): renamed to dbus_connection_close
- for API symmetry with dbus_connection_open
- (_dbus_connection_open_internal):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * dbus/dbus-bus.c (dbus_bus_get):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * bus/connection.c (bus_connections_unref,
- bus_connections_setup_connection, bus_connections_expire_incomplete):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * bus/dispatch.c (bus_dispatch, kill_client_connection,
- kill_client_connection_unchecked, check_hello_connection):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * bus/bus.c (new_connection_callback):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * tools/dbus-send.c (main):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * test/glib/test-profile.c (no_bus_thread_func, with_bus_thread_func):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * test/test-service.c (path_message_func, filter_func):
- s/dbus_connection_disconnect/dbus_connection_close
-
- * doc/TODO: remove connection_open/connection_disconnect lacks symmetry item that was just fixed
-
-2005-05-25 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-protocol.h: Move various bus service #defines such
- as DBUS_SERVICE_DBUS and DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT to
- dbus/dbus-shared.h.
- * dbus/dbus-shared.h: Various defines moved here.
- * dbus/dbus-marshal-header.c: Include dbus-shared.h.
-
-2005-05-25 John (J5) Palmieri <johnp@redhat.com>
-
- * python/__init__.py: Python bindings deserve a minor version
- update. Upped to (0, 40, 2)
-
-2005-05-24 John (J5) Palmieri <johnp@redhat.com>
-
- * python/decorators.py: add explicitly_pass_message decorator
- for passing in the dbus message as keyword for edge case signal
- handling
-
- * python/matchrules.py (SignalMatchRule.__repr__): fix output
- to conform with what dbus expects for match rules
- (SignalMatchRule.execute): add the dbus message as a keyword
- if the signal handler has requested it
-
- * python/examples/example/signal-recipient.py: added some more
- examples on how to hook up to signals
-
-2005-05-23 John (J5) Palmieri <johnp@redhat.com>
-
- * python/decorators.py: import dbus_bindings
-
- * python/matchrules.py (SignalMatchRule, SignalMatchTree,
- SignalMatchNode): new classes that implement wildcard signal
- callback matching using a tree lookup. Heavily modified from a
- patch sent by Celso Pinto (fd.o bug #3241)
-
- * _dbus.py (add_signal_receiver, remove_signal_receiver, _signal_func):
- use new match classes to handle signals.
-
-2005-05-19 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in: s/TYPE_PATH/TYPE_OBJECT_PATH
-
-2005-05-18 Havoc Pennington <hp@redhat.com>
-
- * configure.in: use GLIB_GNU_GETTEXT to get INTLLIBS and require
- gettext. Not really worth requiring yet perhaps, but any
- production quality 1.0 would require it so we should go ahead and
- get things set up. We do have a couple token calls to
- bindtextdomain in the code already.
-
-2005-05-16 John (J5) Palmieri <johnp@redhat.com>
-
- * glib/dbus-gmain.c (io_handler_dispatch): fix deadlock
- when using recursive g_main_loops
-
- * python/_dbus.py (class Bus): add the ProxyObjectClass
- alias for ProxyObject to make it easier for the Twisted
- networking framework to integrate dbus.
-
- * python/proxies.py (class ProxyObject): add the ProxyMethodClass
- alias for ProxyMethod to make it easier for the Twisted
- networking framework to integrate dbus.
-
-2005-05-11 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-glib-tool.c: Add --prefix argument.
- * glib/dbus-binding-tool-glib.h: Add prefix argument.
- * glib/dbus-binding-tool-glib.c (compute_marshaller_name):
- Add prefix argument.
- (generate_glue): Pass prefix argument down.
- (dbus_binding_tool_output_glib_server): Pass prefix to
- glib-genmarshal.
-
-2005-05-11 Colin Walters <walters@verbum.org>
-
- * tools/dbus-send.c (append_array): New function.
- (append_arg): Broken out from main.
- (main): Add cheesy hack to send arrays and variants.
- (usage): Update.
- * tools/dbus-print-message.c (print_iter): Broken out
- from main.
-
-2005-05-11 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-signature.c (dbus_signature_iter_get_signature):
- New function, returns signature string for signature iter.
- * dbus/dbus-signature.h: Prototype it.
- * dbus/dbus-message.c (dbus_message_iter_get_signature):
- New function, returns signature string for message iter.
- (dbus_message_iter_get_array_len): New function, returns
- length of array.
- (dbus_message_iter_get_fixed_array): Fix assertion; this
- function should be used when the iter is pointing to the
- contents of an array
- * dbus/dbus-message.h: Prototypes.
- * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_array_length):
- New function; returns length of an array.
- * dbus/dbus-marshal-recursive.h: Prototype it.
-
-2005-05-11 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-sysdeps-util.c <!HAVE_POSIX_GETPWNAM_R>: Fix
- compilation error.
-
-2005-05-08 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-util.c (_dbus_become_daemon): write the
- daemon's pid, not the parent's pid, to the file descriptor.
- Reported by Taj Morton.
-
-2005-05-05 Havoc Pennington <hp@redhat.com>
-
- * configure.in (LT_*): add notes on how the libtool versioning
- works to save thinking. Increment soname to indicate protocol
- breakage (though really the library interface hasn't changed I
- guess)
-
- * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
- verify the GUID received from server matches what we were
- expecting, if we had an expectation
-
- * dbus/dbus-auth.c (send_ok): send GUID along with the OK command
- (_dbus_auth_get_guid_from_server): new function
- (send_begin): parse the OK args
-
- * doc/dbus-specification.xml: add GUID to the auth protocol
-
-2005-05-05 John (J5) Palmieri <johnp@redhat.com>
-
- * Fix my name in previous changelog ;)
-
- * python/proxies.py (ProxyObject.__getattr__): add further patch
- from Anthony Baxter to throw an AttributeError when python
- __special__ functions are called instead of marshling them over
- the bus (Bug#1685 comment 3).
-
-2005-05-04 John (J5) Palmieri <johnp@redhat.com>
-
- * python/Makefile.am: changed to use pyexecdir for the binding
- shared libraries (Bug#2494)
-
- * python/exceptions.py: bring exceptions over from the bindings
- so they can be used in applications (Bug#2036)
- Make all exceptions derive from DBusException
-
- * python/_dbus.py, python/proxies.py: implement __repr__ in a couple
- of classes so that print obj doesn't throw an exception (Bug #1685)
-
-2005-05-03 Ross Burton <ross@openedhand.com>
-
- * glib/dbus-gobject.c (dbus_g_connection_register_g_object):
- Return if we get an error during registration. Set up a
- weak reference on object to unregister if object is destroyed.
- (unregister_gobject): New function.
-
-2005-05-01 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in:
- - added new type classes for hinting to the marashaler what type
- to send over the wire
- - added int16 and uint16 marshalers
- - Fixed a bug in the type constants that caused int32 to go out
- as uint16 over the wire
- * python/dbus.py: split up into different files and renamed _dbus.py
- * python/__init__.py, python/_util.py, python/decorators.py,
- python/exceptions.py, python/proxies.py, python/services.py,
- python/types.py: new files split off from dbus.py
- * python/Makefile.am: Add new files, remove dbus.py and
- install all python files to <python module dir>/dbus
- * python/examples/*: Added #!/usr/bin/env python to the top of
- every example. Patch provided by Tatavarty Kalyan
-
-2005-04-25 John (J5) Palmieri <johnp@redhat.com>
-
- * NEWS: Update to 0.33
-
-2005-04-25 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in (send_with_reply_handlers): New send
- method for doing async calls
- (_pending_call_notification): New C function for handling pendning call
- callbacks
- (set_notify): New method for setting pending call notification
-
- * python/dbus.py: new version tuple "version" is set at (0, 40, 0)
- Async capabilities added to remote method calls
- (Sender): class removed
- (RemoteService): class removed
- (ObjectTree): class removed for now
- (RemoteObject): Renamed to ProxyObject
- (RemoteMethod): Renamed to ProxyMethod
- (method): Decorator added for decorating python methods as dbus methods
- (signal): Decorator added for decorating python methods as signal emitters
- (ObjectType): Metaclass added for generating introspection data and the
- method callback vtable
- (Interface): Wrapper class added to wrap objects in a dbus interface
- (Object): Uses ObjectType as its metaclass and exports Introspect
- of the org.freedesktop.DBus.Introspectable interface
- (ValidationException, UnknownMethodException): new exceptions
-
- * python/examples/*: Modified to fit with the new bindings
-
-2005-04-23 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_append_args): fix doc comment,
- reported by Tony Houghton
-
- * test/test-service.c (main): test
- dbus_connection_get_object_path_data()
-
- * dbus/dbus-object-tree.c (find_handler): be sure we always init
- the exact_match
- (_dbus_object_tree_get_user_data_unlocked): new function used by
- dbus_connection_get_object_path_data()
- (do_register): add assertion test for get_user_data_unlocked
- (object_tree_test_iteration): more tests
-
- * dbus/dbus-connection.c (dbus_connection_get_object_path_data):
- new function from Dan Reed to let you get the user data from
- dbus_connection_register_object_path()
-
-2005-04-23 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-marshal-recursive-util.c: Fixed buffer overflow
- in numerous places that did not account for the NULL terminator
- (signature_from_seed): changed the manual string copy loop to
- just use strcpy instead
- make check should now pass
-
-2005-04-19 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-marshal-header.c (_dbus_header_create): Fix assert
- so that it allows messages that are not signals to pass in
- NULL as the interface.
-
-2005-04-18 David Zeuthen <davidz@redhat.com>
-
- * glib/dbus-gmain.c (io_handler_destroy_source):
- (timeout_handler_destroy_source, connection_setup_free):
- Also unref the source to avoid memory leaks.
-
-2005-04-13 David Zeuthen <davidz@redhat.com>
-
- * bus/config-parser.c (bus_config_parser_new): Bump this to a
- more reasonable, yet still totally arbitrary, value :-).
-
-2005-04-13 David Zeuthen <davidz@redhat.com>
-
- * doc/TODO: Added an "important for 1.0" item about selinux
- allow/deny messages
-
-2005-04-13 David Zeuthen <davidz@redhat.com>
-
- * bus/selinux.c: Add c-file-style to top of file
- (log_audit_callback): Don't free the data here anymore
- (bus_selinux_check): Don't take spid and tpid since appending
- that to auxdata may OOM.
- (bus_selinux_allows_acquire_service): Handle OOM and signal back
- to the caller if we are OOM by taking an error object.
- (bus_selinux_allows_send): -do-
-
- * bus/selinux.h: Fix prototypes for bus_selinux_allows_acquire_service
- and bus_selinux_allows_send
-
- * bus/bus.c (bus_context_check_security_policy): Pass error and
- pass on OOM thrown by bus_selinux_allows_send()
-
- * bus/services.c (bus_registry_acquire_service): Pass error and
- pass on OOM thrown by bus_selinux_allows_acquire_service()
-
-2005-04-13 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gmain.c (message_queue_dispatch): only dispatch one
- message at a time to avoid monopolizing the main loop, bug
- #2953 from Benjamin Otte
-
-2005-04-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (copy): change a memcpy to memmove due to
- possible overlap, fix from Daniel Reed
- (fixup_alignment): fix signedness warnings
- (_dbus_string_append_unichar): ditto
-
-2005-04-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-util.c (_dbus_message_test): fix signedness warning
-
- * glib/dbus-glib-tool.c (main): fix warning
-
- * glib/dbus-binding-tool-glib.c (generate_glue): fix warning
-
- * dbus/dbus-connection.c (dbus_connection_read_write_dispatch):
- add a new function that can be used in simple applications that
- don't have a main loop and are willing to block
-
-2005-04-05 David Zeuthen <davidz@redhat.com>
-
- Fix https://bugs.freedesktop.org/show_bug.cgi?id=2889
-
- * glib/dbus-gmain.c:
- (io_handler_destroy_source): Remove from list of IO handlers
- of the ConnectionSetup object
- (timeout_handler_destroy_source): -do- for timeout handlers
- (io_handler_source_finalized): Don't remove from list since
- we now do that in io_handler_destroy_source(). Renamed from
- io_handler_source_destroyed
- (timeout_handler_source_destroyed): -do- for timeout handlers
- (connection_setup_free): It is now safe to iterate over all
- IO and timeout handlers as the _destroy_source removes them
- from the list synchronously
-
-2005-03-30 Havoc Pennington <hp@redhat.com>
-
- * configure.in: change check to gtk 2.4
-
- * tools/dbus-viewer.c (name_combo_changed_callback): remove
- gtk_combo_box_get_active_text() usage to decrement GTK requirement
- to 2.4
-
-2005-03-29 John (J5) Palmieri <johnp@redhat.com>
-
- * News: Update 0.32
-
- * HACKING: Fixed realease instructions. configure.in should be updated to
- the next release by the person who made the last release.
-
-2005-03-29 John (J5) Palmieri <johnp@redhat.com>
-
- * python/lvalue_cast_post_process.py - removed. Patch has been
- submitted to Pyrex maintainers that fixes gcc4.0 errors
-
- * python/Makefile.am: removed refrences to lvalue_cast_post_process.py
-
-2005-03-24 Daniel Reed <n@ml.org>
-
- * tools/Makefile.am: Make print-introspect and
- dbus-bus-introspect.xml building conditional on HAVE_GLIB.
-
-2005-03-22 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/Makefile.am: Patch by Colin Walters that fixes distcheck
-
- * dbus/dbus-userdb.c, dbus/dbus-userdb-util.c: Add patch we have
- had in Red Hat packages for a while but for some reason never
- got merged upstream
- (_dbus_is_a_number): New checks if a string
- can be converted to a number and does the conversion if it can
- (_dbus_user_database_lookup): Add check to see if the given username
- is a udi. This allows udi's to be used instead of usernames in the
- config file.
- (_dbus_user_database_lookup_group): Add check to see if the given groupname
- is a gdi. This allows gdi's to be used instead of groupnames in the
- config file.
-
-2005-03-21 John (J5) Palmieri <johnp@redhat.com>
-
- * python/lvalue_cast_post_process.py - added post processor to fix Pyrex
- code so that it compiles with gcc4.0
-
- * python/Makefile.am: Added lvalue_cast_post_process.py to EXTRA_DIST
- run dbus_bindings.c through lvalue_cast_post_process.py and copy the
- results back to dbus_binding.c
-
-2005-03-20 Colin Walters <walters@verbum.org>
-
- Patch suggested by Inguva Rajasekhar <ringuva@novell.com>.
-
- * configure.in: Require GTK+ 2.6.
-
-2005-03-20 Colin Walters <walters@verbum.org>
-
- * Makefile.am (SUBDIRS, DIST_SUBDIRS): Build tools before test.
-
-2005-03-17 Tom Parker <palfrey@tevp.net>
-
- * dbus/dbus-userdb.c (_dbus_user_database_lookup): Don't
- print DBUS_UID_UNSET; instead print passed username. Also
- be sure to actually use gid looked up in cache.
-
- * dbus/dbus-userdb-util.c (_dbus_user_database_lookup_group): Ditto
- for DBUS_GID_UNSET and groupname.
-
-2005-03-17 Colin Walters <walters@verbum.org>
-
- * bus/print-introspect.c: Move to tools/.
- * bus/run-with-tmp-session-bus.sh: Ditto.
-
- * glib/Makefile.am (dbus-glib-bindings.h): Move
- generation to tools/Makefile.am.
-
- * test/glib/run-test.sh: Update to handle move
- of run-with-tmp-session-bus.sh.
-
- * test/glib/test-service-glib.c: Update to handle
- move of dbus-glib-bindings.h.
-
- * tools/print-introspect.c: Moved here
- from bus/, and ported to GLib bindings.
-
- * tools/run-with-tmp-session-bus.sh: Moved here
- from bus/.
-
- * tools/Makefile.am: Generate dbus-glib-bindings.h
- and dbus-bus-introspect.xml here.
-
- * tools/.cvsignore, glib/.cvsignore, bus/.cvsignore:
- Update.
-
-2005-03-17 Colin Walters <walters@verbum.org>
-
- * bus/driver.c (write_args_for_direction): Use
- _dbus_string_get_const_data to retrieve string;
- _dbus_string_get_const_data_len doesn't actually return
- a NULL-terminated substring.
-
- * test/glib/test-service-glib.c: Include dbus-glib-bindings.h.
- (main): Change to use org_freedesktop_DBus_request_name
- instead of using g_proxy_begin_call/end_call.
-
-2005-03-15 Joe Shaw <joeshaw@novell.com>
-
- * mono/ProxyBuilder.cs (BuildFinalizer): Fix some invalid IL when
- generating the finalizer. Fixes from Ben Maurer.
-
-2005-03-12 Joe Shaw <joeshaw@novell.com>
-
- * mono/BusDriver.cs: Update method names: ListServices
- becomes ListNames; GetOwner becomes GetNameOwner.
-
- * mono/ProxyBuilder.cs (BuildFinalizer): Need to load arg 0
- onto the eval stack when removing the delegate.
-
-2005-03-12 Joe Shaw <joeshaw@novell.com>
-
- * mono/dbus-sharp.dll.config.in: Don't hardcode 0 for
- LT_CURRENT. Set it to the autoconf variable.
-
- * mono/ProxyBuilder.cs: Add a finalizer to the generated proxy
- classes that disconnects the signal handler delegate from the
- service object. Fixes a big leak of proxy objects on the
- client side of things. Patch from Ben Maurer
- <bmaurer@ximian.com>
-
-2005-03-12 Colin Walters <walters@verbum.org>
-
- * bus/driver.c (write_args_for_direction): New function,
- parses a type signature into arguments and outputs to
- XML.
- (bus_driver_handle_introspect): Use it instead of
- hardcoding XML for certain signatures.
-
- * bus/Makefile.am (dbus-bus-introspect.xml): Add
- dependency on dbus-daemon.
-
- * glib/dbus-glib-tool.c (main): Parse ignore_unsupported
- argument, pass it to dbus_binding_tool_output_glib_client.
-
- * glib/dbus-binding-tool-glib.c
- (generate_client_glue): Protect against multiple inclusion.
- (dbus_binding_tool_output_glib_client): Add
- G_BEGIN_DECLS/G_END_DECLS.
-
- * glib/dbus-binding-tool-glib.c (compute_client_method_name):
- Change to just take iface prefix directly.
- (write_formal_parameters): Clarify error message.
- (check_supported_parameters): New function; checks to see type
- signatures of method parameters are supported.
- (generate_client_glue): Handle ignore_unsupported flag.
- (dbus_binding_tool_output_glib_client): Handle ignore_unsupported
- parameter.
-
- * glib/Makefile.am (dbus-glib-bindings.h): Pass
- --ignore-unsupported by default until glib bindings
- support arrays.
-
-2005-03-11 Colin Walters <walters@verbum.org>
-
- * glib/Makefile.am: Generate dbus-glib-bindings.h and
- install it.
-
- * bus/print-introspect.c: New file; prints introspection
- data for a given name and object path.
-
- * bus/run-with-tmp-session-bus.sh: New file, refactored
- from test/glib/run-test.sh. Creates a temporary session
- bus and runs another program.
-
- * test/glib/run-test.sh: Refactor to invoke
- run-with-tmp-session-bus.sh.
-
- * bus/driver.c (bus_driver_handle_introspect): Fix to print new
- introspection format. Also change to use DBUS_TYPE_x_AS_STRING
- macros instead of hardcoding.
-
- * glib/.cvsignore, bus/.cvsignore, test/glib/.cvsignore: Update.
-
-2005-03-11 Joe Shaw <joeshaw@novell.com>
-
- * dbus/dbus-connection.c (dbus_connection_send_with_reply): Remove
- this unref; it doesn't match up evenly in some codepaths.
- (_dbus_connection_block_pending_call): Unref at every exitpoint;
- this evenly matches with the ref near the top of this function.
-
-2005-03-09 Joe Shaw <joeshaw@novell.com>
-
- * dbus/dbus-object-tree.c
- (_dbus_object_tree_unregister_and_unlock): If checks are enabled
- and we try to unregister a path that's not registered, still go
- through the process of unlocking and don't just return.
-
-2005-03-09 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_invoke): New method; calls
- to this are generated for client-side wrappers. Invokes a
- D-BUS method and returns reply values.
-
- * glib/dbus-binding-tool-glib.c (write_args_sig_for_direction): New
- function; writes signature string for argument direction.
- (write_args_for_direction): Change to pass input values directly
- instead of via address, and fix indentation.
- (generate_client_glue): Change to invoke dbus_g_proxy_invoke. Also
- make generated wrappers inlineable.
-
- * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Add
- note about using dbus_type_is_fixed.
-
- * dbus/dbus-marshal-basic.c (_dbus_type_is_fixed): Moved to
- dbus/dbus-signature.c as dbus_type_is_fixed.
-
- All callers updated.
-
- * dbus/dbus-signature.c (dbus_type_is_fixed): Moved here
- from dbus/dbus-marshal-basic.c:_dbus_type_is_fixed.
-
- * dbus/dbus-signature.h: Prototype.
-
- * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Fix
- error printf code.
-
- * test/glib/test-dbus-glib.c (main): Be sure to clear error as
- appropriate instead of just freeing it.
- (main): Free returned strings using g_free.
-
- * test/glib/Makefile.am (test-service-glib-glue.h)
- (test-service-glib-bindings.h): Add dependency on dbus-binding-tool.
-
- * glib/dbus-gvalue.c (MAP_BASIC): Refactored from MAP_BASIC_INIT;
- simply maps a simple D-BUS type to GType.
- (dbus_dbus_type_to_gtype): Function which maps D-BUS type to
- GType.
- (dbus_gvalue_init): Just invoke dbus_dbus_type_to_gtype and
- initialize the value with it.
- (dbus_gvalue_binding_type_from_type): Unused, delete.
- (dbus_gvalue_demarshal): Switch to hardcoding demarshalling for
- various types instead of unmarshalling to value data directly.
- Remove can_convert boolean.
- (dbus_gvalue_marshal): Remove duplicate initialization; switch to
- returning directly instead of using can_convert boolean.
- (dbus_gvalue_store): New function; not related to D-BUS per-se.
- Stores a GValue in a pointer to a value of its corresponding C
- type.
-
- * glib/dbus-gvalue.h: Remove dbus_gvalue_binding_type_from_type,
- add dbus_gvalue_store.
-
-2005-03-08 Joe Shaw <joeshaw@novell.com>
-
- Fix a bunch of lifecycle and memory management problems
- in the mono bindings.
-
- * mono/Arguments.cs (Arguments): Implement IDisposable
-
- * mono/Bus.cs (Bus): Don't allow public instantiation. This is
- strictly a static class.
-
- * mono/Connection.cs: Move the DBusObjectPathVTable and associated
- delegates into this file.
- (Connection): Implement IDisposable.
- (Dispose): Disconnect the connection and set the raw connection
- pointer to IntPtr.Zero.
- (~Connection): Call Dispose().
- (RegisterObjectPath): Added. Manages the registration of object
- paths so we can cleanly disconnect them at dispose/finalize time.
- (UnregisterObjectPath): Ditto.
- (set_RawConnection): Unregister all of the object paths when
- changing the underlying DBusConnection. Add them back onto the
- new connection, if any.
-
- * mono/Handler.cs: Don't implement IDisposable; it doesn't use any
- more unmanaged resources anymore, so it's not necessary. Move all
- the DBusObjectPathVTable stuff out of here.
- (Handler): Save references to our delegates so that they don't get
- finalized. Call Connection.RegisterObjectPath() instead of
- dbus_connection_register_object_path() directly.
- (Message_Called): Dispose the message after we're finished with
- it.
-
- * mono/Message.cs (Message): Implement IDisposable.
- (Dispose): Dispose the Arguments, and set the RawMessage to
- IntPtr.Zero.
- (SendWithReplyAndBlock): We own the ref to the reply that comes
- back from dbus_connection_send_with_reply_and_block() so add a
- comment about that and unref it after we've constructed a managed
- MethodReturn class around it. Fixes a big, big leak.
-
- * mono/ProxyBuilder.cs: Reflect into Message to get the Dispose
- method.
- (BuildSignalHandler): After we've sent the Signal message, dispose
- of it.
- (BuildMethod): Dispose of the method call and reply messages after
- we've sent the message and extracted the data we want from the
- reply.
-
- * mono/Service.cs (UnregisterObject): Don't call handler.Dispose()
- anymore.
- (Service_FilterCalled): Dispose of the message after we're
- finished with it.
-
-2005-03-08 Joe Shaw <joeshaw@novell.com>
-
- * dbus/dbus-connection.c (dbus_connection_send_with_reply):
- After we attach our pending call to the connection, unref
- it. Fixes a leak.
-
- * mono/Connection.cs (set_RawConnection): Disconnect our
- filter and match callbacks from the old connection and
- reconnect them to the new connection, if any.
-
- * mono/DBusType/Array.cs: "Code" is a static member, so
- don't use "this" to refer to it. Fix for stricter checking
- in Mono 1.1.4.
-
- * mono/DBusType/ObjectPath.cs (Append): Don't leak the
- object path that we pass into unmanaged code.
-
- * mono/DBusType/String.cs (Append): Don't leak the string
- that we pass into unmanged code.
-
-2005-03-07 John (J5) Palmieri <johnp@redhat.com>
- * NEWS: Update for 0.31
-
- * configure.in: Release 0.31
- add LT_CURRENT, LT_REVISION, LT_AGE for easy soname bumping
-
- * qt/Makefile.am: fixed build
-
- * dbus/Makefile.am: soname bump for libdbus
-
- * glib/Makefile.am: soname bump for libdbus-glib
-
-2005-03-05 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c:
- (pseudorandom_generate_random_bytes_buffer): fix to have no return
- value
- (_dbus_generate_random_bytes_buffer): fix return value
-
- * dbus/dbus-sysdeps-util.c: s/GETPWNAME/GETPWNAM/ so configure
- checks actually work, from Tom Parker <fdo@tevp.net>
-
-2005-03-01 Colin Walters <walters@verbum.org>
-
- * test/glib/test-dbus-glib.c (lose, lose_gerror): Utility
- functions copied from dbus-glib-tool.c.
- (main): Convert lots of error code to use them.
- Also add some testing for introspection bits.
-
-2005-03-01 Colin Walters <walters@verbum.org>
-
- * doc/TODO: Remove introspection signature TODO.
-
-2005-02-27 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gidl.c (property_info_get_type, arg_info_get_type):
- Change return value to const char * instead of int so we can do
- full signatures.
- (struct PropertyInfo, struct ArgInfo): Store char *.
- (property_info_new, arg_info_new): Update parameters, strdup.
- (property_info_unref, arg_info_unref): Free.
-
- * glib/dbus-gidl.h: Update prototypes.
-
- * glib/dbus-gparser.c (basic_type_from_string): Delete.
- (validate_signature): New function, just validates signature and
- sets GError.
- (parse_property, parse_arg): Invoke validate_signature. Store
- signature instead of just type code.
-
- * glib/dbus-gvalue.c (base_type_from_signature): New utility
- function to return a primary type for a signature, dropping
- information about types in container types.
- (dbus_gvalue_genmarshal_name_from_type)
- (dbus_gvalue_binding_type_from_type)
- (dbus_gvalue_ctype_from_type): Update to take full signature
- instead of type code.
- (dbus_gtype_to_dbus_type): Moved here from glib/dbus-gobject.c.
-
- * glib/dbus-gvalue.h: Update prototypes for above.
-
- * glib/dbus-gobject.c (gtype_to_dbus_type): Moved to
- glib/dbus-gvalue.c as dbus_gtype_to_dbus_type.
- (introspect_properties, introspect_signals, write_interface):
- Update to handle signatures, and remove usage of
- _dbus_gutils_type_to_string.
- (handle_introspect): Print out type codes instead of e.g. "string"
- in hardcoded introspection XML; also use x_AS_STRING constants
- instead of hardcoding in string.
-
- * glib/dbus-glib-tool.c (pretty_print): Handle signature change
- to string. Remove usage of _dbus_gutils_type_to_string.
-
- * glib/dbus-gutils.c (_dbus_gutils_type_to_string): Delete.
-
- * glib/dbus-gutils.h (_dbus_gutils_type_to_string): Update for
- deletion.
-
- * glib/dbus-binding-tool-glib.c (compute_marshaller)
- (compute_marshaller_name, generate_glue): Handle signature change
- to string.
- (write_formal_parameters, write_args_for_direction): Ditto, and
- remove FIXME.
-
- * tools/dbus-tree-view.c (type_to_string): Delete.
- (info_set_func_text): Update to print full signatures.
-
- * test/glib/test-service-glib.xml: Change types to new
- introspection format.
-
-2005-02-26 Havoc Pennington <hp@redhat.com>
-
- * doc/TODO: remove the "guid" item
-
- * test/glib/test-profile.c (no_bus_thread_func): use open_private
- (with_bus_thread_func): use open_private
-
- * dbus/dbus-connection.c (dbus_connection_open_private): new
- function that works like the old dbus_connection_open()
- (dbus_connection_open): now returns an existing connection if
- possible
-
- * dbus/dbus-server-unix.c (handle_new_client_fd_and_unlock): pass
- through the GUID to the transport
-
- * dbus/dbus-server.c (_dbus_server_init_base): keep around the
- GUID in hex-encoded form.
-
- * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
- pass GUID argument in to the transport
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): add
- guid argument
-
- * dbus/dbus-transport.c (_dbus_transport_init_base): add guid argument
-
- * dbus/dbus-auth.c (_dbus_auth_server_new): add guid argument
-
-2005-02-25 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: document the GUID thing
-
- * dbus/dbus-server.c (_dbus_server_init_base): initialize a
- globally unique ID for the server, and put a "guid=hexencoded"
- field in the address
-
- * dbus/dbus-bus.c: fix missing #include of dbus-threads-internal.h
-
- * dbus/dbus-message.c: ditto
-
- * dbus/dbus-dataslot.c: ditto
-
- * dbus/dbus-list.c: ditto
-
- * dbus/dbus-internals.h: wait, just include
- dbus-threads-internal.h here
-
- * dbus/dbus-string.c (_dbus_string_copy_to_buffer): move back for
- use in main library
-
- * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes_buffer): new function
-
-2005-02-24 Colin Walters <walters@verbum.org>
-
- * test/glib/Makefile.am (EXTRA_DIST): Add test-service-glib.xml
-
-2005-02-24 John (J5) Palmieir <johnp@redhat.com>
-
- * glib/Makefile.am: added dbus-gobject.h to sources list
- so distcheck doesn't fail
-
-2005-02-24 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-server.c, dbus/dbus-server-unix.c: change semantics so
- you must disconnect before unref, since locking and other things
- are screwed up otherwise. Fix assorted other locking stuff.
-
- * dbus/dbus-signature.c (dbus_signature_iter_get_element_type):
- fix compilation
-
- * dbus/dbus-threads-internal.h: move the mutex/condvar wrappers
- into a private header and don't export from the library
-
- * throughout - call _dbus_thread_stuff vs. dbus_thread_stuff
-
-2005-02-24 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-signature.c: New file; implements various functions
- related to type signatures. Includes an interator for parsing,
- validation functions.
- (dbus_type_is_basic): Moved here from
- dbus-marshal-basic.c:_dbus_type_is_basic.
- (dbus_type_is_container): Moved here from
- dbus-marshal-basic.c:_dbus_type_is_container.
-
- All callers of _dbus_type_is_container and _dbus_type_is_basic
- updated, and include dbus-signature.h.
-
- * dbus/dbus-signature.h: New file; prototypes for the above.
-
- * dbus/Makefile.am (DBUS_LIB_SOURCES): Add dbus-signature.c,
- dbus-signature.h.
-
- * dbus/dbus-marshal-basic.c (map_type_char_to_type): New utility
- function factored out of _dbus_first_type_in_signature.
- (_dbus_first_type_in_signature_c_str): New function; returns first
- type code for a type signature character.
-
- * dbus/dbus-marshal-basic.h: Prototype _dbus_first_type_in_signature_c_str,
- handle function moves.
-
- * dbus/dbus-marshal-recursive.h: Export _dbus_type_signature_next.
-
- * dbus/dbus-marshal-recursive.c (_dbus_type_signature_next): New
- function; skips to next complete type in type signature.
- Implemented using previous skip_one_complete_type. Now
- skip_one_complete_type just delegates to
- _dbus_type_signature_next.
-
- * dbus/dbus-marshal-basic.c (_dbus_type_is_basic): Moved
- to dbus-signature.c
- (_dbus_type_is_container): Ditto.
-
- * doc/dbus-specification.xml: Update introspection sample to
- use real type signatures.
-
- * dbus/dbus-test.h: Prototype signature test.
-
- * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Run
- signature tests.
-
- * dbus/dbus-protocol.h (DBUS_ERROR_INVALID_SIGNATURE): New error.
-
-2005-02-23 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in (PendingCall::get_reply):
- s/dbus_pending_call_get_reply/dbus_pending_call_steal_reply
-
-2005-02-21 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-test-main.c (main): Take optional specific test
- argument.
-
- * dbus/dbus-test.c (run_test): New function, runs a test function
- with no data directory.
- (run_data_test): Like above, but takes data directory.
- (dbus_internal_do_not_use_run_tests): Take
- specific test argument. Replace lots of cut n' paste code
- with run_test and run_data_test.
-
- * dbus/dbus-test.h: Update prototype for
- dbus_internal_do_not_use_run_tests.
-
-2005-02-20 Havoc Pennington <hp@redhat.com>
-
- Fix bugs reported by Daniel P. Berrange
-
- * dbus/dbus-server.c (_dbus_server_unref_unlocked): new function
- (protected_change_watch): new function
- (_dbus_server_toggle_watch, _dbus_server_remove_watch)
- (_dbus_server_add_watch): change to work like the
- dbus-connection.c equivalents; like those, probably kind of
- busted, but should at least mostly work for now
- (dbus_server_disconnect): drop the lock if we were already
- disconnected, patch from Daniel P. Berrange
-
- * dbus/dbus-server.c (_dbus_server_toggle_timeout)
- (_dbus_server_remove_timeout, _dbus_server_add_timeout): all the
- same stuff
-
- * doc/TODO: todo about unscrewing this mess
-
-2005-02-19 Colin Walters <walters@verbum.org>
-
- * glib/dbus-binding-tool-glib.c
- (dbus_binding_tool_output_glib_server): Fix iochannel refcounting.
-
- * glib/dbus-glib-tool.c: Include dbus-glib-tool.h, as well
- as errno.h and sys/stat.h.
- (lose): New function, prints error with
- newline and exits.
- (lose_gerror): Similar, but takes GError for message.
- (main): Add --output argument to specify output file to write to,
- instead of always printing to stdout. In this mode, determine
- timestamps on source files to see whether any are newer than the
- target file. If not, exit. Also convert a number of error
- messages to use lose (since it's shorter), and switch to using
- g_io_channel_shutdown.
-
-2005-02-19 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gobject.c
- (_dbus_glib_marshal_dbus_message_to_gvalue_array): add docs
-
- * glib/dbus-glib.c: fix doxygen warnings
-
- * glib/dbus-gparser.c (parse_annotation): error if an annotation
- is found on an <arg>
-
-2005-02-17 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gobject.h: Don't export
- _dbus_glib_marshal_dbus_message_to_gvalue_array.
-
- * glib/dbus-gobject.c (_dbus_glib_marshal_dbus_message_to_gvalue_array): Do rename.
- (invoke_object_method): Handle it.
-
- * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller):
- Handle rename.
-
-2005-02-17 Colin Walters <walters@verbum.org>
-
- * bus/.cvsignore, doc/.cvsignore
- * test/data/valid-service-files/.cvsignore, test/glib/.cvsignore:
- Update.
-
-2005-02-17 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS):
- Rename to DBUS_SERVICE_DBUS.
- (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS.
- (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL.
- Change the value from "org.freedesktop.Local"
- to "org.freedesktop.DBus.Local".
- (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS.
- (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to
- DBUS_INTERFACE_INTROSPECTABLE.
- Change the value from "org.freedesktop.Introspectable"
- to "org.freedesktop.DBus.Introspectable".
- (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to
- DBUS_INTERFACE_PROPERTIES.
- Change the value from "org.freedesktop.Properties"
- to "org.freedesktop.DBus.Properties".
- (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to
- DBUS_INTERFACE_PEER.
- Change the value from "org.freedesktop.Peer"
- to "org.freedesktop.DBus.Peer".
- (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL):
- DBUS_INTERFACE_LOCAL.
- Change the value from "org.freedesktop.Local"
- to "org.freedesktop.DBus.Local".
-
- All other users of those constants have been changed.
-
- * bus/driver.c (bus_driver_handle_introspect): Use constants.
-
- * glib/dbus-gobject.c (handle_introspect): Use constants.
-
- * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename.
-
-2005-02-17 Colin Walters <walters@verbum.org>
-
- * glib/dbus-gparser.c (struct Parser): Add in_annotation boolean.
- (parse_node, parse_interface, parse_method, parse_signal)
- (parse_property, parse_annotation): Lose if we're currently in an
- annotation.
- (parse_annotation): New function.
- (parser_start_element, parser_end_element): Handle annotation.
- (parse_method, parse_interface): Remove support for c_name attribute,
- switch to annotations.
-
- * glib/dbus-gidl.h (interface_info_get_binding_names)
- (method_info_get_binding_names)
- (interface_info_get_binding_name, method_info_get_binding_name)
- (interface_info_set_binding_name, method_info_set_binding_name):
- Remove.
- (interface_info_get_annotations, method_info_get_annotations)
- (interface_info_get_annotation, method_info_get_annotation)
- (interface_info_add_annotation, method_info_add_annotation):
- Prototype.
-
- * glib/dbus-gidl.c (struct InterfaceInfo): Substitute "annotations"
- for "bindings".
- (struct MethodInfo): Ditto.
- Straightfoward conversion of binding methods into annotation methods
- as prototyped.
-
- * glib/dbus-glib-tool.c (pretty_print): Print annotations.
-
- * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_C_SYMBOL): Define.
-
- * glib/dbus-binding-tool-glib.c (gather_marshallers, generate_glue):
- Use new annotation API.
-
- * doc/introspect.dtd: Fix a number of DTD syntax errors. Add
- annotation element.
-
- * doc/dbus-specification.xml: Discuss introspection annotations,
- include list of well-known annotations.
-
- * test/glib/test-service-glib.xml: Make validate against new DTD.
-
-2005-02-17 Colin Walters <walters@verbum.org>
-
- This patch is based on initial work from
- Paul Kuliniewicz <kuliniew@purdue.edu>.
-
- * glib/dbus-gvalue.c (dbus_gvalue_init): New function; move
- initialization of GValue from dbus type to here.
- (dbus_gvalue_genmarshal_name_from_type): New function; generates a string
- for the "glib-genmarshal" program from a DBus type.
- (dbus_gvalue_binding_type_from_type): New function; turns a DBus type
- into the C name for it we use in the glib bindings.
- (dbus_gvalue_ctype_from_type): New function; maps a DBus type into a
- glib C type (not GValue).
- (dbus_gvalue_demarshal): invoke dbus_gvalue_init.
-
- * glib/dbus-gutils.c (_dbus_gutils_wincaps_to_uscore): Moved here
- from dbus-gobject.c.
-
- * glib/dbus-gutils.h: Prototype it.
-
- * glib/dbus-gproxy.c: Include new dbus-gobject.h.
- (marshal_dbus_message_to_g_marshaller): Use new shared function
- dbus_glib_marshal_dbus_message_to_gvalue_array.
-
- * glib/dbus-gparser.c (parse_interface, parse_method): Handle c_name attribute.
- Will be changed once we have annotations.
-
- * glib/dbus-gobject.c: Change info_hash_mutex from GStaticMutex to
- GStaticRWLock. Callers updated.
- (wincaps_to_uscore): Move to dbus-gutils.c. Callers updated.
- (string_table_next): New function for iterating over zero-terminated
- string value array.
- (string_table_lookup): New function; retrieves specific entry in
- array.
- (get_method_data): New function; look up method data in object data chunk.
- (object_error_domain_prefix_from_object_info)
- (object_error_code_from_object_info): New functions, but not implemented yet.
- (method_interface_from_object_info): New function; retrieve interface name.
- (method_name_from_object_info): New function; retrieve method name.
- (method_arg_info_from_object_info): New function; retrieve argument data.
- (arg_iterate): New function; iterates over serialized argument data.
- (method_dir_signature_from_object_info): New function; returns a
- GString holding type signature for arguments for just one
- direction (input or output).
- (method_input_signature_from_object_info)
- (method_output_signature_from_object_info): New functions.
- (dbus_glib_marshal_dbus_message_to_gvalue_array): New shared function;
- converts dbus message arguments into a GValue array. Used for both
- signal handling and method invocation.
- (struct DBusGlibWriteIterfaceData): New utility structure.
- (write_interface): New function; generate introspection XML for
- an interface.
- (introspect_interfaces): New function; gathers all interface->methods,
- generates introspection XML for them.
- (handle_introspect): Invoke introspect_interfaces.
- (get_object_property): Be sure to zero-initalize stack-allocated GValue.
- (lookup_object_and_method): New function; examines an incoming message
- and attempts to match it up (via interface, method name, and argument
- signature) with a known object and method.
- (gerror_domaincode_to_dbus_error_name): New function; converts a
- GError domain and code into a DBus error name. Needs GError data
- added to object introspection to work well.
- (gerror_to_dbus_error_message): Creates a DBusMessage error return from
- GError.
- (invoke_object_method): New function to invoke an object method
- looked up via lookup_object_and_method. Parses the incoming
- message, turns it into a GValue array, then invokes the marshaller
- specified in the DBusGMethodInfo. Creates a new message with
- either return values or error message as appropriate.
- (gobject_message_function): Invoke lookup_object_and_method and
- invoke_object_method.
-
- * glib/dbus-glib-tool.c: Include dbus-binding-tool-glib.h.
- (enum DBusBindingOutputMode): New enum for binding output modes.
- (pretty_print): Print binding names.
- (dbus_binding_tool_error_quark): GError bits.
- (version): Fix typo.
- (main): Create GIOChannel for output. Parse new --mode argument,
- possible values are "pretty-print", "glib-server", "glib-client".
- Use mode to invoke appropriate function.
-
- * glib/dbus-gobject.h: Prototype dbus_glib_marshal_dbus_message_to_gvalue_array.
-
- * glib/dbus-glib-tool.h: New header, just includes GError bits
- for now.
-
- * glib/dbus-gidl.c (struct InterfaceInfo): Add bindings hashtable;
- maps binding style to name.
- (struct MethodInfo): Ditto.
- (get_hash_keys, get_hash_key): Utility function, returns keys for
- a GHashTable.
- (interface_info_new, method_info_new): Initialize bindings.
- (interface_info_unref, method_info_unref): Destroy bindings.
- (method_info_get_binding_names, method_info_get_binding_name)
- (interface_info_get_binding_names, interface_info_get_binding_name):
- Functions for retrieving binding names.
- (method_info_set_binding_name, interface_info_set_binding_name):
- Functions for setting binding names.
-
- * glib/dbus-binding-tool-glib.h: New file, has prototypes
- for glib binding generation.
-
- * glib/dbus-binding-tool-glib.c: New file, implements server-side
- and client-side glib glue generation.
-
- * glib/Makefile.am (dbus_binding_tool_SOURCES): Add
- dbus-binding-tool-glib.c, dbus-binding-tool-glib.h,
- dbus-glib-tool.h.
-
- * dbus/dbus-glib.h (struct DBusGMethodMarshaller): Remove in favor
- of using GClosureMarshal directly.
- (struct DBusGObjectInfo): Add n_infos member.
-
- * test/glib/test-service-glib.xml: New file; contains introspection data
- for MyTestObject used in test-service-glib.c.
-
- * test/glib/test-service-glib.c (enum MyObjectError): New GError enum.
- (my_object_do_nothing, my_object_increment, my_object_throw_error)
- (my_object_uppercase, my_object_many_args): New test methods.
- (main): Use dbus_g_object_class_install_info to include generated object
- info.
-
- * test/glib/Makefile.am: Generate server-side glue for test-service-glib.c,
- as well as client-side bindings.
-
- * test/glib/test-dbus-glib.c: Include test-service-glib-bindings.h.
- (main): Activate TestSuiteGLibService; test invoke a bunch of its methods
- using both the dbus_gproxy stuff directly as well as the generated bindings.
-
-2005-02-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): always
- complete a pending call, don't run filters first.
-
- * glib/dbus-gproxy.c (dbus_g_proxy_end_call): change to use
- dbus_pending_call_steal_reply
-
- * dbus/dbus-pending-call.c (dbus_pending_call_block): just call
- _dbus_connection_block_pending_call
- (dbus_pending_call_get_reply): change to steal_reply and return a
- ref
-
- * dbus/dbus-connection.c
- (dbus_connection_send_with_reply_and_block): port to work in terms
- of DBusPendingCall
- (_dbus_connection_block_pending_call): replace block_for_reply
- with this
-
-2005-02-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-userdb-util.c (_dbus_user_database_lookup_group):
- properly handle looking up group information by name; fix
- from j@bootlab.org
-
-2005-02-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_return_message)
- (dbus_connection_borrow_message): hold dispatch lock while message
- is outstanding
- (_dbus_connection_block_for_reply): hold dispatch lock while we
- block for the reply, so nobody steals our reply
- (dbus_connection_pop_message): hold the dispatch lock while we
- pluck the message
-
-2005-02-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (_dbus_connection_acquire_dispatch)
- (_dbus_connection_release_dispatch)
- (_dbus_connection_acquire_io_path)
- (_dbus_connection_release_io_path): make the mutex and condvar
- control access to the "acquired" flag. Drop the connection lock
- while waiting on the condvar. Hopefully these are baby steps in
- roughly the right direction.
-
-2005-02-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c: use separate mutexes for the condition
- variables; this is some kind of baseline for sanity, but the
- condition variables still aren't used correctly afaict
-
-2005-02-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock):
- fix a double-unlock
-
- * dbus/dbus-connection.c
- (_dbus_connection_detach_pending_call_unlocked): add this
-
- Initial semi-correct pass through to fix thread locking; there are
- still some issues with the condition variable paths I'm pretty
- sure
-
- * dbus/dbus-server.c: add a mutex on DBusServer and appropriate
- lock/unlock calls
-
- * dbus/dbus-connection.c (_dbus_connection_do_iteration_unlocked):
- rename to add _unlocked
- (struct DBusConnection): move "dispatch_acquired" and
- "io_path_acquired" to use only one bit each.
- (CONNECTION_LOCK, CONNECTION_UNLOCK): add checks with !DBUS_DISABLE_CHECKS
- (dbus_connection_set_watch_functions): hacky fix to reentrancy
- (_dbus_connection_add_watch, _dbus_connection_remove_watch)
- (_dbus_connection_toggle_watch, _dbus_connection_add_timeout)
- (_dbus_connection_remove_timeout)
- (_dbus_connection_toggle_timeout): drop lock when calling out to
- user functions; done in a hacky/bad way.
- (_dbus_connection_send_and_unlock): add a missing unlock
- (_dbus_connection_block_for_reply): add a missing unlock
-
- * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
- drop lock in a hacky probably unsafe way to call out to user
- function
-
-2005-02-12 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-tree-view.c (info_set_func_text): display more
- details on args
-
- * bus/driver.c (bus_driver_handle_list_services): list the bus
- driver
-
- * glib/dbus-gparser.c (parse_arg): generate an arg name if none is supplied
-
- * glib/dbus-gidl.c (signal_info_get_n_args): new function
- (method_info_get_n_args): new function
-
-2005-02-12 Havoc Pennington <hp@redhat.com>
-
- * bus/driver.c (bus_driver_handle_introspect): add introspection
- for bus driver
-
-2005-02-12 Havoc Pennington <hp@redhat.com>
-
- * bus/driver.c: put the signature of each bus driver method in the
- table of handlers and check it on incoming calls; this isn't
- really useful, but going to add introspect support in a minute.
-
-2005-02-11 Joe Shaw <joeshaw@novell.com>
-
- * mono/Connection.cs: The unpredictability of finalizers in mono
- prevents us from deterministically disconnecting the filters from
- the Service class's finalizer, so move tracking of filters and
- matches here. Add API for that.
-
- * mono/Service.cs: Remove the code, add code which calls the
- methods now on the Connection class.
-
-2005-02-11 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus.py (class Sender): added to support dbus signals better
- (Bus::add_signal_receiver): added expand_args parameter which defaults
- to True. When expand args is True the signal handler will pass the
- message arguments as parameters to the signal handler. If False
- revert to previous behavior where the signal handler must get the
- argument list from the message. This is to help port applications
- like HAL that have a tendancy to send variable length argument lists.
- self._match_rule_to_receivers is now a dict of dicts.
- (Bus::remove_signal_receiver): pop handler off the dict intead of
- removing it from a list
- (Bus::_signal_func): change signal handlers so that interface,
- signal_name, service, path and message are packed into a Sender
- object and that is passed to the handler. If expand_args is True
- extract the args list from the message and append it to the parameter
- list
-
- * python/dbus_bindings.pyx.in (class Signature): added to support
- signiature types
- (MessageIter::__init__): changed iteration limit to match D-BUS
- (MessageIter::get*): added INT16, UINT16, SIGNATURE, DICT_ENTRY,
- STRUCT and VARIENT type support
- (MessageIter::python_value_to_dbus_sig): made recursive to support
- recursive types
- (MessageIter::append*): added Signature, dict, tuple
- support
-
- * python/examples/example-client.py: added examples of getting tuples
- and dicts
-
- * python/examples/example-service.py: added examples of sending tuples
- and dicts
-
- * python/examples/example-signal-recipient.py: Fixed to handle new
- signal callback format
-
-2005-02-10 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-dbus-glib.c (main): fix so this test doesn't fail
- (call dbus_g_proxy_add_signal)
-
- * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
- escape the hostname
- (_dbus_server_new_for_domain_socket): escape the path
-
- * dbus/dbus-address.c (dbus_address_escape_value): new
- (dbus_address_unescape_value): new
- (dbus_parse_address): unescape values
-
- * dbus/dbus-string.c (_dbus_string_append_byte_as_hex): new function
-
- * doc/dbus-specification.xml: explain how to escape values in
- addresses
-
-2005-02-10 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-factory.c (generate_special): modify test to
- avoid using a non-basic dict key
-
- * dbus/dbus-marshal-validate-util.c: add test for the below
-
- * doc/dbus-specification.xml: require that dict keys are a basic
- type
-
- * dbus/dbus-marshal-validate.c
- (_dbus_validate_signature_with_reason): require that dict key is a
- basic type
-
-2005-02-10 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock):
- change to be _and_unlock instead of _unlocked
-
- * dbus/dbus-connection.c
- (_dbus_connection_send_preallocated_unlocked_no_update): rename to
- have no_update so we can find this bug quickly in future
-
-2005-02-10 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-util.c (verify_test_message): tests for string
- array
-
- * dbus/dbus-message.c (dbus_message_append_args_valist): add
- support for arrays of string/signature/path
-
-2005-02-10 Joe Shaw <joeshaw@novell.com>
-
- * dbus/dbus-connection.c
- (_dbus_connection_queue_received_message_link,
- _dbus_connection_message_sent): Add the path to
- the verbose output.
- (_dbus_connection_send_preallocated_and_unlock): Added. Calls
- _dbus_connection_send_preallocated_unlocked(), updated the
- dispatch status, and unlocks. Fixes a bug where certain
- situations (like a broken pipe) could cause a Disconnect message
- to not be sent, tricking the bus into thinking a service was still
- there when the process had quit.
- (_dbus_connection_send_preallocated): Call
- _dbus_connection_send_preallocated_and_unlock().
- (_dbus_connection_send_and_unlock): Added. Calls
- _dbus_connection_send_preallocated_and_unlock().
- (dbus_connection_send): Call _dbus_connection_send_and_unlock().
- (dbus_connection_send_with_reply): Update the dispatch status and
- unlock.
-
- * mono/Service.cs (~Service): Added. Removes the filter so that
- we don't get unmanaged code calling back into a GCed delegate.
- (RemoveFilter); Added.
-
-2005-02-09 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_iter_open_container):
- - Removed check for iterator type being an array because
- get_arg_type does not work with writer iterators
- - Pass NULL to _dbus_type_writer_recurse if signiture is NULL
-
-2005-02-07 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: some more language cleanups; add
- stuff about how to deal with invalid protocol and extension
- points; add _ to allowed chars in auth commands; add EXTENSION_
- auth command prefix
-
-2005-02-06 Havoc Pennington <hp@redhat.com>
-
- * s/expected/required/ in a couple places for clarity
-
-2005-02-07 Colin Walters <walters@verbum.org>
-
- * bus/selinux.c (bus_selinux_allows_send): Handle NULL for
- sender or proposed_recipient.
-
-2005-02-06 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-factory.c (generate_special): more tests
-
- * dbus/dbus-marshal-validate.c (validate_body_helper): detect
- array length that exceeds the maximum
-
-2005-02-05 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-factory.c (generate_special): more test cases,
- increasing coverage
-
- * dbus/dbus-marshal-validate.c (validate_body_helper): return the
- reason why a signature was invalid
-
- * dbus/dbus-marshal-header.c (load_and_validate_field): fix to
- skip the length of the string before we look at it in validation
-
- * dbus/dbus-string-util.c (_dbus_string_test): add tests for
- equal_substring
-
- * dbus/dbus-message.c (_dbus_message_loader_new): default
- max_message_length to DBUS_MAXIMUM_MESSAGE_LENGTH
-
-2005-02-05 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal-validate.c (validate_body_helper): fix crash
- if the signature of a variant was empty
- (_dbus_validate_signature_with_reason): catch "(a)" (array inside
- struct with no element type)
-
- * dbus/dbus-message-factory.c (generate_uint32_changed): add more
- mangled messages to break things
-
-2005-02-04 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_disconnect_signal): use
- g_quark_try_string() so it actually can return 0
- (dbus_g_proxy_connect_signal): ditto
-
-2005-02-04 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): fix a
- bogus warning
- (tristring_from_message): assert cleanly on null path/interface
- (should not be possible though I decided later)
- (dbus_g_proxy_dispose): move proxy manager unregistration here
- (DBUS_G_PROXY_DESTROYED): add this macro, and use it in a bunch of
- g_return_if_fail() checks
-
-2005-02-04 Havoc Pennington <hp@redhat.com>
-
- * doc/Makefile.am (EXTRA_DIST): add DTDs to makefile
-
- * doc/introspect.dtd: add introspect.dtd from David A. Wheeler
- (with some minor changes)
-
- * doc/dbus-specification.xml: add deprecated attribute to
- introspection format
-
-2005-01-31 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c: rewrite how signals work again, this time I
- think it's sort of right
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-viewer.c: kind of half-ass hook up the option menu.
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-names-model.c: dynamically watch NameOwnerChanged
-
- * autogen.sh: change to autotools 1.9
-
- * glib/dbus-gproxy.c: completely change how signals work
- (dbus_g_proxy_add_signal): new function to specify signature of a
- signal
- (dbus_g_proxy_emit_received): marshal the dbus message to GValues,
- and g_warning if the incoming message has the wrong signature.
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-names-model.c (have_names_notify): fix this
-
- * dbus/dbus-message.c (_dbus_message_iter_get_args_valist): clean
- up the string array handling a bit
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-glib.c (dbus_g_pending_call_set_notify): new function
- (dbus_g_pending_call_cancel): new function
-
- * dbus/dbus-glib.h: move GType decls for connection/message here;
- * dbus/dbus-glib.c: move all the g_type and ref/unref stuff in
- here, just kind of rationalizing how we handle all that
-
- * tools/dbus-names-model.c: new file for a tree model listing the
- services on a bus
-
- * tools/dbus-tree-view.c (model_new): use proper typing on the
- model rows
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gmain.c: add a custom GSource back that just checks
- whether the message queue has anything in it; otherwise, there are
- cases where we won't see messages in the queue since there was no
- IO visible to the glib main loop
-
- * dbus/dbus-connection-internal.h (_DBUS_DEFAULT_TIMEOUT_VALUE):
- increase default message timeout to 25 seconds
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c (no_bus_stop_server): remove the
- warning about the g_warning that I just fixed
-
- * glib/dbus-gmain.c: rewrite the main loop stuff to avoid the
- custom source, seems to be a lot easier to understand and work
- better.
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- I think this main loop thing is conceptually broken, but here are
- some band aids. I'll maybe rewrite it in a minute.
-
- * glib/dbus-gmain.c (add_timeout): timeout stuff doesn't use the
- custom GSource, so don't pass it in; confusing
- (gsource_server_finalize, gsource_connection_finalize): add
- finalize handlers that remove all the watches.
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gobject.c (introspect_properties): fix the XML
- generated
-
- * dbus/dbus-message.c (dbus_message_unref): add an in_cache flag
- which effectively detects the use of freed messages
-
- * glib/dbus-gobject.c (handle_introspect): modify and return the
- reply message instead of the incoming message
-
- * dbus/dbus-object-tree.c (handle_default_introspect_unlocked):
- gee, maybe it should SEND THE XML instead of just making a string
- and freeing it again ;-)
-
- * tools/dbus-print-message.c (print_message): improve printing of
- messages
-
- * configure.in: add debug-glib.service to the output
-
-2005-01-30 Havoc Pennington <hp@redhat.com>
-
- dbus-viewer introspected and displayed the bus driver
-
- * dbus/dbus-object-tree.c
- (object_tree_test_iteration): add tests for a handler registered on "/"
-
- * dbus/dbus-object-tree.c
- (_dbus_decompose_path): fix to handle path "/" properly
- (run_decompose_tests): add tests for path decomposition
-
- * glib/dbus-gutils.c (_dbus_gutils_split_path): fix to handle "/"
- properly
-
- * glib/dbus-gobject.c (handle_introspect): fix quotes
-
- * test/glib/run-test.sh: support launching the bus, then running
- dbus-viewer
-
- * test/glib/test-service-glib.c (main): put in a trivial gobject
- subclass and register it on the connection
-
- * bus/driver.c (bus_driver_handle_introspect): implement
- introspection of the bus driver service
-
- * dbus/dbus-protocol.h: add #defines for the XML namespace,
- identifiers, doctype decl
-
- * bus/driver.c (bus_driver_handle_get_service_owner): handle
- attempts to get owner of DBUS_SERVICE_ORG_FREEDESKTOP_DBUS by
- returning the service unchanged.
- (bus_driver_handle_message): remove old check for reply_serial in
- method calls, now the message type deals with that
- (bus_driver_handle_message): handle NULL interface
-
- * glib/dbus-gproxy.c (dbus_g_proxy_get_bus_name): new function
-
- * glib/dbus-gloader-expat.c (description_load_from_string): allow
- -1 for len
-
- * tools/dbus-viewer.c: add support for introspecting a service on
- a bus
-
- * glib/dbus-gproxy.c (dbus_g_pending_call_ref): add
- (dbus_g_pending_call_unref): add
-
-2005-01-29 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-tree-view.c: add support for displaying properties.
- (run dbus-viewer with an introspect xml file as arg, then resize
- the window so the tree elements show up, not sure what that is)
-
- * glib/dbus-gobject.c (handle_introspect): return
- org.freedesktop.Properties and org.freedesktop.Introspectable
- interfaces when we are introspected.
-
- * doc/dbus-specification.xml: allow empty interface name when
- Get/Set a property
-
-2005-01-29 Havoc Pennington <hp@redhat.com>
-
- * glib/Makefile.am: rename dbus-glib-tool to dbus-binding-tool;
- though it uses glib, it could be extended for any binding in
- principle
-
- * glib/dbus-gobject.c (gobject_message_function): change to the
- new way properties work
-
- * dbus/dbus-protocol.h: add the new interfaces
-
- * doc/dbus-specification.xml: document the introspection format,
- Introspectable interface, and add an org.freedesktop.Properties
- interface.
-
- * glib/dbus-gparser.c: add support for a <property> element
-
- * glib/dbus-gidl.c: add PropertyInfo
-
- * glib/dbus-gobject.c (handle_introspect): put the outermost
- <node> outside the signal and property descriptions.
- (introspect_properties): export properties as <property> rather
- than as method calls
-
-2005-01-28 Havoc Pennington <hp@redhat.com>
-
- * doc/TODO, doc/dbus-specification.xml: spec and TODO tweaks
- related to authentication protocol
-
-2005-01-28 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in: Updated to handle new D-BUS type system
- - BUS_ACTIVATION -> BUS_STARTER
- - DBUS_BUS_ACTIVATION -> DBUS_BUS_STARTER
- - class MessageIter (__init__): Added recursion checking
- so we throw a nice error instead of just disconnecting from the
- bus.
- (get): Added arg_type parameter for recursion.
- Removed the nil type
- Added signiture type placeholder (not implemented)
- Added struct type placeholder (not implemented)
- Added varient type placeholder (not implemented)
- Commented out dict type for now
- (get_element_type): renamed from get_array_type
- (get_*): changed to use the dbus_message_iter_get_basic API
- (get_*_array): removed in favor of recursive get_array method
- (get_array): new recursive method which calls get to marshal
- the elements of the array
- (value_to_dbus_sig): New method returns the corrasponding
- dbus signiture to a python value
- (append): Comment out dict handling for now
- Handle lists with the new recursive API
- Comment out None handling for now
- (append_nil): removed
- (append_*): changed to use dbus_message_iter_append_basic API
- (append_*_array): removed in favor of recursive append_array
- method
- (__str__): Make it easier to print out recursive iterators
- for debugging
- - class Message (__str__): moved type inspection to the
- MessageIter class' __str__ method
- (get_iter): Added an append parameter wich defaults to False
- If True use the new API's to create an append iterator
-
- * python/dbus.py: Update to use new bindings API
- - TYPE_ACTIVATION -> TYPE_STARTER
- - class Bus (_get_match_rule): GetServiceOwner -> GetNameOwner
- - class ActivationBus -> class StarterBus
- - class RemoteObject (__call__): get an append iterator
- - (_dispatch_dbus_method_call): get an append iterator
- - class Object (emit_signal): get an append iterator
-
- * python/examples/: Fixed up the examples to work with the new API
-
-2005-01-28 Joe Shaw <joeshaw@novell.com>
-
- * configure.in: Bump version up to 0.30.
-
- * HACKING: Add a release item to bump the version number up after
- a release.
-
-2005-01-28 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: update to describe 16-bit types and
- dict entries
-
- * dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken
- assertion
-
- * dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a
- type
-
- * dbus/dbus-marshal-recursive.c: implement
-
-2005-01-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-arch-deps.h.in: add 16/32-bit types
-
- * configure.in: find the right type for 16 and 32 bit ints as well
- as 64
-
- * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add
- the 16-bit types so people don't have to stuff them in 32-bit or
- byte arrays.
-
-2005-01-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c: byteswap the message if you init an
- iterator to read/write from it
-
- * dbus/dbus-marshal-byteswap.c: new file implementing
- _dbus_marshal_byteswap()
-
- * dbus/dbus-marshal-basic.c: add _dbus_swap_array()
-
-2005-01-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal-validate-util.c: break this out (and fix
- build, apparently - nobody noticed?)
-
-2005-01-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal-recursive.h: remove todo comment
-
-2005-01-25 Joe Shaw <joeshaw@novell.com>
-
- * Land the mono binding changes to conform to the new APIs.
-
- * mono/Makefile.am: Remove Custom.cs, DBusType/Custom.cs,
- DBusType/Dict.cs, and DBusType/Nil.cs from the build.
-
- * mono/Arguments.cs (GetCodeAsString): Added. Returns the dbus
- type code as a string.
- (InitAppending): Rename dbus_message_append_iter_init() to
- dbus_message_iter_init_append().
-
- * mono/BusDriver.cs: Rename ServiceEventHandler to
- NameOwnerChangedHandler. Rename GetServiceOwner to GetOwner.
- Rename ServiceOwnerChanged to NameOwnerChanged.
-
- * mono/Connection.cs: Rename BaseService to UniqueName, and the
- underlying C call.
-
- * mono/Custom.cs: Removed. The CUSTOM type has been removed.
-
- * mono/Service.cs: Rename Exists to HasOwner, internally rename
- dbus_bus_acquire_service() to dbus_bus_request_name().
-
- * mono/DBusType/Array.cs (ctor): Use Type.GetElementType() instead
- of Type.UnderlyingSystemType to get the correct element type for
- the array.
- (ctor): Update code for new APIs: use dbus_message_iter_recurse(),
- dbus_message_get_{element|arg}_type() instead of
- dbus_message_iter_init_array_iterator().
- (Append): Replace dbus_message_iter_append_array() with
- dbus_message_iter_open_container() and
- dbus_message_iter_close_container().
-
- * mono/DBusType/Custom.cs, mono/DBusType/Nil.cs: Removed. These
- types have been removed.
-
- * mono/DBusType/*.cs: Replace calls of
- dbus_message_iter_get_[type]() to dbus_message_iter_get_basic(),
- but specify the type in the DllImport extern declaration. Ditto
- for dbus_message_iter_append_[type]() ->
- dbus_message_iter_append_basic().
-
- * mono/example/BusListener.cs: Update for ServiceEventHandler ->
- NameOwnerChangedHandler.
-
-2005-01-25 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in: Rename of methods and bindings
- - get_base_service -> get_unique_name
- - bus_get_base_service -> bus_get_unique_name
- - dbus_bus_get_base_service -> dbus_bus_get_unique_name
- - ACTIVATION_REPLY_ACTIVATED -> DBUS_START_REPLY_SUCCESS
- - ACTIVATION_REPLY_ALREADY_ACTIVE -> DBUS_START_REPLY_ALREADY_RUNNING
- - bus_activate_service -> bus_start_service_by_name
- - dbus_bus_activate_service -> dbus_bus_start_service_by_name
- - bus_acquire_service -> bus_request_name
- - dbus_bus_acquire_service -> dbus_bus_request_name
- - bus_service_exists -> bus_name_has_owner
- - dbus_bus_service_exists -> dbus_bus_name_has_owner
-
- * python/dbus.py: Rename of methods
- - activate_service -> start_service_by_name
- - bus_acquire_service -> bus_request_name
- - ACTIVATION_REPLY_ACTIVATED -> START_REPLY_SUCCESS
- - ACTIVATION_REPLY_ALREADY_ACTIVE -> START_REPLY_ALREADY_RUNNING
-
-
-2005-01-24 Joe Shaw <joeshaw@novell.com>
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): Print out the
- signature for the method that can't be found.
-
- * dbus/dbus-message.c (dbus_message_iter_init): To check to see if
- the message has any arguments, we need to call
- _dbus_type_reader_get_current_type(), not
- _dbus_type_reader_has_next().
-
-2005-01-24 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-factory.c: more testing of message validation
-
- * dbus/dbus-protocol.h (DBUS_MINIMUM_HEADER_SIZE): move to this
- header
-
-2005-01-23 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-factory.c, dbus/dbus-message-util.c:
- get this all working, not many tests in the framework yet though
-
-2005-01-22 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-faq.xml, doc/dbus-tutorial: add a FAQ and update
- tutorial, based on work from David Wheeler.
-
-2005-01-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-bus.c: add more return_if_fail checks
-
- * dbus/dbus-message.c (load_message): have the "no validation"
- mode (have to edit the code to toggle the mode for now though)
-
- * dbus/dbus-marshal-header.c (_dbus_header_load): have a mode that
- skips all validation; I want to use this at least for benchmark
- baseline, I'm not sure if it should be a publicly-available switch.
-
-2005-01-21 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gmain.c: don't put the GLib bindings in the same
- toplevel doxygen group as the low-level API stuff
-
- * dbus/dbus.h: note that libdbus is the low-level API
-
-2005-01-20 Havoc Pennington <hp@redhat.com>
-
- * update-dbus-docs.sh: script to update docs on the web site, only
- works for me though. neener.
-
-2005-01-20 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_poll): amazingly, trying to compile
- code can reveal bugs in it
-
-2005-01-20 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_poll): fix several bugs in the
- select() version, patches from Tor Lillqvist
-
-2005-01-20 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-tutorial.xml: replace > with &gt;
-
- * bus/services.c (bus_registry_acquire_service): validate the name
- and return a better error if it's no good.
-
- * doc/dbus-specification.xml: note NO_AUTO_START change
-
- * dbus/dbus-protocol.h (DBUS_HEADER_FLAG_NO_AUTO_START): change
- from AUTO_START, we're toggling the default
-
- * bus/dispatch.c: adapt the tests to change of auto-start default
-
-2005-01-18 Havoc Pennington <hp@redhat.com>
-
- * rename dbus-daemon-1 to dbus-daemon throughout
-
-2005-01-18 Havoc Pennington <hp@redhat.com>
-
- * Throughout, grand renaming to strip out the use of "service",
- just say "name" instead (or "bus name" when ambiguous). Did not
- change the internal code of the message bus itself, only the
- programmer-facing API and messages.
-
- * doc/dbus-specification.xml: further update the message bus section
-
- * bus/config-parser.c (all_are_equiv): fix bug using freed string
- in error case
-
-2005-01-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-types.h: remove 16-bit types since we don't use them
- ever
-
- * dbus/dbus-marshal-validate.c (_dbus_validate_path): disallow any
- "invalid name character" not only non-ASCII
-
- * doc/dbus-specification.xml: further update spec, message bus
- parts are still out-of-date but the marshaling etc. stuff is now
- accurate-ish
-
-2005-01-17 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: partially update spec
-
-2005-01-17 Havoc Pennington <hp@redhat.com>
-
- * Throughout, align variant bodies according to the contained
- type, rather than always to 8. Should save a fair bit of space in
- message headers.
-
- * dbus/dbus-marshal-validate.c (_dbus_validate_body_with_reason):
- fix handling of case where p == end
-
- * doc/TODO: remove the dbus_bool_t item and variant alignment items
-
-2005-01-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-types.h: hardcode dbus_bool_t to 32 bits
-
- * Throughout: modify DBUS_TYPE_BOOLEAN to be a 32-bit type instead
- of an 8-bit type. Now dbus_bool_t is the type to use whenever you
- are marshaling/unmarshaling a boolean.
-
-2005-01-16 Havoc Pennington <hp@redhat.com>
-
- This is about it on what can be disabled/deleted from libdbus
- easily, back below 150K anyhow. Deeper cuts are more work than
- just turning the code off as I've done here.
-
- * dbus/dbus-marshal-basic.c (_dbus_pack_int32): we don't need the
- signed int convenience funcs
-
- * dbus/dbus-internals.c (_dbus_verbose_real): omit when not in
- verbose mode
-
- * dbus/dbus-string-util.c, dbus/dbus-string.c: more breaking
- things out of libdbus
-
- * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-util.c: same
-
- * dbus/dbus-hash.c: purge the TWO_STRINGS crap (well, make it
- tests-enabled-only, though it should probably be deleted)
-
- * dbus/dbus-message-util.c: same stuff
-
- * dbus/dbus-auth-util.c: same stuff
-
-2005-01-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-userdb-util.c: split out part of dbus-userdb.c
-
- * dbus/dbus-sysdeps.c (_dbus_uid_from_string): move here to pave
- way for stripping down dbus-userdb.c stuff included in libdbus.
- Rename _dbus_parse_uid for consistency.
-
-2005-01-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.c (_dbus_real_assert): print the function
- name the assertion failed in
-
- * dbus/dbus-internals.h (_dbus_return_if_fail)
- (_dbus_return_val_if_fail): assert that the name of the function
- containing the check doesn't start with '_', since we only want to
- use checks on public functions
-
- * dbus/dbus-connection.c (_dbus_connection_ref_unlocked): change
- checks to assertions
-
- * dbus/dbus-marshal-header.c (_dbus_header_set_field_basic):
- change checks to asserts for private function
-
- * dbus/dbus-message.c (_dbus_message_set_serial): checks
- to asserts for private function
-
- * dbus/dbus-marshal-recursive.c (skip_one_complete_type): remove
- broken assertion that was breaking make check
- (_dbus_type_reader_array_is_empty): remove this rather than fix
- it, was only used in assertions
-
-2005-01-16 Havoc Pennington <hp@redhat.com>
-
- * test/unused-code-gc.py: hacky script to find code that's used
- only by the bus (not libdbus) or used only by tests or not used at
- all. It has some false alarms, but looks like we can clean up a
- lot of size from libdbus.
-
- * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-utils.c,
- dbus/Makefile.am: initially move 10K of binary size out of libdbus
-
-2005-01-16 Havoc Pennington <hp@redhat.com>
-
- * Add and fix docs according to Doxygen warnings throughout
- source.
-
- * dbus/dbus-marshal-recursive.c
- (_dbus_type_reader_array_is_empty): change this to just call
- array_reader_get_array_len() and make it static
-
- * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename
- from get_array_type
- (dbus_message_iter_init_append): rename from append_iter_init
-
- * dbus/dbus-marshal-recursive.c
- (_dbus_type_reader_get_element_type): rename from
- _dbus_type_reader_get_array_type
-
-2005-01-15 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c (with_bus_server_filter): fix crash
-
- * dbus/dbus-marshal-basic.c (_dbus_unpack_uint32): inline as macro
- when DBUS_DISABLE_ASSERT
- (_dbus_marshal_set_basic): be sure we align for the string length
-
- * dbus/dbus-marshal-recursive.c (skip_one_complete_type): make
- this look faster
-
- * dbus/dbus-string.c (_dbus_string_get_const_data_len): add an
- inline macro version
- (_dbus_string_set_byte): provide inline macro version
-
-2005-01-15 Havoc Pennington <hp@redhat.com>
-
- * Land the new message args API and type system.
-
- This patch is huge, but the public API change is not
- really large. The set of D-BUS types has changed somewhat,
- and the arg "getters" are more geared toward language bindings;
- they don't make a copy, etc.
-
- There are also some known issues. See these emails for details
- on this huge patch:
- http://lists.freedesktop.org/archives/dbus/2004-December/001836.html
- http://lists.freedesktop.org/archives/dbus/2005-January/001922.html
-
- * dbus/dbus-marshal-*: all the new stuff
-
- * dbus/dbus-message.c: basically rewritten
-
- * dbus/dbus-memory.c (check_guards): with "guards" enabled, init
- freed blocks to be all non-nul bytes so using freed memory is less
- likely to work right
-
- * dbus/dbus-internals.c (_dbus_test_oom_handling): add
- DBUS_FAIL_MALLOC=N environment variable, so you can do
- DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
- DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
- thorough.
-
- * qt/message.cpp: port to the new message args API
- (operator<<): use str.utf8() rather than str.unicode()
- (pretty sure this is right from the Qt docs?)
-
- * glib/dbus-gvalue.c: port to the new message args API
-
- * bus/dispatch.c, bus/driver.c: port to the new message args API
-
- * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
- "locked" flag to TRUE and align_offset to 0; I guess we never
- looked at these anyhow, but seems cleaner.
-
- * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
- move allocation padding macro to this header; use it to implement
- (_DBUS_STRING_STATIC): ability to declare a static string.
-
- * dbus/dbus-message.c (_dbus_message_has_type_interface_member):
- change to return TRUE if the interface is not set.
-
- * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
- to dbus-marshal-validate.[hc]
-
- * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
- dbus-internals.c
-
- * dbus/Makefile.am: cut over from dbus-marshal.[hc]
- to dbus-marshal-*.[hc]
-
- * dbus/dbus-object-tree.c (_dbus_decompose_path): move this
- function here from dbus-marshal.c
-
-2005-01-12 Joe Shaw <joeshaw@novell.com>
-
- * NEWS: Update for 0.23.
-
- * configure.in: Release 0.23.
-
-2005-01-12 Joe Shaw <joeshaw@novell.com>
-
- * mono/Makefile.am, mono/example/Makefile.am: Always build the
- dbus DLL with --debug. Clean up after the .mdb files this leaves
- behind.
-
- * mono/doc/Makefile.am: Need to uninstall the docs on "make
- uninstall"
-
- * mono/Arguments.cs (GetDBusTypeConstructor): If the type
- is an enum, get the enum's underlying type. Another mono
- 1.1.3 fix.
-
-2005-01-11 Joe Shaw <joeshaw@novell.com>
-
- Patch from Sjoerd Simons <sjoerd@luon.net>
-
- * mono/Makefile.am, mono/example/Makefile.am: Don't redefine
- DESTDIR. It breaks stuff.
-
-2005-01-11 Joe Shaw <joeshaw@novell.com>
-
- Patch from Tambet Ingo <tambet@ximian.com>
-
- * mono/DBusType/Array.cs (Get): Get the underlying element type by
- calling type.GetElementType(). The code previously depended on
- broken Mono behavior, which was fixed in Mono 1.1.3.
-
- * mono/DBusType/Dict.cs (constructor): Fix the parameters for
- Activator.CreateInstance() so that the class's constructor is
- called with the right parameters.
-
-2005-01-11 Joe Shaw <joeshaw@novell.com>
-
- Patch from Timo Teräs <ext-timo.teras@nokia.com>
-
- * dbus/dbus-connection.c
- (_dbus_connection_queue_received_message_link): Call
- _dbus_connection_remove_timeout() instead of the _locked()
- variant, since it's always called from
- _dbus_connection_handle_watch(), which handles the locking.
- Removed the _locked() variant since it's no longer used.
-
-2005-01-03 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.h: I'm an idiot, _dbus_assert certainly can
- return
-
-2004-12-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.h: add _DBUS_GNUC_NORETURN to _dbus_assert
-
-2005-01-03 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_sysdeps_test): fix using == on
- floating point
-
- * dbus/dbus-string.c (_dbus_string_insert_alignment): new function
-
-2005-01-02 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.h (_DBUS_ALIGN_OFFSET): new macro
-
-2005-01-01 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add -Wfloat-equal
-
-2005-01-01 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.h: add _DBUS_DOUBLES_BITWISE_EQUAL macro,
- for a variety of reasons '==' doesn't do this.
-
-2004-12-31 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (_dbus_string_equal_substrings): new function
- I keep wishing I had
-
-2004-12-30 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus.py: s/ACTIVATION_REPLY_ACTIVE/ACTIVATION_REPLY_ACTIVATED
-
-2004-12-30 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in: Change DBUS_ACTIVATION_REPLY_ACTIVATED
- and DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE to match the values in
- dbus-protocol.h. Because they are defines and not enums they are not
- autogenerated.
-
-2004-12-26 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in (bus_activate_service): Bind
- dbus_bus_activate_service
-
- * python/dbus.py (Bus.activate_service): activate a service on the
- bus.
-
-2004-12-24 Havoc Pennington <hp@redhat.com>
-
- * test/decode-gcov.c: change to use .gcno and .gcda files, but the
- file format has also changed and I haven't adapted to that yet
-
- * Makefile.am: load .gcno files from latest gcc
-
-2004-12-23 John (J5) Palmieri <johnp@redhat.com>
- * Patch from Rob Taylor <robtaylor@fastmail.fm>
-
- * python/dbus_bindings.pyx.in (bus_get_unix_user): New
- lowlevel binding
-
- * python/dbus.py (get_unix_user): Added binding to
- call dbus_bindings.bus_get_unix_user
-
- * python/extract.py: Modified the proto_pat regex to
- handle unsigned long
-
-2004-12-21 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/make-dbus-glib-error-enum.sh: omit the function keyword for
- better POSIX compliance.
-
-2004-12-19 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (_dbus_string_insert_4_aligned)
- (_dbus_string_insert_8_aligned): new functions
-
- * dbus/dbus-string.c (_dbus_string_alloc_space): new function
-
-2004-12-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII
- macro
-
- * dbus/dbus-message.c: fix a comment, and add a still-unused
- not-implemented function
-
- * dbus/dbus-marshal.h: fix comment
-
- * dbus/dbus-internals.h (_DBUS_ISASCII): new macro
-
-2004-12-17 Joe Shaw <joeshaw@novell.com>
-
- * mono/DBusType/Byte.cs, mono/DBusType/Int32.cs,
- mono/DBusType/Int64.cs, mono/DBusType/UInt32.cs,
- mono/DBusType/UInt64.cs: Use Enum.GetUnderlyingType() instead of
- Type.UnderlyingSystemType to get the actual system type
- underneath. This code previously depended on the broken Mono
- behavior, which was fixed in 1.1.3.
-
-2004-11-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.h (_dbus_string_get_byte): inline when asserts
- are disabled
- (_dbus_string_get_const_data): inline when asserts are disabled
-
- * dbus/dbus-message.c: record the _dbus_current_generation of
- creation so we can complain if dbus_shutdown() is used improperly.
- Do this only if checks are enabled.
-
- * dbus/dbus-connection.c: ditto
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c: add with_bus mode to profile echoes
- that go through the bus.
-
- * test/glib/run-test.sh: add ability to run test-profile
-
- * bus/dbus-daemon-1.1.in: fix to say that SIGHUP causes partial
- config file reload.
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c: clean up how the fake_malloc_overhead
- thing was implemented
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c: tweak a bit, add support for some
- made-up minimal malloc overhead with plain sockets, since in
- real life some sort of buffers are unavoidable thus we could
- count them in the theoretical best case
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_cache_or_finalize): fix bug
- where I was trying to cache one too many messages
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c: reimplement message cache as an array which
- makes the cache about twice as fast and saves maybe 1.5% overall
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-threads.c (init_global_locks): forgot to put the
- message cache lock here
-
-2004-11-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (struct DBusMessage): put the locked bit and
- the "char byte_order" next to each other to save 4 bytes
- (dbus_message_new_empty_header): reduce preallocation, since the
- message cache should achieve a similar effect
- (dbus_message_cache_or_finalize, dbus_message_get_cached): add a
- message cache that keeps a few DBusMessage around in a pool,
- another 8% speedup or so.
-
- * dbus/dbus-dataslot.c (_dbus_data_slot_list_clear): new function
-
-2004-11-25 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration): if we're going
- to write, without reading or blocking, try it before the poll()
- and skip the poll() if nothing remains to write. This is about a
- 3% speedup in the echo client/server
-
-2004-11-25 Havoc Pennington <hp@redhat.com>
-
- The primary change here is to always write() once before adding
- the write watch, which gives us about a 10% performance increase.
-
- * dbus/dbus-transport-unix.c: a number of modifications to cope
- with removing messages_pending
- (check_write_watch): properly handle
- DBUS_AUTH_STATE_WAITING_FOR_MEMORY; adapt to removal of
- messages_pending stuff
- (check_read_watch): properly handle WAITING_FOR_MEMORY and
- AUTHENTICATED cases
- (unix_handle_watch): after writing, see if the write watch can be
- removed
- (unix_do_iteration): assert that write_watch/read_watch are
- non-NULL rather than testing that they aren't, since they
- aren't allowed to be NULL. check_write_watch() at the end so
- we add the watch if we did not finish writing (e.g. got EAGAIN)
-
- * dbus/dbus-transport-protected.h: remove messages_pending call,
- since it resulted in too much inefficient watch adding/removing;
- instead we now require that the transport user does an iteration
- after queueing outgoing messages, and after trying the first
- write() we add a write watch if we got EAGAIN or exceeded our
- max bytes to write per iteration setting
-
- * dbus/dbus-string.c (_dbus_string_validate_signature): add this
- function
-
- * dbus/dbus-server-unix.c (unix_finalize): the socket name was
- freed and then accessed, valgrind flagged this bug, fix it
-
- * dbus/dbus-message.c: fix several bugs where HEADER_FIELD_LAST was taken
- as the last valid field plus 1, where really it is equal to the
- last valid field. Corrects some message corruption issues.
-
- * dbus/dbus-mainloop.c: verbosity changes
-
- * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): handle OOM
- instead of aborting in one of the test codepaths
-
- * dbus/dbus-internals.c (_dbus_verbose_real): fix a bug that
- caused not printing the pid ever again if a verbose was missing
- the newline at the end
- (_dbus_header_field_to_string): add HEADER_FIELD_SIGNATURE
-
- * dbus/dbus-connection.c: verbosity changes;
- (dbus_connection_has_messages_to_send): new function
- (_dbus_connection_message_sent): no longer call transport->messages_pending
- (_dbus_connection_send_preallocated_unlocked): do one iteration to
- try to write() immediately, so we can avoid the write watch. This
- is the core purpose of this patchset
- (_dbus_connection_get_dispatch_status_unlocked): if disconnected,
- dump the outgoing message queue, so nobody will get confused
- trying to send them or thinking stuff is pending to be sent
-
- * bus/test.c: verbosity changes
-
- * bus/driver.c: verbosity/assertion changes
-
- * bus/dispatch.c: a bunch of little tweaks to get it working again
- because this patchset changes when/where you need to block.
-
-2004-11-23 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c: modify to accept a plain_sockets
- argument in which case it will bench plain sockets instead of
- libdbus, for comparison purposes.
-
-2004-11-22 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c (N_CLIENT_THREADS): run multiple
- threads for more time, so sysprof can get a grip on it.
-
- * dbus/dbus-string.c (_dbus_string_validate_utf8): remove
- pointless variable
-
-2004-11-13 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-profile.c: fix this thing up a bit
-
- * dbus/dbus-message.c (dbus_message_new_empty_header): increase
- preallocation sizes by a fair bit; not sure if this will be an
- overall performance win or not, but it does reduce reallocs.
-
- * dbus/dbus-string.c (set_length, reallocate_for_length): ignore
- the test hack that forced constant realloc if asserts are
- disabled, so we can profile sanely. Sprinkle in some
- _DBUS_UNLIKELY() which are probably pointless, but before I
- noticed the real performance problem I put them in.
- (_dbus_string_validate_utf8): micro-optimize this thing a little
- bit, though callgrind says it didn't help; then special-case
- ascii, which did help a lot; then be sure we detect nul bytes as
- invalid, which is a bugfix.
- (align_length_then_lengthen): add some more _DBUS_UNLIKELY
- superstition; use memset to nul the padding instead of a manual
- loop.
- (_dbus_string_get_length): inline this as a
- macro; it showed up in the profile because it's used for loop
- tests and so forth
-
-2004-11-10 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-spawn.c (check_babysit_events): Handle EINTR,
- for extra paranoia.
-
-2004-11-09 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-string.c (_dbus_string_get_length): New
- function, writes DBusString to C buffer.
-
- * dbus/dbus-string.h: Prototype it.
-
- * dbus/dbus-message.c (dbus_message_type_to_string): New
- function, converts message type into C string.
-
- * dbus/dbus-message.h: Prototype it.
-
- * bus/selinux.c (bus_selinux_check): Take source pid,
- target pid, and audit data. Pass audit data to
- avc_has_perm.
- (log_audit_callback): New function, appends extra
- audit information.
- (bus_selinux_allows_acquire_service): Also take
- service name, add it to audit data.
- (bus_selinux_allows_send): Also take message
- type, interface, method member, error name,
- and destination, and add them to audit data.
- (log_cb): Initialize func_audit.
-
- * bus/selinux.h (bus_selinux_allows_acquire_service)
- (bus_selinux_allows_send): Update prototypes
-
- * bus/services.c (bus_registry_acquire_service): Pass
- service name to bus_selinux_allows_acquire_service.
-
- * bus/bus.c (bus_context_check_security_policy): Pass
- additional audit data. Move assignment of dest
- to its own line.
-
-2004-11-07 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-transport-unix.c (do_authentication): Always
- initialize auth_completed.
-
-2004-11-07 Colin Walters <walters@verbum.org>
-
- * bus/bus.c (load_config): Break into three
- separate functions: process_config_first_time_only,
- process_config_every_time, and process_config_postinit.
- (process_config_every_time): Move call of
- bus_registry_set_service_context_table into
- process_config_postinit.
- (process_config_postinit): New function, does
- any processing that needs to happen late
- in initialization (and also on reload).
- (bus_context_new): Instead of calling load_config,
- open config parser here and call process_config_first_time_only
- and process_config_every_time directly. Later, after
- we have forked but before changing UID,
- invoke bus_selinux_full_init, and then call
- process_config_postinit.
- (bus_context_reload_config): As in bus_context_new,
- load parse file inside here, and call process_config_every_time
- and process_config_postinit.
-
- * bus/services.h, bus/services.c
- (bus_registry_set_service_context_table): Rename
- from bus_registry_set_sid_table. Take string hash from config
- parser, and convert them here into SIDs.
-
- * bus/config-parser.c (struct BusConfigParser): Have
- config parser only store a mapping of service->context
- string.
- (merge_service_context_hash): New function.
- (merge_included): Merge context string hashes instead
- of using bus_selinux_id_table_union.
- (bus_config_parser_new): Don't use bus_selinux_id_table_new;
- simply create a new string hash.
- (bus_config_parser_unref): Unref it.
- (start_selinux_child): Simply insert strings into hash,
- don't call bus_selinux_id_table_copy_over.
-
- * bus/selinux.h, bus/selinux.c (bus_selinux_id_table_union)
- (bus_selinux_id_table_copy_over): Delete.
-
-2004-11-03 Colin Walters <walters@verbum.org>
-
- * bus/selinux.c (bus_selinux_pre_init): Kill some unused
- variables.
-
-2004-11-03 Colin Walters <walters@verbum.org>
-
- * bus/test-main.c (test_pre_hook): Fix test logic,
- thanks Joerg Barfurth <Joerg.Barfurth@Sun.COM>.
-
-2004-11-02 Colin Walters <walters@redhat.com>
-
- * bus/selinux.c (bus_selinux_init): Split into two functions,
- bus_selinux_pre_init and bus_selinux_post_init.
- (bus_selinux_pre_init): Just determine whether SELinux is
- enabled.
- (bus_selinux_post_init): Do everything else.
-
- * bus/main.c (main): Call bus_selinux_pre_init before parsing
- config file, and bus_selinux_post_init after. This ensures that
- we don't lose the policyreload notification thread that
- bus_selinux_init created before forking previously.
-
- * bus/test-main.c (test_pre_hook): Update for split.
-
-2004-10-31 Owen Fraser-Green <owen@discobabe.net>
-
- Patch from Johan Fischer <linux@fischaz.com>
-
- * mono/doc/Makefile.am (install-data-local): Added directory
- install for DESTDIR
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- * dbus/dbus-sysdeps.h (_dbus_become_daemon): Also take
- parameter for fd to write pid to.
-
- * dbus/dbus-sysdeps.c (_dbus_become_daemon): Implement it.
-
- * bus/bus.c (bus_context_new): Pass print_pid_fd
- to _dbus_become_daemon (bug #1720)
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- Patch from Ed Catmur <ed@catmur.co.uk>
-
- * mono/doc/Makefile.am (install-data-local): Handle
- DESTDIR.
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- * bus/.cvsignore, qt/.cvsignore: Update.
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- Patch from Kristof Vansant <de_lupus@pandora.be>
-
- * configure.in: Detect Slackware.
- * bus/Makefile.am (SCRIPT_IN_FILES): Add rc.messagebus.in.
- * bus/rc.messagebus.in: New file.
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- * tools/dbus-monitor.c (filter_func): Return
- DBUS_HANDLER_RESULT_HANDLED in filter function
- for now. See:
- http://freedesktop.org/pipermail/dbus/2004-August/001433.html
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- Patch from Matthew Rickard <mjricka@epoch.ncsc.mil>
-
- * bus/services.c (bus_registry_acquire_service):
- Correctly retrieve service name from DBusString
- for printing.
-
-2004-10-29 Colin Walters <walters@redhat.com>
-
- * dbus/dbus-glib.h: Update documentation to not
- refer to internal APIs.
-
-2004-10-27 Joe Shaw <joeshaw@novell.com>
-
- * mono/Arguments.cs (GetDBusTypeConstructor):
- type.UnderlyingSystemType will return "System.Byte" if you do it
- on "byte[]", which is not what we want. So check the type.IsArray
- property and use System.Array instead.
-
-2004-10-25 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps.c (fill_user_info): On errors do not free
- the DBusUserInfo structure since this is passed into the function.
- This would cause a double free when the function that allocated
- the structure would try to free it when an error occured.
-
- * (bus/session.conf.in, bus/Makefile.am, dbus/configure.in):
- use /usr/share/dbus-1/services instead of /usr/lib/dbus-1.0/services
- for service activation to avoid 32bit/64bit parallel install issues
-
-2004-10-21 Colin Walters <walters@verbum.org>
-
- * AUTHORS: Fix my email address, the @gnu.org one
- has been bouncing for some time. Also add J5.
-
-2004-10-21 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-transport-unix.c (do_authentication): Return
- authentication status to callers.
- (unix_handle_watch): If we completed authentication this round,
- don't do another read. Instead wait until the next iteration,
- after we've read any pending data in the auth buffer.
- (unix_do_iteration): Ditto.
- (unix_handle_watch): Updated for new do_authentication prototype.
-
-2004-10-18 Colin Walters <walters@verbum.org>
-
- * bus/selinux.c (bus_selinux_enabled): Handle
- --disable-selinux case.
-
-2004-10-18 Colin Walters <walters@verbum.org>
-
- * bus/selinux.h: Add bus_selinux_enabled.
-
- * bus/selinux.c (bus_selinux_enabled): Implement it.
-
- * bus/config-parser.c (struct include): Add
- if_selinux_enabled member.
- (start_busconfig_child): Parse if_selinux_enabled
- attribute for include.
- (bus_config_parser_content): Handle it.
-
- * bus/session.conf.in, bus/system.conf.in: Add
- inclusion of context mapping to default config files;
- conditional on SELinux being enabled.
-
- * doc/busconfig.dtd: Add to if_selinux_enabled to default DTD.
-
- * test/data/invalid-config-files/badselinux-1.conf,
- test/data/invalid-config-files/badselinux-2.conf:
- Test files for bad syntax.
-
-2004-10-17 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-memory.c (_dbus_initialize_malloc_debug, check_guards)
- (dbus_malloc, dbus_malloc0, dbus_realloc): Fix up printf
- format specifier mismatches.
-
-2004-10-07 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-sysdeps.c (_dbus_file_get_contents): fix an incorrect
- format string.
-
- * glib/dbus-dbus-gmain.c (dbus_g_bus_get): do not mangle NULL
- pointer (bug #1540, Leonardo Boiko).
-
-2004-09-28 Jon Trowbridge <trow@ximian.com>
-
- * mono/BusDriver.cs: Changed BusDriver struct to remove
- the ServiceCreated and ServiceDeleted events and replace them
- with the new ServiceOwnerChanged event.
-
- * mono/example/BusListener.cs: Added a new example program,
- which listens for and reports any ServiceOwnerChanged events
- on the bus driver.
-
- * mono/example/Makefile.am (DESTDIR): Build changes for the
- new BusListener.cs example.
-
-2004-09-27 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/signals.c (bus_match_rule_parse): validate the components of
- match rules (bug #1439).
-
- * dbus/dbus-bus.c (dbus_bus_add_match): add a missing OOM test.
-
-2004-09-24 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * doc/dbus-specification.xml: document ServiceOwnerChanged
- signal.
-
- * bus/driver.c, bus/driver.h, bus/services.c: Use
- ServiceOwnerChanged signal instead of ServiceCreated and
- ServiceDeleted.
-
- * bus/dispatch.c: update testcase for the new signal.
-
-2004-09-20 Jon Trowbridge <trow@ximian.com>
-
- Patch from Nat Friedman <nat@novell.com>
-
- * mono/Makefile.am: A number of small build fixes to allow "make
- distcheck" to succeed.
-
- * mono/example/Makefile.am: "make distcheck" fixes.
-
- * mono/AssemblyInfo.cs.in: When signing the assembly, look for the
- key in @srcdir@.
-
- * test/Makefile.am: "make distcheck" fixes.
-
-2004-09-17 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-sysdeps.c (_dbus_user_at_console): fix memleak in OOM.
-
- * doc/busconfig.dtd: update the DTD for the at_console attribute.
-
- * bus/driver.c (bus_driver_handle_hello): correctly handle Hello
- messages after the first one (bug #1389).
-
- * bus/dispatch.c (check_double_hello_message): add a test case for
- the double hello message bug.
- (check_existent_service_activation): fix check of spawning error.
-
-2004-09-16 David Zeuthen <david@fubar.dk>
-
- * python/dbus_bindings.pyx.in: Add support for int64 and uint64
-
-2004-09-12 David Zeuthen <david@fubar.dk>
-
- Patch from Kay Sievers <kay.sievers@vrfy.org>
-
- * bus/bus.c (bus_context_new):
- * bus/bus.h:
- * bus/main.c (usage)
- (main):
- Add commandline option --nofork to override configuration file
- setting.
-
-2004-09-09 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-*.h: remove the ; after DBUS_(BEGIN|END)_DECLS. Some C
- compilers don't like it (bug #974).
-
-2004-09-04 Harald Fernengel <harry@kdevelop.org>
-
- * qt/connection.*: Applied patch by Jérôme Lodewyck
- <lodewyck@clipper.ens.fr> to integrate an existing
- connection into the Qt eventloop
-
-2004-08-30 Jon Trowbridge <trow@ximian.com>
-
- * mono/BusDriver.cs: Added. This is a class for interacting with
- the org.freedesktop.DBus service.
-
- * mono/Message.cs: Added a mechanism to expose the message that is
- currently being dispatched via the static Message.Current
- property. Added Message.Sender and Message.Destination
- properties.
-
- * mono/Handler.cs: Expose the dispatched message via
- Message.Current when handling method calls.
-
- * mono/Service.cs: Expose the dispatched message via
- Message.Current when handling signal emissions.
-
- * mono/Connection.cs: Bind dbus_bus_get_base_service via the
- Connection.BaseService property.
-
-2004-08-28 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-userdb.c (_dbus_is_console_user): remove unused variable
-
- More fixes from Steve Grubb
-
- * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix fd leak
- (_dbus_listen_tcp_socket): fix fd leak
-
- * dbus/dbus-spawn.c (read_pid, read_ints): move the "again:" for
- EINTR to a bit lower in the code
-
-2004-08-26 Jon Trowbridge <trow@ximian.com>
-
- * bus/driver.c (bus_driver_handle_service_exists): Respond with
- TRUE if we are inquiring about the existence of the built-in
- org.freedesktop.DBus service.
-
-2004-08-25 John Palmieri <johnp@redhat.com>
- * bus/config-parser.c:
- (struct PolicyType): Add POLICY_CONSOLE
- (struct Element.d.policy): s/gid_or_uid/gid_uid_or_at_console
- (start_busconfig_child): Sets up console element when
- <policy at_console=""> is encountered in a policy file
- (append_rule_from_element): Convert console elements to console
- rules.
-
- * bus/policy.c:
- (bus_policy_create_client_policy): Add console rules to the client
- policy based on if the client is at the console
- (bus_policy_append_console_rule): New function for adding a
- console rule to a policy
- (bus_policy_merge): Handle console rule merging
-
- * dbus/dbus-sysdeps.h: Added the DBUS_CONSOLE_DIR constant
- where we check for console user files
-
- * dbus/dbus-sysdeps.c:
- (_dbus_file_exists): New function which checks if the given
- file exists
- (_dbus_user_at_console): New function which does the system
- specific process of checking if the user is at the console
-
- * dbus/dbus-userdb.c:
- (_dbus_is_console_user): New function converts a UID to user name
- and then calls the system specific _dbus_user_at_console to
- see if the user is at the console and therefor a console user
-
-2004-08-25 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/config-parser.c (set_limit):
- * bus/dbus-daemon-1.1.in:
- * test/data/valid-config-files/many-rules.conf: set the
- max_match_rules_per_connection limt from the config file.
-
- * doc/busconfig.dtd: update the DTD.
-
- * bus/driver.c: remove some unused variables.
-
-2004-08-24 Mikael Hallendal <micke@imendio.com>
-
- * dbus/dbus-glib-lowlevel.h: Removed dbus_bus_get_with_g_main since
- it's been replaced by dbus_g_bus_get
-
-2004-08-23 Colin Walters <walters@redhat.com>
-
- Updated SELinux support from Matthew Rickard <mjricka@epoch.ncsc.mil>
-
- * bus/selinux.h: Prototype bus_selinux_get_policy_root.
-
- * bus/selinux.c: Create a thread for policy reload notification.
- (bus_selinux_get_policy_root): Implement.
-
- * bus/config-parser.c (start_busconfig_child)
- (bus_config_parser_content): Support SELinux-root relative
- inclusion.
-
- * configure.in <HAVE_SELINUX>: Add -lpthread.
-
- * bus/test-main.c (test_pre_hook, test_post_hook): New.
- (test_post_hook): Move memory checking into here.
- (test_pre_hook, test_post_hook): Move SELinux checks in
- here, but conditional on a DBUS_TEST_SELINUX environment
- variable. Unfortunately we can't run the SELinux checks
- as a normal user, since they won't have any permissions
- for /selinux. So this will have to be tested manually
- for now, until we have virtualization for most of
- libselinux.
-
-2004-08-23 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_change_identity): add setgroups() to
- drop supplementary groups, suggested by Steve Grubb
-
-2004-08-20 Colin Walters <walters@redhat.com>
-
- * bus/config-parser.c (start_busconfig_child): Remove some unused
- variables.
-
- * bus/selinux.c (bus_selinux_id_table_insert): Avoid compiler
- warning.
-
-2004-08-17 Joe Shaw <joeshaw@novell.com>
-
- * configure.in: If --enable-mono is passed in, if we can't find
- mono error out.
-
- * mono/Makefile.am: Use /gacutil to install assemblies into the
- GAC and not /root.
-
-2004-08-12 Havoc Pennington <hp@redhat.com>
-
- * NEWS: update for 0.22
-
- * configure.in: release 0.22
-
-2004-08-11 Colin Walters <walters@redhat.com>
-
- * tools/dbus-send.c (main, usage): Add --reply-timeout
- argument.
-
-2004-08-10 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/bus.c (process_config_first_time_only): get rid of an unused
- DBusError that was causing a memoy leak (bug #989).
-
- * dbus/dbus-keyring.c, dbus/dbus-message.c:
- fix compilation on Solaris/Forte C (bug #974)
-
- * bus/main.c (main): plug two minuscule memleaks.
-
-2004-08-10 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-tutorial.xml: add some more info on GLib bindings
-
-2004-08-09 Havoc Pennington <hp@redhat.com>
-
- * COPYING: switch to Academic Free License version 2.1 instead of
- 2.0, to resolve complaints about patent termination clause.
-
-2004-07-31 John (J5) Palmieri <johnp@redhat.com>
-
- * README: added documentation for the --enable-python
- configure switch.
-
-2004-07-31 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/config-parser.c (bus_config_parser_new): fix an invalid
- _unref in the SELinux support.
-
- * doc/busconfig.dtd: update DTD for SELinux support.
-
- * bus/config-loader-libxml.c: fix error handler and parser
- initialisation/cleanup. OOM test now works with libxml2 HEAD.
-
- * configure.in: remove the warning about libxml2.
-
- * dbus/dbus-bus.c: silence doxygen warning.
-
-2004-07-31 Colin Walters <walters@redhat.com>
-
- * configure.in: Move #error in SELinux check to its own line.
-
-2004-07-31 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-internals.h (_DBUS_SET_OOM):
- * bus/utils.h (BUS_SET_OOM): use dbus_error_set_const instead of
- dbus_error_set.
-
- * bus/dispatch.c (check_send_exit_to_service): fix the test case,
- broken by the change in the _SET_OOM macros.
-
-2004-07-31 Colin Walters <walters@redhat.com>
-
- * bus/selinux.c <HAVE_SELINUX>: Include utils.h to get
- BUS_SET_OOM.
-
-2004-07-31 Colin Walters <walters@redhat.com>
-
- * configure.in: Use AC_TRY_COMPILE instead of AC_EGREP_HEADER
- to correctly detect DBUS__ACQUIRE_SVC. Also add an
- AC_MSG_CHECKING.
-
-2004-07-24 Havoc Pennington <hp@redhat.com>
-
- SELinux support from Matthew Rickard <mjricka@epoch.ncsc.mil>
-
- * bus/selinux.c, bus/selinux.h: new file encapsulating selinux
- functionality
-
- * configure.in: add --enable-selinux
-
- * bus/policy.c (bus_policy_merge): add FIXME to a comment
-
- * bus/main.c (main): initialize and shut down selinux
-
- * bus/connection.c: store SELinux ID on each connection, to avoid
- repeated getting of the string context and converting it into
- an ID
-
- * bus/bus.c (bus_context_get_policy): new accessor, though it
- isn't used
- (bus_context_check_security_policy): check whether the security
- context of sender connection can send to the security context of
- recipient connection
-
- * bus/config-parser.c: add parsing for <selinux> and <associate>
-
- * dbus/dbus-transport.c (_dbus_transport_get_unix_fd): to
- implement dbus_connection_get_unix_fd()
-
- * dbus/dbus-connection.c (dbus_connection_get_unix_fd): new
- function, used by the selinux stuff
-
-2004-07-29 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/config-loader-libxml.c: complete the implementation of
- libxml backend for config file loader. Doesn't work with full OOM
- test yet.
-
- * configure.in: change error when selecting libxml into a warning.
-
- * test/data/invalid-config-files: add two non-well-formed XML
- files.
-
- * glib/Makefile.am: libdbus_gtool always uses expat, not libxml.
-
- * dbus/dbus-transport-unix.c (unix_handle_watch): do not
- disconnect in case of DBUS_WATCH_HANGUP, several do_reading() may
- be necessary to read all the buffer. (bug #894)
-
- * bus/activation.c (bus_activation_activate_service): fix a
- potential assertion failure (bug #896). Small optimization in the
- case of auto-activation messages.
-
- * dbus/dbus-message.c (verify_test_message, _dbus_message_test):
- add test case for byte-through-vararg bug (#901). patch by Kimmo
- Hämäläinen.
-
-2004-07-28 Anders Carlsson <andersca@gnome.org>
-
- * python/dbus.py:
- * python/dbus_bindings.pyx.in:
- Add dbus.init_gthreads (), allow emit_signal to pass
- arguments to the signal.
-
-2004-07-24 Havoc Pennington <hp@redhat.com>
-
- * AUTHORS: add some people, not really comprehensively, let me
- know if I missed you
-
-2004-07-24 Havoc Pennington <hp@redhat.com>
-
- * Makefile.am (DIST_SUBDIRS): add DIST_SUBDIRS, problem solved by
- Owen
-
- * test/Makefile.am (DIST_SUBDIRS): here also
-
-2004-07-22 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-sysdeps.c (fill_user_info): fix inexistent label name,
- breaking build on Solaris, reported by Farhad Saberi on the ML.
-
- * dbus/dbus-message.c (dbus_message_append_args_valist): fix the
- va_arg invocation to account for integer promotion in the case of
- DBUS_TYPE_BYTE (unsigned char is promoted to int). (bug #901)
-
- * bus/services.c (bus_service_remove_owner): fix bug #902, use
- _dbus_list_get_first_link, not _dbus_list_get_first.
-
- * dbus/dbus-bus.c (dbus_bus_service_exists): plug a memory leak.
-
- * dbus/dbus-object-tree.c (free_subtree_recurse): always null
- handler functions so that the asserts in _dbus_object_subtree_unref
- do not fail.
-
- * dbus/dbus-transport-unix.c (do_reading):
- _dbus_transport_queue_messages return value is of type
- dbus_bool_t, not DBusDispatchStatus.
-
-2004-07-19 David Zeuthen <david@fubar.dk>
-
- * dbus/dbus-protocol.h: Add DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN
-
- * bus/dispatch.c:
- (check_get_connection_unix_user): Debug says GetProperty; but the
- method is called GetConnectionUnixUser
- (check_get_connection_unix_process_id): New function
- (bus_dispatch_test): Actually call check_get_connection_unix_user();
- also call check_get_connection_unix_process_id()
-
- * bus/driver.c:
- (bus_driver_handle_get_connection_unix_process_id): New function,
- handles GetConnectionUnixProcessID on the org.freedesktop.DBus
- interface
-
- * dbus/dbus-auth.c:
- (handle_server_data_external_mech): Set pid from the credentials
- obtained from the socket
-
- * dbus/dbus-connection.c:
- (dbus_connection_get_unix_process_id): New function
-
- * dbus/dbus-connection.h:
- Add prototype for dbus_connection_get_unix_process_id
-
- * dbus/dbus-transport.c:
- (_dbus_transport_get_unix_process_id): New function
-
- * dbus/dbus-transport.h:
- Add prototype for _dbus_transport_get_unix_process_id
-
-2004-07-19 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-message.c: Message counter fix, patch by Christian
- Hammond <chipx86@gnupdate.org>
-
-2004-07-18 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
- * python/dbus_bindings.pyx.in:
- * python/tests/test-client.py:
-
- Add dbus.ByteArray and dbus_bindings.ByteArray
- types so that byte streams can be passed back.
-
- Give jdahlin the heaps of credit that are so
- rightfully his.
-
-2004-07-12 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
-
- Add message argument to the default object_method_handler
- function.
-
- * python/dbus_bindings.pyx.in:
-
- Automatically return NIL when passed an empty list
- (we can't pass back a list since lists are typed
- and we don't have any idea what type the the client
- intended the list to be... :-( )
-
-2004-07-10 Seth Nickell <seth@gnome.org>
-
- * python/examples/Makefile.am:
-
- Fix distcheck breakage caused by new examples.
-
-2004-07-10 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
-
- Add "message" argument to service-side dbus.Object
- methods. This will break existing services written
- using the python bindings, but will allow extraction
- of all the message information (e.g. who its from).
-
- Add improved "object oriented" signal handling/emission.
-
- * python/examples/example-service.py:
-
- Nix this example.
-
- * python/examples/example-signal-emitter.py:
- * python/examples/example-signal-recipient.py:
-
- Two new examples that show how to emit and receive
- signals using the new APIs.
-
- * python/examples/example-signals.py:
- * python/examples/gconf-proxy-service.py:
- * python/examples/gconf-proxy-service2.py:
-
- Add "message" argument to service methods.
-
-2004-06-28 Kay Sievers <kay.sievers@vrfy.org>
-
- * bus/driver.c (bus_driver_handle_get_connection_unix_user)
- * dbus/bus.c (dbus_bus_get_unix_user)
- * doc/dbus-specification.xml: implement GetConnectionUnixUser
- method of org.freedesktop.DBus interface.
-
- * bus/dispatch.c: test case
-
-2004-06-23 John (J5) Palmieri <johnp@redhat.com>
-
- * python/Makefile.am: switched include directory from glib/ to dbus/
- since dbus-glib.h moved
-
-2004-06-22 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * configure.in: prevent building the gcj stuff and libxml loader
- since they are broken.
-
-2004-06-20 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-glib-error-enum.h: autogenerate the GError enum
- codes from the dbus error names
-
- * glib/dbus-glib.h: move to subdir dbus/ since it's included
- as dbus/dbus-glib.h and that breakage is now visible due to
- including dbus/dbus-glib.h in dbus-glib-lowlevel.h
-
- * glib/dbus-glib.h: s/gproxy/g_proxy/
-
- * dbus/dbus-shared.h: new header to hold stuff shared with
- binding APIs
-
- * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather
- than dbus-errors.h
-
- * glib/dbus-glib.h (dbus_set_g_error): move to
- dbus-glib-lowlevel.h
-
- * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch
- of stuff to enable this
-
- * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here
-
- * a bunch of other changes with the same basic "separate glib
- bindings from dbus.h" theme
-
-2004-06-10 Owen Fraser-Green <owen@discobabe.net>
-
- * dbus-sharp.pc.in: Removed glib-sharp inclusion in Libs.
-
- * python/examples/Makefile.am: Fixed typo in EXTRA_DIST.
-
-2004-06-09 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/driver.c, dbus/dbus-bus.c: use BOOLEAN instead of UINT32 for
- the reply value of the ServiceExists message.
-
-2004-06-07 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus_bindings.pyx.in: No longer need to parse path
- elements and pass them as arrays of strings. The C API now
- accepts plain path strings.
- (_build_parsed_path): removed
-
-2004-06-07 Havoc Pennington <hp@redhat.com>
-
- * doc/TODO: remove auto-activation item since it's done; sort
- items by importance/milestone
-
-2004-06-07 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message-builder.c (_dbus_message_data_load): append
- random signature when using REQUIRED_FIELDS (this hack won't work
- in the long term)
-
- * dbus/dbus-message.c: change the signature to be a header field,
- instead of message->signature special-case string. Incremental
- step forward. Then we can fix up code to send the signature in the
- message, then fix up code to validate said signature, then fix up
- code to not put the typecodes inline, etc.
- (load_one_message): don't make up the signature after the fact
- (decode_header_data): require signature field for the known
- message types
-
- * dbus/dbus-marshal.c (_dbus_marshal_string_len): new
-
- * dbus/dbus-protocol.h: add DBUS_HEADER_FIELD_SIGNATURE
-
-2004-06-07 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/DBusType/ObjectPath.cs: Renamed PathName argument to Path
-
- * mono/Handler.cs: Updated to follow new path argument for
- (un-)registering objects.
-
- * mono/example/Makefile.am:
- * mono/Makefile.am:
- * configure.in: Bumped required version for mono and use new -pkg
- syntax for deps
-
-2004-06-05 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-connection.h, dbus/dbus-connection.c: have object path
- registration functions take the path argument as char* instead of
- char**.
-
- * dbus/dbus-marshal.h, dbus/dbus-marshal.c (_dbus_decompose_path):
- split off the path decompostion part of
- _dbus_demarshal_object_path. Some misc. fixes to silence compiler
- warnings.
-
- * glib/dbus-gobject.c, test/test-service.c: update accordingly.
-
-2004-06-02 Kristian Høgsberg <krh@redhat.com>
-
- * dbus/dbus-auth.c: Rewrite auth protocol handling to use a state
- machine approach. A state is implemented as a function that
- handles incoming events as specified for that state.
-
- * doc/dbus-specification.xml: Update auth protocol state machine
- specification to match implementation. Remove some leftover
- base64 examples.
-
-2004-06-02 Kristian Høgsberg <krh@redhat.com>
-
- * glib/dbus-gproxy.c, glib/dbus-gmain.c, dbus/dbus-string.c,
- dbus/dbus-object-tree.c, dbus/dbus-message.c: add comments to
- quiet doxygen.
-
- * Doxyfile.in: remove deprecated options.
-
- * dbus/dbus-message-handler.c, dbus/dbus-message-handler.h,
- glib/test-thread.h, glib/test-thread-client.c,
- glib/test-thread-server.c, glib/test-profile.c,
- glib/test-dbus-glib.c: remove these unused files.
-
-2004-06-01 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-object-tree.c
- (_dbus_object_tree_dispatch_and_unlock): fix dispatch for
- non-fallback handlers (bug #684).
- (_dbus_object_subtree_new): initialize invoke_as_fallback field.
- (find_subtree_recurse): report wether the returned subtree is an
- exact match or a "fallback" match higher up in the tree.
- (object_tree_test_iteration): update test case.
-
-2004-06-01 Seth Nickell <seth@gnome.org>
-
- * python/dbus_bindings.pyx.in:
- * python/tests/test-client.py:
-
- Round off basic type support. Add dicts (yay!), and
- remaining array types.
-
- Make MessageIter more general so it works for dicts too.
-
- Mark all loop variables as C integers.
-
-2004-05-31 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gidl.c (method_info_add_arg): keep args sorted with
- "in" before "out"
-
- * glib/dbus-gobject.c (dbus_type_to_string): move to dbus-gutils.c
-
- * glib/dbus-glib-tool.c (main): set up to have a --self-test
- option that runs the tests, and start filling in some code
- including for starters just dumping the interfaces to stdout
-
- * glib/Makefile.am (INCLUDES): define DBUS_LOCALEDIR
-
- * test/data/valid-introspection-files/lots-of-types.xml: test of
- an example introspection file
-
- * glib/dbus-gparser.c (parser_check_doctype): doctype should be
- "node" (I think...)
-
-2004-05-31 Seth Nickell <seth@gnome.org>
-
- * python/dbus_bindings.pyx.in:
- * python/tests/test-client.py:
-
- Test Suite: 1
- Python Bindings: 0
-
- Fix string array memory trashing bug... oops...
-
-2004-05-30 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
-
- Add a nicer-but-less-flexible alternate API for handling
- calls to virtual objects in dbus.ObjectTree.
-
- Screw up the argument order to the dbus.Object constructor
- for consistency with dbus.ObjectTree (and to make dbus_methods
- optional for future extension)
-
- * python/examples/Makefile.am:
- * python/examples/gconf-proxy-service.py:
- * python/examples/gconf-proxy-service2.py:
-
- Alternate implementation of gconf-proxy-service using the
- nicer dbus.ObjectTree API.
-
- * python/examples/example-service.py:
- * python/tests/test-server.py
-
- Reverse the argument order to deal with dbus.Object constructor
- changes.
-
-2004-05-30 Seth Nickell <seth@gnome.org>
-
- * python/examples/example-client.py:
- * python/examples/example-service.py:
-
- Take it back. Lists seem to work but they're broken
- in the test suite. Make the base examples use
- lists (works fine).
-
-2004-05-30 Seth Nickell <seth@gnome.org>
-
- * python/dbus_bindings.pyx.in:
- * python/tests/test-client.py:
-
- Add some more tests and fix errors that crop up.
- Unfortunately, currently it seems like marshalling
- and unmarshalling of lists is completely broken :-(
-
-2004-05-30 Seth Nickell <seth@gnome.org>
-
- * python/dbus_bindings.pyx.in:
-
- Add support for ObjectPath type.
-
- * python/dbus.py:
-
- Refactor message handling code to a common function.
-
- * python/tests/test-client.py:
- * python/tests/test-server.py:
-
- Add tests that check to make sure values of all types
- can be echoed from a service w/o mangling.
-
-2004-05-29 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
-
- Add ObjectTree class which allows implementation
- of trees of "virtual" objects. Basically the python
- wrapper for "register_fallback".
-
- * python/examples/Makefile.am
- * python/examples/gconf-proxy-client.py:
- * python/examples/gconf-proxy-service.py:
-
- Implement a simple GConf proxy service that supports
- get/set on string and int GConf keys using the ObjectTree.
-
-2004-05-29 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
- * python/examples/example-client.py:
- * python/examples/example-service.py:
- * python/examples/list-system-services.py:
-
- Add SessionBus, SystemBus and ActivationBus classes
- so you don't need to know the special little BUS_TYPE
- flag.
-
-2004-05-29 Havoc Pennington <hp@redhat.com>
-
- * bus/config-parser.c (process_test_valid_subdir): temporarily
- stop testing config parser OOM handling, since expat has issues
- http://freedesktop.org/pipermail/dbus/2004-May/001153.html
-
- * bus/dbus-daemon-1.1.in: change requested_reply to
- send_requested_reply/receive_requested_reply so we can send the
- replies, not just receive them.
-
- * bus/config-parser.c: parse the new
- send_requested_reply/receive_requested_reply
-
- * bus/policy.c (bus_client_policy_check_can_send): add
- requested_reply argument and use it
-
- * bus/bus.c (bus_context_check_security_policy): pass through
- requested_reply status to message send check
-
- * bus/system.conf.in: adapt to requested_reply change
-
-2004-05-28 Havoc Pennington <hp@redhat.com>
-
- * test/glib/test-service-glib.c (main): remove unused variable
-
- * glib/dbus-gidl.c (base_info_ref): fix a silly compiler warning
-
- * dbus/dbus-auth.h (enum): remove AUTHENTICATED_WITH_UNUSED_BYTES
- from the enum, no longer in use.
-
- * dbus/dbus-sysdeps.h: include config.h so DBUS_VA_COPY actually
- works right.
-
- * dbus/dbus-message.c: add various _dbus_return_val_if_fail for
- whether error_name passed in is a valid error name.
-
-2004-05-28 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_get_args): Added support for
- OBJECT_PATH and OBJECT_PATH_ARRAY
-
-2004-05-28 Seth Nickell <seth@gnome.org>
-
- * python/examples/Makefile.am:
-
- Forget to add Makefile.am. Do not pass go.
-
-2004-05-28 Michael Meeks <michael@ximian.com>
-
- * glib/dbus-gvalue.c (dbus_gvalue_marshal, dbus_gvalue_demarshal):
- fix no int64 case.
-
- * dbus/dbus-string.c (_dbus_string_parse_basic_type): impl.
-
- * dbus/dbus-message.c (_dbus_message_iter_get_basic_type),
- (_dbus_message_iter_get_basic_type_array): impl.
- drastically simplify ~all relevant _get methods to use these.
- (_dbus_message_iter_append_basic_array),
- (dbus_message_iter_append_basic): impl
- drastically simplify ~all relevant _append methods to use these.
-
- * dbus/dbus-message-builder.c (parse_basic_type)
- (parse_basic_array, lookup_basic_type): impl.
- (_dbus_message_data_load): prune scads of duplicate /
- cut & paste coding.
-
- * dbus/dbus-marshal.c (_dbus_demarshal_basic_type_array)
- (_dbus_demarshal_basic_type): implement,
- (demarshal_and_validate_len/arg): beef up debug.
- (_dbus_marshal_basic_type, _dbus_marshal_basic_type_array): impl.
-
-2004-05-27 Seth Nickell <seth@gnome.org>
-
- * configure.in:
- * python/Makefile.am:
-
- Include the example python apps in the tarball.
-
- * python/examples/list-system-services.py
-
- Add a python new example that fetches the list of services
- from the system bus.
-
-2004-05-27 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
- * python/dbus_bindings.pyx.in:
-
- Fix failure to notify that a signal was not handled,
- resulted in hung functions.
-
-2004-05-25 Colin Walters <walters@redhat.com>
-
- * tools/dbus-monitor.c (main): Monitor all types of messages.
-
-2004-05-23 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/Handler.cs, mono/Service.cs: Added UnregisterObject method
- which unregisters the object path and disposes the handler.
-
-2004-05-23 Kristian Høgsberg <krh@redhat.com>
-
- Patch from Timo Teräs <ext-timo.teras@nokia.com> (#614):
-
- * dbus/dbus-message.c (dbus_message_iter_get_args_valist): Swap
- operands to && so we call dbus_message_iter_next () for the last
- argument also.
-
-2004-05-21 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-object-tree.c
- (_dbus_object_tree_list_registered_unlock, lookup_subtree): return
- children even if the requested path isn't registered.
- (object_tree_test_iteration): test object_tree_list_registered.
-
- * configure.in: undefine HAVE_ABSTRACT_SOCKETS instead of defining
- it to 0.
-
-2004-05-20 Kristian Høgsberg <krh@redhat.com>
-
- * doc/TODO: Remove resolved items.
-
- * bus/expirelist.h (struct BusExpireList): remove unused n_items
- field.
-
- * bus/connection.c (bus_connections_expect_reply): Enforce the
- per-connection limit on pending replies.
-
- Patch from Jon Trowbridge <trow@ximian.com>:
-
- * bus/main.c (setup_reload_pipe): Added. Creates a pipe and sets
- up a watch that triggers a config reload when one end of the pipe
- becomes readable.
- (signal_handler): Instead of doing the config reload in our SIGHUP
- handler, just write to the reload pipe and let the associated
- watch handle the reload when control returns to the main loop.
-
- * bus/driver.c (bus_driver_handle_reload_config): Added.
- Implements a ReloadConfig method for requesting a configuration
- file reload via the bus driver.
-
-2004-05-19 Owen Fraser-Green <owen@discobabe.net>
-
- * HACKING: Updated release instructions concerning the wiki page.
-
-2004-05-18 Kristian Høgsberg <krh@redhat.com>
-
- * dbus/dbus-auth.c (client_try_next_mechanism): Remove logic to
- filter against auth->allowed_mechs; we only add allowed mechs in
- record_mechanisms().
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): Add an
- ALLOWED_MECHS to auth-script format so we can set the list of
- allowed mechanisms.
-
- * data/auth/client-out-of-mechanisms.auth-script: New test to
- check client disconnects when it is out of mechanisms to try.
-
- * dbus/dbus-auth.c (process_command): Remove check for lines
- longer that 1 MB; we only buffer up maximum 16 kB.
-
- * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
- dbus/dbus-auth-script.c, dbus/dbus-auth.c, dbus/dbus-auth.h:
- Remove auth state AUTHENTICATED_WITH_UNUSED_BYTES, instead always
- assume there might be unused bytes.
-
- * dbus/dbus-auth.c (_dbus_auth_do_work): Remove check for
- client-out-of-mechs, it is handled in process_reject(). Move check
- for max failures to send_rejected(), as it's a server-only thing.
-
- * dbus/dbus-auth.c: Factor out protocol reply code into functions
- send_auth(), send_data(), send_rejected(), send_error(),
- send_ok(), send_begin() and send_cancel().
-
-2004-05-17 Kristian Høgsberg <krh@redhat.com>
-
- Remove base64 encoding, replace with hex encoding. Original patch
- from trow@ximian.com, added error handling.
-
- * dbus/dbus-string.c (_dbus_string_base64_encode)
- (_dbus_string_base64_decode): Remove.
- (_dbus_string_hex_decode): Add end_return argument so we can
- distinguish between OOM and invalid hex encoding.
- (_dbus_string_test): Remove base64 tests and add test case for
- invalid hex.
-
- * dbus/dbus-keyring.c, dbus/dbus-auth-script.c, dbus/dbus-auth.c:
- Replace base64 with hex.
-
- * test/data/auth/invalid-hex-encoding.auth-script: New test case
- for invalid hex encoded data in auth protocol.
-
-2004-05-17 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-connection.c (check_for_reply_unlocked): plug a memory
- leak.
-
-2004-05-15 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/dbus-sharp.dll.config.in: Added for GAC
- * mono/dbus-sharp.snk: Added for GAC
- * mono/Assembly.cs.in: Added for GAC
- * mono/Makefile.am: Changes for GAC installation
- * configure.in: Added refs for dbus-sharp.dll.config.in and
- Assembly.cs.in. More fixes for mono testing
- * mono/example/Makefile.am: Changed var to CSC
- * Makefile.am: Changed flag name to DBUS_USE_CSC
-
-2004-05-15 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/Makefile.am: Added SUBDIRS for docs. Changed SUBDIRS order
- * mono/doc/*: Added documentation framework
- * configure.in: Added monodoc check
- * README: Added description of mono configure flags
-
-2004-05-11 John (J5) Palmieri <johnp@redhat.com>:
-
- * doc/dbus-specification.xml: Added a "Required" column to the
- header fields table and changed the "zero or more" verbage in
- the above paragraph to read "The header must contain the required
- named header fields and zero or more of the optional named header
- fields".
- * test/data/invalid-messages/*.message: Added the required PATH
- named header field to the tests so that they don't fail on
- 'Missing path field'
-
-2004-05-07 John (J5) Palmieri <johnp@redhat.com>
-
- * python/dbus-bindings.pyx.in: Stopped the bindings from trashing
- the stack by implicitly defining variable and parameter types and
- removing the hack of defining C pointers as python objects and later
- casting them.
-
-2004-05-02 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/Makefile.am: Removed test-dbus-sharp.exe from all target
-
-2004-05-01 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/DBusType/Dict.cs: Handle empty dicts
- * mono/DBusType/Array.cs: Handle empty arrays
- * mono/Arguments.cs: Handle empty arguments
-
-2004-04-30 Owen Fraser-Green <owen@discobabe.net>
-
- * dbus-sharp.pc.in: Modified to include include Libs and Requires
- field
-
-2004-04-25 Kristian Høgsberg <krh@redhat.com>
-
- * test/data/valid-messages/standard-*.message: Update message
- test scripts to new header field names.
-
-2004-04-22 John (J5) Palmieri <johnp@redhat.com>
-
- * test/break-loader.c (randomly_do_n_things): tracked down buffer
- overflow to times_we_did_each_thing array which would chop off the
- first character of the failure_dir string. Increased the size of
- the array to 7 to reflect the number of random mutation functions
- we have.
-
-2004-04-21 Kristian Høgsberg <krh@redhat.com>
-
- * dbus/dbus-server-unix.c (unix_finalize): Don't unref
- unix_server->watch here, it is unreffed in disconnect.
- (_dbus_server_new_for_tcp_socket): convert NULL host to
- "localhost" here so we don't append NULL to address.
-
- * dbus/dbus-server.c (_dbus_server_test): Add test case for
- various addresses, including tcp with no explicit host.
-
-2004-04-21 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-message.c (decode_header_data, decode_string_field):
- fix incorrect setting of .name_offset in the HeaderField (it was
- off by two bytes, positioned right after the name and typecode)
-
- * bus/bus.c (bus_context_new, bus_context_unref): test before
- calling dbus_server_free_data_slot and _dbus_user_database_unref
- in case of an error.
-
- * tools/Makefile.am: add $(DBUS_GLIB_TOOL_LIBS), xml libs needed
- by libdbus-gtool.
-
-2004-04-19 Kristian Høgsberg <krh@redhat.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration): Rewrite to use
- _dbus_poll() instead of select().
-
-2004-04-15 Jon Trowbridge <trow@ximian.com>
-
- * bus/main.c (signal_handler): Reload the configuration files
- on SIGHUP.
- (main): Set up our SIGHUP handler.
-
- * bus/bus.c (struct BusContext): Store the config file, user and
- fork flag in the BusContext.
- (process_config_first_time_only): Added. Contains the code
- (previously in bus_context_new) for setting up the BusContext from
- the BusConfigParser that should only be run the first time the
- config files are read.
- (process_config_every_time): Added. Contains the code (previously
- in bus_context_new) for setting up the BusContext from the
- BusConfigParser that should be run every time the config files are
- read.
- (load_config): Added. Builds a BusConfigParser from the config
- files and passes the resulting structure off to
- process_config_first_time_only (assuming this is the first time)
- and process_config_every_time.
- (bus_context_new): All of the config-related code has been moved
- to process_config_first_time_only and process_config_every_time.
- Now this function just does the non-config-related initializations
- and calls load_config.
- (bus_context_reload_config): Added.
-
-2004-04-15 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * bus/driver.c (bus_driver_handle_get_service_owner):
- implement a GetServiceOwner method.
- * doc/dbus-specification.xml: document it.
- * dbus/dbus-errors.h: add a 'ServiceHasNoOwner' error.
-
- * glib/dbus-gproxy.c (dbus_gproxy_new_for_service_owner):
- implement, using the bus GetServiceOwner method.
-
- * test/glib/test-dbus-glib.c:
- use dbus_gproxy_new_for_service_owner so that we can receive the
- signal.
-
-2004-04-15 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-internals.c, dbus/dbus-message-builder.c,
- dbus/dbus-message.c, dbus/dbus-protocol.h
- (DBUS_HEADER_FIELD_SERVICE): renamed DBUS_HEADER_FIELD_DESTINATION
-
- * dbus/dbus-internals.c, dbus/dbus-message-builder.c,
- dbus/dbus-message.c, dbus/dbus-protocol.h
- (DBUS_HEADER_FIELD_SENDER_SERVICE): renamed DBUS_HEADER_FIELD_SENDER
-
- * dbus/dbus-internals.c (_dbus_header_field_to_string):
- DBUS_HEADER_FIELD_DESTINATION resolves to "destination"
- DBUS_HEADER_FIELD_SENDER resolves to "sender"
-
- * doc/dbus-specification.xml (Header Fields Table):
- s/SERVICE/DESTINATION
- s/SENDER_SERVICE/SENDER
-
-
-2004-04-14 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * test/glib/test-dbus-glib.c (timed_exit): fail the test after
- a few seconds.
-
-2004-04-13 Michael Meeks <michael@ximian.com>
-
- * glib/dbus-gobject.c (handle_introspect): split out
- (introspect_properties): this.
- (handle_introspect): implement this.
-
- * test/glib/Makefile.am: use the absolute path so the bus
- daemon's chdir ("/") doesn't kill us dead.
-
- * configure.in: subst ABSOLUTE_TOP_BUILDDIR
-
-2004-04-12 Jon Trowbridge <trow@ximian.com>
-
- * bus/config-parser.c (struct BusConfigParser): Added
- included_files field.
- (seen_include): Added. Checks whether or not a file has already
- been included by any parent BusConfigParser.
- (bus_config_parser_new): Copy the parent's included_files.
- (include_file): Track which files have been included, and fail on
- circular inclusions.
- (process_test_valid_subdir): Changed printf to report if we are
- testing valid or invalid conf files.
- (all_are_equiv): Changed printf to be a bit clearer about
- what we are actually doing.
- (bus_config_parser_test): Test invalid configuration files.
-
-2004-04-09 Jon Trowbridge <trow@ximian.com>
-
- * bus/config-parser.c (bus_config_parser_new): Added a 'parent'
- argument. If non-null, the newly-constructed BusConfigParser will
- be initialized with the parent's BusLimits instead of the default
- values.
- (include_file): When including a config file, pass in
- the current parser as the parent and then copy the BusLimits
- from the included BusConfigParser pack to the current parser.
- (process_test_valid_subdir): Renamed from process_test_subdir.
- (process_test_equiv_subdir): Added. Walks through a directory,
- descending into each subdirectory and loading the config files
- it finds there. If any subdirectory contains two config files
- that don't produce identical BusConfigParser structs, fail.
- For now, the BusConfigParser's BusPolicies are not compared.
- (bus_config_parser_test): Call both process_test_valid_subdir and
- process_test_equiv_subdir.
-
- * bus/config-loader-libxml.c (bus_config_load): Take a parent
- argument and pass it along to the call to bus_config_parser_new.
- Also made a few small changes to allow this code to compile.
-
- * bus/config-loader-expat.c (bus_config_load): Take a parent
- argument and pass it along to the call to bus_config_parser_new.
-
- * bus/bus.c (bus_context_new): Load the config file
- with a NULL parent argument.
-
-2004-03-29 Michael Meeks <michael@ximian.com>
-
- * glib/dbus-gobject.c (introspect_properties): split
- out, fix mangled 'while' flow control.
- (introspect_signals): implement.
- (handle_introspect): update.
-
-2004-03-29 Michael Meeks <michael@ximian.com>
-
- * glib/dbus-gobject.c (set_object_property): split out /
- re-work, use the property type, and not the message type(!)
- (get_object_property): ditto.
-
- * glib/dbus-gvalue.c (dbus_gvalue_demarshal),
- (dbus_gvalue_marshal): make this code re-usable, needed
- for signals too, also on both proxy and server side.
- Re-write for more efficiency / readability.
-
-2004-03-29 Michael Meeks <michael@ximian.com>
-
- * dbus/dbus-message.c
- (dbus_message_new_error_printf): impl.
-
- * dbus/dbus-connection.c
- (dbus_connection_unregister_object_path): fix warning.
-
- * configure.in: fix no-mono-installed situation.
-
-2004-03-27 Havoc Pennington <hp@redhat.com>
-
- Patch from Timo Teräs:
-
- * tools/dbus-send.c (main): if --print-reply, assume type is
- method call; support boolean type args
-
- * dbus/dbus-connection.c (dbus_connection_send_with_reply): fix a
- bunch of memleak and logic bugs
-
-2004-03-23 Owen Fraser-Green <owen@discobabe.net>
-
- * mono/Arguments.cs:
- * mono/Introspector.cs:
- * mono/Handler.cs:
- * mono/InterfaceProxy.cs:
- * mono/Message.cs
- * mono/ProxyBuilder.cs:
- * mono/Service.cs:
- Added InterfaceProxy class to avoid building proxies for every
- object.
-
- * dbus-message.h:
- * dbus-message.c (dbus_message_append_args_valist)
- (dbus_message_iter_get_object_path)
- (dbus_message_iter_get_object_path_array)
- (dbus_message_iter_append_object_path)
- (dbus_message_iter_append_object_path_array):
- Added object_path iter functions to handle OBJECT_PATH arguments
-
-2004-03-23 Owen Fraser-Green <owen@discobabe.net>
-
- First checkin of mono bindings.
- * configure.in:
- * Makefile.am:
- Build stuff for the bindings
- * dbus-sharp.pc.in: Added for pkgconfig
-
-2004-03-21 Havoc Pennington <hp@redhat.com>
-
- * test/test-service.c (main): remove debug spew
-
-2004-03-21 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): accept empty
- arrays
-
- * dbus/dbus-message.h, bus/dbus-message.c (dbus_message_iter_init)
- (dbus_message_iter_init_array_iterator)
- (dbus_message_iter_init_dict_iterator): return a dbus_bool_t to
- indicate whether the iterator is empty
-
- * dbus/dbus-pending-call.c, dbus/dbus-server.c: silence compiler
- warnings
-
-2004-03-19 Havoc Pennington <hp@redhat.com>
-
- * NEWS: 0.21 updates
-
- * configure.in: 0.21
-
- * doc/Makefile.am: add all XMLTO usage to DBUS_XML_DOCS_ENABLED
-
- * python/Makefile.am: change to avoid dist of dbus_bindings.c so
- you don't need pyrex to make dist
-
- * qt/Makefile.am (libdbus_qt_1_la_SOURCES): add integrator.h to
- sources; run moc
-
-2004-03-18 Richard Hult <richard@imendio.com>
-
- * dbus/dbus-message.c (dbus_message_get_auto_activation)
- (dbus_message_set_auto_activation): Add doxygen docs.
-
-2004-03-16 Richard Hult <richard@imendio.com>
-
- * bus/activation.c: (bus_activation_service_created),
- (bus_activation_send_pending_auto_activation_messages),
- (bus_activation_activate_service):
- * bus/activation.h:
- * bus/dispatch.c: (bus_dispatch),
- (check_nonexistent_service_auto_activation),
- (check_service_auto_activated),
- (check_segfault_service_auto_activation),
- (check_existent_service_auto_activation), (bus_dispatch_test):
- * bus/driver.c: (bus_driver_handle_activate_service):
- * bus/services.c: (bus_registry_acquire_service):
- * dbus/dbus-message.c: (dbus_message_set_auto_activation),
- (dbus_message_get_auto_activation):
- * dbus/dbus-message.h:
- * dbus/dbus-protocol.h: Implement auto-activation.
-
- * doc/dbus-specification.xml: Add auto-activation to the spec.
-
-2004-03-12 Olivier Andrieu <oliv__a@users.sourceforge.net>
-
- * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos):
- fix a bug with CUSTOM types.
-
- * dbus/dbus-message.c (message_iter_test, _dbus_message_test): add
- a unit test for this bug (used to fail).
-
-2004-03-12 Mikael Hallendal <micke@imendio.com>
-
- * bus/activation.c:
- (babysitter_watch_callback): notify all pending activations waiting for
- the same exec that the activation failed.
- (bus_activation_activate_service): shortcut the activation if we
- already waiting for the same executable to start up.
-
-2004-03-12 Mikael Hallendal <micke@imendio.com>
-
- * bus/activation.c:
- - Added service file reloading.
- Each service files directory is kept in an hash table in
- BusActivation and each BusActivationEntry knows what .service-file it
- was read from. So when you try to activate a service the bus will
- check if it's been updated, removed or if new .service-files has
- been installed.
- - Test code at the bottom for the service file reloading.
- * bus/test-main.c: (main):
- * bus/test.h:
- - added service reloading test.
- * dbus/dbus-sysdeps.c:
- * dbus/dbus-sysdeps.h: (_dbus_delete_directory): Added.
-
-2004-03-08 Michael Meeks <michael@ximian.com>
-
- * dbus/dbus-connection.c (_dbus_connection_block_for_reply):
- bail immediately if disconnected, to avoid busy loop.
-
- * dbus/dbus-message.c (dbus_message_iter_get_args_valist):
- cleanup cut/paste/inefficiency.
-
-2004-03-01 David Zeuthen <david@fubar.dk>
-
- * dbus/dbus-string.c (_dbus_string_append_printf_valist): Fix a
- bug where args were used twice. This bug resulted in a segfault
- on a Debian/PPC system when starting the messagebus daemon. Include
- dbus-sysdeps.h for DBUS_VA_COPY
-
- * dbus/dbus-sysdeps.h: Define DBUS_VA_COPY if neccessary. From GLib
-
- * configure.in: Check for va_copy; define DBUS_VA_COPY to the
- appropriate va_copy implementation. From GLib
-
-2004-02-24 Joe Shaw <joe@ximian.com>
-
- * bus/services.c (bus_registry_acquire_service): We need to pass
- in the service name to dbus_set_error() to prevent a crash.
-
-2003-12-26 Anders Carlsson <andersca@gnome.org>
-
- * AUTHORS: Reveal my True identity.
-
-2003-12-17 Mikael Hallendal <micke@imendio.com>
-
- * dbus/dbus-message.c: (dbus_message_append_args_valist):
- - Added case for DBUS_TYPE_BYTE, patch from Johan Hedberg.
-
-2003-12-13 Mikael Hallendal <micke@imendio.com>
-
- * doc/TODO: Added not about better error check of configuration files.
-
-2003-12-02 Richard Hult <richard@imendio.com>
-
- * Update AFL version to 2.0 throughout the source files to reflect
- the update that was done a while ago.
-
-2003-12-02 Richard Hult <richard@imendio.com>
-
- * dbus/dbus-message.c (dbus_message_iter_append_dict): Set
- wrote_dict_key to FALSE on the iter that the dict is appended to,
- just like when appending other types. Fixes a bug where a dict
- couldn't be put inside a dict.
- (dbus_message_iter_append_dict_key): Fix typo in warning message.
- (message_iter_test, _dbus_message_test): Add test case for dict
- inside dict.
-
-2003-12-01 David Zeuthen <david@fubar.dk>
-
- * python/dbus.py: Add the actual message when calling the reciever
- of a signal such that parameters can be inspected. Add the method
- remove_signal_receiver
-
-2003-11-26 Mikael Hallendal <micke@imendio.com>
-
- * bus/*.[ch]:
- * dbus/*.[ch]:
- * glib/*.[ch]: Made ref functions return the pointer
-
-2003-11-25 Zack Rusin <zack@kde.org>
-
- * qt/integrator.h, qt/integrator.cpp: Adding handling of DBusServer,
-
- * qt/server.h, qt/server.cpp, qt/Makefile.am: Adding DBusServer
- wrappers,
-
- * qt/connection.h, qt/connection.cpp: Adjusting to changes in
- the Integrator and to better fit with the server,
-
-2003-11-24 Zack Rusin <zack@kde.org>
-
- * qt/connection.h, qt/connection.cpp: removing initDbus method since
- the integrator handles it now
-
- * qt/integrator.h, qt/integrator.cpp: reworking handling of timeouts,
- since QTimer wasn't really meant to be used the way DBusTimeout is
-
-2003-11-24 Zack Rusin <zack@kde.org>
-
- * qt/integrator.h, qt/integrator.cpp, Makefile.am: Adding
- Integrator class which integrates D-BUS with the Qt event loop,
-
- * qt/connection.h, qt/connection.cpp: Move all the code which
- was dealing with D-BUS integration to the Integrator class,
- and start using Integrator,
-
-2003-11-23 Zack Rusin <zack@kde.org>
-
- * qt/connection.h, qt/connection.cpp: Adding the DBusConnection
- wrapper
-
- * qt/message.h, qt/message.cpp: updating to the current D-BUS api,
- switching namespaces to DBusQt, reworking the class,
-
- * Makefile.cvs: switching dependencies so that it matches KDE
- schematics,
-
- * qt/Makefile.am: adding connection.{h,cpp} and message.{h,cpp} to
- the library
-
-2003-11-19 Havoc Pennington <hp@redhat.com>
-
- * NEWS: update
-
- * configure.in: bump version to 0.20
-
- * configure.in (have_qt): add yet another place to look for qt
- (someone hand trolltech a .pc file...)
-
-2003-11-01 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: add state machine docs on the auth
- protocol; just a first draft, I'm sure it's wrong.
-
-2003-10-28 David Zeuthen <david@fubar.dk>
-
- * python/dbus_bindings.pyx.in: add get_dict to handle dictionaries
- return types. Fixup TYPE_* to reflect changes in dbus/dbus-protocol.h
-
-2003-10-28 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (get_next_field): delete unused function
-
-2003-10-28 Havoc Pennington <hp@redhat.com>
-
- * bus/expirelist.c (do_expiration_with_current_time): detect
- failure of the expire_func due to OOM
-
- * bus/connection.c (bus_pending_reply_expired): return FALSE on OOM
-
- * bus/dispatch.c (check_send_exit_to_service): fix to handle the
- NoReply error that's now created by the bus when the service exits
-
-2003-10-28 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (_dbus_message_test): enable and fix the
- tests for set_path, set_interface, set_member, etc.
-
- * dbus/dbus-string.c (_dbus_string_insert_bytes): allow 0 bytes
-
- * dbus/dbus-message.c (set_string_field): always just delete and
- re-append the field; accept NULL for deletion
- (re_align_fields_recurse): reimplement
-
-2003-10-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c: fix docs to properly describe the
- disconnected message
- (_dbus_connection_notify_disconnected): remove this function;
- we can't synchronously add the disconnected message, we have to
- do it after we've queued any remaining real messages
- (_dbus_connection_get_dispatch_status_unlocked): queue the
- disconnect message only if the transport has finished queueing all
- its real messages and is disconnected.
- (dbus_connection_disconnect): update the dispatch status here
-
-2003-10-22 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_check_security_policy): fix up assertion
-
- * bus/connection.c (bus_transaction_send_from_driver): set the
- destination to the connection's base service
-
-2003-10-20 Havoc Pennington <hp@redhat.com>
-
- hmm, make check is currently not passing.
-
- * doc/dbus-specification.xml: add requirement that custom type
- names follow the same rules as interface names.
-
- * dbus/dbus-protocol.h: change some of the byte codes, to avoid
- duplication and allow 'c' to be 'custom'; dict is now 'm' for
- 'map'
-
- * doc/dbus-specification.xml: update type codes to match
- dbus-protocol.h, using the ASCII byte values. Rename type NAMED to
- CUSTOM. Add type OBJECT_PATH to the spec.
-
-2003-10-17 Havoc Pennington <hp@redhat.com>
-
- * bus/driver.c (create_unique_client_name): use "." as separator
- in base service names instead of '-'
-
- * dbus/dbus-string.c (_dbus_string_get_byte): allow getting nul
- byte at the end of the string
-
- * dbus/dbus-internals.h (_DBUS_LIKELY, _DBUS_UNLIKELY): add
- optimization macros since string validation seems to be a slow
- point.
-
- * doc/dbus-specification.xml: restrict valid
- service/interface/member/error names. Add test suite code for the
- name validation.
-
- * dbus/dbus-string.c: limit service/interface/member/error names
- to [0-9][A-Z][a-z]_
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): add missing
- format arg to verbose spew
-
- * glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): if not out of
- memory, return instead of g_error
-
- * test/test-service.c (path_message_func): support emitting a
- signal on request
-
- * dbus/dbus-bus.c (init_connections_unlocked): only fill in
- activation bus type if DBUS_BUS_ACTIVATION was set; default to
- assuming the activation bus was the session bus so that services
- started manually will still register.
- (init_connections_unlocked): fix so that in OOM situation we get
- the same semantics when retrying the function
-
- * test/test-service.c (main): change to use path registration, to
- test those codepaths; register with DBUS_BUS_ACTIVATION rather
- than DBUS_BUS_SESSION
-
-2003-10-16 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gtest-main.c: bracket with #ifdef DBUS_BUILD_TESTS
-
- * Makefile.am (GCOV_DIRS): remove "test", we don't care about test
- coverage of the tests
- (coverage-report.txt): don't move the .da and .bbg files around
-
-2003-10-16 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (struct BusContext): remove struct field I didn't mean
- to put there
-
-2003-10-16 Havoc Pennington <hp@redhat.com>
-
- * bus/connection.c (bus_pending_reply_expired): either cancel or
- execute, not both
- (bus_connections_check_reply): use unlink, not remove_link, as we
- don't want to free the link; fixes double free mess
-
- * dbus/dbus-pending-call.c (dbus_pending_call_block): fix in case
- where no reply was received
-
- * dbus/dbus-connection.c (_dbus_pending_call_complete_and_unlock):
- fix a refcount leak
-
- * bus/signals.c (match_rule_matches): add special cases for the
- bus driver, so you can match on sender/destination for it.
-
- * dbus/dbus-sysdeps.c (_dbus_abort): print backtrace if
- DBUS_PRINT_BACKTRACE is set
-
- * dbus/dbus-internals.c: add pid to assertion failure messages
-
- * dbus/dbus-connection.c: add message type code to the debug spew
-
- * glib/dbus-gproxy.c (gproxy_get_match_rule): match rules want
- sender=foo not service=foo
-
- * dbus/dbus-bus.c (dbus_bus_get): if the activation bus is the
- session bus but DBUS_SESSION_BUS_ADDRESS isn't set, use
- DBUS_ACTIVATION_ADDRESS instead
-
- * bus/activation.c: set DBUS_SESSION_BUS_ADDRESS,
- DBUS_SYSTEM_BUS_ADDRESS if appropriate
-
- * bus/bus.c (bus_context_new): handle OOM copying bus type into
- context struct
-
- * dbus/dbus-message.c (dbus_message_iter_get_object_path): new function
- (dbus_message_iter_get_object_path_array): new function (half
- finished, disabled for the moment)
-
- * glib/dbus-gproxy.c (dbus_gproxy_end_call): properly handle
- DBUS_MESSAGE_TYPE_ERROR
-
- * tools/dbus-launch.c (babysit): support DBUS_DEBUG_OUTPUT to
- avoid redirecting stderr to /dev/null
- (babysit): close stdin if not doing the "exit_with_session" thing
-
- * dbus/dbus-sysdeps.c (_dbus_become_daemon): delete some leftover
- debug code; change DBUS_DEBUG_OUTPUT to only enable stderr, not
- stdout/stdin, so things don't get confused
-
- * bus/system.conf.in: fix to allow replies, I modified .conf
- instead of .conf.in again.
-
-2003-10-14 David Zeuthen <david@fubar.dk>
-
- * python/dbus_bindings.pyx.in (MessageIter.get): fixed typo in
- argtype to arg_type when raising unknown arg type exception.
- Changed type list to reflect the changes in dbus-protocol.h so
- the bindings actually work.
-
-2003-10-14 Havoc Pennington <hp@redhat.com>
-
- * test/decode-gcov.c: support gcc 3.3 also, though gcc 3.3 seems
- to have a bug keeping it from outputting the .da files sometimes
- (string_get_string): don't append garbage nul bytes to the string.
-
-2003-10-15 Seth Nickell <seth@gnome.org>
-
- * python/Makefile.am:
-
- Include dbus_h_wrapper.h in the dist tarball.
-
-2003-10-14 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_check_security_policy): revamp this to
- work more sanely with new policy-based requested reply setup
-
- * bus/connection.c (bus_transaction_send_from_driver): set bus
- driver messages as no reply
-
- * bus/policy.c (bus_client_policy_check_can_receive): handle a
- requested_reply attribute on allow/deny rules
-
- * bus/system.conf: add <allow requested_reply="true"/>
-
- * bus/driver.c (bus_driver_handle_message): fix check for replies
- sent to the bus driver, which was backward. How did this ever work
- at all though? I think I'm missing something.
-
- * dbus/dbus-message.c (decode_header_data): require error and
- method return messages to have a reply serial field to be valid
- (_dbus_message_loader_queue_messages): break up this function;
- validate that reply serial and plain serial are nonzero;
- clean up the OOM/error handling.
- (get_uint_field): don't return -1 from this
- (dbus_message_create_header): fix signed/unsigned bug
-
- * bus/connection.c (bus_connections_expect_reply): save serial of
- the incoming message, not reply serial
-
-2003-10-14 Havoc Pennington <hp@redhat.com>
-
- * bus/connection.c: implement pending reply tracking using
- BusExpireList
-
- * bus/bus.c (bus_context_check_security_policy): verify that a
- reply is pending in order to allow a reply to be sent. Deny
- messages of unknown type.
-
- * bus/dbus-daemon-1.1.in: update to mention new resource limits
-
- * bus/bus.c (bus_context_get_max_replies_per_connection): new
- (bus_context_get_reply_timeout): new
-
-2003-10-13 Seth Nickell <seth@gnome.org>
-
- * python/Makefile.am:
-
- Pass "make distcheck": remove a couple files from DIST_FILES
- that weren't included in the final version.
-
-2003-10-12 Havoc Pennington <hp@pobox.com>
-
- Added test code that 1) starts an actual bus daemon and 2) uses
- DBusGProxy; fixed bugs that were revealed by the test. Lots
- more testing possible, but this is the basic framework.
-
- * glib/dbus-gproxy.c (dbus_gproxy_manager_unregister): remove
- empty proxy lists from the proxy list hash
-
- * dbus/dbus-message.c (dbus_message_iter_get_args_valist): add a
- couple of return_if_fail checks
-
- * dbus/dbus-pending-call.c (_dbus_pending_call_new): use dbus_new0
- to allocate, so everything is cleared to NULL as it should be.
-
- * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): pass
- source as data to dbus_connection_set_timeout_functions() as the
- timeout functions expected
-
- * test/glib/run-test.sh: add a little script to start up a message
- bus and run tests using it
-
- * tools/dbus-launch.1: updates
-
- * tools/dbus-launch.c (main): add --config-file option
-
- * tools/dbus-launch.c (main): remove confusing else if (runprog)
- that could never be reached.
-
- * dbus/dbus-message.c (dbus_message_new_method_return)
- (dbus_message_new_error, dbus_message_new_signal): set the
- no-reply-expected flag on all these. Redundant, but may
- as well be consistent.
-
-2003-10-11 Havoc Pennington <hp@pobox.com>
-
- * test/decode-gcov.c (function_solve_graph): make broken block
- graph a nonfatal error since it seems to be broken. Need to debug
- this.
-
- * dbus/dbus-marshal.c (_dbus_type_is_valid): new function since we
- can't just check type > INVALID < LAST anymore
-
- * dbus/dbus-message.c (dbus_message_get_signature): new function
- (dbus_message_has_signature): new function
- (struct DBusMessage): add signature field (right now it isn't sent
- over the wire, just generated on the fly)
- (dbus_message_copy): copy the signature, and init strings to
- proper length to avoid some reallocs
- (dbus_message_iter_init_array_iterator): return void, since it
- can't fail
- (dbus_message_iter_init_dict_iterator): return void since it can't fail
- (_dbus_message_loader_queue_messages): add silly temporary hack to
- fill in message->signature on load
-
- * dbus/dbus-protocol.h: change DBUS_TYPE_* values to be ASCII
- characters, so they are relatively human-readable.
-
-2003-10-11 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (_dbus_message_test): add more test
- coverage, but #if 0 for now since they uncover a bug
- not fixed yet; I think in re_align_field_recurse()
- (re_align_field_recurse): add FIXME about broken assertion
-
- * dbus/dbus-sysdeps.c (_dbus_sysdeps_test): add more test coverage
-
- * bus/connection.c: share a couple code bits with expirelist.c
-
- * bus/expirelist.h, bus/expirelist.c: implement a generic
- expire-items-after-N-seconds facility, was going to share between
- expiring connections and replies, decided not to use for expiring
- connections for now.
-
- * COPYING: include AFL 2.0 (still need to change all the file headers)
-
-2003-10-09 Havoc Pennington <hp@redhat.com>
-
- * configure.in: define DBUS_HAVE_GCC33_GCOV if we have
- gcc 3.3. Not that we do anything about it yet.
-
- * bus/signals.c (bus_match_rule_parse): impose max length on the
- match rule text
-
- * dbus/dbus-protocol.h: add DBUS_MAXIMUM_MATCH_RULE_LENGTH
-
-2003-10-09 Havoc Pennington <hp@redhat.com>
-
- Make matching rules theoretically work (add parser).
-
- * bus/bus.c (bus_context_check_security_policy): fix up to handle
- the case where destination is explicitly specified as bus driver
- and someone else is eavesdropping.
-
- * bus/policy.c (bus_client_policy_check_can_receive): fix up
- definition of eavesdropping and assertion
-
- * tools/dbus-send.c (main): use dbus_message_type_from_string
-
- * bus/signals.c (bus_match_rule_parse): implement
-
- * dbus/dbus-message.c (dbus_message_type_from_string): new
-
- * dbus/dbus-errors.h (DBUS_ERROR_MATCH_RULE_INVALID): add
-
-2003-10-02 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): rename from
- dbus_gproxy_oneway_call
-
- * glib/dbus-gmain.c (dbus_connection_setup_with_g_main)
- (dbus_server_setup_with_g_main): fix to allow calling them more
- than once on the same args
- (dbus_bus_get_with_g_main): new function
-
-2003-10-02 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-tutorial.xml: write some stuff
-
-2003-09-29 Havoc Pennington <hp@pobox.com>
-
- * configure.in: split checks for Doxygen from XML docs, check for
- xmlto
-
- * doc/Makefile.am: XML-ify all the docs, and add a blank
- dbus-tutorial.xml
-
-2003-09-29 Havoc Pennington <hp@pobox.com>
-
- * Merge dbus-object-names branch. To see the entire patch
- do cvs diff -r DBUS_OBJECT_NAMES_BRANCHPOINT -r dbus-object-names,
- it's huuuuge though.
- To revert, I tagged DBUS_BEFORE_OBJECT_NAMES_MERGE.
-
-2003-09-28 Havoc Pennington <hp@pobox.com>
-
- * HACKING: update to reflect new server
-
-2003-09-26 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
- * python/examples/example-signals.py:
-
- Start implementing some notions of signals. The API
- is really terrible, but they sort of work (with the
- exception of being able to filter by service, and to
- transmit signals *as* a particular service). Need to
- figure out how to make messages come from the service
- we registered :-(
-
- * python/dbus_bindings.pyx.in:
-
- Removed duplicate message_handler callbacks.
-
-2003-09-25 Havoc Pennington <hp@redhat.com>
-
- * bus/session.conf.in: fix my mess
-
-2003-09-25 Havoc Pennington <hp@pobox.com>
-
- * bus/session.conf.in: fix security policy, reported by Seth Nickell
-
-2003-09-25 Seth Nickell <seth@gnome.org>
-
- * python/examples/example-service.py:
-
- Johan notices complete wrong code in example-service, but
- completely wrong in a way that works exactly the same (!).
- Johan is confused, how could this possibly work? Example
- code fails to serve purpose of making things clear.
- Seth fixes.
-
-2003-09-25 Mark McLoughlin <mark@skynet.ie>
-
- * doc/dbus-specification.sgml: don't require header fields
- to be 4-byte aligned and specify that fields should be
- distinguished from padding by the fact that zero is not
- a valid field name.
-
- * doc/TODO: remove re-alignment item and add item to doc
- the OBJECT_PATH type.
-
- * dbus/dbus-message.c:
- (HeaderField): rename the original member to value_offset
- and introduce a name_offset member to keep track of where
- the field actually begins.
- (adjust_field_offsets): remove.
- (append_int_field), (append_uint_field),
- (append_string_field): don't align the start of the header
- field to a 4-byte boundary.
- (get_next_field): impl finding the next marhsalled field
- after a given field.
- (re_align_field_recurse): impl re-aligning a number of
- already marshalled fields.
- (delete_field): impl deleting a field of any type and
- re-aligning any following fields.
- (delete_int_or_uint_field), (delete_string_field): remove.
- (set_int_field), (set_uint_field): no need to re-check
- that we have the correct type for the field.
- (set_string_field): ditto and impl re-aligning any
- following fields.
- (decode_header_data): update to take into account that
- the fields aren't 4-byte aligned any more and the new
- way to distinguish padding from header fields. Also,
- don't exit when there is too much header padding.
- (process_test_subdir): print the directory.
- (_dbus_message_test): add test to make sure a following
- field is re-aligned correctly after field deletion.
-
- * dbus/dbus-string.[ch]:
- (_dbus_string_insert_bytes): rename from insert_byte and
- allow the insert of multiple bytes.
- (_dbus_string_test): test inserting multiple bytes.
-
- * dbus/dbus-marshal.c: (_dbus_marshal_set_string): add
- warning note to docs about having to re-align any
- marshalled values following the string.
-
- * dbus/dbus-message-builder.c:
- (append_string_field), (_dbus_message_data_load):
- don't align the header field.
-
- * dbus/dbus-auth.c: (process_test_subdir): print the
- directory.
-
- * test/break-loader.c: (randomly_add_one_byte): upd. for
- insert_byte change.
-
- * test/data/invalid-messages/bad-header-field-alignment.message:
- new test case.
-
- * test/data/valid-messages/unknown-header-field.message: shove
- a dict in the unknown field.
-
-2003-09-25 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
- * python/dbus_bindings.pyx.in:
-
- Handle return values.
-
- * python/examples/example-client.py:
- * python/examples/example-service.py:
-
- Pass back return values from the service to the client.
-
-2003-09-24 Seth Nickell <seth@gnome.org>
-
- * python/dbus.py:
-
- Connect Object methods (when you are sharing an object) up... pass
- in a list of methods to be shared. Sharing all the methods just
- worked out too weird. You can now create nice Services over the
- DBus in Python. :-)
-
- * python/dbus_bindings.pyx.in:
-
- Keep references to user_data tuples passed into C functions so
- Python doesn't garbage collect on us.
-
- Implement MethodReturn and Error subclasses of Message for creating
- DBusMessage's of those types.
-
- * python/examples/example-client.py:
- * python/examples/example-service.py:
-
- Simple example code showing both how create DBus services and objects,
- and how to use them.
-
-2003-09-23 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gproxy.c (dbus_gproxy_manager_filter): implement
-
-2003-09-23 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c (dbus_gproxy_connect_signal): implement
- (dbus_gproxy_disconnect_signal): implement
- (dbus_gproxy_manager_remove_signal_match): implement
- (dbus_gproxy_manager_add_signal_match): implement
- (dbus_gproxy_oneway_call): implement
-
-2003-09-23 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gproxy.c (struct DBusGProxy): convert to a GObject
- subclass. This means dropping the transparent thread safety of the
- proxy; you now need a separate proxy per-thread, or your own
- locking on the proxy. Probably right anyway.
- (dbus_gproxy_ref, dbus_gproxy_unref): nuke, just use g_object_ref
-
-2003-09-22 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gproxy.c (dbus_gproxy_manager_get): implement
-
-2003-09-21 Seth Nickell <seth@gnome.org>
-
- First checkin of the Python bindings.
-
- * python/.cvsignore:
- * python/Makefile.am:
- * python/dbus_bindings.pyx.in:
- * python/dbus_h_wrapper.h:
-
- Pieces for Pyrex to operate on, building a dbus_bindings.so
- python module for low-level access to the DBus APIs.
-
- * python/dbus.py:
-
- High-level Python module for accessing DBus objects.
-
- * configure.in:
- * Makefile.am:
-
- Build stuff for the python bindings.
-
- * acinclude.m4:
-
- Extra macro needed for finding the Python C header files.
-
-2003-09-21 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gproxy.c (dbus_gproxy_manager_new): start
- implementing the proxy manager, didn't get very far.
-
- * dbus/dbus-bus.c (dbus_bus_add_match): new
- (dbus_bus_remove_match): new
-
- * glib/dbus-gproxy.c (dbus_gproxy_new_for_service): add a
- path_name argument; adjust the other not-yet-implemented
- gproxy constructors to be what I think they should be.
-
-2003-09-21 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-bus.c (dbus_bus_get): set exit_on_disconnect to TRUE
- by default for message bus connections.
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): exit if
- exit_on_disconnect flag is set and we process the disconnected
- signal.
- (dbus_connection_set_exit_on_disconnect): new function
-
-2003-09-21 Havoc Pennington <hp@pobox.com>
-
- Get matching rules mostly working in the bus; only actually
- parsing the rule text remains. However, the client side of
- "signal connections" hasn't been started, this patch is only the
- bus side.
-
- * dbus/dispatch.c: fix for the matching rules changes
-
- * bus/driver.c (bus_driver_handle_remove_match)
- (bus_driver_handle_add_match): send an ack reply from these
- method calls
-
- * glib/dbus-gproxy.c (dbus_gproxy_begin_call): fix order of
- arguments, reported by Seth Nickell
-
- * bus/config-parser.c (append_rule_from_element): support
- eavesdrop=true|false attribute on policies so match rules
- can be prevented from snooping on the system bus.
-
- * bus/dbus-daemon-1.1.in: consistently use terminology "sender"
- and "destination" in attribute names; fix some docs bugs;
- add eavesdrop=true|false attribute
-
- * bus/driver.c (bus_driver_handle_add_match)
- (bus_driver_handle_remove_match): handle AddMatch, RemoveMatch
- messages
-
- * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST): get
- rid of broadcast service concept, signals are just always broadcast
-
- * bus/signals.c, bus/dispatch.c, bus/connection.c, bus/bus.c:
- mostly implement matching rules stuff (currently only exposed as signal
- connections)
-
-2003-09-21 Mark McLoughlin <mark@skynet.ie>
-
- * doc/dbus-specification.sgml: Change the header field name
- to be an enum and update the rest of the spec to reference
- the fields using the conventinal name.
-
- * dbus/dbus-protocol.h: update to reflect the spec.
-
- * doc/TODO: add item to remove the 4 byte alignment requirement.
-
- * dbus/dbus-message.c: Remove the code to generalise the
- header/body length and serial number header fields as named
- header fields so we can reference field names using the
- protocol values.
- (append_int_field), (append_uint_field), (append_string_field):
- Append the field name as a byte rather than four chars.
- (delete_int_or_uint_field), (delete_string_field): reflect the
- fact that the field name and typecode now occupy 4 bytes instead
- of 8.
- (decode_string_field), (decode_header_data): update to reflect
- protocol changes and move the field specific encoding from
- decode_string_field() back into decode_header_data().
-
- * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string):
- Add utility to aid debugging.
-
- * dbus/dbus-message-builder.c:
- (append_string_field), (_dbus_message_data_load): Update to
- reflect protocol changes; Change the FIELD_NAME directive
- to HEADER_FIELD and allow it to take the field's conventional
- name rather than the actual value.
-
- * test/data/*/*.message: Update to use HEADER_FIELD instead
- of FIELD_NAME; Always align the header on an 8 byte boundary
- *before* updating the header length.
-
-2003-09-15 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-pending-call.c: add the get/set object data
- boilerplate as for DBusConnection, etc. Use generic object data
- for the notify callback.
-
- * glib/dbus-gparser.c (parse_node): parse child nodes
-
- * tools/dbus-viewer.c: more hacking on the dbus-viewer
-
- * glib/dbus-gutils.c (_dbus_gutils_split_path): add a file to
- contain functions shared between the convenience lib and the
- installed lib
-
- * glib/Makefile.am (libdbus_glib_1_la_LDFLAGS): add
- -export-symbols-regex to the GLib library
-
- * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock):
- fix the locking in here, and add a default handler for
- Introspect() that just returns sub-nodes.
-
-2003-09-14 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gthread.c (dbus_g_thread_init): rename to make g_foo
- rather than gfoo consistent
-
- * glib/dbus-gproxy.h: delete for now, move contents to
- dbus-glib.h, because the include files don't work right since we
- aren't in the dbus/ subdir.
-
- * glib/dbus-gproxy.c (dbus_gproxy_send): finish implementing
- (dbus_gproxy_end_call): finish
- (dbus_gproxy_begin_call): finish
-
- * glib/dbus-gmain.c (dbus_set_g_error): new
-
- * glib/dbus-gobject.c (handle_introspect): include information
- about child nodes in the introspection
-
- * dbus/dbus-connection.c (dbus_connection_list_registered): new
- function to help in implementation of introspection
-
- * dbus/dbus-object-tree.c
- (_dbus_object_tree_list_registered_and_unlock): new function
-
-2003-09-12 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gidl.h: add common base class for all the foo_info
- types
-
- * tools/dbus-viewer.c: add GTK-based introspection UI thingy
- similar to kdcop
-
- * test/Makefile.am: try test srcdir -ef . in addition to test
- srcdir = ., one of them should work (yeah lame)
-
- * glib/Makefile.am: build the "idl" parser stuff as a convenience
- library
-
- * glib/dbus-gparser.h: make description_load routines return
- NodeInfo* not Parser*
-
- * Makefile.am (SUBDIRS): build test dir after all library dirs
-
- * configure.in: add GTK+ detection
-
-2003-09-07 Havoc Pennington <hp@pobox.com>
-
- * Make Doxygen contented.
-
-2003-09-07 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: more updates
-
-2003-09-06 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: partial updates
-
- * bus/dbus-daemon-1.1.in: fix the config file docs for the
- zillionth time; hopefully I edited the right file this time.
-
- * bus/config-parser.c (append_rule_from_element): support
- send_type, send_path, receive_type, receive_path
-
- * bus/policy.c: add message type and path to the list of things
- that can be "firewalled"
-
-2003-09-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_register_fallback): add this
- (dbus_connection_register_object_path): make this not handle
- messages to paths below the given path
-
-2003-09-03 Havoc Pennington <hp@pobox.com>
-
- * test/glib/Makefile.am: add this with random glib-linked test
- programs
-
- * glib/Makefile.am: remove the random test programs from here,
- leave only the unit tests
-
- * glib/dbus-gobject.c (_dbus_gobject_test): add test for
- uscore/javacaps conversion, and fix
- (get_object_property, set_object_property): change to .NET
- convention for mapping props to methods, set_FooBar/get_FooBar,
- since one language has such a convention we may as well copy it.
- Plus real methods in either getFooBar or get_foo_bar style won't
- collide with this convention.
-
-2003-09-01 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gparser.c: implement
-
- * glib/dbus-gobject.c: start implementing skeletons support
-
- * configure.in: when disabling checks/assert, also define
- G_DISABLE_ASSERT and G_DISABLE_CHECKS
-
-2003-09-01 Havoc Pennington <hp@pobox.com>
-
- * glib/Makefile.am: rearrange a bunch of files and get "make
- check" framework set up
-
-2003-08-31 Havoc Pennington <hp@pobox.com>
-
- * fix build with --disable-tests
-
-2003-08-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c: purge DBusMessageHandler
-
- * dbus/dbus-message-handler.c: remove DBusMessageHandler, just
- use callbacks everywhere
-
-2003-08-30 Havoc Pennington <hp@pobox.com>
-
- * test/data/valid-config-files/system.d/test.conf: change to
- root for the user so warnings don't get printed
-
- * dbus/dbus-message.c: add dbus_message_get_path,
- dbus_message_set_path
-
- * dbus/dbus-object-tree.c (do_test_dispatch): add test of
- dispatching to a path
-
- * dbus/dbus-string.c (_dbus_string_validate_path): add
-
- * dbus/dbus-marshal.c (_dbus_demarshal_object_path): implement
- (_dbus_marshal_object_path): implement
-
- * dbus/dbus-protocol.h (DBUS_HEADER_FIELD_PATH): new header field
- to contain the path to the target object
- (DBUS_HEADER_FIELD_SENDER_SERVICE): rename
- DBUS_HEADER_FIELD_SENDER to explicitly say it's the sender service
-
-2003-08-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-tree.c: write tests and fix the discovered bugs
-
-2003-08-29 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-tree.c: modify to allow overlapping paths to be
- registered
- (struct DBusObjectSubtree): shrink this
- a lot, since we may have a lot of them
- (_dbus_object_tree_free_all_unlocked): implement
- (_dbus_object_tree_dispatch_and_unlock): implement
-
-2003-08-29 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-internals.h: fix _DBUS_N_GLOBAL_LOCKS
-
-2003-08-28 Havoc Pennington <hp@pobox.com>
-
- purge DBusObjectID
-
- * dbus/dbus-connection.c: port to no ObjectID, create a
- DBusObjectTree, rename ObjectTree to ObjectPath in public API
-
- * dbus/dbus-connection.h (struct DBusObjectTreeVTable): delete
- everything except UnregisterFunction and MessageFunction
-
- * dbus/dbus-marshal.c: port away from DBusObjectID,
- add DBUS_TYPE_OBJECT_PATH
-
- * dbus/dbus-object-registry.[hc], dbus/dbus-object.[hc],
- dbus/dbus-objectid.[hc]: remove these, we are moving to
- path-based object IDs
-
-2003-08-25 Havoc Pennington <hp@pobox.com>
-
- Just noticed that dbus_message_test is hosed, I wonder when I
- broke that. I thought make check was passing earlier...
-
- * dbus/dbus-object-tree.c: add new "object tree" to match DCOP
- container tree, will replace most of dbus-object-registry
-
- * dbus/dbus-string.c (_dbus_string_append_printf_valist): fix C99
- screwup
-
-2003-08-19 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (decode_string_field): support FIELD_SENDER
- (dbus_message_is_error): fix this function
-
- * bus/dbus-daemon-1.1: clarify logic on when <deny>/<allow> rules
- match
-
- * bus/policy.c (bus_client_policy_check_can_receive): fix code to
- reflect clarified man page
- (bus_client_policy_check_can_send): ditto
-
- * bus/session.conf.in: fixup
-
- * bus/system.conf.in: fixup
-
-2003-08-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix
-
- * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
- dumb bug created earlier (wrong order of args to
- decode_header_data())
-
- * tools/dbus-send.c: port
-
- * tools/dbus-print-message.c (print_message): port
-
- * test/data/*messages: port all messages over
-
- * dbus/dbus-message-builder.c: support including
- message type
-
- * bus/driver.c: port over
-
- * bus/dispatch.c: port over to new stuff
-
- * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
- rename disconnect signal to "Disconnected"
-
-2003-08-17 Havoc Pennington <hp@pobox.com>
-
- This doesn't compile yet, but syncing up so I can hack on it from
- work. What are branches for if not broken code? ;-)
-
- * dbus/dbus-protocol.h: remove DBUS_HEADER_FIELD_NAME, add
- DBUS_HEADER_FIELD_INTERFACE, DBUS_HEADER_FIELD_MEMBER,
- DBUS_HEADER_FIELD_ERROR_NAME
-
- * dbus/dbus-hash.c: Introduce DBUS_HASH_TWO_STRINGS as hack to use
- for the interface+member pairs
- (string_hash): change to use g_str_hash algorithm
- (find_direct_function, find_string_function): refactor these to
- share most code.
-
- * dbus/dbus-message.c: port all of this over to support
- interface/member fields instead of name field
-
- * dbus/dbus-object-registry.c: port over
-
- * dbus/dbus-string.c (_dbus_string_validate_interface): rename
- from _dbus_string_validate_name
-
- * bus/dbus-daemon-1.1: change file format for the
- <deny>/<allow> stuff to match new message naming scheme
-
- * bus/policy.c: port over
-
- * bus/config-parser.c: parse new format
-
-2003-08-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-registry.c (add_and_remove_objects): remove
- broken assertion
-
- * glib/dbus-gproxy.c: some hacking
-
-2003-08-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-pending-call.c (dbus_pending_call_block): implement
-
- * dbus/dbus-connection.c
- (dbus_connection_send_with_reply_and_block): factor out internals;
- change to convert any error replies to DBusError instead of
- returning them as a message
-
-2003-08-15 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c,
- dbus/dbus-pending-call.c: Finish the pending call stuff
-
-2003-08-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-pending-call.c: start on new object that will replace
- DBusMessageHandler and ReplyHandlerData for tracking outstanding
- replies
-
- * dbus/dbus-gproxy.c: start on proxy object used to communicate
- with remote interfaces
-
- * dbus/dbus-gidl.c: do the boring boilerplate in here
-
-2003-08-12 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (bus_dispatch): make this return proper
- DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD
-
- * dbus/dbus-errors.c (dbus_set_error): use
- _dbus_string_append_printf_valist
-
- * dbus/dbus-string.c (_dbus_string_append_printf_valist)
- (_dbus_string_append_printf): new
-
- * dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to
- UNKNOWN_METHOD
-
- * dbus/dbus-connection.c (dbus_connection_dispatch): handle
- DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a
- message is unhandled.
-
-2003-08-11 Havoc Pennington <hp@pobox.com>
-
- * bus/test.c (client_disconnect_handler): change to return
- HANDLED (would have been REMOVE_MESSAGE)
-
- * dbus/dbus-object.h (enum DBusHandlerResult): rename to
- HANDLED/NOT_YET_HANDLED instead of
- REMOVE_MESSAGE/ALLOW_MORE_HANDLERS to make it clearer how it
- should be used.
-
-2003-08-10 Havoc Pennington <hp@pobox.com>
-
- * tools/dbus-send.c (main): add --type argument, for now
- supporting only method_call and signal types.
-
- * tools/dbus-print-message.c: print message type
-
- * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
- init connection->objects
-
- * doc/dbus-specification.sgml: fix sgml
-
- * bus/*.c: port over to object-instance API changes
-
- * test/test-service.c: ditto
-
- * dbus/dbus-message.c (dbus_message_create_header): allow #NULL
- name, we will have to fix up the rest of the code to also handle
- this
- (dbus_message_new): generic message-creation call
- (set_string_field): allow appending name field
-
-2003-08-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-registry.c: implement signal connection
- and dispatch
-
- * dbus/dbus-connection.c (_dbus_connection_unref_unlocked): new
-
- * dbus/dbus-internals.c (_dbus_memdup): new function
-
-2003-08-02 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_get_no_reply)
- (dbus_message_set_no_reply): add these and remove
- set_is_error/get_is_error
-
- * dbus/dbus-protocol.h, doc/dbus-specification.sgml:
- remove the ERROR flag, since there's now an ERROR type
-
-2003-08-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-registry.c (_dbus_object_registry_handle_and_unlock):
- implement
-
- * dbus/dbus-message.c (dbus_message_get_type): new function
-
- * doc/dbus-specification.sgml: add "type" byte to messages
-
-2003-08-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce
- a message type enum to distinguish kinds of message
- (DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message
- that need not be replied to
-
-2003-08-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-marshal.c: adapt to DBusObjectID changes
- (unpack_8_octets): fix no-64-bit-int bug
-
- * dbus/dbus-object-registry.c (validate_id): validate the
- connection ID bits, not just the instance ID.
-
- * dbus/dbus-connection.c (_dbus_connection_init_id): initialize
- the connection-global 33 bits of the object ID
-
- * dbus/dbus-object-registry.c (info_from_entry): fill in
- object ID in the new way
-
- * dbus/dbus-objectid.h: rather than high/low bits, specifically
- define server/client/instance bits.
-
-2003-07-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_register_object): fix
- build
-
-2003-07-13 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object.h (struct DBusObjectVTable): add padding
- fields to DBusObjectVTable and DBusObjectInfo
-
-2003-07-12 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object-registry.c: implement unit test,
- fix bugs discovered in process
-
- * dbus/dbus-connection.c: remove handler_table and
- register_handler(), add DBusObjectRegistry usage
-
- * dbus/dbus-objectid.c (dbus_object_id_is_null)
- (dbus_object_id_set_null): new functions
-
-2003-07-08 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object.c: implement some of this
-
- * dbus/dbus-object-registry.c
- (_dbus_object_registry_add_and_unlock): fill in the object_id out
- param
- (_dbus_object_registry_new): handle OOM
-
-2003-07-08 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-object.h: sketch out an API for registering objects
- with a connection, that allows us to use as little as 24 bytes
- per object and lets application code represent an object in
- any conceivable way.
-
- * dbus/dbus-object-registry.c: implement the hard bits of the
- DBusConnection aspect of object API. Not yet wired up.
-
-2003-07-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-marshal.c (_dbus_marshal_set_object_id): new function
- (_dbus_marshal_object_id): new
- (_dbus_demarshal_object_id): new
- (_dbus_marshal_get_arg_end_pos): support object ID type, and
- consolidate identical switch cases. Don't conditionalize handling
- of DBUS_TYPE_UINT64, need to handle the type always.
- (_dbus_marshal_validate_arg): consolidate identical cases, and
- handle DBUS_TYPE_OBJECT_ID
-
- * dbus/dbus-objectid.c: new file with DBusObjectID data type.
-
- * dbus/dbus-protocol.h: add DBUS_TYPE_OBJECT_ID
-
-2003-09-28 Havoc Pennington <hp@pobox.com>
-
- * real 0.13 release
-
-2003-09-28 Havoc Pennington <hp@pobox.com>
-
- * doc/Makefile.am (dbus-specification.html): testing a funky hack
- to work with Debian db2html
-
-2003-09-28 Havoc Pennington <hp@pobox.com>
-
- * configure.in: 0.13
-
- * doc/Makefile.am (dbus-test-plan.html): accept nonexistence of
- stylesheet-images for benefit of Debian
-
- Change back to using filesystem-linked sockets for the system
- bus, so only root can create the default system bus address.
-
- * bus/system.conf.in: change to use
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS
-
- * dbus/Makefile.am (INCLUDES): remove DBUS_SYSTEM_BUS_PATH define
- from here.
-
- * configure.in: define DBUS_SYSTEM_BUS_DEFAULT_ADDRESS
- here, and AC_DEFINE DBUS_SYSTEM_PATH
-
-2003-08-09 Anders Carlsson <andersca@codefactory.se>
-
- * doc/TODO:
- * doc/busconfig.dtd:
- Add busconfig DTD.
-
-2003-08-09 Anders Carlsson <andersca@codefactory.se>
-
- * doc/dbus-specification.sgml:
- Add activation reply values.
-
-2003-08-05 Havoc Pennington <hp@redhat.com>
-
- * configure.in: 0.12
-
-2003-08-05 Anders Carlsson <andersca@codefactory.se>
-
- * glib/dbus-gmain.c: (watch_fd_new), (watch_fd_ref),
- (watch_fd_unref), (dbus_gsource_check), (dbus_gsource_dispatch),
- (add_watch), (remove_watch), (create_source):
- Refcount fds, fixes some reentrancy issues.
-
-2003-07-30 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-bus.c (init_connections_unlocked): fix default system
- bus address to be abstract if we have abstract sockets
-
- * NEWS: update
-
-2003-07-28 Havoc Pennington <hp@redhat.com>
-
- * bus/messagebus.in: fix to avoid processname/servicename
- confusion, from Michael Kearey
- https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=100965
-
-2003-07-23 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_iter_get_named):
- fix from Andy Hanton to remove broken "+1"
-
-2003-07-16 Havoc Pennington <hp@pobox.com>
-
- * tools/dbus-launch.c (babysit): close stdout/stderr in the
- babysitter process, as suggested by Thomas Leonard, so
- an "eval `dbus-launch --exit-with-session`" will actually
- return
-
-2003-07-16 Havoc Pennington <hp@pobox.com>
-
- * configure.in: print out EXPANDED_* variables in the summary at
- the end; clean up the code that computes EXPANDED_ variables and
- get the ones using exec_prefix right. Should make things work
- when you build without --prefix
-
-2003-06-29 Havoc Pennington <hp@pobox.com>
-
- * mono/Test.cs (class Test): fire up a main loop and run it
-
- * mono/DBus.cs (DBus): don't g_thread_init since it can only be
- done once, the app has to do it
-
-2003-06-26 Havoc Pennington <hp@pobox.com>
-
- * mono/Connection.cs: set up connection with the glib main loop
-
-2003-07-01 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.sgml: clarify the format of a type code,
- change suggested by Jim Blandy
-
-2003-06-29 Miloslav Trmac <mitr@volny.cz>
-
- * doc/Makefile.am:
- * tools/Makefile.am: Don't assume srcdir == builddir.
-
- * dbus/dbus-memory.c (dbus_realloc): Don't check guards after shrinking
- the allocated block.
- (_dbus_memory_test): New function.
- * dbus/dbus-test.h: Add _dbus_memory_test ().
- * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Call it.
-
- * dbus/dbus-message.c (decode_header_data): Use %.4s instead
- of %c%c%c%c.
- (dbus_message_new): Remove obsolete @todo.
-
- * dbus/dbus-marshal.c (_dbus_marshal_set_int64)
- (_dbus_marshal_set_uint64): Fix comment.
-
- * dbus/dbus-message.c (append_int_field, append_uint_field): Don't
- hardcode FIELD_REPLY_SERIAL.
-
- * dbus/dbus-mainloop.c (_dbus_loop_remove_watch)
- (_dbus_loop_remove_timeout): Cast function pointers to (void *) for %p
-
- * configure.in: Add -D_POSIX_C_SOURCE=199309L -DBSD_SOURCE to CFLAGS
- and disable DBUS_USE_ATOMIC_INT_486 when --enable-ansi is used
-
-2003-06-24 Havoc Pennington <hp@pobox.com>
-
- * mono/*.cs: Use IntPtr.Zero instead of ((IntPtr) 0)
-
-2003-06-23 Anders Carlsson <andersca@codefactory.se>
-
- * configure.in:
- * gcj/.cvsignore:
- * gcj/Hello.java:
- * gcj/Makefile.am:
- * gcj/TestMessage.java: (TestMessage), (TestMessage.main):
- * gcj/org/.cvsignore:
- * gcj/org/Makefile.am:
- * gcj/org/freedesktop/.cvsignore:
- * gcj/org/freedesktop/Makefile.am:
- * gcj/org/freedesktop/dbus/.cvsignore:
- * gcj/org/freedesktop/dbus/Makefile.am:
- * gcj/org/freedesktop/dbus/Message.java: (Message),
- (Message.Message):
- * gcj/org/freedesktop/dbus/natMessage.cc:
- Fix the build system.
-
-2003-06-22 Havoc Pennington <hp@pobox.com>
-
- * mono/Connection.cs: add more bindings
-
- * dbus/dbus-threads.c (dbus_threads_init): allow calling this
- more than once.
-
-2003-06-22 Havoc Pennington <hp@pobox.com>
-
- * mono/Connection.cs, mono/DBus.cs, mono/Error.cs:
- Start wrapping more stuff.
-
-2003-06-22 Havoc Pennington <hp@pobox.com>
-
- * mono/Message.cs: implement Message.Wrap() that ensures we only
- have a single C# wrapper per DBusMessage, assuming it works which
- it probably doesn't.
-
- * dbus/dbus-message.c (dbus_message_allocate_data_slot): new
- (dbus_message_free_data_slot): new
- (dbus_message_set_data): new
- (dbus_message_get_data): new
-
-2003-06-22 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_unref)
- (_dbus_data_slot_allocator_alloc): rework these to keep a
- reference count on each slot and automatically manage a global
- slot ID variable passed in by address
-
- * bus/bus.c: convert to new dataslot API
-
- * dbus/dbus-bus.c: convert to new dataslot API
-
- * dbus/dbus-connection.c: convert to new dataslot API
-
- * dbus/dbus-server.c: convert to new dataslot API
-
- * glib/dbus-gmain.c: ditto
-
- * bus/test.c: ditto
-
- * bus/connection.c: ditto
-
-2003-06-22 Anders Carlsson <andersca@codefactory.se>
-
- * configure.in: Add AM_PROG_GCJ and move AM_PROG_LIBTOOL
- after the gcj checks so that the correct configuration tags
- will be added to libtool.
-
- * dbus-glib-1.pc.in: No need to specify any includes since
- dbus-1.pc.in has those.
-
-2003-06-22 Havoc Pennington <hp@pobox.com>
-
- * mono/*, gcj/*, configure.in, Makefile.am:
- Check in makefiles and subdirs for mono and gcj bindings.
- Neither binding actually exists, just trying to get through
- all the build and other boring bits.
-
-2003-06-21 Philip Blundell <philb@gnu.org>
-
- * tools/dbus-monitor.1: Updated.
-
- * tools/dbus-send.1: Likewise.
-
-2003-06-20 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-transport-unix.c (unix_handle_watch): Check
- for hangup and error after checking read so we won't discard
- pending data if both hangup and read are set.
-
-2003-06-19 Philip Blundell <philb@gnu.org>
-
- * tools/dbus-print-message.c (print_message): Handle BOOLEAN.
-
- * tools/dbus-send.c: Accept both --system and --session.
-
- * tools/dbus-monitor.c: Same here.
-
-2003-06-19 Anders Carlsson <andersca@codefactory.se>
-
- * glib/dbus-glib.h: Fix so that dbus-glib.h can be used
- from C++ (Patch by Miloslav Trmac).
-
-2003-06-15 Joe Shaw <joe@assbarn.com>
-
- * configure.in: Check for socklen_t.
-
- * dbus/dbus-sysdeps.c: Define socklen_t if it's not defined.
-
- * test/test-segfault.c: Add #include <sys/time.h>
-
- * tools/Makefile.am: Add DBUS_X_CFLAGS to the INCLUDES since
- dbus-launch needs it.
-
-2003-06-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): don't use
- SUN_LEN, it breaks abstract socket usage
-
- * dbus/dbus-internals.c (_dbus_verbose_real): only print PID at
- starts of lines.
-
-2003-06-04 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-server.c (dbus_server_listen): allow abstract sockets
- using unix:abstract=/foo, and when listening in a tmpdir
- i.e. unix:tmpdir=/tmp, always use abstract sockets if we can.
-
- * dbus/dbus-transport.c (_dbus_transport_open): support
- unix:abstract=/foo
-
- * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
- support abstract sockets
-
- * dbus/dbus-transport-unix.c
- (_dbus_transport_new_for_domain_socket): support abstract sockets
-
- * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract"
- toggle as an argument, implement abstract namespace support
- (_dbus_listen_unix_socket): ditto
-
- * configure.in: add --enable-abstract-sockets and implement
- a configure check for autodetection of the right value.
-
-2003-06-01 Havoc Pennington <hp@pobox.com>
-
- * tools/dbus-cleanup-sockets.c: add utility to clean up sockets
- in /tmp (though on Linux this will end up being useless,
- when we add abstract namespace support)
-
- * configure.in: define DBUS_SESSION_SOCKET_DIR in addition to
- subst'ing it
-
-2003-05-28 Colin Walters <walters@verbum.org>
-
- * tools/dbus-monitor.c (main): Fix silly typo (s/--session/--system/).
-
-2003-05-18 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c (dbus_message_new): Remove @todo.
-
-2003-05-17 Colin Walters <walters@gnu.org>
-
- * tools/dbus-send.c: Don't exit with an error code if --help was
- passed. Default to using the session bus instead of the system
- one.
-
- * tools/dbus-launch.c: Ditto.
-
- * tools/dbus-monitor.c: Ditto.
-
- * tools/dbus-send.1: Update with new arguments.
-
- * tools/dbus-launch.c: Emit code to export variables. New
- arguments -s and -c to specify shell syntax, and a bit of code to
- autodetect syntax. Also, allow specifying a program to run.
-
- * tools/dbus-launch.1: Update with new arguments.
-
- * tools/dbus-send.1: Ditto.
-
- * tools/dbus-monitor.1: Ditto.
-
-2003-05-17 Havoc Pennington <hp@pobox.com>
-
- * bus/config-parser.c (merge_included): merge in policies from
- child configuration file.
-
- * bus/policy.c (bus_policy_merge): function to merge two policies
- together
-
-2003-05-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c: disable verbose lock spew
-
- * tools/dbus-send.c: add --print-reply command line option
-
- * tools/dbus-print-message.h (print_message): new util function
- shared by dbus-send and dbus-monitor
-
- * tools/dbus-monitor.c (handler_func): exit on disconnect
-
- * dbus/dbus-transport-unix.c (do_reading): if the transport is
- disconnected, don't try to use the read_watch
-
- * dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL
- so we can find this bug more easily
-
-2003-05-16 Havoc Pennington <hp@redhat.com>
-
- * bus/policy.c (free_rule_list_func): avoid a crash when passed
- NULL as DBusHashTable is annoyingly likely to do.
-
-2003-05-16 Colin Walters <walters@verbum.org>
-
- * tools/dbus-monitor.c: Add --session argument and usage()
- function.
-
- * tools/dbus-monitor.1: Update with new --session arg.
-
- * bus/Makefile.am (install-data-hook): Create
- $(libdir)/dbus-1.0/services so that the session bus is happy.
-
-2003-05-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work
- on non-x86. ifdef's are evil.
-
-2003-05-15 Havoc Pennington <hp@redhat.com>
-
- * configure.in: 0.11
-
- * NEWS: update
-
- * bus/Makefile.am (initddir): apparently we are supposed to put
- init scripts in /etc/rc.d/init.d not /etc/init.d
-
- * bus/Makefile.am: remove the "you must --enable-tests to make
- check" as it broke distcheck
-
- * bus/Makefile.am (install-data-hook): create /etc/dbus-1/system.d
-
-2003-05-13 James Willcox <jwillcox@gnome.org>
-
- * configure.in:
- * bus/activation.c: (bus_activation_service_created),
- (bus_activation_activate_service):
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_send_service_created), (bus_driver_send_service_lost),
- (bus_driver_send_service_acquired),
- (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services):
- * bus/session.conf.in:
- * dbus/dbus-bus.c: (dbus_bus_acquire_service),
- (dbus_bus_service_exists), (dbus_bus_activate_service):
- * dbus/dbus-bus.h:
-
- Add some convenience API which lets you activate a service, and did a
- bunch of s/0/DBUS_TYPE_INVALID/ in calls to dbus_message_append_args()
- and dbus_message_get_args()
-
-2003-05-11 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
- calling _dbus_marshal_validate_arg() for every byte in a byte
- array, etc.
-
- * dbus/dbus-message-handler.c: use atomic reference counting to
- reduce number of locks slightly; the global lock in here sucks
-
- * dbus/dbus-connection.c
- (_dbus_connection_update_dispatch_status_and_unlock): variant of
- update_dispatch_status that can be called with lock held; then use
- in a couple places to reduce locking/unlocking
- (dbus_connection_send): hold the lock over the whole function
- instead of acquiring it twice.
-
- * dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM
-
- * bus/connection.c (bus_connections_setup_connection): fix access
- to already-freed memory.
-
- * dbus/dbus-connection.c: keep a little cache of linked list
- nodes, to avoid using the global linked list alloc lock in the
- normal send-message case. Instead we just use the connection lock
- that we already have to take.
-
- * dbus/dbus-list.c (_dbus_list_find_last): new function
-
- * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
- change to use a struct for the atomic type; fix docs,
- they return value before increment, not after increment.
-
- * dbus/dbus-string.c (_dbus_string_append_4_aligned)
- (_dbus_string_append_8_aligned): new functions to try to
- microoptimize this operation.
- (reallocate_for_length): break this out of set_length(), to
- improve profile info, and also so we can consider inlining the
- set_length() part.
-
- * dbus/dbus-message.c (dbus_message_new_empty_header): init data
- strings with some preallocation, cuts down on our calls to realloc
- a fair bit. Though if we can get the "move entire string to empty
- string" optimization below to kick in here, it would be better.
-
- * dbus/dbus-string.c (_dbus_string_move): just call
- _dbus_string_move_len
- (_dbus_string_move_len): add a special case for moving
- an entire string into an empty string; we can just
- swap the string data instead of doing any reallocs.
- (_dbus_string_init_preallocated): new function
-
-2003-05-11 Havoc Pennington <hp@pobox.com>
-
- Write a "test-profile" that does echo client-server with threads;
- profile reveals lock contention, memcpy/realloc of buffers, and
- UTF-8 validation as hot spots. 20% of lock contention eliminated
- with dbus_atomic_inc/dec implementation on x86. Much remaining
- contention is global mempool locks for GList and DBusList.
-
- * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add
- x86 implementation
-
- * dbus/dbus-connection.c (struct DBusConnection): use
- dbus_atomic_t for the reference count
-
- * dbus/dbus-message.c (struct DBusMessage): declare
- dbus_atomic_t values as volatile
-
- * configure.in: code to detect ability to use atomic integer
- operations in assembly, from GLib patch
-
- * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every
- time, tired of it being wrong in threads and forked processes
-
- * glib/test-profile.c: a little program to bounce messages back
- and forth between threads and eat CPU
-
- * dbus/dbus-connection.c: add debug spew macros for debugging
- thread locks; include config.h at top; fix deadlock in
- dbus_connection_flush()
-
-2003-05-08 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov
- data from getting written, and there wasn't a good reason to
- use _exit really.
-
- * test/decode-gcov.c (mark_inside_dbus_build_tests): don't count
- dbus_verbose lines in test coverage
- (main): add list of functions sorted by # of untested blocks
- to the coverage report
-
- * dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS
-
- * dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage
-
- * dbus/dbus-message-handler.c (_dbus_message_handler_test):
- extend test coverage
-
- * test/data/auth/cancel.auth-script: test canceling an
- authentication
-
- * dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they
- aren't used. in CVS history if we end up needing them.
-
-2003-05-04 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message-handler.c (_dbus_message_handler_test): add
- unit test
-
- * dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this
- function, which assumed length was in # of strings, not bytes
-
- * dbus/dbus-message.c (_dbus_message_test): add tests for some
- missing coverage
-
- * dbus/dbus-connection.c
- (_dbus_connection_queue_received_message): disable function for
- now, we are only using it in test mode
-
- * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
- remove a mistaken FIXME
-
-2003-05-04 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_preallocate_send):
- unlock mutex on successful return, patch from Anders Gustafsson
-
-2003-05-04 Havoc Pennington <hp@pobox.com>
-
- * dbus-glib-1.pc.in (Requires): fix dependencies, from
- Anders Gustafsson
-
-2003-05-04 Havoc Pennington <hp@pobox.com>
-
- * tools/dbus-launch.c: implement
-
- * bus/main.c (main), bus/bus.c (bus_context_new):
- implement --print-pid and --fork
-
-2003-05-03 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-address.c (dbus_parse_address): fix bug when a key in
- the address had no value, and add to test suite. Fix and
- regression test from Miloslav Trmac
-
-2003-05-03 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-watch.c (dbus_watch_handle): warn and return if a
- watch is invalid when handled
-
- * tools/Makefile.am, tools/dbus-launch.c, tools/dbus-launch.1: add
- dbus-launch utility to launch the bus from a shell script. Didn't
- actually implement dbus-launch yet, it's just a placeholder still.
-
-2003-05-03 Havoc Pennington <hp@pobox.com>
-
- * bus/Makefile.am, bus/dbus-daemon-1.1.in: man page for the
- daemon; also documents daemon config file, so replaces
- doc/config-file.txt. Corrected some stuff from config-file.txt in
- the process of moving it.
-
-2003-05-03 Havoc Pennington <hp@pobox.com>
-
- * tools/Makefile.am, tools/dbus-send.1, tools/dbus-monitor.1:
- add some man pages
-
-2003-05-03 Colin Walters <walters@verbum.org>
-
- * dbus/dbus-sysdeps.c (fill_user_info): Test against
- DBUS_UID_UNSET to determine whether to do a uid lookup or not.
-
- * Makefile.am: Update to use new .pc versioning scheme.
-
-2003-05-02 Havoc Pennington <hp@redhat.com>
-
- * bus/system.conf.in: allow send/receive to/from message bus
- service
-
-2003-04-30 Havoc Pennington <hp@redhat.com>
-
- * configure.in: print a note when building with unit tests and
- without assertions
-
-2003-04-30 Havoc Pennington <hp@redhat.com>
-
- * Makefile.am: add a check-local that complains if you didn't
- configure with --enable-tests
-
-2003-04-29 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gmain.c: docs cleanups
-
- * dbus/dbus-types.h: add docs on int64 types
-
- * dbus/dbus-memory.c: fix docs to avoid putting private API in
- public API docs section
-
-2003-04-29 Havoc Pennington <hp@redhat.com>
-
- * dbus-1.pc.in, dbus-glib-1.pc.in: rename these from
- dbus-1.0.pc.in, dbus-glib-1.0.pc.in. As these change with the
- parallel install API version, not with the D-BUS package version.
-
- * HACKING: move some of README over here
-
- * README: updates, and document API/ABI policy
-
- * configure.in: reindentation
-
-2003-04-29 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus.h: add "you have to define DBUS_API_SUBJECT_TO_CHANGE
- to use this library" to be sure people have the right
- expectations.
-
-2003-04-28 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add --enable-docs which by default is auto yes if
- doxygen and db2html found, no otherwise; but can be forced on/off
-
- * doc/Makefile.am: conditionalize whether to build docs on
- --enable-docs
-
-2003-04-28 Havoc Pennington <hp@redhat.com>
-
- * configure.in: 0.10
-
- * NEWS: update
-
- * bus/system.conf.in: add <includedir>system.d</includedir>
-
- * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when
- username was provided but not uid
-
- * bus/config-parser.c (struct BusConfigParser): keep track of
- whether the parser is toplevel or was included; change some
- of the error handling if it's included.
-
-2003-04-27 Havoc Pennington <hp@pobox.com>
-
- Unbreak my code...
-
- * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
- report correct status if we finish processing authentication
- inside this function.
-
- * bus/activation.c (try_send_activation_failure): use
- bus_transaction_send_error_reply
-
- * bus/connection.c (bus_connection_get_groups): return an error
- explaining the problem
-
- * bus/bus.c (bus_context_check_security_policy): implement
- restriction here that inactive connections can only send the
- hello message. Also, allow bus driver to send anything to
- any recipient.
-
- * bus/connection.c (bus_connection_complete): create the
- BusClientPolicy here instead of on-demand.
- (bus_connection_get_policy): don't return an error
-
- * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
- sender field in message being replied to
-
- * bus/bus.c (bus_context_check_security_policy): fix silly typo
- causing it to return FALSE always
-
- * bus/policy.c (bus_client_policy_check_can_send): fix bug where
- we checked sender rather than destination
-
-2003-04-25 Havoc Pennington <hp@redhat.com>
-
- test suite is slightly hosed at the moment, will fix soon
-
- * bus/connection.c (bus_connections_expire_incomplete): fix to
- properly disable the timeout when required
- (bus_connection_set_name): check whether we can remove incomplete
- connections timeout after we complete each connection.
-
- * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
- probably still broken.
-
- * bus/services.c (bus_registry_acquire_service): implement max
- number of services owned, and honor allow/deny rules on which
- services a connection can own.
-
- * bus/connection.c (bus_connection_get_policy): report errors here
-
- * bus/activation.c: implement limit on number of pending
- activations
-
-2003-04-25 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
- where we used >= 0 instead of != DBUS_UID_UNSET.
-
-2003-04-25 Havoc Pennington <hp@redhat.com>
-
- * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
- were toggled without add/remove, fix from Anders Gustafsson
-
-2003-04-24 Havoc Pennington <hp@redhat.com>
-
- * test/data/valid-config-files/basic.conf: add <limit> tags to
- this test
-
- * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
- <limit> tag in configuration file.
-
-2003-04-24 Havoc Pennington <hp@redhat.com>
-
- * bus/dispatch.c: somehow missed some name_is
-
- * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
- (_dbus_timeout_set_interval): new
-
- * bus/connection.c (bus_connections_setup_connection): record time
- when each connection is first set up, and expire them after the
- auth timeout passes.
-
-2003-04-24 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_name_is): rename
- (dbus_message_service_is): rename
- (dbus_message_sender_is): rename
- (dbus_message_get_service): rename
-
-2003-04-24 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add --enable-checks
-
- * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
-
- * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
- to use thread locks.
- (_dbus_connection_handler_destroyed_locked): move some private
- functions into proper docs group
-
- * dbus/dbus-internals.h: add _dbus_return_if_fail,
- _dbus_return_val_if_fail
-
- Throughout: use dbus_return_if_fail
-
-2003-04-23 James Willcox <jwillcox@gnome.org>
-
- * glib/dbus-glib.h:
- * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source),
- (dbus_connection_setup_with_g_main),
- (dbus_server_setup_with_g_main):
- * glib/test-dbus-glib.c: (main):
- * glib/test-thread-client.c: (main):
- * glib/test-thread-server.c: (new_connection_callback), (main):
- * tools/dbus-monitor.c: (main):
-
- Added a GMainContext argument to dbus_connection_setup_with_g_main()
- and dbus_server_setup_with_g_main().
-
-2003-04-20 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: document the restrictions on
- message and service names
-
-2003-04-22 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
- support, and do some code cleanups to share more code and
- speed up array marshal/demarshal.
-
- * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
-
- * configure.in: generate dbus-arch-deps.h
-
- * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
- 64-bit typecodes
-
-2003-04-22 Havoc Pennington <hp@redhat.com>
-
- * test/data/valid-messages/opposite-endian.message: fix test
- to use proper type for rply field
-
- * test/data/invalid-messages: add tests for below validation
-
- * dbus/dbus-message.c (decode_header_data): validate field types,
- and validate that named fields are valid names
- (decode_name_field): consider messages in the
- org.freedesktop.Local. namespace to be invalid.
-
- * dbus/dbus-string.c (_dbus_string_validate_name): new
-
-2003-04-19 Havoc Pennington <hp@pobox.com>
-
- * bus/driver.c (bus_driver_handle_hello): check limits and
- return an error if they are exceeded.
-
- * bus/connection.c: maintain separate lists of active and inactive
- connections, and a count of each. Maintain count of completed
- connections per user. Implement code to check connection limits.
-
- * dbus/dbus-list.c (_dbus_list_unlink): export
-
- * bus/bus.c (bus_context_check_security_policy): enforce a maximum
- number of bytes in the message queue for a connection
-
-2003-04-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-auth.c (record_mechanisms): memleak fixes
-
- * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
- memleaks
-
- * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
- on realloc be sure to update the pointer in the keyring
-
- * dbus/dbus-string.c (_dbus_string_zero): compensate for align
- offset to avoid writing to unallocated memory
-
- * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
- try the next mechanism, so we properly handle OOM
-
- * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
- on OOM.
- (_dbus_keyring_new): fix OOM bug
- (_dbus_keyring_new_homedir): always set error; impose a maximum
- number of keys we'll load from the file, mostly to speed up the
- test suite and make its OOM checks more useful, but also for
- general sanity.
-
- * dbus/dbus-auth.c (process_error_server): reject authentication
- if we get an error from the client
- (process_cancel): on cancel, send REJECTED, per the spec
- (process_error_client): send CANCEL if we get an error from the
- server.
-
-2003-04-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
- debug spew
-
- * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
- handling problem
-
- * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
- about DBUS_TEST_HOMEDIR once
-
- * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
- the environment
-
- * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
- config file so we test the right thing
-
- Throughout: assorted docs improvements
-
-2003-04-18 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gmain.c: adapt to watch changes
-
- * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
-
- * dbus/dbus-server.h: remove dbus_server_handle_watch
-
- * dbus/dbus-connection.h: remove dbus_connection_handle_watch
-
- * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
- like DBusTimeout, so we don't need dbus_connection_handle_watch
- etc.
-
-2003-04-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
- database usage so it all goes via the DBusUserDatabase cache.
-
-2003-04-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix logic so that if
- there was an OOM watch we skipped, we always return TRUE so we
- iterate again to have a look at it again. Fixes test suite hang.
- Code rearrangement also lets us lose some memset and only iterate
- over callbacks once.
-
- * bus/driver.c (bus_driver_handle_message): sense of test for
- reply was backward
-
-2003-04-16 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: make spec say serials are unsigned
-
- * dbus/dbus-message.h: change message serials to unsigned
-
- * dbus/dbus-connection.c: adapt to message serials being unsigned
-
-2003-04-15 Havoc Pennington <hp@pobox.com>
-
- * bus/bus.c: create and keep around a shared DBusUserDatabase
- object.
-
- * bus/connection.c (bus_connection_get_groups): don't cache
- groups for user in the connection object, since user database
- object now does that.
-
-2003-04-16 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (_dbus_message_add_size_counter): keep a
- list of size counters
- (_dbus_message_loader_putback_message_link): put back a popped link
-
- * dbus/dbus-connection.c
- (dbus_connection_set_max_live_messages_size): rename
- max_received_size
- (dbus_connection_get_outgoing_size): get size of outgoing
- queue
- (_dbus_connection_set_connection_counter): remove this cruft
-
-2003-04-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-userdb.c: user database abstraction, mostly to get
- caching, but at some point we might want to be able to use a
- different database.
-
- * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses
- SHA1 conf file to test the sha1 auth mechanism, since the regular
- test always uses EXTERNAL when available.
-
- * configure.in,
- test/data/valid-config-files/debug-allow-all-sha1.conf.in:
- add conf file that requires use of sha1 auth
-
-2003-04-13 Havoc Pennington <hp@pobox.com>
-
- * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
- from Philip Blundell to send messages and monitor them.
-
-2003-04-13 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
- callbacks
-
- * test/data/valid-config-files/debug-allow-all.conf.in: allow all
- users
-
- * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
- fix to only recover unused bytes if we're already authenticated
- (_dbus_transport_get_is_authenticated): fix to still mark us
- authenticated if there are unused bytes.
-
- * bus/dispatch.c: implement security policy checking
-
- * bus/connection.c (bus_transaction_send_from_driver): new
-
- * bus/bus.c (bus_context_check_security_policy): new
-
- * bus/dispatch.c (send_service_nonexistent_error): delete this,
- now we just set the DBusError and it gets converted to an error
- reply.
-
- * bus/connection.c (allow_user_function): enable code using actual
- data from the config file
-
- * bus/policy.c (list_allows_user): handle wildcard rules for
- user/group connection perms
-
-2003-04-13 Havoc Pennington <hp@pobox.com>
-
- * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
-
- * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
-
- * bus/policy.c (bus_policy_append_mandatory_rule)
- (bus_policy_append_default_rule, bus_policy_append_user_rule)
- (bus_policy_append_group_rule): new functions
-
-2003-04-12 Havoc Pennington <hp@pobox.com>
-
- * bus/config-parser.c (bus_config_parser_new): fix a memleak
-
- * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
- the pid/gid/uid, just for paranoia.
-
- * test/break-loader.c (randomly_do_n_things): find a byte
- containing a type code, and randomly change it to a different
- type code.
-
-2003-04-12 Havoc Pennington <hp@pobox.com>
-
- * bus/policy.h: change BusPolicy to be the thing from the config
- file, and rename old BusPolicy to BusClientPolicy
-
- * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
- match change in how policy works
-
- * dbus/dbus-internals.h: mark assert_not_reached as
- __attribute((noreturn))__
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.sgml: fix a spot with the wrong name for
- the broadcast service. Use boolean return for ServiceExists.
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add another directory to look for qt in.
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * AUTHORS: add Colin Walters
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * NEWS: update
-
- * configure.in: 0.9
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * bus/messagebus.in: remove pid file when stopping the
- message bus, since the bus won't have privileges to remove it
- itself.
-
-2003-04-11 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_new): move credentials change after
- creating pidfile
-
-2003-04-11 Havoc Pennington <hp@pobox.com>
-
- * test/decode-gcov.c: add "below average functions" to the
- coverage report, and change how some of the code works.
-
- * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
- not in the coverage stats.
-
- * test/test-service.c (main): use _dbus_verbose not fprintf in a
- couple places so running the test suite doesn't result in megaspam.
-
-2003-04-11 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (check_existent_service_activation): accept a no
- memory error in a place we didn't before
-
- * bus/test.c (bus_test_run_everything): remove hacky "do it twice
- in case the first one failed," since the test suite is less
- broken now.
-
-2003-04-10 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (check_segfault_service_activation): add test
- for launching an executable that just crashes.
-
- * test/test-segfault.c (main): try setting coredumpsize to 0 so we
- don't leave a million cores. We'll see how portable this is.
-
-2003-04-10 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
- the possible parent failures before we fork, so that we don't
- fail to create a babysitter after creating the child.
-
- * bus/activation.c (bus_activation_activate_service): kill child
- if we don't successfully complete the activation.
-
-2003-04-10 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
- the connection if it's disconnected
-
- * bus/activation.c (bus_activation_service_created): use new
- transaction features to roll back removal of pending activation if
- we don't successfully create the service after all. Don't remove
- pending activation if the function fails.
-
- * dbus/dbus-list.c (_dbus_list_insert_before_link)
- (_dbus_list_insert_after_link): new code to facilitate
- services.c fixes
-
- * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
- new functionality, so we can preallocate the ability to insert
- into a hash table.
-
- * bus/connection.c (bus_transaction_add_cancel_hook): new function
- allowing us to put custom hooks in a transaction to be used for
- cancelling said transaction
-
- * doc/dbus-specification.sgml: add some discussion of secondary
- service owners, and disallow zero-length service names
-
- * bus/services.c (bus_registry_acquire_service): new function,
- splits out part of bus_driver_handle_acquire_service() and fixes
- a bug where we didn't remove the service doing the acquiring
- from the secondary queue if we failed to remove the current owner
- from the front of the queue.
-
-2003-04-10 Alexander Larsson <alexl@redhat.com>
-
- * doc/dbus-specification.sgml:
- s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
-
-2003-04-10 Alexander Larsson <alexl@redhat.com>
-
- * bus/.cvsignore:
- * glib/.cvsignore:
- * test/.cvsignore:
- Added files to cvsignore
-
- * dbus/dbus-message.h:
- * dbus/dbus-message.c: (dbus_message_iter_get_named):
- Make get_named() take two out argument and return a boolean.
- (dbus_message_iter_get_args_valist):
- Update usage of get_named().
- (dbus_message_iter_append_byte):
- Fix typo
- (dbus_message_iter_append_named)
- Fix typo
- (message_iter_test), (check_message_handling_type), (_dbus_message_test):
- More tests.
-
-2003-04-10 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-marshal.[ch]:
- Add array_type_pos argument to _dbus_marshal_validate_arg.
- Let you pass a NULL end_pos to _dbus_marshal_validate_type.
-
- * dbus/dbus-message.[ch]:
- Multi-dimensional arrays have full type specification in the
- outermost array. Iter code re-arranged to handle this.
- Added some more iter tests.
-
- * doc/dbus-specification.sgml:
- Add me to authors.
- Remove old FIXME.
- Update new array encoding description.
- Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
-
- * test/data/invalid-messages/array-with-mixed-types.message:
- * test/data/valid-messages/array-of-array-of-uint32.message:
- Change to the new array format.
-
- * test/data/invalid-messages/too-short-dict.message:
- Fix bug in test.
-
- * test/data/valid-messages/recursive-types.message:
- Fix up and extend test.
-
-2003-04-10 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c: lots of fixes
-
- * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
- (_dbus_loop_iterate): remove old "quit if no callbacks" code,
- that was crack, broke the test service.
-
- * dbus/dbus-transport.c (_dbus_transport_open): fix error
- handling to avoid piling up errors if we get a failure on the
- first address.
-
- * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
- pid in assertion failures.
-
- * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
- to some fixed size of file descriptor array. Don't return TRUE
- anytime a timeout exists, that led to lots of busy loop silliness
- in the tests.
-
-2003-04-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
- I'd checked this in earlier but hadn't.
-
-2003-04-09 Havoc Pennington <hp@redhat.com>
-
- * bus/dispatch.c (bus_dispatch_test): get a bit further through
- the activation test (man this is getting old!)
-
-2003-04-09 Havoc Pennington <hp@redhat.com>
-
- * test/test-utils.c: use dispatch status function to fix this up
-
- * bus/connection.c (connection_watch_callback): don't dispatch
- from here
- (connection_timeout_callback): don't dispatch from here
- (bus_connections_setup_connection): set the dispatch status function
- (bus_connection_disconnected): unset it
-
- * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function
- used to add a connection to be dispatched
- (_dbus_loop_iterate): do the dispatching at the end of each
- iteration
-
- * dbus/dbus-connection.c
- (dbus_connection_set_dispatch_status_function): new function
- allowing us to fix up main loop usage
- (_dbus_connection_last_unref): free all the various function
- user data
- (dbus_connection_dispatch): call the DispatchStatusFunction
- whenever this function returns
- (dbus_connection_handle_watch): call DispatchStatusFunction
- (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction
- (reply_handler_timeout): call DispatchStatusFunction
- (dbus_connection_flush): call DispatchStatusFunction
-
-2003-04-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
- a memory leak
-
- * bus/dispatch.c (check_service_activated): fix bug in test
-
- * dbus/dbus-mainloop.c (check_timeout): fix this up
-
- * dbus/dbus-internals.c (_dbus_verbose_real): include PID in
- verbose output so we can sort out output from different processes,
- e.g. in the activation case.
-
-2003-04-08 Colin Walters <walters@gnu.org>
-
- * bus/bus.c (struct BusContext) [pidfile]: New member, to store
- the pid file.
- (bus_context_new): Set it.
- (bus_context_unref): Use it to delete the pid file.
-
-2003-04-08 Havoc Pennington <hp@redhat.com>
-
- * test/data/invalid-messages/array-with-mixed-types.message:
- regression test that fails for the moment
-
- * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
- tests for convenience
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
- array of nil, it broke things.
-
- * test/data/invalid-messages/array-of-nil.message: regression test
-
- * test/data/valid-messages/array-of-array-of-uint32.message:
- happened to write this so added it to suite
-
-2003-04-08 Havoc Pennington <hp@redhat.com>
-
- * bus/driver.c (bus_driver_handle_acquire_service): init
- retval/reply before checking name
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
- recursion depth argument
-
- * dbus/dbus-message.h (struct DBusMessageIter): put some padding
- in the public struct for future extension
-
- * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
- typo
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
- message
-
- * doc/dbus-specification.sgml: fix typo
-
-2003-04-08 Alexander Larsson <alexl@redhat.com>
-
- Implemented recursive types, named types and new-style iters
-
- * bus/driver.c:
- * glib/test-thread-client.c: (thread_func):
- * glib/test-thread-server.c: (handle_test_message):
- * test/test-service.c: (handle_echo):
- Update to new api
-
- * dbus/Makefile.am:
- * dbus/dbus-dict.c:
- * dbus/dbus-dict.h:
- * dbus/dbus.h
- Remove DBusDict
-
- * dbus/dbus-internals.c: (_dbus_type_to_string):
- Update for new types.
-
- * dbus/dbus-marshal.[ch]:
- Implement recursive types and the new marshalling format.
- Remove hardcoded dict marshalling.
- Marshal named types.
-
- * dbus/dbus-message-builder.c:
- Add BYTE_ARRAY.
- Remove references to old types
-
- * dbus/dbus-message.[ch]:
- New non-refcounted iter API that supports recursive iters.
- Use iters for appending, including support for recursive
- iters.
- Add byte and named type support.
- Update everything to new marshalling formats.
- Add tests for new API.
-
- * dbus/dbus-protocol.h:
- Remove old array types.
- Add types: BYTE, ARRAY, DICT, NAMED
-
- * dbus/dbus-string.c:
- * dbus/dbus-sysdeps.c:
- Make parse_double locale safe.
-
- * dbus/dbus-test-main.c:
- Call setlocale.
-
- * dbus/dbus-test.c:
- Kill dict test
-
- * doc/dbus-specification.sgml:
- Update spec
-
- * test/data/incomplete-messages/missing-body.message:
- * test/data/invalid-messages/bad-boolean.message:
- * test/data/invalid-messages/bad-boolean-array.message:
- * test/data/invalid-messages/boolean-array-length-too-long.message-raw:
- * test/data/invalid-messages/boolean-has-no-value.message-raw:
- * test/data/invalid-messages/too-short-dict.message:
- * test/data/valid-messages/dict-simple.message:
- * test/data/valid-messages/dict.message:
- * test/data/valid-messages/emptiness.message:
- * test/data/valid-messages/lots-of-arguments.message:
- * test/data/valid-messages/no-padding.message:
- * test/data/valid-messages/recursive-types.message:
- Add missing NAME fields
- Fix up dicts & arrays
-
- * test/data/invalid-messages/dict-with-nil-value.message:
- Removed, this is not invalid anymore.
-
- * test/data/valid-messages/recursive-types.message:
- Add new test for deeply recursive types.
-
-2003-04-07 Havoc Pennington <hp@pobox.com>
-
- * bus/driver.c (bus_driver_handle_acquire_service): return an
- error if you try to acquire a service that starts with ':'
-
-2003-04-07 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.sgml: require that base service names
- start with ':' and that the base service is created/deleted
- as first and last things a connection does on the bus
-
- * bus/dispatch.c (check_existent_service_activation): lots more
- work on the activation test; it doesn't fully pass yet...
-
- * test/test-service.c (main): fix so we don't memleak the
- connection to the message bus
- (filter_func): accept a message asking us to exit
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
- from Colin Walters
-
- * configure.in: fixes to Qt detection from Colin Walters
-
- * doc/Makefile.am: Only remove generated docbook dirs if they
- exist, from Colin Walters
-
- * dbus/dbus-bus.c: change how we set well-known connections to
- NULL, so that it works if a single connection is stored in
- two well-known array slots.
-
- * test/Makefile.am: remove a lot of stuff that isn't immediately
- useful, it's in CVS history if we want it.
-
- * test/test-service.c: use dbus-mainloop instead of that
- watch.[hc] crack
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/Makefile.am: split lists of sources into stuff that goes in
- the library, util functions that go in the lib and are also used
- elsewhere, and util functions that are used in tests/daemon but
- don't go in the lib.
-
- * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
- here so it can be used in test binaries also
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
- here in the parent process, so we can return an error if it
- fails. Also, move some of the code into the child so the parent
- is less hosed if we fail midway through.
-
- * bus/bus.c (bus_context_new): move pidfile detection further up
- in the function, before we start overwriting sockets and such.
-
- * bus/messagebus.in: adjust this a bit, not sure if it will work.
-
- * configure.in: add --with-system-pid-file and --with-system-socket
-
-2003-04-06 Colin Walters <walters@verbum.org>
-
- * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
-
- * bus/system.conf.in: Declare a pidfile.
-
- * bus/bus.c (bus_context_new): Test for an existing pid file, and
- create one (if appropriate).
-
- * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
- (struct BusConfigParser) [pidfile]: New.
- (element_type_to_name, merge_included, start_busconfig_child)
- (bus_config_parser_end_element, bus_config_parser_content): Handle it.
- (bus_config_parser_unref): Free it.
- (bus_config_parser_get_pidfile): New function.
-
- * bus/config-parser.h (_dbus_write_pid_file): Prototype.
-
- * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
-
- * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
-
- * dbus/dbus-sysdeps.h: Prototype it.
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * bus/bus.c (bus_context_new): print the address in here, rather
- than in main(), because we need to do it before forking the daemon
-
- * bus/dispatch.c (send_service_nonexistent_error): set the sender
- on the service nonexistent error
-
- * bus/driver.c (bus_driver_handle_acquire_service): set the
- sender on the AcquireService reply
-
- * test/data/valid-config-files/debug-allow-all.conf.in: Make test
- server also listen on a UNIX socket so services can connect to it.
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
- so it detects deadlocks and also we actually init threads when
- debugging.
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
- save the domain socket name, and unlink it when we disconnect the
- server. Means that at least when we exit normally, we won't leave
- a bunch of junk in /tmp
-
- * dbus/dbus-transport-unix.c
- (_dbus_transport_new_for_domain_socket): code cleanup (nicer
- memory management). (I was making a real change here but then
- didn't)
-
-2003-04-06 Havoc Pennington <hp@pobox.com>
-
- * bus/bus.c (bus_context_new): fix wrong handling of
- server_data_slot_unref() in the error case.
-
- * dbus/dbus-internals.h (_dbus_assert): change so it passes
- "(condition) != 0" to _dbus_real_assert so that
- "_dbus_assert (pointer)" doesn't cause a warning
-
- * bus/main.c (main): accept --print-address option to print out
- the message bus address
-
- * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
-
- * dbus/dbus-transport.c (_dbus_transport_open): special error for
- "tmpdir" option to unix: address on client side
-
- * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
- to unix: address
-
- * configure.in (TEST_SOCKET_DIR): locate a temporary directory
- we can use to create sockets in the test suite.
-
- * bus/main.c (signal_handler): on SIGTERM, exit the daemon
- cleanly. To be used for testing.
-
- * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
-
- * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
-
- * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
- handle trying to call this when there's no servers active
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * NEWS: update
-
- * configure.in: 0.8
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
- crash on startup. Need to get "try starting the daemon"
- in the test suite I guess. ;-)
-
- * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
- tracked the number of open connections; it's better done in
- application-specific code as you want it to span all servers etc.
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * bus/Makefile.am (install-data-hook): add missing DESTDIR,
- patch from Colin Walters
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * doc/config-file.txt (Elements): fix docs of <auth> to reflect
- reality; in fact multiple mechanisms are allowed.
-
- * dbus/dbus-internals.c (_dbus_real_assert)
- (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
- _dbus_assert_not_reached() into functions, so that they don't show
- up in basic block counts for test coverage, and don't use up as
- much disk space. Does mean slower execution speed though, so
- assumes --disable-asserts is the normal production case.
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * test/Makefile.am (dist-hook): also dist *.in files
-
- * NEWS: update
-
- * configure.in: 0.7
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c: docs warning
-
- * dbus/dbus-spawn.c: missing docs
-
- * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * bus/loop.c (bus_loop_iterate): fix the timeout code, using
- magic from GLib
-
- * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
- to -1 once we've reaped the babysitter
- (_dbus_babysitter_handle_watch): do as much work as we can, not
- just one go of it
-
- * bus/activation.c: add code using DBusBabysitter so that we
- handle it when a service fails to start up properly.
- (bus_activation_service_created): don't remove the activation
- entries as we go, just let them get removed when we free the pending
- activation. Unref reply messages after sending them.
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * test/decode-gcov.c (main): print per-directory stats in the report
-
- * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
-
-2003-04-05 Havoc Pennington <hp@pobox.com>
-
- * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
-
- * test/decode-gcov.c: hack up a little program to suck data
- out of gcov files. Yes this is sort of silly.
-
- * configure.in: define something in config.h and do an
- AM_CONDITIONAL when gcov is enabled
-
-2003-04-04 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
- return a "babysitter" object that is used to monitor the status of
- the spawned process and reap it when required.
-
- * test/test-segfault.c, test/test-exit.c,
- test/test-sleep-forever.c: binaries that do various lame things,
- used in the test suite.
-
- * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
-
-2003-04-03 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
- in preparation for modifying it, dbus-sysdeps is getting
- a bit unmanageable.
-
-2003-04-03 Havoc Pennington <hp@redhat.com>
-
- * bus/loop.h, bus/loop.c: make the mainloop an object so we can
- have multiple ones
-
- * bus/*.[hc]: adapt to mainloop change
-
-2003-04-03 Havoc Pennington <hp@redhat.com>
-
- * bus/activation.c (load_directory): fix up memleaks
- (bus_activation_entry_free): free the entry
-
- * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
- we get one from the message bus; fix memleaks.
-
- * dbus/dbus-message.c (dbus_set_error_from_message): new function
-
-2003-04-03 Havoc Pennington <hp@pobox.com>
-
- * bus/config-parser.c (bus_config_parser_unref): free
- list of mechanisms, bug discovered by test suite enhancements
- (putting system.conf and session.conf into suite)
-
- * test/Makefile.am, test/test-service.c: add placeholder for a
- test service that we'll activate as part of test suite. Doesn't
- do anything yet.
-
- * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
- setting NULL value, and use system malloc not dbus_malloc()
- when we have unavoidable memleakage.
-
- * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
- didn't work, and support DBUS_BUS_ACTIVATION.
-
- * bus/activation.c (child_setup): pass our well-known bus type to
- the child
-
- * bus/config-parser.c: support <type> to specify well-known type
-
- * doc/dbus-specification.sgml: document the env variables to
- locate well-known buses and find service activator
-
-2003-04-02 Havoc Pennington <hp@redhat.com>
-
- * test/Makefile.am (all-local): add a rule to copy tests to
- builddir, so we can have generated tests. Use this to remove the
- silly hack for testing system.conf and session.conf. Will use this
- shortly to generate .service files pointing to test binaries.
-
-2003-04-02 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
- current alloc and needed new length, not max of the doubled
- allocation and needed new length. Also, when building tests,
- don't do the double-allocation stuff, just realloc every time.
-
-2003-04-02 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
- in error messages
- (_dbus_string_get_dirname): new
- (_dbus_sysdeps_test): new
- (_dbus_directory_open): include dirnames in error messages
-
- * bus/config-parser.c: interpret <include> and <includedir> and
- <servicedir> relative to config file location if the given
- filename is not absolute.
-
- * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
-
-2003-04-02 Havoc Pennington <hp@redhat.com>
-
- * bus/connection.c (bus_transaction_send_error_reply): set sender
- service for the error, and unref the reply on success
-
- * bus/activation.c: convert to use BusTransaction so OOM can be
- handled correctly
- (bus_activation_service_created): set sender of the message
-
-2003-04-01 Havoc Pennington <hp@redhat.com>
-
- * bus/config-parser.c, bus/bus.c: implement <servicedir> and
- <includedir> (at least mostly)
-
- * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
- first, then the user ID
-
-2003-04-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
- function
-
- * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
-
- * dbus/dbus-internals.c (_dbus_dup_string_array): new function
-
- * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
- socket 0777, and unlink any existing socket.
-
- * bus/bus.c (bus_context_new): change our UID/GID and fork if
- the configuration file so specifies; set up auth mechanism
- restrictions
-
- * bus/config-parser.c (bus_config_parser_content): add support
- for <fork> option and fill in code for <auth>
-
- * bus/system.conf.in: add <fork/> to default configuration,
- and limit auth mechanisms to EXTERNAL
-
- * doc/config-file.txt (Elements): add <fork>
-
- * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
- (_dbus_change_identity): new function
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
- (_dbus_listen_unix_socket): fix off-by-one error in null
- termination spotted by Nalin
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
- DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
- having a real home directory available.
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- * bus/Makefile.am (install-data-hook): create /var/run/dbus
-
- * bus/messagebus.in: add init script for Red Hat /etc/init.d
-
- * configure.in: add support for specifying a style of init script
- to install
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- Fix some annoying DBusString API and fix all affected code.
-
- * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
- max_length argument
- (_dbus_string_get_data): change to return string instead of using
- an out param
- (_dbus_string_get_const_data): ditto
- (_dbus_string_get_data_len): ditto
- (_dbus_string_get_const_data_len): ditto
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- * bus/main.c (main): fix up the command line arguments to be nicer
-
-2003-03-31 Havoc Pennington <hp@redhat.com>
-
- * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
- define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
- final location that lands in the config file
-
- * bus/config-loader-expat.c (bus_config_load): fix type of
- XML_Parser variable
-
- * doc/TODO: remove TODO item for dbus_bus_get()
-
- * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
-
-2003-03-31 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
- (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
- argument since they are always client side
-
- * dbus/dbus-server.c (dbus_server_get_address): new function
-
- * bus/main.c (main): take the configuration file as an argument.
-
- * test/data/valid-config-files/debug-allow-all.conf: new file to
- use with dispatch.c tests for example
-
- * bus/test-main.c (main): require test data dir
-
- * bus/bus.c (bus_context_new): change this to take a
- configuration file name as argument
-
- * doc/config-file.txt (Elements): add <servicedir>
-
- * bus/system.conf, bus/session.conf: new files
-
- * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
- well-known socket if none set
-
- * configure.in: create system.conf and session.conf
-
-2003-03-30 Havoc Pennington <hp@pobox.com>
-
- * bus/config-parser.c: hacking
-
- * dbus/dbus-memory.c: don't use DBusList for the list of stuff
- to shut down, since it could cause weirdness with the DBusList
- lock
-
- * dbus/dbus-list.c (_dbus_list_test): add tests for the
- link-oriented stack routines
- (alloc_link): free the mempool if the first alloc from it fails
-
- * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
-
- * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
- from GLib
- (_dbus_string_skip_white): new
-
- * doc/config-file.txt (Elements): add <includedir>
-
-2003-03-28 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_copy_data_len)
- (_dbus_string_copy_data): new functions
-
-2003-03-28 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
- * dbus/dbus-bus.h:
- Add dbus_bus_get.
-
- * dbus/dbus-memory.c:
- Fix a doc comment.
-
-2003-03-28 Havoc Pennington <hp@pobox.com>
-
- * bus/test.c (bus_test_flush_bus): remove the sleep from here,
- I think it may have just been superstition. Not sure.
-
- * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
- failures that were not being handled.
-
- * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
-
- * dbus/dbus-memory.c: add ability to set number of mallocs in a
- row that will fail on out-of-memory.
-
- * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
- function for testing out-of-memory handling.
-
- * bus/config-loader-expat.c (memsuite): don't wrap the dbus
- allocation functions, they do map exactly to the expat ones.
-
-2003-03-27 Havoc Pennington <hp@redhat.com>
-
- * bus/config-loader-libxml.c (bus_config_load): add another error
- check
-
-2003-03-26 Anders Carlsson <andersca@codefactory.se>
-
- * doc/TODO:
- Add note about automatic service activation.
-
- * doc/dbus-specification.sgml:
- Rename the specification and clarify a few things.
-
-2003-03-26 Anders Carlsson <andersca@codefactory.se>
-
- * Doxyfile.in:
- * dbus/dbus-address.c:
- * dbus/dbus-dict.c:
- * dbus/dbus-marshal.c:
- * dbus/dbus-server-debug-pipe.c:
- * dbus/dbus-transport-unix.c:
- Fix documentation warnings.
-
-2003-03-26 Havoc Pennington <hp@pobox.com>
-
- * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
- after every test so it's quick and easy to see which leaked, and
- so we test multiple dbus_shutdown() calls
-
- * configure.in: change configure.in XML stuff to also support
- expat
-
- * config-loader-libxml.c: some hacking
-
- * config-loader-expat.c: some hacking
-
- * config-parser.c: some hacking, plus tests
-
-2003-03-25 Havoc Pennington <hp@redhat.com>
-
- * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
-
- * configure.in: add --with-xml option to specify XML library,
- right now only libxml is supported.
-
- * bus/config-loader-libxml.c, config-parser.c: sync some minor
- nonworking code between home and work, still just stubs
-
-2003-03-24 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
- file
-
- * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
- NULL argument for "message" if the error is a well-known one,
- fill in a generic message in this case.
-
- * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
- favor of DBusError
-
- * bus/test.c (bus_test_flush_bus): add
-
- * bus/policy.c (bus_policy_test): test code stub
-
-2003-03-24 Havoc Pennington <hp@pobox.com>
-
- * bus/connection.c (bus_connections_setup_connection): set up
- the "can this user connect" function, but it always returns
- TRUE until we have a config file parser so we can have a config
- file that allows connections.
-
-2003-03-23 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
- DBUS_BUILD_TESTS, actually alloc/free a block of memory for
- the mutex, so we can check for proper memory management
- and OOM handling.
-
- * dbus/dbus-dataslot.c: remove the mutex from
- DBusDataSlotAllocator and lock it manually when using it,
- to simplify fitting it into the global slots framework.
-
- * dbus/dbus-threads.c (init_static_locks): rework how we're
- handling global locks so they are easily shut down.
-
- * bus/policy.c (bus_policy_append_rule): fix
-
- * bus/test-main.c (main): check for memleaks
-
- * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
- test suite check for memleaks
-
- * dbus/dbus-memory.c: add support in test mode for tracking
- number of outstanding blocks
-
-2003-03-23 Havoc Pennington <hp@pobox.com>
-
- * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
- policies code
-
- * dbus/dbus-hash.h: add ULONG hash keys
-
- * dbus/dbus-sysdeps.c (_dbus_get_groups): new
- (_dbus_get_group_id): new function
-
-2003-03-20 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
- new function
- (dbus_connection_get_unix_user): new function
-
-2003-03-20 Havoc Pennington <hp@pobox.com>
-
- * bus/connection.c (bus_connection_send_oom_error): assert that
- message has a sender
- (connection_execute_transaction): ditto
- (bus_connection_preallocate_oom_error): fix to set the sender, and
- set recipient to the destination service, not the bus driver
-
- * bus/policy.c: hacking
-
- * dbus/dbus-message.c (dbus_message_service_is): new function
- (dbus_message_sender_is): new
-
-2003-03-19 Havoc Pennington <hp@redhat.com>
-
- * bus/policy.c: start sketching code for policy restrictions on
- what connections can do.
-
-2003-03-18 Havoc Pennington <hp@redhat.com>
-
- * doc/TODO: some notes on high-level todo items. Little nitpick
- stuff is all in @todo, so no need to add it here.
-
- * doc/config-file.txt: some notes on how config file might look
-
-2003-03-18 Anders Carlsson <andersca@codefactory.se>
-
- * configure.in: 0.6
-
- * NEWS: Update.
-
-2003-03-17 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.h: add gcc attributes so that
- our printf-style functions warn on bad arguments to
- format
-
- * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
- format bug
-
- * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
- printf format bug
-
-2003-03-17 Havoc Pennington <hp@redhat.com>
-
- * bus/test-main.c (main): make it print something as it runs
- so make check doesn't look stuck
-
- * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
- from CVS, now obsolete
-
-2003-03-17 Anders Carlsson <andersca@codefactory.se>
-
- * bus/dispatch.c: (bus_dispatch):
- Refetch the service name since it may have been reallocated
- when dbus_message_set_sender was called.
-
- * dbus/dbus-sysdeps.c: (_dbus_accept):
- Add address and address length variables and use them to stop
- valgrind from complaining.
-
-2003-03-17 Havoc Pennington <hp@pobox.com>
-
- All tests pass, no memleaks, no valgrind complaints.
-
- * bus/test.c: refcount handler_slot
-
- * bus/connection.c (bus_connections_new): refcount
- connection_data_slot
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
- bytes so that auth scripts pass.
-
- * bus/dispatch.c: init message_handler_slot so it gets allocated
- properly
-
- * bus/dispatch.c (message_handler_slot_ref): fix memleak
-
- * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
- dealloc server_pipe_hash when no longer used for benefit of
- leak checking
-
- * dbus/dbus-auth.c (process_command): memleak fix
-
- * bus/dispatch.c (check_hello_message): memleak fix
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
-
-2003-03-17 Anders Carlsson <andersca@codefactory.se>
-
- * bus/activation.c (bus_activation_activate_service): Append
- the pending activation entry to the list of pending activations.
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
- connections
-
- * dbus/dbus-address.c (create_entry): fix OOM handling when
- failing to alloc entry->method
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
- the watch
-
- * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
- add some missing dbus_set_result
-
- * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
- alloc the DBusMessageHandler
-
- * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
- the transport here, since we call this from the finalizer; it
- resulted in a double-finalize.
-
- * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
- where we tried to use transport->connection that was NULL,
- happened when transport was disconnected early on due to OOM
-
- * bus/*.c: adapt to handle OOM for watches/timeouts
-
- * dbus/dbus-transport-unix.c: port to handle OOM during
- watch handling
-
- * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
- reference to unused bytes instead of a copy
-
- * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
- out of memory
-
- * dbus/dbus-connection.c (dbus_connection_handle_watch): return
- FALSE on OOM
-
- * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
- of memory
-
-2003-03-16 Anders Carlsson <andersca@codefactory.se>
-
- * doc/dbus-specification.sgml:
- Document reply message for ActivateService.
-
-2003-03-16 Anders Carlsson <andersca@codefactory.se>
-
- * bus/activation.c: (bus_pending_activation_entry_free),
- (bus_pending_activation_free), (bus_activation_new),
- (bus_activation_unref), (bus_activation_service_created),
- (bus_activation_activate_service):
- * bus/activation.h:
- * bus/bus.c: (bus_context_new):
- * bus/desktop-file.c: (new_section):
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_handle_activate_service):
- * bus/services.c: (bus_registry_new), (bus_registry_ensure):
- * bus/services.h:
- * dbus/dbus-connection.c:
- (dbus_connection_send_with_reply_and_block):
- * dbus/dbus-message.c: (dbus_message_append_args_valist):
- * dbus/dbus-protocol.h:
- Make activation work better. Now pending activations will be queued
- and the daemon won't try to activate services that are already registered.
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
- connection data
-
- * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
- DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
- this. always run the test suite before commit...
-
- * bus/*: adapt to DBusConnection API changes
-
- * glib/dbus-gmain.c: adapt to DBusConnection API changes,
- requires renaming stuff to avoid dbus_connection_dispatch name
- conflict.
-
- * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
- function
-
- * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
- separate from _dbus_message_loader_return_buffer()
-
- * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
- this, because it's now always broken to use; the number of
- messages in queue vs. the number still buffered by the message
- loader is undefined/meaningless. Should use
- dbus_connection_get_dispatch_state().
- (dbus_connection_dispatch): rename from
- dbus_connection_dispatch_message
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
- implementation
-
-2003-03-16 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection.c:
- (dbus_connection_send_with_reply_and_block):
- Decrease connection->n_incoming when removing an entry
- from the list.
- * dbus/dbus-dict.c: (dbus_dict_entry_free),
- (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
- (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
- (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
- (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
- (dbus_dict_get_byte_array):
- Handle NULL arrays and strings. Also add support for byte arrays.
-
- * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
- (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
- (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
- (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
- (_dbus_demarshal_dict), (demarshal_and_validate_len),
- (_dbus_marshal_validate_arg), (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- Add support for marshalling and demarshalling empty arrays and strings.
-
- * dbus/dbus-message.c: (dbus_message_append_args_valist),
- (dbus_message_append_string_array),
- (dbus_message_iter_get_boolean),
- (dbus_message_iter_get_boolean_array),
- (dbus_message_iter_get_int32_array),
- (dbus_message_iter_get_uint32_array),
- (dbus_message_iter_get_double_array),
- (dbus_message_iter_get_byte_array),
- (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
- (check_message_handling):
- Add support for getting empty arrays and dicts.
-
- * dbus/dbus-string.c: (_dbus_string_validate_utf8):
- Don't do any validation at all for now, that's better than just checking
- for ASCII.
-
- * test/data/valid-messages/emptiness.message:
- New test message with lots of empty arrays.
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c
- (_dbus_connection_queue_received_message_link): new function that
- can't fail due to OOM
-
- * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
- new function pops a message together with a list link
- containing it.
-
- * dbus/dbus-transport-unix.c (queue_messages): use new link-based
- message queuing functions to avoid needing to alloc memory
-
-2003-03-16 Havoc Pennington <hp@pobox.com>
-
- Oops - test code was only testing failure of around 30 of the
- mallocs in the test path, but it turns out there are 500+
- mallocs. I believe this was due to misguided linking setup such
- that there was one copy of dbus_malloc etc. in the daemon and one
- in the shared lib, and only daemon mallocs were tested. In any
- case, the test case now tests all 500+ mallocs, and doesn't pass
- yet, though there are lots of fixes in this patch.
-
- * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
- this so that it doesn't need to allocate memory, since it
- has no way of indicating failure due to OOM (and would be
- annoying if it did).
-
- * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
-
- * bus/Makefile.am: rearrange to create two self-contained
- libraries, to avoid having libraries with overlapping symbols.
- that was resulting in weirdness, e.g. I'm pretty sure there
- were two copies of global static variables.
-
- * dbus/dbus-internals.c: move the malloc debug stuff to
- dbus-memory.c
-
- * dbus/dbus-list.c (free_link): free list mempool if it becomes
- empty.
-
- * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
-
- * dbus/dbus-address.c (dbus_parse_address): free list nodes
- on failure.
-
- * bus/dispatch.c (bus_dispatch_add_connection): free
- message_handler_slot when no longer using it, so
- memory leak checkers are happy for the test suite.
-
- * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
-
- * bus/bus.c (new_connection_callback): disconnect in here if
- bus_connections_setup_connection fails.
-
- * bus/connection.c (bus_connections_unref): fix to free the
- connections
- (bus_connections_setup_connection): if this fails, don't
- disconnect the connection, just be sure there are no side
- effects.
-
- * dbus/dbus-string.c (undo_alignment): unbreak this
-
- * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
- leaking
- (_dbus_auth_new): fix the order in which we free strings
- on OOM failure
-
- * bus/connection.c (bus_connection_disconnected): fix to
- not send ServiceDeleted multiple times in case of memory
- allocation failure
-
- * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
- get the base service name
- (dbus_bus_register_client): don't return base service name,
- instead store it on the DBusConnection and have an accessor
- function for it.
- (dbus_bus_register_client): rename dbus_bus_register()
-
- * bus/dispatch.c (check_hello_message): verify that other
- connections on the bus also got the correct results, not
- just the one sending hello
-
-2003-03-15 Havoc Pennington <hp@pobox.com>
-
- Make it pass the Hello handling test including all OOM codepaths.
- Now to do other messages...
-
- * bus/services.c (bus_service_remove_owner): fix crash when
- removing owner from an empty list of owners
- (bus_registry_ensure): don't leave service in the list of
- a connection's owned services if we fail to put the service
- in the hash table.
-
- * bus/connection.c (bus_connection_preallocate_oom_error): set
- error flag on the OOM error.
-
- * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
- handle _dbus_transport_set_connection failure
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
- to create watches up front and simply enable/disable them as
- needed.
- (unix_connection_set): this can now fail on OOM
-
- * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
- of enabling/disabling a watch or timeout.
-
- * bus/loop.c (bus_loop_iterate): don't touch disabled
- watches/timeouts
-
- * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
-
-2003-03-15 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
- write useful test code, after all that futzing around ;-)
-
- Test does not yet pass because we can't handle OOM in
- _dbus_transport_messages_pending (basically,
- dbus_connection_preallocate_send() does not prealloc the write
- watch). To fix this, I think we need to add new stuff to
- set_watch_functions, namely a SetEnabled function so we can alloc
- the watch earlier, then enable it later.
-
- * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
- dbus-memory.c to the convenience lib
-
- * bus/test.c: rename some static functions to keep them clearly
- distinct from stuff in connection.c. Handle client disconnection.
-
-2003-03-14 Havoc Pennington <hp@pobox.com>
-
- * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
- transport, tests more of the real codepath. Set up clients
- with bus_setup_debug_client.
-
- * bus/test.c (bus_setup_debug_client): function to set up debug
- "clients" on the main loop
-
- * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
- support
-
- * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
- server type
-
- * dbus/dbus-server-debug.c: support a debug server based on pipes
-
- * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
- (_dbus_close): new function
-
- * configure.in: check for socketpair
-
-2003-03-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
- cheesy hack
-
- * dbus/dbus-transport-debug.c: rework this a good bit to be
- less complicated. hopefully still works.
-
- * dbus/dbus-server-debug.c (handle_new_client): remove timeout
- manually
-
- * glib/dbus-gmain.c (timeout_handler): don't remove timeout
- after running it
-
- * dbus/dbus-message.c (dbus_message_copy): rename from
- dbus_message_new_from_message, fix it up to copy
- all the message fields, add test case
-
- * bus/dispatch.c (bus_dispatch_test): add some more test code,
- not quite passing yet
-
-2003-03-14 Havoc Pennington <hp@pobox.com>
-
- * bus/loop.c (bus_loop_iterate): add this so we can "run loop
- until no work remains" in test code. (the large diff here
- is just code movement, no actual changes)
-
- * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
- 1, no point waiting around for test code.
- (_dbus_server_debug_accept_transport): unref the timeout
- after adding it (right?)
-
- * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
-
-2003-03-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
- out of memory
-
- * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
- of memory
-
- * dbus/dbus-connection.h: Make AddWatchFunction and
- AddTimeoutFunction return a bool so they can fail on out-of-memory
-
- * bus/bus.c (bus_context_new): set up timeout handlers
-
- * bus/connection.c (bus_connections_setup_connection): set up
- timeout handlers
-
- * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
- can fail
-
- * bus/bus.c (bus_context_new): adapt to changes
-
- * bus/connection.c: adapt to changes
-
- * test/watch.c: adapt to DBusWatch changes
-
- * bus/dispatch.c (bus_dispatch_test): started adding this but
- didn't finish
-
-2003-03-14 Anders Carlsson <andersca@codefactory.se>
-
- * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
-
-2003-03-13 Havoc Pennington <hp@pobox.com>
-
- * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
- set up a test framework as for the library
-
-2003-03-12 Havoc Pennington <hp@pobox.com>
-
- Throughout: purge global variables, introduce BusActivation,
- BusConnections, BusRegistry, etc. objects instead.
-
- * bus/bus.h, bus/bus.c: introduce BusContext as a global
- message bus object
-
- * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
- going to redo this a bit differently I think
-
-2003-03-12 Havoc Pennington <hp@redhat.com>
-
- Mega-patch that gets the message bus daemon initially handling
- out-of-memory. Work still needed. Also lots of random
- moving stuff to DBusError instead of ResultCode.
-
- * dbus/dbus-list.c (_dbus_list_length_is_one): new function
-
- * dbus/dbus-connection.c
- (dbus_connection_send_with_reply_and_block): use DBusError
-
- * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
- DBusResultCode
-
- * dbus/dbus-connection.c (dbus_connection_send): drop the result
- code here, as the only failure possible is OOM.
-
- * bus/connection.c (bus_connection_disconnect):
- rename bus_connection_disconnected as it's a notification only
-
- * bus/driver.c (bus_driver_handle_acquire_service): don't free
- "name" on get_args failure, should be done by get_args;
- don't disconnect client for bad args, just return an error.
- (bus_driver_handle_service_exists): ditto
-
- * bus/services.c (bus_services_list): NULL-terminate returned array
-
- * bus/driver.c (bus_driver_send_service_lost)
- (bus_driver_send_service_acquired): send messages from driver to a
- specific client to the client's unique name, not to the broadcast
- service.
-
- * dbus/dbus-message.c (decode_header_data): reject messages that
- contain no name field
- (_dbus_message_get_client_serial): rename to
- dbus_message_get_serial and make public
- (_dbus_message_set_serial): rename from set_client_serial
- (_dbus_message_set_reply_serial): make public
- (_dbus_message_get_reply_serial): make public
-
- * bus/connection.c (bus_connection_foreach): allow stopping
- iteration by returning FALSE from foreach function.
-
- * dbus/dbus-connection.c (dbus_connection_send_preallocated)
- (dbus_connection_free_preallocated_send)
- (dbus_connection_preallocate_send): new API for sending a message
- without possibility of malloc failure.
- (dbus_connection_send_message): rename to just
- dbus_connection_send (and same for whole function family)
-
- * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
-
- * dbus/dbus-sysdeps.c (_dbus_exit): new function
-
- * bus/activation.c: handle/return errors
-
- * dbus/dbus-errors.h: add more DBUS_ERROR #define
-
- * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
- (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
- (_dbus_result_from_errno): move to this file
-
-2003-03-10 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c:
- (_dbus_marshal_set_string):
- Take a length argument so we can marshal the correct string
- length.
-
- (_dbus_marshal_dict), (_dbus_demarshal_dict),
- (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
- (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- Add support for marshalling and demarshalling dicts.
-
- * dbus/dbus-message-builder.c: (_dbus_message_data_load):
- Add support for TYPE DICT.
-
- * dbus/dbus-message.c: (set_string_field):
- Adjust header padding.
-
- (dbus_message_append_args_valist), (dbus_message_append_dict),
- (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
- (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
- (check_message_handling), (check_have_valid_message):
- * dbus/dbus-message.h:
- Add functions for setting and getting dicts.
-
- * dbus/dbus-protocol.h:
- Add DBUS_TYPE_DICT.
-
- * dbus/dbus.h:
- Add dbus-dict.h
-
- * doc/dbus-specification.sgml:
- Add information about how dicts are marshalled.
-
- * test/data/invalid-messages/dict-with-nil-value.message:
- * test/data/invalid-messages/too-short-dict.message:
- * test/data/valid-messages/dict-simple.message:
- * test/data/valid-messages/dict.message:
- Add sample messages containing dicts.
-
-2003-03-08 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-dict.h: Add DBUS_END_DECLS.
-
-2003-03-07 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am:
- * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
- (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
- (dbus_dict_set_int32), (dbus_dict_set_uint32),
- (dbus_dict_set_double), (dbus_dict_set_string),
- (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
- (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
- (dbus_dict_set_string_array), (_dbus_dict_test):
- * dbus/dbus-dict.h:
- Fix according to comments from Havoc.
-
-2003-03-06 Michael Meeks <michael@server.home>
-
- * configure.in: if we don't have kde-config, disable have_qt.
-
-2003-03-07 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am:
- Add dbus-dict.[ch]
-
- * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
- (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
- (dbus_dict_remove), (dbus_dict_get_value_type),
- (dbus_dict_get_keys), (dbus_dict_put_boolean),
- (dbus_dict_put_int32), (dbus_dict_put_uint32),
- (dbus_dict_put_double), (dbus_dict_put_string),
- (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
- (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
- (dbus_dict_put_string_array), (dbus_dict_get_boolean),
- (dbus_dict_get_int32), (dbus_dict_get_uint32),
- (dbus_dict_get_double), (dbus_dict_get_string),
- (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
- (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
- (dbus_dict_get_string_array), (_dbus_dict_test):
- * dbus/dbus-dict.h:
- Add DBusDict implementation
-
- * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
- * dbus/dbus-test.h:
- Add _dbus_dict_test
-
-2003-03-04 Havoc Pennington <hp@pobox.com>
-
- * test/data/auth/*: adapt to changes
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
- USERID_BASE64 and change USERNAME_BASE64 to put in username not
- userid
-
- * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
- more stuff from being in a context name, to make the protocol
- simpler to deal with
-
- * dbus/dbus-errors.c (dbus_error_has_name): new function
- (dbus_error_is_set): new function
-
- * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
- with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
-
- * dbus/dbus-connection.c (dbus_connection_flush): also read
- messages during a flush operation
-
- * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
-
-2003-03-05 Anders Carlsson <andersca@codefactory.se>
-
- * configure.in: Check for gethostbyname on Solaris.
-
- * dbus/dbus-transport.c: (_dbus_transport_open):
- Remove duplicate "tcp" entry.
-
- * doc/dbus-specification.sgml:
- Clarify some things.
-
-2003-03-05 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
- * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
- (_dbus_keyring_test):
- * dbus/dbus-md5.c: (_dbus_md5_compute):
- * dbus/dbus-sha.c: (_dbus_sha_compute):
- Plug memory leaks.
-
-2003-03-05 Anders Carlsson <andersca@codefactory.se>
-
- * README: Add some things.
-
-2003-03-04 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
- after case DBUS_TYPE_BOOELAN.
-
-2003-03-02 Havoc Pennington <hp@pobox.com>
-
- * test/break-loader.c (randomly_set_extreme_ints): add test that
- sets really huge and small integers
-
- * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
- that length of boolean array fits in the string, and that
- string has room for boolean value in single-bool case.
-
- * dbus/dbus-message-builder.c (_dbus_message_data_load): add
- optional value to "ALIGN" command which is what to fill the
- alignment with.
-
- * test/data/valid-messages/no-padding.message: add regression
- test for the message padding problem
-
-2003-03-02 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (decode_header_data): fix to always init
- message_padding, from Benjamin Dauvergne
-
-2003-03-02 Havoc Pennington <hp@pobox.com>
-
- * configure.in: 0.5
-
- * NEWS: Update.
-
-2003-03-01 Joe Shaw <joe@assbarn.com>
-
- * configure.in: Check for "struct cmsgcred" and try to access its
- members for BSD-like unices.
-
- * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
- _dbus_read_credentials_unix_socket().
- (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
- read() for reading the credential byte off the unix socket. Use
- struct cmsgcred on systems that support it.
-
-2003-02-27 Alexander Larsson <alexl@redhat.com>
-
- * glib/Makefile.am:
- * configure.in:
- Make gthreads-2.0 dependency optional. Don't build thread test if
- its not found.
-
-2003-02-27 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c
- (dbus_connection_send_message_with_reply_and_block): fix doh!
- doh! doh! bug that resulted in never removing a reply from the
- queue, no wonder we called get_reply_serial so much ;-)
-
- * dbus/dbus-message.c (struct DBusMessage): cache reply serial
- and client serial instead of demarshaling them every time
-
-2003-02-27 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
- more inlined, using dbus-string-private.h, speeds things up
- substantially
-
- * dbus/dbus-string.c (_dbus_string_free): apply align offset
- when freeing the string
- (_dbus_string_steal_data): fix for align offset
- (undo_alignment): new function
-
-2003-02-26 Havoc Pennington <hp@redhat.com>
-
- All kinds of audit fixes from Owen, plus initial attempt to
- handle unaligned memory returned from malloc.
-
- * dbus/dbus-string.c (_dbus_string_init): clamp max length to
- leave room for align_offset and nul byte
- (fixup_alignment): function to track an align_offset and
- ensure real->str is aligned
- (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
- to allow a nul byte plus align offset
- (_dbus_string_lock): fix overflow issue
- (_dbus_string_init_const_len): add assertions on sanity of len,
- assign allocated to be ALLOCATION_PADDING larger than len
- (set_length): fixup the overflow handling
- (_dbus_string_get_data_len): fix overflow in assertion
- (open_gap): detect overflow in size of gap to be opened
- (_dbus_string_lengthen): add overflow check
- (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
- (_dbus_string_append): add overflow check
- (_dbus_string_append_unichar): overflow
- (_dbus_string_delete): fix overflow in assertion
- (_dbus_string_copy_len): overflow in assertion
- (_dbus_string_replace_len): overflows in assertions
- (_dbus_string_find): change to implement in terms of
- _dbus_string_find_to
- (_dbus_string_find_to): assorted fixage
- (_dbus_string_equal_c_str): assert c_str != NULL,
- fix logic so the function works
- (_dbus_string_ends_with_c_str): fix overflow thingy
- (_dbus_string_base64_encode): overflow fix
- (_dbus_string_validate_ascii): overflow
- (_dbus_string_validate_nul): overflow
-
-2003-02-26 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
-
-2003-02-26 Alexander Larsson <alexl@redhat.com>
-
- * configure.in:
- Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
-
- * dbus/dbus-connection.c:
- * dbus/dbus-connection.h:
- Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
- Add dbus_connection_set_wakeup_main_function and use it when queueing
- incoming and outgoing messages.
-
-
- * dbus/dbus-dataslot.c:
- Threadsafe usage of DBusDataSlotAllocator
-
- * dbus/dbus-message.c: (dbus_message_get_args_iter):
- dbus_new can fail.
-
- * dbus/dbus-server-unix.c:
- Add todo comment
-
- * glib/dbus-gmain.c:
- Implement the new wakeup functions for glib.
-
- * glib/Makefile.am:
- * glib/test-thread-client.c:
- * glib/test-thread-server.c:
- * glib/test-thread.h:
- Initial cut at some thread test code. Not really done yet.
-
-2003-02-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c
- (dbus_connection_send_message_with_reply_and_block): fix crash
- where we ref'd the outgoing message instead of the returned reply
-
- * dbus/dbus-transport-unix.c (do_authentication): check read watch
- at the end of this function, so if we didn't need to read for
- authentication, we reinstall it for receiving messages
-
- * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
- a NULL sender for peer-to-peer case
-
- * dbus/dbus-transport-unix.c (check_read_watch): handle
- !authenticated case correctly
-
- * glib/dbus-gmain.c: add support for DBusServer
-
- * dbus/dbus-server.c: add data slot support
-
- * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
- return values and handle errors
-
- * dbus/dbus-dataslot.c: factor out the data slot stuff from
- DBusConnection
-
- * Doxyfile.in (INPUT): add glib subdir
-
- * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
- setup_with_g_main instead of hookup_with_g_main; write docs
-
-2003-02-24 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
- * dbus/dbus-message-builder.c: (_dbus_message_data_load):
- * dbus/dbus-message.c: (dbus_message_append_boolean),
- (dbus_message_append_boolean_array),
- (dbus_message_get_args_valist), (_dbus_message_test):
- * dbus/dbus-message.h:
- * doc/dbus-specification.sgml:
- Various fixes as pointed out by Havoc.
-
- * test/data/invalid-messages/bad-boolean-array.message:
- * test/data/invalid-messages/bad-boolean.message:
- Add invalid boolean value test cases.
-
-2003-02-24 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-internals.c: (_dbus_type_to_string):
- * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
- (_dbus_marshal_validate_arg):
- * dbus/dbus-message-builder.c: (_dbus_message_data_load):
- * dbus/dbus-message.c: (dbus_message_append_args_valist),
- (dbus_message_append_boolean), (dbus_message_append_boolean_array),
- (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
- (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
- (dbus_message_iter_get_double),
- (dbus_message_iter_get_boolean_array), (message_iter_test):
- * dbus/dbus-message.h:
- * dbus/dbus-protocol.h:
- * doc/dbus-specification.sgml:
- * test/data/valid-messages/lots-of-arguments.message:
- Add support for boolean and boolean array types.
-
-2003-02-23 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-keyring.c: finish most of this implementation and
- simple unit test
-
- * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
- these barf if the error isn't cleared to NULL
-
- * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
- (_dbus_create_directory): new function
-
- * dbus/dbus-errors.c (dbus_set_error): fix warning
-
- * dbus/dbus-string.c (_dbus_string_hex_encode): new function
- (_dbus_string_hex_decode): new function
- (test_hex_roundtrip): test code
-
- * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
-
- * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
-
- * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
- the save-to-temp/rename trick to atomically write the new file
- (_dbus_string_parse_uint): new function
-
-2003-02-22 Havoc Pennington <hp@pobox.com>
-
- * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
-
-2003-02-22 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_iter_get_string_array):
- (dbus_message_iter_get_byte_array): Fix up doxygen warnings
-
- * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
-
- * dbus/test/data/sha-1: add US government test suite for SHA-1
-
-2003-02-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
- Make string arrays NULL-terminated.
-
- * dbus/dbus-memory.c: (dbus_free_string_array):
- * dbus/dbus-memory.h:
- New function for freeing NULL-terminated string arrays.
-
- * dbus/dbus-message-builder.c: (append_quoted_string),
- (_dbus_message_data_load):
- Add support for array types.
-
- * dbus/dbus-message.c: (check_message_handling):
- Add more types as test cases.
-
- * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
- (_dbus_string_parse_double):
- Add the start offset to the end offset.
-
- * test/data/valid-messages/lots-of-arguments.message:
- New test message with lots of arguments.
-
-2003-02-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c: (dbus_message_append_nil),
- (dbus_message_append_int32), (dbus_message_append_uint32),
- (dbus_message_append_double), (dbus_message_append_string),
- (dbus_message_append_int32_array),
- (dbus_message_append_uint32_array),
- (dbus_message_append_double_array),
- (dbus_message_append_byte_array),
- (dbus_message_append_string_array):
- Fix all out-of-memory handling in these functions.
-
-2003-02-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c: (dbus_message_append_nil):
- Fix a silly.
-
-2003-02-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c: (dbus_message_append_args_valist),
- (dbus_message_append_nil), (dbus_message_append_int32_array),
- (dbus_message_append_uint32_array),
- (dbus_message_append_double_array),
- (dbus_message_append_byte_array),
- (dbus_message_append_string_array), (dbus_message_get_args_valist),
- (dbus_message_iter_get_int32_array),
- (dbus_message_iter_get_uint32_array),
- (dbus_message_iter_get_double_array),
- (dbus_message_iter_get_byte_array),
- (dbus_message_iter_get_string_array):
-
- * dbus/dbus-message.h:
- Add functions for appending and getting arrays.
-
-2003-02-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
- element size at least 8 bytes, fixes mempool tests on
- 64-bit machines.
-
-2003-02-20 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration):
- Unlock the connection mutex during a blocking select call.
- Add todo about how we need a way to wake up the select.
-
- * dbus/dbus-connection-internal.h:
- * dbus/dbus-connection.c:
- Add _dbus_connection_lock and _dbus_connection_unlock.
-
-2003-02-19 Havoc Pennington <hp@pobox.com>
-
- * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
- Doxyfile.in, not Doxyfile
-
- * dbus/dbus-keyring.c: do some hacking on this
-
- * dbus/dbus-sysdeps.c (_dbus_delete_file): new
-
- * dbus/dbus-errors.c (dbus_set_error_const): do not call
- dbus_error_init
- (dbus_set_error): remove dbus_error_init, check for message ==
- NULL *before* we sprintf into it, and add @todo about including
- system headers in this file
-
- * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
-
- * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
-
- * dbus/dbus-sysdeps.c (get_user_info): break this function out to
- get various bits of user information based on either username
- or user ID
- (_dbus_homedir_from_username): new function
-
-2003-02-19 Anders Carlsson <andersca@codefactory.se>
-
- * configure.in:
- Add check for nonposix getpwnam_r
-
- * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
- Align the pool element size to a sizeof (void *) boundary.
-
- * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
- (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
- General Solaris fixes.
-
- * test/data/valid-messages/simplest-manual.message:
- Explicitly state that we want little-endian packing.
-
-2003-02-19 Mikael Hallendal <micke@codefactory.se>
-
- * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
- Added to create a transport connecting using a tcp/ip socket.
-
- * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
- to a tcp socket at given host and port.
- (_dbus_listen_tcp_socket): added to listen on tcp socket for given
- hostname and port.
-
- * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
-
- * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
- Added to create a server listening on a TCP/IP socket.
-
-2003-02-19 Havoc Pennington <hp@pobox.com>
-
- Throughout: mop up all the Doxygen warnings and undocumented
- stuff.
-
- * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
- to search any paths.
-
- * dbus/dbus-threads.c: move global mutex initializers to
- dbus-internals.h, multiple prototypes was confusing doxygen
- besides being kind of ugly
-
- * Doxyfile (PREDEFINED): have Doxygen define
- DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
- docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
- (do not abuse the feature! it's for stuff like the autogenerated
- macros in dbus-md5.c, not just for things you don't feel like
- documenting...)
-
-2003-02-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_zero): new function
-
- * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
- wrap it in some dbus-friendly API
-
- * dbus/dbus-types.h: add 16-bit types
-
-2003-02-18 Joe Shaw <joe@assbarn.com>
-
- * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
- credentials from our currently running process.
- (get_word): Fix a buglet where we were copying the entire length
- instead of relative to our position.
-
- * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
- keys on the stack... it's 640k of data.
-
- * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
- read the credentials byte off the socket, even if we don't have
- SO_PEERCRED.
- (_dbus_poll): Implement poll() using select() for systems which
- don't have it.
-
- * glib/test-dbus-glib.c (main): Print out an error if no
- parameters are given.
-
- * test/data/auth/fallback.auth-script: Added. Tests that a client
- can fallback to a secondary auth mechanism if the first fails.
-
-2003-02-18 Havoc Pennington <hp@pobox.com>
-
- * AUTHORS: add Alex
-
-2003-02-17 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: lots of cosmetic
- cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
- env variable to DBUS_BUS_ADDRESS, s/client/application/,
- s/server/bus/ (except in authentication section). Add a section
- "Message Bus Message Routing"
-
-2003-02-17 Anders Carlsson <andersca@codefactory.se.>
-
- Release 0.4
-
- * NEWS: Update
-
-2003-02-17 Anders Carlsson <andersca@codefactory.se>
-
- * doc/dbus-specification.sgml:
- Specification updates.
-
-2003-02-17 Anders Carlsson <andersca@codefactory.se>
-
- * bus/activation.c: (bus_activation_init), (child_setup),
- (bus_activation_activate_service):
- * bus/activation.h:
- * bus/main.c: (main):
- Set DBUS_ADDRESS environment variable.
-
- * dbus/dbus-errors.c: (dbus_set_error):
- Don't use va_copy since that's a C99 feature.
-
- * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
- (_dbus_spawn_async):
- * dbus/dbus-sysdeps.h:
- Add child_setup_func to _dbus_spawn_async.
-
- * doc/dbus-specification.sgml:
- Update specification.
-
- * test/spawn-test.c: (setup_func), (main):
- Fix test.
-
-2003-02-17 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
- Added todo.
-
-2003-02-17 Anders Carlsson <andersca@codefactory.se>
-
- * doc/.cvsignore:
- * doc/Makefile.am:
- * doc/dbus-test-plan.sgml:
- Add test plan document.
-
- * test/Makefile.am:
- Fix distcheck.
-
-2003-02-17 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message.c: (decode_header_data),
- (_dbus_message_loader_return_buffer):
- Set the header padding amount when loading a message.
-
-2003-02-16 Anders Carlsson <andersca@codefactory.se>
-
- * bus/dispatch.c: (send_one_message):
- Only send broadcast messages to registered connections.
-
- * dbus/dbus-message.c: (dbus_message_name_is):
- * dbus/dbus-message.h:
- New convenience function.
-
- * dbus/dbus-transport-debug.c: (do_reading):
- Only dispatch one message per run.
-
- * test/Makefile.am:
- * test/bus-test.c: (new_connection_callback), (die),
- (test_hello_client1_handler), (test_hello_client2_handler),
- (test_hello_replies), (main):
-
- * test/bus-test-loop.[ch]:
- Add these.
-
-2003-02-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
- backward conditional
-
-2003-02-16 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-connection.c:
- Implement sent_message_with_reply. (with_reply_and block is still
- busted).
- Made dispatch_message not lose message if OOM.
-
- * dbus/dbus-errors.h:
- Add NoReply error (for reply timeouts).
-
-2003-02-16 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-hash.c (_dbus_hash_table_unref):
- Actually free keys and values when destroying hashtable.
-
-2003-02-16 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-auth.c: (client_try_next_mechanism):
- Plug a leak.
-
- * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
- Return TRUE if there's no thread implementation around.
-
- * glib/dbus-gmain.c: (free_source),
- (dbus_connection_hookup_with_g_main):
- Make sure to remove the GSource when the connection is finalized.
-
-2003-02-16 Anders Carlsson <andersca@codefactory.se>
-
- * bus/dispatch.c: (bus_dispatch_message_handler):
- * dbus/dbus-errors.h:
- Return an error if someone tries to send a message to a service
- that doesn't exist.
-
-2003-02-16 Anders Carlsson <andersca@codefactory.se>
-
- * bus/activation.c: (load_directory), (bus_activation_init),
- (bus_activation_activate_service):
- * bus/activation.h:
- * bus/driver.c:
- (bus_driver_handle_activate_service), (bus_driver_handle_message):
- More work on the activation handling.
-
- * dbus/dbus-errors.h:
- Add some error messages
-
- * dbus/dbus-message.c: (dbus_message_new_error_reply):
- * dbus/dbus-message.h:
- New function that creates an error message.
-
- * dbus/dbus-protocol.h:
- Add ACTIVATE_SERVER message.
-
- * dbus/dbus-server-unix.c: (unix_handle_watch),
- (_dbus_server_new_for_domain_socket):
- Call _dbus_fd_set_close_on_exec.
-
- * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
- (_dbus_spawn_async), (_dbus_disable_sigpipe),
- (_dbus_fd_set_close_on_exec):
- * dbus/dbus-sysdeps.h:
- Add _dbus_fd_set_close_on exec function. Also add function that checks
- that all open fds are set to close-on-exec and warns otherwise.
-
- * dbus/dbus-transport-unix.c:
- (_dbus_transport_new_for_domain_socket):
- Call _dbus_fd_set_close_on_exec.
-
-2003-02-16 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
- allow people to avoid setting SIGPIPE to SIG_IGN
- (_dbus_connection_new_for_transport): disable SIGPIPE unless
- we've been asked not to
-
-2003-02-15 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-list.c: (_dbus_list_append_link),
- (_dbus_list_prepend_link):
- * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
- (dbus_realloc):
- Warning fixes.
-
-2003-02-15 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- * bus/activation.c: (bus_activation_entry_free),
- (add_desktop_file_entry), (load_directory), (bus_activation_init):
- * bus/activation.h:
- * bus/main.c: (main):
- Add simple activation support, doesn't work yet though.
-
-2003-02-15 Zack Rusin <zack@kde.org>
-
- * qt/dbus-qthread.cpp: small casting fix
-
-2003-02-15 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-errors.c: (dbus_set_error):
- * dbus/dbus-errors.h:
- Add a few errors and make dbus_set_error void.
-
- * dbus/dbus-sysdeps.c:
- (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
- (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
- * dbus/dbus-sysdeps.h:
- Add _dbus_spawn_async.
-
- * test/spawn-test.c: (main):
- Test for _dbus_spawn_async.
-
-2003-02-15 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-internals.h:
- Fix build without tests.
-
- * dbus/dbus-list.c: (alloc_link):
- Fix a segfault when a malloc fails.
-
- * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
- (dbus_malloc0), (dbus_realloc):
- Add support for malloc debugging.
-
-2003-02-15 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-threads.c:
- * dbus/dbus-threads.h:
- Add condvars. Remove static mutext from API.
- Implement static mutexes by initializing them from threads_init.
-
- * glib/dbus-gthread.c:
- * qt/dbus-qthread.cpp:
- Update with the thread api changes.
-
-
- * dbus/dbus-list.c:
- * dbus/dbus-list.h:
- Turn StaticMutex into normal mutex + init function.
- Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
- _dbus_list_append_link, _dbus_list_prepend_link
-
-
- * dbus/dbus-sysdeps.c:
- * dbus/dbus-sysdeps.h:
- New type dbus_atomic_t, and new functions _dbus_atomic_inc,
- _dbus_atomic_dec. Only slow fallback implementation at the moment.
-
- * dbus/dbus-protocol.h:
- Add DBUS_MESSAGE_LOCAL_DISCONNECT define
-
- * dbus/dbus-message.c:
- Make ref/unref atomic.
- Fix some docs.
-
- * dbus/dbus-connection-internal.h:
- * dbus/dbus-connection.c:
- * dbus/dbus-connection.h:
- Make threadsafe.
- Change _peek to _borrow,_return & _steal_borrowed.
- Change disconnect callback to event.
- Make dbus_connection_dispatch_messages reentrant.
-
- * dbus/dbus-transport.c:
- Don't ref the connection on calls to the transport
- implementation.
-
- * dbus/dbus-message-handler.c:
- Make threadsafe.
-
- * glib/dbus-gmain.c:
- Don't use peek_message anymore
-
- * test/Makefile.am:
- * test/debug-thread.c:
- * test/debug-thread.h:
- Simple thread implementation that asserts() on deadlocks in
- single-threaded code.
-
- * test/bus-test.c:
- (main) Call debug_threads_init.
-
- * test/watch.c:
- Use disconnect message instead of disconnect callback.
-
- * bus/connection.c:
- * bus/connection.h:
- Don't call dbus_connection_set_disconnect_function. Instead export
- bus_connection_disconnect.
-
- * bus/dispatch.c:
- Call bus_connection_disconnect when we get a disconnected message.
-
-2003-02-15 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_new): fool around with the
- docs
-
-2003-02-14 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-mempool.c: fail if the debug functions so indicate
-
- * dbus/dbus-memory.c: fail if the debug functions indicate we
- should
-
- * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
- (_dbus_decrement_fail_alloc_counter): debug functions to
- simulate memory allocation failures
-
-2003-02-14 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-errors.h (struct DBusError): add a word of padding
- to DBusError
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_handle_hello):
- * bus/driver.h:
- * bus/services.c: (bus_service_lookup):
- Reorder message sending so we get a more sane order.
-
- * test/bus-test.c: (message_handler):
- Fix tyop.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_send_service_created), (bus_driver_send_service_lost),
- (bus_driver_send_service_acquired), (bus_driver_handle_hello),
- (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services),
- (bus_driver_handle_acquire_service),
- (bus_driver_handle_service_exists):
- * dbus/dbus-bus.c: (dbus_bus_register_client),
- (dbus_bus_acquire_service), (dbus_bus_service_exists):
- * dbus/dbus-errors.c: (dbus_result_to_string):
- * dbus/dbus-errors.h:
- * dbus/dbus-message.c: (dbus_message_append_args),
- (dbus_message_append_args_valist), (dbus_message_get_args),
- (dbus_message_get_args_valist), (dbus_message_get_args_iter),
- (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
- (dbus_message_iter_get_byte_array),
- (dbus_message_iter_get_string_array), (message_iter_test),
- (check_message_handling), (_dbus_message_test):
- * dbus/dbus-message.h:
- * test/bus-test.c: (main):
- Change fields to arguments in messages, so that they won't be
- confused with header fields.
-
- * glib/test-dbus-glib.c: (main):
- Remove append_fields from hello message.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-errors.c:
- * dbus/dbus-message.c:
- * dbus/dbus-string.c:
- Documentation fixes.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
- (remove_timeout):
- Implement support for timeouts in dbus-glib.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-message-builder.c: (_dbus_message_data_load):
- * dbus/dbus-message.c: (process_test_subdir):
- * test/break-loader.c: (find_breaks_based_on):
- Plug some memory leaks.
-
-2003-02-13 Richard Hult <rhult@codefactory.se>
-
- * bus/main.c: Fix build.
-
- * dbus/dbus-errors.h:
- * dbus/dbus-errors.c: Fix copyright for Anders.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- Add utils.[ch]
-
- * bus/connection.c: (bus_connection_foreach):
- Fix a warning.
-
- * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
- (unescape_string), (new_section), (parse_section_start),
- (parse_key_value), (report_error), (bus_desktop_file_load),
- (bus_desktop_file_get_string):
- * bus/desktop-file.h:
- Use DBusError for error reporting.
-
- * bus/dispatch.c: (send_one_message),
- (bus_dispatch_message_handler):
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_send_service_created), (bus_driver_send_service_lost),
- (bus_driver_send_service_acquired), (bus_driver_handle_hello),
- (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services),
- (bus_driver_handle_acquire_service),
- (bus_driver_handle_service_exists):
- * bus/loop.c: (bus_loop_run):
- * bus/main.c:
- Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
-
- * bus/utils.c: (bus_wait_for_memory):
- * bus/utils.h:
- New files with general utility functions.
-
- * dbus/dbus-internals.h:
- Remove _DBUS_HANDLE_OOM.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
- (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
- * dbus/dbus-errors.h:
- Add DBusError structure.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * test/data/valid-messages/standard-acquire-service.message:
- * test/data/valid-messages/standard-hello.message:
- * test/data/valid-messages/standard-list-services.message:
- * test/data/valid-messages/standard-service-exists.message:
- Add some standard messages.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services),
- (bus_driver_handle_acquire_service),
- (bus_driver_handle_service_exists), (bus_driver_handle_message):
- Update for API changes in libdbus.
-
- * dbus/dbus-message.c: (dbus_message_new_reply):
- * dbus/dbus-message.h:
- Remove the name argument. The spec states that replies shouldn't
- have a name.
-
-2003-02-13 Anders Carlsson <andersca@codefactory.se>
-
- * bus/desktop-file.c: (parse_section_start), (parse_key_value),
- (report_error), (bus_desktop_file_load), (lookup_section),
- (lookup_line), (bus_desktop_file_get_raw),
- (bus_desktop_file_get_string):
- * bus/desktop-file.h:
- Some fixes, and new functions for getting a key value from a section.
-
-2003-02-13 Havoc Pennington <hp@pobox.com>
-
- * test/data/auth/fail-after-n-attempts.auth-script: new test
-
- * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
- reject the client.
-
-2003-02-13 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-auth.c (handle_server_data_external_mech): args to
- dbus_credentials_match were backward
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
- NO_CREDENTIALS and ROOT_CREDENTIALS
-
- * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
- into here. Never process more commands after we've reached an
- end state; store further data as unused bytes.
-
- * test/data/auth/*: add more auth tests
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
- command to match exact string and EXPECT_UNUSED to match unused
- bytes
-
- * test/Makefile.am (dist-hook): fix to dist all the test stuff
-
-2003-02-12 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
- \r off of popped lines
-
- * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
- scripts
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
- SEND, append \r\n
-
-2003-02-12 Havoc Pennington <hp@pobox.com>
-
- * dbus/Makefile.am: remove break-loader from the build, since it
- moved.
-
- * configure.in: add --enable-gcov to turn on coverage profiling
- flags and disable optimization
-
-2003-02-10 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
- initial cut at test framework for DBusAuth from laptop.
- Doesn't quite work yet but it compiles and I need to get
- it off the 266mhz laptop. ;-)
-
- * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
- fix a memleak in error case
-
-2003-02-12 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- * bus/desktop-file.c:
- * bus/desktop-file.h:
- Add a desktop file parser.
-
-2003-02-11 Zack Rusin <zack@kde.org>
-
- * qt/message.[h|cpp]: sample implementation
- of the KDE wrapper for DBusMessage
-
-2003-02-09 Zack Rusin <zack@kde.org>
-
- * test/bus-test.c: make_it_compile
- * doc/dbus-specification.sgml: minimal semantic fix
-
-2003-02-06 Anders Carlsson <andersca@codefactory.se>
-
- Release 0.3
-
- * NEWS: Update
-
-2003-02-06 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am:
- * dbus/dbus-break-loader.c:
- * test/Makefile.am:
- * test/break-loader.c:
- Move dbus-break-loader to test/ and rename it to break-loader.
-
-2003-02-02 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
- for code to manage cookies in your home directory
-
- * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
-
- * dbus/dbus-auth.c (get_state): impose a maximum number of tries
- to authenticate, then disconnect the client.
-
-2003-02-03 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_append_fields):
- Correct docs.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * doc/dbus-specification.sgml:
- Update address format section.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * test/Makefile.am:
- * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
- (message_handler), (new_connection_callback), (loop_quit),
- (loop_run), (main):
- Add bus test.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_handle_service_exists):
- Simplify the code a bit.
-
- * dbus/dbus-bus.c: (dbus_bus_service_exists):
- Fix a silly.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- Add libdbus-daemon.la and link to it.
-
-2003-02-01 James Willcox <jwillcox@gnome.org>
-
- * bus/driver.c: (bus_driver_handle_own_service):
- Actually include the service reply code in the message.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_handle_service_exists):
- Don't unref the incoming message.
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
-
-2003-02-02 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-server.c: (dbus_server_listen):
- * dbus/dbus-transport.c: (_dbus_transport_open):
- ifdef out the calls to the debug transport and server.
-
-2003-02-02 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-watch.c (dbus_watch_get_flags):
- Add note in the docs that ERROR or HANGUP won't be returned
- and are assumed always on.
-
- * glib/dbus-gmain.c (add_watch):
- Always add IO_ERR | IO_HUP
-
- * dbus/dbus-message.h:
- Add semicolon after dbus_message_iter_get_string_array().
- Makes qt code build again
-
-2003-02-01 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (create_unique_client_name),
- (bus_driver_handle_hello):
- Don't take a name, just use a numeric id to identify
- each client.
-
- * dbus/Makefile.am:
- * dbus/dbus-bus.c: (dbus_bus_register_client),
- (dbus_bus_acquire_service), (dbus_bus_service_exists):
- * dbus/dbus-bus.h:
- Add new convenience functions for communicating with the bus.
-
- * dbus/dbus-message.h:
-
- * dbus/dbus-protocol.h:
- Fix a typo.
-
-2003-02-01 Alexander Larsson <alexl@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_append_fields):
- Add some more doc comments.
-
-2003-02-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-break-loader.c (randomly_modify_length): change
- a 4-byte value in the message as if it were a length
-
- * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
- execute bit on saved files
-
-2003-02-01 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-break-loader.c (main): new program to find messages
- that break the loader.
-
- * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
- * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
-
- * dbus/dbus-string.c (_dbus_string_set_byte): new
-
-2003-01-31 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c: refactor the test code to be more general,
- in preparation for writing a "randomly permute test cases to
- try to break the loader" program.
-
-2003-01-31 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: work on the specification
-
- * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
- the protocol version of the message.
-
- * dbus/dbus-protocol.h: drop special _REPLY names, the spec
- no longer specifies that.
- (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
- 1/2/3/4)
-
- * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
- "break" for DBUS_TYPE_NIL, remove @todo
-
-2003-01-31 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
- just set_is_error/get_is_error as this is a commonly-used
- function, and write docs.
-
-2003-01-31 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-address.c: (dbus_address_entry_free):
- Free key and value lists.
-
- * dbus/dbus-internals.c: (_dbus_type_to_string):
- Add the types we didn't have.
-
- * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
- (_dbus_marshal_validate_arg):
- Add NIL types.
-
- * dbus/dbus-message.c: (dbus_message_set_sender):
- Remove todo about being able to set sender to NULL.
-
- (dbus_message_set_is_error_reply),
- (dbus_message_get_is_error_reply):
- * dbus/dbus-message.h:
- New functions.
-
- * dbus/dbus-protocol.h:
- Add error reply flag.
-
- * test/data/valid-messages/opposite-endian.message:
- Add NIL type to test.
-
-2003-01-31 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: fully specify the header. Add
- flags and major protocol version, and change header/body len to
- unsigned.
-
- * dbus/dbus-message-builder.c (append_saved_length): append length
- as uint32
-
- * dbus/dbus-message.c (dbus_message_create_header): change header
- length and body length to unsigned. Add the new fields from the
- spec
- (_dbus_message_loader_return_buffer): unsigned header/body len
-
-2003-01-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-auth.c: rework to use only REJECTED, no
- MECHANISMS
-
- * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
- use REJECTED, suggested by Mark McLoughlin
-
-2003-01-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
- a better way to report errors here. e.g. "unix address lacks
- path" or something. also "no such file" when the path doesn't
- exist, etc.
-
- * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
- leaking list nodes
- (dbus_parse_address): add @todo about documenting address format,
- and allowing , and ; to be escaped
-
-2003-01-30 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am:
- Add dbus-address.[ch]
-
- * dbus/dbus-address.c: (dbus_address_entry_free),
- (dbus_address_entries_free), (create_entry),
- (dbus_address_entry_get_method), (dbus_address_entry_get_value),
- (dbus_parse_address), (_dbus_address_test):
- * dbus/dbus-address.h:
- New files for dealing with address parsing.
-
- * dbus/dbus-connection.c:
- Document timeout functions.
-
- * dbus/dbus-message.c:
- Document dbus_message_new_from_message.
-
- * dbus/dbus-server-debug.c:
- Document.
-
- * dbus/dbus-server.c: (dbus_server_listen):
- Parse address and use correct server implementation.
-
- * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
- * dbus/dbus-string.h:
- New function with test.
-
- * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
- * dbus/dbus-test.h:
- Add address tests.
-
- * dbus/dbus-transport-debug.c:
- Document.
-
- * dbus/dbus-transport.c: (_dbus_transport_open):
- Parse address and use correct transport implementation.
-
-2003-01-30 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c: use message->byte_order instead of
- DBUS_COMPILER_BYTE_ORDER throughout.
- (dbus_message_create_header): pad header to align the
- start of the body of the message to 8-byte boundary
-
- * dbus/dbus-marshal.h: make all the demarshalers take const
- DBusString arguments.
-
- * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
- validate message args here, so we don't have to do slow validation
- later, and so we catch bad messages as they are incoming. Also add
- better checks on header_len and body_len. Also fill in
- message->byte_order
-
- * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
- implemented properly)
- (_dbus_string_validate_nul): new function to check all-nul
-
- * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
- get_arg_end_pos and remove all validation
- (_dbus_marshal_validate_arg): actually do validation here.
-
-2003-01-29 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (check_message_handling): fix assertion
- failure on set_client_serial
-
-2003-01-28 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-server-debug.c: Add doc section comments
-
- * dbus/dbus-transport-debug.c: add doc section comments
-
-2003-01-28 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
- the reverse order from how I had it
- (_dbus_string_base64_encode): reverse encoding order. I was
- basically byteswapping everything during encoding.
-
-2003-01-28 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection-internal.h:
- * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
- (_dbus_connection_remove_timeout):
- Add functions for adding and removing timeouts.
-
- * dbus/dbus-message.c: (dbus_message_new_from_message):
- Add new function that takes a message and creates an exact
- copy of it, but with the refcount set to 1.
- (check_message_handling):
- Fix build error.
-
- * dbus/dbus-server-protected.h:
- * dbus/dbus-server.c: (_dbus_server_init_base),
- (_dbus_server_finalize_base), (_dbus_server_add_timeout),
- (dbus_server_set_timeout_functions):
- (_dbus_server_remove_timeout):
- New functions so that a server can add and remove timeouts.
-
- (dbus_server_listen):
- Add commented out call to dbus_server_debug_new.
-
- * dbus/dbus-timeout.c: (_dbus_timeout_new):
- Actually set the handler, doh.
-
- * dbus/dbus-transport.c: (_dbus_transport_open):
- Add commented out call to dbus_transport_debug_client_new.
-
- * dbus/Makefile.am:
- Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
-
-2003-01-28 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (check_message_handling): function to check
- on the loaded message, iterates over it etc.
-
-2003-01-28 Havoc Pennington <hp@pobox.com>
-
- * test/Makefile.am (dist-hook): fix make distdir
-
- * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
-
-2003-01-27 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-mempool.c (time_for_size): replace printf with
- _dbus_verbose
-
- * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
- empty lines; fix the SAVE_LENGTH stuff to be
- START_LENGTH/END_LENGTH so it actually works; couple other
- bugfixes
-
- * test/Makefile.am (dist-hook): add dist-hook for .message files
-
- * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
- can be constant or locked.
- (_dbus_string_free): allow freeing a const string as
- documented/intended
-
- * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
-
- * dbus/dbus-test-main.c (main): take an argument which is the
- directory containing test data
-
- * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
- argument to this and load all the messages in test/data/
- checking that they can be loaded or not loaded as appropriate.
-
-2003-01-27 Anders Carlsson <andersca@codefactory.se>
-
- * bus/dispatch.c: (bus_dispatch_message_handler):
- Dispatch messages sent to services.
-
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_send_service_created), (bus_driver_send_service_lost),
- (bus_driver_send_service_acquired):
- Add helper functions for sending service related messages.
-
- (bus_driver_send_welcome_message):
- Send HELLO_REPLY instead of WELCOME.
-
- (bus_driver_handle_list_services):
- Send LIST_SERVICES_REPLY instead of SERVICES.
-
- (bus_driver_handle_own_service),
- (bus_driver_handle_service_exists):
- New message handlers.
-
- (bus_driver_handle_message):
- Invoke new message handlers.
-
- (bus_driver_remove_connection):
- Don't remove any services here since that's done automatically
- by bus_service_remove_owner now.
-
- * bus/driver.h:
- New function signatures.
-
- * bus/services.c: (bus_service_add_owner):
- Send ServiceAcquired message if we're the only primary owner.
-
- (bus_service_remove_owner):
- Send ServiceAcquired/ServiceLost messages.
-
- (bus_service_set_prohibit_replacement),
- (bus_service_get_prohibit_replacement):
- Functions for setting prohibit replacement.
-
- (bus_service_has_owner):
- New function that checks if a connection is in the owner queue of
- a certain service.
-
- * bus/services.h:
- Add new function signatures.
-
- * dbus/dbus-list.c: (_dbus_list_test):
- Add tests for _dbus_list_remove_last and traversing the list backwards.
-
- * dbus/dbus-list.h:
- Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
- go any further, so return NULL then.
-
- * dbus/dbus-protocol.h:
- Add new messages, service flags and service replies.
-
-2003-01-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message-builder.c: implement, completely untested.
-
- * test/data/*: add data to be used in testing.
- ".message" files are our simple loadable text format.
- ".message-raw" will be binary dumps of messages.
-
- * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
-
-2003-01-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
-
- * dbus/dbus-errors.c (dbus_result_to_string): add
- file errors
-
- * dbus/dbus-message-builder.c: new file, will contain code to load
- up messages from files. Not implemented yet.
-
-2003-01-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.c (dbus_message_set_sender): support deleting
- the sender by setting to NULL
-
-2003-01-26 Havoc Pennington <hp@pobox.com>
-
- The unit tests pass, but otherwise untested. If it breaks, the
- tests should have been better. ;-)
-
- * bus/driver.c (bus_driver_handle_hello): return if we disconnect
- the connection.
-
- * dbus/dbus-message.c: redo everything so we maintain
- message->header as the only copy of the various fields.
- This avoids the possibility of out-of-memory in some cases,
- for example dbus_message_lock() can't run out of memory anymore,
- and avoids extra copying. Figured I may as well go ahead and do
- this since it was busted for dbus_message_lock to not return
- failure on OOM, and dbus_message_write_header was totally
- unchecked for OOM. Also fixed some random other bugs.
-
- * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
- that strings are nul-terminated. Also, end_pos can be equal
- to string length just not greater than, I think.
- (_dbus_marshal_set_int32): new function
- (_dbus_marshal_set_uint32): new function
- (_dbus_marshal_set_string): new function
-
- * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
- a warning, init timeout_list to NULL
- (dbus_connection_send_message): don't use uninitialized variable
- "serial"
-
- * dbus/dbus-string.c (_dbus_string_replace_len): new function
-
-2003-01-26 Anders Carlsson <andersca@codefactory.se>
-
- * bus/driver.c: (bus_driver_handle_hello),
- (bus_driver_send_welcome_message):
- Plug leaks
-
-2003-01-26 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
- * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
- (dbus_connection_unref):
- * dbus/dbus-marshal.c: (_dbus_marshal_test):
- * dbus/dbus-message.c: (dbus_message_unref),
- Plug memory leaks.
-
- (dbus_message_get_fields):
- Remove debugging printout.
-
- (_dbus_message_loader_return_buffer):
- Don't store the header string.
-
- (_dbus_message_test):
- Plug leaks.
-
-2003-01-26 Richard Hult <rhult@codefactory.se>
-
- * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
- the file descriptor list, since it can change under us.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * glib/dbus-gmain.c: (dbus_connection_prepare),
- (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
- (remove_watch), (dbus_connection_hookup_with_g_main):
- Rewrite the glib handling to use its own GSource instead of a
- GIOChannel so we can catch messages put in the queue while waiting
- for a reply.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- * bus/connection.c: (connection_disconnect_handler),
- (connection_watch_callback), (bus_connection_setup):
- * bus/dispatch.c: (send_one_message),
- (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
- (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
- * bus/dispatch.h:
- * bus/driver.c: (bus_driver_send_service_deleted),
- (bus_driver_send_service_created), (bus_driver_handle_hello),
- (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services), (bus_driver_remove_connection),
- (bus_driver_handle_message):
- * bus/driver.h:
- Refactor code, put the message dispatching in its own file. Use
- _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
- is disconnected.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-internals.h:
- Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
-
- * dbus/dbus-message.c: (dbus_message_get_sender):
- * dbus/dbus-message.h:
- Implement dbus_message_get_sender.
-
- * dbus/dbus-protocol.h:
- Add message and service defines.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection.c: (dbus_connection_send_message):
- * dbus/dbus-message-internal.h:
- * dbus/dbus-message.c: (_dbus_message_get_client_serial),
- (dbus_message_write_header):
- Remove _dbus_messag_unlock and don't set the client serial on a
- message if one already exists.
-
-2003-01-24 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-list.c (alloc_link): put a thread lock on the global
- list_pool
-
- * bus/driver.c (bus_driver_handle_list_services): fix a leak
- on OOM
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-list.c: (alloc_link), (free_link):
- Use a memory pool for the links.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * bus/connection.c: (bus_connection_foreach):
- * bus/connection.h:
- Add new bus_connection_foreach function.
-
- * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
- Add function that broadcasts a message to all clients.
-
- (bus_driver_send_service_created), (bus_driver_handle_hello),
- (bus_driver_send_welcome_message),
- (bus_driver_handle_list_services), (bus_driver_message_handler):
- Implement functions that take care of listing services, and notifying
- clients when new services are created.
-
- * bus/services.c: (bus_services_list):
- * bus/services.h:
- Add new function that returns an array of strings with the currently
- registered services.
-
- * glib/dbus-glib.h:
- * glib/dbus-gmain.c:
- Update copyright year.
-
-2003-01-25 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection.c: (dbus_connection_send_message):
- Unlock the message in case it was sent earlier.
-
- (dbus_connection_send_message_with_reply_and_block):
- Remove the reply message from the list.
-
- * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
- Set array_len and new_pos correctly.
-
- (_dbus_marshal_test):
- Remove debug output.
-
- * dbus/dbus-message-internal.h:
- * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
- New function that returns the reply serial.
-
- (_dbus_message_unlock):
- New function that unlocks a message and resets its header.
-
- (dbus_message_append_string_array),
- (dbus_message_get_fields_valist),
- (dbus_message_iter_get_field_type),
- (dbus_message_iter_get_string_array),
- (dbus_message_get_fields),
- (dbus_message_append_fields_valist):
- Handle string arrays.
-
- (dbus_message_set_sender):
- Make this function public since the bus daemon needs it.
-
- (decode_header_data):
- Set the reply serial to -1 initially.
-
- * dbus/dbus-message.h:
- Add dbus_message_set_sender.
-
-2003-01-24 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: add some stuff
-
-2003-01-22 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-specification.sgml: Start to document the protocol.
-
-2003-01-22 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c
- (dbus_connection_send_message_with_reply_and_block): add some @todo
-
- * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
-
-2003-01-21 Havoc Pennington <hp@pobox.com>
-
- (patch untested because can't compile)
-
- * bus/driver.c (create_unique_client_name): make this function
- never recycle client names. Also, caller should initialize
- the DBusString.
-
- * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
-
-2003-01-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_double),
- (_dbus_marshal_int32), (_dbus_marshal_uint32),
- (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
- (_dbus_marshal_double_array), (_dbus_marshal_string_array),
- (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
- (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
- (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- * dbus/dbus-protocol.h:
- Add support for marshalling and demarshalling integer, double
- and string arrays.
-
-2003-01-21 Anders Carlsson <andersca@codefactory.se>
-
- * bus/Makefile.am:
- Add driver.[ch]
-
- * bus/connection.c: (connection_disconnect_handler):
- Remove the connection from the bus driver's list.
-
- (connection_watch_callback): Dispatch messages.
-
- (free_connection_data): Free connection name.
-
- (bus_connection_setup): Add connection to the bus driver's list.
- (bus_connection_remove_owned_service):
- (bus_connection_set_name), (bus_connection_get_name):
- Add functions for setting and getting the connection's name.
-
- * bus/connection.h:
- Add function headers.
-
- * bus/driver.c: (create_unique_client_name),
- (bus_driver_handle_hello_message),
- (bus_driver_send_welcome_message), (bus_driver_message_handler),
- (bus_driver_add_connection), (bus_driver_remove_connection):
- * bus/driver.h:
- * bus/main.c:
- * bus/services.c: (bus_service_free):
- * bus/services.h:
- New file that handles communication and registreation with the bus
- itself.
-
-2003-01-21 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection.c: (dbus_connection_send_message):
- Add a new client_serial parameter.
-
- (dbus_connection_send_message_with_reply):
- Remove a @todo since we've implemented the blocking function.
-
- (dbus_connection_send_message_with_reply_and_block):
- New function that sends a message and waits for a reply and
- then returns the reply.
-
- * dbus/dbus-connection.h:
- Add new functions.
-
- * dbus/dbus-errors.c: (dbus_result_to_string):
- * dbus/dbus-errors.h:
- Add new DBUS_RESULT.
-
- * dbus/dbus-message-internal.h:
- * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
- (_dbus_message_set_sender), (dbus_message_write_header),
- (dbus_message_new_reply), (decode_header_data),
- (_dbus_message_loader_return_buffer), (_dbus_message_test):
- * dbus/dbus-message.h:
- Add new functions that set the reply serial and sender.
- Also marshal and demarshal them correctly and add test.
-
- * dbus/dbus-protocol.h:
- Add new DBUS_MESSAGE_TYPE_SENDER.
-
- * glib/dbus-glib.h:
- * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
- (add_watch), (remove_watch), (add_timeout), (remove_timeout),
- (dbus_connection_hookup_with_g_main):
- * glib/test-dbus-glib.c: (main):
- Rewrite to use GIOChannel and remove the GSource crack.
-
- * test/echo-client.c: (main):
- * test/watch.c: (check_messages):
- Update for changed APIs
-
-2003-01-19 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am: Add dbus-timeout.[cħ]
-
- * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
- Create a DBusTimeoutList.
- (dbus_connection_set_timeout_functions): Add new function to
- set timeout callbacks
-
- * dbus/dbus-connection.h: Add public DBusTimeout API.
-
- * dbus/dbus-message.c: (dbus_message_get_service):
- * dbus/dbus-message.h: New function.
-
- * dbus/dbus-server.c: Fix small doc typo.
-
- * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
-
-2003-01-19 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
- of the string, just as long as specified.
-
-2003-01-19 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
- new function
-
- * dbus/dbus-server.c (dbus_server_set_max_connections)
- (dbus_server_get_max_connections, dbus_server_get_n_connections):
- keep track of current number of connections, and add API for
- setting a max (but haven't implemented enforcing the max yet)
-
-2003-01-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
- reading/writing if read_watch != NULL or write_watch != NULL.
-
- * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
- the message loader code to actually load message->header and
- message->body into the newly-created message.
-
- * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
- in OOM case
-
- * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
- (dbus_connection_get_max_message_size)
- (dbus_connection_set_max_live_messages_size)
- (dbus_connection_get_max_live_messages_size): implement some
- resource limitation functions
-
- * dbus/dbus-resources.c: new file implementing some of the
- resource limits stuff
-
- * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
- missing docs, add @todo to handle OOM etc.
-
- * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
- docs
-
-2003-01-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
- connection if it hasn't been already.
-
- * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
- replace with DisconnectFunction.
-
-2003-01-18 Havoc Pennington <hp@pobox.com>
-
- Building --disable-verbose-mode --disable-asserts --disable-tests
- cuts the library from 112K to 45K or so
-
- * configure.in: check for varargs macro support,
- add --enable-verbose-mode, --enable-asserts.
-
- * dbus/dbus-internals.h (_dbus_assert): support
- DBUS_DISABLE_ASSERT
- (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
-
-2003-01-18 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-test.c: include config.h so that tests actually run
-
- * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
- so the failure mode when that assumption fails will be plenty
- obvious.
-
-2003-01-18 Havoc Pennington <hp@pobox.com>
-
- * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
-
- * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
- the distribution
-
- * test/Makefile.am: don't use special variable "TESTS" for echo-*
- since we don't want to use those in make check
-
-2003-01-15 Havoc Pennington <hp@redhat.com>
-
- Release 0.2
-
- * NEWS: update
-
-2003-01-15 Havoc Pennington <hp@redhat.com>
-
- * test/Makefile.am: fix so that test source code ends up in the
- distribution on make distcheck
-
-2003-01-15 Havoc Pennington <hp@redhat.com>
-
- Release 0.1.
-
- * NEWS: update
-
-2003-01-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
- fix build when --disable-tests
-
- * Makefile.am (EXTRA_DIST): put HACKING in here
-
- * HACKING: document procedure for making a tarball release.
-
-2003-01-14 Anders Carlsson <andersca@codefactory.se>
-
- * bus/connection.c: (connection_error_handler),
- (bus_connection_setup):
- * bus/main.c: (main):
- Make sure that the DBusConnectionData struct is NULLed
- out to prevent a segfault.
-
- * dbus/dbus-errors.c: (dbus_result_to_string):
- * dbus/dbus-errors.h:
- * dbus/dbus-message.c: (dbus_message_get_fields),
- (dbus_message_get_fields_valist), (_dbus_message_test):
- * dbus/dbus-message.h:
- Make dbus_message_get_fields return a result code so we can
- track invalid fields as well as oom.
-
-2003-01-11 Havoc Pennington <hp@pobox.com>
-
- * configure.in: change --enable-test/--enable-ansi action-if-given
- to enable_foo=$enableval instead of enable_foo=yes
-
-2003-01-08 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-string.c (_dbus_string_align_length): new function
-
- * dbus/dbus-test-main.c: move main() for test app here
- * dbus/dbus-test.c
- (dbus_internal_symbol_do_not_use_run_tests): we have to export a
- symbol to run tests, because dbus-test isn't in the main
- library
-
- Code review nitpicks.
-
- * dbus/dbus-message.c (dbus_message_write_header): add newlines
- for people with narrow emacs ;-). Assert client_serial was filled
- in. Assert message->name != NULL.
- (dbus_message_append_fields): have "first_field_type" arg separate
- from va list, needed for C++ binding that also uses varargs IIRC
- and helps with type safety
- (dbus_message_new): add @todo about using DBusString to store
- service/name internally
- (dbus_message_new): don't leak ->service and ->name on OOM later
- in the function
- (dbus_message_unref): free the service name
- (dbus_message_get_fields): same change to varargs
- i.e. first_field_type
- (_dbus_message_loader_return_buffer): assert that the message data
- is aligned (if not it's a bug in our code). Put in verbose griping
- about why we set corrupted = TRUE.
- (decode_header_data): add FIXME that char* is evil. Was going to
- add FIXME about evil locale-specific string.h strncmp, but just
- switched to wacky string-as-uint32 optimization. Move check for
- "no room for field name" above get_const_data_len() to avoid
- assertion failure in get_const_data_len if we have trailing 2
- bytes or the like. Check for service and name fields being
- provided twice. Don't leak service/name on error. Require field
- names to be aligned to 4 bytes.
-
- * dbus/dbus-marshal.c: move byte swap stuff to header
- (_dbus_pack_int32): uscore-prefix
- (_dbus_unpack_int32): uscore-prefix
- (_dbus_unpack_uint32): export
- (_dbus_demarshal_string): add @todo complaining about use of
- memcpy()
- (_dbus_marshal_get_field_end_pos): add @todo about bad error
- handling allowing corrupt data to go unchecked
-
-2003-01-08 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
- to the select() as needed for authentication. (should be using
- _dbus_poll() not select, but for another day)
-
- * dbus/dbus.h: include dbus/dbus-protocol.h
-
-2003-01-08 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am (dbusinclude_HEADERS): Install
- dbus-connection.h
-
-2003-01-08 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-internals.c: (_dbus_type_to_string):
- New function that returns a string describing a type.
-
- * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
- * dbus/dbus-marshal.h:
- * dbus/dbus-message.c: (dbus_message_get_fields_valist),
- (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
- (dbus_message_iter_get_byte_array):
- * dbus/dbus-message.h:
- Add new convenience functions for appending and getting message fields.
- Also add demarshalling routines for byte arrays.
-
-2003-01-07 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-connection-internal.h:
- * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
- (_dbus_connection_get_next_client_serial),
- (dbus_connection_send_message):
- * dbus/dbus-internals.h:
- * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
- (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
- (_dbus_marshal_uint32), (_dbus_demarshal_double),
- (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
- (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
- (_dbus_verbose_bytes), (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- * dbus/dbus-message-internal.h:
- * dbus/dbus-message.c: (_dbus_message_set_client_serial),
- (dbus_message_write_header), (_dbus_message_lock),
- (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
- (dbus_message_get_name), (dbus_message_append_int32),
- (dbus_message_append_uint32), (dbus_message_append_double),
- (dbus_message_append_string), (dbus_message_append_byte_array),
- (dbus_message_get_fields_iter), (dbus_message_iter_ref),
- (dbus_message_iter_unref), (dbus_message_iter_has_next),
- (dbus_message_iter_next), (dbus_message_iter_get_field_type),
- (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
- (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
- (decode_header_data), (_dbus_message_loader_return_buffer),
- (message_iter_test), (_dbus_message_test):
- * dbus/dbus-message.h:
- * dbus/dbus-protocol.h:
- * dbus/dbus-test.c: (main):
- * dbus/dbus-test.h:
- * glib/test-dbus-glib.c: (message_handler), (main):
- * test/echo-client.c: (main):
- * test/watch.c: (check_messages):
- Make messages sendable and receivable for real.
-
-2003-01-07 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_double),
- (_dbus_marshal_string), (_dbus_marshal_byte_array):
- * dbus/dbus-message.c: (dbus_message_append_int32),
- (dbus_message_append_uint32), (dbus_message_append_double),
- (dbus_message_append_string), (dbus_message_append_byte_array):
- Handle OOM restoration.
-
-2003-01-07 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_string),
- (_dbus_demarshal_string), (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- * dbus/dbus-message.c: (dbus_message_get_name),
- Document these functions.
-
- (dbus_message_append_int32), (dbus_message_append_uint32),
- (dbus_message_append_double), (dbus_message_append_string),
- (dbus_message_append_byte_array):
- * dbus/dbus-message.h:
- Add functions for adding message fields of different types.
-
- * dbus/dbus-protocol.h:
- Add the different types.
-
-2003-01-05 Havoc Pennington <hp@pobox.com>
-
- * bus/connection.c: implement routines for handling connections,
- first thing is keeping a list of owned services on each connection
- and setting up watches etc.
-
- * bus/services.c: implement a mapping from service names to lists
- of connections
-
- * dbus/dbus-hash.c: add DBUS_HASH_POINTER
-
- * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
- to use static mutexes for global data
-
- * dbus/dbus-connection.c (dbus_connection_set_data): add new
- collection of functions to set/get application-specific data
- on the DBusConnection.
-
-2003-01-04 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
- (_dbus_poll): new function
-
- * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
- copied from GLib
-
- * bus/loop.c: initial code for the daemon main loop
-
-2003-01-04 Havoc Pennington <hp@pobox.com>
-
- * test/watch.c (error_handler): make it safe if the error handler
- is called multiple times (if we s/error handler/disconnect
- handler/ we should just guarantee it's called only once)
-
- * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
- error handler on disconnect (it's quite possible we should
- just change the error handler to a "disconnect handler," I'm
- not sure we have any other meaningful errors)
-
- * configure.in: check for getpwnam_r
-
- * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
- dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
- mechanism as in SASL spec, using socket credentials
-
- * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
- (_dbus_send_credentials_unix_socket): new function
-
- * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
- dbus_accept()
- (_dbus_write): only check errno if <0 returned
- (_dbus_write_two): ditto
-
-2003-01-02 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
- (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
- (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- Add _dbus_marshal_byte_array and rename _dbus_marshal_string
- to _dbus_marshal_utf8_string. Also fix some tests.
-
-2002-12-28 Harri Porten <porten@kde.org>
-
- * configure.in: added check for C++ compiler and a very cheesy
- check for the Qt integration
-
- * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
-
- * qt/Makefile.am: added
-
- * qt/.cvsignore: added
-
- * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
- latter, added #ifdef QT_THREAD_SUPPORT guard.
-
- * dbus/Makefile.am: added missing headers for make dist
-
-2002-12-28 Kristian Rietveld <kris@gtk.org>
-
- * dbus/Makefile.am: fixup export-symbols-regex.
-
-2002-12-27 Anders Carlsson <andersca@codefactory.se>
-
- * acinclude.m4: Add this file and put the
- PKG_CHECK_MODULE macro in it.
-
-2002-12-27 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_string),
- (_dbus_demarshal_double), (_dbus_demarshal_int32),
- (_dbus_demarshal_uint32), (_dbus_demarshal_string),
- (_dbus_marshal_test):
- Make the demarshalling routines align the pos argument.
- Add string marshalling tests and fix the obvious bugs
- discovered.
-
-2002-12-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-auth.c: fixes fixes fixes
-
- * dbus/dbus-transport-unix.c: wire up support for
- encoding/decoding data on the wire
-
- * dbus/dbus-auth.c (_dbus_auth_encode_data)
- (_dbus_auth_decode_data): append to target string
- instead of nuking it.
-
-2002-12-26 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
- WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
- doh
-
- * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
- avoid swap_bytes() overhead (ignoring possible assembly stuff for
- now). Main point is because I wanted unpack_uint32 to implement
- _dbus_verbose_bytes
- (_dbus_verbose_bytes): new function
-
- * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
-
- * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
- mechanism to handle a corrupt message stream
- (_dbus_message_loader_new): fix preallocation to only prealloc,
- not prelengthen
-
- * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
- (_dbus_string_test): enhance tests for copy/move and fix the
- functions
-
- * dbus/dbus-transport-unix.c: Hold references in more places to
- avoid reentrancy problems
-
- * dbus/dbus-transport.c: ditto
-
- * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
- leak reference count in no-message case
-
- * test/watch.c (do_mainloop): handle adding/removing watches
- during iteration over the watches. Also, ref the connection/server
- stored on a watch, so we don't try to mangle a destroyed one.
-
- * dbus/dbus-transport-unix.c (do_authentication): perform
- authentication
-
- * dbus/dbus-auth.c (get_state): add a state
- AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
- (_dbus_auth_get_unused_bytes): append the unused bytes
- to the passed in string, rather than prepend
-
- * dbus/dbus-transport.c (_dbus_transport_init_base): create
- the auth conversation DBusAuth
-
- * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
- (_dbus_transport_new_for_domain_socket): when creating a
- transport, pass in whether it's a client-side or server-side
- transport so we know which DBusAuth to create
-
-2002-12-03 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-transport-unix.c (unix_finalize): finalize base
- _after_ finalizing the derived members
- (unix_connection_set): unref watch if we fail to add it
-
- * dbus/dbus-connection.c (dbus_connection_unref): delete the
- transport first, so that the connection owned by the
- transport will be valid as the transport finalizes.
-
- * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
- if necessary, and remove watches from the connection.
-
- * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
-
-2002-12-26 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/dbus-marshal.c: (_dbus_marshal_string),
- (_dbus_demarshal_double), (_dbus_demarshal_int32),
- (_dbus_demarshal_uint32), (_dbus_demarshal_string),
- (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- Add string marshal functions and have the demarshal functions
- return the new position.
-
-2002-12-25 Havoc Pennington <hp@pobox.com>
-
- * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
- it is a simple protocol that just maps directly to SASL.
-
- * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
- initial implementation, not actually used yet.
-
- * dbus/dbus-string.c (_dbus_string_find): new function
- (_dbus_string_equal): new function
- (_dbus_string_base64_encode): new function
- (_dbus_string_base64_decode): new function
-
-2002-12-25 Anders Carlsson <andersca@codefactory.se>
-
- * dbus/Makefile.am:
- * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
- (_dbus_marshal_int32), (_dbus_marshal_uint32),
- (_dbus_demarshal_double), (_dbus_demarshal_int32),
- (_dbus_demarshal_uint32), (_dbus_marshal_test):
- * dbus/dbus-marshal.h:
- * dbus/dbus-protocol.h:
- * dbus/dbus-test.c: (main):
- * dbus/dbus-test.h:
- Add un-optimized marshalling/demarshalling routines.
-
-2002-12-25 Harri Porten <porten@kde.org>
-
- * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
-
-2002-12-24 Zack Rusin <zack@kde.org>
-
- * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
- * qt/dbus-qt.h: skeleton with two sample implemenatation of the
- main loop stuff
-
-2002-12-24 Havoc Pennington <hp@pobox.com>
-
- * glib/dbus-gthread.c: fix include
-
- * glib/dbus-glib.h: rename DBusMessageHandler for now.
- I think glib API needs to change, though, as you don't
- want to use DBusMessageFunction, you want to use the
- DBusMessageHandler object. Probably
- dbus_connection_open_with_g_main_loop()
- and dbus_connection_setup_g_main_loop() or something like that
- (but think of better names...) that just create a connection
- that has watch/timeout functions etc. already set up.
-
- * dbus/dbus-connection.c
- (dbus_connection_send_message_with_reply): new function just to
- show how the message handler helps us deal with replies.
-
- * dbus/dbus-list.c (_dbus_list_remove_last): new function
-
- * dbus/dbus-string.c (_dbus_string_test): free a string that
- wasn't
-
- * dbus/dbus-hash.c: use memory pools for the hash entries
- (rebuild_table): be more paranoid about overflow, and
- shrink table when we can
- (_dbus_hash_test): reduce number of sprintfs and write
- valid C89. Add tests for case where we grow and then
- shrink the hash table.
-
- * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
-
- * dbus/dbus-connection.c (dbus_connection_register_handler)
- (dbus_connection_unregister_handler): new functions
-
- * dbus/dbus-message.c (dbus_message_get_name): new
-
- * dbus/dbus-list.c: fix docs typo
-
- * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
- an object representing a handler for messages.
-
-2002-12-16 Anders Carlsson <andersca@codefactory.se>
-
- * glib/dbus-glib.h:
- * glib/dbus-gthread.c: (dbus_gthread_init):
- Don't use the gdbus prefix for public functions.
-
-2002-12-16 Anders Carlsson <andersca@codefactory.se>
-
- * Makefile.am:
- * configure.in:
- Add GLib checks and fixup .pc files
-
- * glib/Makefile.am:
- * glib/dbus-glib.h:
- * glib/dbus-gmain.c: (gdbus_connection_prepare),
- (gdbus_connection_check), (gdbus_connection_dispatch),
- (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
- (dbus_connection_gsource_new):
- * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
- (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
- * glib/test-dbus-glib.c: (message_handler), (main):
- Add GLib support.
-
-2002-12-15 Harri Porten <porten@kde.org>
-
- * autogen.sh: check for libtoolize before attempting to use it
-
- * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
- struct.
-
- * .cvsignore: ignore more stamp files
-
- * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
-
- * test/Makefile.am: added -I$(top_srcdir) to be able to compile
- without make install.
-
-2002-12-15 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-threads.c: add thread stubs that a higher library
- layer can fill in. e.g. the GLib wrapper might fill them in with
- GThread stuff. We still need to use this thread API to
- thread-safe-ize the library.
-
-2002-12-12 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
- below new interfaces and include fewer system headers.
-
- * dbus/dbus-sysdeps.c (_dbus_read): new function
- (_dbus_write): new function
- (_dbus_write_two): new function
- (_dbus_connect_unix_socket): new function
- (_dbus_listen_unix_socket): new function
-
- * dbus/dbus-message-internal.h: change interfaces to use
- DBusString
-
-2002-12-11 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-types.h: add dbus_unichar
-
- * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
-
- * dbus/dbus-connection.c (dbus_connection_send_message): return
- TRUE on success
-
- * dbus/dbus-transport.c: include dbus-watch.h
-
- * dbus/dbus-connection.c: include dbus-message-internal.h
-
- * HACKING: add file with coding guidelines stuff.
-
- * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
- handling here, for security purposes (as in vsftpd). Not actually
- using this class yet.
-
- * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
- system/libc usage here, as in vsftpd, for ease of auditing (and
- should also simplify portability). Haven't actually moved all the
- system/libc usage into here yet.
-
-2002-11-25 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-internals.c (_dbus_verbose): fix to not
- always print the first verbose message.
-
-2002-11-24 Havoc Pennington <hp@pobox.com>
-
- * test/echo-client.c, test/echo-server.c: cheesy test
- clients.
-
- * configure.in (AC_CHECK_FUNCS): check for writev
-
- * dbus/dbus-message.c (_dbus_message_get_network_data): new
- function
-
- * dbus/dbus-list.c (_dbus_list_foreach): new function
-
- * dbus/dbus-internals.c (_dbus_verbose): new function
-
- * dbus/dbus-server.c, dbus/dbus-server.h: public object
- representing a server that listens for connections.
-
- * dbus/.cvsignore: create
-
- * dbus/dbus-errors.h, dbus/dbus-errors.c:
- public API for reporting errors
-
- * dbus/dbus-connection.h, dbus/dbus-connection.c:
- public object representing a connection that
- sends/receives messages. (Same object used for
- both client and server.)
-
- * dbus/dbus-transport.h, dbus/dbus-transport.c:
- Basic abstraction for different kinds of stream
- that we might read/write messages from.
-
-2002-11-23 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
- _DBUS_INT_MAX
-
- * dbus/dbus-test.c (main): add list test, and include
- dbus-test.h as intended
-
- * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
- (_dbus_hash_table_remove_int): return value indicates
- whether the entry existed to remove
-
- * dbus/dbus-list.c: add linked list utility class,
- with docs and tests
-
- * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
- array sometimes.
-
-2002-11-23 Havoc Pennington <hp@pobox.com>
-
- * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
- DBUS_END_DECLS to nothing, that should fix this once and for all
-
- * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
-
- * dbus/dbus-message.c, dbus/dbus-hash.c:
- add some missing @brief
-
-2002-11-23 Havoc Pennington <hp@pobox.com>
-
- * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
- to avoid confusing Doxygen
-
- * dbus/dbus-hash.c: @} not }@
-
- * dbus/dbus-message.c (struct DBusMessage): split out
- internals docs
-
-2002-11-23 Havoc Pennington <hp@pobox.com>
-
- * configure.in: pile on more warning flags if using gcc
-
- * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
- to document static functions
-
- * configure.in: add summary to end of configure so it
- looks nice and attractive
-
- * dbus/dbus-hash.c: finish implementation and write unit
- tests and docs
-
- * configure.in: add --enable-tests to enable unit tests
-
- * dbus/dbus-test.c: test program to run unit tests
- for all files in dbus/*, initially runs a test for
- dbus-hash.c
-
- * dbus/dbus-internals.h: file to hold some internal utility stuff
-
-2002-11-22 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-hash.c: copy in Tcl hash table, not yet
- "ported" away from Tcl
-
- * dbus/dbus-types.h: header for types such as dbus_bool_t
-
-2002-11-22 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus.h: fixups for doc warnings
-
- * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
- macros
- (QUIET): make it quiet so we can see warnings
-
- * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
-
-2002-11-22 Havoc Pennington <hp@redhat.com>
-
- * Makefile.am: include "Doxyfile" target in all-local
-
- * configure.in: generate the Doxyfile
-
- * Doxyfile.in: move Doxyfile here, so we can use
- configure to generate a Doxyfile with the right
- version number etc.
-
-2002-11-22 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c: move inline docs into .c file
-
- * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
- so all docs are under doc/
- (MAN_EXTENSION): generate man pages. Use extension
- ".3dbus" which matches ".3qt" on my system,
- I guess this is OK, I don't know really.
- (FILE_PATTERNS): look for .c files not .h, makes sense
- for plain C I think
-
-2002-11-22 Havoc Pennington <hp@pobox.com>
-
- * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
- because any app can be a server, and any app can be a client,
- the bus is a special kind of server.
-
-Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
-
- * Doxyfile : adding. Still needs Makefile rules to be generated
- automatically (just run "doxygen" in the toplevel dir for now to
- generate docs)
-
- * dbus/dbus-message.h : Adding sample docs (javadoc since
- resembles gtk-doc a little more)
-
- * dbus/dbus.h : Adding sample docs
-
-2002-11-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
- so we can allow ourselves to include files directly,
- instead of having to use dbus.h
-
- * dbus/dbus.h: fill in
-
- * dbus/dbus-message.h: sketch out a sample header file.
- Include griping if you include it directly instead of
- via dbus.h
-
- * dbus/dbus-macros.h: new file with macros for extern "C",
- TRUE/FALSE, NULL, etc.
-
- * doc/file-boilerplate.c: put include guards in here
-
-2002-11-21 Havoc Pennington <hp@redhat.com>
-
- * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
-
- * COPYING: include the GPL as well, and license code
- under both AFL and GPL.
-
-2002-11-21 Havoc Pennington <hp@redhat.com>
-
- * acconfig.h: get rid of this
-
- * autogen.sh (run_configure): add --no-configure option
-
- * configure.in: remove AC_ARG_PROGRAM to make
- autoconf complain less. add AC_PREREQ.
- add AC_DEFINE third arg.
-
-2002-11-21 Anders Carlsson <andersca@codefactory.se>
-
- * doc/Makefile.am:
- Fix references so we can distcheck.
-
-2002-11-21 Havoc Pennington <hp@redhat.com>
-
- * Initial module creation
-
diff --git a/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-2 b/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-2
deleted file mode 100644
index b2204480a4..0000000000
--- a/src/3rd_party/dbus-1.7.8/ChangeLog.pre-1-2
+++ /dev/null
@@ -1,2027 +0,0 @@
-2008-04-04 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.2.1
-
-2008-04-03 John (J5) Palmieri <johnp@redhat.com>
-
- Patch from Sumit <sumitskj_20@yahoo.com>, comments added
-
- * dbus/dbus-transport.c(_dbus_transport_open): fix mem leak
-
-2008-04-03 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-connection.c (dbus_connection_send): add documentation
- to describe when to call dbus_connection_flush and
- dbus_connection_unref after a call to dbus_connection_send is made
- Initial wording by Stanislav Brabec <sbrabec at suse.cz>
- (fd.o bug#13558)
-
-2008-04-03 John (J5) Palmieri <johnp@redhat.com>
-
- Patch from Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
-
- * bus/expirelist.c
- (do_expiration_with_current_time): calculate correct min wait time
- and next interval
- (bus_expire_list_add, bus_expire_list_add_link): if the timeout is
- disabled when we add an item to the expire list, enable the timeout
- (do_expiration_with_current_time): only set timeout if there are
- items to expire
-
-2008-04-01 Timo Hoenig <thoenig@suse.de>
-
- Patch from Frederic Crozat <fcrozat@mandriva.com>
-
- * bus/dir-watch-inotify.c (bus_watch_directory): Only monitor
- IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This
- way, only atomic changes to configuration file are monitored.
- * bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in
- _dbus_verbose function call
- * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use
- _dbus_strerror instead of perror
-
-2008-03-04 Havoc Pennington <hp@redhat.com>
-
- * bus/connection.c, bus/expirelist.c: Make the BusExpireList
- struct opaque, adding accessors for manipulating the list. In this
- commit there should be no change in functionality or behavior. The
- purpose of this change is to improve encapsulation prior to fixing
- some bugs Kimmo Hämäläinen found where the timeout is not properly
- updated, since we need to e.g. take some action whenever adding
- and removing stuff from the expire list.
-
-2008-03-31 Colin Walters <walters@verbum.org>
-
- Patch from Owen Taylor <otaylor@redhat.com>
-
- * tools/dbus-launch-x11.c: Check for X11 events before
- selecting (FDO bug #15293)
-
-2008-03-31 Colin Walters <walters@verbum.org>
-
- Patch from Owen Taylor <otaylor@redhat.com>
-
- * tools/dbus-launch-x11.c: Make sure we call XFlush()
- on all code paths (FDO bug #15293)
-
-2008-03-27 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-send.c (append_dict): Do not provide a signature to
- dbus_message_iter_open_container() when opening a dict entry.
-
-2008-03-26 Colin Walters <walters@verbum.org>
-
- Patch from Scott James Remnant <scott@netsplit.com>
-
- * dbus/dbus-bus.c: Set default exit_on_disconnect after registration with
- the bus, not before. This ensures that programs which wish to set
- exit_on_disconnect to FALSE will not be terminated if the bus exits
- during registration. (FDO Bug #15112)
-
-2008-03-04 John (J5) Palmieri <johnp@redhat.com>
-
- * fix broken poll on Mac OSX - build patch by Benjamin Reed
- * configure.in: check for OSX's deadlocking poll
- * dbus/dbus-sysdeps-unix.c (_dbus_poll): if we have a broken poll
- don't use poll
-
-2008-03-04 John (J5) Palmieri <johnp@redhat.com>
-
- * check if the linker supports a flag instead of just checking for GNU
- ld
- * configure.in: move AM_PROG_LIBTOOL to the top
- (ld_supports_flag): new function for checking if the linker supports
- a given flag
-
-2008-03-04 John (J5) Palmieri <johnp@redhat.com>
-
- * add a changelog for Benjamin Reed's git patch RANT: Change Logs are
- handled by git and having an external changelog just screws up
- merging. We should write down rules for doing git commit messages
- and leave it at that.
- * configure.in: Platform build fixes for Mac OS X
- the Darwin linker does not understand the -z option; wrap it in
- a check for $with_gnu_ld.
- environ is only available at runtime, so you need to make a
- reference to _NSGetEnviron instead for symbols to resolve properly.
-
-2008-03-04 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: add $THREAD_LIBS to DBUS_LAUNCHER_LIBS so we link
- correctly
-
-2008-03-04 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/dbus-launch.c: wrap X'ism in #ifdef so we can compile
- without X
-
-2008-02-28 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c: define _AI_ADDRCONFIG as 0 if not
- defined so that we can compile with an older glibc
-
-2008-02-26 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.1.20
-
-2008-02-26 John (J5) Palmieri <johnp@redhat.com>
-
- * CVE-2008-0595 - security policy of the type <allow send_interface=
- "some.interface.WithMethods"/> work as an implicit allow for
- messages sent without an interface bypassing the default deny rules
- and potentially allowing restricted methods exported on the bus to be
- executed by unauthorized users. This patch fixes the issue.
- * bus/policy.c (bus_client_policy_check_can_send,
- bus_client_policy_check_can_receive): skip messages without an
- interface when evaluating an allow rule, and thus pass it to the
- default deny rules
-
-2008-02-26 John (J5) Palmieri <johnp@redhat.com>
-
- * correctly unref connections without guids during shutdown
- * dbus/dbus-connection.c (close_connection_on_shutdown): new method
- split out from shared_connections_shutdown
- (shared_connections_shutdown): shutdown all shared connections
- without guids
- (_dbus_connection_ref_unlocked): handle OOM when prepending no guid
- connections to the shared_connections_no_guid list
- * Patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
-2008-02-21 John (J5) Palmieri <johnp@redhat.com>
-
- * fix build against the latest gcc/glibc
- * dbus/dbus-sysdeps-unix.c: define _GNU_SOURCE
- * bus/selinux.c: include limits.h
- * Patch by Matthias Clasen <mclasen at redhat.com>
-
-2008-02-21 John (J5) Palmieri <johnp@redhat.com>
-
- * fixes dbus-launch so the bus goes away when X does
- (Red Hat Bug #430412)
- * tools/dbus-launch.c (main): set xdisplay = NULL
- * Patch by Matthias Clasen <mclasen at redhat.com>
-
-2008-01-17 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.1.4
-
-2008-01-17 Timo Hoenig <thoenig@suse.de>
- * fix inotify support
- * bus/dir-watch-inotify.c (_handle_inotify_watch): fix reading of the
- inotify events. Also, use ssize_t not size_t for 'ret'.
- * bus/dir-watch-inotify.c (bus_watch_directory): watch not only for
- IN_MODIFY but also for IN_CREATE and IN_DELETE
- * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): drop the
- inotify watches more elegantly by closing inotify:_fd, set inotify_fd to
- -1 after dropping the watches
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: post-release version bump
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.1.3 (1.2.0RC1)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * fix hacking to say git instead of cvs
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Sébastien Couret <10function at gmail dot com>
-
- * dbus/dbus-marshal-recursive.c (all_reader_classes[]): wrap in
- #ifndef DBUS_DISABLE_ASSERT since it is only used in asserts which
- are noop
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Magnus Henoch <henoch plus bfdo at dtek dot chalmers dot se>
-
- * dbus/dbus-auth.c (handle_server_data_external_mech): handle SASL
- EXTERNAL's inital empty responce (FDO Bug #9945)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/messagebus.in: add lsb headers (FDO Bug #11491)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Peter O'Gorman <pogma at thewrittenword dot com>
-
- * dbus/dbus-spawn.c (babysit_signal_handler): check write return value
- so we don't hang (FDO Bug #11665)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Peter O'Gorman <pogma at thewrittenword dot com>
-
- * dbus/dbus-sysdeps.h: support for AIX poll implementation (FDO Bug
- #11666)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * tests/name-test/run-test.sh: make more portable (FDO Bug #11667)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-connection.c (_dbus_connection_get_next_client_serial):
- don't check for < 0 on an unsigned variable (FDO Bug #12924)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * bus/bus.c (setup_server): check failed allocation (FDO Bug #12920)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): the API
- contract says sitter_p can be NULL, so let's check it (FDO Bug #12919)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-spawn.c (read_ints, read_pid): use correct ssize_t type
- instead of size_t (FDO Bug #12862)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-errors.c (dbus_set_error): make sure to call va_end if we
- hit an OOM error inside va_start (FDO Bug #12846)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-connection.c (dbus_connection_send_with_reply):
- fix possible crash if pending_return is NULL (FDO Bug #12673)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * portions of patch submitted by Tim Mooney
- <enchanter at users dot sourceforge dot net>
-
- * configure.in: never auto-select libxml (FDO Bug #12479)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patches by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-sysdeps-unix (_dbus_get_autolaunch_address): handle OOM
- (FDO Bug #12945)
-
- * dbus/dbus-uuidgen.c (return_uuid): handle OOM (FDO Bug #12928)
-
- * dbus/dbus-misc.c (dbus_get_local_machine_id): handle OOM, fix return
- value to return NULL not FALSE (FDO Bug #12946)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/bus.c (bus_context_check_security_policy): rewrite selinux error
- handling to not abort due to a NULL read and to set the error only if
- it is not already set (Based off of FDO Bug #12430)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-internals.c (_dbus_read_uuid_file_without_creating,
- _dbus_create_uuid_file_exclusively): add OOM handling (FDO Bug #12952)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-spawn.c (babysit, babysitter_iteration): add error
- handling when polling (FDO Bug #12954)
-
-2008-01-15 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * bus/config-parser.c (locate_attributes): remove dead code which
- always evaluated to TRUE
-
- * dbus/dbus-shell.c (_dbus_shell_quote): remove unused code
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * bus/connection.c (bus_connection_complete): plug a possible
- BusClientPolicy leak (FDO Bug #13242)
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Frederic Crozat <fcrozat at mandriva dot com> (FDO Bz#
- 13268)
-
- * add inotify support
-
- * bus/Makefile.am: add inotify module to the build
-
- * bus/dir-watch-inotify.c: inotify module based off the dnotify and
- kqueue modules
-
- * configure.in: add checks and switch for inotify
- also add a printout at the end of configure if inotify and kqueue
- support is being built in (dnotify already had this)
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Frederic Crozat <fcrozat at mandriva dot com>
-
- * bus/dir-watch-dnotify.c (bus_watch_directory): watch for file
- creates also
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
-
- * dbus/dbus-transport-socket.c(do_reading): return message
- loader buffer in case of OOM (FDO Bug#12666)
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * configure.in: add warning to output when libxml is selected since
- we don't have a libxml maintainer and expat works perfectly fine
- for what we need an xml parser for
-
-2008-01-14 John (J5) Palmieri <johnp@redhat.com>
-
- * Patch by Andrea Luzzardi <scox at sig11 dot org>: creates a
- _dbus_geteuid function to fix EXTERNAL authentication in setuid
- applications
-
- * dbus/dbus-sysdeps-unix.c (_dbus_geteuid): used to get the effective
- uid of the running program
- (_dbus_credentials_add_from_current_process): use geteuid instead of
- getuid
- (_dbus_append_user_from_current_process): use geteuid instead of
- getuid
-
- * dbus/dbus-sysdeps-util-unix.c (_dbus_change_to_daemon_user): use
- geteuid instead of getuid
- (_dbus_unix_user_is_at_console): use geteuid instead of getuid
-
- * dbus/dbus-sysdeps-win.c (_dbus_geteuid): add a windows equivilant
- that returns DBUS_UID_UNSET
-
-2007-12-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (_dbus_connection_block_pending_call):
- fix location of curly braces
-
-2007-11-23 Sjoerd Simons <sjoerd@luon.net>
-
- * tools/dbus-launch.c: let both a normal dbus-launch and an
- autolaunched bus save their parameters in X11 if possible. This makes
- the autolaunch and non-autolaunch behaviour more similar. With the
- exception that on a normal launch there will always be a new session
- bus and not being able to save parameters is not fatal. This also
- enables to launch programs directly with autolaunch (not very usefull
- though).
-
-2007-10-31 Havoc Pennington <hp@redhat.com>
-
- * bus/selinux.c (log_audit_callback): rewrite to use
- _dbus_string_copy_to_buffer_with_nul()
-
- * dbus/dbus-string.c (_dbus_string_copy_to_buffer): change to NOT
- nul-terminate the buffer; fail an assertion if there is not enough
- space in the target buffer. This fixes two bugs where
- copy_to_buffer was used to copy the binary bytes in a UUID, where
- nul termination did not make sense. Bug reported by David Castelow.
- (_dbus_string_copy_to_buffer_with_nul): new function that always
- nul-terminates the buffer, and fails an assertion if there is not
- enough space in the buffer.
-
-2007-10-23 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_new): use the new name here
-
- * bus/selinux.c (bus_selinux_audit_init): rename from audit_init()
- to avoid possible libc conflict, and declare it in .h file to
- avoid a warning
-
-2007-10-19 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_new): put audit_init() in HAVE_SELINUX
-
-2007-10-19 Havoc Pennington <hp@redhat.com>
-
- * bus/bus.c (bus_context_new): put the audit_init() in here
- instead, which I believe ends up being the same as where it was
- before, though I'm not sure I understand why it goes here.
-
- * dbus/dbus-sysdeps-util-unix.c (_dbus_change_to_daemon_user):
- remove audit_init() from here, this file can't depend on code in
- bus/ directory
-
-2007-10-16 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * configure.in: *Actually* fix detection of i486 atomic ops -
- my previous attempt at a fix would always enable them due to wrong
- quoting. Patch from Colin Walters <walters@verbum.org>
-
-2007-10-11 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * configure.in: enable Autoconf's AC_C_INLINE to avoid compilation
- failure with gcc -ansi
- * dbus/dbus-macros.h, dbus/dbus-arch-deps.h.in: Use new macro
- _DBUS_GNUC_EXTENSION (the same as G_GNUC_EXTENSION) to avoid -ansi
- warnings about use of "long long".
- * dbus/dbus-server-socket.c: remove unused variable when assertions
- are disabled
- * dbus/dbus-marshal-validate.c: avoid empty statements by removing
- stray semicolons
- * tools/dbus-launch.c: convert C++-style comment to C-style, add {}
- for clarity
- * .gitignore: ignore vi swapfiles
- * dbus/dbus-errors.h, dbus/dbus-errors.c: Add DBUS_ERROR_INIT macro,
- equivalent to calling dbus_error_init() on an uninitialized DBusError
- * dbus/dbus-address.c, dbus/dbus-auth-script.c, dbus/dbus-auth-util.c,
- dbus/dbus-connection.c, dbus/dbus-internals.c, dbus/dbus-keyring.c,
- dbus/dbus-message-util.c, dbus/dbus-server.c, dbus/dbus-sha.c,
- dbus/dbus-spawn-win.c, dbus/dbus-spawn.c,
- dbus/dbus-sysdeps-util-win.c, dbus/dbus-transport-socket.c,
- dbus/dbus-transport.c, dbus/dbus-userdb.c: use that macro instead of
- calling dbus_error_init() where it's clearly equivalent
- * configure.in, dbus/dbus-sysdeps.h, dbus/dbus-sysdeps-unix.c: Fix
- detection of i486 atomic ops. Previously, the attempts to determine
- support at compile-time on Darwin were causing the i486 atomic ops to
- be used on *all* i386 or x86-64 GCC builds (AH_VERBATIM can't be
- conditionalized like we were trying to).
-
-2007-10-10 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * dbus/dbus-errors.c, dbus/dbus-protocol.h: Add new error
- org.freedesktop.DBus.Error.ObjectPathInUse
- * dbus/dbus-object-tree.h, dbus/dbus-object-tree.c,
- dbus/dbus-connection.c, dbus/dbus-connection.h: add new functions
- dbus_connection_try_register_object_path and
- dbus_connection_try_register_fallback, which raise ObjectPathInUse
- rather than asserting, to make object path registration less painful
- for bindings
- * .gitignore: add various things that weren't in .cvsignore because
- CVS implicitly ignored them; generally bring up to date
-
-2007-10-09 John (J5) Palmieri <johnp@redhat.com>
-
- * tools/run-with-tmp-session-bus.sh: Fix env exports for better
- portability (#9280)
- * tools/dbus-send.1: Document syntax for container types in dbus-send
- man file (#9553) - patch from Jack Spaar <jspaar at
- users.sourceforge.net>
-
- [Both OK for MIT/X11 relicensing -smcv]
-
-2007-10-09 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * doc/dbus-specification.xml: Specifically forbid empty structs (#7969)
- * doc/dbus-specification.xml: Patches from Kristoffer Lundén to clarify
- description of DBUS_COOKIE_SHA1 (#10184) and allowable contents of a
- variant (#10185, amended as per Havoc's comments)
-
- [All of the above are OK for MIT/X11 licensing]
-
-2007-10-03 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-internals.h: fd.o bug #11678 Don't error out if compiler
- does not support vararg macros. _dbus_verbose is the only function
- that does this so make it a noop if vararg macros are not supported
- * bus/selinux.c, dbus/dbus-sysdeps-util-unix.c: fd.o bug #12429
- Reverse check to setpcap and only init audit if we were root
- (patch by Dan Walsh <dwalsh@redhat.com>,
- https://bugs.freedesktop.org/show_bug.cgi?id=12429). Reverse
- we_were_root check to setpcap if we were root. Also only init audit
- if we were root. So error dbus message will not show up when policy
- reload happens. dbus -session will no longer try to send audit
- message, only system will.
- * configure.in: fd.o bug #11872 improve linker test for --gc-sections.
- Patch by Tim Mooney <enchanter at users.sourceforge.net>
- * configure.in, dbus/dbus-sysdeps.c: fd.o bug #11872 fix clearenv for
- systems that do not have it. Patch from Brian Cameron <brian.cameron
- at sun.com>
- * tools/dbus-launch.c: fd.o bug #12547 remove superfluous if.
- Also convert tabs to spaces
- * configure.in, bus/Makefile.am, dbus/Makefile.am: Correctly implement
- -fPIC and -fPIE. For security reasons we want possition independent
- code for libraries and possition independent executable for
- executables. Before we were just enabling -fPIC. Now we correctly
- enable -fPIC and -PIE for libdbus and the bus respectively. Proper
- LD_FLAGS are set for each also.
-
-2007-09-20 Ryan Lortie <desrt@desrt.ca>
-
- Add argument path matching support. Bug #11066.
-
- * dbus/signals.c (struct DBusMatchRule, bus_match_rule_new,
- bus_match_rule_set_arg, bus_match_rule_parse_arg_match,
- match_rule_matches): Add support for parsing and matching on
- arg0path='/some/path' type rules.
-
- * dbus/signals.h (bus_match_rule_set_arg): change to take const
- DBusString instead of const char * for the string to match against.
-
- * dbus/dbus-bus.c: add a quick note to dbus_bus_add_match
- documentation about the path matching.
-
- * doc/dbus-specification.xml: add a more detailed description of the
- changes here.
-
-2007-09-19 Ryan Lortie <desrt@desrt.ca>
-
- Add support for compacting DBusStrings to release wasted memory.
-
- * dbus/dbus-string.[ch] (compact, _dbus_string_compact,
- _dbus_string_lock): new compact function to free up allocated memory
- that is no longer used.
-
- * dbus/dbus-message.c (load_message): call _dbus_string_compact on the
- message loader buffer.
-
- * dbus/dbus-transport-socket.c (do_reading, do_writing): call
- _dbus_string_compact on the incoming/outgoing "encoded" buffers.
-
- * dbus/dbus-string-util.c (_dbus_string_test): add a few tests for
- string compacting.
-
-2007-09-13 Ryan Lortie <desrt@desrt.ca>
-
- * HACKING: add more explicit git branch/tag instructions
-
-2007-09-13 Ryan Lortie <desrt@desrt.ca>
-
- migrate from cvs to git (cvs2svn -> git-svnimport).
-
- * HACKING: update release/branch/tag instructions
- * */.cvsignore: rename to .gitignore
-
- also, clean up tags and branch names to conform to HACKING
-
-2007-08-17 William Jon McCann <mccann@jhu.edu>
-
- * update-dbus-docs.sh: upload DTD to server
-
-2007-08-17 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-launch-x11.c (set_address_in_x11): fix from Michael
- Lorenz to use long not int with XChangeProperty format 32
-
- * dbus/dbus-sysdeps-util-unix.c
- (_dbus_write_pid_to_file_and_pipe): factor this out, and use the
- same code in _dbus_become_daemon (where the parent writes the pid
- file and to the pid pipe) and in bus_context_new (where the daemon
- writes its own pid file and to its own pid pipe)
-
- * bus/bus.c (bus_context_new): close the pid pipe after we print
- to it. Also, don't write the pid to the pipe twice when we fork,
- someone reported this bug a long time ago.
-
-2007-08-03 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add major/minor/micro version number AC_SUBST
-
- * dbus/dbus-arch-deps.h.in (DBUS_MAJOR_VERSION,
- DBUS_MINOR_VERSION, DBUS_MICRO_VERSION, DBUS_VERSION_STRING,
- DBUS_VERSION): collection of macros to get version of library we
- are compiled against.
-
- * dbus/dbus-misc.c (dbus_get_version): new function, to get
- version of library we are linked against at runtime.
-
-2007-07-30 Havoc Pennington <hp@redhat.com>
-
- * bus/activation-helper.c (check_bus_name): don't use
- _dbus_check_valid_bus_name() which is only around with
- --enable-checks, instead use _dbus_validate_bus_name().
- Bug #11766 from Diego <diego@pemas.net>
-
-2007-07-27 Havoc Pennington <hp@redhat.com>
-
- * configure.in: post-release version bump
-
-2007-07-27 Havoc Pennington <hp@redhat.com>
-
- * release 1.1.2
-
-2007-07-26 Havoc Pennington <hp@redhat.com>
-
- * bus/config-parser-trivial.c (check_return_values): disable a
- test that hardcoded the bus user's name
-
- * bus/dispatch.c (bus_dispatch_test_conf): remove the "if
- (!use_launcher)" around the tests, they were only failing because
- we didn't pass through all the expected errors from the helper.
-
- * bus/activation-exit-codes.h
- (BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting
- (BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic
- failure code, so if a third party launch helper were written it
- could just always return 1 on failure.
-
-2007-07-24 Daniel P. Berrange <dan@berrange.com>
-
- * bus/dbus-daemon.1: Add docs on new syntax options for the bus
- address strings
-
- * dbus/dbus-address.c: Allow * in addresses (for binding to all
- addresses).
-
- * dbus/dbus-sysdeps.h:
- * dbus/dbus-sysdeps-unix.c: Re-write to use getaddrinfo instead
- of gethostbyname to enable protocol independant name lookup,
- making IPv6 work
-
- * dbus/dbus-server-socket.h:
- * dbus/dbus-server-socket.c: Add support for 'family' in the
- address string to specify ipv4 vs ipv6. Use a port string to
- allow for service resolution. Allow for binding to multiple
- sockets at once in case of dual IPv4 & IPv6 stacks.
-
- * dbus/dbus-server-unix.c: Pass in an array of file descriptors
- instead of a single one.
-
- * dbus/dbus-transport-socket.h:
- * dbus/dbus-transport-socket.c: Add support for 'family' in the
- address string to specify ipv4 vs ipv6. Use a port string to
- allow for service resolution.
-
-2007-07-24 Havoc Pennington <hp@redhat.com>
-
- * configure.in: add AM_PROG_CC_C_O to allow per-target CPPFLAGS
-
- * bus/dispatch.c (bus_dispatch_test_conf): Fix up setting
- TEST_LAUNCH_HELPER_CONFIG to include the full path, and enable
- test shell_fail_service_auto_start when use_launcher==TRUE
-
- * bus/activation-helper-bin.c (convert_error_to_exit_code): pass
- through the INVALID_ARGS error so the test suite works
-
- * bus/activation.c (handle_activation_exit_error): return
- DBUS_ERROR_NO_MEMORY if we get BUS_SPAWN_EXIT_CODE_NO_MEMORY
-
- * dbus/dbus-spawn.c (_dbus_babysitter_get_child_exit_status):
- return only the exit code of the child, not the entire thingy from
- waitpid(), and make the return value indicate whether the child
- exited normally (with a status code)
-
- * bus/bus.c (process_config_first_time_only): _dbus_strdup works
- on NULL so no need to check
- (process_config_every_time): move servicehelper init here, so we
- reload it on HUP or config file change
-
- * bus/Makefile.am (install-data-hook): remove comment because
- Emacs make mode seems to be grumpy about it
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/Makefile.am:
- * bus/test-system.c: (die), (check_memleaks), (test_pre_hook),
- (test_post_hook), (main):
- Add back the test-system.c file - not sure now this got ignored in the
- diff. I blame git.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * configure.in:
- Use ustar to generate the tarball; this fixes the make distcheck
- problem when the data files do not fit in the archive:
- tar: dbus-1.1.2/test/data/valid-service-files/org.freedesktop.DBus.
- TestSuiteShellEchoServiceFail.service.in: file name is too
- long (max 99); not dumped
-
- We have to have the 'long' names as the service helper matches by
- filename rather than by the name in the service file.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * configure.in:
- * test/Makefile.am:
- * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
- uiteNoExec.service.in:
- * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
- uiteNoService.service.in:
- * test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
- uiteNoUser.service.in:
- * test/data/valid-config-files-system/debug-allow-all-fail.conf.in:
- * test/data/valid-config-files-system/debug-allow-all-pass.conf.in:
- * test/data/valid-config-files/debug-allow-all-sha1.conf.in:
- * test/data/valid-config-files/debug-allow-all.conf.in:
- * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
- teEchoService.service.in:
- * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
- teSegfaultService.service.in:
- * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
- teShellEchoServiceFail.service.in:
- * test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
- teShellEchoServiceSuccess.service.in:
- * test/data/valid-service-files/debug-echo.service.in:
- * test/data/valid-service-files/debug-segfault.service.in:
- * test/data/valid-service-files/debug-shell-echo-fail.service.in:
- * test/data/valid-service-files/debug-shell-echo-success.service.in:
- * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoS
- ervice.service.in:
- * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfa
- ultService.service.in:
- * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell
- EchoServiceFail.service.in:
- * test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell
- EchoServiceSuccess.service.in:
- Add the data files needed by the system activation unit checks.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/dispatch.c: (check_segfault_service_no_auto_start),
- (check_launch_service_file_missing),
- (check_launch_service_user_missing),
- (check_launch_service_exec_missing),
- (check_launch_service_service_missing), (bus_dispatch_test_conf),
- (bus_dispatch_test_conf_fail), (bus_dispatch_test):
- Add unit tests for system activation. Most are copied from the
- session activation tests, but some didn't apply when using a laucher.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation.c: (bus_activation_activate_service):
- If the bus uses a service-laucher, then use the setuid laucher.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * configure.in:
- Add the needed library exports for the new laucher.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * configure.in:
- Check for -Wl,--gc-sections so we can really reduce the size of the
- setuid binary.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation.c: (handle_activation_exit_error),
- (babysitter_watch_callback):
- Map the child exit status integer to a proper dbus error.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/bus.c: (process_config_first_time_only),
- (process_config_every_time), (bus_context_unref),
- (bus_context_get_servicehelper):
- * bus/bus.h:
- Add the concept of a service-helper and allow it's value to be read.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation.c: (bus_activation_entry_unref),
- (update_desktop_file_entry):
- Add the concept of, and read the value of user from the desktop file.
- The user string is not required unless we are using system activation.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation.c:
- * bus/desktop-file.h:
- Move the defines into the header file, as we use these in the lauch
- helper as well as the desktop file parsing.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/.cvsignore:
- Add the autogenerated binary files.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/Makefile.am:
- * bus/test.h:
- Add the build glue for the lauch helper, and also add the launch-helper
- OOM checks into make check. I've probably broken the build, give me 2.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/test-launch-helper.c: (die), (check_memleaks),
- (test_post_hook), (bus_activation_helper_oom_test), (main):
- Add a test wrapper to allow OOM checks on the launch helper.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation-helper-bin.c: (convert_error_to_exit_code),
- (main):
- * bus/activation-helper.c: (desktop_file_for_name),
- (clear_environment), (check_permissions), (check_service_name),
- (get_parameters_for_service), (switch_user),
- (exec_for_correct_user), (check_bus_name), (get_correct_parser),
- (launch_bus_name), (check_dbus_user), (run_launch_helper):
- * bus/activation-helper.h:
- Add the initial launch-helper. This is split into a main section and a
- binary loader that allows us to lauch the main section in another test
- harness to do stuff like OOM testing. No build glue yet.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/Makefile.am:
- * bus/config-parser.c: (bus_config_parser_unref),
- (start_busconfig_child), (bus_config_parser_end_element),
- (servicehelper_path), (bus_config_parser_content),
- (bus_config_parser_finished),
- (bus_config_parser_get_servicehelper),
- (test_default_session_servicedirs),
- (test_default_system_servicedirs), (bus_config_parser_test):
- * bus/config-parser.h:
- Make the config-parser code use the common config code.
- Also add the session and systemdirs stuff, and make the config parser
- aware of the servicehelper field.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/system.conf.in:
- Add new servicehelper fields to the default system.conf file.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/config-parser-trivial.c: (service_dirs_find_dir),
- (service_dirs_append_link_unique_or_free), (bus_config_parser_new),
- (bus_config_parser_unref), (bus_config_parser_start_element),
- (bus_config_parser_end_element), (bus_config_parser_content),
- (bus_config_parser_finished), (bus_config_parser_get_user),
- (bus_config_parser_get_type), (bus_config_parser_get_service_dirs),
- (check_return_values), (do_load), (check_loader_oom_func),
- (process_test_valid_subdir), (make_full_path), (check_file_valid),
- (bus_config_parser_trivial_test):
- * bus/config-parser-trivial.h:
- Add a security sensitive stripped down config parser for the setuid
- launcher. This file only reads what it needs, and doesn't try to do
- anything remotely clever like including external files.
- It is not intended to validate the config file; it is expected that
- config-parser will do that before the setuid program tries to read it.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/config-parser-common.c:
- (bus_config_parser_element_name_to_type),
- (bus_config_parser_element_type_to_name):
- * bus/config-parser-common.h:
- We don't want to run the whole config parser with all it's deps in the
- setuid program. We need to implement a stripped down config parser just
- for the launcher, and to do so I need some common functions and
- defines; add them here.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * dbus/dbus-sysdeps-unix.c:
- (_dbus_get_standard_system_servicedirs):
- * dbus/dbus-sysdeps-win.c:
- Provide a way to get the standard system servicedirs, just like we do
- for the session service dirs. These should be seporate, as there may
- be a security issue starting up some session stuff as root.
- The use-case for the same binary starting up per-system _and_
- per-session is also not valid.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/dbus-daemon.1.in:
- Add standard_system_servicedirs and servicehelper into the man file
- and explain what each does.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * doc/busconfig.dtd:
- Add servicehelper into the dtd, it will soon be a valid part of the
- config file.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * dbus/dbus-spawn.c: (read_data),
- (_dbus_babysitter_get_child_exit_status):
- * dbus/dbus-spawn.h:
- Add a function so we can get access to the exit status of the launch
- helper.
- By providing the return code and not the error we can leave the
- 'what does this mean?' to the bus launch code and not include it in the
- dbus directory.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * bus/activation-exit-codes.h:
- Add defines which specify the output codes of the launch helper.
- We have to use exit codes as this is the only way we can return failure
- type without going grotty things like redirecting possibly-nonsecure
- stderr into the error.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * dbus/dbus-protocol.h:
- Add new error names needed for the launch helper.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * dbus/dbus-sysdeps.c: (_dbus_clearenv):
- * dbus/dbus-sysdeps.h:
- Add a wrapper for clearenv.
-
-2007-07-24 Richard Hughes <richard@hughsie.com>
-
- * doc/system-activation.txt:
- Add design document for the system activation parts. I'll shortly be
- committing many patches that add system activation using a setuid
- launcher into CVS, so expect things to be broken for a few hours.
-
-2007-07-19 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/modules/FindKDEWIN.cmake: fixed comment
- * cmake/modules/FindKDEWIN32.cmake: removed obsolate cmake module
-
-2007-07-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_get_cached)
- (dbus_message_cache_or_finalize): don't mess with message from
- message cache outside of the cache lock. Bug #9164 from Jonathan
- Matthew.
-
-2007-07-13 Havoc Pennington <hp@redhat.com>
-
- * Add indent-tabs-mode: nil to all file headers.
-
-2007-07-12 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): invert the test
- for parsing hex as double to be sure it fails to work
-
- * dbus/dbus-sysdeps.c (_dbus_string_parse_double): don't allow hex numbers.
-
-2007-07-10 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-connection.c (struct DBusConnection): Fix from Olivier
- Hochreutiner to avoid trying to protect individual bits in a word
- with different locks (make dispatch_acquired and io_path_acquired
- dbus_bool_t rather than bitfields)
-
-2007-07-09 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c,dbus-sysdeps-win.h,dbus-sysdeps-win-util.c,
- dbus-sysdeps-spawn-win.c: synced with windbus sources
-
-2007-07-07 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c
- (_dbus_getsid): remove unused jump label
- (_dbus_read_credentials_socket): _dbus_string_init could fail,
- check initialisation
- (_dbus_get_working_dir, _dbus_init_working_dir): remove unused
- functions
-
-2007-07-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/modules/FindKDEWIN.cmake: search in <program files dir>\win32libs
- for windows supplementary packages too
-
-2007-06-30 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/dbus/CMakeLists.txt: handle userdb as unix file
-
-2007-06-30 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c,dbus/dbus-sysdeps-win.h: removed obsolate
- DBusUserInfo code
-
-2007-06-30 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_daemon_init): reduced compiler warnings
-
-2007-06-23 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and
- WIN_ONLY commands for auth scripts
- * test/data/auth/external-root.auth-script: limit execution to unix
-
-2007-06-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-tranport.c (auth_via_default_rules): made the verbose spam
- cross-platform
-
-2007-06-21 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-watch.c (dbus_watch_get_fd): 1) its behavior should
- not be the same as before, the ABI has never been declared stable
- on Windows and 2) do not commit to cross-platform files without
- posting the exact patch to the mailing list
-
- * dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): as I have pointed
- out before, either 0xff needs to work on both platforms, or none
- of the dbus code can rely on it working. That means the options
- are 1) audit the code for anywhere that relies on 0xff working, if
- none found ideally add a test that it *doesn't* work and make unix
- reject it explicitly, but in any case this test would go away or
- 2) make it work on Windows also, then we don't have to figure out
- whether we rely on it.
-
- And in either case, post the exact patch to the mailing list and
- don't just commit.
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/CMakeLists.txt: added VERSION_PATCH to be able to
- distinguish win32 binary release from dbus versioning
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c: deleted local DBusCredentials structure
- (_dbus_getsid): new function
- (_dbus_read_credentials_socket): used correct function
- (_dbus_append_user_from_current_process,
- _dbus_credentials_add_from_current_process): added real
- sid reading
- (_dbus_credentials_parse_and_add_desired,_dbus_parse_uid):
- deleted
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): don't check
- 0xff as floating point, this isn't supported on win32 math
- implementation
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_homedir_from_username,
- _dbus_homedir_from_current_process, _dbus_append_desired_identity):
- removed obsolate functions
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c, dbus/dbus-sysdeps-util-win.c,
- dbus/dbus-sysdeps-win.h: disabled uid/sid conversation stuff
- implementation by Peter Kuemmel
-
-2007-06-21 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-watch.c (dbus_watch_get_fd): this function is
- deprecated and its behavior should be as before until all
- client code is migrated.
-
-2007-06-19 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-util-win.c, tools/dbus-launch-win.c:
- msvc7.1 fixes by Jaroslaw Staniek tested with mingw
-
-2007-06-19 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c, dbus/dbus-sysdeps-spawn-win.c,
- dbus/dbus-sysdeps-win.h: disabled DBusSocket implementation
- by Peter Kuemmel
-
-2007-06-18 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: removed obsolate patches
-
-2007-06-18 Havoc Pennington <hp@redhat.com>
-
- * configure.in: bump version to 1.1.2 so CVS is higher than last
- release (this is not the 1.1.2 release)
-
-2007-06-18 Havoc Pennington <hp@redhat.com>
-
- * Release 1.1.1
-
-2007-06-18 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: document org.freedesktop.DBus.GetId()
-
- * bus/driver.c (bus_driver_handle_get_id): implement org.freedesktop.DBus.GetId()
-
- * bus/bus.c (bus_context_new): generate a unique ID for each bus context
-
- * dbus/dbus-connection.c (dbus_connection_get_server_id): new function
-
- * dbus/dbus-bus.c (dbus_bus_get_id): new function
-
- * dbus/dbus-server.c (dbus_server_get_id): new function
-
-2007-06-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c (_dbus_read_credentials_socket): clean
- this up a little bit, to try and understand why telnet'ing to a
- server and sending a non-nul byte didn't disconnect immediately;
- now it seems that it does disconnect immediately as it should,
- though I don't understand what has changed.
-
-2007-06-18 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-watch.c (dbus_watch_get_socket)
- (dbus_watch_get_unix_fd): new API to match DBusConnection
- (dbus_watch_get_fd): deprecate this
-
- Throughout: just s/dbus_watch_get_fd/dbus_watch_get_socket/g for
- now since all the transports use sockets anyway
-
-2007-06-16 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-macros.h, dbus/dbus-message.c,
- dbus/dbus-message.h: renamed DBUS_GNUC_DEPRECATED
- to DBUS_DEPRECATED and extended to msvc compiler
-
-2007-06-15 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/CMakeLists.txt: use local include header first
-
- * dbus/dbus-sysdeps-win.c: mingw fix of DBusCredential struct
-
-2007-06-15 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/ConfigureChecks.cmake,cmake/config.h.cmake:
- added check for HAVE_ERRNO_H
-
- * cmake/dbus/CMakeLists.txt: added missing files
-
- * dbus/dbus-transport-win.c/.h: new files
-
- * dbus/dbus-sysdeps-win.c,.h: added required _unix functions
- to make dbus compilable on win32
-
- * dbus/dbus-sysdeps-win-utils.c,.h: moved some functions to
- dbus-sysdeps-win.c
-
- * dbus-win.patch: removed applied or obsolate patches
-
- Note: dbus-win32 is now compilable, no guarantee that it runs
- without any problems
-
-2007-06-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c (_dbus_append_session_config_file)
- (_dbus_append_system_config_file): new functions
-
- * bus/main.c (main): use _dbus_append_system_config_file() and
- _dbus_append_session_config_file()
-
- * dbus/Makefile.am (INCLUDES): move DBUS_SYSTEM_CONFIG_FILE and
- DBUS_SESSION_CONFIG_FILE into this makefile
-
-2007-06-15 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero)
- (_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr)
- (_dbus_strerror_from_errno): family of functions to abstract
- errno, though these are somewhat bogus (really we should make our
- socket wrappers not use errno probably - the issue is that any
- usage of errno that isn't socket-related probably is not
- cross-platform, so should either be in a unix-only file that can
- use errno directly, or is a bug - these general errno wrappers
- hide issues of this nature in non-socket code, while
- socket-specific API changes would not since sockets are allowed
- cross-platform)
-
-2007-06-14 Havoc Pennington <hp@redhat.com>
-
- * bus/dispatch.c (check_get_connection_unix_process_id): mop up
- getpid() (noticed by Peter Kümmel) and adapt the test to
- expect a "pid unknown" error when running on Windows.
-
-2007-06-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c (_dbus_credentials_parse_and_add_user):
- delete this function since it was effectively the same as
- _dbus_credentials_add_from_username()
-
-2007-06-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-auth.c: adapt to keyring changes
-
- * dbus/dbus-keyring.c: change to avoid using user ID and home
- directory directly; instead use a
- keyring-location-from-credentials function in dbus-sysdeps
-
- * fix to use _dbus_append_user_from_current_process() instead of
- _dbus_username_from_current_process() or _dbus_append_desired_identity().
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * reverted global rename of function _dbus_username_from_current_process.
- It needs too much tests to verify that the change does not break anything.
- I had overseen that the signatures are different and requires non
- trivial changes.
- This is one *major* disadvantage of emulating oop functionality with c.
- You are responsible for cleaning every object on every function return point
- which could be a nightmare if you are not working with dbus all the days.
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-auth.c (handle_client_initial_response_cookie_sha1_mech):
- fixed usage of _dbus_append_desired_identity()
-
- * dbus/dbus-sysdeps.h (_dbus_username_from_current_process): removed prototype
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps.c: moved global lock system_users from dbus-userdb.c
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * global rename of function _dbus_username_from_current_process
- to _dbus_append_desired_identity.
- Approved by Havoc Pennington
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c: disabled DBusUserInfo related code
- (_dbus_append_desired_identity, _dbus_windows_user_is_process_owner):
- new win32 functions as counterpart of unix related
- (_dbus_send_credentials_socket,_dbus_read_credentials_socket):
- renamed from ..._unix_socket
- (_dbus_send_credentials_unix_socket): removed obsolate function
-
- * dbus/dbus-sysdeps-win-util.c: disabled DBusGroupInfo related code
- (_dbus_verify_daemon_user,_dbus_change_to_daemon_user):
- new win32 functions as counterpart of unix related
-
-2007-06-14 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * doc/dbus-specification.xml: say the protocol version is 1 instead of
- 0 (patch from Kristoffer Lundén, fd.o#10033) and remove the FIXME
- about removing protocol version from messages (as per Havoc's comment
- on that bug)
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_pid_for_log,_dbus_flush_caches):
- new win32 functions as counterpart of unix related
-
-2007-06-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/modules/FindKDEWIN.cmake,
- cmake/modules/FindKDEWIN_Packager.cmake,
- cmake/modules/Win32Macros.cmake: new files from the
- kdewin32 project
- * cmake/CMakeLists.txt: cleaned support for kdewin installer and
- win32 explorer wrapper
-
-2007-06-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_iter_open_container): Fix
- broken return_if_fail (kind of scary that test suite does not
- cover this)
-
-2007-06-13 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-server-socket.c (_dbus_server_listen_socket): support
- all_interfaces=true|false for tcp servers
-
- * dbus/dbus-sysdeps-unix.c (_dbus_listen_tcp_socket): support
- inaddr_any flag
-
- * bus/selinux.c: fix some missing includes
-
- * dbus/dbus-server-socket.c (_dbus_server_listen_socket): allow
- port to simply be omitted in addition to specifying 0
-
-2007-06-13 Havoc Pennington <hp@redhat.com>
-
- * configure.ac, bus/selinux.c, dbus/dbus-sysdeps-unix-util.c: add
- libaudit support, no clue what this means really but now we have
- it. Patches from Fedora package.
-
- * bus/bus.c (bus_context_new): move selinux initialization after
- changing to daemon user, patch from Fedora package
-
- * dbus/dbus-transport.c (auth_via_unix_user_function): fix a typo
-
-2007-06-12 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c (dbus_message_iter_open_container): improve
- the checks/warnings for contained_signature a bit
-
-2007-06-12 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-marshal-recursive.c (write_or_verify_typecode):
- improve the warning a bit if you write extra data into a message
-
-2007-06-12 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-auth.c (sha1_handle_second_client_response)
- (handle_server_data_anonymous_mech): add the process ID from
- socket credentials, if available, even if not using EXTERNAL
-
- * dbus/dbus-transport.c (auth_via_default_rules): support
- allow_anonymous flag
-
- * dbus/dbus-connection.c (dbus_connection_get_is_anonymous)
- (dbus_connection_set_allow_anonymous): new API for controlling
- anonymous access
-
-2007-06-09 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-string.c (_dbus_string_pop_line): fix this not to
- think an empty line is the end of the file.
- Also, fix some whitespace.
-
- * dbus/dbus-string-util.c: add more tests for
- _dbus_string_pop_line() revealing that it thinks an empty line is
- the end of the file, which broke dbus-auth-script.c so
- it didn't really run the scripts
-
- * dbus/dbus-auth.c: add ANONYMOUS mechanism
-
- * dbus/dbus-auth-script.c (_dbus_auth_script_run): fix to detect
- an empty/no-op auth script; add commands to check that we have or
- don't have the expected credentials
-
-2007-06-09 Havoc Pennington <hp@redhat.com>
-
- * bus/policy.c (bus_policy_create_client_policy): gracefully
- continue if the connection has no unix user - just don't apply
- any unix user dependent rules.
-
- * bus/config-parser.c: remove dbus-userdb.h usage
-
- * bus/bus.c: remove dbus-userdb.h usage
-
- * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
- support Windows user function; also, fix the logic for checking
- auth as root in the default auth code (broken in the previous
- commit)
-
- * dbus/dbus-connection.c
- (dbus_connection_set_windows_user_function): new function
- (dbus_connection_get_windows_user): new function
-
-2007-06-09 Havoc Pennington <hp@redhat.com>
-
- * bus/dispatch.c (check_get_connection_unix_process_id): adapt
- since sysdeps-unix.h stuff isn't included anymore
-
- * bus/bus.c (bus_context_new): use more abstract functions to
- change user, so they can be no-ops on Windows
-
- * dbus/dbus-credentials.c, dbus/dbus-credentials.h,
- dbus/dbus-credentials-util.c: new files containing a fully opaque
- DBusCredentials data type to replace the old not opaque one.
-
- * configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on
- windows
-
- * dbus/dbus-userdb.h: prohibit on Windows, next step is to clean
- up the uses of it in bus/*.c and factor out the parts of
- cookie auth that depend on it
-
-2007-06-07 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-message.c: improve some docs related to reading values
- from a message iter
-
-2007-06-02 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake: added cygwin compile support
-
-2007-06-01 Ralf Habacker <ralf.habacker@freenet.de>
-
- * tools/dbus-launch-win.c: new file, replaces script wrapper on win32.
-
- * cmake/dbus-launch.bat.cmake: removed obsolate file
-
-2007-05-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/main.c (main): uses _dbus_get_config_file_name() to detect
- session.conf location on win32.
-
- * dbus-sysdeps-win.h (_dbus_get_config_file_name,_dbus_file_exists):
- new prototyp, undefined interface after including windows.h because
- it makes trouble when a paramater is named interface.
-
- * dbus-sysdeps-win.c (_dbus_get_install_root,
- _dbus_get_config_file_name,_dbus_file_exists): new functions.
-
-2007-05-27 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/policy.c,dbus/dbus-internals.c: fixed inconsistant line endings
- as reported by Peter Kümmel.
-
-2007-05-25 John (J5) Palmieri <johnp@redhat.com>
-
- * Released 1.1.0
-
-2007-05-25 John (J5) Palmieri <johnp@redhat.com>
-
- * Split NEWS and ChangeLog into a .pre-1-0 file as per HACKING
- We forgot to do this during the 1.0 release and it makes sense
- now as we get ready to release the first 1.1.0 development tarball
-
-2007-05-25 John (J5) Palmieri <johnp@redhat.com>
-
- * create directory test/data/valid-config-files/session.d so that
- make check passes
-
-2007-05-25 John (J5) Palmieri <johnp@redhat.com>
-
- * INSTALL: remove dependancies for bindings since they no longer
- are a part of core
-
-2007-05-25 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-server-win.c,dbus/dbus-server-win.h: new file
- with empty function _dbus_server_listen_platform_specific().
-
- * dbus/dbus-server.c (listen_funcs): uses
- _dbus_server_listen_platform_specific on any platform.
-
-2007-05-25 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (fill_win_user_info_homedir): not getting
- user info from a domain controller isn't an error, the computer
- may run in a non domain context.
-
-2007-05-25 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_full_duplex_pipe): fixed assertation.
-
-2007-05-24 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * bus/config-parser.c (test_service_dir_matches): fixed ordering for unix.
-
- * bus/config-parser.c (test_default_session_servicedirs): made allocation
- of _progs platform independent.
-
-2007-05-23 Havoc Pennington <hp@redhat.com>
-
- * bus/Makefile.am (install-data-hook): create session.d
-
- * bus/session.conf.in: add session.d for the session bus, so
- security policy can be extended
-
-2007-05-22 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake/CMakeLists.txt: fixed creating of TEST_..._BINARY to make
- bus-test able to find the binaries.
-
-2007-05-21 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * acinclude.m4, configure.in: In recent autotools, ${datadir} is
- defined in terms of ${datarootdir}, so EXPANDED_DATADIR needs to be
- expanded recursively. Rather than fixing configure.in to do this, I
- grabbed the AS_AC_EXPAND macro from autostars.sf.net, which seems to be
- commonly used.
-
-2007-05-21 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * update-dbus-docs.sh: Assorted improvements:
- - Default user if $FDUSER is not set is the ssh default
- (set in ~/.ssh/config or based on the local username), not a
- hard-coded "johnp"
- - Temporary checkout directory is created securely (preventing symlink
- attacks), if mktemp(1) is available
- - Use make -C rather than cd && make && cd ..
-
-2007-05-21 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * HACKING: Point to correct mailing list
-
-2007-05-21 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * doc/dbus-specification.xml: explicitly specify that STRING cannot
- contain embedded NULs.
-
-2007-05-20 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-internal.c: fix inline problem on win32.
-
-2007-05-20 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (fill_win_user_info_homedir): not reaching
- domain controller isn't an error, converted error message to verbose
- message.
-
-2007-05-19 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): disabled
- tests not running on wince.
-
-2007-05-19 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-internals.c (_dbus_verbose_init): win32 requires 'varname='
- to unset a environment variable.
-
-2007-05-19 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps.c (_dbus_setenv): win32 requires 'varname='
- to unset a environment variable.
-
-2007-05-19 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * bus/policy.c (bus_policy_create_client_policy):
- win32 temporary fix until the userdb stuff is ported completly.
-
-2007-05-19 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-server.c (listen_funcs):
- _dbus_server_listen_platform_specific is empty on win32,
- limited to unix only.
-
- * dbus/dbus-server.c (valid_addresses): limit unix
- only addresses to unix.
-
-2007-05-18 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-specification.xml: add a GetAll to the Properties
- interface.
-
-2007-05-17 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * bus\config-parser.c (test_default_session_servicedirs):
- win32 fix.
-
-2007-05-17 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * configure.in: define constant DBUS_UNIX.
-
-2007-05-14 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_printf_string_upper_bound):
- compile fix for MS Platform SDK 6
- patch from Michael Luschas <mluschas@gmail.com>
-
-2007-05-10 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus-1.pc.in: add daemondir to pc file
- patch from Brian Cameron <brian.cameron at sun.com>
-
-2007-05-04 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * doc/dbus-specification.xml: mention the reserved o.fd.DBus.Local
- interface and the corresponding /o/fd/DBus/Local object path;
- describe them as reserved and forbid using them in a sent message,
- mentioning that in the reference implementation this will cause the
- connection to be dropped. Patch approved by Havoc.
-
-2007-04-28 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/: don't install test applications and service files,
- moved CMAKE_DEBUG_POSTFIX to top level CMakeLists.txt
-
-2007-04-27 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-sysdeps-unix.c (_dbus_open_socket): fix #10781 from
- Tobias Nygren, checking pointer to fd vs. 0 rather than checking
- the fd itself
-
-2007-04-26 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/: added debug postfixes to debug exe's for
- easier debugging.
- * dbus\dbus-sysdeps-win.c (_dbus_win_set_error_from_win_error):
- print error code in case no string message is available.
-
-2007-04-06 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * dbus/dbus-message-util.c, dbus/dbus-message.c,
- dbus/dbus-message.h: Add API to convert a DBusMessage to/from a
- byte array. Patch from Dafydd Harries <dafydd.harries@collabora.co.uk>,
- approved by Havoc Pennington.
-
-2007-04-03 Timo Hoenig <thoenig@suse.de>
-
- * dbus/dbus-address.c (dbus_parse_address): Do not accept zero-
- length address.
- * dbus/dbus-address.c (_dbus_address_test): Add test for zero-
- length address.
-
-2007-03-25 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake/dbus/CMakeLists.txt: debug postfix also for mingw.
-
-2007-03-16 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake/modules/FindExpat.cmake: fix package detection on win32.
-
- * README.win: update install instructions.
-
-2007-03-16 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps.h (_dbus_split_paths_and_append):
- new prototyp
- (_DBUS_PATH_SEPARATOR): new macro.
-
- * dbus/dbus-sysdeps.c (_dbus_split_paths_and_append): merged
- from dbus/dbus-sysdeps-unix.c and dbus/dbus-sysdeps-win.c.
-
-2007-03-15 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * bus/config-parser.c, bus/policy.c,
- bus/policy.h, bus/dbus-daemon.1.in,
- bus/session.conf.in: added eavesdrop support
- for replies - patch by olli.salli at collabora.co.uk
- approved by Havoc Pennington.
-
-2007-03-15 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus\dbus-sysdeps-win-thread.c: renamed to
- dbus-sysdeps-thread-win.c, it is a platform depending file
- similar to dbus-sysdeps-pthread.c.
-
-2007-03-15 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake\doc\CMakeLists.txt: added prelimary xml doc
- support, needs cmake Find script.
-
-2007-03-14 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake: add doxygen support
-
-2007-03-14 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * cmake/config.h.cmake: WINCE fixes, defined DBUS_UNIX.
-
-2007-03-13 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-util-win.c (dbus_become_daemon):
- win32 compile fix.
-
-2007-03-13 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: removed obsolate patches.
-
-2007-03-13 Ralf.Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c: added zero byte sending
- and receiving after connection start up
-
-2007-03-11 Havoc Pennington <hp@redhat.com>
-
- * tools/dbus-launch.c (do_close_stderr): fix C89 problem and
- formatting problem
-
- * Mostly fix the DBusPipe mess.
- - put line break after function return types
- - put space before parens
- - do not pass structs around by value
- - don't use dbus_strerror after calling supposedly cross-platform
- api
- - don't name pipe variables "fd"
- - abstract special fd numbers like -1 and 1
-
-2007-03-12 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.h, dbus/dbus-sysdeps-win.c,
- dbus/dbus-sysdeps-util-win.c: renamed functions
- _dbus_xxx_file() to _dbus_file_xxx() to reflect
- struct name DBusFile.
-
-2007-03-12 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-util-unix.c (_dbus_become_daemon):
- fix _dbus_pid_fd check.
-
-2007-03-10 Ralf Habacker <ralf.habacker@freenet.de>
-
- * tools/dbus-print-message.c (print_message):
- added printing of the reply serial to method returns and
- errors, so you can actually figure out the message/reply
- pairs - patch by olli.salli at collabora.co.uk.
-
-2007-03-10 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: removed committed patches.
-
-2007-03-10 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/bus.c, bus/bus.h, bus/main.c, bus/test.c,
- dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-util-unix.c,
- dbus/dbus-sysdeps-util-win.c, dbus/dbus-sysdeps-win.c,
- dbus/dbus-sysdeps.h: renamed _dbus_xxx_pipe to _dbus_pipe_xxx,
- completed _dbus_pipe support.
-
-2007-03-10 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps.h (_dbus_listen_tcp_socket):
- changed type or port to pointer, because the port is given back.
-
- * dbus/dbus-server-socket.c (_dbus_server_new_for_tcp_socket):
- implemented returning tcp port. Skipping port parameter
- and non integer port values in config <listen> statement
- needs more effort.
-
- * dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-win.c
- (_dbus_listen_tcp_socket): return the real used tcp port.
-
- * bus/dbus-daemon.1.in: added <listen> tcp examples
-
-2007-03-09 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/config.h.cmake: win32 msvc bug fix
-
-2007-03-09 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/config.h.cmake: fixed DBUS_WINxx defines,
- using _WINCE does not work.
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: removed _dbus_write_pipe() patch, it is now
- committed.
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/bus.c, dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps.h:
- rename pipe related write() function calls to _dbus_write_pipe().
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: added bus/config-loader-libexpat.c patch,
- uses DBUS_WIN for alls win32 related #ifdefs,
- some minor cleanups
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: updated patch for bus/dispatch.c.
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch: dbus-connection.c (dbus_connection_get_unix_user,
- dbus_connection_get_unix_process_id): Let return them valid user id's,
- otherwise bus-test fails. How to replace on win32 ?.
-
- * dbus/dbus-sysdeps-win.c (fill_win_user_info_homedir):
- fix memory leak.
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win.c (_dbus_win_set_error_from_win_error):
- use dbus friendly error name.
- (fill_win_user_info_homedir): print user name in error case too.
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/ConfigureChecks.cmake: fixed socketpair check
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/dispatch.c: disabled segfault test on win32 for now
-
-2007-03-08 Ralf Habacker <ralf.habacker@freenet.de>
-
- * configure.in, cmake/ConfigureChecks.cmake: added check
- for setrlimit.
- * test/test-segfault.c: only include setrlimit stuff only
- when available.
-
-2007-03-07 Ralf Habacker <ralf.habacker@freenet.de>
-
- * test/test-segfault.c: unix compile fix.
- * dbus-win.patch: removed obsolate patches.
-
-2007-03-07 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/activation.c: removed obsolate include header.
- * test/test-segfault.c: win32 compile fix, rlimit
- isn't available on win32.
- * dbus-win.patch: removed some more patches, they
- are applied or obsolate
-
-2007-03-06 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus-win.patch: fixes unix listen problems, dbus-test
- now runs.
-
-2007-03-06 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake/dbus/CMakeLists.txt,cmake/bus/CMakeLists.txt,
- cmake/CMakeLists.txt: win32 compile fix
-
-2007-03-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-win.patch, README.win: added available win32
- patches from windbus project (http://sf.net/projects/windbus)
-
-2007-03-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * bus/activation.c: (bus_activation_activate_service):
- fixed call to _dbus_spawn_async_with_babysitter().
-
-2007-03-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-spawn.c,dbus/dbus-spawn.h (_dbus_spawn_async_with_babysitter):
- added environment pointer as function parameter, used on win32.
-
- * test/spawn-test.c: fixed call to above mentioned function.
-
-2007-03-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * configure.in,test/test-sleep-forever.c,test/test-names.c:
- added configure check for unistd.h.
-
-2007-03-04 Ralf Habacker <ralf.habacker@freenet.de>
-
- * test/Makefile.am: fixed test data copy problem in
- out of source build, when sources came from svn or cvs.
-
-2007-03-03 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/*-win.*,bus/*-win.*: added win32 platform related
- files. These files are only added to the cmake build system.
- The missing dbus-win.patch file will be added later.
-
-2007-03-03 Ralf Habacker <ralf.habacker@freenet.de>
-
- * cmake: new directory, contains cmake build support.
- See http://www.cmake.org for more informations.
- Currently only unix will be buildable because some
- win32 required files are still missing.
-
-2007-03-03 Thiago Macieira <thiago@kde.org>
-
- * dbus/dbus-sysdeps-unix.c: capture the dbus-launch stderr
- output and add it to the DBusError message we return.
-
- * tools/dbus-launch.1:
- * tools/dbus-launch.c: Add option --close-stderr to, well,
- close stderr before starting dbus-daemon.
-
-2007-01-31 Havoc Pennington <hp@redhat.com>
-
- * bus/dbus-daemon.1.in: write a section in the man page on running
- a test daemon for debugging purposes
-
-2007-01-26 Havoc Pennington <hp@redhat.com>
-
- * bus/session.conf.in: override all the default limits with much
- higher limits on the session bus, there is no reason the session
- bus should have low limits
-
- * bus/config-parser.c (bus_config_parser_new): increase default
- limits so they are less likely to be hit; in particular the max
- replies per connection was way too low
-
-2006-01-25 Simon McVittie <simon.mcvittie@collabora.co.uk>
-
- * doc/dbus-tutorial.xml: Replace Python section of tutorial with
- a pointer to the tutorial maintained as part of dbus-python
-
-2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-unix.c: unix compile fix, moved
- atomic_exchange_and_add() from dbus/dbus-sysdeps.c
- to here, it's used by _dbus_atomic_inc() and _dbus_atomic_dec().
-
-2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * tools/dbus-monitor.c: gettimeofday() is not available
- on windows so we have to provide our own. It's taken from
- lgpl'd kdewin32 package. - Patches from Christian Ehrlicher
-
-2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-unix.c: moved _dbus_atomic_inc/dec()
- from dbus/dbus-sysdeps.c, windows version of _dbus_atomic_inc/dec()
- is in dbus-sysdeps-win.c (not in this patch).
-
- * dbus/dbus-sysdeps.h: DBusAtomic::value is long on windows to fit
- with InterlockedInc/Decrement.
- - Patches from Christian Ehrlicher
-
-2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * tools/dbus-send.c, tools/dbus-monitor.c: win32 compile fix.
-
-2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-marshal-recursive.c (type DBusTypeReaderClass):
- fix mispaced const statement. - Patch from Peter Kümmel
-
-2006-12-19 Ray Strode <rstrode@redhat.com>
-
- * bus/bus.c (process_config_every_time):
- don't overwrite existing bus context activation object
- until after we've checked that the new activation is
- valid.
-
- * bus/main.c
- (signal_handler), (handle_reload_watch):
- don't call exit() on failure, instead make do and keep
- going.
- (close_reload_pipe): new function to turn off
- hangup-causes-config-reload behavior if an unexpected
- error occurs
-
-2006-12-13 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-sysdeps-win-thread.c (_dbus_condvar_wait_win32):
- correctness fix. - Patch from Christian Ehrlicher
-
-2006-12-13 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-internals.h: msvc also knows about __FUNCTION__,
- we should also use it. - Patch from Christian Ehrlicher
-
-2006-12-13 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus-sysdeps-util.c: added win32 related tests
-
-2006-12-12 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-string.c (_dbus_string_pop_line),
- bus/desktop-file.c (parse_section_start,
- parse_comment_or_blank,parse_key_value,): uses
- _dbus_string_find_eol() to support platform independent eol style.
-
-2006-12-12 Ralf Habacker <ralf.habacker@freenet.de>
-
- * dbus/dbus-string.[ch] (_dbus_string_find_eol): new function.
- * dbus/dbus-string-util.c (_dbus_string_test): added testcases for
- _dbus_string_find_eol().
- Approved by: Havoc Pennington.
-
-2006-12-12 Tim Dijkstra <tim@famdijkstra.org>
-
- * configure.in: Added switch to disable user_database caching.
-
- * dbus/dbus-userdb-util.c, dbus/dbus-userdb.c: Add ifdefs to
- be able disable user_dabase caching.
-
-2006-12-12 Tim Dijkstra <tim@famdijkstra.org>
-
- * bus/bus.c, bus/bus.h: Remove DBusUserDatabase from the BusContext
- struct. It is unnecessary we have a global one already. Also remove
- bus_context_get_user_database function, it is no longer needed.
- Flush the global database on reload.
-
- * dbus/dbus-userdb-util.c: Replace _dbus_user_database_get_groups
- with _dbus_groups_from_uid. It no longer needs a DBusUserDatabase.
-
- * dbus/dbus-userdb.c, dbus/dbus-userdb.h:
- Add _dbus_user_database_flush_system.
- Make more functions DBUS_USERDB_INCLUDES_PRIVATE.
- Small unrelated change in _dbus_is_a_number: change
- _dbus_string_parse_int to _dbus_string_parse_uint.
-
- * bus/connection.c: Change call to _dbus_user_database_get_groups to
- _dbus_groups_from_uid.
-
- * bus/policy.c, bus/policy.h: Change call to
- _dbus_user_database_get_groups to _dbus_groups_from_uid. Remove
- DBusUserDatabase from bus_policy_allow_user prototype, it no longer
- needs it.
-
-2006-12-12 John (J5) Palmieri <johnp@redhat.com>
-
- * bus/signal.c: Fix match_rule_equal errata
- (CVE-2006-6107 - Patch from Kimmo Hämäläinen
- <kimmo.hamalainen@nokia.com>)
-
-2006-11-19 Thiago Macieira <thiago@kde.org>
-
- * dbus/dbus-sysdeps-pthread.c (_dbus_pthread_mutex_lock,
- _dbus_pthread_condvar_wait,
- _dbus_pthread_condvar_wait_timeout): set pmutex->holder to
- pthread_self() after coming back from a conditional variable
- wait as well as in one codepath where it was forgotten.
- Approved by: Havoc Pennington.
-
-2006-11-17 Havoc Pennington <hp@redhat.com>
-
- * update-dbus-docs.sh: allow setting fd.org username via env
- variable. Make it run autogen with --enable-xml-docs=yes
- --enable-doxygen-docs=yes so configure will fail if the required
- tools are missing.
-
-2006-11-17 Havoc Pennington <hp@redhat.com>
-
- * doc/dbus-faq.xml: minor FAQ tweaks
-
-2006-11-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-misc.c, dbus/dbus-misc.h: Move
- dbus_get_local_machine_id() to its own file, no substantive
- changes. There are a couple other things we might want to add that
- are "misc" so moving out of dbus-connection.[hc] which is big
- enough already.
-
-2006-11-14 Havoc Pennington <hp@redhat.com>
-
- * dbus/dbus-internals.c (_dbus_generate_uuid): The spec said the
- UUID had the timestamp last, but the implementation had it first;
- move it to last since I think it's a tiny bit nicer (easier to
- compare at a glance, faster to sort, less code), and will not
- cause any practical compatibility problems. Also, always convert
- the timestamp to big endian.
-
- * doc/dbus-specification.xml: Clean up the docs on the UUID.
-
- * tools/dbus-uuidgen.1: more prominently say it is not suitable
- as a replacement for regular uuidgen/RFC4122.
-
-2006-11-14 John (J5) Palmieri <johnp@redhat.com>
-
- * dbus/dbus-threads.h: fix DBUS_THREAD_FUNCTIONS_ALL_MASK to have
- the correct value so we don't assert when initalizing recursive threads
-
- * test/name-test/test-thread-init.c: call dbus_threads_init_default
- instead of _dbus_threads_init_debug since it is more of a real world
- test
-
diff --git a/src/3rd_party/dbus-1.7.8/Doxyfile.in b/src/3rd_party/dbus-1.7.8/Doxyfile.in
deleted file mode 100644
index f0a37eda14..0000000000
--- a/src/3rd_party/dbus-1.7.8/Doxyfile.in
+++ /dev/null
@@ -1,180 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = D-Bus
-PROJECT_NUMBER = @VERSION@
-OUTPUT_DIRECTORY = doc/api
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = YES
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = YES
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = @top_srcdir@/dbus
-FILE_PATTERNS = *.c *.h
-RECURSIVE = YES
-#EXCLUDE = test
-
-# 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.
-
-EXCLUDE_PATTERNS = Makefile.* ChangeLog CHANGES CHANGES.* README \
- README.* *.png AUTHORS DESIGN DESIGN.* *.desktop \
- DESKTOP* COMMENTS HOWTO magic NOTES TODO THANKS
-
-# 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 =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT =
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = YES
-MAN_OUTPUT = man
-MAN_EXTENSION = .3dbus
-MAN_LINKS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED = "DBUS_BEGIN_DECLS=" \
- "DBUS_END_DECLS=" \
- "DOXYGEN_SHOULD_SKIP_THIS" \
- "DBUS_GNUC_DEPRECATED=" \
- "_DBUS_GNUC_PRINTF(from,to)="
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 640
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/src/3rd_party/dbus-1.7.8/HACKING b/src/3rd_party/dbus-1.7.8/HACKING
deleted file mode 100644
index 805fd2e00d..0000000000
--- a/src/3rd_party/dbus-1.7.8/HACKING
+++ /dev/null
@@ -1,351 +0,0 @@
-The guidelines in this file are the ideals; it's better to send a
-not-fully-following-guidelines patch than no patch at all, though. We
-can always polish it up.
-
-Mailing list
-===
-
-The D-Bus mailing list is dbus@lists.freedesktop.org; discussion
-of patches, etc. should go there.
-
-Security
-===
-
-Most of D-Bus is security sensitive. Guidelines related to that:
-
- - avoid memcpy(), sprintf(), strlen(), snprintf, strlcat(),
- strstr(), strtok(), or any of this stuff. Use DBusString.
- If DBusString doesn't have the feature you need, add it
- to DBusString.
-
- There are some exceptions, for example
- if your strings are just used to index a hash table
- and you don't do any parsing/modification of them, perhaps
- DBusString is wasteful and wouldn't help much. But definitely
- if you're doing any parsing, reallocation, etc. use DBusString.
-
- - do not include system headers outside of dbus-memory.c,
- dbus-sysdeps.c, and other places where they are already
- included. This gives us one place to audit all external
- dependencies on features in libc, etc.
-
- - do not use libc features that are "complicated"
- and may contain security holes. For example, you probably shouldn't
- try to use regcomp() to compile an untrusted regular expression.
- Regular expressions are just too complicated, and there are many
- different libc's out there.
-
- - we need to design the message bus daemon (and any similar features)
- to use limited privileges, run in a chroot jail, and so on.
-
-http://vsftpd.beasts.org/ has other good security suggestions.
-
-Coding Style
-===
-
- - The C library uses GNU coding conventions, with GLib-like
- extensions (e.g. lining up function arguments). The
- Qt wrapper uses KDE coding conventions.
-
- - Write docs for all non-static functions and structs and so on. try
- "doxygen Doxyfile" prior to commit and be sure there are no
- warnings printed.
-
- - All external interfaces (network protocols, file formats, etc.)
- should have documented specifications sufficient to allow an
- alternative implementation to be written. Our implementation should
- be strict about specification compliance (should not for example
- heuristically parse a file and accept not-well-formed
- data). Avoiding heuristics is also important for security reasons;
- if it looks funny, ignore it (or exit, or disconnect).
-
-Development
-===
-
-D-Bus uses Git as its version control system. The main repository is
-hosted at git.freedesktop.org/dbus/dbus. To clone D-Bus, execute the
-following command:
-
- git clone git://git.freedesktop.org/dbus/dbus
-OR
- git clone git.freedesktop.org:dbus/dbus
-
-The latter form is the one that allows pushing, but it also requires
-an SSH account on the server. The former form allows anonymous
-checkouts.
-
-D-Bus development happens in two branches in parallel: the current
-stable branch, with an even minor number (like 1.0, 1.2 and 1.4), and
-the next development branch, with the next odd number.
-
-The stable branch is named after the version number itself (dbus-1.2,
-dbus-1.4), whereas the development branch is simply known as "master".
-
-When making a change to D-Bus, do the following:
-
- - check out the earliest branch of D-Bus that makes sense to have
- your change in. If it's a bugfix, it's normally the current stable
- branch; if it's a feature, it's normally the "master" branch. If
- you have an important security fix, you may want to apply to older
- branches too.
-
- - for large changes:
- if you're developing a new, large feature, it's recommended
- to create a new branch and do your development there. Publish
- your branch at a suitable place and ask others to help you
- develop and test it. Once your feature is considered finalised,
- you may merge it into the "master" branch.
-
-- for small changes:
- . make your change to the source code
- . execute tests to guarantee that you're not introducing a
- regression. For that, execute: make check
- (if possible, add a new test to check the fix you're
- introducing)
- . commit your change using "git commit"
- in the commit message, write a short sentence describing what
- you did in the first line. Then write a longer description in
- the next paragraph(s).
- . repeat the previous steps if necessary to have multiple commits
-
- - extract your patches and send to the D-Bus mailing list for
- review or post them to the D-Bus Bugzilla, attaching them to a bug
- report. To extract the patches, execute:
- git format-patch origin/master
-
- - once your code has been reviewed, you may push it to the Git
- server:
- git push origin my-branch:remote
- OR
- git push origin dbus-X.Y
- OR
- git push origin master
- (consult the Git manual to know which command applies)
-
- - (Optional) if you've not worked on "master", merge your changes to
- that branch. If you've worked on an earlier branch than the current
- stable, merge your changes upwards towards the stable branch, then
- from there into "master".
-
- . execute: git checkout master
- . ensure that you have the latest "master" from the server, update
- if you don't
- . execute: git merge dbus-X.Y
- . if you have any conflicts, resolve them, git add the conflicted
- files and then git commit
- . push the "master" branch to the server as well
-
- Executing this merge is recommended, but not necessary for all
- changes. You should do this step if your bugfix is critical for the
- development in "master", or if you suspect that conflicts will arise
- (you're usually the best person to resolve conflicts introduced by
- your own code), or if it has been too long since the last merge.
-
-
-Making a release
-===
-
-To make a release of D-Bus, do the following:
-
- - check out a fresh copy from Git
-
- - verify that the libtool versioning/library soname is
- changed if it needs to be, or not changed if not
-
- - update the file NEWS based on the git history
-
- - verify that the version number of dbus-specification.xml is
- changed if it needs to be; if changes have been made, update the
- release date in that file
-
- - update the AUTHORS file with "make update-authors" if necessary
-
- - the version number should have major.minor.micro, even
- if micro is 0, i.e. "1.0.0" and "1.2.0" not "1.0"/"1.2"; the micro
- version should be even for releases, and odd for intermediate snapshots
-
- - "make distcheck" (DO NOT just "make dist" - pass the check!)
-
- - if make distcheck fails, fix it.
-
- - once distcheck succeeds, "git commit -a". This is the version
- of the tree that corresponds exactly to the released tarball.
-
- - tag the tree with "git tag -s -m 'Released X.Y.Z' dbus-X.Y.Z"
- where X.Y.Z is the version of the release. If you can't sign
- then simply created an unsigned annotated tag:
- "git tag -a -m 'Released X.Y.Z' dbus-X.Y.Z".
-
- - bump the version number up in configure.ac (so the micro version is odd),
- and commit it. Make sure you do this *after* tagging the previous
- release! The idea is that git has a newer version number
- than anything released. Similarly, bump the version number of
- dbus-specification.xml and set the release date to "(not finalized)".
-
- - merge the branch you've released to the chronologically-later
- branch (usually "master"). You'll probably have to fix a merge
- conflict in configure.ac (the version number).
-
- - push your changes and the tag to the central repository with
- git push origin master dbus-X.Y dbus-X.Y.Z
-
- - scp your tarball to freedesktop.org server and copy it to
- dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/dbus/dbus-X.Y.Z.tar.gz.
- This should be possible if you're in group "dbus"
-
- - Update the online documentation with `make -C doc maintainer-upload-docs`.
-
- - update the wiki page http://www.freedesktop.org/Software/dbus by
- adding the new release under the Download heading. Then, cut the
- link and changelog for the previous that was there.
-
- - update the wiki page
- http://www.freedesktop.org/Software/DbusReleaseArchive pasting the
- previous release. Note that bullet points for each of the changelog
- items must be indented three more spaces to conform to the
- formatting of the other releases there.
-
- - post to dbus@lists.freedesktop.org announcing the release.
-
-
-Making a ".0" stable release
-===
-
-We create a branch for each stable release. The branch name should be
-dbus-X.Y which is a branch that has releases versioned X.Y.Z;
-changes on a stable branch should be limited to significant bug fixes.
-
-Because we won't make minor changes like keeping up with the latest
-deprecations on a stable branch, stable branches should turn off the
-gcc warning for deprecated declarations (e.g. see commit 4ebb275ab7).
-
-Be extra-careful not to merge master (or any branch based on master) into a
-stable branch.
-
-To branch:
- git branch dbus-X.Y
-and upload the branch tag to the server:
- git push origin dbus-X.Y
-
-To develop in this branch:
- git checkout dbus-X.Y
-
-Environment variables
-===
-
-These are the environment variables that are used by the D-Bus client library
-
-DBUS_VERBOSE=1
-Turns on printing verbose messages. This only works if D-Bus has been
-compiled with --enable-verbose-mode
-
-DBUS_MALLOC_FAIL_NTH=n
-Can be set to a number, causing every nth call to dbus_alloc or
-dbus_realloc to fail. This only works if D-Bus has been compiled with
---enable-tests.
-
-DBUS_MALLOC_FAIL_GREATER_THAN=n
-Can be set to a number, causing every call to dbus_alloc or
-dbus_realloc to fail if the number of bytes to be allocated is greater
-than the specified number. This only works if D-Bus has been compiled with
---enable-tests.
-
-DBUS_TEST_MALLOC_FAILURES=n
-Many of the D-Bus tests will run over and over, once for each malloc
-involved in the test. Each run will fail a different malloc, plus some
-number of mallocs following that malloc (because a fair number of bugs
-only happen if two or more mallocs fail in a row, e.g. error recovery
-that itself involves malloc). This env variable sets the number of
-mallocs to fail.
-Here's why you care: If set to 0, then the malloc checking is skipped,
-which makes the test suite a heck of a lot faster. Just run with this
-env variable unset before you commit.
-
-Tests
-===
-
-These are the test programs that are built if dbus is compiled using
---enable-tests.
-
-dbus/dbus-test
-This is the main unit test program that tests all aspects of the D-Bus
-client library.
-
-dbus/bus-test
-This it the unit test program for the message bus.
-
-test/break-loader
-A test that tries to break the message loader by passing it randomly
-created invalid messages.
-
-test/name-test/*
-This is a suite of programs which are run with a temporary session bus.
-If your test involves multiple processes communicating, your best bet
-is to add a test in here.
-
-"make check" runs all the deterministic test programs (i.e. not break-loader).
-
-"make lcov-check" is available if you configure with --enable-compiler-coverage
-and gives a complete report on test suite coverage.
-
-Patches
-===
-
-Please file them at http://bugzilla.freedesktop.org under component
-dbus, and also post to the mailing list for discussion. The commit
-rules are:
-
- - for fixes that don't affect API or protocol, they can be committed
- if any one qualified reviewer other than patch author
- reviews and approves
-
- - for fixes that do affect API or protocol, two people
- in the reviewer group have to review and approve the commit, and
- posting to the list is definitely mandatory
-
- - if there's a live unresolved controversy about a change,
- don't commit it while the argument is still raging.
-
- - at their discretion, members of the reviewer group may also commit
- branches/patches under these conditions:
-
- - the branch does not add or change API, ABI or wire-protocol
-
- - the branch solves a known problem and is covered by the regression tests
-
- - there are no objections from the rest of the review group within
- a week of the patches being attached to Bugzilla
-
- - the committer gets a positive review on Bugzilla from someone they
- consider qualified to review the change (e.g. a colleague with D-Bus
- experience; not necessarily a member of the reviewer group)
-
- - regardless of reviews, to commit a patch:
- - make check must pass
- - the test suite must be extended to cover the new code
- as much as reasonably feasible (see Tests above)
- - the patch has to follow the portability, security, and
- style guidelines
- - the patch should as much as reasonable do one thing,
- not many unrelated changes
- No reviewer should approve a patch without these attributes, and
- failure on these points is grounds for reverting the patch.
-
-The reviewer group that can approve patches:
-
-Havoc Pennington <hp@pobox.net>
-Michael Meeks <michael.meeks@novell.com>
-Alexander Larsson <alexl@redhat.com>
-Zack Rusin <zack@kde.org>
-Joe Shaw <joe@assbarn.com>
-Mikael Hallendal <micke@imendio.com>
-Richard Hult <richard@imendio.com>
-Owen Fraser-Green <owen@discobabe.net>
-Olivier Andrieu <oliv__a@users.sourceforge.net>
-Colin Walters <walters@verbum.org>
-Thiago Macieira <thiago@kde.org>
-John Palmieri <johnp@redhat.com>
-Scott James Remnant <scott@netsplit.com>
-Will Thompson <will.thompson@collabora.co.uk>
-Simon McVittie <simon.mcvittie@collabora.co.uk>
-David Zeuthen <davidz@redhat.com>
diff --git a/src/3rd_party/dbus-1.7.8/INSTALL b/src/3rd_party/dbus-1.7.8/INSTALL
deleted file mode 100644
index f2f0122cc4..0000000000
--- a/src/3rd_party/dbus-1.7.8/INSTALL
+++ /dev/null
@@ -1,248 +0,0 @@
- DBus Installation
- =================
-
-Quick start
-===========
-
-DBus could be build with GNU AutoTools or with cmake for its build system,
-thus the basic install procedure can be summarized as:
-
-with autotools:
-
- ./configure --prefix=/usr
- make
- su make install
-
-The configure script will automatically determine whether to try and
-build bindings for GLib, Qt, Qt3, Python and Mono based on what tools
-are installed on the host system. The default build behaviour can be
-overridden using the --enable-XXX/--disable-XXX arguments to configure.
-A typical scenario in which it is desirable to override automatic
-detection, is during packaging of binary builds, where a predictable
-dependancy chain is required. For more details on GNU AutoTools
-installation, consult the generic instructions later in this document
-
-with cmake:
- mkdir dbus-build-dir
- cd dbus-build-dir
- cmake -G <makefile-generator-name> [-D<option>] <dbus-src-root>/cmake
- make
- make install
-
-cmake will automatically determine whether to build some features
-based on what tools and/or libraries are installed on the host system.
-The default build behaviour can be overridden using the
--DENABLE_<XXX> arguments to cmake.
-A typical scenario in which it is desirable to override automatic
-detection, is during packaging of binary builds, where a predictable
-dependancy chain is required. For more details on cmake installation,
-consult http://www.cmake.org/cmake/help/help.html.
-
-External software dependancies
-==============================
-
-The only fundamental requirement to build DBus is an XML parser,
-however, there are a number of other software packages which (if
-present) will enhance functionality.
-
-Core library
-------------
-
- Requisite:
-
- - Gettext
- - expat
-
- Optional:
-
- - libselinux (for SELinux integration)
- - doxygen (for API documentation)
- - xmlto or meinproc4 (for Spec & other XML documentation)
-
-====================================================================
-
-The rest of this document contains the generic GNU AutoTools install
-insructions....
-
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
diff --git a/src/3rd_party/dbus-1.7.8/Makefile.am b/src/3rd_party/dbus-1.7.8/Makefile.am
deleted file mode 100644
index 756ab8b9a2..0000000000
--- a/src/3rd_party/dbus-1.7.8/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-SUBDIRS=dbus bus tools test doc
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = dbus-1.pc
-
-DISTCLEANFILES = \
- dbus-1.pc
-
-EXTRA_DIST = \
- autogen.sh \
- HACKING \
- dbus-1.pc.in \
- cleanup-man-pages.sh \
- ChangeLog.pre-1-0 \
- NEWS.pre-1-0 \
- ChangeLog.pre-1-2 \
- NEWS.pre-1-2 \
- README.valgrind \
- README.win \
- README.wince \
- README.cygwin \
- README.launchd \
- cmake
-
-all-local: Doxyfile
-
-update-authors:
- git shortlog -s -e | cut -c 8- | sort > AUTHORS
-
-DISTCHECK_CONFIGURE_FLAGS = \
- --enable-xml-docs \
- --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
-
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
-include tools/lcov.am
diff --git a/src/3rd_party/dbus-1.7.8/Makefile.in b/src/3rd_party/dbus-1.7.8/Makefile.in
deleted file mode 100644
index 77159082cb..0000000000
--- a/src/3rd_party/dbus-1.7.8/Makefile.in
+++ /dev/null
@@ -1,1072 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright © 2008-2011 Collabora Ltd.
-# Copyright © 2008-2011 Nokia Corporation
-#
-# 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.
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(srcdir)/dbus-1-uninstalled.pc.in \
- $(srcdir)/dbus-1.pc.in $(srcdir)/tools/lcov.am \
- $(top_srcdir)/configure \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
- $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-fail.conf.in \
- $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-pass.conf.in \
- $(top_srcdir)/test/data/valid-config-files/debug-allow-all-sha1.conf.in \
- $(top_srcdir)/test/data/valid-config-files/debug-allow-all.conf.in \
- $(top_srcdir)/test/data/valid-config-files/incoming-limit.conf.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- AUTHORS COPYING ChangeLog INSTALL NEWS compile config.guess \
- config.sub depcomp install-sh ltmain.sh missing
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = Doxyfile dbus-1.pc dbus-1-uninstalled.pc \
- test/data/valid-config-files/debug-allow-all.conf \
- test/data/valid-config-files/debug-allow-all-sha1.conf \
- test/data/valid-config-files/incoming-limit.conf \
- test/data/valid-config-files-system/debug-allow-all-pass.conf \
- test/data/valid-config-files-system/debug-allow-all-fail.conf \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service \
- test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service \
- test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service \
- test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service \
- test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service \
- test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service \
- test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service \
- test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service \
- test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
-DATA = $(pkgconfig_DATA)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir dist dist-all distcheck
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = dbus bus tools test doc
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = dbus-1.pc
-DISTCLEANFILES = \
- dbus-1.pc
-
-EXTRA_DIST = \
- autogen.sh \
- HACKING \
- dbus-1.pc.in \
- cleanup-man-pages.sh \
- ChangeLog.pre-1-0 \
- NEWS.pre-1-0 \
- ChangeLog.pre-1-2 \
- NEWS.pre-1-2 \
- README.valgrind \
- README.win \
- README.wince \
- README.cygwin \
- README.launchd \
- cmake
-
-DISTCHECK_CONFIGURE_FLAGS = \
- --enable-xml-docs \
- --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
-
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/tools/lcov.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-$(srcdir)/tools/lcov.am:
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-dbus-1.pc: $(top_builddir)/config.status $(srcdir)/dbus-1.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-dbus-1-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/dbus-1-uninstalled.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-config-files/debug-allow-all.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files/debug-allow-all.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-config-files/debug-allow-all-sha1.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files/debug-allow-all-sha1.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-config-files/incoming-limit.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files/incoming-limit.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-config-files-system/debug-allow-all-pass.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-pass.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-config-files-system/debug-allow-all-fail.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-fail.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service: $(top_builddir)/config.status $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service: $(top_builddir)/config.status $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service: $(top_builddir)/config.status $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool config.lt
-install-pkgconfigDATA: $(pkgconfig_DATA)
- @$(NORMAL_INSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
- done
-
-uninstall-pkgconfigDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__remove_distdir)
-
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
-
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod u+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(DATA) config.h all-local
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr \
- distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-pkgconfigDATA
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-pkgconfigDATA
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
- ctags-recursive install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am all-local am--refresh check check-am clean \
- clean-generic clean-libtool ctags ctags-recursive dist \
- dist-all dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-pkgconfigDATA
-
-
-all-local: Doxyfile
-
-update-authors:
- git shortlog -s -e | cut -c 8- | sort > AUTHORS
-
-lcov-reset:
- lcov --directory @abs_top_srcdir@ --zerocounters
-
-lcov-report:
- lcov --directory @abs_top_srcdir@ --capture \
- --output-file @abs_top_builddir@/lcov.info
- $(mkdir_p) @abs_top_builddir@/lcov.html
- git_commit=`GIT_DIR=@abs_top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
- genhtml --title "@PACKAGE_STRING@ $$git_commit" \
- --output-directory @abs_top_builddir@/lcov.html lcov.info
- @echo
- @echo 'lcov report can be found in:'
- @echo 'file://@abs_top_builddir@/lcov.html/index.html'
- @echo
-
-lcov-check:
- $(MAKE) lcov-reset
- $(MAKE) check $(LCOV_CHECK_ARGS)
- $(MAKE) lcov-report
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/NEWS b/src/3rd_party/dbus-1.7.8/NEWS
deleted file mode 100644
index 972d398415..0000000000
--- a/src/3rd_party/dbus-1.7.8/NEWS
+++ /dev/null
@@ -1,988 +0,0 @@
-D-Bus 1.7.8 (2013-11-01)
-==
-
-The “extreme hills” release.
-
-Dependencies:
-
-• If systemd support is enabled, libsystemd-journal is now required.
-
-Enhancements:
-
-• When activating a non-systemd service under systemd, annotate its
- stdout/stderr with its bus name in the Journal. Known limitation:
- because the socket is opened before forking, the process will still be
- logged as if it had dbus-daemon's process ID and user ID.
- (fd.o #68559, Chengwei Yang)
-
-• Document more configuration elements in dbus-daemon(1)
- (fd.o #69125, Chengwei Yang)
-
-Fixes:
-
-• Don't leak string arrays or fds if dbus_message_iter_get_args_valist()
- unpacks them and then encounters an error (fd.o #21259, Chengwei Yang)
-
-• If compiled with libaudit, retain CAP_AUDIT_WRITE so we can write
- disallowed method calls to the audit log, fixing a regression in 1.7.6
- (fd.o #49062, Colin Walters)
-
-• path_namespace='/' in match rules incorrectly matched nothing; it
- now matches everything. (fd.o #70799, Simon McVittie)
-
-D-Bus 1.7.6 (2013-10-09)
-==
-
-The “CSI Shrewsbury” release.
-
-Build-time configuration changes:
-
-• Directory change notification via dnotify on Linux is no longer
- supported; it hadn't compiled successfully since 2010 in any case.
- If you don't have inotify (Linux) or kqueue (*BSD), you will need
- to send SIGHUP to the dbus-daemon when its configuration changes.
- (fd.o #33001, Chengwei Yang)
-
-• Compiling with --disable-userdb-cache is no longer supported;
- it didn't work since at least 2008, and would lead to an extremely
- slow dbus-daemon even it worked. (fd.o #15589, #17133, #66947;
- Chengwei Yang)
-
-• The DBUS_DISABLE_ASSERTS CMake option didn't actually disable most
- assertions. It has been renamed to DBUS_DISABLE_ASSERT to be consistent
- with the Autotools build system. (fd.o #66142, Chengwei Yang)
-
-• --with-valgrind=auto enables Valgrind instrumentation if and only if
- valgrind headers are available. The default is still --with-valgrind=no.
- (fd.o #56925, Simon McVittie)
-
-Dependencies:
-
-• Platforms with no 64-bit integer type are no longer supported.
- (fd.o #65429, Simon McVittie)
-
-• GNU make is now (documented to be) required. (fd.o #48277, Simon McVittie)
-
-• Full test coverage no longer requires dbus-glib, although the tests do not
- exercise the shared library (only a static copy) if dbus-glib is missing.
- (fd.o #68852, Simon McVittie)
-
-Enhancements:
-
-• D-Bus Specification 0.22
- · Document GetAdtAuditSessionData() and
- GetConnectionSELinuxSecurityContext() (fd.o #54445, Simon)
- · Fix example .service file (fd.o #66481, Chengwei Yang)
- · Don't claim D-Bus is "low-latency" (lower than what?), just
- give factual statements about it supporting async use
- (fd.o #65141, Justin Lee)
- · Document the contents of .service files, and the fact that
- system services' filenames are constrained
- (fd.o #66608; Simon McVittie, Chengwei Yang)
-
-• Be thread-safe by default on all platforms, even if
- dbus_threads_init_default() has not been called. For compatibility with
- older libdbus, library users should continue to call
- dbus_threads_init_default(): it is harmless to do so.
- (fd.o #54972, Simon McVittie)
-
-• Add GetConnectionCredentials() method (fd.o #54445, Simon)
-
-• New API: dbus_setenv(), a simple wrapper around setenv().
- Note that this is not thread-safe. (fd.o #39196, Simon)
-
-• Add dbus-send --peer=ADDRESS (connect to a given peer-to-peer connection,
- like --address=ADDRESS in previous versions) and dbus-send --bus=ADDRESS
- (connect to a given bus, like dbus-monitor --address=ADDRESS).
- dbus-send --address still exists for backwards compatibility,
- but is no longer documented. (fd.o #48816, Andrey Mazo)
-
-• Windows-specific:
- · "dbus-daemon --nofork" is allowed on Windows again. (fd.o #68852,
- Simon McVittie)
-
-Fixes:
-
-• Avoid an infinite busy-loop if a signal interrupts waitpid()
- (fd.o #68945, Simon McVittie)
-
-• Clean up memory for parent nodes when objects are unexported
- (fd.o #60176, Thomas Fitzsimmons)
-
-• Make dbus_connection_set_route_peer_messages(x, FALSE) behave as
- documented. Previously, it assumed its second parameter was TRUE.
- (fd.o #69165, Chengwei Yang)
-
-• Escape addresses containing non-ASCII characters correctly
- (fd.o #53499, Chengwei Yang)
-
-• Document <servicedir> search order correctly (fd.o #66994, Chengwei Yang)
-
-• Don't crash on "dbus-send --session / x.y.z" which regressed in 1.7.4.
- (fd.o #65923, Chengwei Yang)
-
-• If malloc() returns NULL in _dbus_string_init() or similar, don't free
- an invalid pointer if the string is later freed (fd.o #65959, Chengwei Yang)
-
-• If malloc() returns NULL in dbus_set_error(), don't va_end() a va_list
- that was never va_start()ed (fd.o #66300, Chengwei Yang)
-
-• fix build failure with --enable-stats (fd.o #66004, Chengwei Yang)
-
-• fix a regression test on platforms with strict alignment (fd.o #67279,
- Colin Walters)
-
-• Avoid calling function parameters "interface" since certain Windows headers
- have a namespace-polluting macro of that name (fd.o #66493, Ivan Romanov)
-
-• Assorted Doxygen fixes (fd.o #65755, Chengwei Yang)
-
-• Various thread-safety improvements to static variables (fd.o #68610,
- Simon McVittie)
-
-• Make "make -j check" work (fd.o #68852, Simon McVittie)
-
-• Fix a NULL pointer dereference on an unlikely error path
- (fd.o #69327, Sviatoslav Chagaev)
-
-• Improve valgrind memory pool tracking (fd.o #69326,
- Sviatoslav Chagaev)
-
-• Don't over-allocate memory in dbus-monitor (fd.o #69329,
- Sviatoslav Chagaev)
-
-• dbus-monitor can monitor dbus-daemon < 1.5.6 again
- (fd.o #66107, Chengwei Yang)
-
-• Unix-specific:
- · If accept4() fails with EINVAL, as it can on older Linux kernels
- with newer glibc, try accept() instead of going into a busy-loop.
- (fd.o #69026, Chengwei Yang)
- · If socket() or socketpair() fails with EINVAL or EPROTOTYPE,
- for instance on Hurd or older Linux with a new glibc, try without
- SOCK_CLOEXEC. (fd.o #69073; Pino Toscano, Chengwei Yang)
- · Fix a file descriptor leak on an error code path.
- (fd.o #69182, Sviatoslav Chagaev)
- · dbus-run-session: clear some unwanted environment variables
- (fd.o #39196, Simon)
- · dbus-run-session: compile on FreeBSD (fd.o #66197, Chengwei Yang)
- · Don't fail the autolaunch test if there is no DISPLAY (fd.o #40352, Simon)
- · Use dbus-launch from the builddir for testing, not the installed copy
- (fd.o #37849, Chengwei Yang)
- · Fix compilation if writev() is unavailable (fd.o #69409,
- Vasiliy Balyasnyy)
- · Remove broken support for LOCAL_CREDS credentials passing, and
- document where each credential-passing scheme is used (fd.o #60340,
- Simon McVittie)
- · Make autogen.sh work on *BSD by not assuming GNU coreutils functionality
- (fd.o #35881, #69787; Chengwei Yang)
- · dbus-monitor: be portable to NetBSD (fd.o #69842, Chengwei Yang)
- · dbus-launch: stop using non-portable asprintf (fd.o #37849, Simon)
- · Improve error reporting from the setuid activation helper (fd.o #66728,
- Chengwei Yang)
-
-• Windows-specific:
- · Remove unavailable command-line options from 'dbus-daemon --help'
- (fd.o #42441, Ralf Habacker)
- · Add support for looking up local TCPv4 clients' credentials on
- Windows XP via the undocumented AllocateAndGetTcpExTableFromStack
- function (fd.o #66060, Ralf Habacker)
- · Fix insufficient dependency-tracking (fd.o #68505, Simon McVittie)
- · Don't include wspiapi.h, fixing a compiler warning (fd.o #68852,
- Simon McVittie)
-
-• Internal changes:
- · add DBUS_ENABLE_ASSERT, DBUS_ENABLE_CHECKS for less confusing
- conditionals (fd.o #66142, Chengwei Yang)
- · improve verbose-mode output (fd.o #63047, Colin Walters)
- · consolidate Autotools and CMake build (fd.o #64875, Ralf Habacker)
- · fix various unused variables, unusual build configurations
- etc. (fd.o #65712, #65990, #66005, #66257, #69165, #69410, #70218;
- Chengwei Yang, Vasiliy Balyasnyy)
-
-D-Bus 1.7.4 (2013-06-13)
-==
-
-The “but is your thread-safety thread-safe?” release.
-
-Security fixes:
-
-• CVE-2013-2168: Fix misuse of va_list that could be used as a denial
- of service for system services. Vulnerability reported by Alexandru Cornea.
- (Simon)
-
-Dependencies:
-
-• The Windows version of libdbus now contains a C++ source file, used
- to provide global initialization when the library is loaded.
- gcc (mingw*) users should ensure that g++ is also installed.
-
-• The libxml2-based configuration reader (which hasn't worked for 2.5 years,
- and was never the recommended option) has been removed. Expat is now a
- hard dependency.
-
-Enhancements:
-
-• It should now be safe to call dbus_threads_init_default() from any thread,
- at any time. Authors of loadable modules and plugins that use libdbus
- should consider doing so during initialization.
- (fd.o #54972, Simon McVittie)
-
-• Improve dbus-send documentation and command-line parsing (fd.o #65424,
- Chengwei Yang)
-
-Unix-specific:
- · dbus-run-session: experimental new tool to start a temporary D-Bus
- session, e.g. for regression tests or a text console, replacing
- certain uses of dbus-launch which weren't really correct
- (fd.o #39196, Simon)
-
-Other fixes:
-
-• In dbus-daemon, don't crash if a .service file starts with key=value
- (fd.o #60853, Chengwei Yang)
-
-• Unix-specific:
- · Fix a crash similar to CVE-2013-2168 the first time we try to use syslog
- on a platform not defining LOG_PERROR, such as Solaris or QNX.
- This regressed in 1.7.0. (Simon)
- · Fix an assertion failure if we try to activate systemd services before
- systemd connects to the bus (fd.o #50199, Chengwei Yang)
- · Avoid compiler warnings for ignoring the return from write()
- (Chengwei Yang)
-
-• Windows-specific:
- · Under cmake, install runtime libraries (DLLs) into bin/ instead of lib/
- so that Windows finds them (fd.o #59733, Ralf Habacker)
-
-D-Bus 1.7.2 (2013-04-25)
-==
-
-The “only partially opaque” release.
-
-Configuration changes:
-
-• On non-QNX Unix platforms, the default limit on fds per message in the
- session bus configuration has reduced from 4096 to 1024. The default
- limit used on the system bus was already 1024. On QNX, both limits are
- reduced further, to 128.
-
-Enhancements:
-
-• D-Bus Specification 0.21
- · Following Unicode Corrigendum #9, the noncharacters U+nFFFE, U+nFFFF,
- U+FDD0..U+FDEF are allowed in UTF-8 strings again. (fd.o #63072,
- Simon McVittie)
-
-Fixes:
-
-• Diagnose incorrect use of dbus_connection_get_data() with negative slot
- (i.e. before allocating the slot) rather than returning junk
- (fd.o #63127, Dan Williams)
-
-• Fix a cmake build regression since 1.7.0 (fd.o #63682; Ralf Habacker,
- Simon McVittie)
-
-• Unix-specific:
- · On Linux, link successfully with glibc 2.17 (fd.o #63166, Simon McVittie)
-  · Under systemd, log to syslog only, not stderr, avoiding duplication
- (fd.o #61399, #39987; Colin Walters, Dagobert Michelsen)
- · Under systemd, remove unnecessary dependency on syslog.socket
- (fd.o #63531, Cristian Rodríguez)
- · Include alloca.h for alloca() if available, fixing compilation on
- Solaris 10 (fd.o #63071, Dagobert Michelsen)
- · Allow use of systemd-logind without the rest of systemd
- (fd.o #62585, Martin Pitt)
- · When built with CMake, link to librt and use the right path for
- meinproc's XSLT stylesheets (fd.o #61637, Ralf Habacker)
- · Reduce the default limit on number of fds per message to 128 under
- QNX, working around an arbitrary OS limit (fd.o #61176, Matt Fischer)
-
-• Windows-specific:
- · Do not claim that all bus clients have the dbus-daemon's credentials;
- pick up local TCPv4 clients' credentials (process ID and security
- identifier, i.e. user) using GetExtendedTcpTable() (fd.o #61787,
- Ralf Habacker)
-
-D-Bus 1.7.0 (2013-02-22)
-==
-
-The "Disingenuous Assertions" release.
-
-This is a new development release, starting the 1.7.x branch. D-Bus 1.6
-remains the recommended version for long-term-supported distributions
-or the upcoming GNOME 3.8 release.
-
-Build-time configuration changes:
-
-• The --with-dbus-session-bus-default-address configure option is no longer
- supported. Use the new --with-dbus-session-bus-connect-address and
- --with-dbus-session-bus-listen-address options instead. On Windows, you
- usually want them to have the same argument; on Unix, the defaults are
- usually correct.
-
-• Similarly, the DBUS_SESSION_BUS_DEFAULT_ADDRESS CMake variable is no longer
- supported; use the new DBUS_SESSION_BUS_LISTEN_ADDRESS and
- DBUS_SESSION_BUS_CONNECT_ADDRESS variables instead.
-
-• cmake/cross-compile.sh has been removed. Instead, please use a
- cross-toolchain file (-DCMAKE_TOOLCHAIN_FILE) as documented at
- <http://www.vtk.org/Wiki/CMake_Cross_Compiling>; or use Autotools
- as documented in "info automake Cross-Compilation", and set
- PKG_CONFIG_PATH appropriately.
-
-Requirements:
-
-• Man pages now require xmlto (or either xmlto or meinproc, if using CMake).
-• man2html is no longer used.
-
-Enhancements:
-
-• D-Bus Specification 0.20
- · actually say that /org/freedesktop/DBus is the object that
- implements o.fd.DBus (fd.o #51865, Colin Walters)
- · various reorganisation for better clarity (fd.o #38252, Simon McVittie)
- · stop claiming that all basic types work just like INT32 (strings don't!)
-
-• The "source code" for the man pages is now Docbook XML, eliminating
- the outdated duplicate copies used when building with CMake.
- (fd.o #59805; Ralf Habacker, Simon McVittie)
-
-Fixes:
-
-• In the activation helper, when compiled for tests, do not reset the system
- bus address, fixing the regression tests. (fd.o #52202, Simon)
-
-• Fix building with Valgrind 3.8, at the cost of causing harmless warnings
- with Valgrind 3.6 on some compilers (fd.o #55932, Arun Raghavan)
-
-• Merge <servicehelper> from system-local.conf if necessary (fd.o #51560,
- Krzysztof Konopko)
-
-• Under CMake, prefer xmlto over meinproc (fd.o #59733, Ralf Habacker)
-
-• Stop duplicating CMake's own logic to find libexpat
- (fd.o #59733, Ralf Habacker)
-
-• Don't assume CMake host and build system are the same (fd.o #59733,
- Ralf Habacker)
-
-• Avoid deprecation warnings for GLib 2.35 (fd.o #59971, Simon McVittie)
-
-• Unix-specific:
- · Check for functions in libpthread correctly, fixing compilation on
- (at least) OpenBSD (fd.o #47239, Simon)
- · Don't leak temporary fds pointing to /dev/null (fd.o #56927,
- Michel HERMIER)
- · Update sd-daemon.[ch] from systemd (fd.o #60681)
- · Add partial support for QNX (fd.o #60339, fd.o #61176; Matt Fischer)
-
-• Windows-specific:
- · The default session bus listening and connecting address is now
- "autolaunch:", which makes D-Bus on Windows interoperate with itself
- and GDBus "out of the box". Use the configure options and cmake variables
- described above if you require a different autolaunch scope.
- (fd.o #38201, Simon McVittie)
- · Avoid a CMake warning under Cygwin (fd.o #59401, Ralf Habacker)
-
-• Create session.d, system.d directories under CMake (fd.o #41319,
- Ralf Habacker)
-
-D-Bus 1.6.8 (2012-09-28)
-==
-
-The "Fix one thing, break another" release.
-
-• Follow up to CVE-2012-3524: The additional hardening
- work to use __secure_getenv() as a followup to bug #52202
- broke certain configurations of gnome-keyring. Given
- the difficulty of making this work without extensive
- changes to gnome-keyring, use of __secure_getenv() is
- deferred.
-
-D-Bus 1.6.6 (2012-09-28)
-==
-
-The "Clear the environment in your setuid binaries, please" release.
-
-• CVE-2012-3524: Don't access environment variables (fd.o #52202)
- Thanks to work and input from Colin Walters, Simon McVittie,
- Geoffrey Thomas, and others.
-• Unix-specific:
- · Fix compilation on Solaris (fd.o #53286, Jonathan Perkin)
- · Work around interdependent headers on OpenBSD by including sys/types.h
- before each use of sys/socket.h (fd.o #54418, Brad Smith)
-
-D-Bus 1.6.4 (2012-07-18)
-==
-
-• Detect that users are "at the console" correctly when configured with
- a non-default path such as --enable-console-auth-dir=/run/console
- (fd.o #51521, Dave Reisner)
-
-• Remove an incorrect assertion from DBusTransport (fd.o #51657,
- Simon McVittie)
-
-• Make --enable-developer default to "no" (regression in 1.6.2;
- fd.o #51657, Simon McVittie)
-
-• Windows-specific:
- · Launch dbus-daemon correctly if its path contains a space
- (fd.o #49450, Wolfgang Baron)
-
-D-Bus 1.6.2 (2012-06-27)
-==
-
-The "Ice Cabbage" release.
-
-• Change how we create /var/lib/dbus so it works under Automake >= 1.11.4
- (fd.o #51406, Simon McVittie)
-
-• Don't return from dbus_pending_call_set_notify with a lock held on OOM
- (fd.o #51032, Simon McVittie)
-
-• Disconnect "developer mode" (assertions, verbose mode etc.) from
- Automake maintainer mode. D-Bus developers should now configure with
- --enable-developer. Automake maintainer mode is now on by default;
- distributions can disable it with --disable-maintainer-mode.
- (fd.o #34671, Simon McVittie)
-
-• Automatically define DBUS_STATIC_BUILD in static-only Autotools builds,
- fixing linking when targeting Windows (fd.o #33973; william, Simon McVittie)
-
-• Unix-specific:
- · Check for libpthread under CMake on Unix (fd.o #47237, Simon McVittie)
-
-D-Bus 1.6.0 (2012-06-05)
-==
-
-The “soul of this machine has improved” release.
-
-This version starts a new stable branch of D-Bus: only bug fixes will
-be accepted into 1.6.x. Other changes will now go to the 1.7.x branch.
-
-Summary of changes since 1.4.x:
-
-• New requirements
- · PTHREAD_MUTEX_RECURSIVE on Unix
- · compiler support for 64-bit integers (int64_t or equivalent)
-
-• D-Bus Specification v0.19
-
-• New dbus-daemon features
- · <allow own_prefix="com.example.Service"/> rules allow the service to
- own names like com.example.Service.Instance3
- · optional systemd integration when checking at_console policies
- · --nopidfile option, mainly for use by systemd
- · path_namespace and arg0namespace may appear in match rules
- · eavesdropping is disabled unless the match rule contains eavesdrop=true
-
-• New public API
- · functions to validate various string types (dbus_validate_path() etc.)
- · dbus_type_is_valid()
- · DBusBasicValue, a union of every basic type
-
-• Bug fixes
- · removed an unsafe reimplementation of recursive mutexes
- · dbus-daemon no longer busy-loops if it has far too many file descriptors
- · dbus-daemon.exe --print-address works on Windows
- · all the other bug fixes from 1.4.20
-
-• Other major implementation changes
- · on Linux, dbus-daemon uses epoll if supported, for better scalability
- · dbus_threads_init() ignores its argument and behaves like
- dbus_threads_init_default() instead
- · removed the per-connection link cache, improving dbus-daemon performance
-
-• Developer features
- · optional Valgrind instrumentation (--with-valgrind)
- · optional Stats interface on the dbus-daemon (--enable-stats)
- · optionally abort whenever malloc() fails (--enable-embedded-tests
- and export DBUS_MALLOC_CANNOT_FAIL=1)
-
-Changes since 1.5.12:
-
-• Be more careful about monotonic time vs. real time, fixing DBUS_COOKIE_SHA1
- spec-compliance (fd.o #48580, David Zeuthen)
-
-• Don't use install(1) within the source/build trees, fixing the build as
- non-root when using OpenBSD install(1) (fd.o #48217, Antoine Jacoutot)
-
-• Add missing commas in some tcp and nonce-tcp addresses, and remove
- an unused duplicate copy of the nonce-tcp transport in Windows builds
- (fd.o #45896, Simon McVittie)
-
-D-Bus 1.5.12 (2012-03-27)
-==
-
-The “Big Book of Science” release.
-
-• Add public API to validate various string types:
- dbus_validate_path(), dbus_validate_interface(), dbus_validate_member(),
- dbus_validate_error_name(), dbus_validate_bus_name(), dbus_validate_utf8()
- (fd.o #39549, Simon McVittie)
-
-• Turn DBusBasicValue into public API so bindings don't need to invent their
- own "union of everything" type (fd.o #11191, Simon McVittie)
-
-• Enumerate data files included in the build rather than using find(1)
- (fd.o #33840, Simon McVittie)
-
-• Add support for policy rules like <allow own_prefix="com.example.Service"/>
- in dbus-daemon (fd.o #46273, Alban Crequy)
-
-• Windows-specific:
- · make dbus-daemon.exe --print-address (and --print-pid) work again
- on Win32, but not on WinCE (fd.o #46049, Simon McVittie)
- · fix duplicate case value when compiling against mingw-w64
- (fd.o #47321, Andoni Morales Alastruey)
-
-D-Bus 1.5.10 (2012-02-21)
-==
-
-The "fire in Delerium" release.
-
-On Unix platforms, PTHREAD_MUTEX_RECURSIVE (as specified in POSIX 2008 Base
-and SUSv2) is now required.
-
-• D-Bus Specification 0.19:
- · Formally define unique connection names and well-known bus names,
- and document best practices for interface, bus, member and error names,
- and object paths (fd.o #37095, Simon McVittie)
- · Document the search path for session and system services on Unix, and
- where they should be installed by build systems (fd.o #21620, fd.o #35306;
- Simon McVittie)
- · Document the systemd transport (fd.o #35232, Lennart Poettering)
-
-• Make dbus_threads_init() use the same built-in threading implementation
- as dbus_threads_init_default(); the user-specified primitives that it
- takes as a parameter are now ignored (fd.o #43744, Simon McVittie)
-
-• Allow all configured auth mechanisms, not just one (fd.o #45106,
- Pavel Strashkin)
-
-• Improve cmake build system (Ralf Habacker):
- · simplify XML parser dependencies (fd.o #41027)
- · generate build timestamp (fd.o #41029)
- · only create batch files on Windows
- · fix option and cache syntax
- · add help-options target
- · share dbus-arch-deps.h.in with autotools rather than having our
- own version (fd.o #41033)
-
-• Build tests successfully with older GLib, as found in e.g. Debian 6
- (fd.o #41219, Simon McVittie)
-
-• Avoid use of deprecated GThread API (fd.o #44413, Martin Pitt)
-
-• Build documentation correctly if man2html doesn't support filenames on
- its command-line (fd.o #43875, Jack Nagel)
-
-• Improve test coverage. To get even more coverage, run the tests with
- DBUS_TEST_SLOW=1 (fd.o #38285, #42811; Simon McVittie)
-
-• Reduce the size of the shared library by moving functionality only used
- by dbus-daemon, tests etc. into their internal library and deleting
- unused code (fd.o #34976, #39759; Simon McVittie)
-
-• Add dbus-daemon --nopidfile option, overriding the configuration, for
- setups where the default configuration must include <pidfile/> to avoid
- breaking traditional init, but the pid file is in fact unnecessary; use
- it under systemd to improve startup time a bit (fd.o #45520,
- Lennart Poettering)
-
-• Optionally (if configured --with-valgrind) add instrumentation to debug
- libdbus and associated tools more meaningfully under Valgrind
- (fd.o #37286, Simon McVittie)
-
-• Improve the dbus-send(1) man page (fd.o #14005, Simon McVittie)
-
-• Make dbus-protocol.h compatible with C++11 (fd.o #46147, Marc Mutz)
-
-• If tests are enabled and DBUS_MALLOC_CANNOT_FAIL is set in the environment,
- abort on failure to malloc() (like GLib does), to turn runaway memory leaks
- into a debuggable core-dump if a resource limit is applied (fd.o #41048,
- Simon McVittie)
-
-• Don't crash if realloc() returns NULL in a debug build (fd.o #41048,
- Simon McVittie)
-
-• Unix-specific:
- · Replace our broken reimplementation of recursive mutexes, which has
- been broken since 2006, with an ordinary pthreads recursive mutex
- (fd.o #43744; Sigmund Augdal, Simon McVittie)
- · Use epoll(7) for a more efficient main loop in Linux; equivalent patches
- welcomed for other OSs' equivalents like kqueue, /dev/poll, or Solaris
- event ports (fd.o #33337; Simon McVittie, Ralf Habacker)
- · When running under systemd, use it instead of ConsoleKit to check
- whether to apply at_console policies (fd.o #39609, Lennart Poettering)
- · Avoid a highly unlikely fd leak (fd.o #29881, Simon McVittie)
- · Don't close invalid fd -1 if getaddrinfo fails (fd.o #37258, eXeC001er)
-  · Don't touch ~/.dbus and ~/.dbus-keyrings when running 'make installcheck'
- (fd.o #41218, Simon McVittie)
- · Stop pretending we respect XDG_DATA_DIRS for system services: the launch
- helper doesn't obey environment variables to avoid privilege escalation
- attacks, so make the system bus follow the same rules
- (fd.o #21620, Simon McVittie)
-
-• Windows-specific:
- · Find the dbus-daemon executable next to the shared library (fd.o #41558;
- Jesper Dam, Ralf Habacker)
- · Remove the faulty implementation of _dbus_condvar_wake_all (fd.o #44609,
- Simon McVittie)
-
-D-Bus 1.5.8 (2011-09-21)
-==
-
-The "cross-metering" release.
-
-In addition to dead code removal and refactoring, this release contains all
-of the bugfixes from 1.4.16.
-
-• Clean up dead code, and make more warnings fatal in development builds
- (fd.o #39231, fd.o #41012; Simon McVittie)
-
-• If full test coverage is requested via --enable-tests, strictly require
- Python, pygobject and dbus-python, which are required by some tests; if not,
- and Python is missing, skip those tests rather than failing
- (fd.o #37847, Simon McVittie)
-
-• When using cmake, provide the same version-info API in the installed headers
- as for autotools (DBUS_VERSION, etc.) (fd.o #40905, Ralf Habacker)
-
-• Add a regression test for fd.o #38005 (fd.o #39836, Simon McVittie)
-
-• Make "NOCONFIGURE=1 ./autogen.sh" not run configure (Colin Walters)
-
-• Add _DBUS_STATIC_ASSERT and use it to check invariants (fd.o #39636,
- Simon McVittie)
-
-• Fix duplicates in authors list (Ralf Habacker)
-
-• Fix broken links from dbus-tutorial.html if $(htmldir) != $(docdir)
- (fd.o #39879, Chris Mayo)
-
-• Fix a small memory leak, and a failure to report errors, when updating
- a service file entry for activation (fd.o #39230, Simon McVittie)
-
-• Unix-specific:
- · Clean up (non-abstract) Unix sockets on bus daemon exit (fd.o #38656;
- Brian Cameron, Simon McVittie)
- · On systems that use libcap-ng but not systemd, drop supplemental groups
- when switching to the daemon user (Red Hat #726953, Steve Grubb)
- · Make the cmake build work again on GNU platforms (fd.o #29228,
- Simon McVittie)
- · Fix compilation on non-C99 systems that have inttypes.h but not stdint.h,
- like Solaris (fd.o #40313, Dagobert Michelsen)
- · Define CMSG_ALIGN, CMSG_LEN, CMSG_SPACE on Solaris < 10
- (fd.o #40235, Simon McVittie)
- · Cope with Unixes that don't have LOG_PERROR, like Solaris 10
- (fd.o #39987, Simon McVittie)
- · Cope with platforms whose vsnprintf violates both POSIX and C99, like
- Tru64, IRIX and HP-UX (fd.o #11668, Simon McVittie)
-
-• Windows-specific:
- · Fix compilation on MSVC, which doesn't understand "inline" with its
- C99 meaning (fd.o #40000; Ralf Habacker, Simon McVittie)
- · Fix misuse of GPid in test/dbus-daemon.c (fd.o #40003, Simon McVittie)
- · Fix cross-compilation to Windows with Automake (fd.o #40003, Simon McVittie)
-
-D-Bus 1.5.6 (2011-07-29)
-==
-
-The "weird, gravy-like aftertaste" release.
-
-In addition to new features and refactoring, this release contains all of the
-bugfixes from 1.4.14.
-
-Potentially incompatible (Bustle and similar debugging tools will need
-changes to work as intended):
-
-• Do not allow match rules to "eavesdrop" (receive messages intended for a
- different recipient) by mistake: eavesdroppers must now opt-in to this
- behaviour by putting "eavesdrop='true'" in the match rule, which will
- not have any practical effect on buses where eavesdropping is not allowed
- (fd.o #37890, Cosimo Alfarano)
-
-Other changes:
-
-• D-Bus Specification version 0.18 (fd.o #37890, fd.o #39450, fd.o #38252;
- Cosimo Alfarano, Simon McVittie)
- · add the "eavesdrop" keyword to match rules
- · define eavesdropping, unicast messages and broadcast messages
- · stop claiming that match rules are needed to match unicast messages to you
- · promote the type system to be a top-level section
-
-• Use DBUS_ERROR_OBJECT_PATH_IN_USE if dbus_connection_try_register_object_path
- or dbus_connection_try_register_fallback fails, not ...ADDRESS_IN_USE,
- and simplify object-path registration (fd.o #38874, Jiří Klimeš)
-
-• Consistently use atomic operations on everything that is ever manipulated
- via atomic ops, as was done for changes to DBusConnection's refcount in
- 1.4.12 (fd.o #38005, Simon McVittie)
-
-• Fix a file descriptor leak when connecting to a TCP socket (fd.o #37258,
- Simon McVittie)
-
-• Make "make check" in a clean tree work, by not running tests until
- test data has been set up (fd.o #34405, Simon McVittie)
-
-• The dbus-daemon no longer busy-loops if it has a very large number of file
- descriptors (fd.o #23194, Simon McVittie)
-
-• Refactor message flow through dispatching to avoid locking violations if
- the bus daemon's message limit is hit; remove the per-connection link cache,
- which was meant to improve performance, but now reduces it (fd.o #34393,
- Simon McVittie)
-
-• Some cmake fixes (Ralf Habacker)
-
-• Remove dead code, mainly from DBusString (fd.o #38570, fd.o #39610;
- Simon McVittie, Lennart Poettering)
-
-• Stop storing two extra byte order indicators in each D-Bus message
- (fd.o #38287, Simon McVittie)
-
-• Add an optional Stats interface which can be used to get statistics from
- a running dbus-daemon if enabled at configure time with --enable-stats
- (fd.o #34040, Simon McVittie)
-
-• Fix various typos (fd.o #27227, fd.o #38284; Sascha Silbe, Simon McVittie)
-
-• Documentation (fd.o #36156, Simon McVittie):
- · let xsltproc be overridden as usual: ./configure XSLTPROC=myxsltproc
- · install more documentation automatically, including man2html output
- · put dbus.devhelp in the right place (it must go in ${htmldir})
-
-• Unix-specific:
- · look for system services in /lib/dbus-1/system-services in addition to all
- the other well-known locations; note that this should always be /lib,
- even on platforms where shared libraries on the root FS would go in /lib64,
- /lib/x86_64-linux-gnu or similar (fd.o #35229, Lennart Poettering)
- · opt-in to fd passing on Solaris (fd.o #33465, Simon McVittie)
-
-• Windows-specific (Ralf Habacker):
- · fix use of a mutex for autolaunch server detection
- · don't crash on malloc failure in _dbus_printf_string_upper_bound
-
-D-Bus 1.5.4 (2011-06-10)
-==
-
-Security (local denial of service):
-
-• Byte-swap foreign-endian messages correctly, preventing a long-standing
- local DoS if foreign-endian messages are relayed through the dbus-daemon
- (backporters: this is git commit c3223ba6c401ba81df1305851312a47c485e6cd7)
- (CVE-2011-2200, fd.o #38120, Debian #629938; Simon McVittie)
-
-New things:
-
-• The constant to use for an infinite timeout now has a name,
- DBUS_TIMEOUT_INFINITE. It is numerically equivalent to 0x7fffffff (INT32_MAX)
- which can be used for source compatibility with older versions of libdbus.
-
-• If GLib and DBus-GLib are already installed, more tests will be built,
- providing better coverage. The new tests can also be installed via
- ./configure --enable-installed-tests
- for system integration testing, if required. (fd.o #34570, Simon McVittie)
-
-Changes:
-
-• Consistently use atomic operations for the DBusConnection's refcount,
- fixing potential threading problems (fd.o #38005, Simon McVittie)
-
-• Don't use -Wl,--gc-sections by default: in practice the size decrease is
- small (300KiB on x86-64) and it frequently doesn't work in unusual
- toolchains. To optimize for minimum installed size, you should benchmark
- various possibilities for CFLAGS and LDFLAGS, and set the best flags for
- your particular toolchain at configure time. (fd.o #33466, Simon McVittie)
-
-• Use #!/bin/sh for run-with-tmp-session-bus.sh, making it work on *BSD
- (fd.o #35880, Timothy Redaelli)
-
-• Use ln -fs to set up dbus for systemd, which should fix reinstallation
- when not using a DESTDIR (fd.o #37870, Simon McVittie)
-
-• Windows-specific changes:
- · don't try to build dbus-daemon-launch-helper (fd.o #37838, Mark Brand)
-
-D-Bus 1.5.2 (2011-06-01)
-==
-
-The "Boar Hunter" release.
-
-Notes for distributors:
-
- This version of D-Bus no longer uses -fPIE by default. Distributions wishing
- to harden the dbus-daemon and dbus-launch-helper can re-enable this if their
- toolchain supports it reliably, via something like:
-
- ./configure CFLAGS=-fPIE LDFLAGS="-pie -Wl,-z,relro"
-
- or by using distribution-specific wrappers such as Debian's hardening-wrapper.
-
-Changes:
-
- • D-Bus Specification v0.17
- · Reserve the extra characters used in signatures by GVariant
- (fd.o #34529, Simon McVittie)
- · Define the ObjectManager interface (fd.o #34869, David Zeuthen)
- • Don't force -fPIE: distributions and libtool know better than we do whether
- it's desirable (fd.o #16621, fd.o #27215; Simon McVittie)
- • Allow --disable-gc-sections, in case your toolchain offers the
- -ffunction-sections, -fdata-sections and -Wl,--gc-sections options
- but they're broken, as seen on Solaris (fd.o #33466, Simon McVittie)
- • Install dbus-daemon and dbus-daemon-launch-helper in a more normal way
- (fd.o #14512; Simon McVittie, loosely based on a patch from Luca Barbato)
- • Ensure that maintainers upload documentation with the right permissions
- (fd.o #36130, Simon McVittie)
- • Don't force users of libdbus to be linked against -lpthread, -lrt
- (fd.o #32827, Simon McVittie)
- • Log system-bus activation information to syslog (fd.o #35705,
- Colin Walters)
- • Log messages dropped due to quotas to syslog (fd.o #35358,
- Simon McVittie)
- • Make the nonce-tcp transport work on Unix (fd.o #34569, Simon McVittie)
- • On Unix, if /var/lib/dbus/machine-id cannot be read, try /etc/machine-id
- (fd.o #35228, Lennart Poettering)
- • In the regression tests, don't report fds as "leaked" if they were open
- on startup (fd.o #35173, Simon McVittie)
- • Make dbus-monitor bail out if asked to monitor more than one bus,
- rather than silently using the last one (fd.o #26548, Will Thompson)
- • Clarify documentation (fd.o #35182, Simon McVittie)
- • Clean up minor dead code and some incorrect error handling
- (fd.o #33128, fd.o #29881; Simon McVittie)
- • Check that compiler options are supported before using them (fd.o #19681,
- Simon McVittie)
- • Windows:
- • Remove obsolete workaround for winioctl.h (fd.o #35083, Ralf Habacker)
-
-D-Bus 1.5.0 (2011-04-11)
-==
-
-The "you never know when you need to tow something from your giant
-flying shark" release.
-
- • D-Bus Specification v0.16
- · Add support for path_namespace and arg0namespace in match rules
- (fd.o #24317, #34870; Will Thompson, David Zeuthen, Simon McVittie)
- · Make argNpath support object paths, not just object-path-like strings,
- and document it better (fd.o #31818, Will Thompson)
- • Let the bus daemon implement more than one interface (fd.o #33757,
- Simon McVittie)
- • Optimize _dbus_string_replace_len to reduce waste (fd.o #21261,
- Roberto Guido)
- • Require user intervention to compile with missing 64-bit support
- (fd.o #35114, Simon McVittie)
- • Add dbus_type_is_valid as public API (fd.o #20496, Simon McVittie)
- • Raise UnknownObject instead of UnknownMethod for calls to methods on
- paths that are not part of the object tree, and UnknownInterface for calls
- to unknown interfaces in the bus daemon (fd.o #34527, Lennart Poettering)
-
-D-Bus 1.4.8 (2011-04-08)
-==
-
-The "It's like the beginning of a lobster" release.
-
- • Rename configure.in to configure.ac, and update it to modern conventions
- (fd.o #32245; Javier Jardón, Simon McVittie)
- • Correctly give XDG_DATA_HOME priority over XDG_DATA_DIRS (fd.o #34496,
- Anders Kaseorg)
- • Prevent X11 autolaunching if $DISPLAY is unset or empty, and add
- --disable-x11-autolaunch configure option to prevent it altogether
- in embedded environments (fd.o #19997, NB#219964; Simon McVittie)
- • Install the documentation, and an index for Devhelp (fd.o #13495,
- Debian #454142; Simon McVittie, Matthias Clasen)
- • If checks are not disabled, check validity of string-like types and
- booleans when sending them (fd.o #16338, NB#223152; Simon McVittie)
- • Add UnknownObject, UnknownInterface, UnknownProperty and PropertyReadOnly
- errors to dbus-shared.h (fd.o #34527, Lennart Poettering)
- • Break up a huge conditional in config-parser so gcov can produce coverage
- data (fd.o #10887, Simon McVittie)
- • List which parts of the Desktop Entry specification are applicable to
- .service files (fd.o #19159, Sven Herzberg)
- • Don't suppress service activation if two services have the same Exec=
- (fd.o #35750, Colin Walters)
- • Windows:
- · Avoid the name ELEMENT_TYPE due to namespace-pollution from winioctl.h
- (Andre Heinecke)
- · Include _dbus_path_is_absolute in libdbus on Windows, fixing compilation
- (fd.o #32805, Mark Brand)
-
-D-Bus 1.4.6 (2010-02-17)
-==
-
-The "1, 2, miss a few, 99, 100" release.
-
- • Remove unfinished changes intended to support GTest-based tests,
- which were mistakenly included in 1.4.4
-
-D-Bus 1.4.4 (2010-02-17)
-==
-
- • Switch back to using even micro versions for stable releases; 1.4.1
- should have been called 1.4.2, so skip that version number
- • Don't leave bad file descriptors being watched when spawning processes,
- which could result in a busy-loop (fd.o #32992, NB#200248; possibly
- also LP#656134, LP#680444, LP#713157)
- • Check for MSG_NOSIGNAL correctly
- • Fix failure to detect abstract socket support (fd.o #29895)
- • Make _dbus_system_logv actually exit with DBUS_SYSTEM_LOG_FATAL
- (fd.o #32262, NB#180486)
- • Improve some error code paths (fd.o #29981, fd.o #32264, fd.o #32262,
- fd.o #33128, fd.o #33277, fd.o #33126, NB#180486)
- • Avoid possible symlink attacks in /tmp during compilation (fd.o #32854)
- • Tidy up dead code (fd.o #25306, fd.o #33128, fd.o #34292, NB#180486)
- • Improve gcc malloc annotations (fd.o #32710)
- • If the system bus is launched via systemd, protect it from the OOM killer
- • Documentation improvements (fd.o #11190)
- • Avoid readdir_r, which is difficult to use correctly (fd.o #8284,
- fd.o #15922, LP#241619)
- • Cope with invalid files in session.d, system.d (fd.o #19186,
- Debian #230231)
- • Don't distribute generated files that embed our builddir (fd.o #30285,
- fd.o #34292)
- • Raise the system bus's fd limit to be sufficient for its configuration
- (fd.o #33474, LP#381063)
- • Fix syslog string processing
- • Ignore -Waddress
- • Remove broken gcov parsing code and --enable-gcov, and replace them
- with lcov HTML reports and --enable-compiler-coverage (fd.o #10887)
- • Windows:
- · avoid live-lock in Windows CE due to unfair condition variables
- • OpenBSD:
- · support credentials-passing (fd.o #32542)
- • Solaris:
- · opt-in to thread safety (fd.o #33464)
-
-D-Bus 1.4.1 (20 December 2010)
-==
-
- • Fix for CVE-2010-4352: sending messages with excessively-nested variants can
- crash the bus. The existing restriction to 64-levels of nesting previously
- only applied to the static type signature; now it also applies to dynamic
- nesting using variants. Thanks to Rémi Denis-Courmont for discoving this
- issue.
- • OS X portability fixes, including launchd support.
- • Windows autolaunch improvements.
- • Various bug fixes.
-
-D-Bus 1.4.0 (6 Sep 2010)
-==
- - systemd hookup
-
-D-Bus 1.3.1 (23 June 2010)
-==
- - New standardized PropertiesChanged signal in the properties interface
- - Various portability fixes, in particular to Windows platforms
- - Support forking bus services, for compatibility
-
-D-Bus 1.3.0 (29 July 2009)
-==
- - ability for dbus-send to send to any bus (--address)
- - file descriptor passing on Unix socket transports
- - use of GCC atomic intrinsics for better processor support
- (requires -march=i486 or above for x86 compilation)
- - thread-safe FD_CLOEXEC setting on recent Linux kernels (2.6.24-27 and up)
- and glibc (2.9 for pipe2 and 2.10 for accept4)
- - feature negotiation in the bus daemon
diff --git a/src/3rd_party/dbus-1.7.8/NEWS.pre-1-0 b/src/3rd_party/dbus-1.7.8/NEWS.pre-1-0
deleted file mode 100644
index 7105bc512b..0000000000
--- a/src/3rd_party/dbus-1.7.8/NEWS.pre-1-0
+++ /dev/null
@@ -1,614 +0,0 @@
-D-Bus 1.0.0 (08 November 2006)
-==
-- Documents updated with API/ABI garuntees
-- Added missing patch FreeBSD need to run out of the box
-- dbus-monitor now has a profile mode
-- AUTHORS file updated with names from the ChangeLog
- Thanks to everyone who helped get us here
-
-D-Bus 1.0 RC 3 (0.95) (02 November 2006)
-==
-- DBUS_API_SUBJECT_TO_CHANGE no longer needs to be defined when building apps
-- ./configure checks now work when cross compiling
-- dbus-uuidgen --ensure is now run in the init script so there is no need to
- run it in a post script
-- dbus-uuidgen now writes out to /var/lib/dbus to work with systems that do not
- have a writable /etc. Packages should install and own the /var/lib/dbus
- directory
-- recursive locks are now used when dbus_threads_init_default is called
-- standard_session_servicedirs tag added to the session.conf
- under a normal build this specifies these service directories:
- /usr/local/share/dbus-1/services
- /usr/share/dbus-1/services
- $HOME/.local/share/dbus-1/services
-- fixed crash when a service directory is specified more than once
-- fixed a crash in *BSD when watching config directories for changes
-- fixed Irix build by using dirp->__dd_fd to get the file descriptor
-- cleaned up the LOCAL_CREDS vs CMGCRED credential code so *BSD's don't
- crash here anymore
-- dbus_message_iter_get_array_len deprecated
-- cleanup-man-pages.sh added so packagers can clean up Doxygen man page output
- from 7 to 2 megs
-- large documentation improvements
-- numerous bug fixes
-
-D-Bus 1.0 RC 2 (0.94) (14 October 2006)
-==
-- dbus-uuidgen binary added for future remote machine identification
- packagers should call dbus-uuidgen --ensure in their post
-- GetMachineId peer method added to the bus API
-- dbus_connection_set_route_peer_messages API added to let the bus send
- peer messages directly to an app
-- Autolaunch abilities added to dbus-launch with the --autolaunch flag
- This feature allows libdbus to start a session bus if none can be found
- This is an internal feature and should not be used by scripts
- DBUS_SESSION_BUS_ADDRESS is still the correct way to specify a session bus
-- dbus-launch now prints out a simple key value pairs instead of shell scripts
- if one of the shell flags aren't used
-- support DBUS_BLOCK_ON_ABORT env variable to cause blocking waiting for gdb
-- weak ref are now held for shared connections so the right things happen
- this fixes some pretty major bugs with the way connections were handled
-- Some refactoring for Windows (doesn't effect Unix)
-- Solaris build fixes
-- MacOSX build fixes
-- Cross compile build fixes. We now assume getpwnam_r is posix and va_lists
- can be copied by value since we can't check this in a cross compile. If
- this is not true for a particular target is up to the developer to patch.
-- Bug fixing all around
-
-D-Bus 1.0 RC 1 (0.93) (14 September 2006)
-==
-- dbus_threads_init_default added for initalizing threads without the need for
- bindings
-- Filters are now properly removed
-- dbus_connection_open now holds a hard ref to shared connections
-- We now print out a warning and do nothing when someone tries to close a
- shared connection
-- The --introspect switch has been added to the bus for printing out
- introspection data without actually running the bus
-- LOCAL_CREDS socket credentials are now supported for systems which
- support it such as NetBSD
-- Generalize kqueue support so it works with NetBSD as well as FreeBSD
-- Numerous bug fixes and memory leaks patched
-
-D-Bus 0.92 (18 August 2006)
-==
-- Proper thread locking added to pending calls
-- Threading semantics changed from init early to init before the second thread
- is started
-- Correctly error out when an application tries to acquire or release the
- org.freedesktop.DBus name instead of sending false result codes
-- kqueue directory watching code can now be used to monitor config file changes
- on FreeBSD
-- --with-dbus-daemondir configure switch added so the daemon can be installed
- separate from the user binaries
-- Makefiles fixed for cygwin
-- Various fixes for the ongoing Windows port
-- Fixed docs and comments to use the D-Bus spelling instead of D-BUS
-- Many memleaks and bugs fixed
-
-D-Bus 0.91 (24 July 2006)
-==
-- Remove some lingering bits left over from the bindings split
-- Fix assertion causing D-Bus applications to crash when checks are enabled
-- Fix a timeout bug which would block applications from being auto started
-
-D-Bus 0.90 (17 July 2006)
-==
-- API/ABI freeze for 1.0
-- Bindings are now split out into seperate packages
-- ListActivatableNames added as a method on the bus
-- Removed deprecated dbus_connection_disconnect (use dbus_connection_close)
-- Shared connections are now unreffed on disconnect
-- Fixed pending calls for threaded enviornments
-- Pending calls get timed out on connection disconnect
-- dbus_connection_send_with_reply returns TRUE and a NULL pending call
- if you call it on a connection object which has been disconnected already
- (it returns FALSE on Out of Memory errors only)
-- dbus-monitor now correctly catches methods, not just signals
-- dbus-monitor now prints object paths
-
-D-BUS 0.62 (12 June 2006)
-==
-- Doc fixes
-- Added support for all data-types for the dbus tools
-- Fixed eavesdropping on method calls (dbus-monitor)
-- Fixed silent dropping of method calls with interface=NULL
-- Fixed console ownership problems in Solaris
-- Fixed installation of dbus-signature.h and #include it in dbus/dbus.h
-- Flush the user database cache on config reload
-- GLib bindings:
- - Fix memory leaks
- - Fix properties in DBusGProxy so that they can be given in any
- order
- - Added lots of assertions to ensure correct use
- - Remove duplicated code
- - Fix static string pointer uses in GPtrArray-based collections
-- Python bindings:
- - Remove reference to sys/cdefs.h
-- Qt4 bindings:
- - Code reorganized
- - Added the dbusidl2cpp, dbuscpp2xml and dbus tools
- - Added example programs (ping-pong, complex ping-pong, listnames, chat)
- - Updated selftests
- - Fixed compilation and .moc- and .ui-file processing and cleaning
- - Made central classes derive from QObject
- - Enhance error reporting
- - Many bugfixes
-- Mono bindings:
- - Minor bugfixes
-
-D-BUS 0.61 (24 Febuary 2006)
-==
-- Documentation all around
-- dbus-launch now produces correct sh and csh syntax
-- Nested arrays now work correctly
-- GLib bindings:
- - Inheriting from DBusGProxy is now possible
- - GPtrArrays can now be marshalled
- - org.freedesktop.DBus.GLib.ClientCSymbol annotation added
- - Openning connections to arbitrary addresses now supported
-- Python bindings:
- - sender_keyword and path_keyword keywords added to signal listener API
- - Byte types now demarshal to unsigned char
- - calling methods now do the correct thing
-- Qt bindings:
- - both Qt3 and Qt4 bindings can be built at the same time
- - Use the standard org.freedesktop.DBus.Method.NoReply annotation
- for the "async" calls instead of creating one for us.
-- Mono bindings:
- - 64bit arch fixes
-- Massive bug fixing all around
-
-D-BUS 0.60 (30 November 2005)
-==
-
-- major ABI/API changes - sonames changed
-- RequestName queuing behavior has changed (refer to dbus-specification)
- - DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT has been removed and
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT has been added to the flags
-- signals emitted by the bus now show up in the introspect data
-- auth EXTERNAL now supported on BSD varients
-- ReleaseName method added to the bus to allow a service
- to remove itself as owner of a bus name
-- dbus_connection_read_write added for getting messages off the bus
- in the absence of a mainloop
-- Qt4 bindings added and the Qt3 bindings have been depricated
-- python bindings:
- - marshal using introspect data if available
- - better exception handling and propigation
- - private connections are now supported
- - UTF-8 cleanups
- - out_signature added to method decorators for specifying
- how the return values should be marshaled
- - sender_keyword added to method decorators for specifying
- and argument to provide the unique name of the method caller
- - async_callbacks added to method decorators
- - multiple inheritance of classes now supported
-- GLib bindings:
- - respect NoReply annotations
- - dbus_g_method_return_get_reply and dbus_g_method_return_send_reply
- added to the lowlevel code for use when the dbus-glib marshalling
- code is not adiquate
-- numerous bug fixes all around
-
-D-BUS 0.50 (06 September 2005)
-===
-This is a minor release from 0.36.2. The series number has changed
-not because of any technical reasons but as an indication that we
-are moving closer to 1.0. It is hoped that this will be the last
-series to see major changes, most of which will be isolated to the
-GLib and Python bindings, as we transition to concentrate more on
-bug busting and code auditing.
-
-- D-Bus builds on the Cygwin platform
-- Makefile cleanups
-- Various bug fixes
-- Optimization of the dbus object tree
-- Memleaks and GIL crasher bugs have been fixed in the Python bindings
-
-D-BUS 0.36.2 (29 August 2005)
-===
-- Security: Restrict other users from connecting to another users
- session bus
-
-D-BUS 0.36.1 (24 August 2005)
-===
-- Python Bindings:
- - fixed to work with hal-device-manager
- - For 64bit builds everything is installed to lib64/python2.4/
- since Python can't handle multilib
-
-D-BUS 0.36 (23 August 2005)
-===
-- Maximum sized of cached messages have been reduced to 10K
-- Match rules now allow matching on arguments inside the message
-- introspect.xsl XSLT style sheet added for formatting introspection
- data into XHTML for analysis
-- Python bindings:
- - now have working type objects for explicit
- typecasting
- - Variant type has been added
- - Dictionaries, Variants and Arrays can all be passed the signiture or
- type(s) of their children
- - the optional timeout= keyword has been added when making method calls
- - match on args has been implemented
- - a .pth file has been added for dealing with libraries and python files
- being in different directories such as in 64bit installs
- - various bug fixes
-- GLib bindings:
- - deeply recursive types now supported
- - many symbols are no longer exported as part of the public API
- - various memleak and other bug fixes
-
-D-BUS 0.35.2 (17 July 2005)
-===
-- Rename Unix Security Context to SELinux Security Context in API
-- Fixed more dist errors that distcheck didn't pick up on
-- Fixed various bugs in the python bindings that prevented them from working
-
-D-BUS 0.35.1 (16 July 2005)
-===
-- Fixed dist error where python/dbus_bindings.pxd was being shipped
- instead of dbus_bindings.pxd.in
-- Use this instead of the 0.35 tarball
-
-D-BUS 0.35 (15 July 2005)
-===
-- --with-dbus-user added to the configure scripts for configuring the
- user the system bus runs on
-- --with-console-auth-dir added to configure scripts for configuring the
- directory to look in for console user locks
-- service files for auto-starting D-Bus services now has the ability to pass
- in command line arguments to the executable
-- Huge auto-start bug squashed which caused some services not to start when
- requested in rapid succession
-- SE-Linux security contexts can now be appended to messages for inspection
- by services that enforce their own security policies
-- Colin says the GLib binding are ready for general consumption
-- New GLib tutorial
-- New GLib example code
-- Python bindings are now version (0,42,0)
-- Python bindings API has changed on the service side
-- dbus.service has been split out as a seperate module
-- dbus.service.Service is renamed to dbus.service.BusName
-- dbus.service.Object has swapped the bus_name and object_path constructor
- parameters to make it easier to do inheritance over the bus
-- dbus.glib has been seperated out in order to lessen the dependency on glib
- and to allow other mainloops to be integrated with the bindings including
- a planned generic mainloop for non-gui apps.
-- Python bindings now aquire the GIL when calling back into the python
- interpreter. Fixes crashes when using threading and other random segfaults.
-- New Python tutorial
-- Numerous D-Bus bug fixes all around
-
-D-BUS 0.34 (15 June 2005)
-===
-- dbus_connection_disconnect is deprecated in favor of dbus_connection_close
-- The bus can now use D_NOTIFY (if available) to check when configuration files
- have changed and reload them
-- New dbus_message_has_path/member/interface API added
-- The Ping message from the org.freedesktop.DBus.Peer interface is now handled
-- Complete glib bindings overhaul (and are still under construction)
-- Tutorial now has an updated GLib section
-- GLib bindings can now send/receive hash tables, arrays and other complex types
-- Python bindings overhaul (most public facing API's done)
-- Python bindings have been split up into separate files
-- Python added new type classes for hinting to the marshaler what type
- to send over the wire
-- Python bindings now have decorators for specifying exported methods and signals
-- Numerous bug fixes
-
-D-BUS 0.33 (25 Apr 2005)
-===
-
-- downgrade requirement from GTK+-2.6 to 2.4 for building gtk components
-- python binding API's have been overhalled to be more "pythonic" and cleaner
-- python bindings now export dbus.version which is set to (0,40,0)
-- python bindings now implement the org.freedesktop.DBus.Introspectable interface
-- python binding match rules are now more flexable
-- make check has been fixed
-- many, many major bug fixes
-
-D-BUS 0.32 (29 Mar 2005)
-===
-
-- mono bindings now compiles correctly
-- mono binding cleanups
-- glib bindings generates wrappers for bus methods in dbus-glib-bindings.h
-- glib binding cleanus
-- users and groups can now be specified by UID and GID in config files
-- numerous memory leak fixes
-- various other fixes
-
-D-BUS 0.31 (07 Mar 2005)
-===
-
-- land the new message args API and recursive type system
-- add docs and fixed Doxygen warnings throught source
-- split out some functions not needed in libdbus to *-util.c source files
-- take out type convienience functions
-- libdbus now back below 150K
-- booleans are now 32-bit instead of 8-bit
-- specification updated
-- grand renaming to strip out the use of "service"
- just say "name" instead (or "bus name" when ambiguous)
-- rename dbus-daemon-1 to dbus-daemon throughout
-- rename activation to auto-start
-- auto-start on by default now
-- note that libdbus is the low-level API
-- python bindings updated to the new API
-- mono bindings updated to the new API
-- add 16 bit types
-- dictionaries are now ARRAYS of DICT_ENTRY
-- dbus-glib-tool renamed to dbus-binding-tool
-- massive rewrite of the glib bindings
-- saner names for the dbus interface, object path and service defines
-- new functions for handling type signitures
-- bump sonames for libdbus and libdbus-glib
-- various small fixes
-
-D-BUS 0.23 (11 Jan 2005)
-===
-
-- add setgroups() to drop supplementary groups
-- updated SELinux support
-- add an "at console" security policy
-- fix a bug where org.freedesktop.DBus wasn't recognized as an existing
- service.
-- error out if --enable-mono is explicitly set and mono libs can't be found
-- set the max_match_rules_per_connection limit from the config file.
-- removed dbus_bug_get_with_g_main since it's been replaced by
- dbus_g_bus_get
-- fix fd leaks in socket code
-- lots and lots of mono binding updates, including fixes to make it
- compatible with Mono 1.1.3
-- added --nofork option to override config file setting at runtime
-- added support for int64 and uint64 to the python bindings
-- lots of python binding updates
-- config file DTD updates
-- use SerivceOwnerChanges signal instead of ServiceCreated and
- ServiceDeleted
-- fixes to the authentication code
-- new init script for Slackware
-- print out the pid even when --fork is passed
-- increase preallocation sizes in DBusMessage to heavily reduce
- reallocs
-- lots of performance enhancements
-- lots more small bug fixes
-
-D-BUS 0.22
-===
-
-- add --reply-timeout to dbus-send
-- fix a memleak
-- fix Solaris/Forte build
-- switch to AFL 2.1 rather than 2.0 to address patent termination clause
- concerns
-- add SELinux support
-- mostly repair libxml backend for config parser, still doesn't
- pass out of memory tests
-- fix distcheck to include language bindings
-- add GetConnectionUnixUser method on bus driver
-- also for UnixProcessID
-- lots of Python, Mono, other binding fixes
-- change GLib bindings to not include dbus/dbus.h (fully encapsulate libdbus)
-- pass paths as strings, not arrays of string
-- add message signature header field
-- cleanups to marshaling code
-- clean up authentication code
-- reload conf files on SIGHUP
-- rename SERVICE/SENDER_SERVICE to DESTINATION/SENDER
-- fix circular conf file inclusion
-- allow empty arrays
-- tons of other small bugfixes
-
-D-BUS 0.21
-===
-
-- implement "auto activation" flag on messages, so the destination
- service can be launched automatically
-- fix a bug in custom type marshaling
-- optimize case where multiple apps activate the same service
- (avoid "thundering herd")
-- add dynamic service file discovery/reloading
-- fix a busy loop when blocking for a reply
-- fix a 64-bit crash involving varargs
-- fix a bus crash when processing an AcquireService
-- allow appending TYPE_BYTE via append_args_valist
-- fix dicts-inside-dicts
-- enhancements to Python and Qt bindings
-
-D-BUS 0.20
-===
-
-This release lands some very large API changes and numerous bugfixes.
-The list of changes is too large to fully document here; please refer
-to the documentation, and message-bus-list archives.
-
-D-BUS 0.13
-===
-
-This is probably the last release before landing the large API changes
-on the "dbus-object-names" branch.
-
-- fix system bus to always use filesystem socket; anyone
- can create any abstract socket, which isn't secure
- since if you can crash the system bus you'd be able
- to replace it.
-- add DTD for configuration file
-- improve specification a bit
-
-D-BUS 0.12
-===
-
-- fix "service messagebus status" on Red Hat
-- fix demarshaling of DBUS_TYPE_NAMED
-- fix "eval `dbus-launch --exit-with-session`" to exit properly
-- fix build without --prefix
-- useless fooling with Mono bindings
-- useless fooling with gcj bindings
-- fix srcdir != builddir
-- fix various compiler warnings and other issues
-- add get/set data to DBusMessage
-- fix headers for C++
-- OS X build fixes
-- abstract domain sockets support (Linux only)
-- add dbus-cleanup-sockets utility for people
- not using linux
-- be consistent about defaulting to --session/--system
- with command line tools
-- merge in policies from included config files
-- fix build on non-x86
-- docs updates
-- lots of other bugfixes
-
-D-BUS 0.11
-===
-
-- add --enable-docs to turn off/on the docbook stuff
- (doesn't cover doxygen stuff yet)
-- make people define DBUS_API_SUBJECT_TO_CHANGE
- and read warning in README so they don't
- expect the API to be frozen already
-- rename .pc files to "dbus-1.pc" instead of
- "dbus-1.0.pc" etc. - this will require changing
- pkg-config invocations
-- some docs cleanups
-- add man pages for all executables
-- allow send to/from bus driver in the default system.conf
-- fix user lookup bug
-- implement dbus-launch to launch the session message bus
-- fix some thread deadlocks
-- some performance profiling/optimization
-- add dbus_bus_activate_service() function
-- fix some minor bugs here and there
-- install Red Hat initscript in the right place
-
-D-BUS 0.10
-===
-
-- reversed order of args to dbus_message_new()
-- renamed dbus_message_name_is() and some other
- functions
-- change DBusWatch to have dbus_watch_handle()
- similar to dbus_timeout_handle(), drop
- connection/server-specific handle routines
-- change message serials to be unsigned
-- implemented <allow>/<deny>/<limit> features for
- config file; system bus now has a deny-all policy
- by default.
-- system.conf has <includedir>system.d</includedir>
- so packages can install additions to the default
- policy to <allow> the messages they need. e.g.
- CUPS might install a cups.conf - see
- test/data/valid-config-files/system.d/test.conf
- for an example.
-- add timeouts for authentication, activation
-- add glib-style "checks" on public API, enable
- those by default, disable assertions by default
-- add GMainContext argument to GLib setup functions,
- can be NULL for default context. Needed for threads.
-- add 64-bit integer type
-- validate type of standard message header fields
-- consider messages in the org.freedesktop.Local
- namespace to be invalid (to avoid fake disconnect
- messages for example)
-- fix assorted memory leaks and other bugs in
- the SHA-1 auth mechanism
-- cache user database information (groups user is
- in, etc.) helps a lot with NIS
-- always store uid_t, pid_t, gid_t in "ulong"
- rather than "int"
-- implement config file settings for which
- users can connect
-- SHA-1 unit test
-- dbus-send, dbus-monitor command line utilities
-- fixed lots of misc crashes and other bugs
-
-D-BUS 0.9
-===
-
-- implemented a test case for service activation,
- and fixed many bugs exposed by that
-- implemented recursive argument marshaling/demarshaling
- for messages, allowing multidimensional arrays
-- fixed up integration of message dispatch with
- main loop by adding a callback on change of
- dispatch status
-- add a pidfile feature to daemon
-- some build fixes
-- clean up unix domain sockets on exit
-- add --print-address and the ability
- to create a random server address
- in a temporary directory
-
-D-BUS 0.8
-===
-
-- fix dumb bug in 0.7
-
-D-BUS 0.7
-===
-
-- implement configuration file used to control bus characteristics
-- implement daemon mode, changing user ID, and other system
- bus features
-- add init scripts for systemwide bus
-- add "make check-coverage" target to check test coverage
-- more test suite additions
-- many, many bugfixes
-- many API changes/fixes
-
-D-BUS 0.6
-===
-- Vastly improved bus daemon test suite
-- Lots of misc. bugfixes and memory leak fixes
-- Support for marshalling key/value data
-- Activation improvements.
-
-D-BUS 0.5
-===
-
-- Specification updates
-- port to OS X and other BSD variants
-- port to Solaris
-- Partial work on cookie-based authentication
-- Thread safety fixes
-- Lots of misc. bugfixes
-- Support for more array types
-- Add data slots to DBusServer
-- DBusString security audit fixes
-- Fix for systems (or valgrind) with unaligned malloc blocks
-
-D-BUS 0.4
-===
-
-- Preliminary activation support.
-- Better authentication test suite
-- Bus test program
-- Specification updates
-- Thread safety
-- Bug fixes
-
-D-BUS 0.3
-===
-
- - Preliminary limitations
- - Message sending works
- - Bus client
- - Array marshalling/demarshalling
- - Services
- - Better OOM handling in the bus
- - In-proc debug transport
- - Transport/server address support
-
-D-BUS 0.2
-===
-
- - Include test code in the tarball.
-
-D-BUS 0.1
-===
-
- - Initial release.
diff --git a/src/3rd_party/dbus-1.7.8/NEWS.pre-1-2 b/src/3rd_party/dbus-1.7.8/NEWS.pre-1-2
deleted file mode 100644
index d9898f8e4d..0000000000
--- a/src/3rd_party/dbus-1.7.8/NEWS.pre-1-2
+++ /dev/null
@@ -1,153 +0,0 @@
-D-Bus 1.2.1 (04 April)
-==
-- Due to issues putting the re-licensing effort on hold indefinitely, it has
- been decided to move to 1.2.x versioning scheme. Being that 1.1.20 is
- considered to also be 1.2.0 and this being the second release in the 1.2.x
- stable series we have versioned this release 1.2.1. This release contains a
- number of bug fixes identified after 1.1.20.
-- compiles under some older versions of glibc
-- compiles without X support once again
-- fix stuck server grab if dbus-launch is run in an existing D-Bus X session
-- various Mac OSX build fixes added
-- don't use the broken poll call on Mac OSX
-- better checks for linker flag support should allow D-Bus to link under
- various linkers
-- exit_on_disconnect is set after the connection registers with a bus so we
- don't exit if we get a disconnect during the handshake
-- dicts now work correctly with dbus-send
-- inotify backend is now less aggressive
-- pending calls expire correctly
-- memleak of uuid when the bus is autolaunched fixed
-
-D-Bus 1.1.20 - "Conisten Water" (27 Febuary)
-==
-
-- This is the next generation supported STABLE release of D-Bus. For all
- intents and purposes this is the 1.2.0 release WITHOUT the planned X11/MIT
- license change due to a couple of license holders who have yet to respond.
- For the most part this license change is being persued to simplify licensing
- issues and fix a couple of licensing courner cases. When this happens D-Bus
- will be released under the 1.2.0 version.
-
-- D-Bus 1.0.x effectively goes into security fix mode and will only be
- updated for major issues.
-
-- Fixed CVE-2008-0595 - security policy of the type <allow send_interface=
- "some.interface.WithMethods"/> work as an implicit allow for
- messages sent without an interface bypassing the default deny rules and
- potentially allowing restricted methods exported on the bus to be executed
- by unauthorized users.
-
-- Fixes dbus-launch so the session bus goes away so does D-Bus
-
-- Builds against latest gcc/glibc changes
-
-- Correctly unref connections without guids during shutdown
-
-- About the name: Submitted by Greg K Nicholson, Conisten Water is a lake in
- Cumbria, England where several water speed records have been broken. Between
- 1956 and 1959 Sir Malcolm's son Donald Campbell set four successive records on the lake in Bluebird K7, a hydroplane.
- (Wikipedia http://en.wikipedia.org/wiki/Coniston_Water#Waterspeed_record)
-
-D-Bus 1.1.4 - 1.2.0RC2 (17 January 2007)
-==
-- Fixes inotify support
-
-D-Bus 1.1.3 - 1.2.0RC1 (15 January 2007)
-==
-
-- This release is intended to be Release Candidate 1 of major release
- D-Bus 1.2.0. If nothing is found to be wrong with this release it
- will become 1.2.0 within a week. If we need to make major changes
- we will release an RC2 and start the process over again.
-
-- This is a development release, so API's may still change if problems
- are found (though this is extreamly unlikely).
-
-- DTD for the introspection format is fixed and uploaded to the servers
-
-- Sources now reside in a git repository at
- http://gitweb.freedesktop.org/?p=dbus/dbus.git;a=summary
-
-- Argument path matching of the type arg0path='/aa/bb/' is now supported
- (see the specification for more information)
-
-- New error org.freedesktop.DBus.Error.ObjectPathInUse added
-
-- Autolaunched busses now save their parameters in X11 if possible making them
- behave closer to busses launched through the normal mechanisms
-
-- inotify is now the default backend for watching configuration file changes
-
-- More support for the AIX platform has been added
-
-- Numerous bug fixes and performance enhancements
-
-D-Bus 1.1.2 (27 July 2007)
-==
-
-- This release is intended to be a feature complete beta for stable
- release 1.2.0, please test it. 1.2.0 will follow pretty soon if no
- major problems are found. We'll do more betas if significant
- changes are made.
-
-- This is a development release, so API's may still change if problems
- are found (though we will try hard not to).
-
-- The system bus now supports starting services on demand. This uses a
- setuid helper program because system bus daemon runs as a nobody
- user, while services it launches may need to run as a different
- user.
-
- ***Extra eyes auditing the setuid helper are encouraged and would be
- timely right now, before 1.2.0***
-
- A design doc is available in doc/system-activation.txt
-
-- The TCP address format has been enhanced, such that TCP may be
- actually usable. The dbus-daemon man page describes the new
- elements in the address format. 1.1.1 had added an all_interfaces
- flag to the format, which has been removed in favor of a cleaner
- approach.
-
-- Some thread-related bugs have been fixed, these are important fixes
- if you are using multiple threads with libdbus, and not important
- otherwise.
-
-
-D-Bus 1.1.1 (18 June 2007)
-==
-- This is a development release, unless you need specific
- functionality please use the stable releases as API's may change
- (though we will try hard not to)
-- The bus daemon now generates a globally-unique ID for itself, which is available
- using the convenience function dbus_bus_get_id(). Use this as a unique ID
- for a user's session, for example.
-- dbus_server_get_id(), dbus_connection_get_server_id() now available to access
- the unique ID of a particular address
-- dbus_watch_get_fd() deprecated since it had unclear cross-platform semantics.
- dbus_watch_get_unix_fd() and dbus_watch_get_socket() replace it.
-- support ANONYMOUS mechanism for authentication, which allows a client to
- authenticate as nobody in particular
-- add API dbus_connection_set_allow_anonymous() which will allow the message
- stream to begin if the client auths as anonymous (otherwise, the client
- will be dropped unless they auth as a user).
-- the ANONYMOUS support means you can now use D-Bus (without a bus daemon) as
- a protocol for a network service provided to anonymous Internet or LAN
- clients
-- many internal changes to better support the Windows port, though the
- port is still not complete in this release
-- some improved documentation and return_if_fail checks
-- some small bug fixes
-
-D-Bus 1.1.0 (25 May 2007)
-==
-- first release in the development series, unless you need specific
- functionality please use the stable releases as API's may change
- (though we will try hard not to)
-- better eavesdropping support now picks up reply messages for debugging
-- .pc file now lists the directory the daemon is installed into (daemondir)
-- GetAll call added to the properties interface
-- support for message serialization added for use with external transports like
- TUBES!!!
-- many bugs fixed
diff --git a/src/3rd_party/dbus-1.7.8/README b/src/3rd_party/dbus-1.7.8/README
deleted file mode 100644
index aea83300cc..0000000000
--- a/src/3rd_party/dbus-1.7.8/README
+++ /dev/null
@@ -1,165 +0,0 @@
-Sections in this file describe:
- - introduction and overview
- - low-level vs. high-level API
- - version numbers
- - options to the configure script
- - ABI stability policy
-
-Introduction
-===
-
-D-Bus is a simple system for interprocess communication and coordination.
-
-The "and coordination" part is important; D-Bus provides a bus daemon that does things like:
- - notify applications when other apps exit
- - start services on demand
- - support single-instance applications
-
-See http://www.freedesktop.org/software/dbus/ for lots of documentation,
-mailing lists, etc.
-
-See also the file HACKING for notes of interest to developers working on D-Bus.
-
-If you're considering D-Bus for use in a project, you should be aware
-that D-Bus was designed for a couple of specific use cases, a "system
-bus" and a "desktop session bus." These are documented in more detail
-in the D-Bus specification and FAQ available on the web site.
-
-If your use-case isn't one of these, D-Bus may still be useful, but
-only by accident; so you should evaluate carefully whether D-Bus makes
-sense for your project.
-
-Note: low-level API vs. high-level binding APIs
-===
-
-A core concept of the D-Bus implementation is that "libdbus" is
-intended to be a low-level API. Most programmers are intended to use
-the bindings to GLib, Qt, Python, Mono, Java, or whatever. These
-bindings have varying levels of completeness and are maintained as
-separate projects from the main D-Bus package. The main D-Bus package
-contains the low-level libdbus, the bus daemon, and a few command-line
-tools such as dbus-launch.
-
-If you use the low-level API directly, you're signing up for some
-pain. Think of the low-level API as analogous to Xlib or GDI, and the
-high-level API as analogous to Qt/GTK+/HTML.
-
-Version numbers
-===
-
-D-Bus uses the common "Linux kernel" versioning system, where
-even-numbered minor versions are stable and odd-numbered minor
-versions are development snapshots.
-
-So for example, development snapshots: 1.1.1, 1.1.2, 1.1.3, 1.3.4
-Stable versions: 1.0, 1.0.1, 1.0.2, 1.2.1, 1.2.3
-
-All pre-1.0 versions were development snapshots.
-
-Development snapshots make no ABI stability guarantees for new ABI
-introduced since the last stable release. Development snapshots are
-likely to have more bugs than stable releases, obviously.
-
-Configuration
-===
-
-dbus could be build by using autotools or cmake.
-
-When using autotools the configure step is initiated by running ./configure
-with or without additional configuration flags. dbus requires GNU Make
-(on BSD systems, this is typically called gmake) or a "make" implementation
-with compatible extensions.
-
-When using cmake the configure step is initiated by running the cmake
-program with or without additional configuration flags.
-
-Configuration flags
-===
-
-When using autotools, run "./configure --help" to see the possible
-configuration options and environment variables.
-
-When using cmake, inspect README.cmake to see the possible
-configuration options and environment variables.
-
-API/ABI Policy
-===
-
-Now that D-Bus has reached version 1.0, the objective is that all
-applications dynamically linked to libdbus will continue working
-indefinitely with the most recent system and session bus daemons.
-
- - The protocol will never be broken again; any message bus should
- work with any client forever. However, extensions are possible
- where the protocol is extensible.
-
- - If the library API is modified incompatibly, we will rename it
- as in http://ometer.com/parallel.html - in other words,
- it will always be possible to compile against and use the older
- API, and apps will always get the API they expect.
-
-Interfaces can and probably will be _added_. This means both new
-functions and types in libdbus, and new methods exported to
-applications by the bus daemon.
-
-The above policy is intended to make D-Bus as API-stable as other
-widely-used libraries (such as GTK+, Qt, Xlib, or your favorite
-example). If you have questions or concerns they are very welcome on
-the D-Bus mailing list.
-
-NOTE ABOUT DEVELOPMENT SNAPSHOTS AND VERSIONING
-
-Odd-numbered minor releases (1.1.x, 1.3.x, 2.1.x, etc. -
-major.minor.micro) are devel snapshots for testing, and any new ABI
-they introduce relative to the last stable version is subject to
-change during the development cycle.
-
-Any ABI found in a stable release, however, is frozen.
-
-ABI will not be added in a stable series if we can help it. i.e. the
-ABI of 1.2.0 and 1.2.5 you can expect to be the same, while the ABI of
-1.4.x may add more stuff not found in 1.2.x.
-
-NOTE ABOUT STATIC LINKING
-
-We are not yet firmly freezing all runtime dependencies of the libdbus
-library. For example, the library may read certain files as part of
-its implementation, and these files may move around between versions.
-
-As a result, we don't yet recommend statically linking to
-libdbus. Also, reimplementations of the protocol from scratch might
-have to work to stay in sync with how libdbus behaves.
-
-To lock things down and declare static linking and reimplementation to
-be safe, we'd like to see all the internal dependencies of libdbus
-(for example, files read) well-documented in the specification, and
-we'd like to have a high degree of confidence that these dependencies
-are supportable over the long term and extensible where required.
-
-NOTE ABOUT HIGH-LEVEL BINDINGS
-
-Note that the high-level bindings are _separate projects_ from the
-main D-Bus package, and have their own release cycles, levels of
-maturity, and ABI stability policies. Please consult the documentation
-for your binding.
-
-Bootstrapping D-Bus on new platforms
-===
-
-A full build of D-Bus, with all regression tests enabled and run, has some
-dependencies which themselves depend on D-Bus, either for compilation or
-for some of *their* regression tests: GLib, dbus-glib and dbus-python are
-currently affected.
-
-To avoid circular dependencies, when bootstrapping D-Bus for the first time
-on a new OS or CPU architecture, you can either cross-compile some of
-those components, or choose the build order and options carefully:
-
-* build and install D-Bus without tests
- - do not use the --enable-modular-tests=yes configure option
- - do not use the --enable-tests=yes configure option
-* build and install GLib, again without tests
-* use those versions of libdbus and GLib to build and install dbus-glib
-* ... and use those to install dbus-python
-* rebuild libdbus; this time you can run all of the tests
-* rebuild GLib; this time you can run all of the tests
diff --git a/src/3rd_party/dbus-1.7.8/README.cygwin b/src/3rd_party/dbus-1.7.8/README.cygwin
deleted file mode 100755
index 904cbb44cd..0000000000
--- a/src/3rd_party/dbus-1.7.8/README.cygwin
+++ /dev/null
@@ -1,6 +0,0 @@
-The cygwin dbus port is included in master branch of
-dbus git repository since 1.3.1.
-
-The cygwin port of dbus is maintained by:
-
-http://sourceware.org/cygwinports/
diff --git a/src/3rd_party/dbus-1.7.8/README.launchd b/src/3rd_party/dbus-1.7.8/README.launchd
deleted file mode 100644
index 701e57dd52..0000000000
--- a/src/3rd_party/dbus-1.7.8/README.launchd
+++ /dev/null
@@ -1,61 +0,0 @@
-Launchd[1,2] replaces init, inetd and cron on Mac OS X since 10.4 "Tiger".
-dbus uses this service to provide a common session bus address for each user
-and so deprecates the X11 enabled dbus-launcher.
-
-[1] http://developer.apple.com/MacOsX/launchd.html
-[2] http://launchd.macosforge.org/
-
-
-Setup
-===
-
-Configure with --enable-launchd and --without-x (X11 should not harm but it's
-simply not necessary any more)
-After installation, to prevent a reboot, load the dbus session starter into
-launchd by executing:
-$ launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
-
-You can change the launch agent dir via configure, but it's not recommended.
-Make sure to execute the above line as the actual user for which you want to
-use a session bus since launchd manages its agents on a per user basis.
-
-
-How it works
-===
-
-Launchd allocates a socket and provides the unix path to it via the variable
-DBUS_LAUNCHD_SESSION_BUS_SOCKET in launchd's environment. Every process
-spawned by launchd (or dbus-daemon, if stared by launchd) can access it through
-its own environment. Other processes can query launchd for it by executing:
-$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
-However, this is normally done by the dbus client lib for you.
-
-If launchd start dbus-daemon with a config file containing a "launchd:env=FOO"
-address, as the default session config does with env=DBUS_LAUNCHD_SESSION_BUS_SOCKET,
-the daemon will get the file descriptor from launchd and start listening on it.
-The environment variable is used to get the actual socket path which is passed
-to every service spawned by dbus-daemon as a result from autolaunch messages.
-Please note that it's not possible to start dbus-daemon manually when using a
-"launchd:" address. Only child processes of launchd can access the above
-mentioned file descriptor!
-
-To create custom buses just set up an other launch agent. As a quick start copy
-/Library/LaunchAgents/org.freedesktop.dbus-session.plist, change the label
-to i.e. "org.freedesktop.dbus-foo" and change the SecureSocketWithKey value,
-i.e. to "DBUS_LAUNCHD_FOO_BUS_SOCKET". This environment variable has to be set
-in the config file for your new bus in the <listen> element (see session.config).
-Then edit your /Library/LaunchAgents/org.freedesktop.dbus-foo.plist to start
-dbus-daemon with "--config-file=/opt/local/etc/dbus-1/foo.conf" instead of
-"--session". Now load the new plist onto launchd as described in the setup
-section of this document.
-Executing "launchctl export" should now give you two sockets, one in
-DBUS_LAUNCHD_SESSION_BUS_SOCKET and the new DBUS_LAUNCHD_FOO_BUS_SOCKET.
-To connect to this new bus use "launchd:env=DBUS_LAUNCHD_FOO_BUS_SOCKET".
-
-Since Mac OS X 10.5 "Leopard" you can also configure launchd to start
-dbus-daemon on demand as soon as some process connects to the socket. Since
-it's broken on 10.4 this feature is disabled per default. Look at
-/Library/LaunchAgents/org.freedesktop.dbus-session.plist to change it.
-
-On the client side, the envvar DBUS_SESSION_BUS_ADDRESS can be normally used
-but if it's not set, launchd is queried for the session bus socket.
diff --git a/src/3rd_party/dbus-1.7.8/README.valgrind b/src/3rd_party/dbus-1.7.8/README.valgrind
deleted file mode 100644
index c13f53045d..0000000000
--- a/src/3rd_party/dbus-1.7.8/README.valgrind
+++ /dev/null
@@ -1,24 +0,0 @@
-Running D-Bus clients with Valgrind
-====
-
-When running programs using libdbus in Valgrind, some special care needs to be
-taken so as to avoid incorrect detection of leaks in libdbus. To avoid these
-false positives, do the following:
-
-* Grab a copy of the D-Bus source code
-
-* Run configure with the --enable-developer and --with-valgrind options
-
-* Run make
-
-* Either make sure your code calls dbus_shutdown() (at least while running in
- Valgrind) or set DBUS_MESSAGE_CACHE=0 in your environment
-
-* Run Valgrind on your program with the /path/to/dbus/source/dbus/.libs in your
- LD_LIBRARY_PATH
-
-Your Valgrind log should now be free of any (spurious) libdbus-related leaks.
-
-For the curious, the DBUS_MESSAGE_CACHE=0 is required because by
-default, libdbus uses a recyclable pool of message structs. These help
-performance a bit.
diff --git a/src/3rd_party/dbus-1.7.8/README.win b/src/3rd_party/dbus-1.7.8/README.win
deleted file mode 100644
index 4e4f757400..0000000000
--- a/src/3rd_party/dbus-1.7.8/README.win
+++ /dev/null
@@ -1,111 +0,0 @@
------------------------------------------
-Windows port of the freedesktop.org D-Bus
------------------------------------------
-
-Features and completeness
--------------------------
-The windows port of dbus provides the dbus-1 library and mostly
-applications which are already available on unix. These applications
-are: dbus-daemon, dbus-launch, dbus-monitor and dbus-send.
-DBus comes with a test suite which is used on unix to guarantate
-production quality and this test suite runs mostly. There are some
-test not running yet and there is help needed to get them running.
-
-Supported compilers
--------------------
-On windows Microsoft Visual Studio 2010 (Express and professional variants)
-and mingw-w64|32 are known to work.
-
-Building
---------
-DBus can be built on windows using automake or cmake. See the
-file README for more information.
-Special cmake build instructions can be found in cmake/readme-cmake.txt
-
-
-windbus and dbus4win Ports
---------------------------
-The Windows ports from the windbus and dbus4win projects has been merged
-into the freedesktop git master branch, as applicable. The spec has been
-updated with windows specific stuff.
-
-
-Tests
------
- - dbus library check
- bin\dbus-test.exe <build-root>\test\data
-
- - bus daemon check
- bin\bus-test.exe <build-root>\test\data
-
- - check available names
- bin\test_names.exe
-
- - check if dbus-daemon is accessable
- bin\dbus-send.exe --session --type=method_call --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames method return sender=org.freedesktop.DBus -> dest=:1.4 array [ string "org.freedesktop.DBus"string ":1.4"]
-
- - start session dbus-daemon
- either by running
- bin\dbus-launch
- or
- start bin\dbus-daemon --session
-
- Before running these commands you may execute
- set DBUS_VERBOSE=1
- for getting debug infos
-
-
- - call function registerd in dbus
- bin\dbus-send.exe --dest=org.freedesktop.DBus --print-reply --type=method_call / org.freedesktop.DBus.StartServiceByName string:org.freedesktop.DBus.TestSuiteEchoService uint32:455 method return sender=org.freedesktop.DBus -> dest=:1.8 uint32 2
-
- note: When building with the Visual C++ IDE the *.exe files are in
- the bin/Debug and bin/Release folder, not in the bin folder.
-
-
-FAQ
----
-
-- How far is WinDBus from being usable for production ?
-
- dbus comes with a test suite which is used on unix to guarantate
- production quality and this test suite runs mostly. There are some
- test not running and we need help to get them running.
- In the pratice I and some other people are using dbus for at least more
- than four years in conjunction with kde on windows without any problems.
-
-- On UNIX D-Bus uses UNIX sockets to communicate (correct me if I'm wrong).
- What is used on Windows ?
-
- tcp sockets, there are some efforts to get named pipe running, but some
- design problems of the win32 api, we are not able to solve without
- bigger changes to the dbus code base let us stop this effort.
-
-- Do you have any clue if dbus-win32 can run in a Windows CE environment?
-
- dbus has been ported to wince, see README.wince for more information
-
-- Do you know if the C++ binding made by OpenWengo will be easily portable to Windows?
-
- The OpenWengo dbus-c++ binding has been ported to windows see in WinDBus svn
- (http://sf.net/projects/windbus)
- The related test applications are running well.
-
-
-TODO
-----
-
-October 2010:
-
-- the code wrapped with DBUS_WIN_FIXME should be inspected if it required for windows
-
-- create a dbus setup installer
-
-- implement system bus and system bus service starter
- see http://windbus.svn.sourceforge.net/viewvc/windbus/trunk/bus/bus-service-win.c
- for a starting point
-
-- implement a real login session bus
- The scope parameter of the autolaunch meta protocol could be extended to support user
- specific session busses (like already done with the amarok bundled dbus which use a
- shared memory area named "DBusDaemonAddressInfo:<username>".
- Also the dbus installer should start a session bus on user login.
diff --git a/src/3rd_party/dbus-1.7.8/README.wince b/src/3rd_party/dbus-1.7.8/README.wince
deleted file mode 100644
index 5790dcf052..0000000000
--- a/src/3rd_party/dbus-1.7.8/README.wince
+++ /dev/null
@@ -1,81 +0,0 @@
-DBus Daemon for Windows CE/Windows Mobile 6.5
-=============================================
-
-Bugs in upstream for any window version:
-* MoveFileExA < 0 result check bug
-* double dbus_free somewhere I forgot where (check in -ugly)
-* alignment issue
-* CreateProcess process information handle leak
-* _dbus_getsid NULL vs INVALID_HANDLE_VALUE
-* win_account_to_sid
-
-Customisation
-=============
-
-1) At installation, the following registry value should be set to the
-installation directory of the dbus installation (the directory
-containing the bin, etc, share folders):
-
-HKLM\Software\freedesktop\DBus\Install Directory
-
-2) Instead of environment variable DBUS_VERBOSE, use
-HKLM\Software\freedesktop\DBus\Verbose
-
-2) The keyring directory is MYDOCUMENTS\dbus-keyrings, not
-HOMEPATH\.dbus-keyrings.
-
-
-Compilation
-===========
-
-./configure --host=arm-mingw32ce CPPFLAGS=-I/path/to/expat/include LDFLAGS=-L/path/to/expat/lib
-
-A recent version of libtool is required, with this change:
-
-2010-02-28 Pierre Ossman <ossman@ossman.lkpg.cendio.se> (tiny change)
- Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- Fix deplibs check fallback for 64-bit Windows and Windows CE.
- * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
- 'pe-arm-wince' and 'pe-x86-64'. Add note about consistency with ...
- * libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
- pattern here; sync pattern from the former.
- * tests/deplibs-mingw.at (deplibs without file command): New
- file, new test.
- * Makefile.am (TESTSUITE_AT): Update.
- * NEWS: Update.
-
-
-MB vs WCHAR
-===========
-
-Windows CE only supports the Unicode interface, while DBus Daemon uses
-the Multi-Byte interface on Windows by default. The glue code does
-not support multibyte in all cases. In particular, the _mbsrchr
-function is not correctly implemented. It could be correctly
-implemented, or dbus daemon could use the wchar interface more
-consistently on all Windows targets. For now, the Windows CE port
-will only work for filesystems without some weird characters in file
-names. Is this a serious limitation?
-
-
-Known Issues
-============
-
-Autolaunch is broken so far.
-
-Environment variables are faked. Some are punted to the registry, but
-in any case they can not be used reliably for IPC.
-
-The test suite is not ported yet.
-
-dbus-pipe.c:
- * Uses libc file descriptors. Needed for --print-address and
- --print-pid which probably don't work yet.
-
-dbus-sysdeps-win.c:
- * Backtraces have been disabled.
- * _dbus_fd_set_close_on_exec Not supported, maybe we should disable
- the warning.
- * SearchPathA: Uses HKLM\\Software\\freedesktop\\DBus\\Install Directory
- to locate binaries.
diff --git a/src/3rd_party/dbus-1.7.8/aclocal.m4 b/src/3rd_party/dbus-1.7.8/aclocal.m4
deleted file mode 100644
index a34b9793f2..0000000000
--- a/src/3rd_party/dbus-1.7.8/aclocal.m4
+++ /dev/null
@@ -1,1335 +0,0 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# ---------------------------------------------------------------------------
-# Adds support for distributing Python modules and packages. To
-# install modules, copy them to $(pythondir), using the python_PYTHON
-# automake variable. To install a package with the same name as the
-# automake package, install to $(pkgpythondir), or use the
-# pkgpython_PYTHON automake variable.
-#
-# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
-# locations to install python extension modules (shared libraries).
-# Another macro is required to find the appropriate flags to compile
-# extension modules.
-#
-# If your package is configured with a different prefix to python,
-# users will have to add the install directory to the PYTHONPATH
-# environment variable, or create a .pth file (see the python
-# documentation for details).
-#
-# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
-# cause an error if the version of python installed on the system
-# doesn't meet the requirement. MINIMUM-VERSION should consist of
-# numbers and dots only.
-AC_DEFUN([AM_PATH_PYTHON],
- [
- dnl Find a Python interpreter. Python versions prior to 2.0 are not
- dnl supported. (2.0 was released on October 16, 2000).
- m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
- python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
-
- AC_ARG_VAR([PYTHON], [the Python interpreter])
-
- m4_if([$1],[],[
- dnl No version check is needed.
- # Find any Python interpreter.
- if test -z "$PYTHON"; then
- AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
- fi
- am_display_PYTHON=python
- ], [
- dnl A version check is needed.
- if test -n "$PYTHON"; then
- # If the user set $PYTHON, use it and don't search something else.
- AC_MSG_CHECKING([whether $PYTHON version >= $1])
- AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR(too old)])
- am_display_PYTHON=$PYTHON
- else
- # Otherwise, try each interpreter until we find one that satisfies
- # VERSION.
- AC_CACHE_CHECK([for a Python interpreter with version >= $1],
- [am_cv_pathless_PYTHON],[
- for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
- test "$am_cv_pathless_PYTHON" = none && break
- AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
- done])
- # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
- if test "$am_cv_pathless_PYTHON" = none; then
- PYTHON=:
- else
- AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
- fi
- am_display_PYTHON=$am_cv_pathless_PYTHON
- fi
- ])
-
- if test "$PYTHON" = :; then
- dnl Run any user-specified action, or abort.
- m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
- else
-
- dnl Query Python for its version number. Getting [:3] seems to be
- dnl the best way to do this; it's what "site.py" does in the standard
- dnl library.
-
- AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
- [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
- AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
-
- dnl Use the values of $prefix and $exec_prefix for the corresponding
- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
- dnl distinct variables so they can be overridden if need be. However,
- dnl general consensus is that you shouldn't need this ability.
-
- AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
- AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
-
- dnl At times (like when building shared libraries) you may want
- dnl to know which OS platform Python thinks this is.
-
- AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
- [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
- AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
-
-
- dnl Set up 4 directories:
-
- dnl pythondir -- where to install python scripts. This is the
- dnl site-packages directory, not the python standard library
- dnl directory like in previous automake betas. This behavior
- dnl is more consistent with lispdir.m4 for example.
- dnl Query distutils for this directory.
- AC_CACHE_CHECK([for $am_display_PYTHON script directory],
- [am_cv_python_pythondir],
- [if test "x$prefix" = xNONE
- then
- am_py_prefix=$ac_default_prefix
- else
- am_py_prefix=$prefix
- fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
- case $am_cv_python_pythondir in
- $am_py_prefix*)
- am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
- am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
- ;;
- *)
- case $am_py_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
- ])
- AC_SUBST([pythondir], [$am_cv_python_pythondir])
-
- dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
- dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
- dnl more consistent with the rest of automake.
-
- AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
-
- dnl pyexecdir -- directory for installing python extension modules
- dnl (shared libraries)
- dnl Query distutils for this directory.
- AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
- [am_cv_python_pyexecdir],
- [if test "x$exec_prefix" = xNONE
- then
- am_py_exec_prefix=$am_py_prefix
- else
- am_py_exec_prefix=$exec_prefix
- fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
- case $am_cv_python_pyexecdir in
- $am_py_exec_prefix*)
- am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
- am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
- ;;
- *)
- case $am_py_exec_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
- ])
- AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
-
- dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
-
- AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
-
- dnl Run any user-specified action.
- $2
- fi
-
-])
-
-
-# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ---------------------------------------------------------------------------
-# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
-# Run ACTION-IF-FALSE otherwise.
-# This test uses sys.hexversion instead of the string equivalent (first
-# word of sys.version), in order to cope with versions such as 2.2c1.
-# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
-AC_DEFUN([AM_PYTHON_CHECK_VERSION],
- [prog="import sys
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
-sys.exit(sys.hexversion < minverhex)"
- AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_RUN_LOG(COMMAND)
-# -------------------
-# Run COMMAND, save the exit status in ac_status, and log it.
-# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
-AC_DEFUN([AM_RUN_LOG],
-[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
- ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- (exit $ac_status); }])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# AM_SILENT_RULES([DEFAULT])
-# --------------------------
-# Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
-AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[ --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
-esac
-dnl
-dnl A few `make' implementations (e.g., NonStop OS and NextStep)
-dnl do not support nested variable expansions.
-dnl See automake bug#9928 and bug#10237.
-am_make=${MAKE-make}
-AC_CACHE_CHECK([whether $am_make supports nested variables],
- [am_cv_make_support_nested_variables],
- [if AS_ECHO([['TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi])
-if test $am_cv_make_support_nested_variables = yes; then
- dnl Using `$V' instead of `$(V)' breaks IRIX make.
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AC_SUBST([AM_V])dnl
-AM_SUBST_NOTMAKE([AM_V])dnl
-AC_SUBST([AM_DEFAULT_V])dnl
-AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
-AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
-AM_BACKSLASH='\'
-AC_SUBST([AM_BACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
-])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([m4/as-ac-expand.m4])
-m4_include([m4/compiler.m4])
-m4_include([m4/libtool.m4])
-m4_include([m4/ltoptions.m4])
-m4_include([m4/ltsugar.m4])
-m4_include([m4/ltversion.m4])
-m4_include([m4/lt~obsolete.m4])
-m4_include([m4/pkg.m4])
-m4_include([m4/tp-compiler-flag.m4])
-m4_include([m4/tp-compiler-warnings.m4])
diff --git a/src/3rd_party/dbus-1.7.8/autogen.sh b/src/3rd_party/dbus-1.7.8/autogen.sh
deleted file mode 100755
index bff8257b4c..0000000000
--- a/src/3rd_party/dbus-1.7.8/autogen.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-
-PROJECT=dbus
-TEST_TYPE=-f
-FILE=dbus-1.pc.in
-
-DIE=0
-
-if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
- echo "Activating pre-commit hook."
- cp .git/hooks/pre-commit.sample .git/hooks/pre-commit
- chmod +x .git/hooks/pre-commit
-fi
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "You must have autoconf installed to compile $PROJECT."
- echo "Download the appropriate package for your distribution,"
- echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
- DIE=1
-}
-
-# If the user hasn't explicitly chosen an Automake version, use 1.11. This is
-# the earliest version that gives us silent rules.
-if test -z "$AUTOMAKE"; then
- AUTOMAKE=automake-1.11
- ACLOCAL=aclocal-1.11
-fi
-
-($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
- AUTOMAKE=automake
- ACLOCAL=aclocal
-}
-
-($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "You must have automake installed to compile $PROJECT."
- echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
- echo "(or a newer version if it is available)"
- DIE=1
-}
-
-LIBTOOLIZE=`which libtoolize`
-if ! test -f $LIBTOOLIZE; then
- LIBTOOLIZE=`which glibtoolize`
-fi
-
-($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "You must have libtoolize installed to compile $PROJECT."
- echo "Install the libtool package from ftp.gnu.org or a mirror."
- DIE=1
-}
-
-if test "$DIE" -eq 1; then
- exit 1
-fi
-
-test $TEST_TYPE $FILE || {
- echo "You must run this script in the top-level $PROJECT directory"
- exit 1
-}
-
-if test -z "$*"; then
- echo "I am going to run ./configure with no arguments - if you wish "
- echo "to pass any to it, please specify them on the $0 command line."
-fi
-
-$LIBTOOLIZE --copy --force
-
-$ACLOCAL -I m4 $ACLOCAL_FLAGS
-
-## optionally feature autoheader
-(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
-
-$AUTOMAKE -a $am_opt
-autoconf || echo "autoconf failed - version 2.5x is probably required"
-
-cd $ORIGDIR
-
-if test x"$NOCONFIGURE" = x; then
- run_configure=true
- for arg in $*; do
- case $arg in
- --no-configure)
- run_configure=false
- ;;
- *)
- ;;
- esac
- done
-else
- run_configure=false
-fi
-
-if $run_configure; then
- $srcdir/configure --enable-developer --config-cache "$@"
-fi
diff --git a/src/3rd_party/dbus-1.7.8/bus/Makefile.am b/src/3rd_party/dbus-1.7.8/bus/Makefile.am
deleted file mode 100644
index cd0c67daeb..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/Makefile.am
+++ /dev/null
@@ -1,283 +0,0 @@
-configdir=$(sysconfdir)/dbus-1
-dbus_daemon_execdir = $(DBUS_DAEMONDIR)
-
-DBUS_BUS_LIBS = \
- $(XML_LIBS) \
- $(SELINUX_LIBS) \
- $(THREAD_LIBS) \
- $(ADT_LIBS) \
- $(NETWORK_libs) \
- $(NULL)
-
-DBUS_LAUNCHER_LIBS = \
- $(XML_LIBS) \
- $(THREAD_LIBS) \
- $(NETWORK_libs) \
- $(NULL)
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(XML_CFLAGS) \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
- -DDBUS_COMPILATION \
- -DDBUS_STATIC_BUILD \
- $(NULL)
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-EFENCE=
-
-CONFIG_IN_FILES= \
- session.conf.in \
- system.conf.in \
- org.freedesktop.dbus-session.plist.in
-
-config_DATA= \
- session.conf \
- system.conf
-
-if DBUS_ENABLE_LAUNCHD
-agentdir=$(LAUNCHD_AGENT_DIR)
-agent_DATA=org.freedesktop.dbus-session.plist
-endif
-
-XML_SOURCES=config-loader-expat.c
-
-if DBUS_BUS_ENABLE_KQUEUE
-DIR_WATCH_SOURCE=dir-watch-kqueue.c
-else
-if DBUS_BUS_ENABLE_INOTIFY
-DIR_WATCH_SOURCE=dir-watch-inotify.c
-else
-DIR_WATCH_SOURCE=dir-watch-default.c
-endif
-endif
-
-BUS_SOURCES= \
- activation.c \
- activation.h \
- activation-exit-codes.h \
- bus.c \
- bus.h \
- config-parser.c \
- config-parser.h \
- config-parser-common.c \
- config-parser-common.h \
- connection.c \
- connection.h \
- desktop-file.c \
- desktop-file.h \
- $(DIR_WATCH_SOURCE) \
- dir-watch.h \
- dispatch.c \
- dispatch.h \
- driver.c \
- driver.h \
- expirelist.c \
- expirelist.h \
- policy.c \
- policy.h \
- selinux.h \
- selinux.c \
- services.c \
- services.h \
- signals.c \
- signals.h \
- stats.c \
- stats.h \
- test.c \
- test.h \
- utils.c \
- utils.h \
- $(XML_SOURCES)
-
-dbus_daemon_SOURCES= \
- $(BUS_SOURCES) \
- main.c
-
-dbus_daemon_LDADD= \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(EFENCE) \
- $(DBUS_BUS_LIBS)
-
-LAUNCH_HELPER_SOURCES= \
- $(XML_SOURCES) \
- config-parser-common.c \
- config-parser-common.h \
- config-parser-trivial.c \
- config-parser-trivial.h \
- desktop-file.c \
- desktop-file.h \
- utils.c \
- utils.h \
- activation-exit-codes.h \
- activation-helper.h \
- activation-helper.c
-
-## This is the installed launch helper with the setuid checks
-dbus_daemon_launch_helper_SOURCES= \
- activation-helper-bin.c \
- $(LAUNCH_HELPER_SOURCES)
-
-dbus_daemon_launch_helper_LDADD= \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-## we build another binary so we can do the launch testing without root privs.
-## DO NOT INSTALL THIS FILE
-dbus_daemon_launch_helper_test_SOURCES= \
- activation-helper-bin.c \
- $(LAUNCH_HELPER_SOURCES)
-
-dbus_daemon_launch_helper_test_LDADD= \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-dbus_daemon_launch_helper_test_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DACTIVATION_LAUNCHER_TEST
-
-## we build yet another binary so we can do the OOM tests
-## DO NOT INSTALL THIS FILE
-bus_test_launch_helper_SOURCES= \
- test-launch-helper.c \
- $(LAUNCH_HELPER_SOURCES)
-
-bus_test_launch_helper_LDADD= \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-bus_test_launch_helper_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DACTIVATION_LAUNCHER_TEST \
- -DACTIVATION_LAUNCHER_DO_OOM
-
-noinst_PROGRAMS =
-dbus_daemon_exec_PROGRAMS = dbus-daemon
-if DBUS_UNIX
-libexec_PROGRAMS = dbus-daemon-launch-helper
-endif DBUS_UNIX
-
-## Note that TESTS has special meaning (stuff to use in make check).
-## We don't actually want to run any of these tests until test/ has been
-## compiled, so we don't put them in TESTS here; we run them in test/
-## instead.
-
-if DBUS_ENABLE_EMBEDDED_TESTS
-## we use noinst_PROGRAMS not check_PROGRAMS so that we build
-## even when not doing "make check"
-
-# run as a test by test/Makefile.am
-noinst_PROGRAMS += bus-test bus-test-system
-
-if DBUS_UNIX
-# run as a test by test/Makefile.am
-noinst_PROGRAMS += bus-test-launch-helper
-# this is used by the tests but is not,itself, a test
-noinst_PROGRAMS += dbus-daemon-launch-helper-test
-endif DBUS_UNIX
-
-endif DBUS_ENABLE_EMBEDDED_TESTS
-
-bus_test_system_SOURCES= \
- $(XML_SOURCES) \
- config-parser-common.c \
- config-parser-common.h \
- config-parser-trivial.c \
- config-parser-trivial.h \
- utils.c \
- utils.h \
- test-system.c
-
-bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-
-bus_test_SOURCES= \
- $(BUS_SOURCES) \
- test-main.c
-
-bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-
-## mop up the gcov files
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov || true
-
-install-data-hook:
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
- $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
- $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
- $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
- $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
-if HAVE_SYSTEMD
-# Install dbus.socket as default implementation of a D-Bus stack.
-# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
-# but neither is systemd, so it's OK to assume here that ln complies with SUS.
- $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
- ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
-# Unconditionally enable D-Bus on systemd installations
- $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
- ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
- $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
- ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
-endif
-
-if DBUS_UNIX
-install-exec-hook:
- if test `id -u` -eq 0; then \
- chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
- chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
- else \
- echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
- echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
- fi
-endif
-
-#### Init scripts fun
-SCRIPT_IN_FILES=messagebus.in \
- messagebus-config.in \
- rc.messagebus.in
-
-## Red Hat start
-if DBUS_INIT_SCRIPTS_RED_HAT
-
-initddir=$(sysconfdir)/rc.d/init.d
-
-initd_SCRIPTS= \
- messagebus
-
-endif
- ## Red Hat end
-
-## Slackware start
-if DBUS_INIT_SCRIPTS_SLACKWARE
-
-initddir=$(sysconfdir)/rc.d/
-
-initd_SCRIPTS= \
- rc.messagebus
-
-endif
-## Slackware end
-
-## Cygwin start
-if DBUS_INIT_SCRIPTS_CYGWIN
-
-bin_SCRIPTS= \
- messagebus-config
-
-endif
-## Cygwin end
-
-if HAVE_SYSTEMD
-SCRIPT_IN_FILES += \
- dbus.service.in \
- dbus.socket.in
-
-systemdsystemunit_DATA = \
- dbus.service \
- dbus.socket
-endif
-
-#### Extra dist
-
-EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
diff --git a/src/3rd_party/dbus-1.7.8/bus/Makefile.in b/src/3rd_party/dbus-1.7.8/bus/Makefile.in
deleted file mode 100644
index b9ea356158..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/Makefile.in
+++ /dev/null
@@ -1,1475 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
-dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT)
-@DBUS_UNIX_TRUE@libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
-
-# run as a test by test/Makefile.am
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__append_1 = bus-test bus-test-system
-
-# run as a test by test/Makefile.am
-# this is used by the tests but is not,itself, a test
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = bus-test-launch-helper \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test
-@HAVE_SYSTEMD_TRUE@am__append_3 = \
-@HAVE_SYSTEMD_TRUE@ dbus.service.in \
-@HAVE_SYSTEMD_TRUE@ dbus.socket.in
-
-subdir = bus
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus.service.in $(srcdir)/dbus.socket.in \
- $(srcdir)/messagebus-config.in $(srcdir)/messagebus.in \
- $(srcdir)/org.freedesktop.dbus-session.plist.in \
- $(srcdir)/rc.messagebus.in $(srcdir)/session.conf.in \
- $(srcdir)/system.conf.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = system.conf session.conf messagebus \
- messagebus-config org.freedesktop.dbus-session.plist \
- rc.messagebus dbus.service dbus.socket
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(dbus_daemon_execdir)" \
- "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" \
- "$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" \
- "$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = bus-test$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ bus-test-system$(EXEEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__EXEEXT_2 = bus-test-launch-helper$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test$(EXEEXT)
-PROGRAMS = $(dbus_daemon_exec_PROGRAMS) $(libexec_PROGRAMS) \
- $(noinst_PROGRAMS)
-am__bus_test_SOURCES_DIST = activation.c activation.h \
- activation-exit-codes.h bus.c bus.h config-parser.c \
- config-parser.h config-parser-common.c config-parser-common.h \
- connection.c connection.h desktop-file.c desktop-file.h \
- dir-watch-default.c dir-watch-inotify.c dir-watch-kqueue.c \
- dir-watch.h dispatch.c dispatch.h driver.c driver.h \
- expirelist.c expirelist.h policy.c policy.h selinux.h \
- selinux.c services.c services.h signals.c signals.h stats.c \
- stats.h test.c test.h utils.c utils.h config-loader-expat.c \
- test-main.c
-@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-default.$(OBJEXT)
-@DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-inotify.$(OBJEXT)
-@DBUS_BUS_ENABLE_KQUEUE_TRUE@am__objects_1 = \
-@DBUS_BUS_ENABLE_KQUEUE_TRUE@ dir-watch-kqueue.$(OBJEXT)
-am__objects_2 = config-loader-expat.$(OBJEXT)
-am__objects_3 = activation.$(OBJEXT) bus.$(OBJEXT) \
- config-parser.$(OBJEXT) config-parser-common.$(OBJEXT) \
- connection.$(OBJEXT) desktop-file.$(OBJEXT) $(am__objects_1) \
- dispatch.$(OBJEXT) driver.$(OBJEXT) expirelist.$(OBJEXT) \
- policy.$(OBJEXT) selinux.$(OBJEXT) services.$(OBJEXT) \
- signals.$(OBJEXT) stats.$(OBJEXT) test.$(OBJEXT) \
- utils.$(OBJEXT) $(am__objects_2)
-am_bus_test_OBJECTS = $(am__objects_3) test-main.$(OBJEXT)
-bus_test_OBJECTS = $(am_bus_test_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-bus_test_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
- $(am__DEPENDENCIES_2)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__objects_4 = bus_test_launch_helper-config-loader-expat.$(OBJEXT)
-am__objects_5 = $(am__objects_4) \
- bus_test_launch_helper-config-parser-common.$(OBJEXT) \
- bus_test_launch_helper-config-parser-trivial.$(OBJEXT) \
- bus_test_launch_helper-desktop-file.$(OBJEXT) \
- bus_test_launch_helper-utils.$(OBJEXT) \
- bus_test_launch_helper-activation-helper.$(OBJEXT)
-am_bus_test_launch_helper_OBJECTS = \
- bus_test_launch_helper-test-launch-helper.$(OBJEXT) \
- $(am__objects_5)
-bus_test_launch_helper_OBJECTS = $(am_bus_test_launch_helper_OBJECTS)
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-bus_test_launch_helper_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
-am_bus_test_system_OBJECTS = $(am__objects_2) \
- config-parser-common.$(OBJEXT) config-parser-trivial.$(OBJEXT) \
- utils.$(OBJEXT) test-system.$(OBJEXT)
-bus_test_system_OBJECTS = $(am_bus_test_system_OBJECTS)
-bus_test_system_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_2)
-am__dbus_daemon_SOURCES_DIST = activation.c activation.h \
- activation-exit-codes.h bus.c bus.h config-parser.c \
- config-parser.h config-parser-common.c config-parser-common.h \
- connection.c connection.h desktop-file.c desktop-file.h \
- dir-watch-default.c dir-watch-inotify.c dir-watch-kqueue.c \
- dir-watch.h dispatch.c dispatch.h driver.c driver.h \
- expirelist.c expirelist.h policy.c policy.h selinux.h \
- selinux.c services.c services.h signals.c signals.h stats.c \
- stats.h test.c test.h utils.c utils.h config-loader-expat.c \
- main.c
-am_dbus_daemon_OBJECTS = $(am__objects_3) main.$(OBJEXT)
-dbus_daemon_OBJECTS = $(am_dbus_daemon_OBJECTS)
-dbus_daemon_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
-am__objects_6 = $(am__objects_2) config-parser-common.$(OBJEXT) \
- config-parser-trivial.$(OBJEXT) desktop-file.$(OBJEXT) \
- utils.$(OBJEXT) activation-helper.$(OBJEXT)
-am_dbus_daemon_launch_helper_OBJECTS = \
- activation-helper-bin.$(OBJEXT) $(am__objects_6)
-dbus_daemon_launch_helper_OBJECTS = \
- $(am_dbus_daemon_launch_helper_OBJECTS)
-dbus_daemon_launch_helper_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
-am__objects_7 = \
- dbus_daemon_launch_helper_test-config-loader-expat.$(OBJEXT)
-am__objects_8 = $(am__objects_7) \
- dbus_daemon_launch_helper_test-config-parser-common.$(OBJEXT) \
- dbus_daemon_launch_helper_test-config-parser-trivial.$(OBJEXT) \
- dbus_daemon_launch_helper_test-desktop-file.$(OBJEXT) \
- dbus_daemon_launch_helper_test-utils.$(OBJEXT) \
- dbus_daemon_launch_helper_test-activation-helper.$(OBJEXT)
-am_dbus_daemon_launch_helper_test_OBJECTS = dbus_daemon_launch_helper_test-activation-helper-bin.$(OBJEXT) \
- $(am__objects_8)
-dbus_daemon_launch_helper_test_OBJECTS = \
- $(am_dbus_daemon_launch_helper_test_OBJECTS)
-dbus_daemon_launch_helper_test_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-SCRIPTS = $(bin_SCRIPTS) $(initd_SCRIPTS)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(bus_test_SOURCES) $(bus_test_launch_helper_SOURCES) \
- $(bus_test_system_SOURCES) $(dbus_daemon_SOURCES) \
- $(dbus_daemon_launch_helper_SOURCES) \
- $(dbus_daemon_launch_helper_test_SOURCES)
-DIST_SOURCES = $(am__bus_test_SOURCES_DIST) \
- $(bus_test_launch_helper_SOURCES) $(bus_test_system_SOURCES) \
- $(am__dbus_daemon_SOURCES_DIST) \
- $(dbus_daemon_launch_helper_SOURCES) \
- $(dbus_daemon_launch_helper_test_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DATA = $(agent_DATA) $(config_DATA) $(systemdsystemunit_DATA)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-configdir = $(sysconfdir)/dbus-1
-dbus_daemon_execdir = $(DBUS_DAEMONDIR)
-DBUS_BUS_LIBS = \
- $(XML_LIBS) \
- $(SELINUX_LIBS) \
- $(THREAD_LIBS) \
- $(ADT_LIBS) \
- $(NETWORK_libs) \
- $(NULL)
-
-DBUS_LAUNCHER_LIBS = \
- $(XML_LIBS) \
- $(THREAD_LIBS) \
- $(NETWORK_libs) \
- $(NULL)
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(XML_CFLAGS) \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
- -DDBUS_COMPILATION \
- -DDBUS_STATIC_BUILD \
- $(NULL)
-
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-EFENCE =
-CONFIG_IN_FILES = \
- session.conf.in \
- system.conf.in \
- org.freedesktop.dbus-session.plist.in
-
-config_DATA = \
- session.conf \
- system.conf
-
-@DBUS_ENABLE_LAUNCHD_TRUE@agentdir = $(LAUNCHD_AGENT_DIR)
-@DBUS_ENABLE_LAUNCHD_TRUE@agent_DATA = org.freedesktop.dbus-session.plist
-XML_SOURCES = config-loader-expat.c
-@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-default.c
-@DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-inotify.c
-@DBUS_BUS_ENABLE_KQUEUE_TRUE@DIR_WATCH_SOURCE = dir-watch-kqueue.c
-BUS_SOURCES = \
- activation.c \
- activation.h \
- activation-exit-codes.h \
- bus.c \
- bus.h \
- config-parser.c \
- config-parser.h \
- config-parser-common.c \
- config-parser-common.h \
- connection.c \
- connection.h \
- desktop-file.c \
- desktop-file.h \
- $(DIR_WATCH_SOURCE) \
- dir-watch.h \
- dispatch.c \
- dispatch.h \
- driver.c \
- driver.h \
- expirelist.c \
- expirelist.h \
- policy.c \
- policy.h \
- selinux.h \
- selinux.c \
- services.c \
- services.h \
- signals.c \
- signals.h \
- stats.c \
- stats.h \
- test.c \
- test.h \
- utils.c \
- utils.h \
- $(XML_SOURCES)
-
-dbus_daemon_SOURCES = \
- $(BUS_SOURCES) \
- main.c
-
-dbus_daemon_LDADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(EFENCE) \
- $(DBUS_BUS_LIBS)
-
-LAUNCH_HELPER_SOURCES = \
- $(XML_SOURCES) \
- config-parser-common.c \
- config-parser-common.h \
- config-parser-trivial.c \
- config-parser-trivial.h \
- desktop-file.c \
- desktop-file.h \
- utils.c \
- utils.h \
- activation-exit-codes.h \
- activation-helper.h \
- activation-helper.c
-
-dbus_daemon_launch_helper_SOURCES = \
- activation-helper-bin.c \
- $(LAUNCH_HELPER_SOURCES)
-
-dbus_daemon_launch_helper_LDADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-dbus_daemon_launch_helper_test_SOURCES = \
- activation-helper-bin.c \
- $(LAUNCH_HELPER_SOURCES)
-
-dbus_daemon_launch_helper_test_LDADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-dbus_daemon_launch_helper_test_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DACTIVATION_LAUNCHER_TEST
-
-bus_test_launch_helper_SOURCES = \
- test-launch-helper.c \
- $(LAUNCH_HELPER_SOURCES)
-
-bus_test_launch_helper_LDADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(DBUS_LAUNCHER_LIBS)
-
-bus_test_launch_helper_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DACTIVATION_LAUNCHER_TEST \
- -DACTIVATION_LAUNCHER_DO_OOM
-
-bus_test_system_SOURCES = \
- $(XML_SOURCES) \
- config-parser-common.c \
- config-parser-common.h \
- config-parser-trivial.c \
- config-parser-trivial.h \
- utils.c \
- utils.h \
- test-system.c
-
-bus_test_system_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-bus_test_SOURCES = \
- $(BUS_SOURCES) \
- test-main.c
-
-bus_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-
-#### Init scripts fun
-SCRIPT_IN_FILES = messagebus.in messagebus-config.in rc.messagebus.in \
- $(am__append_3)
-@DBUS_INIT_SCRIPTS_RED_HAT_TRUE@initddir = $(sysconfdir)/rc.d/init.d
-@DBUS_INIT_SCRIPTS_SLACKWARE_TRUE@initddir = $(sysconfdir)/rc.d/
-@DBUS_INIT_SCRIPTS_RED_HAT_TRUE@initd_SCRIPTS = \
-@DBUS_INIT_SCRIPTS_RED_HAT_TRUE@ messagebus
-
-@DBUS_INIT_SCRIPTS_SLACKWARE_TRUE@initd_SCRIPTS = \
-@DBUS_INIT_SCRIPTS_SLACKWARE_TRUE@ rc.messagebus
-
-@DBUS_INIT_SCRIPTS_CYGWIN_TRUE@bin_SCRIPTS = \
-@DBUS_INIT_SCRIPTS_CYGWIN_TRUE@ messagebus-config
-
-@HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \
-@HAVE_SYSTEMD_TRUE@ dbus.service \
-@HAVE_SYSTEMD_TRUE@ dbus.socket
-
-
-#### Extra dist
-EXTRA_DIST = $(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bus/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu bus/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-system.conf: $(top_builddir)/config.status $(srcdir)/system.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-session.conf: $(top_builddir)/config.status $(srcdir)/session.conf.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-messagebus: $(top_builddir)/config.status $(srcdir)/messagebus.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-messagebus-config: $(top_builddir)/config.status $(srcdir)/messagebus-config.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-org.freedesktop.dbus-session.plist: $(top_builddir)/config.status $(srcdir)/org.freedesktop.dbus-session.plist.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-rc.messagebus: $(top_builddir)/config.status $(srcdir)/rc.messagebus.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus.service: $(top_builddir)/config.status $(srcdir)/dbus.service.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus.socket: $(top_builddir)/config.status $(srcdir)/dbus.socket.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-dbus_daemon_execPROGRAMS: $(dbus_daemon_exec_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(dbus_daemon_execdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(dbus_daemon_execdir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(dbus_daemon_execdir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(dbus_daemon_execdir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-dbus_daemon_execPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(dbus_daemon_execdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(dbus_daemon_execdir)" && rm -f $$files
-
-clean-dbus_daemon_execPROGRAMS:
- @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-libexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
-
-clean-libexecPROGRAMS:
- @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-bus-test$(EXEEXT): $(bus_test_OBJECTS) $(bus_test_DEPENDENCIES) $(EXTRA_bus_test_DEPENDENCIES)
- @rm -f bus-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_OBJECTS) $(bus_test_LDADD) $(LIBS)
-bus-test-launch-helper$(EXEEXT): $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_DEPENDENCIES) $(EXTRA_bus_test_launch_helper_DEPENDENCIES)
- @rm -f bus-test-launch-helper$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_LDADD) $(LIBS)
-bus-test-system$(EXEEXT): $(bus_test_system_OBJECTS) $(bus_test_system_DEPENDENCIES) $(EXTRA_bus_test_system_DEPENDENCIES)
- @rm -f bus-test-system$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_system_OBJECTS) $(bus_test_system_LDADD) $(LIBS)
-dbus-daemon$(EXEEXT): $(dbus_daemon_OBJECTS) $(dbus_daemon_DEPENDENCIES) $(EXTRA_dbus_daemon_DEPENDENCIES)
- @rm -f dbus-daemon$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_daemon_OBJECTS) $(dbus_daemon_LDADD) $(LIBS)
-dbus-daemon-launch-helper$(EXEEXT): $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_DEPENDENCIES)
- @rm -f dbus-daemon-launch-helper$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_LDADD) $(LIBS)
-dbus-daemon-launch-helper-test$(EXEEXT): $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_test_DEPENDENCIES)
- @rm -f dbus-daemon-launch-helper-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_LDADD) $(LIBS)
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) { files[d] = files[d] " " $$1; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$4, $$1 } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
-install-initdSCRIPTS: $(initd_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(initddir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(initddir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) { files[d] = files[d] " " $$1; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$4, $$1 } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-initdSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(initddir)'; $(am__uninstall_files_from_dir)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activation-helper-bin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activation-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activation.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-activation-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-desktop-file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-trivial.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desktop-file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-default.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-inotify.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-kqueue.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expirelist.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/policy.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selinux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/services.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stats.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-system.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-bus_test_launch_helper-test-launch-helper.o: test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-test-launch-helper.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo -c -o bus_test_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='bus_test_launch_helper-test-launch-helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
-
-bus_test_launch_helper-test-launch-helper.obj: test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-test-launch-helper.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo -c -o bus_test_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='bus_test_launch_helper-test-launch-helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
-
-bus_test_launch_helper-config-loader-expat.o: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-expat.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo -c -o bus_test_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='bus_test_launch_helper-config-loader-expat.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-
-bus_test_launch_helper-config-loader-expat.obj: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-expat.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo -c -o bus_test_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='bus_test_launch_helper-config-loader-expat.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-
-bus_test_launch_helper-config-parser-common.o: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-common.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo -c -o bus_test_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='bus_test_launch_helper-config-parser-common.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-
-bus_test_launch_helper-config-parser-common.obj: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-common.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo -c -o bus_test_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='bus_test_launch_helper-config-parser-common.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-
-bus_test_launch_helper-config-parser-trivial.o: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-trivial.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo -c -o bus_test_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='bus_test_launch_helper-config-parser-trivial.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-
-bus_test_launch_helper-config-parser-trivial.obj: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-trivial.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo -c -o bus_test_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='bus_test_launch_helper-config-parser-trivial.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-
-bus_test_launch_helper-desktop-file.o: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-desktop-file.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo -c -o bus_test_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo $(DEPDIR)/bus_test_launch_helper-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='bus_test_launch_helper-desktop-file.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-
-bus_test_launch_helper-desktop-file.obj: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-desktop-file.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo -c -o bus_test_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo $(DEPDIR)/bus_test_launch_helper-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='bus_test_launch_helper-desktop-file.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-
-bus_test_launch_helper-utils.o: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-utils.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-utils.Tpo -c -o bus_test_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-utils.Tpo $(DEPDIR)/bus_test_launch_helper-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='bus_test_launch_helper-utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-
-bus_test_launch_helper-utils.obj: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-utils.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-utils.Tpo -c -o bus_test_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-utils.Tpo $(DEPDIR)/bus_test_launch_helper-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='bus_test_launch_helper-utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-
-bus_test_launch_helper-activation-helper.o: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-activation-helper.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo -c -o bus_test_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo $(DEPDIR)/bus_test_launch_helper-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='bus_test_launch_helper-activation-helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-
-bus_test_launch_helper-activation-helper.obj: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-activation-helper.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo -c -o bus_test_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo $(DEPDIR)/bus_test_launch_helper-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='bus_test_launch_helper-activation-helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-
-dbus_daemon_launch_helper_test-activation-helper-bin.o: activation-helper-bin.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-activation-helper-bin.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo -c -o dbus_daemon_launch_helper_test-activation-helper-bin.o `test -f 'activation-helper-bin.c' || echo '$(srcdir)/'`activation-helper-bin.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper-bin.c' object='dbus_daemon_launch_helper_test-activation-helper-bin.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-activation-helper-bin.o `test -f 'activation-helper-bin.c' || echo '$(srcdir)/'`activation-helper-bin.c
-
-dbus_daemon_launch_helper_test-activation-helper-bin.obj: activation-helper-bin.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-activation-helper-bin.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo -c -o dbus_daemon_launch_helper_test-activation-helper-bin.obj `if test -f 'activation-helper-bin.c'; then $(CYGPATH_W) 'activation-helper-bin.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper-bin.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper-bin.c' object='dbus_daemon_launch_helper_test-activation-helper-bin.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-activation-helper-bin.obj `if test -f 'activation-helper-bin.c'; then $(CYGPATH_W) 'activation-helper-bin.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper-bin.c'; fi`
-
-dbus_daemon_launch_helper_test-config-loader-expat.o: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-expat.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='dbus_daemon_launch_helper_test-config-loader-expat.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-
-dbus_daemon_launch_helper_test-config-loader-expat.obj: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-expat.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='dbus_daemon_launch_helper_test-config-loader-expat.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-
-dbus_daemon_launch_helper_test-config-parser-common.o: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-common.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='dbus_daemon_launch_helper_test-config-parser-common.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-
-dbus_daemon_launch_helper_test-config-parser-common.obj: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-common.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='dbus_daemon_launch_helper_test-config-parser-common.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-
-dbus_daemon_launch_helper_test-config-parser-trivial.o: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-trivial.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='dbus_daemon_launch_helper_test-config-parser-trivial.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-
-dbus_daemon_launch_helper_test-config-parser-trivial.obj: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-trivial.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='dbus_daemon_launch_helper_test-config-parser-trivial.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-
-dbus_daemon_launch_helper_test-desktop-file.o: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-desktop-file.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Tpo -c -o dbus_daemon_launch_helper_test-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='dbus_daemon_launch_helper_test-desktop-file.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-
-dbus_daemon_launch_helper_test-desktop-file.obj: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-desktop-file.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Tpo -c -o dbus_daemon_launch_helper_test-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='dbus_daemon_launch_helper_test-desktop-file.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-
-dbus_daemon_launch_helper_test-utils.o: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-utils.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Tpo -c -o dbus_daemon_launch_helper_test-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='dbus_daemon_launch_helper_test-utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-
-dbus_daemon_launch_helper_test-utils.obj: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-utils.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Tpo -c -o dbus_daemon_launch_helper_test-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='dbus_daemon_launch_helper_test-utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-
-dbus_daemon_launch_helper_test-activation-helper.o: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-activation-helper.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Tpo -c -o dbus_daemon_launch_helper_test-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='dbus_daemon_launch_helper_test-activation-helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-
-dbus_daemon_launch_helper_test-activation-helper.obj: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-activation-helper.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Tpo -c -o dbus_daemon_launch_helper_test-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='dbus_daemon_launch_helper_test-activation-helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-agentDATA: $(agent_DATA)
- @$(NORMAL_INSTALL)
- @list='$(agent_DATA)'; test -n "$(agentdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(agentdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(agentdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(agentdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(agentdir)" || exit $$?; \
- done
-
-uninstall-agentDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(agent_DATA)'; test -n "$(agentdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(agentdir)'; $(am__uninstall_files_from_dir)
-install-configDATA: $(config_DATA)
- @$(NORMAL_INSTALL)
- @list='$(config_DATA)'; test -n "$(configdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(configdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(configdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \
- done
-
-uninstall-configDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(config_DATA)'; test -n "$(configdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(configdir)'; $(am__uninstall_files_from_dir)
-install-systemdsystemunitDATA: $(systemdsystemunit_DATA)
- @$(NORMAL_INSTALL)
- @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \
- done
-
-uninstall-systemdsystemunitDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir)
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
-installdirs:
- for dir in "$(DESTDIR)$(dbus_daemon_execdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-@DBUS_UNIX_FALSE@install-exec-hook:
-clean: clean-am
-
-clean-am: clean-dbus_daemon_execPROGRAMS clean-generic \
- clean-libexecPROGRAMS clean-libtool clean-local \
- clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-agentDATA install-configDATA \
- install-initdSCRIPTS install-systemdsystemunitDATA
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binSCRIPTS install-dbus_daemon_execPROGRAMS \
- install-libexecPROGRAMS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-agentDATA uninstall-binSCRIPTS \
- uninstall-configDATA uninstall-dbus_daemon_execPROGRAMS \
- uninstall-initdSCRIPTS uninstall-libexecPROGRAMS \
- uninstall-systemdsystemunitDATA
-
-.MAKE: install-am install-data-am install-exec-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean \
- clean-dbus_daemon_execPROGRAMS clean-generic \
- clean-libexecPROGRAMS clean-libtool clean-local \
- clean-noinstPROGRAMS ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-agentDATA \
- install-am install-binSCRIPTS install-configDATA install-data \
- install-data-am install-data-hook \
- install-dbus_daemon_execPROGRAMS install-dvi install-dvi-am \
- install-exec install-exec-am install-exec-hook install-html \
- install-html-am install-info install-info-am \
- install-initdSCRIPTS install-libexecPROGRAMS install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip install-systemdsystemunitDATA installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-agentDATA uninstall-am \
- uninstall-binSCRIPTS uninstall-configDATA \
- uninstall-dbus_daemon_execPROGRAMS uninstall-initdSCRIPTS \
- uninstall-libexecPROGRAMS uninstall-systemdsystemunitDATA
-
-
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov || true
-
-install-data-hook:
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
- $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
- $(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
- $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
- $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
-# Install dbus.socket as default implementation of a D-Bus stack.
-# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
-# but neither is systemd, so it's OK to assume here that ln complies with SUS.
-@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
-@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
-# Unconditionally enable D-Bus on systemd installations
-@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
-@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
-@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
-@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
-
-@DBUS_UNIX_TRUE@install-exec-hook:
-@DBUS_UNIX_TRUE@ if test `id -u` -eq 0; then \
-@DBUS_UNIX_TRUE@ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
-@DBUS_UNIX_TRUE@ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
-@DBUS_UNIX_TRUE@ else \
-@DBUS_UNIX_TRUE@ echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
-@DBUS_UNIX_TRUE@ echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
-@DBUS_UNIX_TRUE@ fi
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation-exit-codes.h b/src/3rd_party/dbus-1.7.8/bus/activation-exit-codes.h
deleted file mode 100644
index bbb98dca37..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation-exit-codes.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation-exit-codes.h Return values for the launch helper which is set
- * in the helper and read in dbus-spawn.
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_ACTIVATION_EXIT_CODES_H
-#define BUS_ACTIVATION_EXIT_CODES_H
-
-/** Return codes from the launch helper - not public API. However,
- * presumably if some third party did write their own launch helper,
- * they would have to rely on these, or at least always return
- * 1 for GENERIC_FAILURE.
- */
-#define BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE 1
-#define BUS_SPAWN_EXIT_CODE_NO_MEMORY 2
-#define BUS_SPAWN_EXIT_CODE_CONFIG_INVALID 3
-#define BUS_SPAWN_EXIT_CODE_SETUP_FAILED 4
-#define BUS_SPAWN_EXIT_CODE_NAME_INVALID 5
-#define BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND 6
-#define BUS_SPAWN_EXIT_CODE_PERMISSIONS_INVALID 7
-#define BUS_SPAWN_EXIT_CODE_FILE_INVALID 8
-#define BUS_SPAWN_EXIT_CODE_EXEC_FAILED 9
-#define BUS_SPAWN_EXIT_CODE_INVALID_ARGS 10
-#define BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED 11
-
-#endif /* BUS_ACTIVATION_EXIT_CODES_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation-helper-bin.c b/src/3rd_party/dbus-1.7.8/bus/activation-helper-bin.c
deleted file mode 100644
index f5f16d2cef..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation-helper-bin.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation-helper-bin.c Setuid helper for launching programs as a custom
- * user. This file is security sensitive.
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "utils.h"
-#include "activation-helper.h"
-#include "activation-exit-codes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static int
-convert_error_to_exit_code (DBusError *error)
-{
- if (dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY))
- return BUS_SPAWN_EXIT_CODE_NO_MEMORY;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_CONFIG_INVALID))
- return BUS_SPAWN_EXIT_CODE_CONFIG_INVALID;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_SETUP_FAILED))
- return BUS_SPAWN_EXIT_CODE_SETUP_FAILED;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_INVALID))
- return BUS_SPAWN_EXIT_CODE_NAME_INVALID;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND))
- return BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID))
- return BUS_SPAWN_EXIT_CODE_PERMISSIONS_INVALID;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_FILE_INVALID))
- return BUS_SPAWN_EXIT_CODE_FILE_INVALID;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_EXEC_FAILED))
- return BUS_SPAWN_EXIT_CODE_EXEC_FAILED;
-
- if (dbus_error_has_name (error, DBUS_ERROR_INVALID_ARGS))
- return BUS_SPAWN_EXIT_CODE_INVALID_ARGS;
-
- if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED))
- return BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED;
-
- /* should we assert? */
- fprintf(stderr, "%s: %s\n", error->name, error->message);
-
- return BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE;
-}
-
-int
-main (int argc, char **argv)
-{
- DBusError error;
- int retval;
-
- /* default is all okay */
- retval = 0;
-
- /* have we used a help option or not specified the correct arguments? */
- if (argc != 2 ||
- strcmp (argv[1], "--help") == 0 ||
- strcmp (argv[1], "-h") == 0 ||
- strcmp (argv[1], "-?") == 0)
- {
- fprintf (stderr, "dbus-daemon-activation-helper service.to.activate\n");
- exit (0);
- }
-
- dbus_error_init (&error);
- if (!run_launch_helper (argv[1], &error))
- {
- /* convert error to an exit code */
- retval = convert_error_to_exit_code (&error);
- dbus_error_free (&error);
- }
-
- return retval;
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation-helper.c b/src/3rd_party/dbus-1.7.8/bus/activation-helper.c
deleted file mode 100644
index 394f3938c1..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation-helper.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation-helper.c Setuid helper for launching programs as a custom
- * user. This file is security sensitive.
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "bus.h"
-#include "driver.h"
-#include "utils.h"
-#include "desktop-file.h"
-#include "config-parser-trivial.h"
-#include "activation-helper.h"
-#include "activation-exit-codes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-
-#include <dbus/dbus-misc.h>
-#include <dbus/dbus-shell.h>
-#include <dbus/dbus-marshal-validate.h>
-
-static BusDesktopFile *
-desktop_file_for_name (BusConfigParser *parser,
- const char *name,
- DBusError *error)
-{
- BusDesktopFile *desktop_file;
- DBusList **service_dirs;
- DBusList *link;
- DBusError tmp_error;
- DBusString full_path;
- DBusString filename;
- const char *dir;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- desktop_file = NULL;
-
- if (!_dbus_string_init (&filename))
- {
- BUS_SET_OOM (error);
- goto out_all;
- }
-
- if (!_dbus_string_init (&full_path))
- {
- BUS_SET_OOM (error);
- goto out_filename;
- }
-
- if (!_dbus_string_append (&filename, name) ||
- !_dbus_string_append (&filename, ".service"))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- service_dirs = bus_config_parser_get_service_dirs (parser);
- for (link = _dbus_list_get_first_link (service_dirs);
- link != NULL;
- link = _dbus_list_get_next_link (service_dirs, link))
- {
- dir = link->data;
- _dbus_verbose ("Looking at '%s'\n", dir);
-
- dbus_error_init (&tmp_error);
-
- /* clear the path from last time */
- _dbus_string_set_length (&full_path, 0);
-
- /* build the full path */
- if (!_dbus_string_append (&full_path, dir) ||
- !_dbus_concat_dir_and_file (&full_path, &filename))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- _dbus_verbose ("Trying to load file '%s'\n", _dbus_string_get_data (&full_path));
- desktop_file = bus_desktop_file_load (&full_path, &tmp_error);
- if (desktop_file == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- _dbus_verbose ("Could not load %s: %s: %s\n",
- _dbus_string_get_const_data (&full_path),
- tmp_error.name, tmp_error.message);
-
- /* we may have failed if the file is not found; this is not fatal */
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- /* we only bail out on OOM */
- goto out;
- }
- dbus_error_free (&tmp_error);
- }
-
- /* did we find the desktop file we want? */
- if (desktop_file != NULL)
- break;
- }
-
- /* Didn't find desktop file; set error */
- if (desktop_file == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND,
- "The name %s was not provided by any .service files",
- name);
- }
-
-out:
- _dbus_string_free (&full_path);
-out_filename:
- _dbus_string_free (&filename);
-out_all:
- return desktop_file;
-}
-
-/* Clears the environment, except for DBUS_STARTER_x,
- * which we hardcode to the system bus.
- */
-static dbus_bool_t
-clear_environment (DBusError *error)
-{
-#ifndef ACTIVATION_LAUNCHER_TEST
- /* totally clear the environment */
- if (!_dbus_clearenv ())
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "could not clear environment\n");
- return FALSE;
- }
-
- /* Ensure the bus is set to system */
- dbus_setenv ("DBUS_STARTER_ADDRESS", DBUS_SYSTEM_BUS_DEFAULT_ADDRESS);
- dbus_setenv ("DBUS_STARTER_BUS_TYPE", "system");
-#endif
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_permissions (const char *dbus_user, DBusError *error)
-{
-#ifndef ACTIVATION_LAUNCHER_TEST
- uid_t uid, euid;
- struct passwd *pw;
-
- pw = NULL;
- uid = 0;
- euid = 0;
-
- /* bail out unless the dbus user is invoking the helper */
- pw = getpwnam(dbus_user);
- if (!pw)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,
- "cannot find user '%s'", dbus_user);
- return FALSE;
- }
- uid = getuid();
- if (pw->pw_uid != uid)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,
- "not invoked from user '%s'", dbus_user);
- return FALSE;
- }
-
- /* bail out unless we are setuid to user root */
- euid = geteuid();
- if (euid != 0)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,
- "not setuid root");
- return FALSE;
- }
-#endif
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_service_name (BusDesktopFile *desktop_file,
- const char *service_name,
- DBusError *error)
-{
- char *name_tmp;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- /* try to get Name */
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_NAME,
- &name_tmp,
- error))
- goto failed;
-
- /* verify that the name is the same as the file service name */
- if (strcmp (service_name, name_tmp) != 0)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_FILE_INVALID,
- "Service '%s' does not match expected value", name_tmp);
- goto failed_free;
- }
-
- retval = TRUE;
-
-failed_free:
- /* we don't return the name, so free it here */
- dbus_free (name_tmp);
-failed:
- return retval;
-}
-
-static dbus_bool_t
-get_parameters_for_service (BusDesktopFile *desktop_file,
- const char *service_name,
- char **exec,
- char **user,
- DBusError *error)
-{
- char *exec_tmp;
- char *user_tmp;
-
- exec_tmp = NULL;
- user_tmp = NULL;
-
- /* check the name of the service */
- if (!check_service_name (desktop_file, service_name, error))
- goto failed;
-
- /* get the complete path of the executable */
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_EXEC,
- &exec_tmp,
- error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- /* get the user that should run this service - user is compulsary for system activation */
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_USER,
- &user_tmp,
- error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- /* only assign if all the checks passed */
- *exec = exec_tmp;
- *user = user_tmp;
- return TRUE;
-
-failed:
- dbus_free (exec_tmp);
- dbus_free (user_tmp);
- return FALSE;
-}
-
-static dbus_bool_t
-switch_user (char *user, DBusError *error)
-{
-#ifndef ACTIVATION_LAUNCHER_TEST
- struct passwd *pw;
-
- /* find user */
- pw = getpwnam (user);
- if (!pw)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "cannot find user '%s'\n", user);
- return FALSE;
- }
-
- /* initialize the group access list */
- if (initgroups (user, pw->pw_gid))
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "could not initialize groups");
- return FALSE;
- }
-
- /* change to the primary group for the user */
- if (setgid (pw->pw_gid))
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "cannot setgid group %i", pw->pw_gid);
- return FALSE;
- }
-
- /* change to the user specified */
- if (setuid (pw->pw_uid) < 0)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "cannot setuid user %i", pw->pw_uid);
- return FALSE;
- }
-#endif
- return TRUE;
-}
-
-static dbus_bool_t
-exec_for_correct_user (char *exec, char *user, DBusError *error)
-{
- char **argv;
- int argc;
- dbus_bool_t retval;
-
- argc = 0;
- retval = TRUE;
- argv = NULL;
-
- if (!switch_user (user, error))
- return FALSE;
-
- /* convert command into arguments */
- if (!_dbus_shell_parse_argv (exec, &argc, &argv, error))
- return FALSE;
-
-#ifndef ACTIVATION_LAUNCHER_DO_OOM
- /* replace with new binary, with no environment */
- if (execv (argv[0], argv) < 0)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "Failed to exec: %s", argv[0]);
- retval = FALSE;
- }
-#endif
-
- dbus_free_string_array (argv);
- return retval;
-}
-
-static dbus_bool_t
-check_bus_name (const char *bus_name,
- DBusError *error)
-{
- DBusString str;
-
- _dbus_string_init_const (&str, bus_name);
- if (!_dbus_validate_bus_name (&str, 0, _dbus_string_get_length (&str)))
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_INVALID,
- "bus name '%s' is not a valid bus name\n",
- bus_name);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-get_correct_parser (BusConfigParser **parser, DBusError *error)
-{
- DBusString config_file;
- dbus_bool_t retval;
-#ifdef ACTIVATION_LAUNCHER_TEST
- const char *test_config_file;
-#endif
-
- retval = FALSE;
-
-#ifdef ACTIVATION_LAUNCHER_TEST
- test_config_file = NULL;
-
- /* there is no _way_ we should be setuid if this define is set.
- * but we should be doubly paranoid and check... */
- if (getuid() != geteuid())
- _dbus_assert_not_reached ("dbus-daemon-launch-helper-test binary is setuid!");
-
- /* this is not a security hole. The environment variable is only passed in the
- * dbus-daemon-lauch-helper-test NON-SETUID launcher */
- test_config_file = _dbus_getenv ("TEST_LAUNCH_HELPER_CONFIG");
- if (test_config_file == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "the TEST_LAUNCH_HELPER_CONFIG env variable is not set");
- goto out;
- }
-#endif
-
- /* we _only_ use the predefined system config file */
- if (!_dbus_string_init (&config_file))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-#ifndef ACTIVATION_LAUNCHER_TEST
- if (!_dbus_string_append (&config_file, DBUS_SYSTEM_CONFIG_FILE))
- {
- BUS_SET_OOM (error);
- goto out_free_config;
- }
-#else
- if (!_dbus_string_append (&config_file, test_config_file))
- {
- BUS_SET_OOM (error);
- goto out_free_config;
- }
-#endif
-
- /* where are we pointing.... */
- _dbus_verbose ("dbus-daemon-activation-helper: using config file: %s\n",
- _dbus_string_get_const_data (&config_file));
-
- /* get the dbus user */
- *parser = bus_config_load (&config_file, TRUE, NULL, error);
- if (*parser == NULL)
- {
- goto out_free_config;
- }
-
- /* woot */
- retval = TRUE;
-
-out_free_config:
- _dbus_string_free (&config_file);
-out:
- return retval;
-}
-
-static dbus_bool_t
-launch_bus_name (const char *bus_name, BusConfigParser *parser, DBusError *error)
-{
- BusDesktopFile *desktop_file;
- char *exec, *user;
- dbus_bool_t retval;
-
- exec = NULL;
- user = NULL;
- retval = FALSE;
-
- /* get the correct service file for the name we are trying to activate */
- desktop_file = desktop_file_for_name (parser, bus_name, error);
- if (desktop_file == NULL)
- return FALSE;
-
- /* get exec and user for service name */
- if (!get_parameters_for_service (desktop_file, bus_name, &exec, &user, error))
- goto finish;
-
- _dbus_verbose ("dbus-daemon-activation-helper: Name='%s'\n", bus_name);
- _dbus_verbose ("dbus-daemon-activation-helper: Exec='%s'\n", exec);
- _dbus_verbose ("dbus-daemon-activation-helper: User='%s'\n", user);
-
- /* actually execute */
- if (!exec_for_correct_user (exec, user, error))
- goto finish;
-
- retval = TRUE;
-
-finish:
- dbus_free (exec);
- dbus_free (user);
- bus_desktop_file_free (desktop_file);
- return retval;
-}
-
-static dbus_bool_t
-check_dbus_user (BusConfigParser *parser, DBusError *error)
-{
- const char *dbus_user;
-
- dbus_user = bus_config_parser_get_user (parser);
- if (dbus_user == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_CONFIG_INVALID,
- "could not get user from config file\n");
- return FALSE;
- }
-
- /* check to see if permissions are correct */
- if (!check_permissions (dbus_user, error))
- return FALSE;
-
- return TRUE;
-}
-
-dbus_bool_t
-run_launch_helper (const char *bus_name,
- DBusError *error)
-{
- BusConfigParser *parser;
- dbus_bool_t retval;
-
- parser = NULL;
- retval = FALSE;
-
- /* clear the environment, apart from a few select settings */
- if (!clear_environment (error))
- goto error;
-
- /* check to see if we have a valid bus name */
- if (!check_bus_name (bus_name, error))
- goto error;
-
- /* get the correct parser, either the test or default parser */
- if (!get_correct_parser (&parser, error))
- goto error;
-
- /* check we are being invoked by the correct dbus user */
- if (!check_dbus_user (parser, error))
- goto error_free_parser;
-
- /* launch the bus with the service defined user */
- if (!launch_bus_name (bus_name, parser, error))
- goto error_free_parser;
-
- /* woohoo! */
- retval = TRUE;
-
-error_free_parser:
- bus_config_parser_unref (parser);
-error:
- return retval;
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation-helper.h b/src/3rd_party/dbus-1.7.8/bus/activation-helper.h
deleted file mode 100644
index 361a4c6a1a..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation-helper.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation-helper.h The actual activation helper split from the main
- * function for testing.
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_ACTIVATION_HELPER_H
-#define BUS_ACTIVATION_HELPER_H
-
-dbus_bool_t run_launch_helper (const char *bus_name, DBusError *error);
-
-
-#endif /* BUS_ACTIVATION_HELPER_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation.c b/src/3rd_party/dbus-1.7.8/bus/activation.c
deleted file mode 100644
index 868ce05c13..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation.c
+++ /dev/null
@@ -1,2595 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation.c Activation of services
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat, Inc.
- * Copyright (C) 2004 Imendio HB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "activation.h"
-#include "activation-exit-codes.h"
-#include "desktop-file.h"
-#include "dispatch.h"
-#include "services.h"
-#include "test.h"
-#include "utils.h"
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-shell.h>
-#include <dbus/dbus-spawn.h>
-#include <dbus/dbus-timeout.h>
-#include <dbus/dbus-sysdeps.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-struct BusActivation
-{
- int refcount;
- DBusHashTable *entries;
- DBusHashTable *pending_activations;
- char *server_address;
- BusContext *context;
- int n_pending_activations; /**< This is in fact the number of BusPendingActivationEntry,
- * i.e. number of pending activation requests, not pending
- * activations per se
- */
- DBusHashTable *directories;
- DBusHashTable *environment;
-};
-
-typedef struct
-{
- int refcount;
- char *dir_c;
- DBusHashTable *entries;
-} BusServiceDirectory;
-
-typedef struct
-{
- int refcount;
- char *name;
- char *exec;
- char *user;
- char *systemd_service;
- unsigned long mtime;
- BusServiceDirectory *s_dir;
- char *filename;
-} BusActivationEntry;
-
-typedef struct BusPendingActivationEntry BusPendingActivationEntry;
-
-struct BusPendingActivationEntry
-{
- /* Normally a method call, but if connection is NULL, this is a signal
- * instead.
- */
- DBusMessage *activation_message;
- /* NULL if this activation entry is for the dbus-daemon itself,
- * waiting for systemd to start. In this case, auto_activation is always
- * TRUE.
- */
- DBusConnection *connection;
-
- dbus_bool_t auto_activation;
-};
-
-typedef struct
-{
- int refcount;
- BusActivation *activation;
- char *service_name;
- char *exec;
- char *systemd_service;
- DBusList *entries;
- int n_entries;
- DBusBabysitter *babysitter;
- DBusTimeout *timeout;
- unsigned int timeout_added : 1;
-} BusPendingActivation;
-
-#if 0
-static BusServiceDirectory *
-bus_service_directory_ref (BusServiceDirectory *dir)
-{
- _dbus_assert (dir->refcount);
-
- dir->refcount++;
-
- return dir;
-}
-#endif
-
-static void
-bus_service_directory_unref (BusServiceDirectory *dir)
-{
- if (dir == NULL)
- return;
-
- _dbus_assert (dir->refcount > 0);
- dir->refcount--;
-
- if (dir->refcount > 0)
- return;
-
- if (dir->entries)
- _dbus_hash_table_unref (dir->entries);
-
- dbus_free (dir->dir_c);
- dbus_free (dir);
-}
-
-static void
-bus_pending_activation_entry_free (BusPendingActivationEntry *entry)
-{
- if (entry->activation_message)
- dbus_message_unref (entry->activation_message);
-
- if (entry->connection)
- dbus_connection_unref (entry->connection);
-
- dbus_free (entry);
-}
-
-static BusPendingActivation *
-bus_pending_activation_ref (BusPendingActivation *pending_activation)
-{
- _dbus_assert (pending_activation->refcount > 0);
- pending_activation->refcount += 1;
-
- return pending_activation;
-}
-
-static void
-bus_pending_activation_unref (BusPendingActivation *pending_activation)
-{
- DBusList *link;
-
- if (pending_activation == NULL) /* hash table requires this */
- return;
-
- _dbus_assert (pending_activation->refcount > 0);
- pending_activation->refcount -= 1;
-
- if (pending_activation->refcount > 0)
- return;
-
- if (pending_activation->timeout_added)
- {
- _dbus_loop_remove_timeout (bus_context_get_loop (pending_activation->activation->context),
- pending_activation->timeout);
- pending_activation->timeout_added = FALSE;
- }
-
- if (pending_activation->timeout)
- _dbus_timeout_unref (pending_activation->timeout);
-
- if (pending_activation->babysitter)
- {
- if (!_dbus_babysitter_set_watch_functions (pending_activation->babysitter,
- NULL, NULL, NULL,
- pending_activation->babysitter,
- NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
-
- _dbus_babysitter_unref (pending_activation->babysitter);
- }
-
- dbus_free (pending_activation->service_name);
- dbus_free (pending_activation->exec);
- dbus_free (pending_activation->systemd_service);
-
- link = _dbus_list_get_first_link (&pending_activation->entries);
-
- while (link != NULL)
- {
- BusPendingActivationEntry *entry = link->data;
-
- bus_pending_activation_entry_free (entry);
-
- link = _dbus_list_get_next_link (&pending_activation->entries, link);
- }
- _dbus_list_clear (&pending_activation->entries);
-
- pending_activation->activation->n_pending_activations -=
- pending_activation->n_entries;
-
- _dbus_assert (pending_activation->activation->n_pending_activations >= 0);
-
- dbus_free (pending_activation);
-}
-
-static BusActivationEntry *
-bus_activation_entry_ref (BusActivationEntry *entry)
-{
- _dbus_assert (entry->refcount > 0);
- entry->refcount++;
-
- return entry;
-}
-
-static void
-bus_activation_entry_unref (BusActivationEntry *entry)
-{
- if (entry == NULL) /* hash table requires this */
- return;
-
- _dbus_assert (entry->refcount > 0);
- entry->refcount--;
-
- if (entry->refcount > 0)
- return;
-
- dbus_free (entry->name);
- dbus_free (entry->exec);
- dbus_free (entry->user);
- dbus_free (entry->filename);
- dbus_free (entry->systemd_service);
-
- dbus_free (entry);
-}
-
-static dbus_bool_t
-update_desktop_file_entry (BusActivation *activation,
- BusServiceDirectory *s_dir,
- DBusString *filename,
- BusDesktopFile *desktop_file,
- DBusError *error)
-{
- char *name, *exec, *user, *exec_tmp, *systemd_service;
- BusActivationEntry *entry;
- DBusStat stat_buf;
- DBusString file_path;
- DBusError tmp_error;
- dbus_bool_t retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- retval = FALSE;
- name = NULL;
- exec = NULL;
- user = NULL;
- exec_tmp = NULL;
- entry = NULL;
- systemd_service = NULL;
-
- dbus_error_init (&tmp_error);
-
- if (!_dbus_string_init (&file_path))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append (&file_path, s_dir->dir_c) ||
- !_dbus_concat_dir_and_file (&file_path, filename))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!_dbus_stat (&file_path, &stat_buf, NULL))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Can't stat the service file\n");
- goto out;
- }
-
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_NAME,
- &name,
- error))
- goto out;
-
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_EXEC,
- &exec_tmp,
- error))
- goto out;
-
- exec = _dbus_strdup (_dbus_replace_install_prefix (exec_tmp));
- dbus_free (exec_tmp);
- exec_tmp = NULL;
-
- /* user is not _required_ unless we are using system activation */
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_USER,
- &user, &tmp_error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- /* if we got OOM, then exit */
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- goto out;
- }
- else
- {
- /* if we have error because we didn't find anything then continue */
- dbus_error_free (&tmp_error);
- dbus_free (user);
- user = NULL;
- }
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- /* systemd service is never required */
- if (!bus_desktop_file_get_string (desktop_file,
- DBUS_SERVICE_SECTION,
- DBUS_SERVICE_SYSTEMD_SERVICE,
- &systemd_service, &tmp_error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- /* if we got OOM, then exit */
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- goto out;
- }
- else
- {
- /* if we have error because we didn't find anything then continue */
- dbus_error_free (&tmp_error);
- dbus_free (systemd_service);
- systemd_service = NULL;
- }
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- entry = _dbus_hash_table_lookup_string (s_dir->entries,
- _dbus_string_get_const_data (filename));
-
- if (entry == NULL) /* New file */
- {
- /* FIXME we need a better-defined algorithm for which service file to
- * pick than "whichever one is first in the directory listing"
- */
- if (_dbus_hash_table_lookup_string (activation->entries, name))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Service %s already exists in activation entry list\n", name);
- goto out;
- }
-
- entry = dbus_new0 (BusActivationEntry, 1);
- if (entry == NULL)
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- entry->name = name;
- entry->exec = exec;
- entry->user = user;
- entry->systemd_service = systemd_service;
- entry->refcount = 1;
-
- /* ownership has been transferred to entry, do not free separately */
- name = NULL;
- exec = NULL;
- user = NULL;
- systemd_service = NULL;
-
- entry->s_dir = s_dir;
- entry->filename = _dbus_strdup (_dbus_string_get_const_data (filename));
- if (!entry->filename)
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!_dbus_hash_table_insert_string (activation->entries, entry->name, bus_activation_entry_ref (entry)))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!_dbus_hash_table_insert_string (s_dir->entries, entry->filename, bus_activation_entry_ref (entry)))
- {
- /* Revert the insertion in the entries table */
- _dbus_hash_table_remove_string (activation->entries, entry->name);
- BUS_SET_OOM (error);
- goto out;
- }
-
- _dbus_verbose ("Added \"%s\" to list of services\n", entry->name);
- }
- else /* Just update the entry */
- {
- bus_activation_entry_ref (entry);
- _dbus_hash_table_remove_string (activation->entries, entry->name);
-
- if (_dbus_hash_table_lookup_string (activation->entries, name))
- {
- _dbus_verbose ("The new service name \"%s\" of service file \"%s\" is already in cache, ignoring\n",
- name, _dbus_string_get_const_data (&file_path));
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "The new service name \"%s\" of service file \"%s\" is already in cache, ignoring\n",
- name, _dbus_string_get_const_data (&file_path));
- goto out;
- }
-
- /* ownership has been transferred to entry, do not free separately */
- dbus_free (entry->name);
- entry->name = name;
- name = NULL;
-
- dbus_free (entry->exec);
- entry->exec = exec;
- exec = NULL;
-
- dbus_free (entry->user);
- entry->user = user;
- user = NULL;
-
- dbus_free (entry->systemd_service);
- entry->systemd_service = systemd_service;
- systemd_service = NULL;
-
- if (!_dbus_hash_table_insert_string (activation->entries,
- entry->name, bus_activation_entry_ref(entry)))
- {
- BUS_SET_OOM (error);
- /* Also remove path to entries hash since we want this in sync with
- * the entries hash table */
- _dbus_hash_table_remove_string (entry->s_dir->entries,
- entry->filename);
- goto out;
- }
- }
-
- entry->mtime = stat_buf.mtime;
- retval = TRUE;
-
-out:
- /* if these have been transferred into entry, the variables will be NULL */
- dbus_free (name);
- dbus_free (exec);
- dbus_free (user);
- dbus_free (systemd_service);
- _dbus_string_free (&file_path);
-
- if (entry)
- bus_activation_entry_unref (entry);
-
- return retval;
-}
-
-static dbus_bool_t
-check_service_file (BusActivation *activation,
- BusActivationEntry *entry,
- BusActivationEntry **updated_entry,
- DBusError *error)
-{
- DBusStat stat_buf;
- dbus_bool_t retval;
- BusActivationEntry *tmp_entry;
- DBusString file_path;
- DBusString filename;
-
- retval = TRUE;
- tmp_entry = entry;
-
- _dbus_string_init_const (&filename, entry->filename);
-
- if (!_dbus_string_init (&file_path))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append (&file_path, entry->s_dir->dir_c) ||
- !_dbus_concat_dir_and_file (&file_path, &filename))
- {
- BUS_SET_OOM (error);
- retval = FALSE;
- goto out;
- }
-
- if (!_dbus_stat (&file_path, &stat_buf, NULL))
- {
- _dbus_verbose ("****** Can't stat file \"%s\", removing from cache\n",
- _dbus_string_get_const_data (&file_path));
-
- _dbus_hash_table_remove_string (activation->entries, entry->name);
- _dbus_hash_table_remove_string (entry->s_dir->entries, entry->filename);
-
- tmp_entry = NULL;
- retval = TRUE;
- goto out;
- }
- else
- {
- if (stat_buf.mtime > entry->mtime)
- {
- BusDesktopFile *desktop_file;
- DBusError tmp_error;
-
- dbus_error_init (&tmp_error);
-
- desktop_file = bus_desktop_file_load (&file_path, &tmp_error);
- if (desktop_file == NULL)
- {
- _dbus_verbose ("Could not load %s: %s\n",
- _dbus_string_get_const_data (&file_path),
- tmp_error.message);
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- retval = FALSE;
- goto out;
- }
- dbus_error_free (&tmp_error);
- retval = TRUE;
- goto out;
- }
-
- /* @todo We can return OOM or a DBUS_ERROR_FAILED error
- * Handle these both better
- */
- if (!update_desktop_file_entry (activation, entry->s_dir, &filename, desktop_file, &tmp_error))
- {
- bus_desktop_file_free (desktop_file);
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- retval = FALSE;
- goto out;
- }
- dbus_error_free (&tmp_error);
- retval = TRUE;
- goto out;
- }
-
- bus_desktop_file_free (desktop_file);
- retval = TRUE;
- }
- }
-
-out:
- _dbus_string_free (&file_path);
-
- if (updated_entry != NULL)
- *updated_entry = tmp_entry;
- return retval;
-}
-
-
-/* warning: this doesn't fully "undo" itself on failure, i.e. doesn't strip
- * hash entries it already added.
- */
-static dbus_bool_t
-update_directory (BusActivation *activation,
- BusServiceDirectory *s_dir,
- DBusError *error)
-{
- DBusDirIter *iter;
- DBusString dir, filename;
- BusDesktopFile *desktop_file;
- DBusError tmp_error;
- dbus_bool_t retval;
- BusActivationEntry *entry;
- DBusString full_path;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- iter = NULL;
- desktop_file = NULL;
-
- _dbus_string_init_const (&dir, s_dir->dir_c);
-
- if (!_dbus_string_init (&filename))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&full_path))
- {
- BUS_SET_OOM (error);
- _dbus_string_free (&filename);
- return FALSE;
- }
-
- retval = FALSE;
-
- /* from this point it's safe to "goto out" */
-
- iter = _dbus_directory_open (&dir, error);
- if (iter == NULL)
- {
- _dbus_verbose ("Failed to open directory %s: %s\n",
- s_dir->dir_c,
- error ? error->message : "unknown");
- goto out;
- }
-
- /* Now read the files */
- dbus_error_init (&tmp_error);
- while (_dbus_directory_get_next_file (iter, &filename, &tmp_error))
- {
- _dbus_assert (!dbus_error_is_set (&tmp_error));
-
- _dbus_string_set_length (&full_path, 0);
-
- if (!_dbus_string_ends_with_c_str (&filename, ".service"))
- {
- _dbus_verbose ("Skipping non-.service file %s\n",
- _dbus_string_get_const_data (&filename));
- continue;
- }
-
- entry = _dbus_hash_table_lookup_string (s_dir->entries, _dbus_string_get_const_data (&filename));
- if (entry) /* Already has this service file in the cache */
- {
- if (!check_service_file (activation, entry, NULL, error))
- goto out;
-
- continue;
- }
-
- if (!_dbus_string_append (&full_path, s_dir->dir_c) ||
- !_dbus_concat_dir_and_file (&full_path, &filename))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- /* New file */
- desktop_file = bus_desktop_file_load (&full_path, &tmp_error);
- if (desktop_file == NULL)
- {
- _dbus_verbose ("Could not load %s: %s\n",
- _dbus_string_get_const_data (&full_path),
- tmp_error.message);
-
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- goto out;
- }
-
- dbus_error_free (&tmp_error);
- continue;
- }
-
- /* @todo We can return OOM or a DBUS_ERROR_FAILED error
- * Handle these both better
- */
- if (!update_desktop_file_entry (activation, s_dir, &filename, desktop_file, &tmp_error))
- {
- bus_desktop_file_free (desktop_file);
- desktop_file = NULL;
-
- _dbus_verbose ("Could not add %s to activation entry list: %s\n",
- _dbus_string_get_const_data (&full_path), tmp_error.message);
-
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- goto out;
- }
-
- dbus_error_free (&tmp_error);
- continue;
- }
- else
- {
- bus_desktop_file_free (desktop_file);
- desktop_file = NULL;
- continue;
- }
- }
-
- if (dbus_error_is_set (&tmp_error))
- {
- dbus_move_error (&tmp_error, error);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (!retval)
- _DBUS_ASSERT_ERROR_IS_SET (error);
- else
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (iter != NULL)
- _dbus_directory_close (iter);
- _dbus_string_free (&filename);
- _dbus_string_free (&full_path);
-
- return retval;
-}
-
-static dbus_bool_t
-populate_environment (BusActivation *activation)
-{
- DBusString key;
- DBusString value;
- int i;
- char **environment;
- dbus_bool_t retval = FALSE;
-
- environment = _dbus_get_environment ();
-
- if (environment == NULL)
- return FALSE;
-
- if (!_dbus_string_init (&key))
- {
- dbus_free_string_array (environment);
- return FALSE;
- }
-
- if (!_dbus_string_init (&value))
- {
- _dbus_string_free (&key);
- dbus_free_string_array (environment);
- return FALSE;
- }
-
- for (i = 0; environment[i] != NULL; i++)
- {
- if (!_dbus_string_append (&key, environment[i]))
- break;
-
- if (_dbus_string_split_on_byte (&key, '=', &value))
- {
- char *hash_key, *hash_value;
-
- if (!_dbus_string_steal_data (&key, &hash_key))
- break;
-
- if (!_dbus_string_steal_data (&value, &hash_value))
- break;
-
- if (!_dbus_hash_table_insert_string (activation->environment,
- hash_key, hash_value))
- break;
- }
- _dbus_string_set_length (&key, 0);
- _dbus_string_set_length (&value, 0);
- }
-
- if (environment[i] != NULL)
- goto out;
-
- retval = TRUE;
-out:
-
- _dbus_string_free (&key);
- _dbus_string_free (&value);
- dbus_free_string_array (environment);
-
- return retval;
-}
-
-dbus_bool_t
-bus_activation_reload (BusActivation *activation,
- const DBusString *address,
- DBusList **directories,
- DBusError *error)
-{
- DBusList *link;
- char *dir;
-
- if (activation->server_address != NULL)
- dbus_free (activation->server_address);
- if (!_dbus_string_copy_data (address, &activation->server_address))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (activation->entries != NULL)
- _dbus_hash_table_unref (activation->entries);
- activation->entries = _dbus_hash_table_new (DBUS_HASH_STRING, NULL,
- (DBusFreeFunction)bus_activation_entry_unref);
- if (activation->entries == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (activation->directories != NULL)
- _dbus_hash_table_unref (activation->directories);
- activation->directories = _dbus_hash_table_new (DBUS_HASH_STRING, NULL,
- (DBusFreeFunction)bus_service_directory_unref);
-
- if (activation->directories == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- link = _dbus_list_get_first_link (directories);
- while (link != NULL)
- {
- BusServiceDirectory *s_dir;
-
- dir = _dbus_strdup ((const char *) link->data);
- if (!dir)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- s_dir = dbus_new0 (BusServiceDirectory, 1);
- if (!s_dir)
- {
- dbus_free (dir);
- BUS_SET_OOM (error);
- goto failed;
- }
-
- s_dir->refcount = 1;
- s_dir->dir_c = dir;
-
- s_dir->entries = _dbus_hash_table_new (DBUS_HASH_STRING, NULL,
- (DBusFreeFunction)bus_activation_entry_unref);
-
- if (!s_dir->entries)
- {
- bus_service_directory_unref (s_dir);
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!_dbus_hash_table_insert_string (activation->directories, s_dir->dir_c, s_dir))
- {
- bus_service_directory_unref (s_dir);
- BUS_SET_OOM (error);
- goto failed;
- }
-
- /* only fail on OOM, it is ok if we can't read the directory */
- if (!update_directory (activation, s_dir, error))
- {
- if (dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY))
- goto failed;
- else
- dbus_error_free (error);
- }
-
- link = _dbus_list_get_next_link (directories, link);
- }
-
- return TRUE;
- failed:
- return FALSE;
-}
-
-BusActivation*
-bus_activation_new (BusContext *context,
- const DBusString *address,
- DBusList **directories,
- DBusError *error)
-{
- BusActivation *activation;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- activation = dbus_new0 (BusActivation, 1);
- if (activation == NULL)
- {
- BUS_SET_OOM (error);
- return NULL;
- }
-
- activation->refcount = 1;
- activation->context = context;
- activation->n_pending_activations = 0;
-
- if (!bus_activation_reload (activation, address, directories, error))
- goto failed;
-
- /* Initialize this hash table once, we don't want to lose pending
- * activations on reload. */
- activation->pending_activations = _dbus_hash_table_new (DBUS_HASH_STRING, NULL,
- (DBusFreeFunction)bus_pending_activation_unref);
-
- if (activation->pending_activations == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- activation->environment = _dbus_hash_table_new (DBUS_HASH_STRING,
- (DBusFreeFunction) dbus_free,
- (DBusFreeFunction) dbus_free);
-
- if (activation->environment == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!populate_environment (activation))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- return activation;
-
- failed:
- bus_activation_unref (activation);
- return NULL;
-}
-
-BusActivation *
-bus_activation_ref (BusActivation *activation)
-{
- _dbus_assert (activation->refcount > 0);
-
- activation->refcount += 1;
-
- return activation;
-}
-
-void
-bus_activation_unref (BusActivation *activation)
-{
- _dbus_assert (activation->refcount > 0);
-
- activation->refcount -= 1;
-
- if (activation->refcount > 0)
- return;
-
- dbus_free (activation->server_address);
- if (activation->entries)
- _dbus_hash_table_unref (activation->entries);
- if (activation->pending_activations)
- _dbus_hash_table_unref (activation->pending_activations);
- if (activation->directories)
- _dbus_hash_table_unref (activation->directories);
- if (activation->environment)
- _dbus_hash_table_unref (activation->environment);
-
- dbus_free (activation);
-}
-
-static dbus_bool_t
-add_bus_environment (BusActivation *activation,
- DBusError *error)
-{
- const char *type;
-
- if (!bus_activation_set_environment_variable (activation,
- "DBUS_STARTER_ADDRESS",
- activation->server_address,
- error))
- return FALSE;
-
- type = bus_context_get_type (activation->context);
- if (type != NULL)
- {
- if (!bus_activation_set_environment_variable (activation,
- "DBUS_STARTER_BUS_TYPE", type,
- error))
- return FALSE;
-
- if (strcmp (type, "session") == 0)
- {
- if (!bus_activation_set_environment_variable (activation,
- "DBUS_SESSION_BUS_ADDRESS",
- activation->server_address,
- error))
- return FALSE;
- }
- else if (strcmp (type, "system") == 0)
- {
- if (!bus_activation_set_environment_variable (activation,
- "DBUS_SYSTEM_BUS_ADDRESS",
- activation->server_address,
- error))
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-typedef struct
-{
- BusPendingActivation *pending_activation;
- DBusPreallocatedHash *hash_entry;
-} RestorePendingData;
-
-static void
-restore_pending (void *data)
-{
- RestorePendingData *d = data;
-
- _dbus_assert (d->pending_activation != NULL);
- _dbus_assert (d->hash_entry != NULL);
-
- _dbus_verbose ("Restoring pending activation for service %s, has timeout = %d\n",
- d->pending_activation->service_name,
- d->pending_activation->timeout_added);
-
- _dbus_hash_table_insert_string_preallocated (d->pending_activation->activation->pending_activations,
- d->hash_entry,
- d->pending_activation->service_name, d->pending_activation);
-
- bus_pending_activation_ref (d->pending_activation);
-
- d->hash_entry = NULL;
-}
-
-static void
-free_pending_restore_data (void *data)
-{
- RestorePendingData *d = data;
-
- if (d->hash_entry)
- _dbus_hash_table_free_preallocated_entry (d->pending_activation->activation->pending_activations,
- d->hash_entry);
-
- bus_pending_activation_unref (d->pending_activation);
-
- dbus_free (d);
-}
-
-static dbus_bool_t
-add_restore_pending_to_transaction (BusTransaction *transaction,
- BusPendingActivation *pending_activation)
-{
- RestorePendingData *d;
-
- d = dbus_new (RestorePendingData, 1);
- if (d == NULL)
- return FALSE;
-
- d->pending_activation = pending_activation;
- d->hash_entry = _dbus_hash_table_preallocate_entry (d->pending_activation->activation->pending_activations);
-
- bus_pending_activation_ref (d->pending_activation);
-
- if (d->hash_entry == NULL ||
- !bus_transaction_add_cancel_hook (transaction, restore_pending, d,
- free_pending_restore_data))
- {
- free_pending_restore_data (d);
- return FALSE;
- }
-
- _dbus_verbose ("Saved pending activation to be restored if the transaction fails\n");
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_activation_service_created (BusActivation *activation,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error)
-{
- BusPendingActivation *pending_activation;
- DBusMessage *message;
- DBusList *link;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* Check if it's a pending activation */
- pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name);
-
- if (!pending_activation)
- return TRUE;
-
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Successfully activated service '%s'",
- service_name);
-
- link = _dbus_list_get_first_link (&pending_activation->entries);
- while (link != NULL)
- {
- BusPendingActivationEntry *entry = link->data;
- DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
-
- /* entry->connection is NULL for activating systemd */
- if (entry->connection && dbus_connection_get_is_connected (entry->connection))
- {
- /* Only send activation replies to regular activation requests. */
- if (!entry->auto_activation)
- {
- dbus_uint32_t result;
-
- message = dbus_message_new_method_return (entry->activation_message);
- if (!message)
- {
- BUS_SET_OOM (error);
- goto error;
- }
-
- result = DBUS_START_REPLY_SUCCESS;
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_UINT32, &result,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- goto error;
- }
-
- if (!bus_transaction_send_from_driver (transaction, entry->connection, message))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- goto error;
- }
-
- dbus_message_unref (message);
- }
- }
-
- link = next;
- }
-
- return TRUE;
-
- error:
- return FALSE;
-}
-
-dbus_bool_t
-bus_activation_send_pending_auto_activation_messages (BusActivation *activation,
- BusService *service,
- BusTransaction *transaction,
- DBusError *error)
-{
- BusPendingActivation *pending_activation;
- DBusList *link;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* Check if it's a pending activation */
- pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations,
- bus_service_get_name (service));
-
- if (!pending_activation)
- return TRUE;
-
- link = _dbus_list_get_first_link (&pending_activation->entries);
- while (link != NULL)
- {
- BusPendingActivationEntry *entry = link->data;
- DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
-
- if (entry->auto_activation && (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection)))
- {
- DBusConnection *addressed_recipient;
-
- addressed_recipient = bus_service_get_primary_owners_connection (service);
-
- /* Resume dispatching where we left off in bus_dispatch() */
- if (!bus_dispatch_matches (transaction,
- entry->connection,
- addressed_recipient,
- entry->activation_message, error))
- goto error;
- }
-
- link = next;
- }
-
- if (!add_restore_pending_to_transaction (transaction, pending_activation))
- {
- _dbus_verbose ("Could not add cancel hook to transaction to revert removing pending activation\n");
- BUS_SET_OOM (error);
- goto error;
- }
-
- _dbus_hash_table_remove_string (activation->pending_activations, bus_service_get_name (service));
-
- return TRUE;
-
- error:
- return FALSE;
-}
-
-/**
- * FIXME @todo the error messages here would ideally be preallocated
- * so we don't need to allocate memory to send them.
- * Using the usual tactic, prealloc an OOM message, then
- * if we can't alloc the real error send the OOM error instead.
- */
-static dbus_bool_t
-try_send_activation_failure (BusPendingActivation *pending_activation,
- const DBusError *how)
-{
- BusActivation *activation;
- DBusList *link;
- BusTransaction *transaction;
-
- activation = pending_activation->activation;
-
- transaction = bus_transaction_new (activation->context);
- if (transaction == NULL)
- return FALSE;
-
- link = _dbus_list_get_first_link (&pending_activation->entries);
- while (link != NULL)
- {
- BusPendingActivationEntry *entry = link->data;
- DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
-
- if (entry->connection && dbus_connection_get_is_connected (entry->connection))
- {
- if (!bus_transaction_send_error_reply (transaction,
- entry->connection,
- how,
- entry->activation_message))
- goto error;
- }
-
- link = next;
- }
-
- bus_transaction_execute_and_free (transaction);
-
- return TRUE;
-
- error:
- if (transaction)
- bus_transaction_cancel_and_free (transaction);
- return FALSE;
-}
-
-/**
- * Free the pending activation and send an error message to all the
- * connections that were waiting for it.
- */
-static void
-pending_activation_failed (BusPendingActivation *pending_activation,
- const DBusError *how)
-{
- /* FIXME use preallocated OOM messages instead of bus_wait_for_memory() */
- while (!try_send_activation_failure (pending_activation, how))
- _dbus_wait_for_memory ();
-
- /* Destroy this pending activation */
- _dbus_hash_table_remove_string (pending_activation->activation->pending_activations,
- pending_activation->service_name);
-}
-
-/**
- * Depending on the exit code of the helper, set the error accordingly
- */
-static void
-handle_servicehelper_exit_error (int exit_code,
- DBusError *error)
-{
- switch (exit_code)
- {
- case BUS_SPAWN_EXIT_CODE_CONFIG_INVALID:
- dbus_set_error (error, DBUS_ERROR_SPAWN_CONFIG_INVALID,
- "Invalid configuration (missing or empty <user>?)");
- break;
- case BUS_SPAWN_EXIT_CODE_NO_MEMORY:
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Launcher could not run (out of memory)");
- break;
- case BUS_SPAWN_EXIT_CODE_SETUP_FAILED:
- dbus_set_error (error, DBUS_ERROR_SPAWN_SETUP_FAILED,
- "Failed to setup environment correctly");
- break;
- case BUS_SPAWN_EXIT_CODE_NAME_INVALID:
- dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_INVALID,
- "Bus name is not valid or missing");
- break;
- case BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND:
- dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND,
- "Bus name not found in system service directory");
- break;
- case BUS_SPAWN_EXIT_CODE_PERMISSIONS_INVALID:
- dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,
- "The permission of the setuid helper is not correct");
- break;
- case BUS_SPAWN_EXIT_CODE_FILE_INVALID:
- dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,
- "The service file is incorrect or does not have all required attributes");
- break;
- case BUS_SPAWN_EXIT_CODE_EXEC_FAILED:
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "Cannot launch daemon, file not found or permissions invalid");
- break;
- case BUS_SPAWN_EXIT_CODE_INVALID_ARGS:
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Invalid arguments to command line");
- break;
- case BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED:
- dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED,
- "Launched child was signaled, it probably crashed");
- break;
- case BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE:
- default:
- dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
- "Launch helper exited with unknown return code %i", exit_code);
- break;
- }
-}
-
-static void
-pending_activation_finished_cb (DBusBabysitter *babysitter,
- void *data)
-{
- BusPendingActivation *pending_activation = data;
- dbus_bool_t uses_servicehelper;
-
- _dbus_assert (babysitter == pending_activation->babysitter);
- _dbus_babysitter_ref (babysitter);
-
- /* There are two major cases here; are we the system bus or the session? Here this
- * is distinguished by whether or not we use a setuid helper launcher. With the launch helper,
- * some process exit codes are meaningful, processed by handle_servicehelper_exit_error.
- *
- * In both cases though, just ignore when a process exits with status 0; it's possible for
- * a program to (misguidedly) "daemonize", and that appears to us as an exit. This closes a race
- * condition between this code and the child process claiming the bus name.
- */
- uses_servicehelper = bus_context_get_servicehelper (pending_activation->activation->context) != NULL;
-
- /* strictly speaking this is redundant with the check in dbus-spawn now */
- if (_dbus_babysitter_get_child_exited (babysitter))
- {
- DBusError error;
- DBusHashIter iter;
- dbus_bool_t activation_failed;
- int exit_code = 0;
-
- dbus_error_init (&error);
-
- _dbus_babysitter_set_child_exit_error (babysitter, &error);
-
- /* Explicitly check for SPAWN_CHILD_EXITED to avoid overwriting an
- * exec error */
- if (dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_EXITED)
- && _dbus_babysitter_get_child_exit_status (babysitter, &exit_code))
- {
- activation_failed = exit_code != 0;
-
- dbus_error_free(&error);
-
- if (activation_failed)
- {
- if (uses_servicehelper)
- handle_servicehelper_exit_error (exit_code, &error);
- else
- _dbus_babysitter_set_child_exit_error (babysitter, &error);
- }
- }
- else
- {
- activation_failed = TRUE;
- }
-
- if (activation_failed)
- {
- bus_context_log (pending_activation->activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activated service '%s' failed: %s",
- pending_activation->service_name,
- error.message);
-
- /* Destroy all pending activations with the same exec */
- _dbus_hash_iter_init (pending_activation->activation->pending_activations,
- &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- BusPendingActivation *p = _dbus_hash_iter_get_value (&iter);
-
- if (p != pending_activation && strcmp (p->exec, pending_activation->exec) == 0)
- pending_activation_failed (p, &error);
- }
-
- /* Destroys the pending activation */
- pending_activation_failed (pending_activation, &error);
-
- dbus_error_free (&error);
- }
- }
-
- _dbus_babysitter_unref (babysitter);
-}
-
-static dbus_bool_t
-add_babysitter_watch (DBusWatch *watch,
- void *data)
-{
- BusPendingActivation *pending_activation = data;
-
- return _dbus_loop_add_watch (
- bus_context_get_loop (pending_activation->activation->context),
- watch);
-}
-
-static void
-remove_babysitter_watch (DBusWatch *watch,
- void *data)
-{
- BusPendingActivation *pending_activation = data;
-
- _dbus_loop_remove_watch (bus_context_get_loop (pending_activation->activation->context),
- watch);
-}
-
-static void
-toggle_babysitter_watch (DBusWatch *watch,
- void *data)
-{
- BusPendingActivation *pending_activation = data;
-
- _dbus_loop_toggle_watch (bus_context_get_loop (pending_activation->activation->context),
- watch);
-}
-
-static dbus_bool_t
-pending_activation_timed_out (void *data)
-{
- BusPendingActivation *pending_activation = data;
- DBusError error;
-
- /* Kill the spawned process, since it sucks
- * (not sure this is what we want to do, but
- * may as well try it for now)
- */
- if (pending_activation->babysitter)
- _dbus_babysitter_kill_child (pending_activation->babysitter);
-
- dbus_error_init (&error);
-
- dbus_set_error (&error, DBUS_ERROR_TIMED_OUT,
- "Activation of %s timed out",
- pending_activation->service_name);
- bus_context_log (pending_activation->activation->context,
- DBUS_SYSTEM_LOG_INFO,
- "Failed to activate service '%s': timed out",
- pending_activation->service_name);
-
- pending_activation_failed (pending_activation, &error);
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static void
-cancel_pending (void *data)
-{
- BusPendingActivation *pending_activation = data;
-
- _dbus_verbose ("Canceling pending activation of %s\n",
- pending_activation->service_name);
-
- if (pending_activation->babysitter)
- _dbus_babysitter_kill_child (pending_activation->babysitter);
-
- _dbus_hash_table_remove_string (pending_activation->activation->pending_activations,
- pending_activation->service_name);
-}
-
-static void
-free_pending_cancel_data (void *data)
-{
- BusPendingActivation *pending_activation = data;
-
- bus_pending_activation_unref (pending_activation);
-}
-
-static dbus_bool_t
-add_cancel_pending_to_transaction (BusTransaction *transaction,
- BusPendingActivation *pending_activation)
-{
- if (!bus_transaction_add_cancel_hook (transaction, cancel_pending,
- pending_activation,
- free_pending_cancel_data))
- return FALSE;
-
- bus_pending_activation_ref (pending_activation);
-
- _dbus_verbose ("Saved pending activation to be canceled if the transaction fails\n");
-
- return TRUE;
-}
-
-static dbus_bool_t
-update_service_cache (BusActivation *activation, DBusError *error)
-{
- DBusHashIter iter;
-
- _dbus_hash_iter_init (activation->directories, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- DBusError tmp_error;
- BusServiceDirectory *s_dir;
-
- s_dir = _dbus_hash_iter_get_value (&iter);
-
- dbus_error_init (&tmp_error);
- if (!update_directory (activation, s_dir, &tmp_error))
- {
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_move_error (&tmp_error, error);
- return FALSE;
- }
-
- dbus_error_free (&tmp_error);
- continue;
- }
- }
-
- return TRUE;
-}
-
-static BusActivationEntry *
-activation_find_entry (BusActivation *activation,
- const char *service_name,
- DBusError *error)
-{
- BusActivationEntry *entry;
-
- entry = _dbus_hash_table_lookup_string (activation->entries, service_name);
- if (!entry)
- {
- if (!update_service_cache (activation, error))
- return NULL;
-
- entry = _dbus_hash_table_lookup_string (activation->entries,
- service_name);
- }
- else
- {
- BusActivationEntry *updated_entry;
-
- if (!check_service_file (activation, entry, &updated_entry, error))
- return NULL;
-
- entry = updated_entry;
- }
-
- if (!entry)
- {
- dbus_set_error (error, DBUS_ERROR_SERVICE_UNKNOWN,
- "The name %s was not provided by any .service files",
- service_name);
- return NULL;
- }
-
- return entry;
-}
-
-static char **
-bus_activation_get_environment (BusActivation *activation)
-{
- char **environment;
- int i, length;
- DBusString entry;
- DBusHashIter iter;
-
- length = _dbus_hash_table_get_n_entries (activation->environment);
-
- environment = dbus_new0 (char *, length + 1);
-
- if (environment == NULL)
- return NULL;
-
- i = 0;
- _dbus_hash_iter_init (activation->environment, &iter);
-
- if (!_dbus_string_init (&entry))
- {
- dbus_free_string_array (environment);
- return NULL;
- }
-
- while (_dbus_hash_iter_next (&iter))
- {
- const char *key, *value;
-
- key = (const char *) _dbus_hash_iter_get_string_key (&iter);
- value = (const char *) _dbus_hash_iter_get_value (&iter);
-
- if (!_dbus_string_append_printf (&entry, "%s=%s", key, value))
- break;
-
- if (!_dbus_string_steal_data (&entry, environment + i))
- break;
- i++;
- }
-
- _dbus_string_free (&entry);
-
- if (i != length)
- {
- dbus_free_string_array (environment);
- environment = NULL;
- }
-
- return environment;
-}
-
-dbus_bool_t
-bus_activation_set_environment_variable (BusActivation *activation,
- const char *key,
- const char *value,
- DBusError *error)
-{
- char *hash_key;
- char *hash_value;
- dbus_bool_t retval;
-
- retval = FALSE;
- hash_key = NULL;
- hash_value = NULL;
- hash_key = _dbus_strdup (key);
-
- if (hash_key == NULL)
- goto out;
-
- hash_value = _dbus_strdup (value);
-
- if (hash_value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_string (activation->environment,
- hash_key, hash_value))
- goto out;
-
- retval = TRUE;
-out:
- if (retval == FALSE)
- {
- dbus_free (hash_key);
- dbus_free (hash_value);
- BUS_SET_OOM (error);
- }
-
- return retval;
-}
-
-dbus_bool_t
-bus_activation_activate_service (BusActivation *activation,
- DBusConnection *connection,
- BusTransaction *transaction,
- dbus_bool_t auto_activation,
- DBusMessage *activation_message,
- const char *service_name,
- DBusError *error)
-{
- DBusError tmp_error;
- BusActivationEntry *entry;
- BusPendingActivation *pending_activation;
- BusPendingActivationEntry *pending_activation_entry;
- DBusMessage *message;
- DBusString service_str;
- const char *servicehelper;
- char **argv;
- char **envp = NULL;
- int argc;
- dbus_bool_t retval;
- dbus_bool_t was_pending_activation;
- DBusString command;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (activation->n_pending_activations >=
- bus_context_get_max_pending_activations (activation->context))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "The maximum number of pending activations has been reached, activation of %s failed",
- service_name);
- return FALSE;
- }
-
- entry = activation_find_entry (activation, service_name, error);
- if (!entry)
- return FALSE;
-
- /* Bypass the registry lookup if we're auto-activating, bus_dispatch would not
- * call us if the service is already active.
- */
- if (!auto_activation)
- {
- /* Check if the service is active */
- _dbus_string_init_const (&service_str, service_name);
- if (bus_registry_lookup (bus_context_get_registry (activation->context), &service_str) != NULL)
- {
- dbus_uint32_t result;
-
- _dbus_verbose ("Service \"%s\" is already active\n", service_name);
-
- message = dbus_message_new_method_return (activation_message);
-
- if (!message)
- {
- _dbus_verbose ("No memory to create reply to activate message\n");
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- result = DBUS_START_REPLY_ALREADY_RUNNING;
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_UINT32, &result,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("No memory to set args of reply to activate message\n");
- BUS_SET_OOM (error);
- dbus_message_unref (message);
- return FALSE;
- }
-
- retval = bus_transaction_send_from_driver (transaction, connection, message);
- dbus_message_unref (message);
- if (!retval)
- {
- _dbus_verbose ("Failed to send reply\n");
- BUS_SET_OOM (error);
- }
-
- return retval;
- }
- }
-
- pending_activation_entry = dbus_new0 (BusPendingActivationEntry, 1);
- if (!pending_activation_entry)
- {
- _dbus_verbose ("Failed to create pending activation entry\n");
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- pending_activation_entry->auto_activation = auto_activation;
-
- pending_activation_entry->activation_message = activation_message;
- dbus_message_ref (activation_message);
- pending_activation_entry->connection = connection;
- if (connection)
- dbus_connection_ref (connection);
-
- /* Check if the service is being activated */
- pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name);
- was_pending_activation = (pending_activation != NULL);
- if (was_pending_activation)
- {
- if (!_dbus_list_append (&pending_activation->entries, pending_activation_entry))
- {
- _dbus_verbose ("Failed to append a new entry to pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- pending_activation->n_entries += 1;
- pending_activation->activation->n_pending_activations += 1;
- }
- else
- {
- pending_activation = dbus_new0 (BusPendingActivation, 1);
- if (!pending_activation)
- {
- _dbus_verbose ("Failed to create pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- pending_activation->activation = activation;
- pending_activation->refcount = 1;
-
- pending_activation->service_name = _dbus_strdup (service_name);
- if (!pending_activation->service_name)
- {
- _dbus_verbose ("Failed to copy service name for pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- pending_activation->exec = _dbus_strdup (entry->exec);
- if (!pending_activation->exec)
- {
- _dbus_verbose ("Failed to copy service exec for pending activation\n");
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- if (entry->systemd_service)
- {
- pending_activation->systemd_service = _dbus_strdup (entry->systemd_service);
- if (!pending_activation->systemd_service)
- {
- _dbus_verbose ("Failed to copy systemd service for pending activation\n");
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
- }
-
- pending_activation->timeout =
- _dbus_timeout_new (bus_context_get_activation_timeout (activation->context),
- pending_activation_timed_out,
- pending_activation,
- NULL);
- if (!pending_activation->timeout)
- {
- _dbus_verbose ("Failed to create timeout for pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- if (!_dbus_loop_add_timeout (bus_context_get_loop (activation->context),
- pending_activation->timeout))
- {
- _dbus_verbose ("Failed to add timeout for pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- pending_activation->timeout_added = TRUE;
-
- if (!_dbus_list_append (&pending_activation->entries, pending_activation_entry))
- {
- _dbus_verbose ("Failed to add entry to just-created pending activation\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- bus_pending_activation_entry_free (pending_activation_entry);
- return FALSE;
- }
-
- pending_activation->n_entries += 1;
- pending_activation->activation->n_pending_activations += 1;
-
- if (!_dbus_hash_table_insert_string (activation->pending_activations,
- pending_activation->service_name,
- pending_activation))
- {
- _dbus_verbose ("Failed to put pending activation in hash table\n");
-
- BUS_SET_OOM (error);
- bus_pending_activation_unref (pending_activation);
- return FALSE;
- }
- }
-
- if (!add_cancel_pending_to_transaction (transaction, pending_activation))
- {
- _dbus_verbose ("Failed to add pending activation cancel hook to transaction\n");
- BUS_SET_OOM (error);
- _dbus_hash_table_remove_string (activation->pending_activations,
- pending_activation->service_name);
-
- return FALSE;
- }
-
- if (was_pending_activation)
- return TRUE;
-
- if (bus_context_get_systemd_activation (activation->context))
- {
- if (strcmp (service_name, "org.freedesktop.systemd1") == 0)
- /* systemd itself is missing apparently. That can happen
- only during early startup. Let's just wait until systemd
- connects to us and do nothing. */
- return TRUE;
-
- if (entry->systemd_service)
- {
- BusTransaction *activation_transaction;
- DBusString service_string;
- BusService *service;
- BusRegistry *registry;
-
- /* OK, we have a systemd service configured for this entry,
- hence let's enqueue an activation request message. This
- is implemented as a directed signal, not a method call,
- for three reasons: 1) we don't expect a response on
- success, where we just expect a name appearing on the
- bus; 2) at this time the systemd service might not yet
- have connected, so we wouldn't know the message serial at
- this point to set up a pending call; 3) it is ugly if the
- bus suddenly becomes the caller of a remote method. */
-
- message = dbus_message_new_signal (DBUS_PATH_DBUS,
- "org.freedesktop.systemd1.Activator",
- "ActivationRequest");
- if (!message)
- {
- _dbus_verbose ("No memory to create activation message\n");
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS) ||
- !dbus_message_set_destination (message, "org.freedesktop.systemd1") ||
- !dbus_message_append_args (message,
- DBUS_TYPE_STRING, &entry->systemd_service,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("No memory to set args of activation message\n");
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* Create our transaction */
- activation_transaction = bus_transaction_new (activation->context);
- if (activation_transaction == NULL)
- {
- _dbus_verbose ("No memory to create activation transaction\n");
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* Check whether systemd is already connected */
- registry = bus_connection_get_registry (connection);
- _dbus_string_init_const (&service_string, "org.freedesktop.systemd1");
- service = bus_registry_lookup (registry, &service_string);
-
- if (service != NULL)
- {
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s'",
- service_name,
- entry->systemd_service);
- /* Wonderful, systemd is connected, let's just send the msg */
- retval = bus_dispatch_matches (activation_transaction, NULL, bus_service_get_primary_owners_connection (service),
- message, error);
- }
- else
- {
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activating systemd to hand-off: service name='%s' unit='%s'",
- service_name,
- entry->systemd_service);
- /* systemd is not around, let's "activate" it. */
- retval = bus_activation_activate_service (activation, NULL, activation_transaction, TRUE,
- message, "org.freedesktop.systemd1", error);
- }
-
- dbus_message_unref (message);
-
- if (!retval)
- {
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Failed to activate via systemd: service name='%s' unit='%s'",
- service_name,
- entry->systemd_service);
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_verbose ("failed to send activation message: %s\n", error->name);
- bus_transaction_cancel_and_free (activation_transaction);
- return FALSE;
- }
-
- bus_transaction_execute_and_free (activation_transaction);
- return TRUE;
- }
-
- /* OK, we have no configured systemd service, hence let's
- proceed with traditional activation. */
- }
-
- /* use command as system and session different */
- if (!_dbus_string_init (&command))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* does the bus use a helper? */
- servicehelper = bus_context_get_servicehelper (activation->context);
- if (servicehelper != NULL)
- {
- if (entry->user == NULL)
- {
- _dbus_string_free (&command);
- dbus_set_error (error, DBUS_ERROR_SPAWN_FILE_INVALID,
- "Cannot do system-bus activation with no user\n");
- return FALSE;
- }
-
- /* join the helper path and the service name */
- if (!_dbus_string_append (&command, servicehelper))
- {
- _dbus_string_free (&command);
- BUS_SET_OOM (error);
- return FALSE;
- }
- if (!_dbus_string_append (&command, " "))
- {
- _dbus_string_free (&command);
- BUS_SET_OOM (error);
- return FALSE;
- }
- if (!_dbus_string_append (&command, service_name))
- {
- _dbus_string_free (&command);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
- else
- {
- /* the bus does not use a helper, so we can append arguments with the exec line */
- if (!_dbus_string_append (&command, entry->exec))
- {
- _dbus_string_free (&command);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- /* convert command into arguments */
- if (!_dbus_shell_parse_argv (_dbus_string_get_const_data (&command), &argc, &argv, error))
- {
- _dbus_verbose ("Failed to parse command line: %s\n", entry->exec);
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _dbus_hash_table_remove_string (activation->pending_activations,
- pending_activation->service_name);
-
- _dbus_string_free (&command);
- return FALSE;
- }
- _dbus_string_free (&command);
-
- if (!add_bus_environment (activation, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_free_string_array (argv);
- return FALSE;
- }
-
- envp = bus_activation_get_environment (activation);
-
- if (envp == NULL)
- {
- BUS_SET_OOM (error);
- dbus_free_string_array (argv);
- return FALSE;
- }
-
- _dbus_verbose ("Spawning %s ...\n", argv[0]);
- if (servicehelper != NULL)
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' (using servicehelper)",
- service_name);
- else
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activating service name='%s'",
- service_name);
-
- dbus_error_init (&tmp_error);
-
- if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter,
- service_name,
- argv,
- envp,
- NULL, activation,
- &tmp_error))
- {
- _dbus_verbose ("Failed to spawn child\n");
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Failed to activate service %s: %s",
- service_name,
- tmp_error.message);
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- dbus_move_error (&tmp_error, error);
- dbus_free_string_array (argv);
- dbus_free_string_array (envp);
-
- return FALSE;
- }
-
- dbus_free_string_array (argv);
- envp = NULL;
-
- _dbus_assert (pending_activation->babysitter != NULL);
-
- _dbus_babysitter_set_result_function (pending_activation->babysitter,
- pending_activation_finished_cb,
- pending_activation);
-
- if (!_dbus_babysitter_set_watch_functions (pending_activation->babysitter,
- add_babysitter_watch,
- remove_babysitter_watch,
- toggle_babysitter_watch,
- pending_activation,
- NULL))
- {
- BUS_SET_OOM (error);
- _dbus_verbose ("Failed to set babysitter watch functions\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_activation_list_services (BusActivation *activation,
- char ***listp,
- int *array_len)
-{
- int i, j, len;
- char **retval;
- DBusHashIter iter;
-
- len = _dbus_hash_table_get_n_entries (activation->entries);
- retval = dbus_new (char *, len + 1);
-
- if (retval == NULL)
- return FALSE;
-
- _dbus_hash_iter_init (activation->entries, &iter);
- i = 0;
- while (_dbus_hash_iter_next (&iter))
- {
- BusActivationEntry *entry = _dbus_hash_iter_get_value (&iter);
-
- retval[i] = _dbus_strdup (entry->name);
- if (retval[i] == NULL)
- goto error;
-
- i++;
- }
-
- retval[i] = NULL;
-
- if (array_len)
- *array_len = len;
-
- *listp = retval;
- return TRUE;
-
- error:
- for (j = 0; j < i; j++)
- dbus_free (retval[i]);
- dbus_free (retval);
-
- return FALSE;
-}
-
-dbus_bool_t
-dbus_activation_systemd_failure (BusActivation *activation,
- DBusMessage *message)
-{
- DBusError error;
- const char *code, *str, *unit = NULL;
-
- dbus_error_init(&error);
-
- /* This is called whenever the systemd activator sent us a
- response. We'll invalidate all pending activations that match the
- unit name. */
-
- if (dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &unit,
- DBUS_TYPE_STRING, &code,
- DBUS_TYPE_STRING, &str,
- DBUS_TYPE_INVALID))
- dbus_set_error(&error, code, str);
-
-
- if (unit)
- {
- DBusHashIter iter;
-
- bus_context_log (activation->context,
- DBUS_SYSTEM_LOG_INFO, "Activation via systemd failed for unit '%s': %s",
- unit,
- str);
-
- _dbus_hash_iter_init (activation->pending_activations,
- &iter);
-
- while (_dbus_hash_iter_next (&iter))
- {
- BusPendingActivation *p = _dbus_hash_iter_get_value (&iter);
-
- if (p->systemd_service && strcmp (p->systemd_service, unit) == 0)
- pending_activation_failed(p, &error);
- }
- }
-
- dbus_error_free(&error);
-
- return TRUE;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include <stdio.h>
-
-#define SERVICE_NAME_1 "MyService1"
-#define SERVICE_NAME_2 "MyService2"
-#define SERVICE_NAME_3 "MyService3"
-
-#define SERVICE_FILE_1 "service-1.service"
-#define SERVICE_FILE_2 "service-2.service"
-#define SERVICE_FILE_3 "service-3.service"
-
-static dbus_bool_t
-test_create_service_file (DBusString *dir,
- const char *filename,
- const char *name,
- const char *exec)
-{
- DBusString file_name, full_path;
- FILE *file;
- dbus_bool_t ret_val;
-
- ret_val = TRUE;
- _dbus_string_init_const (&file_name, filename);
-
- if (!_dbus_string_init (&full_path))
- return FALSE;
-
- if (!_dbus_string_append (&full_path, _dbus_string_get_const_data (dir)) ||
- !_dbus_concat_dir_and_file (&full_path, &file_name))
- {
- ret_val = FALSE;
- goto out;
- }
-
- file = fopen (_dbus_string_get_const_data (&full_path), "w");
- if (!file)
- {
- ret_val = FALSE;
- goto out;
- }
-
- fprintf (file, "[D-BUS Service]\nName=%s\nExec=%s\n", name, exec);
- fclose (file);
-
-out:
- _dbus_string_free (&full_path);
- return ret_val;
-}
-
-static dbus_bool_t
-test_remove_service_file (DBusString *dir, const char *filename)
-{
- DBusString file_name, full_path;
- dbus_bool_t ret_val;
-
- ret_val = TRUE;
-
- _dbus_string_init_const (&file_name, filename);
-
- if (!_dbus_string_init (&full_path))
- return FALSE;
-
- if (!_dbus_string_append (&full_path, _dbus_string_get_const_data (dir)) ||
- !_dbus_concat_dir_and_file (&full_path, &file_name))
- {
- ret_val = FALSE;
- goto out;
- }
-
- if (!_dbus_delete_file (&full_path, NULL))
- {
- ret_val = FALSE;
- goto out;
- }
-
-out:
- _dbus_string_free (&full_path);
- return ret_val;
-}
-
-static dbus_bool_t
-test_remove_directory (DBusString *dir)
-{
- DBusDirIter *iter;
- DBusString filename, full_path;
- dbus_bool_t ret_val;
-
- ret_val = TRUE;
-
- if (!_dbus_string_init (&filename))
- return FALSE;
-
- if (!_dbus_string_init (&full_path))
- {
- _dbus_string_free (&filename);
- return FALSE;
- }
-
- iter = _dbus_directory_open (dir, NULL);
- if (iter == NULL)
- {
- ret_val = FALSE;
- goto out;
- }
-
- while (_dbus_directory_get_next_file (iter, &filename, NULL))
- {
- if (!test_remove_service_file (dir, _dbus_string_get_const_data (&filename)))
- {
- ret_val = FALSE;
- goto out;
- }
- }
- _dbus_directory_close (iter);
-
- if (!_dbus_delete_directory (dir, NULL))
- {
- ret_val = FALSE;
- goto out;
- }
-
-out:
- _dbus_string_free (&filename);
- _dbus_string_free (&full_path);
-
- return ret_val;
-}
-
-static dbus_bool_t
-init_service_reload_test (DBusString *dir)
-{
- DBusStat stat_buf;
-
- if (!_dbus_stat (dir, &stat_buf, NULL))
- {
- if (!_dbus_create_directory (dir, NULL))
- return FALSE;
- }
- else
- {
- if (!test_remove_directory (dir))
- return FALSE;
-
- if (!_dbus_create_directory (dir, NULL))
- return FALSE;
- }
-
- /* Create one initial file */
- if (!test_create_service_file (dir, SERVICE_FILE_1, SERVICE_NAME_1, "exec-1"))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-cleanup_service_reload_test (DBusString *dir)
-{
- if (!test_remove_directory (dir))
- return FALSE;
-
- return TRUE;
-}
-
-typedef struct
-{
- BusActivation *activation;
- const char *service_name;
- dbus_bool_t expecting_find;
-} CheckData;
-
-static dbus_bool_t
-check_func (void *data)
-{
- CheckData *d;
- BusActivationEntry *entry;
- DBusError error;
- dbus_bool_t ret_val;
-
- ret_val = TRUE;
- d = data;
-
- dbus_error_init (&error);
-
- entry = activation_find_entry (d->activation, d->service_name, &error);
- if (entry == NULL)
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- ret_val = TRUE;
- }
- else
- {
- if (d->expecting_find)
- ret_val = FALSE;
- }
-
- dbus_error_free (&error);
- }
- else
- {
- if (!d->expecting_find)
- ret_val = FALSE;
- }
-
- return ret_val;
-}
-
-static dbus_bool_t
-do_test (const char *description, dbus_bool_t oom_test, CheckData *data)
-{
- dbus_bool_t err;
-
- if (oom_test)
- err = !_dbus_test_oom_handling (description, check_func, data);
- else
- err = !check_func (data);
-
- if (err)
- _dbus_assert_not_reached ("Test failed");
-
- return TRUE;
-}
-
-static dbus_bool_t
-do_service_reload_test (DBusString *dir, dbus_bool_t oom_test)
-{
- BusActivation *activation;
- DBusString address;
- DBusList *directories;
- CheckData d;
-
- directories = NULL;
- _dbus_string_init_const (&address, "");
-
- if (!_dbus_list_append (&directories, _dbus_string_get_data (dir)))
- return FALSE;
-
- activation = bus_activation_new (NULL, &address, &directories, NULL);
- if (!activation)
- return FALSE;
-
- d.activation = activation;
-
- /* Check for existing service file */
- d.expecting_find = TRUE;
- d.service_name = SERVICE_NAME_1;
-
- if (!do_test ("Existing service file", oom_test, &d))
- return FALSE;
-
- /* Check for non-existing service file */
- d.expecting_find = FALSE;
- d.service_name = SERVICE_NAME_3;
-
- if (!do_test ("Nonexisting service file", oom_test, &d))
- return FALSE;
-
- /* Check for added service file */
- if (!test_create_service_file (dir, SERVICE_FILE_2, SERVICE_NAME_2, "exec-2"))
- return FALSE;
-
- d.expecting_find = TRUE;
- d.service_name = SERVICE_NAME_2;
-
- if (!do_test ("Added service file", oom_test, &d))
- return FALSE;
-
- /* Check for removed service file */
- if (!test_remove_service_file (dir, SERVICE_FILE_2))
- return FALSE;
-
- d.expecting_find = FALSE;
- d.service_name = SERVICE_FILE_2;
-
- if (!do_test ("Removed service file", oom_test, &d))
- return FALSE;
-
- /* Check for updated service file */
-
- _dbus_sleep_milliseconds (1000); /* Sleep a second to make sure the mtime is updated */
-
- if (!test_create_service_file (dir, SERVICE_FILE_1, SERVICE_NAME_3, "exec-3"))
- return FALSE;
-
- d.expecting_find = TRUE;
- d.service_name = SERVICE_NAME_3;
-
- if (!do_test ("Updated service file, part 1", oom_test, &d))
- return FALSE;
-
- d.expecting_find = FALSE;
- d.service_name = SERVICE_NAME_1;
-
- if (!do_test ("Updated service file, part 2", oom_test, &d))
- return FALSE;
-
- bus_activation_unref (activation);
- _dbus_list_clear (&directories);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_activation_service_reload_test (const DBusString *test_data_dir)
-{
- DBusString directory;
- const char *tmp;
-
- if (!_dbus_string_init (&directory))
- return FALSE;
-
- tmp = _dbus_get_tmpdir ();
-
- if (tmp == NULL)
- return FALSE;
-
- if (!_dbus_string_append (&directory, tmp))
- return FALSE;
-
- if (!_dbus_string_append (&directory, "/dbus-reload-test-") ||
- !_dbus_generate_random_ascii (&directory, 6))
- {
- return FALSE;
- }
-
- /* Do normal tests */
- if (!init_service_reload_test (&directory))
- _dbus_assert_not_reached ("could not initiate service reload test");
-
- if (!do_service_reload_test (&directory, FALSE))
- {
- /* Do nothing? */
- }
-
- /* Do OOM tests */
- if (!init_service_reload_test (&directory))
- _dbus_assert_not_reached ("could not initiate service reload test");
-
- if (!do_service_reload_test (&directory, TRUE))
- {
- /* Do nothing? */
- }
-
- /* Cleanup test directory */
- if (!cleanup_service_reload_test (&directory))
- return FALSE;
-
- _dbus_string_free (&directory);
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/bus/activation.h b/src/3rd_party/dbus-1.7.8/bus/activation.h
deleted file mode 100644
index 97f25b1ffb..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/activation.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* activation.h Activation of services
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_ACTIVATION_H
-#define BUS_ACTIVATION_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-list.h>
-#include "bus.h"
-
-BusActivation* bus_activation_new (BusContext *context,
- const DBusString *address,
- DBusList **directories,
- DBusError *error);
-dbus_bool_t bus_activation_reload (BusActivation *activation,
- const DBusString *address,
- DBusList **directories,
- DBusError *error);
-BusActivation* bus_activation_ref (BusActivation *activation);
-void bus_activation_unref (BusActivation *activation);
-
-dbus_bool_t bus_activation_set_environment_variable (BusActivation *activation,
- const char *key,
- const char *value,
- DBusError *error);
-dbus_bool_t bus_activation_activate_service (BusActivation *activation,
- DBusConnection *connection,
- BusTransaction *transaction,
- dbus_bool_t auto_activation,
- DBusMessage *activation_message,
- const char *service_name,
- DBusError *error);
-dbus_bool_t bus_activation_service_created (BusActivation *activation,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_activation_list_services (BusActivation *registry,
- char ***listp,
- int *array_len);
-dbus_bool_t dbus_activation_systemd_failure (BusActivation *activation,
- DBusMessage *message);
-
-dbus_bool_t bus_activation_send_pending_auto_activation_messages (BusActivation *activation,
- BusService *service,
- BusTransaction *transaction,
- DBusError *error);
-
-
-#endif /* BUS_ACTIVATION_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/bus.c b/src/3rd_party/dbus-1.7.8/bus/bus.c
deleted file mode 100644
index 307c158612..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/bus.c
+++ /dev/null
@@ -1,1648 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* bus.c message bus context object
- *
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "bus.h"
-
-#include <stdio.h>
-
-#include "activation.h"
-#include "connection.h"
-#include "services.h"
-#include "utils.h"
-#include "policy.h"
-#include "config-parser.h"
-#include "signals.h"
-#include "selinux.h"
-#include "dir-watch.h"
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-credentials.h>
-#include <dbus/dbus-internals.h>
-
-#ifdef DBUS_CYGWIN
-#include <signal.h>
-#endif
-
-struct BusContext
-{
- int refcount;
- DBusGUID uuid;
- char *config_file;
- char *type;
- char *servicehelper;
- char *address;
- char *pidfile;
- char *user;
- char *log_prefix;
- DBusLoop *loop;
- DBusList *servers;
- BusConnections *connections;
- BusActivation *activation;
- BusRegistry *registry;
- BusPolicy *policy;
- BusMatchmaker *matchmaker;
- BusLimits limits;
- unsigned int fork : 1;
- unsigned int syslog : 1;
- unsigned int keep_umask : 1;
- unsigned int allow_anonymous : 1;
- unsigned int systemd_activation : 1;
-};
-
-static dbus_int32_t server_data_slot = -1;
-
-typedef struct
-{
- BusContext *context;
-} BusServerData;
-
-#define BUS_SERVER_DATA(server) (dbus_server_get_data ((server), server_data_slot))
-
-static BusContext*
-server_get_context (DBusServer *server)
-{
- BusContext *context;
- BusServerData *bd;
-
- if (!dbus_server_allocate_data_slot (&server_data_slot))
- return NULL;
-
- bd = BUS_SERVER_DATA (server);
- if (bd == NULL)
- {
- dbus_server_free_data_slot (&server_data_slot);
- return NULL;
- }
-
- context = bd->context;
-
- dbus_server_free_data_slot (&server_data_slot);
-
- return context;
-}
-
-static dbus_bool_t
-add_server_watch (DBusWatch *watch,
- void *data)
-{
- DBusServer *server = data;
- BusContext *context;
-
- context = server_get_context (server);
-
- return _dbus_loop_add_watch (context->loop, watch);
-}
-
-static void
-remove_server_watch (DBusWatch *watch,
- void *data)
-{
- DBusServer *server = data;
- BusContext *context;
-
- context = server_get_context (server);
-
- _dbus_loop_remove_watch (context->loop, watch);
-}
-
-static void
-toggle_server_watch (DBusWatch *watch,
- void *data)
-{
- DBusServer *server = data;
- BusContext *context;
-
- context = server_get_context (server);
-
- _dbus_loop_toggle_watch (context->loop, watch);
-}
-
-static dbus_bool_t
-add_server_timeout (DBusTimeout *timeout,
- void *data)
-{
- DBusServer *server = data;
- BusContext *context;
-
- context = server_get_context (server);
-
- return _dbus_loop_add_timeout (context->loop, timeout);
-}
-
-static void
-remove_server_timeout (DBusTimeout *timeout,
- void *data)
-{
- DBusServer *server = data;
- BusContext *context;
-
- context = server_get_context (server);
-
- _dbus_loop_remove_timeout (context->loop, timeout);
-}
-
-static void
-new_connection_callback (DBusServer *server,
- DBusConnection *new_connection,
- void *data)
-{
- BusContext *context = data;
-
- if (!bus_connections_setup_connection (context->connections, new_connection))
- {
- _dbus_verbose ("No memory to setup new connection\n");
-
- /* if we don't do this, it will get unref'd without
- * being disconnected... kind of strange really
- * that we have to do this, people won't get it right
- * in general.
- */
- dbus_connection_close (new_connection);
- }
-
- dbus_connection_set_max_received_size (new_connection,
- context->limits.max_incoming_bytes);
-
- dbus_connection_set_max_message_size (new_connection,
- context->limits.max_message_size);
-
- dbus_connection_set_max_received_unix_fds (new_connection,
- context->limits.max_incoming_unix_fds);
-
- dbus_connection_set_max_message_unix_fds (new_connection,
- context->limits.max_message_unix_fds);
-
- dbus_connection_set_allow_anonymous (new_connection,
- context->allow_anonymous);
-
- /* on OOM, we won't have ref'd the connection so it will die. */
-}
-
-static void
-free_server_data (void *data)
-{
- BusServerData *bd = data;
-
- dbus_free (bd);
-}
-
-static dbus_bool_t
-setup_server (BusContext *context,
- DBusServer *server,
- char **auth_mechanisms,
- DBusError *error)
-{
- BusServerData *bd;
-
- bd = dbus_new0 (BusServerData, 1);
- if (bd == NULL || !dbus_server_set_data (server,
- server_data_slot,
- bd, free_server_data))
- {
- dbus_free (bd);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- bd->context = context;
-
- if (!dbus_server_set_auth_mechanisms (server, (const char**) auth_mechanisms))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- dbus_server_set_new_connection_function (server,
- new_connection_callback,
- context, NULL);
-
- if (!dbus_server_set_watch_functions (server,
- add_server_watch,
- remove_server_watch,
- toggle_server_watch,
- server,
- NULL))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_server_set_timeout_functions (server,
- add_server_timeout,
- remove_server_timeout,
- NULL,
- server, NULL))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* This code only gets executed the first time the
- * config files are parsed. It is not executed
- * when config files are reloaded.
- */
-static dbus_bool_t
-process_config_first_time_only (BusContext *context,
- BusConfigParser *parser,
- const DBusString *address,
- BusContextFlags flags,
- DBusError *error)
-{
- DBusString log_prefix;
- DBusList *link;
- DBusList **addresses;
- const char *user, *pidfile;
- char **auth_mechanisms;
- DBusList **auth_mechanisms_list;
- int len;
- dbus_bool_t retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- retval = FALSE;
- auth_mechanisms = NULL;
- pidfile = NULL;
-
- _dbus_init_system_log (TRUE);
-
- if (flags & BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION)
- context->systemd_activation = TRUE;
- else
- context->systemd_activation = FALSE;
-
- /* Check for an existing pid file. Of course this is a race;
- * we'd have to use fcntl() locks on the pid file to
- * avoid that. But we want to check for the pid file
- * before overwriting any existing sockets, etc.
- */
-
- if (flags & BUS_CONTEXT_FLAG_WRITE_PID_FILE)
- pidfile = bus_config_parser_get_pidfile (parser);
-
- if (pidfile != NULL)
- {
- DBusString u;
- DBusStat stbuf;
-
- _dbus_string_init_const (&u, pidfile);
-
- if (_dbus_stat (&u, &stbuf, NULL))
- {
-#ifdef DBUS_CYGWIN
- DBusString p;
- long /* int */ pid;
-
- _dbus_string_init (&p);
- _dbus_file_get_contents(&p, &u, NULL);
- _dbus_string_parse_int(&p, 0, &pid, NULL);
- _dbus_string_free(&p);
-
- if ((kill((int)pid, 0))) {
- dbus_set_error(NULL, DBUS_ERROR_FILE_EXISTS,
- "pid %ld not running, removing stale pid file\n",
- pid);
- _dbus_delete_file(&u, NULL);
- } else {
-#endif
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "The pid file \"%s\" exists, if the message bus is not running, remove this file",
- pidfile);
- goto failed;
-#ifdef DBUS_CYGWIN
- }
-#endif
- }
- }
-
- /* keep around the pid filename so we can delete it later */
- context->pidfile = _dbus_strdup (pidfile);
-
- /* note that type may be NULL */
- context->type = _dbus_strdup (bus_config_parser_get_type (parser));
- if (bus_config_parser_get_type (parser) != NULL && context->type == NULL)
- goto oom;
-
- user = bus_config_parser_get_user (parser);
- if (user != NULL)
- {
- context->user = _dbus_strdup (user);
- if (context->user == NULL)
- goto oom;
- }
-
- /* Set up the prefix for syslog messages */
- if (!_dbus_string_init (&log_prefix))
- goto oom;
- if (context->type && !strcmp (context->type, "system"))
- {
- if (!_dbus_string_append (&log_prefix, "[system] "))
- goto oom;
- }
- else if (context->type && !strcmp (context->type, "session"))
- {
- DBusCredentials *credentials;
-
- credentials = _dbus_credentials_new_from_current_process ();
- if (!credentials)
- goto oom;
- if (!_dbus_string_append (&log_prefix, "[session "))
- {
- _dbus_credentials_unref (credentials);
- goto oom;
- }
- if (!_dbus_credentials_to_string_append (credentials, &log_prefix))
- {
- _dbus_credentials_unref (credentials);
- goto oom;
- }
- if (!_dbus_string_append (&log_prefix, "] "))
- {
- _dbus_credentials_unref (credentials);
- goto oom;
- }
- _dbus_credentials_unref (credentials);
- }
- if (!_dbus_string_steal_data (&log_prefix, &context->log_prefix))
- goto oom;
- _dbus_string_free (&log_prefix);
-
- /* Build an array of auth mechanisms */
-
- auth_mechanisms_list = bus_config_parser_get_mechanisms (parser);
- len = _dbus_list_get_length (auth_mechanisms_list);
-
- if (len > 0)
- {
- int i;
-
- auth_mechanisms = dbus_new0 (char*, len + 1);
- if (auth_mechanisms == NULL)
- goto oom;
-
- i = 0;
- link = _dbus_list_get_first_link (auth_mechanisms_list);
- while (link != NULL)
- {
- auth_mechanisms[i] = _dbus_strdup (link->data);
- if (auth_mechanisms[i] == NULL)
- goto oom;
- link = _dbus_list_get_next_link (auth_mechanisms_list, link);
- i += 1;
- }
- }
- else
- {
- auth_mechanisms = NULL;
- }
-
- /* Listen on our addresses */
-
- if (address)
- {
- DBusServer *server;
-
- server = dbus_server_listen (_dbus_string_get_const_data(address), error);
- if (server == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- else if (!setup_server (context, server, auth_mechanisms, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- if (!_dbus_list_append (&context->servers, server))
- goto oom;
- }
- else
- {
- addresses = bus_config_parser_get_addresses (parser);
-
- link = _dbus_list_get_first_link (addresses);
- while (link != NULL)
- {
- DBusServer *server;
-
- server = dbus_server_listen (link->data, error);
- if (server == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- else if (!setup_server (context, server, auth_mechanisms, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- if (!_dbus_list_append (&context->servers, server))
- goto oom;
-
- link = _dbus_list_get_next_link (addresses, link);
- }
- }
-
- context->fork = bus_config_parser_get_fork (parser);
- context->syslog = bus_config_parser_get_syslog (parser);
- context->keep_umask = bus_config_parser_get_keep_umask (parser);
- context->allow_anonymous = bus_config_parser_get_allow_anonymous (parser);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- retval = TRUE;
-
- failed:
- dbus_free_string_array (auth_mechanisms);
- return retval;
-
- oom:
- BUS_SET_OOM (error);
- dbus_free_string_array (auth_mechanisms);
- return FALSE;
-}
-
-/* This code gets executed every time the config files
- * are parsed: both during BusContext construction
- * and on reloads. This function is slightly screwy
- * since it can do a "half reload" in out-of-memory
- * situations. Realistically, unlikely to ever matter.
- */
-static dbus_bool_t
-process_config_every_time (BusContext *context,
- BusConfigParser *parser,
- dbus_bool_t is_reload,
- DBusError *error)
-{
- DBusString full_address;
- DBusList *link;
- DBusList **dirs;
- char *addr;
- const char *servicehelper;
- char *s;
-
- dbus_bool_t retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- addr = NULL;
- retval = FALSE;
-
- if (!_dbus_string_init (&full_address))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* get our limits and timeout lengths */
- bus_config_parser_get_limits (parser, &context->limits);
-
- if (context->policy)
- bus_policy_unref (context->policy);
- context->policy = bus_config_parser_steal_policy (parser);
- _dbus_assert (context->policy != NULL);
-
- /* We have to build the address backward, so that
- * <listen> later in the config file have priority
- */
- link = _dbus_list_get_last_link (&context->servers);
- while (link != NULL)
- {
- addr = dbus_server_get_address (link->data);
- if (addr == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (_dbus_string_get_length (&full_address) > 0)
- {
- if (!_dbus_string_append (&full_address, ";"))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
-
- if (!_dbus_string_append (&full_address, addr))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- dbus_free (addr);
- addr = NULL;
-
- link = _dbus_list_get_prev_link (&context->servers, link);
- }
-
- if (is_reload)
- dbus_free (context->address);
-
- if (!_dbus_string_copy_data (&full_address, &context->address))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- /* get the service directories */
- dirs = bus_config_parser_get_service_dirs (parser);
-
- /* and the service helper */
- servicehelper = bus_config_parser_get_servicehelper (parser);
-
- s = _dbus_strdup(servicehelper);
- if (s == NULL && servicehelper != NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- else
- {
- dbus_free(context->servicehelper);
- context->servicehelper = s;
- }
-
- /* Create activation subsystem */
- if (context->activation)
- {
- if (!bus_activation_reload (context->activation, &full_address, dirs, error))
- goto failed;
- }
- else
- {
- context->activation = bus_activation_new (context, &full_address, dirs, error);
- }
-
- if (context->activation == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- retval = TRUE;
-
- failed:
- _dbus_string_free (&full_address);
-
- if (addr)
- dbus_free (addr);
-
- return retval;
-}
-
-static dbus_bool_t
-list_concat_new (DBusList **a,
- DBusList **b,
- DBusList **result)
-{
- DBusList *link;
-
- *result = NULL;
-
- for (link = _dbus_list_get_first_link (a); link; link = _dbus_list_get_next_link (a, link))
- {
- if (!_dbus_list_append (result, link->data))
- goto oom;
- }
- for (link = _dbus_list_get_first_link (b); link; link = _dbus_list_get_next_link (b, link))
- {
- if (!_dbus_list_append (result, link->data))
- goto oom;
- }
-
- return TRUE;
-oom:
- _dbus_list_clear (result);
- return FALSE;
-}
-
-static void
-raise_file_descriptor_limit (BusContext *context)
-{
-
- /* I just picked this out of thin air; we need some extra
- * descriptors for things like any internal pipes we create,
- * inotify, connections to SELinux, etc.
- */
- unsigned int arbitrary_extra_fds = 32;
- unsigned int limit;
-
- limit = context->limits.max_completed_connections +
- context->limits.max_incomplete_connections
- + arbitrary_extra_fds;
-
- _dbus_request_file_descriptor_limit (limit);
-}
-
-static dbus_bool_t
-process_config_postinit (BusContext *context,
- BusConfigParser *parser,
- DBusError *error)
-{
- DBusHashTable *service_context_table;
- DBusList *watched_dirs = NULL;
-
- raise_file_descriptor_limit (context);
-
- service_context_table = bus_config_parser_steal_service_context_table (parser);
- if (!bus_registry_set_service_context_table (context->registry,
- service_context_table))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- _dbus_hash_table_unref (service_context_table);
-
- /* We need to monitor both the configuration directories and directories
- * containing .service files.
- */
- if (!list_concat_new (bus_config_parser_get_conf_dirs (parser),
- bus_config_parser_get_service_dirs (parser),
- &watched_dirs))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- bus_set_watched_dirs (context, &watched_dirs);
-
- _dbus_list_clear (&watched_dirs);
-
- return TRUE;
-}
-
-BusContext*
-bus_context_new (const DBusString *config_file,
- BusContextFlags flags,
- DBusPipe *print_addr_pipe,
- DBusPipe *print_pid_pipe,
- const DBusString *address,
- DBusError *error)
-{
- BusContext *context;
- BusConfigParser *parser;
-
- _dbus_assert ((flags & BUS_CONTEXT_FLAG_FORK_NEVER) == 0 ||
- (flags & BUS_CONTEXT_FLAG_FORK_ALWAYS) == 0);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- context = NULL;
- parser = NULL;
-
- if (!dbus_server_allocate_data_slot (&server_data_slot))
- {
- BUS_SET_OOM (error);
- return NULL;
- }
-
- context = dbus_new0 (BusContext, 1);
- if (context == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- context->refcount = 1;
-
- _dbus_generate_uuid (&context->uuid);
-
- if (!_dbus_string_copy_data (config_file, &context->config_file))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- context->loop = _dbus_loop_new ();
- if (context->loop == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- context->registry = bus_registry_new (context);
- if (context->registry == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- parser = bus_config_load (config_file, TRUE, NULL, error);
- if (parser == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- if (!process_config_first_time_only (context, parser, address, flags, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- if (!process_config_every_time (context, parser, FALSE, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- /* we need another ref of the server data slot for the context
- * to own
- */
- if (!dbus_server_allocate_data_slot (&server_data_slot))
- _dbus_assert_not_reached ("second ref of server data slot failed");
-
- /* Note that we don't know whether the print_addr_pipe is
- * one of the sockets we're using to listen on, or some
- * other random thing. But I think the answer is "don't do
- * that then"
- */
- if (print_addr_pipe != NULL && _dbus_pipe_is_valid (print_addr_pipe))
- {
- DBusString addr;
- const char *a = bus_context_get_address (context);
- int bytes;
-
- _dbus_assert (a != NULL);
- if (!_dbus_string_init (&addr))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!_dbus_string_append (&addr, a) ||
- !_dbus_string_append (&addr, "\n"))
- {
- _dbus_string_free (&addr);
- BUS_SET_OOM (error);
- goto failed;
- }
-
- bytes = _dbus_string_get_length (&addr);
- if (_dbus_pipe_write (print_addr_pipe, &addr, 0, bytes, error) != bytes)
- {
- /* pipe write returns an error on failure but not short write */
- if (error != NULL && !dbus_error_is_set (error))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Printing message bus address: did not write all bytes\n");
- }
- _dbus_string_free (&addr);
- goto failed;
- }
-
- if (!_dbus_pipe_is_stdout_or_stderr (print_addr_pipe))
- _dbus_pipe_close (print_addr_pipe, NULL);
-
- _dbus_string_free (&addr);
- }
-
- context->connections = bus_connections_new (context);
- if (context->connections == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- context->matchmaker = bus_matchmaker_new ();
- if (context->matchmaker == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- /* check user before we fork */
- if (context->user != NULL)
- {
- if (!_dbus_verify_daemon_user (context->user))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Could not get UID and GID for username \"%s\"",
- context->user);
- goto failed;
- }
- }
-
- /* Now become a daemon if appropriate and write out pid file in any case */
- {
- DBusString u;
-
- if (context->pidfile)
- _dbus_string_init_const (&u, context->pidfile);
-
- if (((flags & BUS_CONTEXT_FLAG_FORK_NEVER) == 0 && context->fork) ||
- (flags & BUS_CONTEXT_FLAG_FORK_ALWAYS))
- {
- _dbus_verbose ("Forking and becoming daemon\n");
-
- if (!_dbus_become_daemon (context->pidfile ? &u : NULL,
- print_pid_pipe,
- error,
- context->keep_umask))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- }
- else
- {
- _dbus_verbose ("Fork not requested\n");
-
- /* Need to write PID file and to PID pipe for ourselves,
- * not for the child process. This is a no-op if the pidfile
- * is NULL and print_pid_pipe is NULL.
- */
- if (!_dbus_write_pid_to_file_and_pipe (context->pidfile ? &u : NULL,
- print_pid_pipe,
- _dbus_getpid (),
- error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- }
- }
-
- if (print_pid_pipe && _dbus_pipe_is_valid (print_pid_pipe) &&
- !_dbus_pipe_is_stdout_or_stderr (print_pid_pipe))
- _dbus_pipe_close (print_pid_pipe, NULL);
-
- if (!bus_selinux_full_init ())
- {
- bus_context_log (context, DBUS_SYSTEM_LOG_FATAL, "SELinux enabled but AVC initialization failed; check system log\n");
- }
-
- if (!process_config_postinit (context, parser, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- if (parser != NULL)
- {
- bus_config_parser_unref (parser);
- parser = NULL;
- }
-
- /* Here we change our credentials if required,
- * as soon as we've set up our sockets and pidfile
- */
- if (context->user != NULL)
- {
- if (!_dbus_change_to_daemon_user (context->user, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
-#ifdef HAVE_SELINUX
- /* FIXME - why not just put this in full_init() below? */
- bus_selinux_audit_init ();
-#endif
- }
-
- dbus_server_free_data_slot (&server_data_slot);
-
- return context;
-
- failed:
- if (parser != NULL)
- bus_config_parser_unref (parser);
- if (context != NULL)
- bus_context_unref (context);
-
- if (server_data_slot >= 0)
- dbus_server_free_data_slot (&server_data_slot);
-
- return NULL;
-}
-
-dbus_bool_t
-bus_context_get_id (BusContext *context,
- DBusString *uuid)
-{
- return _dbus_uuid_encode (&context->uuid, uuid);
-}
-
-dbus_bool_t
-bus_context_reload_config (BusContext *context,
- DBusError *error)
-{
- BusConfigParser *parser;
- DBusString config_file;
- dbus_bool_t ret;
-
- /* Flush the user database cache */
- _dbus_flush_caches ();
-
- ret = FALSE;
- _dbus_string_init_const (&config_file, context->config_file);
- parser = bus_config_load (&config_file, TRUE, NULL, error);
- if (parser == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- if (!process_config_every_time (context, parser, TRUE, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- if (!process_config_postinit (context, parser, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
- ret = TRUE;
-
- bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Reloaded configuration");
- failed:
- if (!ret)
- bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Unable to reload configuration: %s", error->message);
- if (parser != NULL)
- bus_config_parser_unref (parser);
- return ret;
-}
-
-static void
-shutdown_server (BusContext *context,
- DBusServer *server)
-{
- if (server == NULL ||
- !dbus_server_get_is_connected (server))
- return;
-
- if (!dbus_server_set_watch_functions (server,
- NULL, NULL, NULL,
- context,
- NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
-
- if (!dbus_server_set_timeout_functions (server,
- NULL, NULL, NULL,
- context,
- NULL))
- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
-
- dbus_server_disconnect (server);
-}
-
-void
-bus_context_shutdown (BusContext *context)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&context->servers);
- while (link != NULL)
- {
- shutdown_server (context, link->data);
-
- link = _dbus_list_get_next_link (&context->servers, link);
- }
-}
-
-BusContext *
-bus_context_ref (BusContext *context)
-{
- _dbus_assert (context->refcount > 0);
- context->refcount += 1;
-
- return context;
-}
-
-void
-bus_context_unref (BusContext *context)
-{
- _dbus_assert (context->refcount > 0);
- context->refcount -= 1;
-
- if (context->refcount == 0)
- {
- DBusList *link;
-
- _dbus_verbose ("Finalizing bus context %p\n", context);
-
- bus_context_shutdown (context);
-
- if (context->connections)
- {
- bus_connections_unref (context->connections);
- context->connections = NULL;
- }
-
- if (context->registry)
- {
- bus_registry_unref (context->registry);
- context->registry = NULL;
- }
-
- if (context->activation)
- {
- bus_activation_unref (context->activation);
- context->activation = NULL;
- }
-
- link = _dbus_list_get_first_link (&context->servers);
- while (link != NULL)
- {
- dbus_server_unref (link->data);
-
- link = _dbus_list_get_next_link (&context->servers, link);
- }
- _dbus_list_clear (&context->servers);
-
- if (context->policy)
- {
- bus_policy_unref (context->policy);
- context->policy = NULL;
- }
-
- if (context->loop)
- {
- _dbus_loop_unref (context->loop);
- context->loop = NULL;
- }
-
- if (context->matchmaker)
- {
- bus_matchmaker_unref (context->matchmaker);
- context->matchmaker = NULL;
- }
-
- dbus_free (context->config_file);
- dbus_free (context->log_prefix);
- dbus_free (context->type);
- dbus_free (context->address);
- dbus_free (context->user);
- dbus_free (context->servicehelper);
-
- if (context->pidfile)
- {
- DBusString u;
- _dbus_string_init_const (&u, context->pidfile);
-
- /* Deliberately ignore errors here, since there's not much
- * we can do about it, and we're exiting anyways.
- */
- _dbus_delete_file (&u, NULL);
-
- dbus_free (context->pidfile);
- }
- dbus_free (context);
-
- dbus_server_free_data_slot (&server_data_slot);
- }
-}
-
-/* type may be NULL */
-const char*
-bus_context_get_type (BusContext *context)
-{
- return context->type;
-}
-
-const char*
-bus_context_get_address (BusContext *context)
-{
- return context->address;
-}
-
-const char*
-bus_context_get_servicehelper (BusContext *context)
-{
- return context->servicehelper;
-}
-
-dbus_bool_t
-bus_context_get_systemd_activation (BusContext *context)
-{
- return context->systemd_activation;
-}
-
-BusRegistry*
-bus_context_get_registry (BusContext *context)
-{
- return context->registry;
-}
-
-BusConnections*
-bus_context_get_connections (BusContext *context)
-{
- return context->connections;
-}
-
-BusActivation*
-bus_context_get_activation (BusContext *context)
-{
- return context->activation;
-}
-
-BusMatchmaker*
-bus_context_get_matchmaker (BusContext *context)
-{
- return context->matchmaker;
-}
-
-DBusLoop*
-bus_context_get_loop (BusContext *context)
-{
- return context->loop;
-}
-
-dbus_bool_t
-bus_context_allow_unix_user (BusContext *context,
- unsigned long uid)
-{
- return bus_policy_allow_unix_user (context->policy,
- uid);
-}
-
-/* For now this is never actually called because the default
- * DBusConnection behavior of 'same user that owns the bus can connect'
- * is all it would do.
- */
-dbus_bool_t
-bus_context_allow_windows_user (BusContext *context,
- const char *windows_sid)
-{
- return bus_policy_allow_windows_user (context->policy,
- windows_sid);
-}
-
-BusPolicy *
-bus_context_get_policy (BusContext *context)
-{
- return context->policy;
-}
-
-BusClientPolicy*
-bus_context_create_client_policy (BusContext *context,
- DBusConnection *connection,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return bus_policy_create_client_policy (context->policy, connection,
- error);
-}
-
-int
-bus_context_get_activation_timeout (BusContext *context)
-{
-
- return context->limits.activation_timeout;
-}
-
-int
-bus_context_get_auth_timeout (BusContext *context)
-{
- return context->limits.auth_timeout;
-}
-
-int
-bus_context_get_max_completed_connections (BusContext *context)
-{
- return context->limits.max_completed_connections;
-}
-
-int
-bus_context_get_max_incomplete_connections (BusContext *context)
-{
- return context->limits.max_incomplete_connections;
-}
-
-int
-bus_context_get_max_connections_per_user (BusContext *context)
-{
- return context->limits.max_connections_per_user;
-}
-
-int
-bus_context_get_max_pending_activations (BusContext *context)
-{
- return context->limits.max_pending_activations;
-}
-
-int
-bus_context_get_max_services_per_connection (BusContext *context)
-{
- return context->limits.max_services_per_connection;
-}
-
-int
-bus_context_get_max_match_rules_per_connection (BusContext *context)
-{
- return context->limits.max_match_rules_per_connection;
-}
-
-int
-bus_context_get_max_replies_per_connection (BusContext *context)
-{
- return context->limits.max_replies_per_connection;
-}
-
-int
-bus_context_get_reply_timeout (BusContext *context)
-{
- return context->limits.reply_timeout;
-}
-
-void
-bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (3, 4);
-
-void
-bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...)
-{
- va_list args;
-
- if (!context->syslog)
- {
- /* we're not syslogging; just output to stderr */
- va_start (args, msg);
- vfprintf (stderr, msg, args);
- fprintf (stderr, "\n");
- va_end (args);
- return;
- }
-
- va_start (args, msg);
-
- if (context->log_prefix)
- {
- DBusString full_msg;
-
- if (!_dbus_string_init (&full_msg))
- goto out;
- if (!_dbus_string_append (&full_msg, context->log_prefix))
- goto oom_out;
- if (!_dbus_string_append_printf_valist (&full_msg, msg, args))
- goto oom_out;
-
- _dbus_system_log (severity, "%s", _dbus_string_get_const_data (&full_msg));
- oom_out:
- _dbus_string_free (&full_msg);
- }
- else
- _dbus_system_logv (severity, msg, args);
-
-out:
- va_end (args);
-}
-
-static inline const char *
-nonnull (const char *maybe_null,
- const char *if_null)
-{
- return (maybe_null ? maybe_null : if_null);
-}
-
-/*
- * Log something about a message, usually that it was rejected.
- */
-static void
-complain_about_message (BusContext *context,
- const char *error_name,
- const char *complaint,
- int matched_rules,
- DBusMessage *message,
- DBusConnection *sender,
- DBusConnection *proposed_recipient,
- dbus_bool_t requested_reply,
- dbus_bool_t log,
- DBusError *error)
-{
- DBusError stack_error = DBUS_ERROR_INIT;
- const char *sender_name;
- const char *sender_loginfo;
- const char *proposed_recipient_loginfo;
-
- if (error == NULL && !log)
- return;
-
- if (sender != NULL)
- {
- sender_name = bus_connection_get_name (sender);
- sender_loginfo = bus_connection_get_loginfo (sender);
- }
- else
- {
- sender_name = "(unset)";
- sender_loginfo = "(bus)";
- }
-
- if (proposed_recipient != NULL)
- proposed_recipient_loginfo = bus_connection_get_loginfo (proposed_recipient);
- else
- proposed_recipient_loginfo = "bus";
-
- dbus_set_error (&stack_error, error_name,
- "%s, %d matched rules; type=\"%s\", sender=\"%s\" (%s) "
- "interface=\"%s\" member=\"%s\" error name=\"%s\" "
- "requested_reply=\"%d\" destination=\"%s\" (%s)",
- complaint,
- matched_rules,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name,
- sender_loginfo,
- nonnull (dbus_message_get_interface (message), "(unset)"),
- nonnull (dbus_message_get_member (message), "(unset)"),
- nonnull (dbus_message_get_error_name (message), "(unset)"),
- requested_reply,
- nonnull (dbus_message_get_destination (message), DBUS_SERVICE_DBUS),
- proposed_recipient_loginfo);
-
- /* If we hit OOM while setting the error, this will syslog "out of memory"
- * which is itself an indication that something is seriously wrong */
- if (log)
- bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY, "%s",
- stack_error.message);
-
- dbus_move_error (&stack_error, error);
-}
-
-/*
- * addressed_recipient is the recipient specified in the message.
- *
- * proposed_recipient is the recipient we're considering sending
- * to right this second, and may be an eavesdropper.
- *
- * sender is the sender of the message.
- *
- * NULL for proposed_recipient or sender definitely means the bus driver.
- *
- * NULL for addressed_recipient may mean the bus driver, or may mean
- * no destination was specified in the message (e.g. a signal).
- */
-dbus_bool_t
-bus_context_check_security_policy (BusContext *context,
- BusTransaction *transaction,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusConnection *proposed_recipient,
- DBusMessage *message,
- DBusError *error)
-{
- const char *dest;
- BusClientPolicy *sender_policy;
- BusClientPolicy *recipient_policy;
- dbus_int32_t toggles;
- dbus_bool_t log;
- int type;
- dbus_bool_t requested_reply;
-
- type = dbus_message_get_type (message);
- dest = dbus_message_get_destination (message);
-
- /* dispatch.c was supposed to ensure these invariants */
- _dbus_assert (dest != NULL ||
- type == DBUS_MESSAGE_TYPE_SIGNAL ||
- (sender == NULL && !bus_connection_is_active (proposed_recipient)));
- _dbus_assert (type == DBUS_MESSAGE_TYPE_SIGNAL ||
- addressed_recipient != NULL ||
- strcmp (dest, DBUS_SERVICE_DBUS) == 0);
-
- switch (type)
- {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- case DBUS_MESSAGE_TYPE_SIGNAL:
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- case DBUS_MESSAGE_TYPE_ERROR:
- break;
-
- default:
- _dbus_verbose ("security check disallowing message of unknown type %d\n",
- type);
-
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "Message bus will not accept messages of unknown type\n");
-
- return FALSE;
- }
-
- requested_reply = FALSE;
-
- if (sender != NULL)
- {
- /* First verify the SELinux access controls. If allowed then
- * go on with the standard checks.
- */
- if (!bus_selinux_allows_send (sender, proposed_recipient,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_interface (message),
- dbus_message_get_member (message),
- dbus_message_get_error_name (message),
- dest ? dest : DBUS_SERVICE_DBUS, error))
- {
- if (error != NULL && !dbus_error_is_set (error))
- {
- /* don't syslog this, just set the error: avc_has_perm should
- * have already written to either the audit log or syslog */
- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
- "An SELinux policy prevents this sender from sending this "
- "message to this recipient",
- 0, message, sender, proposed_recipient, FALSE, FALSE, error);
- _dbus_verbose ("SELinux security check denying send to service\n");
- }
-
- return FALSE;
- }
-
- if (bus_connection_is_active (sender))
- {
- sender_policy = bus_connection_get_policy (sender);
- _dbus_assert (sender_policy != NULL);
-
- /* Fill in requested_reply variable with TRUE if this is a
- * reply and the reply was pending.
- */
- if (dbus_message_get_reply_serial (message) != 0)
- {
- if (proposed_recipient != NULL /* not to the bus driver */ &&
- addressed_recipient == proposed_recipient /* not eavesdropping */)
- {
- DBusError error2;
-
- dbus_error_init (&error2);
- requested_reply = bus_connections_check_reply (bus_connection_get_connections (sender),
- transaction,
- sender, addressed_recipient, message,
- &error2);
- if (dbus_error_is_set (&error2))
- {
- dbus_move_error (&error2, error);
- return FALSE;
- }
- }
- }
- }
- else
- {
- /* Policy for inactive connections is that they can only send
- * the hello message to the bus driver
- */
- if (proposed_recipient == NULL &&
- dbus_message_is_method_call (message,
- DBUS_INTERFACE_DBUS,
- "Hello"))
- {
- _dbus_verbose ("security check allowing %s message\n",
- "Hello");
- return TRUE;
- }
- else
- {
- _dbus_verbose ("security check disallowing non-%s message\n",
- "Hello");
-
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "Client tried to send a message other than %s without being registered",
- "Hello");
-
- return FALSE;
- }
- }
- }
- else
- {
- sender_policy = NULL;
-
- /* If the sender is the bus driver, we assume any reply was a
- * requested reply as bus driver won't send bogus ones
- */
- if (addressed_recipient == proposed_recipient /* not eavesdropping */ &&
- dbus_message_get_reply_serial (message) != 0)
- requested_reply = TRUE;
- }
-
- _dbus_assert ((sender != NULL && sender_policy != NULL) ||
- (sender == NULL && sender_policy == NULL));
-
- if (proposed_recipient != NULL)
- {
- /* only the bus driver can send to an inactive recipient (as it
- * owns no services, so other apps can't address it). Inactive
- * recipients can receive any message.
- */
- if (bus_connection_is_active (proposed_recipient))
- {
- recipient_policy = bus_connection_get_policy (proposed_recipient);
- _dbus_assert (recipient_policy != NULL);
- }
- else if (sender == NULL)
- {
- _dbus_verbose ("security check using NULL recipient policy for message from bus\n");
- recipient_policy = NULL;
- }
- else
- {
- _dbus_assert_not_reached ("a message was somehow sent to an inactive recipient from a source other than the message bus\n");
- recipient_policy = NULL;
- }
- }
- else
- recipient_policy = NULL;
-
- _dbus_assert ((proposed_recipient != NULL && recipient_policy != NULL) ||
- (proposed_recipient != NULL && sender == NULL && recipient_policy == NULL) ||
- (proposed_recipient == NULL && recipient_policy == NULL));
-
- log = FALSE;
- if (sender_policy &&
- !bus_client_policy_check_can_send (sender_policy,
- context->registry,
- requested_reply,
- proposed_recipient,
- message, &toggles, &log))
- {
- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
- "Rejected send message", toggles,
- message, sender, proposed_recipient, requested_reply,
- (addressed_recipient == proposed_recipient), error);
- _dbus_verbose ("security policy disallowing message due to sender policy\n");
- return FALSE;
- }
-
- if (log)
- {
- /* We want to drop this message, and are only not doing so for backwards
- * compatibility. */
- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
- "Would reject message", toggles,
- message, sender, proposed_recipient, requested_reply,
- TRUE, NULL);
- }
-
- if (recipient_policy &&
- !bus_client_policy_check_can_receive (recipient_policy,
- context->registry,
- requested_reply,
- sender,
- addressed_recipient, proposed_recipient,
- message, &toggles))
- {
- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
- "Rejected receive message", toggles,
- message, sender, proposed_recipient, requested_reply,
- (addressed_recipient == proposed_recipient), NULL);
- _dbus_verbose ("security policy disallowing message due to recipient policy\n");
- return FALSE;
- }
-
- /* See if limits on size have been exceeded */
- if (proposed_recipient &&
- ((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) ||
- (dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fds)))
- {
- complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED,
- "Rejected: destination has a full message queue",
- 0, message, sender, proposed_recipient, requested_reply, TRUE,
- error);
- _dbus_verbose ("security policy disallowing message due to full message queue\n");
- return FALSE;
- }
-
- /* Record that we will allow a reply here in the future (don't
- * bother if the recipient is the bus or this is an eavesdropping
- * connection). Only the addressed recipient may reply.
- */
- if (type == DBUS_MESSAGE_TYPE_METHOD_CALL &&
- sender &&
- addressed_recipient &&
- addressed_recipient == proposed_recipient && /* not eavesdropping */
- !bus_connections_expect_reply (bus_connection_get_connections (sender),
- transaction,
- sender, addressed_recipient,
- message, error))
- {
- _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n");
- return FALSE;
- }
-
- _dbus_verbose ("security policy allowing message\n");
- return TRUE;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/bus.h b/src/3rd_party/dbus-1.7.8/bus/bus.h
deleted file mode 100644
index 3597884193..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/bus.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* bus.h message bus context object
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_BUS_H
-#define BUS_BUS_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-mainloop.h>
-#include <dbus/dbus-pipe.h>
-#include <dbus/dbus-sysdeps.h>
-
-typedef struct BusActivation BusActivation;
-typedef struct BusConnections BusConnections;
-typedef struct BusContext BusContext;
-typedef struct BusPolicy BusPolicy;
-typedef struct BusClientPolicy BusClientPolicy;
-typedef struct BusPolicyRule BusPolicyRule;
-typedef struct BusRegistry BusRegistry;
-typedef struct BusSELinuxID BusSELinuxID;
-typedef struct BusService BusService;
-typedef struct BusOwner BusOwner;
-typedef struct BusTransaction BusTransaction;
-typedef struct BusMatchmaker BusMatchmaker;
-typedef struct BusMatchRule BusMatchRule;
-
-typedef struct
-{
- long max_incoming_bytes; /**< How many incoming message bytes for a single connection */
- long max_incoming_unix_fds; /**< How many incoming message unix fds for a single connection */
- long max_outgoing_bytes; /**< How many outgoing bytes can be queued for a single connection */
- long max_outgoing_unix_fds; /**< How many outgoing unix fds can be queued for a single connection */
- long max_message_size; /**< Max size of a single message in bytes */
- long max_message_unix_fds; /**< Max number of unix fds of a single message*/
- int activation_timeout; /**< How long to wait for an activation to time out */
- int auth_timeout; /**< How long to wait for an authentication to time out */
- int max_completed_connections; /**< Max number of authorized connections */
- int max_incomplete_connections; /**< Max number of incomplete connections */
- int max_connections_per_user; /**< Max number of connections auth'd as same user */
- int max_pending_activations; /**< Max number of pending activations for the entire bus */
- int max_services_per_connection; /**< Max number of owned services for a single connection */
- int max_match_rules_per_connection; /**< Max number of match rules for a single connection */
- int max_replies_per_connection; /**< Max number of replies that can be pending for each connection */
- int reply_timeout; /**< How long to wait before timing out a reply */
-} BusLimits;
-
-typedef enum
-{
- BUS_CONTEXT_FLAG_NONE = 0,
- BUS_CONTEXT_FLAG_FORK_ALWAYS = (1 << 1),
- BUS_CONTEXT_FLAG_FORK_NEVER = (1 << 2),
- BUS_CONTEXT_FLAG_WRITE_PID_FILE = (1 << 3),
- BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION = (1 << 4)
-} BusContextFlags;
-
-BusContext* bus_context_new (const DBusString *config_file,
- BusContextFlags flags,
- DBusPipe *print_addr_pipe,
- DBusPipe *print_pid_pipe,
- const DBusString *address,
- DBusError *error);
-dbus_bool_t bus_context_reload_config (BusContext *context,
- DBusError *error);
-void bus_context_shutdown (BusContext *context);
-BusContext* bus_context_ref (BusContext *context);
-void bus_context_unref (BusContext *context);
-dbus_bool_t bus_context_get_id (BusContext *context,
- DBusString *uuid);
-const char* bus_context_get_type (BusContext *context);
-const char* bus_context_get_address (BusContext *context);
-const char* bus_context_get_servicehelper (BusContext *context);
-dbus_bool_t bus_context_get_systemd_activation (BusContext *context);
-BusRegistry* bus_context_get_registry (BusContext *context);
-BusConnections* bus_context_get_connections (BusContext *context);
-BusActivation* bus_context_get_activation (BusContext *context);
-BusMatchmaker* bus_context_get_matchmaker (BusContext *context);
-DBusLoop* bus_context_get_loop (BusContext *context);
-dbus_bool_t bus_context_allow_unix_user (BusContext *context,
- unsigned long uid);
-dbus_bool_t bus_context_allow_windows_user (BusContext *context,
- const char *windows_sid);
-BusPolicy* bus_context_get_policy (BusContext *context);
-
-BusClientPolicy* bus_context_create_client_policy (BusContext *context,
- DBusConnection *connection,
- DBusError *error);
-int bus_context_get_activation_timeout (BusContext *context);
-int bus_context_get_auth_timeout (BusContext *context);
-int bus_context_get_max_completed_connections (BusContext *context);
-int bus_context_get_max_incomplete_connections (BusContext *context);
-int bus_context_get_max_connections_per_user (BusContext *context);
-int bus_context_get_max_pending_activations (BusContext *context);
-int bus_context_get_max_services_per_connection (BusContext *context);
-int bus_context_get_max_match_rules_per_connection (BusContext *context);
-int bus_context_get_max_replies_per_connection (BusContext *context);
-int bus_context_get_reply_timeout (BusContext *context);
-void bus_context_log (BusContext *context,
- DBusSystemLogSeverity severity,
- const char *msg,
- ...);
-dbus_bool_t bus_context_check_security_policy (BusContext *context,
- BusTransaction *transaction,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusConnection *proposed_recipient,
- DBusMessage *message,
- DBusError *error);
-
-#endif /* BUS_BUS_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-loader-expat.c b/src/3rd_party/dbus-1.7.8/bus/config-loader-expat.c
deleted file mode 100644
index b571fda318..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-loader-expat.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-loader-expat.c expat XML loader
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "config-parser.h"
-#include <dbus/dbus-internals.h>
-#include <expat.h>
-
-static XML_Memory_Handling_Suite memsuite;
-
-typedef struct
-{
- BusConfigParser *parser;
- const char *filename;
- DBusString content;
- DBusError *error;
- dbus_bool_t failed;
-} ExpatParseContext;
-
-static dbus_bool_t
-process_content (ExpatParseContext *context)
-{
- if (context->failed)
- return FALSE;
-
- if (_dbus_string_get_length (&context->content) > 0)
- {
- if (!bus_config_parser_content (context->parser,
- &context->content,
- context->error))
- {
- context->failed = TRUE;
- return FALSE;
- }
- _dbus_string_set_length (&context->content, 0);
- }
-
- return TRUE;
-}
-
-static void
-expat_StartElementHandler (void *userData,
- const XML_Char *name,
- const XML_Char **atts)
-{
- ExpatParseContext *context = userData;
- int i;
- char **names;
- char **values;
-
- /* Expat seems to suck and can't abort the parse if we
- * throw an error. Expat 2.0 is supposed to fix this.
- */
- if (context->failed)
- return;
-
- if (!process_content (context))
- return;
-
- /* "atts" is key, value, key, value, NULL */
- for (i = 0; atts[i] != NULL; ++i)
- ; /* nothing */
-
- _dbus_assert (i % 2 == 0);
- names = dbus_new0 (char *, i / 2 + 1);
- values = dbus_new0 (char *, i / 2 + 1);
-
- if (names == NULL || values == NULL)
- {
- dbus_set_error (context->error, DBUS_ERROR_NO_MEMORY, NULL);
- context->failed = TRUE;
- dbus_free (names);
- dbus_free (values);
- return;
- }
-
- i = 0;
- while (atts[i] != NULL)
- {
- _dbus_assert (i % 2 == 0);
- names [i / 2] = (char*) atts[i];
- values[i / 2] = (char*) atts[i+1];
-
- i += 2;
- }
-
- if (!bus_config_parser_start_element (context->parser,
- name,
- (const char **) names,
- (const char **) values,
- context->error))
- {
- dbus_free (names);
- dbus_free (values);
- context->failed = TRUE;
- return;
- }
-
- dbus_free (names);
- dbus_free (values);
-}
-
-static void
-expat_EndElementHandler (void *userData,
- const XML_Char *name)
-{
- ExpatParseContext *context = userData;
-
- if (!process_content (context))
- return;
-
- if (!bus_config_parser_end_element (context->parser,
- name,
- context->error))
- {
- context->failed = TRUE;
- return;
- }
-}
-
-/* s is not 0 terminated. */
-static void
-expat_CharacterDataHandler (void *userData,
- const XML_Char *s,
- int len)
-{
- ExpatParseContext *context = userData;
- if (context->failed)
- return;
-
- if (!_dbus_string_append_len (&context->content,
- s, len))
- {
- dbus_set_error (context->error, DBUS_ERROR_NO_MEMORY, NULL);
- context->failed = TRUE;
- return;
- }
-}
-
-
-BusConfigParser*
-bus_config_load (const DBusString *file,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent,
- DBusError *error)
-{
- XML_Parser expat;
- const char *filename;
- BusConfigParser *parser;
- ExpatParseContext context;
- DBusString dirname;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- parser = NULL;
- expat = NULL;
- context.error = error;
- context.failed = FALSE;
-
- filename = _dbus_string_get_const_data (file);
-
- if (!_dbus_string_init (&context.content))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (!_dbus_string_init (&dirname))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&context.content);
- return NULL;
- }
-
- memsuite.malloc_fcn = dbus_malloc;
- memsuite.realloc_fcn = dbus_realloc;
- memsuite.free_fcn = dbus_free;
-
- expat = XML_ParserCreate_MM ("UTF-8", &memsuite, NULL);
- if (expat == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- if (!_dbus_string_get_dirname (file, &dirname))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- parser = bus_config_parser_new (&dirname, is_toplevel, parent);
- if (parser == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
- context.parser = parser;
-
- XML_SetUserData (expat, &context);
- XML_SetElementHandler (expat,
- expat_StartElementHandler,
- expat_EndElementHandler);
- XML_SetCharacterDataHandler (expat,
- expat_CharacterDataHandler);
-
- {
- DBusString data;
- const char *data_str;
-
- if (!_dbus_string_init (&data))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- if (!_dbus_file_get_contents (&data, file, error))
- {
- _dbus_string_free (&data);
- goto failed;
- }
-
- data_str = _dbus_string_get_const_data (&data);
-
- if (!XML_Parse (expat, data_str, _dbus_string_get_length (&data), TRUE))
- {
- if (context.error != NULL &&
- !dbus_error_is_set (context.error))
- {
- enum XML_Error e;
-
- e = XML_GetErrorCode (expat);
- if (e == XML_ERROR_NO_MEMORY)
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- else
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Error in file %s, line %d, column %d: %s\n",
- filename,
- XML_GetCurrentLineNumber (expat),
- XML_GetCurrentColumnNumber (expat),
- XML_ErrorString (e));
- }
-
- _dbus_string_free (&data);
- goto failed;
- }
-
- _dbus_string_free (&data);
-
- if (context.failed)
- goto failed;
- }
-
- if (!bus_config_parser_finished (parser, error))
- goto failed;
-
- _dbus_string_free (&dirname);
- _dbus_string_free (&context.content);
- XML_ParserFree (expat);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return parser;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _dbus_string_free (&dirname);
- _dbus_string_free (&context.content);
- if (expat)
- XML_ParserFree (expat);
- if (parser)
- bus_config_parser_unref (parser);
- return NULL;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser-common.c b/src/3rd_party/dbus-1.7.8/bus/config-parser-common.c
deleted file mode 100644
index c522ff49f7..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser-common.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser-common.c Common defines and routines for config file parsing
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-internals.h>
-#include <string.h>
-
-#include "config-parser-common.h"
-#include "utils.h"
-
-ElementType
-bus_config_parser_element_name_to_type (const char *name)
-{
- if (strcmp (name, "none") == 0)
- {
- return ELEMENT_NONE;
- }
- else if (strcmp (name, "busconfig") == 0)
- {
- return ELEMENT_BUSCONFIG;
- }
- else if (strcmp (name, "user") == 0)
- {
- return ELEMENT_USER;
- }
- else if (strcmp (name, "auth") == 0)
- {
- return ELEMENT_AUTH;
- }
- else if (strcmp (name, "type") == 0)
- {
- return ELEMENT_CONFIGTYPE;
- }
- else if (strcmp (name, "fork") == 0)
- {
- return ELEMENT_FORK;
- }
- else if (strcmp (name, "pidfile") == 0)
- {
- return ELEMENT_PIDFILE;
- }
- else if (strcmp (name, "listen") == 0)
- {
- return ELEMENT_LISTEN;
- }
- else if (strcmp (name, "auth") == 0)
- {
- return ELEMENT_AUTH;
- }
- else if (strcmp (name, "allow") == 0)
- {
- return ELEMENT_ALLOW;
- }
- else if (strcmp (name, "deny") == 0)
- {
- return ELEMENT_DENY;
- }
- else if (strcmp (name, "servicehelper") == 0)
- {
- return ELEMENT_SERVICEHELPER;
- }
- else if (strcmp (name, "includedir") == 0)
- {
- return ELEMENT_INCLUDEDIR;
- }
- else if (strcmp (name, "standard_session_servicedirs") == 0)
- {
- return ELEMENT_STANDARD_SESSION_SERVICEDIRS;
- }
- else if (strcmp (name, "standard_system_servicedirs") == 0)
- {
- return ELEMENT_STANDARD_SYSTEM_SERVICEDIRS;
- }
- else if (strcmp (name, "servicedir") == 0)
- {
- return ELEMENT_SERVICEDIR;
- }
- else if (strcmp (name, "include") == 0)
- {
- return ELEMENT_INCLUDE;
- }
- else if (strcmp (name, "policy") == 0)
- {
- return ELEMENT_POLICY;
- }
- else if (strcmp (name, "limit") == 0)
- {
- return ELEMENT_LIMIT;
- }
- else if (strcmp (name, "selinux") == 0)
- {
- return ELEMENT_SELINUX;
- }
- else if (strcmp (name, "associate") == 0)
- {
- return ELEMENT_ASSOCIATE;
- }
- else if (strcmp (name, "syslog") == 0)
- {
- return ELEMENT_SYSLOG;
- }
- else if (strcmp (name, "keep_umask") == 0)
- {
- return ELEMENT_KEEP_UMASK;
- }
- else if (strcmp (name, "allow_anonymous") == 0)
- {
- return ELEMENT_ALLOW_ANONYMOUS;
- }
- return ELEMENT_NONE;
-}
-
-const char*
-bus_config_parser_element_type_to_name (ElementType type)
-{
- switch (type)
- {
- case ELEMENT_NONE:
- return NULL;
- case ELEMENT_BUSCONFIG:
- return "busconfig";
- case ELEMENT_INCLUDE:
- return "include";
- case ELEMENT_USER:
- return "user";
- case ELEMENT_LISTEN:
- return "listen";
- case ELEMENT_AUTH:
- return "auth";
- case ELEMENT_POLICY:
- return "policy";
- case ELEMENT_LIMIT:
- return "limit";
- case ELEMENT_ALLOW:
- return "allow";
- case ELEMENT_DENY:
- return "deny";
- case ELEMENT_FORK:
- return "fork";
- case ELEMENT_PIDFILE:
- return "pidfile";
- case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
- return "standard_session_servicedirs";
- case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
- return "standard_system_servicedirs";
- case ELEMENT_SERVICEDIR:
- return "servicedir";
- case ELEMENT_SERVICEHELPER:
- return "servicehelper";
- case ELEMENT_INCLUDEDIR:
- return "includedir";
- case ELEMENT_CONFIGTYPE:
- return "type";
- case ELEMENT_SELINUX:
- return "selinux";
- case ELEMENT_ASSOCIATE:
- return "associate";
- case ELEMENT_SYSLOG:
- return "syslog";
- case ELEMENT_KEEP_UMASK:
- return "keep_umask";
- case ELEMENT_ALLOW_ANONYMOUS:
- return "allow_anonymous";
- }
-
- _dbus_assert_not_reached ("bad element type");
-
- return NULL;
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser-common.h b/src/3rd_party/dbus-1.7.8/bus/config-parser-common.h
deleted file mode 100644
index 186bf4cf74..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser-common.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser-common.h Common defines and routines for config file parsing
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_CONFIG_PARSER_COMMON_H
-#define BUS_CONFIG_PARSER_COMMON_H
-
-typedef enum
-{
- ELEMENT_NONE,
- ELEMENT_BUSCONFIG,
- ELEMENT_INCLUDE,
- ELEMENT_USER,
- ELEMENT_LISTEN,
- ELEMENT_AUTH,
- ELEMENT_POLICY,
- ELEMENT_LIMIT,
- ELEMENT_ALLOW,
- ELEMENT_DENY,
- ELEMENT_FORK,
- ELEMENT_PIDFILE,
- ELEMENT_SERVICEDIR,
- ELEMENT_SERVICEHELPER,
- ELEMENT_INCLUDEDIR,
- /* this is really <type>, but winioctl.h defines ELEMENT_TYPE */
- ELEMENT_CONFIGTYPE,
- ELEMENT_SELINUX,
- ELEMENT_ASSOCIATE,
- ELEMENT_STANDARD_SESSION_SERVICEDIRS,
- ELEMENT_STANDARD_SYSTEM_SERVICEDIRS,
- ELEMENT_KEEP_UMASK,
- ELEMENT_SYSLOG,
- ELEMENT_ALLOW_ANONYMOUS
-} ElementType;
-
-ElementType bus_config_parser_element_name_to_type (const char *element_name);
-const char* bus_config_parser_element_type_to_name (ElementType type);
-
-#endif /* BUS_CONFIG_PARSER_COMMON_H */
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.c b/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.c
deleted file mode 100644
index 64a05c3a76..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.c
+++ /dev/null
@@ -1,716 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser-trivial.c XML-library-agnostic configuration file parser
- * Does not do includes or anything remotely complicated.
- *
- * Copyright (C) 2003, 2004, 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "config-parser-common.h"
-#include "config-parser-trivial.h"
-#include "utils.h"
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-internals.h>
-#include <string.h>
-
-/**
- * TRIVIAL parser for bus configuration file.
- */
-struct BusConfigParser
-{
- ElementType type;
- DBusString user; /**< User the dbus-daemon runs as */
- DBusString bus_type; /**< Message bus type */
- DBusString service_helper; /**< Location of the setuid helper */
- DBusList *service_dirs; /**< Directories to look for services in */
-};
-
-static dbus_bool_t
-service_dirs_find_dir (DBusList **service_dirs,
- const char *dir)
-{
- DBusList *link;
-
- _dbus_assert (dir != NULL);
-
- for (link = *service_dirs; link; link = _dbus_list_get_next_link(service_dirs, link))
- {
- const char *link_dir;
-
- link_dir = (const char *)link->data;
- if (strcmp (dir, link_dir) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-service_dirs_append_link_unique_or_free (DBusList **service_dirs,
- DBusList *dir_link)
-{
- if (!service_dirs_find_dir (service_dirs, dir_link->data))
- {
- _dbus_list_append_link (service_dirs, dir_link);
- }
- else
- {
- dbus_free (dir_link->data);
- _dbus_list_free_link (dir_link);
- }
-}
-
-BusConfigParser*
-bus_config_parser_new (const DBusString *basedir,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent)
-{
- BusConfigParser *parser;
-
- parser = dbus_new0 (BusConfigParser, 1);
- if (parser == NULL)
- goto failed;
-
- parser->type = ELEMENT_NONE;
-
- /* init the lists */
- parser->service_dirs = NULL;
-
- /* init the strings */
- if (!_dbus_string_init (&parser->user))
- goto failed_parser;
- if (!_dbus_string_init (&parser->bus_type))
- goto failed_type;
- if (!_dbus_string_init (&parser->service_helper))
- goto failed_helper;
-
- /* woot! */
- return parser;
-
-/* argh. we have do do this carefully because of OOM */
-failed_helper:
- _dbus_string_free (&parser->bus_type);
-failed_type:
- _dbus_string_free (&parser->user);
-failed_parser:
- dbus_free (parser);
-failed:
- return NULL;
-}
-
-void
-bus_config_parser_unref (BusConfigParser *parser)
-{
- _dbus_string_free (&parser->user);
- _dbus_string_free (&parser->service_helper);
- _dbus_string_free (&parser->bus_type);
-
- _dbus_list_foreach (&parser->service_dirs,
- (DBusForeachFunction) dbus_free,
- NULL);
-
- _dbus_list_clear (&parser->service_dirs);
-
- dbus_free (parser);
-}
-
-dbus_bool_t
-bus_config_parser_check_doctype (BusConfigParser *parser,
- const char *doctype,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (strcmp (doctype, "busconfig") != 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Configuration file has the wrong document type %s",
- doctype);
- return FALSE;
- }
- else
- return TRUE;
-}
-
-dbus_bool_t
-bus_config_parser_start_element (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- /* we don't do processing of attribute names, we don't need to */
- parser->type = bus_config_parser_element_name_to_type (element_name);
-
- switch (parser->type)
- {
- case ELEMENT_SERVICEHELPER:
- case ELEMENT_USER:
- case ELEMENT_CONFIGTYPE:
- /* content about to be handled */
- break;
-
- case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
- {
- DBusList *link;
- DBusList *dirs;
- dirs = NULL;
-
- if (!_dbus_get_standard_system_servicedirs (&dirs))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- while ((link = _dbus_list_pop_first_link (&dirs)))
- service_dirs_append_link_unique_or_free (&parser->service_dirs, link);
- break;
- }
-
- default:
- {
- /* we really don't care about the others... */
- _dbus_verbose (" START We don't care about '%s' type '%i'\n", element_name, parser->type);
- break;
- }
- }
- return TRUE;
-}
-
-dbus_bool_t
-bus_config_parser_end_element (BusConfigParser *parser,
- const char *element_name,
- DBusError *error)
-{
- /* we don't care */
- return TRUE;
-}
-
-dbus_bool_t
-bus_config_parser_content (BusConfigParser *parser,
- const DBusString *content,
- DBusError *error)
-{
- DBusString content_sane;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&content_sane))
- {
- BUS_SET_OOM (error);
- goto out;
- }
- if (!_dbus_string_copy (content, 0, &content_sane, 0))
- {
- BUS_SET_OOM (error);
- goto out_content;
- }
-
- /* rip out white space */
- _dbus_string_chop_white (&content_sane);
- if (_dbus_string_get_length (&content_sane) == 0)
- {
- /* optimise, there is no content */
- retval = TRUE;
- goto out_content;
- }
-
- switch (parser->type)
- {
- case ELEMENT_SERVICEDIR:
- {
- char *cpath;
-
- /* copy the sane data into a char array */
- if (!_dbus_string_copy_data(&content_sane, &cpath))
- {
- BUS_SET_OOM (error);
- goto out_content;
- }
-
- /* append the dynamic char string to service dirs */
- if (!_dbus_list_append (&parser->service_dirs, cpath))
- {
- dbus_free (cpath);
- BUS_SET_OOM (error);
- goto out_content;
- }
- }
- break;
-
- case ELEMENT_SERVICEHELPER:
- {
- if (!_dbus_string_copy (&content_sane, 0, &parser->service_helper, 0))
- {
- BUS_SET_OOM (error);
- goto out_content;
- }
- }
- break;
-
- case ELEMENT_USER:
- {
- if (!_dbus_string_copy (&content_sane, 0, &parser->user, 0))
- {
- BUS_SET_OOM (error);
- goto out_content;
- }
- }
- break;
-
- case ELEMENT_CONFIGTYPE:
- {
- if (!_dbus_string_copy (&content_sane, 0, &parser->bus_type, 0))
- {
- BUS_SET_OOM (error);
- goto out_content;
- }
- }
- break;
- default:
- {
- /* we don't care about the others... really */
- _dbus_verbose (" CONTENTS We don't care about '%s' type '%i'\n", _dbus_string_get_const_data (&content_sane), parser->type);
- break;
- }
- }
-
- /* woot! */
- retval = TRUE;
-
-out_content:
- _dbus_string_free (&content_sane);
-out:
- return retval;
-}
-
-dbus_bool_t
-bus_config_parser_finished (BusConfigParser *parser,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_verbose ("finished scanning!\n");
- return TRUE;
-}
-
-const char*
-bus_config_parser_get_user (BusConfigParser *parser)
-{
- return _dbus_string_get_const_data (&parser->user);
-}
-
-const char*
-bus_config_parser_get_type (BusConfigParser *parser)
-{
- return _dbus_string_get_const_data (&parser->bus_type);
-}
-
-DBusList**
-bus_config_parser_get_service_dirs (BusConfigParser *parser)
-{
- return &parser->service_dirs;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include <stdio.h>
-#include "test.h"
-
-typedef enum
-{
- VALID,
- INVALID,
- UNKNOWN
-} Validity;
-
-static dbus_bool_t
-check_return_values (const DBusString *full_path)
-{
- BusConfigParser *parser;
- DBusError error;
- dbus_bool_t retval;
- const char *user;
- const char *type;
- DBusList **dirs;
-
- dbus_error_init (&error);
- retval = FALSE;
-
- printf ("Testing values from: %s\n", _dbus_string_get_const_data (full_path));
-
- parser = bus_config_load (full_path, TRUE, NULL, &error);
- if (parser == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- _dbus_verbose ("Failed to load valid file due to OOM\n");
- goto finish;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
-
- /* check user return value is okay */
- user = bus_config_parser_get_user (parser);
- if (user == NULL)
- {
- _dbus_warn ("User was NULL!\n");
- goto finish;
- }
-#if 0
- /* the username can be configured in configure.in so this test doesn't work */
- if (strcmp (user, "dbus") != 0)
- {
- _dbus_warn ("User was invalid; '%s'!\n", user);
- goto finish;
- }
- printf (" <user>dbus</user> OKAY!\n");
-#endif
-
- /* check type return value is okay */
- type = bus_config_parser_get_type (parser);
- if (type == NULL)
- {
- _dbus_warn ("Type was NULL!\n");
- goto finish;
- }
- if (strcmp (type, "system") != 0)
- {
- _dbus_warn ("Type was invalid; '%s'!\n", user);
- goto finish;
- }
- printf (" <type>system</type> OKAY!\n");
-
- /* check dirs return value is okay */
- dirs = bus_config_parser_get_service_dirs (parser);
- if (dirs == NULL)
- {
- _dbus_warn ("Service dirs are NULL!\n");
- goto finish;
- }
- printf (" <standard_system_service_dirs/> OKAY!\n");
- /* NOTE: We tested the specific return values in the config-parser tests */
-
- /* woohoo! */
- retval = TRUE;
-finish:
- if (parser != NULL)
- bus_config_parser_unref (parser);
- dbus_error_free (&error);
- return retval;
-}
-
-static dbus_bool_t
-do_load (const DBusString *full_path,
- Validity validity,
- dbus_bool_t oom_possible)
-{
- BusConfigParser *parser;
- DBusError error;
-
- dbus_error_init (&error);
-
- parser = bus_config_load (full_path, TRUE, NULL, &error);
- if (parser == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
-
- if (oom_possible &&
- dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("Failed to load valid file due to OOM\n");
- dbus_error_free (&error);
- return TRUE;
- }
- else if (validity == VALID)
- {
- _dbus_warn ("Failed to load valid file but still had memory: %s\n",
- error.message);
-
- dbus_error_free (&error);
- return FALSE;
- }
- else
- {
- dbus_error_free (&error);
- return TRUE;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
-
- bus_config_parser_unref (parser);
-
- if (validity == INVALID)
- {
- _dbus_warn ("Accepted invalid file\n");
- return FALSE;
- }
-
- return TRUE;
- }
-}
-
-typedef struct
-{
- const DBusString *full_path;
- Validity validity;
-} LoaderOomData;
-
-static dbus_bool_t
-check_loader_oom_func (void *data)
-{
- LoaderOomData *d = data;
-
- return do_load (d->full_path, d->validity, TRUE);
-}
-
-static dbus_bool_t
-process_test_valid_subdir (const DBusString *test_base_dir,
- const char *subdir,
- Validity validity)
-{
- DBusString test_directory;
- DBusString filename;
- DBusDirIter *dir;
- dbus_bool_t retval;
- DBusError error;
-
- retval = FALSE;
- dir = NULL;
-
- if (!_dbus_string_init (&test_directory))
- _dbus_assert_not_reached ("didn't allocate test_directory\n");
-
- _dbus_string_init_const (&filename, subdir);
-
- if (!_dbus_string_copy (test_base_dir, 0,
- &test_directory, 0))
- _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
-
- if (!_dbus_concat_dir_and_file (&test_directory, &filename))
- _dbus_assert_not_reached ("couldn't allocate full path");
-
- _dbus_string_free (&filename);
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string\n");
-
- dbus_error_init (&error);
- dir = _dbus_directory_open (&test_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- if (validity == VALID)
- printf ("Testing valid files:\n");
- else if (validity == INVALID)
- printf ("Testing invalid files:\n");
- else
- printf ("Testing unknown files:\n");
-
- next:
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
- LoaderOomData d;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
- {
- _dbus_verbose ("Skipping non-.conf file %s\n",
- _dbus_string_get_const_data (&filename));
- _dbus_string_free (&full_path);
- goto next;
- }
-
- printf (" %s\n", _dbus_string_get_const_data (&filename));
-
- _dbus_verbose (" expecting %s\n",
- validity == VALID ? "valid" :
- (validity == INVALID ? "invalid" :
- (validity == UNKNOWN ? "unknown" : "???")));
-
- d.full_path = &full_path;
- d.validity = validity;
-
- /* FIXME hackaround for an expat problem, see
- * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124747
- * http://freedesktop.org/pipermail/dbus/2004-May/001153.html
- */
- /* if (!_dbus_test_oom_handling ("config-loader", check_loader_oom_func, &d)) */
- if (!check_loader_oom_func (&d))
- _dbus_assert_not_reached ("test failed");
-
- _dbus_string_free (&full_path);
- }
-
- if (dbus_error_is_set (&error))
- {
- _dbus_warn ("Could not get next file in %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
-
- if (dir)
- _dbus_directory_close (dir);
- _dbus_string_free (&test_directory);
- _dbus_string_free (&filename);
-
- return retval;
-}
-
-/* convenience function, do not reuse outside of TEST */
-static dbus_bool_t
-make_full_path (const DBusString *test_data_dir,
- const char *subdir,
- const char *file,
- DBusString *full_path)
-{
- DBusString filename;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (full_path))
- {
- _dbus_warn ("couldn't allocate full path");
- goto finish;
- }
-
- if (!_dbus_string_copy (test_data_dir, 0, full_path, 0))
- {
- _dbus_warn ("couldn't allocate full path");
- goto finish;
- }
-
- _dbus_string_init_const (&filename, subdir);
- if (!_dbus_concat_dir_and_file (full_path, &filename))
- {
- _dbus_warn ("couldn't allocate full path");
- goto finish;
- }
- _dbus_string_free (&filename);
-
- _dbus_string_init_const (&filename, file);
- if (!_dbus_concat_dir_and_file (full_path, &filename))
- {
- _dbus_warn ("couldn't allocate full path");
- goto finish;
- }
-
- /* woot! */
- retval = TRUE;
-
-finish:
- _dbus_string_free (&filename);
- return retval;
-}
-
-static dbus_bool_t
-check_file_valid (DBusString *full_path,
- Validity validity)
-{
- dbus_bool_t retval;
-
- if (validity == VALID)
- printf ("Testing valid file:\n");
- else if (validity == INVALID)
- printf ("Testing invalid file:\n");
- else
- printf ("Testing unknown file:\n");
-
- /* print the filename, just so we match the other output */
- printf (" %s\n", _dbus_string_get_const_data (full_path));
-
- /* only test one file */
- retval = do_load (full_path, validity, TRUE);
-
- return retval;
-}
-
-dbus_bool_t
-bus_config_parser_trivial_test (const DBusString *test_data_dir)
-{
- DBusString full_path;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (test_data_dir == NULL ||
- _dbus_string_get_length (test_data_dir) == 0)
- {
- printf ("No test data\n");
- return TRUE;
- }
-
- /* We already test default_session_servicedirs and default_system_servicedirs
- * in bus_config_parser_test() */
- if (!process_test_valid_subdir (test_data_dir, "valid-config-files", VALID))
- goto finish;
-
- /* we don't process all the invalid files, as the trivial parser can't hope
- * to validate them all for all different syntaxes. We just check one broken
- * file to see if junk is received */
- if (!make_full_path (test_data_dir, "invalid-config-files", "not-well-formed.conf", &full_path))
- goto finish;
- if (!check_file_valid (&full_path, INVALID))
- goto finish;
- _dbus_string_free (&full_path);
-
- /* just test if the check_file_valid works okay and we got sane values */
- if (!make_full_path (test_data_dir, "valid-config-files", "system.conf", &full_path))
- goto finish;
- if (!check_file_valid (&full_path, VALID))
- goto finish;
- /* check to see if we got the correct values from the parser */
- if (!check_return_values (&full_path))
- goto finish;
-
- /* woot! */
- retval = TRUE;
-
-finish:
- _dbus_string_free (&full_path);
-
- /* we don't process equiv-config-files as we don't handle <include> */
- return retval;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.h b/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.h
deleted file mode 100644
index 31ddef6b5d..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser-trivial.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser-trivial.h XML-library-agnostic configuration file parser
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_CONFIG_PARSER_TRIVIAL_H
-#define BUS_CONFIG_PARSER_TRIVIAL_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-hash.h>
-
-/* Whatever XML library we're using just pushes data into this API */
-
-typedef struct BusConfigParser BusConfigParser;
-
-BusConfigParser* bus_config_parser_new (const DBusString *basedir,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent);
-
-BusConfigParser* bus_config_parser_ref (BusConfigParser *parser);
-void bus_config_parser_unref (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_check_doctype (BusConfigParser *parser,
- const char *doctype,
- DBusError *error);
-dbus_bool_t bus_config_parser_start_element (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error);
-dbus_bool_t bus_config_parser_end_element (BusConfigParser *parser,
- const char *element_name,
- DBusError *error);
-dbus_bool_t bus_config_parser_content (BusConfigParser *parser,
- const DBusString *content,
- DBusError *error);
-dbus_bool_t bus_config_parser_finished (BusConfigParser *parser,
- DBusError *error);
-
-/* Functions for extracting the parse results */
-const char* bus_config_parser_get_user (BusConfigParser *parser);
-const char* bus_config_parser_get_type (BusConfigParser *parser);
-DBusList** bus_config_parser_get_service_dirs (BusConfigParser *parser);
-
-/* Loader functions (backended off one of the XML parsers). Returns a
- * finished ConfigParser.
- */
-BusConfigParser* bus_config_load (const DBusString *file,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent,
- DBusError *error);
-
-#endif /* BUS_CONFIG_PARSER_TRIVIAL_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser.c b/src/3rd_party/dbus-1.7.8/bus/config-parser.c
deleted file mode 100644
index 12a2d2e7bf..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser.c
+++ /dev/null
@@ -1,3641 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser.c XML-library-agnostic configuration file parser
- *
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "config-parser-common.h"
-#include "config-parser.h"
-#include "test.h"
-#include "utils.h"
-#include "policy.h"
-#include "selinux.h"
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-misc.h>
-#include <dbus/dbus-sysdeps.h>
-#include <string.h>
-
-typedef enum
-{
- /* we ignore policies for unknown groups/users */
- POLICY_IGNORED,
-
- /* non-ignored */
- POLICY_DEFAULT,
- POLICY_MANDATORY,
- POLICY_USER,
- POLICY_GROUP,
- POLICY_CONSOLE
-} PolicyType;
-
-typedef struct
-{
- ElementType type;
-
- unsigned int had_content : 1;
-
- union
- {
- struct
- {
- unsigned int ignore_missing : 1;
- unsigned int if_selinux_enabled : 1;
- unsigned int selinux_root_relative : 1;
- } include;
-
- struct
- {
- PolicyType type;
- unsigned long gid_uid_or_at_console;
- } policy;
-
- struct
- {
- char *name;
- long value;
- } limit;
-
- } d;
-
-} Element;
-
-/**
- * Parser for bus configuration file.
- */
-struct BusConfigParser
-{
- int refcount; /**< Reference count */
-
- DBusString basedir; /**< Directory we resolve paths relative to */
-
- DBusList *stack; /**< stack of Element */
-
- char *user; /**< user to run as */
-
- char *servicehelper; /**< location of the setuid helper */
-
- char *bus_type; /**< Message bus type */
-
- DBusList *listen_on; /**< List of addresses to listen to */
-
- DBusList *mechanisms; /**< Auth mechanisms */
-
- DBusList *service_dirs; /**< Directories to look for session services in */
-
- DBusList *conf_dirs; /**< Directories to look for policy configuration in */
-
- BusPolicy *policy; /**< Security policy */
-
- BusLimits limits; /**< Limits */
-
- char *pidfile; /**< PID file */
-
- DBusList *included_files; /**< Included files stack */
-
- DBusHashTable *service_context_table; /**< Map service names to SELinux contexts */
-
- unsigned int fork : 1; /**< TRUE to fork into daemon mode */
-
- unsigned int syslog : 1; /**< TRUE to enable syslog */
- unsigned int keep_umask : 1; /**< TRUE to keep original umask when forking */
-
- unsigned int is_toplevel : 1; /**< FALSE if we are a sub-config-file inside another one */
-
- unsigned int allow_anonymous : 1; /**< TRUE to allow anonymous connections */
-};
-
-static Element*
-push_element (BusConfigParser *parser,
- ElementType type)
-{
- Element *e;
-
- _dbus_assert (type != ELEMENT_NONE);
-
- e = dbus_new0 (Element, 1);
- if (e == NULL)
- return NULL;
-
- if (!_dbus_list_append (&parser->stack, e))
- {
- dbus_free (e);
- return NULL;
- }
-
- e->type = type;
-
- return e;
-}
-
-static void
-element_free (Element *e)
-{
- if (e->type == ELEMENT_LIMIT)
- dbus_free (e->d.limit.name);
-
- dbus_free (e);
-}
-
-static void
-pop_element (BusConfigParser *parser)
-{
- Element *e;
-
- e = _dbus_list_pop_last (&parser->stack);
-
- element_free (e);
-}
-
-static Element*
-peek_element (BusConfigParser *parser)
-{
- Element *e;
-
- e = _dbus_list_get_last (&parser->stack);
-
- return e;
-}
-
-static ElementType
-top_element_type (BusConfigParser *parser)
-{
- Element *e;
-
- e = _dbus_list_get_last (&parser->stack);
-
- if (e)
- return e->type;
- else
- return ELEMENT_NONE;
-}
-
-static dbus_bool_t
-merge_service_context_hash (DBusHashTable *dest,
- DBusHashTable *from)
-{
- DBusHashIter iter;
- char *service_copy;
- char *context_copy;
-
- service_copy = NULL;
- context_copy = NULL;
-
- _dbus_hash_iter_init (from, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- const char *service = _dbus_hash_iter_get_string_key (&iter);
- const char *context = _dbus_hash_iter_get_value (&iter);
-
- service_copy = _dbus_strdup (service);
- if (service_copy == NULL)
- goto fail;
- context_copy = _dbus_strdup (context);
- if (context_copy == NULL)
- goto fail;
-
- if (!_dbus_hash_table_insert_string (dest, service_copy, context_copy))
- goto fail;
-
- service_copy = NULL;
- context_copy = NULL;
- }
-
- return TRUE;
-
- fail:
- if (service_copy)
- dbus_free (service_copy);
-
- if (context_copy)
- dbus_free (context_copy);
-
- return FALSE;
-}
-
-static dbus_bool_t
-service_dirs_find_dir (DBusList **service_dirs,
- const char *dir)
-{
- DBusList *link;
-
- _dbus_assert (dir != NULL);
-
- for (link = *service_dirs; link; link = _dbus_list_get_next_link(service_dirs, link))
- {
- const char *link_dir;
-
- link_dir = (const char *)link->data;
- if (strcmp (dir, link_dir) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static dbus_bool_t
-service_dirs_append_unique_or_free (DBusList **service_dirs,
- char *dir)
-{
- if (!service_dirs_find_dir (service_dirs, dir))
- return _dbus_list_append (service_dirs, dir);
-
- dbus_free (dir);
- return TRUE;
-}
-
-static void
-service_dirs_append_link_unique_or_free (DBusList **service_dirs,
- DBusList *dir_link)
-{
- if (!service_dirs_find_dir (service_dirs, dir_link->data))
- {
- _dbus_list_append_link (service_dirs, dir_link);
- }
- else
- {
- dbus_free (dir_link->data);
- _dbus_list_free_link (dir_link);
- }
-}
-
-static dbus_bool_t
-merge_included (BusConfigParser *parser,
- BusConfigParser *included,
- DBusError *error)
-{
- DBusList *link;
-
- if (!bus_policy_merge (parser->policy,
- included->policy))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!merge_service_context_hash (parser->service_context_table,
- included->service_context_table))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (included->user != NULL)
- {
- dbus_free (parser->user);
- parser->user = included->user;
- included->user = NULL;
- }
-
- if (included->bus_type != NULL)
- {
- dbus_free (parser->bus_type);
- parser->bus_type = included->bus_type;
- included->bus_type = NULL;
- }
-
- if (included->fork)
- parser->fork = TRUE;
-
- if (included->keep_umask)
- parser->keep_umask = TRUE;
-
- if (included->pidfile != NULL)
- {
- dbus_free (parser->pidfile);
- parser->pidfile = included->pidfile;
- included->pidfile = NULL;
- }
-
- if (included->servicehelper != NULL)
- {
- dbus_free (parser->servicehelper);
- parser->servicehelper = included->servicehelper;
- included->servicehelper = NULL;
- }
-
- while ((link = _dbus_list_pop_first_link (&included->listen_on)))
- _dbus_list_append_link (&parser->listen_on, link);
-
- while ((link = _dbus_list_pop_first_link (&included->mechanisms)))
- _dbus_list_append_link (&parser->mechanisms, link);
-
- while ((link = _dbus_list_pop_first_link (&included->service_dirs)))
- service_dirs_append_link_unique_or_free (&parser->service_dirs, link);
-
- while ((link = _dbus_list_pop_first_link (&included->conf_dirs)))
- _dbus_list_append_link (&parser->conf_dirs, link);
-
- return TRUE;
-}
-
-static dbus_bool_t
-seen_include (BusConfigParser *parser,
- const DBusString *file)
-{
- DBusList *iter;
-
- iter = parser->included_files;
- while (iter != NULL)
- {
- if (! strcmp (_dbus_string_get_const_data (file), iter->data))
- return TRUE;
-
- iter = _dbus_list_get_next_link (&parser->included_files, iter);
- }
-
- return FALSE;
-}
-
-BusConfigParser*
-bus_config_parser_new (const DBusString *basedir,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent)
-{
- BusConfigParser *parser;
-
- parser = dbus_new0 (BusConfigParser, 1);
- if (parser == NULL)
- return NULL;
-
- parser->is_toplevel = !!is_toplevel;
-
- if (!_dbus_string_init (&parser->basedir))
- {
- dbus_free (parser);
- return NULL;
- }
-
- if (((parser->policy = bus_policy_new ()) == NULL) ||
- !_dbus_string_copy (basedir, 0, &parser->basedir, 0) ||
- ((parser->service_context_table = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free,
- dbus_free)) == NULL))
- {
- if (parser->policy)
- bus_policy_unref (parser->policy);
-
- _dbus_string_free (&parser->basedir);
-
- dbus_free (parser);
- return NULL;
- }
-
- if (parent != NULL)
- {
- /* Initialize the parser's limits from the parent. */
- parser->limits = parent->limits;
-
- /* Use the parent's list of included_files to avoid
- circular inclusions. */
- parser->included_files = parent->included_files;
- }
- else
- {
-
- /* Make up some numbers! woot! */
- parser->limits.max_incoming_bytes = _DBUS_ONE_MEGABYTE * 127;
- parser->limits.max_outgoing_bytes = _DBUS_ONE_MEGABYTE * 127;
- parser->limits.max_message_size = _DBUS_ONE_MEGABYTE * 32;
-
- /* We set relatively conservative values here since due to the
- way SCM_RIGHTS works we need to preallocate an array for the
- maximum number of file descriptors we can receive. Picking a
- high value here thus translates directly to more memory
- allocation. */
- parser->limits.max_incoming_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS*4;
- parser->limits.max_outgoing_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS*4;
- parser->limits.max_message_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS;
-
- /* Making this long means the user has to wait longer for an error
- * message if something screws up, but making it too short means
- * they might see a false failure.
- */
- parser->limits.activation_timeout = 25000; /* 25 seconds */
-
- /* Making this long risks making a DOS attack easier, but too short
- * and legitimate auth will fail. If interactive auth (ask user for
- * password) is allowed, then potentially it has to be quite long.
- */
- parser->limits.auth_timeout = 30000; /* 30 seconds */
-
- parser->limits.max_incomplete_connections = 64;
- parser->limits.max_connections_per_user = 256;
-
- /* Note that max_completed_connections / max_connections_per_user
- * is the number of users that would have to work together to
- * DOS all the other users.
- */
- parser->limits.max_completed_connections = 2048;
-
- parser->limits.max_pending_activations = 512;
- parser->limits.max_services_per_connection = 512;
-
- /* For this one, keep in mind that it isn't only the memory used
- * by the match rules, but slowdown from linearly walking a big
- * list of them. A client adding more than this is almost
- * certainly a bad idea for that reason, and should change to a
- * smaller number of wider-net match rules - getting every last
- * message to the bus is probably better than having a thousand
- * match rules.
- */
- parser->limits.max_match_rules_per_connection = 512;
-
- parser->limits.reply_timeout = -1; /* never */
-
- /* this is effectively a limit on message queue size for messages
- * that require a reply
- */
- parser->limits.max_replies_per_connection = 1024*8;
- }
-
- parser->refcount = 1;
-
- return parser;
-}
-
-BusConfigParser *
-bus_config_parser_ref (BusConfigParser *parser)
-{
- _dbus_assert (parser->refcount > 0);
-
- parser->refcount += 1;
-
- return parser;
-}
-
-void
-bus_config_parser_unref (BusConfigParser *parser)
-{
- _dbus_assert (parser->refcount > 0);
-
- parser->refcount -= 1;
-
- if (parser->refcount == 0)
- {
- while (parser->stack != NULL)
- pop_element (parser);
-
- dbus_free (parser->user);
- dbus_free (parser->servicehelper);
- dbus_free (parser->bus_type);
- dbus_free (parser->pidfile);
-
- _dbus_list_foreach (&parser->listen_on,
- (DBusForeachFunction) dbus_free,
- NULL);
-
- _dbus_list_clear (&parser->listen_on);
-
- _dbus_list_foreach (&parser->service_dirs,
- (DBusForeachFunction) dbus_free,
- NULL);
-
- _dbus_list_clear (&parser->service_dirs);
-
- _dbus_list_foreach (&parser->conf_dirs,
- (DBusForeachFunction) dbus_free,
- NULL);
-
- _dbus_list_clear (&parser->conf_dirs);
-
- _dbus_list_foreach (&parser->mechanisms,
- (DBusForeachFunction) dbus_free,
- NULL);
-
- _dbus_list_clear (&parser->mechanisms);
-
- _dbus_string_free (&parser->basedir);
-
- if (parser->policy)
- bus_policy_unref (parser->policy);
-
- if (parser->service_context_table)
- _dbus_hash_table_unref (parser->service_context_table);
-
- dbus_free (parser);
- }
-}
-
-dbus_bool_t
-bus_config_parser_check_doctype (BusConfigParser *parser,
- const char *doctype,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (strcmp (doctype, "busconfig") != 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Configuration file has the wrong document type %s",
- doctype);
- return FALSE;
- }
- else
- return TRUE;
-}
-
-typedef struct
-{
- const char *name;
- const char **retloc;
-} LocateAttr;
-
-static dbus_bool_t
-locate_attributes (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error,
- const char *first_attribute_name,
- const char **first_attribute_retloc,
- ...)
-{
- va_list args;
- const char *name;
- const char **retloc;
- int n_attrs;
-#define MAX_ATTRS 24
- LocateAttr attrs[MAX_ATTRS];
- dbus_bool_t retval;
- int i;
-
- _dbus_assert (first_attribute_name != NULL);
- _dbus_assert (first_attribute_retloc != NULL);
-
- retval = TRUE;
-
- n_attrs = 1;
- attrs[0].name = first_attribute_name;
- attrs[0].retloc = first_attribute_retloc;
- *first_attribute_retloc = NULL;
-
- va_start (args, first_attribute_retloc);
-
- name = va_arg (args, const char*);
- retloc = va_arg (args, const char**);
-
- while (name != NULL)
- {
- _dbus_assert (retloc != NULL);
- _dbus_assert (n_attrs < MAX_ATTRS);
-
- attrs[n_attrs].name = name;
- attrs[n_attrs].retloc = retloc;
- n_attrs += 1;
- *retloc = NULL;
-
- name = va_arg (args, const char*);
- retloc = va_arg (args, const char**);
- }
-
- va_end (args);
-
- i = 0;
- while (attribute_names[i])
- {
- int j;
- dbus_bool_t found;
-
- found = FALSE;
- j = 0;
- while (j < n_attrs)
- {
- if (strcmp (attrs[j].name, attribute_names[i]) == 0)
- {
- retloc = attrs[j].retloc;
-
- if (*retloc != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Attribute \"%s\" repeated twice on the same <%s> element",
- attrs[j].name, element_name);
- retval = FALSE;
- goto out;
- }
-
- *retloc = attribute_values[i];
- found = TRUE;
- }
-
- ++j;
- }
-
- if (!found)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Attribute \"%s\" is invalid on <%s> element in this context",
- attribute_names[i], element_name);
- retval = FALSE;
- goto out;
- }
-
- ++i;
- }
-
- out:
- return retval;
-}
-
-static dbus_bool_t
-check_no_attributes (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- if (attribute_names[0] != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Attribute \"%s\" is invalid on <%s> element in this context",
- attribute_names[0], element_name);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-start_busconfig_child (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- ElementType element_type;
-
- element_type = bus_config_parser_element_name_to_type (element_name);
-
- if (element_type == ELEMENT_USER)
- {
- if (!check_no_attributes (parser, "user", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_USER) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_CONFIGTYPE)
- {
- if (!check_no_attributes (parser, "type", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_CONFIGTYPE) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_FORK)
- {
- if (!check_no_attributes (parser, "fork", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_FORK) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- parser->fork = TRUE;
-
- return TRUE;
- }
- else if (element_type == ELEMENT_SYSLOG)
- {
- if (!check_no_attributes (parser, "syslog", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_SYSLOG) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- parser->syslog = TRUE;
-
- return TRUE;
- }
- else if (element_type == ELEMENT_KEEP_UMASK)
- {
- if (!check_no_attributes (parser, "keep_umask", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_KEEP_UMASK) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- parser->keep_umask = TRUE;
-
- return TRUE;
- }
- else if (element_type == ELEMENT_PIDFILE)
- {
- if (!check_no_attributes (parser, "pidfile", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_PIDFILE) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_LISTEN)
- {
- if (!check_no_attributes (parser, "listen", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_LISTEN) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_AUTH)
- {
- if (!check_no_attributes (parser, "auth", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_AUTH) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_SERVICEHELPER)
- {
- if (!check_no_attributes (parser, "servicehelper", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_SERVICEHELPER) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_INCLUDEDIR)
- {
- if (!check_no_attributes (parser, "includedir", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_INCLUDEDIR) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_STANDARD_SESSION_SERVICEDIRS)
- {
- DBusList *link;
- DBusList *dirs;
- dirs = NULL;
-
- if (!check_no_attributes (parser, "standard_session_servicedirs", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_STANDARD_SESSION_SERVICEDIRS) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_get_standard_session_servicedirs (&dirs))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- while ((link = _dbus_list_pop_first_link (&dirs)))
- service_dirs_append_link_unique_or_free (&parser->service_dirs, link);
-
- return TRUE;
- }
- else if (element_type == ELEMENT_STANDARD_SYSTEM_SERVICEDIRS)
- {
- DBusList *link;
- DBusList *dirs;
- dirs = NULL;
-
- if (!check_no_attributes (parser, "standard_system_servicedirs", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_STANDARD_SYSTEM_SERVICEDIRS) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_get_standard_system_servicedirs (&dirs))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- while ((link = _dbus_list_pop_first_link (&dirs)))
- service_dirs_append_link_unique_or_free (&parser->service_dirs, link);
-
- return TRUE;
- }
- else if (element_type == ELEMENT_ALLOW_ANONYMOUS)
- {
- if (!check_no_attributes (parser, "allow_anonymous", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_ALLOW_ANONYMOUS) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- parser->allow_anonymous = TRUE;
- return TRUE;
- }
- else if (element_type == ELEMENT_SERVICEDIR)
- {
- if (!check_no_attributes (parser, "servicedir", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_SERVICEDIR) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_INCLUDE)
- {
- Element *e;
- const char *if_selinux_enabled;
- const char *ignore_missing;
- const char *selinux_root_relative;
-
- if ((e = push_element (parser, ELEMENT_INCLUDE)) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- e->d.include.ignore_missing = FALSE;
- e->d.include.if_selinux_enabled = FALSE;
- e->d.include.selinux_root_relative = FALSE;
-
- if (!locate_attributes (parser, "include",
- attribute_names,
- attribute_values,
- error,
- "ignore_missing", &ignore_missing,
- "if_selinux_enabled", &if_selinux_enabled,
- "selinux_root_relative", &selinux_root_relative,
- NULL))
- return FALSE;
-
- if (ignore_missing != NULL)
- {
- if (strcmp (ignore_missing, "yes") == 0)
- e->d.include.ignore_missing = TRUE;
- else if (strcmp (ignore_missing, "no") == 0)
- e->d.include.ignore_missing = FALSE;
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "ignore_missing attribute must have value \"yes\" or \"no\"");
- return FALSE;
- }
- }
-
- if (if_selinux_enabled != NULL)
- {
- if (strcmp (if_selinux_enabled, "yes") == 0)
- e->d.include.if_selinux_enabled = TRUE;
- else if (strcmp (if_selinux_enabled, "no") == 0)
- e->d.include.if_selinux_enabled = FALSE;
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "if_selinux_enabled attribute must have value"
- " \"yes\" or \"no\"");
- return FALSE;
- }
- }
-
- if (selinux_root_relative != NULL)
- {
- if (strcmp (selinux_root_relative, "yes") == 0)
- e->d.include.selinux_root_relative = TRUE;
- else if (strcmp (selinux_root_relative, "no") == 0)
- e->d.include.selinux_root_relative = FALSE;
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "selinux_root_relative attribute must have value"
- " \"yes\" or \"no\"");
- return FALSE;
- }
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_POLICY)
- {
- Element *e;
- const char *context;
- const char *user;
- const char *group;
- const char *at_console;
-
- if ((e = push_element (parser, ELEMENT_POLICY)) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- e->d.policy.type = POLICY_IGNORED;
-
- if (!locate_attributes (parser, "policy",
- attribute_names,
- attribute_values,
- error,
- "context", &context,
- "user", &user,
- "group", &group,
- "at_console", &at_console,
- NULL))
- return FALSE;
-
- if (((context && user) ||
- (context && group) ||
- (context && at_console)) ||
- ((user && group) ||
- (user && at_console)) ||
- (group && at_console) ||
- !(context || user || group || at_console))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<policy> element must have exactly one of (context|user|group|at_console) attributes");
- return FALSE;
- }
-
- if (context != NULL)
- {
- if (strcmp (context, "default") == 0)
- {
- e->d.policy.type = POLICY_DEFAULT;
- }
- else if (strcmp (context, "mandatory") == 0)
- {
- e->d.policy.type = POLICY_MANDATORY;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "context attribute on <policy> must have the value \"default\" or \"mandatory\", not \"%s\"",
- context);
- return FALSE;
- }
- }
- else if (user != NULL)
- {
- DBusString username;
- _dbus_string_init_const (&username, user);
-
- if (_dbus_parse_unix_user_from_config (&username,
- &e->d.policy.gid_uid_or_at_console))
- e->d.policy.type = POLICY_USER;
- else
- _dbus_warn ("Unknown username \"%s\" in message bus configuration file\n",
- user);
- }
- else if (group != NULL)
- {
- DBusString group_name;
- _dbus_string_init_const (&group_name, group);
-
- if (_dbus_parse_unix_group_from_config (&group_name,
- &e->d.policy.gid_uid_or_at_console))
- e->d.policy.type = POLICY_GROUP;
- else
- _dbus_warn ("Unknown group \"%s\" in message bus configuration file\n",
- group);
- }
- else if (at_console != NULL)
- {
- dbus_bool_t t;
- t = (strcmp (at_console, "true") == 0);
- if (t || strcmp (at_console, "false") == 0)
- {
- e->d.policy.gid_uid_or_at_console = t;
- e->d.policy.type = POLICY_CONSOLE;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Unknown value \"%s\" for at_console in message bus configuration file",
- at_console);
-
- return FALSE;
- }
- }
- else
- {
- _dbus_assert_not_reached ("all <policy> attributes null and we didn't set error");
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_LIMIT)
- {
- Element *e;
- const char *name;
-
- if ((e = push_element (parser, ELEMENT_LIMIT)) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!locate_attributes (parser, "limit",
- attribute_names,
- attribute_values,
- error,
- "name", &name,
- NULL))
- return FALSE;
-
- if (name == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<limit> element must have a \"name\" attribute");
- return FALSE;
- }
-
- e->d.limit.name = _dbus_strdup (name);
- if (e->d.limit.name == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (element_type == ELEMENT_SELINUX)
- {
- if (!check_no_attributes (parser, "selinux", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_SELINUX) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> not allowed inside <%s> in configuration file",
- element_name, "busconfig");
- return FALSE;
- }
-}
-
-static dbus_bool_t
-append_rule_from_element (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- dbus_bool_t allow,
- DBusError *error)
-{
- const char *log;
- const char *send_interface;
- const char *send_member;
- const char *send_error;
- const char *send_destination;
- const char *send_path;
- const char *send_type;
- const char *receive_interface;
- const char *receive_member;
- const char *receive_error;
- const char *receive_sender;
- const char *receive_path;
- const char *receive_type;
- const char *eavesdrop;
- const char *send_requested_reply;
- const char *receive_requested_reply;
- const char *own;
- const char *own_prefix;
- const char *user;
- const char *group;
-
- BusPolicyRule *rule;
-
- if (!locate_attributes (parser, element_name,
- attribute_names,
- attribute_values,
- error,
- "send_interface", &send_interface,
- "send_member", &send_member,
- "send_error", &send_error,
- "send_destination", &send_destination,
- "send_path", &send_path,
- "send_type", &send_type,
- "receive_interface", &receive_interface,
- "receive_member", &receive_member,
- "receive_error", &receive_error,
- "receive_sender", &receive_sender,
- "receive_path", &receive_path,
- "receive_type", &receive_type,
- "eavesdrop", &eavesdrop,
- "send_requested_reply", &send_requested_reply,
- "receive_requested_reply", &receive_requested_reply,
- "own", &own,
- "own_prefix", &own_prefix,
- "user", &user,
- "group", &group,
- "log", &log,
- NULL))
- return FALSE;
-
- if (!(send_interface || send_member || send_error || send_destination ||
- send_type || send_path ||
- receive_interface || receive_member || receive_error || receive_sender ||
- receive_type || receive_path || eavesdrop ||
- send_requested_reply || receive_requested_reply ||
- own || own_prefix || user || group))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> must have one or more attributes",
- element_name);
- return FALSE;
- }
-
- if ((send_member && (send_interface == NULL && send_path == NULL)) ||
- (receive_member && (receive_interface == NULL && receive_path == NULL)))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "On element <%s>, if you specify a member you must specify an interface or a path. Keep in mind that not all messages have an interface field.",
- element_name);
- return FALSE;
- }
-
- /* Allowed combinations of elements are:
- *
- * base, must be all send or all receive:
- * nothing
- * interface
- * interface + member
- * error
- *
- * base send_ can combine with send_destination, send_path, send_type, send_requested_reply
- * base receive_ with receive_sender, receive_path, receive_type, receive_requested_reply, eavesdrop
- *
- * user, group, own, own_prefix must occur alone
- *
- * Pretty sure the below stuff is broken, FIXME think about it more.
- */
-
- if ((send_interface && (send_error ||
- receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_member && (send_error ||
- receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_error && (receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_destination && (receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_type && (receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_path && (receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (send_requested_reply && (receive_interface ||
- receive_member ||
- receive_error ||
- receive_sender ||
- receive_requested_reply ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (receive_interface && (receive_error ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (receive_member && (receive_error ||
- own || own_prefix ||
- user ||
- group)) ||
-
- (receive_error && (own || own_prefix ||
- user ||
- group)) ||
-
- (eavesdrop && (own || own_prefix ||
- user ||
- group)) ||
-
- (receive_requested_reply && (own || own_prefix ||
- user ||
- group)) ||
-
- (own && (own_prefix || user || group)) ||
-
- (own_prefix && (own || user || group)) ||
-
- (user && group))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Invalid combination of attributes on element <%s>",
- element_name);
- return FALSE;
- }
-
- rule = NULL;
-
- /* In BusPolicyRule, NULL represents wildcard.
- * In the config file, '*' represents it.
- */
-#define IS_WILDCARD(str) ((str) && ((str)[0]) == '*' && ((str)[1]) == '\0')
-
- if (send_interface || send_member || send_error || send_destination ||
- send_path || send_type || send_requested_reply)
- {
- int message_type;
-
- if (IS_WILDCARD (send_interface))
- send_interface = NULL;
- if (IS_WILDCARD (send_member))
- send_member = NULL;
- if (IS_WILDCARD (send_error))
- send_error = NULL;
- if (IS_WILDCARD (send_destination))
- send_destination = NULL;
- if (IS_WILDCARD (send_path))
- send_path = NULL;
- if (IS_WILDCARD (send_type))
- send_type = NULL;
-
- message_type = DBUS_MESSAGE_TYPE_INVALID;
- if (send_type != NULL)
- {
- message_type = dbus_message_type_from_string (send_type);
- if (message_type == DBUS_MESSAGE_TYPE_INVALID)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad message type \"%s\"",
- send_type);
- return FALSE;
- }
- }
-
- if (eavesdrop &&
- !(strcmp (eavesdrop, "true") == 0 ||
- strcmp (eavesdrop, "false") == 0))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad value \"%s\" for %s attribute, must be true or false",
- "eavesdrop", eavesdrop);
- return FALSE;
- }
-
- if (send_requested_reply &&
- !(strcmp (send_requested_reply, "true") == 0 ||
- strcmp (send_requested_reply, "false") == 0))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad value \"%s\" for %s attribute, must be true or false",
- "send_requested_reply", send_requested_reply);
- return FALSE;
- }
-
- rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, allow);
- if (rule == NULL)
- goto nomem;
-
- if (eavesdrop)
- rule->d.send.eavesdrop = (strcmp (eavesdrop, "true") == 0);
-
- if (log)
- rule->d.send.log = (strcmp (log, "true") == 0);
-
- if (send_requested_reply)
- rule->d.send.requested_reply = (strcmp (send_requested_reply, "true") == 0);
-
- rule->d.send.message_type = message_type;
- rule->d.send.path = _dbus_strdup (send_path);
- rule->d.send.interface = _dbus_strdup (send_interface);
- rule->d.send.member = _dbus_strdup (send_member);
- rule->d.send.error = _dbus_strdup (send_error);
- rule->d.send.destination = _dbus_strdup (send_destination);
- if (send_path && rule->d.send.path == NULL)
- goto nomem;
- if (send_interface && rule->d.send.interface == NULL)
- goto nomem;
- if (send_member && rule->d.send.member == NULL)
- goto nomem;
- if (send_error && rule->d.send.error == NULL)
- goto nomem;
- if (send_destination && rule->d.send.destination == NULL)
- goto nomem;
- }
- else if (receive_interface || receive_member || receive_error || receive_sender ||
- receive_path || receive_type || eavesdrop || receive_requested_reply)
- {
- int message_type;
-
- if (IS_WILDCARD (receive_interface))
- receive_interface = NULL;
- if (IS_WILDCARD (receive_member))
- receive_member = NULL;
- if (IS_WILDCARD (receive_error))
- receive_error = NULL;
- if (IS_WILDCARD (receive_sender))
- receive_sender = NULL;
- if (IS_WILDCARD (receive_path))
- receive_path = NULL;
- if (IS_WILDCARD (receive_type))
- receive_type = NULL;
-
- message_type = DBUS_MESSAGE_TYPE_INVALID;
- if (receive_type != NULL)
- {
- message_type = dbus_message_type_from_string (receive_type);
- if (message_type == DBUS_MESSAGE_TYPE_INVALID)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad message type \"%s\"",
- receive_type);
- return FALSE;
- }
- }
-
-
- if (eavesdrop &&
- !(strcmp (eavesdrop, "true") == 0 ||
- strcmp (eavesdrop, "false") == 0))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad value \"%s\" for %s attribute, must be true or false",
- "eavesdrop", eavesdrop);
- return FALSE;
- }
-
- if (receive_requested_reply &&
- !(strcmp (receive_requested_reply, "true") == 0 ||
- strcmp (receive_requested_reply, "false") == 0))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Bad value \"%s\" for %s attribute, must be true or false",
- "receive_requested_reply", receive_requested_reply);
- return FALSE;
- }
-
- rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, allow);
- if (rule == NULL)
- goto nomem;
-
- if (eavesdrop)
- rule->d.receive.eavesdrop = (strcmp (eavesdrop, "true") == 0);
-
- if (receive_requested_reply)
- rule->d.receive.requested_reply = (strcmp (receive_requested_reply, "true") == 0);
-
- rule->d.receive.message_type = message_type;
- rule->d.receive.path = _dbus_strdup (receive_path);
- rule->d.receive.interface = _dbus_strdup (receive_interface);
- rule->d.receive.member = _dbus_strdup (receive_member);
- rule->d.receive.error = _dbus_strdup (receive_error);
- rule->d.receive.origin = _dbus_strdup (receive_sender);
-
- if (receive_path && rule->d.receive.path == NULL)
- goto nomem;
- if (receive_interface && rule->d.receive.interface == NULL)
- goto nomem;
- if (receive_member && rule->d.receive.member == NULL)
- goto nomem;
- if (receive_error && rule->d.receive.error == NULL)
- goto nomem;
- if (receive_sender && rule->d.receive.origin == NULL)
- goto nomem;
- }
- else if (own || own_prefix)
- {
- rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, allow);
- if (rule == NULL)
- goto nomem;
-
- if (own)
- {
- if (IS_WILDCARD (own))
- own = NULL;
-
- rule->d.own.prefix = 0;
- rule->d.own.service_name = _dbus_strdup (own);
- if (own && rule->d.own.service_name == NULL)
- goto nomem;
- }
- else
- {
- rule->d.own.prefix = 1;
- rule->d.own.service_name = _dbus_strdup (own_prefix);
- if (rule->d.own.service_name == NULL)
- goto nomem;
- }
- }
- else if (user)
- {
- if (IS_WILDCARD (user))
- {
- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow);
- if (rule == NULL)
- goto nomem;
-
- rule->d.user.uid = DBUS_UID_UNSET;
- }
- else
- {
- DBusString username;
- dbus_uid_t uid;
-
- _dbus_string_init_const (&username, user);
-
- if (_dbus_parse_unix_user_from_config (&username, &uid))
- {
- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow);
- if (rule == NULL)
- goto nomem;
-
- rule->d.user.uid = uid;
- }
- else
- {
- _dbus_warn ("Unknown username \"%s\" on element <%s>\n",
- user, element_name);
- }
- }
- }
- else if (group)
- {
- if (IS_WILDCARD (group))
- {
- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow);
- if (rule == NULL)
- goto nomem;
-
- rule->d.group.gid = DBUS_GID_UNSET;
- }
- else
- {
- DBusString groupname;
- dbus_gid_t gid;
-
- _dbus_string_init_const (&groupname, group);
-
- if (_dbus_parse_unix_group_from_config (&groupname, &gid))
- {
- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow);
- if (rule == NULL)
- goto nomem;
-
- rule->d.group.gid = gid;
- }
- else
- {
- _dbus_warn ("Unknown group \"%s\" on element <%s>\n",
- group, element_name);
- }
- }
- }
- else
- _dbus_assert_not_reached ("Did not handle some combination of attributes on <allow> or <deny>");
-
- if (rule != NULL)
- {
- Element *pe;
-
- pe = peek_element (parser);
- _dbus_assert (pe != NULL);
- _dbus_assert (pe->type == ELEMENT_POLICY);
-
- switch (pe->d.policy.type)
- {
- case POLICY_IGNORED:
- /* drop the rule on the floor */
- break;
-
- case POLICY_DEFAULT:
- if (!bus_policy_append_default_rule (parser->policy, rule))
- goto nomem;
- break;
- case POLICY_MANDATORY:
- if (!bus_policy_append_mandatory_rule (parser->policy, rule))
- goto nomem;
- break;
- case POLICY_USER:
- if (!BUS_POLICY_RULE_IS_PER_CLIENT (rule))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<%s> rule cannot be per-user because it has bus-global semantics",
- element_name);
- goto failed;
- }
-
- if (!bus_policy_append_user_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
- rule))
- goto nomem;
- break;
- case POLICY_GROUP:
- if (!BUS_POLICY_RULE_IS_PER_CLIENT (rule))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<%s> rule cannot be per-group because it has bus-global semantics",
- element_name);
- goto failed;
- }
-
- if (!bus_policy_append_group_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
- rule))
- goto nomem;
- break;
-
-
- case POLICY_CONSOLE:
- if (!bus_policy_append_console_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
- rule))
- goto nomem;
- break;
- }
-
- bus_policy_rule_unref (rule);
- rule = NULL;
- }
-
- return TRUE;
-
- nomem:
- BUS_SET_OOM (error);
- failed:
- if (rule)
- bus_policy_rule_unref (rule);
- return FALSE;
-}
-
-static dbus_bool_t
-start_policy_child (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- if (strcmp (element_name, "allow") == 0)
- {
- if (!append_rule_from_element (parser, element_name,
- attribute_names, attribute_values,
- TRUE, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_ALLOW) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else if (strcmp (element_name, "deny") == 0)
- {
- if (!append_rule_from_element (parser, element_name,
- attribute_names, attribute_values,
- FALSE, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_DENY) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> not allowed inside <%s> in configuration file",
- element_name, "policy");
- return FALSE;
- }
-}
-
-static dbus_bool_t
-start_selinux_child (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- char *own_copy;
- char *context_copy;
-
- own_copy = NULL;
- context_copy = NULL;
-
- if (strcmp (element_name, "associate") == 0)
- {
- const char *own;
- const char *context;
-
- if (!locate_attributes (parser, "associate",
- attribute_names,
- attribute_values,
- error,
- "own", &own,
- "context", &context,
- NULL))
- return FALSE;
-
- if (push_element (parser, ELEMENT_ASSOCIATE) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (own == NULL || context == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <associate> must have attributes own=\"<servicename>\" and context=\"<selinux context>\"");
- return FALSE;
- }
-
- own_copy = _dbus_strdup (own);
- if (own_copy == NULL)
- goto oom;
- context_copy = _dbus_strdup (context);
- if (context_copy == NULL)
- goto oom;
-
- if (!_dbus_hash_table_insert_string (parser->service_context_table,
- own_copy, context_copy))
- goto oom;
-
- return TRUE;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> not allowed inside <%s> in configuration file",
- element_name, "selinux");
- return FALSE;
- }
-
- oom:
- if (own_copy)
- dbus_free (own_copy);
-
- if (context_copy)
- dbus_free (context_copy);
-
- BUS_SET_OOM (error);
- return FALSE;
-}
-
-dbus_bool_t
-bus_config_parser_start_element (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error)
-{
- ElementType t;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* printf ("START: %s\n", element_name); */
-
- t = top_element_type (parser);
-
- if (t == ELEMENT_NONE)
- {
- if (strcmp (element_name, "busconfig") == 0)
- {
- if (!check_no_attributes (parser, "busconfig", attribute_names, attribute_values, error))
- return FALSE;
-
- if (push_element (parser, ELEMENT_BUSCONFIG) == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Unknown element <%s> at root of configuration file",
- element_name);
- return FALSE;
- }
- }
- else if (t == ELEMENT_BUSCONFIG)
- {
- return start_busconfig_child (parser, element_name,
- attribute_names, attribute_values,
- error);
- }
- else if (t == ELEMENT_POLICY)
- {
- return start_policy_child (parser, element_name,
- attribute_names, attribute_values,
- error);
- }
- else if (t == ELEMENT_SELINUX)
- {
- return start_selinux_child (parser, element_name,
- attribute_names, attribute_values,
- error);
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> is not allowed in this context",
- element_name);
- return FALSE;
- }
-}
-
-static dbus_bool_t
-set_limit (BusConfigParser *parser,
- const char *name,
- long value,
- DBusError *error)
-{
- dbus_bool_t must_be_positive;
- dbus_bool_t must_be_int;
-
- must_be_int = FALSE;
- must_be_positive = FALSE;
-
- if (strcmp (name, "max_incoming_bytes") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_incoming_bytes = value;
- }
- else if (strcmp (name, "max_incoming_unix_fds") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_incoming_unix_fds = value;
- }
- else if (strcmp (name, "max_outgoing_bytes") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_outgoing_bytes = value;
- }
- else if (strcmp (name, "max_outgoing_unix_fds") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_outgoing_unix_fds = value;
- }
- else if (strcmp (name, "max_message_size") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_message_size = value;
- }
- else if (strcmp (name, "max_message_unix_fds") == 0)
- {
- must_be_positive = TRUE;
- parser->limits.max_message_unix_fds = value;
- }
- else if (strcmp (name, "service_start_timeout") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.activation_timeout = value;
- }
- else if (strcmp (name, "auth_timeout") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.auth_timeout = value;
- }
- else if (strcmp (name, "reply_timeout") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.reply_timeout = value;
- }
- else if (strcmp (name, "max_completed_connections") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_completed_connections = value;
- }
- else if (strcmp (name, "max_incomplete_connections") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_incomplete_connections = value;
- }
- else if (strcmp (name, "max_connections_per_user") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_connections_per_user = value;
- }
- else if (strcmp (name, "max_pending_service_starts") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_pending_activations = value;
- }
- else if (strcmp (name, "max_names_per_connection") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_services_per_connection = value;
- }
- else if (strcmp (name, "max_match_rules_per_connection") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_match_rules_per_connection = value;
- }
- else if (strcmp (name, "max_replies_per_connection") == 0)
- {
- must_be_positive = TRUE;
- must_be_int = TRUE;
- parser->limits.max_replies_per_connection = value;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "There is no limit called \"%s\"\n",
- name);
- return FALSE;
- }
-
- if (must_be_positive && value < 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<limit name=\"%s\"> must be a positive number\n",
- name);
- return FALSE;
- }
-
- if (must_be_int &&
- (value < _DBUS_INT_MIN || value > _DBUS_INT_MAX))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<limit name=\"%s\"> value is too large\n",
- name);
- return FALSE;
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_config_parser_end_element (BusConfigParser *parser,
- const char *element_name,
- DBusError *error)
-{
- ElementType t;
- const char *n;
- Element *e;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* printf ("END: %s\n", element_name); */
-
- t = top_element_type (parser);
-
- if (t == ELEMENT_NONE)
- {
- /* should probably be an assertion failure but
- * being paranoid about XML parsers
- */
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "XML parser ended element with no element on the stack");
- return FALSE;
- }
-
- n = bus_config_parser_element_type_to_name (t);
- _dbus_assert (n != NULL);
- if (strcmp (n, element_name) != 0)
- {
- /* should probably be an assertion failure but
- * being paranoid about XML parsers
- */
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "XML element <%s> ended but topmost element on the stack was <%s>",
- element_name, n);
- return FALSE;
- }
-
- e = peek_element (parser);
- _dbus_assert (e != NULL);
-
- switch (e->type)
- {
- case ELEMENT_NONE:
- _dbus_assert_not_reached ("element in stack has no type");
- break;
-
- case ELEMENT_INCLUDE:
- case ELEMENT_USER:
- case ELEMENT_CONFIGTYPE:
- case ELEMENT_LISTEN:
- case ELEMENT_PIDFILE:
- case ELEMENT_AUTH:
- case ELEMENT_SERVICEDIR:
- case ELEMENT_SERVICEHELPER:
- case ELEMENT_INCLUDEDIR:
- case ELEMENT_LIMIT:
- if (!e->had_content)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "XML element <%s> was expected to have content inside it",
- bus_config_parser_element_type_to_name (e->type));
- return FALSE;
- }
-
- if (e->type == ELEMENT_LIMIT)
- {
- if (!set_limit (parser, e->d.limit.name, e->d.limit.value,
- error))
- return FALSE;
- }
- break;
-
- case ELEMENT_BUSCONFIG:
- case ELEMENT_POLICY:
- case ELEMENT_ALLOW:
- case ELEMENT_DENY:
- case ELEMENT_FORK:
- case ELEMENT_SYSLOG:
- case ELEMENT_KEEP_UMASK:
- case ELEMENT_SELINUX:
- case ELEMENT_ASSOCIATE:
- case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
- case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
- case ELEMENT_ALLOW_ANONYMOUS:
- break;
- }
-
- pop_element (parser);
-
- return TRUE;
-}
-
-static dbus_bool_t
-all_whitespace (const DBusString *str)
-{
- int i;
-
- _dbus_string_skip_white (str, 0, &i);
-
- return i == _dbus_string_get_length (str);
-}
-
-static dbus_bool_t
-make_full_path (const DBusString *basedir,
- const DBusString *filename,
- DBusString *full_path)
-{
- if (_dbus_path_is_absolute (filename))
- {
- return _dbus_string_copy (filename, 0, full_path, 0);
- }
- else
- {
- if (!_dbus_string_copy (basedir, 0, full_path, 0))
- return FALSE;
-
- if (!_dbus_concat_dir_and_file (full_path, filename))
- return FALSE;
-
- return TRUE;
- }
-}
-
-static dbus_bool_t
-include_file (BusConfigParser *parser,
- const DBusString *filename,
- dbus_bool_t ignore_missing,
- DBusError *error)
-{
- /* FIXME good test case for this would load each config file in the
- * test suite both alone, and as an include, and check
- * that the result is the same
- */
- BusConfigParser *included;
- const char *filename_str;
- DBusError tmp_error;
-
- dbus_error_init (&tmp_error);
-
- filename_str = _dbus_string_get_const_data (filename);
-
- /* Check to make sure this file hasn't already been included. */
- if (seen_include (parser, filename))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Circular inclusion of file '%s'",
- filename_str);
- return FALSE;
- }
-
- if (! _dbus_list_append (&parser->included_files, (void *) filename_str))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* Since parser is passed in as the parent, included
- inherits parser's limits. */
- included = bus_config_load (filename, FALSE, parser, &tmp_error);
-
- _dbus_list_pop_last (&parser->included_files);
-
- if (included == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
-
- if (dbus_error_has_name (&tmp_error, DBUS_ERROR_FILE_NOT_FOUND) &&
- ignore_missing)
- {
- dbus_error_free (&tmp_error);
- return TRUE;
- }
- else
- {
- dbus_move_error (&tmp_error, error);
- return FALSE;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- if (!merge_included (parser, included, error))
- {
- bus_config_parser_unref (included);
- return FALSE;
- }
-
- /* Copy included's limits back to parser. */
- parser->limits = included->limits;
-
- bus_config_parser_unref (included);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-servicehelper_path (BusConfigParser *parser,
- const DBusString *filename,
- DBusError *error)
-{
- const char *filename_str;
- char *servicehelper;
-
- filename_str = _dbus_string_get_const_data (filename);
-
- /* copy to avoid overwriting with NULL on OOM */
- servicehelper = _dbus_strdup (filename_str);
-
- /* check for OOM */
- if (servicehelper == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* save the latest servicehelper only if not OOM */
- dbus_free (parser->servicehelper);
- parser->servicehelper = servicehelper;
-
- /* We don't check whether the helper exists; instead we
- * would just fail to ever activate anything if it doesn't.
- * This allows an admin to fix the problem if it doesn't exist.
- * It also allows the parser test suite to successfully parse
- * test cases without installing the helper. ;-)
- */
-
- return TRUE;
-}
-
-static dbus_bool_t
-include_dir (BusConfigParser *parser,
- const DBusString *dirname,
- DBusError *error)
-{
- DBusString filename;
- dbus_bool_t retval;
- DBusError tmp_error;
- DBusDirIter *dir;
- char *s;
-
- if (!_dbus_string_init (&filename))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- retval = FALSE;
-
- dir = _dbus_directory_open (dirname, error);
-
- if (dir == NULL)
- goto failed;
-
- dbus_error_init (&tmp_error);
- while (_dbus_directory_get_next_file (dir, &filename, &tmp_error))
- {
- DBusString full_path;
-
- if (!_dbus_string_init (&full_path))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!_dbus_string_copy (dirname, 0, &full_path, 0))
- {
- BUS_SET_OOM (error);
- _dbus_string_free (&full_path);
- goto failed;
- }
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- {
- BUS_SET_OOM (error);
- _dbus_string_free (&full_path);
- goto failed;
- }
-
- if (_dbus_string_ends_with_c_str (&full_path, ".conf"))
- {
- if (!include_file (parser, &full_path, TRUE, error))
- {
- if (dbus_error_is_set (error))
- {
- /* We log to syslog unconditionally here, because this is
- * the configuration parser, so we don't yet know whether
- * this bus is going to want to write to syslog! (There's
- * also some layer inversion going on, if we want to use
- * the bus context.) */
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO,
- "Encountered error '%s' while parsing '%s'\n",
- error->message,
- _dbus_string_get_const_data (&full_path));
- dbus_error_free (error);
- }
- }
- }
-
- _dbus_string_free (&full_path);
- }
-
- if (dbus_error_is_set (&tmp_error))
- {
- dbus_move_error (&tmp_error, error);
- goto failed;
- }
-
-
- if (!_dbus_string_copy_data (dirname, &s))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!_dbus_list_append (&parser->conf_dirs, s))
- {
- dbus_free (s);
- BUS_SET_OOM (error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
- _dbus_string_free (&filename);
-
- if (dir)
- _dbus_directory_close (dir);
-
- return retval;
-}
-
-dbus_bool_t
-bus_config_parser_content (BusConfigParser *parser,
- const DBusString *content,
- DBusError *error)
-{
- Element *e;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-#if 0
- {
- const char *c_str;
-
- _dbus_string_get_const_data (content, &c_str);
-
- printf ("CONTENT %d bytes: %s\n", _dbus_string_get_length (content), c_str);
- }
-#endif
-
- e = peek_element (parser);
- if (e == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Text content outside of any XML element in configuration file");
- return FALSE;
- }
- else if (e->had_content)
- {
- _dbus_assert_not_reached ("Element had multiple content blocks");
- return FALSE;
- }
-
- switch (top_element_type (parser))
- {
- case ELEMENT_NONE:
- _dbus_assert_not_reached ("element at top of stack has no type");
- return FALSE;
-
- case ELEMENT_BUSCONFIG:
- case ELEMENT_POLICY:
- case ELEMENT_ALLOW:
- case ELEMENT_DENY:
- case ELEMENT_FORK:
- case ELEMENT_SYSLOG:
- case ELEMENT_KEEP_UMASK:
- case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
- case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
- case ELEMENT_ALLOW_ANONYMOUS:
- case ELEMENT_SELINUX:
- case ELEMENT_ASSOCIATE:
- if (all_whitespace (content))
- return TRUE;
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "No text content expected inside XML element %s in configuration file",
- bus_config_parser_element_type_to_name (top_element_type (parser)));
- return FALSE;
- }
-
- case ELEMENT_PIDFILE:
- {
- char *s;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_copy_data (content, &s))
- goto nomem;
-
- dbus_free (parser->pidfile);
- parser->pidfile = s;
- }
- break;
-
- case ELEMENT_INCLUDE:
- {
- DBusString full_path, selinux_policy_root;
-
- e->had_content = TRUE;
-
- if (e->d.include.if_selinux_enabled
- && !bus_selinux_enabled ())
- break;
-
- if (!_dbus_string_init (&full_path))
- goto nomem;
-
- if (e->d.include.selinux_root_relative)
- {
- if (!bus_selinux_get_policy_root ())
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Could not determine SELinux policy root for relative inclusion");
- _dbus_string_free (&full_path);
- return FALSE;
- }
- _dbus_string_init_const (&selinux_policy_root,
- bus_selinux_get_policy_root ());
- if (!make_full_path (&selinux_policy_root, content, &full_path))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
- }
- else if (!make_full_path (&parser->basedir, content, &full_path))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
-
- if (!include_file (parser, &full_path,
- e->d.include.ignore_missing, error))
- {
- _dbus_string_free (&full_path);
- return FALSE;
- }
-
- _dbus_string_free (&full_path);
- }
- break;
-
- case ELEMENT_SERVICEHELPER:
- {
- DBusString full_path;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_init (&full_path))
- goto nomem;
-
- if (!make_full_path (&parser->basedir, content, &full_path))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
-
- if (!servicehelper_path (parser, &full_path, error))
- {
- _dbus_string_free (&full_path);
- return FALSE;
- }
-
- _dbus_string_free (&full_path);
- }
- break;
-
- case ELEMENT_INCLUDEDIR:
- {
- DBusString full_path;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_init (&full_path))
- goto nomem;
-
- if (!make_full_path (&parser->basedir, content, &full_path))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
-
- if (!include_dir (parser, &full_path, error))
- {
- _dbus_string_free (&full_path);
- return FALSE;
- }
-
- _dbus_string_free (&full_path);
- }
- break;
-
- case ELEMENT_USER:
- {
- char *s;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_copy_data (content, &s))
- goto nomem;
-
- dbus_free (parser->user);
- parser->user = s;
- }
- break;
-
- case ELEMENT_CONFIGTYPE:
- {
- char *s;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_copy_data (content, &s))
- goto nomem;
-
- dbus_free (parser->bus_type);
- parser->bus_type = s;
- }
- break;
-
- case ELEMENT_LISTEN:
- {
- char *s;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_copy_data (content, &s))
- goto nomem;
-
- if (!_dbus_list_append (&parser->listen_on,
- s))
- {
- dbus_free (s);
- goto nomem;
- }
- }
- break;
-
- case ELEMENT_AUTH:
- {
- char *s;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_copy_data (content, &s))
- goto nomem;
-
- if (!_dbus_list_append (&parser->mechanisms,
- s))
- {
- dbus_free (s);
- goto nomem;
- }
- }
- break;
-
- case ELEMENT_SERVICEDIR:
- {
- char *s;
- DBusString full_path;
-
- e->had_content = TRUE;
-
- if (!_dbus_string_init (&full_path))
- goto nomem;
-
- if (!make_full_path (&parser->basedir, content, &full_path))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
-
- if (!_dbus_string_copy_data (&full_path, &s))
- {
- _dbus_string_free (&full_path);
- goto nomem;
- }
-
- /* _only_ extra session directories can be specified */
- if (!service_dirs_append_unique_or_free (&parser->service_dirs, s))
- {
- _dbus_string_free (&full_path);
- dbus_free (s);
- goto nomem;
- }
-
- _dbus_string_free (&full_path);
- }
- break;
-
- case ELEMENT_LIMIT:
- {
- long val;
-
- e->had_content = TRUE;
-
- val = 0;
- if (!_dbus_string_parse_int (content, 0, &val, NULL))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "<limit name=\"%s\"> element has invalid value (could not parse as integer)",
- e->d.limit.name);
- return FALSE;
- }
-
- e->d.limit.value = val;
-
- _dbus_verbose ("Loaded value %ld for limit %s\n",
- e->d.limit.value,
- e->d.limit.name);
- }
- break;
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return TRUE;
-
- nomem:
- BUS_SET_OOM (error);
- return FALSE;
-}
-
-dbus_bool_t
-bus_config_parser_finished (BusConfigParser *parser,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (parser->stack != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Element <%s> was not closed in configuration file",
- bus_config_parser_element_type_to_name (top_element_type (parser)));
-
- return FALSE;
- }
-
- if (parser->is_toplevel && parser->listen_on == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Configuration file needs one or more <listen> elements giving addresses");
- return FALSE;
- }
-
- return TRUE;
-}
-
-const char*
-bus_config_parser_get_user (BusConfigParser *parser)
-{
- return parser->user;
-}
-
-const char*
-bus_config_parser_get_type (BusConfigParser *parser)
-{
- return parser->bus_type;
-}
-
-DBusList**
-bus_config_parser_get_addresses (BusConfigParser *parser)
-{
- return &parser->listen_on;
-}
-
-DBusList**
-bus_config_parser_get_mechanisms (BusConfigParser *parser)
-{
- return &parser->mechanisms;
-}
-
-DBusList**
-bus_config_parser_get_service_dirs (BusConfigParser *parser)
-{
- return &parser->service_dirs;
-}
-
-DBusList**
-bus_config_parser_get_conf_dirs (BusConfigParser *parser)
-{
- return &parser->conf_dirs;
-}
-
-dbus_bool_t
-bus_config_parser_get_fork (BusConfigParser *parser)
-{
- return parser->fork;
-}
-
-dbus_bool_t
-bus_config_parser_get_syslog (BusConfigParser *parser)
-{
- return parser->syslog;
-}
-
-dbus_bool_t
-bus_config_parser_get_keep_umask (BusConfigParser *parser)
-{
- return parser->keep_umask;
-}
-
-dbus_bool_t
-bus_config_parser_get_allow_anonymous (BusConfigParser *parser)
-{
- return parser->allow_anonymous;
-}
-
-const char *
-bus_config_parser_get_pidfile (BusConfigParser *parser)
-{
- return parser->pidfile;
-}
-
-const char *
-bus_config_parser_get_servicehelper (BusConfigParser *parser)
-{
- return parser->servicehelper;
-}
-
-BusPolicy*
-bus_config_parser_steal_policy (BusConfigParser *parser)
-{
- BusPolicy *policy;
-
- _dbus_assert (parser->policy != NULL); /* can only steal the policy 1 time */
-
- policy = parser->policy;
-
- parser->policy = NULL;
-
- return policy;
-}
-
-/* Overwrite any limits that were set in the configuration file */
-void
-bus_config_parser_get_limits (BusConfigParser *parser,
- BusLimits *limits)
-{
- *limits = parser->limits;
-}
-
-DBusHashTable*
-bus_config_parser_steal_service_context_table (BusConfigParser *parser)
-{
- DBusHashTable *table;
-
- _dbus_assert (parser->service_context_table != NULL); /* can only steal once */
-
- table = parser->service_context_table;
-
- parser->service_context_table = NULL;
-
- return table;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include <stdio.h>
-
-typedef enum
-{
- VALID,
- INVALID,
- UNKNOWN
-} Validity;
-
-static dbus_bool_t
-do_check_own_rules (BusPolicy *policy)
-{
- const struct {
- char *name;
- dbus_bool_t allowed;
- } checks[] = {
- {"org.freedesktop", FALSE},
- {"org.freedesktop.ManySystem", FALSE},
- {"org.freedesktop.ManySystems", TRUE},
- {"org.freedesktop.ManySystems.foo", TRUE},
- {"org.freedesktop.ManySystems.foo.bar", TRUE},
- {"org.freedesktop.ManySystems2", FALSE},
- {"org.freedesktop.ManySystems2.foo", FALSE},
- {"org.freedesktop.ManySystems2.foo.bar", FALSE},
- {NULL, FALSE}
- };
- int i = 0;
-
- while (checks[i].name)
- {
- DBusString service_name;
- dbus_bool_t ret;
-
- if (!_dbus_string_init (&service_name))
- _dbus_assert_not_reached ("couldn't init string");
- if (!_dbus_string_append (&service_name, checks[i].name))
- _dbus_assert_not_reached ("couldn't append string");
-
- ret = bus_policy_check_can_own (policy, &service_name);
- printf (" Check name %s: %s\n", checks[i].name,
- ret ? "allowed" : "not allowed");
- if (checks[i].allowed && !ret)
- {
- _dbus_warn ("Cannot own %s\n", checks[i].name);
- return FALSE;
- }
- if (!checks[i].allowed && ret)
- {
- _dbus_warn ("Can own %s\n", checks[i].name);
- return FALSE;
- }
- _dbus_string_free (&service_name);
-
- i++;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-do_load (const DBusString *full_path,
- Validity validity,
- dbus_bool_t oom_possible,
- dbus_bool_t check_own_rules)
-{
- BusConfigParser *parser;
- DBusError error;
-
- dbus_error_init (&error);
-
- parser = bus_config_load (full_path, TRUE, NULL, &error);
- if (parser == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
-
- if (oom_possible &&
- dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("Failed to load valid file due to OOM\n");
- dbus_error_free (&error);
- return TRUE;
- }
- else if (validity == VALID)
- {
- _dbus_warn ("Failed to load valid file but still had memory: %s\n",
- error.message);
-
- dbus_error_free (&error);
- return FALSE;
- }
- else
- {
- dbus_error_free (&error);
- return TRUE;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
-
- if (check_own_rules && do_check_own_rules (parser->policy) == FALSE)
- {
- return FALSE;
- }
-
- bus_config_parser_unref (parser);
-
- if (validity == INVALID)
- {
- _dbus_warn ("Accepted invalid file\n");
- return FALSE;
- }
-
- return TRUE;
- }
-}
-
-typedef struct
-{
- const DBusString *full_path;
- Validity validity;
- dbus_bool_t check_own_rules;
-} LoaderOomData;
-
-static dbus_bool_t
-check_loader_oom_func (void *data)
-{
- LoaderOomData *d = data;
-
- return do_load (d->full_path, d->validity, TRUE, d->check_own_rules);
-}
-
-static dbus_bool_t
-process_test_valid_subdir (const DBusString *test_base_dir,
- const char *subdir,
- Validity validity)
-{
- DBusString test_directory;
- DBusString filename;
- DBusDirIter *dir;
- dbus_bool_t retval;
- DBusError error;
-
- retval = FALSE;
- dir = NULL;
-
- if (!_dbus_string_init (&test_directory))
- _dbus_assert_not_reached ("didn't allocate test_directory\n");
-
- _dbus_string_init_const (&filename, subdir);
-
- if (!_dbus_string_copy (test_base_dir, 0,
- &test_directory, 0))
- _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
-
- if (!_dbus_concat_dir_and_file (&test_directory, &filename))
- _dbus_assert_not_reached ("couldn't allocate full path");
-
- _dbus_string_free (&filename);
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string\n");
-
- dbus_error_init (&error);
- dir = _dbus_directory_open (&test_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- if (validity == VALID)
- printf ("Testing valid files:\n");
- else if (validity == INVALID)
- printf ("Testing invalid files:\n");
- else
- printf ("Testing unknown files:\n");
-
- next:
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
- LoaderOomData d;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
- {
- _dbus_verbose ("Skipping non-.conf file %s\n",
- _dbus_string_get_const_data (&filename));
- _dbus_string_free (&full_path);
- goto next;
- }
-
- printf (" %s\n", _dbus_string_get_const_data (&filename));
-
- _dbus_verbose (" expecting %s\n",
- validity == VALID ? "valid" :
- (validity == INVALID ? "invalid" :
- (validity == UNKNOWN ? "unknown" : "???")));
-
- d.full_path = &full_path;
- d.validity = validity;
- d.check_own_rules = _dbus_string_ends_with_c_str (&full_path,
- "check-own-rules.conf");
-
- /* FIXME hackaround for an expat problem, see
- * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124747
- * http://freedesktop.org/pipermail/dbus/2004-May/001153.html
- */
- /* if (!_dbus_test_oom_handling ("config-loader", check_loader_oom_func, &d)) */
- if (!check_loader_oom_func (&d))
- _dbus_assert_not_reached ("test failed");
-
- _dbus_string_free (&full_path);
- }
-
- if (dbus_error_is_set (&error))
- {
- _dbus_warn ("Could not get next file in %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
-
- if (dir)
- _dbus_directory_close (dir);
- _dbus_string_free (&test_directory);
- _dbus_string_free (&filename);
-
- return retval;
-}
-
-static dbus_bool_t
-bools_equal (dbus_bool_t a,
- dbus_bool_t b)
-{
- return a ? b : !b;
-}
-
-static dbus_bool_t
-strings_equal_or_both_null (const char *a,
- const char *b)
-{
- if (a == NULL || b == NULL)
- return a == b;
- else
- return !strcmp (a, b);
-}
-
-static dbus_bool_t
-elements_equal (const Element *a,
- const Element *b)
-{
- if (a->type != b->type)
- return FALSE;
-
- if (!bools_equal (a->had_content, b->had_content))
- return FALSE;
-
- switch (a->type)
- {
-
- case ELEMENT_INCLUDE:
- if (!bools_equal (a->d.include.ignore_missing,
- b->d.include.ignore_missing))
- return FALSE;
- break;
-
- case ELEMENT_POLICY:
- if (a->d.policy.type != b->d.policy.type)
- return FALSE;
- if (a->d.policy.gid_uid_or_at_console != b->d.policy.gid_uid_or_at_console)
- return FALSE;
- break;
-
- case ELEMENT_LIMIT:
- if (strcmp (a->d.limit.name, b->d.limit.name))
- return FALSE;
- if (a->d.limit.value != b->d.limit.value)
- return FALSE;
- break;
-
- default:
- /* do nothing */
- break;
- }
-
- return TRUE;
-
-}
-
-static dbus_bool_t
-lists_of_elements_equal (DBusList *a,
- DBusList *b)
-{
- DBusList *ia;
- DBusList *ib;
-
- ia = a;
- ib = b;
-
- while (ia != NULL && ib != NULL)
- {
- if (elements_equal (ia->data, ib->data))
- return FALSE;
- ia = _dbus_list_get_next_link (&a, ia);
- ib = _dbus_list_get_next_link (&b, ib);
- }
-
- return ia == NULL && ib == NULL;
-}
-
-static dbus_bool_t
-lists_of_c_strings_equal (DBusList *a,
- DBusList *b)
-{
- DBusList *ia;
- DBusList *ib;
-
- ia = a;
- ib = b;
-
- while (ia != NULL && ib != NULL)
- {
- if (strcmp (ia->data, ib->data))
- return FALSE;
- ia = _dbus_list_get_next_link (&a, ia);
- ib = _dbus_list_get_next_link (&b, ib);
- }
-
- return ia == NULL && ib == NULL;
-}
-
-static dbus_bool_t
-limits_equal (const BusLimits *a,
- const BusLimits *b)
-{
- return
- (a->max_incoming_bytes == b->max_incoming_bytes
- || a->max_incoming_unix_fds == b->max_incoming_unix_fds
- || a->max_outgoing_bytes == b->max_outgoing_bytes
- || a->max_outgoing_unix_fds == b->max_outgoing_unix_fds
- || a->max_message_size == b->max_message_size
- || a->max_message_unix_fds == b->max_message_unix_fds
- || a->activation_timeout == b->activation_timeout
- || a->auth_timeout == b->auth_timeout
- || a->max_completed_connections == b->max_completed_connections
- || a->max_incomplete_connections == b->max_incomplete_connections
- || a->max_connections_per_user == b->max_connections_per_user
- || a->max_pending_activations == b->max_pending_activations
- || a->max_services_per_connection == b->max_services_per_connection
- || a->max_match_rules_per_connection == b->max_match_rules_per_connection
- || a->max_replies_per_connection == b->max_replies_per_connection
- || a->reply_timeout == b->reply_timeout);
-}
-
-static dbus_bool_t
-config_parsers_equal (const BusConfigParser *a,
- const BusConfigParser *b)
-{
- if (!_dbus_string_equal (&a->basedir, &b->basedir))
- return FALSE;
-
- if (!lists_of_elements_equal (a->stack, b->stack))
- return FALSE;
-
- if (!strings_equal_or_both_null (a->user, b->user))
- return FALSE;
-
- if (!lists_of_c_strings_equal (a->listen_on, b->listen_on))
- return FALSE;
-
- if (!lists_of_c_strings_equal (a->mechanisms, b->mechanisms))
- return FALSE;
-
- if (!lists_of_c_strings_equal (a->service_dirs, b->service_dirs))
- return FALSE;
-
- /* FIXME: compare policy */
-
- /* FIXME: compare service selinux ID table */
-
- if (! limits_equal (&a->limits, &b->limits))
- return FALSE;
-
- if (!strings_equal_or_both_null (a->pidfile, b->pidfile))
- return FALSE;
-
- if (! bools_equal (a->fork, b->fork))
- return FALSE;
-
- if (! bools_equal (a->keep_umask, b->keep_umask))
- return FALSE;
-
- if (! bools_equal (a->is_toplevel, b->is_toplevel))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-all_are_equiv (const DBusString *target_directory)
-{
- DBusString filename;
- DBusDirIter *dir;
- BusConfigParser *first_parser;
- BusConfigParser *parser;
- DBusError error;
- dbus_bool_t equal;
- dbus_bool_t retval;
-
- dir = NULL;
- first_parser = NULL;
- parser = NULL;
- retval = FALSE;
-
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string");
-
- dbus_error_init (&error);
- dir = _dbus_directory_open (target_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (target_directory),
- error.message);
- dbus_error_free (&error);
- goto finished;
- }
-
- printf ("Comparing equivalent files:\n");
-
- next:
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (target_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
- {
- _dbus_verbose ("Skipping non-.conf file %s\n",
- _dbus_string_get_const_data (&filename));
- _dbus_string_free (&full_path);
- goto next;
- }
-
- printf (" %s\n", _dbus_string_get_const_data (&filename));
-
- parser = bus_config_load (&full_path, TRUE, NULL, &error);
-
- if (parser == NULL)
- {
- _dbus_warn ("Could not load file %s: %s\n",
- _dbus_string_get_const_data (&full_path),
- error.message);
- _dbus_string_free (&full_path);
- dbus_error_free (&error);
- goto finished;
- }
- else if (first_parser == NULL)
- {
- _dbus_string_free (&full_path);
- first_parser = parser;
- }
- else
- {
- _dbus_string_free (&full_path);
- equal = config_parsers_equal (first_parser, parser);
- bus_config_parser_unref (parser);
- if (! equal)
- goto finished;
- }
- }
-
- retval = TRUE;
-
- finished:
- _dbus_string_free (&filename);
- if (first_parser)
- bus_config_parser_unref (first_parser);
- if (dir)
- _dbus_directory_close (dir);
-
- return retval;
-
-}
-
-static dbus_bool_t
-process_test_equiv_subdir (const DBusString *test_base_dir,
- const char *subdir)
-{
- DBusString test_directory;
- DBusString filename;
- DBusDirIter *dir;
- DBusError error;
- dbus_bool_t equal;
- dbus_bool_t retval;
-
- dir = NULL;
- retval = FALSE;
-
- if (!_dbus_string_init (&test_directory))
- _dbus_assert_not_reached ("didn't allocate test_directory");
-
- _dbus_string_init_const (&filename, subdir);
-
- if (!_dbus_string_copy (test_base_dir, 0,
- &test_directory, 0))
- _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
-
- if (!_dbus_concat_dir_and_file (&test_directory, &filename))
- _dbus_assert_not_reached ("couldn't allocate full path");
-
- _dbus_string_free (&filename);
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string");
-
- dbus_error_init (&error);
- dir = _dbus_directory_open (&test_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto finished;
- }
-
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
-
- /* Skip CVS's magic directories! */
- if (_dbus_string_equal_c_str (&filename, "CVS"))
- continue;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- equal = all_are_equiv (&full_path);
- _dbus_string_free (&full_path);
-
- if (!equal)
- goto finished;
- }
-
- retval = TRUE;
-
- finished:
- _dbus_string_free (&test_directory);
- _dbus_string_free (&filename);
- if (dir)
- _dbus_directory_close (dir);
-
- return retval;
-
-}
-
-static const char *test_session_service_dir_matches[] =
- {
-#ifdef DBUS_UNIX
- "/testhome/foo/.testlocal/testshare/dbus-1/services",
- "/testusr/testlocal/testshare/dbus-1/services",
- "/testusr/testshare/dbus-1/services",
- DBUS_DATADIR"/dbus-1/services",
-#endif
-/* will be filled in test_default_session_servicedirs() */
-#ifdef DBUS_WIN
- NULL,
- NULL,
-#endif
- NULL
- };
-
-static dbus_bool_t
-test_default_session_servicedirs (void)
-{
- DBusList *dirs;
- DBusList *link;
- DBusString progs;
- int i;
-
-#ifdef DBUS_WIN
- const char *common_progs;
- char buffer[1024];
-
- if (_dbus_get_install_root(buffer, sizeof(buffer)))
- {
- strcat(buffer,DBUS_DATADIR);
- strcat(buffer,"/dbus-1/services");
- test_session_service_dir_matches[0] = buffer;
- }
-#endif
-
- /* On Unix we don't actually use this variable, but it's easier to handle the
- * deallocation if we always allocate it, whether needed or not */
- if (!_dbus_string_init (&progs))
- _dbus_assert_not_reached ("OOM allocating progs");
-
-#ifndef DBUS_UNIX
- common_progs = _dbus_getenv ("CommonProgramFiles");
-
- if (common_progs)
- {
- if (!_dbus_string_append (&progs, common_progs))
- {
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- if (!_dbus_string_append (&progs, "/dbus-1/services"))
- {
- _dbus_string_free (&progs);
- return FALSE;
- }
- test_session_service_dir_matches[1] = _dbus_string_get_const_data(&progs);
- }
-#endif
- dirs = NULL;
-
- printf ("Testing retrieving the default session service directories\n");
- if (!_dbus_get_standard_session_servicedirs (&dirs))
- _dbus_assert_not_reached ("couldn't get stardard dirs");
-
- /* make sure our defaults end with share/dbus-1/service */
- while ((link = _dbus_list_pop_first_link (&dirs)))
- {
- DBusString path;
-
- printf (" default service dir: %s\n", (char *)link->data);
- _dbus_string_init_const (&path, (char *)link->data);
- if (!_dbus_string_ends_with_c_str (&path, "dbus-1/services"))
- {
- printf ("error with default session service directories\n");
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
- }
-
-#ifdef DBUS_UNIX
- if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
- _dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME");
-
- if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
- _dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS");
-#endif
- if (!_dbus_get_standard_session_servicedirs (&dirs))
- _dbus_assert_not_reached ("couldn't get stardard dirs");
-
- /* make sure we read and parse the env variable correctly */
- i = 0;
- while ((link = _dbus_list_pop_first_link (&dirs)))
- {
- printf (" test service dir: %s\n", (char *)link->data);
- if (test_session_service_dir_matches[i] == NULL)
- {
- printf ("more directories parsed than in match set\n");
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- if (strcmp (test_session_service_dir_matches[i],
- (char *)link->data) != 0)
- {
- printf ("%s directory does not match %s in the match set\n",
- (char *)link->data,
- test_session_service_dir_matches[i]);
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- ++i;
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
- }
-
- if (test_session_service_dir_matches[i] != NULL)
- {
- printf ("extra data %s in the match set was not matched\n",
- test_session_service_dir_matches[i]);
-
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- _dbus_string_free (&progs);
- return TRUE;
-}
-
-static const char *test_system_service_dir_matches[] =
- {
-#ifdef DBUS_UNIX
- "/usr/local/share/dbus-1/system-services",
- "/usr/share/dbus-1/system-services",
-#endif
- DBUS_DATADIR"/dbus-1/system-services",
-#ifdef DBUS_UNIX
- "/lib/dbus-1/system-services",
-#endif
-
-#ifdef DBUS_WIN
- NULL,
-#endif
- NULL
- };
-
-static dbus_bool_t
-test_default_system_servicedirs (void)
-{
- DBusList *dirs;
- DBusList *link;
- DBusString progs;
-#ifndef DBUS_UNIX
- const char *common_progs;
-#endif
- int i;
-
- /* On Unix we don't actually use this variable, but it's easier to handle the
- * deallocation if we always allocate it, whether needed or not */
- if (!_dbus_string_init (&progs))
- _dbus_assert_not_reached ("OOM allocating progs");
-
-#ifndef DBUS_UNIX
- common_progs = _dbus_getenv ("CommonProgramFiles");
-
- if (common_progs)
- {
- if (!_dbus_string_append (&progs, common_progs))
- {
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- if (!_dbus_string_append (&progs, "/dbus-1/system-services"))
- {
- _dbus_string_free (&progs);
- return FALSE;
- }
- test_system_service_dir_matches[1] = _dbus_string_get_const_data(&progs);
- }
-#endif
- dirs = NULL;
-
- printf ("Testing retrieving the default system service directories\n");
- if (!_dbus_get_standard_system_servicedirs (&dirs))
- _dbus_assert_not_reached ("couldn't get stardard dirs");
-
- /* make sure our defaults end with share/dbus-1/system-service */
- while ((link = _dbus_list_pop_first_link (&dirs)))
- {
- DBusString path;
-
- printf (" default service dir: %s\n", (char *)link->data);
- _dbus_string_init_const (&path, (char *)link->data);
- if (!_dbus_string_ends_with_c_str (&path, "dbus-1/system-services"))
- {
- printf ("error with default system service directories\n");
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
- }
-
-#ifdef DBUS_UNIX
- if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
- _dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME");
-
- if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
- _dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS");
-#endif
- if (!_dbus_get_standard_system_servicedirs (&dirs))
- _dbus_assert_not_reached ("couldn't get stardard dirs");
-
- /* make sure we read and parse the env variable correctly */
- i = 0;
- while ((link = _dbus_list_pop_first_link (&dirs)))
- {
- printf (" test service dir: %s\n", (char *)link->data);
- if (test_system_service_dir_matches[i] == NULL)
- {
- printf ("more directories parsed than in match set\n");
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- if (strcmp (test_system_service_dir_matches[i],
- (char *)link->data) != 0)
- {
- printf ("%s directory does not match %s in the match set\n",
- (char *)link->data,
- test_system_service_dir_matches[i]);
- dbus_free (link->data);
- _dbus_list_free_link (link);
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- ++i;
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
- }
-
- if (test_system_service_dir_matches[i] != NULL)
- {
- printf ("extra data %s in the match set was not matched\n",
- test_system_service_dir_matches[i]);
-
- _dbus_string_free (&progs);
- return FALSE;
- }
-
- _dbus_string_free (&progs);
- return TRUE;
-}
-
-dbus_bool_t
-bus_config_parser_test (const DBusString *test_data_dir)
-{
- if (test_data_dir == NULL ||
- _dbus_string_get_length (test_data_dir) == 0)
- {
- printf ("No test data\n");
- return TRUE;
- }
-
- if (!test_default_session_servicedirs())
- return FALSE;
-
-#ifdef DBUS_WIN
- printf("default system service dir skipped\n");
-#else
- if (!test_default_system_servicedirs())
- return FALSE;
-#endif
-
- if (!process_test_valid_subdir (test_data_dir, "valid-config-files", VALID))
- return FALSE;
-
- if (!process_test_valid_subdir (test_data_dir, "invalid-config-files", INVALID))
- return FALSE;
-
- if (!process_test_equiv_subdir (test_data_dir, "equiv-config-files"))
- return FALSE;
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/config-parser.h b/src/3rd_party/dbus-1.7.8/bus/config-parser.h
deleted file mode 100644
index ba5bf74906..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/config-parser.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-parser.h XML-library-agnostic configuration file parser
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_CONFIG_PARSER_H
-#define BUS_CONFIG_PARSER_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-hash.h>
-#include "bus.h"
-
-/* Whatever XML library we're using just pushes data into this API */
-
-typedef struct BusConfigParser BusConfigParser;
-
-BusConfigParser* bus_config_parser_new (const DBusString *basedir,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent);
-
-BusConfigParser* bus_config_parser_ref (BusConfigParser *parser);
-void bus_config_parser_unref (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_check_doctype (BusConfigParser *parser,
- const char *doctype,
- DBusError *error);
-dbus_bool_t bus_config_parser_start_element (BusConfigParser *parser,
- const char *element_name,
- const char **attribute_names,
- const char **attribute_values,
- DBusError *error);
-dbus_bool_t bus_config_parser_end_element (BusConfigParser *parser,
- const char *element_name,
- DBusError *error);
-dbus_bool_t bus_config_parser_content (BusConfigParser *parser,
- const DBusString *content,
- DBusError *error);
-dbus_bool_t bus_config_parser_finished (BusConfigParser *parser,
- DBusError *error);
-
-/* Functions for extracting the parse results */
-const char* bus_config_parser_get_user (BusConfigParser *parser);
-const char* bus_config_parser_get_type (BusConfigParser *parser);
-DBusList** bus_config_parser_get_addresses (BusConfigParser *parser);
-DBusList** bus_config_parser_get_mechanisms (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_get_fork (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_get_allow_anonymous (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_get_syslog (BusConfigParser *parser);
-dbus_bool_t bus_config_parser_get_keep_umask (BusConfigParser *parser);
-const char* bus_config_parser_get_pidfile (BusConfigParser *parser);
-const char* bus_config_parser_get_servicehelper (BusConfigParser *parser);
-DBusList** bus_config_parser_get_service_dirs (BusConfigParser *parser);
-DBusList** bus_config_parser_get_conf_dirs (BusConfigParser *parser);
-BusPolicy* bus_config_parser_steal_policy (BusConfigParser *parser);
-void bus_config_parser_get_limits (BusConfigParser *parser,
- BusLimits *limits);
-
-DBusHashTable* bus_config_parser_steal_service_context_table (BusConfigParser *parser);
-
-/* Loader functions (backended off one of the XML parsers). Returns a
- * finished ConfigParser.
- */
-BusConfigParser* bus_config_load (const DBusString *file,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent,
- DBusError *error);
-
-#endif /* BUS_CONFIG_PARSER_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/connection.c b/src/3rd_party/dbus-1.7.8/bus/connection.c
deleted file mode 100644
index fddbc78a5d..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/connection.c
+++ /dev/null
@@ -1,2387 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* connection.c Client connections
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "connection.h"
-#include "dispatch.h"
-#include "policy.h"
-#include "services.h"
-#include "utils.h"
-#include "signals.h"
-#include "expirelist.h"
-#include "selinux.h"
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-timeout.h>
-
-/* Trim executed commands to this length; we want to keep logs readable */
-#define MAX_LOG_COMMAND_LEN 50
-
-static void bus_connection_remove_transactions (DBusConnection *connection);
-
-typedef struct
-{
- BusExpireItem expire_item;
-
- DBusConnection *will_get_reply;
- DBusConnection *will_send_reply;
-
- dbus_uint32_t reply_serial;
-
-} BusPendingReply;
-
-struct BusConnections
-{
- int refcount;
- DBusList *completed; /**< List of all completed connections */
- int n_completed; /**< Length of completed list */
- DBusList *incomplete; /**< List of all not-yet-active connections */
- int n_incomplete; /**< Length of incomplete list */
- BusContext *context;
- DBusHashTable *completed_by_user; /**< Number of completed connections for each UID */
- DBusTimeout *expire_timeout; /**< Timeout for expiring incomplete connections. */
- int stamp; /**< Incrementing number */
- BusExpireList *pending_replies; /**< List of pending replies */
-
-#ifdef DBUS_ENABLE_STATS
- int total_match_rules;
- int peak_match_rules;
- int peak_match_rules_per_conn;
-
- int total_bus_names;
- int peak_bus_names;
- int peak_bus_names_per_conn;
-#endif
-};
-
-static dbus_int32_t connection_data_slot = -1;
-
-typedef struct
-{
- BusConnections *connections;
- DBusList *link_in_connection_list;
- DBusConnection *connection;
- DBusList *services_owned;
- int n_services_owned;
- DBusList *match_rules;
- int n_match_rules;
- char *name;
- DBusList *transaction_messages; /**< Stuff we need to send as part of a transaction */
- DBusMessage *oom_message;
- DBusPreallocatedSend *oom_preallocated;
- BusClientPolicy *policy;
-
- char *cached_loginfo_string;
- BusSELinuxID *selinux_id;
-
- long connection_tv_sec; /**< Time when we connected (seconds component) */
- long connection_tv_usec; /**< Time when we connected (microsec component) */
- int stamp; /**< connections->stamp last time we were traversed */
-
-#ifdef DBUS_ENABLE_STATS
- int peak_match_rules;
- int peak_bus_names;
-#endif
-} BusConnectionData;
-
-static dbus_bool_t bus_pending_reply_expired (BusExpireList *list,
- DBusList *link,
- void *data);
-
-static void bus_connection_drop_pending_replies (BusConnections *connections,
- DBusConnection *connection);
-
-static dbus_bool_t expire_incomplete_timeout (void *data);
-
-#define BUS_CONNECTION_DATA(connection) (dbus_connection_get_data ((connection), connection_data_slot))
-
-static DBusLoop*
-connection_get_loop (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- return bus_context_get_loop (d->connections->context);
-}
-
-
-static int
-get_connections_for_uid (BusConnections *connections,
- dbus_uid_t uid)
-{
- void *val;
- int current_count;
-
- /* val is NULL is 0 when it isn't in the hash yet */
-
- val = _dbus_hash_table_lookup_uintptr (connections->completed_by_user,
- uid);
-
- current_count = _DBUS_POINTER_TO_INT (val);
-
- return current_count;
-}
-
-static dbus_bool_t
-adjust_connections_for_uid (BusConnections *connections,
- dbus_uid_t uid,
- int adjustment)
-{
- int current_count;
-
- current_count = get_connections_for_uid (connections, uid);
-
- _dbus_verbose ("Adjusting connection count for UID " DBUS_UID_FORMAT
- ": was %d adjustment %d making %d\n",
- uid, current_count, adjustment, current_count + adjustment);
-
- _dbus_assert (current_count >= 0);
-
- current_count += adjustment;
-
- _dbus_assert (current_count >= 0);
-
- if (current_count == 0)
- {
- _dbus_hash_table_remove_uintptr (connections->completed_by_user, uid);
- return TRUE;
- }
- else
- {
- dbus_bool_t retval;
-
- retval = _dbus_hash_table_insert_uintptr (connections->completed_by_user,
- uid, _DBUS_INT_TO_POINTER (current_count));
-
- /* only positive adjustment can fail as otherwise
- * a hash entry should already exist
- */
- _dbus_assert (adjustment > 0 ||
- (adjustment <= 0 && retval));
-
- return retval;
- }
-}
-
-void
-bus_connection_disconnected (DBusConnection *connection)
-{
- BusConnectionData *d;
- BusService *service;
- BusMatchmaker *matchmaker;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- _dbus_verbose ("%s disconnected, dropping all service ownership and releasing\n",
- d->name ? d->name : "(inactive)");
-
- /* Delete our match rules */
- if (d->n_match_rules > 0)
- {
- matchmaker = bus_context_get_matchmaker (d->connections->context);
- bus_matchmaker_disconnected (matchmaker, connection);
- }
-
- /* Drop any service ownership. Unfortunately, this requires
- * memory allocation and there doesn't seem to be a good way to
- * handle it other than sleeping; we can't "fail" the operation of
- * disconnecting a client, and preallocating a broadcast "service is
- * now gone" message for every client-service pair seems kind of
- * involved.
- */
- while ((service = _dbus_list_get_last (&d->services_owned)))
- {
- BusTransaction *transaction;
- DBusError error;
-
- retry:
-
- dbus_error_init (&error);
-
- while ((transaction = bus_transaction_new (d->connections->context)) == NULL)
- _dbus_wait_for_memory ();
-
- if (!bus_service_remove_owner (service, connection,
- transaction, &error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
-
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- bus_transaction_cancel_and_free (transaction);
- _dbus_wait_for_memory ();
- goto retry;
- }
- else
- {
- _dbus_verbose ("Failed to remove service owner: %s %s\n",
- error.name, error.message);
- _dbus_assert_not_reached ("Removing service owner failed for non-memory-related reason");
- }
- }
-
- bus_transaction_execute_and_free (transaction);
- }
-
- bus_dispatch_remove_connection (connection);
-
- /* no more watching */
- if (!dbus_connection_set_watch_functions (connection,
- NULL, NULL, NULL,
- connection,
- NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
-
- if (!dbus_connection_set_timeout_functions (connection,
- NULL, NULL, NULL,
- connection,
- NULL))
- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
-
- dbus_connection_set_unix_user_function (connection,
- NULL, NULL, NULL);
- dbus_connection_set_windows_user_function (connection,
- NULL, NULL, NULL);
-
- dbus_connection_set_dispatch_status_function (connection,
- NULL, NULL, NULL);
-
- bus_connection_remove_transactions (connection);
-
- if (d->link_in_connection_list != NULL)
- {
- if (d->name != NULL)
- {
- unsigned long uid;
-
- _dbus_list_remove_link (&d->connections->completed, d->link_in_connection_list);
- d->link_in_connection_list = NULL;
- d->connections->n_completed -= 1;
-
- if (dbus_connection_get_unix_user (connection, &uid))
- {
- if (!adjust_connections_for_uid (d->connections,
- uid, -1))
- _dbus_assert_not_reached ("adjusting downward should never fail");
- }
- }
- else
- {
- _dbus_list_remove_link (&d->connections->incomplete, d->link_in_connection_list);
- d->link_in_connection_list = NULL;
- d->connections->n_incomplete -= 1;
- }
-
- _dbus_assert (d->connections->n_incomplete >= 0);
- _dbus_assert (d->connections->n_completed >= 0);
- }
-
- bus_connection_drop_pending_replies (d->connections, connection);
-
- /* frees "d" as side effect */
- dbus_connection_set_data (connection,
- connection_data_slot,
- NULL, NULL);
-
- dbus_connection_unref (connection);
-}
-
-static dbus_bool_t
-add_connection_watch (DBusWatch *watch,
- void *data)
-{
- DBusConnection *connection = data;
-
- return _dbus_loop_add_watch (connection_get_loop (connection), watch);
-}
-
-static void
-remove_connection_watch (DBusWatch *watch,
- void *data)
-{
- DBusConnection *connection = data;
-
- _dbus_loop_remove_watch (connection_get_loop (connection), watch);
-}
-
-static void
-toggle_connection_watch (DBusWatch *watch,
- void *data)
-{
- DBusConnection *connection = data;
-
- _dbus_loop_toggle_watch (connection_get_loop (connection), watch);
-}
-
-static dbus_bool_t
-add_connection_timeout (DBusTimeout *timeout,
- void *data)
-{
- DBusConnection *connection = data;
-
- return _dbus_loop_add_timeout (connection_get_loop (connection), timeout);
-}
-
-static void
-remove_connection_timeout (DBusTimeout *timeout,
- void *data)
-{
- DBusConnection *connection = data;
-
- _dbus_loop_remove_timeout (connection_get_loop (connection), timeout);
-}
-
-static void
-dispatch_status_function (DBusConnection *connection,
- DBusDispatchStatus new_status,
- void *data)
-{
- DBusLoop *loop = data;
-
- if (new_status != DBUS_DISPATCH_COMPLETE)
- {
- while (!_dbus_loop_queue_dispatch (loop, connection))
- _dbus_wait_for_memory ();
- }
-}
-
-static dbus_bool_t
-allow_unix_user_function (DBusConnection *connection,
- unsigned long uid,
- void *data)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return bus_context_allow_unix_user (d->connections->context, uid);
-}
-
-static void
-free_connection_data (void *data)
-{
- BusConnectionData *d = data;
-
- /* services_owned should be NULL since we should be disconnected */
- _dbus_assert (d->services_owned == NULL);
- _dbus_assert (d->n_services_owned == 0);
- /* similarly */
- _dbus_assert (d->transaction_messages == NULL);
-
- if (d->oom_preallocated)
- dbus_connection_free_preallocated_send (d->connection, d->oom_preallocated);
-
- if (d->oom_message)
- dbus_message_unref (d->oom_message);
-
- if (d->policy)
- bus_client_policy_unref (d->policy);
-
- if (d->selinux_id)
- bus_selinux_id_unref (d->selinux_id);
-
- dbus_free (d->cached_loginfo_string);
-
- dbus_free (d->name);
-
- dbus_free (d);
-}
-
-BusConnections*
-bus_connections_new (BusContext *context)
-{
- BusConnections *connections;
-
- if (!dbus_connection_allocate_data_slot (&connection_data_slot))
- goto failed_0;
-
- connections = dbus_new0 (BusConnections, 1);
- if (connections == NULL)
- goto failed_1;
-
- connections->completed_by_user = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL, NULL);
- if (connections->completed_by_user == NULL)
- goto failed_2;
-
- connections->expire_timeout = _dbus_timeout_new (100, /* irrelevant */
- expire_incomplete_timeout,
- connections, NULL);
- if (connections->expire_timeout == NULL)
- goto failed_3;
-
- _dbus_timeout_set_enabled (connections->expire_timeout, FALSE);
-
- connections->pending_replies = bus_expire_list_new (bus_context_get_loop (context),
- bus_context_get_reply_timeout (context),
- bus_pending_reply_expired,
- connections);
- if (connections->pending_replies == NULL)
- goto failed_4;
-
- if (!_dbus_loop_add_timeout (bus_context_get_loop (context),
- connections->expire_timeout))
- goto failed_5;
-
- connections->refcount = 1;
- connections->context = context;
-
- return connections;
-
- failed_5:
- bus_expire_list_free (connections->pending_replies);
- failed_4:
- _dbus_timeout_unref (connections->expire_timeout);
- failed_3:
- _dbus_hash_table_unref (connections->completed_by_user);
- failed_2:
- dbus_free (connections);
- failed_1:
- dbus_connection_free_data_slot (&connection_data_slot);
- failed_0:
- return NULL;
-}
-
-BusConnections *
-bus_connections_ref (BusConnections *connections)
-{
- _dbus_assert (connections->refcount > 0);
- connections->refcount += 1;
-
- return connections;
-}
-
-void
-bus_connections_unref (BusConnections *connections)
-{
- _dbus_assert (connections->refcount > 0);
- connections->refcount -= 1;
- if (connections->refcount == 0)
- {
- /* drop all incomplete */
- while (connections->incomplete != NULL)
- {
- DBusConnection *connection;
-
- connection = connections->incomplete->data;
-
- dbus_connection_ref (connection);
- dbus_connection_close (connection);
- bus_connection_disconnected (connection);
- dbus_connection_unref (connection);
- }
-
- _dbus_assert (connections->n_incomplete == 0);
-
- /* drop all real connections */
- while (connections->completed != NULL)
- {
- DBusConnection *connection;
-
- connection = connections->completed->data;
-
- dbus_connection_ref (connection);
- dbus_connection_close (connection);
- bus_connection_disconnected (connection);
- dbus_connection_unref (connection);
- }
-
- _dbus_assert (connections->n_completed == 0);
-
- bus_expire_list_free (connections->pending_replies);
-
- _dbus_loop_remove_timeout (bus_context_get_loop (connections->context),
- connections->expire_timeout);
-
- _dbus_timeout_unref (connections->expire_timeout);
-
- _dbus_hash_table_unref (connections->completed_by_user);
-
- dbus_free (connections);
-
- dbus_connection_free_data_slot (&connection_data_slot);
- }
-}
-
-/* Used for logging */
-static dbus_bool_t
-cache_peer_loginfo_string (BusConnectionData *d,
- DBusConnection *connection)
-{
- DBusString loginfo_buf;
- unsigned long uid;
- unsigned long pid;
- char *windows_sid;
- dbus_bool_t prev_added;
-
- if (!_dbus_string_init (&loginfo_buf))
- return FALSE;
-
- prev_added = FALSE;
- if (dbus_connection_get_unix_user (connection, &uid))
- {
- if (!_dbus_string_append_printf (&loginfo_buf, "uid=%ld", uid))
- goto oom;
- else
- prev_added = TRUE;
- }
-
- if (dbus_connection_get_unix_process_id (connection, &pid))
- {
- if (prev_added)
- {
- if (!_dbus_string_append_byte (&loginfo_buf, ' '))
- goto oom;
- }
- if (!_dbus_string_append_printf (&loginfo_buf, "pid=%ld comm=\"", pid))
- goto oom;
- /* Ignore errors here; we may not have permissions to read the
- * proc file. */
- _dbus_command_for_pid (pid, &loginfo_buf, MAX_LOG_COMMAND_LEN, NULL);
- if (!_dbus_string_append_byte (&loginfo_buf, '"'))
- goto oom;
- }
-
- if (dbus_connection_get_windows_user (connection, &windows_sid))
- {
- dbus_bool_t did_append;
- did_append = _dbus_string_append_printf (&loginfo_buf,
- "sid=\"%s\" ", windows_sid);
- dbus_free (windows_sid);
- if (!did_append)
- goto oom;
- }
-
- if (!_dbus_string_steal_data (&loginfo_buf, &(d->cached_loginfo_string)))
- goto oom;
-
- _dbus_string_free (&loginfo_buf);
-
- return TRUE;
-oom:
- _dbus_string_free (&loginfo_buf);
- return FALSE;
-}
-
-dbus_bool_t
-bus_connections_setup_connection (BusConnections *connections,
- DBusConnection *connection)
-{
-
- BusConnectionData *d;
- dbus_bool_t retval;
- DBusError error;
-
-
- d = dbus_new0 (BusConnectionData, 1);
-
- if (d == NULL)
- return FALSE;
-
- d->connections = connections;
- d->connection = connection;
-
- _dbus_get_monotonic_time (&d->connection_tv_sec,
- &d->connection_tv_usec);
-
- _dbus_assert (connection_data_slot >= 0);
-
- if (!dbus_connection_set_data (connection,
- connection_data_slot,
- d, free_connection_data))
- {
- dbus_free (d);
- return FALSE;
- }
-
- dbus_connection_set_route_peer_messages (connection, TRUE);
-
- retval = FALSE;
-
- dbus_error_init (&error);
- d->selinux_id = bus_selinux_init_connection_id (connection,
- &error);
- if (dbus_error_is_set (&error))
- {
- /* This is a bit bogus because we pretend all errors
- * are OOM; this is done because we know that in bus.c
- * an OOM error disconnects the connection, which is
- * the same thing we want on any other error.
- */
- dbus_error_free (&error);
- goto out;
- }
-
- if (!dbus_connection_set_watch_functions (connection,
- add_connection_watch,
- remove_connection_watch,
- toggle_connection_watch,
- connection,
- NULL))
- goto out;
-
- if (!dbus_connection_set_timeout_functions (connection,
- add_connection_timeout,
- remove_connection_timeout,
- NULL,
- connection, NULL))
- goto out;
-
- /* For now we don't need to set a Windows user function because
- * there are no policies in the config file controlling what
- * Windows users can connect. The default 'same user that owns the
- * bus can connect' behavior of DBusConnection is fine on Windows.
- */
- dbus_connection_set_unix_user_function (connection,
- allow_unix_user_function,
- NULL, NULL);
-
- dbus_connection_set_dispatch_status_function (connection,
- dispatch_status_function,
- bus_context_get_loop (connections->context),
- NULL);
-
- d->link_in_connection_list = _dbus_list_alloc_link (connection);
- if (d->link_in_connection_list == NULL)
- goto out;
-
- /* Setup the connection with the dispatcher */
- if (!bus_dispatch_add_connection (connection))
- goto out;
-
- if (dbus_connection_get_dispatch_status (connection) != DBUS_DISPATCH_COMPLETE)
- {
- if (!_dbus_loop_queue_dispatch (bus_context_get_loop (connections->context), connection))
- {
- bus_dispatch_remove_connection (connection);
- goto out;
- }
- }
-
- _dbus_list_append_link (&connections->incomplete, d->link_in_connection_list);
- connections->n_incomplete += 1;
-
- dbus_connection_ref (connection);
-
- /* Note that we might disconnect ourselves here, but it only takes
- * effect on return to the main loop. We call this to free up
- * expired connections if possible, and to queue the timeout for our
- * own expiration.
- */
- bus_connections_expire_incomplete (connections);
-
- /* And we might also disconnect ourselves here, but again it
- * only takes effect on return to main loop.
- */
- if (connections->n_incomplete >
- bus_context_get_max_incomplete_connections (connections->context))
- {
- _dbus_verbose ("Number of incomplete connections exceeds max, dropping oldest one\n");
-
- _dbus_assert (connections->incomplete != NULL);
- /* Disconnect the oldest unauthenticated connection. FIXME
- * would it be more secure to drop a *random* connection? This
- * algorithm seems to mean that if someone can create new
- * connections quickly enough, they can keep anyone else from
- * completing authentication. But random may or may not really
- * help with that, a more elaborate solution might be required.
- */
- dbus_connection_close (connections->incomplete->data);
- }
-
- retval = TRUE;
-
- out:
- if (!retval)
- {
- if (d->selinux_id)
- bus_selinux_id_unref (d->selinux_id);
- d->selinux_id = NULL;
-
- if (!dbus_connection_set_watch_functions (connection,
- NULL, NULL, NULL,
- connection,
- NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
-
- if (!dbus_connection_set_timeout_functions (connection,
- NULL, NULL, NULL,
- connection,
- NULL))
- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
-
- dbus_connection_set_unix_user_function (connection,
- NULL, NULL, NULL);
-
- dbus_connection_set_windows_user_function (connection,
- NULL, NULL, NULL);
-
- dbus_connection_set_dispatch_status_function (connection,
- NULL, NULL, NULL);
-
- if (d->link_in_connection_list != NULL)
- {
- _dbus_assert (d->link_in_connection_list->next == NULL);
- _dbus_assert (d->link_in_connection_list->prev == NULL);
- _dbus_list_free_link (d->link_in_connection_list);
- d->link_in_connection_list = NULL;
- }
-
- if (!dbus_connection_set_data (connection,
- connection_data_slot,
- NULL, NULL))
- _dbus_assert_not_reached ("failed to set connection data to null");
-
- /* "d" has now been freed */
- }
-
- return retval;
-}
-
-void
-bus_connections_expire_incomplete (BusConnections *connections)
-{
- int next_interval;
-
- next_interval = -1;
-
- if (connections->incomplete != NULL)
- {
- long tv_sec, tv_usec;
- DBusList *link;
- int auth_timeout;
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
- auth_timeout = bus_context_get_auth_timeout (connections->context);
-
- link = _dbus_list_get_first_link (&connections->incomplete);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&connections->incomplete, link);
- DBusConnection *connection;
- BusConnectionData *d;
- double elapsed;
-
- connection = link->data;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- elapsed = ELAPSED_MILLISECONDS_SINCE (d->connection_tv_sec,
- d->connection_tv_usec,
- tv_sec, tv_usec);
-
- if (elapsed >= (double) auth_timeout)
- {
- _dbus_verbose ("Timing out authentication for connection %p\n", connection);
- dbus_connection_close (connection);
- }
- else
- {
- /* We can end the loop, since the connections are in oldest-first order */
- next_interval = ((double)auth_timeout) - elapsed;
- _dbus_verbose ("Connection %p authentication expires in %d milliseconds\n",
- connection, next_interval);
-
- break;
- }
-
- link = next;
- }
- }
-
- bus_expire_timeout_set_interval (connections->expire_timeout,
- next_interval);
-}
-
-static dbus_bool_t
-expire_incomplete_timeout (void *data)
-{
- BusConnections *connections = data;
-
- _dbus_verbose ("Running\n");
-
- /* note that this may remove the timeout */
- bus_connections_expire_incomplete (connections);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_connection_get_unix_groups (DBusConnection *connection,
- unsigned long **groups,
- int *n_groups,
- DBusError *error)
-{
- unsigned long uid;
-
- *groups = NULL;
- *n_groups = 0;
-
- if (dbus_connection_get_unix_user (connection, &uid))
- {
- if (!_dbus_unix_groups_from_uid (uid, groups, n_groups))
- {
- _dbus_verbose ("Did not get any groups for UID %lu\n",
- uid);
- return FALSE;
- }
- else
- {
- _dbus_verbose ("Got %d groups for UID %lu\n",
- *n_groups, uid);
- return TRUE;
- }
- }
- else
- return TRUE; /* successfully got 0 groups */
-}
-
-dbus_bool_t
-bus_connection_is_in_unix_group (DBusConnection *connection,
- unsigned long gid)
-{
- int i;
- unsigned long *group_ids;
- int n_group_ids;
-
- if (!bus_connection_get_unix_groups (connection, &group_ids, &n_group_ids,
- NULL))
- return FALSE;
-
- i = 0;
- while (i < n_group_ids)
- {
- if (group_ids[i] == gid)
- {
- dbus_free (group_ids);
- return TRUE;
- }
- ++i;
- }
-
- dbus_free (group_ids);
- return FALSE;
-}
-
-const char *
-bus_connection_get_loginfo (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- if (!bus_connection_is_active (connection))
- return "inactive";
- return d->cached_loginfo_string;
-}
-
-BusClientPolicy*
-bus_connection_get_policy (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
- _dbus_assert (d->policy != NULL);
-
- return d->policy;
-}
-
-static dbus_bool_t
-foreach_active (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&connections->completed);
- while (link != NULL)
- {
- DBusConnection *connection = link->data;
- DBusList *next = _dbus_list_get_next_link (&connections->completed, link);
-
- if (!(* function) (connection, data))
- return FALSE;
-
- link = next;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-foreach_inactive (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&connections->incomplete);
- while (link != NULL)
- {
- DBusConnection *connection = link->data;
- DBusList *next = _dbus_list_get_next_link (&connections->incomplete, link);
-
- if (!(* function) (connection, data))
- return FALSE;
-
- link = next;
- }
-
- return TRUE;
-}
-
-/**
- * Calls function on each active connection; if the function returns
- * #FALSE, stops iterating. Active connections are authenticated
- * and have sent a Hello message.
- *
- * @param connections the connections object
- * @param function the function
- * @param data data to pass to it as a second arg
- */
-void
-bus_connections_foreach_active (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data)
-{
- foreach_active (connections, function, data);
-}
-
-/**
- * Calls function on each connection; if the function returns
- * #FALSE, stops iterating.
- *
- * @param connections the connections object
- * @param function the function
- * @param data data to pass to it as a second arg
- */
-void
-bus_connections_foreach (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data)
-{
- if (!foreach_active (connections, function, data))
- return;
-
- foreach_inactive (connections, function, data);
-}
-
-BusContext*
-bus_connections_get_context (BusConnections *connections)
-{
- return connections->context;
-}
-
-/*
- * This is used to avoid covering the same connection twice when
- * traversing connections. Note that it assumes we will
- * bus_connection_mark_stamp() each connection at least once per
- * INT_MAX increments of the global stamp, or wraparound would break
- * things.
- */
-void
-bus_connections_increment_stamp (BusConnections *connections)
-{
- connections->stamp += 1;
-}
-
-/* Mark connection with current stamp, return TRUE if it
- * didn't already have that stamp
- */
-dbus_bool_t
-bus_connection_mark_stamp (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- if (d->stamp == d->connections->stamp)
- return FALSE;
- else
- {
- d->stamp = d->connections->stamp;
- return TRUE;
- }
-}
-
-BusContext*
-bus_connection_get_context (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return d->connections->context;
-}
-
-BusConnections*
-bus_connection_get_connections (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return d->connections;
-}
-
-BusRegistry*
-bus_connection_get_registry (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return bus_context_get_registry (d->connections->context);
-}
-
-BusActivation*
-bus_connection_get_activation (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return bus_context_get_activation (d->connections->context);
-}
-
-BusMatchmaker*
-bus_connection_get_matchmaker (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return bus_context_get_matchmaker (d->connections->context);
-}
-
-BusSELinuxID*
-bus_connection_get_selinux_id (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- return d->selinux_id;
-}
-
-/**
- * Checks whether the connection is registered with the message bus.
- *
- * @param connection the connection
- * @returns #TRUE if we're an active message bus participant
- */
-dbus_bool_t
-bus_connection_is_active (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- return d != NULL && d->name != NULL;
-}
-
-dbus_bool_t
-bus_connection_preallocate_oom_error (DBusConnection *connection)
-{
- DBusMessage *message;
- DBusPreallocatedSend *preallocated;
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
-
- if (d->oom_preallocated != NULL)
- return TRUE;
-
- preallocated = dbus_connection_preallocate_send (connection);
- if (preallocated == NULL)
- return FALSE;
-
- message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
-
- if (message == NULL)
- {
- dbus_connection_free_preallocated_send (connection, preallocated);
- return FALSE;
- }
-
- /* d->name may be NULL, but that is OK */
- if (!dbus_message_set_error_name (message, DBUS_ERROR_NO_MEMORY) ||
- !dbus_message_set_destination (message, d->name) ||
- !dbus_message_set_sender (message,
- DBUS_SERVICE_DBUS))
- {
- dbus_connection_free_preallocated_send (connection, preallocated);
- dbus_message_unref (message);
- return FALSE;
- }
-
- /* set reply serial to placeholder value just so space is already allocated
- * for it.
- */
- if (!dbus_message_set_reply_serial (message, 14))
- {
- dbus_connection_free_preallocated_send (connection, preallocated);
- dbus_message_unref (message);
- return FALSE;
- }
-
- d->oom_message = message;
- d->oom_preallocated = preallocated;
-
- return TRUE;
-}
-
-void
-bus_connection_send_oom_error (DBusConnection *connection,
- DBusMessage *in_reply_to)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
- _dbus_assert (d->oom_message != NULL);
-
- /* should always succeed since we set it to a placeholder earlier */
- if (!dbus_message_set_reply_serial (d->oom_message,
- dbus_message_get_serial (in_reply_to)))
- _dbus_assert_not_reached ("Failed to set reply serial for preallocated oom message");
-
- _dbus_assert (dbus_message_get_sender (d->oom_message) != NULL);
-
- dbus_connection_send_preallocated (connection, d->oom_preallocated,
- d->oom_message, NULL);
-
- dbus_message_unref (d->oom_message);
- d->oom_message = NULL;
- d->oom_preallocated = NULL;
-}
-
-#ifdef DBUS_ENABLE_STATS
-static void
-update_peak (int *peak,
- int n)
-{
- if (*peak < n)
- *peak = n;
-}
-#endif
-
-void
-bus_connection_add_match_rule_link (DBusConnection *connection,
- DBusList *link)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- _dbus_list_append_link (&d->match_rules, link);
-
- d->n_match_rules += 1;
-
-#ifdef DBUS_ENABLE_STATS
- update_peak (&d->peak_match_rules, d->n_match_rules);
- update_peak (&d->connections->peak_match_rules_per_conn, d->n_match_rules);
-
- d->connections->total_match_rules += 1;
- update_peak (&d->connections->peak_match_rules,
- d->connections->total_match_rules);
-#endif
-}
-
-dbus_bool_t
-bus_connection_add_match_rule (DBusConnection *connection,
- BusMatchRule *rule)
-{
- DBusList *link;
-
- link = _dbus_list_alloc_link (rule);
-
- if (link == NULL)
- return FALSE;
-
- bus_connection_add_match_rule_link (connection, link);
-
- return TRUE;
-}
-
-void
-bus_connection_remove_match_rule (DBusConnection *connection,
- BusMatchRule *rule)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- _dbus_list_remove_last (&d->match_rules, rule);
-
- d->n_match_rules -= 1;
- _dbus_assert (d->n_match_rules >= 0);
-
-#ifdef DBUS_ENABLE_STATS
- d->connections->total_match_rules -= 1;
-#endif
-}
-
-int
-bus_connection_get_n_match_rules (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- return d->n_match_rules;
-}
-
-void
-bus_connection_add_owned_service_link (DBusConnection *connection,
- DBusList *link)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- _dbus_list_append_link (&d->services_owned, link);
-
- d->n_services_owned += 1;
-
-#ifdef DBUS_ENABLE_STATS
- update_peak (&d->peak_bus_names, d->n_services_owned);
- update_peak (&d->connections->peak_bus_names_per_conn,
- d->n_services_owned);
-
- d->connections->total_bus_names += 1;
- update_peak (&d->connections->peak_bus_names,
- d->connections->total_bus_names);
-#endif
-}
-
-dbus_bool_t
-bus_connection_add_owned_service (DBusConnection *connection,
- BusService *service)
-{
- DBusList *link;
-
- link = _dbus_list_alloc_link (service);
-
- if (link == NULL)
- return FALSE;
-
- bus_connection_add_owned_service_link (connection, link);
-
- return TRUE;
-}
-
-void
-bus_connection_remove_owned_service (DBusConnection *connection,
- BusService *service)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- _dbus_list_remove_last (&d->services_owned, service);
-
- d->n_services_owned -= 1;
- _dbus_assert (d->n_services_owned >= 0);
-
-#ifdef DBUS_ENABLE_STATS
- d->connections->total_bus_names -= 1;
-#endif
-}
-
-int
-bus_connection_get_n_services_owned (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- return d->n_services_owned;
-}
-
-dbus_bool_t
-bus_connection_complete (DBusConnection *connection,
- const DBusString *name,
- DBusError *error)
-{
- BusConnectionData *d;
- unsigned long uid;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
- _dbus_assert (d->name == NULL);
- _dbus_assert (d->policy == NULL);
-
- _dbus_assert (!bus_connection_is_active (connection));
-
- if (!_dbus_string_copy_data (name, &d->name))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- _dbus_assert (d->name != NULL);
-
- _dbus_verbose ("Name %s assigned to %p\n", d->name, connection);
-
- d->policy = bus_context_create_client_policy (d->connections->context,
- connection,
- error);
-
- /* we may have a NULL policy on OOM or error getting list of
- * groups for a user. In the latter case we don't handle it so
- * well currently, as it will just keep failing over and over.
- */
-
- if (d->policy == NULL)
- {
- _dbus_verbose ("Failed to create security policy for connection %p\n",
- connection);
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_free (d->name);
- d->name = NULL;
- return FALSE;
- }
-
- if (dbus_connection_get_unix_user (connection, &uid))
- {
- if (!adjust_connections_for_uid (d->connections,
- uid, 1))
- goto fail;
- }
-
- /* Create and cache a string which holds information about the
- * peer process; used for logging purposes.
- */
- if (!cache_peer_loginfo_string (d, connection))
- goto fail;
-
- /* Now the connection is active, move it between lists */
- _dbus_list_unlink (&d->connections->incomplete,
- d->link_in_connection_list);
- d->connections->n_incomplete -= 1;
- _dbus_list_append_link (&d->connections->completed,
- d->link_in_connection_list);
- d->connections->n_completed += 1;
-
- _dbus_assert (d->connections->n_incomplete >= 0);
- _dbus_assert (d->connections->n_completed > 0);
-
- /* See if we can remove the timeout */
- bus_connections_expire_incomplete (d->connections);
-
- _dbus_assert (bus_connection_is_active (connection));
-
- return TRUE;
-fail:
- BUS_SET_OOM (error);
- dbus_free (d->name);
- d->name = NULL;
- if (d->policy)
- bus_client_policy_unref (d->policy);
- d->policy = NULL;
- return FALSE;
-}
-
-const char *
-bus_connection_get_name (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- return d->name;
-}
-
-/**
- * Check whether completing the passed-in connection would
- * exceed limits, and if so set error and return #FALSE
- */
-dbus_bool_t
-bus_connections_check_limits (BusConnections *connections,
- DBusConnection *requesting_completion,
- DBusError *error)
-{
- unsigned long uid;
-
- if (connections->n_completed >=
- bus_context_get_max_completed_connections (connections->context))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "The maximum number of active connections has been reached");
- return FALSE;
- }
-
- if (dbus_connection_get_unix_user (requesting_completion, &uid))
- {
- if (get_connections_for_uid (connections, uid) >=
- bus_context_get_max_connections_per_user (connections->context))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "The maximum number of active connections for UID %lu has been reached",
- uid);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-static void
-bus_pending_reply_free (BusPendingReply *pending)
-{
- _dbus_verbose ("Freeing pending reply %p, replier %p receiver %p serial %u\n",
- pending,
- pending->will_send_reply,
- pending->will_get_reply,
- pending->reply_serial);
-
- dbus_free (pending);
-}
-
-static dbus_bool_t
-bus_pending_reply_send_no_reply (BusConnections *connections,
- BusTransaction *transaction,
- BusPendingReply *pending)
-{
- DBusMessage *message;
- DBusMessageIter iter;
- dbus_bool_t retval;
- const char *errmsg;
-
- retval = FALSE;
-
- message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
- if (message == NULL)
- return FALSE;
-
- dbus_message_set_no_reply (message, TRUE);
-
- if (!dbus_message_set_reply_serial (message,
- pending->reply_serial))
- goto out;
-
- if (!dbus_message_set_error_name (message,
- DBUS_ERROR_NO_REPLY))
- goto out;
-
- errmsg = "Message did not receive a reply (timeout by message bus)";
- dbus_message_iter_init_append (message, &iter);
- if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errmsg))
- goto out;
-
- if (!bus_transaction_send_from_driver (transaction, pending->will_get_reply,
- message))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_message_unref (message);
- return retval;
-}
-
-static dbus_bool_t
-bus_pending_reply_expired (BusExpireList *list,
- DBusList *link,
- void *data)
-{
- BusPendingReply *pending = link->data;
- BusConnections *connections = data;
- BusTransaction *transaction;
-
- /* No reply is forthcoming. So nuke it if we can. If not,
- * leave it in the list to try expiring again later when we
- * get more memory.
- */
-
- _dbus_verbose ("Expiring pending reply %p, replier %p receiver %p serial %u\n",
- pending,
- pending->will_send_reply,
- pending->will_get_reply,
- pending->reply_serial);
-
- transaction = bus_transaction_new (connections->context);
- if (transaction == NULL)
- return FALSE;
-
- if (!bus_pending_reply_send_no_reply (connections,
- transaction,
- pending))
- {
- bus_transaction_cancel_and_free (transaction);
- return FALSE;
- }
-
- bus_expire_list_remove_link (connections->pending_replies, link);
-
- bus_pending_reply_free (pending);
- bus_transaction_execute_and_free (transaction);
-
- return TRUE;
-}
-
-static void
-bus_connection_drop_pending_replies (BusConnections *connections,
- DBusConnection *connection)
-{
- /* The DBusConnection is almost 100% finalized here, so you can't
- * do anything with it except check for pointer equality
- */
- DBusList *link;
-
- _dbus_verbose ("Dropping pending replies that involve connection %p\n",
- connection);
-
- link = bus_expire_list_get_first_link (connections->pending_replies);
- while (link != NULL)
- {
- DBusList *next;
- BusPendingReply *pending;
-
- next = bus_expire_list_get_next_link (connections->pending_replies,
- link);
- pending = link->data;
-
- if (pending->will_get_reply == connection)
- {
- /* We don't need to track this pending reply anymore */
-
- _dbus_verbose ("Dropping pending reply %p, replier %p receiver %p serial %u\n",
- pending,
- pending->will_send_reply,
- pending->will_get_reply,
- pending->reply_serial);
-
- bus_expire_list_remove_link (connections->pending_replies,
- link);
- bus_pending_reply_free (pending);
- }
- else if (pending->will_send_reply == connection)
- {
- /* The reply isn't going to be sent, so set things
- * up so it will be expired right away
- */
- _dbus_verbose ("Will expire pending reply %p, replier %p receiver %p serial %u\n",
- pending,
- pending->will_send_reply,
- pending->will_get_reply,
- pending->reply_serial);
-
- pending->will_send_reply = NULL;
- pending->expire_item.added_tv_sec = 0;
- pending->expire_item.added_tv_usec = 0;
-
- bus_expire_list_recheck_immediately (connections->pending_replies);
- }
-
- link = next;
- }
-}
-
-
-typedef struct
-{
- BusPendingReply *pending;
- BusConnections *connections;
-} CancelPendingReplyData;
-
-static void
-cancel_pending_reply (void *data)
-{
- CancelPendingReplyData *d = data;
-
- _dbus_verbose ("d = %p\n", d);
-
- if (!bus_expire_list_remove (d->connections->pending_replies,
- &d->pending->expire_item))
- _dbus_assert_not_reached ("pending reply did not exist to be cancelled");
-
- bus_pending_reply_free (d->pending); /* since it's been cancelled */
-}
-
-static void
-cancel_pending_reply_data_free (void *data)
-{
- CancelPendingReplyData *d = data;
-
- _dbus_verbose ("d = %p\n", d);
-
- /* d->pending should be either freed or still
- * in the list of pending replies (owned by someone
- * else)
- */
-
- dbus_free (d);
-}
-
-/*
- * Record that a reply is allowed; return TRUE on success.
- */
-dbus_bool_t
-bus_connections_expect_reply (BusConnections *connections,
- BusTransaction *transaction,
- DBusConnection *will_get_reply,
- DBusConnection *will_send_reply,
- DBusMessage *reply_to_this,
- DBusError *error)
-{
- BusPendingReply *pending;
- dbus_uint32_t reply_serial;
- DBusList *link;
- CancelPendingReplyData *cprd;
- int count;
-
- _dbus_assert (will_get_reply != NULL);
- _dbus_assert (will_send_reply != NULL);
- _dbus_assert (reply_to_this != NULL);
-
- if (dbus_message_get_no_reply (reply_to_this))
- return TRUE; /* we won't allow a reply, since client doesn't care for one. */
-
- reply_serial = dbus_message_get_serial (reply_to_this);
-
- link = bus_expire_list_get_first_link (connections->pending_replies);
- count = 0;
- while (link != NULL)
- {
- pending = link->data;
-
- if (pending->reply_serial == reply_serial &&
- pending->will_get_reply == will_get_reply &&
- pending->will_send_reply == will_send_reply)
- {
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "Message has the same reply serial as a currently-outstanding existing method call");
- return FALSE;
- }
-
- link = bus_expire_list_get_next_link (connections->pending_replies,
- link);
- if (pending->will_get_reply == will_get_reply)
- ++count;
- }
-
- if (count >=
- bus_context_get_max_replies_per_connection (connections->context))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "The maximum number of pending replies per connection has been reached");
- return FALSE;
- }
-
- pending = dbus_new0 (BusPendingReply, 1);
- if (pending == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- /* so we can see a not-yet-added pending reply */
- pending->expire_item.added_tv_sec = 1;
- pending->expire_item.added_tv_usec = 1;
-#endif
-
- pending->will_get_reply = will_get_reply;
- pending->will_send_reply = will_send_reply;
- pending->reply_serial = reply_serial;
-
- cprd = dbus_new0 (CancelPendingReplyData, 1);
- if (cprd == NULL)
- {
- BUS_SET_OOM (error);
- bus_pending_reply_free (pending);
- return FALSE;
- }
-
- if (!bus_expire_list_add (connections->pending_replies,
- &pending->expire_item))
- {
- BUS_SET_OOM (error);
- dbus_free (cprd);
- bus_pending_reply_free (pending);
- return FALSE;
- }
-
- if (!bus_transaction_add_cancel_hook (transaction,
- cancel_pending_reply,
- cprd,
- cancel_pending_reply_data_free))
- {
- BUS_SET_OOM (error);
- bus_expire_list_remove (connections->pending_replies, &pending->expire_item);
- dbus_free (cprd);
- bus_pending_reply_free (pending);
- return FALSE;
- }
-
- cprd->pending = pending;
- cprd->connections = connections;
-
- _dbus_get_monotonic_time (&pending->expire_item.added_tv_sec,
- &pending->expire_item.added_tv_usec);
-
- _dbus_verbose ("Added pending reply %p, replier %p receiver %p serial %u\n",
- pending,
- pending->will_send_reply,
- pending->will_get_reply,
- pending->reply_serial);
-
- return TRUE;
-}
-
-typedef struct
-{
- DBusList *link;
- BusConnections *connections;
-} CheckPendingReplyData;
-
-static void
-cancel_check_pending_reply (void *data)
-{
- CheckPendingReplyData *d = data;
-
- _dbus_verbose ("d = %p\n",d);
-
- bus_expire_list_add_link (d->connections->pending_replies,
- d->link);
- d->link = NULL;
-}
-
-static void
-check_pending_reply_data_free (void *data)
-{
- CheckPendingReplyData *d = data;
-
- _dbus_verbose ("d = %p\n",d);
-
- if (d->link != NULL)
- {
- BusPendingReply *pending = d->link->data;
-
- _dbus_assert (!bus_expire_list_contains_item (d->connections->pending_replies,
- &pending->expire_item));
-
- bus_pending_reply_free (pending);
- _dbus_list_free_link (d->link);
- }
-
- dbus_free (d);
-}
-
-/*
- * Check whether a reply is allowed, remove BusPendingReply
- * if so, return TRUE if so.
- */
-dbus_bool_t
-bus_connections_check_reply (BusConnections *connections,
- BusTransaction *transaction,
- DBusConnection *sending_reply,
- DBusConnection *receiving_reply,
- DBusMessage *reply,
- DBusError *error)
-{
- CheckPendingReplyData *cprd;
- DBusList *link;
- dbus_uint32_t reply_serial;
-
- _dbus_assert (sending_reply != NULL);
- _dbus_assert (receiving_reply != NULL);
-
- reply_serial = dbus_message_get_reply_serial (reply);
-
- link = bus_expire_list_get_first_link (connections->pending_replies);
- while (link != NULL)
- {
- BusPendingReply *pending = link->data;
-
- if (pending->reply_serial == reply_serial &&
- pending->will_get_reply == receiving_reply &&
- pending->will_send_reply == sending_reply)
- {
- _dbus_verbose ("Found pending reply with serial %u\n", reply_serial);
- break;
- }
-
- link = bus_expire_list_get_next_link (connections->pending_replies,
- link);
- }
-
- if (link == NULL)
- {
- _dbus_verbose ("No pending reply expected\n");
-
- return FALSE;
- }
-
- cprd = dbus_new0 (CheckPendingReplyData, 1);
- if (cprd == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_add_cancel_hook (transaction,
- cancel_check_pending_reply,
- cprd,
- check_pending_reply_data_free))
- {
- BUS_SET_OOM (error);
- dbus_free (cprd);
- return FALSE;
- }
-
- cprd->link = link;
- cprd->connections = connections;
-
- bus_expire_list_unlink (connections->pending_replies,
- link);
-
- _dbus_assert (!bus_expire_list_contains_item (connections->pending_replies, link->data));
-
- return TRUE;
-}
-
-/*
- * Transactions
- *
- * Note that this is fairly fragile; in particular, don't try to use
- * one transaction across any main loop iterations.
- */
-
-typedef struct
-{
- BusTransaction *transaction;
- DBusMessage *message;
- DBusPreallocatedSend *preallocated;
-} MessageToSend;
-
-typedef struct
-{
- BusTransactionCancelFunction cancel_function;
- DBusFreeFunction free_data_function;
- void *data;
-} CancelHook;
-
-struct BusTransaction
-{
- DBusList *connections;
- BusContext *context;
- DBusList *cancel_hooks;
-};
-
-static void
-message_to_send_free (DBusConnection *connection,
- MessageToSend *to_send)
-{
- if (to_send->message)
- dbus_message_unref (to_send->message);
-
- if (to_send->preallocated)
- dbus_connection_free_preallocated_send (connection, to_send->preallocated);
-
- dbus_free (to_send);
-}
-
-static void
-cancel_hook_cancel (void *element,
- void *data)
-{
- CancelHook *ch = element;
-
- _dbus_verbose ("Running transaction cancel hook\n");
-
- if (ch->cancel_function)
- (* ch->cancel_function) (ch->data);
-}
-
-static void
-cancel_hook_free (void *element,
- void *data)
-{
- CancelHook *ch = element;
-
- if (ch->free_data_function)
- (* ch->free_data_function) (ch->data);
-
- dbus_free (ch);
-}
-
-static void
-free_cancel_hooks (BusTransaction *transaction)
-{
- _dbus_list_foreach (&transaction->cancel_hooks,
- cancel_hook_free, NULL);
-
- _dbus_list_clear (&transaction->cancel_hooks);
-}
-
-BusTransaction*
-bus_transaction_new (BusContext *context)
-{
- BusTransaction *transaction;
-
- transaction = dbus_new0 (BusTransaction, 1);
- if (transaction == NULL)
- return NULL;
-
- transaction->context = context;
-
- return transaction;
-}
-
-BusContext*
-bus_transaction_get_context (BusTransaction *transaction)
-{
- return transaction->context;
-}
-
-BusConnections*
-bus_transaction_get_connections (BusTransaction *transaction)
-{
- return bus_context_get_connections (transaction->context);
-}
-
-dbus_bool_t
-bus_transaction_send_from_driver (BusTransaction *transaction,
- DBusConnection *connection,
- DBusMessage *message)
-{
- /* We have to set the sender to the driver, and have
- * to check security policy since it was not done in
- * dispatch.c
- */
- _dbus_verbose ("Sending %s %s %s from driver\n",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(no interface)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(no member)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(no error name)");
-
- if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
- return FALSE;
-
- if (bus_connection_is_active (connection))
- {
- if (!dbus_message_set_destination (message,
- bus_connection_get_name (connection)))
- return FALSE;
- }
-
- /* bus driver never wants a reply */
- dbus_message_set_no_reply (message, TRUE);
-
- /* If security policy doesn't allow the message, we silently
- * eat it; the driver doesn't care about getting a reply.
- */
- if (!bus_context_check_security_policy (bus_transaction_get_context (transaction),
- transaction,
- NULL, connection, connection, message, NULL))
- return TRUE;
-
- return bus_transaction_send (transaction, connection, message);
-}
-
-dbus_bool_t
-bus_transaction_send (BusTransaction *transaction,
- DBusConnection *connection,
- DBusMessage *message)
-{
- MessageToSend *to_send;
- BusConnectionData *d;
- DBusList *link;
-
- _dbus_verbose (" trying to add %s interface=%s member=%s error=%s to transaction%s\n",
- dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR ? "error" :
- dbus_message_get_reply_serial (message) != 0 ? "reply" :
- "message",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- dbus_connection_get_is_connected (connection) ?
- "" : " (disconnected)");
-
- _dbus_assert (dbus_message_get_sender (message) != NULL);
-
- if (!dbus_connection_get_is_connected (connection))
- return TRUE; /* silently ignore disconnected connections */
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- to_send = dbus_new (MessageToSend, 1);
- if (to_send == NULL)
- {
- return FALSE;
- }
-
- to_send->preallocated = dbus_connection_preallocate_send (connection);
- if (to_send->preallocated == NULL)
- {
- dbus_free (to_send);
- return FALSE;
- }
-
- dbus_message_ref (message);
- to_send->message = message;
- to_send->transaction = transaction;
-
- _dbus_verbose ("about to prepend message\n");
-
- if (!_dbus_list_prepend (&d->transaction_messages, to_send))
- {
- message_to_send_free (connection, to_send);
- return FALSE;
- }
-
- _dbus_verbose ("prepended message\n");
-
- /* See if we already had this connection in the list
- * for this transaction. If we have a pending message,
- * then we should already be in transaction->connections
- */
- link = _dbus_list_get_first_link (&d->transaction_messages);
- _dbus_assert (link->data == to_send);
- link = _dbus_list_get_next_link (&d->transaction_messages, link);
- while (link != NULL)
- {
- MessageToSend *m = link->data;
- DBusList *next = _dbus_list_get_next_link (&d->transaction_messages, link);
-
- if (m->transaction == transaction)
- break;
-
- link = next;
- }
-
- if (link == NULL)
- {
- if (!_dbus_list_prepend (&transaction->connections, connection))
- {
- _dbus_list_remove (&d->transaction_messages, to_send);
- message_to_send_free (connection, to_send);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-static void
-transaction_free (BusTransaction *transaction)
-{
- _dbus_assert (transaction->connections == NULL);
-
- free_cancel_hooks (transaction);
-
- dbus_free (transaction);
-}
-
-static void
-connection_cancel_transaction (DBusConnection *connection,
- BusTransaction *transaction)
-{
- DBusList *link;
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- link = _dbus_list_get_first_link (&d->transaction_messages);
- while (link != NULL)
- {
- MessageToSend *m = link->data;
- DBusList *next = _dbus_list_get_next_link (&d->transaction_messages, link);
-
- if (m->transaction == transaction)
- {
- _dbus_list_remove_link (&d->transaction_messages,
- link);
-
- message_to_send_free (connection, m);
- }
-
- link = next;
- }
-}
-
-void
-bus_transaction_cancel_and_free (BusTransaction *transaction)
-{
- DBusConnection *connection;
-
- _dbus_verbose ("TRANSACTION: cancelled\n");
-
- while ((connection = _dbus_list_pop_first (&transaction->connections)))
- connection_cancel_transaction (connection, transaction);
-
- _dbus_list_foreach (&transaction->cancel_hooks,
- cancel_hook_cancel, NULL);
-
- transaction_free (transaction);
-}
-
-static void
-connection_execute_transaction (DBusConnection *connection,
- BusTransaction *transaction)
-{
- DBusList *link;
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- /* Send the queue in order (FIFO) */
- link = _dbus_list_get_last_link (&d->transaction_messages);
- while (link != NULL)
- {
- MessageToSend *m = link->data;
- DBusList *prev = _dbus_list_get_prev_link (&d->transaction_messages, link);
-
- if (m->transaction == transaction)
- {
- _dbus_list_remove_link (&d->transaction_messages,
- link);
-
- _dbus_assert (dbus_message_get_sender (m->message) != NULL);
-
- dbus_connection_send_preallocated (connection,
- m->preallocated,
- m->message,
- NULL);
-
- m->preallocated = NULL; /* so we don't double-free it */
-
- message_to_send_free (connection, m);
- }
-
- link = prev;
- }
-}
-
-void
-bus_transaction_execute_and_free (BusTransaction *transaction)
-{
- /* For each connection in transaction->connections
- * send the messages
- */
- DBusConnection *connection;
-
- _dbus_verbose ("TRANSACTION: executing\n");
-
- while ((connection = _dbus_list_pop_first (&transaction->connections)))
- connection_execute_transaction (connection, transaction);
-
- transaction_free (transaction);
-}
-
-static void
-bus_connection_remove_transactions (DBusConnection *connection)
-{
- MessageToSend *to_send;
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- _dbus_assert (d != NULL);
-
- while ((to_send = _dbus_list_get_first (&d->transaction_messages)))
- {
- /* only has an effect for the first MessageToSend listing this transaction */
- _dbus_list_remove (&to_send->transaction->connections,
- connection);
-
- _dbus_list_remove (&d->transaction_messages, to_send);
- message_to_send_free (connection, to_send);
- }
-}
-
-/**
- * Converts the DBusError to a message reply
- */
-dbus_bool_t
-bus_transaction_send_error_reply (BusTransaction *transaction,
- DBusConnection *connection,
- const DBusError *error,
- DBusMessage *in_reply_to)
-{
- DBusMessage *reply;
-
- _dbus_assert (error != NULL);
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _dbus_verbose ("Sending error reply %s \"%s\"\n",
- error->name, error->message);
-
- reply = dbus_message_new_error (in_reply_to,
- error->name,
- error->message);
- if (reply == NULL)
- return FALSE;
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- dbus_message_unref (reply);
- return FALSE;
- }
-
- dbus_message_unref (reply);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_transaction_add_cancel_hook (BusTransaction *transaction,
- BusTransactionCancelFunction cancel_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- CancelHook *ch;
-
- ch = dbus_new (CancelHook, 1);
- if (ch == NULL)
- return FALSE;
-
- _dbus_verbose (" adding cancel hook function = %p data = %p\n",
- cancel_function, data);
-
- ch->cancel_function = cancel_function;
- ch->data = data;
- ch->free_data_function = free_data_function;
-
- /* It's important that the hooks get run in reverse order that they
- * were added
- */
- if (!_dbus_list_prepend (&transaction->cancel_hooks, ch))
- {
- dbus_free (ch);
- return FALSE;
- }
-
- return TRUE;
-}
-
-#ifdef DBUS_ENABLE_STATS
-int
-bus_connections_get_n_active (BusConnections *connections)
-{
- return connections->n_completed;
-}
-
-int
-bus_connections_get_n_incomplete (BusConnections *connections)
-{
- return connections->n_incomplete;
-}
-
-int
-bus_connections_get_total_match_rules (BusConnections *connections)
-{
- return connections->total_match_rules;
-}
-
-int
-bus_connections_get_peak_match_rules (BusConnections *connections)
-{
- return connections->peak_match_rules;
-}
-
-int
-bus_connections_get_peak_match_rules_per_conn (BusConnections *connections)
-{
- return connections->peak_match_rules_per_conn;
-}
-
-int
-bus_connections_get_total_bus_names (BusConnections *connections)
-{
- return connections->total_bus_names;
-}
-
-int
-bus_connections_get_peak_bus_names (BusConnections *connections)
-{
- return connections->peak_bus_names;
-}
-
-int
-bus_connections_get_peak_bus_names_per_conn (BusConnections *connections)
-{
- return connections->peak_bus_names_per_conn;
-}
-
-int
-bus_connection_get_peak_match_rules (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- return d->peak_match_rules;
-}
-
-int
-bus_connection_get_peak_bus_names (DBusConnection *connection)
-{
- BusConnectionData *d;
-
- d = BUS_CONNECTION_DATA (connection);
- return d->peak_bus_names;
-}
-#endif /* DBUS_ENABLE_STATS */
diff --git a/src/3rd_party/dbus-1.7.8/bus/connection.h b/src/3rd_party/dbus-1.7.8/bus/connection.h
deleted file mode 100644
index c9360212d1..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/connection.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* connection.h Client connections
- *
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_CONNECTION_H
-#define BUS_CONNECTION_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-list.h>
-#include "bus.h"
-
-typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection,
- void *data);
-
-
-BusConnections* bus_connections_new (BusContext *context);
-BusConnections* bus_connections_ref (BusConnections *connections);
-void bus_connections_unref (BusConnections *connections);
-dbus_bool_t bus_connections_setup_connection (BusConnections *connections,
- DBusConnection *connection);
-void bus_connections_foreach (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data);
-void bus_connections_foreach_active (BusConnections *connections,
- BusConnectionForeachFunction function,
- void *data);
-BusContext* bus_connections_get_context (BusConnections *connections);
-void bus_connections_increment_stamp (BusConnections *connections);
-BusContext* bus_connection_get_context (DBusConnection *connection);
-BusConnections* bus_connection_get_connections (DBusConnection *connection);
-BusRegistry* bus_connection_get_registry (DBusConnection *connection);
-BusActivation* bus_connection_get_activation (DBusConnection *connection);
-BusMatchmaker* bus_connection_get_matchmaker (DBusConnection *connection);
-const char * bus_connection_get_loginfo (DBusConnection *connection);
-BusSELinuxID* bus_connection_get_selinux_id (DBusConnection *connection);
-dbus_bool_t bus_connections_check_limits (BusConnections *connections,
- DBusConnection *requesting_completion,
- DBusError *error);
-void bus_connections_expire_incomplete (BusConnections *connections);
-
-dbus_bool_t bus_connections_expect_reply (BusConnections *connections,
- BusTransaction *transaction,
- DBusConnection *will_get_reply,
- DBusConnection *will_send_reply,
- DBusMessage *reply_to_this,
- DBusError *error);
-dbus_bool_t bus_connections_check_reply (BusConnections *connections,
- BusTransaction *transaction,
- DBusConnection *sending_reply,
- DBusConnection *receiving_reply,
- DBusMessage *reply,
- DBusError *error);
-
-dbus_bool_t bus_connection_mark_stamp (DBusConnection *connection);
-
-dbus_bool_t bus_connection_is_active (DBusConnection *connection);
-const char *bus_connection_get_name (DBusConnection *connection);
-
-dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection);
-void bus_connection_send_oom_error (DBusConnection *connection,
- DBusMessage *in_reply_to);
-
-/* called by signals.c */
-dbus_bool_t bus_connection_add_match_rule (DBusConnection *connection,
- BusMatchRule *rule);
-void bus_connection_add_match_rule_link (DBusConnection *connection,
- DBusList *link);
-void bus_connection_remove_match_rule (DBusConnection *connection,
- BusMatchRule *rule);
-int bus_connection_get_n_match_rules (DBusConnection *connection);
-
-
-/* called by services.c */
-dbus_bool_t bus_connection_add_owned_service (DBusConnection *connection,
- BusService *service);
-void bus_connection_remove_owned_service (DBusConnection *connection,
- BusService *service);
-void bus_connection_add_owned_service_link (DBusConnection *connection,
- DBusList *link);
-int bus_connection_get_n_services_owned (DBusConnection *connection);
-
-/* called by driver.c */
-dbus_bool_t bus_connection_complete (DBusConnection *connection,
- const DBusString *name,
- DBusError *error);
-
-/* called by dispatch.c when the connection is dropped */
-void bus_connection_disconnected (DBusConnection *connection);
-
-dbus_bool_t bus_connection_is_in_unix_group (DBusConnection *connection,
- unsigned long gid);
-dbus_bool_t bus_connection_get_unix_groups (DBusConnection *connection,
- unsigned long **groups,
- int *n_groups,
- DBusError *error);
-BusClientPolicy* bus_connection_get_policy (DBusConnection *connection);
-
-/* transaction API so we can send or not send a block of messages as a whole */
-
-typedef void (* BusTransactionCancelFunction) (void *data);
-
-BusTransaction* bus_transaction_new (BusContext *context);
-BusContext* bus_transaction_get_context (BusTransaction *transaction);
-BusConnections* bus_transaction_get_connections (BusTransaction *transaction);
-dbus_bool_t bus_transaction_send (BusTransaction *transaction,
- DBusConnection *connection,
- DBusMessage *message);
-dbus_bool_t bus_transaction_send_from_driver (BusTransaction *transaction,
- DBusConnection *connection,
- DBusMessage *message);
-dbus_bool_t bus_transaction_send_error_reply (BusTransaction *transaction,
- DBusConnection *connection,
- const DBusError *error,
- DBusMessage *in_reply_to);
-void bus_transaction_cancel_and_free (BusTransaction *transaction);
-void bus_transaction_execute_and_free (BusTransaction *transaction);
-dbus_bool_t bus_transaction_add_cancel_hook (BusTransaction *transaction,
- BusTransactionCancelFunction cancel_function,
- void *data,
- DBusFreeFunction free_data_function);
-
-/* called by stats.c, only present if DBUS_ENABLE_STATS */
-int bus_connections_get_n_active (BusConnections *connections);
-int bus_connections_get_n_incomplete (BusConnections *connections);
-int bus_connections_get_total_match_rules (BusConnections *connections);
-int bus_connections_get_peak_match_rules (BusConnections *connections);
-int bus_connections_get_peak_match_rules_per_conn (BusConnections *connections);
-int bus_connections_get_total_bus_names (BusConnections *connections);
-int bus_connections_get_peak_bus_names (BusConnections *connections);
-int bus_connections_get_peak_bus_names_per_conn (BusConnections *connections);
-
-int bus_connection_get_peak_match_rules (DBusConnection *connection);
-int bus_connection_get_peak_bus_names (DBusConnection *connection);
-
-#endif /* BUS_CONNECTION_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/dbus.service.in b/src/3rd_party/dbus-1.7.8/bus/dbus.service.in
deleted file mode 100644
index 1b0bbb29d2..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dbus.service.in
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=D-Bus System Message Bus
-Requires=dbus.socket
-
-[Service]
-ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
-ExecReload=@EXPANDED_BINDIR@/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
-OOMScoreAdjust=-900
diff --git a/src/3rd_party/dbus-1.7.8/bus/dbus.socket.in b/src/3rd_party/dbus-1.7.8/bus/dbus.socket.in
deleted file mode 100644
index 74cbe582b3..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dbus.socket.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[Unit]
-Description=D-Bus System Message Bus Socket
-
-[Socket]
-ListenStream=@DBUS_SYSTEM_SOCKET@
diff --git a/src/3rd_party/dbus-1.7.8/bus/desktop-file.c b/src/3rd_party/dbus-1.7.8/bus/desktop-file.c
deleted file mode 100644
index bfeb72e241..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/desktop-file.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* desktop-file.c .desktop file parser
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-internals.h>
-#include "desktop-file.h"
-#include "utils.h"
-
-typedef struct
-{
- char *key;
- char *value;
-} BusDesktopFileLine;
-
-typedef struct
-{
- char *section_name;
-
- int n_lines;
- BusDesktopFileLine *lines;
- int n_allocated_lines;
-} BusDesktopFileSection;
-
-struct BusDesktopFile
-{
- int n_sections;
- BusDesktopFileSection *sections;
- int n_allocated_sections;
-};
-
-/**
- * Parser for service files.
- */
-typedef struct
-{
- DBusString data; /**< The data from the file */
-
- BusDesktopFile *desktop_file; /**< The resulting object */
- int current_section; /**< The current section being parsed */
-
- int pos; /**< Current position */
- int len; /**< Length */
- int line_num; /**< Current line number */
-
-} BusDesktopFileParser;
-
-#define VALID_KEY_CHAR 1
-#define VALID_LOCALE_CHAR 2
-static unsigned char valid[256] = {
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x2 , 0x0 ,
- 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 ,
- 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 ,
- 0x0 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 ,
- 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
- 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
-};
-
-static void report_error (BusDesktopFileParser *parser,
- char *message,
- const char *error_name,
- DBusError *error);
-
-static void
-parser_free (BusDesktopFileParser *parser)
-{
- bus_desktop_file_free (parser->desktop_file);
-
- _dbus_string_free (&parser->data);
-}
-
-static void
-bus_desktop_file_line_free (BusDesktopFileLine *line)
-{
- dbus_free (line->key);
- dbus_free (line->value);
-}
-
-static void
-bus_desktop_file_section_free (BusDesktopFileSection *section)
-{
- int i;
-
- for (i = 0; i < section->n_lines; i++)
- bus_desktop_file_line_free (&section->lines[i]);
-
- dbus_free (section->lines);
- dbus_free (section->section_name);
-}
-
-void
-bus_desktop_file_free (BusDesktopFile *desktop_file)
-{
- int i;
-
- for (i = 0; i < desktop_file->n_sections; i++)
- bus_desktop_file_section_free (&desktop_file->sections[i]);
- dbus_free (desktop_file->sections);
-
- dbus_free (desktop_file);
-}
-
-static dbus_bool_t
-grow_lines_in_section (BusDesktopFileSection *section)
-{
- BusDesktopFileLine *lines;
-
- int new_n_lines;
-
- if (section->n_allocated_lines == 0)
- new_n_lines = 1;
- else
- new_n_lines = section->n_allocated_lines*2;
-
- lines = dbus_realloc (section->lines,
- sizeof (BusDesktopFileLine) * new_n_lines);
-
- if (lines == NULL)
- return FALSE;
-
- section->lines = lines;
- section->n_allocated_lines = new_n_lines;
-
- return TRUE;
-}
-
-static dbus_bool_t
-grow_sections (BusDesktopFile *desktop_file)
-{
- int new_n_sections;
- BusDesktopFileSection *sections;
-
- if (desktop_file->n_allocated_sections == 0)
- new_n_sections = 1;
- else
- new_n_sections = desktop_file->n_allocated_sections*2;
-
- sections = dbus_realloc (desktop_file->sections,
- sizeof (BusDesktopFileSection) * new_n_sections);
- if (sections == NULL)
- return FALSE;
-
- desktop_file->sections = sections;
-
- desktop_file->n_allocated_sections = new_n_sections;
-
- return TRUE;
-}
-
-static char *
-unescape_string (BusDesktopFileParser *parser,
- const DBusString *str,
- int pos,
- int end_pos,
- DBusError *error)
-{
- char *retval, *q;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* len + 1 is enough, because unescaping never makes the
- * string longer
- */
- retval = dbus_malloc (end_pos - pos + 1);
- if (retval == NULL)
- {
- BUS_SET_OOM (error);
- return NULL;
- }
-
- q = retval;
-
- while (pos < end_pos)
- {
- if (_dbus_string_get_byte (str, pos) == 0)
- {
- /* Found an embedded null */
- dbus_free (retval);
- report_error (parser, "Text to be unescaped contains embedded nul",
- BUS_DESKTOP_PARSE_ERROR_INVALID_ESCAPES, error);
- return NULL;
- }
-
- if (_dbus_string_get_byte (str, pos) == '\\')
- {
- pos ++;
-
- if (pos >= end_pos)
- {
- /* Escape at end of string */
- dbus_free (retval);
- report_error (parser, "Text to be unescaped ended in \\",
- BUS_DESKTOP_PARSE_ERROR_INVALID_ESCAPES, error);
- return NULL;
- }
-
- switch (_dbus_string_get_byte (str, pos))
- {
- case 's':
- *q++ = ' ';
- break;
- case 't':
- *q++ = '\t';
- break;
- case 'n':
- *q++ = '\n';
- break;
- case 'r':
- *q++ = '\r';
- break;
- case '\\':
- *q++ = '\\';
- break;
- default:
- /* Invalid escape code */
- dbus_free (retval);
- report_error (parser, "Text to be unescaped had invalid escape sequence",
- BUS_DESKTOP_PARSE_ERROR_INVALID_ESCAPES, error);
- return NULL;
- }
- pos++;
- }
- else
- {
- *q++ =_dbus_string_get_byte (str, pos);
-
- pos++;
- }
- }
-
- *q = 0;
-
- return retval;
-}
-
-static BusDesktopFileSection*
-new_section (BusDesktopFile *desktop_file,
- const char *name)
-{
- int n;
- char *name_copy;
-
- if (desktop_file->n_allocated_sections == desktop_file->n_sections)
- {
- if (!grow_sections (desktop_file))
- return NULL;
- }
-
- name_copy = _dbus_strdup (name);
- if (name_copy == NULL)
- return NULL;
-
- n = desktop_file->n_sections;
- desktop_file->sections[n].section_name = name_copy;
-
- desktop_file->sections[n].n_lines = 0;
- desktop_file->sections[n].lines = NULL;
- desktop_file->sections[n].n_allocated_lines = 0;
-
- if (!grow_lines_in_section (&desktop_file->sections[n]))
- {
- dbus_free (desktop_file->sections[n].section_name);
- desktop_file->sections[n].section_name = NULL;
- return NULL;
- }
-
- desktop_file->n_sections += 1;
-
- return &desktop_file->sections[n];
-}
-
-static BusDesktopFileSection*
-open_section (BusDesktopFileParser *parser,
- char *name)
-{
- BusDesktopFileSection *section;
-
- section = new_section (parser->desktop_file, name);
- if (section == NULL)
- return NULL;
-
- parser->current_section = parser->desktop_file->n_sections - 1;
- _dbus_assert (&parser->desktop_file->sections[parser->current_section] == section);
-
- return section;
-}
-
-static BusDesktopFileLine *
-new_line (BusDesktopFileParser *parser)
-{
- BusDesktopFileSection *section;
- BusDesktopFileLine *line;
-
- section = &parser->desktop_file->sections[parser->current_section];
-
- if (section->n_allocated_lines == section->n_lines)
- {
- if (!grow_lines_in_section (section))
- return NULL;
- }
-
- line = &section->lines[section->n_lines++];
-
- _DBUS_ZERO(*line);
-
- return line;
-}
-
-static dbus_bool_t
-is_blank_line (BusDesktopFileParser *parser)
-{
- int p;
- char c;
-
- p = parser->pos;
-
- c = _dbus_string_get_byte (&parser->data, p);
-
- while (c && c != '\n')
- {
- if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f'))
- return FALSE;
-
- p++;
- c = _dbus_string_get_byte (&parser->data, p);
- }
-
- return TRUE;
-}
-
-static void
-parse_comment_or_blank (BusDesktopFileParser *parser)
-{
- int line_end, eol_len;
-
- if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
- line_end = parser->len;
-
- if (line_end == parser->len)
- parser->pos = parser->len;
- else
- parser->pos = line_end + eol_len;
-
- parser->line_num += 1;
-}
-
-static dbus_bool_t
-is_valid_section_name (const char *name)
-{
- /* 5. Group names may contain all ASCII characters except for control characters and '[' and ']'. */
-
- while (*name)
- {
- if (!((*name >= 'A' && *name <= 'Z') || (*name >= 'a' || *name <= 'z') ||
- *name == '\n' || *name == '\t'))
- return FALSE;
-
- name++;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-parse_section_start (BusDesktopFileParser *parser, DBusError *error)
-{
- int line_end, eol_len;
- char *section_name;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
- line_end = parser->len;
-
- if (line_end - parser->pos <= 2 ||
- _dbus_string_get_byte (&parser->data, line_end - 1) != ']')
- {
- report_error (parser, "Invalid syntax for section header", BUS_DESKTOP_PARSE_ERROR_INVALID_SYNTAX, error);
- parser_free (parser);
- return FALSE;
- }
-
- section_name = unescape_string (parser,
- &parser->data, parser->pos + 1, line_end - 1,
- error);
-
- if (section_name == NULL)
- {
- parser_free (parser);
- return FALSE;
- }
-
- if (!is_valid_section_name (section_name))
- {
- report_error (parser, "Invalid characters in section name", BUS_DESKTOP_PARSE_ERROR_INVALID_CHARS, error);
- parser_free (parser);
- dbus_free (section_name);
- return FALSE;
- }
-
- if (open_section (parser, section_name) == NULL)
- {
- dbus_free (section_name);
- parser_free (parser);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (line_end == parser->len)
- parser->pos = parser->len;
- else
- parser->pos = line_end + eol_len;
-
- parser->line_num += 1;
-
- dbus_free (section_name);
-
- return TRUE;
-}
-
-static dbus_bool_t
-parse_key_value (BusDesktopFileParser *parser, DBusError *error)
-{
- int line_end, eol_len;
- int key_start, key_end;
- int value_start;
- int p;
- char *value, *tmp;
- DBusString key;
- BusDesktopFileLine *line;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
- line_end = parser->len;
-
- p = parser->pos;
- key_start = p;
- while (p < line_end &&
- (valid[_dbus_string_get_byte (&parser->data, p)] & VALID_KEY_CHAR))
- p++;
- key_end = p;
-
- if (key_start == key_end)
- {
- report_error (parser, "Empty key name", BUS_DESKTOP_PARSE_ERROR_INVALID_SYNTAX, error);
- parser_free (parser);
- return FALSE;
- }
-
- /* We ignore locales for now */
- if (p < line_end && _dbus_string_get_byte (&parser->data, p) == '[')
- {
- if (line_end == parser->len)
- parser->pos = parser->len;
- else
- parser->pos = line_end + eol_len;
-
- parser->line_num += 1;
-
- return TRUE;
- }
-
- /* Skip space before '=' */
- while (p < line_end && _dbus_string_get_byte (&parser->data, p) == ' ')
- p++;
-
- if (p < line_end && _dbus_string_get_byte (&parser->data, p) != '=')
- {
- report_error (parser, "Invalid characters in key name", BUS_DESKTOP_PARSE_ERROR_INVALID_CHARS, error);
- parser_free (parser);
- return FALSE;
- }
-
- if (p == line_end)
- {
- report_error (parser, "No '=' in key/value pair", BUS_DESKTOP_PARSE_ERROR_INVALID_SYNTAX, error);
- parser_free (parser);
- return FALSE;
- }
-
- /* Skip the '=' */
- p++;
-
- /* Skip space after '=' */
- while (p < line_end && _dbus_string_get_byte (&parser->data, p) == ' ')
- p++;
-
- value_start = p;
-
- value = unescape_string (parser, &parser->data, value_start, line_end, error);
- if (value == NULL)
- {
- parser_free (parser);
- return FALSE;
- }
-
- line = new_line (parser);
- if (line == NULL)
- {
- dbus_free (value);
- parser_free (parser);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&key))
- {
- dbus_free (value);
- parser_free (parser);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_copy_len (&parser->data, key_start, key_end - key_start,
- &key, 0))
- {
- _dbus_string_free (&key);
- dbus_free (value);
- parser_free (parser);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_steal_data (&key, &tmp))
- {
- _dbus_string_free (&key);
- dbus_free (value);
- parser_free (parser);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- _dbus_string_free (&key);
-
- line->key = tmp;
- line->value = value;
-
- if (line_end == parser->len)
- parser->pos = parser->len;
- else
- parser->pos = line_end + eol_len;
-
- parser->line_num += 1;
-
- return TRUE;
-}
-
-static void
-report_error (BusDesktopFileParser *parser,
- char *message,
- const char *error_name,
- DBusError *error)
-{
- const char *section_name = NULL;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (parser->current_section != -1)
- section_name = parser->desktop_file->sections[parser->current_section].section_name;
-
- if (section_name)
- dbus_set_error (error, error_name,
- "Error in section %s at line %d: %s\n", section_name, parser->line_num, message);
- else
- dbus_set_error (error, error_name,
- "Error at line %d: %s\n", parser->line_num, message);
-}
-
-#if 0
-static void
-dump_desktop_file (BusDesktopFile *file)
-{
- int i;
-
- for (i = 0; i < file->n_sections; i++)
- {
- int j;
-
- printf ("[%s]\n", file->sections[i].section_name);
-
- for (j = 0; j < file->sections[i].n_lines; j++)
- {
- printf ("%s=%s\n", file->sections[i].lines[j].key,
- file->sections[i].lines[j].value);
- }
- }
-}
-#endif
-
-BusDesktopFile*
-bus_desktop_file_load (DBusString *filename,
- DBusError *error)
-{
- DBusString str;
- BusDesktopFileParser parser;
- DBusStat sb;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* Clearly there's a race here, but it's just to make it unlikely
- * that we do something silly, we still handle doing it below.
- */
- if (!_dbus_stat (filename, &sb, error))
- return NULL;
-
- if (sb.size > _DBUS_ONE_KILOBYTE * 128)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Desktop file size (%ld bytes) is too large", (long) sb.size);
- return NULL;
- }
-
- if (!_dbus_string_init (&str))
- {
- BUS_SET_OOM (error);
- return NULL;
- }
-
- if (!_dbus_file_get_contents (&str, filename, error))
- {
- _dbus_string_free (&str);
- return NULL;
- }
-
- if (!_dbus_string_validate_utf8 (&str, 0, _dbus_string_get_length (&str)))
- {
- _dbus_string_free (&str);
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "invalid UTF-8");
- return NULL;
- }
-
- parser.desktop_file = dbus_new0 (BusDesktopFile, 1);
- if (parser.desktop_file == NULL)
- {
- _dbus_string_free (&str);
- BUS_SET_OOM (error);
- return NULL;
- }
-
- parser.data = str;
- parser.line_num = 1;
- parser.pos = 0;
- parser.len = _dbus_string_get_length (&parser.data);
- parser.current_section = -1;
-
- while (parser.pos < parser.len)
- {
- if (_dbus_string_get_byte (&parser.data, parser.pos) == '[')
- {
- if (!parse_section_start (&parser, error))
- {
- return NULL;
- }
- }
- else if (is_blank_line (&parser) ||
- _dbus_string_get_byte (&parser.data, parser.pos) == '#')
- parse_comment_or_blank (&parser);
- else if (parser.current_section < 0)
- {
- dbus_set_error(error, DBUS_ERROR_FAILED,
- "invalid service file: key=value before [Section]");
- return NULL;
- }
- else
- {
- if (!parse_key_value (&parser, error))
- {
- return NULL;
- }
- }
- }
-
- _dbus_string_free (&parser.data);
-
- return parser.desktop_file;
-}
-
-static BusDesktopFileSection *
-lookup_section (BusDesktopFile *desktop_file,
- const char *section_name)
-{
- BusDesktopFileSection *section;
- int i;
-
- if (section_name == NULL)
- return NULL;
-
- for (i = 0; i < desktop_file->n_sections; i ++)
- {
- section = &desktop_file->sections[i];
-
- if (strcmp (section->section_name, section_name) == 0)
- return section;
- }
-
- return NULL;
-}
-
-static BusDesktopFileLine *
-lookup_line (BusDesktopFile *desktop_file,
- BusDesktopFileSection *section,
- const char *keyname)
-{
- BusDesktopFileLine *line;
- int i;
-
- for (i = 0; i < section->n_lines; i++)
- {
- line = &section->lines[i];
-
- if (strcmp (line->key, keyname) == 0)
- return line;
- }
-
- return NULL;
-}
-
-dbus_bool_t
-bus_desktop_file_get_raw (BusDesktopFile *desktop_file,
- const char *section_name,
- const char *keyname,
- const char **val)
-{
- BusDesktopFileSection *section;
- BusDesktopFileLine *line;
-
- *val = NULL;
-
- section = lookup_section (desktop_file, section_name);
-
- if (!section)
- return FALSE;
-
- line = lookup_line (desktop_file,
- section,
- keyname);
-
- if (!line)
- return FALSE;
-
- *val = line->value;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_desktop_file_get_string (BusDesktopFile *desktop_file,
- const char *section,
- const char *keyname,
- char **val,
- DBusError *error)
-{
- const char *raw;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- *val = NULL;
-
- if (!bus_desktop_file_get_raw (desktop_file, section, keyname, &raw))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "No \"%s\" key in .service file\n", keyname);
- return FALSE;
- }
-
- *val = _dbus_strdup (raw);
-
- if (*val == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/desktop-file.h b/src/3rd_party/dbus-1.7.8/bus/desktop-file.h
deleted file mode 100644
index e405625c6b..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/desktop-file.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* desktop-file.h .desktop file parser
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef BUS_DESKTOP_FILE_H
-#define BUS_DESKTOP_FILE_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-
-#define BUS_DESKTOP_PARSE_ERROR_INVALID_SYNTAX "org.freedesktop.DBus.DesktopParseError.InvalidSyntax"
-#define BUS_DESKTOP_PARSE_ERROR_INVALID_ESCAPES "org.freedesktop.DBus.DesktopParseError.InvalidEscapes"
-#define BUS_DESKTOP_PARSE_ERROR_INVALID_CHARS "org.freedesktop.DBus.DesktopParseError.InvalidChars"
-
-#define DBUS_SERVICE_SECTION "D-BUS Service"
-#define DBUS_SERVICE_NAME "Name"
-#define DBUS_SERVICE_EXEC "Exec"
-#define DBUS_SERVICE_USER "User"
-#define DBUS_SERVICE_SYSTEMD_SERVICE "SystemdService"
-
-typedef struct BusDesktopFile BusDesktopFile;
-
-BusDesktopFile *bus_desktop_file_load (DBusString *filename,
- DBusError *error);
-void bus_desktop_file_free (BusDesktopFile *file);
-
-dbus_bool_t bus_desktop_file_get_raw (BusDesktopFile *desktop_file,
- const char *section_name,
- const char *keyname,
- const char **val);
-dbus_bool_t bus_desktop_file_get_string (BusDesktopFile *desktop_file,
- const char *section,
- const char *keyname,
- char **val,
- DBusError *error);
-
-
-#endif /* BUS_DESKTOP_FILE_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/dir-watch-default.c b/src/3rd_party/dbus-1.7.8/bus/dir-watch-default.c
deleted file mode 100644
index 69361b1fb9..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dir-watch-default.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dir-watch-default.c OS specific directory change notification for message bus
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include <dbus/dbus-internals.h>
-#include "dir-watch.h"
-
-
-/* NoOp */
-
-void
-bus_set_watched_dirs (BusContext *context, DBusList **directories)
-{
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/dir-watch-inotify.c b/src/3rd_party/dbus-1.7.8/bus/dir-watch-inotify.c
deleted file mode 100644
index 49ebc721b0..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dir-watch-inotify.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dir-watch-inotify.c OS specific directory change notification for message bus
- *
- * Copyright (C) 2003 Red Hat, Inc.
- * (c) 2006 Mandriva
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/* Be careful, this file is not Linux-only: QNX also uses it */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-/* QNX's inotify is broken, and requires stdint.h to be manually included first */
-#include <stdint.h>
-#include <sys/inotify.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-watch.h>
-#include "dir-watch.h"
-
-#define MAX_DIRS_TO_WATCH 128
-#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))
-#define INOTIFY_BUF_LEN (1024 * (INOTIFY_EVENT_SIZE + 16))
-
-/* use a static array to avoid handling OOM */
-static int wds[MAX_DIRS_TO_WATCH];
-static char *dirs[MAX_DIRS_TO_WATCH];
-static int num_wds = 0;
-static int inotify_fd = -1;
-static DBusWatch *watch = NULL;
-static DBusLoop *loop = NULL;
-
-static dbus_bool_t
-_handle_inotify_watch (DBusWatch *passed_watch, unsigned int flags, void *data)
-{
- char buffer[INOTIFY_BUF_LEN];
- ssize_t ret = 0;
- int i = 0;
-
- ret = read (inotify_fd, buffer, INOTIFY_BUF_LEN);
- if (ret < 0)
- _dbus_verbose ("Error reading inotify event: '%s'\n", _dbus_strerror(errno));
- else if (!ret)
- _dbus_verbose ("Error reading inotify event: buffer too small\n");
- else
- {
- _dbus_verbose ("Sending SIGHUP signal on reception of %ld inotify event(s)\n", (long) ret);
- (void) kill (_dbus_getpid (), SIGHUP);
- }
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- while (i < ret)
- {
- struct inotify_event *ev;
-
- ev = (struct inotify_event *) &buffer[i];
- i += INOTIFY_EVENT_SIZE + ev->len;
- if (ev->len)
- _dbus_verbose ("event name: '%s'\n", ev->name);
- _dbus_verbose ("inotify event: wd=%d mask=%u cookie=%u len=%u\n", ev->wd, ev->mask, ev->cookie, ev->len);
- }
-#endif
-
- return TRUE;
-}
-
-#include <stdio.h>
-
-static void
-_set_watched_dirs_internal (DBusList **directories)
-{
- int new_wds[MAX_DIRS_TO_WATCH];
- char *new_dirs[MAX_DIRS_TO_WATCH];
- DBusList *link;
- int i, j, wd;
-
- for (i = 0; i < MAX_DIRS_TO_WATCH; i++)
- {
- new_wds[i] = -1;
- new_dirs[i] = NULL;
- }
-
- i = 0;
- link = _dbus_list_get_first_link (directories);
- while (link != NULL)
- {
- new_dirs[i++] = (char *)link->data;
- link = _dbus_list_get_next_link (directories, link);
- }
-
- /* Look for directories in both the old and new sets, if
- * we find one, move its data into the new set.
- */
- for (i = 0; new_dirs[i]; i++)
- {
- for (j = 0; j < num_wds; j++)
- {
- if (dirs[j] && strcmp (new_dirs[i], dirs[j]) == 0)
- {
- new_wds[i] = wds[j];
- new_dirs[i] = dirs[j];
- wds[j] = -1;
- dirs[j] = NULL;
- break;
- }
- }
- }
-
- /* Any directories we find in "wds" with a nonzero fd must
- * not be in the new set, so perform cleanup now.
- */
- for (j = 0; j < num_wds; j++)
- {
- if (wds[j] != -1)
- {
- inotify_rm_watch (inotify_fd, wds[j]);
- dbus_free (dirs[j]);
- wds[j] = -1;
- dirs[j] = NULL;
- }
- }
-
- for (i = 0; new_dirs[i]; i++)
- {
- if (new_wds[i] == -1)
- {
- /* FIXME - less lame error handling for failing to add a watch; we may need to sleep. */
- wd = inotify_add_watch (inotify_fd, new_dirs[i], IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO | IN_MOVED_FROM);
- if (wd < 0)
- {
- /* Not all service directories need to exist. */
- if (errno != ENOENT)
- {
- _dbus_warn ("Cannot setup inotify for '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno));
- goto out;
- }
- else
- {
- new_wds[i] = -1;
- new_dirs[i] = NULL;
- continue;
- }
- }
- new_wds[i] = wd;
- new_dirs[i] = _dbus_strdup (new_dirs[i]);
- if (!new_dirs[i])
- {
- /* FIXME have less lame handling for OOM, we just silently fail to
- * watch. (In reality though, the whole OOM handling in dbus is stupid
- * but we won't go into that in this comment =) )
- */
- inotify_rm_watch (inotify_fd, wd);
- new_wds[i] = -1;
- }
- }
- }
-
- num_wds = i;
-
- for (i = 0; i < MAX_DIRS_TO_WATCH; i++)
- {
- wds[i] = new_wds[i];
- dirs[i] = new_dirs[i];
- }
-
- out:;
-}
-
-#include <stdio.h>
-static void
-_shutdown_inotify (void *data)
-{
- DBusList *empty = NULL;
-
- if (inotify_fd == -1)
- return;
-
- _set_watched_dirs_internal (&empty);
-
- if (watch != NULL)
- {
- _dbus_loop_remove_watch (loop, watch);
- _dbus_watch_invalidate (watch);
- _dbus_watch_unref (watch);
- _dbus_loop_unref (loop);
- }
- watch = NULL;
- loop = NULL;
-
- close (inotify_fd);
- inotify_fd = -1;
-}
-
-static int
-_init_inotify (BusContext *context)
-{
- int ret = 0;
-
- if (inotify_fd == -1)
- {
-#ifdef HAVE_INOTIFY_INIT1
- inotify_fd = inotify_init1 (IN_CLOEXEC);
- /* This ensures we still run on older Linux kernels.
- * https://bugs.freedesktop.org/show_bug.cgi?id=23957
- */
- if (inotify_fd < 0)
- inotify_fd = inotify_init ();
-#else
- inotify_fd = inotify_init ();
-#endif
- if (inotify_fd <= 0)
- {
- _dbus_warn ("Cannot initialize inotify\n");
- goto out;
- }
- loop = bus_context_get_loop (context);
- _dbus_loop_ref (loop);
-
- watch = _dbus_watch_new (inotify_fd, DBUS_WATCH_READABLE, TRUE,
- _handle_inotify_watch, NULL, NULL);
-
- if (watch == NULL)
- {
- _dbus_warn ("Unable to create inotify watch\n");
- goto out;
- }
-
- if (!_dbus_loop_add_watch (loop, watch))
- {
- _dbus_warn ("Unable to add reload watch to main loop");
- _dbus_watch_unref (watch);
- watch = NULL;
- goto out;
- }
-
- if (!_dbus_register_shutdown_func (_shutdown_inotify, NULL))
- {
- _dbus_warn ("Unable to register shutdown func");
- _dbus_watch_unref (watch);
- watch = NULL;
- goto out;
- }
- }
-
- ret = 1;
-
-out:
- return ret;
-}
-
-void
-bus_set_watched_dirs (BusContext *context, DBusList **directories)
-{
- if (!_init_inotify (context))
- return;
-
- _set_watched_dirs_internal (directories);
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/dir-watch-kqueue.c b/src/3rd_party/dbus-1.7.8/bus/dir-watch-kqueue.c
deleted file mode 100644
index c60560f00f..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dir-watch-kqueue.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dir-watch-kqueue.c OS specific directory change notification for message bus
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <sys/event.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <unistd.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include "bus.h"
-#include <dbus/dbus-watch.h>
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-list.h>
-#include "dir-watch.h"
-
-#define MAX_DIRS_TO_WATCH 128
-
-static int kq = -1;
-static int fds[MAX_DIRS_TO_WATCH];
-static char *dirs[MAX_DIRS_TO_WATCH];
-static int num_fds = 0;
-static DBusWatch *watch = NULL;
-static DBusLoop *loop = NULL;
-
-static dbus_bool_t
-_handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
-{
- struct kevent ev;
- struct timespec nullts = { 0, 0 };
- int res;
- pid_t pid;
-
- res = kevent (kq, NULL, 0, &ev, 1, &nullts);
-
- /* Sleep for half a second to avoid a race when files are install(1)'d
- * to system.d. */
- usleep(500000);
-
- if (res > 0)
- {
- pid = getpid ();
- _dbus_verbose ("Sending SIGHUP signal on reception of a kevent\n");
- (void) kill (pid, SIGHUP);
- }
- else if (res < 0 && errno == EBADF)
- {
- kq = -1;
- if (watch != NULL)
- {
- _dbus_loop_remove_watch (loop, watch);
- _dbus_watch_invalidate (watch);
- _dbus_watch_unref (watch);
- watch = NULL;
- }
- pid = getpid ();
- _dbus_verbose ("Sending SIGHUP signal since kqueue has been closed\n");
- (void) kill (pid, SIGHUP);
- }
-
- return TRUE;
-}
-
-static int
-_init_kqueue (BusContext *context)
-{
- int ret = 0;
-
- if (kq < 0)
- {
-
- kq = kqueue ();
- if (kq < 0)
- {
- _dbus_warn ("Cannot create kqueue; error '%s'\n", _dbus_strerror (errno));
- goto out;
- }
-
- loop = bus_context_get_loop (context);
-
- watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE,
- _handle_kqueue_watch, NULL, NULL);
-
- if (watch == NULL)
- {
- _dbus_warn ("Unable to create kqueue watch\n");
- close (kq);
- kq = -1;
- goto out;
- }
-
- if (!_dbus_loop_add_watch (loop, watch))
- {
- _dbus_warn ("Unable to add reload watch to main loop");
- _dbus_watch_invalidate (watch);
- _dbus_watch_unref (watch);
- watch = NULL;
- close (kq);
- kq = -1;
- goto out;
- }
- }
-
- ret = 1;
-
-out:
- return ret;
-}
-
-void
-bus_set_watched_dirs (BusContext *context, DBusList **directories)
-{
- int new_fds[MAX_DIRS_TO_WATCH];
- char *new_dirs[MAX_DIRS_TO_WATCH];
- DBusList *link;
- int i, j, fd;
- struct kevent ev;
-
- if (!_init_kqueue (context))
- goto out;
-
- for (i = 0; i < MAX_DIRS_TO_WATCH; i++)
- {
- new_fds[i] = -1;
- new_dirs[i] = NULL;
- }
-
- i = 0;
- link = _dbus_list_get_first_link (directories);
- while (link != NULL)
- {
- new_dirs[i++] = (char *)link->data;
- link = _dbus_list_get_next_link (directories, link);
- }
-
- /* Look for directories in both the old and new sets, if
- * we find one, move its data into the new set.
- */
- for (i = 0; new_dirs[i]; i++)
- {
- for (j = 0; j < num_fds; j++)
- {
- if (dirs[j] && strcmp (new_dirs[i], dirs[j]) == 0)
- {
- new_fds[i] = fds[j];
- new_dirs[i] = dirs[j];
- fds[j] = -1;
- dirs[j] = NULL;
- break;
- }
- }
- }
-
- /* Any directory we find in "fds" with a nonzero fd must
- * not be in the new set, so perform cleanup now.
- */
- for (j = 0; j < num_fds; j++)
- {
- if (fds[j] != -1)
- {
- close (fds[j]);
- dbus_free (dirs[j]);
- fds[j] = -1;
- dirs[j] = NULL;
- }
- }
-
- for (i = 0; new_dirs[i]; i++)
- {
- if (new_fds[i] == -1)
- {
- /* FIXME - less lame error handling for failing to add a watch;
- * we may need to sleep.
- */
- fd = open (new_dirs[i], O_RDONLY);
- if (fd < 0)
- {
- if (errno != ENOENT)
- {
- _dbus_warn ("Cannot open directory '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno));
- goto out;
- }
- else
- {
- new_fds[i] = -1;
- new_dirs[i] = NULL;
- continue;
- }
- }
-
- EV_SET (&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
- NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME, 0, 0);
- if (kevent (kq, &ev, 1, NULL, 0, NULL) == -1)
- {
- _dbus_warn ("Cannot setup a kevent for '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno));
- close (fd);
- goto out;
- }
-
- new_fds[i] = fd;
- new_dirs[i] = _dbus_strdup (new_dirs[i]);
- if (!new_dirs[i])
- {
- /* FIXME have less lame handling for OOM, we just silently fail to
- * watch. (In reality though, the whole OOM handling in dbus is
- * stupid but we won't go into that in this comment =) )
- */
- close (fd);
- new_fds[i] = -1;
- }
- }
- }
-
- num_fds = i;
-
- for (i = 0; i < MAX_DIRS_TO_WATCH; i++)
- {
- fds[i] = new_fds[i];
- dirs[i] = new_dirs[i];
- }
-
- out:
- ;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/dir-watch.h b/src/3rd_party/dbus-1.7.8/bus/dir-watch.h
deleted file mode 100644
index b44529e5c2..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dir-watch.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dir-watch.h Watch directories
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include "bus.h"
-
-#ifndef DIR_WATCH_H
-#define DIR_WATCH_H
-
-/**
- * Update the set of directories to monitor for changes. The
- * operating-system-specific implementation of this function should
- * avoid creating a window where a directory in both the
- * old and new set isn't monitored.
- *
- * @param context The bus context
- * @param dirs List of strings which are directory paths
- */
-void bus_set_watched_dirs (BusContext *context, DBusList **dirs);
-
-#endif /* DIR_WATCH_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/dispatch.c b/src/3rd_party/dbus-1.7.8/bus/dispatch.c
deleted file mode 100644
index 5fc0d112ed..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dispatch.c
+++ /dev/null
@@ -1,4917 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dispatch.c Message dispatcher
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2004 Imendio HB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dispatch.h"
-#include "connection.h"
-#include "driver.h"
-#include "services.h"
-#include "activation.h"
-#include "utils.h"
-#include "bus.h"
-#include "signals.h"
-#include "test.h"
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-misc.h>
-#include <string.h>
-
-#ifdef HAVE_UNIX_FD_PASSING
-#include <dbus/dbus-sysdeps-unix.h>
-#include <unistd.h>
-#endif
-
-/* This is hard-coded in the files in valid-config-files-*. We have to use
- * the debug-pipe transport because the tests in this file require that
- * dbus_connection_open_private() does not block. */
-#define TEST_DEBUG_PIPE "debug-pipe:name=test-server"
-
-static dbus_bool_t
-send_one_message (DBusConnection *connection,
- BusContext *context,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- BusTransaction *transaction,
- DBusError *error)
-{
- if (!bus_context_check_security_policy (context, transaction,
- sender,
- addressed_recipient,
- connection,
- message,
- NULL))
- return TRUE; /* silently don't send it */
-
- if (dbus_message_contains_unix_fds(message) &&
- !dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD))
- return TRUE; /* silently don't send it */
-
- if (!bus_transaction_send (transaction,
- connection,
- message))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_dispatch_matches (BusTransaction *transaction,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- DBusError *error)
-{
- DBusError tmp_error;
- BusConnections *connections;
- DBusList *recipients;
- BusMatchmaker *matchmaker;
- DBusList *link;
- BusContext *context;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* sender and recipient can both be NULL for the bus driver,
- * or for signals with no particular recipient
- */
-
- _dbus_assert (sender == NULL || bus_connection_is_active (sender));
- _dbus_assert (dbus_message_get_sender (message) != NULL);
-
- context = bus_transaction_get_context (transaction);
-
- /* First, send the message to the addressed_recipient, if there is one. */
- if (addressed_recipient != NULL)
- {
- if (!bus_context_check_security_policy (context, transaction,
- sender, addressed_recipient,
- addressed_recipient,
- message, error))
- return FALSE;
-
- if (dbus_message_contains_unix_fds (message) &&
- !dbus_connection_can_send_type (addressed_recipient,
- DBUS_TYPE_UNIX_FD))
- {
- dbus_set_error (error,
- DBUS_ERROR_NOT_SUPPORTED,
- "Tried to send message with Unix file descriptors"
- "to a client that doesn't support that.");
- return FALSE;
- }
-
- /* Dispatch the message */
- if (!bus_transaction_send (transaction, addressed_recipient, message))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- /* Now dispatch to others who look interested in this message */
- connections = bus_transaction_get_connections (transaction);
- dbus_error_init (&tmp_error);
- matchmaker = bus_context_get_matchmaker (context);
-
- recipients = NULL;
- if (!bus_matchmaker_get_recipients (matchmaker, connections,
- sender, addressed_recipient, message,
- &recipients))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- link = _dbus_list_get_first_link (&recipients);
- while (link != NULL)
- {
- DBusConnection *dest;
-
- dest = link->data;
-
- if (!send_one_message (dest, context, sender, addressed_recipient,
- message, transaction, &tmp_error))
- break;
-
- link = _dbus_list_get_next_link (&recipients, link);
- }
-
- _dbus_list_clear (&recipients);
-
- if (dbus_error_is_set (&tmp_error))
- {
- dbus_move_error (&tmp_error, error);
- return FALSE;
- }
- else
- return TRUE;
-}
-
-static DBusHandlerResult
-bus_dispatch (DBusConnection *connection,
- DBusMessage *message)
-{
- const char *sender, *service_name;
- DBusError error;
- BusTransaction *transaction;
- BusContext *context;
- DBusHandlerResult result;
- DBusConnection *addressed_recipient;
-
- result = DBUS_HANDLER_RESULT_HANDLED;
-
- transaction = NULL;
- addressed_recipient = NULL;
- dbus_error_init (&error);
-
- context = bus_connection_get_context (connection);
- _dbus_assert (context != NULL);
-
- /* If we can't even allocate an OOM error, we just go to sleep
- * until we can.
- */
- while (!bus_connection_preallocate_oom_error (connection))
- _dbus_wait_for_memory ();
-
- /* Ref connection in case we disconnect it at some point in here */
- dbus_connection_ref (connection);
-
- service_name = dbus_message_get_destination (message);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- const char *interface_name, *member_name, *error_name;
-
- interface_name = dbus_message_get_interface (message);
- member_name = dbus_message_get_member (message);
- error_name = dbus_message_get_error_name (message);
-
- _dbus_verbose ("DISPATCH: %s %s %s to %s\n",
- interface_name ? interface_name : "(no interface)",
- member_name ? member_name : "(no member)",
- error_name ? error_name : "(no error name)",
- service_name ? service_name : "peer");
- }
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
- /* If service_name is NULL, if it's a signal we send it to all
- * connections with a match rule. If it's not a signal, there
- * are some special cases here but mostly we just bail out.
- */
- if (service_name == NULL)
- {
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- {
- bus_connection_disconnected (connection);
- goto out;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL)
- {
- /* DBusConnection also handles some of these automatically, we leave
- * it to do so.
- */
- result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- goto out;
- }
- }
-
- /* Create our transaction */
- transaction = bus_transaction_new (context);
- if (transaction == NULL)
- {
- BUS_SET_OOM (&error);
- goto out;
- }
-
- /* Assign a sender to the message */
- if (bus_connection_is_active (connection))
- {
- sender = bus_connection_get_name (connection);
- _dbus_assert (sender != NULL);
-
- if (!dbus_message_set_sender (message, sender))
- {
- BUS_SET_OOM (&error);
- goto out;
- }
-
- /* We need to refetch the service name here, because
- * dbus_message_set_sender can cause the header to be
- * reallocated, and thus the service_name pointer will become
- * invalid.
- */
- service_name = dbus_message_get_destination (message);
- }
-
- if (service_name &&
- strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */
- {
- if (!bus_context_check_security_policy (context, transaction,
- connection, NULL, NULL, message, &error))
- {
- _dbus_verbose ("Security policy rejected message\n");
- goto out;
- }
-
- _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS);
- if (!bus_driver_handle_message (connection, transaction, message, &error))
- goto out;
- }
- else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */
- {
- _dbus_verbose ("Received message from non-registered client. Disconnecting.\n");
- dbus_connection_close (connection);
- goto out;
- }
- else if (service_name != NULL) /* route to named service */
- {
- DBusString service_string;
- BusService *service;
- BusRegistry *registry;
-
- _dbus_assert (service_name != NULL);
-
- registry = bus_connection_get_registry (connection);
-
- _dbus_string_init_const (&service_string, service_name);
- service = bus_registry_lookup (registry, &service_string);
-
- if (service == NULL && dbus_message_get_auto_start (message))
- {
- BusActivation *activation;
- /* We can't do the security policy check here, since the addressed
- * recipient service doesn't exist yet. We do it before sending the
- * message after the service has been created.
- */
- activation = bus_connection_get_activation (connection);
-
- if (!bus_activation_activate_service (activation, connection, transaction, TRUE,
- message, service_name, &error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- _dbus_verbose ("bus_activation_activate_service() failed: %s\n", error.name);
- goto out;
- }
-
- goto out;
- }
- else if (service == NULL)
- {
- dbus_set_error (&error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Name \"%s\" does not exist",
- service_name);
- goto out;
- }
- else
- {
- addressed_recipient = bus_service_get_primary_owners_connection (service);
- _dbus_assert (addressed_recipient != NULL);
- }
- }
-
- /* Now send the message to its destination (or not, if
- * addressed_recipient == NULL), and match it against other connections'
- * match rules.
- */
- if (!bus_dispatch_matches (transaction, connection, addressed_recipient, message, &error))
- goto out;
-
- out:
- if (dbus_error_is_set (&error))
- {
- if (!dbus_connection_get_is_connected (connection))
- {
- /* If we disconnected it, we won't bother to send it any error
- * messages.
- */
- _dbus_verbose ("Not sending error to connection we disconnected\n");
- }
- else if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- bus_connection_send_oom_error (connection, message);
-
- /* cancel transaction due to OOM */
- if (transaction != NULL)
- {
- bus_transaction_cancel_and_free (transaction);
- transaction = NULL;
- }
- }
- else
- {
- /* Try to send the real error, if no mem to do that, send
- * the OOM error
- */
- _dbus_assert (transaction != NULL);
- if (!bus_transaction_send_error_reply (transaction, connection,
- &error, message))
- {
- bus_connection_send_oom_error (connection, message);
-
- /* cancel transaction due to OOM */
- if (transaction != NULL)
- {
- bus_transaction_cancel_and_free (transaction);
- transaction = NULL;
- }
- }
- }
-
-
- dbus_error_free (&error);
- }
-
- if (transaction != NULL)
- {
- bus_transaction_execute_and_free (transaction);
- }
-
- dbus_connection_unref (connection);
-
- return result;
-}
-
-static DBusHandlerResult
-bus_dispatch_message_filter (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- return bus_dispatch (connection, message);
-}
-
-dbus_bool_t
-bus_dispatch_add_connection (DBusConnection *connection)
-{
- if (!dbus_connection_add_filter (connection,
- bus_dispatch_message_filter,
- NULL, NULL))
- return FALSE;
-
- return TRUE;
-}
-
-void
-bus_dispatch_remove_connection (DBusConnection *connection)
-{
- /* Here we tell the bus driver that we want to get off. */
- bus_driver_remove_connection (connection);
-
- dbus_connection_remove_filter (connection,
- bus_dispatch_message_filter,
- NULL);
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include <stdio.h>
-
-/* This is used to know whether we need to block in order to finish
- * sending a message, or whether the initial dbus_connection_send()
- * already flushed the queue.
- */
-#define SEND_PENDING(connection) (dbus_connection_has_messages_to_send (connection))
-
-typedef dbus_bool_t (* Check1Func) (BusContext *context);
-typedef dbus_bool_t (* Check2Func) (BusContext *context,
- DBusConnection *connection);
-
-static dbus_bool_t check_no_leftovers (BusContext *context);
-
-static void
-block_connection_until_message_from_bus (BusContext *context,
- DBusConnection *connection,
- const char *what_is_expected)
-{
- _dbus_verbose ("expecting: %s\n", what_is_expected);
-
- while (dbus_connection_get_dispatch_status (connection) ==
- DBUS_DISPATCH_COMPLETE &&
- dbus_connection_get_is_connected (connection))
- {
- bus_test_run_bus_loop (context, TRUE);
- bus_test_run_clients_loop (FALSE);
- }
-}
-
-static void
-spin_connection_until_authenticated (BusContext *context,
- DBusConnection *connection)
-{
- _dbus_verbose ("Spinning to auth connection %p\n", connection);
- while (!dbus_connection_get_is_authenticated (connection) &&
- dbus_connection_get_is_connected (connection))
- {
- bus_test_run_bus_loop (context, FALSE);
- bus_test_run_clients_loop (FALSE);
- }
- _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
-}
-
-/* compensate for fact that pop_message() can return #NULL due to OOM */
-static DBusMessage*
-pop_message_waiting_for_memory (DBusConnection *connection)
-{
- while (dbus_connection_get_dispatch_status (connection) ==
- DBUS_DISPATCH_NEED_MEMORY)
- _dbus_wait_for_memory ();
-
- return dbus_connection_pop_message (connection);
-}
-
-static DBusMessage*
-borrow_message_waiting_for_memory (DBusConnection *connection)
-{
- while (dbus_connection_get_dispatch_status (connection) ==
- DBUS_DISPATCH_NEED_MEMORY)
- _dbus_wait_for_memory ();
-
- return dbus_connection_borrow_message (connection);
-}
-
-static void
-warn_unexpected_real (DBusConnection *connection,
- DBusMessage *message,
- const char *expected,
- const char *function,
- int line)
-{
- if (message)
- _dbus_warn ("%s:%d received message interface \"%s\" member \"%s\" error name \"%s\" on %p, expecting %s\n",
- function, line,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- connection,
- expected);
- else
- _dbus_warn ("%s:%d received no message on %p, expecting %s\n",
- function, line, connection, expected);
-}
-
-#define warn_unexpected(connection, message, expected) \
- warn_unexpected_real (connection, message, expected, _DBUS_FUNCTION_NAME, __LINE__)
-
-static void
-verbose_message_received (DBusConnection *connection,
- DBusMessage *message)
-{
- _dbus_verbose ("Received message interface \"%s\" member \"%s\" error name \"%s\" on %p\n",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- connection);
-}
-
-typedef enum
-{
- SERVICE_CREATED,
- OWNER_CHANGED,
- SERVICE_DELETED
-} ServiceInfoKind;
-
-typedef struct
-{
- ServiceInfoKind expected_kind;
- const char *expected_service_name;
- dbus_bool_t failed;
- DBusConnection *skip_connection;
-} CheckServiceOwnerChangedData;
-
-static dbus_bool_t
-check_service_owner_changed_foreach (DBusConnection *connection,
- void *data)
-{
- CheckServiceOwnerChangedData *d = data;
- DBusMessage *message;
- DBusError error;
- const char *service_name, *old_owner, *new_owner;
-
- if (d->expected_kind == SERVICE_CREATED
- && connection == d->skip_connection)
- return TRUE;
-
- dbus_error_init (&error);
- d->failed = TRUE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a message on %p, expecting %s\n",
- connection, "NameOwnerChanged");
- goto out;
- }
- else if (!dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged"))
- {
- warn_unexpected (connection, message, "NameOwnerChanged");
-
- goto out;
- }
- else
- {
- reget_service_info_data:
- service_name = NULL;
- old_owner = NULL;
- new_owner = NULL;
-
- dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &new_owner,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set (&error))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto reget_service_info_data;
- }
- else
- {
- _dbus_warn ("Did not get the expected arguments\n");
- goto out;
- }
- }
-
- if ((d->expected_kind == SERVICE_CREATED && ( old_owner[0] || !new_owner[0]))
- || (d->expected_kind == OWNER_CHANGED && (!old_owner[0] || !new_owner[0]))
- || (d->expected_kind == SERVICE_DELETED && (!old_owner[0] || new_owner[0])))
- {
- _dbus_warn ("inconsistent NameOwnerChanged arguments\n");
- goto out;
- }
-
- if (strcmp (service_name, d->expected_service_name) != 0)
- {
- _dbus_warn ("expected info on service %s, got info on %s\n",
- d->expected_service_name,
- service_name);
- goto out;
- }
-
- if (*service_name == ':' && new_owner[0]
- && strcmp (service_name, new_owner) != 0)
- {
- _dbus_warn ("inconsistent ServiceOwnedChanged message (\"%s\" [ %s -> %s ])\n",
- service_name, old_owner, new_owner);
- goto out;
- }
- }
-
- d->failed = FALSE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return !d->failed;
-}
-
-
-static void
-kill_client_connection (BusContext *context,
- DBusConnection *connection)
-{
- char *base_service;
- const char *s;
- CheckServiceOwnerChangedData socd;
-
- _dbus_verbose ("killing connection %p\n", connection);
-
- s = dbus_bus_get_unique_name (connection);
- _dbus_assert (s != NULL);
-
- while ((base_service = _dbus_strdup (s)) == NULL)
- _dbus_wait_for_memory ();
-
- dbus_connection_ref (connection);
-
- /* kick in the disconnect handler that unrefs the connection */
- dbus_connection_close (connection);
-
- bus_test_run_everything (context);
-
- _dbus_assert (bus_test_client_listed (connection));
-
- /* Run disconnect handler in test.c */
- if (bus_connection_dispatch_one_message (connection))
- _dbus_assert_not_reached ("something received on connection being killed other than the disconnect");
-
- _dbus_assert (!dbus_connection_get_is_connected (connection));
- dbus_connection_unref (connection);
- connection = NULL;
- _dbus_assert (!bus_test_client_listed (connection));
-
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
-
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- dbus_free (base_service);
-
- if (socd.failed)
- _dbus_assert_not_reached ("didn't get the expected NameOwnerChanged (deletion) messages");
-
- if (!check_no_leftovers (context))
- _dbus_assert_not_reached ("stuff left in message queues after disconnecting a client");
-}
-
-static void
-kill_client_connection_unchecked (DBusConnection *connection)
-{
- /* This kills the connection without expecting it to affect
- * the rest of the bus.
- */
- _dbus_verbose ("Unchecked kill of connection %p\n", connection);
-
- dbus_connection_ref (connection);
- dbus_connection_close (connection);
- /* dispatching disconnect handler will unref once */
- if (bus_connection_dispatch_one_message (connection))
- _dbus_assert_not_reached ("message other than disconnect dispatched after failure to register");
-
- _dbus_assert (!bus_test_client_listed (connection));
- dbus_connection_unref (connection);
-}
-
-typedef struct
-{
- dbus_bool_t failed;
-} CheckNoMessagesData;
-
-static dbus_bool_t
-check_no_messages_foreach (DBusConnection *connection,
- void *data)
-{
- CheckNoMessagesData *d = data;
- DBusMessage *message;
-
- message = pop_message_waiting_for_memory (connection);
- if (message != NULL)
- {
- warn_unexpected (connection, message, "no messages");
-
- d->failed = TRUE;
- }
-
- if (message)
- dbus_message_unref (message);
- return !d->failed;
-}
-
-static dbus_bool_t
-check_no_leftovers (BusContext *context)
-{
- CheckNoMessagesData nmd;
-
- nmd.failed = FALSE;
- bus_test_clients_foreach (check_no_messages_foreach,
- &nmd);
-
- if (nmd.failed)
- {
- _dbus_verbose ("leftover message found\n");
- return FALSE;
- }
- else
- return TRUE;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_hello_message (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- DBusMessage *name_message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- DBusError error;
- const char *name;
- const char *acquired;
-
- retval = FALSE;
- dbus_error_init (&error);
- name = NULL;
- acquired = NULL;
- message = NULL;
- name_message = NULL;
-
- _dbus_verbose ("check_hello_message for %p\n", connection);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "Hello");
-
- if (message == NULL)
- return TRUE;
-
- dbus_connection_ref (connection); /* because we may get disconnected */
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- dbus_connection_unref (connection);
- return TRUE;
- }
-
- _dbus_assert (dbus_message_has_signature (message, ""));
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected (presumably auth failed)\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected (presumably auth failed)\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- block_connection_until_message_from_bus (context, connection, "reply to Hello");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected (presumably auth failed)\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Hello", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- CheckServiceOwnerChangedData socd;
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- ; /* good, expected */
- }
- else
- {
- warn_unexpected (connection, message, "method return for Hello");
-
- goto out;
- }
-
- retry_get_hello_name:
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("no memory to get service name arg from hello\n");
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto retry_get_hello_name;
- }
- else
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Did not get the expected single string argument to hello\n");
- goto out;
- }
- }
-
- _dbus_verbose ("Got hello name: %s\n", name);
-
- while (!dbus_bus_set_unique_name (connection, name))
- _dbus_wait_for_memory ();
-
- socd.expected_kind = SERVICE_CREATED;
- socd.expected_service_name = name;
- socd.failed = FALSE;
- socd.skip_connection = connection; /* we haven't done AddMatch so won't get it ourselves */
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- name_message = message;
- /* Client should also have gotten ServiceAcquired */
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Expecting %s, got nothing\n",
- "NameAcquired");
- goto out;
- }
- if (! dbus_message_is_signal (message, DBUS_INTERFACE_DBUS,
- "NameAcquired"))
- {
- _dbus_warn ("Expecting %s, got smthg else\n",
- "NameAcquired");
- goto out;
- }
-
- retry_get_acquired_name:
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &acquired,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("no memory to get service name arg from acquired\n");
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto retry_get_acquired_name;
- }
- else
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Did not get the expected single string argument to ServiceAcquired\n");
- goto out;
- }
- }
-
- _dbus_verbose ("Got acquired name: %s\n", acquired);
-
- if (strcmp (acquired, name) != 0)
- {
- _dbus_warn ("Acquired name is %s but expected %s\n",
- acquired, name);
- goto out;
- }
- acquired = NULL;
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- _dbus_verbose ("ending - retval = %d\n", retval);
-
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- if (name_message)
- dbus_message_unref (name_message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_double_hello_message (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- DBusError error;
-
- retval = FALSE;
- dbus_error_init (&error);
- message = NULL;
-
- _dbus_verbose ("check_double_hello_message for %p\n", connection);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "Hello");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- dbus_connection_ref (connection); /* because we may get disconnected */
- block_connection_until_message_from_bus (context, connection, "reply to Hello");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Hello", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
- {
- warn_unexpected (connection, message, "method return for Hello");
- goto out;
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_get_connection_unix_user (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- DBusError error;
- const char *base_service_name;
- dbus_uint32_t uid;
-
- retval = FALSE;
- dbus_error_init (&error);
- message = NULL;
-
- _dbus_verbose ("check_get_connection_unix_user for %p\n", connection);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "GetConnectionUnixUser");
-
- if (message == NULL)
- return TRUE;
-
- base_service_name = dbus_bus_get_unique_name (connection);
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &base_service_name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- dbus_message_unref (message);
- message = NULL;
-
- dbus_connection_ref (connection); /* because we may get disconnected */
- block_connection_until_message_from_bus (context, connection, "reply to GetConnectionUnixUser");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "GetConnectionUnixUser", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (dbus_message_is_error (message, DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- ; /* good, expected */
- }
- else
- {
- warn_unexpected (connection, message,
- "method_return for GetConnectionUnixUser");
-
- goto out;
- }
-
- retry_get_property:
-
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_UINT32, &uid,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("no memory to get uid by GetConnectionUnixUser\n");
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto retry_get_property;
- }
- else
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Did not get the expected DBUS_TYPE_UINT32 from GetConnectionUnixUser\n");
- goto out;
- }
- }
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_get_connection_unix_process_id (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- DBusError error;
- const char *base_service_name;
- dbus_uint32_t pid;
-
- retval = FALSE;
- dbus_error_init (&error);
- message = NULL;
-
- _dbus_verbose ("check_get_connection_unix_process_id for %p\n", connection);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "GetConnectionUnixProcessID");
-
- if (message == NULL)
- return TRUE;
-
- base_service_name = dbus_bus_get_unique_name (connection);
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &base_service_name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- dbus_message_unref (message);
- message = NULL;
-
- dbus_connection_ref (connection); /* because we may get disconnected */
- block_connection_until_message_from_bus (context, connection, "reply to GetConnectionUnixProcessID");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "GetConnectionUnixProcessID", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (dbus_message_is_error (message, DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
-#ifdef DBUS_WIN
- else if (dbus_message_is_error (message, DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN))
- {
- /* We are expecting this error, since we know in the test suite we aren't
- * talking to a client running on UNIX
- */
- _dbus_verbose ("Windows correctly does not support GetConnectionUnixProcessID\n");
- }
-#endif
- else
- {
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__linux__) || \
- defined(__OpenBSD__)
- warn_unexpected (connection, message, "not this error");
-
- goto out;
-#else
- _dbus_verbose ("does not support GetConnectionUnixProcessID but perhaps that's OK?\n");
-#endif
- }
- }
- else
- {
-#ifdef DBUS_WIN
- warn_unexpected (connection, message, "GetConnectionUnixProcessID to fail on Windows");
- goto out;
-#else
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- ; /* good, expected */
- }
- else
- {
- warn_unexpected (connection, message,
- "method_return for GetConnectionUnixProcessID");
-
- goto out;
- }
-
- retry_get_property:
-
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_UINT32, &pid,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("no memory to get pid by GetConnectionUnixProcessID\n");
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto retry_get_property;
- }
- else
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Did not get the expected DBUS_TYPE_UINT32 from GetConnectionUnixProcessID\n");
- goto out;
- }
- }
- else
- {
- /* test if returned pid is the same as our own pid
- *
- * @todo It would probably be good to restructure the tests
- * in a way so our parent is the bus that we're testing
- * cause then we can test that the pid returned matches
- * getppid()
- */
- if (pid != (dbus_uint32_t) _dbus_getpid ())
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Result from GetConnectionUnixProcessID is not our own pid\n");
- goto out;
- }
- }
-#endif /* !DBUS_WIN */
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_add_match_all (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- dbus_uint32_t serial;
- DBusError error;
- const char *empty = "";
-
- retval = FALSE;
- dbus_error_init (&error);
- message = NULL;
-
- _dbus_verbose ("check_add_match_all for %p\n", connection);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "AddMatch");
-
- if (message == NULL)
- return TRUE;
-
- /* empty string match rule matches everything */
- if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &empty,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- dbus_connection_ref (connection); /* because we may get disconnected */
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- block_connection_until_message_from_bus (context, connection, "reply to AddMatch");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "AddMatch", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- ; /* good, expected */
- _dbus_assert (dbus_message_get_reply_serial (message) == serial);
- }
- else
- {
- warn_unexpected (connection, message, "method return for AddMatch");
-
- goto out;
- }
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_hello_connection (BusContext *context)
-{
- DBusConnection *connection;
- DBusError error;
-
- dbus_error_init (&error);
-
- connection = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (connection == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- dbus_error_free (&error);
- return TRUE;
- }
-
- if (!bus_setup_debug_client (connection))
- {
- dbus_connection_close (connection);
- dbus_connection_unref (connection);
- return TRUE;
- }
-
- spin_connection_until_authenticated (context, connection);
-
- if (!check_hello_message (context, connection))
- return FALSE;
-
- if (dbus_bus_get_unique_name (connection) == NULL)
- {
- /* We didn't successfully register, so we can't
- * do the usual kill_client_connection() checks
- */
- kill_client_connection_unchecked (connection);
- }
- else
- {
- if (!check_add_match_all (context, connection))
- return FALSE;
-
- kill_client_connection (context, connection);
- }
-
- return TRUE;
-}
-
-#define NONEXISTENT_SERVICE_NAME "test.this.service.does.not.exist.ewuoiurjdfxcvn"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_nonexistent_service_no_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *nonexistent = NONEXISTENT_SERVICE_NAME;
- dbus_uint32_t flags;
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "StartServiceByName");
-
- if (message == NULL)
- return TRUE;
-
- dbus_message_set_auto_start (message, FALSE);
-
- flags = 0;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &nonexistent,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to ActivateService on nonexistent");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "StartServiceByName", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SERVICE_UNKNOWN))
- {
- ; /* good, this is expected also */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully activate %s\n",
- NONEXISTENT_SERVICE_NAME);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_nonexistent_service_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (NONEXISTENT_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to Echo");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
-
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SERVICE_UNKNOWN))
- {
- ; /* good, this is expected also */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully activate %s\n",
- NONEXISTENT_SERVICE_NAME);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-static dbus_bool_t
-check_base_service_activated (BusContext *context,
- DBusConnection *connection,
- DBusMessage *initial_message,
- const char **base_service_p)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- DBusError error;
- const char *base_service, *base_service_from_bus, *old_owner;
-
- retval = FALSE;
-
- dbus_error_init (&error);
- base_service = NULL;
- old_owner = NULL;
- base_service_from_bus = NULL;
-
- message = initial_message;
- dbus_message_ref (message);
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged"))
- {
- CheckServiceOwnerChangedData socd;
-
- reget_service_name_arg:
- base_service = NULL;
- old_owner = NULL;
- base_service_from_bus = NULL;
-
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &base_service,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &base_service_from_bus,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto reget_service_name_arg;
- }
- else
- {
- _dbus_warn ("Message %s doesn't have a service name: %s\n",
- "NameOwnerChanged (creation)",
- error.message);
- goto out;
- }
- }
-
- if (*base_service != ':')
- {
- _dbus_warn ("Expected base service activation, got \"%s\" instead\n",
- base_service);
- goto out;
- }
-
- if (strcmp (base_service, base_service_from_bus) != 0)
- {
- _dbus_warn ("Expected base service activation, got \"%s\" instead with owner \"%s\"\n",
- base_service, base_service_from_bus);
- goto out;
- }
-
- if (old_owner[0])
- {
- _dbus_warn ("Received an old_owner argument during base service activation, \"%s\"\n",
- old_owner);
- goto out;
- }
-
- socd.expected_kind = SERVICE_CREATED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = connection;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
- }
- else
- {
- warn_unexpected (connection, message, "NameOwnerChanged (creation) for base service");
-
- goto out;
- }
-
- if (base_service_p)
- *base_service_p = base_service;
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
- dbus_error_free (&error);
-
- return retval;
-}
-
-static dbus_bool_t
-check_service_activated (BusContext *context,
- DBusConnection *connection,
- const char *activated_name,
- const char *base_service_name,
- DBusMessage *initial_message)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- DBusError error;
- dbus_uint32_t activation_result;
-
- retval = FALSE;
-
- dbus_error_init (&error);
-
- message = initial_message;
- dbus_message_ref (message);
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged"))
- {
- CheckServiceOwnerChangedData socd;
- const char *service_name, *base_service_from_bus, *old_owner;
-
- reget_service_name_arg:
- service_name = NULL;
- old_owner = NULL;
- base_service_from_bus = NULL;
-
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &base_service_from_bus,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto reget_service_name_arg;
- }
- else
- {
- _dbus_warn ("Message %s doesn't have a service name: %s\n",
- "NameOwnerChanged (creation)",
- error.message);
- goto out;
- }
- }
-
- if (strcmp (service_name, activated_name) != 0)
- {
- _dbus_warn ("Expected to see service %s created, saw %s instead\n",
- activated_name, service_name);
- goto out;
- }
-
- if (strcmp (base_service_name, base_service_from_bus) != 0)
- {
- _dbus_warn ("NameOwnerChanged reports wrong base service: %s owner, expected %s instead\n",
- base_service_from_bus, base_service_name);
- goto out;
- }
-
- if (old_owner[0])
- {
- _dbus_warn ("expected a %s, got a %s\n",
- "NameOwnerChanged (creation)",
- "NameOwnerChanged (change)");
- goto out;
- }
-
- socd.expected_kind = SERVICE_CREATED;
- socd.skip_connection = connection;
- socd.failed = FALSE;
- socd.expected_service_name = service_name;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- dbus_message_unref (message);
- service_name = NULL;
- old_owner = NULL;
- base_service_from_bus = NULL;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Expected a reply to %s, got nothing\n",
- "StartServiceByName");
- goto out;
- }
- }
- else
- {
- warn_unexpected (connection, message, "NameOwnerChanged for the activated name");
-
- goto out;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- warn_unexpected (connection, message, "reply to StartServiceByName");
-
- goto out;
- }
-
- activation_result = 0;
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_UINT32, &activation_result,
- DBUS_TYPE_INVALID))
- {
- if (!dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_warn ("Did not have activation result first argument to %s: %s\n",
- "StartServiceByName", error.message);
- goto out;
- }
-
- dbus_error_free (&error);
- }
- else
- {
- if (activation_result == DBUS_START_REPLY_SUCCESS)
- ; /* Good */
- else if (activation_result == DBUS_START_REPLY_ALREADY_RUNNING)
- ; /* Good also */
- else
- {
- _dbus_warn ("Activation result was %u, no good.\n",
- activation_result);
- goto out;
- }
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after verifying existent activation results\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
- dbus_error_free (&error);
-
- return retval;
-}
-
-static dbus_bool_t
-check_service_auto_activated (BusContext *context,
- DBusConnection *connection,
- const char *activated_name,
- const char *base_service_name,
- DBusMessage *initial_message)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- DBusError error;
-
- retval = FALSE;
-
- dbus_error_init (&error);
-
- message = initial_message;
- dbus_message_ref (message);
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged"))
- {
- const char *service_name;
- CheckServiceOwnerChangedData socd;
-
- reget_service_name_arg:
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto reget_service_name_arg;
- }
- else
- {
- _dbus_warn ("Message %s doesn't have a service name: %s\n",
- "NameOwnerChanged",
- error.message);
- dbus_error_free (&error);
- goto out;
- }
- }
-
- if (strcmp (service_name, activated_name) != 0)
- {
- _dbus_warn ("Expected to see service %s created, saw %s instead\n",
- activated_name, service_name);
- goto out;
- }
-
- socd.expected_kind = SERVICE_CREATED;
- socd.expected_service_name = service_name;
- socd.failed = FALSE;
- socd.skip_connection = connection;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- /* Note that this differs from regular activation in that we don't get a
- * reply to ActivateService here.
- */
-
- dbus_message_unref (message);
- message = NULL;
- service_name = NULL;
- }
- else
- {
- warn_unexpected (connection, message, "NameOwnerChanged for the activated name");
-
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-static dbus_bool_t
-check_service_deactivated (BusContext *context,
- DBusConnection *connection,
- const char *activated_name,
- const char *base_service)
-{
- dbus_bool_t retval;
- CheckServiceOwnerChangedData socd;
-
- retval = FALSE;
-
- /* Now we are expecting ServiceOwnerChanged (deletion) messages for the base
- * service and the activated_name. The base service
- * notification is required to come last.
- */
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = activated_name;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- retval = TRUE;
-
- out:
- return retval;
-}
-
-static dbus_bool_t
-check_send_exit_to_service (BusContext *context,
- DBusConnection *connection,
- const char *service_name,
- const char *base_service)
-{
- dbus_bool_t got_error;
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- _dbus_verbose ("Sending exit message to the test service\n");
-
- retval = FALSE;
-
- /* Kill off the test service by sending it a quit message */
- message = dbus_message_new_method_call (service_name,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Exit");
-
- if (message == NULL)
- {
- /* Do this again; we still need the service to exit... */
- if (!check_send_exit_to_service (context, connection,
- service_name, base_service))
- goto out;
-
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
-
- /* Do this again; we still need the service to exit... */
- if (!check_send_exit_to_service (context, connection,
- service_name, base_service))
- goto out;
-
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- /* send message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- /* read it in and write it out to test service */
- bus_test_run_bus_loop (context, FALSE);
-
- /* see if we got an error during message bus dispatching */
- bus_test_run_clients_loop (FALSE);
- message = borrow_message_waiting_for_memory (connection);
- got_error = message != NULL && dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR;
- if (message)
- {
- dbus_connection_return_message (connection, message);
- message = NULL;
- }
-
- if (!got_error)
- {
- /* If no error, wait for the test service to exit */
- block_connection_until_message_from_bus (context, connection, "test service to exit");
-
- bus_test_run_everything (context);
- }
-
- if (got_error)
- {
- message = pop_message_waiting_for_memory (connection);
- _dbus_assert (message != NULL);
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- warn_unexpected (connection, message,
- "error with the correct reply serial");
- goto out;
- }
-
- if (!dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- warn_unexpected (connection, message,
- "a no memory error from asking test service to exit");
- goto out;
- }
-
- _dbus_verbose ("Got error %s when asking test service to exit\n",
- dbus_message_get_error_name (message));
-
- /* Do this again; we still need the service to exit... */
- if (!check_send_exit_to_service (context, connection,
- service_name, base_service))
- goto out;
- }
- else
- {
- if (!check_service_deactivated (context, connection,
- service_name, base_service))
- goto out;
-
- /* Should now have a NoReply error from the Exit() method
- * call; it should have come after all the deactivation
- * stuff.
- */
- message = pop_message_waiting_for_memory (connection);
-
- if (message == NULL)
- {
- warn_unexpected (connection, NULL,
- "reply to Exit() method call");
- goto out;
- }
- if (!dbus_message_is_error (message,
- DBUS_ERROR_NO_REPLY))
- {
- warn_unexpected (connection, message,
- "NoReply error from Exit() method call");
- goto out;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- warn_unexpected (connection, message,
- "error with the correct reply serial");
- goto out;
- }
-
- _dbus_verbose ("Got error %s after test service exited\n",
- dbus_message_get_error_name (message));
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after %s\n",
- _DBUS_FUNCTION_NAME);
- goto out;
- }
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-static dbus_bool_t
-check_got_error (BusContext *context,
- DBusConnection *connection,
- const char *first_error_name,
- ...)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- va_list ap;
- dbus_bool_t error_found;
- const char *error_name;
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not get an expected error\n");
- goto out;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
- {
- warn_unexpected (connection, message, "an error");
-
- goto out;
- }
-
- error_found = FALSE;
-
- va_start (ap, first_error_name);
- error_name = first_error_name;
- while (error_name != NULL)
- {
- if (dbus_message_is_error (message, error_name))
- {
- error_found = TRUE;
- break;
- }
- error_name = va_arg (ap, char*);
- }
- va_end (ap);
-
- if (!error_found)
- {
- _dbus_warn ("Expected error %s or other, got %s instead\n",
- first_error_name,
- dbus_message_get_error_name (message));
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-typedef enum
-{
- GOT_SERVICE_CREATED,
- GOT_SERVICE_DELETED,
- GOT_ERROR,
- GOT_SOMETHING_ELSE
-} GotServiceInfo;
-
-static GotServiceInfo
-check_got_service_info (DBusMessage *message)
-{
- GotServiceInfo message_kind;
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged"))
- {
- DBusError error;
- const char *service_name, *old_owner, *new_owner;
- dbus_error_init (&error);
-
- reget_service_info_data:
- service_name = NULL;
- old_owner = NULL;
- new_owner = NULL;
-
- dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &new_owner,
- DBUS_TYPE_INVALID);
- if (dbus_error_is_set (&error))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- goto reget_service_info_data;
- }
- else
- {
- _dbus_warn ("unexpected arguments for NameOwnerChanged message\n");
- message_kind = GOT_SOMETHING_ELSE;
- }
- }
- else if (!old_owner[0])
- message_kind = GOT_SERVICE_CREATED;
- else if (!new_owner[0])
- message_kind = GOT_SERVICE_DELETED;
- else
- message_kind = GOT_SOMETHING_ELSE;
-
- dbus_error_free (&error);
- }
- else if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- message_kind = GOT_ERROR;
- else
- message_kind = GOT_SOMETHING_ELSE;
-
- return message_kind;
-}
-
-#define EXISTENT_SERVICE_NAME "org.freedesktop.DBus.TestSuiteEchoService"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_existent_service_no_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- DBusMessage *base_service_message;
- const char *base_service;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *existent = EXISTENT_SERVICE_NAME;
- dbus_uint32_t flags;
-
- base_service_message = NULL;
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "StartServiceByName");
-
- if (message == NULL)
- return TRUE;
-
- dbus_message_set_auto_start (message, FALSE);
-
- flags = 0;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &existent,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* now wait for the message bus to hear back from the activated
- * service.
- */
- block_connection_until_message_from_bus (context, connection, "activated service to connect");
-
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after %s %d on %p\n",
- "StartServiceByName", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
- _dbus_verbose (" (after sending %s)\n", "StartServiceByName");
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_EXITED) ||
- dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_SIGNALED) ||
- dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_EXEC_FAILED))
- {
- ; /* good, this is expected also */
- }
- else
- {
- _dbus_warn ("Did not expect error %s\n",
- dbus_message_get_error_name (message));
- goto out;
- }
- }
- else
- {
- GotServiceInfo message_kind;
-
- if (!check_base_service_activated (context, connection,
- message, &base_service))
- goto out;
-
- base_service_message = message;
- message = NULL;
-
- /* We may need to block here for the test service to exit or finish up */
- block_connection_until_message_from_bus (context, connection, "test service to exit or finish up");
-
- message = dbus_connection_borrow_message (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after base service creation notification\n");
- goto out;
- }
-
- message_kind = check_got_service_info (message);
-
- dbus_connection_return_message (connection, message);
- message = NULL;
-
- switch (message_kind)
- {
- case GOT_SOMETHING_ELSE:
- _dbus_warn ("Unexpected message after ActivateService "
- "(should be an error or a service announcement");
- goto out;
-
- case GOT_ERROR:
- if (!check_got_error (context, connection,
- DBUS_ERROR_SPAWN_CHILD_EXITED,
- DBUS_ERROR_NO_MEMORY,
- NULL))
- goto out;
- /* A service deleted should be coming along now after this error.
- * We can also get the error *after* the service deleted.
- */
-
- /* fall through */
-
- case GOT_SERVICE_DELETED:
- {
- /* The service started up and got a base address, but then
- * failed to register under EXISTENT_SERVICE_NAME
- */
- CheckServiceOwnerChangedData socd;
-
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
-
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- /* Now we should get an error about the service exiting
- * if we didn't get it before.
- */
- if (message_kind != GOT_ERROR)
- {
- block_connection_until_message_from_bus (context, connection, "error about service exiting");
-
- /* and process everything again */
- bus_test_run_everything (context);
-
- if (!check_got_error (context, connection,
- DBUS_ERROR_SPAWN_CHILD_EXITED,
- DBUS_ERROR_NO_MEMORY,
- NULL))
- goto out;
- }
- break;
- }
-
- case GOT_SERVICE_CREATED:
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message we just put back! "
- "should have been a NameOwnerChanged (creation)\n");
- goto out;
- }
-
- if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
- base_service, message))
- goto out;
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after successful activation\n");
- goto out;
- }
-
- if (!check_send_exit_to_service (context, connection,
- EXISTENT_SERVICE_NAME, base_service))
- goto out;
-
- break;
- }
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- if (base_service_message)
- dbus_message_unref (base_service_message);
-
- return retval;
-}
-
-#ifndef DBUS_WIN_FIXME
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_segfault_service_no_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *segv_service;
- dbus_uint32_t flags;
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "StartServiceByName");
-
- if (message == NULL)
- return TRUE;
-
- dbus_message_set_auto_start (message, FALSE);
-
- segv_service = "org.freedesktop.DBus.TestSuiteSegfaultService";
- flags = 0;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &segv_service,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to activating segfault service");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "StartServiceByName", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_FAILED))
- {
- const char *servicehelper;
- servicehelper = bus_context_get_servicehelper (context);
- /* make sure this only happens with the launch helper */
- _dbus_assert (servicehelper != NULL);
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_SIGNALED))
- {
- ; /* good, this is expected also */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully activate segfault service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_segfault_service_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteSegfaultService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to Echo on segfault service");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_SIGNALED))
- {
- ; /* good, this is expected also */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully activate segfault service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-#endif
-
-#define TEST_ECHO_MESSAGE "Test echo message"
-#define TEST_RUN_HELLO_FROM_SELF_MESSAGE "Test sending message to self"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_existent_hello_from_self (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- const char *text;
-
- message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "RunHelloFromSelf");
-
- if (message == NULL)
- return TRUE;
-
- text = TEST_RUN_HELLO_FROM_SELF_MESSAGE;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* Note: if this test is run in OOM mode, it will block when the bus
- * doesn't send a reply due to OOM.
- */
- block_connection_until_message_from_bus (context, connection, "reply from running hello from self");
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message! Should have been reply from RunHelloFromSelf message\n");
- return FALSE;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- _dbus_warn ("Wrong reply serial\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- return TRUE;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_existent_ping (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.DBus.Peer",
- "Ping");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* Note: if this test is run in OOM mode, it will block when the bus
- * doesn't send a reply due to OOM.
- */
- block_connection_until_message_from_bus (context, connection, "reply from running Ping");
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message! Should have been reply from Ping message\n");
- return FALSE;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- _dbus_warn ("Wrong reply serial\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- _dbus_warn ("Unexpected message return during Ping\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- return TRUE;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_existent_get_machine_id (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- const char *machine_id;
-
- message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.DBus.Peer",
- "GetMachineId");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* Note: if this test is run in OOM mode, it will block when the bus
- * doesn't send a reply due to OOM.
- */
- block_connection_until_message_from_bus (context, connection, "reply from running GetMachineId");
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message! Should have been reply from GetMachineId message\n");
- return FALSE;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- _dbus_warn ("Wrong reply serial\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- _dbus_warn ("Unexpected message return during GetMachineId\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- machine_id = NULL;
- if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &machine_id, DBUS_TYPE_INVALID))
- {
- _dbus_warn ("Did not get a machine ID in reply to GetMachineId\n");
- dbus_message_unref (message);
- return FALSE;
- }
-
- if (machine_id == NULL || strlen (machine_id) != 32)
- {
- _dbus_warn ("Machine id looks bogus: '%s'\n", machine_id ? machine_id : "null");
- dbus_message_unref (message);
- return FALSE;
- }
-
- /* We can't check that the machine id is correct because during make check it is
- * just made up for each process separately
- */
-
- dbus_message_unref (message);
- message = NULL;
-
- return TRUE;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_existent_service_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- DBusMessage *base_service_message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *base_service;
- const char *text;
-
- base_service_message = NULL;
-
- message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- text = TEST_ECHO_MESSAGE;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* now wait for the message bus to hear back from the activated
- * service.
- */
- block_connection_until_message_from_bus (context, connection, "reply to Echo on existent service");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after auto start %d on %p\n",
- serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
- _dbus_verbose (" (after sending %s)\n", "auto start");
-
- /* we should get zero or two ServiceOwnerChanged signals */
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL)
- {
- GotServiceInfo message_kind;
-
- if (!check_base_service_activated (context, connection,
- message, &base_service))
- goto out;
-
- base_service_message = message;
- message = NULL;
-
- /* We may need to block here for the test service to exit or finish up */
- block_connection_until_message_from_bus (context, connection, "service to exit");
-
- /* Should get a service creation notification for the activated
- * service name, or a service deletion on the base service name
- */
- message = dbus_connection_borrow_message (connection);
- if (message == NULL)
- {
- _dbus_warn ("No message after auto activation "
- "(should be a service announcement)\n");
- dbus_connection_return_message (connection, message);
- message = NULL;
- goto out;
- }
-
- message_kind = check_got_service_info (message);
-
- dbus_connection_return_message (connection, message);
- message = NULL;
-
- switch (message_kind)
- {
- case GOT_SERVICE_CREATED:
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message we just put back! "
- "should have been a NameOwnerChanged (creation)\n");
- goto out;
- }
-
- /* Check that ServiceOwnerChanged (creation) was correctly received */
- if (!check_service_auto_activated (context, connection, EXISTENT_SERVICE_NAME,
- base_service, message))
- goto out;
-
- dbus_message_unref (message);
- message = NULL;
-
- break;
-
- case GOT_SERVICE_DELETED:
- {
- /* The service started up and got a base address, but then
- * failed to register under EXISTENT_SERVICE_NAME
- */
- CheckServiceOwnerChangedData socd;
-
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- break;
- }
-
- case GOT_ERROR:
- case GOT_SOMETHING_ELSE:
- _dbus_warn ("Unexpected message after auto activation\n");
- goto out;
- }
- }
-
- /* OK, now we've dealt with ServiceOwnerChanged signals, now should
- * come the method reply (or error) from the initial method call
- */
-
- /* Note: if this test is run in OOM mode, it will block when the bus
- * doesn't send a reply due to OOM.
- */
- block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message! Should have been reply from echo message\n");
- goto out;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- _dbus_warn ("Wrong reply serial\n");
- goto out;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!check_existent_ping (context, connection))
- goto out;
-
- if (!check_existent_get_machine_id (context, connection))
- goto out;
-
- if (!check_existent_hello_from_self (context, connection))
- goto out;
-
- if (!check_send_exit_to_service (context, connection,
- EXISTENT_SERVICE_NAME,
- base_service))
- goto out;
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- if (base_service_message)
- dbus_message_unref (base_service_message);
-
- return retval;
-}
-
-#define SERVICE_FILE_MISSING_NAME "org.freedesktop.DBus.TestSuiteEchoServiceDotServiceFileDoesNotExist"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_launch_service_file_missing (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (SERVICE_FILE_MISSING_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to service file missing should fail to auto-start");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SERVICE_UNKNOWN))
- {
- _dbus_verbose("got service unknown\n");
- ; /* good, this is expected (only valid when using launch helper) */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully auto-start missing service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-#define SERVICE_USER_MISSING_NAME "org.freedesktop.DBus.TestSuiteNoUser"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_launch_service_user_missing (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (SERVICE_USER_MISSING_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection,
- "reply to service which should fail to auto-start (missing User)");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_warn ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_FILE_INVALID))
- {
- _dbus_verbose("got service file invalid\n");
- ; /* good, this is expected (only valid when using launch helper) */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully auto-start missing service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-#define SERVICE_EXEC_MISSING_NAME "org.freedesktop.DBus.TestSuiteNoExec"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_launch_service_exec_missing (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (SERVICE_EXEC_MISSING_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection,
- "reply to service which should fail to auto-start (missing Exec)");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_warn ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SERVICE_UNKNOWN))
- {
- _dbus_verbose("could not activate as invalid service file was not added\n");
- ; /* good, this is expected as we shouldn't have been added to
- * the activation list with a missing Exec key */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_FILE_INVALID))
- {
- _dbus_verbose("got service file invalid\n");
- ; /* good, this is allowed, and is the message passed back from the
- * launch helper */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully auto-start missing service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-#define SERVICE_SERVICE_MISSING_NAME "org.freedesktop.DBus.TestSuiteNoService"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_launch_service_service_missing (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (SERVICE_SERVICE_MISSING_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection,
- "reply to service which should fail to auto-start (missing Service)");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_warn ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SERVICE_UNKNOWN))
- {
- _dbus_verbose("could not activate as invalid service file was not added\n");
- ; /* good, this is expected as we shouldn't have been added to
- * the activation list with a missing Exec key */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_FILE_INVALID))
- {
- _dbus_verbose("got service file invalid\n");
- ; /* good, this is allowed, and is the message passed back from the
- * launch helper */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully auto-start missing service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-#define SHELL_FAIL_SERVICE_NAME "org.freedesktop.DBus.TestSuiteShellEchoServiceFail"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_shell_fail_service_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
-
- message = dbus_message_new_method_call (SHELL_FAIL_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
- block_connection_until_message_from_bus (context, connection, "reply to shell Echo on service which should fail to auto-start");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- "Echo message (auto activation)", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_INVALID_ARGS))
- {
- _dbus_verbose("got invalid args\n");
- ; /* good, this is expected also */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- _dbus_warn ("Did not expect to successfully auto-start shell fail service\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-#define SHELL_SUCCESS_SERVICE_NAME "org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess"
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_shell_service_success_auto_start (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- DBusMessage *base_service_message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *base_service;
- const char *argv[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
-
- base_service_message = NULL;
-
- message = dbus_message_new_method_call (SHELL_SUCCESS_SERVICE_NAME,
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* now wait for the message bus to hear back from the activated
- * service.
- */
- block_connection_until_message_from_bus (context, connection, "reply to Echo on shell success service");
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after auto start %d on %p\n",
- serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
- _dbus_verbose (" (after sending %s)\n", "auto start");
-
- /* we should get zero or two ServiceOwnerChanged signals */
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL)
- {
- GotServiceInfo message_kind;
-
- if (!check_base_service_activated (context, connection,
- message, &base_service))
- goto out;
-
- base_service_message = message;
- message = NULL;
-
- /* We may need to block here for the test service to exit or finish up */
- block_connection_until_message_from_bus (context, connection, "service to exit");
-
- /* Should get a service creation notification for the activated
- * service name, or a service deletion on the base service name
- */
- message = dbus_connection_borrow_message (connection);
- if (message == NULL)
- {
- _dbus_warn ("No message after auto activation "
- "(should be a service announcement)\n");
- dbus_connection_return_message (connection, message);
- message = NULL;
- goto out;
- }
-
- message_kind = check_got_service_info (message);
-
- dbus_connection_return_message (connection, message);
- message = NULL;
-
- switch (message_kind)
- {
- case GOT_SERVICE_CREATED:
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message we just put back! "
- "should have been a NameOwnerChanged (creation)\n");
- goto out;
- }
-
- /* Check that ServiceOwnerChanged (creation) was correctly received */
- if (!check_service_auto_activated (context, connection, SHELL_SUCCESS_SERVICE_NAME,
- base_service, message))
- goto out;
-
- dbus_message_unref (message);
- message = NULL;
-
- break;
-
- case GOT_SERVICE_DELETED:
- {
- /* The service started up and got a base address, but then
- * failed to register under SHELL_SUCCESS_SERVICE_NAME
- */
- CheckServiceOwnerChangedData socd;
-
- socd.expected_kind = SERVICE_DELETED;
- socd.expected_service_name = base_service;
- socd.failed = FALSE;
- socd.skip_connection = NULL;
- bus_test_clients_foreach (check_service_owner_changed_foreach,
- &socd);
-
- if (socd.failed)
- goto out;
-
- break;
- }
-
- case GOT_ERROR:
- case GOT_SOMETHING_ELSE:
- _dbus_warn ("Unexpected message after auto activation\n");
- goto out;
- }
- }
-
- /* OK, now we've dealt with ServiceOwnerChanged signals, now should
- * come the method reply (or error) from the initial method call
- */
-
- /* Note: if this test is run in OOM mode, it will block when the bus
- * doesn't send a reply due to OOM.
- */
- block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message! Should have been reply from echo message\n");
- goto out;
- }
-
- if (dbus_message_get_reply_serial (message) != serial)
- {
- _dbus_warn ("Wrong reply serial\n");
- goto out;
- }
-
- if (!dbus_message_get_args (message, NULL,
- DBUS_TYPE_STRING, &argv[0],
- DBUS_TYPE_STRING, &argv[1],
- DBUS_TYPE_STRING, &argv[2],
- DBUS_TYPE_STRING, &argv[3],
- DBUS_TYPE_STRING, &argv[4],
- DBUS_TYPE_STRING, &argv[5],
- DBUS_TYPE_STRING, &argv[6],
- DBUS_TYPE_INVALID))
- {
- _dbus_warn ("Error getting arguments from return\n");
- goto out;
- }
-
- /* don't worry about arg[0] as it may be different
- depending on the path to the tests
- */
- if (strcmp("-test", argv[1]) != 0)
- {
- _dbus_warn ("Unexpected argv[1] in shell success service test (expected: %s, got: %s)\n",
- "-test", argv[1]);
- goto out;
- }
-
- if (strcmp("that", argv[2]) != 0)
- {
- _dbus_warn ("Unexpected argv[2] in shell success service test (expected: %s, got: %s)\n",
- "that", argv[2]);
- goto out;
- }
-
- if (strcmp("we get", argv[3]) != 0)
- {
- _dbus_warn ("Unexpected argv[3] in shell success service test (expected: %s, got: %s)\n",
- "we get", argv[3]);
- goto out;
- }
-
- if (strcmp("back", argv[4]) != 0)
- {
- _dbus_warn ("Unexpected argv[4] in shell success service test (expected: %s, got: %s)\n",
- "back", argv[4]);
- goto out;
- }
-
- if (strcmp("--what", argv[5]) != 0)
- {
- _dbus_warn ("Unexpected argv[5] in shell success service test (expected: %s, got: %s)\n",
- "--what", argv[5]);
- goto out;
- }
-
- if (strcmp("we put in", argv[6]) != 0)
- {
- _dbus_warn ("Unexpected argv[6] in shell success service test (expected: %s, got: %s)\n",
- "we put in", argv[6]);
- goto out;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!check_send_exit_to_service (context, connection,
- SHELL_SUCCESS_SERVICE_NAME,
- base_service))
- goto out;
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- if (base_service_message)
- dbus_message_unref (base_service_message);
-
- return retval;
-}
-
-typedef struct
-{
- Check1Func func;
- BusContext *context;
-} Check1Data;
-
-static dbus_bool_t
-check_oom_check1_func (void *data)
-{
- Check1Data *d = data;
-
- if (! (* d->func) (d->context))
- return FALSE;
-
- if (!check_no_leftovers (d->context))
- {
- _dbus_warn ("Messages were left over, should be covered by test suite\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-check1_try_iterations (BusContext *context,
- const char *description,
- Check1Func func)
-{
- Check1Data d;
-
- d.func = func;
- d.context = context;
-
- if (!_dbus_test_oom_handling (description, check_oom_check1_func,
- &d))
- _dbus_assert_not_reached ("test failed");
-}
-
-static dbus_bool_t
-check_get_services (BusContext *context,
- DBusConnection *connection,
- const char *method,
- char ***services,
- int *len)
-{
- DBusMessage *message;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- DBusError error;
- char **srvs;
- int l;
-
- retval = FALSE;
- dbus_error_init (&error);
- message = NULL;
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- method);
-
- if (message == NULL)
- return TRUE;
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- /* send our message */
- bus_test_run_clients_loop (SEND_PENDING (connection));
-
- dbus_message_unref (message);
- message = NULL;
-
- dbus_connection_ref (connection); /* because we may get disconnected */
- block_connection_until_message_from_bus (context, connection, "reply to ListActivatableNames/ListNames");
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
-
- dbus_connection_unref (connection);
-
- return TRUE;
- }
-
- dbus_connection_unref (connection);
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive a reply to %s %d on %p\n",
- method, serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (dbus_message_is_error (message, DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else
- {
- warn_unexpected (connection, message, "not this error");
-
- goto out;
- }
- }
- else
- {
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- ; /* good, expected */
- }
- else
- {
- warn_unexpected (connection, message,
- "method_return for ListActivatableNames/ListNames");
-
- goto out;
- }
-
- retry_get_property:
-
- if (!dbus_message_get_args (message, &error,
- DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING,
- &srvs, &l,
- DBUS_TYPE_INVALID))
- {
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_verbose ("no memory to list services by %s\n", method);
- dbus_error_free (&error);
- _dbus_wait_for_memory ();
- goto retry_get_property;
- }
- else
- {
- _dbus_assert (dbus_error_is_set (&error));
- _dbus_warn ("Did not get the expected DBUS_TYPE_ARRAY from %s\n", method);
- goto out;
- }
- } else {
- *services = srvs;
- *len = l;
- }
- }
-
- if (!check_no_leftovers (context))
- goto out;
-
- retval = TRUE;
-
- out:
- dbus_error_free (&error);
-
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-/* returns TRUE if the correct thing happens,
- * but the correct thing may include OOM errors.
- */
-static dbus_bool_t
-check_list_services (BusContext *context,
- DBusConnection *connection)
-{
- DBusMessage *message;
- DBusMessage *base_service_message;
- const char *base_service;
- dbus_uint32_t serial;
- dbus_bool_t retval;
- const char *existent = EXISTENT_SERVICE_NAME;
- dbus_uint32_t flags;
- char **services;
- int len;
-
- _dbus_verbose ("check_list_services for %p\n", connection);
-
- if (!check_get_services (context, connection, "ListActivatableNames", &services, &len))
- {
- return TRUE;
- }
-
- if (!_dbus_string_array_contains ((const char **)services, existent))
- {
- _dbus_warn ("Did not get the expected %s from ListActivatableNames\n", existent);
- dbus_free_string_array (services);
- return FALSE;
- }
-
- dbus_free_string_array (services);
-
- base_service_message = NULL;
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "StartServiceByName");
-
- if (message == NULL)
- return TRUE;
-
- dbus_message_set_auto_start (message, FALSE);
-
- flags = 0;
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &existent,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- if (!dbus_connection_send (connection, message, &serial))
- {
- dbus_message_unref (message);
- return TRUE;
- }
-
- dbus_message_unref (message);
- message = NULL;
-
- bus_test_run_everything (context);
-
- /* now wait for the message bus to hear back from the activated
- * service.
- */
- block_connection_until_message_from_bus (context, connection, "activated service to connect");
-
- bus_test_run_everything (context);
-
- if (!dbus_connection_get_is_connected (connection))
- {
- _dbus_verbose ("connection was disconnected\n");
- return TRUE;
- }
-
- retval = FALSE;
-
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after %s %d on %p\n",
- "StartServiceByName", serial, connection);
- goto out;
- }
-
- verbose_message_received (connection, message);
- _dbus_verbose (" (after sending %s)\n", "StartServiceByName");
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
- {
- if (!dbus_message_has_sender (message, DBUS_SERVICE_DBUS))
- {
- _dbus_warn ("Message has wrong sender %s\n",
- dbus_message_get_sender (message) ?
- dbus_message_get_sender (message) : "(none)");
- goto out;
- }
-
- if (dbus_message_is_error (message,
- DBUS_ERROR_NO_MEMORY))
- {
- ; /* good, this is a valid response */
- }
- else if (dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_EXITED) ||
- dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_CHILD_SIGNALED) ||
- dbus_message_is_error (message,
- DBUS_ERROR_SPAWN_EXEC_FAILED))
- {
- ; /* good, this is expected also */
- }
- else
- {
- _dbus_warn ("Did not expect error %s\n",
- dbus_message_get_error_name (message));
- goto out;
- }
- }
- else
- {
- GotServiceInfo message_kind;
-
- if (!check_base_service_activated (context, connection,
- message, &base_service))
- goto out;
-
- base_service_message = message;
- message = NULL;
-
- /* We may need to block here for the test service to exit or finish up */
- block_connection_until_message_from_bus (context, connection, "test service to exit or finish up");
-
- message = dbus_connection_borrow_message (connection);
- if (message == NULL)
- {
- _dbus_warn ("Did not receive any messages after base service creation notification\n");
- goto out;
- }
-
- message_kind = check_got_service_info (message);
-
- dbus_connection_return_message (connection, message);
- message = NULL;
-
- switch (message_kind)
- {
- case GOT_SOMETHING_ELSE:
- case GOT_ERROR:
- case GOT_SERVICE_DELETED:
- _dbus_warn ("Unexpected message after ActivateService "
- "(should be an error or a service announcement)\n");
- goto out;
-
- case GOT_SERVICE_CREATED:
- message = pop_message_waiting_for_memory (connection);
- if (message == NULL)
- {
- _dbus_warn ("Failed to pop message we just put back! "
- "should have been a NameOwnerChanged (creation)\n");
- goto out;
- }
-
- if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
- base_service, message))
- goto out;
-
- dbus_message_unref (message);
- message = NULL;
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after successful activation\n");
- goto out;
- }
-
- break;
- }
- }
-
- if (!check_get_services (context, connection, "ListNames", &services, &len))
- {
- return TRUE;
- }
-
- if (!_dbus_string_array_contains ((const char **)services, existent))
- {
- _dbus_warn ("Did not get the expected %s from ListNames\n", existent);
- goto out;
- }
-
- dbus_free_string_array (services);
-
- if (!check_send_exit_to_service (context, connection,
- EXISTENT_SERVICE_NAME, base_service))
- goto out;
-
- retval = TRUE;
-
- out:
- if (message)
- dbus_message_unref (message);
-
- if (base_service_message)
- dbus_message_unref (base_service_message);
-
- return retval;
-}
-
-typedef struct
-{
- Check2Func func;
- BusContext *context;
- DBusConnection *connection;
-} Check2Data;
-
-static dbus_bool_t
-check_oom_check2_func (void *data)
-{
- Check2Data *d = data;
-
- if (! (* d->func) (d->context, d->connection))
- return FALSE;
-
- if (!check_no_leftovers (d->context))
- {
- _dbus_warn ("Messages were left over, should be covered by test suite\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-check2_try_iterations (BusContext *context,
- DBusConnection *connection,
- const char *description,
- Check2Func func)
-{
- Check2Data d;
-
- d.func = func;
- d.context = context;
- d.connection = connection;
-
- if (!_dbus_test_oom_handling (description, check_oom_check2_func,
- &d))
- {
- _dbus_warn ("%s failed during oom\n", description);
- _dbus_assert_not_reached ("test failed");
- }
-}
-
-static dbus_bool_t
-setenv_TEST_LAUNCH_HELPER_CONFIG(const DBusString *test_data_dir,
- const char *filename)
-{
- DBusString full;
- DBusString file;
-
- if (!_dbus_string_init (&full))
- return FALSE;
-
- if (!_dbus_string_copy (test_data_dir, 0, &full, 0))
- {
- _dbus_string_free (&full);
- return FALSE;
- }
-
- _dbus_string_init_const (&file, filename);
-
- if (!_dbus_concat_dir_and_file (&full, &file))
- {
- _dbus_string_free (&full);
- return FALSE;
- }
-
- _dbus_verbose ("Setting TEST_LAUNCH_HELPER_CONFIG to '%s'\n",
- _dbus_string_get_const_data (&full));
-
- dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", _dbus_string_get_const_data (&full));
-
- _dbus_string_free (&full);
-
- return TRUE;
-}
-
-static dbus_bool_t
-bus_dispatch_test_conf (const DBusString *test_data_dir,
- const char *filename,
- dbus_bool_t use_launcher)
-{
- BusContext *context;
- DBusConnection *foo;
- DBusConnection *bar;
- DBusConnection *baz;
- DBusError error;
-
- /* save the config name for the activation helper */
- if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
- _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
-
- dbus_error_init (&error);
-
- context = bus_context_new_test (test_data_dir, filename);
- if (context == NULL)
- return FALSE;
-
- foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (foo == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (foo))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, foo);
-
- if (!check_hello_message (context, foo))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_double_hello_message (context, foo))
- _dbus_assert_not_reached ("double hello message failed");
-
- if (!check_add_match_all (context, foo))
- _dbus_assert_not_reached ("AddMatch message failed");
-
- bar = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (bar == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (bar))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, bar);
-
- if (!check_hello_message (context, bar))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_add_match_all (context, bar))
- _dbus_assert_not_reached ("AddMatch message failed");
-
- baz = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (baz == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (baz))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, baz);
-
- if (!check_hello_message (context, baz))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_add_match_all (context, baz))
- _dbus_assert_not_reached ("AddMatch message failed");
-
-#ifdef DBUS_WIN_FIXME
- _dbus_warn("TODO: testing of GetConnectionUnixUser message skipped for now\n");
- _dbus_warn("TODO: testing of GetConnectionUnixProcessID message skipped for now\n");
-#else
- if (!check_get_connection_unix_user (context, baz))
- _dbus_assert_not_reached ("GetConnectionUnixUser message failed");
-
- if (!check_get_connection_unix_process_id (context, baz))
- _dbus_assert_not_reached ("GetConnectionUnixProcessID message failed");
-#endif
-
- if (!check_list_services (context, baz))
- _dbus_assert_not_reached ("ListActivatableNames message failed");
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after setting up initial connections\n");
- _dbus_assert_not_reached ("initial connection setup failed");
- }
-
- check1_try_iterations (context, "create_and_hello",
- check_hello_connection);
-
- check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
- check_nonexistent_service_no_auto_start);
-
-#ifdef DBUS_WIN_FIXME
- _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
-#else
- check2_try_iterations (context, foo, "segfault_service_no_auto_start",
- check_segfault_service_no_auto_start);
-#endif
-
- check2_try_iterations (context, foo, "existent_service_no_auto_start",
- check_existent_service_no_auto_start);
-
- check2_try_iterations (context, foo, "nonexistent_service_auto_start",
- check_nonexistent_service_auto_start);
-
-
-#ifdef DBUS_WIN_FIXME
- _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
-#else
- /* only do the segfault test if we are not using the launcher */
- check2_try_iterations (context, foo, "segfault_service_auto_start",
- check_segfault_service_auto_start);
-#endif
-
- /* only do the shell fail test if we are not using the launcher */
- check2_try_iterations (context, foo, "shell_fail_service_auto_start",
- check_shell_fail_service_auto_start);
-
- /* specific to launcher */
- if (use_launcher)
- if (!check_launch_service_file_missing (context, foo))
- _dbus_assert_not_reached ("did not get service file not found error");
-
-#if 0
- /* Note: need to resolve some issues with the testing code in order to run
- * this in oom (handle that we sometimes don't get replies back from the bus
- * when oom happens, without blocking the test).
- */
- check2_try_iterations (context, foo, "existent_service_auto_auto_start",
- check_existent_service_auto_start);
-#endif
-
- if (!check_existent_service_auto_start (context, foo))
- _dbus_assert_not_reached ("existent service auto start failed");
-
- if (!check_shell_service_success_auto_start (context, foo))
- _dbus_assert_not_reached ("shell success service auto start failed");
-
- _dbus_verbose ("Disconnecting foo, bar, and baz\n");
-
- kill_client_connection_unchecked (foo);
- kill_client_connection_unchecked (bar);
- kill_client_connection_unchecked (baz);
-
- bus_context_unref (context);
-
- return TRUE;
-}
-
-static dbus_bool_t
-bus_dispatch_test_conf_fail (const DBusString *test_data_dir,
- const char *filename)
-{
- BusContext *context;
- DBusConnection *foo;
- DBusError error;
-
- /* save the config name for the activation helper */
- if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
- _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
-
- dbus_error_init (&error);
-
- context = bus_context_new_test (test_data_dir, filename);
- if (context == NULL)
- return FALSE;
-
- foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (foo == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (foo))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, foo);
-
- if (!check_hello_message (context, foo))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_double_hello_message (context, foo))
- _dbus_assert_not_reached ("double hello message failed");
-
- if (!check_add_match_all (context, foo))
- _dbus_assert_not_reached ("AddMatch message failed");
-
- /* this only tests the activation.c user check */
- if (!check_launch_service_user_missing (context, foo))
- _dbus_assert_not_reached ("user missing did not trigger error");
-
- /* this only tests the desktop.c exec check */
- if (!check_launch_service_exec_missing (context, foo))
- _dbus_assert_not_reached ("exec missing did not trigger error");
-
- /* this only tests the desktop.c service check */
- if (!check_launch_service_service_missing (context, foo))
- _dbus_assert_not_reached ("service missing did not trigger error");
-
- _dbus_verbose ("Disconnecting foo\n");
-
- kill_client_connection_unchecked (foo);
-
- bus_context_unref (context);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_dispatch_test (const DBusString *test_data_dir)
-{
- /* run normal activation tests */
- _dbus_verbose ("Normal activation tests\n");
- if (!bus_dispatch_test_conf (test_data_dir,
- "valid-config-files/debug-allow-all.conf", FALSE))
- return FALSE;
-
-#ifdef DBUS_WIN
- _dbus_warn("Info: Launch helper activation tests skipped because launch-helper is not supported yet\n");
-#else
- /* run launch-helper activation tests */
- _dbus_verbose ("Launch helper activation tests\n");
- if (!bus_dispatch_test_conf (test_data_dir,
- "valid-config-files-system/debug-allow-all-pass.conf", TRUE))
- return FALSE;
-
- /* run select launch-helper activation tests on broken service files */
- if (!bus_dispatch_test_conf_fail (test_data_dir,
- "valid-config-files-system/debug-allow-all-fail.conf"))
- return FALSE;
-#endif
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_dispatch_sha1_test (const DBusString *test_data_dir)
-{
- BusContext *context;
- DBusConnection *foo;
- DBusError error;
-
- dbus_error_init (&error);
-
- /* Test SHA1 authentication */
- _dbus_verbose ("Testing SHA1 context\n");
-
- context = bus_context_new_test (test_data_dir,
- "valid-config-files/debug-allow-all-sha1.conf");
- if (context == NULL)
- return FALSE;
-
- foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (foo == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (foo))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, foo);
-
- if (!check_hello_message (context, foo))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_add_match_all (context, foo))
- _dbus_assert_not_reached ("addmatch message failed");
-
- if (!check_no_leftovers (context))
- {
- _dbus_warn ("Messages were left over after setting up initial SHA-1 connection\n");
- _dbus_assert_not_reached ("initial connection setup failed");
- }
-
- check1_try_iterations (context, "create_and_hello_sha1",
- check_hello_connection);
-
- kill_client_connection_unchecked (foo);
-
- bus_context_unref (context);
-
- return TRUE;
-}
-
-#ifdef HAVE_UNIX_FD_PASSING
-
-dbus_bool_t
-bus_unix_fds_passing_test(const DBusString *test_data_dir)
-{
- BusContext *context;
- DBusConnection *foo, *bar;
- DBusError error;
- DBusMessage *m;
- int one[2], two[2], x, y, z;
- char r;
-
- dbus_error_init (&error);
-
- context = bus_context_new_test (test_data_dir, "valid-config-files/debug-allow-all.conf");
- if (context == NULL)
- _dbus_assert_not_reached ("could not alloc context");
-
- foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (foo == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (foo))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, foo);
-
- if (!check_hello_message (context, foo))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_add_match_all (context, foo))
- _dbus_assert_not_reached ("AddMatch message failed");
-
- bar = dbus_connection_open_private (TEST_DEBUG_PIPE, &error);
- if (bar == NULL)
- _dbus_assert_not_reached ("could not alloc connection");
-
- if (!bus_setup_debug_client (bar))
- _dbus_assert_not_reached ("could not set up connection");
-
- spin_connection_until_authenticated (context, bar);
-
- if (!check_hello_message (context, bar))
- _dbus_assert_not_reached ("hello message failed");
-
- if (!check_add_match_all (context, bar))
- _dbus_assert_not_reached ("AddMatch message failed");
-
- if (!(m = dbus_message_new_signal("/", "a.b.c", "d")))
- _dbus_assert_not_reached ("could not alloc message");
-
- if (!(_dbus_full_duplex_pipe(one, one+1, TRUE, &error)))
- _dbus_assert_not_reached("Failed to allocate pipe #1");
-
- if (!(_dbus_full_duplex_pipe(two, two+1, TRUE, &error)))
- _dbus_assert_not_reached("Failed to allocate pipe #2");
-
- if (!dbus_message_append_args(m,
- DBUS_TYPE_UNIX_FD, one,
- DBUS_TYPE_UNIX_FD, two,
- DBUS_TYPE_UNIX_FD, two,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached("Failed to attach fds.");
-
- if (!_dbus_close(one[0], &error))
- _dbus_assert_not_reached("Failed to close pipe #1 ");
- if (!_dbus_close(two[0], &error))
- _dbus_assert_not_reached("Failed to close pipe #2 ");
-
- if (!(dbus_connection_can_send_type(foo, DBUS_TYPE_UNIX_FD)))
- _dbus_assert_not_reached("Connection cannot do fd passing");
-
- if (!(dbus_connection_can_send_type(bar, DBUS_TYPE_UNIX_FD)))
- _dbus_assert_not_reached("Connection cannot do fd passing");
-
- if (!dbus_connection_send (foo, m, NULL))
- _dbus_assert_not_reached("Failed to send fds");
-
- dbus_message_unref(m);
-
- bus_test_run_clients_loop (SEND_PENDING (foo));
-
- bus_test_run_everything (context);
-
- block_connection_until_message_from_bus (context, foo, "unix fd reception on foo");
-
- if (!(m = pop_message_waiting_for_memory (foo)))
- _dbus_assert_not_reached("Failed to receive msg");
-
- if (!dbus_message_is_signal(m, "a.b.c", "d"))
- _dbus_assert_not_reached("bogus message received");
-
- dbus_message_unref(m);
-
- block_connection_until_message_from_bus (context, bar, "unix fd reception on bar");
-
- if (!(m = pop_message_waiting_for_memory (bar)))
- _dbus_assert_not_reached("Failed to receive msg");
-
- if (!dbus_message_is_signal(m, "a.b.c", "d"))
- _dbus_assert_not_reached("bogus message received");
-
- if (!dbus_message_get_args(m,
- &error,
- DBUS_TYPE_UNIX_FD, &x,
- DBUS_TYPE_UNIX_FD, &y,
- DBUS_TYPE_UNIX_FD, &z,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached("Failed to parse fds.");
-
- dbus_message_unref(m);
-
- if (write(x, "X", 1) != 1)
- _dbus_assert_not_reached("Failed to write to pipe #1");
- if (write(y, "Y", 1) != 1)
- _dbus_assert_not_reached("Failed to write to pipe #2");
- if (write(z, "Z", 1) != 1)
- _dbus_assert_not_reached("Failed to write to pipe #2/2nd fd");
-
- if (!_dbus_close(x, &error))
- _dbus_assert_not_reached("Failed to close pipe #1/other side ");
- if (!_dbus_close(y, &error))
- _dbus_assert_not_reached("Failed to close pipe #2/other side ");
- if (!_dbus_close(z, &error))
- _dbus_assert_not_reached("Failed to close pipe #2/other size 2nd fd ");
-
- if (read(one[1], &r, 1) != 1 || r != 'X')
- _dbus_assert_not_reached("Failed to read value from pipe.");
- if (read(two[1], &r, 1) != 1 || r != 'Y')
- _dbus_assert_not_reached("Failed to read value from pipe.");
- if (read(two[1], &r, 1) != 1 || r != 'Z')
- _dbus_assert_not_reached("Failed to read value from pipe.");
-
- if (!_dbus_close(one[1], &error))
- _dbus_assert_not_reached("Failed to close pipe #1 ");
- if (!_dbus_close(two[1], &error))
- _dbus_assert_not_reached("Failed to close pipe #2 ");
-
- _dbus_verbose ("Disconnecting foo\n");
- kill_client_connection_unchecked (foo);
-
- _dbus_verbose ("Disconnecting bar\n");
- kill_client_connection_unchecked (bar);
-
- bus_context_unref (context);
-
- return TRUE;
-}
-#endif
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/bus/dispatch.h b/src/3rd_party/dbus-1.7.8/bus/dispatch.h
deleted file mode 100644
index fb5ba7a5b1..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/dispatch.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dispatch.h Message dispatcher
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_DISPATCH_H
-#define BUS_DISPATCH_H
-
-#include <dbus/dbus.h>
-#include "connection.h"
-
-dbus_bool_t bus_dispatch_add_connection (DBusConnection *connection);
-void bus_dispatch_remove_connection (DBusConnection *connection);
-dbus_bool_t bus_dispatch_matches (BusTransaction *transaction,
- DBusConnection *sender,
- DBusConnection *recipient,
- DBusMessage *message,
- DBusError *error);
-
-#endif /* BUS_DISPATCH_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/driver.c b/src/3rd_party/dbus-1.7.8/bus/driver.c
deleted file mode 100644
index e95a79d9df..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/driver.c
+++ /dev/null
@@ -1,2068 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* driver.c Bus client (driver)
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003, 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "activation.h"
-#include "connection.h"
-#include "driver.h"
-#include "dispatch.h"
-#include "services.h"
-#include "selinux.h"
-#include "signals.h"
-#include "stats.h"
-#include "utils.h"
-
-#include <dbus/dbus-asv-util.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-marshal-recursive.h>
-#include <string.h>
-
-static DBusConnection *
-bus_driver_get_conn_helper (DBusConnection *connection,
- DBusMessage *message,
- const char *what_we_want,
- const char **name_p,
- DBusError *error)
-{
- const char *name;
- BusRegistry *registry;
- BusService *serv;
- DBusString str;
- DBusConnection *conn;
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- return NULL;
-
- _dbus_assert (name != NULL);
- _dbus_verbose ("asked for %s of connection %s\n", what_we_want, name);
-
- registry = bus_connection_get_registry (connection);
- _dbus_string_init_const (&str, name);
- serv = bus_registry_lookup (registry, &str);
-
- if (serv == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get %s of name '%s': no such name",
- what_we_want, name);
- return NULL;
- }
-
- conn = bus_service_get_primary_owners_connection (serv);
- _dbus_assert (conn != NULL);
-
- if (name_p != NULL)
- *name_p = name;
-
- return conn;
-}
-
-static dbus_bool_t bus_driver_send_welcome_message (DBusConnection *connection,
- DBusMessage *hello_message,
- BusTransaction *transaction,
- DBusError *error);
-
-dbus_bool_t
-bus_driver_send_service_owner_changed (const char *service_name,
- const char *old_owner,
- const char *new_owner,
- BusTransaction *transaction,
- DBusError *error)
-{
- DBusMessage *message;
- dbus_bool_t retval;
- const char *null_service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- null_service = "";
- _dbus_verbose ("sending name owner changed: %s [%s -> %s]\n",
- service_name,
- old_owner ? old_owner : null_service,
- new_owner ? new_owner : null_service);
-
- message = dbus_message_new_signal (DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged");
-
- if (message == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
- goto oom;
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_STRING, old_owner ? &old_owner : &null_service,
- DBUS_TYPE_STRING, new_owner ? &new_owner : &null_service,
- DBUS_TYPE_INVALID))
- goto oom;
-
- _dbus_assert (dbus_message_has_signature (message, "sss"));
-
- retval = bus_dispatch_matches (transaction, NULL, NULL, message, error);
- dbus_message_unref (message);
-
- return retval;
-
- oom:
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
-}
-
-dbus_bool_t
-bus_driver_send_service_lost (DBusConnection *connection,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error)
-{
- DBusMessage *message;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- message = dbus_message_new_signal (DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "NameLost");
-
- if (message == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_set_destination (message, bus_connection_get_name (connection)) ||
- !dbus_message_append_args (message,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, message))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
- else
- {
- dbus_message_unref (message);
- return TRUE;
- }
-}
-
-dbus_bool_t
-bus_driver_send_service_acquired (DBusConnection *connection,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error)
-{
- DBusMessage *message;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- message = dbus_message_new_signal (DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "NameAcquired");
-
- if (message == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_set_destination (message, bus_connection_get_name (connection)) ||
- !dbus_message_append_args (message,
- DBUS_TYPE_STRING, &service_name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, message))
- {
- dbus_message_unref (message);
- BUS_SET_OOM (error);
- return FALSE;
- }
- else
- {
- dbus_message_unref (message);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-create_unique_client_name (BusRegistry *registry,
- DBusString *str)
-{
- /* We never want to use the same unique client name twice, because
- * we want to guarantee that if you send a message to a given unique
- * name, you always get the same application. So we use two numbers
- * for INT_MAX * INT_MAX combinations, should be pretty safe against
- * wraparound.
- */
- /* FIXME these should be in BusRegistry rather than static vars */
- static int next_major_number = 0;
- static int next_minor_number = 0;
- int len;
-
- len = _dbus_string_get_length (str);
-
- while (TRUE)
- {
- /* start out with 1-0, go to 1-1, 1-2, 1-3,
- * up to 1-MAXINT, then 2-0, 2-1, etc.
- */
- if (next_minor_number <= 0)
- {
- next_major_number += 1;
- next_minor_number = 0;
- if (next_major_number <= 0)
- _dbus_assert_not_reached ("INT_MAX * INT_MAX clients were added");
- }
-
- _dbus_assert (next_major_number > 0);
- _dbus_assert (next_minor_number >= 0);
-
- /* appname:MAJOR-MINOR */
-
- if (!_dbus_string_append (str, ":"))
- return FALSE;
-
- if (!_dbus_string_append_int (str, next_major_number))
- return FALSE;
-
- if (!_dbus_string_append (str, "."))
- return FALSE;
-
- if (!_dbus_string_append_int (str, next_minor_number))
- return FALSE;
-
- next_minor_number += 1;
-
- /* Check if a client with the name exists */
- if (bus_registry_lookup (registry, str) == NULL)
- break;
-
- /* drop the number again, try the next one. */
- _dbus_string_set_length (str, len);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-bus_driver_handle_hello (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusString unique_name;
- BusService *service;
- dbus_bool_t retval;
- BusRegistry *registry;
- BusConnections *connections;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (bus_connection_is_active (connection))
- {
- /* We already handled an Hello message for this connection. */
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Already handled an Hello message");
- return FALSE;
- }
-
- /* Note that when these limits are exceeded we don't disconnect the
- * connection; we just sort of leave it hanging there until it times
- * out or disconnects itself or is dropped due to the max number of
- * incomplete connections. It's even OK if the connection wants to
- * retry the hello message, we support that.
- */
- connections = bus_connection_get_connections (connection);
- if (!bus_connections_check_limits (connections, connection,
- error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&unique_name))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- retval = FALSE;
-
- registry = bus_connection_get_registry (connection);
-
- if (!create_unique_client_name (registry, &unique_name))
- {
- BUS_SET_OOM (error);
- goto out_0;
- }
-
- if (!bus_connection_complete (connection, &unique_name, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto out_0;
- }
-
- if (!dbus_message_set_sender (message,
- bus_connection_get_name (connection)))
- {
- BUS_SET_OOM (error);
- goto out_0;
- }
-
- if (!bus_driver_send_welcome_message (connection, message, transaction, error))
- goto out_0;
-
- /* Create the service */
- service = bus_registry_ensure (registry,
- &unique_name, connection, 0, transaction, error);
- if (service == NULL)
- goto out_0;
-
- _dbus_assert (bus_connection_is_active (connection));
- retval = TRUE;
-
- out_0:
- _dbus_string_free (&unique_name);
- return retval;
-}
-
-static dbus_bool_t
-bus_driver_send_welcome_message (DBusConnection *connection,
- DBusMessage *hello_message,
- BusTransaction *transaction,
- DBusError *error)
-{
- DBusMessage *welcome;
- const char *name;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- name = bus_connection_get_name (connection);
- _dbus_assert (name != NULL);
-
- welcome = dbus_message_new_method_return (hello_message);
- if (welcome == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_append_args (welcome,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (welcome);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- _dbus_assert (dbus_message_has_signature (welcome, DBUS_TYPE_STRING_AS_STRING));
-
- if (!bus_transaction_send_from_driver (transaction, connection, welcome))
- {
- dbus_message_unref (welcome);
- BUS_SET_OOM (error);
- return FALSE;
- }
- else
- {
- dbus_message_unref (welcome);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-bus_driver_handle_list_services (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
- int len;
- char **services;
- BusRegistry *registry;
- int i;
- DBusMessageIter iter;
- DBusMessageIter sub;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_registry_list_services (registry, &services, &len))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- dbus_message_iter_init_append (reply, &iter);
-
- if (!dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING,
- &sub))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- {
- /* Include the bus driver in the list */
- const char *v_STRING = DBUS_SERVICE_DBUS;
- if (!dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING,
- &v_STRING))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- i = 0;
- while (i < len)
- {
- if (!dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING,
- &services[i]))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- ++i;
- }
-
- dbus_free_string_array (services);
-
- if (!dbus_message_iter_close_container (&iter, &sub))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- else
- {
- dbus_message_unref (reply);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-bus_driver_handle_list_activatable_services (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
- int len;
- char **services;
- BusActivation *activation;
- int i;
- DBusMessageIter iter;
- DBusMessageIter sub;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- activation = bus_connection_get_activation (connection);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_activation_list_services (activation, &services, &len))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- dbus_message_iter_init_append (reply, &iter);
-
- if (!dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING,
- &sub))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- {
- /* Include the bus driver in the list */
- const char *v_STRING = DBUS_SERVICE_DBUS;
- if (!dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING,
- &v_STRING))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- i = 0;
- while (i < len)
- {
- if (!dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING,
- &services[i]))
- {
- dbus_free_string_array (services);
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- ++i;
- }
-
- dbus_free_string_array (services);
-
- if (!dbus_message_iter_close_container (&iter, &sub))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- dbus_message_unref (reply);
- BUS_SET_OOM (error);
- return FALSE;
- }
- else
- {
- dbus_message_unref (reply);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-bus_driver_handle_acquire_service (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
- DBusString service_name;
- const char *name;
- dbus_uint32_t service_reply;
- dbus_uint32_t flags;
- dbus_bool_t retval;
- BusRegistry *registry;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- return FALSE;
-
- _dbus_verbose ("Trying to own name %s with flags 0x%x\n", name, flags);
-
- retval = FALSE;
- reply = NULL;
-
- _dbus_string_init_const (&service_name, name);
-
- if (!bus_registry_acquire_service (registry, connection,
- &service_name, flags,
- &service_reply, transaction,
- error))
- goto out;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!dbus_message_append_args (reply, DBUS_TYPE_UINT32, &service_reply, DBUS_TYPE_INVALID))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (reply)
- dbus_message_unref (reply);
- return retval;
-}
-
-static dbus_bool_t
-bus_driver_handle_release_service (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
- DBusString service_name;
- const char *name;
- dbus_uint32_t service_reply;
- dbus_bool_t retval;
- BusRegistry *registry;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- return FALSE;
-
- _dbus_verbose ("Trying to release name %s\n", name);
-
- retval = FALSE;
- reply = NULL;
-
- _dbus_string_init_const (&service_name, name);
-
- if (!bus_registry_release_service (registry, connection,
- &service_name, &service_reply,
- transaction, error))
- goto out;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!dbus_message_append_args (reply, DBUS_TYPE_UINT32, &service_reply, DBUS_TYPE_INVALID))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (reply)
- dbus_message_unref (reply);
- return retval;
-}
-
-static dbus_bool_t
-bus_driver_handle_service_exists (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
- DBusString service_name;
- BusService *service;
- dbus_bool_t service_exists;
- const char *name;
- dbus_bool_t retval;
- BusRegistry *registry;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- return FALSE;
-
- retval = FALSE;
-
- if (strcmp (name, DBUS_SERVICE_DBUS) == 0)
- {
- service_exists = TRUE;
- }
- else
- {
- _dbus_string_init_const (&service_name, name);
- service = bus_registry_lookup (registry, &service_name);
- service_exists = service != NULL;
- }
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!dbus_message_append_args (reply,
- DBUS_TYPE_BOOLEAN, &service_exists,
- 0))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (reply)
- dbus_message_unref (reply);
-
- return retval;
-}
-
-static dbus_bool_t
-bus_driver_handle_activate_service (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- dbus_uint32_t flags;
- const char *name;
- dbus_bool_t retval;
- BusActivation *activation;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- activation = bus_connection_get_activation (connection);
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_verbose ("No memory to get arguments to StartServiceByName\n");
- return FALSE;
- }
-
- retval = FALSE;
-
- if (!bus_activation_activate_service (activation, connection, transaction, FALSE,
- message, name, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_verbose ("bus_activation_activate_service() failed\n");
- goto out;
- }
-
- retval = TRUE;
-
- out:
- return retval;
-}
-
-static dbus_bool_t
-send_ack_reply (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusMessage *reply;
-
- if (dbus_message_get_no_reply (message))
- return TRUE;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- {
- BUS_SET_OOM (error);
- dbus_message_unref (reply);
- return FALSE;
- }
-
- dbus_message_unref (reply);
-
- return TRUE;
-}
-
-static dbus_bool_t
-bus_driver_handle_update_activation_environment (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- dbus_bool_t retval;
- BusActivation *activation;
- DBusMessageIter iter;
- DBusMessageIter dict_iter;
- DBusMessageIter dict_entry_iter;
- int array_type;
- int key_type;
- DBusList *keys, *key_link;
- DBusList *values, *value_link;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- activation = bus_connection_get_activation (connection);
-
- dbus_message_iter_init (message, &iter);
-
- /* The message signature has already been checked for us,
- * so let's just assert it's right.
- */
- _dbus_assert (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY);
-
- dbus_message_iter_recurse (&iter, &dict_iter);
-
- retval = FALSE;
-
- /* Then loop through the sent dictionary, add the location of
- * the environment keys and values to lists. The result will
- * be in reverse order, so we don't have to constantly search
- * for the end of the list in a loop.
- */
- keys = NULL;
- values = NULL;
- while ((array_type = dbus_message_iter_get_arg_type (&dict_iter)) == DBUS_TYPE_DICT_ENTRY)
- {
- dbus_message_iter_recurse (&dict_iter, &dict_entry_iter);
-
- while ((key_type = dbus_message_iter_get_arg_type (&dict_entry_iter)) == DBUS_TYPE_STRING)
- {
- char *key;
- char *value;
- int value_type;
-
- dbus_message_iter_get_basic (&dict_entry_iter, &key);
- dbus_message_iter_next (&dict_entry_iter);
-
- value_type = dbus_message_iter_get_arg_type (&dict_entry_iter);
-
- if (value_type != DBUS_TYPE_STRING)
- break;
-
- dbus_message_iter_get_basic (&dict_entry_iter, &value);
-
- if (!_dbus_list_append (&keys, key))
- {
- BUS_SET_OOM (error);
- break;
- }
-
- if (!_dbus_list_append (&values, value))
- {
- BUS_SET_OOM (error);
- break;
- }
-
- dbus_message_iter_next (&dict_entry_iter);
- }
-
- if (key_type != DBUS_TYPE_INVALID)
- break;
-
- dbus_message_iter_next (&dict_iter);
- }
-
- if (array_type != DBUS_TYPE_INVALID)
- goto out;
-
- _dbus_assert (_dbus_list_get_length (&keys) == _dbus_list_get_length (&values));
-
- key_link = keys;
- value_link = values;
- while (key_link != NULL)
- {
- const char *key;
- const char *value;
-
- key = key_link->data;
- value = value_link->data;
-
- if (!bus_activation_set_environment_variable (activation,
- key, value, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_verbose ("bus_activation_set_environment_variable() failed\n");
- break;
- }
- key_link = _dbus_list_get_next_link (&keys, key_link);
- value_link = _dbus_list_get_next_link (&values, value_link);
- }
-
- /* FIXME: We can fail early having set only some of the environment variables,
- * (because of OOM failure). It's sort of hard to fix and it doesn't really
- * matter, so we're punting for now.
- */
- if (key_link != NULL)
- goto out;
-
- if (!send_ack_reply (connection, transaction,
- message, error))
- goto out;
-
- retval = TRUE;
-
- out:
- _dbus_list_clear (&keys);
- _dbus_list_clear (&values);
- return retval;
-}
-
-static dbus_bool_t
-bus_driver_handle_add_match (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- BusMatchRule *rule;
- const char *text;
- DBusString str;
- BusMatchmaker *matchmaker;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- text = NULL;
- rule = NULL;
-
- if (bus_connection_get_n_match_rules (connection) >=
- bus_context_get_max_match_rules_per_connection (bus_transaction_get_context (transaction)))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "Connection \"%s\" is not allowed to add more match rules "
- "(increase limits in configuration file if required)",
- bus_connection_is_active (connection) ?
- bus_connection_get_name (connection) :
- "(inactive)");
- goto failed;
- }
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("No memory to get arguments to AddMatch\n");
- goto failed;
- }
-
- _dbus_string_init_const (&str, text);
-
- rule = bus_match_rule_parse (connection, &str, error);
- if (rule == NULL)
- goto failed;
-
- matchmaker = bus_connection_get_matchmaker (connection);
-
- if (!bus_matchmaker_add_rule (matchmaker, rule))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!send_ack_reply (connection, transaction,
- message, error))
- {
- bus_matchmaker_remove_rule (matchmaker, rule);
- goto failed;
- }
-
- bus_match_rule_unref (rule);
-
- return TRUE;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (rule)
- bus_match_rule_unref (rule);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_remove_match (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- BusMatchRule *rule;
- const char *text;
- DBusString str;
- BusMatchmaker *matchmaker;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- text = NULL;
- rule = NULL;
-
- if (!dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("No memory to get arguments to RemoveMatch\n");
- goto failed;
- }
-
- _dbus_string_init_const (&str, text);
-
- rule = bus_match_rule_parse (connection, &str, error);
- if (rule == NULL)
- goto failed;
-
- /* Send the ack before we remove the rule, since the ack is undone
- * on transaction cancel, but rule removal isn't.
- */
- if (!send_ack_reply (connection, transaction,
- message, error))
- goto failed;
-
- matchmaker = bus_connection_get_matchmaker (connection);
-
- if (!bus_matchmaker_remove_rule_by_value (matchmaker, rule, error))
- goto failed;
-
- bus_match_rule_unref (rule);
-
- return TRUE;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (rule)
- bus_match_rule_unref (rule);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_service_owner (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- const char *text;
- const char *base_name;
- DBusString str;
- BusRegistry *registry;
- BusService *service;
- DBusMessage *reply;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- text = NULL;
- reply = NULL;
-
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_string_init_const (&str, text);
- service = bus_registry_lookup (registry, &str);
- if (service == NULL &&
- _dbus_string_equal_c_str (&str, DBUS_SERVICE_DBUS))
- {
- /* ORG_FREEDESKTOP_DBUS owns itself */
- base_name = DBUS_SERVICE_DBUS;
- }
- else if (service == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get owner of name '%s': no such name", text);
- goto failed;
- }
- else
- {
- base_name = bus_connection_get_name (bus_service_get_primary_owners_connection (service));
- if (base_name == NULL)
- {
- /* FIXME - how is this error possible? */
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Could not determine unique name for '%s'", text);
- goto failed;
- }
- _dbus_assert (*base_name == ':');
- }
-
- _dbus_assert (base_name != NULL);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (! dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &base_name,
- DBUS_TYPE_INVALID))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_list_queued_owners (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- const char *text;
- DBusList *base_names;
- DBusList *link;
- DBusString str;
- BusRegistry *registry;
- BusService *service;
- DBusMessage *reply;
- DBusMessageIter iter, array_iter;
- char *dbus_service_name = DBUS_SERVICE_DBUS;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (connection);
-
- base_names = NULL;
- text = NULL;
- reply = NULL;
-
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &text,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_string_init_const (&str, text);
- service = bus_registry_lookup (registry, &str);
- if (service == NULL &&
- _dbus_string_equal_c_str (&str, DBUS_SERVICE_DBUS))
- {
- /* ORG_FREEDESKTOP_DBUS owns itself */
- if (! _dbus_list_append (&base_names, dbus_service_name))
- goto oom;
- }
- else if (service == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get owners of name '%s': no such name", text);
- goto failed;
- }
- else
- {
- if (!bus_service_list_queued_owners (service,
- &base_names,
- error))
- goto failed;
- }
-
- _dbus_assert (base_names != NULL);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- dbus_message_iter_init_append (reply, &iter);
- if (!dbus_message_iter_open_container (&iter,
- DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING,
- &array_iter))
- goto oom;
-
- link = _dbus_list_get_first_link (&base_names);
- while (link != NULL)
- {
- char *uname;
-
- _dbus_assert (link->data != NULL);
- uname = (char *)link->data;
-
- if (!dbus_message_iter_append_basic (&array_iter,
- DBUS_TYPE_STRING,
- &uname))
- goto oom;
-
- link = _dbus_list_get_next_link (&base_names, link);
- }
-
- if (! dbus_message_iter_close_container (&iter, &array_iter))
- goto oom;
-
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
-
- if (base_names)
- _dbus_list_clear (&base_names);
-
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusConnection *conn;
- DBusMessage *reply;
- unsigned long uid;
- dbus_uint32_t uid32;
- const char *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- conn = bus_driver_get_conn_helper (connection, message, "UID", &service,
- error);
-
- if (conn == NULL)
- goto failed;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (!dbus_connection_get_unix_user (conn, &uid))
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Could not determine UID for '%s'", service);
- goto failed;
- }
-
- uid32 = uid;
- if (! dbus_message_append_args (reply,
- DBUS_TYPE_UINT32, &uid32,
- DBUS_TYPE_INVALID))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusConnection *conn;
- DBusMessage *reply;
- unsigned long pid;
- dbus_uint32_t pid32;
- const char *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- conn = bus_driver_get_conn_helper (connection, message, "PID", &service,
- error);
-
- if (conn == NULL)
- goto failed;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (!dbus_connection_get_unix_process_id (conn, &pid))
- {
- dbus_set_error (error,
- DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN,
- "Could not determine PID for '%s'", service);
- goto failed;
- }
-
- pid32 = pid;
- if (! dbus_message_append_args (reply,
- DBUS_TYPE_UINT32, &pid32,
- DBUS_TYPE_INVALID))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusConnection *conn;
- DBusMessage *reply;
- void *data = NULL;
- dbus_uint32_t data_size;
- const char *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- conn = bus_driver_get_conn_helper (connection, message,
- "audit session data", &service, error);
-
- if (conn == NULL)
- goto failed;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (!dbus_connection_get_adt_audit_session_data (conn, &data, &data_size) || data == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN,
- "Could not determine audit session data for '%s'", service);
- goto failed;
- }
-
- if (! dbus_message_append_args (reply,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &data, data_size,
- DBUS_TYPE_INVALID))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_connection_selinux_security_context (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusConnection *conn;
- DBusMessage *reply;
- BusSELinuxID *context;
- const char *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- conn = bus_driver_get_conn_helper (connection, message, "security context",
- &service, error);
-
- if (conn == NULL)
- goto failed;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- context = bus_connection_get_selinux_id (conn);
- if (!context)
- {
- dbus_set_error (error,
- DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN,
- "Could not determine security context for '%s'", service);
- goto failed;
- }
-
- if (! bus_selinux_append_context (reply, context, error))
- goto failed;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_connection_credentials (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusConnection *conn;
- DBusMessage *reply;
- DBusMessageIter reply_iter;
- DBusMessageIter array_iter;
- unsigned long ulong_val;
- const char *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- conn = bus_driver_get_conn_helper (connection, message, "credentials",
- &service, error);
-
- if (conn == NULL)
- goto failed;
-
- reply = _dbus_asv_new_method_return (message, &reply_iter, &array_iter);
- if (reply == NULL)
- goto oom;
-
- /* we can't represent > 32-bit pids; if your system needs them, please
- * add ProcessID64 to the spec or something */
- if (dbus_connection_get_unix_process_id (conn, &ulong_val) &&
- ulong_val <= _DBUS_UINT32_MAX)
- {
- if (!_dbus_asv_add_uint32 (&array_iter, "ProcessID", ulong_val))
- goto oom;
- }
-
- /* we can't represent > 32-bit uids; if your system needs them, please
- * add UnixUserID64 to the spec or something */
- if (dbus_connection_get_unix_user (conn, &ulong_val) &&
- ulong_val <= _DBUS_UINT32_MAX)
- {
- if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
- goto oom;
- }
-
- if (!_dbus_asv_close (&reply_iter, &array_iter))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- {
- /* this time we don't want to close the iterator again, so just
- * get rid of the message */
- dbus_message_unref (reply);
- reply = NULL;
- goto oom;
- }
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- if (reply)
- {
- _dbus_asv_abandon (&reply_iter, &array_iter);
- dbus_message_unref (reply);
- }
-
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_reload_config (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- BusContext *context;
- DBusMessage *reply;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- context = bus_connection_get_context (connection);
- if (!bus_context_reload_config (context, error))
- goto failed;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (reply)
- dbus_message_unref (reply);
- return FALSE;
-}
-
-static dbus_bool_t
-bus_driver_handle_get_id (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- BusContext *context;
- DBusMessage *reply;
- DBusString uuid;
- const char *v_STRING;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&uuid))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- reply = NULL;
-
- context = bus_connection_get_context (connection);
- if (!bus_context_get_id (context, &uuid))
- goto oom;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- v_STRING = _dbus_string_get_const_data (&uuid);
- if (!dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_INVALID))
- goto oom;
-
- _dbus_assert (dbus_message_has_signature (reply, "s"));
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- _dbus_string_free (&uuid);
- dbus_message_unref (reply);
- return TRUE;
-
- oom:
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- BUS_SET_OOM (error);
-
- if (reply)
- dbus_message_unref (reply);
- _dbus_string_free (&uuid);
- return FALSE;
-}
-
-typedef struct
-{
- const char *name;
- const char *in_args;
- const char *out_args;
- dbus_bool_t (* handler) (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error);
-} MessageHandler;
-
-/* For speed it might be useful to sort this in order of
- * frequency of use (but doesn't matter with only a few items
- * anyhow)
- */
-static const MessageHandler dbus_message_handlers[] = {
- { "Hello",
- "",
- DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_hello },
- { "RequestName",
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_UINT32_AS_STRING,
- DBUS_TYPE_UINT32_AS_STRING,
- bus_driver_handle_acquire_service },
- { "ReleaseName",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_UINT32_AS_STRING,
- bus_driver_handle_release_service },
- { "StartServiceByName",
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_UINT32_AS_STRING,
- DBUS_TYPE_UINT32_AS_STRING,
- bus_driver_handle_activate_service },
- { "UpdateActivationEnvironment",
- DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
- "",
- bus_driver_handle_update_activation_environment },
- { "NameHasOwner",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_BOOLEAN_AS_STRING,
- bus_driver_handle_service_exists },
- { "ListNames",
- "",
- DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_list_services },
- { "ListActivatableNames",
- "",
- DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_list_activatable_services },
- { "AddMatch",
- DBUS_TYPE_STRING_AS_STRING,
- "",
- bus_driver_handle_add_match },
- { "RemoveMatch",
- DBUS_TYPE_STRING_AS_STRING,
- "",
- bus_driver_handle_remove_match },
- { "GetNameOwner",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_get_service_owner },
- { "ListQueuedOwners",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_list_queued_owners },
- { "GetConnectionUnixUser",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_UINT32_AS_STRING,
- bus_driver_handle_get_connection_unix_user },
- { "GetConnectionUnixProcessID",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_UINT32_AS_STRING,
- bus_driver_handle_get_connection_unix_process_id },
- { "GetAdtAuditSessionData",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING,
- bus_driver_handle_get_adt_audit_session_data },
- { "GetConnectionSELinuxSecurityContext",
- DBUS_TYPE_STRING_AS_STRING,
- DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING,
- bus_driver_handle_get_connection_selinux_security_context },
- { "ReloadConfig",
- "",
- "",
- bus_driver_handle_reload_config },
- { "GetId",
- "",
- DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_get_id },
- { "GetConnectionCredentials", "s", "a{sv}",
- bus_driver_handle_get_connection_credentials },
- { NULL, NULL, NULL, NULL }
-};
-
-static dbus_bool_t bus_driver_handle_introspect (DBusConnection *,
- BusTransaction *, DBusMessage *, DBusError *);
-
-static const MessageHandler introspectable_message_handlers[] = {
- { "Introspect", "", DBUS_TYPE_STRING_AS_STRING, bus_driver_handle_introspect },
- { NULL, NULL, NULL, NULL }
-};
-
-#ifdef DBUS_ENABLE_STATS
-static const MessageHandler stats_message_handlers[] = {
- { "GetStats", "", "a{sv}", bus_stats_handle_get_stats },
- { "GetConnectionStats", "s", "a{sv}", bus_stats_handle_get_connection_stats },
- { NULL, NULL, NULL, NULL }
-};
-#endif
-
-typedef struct {
- const char *name;
- const MessageHandler *message_handlers;
- const char *extra_introspection;
-} InterfaceHandler;
-
-/* These should ideally be sorted by frequency of use, although it
- * probably doesn't matter with this few items */
-static InterfaceHandler interface_handlers[] = {
- { DBUS_INTERFACE_DBUS, dbus_message_handlers,
- " <signal name=\"NameOwnerChanged\">\n"
- " <arg type=\"s\"/>\n"
- " <arg type=\"s\"/>\n"
- " <arg type=\"s\"/>\n"
- " </signal>\n"
- " <signal name=\"NameLost\">\n"
- " <arg type=\"s\"/>\n"
- " </signal>\n"
- " <signal name=\"NameAcquired\">\n"
- " <arg type=\"s\"/>\n"
- " </signal>\n" },
- { DBUS_INTERFACE_INTROSPECTABLE, introspectable_message_handlers, NULL },
-#ifdef DBUS_ENABLE_STATS
- { BUS_INTERFACE_STATS, stats_message_handlers, NULL },
-#endif
- { NULL, NULL, NULL }
-};
-
-static dbus_bool_t
-write_args_for_direction (DBusString *xml,
- const char *signature,
- dbus_bool_t in)
-{
- DBusTypeReader typereader;
- DBusString sigstr;
- int current_type;
-
- _dbus_string_init_const (&sigstr, signature);
- _dbus_type_reader_init_types_only (&typereader, &sigstr, 0);
-
- while ((current_type = _dbus_type_reader_get_current_type (&typereader)) != DBUS_TYPE_INVALID)
- {
- const DBusString *subsig;
- int start, len;
-
- _dbus_type_reader_get_signature (&typereader, &subsig, &start, &len);
- if (!_dbus_string_append_printf (xml, " <arg direction=\"%s\" type=\"",
- in ? "in" : "out"))
- goto oom;
- if (!_dbus_string_append_len (xml,
- _dbus_string_get_const_data (subsig) + start,
- len))
- goto oom;
- if (!_dbus_string_append (xml, "\"/>\n"))
- goto oom;
-
- _dbus_type_reader_next (&typereader);
- }
- return TRUE;
- oom:
- return FALSE;
-}
-
-dbus_bool_t
-bus_driver_generate_introspect_string (DBusString *xml)
-{
- const InterfaceHandler *ih;
- const MessageHandler *mh;
-
- if (!_dbus_string_append (xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE))
- return FALSE;
- if (!_dbus_string_append (xml, "<node>\n"))
- return FALSE;
-
- for (ih = interface_handlers; ih->name != NULL; ih++)
- {
- if (!_dbus_string_append_printf (xml, " <interface name=\"%s\">\n",
- ih->name))
- return FALSE;
-
- for (mh = ih->message_handlers; mh->name != NULL; mh++)
- {
- if (!_dbus_string_append_printf (xml, " <method name=\"%s\">\n",
- mh->name))
- return FALSE;
-
- if (!write_args_for_direction (xml, mh->in_args, TRUE))
- return FALSE;
-
- if (!write_args_for_direction (xml, mh->out_args, FALSE))
- return FALSE;
-
- if (!_dbus_string_append (xml, " </method>\n"))
- return FALSE;
- }
-
- if (ih->extra_introspection != NULL &&
- !_dbus_string_append (xml, ih->extra_introspection))
- return FALSE;
-
- if (!_dbus_string_append (xml, " </interface>\n"))
- return FALSE;
- }
-
- if (!_dbus_string_append (xml, "</node>\n"))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-bus_driver_handle_introspect (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- DBusString xml;
- DBusMessage *reply;
- const char *v_STRING;
-
- _dbus_verbose ("Introspect() on bus driver\n");
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- reply = NULL;
-
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&xml))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!bus_driver_generate_introspect_string (&xml))
- goto oom;
-
- v_STRING = _dbus_string_get_const_data (&xml);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto oom;
-
- if (! dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_INVALID))
- goto oom;
-
- if (! bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
- _dbus_string_free (&xml);
-
- return TRUE;
-
- oom:
- BUS_SET_OOM (error);
-
- if (reply)
- dbus_message_unref (reply);
-
- _dbus_string_free (&xml);
-
- return FALSE;
-}
-
-dbus_bool_t
-bus_driver_handle_message (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- const char *name, *interface;
- const InterfaceHandler *ih;
- const MessageHandler *mh;
- dbus_bool_t found_interface = FALSE;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (dbus_message_is_signal (message, "org.freedesktop.systemd1.Activator", "ActivationFailure"))
- {
- BusContext *context;
-
- context = bus_connection_get_context (connection);
- return dbus_activation_systemd_failure(bus_context_get_activation(context), message);
- }
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
- {
- _dbus_verbose ("Driver got a non-method-call message, ignoring\n");
- return TRUE; /* we just ignore this */
- }
-
- /* may be NULL, which means "any interface will do" */
- interface = dbus_message_get_interface (message);
-
- _dbus_assert (dbus_message_get_member (message) != NULL);
-
- name = dbus_message_get_member (message);
-
- _dbus_verbose ("Driver got a method call: %s\n", name);
-
- /* security checks should have kept this from getting here */
- _dbus_assert (dbus_message_get_sender (message) != NULL ||
- strcmp (name, "Hello") == 0);
-
- for (ih = interface_handlers; ih->name != NULL; ih++)
- {
- if (interface != NULL && strcmp (interface, ih->name) != 0)
- continue;
-
- found_interface = TRUE;
-
- for (mh = ih->message_handlers; mh->name != NULL; mh++)
- {
- if (strcmp (mh->name, name) != 0)
- continue;
-
- _dbus_verbose ("Found driver handler for %s\n", name);
-
- if (!dbus_message_has_signature (message, mh->in_args))
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_verbose ("Call to %s has wrong args (%s, expected %s)\n",
- name, dbus_message_get_signature (message),
- mh->in_args);
-
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Call to %s has wrong args (%s, expected %s)\n",
- name, dbus_message_get_signature (message),
- mh->in_args);
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
- }
-
- if ((* mh->handler) (connection, transaction, message, error))
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_verbose ("Driver handler succeeded\n");
- return TRUE;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_verbose ("Driver handler returned failure\n");
- return FALSE;
- }
- }
- }
-
- _dbus_verbose ("No driver handler for message \"%s\"\n",
- name);
-
- dbus_set_error (error, found_interface ? DBUS_ERROR_UNKNOWN_METHOD : DBUS_ERROR_UNKNOWN_INTERFACE,
- "%s does not understand message %s",
- DBUS_SERVICE_DBUS, name);
-
- return FALSE;
-}
-
-void
-bus_driver_remove_connection (DBusConnection *connection)
-{
- /* FIXME 1.0 Does nothing for now, should unregister the connection
- * with the bus driver.
- */
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/driver.h b/src/3rd_party/dbus-1.7.8/bus/driver.h
deleted file mode 100644
index 713b276403..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/driver.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* driver.h Bus client (driver)
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_DRIVER_H
-#define BUS_DRIVER_H
-
-#include <dbus/dbus.h>
-#include "connection.h"
-
-void bus_driver_remove_connection (DBusConnection *connection);
-dbus_bool_t bus_driver_handle_message (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error);
-dbus_bool_t bus_driver_send_service_lost (DBusConnection *connection,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_driver_send_service_acquired (DBusConnection *connection,
- const char *service_name,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_driver_send_service_owner_changed (const char *service_name,
- const char *old_owner,
- const char *new_owner,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_driver_generate_introspect_string (DBusString *xml);
-
-
-
-#endif /* BUS_DRIVER_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/expirelist.c b/src/3rd_party/dbus-1.7.8/bus/expirelist.c
deleted file mode 100644
index 9a3886e979..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/expirelist.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* expirelist.c List of items that expire
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "expirelist.h"
-#include "test.h"
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-mainloop.h>
-#include <dbus/dbus-timeout.h>
-
-struct BusExpireList
-{
- DBusList *items; /**< List of BusExpireItem */
- DBusTimeout *timeout;
- DBusLoop *loop;
- BusExpireFunc expire_func;
- void *data;
- int expire_after; /**< Expire after milliseconds (thousandths) */
-};
-
-static dbus_bool_t expire_timeout_handler (void *data);
-
-BusExpireList*
-bus_expire_list_new (DBusLoop *loop,
- int expire_after,
- BusExpireFunc expire_func,
- void *data)
-{
- BusExpireList *list;
-
- list = dbus_new0 (BusExpireList, 1);
- if (list == NULL)
- return NULL;
-
- list->expire_func = expire_func;
- list->data = data;
- list->loop = loop;
- list->expire_after = expire_after;
-
- list->timeout = _dbus_timeout_new (100, /* irrelevant */
- expire_timeout_handler,
- list, NULL);
- if (list->timeout == NULL)
- goto failed;
-
- _dbus_timeout_set_enabled (list->timeout, FALSE);
-
- if (!_dbus_loop_add_timeout (list->loop, list->timeout))
- goto failed;
-
- return list;
-
- failed:
- if (list->timeout)
- _dbus_timeout_unref (list->timeout);
-
- dbus_free (list);
-
- return NULL;
-}
-
-void
-bus_expire_list_free (BusExpireList *list)
-{
- _dbus_assert (list->items == NULL);
-
- _dbus_loop_remove_timeout (list->loop, list->timeout);
-
- _dbus_timeout_unref (list->timeout);
-
- dbus_free (list);
-}
-
-void
-bus_expire_timeout_set_interval (DBusTimeout *timeout,
- int next_interval)
-{
- if (next_interval >= 0)
- {
- _dbus_timeout_set_interval (timeout,
- next_interval);
- _dbus_timeout_set_enabled (timeout, TRUE);
-
- _dbus_verbose ("Enabled an expire timeout with interval %d\n",
- next_interval);
- }
- else if (dbus_timeout_get_enabled (timeout))
- {
- _dbus_timeout_set_enabled (timeout, FALSE);
-
- _dbus_verbose ("Disabled an expire timeout\n");
- }
- else
- _dbus_verbose ("No need to disable this expire timeout\n");
-}
-
-void
-bus_expire_list_recheck_immediately (BusExpireList *list)
-{
- _dbus_verbose ("setting interval on expire list to 0 for immediate recheck\n");
-
- bus_expire_timeout_set_interval (list->timeout, 0);
-}
-
-static int
-do_expiration_with_monotonic_time (BusExpireList *list,
- long tv_sec,
- long tv_usec)
-{
- DBusList *link;
- int next_interval, min_wait_time, items_to_expire;
-
- next_interval = -1;
- min_wait_time = 3600 * 1000; /* this is reset anyway if used */
- items_to_expire = 0;
-
- link = _dbus_list_get_first_link (&list->items);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&list->items, link);
- double elapsed;
- BusExpireItem *item;
-
- item = link->data;
-
- elapsed = ELAPSED_MILLISECONDS_SINCE (item->added_tv_sec,
- item->added_tv_usec,
- tv_sec, tv_usec);
-
- if (((item->added_tv_sec == 0) && (item->added_tv_usec == 0)) ||
- ((list->expire_after > 0) && (elapsed >= (double) list->expire_after)))
- {
- _dbus_verbose ("Expiring an item %p\n", item);
-
- /* If the expire function fails, we just end up expiring
- * this item next time we walk through the list. This would
- * be an indeterminate time normally, so we set up the
- * next_interval to be "shortly" (just enough to avoid
- * a busy loop)
- */
- if (!(* list->expire_func) (list, link, list->data))
- {
- next_interval = _dbus_get_oom_wait ();
- break;
- }
- }
- else if (list->expire_after > 0)
- {
- double to_wait;
-
- items_to_expire = 1;
- to_wait = (double) list->expire_after - elapsed;
- if (min_wait_time > to_wait)
- min_wait_time = to_wait;
- }
-
- link = next;
- }
-
- if (next_interval < 0 && items_to_expire)
- next_interval = min_wait_time;
-
- return next_interval;
-}
-
-static void
-bus_expirelist_expire (BusExpireList *list)
-{
- int next_interval;
-
- next_interval = -1;
-
- if (list->items != NULL)
- {
- long tv_sec, tv_usec;
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
-
- next_interval = do_expiration_with_monotonic_time (list, tv_sec, tv_usec);
- }
-
- bus_expire_timeout_set_interval (list->timeout, next_interval);
-}
-
-static dbus_bool_t
-expire_timeout_handler (void *data)
-{
- BusExpireList *list = data;
-
- _dbus_verbose ("Running\n");
-
- /* note that this may remove the timeout */
- bus_expirelist_expire (list);
-
- return TRUE;
-}
-
-void
-bus_expire_list_remove_link (BusExpireList *list,
- DBusList *link)
-{
- _dbus_list_remove_link (&list->items, link);
-}
-
-dbus_bool_t
-bus_expire_list_remove (BusExpireList *list,
- BusExpireItem *item)
-{
- return _dbus_list_remove (&list->items, item);
-}
-
-void
-bus_expire_list_unlink (BusExpireList *list,
- DBusList *link)
-{
- _dbus_list_unlink (&list->items, link);
-}
-
-dbus_bool_t
-bus_expire_list_add (BusExpireList *list,
- BusExpireItem *item)
-{
- dbus_bool_t ret;
-
- ret = _dbus_list_prepend (&list->items, item);
- if (ret && !dbus_timeout_get_enabled (list->timeout))
- bus_expire_timeout_set_interval (list->timeout, 0);
-
- return ret;
-}
-
-void
-bus_expire_list_add_link (BusExpireList *list,
- DBusList *link)
-{
- _dbus_assert (link->data != NULL);
-
- _dbus_list_prepend_link (&list->items, link);
-
- if (!dbus_timeout_get_enabled (list->timeout))
- bus_expire_timeout_set_interval (list->timeout, 0);
-}
-
-DBusList*
-bus_expire_list_get_first_link (BusExpireList *list)
-{
- return _dbus_list_get_first_link (&list->items);
-}
-
-DBusList*
-bus_expire_list_get_next_link (BusExpireList *list,
- DBusList *link)
-{
- return _dbus_list_get_next_link (&list->items, link);
-}
-
-dbus_bool_t
-bus_expire_list_contains_item (BusExpireList *list,
- BusExpireItem *item)
-{
- return _dbus_list_find_last (&list->items, item) != NULL;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-typedef struct
-{
- BusExpireItem item;
- int expire_count;
-} TestExpireItem;
-
-static dbus_bool_t
-test_expire_func (BusExpireList *list,
- DBusList *link,
- void *data)
-{
- TestExpireItem *t;
-
- t = (TestExpireItem*) link->data;
-
- t->expire_count += 1;
-
- return TRUE;
-}
-
-static void
-time_add_milliseconds (long *tv_sec,
- long *tv_usec,
- int milliseconds)
-{
- *tv_sec = *tv_sec + milliseconds / 1000;
- *tv_usec = *tv_usec + milliseconds * 1000;
- if (*tv_usec >= 1000000)
- {
- *tv_usec -= 1000000;
- *tv_sec += 1;
- }
-}
-
-dbus_bool_t
-bus_expire_list_test (const DBusString *test_data_dir)
-{
- DBusLoop *loop;
- BusExpireList *list;
- long tv_sec, tv_usec;
- long tv_sec_not_expired, tv_usec_not_expired;
- long tv_sec_expired, tv_usec_expired;
- long tv_sec_past, tv_usec_past;
- TestExpireItem *item;
- int next_interval;
- dbus_bool_t result = FALSE;
-
-
- loop = _dbus_loop_new ();
- _dbus_assert (loop != NULL);
-
-#define EXPIRE_AFTER 100
-
- list = bus_expire_list_new (loop, EXPIRE_AFTER,
- test_expire_func, NULL);
- _dbus_assert (list != NULL);
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
-
- tv_sec_not_expired = tv_sec;
- tv_usec_not_expired = tv_usec;
- time_add_milliseconds (&tv_sec_not_expired,
- &tv_usec_not_expired, EXPIRE_AFTER - 1);
-
- tv_sec_expired = tv_sec;
- tv_usec_expired = tv_usec;
- time_add_milliseconds (&tv_sec_expired,
- &tv_usec_expired, EXPIRE_AFTER);
-
-
- tv_sec_past = tv_sec - 1;
- tv_usec_past = tv_usec;
-
- item = dbus_new0 (TestExpireItem, 1);
-
- if (item == NULL)
- goto oom;
-
- item->item.added_tv_sec = tv_sec;
- item->item.added_tv_usec = tv_usec;
- if (!bus_expire_list_add (list, &item->item))
- _dbus_assert_not_reached ("out of memory");
-
- next_interval =
- do_expiration_with_monotonic_time (list, tv_sec_not_expired,
- tv_usec_not_expired);
- _dbus_assert (item->expire_count == 0);
- _dbus_verbose ("next_interval = %d\n", next_interval);
- _dbus_assert (next_interval == 1);
-
- next_interval =
- do_expiration_with_monotonic_time (list, tv_sec_expired,
- tv_usec_expired);
- _dbus_assert (item->expire_count == 1);
- _dbus_verbose ("next_interval = %d\n", next_interval);
- _dbus_assert (next_interval == -1);
-
- next_interval =
- do_expiration_with_monotonic_time (list, tv_sec_past,
- tv_usec_past);
- _dbus_assert (item->expire_count == 1);
- _dbus_verbose ("next_interval = %d\n", next_interval);
- _dbus_assert (next_interval == 1000 + EXPIRE_AFTER);
-
- bus_expire_list_remove (list, &item->item);
- dbus_free (item);
-
- bus_expire_list_free (list);
- _dbus_loop_unref (loop);
-
- result = TRUE;
-
- oom:
- return result;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/bus/expirelist.h b/src/3rd_party/dbus-1.7.8/bus/expirelist.h
deleted file mode 100644
index 887cb97b06..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/expirelist.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* expirelist.h List of stuff that expires
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_EXPIRE_LIST_H
-#define BUS_EXPIRE_LIST_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-mainloop.h>
-
-typedef struct BusExpireList BusExpireList;
-typedef struct BusExpireItem BusExpireItem;
-
-typedef dbus_bool_t (* BusExpireFunc) (BusExpireList *list,
- DBusList *link,
- void *data);
-
-
-/* embed this in a child expire item struct */
-struct BusExpireItem
-{
- long added_tv_sec; /**< Time we were added (seconds component) */
- long added_tv_usec; /**< Time we were added (microsec component) */
-};
-
-BusExpireList* bus_expire_list_new (DBusLoop *loop,
- int expire_after,
- BusExpireFunc expire_func,
- void *data);
-void bus_expire_list_free (BusExpireList *list);
-void bus_expire_list_recheck_immediately (BusExpireList *list);
-void bus_expire_list_remove_link (BusExpireList *list,
- DBusList *link);
-dbus_bool_t bus_expire_list_remove (BusExpireList *list,
- BusExpireItem *item);
-DBusList* bus_expire_list_get_first_link (BusExpireList *list);
-DBusList* bus_expire_list_get_next_link (BusExpireList *list,
- DBusList *link);
-dbus_bool_t bus_expire_list_add (BusExpireList *list,
- BusExpireItem *item);
-void bus_expire_list_add_link (BusExpireList *list,
- DBusList *link);
-dbus_bool_t bus_expire_list_contains_item (BusExpireList *list,
- BusExpireItem *item);
-void bus_expire_list_unlink (BusExpireList *list,
- DBusList *link);
-
-/* this macro and function are semi-related utility functions, not really part of the
- * BusExpireList API
- */
-
-#define ELAPSED_MILLISECONDS_SINCE(orig_tv_sec, orig_tv_usec, \
- now_tv_sec, now_tv_usec) \
- (((double) (now_tv_sec) - (double) (orig_tv_sec)) * 1000.0 + \
- ((double) (now_tv_usec) - (double) (orig_tv_usec)) / 1000.0)
-
-void bus_expire_timeout_set_interval (DBusTimeout *timeout,
- int next_interval);
-
-#endif /* BUS_EXPIRE_LIST_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/main.c b/src/3rd_party/dbus-1.7.8/bus/main.c
deleted file mode 100644
index e060baa8e8..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/main.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* main.c main() for message bus
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "bus.h"
-#include "driver.h"
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-watch.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* for write() and STDERR_FILENO */
-#endif
-#include "selinux.h"
-
-static BusContext *context;
-
-#ifdef DBUS_UNIX
-
-static int reload_pipe[2];
-#define RELOAD_READ_END 0
-#define RELOAD_WRITE_END 1
-
-static void close_reload_pipe (DBusWatch **);
-
-typedef enum
- {
- ACTION_RELOAD = 'r',
- ACTION_QUIT = 'q'
- } SignalAction;
-
-static void
-signal_handler (int sig)
-{
- switch (sig)
- {
- case SIGHUP:
- {
- DBusString str;
- char action[2] = { ACTION_RELOAD, '\0' };
-
- _dbus_string_init_const (&str, action);
- if ((reload_pipe[RELOAD_WRITE_END] > 0) &&
- !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1))
- {
- /* If we receive SIGHUP often enough to fill the pipe buffer (4096
- * times on old Linux, 65536 on modern Linux) before it can be
- * drained, let's just warn and ignore. The configuration will be
- * reloaded while draining the pipe buffer, which is what we
- * wanted. It's harmless that it will be reloaded fewer times than
- * we asked for, since the reload is delayed anyway, so new changes
- * will be picked up.
- *
- * We use write() because _dbus_warn uses vfprintf, which isn't
- * async-signal-safe.
- *
- * This is necessarily Unix-specific, but so are POSIX signals,
- * so... */
- static const char message[] =
- "Unable to write to reload pipe - buffer full?\n";
-
- if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
- {
- /* ignore failure to write out a warning */
- }
- }
- }
- break;
-
- case SIGTERM:
- {
- DBusString str;
- char action[2] = { ACTION_QUIT, '\0' };
- _dbus_string_init_const (&str, action);
- if ((reload_pipe[RELOAD_WRITE_END] < 0) ||
- !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1))
- {
- /* If we can't write to the socket, dying seems a more
- * important response to SIGTERM than cleaning up sockets,
- * so we exit. We'd use exit(), but that's not async-signal-safe,
- * so we'll have to resort to _exit(). */
- static const char message[] =
- "Unable to write termination signal to pipe - buffer full?\n"
- "Will exit instead.\n";
-
- if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
- {
- /* ignore failure to write out a warning */
- }
- _exit (1);
- }
- }
- break;
- }
-}
-#endif /* DBUS_UNIX */
-
-static void
-usage (void)
-{
- fprintf (stderr,
- DBUS_DAEMON_NAME
- " [--version]"
- " [--session]"
- " [--system]"
- " [--config-file=FILE]"
- " [--print-address[=DESCRIPTOR]]"
- " [--print-pid[=DESCRIPTOR]]"
- " [--introspect]"
- " [--address=ADDRESS]"
- " [--nopidfile]"
- " [--nofork]"
-#ifdef DBUS_UNIX
- " [--fork]"
- " [--systemd-activation]"
-#endif
- "\n");
- exit (1);
-}
-
-static void
-version (void)
-{
- printf ("D-Bus Message Bus Daemon %s\n"
- "Copyright (C) 2002, 2003 Red Hat, Inc., CodeFactory AB, and others\n"
- "This is free software; see the source for copying conditions.\n"
- "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
- DBUS_VERSION_STRING);
- exit (0);
-}
-
-static void
-introspect (void)
-{
- DBusString xml;
- const char *v_STRING;
-
- if (!_dbus_string_init (&xml))
- goto oom;
-
- if (!bus_driver_generate_introspect_string (&xml))
- {
- _dbus_string_free (&xml);
- goto oom;
- }
-
- v_STRING = _dbus_string_get_const_data (&xml);
- printf ("%s\n", v_STRING);
-
- exit (0);
-
- oom:
- _dbus_warn ("Can not introspect - Out of memory\n");
- exit (1);
-}
-
-static void
-check_two_config_files (const DBusString *config_file,
- const char *extra_arg)
-{
- if (_dbus_string_get_length (config_file) > 0)
- {
- fprintf (stderr, "--%s specified but configuration file %s already requested\n",
- extra_arg, _dbus_string_get_const_data (config_file));
- exit (1);
- }
-}
-
-static void
-check_two_addresses (const DBusString *address,
- const char *extra_arg)
-{
- if (_dbus_string_get_length (address) > 0)
- {
- fprintf (stderr, "--%s specified but address %s already requested\n",
- extra_arg, _dbus_string_get_const_data (address));
- exit (1);
- }
-}
-
-static void
-check_two_addr_descriptors (const DBusString *addr_fd,
- const char *extra_arg)
-{
- if (_dbus_string_get_length (addr_fd) > 0)
- {
- fprintf (stderr, "--%s specified but printing address to %s already requested\n",
- extra_arg, _dbus_string_get_const_data (addr_fd));
- exit (1);
- }
-}
-
-static void
-check_two_pid_descriptors (const DBusString *pid_fd,
- const char *extra_arg)
-{
- if (_dbus_string_get_length (pid_fd) > 0)
- {
- fprintf (stderr, "--%s specified but printing pid to %s already requested\n",
- extra_arg, _dbus_string_get_const_data (pid_fd));
- exit (1);
- }
-}
-
-#ifdef DBUS_UNIX
-static dbus_bool_t
-handle_reload_watch (DBusWatch *watch,
- unsigned int flags,
- void *data)
-{
- DBusError error;
- DBusString str;
- char *action_str;
- char action = '\0';
-
- while (!_dbus_string_init (&str))
- _dbus_wait_for_memory ();
-
- if ((reload_pipe[RELOAD_READ_END] > 0) &&
- _dbus_read_socket (reload_pipe[RELOAD_READ_END], &str, 1) != 1)
- {
- _dbus_warn ("Couldn't read from reload pipe.\n");
- close_reload_pipe (&watch);
- return TRUE;
- }
-
- action_str = _dbus_string_get_data (&str);
- if (action_str != NULL)
- {
- action = action_str[0];
- }
- _dbus_string_free (&str);
-
- /* this can only fail if we don't understand the config file
- * or OOM. Either way we should just stick with the currently
- * loaded config.
- */
- dbus_error_init (&error);
-
- switch (action)
- {
- case ACTION_RELOAD:
- if (! bus_context_reload_config (context, &error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- _dbus_assert (dbus_error_has_name (&error, DBUS_ERROR_FAILED) ||
- dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY));
- _dbus_warn ("Unable to reload configuration: %s\n",
- error.message);
- dbus_error_free (&error);
- }
- break;
-
- case ACTION_QUIT:
- {
- DBusLoop *loop;
- /*
- * On OSs without abstract sockets, we want to quit
- * gracefully rather than being killed by SIGTERM,
- * so that DBusServer gets a chance to clean up the
- * sockets from the filesystem. fd.o #38656
- */
- loop = bus_context_get_loop (context);
- if (loop != NULL)
- {
- _dbus_loop_quit (loop);
- }
- }
- break;
-
- default:
- break;
- }
-
- return TRUE;
-}
-
-static void
-setup_reload_pipe (DBusLoop *loop)
-{
- DBusError error;
- DBusWatch *watch;
-
- dbus_error_init (&error);
-
- if (!_dbus_full_duplex_pipe (&reload_pipe[0], &reload_pipe[1],
- TRUE, &error))
- {
- _dbus_warn ("Unable to create reload pipe: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- watch = _dbus_watch_new (reload_pipe[RELOAD_READ_END],
- DBUS_WATCH_READABLE, TRUE,
- handle_reload_watch, NULL, NULL);
-
- if (watch == NULL)
- {
- _dbus_warn ("Unable to create reload watch: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- if (!_dbus_loop_add_watch (loop, watch))
- {
- _dbus_warn ("Unable to add reload watch to main loop: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
-}
-
-static void
-close_reload_pipe (DBusWatch **watch)
-{
- _dbus_loop_remove_watch (bus_context_get_loop (context), *watch);
- _dbus_watch_invalidate (*watch);
- _dbus_watch_unref (*watch);
- *watch = NULL;
-
- _dbus_close_socket (reload_pipe[RELOAD_READ_END], NULL);
- reload_pipe[RELOAD_READ_END] = -1;
-
- _dbus_close_socket (reload_pipe[RELOAD_WRITE_END], NULL);
- reload_pipe[RELOAD_WRITE_END] = -1;
-}
-#endif /* DBUS_UNIX */
-
-int
-main (int argc, char **argv)
-{
- DBusError error;
- DBusString config_file;
- DBusString address;
- DBusString addr_fd;
- DBusString pid_fd;
- const char *prev_arg;
- DBusPipe print_addr_pipe;
- DBusPipe print_pid_pipe;
- int i;
- dbus_bool_t print_address;
- dbus_bool_t print_pid;
- BusContextFlags flags;
-
- if (!_dbus_string_init (&config_file))
- return 1;
-
- if (!_dbus_string_init (&address))
- return 1;
-
- if (!_dbus_string_init (&addr_fd))
- return 1;
-
- if (!_dbus_string_init (&pid_fd))
- return 1;
-
- print_address = FALSE;
- print_pid = FALSE;
-
- flags = BUS_CONTEXT_FLAG_WRITE_PID_FILE;
-
- prev_arg = NULL;
- i = 1;
- while (i < argc)
- {
- const char *arg = argv[i];
-
- if (strcmp (arg, "--help") == 0 ||
- strcmp (arg, "-h") == 0 ||
- strcmp (arg, "-?") == 0)
- {
- usage ();
- }
- else if (strcmp (arg, "--version") == 0)
- {
- version ();
- }
- else if (strcmp (arg, "--introspect") == 0)
- {
- introspect ();
- }
- else if (strcmp (arg, "--nofork") == 0)
- {
- flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS;
- flags |= BUS_CONTEXT_FLAG_FORK_NEVER;
- }
-#ifdef DBUS_UNIX
- else if (strcmp (arg, "--fork") == 0)
- {
- flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER;
- flags |= BUS_CONTEXT_FLAG_FORK_ALWAYS;
- }
- else if (strcmp (arg, "--systemd-activation") == 0)
- {
- flags |= BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION;
- }
-#endif
- else if (strcmp (arg, "--nopidfile") == 0)
- {
- flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE;
- }
- else if (strcmp (arg, "--system") == 0)
- {
- check_two_config_files (&config_file, "system");
-
- if (!_dbus_append_system_config_file (&config_file))
- exit (1);
- }
- else if (strcmp (arg, "--session") == 0)
- {
- check_two_config_files (&config_file, "session");
-
- if (!_dbus_append_session_config_file (&config_file))
- exit (1);
- }
- else if (strstr (arg, "--config-file=") == arg)
- {
- const char *file;
-
- check_two_config_files (&config_file, "config-file");
-
- file = strchr (arg, '=');
- ++file;
-
- if (!_dbus_string_append (&config_file, file))
- exit (1);
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--config-file") == 0)
- {
- check_two_config_files (&config_file, "config-file");
-
- if (!_dbus_string_append (&config_file, arg))
- exit (1);
- }
- else if (strcmp (arg, "--config-file") == 0)
- {
- /* wait for next arg */
- }
- else if (strstr (arg, "--address=") == arg)
- {
- const char *file;
-
- check_two_addresses (&address, "address");
-
- file = strchr (arg, '=');
- ++file;
-
- if (!_dbus_string_append (&address, file))
- exit (1);
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--address") == 0)
- {
- check_two_addresses (&address, "address");
-
- if (!_dbus_string_append (&address, arg))
- exit (1);
- }
- else if (strcmp (arg, "--address") == 0)
- {
- /* wait for next arg */
- }
- else if (strstr (arg, "--print-address=") == arg)
- {
- const char *desc;
-
- check_two_addr_descriptors (&addr_fd, "print-address");
-
- desc = strchr (arg, '=');
- ++desc;
-
- if (!_dbus_string_append (&addr_fd, desc))
- exit (1);
-
- print_address = TRUE;
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--print-address") == 0)
- {
- check_two_addr_descriptors (&addr_fd, "print-address");
-
- if (!_dbus_string_append (&addr_fd, arg))
- exit (1);
-
- print_address = TRUE;
- }
- else if (strcmp (arg, "--print-address") == 0)
- {
- print_address = TRUE; /* and we'll get the next arg if appropriate */
- }
- else if (strstr (arg, "--print-pid=") == arg)
- {
- const char *desc;
-
- check_two_pid_descriptors (&pid_fd, "print-pid");
-
- desc = strchr (arg, '=');
- ++desc;
-
- if (!_dbus_string_append (&pid_fd, desc))
- exit (1);
-
- print_pid = TRUE;
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--print-pid") == 0)
- {
- check_two_pid_descriptors (&pid_fd, "print-pid");
-
- if (!_dbus_string_append (&pid_fd, arg))
- exit (1);
-
- print_pid = TRUE;
- }
- else if (strcmp (arg, "--print-pid") == 0)
- {
- print_pid = TRUE; /* and we'll get the next arg if appropriate */
- }
- else
- {
- usage ();
- }
-
- prev_arg = arg;
-
- ++i;
- }
-
- if (_dbus_string_get_length (&config_file) == 0)
- {
- fprintf (stderr, "No configuration file specified.\n");
- usage ();
- }
-
- _dbus_pipe_invalidate (&print_addr_pipe);
- if (print_address)
- {
- _dbus_pipe_init_stdout (&print_addr_pipe);
- if (_dbus_string_get_length (&addr_fd) > 0)
- {
- long val;
- int end;
- if (!_dbus_string_parse_int (&addr_fd, 0, &val, &end) ||
- end != _dbus_string_get_length (&addr_fd) ||
- val < 0 || val > _DBUS_INT_MAX)
- {
- fprintf (stderr, "Invalid file descriptor: \"%s\"\n",
- _dbus_string_get_const_data (&addr_fd));
- exit (1);
- }
-
- _dbus_pipe_init (&print_addr_pipe, val);
- }
- }
- _dbus_string_free (&addr_fd);
-
- _dbus_pipe_invalidate (&print_pid_pipe);
- if (print_pid)
- {
- _dbus_pipe_init_stdout (&print_pid_pipe);
- if (_dbus_string_get_length (&pid_fd) > 0)
- {
- long val;
- int end;
- if (!_dbus_string_parse_int (&pid_fd, 0, &val, &end) ||
- end != _dbus_string_get_length (&pid_fd) ||
- val < 0 || val > _DBUS_INT_MAX)
- {
- fprintf (stderr, "Invalid file descriptor: \"%s\"\n",
- _dbus_string_get_const_data (&pid_fd));
- exit (1);
- }
-
- _dbus_pipe_init (&print_pid_pipe, val);
- }
- }
- _dbus_string_free (&pid_fd);
-
- if (!bus_selinux_pre_init ())
- {
- _dbus_warn ("SELinux pre-initialization failed\n");
- exit (1);
- }
-
- dbus_error_init (&error);
- context = bus_context_new (&config_file, flags,
- &print_addr_pipe, &print_pid_pipe,
- _dbus_string_get_length(&address) > 0 ? &address : NULL,
- &error);
- _dbus_string_free (&config_file);
- if (context == NULL)
- {
- _dbus_warn ("Failed to start message bus: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- /* bus_context_new() closes the print_addr_pipe and
- * print_pid_pipe
- */
-
-#ifdef DBUS_UNIX
- setup_reload_pipe (bus_context_get_loop (context));
-
- /* POSIX signals are Unix-specific, and _dbus_set_signal_handler is
- * unimplemented (and probably unimplementable) on Windows, so there's
- * no point in trying to make the handler portable to non-Unix. */
-
- _dbus_set_signal_handler (SIGTERM, signal_handler);
- _dbus_set_signal_handler (SIGHUP, signal_handler);
-#endif /* DBUS_UNIX */
-
- _dbus_verbose ("We are on D-Bus...\n");
- _dbus_loop_run (bus_context_get_loop (context));
-
- bus_context_shutdown (context);
- bus_context_unref (context);
- bus_selinux_shutdown ();
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/messagebus-config.in b/src/3rd_party/dbus-1.7.8/bus/messagebus-config.in
deleted file mode 100644
index 39459dcb7c..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/messagebus-config.in
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/sh
-#
-# messagebus-config, Copyright 2009 Yaakov Selkowitz
-#
-# This file is part of the Cygwin port of dbus.
-
-# ======================================================================
-# Initialization
-# ======================================================================
-PROGNAME=$(basename $0)
-_tdir=$(dirname $0)
-PROGDIR=$(cd $_tdir && pwd)
-
-CSIH_SCRIPT=/usr/share/csih/cygwin-service-installation-helper.sh
-
-# Subdirectory where the new package is being installed
-PREFIX=@prefix@
-
-# Directory where the config files are stored
-SYSCONFDIR=@sysconfdir@/dbus-1
-DEVDIR=/dev
-LOGDIR=/var/log
-RUNDIR=$(dirname @DBUS_SYSTEM_PID_FILE@)
-SOCKDIR=$(dirname @DBUS_SYSTEM_SOCKET@)
-
-source ${CSIH_SCRIPT}
-
-# ======================================================================
-# Routine: install_service
-# Install messagebus as a service
-# ======================================================================
-install_service() {
-
- if csih_is_nt
- then
-
- # Check if messagebus is installed and remove on user request.
- if cygrunsrv -Q messagebus > /dev/null 2>&1
- then
- csih_warning "The messagebus service is already installed."
- echo
- if csih_request "Do you want to reinstall it with different args?"
- then
- cygrunsrv -E messagebus
- cygrunsrv -R messagebus
- fi
- fi
-
- # Install messagebus service if it is not already installed
- if ! cygrunsrv -Q messagebus > /dev/null 2>&1
- then
- echo
- csih_warning "The following function requires administrator privileges!"
- if csih_request "Do you want to install messagebus as service?"
- then
- if cygrunsrv -I messagebus -d "CYGWIN D-Bus system service" -p @EXPANDED_BINDIR@/dbus-daemon -a "--nofork --system"
- then
- echo
- csih_inform "The messagebus service has been installed under the LocalSystem"
- csih_inform "account (also known as SYSTEM). To start the service now, call"
- csih_inform "\`net start messagebus' or \`cygrunsrv -S messagebus'. Otherwise, it"
- csih_inform "will start automatically after the next reboot."
- echo
- csih_inform "Check ${SYSCONFDIR}/system.conf first, if it suits your needs."
- fi
- fi # user allowed us to install messagebus
- fi # messagebus already installed
- fi # csih_is_nt
-} # --- End of install_service --- #
-
-
-# ======================================================================
-# Main Entry Point
-# ======================================================================
-
-
-# Check how the script has been started. If
-# (1) it has been started by giving the full path and
-# that path is /etc/postinstall, OR
-# (2) Otherwise, if the environment variable
-# CONFIG_AUTO_ANSWER_NO is set
-# then set auto_answer to "no". This allows automatic
-# creation of the config files in /etc w/o overwriting
-# them if they already exist. In both cases, color
-# escape sequences are suppressed, so as to prevent
-# cluttering setup's logfiles.
-if [ "$PROGDIR" = "/etc/postinstall" ]
-then
- csih_auto_answer="no"
- csih_disable_color
-fi
-if [ -n "${CONFIG_AUTO_ANSWER_NO}" ]
-then
- csih_auto_answer="no"
- csih_disable_color
-fi
-
-
-# ======================================================================
-# Parse options
-# ======================================================================
-while :
-do
- case $# in
- 0)
- break
- ;;
- esac
-
- option=$1
- shift
-
- case "$option" in
- -d | --debug )
- set -x
- csih_trace_on
- ;;
-
- -y | --yes )
- csih_auto_answer=yes
- ;;
-
- -n | --no )
- csih_auto_answer=no
- ;;
-
- *)
- echo "usage: ${PROGNAME} [OPTION]..."
- echo
- echo "This script creates a basic messagebus configuration."
- echo
- echo "Options:"
- echo " --debug -d Enable shell's debug output."
- echo " --yes -y Answer all questions with \"yes\" automatically."
- echo " --no -n Answer all questions with \"no\" automatically."
- echo
- exit 1
- ;;
-
- esac
-done
-
-# ======================================================================
-# Action!
-# ======================================================================
-
-# Check for ${SYSCONFDIR} directory
-csih_make_dir "${SYSCONFDIR}" "Cannot create global configuration files."
-chmod 775 "${SYSCONFDIR}"
-setfacl -m u:system:rwx "${SYSCONFDIR}"
-
-# Check for ${DEVDIR} directory
-csih_make_dir "${DEVDIR}" "Syslogging using messagebus will not work."
-chmod 775 "${DEVDIR}"
-setfacl -m u:system:rwx "${DEVDIR}"
-
-# Check for ${LOGDIR} directory
-csih_make_dir "${LOGDIR}" "Syslogging using messagebus will not work."
-chmod 775 "${LOGDIR}"
-setfacl -m u:system:rwx "${LOGDIR}"
-
-# Check for ${RUNDIR} directory
-csih_make_dir "${RUNDIR}" "PID files of running processes will not be created."
-chmod 775 "${RUNDIR}"
-setfacl -m u:system:rwx "${RUNDIR}"
-
-# Check for ${SOCKDIR} directory
-csih_make_dir "${SOCKDIR}" "SOCKET files of running processes will not be created."
-chmod 775 "${SOCKDIR}"
-setfacl -m u:system:rwx "${SOCKDIR}"
-
-# maybe: csih_auto_answer=no will skip,
-# interactive user will get a chance to override
-install_service
-
-
-echo
-echo "Configuration finished. Have fun!"
diff --git a/src/3rd_party/dbus-1.7.8/bus/messagebus.in b/src/3rd_party/dbus-1.7.8/bus/messagebus.in
deleted file mode 100755
index 3e2ee07a11..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/messagebus.in
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-#
-# messagebus: The D-BUS systemwide message bus
-#
-# chkconfig: 345 22 85
-# description: This is a daemon which broadcasts notifications of system events \
-# and other messages. See http://www.freedesktop.org/software/dbus/
-#
-# processname: dbus-daemon
-# pidfile: @DBUS_SYSTEM_PID_FILE@
-#
-### BEGIN INIT INFO
-# Provides: messagebus
-# Required-Start: $syslog $local_fs
-# Required-Stop: $syslog $local_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: The D-Bus systemwide message bus
-# Description: This is a daemon which broadcasts notifications of system
-# events and other messages. See http://www.freedesktop.org/software/dbus
-### END INIT INFO
-
-# Sanity checks.
-[ -x @EXPANDED_BINDIR@/dbus-daemon ] || exit 0
-
-# Source function library.
-. @EXPANDED_SYSCONFDIR@/rc.d/init.d/functions
-
-# so we can rearrange this easily
-processname=dbus-daemon
-servicename=messagebus
-
-RETVAL=0
-
-start() {
- echo -n $"Starting system message bus: "
- if [ -x @EXPANDED_BINDIR@/dbus-uuidgen ] ; then
- @EXPANDED_BINDIR@/dbus-uuidgen --ensure
- fi
-
- daemon --check $servicename $processname --system
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
-}
-
-stop() {
- echo -n $"Stopping system message bus: "
-
- ## we don't want to kill all the per-user $processname, we want
- ## to use the pid file *only*; because we use the fake nonexistent
- ## program name "$servicename" that should be safe-ish
- killproc $servicename -TERM
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
- rm -f @DBUS_SYSTEM_PID_FILE@
- fi
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status $servicename
- RETVAL=$?
- ;;
- restart)
- stop
- start
- ;;
- condrestart)
- if [ -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename ]; then
- stop
- start
- fi
- ;;
- reload)
- echo "Message bus can't reload its configuration, you have to restart it"
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- ;;
-esac
-exit $RETVAL
diff --git a/src/3rd_party/dbus-1.7.8/bus/org.freedesktop.dbus-session.plist.in b/src/3rd_party/dbus-1.7.8/bus/org.freedesktop.dbus-session.plist.in
deleted file mode 100644
index 40ff370d6a..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/org.freedesktop.dbus-session.plist.in
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Label</key>
- <string>org.freedesktop.dbus-session</string>
-
- <key>ServiceIPC</key>
- <true/>
-
- <!-- Please uncomment on 10.4; OnDemand doesn't work properly there. -->
- <!--
- <key>OnDemand</key>
- <false />
- -->
-
- <key>ProgramArguments</key>
- <array>
- <string>@DBUS_DAEMONDIR@/dbus-daemon</string>
- <string>--nofork</string>
- <string>--session</string>
- </array>
-
- <key>Sockets</key>
- <dict>
- <key>unix_domain_listener</key>
- <dict>
- <key>SecureSocketWithKey</key>
- <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>
- </dict>
- </dict>
-</dict>
-</plist>
diff --git a/src/3rd_party/dbus-1.7.8/bus/policy.c b/src/3rd_party/dbus-1.7.8/bus/policy.c
deleted file mode 100644
index 082f3853b8..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/policy.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* policy.c Bus security policy
- *
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "policy.h"
-#include "services.h"
-#include "test.h"
-#include "utils.h"
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-internals.h>
-
-BusPolicyRule*
-bus_policy_rule_new (BusPolicyRuleType type,
- dbus_bool_t allow)
-{
- BusPolicyRule *rule;
-
- rule = dbus_new0 (BusPolicyRule, 1);
- if (rule == NULL)
- return NULL;
-
- rule->type = type;
- rule->refcount = 1;
- rule->allow = allow;
-
- switch (rule->type)
- {
- case BUS_POLICY_RULE_USER:
- rule->d.user.uid = DBUS_UID_UNSET;
- break;
- case BUS_POLICY_RULE_GROUP:
- rule->d.group.gid = DBUS_GID_UNSET;
- break;
- case BUS_POLICY_RULE_SEND:
- rule->d.send.message_type = DBUS_MESSAGE_TYPE_INVALID;
-
- /* allow rules default to TRUE (only requested replies allowed)
- * deny rules default to FALSE (only unrequested replies denied)
- */
- rule->d.send.requested_reply = rule->allow;
- break;
- case BUS_POLICY_RULE_RECEIVE:
- rule->d.receive.message_type = DBUS_MESSAGE_TYPE_INVALID;
- /* allow rules default to TRUE (only requested replies allowed)
- * deny rules default to FALSE (only unrequested replies denied)
- */
- rule->d.receive.requested_reply = rule->allow;
- break;
- case BUS_POLICY_RULE_OWN:
- break;
- }
-
- return rule;
-}
-
-BusPolicyRule *
-bus_policy_rule_ref (BusPolicyRule *rule)
-{
- _dbus_assert (rule->refcount > 0);
-
- rule->refcount += 1;
-
- return rule;
-}
-
-void
-bus_policy_rule_unref (BusPolicyRule *rule)
-{
- _dbus_assert (rule->refcount > 0);
-
- rule->refcount -= 1;
-
- if (rule->refcount == 0)
- {
- switch (rule->type)
- {
- case BUS_POLICY_RULE_SEND:
- dbus_free (rule->d.send.path);
- dbus_free (rule->d.send.interface);
- dbus_free (rule->d.send.member);
- dbus_free (rule->d.send.error);
- dbus_free (rule->d.send.destination);
- break;
- case BUS_POLICY_RULE_RECEIVE:
- dbus_free (rule->d.receive.path);
- dbus_free (rule->d.receive.interface);
- dbus_free (rule->d.receive.member);
- dbus_free (rule->d.receive.error);
- dbus_free (rule->d.receive.origin);
- break;
- case BUS_POLICY_RULE_OWN:
- dbus_free (rule->d.own.service_name);
- break;
- case BUS_POLICY_RULE_USER:
- break;
- case BUS_POLICY_RULE_GROUP:
- break;
- }
-
- dbus_free (rule);
- }
-}
-
-struct BusPolicy
-{
- int refcount;
-
- DBusList *default_rules; /**< Default policy rules */
- DBusList *mandatory_rules; /**< Mandatory policy rules */
- DBusHashTable *rules_by_uid; /**< per-UID policy rules */
- DBusHashTable *rules_by_gid; /**< per-GID policy rules */
- DBusList *at_console_true_rules; /**< console user policy rules where at_console="true"*/
- DBusList *at_console_false_rules; /**< console user policy rules where at_console="false"*/
-};
-
-static void
-free_rule_func (void *data,
- void *user_data)
-{
- BusPolicyRule *rule = data;
-
- bus_policy_rule_unref (rule);
-}
-
-static void
-free_rule_list_func (void *data)
-{
- DBusList **list = data;
-
- if (list == NULL) /* DBusHashTable is on crack */
- return;
-
- _dbus_list_foreach (list, free_rule_func, NULL);
-
- _dbus_list_clear (list);
-
- dbus_free (list);
-}
-
-BusPolicy*
-bus_policy_new (void)
-{
- BusPolicy *policy;
-
- policy = dbus_new0 (BusPolicy, 1);
- if (policy == NULL)
- return NULL;
-
- policy->refcount = 1;
-
- policy->rules_by_uid = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL,
- free_rule_list_func);
- if (policy->rules_by_uid == NULL)
- goto failed;
-
- policy->rules_by_gid = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL,
- free_rule_list_func);
- if (policy->rules_by_gid == NULL)
- goto failed;
-
- return policy;
-
- failed:
- bus_policy_unref (policy);
- return NULL;
-}
-
-BusPolicy *
-bus_policy_ref (BusPolicy *policy)
-{
- _dbus_assert (policy->refcount > 0);
-
- policy->refcount += 1;
-
- return policy;
-}
-
-void
-bus_policy_unref (BusPolicy *policy)
-{
- _dbus_assert (policy->refcount > 0);
-
- policy->refcount -= 1;
-
- if (policy->refcount == 0)
- {
- _dbus_list_foreach (&policy->default_rules, free_rule_func, NULL);
- _dbus_list_clear (&policy->default_rules);
-
- _dbus_list_foreach (&policy->mandatory_rules, free_rule_func, NULL);
- _dbus_list_clear (&policy->mandatory_rules);
-
- _dbus_list_foreach (&policy->at_console_true_rules, free_rule_func, NULL);
- _dbus_list_clear (&policy->at_console_true_rules);
-
- _dbus_list_foreach (&policy->at_console_false_rules, free_rule_func, NULL);
- _dbus_list_clear (&policy->at_console_false_rules);
-
- if (policy->rules_by_uid)
- {
- _dbus_hash_table_unref (policy->rules_by_uid);
- policy->rules_by_uid = NULL;
- }
-
- if (policy->rules_by_gid)
- {
- _dbus_hash_table_unref (policy->rules_by_gid);
- policy->rules_by_gid = NULL;
- }
-
- dbus_free (policy);
- }
-}
-
-static dbus_bool_t
-add_list_to_client (DBusList **list,
- BusClientPolicy *client)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- BusPolicyRule *rule = link->data;
- link = _dbus_list_get_next_link (list, link);
-
- switch (rule->type)
- {
- case BUS_POLICY_RULE_USER:
- case BUS_POLICY_RULE_GROUP:
- /* These aren't per-connection policies */
- break;
-
- case BUS_POLICY_RULE_OWN:
- case BUS_POLICY_RULE_SEND:
- case BUS_POLICY_RULE_RECEIVE:
- /* These are per-connection */
- if (!bus_client_policy_append_rule (client, rule))
- return FALSE;
- break;
- }
- }
-
- return TRUE;
-}
-
-BusClientPolicy*
-bus_policy_create_client_policy (BusPolicy *policy,
- DBusConnection *connection,
- DBusError *error)
-{
- BusClientPolicy *client;
- dbus_uid_t uid;
- dbus_bool_t at_console;
-
- _dbus_assert (dbus_connection_get_is_authenticated (connection));
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- client = bus_client_policy_new ();
- if (client == NULL)
- goto nomem;
-
- if (!add_list_to_client (&policy->default_rules,
- client))
- goto nomem;
-
- /* we avoid the overhead of looking up user's groups
- * if we don't have any group rules anyway
- */
- if (_dbus_hash_table_get_n_entries (policy->rules_by_gid) > 0)
- {
- unsigned long *groups;
- int n_groups;
- int i;
-
- if (!bus_connection_get_unix_groups (connection, &groups, &n_groups, error))
- goto failed;
-
- i = 0;
- while (i < n_groups)
- {
- DBusList **list;
-
- list = _dbus_hash_table_lookup_uintptr (policy->rules_by_gid,
- groups[i]);
-
- if (list != NULL)
- {
- if (!add_list_to_client (list, client))
- {
- dbus_free (groups);
- goto nomem;
- }
- }
-
- ++i;
- }
-
- dbus_free (groups);
- }
-
- if (dbus_connection_get_unix_user (connection, &uid))
- {
- if (_dbus_hash_table_get_n_entries (policy->rules_by_uid) > 0)
- {
- DBusList **list;
-
- list = _dbus_hash_table_lookup_uintptr (policy->rules_by_uid,
- uid);
-
- if (list != NULL)
- {
- if (!add_list_to_client (list, client))
- goto nomem;
- }
- }
-
- /* Add console rules */
- at_console = _dbus_unix_user_is_at_console (uid, error);
-
- if (at_console)
- {
- if (!add_list_to_client (&policy->at_console_true_rules, client))
- goto nomem;
- }
- else if (dbus_error_is_set (error) == TRUE)
- {
- goto failed;
- }
- else if (!add_list_to_client (&policy->at_console_false_rules, client))
- {
- goto nomem;
- }
- }
-
- if (!add_list_to_client (&policy->mandatory_rules,
- client))
- goto nomem;
-
- bus_client_policy_optimize (client);
-
- return client;
-
- nomem:
- BUS_SET_OOM (error);
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (client)
- bus_client_policy_unref (client);
- return NULL;
-}
-
-static dbus_bool_t
-list_allows_user (dbus_bool_t def,
- DBusList **list,
- unsigned long uid,
- const unsigned long *group_ids,
- int n_group_ids)
-{
- DBusList *link;
- dbus_bool_t allowed;
-
- allowed = def;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- BusPolicyRule *rule = link->data;
- link = _dbus_list_get_next_link (list, link);
-
- if (rule->type == BUS_POLICY_RULE_USER)
- {
- _dbus_verbose ("List %p user rule uid="DBUS_UID_FORMAT"\n",
- list, rule->d.user.uid);
-
- if (rule->d.user.uid == DBUS_UID_UNSET)
- ; /* '*' wildcard */
- else if (rule->d.user.uid != uid)
- continue;
- }
- else if (rule->type == BUS_POLICY_RULE_GROUP)
- {
- _dbus_verbose ("List %p group rule gid="DBUS_GID_FORMAT"\n",
- list, rule->d.group.gid);
-
- if (rule->d.group.gid == DBUS_GID_UNSET)
- ; /* '*' wildcard */
- else
- {
- int i;
-
- i = 0;
- while (i < n_group_ids)
- {
- if (rule->d.group.gid == group_ids[i])
- break;
- ++i;
- }
-
- if (i == n_group_ids)
- continue;
- }
- }
- else
- continue;
-
- allowed = rule->allow;
- }
-
- return allowed;
-}
-
-dbus_bool_t
-bus_policy_allow_unix_user (BusPolicy *policy,
- unsigned long uid)
-{
- dbus_bool_t allowed;
- unsigned long *group_ids;
- int n_group_ids;
-
- /* On OOM or error we always reject the user */
- if (!_dbus_unix_groups_from_uid (uid, &group_ids, &n_group_ids))
- {
- _dbus_verbose ("Did not get any groups for UID %lu\n",
- uid);
- return FALSE;
- }
-
- /* Default to "user owning bus" can connect */
- allowed = _dbus_unix_user_is_process_owner (uid);
-
- allowed = list_allows_user (allowed,
- &policy->default_rules,
- uid,
- group_ids, n_group_ids);
-
- allowed = list_allows_user (allowed,
- &policy->mandatory_rules,
- uid,
- group_ids, n_group_ids);
-
- dbus_free (group_ids);
-
- _dbus_verbose ("UID %lu allowed = %d\n", uid, allowed);
-
- return allowed;
-}
-
-/* For now this is never actually called because the default
- * DBusConnection behavior of 'same user that owns the bus can
- * connect' is all it would do. Set the windows user function in
- * connection.c if the config file ever supports doing something
- * interesting here.
- */
-dbus_bool_t
-bus_policy_allow_windows_user (BusPolicy *policy,
- const char *windows_sid)
-{
- /* Windows has no policies here since only the session bus
- * is really used for now, so just checking that the
- * connecting person is the same as the bus owner is fine.
- */
- return _dbus_windows_user_is_process_owner (windows_sid);
-}
-
-dbus_bool_t
-bus_policy_append_default_rule (BusPolicy *policy,
- BusPolicyRule *rule)
-{
- if (!_dbus_list_append (&policy->default_rules, rule))
- return FALSE;
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_policy_append_mandatory_rule (BusPolicy *policy,
- BusPolicyRule *rule)
-{
- if (!_dbus_list_append (&policy->mandatory_rules, rule))
- return FALSE;
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-}
-
-
-
-static DBusList**
-get_list (DBusHashTable *hash,
- unsigned long key)
-{
- DBusList **list;
-
- list = _dbus_hash_table_lookup_uintptr (hash, key);
-
- if (list == NULL)
- {
- list = dbus_new0 (DBusList*, 1);
- if (list == NULL)
- return NULL;
-
- if (!_dbus_hash_table_insert_uintptr (hash, key, list))
- {
- dbus_free (list);
- return NULL;
- }
- }
-
- return list;
-}
-
-dbus_bool_t
-bus_policy_append_user_rule (BusPolicy *policy,
- dbus_uid_t uid,
- BusPolicyRule *rule)
-{
- DBusList **list;
-
- list = get_list (policy->rules_by_uid, uid);
-
- if (list == NULL)
- return FALSE;
-
- if (!_dbus_list_append (list, rule))
- return FALSE;
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_policy_append_group_rule (BusPolicy *policy,
- dbus_gid_t gid,
- BusPolicyRule *rule)
-{
- DBusList **list;
-
- list = get_list (policy->rules_by_gid, gid);
-
- if (list == NULL)
- return FALSE;
-
- if (!_dbus_list_append (list, rule))
- return FALSE;
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_policy_append_console_rule (BusPolicy *policy,
- dbus_bool_t at_console,
- BusPolicyRule *rule)
-{
- if (at_console)
- {
- if (!_dbus_list_append (&policy->at_console_true_rules, rule))
- return FALSE;
- }
- else
- {
- if (!_dbus_list_append (&policy->at_console_false_rules, rule))
- return FALSE;
- }
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-
-}
-
-static dbus_bool_t
-append_copy_of_policy_list (DBusList **list,
- DBusList **to_append)
-{
- DBusList *link;
- DBusList *tmp_list;
-
- tmp_list = NULL;
-
- /* Preallocate all our links */
- link = _dbus_list_get_first_link (to_append);
- while (link != NULL)
- {
- if (!_dbus_list_append (&tmp_list, link->data))
- {
- _dbus_list_clear (&tmp_list);
- return FALSE;
- }
-
- link = _dbus_list_get_next_link (to_append, link);
- }
-
- /* Now append them */
- while ((link = _dbus_list_pop_first_link (&tmp_list)))
- {
- bus_policy_rule_ref (link->data);
- _dbus_list_append_link (list, link);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-merge_id_hash (DBusHashTable *dest,
- DBusHashTable *to_absorb)
-{
- DBusHashIter iter;
-
- _dbus_hash_iter_init (to_absorb, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- unsigned long id = _dbus_hash_iter_get_uintptr_key (&iter);
- DBusList **list = _dbus_hash_iter_get_value (&iter);
- DBusList **target = get_list (dest, id);
-
- if (target == NULL)
- return FALSE;
-
- if (!append_copy_of_policy_list (target, list))
- return FALSE;
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_policy_merge (BusPolicy *policy,
- BusPolicy *to_absorb)
-{
- /* FIXME Not properly atomic, but as used for configuration files we
- * don't rely on it quite so much.
- */
-
- if (!append_copy_of_policy_list (&policy->default_rules,
- &to_absorb->default_rules))
- return FALSE;
-
- if (!append_copy_of_policy_list (&policy->mandatory_rules,
- &to_absorb->mandatory_rules))
- return FALSE;
-
- if (!append_copy_of_policy_list (&policy->at_console_true_rules,
- &to_absorb->at_console_true_rules))
- return FALSE;
-
- if (!append_copy_of_policy_list (&policy->at_console_false_rules,
- &to_absorb->at_console_false_rules))
- return FALSE;
-
- if (!merge_id_hash (policy->rules_by_uid,
- to_absorb->rules_by_uid))
- return FALSE;
-
- if (!merge_id_hash (policy->rules_by_gid,
- to_absorb->rules_by_gid))
- return FALSE;
-
- return TRUE;
-}
-
-struct BusClientPolicy
-{
- int refcount;
-
- DBusList *rules;
-};
-
-BusClientPolicy*
-bus_client_policy_new (void)
-{
- BusClientPolicy *policy;
-
- policy = dbus_new0 (BusClientPolicy, 1);
- if (policy == NULL)
- return NULL;
-
- policy->refcount = 1;
-
- return policy;
-}
-
-BusClientPolicy *
-bus_client_policy_ref (BusClientPolicy *policy)
-{
- _dbus_assert (policy->refcount > 0);
-
- policy->refcount += 1;
-
- return policy;
-}
-
-static void
-rule_unref_foreach (void *data,
- void *user_data)
-{
- BusPolicyRule *rule = data;
-
- bus_policy_rule_unref (rule);
-}
-
-void
-bus_client_policy_unref (BusClientPolicy *policy)
-{
- _dbus_assert (policy->refcount > 0);
-
- policy->refcount -= 1;
-
- if (policy->refcount == 0)
- {
- _dbus_list_foreach (&policy->rules,
- rule_unref_foreach,
- NULL);
-
- _dbus_list_clear (&policy->rules);
-
- dbus_free (policy);
- }
-}
-
-static void
-remove_rules_by_type_up_to (BusClientPolicy *policy,
- BusPolicyRuleType type,
- DBusList *up_to)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&policy->rules);
- while (link != up_to)
- {
- BusPolicyRule *rule = link->data;
- DBusList *next = _dbus_list_get_next_link (&policy->rules, link);
-
- if (rule->type == type)
- {
- _dbus_list_remove_link (&policy->rules, link);
- bus_policy_rule_unref (rule);
- }
-
- link = next;
- }
-}
-
-void
-bus_client_policy_optimize (BusClientPolicy *policy)
-{
- DBusList *link;
-
- /* The idea here is that if we have:
- *
- * <allow send_interface="foo.bar"/>
- * <deny send_interface="*"/>
- *
- * (for example) the deny will always override the allow. So we
- * delete the allow. Ditto for deny followed by allow, etc. This is
- * a dumb thing to put in a config file, but the <include> feature
- * of files allows for an "inheritance and override" pattern where
- * it could make sense. If an included file wants to "start over"
- * with a blanket deny, no point keeping the rules from the parent
- * file.
- */
-
- _dbus_verbose ("Optimizing policy with %d rules\n",
- _dbus_list_get_length (&policy->rules));
-
- link = _dbus_list_get_first_link (&policy->rules);
- while (link != NULL)
- {
- BusPolicyRule *rule;
- DBusList *next;
- dbus_bool_t remove_preceding;
-
- next = _dbus_list_get_next_link (&policy->rules, link);
- rule = link->data;
-
- remove_preceding = FALSE;
-
- _dbus_assert (rule != NULL);
-
- switch (rule->type)
- {
- case BUS_POLICY_RULE_SEND:
- remove_preceding =
- rule->d.send.message_type == DBUS_MESSAGE_TYPE_INVALID &&
- rule->d.send.path == NULL &&
- rule->d.send.interface == NULL &&
- rule->d.send.member == NULL &&
- rule->d.send.error == NULL &&
- rule->d.send.destination == NULL;
- break;
- case BUS_POLICY_RULE_RECEIVE:
- remove_preceding =
- rule->d.receive.message_type == DBUS_MESSAGE_TYPE_INVALID &&
- rule->d.receive.path == NULL &&
- rule->d.receive.interface == NULL &&
- rule->d.receive.member == NULL &&
- rule->d.receive.error == NULL &&
- rule->d.receive.origin == NULL;
- break;
- case BUS_POLICY_RULE_OWN:
- remove_preceding =
- rule->d.own.service_name == NULL;
- break;
- case BUS_POLICY_RULE_USER:
- case BUS_POLICY_RULE_GROUP:
- _dbus_assert_not_reached ("invalid rule");
- break;
- }
-
- if (remove_preceding)
- remove_rules_by_type_up_to (policy, rule->type,
- link);
-
- link = next;
- }
-
- _dbus_verbose ("After optimization, policy has %d rules\n",
- _dbus_list_get_length (&policy->rules));
-}
-
-dbus_bool_t
-bus_client_policy_append_rule (BusClientPolicy *policy,
- BusPolicyRule *rule)
-{
- _dbus_verbose ("Appending rule %p with type %d to policy %p\n",
- rule, rule->type, policy);
-
- if (!_dbus_list_append (&policy->rules, rule))
- return FALSE;
-
- bus_policy_rule_ref (rule);
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_client_policy_check_can_send (BusClientPolicy *policy,
- BusRegistry *registry,
- dbus_bool_t requested_reply,
- DBusConnection *receiver,
- DBusMessage *message,
- dbus_int32_t *toggles,
- dbus_bool_t *log)
-{
- DBusList *link;
- dbus_bool_t allowed;
-
- /* policy->rules is in the order the rules appeared
- * in the config file, i.e. last rule that applies wins
- */
-
- _dbus_verbose (" (policy) checking send rules\n");
- *toggles = 0;
-
- allowed = FALSE;
- link = _dbus_list_get_first_link (&policy->rules);
- while (link != NULL)
- {
- BusPolicyRule *rule = link->data;
-
- link = _dbus_list_get_next_link (&policy->rules, link);
-
- /* Rule is skipped if it specifies a different
- * message name from the message, or a different
- * destination from the message
- */
-
- if (rule->type != BUS_POLICY_RULE_SEND)
- {
- _dbus_verbose (" (policy) skipping non-send rule\n");
- continue;
- }
-
- if (rule->d.send.message_type != DBUS_MESSAGE_TYPE_INVALID)
- {
- if (dbus_message_get_type (message) != rule->d.send.message_type)
- {
- _dbus_verbose (" (policy) skipping rule for different message type\n");
- continue;
- }
- }
-
- /* If it's a reply, the requested_reply flag kicks in */
- if (dbus_message_get_reply_serial (message) != 0)
- {
- /* for allow, requested_reply=true means the rule applies
- * only when reply was requested. requested_reply=false means
- * always allow.
- */
- if (!requested_reply && rule->allow && rule->d.send.requested_reply && !rule->d.send.eavesdrop)
- {
- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n");
- continue;
- }
-
- /* for deny, requested_reply=false means the rule applies only
- * when the reply was not requested. requested_reply=true means the
- * rule always applies.
- */
- if (requested_reply && !rule->allow && !rule->d.send.requested_reply)
- {
- _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n");
- continue;
- }
- }
-
- if (rule->d.send.path != NULL)
- {
- if (dbus_message_get_path (message) != NULL &&
- strcmp (dbus_message_get_path (message),
- rule->d.send.path) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different path\n");
- continue;
- }
- }
-
- if (rule->d.send.interface != NULL)
- {
- /* The interface is optional in messages. For allow rules, if the message
- * has no interface we want to skip the rule (and thus not allow);
- * for deny rules, if the message has no interface we want to use the
- * rule (and thus deny).
- */
- dbus_bool_t no_interface;
-
- no_interface = dbus_message_get_interface (message) == NULL;
-
- if ((no_interface && rule->allow) ||
- (!no_interface &&
- strcmp (dbus_message_get_interface (message),
- rule->d.send.interface) != 0))
- {
- _dbus_verbose (" (policy) skipping rule for different interface\n");
- continue;
- }
- }
-
- if (rule->d.send.member != NULL)
- {
- if (dbus_message_get_member (message) != NULL &&
- strcmp (dbus_message_get_member (message),
- rule->d.send.member) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different member\n");
- continue;
- }
- }
-
- if (rule->d.send.error != NULL)
- {
- if (dbus_message_get_error_name (message) != NULL &&
- strcmp (dbus_message_get_error_name (message),
- rule->d.send.error) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different error name\n");
- continue;
- }
- }
-
- if (rule->d.send.destination != NULL)
- {
- /* receiver can be NULL for messages that are sent to the
- * message bus itself, we check the strings in that case as
- * built-in services don't have a DBusConnection but messages
- * to them have a destination service name.
- */
- if (receiver == NULL)
- {
- if (!dbus_message_has_destination (message,
- rule->d.send.destination))
- {
- _dbus_verbose (" (policy) skipping rule because message dest is not %s\n",
- rule->d.send.destination);
- continue;
- }
- }
- else
- {
- DBusString str;
- BusService *service;
-
- _dbus_string_init_const (&str, rule->d.send.destination);
-
- service = bus_registry_lookup (registry, &str);
- if (service == NULL)
- {
- _dbus_verbose (" (policy) skipping rule because dest %s doesn't exist\n",
- rule->d.send.destination);
- continue;
- }
-
- if (!bus_service_has_owner (service, receiver))
- {
- _dbus_verbose (" (policy) skipping rule because dest %s isn't owned by receiver\n",
- rule->d.send.destination);
- continue;
- }
- }
- }
-
- /* Use this rule */
- allowed = rule->allow;
- *log = rule->d.send.log;
- (*toggles)++;
-
- _dbus_verbose (" (policy) used rule, allow now = %d\n",
- allowed);
- }
-
- return allowed;
-}
-
-/* See docs on what the args mean on bus_context_check_security_policy()
- * comment
- */
-dbus_bool_t
-bus_client_policy_check_can_receive (BusClientPolicy *policy,
- BusRegistry *registry,
- dbus_bool_t requested_reply,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusConnection *proposed_recipient,
- DBusMessage *message,
- dbus_int32_t *toggles)
-{
- DBusList *link;
- dbus_bool_t allowed;
- dbus_bool_t eavesdropping;
-
- eavesdropping =
- addressed_recipient != proposed_recipient &&
- dbus_message_get_destination (message) != NULL;
-
- /* policy->rules is in the order the rules appeared
- * in the config file, i.e. last rule that applies wins
- */
-
- _dbus_verbose (" (policy) checking receive rules, eavesdropping = %d\n", eavesdropping);
- *toggles = 0;
-
- allowed = FALSE;
- link = _dbus_list_get_first_link (&policy->rules);
- while (link != NULL)
- {
- BusPolicyRule *rule = link->data;
-
- link = _dbus_list_get_next_link (&policy->rules, link);
-
- if (rule->type != BUS_POLICY_RULE_RECEIVE)
- {
- _dbus_verbose (" (policy) skipping non-receive rule\n");
- continue;
- }
-
- if (rule->d.receive.message_type != DBUS_MESSAGE_TYPE_INVALID)
- {
- if (dbus_message_get_type (message) != rule->d.receive.message_type)
- {
- _dbus_verbose (" (policy) skipping rule for different message type\n");
- continue;
- }
- }
-
- /* for allow, eavesdrop=false means the rule doesn't apply when
- * eavesdropping. eavesdrop=true means always allow.
- */
- if (eavesdropping && rule->allow && !rule->d.receive.eavesdrop)
- {
- _dbus_verbose (" (policy) skipping allow rule since it doesn't apply to eavesdropping\n");
- continue;
- }
-
- /* for deny, eavesdrop=true means the rule applies only when
- * eavesdropping; eavesdrop=false means always deny.
- */
- if (!eavesdropping && !rule->allow && rule->d.receive.eavesdrop)
- {
- _dbus_verbose (" (policy) skipping deny rule since it only applies to eavesdropping\n");
- continue;
- }
-
- /* If it's a reply, the requested_reply flag kicks in */
- if (dbus_message_get_reply_serial (message) != 0)
- {
- /* for allow, requested_reply=true means the rule applies
- * only when reply was requested. requested_reply=false means
- * always allow.
- */
- if (!requested_reply && rule->allow && rule->d.receive.requested_reply && !rule->d.receive.eavesdrop)
- {
- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n");
- continue;
- }
-
- /* for deny, requested_reply=false means the rule applies only
- * when the reply was not requested. requested_reply=true means the
- * rule always applies.
- */
- if (requested_reply && !rule->allow && !rule->d.receive.requested_reply)
- {
- _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n");
- continue;
- }
- }
-
- if (rule->d.receive.path != NULL)
- {
- if (dbus_message_get_path (message) != NULL &&
- strcmp (dbus_message_get_path (message),
- rule->d.receive.path) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different path\n");
- continue;
- }
- }
-
- if (rule->d.receive.interface != NULL)
- {
- /* The interface is optional in messages. For allow rules, if the message
- * has no interface we want to skip the rule (and thus not allow);
- * for deny rules, if the message has no interface we want to use the
- * rule (and thus deny).
- */
- dbus_bool_t no_interface;
-
- no_interface = dbus_message_get_interface (message) == NULL;
-
- if ((no_interface && rule->allow) ||
- (!no_interface &&
- strcmp (dbus_message_get_interface (message),
- rule->d.receive.interface) != 0))
- {
- _dbus_verbose (" (policy) skipping rule for different interface\n");
- continue;
- }
- }
-
- if (rule->d.receive.member != NULL)
- {
- if (dbus_message_get_member (message) != NULL &&
- strcmp (dbus_message_get_member (message),
- rule->d.receive.member) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different member\n");
- continue;
- }
- }
-
- if (rule->d.receive.error != NULL)
- {
- if (dbus_message_get_error_name (message) != NULL &&
- strcmp (dbus_message_get_error_name (message),
- rule->d.receive.error) != 0)
- {
- _dbus_verbose (" (policy) skipping rule for different error name\n");
- continue;
- }
- }
-
- if (rule->d.receive.origin != NULL)
- {
- /* sender can be NULL for messages that originate from the
- * message bus itself, we check the strings in that case as
- * built-in services don't have a DBusConnection but will
- * still set the sender on their messages.
- */
- if (sender == NULL)
- {
- if (!dbus_message_has_sender (message,
- rule->d.receive.origin))
- {
- _dbus_verbose (" (policy) skipping rule because message sender is not %s\n",
- rule->d.receive.origin);
- continue;
- }
- }
- else
- {
- BusService *service;
- DBusString str;
-
- _dbus_string_init_const (&str, rule->d.receive.origin);
-
- service = bus_registry_lookup (registry, &str);
-
- if (service == NULL)
- {
- _dbus_verbose (" (policy) skipping rule because origin %s doesn't exist\n",
- rule->d.receive.origin);
- continue;
- }
-
- if (!bus_service_has_owner (service, sender))
- {
- _dbus_verbose (" (policy) skipping rule because origin %s isn't owned by sender\n",
- rule->d.receive.origin);
- continue;
- }
- }
- }
-
- /* Use this rule */
- allowed = rule->allow;
- (*toggles)++;
-
- _dbus_verbose (" (policy) used rule, allow now = %d\n",
- allowed);
- }
-
- return allowed;
-}
-
-
-
-static dbus_bool_t
-bus_rules_check_can_own (DBusList *rules,
- const DBusString *service_name)
-{
- DBusList *link;
- dbus_bool_t allowed;
-
- /* rules is in the order the rules appeared
- * in the config file, i.e. last rule that applies wins
- */
-
- allowed = FALSE;
- link = _dbus_list_get_first_link (&rules);
- while (link != NULL)
- {
- BusPolicyRule *rule = link->data;
-
- link = _dbus_list_get_next_link (&rules, link);
-
- /* Rule is skipped if it specifies a different service name from
- * the desired one.
- */
-
- if (rule->type != BUS_POLICY_RULE_OWN)
- continue;
-
- if (!rule->d.own.prefix && rule->d.own.service_name != NULL)
- {
- if (!_dbus_string_equal_c_str (service_name,
- rule->d.own.service_name))
- continue;
- }
- else if (rule->d.own.prefix)
- {
- const char *data;
- char next_char;
- if (!_dbus_string_starts_with_c_str (service_name,
- rule->d.own.service_name))
- continue;
-
- data = _dbus_string_get_const_data (service_name);
- next_char = data[strlen (rule->d.own.service_name)];
- if (next_char != '\0' && next_char != '.')
- continue;
- }
-
- /* Use this rule */
- allowed = rule->allow;
- }
-
- return allowed;
-}
-
-dbus_bool_t
-bus_client_policy_check_can_own (BusClientPolicy *policy,
- const DBusString *service_name)
-{
- return bus_rules_check_can_own (policy->rules, service_name);
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-dbus_bool_t
-bus_policy_check_can_own (BusPolicy *policy,
- const DBusString *service_name)
-{
- return bus_rules_check_can_own (policy->default_rules, service_name);
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/policy.h b/src/3rd_party/dbus-1.7.8/bus/policy.h
deleted file mode 100644
index d1d3e72b7f..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/policy.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* policy.h Bus security policy
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_POLICY_H
-#define BUS_POLICY_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-sysdeps.h>
-#include "bus.h"
-
-typedef enum
-{
- BUS_POLICY_RULE_SEND,
- BUS_POLICY_RULE_RECEIVE,
- BUS_POLICY_RULE_OWN,
- BUS_POLICY_RULE_USER,
- BUS_POLICY_RULE_GROUP
-} BusPolicyRuleType;
-
-/** determines whether the rule affects a connection, or some global item */
-#define BUS_POLICY_RULE_IS_PER_CLIENT(rule) (!((rule)->type == BUS_POLICY_RULE_USER || \
- (rule)->type == BUS_POLICY_RULE_GROUP))
-
-struct BusPolicyRule
-{
- int refcount;
-
- BusPolicyRuleType type;
-
- unsigned int allow : 1; /**< #TRUE if this allows, #FALSE if it denies */
-
- union
- {
- struct
- {
- /* message type can be DBUS_MESSAGE_TYPE_INVALID meaning "any" */
- int message_type;
- /* any of these can be NULL meaning "any" */
- char *path;
- char *interface;
- char *member;
- char *error;
- char *destination;
- unsigned int eavesdrop : 1;
- unsigned int requested_reply : 1;
- unsigned int log : 1;
- } send;
-
- struct
- {
- /* message type can be DBUS_MESSAGE_TYPE_INVALID meaning "any" */
- int message_type;
- /* any of these can be NULL meaning "any" */
- char *path;
- char *interface;
- char *member;
- char *error;
- char *origin;
- unsigned int eavesdrop : 1;
- unsigned int requested_reply : 1;
- } receive;
-
- struct
- {
- /* can be NULL meaning "any" */
- char *service_name;
- /* if prefix is set, any name starting with service_name can be owned */
- unsigned int prefix : 1;
- } own;
-
- struct
- {
- /* can be DBUS_UID_UNSET meaning "any" */
- dbus_uid_t uid;
- } user;
-
- struct
- {
- /* can be DBUS_GID_UNSET meaning "any" */
- dbus_gid_t gid;
- } group;
-
- } d;
-};
-
-BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type,
- dbus_bool_t allow);
-BusPolicyRule* bus_policy_rule_ref (BusPolicyRule *rule);
-void bus_policy_rule_unref (BusPolicyRule *rule);
-
-BusPolicy* bus_policy_new (void);
-BusPolicy* bus_policy_ref (BusPolicy *policy);
-void bus_policy_unref (BusPolicy *policy);
-BusClientPolicy* bus_policy_create_client_policy (BusPolicy *policy,
- DBusConnection *connection,
- DBusError *error);
-dbus_bool_t bus_policy_allow_unix_user (BusPolicy *policy,
- unsigned long uid);
-dbus_bool_t bus_policy_allow_windows_user (BusPolicy *policy,
- const char *windows_sid);
-dbus_bool_t bus_policy_append_default_rule (BusPolicy *policy,
- BusPolicyRule *rule);
-dbus_bool_t bus_policy_append_mandatory_rule (BusPolicy *policy,
- BusPolicyRule *rule);
-dbus_bool_t bus_policy_append_user_rule (BusPolicy *policy,
- dbus_uid_t uid,
- BusPolicyRule *rule);
-dbus_bool_t bus_policy_append_group_rule (BusPolicy *policy,
- dbus_gid_t gid,
- BusPolicyRule *rule);
-dbus_bool_t bus_policy_append_console_rule (BusPolicy *policy,
- dbus_bool_t at_console,
- BusPolicyRule *rule);
-
-dbus_bool_t bus_policy_merge (BusPolicy *policy,
- BusPolicy *to_absorb);
-
-BusClientPolicy* bus_client_policy_new (void);
-BusClientPolicy* bus_client_policy_ref (BusClientPolicy *policy);
-void bus_client_policy_unref (BusClientPolicy *policy);
-dbus_bool_t bus_client_policy_check_can_send (BusClientPolicy *policy,
- BusRegistry *registry,
- dbus_bool_t requested_reply,
- DBusConnection *receiver,
- DBusMessage *message,
- dbus_int32_t *toggles,
- dbus_bool_t *log);
-dbus_bool_t bus_client_policy_check_can_receive (BusClientPolicy *policy,
- BusRegistry *registry,
- dbus_bool_t requested_reply,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusConnection *proposed_recipient,
- DBusMessage *message,
- dbus_int32_t *toggles);
-dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy,
- const DBusString *service_name);
-dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy,
- BusPolicyRule *rule);
-void bus_client_policy_optimize (BusClientPolicy *policy);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-dbus_bool_t bus_policy_check_can_own (BusPolicy *policy,
- const DBusString *service_name);
-#endif
-
-#endif /* BUS_POLICY_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/rc.messagebus.in b/src/3rd_party/dbus-1.7.8/bus/rc.messagebus.in
deleted file mode 100644
index c52ca77767..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/rc.messagebus.in
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#
-# messagebus: The D-BUS systemwide message bus
-#
-# chkconfig: 345 97 03
-# description: This is a daemon which broadcasts notifications of system events \
-# and other messages. See http://www.freedesktop.org/software/dbus/
-#
-# processname: dbus-daemon
-# pidfile: @DBUS_SYSTEM_PID_FILE@
-#
-
-# Sanity checks.
-#[ -x @EXPANDED_BINDIR@/dbus-daemon ] || exit 0
-
-# Source function library.
-#. @EXPANDED_SYSCONFDIR@/rc.d/init.d/functions
-
-# so we can rearrange this easily
-#processname=dbus-daemon
-#servicename=messagebus
-
-#RETVAL=0
-
-start() {
- echo "Starting system message bus"
- if [ -x @EXPANDED_BINDIR@/dbus-uuidgen ] ; then
- @EXPANDED_BINDIR@/dbus-uuidgen --ensure
- fi
-
- if [ -x @EXPANDED_BINDIR@/dbus-daemon ];then
- @EXPANDED_BINDIR@/dbus-daemon --system
- fi
- #daemon --check $servicename $processname --system
- #RETVAL=$?
- #echo
- #[ $RETVAL -eq 0 ] && touch @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
-}
-
-stop() {
- echo "Stopping system message bus"
-
- ## we don't want to kill all the per-user $processname, we want
- ## to use the pid file *only*; because we use the fake nonexistent
- ## program name "$servicename" that should be safe-ish
- killall dbus-daemon
- #RETVAL=$?
- #echo
- #if [ $RETVAL -eq 0 ]; then
- # rm -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename
- # rm -f @DBUS_SYSTEM_PID_FILE@
- #fi
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status $servicename
- RETVAL=$?
- ;;
- restart)
- stop
- start
- ;;
- reload)
- echo "Message bus can't reload its configuration, you have to restart it"
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|reload}"
- ;;
-esac
-exit $RETVAL
diff --git a/src/3rd_party/dbus-1.7.8/bus/selinux.c b/src/3rd_party/dbus-1.7.8/bus/selinux.c
deleted file mode 100644
index 768e55ef28..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/selinux.c
+++ /dev/null
@@ -1,1092 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- * selinux.c SELinux security checks for D-Bus
- *
- * Author: Matthew Rickard <mjricka@epoch.ncsc.mil>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-string.h>
-#ifndef DBUS_WIN
-#include <dbus/dbus-userdb.h>
-#endif
-#include "selinux.h"
-#include "services.h"
-#include "policy.h"
-#include "utils.h"
-#include "config-parser.h"
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_SELINUX
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <pthread.h>
-#include <syslog.h>
-#include <selinux/selinux.h>
-#include <selinux/avc.h>
-#include <selinux/av_permissions.h>
-#include <selinux/flask.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <grp.h>
-#endif /* HAVE_SELINUX */
-#ifdef HAVE_LIBAUDIT
-#include <cap-ng.h>
-#include <libaudit.h>
-#endif /* HAVE_LIBAUDIT */
-
-#define BUS_SID_FROM_SELINUX(sid) ((BusSELinuxID*) (sid))
-#define SELINUX_SID_FROM_BUS(sid) ((security_id_t) (sid))
-
-#ifdef HAVE_SELINUX
-/* Store the value telling us if SELinux is enabled in the kernel. */
-static dbus_bool_t selinux_enabled = FALSE;
-
-/* Store an avc_entry_ref to speed AVC decisions. */
-static struct avc_entry_ref aeref;
-
-/* Store the SID of the bus itself to use as the default. */
-static security_id_t bus_sid = SECSID_WILD;
-
-/* Thread to listen for SELinux status changes via netlink. */
-static pthread_t avc_notify_thread;
-
-/* Prototypes for AVC callback functions. */
-static void log_callback (const char *fmt, ...);
-static void log_audit_callback (void *data, security_class_t class, char *buf, size_t bufleft);
-static void *avc_create_thread (void (*run) (void));
-static void avc_stop_thread (void *thread);
-static void *avc_alloc_lock (void);
-static void avc_get_lock (void *lock);
-static void avc_release_lock (void *lock);
-static void avc_free_lock (void *lock);
-
-/* AVC callback structures for use in avc_init. */
-static const struct avc_memory_callback mem_cb =
-{
- .func_malloc = dbus_malloc,
- .func_free = dbus_free
-};
-static const struct avc_log_callback log_cb =
-{
- .func_log = log_callback,
- .func_audit = log_audit_callback
-};
-static const struct avc_thread_callback thread_cb =
-{
- .func_create_thread = avc_create_thread,
- .func_stop_thread = avc_stop_thread
-};
-static const struct avc_lock_callback lock_cb =
-{
- .func_alloc_lock = avc_alloc_lock,
- .func_get_lock = avc_get_lock,
- .func_release_lock = avc_release_lock,
- .func_free_lock = avc_free_lock
-};
-#endif /* HAVE_SELINUX */
-
-/**
- * Log callback to log denial messages from the AVC.
- * This is used in avc_init. Logs to both standard
- * error and syslogd.
- *
- * @param fmt the format string
- * @param variable argument list
- */
-#ifdef HAVE_SELINUX
-
-#ifdef HAVE_LIBAUDIT
-static int audit_fd = -1;
-#endif
-
-void
-bus_selinux_audit_init(void)
-{
-#ifdef HAVE_LIBAUDIT
- audit_fd = audit_open ();
-
- if (audit_fd < 0)
- {
- /* If kernel doesn't support audit, bail out */
- if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT)
- return;
- /* If user bus, bail out */
- if (errno == EPERM && getuid() != 0)
- return;
- _dbus_warn ("Failed opening connection to the audit subsystem");
- }
-#endif /* HAVE_LIBAUDIT */
-}
-
-static void
-log_callback (const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
-#ifdef HAVE_LIBAUDIT
- if (audit_fd >= 0)
- {
- capng_get_caps_process();
- if (capng_have_capability(CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
- {
- char buf[PATH_MAX*2];
-
- /* FIXME: need to change this to show real user */
- vsnprintf(buf, sizeof(buf), fmt, ap);
- audit_log_user_avc_message(audit_fd, AUDIT_USER_AVC, buf, NULL, NULL,
- NULL, getuid());
- return;
- }
- }
-#endif /* HAVE_LIBAUDIT */
-
- vsyslog (LOG_USER | LOG_INFO, fmt, ap);
- va_end(ap);
-}
-
-/**
- * On a policy reload we need to reparse the SELinux configuration file, since
- * this could have changed. Send a SIGHUP to reload all configs.
- */
-static int
-policy_reload_callback (u_int32_t event, security_id_t ssid,
- security_id_t tsid, security_class_t tclass,
- access_vector_t perms, access_vector_t *out_retained)
-{
- if (event == AVC_CALLBACK_RESET)
- return raise (SIGHUP);
-
- return 0;
-}
-
-/**
- * Log any auxiliary data
- */
-static void
-log_audit_callback (void *data, security_class_t class, char *buf, size_t bufleft)
-{
- DBusString *audmsg = data;
-
- if (bufleft > (size_t) _dbus_string_get_length(audmsg))
- {
- _dbus_string_copy_to_buffer_with_nul (audmsg, buf, bufleft);
- }
- else
- {
- DBusString s;
-
- _dbus_string_init_const(&s, "Buffer too small for audit message");
-
- if (bufleft > (size_t) _dbus_string_get_length(&s))
- _dbus_string_copy_to_buffer_with_nul (&s, buf, bufleft);
- }
-}
-
-/**
- * Create thread to notify the AVC of enforcing and policy reload
- * changes via netlink.
- *
- * @param run the thread run function
- * @return pointer to the thread
- */
-static void *
-avc_create_thread (void (*run) (void))
-{
- int rc;
-
- rc = pthread_create (&avc_notify_thread, NULL, (void *(*) (void *)) run, NULL);
- if (rc != 0)
- {
- _dbus_warn ("Failed to start AVC thread: %s\n", _dbus_strerror (rc));
- exit (1);
- }
- return &avc_notify_thread;
-}
-
-/* Stop AVC netlink thread. */
-static void
-avc_stop_thread (void *thread)
-{
- pthread_cancel (*(pthread_t *) thread);
-}
-
-/* Allocate a new AVC lock. */
-static void *
-avc_alloc_lock (void)
-{
- pthread_mutex_t *avc_mutex;
-
- avc_mutex = dbus_new (pthread_mutex_t, 1);
- if (avc_mutex == NULL)
- {
- _dbus_warn ("Could not create mutex: %s\n", _dbus_strerror (errno));
- exit (1);
- }
- pthread_mutex_init (avc_mutex, NULL);
-
- return avc_mutex;
-}
-
-/* Acquire an AVC lock. */
-static void
-avc_get_lock (void *lock)
-{
- pthread_mutex_lock (lock);
-}
-
-/* Release an AVC lock. */
-static void
-avc_release_lock (void *lock)
-{
- pthread_mutex_unlock (lock);
-}
-
-/* Free an AVC lock. */
-static void
-avc_free_lock (void *lock)
-{
- pthread_mutex_destroy (lock);
- dbus_free (lock);
-}
-#endif /* HAVE_SELINUX */
-
-/**
- * Return whether or not SELinux is enabled; must be
- * called after bus_selinux_init.
- */
-dbus_bool_t
-bus_selinux_enabled (void)
-{
-#ifdef HAVE_SELINUX
- return selinux_enabled;
-#else
- return FALSE;
-#endif /* HAVE_SELINUX */
-}
-
-/**
- * Do early initialization; determine whether SELinux is enabled.
- */
-dbus_bool_t
-bus_selinux_pre_init (void)
-{
-#ifdef HAVE_SELINUX
- int r;
- _dbus_assert (bus_sid == SECSID_WILD);
-
- /* Determine if we are running an SELinux kernel. */
- r = is_selinux_enabled ();
- if (r < 0)
- {
- _dbus_warn ("Could not tell if SELinux is enabled: %s\n",
- _dbus_strerror (errno));
- return FALSE;
- }
-
- selinux_enabled = r != 0;
- return TRUE;
-#else
- return TRUE;
-#endif
-}
-
-/**
- * Initialize the user space access vector cache (AVC) for D-Bus and set up
- * logging callbacks.
- */
-dbus_bool_t
-bus_selinux_full_init (void)
-{
-#ifdef HAVE_SELINUX
- char *bus_context;
-
- _dbus_assert (bus_sid == SECSID_WILD);
-
- if (!selinux_enabled)
- {
- _dbus_verbose ("SELinux not enabled in this kernel.\n");
- return TRUE;
- }
-
- _dbus_verbose ("SELinux is enabled in this kernel.\n");
-
- avc_entry_ref_init (&aeref);
- if (avc_init ("avc", &mem_cb, &log_cb, &thread_cb, &lock_cb) < 0)
- {
- _dbus_warn ("Failed to start Access Vector Cache (AVC).\n");
- return FALSE;
- }
- else
- {
- _dbus_verbose ("Access Vector Cache (AVC) started.\n");
- }
-
- if (avc_add_callback (policy_reload_callback, AVC_CALLBACK_RESET,
- NULL, NULL, 0, 0) < 0)
- {
- _dbus_warn ("Failed to add policy reload callback: %s\n",
- _dbus_strerror (errno));
- avc_destroy ();
- return FALSE;
- }
-
- bus_context = NULL;
- bus_sid = SECSID_WILD;
-
- if (getcon (&bus_context) < 0)
- {
- _dbus_verbose ("Error getting context of bus: %s\n",
- _dbus_strerror (errno));
- return FALSE;
- }
-
- if (avc_context_to_sid (bus_context, &bus_sid) < 0)
- {
- _dbus_verbose ("Error getting SID from bus context: %s\n",
- _dbus_strerror (errno));
- freecon (bus_context);
- return FALSE;
- }
-
- freecon (bus_context);
-
-#endif /* HAVE_SELINUX */
- return TRUE;
-}
-
-/**
- * Decrement SID reference count.
- *
- * @param sid the SID to decrement
- */
-void
-bus_selinux_id_unref (BusSELinuxID *sid)
-{
-#ifdef HAVE_SELINUX
- if (!selinux_enabled)
- return;
-
- _dbus_assert (sid != NULL);
-
- sidput (SELINUX_SID_FROM_BUS (sid));
-#endif /* HAVE_SELINUX */
-}
-
-void
-bus_selinux_id_ref (BusSELinuxID *sid)
-{
-#ifdef HAVE_SELINUX
- if (!selinux_enabled)
- return;
-
- _dbus_assert (sid != NULL);
-
- sidget (SELINUX_SID_FROM_BUS (sid));
-#endif /* HAVE_SELINUX */
-}
-
-/**
- * Determine if the SELinux security policy allows the given sender
- * security context to go to the given recipient security context.
- * This function determines if the requested permissions are to be
- * granted from the connection to the message bus or to another
- * optionally supplied security identifier (e.g. for a service
- * context). Currently these permissions are either send_msg or
- * acquire_svc in the dbus class.
- *
- * @param sender_sid source security context
- * @param override_sid is the target security context. If SECSID_WILD this will
- * use the context of the bus itself (e.g. the default).
- * @param target_class is the target security class.
- * @param requested is the requested permissions.
- * @returns #TRUE if security policy allows the send.
- */
-#ifdef HAVE_SELINUX
-static dbus_bool_t
-bus_selinux_check (BusSELinuxID *sender_sid,
- BusSELinuxID *override_sid,
- security_class_t target_class,
- access_vector_t requested,
- DBusString *auxdata)
-{
- if (!selinux_enabled)
- return TRUE;
-
- /* Make the security check. AVC checks enforcing mode here as well. */
- if (avc_has_perm (SELINUX_SID_FROM_BUS (sender_sid),
- override_sid ?
- SELINUX_SID_FROM_BUS (override_sid) :
- SELINUX_SID_FROM_BUS (bus_sid),
- target_class, requested, &aeref, auxdata) < 0)
- {
- switch (errno)
- {
- case EACCES:
- _dbus_verbose ("SELinux denying due to security policy.\n");
- return FALSE;
- case EINVAL:
- _dbus_verbose ("SELinux denying due to invalid security context.\n");
- return FALSE;
- default:
- _dbus_verbose ("SELinux denying due to: %s\n", _dbus_strerror (errno));
- return FALSE;
- }
- }
- else
- return TRUE;
-}
-#endif /* HAVE_SELINUX */
-
-/**
- * Returns true if the given connection can acquire a service,
- * assuming the given security ID is needed for that service.
- *
- * @param connection connection that wants to own the service
- * @param service_sid the SID of the service from the table
- * @returns #TRUE if acquire is permitted.
- */
-dbus_bool_t
-bus_selinux_allows_acquire_service (DBusConnection *connection,
- BusSELinuxID *service_sid,
- const char *service_name,
- DBusError *error)
-{
-#ifdef HAVE_SELINUX
- BusSELinuxID *connection_sid;
- unsigned long spid;
- DBusString auxdata;
- dbus_bool_t ret;
-
- if (!selinux_enabled)
- return TRUE;
-
- connection_sid = bus_connection_get_selinux_id (connection);
- if (!dbus_connection_get_unix_process_id (connection, &spid))
- spid = 0;
-
- if (!_dbus_string_init (&auxdata))
- goto oom;
-
- if (!_dbus_string_append (&auxdata, "service="))
- goto oom;
-
- if (!_dbus_string_append (&auxdata, service_name))
- goto oom;
-
- if (spid)
- {
- if (!_dbus_string_append (&auxdata, " spid="))
- goto oom;
-
- if (!_dbus_string_append_uint (&auxdata, spid))
- goto oom;
- }
-
- ret = bus_selinux_check (connection_sid,
- service_sid,
- SECCLASS_DBUS,
- DBUS__ACQUIRE_SVC,
- &auxdata);
-
- _dbus_string_free (&auxdata);
- return ret;
-
- oom:
- _dbus_string_free (&auxdata);
- BUS_SET_OOM (error);
- return FALSE;
-
-#else
- return TRUE;
-#endif /* HAVE_SELINUX */
-}
-
-/**
- * Check if SELinux security controls allow the message to be sent to a
- * particular connection based on the security context of the sender and
- * that of the receiver. The destination connection need not be the
- * addressed recipient, it could be an "eavesdropper"
- *
- * @param sender the sender of the message.
- * @param proposed_recipient the connection the message is to be sent to.
- * @returns whether to allow the send
- */
-dbus_bool_t
-bus_selinux_allows_send (DBusConnection *sender,
- DBusConnection *proposed_recipient,
- const char *msgtype,
- const char *interface,
- const char *member,
- const char *error_name,
- const char *destination,
- DBusError *error)
-{
-#ifdef HAVE_SELINUX
- BusSELinuxID *recipient_sid;
- BusSELinuxID *sender_sid;
- unsigned long spid, tpid;
- DBusString auxdata;
- dbus_bool_t ret;
- dbus_bool_t string_alloced;
-
- if (!selinux_enabled)
- return TRUE;
-
- if (!sender || !dbus_connection_get_unix_process_id (sender, &spid))
- spid = 0;
- if (!proposed_recipient || !dbus_connection_get_unix_process_id (proposed_recipient, &tpid))
- tpid = 0;
-
- string_alloced = FALSE;
- if (!_dbus_string_init (&auxdata))
- goto oom;
- string_alloced = TRUE;
-
- if (!_dbus_string_append (&auxdata, "msgtype="))
- goto oom;
-
- if (!_dbus_string_append (&auxdata, msgtype))
- goto oom;
-
- if (interface)
- {
- if (!_dbus_string_append (&auxdata, " interface="))
- goto oom;
- if (!_dbus_string_append (&auxdata, interface))
- goto oom;
- }
-
- if (member)
- {
- if (!_dbus_string_append (&auxdata, " member="))
- goto oom;
- if (!_dbus_string_append (&auxdata, member))
- goto oom;
- }
-
- if (error_name)
- {
- if (!_dbus_string_append (&auxdata, " error_name="))
- goto oom;
- if (!_dbus_string_append (&auxdata, error_name))
- goto oom;
- }
-
- if (destination)
- {
- if (!_dbus_string_append (&auxdata, " dest="))
- goto oom;
- if (!_dbus_string_append (&auxdata, destination))
- goto oom;
- }
-
- if (spid)
- {
- if (!_dbus_string_append (&auxdata, " spid="))
- goto oom;
-
- if (!_dbus_string_append_uint (&auxdata, spid))
- goto oom;
- }
-
- if (tpid)
- {
- if (!_dbus_string_append (&auxdata, " tpid="))
- goto oom;
-
- if (!_dbus_string_append_uint (&auxdata, tpid))
- goto oom;
- }
-
- sender_sid = bus_connection_get_selinux_id (sender);
- /* A NULL proposed_recipient means the bus itself. */
- if (proposed_recipient)
- recipient_sid = bus_connection_get_selinux_id (proposed_recipient);
- else
- recipient_sid = BUS_SID_FROM_SELINUX (bus_sid);
-
- ret = bus_selinux_check (sender_sid,
- recipient_sid,
- SECCLASS_DBUS,
- DBUS__SEND_MSG,
- &auxdata);
-
- _dbus_string_free (&auxdata);
-
- return ret;
-
- oom:
- if (string_alloced)
- _dbus_string_free (&auxdata);
- BUS_SET_OOM (error);
- return FALSE;
-
-#else
- return TRUE;
-#endif /* HAVE_SELINUX */
-}
-
-dbus_bool_t
-bus_selinux_append_context (DBusMessage *message,
- BusSELinuxID *sid,
- DBusError *error)
-{
-#ifdef HAVE_SELINUX
- char *context;
-
- if (avc_sid_to_context (SELINUX_SID_FROM_BUS (sid), &context) < 0)
- {
- if (errno == ENOMEM)
- BUS_SET_OOM (error);
- else
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Error getting context from SID: %s\n",
- _dbus_strerror (errno));
- return FALSE;
- }
- if (!dbus_message_append_args (message,
- DBUS_TYPE_ARRAY,
- DBUS_TYPE_BYTE,
- &context,
- strlen (context),
- DBUS_TYPE_INVALID))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
- freecon (context);
- return TRUE;
-#else
- return TRUE;
-#endif
-}
-
-/**
- * Gets the security context of a connection to the bus. It is up to
- * the caller to freecon() when they are done.
- *
- * @param connection the connection to get the context of.
- * @param con the location to store the security context.
- * @returns #TRUE if context is successfully obtained.
- */
-#ifdef HAVE_SELINUX
-static dbus_bool_t
-bus_connection_read_selinux_context (DBusConnection *connection,
- char **con)
-{
- int fd;
-
- if (!selinux_enabled)
- return FALSE;
-
- _dbus_assert (connection != NULL);
-
- if (!dbus_connection_get_unix_fd (connection, &fd))
- {
- _dbus_verbose ("Failed to get file descriptor of socket.\n");
- return FALSE;
- }
-
- if (getpeercon (fd, con) < 0)
- {
- _dbus_verbose ("Error getting context of socket peer: %s\n",
- _dbus_strerror (errno));
- return FALSE;
- }
-
- _dbus_verbose ("Successfully read connection context.\n");
- return TRUE;
-}
-#endif /* HAVE_SELINUX */
-
-/**
- * Read the SELinux ID from the connection.
- *
- * @param connection the connection to read from
- * @returns the SID if successfully determined, #NULL otherwise.
- */
-BusSELinuxID*
-bus_selinux_init_connection_id (DBusConnection *connection,
- DBusError *error)
-{
-#ifdef HAVE_SELINUX
- char *con;
- security_id_t sid;
-
- if (!selinux_enabled)
- return NULL;
-
- if (!bus_connection_read_selinux_context (connection, &con))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to read an SELinux context from connection");
- _dbus_verbose ("Error getting peer context.\n");
- return NULL;
- }
-
- _dbus_verbose ("Converting context to SID to store on connection\n");
-
- if (avc_context_to_sid (con, &sid) < 0)
- {
- if (errno == ENOMEM)
- BUS_SET_OOM (error);
- else
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Error getting SID from context \"%s\": %s\n",
- con, _dbus_strerror (errno));
-
- _dbus_warn ("Error getting SID from context \"%s\": %s\n",
- con, _dbus_strerror (errno));
-
- freecon (con);
- return NULL;
- }
-
- freecon (con);
- return BUS_SID_FROM_SELINUX (sid);
-#else
- return NULL;
-#endif /* HAVE_SELINUX */
-}
-
-
-/**
- * Function for freeing hash table data. These SIDs
- * should no longer be referenced.
- */
-static void
-bus_selinux_id_table_free_value (BusSELinuxID *sid)
-{
-#ifdef HAVE_SELINUX
- /* NULL sometimes due to how DBusHashTable works */
- if (sid)
- bus_selinux_id_unref (sid);
-#endif /* HAVE_SELINUX */
-}
-
-/**
- * Creates a new table mapping service names to security ID.
- * A security ID is a "compiled" security context, a security
- * context is just a string.
- *
- * @returns the new table or #NULL if no memory
- */
-DBusHashTable*
-bus_selinux_id_table_new (void)
-{
- return _dbus_hash_table_new (DBUS_HASH_STRING,
- (DBusFreeFunction) dbus_free,
- (DBusFreeFunction) bus_selinux_id_table_free_value);
-}
-
-/**
- * Hashes a service name and service context into the service SID
- * table as a string and a SID.
- *
- * @param service_name is the name of the service.
- * @param service_context is the context of the service.
- * @param service_table is the table to hash them into.
- * @return #FALSE if not enough memory
- */
-dbus_bool_t
-bus_selinux_id_table_insert (DBusHashTable *service_table,
- const char *service_name,
- const char *service_context)
-{
-#ifdef HAVE_SELINUX
- dbus_bool_t retval;
- security_id_t sid;
- char *key;
-
- if (!selinux_enabled)
- return TRUE;
-
- sid = SECSID_WILD;
- retval = FALSE;
-
- key = _dbus_strdup (service_name);
- if (key == NULL)
- return retval;
-
- if (avc_context_to_sid ((char *) service_context, &sid) < 0)
- {
- if (errno == ENOMEM)
- {
- dbus_free (key);
- return FALSE;
- }
-
- _dbus_warn ("Error getting SID from context \"%s\": %s\n",
- (char *) service_context,
- _dbus_strerror (errno));
- goto out;
- }
-
- if (!_dbus_hash_table_insert_string (service_table,
- key,
- BUS_SID_FROM_SELINUX (sid)))
- goto out;
-
- _dbus_verbose ("Parsed \tservice: %s \n\t\tcontext: %s\n",
- key,
- sid->ctx);
-
- /* These are owned by the hash, so clear them to avoid unref */
- key = NULL;
- sid = SECSID_WILD;
-
- retval = TRUE;
-
- out:
- if (sid != SECSID_WILD)
- sidput (sid);
-
- if (key)
- dbus_free (key);
-
- return retval;
-#else
- return TRUE;
-#endif /* HAVE_SELINUX */
-}
-
-
-/**
- * Find the security identifier associated with a particular service
- * name. Return a pointer to this SID, or #NULL/SECSID_WILD if the
- * service is not found in the hash table. This should be nearly a
- * constant time operation. If SELinux support is not available,
- * always return NULL.
- *
- * @param service_table the hash table to check for service name.
- * @param service_name the name of the service to look for.
- * @returns the SELinux ID associated with the service
- */
-BusSELinuxID*
-bus_selinux_id_table_lookup (DBusHashTable *service_table,
- const DBusString *service_name)
-{
-#ifdef HAVE_SELINUX
- security_id_t sid;
-
- sid = SECSID_WILD; /* default context */
-
- if (!selinux_enabled)
- return NULL;
-
- _dbus_verbose ("Looking up service SID for %s\n",
- _dbus_string_get_const_data (service_name));
-
- sid = _dbus_hash_table_lookup_string (service_table,
- _dbus_string_get_const_data (service_name));
-
- if (sid == SECSID_WILD)
- _dbus_verbose ("Service %s not found\n",
- _dbus_string_get_const_data (service_name));
- else
- _dbus_verbose ("Service %s found\n",
- _dbus_string_get_const_data (service_name));
-
- return BUS_SID_FROM_SELINUX (sid);
-#endif /* HAVE_SELINUX */
- return NULL;
-}
-
-/**
- * Get the SELinux policy root. This is used to find the D-Bus
- * specific config file within the policy.
- */
-const char *
-bus_selinux_get_policy_root (void)
-{
-#ifdef HAVE_SELINUX
- return selinux_policy_root ();
-#else
- return NULL;
-#endif /* HAVE_SELINUX */
-}
-
-/**
- * For debugging: Print out the current hash table of service SIDs.
- */
-void
-bus_selinux_id_table_print (DBusHashTable *service_table)
-{
-#if defined (DBUS_ENABLE_VERBOSE_MODE) && defined (HAVE_SELINUX)
- DBusHashIter iter;
-
- if (!selinux_enabled)
- return;
-
- _dbus_verbose ("Service SID Table:\n");
- _dbus_hash_iter_init (service_table, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- const char *key = _dbus_hash_iter_get_string_key (&iter);
- security_id_t sid = _dbus_hash_iter_get_value (&iter);
- _dbus_verbose ("The key is %s\n", key);
- _dbus_verbose ("The context is %s\n", sid->ctx);
- _dbus_verbose ("The refcount is %d\n", sid->refcnt);
- }
-#endif /* DBUS_ENABLE_VERBOSE_MODE && HAVE_SELINUX */
-}
-
-
-/**
- * Print out some AVC statistics.
- */
-#ifdef HAVE_SELINUX
-static void
-bus_avc_print_stats (void)
-{
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- struct avc_cache_stats cstats;
-
- if (!selinux_enabled)
- return;
-
- _dbus_verbose ("AVC Statistics:\n");
- avc_cache_stats (&cstats);
- avc_av_stats ();
- _dbus_verbose ("AVC Cache Statistics:\n");
- _dbus_verbose ("Entry lookups: %d\n", cstats.entry_lookups);
- _dbus_verbose ("Entry hits: %d\n", cstats.entry_hits);
- _dbus_verbose ("Entry misses %d\n", cstats.entry_misses);
- _dbus_verbose ("Entry discards: %d\n", cstats.entry_discards);
- _dbus_verbose ("CAV lookups: %d\n", cstats.cav_lookups);
- _dbus_verbose ("CAV hits: %d\n", cstats.cav_hits);
- _dbus_verbose ("CAV probes: %d\n", cstats.cav_probes);
- _dbus_verbose ("CAV misses: %d\n", cstats.cav_misses);
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-}
-#endif /* HAVE_SELINUX */
-
-/**
- * Destroy the AVC before we terminate.
- */
-void
-bus_selinux_shutdown (void)
-{
-#ifdef HAVE_SELINUX
- if (!selinux_enabled)
- return;
-
- _dbus_verbose ("AVC shutdown\n");
-
- if (bus_sid != SECSID_WILD)
- {
- sidput (bus_sid);
- bus_sid = SECSID_WILD;
-
- bus_avc_print_stats ();
-
- avc_destroy ();
-#ifdef HAVE_LIBAUDIT
- audit_close (audit_fd);
-#endif /* HAVE_LIBAUDIT */
- }
-#endif /* HAVE_SELINUX */
-}
-
-/* The !HAVE_LIBAUDIT case lives in dbus-sysdeps-util-unix.c */
-#ifdef HAVE_LIBAUDIT
-/**
- * Changes the user and group the bus is running as.
- *
- * @param user the user to become
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_change_to_daemon_user (const char *user,
- DBusError *error)
-{
- dbus_uid_t uid;
- dbus_gid_t gid;
- DBusString u;
-
- _dbus_string_init_const (&u, user);
-
- if (!_dbus_get_user_id_and_primary_group (&u, &uid, &gid))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "User '%s' does not appear to exist?",
- user);
- return FALSE;
- }
-
- /* If we were root */
- if (_dbus_geteuid () == 0)
- {
- int rc;
- int have_audit_write;
-
- have_audit_write = capng_have_capability (CAPNG_PERMITTED, CAP_AUDIT_WRITE);
- capng_clear (CAPNG_SELECT_BOTH);
- /* Only attempt to retain CAP_AUDIT_WRITE if we had it when
- * starting. See:
- * https://bugs.freedesktop.org/show_bug.cgi?id=49062#c9
- */
- if (have_audit_write)
- capng_update (CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
- CAP_AUDIT_WRITE);
- rc = capng_change_id (uid, gid, CAPNG_DROP_SUPP_GRP);
- if (rc)
- {
- switch (rc) {
- default:
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to drop capabilities: %s\n",
- _dbus_strerror (errno));
- break;
- case -4:
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set GID to %lu: %s", gid,
- _dbus_strerror (errno));
- break;
- case -5:
- _dbus_warn ("Failed to drop supplementary groups: %s\n",
- _dbus_strerror (errno));
- break;
- case -6:
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set UID to %lu: %s", uid,
- _dbus_strerror (errno));
- break;
- case -7:
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to unset keep-capabilities: %s\n",
- _dbus_strerror (errno));
- break;
- }
- return FALSE;
- }
- }
-
- return TRUE;
-}
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/bus/selinux.h b/src/3rd_party/dbus-1.7.8/bus/selinux.h
deleted file mode 100644
index 3bab36de48..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/selinux.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* selinux.h SELinux security check headers for D-BUS
- *
- * Author: Matthew Rickard <mjricka@epoch.ncsc.mil>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_SELINUX_H
-#define BUS_SELINUX_H
-
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-connection.h>
-#include "services.h"
-
-dbus_bool_t bus_selinux_pre_init (void);
-dbus_bool_t bus_selinux_full_init(void);
-void bus_selinux_shutdown (void);
-
-dbus_bool_t bus_selinux_enabled (void);
-
-void bus_selinux_id_ref (BusSELinuxID *sid);
-void bus_selinux_id_unref (BusSELinuxID *sid);
-
-DBusHashTable* bus_selinux_id_table_new (void);
-BusSELinuxID* bus_selinux_id_table_lookup (DBusHashTable *service_table,
- const DBusString *service_name);
-dbus_bool_t bus_selinux_id_table_insert (DBusHashTable *service_table,
- const char *service_name,
- const char *service_context);
-void bus_selinux_id_table_print (DBusHashTable *service_table);
-const char* bus_selinux_get_policy_root (void);
-
-dbus_bool_t bus_selinux_append_context (DBusMessage *message,
- BusSELinuxID *context,
- DBusError *error);
-
-dbus_bool_t bus_selinux_allows_acquire_service (DBusConnection *connection,
- BusSELinuxID *service_sid,
- const char *service_name,
- DBusError *error);
-
-dbus_bool_t bus_selinux_allows_send (DBusConnection *sender,
- DBusConnection *proposed_recipient,
- const char *msgtype, /* Supplementary audit data */
- const char *interface,
- const char *member,
- const char *error_name,
- const char *destination,
- DBusError *error);
-
-BusSELinuxID* bus_selinux_init_connection_id (DBusConnection *connection,
- DBusError *error);
-
-
-void bus_selinux_audit_init(void);
-
-#endif /* BUS_SELINUX_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/services.c b/src/3rd_party/dbus-1.7.8/bus/services.c
deleted file mode 100644
index 6f380fac7d..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/services.c
+++ /dev/null
@@ -1,1304 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* services.c Service management
- *
- * Copyright (C) 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-mempool.h>
-#include <dbus/dbus-marshal-validate.h>
-
-#include "driver.h"
-#include "services.h"
-#include "connection.h"
-#include "utils.h"
-#include "activation.h"
-#include "policy.h"
-#include "bus.h"
-#include "selinux.h"
-
-struct BusService
-{
- int refcount;
-
- BusRegistry *registry;
- char *name;
- DBusList *owners;
-};
-
-struct BusOwner
-{
- int refcount;
-
- BusService *service;
- DBusConnection *conn;
-
- unsigned int allow_replacement : 1;
- unsigned int do_not_queue : 1;
-};
-
-struct BusRegistry
-{
- int refcount;
-
- BusContext *context;
-
- DBusHashTable *service_hash;
- DBusMemPool *service_pool;
- DBusMemPool *owner_pool;
-
- DBusHashTable *service_sid_table;
-};
-
-BusRegistry*
-bus_registry_new (BusContext *context)
-{
- BusRegistry *registry;
-
- registry = dbus_new0 (BusRegistry, 1);
- if (registry == NULL)
- return NULL;
-
- registry->refcount = 1;
- registry->context = context;
-
- registry->service_hash = _dbus_hash_table_new (DBUS_HASH_STRING,
- NULL, NULL);
- if (registry->service_hash == NULL)
- goto failed;
-
- registry->service_pool = _dbus_mem_pool_new (sizeof (BusService),
- TRUE);
-
- if (registry->service_pool == NULL)
- goto failed;
-
- registry->owner_pool = _dbus_mem_pool_new (sizeof (BusOwner),
- TRUE);
-
- if (registry->owner_pool == NULL)
- goto failed;
-
- registry->service_sid_table = NULL;
-
- return registry;
-
- failed:
- bus_registry_unref (registry);
- return NULL;
-}
-
-BusRegistry *
-bus_registry_ref (BusRegistry *registry)
-{
- _dbus_assert (registry->refcount > 0);
- registry->refcount += 1;
-
- return registry;
-}
-
-void
-bus_registry_unref (BusRegistry *registry)
-{
- _dbus_assert (registry->refcount > 0);
- registry->refcount -= 1;
-
- if (registry->refcount == 0)
- {
- if (registry->service_hash)
- _dbus_hash_table_unref (registry->service_hash);
- if (registry->service_pool)
- _dbus_mem_pool_free (registry->service_pool);
- if (registry->owner_pool)
- _dbus_mem_pool_free (registry->owner_pool);
- if (registry->service_sid_table)
- _dbus_hash_table_unref (registry->service_sid_table);
-
- dbus_free (registry);
- }
-}
-
-BusService*
-bus_registry_lookup (BusRegistry *registry,
- const DBusString *service_name)
-{
- BusService *service;
-
- service = _dbus_hash_table_lookup_string (registry->service_hash,
- _dbus_string_get_const_data (service_name));
-
- return service;
-}
-
-static DBusList *
-_bus_service_find_owner_link (BusService *service,
- DBusConnection *connection)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&service->owners);
-
- while (link != NULL)
- {
- BusOwner *bus_owner;
-
- bus_owner = (BusOwner *) link->data;
- if (bus_owner->conn == connection)
- break;
-
- link = _dbus_list_get_next_link (&service->owners, link);
- }
-
- return link;
-}
-
-static void
-bus_owner_set_flags (BusOwner *owner,
- dbus_uint32_t flags)
-{
- owner->allow_replacement =
- (flags & DBUS_NAME_FLAG_ALLOW_REPLACEMENT) != FALSE;
-
- owner->do_not_queue =
- (flags & DBUS_NAME_FLAG_DO_NOT_QUEUE) != FALSE;
-}
-
-static BusOwner *
-bus_owner_new (BusService *service,
- DBusConnection *conn,
- dbus_uint32_t flags)
-{
- BusOwner *result;
-
- result = _dbus_mem_pool_alloc (service->registry->owner_pool);
- if (result != NULL)
- {
- result->refcount = 1;
- /* don't ref the connection because we don't want
- to block the connection from going away.
- transactions take care of reffing the connection
- but we need to use refcounting on the owner
- so that the owner does not get freed before
- we can deref the connection in the transaction
- */
- result->conn = conn;
- result->service = service;
-
- if (!bus_connection_add_owned_service (conn, service))
- {
- _dbus_mem_pool_dealloc (service->registry->owner_pool, result);
- return NULL;
- }
-
- bus_owner_set_flags (result, flags);
- }
- return result;
-}
-
-static BusOwner *
-bus_owner_ref (BusOwner *owner)
-{
- _dbus_assert (owner->refcount > 0);
- owner->refcount += 1;
-
- return owner;
-}
-
-static void
-bus_owner_unref (BusOwner *owner)
-{
- _dbus_assert (owner->refcount > 0);
- owner->refcount -= 1;
-
- if (owner->refcount == 0)
- {
- bus_connection_remove_owned_service (owner->conn, owner->service);
- _dbus_mem_pool_dealloc (owner->service->registry->owner_pool, owner);
- }
-}
-
-BusService*
-bus_registry_ensure (BusRegistry *registry,
- const DBusString *service_name,
- DBusConnection *owner_connection_if_created,
- dbus_uint32_t flags,
- BusTransaction *transaction,
- DBusError *error)
-{
- BusService *service;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_assert (owner_connection_if_created != NULL);
- _dbus_assert (transaction != NULL);
-
- service = _dbus_hash_table_lookup_string (registry->service_hash,
- _dbus_string_get_const_data (service_name));
- if (service != NULL)
- return service;
-
- service = _dbus_mem_pool_alloc (registry->service_pool);
- if (service == NULL)
- {
- BUS_SET_OOM (error);
- return NULL;
- }
-
- service->registry = registry;
- service->refcount = 1;
-
- _dbus_verbose ("copying string %p '%s' to service->name\n",
- service_name, _dbus_string_get_const_data (service_name));
- if (!_dbus_string_copy_data (service_name, &service->name))
- {
- _dbus_mem_pool_dealloc (registry->service_pool, service);
- BUS_SET_OOM (error);
- return NULL;
- }
- _dbus_verbose ("copied string %p '%s' to '%s'\n",
- service_name, _dbus_string_get_const_data (service_name),
- service->name);
-
- if (!bus_driver_send_service_owner_changed (service->name,
- NULL,
- bus_connection_get_name (owner_connection_if_created),
- transaction, error))
- {
- bus_service_unref (service);
- return NULL;
- }
-
- if (!bus_activation_service_created (bus_context_get_activation (registry->context),
- service->name, transaction, error))
- {
- bus_service_unref (service);
- return NULL;
- }
-
- if (!bus_service_add_owner (service, owner_connection_if_created, flags,
- transaction, error))
- {
- bus_service_unref (service);
- return NULL;
- }
-
- if (!_dbus_hash_table_insert_string (registry->service_hash,
- service->name,
- service))
- {
- /* The add_owner gets reverted on transaction cancel */
- BUS_SET_OOM (error);
- return NULL;
- }
-
- return service;
-}
-
-void
-bus_registry_foreach (BusRegistry *registry,
- BusServiceForeachFunction function,
- void *data)
-{
- DBusHashIter iter;
-
- _dbus_hash_iter_init (registry->service_hash, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- BusService *service = _dbus_hash_iter_get_value (&iter);
-
- (* function) (service, data);
- }
-}
-
-dbus_bool_t
-bus_registry_list_services (BusRegistry *registry,
- char ***listp,
- int *array_len)
-{
- int i, j, len;
- char **retval;
- DBusHashIter iter;
-
- len = _dbus_hash_table_get_n_entries (registry->service_hash);
- retval = dbus_new (char *, len + 1);
-
- if (retval == NULL)
- return FALSE;
-
- _dbus_hash_iter_init (registry->service_hash, &iter);
- i = 0;
- while (_dbus_hash_iter_next (&iter))
- {
- BusService *service = _dbus_hash_iter_get_value (&iter);
-
- retval[i] = _dbus_strdup (service->name);
- if (retval[i] == NULL)
- goto error;
-
- i++;
- }
-
- retval[i] = NULL;
-
- if (array_len)
- *array_len = len;
-
- *listp = retval;
- return TRUE;
-
- error:
- for (j = 0; j < i; j++)
- dbus_free (retval[i]);
- dbus_free (retval);
-
- return FALSE;
-}
-
-dbus_bool_t
-bus_registry_acquire_service (BusRegistry *registry,
- DBusConnection *connection,
- const DBusString *service_name,
- dbus_uint32_t flags,
- dbus_uint32_t *result,
- BusTransaction *transaction,
- DBusError *error)
-{
- dbus_bool_t retval;
- DBusConnection *old_owner_conn;
- BusClientPolicy *policy;
- BusService *service;
- BusActivation *activation;
- BusSELinuxID *sid;
- BusOwner *primary_owner;
-
- retval = FALSE;
-
- if (!_dbus_validate_bus_name (service_name, 0,
- _dbus_string_get_length (service_name)))
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Requested bus name \"%s\" is not valid",
- _dbus_string_get_const_data (service_name));
-
- _dbus_verbose ("Attempt to acquire invalid service name\n");
-
- goto out;
- }
-
- if (_dbus_string_get_byte (service_name, 0) == ':')
- {
- /* Not allowed; only base services can start with ':' */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Cannot acquire a service starting with ':' such as \"%s\"",
- _dbus_string_get_const_data (service_name));
-
- _dbus_verbose ("Attempt to acquire invalid base service name \"%s\"",
- _dbus_string_get_const_data (service_name));
-
- goto out;
- }
-
- if (_dbus_string_equal_c_str (service_name, DBUS_SERVICE_DBUS))
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Connection \"%s\" is not allowed to own the service \"%s\"because "
- "it is reserved for D-Bus' use only",
- bus_connection_is_active (connection) ?
- bus_connection_get_name (connection) :
- "(inactive)",
- DBUS_SERVICE_DBUS);
- goto out;
- }
-
- policy = bus_connection_get_policy (connection);
- _dbus_assert (policy != NULL);
-
- /* Note that if sid is #NULL then the bus's own context gets used
- * in bus_connection_selinux_allows_acquire_service()
- */
- sid = bus_selinux_id_table_lookup (registry->service_sid_table,
- service_name);
-
- if (!bus_selinux_allows_acquire_service (connection, sid,
- _dbus_string_get_const_data (service_name), error))
- {
-
- if (dbus_error_is_set (error) &&
- dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY))
- {
- goto out;
- }
-
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "Connection \"%s\" is not allowed to own the service \"%s\" due "
- "to SELinux policy",
- bus_connection_is_active (connection) ?
- bus_connection_get_name (connection) :
- "(inactive)",
- _dbus_string_get_const_data (service_name));
- goto out;
- }
-
- if (!bus_client_policy_check_can_own (policy, service_name))
- {
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "Connection \"%s\" is not allowed to own the service \"%s\" due "
- "to security policies in the configuration file",
- bus_connection_is_active (connection) ?
- bus_connection_get_name (connection) :
- "(inactive)",
- _dbus_string_get_const_data (service_name));
- goto out;
- }
-
- if (bus_connection_get_n_services_owned (connection) >=
- bus_context_get_max_services_per_connection (registry->context))
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "Connection \"%s\" is not allowed to own more services "
- "(increase limits in configuration file if required)",
- bus_connection_is_active (connection) ?
- bus_connection_get_name (connection) :
- "(inactive)");
- goto out;
- }
-
- service = bus_registry_lookup (registry, service_name);
-
- if (service != NULL)
- {
- primary_owner = bus_service_get_primary_owner (service);
- if (primary_owner != NULL)
- old_owner_conn = primary_owner->conn;
- else
- old_owner_conn = NULL;
- }
- else
- old_owner_conn = NULL;
-
- if (service == NULL)
- {
- service = bus_registry_ensure (registry,
- service_name, connection, flags,
- transaction, error);
- if (service == NULL)
- goto out;
- }
-
- primary_owner = bus_service_get_primary_owner (service);
- if (primary_owner == NULL)
- goto out;
-
- if (old_owner_conn == NULL)
- {
- _dbus_assert (primary_owner->conn == connection);
-
- *result = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER;
- }
- else if (old_owner_conn == connection)
- {
- bus_owner_set_flags (primary_owner, flags);
- *result = DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER;
- }
- else if (((flags & DBUS_NAME_FLAG_DO_NOT_QUEUE) &&
- !(bus_service_get_allow_replacement (service))) ||
- ((flags & DBUS_NAME_FLAG_DO_NOT_QUEUE) &&
- !(flags & DBUS_NAME_FLAG_REPLACE_EXISTING)))
- {
- DBusList *link;
- BusOwner *temp_owner;
- /* Since we can't be queued if we are already in the queue
- remove us */
-
- link = _bus_service_find_owner_link (service, connection);
- if (link != NULL)
- {
- _dbus_list_unlink (&service->owners, link);
- temp_owner = (BusOwner *)link->data;
- bus_owner_unref (temp_owner);
- _dbus_list_free_link (link);
- }
-
- *result = DBUS_REQUEST_NAME_REPLY_EXISTS;
- }
- else if (!(flags & DBUS_NAME_FLAG_DO_NOT_QUEUE) &&
- (!(flags & DBUS_NAME_FLAG_REPLACE_EXISTING) ||
- !(bus_service_get_allow_replacement (service))))
- {
- /* Queue the connection */
- if (!bus_service_add_owner (service, connection,
- flags,
- transaction, error))
- goto out;
-
- *result = DBUS_REQUEST_NAME_REPLY_IN_QUEUE;
- }
- else
- {
- /* Replace the current owner */
-
- /* We enqueue the new owner and remove the first one because
- * that will cause NameAcquired and NameLost messages to
- * be sent.
- */
-
- if (!bus_service_add_owner (service, connection,
- flags,
- transaction, error))
- goto out;
-
- if (primary_owner->do_not_queue)
- {
- if (!bus_service_remove_owner (service, old_owner_conn,
- transaction, error))
- goto out;
- }
- else
- {
- if (!bus_service_swap_owner (service, old_owner_conn,
- transaction, error))
- goto out;
- }
-
-
- _dbus_assert (connection == bus_service_get_primary_owner (service)->conn);
- *result = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER;
- }
-
- activation = bus_context_get_activation (registry->context);
- retval = bus_activation_send_pending_auto_activation_messages (activation,
- service,
- transaction,
- error);
-
- out:
- return retval;
-}
-
-dbus_bool_t
-bus_registry_release_service (BusRegistry *registry,
- DBusConnection *connection,
- const DBusString *service_name,
- dbus_uint32_t *result,
- BusTransaction *transaction,
- DBusError *error)
-{
- dbus_bool_t retval;
- BusService *service;
-
- retval = FALSE;
-
- if (!_dbus_validate_bus_name (service_name, 0,
- _dbus_string_get_length (service_name)))
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Given bus name \"%s\" is not valid",
- _dbus_string_get_const_data (service_name));
-
- _dbus_verbose ("Attempt to release invalid service name\n");
-
- goto out;
- }
-
- if (_dbus_string_get_byte (service_name, 0) == ':')
- {
- /* Not allowed; the base service name cannot be created or released */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Cannot release a service starting with ':' such as \"%s\"",
- _dbus_string_get_const_data (service_name));
-
- _dbus_verbose ("Attempt to release invalid base service name \"%s\"",
- _dbus_string_get_const_data (service_name));
-
- goto out;
- }
-
- if (_dbus_string_equal_c_str (service_name, DBUS_SERVICE_DBUS))
- {
- /* Not allowed; the base service name cannot be created or released */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Cannot release the %s service because it is owned by the bus",
- DBUS_SERVICE_DBUS);
-
- _dbus_verbose ("Attempt to release service name \"%s\"",
- DBUS_SERVICE_DBUS);
-
- goto out;
- }
-
- service = bus_registry_lookup (registry, service_name);
-
- if (service == NULL)
- {
- *result = DBUS_RELEASE_NAME_REPLY_NON_EXISTENT;
- }
- else if (!bus_service_has_owner (service, connection))
- {
- *result = DBUS_RELEASE_NAME_REPLY_NOT_OWNER;
- }
- else
- {
- if (!bus_service_remove_owner (service, connection,
- transaction, error))
- goto out;
-
- _dbus_assert (!bus_service_has_owner (service, connection));
- *result = DBUS_RELEASE_NAME_REPLY_RELEASED;
- }
-
- retval = TRUE;
-
- out:
- return retval;
-}
-
-dbus_bool_t
-bus_registry_set_service_context_table (BusRegistry *registry,
- DBusHashTable *table)
-{
- DBusHashTable *new_table;
- DBusHashIter iter;
-
- new_table = bus_selinux_id_table_new ();
- if (!new_table)
- return FALSE;
-
- _dbus_hash_iter_init (table, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- const char *service = _dbus_hash_iter_get_string_key (&iter);
- const char *context = _dbus_hash_iter_get_value (&iter);
-
- if (!bus_selinux_id_table_insert (new_table,
- service,
- context))
- return FALSE;
- }
-
- if (registry->service_sid_table)
- _dbus_hash_table_unref (registry->service_sid_table);
- registry->service_sid_table = new_table;
- return TRUE;
-}
-
-static void
-bus_service_unlink_owner (BusService *service,
- BusOwner *owner)
-{
- _dbus_list_remove_last (&service->owners, owner);
- bus_owner_unref (owner);
-}
-
-static void
-bus_service_unlink (BusService *service)
-{
- _dbus_assert (service->owners == NULL);
-
- /* the service may not be in the hash, if
- * the failure causing transaction cancel
- * was in the right place, but that's OK
- */
- _dbus_hash_table_remove_string (service->registry->service_hash,
- service->name);
-
- bus_service_unref (service);
-}
-
-static void
-bus_service_relink (BusService *service,
- DBusPreallocatedHash *preallocated)
-{
- _dbus_assert (service->owners == NULL);
- _dbus_assert (preallocated != NULL);
-
- _dbus_hash_table_insert_string_preallocated (service->registry->service_hash,
- preallocated,
- service->name,
- service);
-
- bus_service_ref (service);
-}
-
-/**
- * Data used to represent an ownership cancellation in
- * a bus transaction.
- */
-typedef struct
-{
- BusOwner *owner; /**< the owner */
- BusService *service; /**< service to cancel ownership of */
-} OwnershipCancelData;
-
-static void
-cancel_ownership (void *data)
-{
- OwnershipCancelData *d = data;
-
- /* We don't need to send messages notifying of these
- * changes, since we're reverting something that was
- * cancelled (effectively never really happened)
- */
- bus_service_unlink_owner (d->service, d->owner);
-
- if (d->service->owners == NULL)
- bus_service_unlink (d->service);
-}
-
-static void
-free_ownership_cancel_data (void *data)
-{
- OwnershipCancelData *d = data;
-
- dbus_connection_unref (d->owner->conn);
- bus_owner_unref (d->owner);
- bus_service_unref (d->service);
-
- dbus_free (d);
-}
-
-static dbus_bool_t
-add_cancel_ownership_to_transaction (BusTransaction *transaction,
- BusService *service,
- BusOwner *owner)
-{
- OwnershipCancelData *d;
-
- d = dbus_new (OwnershipCancelData, 1);
- if (d == NULL)
- return FALSE;
-
- d->service = service;
- d->owner = owner;
-
- if (!bus_transaction_add_cancel_hook (transaction, cancel_ownership, d,
- free_ownership_cancel_data))
- {
- dbus_free (d);
- return FALSE;
- }
-
- bus_service_ref (d->service);
- bus_owner_ref (owner);
- dbus_connection_ref (d->owner->conn);
-
- return TRUE;
-}
-
-/* this function is self-cancelling if you cancel the transaction */
-dbus_bool_t
-bus_service_add_owner (BusService *service,
- DBusConnection *connection,
- dbus_uint32_t flags,
- BusTransaction *transaction,
- DBusError *error)
-{
- BusOwner *bus_owner;
- DBusList *bus_owner_link;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* Send service acquired message first, OOM will result
- * in cancelling the transaction
- */
- if (service->owners == NULL)
- {
- if (!bus_driver_send_service_acquired (connection, service->name, transaction, error))
- return FALSE;
- }
-
- bus_owner_link = _bus_service_find_owner_link (service, connection);
-
- if (bus_owner_link == NULL)
- {
- bus_owner = bus_owner_new (service, connection, flags);
- if (bus_owner == NULL)
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- bus_owner_set_flags (bus_owner, flags);
- if (!(flags & DBUS_NAME_FLAG_REPLACE_EXISTING) || service->owners == NULL)
- {
- if (!_dbus_list_append (&service->owners,
- bus_owner))
- {
- bus_owner_unref (bus_owner);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
- else
- {
- if (!_dbus_list_insert_after (&service->owners,
- _dbus_list_get_first_link (&service->owners),
- bus_owner))
- {
- bus_owner_unref (bus_owner);
- BUS_SET_OOM (error);
- return FALSE;
- }
- }
- }
- else
- {
- /* Update the link since we are already in the queue
- * No need for operations that can produce OOM
- */
-
- bus_owner = (BusOwner *) bus_owner_link->data;
- if (flags & DBUS_NAME_FLAG_REPLACE_EXISTING)
- {
- DBusList *link;
- _dbus_list_unlink (&service->owners, bus_owner_link);
- link = _dbus_list_get_first_link (&service->owners);
- _dbus_assert (link != NULL);
-
- _dbus_list_insert_after_link (&service->owners, link, bus_owner_link);
- }
-
- bus_owner_set_flags (bus_owner, flags);
- return TRUE;
- }
-
- if (!add_cancel_ownership_to_transaction (transaction,
- service,
- bus_owner))
- {
- bus_service_unlink_owner (service, bus_owner);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-typedef struct
-{
- BusOwner *owner;
- BusService *service;
- BusOwner *before_owner; /* restore to position before this connection in owners list */
- DBusList *owner_link;
- DBusList *service_link;
- DBusPreallocatedHash *hash_entry;
-} OwnershipRestoreData;
-
-static void
-restore_ownership (void *data)
-{
- OwnershipRestoreData *d = data;
- DBusList *link;
-
- _dbus_assert (d->service_link != NULL);
- _dbus_assert (d->owner_link != NULL);
-
- if (d->service->owners == NULL)
- {
- _dbus_assert (d->hash_entry != NULL);
- bus_service_relink (d->service, d->hash_entry);
- }
- else
- {
- _dbus_assert (d->hash_entry == NULL);
- }
-
- /* We don't need to send messages notifying of these
- * changes, since we're reverting something that was
- * cancelled (effectively never really happened)
- */
- link = _dbus_list_get_first_link (&d->service->owners);
- while (link != NULL)
- {
- if (link->data == d->before_owner)
- break;
-
- link = _dbus_list_get_next_link (&d->service->owners, link);
- }
-
- _dbus_list_insert_before_link (&d->service->owners, link, d->owner_link);
-
- /* Note that removing then restoring this changes the order in which
- * ServiceDeleted messages are sent on destruction of the
- * connection. This should be OK as the only guarantee there is
- * that the base service is destroyed last, and we never even
- * tentatively remove the base service.
- */
- bus_connection_add_owned_service_link (d->owner->conn, d->service_link);
-
- d->hash_entry = NULL;
- d->service_link = NULL;
- d->owner_link = NULL;
-}
-
-static void
-free_ownership_restore_data (void *data)
-{
- OwnershipRestoreData *d = data;
-
- if (d->service_link)
- _dbus_list_free_link (d->service_link);
- if (d->owner_link)
- _dbus_list_free_link (d->owner_link);
- if (d->hash_entry)
- _dbus_hash_table_free_preallocated_entry (d->service->registry->service_hash,
- d->hash_entry);
-
- dbus_connection_unref (d->owner->conn);
- bus_owner_unref (d->owner);
- bus_service_unref (d->service);
-
- dbus_free (d);
-}
-
-static dbus_bool_t
-add_restore_ownership_to_transaction (BusTransaction *transaction,
- BusService *service,
- BusOwner *owner)
-{
- OwnershipRestoreData *d;
- DBusList *link;
-
- d = dbus_new (OwnershipRestoreData, 1);
- if (d == NULL)
- return FALSE;
-
- d->service = service;
- d->owner = owner;
- d->service_link = _dbus_list_alloc_link (service);
- d->owner_link = _dbus_list_alloc_link (owner);
- d->hash_entry = _dbus_hash_table_preallocate_entry (service->registry->service_hash);
-
- bus_service_ref (d->service);
- bus_owner_ref (d->owner);
- dbus_connection_ref (d->owner->conn);
-
- d->before_owner = NULL;
- link = _dbus_list_get_first_link (&service->owners);
- while (link != NULL)
- {
- if (link->data == owner)
- {
- link = _dbus_list_get_next_link (&service->owners, link);
-
- if (link)
- d->before_owner = link->data;
-
- break;
- }
-
- link = _dbus_list_get_next_link (&service->owners, link);
- }
-
- if (d->service_link == NULL ||
- d->owner_link == NULL ||
- d->hash_entry == NULL ||
- !bus_transaction_add_cancel_hook (transaction, restore_ownership, d,
- free_ownership_restore_data))
- {
- free_ownership_restore_data (d);
- return FALSE;
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_service_swap_owner (BusService *service,
- DBusConnection *connection,
- BusTransaction *transaction,
- DBusError *error)
-{
- DBusList *swap_link;
- BusOwner *primary_owner;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* We send out notifications before we do any work we
- * might have to undo if the notification-sending failed
- */
-
- /* Send service lost message */
- primary_owner = bus_service_get_primary_owner (service);
- if (primary_owner == NULL || primary_owner->conn != connection)
- _dbus_assert_not_reached ("Tried to swap a non primary owner");
-
-
- if (!bus_driver_send_service_lost (connection, service->name,
- transaction, error))
- return FALSE;
-
- if (service->owners == NULL)
- {
- _dbus_assert_not_reached ("Tried to swap owner of a service that has no owners");
- }
- else if (_dbus_list_length_is_one (&service->owners))
- {
- _dbus_assert_not_reached ("Tried to swap owner of a service that has no other owners in the queue");
- }
- else
- {
- DBusList *link;
- BusOwner *new_owner;
- DBusConnection *new_owner_conn;
- link = _dbus_list_get_first_link (&service->owners);
- _dbus_assert (link != NULL);
- link = _dbus_list_get_next_link (&service->owners, link);
- _dbus_assert (link != NULL);
-
- new_owner = (BusOwner *)link->data;
- new_owner_conn = new_owner->conn;
-
- if (!bus_driver_send_service_owner_changed (service->name,
- bus_connection_get_name (connection),
- bus_connection_get_name (new_owner_conn),
- transaction, error))
- return FALSE;
-
- /* This will be our new owner */
- if (!bus_driver_send_service_acquired (new_owner_conn,
- service->name,
- transaction,
- error))
- return FALSE;
- }
-
- if (!add_restore_ownership_to_transaction (transaction, service, primary_owner))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- /* unlink the primary and make it the second link */
- swap_link = _dbus_list_get_first_link (&service->owners);
- _dbus_list_unlink (&service->owners, swap_link);
-
- _dbus_list_insert_after_link (&service->owners,
- _dbus_list_get_first_link (&service->owners),
- swap_link);
-
- return TRUE;
-}
-
-/* this function is self-cancelling if you cancel the transaction */
-dbus_bool_t
-bus_service_remove_owner (BusService *service,
- DBusConnection *connection,
- BusTransaction *transaction,
- DBusError *error)
-{
- BusOwner *primary_owner;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* We send out notifications before we do any work we
- * might have to undo if the notification-sending failed
- */
-
- /* Send service lost message */
- primary_owner = bus_service_get_primary_owner (service);
- if (primary_owner != NULL && primary_owner->conn == connection)
- {
- if (!bus_driver_send_service_lost (connection, service->name,
- transaction, error))
- return FALSE;
- }
- else
- {
- /* if we are not the primary owner then just remove us from the queue */
- DBusList *link;
- BusOwner *temp_owner;
-
- link = _bus_service_find_owner_link (service, connection);
- _dbus_list_unlink (&service->owners, link);
- temp_owner = (BusOwner *)link->data;
- bus_owner_unref (temp_owner);
- _dbus_list_free_link (link);
-
- return TRUE;
- }
-
- if (service->owners == NULL)
- {
- _dbus_assert_not_reached ("Tried to remove owner of a service that has no owners");
- }
- else if (_dbus_list_length_is_one (&service->owners))
- {
- if (!bus_driver_send_service_owner_changed (service->name,
- bus_connection_get_name (connection),
- NULL,
- transaction, error))
- return FALSE;
- }
- else
- {
- DBusList *link;
- BusOwner *new_owner;
- DBusConnection *new_owner_conn;
- link = _dbus_list_get_first_link (&service->owners);
- _dbus_assert (link != NULL);
- link = _dbus_list_get_next_link (&service->owners, link);
- _dbus_assert (link != NULL);
-
- new_owner = (BusOwner *)link->data;
- new_owner_conn = new_owner->conn;
-
- if (!bus_driver_send_service_owner_changed (service->name,
- bus_connection_get_name (connection),
- bus_connection_get_name (new_owner_conn),
- transaction, error))
- return FALSE;
-
- /* This will be our new owner */
- if (!bus_driver_send_service_acquired (new_owner_conn,
- service->name,
- transaction,
- error))
- return FALSE;
- }
-
- if (!add_restore_ownership_to_transaction (transaction, service, primary_owner))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- bus_service_unlink_owner (service, primary_owner);
-
- if (service->owners == NULL)
- bus_service_unlink (service);
-
- return TRUE;
-}
-
-BusService *
-bus_service_ref (BusService *service)
-{
- _dbus_assert (service->refcount > 0);
-
- service->refcount += 1;
-
- return service;
-}
-
-void
-bus_service_unref (BusService *service)
-{
- _dbus_assert (service->refcount > 0);
-
- service->refcount -= 1;
-
- if (service->refcount == 0)
- {
- _dbus_assert (service->owners == NULL);
-
- dbus_free (service->name);
- _dbus_mem_pool_dealloc (service->registry->service_pool, service);
- }
-}
-
-DBusConnection *
-bus_service_get_primary_owners_connection (BusService *service)
-{
- BusOwner *owner;
-
- owner = bus_service_get_primary_owner (service);
-
- if (owner != NULL)
- return owner->conn;
- else
- return NULL;
-}
-
-BusOwner*
-bus_service_get_primary_owner (BusService *service)
-{
- return _dbus_list_get_first (&service->owners);
-}
-
-const char*
-bus_service_get_name (BusService *service)
-{
- return service->name;
-}
-
-dbus_bool_t
-bus_service_get_allow_replacement (BusService *service)
-{
- BusOwner *owner;
- DBusList *link;
-
- _dbus_assert (service->owners != NULL);
-
- link = _dbus_list_get_first_link (&service->owners);
- owner = (BusOwner *) link->data;
-
- return owner->allow_replacement;
-}
-
-dbus_bool_t
-bus_service_has_owner (BusService *service,
- DBusConnection *connection)
-{
- DBusList *link;
-
- link = _bus_service_find_owner_link (service, connection);
-
- if (link == NULL)
- return FALSE;
- else
- return TRUE;
-}
-
-dbus_bool_t
-bus_service_list_queued_owners (BusService *service,
- DBusList **return_list,
- DBusError *error)
-{
- DBusList *link;
-
- _dbus_assert (*return_list == NULL);
-
- link = _dbus_list_get_first_link (&service->owners);
- _dbus_assert (link != NULL);
-
- while (link != NULL)
- {
- BusOwner *owner;
- const char *uname;
-
- owner = (BusOwner *) link->data;
- uname = bus_connection_get_name (owner->conn);
-
- if (!_dbus_list_append (return_list, (char *)uname))
- goto oom;
-
- link = _dbus_list_get_next_link (&service->owners, link);
- }
-
- return TRUE;
-
- oom:
- _dbus_list_clear (return_list);
- BUS_SET_OOM (error);
- return FALSE;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/services.h b/src/3rd_party/dbus-1.7.8/bus/services.h
deleted file mode 100644
index 056dd9faa4..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/services.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* services.h Service management
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_SERVICES_H
-#define BUS_SERVICES_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-hash.h>
-#include "connection.h"
-#include "bus.h"
-
-typedef void (* BusServiceForeachFunction) (BusService *service,
- void *data);
-
-BusRegistry* bus_registry_new (BusContext *context);
-BusRegistry* bus_registry_ref (BusRegistry *registry);
-void bus_registry_unref (BusRegistry *registry);
-BusService* bus_registry_lookup (BusRegistry *registry,
- const DBusString *service_name);
-BusService* bus_registry_ensure (BusRegistry *registry,
- const DBusString *service_name,
- DBusConnection *owner_connection_if_created,
- dbus_uint32_t flags,
- BusTransaction *transaction,
- DBusError *error);
-void bus_registry_foreach (BusRegistry *registry,
- BusServiceForeachFunction function,
- void *data);
-dbus_bool_t bus_registry_list_services (BusRegistry *registry,
- char ***listp,
- int *array_len);
-dbus_bool_t bus_registry_acquire_service (BusRegistry *registry,
- DBusConnection *connection,
- const DBusString *service_name,
- dbus_uint32_t flags,
- dbus_uint32_t *result,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_registry_release_service (BusRegistry *registry,
- DBusConnection *connection,
- const DBusString *service_name,
- dbus_uint32_t *result,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_registry_set_service_context_table (BusRegistry *registry,
- DBusHashTable *table);
-
-BusService* bus_service_ref (BusService *service);
-void bus_service_unref (BusService *service);
-dbus_bool_t bus_service_add_owner (BusService *service,
- DBusConnection *connection,
- dbus_uint32_t flags,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_service_swap_owner (BusService *service,
- DBusConnection *connection,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_service_remove_owner (BusService *service,
- DBusConnection *connection,
- BusTransaction *transaction,
- DBusError *error);
-dbus_bool_t bus_service_has_owner (BusService *service,
- DBusConnection *connection);
-BusOwner* bus_service_get_primary_owner (BusService *service);
-dbus_bool_t bus_service_get_allow_replacement (BusService *service);
-const char* bus_service_get_name (BusService *service);
-dbus_bool_t bus_service_list_queued_owners (BusService *service,
- DBusList **return_list,
- DBusError *error);
-
-DBusConnection* bus_service_get_primary_owners_connection (BusService *service);
-#endif /* BUS_SERVICES_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/session.conf.in b/src/3rd_party/dbus-1.7.8/bus/session.conf.in
deleted file mode 100644
index 74d9d1fd5b..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/session.conf.in
+++ /dev/null
@@ -1,63 +0,0 @@
-<!-- This configuration file controls the per-user-login-session message bus.
- Add a session-local.conf and edit that rather than changing this
- file directly. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
-
- <!-- If we fork, keep the user's original umask to avoid affecting
- the behavior of child processes. -->
- <keep_umask/>
-
- <listen>@DBUS_SESSION_BUS_LISTEN_ADDRESS@</listen>
-
- <standard_session_servicedirs />
-
- <policy context="default">
- <!-- Allow everything to be sent -->
- <allow send_destination="*" eavesdrop="true"/>
- <!-- Allow everything to be received -->
- <allow eavesdrop="true"/>
- <!-- Allow anyone to own anything -->
- <allow own="*"/>
- </policy>
-
- <!-- Config files are placed here that among other things,
- further restrict the above policy for specific services. -->
- <includedir>session.d</includedir>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
- <include ignore_missing="yes">session-local.conf</include>
-
- <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
- <!-- For the session bus, override the default relatively-low limits
- with essentially infinite limits, since the bus is just running
- as the user anyway, using up bus resources is not something we need
- to worry about. In some cases, we do set the limits lower than
- "all available memory" if exceeding the limit is almost certainly a bug,
- having the bus enforce a limit is nicer than a huge memory leak. But the
- intent is that these limits should never be hit. -->
-
- <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
- <limit name="max_incoming_bytes">1000000000</limit>
- <limit name="max_incoming_unix_fds">250000000</limit>
- <limit name="max_outgoing_bytes">1000000000</limit>
- <limit name="max_outgoing_unix_fds">250000000</limit>
- <limit name="max_message_size">1000000000</limit>
- <limit name="max_message_unix_fds">@DEFAULT_MESSAGE_UNIX_FDS@</limit>
- <limit name="service_start_timeout">120000</limit>
- <limit name="auth_timeout">240000</limit>
- <limit name="max_completed_connections">100000</limit>
- <limit name="max_incomplete_connections">10000</limit>
- <limit name="max_connections_per_user">100000</limit>
- <limit name="max_pending_service_starts">10000</limit>
- <limit name="max_names_per_connection">50000</limit>
- <limit name="max_match_rules_per_connection">50000</limit>
- <limit name="max_replies_per_connection">50000</limit>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/bus/signals.c b/src/3rd_party/dbus-1.7.8/bus/signals.c
deleted file mode 100644
index 4c500c67fd..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/signals.c
+++ /dev/null
@@ -1,2841 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* signals.c Bus signal connection implementation
- *
- * Copyright (C) 2003, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "signals.h"
-#include "services.h"
-#include "utils.h"
-#include <dbus/dbus-marshal-validate.h>
-
-struct BusMatchRule
-{
- int refcount; /**< reference count */
-
- DBusConnection *matches_go_to; /**< Owner of the rule */
-
- unsigned int flags; /**< BusMatchFlags */
-
- int message_type;
- char *interface;
- char *member;
- char *sender;
- char *destination;
- char *path;
-
- unsigned int *arg_lens;
- char **args;
- int args_len;
-};
-
-#define BUS_MATCH_ARG_NAMESPACE 0x4000000u
-#define BUS_MATCH_ARG_IS_PATH 0x8000000u
-
-#define BUS_MATCH_ARG_FLAGS (BUS_MATCH_ARG_NAMESPACE | BUS_MATCH_ARG_IS_PATH)
-
-BusMatchRule*
-bus_match_rule_new (DBusConnection *matches_go_to)
-{
- BusMatchRule *rule;
-
- rule = dbus_new0 (BusMatchRule, 1);
- if (rule == NULL)
- return NULL;
-
- rule->refcount = 1;
- rule->matches_go_to = matches_go_to;
-
-#ifndef DBUS_ENABLE_EMBEDDED_TESTS
- _dbus_assert (rule->matches_go_to != NULL);
-#endif
-
- return rule;
-}
-
-BusMatchRule *
-bus_match_rule_ref (BusMatchRule *rule)
-{
- _dbus_assert (rule->refcount > 0);
-
- rule->refcount += 1;
-
- return rule;
-}
-
-void
-bus_match_rule_unref (BusMatchRule *rule)
-{
- _dbus_assert (rule->refcount > 0);
-
- rule->refcount -= 1;
- if (rule->refcount == 0)
- {
- dbus_free (rule->interface);
- dbus_free (rule->member);
- dbus_free (rule->sender);
- dbus_free (rule->destination);
- dbus_free (rule->path);
- dbus_free (rule->arg_lens);
-
- /* can't use dbus_free_string_array() since there
- * are embedded NULL
- */
- if (rule->args)
- {
- int i;
-
- i = 0;
- while (i < rule->args_len)
- {
- if (rule->args[i])
- dbus_free (rule->args[i]);
- ++i;
- }
-
- dbus_free (rule->args);
- }
-
- dbus_free (rule);
- }
-}
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-/* Note this function does not do escaping, so it's only
- * good for debug spew at the moment
- */
-static char*
-match_rule_to_string (BusMatchRule *rule)
-{
- DBusString str;
- char *ret;
-
- if (!_dbus_string_init (&str))
- {
- char *s;
- while ((s = _dbus_strdup ("nomem")) == NULL)
- ; /* only OK for debug spew... */
- return s;
- }
-
- if (rule->flags & BUS_MATCH_MESSAGE_TYPE)
- {
- if (!_dbus_string_append_printf (&str, "type='%s'",
- dbus_message_type_to_string (rule->message_type)))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_INTERFACE)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "interface='%s'", rule->interface))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_MEMBER)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "member='%s'", rule->member))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_PATH)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "path='%s'", rule->path))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_PATH_NAMESPACE)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "path_namespace='%s'", rule->path))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_SENDER)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "sender='%s'", rule->sender))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_DESTINATION)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "destination='%s'", rule->destination))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_CLIENT_IS_EAVESDROPPING)
- {
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- if (!_dbus_string_append_printf (&str, "eavesdrop='%s'",
- (rule->flags & BUS_MATCH_CLIENT_IS_EAVESDROPPING) ?
- "true" : "false"))
- goto nomem;
- }
-
- if (rule->flags & BUS_MATCH_ARGS)
- {
- int i;
-
- _dbus_assert (rule->args != NULL);
-
- i = 0;
- while (i < rule->args_len)
- {
- if (rule->args[i] != NULL)
- {
- dbus_bool_t is_path, is_namespace;
-
- if (_dbus_string_get_length (&str) > 0)
- {
- if (!_dbus_string_append (&str, ","))
- goto nomem;
- }
-
- is_path = (rule->arg_lens[i] & BUS_MATCH_ARG_IS_PATH) != 0;
- is_namespace = (rule->arg_lens[i] & BUS_MATCH_ARG_NAMESPACE) != 0;
-
- if (!_dbus_string_append_printf (&str,
- "arg%d%s='%s'",
- i,
- is_path ? "path" :
- is_namespace ? "namespace" : "",
- rule->args[i]))
- goto nomem;
- }
-
- ++i;
- }
- }
-
- if (!_dbus_string_steal_data (&str, &ret))
- goto nomem;
-
- _dbus_string_free (&str);
- return ret;
-
- nomem:
- _dbus_string_free (&str);
- {
- char *s;
- while ((s = _dbus_strdup ("nomem")) == NULL)
- ; /* only OK for debug spew... */
- return s;
- }
-}
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
-dbus_bool_t
-bus_match_rule_set_message_type (BusMatchRule *rule,
- int type)
-{
- rule->flags |= BUS_MATCH_MESSAGE_TYPE;
-
- rule->message_type = type;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_match_rule_set_interface (BusMatchRule *rule,
- const char *interface)
-{
- char *new;
-
- _dbus_assert (interface != NULL);
-
- new = _dbus_strdup (interface);
- if (new == NULL)
- return FALSE;
-
- rule->flags |= BUS_MATCH_INTERFACE;
- dbus_free (rule->interface);
- rule->interface = new;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_match_rule_set_member (BusMatchRule *rule,
- const char *member)
-{
- char *new;
-
- _dbus_assert (member != NULL);
-
- new = _dbus_strdup (member);
- if (new == NULL)
- return FALSE;
-
- rule->flags |= BUS_MATCH_MEMBER;
- dbus_free (rule->member);
- rule->member = new;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_match_rule_set_sender (BusMatchRule *rule,
- const char *sender)
-{
- char *new;
-
- _dbus_assert (sender != NULL);
-
- new = _dbus_strdup (sender);
- if (new == NULL)
- return FALSE;
-
- rule->flags |= BUS_MATCH_SENDER;
- dbus_free (rule->sender);
- rule->sender = new;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_match_rule_set_destination (BusMatchRule *rule,
- const char *destination)
-{
- char *new;
-
- _dbus_assert (destination != NULL);
-
- new = _dbus_strdup (destination);
- if (new == NULL)
- return FALSE;
-
- rule->flags |= BUS_MATCH_DESTINATION;
- dbus_free (rule->destination);
- rule->destination = new;
-
- return TRUE;
-}
-
-void
-bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule,
- dbus_bool_t is_eavesdropping)
-{
- if (is_eavesdropping)
- rule->flags |= BUS_MATCH_CLIENT_IS_EAVESDROPPING;
- else
- rule->flags &= ~(BUS_MATCH_CLIENT_IS_EAVESDROPPING);
-}
-
-dbus_bool_t
-bus_match_rule_set_path (BusMatchRule *rule,
- const char *path,
- dbus_bool_t is_namespace)
-{
- char *new;
-
- _dbus_assert (path != NULL);
-
- new = _dbus_strdup (path);
- if (new == NULL)
- return FALSE;
-
- rule->flags &= ~(BUS_MATCH_PATH|BUS_MATCH_PATH_NAMESPACE);
-
- if (is_namespace)
- rule->flags |= BUS_MATCH_PATH_NAMESPACE;
- else
- rule->flags |= BUS_MATCH_PATH;
-
- dbus_free (rule->path);
- rule->path = new;
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_match_rule_set_arg (BusMatchRule *rule,
- int arg,
- const DBusString *value,
- dbus_bool_t is_path,
- dbus_bool_t is_namespace)
-{
- int length;
- char *new;
-
- _dbus_assert (value != NULL);
-
- /* args_len is the number of args not including null termination
- * in the char**
- */
- if (arg >= rule->args_len)
- {
- unsigned int *new_arg_lens;
- char **new_args;
- int new_args_len;
- int i;
-
- new_args_len = arg + 1;
-
- /* add another + 1 here for null termination */
- new_args = dbus_realloc (rule->args,
- sizeof (char *) * (new_args_len + 1));
- if (new_args == NULL)
- return FALSE;
-
- /* NULL the new slots */
- i = rule->args_len;
- while (i <= new_args_len) /* <= for null termination */
- {
- new_args[i] = NULL;
- ++i;
- }
-
- rule->args = new_args;
-
- /* and now add to the lengths */
- new_arg_lens = dbus_realloc (rule->arg_lens,
- sizeof (int) * (new_args_len + 1));
-
- if (new_arg_lens == NULL)
- return FALSE;
-
- /* zero the new slots */
- i = rule->args_len;
- while (i <= new_args_len) /* <= for null termination */
- {
- new_arg_lens[i] = 0;
- ++i;
- }
-
- rule->arg_lens = new_arg_lens;
- rule->args_len = new_args_len;
- }
-
- length = _dbus_string_get_length (value);
- if (!_dbus_string_copy_data (value, &new))
- return FALSE;
-
- rule->flags |= BUS_MATCH_ARGS;
-
- dbus_free (rule->args[arg]);
- rule->arg_lens[arg] = length;
- rule->args[arg] = new;
-
- if (is_path)
- rule->arg_lens[arg] |= BUS_MATCH_ARG_IS_PATH;
-
- if (is_namespace)
- rule->arg_lens[arg] |= BUS_MATCH_ARG_NAMESPACE;
-
- /* NULL termination didn't get busted */
- _dbus_assert (rule->args[rule->args_len] == NULL);
- _dbus_assert (rule->arg_lens[rule->args_len] == 0);
-
- return TRUE;
-}
-
-#define ISWHITE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
-
-static dbus_bool_t
-find_key (const DBusString *str,
- int start,
- DBusString *key,
- int *value_pos,
- DBusError *error)
-{
- const char *p;
- const char *s;
- const char *key_start;
- const char *key_end;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- s = _dbus_string_get_const_data (str);
-
- p = s + start;
-
- while (*p && ISWHITE (*p))
- ++p;
-
- key_start = p;
-
- while (*p && *p != '=' && !ISWHITE (*p))
- ++p;
-
- key_end = p;
-
- while (*p && ISWHITE (*p))
- ++p;
-
- if (key_start == key_end)
- {
- /* Empty match rules or trailing whitespace are OK */
- *value_pos = p - s;
- return TRUE;
- }
-
- if (*p != '=')
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Match rule has a key with no subsequent '=' character");
- return FALSE;
- }
- ++p;
-
- if (!_dbus_string_append_len (key, key_start, key_end - key_start))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- *value_pos = p - s;
-
- return TRUE;
-}
-
-static dbus_bool_t
-find_value (const DBusString *str,
- int start,
- const char *key,
- DBusString *value,
- int *value_end,
- DBusError *error)
-{
- const char *p;
- const char *s;
- char quote_char;
- int orig_len;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- orig_len = _dbus_string_get_length (value);
-
- s = _dbus_string_get_const_data (str);
-
- p = s + start;
-
- quote_char = '\0';
-
- while (*p)
- {
- if (quote_char == '\0')
- {
- switch (*p)
- {
- case '\0':
- goto done;
-
- case '\'':
- quote_char = '\'';
- goto next;
-
- case ',':
- ++p;
- goto done;
-
- case '\\':
- quote_char = '\\';
- goto next;
-
- default:
- if (!_dbus_string_append_byte (value, *p))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- }
- else if (quote_char == '\\')
- {
- /* \ only counts as an escape if escaping a quote mark */
- if (*p != '\'')
- {
- if (!_dbus_string_append_byte (value, '\\'))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
-
- if (!_dbus_string_append_byte (value, *p))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- quote_char = '\0';
- }
- else
- {
- _dbus_assert (quote_char == '\'');
-
- if (*p == '\'')
- {
- quote_char = '\0';
- }
- else
- {
- if (!_dbus_string_append_byte (value, *p))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- }
-
- next:
- ++p;
- }
-
- done:
-
- if (quote_char == '\\')
- {
- if (!_dbus_string_append_byte (value, '\\'))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (quote_char == '\'')
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Unbalanced quotation marks in match rule");
- goto failed;
- }
- else
- _dbus_assert (quote_char == '\0');
-
- /* Zero-length values are allowed */
-
- *value_end = p - s;
-
- return TRUE;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_set_length (value, orig_len);
- return FALSE;
-}
-
-/* duplicates aren't allowed so the real legitimate max is only 6 or
- * so. Leaving extra so we don't have to bother to update it.
- * FIXME this is sort of busted now with arg matching, but we let
- * you match on up to 10 args for now
- */
-#define MAX_RULE_TOKENS 16
-
-/* this is slightly too high level to be termed a "token"
- * but let's not be pedantic.
- */
-typedef struct
-{
- char *key;
- char *value;
-} RuleToken;
-
-static dbus_bool_t
-tokenize_rule (const DBusString *rule_text,
- RuleToken tokens[MAX_RULE_TOKENS],
- DBusError *error)
-{
- int i;
- int pos;
- DBusString key;
- DBusString value;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&key))
- {
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&value))
- {
- _dbus_string_free (&key);
- BUS_SET_OOM (error);
- return FALSE;
- }
-
- i = 0;
- pos = 0;
- while (i < MAX_RULE_TOKENS &&
- pos < _dbus_string_get_length (rule_text))
- {
- _dbus_assert (tokens[i].key == NULL);
- _dbus_assert (tokens[i].value == NULL);
-
- if (!find_key (rule_text, pos, &key, &pos, error))
- goto out;
-
- if (_dbus_string_get_length (&key) == 0)
- goto next;
-
- if (!_dbus_string_steal_data (&key, &tokens[i].key))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- if (!find_value (rule_text, pos, tokens[i].key, &value, &pos, error))
- goto out;
-
- if (!_dbus_string_steal_data (&value, &tokens[i].value))
- {
- BUS_SET_OOM (error);
- goto out;
- }
-
- next:
- ++i;
- }
-
- retval = TRUE;
-
- out:
- if (!retval)
- {
- i = 0;
- while (tokens[i].key || tokens[i].value)
- {
- dbus_free (tokens[i].key);
- dbus_free (tokens[i].value);
- tokens[i].key = NULL;
- tokens[i].value = NULL;
- ++i;
- }
- }
-
- _dbus_string_free (&key);
- _dbus_string_free (&value);
-
- return retval;
-}
-
-static dbus_bool_t
-bus_match_rule_parse_arg_match (BusMatchRule *rule,
- const char *key,
- const DBusString *value,
- DBusError *error)
-{
- dbus_bool_t is_path = FALSE;
- dbus_bool_t is_namespace = FALSE;
- DBusString key_str;
- unsigned long arg;
- int length;
- int end;
-
- /* For now, arg0='foo' always implies that 'foo' is a
- * DBUS_TYPE_STRING. Someday we could add an arg0type='int32' thing
- * if we wanted, which would specify another type, in which case
- * arg0='5' would have the 5 parsed as an int rather than string.
- */
-
- /* First we need to parse arg0 = 0, arg27 = 27 */
-
- _dbus_string_init_const (&key_str, key);
- length = _dbus_string_get_length (&key_str);
-
- if (_dbus_string_get_length (&key_str) < 4)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key '%s' in match rule starts with 'arg' but lacks an arg number. Should be 'arg0' or 'arg7' for example.\n", key);
- goto failed;
- }
-
- if (!_dbus_string_parse_uint (&key_str, 3, &arg, &end))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key '%s' in match rule starts with 'arg' but could not parse arg number. Should be 'arg0' or 'arg7' for example.\n", key);
- goto failed;
- }
-
- if (end != length)
- {
- if ((end + strlen ("path")) == length &&
- _dbus_string_ends_with_c_str (&key_str, "path"))
- {
- is_path = TRUE;
- }
- else if (_dbus_string_equal_c_str (&key_str, "arg0namespace"))
- {
- int value_len = _dbus_string_get_length (value);
-
- is_namespace = TRUE;
-
- if (!_dbus_validate_bus_namespace (value, 0, value_len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "arg0namespace='%s' is not a valid prefix of a bus name",
- _dbus_string_get_const_data (value));
- goto failed;
- }
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key '%s' in match rule contains junk after argument number (%u). Only 'arg%upath' (for example) or 'arg0namespace' are valid", key, arg, arg);
- goto failed;
- }
- }
-
- /* If we didn't check this we could allocate a huge amount of RAM */
- if (arg > DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key '%s' in match rule has arg number %lu but the maximum is %d.\n", key, (unsigned long) arg, DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER);
- goto failed;
- }
-
- if ((rule->flags & BUS_MATCH_ARGS) &&
- rule->args_len > (int) arg &&
- rule->args[arg] != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Argument %d matched more than once in match rule\n", key);
- goto failed;
- }
-
- if (!bus_match_rule_set_arg (rule, arg, value, is_path, is_namespace))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- return TRUE;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
-}
-
-/*
- * The format is comma-separated with strings quoted with single quotes
- * as for the shell (to escape a literal single quote, use '\'').
- *
- * type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='Foo',
- * path='/bar/foo',destination=':452345.34'
- *
- */
-BusMatchRule*
-bus_match_rule_parse (DBusConnection *matches_go_to,
- const DBusString *rule_text,
- DBusError *error)
-{
- BusMatchRule *rule;
- RuleToken tokens[MAX_RULE_TOKENS+1]; /* NULL termination + 1 */
- int i;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (_dbus_string_get_length (rule_text) > DBUS_MAXIMUM_MATCH_RULE_LENGTH)
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "Match rule text is %d bytes, maximum is %d",
- _dbus_string_get_length (rule_text),
- DBUS_MAXIMUM_MATCH_RULE_LENGTH);
- return NULL;
- }
-
- memset (tokens, '\0', sizeof (tokens));
-
- rule = bus_match_rule_new (matches_go_to);
- if (rule == NULL)
- {
- BUS_SET_OOM (error);
- goto failed;
- }
-
- if (!tokenize_rule (rule_text, tokens, error))
- goto failed;
-
- i = 0;
- while (tokens[i].key != NULL)
- {
- DBusString tmp_str;
- int len;
- const char *key = tokens[i].key;
- const char *value = tokens[i].value;
-
- _dbus_string_init_const (&tmp_str, value);
- len = _dbus_string_get_length (&tmp_str);
-
- if (strcmp (key, "type") == 0)
- {
- int t;
-
- if (rule->flags & BUS_MATCH_MESSAGE_TYPE)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key %s specified twice in match rule\n", key);
- goto failed;
- }
-
- t = dbus_message_type_from_string (value);
-
- if (t == DBUS_MESSAGE_TYPE_INVALID)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Invalid message type (%s) in match rule\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_message_type (rule, t))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "sender") == 0)
- {
- if (rule->flags & BUS_MATCH_SENDER)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key %s specified twice in match rule\n", key);
- goto failed;
- }
-
- if (!_dbus_validate_bus_name (&tmp_str, 0, len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Sender name '%s' is invalid\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_sender (rule, value))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "interface") == 0)
- {
- if (rule->flags & BUS_MATCH_INTERFACE)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key %s specified twice in match rule\n", key);
- goto failed;
- }
-
- if (!_dbus_validate_interface (&tmp_str, 0, len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Interface name '%s' is invalid\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_interface (rule, value))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "member") == 0)
- {
- if (rule->flags & BUS_MATCH_MEMBER)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key %s specified twice in match rule\n", key);
- goto failed;
- }
-
- if (!_dbus_validate_member (&tmp_str, 0, len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Member name '%s' is invalid\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_member (rule, value))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "path") == 0 ||
- strcmp (key, "path_namespace") == 0)
- {
- dbus_bool_t is_namespace = (strcmp (key, "path_namespace") == 0);
-
- if (rule->flags & (BUS_MATCH_PATH | BUS_MATCH_PATH_NAMESPACE))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "path or path_namespace specified twice in match rule\n");
- goto failed;
- }
-
- if (!_dbus_validate_path (&tmp_str, 0, len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Path '%s' is invalid\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_path (rule, value, is_namespace))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "destination") == 0)
- {
- if (rule->flags & BUS_MATCH_DESTINATION)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Key %s specified twice in match rule\n", key);
- goto failed;
- }
-
- if (!_dbus_validate_bus_name (&tmp_str, 0, len))
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Destination name '%s' is invalid\n", value);
- goto failed;
- }
-
- if (!bus_match_rule_set_destination (rule, value))
- {
- BUS_SET_OOM (error);
- goto failed;
- }
- }
- else if (strcmp (key, "eavesdrop") == 0)
- {
- /* do not detect "eavesdrop" being used more than once in rule:
- * 1) it's not possible, it's only in the flags
- * 2) it might be used twice to disable eavesdropping when it's
- * automatically added (eg dbus-monitor/bustle) */
-
- /* we accept only "true|false" as possible values */
- if ((strcmp (value, "true") == 0))
- {
- bus_match_rule_set_client_is_eavesdropping (rule, TRUE);
- }
- else if (strcmp (value, "false") == 0)
- {
- bus_match_rule_set_client_is_eavesdropping (rule, FALSE);
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "eavesdrop='%s' is invalid, "
- "it should be 'true' or 'false'\n",
- value);
- goto failed;
- }
- }
- else if (strncmp (key, "arg", 3) == 0)
- {
- if (!bus_match_rule_parse_arg_match (rule, key, &tmp_str, error))
- goto failed;
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID,
- "Unknown key \"%s\" in match rule",
- key);
- goto failed;
- }
-
- ++i;
- }
-
-
- goto out;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (rule)
- {
- bus_match_rule_unref (rule);
- rule = NULL;
- }
-
- out:
-
- i = 0;
- while (tokens[i].key || tokens[i].value)
- {
- _dbus_assert (i < MAX_RULE_TOKENS);
- dbus_free (tokens[i].key);
- dbus_free (tokens[i].value);
- ++i;
- }
-
- return rule;
-}
-
-typedef struct RulePool RulePool;
-struct RulePool
-{
- /* Maps non-NULL interface names to non-NULL (DBusList **)s */
- DBusHashTable *rules_by_iface;
-
- /* List of BusMatchRules which don't specify an interface */
- DBusList *rules_without_iface;
-};
-
-struct BusMatchmaker
-{
- int refcount;
-
- /* Pools of rules, grouped by the type of message they match. 0
- * (DBUS_MESSAGE_TYPE_INVALID) represents rules that do not specify a message
- * type.
- */
- RulePool rules_by_type[DBUS_NUM_MESSAGE_TYPES];
-};
-
-static void
-rule_list_free (DBusList **rules)
-{
- while (*rules != NULL)
- {
- BusMatchRule *rule;
-
- rule = (*rules)->data;
- bus_match_rule_unref (rule);
- _dbus_list_remove_link (rules, *rules);
- }
-}
-
-static void
-rule_list_ptr_free (DBusList **list)
-{
- /* We have to cope with NULL because the hash table frees the "existing"
- * value (which is NULL) when creating a new table entry...
- */
- if (list != NULL)
- {
- rule_list_free (list);
- dbus_free (list);
- }
-}
-
-BusMatchmaker*
-bus_matchmaker_new (void)
-{
- BusMatchmaker *matchmaker;
- int i;
-
- matchmaker = dbus_new0 (BusMatchmaker, 1);
- if (matchmaker == NULL)
- return NULL;
-
- matchmaker->refcount = 1;
-
- for (i = DBUS_MESSAGE_TYPE_INVALID; i < DBUS_NUM_MESSAGE_TYPES; i++)
- {
- RulePool *p = matchmaker->rules_by_type + i;
-
- p->rules_by_iface = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free, (DBusFreeFunction) rule_list_ptr_free);
-
- if (p->rules_by_iface == NULL)
- goto nomem;
- }
-
- return matchmaker;
-
- nomem:
- for (i = DBUS_MESSAGE_TYPE_INVALID; i < DBUS_NUM_MESSAGE_TYPES; i++)
- {
- RulePool *p = matchmaker->rules_by_type + i;
-
- if (p->rules_by_iface == NULL)
- break;
- else
- _dbus_hash_table_unref (p->rules_by_iface);
- }
- dbus_free (matchmaker);
-
- return NULL;
-}
-
-static DBusList **
-bus_matchmaker_get_rules (BusMatchmaker *matchmaker,
- int message_type,
- const char *interface,
- dbus_bool_t create)
-{
- RulePool *p;
-
- _dbus_assert (message_type >= 0);
- _dbus_assert (message_type < DBUS_NUM_MESSAGE_TYPES);
-
- _dbus_verbose ("Looking up rules for message_type %d, interface %s\n",
- message_type,
- interface != NULL ? interface : "<null>");
-
- p = matchmaker->rules_by_type + message_type;
-
- if (interface == NULL)
- {
- return &p->rules_without_iface;
- }
- else
- {
- DBusList **list;
-
- list = _dbus_hash_table_lookup_string (p->rules_by_iface, interface);
-
- if (list == NULL && create)
- {
- char *dupped_interface;
-
- list = dbus_new0 (DBusList *, 1);
- if (list == NULL)
- return NULL;
-
- dupped_interface = _dbus_strdup (interface);
- if (dupped_interface == NULL)
- {
- dbus_free (list);
- return NULL;
- }
-
- _dbus_verbose ("Adding list for type %d, iface %s\n", message_type,
- interface);
-
- if (!_dbus_hash_table_insert_string (p->rules_by_iface,
- dupped_interface, list))
- {
- dbus_free (list);
- dbus_free (dupped_interface);
- return NULL;
- }
- }
-
- return list;
- }
-}
-
-static void
-bus_matchmaker_gc_rules (BusMatchmaker *matchmaker,
- int message_type,
- const char *interface,
- DBusList **rules)
-{
- RulePool *p;
-
- if (interface == NULL)
- return;
-
- if (*rules != NULL)
- return;
-
- _dbus_verbose ("GCing HT entry for message_type %u, interface %s\n",
- message_type, interface);
-
- p = matchmaker->rules_by_type + message_type;
-
- _dbus_assert (_dbus_hash_table_lookup_string (p->rules_by_iface, interface)
- == rules);
-
- _dbus_hash_table_remove_string (p->rules_by_iface, interface);
-}
-
-BusMatchmaker *
-bus_matchmaker_ref (BusMatchmaker *matchmaker)
-{
- _dbus_assert (matchmaker->refcount > 0);
-
- matchmaker->refcount += 1;
-
- return matchmaker;
-}
-
-void
-bus_matchmaker_unref (BusMatchmaker *matchmaker)
-{
- _dbus_assert (matchmaker->refcount > 0);
-
- matchmaker->refcount -= 1;
- if (matchmaker->refcount == 0)
- {
- int i;
-
- for (i = DBUS_MESSAGE_TYPE_INVALID; i < DBUS_NUM_MESSAGE_TYPES; i++)
- {
- RulePool *p = matchmaker->rules_by_type + i;
-
- _dbus_hash_table_unref (p->rules_by_iface);
- rule_list_free (&p->rules_without_iface);
- }
-
- dbus_free (matchmaker);
- }
-}
-
-/* The rule can't be modified after it's added. */
-dbus_bool_t
-bus_matchmaker_add_rule (BusMatchmaker *matchmaker,
- BusMatchRule *rule)
-{
- DBusList **rules;
-
- _dbus_assert (bus_connection_is_active (rule->matches_go_to));
-
- _dbus_verbose ("Adding rule with message_type %d, interface %s\n",
- rule->message_type,
- rule->interface != NULL ? rule->interface : "<null>");
-
- rules = bus_matchmaker_get_rules (matchmaker, rule->message_type,
- rule->interface, TRUE);
-
- if (rules == NULL)
- return FALSE;
-
- if (!_dbus_list_append (rules, rule))
- return FALSE;
-
- if (!bus_connection_add_match_rule (rule->matches_go_to, rule))
- {
- _dbus_list_remove_last (rules, rule);
- bus_matchmaker_gc_rules (matchmaker, rule->message_type,
- rule->interface, rules);
- return FALSE;
- }
-
- bus_match_rule_ref (rule);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- char *s = match_rule_to_string (rule);
-
- _dbus_verbose ("Added match rule %s to connection %p\n",
- s, rule->matches_go_to);
- dbus_free (s);
- }
-#endif
-
- return TRUE;
-}
-
-static dbus_bool_t
-match_rule_equal (BusMatchRule *a,
- BusMatchRule *b)
-{
- if (a->flags != b->flags)
- return FALSE;
-
- if (a->matches_go_to != b->matches_go_to)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_MESSAGE_TYPE) &&
- a->message_type != b->message_type)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_MEMBER) &&
- strcmp (a->member, b->member) != 0)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_PATH) &&
- strcmp (a->path, b->path) != 0)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_INTERFACE) &&
- strcmp (a->interface, b->interface) != 0)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_SENDER) &&
- strcmp (a->sender, b->sender) != 0)
- return FALSE;
-
- if ((a->flags & BUS_MATCH_DESTINATION) &&
- strcmp (a->destination, b->destination) != 0)
- return FALSE;
-
- /* we already compared the value of flags, and
- * BUS_MATCH_CLIENT_IS_EAVESDROPPING does not have another struct member */
-
- if (a->flags & BUS_MATCH_ARGS)
- {
- int i;
-
- if (a->args_len != b->args_len)
- return FALSE;
-
- i = 0;
- while (i < a->args_len)
- {
- int length;
-
- if ((a->args[i] != NULL) != (b->args[i] != NULL))
- return FALSE;
-
- if (a->arg_lens[i] != b->arg_lens[i])
- return FALSE;
-
- length = a->arg_lens[i] & ~BUS_MATCH_ARG_FLAGS;
-
- if (a->args[i] != NULL)
- {
- _dbus_assert (b->args[i] != NULL);
- if (memcmp (a->args[i], b->args[i], length) != 0)
- return FALSE;
- }
-
- ++i;
- }
- }
-
- return TRUE;
-}
-
-static void
-bus_matchmaker_remove_rule_link (DBusList **rules,
- DBusList *link)
-{
- BusMatchRule *rule = link->data;
-
- bus_connection_remove_match_rule (rule->matches_go_to, rule);
- _dbus_list_remove_link (rules, link);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- char *s = match_rule_to_string (rule);
-
- _dbus_verbose ("Removed match rule %s for connection %p\n",
- s, rule->matches_go_to);
- dbus_free (s);
- }
-#endif
-
- bus_match_rule_unref (rule);
-}
-
-void
-bus_matchmaker_remove_rule (BusMatchmaker *matchmaker,
- BusMatchRule *rule)
-{
- DBusList **rules;
-
- _dbus_verbose ("Removing rule with message_type %d, interface %s\n",
- rule->message_type,
- rule->interface != NULL ? rule->interface : "<null>");
-
- bus_connection_remove_match_rule (rule->matches_go_to, rule);
-
- rules = bus_matchmaker_get_rules (matchmaker, rule->message_type,
- rule->interface, FALSE);
-
- /* We should only be asked to remove a rule by identity right after it was
- * added, so there should be a list for it.
- */
- _dbus_assert (rules != NULL);
-
- _dbus_list_remove (rules, rule);
- bus_matchmaker_gc_rules (matchmaker, rule->message_type, rule->interface,
- rules);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- char *s = match_rule_to_string (rule);
-
- _dbus_verbose ("Removed match rule %s for connection %p\n",
- s, rule->matches_go_to);
- dbus_free (s);
- }
-#endif
-
- bus_match_rule_unref (rule);
-}
-
-/* Remove a single rule which is equal to the given rule by value */
-dbus_bool_t
-bus_matchmaker_remove_rule_by_value (BusMatchmaker *matchmaker,
- BusMatchRule *value,
- DBusError *error)
-{
- DBusList **rules;
- DBusList *link = NULL;
-
- _dbus_verbose ("Removing rule by value with message_type %d, interface %s\n",
- value->message_type,
- value->interface != NULL ? value->interface : "<null>");
-
- rules = bus_matchmaker_get_rules (matchmaker, value->message_type,
- value->interface, FALSE);
-
- if (rules != NULL)
- {
- /* we traverse backward because bus_connection_remove_match_rule()
- * removes the most-recently-added rule
- */
- link = _dbus_list_get_last_link (rules);
- while (link != NULL)
- {
- BusMatchRule *rule;
- DBusList *prev;
-
- rule = link->data;
- prev = _dbus_list_get_prev_link (rules, link);
-
- if (match_rule_equal (rule, value))
- {
- bus_matchmaker_remove_rule_link (rules, link);
- break;
- }
-
- link = prev;
- }
- }
-
- if (link == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_MATCH_RULE_NOT_FOUND,
- "The given match rule wasn't found and can't be removed");
- return FALSE;
- }
-
- bus_matchmaker_gc_rules (matchmaker, value->message_type, value->interface,
- rules);
-
- return TRUE;
-}
-
-static void
-rule_list_remove_by_connection (DBusList **rules,
- DBusConnection *connection)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (rules);
- while (link != NULL)
- {
- BusMatchRule *rule;
- DBusList *next;
-
- rule = link->data;
- next = _dbus_list_get_next_link (rules, link);
-
- if (rule->matches_go_to == connection)
- {
- bus_matchmaker_remove_rule_link (rules, link);
- }
- else if (((rule->flags & BUS_MATCH_SENDER) && *rule->sender == ':') ||
- ((rule->flags & BUS_MATCH_DESTINATION) && *rule->destination == ':'))
- {
- /* The rule matches to/from a base service, see if it's the
- * one being disconnected, since we know this service name
- * will never be recycled.
- */
- const char *name;
-
- name = bus_connection_get_name (connection);
- _dbus_assert (name != NULL); /* because we're an active connection */
-
- if (((rule->flags & BUS_MATCH_SENDER) &&
- strcmp (rule->sender, name) == 0) ||
- ((rule->flags & BUS_MATCH_DESTINATION) &&
- strcmp (rule->destination, name) == 0))
- {
- bus_matchmaker_remove_rule_link (rules, link);
- }
- }
-
- link = next;
- }
-}
-
-void
-bus_matchmaker_disconnected (BusMatchmaker *matchmaker,
- DBusConnection *connection)
-{
- int i;
-
- /* FIXME
- *
- * This scans all match rules on the bus. We could avoid that
- * for the rules belonging to the connection, since we keep
- * a list of those; but for the rules that just refer to
- * the connection we'd need to do something more elaborate.
- */
-
- _dbus_assert (bus_connection_is_active (connection));
-
- _dbus_verbose ("Removing all rules for connection %p\n", connection);
-
- for (i = DBUS_MESSAGE_TYPE_INVALID; i < DBUS_NUM_MESSAGE_TYPES; i++)
- {
- RulePool *p = matchmaker->rules_by_type + i;
- DBusHashIter iter;
-
- rule_list_remove_by_connection (&p->rules_without_iface, connection);
-
- _dbus_hash_iter_init (p->rules_by_iface, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- DBusList **items = _dbus_hash_iter_get_value (&iter);
-
- rule_list_remove_by_connection (items, connection);
-
- if (*items == NULL)
- _dbus_hash_iter_remove_entry (&iter);
- }
- }
-}
-
-static dbus_bool_t
-connection_is_primary_owner (DBusConnection *connection,
- const char *service_name)
-{
- BusService *service;
- DBusString str;
- BusRegistry *registry;
-
- _dbus_assert (connection != NULL);
-
- registry = bus_connection_get_registry (connection);
-
- _dbus_string_init_const (&str, service_name);
- service = bus_registry_lookup (registry, &str);
-
- if (service == NULL)
- return FALSE; /* Service doesn't exist so connection can't own it. */
-
- return bus_service_get_primary_owners_connection (service) == connection;
-}
-
-static dbus_bool_t
-str_has_prefix (const char *str, const char *prefix)
-{
- size_t prefix_len;
- prefix_len = strlen (prefix);
- if (strncmp (str, prefix, prefix_len) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-static dbus_bool_t
-match_rule_matches (BusMatchRule *rule,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- BusMatchFlags already_matched)
-{
- dbus_bool_t wants_to_eavesdrop = FALSE;
- int flags;
-
- /* All features of the match rule are AND'd together,
- * so FALSE if any of them don't match.
- */
-
- /* sender/addressed_recipient of #NULL may mean bus driver,
- * or for addressed_recipient may mean a message with no
- * specific recipient (i.e. a signal)
- */
-
- /* Don't bother re-matching features we've already checked implicitly. */
- flags = rule->flags & (~already_matched);
-
- if (flags & BUS_MATCH_CLIENT_IS_EAVESDROPPING)
- wants_to_eavesdrop = TRUE;
-
- if (flags & BUS_MATCH_MESSAGE_TYPE)
- {
- _dbus_assert (rule->message_type != DBUS_MESSAGE_TYPE_INVALID);
-
- if (rule->message_type != dbus_message_get_type (message))
- return FALSE;
- }
-
- if (flags & BUS_MATCH_INTERFACE)
- {
- const char *iface;
-
- _dbus_assert (rule->interface != NULL);
-
- iface = dbus_message_get_interface (message);
- if (iface == NULL)
- return FALSE;
-
- if (strcmp (iface, rule->interface) != 0)
- return FALSE;
- }
-
- if (flags & BUS_MATCH_MEMBER)
- {
- const char *member;
-
- _dbus_assert (rule->member != NULL);
-
- member = dbus_message_get_member (message);
- if (member == NULL)
- return FALSE;
-
- if (strcmp (member, rule->member) != 0)
- return FALSE;
- }
-
- if (flags & BUS_MATCH_SENDER)
- {
- _dbus_assert (rule->sender != NULL);
-
- if (sender == NULL)
- {
- if (strcmp (rule->sender,
- DBUS_SERVICE_DBUS) != 0)
- return FALSE;
- }
- else
- {
- if (!connection_is_primary_owner (sender, rule->sender))
- return FALSE;
- }
- }
-
- /* Note: this part is relevant for eavesdropper rules:
- * Two cases:
- * 1) rule has a destination to be matched
- * (flag BUS_MATCH_DESTINATION present). Rule will match if:
- * - rule->destination matches the addressed_recipient
- * AND
- * - wants_to_eavesdrop=TRUE
- *
- * Note: (the case in which addressed_recipient is the actual rule owner
- * is handled elsewere in dispatch.c:bus_dispatch_matches().
- *
- * 2) rule has no destination. Rule will match if:
- * - message has no specified destination (ie broadcasts)
- * (Note: this will rule out unicast method calls and unicast signals,
- * fixing FDO#269748)
- * OR
- * - wants_to_eavesdrop=TRUE (destination-catch-all situation)
- */
- if (flags & BUS_MATCH_DESTINATION)
- {
- const char *destination;
-
- _dbus_assert (rule->destination != NULL);
-
- destination = dbus_message_get_destination (message);
- if (destination == NULL)
- /* broadcast, but this rule specified a destination: no match */
- return FALSE;
-
- /* rule owner does not intend to eavesdrop: we'll deliver only msgs
- * directed to it, NOT MATCHING */
- if (!wants_to_eavesdrop)
- return FALSE;
-
- if (addressed_recipient == NULL)
- {
- if (strcmp (rule->destination,
- DBUS_SERVICE_DBUS) != 0)
- return FALSE;
- }
- else
- {
- if (!connection_is_primary_owner (addressed_recipient, rule->destination))
- return FALSE;
- }
- } else { /* no destination in rule */
- dbus_bool_t msg_is_broadcast;
-
- _dbus_assert (rule->destination == NULL);
-
- msg_is_broadcast = (dbus_message_get_destination (message) == NULL);
-
- if (!wants_to_eavesdrop && !msg_is_broadcast)
- return FALSE;
-
- /* if we are here rule owner intends to eavesdrop
- * OR
- * message is being broadcasted */
- }
-
- if (flags & BUS_MATCH_PATH)
- {
- const char *path;
-
- _dbus_assert (rule->path != NULL);
-
- path = dbus_message_get_path (message);
- if (path == NULL)
- return FALSE;
-
- if (strcmp (path, rule->path) != 0)
- return FALSE;
- }
-
- if (flags & BUS_MATCH_PATH_NAMESPACE)
- {
- const char *path;
- int len;
-
- _dbus_assert (rule->path != NULL);
-
- path = dbus_message_get_path (message);
- if (path == NULL)
- return FALSE;
-
- if (!str_has_prefix (path, rule->path))
- return FALSE;
-
- len = strlen (rule->path);
-
- /* Check that the actual argument is within the expected
- * namespace, rather than just starting with that string,
- * by checking that the matched prefix is followed by a '/'
- * or the end of the path.
- *
- * Special case: the only valid path of length 1, "/",
- * matches everything.
- */
- if (len > 1 && path[len] != '\0' && path[len] != '/')
- return FALSE;
- }
-
- if (flags & BUS_MATCH_ARGS)
- {
- int i;
- DBusMessageIter iter;
-
- _dbus_assert (rule->args != NULL);
-
- dbus_message_iter_init (message, &iter);
-
- i = 0;
- while (i < rule->args_len)
- {
- int current_type;
- const char *expected_arg;
- int expected_length;
- dbus_bool_t is_path, is_namespace;
-
- expected_arg = rule->args[i];
- expected_length = rule->arg_lens[i] & ~BUS_MATCH_ARG_FLAGS;
- is_path = (rule->arg_lens[i] & BUS_MATCH_ARG_IS_PATH) != 0;
- is_namespace = (rule->arg_lens[i] & BUS_MATCH_ARG_NAMESPACE) != 0;
-
- current_type = dbus_message_iter_get_arg_type (&iter);
-
- if (expected_arg != NULL)
- {
- const char *actual_arg;
- int actual_length;
-
- if (current_type != DBUS_TYPE_STRING &&
- (!is_path || current_type != DBUS_TYPE_OBJECT_PATH))
- return FALSE;
-
- actual_arg = NULL;
- dbus_message_iter_get_basic (&iter, &actual_arg);
- _dbus_assert (actual_arg != NULL);
-
- actual_length = strlen (actual_arg);
-
- if (is_path)
- {
- if (actual_length < expected_length &&
- actual_arg[actual_length - 1] != '/')
- return FALSE;
-
- if (expected_length < actual_length &&
- expected_arg[expected_length - 1] != '/')
- return FALSE;
-
- if (memcmp (actual_arg, expected_arg,
- MIN (actual_length, expected_length)) != 0)
- return FALSE;
- }
- else if (is_namespace)
- {
- if (expected_length > actual_length)
- return FALSE;
-
- /* If the actual argument doesn't start with the expected
- * namespace, then we don't match.
- */
- if (memcmp (expected_arg, actual_arg, expected_length) != 0)
- return FALSE;
-
- if (expected_length < actual_length)
- {
- /* Check that the actual argument is within the expected
- * namespace, rather than just starting with that string,
- * by checking that the matched prefix ends in a '.'.
- *
- * This doesn't stop "foo.bar." matching "foo.bar..baz"
- * which is an invalid namespace, but at some point the
- * daemon can't cover up for broken services.
- */
- if (actual_arg[expected_length] != '.')
- return FALSE;
- }
- /* otherwise we had an exact match. */
- }
- else
- {
- if (expected_length != actual_length ||
- memcmp (expected_arg, actual_arg, expected_length) != 0)
- return FALSE;
- }
-
- }
-
- if (current_type != DBUS_TYPE_INVALID)
- dbus_message_iter_next (&iter);
-
- ++i;
- }
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-get_recipients_from_list (DBusList **rules,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- DBusList **recipients_p)
-{
- DBusList *link;
-
- if (rules == NULL)
- return TRUE;
-
- link = _dbus_list_get_first_link (rules);
- while (link != NULL)
- {
- BusMatchRule *rule;
-
- rule = link->data;
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- char *s = match_rule_to_string (rule);
-
- _dbus_verbose ("Checking whether message matches rule %s for connection %p\n",
- s, rule->matches_go_to);
- dbus_free (s);
- }
-#endif
-
- if (match_rule_matches (rule,
- sender, addressed_recipient, message,
- BUS_MATCH_MESSAGE_TYPE | BUS_MATCH_INTERFACE))
- {
- _dbus_verbose ("Rule matched\n");
-
- /* Append to the list if we haven't already */
- if (bus_connection_mark_stamp (rule->matches_go_to))
- {
- if (!_dbus_list_append (recipients_p, rule->matches_go_to))
- return FALSE;
- }
- else
- {
- _dbus_verbose ("Connection already receiving this message, so not adding again\n");
- }
- }
-
- link = _dbus_list_get_next_link (rules, link);
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-bus_matchmaker_get_recipients (BusMatchmaker *matchmaker,
- BusConnections *connections,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- DBusList **recipients_p)
-{
- int type;
- const char *interface;
- DBusList **neither, **just_type, **just_iface, **both;
-
- _dbus_assert (*recipients_p == NULL);
-
- /* This avoids sending same message to the same connection twice.
- * Purpose of the stamp instead of a bool is to avoid iterating over
- * all connections resetting the bool each time.
- */
- bus_connections_increment_stamp (connections);
-
- /* addressed_recipient is already receiving the message, don't add to list.
- * NULL addressed_recipient means either bus driver, or this is a signal
- * and thus lacks a specific addressed_recipient.
- */
- if (addressed_recipient != NULL)
- bus_connection_mark_stamp (addressed_recipient);
-
- type = dbus_message_get_type (message);
- interface = dbus_message_get_interface (message);
-
- neither = bus_matchmaker_get_rules (matchmaker, DBUS_MESSAGE_TYPE_INVALID,
- NULL, FALSE);
- just_type = just_iface = both = NULL;
-
- if (interface != NULL)
- just_iface = bus_matchmaker_get_rules (matchmaker,
- DBUS_MESSAGE_TYPE_INVALID, interface, FALSE);
-
- if (type > DBUS_MESSAGE_TYPE_INVALID && type < DBUS_NUM_MESSAGE_TYPES)
- {
- just_type = bus_matchmaker_get_rules (matchmaker, type, NULL, FALSE);
-
- if (interface != NULL)
- both = bus_matchmaker_get_rules (matchmaker, type, interface, FALSE);
- }
-
- if (!(get_recipients_from_list (neither, sender, addressed_recipient,
- message, recipients_p) &&
- get_recipients_from_list (just_iface, sender, addressed_recipient,
- message, recipients_p) &&
- get_recipients_from_list (just_type, sender, addressed_recipient,
- message, recipients_p) &&
- get_recipients_from_list (both, sender, addressed_recipient,
- message, recipients_p)))
- {
- _dbus_list_clear (recipients_p);
- return FALSE;
- }
-
- return TRUE;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "test.h"
-#include <stdlib.h>
-
-static BusMatchRule*
-check_parse (dbus_bool_t should_succeed,
- const char *text)
-{
- BusMatchRule *rule;
- DBusString str;
- DBusError error;
-
- dbus_error_init (&error);
-
- _dbus_string_init_const (&str, text);
-
- rule = bus_match_rule_parse (NULL, &str, &error);
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- return NULL;
- }
-
- if (should_succeed && rule == NULL)
- {
- _dbus_warn ("Failed to parse: %s: %s: \"%s\"\n",
- error.name, error.message,
- _dbus_string_get_const_data (&str));
- exit (1);
- }
-
- if (!should_succeed && rule != NULL)
- {
- _dbus_warn ("Failed to fail to parse: \"%s\"\n",
- _dbus_string_get_const_data (&str));
- exit (1);
- }
-
- dbus_error_free (&error);
-
- return rule;
-}
-
-static void
-assert_large_rule (BusMatchRule *rule)
-{
- _dbus_assert (rule->flags & BUS_MATCH_MESSAGE_TYPE);
- _dbus_assert (rule->flags & BUS_MATCH_SENDER);
- _dbus_assert (rule->flags & BUS_MATCH_INTERFACE);
- _dbus_assert (rule->flags & BUS_MATCH_MEMBER);
- _dbus_assert (rule->flags & BUS_MATCH_DESTINATION);
- _dbus_assert (rule->flags & BUS_MATCH_PATH);
-
- _dbus_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (rule->interface != NULL);
- _dbus_assert (rule->member != NULL);
- _dbus_assert (rule->sender != NULL);
- _dbus_assert (rule->destination != NULL);
- _dbus_assert (rule->path != NULL);
-
- _dbus_assert (strcmp (rule->interface, "org.freedesktop.DBusInterface") == 0);
- _dbus_assert (strcmp (rule->sender, "org.freedesktop.DBusSender") == 0);
- _dbus_assert (strcmp (rule->member, "Foo") == 0);
- _dbus_assert (strcmp (rule->path, "/bar/foo") == 0);
- _dbus_assert (strcmp (rule->destination, ":452345.34") == 0);
-}
-
-static dbus_bool_t
-test_parsing (void *data)
-{
- BusMatchRule *rule;
-
- rule = check_parse (TRUE, "type='signal',sender='org.freedesktop.DBusSender',interface='org.freedesktop.DBusInterface',member='Foo',path='/bar/foo',destination=':452345.34'");
- if (rule != NULL)
- {
- assert_large_rule (rule);
- bus_match_rule_unref (rule);
- }
-
- /* With extra whitespace and useless quotes */
- rule = check_parse (TRUE, " type='signal', \tsender='org.freedes''ktop.DBusSender', interface='org.freedesktop.DBusInterface''''', \tmember='Foo',path='/bar/foo',destination=':452345.34'''''");
- if (rule != NULL)
- {
- assert_large_rule (rule);
- bus_match_rule_unref (rule);
- }
-
-
- /* A simple signal connection */
- rule = check_parse (TRUE, "type='signal',path='/foo',interface='org.Bar'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags & BUS_MATCH_MESSAGE_TYPE);
- _dbus_assert (rule->flags & BUS_MATCH_INTERFACE);
- _dbus_assert (rule->flags & BUS_MATCH_PATH);
-
- _dbus_assert (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (rule->interface != NULL);
- _dbus_assert (rule->path != NULL);
-
- _dbus_assert (strcmp (rule->interface, "org.Bar") == 0);
- _dbus_assert (strcmp (rule->path, "/foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- /* argN */
- rule = check_parse (TRUE, "arg0='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 1);
- _dbus_assert (rule->args[0] != NULL);
- _dbus_assert (rule->args[1] == NULL);
- _dbus_assert (strcmp (rule->args[0], "foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg1='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 2);
- _dbus_assert (rule->args[0] == NULL);
- _dbus_assert (rule->args[1] != NULL);
- _dbus_assert (rule->args[2] == NULL);
- _dbus_assert (strcmp (rule->args[1], "foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg2='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 3);
- _dbus_assert (rule->args[0] == NULL);
- _dbus_assert (rule->args[1] == NULL);
- _dbus_assert (rule->args[2] != NULL);
- _dbus_assert (rule->args[3] == NULL);
- _dbus_assert (strcmp (rule->args[2], "foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg40='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 41);
- _dbus_assert (rule->args[0] == NULL);
- _dbus_assert (rule->args[1] == NULL);
- _dbus_assert (rule->args[40] != NULL);
- _dbus_assert (rule->args[41] == NULL);
- _dbus_assert (strcmp (rule->args[40], "foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg63='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 64);
- _dbus_assert (rule->args[0] == NULL);
- _dbus_assert (rule->args[1] == NULL);
- _dbus_assert (rule->args[63] != NULL);
- _dbus_assert (rule->args[64] == NULL);
- _dbus_assert (strcmp (rule->args[63], "foo") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg7path='/foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags = BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 8);
- _dbus_assert (rule->args[7] != NULL);
- _dbus_assert (rule->args[8] == NULL);
- _dbus_assert (strcmp (rule->args[7], "/foo") == 0);
- _dbus_assert ((rule->arg_lens[7] & BUS_MATCH_ARG_IS_PATH)
- == BUS_MATCH_ARG_IS_PATH);
-
- bus_match_rule_unref (rule);
- }
-
- /* Arg 0 namespace matches */
- rule = check_parse (TRUE, "arg0namespace='foo'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 1);
- _dbus_assert (strcmp (rule->args[0], "foo") == 0);
- _dbus_assert ((rule->arg_lens[0] & BUS_MATCH_ARG_NAMESPACE)
- == BUS_MATCH_ARG_NAMESPACE);
-
- bus_match_rule_unref (rule);
- }
-
- rule = check_parse (TRUE, "arg0namespace='foo.bar'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_ARGS);
- _dbus_assert (rule->args != NULL);
- _dbus_assert (rule->args_len == 1);
- _dbus_assert (strcmp (rule->args[0], "foo.bar") == 0);
- _dbus_assert ((rule->arg_lens[0] & BUS_MATCH_ARG_NAMESPACE)
- == BUS_MATCH_ARG_NAMESPACE);
-
- bus_match_rule_unref (rule);
- }
-
- /* Only arg0namespace is supported. */
- rule = check_parse (FALSE, "arg1namespace='foo'");
- _dbus_assert (rule == NULL);
-
- /* An empty string isn't a valid namespace prefix (you should just not
- * specify this key at all).
- */
- rule = check_parse (FALSE, "arg0namespace=''");
- _dbus_assert (rule == NULL);
-
- /* Trailing periods aren't allowed (earlier versions of the arg0namespace
- * spec allowed a single trailing period, which altered the semantics) */
- rule = check_parse (FALSE, "arg0namespace='foo.'");
- _dbus_assert (rule == NULL);
-
- rule = check_parse (FALSE, "arg0namespace='foo.bar.'");
- _dbus_assert (rule == NULL);
-
- rule = check_parse (FALSE, "arg0namespace='foo..'");
- _dbus_assert (rule == NULL);
-
- rule = check_parse (FALSE, "arg0namespace='foo.bar..'");
- _dbus_assert (rule == NULL);
-
- /* Too-large argN */
- rule = check_parse (FALSE, "arg300='foo'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "arg64='foo'");
- _dbus_assert (rule == NULL);
-
- /* No N in argN */
- rule = check_parse (FALSE, "arg='foo'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "argv='foo'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "arg3junk='foo'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "argument='foo'");
- _dbus_assert (rule == NULL);
-
- /* Reject duplicates */
- rule = check_parse (FALSE, "type='signal',type='method_call'");
- _dbus_assert (rule == NULL);
-
- rule = check_parse (TRUE, "path_namespace='/foo/bar'");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == BUS_MATCH_PATH_NAMESPACE);
- _dbus_assert (rule->path != NULL);
- _dbus_assert (strcmp (rule->path, "/foo/bar") == 0);
-
- bus_match_rule_unref (rule);
- }
-
- /* Almost a duplicate */
- rule = check_parse (FALSE, "path='/foo',path_namespace='/foo'");
- _dbus_assert (rule == NULL);
-
- /* Trailing / was supported in the initial proposal, but now isn't */
- rule = check_parse (FALSE, "path_namespace='/foo/'");
- _dbus_assert (rule == NULL);
-
- /* Duplicates with the argN code */
- rule = check_parse (FALSE, "arg0='foo',arg0='bar'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "arg3='foo',arg3='bar'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "arg30='foo',arg30='bar'");
- _dbus_assert (rule == NULL);
-
- /* Reject broken keys */
- rule = check_parse (FALSE, "blah='signal'");
- _dbus_assert (rule == NULL);
-
- /* Reject broken values */
- rule = check_parse (FALSE, "type='chouin'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "interface='abc@def++'");
- _dbus_assert (rule == NULL);
- rule = check_parse (FALSE, "service='youpi'");
- _dbus_assert (rule == NULL);
-
- /* Allow empty rule */
- rule = check_parse (TRUE, "");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == 0);
-
- bus_match_rule_unref (rule);
- }
-
- /* All-whitespace rule is the same as empty */
- rule = check_parse (TRUE, " \t");
- if (rule != NULL)
- {
- _dbus_assert (rule->flags == 0);
-
- bus_match_rule_unref (rule);
- }
-
- /* But with non-whitespace chars and no =value, it's not OK */
- rule = check_parse (FALSE, "type");
- _dbus_assert (rule == NULL);
-
- return TRUE;
-}
-
-static struct {
- const char *first;
- const char *second;
-} equality_tests[] = {
- { "type='signal'", "type='signal'" },
- { "type='signal',interface='foo.bar'", "interface='foo.bar',type='signal'" },
- { "type='signal',member='bar'", "member='bar',type='signal'" },
- { "type='method_call',sender=':1.0'", "sender=':1.0',type='method_call'" },
- { "type='method_call',destination=':1.0'", "destination=':1.0',type='method_call'" },
- { "type='method_call',path='/foo/bar'", "path='/foo/bar',type='method_call'" },
- { "type='method_call',arg0='blah'", "arg0='blah',type='method_call'" },
- { "type='method_call',arg0='boo'", "arg0='boo',type='method_call'" },
- { "type='method_call',arg0='blah',arg1='baz'", "arg0='blah',arg1='baz',type='method_call'" },
- { "type='method_call',arg3='foosh'", "arg3='foosh',type='method_call'" },
- { "arg3='fool'", "arg3='fool'" },
- { "arg0namespace='fool'", "arg0namespace='fool'" },
- { "member='food'", "member='food'" }
-};
-
-static void
-test_equality (void)
-{
- int i;
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (equality_tests))
- {
- BusMatchRule *first;
- BusMatchRule *second;
- int j;
-
- first = check_parse (TRUE, equality_tests[i].first);
- _dbus_assert (first != NULL);
- second = check_parse (TRUE, equality_tests[i].second);
- _dbus_assert (second != NULL);
-
- if (!match_rule_equal (first, second))
- {
- _dbus_warn ("rule %s and %s should have been equal\n",
- equality_tests[i].first,
- equality_tests[i].second);
- exit (1);
- }
-
- bus_match_rule_unref (second);
-
- /* Check that the rule is not equal to any of the
- * others besides its pair match
- */
- j = 0;
- while (j < _DBUS_N_ELEMENTS (equality_tests))
- {
- if (i != j)
- {
- second = check_parse (TRUE, equality_tests[j].second);
-
- if (match_rule_equal (first, second))
- {
- _dbus_warn ("rule %s and %s should not have been equal\n",
- equality_tests[i].first,
- equality_tests[j].second);
- exit (1);
- }
-
- bus_match_rule_unref (second);
- }
-
- ++j;
- }
-
- bus_match_rule_unref (first);
-
- ++i;
- }
-}
-
-static const char*
-should_match_message_1[] = {
- "type='signal'",
- "member='Frobated'",
- "arg0='foobar'",
- "type='signal',member='Frobated'",
- "type='signal',member='Frobated',arg0='foobar'",
- "member='Frobated',arg0='foobar'",
- "type='signal',arg0='foobar'",
- /* The definition of argXpath matches says: "As with normal argument matches,
- * if the argument is exactly equal to the string given in the match rule
- * then the rule is satisfied." So this should match (even though the
- * argument is not a valid path)!
- */
- "arg0path='foobar'",
- "arg0namespace='foobar'",
- NULL
-};
-
-static const char*
-should_not_match_message_1[] = {
- "type='method_call'",
- "type='error'",
- "type='method_return'",
- "type='signal',member='Oopsed'",
- "arg0='blah'",
- "arg1='foobar'",
- "arg2='foobar'",
- "arg3='foobar'",
- "arg0='3'",
- "arg1='3'",
- "arg0='foobar',arg1='abcdef'",
- "arg0='foobar',arg1='abcdef',arg2='abcdefghi',arg3='abcdefghi',arg4='abcdefghi'",
- "arg0='foobar',arg1='abcdef',arg4='abcdefghi',arg3='abcdefghi',arg2='abcdefghi'",
- "arg0path='foo'",
- "arg0path='foobar/'",
- "arg1path='3'",
- "arg0namespace='foo'",
- "arg0namespace='foo',arg1='abcdef'",
- "arg0namespace='moo'",
- NULL
-};
-
-#define EXAMPLE_NAME "com.example.backend.foo"
-
-static const char *
-should_match_message_2[] = {
- /* EXAMPLE_NAME is in all of these namespaces */
- "arg0namespace='com.example.backend'",
- "arg0namespace='com.example'",
- "arg0namespace='com'",
-
- /* If the client specifies the name exactly, with no trailing period, then
- * it should match.
- */
- "arg0namespace='com.example.backend.foo'",
-
- NULL
-};
-
-static const char *
-should_not_match_message_2[] = {
- /* These are not even prefixes */
- "arg0namespace='com.example.backend.foo.bar'",
- "arg0namespace='com.example.backend.foobar'",
-
- /* These are prefixes, but they're not parent namespaces. */
- "arg0namespace='com.example.backend.fo'",
- "arg0namespace='com.example.backen'",
- "arg0namespace='com.exampl'",
- "arg0namespace='co'",
-
- NULL
-};
-
-static void
-check_matches (dbus_bool_t expected_to_match,
- int number,
- DBusMessage *message,
- const char *rule_text)
-{
- BusMatchRule *rule;
- dbus_bool_t matched;
-
- rule = check_parse (TRUE, rule_text);
- _dbus_assert (rule != NULL);
-
- /* We can't test sender/destination rules since we pass NULL here */
- matched = match_rule_matches (rule, NULL, NULL, message, 0);
-
- if (matched != expected_to_match)
- {
- _dbus_warn ("Expected rule %s to %s message %d, failed\n",
- rule_text, expected_to_match ?
- "match" : "not match", number);
- exit (1);
- }
-
- bus_match_rule_unref (rule);
-}
-
-static void
-check_matching (DBusMessage *message,
- int number,
- const char **should_match,
- const char **should_not_match)
-{
- int i;
-
- i = 0;
- while (should_match[i] != NULL)
- {
- check_matches (TRUE, number, message, should_match[i]);
- ++i;
- }
-
- i = 0;
- while (should_not_match[i] != NULL)
- {
- check_matches (FALSE, number, message, should_not_match[i]);
- ++i;
- }
-}
-
-static void
-test_matching (void)
-{
- DBusMessage *message1, *message2;
- const char *v_STRING;
- dbus_int32_t v_INT32;
-
- message1 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message1 != NULL);
- if (!dbus_message_set_member (message1, "Frobated"))
- _dbus_assert_not_reached ("oom");
-
- v_STRING = "foobar";
- v_INT32 = 3;
- if (!dbus_message_append_args (message1,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_INT32, &v_INT32,
- NULL))
- _dbus_assert_not_reached ("oom");
-
- check_matching (message1, 1,
- should_match_message_1,
- should_not_match_message_1);
-
- dbus_message_unref (message1);
-
- message2 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message2 != NULL);
- if (!dbus_message_set_member (message2, "NameOwnerChanged"))
- _dbus_assert_not_reached ("oom");
-
- /* Obviously this isn't really a NameOwnerChanged signal. */
- v_STRING = EXAMPLE_NAME;
- if (!dbus_message_append_args (message2,
- DBUS_TYPE_STRING, &v_STRING,
- NULL))
- _dbus_assert_not_reached ("oom");
-
- check_matching (message2, 2,
- should_match_message_2,
- should_not_match_message_2);
-
- dbus_message_unref (message2);
-}
-
-#define PATH_MATCH_RULE "arg0path='/aa/bb/'"
-
-/* This is a list of paths that should be matched by PATH_MATCH_RULE, taken
- * from the specification. Notice that not all of them are actually legal D-Bus
- * paths.
- *
- * The author of this test takes no responsibility for the semantics of
- * this match rule key.
- */
-static const char *paths_that_should_be_matched[] = {
- "/aa/",
- "/aa/bb/",
- "/aa/bb/cc/",
-#define FIRST_VALID_PATH_WHICH_SHOULD_MATCH 3
- "/",
- "/aa/bb/cc",
- NULL
-};
-
-/* These paths should not be matched by PATH_MATCH_RULE. */
-static const char *paths_that_should_not_be_matched[] = {
- "/aa/b",
- "/aa",
- /* or even... */
- "/aa/bb",
- NULL
-};
-
-static void
-test_path_match (int type,
- const char *path,
- const char *rule_text,
- BusMatchRule *rule,
- dbus_bool_t should_match)
-{
- DBusMessage *message = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- dbus_bool_t matched;
-
- _dbus_assert (message != NULL);
- if (!dbus_message_set_member (message, "Foo"))
- _dbus_assert_not_reached ("oom");
-
- if (!dbus_message_append_args (message,
- type, &path,
- NULL))
- _dbus_assert_not_reached ("oom");
-
- matched = match_rule_matches (rule, NULL, NULL, message, 0);
-
- if (matched != should_match)
- {
- _dbus_warn ("Expected rule %s to %s message "
- "with first arg %s of type '%c', failed\n",
- rule_text,
- should_match ? "match" : "not match",
- path,
- (char) type);
- exit (1);
- }
-
- dbus_message_unref (message);
-}
-
-static void
-test_path_matching (void)
-{
- BusMatchRule *rule;
- const char **s;
-
- rule = check_parse (TRUE, PATH_MATCH_RULE);
- _dbus_assert (rule != NULL);
-
- for (s = paths_that_should_be_matched; *s != NULL; s++)
- test_path_match (DBUS_TYPE_STRING, *s, PATH_MATCH_RULE, rule, TRUE);
-
- for (s = paths_that_should_be_matched + FIRST_VALID_PATH_WHICH_SHOULD_MATCH;
- *s != NULL; s++)
- test_path_match (DBUS_TYPE_OBJECT_PATH, *s, PATH_MATCH_RULE, rule, TRUE);
-
- for (s = paths_that_should_not_be_matched; *s != NULL; s++)
- {
- test_path_match (DBUS_TYPE_STRING, *s, PATH_MATCH_RULE, rule, FALSE);
- test_path_match (DBUS_TYPE_OBJECT_PATH, *s, PATH_MATCH_RULE, rule, FALSE);
- }
-
- bus_match_rule_unref (rule);
-}
-
-static const char*
-path_namespace_should_match_message_1[] = {
- "type='signal',path_namespace='/'",
- "type='signal',path_namespace='/foo'",
- "type='signal',path_namespace='/foo/TheObjectManager'",
- NULL
-};
-
-static const char*
-path_namespace_should_not_match_message_1[] = {
- "type='signal',path_namespace='/bar'",
- "type='signal',path_namespace='/bar/TheObjectManager'",
- NULL
-};
-
-static const char*
-path_namespace_should_match_message_2[] = {
- "type='signal',path_namespace='/'",
- "type='signal',path_namespace='/foo/TheObjectManager'",
- NULL
-};
-
-static const char*
-path_namespace_should_not_match_message_2[] = {
- NULL
-};
-
-static const char*
-path_namespace_should_match_message_3[] = {
- "type='signal',path_namespace='/'",
- NULL
-};
-
-static const char*
-path_namespace_should_not_match_message_3[] = {
- "type='signal',path_namespace='/foo/TheObjectManager'",
- NULL
-};
-
-static const char*
-path_namespace_should_match_message_4[] = {
- "type='signal',path_namespace='/'",
- NULL
-};
-
-static const char*
-path_namespace_should_not_match_message_4[] = {
- "type='signal',path_namespace='/foo/TheObjectManager'",
- NULL
-};
-
-static void
-test_matching_path_namespace (void)
-{
- DBusMessage *message1;
- DBusMessage *message2;
- DBusMessage *message3;
- DBusMessage *message4;
-
- message1 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message1 != NULL);
- if (!dbus_message_set_path (message1, "/foo/TheObjectManager"))
- _dbus_assert_not_reached ("oom");
-
- message2 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message2 != NULL);
- if (!dbus_message_set_path (message2, "/foo/TheObjectManager/child_object"))
- _dbus_assert_not_reached ("oom");
-
- message3 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message3 != NULL);
- if (!dbus_message_set_path (message3, "/foo/TheObjectManagerOther"))
- _dbus_assert_not_reached ("oom");
-
- message4 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
- _dbus_assert (message4 != NULL);
- if (!dbus_message_set_path (message4, "/"))
- _dbus_assert_not_reached ("oom");
-
- check_matching (message1, 1,
- path_namespace_should_match_message_1,
- path_namespace_should_not_match_message_1);
- check_matching (message2, 2,
- path_namespace_should_match_message_2,
- path_namespace_should_not_match_message_2);
- check_matching (message3, 3,
- path_namespace_should_match_message_3,
- path_namespace_should_not_match_message_3);
- check_matching (message4, 4,
- path_namespace_should_match_message_4,
- path_namespace_should_not_match_message_4);
-
- dbus_message_unref (message4);
- dbus_message_unref (message3);
- dbus_message_unref (message2);
- dbus_message_unref (message1);
-}
-
-dbus_bool_t
-bus_signals_test (const DBusString *test_data_dir)
-{
- BusMatchmaker *matchmaker;
-
- matchmaker = bus_matchmaker_new ();
- bus_matchmaker_ref (matchmaker);
- bus_matchmaker_unref (matchmaker);
- bus_matchmaker_unref (matchmaker);
-
- if (!_dbus_test_oom_handling ("parsing match rules", test_parsing, NULL))
- _dbus_assert_not_reached ("Parsing match rules test failed");
-
- test_equality ();
- test_matching ();
- test_path_matching ();
- test_matching_path_namespace ();
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/signals.h b/src/3rd_party/dbus-1.7.8/bus/signals.h
deleted file mode 100644
index a71d2e45e3..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/signals.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* signals.h Bus signal connection implementation
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_SIGNALS_H
-#define BUS_SIGNALS_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-#include "connection.h"
-
-typedef enum
-{
- BUS_MATCH_MESSAGE_TYPE = 1 << 0,
- BUS_MATCH_INTERFACE = 1 << 1,
- BUS_MATCH_MEMBER = 1 << 2,
- BUS_MATCH_SENDER = 1 << 3,
- BUS_MATCH_DESTINATION = 1 << 4,
- BUS_MATCH_PATH = 1 << 5,
- BUS_MATCH_ARGS = 1 << 6,
- BUS_MATCH_PATH_NAMESPACE = 1 << 7,
- BUS_MATCH_CLIENT_IS_EAVESDROPPING = 1 << 8
-} BusMatchFlags;
-
-BusMatchRule* bus_match_rule_new (DBusConnection *matches_go_to);
-BusMatchRule* bus_match_rule_ref (BusMatchRule *rule);
-void bus_match_rule_unref (BusMatchRule *rule);
-
-dbus_bool_t bus_match_rule_set_message_type (BusMatchRule *rule,
- int type);
-dbus_bool_t bus_match_rule_set_interface (BusMatchRule *rule,
- const char *interface);
-dbus_bool_t bus_match_rule_set_member (BusMatchRule *rule,
- const char *member);
-dbus_bool_t bus_match_rule_set_sender (BusMatchRule *rule,
- const char *sender);
-dbus_bool_t bus_match_rule_set_destination (BusMatchRule *rule,
- const char *destination);
-dbus_bool_t bus_match_rule_set_path (BusMatchRule *rule,
- const char *path,
- dbus_bool_t is_namespace);
-dbus_bool_t bus_match_rule_set_arg (BusMatchRule *rule,
- int arg,
- const DBusString *value,
- dbus_bool_t is_path,
- dbus_bool_t is_namespace);
-
-/* Calling this methods a client declares that it is creating a rule which
- * needs to eavesdrop (e.g., dbus-monitor), any other created rules not
- * setting themselves as eavesdropping won't receive any message not addressed
- * to them, when eavedrop is enabled in the policy. On the other hand, when
- * eavedrop is not enabled in policy, this method won't have any effect */
-void bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule,
- dbus_bool_t is_eavesdropping);
-
-BusMatchRule* bus_match_rule_parse (DBusConnection *matches_go_to,
- const DBusString *rule_text,
- DBusError *error);
-
-BusMatchmaker* bus_matchmaker_new (void);
-BusMatchmaker* bus_matchmaker_ref (BusMatchmaker *matchmaker);
-void bus_matchmaker_unref (BusMatchmaker *matchmaker);
-
-dbus_bool_t bus_matchmaker_add_rule (BusMatchmaker *matchmaker,
- BusMatchRule *rule);
-dbus_bool_t bus_matchmaker_remove_rule_by_value (BusMatchmaker *matchmaker,
- BusMatchRule *value,
- DBusError *error);
-void bus_matchmaker_remove_rule (BusMatchmaker *matchmaker,
- BusMatchRule *rule);
-void bus_matchmaker_disconnected (BusMatchmaker *matchmaker,
- DBusConnection *connection);
-dbus_bool_t bus_matchmaker_get_recipients (BusMatchmaker *matchmaker,
- BusConnections *connections,
- DBusConnection *sender,
- DBusConnection *addressed_recipient,
- DBusMessage *message,
- DBusList **recipients_p);
-
-#endif /* BUS_SIGNALS_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/stats.c b/src/3rd_party/dbus-1.7.8/bus/stats.c
deleted file mode 100644
index ec768ec79f..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/stats.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* stats.c - statistics from the bus driver
- *
- * Copyright © 2011-2012 Nokia Corporation
- * Copyright © 2012-2013 Collabora Ltd.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#include <config.h>
-#include "stats.h"
-
-#include <dbus/dbus-asv-util.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-connection-internal.h>
-
-#include "connection.h"
-#include "services.h"
-#include "utils.h"
-
-#ifdef DBUS_ENABLE_STATS
-
-dbus_bool_t
-bus_stats_handle_get_stats (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- BusConnections *connections;
- DBusMessage *reply = NULL;
- DBusMessageIter iter, arr_iter;
- static dbus_uint32_t stats_serial = 0;
- dbus_uint32_t in_use, in_free_list, allocated;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- connections = bus_transaction_get_connections (transaction);
-
- reply = _dbus_asv_new_method_return (message, &iter, &arr_iter);
-
- if (reply == NULL)
- goto oom;
-
- /* Globals */
-
- _dbus_list_get_stats (&in_use, &in_free_list, &allocated);
-
- if (!_dbus_asv_add_uint32 (&arr_iter, "Serial", stats_serial++) ||
- !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolUsedBytes", in_use) ||
- !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolCachedBytes", in_free_list) ||
- !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolAllocatedBytes", allocated))
- {
- _dbus_asv_abandon (&iter, &arr_iter);
- goto oom;
- }
-
- /* Connections */
-
- if (!_dbus_asv_add_uint32 (&arr_iter, "ActiveConnections",
- bus_connections_get_n_active (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "IncompleteConnections",
- bus_connections_get_n_incomplete (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "MatchRules",
- bus_connections_get_total_match_rules (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRules",
- bus_connections_get_peak_match_rules (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRulesPerConnection",
- bus_connections_get_peak_match_rules_per_conn (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "BusNames",
- bus_connections_get_total_bus_names (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNames",
- bus_connections_get_peak_bus_names (connections)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNamesPerConnection",
- bus_connections_get_peak_bus_names_per_conn (connections)))
- {
- _dbus_asv_abandon (&iter, &arr_iter);
- goto oom;
- }
-
- /* end */
-
- if (!_dbus_asv_close (&iter, &arr_iter))
- goto oom;
-
- if (!bus_transaction_send_from_driver (transaction, connection, reply))
- goto oom;
-
- dbus_message_unref (reply);
- return TRUE;
-
-oom:
- if (reply != NULL)
- dbus_message_unref (reply);
-
- BUS_SET_OOM (error);
- return FALSE;
-}
-
-dbus_bool_t
-bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
-{
- const char *bus_name = NULL;
- DBusString bus_name_str;
- DBusMessage *reply = NULL;
- DBusMessageIter iter, arr_iter;
- static dbus_uint32_t stats_serial = 0;
- dbus_uint32_t in_messages, in_bytes, in_fds, in_peak_bytes, in_peak_fds;
- dbus_uint32_t out_messages, out_bytes, out_fds, out_peak_bytes, out_peak_fds;
- BusRegistry *registry;
- BusService *service;
- DBusConnection *stats_connection;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- registry = bus_connection_get_registry (caller_connection);
-
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &bus_name,
- DBUS_TYPE_INVALID))
- return FALSE;
-
- _dbus_string_init_const (&bus_name_str, bus_name);
- service = bus_registry_lookup (registry, &bus_name_str);
-
- if (service == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Bus name '%s' has no owner", bus_name);
- return FALSE;
- }
-
- stats_connection = bus_service_get_primary_owners_connection (service);
- _dbus_assert (stats_connection != NULL);
-
- reply = _dbus_asv_new_method_return (message, &iter, &arr_iter);
-
- if (reply == NULL)
- goto oom;
-
- /* Bus daemon per-connection stats */
-
- if (!_dbus_asv_add_uint32 (&arr_iter, "Serial", stats_serial++) ||
- !_dbus_asv_add_uint32 (&arr_iter, "MatchRules",
- bus_connection_get_n_match_rules (stats_connection)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRules",
- bus_connection_get_peak_match_rules (stats_connection)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "BusNames",
- bus_connection_get_n_services_owned (stats_connection)) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNames",
- bus_connection_get_peak_bus_names (stats_connection)) ||
- !_dbus_asv_add_string (&arr_iter, "UniqueName",
- bus_connection_get_name (stats_connection)))
- {
- _dbus_asv_abandon (&iter, &arr_iter);
- goto oom;
- }
-
- /* DBusConnection per-connection stats */
-
- _dbus_connection_get_stats (stats_connection,
- &in_messages, &in_bytes, &in_fds,
- &in_peak_bytes, &in_peak_fds,
- &out_messages, &out_bytes, &out_fds,
- &out_peak_bytes, &out_peak_fds);
-
- if (!_dbus_asv_add_uint32 (&arr_iter, "IncomingMessages", in_messages) ||
- !_dbus_asv_add_uint32 (&arr_iter, "IncomingBytes", in_bytes) ||
- !_dbus_asv_add_uint32 (&arr_iter, "IncomingFDs", in_fds) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakIncomingBytes", in_peak_bytes) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakIncomingFDs", in_peak_fds) ||
- !_dbus_asv_add_uint32 (&arr_iter, "OutgoingMessages", out_messages) ||
- !_dbus_asv_add_uint32 (&arr_iter, "OutgoingBytes", out_bytes) ||
- !_dbus_asv_add_uint32 (&arr_iter, "OutgoingFDs", out_fds) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakOutgoingBytes", out_peak_bytes) ||
- !_dbus_asv_add_uint32 (&arr_iter, "PeakOutgoingFDs", out_peak_fds))
- {
- _dbus_asv_abandon (&iter, &arr_iter);
- goto oom;
- }
-
- /* end */
-
- if (!_dbus_asv_close (&iter, &arr_iter))
- goto oom;
-
- if (!bus_transaction_send_from_driver (transaction, caller_connection,
- reply))
- goto oom;
-
- dbus_message_unref (reply);
- return TRUE;
-
-oom:
- if (reply != NULL)
- dbus_message_unref (reply);
-
- BUS_SET_OOM (error);
- return FALSE;
-}
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/bus/stats.h b/src/3rd_party/dbus-1.7.8/bus/stats.h
deleted file mode 100644
index 0f843db59e..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/stats.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* stats.h - statistics from the bus driver
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#ifndef BUS_STATS_H
-#define BUS_STATS_H
-
-#include "bus.h"
-
-#define BUS_INTERFACE_STATS "org.freedesktop.DBus.Debug.Stats"
-
-dbus_bool_t bus_stats_handle_get_stats (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error);
-
-dbus_bool_t bus_stats_handle_get_connection_stats (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error);
-
-#endif /* multiple-inclusion guard */
diff --git a/src/3rd_party/dbus-1.7.8/bus/system.conf.in b/src/3rd_party/dbus-1.7.8/bus/system.conf.in
deleted file mode 100644
index 92f4cc420f..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/system.conf.in
+++ /dev/null
@@ -1,83 +0,0 @@
-<!-- This configuration file controls the systemwide message bus.
- Add a system-local.conf and edit that rather than changing this
- file directly. -->
-
-<!-- Note that there are any number of ways you can hose yourself
- security-wise by screwing up this file; in particular, you
- probably don't want to listen on any more addresses, add any more
- auth mechanisms, run as a different user, etc. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-
- <!-- Our well-known bus type, do not change this -->
- <type>system</type>
-
- <!-- Run as special user -->
- <user>@DBUS_USER@</user>
-
- <!-- Fork into daemon mode -->
- <fork/>
-
- <!-- We use system service launching using a helper -->
- <standard_system_servicedirs/>
-
- <!-- This is a setuid helper that is used to launch system services -->
- <servicehelper>@DBUS_LIBEXECDIR@/dbus-daemon-launch-helper</servicehelper>
-
- <!-- Write a pid file -->
- <pidfile>@DBUS_SYSTEM_PID_FILE@</pidfile>
-
- <!-- Enable logging to syslog -->
- <syslog/>
-
- <!-- Only allow socket-credentials-based authentication -->
- <auth>EXTERNAL</auth>
-
- <!-- Only listen on a local socket. (abstract=/path/to/socket
- means use abstract namespace, don't really create filesystem
- file; only Linux supports this. Use path=/whatever on other
- systems.) -->
- <listen>@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@</listen>
-
- <policy context="default">
- <!-- All users can connect to system bus -->
- <allow user="*"/>
-
- <!-- Holes must be punched in service configuration files for
- name ownership and sending method calls -->
- <deny own="*"/>
- <deny send_type="method_call"/>
-
- <!-- Signals and reply messages (method returns, errors) are allowed
- by default -->
- <allow send_type="signal"/>
- <allow send_requested_reply="true" send_type="method_return"/>
- <allow send_requested_reply="true" send_type="error"/>
-
- <!-- All messages may be received by default -->
- <allow receive_type="method_call"/>
- <allow receive_type="method_return"/>
- <allow receive_type="error"/>
- <allow receive_type="signal"/>
-
- <!-- Allow anyone to talk to the message bus -->
- <allow send_destination="org.freedesktop.DBus"/>
- <!-- But disallow some specific bus services -->
- <deny send_destination="org.freedesktop.DBus"
- send_interface="org.freedesktop.DBus"
- send_member="UpdateActivationEnvironment"/>
- </policy>
-
- <!-- Config files are placed here that among other things, punch
- holes in the above policy for specific services. -->
- <includedir>system.d</includedir>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
- <include ignore_missing="yes">system-local.conf</include>
-
- <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/bus/test-launch-helper.c b/src/3rd_party/dbus-1.7.8/bus/test-launch-helper.c
deleted file mode 100644
index e9ba412ac3..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/test-launch-helper.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* test-main.c main() for the OOM check of the launch helper
- *
- * Copyright (C) 2007 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "test.h"
-#include "activation-helper.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-misc.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static void
-die (const char *failure)
-{
- fprintf (stderr, "Unit test failed: %s\n", failure);
- exit (1);
-}
-
-static void
-check_memleaks (const char *name)
-{
- dbus_shutdown ();
-
- printf ("%s: checking for memleaks\n", name);
- if (_dbus_get_malloc_blocks_outstanding () != 0)
- {
- _dbus_warn ("%d dbus_malloc blocks were not freed\n",
- _dbus_get_malloc_blocks_outstanding ());
- die ("memleaks");
- }
-}
-
-static void
-test_post_hook (const char *name)
-{
- check_memleaks (name);
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-
-#ifdef ACTIVATION_LAUNCHER_DO_OOM
-
-/* returns true if good things happen, or if we get OOM */
-static dbus_bool_t
-bus_activation_helper_oom_test (void *data)
-{
- const char *service;
- DBusError error;
- dbus_bool_t retval;
-
- service = (const char *) data;
- retval = TRUE;
-
- dbus_error_init (&error);
- if (!run_launch_helper (service, &error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- /* we failed, but a OOM is good */
- if (!dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- _dbus_warn ("FAILED SELF TEST: Error: %s\n", error.message);
- retval = FALSE;
- }
- dbus_error_free (&error);
- }
- else
- {
- /* we succeeded, yay! */
- _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
- }
- return retval;
-}
-
-#endif
-
-int
-main (int argc, char **argv)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- const char *dir;
- DBusString config_file;
-
- if (argc > 1)
- dir = argv[1];
- else
- dir = _dbus_getenv ("DBUS_TEST_DATA");
-
- if (dir == NULL)
- {
- fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
- return 1;
- }
-
- printf ("%s: Running launch helper OOM checks\n", argv[0]);
-
- if (!_dbus_string_init (&config_file))
- return 1;
- if (!_dbus_string_append (&config_file, dir))
- return 1;
- if (!_dbus_string_append (&config_file, "/valid-config-files-system/debug-allow-all-pass.conf"))
- return 1;
-
- /* use a config file that will actually work... */
- dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG",
- _dbus_string_get_const_data (&config_file));
-
- _dbus_string_free (&config_file);
-
- if (!_dbus_test_oom_handling ("dbus-daemon-launch-helper",
- bus_activation_helper_oom_test,
- "org.freedesktop.DBus.TestSuiteEchoService"))
- die ("OOM failed");
-
- test_post_hook (argv[0]);
-
- printf ("%s: Success\n", argv[0]);
-
- return 0;
-#else /* DBUS_ENABLE_EMBEDDED_TESTS */
-
- printf ("Not compiled with test support\n");
-
- return 0;
-#endif
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/bus/test-main.c b/src/3rd_party/dbus-1.7.8/bus/test-main.c
deleted file mode 100644
index 01d228704c..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/test-main.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* test-main.c main() for make check
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-message-internal.h>
-#include "selinux.h"
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static void
-die (const char *failure)
-{
- fprintf (stderr, "Unit test failed: %s\n", failure);
- exit (1);
-}
-
-static void
-check_memleaks (const char *name)
-{
- dbus_shutdown ();
-
- printf ("%s: checking for memleaks\n", name);
- if (_dbus_get_malloc_blocks_outstanding () != 0)
- {
- _dbus_warn ("%d dbus_malloc blocks were not freed\n",
- _dbus_get_malloc_blocks_outstanding ());
- die ("memleaks");
- }
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-static DBusInitialFDs *initial_fds = NULL;
-
-static void
-test_pre_hook (void)
-{
-
- if (_dbus_getenv ("DBUS_TEST_SELINUX")
- && (!bus_selinux_pre_init ()
- || !bus_selinux_full_init ()))
- die ("could not init selinux support");
-
- initial_fds = _dbus_check_fdleaks_enter ();
-}
-
-static char *progname = "";
-
-static void
-test_post_hook (void)
-{
- if (_dbus_getenv ("DBUS_TEST_SELINUX"))
- bus_selinux_shutdown ();
- check_memleaks (progname);
-
- _dbus_check_fdleaks_leave (initial_fds);
- initial_fds = NULL;
-}
-
-int
-main (int argc, char **argv)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- const char *dir;
- const char *only;
- DBusString test_data_dir;
-
- progname = argv[0];
-
- if (argc > 1)
- dir = argv[1];
- else
- dir = _dbus_getenv ("DBUS_TEST_DATA");
-
- if (argc > 2)
- only = argv[2];
- else
- only = NULL;
-
- if (dir == NULL)
- {
- fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
- return 1;
- }
-
- _dbus_string_init_const (&test_data_dir, dir);
-
- if (!_dbus_threads_init_debug ())
- die ("initializing debug threads");
-
- if (only == NULL || strcmp (only, "expire-list") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running expire list test\n", argv[0]);
- if (!bus_expire_list_test (&test_data_dir))
- die ("expire list");
- test_post_hook ();
- }
-
- if (only == NULL || strcmp (only, "config-parser") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running config file parser test\n", argv[0]);
- if (!bus_config_parser_test (&test_data_dir))
- die ("parser");
- test_post_hook ();
- }
-
- if (only == NULL || strcmp (only, "signals") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running signals test\n", argv[0]);
- if (!bus_signals_test (&test_data_dir))
- die ("signals");
- test_post_hook ();
- }
-
- if (only == NULL || strcmp (only, "dispatch-sha1") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running SHA1 connection test\n", argv[0]);
- if (!bus_dispatch_sha1_test (&test_data_dir))
- die ("sha1");
- test_post_hook ();
- }
-
- if (only == NULL || strcmp (only, "dispatch") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running message dispatch test\n", argv[0]);
- if (!bus_dispatch_test (&test_data_dir))
- die ("dispatch");
- test_post_hook ();
- }
-
- if (only == NULL || strcmp (only, "activation-service-reload") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running service files reloading test\n", argv[0]);
- if (!bus_activation_service_reload_test (&test_data_dir))
- die ("service reload");
- test_post_hook ();
- }
-
-#ifdef HAVE_UNIX_FD_PASSING
- if (only == NULL || strcmp (only, "unix-fds-passing") == 0)
- {
- test_pre_hook ();
- printf ("%s: Running unix fd passing test\n", argv[0]);
- if (!bus_unix_fds_passing_test (&test_data_dir))
- die ("unix fd passing");
- test_post_hook ();
- }
-#endif
-
- printf ("%s: Success\n", argv[0]);
-
-
- return 0;
-#else /* DBUS_ENABLE_EMBEDDED_TESTS */
-
- printf ("Not compiled with test support\n");
-
- return 0;
-#endif
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/test-system.c b/src/3rd_party/dbus-1.7.8/bus/test-system.c
deleted file mode 100644
index 5f02d0ab42..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/test-system.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* test-main.c main() for make check
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-internals.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static void
-die (const char *failure)
-{
- fprintf (stderr, "Unit test failed: %s\n", failure);
- exit (1);
-}
-
-static void
-check_memleaks (const char *name)
-{
- dbus_shutdown ();
-
- printf ("%s: checking for memleaks\n", name);
- if (_dbus_get_malloc_blocks_outstanding () != 0)
- {
- _dbus_warn ("%d dbus_malloc blocks were not freed\n",
- _dbus_get_malloc_blocks_outstanding ());
- die ("memleaks");
- }
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-static void
-test_pre_hook (void)
-{
-}
-
-static char *progname = "";
-static void
-test_post_hook (void)
-{
- check_memleaks (progname);
-}
-
-int
-main (int argc, char **argv)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- const char *dir;
- DBusString test_data_dir;
-
- progname = argv[0];
-
- if (argc > 1)
- dir = argv[1];
- else
- dir = _dbus_getenv ("DBUS_TEST_DATA");
-
- if (dir == NULL)
- {
- fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
- return 1;
- }
-
- _dbus_string_init_const (&test_data_dir, dir);
-
- if (!_dbus_threads_init_debug ())
- die ("initializing debug threads");
-
- test_pre_hook ();
- printf ("%s: Running config file parser (trivial) test\n", argv[0]);
- if (!bus_config_parser_trivial_test (&test_data_dir))
- die ("parser");
- test_post_hook ();
-
- printf ("%s: Success\n", argv[0]);
-
- return 0;
-#else /* DBUS_ENABLE_EMBEDDED_TESTS */
-
- printf ("Not compiled with test support\n");
-
- return 0;
-#endif
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/test.c b/src/3rd_party/dbus-1.7.8/bus/test.c
deleted file mode 100644
index 31ef4c8fc6..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/test.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* test.c unit test routines
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "test.h"
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-sysdeps.h>
-
-/* The "debug client" watch/timeout handlers don't dispatch messages,
- * as we manually pull them in order to verify them. This is why they
- * are different from the real handlers in connection.c
- */
-static DBusList *clients = NULL;
-static DBusLoop *client_loop = NULL;
-
-static dbus_bool_t
-add_client_watch (DBusWatch *watch,
- void *data)
-{
- return _dbus_loop_add_watch (client_loop, watch);
-}
-
-static void
-remove_client_watch (DBusWatch *watch,
- void *data)
-{
- _dbus_loop_remove_watch (client_loop, watch);
-}
-
-static void
-toggle_client_watch (DBusWatch *watch,
- void *data)
-{
- _dbus_loop_toggle_watch (client_loop, watch);
-}
-
-static dbus_bool_t
-add_client_timeout (DBusTimeout *timeout,
- void *data)
-{
- return _dbus_loop_add_timeout (client_loop, timeout);
-}
-
-static void
-remove_client_timeout (DBusTimeout *timeout,
- void *data)
-{
- _dbus_loop_remove_timeout (client_loop, timeout);
-}
-
-static DBusHandlerResult
-client_disconnect_filter (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- if (!dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- _dbus_verbose ("Removing client %p in disconnect handler\n",
- connection);
-
- _dbus_list_remove (&clients, connection);
-
- dbus_connection_unref (connection);
-
- if (clients == NULL)
- {
- _dbus_loop_unref (client_loop);
- client_loop = NULL;
- }
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-dbus_bool_t
-bus_setup_debug_client (DBusConnection *connection)
-{
- dbus_bool_t retval;
-
- if (!dbus_connection_add_filter (connection,
- client_disconnect_filter,
- NULL, NULL))
- return FALSE;
-
- retval = FALSE;
-
- if (client_loop == NULL)
- {
- client_loop = _dbus_loop_new ();
- if (client_loop == NULL)
- goto out;
- }
-
- if (!dbus_connection_set_watch_functions (connection,
- add_client_watch,
- remove_client_watch,
- toggle_client_watch,
- connection,
- NULL))
- goto out;
-
- if (!dbus_connection_set_timeout_functions (connection,
- add_client_timeout,
- remove_client_timeout,
- NULL,
- connection, NULL))
- goto out;
-
- if (!_dbus_list_append (&clients, connection))
- goto out;
-
- retval = TRUE;
-
- out:
- if (!retval)
- {
- dbus_connection_remove_filter (connection,
- client_disconnect_filter,
- NULL);
-
- dbus_connection_set_watch_functions (connection,
- NULL, NULL, NULL, NULL, NULL);
- dbus_connection_set_timeout_functions (connection,
- NULL, NULL, NULL, NULL, NULL);
-
- _dbus_list_remove_last (&clients, connection);
-
- if (clients == NULL)
- {
- _dbus_loop_unref (client_loop);
- client_loop = NULL;
- }
- }
-
- return retval;
-}
-
-void
-bus_test_clients_foreach (BusConnectionForeachFunction function,
- void *data)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&clients);
- while (link != NULL)
- {
- DBusConnection *connection = link->data;
- DBusList *next = _dbus_list_get_next_link (&clients, link);
-
- if (!(* function) (connection, data))
- break;
-
- link = next;
- }
-}
-
-dbus_bool_t
-bus_test_client_listed (DBusConnection *connection)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&clients);
- while (link != NULL)
- {
- DBusConnection *c = link->data;
- DBusList *next = _dbus_list_get_next_link (&clients, link);
-
- if (c == connection)
- return TRUE;
-
- link = next;
- }
-
- return FALSE;
-}
-
-void
-bus_test_run_clients_loop (dbus_bool_t block_once)
-{
- if (client_loop == NULL)
- return;
-
- _dbus_verbose ("---> Dispatching on \"client side\"\n");
-
- /* dispatch before we block so pending dispatches
- * won't make our block return early
- */
- _dbus_loop_dispatch (client_loop);
-
- /* Do one blocking wait, since we're expecting data */
- if (block_once)
- {
- _dbus_verbose ("---> blocking on \"client side\"\n");
- _dbus_loop_iterate (client_loop, TRUE);
- }
-
- /* Then mop everything up */
- while (_dbus_loop_iterate (client_loop, FALSE))
- ;
-
- _dbus_verbose ("---> Done dispatching on \"client side\"\n");
-}
-
-void
-bus_test_run_bus_loop (BusContext *context,
- dbus_bool_t block_once)
-{
- _dbus_verbose ("---> Dispatching on \"server side\"\n");
-
- /* dispatch before we block so pending dispatches
- * won't make our block return early
- */
- _dbus_loop_dispatch (bus_context_get_loop (context));
-
- /* Do one blocking wait, since we're expecting data */
- if (block_once)
- {
- _dbus_verbose ("---> blocking on \"server side\"\n");
- _dbus_loop_iterate (bus_context_get_loop (context), TRUE);
- }
-
- /* Then mop everything up */
- while (_dbus_loop_iterate (bus_context_get_loop (context), FALSE))
- ;
-
- _dbus_verbose ("---> Done dispatching on \"server side\"\n");
-}
-
-void
-bus_test_run_everything (BusContext *context)
-{
- while (_dbus_loop_iterate (bus_context_get_loop (context), FALSE) ||
- (client_loop == NULL || _dbus_loop_iterate (client_loop, FALSE)))
- ;
-}
-
-BusContext*
-bus_context_new_test (const DBusString *test_data_dir,
- const char *filename)
-{
- DBusError error;
- DBusString config_file;
- DBusString relative;
- BusContext *context;
-
- if (!_dbus_string_init (&config_file))
- {
- _dbus_warn ("No memory\n");
- return NULL;
- }
-
- if (!_dbus_string_copy (test_data_dir, 0,
- &config_file, 0))
- {
- _dbus_warn ("No memory\n");
- _dbus_string_free (&config_file);
- return NULL;
- }
-
- _dbus_string_init_const (&relative, filename);
-
- if (!_dbus_concat_dir_and_file (&config_file, &relative))
- {
- _dbus_warn ("No memory\n");
- _dbus_string_free (&config_file);
- return NULL;
- }
-
- dbus_error_init (&error);
- context = bus_context_new (&config_file, BUS_CONTEXT_FLAG_NONE, NULL, NULL, NULL, &error);
- if (context == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
-
- _dbus_warn ("Failed to create debug bus context from configuration file %s: %s\n",
- filename, error.message);
-
- dbus_error_free (&error);
-
- _dbus_string_free (&config_file);
-
- return NULL;
- }
-
- _dbus_string_free (&config_file);
-
- return context;
-}
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/bus/test.h b/src/3rd_party/dbus-1.7.8/bus/test.h
deleted file mode 100644
index 38b74e89cf..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/test.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* test.h unit test routines
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_TEST_H
-#define BUS_TEST_H
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-string.h>
-#include "connection.h"
-
-dbus_bool_t bus_dispatch_test (const DBusString *test_data_dir);
-dbus_bool_t bus_dispatch_sha1_test (const DBusString *test_data_dir);
-dbus_bool_t bus_config_parser_test (const DBusString *test_data_dir);
-dbus_bool_t bus_config_parser_trivial_test (const DBusString *test_data_dir);
-dbus_bool_t bus_signals_test (const DBusString *test_data_dir);
-dbus_bool_t bus_expire_list_test (const DBusString *test_data_dir);
-dbus_bool_t bus_activation_service_reload_test (const DBusString *test_data_dir);
-dbus_bool_t bus_setup_debug_client (DBusConnection *connection);
-void bus_test_clients_foreach (BusConnectionForeachFunction function,
- void *data);
-dbus_bool_t bus_test_client_listed (DBusConnection *connection);
-void bus_test_run_bus_loop (BusContext *context,
- dbus_bool_t block);
-void bus_test_run_clients_loop (dbus_bool_t block);
-void bus_test_run_everything (BusContext *context);
-BusContext* bus_context_new_test (const DBusString *test_data_dir,
- const char *filename);
-
-#ifdef HAVE_UNIX_FD_PASSING
-dbus_bool_t bus_unix_fds_passing_test (const DBusString *test_data_dir);
-#endif
-
-#endif
-
-#endif /* BUS_TEST_H */
diff --git a/src/3rd_party/dbus-1.7.8/bus/utils.c b/src/3rd_party/dbus-1.7.8/bus/utils.c
deleted file mode 100644
index 7d24872741..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/utils.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* utils.c General utility functions
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "utils.h"
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-mainloop.h>
-
-const char bus_no_memory_message[] = "Memory allocation failure in message bus";
-
-void
-bus_connection_dispatch_all_messages (DBusConnection *connection)
-{
- while (bus_connection_dispatch_one_message (connection))
- ;
-}
-
-dbus_bool_t
-bus_connection_dispatch_one_message (DBusConnection *connection)
-{
- DBusDispatchStatus status;
-
- while ((status = dbus_connection_dispatch (connection)) == DBUS_DISPATCH_NEED_MEMORY)
- _dbus_wait_for_memory ();
-
- return status == DBUS_DISPATCH_DATA_REMAINS;
-}
diff --git a/src/3rd_party/dbus-1.7.8/bus/utils.h b/src/3rd_party/dbus-1.7.8/bus/utils.h
deleted file mode 100644
index f533895ff2..0000000000
--- a/src/3rd_party/dbus-1.7.8/bus/utils.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* utils.h General utility functions
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef BUS_UTILS_H
-#define BUS_UTILS_H
-
-#include <dbus/dbus.h>
-
-extern const char bus_no_memory_message[];
-#define BUS_SET_OOM(error) dbus_set_error_const ((error), DBUS_ERROR_NO_MEMORY, bus_no_memory_message)
-
-void bus_connection_dispatch_all_messages (DBusConnection *connection);
-dbus_bool_t bus_connection_dispatch_one_message (DBusConnection *connection);
-
-#endif /* BUS_UTILS_H */
diff --git a/src/3rd_party/dbus-1.7.8/cleanup-man-pages.sh b/src/3rd_party/dbus-1.7.8/cleanup-man-pages.sh
deleted file mode 100755
index 23e98a661e..0000000000
--- a/src/3rd_party/dbus-1.7.8/cleanup-man-pages.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh
-
-## This script cleans up private/internal API from the man pages
-## generated by Doxygen. This brings the man pages down from 7 megs
-## to 2 megs and avoids namespace-polluting man pages. It's probably
-## pretty specific to GNU utilities. Patches gladly accepted to make
-## it work without them.
-
-## You would run this after building dbus and after running "doxygen
-## Doxyfile"
-
-die() {
- echo "$*" 1>&2
- exit 1
-}
-
-MANDIR=$1
-if test x"$MANDIR" = x ; then
- MANDIR=doc/api/man/man3dbus
-fi
-
-cd "$MANDIR" || die "Could not cd to $MANDIR"
-
-test -d keep || mkdir keep || die "Could not create $MANDIR/keep directory"
-test -d nuke || mkdir nuke || die "Could not create $MANDIR/nuke directory"
-
-## blacklist
-(find . -maxdepth 1 -name "_*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all underscore-prefixed items"
-(find . -maxdepth 1 -name "DBus*Internal*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all internal-containing items"
-(find . -maxdepth 1 -name "dbus_*_internal_*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all internal-containing items"
-
-## this is kind of unmaintainable, but I guess it's no huge disaster if we miss something.
-## this list should only contain man pages with >1 line, i.e. with real content; the
-## one-line cross-references get cleaned up next.
-for I in DBusCounter.* DBusCredentials.* DBusDataSlot.* DBusDataSlotAllocator.* DBusDataSlotList.* \
- DBusDirIter.* DBusFakeMutex.* DBusFreedElement.* DBusGroupInfo.* DBusGUID.* DBusHashEntry.* \
- DBusHashIter.* DBusHashTable.* DBusHeader.* DBusHeaderField.* DBusKey.* DBusKeyring.* DBusList.* \
- DBusMarshal.* DBusMD5* DBusMemBlock.* DBusMemPool.* DBusMessageGenerator.* DBusMessageLoader.* \
- DBusMessageRealIter.* DBusObjectSubtree.* DBusObjectTree.* DBusPollFD.* DBusReal* \
- DBusResources.* DBusServerDebugPipe.* DBusServerSocket.* DBusServerUnix.* \
- DBusServerVTable.* DBusSHA.* DBusSHAContext.* DBusSignatureRealIter.* DBusStat.* DBusString.* \
- DBusSysdeps.* DBusSysdepsUnix.* DBusTimeoutList.* DBusTransport* DBusTypeReader* DBusTypeWriter* \
- DBusUserInfo.* DBusWatchList.* ; do
- if test -f "$I" ; then
- /bin/mv "$I" nuke || die "could not move $I to $MANDIR/nuke"
- fi
-done
-
-## many files just contain ".so man3dbus/DBusStringInternals.3dbus" or the like,
-## if these point to something we nuked, we want to also nuke the pointer.
-for I in * ; do
- if test -f "$I" ; then
- LINES=`wc -l "$I" | cut -d ' ' -f 1`
- if test x"$LINES" = x1 ; then
- REF_TO=`cat "$I" | sed -e 's/\.so man3dbus\///g'`
- ## echo "$I points to $REF_TO"
- if ! test -f "$REF_TO" ; then
- /bin/mv "$I" nuke || die "could not move $I to $MANDIR/nuke"
- fi
- fi
- fi
-done
-
-## whitelist
-(find . -maxdepth 1 -name "dbus_*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all dbus-prefixed items"
-(find . -maxdepth 1 -name "DBUS_*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all DBUS_-prefixed items"
-(find . -maxdepth 1 -name "DBus*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all DBus-prefixed items"
-
-## everything else is assumed irrelevant, this is mostly struct fields
-## from the public headers
-(find . -maxdepth 1 -type f | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move remaining items"
-
-NUKE_COUNT=`find nuke -type f -name "*" | wc -l`
-KEEP_COUNT=`find keep -type f -name "*" | wc -l`
-MISSING_COUNT=`find . -maxdepth 1 -type f -name "*" | wc -l`
-
-echo "$KEEP_COUNT man pages kept and $NUKE_COUNT man pages to remove"
-echo "$MISSING_COUNT not handled"
-
-(find keep -type f -name "*" | xargs -I ITEMS /bin/mv ITEMS .) || die "could not move kept items back"
-
-rmdir keep || die "could not remove $MANDIR/keep"
-
-echo "Man pages to be installed are in $MANDIR and man pages to ignore are in $MANDIR/nuke"
-
-exit 0
diff --git a/src/3rd_party/dbus-1.7.8/cmake/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/CMakeLists.txt
deleted file mode 100644
index fe1119664b..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/CMakeLists.txt
+++ /dev/null
@@ -1,601 +0,0 @@
-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
-
-# we do not need to have WIN32 defined
-set(CMAKE_LEGACY_CYGWIN_WIN32 0)
-
-project(dbus)
-
-# we need to be up to date
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
-if(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
-
-
-# detect version
-include(MacrosAutotools)
-autoversion(../configure.ac dbus)
-# used by file version info
-set (DBUS_PATCH_VERSION "0")
-
-# set PACKAGE_... variables
-autopackage(
- dbus
- ${DBUS_VERSION_STRING}
- "http://dbus.freedesktop.org"
- "https://bugs.freedesktop.org/enter_bug.cgi?product=dbus"
-)
-
-include(Macros)
-TIMESTAMP(DBUS_BUILD_TIMESTAMP)
-
-########### basic vars ###############
-
-
-if (DBUSDIR)
- set(DBUS_INSTALL_DIR "${DBUSDIR}")
-endif (DBUSDIR)
-if ($ENV{DBUSDIR})
- set(DBUS_INSTALL_DIR "$ENV{DBUSDIR}")
-endif ($ENV{DBUSDIR})
-
-if (DBUS_INSTALL_DIR)
- set(CMAKE_INSTALL_PREFIX "${DBUS_INSTALL_DIR}" CACHE PATH "install prefix" FORCE)
-else (DBUS_INSTALL_DIR)
- set(DBUS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
-endif (DBUS_INSTALL_DIR)
-
-# autotools style
-if (NOT DATAROOTDIR)
- set (DATAROOTDIR share)
-endif()
-
-if (NOT DATADIR)
- set (DATADIR ${DATAROOTDIR})
-endif()
-
-if (NOT DOCDIR)
- SET(DOCDIR ${DATAROOTDIR}/doc/dbus)
-endif()
-
-if (NOT DBUS_DATADIR)
- SET(DBUS_DATADIR ${DATADIR})
-endif()
-
-set(prefix ${DBUS_INSTALL_DIR})
-set(exec_prefix ${prefix})
-set(EXPANDED_LIBDIR ${DBUS_INSTALL_DIR}/lib)
-set(EXPANDED_INCLUDEDIR ${DBUS_INSTALL_DIR}/include)
-set(EXPANDED_BINDIR ${DBUS_INSTALL_DIR}/bin)
-set(EXPANDED_SYSCONFDIR ${DBUS_INSTALL_DIR}/etc)
-set(EXPANDED_DATADIR ${DBUS_INSTALL_DIR}/${DBUS_DATADIR})
-set(DBUS_MACHINE_UUID_FILE ${DBUS_INSTALL_DIR}/lib/dbus/machine-id)
-set(DBUS_BINDIR ${EXPANDED_BINDIR})
-set(DBUS_DAEMONDIR ${EXPANDED_BINDIR})
-
-
-#enable building of shared library
-SET(BUILD_SHARED_LIBS ON)
-
-if(WIN32)
- set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "bin" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib")
-else()
- set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${EXPANDED_LIBDIR}" LIBRARY DESTINATION "${EXPANDED_LIBDIR}" ARCHIVE DESTINATION "${EXPANDED_LIBDIR}")
-endif()
-
-if (CYGWIN)
- set (WIN32)
-endif (CYGWIN)
-
-# search for required packages
-if (WIN32)
- # include local header first to avoid using old installed header
- set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/..)
- find_package(LibIconv)
- include(Win32Macros)
- addExplorerWrapper(${CMAKE_PROJECT_NAME})
-endif (WIN32)
-
-if(NOT WIN32)
- option (DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
- set (CMAKE_THREAD_PREFER_PTHREAD ON)
- include (FindThreads)
-endif(NOT WIN32)
-
-option (DBUS_DISABLE_ASSERT "Disable assertion checking" OFF)
-
-option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
-
-find_package(EXPAT)
-find_package(X11)
-
-# analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac
-add_definitions(-D_GNU_SOURCE)
-
-# do config checks
-INCLUDE(ConfigureChecks.cmake)
-
-# @TODO: how to remove last dir from ${CMAKE_SOURCE_DIR} ?
-SET(DBUS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/..)
-
-# make some more macros available
-include (MacroLibrary)
-
-if(VCS)
- set(DBUS_VERBOSE_C_S 1 CACHE STRING "verbose mode" FORCE)
-endif(VCS)
-
-if(WIN32)
- set(CMAKE_DEBUG_POSTFIX "d")
- if(MSVC)
- # controll folders in msvc projects
- include(ProjectSourceGroup)
- if(NOT GROUP_CODE)
- #set(GROUP_CODE split) #cmake default
- set(GROUP_CODE flat)
- endif(NOT GROUP_CODE)
- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
-
-
- # Use the highest warning level
- if (WALL)
- set(WALL 1 CACHE STRING "all warnings" FORCE)
- set(CMAKE_CXX_WARNING_LEVEL 4 CACHE STRING "warning level" FORCE)
-
- if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
- STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
- endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-
- if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
- STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- else(CMAKE_C_FLAGS MATCHES "/W[0-4]")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
- endif(CMAKE_C_FLAGS MATCHES "/W[0-4]")
- else (WALL)
- set(CMAKE_CXX_WARNING_LEVEL 3 CACHE STRING "warning level" FORCE)
- endif (WALL)
-
- SET(MSVC_W_ERROR " /we4028 /we4013 /we4133 /we4047 /we4031 /we4002 /we4003 /we4114")
- SET(MSVC_W_DISABLE " /wd4127 /wd4090 /wd4101 /wd4244")
-
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /FIconfig.h ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
- SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /FIconfig.h ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
- endif(MSVC)
-endif(WIN32)
-
-if (UNIX AND NOT DBUS_DISABLE_ASSERT)
- # required for backtrace
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wl,--export-dynamic")
- SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wl,--export-dynamic")
- add_definitions(-DDBUS_BUILT_R_DYNAMIC)
-endif (UNIX AND NOT DBUS_DISABLE_ASSERT)
-
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
-
-#########################################################################
-# Windows CE (>= 5.0.0)
-#
-# WinCE support now relies on the presence of platform files, found in cmake/modules/platform
-# Cmake 2.8.0 doesn't include WinCE platform files by default, but working ones can be found
-# on CMake's bugtracker :
-# http://public.kitware.com/Bug/view.php?id=7919
-#
-# for cmake 2.8.0 get the following patch only :
-# http://public.kitware.com/Bug/file_download.php?file_id=2944&type=bug
-#
-# after applying the patch, you can enable the WinCE build by specifying :
-# cmake [...] -DCMAKE_SYSTEM_NAME=WinCE -DCMAKE_SYSTEM_VERSION=X.XX
-# (where X.XX is your actual WinCE version, e.g. 5.02 for Windows Mobile 6)
-#
-# Note that you should have a proper cross-compilation environment set up prior to running
-# cmake, ie. the PATH, INCLUDE and LIB env vars pointing to your CE SDK/toolchain.
-#
-if(WINCE)
-
-MESSAGE("Building for WinCE (${CMAKE_SYSTEM_VERSION})")
-
-endif(WINCE)
-#########################################################################
-
-
-ENABLE_TESTING()
-
-#########################################################################
-# Disallow in-source build
-#macro_ensure_out_of_source_build("dbus requires an out of source build. Please create a separate build directory and run 'cmake path_to_dbus [options]' there.")
-
-# ... and warn in case of an earlier in-source build
-#set(generatedFileInSourceDir EXISTS ${dbus_SOURCE_DIR}/config.h)
-#if(${generatedFileInSourceDir})
-# message(STATUS "config.h exists in your source directory.")
-#endif(${generatedFileInSourceDir})
-#########################################################################
-
-if (WIN32 OR CYGWIN)
- set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
-else (WIN32 OR CYGWIN)
- set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
-endif (WIN32 OR CYGWIN)
-
-set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
-
-# for including config.h and for includes like <dir/foo.h>
-include_directories( ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR} ${CMAKE_INCLUDE_PATH} )
-
-# linker search directories
-link_directories(${DBUS_LIB_DIR} ${LIBRARY_OUTPUT_PATH} )
-include_directories( ${CMAKE_LIBRARY_PATH} )
-
-set(DBUS_INCLUDES)
-
-ENABLE_TESTING()
-
-########### command line options ###############
-# TODO: take check from configure.in
-
-option (DBUS_BUILD_TESTS "enable unit test code" ON)
-
-if(DBUS_BUILD_TESTS)
- set (DBUS_ENABLE_EMBEDDED_TESTS ON)
- set (DBUS_ENABLE_MODULAR_TESTS ON)
- add_definitions(-DDBUS_ENABLE_EMBEDDED_TESTS -DDBUS_ENABLE_MODULAR_TESTS)
-endif(DBUS_BUILD_TESTS)
-
-option (DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
-if(DBUS_USE_OUTPUT_DEBUG_STRING)
- add_definitions(-DDBUS_USE_OUTPUT_DEBUG_STRING)
-endif(DBUS_USE_OUTPUT_DEBUG_STRING)
-
-if(WIN32)
- # win32 dbus service support - this support is not complete
- option (DBUS_SERVICE "enable dbus service installer" OFF)
-endif(WIN32)
-
-option (DBUS_ENABLE_ANSI "enable -ansi -pedantic gcc flags" OFF)
-if(DBUS_ENABLE_ANSI)
- if(NOT MSVC)
- add_definitions(-ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic)
- else(NOT MSVC)
- add_definitions(-Za -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -W4)
- endif(NOT MSVC)
-endif(DBUS_ENABLE_ANSI)
-
-option (DBUS_ENABLE_VERBOSE_MODE "support verbose debug mode" ON)
-
-option (DBUS_DISABLE_CHECKS "Disable public API sanity checking" OFF)
-
-if(NOT MSVC)
- option (DBUS_GCOV_ENABLED "compile with coverage profiling instrumentation (gcc only)" OFF)
- if(DBUS_GCOV_ENABLED)
- add_definitions(-fprofile-arcs -ftest-coverage)
- # FIXME!!!!
- ## remove optimization
- # CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
- endif(DBUS_GCOV_ENABLED)
-endif(NOT MSVC)
-
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- option (DBUS_BUS_ENABLE_INOTIFY "build with inotify support (linux only)" ON)
- if(DBUS_BUS_ENABLE_INOTIFY)
- check_include_file(sys/inotify.h HAVE_SYS_INOTIFY_H)
- if(NOT HAVE_SYS_INOTIFY_H)
- message(FATAL_ERROR "sys/inotify.h not found!")
- endif(NOT HAVE_SYS_INOTIFY_H)
- endif(DBUS_BUS_ENABLE_INOTIFY)
-elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*BSD")
- option (DBUS_BUS_ENABLE_KQUEUE "build with kqueue support (FreeBSD only)" ON)
- if(DBUS_BUS_ENABLE_KQUEUE)
- # cmake check a header by compiling a test program with
- # the header, sys/event.h needs stdint.h and sys/types.h
- # to work.
- check_include_files("stdint.h;sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
- if(NOT HAVE_SYS_EVENT_H)
- message(FATAL_ERROR "sys/event.h not found!")
- endif(NOT HAVE_SYS_EVENT_H)
- endif(DBUS_BUS_ENABLE_KQUEUE)
-endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-
-STRING(TOUPPER ${CMAKE_SYSTEM_NAME} sysname)
-if("${sysname}" MATCHES ".*SOLARIS.*")
- option (HAVE_CONSOLE_OWNER_FILE "enable console owner file (solaris only)" ON)
- if(HAVE_CONSOLE_OWNER_FILE)
- set (DBUS_CONSOLE_OWNER_FILE "/dev/console" CACHE STRING "Directory to check for console ownerhip")
- endif(HAVE_CONSOLE_OWNER_FILE)
-endif("${sysname}" MATCHES ".*SOLARIS.*")
-
-if(NOT EXPAT_FOUND)
- message(FATAL_ERROR "expat not found!")
-endif(NOT EXPAT_FOUND)
-
-SET(XML_LIB "Expat")
-SET(XML_LIBRARY ${EXPAT_LIBRARIES})
-SET(XML_INCLUDE_DIR ${EXPAT_INCLUDE_DIR})
-
-# all missing or hardcoded for now
-
-# 'hidden' ones
-set(atomic_int OFF)
-set(atomic_int486 OFF)
-if(CMAKE_COMPILER_IS_GNUCC AND NOT DBUS_ENABLE_ANSI)
- FIND_PROGRAM(UNAME_EXECUTABLE
- NAMES uname
- PATHS /bin /usr/bin /usr/local/bin c:/Programme/MSys/bin d:/Programme/MSys/bin)
-
- if(UNAME_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${UNAME_EXECUTABLE} "-m"
- OUTPUT_VARIABLE UNAME_OUTPUT)
-
- if("UNAME_OUTPUT" MATCHES "^.*i[0123]86.*$")
- set(atomic_int ON)
- else("UNAME_OUTPUT" MATCHES "^.*i[0123]86.*$")
- if("UNAME_OUTPUT" MATCHES "^.*i?86.*$")
- set(atomic_int ON)
- set(atomic_int_486 ON)
- endif("UNAME_OUTPUT" MATCHES "^.*i?86.*$")
- endif("UNAME_OUTPUT" MATCHES "^.*i[0123]86.*$")
- endif(UNAME_EXECUTABLE)
-endif(CMAKE_COMPILER_IS_GNUCC AND NOT DBUS_ENABLE_ANSI)
-
-set (DBUS_HAVE_ATOMIC_INT ${atomic_int} CACHE STRING "Some atomic integer implementation present")
-set (DBUS_USE_ATOMIC_INT_486 ${atomic_int_486} CACHE STRING "Use atomic integer implementation for 486")
-
-if(X11_FOUND)
- option (DBUS_BUILD_X11 "Build with X11 autolaunch support " ON)
-endif(X11_FOUND)
-
-# test binary names
-if (WIN32)
- # Automake calls this EXEEXT, and CMake doesn't have a standard name
- # for it; follow Automake's naming convention so we can share .in files
- set (EXEEXT ".exe")
-endif(WIN32)
-
-if (MSVC_IDE)
- if(CMAKE_BUILD_TYPE MATCHES Debug)
- set(IDE_BIN /Debug )
- message(STATUS)
- message(STATUS "Visual Studio: test programs will only work with 'Debug' configuration!")
- message(STATUS "To run tests with 'Release' configuration use -DCMAKE_BUILD_TYPE=Release")
- message(STATUS "Add '..\\..\\test\\data' to the command line option of the test programs")
- message(STATUS)
- else(CMAKE_BUILD_TYPE MATCHES Debug)
- set(IDE_BIN /Release)
- message(STATUS)
- message(STATUS "Visual Studio: test programs will only work with 'Release' configuration!")
- message(STATUS "To run tests with 'Debug' configuration use -DCMAKE_BUILD_TYPE=Debug")
- message(STATUS "Add '..\\..\\test\\data' to the command line option of the test programs")
- message(STATUS)
- endif(CMAKE_BUILD_TYPE MATCHES Debug)
- set (TEST_PATH_FORCE FORCE)
- FILE(REMOVE ${CMAKE_BINARY_DIR}/data/dbus-1/services)
-endif (MSVC_IDE)
-
-#### Find socket directories
- if (NOT $ENV{TMPDIR} STREQUAL "")
- set (DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR})
- else (NOT $ENV{TMPDIR} STREQUAL "")
- if (NOT $ENV{TEMP} STREQUAL "")
- set (DBUS_SESSION_SOCKET_DIR $ENV{TEMP})
- else (NOT $ENV{TEMP} STREQUAL "")
- if (NOT $ENV{TMP} STREQUAL "")
- set (DBUS_SESSION_SOCKET_DIR $ENV{TMP})
- else (NOT $ENV{TMP} STREQUAL "")
- if (WIN32)
- #Should never happen, both TMP and TEMP seem always set on Windows
- message(FATAL_ERROR "Could not determine a usable temporary directory")
- else(WIN32)
- set (DBUS_SESSION_SOCKET_DIR /tmp)
- endif(WIN32)
- endif (NOT $ENV{TMP} STREQUAL "")
- endif (NOT $ENV{TEMP} STREQUAL "")
- endif (NOT $ENV{TMPDIR} STREQUAL "")
-
-# TODO: fix redhet
-if (WIN32)
- # bus-test expects a non empty string
- set (DBUS_SYSTEM_PID_FILE "/dbus-pid")
-else (WIN32)
- set (DBUS_SYSTEM_PID_FILE ${EXPANDED_LOCALSTATEDIR}/run/dbus/pid)
-endif (WIN32)
-
-if (WIN32)
- set (DBUS_CONSOLE_AUTH_DIR "")
-else (WIN32)
- set (DBUS_CONSOLE_AUTH_DIR "/var/run/console/")
-endif (WIN32)
-
-set (DBUS_USER )
-
-# In Autotools this has a different default on QNX, but there seems little
-# point in replicating that here; if you're on an unusual Unix, use Autotools.
-set (DEFAULT_MESSAGE_UNIX_FDS 1024)
-
-# This won't work on Windows. It's not meant to - the system bus is
-# meaningless on Windows anyway.
-#
-# This has to be suitable for hard-coding in client libraries as well as
-# in the dbus-daemon's configuration, so it has to be valid to listen on
-# and also to connect to. If this ever changes, it'll need to be split into
-# two variables, one for the listening address and one for the connecting
-# address.
-set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address")
-
-if (WIN32)
- set (DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:" CACHE STRING "session bus default listening address")
- set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients")
-
- set (DBUS_SYSTEM_CONFIG_FILE "etc/dbus-1/system.conf")
- set (DBUS_SESSION_CONFIG_FILE "etc/dbus-1/session.conf")
- # bus-test expects a non empty string
- set (DBUS_USER "Administrator")
-else (WIN32)
- set (DBUS_SESSION_BUS_LISTEN_ADDRESS "unix:tmpdir=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default listening address")
- set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients")
- set (sysconfdir "")
- set (configdir ${sysconfdir}/dbus-1 )
- set (DBUS_SYSTEM_CONFIG_FILE ${configdir}/system.conf)
- set (DBUS_SESSION_CONFIG_FILE ${configdir}/session.conf)
- set (DBUS_USER "root")
-endif (WIN32)
-
-set (DBUS_DAEMON_NAME "dbus-daemon" CACHE STRING "The name of the dbus daemon executable")
-
-########### create config.h ###############
-
-#include(ConfigureChecks.cmake)
-
-# better use flags for gcc
-if (MINGW)
- set (HAVE_GNUC_VARARGS 1)
-endif(MINGW)
-
-# compiler definitions
-add_definitions(-DHAVE_CONFIG_H=1)
-add_definitions(${DBUS_BUS_CFLAGS})
-
-
-if (DBUS_BUILD_TESTS)
- # set variables used for the .in files (substituted by configure_file) in test/data:
- set(DBUS_TEST_EXEC ${EXECUTABLE_OUTPUT_PATH}${IDE_BIN})
- set(DBUS_TEST_DATA ${CMAKE_BINARY_DIR}/test/data)
- set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR} )
- set(TEST_LAUNCH_HELPER_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
- if (UNIX)
- set (TEST_LISTEN "unix:tmpdir=${TEST_SOCKET_DIR}")
- endif (UNIX)
- if (WIN32)
- set (TEST_LISTEN "tcp:host=localhost")
- endif (WIN32)
-endif (DBUS_BUILD_TESTS)
-
-set(DBUS_LIBRARIES dbus-1)
-set(DBUS_INTERNAL_LIBRARIES dbus-internal)
-
-# settings for building and using static internal lib
-# important note: DBUS_INTERNAL_xxxxx_DEFINITIONS must *not* be set when building dbus-1 library
-set (DBUS_INTERNAL_ADD_LIBRARY_OPTIONS STATIC)
-set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD")
-# For now, the CMake build system doesn't support replacing the internal
-# main loop with dbus-glib
-set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD -DDBUS_COMPILATION -DDBUS_TEST_USE_INTERNAL")
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
-
-if (WIN32)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dbus-env.bat.cmake ${CMAKE_BINARY_DIR}/bin/dbus-env.bat )
-install_files(/bin FILES ${CMAKE_BINARY_DIR}/bin/dbus-env.bat)
-endif()
-
-add_definitions(-DHAVE_CONFIG_H=1)
-
-########### subdirs ###############
-
-add_subdirectory( dbus )
-add_subdirectory( bus )
-if (DBUS_BUILD_TESTS)
- add_subdirectory( test )
-endif (DBUS_BUILD_TESTS)
-add_subdirectory( tools )
-add_subdirectory( doc )
-
-
-OPTION(DBUS_INSTALL_SYSTEM_LIBS "install required system libraries" OFF)
-MESSAGE(" ")
-MESSAGE("set -DDBUS_INSTALL_SYSTEM_LIBS=1 to install runtime libraries too")
-MESSAGE("set DBUSDIR (environment or cmake option) to overwrite the default install directory ")
-MESSAGE(" ")
-MESSAGE(" ")
-GET_FILENAME_COMPONENT(C_COMPILER ${CMAKE_C_COMPILER} NAME)
-GET_FILENAME_COMPONENT(CXX_COMPILER ${CMAKE_CXX_COMPILER} NAME)
-
-message(" D-BUS ${DBUS_VERSION} ")
-message(" =========== ")
-message(" ")
-message(" install prefix: ${prefix} ")
-message(" install exec_prefix: ${exec_prefix} ")
-message(" install libdir: ${EXPANDED_LIBDIR} ")
-message(" install bindir: ${EXPANDED_BINDIR} ")
-message(" install sysconfdir: ${EXPANDED_SYSCONFDIR} ")
-message(" install datadir: ${EXPANDED_DATADIR} ")
-message(" source code location: ${DBUS_SOURCE_DIR} ")
-message(" build dir: ${CMAKE_BINARY_DIR} ")
-message(" c compiler: ${C_COMPILER} ")
-message(" cflags: ${CMAKE_C_FLAGS} ")
-message(" cflags debug: ${CMAKE_C_FLAGS_DEBUG} ")
-message(" cflags release: ${CMAKE_C_FLAGS_RELEASE} ")
-message(" cxx compiler: ${CXX_COMPILER} ")
-message(" cxxflags: ${CMAKE_CXX_FLAGS} ")
-message(" cxxflags debug: ${CMAKE_CXX_FLAGS_DEBUG} ")
-message(" cxxflags release: ${CMAKE_CXX_FLAGS_RELEASE} ")
-message(" 64-bit int: ${DBUS_INT64_TYPE} ")
-message(" 32-bit int: ${DBUS_INT32_TYPE} ")
-message(" 16-bit int: ${DBUS_INT16_TYPE} ")
-message(" Doxygen: ${DOXYGEN} ")
-message(" Docbook Generator: ${DOCBOOK_GENERATOR_NAME} ")
-
-
-message(" gcc coverage profiling: ${DBUS_GCOV_ENABLED} ")
-message(" Building unit tests: ${DBUS_BUILD_TESTS} ")
-message(" Building verbose mode: ${DBUS_ENABLE_VERBOSE_MODE} ")
-message(" Building w/o assertions: ${DBUS_DISABLE_ASSERT} ")
-message(" Building w/o checks: ${DBUS_DISABLE_CHECKS} ")
-message(" Building bus stats API: ${DBUS_ENABLE_STATS} ")
-message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} ")
-message(" Building inotify support: ${DBUS_BUS_ENABLE_INOTIFY} ")
-message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ")
-message(" Building Doxygen docs: ${DBUS_ENABLE_DOXYGEN_DOCS} ")
-message(" Building XML docs: ${DBUS_ENABLE_XML_DOCS} ")
-message(" Daemon executable name: ${DBUS_DAEMON_NAME}")
-if (WIN32)
-message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ")
-message(" Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} ")
-message(" Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS} ")
-else (WIN32)
-message(" System bus socket: ${DBUS_SYSTEM_SOCKET} ")
-message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ")
-message(" System bus PID file: ${DBUS_SYSTEM_PID_FILE} ")
-message(" Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR} ")
-message(" Console auth dir: ${DBUS_CONSOLE_AUTH_DIR} ")
-message(" System bus user: ${DBUS_USER} ")
-message(" 'make check' socket dir: ${TEST_SOCKET_DIR} ")
-endif (WIN32)
-message(" Test listen address: ${TEST_LISTEN} ")
-if (MSVC)
-message(" build timestamp: ${DBUS_BUILD_TIMESTAMP} ")
-endif (MSVC)
-
-MESSAGE(" ")
-if (DBUS_BUILD_TESTS)
- message("NOTE: building with unit tests increases the size of the installed library and renders it insecure.")
-endif(DBUS_BUILD_TESTS)
-
-if (DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERT)
- message("NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)")
-endif(DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERT)
-
-if (DBUS_GCOV_ENABLED)
- message("NOTE: building with coverage profiling is definitely for developers only.")
-endif(DBUS_GCOV_ENABLED)
-
-if (DBUS_ENABLE_VERBOSE_MODE)
- message("NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance.")
-endif(DBUS_ENABLE_VERBOSE_MODE)
-
-if(NOT DBUS_DISABLE_ASSERT)
- message("NOTE: building with assertions increases library size and decreases performance.")
-endif(NOT DBUS_DISABLE_ASSERT)
-
-if (DBUS_DISABLE_CHECKS)
- message("NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance.")
-endif(DBUS_DISABLE_CHECKS)
-MESSAGE(" ")
-
-INCLUDE(modules/CPackInstallConfig.cmake)
-
-add_custom_target(help-options
- cmake -LH
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/ConfigureChecks.cmake b/src/3rd_party/dbus-1.7.8/cmake/ConfigureChecks.cmake
deleted file mode 100644
index 2794975ee1..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/ConfigureChecks.cmake
+++ /dev/null
@@ -1,157 +0,0 @@
-include(CheckIncludeFile)
-include(CheckSymbolExists)
-include(CheckStructMember)
-include(CheckTypeSize)
-
-check_include_file(dirent.h HAVE_DIRENT_H) # dbus-sysdeps-util.c
-check_include_file(io.h HAVE_IO_H) # internal
-check_include_file(grp.h HAVE_GRP_H) # dbus-sysdeps-util-win.c
-check_include_file(sys/poll.h HAVE_POLL) # dbus-sysdeps.c, dbus-sysdeps-win.c
-check_include_file(sys/time.h HAVE_SYS_TIME_H)# dbus-sysdeps-win.c
-check_include_file(sys/wait.h HAVE_SYS_WAIT_H)# dbus-sysdeps-win.c
-check_include_file(time.h HAVE_TIME_H) # dbus-sysdeps-win.c
-check_include_file(ws2tcpip.h HAVE_WS2TCPIP_H)# dbus-sysdeps-win.c
-check_include_file(unistd.h HAVE_UNISTD_H) # dbus-sysdeps-util-win.c
-check_include_file(stdio.h HAVE_STDIO_H) # dbus-sysdeps.h
-check_include_file(sys/syslimits.h HAVE_SYS_SYSLIMITS_H) # dbus-sysdeps-unix.c
-check_include_file(errno.h HAVE_ERRNO_H) # dbus-sysdeps.c
-check_include_file(signal.h HAVE_SIGNAL_H)
-check_include_file(locale.h HAVE_LOCALE_H)
-check_include_file(inttypes.h HAVE_INTTYPES_H) # dbus-pipe.h
-check_include_file(stdint.h HAVE_STDINT_H) # dbus-pipe.h
-
-check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE) # dbus-sysdeps.c, dbus-sysdeps-win.c
-check_symbol_exists(getgrouplist "grp.h" HAVE_GETGROUPLIST) # dbus-sysdeps.c
-check_symbol_exists(getpeerucred "ucred.h" HAVE_GETPEERUCRED) # dbus-sysdeps.c, dbus-sysdeps-win.c
-check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP) # dbus-sysdeps.c
-check_symbol_exists(getpwnam_r "errno.h pwd.h" HAVE_POSIX_GETPWNAM_R) # dbus-sysdeps-util-unix.c
-check_symbol_exists(setenv "stdlib.h" HAVE_SETENV) # dbus-sysdeps.c
-check_symbol_exists(unsetenv "stdlib.h" HAVE_UNSETENV) # dbus-sysdeps.c
-check_symbol_exists(clearenv "stdlib.h" HAVE_CLEARENV) # dbus-sysdeps.c
-check_symbol_exists(writev "sys/uio.h" HAVE_WRITEV) # dbus-sysdeps.c, dbus-sysdeps-win.c
-check_symbol_exists(setrlimit "sys/resource.h" HAVE_SETRLIMIT) # dbus-sysdeps.c, dbus-sysdeps-win.c, test/test-segfault.c
-check_symbol_exists(socketpair "sys/socket.h" HAVE_SOCKETPAIR) # dbus-sysdeps.c
-check_symbol_exists(socklen_t "sys/socket.h" HAVE_SOCKLEN_T) # dbus-sysdeps-unix.c
-check_symbol_exists(setlocale "locale.h" HAVE_SETLOCALE) # dbus-test-main.c
-check_symbol_exists(localeconv "locale.h" HAVE_LOCALECONV) # dbus-sysdeps.c
-check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL) # dbus-send.c
-check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL) # dbus-send.c
-
-check_struct_member(cmsgcred cmcred_pid "sys/types.h sys/socket.h" HAVE_CMSGCRED) # dbus-sysdeps.c
-
-# missing:
-# HAVE_ABSTRACT_SOCKETS
-# DBUS_HAVE_GCC33_GCOV
-
-check_type_size("short" SIZEOF_SHORT)
-check_type_size("int" SIZEOF_INT)
-check_type_size("long" SIZEOF_LONG)
-check_type_size("long long" SIZEOF_LONG_LONG)
-check_type_size("__int64" SIZEOF___INT64)
-
-# DBUS_INT64_TYPE
-if(SIZEOF_INT EQUAL 8)
- set (DBUS_INT64_TYPE "int")
- set (DBUS_INT64_CONSTANT "(val)")
- set (DBUS_UINT64_CONSTANT "(val##U)")
-elseif(SIZEOF_LONG EQUAL 8)
- set (DBUS_INT64_TYPE "long")
- set (DBUS_INT64_CONSTANT "(val##L)")
- set (DBUS_UINT64_CONSTANT "(val##UL)")
-elseif(SIZEOF_LONG_LONG EQUAL 8)
- set (DBUS_INT64_TYPE "long long")
- set (DBUS_INT64_CONSTANT "(val##LL)")
- set (DBUS_UINT64_CONSTANT "(val##ULL)")
-elseif(SIZEOF___INT64 EQUAL 8)
- set (DBUS_INT64_TYPE "__int64")
- set (DBUS_INT64_CONSTANT "(val##i64)")
- set (DBUS_UINT64_CONSTANT "(val##ui64)")
-else(SIZEOF_INT EQUAL 8)
- message (FATAL_ERROR "Could not find a 64-bit integer type")
-endif(SIZEOF_INT EQUAL 8)
-
-# DBUS_INT32_TYPE
-if(SIZEOF_INT EQUAL 4)
- set (DBUS_INT32_TYPE "int")
-elseif(SIZEOF_LONG EQUAL 4)
- set (DBUS_INT32_TYPE "long")
-elseif(SIZEOF_LONG_LONG EQUAL 4)
- set (DBUS_INT32_TYPE "long long")
-endif(SIZEOF_INT EQUAL 4)
-
-# DBUS_INT16_TYPE
-if(SIZEOF_INT EQUAL 2)
- set (DBUS_INT16_TYPE "int")
-elseif(SIZEOF_SHORT EQUAL 2)
- set (DBUS_INT16_TYPE "short")
-endif(SIZEOF_INT EQUAL 2)
-
-find_program(DOXYGEN doxygen)
-find_program(XMLTO xmlto)
-
-if(MSVC)
- SET(DBUS_VA_COPY_FUNC "_DBUS_VA_COPY_ASSIGN";)
-else(MSVC)
-write_file("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c" "#include <stdarg.h>
- #include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
-")
-try_compile(DBUS_HAVE_VA_COPY
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c)
-
-if(DBUS_HAVE_VA_COPY)
- SET(DBUS_VA_COPY_FUNC va_copy CACHE STRING "va_copy function")
-else(DBUS_HAVE_VA_COPY)
- write_file("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c" "#include <stdarg.h>
- #include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- __va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
- ")
- try_compile(DBUS_HAVE___VA_COPY
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c)
- if(DBUS_HAVE___VA_COPY)
- SET(DBUS_VA_COPY_FUNC __va_copy CACHE STRING "va_copy function")
- else(DBUS_HAVE___VA_COPY)
- SET(DBUS_VA_COPY_AS_ARRAY "1" CACHE STRING "'va_lists' cannot be copies as values")
- endif(DBUS_HAVE___VA_COPY)
-endif(DBUS_HAVE_VA_COPY)
-endif(MSVC) # _not_ MSVC
-#### Abstract sockets
-
-if (DBUS_ENABLE_ABSTRACT_SOCKETS)
-
- try_compile(HAVE_ABSTRACT_SOCKETS
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/modules/CheckForAbstractSockets.c)
-
-endif(DBUS_ENABLE_ABSTRACT_SOCKETS)
-
-if(HAVE_ABSTRACT_SOCKETS)
- set(DBUS_PATH_OR_ABSTRACT_VALUE abstract)
-else(HAVE_ABSTRACT_SOCKETS)
- set(DBUS_PATH_OR_ABSTRACT_VALUE path)
-endif(HAVE_ABSTRACT_SOCKETS)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/bus-test.bat.cmake b/src/3rd_party/dbus-1.7.8/cmake/bus-test.bat.cmake
deleted file mode 100644
index 0168871338..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/bus-test.bat.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-:: bus-test wrapper
-@echo off
-
-:: session bus address
-set DBUS_STARTER_BUS=tcp:host=localhost,port=1234
-
-if NOT "%1" == "" (
- SET DATADIR=%1
-) else (
- SET DATADIR=test\data
-)
-
-bin\bus-test.exe test\data
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/bus/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/bus/CMakeLists.txt
deleted file mode 100644
index 9943584ae8..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/bus/CMakeLists.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-project(bus)
-
-add_definitions(-DDBUS_COMPILATION)
-
-SET(EFENCE "")
-SET(BUS_DIR ${CMAKE_SOURCE_DIR}/../bus)
-
-set (config_DATA
- session.conf
- system.conf
-)
-
-# config files for installation
-CONFIGURE_FILE( "${BUS_DIR}/session.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/session.conf" IMMEDIATE @ONLY)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/session.d)
-
-CONFIGURE_FILE( "system.conf.cmake" "${CMAKE_CURRENT_BINARY_DIR}/system.conf" IMMEDIATE @ONLY)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/system.d)
-
-# copy services for local daemon start to local service dir data/dbus-1/services
-SET (SERVICE_FILES test/data/valid-service-files)
-FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${SERVICE_FILES}/*.service.in" )
-FOREACH(FILE ${FILES})
- GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME_WE)
- SET (TARGET ${CMAKE_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service)
- IF (CONFIG_VERBOSE)
- MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
- ENDIF (CONFIG_VERBOSE)
- configure_file(${FILE} ${TARGET} )
-ENDFOREACH(FILE)
-
-SET (XML_SOURCES ${BUS_DIR}/config-loader-expat.c)
-
-if (DBUS_BUS_ENABLE_INOTIFY)
- set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-inotify.c)
-elseif (DBUS_BUS_ENABLE_KQUEUE)
- set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-kqueue.c)
-else (DBUS_BUS_ENABLE_INOTIFY)
- set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-default.c)
-endif (DBUS_BUS_ENABLE_INOTIFY)
-
-set (BUS_SOURCES
- ${BUS_DIR}/activation.c
- ${BUS_DIR}/activation.h
- ${BUS_DIR}/bus.c
- ${BUS_DIR}/bus.h
- ${BUS_DIR}/config-parser.c
- ${BUS_DIR}/config-parser.h
- ${BUS_DIR}/config-parser-common.c
- ${BUS_DIR}/config-parser-common.h
-# ${BUS_DIR}/config-parser-trivial.c
- ${BUS_DIR}/connection.c
- ${BUS_DIR}/connection.h
- ${BUS_DIR}/desktop-file.c
- ${BUS_DIR}/desktop-file.h
- ${BUS_DIR}/dir-watch.h
- ${BUS_DIR}/dispatch.c
- ${BUS_DIR}/dispatch.h
- ${BUS_DIR}/driver.c
- ${BUS_DIR}/driver.h
- ${BUS_DIR}/expirelist.c
- ${BUS_DIR}/expirelist.h
- ${BUS_DIR}/policy.c
- ${BUS_DIR}/policy.h
- ${BUS_DIR}/selinux.h
- ${BUS_DIR}/selinux.c
- ${BUS_DIR}/services.c
- ${BUS_DIR}/services.h
- ${BUS_DIR}/signals.c
- ${BUS_DIR}/signals.h
- ${BUS_DIR}/test.c
- ${BUS_DIR}/test.h
- ${BUS_DIR}/utils.c
- ${BUS_DIR}/utils.h
- ${XML_SOURCES}
- ${DIR_WATCH_SOURCE}
-)
-if(DBUS_ENABLE_STATS)
- list(APPEND BUS_SOURCES
- ${BUS_DIR}/stats.c
- ${BUS_DIR}/stats.h
- )
-endif(DBUS_ENABLE_STATS)
-
-include_directories(${XML_INCLUDE_DIR})
-
-add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
-target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
-set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
-set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-
-install_targets(/bin dbus-daemon)
-install_files(/etc/dbus-1 FILES ${config_DATA})
-install(DIRECTORY . DESTINATION etc/dbus-1/session.d FILES_MATCHING PATTERN "*.conf")
-
-if (DBUS_SERVICE)
- set (dbus_service_SOURCES
- ${BUS_DIR}/bus-service-win.c
- # TODO: add additional files
- # ${BUS_DIR}/service-main.c
- # ${BUS_SOURCES}
- )
-
- add_executable(dbus-service ${dbus_service_SOURCES} )
- target_link_libraries(dbus-service ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
- set_target_properties(dbus-service PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
- install_targets(/bin dbus-service )
-endif (DBUS_SERVICE)
-
-if (DBUS_ENABLE_EMBEDDED_TESTS)
- add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
- target_link_libraries(bus-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
- set_target_properties(bus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
- add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_BINARY_DIR}/test/data)
-endif (DBUS_ENABLE_EMBEDDED_TESTS)
-
-if(MSVC)
- project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
-endif(MSVC)
-
-## mop up the gcov files
-#clean-local:
-# /bin/rm *.bb *.bbg *.da *.gcov || true
-
-#install-data-hook:
-# $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/run/dbus
-# $(mkinstalldirs) $(DESTDIR)/$(configdir)/system.d
-# $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services
-
-##install_file(${configdir}/system.d FILE
-
-
-set(LAUNCH_HELPER_SOURCES ${XML_SOURCES}
- ${BUS_DIR}/config-parser-common.c
- ${BUS_DIR}/config-parser-trivial.c
- ${BUS_DIR}/desktop-file.c
- ${BUS_DIR}/utils.c
- ${BUS_DIR}/activation-helper.c
-
-)
-
-if(NOT WIN32)
-# TODO PENDING(kdab) fix build on windows (activation-helper.c)
- add_executable(dbus-daemon-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c )
- target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
-
- add_executable(dbus-daemon-launch-helper-test ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c)
- set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
- target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
-
- add_executable(bus-test-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
- set_target_properties(bus-test-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
- target_link_libraries(bus-test-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
- add_test(bus-test-launch-helper ${EXECUTABLE_OUTPUT_PATH}/bus-test-launch-helper )
-
-endif(NOT WIN32)
-
-#### Init scripts fun
-#SCRIPT_IN_FILES=messagebus.in
-# rc.messagebus.in
-
-## Red Hat start
-#if DBUS_INIT_SCRIPTS_RED_HAT
-
-#initddir=$(sysconfdir)/rc.d/init.d
-
-#initd_SCRIPTS=
-# messagebus
-
-#endif
-# ## Red Hat end
-
-## Slackware start
-#if DBUS_INIT_SCRIPTS_SLACKWARE
-
-#initddir=$(sysconfdir)/rc.d/
-
-#initd_SCRIPTS=
-# rc.messagebus
-
-#endif
-## Slackware end
-
-#MAN_IN_FILES=dbus-daemon.1.in
-#man_MANS = dbus-daemon.1
-
-#### Extra dist
-
-#EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/bus/service.cmake b/src/3rd_party/dbus-1.7.8/cmake/bus/service.cmake
deleted file mode 100644
index 25d17ff17e..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/bus/service.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedektop.DBus.ServiceName
-Exec=notepad
diff --git a/src/3rd_party/dbus-1.7.8/cmake/bus/system.conf.cmake b/src/3rd_party/dbus-1.7.8/cmake/bus/system.conf.cmake
deleted file mode 100644
index ee85ecc484..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/bus/system.conf.cmake
+++ /dev/null
@@ -1,62 +0,0 @@
-<!-- This configuration file controls the systemwide message bus.
- Add a system-local.conf and edit that rather than changing this
- file directly. -->
-
-<!-- Note that there are any number of ways you can hose yourself
- security-wise by screwing up this file; in particular, you
- probably don't want to listen on any more addresses, add any more
- auth mechanisms, run as a different user, etc. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-
- <!-- Our well-known bus type, do not change this -->
- <type>system</type>
-
- <!-- Run as special user -->
- <user>@DBUS_USER@</user>
-
- <!-- Fork into daemon mode -->
- <fork/>
-
- <!-- Write a pid file -->
- <pidfile>@DBUS_SYSTEM_PID_FILE@</pidfile>
-
- <!-- Only allow socket-credentials-based authentication -->
- <auth>EXTERNAL</auth>
-
- <!-- Only listen on a local socket. (abstract=/path/to/socket
- means use abstract namespace, don't really create filesystem
- file; only Linux supports this. Use path=/whatever on other
- systems.) -->
- <listen>@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@</listen>
-
- <policy context="default">
- <!-- Deny everything then punch holes -->
- <deny send_interface="*"/>
- <deny receive_interface="*"/>
- <deny own="*"/>
- <!-- But allow all users to connect -->
- <allow user="*"/>
- <!-- Allow anyone to talk to the message bus -->
- <!-- FIXME I think currently these allow rules are always implicit
- even if they aren't in here -->
- <allow send_destination="org.freedesktop.DBus"/>
- <allow receive_sender="org.freedesktop.DBus"/>
- <!-- valid replies are always allowed -->
- <allow send_requested_reply="true"/>
- <allow receive_requested_reply="true"/>
- </policy>
-
- <!-- Config files are placed here that among other things, punch
- holes in the above policy for specific services. -->
- <includedir>system.d</includedir>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
- <include ignore_missing="yes">system-local.conf</include>
-
- <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/cmake/config.h.cmake b/src/3rd_party/dbus-1.7.8/cmake/config.h.cmake
deleted file mode 100644
index 3735560955..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/config.h.cmake
+++ /dev/null
@@ -1,250 +0,0 @@
-/* config.h. Generated by cmake from config.h.cmake */
-
-#ifndef _DBUS_CONFIG_H
-#define _DBUS_CONFIG_H
-/****************************/
-/* indicate that we are building with cmake */
-#define DBUS_CMAKE 1
-
-@AUTOPACKAGE_CONFIG_H_TEMPLATE@
-
-/*
- * Variables defined by AC_DEFINE in ../configure.ac
- * should be placed in this file
-*/
-#cmakedefine HAVE_GNUC_VARARGS 1
-
-#cmakedefine DBUS_CONSOLE_AUTH_DIR "@DBUS_CONSOLE_AUTH_DIR@"
-#cmakedefine DBUS_DATADIR "@DBUS_DATADIR@"
-#cmakedefine DBUS_BINDIR "@DBUS_BINDIR@"
-#cmakedefine DBUS_SYSTEM_CONFIG_FILE "@DBUS_SYSTEM_CONFIG_FILE@"
-#cmakedefine DBUS_SESSION_CONFIG_FILE "@DBUS_SESSION_CONFIG_FILE@"
-#cmakedefine DBUS_DAEMON_NAME "@DBUS_DAEMON_NAME@"
-#cmakedefine DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@"
-#cmakedefine DBUS_SESSION_BUS_CONNECT_ADDRESS "@DBUS_SESSION_BUS_CONNECT_ADDRESS@"
-#cmakedefine DBUS_MACHINE_UUID_FILE "@DBUS_MACHINE_UUID_FILE@"
-#cmakedefine DBUS_DAEMONDIR "@DBUS_DAEMONDIR@"
-
-#cmakedefine DBUS_ENABLE_STATS
-
-#define TEST_LISTEN "@TEST_LISTEN@"
-
-// test binaries
-#define DBUS_TEST_EXEC "@DBUS_TEST_EXEC@"
-#define DBUS_EXEEXT "@EXEEXT@"
-
-/* Some dbus features */
-#cmakedefine DBUS_ENABLE_ANSI 1
-#cmakedefine DBUS_ENABLE_VERBOSE_MODE 1
-#cmakedefine DBUS_DISABLE_ASSERT 1
-#ifndef DBUS_DISABLE_ASSERT
-# define DBUS_ENABLE_ASSERT 1
-#endif
-#cmakedefine DBUS_DISABLE_CHECKS 1
-#ifndef DBUS_DISABLE_CHECKS
-# define DBUS_ENABLE_CHECKS 1
-#endif
-/* xmldocs */
-/* doxygen */
-#cmakedefine DBUS_GCOV_ENABLED 1
-
-/* abstract-sockets */
-
-#cmakedefine HAVE_ABSTRACT_SOCKETS 1
-
-#cmakedefine DBUS_PATH_OR_ABSTRACT_VALUE 1
-
-#if (defined DBUS_PATH_OR_ABSTRACT_VALUE)
-#define DBUS_PATH_OR_ABSTRACT @DBUS_PATH_OR_ABSTRACT_VALUE@
-#endif
-
-#ifdef DBUS_PATH_OR_ABSTRACT_VALUE
-#undef DBUS_PATH_OR_ABSTRACT_VALUE
-#endif
-
-/* selinux */
-/* kqueue */
-#cmakedefine HAVE_CONSOLE_OWNER_FILE 1
-#define DBUS_CONSOLE_OWNER_FILE "@DBUS_CONSOLE_OWNER_FILE@"
-
-#cmakedefine DBUS_HAVE_ATOMIC_INT 1
-#cmakedefine DBUS_USE_ATOMIC_INT_486 1
-#if (defined(__i386__) || defined(__x86_64__))
-# define DBUS_HAVE_ATOMIC_INT 1
-# define DBUS_USE_ATOMIC_INT_486 1
-#endif
-
-#cmakedefine DBUS_BUILD_X11 1
-/* For the moment, the cmake build system doesn't have an equivalent of
- * the autoconf build system's --disable-x11-autolaunch */
-#ifdef DBUS_BUILD_X11
-# define DBUS_ENABLE_X11_AUTOLAUNCH 1
-#endif
-
-#define DBUS_DEFAULT_MESSAGE_UNIX_FDS @DEFAULT_MESSAGE_UNIX_FDS@
-
-#define _DBUS_VA_COPY_ASSIGN(a1,a2) { a1 = a2; }
-
-#cmakedefine DBUS_VA_COPY_FUNC
-#if (defined DBUS_VA_COPY_FUNC)
-# define DBUS_VA_COPY @DBUS_VA_COPY_FUNC@
-#endif
-
-#ifdef DBUS_VA_COPY_FUNC
-#undef DBUS_VA_COPY_FUNC
-#endif
-
-#cmakedefine DBUS_VA_COPY_AS_ARRAY @DBUS_VA_COPY_AS_ARRAY@
-
-// headers
-/* Define to 1 if you have dirent.h */
-#cmakedefine HAVE_DIRENT_H 1
-
-/* Define to 1 if you have io.h */
-#cmakedefine HAVE_IO_H 1
-
-/* Define to 1 if you have grp.h */
-#cmakedefine HAVE_GRP_H 1
-
-/* Define to 1 if you have sys/poll.h */
-#cmakedefine HAVE_POLL 1
-
-/* Define to 1 if you have sys/time.h */
-#cmakedefine HAVE_SYS_TIME 1
-
-/* Define to 1 if you have sys/wait.h */
-#cmakedefine HAVE_SYS_WAIT 1
-
-/* Define to 1 if you have time.h */
-#cmakedefine HAVE_TIME_H 1
-
-/* Define to 1 if you have ws2tcpip.h */
-#cmakedefine HAVE_WS2TCPIP_H
-
-/* Define to 1 if you have unistd.h */
-#cmakedefine HAVE_UNISTD_H 1
-
-/* Define to 1 if you have stdio.h */
-#cmakedefine HAVE_STDIO_H 1
-
-/* Define to 1 if you have sys/syslimits.h */
-#cmakedefine HAVE_SYS_SYSLIMITS_H 1
-
-/* Define to 1 if you have errno.h */
-#cmakedefine HAVE_ERRNO_H 1
-
-/* Define to 1 if you have signal.h */
-#cmakedefine HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have locale.h */
-#cmakedefine HAVE_LOCALE_H 1
-
-/* Define to 1 if you have inttypes.h */
-#cmakedefine HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have stdint.h */
-#cmakedefine HAVE_STDINT_H 1
-
-// symbols
-/* Define to 1 if you have backtrace */
-#cmakedefine HAVE_BACKTRACE 1
-
-/* Define to 1 if you have getgrouplist */
-#cmakedefine HAVE_GETGROUPLIST 1
-
-/* Define to 1 if you have getpeerucred */
-#cmakedefine HAVE_GETPEERUCRED 1
-
-/* Define to 1 if you have nanosleep */
-#cmakedefine HAVE_NANOSLEEP 1
-
-/* Define to 1 if you have getpwnam_r */
-#cmakedefine HAVE_POSIX_GETPWNAM_R 1
-
-/* Define to 1 if you have socketpair */
-#cmakedefine HAVE_SOCKETPAIR 1
-
-/* Define to 1 if you have setenv */
-#cmakedefine HAVE_SETENV 1
-
-/* Define to 1 if you have unsetenv */
-#cmakedefine HAVE_UNSETENV 1
-
-/* Define to 1 if you have clearenv */
-#cmakedefine HAVE_CLEARENV 1
-
-/* Define to 1 if you have writev */
-#cmakedefine HAVE_WRITEV 1
-
-/* Define to 1 if you have socklen_t */
-#cmakedefine HAVE_SOCKLEN_T 1
-
-/* Define to 1 if you have setlocale */
-#cmakedefine HAVE_SETLOCALE 1
-
-/* Define to 1 if you have localeconv */
-#cmakedefine HAVE_LOCALECONV 1
-
-/* Define to 1 if you have strtoll */
-#cmakedefine HAVE_STRTOLL 1
-
-/* Define to 1 if you have strtoull */
-#cmakedefine HAVE_STRTOULL 1
-
-// structs
-/* Define to 1 if you have struct cmsgred */
-#cmakedefine HAVE_CMSGCRED 1
-
-// system type defines
-#if defined(_WIN32) || defined(_WIN64) || defined (_WIN32_WCE)
-# define DBUS_WIN
-# define DBUS_WIN_FIXME 1
-# ifdef _WIN32_WCE
-# define DBUS_WINCE
-# else
-# define DBUS_WIN32
-# endif
-#else
-# define DBUS_UNIX
-#endif
-
-#if defined(_WIN32) || defined(_WIN64)
-// mingw mode_t
-# ifdef HAVE_STDIO_H
-# include <stdio.h>
-# endif
-# ifndef _MSC_VER
-# define uid_t int
-# define gid_t int
-# else
-# define snprintf _snprintf
- typedef int mode_t;
-# if !defined(_WIN32_WCE)
-# define strtoll _strtoi64
-# define strtoull _strtoui64
-# define HAVE_STRTOLL 1
-# define HAVE_STRTOULL 1
-# endif
-# endif
-#endif // defined(_WIN32) || defined(_WIN64)
-
-#ifdef interface
-#undef interface
-#endif
-
-#ifndef SIGHUP
-#define SIGHUP 1
-#endif
-
-#cmakedefine DBUS_VERBOSE_C_S 1
-#ifdef DBUS_VERBOSE_C_S
-#define _dbus_verbose_C_S printf
-#else
-#define _dbus_verbose_C_S _dbus_verbose
-#endif
-
-# if defined(_MSC_VER) && !defined(inline)
-#define inline __inline
-#endif
-
-#endif // _DBUS_CONFIG_H
diff --git a/src/3rd_party/dbus-1.7.8/cmake/dbus-env.bat.cmake b/src/3rd_party/dbus-1.7.8/cmake/dbus-env.bat.cmake
deleted file mode 100644
index d859ce0361..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/dbus-env.bat.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-:: environment setting for dbus clients
-@echo off
-
-:: session bus address
-set DBUS_SESSION_BUS_ADDRESS=@DBUS_SESSION_BUS_CONNECT_ADDRESS@
-
-:: system bus address
-set DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
diff --git a/src/3rd_party/dbus-1.7.8/cmake/dbus/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/dbus/CMakeLists.txt
deleted file mode 100644
index 0205f85295..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/dbus/CMakeLists.txt
+++ /dev/null
@@ -1,316 +0,0 @@
-project(dbus-lib)
-
-SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus)
-
-configure_file(${DBUS_DIR}/dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
-
-add_definitions(-DDBUS_COMPILATION)
-
-set (dbusinclude_HEADERS
- ${DBUS_DIR}/dbus.h
- ${DBUS_DIR}/dbus-address.h
- ${DBUS_DIR}/dbus-bus.h
- ${DBUS_DIR}/dbus-connection.h
- ${DBUS_DIR}/dbus-errors.h
- ${DBUS_DIR}/dbus-macros.h
- ${DBUS_DIR}/dbus-memory.h
- ${DBUS_DIR}/dbus-message.h
- ${DBUS_DIR}/dbus-misc.h
- ${DBUS_DIR}/dbus-pending-call.h
- ${DBUS_DIR}/dbus-protocol.h
- ${DBUS_DIR}/dbus-server.h
- ${DBUS_DIR}/dbus-shared.h
- ${DBUS_DIR}/dbus-signature.h
- ${DBUS_DIR}/dbus-syntax.h
- ${DBUS_DIR}/dbus-threads.h
- ${DBUS_DIR}/dbus-types.h
- dbus-arch-deps.h
-)
-
-### source code that goes in the installed client library
-### and is specific to library functionality
-set (DBUS_LIB_SOURCES
- ${DBUS_DIR}/dbus-address.c
- ${DBUS_DIR}/dbus-auth.c
- ${DBUS_DIR}/dbus-bus.c
- ${DBUS_DIR}/dbus-connection.c
- ${DBUS_DIR}/dbus-credentials.c
- ${DBUS_DIR}/dbus-errors.c
- ${DBUS_DIR}/dbus-keyring.c
- ${DBUS_DIR}/dbus-marshal-header.c
- ${DBUS_DIR}/dbus-marshal-byteswap.c
- ${DBUS_DIR}/dbus-marshal-recursive.c
- ${DBUS_DIR}/dbus-marshal-validate.c
- ${DBUS_DIR}/dbus-message.c
- ${DBUS_DIR}/dbus-misc.c
- ${DBUS_DIR}/dbus-nonce.c
- ${DBUS_DIR}/dbus-object-tree.c
- ${DBUS_DIR}/dbus-pending-call.c
- ${DBUS_DIR}/dbus-resources.c
- ${DBUS_DIR}/dbus-server.c
- ${DBUS_DIR}/dbus-server-socket.c
- ${DBUS_DIR}/dbus-server-debug-pipe.c
- ${DBUS_DIR}/dbus-sha.c
- ${DBUS_DIR}/dbus-signature.c
- ${DBUS_DIR}/dbus-syntax.c
- ${DBUS_DIR}/dbus-timeout.c
- ${DBUS_DIR}/dbus-threads.c
- ${DBUS_DIR}/dbus-transport.c
- ${DBUS_DIR}/dbus-transport-socket.c
- ${DBUS_DIR}/dbus-watch.c
-)
-
-
-if(UNIX)
- set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
- ${DBUS_DIR}/dbus-transport-unix.c
- ${DBUS_DIR}/dbus-server-unix.c
- )
-else(UNIX)
- set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
- ${DBUS_DIR}/dbus-transport-win.c
- ${DBUS_DIR}/dbus-server-win.c
- )
-endif(UNIX)
-
-set (DBUS_LIB_HEADERS
- ${DBUS_DIR}/dbus-auth.h
- ${DBUS_DIR}/dbus-connection-internal.h
- ${DBUS_DIR}/dbus-credentials.h
- ${DBUS_DIR}/dbus-keyring.h
- ${DBUS_DIR}/dbus-marshal-header.h
- ${DBUS_DIR}/dbus-marshal-byteswap.h
- ${DBUS_DIR}/dbus-marshal-recursive.h
- ${DBUS_DIR}/dbus-marshal-validate.h
- ${DBUS_DIR}/dbus-message-internal.h
- ${DBUS_DIR}/dbus-message-private.h
- ${DBUS_DIR}/dbus-misc.h
- ${DBUS_DIR}/dbus-object-tree.h
- ${DBUS_DIR}/dbus-protocol.h
- ${DBUS_DIR}/dbus-resources.h
- ${DBUS_DIR}/dbus-server-debug-pipe.h
- ${DBUS_DIR}/dbus-server-protected.h
- ${DBUS_DIR}/dbus-server-unix.h
- ${DBUS_DIR}/dbus-sha.h
- ${DBUS_DIR}/dbus-timeout.h
- ${DBUS_DIR}/dbus-threads.h
- ${DBUS_DIR}/dbus-threads-internal.h
- ${DBUS_DIR}/dbus-transport.h
- ${DBUS_DIR}/dbus-transport-protected.h
- ${DBUS_DIR}/dbus-watch.h
- ${CMAKE_BINARY_DIR}/config.h
-)
-if(UNIX)
- set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
- ${DBUS_DIR}/dbus-transport-unix.h
- )
-else(UNIX)
- set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
- ${DBUS_DIR}/dbus-transport-win.h
- )
-endif(UNIX)
-
-
-### source code that goes in the installed client library
-### AND is generic utility functionality used by the
-### daemon or test programs (all symbols in here should
-### be underscore-prefixed)
-set (DBUS_SHARED_SOURCES
- ${DBUS_DIR}/dbus-dataslot.c
- ${DBUS_DIR}/dbus-file.c
- ${DBUS_DIR}/dbus-hash.c
- ${DBUS_DIR}/dbus-internals.c
- ${DBUS_DIR}/dbus-list.c
- ${DBUS_DIR}/dbus-marshal-basic.c
- ${DBUS_DIR}/dbus-memory.c
- ${DBUS_DIR}/dbus-mempool.c
- ${DBUS_DIR}/dbus-string.c
- ${DBUS_DIR}/dbus-sysdeps.c
- ${DBUS_DIR}/dbus-pipe.c
-)
-
-set (DBUS_SHARED_HEADERS
- ${DBUS_DIR}/dbus-dataslot.h
- ${DBUS_DIR}/dbus-file.h
- ${DBUS_DIR}/dbus-hash.h
- ${DBUS_DIR}/dbus-internals.h
- ${DBUS_DIR}/dbus-list.h
- ${DBUS_DIR}/dbus-marshal-basic.h
- ${DBUS_DIR}/dbus-mempool.h
- ${DBUS_DIR}/dbus-string.h
- ${DBUS_DIR}/dbus-string-private.h
- ${DBUS_DIR}/dbus-pipe.h
- ${DBUS_DIR}/dbus-sysdeps.h
-)
-
-### source code that is generic utility functionality used
-### by the bus daemon or test apps, but is NOT included
-### in the D-BUS client library (all symbols in here
-### should be underscore-prefixed but don't really need
-### to be unless they move to DBUS_SHARED_SOURCES later)
-set (DBUS_UTIL_SOURCES
- ${DBUS_DIR}/dbus-asv-util.c
- ${DBUS_DIR}/dbus-auth-script.c
- ${DBUS_DIR}/dbus-auth-util.c
- ${DBUS_DIR}/dbus-credentials-util.c
- ${DBUS_DIR}/dbus-mainloop.c
- ${DBUS_DIR}/dbus-marshal-byteswap-util.c
- ${DBUS_DIR}/dbus-marshal-recursive-util.c
- ${DBUS_DIR}/dbus-marshal-validate-util.c
- ${DBUS_DIR}/dbus-message-factory.c
- ${DBUS_DIR}/dbus-message-util.c
- ${DBUS_DIR}/dbus-shell.c
- ${DBUS_DIR}/dbus-socket-set.c
- ${DBUS_DIR}/dbus-socket-set-poll.c
- ${DBUS_DIR}/dbus-string-util.c
- ${DBUS_DIR}/dbus-sysdeps-util.c
-)
-
-if (DBUS_ENABLE_EMBEDDED_TESTS)
- set (DBUS_UTIL_SOURCES
- ${DBUS_UTIL_SOURCES}
- ${DBUS_DIR}/dbus-test.c
- )
-endif (DBUS_ENABLE_EMBEDDED_TESTS)
-
-set (DBUS_UTIL_HEADERS
- ${DBUS_DIR}/dbus-asv-util.h
- ${DBUS_DIR}/dbus-auth-script.h
- ${DBUS_DIR}/dbus-mainloop.h
- ${DBUS_DIR}/dbus-message-factory.h
- ${DBUS_DIR}/dbus-shell.h
- ${DBUS_DIR}/dbus-socket-set.h
- ${DBUS_DIR}/dbus-spawn.h
- ${DBUS_DIR}/dbus-test.h
-)
-
-### platform specific settings
-if (WIN32)
- set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
- ${DBUS_DIR}/dbus-file-win.c
- ${DBUS_DIR}/dbus-init-win.cpp
- ${DBUS_DIR}/dbus-sysdeps-win.c
- ${DBUS_DIR}/dbus-pipe-win.c
- ${DBUS_DIR}/dbus-sysdeps-thread-win.c
- )
- set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
- ${DBUS_DIR}/dbus-sockets-win.h
- ${DBUS_DIR}/dbus-sysdeps-win.h
- )
- set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
- ${DBUS_DIR}/dbus-spawn-win.c
- ${DBUS_DIR}/dbus-sysdeps-util-win.c
- )
- if(WINCE)
- set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
- ${DBUS_DIR}/dbus-sysdeps-wince-glue.c
- )
- set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
- ${DBUS_DIR}/dbus-sysdeps-wince-glue.h
- )
- endif(WINCE)
-else (WIN32)
- set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
- ${DBUS_DIR}/dbus-file-unix.c
- ${DBUS_DIR}/dbus-pipe-unix.c
- ${DBUS_DIR}/dbus-sysdeps-unix.c
- ${DBUS_DIR}/dbus-sysdeps-pthread.c
- ${DBUS_DIR}/dbus-userdb.c
- ${DBUS_DIR}/sd-daemon.c
- )
- set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
- ${DBUS_DIR}/dbus-server-unix.h
- ${DBUS_DIR}/dbus-transport-unix.h
- ${DBUS_DIR}/dbus-sysdeps-unix.h
- ${DBUS_DIR}/dbus-userdb.h
- ${DBUS_DIR}/sd-daemon.h
- )
- set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
- ${DBUS_DIR}/dbus-spawn.c
- ${DBUS_DIR}/dbus-userdb-util.c
- ${DBUS_DIR}/dbus-sysdeps-util-unix.c
- )
-endif (WIN32)
-
-set(libdbus_SOURCES
- ${DBUS_LIB_SOURCES}
- ${DBUS_SHARED_SOURCES}
-)
-
-set(libdbus_HEADERS
- ${DBUS_LIB_HEADERS}
- ${DBUS_SHARED_HEADERS}
-)
-if (MSVC)
- set (BUILD_FILEVERSION ${DBUS_MAJOR_VERSION},${DBUS_MINOR_VERSION},${DBUS_MICRO_VERSION},${DBUS_PATCH_VERSION})
- set (BUILD_TIMESTAMP ${DBUS_BUILD_TIMESTAMP})
-
- configure_file(${DBUS_DIR}/versioninfo.rc.in ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/afxres.h "")
- list(APPEND libdbus_SOURCES versioninfo.rc)
- set_source_files_properties(versioninfo.rc COMPILE_FLAGS "-D__LINE__=1")
-endif (MSVC)
-
-if(MSVC_IDE)
- project_source_group(${GROUP_CODE} DBUS_LIB_SOURCES DBUS_LIB_HEADERS)
- project_source_group(${GROUP_CODE} DBUS_SHARED_SOURCES DBUS_SHARED_HEADERS)
- project_source_group(${GROUP_CODE} DBUS_UTIL_SOURCES DBUS_UTIL_SOURCES)
-endif(MSVC_IDE)
-
-### Client library
-
-add_library(dbus-1 SHARED
- ${libdbus_SOURCES}
- ${libdbus_HEADERS}
-)
-if(WIN32)
- if(WINCE)
- target_link_libraries(dbus-1 ws2)
- else(WINCE)
- target_link_libraries(dbus-1 ws2_32 advapi32 netapi32 iphlpapi)
- endif(WINCE)
-else(WIN32)
- target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT} rt)
-endif(WIN32)
-
-install(TARGETS dbus-1 ${INSTALL_TARGETS_DEFAULT_ARGS})
-install_files(/include/dbus FILES ${dbusinclude_HEADERS})
-
-### Internal library, used for the daemon, tools and tests, compiled statically.
-
-add_library(dbus-internal ${DBUS_INTERNAL_ADD_LIBRARY_OPTIONS}
- ${DBUS_LIB_SOURCES}
- ${DBUS_LIB_HEADERS}
- ${DBUS_SHARED_SOURCES}
- ${DBUS_SHARED_HEADERS}
- ${DBUS_UTIL_SOURCES}
- ${DBUS_UTIL_HEADERS}
-)
-target_link_libraries(dbus-internal)
-set_target_properties(dbus-internal PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_LIBRARY_DEFINITIONS})
-if(WIN32)
- if(WINCE)
- target_link_libraries(dbus-internal ws2)
- else(WINCE)
- target_link_libraries(dbus-internal ws2_32 advapi32 netapi32 iphlpapi)
- endif(WINCE)
-else(WIN32)
- target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT} rt)
-endif(WIN32)
-
-if (DBUS_ENABLE_EMBEDDED_TESTS)
- set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
- ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
- target_link_libraries(dbus-test ${DBUS_INTERNAL_LIBRARIES})
- add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
- set_target_properties(dbus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-ENDIF (DBUS_ENABLE_EMBEDDED_TESTS)
-
-if (UNIX)
-# set version info
-ENDIF (UNIX)
-
-
-## mop up the gcov files
-#clean-local:
-#/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
diff --git a/src/3rd_party/dbus-1.7.8/cmake/doc/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/doc/CMakeLists.txt
deleted file mode 100644
index 7fdfc2196f..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/doc/CMakeLists.txt
+++ /dev/null
@@ -1,154 +0,0 @@
-find_package(Doxygen)
-
-if(DOXYGEN_EXECUTABLE)
- OPTION(DBUS_ENABLE_DOXYGEN_DOCS "build DOXYGEN documentation (requires Doxygen)" ON)
-endif(DOXYGEN_EXECUTABLE)
-
-if (DBUS_ENABLE_DOXYGEN_DOCS)
- set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
- configure_file(${CMAKE_SOURCE_DIR}/../Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
- add_custom_target(doc
- COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- )
-endif (DBUS_ENABLE_DOXYGEN_DOCS)
-
-#
-# find docbook generator
-#
-find_program(MEINPROC4_EXECUTABLE meinproc4)
-
-find_program(XMLTO_EXECUTABLE xmlto)
-
-if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
- OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON)
- ADD_CUSTOM_TARGET(xmldoc ALL)
-endif (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
-
-if (XMLTO_EXECUTABLE)
- set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE)
- set(DBUS_XML_DOCS_ENABLED 1)
- set(MEINPROC4_EXECUTABLE 0)
- MESSAGE(STATUS "xmlto docbook generator found")
- set(STYLESHEET_MAN "${DOCBOOKXSL_DIR}/manpages/docbook.xsl")
- set(STYLESHEET_HTML "${DOCBOOKXSL_DIR}/html/docbook.xsl")
-
-elseif (MEINPROC4_EXECUTABLE)
- set(DOCBOOK_GENERATOR_NAME "meinproc4" PARENT_SCOPE)
- set(DBUS_XML_DOCS_ENABLED 1)
- if(WIN32)
- get_filename_component(_a ${MEINPROC4_EXECUTABLE} PATH)
- get_filename_component(_meinproc_install_path ${_a} PATH)
- set(STYLESHEET_HTML "${_meinproc_install_path}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl")
- else(WIN32)
- set(STYLESHEET_HTML file:///usr/share/kde4/apps/ksgmltools2/customization/kde-nochunk.xsl)
- endif(WIN32)
-endif ()
-
-if (DBUS_ENABLE_XML_DOCS)
-
-macro (DOCBOOK _sources _format)
- get_filename_component(_infile ${_sources} ABSOLUTE)
- get_filename_component(_name ${_infile} NAME)
- set(_deps ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
-
- if (${_format} STREQUAL "man")
- string(REPLACE ".xml" "" _outname ${_name})
- set(STYLESHEET ${STYLESHEET_MAN})
- else()
- string(REPLACE ".xml" ".html" _outname ${_name})
- set(STYLESHEET ${STYLESHEET_HTML})
- endif ()
-
- set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname})
- if (EXISTS ${_sources})
- if (MEINPROC4_EXECUTABLE)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_outfile}
- COMMAND ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
- DEPENDS ${_infile} ${STYLESHEET} ${_deps}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
- endif ()
- if (XMLTO_EXECUTABLE)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_outfile}
- COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}
- DEPENDS ${_infile} ${_deps}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
- endif ()
- if (${_format} STREQUAL "man")
- install(FILES ${_outfile} DESTINATION share/man/man1)
- else ()
- install(FILES ${_outfile} DESTINATION share/doc/dbus)
- endif ()
- else ()
- MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found")
- endif ()
- ADD_CUSTOM_TARGET(${_outname} DEPENDS ${_outfile})
- ADD_DEPENDENCIES(xmldoc ${_outname})
-endmacro (DOCBOOK)
-
-### copy tests to builddir so that generated tests and static tests
-### are all in one place.
-### todo how to add more filetypes
-MACRO (COPYDIR _src _type)
- FOREACH(FILE_TYPE ${_type})
- FOREACH(DIR ${_src})
- FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
- FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
- FOREACH(FILE ${FILES})
- GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
- SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
- IF (CONFIG_VERBOSE)
- MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
- ENDIF (CONFIG_VERBOSE)
- ENDFOREACH(FILE)
- ENDFOREACH(DIR)
- ENDFOREACH(FILE_TYPE)
-ENDMACRO (COPYDIR)
-
-COPYDIR(doc *.png)
-COPYDIR(doc *.svg)
-
-DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-test-plan.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-tutorial.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-specification.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-faq.xml html-nochunks)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-cleanup-sockets.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-daemon.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-launch.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-monitor.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-send.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml)
-configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-uuidgen.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml html-nochunks)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml html-nochunks)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml html-nochunks)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml html-nochunks)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml html-nochunks)
-DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml html-nochunks)
-if (UNIX)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml man)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml man)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml man)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml man)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml man)
- DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml man)
-endif()
-#
-# handle html index file
-#
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index.html.cmake ${CMAKE_CURRENT_BINARY_DIR}/index.html )
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html DESTINATION share/doc/dbus)
-
-set (EXTRA_DIST
- ${CMAKE_SOURCE_DIR}/../doc/busconfig.dtd
- ${CMAKE_SOURCE_DIR}/../doc/introspect.dtd
- ${CMAKE_SOURCE_DIR}/../doc/introspect.xsl
-)
-
-install(FILES ${EXTRA_DIST} DESTINATION share/doc/dbus)
-
-endif(DBUS_ENABLE_XML_DOCS)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/doc/index.html.cmake b/src/3rd_party/dbus-1.7.8/cmake/doc/index.html.cmake
deleted file mode 100644
index 77dd6614ef..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/doc/index.html.cmake
+++ /dev/null
@@ -1,55 +0,0 @@
-<html>
-<head>
-<title>D-Bus Documentation Index</title>
-</head>
-<body>
-<h1>D-Bus Documentation Index</h1>
-<p>Version @DBUS_VERSION_STRING@</p>
-
-<table>
- <tr>
- <th width=10%>
- </th>
- <th width=30% align=left>
- generic documentation
- </th>
- <th width=30% align=left>
-application manuals
- </th>
- </tr>
- <tr>
- <td valign=top>
- </td>
- <td valign=top>
-<a href="http://dbus.freedesktop.org">D-Bus Website</a>
- <br>
- <br>
-<a href="dbus-tutorial.html">D-Bus Tutorial</a>
- <br>
- <br>
-<a href="dbus-specification.html">D-Bus Specification</a>
- <br>
- <br>
-<a href="dbus-faq.html">D-Bus FAQ</a>
- <br>
- <br>
-<a href="dbus-test-plan.html">D-Bus Test Plan</a>
- <br>
- <br>
- </td>
- <td valign=top>
-<a href="dbus-daemon.html">D-Bus Daemon manual</a>
- <br>
- <br>
-<a href="dbus-launch.html">D-Bus launch manual</a>
- <br>
- <br>
-<a href="dbus-send.html">D-Bus send tool manual</a>
- <br>
- <br>
-<a href="dbus-monitor.html">D-Bus monitor manual</a>
- </td>
- </tr>
-</table>
-</body>
-</html>
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/CPackInstallConfig.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/CPackInstallConfig.cmake
deleted file mode 100644
index 74b6689880..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/CPackInstallConfig.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
-
-if (DBUS_INSTALL_SYSTEM_LIBS)
- if (MINGW)
- install_files(/bin FILES ${LIBEXPAT_LIBRARIES})
- else (MINGW)
- INCLUDE(InstallRequiredSystemLibraries)
- endif (MINGW)
-endif (DBUS_INSTALL_SYSTEM_LIBS)
-
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "D-BUS For Windows")
-SET(CPACK_PACKAGE_VENDOR "D-BUS Windows Team")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/../README")
-SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/../COPYING")
-# duplicated from VERSION
-SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
-SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
-SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
-#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "dbus ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "dbus")
-IF(WIN32 AND NOT UNIX)
- SET(CPACK_GENERATOR NSIS ZIP) # can be NSIS, STGZ, TBZ2, TGZ, TZ and ZIP
- SET(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
- # There is a bug in NSI that does not handle full unix paths properly. Make
- # sure there is at least one set of four (4) backlasshes.
-# SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
- SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\dbus-launch.bat")
- SET(CPACK_NSIS_DISPLAY_NAME "D-Bus for Windows")
- SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\sourceforge.net/projects/windbus")
- SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\sourceforge.net/projects/windbus")
- SET(CPACK_NSIS_CONTACT "me@my-personal-home-page.com")
- SET(CPACK_NSIS_MODIFY_PATH ON)
-ELSE(WIN32 AND NOT UNIX)
- SET(CPACK_STRIP_FILES "bin/MyExecutable")
- SET(CPACK_SOURCE_STRIP_FILES "")
-ENDIF(WIN32 AND NOT UNIX)
-SET(CPACK_PACKAGE_EXECUTABLES "dbus-launch" "D-Bus Daemon")
-INCLUDE(CPack)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckForAbstractSockets.c b/src/3rd_party/dbus-1.7.8/cmake/modules/CheckForAbstractSockets.c
deleted file mode 100644
index 062b846c39..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckForAbstractSockets.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-
-int main() {
- int listen_fd;
- struct sockaddr_un addr;
-
- listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
- if (listen_fd < 0)
- {
- fprintf (stderr, "socket() failed: %s\n", strerror (errno));
- exit (1);
- }
-
- memset (&addr, '\0', sizeof (addr));
- addr.sun_family = AF_UNIX;
- strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
- addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
- {
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- exit (0);
-} \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckPrototypeExists.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/CheckPrototypeExists.cmake
deleted file mode 100644
index da319f13a5..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckPrototypeExists.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# - Check if the prototype for a function exists.
-# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
-#
-# FUNCTION - the name of the function you are looking for
-# HEADER - the header(s) where the prototype should be declared
-# VARIABLE - variable to store the result
-#
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-
-INCLUDE(CheckCXXSourceCompiles)
-
-MACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
- SET(_INCLUDE_FILES)
- FOREACH (it ${_HEADER})
- SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
- ENDFOREACH (it)
-
- SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
-${_INCLUDE_FILES}
-int main()
-{
-#ifndef ${_SYMBOL}
- int i = sizeof(&${_SYMBOL});
-#endif
- return 0;
-}
-")
- CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
-ENDMACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckStructMember.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/CheckStructMember.cmake
deleted file mode 100644
index fd5d3461b1..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/CheckStructMember.cmake
+++ /dev/null
@@ -1,36 +0,0 @@
-# - Check if the given struct or class has the specified member variable
-# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
-#
-# STRUCT - the name of the struct or class you are interested in
-# MEMBER - the member which existence you want to check
-# HEADER - the header(s) where the prototype should be declared
-# VARIABLE - variable to store the result
-#
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-
-INCLUDE(CheckCXXSourceCompiles)
-
-MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
- SET(_INCLUDE_FILES)
- FOREACH (it ${_HEADER})
- SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
- ENDFOREACH (it)
-
- SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
-${_INCLUDE_FILES}
-int main()
-{
- ${_STRUCT}* tmp;
- tmp->${_MEMBER};
- return 0;
-}
-")
- CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
-
-ENDMACRO (CHECK_STRUCT_MEMBER)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/FindDoxygen.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/FindDoxygen.cmake
deleted file mode 100644
index 1767901e78..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/FindDoxygen.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-
-find_program(DOXYGEN_EXECUTABLE NAMES doxygen DOC "doxygen executable")
-mark_as_advanced(DOXYGEN_EXECUTABLE)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/FindGLIB.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/FindGLIB.cmake
deleted file mode 100644
index 1fdaee9597..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/FindGLIB.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# - Try to find the GLIB library
-# Once done this will define
-#
-# GLIB_FOUND - system has GLIB
-# GLIB_INCLUDES - the GLIB include directories
-# GLIB_LIBRARIES - The libraries needed to use GLIB
-
-if (WIN32)
-
-INCLUDE(MacroGetenvWinPath)
-
-MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES)
-
-FIND_PATH(GLIB_INCLUDE_DIR glib.h
- ${_program_FILES_DIR}/glib/include/glib-2.0
-)
-
-
-# search for GLIB in the default install directory for applications (default of (n)make install)
-FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0
- PATHS
- ${_program_FILES_DIR}/glib/lib
-)
-
-if (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
- set(GLIB_FOUND TRUE)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GLIB_INCLUDES})
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLIB_LIBRARIES})
-
-endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
-
-if (GLIB_FOUND)
- if (NOT GLIB_FIND_QUIETLY)
- message(STATUS "Found GLIB: ${GLIB_LIBRARY}")
- endif (NOT GLIB_FIND_QUIETLY)
-else (GLIB_FOUND)
- if (GLIB_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find GLIB library")
- endif (GLIB_FIND_REQUIRED)
-endif (GLIB_FOUND)
-
-endif (WIN32)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/FindLibIconv.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/FindLibIconv.cmake
deleted file mode 100644
index dac63449fa..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/FindLibIconv.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# - Try to find LibIconv
-# Once done this will define
-#
-# LIBICONV_FOUND - system has LibIconv
-# LIBICONV_INCLUDE_DIR - the LibIconv include directory
-# LIBICONV_LIBRARIES - the libraries needed to use LibIconv
-# LIBICONV_DEFINITIONS - Compiler switches required for using LibIconv
-
-if (LIBICONV_INCLUDE_DIR AND LIBICONV_LIBRARIES)
-
- # in cache already
- SET(LIBICONV_FOUND TRUE)
-
-else (LIBICONV_INCLUDE_DIR AND LIBICONV_LIBRARIES)
-
- IF (NOT WIN32)
- MESSAGE(FATAL_ERROR "Please set this to the correct values!")
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
- PKGCONFIG(libiconv-1.9 _LibIconvIncDir _LibIconvLinkDir _LibIconvLinkFlags _LiIconvCflags)
- SET(LIBICONV_DEFINITIONS ${_LibIconvCflags})
- ENDIF (NOT WIN32)
-
- FIND_PATH(LIBICONV_INCLUDE_DIR iconv.h
- PATHS
- ${_LibIconvIncDir}
- PATH_SUFFIXES libiconv
- )
-
- FIND_LIBRARY(LIBICONV_LIBRARIES NAMES iconv libiconv
- PATHS
- ${_LibIconvLinkDir}
- )
-
- if (LIBICONV_INCLUDE_DIR AND LIBICONV_LIBRARIES)
- set(LIBICONV_FOUND TRUE)
- endif (LIBICONV_INCLUDE_DIR AND LIBICONV_LIBRARIES)
-
- if (LIBICONV_FOUND)
- if (NOT LibIconv_FIND_QUIETLY)
- message(STATUS "Found LibIconv: ${LIBICONV_LIBRARIES}")
- endif (NOT LibIconv_FIND_QUIETLY)
- else (LIBICONV_FOUND)
- if (LibIconv_FIND_REQUIRED)
- message(SEND_ERROR "Could NOT find LibIconv")
- endif (LibIconv_FIND_REQUIRED)
- endif (LIBICONV_FOUND)
-
- MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARIES)
-
-endif (LIBICONV_INCLUDE_DIR AND LIBICONV_LIBRARIES)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroGetenvWinPath.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/MacroGetenvWinPath.cmake
deleted file mode 100644
index b18f7f639a..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroGetenvWinPath.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-
-MACRO (MACRO_GETENV_WIN_PATH var name)
- set(${var} $ENV{${name}})
- STRING(REGEX REPLACE "\\\\" "/" ${var} "${${var}}")
-ENDMACRO (MACRO_GETENV_WIN_PATH var name)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroLibrary.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/MacroLibrary.cmake
deleted file mode 100644
index 6523530cac..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroLibrary.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-# - include MacroLibrary offers a collection of macros which extend the built-in cmake commands
-# OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
-
-INCLUDE(MacroOptionalFindPackage)
-#INCLUDE(MacroAdditionalCleanFiles)
-#INCLUDE(MacroAddFileDependencies)
-#INCLUDE(MacroGetenvWinPath)
-#INCLUDE(MacroEnsureOutOfSourceBuild)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroOptionalFindPackage.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/MacroOptionalFindPackage.cmake
deleted file mode 100644
index 7068131202..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/MacroOptionalFindPackage.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION()
-# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
-# This macro is a combination of OPTION() and FIND_PACKAGE(), it
-# works like FIND_PACKAGE(), but additionally it automatically creates
-# an option name WITH_<name>, which can be disabled via the cmake GUI.
-# or via -DWITH_<name>=OFF
-# The standard <name>_FOUND variables can be used in the same way
-# as when using the normal FIND_PACKAGE()
-
-MACRO (MACRO_OPTIONAL_FIND_PACKAGE _name )
- OPTION(WITH_${_name} "Search for ${_name} package" ON)
- if (WITH_${_name})
- FIND_PACKAGE(${_name} ${ARGN})
- else (WITH_${_name})
- set(${_name}_FOUND)
- set(${_name}_INCLUDE_DIR)
- set(${_name}_INCLUDES)
- set(${_name}_LIBRARY)
- set(${_name}_LIBRARIES)
- endif (WITH_${_name})
-ENDMACRO (MACRO_OPTIONAL_FIND_PACKAGE)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/Macros.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/Macros.cmake
deleted file mode 100644
index adb34b5161..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/Macros.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-
-MACRO(TIMESTAMP RESULT)
- if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
- EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE DATE)
- string(REGEX REPLACE "(..)[/.](..)[/.](....).*" "\\3\\2\\1" DATE ${DATE})
- EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE TIME)
- string(REGEX REPLACE "(..):(..)" "\\1\\2" TIME ${TIME})
- set (${RESULT} "${DATE}${TIME}")
- else ()
- EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT})
- endif ()
-ENDMACRO()
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/MacrosAutotools.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/MacrosAutotools.cmake
deleted file mode 100644
index 68e8ae5126..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/MacrosAutotools.cmake
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# @Author Ralf Habacker
-#
-# extracts version information from autoconf config file
-# and set related cmake variables
-#
-# returns
-# ${prefix}_VERSION
-# ${prefix}_VERSION_STRING
-# ${prefix}_MAJOR_VERSION
-# ${prefix}_MINOR_VERSION
-# ${prefix}_MICRO_VERSION
-#
-macro(autoversion config prefix)
- file (READ ${config} _configure_ac)
- string(TOUPPER ${prefix} prefix_upper)
- string (REGEX REPLACE ".*${prefix}_major_version], .([0-9]+).*" "\\1" ${prefix_upper}_MAJOR_VERSION ${_configure_ac})
- string (REGEX REPLACE ".*${prefix}_minor_version], .([0-9]+).*" "\\1" ${prefix_upper}_MINOR_VERSION ${_configure_ac})
- string (REGEX REPLACE ".*${prefix}_micro_version], .([0-9]+).*" "\\1" ${prefix_upper}_MICRO_VERSION ${_configure_ac})
- set (${prefix_upper}_VERSION ${${prefix_upper}_MAJOR_VERSION}.${${prefix_upper}_MINOR_VERSION}.${${prefix_upper}_MICRO_VERSION})
- set (${prefix_upper}_VERSION_STRING "${${prefix_upper}_VERSION}")
-
-endmacro()
-
-#
-# Defines package related variables (PACKAGE_..., PACKAGE and VERSION)
-# as done by autotools.
-#
-# Additional it defines a cmake variable named PACKAGE_CONFIG_H_TEMPLATE
-# which could be placed in config.h templates to have those variables
-# defined at code level like shown below:
-#
-# config.h.template
-# ...
-# @AUTOPACKAGE_CONFIG_H_TEMPLATE@
-# ...
-#
-macro(autopackage name version url support_url)
- # Define to the full name of this package.
- set(PACKAGE_NAME ${name})
-
- # Define to the version of this package.
- set(PACKAGE_VERSION ${version})
-
- # Define to the home page for this package.
- set(PACKAGE_URL ${url})
-
- # Define to the address where bug reports for this package should be sent.
- set(PACKAGE_BUGREPORT ${support_url})
-
- # Define to the full name and version of this package.
- set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-
- # Define to the one symbol short name of this package.
- set(PACKAGE_TARNAME ${PACKAGE_NAME})
-
- set(PACKAGE ${name})
- set(VERSION ${DBUS_VERSION_STRING})
-
- set(AUTOPACKAGE_CONFIG_H_TEMPLATE "/* generated by cmake macro autopackage */\n
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT \"@PACKAGE_BUGREPORT@\"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME \"@PACKAGE_NAME@\"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING \"@PACKAGE_STRING@\"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME \"@PACKAGE_TARNAME@\"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL \"@PACKAGE_URL@\"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION \"@PACKAGE_VERSION@\"
-
-/* defined by autotools package */
-#define PACKAGE \"@PACKAGE@\"
-#define VERSION \"@VERSION@\"
-")
-endmacro(autopackage)
-
-#
-# parses config.h template and create cmake equivalent
-# not implemented yet
-#
-macro(autoconfig template output)
- file(READ ${template} contents)
- # Convert file contents into a CMake list (where each element in the list
- # is one line of the file)
- STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}")
- STRING(REGEX REPLACE "\n" ";" contents "${contents}")
- foreach(line contents)
- message(STATUS ${line})
- # find #undef lines
- # append to config.h #define <variable-name> <variable-content>
- endforeach()
-endmacro()
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/ProjectSourceGroup.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/ProjectSourceGroup.cmake
deleted file mode 100644
index 713a67a1ed..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/ProjectSourceGroup.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# folders in the msvc projects
-# mode==flat : headers and ourses in no folders
-# mode==split : standard behavior of cmake, split headers and sources
-# mode== <other values" : code is in this folder
-macro(project_source_group mode sources headers)
- #message(STATUS ${mode})
- #message(STATUS ${sources} ${headers})
- if(${mode} MATCHES "flat")
- source_group("Source Files" Files)
- source_group("Header Files" Files)
- source_group("cmake" FILES CMakeLists.txt)
- else(${mode} MATCHES "flat")
- if(NOT ${mode} MATCHES "split")
- source_group("${mode}" FILES ${${sources}} ${${headers}})
- endif(NOT ${mode} MATCHES "split")
- endif(${mode} MATCHES "flat")
-endmacro(project_source_group mode sources headers)
-
diff --git a/src/3rd_party/dbus-1.7.8/cmake/modules/Win32Macros.cmake b/src/3rd_party/dbus-1.7.8/cmake/modules/Win32Macros.cmake
deleted file mode 100644
index 4385cc97e1..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/modules/Win32Macros.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# win32 macros
-#
-# Copyright (c) 2006-2007, Ralf Habacker
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-#
-
-if (WIN32)
- #
- # addExplorerWrapper creates batch files for fast access
- # to the build environment from the win32 explorer.
- #
- # For mingw and nmake projects it's opens a command shell,
- # for Visual Studio IDE's (at least tested with VS 8 2005) it
- # opens the related .sln file with paths setting specified at
- # configure time.
- #
- MACRO (addExplorerWrapper _projectname)
- # write explorer wrappers
- get_filename_component(CMAKE_BIN_PATH ${CMAKE_COMMAND} PATH)
- set (ADD_PATH "${CMAKE_BIN_PATH}")
-
- if (QT_QMAKE_EXECUTABLE)
- get_filename_component(QT_BIN_PATH ${QT_QMAKE_EXECUTABLE} PATH)
- set (ADD_PATH "${ADD_PATH};${QT_BIN_PATH}")
- endif (QT_QMAKE_EXECUTABLE)
-
- # add here more pathes
-
- if (MINGW)
- get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
- set (ADD_PATH "${ADD_PATH};${MINGW_BIN_PATH}")
- write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncmd.exe")
- else (MINGW)
- if (CMAKE_BUILD_TOOL STREQUAL "nmake")
- get_filename_component(VC_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
- write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncall \"${VC_BIN_PATH}\\vcvars32.bat\"\ncmd.exe")
- else (CMAKE_BUILD_TOOL STREQUAL "nmake")
- write_file (${CMAKE_BINARY_DIR}/${_projectname}-sln.bat "set PATH=${ADD_PATH};%PATH%\nstart ${_projectname}.sln")
- endif (CMAKE_BUILD_TOOL STREQUAL "nmake")
- endif (MINGW)
- ENDMACRO (addExplorerWrapper)
-endif(WIN32)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/test/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/test/CMakeLists.txt
deleted file mode 100644
index 8657e4c759..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/test/CMakeLists.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-project(test)
-
-add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-
-add_library(dbus-testutils STATIC
- ${CMAKE_SOURCE_DIR}/../test/test-utils.h
- ${CMAKE_SOURCE_DIR}/../test/test-utils.c
-)
-target_link_libraries(dbus-testutils ${DBUS_INTERNAL_LIBRARIES})
-
-add_subdirectory( name-test )
-
-set (test-service_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-service.c
-)
-
-set (test-names_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-names.c
-)
-
-set (break_loader_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/break-loader.c
-)
-
-set (test-shell-service_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-shell-service.c
-)
-
-set (shell-test_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/shell-test.c
-)
-
-set (spawn-test_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/spawn-test.c
-)
-
-set (test-exit_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-exit.c
-)
-
-set (test-segfault_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-segfault.c
-)
-
-set (test-sleep-forever_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/test-sleep-forever.c
-)
-
-add_executable(test-service ${test-service_SOURCES})
-target_link_libraries(test-service dbus-testutils)
-
-add_executable(test-names ${test-names_SOURCES})
-target_link_libraries(test-names dbus-testutils)
-
-add_executable(shell-test ${shell-test_SOURCES})
-target_link_libraries(shell-test ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(shell-test ${EXECUTABLE_OUTPUT_PATH}/shell-test${EXEEXT})
-
-add_executable(test-shell-service ${test-shell-service_SOURCES})
-target_link_libraries(test-shell-service dbus-testutils)
-
-add_executable(spawn-test ${spawn-test_SOURCES})
-target_link_libraries(spawn-test ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-exit ${test-exit_SOURCES})
-target_link_libraries(test-exit ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-segfault ${test-segfault_SOURCES})
-target_link_libraries(test-segfault ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-sleep-forever ${test-sleep-forever_SOURCES})
-target_link_libraries(test-sleep-forever ${DBUS_INTERNAL_LIBRARIES})
-
-### keep these in creation order, i.e. uppermost dirs first
-set (TESTDIRS
- test/data
- test/data/valid-messages
- test/data/invalid-messages
- test/data/incomplete-messages
- test/data/auth
- test/data/sha-1
- test/data/valid-config-files
- test/data/valid-config-files/basic.d
- test/data/valid-config-files/system.d
- test/data/valid-config-files-system
- test/data/valid-introspection-files
- test/data/valid-messages
- test/data/valid-service-files
- test/data/valid-service-files-system
- test/data/invalid-config-files
- test/data/invalid-config-files-system
- test/data/invalid-messages
- test/data/invalid-service-files-system
- test/data/equiv-config-files
- test/data/equiv-config-files/basic
- test/data/equiv-config-files/basic/basic.d
- test/data/equiv-config-files/entities
- test/data/equiv-config-files/entities/basic.d
-)
-set (CONFIG_VERBOSE 0)
-
-### copy tests to builddir so that generated tests and static tests
-### are all in one place.
-MESSAGE(STATUS "Copying test files to test directory")
-FOREACH(FILE_TYPE *.message *.message-raw *.auth-script *.sha1 *.txt *.conf *.service)
- FOREACH(DIR ${TESTDIRS})
- FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
- FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
- FOREACH(FILE ${FILES})
- GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
- SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
- IF (CONFIG_VERBOSE)
- MESSAGE("${FILE}")
- ENDIF (CONFIG_VERBOSE)
- ENDFOREACH(FILE)
- ENDFOREACH(DIR)
-ENDFOREACH(FILE_TYPE)
-
-### generate test files
-MESSAGE(STATUS "Generating test files from templates into test directory")
-
-FOREACH(FILE_TYPE *.conf.in *.service.in)
- FOREACH(DIR ${TESTDIRS})
- FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
- FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
- FOREACH(FILE ${FILES})
- GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
- STRING(REGEX REPLACE "\\.in$" "" FILENAME ${FILENAME})
- SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} @ONLY IMMEDIATE)
- IF (CONFIG_VERBOSE)
- MESSAGE("${FILE}")
- ENDIF (CONFIG_VERBOSE)
- ENDFOREACH(FILE)
- ENDFOREACH(DIR)
-ENDFOREACH(FILE_TYPE)
-
-MESSAGE(STATUS "Copying generated bus config files to test directory")
-set (OUTDIR ${CMAKE_BINARY_DIR}/test/data/valid-config-files)
-
-FILE(GLOB FILES "${CMAKE_BINARY_DIR}/bus/*.conf" )
-FILE(MAKE_DIRECTORY ${OUTDIR})
-FOREACH(FILE ${FILES})
- GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
- SET (TARGET ${OUTDIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
- IF (CONFIG_VERBOSE)
- MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
- ENDIF (CONFIG_VERBOSE)
-ENDFOREACH(FILE)
-
-# todo: for installation the TEST_..._BINARY variables must reflect the
-# installation dir or has to be defined relative
-#
diff --git a/src/3rd_party/dbus-1.7.8/cmake/test/name-test/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/test/name-test/CMakeLists.txt
deleted file mode 100644
index bf096ba7eb..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/test/name-test/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-if (DBUS_ENABLE_EMBEDDED_TESTS)
-
-set (NAMEtest-DIR ../../../test/name-test)
-
-add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-
-add_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c)
-target_link_libraries(test-pending-call-dispatch ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-dispatch ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-dispatch)
-
-add_executable(test-pending-call-timeout ${NAMEtest-DIR}/test-pending-call-timeout.c)
-target_link_libraries(test-pending-call-timeout ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-timeout ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-timeout)
-
-add_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c)
-target_link_libraries(test-thread-init ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-thread-init ${EXECUTABLE_OUTPUT_PATH}/test-thread-init)
-
-add_executable(test-ids ${NAMEtest-DIR}/test-ids.c)
-target_link_libraries(test-ids ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-ids ${EXECUTABLE_OUTPUT_PATH}/test-ids)
-
-add_executable(test-shutdown ${NAMEtest-DIR}/test-shutdown.c)
-target_link_libraries(test-shutdown dbus-testutils)
-ADD_TEST(test-shutdown ${EXECUTABLE_OUTPUT_PATH}/test-shutdown)
-
-add_executable(test-privserver ${NAMEtest-DIR}/test-privserver.c)
-target_link_libraries(test-privserver dbus-testutils)
-ADD_TEST(test-privserver ${EXECUTABLE_OUTPUT_PATH}/test-privserver)
-
-add_executable(test-privserver-client ${NAMEtest-DIR}/test-privserver-client.c)
-target_link_libraries(test-privserver-client dbus-testutils)
-ADD_TEST(test-privserver-client ${EXECUTABLE_OUTPUT_PATH}/test-privserver-client)
-
-add_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c)
-target_link_libraries(test-autolaunch dbus-testutils)
-ADD_TEST(test-autolaunch ${EXECUTABLE_OUTPUT_PATH}/test-autolaunch)
-
-endif (DBUS_ENABLE_EMBEDDED_TESTS)
diff --git a/src/3rd_party/dbus-1.7.8/cmake/tools/CMakeLists.txt b/src/3rd_party/dbus-1.7.8/cmake/tools/CMakeLists.txt
deleted file mode 100644
index 101c7e60d9..0000000000
--- a/src/3rd_party/dbus-1.7.8/cmake/tools/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-project(tools)
-
-set (dbus_send_SOURCES
- ../../tools/dbus-print-message.c
- ../../tools/dbus-print-message.h
- ../../tools/dbus-send.c
-)
-
-set (dbus_monitor_SOURCES
- ../../tools/dbus-monitor.c
- ../../tools/dbus-print-message.c
- ../../tools/dbus-print-message.h
-)
-
-if (WIN32)
-set (dbus_launch_SOURCES
- ../../tools/dbus-launch-win.c
-)
-else (WIN32)
-set (dbus_launch_SOURCES
- ../../tools/dbus-launch.c
-)
-endif (WIN32)
-
-if (DBUS_BUILD_X11)
-set (dbus_launch_SOURCES
- ${dbus_launch_SOURCES}
- ../../tools/dbus-launch-x11.c
-)
-endif(DBUS_BUILD_X11)
-
-set (dbus_cleanup_sockets_SOURCES
- ../../tools/dbus-cleanup-sockets.c
-)
-
-add_executable(dbus-send ${dbus_send_SOURCES})
-target_link_libraries(dbus-send ${DBUS_LIBRARIES})
-install_targets(/bin dbus-send )
-
-add_executable(dbus-launch ${dbus_launch_SOURCES})
-target_link_libraries(dbus-launch )
-if (DBUS_BUILD_X11)
- target_link_libraries(dbus-launch ${X11_LIBRARIES} )
-endif (DBUS_BUILD_X11)
-install_targets(/bin dbus-launch )
-
-add_executable(dbus-monitor ${dbus_monitor_SOURCES})
-target_link_libraries(dbus-monitor ${DBUS_LIBRARIES})
-install_targets(/bin dbus-monitor )
diff --git a/src/3rd_party/dbus-1.7.8/compile b/src/3rd_party/dbus-1.7.8/compile
deleted file mode 100755
index 531136b068..0000000000
--- a/src/3rd_party/dbus-1.7.8/compile
+++ /dev/null
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
- eat=1
- linker_opts="$linker_opts $2"
- ;;
- -*)
- set x "$@" "$1"
- shift
- ;;
- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
- func_file_conv "$1"
- set x "$@" -Tp"$file"
- shift
- ;;
- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
- func_file_conv "$1" mingw
- set x "$@" "$file"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
- done
- if test -n "$linker_opts"; then
- linker_opts="-link$linker_opts"
- fi
- exec "$@" $linker_opts
- exit 1
-}
-
-eat=
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
- func_cl_wrapper "$@" # Doesn't return...
- ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- # So we strip '-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no '-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # '.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/config.guess b/src/3rd_party/dbus-1.7.8/config.guess
deleted file mode 100755
index b79252d6b1..0000000000
--- a/src/3rd_party/dbus-1.7.8/config.guess
+++ /dev/null
@@ -1,1558 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-06-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
-esac
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/config.h.in b/src/3rd_party/dbus-1.7.8/config.h.in
deleted file mode 100644
index 7f9a1f326b..0000000000
--- a/src/3rd_party/dbus-1.7.8/config.h.in
+++ /dev/null
@@ -1,498 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* poll doesn't work on devices */
-#undef BROKEN_POLL
-
-/* Directory for installing the binaries */
-#undef DBUS_BINDIR
-
-/* Define to build X11 functionality */
-#undef DBUS_BUILD_X11
-
-/* whether -export-dynamic was passed to libtool */
-#undef DBUS_BUILT_R_DYNAMIC
-
-/* Use inotify */
-#undef DBUS_BUS_ENABLE_INOTIFY
-
-/* Use kqueue */
-#undef DBUS_BUS_ENABLE_KQUEUE
-
-/* Directory to check for console ownerhip */
-#undef DBUS_CONSOLE_AUTH_DIR
-
-/* File to check for console ownerhip */
-#undef DBUS_CONSOLE_OWNER_FILE
-
-/* Defined if we run on a cygwin API based system */
-#undef DBUS_CYGWIN
-
-/* Directory for installing the DBUS daemon */
-#undef DBUS_DAEMONDIR
-
-/* Name of executable */
-#undef DBUS_DAEMON_NAME
-
-/* Directory for installing DBUS data files */
-#undef DBUS_DATADIR
-
-/* Default for dbus_connection_get_max_message_unix_fds() */
-#undef DBUS_DEFAULT_MESSAGE_UNIX_FDS
-
-/* Disable assertion checking */
-#undef DBUS_DISABLE_ASSERT
-
-/* Disable public API sanity checking */
-#undef DBUS_DISABLE_CHECKS
-
-/* Define to build test code into the library and binaries */
-#undef DBUS_ENABLE_EMBEDDED_TESTS
-
-/* Use launchd autolaunch */
-#undef DBUS_ENABLE_LAUNCHD
-
-/* Define to build independent test binaries */
-#undef DBUS_ENABLE_MODULAR_TESTS
-
-/* Define to enable bus daemon usage statistics */
-#undef DBUS_ENABLE_STATS
-
-/* Support a verbose mode */
-#undef DBUS_ENABLE_VERBOSE_MODE
-
-/* Define to enable X11 auto-launch */
-#undef DBUS_ENABLE_X11_AUTOLAUNCH
-
-/* Extension for executables, typically empty or .exe */
-#undef DBUS_EXEEXT
-
-/* Defined if gcov is enabled to force a rebuild due to config.h changing */
-#undef DBUS_GCOV_ENABLED
-
-/* Define to use epoll(4) on Linux */
-#undef DBUS_HAVE_LINUX_EPOLL
-
-/* Define to printf modifier for 64 bit integer type */
-#undef DBUS_INT64_PRINTF_MODIFIER
-
-/* Directory for installing the libexec binaries */
-#undef DBUS_LIBEXECDIR
-
-/* Prefix for installing DBUS */
-#undef DBUS_PREFIX
-
-/* Fallback address for session bus clients */
-#undef DBUS_SESSION_BUS_CONNECT_ADDRESS
-
-/* Where per-session bus puts its sockets */
-#undef DBUS_SESSION_SOCKET_DIR
-
-/* The default D-Bus address of the system bus */
-#undef DBUS_SYSTEM_BUS_DEFAULT_ADDRESS
-
-/* The name of the socket the system bus listens on by default */
-#undef DBUS_SYSTEM_SOCKET
-
-/* Full path to the daemon in the builddir */
-#undef DBUS_TEST_EXEC
-
-/* Full path to the launch helper test program in the builddir */
-#undef DBUS_TEST_LAUNCH_HELPER_BINARY
-
-/* Where to put test sockets */
-#undef DBUS_TEST_SOCKET_DIR
-
-/* Defined if we run on a Unix-based system */
-#undef DBUS_UNIX
-
-/* User for running the system BUS daemon */
-#undef DBUS_USER
-
-/* Use the gcc __sync extension */
-#undef DBUS_USE_SYNC
-
-/* A 'va_copy' style function */
-#undef DBUS_VA_COPY
-
-/* 'va_lists' cannot be copies as values */
-#undef DBUS_VA_COPY_AS_ARRAY
-
-/* Defined if we run on a W32 API based system */
-#undef DBUS_WIN
-
-/* Defined if we run on a W32 CE API based system */
-#undef DBUS_WINCE
-
-/* Define if GLib, GObject, GIO are available */
-#undef DBUS_WITH_GLIB
-
-/* The name of the gettext domain */
-#undef GETTEXT_PACKAGE
-
-/* Prevent post-2.32 APIs */
-#undef GLIB_VERSION_MAX_ALLOWED
-
-/* Ignore post-2.26 deprecations */
-#undef GLIB_VERSION_MIN_REQUIRED
-
-/* Disable GLib public API sanity checking */
-#undef G_DISABLE_CHECKS
-
-/* Have abstract socket namespace */
-#undef HAVE_ABSTRACT_SOCKETS
-
-/* Define to 1 if you have the `accept4' function. */
-#undef HAVE_ACCEPT4
-
-/* Adt audit API */
-#undef HAVE_ADT
-
-/* Define to 1 if you have the <alloca.h> header file. */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the `backtrace' function. */
-#undef HAVE_BACKTRACE
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-#undef HAVE_BYTESWAP_H
-
-/* Define to 1 if you have the `clearenv' function. */
-#undef HAVE_CLEARENV
-
-/* Have cmsgcred structure */
-#undef HAVE_CMSGCRED
-
-/* Have console owner file */
-#undef HAVE_CONSOLE_OWNER_FILE
-
-/* Define to 1 if you have the <crt_externs.h> header file. */
-#undef HAVE_CRT_EXTERNS_H
-
-/* Have the ddfd member of DIR */
-#undef HAVE_DDFD
-
-/* Define to 1 if you have the declaration of `LOG_PERROR', and to 0 if you
- don't. */
-#undef HAVE_DECL_LOG_PERROR
-
-/* Define to 1 if you have the declaration of `MSG_NOSIGNAL', and to 0 if you
- don't. */
-#undef HAVE_DECL_MSG_NOSIGNAL
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Have dirfd function */
-#undef HAVE_DIRFD
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* Define to 1 if you have the <execinfo.h> header file. */
-#undef HAVE_EXECINFO_H
-
-/* Define to 1 if you have the <expat.h> header file. */
-#undef HAVE_EXPAT_H
-
-/* Define to 1 if you have the `fpathconf' function. */
-#undef HAVE_FPATHCONF
-
-/* Define to 1 if you have the `getgrouplist' function. */
-#undef HAVE_GETGROUPLIST
-
-/* Define to 1 if you have the `getpeereid' function. */
-#undef HAVE_GETPEEREID
-
-/* Define to 1 if you have the `getpeerucred' function. */
-#undef HAVE_GETPEERUCRED
-
-/* Define to 1 if you have the `getresuid' function. */
-#undef HAVE_GETRESUID
-
-/* Have GNU-style varargs macros */
-#undef HAVE_GNUC_VARARGS
-
-/* Define to 1 if you have the `inotify_init1' function. */
-#undef HAVE_INOTIFY_INIT1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Have ISO C99 varargs macros */
-#undef HAVE_ISO_VARARGS
-
-/* Define to 1 if you have the `issetugid' function. */
-#undef HAVE_ISSETUGID
-
-/* audit daemon SELinux support */
-#undef HAVE_LIBAUDIT
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `localeconv' function. */
-#undef HAVE_LOCALECONV
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define if we have CLOCK_MONOTONIC */
-#undef HAVE_MONOTONIC_CLOCK
-
-/* Define to 1 if you have the `nanosleep' function. */
-#undef HAVE_NANOSLEEP
-
-/* Have non-POSIX function getpwnam_r */
-#undef HAVE_NONPOSIX_GETPWNAM_R
-
-/* Define if your system needs _NSGetEnviron to set up the environment */
-#undef HAVE_NSGETENVIRON
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define to 1 if you have the `poll' function. */
-#undef HAVE_POLL
-
-/* Have POSIX function getpwnam_r */
-#undef HAVE_POSIX_GETPWNAM_R
-
-/* SELinux support */
-#undef HAVE_SELINUX
-
-/* Define to 1 if you have the `setenv' function. */
-#undef HAVE_SETENV
-
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Have socklen_t type */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoull' function. */
-#undef HAVE_STRTOULL
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
-
-/* Have systemd */
-#undef HAVE_SYSTEMD
-
-/* Define to 1 if you have the <sys/inotify.h> header file. */
-#undef HAVE_SYS_INOTIFY_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/syslimits.h> header file. */
-#undef HAVE_SYS_SYSLIMITS_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#undef HAVE_SYS_UIO_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Supports sending UNIX file descriptors */
-#undef HAVE_UNIX_FD_PASSING
-
-/* Define to 1 if you have the `unsetenv' function. */
-#undef HAVE_UNSETENV
-
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
-/* Define to 1 if you have the `writev' function. */
-#undef HAVE_WRITEV
-
-/* Define to 1 if you have the <ws2tcpip.h> header file. */
-#undef HAVE_WS2TCPIP_H
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LT_OBJDIR
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The size of `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
-
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
-/* The size of `void *', as computed by sizeof. */
-#undef SIZEOF_VOID_P
-
-/* The size of `__int64', as computed by sizeof. */
-#undef SIZEOF___INT64
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Full path to the dbus-launch in the builddir */
-#undef TEST_BUS_LAUNCH_BINARY
-
-/* Listening address for regression tests */
-#undef TEST_LISTEN
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to add Valgrind instrumentation */
-#undef WITH_VALGRIND
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
-
-
- /* Use the compiler-provided endianness defines to allow universal compiling. */
- #if defined(__BIG_ENDIAN__)
- #define WORDS_BIGENDIAN 1
- #endif
-
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-
-#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
-# include <sys/time.h>
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-#endif
-
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Defined to get newer W32 CE APIs */
-#undef _WIN32_WCE
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-
-/* explicitly define these macros to get less confusing conditions */
-#ifndef DBUS_DISABLE_ASSERT
-# define DBUS_ENABLE_ASSERT 1
-#endif
-#ifndef DBUS_DISABLE_CHECKS
-# define DBUS_ENABLE_CHECKS 1
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/config.sub b/src/3rd_party/dbus-1.7.8/config.sub
deleted file mode 100755
index 9633db7046..0000000000
--- a/src/3rd_party/dbus-1.7.8/config.sub
+++ /dev/null
@@ -1,1791 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-08-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 \
- | or1k | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or1k-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/configure b/src/3rd_party/dbus-1.7.8/configure
deleted file mode 100755
index 05f148c90b..0000000000
--- a/src/3rd_party/dbus-1.7.8/configure
+++ /dev/null
@@ -1,25685 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dbus 1.7.8.
-#
-# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1
-
- test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
- || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: https://bugs.freedesktop.org/enter_bug.cgi?product=dbus
-$0: about your system, including any error possibly output
-$0: before this message. Then install a modern shell, or
-$0: manually run the script under such a shell if you do
-$0: have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='dbus'
-PACKAGE_TARNAME='dbus'
-PACKAGE_VERSION='1.7.8'
-PACKAGE_STRING='dbus 1.7.8'
-PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=dbus'
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-DBUS_SESSION_BUS_CONNECT_ADDRESS
-DBUS_SESSION_BUS_LISTEN_ADDRESS
-DBUS_SESSION_SOCKET_DIR
-TEST_LISTEN
-TEST_SOCKET_DIR
-TEST_LAUNCH_HELPER_BINARY
-DBUS_TEST_EXEC
-DBUS_TEST_DATA
-DBUS_LIBEXECDIR
-DBUS_BINDIR
-DBUS_DAEMONDIR
-DBUS_DATADIR
-DBUS_PREFIX
-DBUS_USER
-DBUS_CONSOLE_OWNER_FILE
-DBUS_CONSOLE_AUTH_DIR
-DBUS_SYSTEM_PID_FILE
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS
-DBUS_SYSTEM_SOCKET
-HAVE_SYSTEMD_FALSE
-HAVE_SYSTEMD_TRUE
-systemdsystemunitdir
-DBUS_INIT_SCRIPTS_CYGWIN_FALSE
-DBUS_INIT_SCRIPTS_CYGWIN_TRUE
-DBUS_INIT_SCRIPTS_SLACKWARE_FALSE
-DBUS_INIT_SCRIPTS_SLACKWARE_TRUE
-DBUS_INIT_SCRIPTS_RED_HAT_FALSE
-DBUS_INIT_SCRIPTS_RED_HAT_TRUE
-EXPANDED_DATADIR
-EXPANDED_LIBEXECDIR
-EXPANDED_LIBDIR
-EXPANDED_BINDIR
-EXPANDED_SYSCONFDIR
-EXPANDED_LOCALSTATEDIR
-EXPANDED_PREFIX
-DBUS_CAN_UPLOAD_DOCS_FALSE
-DBUS_CAN_UPLOAD_DOCS_TRUE
-DBUS_XML_DOCS_ENABLED_FALSE
-DBUS_XML_DOCS_ENABLED_TRUE
-XMLTO
-DBUS_HAVE_XSLTPROC_FALSE
-DBUS_HAVE_XSLTPROC_TRUE
-XSLTPROC
-DBUS_DOXYGEN_DOCS_ENABLED_FALSE
-DBUS_DOXYGEN_DOCS_ENABLED_TRUE
-DOXYGEN
-DBUS_X_LIBS
-DBUS_X_CFLAGS
-X_EXTRA_LIBS
-X_LIBS
-X_PRE_LIBS
-X_CFLAGS
-XMKMF
-LIBDBUS_LIBS
-DEFAULT_MESSAGE_UNIX_FDS
-VALGRIND_LIBS
-VALGRIND_CFLAGS
-NETWORK_libs
-ADT_LIBS
-SELINUX_LIBS
-HAVE_LIBAUDIT_FALSE
-HAVE_LIBAUDIT_TRUE
-SYSTEMD_LIBS
-SYSTEMD_CFLAGS
-HAVE_CONSOLE_OWNER_FILE_FALSE
-HAVE_CONSOLE_OWNER_FILE_TRUE
-LAUNCHD_AGENT_DIR
-DBUS_ENABLE_LAUNCHD_FALSE
-DBUS_ENABLE_LAUNCHD_TRUE
-LAUNCHCTL
-DBUS_BUS_ENABLE_KQUEUE_FALSE
-DBUS_BUS_ENABLE_KQUEUE_TRUE
-HAVE_LINUX_EPOLL_FALSE
-HAVE_LINUX_EPOLL_TRUE
-DBUS_BUS_ENABLE_INOTIFY_FALSE
-DBUS_BUS_ENABLE_INOTIFY_TRUE
-HAVE_SELINUX_FALSE
-HAVE_SELINUX_TRUE
-THREAD_LIBS
-XML_LIBS
-XML_CFLAGS
-DBUS_PATH_OR_ABSTRACT
-DBUS_INT16_TYPE
-DBUS_INT32_TYPE
-DBUS_UINT64_CONSTANT
-DBUS_INT64_CONSTANT
-DBUS_INT64_TYPE
-R_DYNAMIC_LDFLAG
-pkgpyexecdir
-pyexecdir
-pkgpythondir
-pythondir
-PYTHON_PLATFORM
-PYTHON_EXEC_PREFIX
-PYTHON_PREFIX
-PYTHON_VERSION
-PYTHON
-DBUS_ENABLE_INSTALLED_TESTS_FALSE
-DBUS_ENABLE_INSTALLED_TESTS_TRUE
-DBUS_WITH_GLIB_FALSE
-DBUS_WITH_GLIB_TRUE
-DBUS_ENABLE_MODULAR_TESTS_FALSE
-DBUS_ENABLE_MODULAR_TESTS_TRUE
-DBUS_WITH_DBUS_GLIB_FALSE
-DBUS_WITH_DBUS_GLIB_TRUE
-DBUS_GLIB_LIBS
-DBUS_GLIB_CFLAGS
-GLIB_LIBS
-GLIB_CFLAGS
-DBUS_ENABLE_EMBEDDED_TESTS_FALSE
-DBUS_ENABLE_EMBEDDED_TESTS_TRUE
-DBUS_STATIC_BUILD_CPPFLAGS
-DBUS_CYGWIN_FALSE
-DBUS_CYGWIN_TRUE
-DBUS_UNIX_FALSE
-DBUS_UNIX_TRUE
-DBUS_WINCE_FALSE
-DBUS_WINCE_TRUE
-DBUS_WIN_FALSE
-DBUS_WIN_TRUE
-WINDRES
-BUILD_FILEVERSION
-BUILD_TIMESTAMP
-RC
-PKG_CONFIG
-CXXCPP
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-ac_ct_AR
-AR
-DLLTOOL
-OBJDUMP
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-SED
-LIBTOOL
-EGREP
-GREP
-CPP
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-DBUS_VERSION
-DBUS_MICRO_VERSION
-DBUS_MINOR_VERSION
-DBUS_MAJOR_VERSION
-LT_AGE
-LT_REVISION
-LT_CURRENT
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-GETTEXT_PACKAGE
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_maintainer_mode
-enable_silent_rules
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-enable_compiler_coverage
-enable_compiler_optimisations
-enable_developer
-enable_ansi
-enable_verbose_mode
-enable_asserts
-enable_checks
-enable_xml_docs
-enable_doxygen_docs
-enable_abstract_sockets
-enable_selinux
-enable_libaudit
-enable_inotify
-enable_kqueue
-enable_console_owner_file
-enable_launchd
-enable_systemd
-with_init_scripts
-with_session_socket_dir
-with_test_socket_dir
-with_system_pid_file
-with_system_socket
-with_console_auth_dir
-with_console_owner_file
-with_launchd_agent_dir
-with_dbus_user
-with_dbus_daemondir
-enable_embedded_tests
-enable_modular_tests
-enable_tests
-with_dbus_glib
-enable_installed_tests
-enable_epoll
-with_valgrind
-enable_x11_autolaunch
-with_x
-enable_Werror
-with_systemdsystemunitdir
-with_dbus_test_dir
-with_dbus_session_bus_listen_address
-with_dbus_session_bus_connect_address
-enable_stats
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CXX
-CXXFLAGS
-CCC
-CPP
-CXXCPP
-PKG_CONFIG
-GLIB_CFLAGS
-GLIB_LIBS
-DBUS_GLIB_CFLAGS
-DBUS_GLIB_LIBS
-PYTHON
-THREAD_LIBS
-SYSTEMD_CFLAGS
-SYSTEMD_LIBS
-VALGRIND_CFLAGS
-VALGRIND_LIBS
-XMKMF'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures dbus 1.7.8 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/dbus]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-X features:
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of dbus 1.7.8:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-maintainer-mode disable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-shared[=PKGS] build shared libraries [default=yes]
- --enable-static[=PKGS] build static libraries [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-compiler-coverage
- Enable generation of coverage data
- --disable-compiler-optimisations
- Disable compiler optimisations
- --enable-developer set defaults to be appropriate for a D-Bus developer
- instead of a distribution/end-user
- --enable-ansi enable -ansi -pedantic gcc flags
- --enable-verbose-mode support verbose debug mode
- --enable-asserts include assertion checks
- --enable-checks include sanity checks on public API
- --enable-xml-docs build XML documentation (requires xmlto)
- --enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)
- --enable-abstract-sockets
- use abstract socket namespace (linux only)
- --enable-selinux build with SELinux support
- --enable-libaudit build audit daemon support for SELinux
- --enable-inotify build with inotify support (linux only)
- --enable-kqueue build with kqueue support
- --enable-console-owner-file
- enable console owner file
- --enable-launchd build with launchd auto-launch support
- --enable-systemd build with systemd at_console support
- --enable-embedded-tests enable unit test code in the library and binaries
- --enable-modular-tests enable modular regression tests (requires GLib)
- --enable-tests enable/disable all tests, overriding
- embedded-tests/modular-tests
- --enable-installed-tests
- enable unit test code in the library and binaries
- --enable-epoll use epoll(4) on Linux
- --enable-x11-autolaunch build with X11 auto-launch support
- --disable-Werror compile without -Werror (normally enabled in
- development builds)
- --enable-stats enable bus daemon usage statistics
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot=DIR Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).
- --with-init-scripts=redhat
- Style of init scripts to install
- --with-session-socket-dir=dirname
- Where to put sockets for the per-login-session
- message bus
- --with-test-socket-dir=dirname
- Where to put sockets for make check
- --with-system-pid-file=pidfile
- PID file for systemwide daemon
- --with-system-socket=filename
- UNIX domain socket for systemwide daemon
- --with-console-auth-dir=dirname
- directory to check for console ownerhip
- --with-console-owner-file=filename
- file whose owner determines current console owner
- --with-launchd-agent-dir=dirname
- directory to put the launchd agent (default:
- /Library/LaunchAgents)
- --with-dbus-user=<user> User for running the DBUS daemon (messagebus)
- --with-dbus-daemondir=dirname
- Directory for installing the DBUS daemon
- --with-dbus-glib Use dbus-glib for regression tests
- --with-valgrind Add instrumentation to help valgrind to understand
- our allocator
- --with-x use the X Window System
- --with-systemdsystemunitdir=DIR
- Directory for systemd service files
- --with-dbus-test-dir=dirname
- path where the tests tools are available
- --with-dbus-session-bus-listen-address=ADDRESS
- default address for a session bus to listen on (see
- configure.ac)
- --with-dbus-session-bus-connect-address=ADDRESS
- fallback address for a session bus client to connect
- to (see configure.ac)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CPP C preprocessor
- CXXCPP C++ preprocessor
- PKG_CONFIG path to pkg-config utility
- GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
- GLIB_LIBS linker flags for GLIB, overriding pkg-config
- DBUS_GLIB_CFLAGS
- C compiler flags for DBUS_GLIB, overriding pkg-config
- DBUS_GLIB_LIBS
- linker flags for DBUS_GLIB, overriding pkg-config
- PYTHON the Python interpreter
- THREAD_LIBS
- SYSTEMD_CFLAGS
- C compiler flags for SYSTEMD, overriding pkg-config
- SYSTEMD_LIBS
- linker flags for SYSTEMD, overriding pkg-config
- VALGRIND_CFLAGS
- C compiler flags for VALGRIND, overriding pkg-config
- VALGRIND_LIBS
- linker flags for VALGRIND, overriding pkg-config
- XMKMF Path to xmkmf, Makefile generator for X Window System
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-dbus configure 1.7.8
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ---------------------------------------------------------------------- ##
-## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=dbus ##
-## ---------------------------------------------------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=0 ac_mid=0
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid; break
-else
- as_fn_arith $ac_mid + 1 && ac_lo=$as_val
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=-1 ac_mid=-1
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=$ac_mid; break
-else
- as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid
-else
- as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (($2) < 0)
- {
- long int i = longval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%ld", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%lu", i);
- }
- /* Do not output a trailing newline, as this causes \r\n confusion
- on some platforms. */
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
- ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
- fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- as_decl_name=`echo $2|sed 's/ *(.*//'`
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-#ifndef $as_decl_name
-#ifdef __cplusplus
- (void) $as_decl_use;
-#else
- (void) $as_decl_name;
-#endif
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_decl
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by dbus $as_me 1.7.8, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-
-
-am__api_version='1.11'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='dbus'
- VERSION='1.7.8'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
-$as_echo_n "checking how to create a ustar tar archive... " >&6; }
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar plaintar pax cpio none'
-_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- { echo "$as_me:$LINENO: $_am_tar --version" >&5
- ($_am_tar --version) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && break
- done
- am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x ustar -w "$$tardir"'
- am__tar_='pax -L -x ustar -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
- am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
- am__untar='cpio -i -H ustar -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_ustar}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
- (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- rm -rf conftest.dir
- if test -s conftest.tar; then
- { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
- ($am__untar <conftest.tar) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-if ${am_cv_prog_tar_ustar+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_prog_tar_ustar=$_am_tool
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
-$as_echo "$am_cv_prog_tar_ustar" >&6; }
-
-
-
-
-
-
-GETTEXT_PACKAGE=dbus-1
-
-
-cat >>confdefs.h <<_ACEOF
-#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE"
-_ACEOF
-
-
-# By default, rebuild autotools files on demand; only use ./missing if the
-# user says --disable-maintainer-mode (some distributions like to do this)
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=yes
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=0;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_DAEMON_NAME "dbus-daemon"
-_ACEOF
-
-
-# libtool versioning - this applies to libdbus
-#
-# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
-#
-
-## increment if the interface has additions, changes, removals.
-LT_CURRENT=11
-
-## increment any time the source changes; set to
-## 0 if you increment CURRENT
-LT_REVISION=3
-
-## increment if any interfaces have been added; set to 0
-## if any interfaces have been changed or removed. removal has
-## precedence over adding, so set to 0 if both happened.
-LT_AGE=8
-
-
-
-
-
-DBUS_MAJOR_VERSION=1
-DBUS_MINOR_VERSION=7
-DBUS_MICRO_VERSION=8
-DBUS_VERSION=1.7.8
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
-else
- MINIX=
-fi
-
-
- if test "$MINIX" = yes; then
-
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
-
-
-$as_echo "#define _MINIX 1" >>confdefs.h
-
- fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-# define __EXTENSIONS__ 1
- $ac_includes_default
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_safe_to_define___extensions__=yes
-else
- ac_cv_safe_to_define___extensions__=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
- test $ac_cv_safe_to_define___extensions__ = yes &&
- $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
- $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-
- $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
- $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
-
- $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
-$as_echo_n "checking for library containing strerror... " >&6; }
-if ${ac_cv_search_strerror+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strerror ();
-int
-main ()
-{
-return strerror ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' cposix; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_strerror=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_strerror+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_strerror+:} false; then :
-
-else
- ac_cv_search_strerror=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
-$as_echo "$ac_cv_search_strerror" >&6; }
-ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2'
-macro_revision='1.3337'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO ""
-}
-
-case "$ECHO" in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- { ac_script=; unset ac_script;}
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
- then ac_cv_path_FGREP="$GREP -F"
- else
- if test -z "$FGREP"; then
- ac_path_FGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
- # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_FGREP="$ac_path_FGREP"
- ac_path_FGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_FGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_FGREP"; then
- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_FGREP=$FGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in dumpbin "link -dump"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DUMPBIN"; then
- ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$DUMPBIN" && break
- done
-fi
-if test -z "$DUMPBIN"; then
- ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in dumpbin "link -dump"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DUMPBIN"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_DUMPBIN" && break
-done
-
- if test "x$ac_ct_DUMPBIN" = x; then
- DUMPBIN=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DUMPBIN=$ac_ct_DUMPBIN
- fi
-fi
-
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
-
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: output\"" >&5)
- cat conftest.out >&5
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLTOOL=$ac_ct_DLLTOOL
- fi
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ar_at_file=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK '"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
- withval=$with_sysroot;
-else
- with_sysroot=no
-fi
-
-
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
- as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$MANIFEST_TOOL"; then
- ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
- ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
- # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_MANIFEST_TOOL"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_MANIFEST_TOOL" = x; then
- MANIFEST_TOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
- fi
-else
- MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&5
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DSYMUTIL=$ac_ct_DSYMUTIL
- fi
-else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
- ac_ct_NMEDIT=$NMEDIT
- # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- NMEDIT=$ac_ct_NMEDIT
- fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$LIPO"; then
- ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
- ac_ct_LIPO=$LIPO
- # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_LIPO"; then
- ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_LIPO" = x; then
- LIPO=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- LIPO=$ac_ct_LIPO
- fi
-else
- LIPO="$ac_cv_prog_LIPO"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL"; then
- ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
- ac_ct_OTOOL=$OTOOL
- # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL"; then
- ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL" = x; then
- OTOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL=$ac_ct_OTOOL
- fi
-else
- OTOOL="$ac_cv_prog_OTOOL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL64"; then
- ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
- ac_ct_OTOOL64=$OTOOL64
- # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL64"; then
- ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL64" = x; then
- OTOOL64=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL64=$ac_ct_OTOOL64
- fi
-else
- OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&5
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_ld_exported_symbols_list=yes
-else
- lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
- echo "$RANLIB libconftest.a" >&5
- $RANLIB libconftest.a 2>&5
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&5
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-func_stripname_cnf ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname_cnf
-
-
-
-
-
-# Set options
-
-
-
- enable_dlopen=no
-
-
- enable_win32_dll=no
-
-
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
- # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
- # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
- *)
- lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-
-
-
-
-
- lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='--shared'
- lt_prog_compiler_static='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-qpic'
- lt_prog_compiler_static='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works=yes
- fi
- else
- lt_cv_prog_compiler_static_works=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag=
- always_export_symbols=no
- archive_cmds=
- archive_expsym_cmds=
- compiler_needs_object=no
- enable_shared_with_static_runtimes=no
- export_dynamic_flag_spec=
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- hardcode_automatic=no
- hardcode_direct=no
- hardcode_direct_absolute=no
- hardcode_libdir_flag_spec=
- hardcode_libdir_separator=
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- inherit_rpath=no
- link_all_deplibs=unknown
- module_cmds=
- module_expsym_cmds=
- old_archive_from_new_cmds=
- old_archive_from_expsyms_cmds=
- thread_safe_flag_spec=
- whole_archive_flag_spec=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs=no
- ;;
- esac
-
- ld_shlibs=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
- *\ \(GNU\ Binutils\)\ [3-9]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[3-9]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='${wl}--export-all-symbols'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- link_all_deplibs=yes
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- whole_archive_flag_spec=
- tmp_sharedflag='--shared' ;;
- xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix[4-9]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- file_list_spec='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- link_all_deplibs=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- export_dynamic_flag_spec='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- fi
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- file_list_spec='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
- enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- old_postinstall_cmds='chmod 644 $oldlib'
- postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- enable_shared_with_static_runtimes=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec=''
- fi
- link_all_deplibs=yes
- allow_undefined_flag="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
- else
- ld_shlibs=no
- fi
-
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
-
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler__b=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -b"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler__b=yes
- fi
- else
- lt_cv_prog_compiler__b=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_irix_exported_symbol=yes
-else
- lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test "$lt_cv_irix_exported_symbol" = yes; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- inherit_rpath=yes
- link_all_deplibs=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-R,$libdir'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
- archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([A-Za-z]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
- test -n "$runpath_var" ||
- test "X$hardcode_automatic" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
- test "$inherit_rpath" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
- if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_svld_dlopen=yes
-else
- ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_dld_link=yes
-else
- ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
- # Report which library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[4-9]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-else
- _lt_caught_CXX_error=yes
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-reload_flag_CXX=$reload_flag
-reload_cmds_CXX=$reload_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
- # save warnings/boilerplate of simple test code
- ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
- ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- compiler_CXX=$CC
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
- else
- lt_prog_compiler_no_builtin_flag_CXX=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
- ld_shlibs_CXX=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix[4-9]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_direct_absolute_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- file_list_spec_CXX='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- export_dynamic_flag_spec_CXX='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- fi
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_CXX=' '
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=yes
- file_list_spec_CXX='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
- enable_shared_with_static_runtimes_CXX=yes
- # Don't use ranlib
- old_postinstall_cmds_CXX='chmod 644 $oldlib'
- postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec_CXX=''
- fi
- link_all_deplibs_CXX=yes
- allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-
- else
- ld_shlibs_CXX=no
- fi
-
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- ld_shlibs_CXX=no
- ;;
-
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
-
- haiku*)
- archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- link_all_deplibs_CXX=yes
- ;;
-
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_direct_absolute_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- interix[3-9]*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- inherit_rpath_CXX=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
- prelink_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- old_archive_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- archive_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object_CXX=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- ld_shlibs_CXX=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- hardcode_direct_absolute_CXX=yes
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- case $host in
- osf3*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- ;;
- esac
-
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
- '"$old_archive_cmds_CXX"
- reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
- '"$reload_cmds_CXX"
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
- test "$ld_shlibs_CXX" = no && can_build_shared=no
-
- GCC_CXX="$GXX"
- LD_CXX="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- # Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case ${prev}${p} in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test "$pre_test_object_deps_done" = no; then
- case ${prev} in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
- compiler_lib_search_dirs_CXX=
-if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static_CXX=
- ;;
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic_CXX='-fPIC -shared'
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[4-9]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-qpic'
- lt_prog_compiler_static_CXX='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic_CXX='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
-lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_cv_prog_compiler_static_works_CXX=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- case $host_os in
- aix[4-9]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs_CXX=no
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-with_gnu_ld_CXX=$with_gnu_ld
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc_CXX=no
- else
- lt_cv_archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
- archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
- test -n "$runpath_var_CXX" ||
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
- test "$inherit_rpath_CXX" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
-
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-# Check whether --enable-compiler-coverage was given.
-if test "${enable_compiler_coverage+set}" = set; then :
- enableval=$enable_compiler_coverage; if test "x$enable_compiler_coverage" = "xyes"; then
- if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
- fi
-fi
-else
- enable_compiler_coverage=no
-fi
-
-# Check whether --enable-compiler-optimisations was given.
-if test "${enable_compiler_optimisations+set}" = set; then :
- enableval=$enable_compiler_optimisations; if test "x$enable_compiler_optimisations" = "xno"; then
- CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"`
-fi
-fi
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
- ac_pt_PKG_CONFIG=$PKG_CONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_PKG_CONFIG" = x; then
- PKG_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- PKG_CONFIG=$ac_pt_PKG_CONFIG
- fi
-else
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=0.9.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- PKG_CONFIG=""
- fi
-
-fi
-
-# Initialize libtool
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RC"; then
- ac_cv_prog_RC="$RC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RC="${ac_tool_prefix}windres"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RC=$ac_cv_prog_RC
-if test -n "$RC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
-$as_echo "$RC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RC"; then
- ac_ct_RC=$RC
- # Extract the first word of "windres", so it can be a program name with args.
-set dummy windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RC"; then
- ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RC="windres"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RC=$ac_cv_prog_ac_ct_RC
-if test -n "$ac_ct_RC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5
-$as_echo "$ac_ct_RC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RC" = x; then
- RC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RC=$ac_ct_RC
- fi
-else
- RC="$ac_cv_prog_RC"
-fi
-
-
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-if test -n "$compiler"; then
- :
-
-
-
-fi
-
-GCC=$lt_save_GCC
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-
-
-# Set some internal variables depending on the platform for later use.
-dbus_win=no
-dbus_cygwin=no
-dbus_unix=no
-case "${host}" in
- *-mingw32ce*)
- dbus_win=yes
- dbus_wince=yes
- ;;
- *-mingw32*)
- dbus_win=yes
- ;;
- *-cygwin*)
- dbus_cygwin=yes
- dbus_unix=yes
- ;;
- *)
- dbus_unix=yes
- ;;
-esac
-
-# Special defines for certain platforms
-if test "$dbus_win" = yes; then
-
-$as_echo "#define DBUS_WIN 1" >>confdefs.h
-
- BUILD_TIMESTAMP=`date --iso-8601=minutes`
-
- # Assume DBUS_VERSION is always three numbers
- BUILD_FILEVERSION=`echo "$DBUS_VERSION" | sed -e 's/\./,/g'`,0
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_WINDRES+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$WINDRES"; then
- ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-WINDRES=$ac_cv_prog_WINDRES
-if test -n "$WINDRES"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
-$as_echo "$WINDRES" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_WINDRES"; then
- ac_ct_WINDRES=$WINDRES
- # Extract the first word of "windres", so it can be a program name with args.
-set dummy windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_WINDRES"; then
- ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_WINDRES="windres"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
-if test -n "$ac_ct_WINDRES"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
-$as_echo "$ac_ct_WINDRES" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_WINDRES" = x; then
- WINDRES="no"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- WINDRES=$ac_ct_WINDRES
- fi
-else
- WINDRES="$ac_cv_prog_WINDRES"
-fi
-
- if test "$WINDRES" = no; then
- as_fn_error $? "*** Could not find an implementation of windres in your PATH." "$LINENO" 5
- fi
- if test "$dbus_wince" = yes; then
-
-$as_echo "#define DBUS_WINCE 1" >>confdefs.h
-
-
-$as_echo "#define _WIN32_WCE 0x0502" >>confdefs.h
-
- fi
-else
-
-$as_echo "#define DBUS_UNIX 1" >>confdefs.h
-
-fi
-if test "$dbus_cygwin" = yes; then
-
-$as_echo "#define DBUS_CYGWIN 1" >>confdefs.h
-
-fi
-
- if test "$dbus_win" = yes; then
- DBUS_WIN_TRUE=
- DBUS_WIN_FALSE='#'
-else
- DBUS_WIN_TRUE='#'
- DBUS_WIN_FALSE=
-fi
-
- if test "$dbus_wince" = yes; then
- DBUS_WINCE_TRUE=
- DBUS_WINCE_FALSE='#'
-else
- DBUS_WINCE_TRUE='#'
- DBUS_WINCE_FALSE=
-fi
-
- if test "$dbus_unix" = yes; then
- DBUS_UNIX_TRUE=
- DBUS_UNIX_FALSE='#'
-else
- DBUS_UNIX_TRUE='#'
- DBUS_UNIX_FALSE=
-fi
-
- if test "$dbus_cygwin" = yes; then
- DBUS_CYGWIN_TRUE=
- DBUS_CYGWIN_FALSE='#'
-else
- DBUS_CYGWIN_TRUE='#'
- DBUS_CYGWIN_FALSE=
-fi
-
-
-# this must come first: other options use this to set their defaults
-# Check whether --enable-developer was given.
-if test "${enable_developer+set}" = set; then :
- enableval=$enable_developer;
-else
- enable_developer=no
-fi
-
-
-DBUS_STATIC_BUILD_CPPFLAGS=
-if test "x$enable_shared" = xno; then
- # On Windows, linking against the static library requires special effort
- # to turn off DLL import/export processing. We normally link some things
- # against the dynamic library, but if we're not building that, we'll
- # have to link everything statically.
- DBUS_STATIC_BUILD_CPPFLAGS=-DDBUS_STATIC_BUILD
-fi
-
-
-# Check whether --enable-ansi was given.
-if test "${enable_ansi+set}" = set; then :
- enableval=$enable_ansi; enable_ansi=$enableval
-else
- enable_ansi=no
-fi
-
-# Check whether --enable-verbose-mode was given.
-if test "${enable_verbose_mode+set}" = set; then :
- enableval=$enable_verbose_mode; enable_verbose_mode=$enableval
-else
- enable_verbose_mode=$enable_developer
-fi
-
-# Check whether --enable-asserts was given.
-if test "${enable_asserts+set}" = set; then :
- enableval=$enable_asserts; enable_asserts=$enableval
-else
- enable_asserts=$enable_developer
-fi
-
-# Check whether --enable-checks was given.
-if test "${enable_checks+set}" = set; then :
- enableval=$enable_checks; enable_checks=$enableval
-else
- enable_checks=yes
-fi
-
-# Check whether --enable-xml-docs was given.
-if test "${enable_xml_docs+set}" = set; then :
- enableval=$enable_xml_docs; enable_xml_docs=$enableval
-else
- enable_xml_docs=auto
-fi
-
-# Check whether --enable-doxygen-docs was given.
-if test "${enable_doxygen_docs+set}" = set; then :
- enableval=$enable_doxygen_docs; enable_doxygen_docs=$enableval
-else
- enable_doxygen_docs=auto
-fi
-
-# Check whether --enable-abstract-sockets was given.
-if test "${enable_abstract_sockets+set}" = set; then :
- enableval=$enable_abstract_sockets; enable_abstract_sockets=$enableval
-else
- enable_abstract_sockets=auto
-fi
-
-# Check whether --enable-selinux was given.
-if test "${enable_selinux+set}" = set; then :
- enableval=$enable_selinux; enable_selinux=$enableval
-else
- enable_selinux=auto
-fi
-
-# Check whether --enable-libaudit was given.
-if test "${enable_libaudit+set}" = set; then :
- enableval=$enable_libaudit; enable_libaudit=$enableval
-else
- enable_libaudit=auto
-fi
-
-# Check whether --enable-inotify was given.
-if test "${enable_inotify+set}" = set; then :
- enableval=$enable_inotify; enable_inotify=$enableval
-else
- enable_inotify=auto
-fi
-
-# Check whether --enable-kqueue was given.
-if test "${enable_kqueue+set}" = set; then :
- enableval=$enable_kqueue; enable_kqueue=$enableval
-else
- enable_kqueue=auto
-fi
-
-# Check whether --enable-console-owner-file was given.
-if test "${enable_console_owner_file+set}" = set; then :
- enableval=$enable_console_owner_file; enable_console_owner_file=$enableval
-else
- enable_console_owner_file=auto
-fi
-
-# Check whether --enable-launchd was given.
-if test "${enable_launchd+set}" = set; then :
- enableval=$enable_launchd; enable_launchd=$enableval
-else
- enable_launchd=auto
-fi
-
-# Check whether --enable-systemd was given.
-if test "${enable_systemd+set}" = set; then :
- enableval=$enable_systemd; enable_systemd=$enableval
-else
- enable_systemd=auto
-fi
-
-
-
-# Check whether --with-init-scripts was given.
-if test "${with_init_scripts+set}" = set; then :
- withval=$with_init_scripts;
-fi
-
-
-# Check whether --with-session-socket-dir was given.
-if test "${with_session_socket_dir+set}" = set; then :
- withval=$with_session_socket_dir;
-fi
-
-
-# Check whether --with-test-socket-dir was given.
-if test "${with_test_socket_dir+set}" = set; then :
- withval=$with_test_socket_dir;
-fi
-
-
-# Check whether --with-system-pid-file was given.
-if test "${with_system_pid_file+set}" = set; then :
- withval=$with_system_pid_file;
-fi
-
-
-# Check whether --with-system-socket was given.
-if test "${with_system_socket+set}" = set; then :
- withval=$with_system_socket;
-fi
-
-
-# Check whether --with-console-auth-dir was given.
-if test "${with_console_auth_dir+set}" = set; then :
- withval=$with_console_auth_dir;
-fi
-
-
-# Check whether --with-console-owner-file was given.
-if test "${with_console_owner_file+set}" = set; then :
- withval=$with_console_owner_file;
-fi
-
-
-# Check whether --with-launchd-agent-dir was given.
-if test "${with_launchd_agent_dir+set}" = set; then :
- withval=$with_launchd_agent_dir;
-fi
-
-
-# Check whether --with-dbus_user was given.
-if test "${with_dbus_user+set}" = set; then :
- withval=$with_dbus_user;
-fi
-
-
-# Check whether --with-dbus_daemondir was given.
-if test "${with_dbus_daemondir+set}" = set; then :
- withval=$with_dbus_daemondir;
-fi
-
-
-# Check whether --enable-embedded-tests was given.
-if test "${enable_embedded_tests+set}" = set; then :
- enableval=$enable_embedded_tests;
-else
- enable_embedded_tests=$enable_developer
-fi
-
-# Check whether --enable-modular-tests was given.
-if test "${enable_modular_tests+set}" = set; then :
- enableval=$enable_modular_tests;
-else
- enable_modular_tests=auto
-fi
-
-# --enable-tests overrides both --enable-embedded-tests and
-# --enable-modular-tests
-# Check whether --enable-tests was given.
-if test "${enable_tests+set}" = set; then :
- enableval=$enable_tests;
- if test "x$enableval" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage was requested with --enable-tests=yes" >&5
-$as_echo "$as_me: Full test coverage was requested with --enable-tests=yes" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: This has many dependencies (GLib, dbus-glib, Python)" >&5
-$as_echo "$as_me: This has many dependencies (GLib, dbus-glib, Python)" >&6;}
- fi
- enable_embedded_tests=$enableval
- enable_modular_tests=$enableval
-
-fi
-
-
-# DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
-# and also some stuff in the test/ subdir.
- if test "x$enable_embedded_tests" = xyes; then
- DBUS_ENABLE_EMBEDDED_TESTS_TRUE=
- DBUS_ENABLE_EMBEDDED_TESTS_FALSE='#'
-else
- DBUS_ENABLE_EMBEDDED_TESTS_TRUE='#'
- DBUS_ENABLE_EMBEDDED_TESTS_FALSE=
-fi
-
-if test "x$enable_embedded_tests" = xyes; then
-
-$as_echo "#define DBUS_ENABLE_EMBEDDED_TESTS 1" >>confdefs.h
-
-fi
-
-# DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
-# These use GTest, from GLib, because life's too short. They're enabled by
-# default (unless you don't have GLib), because they don't bloat the library
-# or binaries.
-
-
-$as_echo "#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_26" >>confdefs.h
-
-
-$as_echo "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_32" >>confdefs.h
-
-
-with_glib=yes
-
-if test "x$enable_modular_tests" != xno; then :
-
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
-$as_echo_n "checking for GLIB... " >&6; }
-
-if test -n "$GLIB_CFLAGS"; then
- pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24, gio-2.0 >= 2.24\""; } >&5
- ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24, gio-2.0 >= 2.24") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.24, gio-2.0 >= 2.24" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$GLIB_LIBS"; then
- pkg_cv_GLIB_LIBS="$GLIB_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24, gio-2.0 >= 2.24\""; } >&5
- ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24, gio-2.0 >= 2.24") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.24, gio-2.0 >= 2.24" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.24, gio-2.0 >= 2.24" 2>&1`
- else
- GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.24, gio-2.0 >= 2.24" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$GLIB_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- if test "x$enable_modular_tests" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib" >&5
-$as_echo "$as_me: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib" >&6;}
- as_fn_error $? "$GLIB_ERRORS" "$LINENO" 5
- else # assumed to be "auto"
- with_glib=no
- fi
-elif test $pkg_failed = untried; then
- if test "x$enable_modular_tests" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib" >&5
-$as_echo "$as_me: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib" >&6;}
- as_fn_error $? "$GLIB_ERRORS" "$LINENO" 5
- else # assumed to be "auto"
- with_glib=no
- fi
-else
- GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
- GLIB_LIBS=$pkg_cv_GLIB_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- :
-fi
-
-else
- with_glib=no
-fi
-
-# Not required, because we can use internal APIs (but that makes the
-# "installable tests" less useful as integration tests)
-
-# Check whether --with-dbus_glib was given.
-if test "${with_dbus_glib+set}" = set; then :
- withval=$with_dbus_glib;
-else
- with_dbus_glib=auto
-fi
-
-if test "x$with_dbus_glib" != xno; then :
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5
-$as_echo_n "checking for DBUS_GLIB... " >&6; }
-
-if test -n "$DBUS_GLIB_CFLAGS"; then
- pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$DBUS_GLIB_LIBS"; then
- pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-glib-1" 2>&1`
- else
- DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-glib-1" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$DBUS_GLIB_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- if test "x$with_dbus_glib" = xyes; then :
- as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
-else
- with_dbus_glib=no
-fi
-elif test $pkg_failed = untried; then
- if test "x$with_dbus_glib" = xyes; then :
- as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
-else
- with_dbus_glib=no
-fi
-else
- DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS
- DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- :
-fi
-fi
- if test "x$with_dbus_glib" != xno; then
- DBUS_WITH_DBUS_GLIB_TRUE=
- DBUS_WITH_DBUS_GLIB_FALSE='#'
-else
- DBUS_WITH_DBUS_GLIB_TRUE='#'
- DBUS_WITH_DBUS_GLIB_FALSE=
-fi
-
-
-if test "x$enable_modular_tests" != xno; then
-
-$as_echo "#define DBUS_ENABLE_MODULAR_TESTS 1" >>confdefs.h
-
-fi
- if test "x$enable_modular_tests" != xno; then
- DBUS_ENABLE_MODULAR_TESTS_TRUE=
- DBUS_ENABLE_MODULAR_TESTS_FALSE='#'
-else
- DBUS_ENABLE_MODULAR_TESTS_TRUE='#'
- DBUS_ENABLE_MODULAR_TESTS_FALSE=
-fi
-
-
-if test "x$with_glib" != xno; then
-
-$as_echo "#define DBUS_WITH_GLIB 1" >>confdefs.h
-
-fi
- if test "x$with_glib" != xno; then
- DBUS_WITH_GLIB_TRUE=
- DBUS_WITH_GLIB_FALSE='#'
-else
- DBUS_WITH_GLIB_TRUE='#'
- DBUS_WITH_GLIB_FALSE=
-fi
-
-
-# Check whether --enable-installed-tests was given.
-if test "${enable_installed_tests+set}" = set; then :
- enableval=$enable_installed_tests;
-else
- enable_installed_tests=no
-fi
-
- if test "x$enable_installed_tests" = xyes; then
- DBUS_ENABLE_INSTALLED_TESTS_TRUE=
- DBUS_ENABLE_INSTALLED_TESTS_FALSE='#'
-else
- DBUS_ENABLE_INSTALLED_TESTS_TRUE='#'
- DBUS_ENABLE_INSTALLED_TESTS_FALSE=
-fi
-
-
-if test "x$enable_tests" = xyes; then
- # full test coverage is required, Python is a hard dependency
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject" >&5
-$as_echo "$as_me: Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject" >&6;}
-
-
-
-
-
-
- if test -n "$PYTHON"; then
- # If the user set $PYTHON, use it and don't search something else.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.6" >&5
-$as_echo_n "checking whether $PYTHON version >= 2.6... " >&6; }
- prog="import sys
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
- if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
- ($PYTHON -c "$prog") >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- as_fn_error $? "too old" "$LINENO" 5
-fi
- am_display_PYTHON=$PYTHON
- else
- # Otherwise, try each interpreter until we find one that satisfies
- # VERSION.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.6" >&5
-$as_echo_n "checking for a Python interpreter with version >= 2.6... " >&6; }
-if ${am_cv_pathless_PYTHON+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
- test "$am_cv_pathless_PYTHON" = none && break
- prog="import sys
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
- if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5
- ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then :
- break
-fi
- done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5
-$as_echo "$am_cv_pathless_PYTHON" >&6; }
- # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
- if test "$am_cv_pathless_PYTHON" = none; then
- PYTHON=:
- else
- # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
-set dummy $am_cv_pathless_PYTHON; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHON+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PYTHON in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PYTHON=$ac_cv_path_PYTHON
-if test -n "$PYTHON"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
-$as_echo "$PYTHON" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
- am_display_PYTHON=$am_cv_pathless_PYTHON
- fi
-
-
- if test "$PYTHON" = :; then
- as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5
- else
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5
-$as_echo_n "checking for $am_display_PYTHON version... " >&6; }
-if ${am_cv_python_version+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
-$as_echo "$am_cv_python_version" >&6; }
- PYTHON_VERSION=$am_cv_python_version
-
-
-
- PYTHON_PREFIX='${prefix}'
-
- PYTHON_EXEC_PREFIX='${exec_prefix}'
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5
-$as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
-if ${am_cv_python_platform+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5
-$as_echo "$am_cv_python_platform" >&6; }
- PYTHON_PLATFORM=$am_cv_python_platform
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
-$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
-if ${am_cv_python_pythondir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$prefix" = xNONE
- then
- am_py_prefix=$ac_default_prefix
- else
- am_py_prefix=$prefix
- fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
- case $am_cv_python_pythondir in
- $am_py_prefix*)
- am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
- am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
- ;;
- *)
- case $am_py_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5
-$as_echo "$am_cv_python_pythondir" >&6; }
- pythondir=$am_cv_python_pythondir
-
-
-
- pkgpythondir=\${pythondir}/$PACKAGE
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
-$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
-if ${am_cv_python_pyexecdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$exec_prefix" = xNONE
- then
- am_py_exec_prefix=$am_py_prefix
- else
- am_py_exec_prefix=$exec_prefix
- fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
- case $am_cv_python_pyexecdir in
- $am_py_exec_prefix*)
- am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
- am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
- ;;
- *)
- case $am_py_exec_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5
-$as_echo "$am_cv_python_pyexecdir" >&6; }
- pyexecdir=$am_cv_python_pyexecdir
-
-
-
- pkgpyexecdir=\${pyexecdir}/$PACKAGE
-
-
-
- fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python modules for full test coverage" >&5
-$as_echo_n "checking for Python modules for full test coverage... " >&6; }
- if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "cannot import dbus, gobject, dbus.mainloop.glib Python modules" "$LINENO" 5
- fi
-else
- # --enable-tests not given: do not abort if Python is missing
-
-
-
-
-
-
- if test -n "$PYTHON"; then
- # If the user set $PYTHON, use it and don't search something else.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.6" >&5
-$as_echo_n "checking whether $PYTHON version >= 2.6... " >&6; }
- prog="import sys
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
- if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
- ($PYTHON -c "$prog") >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- as_fn_error $? "too old" "$LINENO" 5
-fi
- am_display_PYTHON=$PYTHON
- else
- # Otherwise, try each interpreter until we find one that satisfies
- # VERSION.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.6" >&5
-$as_echo_n "checking for a Python interpreter with version >= 2.6... " >&6; }
-if ${am_cv_pathless_PYTHON+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
- test "$am_cv_pathless_PYTHON" = none && break
- prog="import sys
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
- if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5
- ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then :
- break
-fi
- done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5
-$as_echo "$am_cv_pathless_PYTHON" >&6; }
- # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
- if test "$am_cv_pathless_PYTHON" = none; then
- PYTHON=:
- else
- # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
-set dummy $am_cv_pathless_PYTHON; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHON+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PYTHON in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PYTHON=$ac_cv_path_PYTHON
-if test -n "$PYTHON"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
-$as_echo "$PYTHON" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
- am_display_PYTHON=$am_cv_pathless_PYTHON
- fi
-
-
- if test "$PYTHON" = :; then
- :
- else
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5
-$as_echo_n "checking for $am_display_PYTHON version... " >&6; }
-if ${am_cv_python_version+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
-$as_echo "$am_cv_python_version" >&6; }
- PYTHON_VERSION=$am_cv_python_version
-
-
-
- PYTHON_PREFIX='${prefix}'
-
- PYTHON_EXEC_PREFIX='${exec_prefix}'
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5
-$as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
-if ${am_cv_python_platform+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5
-$as_echo "$am_cv_python_platform" >&6; }
- PYTHON_PLATFORM=$am_cv_python_platform
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
-$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
-if ${am_cv_python_pythondir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$prefix" = xNONE
- then
- am_py_prefix=$ac_default_prefix
- else
- am_py_prefix=$prefix
- fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
- case $am_cv_python_pythondir in
- $am_py_prefix*)
- am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
- am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
- ;;
- *)
- case $am_py_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5
-$as_echo "$am_cv_python_pythondir" >&6; }
- pythondir=$am_cv_python_pythondir
-
-
-
- pkgpythondir=\${pythondir}/$PACKAGE
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
-$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
-if ${am_cv_python_pyexecdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$exec_prefix" = xNONE
- then
- am_py_exec_prefix=$am_py_prefix
- else
- am_py_exec_prefix=$exec_prefix
- fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
- case $am_cv_python_pyexecdir in
- $am_py_exec_prefix*)
- am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
- am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
- ;;
- *)
- case $am_py_exec_prefix in
- /usr|/System*) ;;
- *)
- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
- ;;
- esac
- ;;
- esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5
-$as_echo "$am_cv_python_pyexecdir" >&6; }
- pyexecdir=$am_cv_python_pyexecdir
-
-
-
- pkgpyexecdir=\${pyexecdir}/$PACKAGE
-
-
-
- fi
-
-
-fi
-
-if test x$enable_verbose_mode = xyes; then
-
-$as_echo "#define DBUS_ENABLE_VERBOSE_MODE 1" >>confdefs.h
-
-fi
-
-if test x$enable_asserts = xno; then
-
-$as_echo "#define DBUS_DISABLE_ASSERT 1" >>confdefs.h
-
- DISABLE_UNUSED_WARNINGS="unused-label"
- R_DYNAMIC_LDFLAG=""
- if test x$enable_embedded_tests = xyes; then
- DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
- unused-but-set-variable unused-variable \
- unused-function"
- fi
-else
- # -rdynamic is needed for glibc's backtrace_symbols to work.
- # No clue how much overhead this adds, but it's useful
- # to do this on any assertion failure,
- # so for now it's enabled anytime asserts are (currently not
- # in production builds).
-
- # To get -rdynamic you pass -export-dynamic to libtool.
-
-$as_echo "#define DBUS_BUILT_R_DYNAMIC 1" >>confdefs.h
-
- R_DYNAMIC_LDFLAG=-export-dynamic
-fi
-
-
-if test x$enable_checks = xno; then
-
-$as_echo "#define DBUS_DISABLE_CHECKS 1" >>confdefs.h
-
-
-$as_echo "#define G_DISABLE_CHECKS 1" >>confdefs.h
-
- DISABLE_UNUSED_WARNINGS="unused-label"
-fi
-
-
-
-if test x$enable_compiler_coverage = xyes; then
- ## so that config.h changes when you toggle gcov support
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_GCOV_ENABLED 1
-_ACEOF
-
-fi
-
-# glibc21.m4 serial 3
-
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5
-$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
-if ${ac_cv_gnu_library_2_1+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
- Lucky GNU user
- #endif
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
- ac_cv_gnu_library_2_1=yes
-else
- ac_cv_gnu_library_2_1=no
-fi
-rm -f conftest*
-
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
-$as_echo "$ac_cv_gnu_library_2_1" >&6; }
-
-#### Integer sizes
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
-$as_echo_n "checking size of char... " >&6; }
-if ${ac_cv_sizeof_char+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_char" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (char)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_char=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
-$as_echo "$ac_cv_sizeof_char" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
-$as_echo_n "checking size of short... " >&6; }
-if ${ac_cv_sizeof_short+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_short" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (short)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_short=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
-$as_echo "$ac_cv_sizeof_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if ${ac_cv_sizeof_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_int" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
-$as_echo_n "checking size of void *... " >&6; }
-if ${ac_cv_sizeof_void_p+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_void_p" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (void *)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_void_p=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
-$as_echo "$ac_cv_sizeof_void_p" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
-$as_echo_n "checking size of long long... " >&6; }
-if ${ac_cv_sizeof_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
-$as_echo "$ac_cv_sizeof_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
-$as_echo_n "checking size of __int64... " >&6; }
-if ${ac_cv_sizeof___int64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type___int64" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (__int64)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof___int64=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5
-$as_echo "$ac_cv_sizeof___int64" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF___INT64 $ac_cv_sizeof___int64
-_ACEOF
-
-
-
-### See what our 64 bit type is called
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 64-bit integer type" >&5
-$as_echo_n "checking 64-bit integer type... " >&6; }
-
-case 8 in
-$ac_cv_sizeof_int)
- dbusint64=int
- dbusint64_constant='(val)'
- dbusuint64_constant='(val)'
- dbusint64_printf_modifier='""'
- ;;
-$ac_cv_sizeof_long)
- dbusint64=long
- dbusint64_constant='(val##L)'
- dbusuint64_constant='(val##UL)'
- dbusint64_printf_modifier='"l"'
- ;;
-$ac_cv_sizeof_long_long)
- dbusint64='long long'
- dbusint64_constant='(val##LL)'
- dbusuint64_constant='(val##ULL)'
- # Ideally we discover what the format is, but this is
- # only used in verbose mode, so eh...
- if test x"$ac_cv_gnu_library_2_1" = xyes; then
- dbusint64_printf_modifier='"ll"'
- fi
- ;;
-$ac_cv_sizeof___int64)
- dbusint64=__int64
- dbusint64_constant='(val##i64)'
- dbusuint64_constant='(val##ui64)'
- # See above case
- if test x"$ac_cv_gnu_library_2_1" = xyes; then
- dbusint64_printf_modifier='"ll"'
- fi
- ;;
-esac
-
-if test -z "$dbusint64"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- as_fn_error $? "Could not find a 64-bit integer type.
-
-Please report a bug here with details of your platform and compiler:
-
- http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core" "$LINENO" 5
-
-else
-
- DBUS_INT64_TYPE="$dbusint64"
- DBUS_INT64_CONSTANT="$dbusint64_constant"
- DBUS_UINT64_CONSTANT="$dbusuint64_constant"
- if test x"$dbusint64_printf_modifier" != x; then
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_INT64_PRINTF_MODIFIER $dbusint64_printf_modifier
-_ACEOF
-
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_INT64_TYPE" >&5
-$as_echo "$DBUS_INT64_TYPE" >&6; }
-
-fi
-
-
-
-
-
-### see what 32-bit int is called
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit integer type" >&5
-$as_echo_n "checking 32-bit integer type... " >&6; }
-
-case 4 in
-$ac_cv_sizeof_short)
- dbusint32=short
- ;;
-$ac_cv_sizeof_int)
- dbusint32=int
- ;;
-$ac_cv_sizeof_long)
- dbusint32=long
- ;;
-esac
-
-if test -z "$dbusint32" ; then
- DBUS_INT32_TYPE="no_int32_type_detected"
- as_fn_error $? "No 32-bit integer type found" "$LINENO" 5
-else
- DBUS_INT32_TYPE="$dbusint32"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_INT32_TYPE" >&5
-$as_echo "$DBUS_INT32_TYPE" >&6; }
-fi
-
-
-
-### see what 16-bit int is called
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 16-bit integer type" >&5
-$as_echo_n "checking 16-bit integer type... " >&6; }
-
-case 2 in
-$ac_cv_sizeof_short)
- dbusint16=short
- ;;
-$ac_cv_sizeof_int)
- dbusint16=int
- ;;
-esac
-
-if test -z "$dbusint16" ; then
- DBUS_INT16_TYPE="no_int16_type_detected"
- as_fn_error $? "No 16-bit integer type found" "$LINENO" 5
-else
- DBUS_INT16_TYPE="$dbusint16"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_INT16_TYPE" >&5
-$as_echo "$DBUS_INT16_TYPE" >&6; }
-fi
-
-
-
-## byte order
-case $host_os in
- darwin*)
- # check at compile-time, so that it is possible to build universal
- # (with multiple architectures at once on the compile line)
-
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of va_copy()" >&5
-$as_echo_n "checking for an implementation of va_copy()... " >&6; }
-if ${dbus_cv_va_copy+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- dbus_cv_va_copy=yes
-else
- dbus_cv_va_copy=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_cv_va_copy" >&5
-$as_echo "$dbus_cv_va_copy" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an implementation of __va_copy()" >&5
-$as_echo_n "checking for an implementation of __va_copy()... " >&6; }
-if ${dbus_cv___va_copy+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- __va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- dbus_cv___va_copy=yes
-else
- dbus_cv___va_copy=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_cv___va_copy" >&5
-$as_echo "$dbus_cv___va_copy" >&6; }
-
-if test "x$dbus_cv_va_copy" = "xyes"; then
- dbus_va_copy_func=va_copy
-else if test "x$dbus_cv___va_copy" = "xyes"; then
- dbus_va_copy_func=__va_copy
-fi
-fi
-
-if test -n "$dbus_va_copy_func"; then
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_VA_COPY $dbus_va_copy_func
-_ACEOF
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_lists can be copied by value" >&5
-$as_echo_n "checking whether va_lists can be copied by value... " >&6; }
-if ${dbus_cv_va_val_copy+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- dbus_cv_va_val_copy=yes
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <stdarg.h>
- #include <stdlib.h>
-
-int
-main ()
-{
-
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- args2 = args1;
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- dbus_cv_va_val_copy=yes
-else
- dbus_cv_va_val_copy=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_cv_va_val_copy" >&5
-$as_echo "$dbus_cv_va_val_copy" >&6; }
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-if test "x$dbus_cv_va_val_copy" = "xno"; then
-
-$as_echo "#define DBUS_VA_COPY_AS_ARRAY 1" >>confdefs.h
-
-fi
-
-
-#### Atomic integers
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC knows __sync_sub_and_fetch()" >&5
-$as_echo_n "checking whether $CC knows __sync_sub_and_fetch()... " >&6; }
-if ${dbus_cv_sync_sub_and_fetch+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- dbus_cv_sync_sub_and_fetch=yes
-else
- dbus_cv_sync_sub_and_fetch=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_cv_sync_sub_and_fetch" >&5
-$as_echo "$dbus_cv_sync_sub_and_fetch" >&6; }
-
-if test "x$dbus_cv_sync_sub_and_fetch" = "xyes" ; then
- have_sync=1
-else
- have_sync=0
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_USE_SYNC $have_sync
-_ACEOF
-
-
-#### Various functions
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
-int
-main ()
-{
-return socket ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' socket network; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_socket=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_socket+:} false; then :
-
-else
- ac_cv_search_socket=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_gethostbyname=yes
-else
- ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
- LIBS="-lnsl $LIBS"
-
-fi
-
-fi
-
-
-for ac_func in vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-for ac_header in syslog.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
-if test "x$ac_cv_header_syslog_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYSLOG_H 1
-_ACEOF
-
-fi
-
-done
-
-if test "x$ac_cv_header_syslog_h" = "xyes"; then
- ac_fn_c_check_decl "$LINENO" "LOG_PERROR" "ac_cv_have_decl_LOG_PERROR" "#include <syslog.h>
-"
-if test "x$ac_cv_have_decl_LOG_PERROR" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LOG_PERROR $ac_have_decl
-_ACEOF
-
-fi
-
-#### Check for broken poll; taken from Glib's configure
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll" >&5
-$as_echo_n "checking for broken poll... " >&6; }
-if test "$cross_compiling" = yes; then :
- broken_poll="no (cross compiling)"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <stdlib.h>
- #include <fcntl.h>
- #include <poll.h>
- #ifdef HAVE_SYS_POLL_H
- #include <sys/poll.h>
- #endif
- int main(void) {
- struct pollfd fds[1];
- int fd;
- fd = open("/dev/null", 1);
- fds[0].fd = fd;
- fds[0].events = POLLIN;
- fds[0].revents = 0;
- if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
- exit(1); /* Does not work for devices -- fail */
- }
- exit(0);
- }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- broken_poll=no
-else
- broken_poll=yes
-
-$as_echo "#define BROKEN_POLL 1" >>confdefs.h
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $broken_poll" >&5
-$as_echo "$broken_poll" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dirfd" >&5
-$as_echo_n "checking for dirfd... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <dirent.h>
-
-int
-main ()
-{
-
-DIR *dirp;
-dirp = opendir(".");
-dirfd(dirp);
-closedir(dirp);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- dbus_have_dirfd=yes
-else
- dbus_have_dirfd=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_dirfd" >&5
-$as_echo "$dbus_have_dirfd" >&6; }
-if test "$dbus_have_dirfd" = yes; then
-
-$as_echo "#define HAVE_DIRFD 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIR *dirp->dd_fd" >&5
-$as_echo_n "checking for DIR *dirp->dd_fd... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <dirent.h>
-
-int
-main ()
-{
-
-DIR *dirp;
-int fd;
-dirp = opendir(".");
-fd = dirp->dd_fd;
-closedir(dirp);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- dbus_have_ddfd=yes
-else
- dbus_have_ddfd=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_ddfd" >&5
-$as_echo "$dbus_have_ddfd" >&6; }
- if test "$dbus_have_ddfd" = yes; then
-
-$as_echo "#define HAVE_DDFD 1" >>confdefs.h
-
- fi
-fi
-
-for ac_header in sys/resource.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_resource_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_RESOURCE_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dirent.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default"
-if test "x$ac_cv_header_dirent_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DIRENT_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in execinfo.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
-if test "x$ac_cv_header_execinfo_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_EXECINFO_H 1
-_ACEOF
- for ac_func in backtrace
-do :
- ac_fn_c_check_func "$LINENO" "backtrace" "ac_cv_func_backtrace"
-if test "x$ac_cv_func_backtrace" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_BACKTRACE 1
-_ACEOF
-
-fi
-done
-
-fi
-
-done
-
-
-for ac_header in errno.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
-if test "x$ac_cv_header_errno_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_ERRNO_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in signal.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default"
-if test "x$ac_cv_header_signal_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGNAL_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in locale.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
-if test "x$ac_cv_header_locale_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LOCALE_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in byteswap.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default"
-if test "x$ac_cv_header_byteswap_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_BYTESWAP_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in unistd.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in ws2tcpip.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
-if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_WS2TCPIP_H 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in alloca.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default"
-if test "x$ac_cv_header_alloca_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
-#
-case $host_os in
- solaris*)
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
-esac
-
-# checking for a posix version of getpwnam_r
-# if we are cross compiling and can not run the test
-# assume getpwnam_r is the posix version
-# it is up to the person cross compiling to change
-# this behavior if desired
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix getpwnam_r" >&5
-$as_echo_n "checking for posix getpwnam_r... " >&6; }
-if ${ac_cv_func_posix_getpwnam_r+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_posix_getpwnam_r=yes
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <errno.h>
-#include <pwd.h>
-
-int
-main ()
-{
-
- char buffer[10000];
- struct passwd pwd, *pwptr = &pwd;
- int error;
- errno = 0;
- error = getpwnam_r ("", &pwd, buffer,
- sizeof (buffer), &pwptr);
- return (error < 0 && errno == ENOSYS)
- || error == ENOSYS;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_posix_getpwnam_r=yes
-else
- ac_cv_func_posix_getpwnam_r=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_posix_getpwnam_r" >&5
-$as_echo "$ac_cv_func_posix_getpwnam_r" >&6; }
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-if test "$ac_cv_func_posix_getpwnam_r" = yes; then
-
-$as_echo "#define HAVE_POSIX_GETPWNAM_R 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nonposix getpwnam_r" >&5
-$as_echo_n "checking for nonposix getpwnam_r... " >&6; }
-if ${ac_cv_func_nonposix_getpwnam_r+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <pwd.h>
-int
-main ()
-{
-char buffer[10000];
- struct passwd pwd;
- getpwnam_r ("", &pwd, buffer,
- sizeof (buffer));
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_func_nonposix_getpwnam_r=yes
-else
- ac_cv_func_nonposix_getpwnam_r=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_nonposix_getpwnam_r" >&5
-$as_echo "$ac_cv_func_nonposix_getpwnam_r" >&6; }
- if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
-
-$as_echo "#define HAVE_NONPOSIX_GETPWNAM_R 1" >>confdefs.h
-
- fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether socklen_t is defined" >&5
-$as_echo_n "checking whether socklen_t is defined... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-int
-main ()
-{
-
-socklen_t foo;
-foo = 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- dbus_have_socklen_t=yes
-else
- dbus_have_socklen_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_socklen_t" >&5
-$as_echo "$dbus_have_socklen_t" >&6; }
-
-if test "x$dbus_have_socklen_t" = "xyes"; then
-
-$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
-
-fi
-
-for ac_header in sys/uio.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_uio_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_UIO_H 1
-_ACEOF
- for ac_func in writev
-do :
- ac_fn_c_check_func "$LINENO" "writev" "ac_cv_func_writev"
-if test "x$ac_cv_func_writev" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
-fi
-done
-
-fi
-
-done
-
-
-for ac_header in sys/syslimits.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/syslimits.h" "ac_cv_header_sys_syslimits_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_syslimits_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_SYSLIMITS_H 1
-_ACEOF
-
-fi
-
-done
-
-
-ac_fn_c_check_decl "$LINENO" "MSG_NOSIGNAL" "ac_cv_have_decl_MSG_NOSIGNAL" " #include <sys/types.h>
-#include <sys/socket.h>
-"
-if test "x$ac_cv_have_decl_MSG_NOSIGNAL" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MSG_NOSIGNAL $ac_have_decl
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 varargs macros in C" >&5
-$as_echo_n "checking for ISO C99 varargs macros in C... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-int a(int p1, int p2, int p3);
-#define call_a(...) a(1,__VA_ARGS__)
-call_a(2,3);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- dbus_have_iso_c_varargs=yes
-else
- dbus_have_iso_c_varargs=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_iso_c_varargs" >&5
-$as_echo "$dbus_have_iso_c_varargs" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUC varargs macros" >&5
-$as_echo_n "checking for GNUC varargs macros... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-int a(int p1, int p2, int p3);
-#define call_a(params...) a(1,params)
-call_a(2,3);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- dbus_have_gnuc_varargs=yes
-else
- dbus_have_gnuc_varargs=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_gnuc_varargs" >&5
-$as_echo "$dbus_have_gnuc_varargs" >&6; }
-
-if test x$dbus_have_iso_c_varargs = xyes; then
-
-$as_echo "#define HAVE_ISO_VARARGS 1" >>confdefs.h
-
-fi
-if test x$dbus_have_gnuc_varargs = xyes; then
-
-$as_echo "#define HAVE_GNUC_VARARGS 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct cmsgcred" >&5
-$as_echo_n "checking for struct cmsgcred... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int
-main ()
-{
-
-struct cmsgcred cred;
-
-cred.cmcred_pid = 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- dbus_have_struct_cmsgcred=yes
-else
- dbus_have_struct_cmsgcred=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_struct_cmsgcred" >&5
-$as_echo "$dbus_have_struct_cmsgcred" >&6; }
-
-if test x$dbus_have_struct_cmsgcred = xyes; then
-
-$as_echo "#define HAVE_CMSGCRED 1" >>confdefs.h
-
-fi
-
-for ac_func in getpeerucred getpeereid
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-for ac_func in pipe2 accept4
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-#### Abstract sockets
-
-if test x$enable_abstract_sockets = xauto; then
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-warn_on_xcompile=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking abstract socket namespace" >&5
-$as_echo_n "checking abstract socket namespace... " >&6; }
-if ${ac_cv_have_abstract_sockets+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
-
- ac_cv_have_abstract_sockets=no
- warn_on_xcompile=yes
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-
-int
-main ()
-{
-
- size_t slen;
- int listen_fd;
- struct sockaddr_un addr;
-
- listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
- if (listen_fd < 0)
- {
- fprintf (stderr, "socket() failed: %s\n", strerror (errno));
- exit (1);
- }
-
- memset (&addr, '\0', sizeof (addr));
- addr.sun_family = AF_UNIX;
- strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
- /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
- * beginning.
- */
- slen = SUN_LEN(&addr);
- addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
- {
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- exit (0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_have_abstract_sockets=yes
-else
- ac_cv_have_abstract_sockets=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_abstract_sockets" >&5
-$as_echo "$ac_cv_have_abstract_sockets" >&6; }
-if test x$warn_on_xcompile = xyes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets" >&5
-$as_echo "$as_me: WARNING: Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets" >&2;}
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-
-if test x$enable_abstract_sockets = xyes; then
- if test x$ac_cv_have_abstract_sockets = xno; then
- as_fn_error $? "Abstract sockets explicitly required, and support not detected." "$LINENO" 5
- fi
-fi
-
-if test x$enable_abstract_sockets = xno; then
- ac_cv_have_abstract_sockets=no;
-fi
-
-if test x$ac_cv_have_abstract_sockets = xyes ; then
- DBUS_PATH_OR_ABSTRACT=abstract
-
-$as_echo "#define HAVE_ABSTRACT_SOCKETS 1" >>confdefs.h
-
-else
- DBUS_PATH_OR_ABSTRACT=path
-fi
-
-# this is used in addresses to prefer abstract, e.g.
-# unix:path=/foo or unix:abstract=/foo
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
- ac_pt_PKG_CONFIG=$PKG_CONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_PKG_CONFIG" = x; then
- PKG_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- PKG_CONFIG=$ac_pt_PKG_CONFIG
- fi
-else
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=0.9.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- PKG_CONFIG=""
- fi
-
-fi
-
-#### Sort out XML library
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate_MM in -lexpat" >&5
-$as_echo_n "checking for XML_ParserCreate_MM in -lexpat... " >&6; }
-if ${ac_cv_lib_expat_XML_ParserCreate_MM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lexpat $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XML_ParserCreate_MM ();
-int
-main ()
-{
-return XML_ParserCreate_MM ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_expat_XML_ParserCreate_MM=yes
-else
- ac_cv_lib_expat_XML_ParserCreate_MM=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_ParserCreate_MM" >&5
-$as_echo "$ac_cv_lib_expat_XML_ParserCreate_MM" >&6; }
-if test "x$ac_cv_lib_expat_XML_ParserCreate_MM" = xyes; then :
- for ac_header in expat.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default"
-if test "x$ac_cv_header_expat_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_EXPAT_H 1
-_ACEOF
-
-else
- as_fn_error $? "Could not find expat.h, check config.log for failed attempts" "$LINENO" 5
-fi
-
-done
-
-else
- as_fn_error $? "Explicitly requested expat but expat not found" "$LINENO" 5
-fi
-
-
-XML_LIBS=-lexpat
-XML_CFLAGS=
-
-
-
-# Thread lib detection
-
-save_libs="$LIBS"
-LIBS="$LIBS $THREAD_LIBS"
-
-is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform."
-
-# Don't do these automatic checks if the user set THREAD_LIBS on the
-# configure command-line. If they did, we assume they're right.
-#
-# We also don't do these checks on Windows, because you don't need magical
-# linker flags to have threading support there.
-if test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x; then :
-
- # Mandatory pthread functions. In principle, some of these could be made
- # optional if there are platforms that don't have them.
- #
- # Currently, we only look in -lpthread.
- # In principle we might need to look in -lpthreads, -lthreads, ...
- # as well - please file a bug if your platform needs this.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_cond_timedwait" >&5
-$as_echo_n "checking for library containing pthread_cond_timedwait... " >&6; }
-if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_cond_timedwait ();
-int
-main ()
-{
-return pthread_cond_timedwait ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' pthread; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_pthread_cond_timedwait=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
-
-else
- ac_cv_search_pthread_cond_timedwait=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_cond_timedwait" >&5
-$as_echo "$ac_cv_search_pthread_cond_timedwait" >&6; }
-ac_res=$ac_cv_search_pthread_cond_timedwait
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$LIBS"
-else
- as_fn_error $? "pthread_cond_timedwait $is_missing_pthread_function" "$LINENO" 5
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_init" >&5
-$as_echo_n "checking for library containing pthread_mutexattr_init... " >&6; }
-if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutexattr_init ();
-int
-main ()
-{
-return pthread_mutexattr_init ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' pthread; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_pthread_mutexattr_init=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
-
-else
- ac_cv_search_pthread_mutexattr_init=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_init" >&5
-$as_echo "$ac_cv_search_pthread_mutexattr_init" >&6; }
-ac_res=$ac_cv_search_pthread_mutexattr_init
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$LIBS"
-else
- as_fn_error $? "pthread_mutexattr_init $is_missing_pthread_function" "$LINENO" 5
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_settype" >&5
-$as_echo_n "checking for library containing pthread_mutexattr_settype... " >&6; }
-if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutexattr_settype ();
-int
-main ()
-{
-return pthread_mutexattr_settype ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' pthread; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_pthread_mutexattr_settype=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
-
-else
- ac_cv_search_pthread_mutexattr_settype=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_settype" >&5
-$as_echo "$ac_cv_search_pthread_mutexattr_settype" >&6; }
-ac_res=$ac_cv_search_pthread_mutexattr_settype
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$LIBS"
-else
- as_fn_error $? "pthread_mutexattr_settype $is_missing_pthread_function" "$LINENO" 5
-fi
-
-
- # Optional, for monotonic clocks. Because it's optional, this check
- # is non-fatal if we don't find it.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_condattr_setclock" >&5
-$as_echo_n "checking for library containing pthread_condattr_setclock... " >&6; }
-if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_condattr_setclock ();
-int
-main ()
-{
-return pthread_condattr_setclock ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' pthread; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_pthread_condattr_setclock=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
-
-else
- ac_cv_search_pthread_condattr_setclock=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_condattr_setclock" >&5
-$as_echo "$ac_cv_search_pthread_condattr_setclock" >&6; }
-ac_res=$ac_cv_search_pthread_condattr_setclock
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$LIBS"
-fi
-
-
- if test "x$ac_cv_search_pthread_condattr_setclock" != xno; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_getres" >&5
-$as_echo_n "checking for library containing clock_getres... " >&6; }
-if ${ac_cv_search_clock_getres+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char clock_getres ();
-int
-main ()
-{
-return clock_getres ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' rt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_clock_getres=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_clock_getres+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_clock_getres+:} false; then :
-
-else
- ac_cv_search_clock_getres=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_getres" >&5
-$as_echo "$ac_cv_search_clock_getres" >&6; }
-ac_res=$ac_cv_search_clock_getres
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$LIBS"
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC" >&5
-$as_echo_n "checking for CLOCK_MONOTONIC... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <time.h>
-#include <pthread.h>
-
-int
-main ()
-{
-
-struct timespec monotonic_timer;
-pthread_condattr_t attr;
-pthread_condattr_init (&attr);
-pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
-clock_getres (CLOCK_MONOTONIC,&monotonic_timer);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- have_clock_monotonic=true
-else
- have_clock_monotonic=false
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test x$have_clock_monotonic = xtrue; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
-
-$as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-fi
-
-fi
-fi
-LIBS="$save_libs"
-
-
-
-# SELinux detection
-if test x$enable_selinux = xno ; then
- have_selinux=no;
-else
- # See if we have SELinux library
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_selinux_enabled in -lselinux" >&5
-$as_echo_n "checking for is_selinux_enabled in -lselinux... " >&6; }
-if ${ac_cv_lib_selinux_is_selinux_enabled+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lselinux $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char is_selinux_enabled ();
-int
-main ()
-{
-return is_selinux_enabled ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_selinux_is_selinux_enabled=yes
-else
- ac_cv_lib_selinux_is_selinux_enabled=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5
-$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; }
-if test "x$ac_cv_lib_selinux_is_selinux_enabled" = xyes; then :
- have_selinux=yes
-else
- have_selinux=no
-fi
-
-
- # see if we have the SELinux header with the new D-Bus stuff in it
- if test x$have_selinux = xyes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS Flask permissions in selinux/av_permissions.h" >&5
-$as_echo_n "checking for DBUS Flask permissions in selinux/av_permissions.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <selinux/av_permissions.h>
-int
-main ()
-{
-#ifdef DBUS__ACQUIRE_SVC return 0;
- #else
- #error DBUS__ACQUIRE_SVC not defined
- #endif
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- have_selinux=yes
-else
- have_selinux=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_selinux" >&5
-$as_echo "$have_selinux" >&6; }
- fi
-
- if test x$enable_selinux = xauto ; then
- if test x$have_selinux = xno ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sufficiently new SELinux library not found" >&5
-$as_echo "$as_me: WARNING: Sufficiently new SELinux library not found" >&2;}
- fi
- else
- if test x$have_selinux = xno ; then
- as_fn_error $? "SElinux explicitly required, and SELinux library not found" "$LINENO" 5
- fi
- fi
-fi
-
- if test x$have_selinux = xyes; then
- HAVE_SELINUX_TRUE=
- HAVE_SELINUX_FALSE='#'
-else
- HAVE_SELINUX_TRUE='#'
- HAVE_SELINUX_FALSE=
-fi
-
-
-if test x$have_selinux = xyes ; then
- # the selinux code creates threads
- # which requires libpthread even on linux
- ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create"
-if test "x$ac_cv_func_pthread_create" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_create ();
-int
-main ()
-{
-return pthread_create ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pthread_pthread_create=yes
-else
- ac_cv_lib_pthread_pthread_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
- SELINUX_THREAD_LIBS="-lpthread"
-fi
-
-fi
-
-
- SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
-
-$as_echo "#define HAVE_SELINUX 1" >>confdefs.h
-
-else
- SELINUX_LIBS=
-fi
-
-# inotify checks
-if test x$enable_inotify = xno ; then
- have_inotify=no;
-else
- for ac_header in sys/inotify.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_inotify_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_INOTIFY_H 1
-_ACEOF
- have_inotify=yes
-else
- have_inotify=no
-fi
-
-done
-
-fi
-
-if test x$have_inotify = xyes; then
-
-$as_echo "#define DBUS_BUS_ENABLE_INOTIFY 1" >>confdefs.h
-
- for ac_func in inotify_init1
-do :
- ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1"
-if test "x$ac_cv_func_inotify_init1" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_INOTIFY_INIT1 1
-_ACEOF
-
-fi
-done
-
-fi
-
- if test x$have_inotify = xyes; then
- DBUS_BUS_ENABLE_INOTIFY_TRUE=
- DBUS_BUS_ENABLE_INOTIFY_FALSE='#'
-else
- DBUS_BUS_ENABLE_INOTIFY_TRUE='#'
- DBUS_BUS_ENABLE_INOTIFY_FALSE=
-fi
-
-
-# For simplicity, we require the userland API for epoll_create1 at
-# compile-time (glibc 2.9), but we'll run on kernels that turn out
-# not to have it at runtime.
-# Check whether --enable-epoll was given.
-if test "${enable_epoll+set}" = set; then :
- enableval=$enable_epoll; enable_epoll=$enableval
-else
- enable_epoll=auto
-fi
-
-if test x$enable_epoll = xno; then
- have_linux_epoll=no
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux epoll(4)" >&5
-$as_echo_n "checking for Linux epoll(4)... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #ifndef __linux__
- #error This is not Linux
- #endif
- #include <sys/epoll.h>
-
-int
-main ()
-{
-epoll_create1 (EPOLL_CLOEXEC);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- have_linux_epoll=yes
-else
- have_linux_epoll=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_linux_epoll" >&5
-$as_echo "$have_linux_epoll" >&6; }
-fi
-if test x$enable_epoll,$have_linux_epoll = xyes,no; then
- as_fn_error $? "epoll support explicitly enabled but not available" "$LINENO" 5
-fi
-if test x$have_linux_epoll = xyes; then
-
-$as_echo "#define DBUS_HAVE_LINUX_EPOLL 1" >>confdefs.h
-
-fi
- if test x$have_linux_epoll = xyes; then
- HAVE_LINUX_EPOLL_TRUE=
- HAVE_LINUX_EPOLL_FALSE='#'
-else
- HAVE_LINUX_EPOLL_TRUE='#'
- HAVE_LINUX_EPOLL_FALSE=
-fi
-
-
-# kqueue checks
-if test x$enable_kqueue = xno ; then
- have_kqueue=no
-else
- have_kqueue=yes
- ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_event_h" = xyes; then :
-
-else
- have_kqueue=no
-fi
-
-
- ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue"
-if test "x$ac_cv_func_kqueue" = xyes; then :
-
-else
- have_kqueue=no
-fi
-
-
- if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
- as_fn_error $? "kqueue support explicitly enabled but not available" "$LINENO" 5
- fi
-fi
-
-if test x$have_kqueue = xyes; then
-
-$as_echo "#define DBUS_BUS_ENABLE_KQUEUE 1" >>confdefs.h
-
-fi
-
- if test x$have_kqueue = xyes; then
- DBUS_BUS_ENABLE_KQUEUE_TRUE=
- DBUS_BUS_ENABLE_KQUEUE_FALSE='#'
-else
- DBUS_BUS_ENABLE_KQUEUE_TRUE='#'
- DBUS_BUS_ENABLE_KQUEUE_FALSE=
-fi
-
-
-# launchd checks
-if test x$enable_launchd = xno ; then
- have_launchd=no
-else
- have_launchd=yes
- ac_fn_c_check_header_mongrel "$LINENO" "launch.h" "ac_cv_header_launch_h" "$ac_includes_default"
-if test "x$ac_cv_header_launch_h" = xyes; then :
-
-else
- have_launchd=no
-fi
-
-
- # Extract the first word of "launchctl", so it can be a program name with args.
-set dummy launchctl; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_LAUNCHCTL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $LAUNCHCTL in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_LAUNCHCTL="$LAUNCHCTL" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_LAUNCHCTL="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-LAUNCHCTL=$ac_cv_path_LAUNCHCTL
-if test -n "$LAUNCHCTL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LAUNCHCTL" >&5
-$as_echo "$LAUNCHCTL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$LAUNCHCTL" = "x"; then
- have_launchd=no
- fi
-
- if test x$enable_launchd = xyes && test x$have_launchd = xno ; then
- as_fn_error $? "launchd support explicitly enabled but not available" "$LINENO" 5
- fi
-fi
-
-if test x$have_launchd = xyes; then
-
-$as_echo "#define DBUS_ENABLE_LAUNCHD 1" >>confdefs.h
-
-fi
-
- if test x$have_launchd = xyes; then
- DBUS_ENABLE_LAUNCHD_TRUE=
- DBUS_ENABLE_LAUNCHD_FALSE='#'
-else
- DBUS_ENABLE_LAUNCHD_TRUE='#'
- DBUS_ENABLE_LAUNCHD_FALSE=
-fi
-
-
-#### Directory to place launchd agent file
-if test "x$with_launchd_agent_dir" = "x"; then
- LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
-else
- LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
-fi
-
-
-
-if test x$enable_console_owner_file = xno ; then
- have_console_owner_file=no;
-else
- case $host_os in
- solaris*)
- have_console_owner_file=yes;
-
-$as_echo "#define HAVE_CONSOLE_OWNER_FILE 1" >>confdefs.h
-
- ;;
- *)
- have_console_owner_file=no;;
- esac
-fi
-
- if test x$have_console_owner_file = xyes; then
- HAVE_CONSOLE_OWNER_FILE_TRUE=
- HAVE_CONSOLE_OWNER_FILE_FALSE='#'
-else
- HAVE_CONSOLE_OWNER_FILE_TRUE='#'
- HAVE_CONSOLE_OWNER_FILE_FALSE=
-fi
-
-
-if test x$enable_systemd = xno ; then
- have_systemd=no;
-else
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
-$as_echo_n "checking for SYSTEMD... " >&6; }
-
-if test -n "$SYSTEMD_CFLAGS"; then
- pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$SYSTEMD_LIBS"; then
- pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
- else
- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$SYSTEMD_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- have_systemd=no
-elif test $pkg_failed = untried; then
- have_systemd=no
-else
- SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
- SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- have_systemd=yes
-fi
-fi
-
-if test x$have_systemd = xyes; then
-
-$as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
-
-fi
-
-if test x$enable_systemd = xyes -a x$have_systemd != xyes ; then
- as_fn_error $? "Explicitly requested systemd support, but systemd not found" "$LINENO" 5
-fi
-
-# libaudit detection
-if test x$enable_libaudit = xno ; then
- have_libaudit=no;
-else
- # See if we have audit daemon & capabilities library
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for audit_log_user_avc_message in -laudit" >&5
-$as_echo_n "checking for audit_log_user_avc_message in -laudit... " >&6; }
-if ${ac_cv_lib_audit_audit_log_user_avc_message+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-laudit $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char audit_log_user_avc_message ();
-int
-main ()
-{
-return audit_log_user_avc_message ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_audit_audit_log_user_avc_message=yes
-else
- ac_cv_lib_audit_audit_log_user_avc_message=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audit_audit_log_user_avc_message" >&5
-$as_echo "$ac_cv_lib_audit_audit_log_user_avc_message" >&6; }
-if test "x$ac_cv_lib_audit_audit_log_user_avc_message" = xyes; then :
- have_libaudit=yes
-else
- have_libaudit=no
-fi
-
- if test x$have_libaudit = xyes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for capng_clear in -lcap-ng" >&5
-$as_echo_n "checking for capng_clear in -lcap-ng... " >&6; }
-if ${ac_cv_lib_cap_ng_capng_clear+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcap-ng $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char capng_clear ();
-int
-main ()
-{
-return capng_clear ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_cap_ng_capng_clear=yes
-else
- ac_cv_lib_cap_ng_capng_clear=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_ng_capng_clear" >&5
-$as_echo "$ac_cv_lib_cap_ng_capng_clear" >&6; }
-if test "x$ac_cv_lib_cap_ng_capng_clear" = xyes; then :
- have_libaudit=yes
-else
- have_libaudit=no
-fi
-
- fi
-fi
-
- if test x$have_libaudit = xyes; then
- HAVE_LIBAUDIT_TRUE=
- HAVE_LIBAUDIT_FALSE='#'
-else
- HAVE_LIBAUDIT_TRUE='#'
- HAVE_LIBAUDIT_FALSE=
-fi
-
-
-if test x$have_libaudit = xyes ; then
- SELINUX_LIBS="$SELINUX_LIBS -laudit -lcap-ng"
-
-$as_echo "#define HAVE_LIBAUDIT 1" >>confdefs.h
-
-fi
-
-
-
-# Check for ADT API (Solaris Basic Security Mode auditing)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ADT API" >&5
-$as_echo_n "checking for ADT API... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <bsm/adt.h>
-adt_user_context = ADT_USER;
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- check_adt_audit=yes
-else
- check_adt_audit=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test ${check_adt_audit} = yes
-then
-
-$as_echo "#define HAVE_ADT /**/" >>confdefs.h
-
- ADT_LIBS="-lbsm"
- LIBS="-lbsm $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Check for SCM_RIGHTS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SCM_RIGHTS" >&5
-$as_echo_n "checking for SCM_RIGHTS... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-static int x = SCM_RIGHTS;
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: supported" >&5
-$as_echo "supported" >&6; }
-
-$as_echo "#define HAVE_UNIX_FD_PASSING 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
-$as_echo "not supported" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-NETWORK_libs=
-if test x$dbus_win = xyes ; then
- if test x$dbus_wince = xyes ; then
- NETWORK_libs="-lws2"
- else
- NETWORK_libs="-lws2_32 -liphlpapi"
- fi
-fi
-
-
-
-
-# Check whether --with-valgrind was given.
-if test "${with_valgrind+set}" = set; then :
- withval=$with_valgrind;
-else
- with_valgrind=no
-fi
-
-
-if test "x$with_valgrind" = xauto; then :
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 3.6\""; } >&5
- ($PKG_CONFIG --exists --print-errors "valgrind >= 3.6") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- with_valgrind=yes
-else
- with_valgrind=no
-fi
-fi
-
-if test x$with_valgrind != xno; then
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND" >&5
-$as_echo_n "checking for VALGRIND... " >&6; }
-
-if test -n "$VALGRIND_CFLAGS"; then
- pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 3.6\""; } >&5
- ($PKG_CONFIG --exists --print-errors "valgrind >= 3.6") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_VALGRIND_CFLAGS=`$PKG_CONFIG --cflags "valgrind >= 3.6" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$VALGRIND_LIBS"; then
- pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 3.6\""; } >&5
- ($PKG_CONFIG --exists --print-errors "valgrind >= 3.6") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_VALGRIND_LIBS=`$PKG_CONFIG --libs "valgrind >= 3.6" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "valgrind >= 3.6" 2>&1`
- else
- VALGRIND_PKG_ERRORS=`$PKG_CONFIG --print-errors "valgrind >= 3.6" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$VALGRIND_PKG_ERRORS" >&5
-
- as_fn_error $? "Package requirements (valgrind >= 3.6) were not met:
-
-$VALGRIND_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables VALGRIND_CFLAGS
-and VALGRIND_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-" "$LINENO" 5
-elif test $pkg_failed = untried; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables VALGRIND_CFLAGS
-and VALGRIND_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
- VALGRIND_CFLAGS=$pkg_cv_VALGRIND_CFLAGS
- VALGRIND_LIBS=$pkg_cv_VALGRIND_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- :
-fi
-
-$as_echo "#define WITH_VALGRIND 1" >>confdefs.h
-
-fi
-
-# Determine maximum number of Unix fds which may be passed
-case $host_os in #(
- *qnx*) :
- DEFAULT_MESSAGE_UNIX_FDS=256 ;; #(
- *) :
- DEFAULT_MESSAGE_UNIX_FDS=1024 ;; #(
- *) :
- ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_DEFAULT_MESSAGE_UNIX_FDS $DEFAULT_MESSAGE_UNIX_FDS
-_ACEOF
-
-
-
-#### Set up final flags
-LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs"
-
-
-### X11 detection
-DBUS_X_LIBS=
-DBUS_X_CFLAGS=
-
-# Check whether --enable-x11-autolaunch was given.
-if test "${enable_x11_autolaunch+set}" = set; then :
- enableval=$enable_x11_autolaunch;
-else
- enable_x11_autolaunch=auto
-fi
-
-
-if test "x$dbus_win" = xyes; then
- if test "x$enable_x11_autolaunch" = xyes; then
- as_fn_error $? "X11 auto-launch is not supported on Windows" "$LINENO" 5
- fi
-
- enable_x11_autolaunch=no
- have_x11=no
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
- withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
- # The user explicitly disabled X.
- have_x=disabled
-else
- case $x_includes,$x_libraries in #(
- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
- *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
- cd conftest.dir
- cat >Imakefile <<'_ACEOF'
-incroot:
- @echo incroot='${INCROOT}'
-usrlibdir:
- @echo usrlibdir='${USRLIBDIR}'
-libdir:
- @echo libdir='${LIBDIR}'
-_ACEOF
- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
- for ac_var in incroot usrlibdir libdir; do
- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
- done
- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
- for ac_extension in a so sl dylib la dll; do
- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
- test -f "$ac_im_libdir/libX11.$ac_extension"; then
- ac_im_usrlibdir=$ac_im_libdir; break
- fi
- done
- # Screen out bogus values from the imake configuration. They are
- # bogus both because they are the default anyway, and because
- # using them would break gcc on systems where it needs fixed includes.
- case $ac_im_incroot in
- /usr/include) ac_x_includes= ;;
- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
- esac
- case $ac_im_usrlibdir in
- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
- esac
- fi
- cd ..
- rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R7/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R7
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R7/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R7
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
- # First, try using that file with no special directory specified.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
- for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
- ac_x_includes=$ac_dir
- break
- fi
-done
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
- # Check for the libraries.
- # See if we find them without any special options.
- # Don't add to $LIBS permanently.
- ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
- LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
- # Don't even attempt the hair of trying to link an X program!
- for ac_extension in a so sl dylib la dll; do
- if test -r "$ac_dir/libX11.$ac_extension"; then
- ac_x_libraries=$ac_dir
- break 2
- fi
- done
-done
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
- no,* | *,no | *\'*)
- # Didn't find X, or a directory has "'" in its name.
- ac_cv_have_x="have_x=no";; #(
- *)
- # Record where we found X for the cache.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$ac_x_includes'\
- ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
- *) have_x=yes;;
- esac
- eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
- no_x=yes
-else
- # If each of the values was on the command line, it overrides each guess.
- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
- # Update the cache value to reflect the command line values.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$x_includes'\
- ac_x_libraries='$x_libraries'"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-if test "$no_x" = yes; then
- # Not all programs may use this symbol, but it does not hurt to define it.
-
-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
-
- X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
- if test -n "$x_includes"; then
- X_CFLAGS="$X_CFLAGS -I$x_includes"
- fi
-
- # It would also be nice to do this for all -L options, not just this one.
- if test -n "$x_libraries"; then
- X_LIBS="$X_LIBS -L$x_libraries"
- # For Solaris; some versions of Sun CC require a space after -R and
- # others require no space. Words are not sufficient . . . .
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
- ac_xsave_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- X_LIBS="$X_LIBS -R$x_libraries"
-else
- LIBS="$ac_xsave_LIBS -R $x_libraries"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- X_LIBS="$X_LIBS -R $x_libraries"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
-$as_echo "neither works" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_c_werror_flag=$ac_xsave_c_werror_flag
- LIBS=$ac_xsave_LIBS
- fi
-
- # Check for system-dependent libraries X programs must link with.
- # Do this before checking for the system-independent R6 libraries
- # (-lICE), since we may need -lsocket or whatever for X linking.
-
- if test "$ISC" = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
- else
- # Martyn Johnson says this is needed for Ultrix, if the X
- # libraries were built with DECnet support. And Karl Berry says
- # the Alpha needs dnet_stub (dnet does not exist).
- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dnet_dnet_ntoa=yes
-else
- ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
- if test $ac_cv_lib_dnet_dnet_ntoa = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
- ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$ac_xsave_LIBS"
-
- # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
- # to get the SysV transport functions.
- # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
- # needs -lnsl.
- # The nsl library prevents programs from opening the X display
- # on Irix 5.2, according to T.E. Dickey.
- # The functions gethostbyname, getservbyname, and inet_addr are
- # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
-
-fi
-
- if test $ac_cv_func_gethostbyname = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_gethostbyname=yes
-else
- ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
- if test $ac_cv_lib_nsl_gethostbyname = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_bsd_gethostbyname=yes
-else
- ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
- fi
- fi
-
- # lieder@skyler.mavd.honeywell.com says without -lsocket,
- # socket/setsockopt and other routines are undefined under SCO ODT
- # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
- # on later versions), says Simon Leinen: it contains gethostby*
- # variants that don't use the name server (or something). -lsocket
- # must be given before -lnsl if both are needed. We assume that
- # if connect needs -lnsl, so does gethostbyname.
- ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = xyes; then :
-
-fi
-
- if test $ac_cv_func_connect = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
-$as_echo_n "checking for connect in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_connect+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_connect=yes
-else
- ac_cv_lib_socket_connect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
-$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = xyes; then :
- X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
- fi
-
- # Guillermo Gomez says -lposix is necessary on A/UX.
- ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = xyes; then :
-
-fi
-
- if test $ac_cv_func_remove = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
-$as_echo_n "checking for remove in -lposix... " >&6; }
-if ${ac_cv_lib_posix_remove+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-int
-main ()
-{
-return remove ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_posix_remove=yes
-else
- ac_cv_lib_posix_remove=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
-$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
- fi
-
- # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
- ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = xyes; then :
-
-fi
-
- if test $ac_cv_func_shmat = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
-$as_echo_n "checking for shmat in -lipc... " >&6; }
-if ${ac_cv_lib_ipc_shmat+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-int
-main ()
-{
-return shmat ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ipc_shmat=yes
-else
- ac_cv_lib_ipc_shmat=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
- fi
- fi
-
- # Check for libraries that X11R6 Xt/Xaw programs need.
- ac_save_LDFLAGS=$LDFLAGS
- test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
- # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
- # check for ICE first), but we must link in the order -lSM -lICE or
- # we get undefined symbols. So assume we have SM if we have ICE.
- # These have to be linked with before -lX11, unlike the other
- # libraries we check for below, so use a different variable.
- # John Interrante, Karl Berry
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char IceConnectionNumber ();
-int
-main ()
-{
-return IceConnectionNumber ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ICE_IceConnectionNumber=yes
-else
- ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
- X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
- LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-
- if test "x$no_x" = xyes; then
- have_x11=no
- else
- have_x11=yes
- DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
- DBUS_X_CFLAGS="$X_CFLAGS"
- fi
-fi
-
-if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
- as_fn_error $? "X11 auto-launch requires X headers/libraries" "$LINENO" 5
-else
- # move from "auto" to "yes" or "no" if necessary
- if test "x$enable_x11_autolaunch" != xno; then
- enable_x11_autolaunch="$have_x11"
- fi
-fi
-
-if test "x$have_x11" = xyes ; then
-
-$as_echo "#define DBUS_BUILD_X11 1" >>confdefs.h
-
-fi
-
-if test "x$enable_x11_autolaunch" = xyes ; then
-
-$as_echo "#define DBUS_ENABLE_X11_AUTOLAUNCH 1" >>confdefs.h
-
-fi
-
-
-
-
-#### gcc warning flags
-
-cc_supports_flag() {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports \"$*\"" >&5
-$as_echo_n "checking whether $CC supports \"$*\"... " >&6; }
- save_CFLAGS="$CFLAGS"
- CFLAGS="$*"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- rc=yes
-else
- rc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rc" >&5
-$as_echo "$rc" >&6; }
- test "x$rc" = xyes
-}
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands " >&5
-$as_echo_n "checking to see if compiler understands ... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS "
- CXXFLAGS="$CXXFLAGS "
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
-
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
-
- tp_warnings=""
- for tp_flag in all \
- extra \
- char-subscripts \
- missing-declarations \
- missing-prototypes \
- nested-externs \
- pointer-arith \
- cast-align \
- no-address \
- float-equal \
- declaration-after-statement \
- ; do
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -W$tp_flag" >&5
-$as_echo_n "checking to see if compiler understands -W$tp_flag... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -W$tp_flag"
- CXXFLAGS="$CXXFLAGS -W$tp_flag"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- tp_warnings="$tp_warnings -W$tp_flag"
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
- done
-
- tp_error_flags="-Werror"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5
-$as_echo_n "checking to see if compiler understands -Werror... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -Werror"
- CXXFLAGS="$CXXFLAGS -Werror"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- tp_werror=yes
- true
- else
- tp_werror=no
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
- for tp_flag in $DISABLE_UNUSED_WARNINGS \
- missing-field-initializers \
- unused-parameter \
- sign-compare \
- pointer-sign \
- type-limits \
- ; do
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-$tp_flag" >&5
-$as_echo_n "checking to see if compiler understands -Wno-$tp_flag... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -Wno-$tp_flag"
- CXXFLAGS="$CXXFLAGS -Wno-$tp_flag"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- tp_warnings="$tp_warnings -Wno-$tp_flag"
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-error=$tp_flag" >&5
-$as_echo_n "checking to see if compiler understands -Wno-error=$tp_flag... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -Wno-error=$tp_flag"
- CXXFLAGS="$CXXFLAGS -Wno-error=$tp_flag"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"
- true
- else
- tp_werror=no
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
- done
-
- # Check whether --enable-Werror was given.
-if test "${enable_Werror+set}" = set; then :
- enableval=$enable_Werror; tp_werror=$enableval
-else
- :
-fi
-
-
- if test "x$tp_werror" = xyes && test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes; then
- WARNING_CFLAGS="$tp_error_flags $tp_warnings"
- else
- WARNING_CFLAGS="$tp_warnings"
- fi
-
-
-
-if test "x$GCC" = "xyes"; then
- # We're treating -fno-common like a warning: it makes the linker more
- # strict, because on some systems the linker is *always* this strict
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -fno-common" >&5
-$as_echo_n "checking to see if compiler understands -fno-common... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -fno-common"
- CXXFLAGS="$CXXFLAGS -fno-common"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- WARNING_CFLAGS="$WARNING_CFLAGS -fno-common"
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
-
- # http://bugs.freedesktop.org/show_bug.cgi?id=10599
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -fno-strict-aliasing" >&5
-$as_echo_n "checking to see if compiler understands -fno-strict-aliasing... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -fno-strict-aliasing"
- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- WARNING_CFLAGS="$WARNING_CFLAGS -fno-strict-aliasing"
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
-
- if test "x$enable_ansi" = "xyes"; then
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic" >&5
-$as_echo_n "checking to see if compiler understands -ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic... " >&6; }
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS -ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic"
- CXXFLAGS="$CXXFLAGS -ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- flag_ok=yes
-else
- flag_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- WARNING_CFLAGS="$WARNING_CFLAGS -ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic"
- true
- else
-
- true
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5
-$as_echo "$flag_ok" >&6; }
-
-
- fi
-fi
-
-CFLAGS="$WARNING_CFLAGS $CFLAGS"
-
-case $host_os in
- solaris*)
- # Solaris' C library apparently needs these runes to be threadsafe...
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
- # ... this opt-in to get sockaddr_in6 and sockaddr_storage...
- CFLAGS="$CFLAGS -D__EXTENSIONS__"
- # ... and this opt-in to get file descriptor passing support
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500"
- ;;
-esac
-
-### Doxygen Documentation
-
-# Extract the first word of "doxygen", so it can be a program name with args.
-set dummy doxygen; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DOXYGEN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $DOXYGEN in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN="no"
- ;;
-esac
-fi
-DOXYGEN=$ac_cv_path_DOXYGEN
-if test -n "$DOXYGEN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5
-$as_echo "$DOXYGEN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Doxygen documentation" >&5
-$as_echo_n "checking whether to build Doxygen documentation... " >&6; }
-
-if test x$DOXYGEN = xno ; then
- have_doxygen=no
-else
- have_doxygen=yes
-fi
-
-if test x$enable_doxygen_docs = xauto ; then
- if test x$have_doxygen = xno ; then
- enable_doxygen_docs=no
- else
- enable_doxygen_docs=yes
- fi
-fi
-
-if test x$enable_doxygen_docs = xyes; then
- if test x$have_doxygen = xno; then
- as_fn_error $? "Building Doxygen docs explicitly required, but Doxygen not found" "$LINENO" 5
- fi
-fi
-
- if test x$enable_doxygen_docs = xyes; then
- DBUS_DOXYGEN_DOCS_ENABLED_TRUE=
- DBUS_DOXYGEN_DOCS_ENABLED_FALSE='#'
-else
- DBUS_DOXYGEN_DOCS_ENABLED_TRUE='#'
- DBUS_DOXYGEN_DOCS_ENABLED_FALSE=
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_doxygen_docs" >&5
-$as_echo "$enable_doxygen_docs" >&6; }
-
-for ac_prog in xsltproc
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_XSLTPROC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$XSLTPROC"; then
- ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_XSLTPROC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-XSLTPROC=$ac_cv_prog_XSLTPROC
-if test -n "$XSLTPROC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
-$as_echo "$XSLTPROC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$XSLTPROC" && break
-done
-
- if test "x$XSLTPROC" != "x"; then
- DBUS_HAVE_XSLTPROC_TRUE=
- DBUS_HAVE_XSLTPROC_FALSE='#'
-else
- DBUS_HAVE_XSLTPROC_TRUE='#'
- DBUS_HAVE_XSLTPROC_FALSE=
-fi
-
-
-### XML Documentation
-
-# Extract the first word of "xmlto", so it can be a program name with args.
-set dummy xmlto; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XMLTO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $XMLTO in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_XMLTO" && ac_cv_path_XMLTO="no"
- ;;
-esac
-fi
-XMLTO=$ac_cv_path_XMLTO
-if test -n "$XMLTO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5
-$as_echo "$XMLTO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XML documentation" >&5
-$as_echo_n "checking whether to build XML documentation... " >&6; }
-
-if test x$XMLTO = xno ; then
- have_xmlto=no
-else
- have_xmlto=yes
-fi
-
-if test x$enable_xml_docs = xauto ; then
- if test x$have_xmlto = xno ; then
- enable_xml_docs=no
- else
- enable_xml_docs=yes
- fi
-fi
-
-if test x$enable_xml_docs = xyes; then
- if test x$have_xmlto = xno; then
- as_fn_error $? "Building XML docs explicitly required, but xmlto not found" "$LINENO" 5
- fi
-fi
-
- if test x$enable_xml_docs = xyes; then
- DBUS_XML_DOCS_ENABLED_TRUE=
- DBUS_XML_DOCS_ENABLED_FALSE='#'
-else
- DBUS_XML_DOCS_ENABLED_TRUE='#'
- DBUS_XML_DOCS_ENABLED_FALSE=
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xml_docs" >&5
-$as_echo "$enable_xml_docs" >&6; }
-
- if test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes; then
- DBUS_CAN_UPLOAD_DOCS_TRUE=
- DBUS_CAN_UPLOAD_DOCS_FALSE='#'
-else
- DBUS_CAN_UPLOAD_DOCS_TRUE='#'
- DBUS_CAN_UPLOAD_DOCS_FALSE=
-fi
-
-
-#### Have to go $localstatedir->$prefix/var->/usr/local/var
-
-#### find the actual value for $prefix that we'll end up with
-## (I know this is broken and should be done in the Makefile, but
-## that's a major pain and almost nobody actually seems to care)
-
- EXP_VAR=EXPANDED_PREFIX
- FROM_VAR="$prefix"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_PREFIX="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_LOCALSTATEDIR
- FROM_VAR="$localstatedir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_LOCALSTATEDIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_SYSCONFDIR
- FROM_VAR="$sysconfdir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_SYSCONFDIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_BINDIR
- FROM_VAR="$bindir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_BINDIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_LIBDIR
- FROM_VAR="$libdir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_LIBDIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_LIBEXECDIR
- FROM_VAR="$libexecdir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_LIBEXECDIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
- EXP_VAR=EXPANDED_DATADIR
- FROM_VAR="$datadir"
-
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- full_var=$new_full_var
- EXPANDED_DATADIR="$full_var"
-
-
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-
-
-#### Check our operating system
-operating_system=unknown
-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
- operating_system=redhat
-fi
-
-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
- operating_system=slackware
-fi
-
-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
- operating_system=cygwin
-fi
-
-#### Sort out init scripts
-
-if test x$with_init_scripts = x; then
- case x$operating_system in
- xredhat) with_init_scripts=redhat ;;
- xslackware) with_init_scripts=slackware ;;
- xcygwin) with_init_scripts=cygwin ;;
- *) with_init_scripts=none ;;
- esac
-fi
-
- if test x$with_init_scripts = xredhat; then
- DBUS_INIT_SCRIPTS_RED_HAT_TRUE=
- DBUS_INIT_SCRIPTS_RED_HAT_FALSE='#'
-else
- DBUS_INIT_SCRIPTS_RED_HAT_TRUE='#'
- DBUS_INIT_SCRIPTS_RED_HAT_FALSE=
-fi
-
- if test x$with_init_scripts = xslackware; then
- DBUS_INIT_SCRIPTS_SLACKWARE_TRUE=
- DBUS_INIT_SCRIPTS_SLACKWARE_FALSE='#'
-else
- DBUS_INIT_SCRIPTS_SLACKWARE_TRUE='#'
- DBUS_INIT_SCRIPTS_SLACKWARE_FALSE=
-fi
-
- if test x$with_init_scripts = xcygwin; then
- DBUS_INIT_SCRIPTS_CYGWIN_TRUE=
- DBUS_INIT_SCRIPTS_CYGWIN_FALSE='#'
-else
- DBUS_INIT_SCRIPTS_CYGWIN_TRUE='#'
- DBUS_INIT_SCRIPTS_CYGWIN_FALSE=
-fi
-
-
-##### systemd unit files
-
-# Check whether --with-systemdsystemunitdir was given.
-if test "${with_systemdsystemunitdir+set}" = set; then :
- withval=$with_systemdsystemunitdir;
-else
-
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd\""; } >&5
- ($PKG_CONFIG --exists --print-errors "systemd") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
-else
- with_systemdsystemunitdir=no
-fi
-
-fi
-
-if test "x$with_systemdsystemunitdir" != xno; then
- systemdsystemunitdir=$with_systemdsystemunitdir
-
-fi
- if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
- HAVE_SYSTEMD_TRUE=
- HAVE_SYSTEMD_FALSE='#'
-else
- HAVE_SYSTEMD_TRUE='#'
- HAVE_SYSTEMD_FALSE=
-fi
-
-
-##### Set up location for system bus socket
-if ! test -z "$with_system_socket"; then
- DBUS_SYSTEM_SOCKET=$with_system_socket
-else
- DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
-fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_SYSTEM_SOCKET "$DBUS_SYSTEM_SOCKET"
-_ACEOF
-
-
-## System bus only listens on local domain sockets, and never
-## on an abstract socket (so only root can create the socket).
-##
-## This won't work on Windows. It's not meant to - the system bus is
-## meaningless on Windows anyway.
-##
-## This has to be suitable for hard-coding in client libraries as well as
-## in the dbus-daemon's configuration, so it has to be valid to listen on
-## and also to connect to. If this ever changes, it'll need to be split into
-## two variables, one for the listening address and one for the connecting
-## address.
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS"
-_ACEOF
-
-
-#### Set up the pid file
-if ! test -z "$with_system_pid_file"; then
- DBUS_SYSTEM_PID_FILE=$with_system_pid_file
-elif test x$with_init_scripts = xredhat ; then
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
-else
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
-fi
-
-
-
-#### Directory to check for console ownership
-if ! test -z "$with_console_auth_dir"; then
- DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
-else
- DBUS_CONSOLE_AUTH_DIR=/var/run/console/
-fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_CONSOLE_AUTH_DIR "$DBUS_CONSOLE_AUTH_DIR"
-_ACEOF
-
-
-#### File to check for console ownership
-if test x$have_console_owner_file = xyes; then
- if ! test -z "$with_console_owner_file"; then
- DBUS_CONSOLE_OWNER_FILE=$with_console_owner_file
- else
- DBUS_CONSOLE_OWNER_FILE=/dev/console
- fi
-else
- DBUS_CONSOLE_OWNER_FILE=
-fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_CONSOLE_OWNER_FILE "$DBUS_CONSOLE_OWNER_FILE"
-_ACEOF
-
-
-#### User to start the system bus as
-if test -z "$with_dbus_user" ; then
- DBUS_USER=messagebus
-else
- DBUS_USER=$with_dbus_user
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_USER "$DBUS_USER"
-_ACEOF
-
-
-#### Prefix to install into
-DBUS_PREFIX=$EXPANDED_PREFIX
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_PREFIX "$DBUS_PREFIX"
-_ACEOF
-
-
-#### Direcotry to install data files into
-DBUS_DATADIR=$EXPANDED_DATADIR
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_DATADIR "$DBUS_DATADIR"
-_ACEOF
-
-
-#### Directory to install dbus-daemon
-if test -z "$with_dbus_daemondir" ; then
- DBUS_DAEMONDIR=$EXPANDED_BINDIR
-else
- DBUS_DAEMONDIR=$with_dbus_daemondir
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_DAEMONDIR "$DBUS_DAEMONDIR"
-_ACEOF
-
-
-#### Directory to install the other binaries
-DBUS_BINDIR="$EXPANDED_BINDIR"
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_BINDIR "$DBUS_BINDIR"
-_ACEOF
-
-
-#### Directory to install the libexec binaries
-DBUS_LIBEXECDIR="$EXPANDED_LIBEXECDIR"
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_LIBEXECDIR "$DBUS_LIBEXECDIR"
-_ACEOF
-
-
-#### Tell tests where to find certain stuff in builddir
-
-DBUS_PWD=`pwd`
-# Useful in a cross-compilation environment, where the tests are run on the host system.
-
-# Check whether --with-dbus-test-dir was given.
-if test "${with_dbus_test_dir+set}" = set; then :
- withval=$with_dbus_test_dir; DBUS_PWD=$withval
-fi
-
-
-DBUS_TEST_EXEC="$DBUS_PWD/test"
-DBUS_TEST_DATA="$DBUS_PWD/test/data"
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_TEST_EXEC "$DBUS_TEST_EXEC"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_EXEEXT "$EXEEXT"
-_ACEOF
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define TEST_BUS_LAUNCH_BINARY "$DBUS_PWD/tools/dbus-launch$EXEEXT"
-_ACEOF
-
-
-## Export the non-setuid external helper
-TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_TEST_LAUNCH_HELPER_BINARY "$TEST_LAUNCH_HELPER_BINARY"
-_ACEOF
-
-
-#### Find socket directories
-if ! test -z "$TMPDIR" ; then
- DEFAULT_SOCKET_DIR=$TMPDIR
-elif ! test -z "$TEMP" ; then
- DEFAULT_SOCKET_DIR=$TEMP
-elif ! test -z "$TMP" ; then
- DEFAULT_SOCKET_DIR=$TMP
-else
- DEFAULT_SOCKET_DIR=/tmp
-fi
-
-DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
-
-if ! test -z "$with_test_socket_dir" ; then
- TEST_SOCKET_DIR="$with_test_socket_dir"
-else
- TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_TEST_SOCKET_DIR "$TEST_SOCKET_DIR"
-_ACEOF
-
-
-if test "x$dbus_unix" = xyes; then
- TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
-else
- TEST_LISTEN="tcp:host=localhost"
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define TEST_LISTEN "$TEST_LISTEN"
-_ACEOF
-
-
-if ! test -z "$with_session_socket_dir" ; then
- DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
-else
- DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_SESSION_SOCKET_DIR "$DBUS_SESSION_SOCKET_DIR"
-_ACEOF
-
-
-
-# This must be a listening address. It doesn't necessarily need to be an
-# address you can connect to - it can be something vague like
-# "nonce-tcp:".
-#
-# The default varies by platform.
-
-# Check whether --with-dbus_session_bus_listen_address was given.
-if test "${with_dbus_session_bus_listen_address+set}" = set; then :
- withval=$with_dbus_session_bus_listen_address; with_dbus_session_bus_listen_address=$withval
-else
- with_dbus_session_bus_listen_address=
-fi
-
-
-if test "x$with_dbus_session_bus_listen_address" != "x"; then
- # the user specified something, trust them
- DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address"
-elif test x$dbus_win = xyes; then
- # On Windows, you can (and should) listen on autolaunch addresses,
- # because autolaunching is different.
- # See https://bugs.freedesktop.org/show_bug.cgi?id=38201
- DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:"
-elif test x$have_launchd = xyes; then
- # Mac OS X default is to use launchd
- DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
-else
- # The default on all other Unix platforms (notably Linux)
- # is to create a randomly named socket in /tmp or similar
- DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
-fi
-
-
-# This must be an address you can connect to. It doesn't necessarily
-# need to be an address you can listen on - it can be "autolaunch:",
-# even on Unix.
-#
-# The default varies by platform.
-
-# Check whether --with-dbus_session_bus_connect_address was given.
-if test "${with_dbus_session_bus_connect_address+set}" = set; then :
- withval=$with_dbus_session_bus_connect_address; with_dbus_session_bus_connect_address=$withval
-else
- with_dbus_session_bus_connect_address=
-fi
-
-
-if test "x$with_dbus_session_bus_connect_address" != "x"; then
- # the user specified something, trust them
- DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address"
-elif test x$dbus_win = xyes; then
- # Windows autolaunching is a bit different; leaving it in its own
- # branch of the conditional because the default might conceivably
- # change (see #38201)
- DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
-else
- # The default on all other Unix platforms (notably Linux)
- # is to use auto-launching - this works a bit differently on Mac OS X
- # but comes out basically the same in the end
- DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_SESSION_BUS_CONNECT_ADDRESS "$DBUS_SESSION_BUS_CONNECT_ADDRESS"
-_ACEOF
-
-
-# darwin needs this to initialize the environment
-for ac_header in crt_externs.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
-if test "x$ac_cv_header_crt_externs_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_CRT_EXTERNS_H 1
-_ACEOF
-
-fi
-
-done
-
-ac_fn_c_check_func "$LINENO" "_NSGetEnviron" "ac_cv_func__NSGetEnviron"
-if test "x$ac_cv_func__NSGetEnviron" = xyes; then :
-
-$as_echo "#define HAVE_NSGETENVIRON 1" >>confdefs.h
-
-fi
-
-
-
-# Check whether --enable-stats was given.
-if test "${enable_stats+set}" = set; then :
- enableval=$enable_stats;
-else
- enable_stats=no
-fi
-
-if test "x$enable_stats" = xyes; then
-
-$as_echo "#define DBUS_ENABLE_STATS 1" >>confdefs.h
-
-fi
-
-ac_config_files="$ac_config_files Doxyfile dbus/versioninfo.rc dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus bus/messagebus-config bus/org.freedesktop.dbus-session.plist bus/rc.messagebus bus/dbus.service bus/dbus.socket Makefile dbus/Makefile bus/Makefile tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile doc/dbus-cleanup-sockets.1.xml doc/dbus-daemon.1.xml doc/dbus-launch.1.xml doc/dbus-monitor.1.xml doc/dbus-run-session.1.xml doc/dbus-send.1.xml doc/dbus-uuidgen.1.xml dbus-1.pc dbus-1-uninstalled.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-config-files/incoming-limit.conf test/data/valid-config-files-system/debug-allow-all-pass.conf test/data/valid-config-files-system/debug-allow-all-fail.conf test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_WIN_TRUE}" && test -z "${DBUS_WIN_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_WIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_WINCE_TRUE}" && test -z "${DBUS_WINCE_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_WINCE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_UNIX_TRUE}" && test -z "${DBUS_UNIX_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_UNIX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_CYGWIN_TRUE}" && test -z "${DBUS_CYGWIN_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_CYGWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_ENABLE_EMBEDDED_TESTS_TRUE}" && test -z "${DBUS_ENABLE_EMBEDDED_TESTS_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_ENABLE_EMBEDDED_TESTS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_WITH_DBUS_GLIB_TRUE}" && test -z "${DBUS_WITH_DBUS_GLIB_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_WITH_DBUS_GLIB\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_ENABLE_MODULAR_TESTS_TRUE}" && test -z "${DBUS_ENABLE_MODULAR_TESTS_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_ENABLE_MODULAR_TESTS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_WITH_GLIB_TRUE}" && test -z "${DBUS_WITH_GLIB_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_WITH_GLIB\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${DBUS_ENABLE_INSTALLED_TESTS_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_ENABLE_INSTALLED_TESTS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${HAVE_SELINUX_TRUE}" && test -z "${HAVE_SELINUX_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_SELINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_BUS_ENABLE_INOTIFY_TRUE}" && test -z "${DBUS_BUS_ENABLE_INOTIFY_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_BUS_ENABLE_INOTIFY\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LINUX_EPOLL_TRUE}" && test -z "${HAVE_LINUX_EPOLL_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_LINUX_EPOLL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_BUS_ENABLE_KQUEUE_TRUE}" && test -z "${DBUS_BUS_ENABLE_KQUEUE_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_BUS_ENABLE_KQUEUE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_ENABLE_LAUNCHD_TRUE}" && test -z "${DBUS_ENABLE_LAUNCHD_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_ENABLE_LAUNCHD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_CONSOLE_OWNER_FILE_TRUE}" && test -z "${HAVE_CONSOLE_OWNER_FILE_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_CONSOLE_OWNER_FILE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBAUDIT_TRUE}" && test -z "${HAVE_LIBAUDIT_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_LIBAUDIT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_DOXYGEN_DOCS_ENABLED_TRUE}" && test -z "${DBUS_DOXYGEN_DOCS_ENABLED_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_DOXYGEN_DOCS_ENABLED\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_HAVE_XSLTPROC_TRUE}" && test -z "${DBUS_HAVE_XSLTPROC_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_HAVE_XSLTPROC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_XML_DOCS_ENABLED_TRUE}" && test -z "${DBUS_XML_DOCS_ENABLED_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_XML_DOCS_ENABLED\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_CAN_UPLOAD_DOCS_TRUE}" && test -z "${DBUS_CAN_UPLOAD_DOCS_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_CAN_UPLOAD_DOCS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_INIT_SCRIPTS_RED_HAT_TRUE}" && test -z "${DBUS_INIT_SCRIPTS_RED_HAT_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_INIT_SCRIPTS_RED_HAT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_INIT_SCRIPTS_SLACKWARE_TRUE}" && test -z "${DBUS_INIT_SCRIPTS_SLACKWARE_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_INIT_SCRIPTS_SLACKWARE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_INIT_SCRIPTS_CYGWIN_TRUE}" && test -z "${DBUS_INIT_SCRIPTS_CYGWIN_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_INIT_SCRIPTS_CYGWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by dbus $as_me 1.7.8, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-dbus config.status 1.7.8
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
-predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
-postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
-LD_RC='`$ECHO "$LD_RC" | $SED "$delay_single_quote_subst"`'
-reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
-reload_flag_RC='`$ECHO "$reload_flag_RC" | $SED "$delay_single_quote_subst"`'
-reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-reload_cmds_RC='`$ECHO "$reload_cmds_RC" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds_RC='`$ECHO "$old_archive_cmds_RC" | $SED "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_RC='`$ECHO "$compiler_RC" | $SED "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
-GCC_RC='`$ECHO "$GCC_RC" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_RC='`$ECHO "$lt_prog_compiler_no_builtin_flag_RC" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_RC='`$ECHO "$lt_prog_compiler_pic_RC" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_RC='`$ECHO "$lt_prog_compiler_wl_RC" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static_RC='`$ECHO "$lt_prog_compiler_static_RC" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_RC='`$ECHO "$lt_cv_prog_compiler_c_o_RC" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc_RC='`$ECHO "$archive_cmds_need_lc_RC" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_RC='`$ECHO "$enable_shared_with_static_runtimes_RC" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_RC='`$ECHO "$export_dynamic_flag_spec_RC" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec_RC='`$ECHO "$whole_archive_flag_spec_RC" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object_RC='`$ECHO "$compiler_needs_object_RC" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_RC='`$ECHO "$old_archive_from_new_cmds_RC" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_RC='`$ECHO "$old_archive_from_expsyms_cmds_RC" | $SED "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_RC='`$ECHO "$archive_cmds_RC" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds_RC='`$ECHO "$archive_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_cmds_RC='`$ECHO "$module_cmds_RC" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds_RC='`$ECHO "$module_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld_RC='`$ECHO "$with_gnu_ld_RC" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag_RC='`$ECHO "$allow_undefined_flag_RC" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag_RC='`$ECHO "$no_undefined_flag_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_RC='`$ECHO "$hardcode_libdir_flag_spec_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator_RC='`$ECHO "$hardcode_libdir_separator_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_RC='`$ECHO "$hardcode_direct_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute_RC='`$ECHO "$hardcode_direct_absolute_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L_RC='`$ECHO "$hardcode_minus_L_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_RC='`$ECHO "$hardcode_shlibpath_var_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic_RC='`$ECHO "$hardcode_automatic_RC" | $SED "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
-inherit_rpath_RC='`$ECHO "$inherit_rpath_RC" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs_RC='`$ECHO "$link_all_deplibs_RC" | $SED "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
-always_export_symbols_RC='`$ECHO "$always_export_symbols_RC" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds_RC='`$ECHO "$export_symbols_cmds_RC" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms_RC='`$ECHO "$exclude_expsyms_RC" | $SED "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-include_expsyms_RC='`$ECHO "$include_expsyms_RC" | $SED "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-prelink_cmds_RC='`$ECHO "$prelink_cmds_RC" | $SED "$delay_single_quote_subst"`'
-postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-postlink_cmds_RC='`$ECHO "$postlink_cmds_RC" | $SED "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
-file_list_spec_RC='`$ECHO "$file_list_spec_RC" | $SED "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_action_RC='`$ECHO "$hardcode_action_RC" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_RC='`$ECHO "$compiler_lib_search_dirs_RC" | $SED "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-predep_objects_RC='`$ECHO "$predep_objects_RC" | $SED "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-postdep_objects_RC='`$ECHO "$postdep_objects_RC" | $SED "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
-predeps_RC='`$ECHO "$predeps_RC" | $SED "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
-postdeps_RC='`$ECHO "$postdeps_RC" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path_RC='`$ECHO "$compiler_lib_search_path_RC" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-DLLTOOL \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-nm_file_list_spec \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib \
-compiler_lib_search_dirs \
-predep_objects \
-postdep_objects \
-predeps \
-postdeps \
-compiler_lib_search_path \
-LD_CXX \
-LD_RC \
-reload_flag_CXX \
-reload_flag_RC \
-compiler_CXX \
-compiler_RC \
-lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_no_builtin_flag_RC \
-lt_prog_compiler_pic_CXX \
-lt_prog_compiler_pic_RC \
-lt_prog_compiler_wl_CXX \
-lt_prog_compiler_wl_RC \
-lt_prog_compiler_static_CXX \
-lt_prog_compiler_static_RC \
-lt_cv_prog_compiler_c_o_CXX \
-lt_cv_prog_compiler_c_o_RC \
-export_dynamic_flag_spec_CXX \
-export_dynamic_flag_spec_RC \
-whole_archive_flag_spec_CXX \
-whole_archive_flag_spec_RC \
-compiler_needs_object_CXX \
-compiler_needs_object_RC \
-with_gnu_ld_CXX \
-with_gnu_ld_RC \
-allow_undefined_flag_CXX \
-allow_undefined_flag_RC \
-no_undefined_flag_CXX \
-no_undefined_flag_RC \
-hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_RC \
-hardcode_libdir_separator_CXX \
-hardcode_libdir_separator_RC \
-exclude_expsyms_CXX \
-exclude_expsyms_RC \
-include_expsyms_CXX \
-include_expsyms_RC \
-file_list_spec_CXX \
-file_list_spec_RC \
-compiler_lib_search_dirs_CXX \
-compiler_lib_search_dirs_RC \
-predep_objects_CXX \
-predep_objects_RC \
-postdep_objects_CXX \
-postdep_objects_RC \
-predeps_CXX \
-predeps_RC \
-postdeps_CXX \
-postdeps_RC \
-compiler_lib_search_path_CXX \
-compiler_lib_search_path_RC; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
-reload_cmds_CXX \
-reload_cmds_RC \
-old_archive_cmds_CXX \
-old_archive_cmds_RC \
-old_archive_from_new_cmds_CXX \
-old_archive_from_new_cmds_RC \
-old_archive_from_expsyms_cmds_CXX \
-old_archive_from_expsyms_cmds_RC \
-archive_cmds_CXX \
-archive_cmds_RC \
-archive_expsym_cmds_CXX \
-archive_expsym_cmds_RC \
-module_cmds_CXX \
-module_cmds_RC \
-module_expsym_cmds_CXX \
-module_expsym_cmds_RC \
-export_symbols_cmds_CXX \
-export_symbols_cmds_RC \
-prelink_cmds_CXX \
-prelink_cmds_RC \
-postlink_cmds_CXX \
-postlink_cmds_RC; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'
-
-
-
-
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;;
- "dbus/versioninfo.rc") CONFIG_FILES="$CONFIG_FILES dbus/versioninfo.rc" ;;
- "dbus/dbus-arch-deps.h") CONFIG_FILES="$CONFIG_FILES dbus/dbus-arch-deps.h" ;;
- "bus/system.conf") CONFIG_FILES="$CONFIG_FILES bus/system.conf" ;;
- "bus/session.conf") CONFIG_FILES="$CONFIG_FILES bus/session.conf" ;;
- "bus/messagebus") CONFIG_FILES="$CONFIG_FILES bus/messagebus" ;;
- "bus/messagebus-config") CONFIG_FILES="$CONFIG_FILES bus/messagebus-config" ;;
- "bus/org.freedesktop.dbus-session.plist") CONFIG_FILES="$CONFIG_FILES bus/org.freedesktop.dbus-session.plist" ;;
- "bus/rc.messagebus") CONFIG_FILES="$CONFIG_FILES bus/rc.messagebus" ;;
- "bus/dbus.service") CONFIG_FILES="$CONFIG_FILES bus/dbus.service" ;;
- "bus/dbus.socket") CONFIG_FILES="$CONFIG_FILES bus/dbus.socket" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "dbus/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/Makefile" ;;
- "bus/Makefile") CONFIG_FILES="$CONFIG_FILES bus/Makefile" ;;
- "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
- "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
- "test/name-test/Makefile") CONFIG_FILES="$CONFIG_FILES test/name-test/Makefile" ;;
- "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
- "doc/dbus-cleanup-sockets.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-cleanup-sockets.1.xml" ;;
- "doc/dbus-daemon.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-daemon.1.xml" ;;
- "doc/dbus-launch.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-launch.1.xml" ;;
- "doc/dbus-monitor.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-monitor.1.xml" ;;
- "doc/dbus-run-session.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-run-session.1.xml" ;;
- "doc/dbus-send.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-send.1.xml" ;;
- "doc/dbus-uuidgen.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-uuidgen.1.xml" ;;
- "dbus-1.pc") CONFIG_FILES="$CONFIG_FILES dbus-1.pc" ;;
- "dbus-1-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES dbus-1-uninstalled.pc" ;;
- "test/data/valid-config-files/debug-allow-all.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/debug-allow-all.conf" ;;
- "test/data/valid-config-files/debug-allow-all-sha1.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/debug-allow-all-sha1.conf" ;;
- "test/data/valid-config-files/incoming-limit.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/incoming-limit.conf" ;;
- "test/data/valid-config-files-system/debug-allow-all-pass.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files-system/debug-allow-all-pass.conf" ;;
- "test/data/valid-config-files-system/debug-allow-all-fail.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files-system/debug-allow-all-fail.conf" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service" ;;
- "test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service" ;;
- "test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service" ;;
- "test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service" ;;
- "test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service" ;;
- "test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service" ;;
- "test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service") CONFIG_FILES="$CONFIG_FILES test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service" ;;
- "test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service") CONFIG_FILES="$CONFIG_FILES test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service" ;;
- "test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service") CONFIG_FILES="$CONFIG_FILES test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
- "libtool":C)
-
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags="CXX RC "
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and in which our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects
-postdep_objects=$lt_postdep_objects
-predeps=$lt_predeps
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- if test x"$xsi_shell" = xyes; then
- sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\ # positional parameters, so assign one to ordinary parameter first.\
-\ func_stripname_result=${3}\
-\ func_stripname_result=${func_stripname_result#"${1}"}\
-\ func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\ func_split_long_opt_name=${1%%=*}\
-\ func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\ func_split_short_opt_arg=${1#??}\
-\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\ case ${1} in\
-\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\ *) func_lo2o_result=${1} ;;\
-\ esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
- func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
- func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
- func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
- sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
- eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\ func_quote_for_eval "${2}"\
-\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-
- cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag_CXX
-reload_cmds=$lt_reload_cmds_CXX
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_CXX
-
-# A language specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_CXX
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_CXX
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_CXX
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_CXX
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_CXX
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds_CXX
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_CXX
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_CXX
-postdep_objects=$lt_postdep_objects_CXX
-predeps=$lt_predeps_CXX
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# ### END LIBTOOL TAG CONFIG: CXX
-_LT_EOF
-
-
- cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: RC
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag_RC
-reload_cmds=$lt_reload_cmds_RC
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_RC
-
-# A language specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_RC
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_RC
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_RC
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_RC
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_RC
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds_RC
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_RC
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_RC
-postdep_objects=$lt_postdep_objects_RC
-predeps=$lt_predeps_RC
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# ### END LIBTOOL TAG CONFIG: RC
-_LT_EOF
-
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-echo "
- D-Bus $VERSION
- ==============
-
- prefix: ${EXPANDED_PREFIX}
- exec_prefix: ${exec_prefix}
- libdir: ${EXPANDED_LIBDIR}
- libexecdir: ${EXPANDED_LIBEXECDIR}
- bindir: ${EXPANDED_BINDIR}
- sysconfdir: ${EXPANDED_SYSCONFDIR}
- localstatedir: ${EXPANDED_LOCALSTATEDIR}
- datadir: ${EXPANDED_DATADIR}
- source code location: ${srcdir}
- compiler: ${CC}
- cflags: ${CFLAGS}
- cppflags: ${CPPFLAGS}
- cxxflags: ${CXXFLAGS}
- 64-bit int: ${DBUS_INT64_TYPE}
- 32-bit int: ${DBUS_INT32_TYPE}
- 16-bit int: ${DBUS_INT16_TYPE}
- Doxygen: ${DOXYGEN:-not found}
- xmlto: ${XMLTO:-not found}"
-
-echo "
- Rebuilding generated files: ${USE_MAINTAINER_MODE}
- gcc coverage profiling: ${enable_compiler_coverage}
- Building embedded tests: ${enable_embedded_tests}
- Building modular tests: ${enable_modular_tests}
- - with GLib: ${with_glib}
- - with dbus-glib: ${with_dbus_glib}
- Building verbose mode: ${enable_verbose_mode}
- Building assertions: ${enable_asserts}
- Building checks: ${enable_checks}
- Building bus stats API: ${enable_stats}
- Building SELinux support: ${have_selinux}
- Building inotify support: ${have_inotify}
- Building kqueue support: ${have_kqueue}
- Building systemd support: ${have_systemd}
- Building X11 code: ${have_x11}
- Building Doxygen docs: ${enable_doxygen_docs}
- Building XML docs: ${enable_xml_docs}
- Building launchd support: ${have_launchd}
- Init scripts style: ${with_init_scripts}
- Abstract socket names: ${ac_cv_have_abstract_sockets}
- System bus socket: ${DBUS_SYSTEM_SOCKET}
- System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
- System bus PID file: ${DBUS_SYSTEM_PID_FILE}
- Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
- Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
- Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
- Console owner file: ${have_console_owner_file}
- Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
- System bus user: ${DBUS_USER}
- Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
- 'make check' socket dir: ${TEST_SOCKET_DIR}
-"
-if test x$have_launchd = xyes; then
- echo " launchd agent dir: ${LAUNCHD_AGENT_DIR}"
-fi
-echo
-
-if test x$enable_embedded_tests = xyes; then
- echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
-fi
-if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
- echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
-fi
-if test x$enable_compiler_coverage = xyes; then
- echo "NOTE: building with coverage profiling is definitely for developers only."
-fi
-if test x$enable_verbose_mode = xyes; then
- echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
-fi
-if test x$enable_asserts = xyes; then
- echo "NOTE: building with assertions increases library size and decreases performance."
-fi
-if test x$enable_checks = xno; then
- echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-Bus, but will slightly decrease D-Bus library size and _very_ slightly improve performance."
-fi
diff --git a/src/3rd_party/dbus-1.7.8/configure.ac b/src/3rd_party/dbus-1.7.8/configure.ac
deleted file mode 100644
index f759cf48cb..0000000000
--- a/src/3rd_party/dbus-1.7.8/configure.ac
+++ /dev/null
@@ -1,1875 +0,0 @@
-dnl -*- mode: m4 -*-
-AC_PREREQ([2.63])
-
-m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [7])
-m4_define([dbus_micro_version], [8])
-m4_define([dbus_version],
- [dbus_major_version.dbus_minor_version.dbus_micro_version])
-AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
-
-AC_CANONICAL_HOST
-
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_MACRO_DIR([m4])
-
-AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability])
-
-GETTEXT_PACKAGE=dbus-1
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
-
-# By default, rebuild autotools files on demand; only use ./missing if the
-# user says --disable-maintainer-mode (some distributions like to do this)
-AM_MAINTAINER_MODE([enable])
-
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-
-AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
-
-# libtool versioning - this applies to libdbus
-#
-# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
-#
-
-## increment if the interface has additions, changes, removals.
-LT_CURRENT=11
-
-## increment any time the source changes; set to
-## 0 if you increment CURRENT
-LT_REVISION=3
-
-## increment if any interfaces have been added; set to 0
-## if any interfaces have been changed or removed. removal has
-## precedence over adding, so set to 0 if both happened.
-LT_AGE=8
-
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-DBUS_MAJOR_VERSION=dbus_major_version
-DBUS_MINOR_VERSION=dbus_minor_version
-DBUS_MICRO_VERSION=dbus_micro_version
-DBUS_VERSION=dbus_major_version.dbus_minor_version.dbus_micro_version
-
-AC_SUBST(DBUS_MAJOR_VERSION)
-AC_SUBST(DBUS_MINOR_VERSION)
-AC_SUBST(DBUS_MICRO_VERSION)
-AC_SUBST(DBUS_VERSION)
-
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-AC_USE_SYSTEM_EXTENSIONS
-AC_ISC_POSIX
-AC_HEADER_STDC
-AC_C_INLINE
-AM_PROG_LIBTOOL
-AC_PROG_MKDIR_P
-COMPILER_COVERAGE
-COMPILER_OPTIMISATIONS
-PKG_PROG_PKG_CONFIG
-
-# Initialize libtool
-LT_INIT([win32-dll])
-LT_LANG([Windows Resource])
-
-# Set some internal variables depending on the platform for later use.
-dbus_win=no
-dbus_cygwin=no
-dbus_unix=no
-case "${host}" in
- *-mingw32ce*)
- dbus_win=yes
- dbus_wince=yes
- ;;
- *-mingw32*)
- dbus_win=yes
- ;;
- *-cygwin*)
- dbus_cygwin=yes
- dbus_unix=yes
- ;;
- *)
- dbus_unix=yes
- ;;
-esac
-
-# Special defines for certain platforms
-if test "$dbus_win" = yes; then
- AC_DEFINE(DBUS_WIN,1,[Defined if we run on a W32 API based system])
- BUILD_TIMESTAMP=`date --iso-8601=minutes`
- AC_SUBST(BUILD_TIMESTAMP)
- # Assume DBUS_VERSION is always three numbers
- BUILD_FILEVERSION=`echo "$DBUS_VERSION" | sed -e 's/\./,/g'`,0
- AC_SUBST(BUILD_FILEVERSION)
- AC_CHECK_TOOL(WINDRES, windres, no)
- if test "$WINDRES" = no; then
- AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
- fi
- if test "$dbus_wince" = yes; then
- AC_DEFINE(DBUS_WINCE,1,[Defined if we run on a W32 CE API based system])
- AC_DEFINE(_WIN32_WCE, 0x0502, [Defined to get newer W32 CE APIs])
- fi
-else
- AC_DEFINE(DBUS_UNIX,1,[Defined if we run on a Unix-based system])
-fi
-if test "$dbus_cygwin" = yes; then
- AC_DEFINE(DBUS_CYGWIN,1,[Defined if we run on a cygwin API based system])
-fi
-
-AM_CONDITIONAL(DBUS_WIN, test "$dbus_win" = yes)
-AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
-AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
-AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
-
-# this must come first: other options use this to set their defaults
-AC_ARG_ENABLE([developer],
- [AS_HELP_STRING([--enable-developer],
- [set defaults to be appropriate for a D-Bus developer instead of a distribution/end-user])],
- [],
- [enable_developer=no])
-
-DBUS_STATIC_BUILD_CPPFLAGS=
-if test "x$enable_shared" = xno; then
- # On Windows, linking against the static library requires special effort
- # to turn off DLL import/export processing. We normally link some things
- # against the dynamic library, but if we're not building that, we'll
- # have to link everything statically.
- DBUS_STATIC_BUILD_CPPFLAGS=-DDBUS_STATIC_BUILD
-fi
-AC_SUBST([DBUS_STATIC_BUILD_CPPFLAGS])
-
-AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
-AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$enable_developer)
-AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$enable_developer)
-AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
-AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto)
-AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
-AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
-AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
-AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon support for SELinux]),enable_libaudit=$enableval,enable_libaudit=auto)
-AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=auto)
-AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
-AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
-AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
-AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
-
-AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
-AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
-AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
-AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
-AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
-AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
-AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
-AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
-AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
-AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
-
-AC_ARG_ENABLE([embedded-tests],
- AS_HELP_STRING([--enable-embedded-tests],
- [enable unit test code in the library and binaries]),
- [], [enable_embedded_tests=$enable_developer])
-AC_ARG_ENABLE([modular-tests],
- AS_HELP_STRING([--enable-modular-tests],
- [enable modular regression tests (requires GLib)]),
- [], [enable_modular_tests=auto])
-# --enable-tests overrides both --enable-embedded-tests and
-# --enable-modular-tests
-AC_ARG_ENABLE([tests],
- AS_HELP_STRING([--enable-tests],
- [enable/disable all tests, overriding embedded-tests/modular-tests]),
- [
- if test "x$enableval" = xyes; then
- AC_MSG_NOTICE([Full test coverage was requested with --enable-tests=yes])
- AC_MSG_NOTICE([This has many dependencies (GLib, dbus-glib, Python)])
- fi
- enable_embedded_tests=$enableval
- enable_modular_tests=$enableval
- ],
- [])
-
-# DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
-# and also some stuff in the test/ subdir.
-AM_CONDITIONAL([DBUS_ENABLE_EMBEDDED_TESTS],
- [test "x$enable_embedded_tests" = xyes])
-if test "x$enable_embedded_tests" = xyes; then
- AC_DEFINE([DBUS_ENABLE_EMBEDDED_TESTS], [1],
- [Define to build test code into the library and binaries])
-fi
-
-# DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
-# These use GTest, from GLib, because life's too short. They're enabled by
-# default (unless you don't have GLib), because they don't bloat the library
-# or binaries.
-
-AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_26], [Ignore post-2.26 deprecations])
-AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_32], [Prevent post-2.32 APIs])
-
-with_glib=yes
-
-AS_IF([test "x$enable_modular_tests" != xno],
- [
- PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24, gio-2.0 >= 2.24],
- [],
- [if test "x$enable_modular_tests" = xyes; then
- AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib])
- AC_MSG_ERROR([$GLIB_ERRORS])
- else # assumed to be "auto"
- with_glib=no
- fi])
- ],
- [with_glib=no])
-
-# Not required, because we can use internal APIs (but that makes the
-# "installable tests" less useful as integration tests)
-AC_ARG_WITH([dbus_glib],
- [AS_HELP_STRING([--with-dbus-glib], [Use dbus-glib for regression tests])],
- [],
- [with_dbus_glib=auto])
-AS_IF([test "x$with_dbus_glib" != xno],
- [PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
- [],
- [AS_IF([test "x$with_dbus_glib" = xyes],
- dnl specifically requested, but not found
- [AC_MSG_ERROR([$DBUS_GLIB_ERRORS])],
- dnl else: assumed to be "auto"
- [with_dbus_glib=no])])])
-AM_CONDITIONAL([DBUS_WITH_DBUS_GLIB], [test "x$with_dbus_glib" != xno])
-
-if test "x$enable_modular_tests" != xno; then
- AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
- [Define to build independent test binaries])
-fi
-AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS],
- [test "x$enable_modular_tests" != xno])
-
-if test "x$with_glib" != xno; then
- AC_DEFINE([DBUS_WITH_GLIB], [1],
- [Define if GLib, GObject, GIO are available])
-fi
-AM_CONDITIONAL([DBUS_WITH_GLIB], [test "x$with_glib" != xno])
-
-AC_ARG_ENABLE([installed-tests],
- AS_HELP_STRING([--enable-installed-tests],
- [enable unit test code in the library and binaries]),
- [], [enable_installed_tests=no])
-AM_CONDITIONAL([DBUS_ENABLE_INSTALLED_TESTS],
- [test "x$enable_installed_tests" = xyes])
-
-if test "x$enable_tests" = xyes; then
- # full test coverage is required, Python is a hard dependency
- AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
- AM_PATH_PYTHON([2.6])
- AC_MSG_CHECKING([for Python modules for full test coverage])
- if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
- fi
-else
- # --enable-tests not given: do not abort if Python is missing
- AM_PATH_PYTHON([2.6], [], [:])
-fi
-
-if test x$enable_verbose_mode = xyes; then
- AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
-fi
-
-if test x$enable_asserts = xno; then
- AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
- DISABLE_UNUSED_WARNINGS="unused-label"
- R_DYNAMIC_LDFLAG=""
- if test x$enable_embedded_tests = xyes; then
- DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
- unused-but-set-variable unused-variable \
- unused-function"
- fi
-else
- # -rdynamic is needed for glibc's backtrace_symbols to work.
- # No clue how much overhead this adds, but it's useful
- # to do this on any assertion failure,
- # so for now it's enabled anytime asserts are (currently not
- # in production builds).
-
- # To get -rdynamic you pass -export-dynamic to libtool.
- AC_DEFINE(DBUS_BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
- R_DYNAMIC_LDFLAG=-export-dynamic
-fi
-AC_SUBST(R_DYNAMIC_LDFLAG)
-
-if test x$enable_checks = xno; then
- AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
- AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
- DISABLE_UNUSED_WARNINGS="unused-label"
-fi
-
-AH_BOTTOM([
-/* explicitly define these macros to get less confusing conditions */
-#ifndef DBUS_DISABLE_ASSERT
-# define DBUS_ENABLE_ASSERT 1
-#endif
-#ifndef DBUS_DISABLE_CHECKS
-# define DBUS_ENABLE_CHECKS 1
-#endif])
-
-if test x$enable_compiler_coverage = xyes; then
- ## so that config.h changes when you toggle gcov support
- AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
-fi
-
-# glibc21.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
-
-AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
- ac_cv_gnu_library_2_1,
- [AC_EGREP_CPP([Lucky GNU user],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
- Lucky GNU user
- #endif
-#endif
- ],
- ac_cv_gnu_library_2_1=yes,
- ac_cv_gnu_library_2_1=no)
- ]
-)
-
-#### Integer sizes
-
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(__int64)
-
-### See what our 64 bit type is called
-AC_MSG_CHECKING([64-bit integer type])
-
-case 8 in
-$ac_cv_sizeof_int)
- dbusint64=int
- dbusint64_constant='(val)'
- dbusuint64_constant='(val)'
- dbusint64_printf_modifier='""'
- ;;
-$ac_cv_sizeof_long)
- dbusint64=long
- dbusint64_constant='(val##L)'
- dbusuint64_constant='(val##UL)'
- dbusint64_printf_modifier='"l"'
- ;;
-$ac_cv_sizeof_long_long)
- dbusint64='long long'
- dbusint64_constant='(val##LL)'
- dbusuint64_constant='(val##ULL)'
- # Ideally we discover what the format is, but this is
- # only used in verbose mode, so eh...
- if test x"$ac_cv_gnu_library_2_1" = xyes; then
- dbusint64_printf_modifier='"ll"'
- fi
- ;;
-$ac_cv_sizeof___int64)
- dbusint64=__int64
- dbusint64_constant='(val##i64)'
- dbusuint64_constant='(val##ui64)'
- # See above case
- if test x"$ac_cv_gnu_library_2_1" = xyes; then
- dbusint64_printf_modifier='"ll"'
- fi
- ;;
-esac
-
-AS_IF(
- [test -z "$dbusint64"],
- [AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Could not find a 64-bit integer type.
-
-Please report a bug here with details of your platform and compiler:
-
- http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core])
- ],
- dnl else
- [
- DBUS_INT64_TYPE="$dbusint64"
- DBUS_INT64_CONSTANT="$dbusint64_constant"
- DBUS_UINT64_CONSTANT="$dbusuint64_constant"
- if test x"$dbusint64_printf_modifier" != x; then
- AC_DEFINE_UNQUOTED(DBUS_INT64_PRINTF_MODIFIER, [$dbusint64_printf_modifier], [Define to printf modifier for 64 bit integer type])
- fi
- AC_MSG_RESULT($DBUS_INT64_TYPE)
- ])
-
-AC_SUBST(DBUS_INT64_TYPE)
-AC_SUBST(DBUS_INT64_CONSTANT)
-AC_SUBST(DBUS_UINT64_CONSTANT)
-
-### see what 32-bit int is called
-AC_MSG_CHECKING([32-bit integer type])
-
-case 4 in
-$ac_cv_sizeof_short)
- dbusint32=short
- ;;
-$ac_cv_sizeof_int)
- dbusint32=int
- ;;
-$ac_cv_sizeof_long)
- dbusint32=long
- ;;
-esac
-
-if test -z "$dbusint32" ; then
- DBUS_INT32_TYPE="no_int32_type_detected"
- AC_MSG_ERROR([No 32-bit integer type found])
-else
- DBUS_INT32_TYPE="$dbusint32"
- AC_MSG_RESULT($DBUS_INT32_TYPE)
-fi
-
-AC_SUBST(DBUS_INT32_TYPE)
-
-### see what 16-bit int is called
-AC_MSG_CHECKING([16-bit integer type])
-
-case 2 in
-$ac_cv_sizeof_short)
- dbusint16=short
- ;;
-$ac_cv_sizeof_int)
- dbusint16=int
- ;;
-esac
-
-if test -z "$dbusint16" ; then
- DBUS_INT16_TYPE="no_int16_type_detected"
- AC_MSG_ERROR([No 16-bit integer type found])
-else
- DBUS_INT16_TYPE="$dbusint16"
- AC_MSG_RESULT($DBUS_INT16_TYPE)
-fi
-
-AC_SUBST(DBUS_INT16_TYPE)
-
-## byte order
-case $host_os in
- darwin*)
- # check at compile-time, so that it is possible to build universal
- # (with multiple architectures at once on the compile line)
- AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [
- /* Use the compiler-provided endianness defines to allow universal compiling. */
- #if defined(__BIG_ENDIAN__)
- #define WORDS_BIGENDIAN 1
- #endif
- ])
- ;;
- *)
- AC_C_BIGENDIAN
- ;;
-esac
-
-dnl **********************************
-dnl *** va_copy checks (from GLib) ***
-dnl **********************************
-dnl we currently check for all three va_copy possibilities, so we get
-dnl all results in config.log for bug reports.
-AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
- AC_LINK_IFELSE([AC_LANG_SOURCE([#include <stdarg.h>
-#include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }])],
- [dbus_cv_va_copy=yes],
- [dbus_cv_va_copy=no])
-])
-AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
- AC_LINK_IFELSE([AC_LANG_SOURCE([#include <stdarg.h>
-#include <stdlib.h>
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- __va_copy (args2, args1);
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }])],
- [dbus_cv___va_copy=yes],
- [dbus_cv___va_copy=no])
-])
-
-if test "x$dbus_cv_va_copy" = "xyes"; then
- dbus_va_copy_func=va_copy
-else if test "x$dbus_cv___va_copy" = "xyes"; then
- dbus_va_copy_func=__va_copy
-fi
-fi
-
-if test -n "$dbus_va_copy_func"; then
- AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
-fi
-
-AC_LANG_PUSH(C)
-AC_CACHE_CHECK([whether va_lists can be copied by value],
- dbus_cv_va_val_copy,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
- #include <stdarg.h>
- #include <stdlib.h>
-]],
-[[
- static void f (int i, ...) {
- va_list args1, args2;
- va_start (args1, i);
- args2 = args1;
- if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
- exit (1);
- va_end (args1); va_end (args2);
- }
- int main() {
- f (0, 42);
- return 0;
- }
-]])],
- [dbus_cv_va_val_copy=yes],
- [dbus_cv_va_val_copy=no],
- [dbus_cv_va_val_copy=yes])
-])
-AC_LANG_POP(C)
-
-if test "x$dbus_cv_va_val_copy" = "xno"; then
- AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
-fi
-
-
-#### Atomic integers
-
-AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
- dbus_cv_sync_sub_and_fetch,
- [AC_LINK_IFELSE([
- AC_LANG_PROGRAM([[]], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]])],
- [dbus_cv_sync_sub_and_fetch=yes],
- [dbus_cv_sync_sub_and_fetch=no])
- ])
-
-if test "x$dbus_cv_sync_sub_and_fetch" = "xyes" ; then
- have_sync=1
-else
- have_sync=0
-fi
-
-AC_DEFINE_UNQUOTED([DBUS_USE_SYNC], [$have_sync], [Use the gcc __sync extension])
-
-#### Various functions
-AC_SEARCH_LIBS(socket,[socket network])
-AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
-
-AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid)
-
-AC_CHECK_HEADERS([syslog.h])
-if test "x$ac_cv_header_syslog_h" = "xyes"; then
- AC_CHECK_DECLS([LOG_PERROR], [], [], [[#include <syslog.h>]])
-fi
-
-#### Check for broken poll; taken from Glib's configure
-
-AC_MSG_CHECKING([for broken poll])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
- #include <stdlib.h>
- #include <fcntl.h>
- #include <poll.h>
- #ifdef HAVE_SYS_POLL_H
- #include <sys/poll.h>
- #endif
- int main(void) {
- struct pollfd fds[1];
- int fd;
- fd = open("/dev/null", 1);
- fds[0].fd = fd;
- fds[0].events = POLLIN;
- fds[0].revents = 0;
- if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
- exit(1); /* Does not work for devices -- fail */
- }
- exit(0);
- }]])],
- [broken_poll=no],
- [broken_poll=yes
- AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
- [broken_poll="no (cross compiling)"])
-AC_MSG_RESULT($broken_poll)
-
-AC_MSG_CHECKING(for dirfd)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <dirent.h>
-]], [[
-DIR *dirp;
-dirp = opendir(".");
-dirfd(dirp);
-closedir(dirp);
-]])],
-[dbus_have_dirfd=yes],
-[dbus_have_dirfd=no])
-AC_MSG_RESULT($dbus_have_dirfd)
-if test "$dbus_have_dirfd" = yes; then
- AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
-else
- AC_MSG_CHECKING(for DIR *dirp->dd_fd)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <dirent.h>
- ]], [[
-DIR *dirp;
-int fd;
-dirp = opendir(".");
-fd = dirp->dd_fd;
-closedir(dirp);
- ]])],
- [dbus_have_ddfd=yes],
- [dbus_have_ddfd=no])
- AC_MSG_RESULT($dbus_have_ddfd)
- if test "$dbus_have_ddfd" = yes; then
- AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR])
- fi
-fi
-
-AC_CHECK_HEADERS(sys/resource.h)
-
-AC_CHECK_HEADERS(dirent.h)
-
-AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
-
-AC_CHECK_HEADERS(errno.h)
-
-AC_CHECK_HEADERS(signal.h)
-
-AC_CHECK_HEADERS(locale.h)
-
-AC_CHECK_HEADERS(byteswap.h)
-
-AC_CHECK_HEADERS(unistd.h)
-
-AC_CHECK_HEADERS(ws2tcpip.h)
-
-AC_CHECK_HEADERS(alloca.h)
-
-# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
-#
-case $host_os in
- solaris*)
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
-esac
-
-# checking for a posix version of getpwnam_r
-# if we are cross compiling and can not run the test
-# assume getpwnam_r is the posix version
-# it is up to the person cross compiling to change
-# this behavior if desired
-AC_LANG_PUSH(C)
-AC_CACHE_CHECK([for posix getpwnam_r],
- ac_cv_func_posix_getpwnam_r,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <errno.h>
-#include <pwd.h>
-]],
-[[
- char buffer[10000];
- struct passwd pwd, *pwptr = &pwd;
- int error;
- errno = 0;
- error = getpwnam_r ("", &pwd, buffer,
- sizeof (buffer), &pwptr);
- return (error < 0 && errno == ENOSYS)
- || error == ENOSYS;
-]])],
- [ac_cv_func_posix_getpwnam_r=yes],
- [ac_cv_func_posix_getpwnam_r=no],
- [ac_cv_func_posix_getpwnam_r=yes]
-)])
-AC_LANG_POP(C)
-
-if test "$ac_cv_func_posix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
- [Have POSIX function getpwnam_r])
-else
- AC_CACHE_CHECK([for nonposix getpwnam_r],
- ac_cv_func_nonposix_getpwnam_r,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[char buffer[10000];
- struct passwd pwd;
- getpwnam_r ("", &pwd, buffer,
- sizeof (buffer));]])],
- [ac_cv_func_nonposix_getpwnam_r=yes],
- [ac_cv_func_nonposix_getpwnam_r=no])])
- if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
- [Have non-POSIX function getpwnam_r])
- fi
-fi
-
-dnl check for socklen_t
-AC_MSG_CHECKING(whether socklen_t is defined)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-]], [[
-socklen_t foo;
-foo = 1;
-]])],
-[dbus_have_socklen_t=yes],
-[dbus_have_socklen_t=no])
-AC_MSG_RESULT($dbus_have_socklen_t)
-
-if test "x$dbus_have_socklen_t" = "xyes"; then
- AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
-fi
-
-dnl check for writev header and writev function so we're
-dnl good to go if HAVE_WRITEV gets defined.
-AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
-
-dnl needed on darwin for NAME_MAX
-AC_CHECK_HEADERS(sys/syslimits.h)
-
-dnl Make it easy to check if we have MSG_NOSIGNAL without actually having to include sys/socket.h
-AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [[ #include <sys/types.h>
-#include <sys/socket.h> ]])
-
-dnl check for flavours of varargs macros (test from GLib)
-AC_MSG_CHECKING(for ISO C99 varargs macros in C)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-int a(int p1, int p2, int p3);
-#define call_a(...) a(1,__VA_ARGS__)
-call_a(2,3);
-]])],
-[dbus_have_iso_c_varargs=yes],
-[dbus_have_iso_c_varargs=no])
-AC_MSG_RESULT($dbus_have_iso_c_varargs)
-
-AC_MSG_CHECKING(for GNUC varargs macros)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-int a(int p1, int p2, int p3);
-#define call_a(params...) a(1,params)
-call_a(2,3);
-]])],
-[dbus_have_gnuc_varargs=yes],
-[dbus_have_gnuc_varargs=no])
-AC_MSG_RESULT($dbus_have_gnuc_varargs)
-
-dnl Output varargs tests
-if test x$dbus_have_iso_c_varargs = xyes; then
- AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
-fi
-if test x$dbus_have_gnuc_varargs = xyes; then
- AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
-fi
-
-dnl Check for various credentials.
-AC_MSG_CHECKING(for struct cmsgcred)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/socket.h>
-]], [[
-struct cmsgcred cred;
-
-cred.cmcred_pid = 0;
-]])],
-[dbus_have_struct_cmsgcred=yes],
-[dbus_have_struct_cmsgcred=no])
-AC_MSG_RESULT($dbus_have_struct_cmsgcred)
-
-if test x$dbus_have_struct_cmsgcred = xyes; then
- AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
-fi
-
-AC_CHECK_FUNCS(getpeerucred getpeereid)
-
-AC_CHECK_FUNCS(pipe2 accept4)
-
-#### Abstract sockets
-
-if test x$enable_abstract_sockets = xauto; then
-AC_LANG_PUSH(C)
-warn_on_xcompile=no
-AC_CACHE_CHECK([abstract socket namespace],
- ac_cv_have_abstract_sockets,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-]],
-[[
- size_t slen;
- int listen_fd;
- struct sockaddr_un addr;
-
- listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
- if (listen_fd < 0)
- {
- fprintf (stderr, "socket() failed: %s\n", strerror (errno));
- exit (1);
- }
-
- memset (&addr, '\0', sizeof (addr));
- addr.sun_family = AF_UNIX;
- strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
- /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
- * beginning.
- */
- slen = SUN_LEN(&addr);
- addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
- {
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- exit (0);
-]])],
- [ac_cv_have_abstract_sockets=yes],
- [ac_cv_have_abstract_sockets=no],
- [
- ac_cv_have_abstract_sockets=no
- warn_on_xcompile=yes
- ]
-)])
-if test x$warn_on_xcompile = xyes ; then
- AC_MSG_WARN([Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets])
-fi
-AC_LANG_POP(C)
-fi
-
-if test x$enable_abstract_sockets = xyes; then
- if test x$ac_cv_have_abstract_sockets = xno; then
- AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
- fi
-fi
-
-if test x$enable_abstract_sockets = xno; then
- ac_cv_have_abstract_sockets=no;
-fi
-
-if test x$ac_cv_have_abstract_sockets = xyes ; then
- DBUS_PATH_OR_ABSTRACT=abstract
- AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
-else
- DBUS_PATH_OR_ABSTRACT=path
-fi
-
-# this is used in addresses to prefer abstract, e.g.
-# unix:path=/foo or unix:abstract=/foo
-AC_SUBST(DBUS_PATH_OR_ABSTRACT)
-
-PKG_PROG_PKG_CONFIG
-
-#### Sort out XML library
-
-AC_CHECK_LIB(expat, XML_ParserCreate_MM,
- [ AC_CHECK_HEADERS(expat.h, [],
- [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ],
- [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ])
-
-XML_LIBS=-lexpat
-XML_CFLAGS=
-AC_SUBST([XML_CFLAGS])
-AC_SUBST([XML_LIBS])
-
-# Thread lib detection
-AC_ARG_VAR([THREAD_LIBS])
-save_libs="$LIBS"
-LIBS="$LIBS $THREAD_LIBS"
-
-is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform."
-
-# Don't do these automatic checks if the user set THREAD_LIBS on the
-# configure command-line. If they did, we assume they're right.
-#
-# We also don't do these checks on Windows, because you don't need magical
-# linker flags to have threading support there.
-AS_IF([test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x],
- [
- # Mandatory pthread functions. In principle, some of these could be made
- # optional if there are platforms that don't have them.
- #
- # Currently, we only look in -lpthread.
- # In principle we might need to look in -lpthreads, -lthreads, ...
- # as well - please file a bug if your platform needs this.
- AC_SEARCH_LIBS([pthread_cond_timedwait],
- [pthread],
- [THREAD_LIBS="$LIBS"],
- [AC_MSG_ERROR([pthread_cond_timedwait $is_missing_pthread_function])],
- [])
- AC_SEARCH_LIBS([pthread_mutexattr_init],
- [pthread],
- [THREAD_LIBS="$LIBS"],
- [AC_MSG_ERROR([pthread_mutexattr_init $is_missing_pthread_function])],
- [])
- AC_SEARCH_LIBS([pthread_mutexattr_settype],
- [pthread],
- [THREAD_LIBS="$LIBS"],
- [AC_MSG_ERROR([pthread_mutexattr_settype $is_missing_pthread_function])],
- [])
-
- # Optional, for monotonic clocks. Because it's optional, this check
- # is non-fatal if we don't find it.
- AC_SEARCH_LIBS([pthread_condattr_setclock],
- [pthread],
- [THREAD_LIBS="$LIBS"])
-
- AS_IF([test "x$ac_cv_search_pthread_condattr_setclock" != xno],
- [
- AC_SEARCH_LIBS([clock_getres], [rt], [THREAD_LIBS="$LIBS"])
- AC_MSG_CHECKING([for CLOCK_MONOTONIC])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[#include <time.h>
-#include <pthread.h>
-]], [[
-struct timespec monotonic_timer;
-pthread_condattr_t attr;
-pthread_condattr_init (&attr);
-pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
-clock_getres (CLOCK_MONOTONIC,&monotonic_timer);
-]])],
- [have_clock_monotonic=true],
- [have_clock_monotonic=false])
- AS_IF([test x$have_clock_monotonic = xtrue],
- [
- AC_MSG_RESULT([found])
- AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
- ],
- [AC_MSG_RESULT([not found])])
- ]) dnl have pthread_condattr_setclock
- ]) dnl on Unix
-
-LIBS="$save_libs"
-
-AC_SUBST([THREAD_LIBS])
-
-# SELinux detection
-if test x$enable_selinux = xno ; then
- have_selinux=no;
-else
- # See if we have SELinux library
- AC_CHECK_LIB(selinux, is_selinux_enabled,
- have_selinux=yes, have_selinux=no)
-
- # see if we have the SELinux header with the new D-Bus stuff in it
- if test x$have_selinux = xyes ; then
- AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <selinux/av_permissions.h>]],
- [[#ifdef DBUS__ACQUIRE_SVC return 0;
- #else
- #error DBUS__ACQUIRE_SVC not defined
- #endif]])],
- [have_selinux=yes],
- [have_selinux=no])
- AC_MSG_RESULT($have_selinux)
- fi
-
- if test x$enable_selinux = xauto ; then
- if test x$have_selinux = xno ; then
- AC_MSG_WARN([Sufficiently new SELinux library not found])
- fi
- else
- if test x$have_selinux = xno ; then
- AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
- fi
- fi
-fi
-
-AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
-
-if test x$have_selinux = xyes ; then
- # the selinux code creates threads
- # which requires libpthread even on linux
- AC_CHECK_FUNC(pthread_create,,[AC_CHECK_LIB(pthread,pthread_create,
- [SELINUX_THREAD_LIBS="-lpthread"])])
-
- SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
- AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
-else
- SELINUX_LIBS=
-fi
-
-# inotify checks
-if test x$enable_inotify = xno ; then
- have_inotify=no;
-else
- AC_CHECK_HEADERS(sys/inotify.h, have_inotify=yes, have_inotify=no)
-fi
-
-dnl check if inotify backend is enabled
-if test x$have_inotify = xyes; then
- AC_DEFINE(DBUS_BUS_ENABLE_INOTIFY,1,[Use inotify])
- AC_CHECK_FUNCS(inotify_init1)
-fi
-
-AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
-
-# For simplicity, we require the userland API for epoll_create1 at
-# compile-time (glibc 2.9), but we'll run on kernels that turn out
-# not to have it at runtime.
-AC_ARG_ENABLE([epoll],
- [AS_HELP_STRING([--enable-epoll],[use epoll(4) on Linux])],
- [enable_epoll=$enableval], [enable_epoll=auto])
-if test x$enable_epoll = xno; then
- have_linux_epoll=no
-else
- AC_MSG_CHECKING([for Linux epoll(4)])
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
- [
- #ifndef __linux__
- #error This is not Linux
- #endif
- #include <sys/epoll.h>
- ],
- [epoll_create1 (EPOLL_CLOEXEC);])],
- [have_linux_epoll=yes],
- [have_linux_epoll=no])
- AC_MSG_RESULT([$have_linux_epoll])
-fi
-if test x$enable_epoll,$have_linux_epoll = xyes,no; then
- AC_MSG_ERROR([epoll support explicitly enabled but not available])
-fi
-if test x$have_linux_epoll = xyes; then
- AC_DEFINE([DBUS_HAVE_LINUX_EPOLL], 1, [Define to use epoll(4) on Linux])
-fi
-AM_CONDITIONAL([HAVE_LINUX_EPOLL], [test x$have_linux_epoll = xyes])
-
-# kqueue checks
-if test x$enable_kqueue = xno ; then
- have_kqueue=no
-else
- have_kqueue=yes
- AC_CHECK_HEADER(sys/event.h, , have_kqueue=no)
- AC_CHECK_FUNC(kqueue, , have_kqueue=no)
-
- if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
- AC_MSG_ERROR(kqueue support explicitly enabled but not available)
- fi
-fi
-
-dnl check if kqueue backend is enabled
-if test x$have_kqueue = xyes; then
- AC_DEFINE(DBUS_BUS_ENABLE_KQUEUE,1,[Use kqueue])
-fi
-
-AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
-
-# launchd checks
-if test x$enable_launchd = xno ; then
- have_launchd=no
-else
- have_launchd=yes
- AC_CHECK_HEADER([launch.h], , have_launchd=no)
- AC_PATH_PROG([LAUNCHCTL], [launchctl])
- if test "x$LAUNCHCTL" = "x"; then
- have_launchd=no
- fi
-
- if test x$enable_launchd = xyes && test x$have_launchd = xno ; then
- AC_MSG_ERROR([launchd support explicitly enabled but not available])
- fi
-fi
-
-dnl check if launchd is enabled
-if test x$have_launchd = xyes; then
- AC_DEFINE(DBUS_ENABLE_LAUNCHD,1,[Use launchd autolaunch])
-fi
-
-AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes)
-
-#### Directory to place launchd agent file
-if test "x$with_launchd_agent_dir" = "x"; then
- LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
-else
- LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
-fi
-
-AC_SUBST(LAUNCHD_AGENT_DIR)
-
-dnl console owner file
-if test x$enable_console_owner_file = xno ; then
- have_console_owner_file=no;
-else
- case $host_os in
- solaris*)
- have_console_owner_file=yes;
- AC_DEFINE(HAVE_CONSOLE_OWNER_FILE,1,[Have console owner file])
- ;;
- *)
- have_console_owner_file=no;;
- esac
-fi
-
-AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
-
-dnl systemd detection
-if test x$enable_systemd = xno ; then
- have_systemd=no;
-else
- PKG_CHECK_MODULES(SYSTEMD,
- [libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32],
- have_systemd=yes,
- have_systemd=no)
-fi
-
-if test x$have_systemd = xyes; then
- AC_DEFINE(HAVE_SYSTEMD,1,[Have systemd])
-fi
-
-if test x$enable_systemd = xyes -a x$have_systemd != xyes ; then
- AC_MSG_ERROR([Explicitly requested systemd support, but systemd not found])
-fi
-
-# libaudit detection
-if test x$enable_libaudit = xno ; then
- have_libaudit=no;
-else
- # See if we have audit daemon & capabilities library
- AC_CHECK_LIB(audit, audit_log_user_avc_message,
- have_libaudit=yes, have_libaudit=no)
- if test x$have_libaudit = xyes ; then
- AC_CHECK_LIB(cap-ng, capng_clear,
- have_libaudit=yes, have_libaudit=no)
- fi
-fi
-
-AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)
-
-if test x$have_libaudit = xyes ; then
- SELINUX_LIBS="$SELINUX_LIBS -laudit -lcap-ng"
- AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
-fi
-
-AC_SUBST([SELINUX_LIBS])
-
-# Check for ADT API (Solaris Basic Security Mode auditing)
-AC_MSG_CHECKING(for ADT API)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <bsm/adt.h>
-adt_user_context = ADT_USER;
-]], [[]])], [ check_adt_audit=yes ], [ check_adt_audit=no ])
-
-if test ${check_adt_audit} = yes
-then
- AC_DEFINE([HAVE_ADT], [], [Adt audit API])
- ADT_LIBS="-lbsm"
- LIBS="-lbsm $LIBS"
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST([ADT_LIBS])
-
-# Check for SCM_RIGHTS
-AC_MSG_CHECKING([for SCM_RIGHTS])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-static int x = SCM_RIGHTS;
-]], [[]])],
-[ AC_MSG_RESULT([supported])
- AC_DEFINE([HAVE_UNIX_FD_PASSING], [1], [Supports sending UNIX file descriptors]) ],
-[ AC_MSG_RESULT([not supported]) ])
-
-NETWORK_libs=
-if test x$dbus_win = xyes ; then
- if test x$dbus_wince = xyes ; then
- NETWORK_libs="-lws2"
- else
- NETWORK_libs="-lws2_32 -liphlpapi"
- fi
-fi
-
-AC_SUBST([NETWORK_libs])
-
-AC_ARG_WITH([valgrind],
- [AS_HELP_STRING([--with-valgrind],
- [Add instrumentation to help valgrind to understand our allocator])],
- [],
- [with_valgrind=no])
-
-AS_IF([test "x$with_valgrind" = xauto],
- [PKG_CHECK_EXISTS([valgrind >= 3.6],
- [with_valgrind=yes], [with_valgrind=no])])
-
-if test x$with_valgrind != xno; then
- PKG_CHECK_MODULES([VALGRIND], [valgrind >= 3.6])
- AC_DEFINE([WITH_VALGRIND], [1], [Define to add Valgrind instrumentation])
-fi
-
-# Determine maximum number of Unix fds which may be passed
-AS_CASE([$host_os],
- [*qnx*],
- [DEFAULT_MESSAGE_UNIX_FDS=256],
- [*],
- [DEFAULT_MESSAGE_UNIX_FDS=1024])
-AC_DEFINE_UNQUOTED([DBUS_DEFAULT_MESSAGE_UNIX_FDS],
- [$DEFAULT_MESSAGE_UNIX_FDS],
- [Default for dbus_connection_get_max_message_unix_fds()])
-AC_SUBST([DEFAULT_MESSAGE_UNIX_FDS])
-
-#### Set up final flags
-LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs"
-AC_SUBST([LIBDBUS_LIBS])
-
-### X11 detection
-DBUS_X_LIBS=
-DBUS_X_CFLAGS=
-
-AC_ARG_ENABLE([x11-autolaunch],
- AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
- [], [enable_x11_autolaunch=auto])
-
-if test "x$dbus_win" = xyes; then
- if test "x$enable_x11_autolaunch" = xyes; then
- AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
- fi
-
- enable_x11_autolaunch=no
- have_x11=no
-else
- AC_PATH_XTRA
-
- if test "x$no_x" = xyes; then
- have_x11=no
- else
- have_x11=yes
- DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
- DBUS_X_CFLAGS="$X_CFLAGS"
- fi
-fi
-
-if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
- AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
-else
- # move from "auto" to "yes" or "no" if necessary
- if test "x$enable_x11_autolaunch" != xno; then
- enable_x11_autolaunch="$have_x11"
- fi
-fi
-
-if test "x$have_x11" = xyes ; then
- AC_DEFINE([DBUS_BUILD_X11], [1], [Define to build X11 functionality])
-fi
-
-if test "x$enable_x11_autolaunch" = xyes ; then
- AC_DEFINE([DBUS_ENABLE_X11_AUTOLAUNCH], [1], [Define to enable X11 auto-launch])
-fi
-
-AC_SUBST([DBUS_X_CFLAGS])
-AC_SUBST([DBUS_X_LIBS])
-
-#### gcc warning flags
-
-cc_supports_flag() {
- AC_MSG_CHECKING(whether $CC supports "$*")
- save_CFLAGS="$CFLAGS"
- CFLAGS="$*"
- AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
- CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT([$rc])
- test "x$rc" = xyes
-}
-
-TP_COMPILER_WARNINGS([WARNING_CFLAGS],
- dnl Use -Werror by default if:
- dnl - we're not on Windows (too many warnings), and
- dnl - we're in developer mode (a D-Bus developer, not a distro or end-user)
- dnl Override with --enable-Werror or --disable-Werror
- [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes],
-
- dnl Enable these warnings if possible:
- [all \
- extra \
- char-subscripts \
- missing-declarations \
- missing-prototypes \
- nested-externs \
- pointer-arith \
- cast-align \
- no-address \
- float-equal \
- declaration-after-statement \
- ],
-
- dnl Disable these warnings if possible, make them non-fatal if possible,
- dnl and don't enable -Werror unless we succeeded.
- dnl
- dnl Intentional:
- dnl - $DISABLE_UNUSED_WARNINGS disables unused-label warnings if not
- dnl checking or not asserting
- dnl - missing field initializers being 0 is a C feature, not a bug
- dnl - unused-parameter is to make writing callbacks less annoying
- dnl
- dnl To be fixed one day:
- dnl - sign-compare and pointer-sign are workarounds for fd.o #17433
- dnl - type-limits is probably a bug too, but having the rest of -Wextra
- dnl is better than nothing
- [$DISABLE_UNUSED_WARNINGS \
- missing-field-initializers \
- unused-parameter \
- sign-compare \
- pointer-sign \
- type-limits \
- ])
-
-if test "x$GCC" = "xyes"; then
- # We're treating -fno-common like a warning: it makes the linker more
- # strict, because on some systems the linker is *always* this strict
- TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-common])
-
- # http://bugs.freedesktop.org/show_bug.cgi?id=10599
- TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-strict-aliasing])
-
- if test "x$enable_ansi" = "xyes"; then
- TP_ADD_COMPILER_FLAG([WARNING_CFLAGS],
- [-ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic])
- fi
-fi
-
-dnl In principle we should put WARNING_CFLAGS in each Makefile.am like
-dnl telepathy-glib does, since CFLAGS is meant to be reserved for the user...
-dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
-dnl is the next best thing
-CFLAGS="$WARNING_CFLAGS $CFLAGS"
-
-case $host_os in
- solaris*)
- # Solaris' C library apparently needs these runes to be threadsafe...
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
- # ... this opt-in to get sockaddr_in6 and sockaddr_storage...
- CFLAGS="$CFLAGS -D__EXTENSIONS__"
- # ... and this opt-in to get file descriptor passing support
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500"
- ;;
-esac
-
-### Doxygen Documentation
-
-AC_PATH_PROG(DOXYGEN, doxygen, no)
-
-AC_MSG_CHECKING([whether to build Doxygen documentation])
-
-if test x$DOXYGEN = xno ; then
- have_doxygen=no
-else
- have_doxygen=yes
-fi
-
-if test x$enable_doxygen_docs = xauto ; then
- if test x$have_doxygen = xno ; then
- enable_doxygen_docs=no
- else
- enable_doxygen_docs=yes
- fi
-fi
-
-if test x$enable_doxygen_docs = xyes; then
- if test x$have_doxygen = xno; then
- AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
- fi
-fi
-
-AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
-AC_MSG_RESULT($enable_doxygen_docs)
-
-AC_CHECK_PROGS([XSLTPROC], [xsltproc])
-AM_CONDITIONAL([DBUS_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
-
-### XML Documentation
-
-AC_PATH_PROG(XMLTO, xmlto, no)
-
-AC_MSG_CHECKING([whether to build XML documentation])
-
-if test x$XMLTO = xno ; then
- have_xmlto=no
-else
- have_xmlto=yes
-fi
-
-if test x$enable_xml_docs = xauto ; then
- if test x$have_xmlto = xno ; then
- enable_xml_docs=no
- else
- enable_xml_docs=yes
- fi
-fi
-
-if test x$enable_xml_docs = xyes; then
- if test x$have_xmlto = xno; then
- AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
- fi
-fi
-
-AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
-AC_MSG_RESULT($enable_xml_docs)
-
-AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
- [test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes])
-
-#### Have to go $localstatedir->$prefix/var->/usr/local/var
-
-#### find the actual value for $prefix that we'll end up with
-## (I know this is broken and should be done in the Makefile, but
-## that's a major pain and almost nobody actually seems to care)
-AS_AC_EXPAND(EXPANDED_PREFIX, "$prefix")
-AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
-AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
-AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
-AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
-AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
-AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
-
-#### Check our operating system
-operating_system=unknown
-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
- operating_system=redhat
-fi
-
-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
- operating_system=slackware
-fi
-
-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
- operating_system=cygwin
-fi
-
-#### Sort out init scripts
-
-if test x$with_init_scripts = x; then
- case x$operating_system in
- xredhat) with_init_scripts=redhat ;;
- xslackware) with_init_scripts=slackware ;;
- xcygwin) with_init_scripts=cygwin ;;
- *) with_init_scripts=none ;;
- esac
-fi
-
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_CYGWIN, test x$with_init_scripts = xcygwin)
-
-##### systemd unit files
-AC_ARG_WITH([systemdsystemunitdir],
-AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
- [],
- [
- PKG_CHECK_EXISTS([systemd],
- [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)],
- [with_systemdsystemunitdir=no])
- ])
-if test "x$with_systemdsystemunitdir" != xno; then
- AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
-fi
-AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
-
-##### Set up location for system bus socket
-if ! test -z "$with_system_socket"; then
- DBUS_SYSTEM_SOCKET=$with_system_socket
-else
- DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
-fi
-
-AC_SUBST(DBUS_SYSTEM_SOCKET)
-AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
-
-## System bus only listens on local domain sockets, and never
-## on an abstract socket (so only root can create the socket).
-##
-## This won't work on Windows. It's not meant to - the system bus is
-## meaningless on Windows anyway.
-##
-## This has to be suitable for hard-coding in client libraries as well as
-## in the dbus-daemon's configuration, so it has to be valid to listen on
-## and also to connect to. If this ever changes, it'll need to be split into
-## two variables, one for the listening address and one for the connecting
-## address.
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
-AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
-AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
-
-#### Set up the pid file
-if ! test -z "$with_system_pid_file"; then
- DBUS_SYSTEM_PID_FILE=$with_system_pid_file
-elif test x$with_init_scripts = xredhat ; then
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
-else
- DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
-fi
-
-AC_SUBST(DBUS_SYSTEM_PID_FILE)
-
-#### Directory to check for console ownership
-if ! test -z "$with_console_auth_dir"; then
- DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
-else
- DBUS_CONSOLE_AUTH_DIR=/var/run/console/
-fi
-
-AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
-AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
-
-#### File to check for console ownership
-if test x$have_console_owner_file = xyes; then
- if ! test -z "$with_console_owner_file"; then
- DBUS_CONSOLE_OWNER_FILE=$with_console_owner_file
- else
- DBUS_CONSOLE_OWNER_FILE=/dev/console
- fi
-else
- DBUS_CONSOLE_OWNER_FILE=
-fi
-
-AC_SUBST(DBUS_CONSOLE_OWNER_FILE)
-AC_DEFINE_UNQUOTED(DBUS_CONSOLE_OWNER_FILE, "$DBUS_CONSOLE_OWNER_FILE", [File to check for console ownerhip])
-
-#### User to start the system bus as
-if test -z "$with_dbus_user" ; then
- DBUS_USER=messagebus
-else
- DBUS_USER=$with_dbus_user
-fi
-AC_SUBST(DBUS_USER)
-AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
-
-#### Prefix to install into
-DBUS_PREFIX=$EXPANDED_PREFIX
-AC_SUBST(DBUS_PREFIX)
-AC_DEFINE_UNQUOTED(DBUS_PREFIX,"$DBUS_PREFIX", [Prefix for installing DBUS])
-
-#### Direcotry to install data files into
-DBUS_DATADIR=$EXPANDED_DATADIR
-AC_SUBST(DBUS_DATADIR)
-AC_DEFINE_UNQUOTED(DBUS_DATADIR,"$DBUS_DATADIR", [Directory for installing DBUS data files])
-
-#### Directory to install dbus-daemon
-if test -z "$with_dbus_daemondir" ; then
- DBUS_DAEMONDIR=$EXPANDED_BINDIR
-else
- DBUS_DAEMONDIR=$with_dbus_daemondir
-fi
-AC_SUBST(DBUS_DAEMONDIR)
-AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
-
-#### Directory to install the other binaries
-DBUS_BINDIR="$EXPANDED_BINDIR"
-AC_SUBST(DBUS_BINDIR)
-AC_DEFINE_UNQUOTED(DBUS_BINDIR,"$DBUS_BINDIR", [Directory for installing the binaries])
-
-#### Directory to install the libexec binaries
-DBUS_LIBEXECDIR="$EXPANDED_LIBEXECDIR"
-AC_SUBST(DBUS_LIBEXECDIR)
-AC_DEFINE_UNQUOTED(DBUS_LIBEXECDIR,"$DBUS_LIBEXECDIR", [Directory for installing the libexec binaries])
-
-#### Tell tests where to find certain stuff in builddir
-
-DBUS_PWD=`pwd`
-# Useful in a cross-compilation environment, where the tests are run on the host system.
-AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]),
- DBUS_PWD=$withval)
-
-DBUS_TEST_EXEC="$DBUS_PWD/test"
-DBUS_TEST_DATA="$DBUS_PWD/test/data"
-
-AC_SUBST([DBUS_TEST_DATA])
-AC_SUBST([DBUS_TEST_EXEC])
-
-AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"],
- [Full path to the daemon in the builddir])
-AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
- [Extension for executables, typically empty or .exe])
-
-AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"],
- [Full path to the dbus-launch in the builddir])
-
-## Export the non-setuid external helper
-TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
-AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
-AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
- [Full path to the launch helper test program in the builddir])
-
-#### Find socket directories
-if ! test -z "$TMPDIR" ; then
- DEFAULT_SOCKET_DIR=$TMPDIR
-elif ! test -z "$TEMP" ; then
- DEFAULT_SOCKET_DIR=$TEMP
-elif ! test -z "$TMP" ; then
- DEFAULT_SOCKET_DIR=$TMP
-else
- DEFAULT_SOCKET_DIR=/tmp
-fi
-
-DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
-
-if ! test -z "$with_test_socket_dir" ; then
- TEST_SOCKET_DIR="$with_test_socket_dir"
-else
- TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
-fi
-AC_SUBST(TEST_SOCKET_DIR)
-AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
-
-if test "x$dbus_unix" = xyes; then
- TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
-else
- TEST_LISTEN="tcp:host=localhost"
-fi
-AC_SUBST([TEST_LISTEN])
-AC_DEFINE_UNQUOTED([TEST_LISTEN], ["$TEST_LISTEN"],
- [Listening address for regression tests])
-
-if ! test -z "$with_session_socket_dir" ; then
- DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
-else
- DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
-fi
-AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
-AC_SUBST(DBUS_SESSION_SOCKET_DIR)
-
-# This must be a listening address. It doesn't necessarily need to be an
-# address you can connect to - it can be something vague like
-# "nonce-tcp:".
-#
-# The default varies by platform.
-AC_ARG_WITH([dbus_session_bus_listen_address],
- AS_HELP_STRING([--with-dbus-session-bus-listen-address=[ADDRESS]],
- [default address for a session bus to listen on (see configure.ac)]),
- [with_dbus_session_bus_listen_address=$withval],
- [with_dbus_session_bus_listen_address=])
-
-if test "x$with_dbus_session_bus_listen_address" != "x"; then
- # the user specified something, trust them
- DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address"
-elif test x$dbus_win = xyes; then
- # On Windows, you can (and should) listen on autolaunch addresses,
- # because autolaunching is different.
- # See https://bugs.freedesktop.org/show_bug.cgi?id=38201
- DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:"
-elif test x$have_launchd = xyes; then
- # Mac OS X default is to use launchd
- DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
-else
- # The default on all other Unix platforms (notably Linux)
- # is to create a randomly named socket in /tmp or similar
- DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
-fi
-AC_SUBST([DBUS_SESSION_BUS_LISTEN_ADDRESS])
-
-# This must be an address you can connect to. It doesn't necessarily
-# need to be an address you can listen on - it can be "autolaunch:",
-# even on Unix.
-#
-# The default varies by platform.
-AC_ARG_WITH([dbus_session_bus_connect_address],
- AS_HELP_STRING([--with-dbus-session-bus-connect-address=[ADDRESS]],
- [fallback address for a session bus client to connect to (see configure.ac)]),
- [with_dbus_session_bus_connect_address=$withval],
- [with_dbus_session_bus_connect_address=])
-
-if test "x$with_dbus_session_bus_connect_address" != "x"; then
- # the user specified something, trust them
- DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address"
-elif test x$dbus_win = xyes; then
- # Windows autolaunching is a bit different; leaving it in its own
- # branch of the conditional because the default might conceivably
- # change (see #38201)
- DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
-else
- # The default on all other Unix platforms (notably Linux)
- # is to use auto-launching - this works a bit differently on Mac OS X
- # but comes out basically the same in the end
- DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
-fi
-AC_SUBST([DBUS_SESSION_BUS_CONNECT_ADDRESS])
-AC_DEFINE_UNQUOTED([DBUS_SESSION_BUS_CONNECT_ADDRESS],
- ["$DBUS_SESSION_BUS_CONNECT_ADDRESS"],
- [Fallback address for session bus clients])
-
-# darwin needs this to initialize the environment
-AC_CHECK_HEADERS(crt_externs.h)
-AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
-AH_VERBATIM(_DARWIN_ENVIRON,
-[
-#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
-# include <sys/time.h>
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-#endif
-])
-
-AC_ARG_ENABLE([stats],
- [AS_HELP_STRING([--enable-stats],
- [enable bus daemon usage statistics])],
- [], [enable_stats=no])
-if test "x$enable_stats" = xyes; then
- AC_DEFINE([DBUS_ENABLE_STATS], [1],
- [Define to enable bus daemon usage statistics])
-fi
-
-AC_CONFIG_FILES([
-Doxyfile
-dbus/versioninfo.rc
-dbus/dbus-arch-deps.h
-bus/system.conf
-bus/session.conf
-bus/messagebus
-bus/messagebus-config
-bus/org.freedesktop.dbus-session.plist
-bus/rc.messagebus
-bus/dbus.service
-bus/dbus.socket
-Makefile
-dbus/Makefile
-bus/Makefile
-tools/Makefile
-test/Makefile
-test/name-test/Makefile
-doc/Makefile
-doc/dbus-cleanup-sockets.1.xml
-doc/dbus-daemon.1.xml
-doc/dbus-launch.1.xml
-doc/dbus-monitor.1.xml
-doc/dbus-run-session.1.xml
-doc/dbus-send.1.xml
-doc/dbus-uuidgen.1.xml
-dbus-1.pc
-dbus-1-uninstalled.pc
-test/data/valid-config-files/debug-allow-all.conf
-test/data/valid-config-files/debug-allow-all-sha1.conf
-test/data/valid-config-files/incoming-limit.conf
-test/data/valid-config-files-system/debug-allow-all-pass.conf
-test/data/valid-config-files-system/debug-allow-all-fail.conf
-test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
-test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
-test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
-test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
-])
-AC_OUTPUT
-
-dnl ==========================================================================
-echo "
- D-Bus $VERSION
- ==============
-
- prefix: ${EXPANDED_PREFIX}
- exec_prefix: ${exec_prefix}
- libdir: ${EXPANDED_LIBDIR}
- libexecdir: ${EXPANDED_LIBEXECDIR}
- bindir: ${EXPANDED_BINDIR}
- sysconfdir: ${EXPANDED_SYSCONFDIR}
- localstatedir: ${EXPANDED_LOCALSTATEDIR}
- datadir: ${EXPANDED_DATADIR}
- source code location: ${srcdir}
- compiler: ${CC}
- cflags: ${CFLAGS}
- cppflags: ${CPPFLAGS}
- cxxflags: ${CXXFLAGS}
- 64-bit int: ${DBUS_INT64_TYPE}
- 32-bit int: ${DBUS_INT32_TYPE}
- 16-bit int: ${DBUS_INT16_TYPE}
- Doxygen: ${DOXYGEN:-not found}
- xmlto: ${XMLTO:-not found}"
-
-echo "
- Rebuilding generated files: ${USE_MAINTAINER_MODE}
- gcc coverage profiling: ${enable_compiler_coverage}
- Building embedded tests: ${enable_embedded_tests}
- Building modular tests: ${enable_modular_tests}
- - with GLib: ${with_glib}
- - with dbus-glib: ${with_dbus_glib}
- Building verbose mode: ${enable_verbose_mode}
- Building assertions: ${enable_asserts}
- Building checks: ${enable_checks}
- Building bus stats API: ${enable_stats}
- Building SELinux support: ${have_selinux}
- Building inotify support: ${have_inotify}
- Building kqueue support: ${have_kqueue}
- Building systemd support: ${have_systemd}
- Building X11 code: ${have_x11}
- Building Doxygen docs: ${enable_doxygen_docs}
- Building XML docs: ${enable_xml_docs}
- Building launchd support: ${have_launchd}
- Init scripts style: ${with_init_scripts}
- Abstract socket names: ${ac_cv_have_abstract_sockets}
- System bus socket: ${DBUS_SYSTEM_SOCKET}
- System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
- System bus PID file: ${DBUS_SYSTEM_PID_FILE}
- Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
- Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
- Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
- Console owner file: ${have_console_owner_file}
- Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
- System bus user: ${DBUS_USER}
- Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
- 'make check' socket dir: ${TEST_SOCKET_DIR}
-"
-if test x$have_launchd = xyes; then
- echo " launchd agent dir: ${LAUNCHD_AGENT_DIR}"
-fi
-echo
-
-if test x$enable_embedded_tests = xyes; then
- echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
-fi
-if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
- echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
-fi
-if test x$enable_compiler_coverage = xyes; then
- echo "NOTE: building with coverage profiling is definitely for developers only."
-fi
-if test x$enable_verbose_mode = xyes; then
- echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
-fi
-if test x$enable_asserts = xyes; then
- echo "NOTE: building with assertions increases library size and decreases performance."
-fi
-if test x$enable_checks = xno; then
- echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-Bus, but will slightly decrease D-Bus library size and _very_ slightly improve performance."
-fi
diff --git a/src/3rd_party/dbus-1.7.8/dbus-1-uninstalled.pc.in b/src/3rd_party/dbus-1.7.8/dbus-1-uninstalled.pc.in
deleted file mode 100644
index 038c83e20a..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus-1-uninstalled.pc.in
+++ /dev/null
@@ -1,17 +0,0 @@
-abs_top_builddir=@abs_top_builddir@
-abs_top_srcdir=@abs_top_srcdir@
-prefix=
-exec_prefix=
-system_bus_default_address=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-sysconfdir=@EXPANDED_SYSCONFDIR@
-session_bus_services_dir=@EXPANDED_DATADIR@/dbus-1/services
-system_bus_services_dir=@EXPANDED_DATADIR@/dbus-1/system-services
-interfaces_dir=@EXPANDED_DATADIR@/dbus-1/interfaces
-daemondir=@DBUS_DAEMONDIR@
-
-Name: dbus
-Description: Free desktop message bus (uninstalled copy)
-Version: @VERSION@
-Libs: ${abs_top_builddir}/dbus/libdbus-1.la
-Libs.private: @LIBDBUS_LIBS@
-Cflags: -I${abs_top_srcdir} @DBUS_STATIC_BUILD_CPPFLAGS@
diff --git a/src/3rd_party/dbus-1.7.8/dbus-1.pc.in b/src/3rd_party/dbus-1.7.8/dbus-1.pc.in
deleted file mode 100644
index 25f8bcee48..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus-1.pc.in
+++ /dev/null
@@ -1,17 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-system_bus_default_address=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-sysconfdir=@EXPANDED_SYSCONFDIR@
-session_bus_services_dir=@EXPANDED_DATADIR@/dbus-1/services
-system_bus_services_dir=@EXPANDED_DATADIR@/dbus-1/system-services
-interfaces_dir=@EXPANDED_DATADIR@/dbus-1/interfaces
-daemondir=@DBUS_DAEMONDIR@
-
-Name: dbus
-Description: Free desktop message bus
-Version: @VERSION@
-Libs: -L${libdir} -ldbus-1
-Libs.private: @LIBDBUS_LIBS@
-Cflags: -I${includedir}/dbus-1.0 -I${libdir}/dbus-1.0/include @DBUS_STATIC_BUILD_CPPFLAGS@
diff --git a/src/3rd_party/dbus-1.7.8/dbus/Makefile.am b/src/3rd_party/dbus-1.7.8/dbus/Makefile.am
deleted file mode 100644
index 0f9033d1ed..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/Makefile.am
+++ /dev/null
@@ -1,329 +0,0 @@
-
-configdir=$(sysconfdir)/dbus-1
-
-AM_CPPFLAGS = \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- $(SYSTEMD_CFLAGS) \
- $(VALGRIND_CFLAGS) \
- -DDBUS_COMPILATION \
- -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
- -DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
- $(NULL)
-
-# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
-# results in an otherwise unnecessary dependency on librt. Disable it.
-AM_CPPFLAGS += -DSD_DAEMON_DISABLE_MQ
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-dbusincludedir=$(includedir)/dbus-1.0/dbus
-dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
-
-lib_LTLIBRARIES=libdbus-1.la
-
-#
-# Deal with W32 .def and version-info.rc stuff
-#
-if DBUS_WIN
-
-SUFFIXES = rc
-
-.rc.o:
- $(WINDRES) $< -o $@
-
-dbus_res = versioninfo.o
-dbus_res_ldflag = -Wl,$(dbus_res)
-no_undefined = -no-undefined
-export_symbols =
-
-EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
-intllibs =
-
-else
-dbus_res =
-dbus_res_ldflag =
-no_undefined =
-## don't export symbols that start with "_" (we use this
-## convention for internal symbols)
-export_symbols = -export-symbols-regex "^[^_].*"
-
-intllibs = @LTLIBINTL@
-
-endif
-
-
-#
-# Platform-dependent sources:
-#
-if DBUS_WIN
-DBUS_LIB_arch_sources = \
- dbus-server-win.c \
- dbus-server-win.h
-
-if DBUS_WINCE
-wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
-else
-wince_source =
-endif
-
-DBUS_SHARED_arch_sources = \
- $(wince_source) \
- dbus-file-win.c \
- dbus-pipe-win.c \
- dbus-sockets-win.h \
- dbus-sysdeps-win.c \
- dbus-sysdeps-win.h \
- dbus-sysdeps-thread-win.c \
- dbus-transport-win.c \
- dbus-transport-win.h
-
-DBUS_UTIL_arch_sources = \
- dbus-sysdeps-util-win.c \
- dbus-spawn-win.c
-else
-
-if DBUS_ENABLE_LAUNCHD
-launchd_source = dbus-server-launchd.h dbus-server-launchd.c
-else
-launchd_source =
-endif
-
-DBUS_LIB_arch_sources = \
- dbus-uuidgen.c \
- dbus-uuidgen.h \
- dbus-server-unix.c \
- dbus-server-unix.h
-
-DBUS_SHARED_arch_sources = \
- $(launchd_source) \
- dbus-file-unix.c \
- dbus-pipe-unix.c \
- dbus-sysdeps-unix.c \
- dbus-sysdeps-unix.h \
- dbus-sysdeps-pthread.c \
- dbus-transport-unix.c \
- dbus-transport-unix.h \
- dbus-userdb.c \
- dbus-userdb.h \
- sd-daemon.c \
- sd-daemon.h
-
-DBUS_UTIL_arch_sources = \
- dbus-sysdeps-util-unix.c \
- dbus-userdb-util.c \
- dbus-spawn.c
-endif
-
-if HAVE_LINUX_EPOLL
-DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
-endif
-
-dbusinclude_HEADERS= \
- dbus.h \
- dbus-address.h \
- dbus-bus.h \
- dbus-connection.h \
- dbus-errors.h \
- dbus-macros.h \
- dbus-memory.h \
- dbus-message.h \
- dbus-misc.h \
- dbus-pending-call.h \
- dbus-protocol.h \
- dbus-server.h \
- dbus-shared.h \
- dbus-signature.h \
- dbus-syntax.h \
- dbus-threads.h \
- dbus-types.h
-
-
-nodist_dbusarchinclude_HEADERS= \
- dbus-arch-deps.h
-
-### source code that goes in the installed client library
-### and is specific to library functionality
-DBUS_LIB_SOURCES= \
- dbus-address.c \
- dbus-auth.c \
- dbus-auth.h \
- dbus-bus.c \
- dbus-connection.c \
- dbus-connection-internal.h \
- dbus-credentials.c \
- dbus-credentials.h \
- dbus-errors.c \
- dbus-keyring.c \
- dbus-keyring.h \
- dbus-marshal-header.c \
- dbus-marshal-header.h \
- dbus-marshal-byteswap.c \
- dbus-marshal-byteswap.h \
- dbus-marshal-recursive.c \
- dbus-marshal-recursive.h \
- dbus-marshal-validate.c \
- dbus-marshal-validate.h \
- dbus-message.c \
- dbus-message-internal.h \
- dbus-message-private.h \
- dbus-misc.c \
- dbus-nonce.h \
- dbus-nonce.c \
- dbus-object-tree.c \
- dbus-object-tree.h \
- dbus-pending-call.c \
- dbus-pending-call-internal.h \
- dbus-resources.c \
- dbus-resources.h \
- dbus-server.c \
- dbus-server-debug-pipe.c \
- dbus-server-debug-pipe.h \
- dbus-server-protected.h \
- dbus-server-socket.c \
- dbus-server-socket.h \
- $(DBUS_LIB_arch_sources) \
- dbus-sha.c \
- dbus-sha.h \
- dbus-signature.c \
- dbus-syntax.c \
- dbus-timeout.c \
- dbus-timeout.h \
- dbus-threads-internal.h \
- dbus-threads.c \
- dbus-transport.c \
- dbus-transport.h \
- dbus-transport-protected.h \
- dbus-transport-socket.c \
- dbus-transport-socket.h \
- dbus-watch.c \
- dbus-watch.h
-
-### source code that goes in the installed client library
-### AND is generic utility functionality used by the
-### daemon or test programs (all symbols in here should
-### be underscore-prefixed)
-DBUS_SHARED_SOURCES= \
- dbus-dataslot.c \
- dbus-dataslot.h \
- dbus-file.c \
- dbus-file.h \
- dbus-hash.c \
- dbus-hash.h \
- dbus-internals.c \
- dbus-internals.h \
- dbus-list.c \
- dbus-list.h \
- dbus-marshal-basic.c \
- dbus-marshal-basic.h \
- dbus-memory.c \
- dbus-mempool.c \
- dbus-mempool.h \
- dbus-pipe.c \
- dbus-pipe.h \
- dbus-string.c \
- dbus-string.h \
- dbus-string-private.h \
- $(DBUS_SHARED_arch_sources) \
- dbus-sysdeps.c \
- dbus-sysdeps.h \
- dbus-valgrind-internal.h
-
-### source code that is generic utility functionality used
-### by the bus daemon or test apps, but is NOT included
-### in the D-Bus client library (all symbols in here
-### should be underscore-prefixed but don't really need
-### to be unless they move to DBUS_SHARED_SOURCES later)
-DBUS_UTIL_SOURCES= \
- dbus-asv-util.c \
- dbus-asv-util.h \
- dbus-auth-script.c \
- dbus-auth-script.h \
- dbus-auth-util.c \
- dbus-credentials-util.c \
- dbus-mainloop.c \
- dbus-mainloop.h \
- dbus-marshal-byteswap-util.c \
- dbus-marshal-recursive-util.c \
- dbus-marshal-validate-util.c \
- dbus-message-factory.c \
- dbus-message-factory.h \
- dbus-message-util.c \
- dbus-shell.c \
- dbus-shell.h \
- $(DBUS_UTIL_arch_sources) \
- dbus-socket-set.h \
- dbus-socket-set.c \
- dbus-socket-set-poll.c \
- dbus-spawn.h \
- dbus-string-util.c \
- dbus-sysdeps-util.c \
- dbus-test.c \
- dbus-test.h
-
-libdbus_1_la_SOURCES= \
- $(DBUS_LIB_SOURCES) \
- $(DBUS_SHARED_SOURCES)
-
-libdbus_internal_la_SOURCES= \
- $(DBUS_LIB_SOURCES) \
- $(DBUS_SHARED_SOURCES) \
- $(DBUS_UTIL_SOURCES)
-
-BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
-EXTRA_DIST=dbus-arch-deps.h.in
-
-## this library is the same as libdbus, but exports all the symbols
-## and is only used for static linking within the dbus package.
-noinst_LTLIBRARIES=libdbus-internal.la
-
-libdbus_1_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -Ddbus_1_EXPORTS \
- $(NULL)
-libdbus_1_la_LIBADD= $(LIBDBUS_LIBS)
-libdbus_1_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- $(export_symbols) \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
- -no-undefined \
- $(NULL)
-
-libdbus_internal_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DDBUS_STATIC_BUILD \
- $(NULL)
-libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
-
-if DBUS_WIN
-# This must be a separate convenience library, otherwise libtool notices
-# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
-# even on Unix where in fact it doesn't contain any C++. For Windows, where
-# this code is used, we don't actually need libstdc++.
-noinst_LTLIBRARIES += libdbus-init-win.la
-libdbus_init_win_la_SOURCES = dbus-init-win.cpp
-libdbus_1_la_LIBADD += libdbus-init-win.la
-libdbus_internal_la_LIBADD += libdbus-init-win.la
-endif
-
-noinst_PROGRAMS =
-
-if DBUS_ENABLE_EMBEDDED_TESTS
-# We can't actually run this til we've reached test/
-noinst_PROGRAMS += dbus-test
-endif
-
-dbus_test_SOURCES= \
- dbus-test-main.c
-
-dbus_test_LDADD = libdbus-internal.la
-
-## mop up the gcov files
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
-
-update-systemd:
- curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
- curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h
diff --git a/src/3rd_party/dbus-1.7.8/dbus/Makefile.in b/src/3rd_party/dbus-1.7.8/dbus/Makefile.in
deleted file mode 100644
index 43bc1ef4d8..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/Makefile.in
+++ /dev/null
@@ -1,2374 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-@HAVE_LINUX_EPOLL_TRUE@am__append_1 = dbus-socket-set-epoll.c
-
-# This must be a separate convenience library, otherwise libtool notices
-# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
-# even on Unix where in fact it doesn't contain any C++. For Windows, where
-# this code is used, we don't actually need libstdc++.
-@DBUS_WIN_TRUE@am__append_2 = libdbus-init-win.la
-@DBUS_WIN_TRUE@am__append_3 = libdbus-init-win.la
-@DBUS_WIN_TRUE@am__append_4 = libdbus-init-win.la
-noinst_PROGRAMS = $(am__EXEEXT_1)
-
-# We can't actually run this til we've reached test/
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__append_5 = dbus-test
-subdir = dbus
-DIST_COMMON = $(dbusinclude_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/dbus-arch-deps.h.in \
- $(srcdir)/versioninfo.rc.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = versioninfo.rc dbus-arch-deps.h
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusincludedir)" \
- "$(DESTDIR)$(dbusarchincludedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
-am__DEPENDENCIES_1 =
-libdbus_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_3)
-am__libdbus_1_la_SOURCES_DIST = dbus-address.c dbus-auth.c dbus-auth.h \
- dbus-bus.c dbus-connection.c dbus-connection-internal.h \
- dbus-credentials.c dbus-credentials.h dbus-errors.c \
- dbus-keyring.c dbus-keyring.h dbus-marshal-header.c \
- dbus-marshal-header.h dbus-marshal-byteswap.c \
- dbus-marshal-byteswap.h dbus-marshal-recursive.c \
- dbus-marshal-recursive.h dbus-marshal-validate.c \
- dbus-marshal-validate.h dbus-message.c dbus-message-internal.h \
- dbus-message-private.h dbus-misc.c dbus-nonce.h dbus-nonce.c \
- dbus-object-tree.c dbus-object-tree.h dbus-pending-call.c \
- dbus-pending-call-internal.h dbus-resources.c dbus-resources.h \
- dbus-server.c dbus-server-debug-pipe.c \
- dbus-server-debug-pipe.h dbus-server-protected.h \
- dbus-server-socket.c dbus-server-socket.h dbus-uuidgen.c \
- dbus-uuidgen.h dbus-server-unix.c dbus-server-unix.h \
- dbus-server-win.c dbus-server-win.h dbus-sha.c dbus-sha.h \
- dbus-signature.c dbus-syntax.c dbus-timeout.c dbus-timeout.h \
- dbus-threads-internal.h dbus-threads.c dbus-transport.c \
- dbus-transport.h dbus-transport-protected.h \
- dbus-transport-socket.c dbus-transport-socket.h dbus-watch.c \
- dbus-watch.h dbus-dataslot.c dbus-dataslot.h dbus-file.c \
- dbus-file.h dbus-hash.c dbus-hash.h dbus-internals.c \
- dbus-internals.h dbus-list.c dbus-list.h dbus-marshal-basic.c \
- dbus-marshal-basic.h dbus-memory.c dbus-mempool.c \
- dbus-mempool.h dbus-pipe.c dbus-pipe.h dbus-string.c \
- dbus-string.h dbus-string-private.h dbus-server-launchd.h \
- dbus-server-launchd.c dbus-file-unix.c dbus-pipe-unix.c \
- dbus-sysdeps-unix.c dbus-sysdeps-unix.h dbus-sysdeps-pthread.c \
- dbus-transport-unix.c dbus-transport-unix.h dbus-userdb.c \
- dbus-userdb.h sd-daemon.c sd-daemon.h \
- dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c \
- dbus-file-win.c dbus-pipe-win.c dbus-sockets-win.h \
- dbus-sysdeps-win.c dbus-sysdeps-win.h \
- dbus-sysdeps-thread-win.c dbus-transport-win.c \
- dbus-transport-win.h dbus-sysdeps.c dbus-sysdeps.h \
- dbus-valgrind-internal.h
-@DBUS_WIN_FALSE@am__objects_1 = libdbus_1_la-dbus-uuidgen.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-server-unix.lo
-@DBUS_WIN_TRUE@am__objects_1 = libdbus_1_la-dbus-server-win.lo
-am__objects_2 = libdbus_1_la-dbus-address.lo libdbus_1_la-dbus-auth.lo \
- libdbus_1_la-dbus-bus.lo libdbus_1_la-dbus-connection.lo \
- libdbus_1_la-dbus-credentials.lo libdbus_1_la-dbus-errors.lo \
- libdbus_1_la-dbus-keyring.lo \
- libdbus_1_la-dbus-marshal-header.lo \
- libdbus_1_la-dbus-marshal-byteswap.lo \
- libdbus_1_la-dbus-marshal-recursive.lo \
- libdbus_1_la-dbus-marshal-validate.lo \
- libdbus_1_la-dbus-message.lo libdbus_1_la-dbus-misc.lo \
- libdbus_1_la-dbus-nonce.lo libdbus_1_la-dbus-object-tree.lo \
- libdbus_1_la-dbus-pending-call.lo \
- libdbus_1_la-dbus-resources.lo libdbus_1_la-dbus-server.lo \
- libdbus_1_la-dbus-server-debug-pipe.lo \
- libdbus_1_la-dbus-server-socket.lo $(am__objects_1) \
- libdbus_1_la-dbus-sha.lo libdbus_1_la-dbus-signature.lo \
- libdbus_1_la-dbus-syntax.lo libdbus_1_la-dbus-timeout.lo \
- libdbus_1_la-dbus-threads.lo libdbus_1_la-dbus-transport.lo \
- libdbus_1_la-dbus-transport-socket.lo \
- libdbus_1_la-dbus-watch.lo
-@DBUS_ENABLE_LAUNCHD_TRUE@@DBUS_WIN_FALSE@am__objects_3 = libdbus_1_la-dbus-server-launchd.lo
-@DBUS_WINCE_TRUE@@DBUS_WIN_TRUE@am__objects_4 = libdbus_1_la-dbus-sysdeps-wince-glue.lo
-@DBUS_WIN_FALSE@am__objects_5 = $(am__objects_3) \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-file-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-pipe-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-sysdeps-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-sysdeps-pthread.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-transport-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-dbus-userdb.lo \
-@DBUS_WIN_FALSE@ libdbus_1_la-sd-daemon.lo
-@DBUS_WIN_TRUE@am__objects_5 = $(am__objects_4) \
-@DBUS_WIN_TRUE@ libdbus_1_la-dbus-file-win.lo \
-@DBUS_WIN_TRUE@ libdbus_1_la-dbus-pipe-win.lo \
-@DBUS_WIN_TRUE@ libdbus_1_la-dbus-sysdeps-win.lo \
-@DBUS_WIN_TRUE@ libdbus_1_la-dbus-sysdeps-thread-win.lo \
-@DBUS_WIN_TRUE@ libdbus_1_la-dbus-transport-win.lo
-am__objects_6 = libdbus_1_la-dbus-dataslot.lo \
- libdbus_1_la-dbus-file.lo libdbus_1_la-dbus-hash.lo \
- libdbus_1_la-dbus-internals.lo libdbus_1_la-dbus-list.lo \
- libdbus_1_la-dbus-marshal-basic.lo libdbus_1_la-dbus-memory.lo \
- libdbus_1_la-dbus-mempool.lo libdbus_1_la-dbus-pipe.lo \
- libdbus_1_la-dbus-string.lo $(am__objects_5) \
- libdbus_1_la-dbus-sysdeps.lo
-am_libdbus_1_la_OBJECTS = $(am__objects_2) $(am__objects_6)
-libdbus_1_la_OBJECTS = $(am_libdbus_1_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-libdbus_1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(libdbus_1_la_LDFLAGS) $(LDFLAGS) -o $@
-libdbus_init_win_la_LIBADD =
-am__libdbus_init_win_la_SOURCES_DIST = dbus-init-win.cpp
-@DBUS_WIN_TRUE@am_libdbus_init_win_la_OBJECTS = dbus-init-win.lo
-libdbus_init_win_la_OBJECTS = $(am_libdbus_init_win_la_OBJECTS)
-@DBUS_WIN_TRUE@am_libdbus_init_win_la_rpath =
-libdbus_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__append_4)
-am__libdbus_internal_la_SOURCES_DIST = dbus-address.c dbus-auth.c \
- dbus-auth.h dbus-bus.c dbus-connection.c \
- dbus-connection-internal.h dbus-credentials.c \
- dbus-credentials.h dbus-errors.c dbus-keyring.c dbus-keyring.h \
- dbus-marshal-header.c dbus-marshal-header.h \
- dbus-marshal-byteswap.c dbus-marshal-byteswap.h \
- dbus-marshal-recursive.c dbus-marshal-recursive.h \
- dbus-marshal-validate.c dbus-marshal-validate.h dbus-message.c \
- dbus-message-internal.h dbus-message-private.h dbus-misc.c \
- dbus-nonce.h dbus-nonce.c dbus-object-tree.c \
- dbus-object-tree.h dbus-pending-call.c \
- dbus-pending-call-internal.h dbus-resources.c dbus-resources.h \
- dbus-server.c dbus-server-debug-pipe.c \
- dbus-server-debug-pipe.h dbus-server-protected.h \
- dbus-server-socket.c dbus-server-socket.h dbus-uuidgen.c \
- dbus-uuidgen.h dbus-server-unix.c dbus-server-unix.h \
- dbus-server-win.c dbus-server-win.h dbus-sha.c dbus-sha.h \
- dbus-signature.c dbus-syntax.c dbus-timeout.c dbus-timeout.h \
- dbus-threads-internal.h dbus-threads.c dbus-transport.c \
- dbus-transport.h dbus-transport-protected.h \
- dbus-transport-socket.c dbus-transport-socket.h dbus-watch.c \
- dbus-watch.h dbus-dataslot.c dbus-dataslot.h dbus-file.c \
- dbus-file.h dbus-hash.c dbus-hash.h dbus-internals.c \
- dbus-internals.h dbus-list.c dbus-list.h dbus-marshal-basic.c \
- dbus-marshal-basic.h dbus-memory.c dbus-mempool.c \
- dbus-mempool.h dbus-pipe.c dbus-pipe.h dbus-string.c \
- dbus-string.h dbus-string-private.h dbus-server-launchd.h \
- dbus-server-launchd.c dbus-file-unix.c dbus-pipe-unix.c \
- dbus-sysdeps-unix.c dbus-sysdeps-unix.h dbus-sysdeps-pthread.c \
- dbus-transport-unix.c dbus-transport-unix.h dbus-userdb.c \
- dbus-userdb.h sd-daemon.c sd-daemon.h \
- dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c \
- dbus-file-win.c dbus-pipe-win.c dbus-sockets-win.h \
- dbus-sysdeps-win.c dbus-sysdeps-win.h \
- dbus-sysdeps-thread-win.c dbus-transport-win.c \
- dbus-transport-win.h dbus-sysdeps.c dbus-sysdeps.h \
- dbus-valgrind-internal.h dbus-asv-util.c dbus-asv-util.h \
- dbus-auth-script.c dbus-auth-script.h dbus-auth-util.c \
- dbus-credentials-util.c dbus-mainloop.c dbus-mainloop.h \
- dbus-marshal-byteswap-util.c dbus-marshal-recursive-util.c \
- dbus-marshal-validate-util.c dbus-message-factory.c \
- dbus-message-factory.h dbus-message-util.c dbus-shell.c \
- dbus-shell.h dbus-sysdeps-util-unix.c dbus-userdb-util.c \
- dbus-spawn.c dbus-socket-set-epoll.c dbus-sysdeps-util-win.c \
- dbus-spawn-win.c dbus-socket-set.h dbus-socket-set.c \
- dbus-socket-set-poll.c dbus-spawn.h dbus-string-util.c \
- dbus-sysdeps-util.c dbus-test.c dbus-test.h
-@DBUS_WIN_FALSE@am__objects_7 = libdbus_internal_la-dbus-uuidgen.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-server-unix.lo
-@DBUS_WIN_TRUE@am__objects_7 = libdbus_internal_la-dbus-server-win.lo
-am__objects_8 = libdbus_internal_la-dbus-address.lo \
- libdbus_internal_la-dbus-auth.lo \
- libdbus_internal_la-dbus-bus.lo \
- libdbus_internal_la-dbus-connection.lo \
- libdbus_internal_la-dbus-credentials.lo \
- libdbus_internal_la-dbus-errors.lo \
- libdbus_internal_la-dbus-keyring.lo \
- libdbus_internal_la-dbus-marshal-header.lo \
- libdbus_internal_la-dbus-marshal-byteswap.lo \
- libdbus_internal_la-dbus-marshal-recursive.lo \
- libdbus_internal_la-dbus-marshal-validate.lo \
- libdbus_internal_la-dbus-message.lo \
- libdbus_internal_la-dbus-misc.lo \
- libdbus_internal_la-dbus-nonce.lo \
- libdbus_internal_la-dbus-object-tree.lo \
- libdbus_internal_la-dbus-pending-call.lo \
- libdbus_internal_la-dbus-resources.lo \
- libdbus_internal_la-dbus-server.lo \
- libdbus_internal_la-dbus-server-debug-pipe.lo \
- libdbus_internal_la-dbus-server-socket.lo $(am__objects_7) \
- libdbus_internal_la-dbus-sha.lo \
- libdbus_internal_la-dbus-signature.lo \
- libdbus_internal_la-dbus-syntax.lo \
- libdbus_internal_la-dbus-timeout.lo \
- libdbus_internal_la-dbus-threads.lo \
- libdbus_internal_la-dbus-transport.lo \
- libdbus_internal_la-dbus-transport-socket.lo \
- libdbus_internal_la-dbus-watch.lo
-@DBUS_ENABLE_LAUNCHD_TRUE@@DBUS_WIN_FALSE@am__objects_9 = libdbus_internal_la-dbus-server-launchd.lo
-@DBUS_WINCE_TRUE@@DBUS_WIN_TRUE@am__objects_10 = libdbus_internal_la-dbus-sysdeps-wince-glue.lo
-@DBUS_WIN_FALSE@am__objects_11 = $(am__objects_9) \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-file-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-pipe-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-sysdeps-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-sysdeps-pthread.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-transport-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-userdb.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-sd-daemon.lo
-@DBUS_WIN_TRUE@am__objects_11 = $(am__objects_10) \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-file-win.lo \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-pipe-win.lo \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-sysdeps-win.lo \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-sysdeps-thread-win.lo \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-transport-win.lo
-am__objects_12 = libdbus_internal_la-dbus-dataslot.lo \
- libdbus_internal_la-dbus-file.lo \
- libdbus_internal_la-dbus-hash.lo \
- libdbus_internal_la-dbus-internals.lo \
- libdbus_internal_la-dbus-list.lo \
- libdbus_internal_la-dbus-marshal-basic.lo \
- libdbus_internal_la-dbus-memory.lo \
- libdbus_internal_la-dbus-mempool.lo \
- libdbus_internal_la-dbus-pipe.lo \
- libdbus_internal_la-dbus-string.lo $(am__objects_11) \
- libdbus_internal_la-dbus-sysdeps.lo
-@HAVE_LINUX_EPOLL_TRUE@am__objects_13 = libdbus_internal_la-dbus-socket-set-epoll.lo
-@DBUS_WIN_FALSE@am__objects_14 = \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-sysdeps-util-unix.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-userdb-util.lo \
-@DBUS_WIN_FALSE@ libdbus_internal_la-dbus-spawn.lo \
-@DBUS_WIN_FALSE@ $(am__objects_13)
-@DBUS_WIN_TRUE@am__objects_14 = \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-sysdeps-util-win.lo \
-@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-spawn-win.lo \
-@DBUS_WIN_TRUE@ $(am__objects_13)
-am__objects_15 = libdbus_internal_la-dbus-asv-util.lo \
- libdbus_internal_la-dbus-auth-script.lo \
- libdbus_internal_la-dbus-auth-util.lo \
- libdbus_internal_la-dbus-credentials-util.lo \
- libdbus_internal_la-dbus-mainloop.lo \
- libdbus_internal_la-dbus-marshal-byteswap-util.lo \
- libdbus_internal_la-dbus-marshal-recursive-util.lo \
- libdbus_internal_la-dbus-marshal-validate-util.lo \
- libdbus_internal_la-dbus-message-factory.lo \
- libdbus_internal_la-dbus-message-util.lo \
- libdbus_internal_la-dbus-shell.lo $(am__objects_14) \
- libdbus_internal_la-dbus-socket-set.lo \
- libdbus_internal_la-dbus-socket-set-poll.lo \
- libdbus_internal_la-dbus-string-util.lo \
- libdbus_internal_la-dbus-sysdeps-util.lo \
- libdbus_internal_la-dbus-test.lo
-am_libdbus_internal_la_OBJECTS = $(am__objects_8) $(am__objects_12) \
- $(am__objects_15)
-libdbus_internal_la_OBJECTS = $(am_libdbus_internal_la_OBJECTS)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = dbus-test$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-am_dbus_test_OBJECTS = dbus-test-main.$(OBJEXT)
-dbus_test_OBJECTS = $(am_dbus_test_OBJECTS)
-dbus_test_DEPENDENCIES = libdbus-internal.la
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_init_win_la_SOURCES) \
- $(libdbus_internal_la_SOURCES) $(dbus_test_SOURCES)
-DIST_SOURCES = $(am__libdbus_1_la_SOURCES_DIST) \
- $(am__libdbus_init_win_la_SOURCES_DIST) \
- $(am__libdbus_internal_la_SOURCES_DIST) $(dbus_test_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-HEADERS = $(dbusinclude_HEADERS) $(nodist_dbusarchinclude_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-configdir = $(sysconfdir)/dbus-1
-
-# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
-# results in an otherwise unnecessary dependency on librt. Disable it.
-AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(SYSTEMD_CFLAGS) \
- $(VALGRIND_CFLAGS) -DDBUS_COMPILATION \
- -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
- -DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
- $(NULL) -DSD_DAEMON_DISABLE_MQ
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-dbusincludedir = $(includedir)/dbus-1.0/dbus
-dbusarchincludedir = $(libdir)/dbus-1.0/include/dbus
-lib_LTLIBRARIES = libdbus-1.la
-
-#
-# Deal with W32 .def and version-info.rc stuff
-#
-@DBUS_WIN_TRUE@SUFFIXES = rc
-@DBUS_WIN_FALSE@dbus_res =
-@DBUS_WIN_TRUE@dbus_res = versioninfo.o
-@DBUS_WIN_FALSE@dbus_res_ldflag =
-@DBUS_WIN_TRUE@dbus_res_ldflag = -Wl,$(dbus_res)
-@DBUS_WIN_FALSE@no_undefined =
-@DBUS_WIN_TRUE@no_undefined = -no-undefined
-@DBUS_WIN_FALSE@export_symbols = -export-symbols-regex "^[^_].*"
-@DBUS_WIN_TRUE@export_symbols =
-@DBUS_WIN_TRUE@EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
-@DBUS_WIN_FALSE@intllibs = @LTLIBINTL@
-@DBUS_WIN_TRUE@intllibs =
-@DBUS_WIN_FALSE@DBUS_LIB_arch_sources = \
-@DBUS_WIN_FALSE@ dbus-uuidgen.c \
-@DBUS_WIN_FALSE@ dbus-uuidgen.h \
-@DBUS_WIN_FALSE@ dbus-server-unix.c \
-@DBUS_WIN_FALSE@ dbus-server-unix.h
-
-
-#
-# Platform-dependent sources:
-#
-@DBUS_WIN_TRUE@DBUS_LIB_arch_sources = \
-@DBUS_WIN_TRUE@ dbus-server-win.c \
-@DBUS_WIN_TRUE@ dbus-server-win.h
-
-@DBUS_WINCE_FALSE@@DBUS_WIN_TRUE@wince_source =
-@DBUS_WINCE_TRUE@@DBUS_WIN_TRUE@wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
-@DBUS_WIN_FALSE@DBUS_SHARED_arch_sources = \
-@DBUS_WIN_FALSE@ $(launchd_source) \
-@DBUS_WIN_FALSE@ dbus-file-unix.c \
-@DBUS_WIN_FALSE@ dbus-pipe-unix.c \
-@DBUS_WIN_FALSE@ dbus-sysdeps-unix.c \
-@DBUS_WIN_FALSE@ dbus-sysdeps-unix.h \
-@DBUS_WIN_FALSE@ dbus-sysdeps-pthread.c \
-@DBUS_WIN_FALSE@ dbus-transport-unix.c \
-@DBUS_WIN_FALSE@ dbus-transport-unix.h \
-@DBUS_WIN_FALSE@ dbus-userdb.c \
-@DBUS_WIN_FALSE@ dbus-userdb.h \
-@DBUS_WIN_FALSE@ sd-daemon.c \
-@DBUS_WIN_FALSE@ sd-daemon.h
-
-@DBUS_WIN_TRUE@DBUS_SHARED_arch_sources = \
-@DBUS_WIN_TRUE@ $(wince_source) \
-@DBUS_WIN_TRUE@ dbus-file-win.c \
-@DBUS_WIN_TRUE@ dbus-pipe-win.c \
-@DBUS_WIN_TRUE@ dbus-sockets-win.h \
-@DBUS_WIN_TRUE@ dbus-sysdeps-win.c \
-@DBUS_WIN_TRUE@ dbus-sysdeps-win.h \
-@DBUS_WIN_TRUE@ dbus-sysdeps-thread-win.c \
-@DBUS_WIN_TRUE@ dbus-transport-win.c \
-@DBUS_WIN_TRUE@ dbus-transport-win.h
-
-@DBUS_WIN_FALSE@DBUS_UTIL_arch_sources = dbus-sysdeps-util-unix.c \
-@DBUS_WIN_FALSE@ dbus-userdb-util.c dbus-spawn.c \
-@DBUS_WIN_FALSE@ $(am__append_1)
-@DBUS_WIN_TRUE@DBUS_UTIL_arch_sources = dbus-sysdeps-util-win.c \
-@DBUS_WIN_TRUE@ dbus-spawn-win.c $(am__append_1)
-@DBUS_ENABLE_LAUNCHD_FALSE@@DBUS_WIN_FALSE@launchd_source =
-@DBUS_ENABLE_LAUNCHD_TRUE@@DBUS_WIN_FALSE@launchd_source = dbus-server-launchd.h dbus-server-launchd.c
-dbusinclude_HEADERS = \
- dbus.h \
- dbus-address.h \
- dbus-bus.h \
- dbus-connection.h \
- dbus-errors.h \
- dbus-macros.h \
- dbus-memory.h \
- dbus-message.h \
- dbus-misc.h \
- dbus-pending-call.h \
- dbus-protocol.h \
- dbus-server.h \
- dbus-shared.h \
- dbus-signature.h \
- dbus-syntax.h \
- dbus-threads.h \
- dbus-types.h
-
-nodist_dbusarchinclude_HEADERS = \
- dbus-arch-deps.h
-
-
-### source code that goes in the installed client library
-### and is specific to library functionality
-DBUS_LIB_SOURCES = \
- dbus-address.c \
- dbus-auth.c \
- dbus-auth.h \
- dbus-bus.c \
- dbus-connection.c \
- dbus-connection-internal.h \
- dbus-credentials.c \
- dbus-credentials.h \
- dbus-errors.c \
- dbus-keyring.c \
- dbus-keyring.h \
- dbus-marshal-header.c \
- dbus-marshal-header.h \
- dbus-marshal-byteswap.c \
- dbus-marshal-byteswap.h \
- dbus-marshal-recursive.c \
- dbus-marshal-recursive.h \
- dbus-marshal-validate.c \
- dbus-marshal-validate.h \
- dbus-message.c \
- dbus-message-internal.h \
- dbus-message-private.h \
- dbus-misc.c \
- dbus-nonce.h \
- dbus-nonce.c \
- dbus-object-tree.c \
- dbus-object-tree.h \
- dbus-pending-call.c \
- dbus-pending-call-internal.h \
- dbus-resources.c \
- dbus-resources.h \
- dbus-server.c \
- dbus-server-debug-pipe.c \
- dbus-server-debug-pipe.h \
- dbus-server-protected.h \
- dbus-server-socket.c \
- dbus-server-socket.h \
- $(DBUS_LIB_arch_sources) \
- dbus-sha.c \
- dbus-sha.h \
- dbus-signature.c \
- dbus-syntax.c \
- dbus-timeout.c \
- dbus-timeout.h \
- dbus-threads-internal.h \
- dbus-threads.c \
- dbus-transport.c \
- dbus-transport.h \
- dbus-transport-protected.h \
- dbus-transport-socket.c \
- dbus-transport-socket.h \
- dbus-watch.c \
- dbus-watch.h
-
-
-### source code that goes in the installed client library
-### AND is generic utility functionality used by the
-### daemon or test programs (all symbols in here should
-### be underscore-prefixed)
-DBUS_SHARED_SOURCES = \
- dbus-dataslot.c \
- dbus-dataslot.h \
- dbus-file.c \
- dbus-file.h \
- dbus-hash.c \
- dbus-hash.h \
- dbus-internals.c \
- dbus-internals.h \
- dbus-list.c \
- dbus-list.h \
- dbus-marshal-basic.c \
- dbus-marshal-basic.h \
- dbus-memory.c \
- dbus-mempool.c \
- dbus-mempool.h \
- dbus-pipe.c \
- dbus-pipe.h \
- dbus-string.c \
- dbus-string.h \
- dbus-string-private.h \
- $(DBUS_SHARED_arch_sources) \
- dbus-sysdeps.c \
- dbus-sysdeps.h \
- dbus-valgrind-internal.h
-
-
-### source code that is generic utility functionality used
-### by the bus daemon or test apps, but is NOT included
-### in the D-Bus client library (all symbols in here
-### should be underscore-prefixed but don't really need
-### to be unless they move to DBUS_SHARED_SOURCES later)
-DBUS_UTIL_SOURCES = \
- dbus-asv-util.c \
- dbus-asv-util.h \
- dbus-auth-script.c \
- dbus-auth-script.h \
- dbus-auth-util.c \
- dbus-credentials-util.c \
- dbus-mainloop.c \
- dbus-mainloop.h \
- dbus-marshal-byteswap-util.c \
- dbus-marshal-recursive-util.c \
- dbus-marshal-validate-util.c \
- dbus-message-factory.c \
- dbus-message-factory.h \
- dbus-message-util.c \
- dbus-shell.c \
- dbus-shell.h \
- $(DBUS_UTIL_arch_sources) \
- dbus-socket-set.h \
- dbus-socket-set.c \
- dbus-socket-set-poll.c \
- dbus-spawn.h \
- dbus-string-util.c \
- dbus-sysdeps-util.c \
- dbus-test.c \
- dbus-test.h
-
-libdbus_1_la_SOURCES = \
- $(DBUS_LIB_SOURCES) \
- $(DBUS_SHARED_SOURCES)
-
-libdbus_internal_la_SOURCES = \
- $(DBUS_LIB_SOURCES) \
- $(DBUS_SHARED_SOURCES) \
- $(DBUS_UTIL_SOURCES)
-
-BUILT_SOURCES = $(nodist_dbusarchinclude_HEADERS)
-EXTRA_DIST = dbus-arch-deps.h.in
-noinst_LTLIBRARIES = libdbus-internal.la $(am__append_2)
-libdbus_1_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -Ddbus_1_EXPORTS \
- $(NULL)
-
-libdbus_1_la_LIBADD = $(LIBDBUS_LIBS) $(am__append_3)
-libdbus_1_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- $(export_symbols) \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
- -no-undefined \
- $(NULL)
-
-libdbus_internal_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DDBUS_STATIC_BUILD \
- $(NULL)
-
-libdbus_internal_la_LIBADD = $(LIBDBUS_LIBS) $(SYSTEMD_LIBS) \
- $(am__append_4)
-@DBUS_WIN_TRUE@libdbus_init_win_la_SOURCES = dbus-init-win.cpp
-dbus_test_SOURCES = \
- dbus-test-main.c
-
-dbus_test_LDADD = libdbus-internal.la
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: rc .c .cpp .lo .o .obj .rc
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dbus/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu dbus/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-versioninfo.rc: $(top_builddir)/config.status $(srcdir)/versioninfo.rc.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-arch-deps.h: $(top_builddir)/config.status $(srcdir)/dbus-arch-deps.h.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
- }
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libdbus-1.la: $(libdbus_1_la_OBJECTS) $(libdbus_1_la_DEPENDENCIES) $(EXTRA_libdbus_1_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdbus_1_la_LINK) -rpath $(libdir) $(libdbus_1_la_OBJECTS) $(libdbus_1_la_LIBADD) $(LIBS)
-libdbus-init-win.la: $(libdbus_init_win_la_OBJECTS) $(libdbus_init_win_la_DEPENDENCIES) $(EXTRA_libdbus_init_win_la_DEPENDENCIES)
- $(AM_V_CXXLD)$(CXXLINK) $(am_libdbus_init_win_la_rpath) $(libdbus_init_win_la_OBJECTS) $(libdbus_init_win_la_LIBADD) $(LIBS)
-libdbus-internal.la: $(libdbus_internal_la_OBJECTS) $(libdbus_internal_la_DEPENDENCIES) $(EXTRA_libdbus_internal_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libdbus_internal_la_OBJECTS) $(libdbus_internal_la_LIBADD) $(LIBS)
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-dbus-test$(EXEEXT): $(dbus_test_OBJECTS) $(dbus_test_DEPENDENCIES) $(EXTRA_dbus_test_DEPENDENCIES)
- @rm -f dbus-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_test_OBJECTS) $(dbus_test_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-init-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-test-main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-address.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-auth.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-bus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-connection.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-credentials.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-dataslot.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-errors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-file-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-file-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-file.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-hash.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-internals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-keyring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-list.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-marshal-basic.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-marshal-byteswap.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-marshal-header.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-marshal-recursive.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-marshal-validate.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-memory.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-mempool.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-message.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-misc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-nonce.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-object-tree.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-pending-call.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-pipe-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-pipe-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-pipe.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-resources.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server-debug-pipe.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server-launchd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server-socket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-server.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sha.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-signature.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-string.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-syntax.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps-pthread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps-thread-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps-wince-glue.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-sysdeps.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-threads.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-timeout.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-transport-socket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-transport-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-transport-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-transport.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-userdb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-uuidgen.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-watch.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-sd-daemon.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-address.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-asv-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth-script.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-bus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-connection.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-credentials-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-credentials.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-dataslot.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-errors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-file-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-file-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-file.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-hash.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-internals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-keyring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-list.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-mainloop.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-basic.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-header.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-validate-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-marshal-validate.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-memory.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-mempool.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-message-factory.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-message-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-message.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-misc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-nonce.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-object-tree.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-pending-call.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-pipe-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-pipe-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-pipe.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-resources.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server-debug-pipe.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server-launchd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server-socket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-server.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sha.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-shell.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-signature.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-socket-set-epoll.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-socket-set-poll.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-socket-set.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-spawn-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-spawn.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-string-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-string.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-syntax.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-pthread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-thread-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps-wince-glue.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-sysdeps.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-test.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-threads.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-timeout.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-transport-socket.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-transport-unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-transport-win.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-transport.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-userdb-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-userdb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-uuidgen.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-watch.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-sd-daemon.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-libdbus_1_la-dbus-address.lo: dbus-address.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-address.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-address.Tpo -c -o libdbus_1_la-dbus-address.lo `test -f 'dbus-address.c' || echo '$(srcdir)/'`dbus-address.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-address.Tpo $(DEPDIR)/libdbus_1_la-dbus-address.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-address.c' object='libdbus_1_la-dbus-address.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-address.lo `test -f 'dbus-address.c' || echo '$(srcdir)/'`dbus-address.c
-
-libdbus_1_la-dbus-auth.lo: dbus-auth.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-auth.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-auth.Tpo -c -o libdbus_1_la-dbus-auth.lo `test -f 'dbus-auth.c' || echo '$(srcdir)/'`dbus-auth.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-auth.Tpo $(DEPDIR)/libdbus_1_la-dbus-auth.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-auth.c' object='libdbus_1_la-dbus-auth.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-auth.lo `test -f 'dbus-auth.c' || echo '$(srcdir)/'`dbus-auth.c
-
-libdbus_1_la-dbus-bus.lo: dbus-bus.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-bus.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-bus.Tpo -c -o libdbus_1_la-dbus-bus.lo `test -f 'dbus-bus.c' || echo '$(srcdir)/'`dbus-bus.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-bus.Tpo $(DEPDIR)/libdbus_1_la-dbus-bus.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-bus.c' object='libdbus_1_la-dbus-bus.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-bus.lo `test -f 'dbus-bus.c' || echo '$(srcdir)/'`dbus-bus.c
-
-libdbus_1_la-dbus-connection.lo: dbus-connection.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-connection.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-connection.Tpo -c -o libdbus_1_la-dbus-connection.lo `test -f 'dbus-connection.c' || echo '$(srcdir)/'`dbus-connection.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-connection.Tpo $(DEPDIR)/libdbus_1_la-dbus-connection.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-connection.c' object='libdbus_1_la-dbus-connection.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-connection.lo `test -f 'dbus-connection.c' || echo '$(srcdir)/'`dbus-connection.c
-
-libdbus_1_la-dbus-credentials.lo: dbus-credentials.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-credentials.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-credentials.Tpo -c -o libdbus_1_la-dbus-credentials.lo `test -f 'dbus-credentials.c' || echo '$(srcdir)/'`dbus-credentials.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-credentials.Tpo $(DEPDIR)/libdbus_1_la-dbus-credentials.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-credentials.c' object='libdbus_1_la-dbus-credentials.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-credentials.lo `test -f 'dbus-credentials.c' || echo '$(srcdir)/'`dbus-credentials.c
-
-libdbus_1_la-dbus-errors.lo: dbus-errors.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-errors.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-errors.Tpo -c -o libdbus_1_la-dbus-errors.lo `test -f 'dbus-errors.c' || echo '$(srcdir)/'`dbus-errors.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-errors.Tpo $(DEPDIR)/libdbus_1_la-dbus-errors.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-errors.c' object='libdbus_1_la-dbus-errors.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-errors.lo `test -f 'dbus-errors.c' || echo '$(srcdir)/'`dbus-errors.c
-
-libdbus_1_la-dbus-keyring.lo: dbus-keyring.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-keyring.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-keyring.Tpo -c -o libdbus_1_la-dbus-keyring.lo `test -f 'dbus-keyring.c' || echo '$(srcdir)/'`dbus-keyring.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-keyring.Tpo $(DEPDIR)/libdbus_1_la-dbus-keyring.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-keyring.c' object='libdbus_1_la-dbus-keyring.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-keyring.lo `test -f 'dbus-keyring.c' || echo '$(srcdir)/'`dbus-keyring.c
-
-libdbus_1_la-dbus-marshal-header.lo: dbus-marshal-header.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-marshal-header.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-marshal-header.Tpo -c -o libdbus_1_la-dbus-marshal-header.lo `test -f 'dbus-marshal-header.c' || echo '$(srcdir)/'`dbus-marshal-header.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-marshal-header.Tpo $(DEPDIR)/libdbus_1_la-dbus-marshal-header.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-header.c' object='libdbus_1_la-dbus-marshal-header.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-marshal-header.lo `test -f 'dbus-marshal-header.c' || echo '$(srcdir)/'`dbus-marshal-header.c
-
-libdbus_1_la-dbus-marshal-byteswap.lo: dbus-marshal-byteswap.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-marshal-byteswap.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-marshal-byteswap.Tpo -c -o libdbus_1_la-dbus-marshal-byteswap.lo `test -f 'dbus-marshal-byteswap.c' || echo '$(srcdir)/'`dbus-marshal-byteswap.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-marshal-byteswap.Tpo $(DEPDIR)/libdbus_1_la-dbus-marshal-byteswap.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-byteswap.c' object='libdbus_1_la-dbus-marshal-byteswap.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-marshal-byteswap.lo `test -f 'dbus-marshal-byteswap.c' || echo '$(srcdir)/'`dbus-marshal-byteswap.c
-
-libdbus_1_la-dbus-marshal-recursive.lo: dbus-marshal-recursive.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-marshal-recursive.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-marshal-recursive.Tpo -c -o libdbus_1_la-dbus-marshal-recursive.lo `test -f 'dbus-marshal-recursive.c' || echo '$(srcdir)/'`dbus-marshal-recursive.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-marshal-recursive.Tpo $(DEPDIR)/libdbus_1_la-dbus-marshal-recursive.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-recursive.c' object='libdbus_1_la-dbus-marshal-recursive.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-marshal-recursive.lo `test -f 'dbus-marshal-recursive.c' || echo '$(srcdir)/'`dbus-marshal-recursive.c
-
-libdbus_1_la-dbus-marshal-validate.lo: dbus-marshal-validate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-marshal-validate.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-marshal-validate.Tpo -c -o libdbus_1_la-dbus-marshal-validate.lo `test -f 'dbus-marshal-validate.c' || echo '$(srcdir)/'`dbus-marshal-validate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-marshal-validate.Tpo $(DEPDIR)/libdbus_1_la-dbus-marshal-validate.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-validate.c' object='libdbus_1_la-dbus-marshal-validate.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-marshal-validate.lo `test -f 'dbus-marshal-validate.c' || echo '$(srcdir)/'`dbus-marshal-validate.c
-
-libdbus_1_la-dbus-message.lo: dbus-message.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-message.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-message.Tpo -c -o libdbus_1_la-dbus-message.lo `test -f 'dbus-message.c' || echo '$(srcdir)/'`dbus-message.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-message.Tpo $(DEPDIR)/libdbus_1_la-dbus-message.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-message.c' object='libdbus_1_la-dbus-message.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-message.lo `test -f 'dbus-message.c' || echo '$(srcdir)/'`dbus-message.c
-
-libdbus_1_la-dbus-misc.lo: dbus-misc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-misc.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-misc.Tpo -c -o libdbus_1_la-dbus-misc.lo `test -f 'dbus-misc.c' || echo '$(srcdir)/'`dbus-misc.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-misc.Tpo $(DEPDIR)/libdbus_1_la-dbus-misc.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-misc.c' object='libdbus_1_la-dbus-misc.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-misc.lo `test -f 'dbus-misc.c' || echo '$(srcdir)/'`dbus-misc.c
-
-libdbus_1_la-dbus-nonce.lo: dbus-nonce.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-nonce.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-nonce.Tpo -c -o libdbus_1_la-dbus-nonce.lo `test -f 'dbus-nonce.c' || echo '$(srcdir)/'`dbus-nonce.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-nonce.Tpo $(DEPDIR)/libdbus_1_la-dbus-nonce.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-nonce.c' object='libdbus_1_la-dbus-nonce.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-nonce.lo `test -f 'dbus-nonce.c' || echo '$(srcdir)/'`dbus-nonce.c
-
-libdbus_1_la-dbus-object-tree.lo: dbus-object-tree.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-object-tree.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-object-tree.Tpo -c -o libdbus_1_la-dbus-object-tree.lo `test -f 'dbus-object-tree.c' || echo '$(srcdir)/'`dbus-object-tree.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-object-tree.Tpo $(DEPDIR)/libdbus_1_la-dbus-object-tree.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-object-tree.c' object='libdbus_1_la-dbus-object-tree.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-object-tree.lo `test -f 'dbus-object-tree.c' || echo '$(srcdir)/'`dbus-object-tree.c
-
-libdbus_1_la-dbus-pending-call.lo: dbus-pending-call.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-pending-call.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-pending-call.Tpo -c -o libdbus_1_la-dbus-pending-call.lo `test -f 'dbus-pending-call.c' || echo '$(srcdir)/'`dbus-pending-call.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-pending-call.Tpo $(DEPDIR)/libdbus_1_la-dbus-pending-call.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pending-call.c' object='libdbus_1_la-dbus-pending-call.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-pending-call.lo `test -f 'dbus-pending-call.c' || echo '$(srcdir)/'`dbus-pending-call.c
-
-libdbus_1_la-dbus-resources.lo: dbus-resources.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-resources.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-resources.Tpo -c -o libdbus_1_la-dbus-resources.lo `test -f 'dbus-resources.c' || echo '$(srcdir)/'`dbus-resources.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-resources.Tpo $(DEPDIR)/libdbus_1_la-dbus-resources.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-resources.c' object='libdbus_1_la-dbus-resources.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-resources.lo `test -f 'dbus-resources.c' || echo '$(srcdir)/'`dbus-resources.c
-
-libdbus_1_la-dbus-server.lo: dbus-server.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server.Tpo -c -o libdbus_1_la-dbus-server.lo `test -f 'dbus-server.c' || echo '$(srcdir)/'`dbus-server.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server.Tpo $(DEPDIR)/libdbus_1_la-dbus-server.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server.c' object='libdbus_1_la-dbus-server.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server.lo `test -f 'dbus-server.c' || echo '$(srcdir)/'`dbus-server.c
-
-libdbus_1_la-dbus-server-debug-pipe.lo: dbus-server-debug-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server-debug-pipe.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server-debug-pipe.Tpo -c -o libdbus_1_la-dbus-server-debug-pipe.lo `test -f 'dbus-server-debug-pipe.c' || echo '$(srcdir)/'`dbus-server-debug-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server-debug-pipe.Tpo $(DEPDIR)/libdbus_1_la-dbus-server-debug-pipe.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-debug-pipe.c' object='libdbus_1_la-dbus-server-debug-pipe.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server-debug-pipe.lo `test -f 'dbus-server-debug-pipe.c' || echo '$(srcdir)/'`dbus-server-debug-pipe.c
-
-libdbus_1_la-dbus-server-socket.lo: dbus-server-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server-socket.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server-socket.Tpo -c -o libdbus_1_la-dbus-server-socket.lo `test -f 'dbus-server-socket.c' || echo '$(srcdir)/'`dbus-server-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server-socket.Tpo $(DEPDIR)/libdbus_1_la-dbus-server-socket.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-socket.c' object='libdbus_1_la-dbus-server-socket.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server-socket.lo `test -f 'dbus-server-socket.c' || echo '$(srcdir)/'`dbus-server-socket.c
-
-libdbus_1_la-dbus-uuidgen.lo: dbus-uuidgen.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-uuidgen.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-uuidgen.Tpo -c -o libdbus_1_la-dbus-uuidgen.lo `test -f 'dbus-uuidgen.c' || echo '$(srcdir)/'`dbus-uuidgen.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-uuidgen.Tpo $(DEPDIR)/libdbus_1_la-dbus-uuidgen.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-uuidgen.c' object='libdbus_1_la-dbus-uuidgen.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-uuidgen.lo `test -f 'dbus-uuidgen.c' || echo '$(srcdir)/'`dbus-uuidgen.c
-
-libdbus_1_la-dbus-server-unix.lo: dbus-server-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server-unix.Tpo -c -o libdbus_1_la-dbus-server-unix.lo `test -f 'dbus-server-unix.c' || echo '$(srcdir)/'`dbus-server-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server-unix.Tpo $(DEPDIR)/libdbus_1_la-dbus-server-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-unix.c' object='libdbus_1_la-dbus-server-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server-unix.lo `test -f 'dbus-server-unix.c' || echo '$(srcdir)/'`dbus-server-unix.c
-
-libdbus_1_la-dbus-server-win.lo: dbus-server-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server-win.Tpo -c -o libdbus_1_la-dbus-server-win.lo `test -f 'dbus-server-win.c' || echo '$(srcdir)/'`dbus-server-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-server-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-win.c' object='libdbus_1_la-dbus-server-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server-win.lo `test -f 'dbus-server-win.c' || echo '$(srcdir)/'`dbus-server-win.c
-
-libdbus_1_la-dbus-sha.lo: dbus-sha.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sha.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sha.Tpo -c -o libdbus_1_la-dbus-sha.lo `test -f 'dbus-sha.c' || echo '$(srcdir)/'`dbus-sha.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sha.Tpo $(DEPDIR)/libdbus_1_la-dbus-sha.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sha.c' object='libdbus_1_la-dbus-sha.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sha.lo `test -f 'dbus-sha.c' || echo '$(srcdir)/'`dbus-sha.c
-
-libdbus_1_la-dbus-signature.lo: dbus-signature.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-signature.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-signature.Tpo -c -o libdbus_1_la-dbus-signature.lo `test -f 'dbus-signature.c' || echo '$(srcdir)/'`dbus-signature.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-signature.Tpo $(DEPDIR)/libdbus_1_la-dbus-signature.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-signature.c' object='libdbus_1_la-dbus-signature.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-signature.lo `test -f 'dbus-signature.c' || echo '$(srcdir)/'`dbus-signature.c
-
-libdbus_1_la-dbus-syntax.lo: dbus-syntax.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-syntax.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-syntax.Tpo -c -o libdbus_1_la-dbus-syntax.lo `test -f 'dbus-syntax.c' || echo '$(srcdir)/'`dbus-syntax.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-syntax.Tpo $(DEPDIR)/libdbus_1_la-dbus-syntax.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-syntax.c' object='libdbus_1_la-dbus-syntax.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-syntax.lo `test -f 'dbus-syntax.c' || echo '$(srcdir)/'`dbus-syntax.c
-
-libdbus_1_la-dbus-timeout.lo: dbus-timeout.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-timeout.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-timeout.Tpo -c -o libdbus_1_la-dbus-timeout.lo `test -f 'dbus-timeout.c' || echo '$(srcdir)/'`dbus-timeout.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-timeout.Tpo $(DEPDIR)/libdbus_1_la-dbus-timeout.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-timeout.c' object='libdbus_1_la-dbus-timeout.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-timeout.lo `test -f 'dbus-timeout.c' || echo '$(srcdir)/'`dbus-timeout.c
-
-libdbus_1_la-dbus-threads.lo: dbus-threads.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-threads.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-threads.Tpo -c -o libdbus_1_la-dbus-threads.lo `test -f 'dbus-threads.c' || echo '$(srcdir)/'`dbus-threads.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-threads.Tpo $(DEPDIR)/libdbus_1_la-dbus-threads.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-threads.c' object='libdbus_1_la-dbus-threads.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-threads.lo `test -f 'dbus-threads.c' || echo '$(srcdir)/'`dbus-threads.c
-
-libdbus_1_la-dbus-transport.lo: dbus-transport.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-transport.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-transport.Tpo -c -o libdbus_1_la-dbus-transport.lo `test -f 'dbus-transport.c' || echo '$(srcdir)/'`dbus-transport.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-transport.Tpo $(DEPDIR)/libdbus_1_la-dbus-transport.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport.c' object='libdbus_1_la-dbus-transport.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-transport.lo `test -f 'dbus-transport.c' || echo '$(srcdir)/'`dbus-transport.c
-
-libdbus_1_la-dbus-transport-socket.lo: dbus-transport-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-transport-socket.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-transport-socket.Tpo -c -o libdbus_1_la-dbus-transport-socket.lo `test -f 'dbus-transport-socket.c' || echo '$(srcdir)/'`dbus-transport-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-transport-socket.Tpo $(DEPDIR)/libdbus_1_la-dbus-transport-socket.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-socket.c' object='libdbus_1_la-dbus-transport-socket.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-transport-socket.lo `test -f 'dbus-transport-socket.c' || echo '$(srcdir)/'`dbus-transport-socket.c
-
-libdbus_1_la-dbus-watch.lo: dbus-watch.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-watch.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-watch.Tpo -c -o libdbus_1_la-dbus-watch.lo `test -f 'dbus-watch.c' || echo '$(srcdir)/'`dbus-watch.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-watch.Tpo $(DEPDIR)/libdbus_1_la-dbus-watch.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-watch.c' object='libdbus_1_la-dbus-watch.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-watch.lo `test -f 'dbus-watch.c' || echo '$(srcdir)/'`dbus-watch.c
-
-libdbus_1_la-dbus-dataslot.lo: dbus-dataslot.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-dataslot.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-dataslot.Tpo -c -o libdbus_1_la-dbus-dataslot.lo `test -f 'dbus-dataslot.c' || echo '$(srcdir)/'`dbus-dataslot.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-dataslot.Tpo $(DEPDIR)/libdbus_1_la-dbus-dataslot.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-dataslot.c' object='libdbus_1_la-dbus-dataslot.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-dataslot.lo `test -f 'dbus-dataslot.c' || echo '$(srcdir)/'`dbus-dataslot.c
-
-libdbus_1_la-dbus-file.lo: dbus-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-file.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-file.Tpo -c -o libdbus_1_la-dbus-file.lo `test -f 'dbus-file.c' || echo '$(srcdir)/'`dbus-file.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-file.Tpo $(DEPDIR)/libdbus_1_la-dbus-file.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file.c' object='libdbus_1_la-dbus-file.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-file.lo `test -f 'dbus-file.c' || echo '$(srcdir)/'`dbus-file.c
-
-libdbus_1_la-dbus-hash.lo: dbus-hash.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-hash.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-hash.Tpo -c -o libdbus_1_la-dbus-hash.lo `test -f 'dbus-hash.c' || echo '$(srcdir)/'`dbus-hash.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-hash.Tpo $(DEPDIR)/libdbus_1_la-dbus-hash.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-hash.c' object='libdbus_1_la-dbus-hash.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-hash.lo `test -f 'dbus-hash.c' || echo '$(srcdir)/'`dbus-hash.c
-
-libdbus_1_la-dbus-internals.lo: dbus-internals.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-internals.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-internals.Tpo -c -o libdbus_1_la-dbus-internals.lo `test -f 'dbus-internals.c' || echo '$(srcdir)/'`dbus-internals.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-internals.Tpo $(DEPDIR)/libdbus_1_la-dbus-internals.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-internals.c' object='libdbus_1_la-dbus-internals.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-internals.lo `test -f 'dbus-internals.c' || echo '$(srcdir)/'`dbus-internals.c
-
-libdbus_1_la-dbus-list.lo: dbus-list.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-list.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-list.Tpo -c -o libdbus_1_la-dbus-list.lo `test -f 'dbus-list.c' || echo '$(srcdir)/'`dbus-list.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-list.Tpo $(DEPDIR)/libdbus_1_la-dbus-list.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-list.c' object='libdbus_1_la-dbus-list.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-list.lo `test -f 'dbus-list.c' || echo '$(srcdir)/'`dbus-list.c
-
-libdbus_1_la-dbus-marshal-basic.lo: dbus-marshal-basic.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-marshal-basic.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-marshal-basic.Tpo -c -o libdbus_1_la-dbus-marshal-basic.lo `test -f 'dbus-marshal-basic.c' || echo '$(srcdir)/'`dbus-marshal-basic.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-marshal-basic.Tpo $(DEPDIR)/libdbus_1_la-dbus-marshal-basic.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-basic.c' object='libdbus_1_la-dbus-marshal-basic.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-marshal-basic.lo `test -f 'dbus-marshal-basic.c' || echo '$(srcdir)/'`dbus-marshal-basic.c
-
-libdbus_1_la-dbus-memory.lo: dbus-memory.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-memory.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-memory.Tpo -c -o libdbus_1_la-dbus-memory.lo `test -f 'dbus-memory.c' || echo '$(srcdir)/'`dbus-memory.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-memory.Tpo $(DEPDIR)/libdbus_1_la-dbus-memory.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-memory.c' object='libdbus_1_la-dbus-memory.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-memory.lo `test -f 'dbus-memory.c' || echo '$(srcdir)/'`dbus-memory.c
-
-libdbus_1_la-dbus-mempool.lo: dbus-mempool.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-mempool.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-mempool.Tpo -c -o libdbus_1_la-dbus-mempool.lo `test -f 'dbus-mempool.c' || echo '$(srcdir)/'`dbus-mempool.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-mempool.Tpo $(DEPDIR)/libdbus_1_la-dbus-mempool.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-mempool.c' object='libdbus_1_la-dbus-mempool.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-mempool.lo `test -f 'dbus-mempool.c' || echo '$(srcdir)/'`dbus-mempool.c
-
-libdbus_1_la-dbus-pipe.lo: dbus-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-pipe.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-pipe.Tpo -c -o libdbus_1_la-dbus-pipe.lo `test -f 'dbus-pipe.c' || echo '$(srcdir)/'`dbus-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-pipe.Tpo $(DEPDIR)/libdbus_1_la-dbus-pipe.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe.c' object='libdbus_1_la-dbus-pipe.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-pipe.lo `test -f 'dbus-pipe.c' || echo '$(srcdir)/'`dbus-pipe.c
-
-libdbus_1_la-dbus-string.lo: dbus-string.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-string.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-string.Tpo -c -o libdbus_1_la-dbus-string.lo `test -f 'dbus-string.c' || echo '$(srcdir)/'`dbus-string.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-string.Tpo $(DEPDIR)/libdbus_1_la-dbus-string.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-string.c' object='libdbus_1_la-dbus-string.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-string.lo `test -f 'dbus-string.c' || echo '$(srcdir)/'`dbus-string.c
-
-libdbus_1_la-dbus-server-launchd.lo: dbus-server-launchd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-server-launchd.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-server-launchd.Tpo -c -o libdbus_1_la-dbus-server-launchd.lo `test -f 'dbus-server-launchd.c' || echo '$(srcdir)/'`dbus-server-launchd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-server-launchd.Tpo $(DEPDIR)/libdbus_1_la-dbus-server-launchd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-launchd.c' object='libdbus_1_la-dbus-server-launchd.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-server-launchd.lo `test -f 'dbus-server-launchd.c' || echo '$(srcdir)/'`dbus-server-launchd.c
-
-libdbus_1_la-dbus-file-unix.lo: dbus-file-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-file-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-file-unix.Tpo -c -o libdbus_1_la-dbus-file-unix.lo `test -f 'dbus-file-unix.c' || echo '$(srcdir)/'`dbus-file-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-file-unix.Tpo $(DEPDIR)/libdbus_1_la-dbus-file-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file-unix.c' object='libdbus_1_la-dbus-file-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-file-unix.lo `test -f 'dbus-file-unix.c' || echo '$(srcdir)/'`dbus-file-unix.c
-
-libdbus_1_la-dbus-pipe-unix.lo: dbus-pipe-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-pipe-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-pipe-unix.Tpo -c -o libdbus_1_la-dbus-pipe-unix.lo `test -f 'dbus-pipe-unix.c' || echo '$(srcdir)/'`dbus-pipe-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-pipe-unix.Tpo $(DEPDIR)/libdbus_1_la-dbus-pipe-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe-unix.c' object='libdbus_1_la-dbus-pipe-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-pipe-unix.lo `test -f 'dbus-pipe-unix.c' || echo '$(srcdir)/'`dbus-pipe-unix.c
-
-libdbus_1_la-dbus-sysdeps-unix.lo: dbus-sysdeps-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps-unix.Tpo -c -o libdbus_1_la-dbus-sysdeps-unix.lo `test -f 'dbus-sysdeps-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps-unix.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-unix.c' object='libdbus_1_la-dbus-sysdeps-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps-unix.lo `test -f 'dbus-sysdeps-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-unix.c
-
-libdbus_1_la-dbus-sysdeps-pthread.lo: dbus-sysdeps-pthread.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps-pthread.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps-pthread.Tpo -c -o libdbus_1_la-dbus-sysdeps-pthread.lo `test -f 'dbus-sysdeps-pthread.c' || echo '$(srcdir)/'`dbus-sysdeps-pthread.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps-pthread.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps-pthread.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-pthread.c' object='libdbus_1_la-dbus-sysdeps-pthread.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps-pthread.lo `test -f 'dbus-sysdeps-pthread.c' || echo '$(srcdir)/'`dbus-sysdeps-pthread.c
-
-libdbus_1_la-dbus-transport-unix.lo: dbus-transport-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-transport-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-transport-unix.Tpo -c -o libdbus_1_la-dbus-transport-unix.lo `test -f 'dbus-transport-unix.c' || echo '$(srcdir)/'`dbus-transport-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-transport-unix.Tpo $(DEPDIR)/libdbus_1_la-dbus-transport-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-unix.c' object='libdbus_1_la-dbus-transport-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-transport-unix.lo `test -f 'dbus-transport-unix.c' || echo '$(srcdir)/'`dbus-transport-unix.c
-
-libdbus_1_la-dbus-userdb.lo: dbus-userdb.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-userdb.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-userdb.Tpo -c -o libdbus_1_la-dbus-userdb.lo `test -f 'dbus-userdb.c' || echo '$(srcdir)/'`dbus-userdb.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-userdb.Tpo $(DEPDIR)/libdbus_1_la-dbus-userdb.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-userdb.c' object='libdbus_1_la-dbus-userdb.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-userdb.lo `test -f 'dbus-userdb.c' || echo '$(srcdir)/'`dbus-userdb.c
-
-libdbus_1_la-sd-daemon.lo: sd-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-sd-daemon.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-sd-daemon.Tpo -c -o libdbus_1_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-sd-daemon.Tpo $(DEPDIR)/libdbus_1_la-sd-daemon.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sd-daemon.c' object='libdbus_1_la-sd-daemon.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c
-
-libdbus_1_la-dbus-sysdeps-wince-glue.lo: dbus-sysdeps-wince-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps-wince-glue.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps-wince-glue.Tpo -c -o libdbus_1_la-dbus-sysdeps-wince-glue.lo `test -f 'dbus-sysdeps-wince-glue.c' || echo '$(srcdir)/'`dbus-sysdeps-wince-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps-wince-glue.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps-wince-glue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-wince-glue.c' object='libdbus_1_la-dbus-sysdeps-wince-glue.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps-wince-glue.lo `test -f 'dbus-sysdeps-wince-glue.c' || echo '$(srcdir)/'`dbus-sysdeps-wince-glue.c
-
-libdbus_1_la-dbus-file-win.lo: dbus-file-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-file-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-file-win.Tpo -c -o libdbus_1_la-dbus-file-win.lo `test -f 'dbus-file-win.c' || echo '$(srcdir)/'`dbus-file-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-file-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-file-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file-win.c' object='libdbus_1_la-dbus-file-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-file-win.lo `test -f 'dbus-file-win.c' || echo '$(srcdir)/'`dbus-file-win.c
-
-libdbus_1_la-dbus-pipe-win.lo: dbus-pipe-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-pipe-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-pipe-win.Tpo -c -o libdbus_1_la-dbus-pipe-win.lo `test -f 'dbus-pipe-win.c' || echo '$(srcdir)/'`dbus-pipe-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-pipe-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-pipe-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe-win.c' object='libdbus_1_la-dbus-pipe-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-pipe-win.lo `test -f 'dbus-pipe-win.c' || echo '$(srcdir)/'`dbus-pipe-win.c
-
-libdbus_1_la-dbus-sysdeps-win.lo: dbus-sysdeps-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps-win.Tpo -c -o libdbus_1_la-dbus-sysdeps-win.lo `test -f 'dbus-sysdeps-win.c' || echo '$(srcdir)/'`dbus-sysdeps-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-win.c' object='libdbus_1_la-dbus-sysdeps-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps-win.lo `test -f 'dbus-sysdeps-win.c' || echo '$(srcdir)/'`dbus-sysdeps-win.c
-
-libdbus_1_la-dbus-sysdeps-thread-win.lo: dbus-sysdeps-thread-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps-thread-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps-thread-win.Tpo -c -o libdbus_1_la-dbus-sysdeps-thread-win.lo `test -f 'dbus-sysdeps-thread-win.c' || echo '$(srcdir)/'`dbus-sysdeps-thread-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps-thread-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps-thread-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-thread-win.c' object='libdbus_1_la-dbus-sysdeps-thread-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps-thread-win.lo `test -f 'dbus-sysdeps-thread-win.c' || echo '$(srcdir)/'`dbus-sysdeps-thread-win.c
-
-libdbus_1_la-dbus-transport-win.lo: dbus-transport-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-transport-win.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-transport-win.Tpo -c -o libdbus_1_la-dbus-transport-win.lo `test -f 'dbus-transport-win.c' || echo '$(srcdir)/'`dbus-transport-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-transport-win.Tpo $(DEPDIR)/libdbus_1_la-dbus-transport-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-win.c' object='libdbus_1_la-dbus-transport-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-transport-win.lo `test -f 'dbus-transport-win.c' || echo '$(srcdir)/'`dbus-transport-win.c
-
-libdbus_1_la-dbus-sysdeps.lo: dbus-sysdeps.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_1_la-dbus-sysdeps.lo -MD -MP -MF $(DEPDIR)/libdbus_1_la-dbus-sysdeps.Tpo -c -o libdbus_1_la-dbus-sysdeps.lo `test -f 'dbus-sysdeps.c' || echo '$(srcdir)/'`dbus-sysdeps.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_1_la-dbus-sysdeps.Tpo $(DEPDIR)/libdbus_1_la-dbus-sysdeps.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps.c' object='libdbus_1_la-dbus-sysdeps.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_1_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_1_la-dbus-sysdeps.lo `test -f 'dbus-sysdeps.c' || echo '$(srcdir)/'`dbus-sysdeps.c
-
-libdbus_internal_la-dbus-address.lo: dbus-address.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-address.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-address.Tpo -c -o libdbus_internal_la-dbus-address.lo `test -f 'dbus-address.c' || echo '$(srcdir)/'`dbus-address.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-address.Tpo $(DEPDIR)/libdbus_internal_la-dbus-address.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-address.c' object='libdbus_internal_la-dbus-address.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-address.lo `test -f 'dbus-address.c' || echo '$(srcdir)/'`dbus-address.c
-
-libdbus_internal_la-dbus-auth.lo: dbus-auth.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-auth.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-auth.Tpo -c -o libdbus_internal_la-dbus-auth.lo `test -f 'dbus-auth.c' || echo '$(srcdir)/'`dbus-auth.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-auth.Tpo $(DEPDIR)/libdbus_internal_la-dbus-auth.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-auth.c' object='libdbus_internal_la-dbus-auth.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-auth.lo `test -f 'dbus-auth.c' || echo '$(srcdir)/'`dbus-auth.c
-
-libdbus_internal_la-dbus-bus.lo: dbus-bus.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-bus.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-bus.Tpo -c -o libdbus_internal_la-dbus-bus.lo `test -f 'dbus-bus.c' || echo '$(srcdir)/'`dbus-bus.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-bus.Tpo $(DEPDIR)/libdbus_internal_la-dbus-bus.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-bus.c' object='libdbus_internal_la-dbus-bus.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-bus.lo `test -f 'dbus-bus.c' || echo '$(srcdir)/'`dbus-bus.c
-
-libdbus_internal_la-dbus-connection.lo: dbus-connection.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-connection.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-connection.Tpo -c -o libdbus_internal_la-dbus-connection.lo `test -f 'dbus-connection.c' || echo '$(srcdir)/'`dbus-connection.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-connection.Tpo $(DEPDIR)/libdbus_internal_la-dbus-connection.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-connection.c' object='libdbus_internal_la-dbus-connection.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-connection.lo `test -f 'dbus-connection.c' || echo '$(srcdir)/'`dbus-connection.c
-
-libdbus_internal_la-dbus-credentials.lo: dbus-credentials.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-credentials.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-credentials.Tpo -c -o libdbus_internal_la-dbus-credentials.lo `test -f 'dbus-credentials.c' || echo '$(srcdir)/'`dbus-credentials.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-credentials.Tpo $(DEPDIR)/libdbus_internal_la-dbus-credentials.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-credentials.c' object='libdbus_internal_la-dbus-credentials.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-credentials.lo `test -f 'dbus-credentials.c' || echo '$(srcdir)/'`dbus-credentials.c
-
-libdbus_internal_la-dbus-errors.lo: dbus-errors.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-errors.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-errors.Tpo -c -o libdbus_internal_la-dbus-errors.lo `test -f 'dbus-errors.c' || echo '$(srcdir)/'`dbus-errors.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-errors.Tpo $(DEPDIR)/libdbus_internal_la-dbus-errors.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-errors.c' object='libdbus_internal_la-dbus-errors.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-errors.lo `test -f 'dbus-errors.c' || echo '$(srcdir)/'`dbus-errors.c
-
-libdbus_internal_la-dbus-keyring.lo: dbus-keyring.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-keyring.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-keyring.Tpo -c -o libdbus_internal_la-dbus-keyring.lo `test -f 'dbus-keyring.c' || echo '$(srcdir)/'`dbus-keyring.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-keyring.Tpo $(DEPDIR)/libdbus_internal_la-dbus-keyring.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-keyring.c' object='libdbus_internal_la-dbus-keyring.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-keyring.lo `test -f 'dbus-keyring.c' || echo '$(srcdir)/'`dbus-keyring.c
-
-libdbus_internal_la-dbus-marshal-header.lo: dbus-marshal-header.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-header.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-header.Tpo -c -o libdbus_internal_la-dbus-marshal-header.lo `test -f 'dbus-marshal-header.c' || echo '$(srcdir)/'`dbus-marshal-header.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-header.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-header.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-header.c' object='libdbus_internal_la-dbus-marshal-header.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-header.lo `test -f 'dbus-marshal-header.c' || echo '$(srcdir)/'`dbus-marshal-header.c
-
-libdbus_internal_la-dbus-marshal-byteswap.lo: dbus-marshal-byteswap.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-byteswap.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap.Tpo -c -o libdbus_internal_la-dbus-marshal-byteswap.lo `test -f 'dbus-marshal-byteswap.c' || echo '$(srcdir)/'`dbus-marshal-byteswap.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-byteswap.c' object='libdbus_internal_la-dbus-marshal-byteswap.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-byteswap.lo `test -f 'dbus-marshal-byteswap.c' || echo '$(srcdir)/'`dbus-marshal-byteswap.c
-
-libdbus_internal_la-dbus-marshal-recursive.lo: dbus-marshal-recursive.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-recursive.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive.Tpo -c -o libdbus_internal_la-dbus-marshal-recursive.lo `test -f 'dbus-marshal-recursive.c' || echo '$(srcdir)/'`dbus-marshal-recursive.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-recursive.c' object='libdbus_internal_la-dbus-marshal-recursive.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-recursive.lo `test -f 'dbus-marshal-recursive.c' || echo '$(srcdir)/'`dbus-marshal-recursive.c
-
-libdbus_internal_la-dbus-marshal-validate.lo: dbus-marshal-validate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-validate.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate.Tpo -c -o libdbus_internal_la-dbus-marshal-validate.lo `test -f 'dbus-marshal-validate.c' || echo '$(srcdir)/'`dbus-marshal-validate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-validate.c' object='libdbus_internal_la-dbus-marshal-validate.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-validate.lo `test -f 'dbus-marshal-validate.c' || echo '$(srcdir)/'`dbus-marshal-validate.c
-
-libdbus_internal_la-dbus-message.lo: dbus-message.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-message.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-message.Tpo -c -o libdbus_internal_la-dbus-message.lo `test -f 'dbus-message.c' || echo '$(srcdir)/'`dbus-message.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-message.Tpo $(DEPDIR)/libdbus_internal_la-dbus-message.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-message.c' object='libdbus_internal_la-dbus-message.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-message.lo `test -f 'dbus-message.c' || echo '$(srcdir)/'`dbus-message.c
-
-libdbus_internal_la-dbus-misc.lo: dbus-misc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-misc.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-misc.Tpo -c -o libdbus_internal_la-dbus-misc.lo `test -f 'dbus-misc.c' || echo '$(srcdir)/'`dbus-misc.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-misc.Tpo $(DEPDIR)/libdbus_internal_la-dbus-misc.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-misc.c' object='libdbus_internal_la-dbus-misc.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-misc.lo `test -f 'dbus-misc.c' || echo '$(srcdir)/'`dbus-misc.c
-
-libdbus_internal_la-dbus-nonce.lo: dbus-nonce.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-nonce.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-nonce.Tpo -c -o libdbus_internal_la-dbus-nonce.lo `test -f 'dbus-nonce.c' || echo '$(srcdir)/'`dbus-nonce.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-nonce.Tpo $(DEPDIR)/libdbus_internal_la-dbus-nonce.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-nonce.c' object='libdbus_internal_la-dbus-nonce.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-nonce.lo `test -f 'dbus-nonce.c' || echo '$(srcdir)/'`dbus-nonce.c
-
-libdbus_internal_la-dbus-object-tree.lo: dbus-object-tree.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-object-tree.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-object-tree.Tpo -c -o libdbus_internal_la-dbus-object-tree.lo `test -f 'dbus-object-tree.c' || echo '$(srcdir)/'`dbus-object-tree.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-object-tree.Tpo $(DEPDIR)/libdbus_internal_la-dbus-object-tree.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-object-tree.c' object='libdbus_internal_la-dbus-object-tree.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-object-tree.lo `test -f 'dbus-object-tree.c' || echo '$(srcdir)/'`dbus-object-tree.c
-
-libdbus_internal_la-dbus-pending-call.lo: dbus-pending-call.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-pending-call.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-pending-call.Tpo -c -o libdbus_internal_la-dbus-pending-call.lo `test -f 'dbus-pending-call.c' || echo '$(srcdir)/'`dbus-pending-call.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-pending-call.Tpo $(DEPDIR)/libdbus_internal_la-dbus-pending-call.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pending-call.c' object='libdbus_internal_la-dbus-pending-call.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-pending-call.lo `test -f 'dbus-pending-call.c' || echo '$(srcdir)/'`dbus-pending-call.c
-
-libdbus_internal_la-dbus-resources.lo: dbus-resources.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-resources.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-resources.Tpo -c -o libdbus_internal_la-dbus-resources.lo `test -f 'dbus-resources.c' || echo '$(srcdir)/'`dbus-resources.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-resources.Tpo $(DEPDIR)/libdbus_internal_la-dbus-resources.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-resources.c' object='libdbus_internal_la-dbus-resources.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-resources.lo `test -f 'dbus-resources.c' || echo '$(srcdir)/'`dbus-resources.c
-
-libdbus_internal_la-dbus-server.lo: dbus-server.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server.Tpo -c -o libdbus_internal_la-dbus-server.lo `test -f 'dbus-server.c' || echo '$(srcdir)/'`dbus-server.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server.c' object='libdbus_internal_la-dbus-server.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server.lo `test -f 'dbus-server.c' || echo '$(srcdir)/'`dbus-server.c
-
-libdbus_internal_la-dbus-server-debug-pipe.lo: dbus-server-debug-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server-debug-pipe.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server-debug-pipe.Tpo -c -o libdbus_internal_la-dbus-server-debug-pipe.lo `test -f 'dbus-server-debug-pipe.c' || echo '$(srcdir)/'`dbus-server-debug-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server-debug-pipe.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server-debug-pipe.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-debug-pipe.c' object='libdbus_internal_la-dbus-server-debug-pipe.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server-debug-pipe.lo `test -f 'dbus-server-debug-pipe.c' || echo '$(srcdir)/'`dbus-server-debug-pipe.c
-
-libdbus_internal_la-dbus-server-socket.lo: dbus-server-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server-socket.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server-socket.Tpo -c -o libdbus_internal_la-dbus-server-socket.lo `test -f 'dbus-server-socket.c' || echo '$(srcdir)/'`dbus-server-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server-socket.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server-socket.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-socket.c' object='libdbus_internal_la-dbus-server-socket.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server-socket.lo `test -f 'dbus-server-socket.c' || echo '$(srcdir)/'`dbus-server-socket.c
-
-libdbus_internal_la-dbus-uuidgen.lo: dbus-uuidgen.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-uuidgen.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-uuidgen.Tpo -c -o libdbus_internal_la-dbus-uuidgen.lo `test -f 'dbus-uuidgen.c' || echo '$(srcdir)/'`dbus-uuidgen.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-uuidgen.Tpo $(DEPDIR)/libdbus_internal_la-dbus-uuidgen.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-uuidgen.c' object='libdbus_internal_la-dbus-uuidgen.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-uuidgen.lo `test -f 'dbus-uuidgen.c' || echo '$(srcdir)/'`dbus-uuidgen.c
-
-libdbus_internal_la-dbus-server-unix.lo: dbus-server-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server-unix.Tpo -c -o libdbus_internal_la-dbus-server-unix.lo `test -f 'dbus-server-unix.c' || echo '$(srcdir)/'`dbus-server-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-unix.c' object='libdbus_internal_la-dbus-server-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server-unix.lo `test -f 'dbus-server-unix.c' || echo '$(srcdir)/'`dbus-server-unix.c
-
-libdbus_internal_la-dbus-server-win.lo: dbus-server-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server-win.Tpo -c -o libdbus_internal_la-dbus-server-win.lo `test -f 'dbus-server-win.c' || echo '$(srcdir)/'`dbus-server-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-win.c' object='libdbus_internal_la-dbus-server-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server-win.lo `test -f 'dbus-server-win.c' || echo '$(srcdir)/'`dbus-server-win.c
-
-libdbus_internal_la-dbus-sha.lo: dbus-sha.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sha.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sha.Tpo -c -o libdbus_internal_la-dbus-sha.lo `test -f 'dbus-sha.c' || echo '$(srcdir)/'`dbus-sha.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sha.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sha.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sha.c' object='libdbus_internal_la-dbus-sha.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sha.lo `test -f 'dbus-sha.c' || echo '$(srcdir)/'`dbus-sha.c
-
-libdbus_internal_la-dbus-signature.lo: dbus-signature.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-signature.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-signature.Tpo -c -o libdbus_internal_la-dbus-signature.lo `test -f 'dbus-signature.c' || echo '$(srcdir)/'`dbus-signature.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-signature.Tpo $(DEPDIR)/libdbus_internal_la-dbus-signature.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-signature.c' object='libdbus_internal_la-dbus-signature.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-signature.lo `test -f 'dbus-signature.c' || echo '$(srcdir)/'`dbus-signature.c
-
-libdbus_internal_la-dbus-syntax.lo: dbus-syntax.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-syntax.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-syntax.Tpo -c -o libdbus_internal_la-dbus-syntax.lo `test -f 'dbus-syntax.c' || echo '$(srcdir)/'`dbus-syntax.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-syntax.Tpo $(DEPDIR)/libdbus_internal_la-dbus-syntax.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-syntax.c' object='libdbus_internal_la-dbus-syntax.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-syntax.lo `test -f 'dbus-syntax.c' || echo '$(srcdir)/'`dbus-syntax.c
-
-libdbus_internal_la-dbus-timeout.lo: dbus-timeout.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-timeout.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-timeout.Tpo -c -o libdbus_internal_la-dbus-timeout.lo `test -f 'dbus-timeout.c' || echo '$(srcdir)/'`dbus-timeout.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-timeout.Tpo $(DEPDIR)/libdbus_internal_la-dbus-timeout.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-timeout.c' object='libdbus_internal_la-dbus-timeout.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-timeout.lo `test -f 'dbus-timeout.c' || echo '$(srcdir)/'`dbus-timeout.c
-
-libdbus_internal_la-dbus-threads.lo: dbus-threads.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-threads.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-threads.Tpo -c -o libdbus_internal_la-dbus-threads.lo `test -f 'dbus-threads.c' || echo '$(srcdir)/'`dbus-threads.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-threads.Tpo $(DEPDIR)/libdbus_internal_la-dbus-threads.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-threads.c' object='libdbus_internal_la-dbus-threads.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-threads.lo `test -f 'dbus-threads.c' || echo '$(srcdir)/'`dbus-threads.c
-
-libdbus_internal_la-dbus-transport.lo: dbus-transport.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-transport.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-transport.Tpo -c -o libdbus_internal_la-dbus-transport.lo `test -f 'dbus-transport.c' || echo '$(srcdir)/'`dbus-transport.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-transport.Tpo $(DEPDIR)/libdbus_internal_la-dbus-transport.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport.c' object='libdbus_internal_la-dbus-transport.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-transport.lo `test -f 'dbus-transport.c' || echo '$(srcdir)/'`dbus-transport.c
-
-libdbus_internal_la-dbus-transport-socket.lo: dbus-transport-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-transport-socket.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-transport-socket.Tpo -c -o libdbus_internal_la-dbus-transport-socket.lo `test -f 'dbus-transport-socket.c' || echo '$(srcdir)/'`dbus-transport-socket.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-transport-socket.Tpo $(DEPDIR)/libdbus_internal_la-dbus-transport-socket.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-socket.c' object='libdbus_internal_la-dbus-transport-socket.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-transport-socket.lo `test -f 'dbus-transport-socket.c' || echo '$(srcdir)/'`dbus-transport-socket.c
-
-libdbus_internal_la-dbus-watch.lo: dbus-watch.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-watch.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-watch.Tpo -c -o libdbus_internal_la-dbus-watch.lo `test -f 'dbus-watch.c' || echo '$(srcdir)/'`dbus-watch.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-watch.Tpo $(DEPDIR)/libdbus_internal_la-dbus-watch.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-watch.c' object='libdbus_internal_la-dbus-watch.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-watch.lo `test -f 'dbus-watch.c' || echo '$(srcdir)/'`dbus-watch.c
-
-libdbus_internal_la-dbus-dataslot.lo: dbus-dataslot.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-dataslot.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-dataslot.Tpo -c -o libdbus_internal_la-dbus-dataslot.lo `test -f 'dbus-dataslot.c' || echo '$(srcdir)/'`dbus-dataslot.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-dataslot.Tpo $(DEPDIR)/libdbus_internal_la-dbus-dataslot.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-dataslot.c' object='libdbus_internal_la-dbus-dataslot.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-dataslot.lo `test -f 'dbus-dataslot.c' || echo '$(srcdir)/'`dbus-dataslot.c
-
-libdbus_internal_la-dbus-file.lo: dbus-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-file.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-file.Tpo -c -o libdbus_internal_la-dbus-file.lo `test -f 'dbus-file.c' || echo '$(srcdir)/'`dbus-file.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-file.Tpo $(DEPDIR)/libdbus_internal_la-dbus-file.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file.c' object='libdbus_internal_la-dbus-file.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-file.lo `test -f 'dbus-file.c' || echo '$(srcdir)/'`dbus-file.c
-
-libdbus_internal_la-dbus-hash.lo: dbus-hash.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-hash.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-hash.Tpo -c -o libdbus_internal_la-dbus-hash.lo `test -f 'dbus-hash.c' || echo '$(srcdir)/'`dbus-hash.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-hash.Tpo $(DEPDIR)/libdbus_internal_la-dbus-hash.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-hash.c' object='libdbus_internal_la-dbus-hash.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-hash.lo `test -f 'dbus-hash.c' || echo '$(srcdir)/'`dbus-hash.c
-
-libdbus_internal_la-dbus-internals.lo: dbus-internals.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-internals.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-internals.Tpo -c -o libdbus_internal_la-dbus-internals.lo `test -f 'dbus-internals.c' || echo '$(srcdir)/'`dbus-internals.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-internals.Tpo $(DEPDIR)/libdbus_internal_la-dbus-internals.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-internals.c' object='libdbus_internal_la-dbus-internals.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-internals.lo `test -f 'dbus-internals.c' || echo '$(srcdir)/'`dbus-internals.c
-
-libdbus_internal_la-dbus-list.lo: dbus-list.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-list.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-list.Tpo -c -o libdbus_internal_la-dbus-list.lo `test -f 'dbus-list.c' || echo '$(srcdir)/'`dbus-list.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-list.Tpo $(DEPDIR)/libdbus_internal_la-dbus-list.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-list.c' object='libdbus_internal_la-dbus-list.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-list.lo `test -f 'dbus-list.c' || echo '$(srcdir)/'`dbus-list.c
-
-libdbus_internal_la-dbus-marshal-basic.lo: dbus-marshal-basic.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-basic.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-basic.Tpo -c -o libdbus_internal_la-dbus-marshal-basic.lo `test -f 'dbus-marshal-basic.c' || echo '$(srcdir)/'`dbus-marshal-basic.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-basic.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-basic.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-basic.c' object='libdbus_internal_la-dbus-marshal-basic.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-basic.lo `test -f 'dbus-marshal-basic.c' || echo '$(srcdir)/'`dbus-marshal-basic.c
-
-libdbus_internal_la-dbus-memory.lo: dbus-memory.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-memory.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-memory.Tpo -c -o libdbus_internal_la-dbus-memory.lo `test -f 'dbus-memory.c' || echo '$(srcdir)/'`dbus-memory.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-memory.Tpo $(DEPDIR)/libdbus_internal_la-dbus-memory.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-memory.c' object='libdbus_internal_la-dbus-memory.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-memory.lo `test -f 'dbus-memory.c' || echo '$(srcdir)/'`dbus-memory.c
-
-libdbus_internal_la-dbus-mempool.lo: dbus-mempool.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-mempool.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-mempool.Tpo -c -o libdbus_internal_la-dbus-mempool.lo `test -f 'dbus-mempool.c' || echo '$(srcdir)/'`dbus-mempool.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-mempool.Tpo $(DEPDIR)/libdbus_internal_la-dbus-mempool.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-mempool.c' object='libdbus_internal_la-dbus-mempool.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-mempool.lo `test -f 'dbus-mempool.c' || echo '$(srcdir)/'`dbus-mempool.c
-
-libdbus_internal_la-dbus-pipe.lo: dbus-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-pipe.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-pipe.Tpo -c -o libdbus_internal_la-dbus-pipe.lo `test -f 'dbus-pipe.c' || echo '$(srcdir)/'`dbus-pipe.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-pipe.Tpo $(DEPDIR)/libdbus_internal_la-dbus-pipe.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe.c' object='libdbus_internal_la-dbus-pipe.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-pipe.lo `test -f 'dbus-pipe.c' || echo '$(srcdir)/'`dbus-pipe.c
-
-libdbus_internal_la-dbus-string.lo: dbus-string.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-string.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-string.Tpo -c -o libdbus_internal_la-dbus-string.lo `test -f 'dbus-string.c' || echo '$(srcdir)/'`dbus-string.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-string.Tpo $(DEPDIR)/libdbus_internal_la-dbus-string.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-string.c' object='libdbus_internal_la-dbus-string.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-string.lo `test -f 'dbus-string.c' || echo '$(srcdir)/'`dbus-string.c
-
-libdbus_internal_la-dbus-server-launchd.lo: dbus-server-launchd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-server-launchd.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-server-launchd.Tpo -c -o libdbus_internal_la-dbus-server-launchd.lo `test -f 'dbus-server-launchd.c' || echo '$(srcdir)/'`dbus-server-launchd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-server-launchd.Tpo $(DEPDIR)/libdbus_internal_la-dbus-server-launchd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-server-launchd.c' object='libdbus_internal_la-dbus-server-launchd.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-server-launchd.lo `test -f 'dbus-server-launchd.c' || echo '$(srcdir)/'`dbus-server-launchd.c
-
-libdbus_internal_la-dbus-file-unix.lo: dbus-file-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-file-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-file-unix.Tpo -c -o libdbus_internal_la-dbus-file-unix.lo `test -f 'dbus-file-unix.c' || echo '$(srcdir)/'`dbus-file-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-file-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-file-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file-unix.c' object='libdbus_internal_la-dbus-file-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-file-unix.lo `test -f 'dbus-file-unix.c' || echo '$(srcdir)/'`dbus-file-unix.c
-
-libdbus_internal_la-dbus-pipe-unix.lo: dbus-pipe-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-pipe-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-pipe-unix.Tpo -c -o libdbus_internal_la-dbus-pipe-unix.lo `test -f 'dbus-pipe-unix.c' || echo '$(srcdir)/'`dbus-pipe-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-pipe-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-pipe-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe-unix.c' object='libdbus_internal_la-dbus-pipe-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-pipe-unix.lo `test -f 'dbus-pipe-unix.c' || echo '$(srcdir)/'`dbus-pipe-unix.c
-
-libdbus_internal_la-dbus-sysdeps-unix.lo: dbus-sysdeps-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-unix.Tpo -c -o libdbus_internal_la-dbus-sysdeps-unix.lo `test -f 'dbus-sysdeps-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-unix.c' object='libdbus_internal_la-dbus-sysdeps-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-unix.lo `test -f 'dbus-sysdeps-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-unix.c
-
-libdbus_internal_la-dbus-sysdeps-pthread.lo: dbus-sysdeps-pthread.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-pthread.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-pthread.Tpo -c -o libdbus_internal_la-dbus-sysdeps-pthread.lo `test -f 'dbus-sysdeps-pthread.c' || echo '$(srcdir)/'`dbus-sysdeps-pthread.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-pthread.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-pthread.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-pthread.c' object='libdbus_internal_la-dbus-sysdeps-pthread.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-pthread.lo `test -f 'dbus-sysdeps-pthread.c' || echo '$(srcdir)/'`dbus-sysdeps-pthread.c
-
-libdbus_internal_la-dbus-transport-unix.lo: dbus-transport-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-transport-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-transport-unix.Tpo -c -o libdbus_internal_la-dbus-transport-unix.lo `test -f 'dbus-transport-unix.c' || echo '$(srcdir)/'`dbus-transport-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-transport-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-transport-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-unix.c' object='libdbus_internal_la-dbus-transport-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-transport-unix.lo `test -f 'dbus-transport-unix.c' || echo '$(srcdir)/'`dbus-transport-unix.c
-
-libdbus_internal_la-dbus-userdb.lo: dbus-userdb.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-userdb.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-userdb.Tpo -c -o libdbus_internal_la-dbus-userdb.lo `test -f 'dbus-userdb.c' || echo '$(srcdir)/'`dbus-userdb.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-userdb.Tpo $(DEPDIR)/libdbus_internal_la-dbus-userdb.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-userdb.c' object='libdbus_internal_la-dbus-userdb.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-userdb.lo `test -f 'dbus-userdb.c' || echo '$(srcdir)/'`dbus-userdb.c
-
-libdbus_internal_la-sd-daemon.lo: sd-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-sd-daemon.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-sd-daemon.Tpo -c -o libdbus_internal_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-sd-daemon.Tpo $(DEPDIR)/libdbus_internal_la-sd-daemon.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sd-daemon.c' object='libdbus_internal_la-sd-daemon.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c
-
-libdbus_internal_la-dbus-sysdeps-wince-glue.lo: dbus-sysdeps-wince-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-wince-glue.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-wince-glue.Tpo -c -o libdbus_internal_la-dbus-sysdeps-wince-glue.lo `test -f 'dbus-sysdeps-wince-glue.c' || echo '$(srcdir)/'`dbus-sysdeps-wince-glue.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-wince-glue.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-wince-glue.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-wince-glue.c' object='libdbus_internal_la-dbus-sysdeps-wince-glue.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-wince-glue.lo `test -f 'dbus-sysdeps-wince-glue.c' || echo '$(srcdir)/'`dbus-sysdeps-wince-glue.c
-
-libdbus_internal_la-dbus-file-win.lo: dbus-file-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-file-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-file-win.Tpo -c -o libdbus_internal_la-dbus-file-win.lo `test -f 'dbus-file-win.c' || echo '$(srcdir)/'`dbus-file-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-file-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-file-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-file-win.c' object='libdbus_internal_la-dbus-file-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-file-win.lo `test -f 'dbus-file-win.c' || echo '$(srcdir)/'`dbus-file-win.c
-
-libdbus_internal_la-dbus-pipe-win.lo: dbus-pipe-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-pipe-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-pipe-win.Tpo -c -o libdbus_internal_la-dbus-pipe-win.lo `test -f 'dbus-pipe-win.c' || echo '$(srcdir)/'`dbus-pipe-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-pipe-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-pipe-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-pipe-win.c' object='libdbus_internal_la-dbus-pipe-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-pipe-win.lo `test -f 'dbus-pipe-win.c' || echo '$(srcdir)/'`dbus-pipe-win.c
-
-libdbus_internal_la-dbus-sysdeps-win.lo: dbus-sysdeps-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-win.Tpo -c -o libdbus_internal_la-dbus-sysdeps-win.lo `test -f 'dbus-sysdeps-win.c' || echo '$(srcdir)/'`dbus-sysdeps-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-win.c' object='libdbus_internal_la-dbus-sysdeps-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-win.lo `test -f 'dbus-sysdeps-win.c' || echo '$(srcdir)/'`dbus-sysdeps-win.c
-
-libdbus_internal_la-dbus-sysdeps-thread-win.lo: dbus-sysdeps-thread-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-thread-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-thread-win.Tpo -c -o libdbus_internal_la-dbus-sysdeps-thread-win.lo `test -f 'dbus-sysdeps-thread-win.c' || echo '$(srcdir)/'`dbus-sysdeps-thread-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-thread-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-thread-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-thread-win.c' object='libdbus_internal_la-dbus-sysdeps-thread-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-thread-win.lo `test -f 'dbus-sysdeps-thread-win.c' || echo '$(srcdir)/'`dbus-sysdeps-thread-win.c
-
-libdbus_internal_la-dbus-transport-win.lo: dbus-transport-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-transport-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-transport-win.Tpo -c -o libdbus_internal_la-dbus-transport-win.lo `test -f 'dbus-transport-win.c' || echo '$(srcdir)/'`dbus-transport-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-transport-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-transport-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-transport-win.c' object='libdbus_internal_la-dbus-transport-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-transport-win.lo `test -f 'dbus-transport-win.c' || echo '$(srcdir)/'`dbus-transport-win.c
-
-libdbus_internal_la-dbus-sysdeps.lo: dbus-sysdeps.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps.Tpo -c -o libdbus_internal_la-dbus-sysdeps.lo `test -f 'dbus-sysdeps.c' || echo '$(srcdir)/'`dbus-sysdeps.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps.c' object='libdbus_internal_la-dbus-sysdeps.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps.lo `test -f 'dbus-sysdeps.c' || echo '$(srcdir)/'`dbus-sysdeps.c
-
-libdbus_internal_la-dbus-asv-util.lo: dbus-asv-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-asv-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Tpo -c -o libdbus_internal_la-dbus-asv-util.lo `test -f 'dbus-asv-util.c' || echo '$(srcdir)/'`dbus-asv-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-asv-util.c' object='libdbus_internal_la-dbus-asv-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-asv-util.lo `test -f 'dbus-asv-util.c' || echo '$(srcdir)/'`dbus-asv-util.c
-
-libdbus_internal_la-dbus-auth-script.lo: dbus-auth-script.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-auth-script.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Tpo -c -o libdbus_internal_la-dbus-auth-script.lo `test -f 'dbus-auth-script.c' || echo '$(srcdir)/'`dbus-auth-script.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Tpo $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-auth-script.c' object='libdbus_internal_la-dbus-auth-script.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-auth-script.lo `test -f 'dbus-auth-script.c' || echo '$(srcdir)/'`dbus-auth-script.c
-
-libdbus_internal_la-dbus-auth-util.lo: dbus-auth-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-auth-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-auth-util.Tpo -c -o libdbus_internal_la-dbus-auth-util.lo `test -f 'dbus-auth-util.c' || echo '$(srcdir)/'`dbus-auth-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-auth-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-auth-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-auth-util.c' object='libdbus_internal_la-dbus-auth-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-auth-util.lo `test -f 'dbus-auth-util.c' || echo '$(srcdir)/'`dbus-auth-util.c
-
-libdbus_internal_la-dbus-credentials-util.lo: dbus-credentials-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-credentials-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-credentials-util.Tpo -c -o libdbus_internal_la-dbus-credentials-util.lo `test -f 'dbus-credentials-util.c' || echo '$(srcdir)/'`dbus-credentials-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-credentials-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-credentials-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-credentials-util.c' object='libdbus_internal_la-dbus-credentials-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-credentials-util.lo `test -f 'dbus-credentials-util.c' || echo '$(srcdir)/'`dbus-credentials-util.c
-
-libdbus_internal_la-dbus-mainloop.lo: dbus-mainloop.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-mainloop.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-mainloop.Tpo -c -o libdbus_internal_la-dbus-mainloop.lo `test -f 'dbus-mainloop.c' || echo '$(srcdir)/'`dbus-mainloop.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-mainloop.Tpo $(DEPDIR)/libdbus_internal_la-dbus-mainloop.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-mainloop.c' object='libdbus_internal_la-dbus-mainloop.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-mainloop.lo `test -f 'dbus-mainloop.c' || echo '$(srcdir)/'`dbus-mainloop.c
-
-libdbus_internal_la-dbus-marshal-byteswap-util.lo: dbus-marshal-byteswap-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-byteswap-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap-util.Tpo -c -o libdbus_internal_la-dbus-marshal-byteswap-util.lo `test -f 'dbus-marshal-byteswap-util.c' || echo '$(srcdir)/'`dbus-marshal-byteswap-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-byteswap-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-byteswap-util.c' object='libdbus_internal_la-dbus-marshal-byteswap-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-byteswap-util.lo `test -f 'dbus-marshal-byteswap-util.c' || echo '$(srcdir)/'`dbus-marshal-byteswap-util.c
-
-libdbus_internal_la-dbus-marshal-recursive-util.lo: dbus-marshal-recursive-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-recursive-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive-util.Tpo -c -o libdbus_internal_la-dbus-marshal-recursive-util.lo `test -f 'dbus-marshal-recursive-util.c' || echo '$(srcdir)/'`dbus-marshal-recursive-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-recursive-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-recursive-util.c' object='libdbus_internal_la-dbus-marshal-recursive-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-recursive-util.lo `test -f 'dbus-marshal-recursive-util.c' || echo '$(srcdir)/'`dbus-marshal-recursive-util.c
-
-libdbus_internal_la-dbus-marshal-validate-util.lo: dbus-marshal-validate-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-marshal-validate-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate-util.Tpo -c -o libdbus_internal_la-dbus-marshal-validate-util.lo `test -f 'dbus-marshal-validate-util.c' || echo '$(srcdir)/'`dbus-marshal-validate-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-marshal-validate-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-marshal-validate-util.c' object='libdbus_internal_la-dbus-marshal-validate-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-marshal-validate-util.lo `test -f 'dbus-marshal-validate-util.c' || echo '$(srcdir)/'`dbus-marshal-validate-util.c
-
-libdbus_internal_la-dbus-message-factory.lo: dbus-message-factory.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-message-factory.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-message-factory.Tpo -c -o libdbus_internal_la-dbus-message-factory.lo `test -f 'dbus-message-factory.c' || echo '$(srcdir)/'`dbus-message-factory.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-message-factory.Tpo $(DEPDIR)/libdbus_internal_la-dbus-message-factory.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-message-factory.c' object='libdbus_internal_la-dbus-message-factory.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-message-factory.lo `test -f 'dbus-message-factory.c' || echo '$(srcdir)/'`dbus-message-factory.c
-
-libdbus_internal_la-dbus-message-util.lo: dbus-message-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-message-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-message-util.Tpo -c -o libdbus_internal_la-dbus-message-util.lo `test -f 'dbus-message-util.c' || echo '$(srcdir)/'`dbus-message-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-message-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-message-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-message-util.c' object='libdbus_internal_la-dbus-message-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-message-util.lo `test -f 'dbus-message-util.c' || echo '$(srcdir)/'`dbus-message-util.c
-
-libdbus_internal_la-dbus-shell.lo: dbus-shell.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-shell.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-shell.Tpo -c -o libdbus_internal_la-dbus-shell.lo `test -f 'dbus-shell.c' || echo '$(srcdir)/'`dbus-shell.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-shell.Tpo $(DEPDIR)/libdbus_internal_la-dbus-shell.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-shell.c' object='libdbus_internal_la-dbus-shell.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-shell.lo `test -f 'dbus-shell.c' || echo '$(srcdir)/'`dbus-shell.c
-
-libdbus_internal_la-dbus-sysdeps-util-unix.lo: dbus-sysdeps-util-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-util-unix.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-unix.Tpo -c -o libdbus_internal_la-dbus-sysdeps-util-unix.lo `test -f 'dbus-sysdeps-util-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-util-unix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-unix.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-unix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-util-unix.c' object='libdbus_internal_la-dbus-sysdeps-util-unix.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-util-unix.lo `test -f 'dbus-sysdeps-util-unix.c' || echo '$(srcdir)/'`dbus-sysdeps-util-unix.c
-
-libdbus_internal_la-dbus-userdb-util.lo: dbus-userdb-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-userdb-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-userdb-util.Tpo -c -o libdbus_internal_la-dbus-userdb-util.lo `test -f 'dbus-userdb-util.c' || echo '$(srcdir)/'`dbus-userdb-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-userdb-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-userdb-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-userdb-util.c' object='libdbus_internal_la-dbus-userdb-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-userdb-util.lo `test -f 'dbus-userdb-util.c' || echo '$(srcdir)/'`dbus-userdb-util.c
-
-libdbus_internal_la-dbus-spawn.lo: dbus-spawn.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-spawn.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-spawn.Tpo -c -o libdbus_internal_la-dbus-spawn.lo `test -f 'dbus-spawn.c' || echo '$(srcdir)/'`dbus-spawn.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-spawn.Tpo $(DEPDIR)/libdbus_internal_la-dbus-spawn.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-spawn.c' object='libdbus_internal_la-dbus-spawn.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-spawn.lo `test -f 'dbus-spawn.c' || echo '$(srcdir)/'`dbus-spawn.c
-
-libdbus_internal_la-dbus-socket-set-epoll.lo: dbus-socket-set-epoll.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-socket-set-epoll.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-socket-set-epoll.Tpo -c -o libdbus_internal_la-dbus-socket-set-epoll.lo `test -f 'dbus-socket-set-epoll.c' || echo '$(srcdir)/'`dbus-socket-set-epoll.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-socket-set-epoll.Tpo $(DEPDIR)/libdbus_internal_la-dbus-socket-set-epoll.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-socket-set-epoll.c' object='libdbus_internal_la-dbus-socket-set-epoll.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-socket-set-epoll.lo `test -f 'dbus-socket-set-epoll.c' || echo '$(srcdir)/'`dbus-socket-set-epoll.c
-
-libdbus_internal_la-dbus-sysdeps-util-win.lo: dbus-sysdeps-util-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-util-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-win.Tpo -c -o libdbus_internal_la-dbus-sysdeps-util-win.lo `test -f 'dbus-sysdeps-util-win.c' || echo '$(srcdir)/'`dbus-sysdeps-util-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-util-win.c' object='libdbus_internal_la-dbus-sysdeps-util-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-util-win.lo `test -f 'dbus-sysdeps-util-win.c' || echo '$(srcdir)/'`dbus-sysdeps-util-win.c
-
-libdbus_internal_la-dbus-spawn-win.lo: dbus-spawn-win.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-spawn-win.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-spawn-win.Tpo -c -o libdbus_internal_la-dbus-spawn-win.lo `test -f 'dbus-spawn-win.c' || echo '$(srcdir)/'`dbus-spawn-win.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-spawn-win.Tpo $(DEPDIR)/libdbus_internal_la-dbus-spawn-win.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-spawn-win.c' object='libdbus_internal_la-dbus-spawn-win.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-spawn-win.lo `test -f 'dbus-spawn-win.c' || echo '$(srcdir)/'`dbus-spawn-win.c
-
-libdbus_internal_la-dbus-socket-set.lo: dbus-socket-set.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-socket-set.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-socket-set.Tpo -c -o libdbus_internal_la-dbus-socket-set.lo `test -f 'dbus-socket-set.c' || echo '$(srcdir)/'`dbus-socket-set.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-socket-set.Tpo $(DEPDIR)/libdbus_internal_la-dbus-socket-set.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-socket-set.c' object='libdbus_internal_la-dbus-socket-set.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-socket-set.lo `test -f 'dbus-socket-set.c' || echo '$(srcdir)/'`dbus-socket-set.c
-
-libdbus_internal_la-dbus-socket-set-poll.lo: dbus-socket-set-poll.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-socket-set-poll.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-socket-set-poll.Tpo -c -o libdbus_internal_la-dbus-socket-set-poll.lo `test -f 'dbus-socket-set-poll.c' || echo '$(srcdir)/'`dbus-socket-set-poll.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-socket-set-poll.Tpo $(DEPDIR)/libdbus_internal_la-dbus-socket-set-poll.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-socket-set-poll.c' object='libdbus_internal_la-dbus-socket-set-poll.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-socket-set-poll.lo `test -f 'dbus-socket-set-poll.c' || echo '$(srcdir)/'`dbus-socket-set-poll.c
-
-libdbus_internal_la-dbus-string-util.lo: dbus-string-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-string-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-string-util.Tpo -c -o libdbus_internal_la-dbus-string-util.lo `test -f 'dbus-string-util.c' || echo '$(srcdir)/'`dbus-string-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-string-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-string-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-string-util.c' object='libdbus_internal_la-dbus-string-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-string-util.lo `test -f 'dbus-string-util.c' || echo '$(srcdir)/'`dbus-string-util.c
-
-libdbus_internal_la-dbus-sysdeps-util.lo: dbus-sysdeps-util.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-sysdeps-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util.Tpo -c -o libdbus_internal_la-dbus-sysdeps-util.lo `test -f 'dbus-sysdeps-util.c' || echo '$(srcdir)/'`dbus-sysdeps-util.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-sysdeps-util.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-sysdeps-util.c' object='libdbus_internal_la-dbus-sysdeps-util.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps-util.lo `test -f 'dbus-sysdeps-util.c' || echo '$(srcdir)/'`dbus-sysdeps-util.c
-
-libdbus_internal_la-dbus-test.lo: dbus-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-test.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-test.Tpo -c -o libdbus_internal_la-dbus-test.lo `test -f 'dbus-test.c' || echo '$(srcdir)/'`dbus-test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-test.Tpo $(DEPDIR)/libdbus_internal_la-dbus-test.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-test.c' object='libdbus_internal_la-dbus-test.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-test.lo `test -f 'dbus-test.c' || echo '$(srcdir)/'`dbus-test.c
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-dbusincludeHEADERS: $(dbusinclude_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(dbusincludedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(dbusincludedir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusincludedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusincludedir)" || exit $$?; \
- done
-
-uninstall-dbusincludeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(dbusincludedir)'; $(am__uninstall_files_from_dir)
-install-nodist_dbusarchincludeHEADERS: $(nodist_dbusarchinclude_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(nodist_dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(dbusarchincludedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(dbusarchincludedir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusarchincludedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusarchincludedir)" || exit $$?; \
- done
-
-uninstall-nodist_dbusarchincludeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(nodist_dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(dbusarchincludedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusincludedir)" "$(DESTDIR)$(dbusarchincludedir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dbusincludeHEADERS \
- install-nodist_dbusarchincludeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES \
- uninstall-nodist_dbusarchincludeHEADERS
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-dbusincludeHEADERS install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-libLTLIBRARIES \
- install-man install-nodist_dbusarchincludeHEADERS install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-dbusincludeHEADERS \
- uninstall-libLTLIBRARIES \
- uninstall-nodist_dbusarchincludeHEADERS
-
-
-@DBUS_WIN_TRUE@.rc.o:
-@DBUS_WIN_TRUE@ $(WINDRES) $< -o $@
-
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
-
-update-systemd:
- curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
- curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-address.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-address.c
deleted file mode 100644
index c4cfbbe597..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-address.c
+++ /dev/null
@@ -1,828 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-address.c Server address parser.
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2004,2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-address.h"
-#include "dbus-internals.h"
-#include "dbus-list.h"
-#include "dbus-string.h"
-#include "dbus-protocol.h"
-
-/**
- * @defgroup DBusAddressInternals Address parsing
- * @ingroup DBusInternals
- * @brief Implementation of parsing addresses of D-Bus servers.
- *
- * @{
- */
-
-/**
- * Internals of DBusAddressEntry
- */
-struct DBusAddressEntry
-{
- DBusString method; /**< The address type (unix, tcp, etc.) */
-
- DBusList *keys; /**< List of keys */
- DBusList *values; /**< List of values */
-};
-
-
-/**
- *
- * Sets #DBUS_ERROR_BAD_ADDRESS.
- * If address_problem_type and address_problem_field are not #NULL,
- * sets an error message about how the field is no good. Otherwise, sets
- * address_problem_other as the error message.
- *
- * @param error the error to set
- * @param address_problem_type the address type of the bad address or #NULL
- * @param address_problem_field the missing field of the bad address or #NULL
- * @param address_problem_other any other error message or #NULL
- */
-void
-_dbus_set_bad_address (DBusError *error,
- const char *address_problem_type,
- const char *address_problem_field,
- const char *address_problem_other)
-{
- if (address_problem_type != NULL)
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Server address of type %s was missing argument %s",
- address_problem_type, address_problem_field);
- else
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Could not parse server address: %s",
- address_problem_other);
-}
-
-/**
- * #TRUE if the byte need not be escaped when found in a dbus address.
- * All other bytes are required to be escaped in a valid address.
- */
-#define _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE(b) \
- (((b) >= 'a' && (b) <= 'z') || \
- ((b) >= 'A' && (b) <= 'Z') || \
- ((b) >= '0' && (b) <= '9') || \
- (b) == '-' || \
- (b) == '_' || \
- (b) == '/' || \
- (b) == '\\' || \
- (b) == '*' || \
- (b) == '.')
-
-/**
- * Appends an escaped version of one string to another string,
- * using the D-Bus address escaping mechanism
- *
- * @param escaped the string to append to
- * @param unescaped the string to escape
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_address_append_escaped (DBusString *escaped,
- const DBusString *unescaped)
-{
- const unsigned char *p;
- const unsigned char *end;
- dbus_bool_t ret;
- int orig_len;
-
- ret = FALSE;
-
- orig_len = _dbus_string_get_length (escaped);
- p = (const unsigned char *) _dbus_string_get_const_data (unescaped);
- end = p + _dbus_string_get_length (unescaped);
- while (p != end)
- {
- if (_DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE (*p))
- {
- if (!_dbus_string_append_byte (escaped, *p))
- goto out;
- }
- else
- {
- if (!_dbus_string_append_byte (escaped, '%'))
- goto out;
- if (!_dbus_string_append_byte_as_hex (escaped, *p))
- goto out;
- }
-
- ++p;
- }
-
- ret = TRUE;
-
- out:
- if (!ret)
- _dbus_string_set_length (escaped, orig_len);
- return ret;
-}
-
-/** @} */ /* End of internals */
-
-static void
-dbus_address_entry_free (DBusAddressEntry *entry)
-{
- DBusList *link;
-
- _dbus_string_free (&entry->method);
-
- link = _dbus_list_get_first_link (&entry->keys);
- while (link != NULL)
- {
- _dbus_string_free (link->data);
- dbus_free (link->data);
-
- link = _dbus_list_get_next_link (&entry->keys, link);
- }
- _dbus_list_clear (&entry->keys);
-
- link = _dbus_list_get_first_link (&entry->values);
- while (link != NULL)
- {
- _dbus_string_free (link->data);
- dbus_free (link->data);
-
- link = _dbus_list_get_next_link (&entry->values, link);
- }
- _dbus_list_clear (&entry->values);
-
- dbus_free (entry);
-}
-
-/**
- * @defgroup DBusAddress Address parsing
- * @ingroup DBus
- * @brief Parsing addresses of D-Bus servers.
- *
- * @{
- */
-
-/**
- * Frees a #NULL-terminated array of address entries.
- *
- * @param entries the array.
- */
-void
-dbus_address_entries_free (DBusAddressEntry **entries)
-{
- int i;
-
- for (i = 0; entries[i] != NULL; i++)
- dbus_address_entry_free (entries[i]);
- dbus_free (entries);
-}
-
-static DBusAddressEntry *
-create_entry (void)
-{
- DBusAddressEntry *entry;
-
- entry = dbus_new0 (DBusAddressEntry, 1);
-
- if (entry == NULL)
- return NULL;
-
- if (!_dbus_string_init (&entry->method))
- {
- dbus_free (entry);
- return NULL;
- }
-
- return entry;
-}
-
-/**
- * Returns the method string of an address entry. For example, given
- * the address entry "tcp:host=example.com" it would return the string
- * "tcp"
- *
- * @param entry the entry.
- * @returns a string describing the method. This string
- * must not be freed.
- */
-const char *
-dbus_address_entry_get_method (DBusAddressEntry *entry)
-{
- return _dbus_string_get_const_data (&entry->method);
-}
-
-/**
- * Returns a value from a key of an entry. For example,
- * given the address "tcp:host=example.com,port=8073" if you asked
- * for the key "host" you would get the value "example.com"
- *
- * The returned value is already unescaped.
- *
- * @param entry the entry.
- * @param key the key.
- * @returns the key value. This string must not be freed.
- */
-const char *
-dbus_address_entry_get_value (DBusAddressEntry *entry,
- const char *key)
-{
- DBusList *values, *keys;
-
- keys = _dbus_list_get_first_link (&entry->keys);
- values = _dbus_list_get_first_link (&entry->values);
-
- while (keys != NULL)
- {
- _dbus_assert (values != NULL);
-
- if (_dbus_string_equal_c_str (keys->data, key))
- return _dbus_string_get_const_data (values->data);
-
- keys = _dbus_list_get_next_link (&entry->keys, keys);
- values = _dbus_list_get_next_link (&entry->values, values);
- }
-
- return NULL;
-}
-
-static dbus_bool_t
-append_unescaped_value (DBusString *unescaped,
- const DBusString *escaped,
- int escaped_start,
- int escaped_len,
- DBusError *error)
-{
- const char *p;
- const char *end;
- dbus_bool_t ret;
-
- ret = FALSE;
-
- p = _dbus_string_get_const_data (escaped) + escaped_start;
- end = p + escaped_len;
- while (p != end)
- {
- if (_DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE (*p))
- {
- if (!_dbus_string_append_byte (unescaped, *p))
- goto out;
- }
- else if (*p == '%')
- {
- /* Efficiency is king */
- char buf[3];
- DBusString hex;
- int hex_end;
-
- ++p;
-
- if ((p + 2) > end)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "In D-Bus address, percent character was not followed by two hex digits");
- goto out;
- }
-
- buf[0] = *p;
- ++p;
- buf[1] = *p;
- buf[2] = '\0';
-
- _dbus_string_init_const (&hex, buf);
-
- if (!_dbus_string_hex_decode (&hex, 0, &hex_end,
- unescaped,
- _dbus_string_get_length (unescaped)))
- goto out;
-
- if (hex_end != 2)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "In D-Bus address, percent character was followed by characters other than hex digits");
- goto out;
- }
- }
- else
- {
- /* Error, should have been escaped */
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "In D-Bus address, character '%c' should have been escaped\n",
- *p);
- goto out;
- }
-
- ++p;
- }
-
- ret = TRUE;
-
- out:
- if (!ret && error && !dbus_error_is_set (error))
- _DBUS_SET_OOM (error);
-
- _dbus_assert (ret || error == NULL || dbus_error_is_set (error));
-
- return ret;
-}
-
-/**
- * Parses an address string of the form:
- *
- * method:key=value,key=value;method:key=value
- *
- * See the D-Bus specification for complete docs on the format.
- *
- * When connecting to an address, the first address entries
- * in the semicolon-separated list should be tried first.
- *
- * @param address the address.
- * @param entry return location to an array of entries.
- * @param array_len return location for array length.
- * @param error address where an error can be returned.
- * @returns #TRUE on success, #FALSE otherwise.
- */
-dbus_bool_t
-dbus_parse_address (const char *address,
- DBusAddressEntry ***entry,
- int *array_len,
- DBusError *error)
-{
- DBusString str;
- int pos, end_pos, len, i;
- DBusList *entries, *link;
- DBusAddressEntry **entry_array;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_string_init_const (&str, address);
-
- entries = NULL;
- pos = 0;
- len = _dbus_string_get_length (&str);
-
- if (len == 0)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Empty address '%s'", address);
- goto error;
- }
-
- while (pos < len)
- {
- DBusAddressEntry *entry;
-
- int found_pos;
-
- entry = create_entry ();
- if (!entry)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-
- goto error;
- }
-
- /* Append the entry */
- if (!_dbus_list_append (&entries, entry))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_address_entry_free (entry);
- goto error;
- }
-
- /* Look for a semi-colon */
- if (!_dbus_string_find (&str, pos, ";", &end_pos))
- end_pos = len;
-
- /* Look for the colon : */
- if (!_dbus_string_find_to (&str, pos, end_pos, ":", &found_pos))
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS, "Address does not contain a colon");
- goto error;
- }
-
- if (!_dbus_string_copy_len (&str, pos, found_pos - pos, &entry->method, 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto error;
- }
-
- pos = found_pos + 1;
-
- while (pos < end_pos)
- {
- int comma_pos, equals_pos;
-
- if (!_dbus_string_find_to (&str, pos, end_pos, ",", &comma_pos))
- comma_pos = end_pos;
-
- if (!_dbus_string_find_to (&str, pos, comma_pos, "=", &equals_pos) ||
- equals_pos == pos || equals_pos + 1 == comma_pos)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "'=' character not found or has no value following it");
- goto error;
- }
- else
- {
- DBusString *key;
- DBusString *value;
-
- key = dbus_new0 (DBusString, 1);
-
- if (!key)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto error;
- }
-
- value = dbus_new0 (DBusString, 1);
- if (!value)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_free (key);
- goto error;
- }
-
- if (!_dbus_string_init (key))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_free (key);
- dbus_free (value);
-
- goto error;
- }
-
- if (!_dbus_string_init (value))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (key);
-
- dbus_free (key);
- dbus_free (value);
- goto error;
- }
-
- if (!_dbus_string_copy_len (&str, pos, equals_pos - pos, key, 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (key);
- _dbus_string_free (value);
-
- dbus_free (key);
- dbus_free (value);
- goto error;
- }
-
- if (!append_unescaped_value (value, &str, equals_pos + 1,
- comma_pos - equals_pos - 1, error))
- {
- _dbus_assert (error == NULL || dbus_error_is_set (error));
- _dbus_string_free (key);
- _dbus_string_free (value);
-
- dbus_free (key);
- dbus_free (value);
- goto error;
- }
-
- if (!_dbus_list_append (&entry->keys, key))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (key);
- _dbus_string_free (value);
-
- dbus_free (key);
- dbus_free (value);
- goto error;
- }
-
- if (!_dbus_list_append (&entry->values, value))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (value);
-
- dbus_free (value);
- goto error;
- }
- }
-
- pos = comma_pos + 1;
- }
-
- pos = end_pos + 1;
- }
-
- *array_len = _dbus_list_get_length (&entries);
-
- entry_array = dbus_new (DBusAddressEntry *, *array_len + 1);
-
- if (!entry_array)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-
- goto error;
- }
-
- entry_array [*array_len] = NULL;
-
- link = _dbus_list_get_first_link (&entries);
- i = 0;
- while (link != NULL)
- {
- entry_array[i] = link->data;
- i++;
- link = _dbus_list_get_next_link (&entries, link);
- }
-
- _dbus_list_clear (&entries);
- *entry = entry_array;
-
- return TRUE;
-
- error:
-
- link = _dbus_list_get_first_link (&entries);
- while (link != NULL)
- {
- dbus_address_entry_free (link->data);
- link = _dbus_list_get_next_link (&entries, link);
- }
-
- _dbus_list_clear (&entries);
-
- return FALSE;
-
-}
-
-/**
- * Escapes the given string as a value in a key=value pair
- * for a D-Bus address.
- *
- * @param value the unescaped value
- * @returns newly-allocated escaped value or #NULL if no memory
- */
-char*
-dbus_address_escape_value (const char *value)
-{
- DBusString escaped;
- DBusString unescaped;
- char *ret;
-
- ret = NULL;
-
- _dbus_string_init_const (&unescaped, value);
-
- if (!_dbus_string_init (&escaped))
- return NULL;
-
- if (!_dbus_address_append_escaped (&escaped, &unescaped))
- goto out;
-
- if (!_dbus_string_steal_data (&escaped, &ret))
- goto out;
-
- out:
- _dbus_string_free (&escaped);
- return ret;
-}
-
-/**
- * Unescapes the given string as a value in a key=value pair
- * for a D-Bus address. Note that dbus_address_entry_get_value()
- * returns an already-unescaped value.
- *
- * @param value the escaped value
- * @param error error to set if the unescaping fails
- * @returns newly-allocated unescaped value or #NULL if no memory
- */
-char*
-dbus_address_unescape_value (const char *value,
- DBusError *error)
-{
- DBusString unescaped;
- DBusString escaped;
- char *ret;
-
- ret = NULL;
-
- _dbus_string_init_const (&escaped, value);
-
- if (!_dbus_string_init (&unescaped))
- return NULL;
-
- if (!append_unescaped_value (&unescaped, &escaped,
- 0, _dbus_string_get_length (&escaped),
- error))
- goto out;
-
- if (!_dbus_string_steal_data (&unescaped, &ret))
- goto out;
-
- out:
- if (ret == NULL && error && !dbus_error_is_set (error))
- _DBUS_SET_OOM (error);
-
- _dbus_assert (ret != NULL || error == NULL || dbus_error_is_set (error));
-
- _dbus_string_free (&unescaped);
- return ret;
-}
-
-/** @} */ /* End of public API */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include "dbus-test.h"
-#include <stdlib.h>
-
-typedef struct
-{
- const char *escaped;
- const char *unescaped;
-} EscapeTest;
-
-static const EscapeTest escape_tests[] = {
- { "abcde", "abcde" },
- { "", "" },
- { "%20%20", " " },
- { "%24", "$" },
- { "%25", "%" },
- { "abc%24", "abc$" },
- { "%24abc", "$abc" },
- { "abc%24abc", "abc$abc" },
- { "/", "/" },
- { "-", "-" },
- { "_", "_" },
- { "A", "A" },
- { "I", "I" },
- { "Z", "Z" },
- { "a", "a" },
- { "i", "i" },
- { "z", "z" },
- /* Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499 */
- { "%c3%b6", "\xc3\xb6" }
-};
-
-static const char* invalid_escaped_values[] = {
- "%a",
- "%q",
- "%az",
- "%%",
- "%$$",
- "abc%a",
- "%axyz",
- "%",
- "$",
- " ",
-};
-
-dbus_bool_t
-_dbus_address_test (void)
-{
- DBusAddressEntry **entries;
- int len;
- DBusError error = DBUS_ERROR_INIT;
- int i;
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (escape_tests))
- {
- const EscapeTest *test = &escape_tests[i];
- char *escaped;
- char *unescaped;
-
- escaped = dbus_address_escape_value (test->unescaped);
- if (escaped == NULL)
- _dbus_assert_not_reached ("oom");
-
- if (strcmp (escaped, test->escaped) != 0)
- {
- _dbus_warn ("Escaped '%s' as '%s' should have been '%s'\n",
- test->unescaped, escaped, test->escaped);
- exit (1);
- }
- dbus_free (escaped);
-
- unescaped = dbus_address_unescape_value (test->escaped, &error);
- if (unescaped == NULL)
- {
- _dbus_warn ("Failed to unescape '%s': %s\n",
- test->escaped, error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- if (strcmp (unescaped, test->unescaped) != 0)
- {
- _dbus_warn ("Unescaped '%s' as '%s' should have been '%s'\n",
- test->escaped, unescaped, test->unescaped);
- exit (1);
- }
- dbus_free (unescaped);
-
- ++i;
- }
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (invalid_escaped_values))
- {
- char *unescaped;
-
- unescaped = dbus_address_unescape_value (invalid_escaped_values[i],
- &error);
- if (unescaped != NULL)
- {
- _dbus_warn ("Should not have successfully unescaped '%s' to '%s'\n",
- invalid_escaped_values[i], unescaped);
- dbus_free (unescaped);
- exit (1);
- }
-
- _dbus_assert (dbus_error_is_set (&error));
- dbus_error_free (&error);
-
- ++i;
- }
-
- if (!dbus_parse_address ("unix:path=/tmp/foo;debug:name=test,sliff=sloff;",
- &entries, &len, &error))
- _dbus_assert_not_reached ("could not parse address");
- _dbus_assert (len == 2);
- _dbus_assert (strcmp (dbus_address_entry_get_value (entries[0], "path"), "/tmp/foo") == 0);
- _dbus_assert (strcmp (dbus_address_entry_get_value (entries[1], "name"), "test") == 0);
- _dbus_assert (strcmp (dbus_address_entry_get_value (entries[1], "sliff"), "sloff") == 0);
-
- dbus_address_entries_free (entries);
-
- /* Different possible errors */
- if (dbus_parse_address ("", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:bar", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:bar,baz", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:bar=foo,baz", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:bar=foo;baz", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:=foo", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:foo=", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- if (dbus_parse_address ("foo:foo,bar=baz", &entries, &len, &error))
- _dbus_assert_not_reached ("Parsed incorrect address.");
- else
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-address.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-address.h
deleted file mode 100644
index e51ef0aee1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-address.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-address.h Server address parser.
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_ADDRESS_H
-#define DBUS_ADDRESS_H
-
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusAddress
- * @{
- */
-
-/** Opaque type representing one of the semicolon-separated items in an address */
-typedef struct DBusAddressEntry DBusAddressEntry;
-
-DBUS_EXPORT
-dbus_bool_t dbus_parse_address (const char *address,
- DBusAddressEntry ***entry,
- int *array_len,
- DBusError *error);
-DBUS_EXPORT
-const char *dbus_address_entry_get_value (DBusAddressEntry *entry,
- const char *key);
-DBUS_EXPORT
-const char *dbus_address_entry_get_method (DBusAddressEntry *entry);
-DBUS_EXPORT
-void dbus_address_entries_free (DBusAddressEntry **entries);
-
-DBUS_EXPORT
-char* dbus_address_escape_value (const char *value);
-DBUS_EXPORT
-char* dbus_address_unescape_value (const char *value,
- DBusError *error);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_ADDRESS_H */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-arch-deps.h.in b/src/3rd_party/dbus-1.7.8/dbus/dbus-arch-deps.h.in
deleted file mode 100644
index dfc3589e7b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-arch-deps.h.in
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.0
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_ARCH_DEPS_H
-#define DBUS_ARCH_DEPS_H
-
-#include <dbus/dbus-macros.h>
-
-DBUS_BEGIN_DECLS
-
-/* D-Bus no longer supports platforms with no 64-bit integer type. */
-#define DBUS_HAVE_INT64 1
-_DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t;
-_DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
-
-#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_INT64_CONSTANT@)
-#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_UINT64_CONSTANT@)
-
-typedef @DBUS_INT32_TYPE@ dbus_int32_t;
-typedef unsigned @DBUS_INT32_TYPE@ dbus_uint32_t;
-
-typedef @DBUS_INT16_TYPE@ dbus_int16_t;
-typedef unsigned @DBUS_INT16_TYPE@ dbus_uint16_t;
-
-/* This is not really arch-dependent, but it's not worth
- * creating an additional generated header just for this
- */
-#define DBUS_MAJOR_VERSION @DBUS_MAJOR_VERSION@
-#define DBUS_MINOR_VERSION @DBUS_MINOR_VERSION@
-#define DBUS_MICRO_VERSION @DBUS_MICRO_VERSION@
-
-#define DBUS_VERSION_STRING "@DBUS_VERSION@"
-
-#define DBUS_VERSION ((@DBUS_MAJOR_VERSION@ << 16) | (@DBUS_MINOR_VERSION@ << 8) | (@DBUS_MICRO_VERSION@))
-
-DBUS_END_DECLS
-
-#endif /* DBUS_ARCH_DEPS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.c
deleted file mode 100644
index 583e41fa11..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* dbus-asv-util.c - utility functions for a{sv}
- *
- * Copyright © 2011-2012 Nokia Corporation
- * Copyright © 2012-2013 Collabora Ltd.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#include <config.h>
-
-#include <dbus/dbus.h>
-
-#include "dbus/dbus-asv-util.h"
-
-/**
- * Convenience function to create a method-call reply whose type is a{sv}
- * (map from string to variant).
- *
- * Append values with 0 or more sequences of _dbus_asv_open_entry(),
- * appending a value to var_iter, and _dbus_asv_close_entry(),
- * then close the a{sv} with _dbus_asv_close() or _dbus_asv_abandon().
- *
- * This must be paired with a call to _dbus_asv_close() or _dbus_asv_abandon().
- *
- * @param message a method call message
- * @param iter an iterator which will be initialized to append to the message
- * @param arr_iter an iterator which will be initialized to append to the array
- * @returns a new message, or #NULL if not enough memory
- */
-DBusMessage *
-_dbus_asv_new_method_return (DBusMessage *message,
- DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- DBusMessage *reply = dbus_message_new_method_return (message);
-
- if (reply == NULL)
- return NULL;
-
- dbus_message_iter_init_append (reply, iter);
-
- if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, "{sv}",
- arr_iter))
- {
- dbus_message_unref (reply);
- return NULL;
- }
-
- return reply;
-}
-
-/*
- * Open a new entry in an a{sv} (map from string to variant).
- *
- * This must be paired with a call to either _dbus_asv_close_entry()
- * or _dbus_asv_abandon_entry().
- *
- * If this function fails, the a{sv} must be abandoned, for instance
- * with _dbus_asv_abandon().
- *
- * @param arr_iter the iterator which is appending to the array
- * @param entry_iter will be initialized to append to the dict-entry
- * @param key a UTF-8 key for the map
- * @param type the type of the variant value, e.g. DBUS_TYPE_STRING_AS_STRING
- * @param var_iter will be initialized to append (i.e. write) to the variant
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-static dbus_bool_t
-_dbus_asv_open_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- const char *key,
- const char *type,
- DBusMessageIter *var_iter)
-{
- if (!dbus_message_iter_open_container (arr_iter, DBUS_TYPE_DICT_ENTRY,
- NULL, entry_iter))
- return FALSE;
-
- if (!dbus_message_iter_append_basic (entry_iter, DBUS_TYPE_STRING, &key))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- if (!dbus_message_iter_open_container (entry_iter, DBUS_TYPE_VARIANT,
- type, var_iter))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- * Closes an a{sv} entry after successfully appending the value.
- *
- * If this function fails, the a{sv} must be abandoned, for instance
- * with _dbus_asv_abandon().
- *
- * @param arr_iter the iterator which is appending to the array
- * @param entry_iter the iterator appending to the dict-entry, will be closed
- * @param var_iter the iterator appending to the variant, will be closed
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-static dbus_bool_t
-_dbus_asv_close_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- DBusMessageIter *var_iter)
-{
- if (!dbus_message_iter_close_container (entry_iter, var_iter))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- if (!dbus_message_iter_close_container (arr_iter, entry_iter))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Closes an a{sv} after successfully appending all values.
- *
- * If this function fails, you must abandon iter and whatever
- * larger data structure (message, etc.) the a{sv} was embedded in.
- *
- * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
- * @param arr_iter the iterator appending to the array, will be closed
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_asv_close (DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- return dbus_message_iter_close_container (iter, arr_iter);
-}
-
-/*
- * Closes an a{sv} entry after unsuccessfully appending a value.
- * You must also abandon the a{sv} itself (for instance with
- * _dbus_asv_abandon()), and abandon whatever larger data structure
- * the a{sv} was embedded in.
- *
- * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
- * @param arr_iter the iterator appending to the array, will be closed
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-static void
-_dbus_asv_abandon_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- DBusMessageIter *var_iter)
-{
- dbus_message_iter_abandon_container (entry_iter, var_iter);
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
-}
-
-/**
- * Closes an a{sv} after unsuccessfully appending a value.
- *
- * You must also abandon whatever larger data structure (message, etc.)
- * the a{sv} was embedded in.
- *
- * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
- * @param arr_iter the iterator appending to the array, will be closed
- */
-void
-_dbus_asv_abandon (DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- dbus_message_iter_abandon_container (iter, arr_iter);
-}
-
-/**
- * Create a new entry in an a{sv} (map from string to variant)
- * with a 32-bit unsigned integer value.
- *
- * If this function fails, the a{sv} must be abandoned, for instance
- * with _dbus_asv_abandon().
- *
- * @param arr_iter the iterator which is appending to the array
- * @param key a UTF-8 key for the map
- * @param value the value
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_asv_add_uint32 (DBusMessageIter *arr_iter,
- const char *key,
- dbus_uint32_t value)
-{
- DBusMessageIter entry_iter, var_iter;
-
- if (!_dbus_asv_open_entry (arr_iter, &entry_iter, key,
- DBUS_TYPE_UINT32_AS_STRING, &var_iter))
- return FALSE;
-
- if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_UINT32,
- &value))
- {
- _dbus_asv_abandon_entry (arr_iter, &entry_iter, &var_iter);
- return FALSE;
- }
-
- if (!_dbus_asv_close_entry (arr_iter, &entry_iter, &var_iter))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Create a new entry in an a{sv} (map from string to variant)
- * with a UTF-8 string value.
- *
- * If this function fails, the a{sv} must be abandoned, for instance
- * with _dbus_asv_abandon().
- *
- * @param arr_iter the iterator which is appending to the array
- * @param key a UTF-8 key for the map
- * @param value the value
- * @returns #TRUE on success, or #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_asv_add_string (DBusMessageIter *arr_iter,
- const char *key,
- const char *value)
-{
- DBusMessageIter entry_iter, var_iter;
-
- if (!_dbus_asv_open_entry (arr_iter, &entry_iter, key,
- DBUS_TYPE_STRING_AS_STRING, &var_iter))
- return FALSE;
-
- if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_STRING,
- &value))
- {
- _dbus_asv_abandon_entry (arr_iter, &entry_iter, &var_iter);
- return FALSE;
- }
-
- if (!_dbus_asv_close_entry (arr_iter, &entry_iter, &var_iter))
- return FALSE;
-
- return TRUE;
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.h
deleted file mode 100644
index 0337260ab9..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-asv-util.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* dbus-asv-util.h - utility functions for a{sv}
- *
- * Copyright © 2011-2012 Nokia Corporation
- * Copyright © 2012-2013 Collabora Ltd.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#ifndef DBUS_ASV_UTIL_H
-#define DBUS_ASV_UTIL_H
-
-#include <dbus/dbus-internals.h>
-
-DBUS_BEGIN_DECLS
-
-DBusMessage *_dbus_asv_new_method_return (DBusMessage *message,
- DBusMessageIter *iter,
- DBusMessageIter *arr_iter);
-dbus_bool_t _dbus_asv_close (DBusMessageIter *iter,
- DBusMessageIter *arr_iter);
-void _dbus_asv_abandon (DBusMessageIter *iter,
- DBusMessageIter *arr_iter);
-
-dbus_bool_t _dbus_asv_add_uint32 (DBusMessageIter *arr_iter,
- const char *key,
- dbus_uint32_t value);
-dbus_bool_t _dbus_asv_add_string (DBusMessageIter *arr_iter,
- const char *key,
- const char *value);
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.c
deleted file mode 100644
index c1f0c88ec7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.c
+++ /dev/null
@@ -1,803 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-auth-script.c Test DBusAuth using a special script file (internal to D-Bus implementation)
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include "dbus-auth-script.h"
-#include "dbus-auth.h"
-#include "dbus-string.h"
-#include "dbus-hash.h"
-#include "dbus-credentials.h"
-#include "dbus-internals.h"
-
-/**
- * @defgroup DBusAuthScript code for running unit test scripts for DBusAuth
- * @ingroup DBusInternals
- * @brief DBusAuth unit test scripting
- *
- * The code in here is used for unit testing, it loads
- * up a script that tests DBusAuth.
- *
- * @{
- */
-
-/* this is slightly different from the other append_quoted_string
- * in dbus-message-builder.c
- */
-static dbus_bool_t
-append_quoted_string (DBusString *dest,
- const DBusString *quoted)
-{
- dbus_bool_t in_quotes = FALSE;
- dbus_bool_t in_backslash = FALSE;
- int i;
-
- i = 0;
- while (i < _dbus_string_get_length (quoted))
- {
- unsigned char b;
-
- b = _dbus_string_get_byte (quoted, i);
-
- if (in_backslash)
- {
- unsigned char a;
-
- if (b == 'r')
- a = '\r';
- else if (b == 'n')
- a = '\n';
- else if (b == '\\')
- a = '\\';
- else
- {
- _dbus_warn ("bad backslashed byte %c\n", b);
- return FALSE;
- }
-
- if (!_dbus_string_append_byte (dest, a))
- return FALSE;
-
- in_backslash = FALSE;
- }
- else if (b == '\\')
- {
- in_backslash = TRUE;
- }
- else if (in_quotes)
- {
- if (b == '\'')
- in_quotes = FALSE;
- else
- {
- if (!_dbus_string_append_byte (dest, b))
- return FALSE;
- }
- }
- else
- {
- if (b == '\'')
- in_quotes = TRUE;
- else if (b == ' ' || b == '\n' || b == '\t')
- break; /* end on whitespace if not quoted */
- else
- {
- if (!_dbus_string_append_byte (dest, b))
- return FALSE;
- }
- }
-
- ++i;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-same_first_word (const DBusString *a,
- const DBusString *b)
-{
- int first_a_blank, first_b_blank;
-
- _dbus_string_find_blank (a, 0, &first_a_blank);
- _dbus_string_find_blank (b, 0, &first_b_blank);
-
- if (first_a_blank != first_b_blank)
- return FALSE;
-
- return _dbus_string_equal_len (a, b, first_a_blank);
-}
-
-static DBusAuthState
-auth_state_from_string (const DBusString *str)
-{
- if (_dbus_string_starts_with_c_str (str, "WAITING_FOR_INPUT"))
- return DBUS_AUTH_STATE_WAITING_FOR_INPUT;
- else if (_dbus_string_starts_with_c_str (str, "WAITING_FOR_MEMORY"))
- return DBUS_AUTH_STATE_WAITING_FOR_MEMORY;
- else if (_dbus_string_starts_with_c_str (str, "HAVE_BYTES_TO_SEND"))
- return DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND;
- else if (_dbus_string_starts_with_c_str (str, "NEED_DISCONNECT"))
- return DBUS_AUTH_STATE_NEED_DISCONNECT;
- else if (_dbus_string_starts_with_c_str (str, "AUTHENTICATED"))
- return DBUS_AUTH_STATE_AUTHENTICATED;
- else
- return -1;
-}
-
-static const char*
-auth_state_to_string (DBusAuthState state)
-{
- switch (state)
- {
- case DBUS_AUTH_STATE_WAITING_FOR_INPUT:
- return "WAITING_FOR_INPUT";
- case DBUS_AUTH_STATE_WAITING_FOR_MEMORY:
- return "WAITING_FOR_MEMORY";
- case DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND:
- return "HAVE_BYTES_TO_SEND";
- case DBUS_AUTH_STATE_NEED_DISCONNECT:
- return "NEED_DISCONNECT";
- case DBUS_AUTH_STATE_AUTHENTICATED:
- return "AUTHENTICATED";
- }
-
- return "unknown";
-}
-
-static char **
-split_string (DBusString *str)
-{
- int i, j, k, count, end;
- char **array;
-
- end = _dbus_string_get_length (str);
-
- i = 0;
- _dbus_string_skip_blank (str, i, &i);
- for (count = 0; i < end; count++)
- {
- _dbus_string_find_blank (str, i, &i);
- _dbus_string_skip_blank (str, i, &i);
- }
-
- array = dbus_new0 (char *, count + 1);
- if (array == NULL)
- return NULL;
-
- i = 0;
- _dbus_string_skip_blank (str, i, &i);
- for (k = 0; k < count; k++)
- {
- _dbus_string_find_blank (str, i, &j);
-
- array[k] = dbus_malloc (j - i + 1);
- if (array[k] == NULL)
- {
- dbus_free_string_array (array);
- return NULL;
- }
- memcpy (array[k],
- _dbus_string_get_const_data_len (str, i, j - i), j - i);
- array[k][j - i] = '\0';
-
- _dbus_string_skip_blank (str, j, &i);
- }
- array[k] = NULL;
-
- return array;
-}
-
-static void
-auth_set_unix_credentials(DBusAuth *auth,
- dbus_uid_t uid,
- dbus_pid_t pid)
-{
- DBusCredentials *credentials;
-
- credentials = _dbus_credentials_new ();
- if (credentials == NULL)
- _dbus_assert_not_reached ("no memory");
-
- if (uid != DBUS_UID_UNSET)
- _dbus_credentials_add_unix_uid (credentials, uid);
- if (pid != DBUS_PID_UNSET)
- _dbus_credentials_add_pid (credentials, pid);
-
- _dbus_auth_set_credentials (auth, credentials);
-
- _dbus_credentials_unref (credentials);
-}
-
-/**
- * Runs an "auth script" which is a script for testing the
- * authentication protocol. Scripts send and receive data, and then
- * include assertions about the state of both ends of the connection
- * after processing the data. A script succeeds if these assertions
- * hold.
- *
- * @param filename the file containing the script to run
- * @returns #TRUE if the script succeeds, #FALSE otherwise
- */
-dbus_bool_t
-_dbus_auth_script_run (const DBusString *filename)
-{
- DBusString file;
- DBusError error = DBUS_ERROR_INIT;
- DBusString line;
- dbus_bool_t retval;
- int line_no;
- DBusAuth *auth;
- DBusString from_auth;
- DBusAuthState state;
- DBusString context;
- DBusString guid;
-
- retval = FALSE;
- auth = NULL;
-
- _dbus_string_init_const (&guid, "5fa01f4202cd837709a3274ca0df9d00");
- _dbus_string_init_const (&context, "org_freedesktop_test");
-
- if (!_dbus_string_init (&file))
- return FALSE;
-
- if (!_dbus_string_init (&line))
- {
- _dbus_string_free (&file);
- return FALSE;
- }
-
- if (!_dbus_string_init (&from_auth))
- {
- _dbus_string_free (&file);
- _dbus_string_free (&line);
- return FALSE;
- }
-
- if (!_dbus_file_get_contents (&file, filename, &error)) {
- _dbus_warn ("Getting contents of %s failed: %s\n",
- _dbus_string_get_const_data (filename), error.message);
- dbus_error_free (&error);
- goto out;
- }
-
- state = DBUS_AUTH_STATE_NEED_DISCONNECT;
- line_no = 0;
-
- next_iteration:
- while (_dbus_string_pop_line (&file, &line))
- {
- line_no += 1;
-
- /* _dbus_warn ("%s\n", _dbus_string_get_const_data (&line)); */
-
- _dbus_string_delete_leading_blanks (&line);
-
- if (auth != NULL)
- {
- while ((state = _dbus_auth_do_work (auth)) ==
- DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND)
- {
- const DBusString *tmp;
- if (_dbus_auth_get_bytes_to_send (auth, &tmp))
- {
- int count = _dbus_string_get_length (tmp);
-
- if (_dbus_string_copy (tmp, 0, &from_auth,
- _dbus_string_get_length (&from_auth)))
- _dbus_auth_bytes_sent (auth, count);
- }
- }
- }
-
- if (_dbus_string_get_length (&line) == 0)
- {
- /* empty line */
- goto next_iteration;
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "#"))
- {
- /* Ignore this comment */
- goto next_iteration;
- }
-#ifdef DBUS_WIN
- else if (_dbus_string_starts_with_c_str (&line,
- "WIN_ONLY"))
- {
- /* Ignore this line */
- goto next_iteration;
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "UNIX_ONLY"))
- {
- /* skip this file */
- _dbus_warn ("skipping unix only auth script\n");
- retval = TRUE;
- goto out;
- }
-#endif
-#ifdef DBUS_UNIX
- else if (_dbus_string_starts_with_c_str (&line,
- "UNIX_ONLY"))
- {
- /* Ignore this line */
- goto next_iteration;
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "WIN_ONLY"))
- {
- /* skip this file */
- _dbus_warn ("skipping windows only auth script\n");
- retval = TRUE;
- goto out;
- }
-#endif
- else if (_dbus_string_starts_with_c_str (&line,
- "CLIENT"))
- {
- DBusCredentials *creds;
-
- if (auth != NULL)
- {
- _dbus_warn ("already created a DBusAuth (CLIENT or SERVER given twice)\n");
- goto out;
- }
-
- auth = _dbus_auth_client_new ();
- if (auth == NULL)
- {
- _dbus_warn ("no memory to create DBusAuth\n");
- goto out;
- }
-
- /* test ref/unref */
- _dbus_auth_ref (auth);
- _dbus_auth_unref (auth);
-
- creds = _dbus_credentials_new_from_current_process ();
- if (creds == NULL)
- {
- _dbus_warn ("no memory for credentials\n");
- _dbus_auth_unref (auth);
- auth = NULL;
- goto out;
- }
-
- if (!_dbus_auth_set_credentials (auth, creds))
- {
- _dbus_warn ("no memory for setting credentials\n");
- _dbus_auth_unref (auth);
- auth = NULL;
- _dbus_credentials_unref (creds);
- goto out;
- }
-
- _dbus_credentials_unref (creds);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "SERVER"))
- {
- DBusCredentials *creds;
-
- if (auth != NULL)
- {
- _dbus_warn ("already created a DBusAuth (CLIENT or SERVER given twice)\n");
- goto out;
- }
-
- auth = _dbus_auth_server_new (&guid);
- if (auth == NULL)
- {
- _dbus_warn ("no memory to create DBusAuth\n");
- goto out;
- }
-
- /* test ref/unref */
- _dbus_auth_ref (auth);
- _dbus_auth_unref (auth);
-
- creds = _dbus_credentials_new_from_current_process ();
- if (creds == NULL)
- {
- _dbus_warn ("no memory for credentials\n");
- _dbus_auth_unref (auth);
- auth = NULL;
- goto out;
- }
-
- if (!_dbus_auth_set_credentials (auth, creds))
- {
- _dbus_warn ("no memory for setting credentials\n");
- _dbus_auth_unref (auth);
- auth = NULL;
- _dbus_credentials_unref (creds);
- goto out;
- }
-
- _dbus_credentials_unref (creds);
-
- _dbus_auth_set_context (auth, &context);
- }
- else if (auth == NULL)
- {
- _dbus_warn ("must specify CLIENT or SERVER\n");
- goto out;
-
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "NO_CREDENTIALS"))
- {
- auth_set_unix_credentials (auth, DBUS_UID_UNSET, DBUS_PID_UNSET);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "ROOT_CREDENTIALS"))
- {
- auth_set_unix_credentials (auth, 0, DBUS_PID_UNSET);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "SILLY_CREDENTIALS"))
- {
- auth_set_unix_credentials (auth, 4312, DBUS_PID_UNSET);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "ALLOWED_MECHS"))
- {
- char **mechs;
-
- _dbus_string_delete_first_word (&line);
- mechs = split_string (&line);
- _dbus_auth_set_mechanisms (auth, (const char **) mechs);
- dbus_free_string_array (mechs);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "SEND"))
- {
- DBusString to_send;
-
- _dbus_string_delete_first_word (&line);
-
- if (!_dbus_string_init (&to_send))
- {
- _dbus_warn ("no memory to allocate string\n");
- goto out;
- }
-
- if (!append_quoted_string (&to_send, &line))
- {
- _dbus_warn ("failed to append quoted string line %d\n",
- line_no);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- _dbus_verbose ("Sending '%s'\n", _dbus_string_get_const_data (&to_send));
-
- if (!_dbus_string_append (&to_send, "\r\n"))
- {
- _dbus_warn ("failed to append \r\n from line %d\n",
- line_no);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- /* Replace USERID_HEX with our username in hex */
- {
- int where;
-
- if (_dbus_string_find (&to_send, 0,
- "USERID_HEX", &where))
- {
- DBusString username;
-
- if (!_dbus_string_init (&username))
- {
- _dbus_warn ("no memory for userid\n");
- _dbus_string_free (&to_send);
- goto out;
- }
-
- if (!_dbus_append_user_from_current_process (&username))
- {
- _dbus_warn ("no memory for userid\n");
- _dbus_string_free (&username);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- _dbus_string_delete (&to_send, where, strlen ("USERID_HEX"));
-
- if (!_dbus_string_hex_encode (&username, 0,
- &to_send, where))
- {
- _dbus_warn ("no memory to subst USERID_HEX\n");
- _dbus_string_free (&username);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- _dbus_string_free (&username);
- }
- else if (_dbus_string_find (&to_send, 0,
- "USERNAME_HEX", &where))
- {
- DBusString username;
-
- if (!_dbus_string_init (&username))
- {
- _dbus_warn ("no memory for username\n");
- _dbus_string_free (&to_send);
- goto out;
- }
-
- if (!_dbus_append_user_from_current_process (&username))
- {
- _dbus_warn ("no memory for username\n");
- _dbus_string_free (&username);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- _dbus_string_delete (&to_send, where, strlen ("USERNAME_HEX"));
-
- if (!_dbus_string_hex_encode (&username, 0,
- &to_send, where))
- {
- _dbus_warn ("no memory to subst USERNAME_HEX\n");
- _dbus_string_free (&username);
- _dbus_string_free (&to_send);
- goto out;
- }
-
- _dbus_string_free (&username);
- }
- }
-
- {
- DBusString *buffer;
-
- _dbus_auth_get_buffer (auth, &buffer);
- if (!_dbus_string_copy (&to_send, 0,
- buffer, _dbus_string_get_length (buffer)))
- {
- _dbus_warn ("not enough memory to call bytes_received, or can't add bytes to auth object already in end state\n");
- _dbus_string_free (&to_send);
- _dbus_auth_return_buffer (auth, buffer, 0);
- goto out;
- }
-
- _dbus_auth_return_buffer (auth, buffer, _dbus_string_get_length (&to_send));
- }
-
- _dbus_string_free (&to_send);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT_STATE"))
- {
- DBusAuthState expected;
-
- _dbus_string_delete_first_word (&line);
-
- expected = auth_state_from_string (&line);
- if (expected < 0)
- {
- _dbus_warn ("bad auth state given to EXPECT_STATE\n");
- goto parse_failed;
- }
-
- if (expected != state)
- {
- _dbus_warn ("expected auth state %s but got %s on line %d\n",
- auth_state_to_string (expected),
- auth_state_to_string (state),
- line_no);
- goto out;
- }
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT_COMMAND"))
- {
- DBusString received;
-
- _dbus_string_delete_first_word (&line);
-
- if (!_dbus_string_init (&received))
- {
- _dbus_warn ("no mem to allocate string received\n");
- goto out;
- }
-
- if (!_dbus_string_pop_line (&from_auth, &received))
- {
- _dbus_warn ("no line popped from the DBusAuth being tested, expected command %s on line %d\n",
- _dbus_string_get_const_data (&line), line_no);
- _dbus_string_free (&received);
- goto out;
- }
-
- if (!same_first_word (&received, &line))
- {
- _dbus_warn ("line %d expected command '%s' and got '%s'\n",
- line_no,
- _dbus_string_get_const_data (&line),
- _dbus_string_get_const_data (&received));
- _dbus_string_free (&received);
- goto out;
- }
-
- _dbus_string_free (&received);
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT_UNUSED"))
- {
- DBusString expected;
- const DBusString *unused;
-
- _dbus_string_delete_first_word (&line);
-
- if (!_dbus_string_init (&expected))
- {
- _dbus_warn ("no mem to allocate string expected\n");
- goto out;
- }
-
- if (!append_quoted_string (&expected, &line))
- {
- _dbus_warn ("failed to append quoted string line %d\n",
- line_no);
- _dbus_string_free (&expected);
- goto out;
- }
-
- _dbus_auth_get_unused_bytes (auth, &unused);
-
- if (_dbus_string_equal (&expected, unused))
- {
- _dbus_auth_delete_unused_bytes (auth);
- _dbus_string_free (&expected);
- }
- else
- {
- _dbus_warn ("Expected unused bytes '%s' and have '%s'\n",
- _dbus_string_get_const_data (&expected),
- _dbus_string_get_const_data (unused));
- _dbus_string_free (&expected);
- goto out;
- }
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT_HAVE_NO_CREDENTIALS"))
- {
- DBusCredentials *authorized_identity;
-
- authorized_identity = _dbus_auth_get_identity (auth);
- if (!_dbus_credentials_are_anonymous (authorized_identity))
- {
- _dbus_warn ("Expected anonymous login or failed login, but some credentials were authorized\n");
- goto out;
- }
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT_HAVE_SOME_CREDENTIALS"))
- {
- DBusCredentials *authorized_identity;
-
- authorized_identity = _dbus_auth_get_identity (auth);
- if (_dbus_credentials_are_anonymous (authorized_identity))
- {
- _dbus_warn ("Expected to have some credentials, but we don't\n");
- goto out;
- }
- }
- else if (_dbus_string_starts_with_c_str (&line,
- "EXPECT"))
- {
- DBusString expected;
-
- _dbus_string_delete_first_word (&line);
-
- if (!_dbus_string_init (&expected))
- {
- _dbus_warn ("no mem to allocate string expected\n");
- goto out;
- }
-
- if (!append_quoted_string (&expected, &line))
- {
- _dbus_warn ("failed to append quoted string line %d\n",
- line_no);
- _dbus_string_free (&expected);
- goto out;
- }
-
- if (_dbus_string_equal_len (&expected, &from_auth,
- _dbus_string_get_length (&expected)))
- {
- _dbus_string_delete (&from_auth, 0,
- _dbus_string_get_length (&expected));
- _dbus_string_free (&expected);
- }
- else
- {
- _dbus_warn ("Expected exact string '%s' and have '%s'\n",
- _dbus_string_get_const_data (&expected),
- _dbus_string_get_const_data (&from_auth));
- _dbus_string_free (&expected);
- goto out;
- }
- }
- else
- goto parse_failed;
-
- goto next_iteration; /* skip parse_failed */
-
- parse_failed:
- {
- _dbus_warn ("couldn't process line %d \"%s\"\n",
- line_no, _dbus_string_get_const_data (&line));
- goto out;
- }
- }
-
- if (auth == NULL)
- {
- _dbus_warn ("Auth script is bogus, did not even have CLIENT or SERVER\n");
- goto out;
- }
- else if (state == DBUS_AUTH_STATE_AUTHENTICATED)
- {
- const DBusString *unused;
-
- _dbus_auth_get_unused_bytes (auth, &unused);
-
- if (_dbus_string_get_length (unused) > 0)
- {
- _dbus_warn ("did not expect unused bytes (scripts must specify explicitly if they are expected)\n");
- goto out;
- }
- }
-
- if (_dbus_string_get_length (&from_auth) > 0)
- {
- _dbus_warn ("script did not have EXPECT_ statements for all the data received from the DBusAuth\n");
- _dbus_warn ("Leftover data: %s\n", _dbus_string_get_const_data (&from_auth));
- goto out;
- }
-
- retval = TRUE;
-
- out:
- if (auth)
- _dbus_auth_unref (auth);
-
- _dbus_string_free (&file);
- _dbus_string_free (&line);
- _dbus_string_free (&from_auth);
-
- return retval;
-}
-
-/** @} */
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.h
deleted file mode 100644
index 39e6c7c48e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-script.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-auth-script.h Test DBusAuth using a special script file (internal to D-Bus implementation)
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_AUTH_SCRIPT_H
-#define DBUS_AUTH_SCRIPT_H
-
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-string.h>
-
-DBUS_BEGIN_DECLS
-
-dbus_bool_t _dbus_auth_script_run (const DBusString *filename);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_AUTH_SCRIPT_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-util.c
deleted file mode 100644
index e88d6696a0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth-util.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-auth-util.c Would be in dbus-auth.c, but only used for tests/bus
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-auth.h"
-
-/**
- * @addtogroup DBusAuth
- * @{
- */
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include "dbus-auth-script.h"
-#include <stdio.h>
-
-static dbus_bool_t
-process_test_subdir (const DBusString *test_base_dir,
- const char *subdir)
-{
- DBusString test_directory;
- DBusString filename;
- DBusDirIter *dir;
- dbus_bool_t retval;
- DBusError error = DBUS_ERROR_INIT;
-
- retval = FALSE;
- dir = NULL;
-
- if (!_dbus_string_init (&test_directory))
- _dbus_assert_not_reached ("didn't allocate test_directory\n");
-
- _dbus_string_init_const (&filename, subdir);
-
- if (!_dbus_string_copy (test_base_dir, 0,
- &test_directory, 0))
- _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
-
- if (!_dbus_concat_dir_and_file (&test_directory, &filename))
- _dbus_assert_not_reached ("couldn't allocate full path");
-
- _dbus_string_free (&filename);
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string\n");
-
- dir = _dbus_directory_open (&test_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- printf ("Testing %s:\n", subdir);
-
- next:
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- if (!_dbus_string_ends_with_c_str (&filename, ".auth-script"))
- {
- _dbus_verbose ("Skipping non-.auth-script file %s\n",
- _dbus_string_get_const_data (&filename));
- _dbus_string_free (&full_path);
- goto next;
- }
-
- printf (" %s\n", _dbus_string_get_const_data (&filename));
-
- if (!_dbus_auth_script_run (&full_path))
- {
- _dbus_string_free (&full_path);
- goto failed;
- }
- else
- _dbus_string_free (&full_path);
- }
-
- if (dbus_error_is_set (&error))
- {
- _dbus_warn ("Could not get next file in %s: %s\n",
- _dbus_string_get_const_data (&test_directory), error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
-
- if (dir)
- _dbus_directory_close (dir);
- _dbus_string_free (&test_directory);
- _dbus_string_free (&filename);
-
- return retval;
-}
-
-static dbus_bool_t
-process_test_dirs (const char *test_data_dir)
-{
- DBusString test_directory;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- _dbus_string_init_const (&test_directory, test_data_dir);
-
- if (!process_test_subdir (&test_directory, "auth"))
- goto failed;
-
- retval = TRUE;
-
- failed:
-
- _dbus_string_free (&test_directory);
-
- return retval;
-}
-
-dbus_bool_t
-_dbus_auth_test (const char *test_data_dir)
-{
-
- if (test_data_dir == NULL)
- return TRUE;
-
- if (!process_test_dirs (test_data_dir))
- return FALSE;
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.c
deleted file mode 100644
index a0f72773a3..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.c
+++ /dev/null
@@ -1,2810 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-auth.c Authentication
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-auth.h"
-#include "dbus-string.h"
-#include "dbus-list.h"
-#include "dbus-internals.h"
-#include "dbus-keyring.h"
-#include "dbus-sha.h"
-#include "dbus-protocol.h"
-#include "dbus-credentials.h"
-
-/**
- * @defgroup DBusAuth Authentication
- * @ingroup DBusInternals
- * @brief DBusAuth object
- *
- * DBusAuth manages the authentication negotiation when a connection
- * is first established, and also manage any encryption used over a
- * connection.
- *
- * @todo some SASL profiles require sending the empty string as a
- * challenge/response, but we don't currently allow that in our
- * protocol.
- *
- * @todo right now sometimes both ends will block waiting for input
- * from the other end, e.g. if there's an error during
- * DBUS_COOKIE_SHA1.
- *
- * @todo the cookie keyring needs to be cached globally not just
- * per-auth (which raises threadsafety issues too)
- *
- * @todo grep FIXME in dbus-auth.c
- */
-
-/**
- * @defgroup DBusAuthInternals Authentication implementation details
- * @ingroup DBusInternals
- * @brief DBusAuth implementation details
- *
- * Private details of authentication code.
- *
- * @{
- */
-
-/**
- * This function appends an initial client response to the given string
- */
-typedef dbus_bool_t (* DBusInitialResponseFunction) (DBusAuth *auth,
- DBusString *response);
-
-/**
- * This function processes a block of data received from the peer.
- * i.e. handles a DATA command.
- */
-typedef dbus_bool_t (* DBusAuthDataFunction) (DBusAuth *auth,
- const DBusString *data);
-
-/**
- * This function encodes a block of data from the peer.
- */
-typedef dbus_bool_t (* DBusAuthEncodeFunction) (DBusAuth *auth,
- const DBusString *data,
- DBusString *encoded);
-
-/**
- * This function decodes a block of data from the peer.
- */
-typedef dbus_bool_t (* DBusAuthDecodeFunction) (DBusAuth *auth,
- const DBusString *data,
- DBusString *decoded);
-
-/**
- * This function is called when the mechanism is abandoned.
- */
-typedef void (* DBusAuthShutdownFunction) (DBusAuth *auth);
-
-/**
- * Virtual table representing a particular auth mechanism.
- */
-typedef struct
-{
- const char *mechanism; /**< Name of the mechanism */
- DBusAuthDataFunction server_data_func; /**< Function on server side for DATA */
- DBusAuthEncodeFunction server_encode_func; /**< Function on server side to encode */
- DBusAuthDecodeFunction server_decode_func; /**< Function on server side to decode */
- DBusAuthShutdownFunction server_shutdown_func; /**< Function on server side to shut down */
- DBusInitialResponseFunction client_initial_response_func; /**< Function on client side to handle initial response */
- DBusAuthDataFunction client_data_func; /**< Function on client side for DATA */
- DBusAuthEncodeFunction client_encode_func; /**< Function on client side for encode */
- DBusAuthDecodeFunction client_decode_func; /**< Function on client side for decode */
- DBusAuthShutdownFunction client_shutdown_func; /**< Function on client side for shutdown */
-} DBusAuthMechanismHandler;
-
-/**
- * Enumeration for the known authentication commands.
- */
-typedef enum {
- DBUS_AUTH_COMMAND_AUTH,
- DBUS_AUTH_COMMAND_CANCEL,
- DBUS_AUTH_COMMAND_DATA,
- DBUS_AUTH_COMMAND_BEGIN,
- DBUS_AUTH_COMMAND_REJECTED,
- DBUS_AUTH_COMMAND_OK,
- DBUS_AUTH_COMMAND_ERROR,
- DBUS_AUTH_COMMAND_UNKNOWN,
- DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD,
- DBUS_AUTH_COMMAND_AGREE_UNIX_FD
-} DBusAuthCommand;
-
-/**
- * Auth state function, determines the reaction to incoming events for
- * a particular state. Returns whether we had enough memory to
- * complete the operation.
- */
-typedef dbus_bool_t (* DBusAuthStateFunction) (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-
-/**
- * Information about a auth state.
- */
-typedef struct
-{
- const char *name; /**< Name of the state */
- DBusAuthStateFunction handler; /**< State function for this state */
-} DBusAuthStateData;
-
-/**
- * Internal members of DBusAuth.
- */
-struct DBusAuth
-{
- int refcount; /**< reference count */
- const char *side; /**< Client or server */
-
- DBusString incoming; /**< Incoming data buffer */
- DBusString outgoing; /**< Outgoing data buffer */
-
- const DBusAuthStateData *state; /**< Current protocol state */
-
- const DBusAuthMechanismHandler *mech; /**< Current auth mechanism */
-
- DBusString identity; /**< Current identity we're authorizing
- * as.
- */
-
- DBusCredentials *credentials; /**< Credentials read from socket
- */
-
- DBusCredentials *authorized_identity; /**< Credentials that are authorized */
-
- DBusCredentials *desired_identity; /**< Identity client has requested */
-
- DBusString context; /**< Cookie scope */
- DBusKeyring *keyring; /**< Keyring for cookie mechanism. */
- int cookie_id; /**< ID of cookie to use */
- DBusString challenge; /**< Challenge sent to client */
-
- char **allowed_mechs; /**< Mechanisms we're allowed to use,
- * or #NULL if we can use any
- */
-
- unsigned int needed_memory : 1; /**< We needed memory to continue since last
- * successful getting something done
- */
- unsigned int already_got_mechanisms : 1; /**< Client already got mech list */
- unsigned int already_asked_for_initial_response : 1; /**< Already sent a blank challenge to get an initial response */
- unsigned int buffer_outstanding : 1; /**< Buffer is "checked out" for reading data into */
-
- unsigned int unix_fd_possible : 1; /**< This side could do unix fd passing */
- unsigned int unix_fd_negotiated : 1; /**< Unix fd was successfully negotiated */
-};
-
-/**
- * "Subclass" of DBusAuth for client side
- */
-typedef struct
-{
- DBusAuth base; /**< Parent class */
-
- DBusList *mechs_to_try; /**< Mechanisms we got from the server that we're going to try using */
-
- DBusString guid_from_server; /**< GUID received from server */
-
-} DBusAuthClient;
-
-/**
- * "Subclass" of DBusAuth for server side.
- */
-typedef struct
-{
- DBusAuth base; /**< Parent class */
-
- int failures; /**< Number of times client has been rejected */
- int max_failures; /**< Number of times we reject before disconnect */
-
- DBusString guid; /**< Our globally unique ID in hex encoding */
-
-} DBusAuthServer;
-
-static void goto_state (DBusAuth *auth,
- const DBusAuthStateData *new_state);
-static dbus_bool_t send_auth (DBusAuth *auth,
- const DBusAuthMechanismHandler *mech);
-static dbus_bool_t send_data (DBusAuth *auth,
- DBusString *data);
-static dbus_bool_t send_rejected (DBusAuth *auth);
-static dbus_bool_t send_error (DBusAuth *auth,
- const char *message);
-static dbus_bool_t send_ok (DBusAuth *auth);
-static dbus_bool_t send_begin (DBusAuth *auth);
-static dbus_bool_t send_cancel (DBusAuth *auth);
-static dbus_bool_t send_negotiate_unix_fd (DBusAuth *auth);
-static dbus_bool_t send_agree_unix_fd (DBusAuth *auth);
-
-/**
- * Client states
- */
-
-static dbus_bool_t handle_server_state_waiting_for_auth (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-static dbus_bool_t handle_server_state_waiting_for_data (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-static dbus_bool_t handle_server_state_waiting_for_begin (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-
-static const DBusAuthStateData server_state_waiting_for_auth = {
- "WaitingForAuth", handle_server_state_waiting_for_auth
-};
-static const DBusAuthStateData server_state_waiting_for_data = {
- "WaitingForData", handle_server_state_waiting_for_data
-};
-static const DBusAuthStateData server_state_waiting_for_begin = {
- "WaitingForBegin", handle_server_state_waiting_for_begin
-};
-
-/**
- * Client states
- */
-
-static dbus_bool_t handle_client_state_waiting_for_data (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-static dbus_bool_t handle_client_state_waiting_for_ok (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-static dbus_bool_t handle_client_state_waiting_for_reject (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-static dbus_bool_t handle_client_state_waiting_for_agree_unix_fd (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args);
-
-static const DBusAuthStateData client_state_need_send_auth = {
- "NeedSendAuth", NULL
-};
-static const DBusAuthStateData client_state_waiting_for_data = {
- "WaitingForData", handle_client_state_waiting_for_data
-};
-static const DBusAuthStateData client_state_waiting_for_ok = {
- "WaitingForOK", handle_client_state_waiting_for_ok
-};
-static const DBusAuthStateData client_state_waiting_for_reject = {
- "WaitingForReject", handle_client_state_waiting_for_reject
-};
-static const DBusAuthStateData client_state_waiting_for_agree_unix_fd = {
- "WaitingForAgreeUnixFD", handle_client_state_waiting_for_agree_unix_fd
-};
-
-/**
- * Common terminal states. Terminal states have handler == NULL.
- */
-
-static const DBusAuthStateData common_state_authenticated = {
- "Authenticated", NULL
-};
-
-static const DBusAuthStateData common_state_need_disconnect = {
- "NeedDisconnect", NULL
-};
-
-static const char auth_side_client[] = "client";
-static const char auth_side_server[] = "server";
-/**
- * @param auth the auth conversation
- * @returns #TRUE if the conversation is the server side
- */
-#define DBUS_AUTH_IS_SERVER(auth) ((auth)->side == auth_side_server)
-/**
- * @param auth the auth conversation
- * @returns #TRUE if the conversation is the client side
- */
-#define DBUS_AUTH_IS_CLIENT(auth) ((auth)->side == auth_side_client)
-/**
- * @param auth the auth conversation
- * @returns auth cast to DBusAuthClient
- */
-#define DBUS_AUTH_CLIENT(auth) ((DBusAuthClient*)(auth))
-/**
- * @param auth the auth conversation
- * @returns auth cast to DBusAuthServer
- */
-#define DBUS_AUTH_SERVER(auth) ((DBusAuthServer*)(auth))
-
-/**
- * The name of the auth ("client" or "server")
- * @param auth the auth conversation
- * @returns a string
- */
-#define DBUS_AUTH_NAME(auth) ((auth)->side)
-
-static DBusAuth*
-_dbus_auth_new (int size)
-{
- DBusAuth *auth;
-
- auth = dbus_malloc0 (size);
- if (auth == NULL)
- return NULL;
-
- auth->refcount = 1;
-
- auth->keyring = NULL;
- auth->cookie_id = -1;
-
- /* note that we don't use the max string length feature,
- * because you can't use that feature if you're going to
- * try to recover from out-of-memory (it creates
- * what looks like unrecoverable inability to alloc
- * more space in the string). But we do handle
- * overlong buffers in _dbus_auth_do_work().
- */
-
- if (!_dbus_string_init (&auth->incoming))
- goto enomem_0;
-
- if (!_dbus_string_init (&auth->outgoing))
- goto enomem_1;
-
- if (!_dbus_string_init (&auth->identity))
- goto enomem_2;
-
- if (!_dbus_string_init (&auth->context))
- goto enomem_3;
-
- if (!_dbus_string_init (&auth->challenge))
- goto enomem_4;
-
- /* default context if none is specified */
- if (!_dbus_string_append (&auth->context, "org_freedesktop_general"))
- goto enomem_5;
-
- auth->credentials = _dbus_credentials_new ();
- if (auth->credentials == NULL)
- goto enomem_6;
-
- auth->authorized_identity = _dbus_credentials_new ();
- if (auth->authorized_identity == NULL)
- goto enomem_7;
-
- auth->desired_identity = _dbus_credentials_new ();
- if (auth->desired_identity == NULL)
- goto enomem_8;
-
- return auth;
-
-#if 0
- enomem_9:
- _dbus_credentials_unref (auth->desired_identity);
-#endif
- enomem_8:
- _dbus_credentials_unref (auth->authorized_identity);
- enomem_7:
- _dbus_credentials_unref (auth->credentials);
- enomem_6:
- /* last alloc was an append to context, which is freed already below */ ;
- enomem_5:
- _dbus_string_free (&auth->challenge);
- enomem_4:
- _dbus_string_free (&auth->context);
- enomem_3:
- _dbus_string_free (&auth->identity);
- enomem_2:
- _dbus_string_free (&auth->outgoing);
- enomem_1:
- _dbus_string_free (&auth->incoming);
- enomem_0:
- dbus_free (auth);
- return NULL;
-}
-
-static void
-shutdown_mech (DBusAuth *auth)
-{
- /* Cancel any auth */
- auth->already_asked_for_initial_response = FALSE;
- _dbus_string_set_length (&auth->identity, 0);
-
- _dbus_credentials_clear (auth->authorized_identity);
- _dbus_credentials_clear (auth->desired_identity);
-
- if (auth->mech != NULL)
- {
- _dbus_verbose ("%s: Shutting down mechanism %s\n",
- DBUS_AUTH_NAME (auth), auth->mech->mechanism);
-
- if (DBUS_AUTH_IS_CLIENT (auth))
- (* auth->mech->client_shutdown_func) (auth);
- else
- (* auth->mech->server_shutdown_func) (auth);
-
- auth->mech = NULL;
- }
-}
-
-/*
- * DBUS_COOKIE_SHA1 mechanism
- */
-
-/* Returns TRUE but with an empty string hash if the
- * cookie_id isn't known. As with all this code
- * TRUE just means we had enough memory.
- */
-static dbus_bool_t
-sha1_compute_hash (DBusAuth *auth,
- int cookie_id,
- const DBusString *server_challenge,
- const DBusString *client_challenge,
- DBusString *hash)
-{
- DBusString cookie;
- DBusString to_hash;
- dbus_bool_t retval;
-
- _dbus_assert (auth->keyring != NULL);
-
- retval = FALSE;
-
- if (!_dbus_string_init (&cookie))
- return FALSE;
-
- if (!_dbus_keyring_get_hex_key (auth->keyring, cookie_id,
- &cookie))
- goto out_0;
-
- if (_dbus_string_get_length (&cookie) == 0)
- {
- retval = TRUE;
- goto out_0;
- }
-
- if (!_dbus_string_init (&to_hash))
- goto out_0;
-
- if (!_dbus_string_copy (server_challenge, 0,
- &to_hash, _dbus_string_get_length (&to_hash)))
- goto out_1;
-
- if (!_dbus_string_append (&to_hash, ":"))
- goto out_1;
-
- if (!_dbus_string_copy (client_challenge, 0,
- &to_hash, _dbus_string_get_length (&to_hash)))
- goto out_1;
-
- if (!_dbus_string_append (&to_hash, ":"))
- goto out_1;
-
- if (!_dbus_string_copy (&cookie, 0,
- &to_hash, _dbus_string_get_length (&to_hash)))
- goto out_1;
-
- if (!_dbus_sha_compute (&to_hash, hash))
- goto out_1;
-
- retval = TRUE;
-
- out_1:
- _dbus_string_zero (&to_hash);
- _dbus_string_free (&to_hash);
- out_0:
- _dbus_string_zero (&cookie);
- _dbus_string_free (&cookie);
- return retval;
-}
-
-/** http://www.ietf.org/rfc/rfc2831.txt suggests at least 64 bits of
- * entropy, we use 128. This is the number of bytes in the random
- * challenge.
- */
-#define N_CHALLENGE_BYTES (128/8)
-
-static dbus_bool_t
-sha1_handle_first_client_response (DBusAuth *auth,
- const DBusString *data)
-{
- /* We haven't sent a challenge yet, we're expecting a desired
- * username from the client.
- */
- DBusString tmp;
- DBusString tmp2;
- dbus_bool_t retval;
- DBusError error;
-
- retval = FALSE;
-
- _dbus_string_set_length (&auth->challenge, 0);
-
- if (_dbus_string_get_length (data) > 0)
- {
- if (_dbus_string_get_length (&auth->identity) > 0)
- {
- /* Tried to send two auth identities, wtf */
- _dbus_verbose ("%s: client tried to send auth identity, but we already have one\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
- else
- {
- /* this is our auth identity */
- if (!_dbus_string_copy (data, 0, &auth->identity, 0))
- return FALSE;
- }
- }
-
- if (!_dbus_credentials_add_from_user (auth->desired_identity, data))
- {
- _dbus_verbose ("%s: Did not get a valid username from client\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
-
- if (!_dbus_string_init (&tmp))
- return FALSE;
-
- if (!_dbus_string_init (&tmp2))
- {
- _dbus_string_free (&tmp);
- return FALSE;
- }
-
- /* we cache the keyring for speed, so here we drop it if it's the
- * wrong one. FIXME caching the keyring here is useless since we use
- * a different DBusAuth for every connection.
- */
- if (auth->keyring &&
- !_dbus_keyring_is_for_credentials (auth->keyring,
- auth->desired_identity))
- {
- _dbus_keyring_unref (auth->keyring);
- auth->keyring = NULL;
- }
-
- if (auth->keyring == NULL)
- {
- dbus_error_init (&error);
- auth->keyring = _dbus_keyring_new_for_credentials (auth->desired_identity,
- &auth->context,
- &error);
-
- if (auth->keyring == NULL)
- {
- if (dbus_error_has_name (&error,
- DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- goto out;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- _dbus_verbose ("%s: Error loading keyring: %s\n",
- DBUS_AUTH_NAME (auth), error.message);
- if (send_rejected (auth))
- retval = TRUE; /* retval is only about mem */
- dbus_error_free (&error);
- goto out;
- }
- }
- else
- {
- _dbus_assert (!dbus_error_is_set (&error));
- }
- }
-
- _dbus_assert (auth->keyring != NULL);
-
- dbus_error_init (&error);
- auth->cookie_id = _dbus_keyring_get_best_key (auth->keyring, &error);
- if (auth->cookie_id < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
- _dbus_verbose ("%s: Could not get a cookie ID to send to client: %s\n",
- DBUS_AUTH_NAME (auth), error.message);
- if (send_rejected (auth))
- retval = TRUE;
- dbus_error_free (&error);
- goto out;
- }
- else
- {
- _dbus_assert (!dbus_error_is_set (&error));
- }
-
- if (!_dbus_string_copy (&auth->context, 0,
- &tmp2, _dbus_string_get_length (&tmp2)))
- goto out;
-
- if (!_dbus_string_append (&tmp2, " "))
- goto out;
-
- if (!_dbus_string_append_int (&tmp2, auth->cookie_id))
- goto out;
-
- if (!_dbus_string_append (&tmp2, " "))
- goto out;
-
- if (!_dbus_generate_random_bytes (&tmp, N_CHALLENGE_BYTES))
- goto out;
-
- _dbus_string_set_length (&auth->challenge, 0);
- if (!_dbus_string_hex_encode (&tmp, 0, &auth->challenge, 0))
- goto out;
-
- if (!_dbus_string_hex_encode (&tmp, 0, &tmp2,
- _dbus_string_get_length (&tmp2)))
- goto out;
-
- if (!send_data (auth, &tmp2))
- goto out;
-
- goto_state (auth, &server_state_waiting_for_data);
- retval = TRUE;
-
- out:
- _dbus_string_zero (&tmp);
- _dbus_string_free (&tmp);
- _dbus_string_zero (&tmp2);
- _dbus_string_free (&tmp2);
-
- return retval;
-}
-
-static dbus_bool_t
-sha1_handle_second_client_response (DBusAuth *auth,
- const DBusString *data)
-{
- /* We are expecting a response which is the hex-encoded client
- * challenge, space, then SHA-1 hash of the concatenation of our
- * challenge, ":", client challenge, ":", secret key, all
- * hex-encoded.
- */
- int i;
- DBusString client_challenge;
- DBusString client_hash;
- dbus_bool_t retval;
- DBusString correct_hash;
-
- retval = FALSE;
-
- if (!_dbus_string_find_blank (data, 0, &i))
- {
- _dbus_verbose ("%s: no space separator in client response\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
-
- if (!_dbus_string_init (&client_challenge))
- goto out_0;
-
- if (!_dbus_string_init (&client_hash))
- goto out_1;
-
- if (!_dbus_string_copy_len (data, 0, i, &client_challenge,
- 0))
- goto out_2;
-
- _dbus_string_skip_blank (data, i, &i);
-
- if (!_dbus_string_copy_len (data, i,
- _dbus_string_get_length (data) - i,
- &client_hash,
- 0))
- goto out_2;
-
- if (_dbus_string_get_length (&client_challenge) == 0 ||
- _dbus_string_get_length (&client_hash) == 0)
- {
- _dbus_verbose ("%s: zero-length client challenge or hash\n",
- DBUS_AUTH_NAME (auth));
- if (send_rejected (auth))
- retval = TRUE;
- goto out_2;
- }
-
- if (!_dbus_string_init (&correct_hash))
- goto out_2;
-
- if (!sha1_compute_hash (auth, auth->cookie_id,
- &auth->challenge,
- &client_challenge,
- &correct_hash))
- goto out_3;
-
- /* if cookie_id was invalid, then we get an empty hash */
- if (_dbus_string_get_length (&correct_hash) == 0)
- {
- if (send_rejected (auth))
- retval = TRUE;
- goto out_3;
- }
-
- if (!_dbus_string_equal (&client_hash, &correct_hash))
- {
- if (send_rejected (auth))
- retval = TRUE;
- goto out_3;
- }
-
- if (!_dbus_credentials_add_credentials (auth->authorized_identity,
- auth->desired_identity))
- goto out_3;
-
- /* Copy process ID from the socket credentials if it's there
- */
- if (!_dbus_credentials_add_credential (auth->authorized_identity,
- DBUS_CREDENTIAL_UNIX_PROCESS_ID,
- auth->credentials))
- goto out_3;
-
- if (!send_ok (auth))
- goto out_3;
-
- _dbus_verbose ("%s: authenticated client using DBUS_COOKIE_SHA1\n",
- DBUS_AUTH_NAME (auth));
-
- retval = TRUE;
-
- out_3:
- _dbus_string_zero (&correct_hash);
- _dbus_string_free (&correct_hash);
- out_2:
- _dbus_string_zero (&client_hash);
- _dbus_string_free (&client_hash);
- out_1:
- _dbus_string_free (&client_challenge);
- out_0:
- return retval;
-}
-
-static dbus_bool_t
-handle_server_data_cookie_sha1_mech (DBusAuth *auth,
- const DBusString *data)
-{
- if (auth->cookie_id < 0)
- return sha1_handle_first_client_response (auth, data);
- else
- return sha1_handle_second_client_response (auth, data);
-}
-
-static void
-handle_server_shutdown_cookie_sha1_mech (DBusAuth *auth)
-{
- auth->cookie_id = -1;
- _dbus_string_set_length (&auth->challenge, 0);
-}
-
-static dbus_bool_t
-handle_client_initial_response_cookie_sha1_mech (DBusAuth *auth,
- DBusString *response)
-{
- DBusString username;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&username))
- return FALSE;
-
- if (!_dbus_append_user_from_current_process (&username))
- goto out_0;
-
- if (!_dbus_string_hex_encode (&username, 0,
- response,
- _dbus_string_get_length (response)))
- goto out_0;
-
- retval = TRUE;
-
- out_0:
- _dbus_string_free (&username);
-
- return retval;
-}
-
-static dbus_bool_t
-handle_client_data_cookie_sha1_mech (DBusAuth *auth,
- const DBusString *data)
-{
- /* The data we get from the server should be the cookie context
- * name, the cookie ID, and the server challenge, separated by
- * spaces. We send back our challenge string and the correct hash.
- */
- dbus_bool_t retval;
- DBusString context;
- DBusString cookie_id_str;
- DBusString server_challenge;
- DBusString client_challenge;
- DBusString correct_hash;
- DBusString tmp;
- int i, j;
- long val;
-
- retval = FALSE;
-
- if (!_dbus_string_find_blank (data, 0, &i))
- {
- if (send_error (auth,
- "Server did not send context/ID/challenge properly"))
- retval = TRUE;
- goto out_0;
- }
-
- if (!_dbus_string_init (&context))
- goto out_0;
-
- if (!_dbus_string_copy_len (data, 0, i,
- &context, 0))
- goto out_1;
-
- _dbus_string_skip_blank (data, i, &i);
- if (!_dbus_string_find_blank (data, i, &j))
- {
- if (send_error (auth,
- "Server did not send context/ID/challenge properly"))
- retval = TRUE;
- goto out_1;
- }
-
- if (!_dbus_string_init (&cookie_id_str))
- goto out_1;
-
- if (!_dbus_string_copy_len (data, i, j - i,
- &cookie_id_str, 0))
- goto out_2;
-
- if (!_dbus_string_init (&server_challenge))
- goto out_2;
-
- i = j;
- _dbus_string_skip_blank (data, i, &i);
- j = _dbus_string_get_length (data);
-
- if (!_dbus_string_copy_len (data, i, j - i,
- &server_challenge, 0))
- goto out_3;
-
- if (!_dbus_keyring_validate_context (&context))
- {
- if (send_error (auth, "Server sent invalid cookie context"))
- retval = TRUE;
- goto out_3;
- }
-
- if (!_dbus_string_parse_int (&cookie_id_str, 0, &val, NULL))
- {
- if (send_error (auth, "Could not parse cookie ID as an integer"))
- retval = TRUE;
- goto out_3;
- }
-
- if (_dbus_string_get_length (&server_challenge) == 0)
- {
- if (send_error (auth, "Empty server challenge string"))
- retval = TRUE;
- goto out_3;
- }
-
- if (auth->keyring == NULL)
- {
- DBusError error;
-
- dbus_error_init (&error);
- auth->keyring = _dbus_keyring_new_for_credentials (NULL,
- &context,
- &error);
-
- if (auth->keyring == NULL)
- {
- if (dbus_error_has_name (&error,
- DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- goto out_3;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET (&error);
-
- _dbus_verbose ("%s: Error loading keyring: %s\n",
- DBUS_AUTH_NAME (auth), error.message);
-
- if (send_error (auth, "Could not load cookie file"))
- retval = TRUE; /* retval is only about mem */
-
- dbus_error_free (&error);
- goto out_3;
- }
- }
- else
- {
- _dbus_assert (!dbus_error_is_set (&error));
- }
- }
-
- _dbus_assert (auth->keyring != NULL);
-
- if (!_dbus_string_init (&tmp))
- goto out_3;
-
- if (!_dbus_generate_random_bytes (&tmp, N_CHALLENGE_BYTES))
- goto out_4;
-
- if (!_dbus_string_init (&client_challenge))
- goto out_4;
-
- if (!_dbus_string_hex_encode (&tmp, 0, &client_challenge, 0))
- goto out_5;
-
- if (!_dbus_string_init (&correct_hash))
- goto out_5;
-
- if (!sha1_compute_hash (auth, val,
- &server_challenge,
- &client_challenge,
- &correct_hash))
- goto out_6;
-
- if (_dbus_string_get_length (&correct_hash) == 0)
- {
- /* couldn't find the cookie ID or something */
- if (send_error (auth, "Don't have the requested cookie ID"))
- retval = TRUE;
- goto out_6;
- }
-
- _dbus_string_set_length (&tmp, 0);
-
- if (!_dbus_string_copy (&client_challenge, 0, &tmp,
- _dbus_string_get_length (&tmp)))
- goto out_6;
-
- if (!_dbus_string_append (&tmp, " "))
- goto out_6;
-
- if (!_dbus_string_copy (&correct_hash, 0, &tmp,
- _dbus_string_get_length (&tmp)))
- goto out_6;
-
- if (!send_data (auth, &tmp))
- goto out_6;
-
- retval = TRUE;
-
- out_6:
- _dbus_string_zero (&correct_hash);
- _dbus_string_free (&correct_hash);
- out_5:
- _dbus_string_free (&client_challenge);
- out_4:
- _dbus_string_zero (&tmp);
- _dbus_string_free (&tmp);
- out_3:
- _dbus_string_free (&server_challenge);
- out_2:
- _dbus_string_free (&cookie_id_str);
- out_1:
- _dbus_string_free (&context);
- out_0:
- return retval;
-}
-
-static void
-handle_client_shutdown_cookie_sha1_mech (DBusAuth *auth)
-{
- auth->cookie_id = -1;
- _dbus_string_set_length (&auth->challenge, 0);
-}
-
-/*
- * EXTERNAL mechanism
- */
-
-static dbus_bool_t
-handle_server_data_external_mech (DBusAuth *auth,
- const DBusString *data)
-{
- if (_dbus_credentials_are_anonymous (auth->credentials))
- {
- _dbus_verbose ("%s: no credentials, mechanism EXTERNAL can't authenticate\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
-
- if (_dbus_string_get_length (data) > 0)
- {
- if (_dbus_string_get_length (&auth->identity) > 0)
- {
- /* Tried to send two auth identities, wtf */
- _dbus_verbose ("%s: client tried to send auth identity, but we already have one\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
- else
- {
- /* this is our auth identity */
- if (!_dbus_string_copy (data, 0, &auth->identity, 0))
- return FALSE;
- }
- }
-
- /* Poke client for an auth identity, if none given */
- if (_dbus_string_get_length (&auth->identity) == 0 &&
- !auth->already_asked_for_initial_response)
- {
- if (send_data (auth, NULL))
- {
- _dbus_verbose ("%s: sending empty challenge asking client for auth identity\n",
- DBUS_AUTH_NAME (auth));
- auth->already_asked_for_initial_response = TRUE;
- goto_state (auth, &server_state_waiting_for_data);
- return TRUE;
- }
- else
- return FALSE;
- }
-
- _dbus_credentials_clear (auth->desired_identity);
-
- /* If auth->identity is still empty here, then client
- * responded with an empty string after we poked it for
- * an initial response. This means to try to auth the
- * identity provided in the credentials.
- */
- if (_dbus_string_get_length (&auth->identity) == 0)
- {
- if (!_dbus_credentials_add_credentials (auth->desired_identity,
- auth->credentials))
- {
- return FALSE; /* OOM */
- }
- }
- else
- {
- if (!_dbus_credentials_add_from_user (auth->desired_identity,
- &auth->identity))
- {
- _dbus_verbose ("%s: could not get credentials from uid string\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
- }
-
- if (_dbus_credentials_are_anonymous (auth->desired_identity))
- {
- _dbus_verbose ("%s: desired user %s is no good\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (&auth->identity));
- return send_rejected (auth);
- }
-
- if (_dbus_credentials_are_superset (auth->credentials,
- auth->desired_identity))
- {
- /* client has authenticated */
- if (!_dbus_credentials_add_credentials (auth->authorized_identity,
- auth->desired_identity))
- return FALSE;
-
- /* also copy process ID from the socket credentials
- */
- if (!_dbus_credentials_add_credential (auth->authorized_identity,
- DBUS_CREDENTIAL_UNIX_PROCESS_ID,
- auth->credentials))
- return FALSE;
-
- /* also copy audit data from the socket credentials
- */
- if (!_dbus_credentials_add_credential (auth->authorized_identity,
- DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID,
- auth->credentials))
- return FALSE;
-
- if (!send_ok (auth))
- return FALSE;
-
- _dbus_verbose ("%s: authenticated client based on socket credentials\n",
- DBUS_AUTH_NAME (auth));
-
- return TRUE;
- }
- else
- {
- _dbus_verbose ("%s: desired identity not found in socket credentials\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
-}
-
-static void
-handle_server_shutdown_external_mech (DBusAuth *auth)
-{
-
-}
-
-static dbus_bool_t
-handle_client_initial_response_external_mech (DBusAuth *auth,
- DBusString *response)
-{
- /* We always append our UID as an initial response, so the server
- * doesn't have to send back an empty challenge to check whether we
- * want to specify an identity. i.e. this avoids a round trip that
- * the spec for the EXTERNAL mechanism otherwise requires.
- */
- DBusString plaintext;
-
- if (!_dbus_string_init (&plaintext))
- return FALSE;
-
- if (!_dbus_append_user_from_current_process (&plaintext))
- goto failed;
-
- if (!_dbus_string_hex_encode (&plaintext, 0,
- response,
- _dbus_string_get_length (response)))
- goto failed;
-
- _dbus_string_free (&plaintext);
-
- return TRUE;
-
- failed:
- _dbus_string_free (&plaintext);
- return FALSE;
-}
-
-static dbus_bool_t
-handle_client_data_external_mech (DBusAuth *auth,
- const DBusString *data)
-{
-
- return TRUE;
-}
-
-static void
-handle_client_shutdown_external_mech (DBusAuth *auth)
-{
-
-}
-
-/*
- * ANONYMOUS mechanism
- */
-
-static dbus_bool_t
-handle_server_data_anonymous_mech (DBusAuth *auth,
- const DBusString *data)
-{
- if (_dbus_string_get_length (data) > 0)
- {
- /* Client is allowed to send "trace" data, the only defined
- * meaning is that if it contains '@' it is an email address,
- * and otherwise it is anything else, and it's supposed to be
- * UTF-8
- */
- if (!_dbus_string_validate_utf8 (data, 0, _dbus_string_get_length (data)))
- {
- _dbus_verbose ("%s: Received invalid UTF-8 trace data from ANONYMOUS client\n",
- DBUS_AUTH_NAME (auth));
- return send_rejected (auth);
- }
-
- _dbus_verbose ("%s: ANONYMOUS client sent trace string: '%s'\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (data));
- }
-
- /* We want to be anonymous (clear in case some other protocol got midway through I guess) */
- _dbus_credentials_clear (auth->desired_identity);
-
- /* Copy process ID from the socket credentials
- */
- if (!_dbus_credentials_add_credential (auth->authorized_identity,
- DBUS_CREDENTIAL_UNIX_PROCESS_ID,
- auth->credentials))
- return FALSE;
-
- /* Anonymous is always allowed */
- if (!send_ok (auth))
- return FALSE;
-
- _dbus_verbose ("%s: authenticated client as anonymous\n",
- DBUS_AUTH_NAME (auth));
-
- return TRUE;
-}
-
-static void
-handle_server_shutdown_anonymous_mech (DBusAuth *auth)
-{
-
-}
-
-static dbus_bool_t
-handle_client_initial_response_anonymous_mech (DBusAuth *auth,
- DBusString *response)
-{
- /* Our initial response is a "trace" string which must be valid UTF-8
- * and must be an email address if it contains '@'.
- * We just send the dbus implementation info, like a user-agent or
- * something, because... why not. There's nothing guaranteed here
- * though, we could change it later.
- */
- DBusString plaintext;
-
- if (!_dbus_string_init (&plaintext))
- return FALSE;
-
- if (!_dbus_string_append (&plaintext,
- "libdbus " DBUS_VERSION_STRING))
- goto failed;
-
- if (!_dbus_string_hex_encode (&plaintext, 0,
- response,
- _dbus_string_get_length (response)))
- goto failed;
-
- _dbus_string_free (&plaintext);
-
- return TRUE;
-
- failed:
- _dbus_string_free (&plaintext);
- return FALSE;
-}
-
-static dbus_bool_t
-handle_client_data_anonymous_mech (DBusAuth *auth,
- const DBusString *data)
-{
-
- return TRUE;
-}
-
-static void
-handle_client_shutdown_anonymous_mech (DBusAuth *auth)
-{
-
-}
-
-/* Put mechanisms here in order of preference.
- * Right now we have:
- *
- * - EXTERNAL checks socket credentials (or in the future, other info from the OS)
- * - DBUS_COOKIE_SHA1 uses a cookie in the home directory, like xauth or ICE
- * - ANONYMOUS checks nothing but doesn't auth the person as a user
- *
- * We might ideally add a mechanism to chain to Cyrus SASL so we can
- * use its mechanisms as well.
- *
- */
-static const DBusAuthMechanismHandler
-all_mechanisms[] = {
- { "EXTERNAL",
- handle_server_data_external_mech,
- NULL, NULL,
- handle_server_shutdown_external_mech,
- handle_client_initial_response_external_mech,
- handle_client_data_external_mech,
- NULL, NULL,
- handle_client_shutdown_external_mech },
- { "DBUS_COOKIE_SHA1",
- handle_server_data_cookie_sha1_mech,
- NULL, NULL,
- handle_server_shutdown_cookie_sha1_mech,
- handle_client_initial_response_cookie_sha1_mech,
- handle_client_data_cookie_sha1_mech,
- NULL, NULL,
- handle_client_shutdown_cookie_sha1_mech },
- { "ANONYMOUS",
- handle_server_data_anonymous_mech,
- NULL, NULL,
- handle_server_shutdown_anonymous_mech,
- handle_client_initial_response_anonymous_mech,
- handle_client_data_anonymous_mech,
- NULL, NULL,
- handle_client_shutdown_anonymous_mech },
- { NULL, NULL }
-};
-
-static const DBusAuthMechanismHandler*
-find_mech (const DBusString *name,
- char **allowed_mechs)
-{
- int i;
-
- if (allowed_mechs != NULL &&
- !_dbus_string_array_contains ((const char**) allowed_mechs,
- _dbus_string_get_const_data (name)))
- return NULL;
-
- i = 0;
- while (all_mechanisms[i].mechanism != NULL)
- {
- if (_dbus_string_equal_c_str (name,
- all_mechanisms[i].mechanism))
-
- return &all_mechanisms[i];
-
- ++i;
- }
-
- return NULL;
-}
-
-static dbus_bool_t
-send_auth (DBusAuth *auth, const DBusAuthMechanismHandler *mech)
-{
- DBusString auth_command;
-
- if (!_dbus_string_init (&auth_command))
- return FALSE;
-
- if (!_dbus_string_append (&auth_command,
- "AUTH "))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
-
- if (!_dbus_string_append (&auth_command,
- mech->mechanism))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
-
- if (mech->client_initial_response_func != NULL)
- {
- if (!_dbus_string_append (&auth_command, " "))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
-
- if (!(* mech->client_initial_response_func) (auth, &auth_command))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
- }
-
- if (!_dbus_string_append (&auth_command,
- "\r\n"))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
-
- if (!_dbus_string_copy (&auth_command, 0,
- &auth->outgoing,
- _dbus_string_get_length (&auth->outgoing)))
- {
- _dbus_string_free (&auth_command);
- return FALSE;
- }
-
- _dbus_string_free (&auth_command);
- shutdown_mech (auth);
- auth->mech = mech;
- goto_state (auth, &client_state_waiting_for_data);
-
- return TRUE;
-}
-
-static dbus_bool_t
-send_data (DBusAuth *auth, DBusString *data)
-{
- int old_len;
-
- if (data == NULL || _dbus_string_get_length (data) == 0)
- return _dbus_string_append (&auth->outgoing, "DATA\r\n");
- else
- {
- old_len = _dbus_string_get_length (&auth->outgoing);
- if (!_dbus_string_append (&auth->outgoing, "DATA "))
- goto out;
-
- if (!_dbus_string_hex_encode (data, 0, &auth->outgoing,
- _dbus_string_get_length (&auth->outgoing)))
- goto out;
-
- if (!_dbus_string_append (&auth->outgoing, "\r\n"))
- goto out;
-
- return TRUE;
-
- out:
- _dbus_string_set_length (&auth->outgoing, old_len);
-
- return FALSE;
- }
-}
-
-static dbus_bool_t
-send_rejected (DBusAuth *auth)
-{
- DBusString command;
- DBusAuthServer *server_auth;
- int i;
-
- if (!_dbus_string_init (&command))
- return FALSE;
-
- if (!_dbus_string_append (&command,
- "REJECTED"))
- goto nomem;
-
- i = 0;
- while (all_mechanisms[i].mechanism != NULL)
- {
- if (!_dbus_string_append (&command,
- " "))
- goto nomem;
-
- if (!_dbus_string_append (&command,
- all_mechanisms[i].mechanism))
- goto nomem;
-
- ++i;
- }
-
- if (!_dbus_string_append (&command, "\r\n"))
- goto nomem;
-
- if (!_dbus_string_copy (&command, 0, &auth->outgoing,
- _dbus_string_get_length (&auth->outgoing)))
- goto nomem;
-
- shutdown_mech (auth);
-
- _dbus_assert (DBUS_AUTH_IS_SERVER (auth));
- server_auth = DBUS_AUTH_SERVER (auth);
- server_auth->failures += 1;
-
- if (server_auth->failures >= server_auth->max_failures)
- goto_state (auth, &common_state_need_disconnect);
- else
- goto_state (auth, &server_state_waiting_for_auth);
-
- _dbus_string_free (&command);
-
- return TRUE;
-
- nomem:
- _dbus_string_free (&command);
- return FALSE;
-}
-
-static dbus_bool_t
-send_error (DBusAuth *auth, const char *message)
-{
- return _dbus_string_append_printf (&auth->outgoing,
- "ERROR \"%s\"\r\n", message);
-}
-
-static dbus_bool_t
-send_ok (DBusAuth *auth)
-{
- int orig_len;
-
- orig_len = _dbus_string_get_length (&auth->outgoing);
-
- if (_dbus_string_append (&auth->outgoing, "OK ") &&
- _dbus_string_copy (& DBUS_AUTH_SERVER (auth)->guid,
- 0,
- &auth->outgoing,
- _dbus_string_get_length (&auth->outgoing)) &&
- _dbus_string_append (&auth->outgoing, "\r\n"))
- {
- goto_state (auth, &server_state_waiting_for_begin);
- return TRUE;
- }
- else
- {
- _dbus_string_set_length (&auth->outgoing, orig_len);
- return FALSE;
- }
-}
-
-static dbus_bool_t
-send_begin (DBusAuth *auth)
-{
-
- if (!_dbus_string_append (&auth->outgoing,
- "BEGIN\r\n"))
- return FALSE;
-
- goto_state (auth, &common_state_authenticated);
- return TRUE;
-}
-
-static dbus_bool_t
-process_ok(DBusAuth *auth,
- const DBusString *args_from_ok) {
-
- int end_of_hex;
-
- /* "args_from_ok" should be the GUID, whitespace already pulled off the front */
- _dbus_assert (_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0);
-
- /* We decode the hex string to binary, using guid_from_server as scratch... */
-
- end_of_hex = 0;
- if (!_dbus_string_hex_decode (args_from_ok, 0, &end_of_hex,
- & DBUS_AUTH_CLIENT (auth)->guid_from_server, 0))
- return FALSE;
-
- /* now clear out the scratch */
- _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
-
- if (end_of_hex != _dbus_string_get_length (args_from_ok) ||
- end_of_hex == 0)
- {
- _dbus_verbose ("Bad GUID from server, parsed %d bytes and had %d bytes from server\n",
- end_of_hex, _dbus_string_get_length (args_from_ok));
- goto_state (auth, &common_state_need_disconnect);
- return TRUE;
- }
-
- if (!_dbus_string_copy (args_from_ok, 0, &DBUS_AUTH_CLIENT (auth)->guid_from_server, 0)) {
- _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
- return FALSE;
- }
-
- _dbus_verbose ("Got GUID '%s' from the server\n",
- _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
-
- if (auth->unix_fd_possible)
- return send_negotiate_unix_fd(auth);
-
- _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
- return send_begin (auth);
-}
-
-static dbus_bool_t
-send_cancel (DBusAuth *auth)
-{
- if (_dbus_string_append (&auth->outgoing, "CANCEL\r\n"))
- {
- goto_state (auth, &client_state_waiting_for_reject);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static dbus_bool_t
-process_data (DBusAuth *auth,
- const DBusString *args,
- DBusAuthDataFunction data_func)
-{
- int end;
- DBusString decoded;
-
- if (!_dbus_string_init (&decoded))
- return FALSE;
-
- if (!_dbus_string_hex_decode (args, 0, &end, &decoded, 0))
- {
- _dbus_string_free (&decoded);
- return FALSE;
- }
-
- if (_dbus_string_get_length (args) != end)
- {
- _dbus_string_free (&decoded);
- if (!send_error (auth, "Invalid hex encoding"))
- return FALSE;
-
- return TRUE;
- }
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- if (_dbus_string_validate_ascii (&decoded, 0,
- _dbus_string_get_length (&decoded)))
- _dbus_verbose ("%s: data: '%s'\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (&decoded));
-#endif
-
- if (!(* data_func) (auth, &decoded))
- {
- _dbus_string_free (&decoded);
- return FALSE;
- }
-
- _dbus_string_free (&decoded);
- return TRUE;
-}
-
-static dbus_bool_t
-send_negotiate_unix_fd (DBusAuth *auth)
-{
- if (!_dbus_string_append (&auth->outgoing,
- "NEGOTIATE_UNIX_FD\r\n"))
- return FALSE;
-
- goto_state (auth, &client_state_waiting_for_agree_unix_fd);
- return TRUE;
-}
-
-static dbus_bool_t
-send_agree_unix_fd (DBusAuth *auth)
-{
- _dbus_assert(auth->unix_fd_possible);
-
- auth->unix_fd_negotiated = TRUE;
- _dbus_verbose("Agreed to UNIX FD passing\n");
-
- if (!_dbus_string_append (&auth->outgoing,
- "AGREE_UNIX_FD\r\n"))
- return FALSE;
-
- goto_state (auth, &server_state_waiting_for_begin);
- return TRUE;
-}
-
-static dbus_bool_t
-handle_auth (DBusAuth *auth, const DBusString *args)
-{
- if (_dbus_string_get_length (args) == 0)
- {
- /* No args to the auth, send mechanisms */
- if (!send_rejected (auth))
- return FALSE;
-
- return TRUE;
- }
- else
- {
- int i;
- DBusString mech;
- DBusString hex_response;
-
- _dbus_string_find_blank (args, 0, &i);
-
- if (!_dbus_string_init (&mech))
- return FALSE;
-
- if (!_dbus_string_init (&hex_response))
- {
- _dbus_string_free (&mech);
- return FALSE;
- }
-
- if (!_dbus_string_copy_len (args, 0, i, &mech, 0))
- goto failed;
-
- _dbus_string_skip_blank (args, i, &i);
- if (!_dbus_string_copy (args, i, &hex_response, 0))
- goto failed;
-
- auth->mech = find_mech (&mech, auth->allowed_mechs);
- if (auth->mech != NULL)
- {
- _dbus_verbose ("%s: Trying mechanism %s\n",
- DBUS_AUTH_NAME (auth),
- auth->mech->mechanism);
-
- if (!process_data (auth, &hex_response,
- auth->mech->server_data_func))
- goto failed;
- }
- else
- {
- /* Unsupported mechanism */
- _dbus_verbose ("%s: Unsupported mechanism %s\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (&mech));
-
- if (!send_rejected (auth))
- goto failed;
- }
-
- _dbus_string_free (&mech);
- _dbus_string_free (&hex_response);
-
- return TRUE;
-
- failed:
- auth->mech = NULL;
- _dbus_string_free (&mech);
- _dbus_string_free (&hex_response);
- return FALSE;
- }
-}
-
-static dbus_bool_t
-handle_server_state_waiting_for_auth (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_AUTH:
- return handle_auth (auth, args);
-
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_DATA:
- return send_error (auth, "Not currently in an auth conversation");
-
- case DBUS_AUTH_COMMAND_BEGIN:
- goto_state (auth, &common_state_need_disconnect);
- return TRUE;
-
- case DBUS_AUTH_COMMAND_ERROR:
- return send_rejected (auth);
-
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- return send_error (auth, "Need to authenticate first");
-
- case DBUS_AUTH_COMMAND_REJECTED:
- case DBUS_AUTH_COMMAND_OK:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
- }
-}
-
-static dbus_bool_t
-handle_server_state_waiting_for_data (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_AUTH:
- return send_error (auth, "Sent AUTH while another AUTH in progress");
-
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_ERROR:
- return send_rejected (auth);
-
- case DBUS_AUTH_COMMAND_DATA:
- return process_data (auth, args, auth->mech->server_data_func);
-
- case DBUS_AUTH_COMMAND_BEGIN:
- goto_state (auth, &common_state_need_disconnect);
- return TRUE;
-
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- return send_error (auth, "Need to authenticate first");
-
- case DBUS_AUTH_COMMAND_REJECTED:
- case DBUS_AUTH_COMMAND_OK:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
- }
-}
-
-static dbus_bool_t
-handle_server_state_waiting_for_begin (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_AUTH:
- return send_error (auth, "Sent AUTH while expecting BEGIN");
-
- case DBUS_AUTH_COMMAND_DATA:
- return send_error (auth, "Sent DATA while expecting BEGIN");
-
- case DBUS_AUTH_COMMAND_BEGIN:
- goto_state (auth, &common_state_authenticated);
- return TRUE;
-
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- if (auth->unix_fd_possible)
- return send_agree_unix_fd(auth);
- else
- return send_error(auth, "Unix FD passing not supported, not authenticated or otherwise not possible");
-
- case DBUS_AUTH_COMMAND_REJECTED:
- case DBUS_AUTH_COMMAND_OK:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
-
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_ERROR:
- return send_rejected (auth);
- }
-}
-
-/* return FALSE if no memory, TRUE if all OK */
-static dbus_bool_t
-get_word (const DBusString *str,
- int *start,
- DBusString *word)
-{
- int i;
-
- _dbus_string_skip_blank (str, *start, start);
- _dbus_string_find_blank (str, *start, &i);
-
- if (i > *start)
- {
- if (!_dbus_string_copy_len (str, *start, i - *start, word, 0))
- return FALSE;
-
- *start = i;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-record_mechanisms (DBusAuth *auth,
- const DBusString *args)
-{
- int next;
- int len;
-
- if (auth->already_got_mechanisms)
- return TRUE;
-
- len = _dbus_string_get_length (args);
-
- next = 0;
- while (next < len)
- {
- DBusString m;
- const DBusAuthMechanismHandler *mech;
-
- if (!_dbus_string_init (&m))
- goto nomem;
-
- if (!get_word (args, &next, &m))
- {
- _dbus_string_free (&m);
- goto nomem;
- }
-
- mech = find_mech (&m, auth->allowed_mechs);
-
- if (mech != NULL)
- {
- /* FIXME right now we try mechanisms in the order
- * the server lists them; should we do them in
- * some more deterministic order?
- *
- * Probably in all_mechanisms order, our order of
- * preference. Of course when the server is us,
- * it lists things in that order anyhow.
- */
-
- if (mech != &all_mechanisms[0])
- {
- _dbus_verbose ("%s: Adding mechanism %s to list we will try\n",
- DBUS_AUTH_NAME (auth), mech->mechanism);
-
- if (!_dbus_list_append (& DBUS_AUTH_CLIENT (auth)->mechs_to_try,
- (void*) mech))
- {
- _dbus_string_free (&m);
- goto nomem;
- }
- }
- else
- {
- _dbus_verbose ("%s: Already tried mechanism %s; not adding to list we will try\n",
- DBUS_AUTH_NAME (auth), mech->mechanism);
- }
- }
- else
- {
- _dbus_verbose ("%s: Server offered mechanism \"%s\" that we don't know how to use\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (&m));
- }
-
- _dbus_string_free (&m);
- }
-
- auth->already_got_mechanisms = TRUE;
-
- return TRUE;
-
- nomem:
- _dbus_list_clear (& DBUS_AUTH_CLIENT (auth)->mechs_to_try);
-
- return FALSE;
-}
-
-static dbus_bool_t
-process_rejected (DBusAuth *auth, const DBusString *args)
-{
- const DBusAuthMechanismHandler *mech;
- DBusAuthClient *client;
-
- client = DBUS_AUTH_CLIENT (auth);
-
- if (!auth->already_got_mechanisms)
- {
- if (!record_mechanisms (auth, args))
- return FALSE;
- }
-
- if (DBUS_AUTH_CLIENT (auth)->mechs_to_try != NULL)
- {
- mech = client->mechs_to_try->data;
-
- if (!send_auth (auth, mech))
- return FALSE;
-
- _dbus_list_pop_first (&client->mechs_to_try);
-
- _dbus_verbose ("%s: Trying mechanism %s\n",
- DBUS_AUTH_NAME (auth),
- mech->mechanism);
- }
- else
- {
- /* Give up */
- _dbus_verbose ("%s: Disconnecting because we are out of mechanisms to try using\n",
- DBUS_AUTH_NAME (auth));
- goto_state (auth, &common_state_need_disconnect);
- }
-
- return TRUE;
-}
-
-
-static dbus_bool_t
-handle_client_state_waiting_for_data (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- _dbus_assert (auth->mech != NULL);
-
- switch (command)
- {
- case DBUS_AUTH_COMMAND_DATA:
- return process_data (auth, args, auth->mech->client_data_func);
-
- case DBUS_AUTH_COMMAND_REJECTED:
- return process_rejected (auth, args);
-
- case DBUS_AUTH_COMMAND_OK:
- return process_ok(auth, args);
-
- case DBUS_AUTH_COMMAND_ERROR:
- return send_cancel (auth);
-
- case DBUS_AUTH_COMMAND_AUTH:
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_BEGIN:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
- }
-}
-
-static dbus_bool_t
-handle_client_state_waiting_for_ok (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_REJECTED:
- return process_rejected (auth, args);
-
- case DBUS_AUTH_COMMAND_OK:
- return process_ok(auth, args);
-
- case DBUS_AUTH_COMMAND_DATA:
- case DBUS_AUTH_COMMAND_ERROR:
- return send_cancel (auth);
-
- case DBUS_AUTH_COMMAND_AUTH:
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_BEGIN:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
- }
-}
-
-static dbus_bool_t
-handle_client_state_waiting_for_reject (DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_REJECTED:
- return process_rejected (auth, args);
-
- case DBUS_AUTH_COMMAND_AUTH:
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_DATA:
- case DBUS_AUTH_COMMAND_BEGIN:
- case DBUS_AUTH_COMMAND_OK:
- case DBUS_AUTH_COMMAND_ERROR:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- default:
- goto_state (auth, &common_state_need_disconnect);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-handle_client_state_waiting_for_agree_unix_fd(DBusAuth *auth,
- DBusAuthCommand command,
- const DBusString *args)
-{
- switch (command)
- {
- case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
- _dbus_assert(auth->unix_fd_possible);
- auth->unix_fd_negotiated = TRUE;
- _dbus_verbose("Successfully negotiated UNIX FD passing\n");
- return send_begin (auth);
-
- case DBUS_AUTH_COMMAND_ERROR:
- _dbus_assert(auth->unix_fd_possible);
- auth->unix_fd_negotiated = FALSE;
- _dbus_verbose("Failed to negotiate UNIX FD passing\n");
- return send_begin (auth);
-
- case DBUS_AUTH_COMMAND_OK:
- case DBUS_AUTH_COMMAND_DATA:
- case DBUS_AUTH_COMMAND_REJECTED:
- case DBUS_AUTH_COMMAND_AUTH:
- case DBUS_AUTH_COMMAND_CANCEL:
- case DBUS_AUTH_COMMAND_BEGIN:
- case DBUS_AUTH_COMMAND_UNKNOWN:
- case DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD:
- default:
- return send_error (auth, "Unknown command");
- }
-}
-
-/**
- * Mapping from command name to enum
- */
-typedef struct {
- const char *name; /**< Name of the command */
- DBusAuthCommand command; /**< Corresponding enum */
-} DBusAuthCommandName;
-
-static const DBusAuthCommandName auth_command_names[] = {
- { "AUTH", DBUS_AUTH_COMMAND_AUTH },
- { "CANCEL", DBUS_AUTH_COMMAND_CANCEL },
- { "DATA", DBUS_AUTH_COMMAND_DATA },
- { "BEGIN", DBUS_AUTH_COMMAND_BEGIN },
- { "REJECTED", DBUS_AUTH_COMMAND_REJECTED },
- { "OK", DBUS_AUTH_COMMAND_OK },
- { "ERROR", DBUS_AUTH_COMMAND_ERROR },
- { "NEGOTIATE_UNIX_FD", DBUS_AUTH_COMMAND_NEGOTIATE_UNIX_FD },
- { "AGREE_UNIX_FD", DBUS_AUTH_COMMAND_AGREE_UNIX_FD }
-};
-
-static DBusAuthCommand
-lookup_command_from_name (DBusString *command)
-{
- int i;
-
- for (i = 0; i < _DBUS_N_ELEMENTS (auth_command_names); i++)
- {
- if (_dbus_string_equal_c_str (command,
- auth_command_names[i].name))
- return auth_command_names[i].command;
- }
-
- return DBUS_AUTH_COMMAND_UNKNOWN;
-}
-
-static void
-goto_state (DBusAuth *auth,
- const DBusAuthStateData *state)
-{
- _dbus_verbose ("%s: going from state %s to state %s\n",
- DBUS_AUTH_NAME (auth),
- auth->state->name,
- state->name);
-
- auth->state = state;
-}
-
-/* returns whether to call it again right away */
-static dbus_bool_t
-process_command (DBusAuth *auth)
-{
- DBusAuthCommand command;
- DBusString line;
- DBusString args;
- int eol;
- int i, j;
- dbus_bool_t retval;
-
- /* _dbus_verbose ("%s: trying process_command()\n"); */
-
- retval = FALSE;
-
- eol = 0;
- if (!_dbus_string_find (&auth->incoming, 0, "\r\n", &eol))
- return FALSE;
-
- if (!_dbus_string_init (&line))
- {
- auth->needed_memory = TRUE;
- return FALSE;
- }
-
- if (!_dbus_string_init (&args))
- {
- _dbus_string_free (&line);
- auth->needed_memory = TRUE;
- return FALSE;
- }
-
- if (!_dbus_string_copy_len (&auth->incoming, 0, eol, &line, 0))
- goto out;
-
- if (!_dbus_string_validate_ascii (&line, 0,
- _dbus_string_get_length (&line)))
- {
- _dbus_verbose ("%s: Command contained non-ASCII chars or embedded nul\n",
- DBUS_AUTH_NAME (auth));
- if (!send_error (auth, "Command contained non-ASCII"))
- goto out;
- else
- goto next_command;
- }
-
- _dbus_verbose ("%s: got command \"%s\"\n",
- DBUS_AUTH_NAME (auth),
- _dbus_string_get_const_data (&line));
-
- _dbus_string_find_blank (&line, 0, &i);
- _dbus_string_skip_blank (&line, i, &j);
-
- if (j > i)
- _dbus_string_delete (&line, i, j - i);
-
- if (!_dbus_string_move (&line, i, &args, 0))
- goto out;
-
- /* FIXME 1.0 we should probably validate that only the allowed
- * chars are in the command name
- */
-
- command = lookup_command_from_name (&line);
- if (!(* auth->state->handler) (auth, command, &args))
- goto out;
-
- next_command:
-
- /* We've succeeded in processing the whole command so drop it out
- * of the incoming buffer and return TRUE to try another command.
- */
-
- _dbus_string_delete (&auth->incoming, 0, eol);
-
- /* kill the \r\n */
- _dbus_string_delete (&auth->incoming, 0, 2);
-
- retval = TRUE;
-
- out:
- _dbus_string_free (&args);
- _dbus_string_free (&line);
-
- if (!retval)
- auth->needed_memory = TRUE;
- else
- auth->needed_memory = FALSE;
-
- return retval;
-}
-
-
-/** @} */
-
-/**
- * @addtogroup DBusAuth
- * @{
- */
-
-/**
- * Creates a new auth conversation object for the server side.
- * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
- * for full details on what this object does.
- *
- * @returns the new object or #NULL if no memory
- */
-DBusAuth*
-_dbus_auth_server_new (const DBusString *guid)
-{
- DBusAuth *auth;
- DBusAuthServer *server_auth;
- DBusString guid_copy;
-
- if (!_dbus_string_init (&guid_copy))
- return NULL;
-
- if (!_dbus_string_copy (guid, 0, &guid_copy, 0))
- {
- _dbus_string_free (&guid_copy);
- return NULL;
- }
-
- auth = _dbus_auth_new (sizeof (DBusAuthServer));
- if (auth == NULL)
- {
- _dbus_string_free (&guid_copy);
- return NULL;
- }
-
- auth->side = auth_side_server;
- auth->state = &server_state_waiting_for_auth;
-
- server_auth = DBUS_AUTH_SERVER (auth);
-
- server_auth->guid = guid_copy;
-
- /* perhaps this should be per-mechanism with a lower
- * max
- */
- server_auth->failures = 0;
- server_auth->max_failures = 6;
-
- return auth;
-}
-
-/**
- * Creates a new auth conversation object for the client side.
- * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
- * for full details on what this object does.
- *
- * @returns the new object or #NULL if no memory
- */
-DBusAuth*
-_dbus_auth_client_new (void)
-{
- DBusAuth *auth;
- DBusString guid_str;
-
- if (!_dbus_string_init (&guid_str))
- return NULL;
-
- auth = _dbus_auth_new (sizeof (DBusAuthClient));
- if (auth == NULL)
- {
- _dbus_string_free (&guid_str);
- return NULL;
- }
-
- DBUS_AUTH_CLIENT (auth)->guid_from_server = guid_str;
-
- auth->side = auth_side_client;
- auth->state = &client_state_need_send_auth;
-
- /* Start the auth conversation by sending AUTH for our default
- * mechanism */
- if (!send_auth (auth, &all_mechanisms[0]))
- {
- _dbus_auth_unref (auth);
- return NULL;
- }
-
- return auth;
-}
-
-/**
- * Increments the refcount of an auth object.
- *
- * @param auth the auth conversation
- * @returns the auth conversation
- */
-DBusAuth *
-_dbus_auth_ref (DBusAuth *auth)
-{
- _dbus_assert (auth != NULL);
-
- auth->refcount += 1;
-
- return auth;
-}
-
-/**
- * Decrements the refcount of an auth object.
- *
- * @param auth the auth conversation
- */
-void
-_dbus_auth_unref (DBusAuth *auth)
-{
- _dbus_assert (auth != NULL);
- _dbus_assert (auth->refcount > 0);
-
- auth->refcount -= 1;
- if (auth->refcount == 0)
- {
- shutdown_mech (auth);
-
- if (DBUS_AUTH_IS_CLIENT (auth))
- {
- _dbus_string_free (& DBUS_AUTH_CLIENT (auth)->guid_from_server);
- _dbus_list_clear (& DBUS_AUTH_CLIENT (auth)->mechs_to_try);
- }
- else
- {
- _dbus_assert (DBUS_AUTH_IS_SERVER (auth));
-
- _dbus_string_free (& DBUS_AUTH_SERVER (auth)->guid);
- }
-
- if (auth->keyring)
- _dbus_keyring_unref (auth->keyring);
-
- _dbus_string_free (&auth->context);
- _dbus_string_free (&auth->challenge);
- _dbus_string_free (&auth->identity);
- _dbus_string_free (&auth->incoming);
- _dbus_string_free (&auth->outgoing);
-
- dbus_free_string_array (auth->allowed_mechs);
-
- _dbus_credentials_unref (auth->credentials);
- _dbus_credentials_unref (auth->authorized_identity);
- _dbus_credentials_unref (auth->desired_identity);
-
- dbus_free (auth);
- }
-}
-
-/**
- * Sets an array of authentication mechanism names
- * that we are willing to use.
- *
- * @param auth the auth conversation
- * @param mechanisms #NULL-terminated array of mechanism names
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_auth_set_mechanisms (DBusAuth *auth,
- const char **mechanisms)
-{
- char **copy;
-
- if (mechanisms != NULL)
- {
- copy = _dbus_dup_string_array (mechanisms);
- if (copy == NULL)
- return FALSE;
- }
- else
- copy = NULL;
-
- dbus_free_string_array (auth->allowed_mechs);
-
- auth->allowed_mechs = copy;
-
- return TRUE;
-}
-
-/**
- * @param auth the auth conversation object
- * @returns #TRUE if we're in a final state
- */
-#define DBUS_AUTH_IN_END_STATE(auth) ((auth)->state->handler == NULL)
-
-/**
- * Analyzes buffered input and moves the auth conversation forward,
- * returning the new state of the auth conversation.
- *
- * @param auth the auth conversation
- * @returns the new state
- */
-DBusAuthState
-_dbus_auth_do_work (DBusAuth *auth)
-{
- auth->needed_memory = FALSE;
-
- /* Max amount we'll buffer up before deciding someone's on crack */
-#define MAX_BUFFER (16 * _DBUS_ONE_KILOBYTE)
-
- do
- {
- if (DBUS_AUTH_IN_END_STATE (auth))
- break;
-
- if (_dbus_string_get_length (&auth->incoming) > MAX_BUFFER ||
- _dbus_string_get_length (&auth->outgoing) > MAX_BUFFER)
- {
- goto_state (auth, &common_state_need_disconnect);
- _dbus_verbose ("%s: Disconnecting due to excessive data buffered in auth phase\n",
- DBUS_AUTH_NAME (auth));
- break;
- }
- }
- while (process_command (auth));
-
- if (auth->needed_memory)
- return DBUS_AUTH_STATE_WAITING_FOR_MEMORY;
- else if (_dbus_string_get_length (&auth->outgoing) > 0)
- return DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND;
- else if (auth->state == &common_state_need_disconnect)
- return DBUS_AUTH_STATE_NEED_DISCONNECT;
- else if (auth->state == &common_state_authenticated)
- return DBUS_AUTH_STATE_AUTHENTICATED;
- else return DBUS_AUTH_STATE_WAITING_FOR_INPUT;
-}
-
-/**
- * Gets bytes that need to be sent to the peer we're conversing with.
- * After writing some bytes, _dbus_auth_bytes_sent() must be called
- * to notify the auth object that they were written.
- *
- * @param auth the auth conversation
- * @param str return location for a ref to the buffer to send
- * @returns #FALSE if nothing to send
- */
-dbus_bool_t
-_dbus_auth_get_bytes_to_send (DBusAuth *auth,
- const DBusString **str)
-{
- _dbus_assert (auth != NULL);
- _dbus_assert (str != NULL);
-
- *str = NULL;
-
- if (_dbus_string_get_length (&auth->outgoing) == 0)
- return FALSE;
-
- *str = &auth->outgoing;
-
- return TRUE;
-}
-
-/**
- * Notifies the auth conversation object that
- * the given number of bytes of the outgoing buffer
- * have been written out.
- *
- * @param auth the auth conversation
- * @param bytes_sent number of bytes written out
- */
-void
-_dbus_auth_bytes_sent (DBusAuth *auth,
- int bytes_sent)
-{
- _dbus_verbose ("%s: Sent %d bytes of: %s\n",
- DBUS_AUTH_NAME (auth),
- bytes_sent,
- _dbus_string_get_const_data (&auth->outgoing));
-
- _dbus_string_delete (&auth->outgoing,
- 0, bytes_sent);
-}
-
-/**
- * Get a buffer to be used for reading bytes from the peer we're conversing
- * with. Bytes should be appended to this buffer.
- *
- * @param auth the auth conversation
- * @param buffer return location for buffer to append bytes to
- */
-void
-_dbus_auth_get_buffer (DBusAuth *auth,
- DBusString **buffer)
-{
- _dbus_assert (auth != NULL);
- _dbus_assert (!auth->buffer_outstanding);
-
- *buffer = &auth->incoming;
-
- auth->buffer_outstanding = TRUE;
-}
-
-/**
- * Returns a buffer with new data read into it.
- *
- * @param auth the auth conversation
- * @param buffer the buffer being returned
- * @param bytes_read number of new bytes added
- */
-void
-_dbus_auth_return_buffer (DBusAuth *auth,
- DBusString *buffer,
- int bytes_read)
-{
- _dbus_assert (buffer == &auth->incoming);
- _dbus_assert (auth->buffer_outstanding);
-
- auth->buffer_outstanding = FALSE;
-}
-
-/**
- * Returns leftover bytes that were not used as part of the auth
- * conversation. These bytes will be part of the message stream
- * instead. This function may not be called until authentication has
- * succeeded.
- *
- * @param auth the auth conversation
- * @param str return location for pointer to string of unused bytes
- */
-void
-_dbus_auth_get_unused_bytes (DBusAuth *auth,
- const DBusString **str)
-{
- if (!DBUS_AUTH_IN_END_STATE (auth))
- return;
-
- *str = &auth->incoming;
-}
-
-
-/**
- * Gets rid of unused bytes returned by _dbus_auth_get_unused_bytes()
- * after we've gotten them and successfully moved them elsewhere.
- *
- * @param auth the auth conversation
- */
-void
-_dbus_auth_delete_unused_bytes (DBusAuth *auth)
-{
- if (!DBUS_AUTH_IN_END_STATE (auth))
- return;
-
- _dbus_string_set_length (&auth->incoming, 0);
-}
-
-/**
- * Called post-authentication, indicates whether we need to encode
- * the message stream with _dbus_auth_encode_data() prior to
- * sending it to the peer.
- *
- * @param auth the auth conversation
- * @returns #TRUE if we need to encode the stream
- */
-dbus_bool_t
-_dbus_auth_needs_encoding (DBusAuth *auth)
-{
- if (auth->state != &common_state_authenticated)
- return FALSE;
-
- if (auth->mech != NULL)
- {
- if (DBUS_AUTH_IS_CLIENT (auth))
- return auth->mech->client_encode_func != NULL;
- else
- return auth->mech->server_encode_func != NULL;
- }
- else
- return FALSE;
-}
-
-/**
- * Called post-authentication, encodes a block of bytes for sending to
- * the peer. If no encoding was negotiated, just copies the bytes
- * (you can avoid this by checking _dbus_auth_needs_encoding()).
- *
- * @param auth the auth conversation
- * @param plaintext the plain text data
- * @param encoded initialized string to where encoded data is appended
- * @returns #TRUE if we had enough memory and successfully encoded
- */
-dbus_bool_t
-_dbus_auth_encode_data (DBusAuth *auth,
- const DBusString *plaintext,
- DBusString *encoded)
-{
- _dbus_assert (plaintext != encoded);
-
- if (auth->state != &common_state_authenticated)
- return FALSE;
-
- if (_dbus_auth_needs_encoding (auth))
- {
- if (DBUS_AUTH_IS_CLIENT (auth))
- return (* auth->mech->client_encode_func) (auth, plaintext, encoded);
- else
- return (* auth->mech->server_encode_func) (auth, plaintext, encoded);
- }
- else
- {
- return _dbus_string_copy (plaintext, 0, encoded,
- _dbus_string_get_length (encoded));
- }
-}
-
-/**
- * Called post-authentication, indicates whether we need to decode
- * the message stream with _dbus_auth_decode_data() after
- * receiving it from the peer.
- *
- * @param auth the auth conversation
- * @returns #TRUE if we need to encode the stream
- */
-dbus_bool_t
-_dbus_auth_needs_decoding (DBusAuth *auth)
-{
- if (auth->state != &common_state_authenticated)
- return FALSE;
-
- if (auth->mech != NULL)
- {
- if (DBUS_AUTH_IS_CLIENT (auth))
- return auth->mech->client_decode_func != NULL;
- else
- return auth->mech->server_decode_func != NULL;
- }
- else
- return FALSE;
-}
-
-
-/**
- * Called post-authentication, decodes a block of bytes received from
- * the peer. If no encoding was negotiated, just copies the bytes (you
- * can avoid this by checking _dbus_auth_needs_decoding()).
- *
- * @todo 1.0? We need to be able to distinguish "out of memory" error
- * from "the data is hosed" error.
- *
- * @param auth the auth conversation
- * @param encoded the encoded data
- * @param plaintext initialized string where decoded data is appended
- * @returns #TRUE if we had enough memory and successfully decoded
- */
-dbus_bool_t
-_dbus_auth_decode_data (DBusAuth *auth,
- const DBusString *encoded,
- DBusString *plaintext)
-{
- _dbus_assert (plaintext != encoded);
-
- if (auth->state != &common_state_authenticated)
- return FALSE;
-
- if (_dbus_auth_needs_decoding (auth))
- {
- if (DBUS_AUTH_IS_CLIENT (auth))
- return (* auth->mech->client_decode_func) (auth, encoded, plaintext);
- else
- return (* auth->mech->server_decode_func) (auth, encoded, plaintext);
- }
- else
- {
- return _dbus_string_copy (encoded, 0, plaintext,
- _dbus_string_get_length (plaintext));
- }
-}
-
-/**
- * Sets credentials received via reliable means from the operating
- * system.
- *
- * @param auth the auth conversation
- * @param credentials the credentials received
- * @returns #FALSE on OOM
- */
-dbus_bool_t
-_dbus_auth_set_credentials (DBusAuth *auth,
- DBusCredentials *credentials)
-{
- _dbus_credentials_clear (auth->credentials);
- return _dbus_credentials_add_credentials (auth->credentials,
- credentials);
-}
-
-/**
- * Gets the identity we authorized the client as. Apps may have
- * different policies as to what identities they allow.
- *
- * Returned credentials are not a copy and should not be modified
- *
- * @param auth the auth conversation
- * @returns the credentials we've authorized BY REFERENCE do not modify
- */
-DBusCredentials*
-_dbus_auth_get_identity (DBusAuth *auth)
-{
- if (auth->state == &common_state_authenticated)
- {
- return auth->authorized_identity;
- }
- else
- {
- /* FIXME instead of this, keep an empty credential around that
- * doesn't require allocation or something
- */
- /* return empty credentials */
- _dbus_assert (_dbus_credentials_are_empty (auth->authorized_identity));
- return auth->authorized_identity;
- }
-}
-
-/**
- * Gets the GUID from the server if we've authenticated; gets
- * #NULL otherwise.
- * @param auth the auth object
- * @returns the GUID in ASCII hex format
- */
-const char*
-_dbus_auth_get_guid_from_server (DBusAuth *auth)
-{
- _dbus_assert (DBUS_AUTH_IS_CLIENT (auth));
-
- if (auth->state == &common_state_authenticated)
- return _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server);
- else
- return NULL;
-}
-
-/**
- * Sets the "authentication context" which scopes cookies
- * with the DBUS_COOKIE_SHA1 auth mechanism for example.
- *
- * @param auth the auth conversation
- * @param context the context
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_auth_set_context (DBusAuth *auth,
- const DBusString *context)
-{
- return _dbus_string_replace_len (context, 0, _dbus_string_get_length (context),
- &auth->context, 0, _dbus_string_get_length (context));
-}
-
-/**
- * Sets whether unix fd passing is potentially on the transport and
- * hence shall be negotiated.
- *
- * @param auth the auth conversation
- * @param b TRUE when unix fd passing shall be negotiated, otherwise FALSE
- */
-void
-_dbus_auth_set_unix_fd_possible(DBusAuth *auth, dbus_bool_t b)
-{
- auth->unix_fd_possible = b;
-}
-
-/**
- * Queries whether unix fd passing was successfully negotiated.
- *
- * @param auth the auth conversion
- * @returns #TRUE when unix fd passing was negotiated.
- */
-dbus_bool_t
-_dbus_auth_get_unix_fd_negotiated(DBusAuth *auth)
-{
- return auth->unix_fd_negotiated;
-}
-
-/** @} */
-
-/* tests in dbus-auth-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.h
deleted file mode 100644
index ae3f364788..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-auth.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-auth.h Authentication
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_AUTH_H
-#define DBUS_AUTH_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusAuth DBusAuth;
-
-typedef enum
-{
- DBUS_AUTH_STATE_WAITING_FOR_INPUT,
- DBUS_AUTH_STATE_WAITING_FOR_MEMORY,
- DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND,
- DBUS_AUTH_STATE_NEED_DISCONNECT,
- DBUS_AUTH_STATE_AUTHENTICATED
-} DBusAuthState;
-
-DBusAuth* _dbus_auth_server_new (const DBusString *guid);
-DBusAuth* _dbus_auth_client_new (void);
-DBusAuth* _dbus_auth_ref (DBusAuth *auth);
-void _dbus_auth_unref (DBusAuth *auth);
-dbus_bool_t _dbus_auth_set_mechanisms (DBusAuth *auth,
- const char **mechanisms);
-DBusAuthState _dbus_auth_do_work (DBusAuth *auth);
-dbus_bool_t _dbus_auth_get_bytes_to_send (DBusAuth *auth,
- const DBusString **str);
-void _dbus_auth_bytes_sent (DBusAuth *auth,
- int bytes_sent);
-void _dbus_auth_get_buffer (DBusAuth *auth,
- DBusString **buffer);
-void _dbus_auth_return_buffer (DBusAuth *auth,
- DBusString *buffer,
- int bytes_read);
-void _dbus_auth_get_unused_bytes (DBusAuth *auth,
- const DBusString **str);
-void _dbus_auth_delete_unused_bytes (DBusAuth *auth);
-dbus_bool_t _dbus_auth_needs_encoding (DBusAuth *auth);
-dbus_bool_t _dbus_auth_encode_data (DBusAuth *auth,
- const DBusString *plaintext,
- DBusString *encoded);
-dbus_bool_t _dbus_auth_needs_decoding (DBusAuth *auth);
-dbus_bool_t _dbus_auth_decode_data (DBusAuth *auth,
- const DBusString *encoded,
- DBusString *plaintext);
-dbus_bool_t _dbus_auth_set_credentials (DBusAuth *auth,
- DBusCredentials *credentials);
-DBusCredentials* _dbus_auth_get_identity (DBusAuth *auth);
-dbus_bool_t _dbus_auth_set_context (DBusAuth *auth,
- const DBusString *context);
-const char* _dbus_auth_get_guid_from_server(DBusAuth *auth);
-
-void _dbus_auth_set_unix_fd_possible(DBusAuth *auth, dbus_bool_t b);
-dbus_bool_t _dbus_auth_get_unix_fd_negotiated(DBusAuth *auth);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_AUTH_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.c
deleted file mode 100644
index 0fd483113b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.c
+++ /dev/null
@@ -1,1602 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-bus.c Convenience functions for communicating with the bus.
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-bus.h"
-#include "dbus-protocol.h"
-#include "dbus-internals.h"
-#include "dbus-message.h"
-#include "dbus-marshal-validate.h"
-#include "dbus-misc.h"
-#include "dbus-threads-internal.h"
-#include "dbus-connection-internal.h"
-#include "dbus-string.h"
-
-/**
- * @defgroup DBusBus Message bus APIs
- * @ingroup DBus
- * @brief Functions for communicating with the message bus
- *
- * dbus_bus_get() allows all modules and libraries in a given
- * process to share the same connection to the bus daemon by storing
- * the connection globally.
- *
- * All other functions in this module are just convenience functions;
- * most of them invoke methods on the bus daemon, by sending method
- * call messages to #DBUS_SERVICE_DBUS. These convenience functions
- * often make blocking method calls. If you don't want to block,
- * you can send the method call messages manually in the same way
- * you would any other method call message.
- *
- * This module is the only one in libdbus that's specific to
- * communicating with the message bus daemon. The rest of the API can
- * also be used for connecting to another application directly.
- *
- * @todo right now the default address of the system bus is hardcoded,
- * so if you change it in the global config file suddenly you have to
- * set DBUS_SYSTEM_BUS_ADDRESS env variable. Might be nice if the
- * client lib somehow read the config file, or if the bus on startup
- * somehow wrote out its address to a well-known spot, but might also
- * not be worth it.
- */
-
-/**
- * @defgroup DBusBusInternals Message bus APIs internals
- * @ingroup DBusInternals
- * @brief Internals of functions for communicating with the message bus
- *
- * @{
- */
-
-/**
- * Block of message-bus-related data we attach to each
- * #DBusConnection used with these convenience functions.
- *
- */
-typedef struct
-{
- DBusConnection *connection; /**< Connection we're associated with */
- char *unique_name; /**< Unique name of this connection */
-
- unsigned int is_well_known : 1; /**< Is one of the well-known connections in our global array */
-} BusData;
-
-/** The slot we have reserved to store BusData.
- */
-static dbus_int32_t bus_data_slot = -1;
-
-/** Number of bus types */
-#define N_BUS_TYPES 3
-
-static DBusConnection *bus_connections[N_BUS_TYPES];
-static char *bus_connection_addresses[N_BUS_TYPES] = { NULL, NULL, NULL };
-
-static DBusBusType activation_bus_type = DBUS_BUS_STARTER;
-
-static dbus_bool_t initialized = FALSE;
-
-static void
-addresses_shutdown_func (void *data)
-{
- int i;
-
- i = 0;
- while (i < N_BUS_TYPES)
- {
- if (bus_connections[i] != NULL)
- _dbus_warn_check_failed ("dbus_shutdown() called but connections were still live. This probably means the application did not drop all its references to bus connections.\n");
-
- dbus_free (bus_connection_addresses[i]);
- bus_connection_addresses[i] = NULL;
- ++i;
- }
-
- activation_bus_type = DBUS_BUS_STARTER;
-
- initialized = FALSE;
-}
-
-static dbus_bool_t
-get_from_env (char **connection_p,
- const char *env_var)
-{
- const char *s;
-
- _dbus_assert (*connection_p == NULL);
-
- s = _dbus_getenv (env_var);
- if (s == NULL || *s == '\0')
- return TRUE; /* successfully didn't use the env var */
- else
- {
- *connection_p = _dbus_strdup (s);
- return *connection_p != NULL;
- }
-}
-
-static dbus_bool_t
-init_session_address (void)
-{
- dbus_bool_t retval;
-
- retval = FALSE;
-
- /* First, look in the environment. This is the normal case on
- * freedesktop.org/Unix systems. */
- get_from_env (&bus_connection_addresses[DBUS_BUS_SESSION],
- "DBUS_SESSION_BUS_ADDRESS");
- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
- {
- dbus_bool_t supported;
- DBusString addr;
- DBusError error = DBUS_ERROR_INIT;
-
- if (!_dbus_string_init (&addr))
- return FALSE;
-
- supported = FALSE;
- /* So it's not in the environment - let's try a platform-specific method.
- * On MacOS, this involves asking launchd. On Windows (not specified yet)
- * we might do a COM lookup.
- * Ignore errors - if we failed, fall back to autolaunch. */
- retval = _dbus_lookup_session_address (&supported, &addr, &error);
- if (supported && retval)
- {
- retval =_dbus_string_steal_data (&addr, &bus_connection_addresses[DBUS_BUS_SESSION]);
- }
- else if (supported && !retval)
- {
- if (dbus_error_is_set(&error))
- _dbus_warn ("Dynamic session lookup supported but failed: %s\n", error.message);
- else
- _dbus_warn ("Dynamic session lookup supported but failed silently\n");
- }
- _dbus_string_free (&addr);
- }
- else
- retval = TRUE;
-
- if (!retval)
- return FALSE;
-
- /* We have a hard-coded (but compile-time-configurable) fallback address for
- * the session bus. */
- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
- bus_connection_addresses[DBUS_BUS_SESSION] =
- _dbus_strdup (DBUS_SESSION_BUS_CONNECT_ADDRESS);
-
- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-init_connections_unlocked (void)
-{
- if (!initialized)
- {
- const char *s;
- int i;
-
- i = 0;
- while (i < N_BUS_TYPES)
- {
- bus_connections[i] = NULL;
- ++i;
- }
-
- /* Don't init these twice, we may run this code twice if
- * init_connections_unlocked() fails midway through.
- * In practice, each block below should contain only one
- * "return FALSE" or running through twice may not
- * work right.
- */
-
- if (bus_connection_addresses[DBUS_BUS_SYSTEM] == NULL)
- {
- _dbus_verbose ("Filling in system bus address...\n");
-
- if (!get_from_env (&bus_connection_addresses[DBUS_BUS_SYSTEM],
- "DBUS_SYSTEM_BUS_ADDRESS"))
- return FALSE;
- }
-
-
- if (bus_connection_addresses[DBUS_BUS_SYSTEM] == NULL)
- {
- /* Use default system bus address if none set in environment */
- bus_connection_addresses[DBUS_BUS_SYSTEM] =
- _dbus_strdup (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS);
-
- if (bus_connection_addresses[DBUS_BUS_SYSTEM] == NULL)
- return FALSE;
-
- _dbus_verbose (" used default system bus \"%s\"\n",
- bus_connection_addresses[DBUS_BUS_SYSTEM]);
- }
- else
- _dbus_verbose (" used env var system bus \"%s\"\n",
- bus_connection_addresses[DBUS_BUS_SYSTEM]);
-
- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
- {
- _dbus_verbose ("Filling in session bus address...\n");
-
- if (!init_session_address ())
- return FALSE;
-
- _dbus_verbose (" \"%s\"\n", bus_connection_addresses[DBUS_BUS_SESSION] ?
- bus_connection_addresses[DBUS_BUS_SESSION] : "none set");
- }
-
- if (bus_connection_addresses[DBUS_BUS_STARTER] == NULL)
- {
- _dbus_verbose ("Filling in activation bus address...\n");
-
- if (!get_from_env (&bus_connection_addresses[DBUS_BUS_STARTER],
- "DBUS_STARTER_ADDRESS"))
- return FALSE;
-
- _dbus_verbose (" \"%s\"\n", bus_connection_addresses[DBUS_BUS_STARTER] ?
- bus_connection_addresses[DBUS_BUS_STARTER] : "none set");
- }
-
-
- if (bus_connection_addresses[DBUS_BUS_STARTER] != NULL)
- {
- s = _dbus_getenv ("DBUS_STARTER_BUS_TYPE");
-
- if (s != NULL)
- {
- _dbus_verbose ("Bus activation type was set to \"%s\"\n", s);
-
- if (strcmp (s, "system") == 0)
- activation_bus_type = DBUS_BUS_SYSTEM;
- else if (strcmp (s, "session") == 0)
- activation_bus_type = DBUS_BUS_SESSION;
- }
- }
- else
- {
- /* Default to the session bus instead if available */
- if (bus_connection_addresses[DBUS_BUS_SESSION] != NULL)
- {
- bus_connection_addresses[DBUS_BUS_STARTER] =
- _dbus_strdup (bus_connection_addresses[DBUS_BUS_SESSION]);
- if (bus_connection_addresses[DBUS_BUS_STARTER] == NULL)
- return FALSE;
- }
- }
-
- /* If we return FALSE we have to be sure that restarting
- * the above code will work right
- */
-
- if (!_dbus_register_shutdown_func (addresses_shutdown_func,
- NULL))
- return FALSE;
-
- initialized = TRUE;
- }
-
- return initialized;
-}
-
-static void
-bus_data_free (void *data)
-{
- BusData *bd = data;
-
- if (bd->is_well_known)
- {
- int i;
-
- if (!_DBUS_LOCK (bus))
- _dbus_assert_not_reached ("global locks should have been initialized "
- "when we attached bus data");
-
- /* We may be stored in more than one slot */
- /* This should now be impossible - these slots are supposed to
- * be cleared on disconnect, so should not need to be cleared on
- * finalize
- */
- i = 0;
- while (i < N_BUS_TYPES)
- {
- if (bus_connections[i] == bd->connection)
- bus_connections[i] = NULL;
-
- ++i;
- }
- _DBUS_UNLOCK (bus);
- }
-
- dbus_free (bd->unique_name);
- dbus_free (bd);
-
- dbus_connection_free_data_slot (&bus_data_slot);
-}
-
-static BusData*
-ensure_bus_data (DBusConnection *connection)
-{
- BusData *bd;
-
- if (!dbus_connection_allocate_data_slot (&bus_data_slot))
- return NULL;
-
- bd = dbus_connection_get_data (connection, bus_data_slot);
- if (bd == NULL)
- {
- bd = dbus_new0 (BusData, 1);
- if (bd == NULL)
- {
- dbus_connection_free_data_slot (&bus_data_slot);
- return NULL;
- }
-
- bd->connection = connection;
-
- if (!dbus_connection_set_data (connection, bus_data_slot, bd,
- bus_data_free))
- {
- dbus_free (bd);
- dbus_connection_free_data_slot (&bus_data_slot);
- return NULL;
- }
-
- /* Data slot refcount now held by the BusData */
- }
- else
- {
- dbus_connection_free_data_slot (&bus_data_slot);
- }
-
- return bd;
-}
-
-/**
- * Internal function that checks to see if this
- * is a shared connection owned by the bus and if it is unref it.
- *
- * @param connection a connection that has been disconnected.
- */
-void
-_dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection)
-{
- int i;
-
- if (!_DBUS_LOCK (bus))
- {
- /* If it was in bus_connections, we would have initialized global locks
- * when we added it. So, it can't be. */
- return;
- }
-
- /* We are expecting to have the connection saved in only one of these
- * slots, but someone could in a pathological case set system and session
- * bus to the same bus or something. Or set one of them to the starter
- * bus without setting the starter bus type in the env variable.
- * So we don't break the loop as soon as we find a match.
- */
- for (i = 0; i < N_BUS_TYPES; ++i)
- {
- if (bus_connections[i] == connection)
- {
- bus_connections[i] = NULL;
- }
- }
-
- _DBUS_UNLOCK (bus);
-}
-
-static DBusConnection *
-internal_bus_get (DBusBusType type,
- dbus_bool_t private,
- DBusError *error)
-{
- const char *address;
- DBusConnection *connection;
- BusData *bd;
- DBusBusType address_type;
-
- _dbus_return_val_if_fail (type >= 0 && type < N_BUS_TYPES, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
- connection = NULL;
-
- if (!_DBUS_LOCK (bus))
- {
- _DBUS_SET_OOM (error);
- /* do not "goto out", that would try to unlock */
- return NULL;
- }
-
- if (!init_connections_unlocked ())
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- /* We want to use the activation address even if the
- * activating bus is the session or system bus,
- * per the spec.
- */
- address_type = type;
-
- /* Use the real type of the activation bus for getting its
- * connection, but only if the real type's address is available. (If
- * the activating bus isn't a well-known bus then
- * activation_bus_type == DBUS_BUS_STARTER)
- */
- if (type == DBUS_BUS_STARTER &&
- bus_connection_addresses[activation_bus_type] != NULL)
- type = activation_bus_type;
-
- if (!private && bus_connections[type] != NULL)
- {
- connection = bus_connections[type];
- dbus_connection_ref (connection);
- goto out;
- }
-
- address = bus_connection_addresses[address_type];
- if (address == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)");
- goto out;
- }
-
- if (private)
- connection = dbus_connection_open_private (address, error);
- else
- connection = dbus_connection_open (address, error);
-
- if (!connection)
- {
- goto out;
- }
-
- if (!dbus_bus_register (connection, error))
- {
- _dbus_connection_close_possibly_shared (connection);
- dbus_connection_unref (connection);
- connection = NULL;
- goto out;
- }
-
- if (!private)
- {
- /* store a weak ref to the connection (dbus-connection.c is
- * supposed to have a strong ref that it drops on disconnect,
- * since this is a shared connection)
- */
- bus_connections[type] = connection;
- }
-
- /* By default we're bound to the lifecycle of
- * the message bus.
- */
- dbus_connection_set_exit_on_disconnect (connection,
- TRUE);
-
- if (!_DBUS_LOCK (bus_datas))
- _dbus_assert_not_reached ("global locks were initialized already");
-
- bd = ensure_bus_data (connection);
- _dbus_assert (bd != NULL); /* it should have been created on
- register, so OOM not possible */
- bd->is_well_known = TRUE;
- _DBUS_UNLOCK (bus_datas);
-
-out:
- /* Return a reference to the caller, or NULL with error set. */
- if (connection == NULL)
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _DBUS_UNLOCK (bus);
- return connection;
-}
-
-
-/** @} */ /* end of implementation details docs */
-
-/**
- * @addtogroup DBusBus
- * @{
- */
-
-/**
- * Connects to a bus daemon and registers the client with it. If a
- * connection to the bus already exists, then that connection is
- * returned. The caller of this function owns a reference to the bus.
- *
- * The caller may NOT call dbus_connection_close() on this connection;
- * see dbus_connection_open() and dbus_connection_close() for details
- * on that.
- *
- * If this function obtains a new connection object never before
- * returned from dbus_bus_get(), it will call
- * dbus_connection_set_exit_on_disconnect(), so the application
- * will exit if the connection closes. You can undo this
- * by calling dbus_connection_set_exit_on_disconnect() yourself
- * after you get the connection.
- *
- * dbus_bus_get() calls dbus_bus_register() for you.
- *
- * If returning a newly-created connection, this function will block
- * until authentication and bus registration are complete.
- *
- * @param type bus type
- * @param error address where an error can be returned.
- * @returns a #DBusConnection with new ref or #NULL on error
- */
-DBusConnection *
-dbus_bus_get (DBusBusType type,
- DBusError *error)
-{
- return internal_bus_get (type, FALSE, error);
-}
-
-/**
- * Connects to a bus daemon and registers the client with it as with
- * dbus_bus_register(). Unlike dbus_bus_get(), always creates a new
- * connection. This connection will not be saved or recycled by
- * libdbus. Caller owns a reference to the bus and must either close
- * it or know it to be closed prior to releasing this reference.
- *
- * See dbus_connection_open_private() for more details on when to
- * close and unref this connection.
- *
- * This function calls
- * dbus_connection_set_exit_on_disconnect() on the new connection, so the application
- * will exit if the connection closes. You can undo this
- * by calling dbus_connection_set_exit_on_disconnect() yourself
- * after you get the connection.
- *
- * dbus_bus_get_private() calls dbus_bus_register() for you.
- *
- * This function will block until authentication and bus registration
- * are complete.
- *
- * @param type bus type
- * @param error address where an error can be returned.
- * @returns a DBusConnection with new ref
- */
-DBusConnection *
-dbus_bus_get_private (DBusBusType type,
- DBusError *error)
-{
- return internal_bus_get (type, TRUE, error);
-}
-
-/**
- * Registers a connection with the bus. This must be the first
- * thing an application does when connecting to the message bus.
- * If registration succeeds, the unique name will be set,
- * and can be obtained using dbus_bus_get_unique_name().
- *
- * This function will block until registration is complete.
- *
- * If the connection has already registered with the bus
- * (determined by checking whether dbus_bus_get_unique_name()
- * returns a non-#NULL value), then this function does nothing.
- *
- * If you use dbus_bus_get() or dbus_bus_get_private() this
- * function will be called for you.
- *
- * @note Just use dbus_bus_get() or dbus_bus_get_private() instead of
- * dbus_bus_register() and save yourself some pain. Using
- * dbus_bus_register() manually is only useful if you have your
- * own custom message bus not found in #DBusBusType.
- *
- * If you open a bus connection with dbus_connection_open() or
- * dbus_connection_open_private() you will have to dbus_bus_register()
- * yourself, or make the appropriate registration method calls
- * yourself. If you send the method calls yourself, call
- * dbus_bus_set_unique_name() with the unique bus name you get from
- * the bus.
- *
- * For shared connections (created with dbus_connection_open()) in a
- * multithreaded application, you can't really make the registration
- * calls yourself, because you don't know whether some other thread is
- * also registering, and the bus will kick you off if you send two
- * registration messages.
- *
- * If you use dbus_bus_register() however, there is a lock that
- * keeps both apps from registering at the same time.
- *
- * The rule in a multithreaded app, then, is that dbus_bus_register()
- * must be used to register, or you need to have your own locks that
- * all threads in the app will respect.
- *
- * In a single-threaded application you can register by hand instead
- * of using dbus_bus_register(), as long as you check
- * dbus_bus_get_unique_name() to see if a unique name has already been
- * stored by another thread before you send the registration messages.
- *
- * @param connection the connection
- * @param error place to store errors
- * @returns #TRUE on success
- */
-dbus_bool_t
-dbus_bus_register (DBusConnection *connection,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- char *name;
- BusData *bd;
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- retval = FALSE;
- message = NULL;
- reply = NULL;
-
- if (!_DBUS_LOCK (bus_datas))
- {
- _DBUS_SET_OOM (error);
- /* do not "goto out", that would try to unlock */
- return FALSE;
- }
-
- bd = ensure_bus_data (connection);
- if (bd == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- if (bd->unique_name != NULL)
- {
- _dbus_verbose ("Ignoring attempt to register the same DBusConnection %s with the message bus a second time.\n",
- bd->unique_name);
- /* Success! */
- retval = TRUE;
- goto out;
- }
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "Hello");
-
- if (!message)
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1, error);
-
- if (reply == NULL)
- goto out;
- else if (dbus_set_error_from_message (error, reply))
- goto out;
- else if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- goto out;
-
- bd->unique_name = _dbus_strdup (name);
- if (bd->unique_name == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- _DBUS_UNLOCK (bus_datas);
-
- if (message)
- dbus_message_unref (message);
-
- if (reply)
- dbus_message_unref (reply);
-
- if (!retval)
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- return retval;
-}
-
-
-/**
- * Sets the unique name of the connection, as assigned by the message
- * bus. Can only be used if you registered with the bus manually
- * (i.e. if you did not call dbus_bus_register()). Can only be called
- * once per connection. After the unique name is set, you can get it
- * with dbus_bus_get_unique_name().
- *
- * The only reason to use this function is to re-implement the
- * equivalent of dbus_bus_register() yourself. One (probably unusual)
- * reason to do that might be to do the bus registration call
- * asynchronously instead of synchronously.
- *
- * @note Just use dbus_bus_get() or dbus_bus_get_private(), or worst
- * case dbus_bus_register(), instead of messing with this
- * function. There's really no point creating pain for yourself by
- * doing things manually.
- *
- * It's hard to use this function safely on shared connections
- * (created by dbus_connection_open()) in a multithreaded application,
- * because only one registration attempt can be sent to the bus. If
- * two threads are both sending the registration message, there is no
- * mechanism in libdbus itself to avoid sending it twice.
- *
- * Thus, you need a way to coordinate which thread sends the
- * registration attempt; which also means you know which thread
- * will call dbus_bus_set_unique_name(). If you don't know
- * about all threads in the app (for example, if some libraries
- * you're using might start libdbus-using threads), then you
- * need to avoid using this function on shared connections.
- *
- * @param connection the connection
- * @param unique_name the unique name
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_bus_set_unique_name (DBusConnection *connection,
- const char *unique_name)
-{
- BusData *bd;
- dbus_bool_t success = FALSE;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (unique_name != NULL, FALSE);
-
- if (!_DBUS_LOCK (bus_datas))
- {
- /* do not "goto out", that would try to unlock */
- return FALSE;
- }
-
- bd = ensure_bus_data (connection);
- if (bd == NULL)
- goto out;
-
- _dbus_assert (bd->unique_name == NULL);
-
- bd->unique_name = _dbus_strdup (unique_name);
- success = bd->unique_name != NULL;
-
-out:
- _DBUS_UNLOCK (bus_datas);
-
- return success;
-}
-
-/**
- * Gets the unique name of the connection as assigned by the message
- * bus. Only possible after the connection has been registered with
- * the message bus. All connections returned by dbus_bus_get() or
- * dbus_bus_get_private() have been successfully registered.
- *
- * The name remains valid until the connection is freed, and
- * should not be freed by the caller.
- *
- * Other than dbus_bus_get(), there are two ways to set the unique
- * name; one is dbus_bus_register(), the other is
- * dbus_bus_set_unique_name(). You are responsible for calling
- * dbus_bus_set_unique_name() if you register by hand instead of using
- * dbus_bus_register().
- *
- * @param connection the connection
- * @returns the unique name or #NULL on error
- */
-const char*
-dbus_bus_get_unique_name (DBusConnection *connection)
-{
- BusData *bd;
- const char *unique_name = NULL;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
-
- if (!_DBUS_LOCK (bus_datas))
- {
- /* We'd have initialized locks when we gave it its unique name, if it
- * had one. Don't "goto out", that would try to unlock. */
- return NULL;
- }
-
- bd = ensure_bus_data (connection);
- if (bd == NULL)
- goto out;
-
- unique_name = bd->unique_name;
-
-out:
- _DBUS_UNLOCK (bus_datas);
-
- return unique_name;
-}
-
-/**
- * Asks the bus to return the UID the named connection authenticated
- * as, if any. Only works on UNIX; only works for connections on the
- * same machine as the bus. If you are not on the same machine as the
- * bus, then calling this is probably a bad idea, since the UID will
- * mean little to your application.
- *
- * For the system message bus you're guaranteed to be on the same
- * machine since it only listens on a UNIX domain socket (at least,
- * as shipped by default).
- *
- * This function only works for connections that authenticated as
- * a UNIX user, right now that includes all bus connections, but
- * it's very possible to have connections with no associated UID.
- * So check for errors and do something sensible if they happen.
- *
- * This function will always return an error on Windows.
- *
- * @param connection the connection
- * @param name a name owned by the connection
- * @param error location to store the error
- * @returns the unix user id, or ((unsigned)-1) if error is set
- */
-unsigned long
-dbus_bus_get_unix_user (DBusConnection *connection,
- const char *name,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- dbus_uint32_t uid;
-
- _dbus_return_val_if_fail (connection != NULL, DBUS_UID_UNSET);
- _dbus_return_val_if_fail (name != NULL, DBUS_UID_UNSET);
- _dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), DBUS_UID_UNSET);
- _dbus_return_val_if_error_is_set (error, DBUS_UID_UNSET);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "GetConnectionUnixUser");
-
- if (message == NULL)
- {
- _DBUS_SET_OOM (error);
- return DBUS_UID_UNSET;
- }
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- _DBUS_SET_OOM (error);
- return DBUS_UID_UNSET;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1,
- error);
-
- dbus_message_unref (message);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_UID_UNSET;
- }
-
- if (dbus_set_error_from_message (error, reply))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return DBUS_UID_UNSET;
- }
-
- if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_UINT32, &uid,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return DBUS_UID_UNSET;
- }
-
- dbus_message_unref (reply);
-
- return (unsigned long) uid;
-}
-
-/**
- * Asks the bus to return its globally unique ID, as described in the
- * D-Bus specification. For the session bus, this is useful as a way
- * to uniquely identify each user session. For the system bus,
- * probably the bus ID is not useful; instead, use the machine ID
- * since it's accessible without necessarily connecting to the bus and
- * may be persistent beyond a single bus instance (across reboots for
- * example). See dbus_get_local_machine_id().
- *
- * In addition to an ID for each bus and an ID for each machine, there is
- * an ID for each address that the bus is listening on; that can
- * be retrieved with dbus_connection_get_server_id(), though it is
- * probably not very useful.
- *
- * @param connection the connection
- * @param error location to store the error
- * @returns the bus ID or #NULL if error is set
- */
-char*
-dbus_bus_get_id (DBusConnection *connection,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- char *id;
- const char *v_STRING;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "GetId");
-
- if (message == NULL)
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1,
- error);
-
- dbus_message_unref (message);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return NULL;
- }
-
- if (dbus_set_error_from_message (error, reply))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return NULL;
- }
-
- v_STRING = NULL;
- if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return NULL;
- }
-
- id = _dbus_strdup (v_STRING); /* may be NULL */
-
- dbus_message_unref (reply);
-
- if (id == NULL)
- _DBUS_SET_OOM (error);
-
- /* FIXME it might be nice to cache the ID locally */
-
- return id;
-}
-
-/**
- * Asks the bus to assign the given name to this connection by invoking
- * the RequestName method on the bus. This method is fully documented
- * in the D-Bus specification. For quick reference, the flags and
- * result codes are discussed here, but the specification is the
- * canonical version of this information.
- *
- * First you should know that for each bus name, the bus stores
- * a queue of connections that would like to own it. Only
- * one owns it at a time - called the primary owner. If the primary
- * owner releases the name or disconnects, then the next owner in the
- * queue atomically takes over.
- *
- * So for example if you have an application org.freedesktop.TextEditor
- * and multiple instances of it can be run, you can have all of them
- * sitting in the queue. The first one to start up will receive messages
- * sent to org.freedesktop.TextEditor, but if that one exits another
- * will become the primary owner and receive messages.
- *
- * The queue means you don't need to manually watch for the current owner to
- * disappear and then request the name again.
- *
- * When requesting a name, you can specify several flags.
- *
- * #DBUS_NAME_FLAG_ALLOW_REPLACEMENT and #DBUS_NAME_FLAG_DO_NOT_QUEUE
- * are properties stored by the bus for this connection with respect to
- * each requested bus name. These properties are stored even if the
- * connection is queued and does not become the primary owner.
- * You can update these flags by calling RequestName again (even if
- * you already own the name).
- *
- * #DBUS_NAME_FLAG_ALLOW_REPLACEMENT means that another requestor of the
- * name can take it away from you by specifying #DBUS_NAME_FLAG_REPLACE_EXISTING.
- *
- * #DBUS_NAME_FLAG_DO_NOT_QUEUE means that if you aren't the primary owner,
- * you don't want to be queued up - you only care about being the
- * primary owner.
- *
- * Unlike the other two flags, #DBUS_NAME_FLAG_REPLACE_EXISTING is a property
- * of the individual RequestName call, i.e. the bus does not persistently
- * associate it with the connection-name pair. If a RequestName call includes
- * the #DBUS_NAME_FLAG_REPLACE_EXISTING flag, and the current primary
- * owner has #DBUS_NAME_FLAG_ALLOW_REPLACEMENT set, then the current primary
- * owner will be kicked off.
- *
- * If no flags are given, an application will receive the requested
- * name only if the name is currently unowned; and it will NOT give
- * up the name if another application asks to take it over using
- * #DBUS_NAME_FLAG_REPLACE_EXISTING.
- *
- * This function returns a result code. The possible result codes
- * are as follows.
- *
- * #DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER means that the name had no
- * existing owner, and the caller is now the primary owner; or that
- * the name had an owner, and the caller specified
- * #DBUS_NAME_FLAG_REPLACE_EXISTING, and the current owner
- * specified #DBUS_NAME_FLAG_ALLOW_REPLACEMENT.
- *
- * #DBUS_REQUEST_NAME_REPLY_IN_QUEUE happens only if the caller does NOT
- * specify #DBUS_NAME_FLAG_DO_NOT_QUEUE and either the current owner
- * did NOT specify #DBUS_NAME_FLAG_ALLOW_REPLACEMENT or the caller did NOT
- * specify #DBUS_NAME_FLAG_REPLACE_EXISTING. In this case the caller ends up
- * in a queue to own the name after the current owner gives it up.
- *
- * #DBUS_REQUEST_NAME_REPLY_EXISTS happens if the name has an owner
- * already and the caller specifies #DBUS_NAME_FLAG_DO_NOT_QUEUE
- * and either the current owner has NOT specified
- * #DBUS_NAME_FLAG_ALLOW_REPLACEMENT or the caller did NOT specify
- * #DBUS_NAME_FLAG_REPLACE_EXISTING.
- *
- * #DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER happens if an application
- * requests a name it already owns. (Re-requesting a name is useful if
- * you want to change the #DBUS_NAME_FLAG_ALLOW_REPLACEMENT or
- * #DBUS_NAME_FLAG_DO_NOT_QUEUE settings.)
- *
- * When a service represents an application, say "text editor," then
- * it should specify #DBUS_NAME_FLAG_ALLOW_REPLACEMENT if it wants
- * the last editor started to be the user's editor vs. the first one
- * started. Then any editor that can be the user's editor should
- * specify #DBUS_NAME_FLAG_REPLACE_EXISTING to either take over
- * (last-started-wins) or be queued up (first-started-wins) according
- * to whether #DBUS_NAME_FLAG_ALLOW_REPLACEMENT was given.
- *
- * Conventionally, single-instance applications often offer a command
- * line option called --replace which means to replace the current
- * instance. To implement this, always set
- * #DBUS_NAME_FLAG_ALLOW_REPLACEMENT when you request your
- * application's bus name. When you lose ownership of your bus name,
- * you need to exit. Look for the signal "NameLost" from
- * #DBUS_SERVICE_DBUS and #DBUS_INTERFACE_DBUS (the signal's first
- * argument is the bus name that was lost). If starting up without
- * --replace, do not specify #DBUS_NAME_FLAG_REPLACE_EXISTING, and
- * exit if you fail to become the bus name owner. If --replace is
- * given, ask to replace the old owner.
- *
- * @param connection the connection
- * @param name the name to request
- * @param flags flags
- * @param error location to store the error
- * @returns a result code, -1 if error is set
- */
-int
-dbus_bus_request_name (DBusConnection *connection,
- const char *name,
- unsigned int flags,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- dbus_uint32_t result;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
- _dbus_return_val_if_fail (name != NULL, 0);
- _dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), 0);
- _dbus_return_val_if_error_is_set (error, 0);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "RequestName");
-
- if (message == NULL)
- {
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_UINT32, &flags,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1,
- error);
-
- dbus_message_unref (message);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return -1;
- }
-
- if (dbus_set_error_from_message (error, reply))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return -1;
- }
-
- if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_UINT32, &result,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return -1;
- }
-
- dbus_message_unref (reply);
-
- return result;
-}
-
-
-/**
- * Asks the bus to unassign the given name from this connection by
- * invoking the ReleaseName method on the bus. The "ReleaseName"
- * method is canonically documented in the D-Bus specification.
- *
- * Possible results are: #DBUS_RELEASE_NAME_REPLY_RELEASED
- * which means you owned the name or were in the queue to own it,
- * and and now you don't own it and aren't in the queue.
- * #DBUS_RELEASE_NAME_REPLY_NOT_OWNER which means someone else
- * owns the name so you can't release it.
- * #DBUS_RELEASE_NAME_REPLY_NON_EXISTENT
- * which means nobody owned the name.
- *
- * @param connection the connection
- * @param name the name to remove
- * @param error location to store the error
- * @returns a result code, -1 if error is set
- */
-int
-dbus_bus_release_name (DBusConnection *connection,
- const char *name,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- dbus_uint32_t result;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
- _dbus_return_val_if_fail (name != NULL, 0);
- _dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), 0);
- _dbus_return_val_if_error_is_set (error, 0);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "ReleaseName");
-
- if (message == NULL)
- {
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1,
- error);
-
- dbus_message_unref (message);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return -1;
- }
-
- if (dbus_set_error_from_message (error, reply))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return -1;
- }
-
- if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_UINT32, &result,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return -1;
- }
-
- dbus_message_unref (reply);
-
- return result;
-}
-
-/**
- * Asks the bus whether a certain name has an owner.
- *
- * Using this can easily result in a race condition,
- * since an owner can appear or disappear after you
- * call this.
- *
- * If you want to request a name, just request it;
- * if you want to avoid replacing a current owner,
- * don't specify #DBUS_NAME_FLAG_REPLACE_EXISTING and
- * you will get an error if there's already an owner.
- *
- * @param connection the connection
- * @param name the name
- * @param error location to store any errors
- * @returns #TRUE if the name exists, #FALSE if not or on error
- */
-dbus_bool_t
-dbus_bus_name_has_owner (DBusConnection *connection,
- const char *name,
- DBusError *error)
-{
- DBusMessage *message, *reply;
- dbus_bool_t exists;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (name != NULL, FALSE);
- _dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "NameHasOwner");
- if (message == NULL)
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (message);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, message, -1, error);
- dbus_message_unref (message);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
- }
-
- if (!dbus_message_get_args (reply, error,
- DBUS_TYPE_BOOLEAN, &exists,
- DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return FALSE;
- }
-
- dbus_message_unref (reply);
- return exists;
-}
-
-/**
- * Starts a service that will request ownership of the given name.
- * The returned result will be one of be one of
- * #DBUS_START_REPLY_SUCCESS or #DBUS_START_REPLY_ALREADY_RUNNING if
- * successful. Pass #NULL if you don't care about the result.
- *
- * The flags parameter is for future expansion, currently you should
- * specify 0.
- *
- * It's often easier to avoid explicitly starting services, and
- * just send a method call to the service's bus name instead.
- * Method calls start a service to handle them by default
- * unless you call dbus_message_set_auto_start() to disable this
- * behavior.
- *
- * @param connection the connection
- * @param name the name we want the new service to request
- * @param flags the flags (should always be 0 for now)
- * @param result a place to store the result or #NULL
- * @param error location to store any errors
- * @returns #TRUE if the activation succeeded, #FALSE if not
- */
-dbus_bool_t
-dbus_bus_start_service_by_name (DBusConnection *connection,
- const char *name,
- dbus_uint32_t flags,
- dbus_uint32_t *result,
- DBusError *error)
-{
- DBusMessage *msg;
- DBusMessage *reply;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (_dbus_check_is_valid_bus_name (name), FALSE);
-
- msg = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "StartServiceByName");
-
- if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &name,
- DBUS_TYPE_UINT32, &flags, DBUS_TYPE_INVALID))
- {
- dbus_message_unref (msg);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- reply = dbus_connection_send_with_reply_and_block (connection, msg,
- -1, error);
- dbus_message_unref (msg);
-
- if (reply == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
- }
-
- if (dbus_set_error_from_message (error, reply))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return FALSE;
- }
-
- if (result != NULL &&
- !dbus_message_get_args (reply, error, DBUS_TYPE_UINT32,
- result, DBUS_TYPE_INVALID))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- dbus_message_unref (reply);
- return FALSE;
- }
-
- dbus_message_unref (reply);
- return TRUE;
-}
-
-static void
-send_no_return_values (DBusConnection *connection,
- DBusMessage *msg,
- DBusError *error)
-{
- if (error)
- {
- /* Block to check success codepath */
- DBusMessage *reply;
-
- reply = dbus_connection_send_with_reply_and_block (connection, msg,
- -1, error);
-
- if (reply == NULL)
- _DBUS_ASSERT_ERROR_IS_SET (error);
- else
- dbus_message_unref (reply);
- }
- else
- {
- /* Silently-fail nonblocking codepath */
- dbus_message_set_no_reply (msg, TRUE);
- dbus_connection_send (connection, msg, NULL);
- }
-}
-
-/**
- * Adds a match rule to match messages going through the message bus.
- * The "rule" argument is the string form of a match rule.
- *
- * If you pass #NULL for the error, this function will not
- * block; the match thus won't be added until you flush the
- * connection, and if there's an error adding the match
- * you won't find out about it. This is generally acceptable, since the
- * possible errors (including a lack of resources in the bus, the connection
- * having exceeded its quota of active match rules, or the match rule being
- * unparseable) are generally unrecoverable.
- *
- * If you pass non-#NULL for the error this function will
- * block until it gets a reply. This may be useful when using match rule keys
- * introduced in recent versions of D-Bus, like 'arg0namespace', to allow the
- * application to fall back to less efficient match rules supported by older
- * versions of the daemon if the running version is not new enough; or when
- * using user-supplied rules rather than rules hard-coded at compile time.
- *
- * Normal API conventions would have the function return
- * a boolean value indicating whether the error was set,
- * but that would require blocking always to determine
- * the return value.
- *
- * The AddMatch method is fully documented in the D-Bus
- * specification. For quick reference, the format of the
- * match rules is discussed here, but the specification
- * is the canonical version of this information.
- *
- * Rules are specified as a string of comma separated
- * key/value pairs. An example is
- * "type='signal',sender='org.freedesktop.DBus',
- * interface='org.freedesktop.DBus',member='Foo',
- * path='/bar/foo',destination=':452345.34'"
- *
- * Possible keys you can match on are type, sender,
- * interface, member, path, destination and numbered
- * keys to match message args (keys are 'arg0', 'arg1', etc.).
- * Omitting a key from the rule indicates
- * a wildcard match. For instance omitting
- * the member from a match rule but adding a sender would
- * let all messages from that sender through regardless of
- * the member.
- *
- * Matches are inclusive not exclusive so as long as one
- * rule matches the message will get through. It is important
- * to note this because every time a message is received the
- * application will be paged into memory to process it. This
- * can cause performance problems such as draining batteries
- * on embedded platforms.
- *
- * If you match message args ('arg0', 'arg1', and so forth)
- * only string arguments will match. That is, arg0='5' means
- * match the string "5" not the integer 5.
- *
- * Currently there is no way to match against non-string arguments.
- *
- * A specialised form of wildcard matching on arguments is
- * supported for path-like namespaces. If your argument match has
- * a 'path' suffix (eg: "arg0path='/some/path/'") then it is
- * considered a match if the argument exactly matches the given
- * string or if one of them ends in a '/' and is a prefix of the
- * other.
- *
- * Matching on interface is tricky because method call
- * messages only optionally specify the interface.
- * If a message omits the interface, then it will NOT match
- * if the rule specifies an interface name. This means match
- * rules on method calls should not usually give an interface.
- *
- * However, signal messages are required to include the interface
- * so when matching signals usually you should specify the interface
- * in the match rule.
- *
- * For security reasons, you can match arguments only up to
- * #DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER.
- *
- * Match rules have a maximum length of #DBUS_MAXIMUM_MATCH_RULE_LENGTH
- * bytes.
- *
- * Both of these maximums are much higher than you're likely to need,
- * they only exist because the D-Bus bus daemon has fixed limits on
- * all resource usage.
- *
- * @param connection connection to the message bus
- * @param rule textual form of match rule
- * @param error location to store any errors
- */
-void
-dbus_bus_add_match (DBusConnection *connection,
- const char *rule,
- DBusError *error)
-{
- DBusMessage *msg;
-
- _dbus_return_if_fail (rule != NULL);
-
- msg = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "AddMatch");
-
- if (msg == NULL)
- {
- _DBUS_SET_OOM (error);
- return;
- }
-
- if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &rule,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (msg);
- _DBUS_SET_OOM (error);
- return;
- }
-
- send_no_return_values (connection, msg, error);
-
- dbus_message_unref (msg);
-}
-
-/**
- * Removes a previously-added match rule "by value" (the most
- * recently-added identical rule gets removed). The "rule" argument
- * is the string form of a match rule.
- *
- * The bus compares match rules semantically, not textually, so
- * whitespace and ordering don't have to be identical to
- * the rule you passed to dbus_bus_add_match().
- *
- * If you pass #NULL for the error, this function will not
- * block; otherwise it will. See detailed explanation in
- * docs for dbus_bus_add_match().
- *
- * @param connection connection to the message bus
- * @param rule textual form of match rule
- * @param error location to store any errors
- */
-void
-dbus_bus_remove_match (DBusConnection *connection,
- const char *rule,
- DBusError *error)
-{
- DBusMessage *msg;
-
- _dbus_return_if_fail (rule != NULL);
-
- msg = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
- "RemoveMatch");
-
- if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, &rule,
- DBUS_TYPE_INVALID))
- {
- dbus_message_unref (msg);
- _DBUS_SET_OOM (error);
- return;
- }
-
- send_no_return_values (connection, msg, error);
-
- dbus_message_unref (msg);
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.h
deleted file mode 100644
index 02a95711d0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-bus.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-bus.h Convenience functions for communicating with the bus.
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_BUS_H
-#define DBUS_BUS_H
-
-#include <dbus/dbus-connection.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusBus
- * @{
- */
-
-DBUS_EXPORT
-DBusConnection *dbus_bus_get (DBusBusType type,
- DBusError *error);
-DBUS_EXPORT
-DBusConnection *dbus_bus_get_private (DBusBusType type,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_bus_register (DBusConnection *connection,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection,
- const char *unique_name);
-DBUS_EXPORT
-const char* dbus_bus_get_unique_name (DBusConnection *connection);
-DBUS_EXPORT
-unsigned long dbus_bus_get_unix_user (DBusConnection *connection,
- const char *name,
- DBusError *error);
-DBUS_EXPORT
-char* dbus_bus_get_id (DBusConnection *connection,
- DBusError *error);
-DBUS_EXPORT
-int dbus_bus_request_name (DBusConnection *connection,
- const char *name,
- unsigned int flags,
- DBusError *error);
-DBUS_EXPORT
-int dbus_bus_release_name (DBusConnection *connection,
- const char *name,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection,
- const char *name,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection,
- const char *name,
- dbus_uint32_t flags,
- dbus_uint32_t *reply,
- DBusError *error);
-
-DBUS_EXPORT
-void dbus_bus_add_match (DBusConnection *connection,
- const char *rule,
- DBusError *error);
-DBUS_EXPORT
-void dbus_bus_remove_match (DBusConnection *connection,
- const char *rule,
- DBusError *error);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_BUS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection-internal.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-connection-internal.h
deleted file mode 100644
index 2842f2f4b7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection-internal.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-connection-internal.h DBusConnection internal interfaces
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_CONNECTION_INTERNAL_H
-#define DBUS_CONNECTION_INTERNAL_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-transport.h>
-#include <dbus/dbus-resources.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-timeout.h>
-#include <dbus/dbus-dataslot.h>
-
-DBUS_BEGIN_DECLS
-
-typedef enum
-{
- DBUS_ITERATION_DO_WRITING = 1 << 0, /**< Write messages out. */
- DBUS_ITERATION_DO_READING = 1 << 1, /**< Read messages in. */
- DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
-} DBusIterationFlags;
-
-/** default timeout value when waiting for a message reply, 25 seconds */
-#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
-
-void _dbus_connection_lock (DBusConnection *connection);
-void _dbus_connection_unlock (DBusConnection *connection);
-DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
-void _dbus_connection_unref_unlocked (DBusConnection *connection);
-void _dbus_connection_queue_received_message_link (DBusConnection *connection,
- DBusList *link);
-dbus_bool_t _dbus_connection_has_messages_to_send_unlocked (DBusConnection *connection);
-DBusMessage* _dbus_connection_get_message_to_send (DBusConnection *connection);
-void _dbus_connection_message_sent_unlocked (DBusConnection *connection,
- DBusMessage *message);
-dbus_bool_t _dbus_connection_add_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch);
-void _dbus_connection_remove_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch);
-void _dbus_connection_toggle_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch,
- dbus_bool_t enabled);
-dbus_bool_t _dbus_connection_handle_watch (DBusWatch *watch,
- unsigned int condition,
- void *data);
-dbus_bool_t _dbus_connection_add_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout);
-void _dbus_connection_remove_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout);
-void _dbus_connection_toggle_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout,
- dbus_bool_t enabled);
-DBusConnection* _dbus_connection_new_for_transport (DBusTransport *transport);
-void _dbus_connection_do_iteration_unlocked (DBusConnection *connection,
- DBusPendingCall *pending,
- unsigned int flags,
- int timeout_milliseconds);
-void _dbus_connection_close_possibly_shared (DBusConnection *connection);
-void _dbus_connection_close_if_only_one_ref (DBusConnection *connection);
-
-DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection,
- int timeout_milliseconds,
- DBusTimeoutHandler timeout_handler);
-void _dbus_pending_call_notify (DBusPendingCall *pending);
-void _dbus_connection_remove_pending_call (DBusConnection *connection,
- DBusPendingCall *pending);
-void _dbus_connection_block_pending_call (DBusPendingCall *pending);
-void _dbus_pending_call_complete_and_unlock (DBusPendingCall *pending,
- DBusMessage *message);
-dbus_bool_t _dbus_connection_send_and_unlock (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *client_serial);
-
-void _dbus_connection_queue_synthesized_message_link (DBusConnection *connection,
- DBusList *link);
-void _dbus_connection_test_get_locks (DBusConnection *conn,
- DBusMutex **mutex_loc,
- DBusMutex **dispatch_mutex_loc,
- DBusMutex **io_path_mutex_loc,
- DBusCondVar **dispatch_cond_loc,
- DBusCondVar **io_path_cond_loc);
-
-/* if DBUS_ENABLE_STATS */
-void _dbus_connection_get_stats (DBusConnection *connection,
- dbus_uint32_t *in_messages,
- dbus_uint32_t *in_bytes,
- dbus_uint32_t *in_fds,
- dbus_uint32_t *in_peak_bytes,
- dbus_uint32_t *in_peak_fds,
- dbus_uint32_t *out_messages,
- dbus_uint32_t *out_bytes,
- dbus_uint32_t *out_fds,
- dbus_uint32_t *out_peak_bytes,
- dbus_uint32_t *out_peak_fds);
-
-
-/* if DBUS_ENABLE_EMBEDDED_TESTS */
-const char* _dbus_connection_get_address (DBusConnection *connection);
-
-/* This _dbus_bus_* stuff doesn't really belong here, but dbus-bus-internal.h seems
- * silly for one function
- */
-/**
- * @addtogroup DBusBusInternals
- * @{
- */
-
-void _dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection);
-
-/** @} */
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_CONNECTION_INTERNAL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.c
deleted file mode 100644
index f0b6871e82..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.c
+++ /dev/null
@@ -1,6295 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-connection.c DBusConnection object
- *
- * Copyright (C) 2002-2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-shared.h"
-#include "dbus-connection.h"
-#include "dbus-list.h"
-#include "dbus-timeout.h"
-#include "dbus-transport.h"
-#include "dbus-watch.h"
-#include "dbus-connection-internal.h"
-#include "dbus-pending-call-internal.h"
-#include "dbus-list.h"
-#include "dbus-hash.h"
-#include "dbus-message-internal.h"
-#include "dbus-message-private.h"
-#include "dbus-threads.h"
-#include "dbus-protocol.h"
-#include "dbus-dataslot.h"
-#include "dbus-string.h"
-#include "dbus-signature.h"
-#include "dbus-pending-call.h"
-#include "dbus-object-tree.h"
-#include "dbus-threads-internal.h"
-#include "dbus-bus.h"
-#include "dbus-marshal-basic.h"
-
-#ifdef DBUS_DISABLE_CHECKS
-#define TOOK_LOCK_CHECK(connection)
-#define RELEASING_LOCK_CHECK(connection)
-#define HAVE_LOCK_CHECK(connection)
-#else
-#define TOOK_LOCK_CHECK(connection) do { \
- _dbus_assert (!(connection)->have_connection_lock); \
- (connection)->have_connection_lock = TRUE; \
- } while (0)
-#define RELEASING_LOCK_CHECK(connection) do { \
- _dbus_assert ((connection)->have_connection_lock); \
- (connection)->have_connection_lock = FALSE; \
- } while (0)
-#define HAVE_LOCK_CHECK(connection) _dbus_assert ((connection)->have_connection_lock)
-/* A "DO_NOT_HAVE_LOCK_CHECK" is impossible since we need the lock to check the flag */
-#endif
-
-#define TRACE_LOCKS 1
-
-#define CONNECTION_LOCK(connection) do { \
- if (TRACE_LOCKS) { _dbus_verbose ("LOCK\n"); } \
- _dbus_rmutex_lock ((connection)->mutex); \
- TOOK_LOCK_CHECK (connection); \
- } while (0)
-
-#define CONNECTION_UNLOCK(connection) _dbus_connection_unlock (connection)
-
-#define SLOTS_LOCK(connection) do { \
- _dbus_rmutex_lock ((connection)->slot_mutex); \
- } while (0)
-
-#define SLOTS_UNLOCK(connection) do { \
- _dbus_rmutex_unlock ((connection)->slot_mutex); \
- } while (0)
-
-#define DISPATCH_STATUS_NAME(s) \
- ((s) == DBUS_DISPATCH_COMPLETE ? "complete" : \
- (s) == DBUS_DISPATCH_DATA_REMAINS ? "data remains" : \
- (s) == DBUS_DISPATCH_NEED_MEMORY ? "need memory" : \
- "???")
-
-/**
- * @defgroup DBusConnection DBusConnection
- * @ingroup DBus
- * @brief Connection to another application
- *
- * A DBusConnection represents a connection to another
- * application. Messages can be sent and received via this connection.
- * The other application may be a message bus; for convenience, the
- * function dbus_bus_get() is provided to automatically open a
- * connection to the well-known message buses.
- *
- * In brief a DBusConnection is a message queue associated with some
- * message transport mechanism such as a socket. The connection
- * maintains a queue of incoming messages and a queue of outgoing
- * messages.
- *
- * Several functions use the following terms:
- * <ul>
- * <li><b>read</b> means to fill the incoming message queue by reading from the socket</li>
- * <li><b>write</b> means to drain the outgoing queue by writing to the socket</li>
- * <li><b>dispatch</b> means to drain the incoming queue by invoking application-provided message handlers</li>
- * </ul>
- *
- * The function dbus_connection_read_write_dispatch() for example does all
- * three of these things, offering a simple alternative to a main loop.
- *
- * In an application with a main loop, the read/write/dispatch
- * operations are usually separate.
- *
- * The connection provides #DBusWatch and #DBusTimeout objects to
- * the main loop. These are used to know when reading, writing, or
- * dispatching should be performed.
- *
- * Incoming messages are processed
- * by calling dbus_connection_dispatch(). dbus_connection_dispatch()
- * runs any handlers registered for the topmost message in the message
- * queue, then discards the message, then returns.
- *
- * dbus_connection_get_dispatch_status() indicates whether
- * messages are currently in the queue that need dispatching.
- * dbus_connection_set_dispatch_status_function() allows
- * you to set a function to be used to monitor the dispatch status.
- *
- * If you're using GLib or Qt add-on libraries for D-Bus, there are
- * special convenience APIs in those libraries that hide
- * all the details of dispatch and watch/timeout monitoring.
- * For example, dbus_connection_setup_with_g_main().
- *
- * If you aren't using these add-on libraries, but want to process
- * messages asynchronously, you must manually call
- * dbus_connection_set_dispatch_status_function(),
- * dbus_connection_set_watch_functions(),
- * dbus_connection_set_timeout_functions() providing appropriate
- * functions to integrate the connection with your application's main
- * loop. This can be tricky to get right; main loops are not simple.
- *
- * If you don't need to be asynchronous, you can ignore #DBusWatch,
- * #DBusTimeout, and dbus_connection_dispatch(). Instead,
- * dbus_connection_read_write_dispatch() can be used.
- *
- * Or, in <em>very</em> simple applications,
- * dbus_connection_pop_message() may be all you need, allowing you to
- * avoid setting up any handler functions (see
- * dbus_connection_add_filter(),
- * dbus_connection_register_object_path() for more on handlers).
- *
- * When you use dbus_connection_send() or one of its variants to send
- * a message, the message is added to the outgoing queue. It's
- * actually written to the network later; either in
- * dbus_watch_handle() invoked by your main loop, or in
- * dbus_connection_flush() which blocks until it can write out the
- * entire outgoing queue. The GLib/Qt add-on libraries again
- * handle the details here for you by setting up watch functions.
- *
- * When a connection is disconnected, you are guaranteed to get a
- * signal "Disconnected" from the interface
- * #DBUS_INTERFACE_LOCAL, path
- * #DBUS_PATH_LOCAL.
- *
- * You may not drop the last reference to a #DBusConnection
- * until that connection has been disconnected.
- *
- * You may dispatch the unprocessed incoming message queue even if the
- * connection is disconnected. However, "Disconnected" will always be
- * the last message in the queue (obviously no messages are received
- * after disconnection).
- *
- * After calling dbus_threads_init(), #DBusConnection has thread
- * locks and drops them when invoking user callbacks, so in general is
- * transparently threadsafe. However, #DBusMessage does NOT have
- * thread locks; you must not send the same message to multiple
- * #DBusConnection if those connections will be used from different threads,
- * for example.
- *
- * Also, if you dispatch or pop messages from multiple threads, it
- * may work in the sense that it won't crash, but it's tough to imagine
- * sane results; it will be completely unpredictable which messages
- * go to which threads.
- *
- * It's recommended to dispatch from a single thread.
- *
- * The most useful function to call from multiple threads at once
- * is dbus_connection_send_with_reply_and_block(). That is,
- * multiple threads can make method calls at the same time.
- *
- * If you aren't using threads, you can use a main loop and
- * dbus_pending_call_set_notify() to achieve a similar result.
- */
-
-/**
- * @defgroup DBusConnectionInternals DBusConnection implementation details
- * @ingroup DBusInternals
- * @brief Implementation details of DBusConnection
- *
- * @{
- */
-
-static void
-_dbus_connection_trace_ref (DBusConnection *connection,
- int old_refcount,
- int new_refcount,
- const char *why)
-{
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- static int enabled = -1;
-
- _dbus_trace_ref ("DBusConnection", connection, old_refcount, new_refcount,
- why, "DBUS_CONNECTION_TRACE", &enabled);
-#endif
-}
-
-/**
- * Internal struct representing a message filter function
- */
-typedef struct DBusMessageFilter DBusMessageFilter;
-
-/**
- * Internal struct representing a message filter function
- */
-struct DBusMessageFilter
-{
- DBusAtomic refcount; /**< Reference count */
- DBusHandleMessageFunction function; /**< Function to call to filter */
- void *user_data; /**< User data for the function */
- DBusFreeFunction free_user_data_function; /**< Function to free the user data */
-};
-
-
-/**
- * Internals of DBusPreallocatedSend
- */
-struct DBusPreallocatedSend
-{
- DBusConnection *connection; /**< Connection we'd send the message to */
- DBusList *queue_link; /**< Preallocated link in the queue */
- DBusList *counter_link; /**< Preallocated link in the resource counter */
-};
-
-#if HAVE_DECL_MSG_NOSIGNAL
-static dbus_bool_t _dbus_modify_sigpipe = FALSE;
-#else
-static dbus_bool_t _dbus_modify_sigpipe = TRUE;
-#endif
-
-/**
- * Implementation details of DBusConnection. All fields are private.
- */
-struct DBusConnection
-{
- DBusAtomic refcount; /**< Reference count. */
-
- DBusRMutex *mutex; /**< Lock on the entire DBusConnection */
-
- DBusCMutex *dispatch_mutex; /**< Protects dispatch_acquired */
- DBusCondVar *dispatch_cond; /**< Notify when dispatch_acquired is available */
- DBusCMutex *io_path_mutex; /**< Protects io_path_acquired */
- DBusCondVar *io_path_cond; /**< Notify when io_path_acquired is available */
-
- DBusList *outgoing_messages; /**< Queue of messages we need to send, send the end of the list first. */
- DBusList *incoming_messages; /**< Queue of messages we have received, end of the list received most recently. */
- DBusList *expired_messages; /**< Messages that will be released when we next unlock. */
-
- DBusMessage *message_borrowed; /**< Filled in if the first incoming message has been borrowed;
- * dispatch_acquired will be set by the borrower
- */
-
- int n_outgoing; /**< Length of outgoing queue. */
- int n_incoming; /**< Length of incoming queue. */
-
- DBusCounter *outgoing_counter; /**< Counts size of outgoing messages. */
-
- DBusTransport *transport; /**< Object that sends/receives messages over network. */
- DBusWatchList *watches; /**< Stores active watches. */
- DBusTimeoutList *timeouts; /**< Stores active timeouts. */
-
- DBusList *filter_list; /**< List of filters. */
-
- DBusRMutex *slot_mutex; /**< Lock on slot_list so overall connection lock need not be taken */
- DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
-
- DBusHashTable *pending_replies; /**< Hash of message serials to #DBusPendingCall. */
-
- dbus_uint32_t client_serial; /**< Client serial. Increments each time a message is sent */
- DBusList *disconnect_message_link; /**< Preallocated list node for queueing the disconnection message */
-
- DBusWakeupMainFunction wakeup_main_function; /**< Function to wake up the mainloop */
- void *wakeup_main_data; /**< Application data for wakeup_main_function */
- DBusFreeFunction free_wakeup_main_data; /**< free wakeup_main_data */
-
- DBusDispatchStatusFunction dispatch_status_function; /**< Function on dispatch status changes */
- void *dispatch_status_data; /**< Application data for dispatch_status_function */
- DBusFreeFunction free_dispatch_status_data; /**< free dispatch_status_data */
-
- DBusDispatchStatus last_dispatch_status; /**< The last dispatch status we reported to the application. */
-
- DBusObjectTree *objects; /**< Object path handlers registered with this connection */
-
- char *server_guid; /**< GUID of server if we are in shared_connections, #NULL if server GUID is unknown or connection is private */
-
- /* These two MUST be bools and not bitfields, because they are protected by a separate lock
- * from connection->mutex and all bitfields in a word have to be read/written together.
- * So you can't have a different lock for different bitfields in the same word.
- */
- dbus_bool_t dispatch_acquired; /**< Someone has dispatch path (can drain incoming queue) */
- dbus_bool_t io_path_acquired; /**< Someone has transport io path (can use the transport to read/write messages) */
-
- unsigned int shareable : 1; /**< #TRUE if libdbus owns a reference to the connection and can return it from dbus_connection_open() more than once */
-
- unsigned int exit_on_disconnect : 1; /**< If #TRUE, exit after handling disconnect signal */
-
- unsigned int route_peer_messages : 1; /**< If #TRUE, if org.freedesktop.DBus.Peer messages have a bus name, don't handle them automatically */
-
- unsigned int disconnected_message_arrived : 1; /**< We popped or are dispatching the disconnected message.
- * if the disconnect_message_link is NULL then we queued it, but
- * this flag is whether it got to the head of the queue.
- */
- unsigned int disconnected_message_processed : 1; /**< We did our default handling of the disconnected message,
- * such as closing the connection.
- */
-
-#ifndef DBUS_DISABLE_CHECKS
- unsigned int have_connection_lock : 1; /**< Used to check locking */
-#endif
-
-#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
- int generation; /**< _dbus_current_generation that should correspond to this connection */
-#endif
-};
-
-static DBusDispatchStatus _dbus_connection_get_dispatch_status_unlocked (DBusConnection *connection);
-static void _dbus_connection_update_dispatch_status_and_unlock (DBusConnection *connection,
- DBusDispatchStatus new_status);
-static void _dbus_connection_last_unref (DBusConnection *connection);
-static void _dbus_connection_acquire_dispatch (DBusConnection *connection);
-static void _dbus_connection_release_dispatch (DBusConnection *connection);
-static DBusDispatchStatus _dbus_connection_flush_unlocked (DBusConnection *connection);
-static void _dbus_connection_close_possibly_shared_and_unlock (DBusConnection *connection);
-static dbus_bool_t _dbus_connection_get_is_connected_unlocked (DBusConnection *connection);
-static dbus_bool_t _dbus_connection_peek_for_reply_unlocked (DBusConnection *connection,
- dbus_uint32_t client_serial);
-
-static DBusMessageFilter *
-_dbus_message_filter_ref (DBusMessageFilter *filter)
-{
-#ifdef DBUS_DISABLE_ASSERT
- _dbus_atomic_inc (&filter->refcount);
-#else
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_inc (&filter->refcount);
- _dbus_assert (old_value > 0);
-#endif
-
- return filter;
-}
-
-static void
-_dbus_message_filter_unref (DBusMessageFilter *filter)
-{
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_dec (&filter->refcount);
- _dbus_assert (old_value > 0);
-
- if (old_value == 1)
- {
- if (filter->free_user_data_function)
- (* filter->free_user_data_function) (filter->user_data);
-
- dbus_free (filter);
- }
-}
-
-/**
- * Acquires the connection lock.
- *
- * @param connection the connection.
- */
-void
-_dbus_connection_lock (DBusConnection *connection)
-{
- CONNECTION_LOCK (connection);
-}
-
-/**
- * Releases the connection lock.
- *
- * @param connection the connection.
- */
-void
-_dbus_connection_unlock (DBusConnection *connection)
-{
- DBusList *expired_messages;
- DBusList *iter;
-
- if (TRACE_LOCKS)
- {
- _dbus_verbose ("UNLOCK\n");
- }
-
- /* If we had messages that expired (fell off the incoming or outgoing
- * queues) while we were locked, actually release them now */
- expired_messages = connection->expired_messages;
- connection->expired_messages = NULL;
-
- RELEASING_LOCK_CHECK (connection);
- _dbus_rmutex_unlock (connection->mutex);
-
- for (iter = _dbus_list_pop_first_link (&expired_messages);
- iter != NULL;
- iter = _dbus_list_pop_first_link (&expired_messages))
- {
- DBusMessage *message = iter->data;
-
- dbus_message_unref (message);
- _dbus_list_free_link (iter);
- }
-}
-
-/**
- * Wakes up the main loop if it is sleeping
- * Needed if we're e.g. queueing outgoing messages
- * on a thread while the mainloop sleeps.
- *
- * @param connection the connection.
- */
-static void
-_dbus_connection_wakeup_mainloop (DBusConnection *connection)
-{
- if (connection->wakeup_main_function)
- (*connection->wakeup_main_function) (connection->wakeup_main_data);
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Gets the locks so we can examine them
- *
- * @param connection the connection.
- * @param mutex_loc return for the location of the main mutex pointer
- * @param dispatch_mutex_loc return location of the dispatch mutex pointer
- * @param io_path_mutex_loc return location of the io_path mutex pointer
- * @param dispatch_cond_loc return location of the dispatch conditional
- * variable pointer
- * @param io_path_cond_loc return location of the io_path conditional
- * variable pointer
- */
-void
-_dbus_connection_test_get_locks (DBusConnection *connection,
- DBusMutex **mutex_loc,
- DBusMutex **dispatch_mutex_loc,
- DBusMutex **io_path_mutex_loc,
- DBusCondVar **dispatch_cond_loc,
- DBusCondVar **io_path_cond_loc)
-{
- *mutex_loc = (DBusMutex *) connection->mutex;
- *dispatch_mutex_loc = (DBusMutex *) connection->dispatch_mutex;
- *io_path_mutex_loc = (DBusMutex *) connection->io_path_mutex;
- *dispatch_cond_loc = connection->dispatch_cond;
- *io_path_cond_loc = connection->io_path_cond;
-}
-#endif
-
-/**
- * Adds a message-containing list link to the incoming message queue,
- * taking ownership of the link and the message's current refcount.
- * Cannot fail due to lack of memory.
- *
- * @param connection the connection.
- * @param link the message link to queue.
- */
-void
-_dbus_connection_queue_received_message_link (DBusConnection *connection,
- DBusList *link)
-{
- DBusPendingCall *pending;
- dbus_uint32_t reply_serial;
- DBusMessage *message;
-
- _dbus_assert (_dbus_transport_peek_is_authenticated (connection->transport));
-
- _dbus_list_append_link (&connection->incoming_messages,
- link);
- message = link->data;
-
- /* If this is a reply we're waiting on, remove timeout for it */
- reply_serial = dbus_message_get_reply_serial (message);
- if (reply_serial != 0)
- {
- pending = _dbus_hash_table_lookup_int (connection->pending_replies,
- reply_serial);
- if (pending != NULL)
- {
- if (_dbus_pending_call_is_timeout_added_unlocked (pending))
- _dbus_connection_remove_timeout_unlocked (connection,
- _dbus_pending_call_get_timeout_unlocked (pending));
-
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
- }
- }
-
-
-
- connection->n_incoming += 1;
-
- _dbus_connection_wakeup_mainloop (connection);
-
- _dbus_verbose ("Message %p (%s %s %s %s '%s' reply to %u) added to incoming queue %p, %d incoming\n",
- message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_path (message) ?
- dbus_message_get_path (message) :
- "no path",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message),
- dbus_message_get_reply_serial (message),
- connection,
- connection->n_incoming);
-
- _dbus_message_trace_ref (message, -1, -1,
- "_dbus_conection_queue_received_message_link");
-}
-
-/**
- * Adds a link + message to the incoming message queue.
- * Can't fail. Takes ownership of both link and message.
- *
- * @param connection the connection.
- * @param link the list node and message to queue.
- *
- */
-void
-_dbus_connection_queue_synthesized_message_link (DBusConnection *connection,
- DBusList *link)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_list_append_link (&connection->incoming_messages, link);
-
- connection->n_incoming += 1;
-
- _dbus_connection_wakeup_mainloop (connection);
-
- _dbus_message_trace_ref (link->data, -1, -1,
- "_dbus_connection_queue_synthesized_message_link");
-
- _dbus_verbose ("Synthesized message %p added to incoming queue %p, %d incoming\n",
- link->data, connection, connection->n_incoming);
-}
-
-
-/**
- * Checks whether there are messages in the outgoing message queue.
- * Called with connection lock held.
- *
- * @param connection the connection.
- * @returns #TRUE if the outgoing queue is non-empty.
- */
-dbus_bool_t
-_dbus_connection_has_messages_to_send_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
- return connection->outgoing_messages != NULL;
-}
-
-/**
- * Checks whether there are messages in the outgoing message queue.
- * Use dbus_connection_flush() to block until all outgoing
- * messages have been written to the underlying transport
- * (such as a socket).
- *
- * @param connection the connection.
- * @returns #TRUE if the outgoing queue is non-empty.
- */
-dbus_bool_t
-dbus_connection_has_messages_to_send (DBusConnection *connection)
-{
- dbus_bool_t v;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
- v = _dbus_connection_has_messages_to_send_unlocked (connection);
- CONNECTION_UNLOCK (connection);
-
- return v;
-}
-
-/**
- * Gets the next outgoing message. The message remains in the
- * queue, and the caller does not own a reference to it.
- *
- * @param connection the connection.
- * @returns the message to be sent.
- */
-DBusMessage*
-_dbus_connection_get_message_to_send (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- return _dbus_list_get_last (&connection->outgoing_messages);
-}
-
-/**
- * Notifies the connection that a message has been sent, so the
- * message can be removed from the outgoing queue.
- * Called with the connection lock held.
- *
- * @param connection the connection.
- * @param message the message that was sent.
- */
-void
-_dbus_connection_message_sent_unlocked (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusList *link;
-
- HAVE_LOCK_CHECK (connection);
-
- /* This can be called before we even complete authentication, since
- * it's called on disconnect to clean up the outgoing queue.
- * It's also called as we successfully send each message.
- */
-
- link = _dbus_list_get_last_link (&connection->outgoing_messages);
- _dbus_assert (link != NULL);
- _dbus_assert (link->data == message);
-
- _dbus_list_unlink (&connection->outgoing_messages,
- link);
- _dbus_list_prepend_link (&connection->expired_messages, link);
-
- connection->n_outgoing -= 1;
-
- _dbus_verbose ("Message %p (%s %s %s %s '%s') removed from outgoing queue %p, %d left to send\n",
- message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_path (message) ?
- dbus_message_get_path (message) :
- "no path",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message),
- connection, connection->n_outgoing);
-
- /* It's OK that in principle we call the notify function, because for the
- * outgoing limit, there isn't one */
- _dbus_message_remove_counter (message, connection->outgoing_counter);
-
- /* The message will actually be unreffed when we unlock */
-}
-
-/** Function to be called in protected_change_watch() with refcount held */
-typedef dbus_bool_t (* DBusWatchAddFunction) (DBusWatchList *list,
- DBusWatch *watch);
-/** Function to be called in protected_change_watch() with refcount held */
-typedef void (* DBusWatchRemoveFunction) (DBusWatchList *list,
- DBusWatch *watch);
-/** Function to be called in protected_change_watch() with refcount held */
-typedef void (* DBusWatchToggleFunction) (DBusWatchList *list,
- DBusWatch *watch,
- dbus_bool_t enabled);
-
-static dbus_bool_t
-protected_change_watch (DBusConnection *connection,
- DBusWatch *watch,
- DBusWatchAddFunction add_function,
- DBusWatchRemoveFunction remove_function,
- DBusWatchToggleFunction toggle_function,
- dbus_bool_t enabled)
-{
- dbus_bool_t retval;
-
- HAVE_LOCK_CHECK (connection);
-
- /* The original purpose of protected_change_watch() was to hold a
- * ref on the connection while dropping the connection lock, then
- * calling out to the app. This was a broken hack that did not
- * work, since the connection was in a hosed state (no WatchList
- * field) while calling out.
- *
- * So for now we'll just keep the lock while calling out. This means
- * apps are not allowed to call DBusConnection methods inside a
- * watch function or they will deadlock.
- *
- * The "real fix" is to use the _and_unlock() pattern found
- * elsewhere in the code, to defer calling out to the app until
- * we're about to drop locks and return flow of control to the app
- * anyway.
- *
- * See http://lists.freedesktop.org/archives/dbus/2007-July/thread.html#8144
- */
-
- if (connection->watches)
- {
- if (add_function)
- retval = (* add_function) (connection->watches, watch);
- else if (remove_function)
- {
- retval = TRUE;
- (* remove_function) (connection->watches, watch);
- }
- else
- {
- retval = TRUE;
- (* toggle_function) (connection->watches, watch, enabled);
- }
- return retval;
- }
- else
- return FALSE;
-}
-
-
-/**
- * Adds a watch using the connection's DBusAddWatchFunction if
- * available. Otherwise records the watch to be added when said
- * function is available. Also re-adds the watch if the
- * DBusAddWatchFunction changes. May fail due to lack of memory.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param watch the watch to add.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_connection_add_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch)
-{
- return protected_change_watch (connection, watch,
- _dbus_watch_list_add_watch,
- NULL, NULL, FALSE);
-}
-
-/**
- * Removes a watch using the connection's DBusRemoveWatchFunction
- * if available. It's an error to call this function on a watch
- * that was not previously added.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param watch the watch to remove.
- */
-void
-_dbus_connection_remove_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch)
-{
- protected_change_watch (connection, watch,
- NULL,
- _dbus_watch_list_remove_watch,
- NULL, FALSE);
-}
-
-/**
- * Toggles a watch and notifies app via connection's
- * DBusWatchToggledFunction if available. It's an error to call this
- * function on a watch that was not previously added.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param watch the watch to toggle.
- * @param enabled whether to enable or disable
- */
-void
-_dbus_connection_toggle_watch_unlocked (DBusConnection *connection,
- DBusWatch *watch,
- dbus_bool_t enabled)
-{
- _dbus_assert (watch != NULL);
-
- protected_change_watch (connection, watch,
- NULL, NULL,
- _dbus_watch_list_toggle_watch,
- enabled);
-}
-
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef dbus_bool_t (* DBusTimeoutAddFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout);
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef void (* DBusTimeoutRemoveFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout);
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef void (* DBusTimeoutToggleFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout,
- dbus_bool_t enabled);
-
-static dbus_bool_t
-protected_change_timeout (DBusConnection *connection,
- DBusTimeout *timeout,
- DBusTimeoutAddFunction add_function,
- DBusTimeoutRemoveFunction remove_function,
- DBusTimeoutToggleFunction toggle_function,
- dbus_bool_t enabled)
-{
- dbus_bool_t retval;
-
- HAVE_LOCK_CHECK (connection);
-
- /* The original purpose of protected_change_timeout() was to hold a
- * ref on the connection while dropping the connection lock, then
- * calling out to the app. This was a broken hack that did not
- * work, since the connection was in a hosed state (no TimeoutList
- * field) while calling out.
- *
- * So for now we'll just keep the lock while calling out. This means
- * apps are not allowed to call DBusConnection methods inside a
- * timeout function or they will deadlock.
- *
- * The "real fix" is to use the _and_unlock() pattern found
- * elsewhere in the code, to defer calling out to the app until
- * we're about to drop locks and return flow of control to the app
- * anyway.
- *
- * See http://lists.freedesktop.org/archives/dbus/2007-July/thread.html#8144
- */
-
- if (connection->timeouts)
- {
- if (add_function)
- retval = (* add_function) (connection->timeouts, timeout);
- else if (remove_function)
- {
- retval = TRUE;
- (* remove_function) (connection->timeouts, timeout);
- }
- else
- {
- retval = TRUE;
- (* toggle_function) (connection->timeouts, timeout, enabled);
- }
- return retval;
- }
- else
- return FALSE;
-}
-
-/**
- * Adds a timeout using the connection's DBusAddTimeoutFunction if
- * available. Otherwise records the timeout to be added when said
- * function is available. Also re-adds the timeout if the
- * DBusAddTimeoutFunction changes. May fail due to lack of memory.
- * The timeout will fire repeatedly until removed.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param timeout the timeout to add.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_connection_add_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout)
-{
- return protected_change_timeout (connection, timeout,
- _dbus_timeout_list_add_timeout,
- NULL, NULL, FALSE);
-}
-
-/**
- * Removes a timeout using the connection's DBusRemoveTimeoutFunction
- * if available. It's an error to call this function on a timeout
- * that was not previously added.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param timeout the timeout to remove.
- */
-void
-_dbus_connection_remove_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout)
-{
- protected_change_timeout (connection, timeout,
- NULL,
- _dbus_timeout_list_remove_timeout,
- NULL, FALSE);
-}
-
-/**
- * Toggles a timeout and notifies app via connection's
- * DBusTimeoutToggledFunction if available. It's an error to call this
- * function on a timeout that was not previously added.
- * Connection lock should be held when calling this.
- *
- * @param connection the connection.
- * @param timeout the timeout to toggle.
- * @param enabled whether to enable or disable
- */
-void
-_dbus_connection_toggle_timeout_unlocked (DBusConnection *connection,
- DBusTimeout *timeout,
- dbus_bool_t enabled)
-{
- protected_change_timeout (connection, timeout,
- NULL, NULL,
- _dbus_timeout_list_toggle_timeout,
- enabled);
-}
-
-static dbus_bool_t
-_dbus_connection_attach_pending_call_unlocked (DBusConnection *connection,
- DBusPendingCall *pending)
-{
- dbus_uint32_t reply_serial;
- DBusTimeout *timeout;
-
- HAVE_LOCK_CHECK (connection);
-
- reply_serial = _dbus_pending_call_get_reply_serial_unlocked (pending);
-
- _dbus_assert (reply_serial != 0);
-
- timeout = _dbus_pending_call_get_timeout_unlocked (pending);
-
- if (timeout)
- {
- if (!_dbus_connection_add_timeout_unlocked (connection, timeout))
- return FALSE;
-
- if (!_dbus_hash_table_insert_int (connection->pending_replies,
- reply_serial,
- pending))
- {
- _dbus_connection_remove_timeout_unlocked (connection, timeout);
-
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
- HAVE_LOCK_CHECK (connection);
- return FALSE;
- }
-
- _dbus_pending_call_set_timeout_added_unlocked (pending, TRUE);
- }
- else
- {
- if (!_dbus_hash_table_insert_int (connection->pending_replies,
- reply_serial,
- pending))
- {
- HAVE_LOCK_CHECK (connection);
- return FALSE;
- }
- }
-
- _dbus_pending_call_ref_unlocked (pending);
-
- HAVE_LOCK_CHECK (connection);
-
- return TRUE;
-}
-
-static void
-free_pending_call_on_hash_removal (void *data)
-{
- DBusPendingCall *pending;
- DBusConnection *connection;
-
- if (data == NULL)
- return;
-
- pending = data;
-
- connection = _dbus_pending_call_get_connection_unlocked (pending);
-
- HAVE_LOCK_CHECK (connection);
-
- if (_dbus_pending_call_is_timeout_added_unlocked (pending))
- {
- _dbus_connection_remove_timeout_unlocked (connection,
- _dbus_pending_call_get_timeout_unlocked (pending));
-
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
- }
-
- /* FIXME 1.0? this is sort of dangerous and undesirable to drop the lock
- * here, but the pending call finalizer could in principle call out to
- * application code so we pretty much have to... some larger code reorg
- * might be needed.
- */
- _dbus_connection_ref_unlocked (connection);
- _dbus_pending_call_unref_and_unlock (pending);
- CONNECTION_LOCK (connection);
- _dbus_connection_unref_unlocked (connection);
-}
-
-static void
-_dbus_connection_detach_pending_call_unlocked (DBusConnection *connection,
- DBusPendingCall *pending)
-{
- /* This ends up unlocking to call the pending call finalizer, which is unexpected to
- * say the least.
- */
- _dbus_hash_table_remove_int (connection->pending_replies,
- _dbus_pending_call_get_reply_serial_unlocked (pending));
-}
-
-static void
-_dbus_connection_detach_pending_call_and_unlock (DBusConnection *connection,
- DBusPendingCall *pending)
-{
- /* The idea here is to avoid finalizing the pending call
- * with the lock held, since there's a destroy notifier
- * in pending call that goes out to application code.
- *
- * There's an extra unlock inside the hash table
- * "free pending call" function FIXME...
- */
- _dbus_pending_call_ref_unlocked (pending);
- _dbus_hash_table_remove_int (connection->pending_replies,
- _dbus_pending_call_get_reply_serial_unlocked (pending));
-
- if (_dbus_pending_call_is_timeout_added_unlocked (pending))
- _dbus_connection_remove_timeout_unlocked (connection,
- _dbus_pending_call_get_timeout_unlocked (pending));
-
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
-
- _dbus_pending_call_unref_and_unlock (pending);
-}
-
-/**
- * Removes a pending call from the connection, such that
- * the pending reply will be ignored. May drop the last
- * reference to the pending call.
- *
- * @param connection the connection
- * @param pending the pending call
- */
-void
-_dbus_connection_remove_pending_call (DBusConnection *connection,
- DBusPendingCall *pending)
-{
- CONNECTION_LOCK (connection);
- _dbus_connection_detach_pending_call_and_unlock (connection, pending);
-}
-
-/**
- * Acquire the transporter I/O path. This must be done before
- * doing any I/O in the transporter. May sleep and drop the
- * IO path mutex while waiting for the I/O path.
- *
- * @param connection the connection.
- * @param timeout_milliseconds maximum blocking time, or -1 for no limit.
- * @returns TRUE if the I/O path was acquired.
- */
-static dbus_bool_t
-_dbus_connection_acquire_io_path (DBusConnection *connection,
- int timeout_milliseconds)
-{
- dbus_bool_t we_acquired;
-
- HAVE_LOCK_CHECK (connection);
-
- /* We don't want the connection to vanish */
- _dbus_connection_ref_unlocked (connection);
-
- /* We will only touch io_path_acquired which is protected by our mutex */
- CONNECTION_UNLOCK (connection);
-
- _dbus_verbose ("locking io_path_mutex\n");
- _dbus_cmutex_lock (connection->io_path_mutex);
-
- _dbus_verbose ("start connection->io_path_acquired = %d timeout = %d\n",
- connection->io_path_acquired, timeout_milliseconds);
-
- we_acquired = FALSE;
-
- if (connection->io_path_acquired)
- {
- if (timeout_milliseconds != -1)
- {
- _dbus_verbose ("waiting %d for IO path to be acquirable\n",
- timeout_milliseconds);
-
- if (!_dbus_condvar_wait_timeout (connection->io_path_cond,
- connection->io_path_mutex,
- timeout_milliseconds))
- {
- /* We timed out before anyone signaled. */
- /* (writing the loop to handle the !timedout case by
- * waiting longer if needed is a pain since dbus
- * wraps pthread_cond_timedwait to take a relative
- * time instead of absolute, something kind of stupid
- * on our part. for now it doesn't matter, we will just
- * end up back here eventually.)
- */
- }
- }
- else
- {
- while (connection->io_path_acquired)
- {
- _dbus_verbose ("waiting for IO path to be acquirable\n");
- _dbus_condvar_wait (connection->io_path_cond,
- connection->io_path_mutex);
- }
- }
- }
-
- if (!connection->io_path_acquired)
- {
- we_acquired = TRUE;
- connection->io_path_acquired = TRUE;
- }
-
- _dbus_verbose ("end connection->io_path_acquired = %d we_acquired = %d\n",
- connection->io_path_acquired, we_acquired);
-
- _dbus_verbose ("unlocking io_path_mutex\n");
- _dbus_cmutex_unlock (connection->io_path_mutex);
-
- CONNECTION_LOCK (connection);
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_connection_unref_unlocked (connection);
-
- return we_acquired;
-}
-
-/**
- * Release the I/O path when you're done with it. Only call
- * after you've acquired the I/O. Wakes up at most one thread
- * currently waiting to acquire the I/O path.
- *
- * @param connection the connection.
- */
-static void
-_dbus_connection_release_io_path (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_verbose ("locking io_path_mutex\n");
- _dbus_cmutex_lock (connection->io_path_mutex);
-
- _dbus_assert (connection->io_path_acquired);
-
- _dbus_verbose ("start connection->io_path_acquired = %d\n",
- connection->io_path_acquired);
-
- connection->io_path_acquired = FALSE;
- _dbus_condvar_wake_one (connection->io_path_cond);
-
- _dbus_verbose ("unlocking io_path_mutex\n");
- _dbus_cmutex_unlock (connection->io_path_mutex);
-}
-
-/**
- * Queues incoming messages and sends outgoing messages for this
- * connection, optionally blocking in the process. Each call to
- * _dbus_connection_do_iteration_unlocked() will call select() or poll() one
- * time and then read or write data if possible.
- *
- * The purpose of this function is to be able to flush outgoing
- * messages or queue up incoming messages without returning
- * control to the application and causing reentrancy weirdness.
- *
- * The flags parameter allows you to specify whether to
- * read incoming messages, write outgoing messages, or both,
- * and whether to block if no immediate action is possible.
- *
- * The timeout_milliseconds parameter does nothing unless the
- * iteration is blocking.
- *
- * If there are no outgoing messages and DBUS_ITERATION_DO_READING
- * wasn't specified, then it's impossible to block, even if
- * you specify DBUS_ITERATION_BLOCK; in that case the function
- * returns immediately.
- *
- * If pending is not NULL then a check is made if the pending call
- * is completed after the io path has been required. If the call
- * has been completed nothing is done. This must be done since
- * the _dbus_connection_acquire_io_path releases the connection
- * lock for a while.
- *
- * Called with connection lock held.
- *
- * @param connection the connection.
- * @param pending the pending call that should be checked or NULL
- * @param flags iteration flags.
- * @param timeout_milliseconds maximum blocking time, or -1 for no limit.
- */
-void
-_dbus_connection_do_iteration_unlocked (DBusConnection *connection,
- DBusPendingCall *pending,
- unsigned int flags,
- int timeout_milliseconds)
-{
- _dbus_verbose ("start\n");
-
- HAVE_LOCK_CHECK (connection);
-
- if (connection->n_outgoing == 0)
- flags &= ~DBUS_ITERATION_DO_WRITING;
-
- if (_dbus_connection_acquire_io_path (connection,
- (flags & DBUS_ITERATION_BLOCK) ? timeout_milliseconds : 0))
- {
- HAVE_LOCK_CHECK (connection);
-
- if ( (pending != NULL) && _dbus_pending_call_get_completed_unlocked(pending))
- {
- _dbus_verbose ("pending call completed while acquiring I/O path");
- }
- else if ( (pending != NULL) &&
- _dbus_connection_peek_for_reply_unlocked (connection,
- _dbus_pending_call_get_reply_serial_unlocked (pending)))
- {
- _dbus_verbose ("pending call completed while acquiring I/O path (reply found in queue)");
- }
- else
- {
- _dbus_transport_do_iteration (connection->transport,
- flags, timeout_milliseconds);
- }
-
- _dbus_connection_release_io_path (connection);
- }
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_verbose ("end\n");
-}
-
-/**
- * Creates a new connection for the given transport. A transport
- * represents a message stream that uses some concrete mechanism, such
- * as UNIX domain sockets. May return #NULL if insufficient
- * memory exists to create the connection.
- *
- * @param transport the transport.
- * @returns the new connection, or #NULL on failure.
- */
-DBusConnection*
-_dbus_connection_new_for_transport (DBusTransport *transport)
-{
- DBusConnection *connection;
- DBusWatchList *watch_list;
- DBusTimeoutList *timeout_list;
- DBusHashTable *pending_replies;
- DBusList *disconnect_link;
- DBusMessage *disconnect_message;
- DBusCounter *outgoing_counter;
- DBusObjectTree *objects;
-
- watch_list = NULL;
- connection = NULL;
- pending_replies = NULL;
- timeout_list = NULL;
- disconnect_link = NULL;
- disconnect_message = NULL;
- outgoing_counter = NULL;
- objects = NULL;
-
- watch_list = _dbus_watch_list_new ();
- if (watch_list == NULL)
- goto error;
-
- timeout_list = _dbus_timeout_list_new ();
- if (timeout_list == NULL)
- goto error;
-
- pending_replies =
- _dbus_hash_table_new (DBUS_HASH_INT,
- NULL,
- (DBusFreeFunction)free_pending_call_on_hash_removal);
- if (pending_replies == NULL)
- goto error;
-
- connection = dbus_new0 (DBusConnection, 1);
- if (connection == NULL)
- goto error;
-
- _dbus_rmutex_new_at_location (&connection->mutex);
- if (connection->mutex == NULL)
- goto error;
-
- _dbus_cmutex_new_at_location (&connection->io_path_mutex);
- if (connection->io_path_mutex == NULL)
- goto error;
-
- _dbus_cmutex_new_at_location (&connection->dispatch_mutex);
- if (connection->dispatch_mutex == NULL)
- goto error;
-
- _dbus_condvar_new_at_location (&connection->dispatch_cond);
- if (connection->dispatch_cond == NULL)
- goto error;
-
- _dbus_condvar_new_at_location (&connection->io_path_cond);
- if (connection->io_path_cond == NULL)
- goto error;
-
- _dbus_rmutex_new_at_location (&connection->slot_mutex);
- if (connection->slot_mutex == NULL)
- goto error;
-
- disconnect_message = dbus_message_new_signal (DBUS_PATH_LOCAL,
- DBUS_INTERFACE_LOCAL,
- "Disconnected");
-
- if (disconnect_message == NULL)
- goto error;
-
- disconnect_link = _dbus_list_alloc_link (disconnect_message);
- if (disconnect_link == NULL)
- goto error;
-
- outgoing_counter = _dbus_counter_new ();
- if (outgoing_counter == NULL)
- goto error;
-
- objects = _dbus_object_tree_new (connection);
- if (objects == NULL)
- goto error;
-
- if (_dbus_modify_sigpipe)
- _dbus_disable_sigpipe ();
-
- /* initialized to 0: use atomic op to avoid mixing atomic and non-atomic */
- _dbus_atomic_inc (&connection->refcount);
- connection->transport = transport;
- connection->watches = watch_list;
- connection->timeouts = timeout_list;
- connection->pending_replies = pending_replies;
- connection->outgoing_counter = outgoing_counter;
- connection->filter_list = NULL;
- connection->last_dispatch_status = DBUS_DISPATCH_COMPLETE; /* so we're notified first time there's data */
- connection->objects = objects;
- connection->exit_on_disconnect = FALSE;
- connection->shareable = FALSE;
- connection->route_peer_messages = FALSE;
- connection->disconnected_message_arrived = FALSE;
- connection->disconnected_message_processed = FALSE;
-
-#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
- connection->generation = _dbus_current_generation;
-#endif
-
- _dbus_data_slot_list_init (&connection->slot_list);
-
- connection->client_serial = 1;
-
- connection->disconnect_message_link = disconnect_link;
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_transport_set_connection (transport, connection))
- {
- CONNECTION_UNLOCK (connection);
-
- goto error;
- }
-
- _dbus_transport_ref (transport);
-
- CONNECTION_UNLOCK (connection);
-
- _dbus_connection_trace_ref (connection, 0, 1, "new_for_transport");
- return connection;
-
- error:
- if (disconnect_message != NULL)
- dbus_message_unref (disconnect_message);
-
- if (disconnect_link != NULL)
- _dbus_list_free_link (disconnect_link);
-
- if (connection != NULL)
- {
- _dbus_condvar_free_at_location (&connection->io_path_cond);
- _dbus_condvar_free_at_location (&connection->dispatch_cond);
- _dbus_rmutex_free_at_location (&connection->mutex);
- _dbus_cmutex_free_at_location (&connection->io_path_mutex);
- _dbus_cmutex_free_at_location (&connection->dispatch_mutex);
- _dbus_rmutex_free_at_location (&connection->slot_mutex);
- dbus_free (connection);
- }
- if (pending_replies)
- _dbus_hash_table_unref (pending_replies);
-
- if (watch_list)
- _dbus_watch_list_free (watch_list);
-
- if (timeout_list)
- _dbus_timeout_list_free (timeout_list);
-
- if (outgoing_counter)
- _dbus_counter_unref (outgoing_counter);
-
- if (objects)
- _dbus_object_tree_unref (objects);
-
- return NULL;
-}
-
-/**
- * Increments the reference count of a DBusConnection.
- * Requires that the caller already holds the connection lock.
- *
- * @param connection the connection.
- * @returns the connection.
- */
-DBusConnection *
-_dbus_connection_ref_unlocked (DBusConnection *connection)
-{
- dbus_int32_t old_refcount;
-
- _dbus_assert (connection != NULL);
- _dbus_assert (connection->generation == _dbus_current_generation);
-
- HAVE_LOCK_CHECK (connection);
-
- old_refcount = _dbus_atomic_inc (&connection->refcount);
- _dbus_connection_trace_ref (connection, old_refcount, old_refcount + 1,
- "ref_unlocked");
-
- return connection;
-}
-
-/**
- * Decrements the reference count of a DBusConnection.
- * Requires that the caller already holds the connection lock.
- *
- * @param connection the connection.
- */
-void
-_dbus_connection_unref_unlocked (DBusConnection *connection)
-{
- dbus_int32_t old_refcount;
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_assert (connection != NULL);
-
- old_refcount = _dbus_atomic_dec (&connection->refcount);
-
- _dbus_connection_trace_ref (connection, old_refcount, old_refcount - 1,
- "unref_unlocked");
-
- if (old_refcount == 1)
- _dbus_connection_last_unref (connection);
-}
-
-static dbus_uint32_t
-_dbus_connection_get_next_client_serial (DBusConnection *connection)
-{
- dbus_uint32_t serial;
-
- serial = connection->client_serial++;
-
- if (connection->client_serial == 0)
- connection->client_serial = 1;
-
- return serial;
-}
-
-/**
- * A callback for use with dbus_watch_new() to create a DBusWatch.
- *
- * @todo This is basically a hack - we could delete _dbus_transport_handle_watch()
- * and the virtual handle_watch in DBusTransport if we got rid of it.
- * The reason this is some work is threading, see the _dbus_connection_handle_watch()
- * implementation.
- *
- * @param watch the watch.
- * @param condition the current condition of the file descriptors being watched.
- * @param data must be a pointer to a #DBusConnection
- * @returns #FALSE if the IO condition may not have been fully handled due to lack of memory
- */
-dbus_bool_t
-_dbus_connection_handle_watch (DBusWatch *watch,
- unsigned int condition,
- void *data)
-{
- DBusConnection *connection;
- dbus_bool_t retval;
- DBusDispatchStatus status;
-
- connection = data;
-
- _dbus_verbose ("start\n");
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_connection_acquire_io_path (connection, 1))
- {
- /* another thread is handling the message */
- CONNECTION_UNLOCK (connection);
- return TRUE;
- }
-
- HAVE_LOCK_CHECK (connection);
- retval = _dbus_transport_handle_watch (connection->transport,
- watch, condition);
-
- _dbus_connection_release_io_path (connection);
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_verbose ("middle\n");
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* this calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- _dbus_verbose ("end\n");
-
- return retval;
-}
-
-/* Protected by _DBUS_LOCK (shared_connections) */
-static DBusHashTable *shared_connections = NULL;
-static DBusList *shared_connections_no_guid = NULL;
-
-static void
-close_connection_on_shutdown (DBusConnection *connection)
-{
- DBusMessage *message;
-
- dbus_connection_ref (connection);
- _dbus_connection_close_possibly_shared (connection);
-
- /* Churn through to the Disconnected message */
- while ((message = dbus_connection_pop_message (connection)))
- {
- dbus_message_unref (message);
- }
- dbus_connection_unref (connection);
-}
-
-static void
-shared_connections_shutdown (void *data)
-{
- int n_entries;
-
- if (!_DBUS_LOCK (shared_connections))
- {
- /* We'd have initialized locks before adding anything, so there
- * can't be anything there. */
- return;
- }
-
- /* This is a little bit unpleasant... better ideas? */
- while ((n_entries = _dbus_hash_table_get_n_entries (shared_connections)) > 0)
- {
- DBusConnection *connection;
- DBusHashIter iter;
-
- _dbus_hash_iter_init (shared_connections, &iter);
- _dbus_hash_iter_next (&iter);
-
- connection = _dbus_hash_iter_get_value (&iter);
-
- _DBUS_UNLOCK (shared_connections);
- close_connection_on_shutdown (connection);
- if (!_DBUS_LOCK (shared_connections))
- _dbus_assert_not_reached ("global locks were already initialized");
-
- /* The connection should now be dead and not in our hash ... */
- _dbus_assert (_dbus_hash_table_get_n_entries (shared_connections) < n_entries);
- }
-
- _dbus_assert (_dbus_hash_table_get_n_entries (shared_connections) == 0);
-
- _dbus_hash_table_unref (shared_connections);
- shared_connections = NULL;
-
- if (shared_connections_no_guid != NULL)
- {
- DBusConnection *connection;
- connection = _dbus_list_pop_first (&shared_connections_no_guid);
- while (connection != NULL)
- {
- _DBUS_UNLOCK (shared_connections);
- close_connection_on_shutdown (connection);
- if (!_DBUS_LOCK (shared_connections))
- _dbus_assert_not_reached ("global locks were already initialized");
- connection = _dbus_list_pop_first (&shared_connections_no_guid);
- }
- }
-
- shared_connections_no_guid = NULL;
-
- _DBUS_UNLOCK (shared_connections);
-}
-
-static dbus_bool_t
-connection_lookup_shared (DBusAddressEntry *entry,
- DBusConnection **result)
-{
- _dbus_verbose ("checking for existing connection\n");
-
- *result = NULL;
-
- if (!_DBUS_LOCK (shared_connections))
- {
- /* If it was shared, we'd have initialized global locks when we put
- * it in shared_connections. */
- return FALSE;
- }
-
- if (shared_connections == NULL)
- {
- _dbus_verbose ("creating shared_connections hash table\n");
-
- shared_connections = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free,
- NULL);
- if (shared_connections == NULL)
- {
- _DBUS_UNLOCK (shared_connections);
- return FALSE;
- }
-
- if (!_dbus_register_shutdown_func (shared_connections_shutdown, NULL))
- {
- _dbus_hash_table_unref (shared_connections);
- shared_connections = NULL;
- _DBUS_UNLOCK (shared_connections);
- return FALSE;
- }
-
- _dbus_verbose (" successfully created shared_connections\n");
-
- _DBUS_UNLOCK (shared_connections);
- return TRUE; /* no point looking up in the hash we just made */
- }
- else
- {
- const char *guid;
-
- guid = dbus_address_entry_get_value (entry, "guid");
-
- if (guid != NULL)
- {
- DBusConnection *connection;
-
- connection = _dbus_hash_table_lookup_string (shared_connections,
- guid);
-
- if (connection)
- {
- /* The DBusConnection can't be finalized without taking
- * the shared_connections lock to remove it from the
- * hash. So it's safe to ref the connection here.
- * However, it may be disconnected if the Disconnected
- * message hasn't been processed yet, in which case we
- * want to pretend it isn't in the hash and avoid
- * returning it.
- *
- * The idea is to avoid ever returning a disconnected connection
- * from dbus_connection_open(). We could just synchronously
- * drop our shared ref to the connection on connection disconnect,
- * and then assert here that the connection is connected, but
- * that causes reentrancy headaches.
- */
- CONNECTION_LOCK (connection);
- if (_dbus_connection_get_is_connected_unlocked (connection))
- {
- _dbus_connection_ref_unlocked (connection);
- *result = connection;
- _dbus_verbose ("looked up existing connection to server guid %s\n",
- guid);
- }
- else
- {
- _dbus_verbose ("looked up existing connection to server guid %s but it was disconnected so ignoring it\n",
- guid);
- }
- CONNECTION_UNLOCK (connection);
- }
- }
-
- _DBUS_UNLOCK (shared_connections);
- return TRUE;
- }
-}
-
-static dbus_bool_t
-connection_record_shared_unlocked (DBusConnection *connection,
- const char *guid)
-{
- char *guid_key;
- char *guid_in_connection;
-
- HAVE_LOCK_CHECK (connection);
- _dbus_assert (connection->server_guid == NULL);
- _dbus_assert (connection->shareable);
-
- /* get a hard ref on this connection, even if
- * we won't in fact store it in the hash, we still
- * need to hold a ref on it until it's disconnected.
- */
- _dbus_connection_ref_unlocked (connection);
-
- if (guid == NULL)
- {
- if (!_DBUS_LOCK (shared_connections))
- return FALSE;
-
- if (!_dbus_list_prepend (&shared_connections_no_guid, connection))
- {
- _DBUS_UNLOCK (shared_connections);
- return FALSE;
- }
-
- _DBUS_UNLOCK (shared_connections);
- return TRUE; /* don't store in the hash */
- }
-
- /* A separate copy of the key is required in the hash table, because
- * we don't have a lock on the connection when we are doing a hash
- * lookup.
- */
-
- guid_key = _dbus_strdup (guid);
- if (guid_key == NULL)
- return FALSE;
-
- guid_in_connection = _dbus_strdup (guid);
- if (guid_in_connection == NULL)
- {
- dbus_free (guid_key);
- return FALSE;
- }
-
- if (!_DBUS_LOCK (shared_connections))
- {
- dbus_free (guid_in_connection);
- dbus_free (guid_key);
- return FALSE;
- }
-
- _dbus_assert (shared_connections != NULL);
-
- if (!_dbus_hash_table_insert_string (shared_connections,
- guid_key, connection))
- {
- dbus_free (guid_key);
- dbus_free (guid_in_connection);
- _DBUS_UNLOCK (shared_connections);
- return FALSE;
- }
-
- connection->server_guid = guid_in_connection;
-
- _dbus_verbose ("stored connection to %s to be shared\n",
- connection->server_guid);
-
- _DBUS_UNLOCK (shared_connections);
-
- _dbus_assert (connection->server_guid != NULL);
-
- return TRUE;
-}
-
-static void
-connection_forget_shared_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- if (!connection->shareable)
- return;
-
- if (!_DBUS_LOCK (shared_connections))
- {
- /* If it was shared, we'd have initialized global locks when we put
- * it in the table; so it can't be there. */
- return;
- }
-
- if (connection->server_guid != NULL)
- {
- _dbus_verbose ("dropping connection to %s out of the shared table\n",
- connection->server_guid);
-
- if (!_dbus_hash_table_remove_string (shared_connections,
- connection->server_guid))
- _dbus_assert_not_reached ("connection was not in the shared table");
-
- dbus_free (connection->server_guid);
- connection->server_guid = NULL;
- }
- else
- {
- _dbus_list_remove (&shared_connections_no_guid, connection);
- }
-
- _DBUS_UNLOCK (shared_connections);
-
- /* remove our reference held on all shareable connections */
- _dbus_connection_unref_unlocked (connection);
-}
-
-static DBusConnection*
-connection_try_from_address_entry (DBusAddressEntry *entry,
- DBusError *error)
-{
- DBusTransport *transport;
- DBusConnection *connection;
-
- transport = _dbus_transport_open (entry, error);
-
- if (transport == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return NULL;
- }
-
- connection = _dbus_connection_new_for_transport (transport);
-
- _dbus_transport_unref (transport);
-
- if (connection == NULL)
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
-#ifndef DBUS_DISABLE_CHECKS
- _dbus_assert (!connection->have_connection_lock);
-#endif
- return connection;
-}
-
-/*
- * If the shared parameter is true, then any existing connection will
- * be used (and if a new connection is created, it will be available
- * for use by others). If the shared parameter is false, a new
- * connection will always be created, and the new connection will
- * never be returned to other callers.
- *
- * @param address the address
- * @param shared whether the connection is shared or private
- * @param error error return
- * @returns the connection or #NULL on error
- */
-static DBusConnection*
-_dbus_connection_open_internal (const char *address,
- dbus_bool_t shared,
- DBusError *error)
-{
- DBusConnection *connection;
- DBusAddressEntry **entries;
- DBusError tmp_error = DBUS_ERROR_INIT;
- DBusError first_error = DBUS_ERROR_INIT;
- int len, i;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_verbose ("opening %s connection to: %s\n",
- shared ? "shared" : "private", address);
-
- if (!dbus_parse_address (address, &entries, &len, error))
- return NULL;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- connection = NULL;
-
- for (i = 0; i < len; i++)
- {
- if (shared)
- {
- if (!connection_lookup_shared (entries[i], &connection))
- _DBUS_SET_OOM (&tmp_error);
- }
-
- if (connection == NULL)
- {
- connection = connection_try_from_address_entry (entries[i],
- &tmp_error);
-
- if (connection != NULL && shared)
- {
- const char *guid;
-
- connection->shareable = TRUE;
-
- /* guid may be NULL */
- guid = dbus_address_entry_get_value (entries[i], "guid");
-
- CONNECTION_LOCK (connection);
-
- if (!connection_record_shared_unlocked (connection, guid))
- {
- _DBUS_SET_OOM (&tmp_error);
- _dbus_connection_close_possibly_shared_and_unlock (connection);
- dbus_connection_unref (connection);
- connection = NULL;
- }
- else
- CONNECTION_UNLOCK (connection);
- }
- }
-
- if (connection)
- break;
-
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
-
- if (i == 0)
- dbus_move_error (&tmp_error, &first_error);
- else
- dbus_error_free (&tmp_error);
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- if (connection == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (&first_error);
- dbus_move_error (&first_error, error);
- }
- else
- dbus_error_free (&first_error);
-
- dbus_address_entries_free (entries);
- return connection;
-}
-
-/**
- * Closes a shared OR private connection, while dbus_connection_close() can
- * only be used on private connections. Should only be called by the
- * dbus code that owns the connection - an owner must be known,
- * the open/close state is like malloc/free, not like ref/unref.
- *
- * @param connection the connection
- */
-void
-_dbus_connection_close_possibly_shared (DBusConnection *connection)
-{
- _dbus_assert (connection != NULL);
- _dbus_assert (connection->generation == _dbus_current_generation);
-
- CONNECTION_LOCK (connection);
- _dbus_connection_close_possibly_shared_and_unlock (connection);
-}
-
-static DBusPreallocatedSend*
-_dbus_connection_preallocate_send_unlocked (DBusConnection *connection)
-{
- DBusPreallocatedSend *preallocated;
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_assert (connection != NULL);
-
- preallocated = dbus_new (DBusPreallocatedSend, 1);
- if (preallocated == NULL)
- return NULL;
-
- preallocated->queue_link = _dbus_list_alloc_link (NULL);
- if (preallocated->queue_link == NULL)
- goto failed_0;
-
- preallocated->counter_link = _dbus_list_alloc_link (connection->outgoing_counter);
- if (preallocated->counter_link == NULL)
- goto failed_1;
-
- _dbus_counter_ref (preallocated->counter_link->data);
-
- preallocated->connection = connection;
-
- return preallocated;
-
- failed_1:
- _dbus_list_free_link (preallocated->queue_link);
- failed_0:
- dbus_free (preallocated);
-
- return NULL;
-}
-
-/* Called with lock held, does not update dispatch status */
-static void
-_dbus_connection_send_preallocated_unlocked_no_update (DBusConnection *connection,
- DBusPreallocatedSend *preallocated,
- DBusMessage *message,
- dbus_uint32_t *client_serial)
-{
- dbus_uint32_t serial;
-
- preallocated->queue_link->data = message;
- _dbus_list_prepend_link (&connection->outgoing_messages,
- preallocated->queue_link);
-
- /* It's OK that we'll never call the notify function, because for the
- * outgoing limit, there isn't one */
- _dbus_message_add_counter_link (message,
- preallocated->counter_link);
-
- dbus_free (preallocated);
- preallocated = NULL;
-
- dbus_message_ref (message);
-
- connection->n_outgoing += 1;
-
- _dbus_verbose ("Message %p (%s %s %s %s '%s') for %s added to outgoing queue %p, %d pending to send\n",
- message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_path (message) ?
- dbus_message_get_path (message) :
- "no path",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message),
- dbus_message_get_destination (message) ?
- dbus_message_get_destination (message) :
- "null",
- connection,
- connection->n_outgoing);
-
- if (dbus_message_get_serial (message) == 0)
- {
- serial = _dbus_connection_get_next_client_serial (connection);
- dbus_message_set_serial (message, serial);
- if (client_serial)
- *client_serial = serial;
- }
- else
- {
- if (client_serial)
- *client_serial = dbus_message_get_serial (message);
- }
-
- _dbus_verbose ("Message %p serial is %u\n",
- message, dbus_message_get_serial (message));
-
- dbus_message_lock (message);
-
- /* Now we need to run an iteration to hopefully just write the messages
- * out immediately, and otherwise get them queued up
- */
- _dbus_connection_do_iteration_unlocked (connection,
- NULL,
- DBUS_ITERATION_DO_WRITING,
- -1);
-
- /* If stuff is still queued up, be sure we wake up the main loop */
- if (connection->n_outgoing > 0)
- _dbus_connection_wakeup_mainloop (connection);
-}
-
-static void
-_dbus_connection_send_preallocated_and_unlock (DBusConnection *connection,
- DBusPreallocatedSend *preallocated,
- DBusMessage *message,
- dbus_uint32_t *client_serial)
-{
- DBusDispatchStatus status;
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_connection_send_preallocated_unlocked_no_update (connection,
- preallocated,
- message, client_serial);
-
- _dbus_verbose ("middle\n");
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* this calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-}
-
-/**
- * Like dbus_connection_send(), but assumes the connection
- * is already locked on function entry, and unlocks before returning.
- *
- * @param connection the connection
- * @param message the message to send
- * @param client_serial return location for client serial of sent message
- * @returns #FALSE on out-of-memory
- */
-dbus_bool_t
-_dbus_connection_send_and_unlock (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *client_serial)
-{
- DBusPreallocatedSend *preallocated;
-
- _dbus_assert (connection != NULL);
- _dbus_assert (message != NULL);
-
- preallocated = _dbus_connection_preallocate_send_unlocked (connection);
- if (preallocated == NULL)
- {
- CONNECTION_UNLOCK (connection);
- return FALSE;
- }
-
- _dbus_connection_send_preallocated_and_unlock (connection,
- preallocated,
- message,
- client_serial);
- return TRUE;
-}
-
-/**
- * Used internally to handle the semantics of dbus_server_set_new_connection_function().
- * If the new connection function does not ref the connection, we want to close it.
- *
- * A bit of a hack, probably the new connection function should have returned a value
- * for whether to close, or should have had to close the connection itself if it
- * didn't want it.
- *
- * But, this works OK as long as the new connection function doesn't do anything
- * crazy like keep the connection around without ref'ing it.
- *
- * We have to lock the connection across refcount check and close in case
- * the new connection function spawns a thread that closes and unrefs.
- * In that case, if the app thread
- * closes and unrefs first, we'll harmlessly close again; if the app thread
- * still has the ref, we'll close and then the app will close harmlessly.
- * If the app unrefs without closing, the app is broken since if the
- * app refs from the new connection function it is supposed to also close.
- *
- * If we didn't atomically check the refcount and close with the lock held
- * though, we could screw this up.
- *
- * @param connection the connection
- */
-void
-_dbus_connection_close_if_only_one_ref (DBusConnection *connection)
-{
- dbus_int32_t refcount;
-
- CONNECTION_LOCK (connection);
-
- refcount = _dbus_atomic_get (&connection->refcount);
- /* The caller should have at least one ref */
- _dbus_assert (refcount >= 1);
-
- if (refcount == 1)
- _dbus_connection_close_possibly_shared_and_unlock (connection);
- else
- CONNECTION_UNLOCK (connection);
-}
-
-
-/**
- * When a function that blocks has been called with a timeout, and we
- * run out of memory, the time to wait for memory is based on the
- * timeout. If the caller was willing to block a long time we wait a
- * relatively long time for memory, if they were only willing to block
- * briefly then we retry for memory at a rapid rate.
- *
- * @param timeout_milliseconds the timeout requested for blocking
- */
-static void
-_dbus_memory_pause_based_on_timeout (int timeout_milliseconds)
-{
- if (timeout_milliseconds == -1)
- _dbus_sleep_milliseconds (1000);
- else if (timeout_milliseconds < 100)
- ; /* just busy loop */
- else if (timeout_milliseconds <= 1000)
- _dbus_sleep_milliseconds (timeout_milliseconds / 3);
- else
- _dbus_sleep_milliseconds (1000);
-}
-
-static DBusMessage *
-generate_local_error_message (dbus_uint32_t serial,
- char *error_name,
- char *error_msg)
-{
- DBusMessage *message;
- message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
- if (!message)
- goto out;
-
- if (!dbus_message_set_error_name (message, error_name))
- {
- dbus_message_unref (message);
- message = NULL;
- goto out;
- }
-
- dbus_message_set_no_reply (message, TRUE);
-
- if (!dbus_message_set_reply_serial (message,
- serial))
- {
- dbus_message_unref (message);
- message = NULL;
- goto out;
- }
-
- if (error_msg != NULL)
- {
- DBusMessageIter iter;
-
- dbus_message_iter_init_append (message, &iter);
- if (!dbus_message_iter_append_basic (&iter,
- DBUS_TYPE_STRING,
- &error_msg))
- {
- dbus_message_unref (message);
- message = NULL;
- goto out;
- }
- }
-
- out:
- return message;
-}
-
-/*
- * Peek the incoming queue to see if we got reply for a specific serial
- */
-static dbus_bool_t
-_dbus_connection_peek_for_reply_unlocked (DBusConnection *connection,
- dbus_uint32_t client_serial)
-{
- DBusList *link;
- HAVE_LOCK_CHECK (connection);
-
- link = _dbus_list_get_first_link (&connection->incoming_messages);
-
- while (link != NULL)
- {
- DBusMessage *reply = link->data;
-
- if (dbus_message_get_reply_serial (reply) == client_serial)
- {
- _dbus_verbose ("%s reply to %d found in queue\n", _DBUS_FUNCTION_NAME, client_serial);
- return TRUE;
- }
- link = _dbus_list_get_next_link (&connection->incoming_messages, link);
- }
-
- return FALSE;
-}
-
-/* This is slightly strange since we can pop a message here without
- * the dispatch lock.
- */
-static DBusMessage*
-check_for_reply_unlocked (DBusConnection *connection,
- dbus_uint32_t client_serial)
-{
- DBusList *link;
-
- HAVE_LOCK_CHECK (connection);
-
- link = _dbus_list_get_first_link (&connection->incoming_messages);
-
- while (link != NULL)
- {
- DBusMessage *reply = link->data;
-
- if (dbus_message_get_reply_serial (reply) == client_serial)
- {
- _dbus_list_remove_link (&connection->incoming_messages, link);
- connection->n_incoming -= 1;
- return reply;
- }
- link = _dbus_list_get_next_link (&connection->incoming_messages, link);
- }
-
- return NULL;
-}
-
-static void
-connection_timeout_and_complete_all_pending_calls_unlocked (DBusConnection *connection)
-{
- /* We can't iterate over the hash in the normal way since we'll be
- * dropping the lock for each item. So we restart the
- * iter each time as we drain the hash table.
- */
-
- while (_dbus_hash_table_get_n_entries (connection->pending_replies) > 0)
- {
- DBusPendingCall *pending;
- DBusHashIter iter;
-
- _dbus_hash_iter_init (connection->pending_replies, &iter);
- _dbus_hash_iter_next (&iter);
-
- pending = _dbus_hash_iter_get_value (&iter);
- _dbus_pending_call_ref_unlocked (pending);
-
- _dbus_pending_call_queue_timeout_error_unlocked (pending,
- connection);
-
- if (_dbus_pending_call_is_timeout_added_unlocked (pending))
- _dbus_connection_remove_timeout_unlocked (connection,
- _dbus_pending_call_get_timeout_unlocked (pending));
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
- _dbus_hash_iter_remove_entry (&iter);
-
- _dbus_pending_call_unref_and_unlock (pending);
- CONNECTION_LOCK (connection);
- }
- HAVE_LOCK_CHECK (connection);
-}
-
-static void
-complete_pending_call_and_unlock (DBusConnection *connection,
- DBusPendingCall *pending,
- DBusMessage *message)
-{
- _dbus_pending_call_set_reply_unlocked (pending, message);
- _dbus_pending_call_ref_unlocked (pending); /* in case there's no app with a ref held */
- _dbus_connection_detach_pending_call_and_unlock (connection, pending);
-
- /* Must be called unlocked since it invokes app callback */
- _dbus_pending_call_complete (pending);
- dbus_pending_call_unref (pending);
-}
-
-static dbus_bool_t
-check_for_reply_and_update_dispatch_unlocked (DBusConnection *connection,
- DBusPendingCall *pending)
-{
- DBusMessage *reply;
- DBusDispatchStatus status;
-
- reply = check_for_reply_unlocked (connection,
- _dbus_pending_call_get_reply_serial_unlocked (pending));
- if (reply != NULL)
- {
- _dbus_verbose ("checked for reply\n");
-
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n");
-
- complete_pending_call_and_unlock (connection, pending, reply);
- dbus_message_unref (reply);
-
- CONNECTION_LOCK (connection);
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- dbus_pending_call_unref (pending);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * Blocks until a pending call times out or gets a reply.
- *
- * Does not re-enter the main loop or run filter/path-registered
- * callbacks. The reply to the message will not be seen by
- * filter callbacks.
- *
- * Returns immediately if pending call already got a reply.
- *
- * @todo could use performance improvements (it keeps scanning
- * the whole message queue for example)
- *
- * @param pending the pending call we block for a reply on
- */
-void
-_dbus_connection_block_pending_call (DBusPendingCall *pending)
-{
- long start_tv_sec, start_tv_usec;
- long tv_sec, tv_usec;
- DBusDispatchStatus status;
- DBusConnection *connection;
- dbus_uint32_t client_serial;
- DBusTimeout *timeout;
- int timeout_milliseconds, elapsed_milliseconds;
-
- _dbus_assert (pending != NULL);
-
- if (dbus_pending_call_get_completed (pending))
- return;
-
- dbus_pending_call_ref (pending); /* necessary because the call could be canceled */
-
- connection = _dbus_pending_call_get_connection_and_lock (pending);
-
- /* Flush message queue - note, can affect dispatch status */
- _dbus_connection_flush_unlocked (connection);
-
- client_serial = _dbus_pending_call_get_reply_serial_unlocked (pending);
-
- /* note that timeout_milliseconds is limited to a smallish value
- * in _dbus_pending_call_new() so overflows aren't possible
- * below
- */
- timeout = _dbus_pending_call_get_timeout_unlocked (pending);
- _dbus_get_monotonic_time (&start_tv_sec, &start_tv_usec);
- if (timeout)
- {
- timeout_milliseconds = dbus_timeout_get_interval (timeout);
-
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): will block %d milliseconds for reply serial %u from %ld sec %ld usec\n",
- timeout_milliseconds,
- client_serial,
- start_tv_sec, start_tv_usec);
- }
- else
- {
- timeout_milliseconds = -1;
-
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): will block for reply serial %u\n", client_serial);
- }
-
- /* check to see if we already got the data off the socket */
- /* from another blocked pending call */
- if (check_for_reply_and_update_dispatch_unlocked (connection, pending))
- return;
-
- /* Now we wait... */
- /* always block at least once as we know we don't have the reply yet */
- _dbus_connection_do_iteration_unlocked (connection,
- pending,
- DBUS_ITERATION_DO_READING |
- DBUS_ITERATION_BLOCK,
- timeout_milliseconds);
-
- recheck_status:
-
- _dbus_verbose ("top of recheck\n");
-
- HAVE_LOCK_CHECK (connection);
-
- /* queue messages and get status */
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* the get_completed() is in case a dispatch() while we were blocking
- * got the reply instead of us.
- */
- if (_dbus_pending_call_get_completed_unlocked (pending))
- {
- _dbus_verbose ("Pending call completed by dispatch\n");
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- dbus_pending_call_unref (pending);
- return;
- }
-
- if (status == DBUS_DISPATCH_DATA_REMAINS)
- {
- if (check_for_reply_and_update_dispatch_unlocked (connection, pending))
- return;
- }
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
- elapsed_milliseconds = (tv_sec - start_tv_sec) * 1000 +
- (tv_usec - start_tv_usec) / 1000;
-
- if (!_dbus_connection_get_is_connected_unlocked (connection))
- {
- DBusMessage *error_msg;
-
- error_msg = generate_local_error_message (client_serial,
- DBUS_ERROR_DISCONNECTED,
- "Connection was disconnected before a reply was received");
-
- /* on OOM error_msg is set to NULL */
- complete_pending_call_and_unlock (connection, pending, error_msg);
- dbus_pending_call_unref (pending);
- return;
- }
- else if (connection->disconnect_message_link == NULL)
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): disconnected\n");
- else if (timeout == NULL)
- {
- if (status == DBUS_DISPATCH_NEED_MEMORY)
- {
- /* Try sleeping a bit, as we aren't sure we need to block for reading,
- * we may already have a reply in the buffer and just can't process
- * it.
- */
- _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
-
- _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
- }
- else
- {
- /* block again, we don't have the reply buffered yet. */
- _dbus_connection_do_iteration_unlocked (connection,
- pending,
- DBUS_ITERATION_DO_READING |
- DBUS_ITERATION_BLOCK,
- timeout_milliseconds - elapsed_milliseconds);
- }
-
- goto recheck_status;
- }
- else if (tv_sec < start_tv_sec)
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): clock set backward\n");
- else if (elapsed_milliseconds < timeout_milliseconds)
- {
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): %d milliseconds remain\n", timeout_milliseconds - elapsed_milliseconds);
-
- if (status == DBUS_DISPATCH_NEED_MEMORY)
- {
- /* Try sleeping a bit, as we aren't sure we need to block for reading,
- * we may already have a reply in the buffer and just can't process
- * it.
- */
- _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
-
- _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
- }
- else
- {
- /* block again, we don't have the reply buffered yet. */
- _dbus_connection_do_iteration_unlocked (connection,
- NULL,
- DBUS_ITERATION_DO_READING |
- DBUS_ITERATION_BLOCK,
- timeout_milliseconds - elapsed_milliseconds);
- }
-
- goto recheck_status;
- }
-
- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): Waited %d milliseconds and got no reply\n",
- elapsed_milliseconds);
-
- _dbus_assert (!_dbus_pending_call_get_completed_unlocked (pending));
-
- /* unlock and call user code */
- complete_pending_call_and_unlock (connection, pending, NULL);
-
- /* update user code on dispatch status */
- CONNECTION_LOCK (connection);
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- dbus_pending_call_unref (pending);
-}
-
-/** @} */
-
-/**
- * @addtogroup DBusConnection
- *
- * @{
- */
-
-/**
- * Gets a connection to a remote address. If a connection to the given
- * address already exists, returns the existing connection with its
- * reference count incremented. Otherwise, returns a new connection
- * and saves the new connection for possible re-use if a future call
- * to dbus_connection_open() asks to connect to the same server.
- *
- * Use dbus_connection_open_private() to get a dedicated connection
- * not shared with other callers of dbus_connection_open().
- *
- * If the open fails, the function returns #NULL, and provides a
- * reason for the failure in the error parameter. Pass #NULL for the
- * error parameter if you aren't interested in the reason for
- * failure.
- *
- * Because this connection is shared, no user of the connection
- * may call dbus_connection_close(). However, when you are done with the
- * connection you should call dbus_connection_unref().
- *
- * @note Prefer dbus_connection_open() to dbus_connection_open_private()
- * unless you have good reason; connections are expensive enough
- * that it's wasteful to create lots of connections to the same
- * server.
- *
- * @param address the address.
- * @param error address where an error can be returned.
- * @returns new connection, or #NULL on failure.
- */
-DBusConnection*
-dbus_connection_open (const char *address,
- DBusError *error)
-{
- DBusConnection *connection;
-
- _dbus_return_val_if_fail (address != NULL, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
- connection = _dbus_connection_open_internal (address,
- TRUE,
- error);
-
- return connection;
-}
-
-/**
- * Opens a new, dedicated connection to a remote address. Unlike
- * dbus_connection_open(), always creates a new connection.
- * This connection will not be saved or recycled by libdbus.
- *
- * If the open fails, the function returns #NULL, and provides a
- * reason for the failure in the error parameter. Pass #NULL for the
- * error parameter if you aren't interested in the reason for
- * failure.
- *
- * When you are done with this connection, you must
- * dbus_connection_close() to disconnect it,
- * and dbus_connection_unref() to free the connection object.
- *
- * (The dbus_connection_close() can be skipped if the
- * connection is already known to be disconnected, for example
- * if you are inside a handler for the Disconnected signal.)
- *
- * @note Prefer dbus_connection_open() to dbus_connection_open_private()
- * unless you have good reason; connections are expensive enough
- * that it's wasteful to create lots of connections to the same
- * server.
- *
- * @param address the address.
- * @param error address where an error can be returned.
- * @returns new connection, or #NULL on failure.
- */
-DBusConnection*
-dbus_connection_open_private (const char *address,
- DBusError *error)
-{
- DBusConnection *connection;
-
- _dbus_return_val_if_fail (address != NULL, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
- connection = _dbus_connection_open_internal (address,
- FALSE,
- error);
-
- return connection;
-}
-
-/**
- * Increments the reference count of a DBusConnection.
- *
- * @param connection the connection.
- * @returns the connection.
- */
-DBusConnection *
-dbus_connection_ref (DBusConnection *connection)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
- _dbus_return_val_if_fail (connection->generation == _dbus_current_generation, NULL);
- old_refcount = _dbus_atomic_inc (&connection->refcount);
- _dbus_connection_trace_ref (connection, old_refcount, old_refcount + 1,
- "ref");
-
- return connection;
-}
-
-static void
-free_outgoing_message (void *element,
- void *data)
-{
- DBusMessage *message = element;
- DBusConnection *connection = data;
-
- _dbus_message_remove_counter (message, connection->outgoing_counter);
- dbus_message_unref (message);
-}
-
-/* This is run without the mutex held, but after the last reference
- * to the connection has been dropped we should have no thread-related
- * problems
- */
-static void
-_dbus_connection_last_unref (DBusConnection *connection)
-{
- DBusList *link;
-
- _dbus_verbose ("Finalizing connection %p\n", connection);
-
- _dbus_assert (_dbus_atomic_get (&connection->refcount) == 0);
-
- /* You have to disconnect the connection before unref:ing it. Otherwise
- * you won't get the disconnected message.
- */
- _dbus_assert (!_dbus_transport_get_is_connected (connection->transport));
- _dbus_assert (connection->server_guid == NULL);
-
- /* ---- We're going to call various application callbacks here, hope it doesn't break anything... */
- _dbus_object_tree_free_all_unlocked (connection->objects);
-
- dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL);
- dbus_connection_set_wakeup_main_function (connection, NULL, NULL, NULL);
- dbus_connection_set_unix_user_function (connection, NULL, NULL, NULL);
- dbus_connection_set_windows_user_function (connection, NULL, NULL, NULL);
-
- _dbus_watch_list_free (connection->watches);
- connection->watches = NULL;
-
- _dbus_timeout_list_free (connection->timeouts);
- connection->timeouts = NULL;
-
- _dbus_data_slot_list_free (&connection->slot_list);
-
- link = _dbus_list_get_first_link (&connection->filter_list);
- while (link != NULL)
- {
- DBusMessageFilter *filter = link->data;
- DBusList *next = _dbus_list_get_next_link (&connection->filter_list, link);
-
- filter->function = NULL;
- _dbus_message_filter_unref (filter); /* calls app callback */
- link->data = NULL;
-
- link = next;
- }
- _dbus_list_clear (&connection->filter_list);
-
- /* ---- Done with stuff that invokes application callbacks */
-
- _dbus_object_tree_unref (connection->objects);
-
- _dbus_hash_table_unref (connection->pending_replies);
- connection->pending_replies = NULL;
-
- _dbus_list_clear (&connection->filter_list);
-
- _dbus_list_foreach (&connection->outgoing_messages,
- free_outgoing_message,
- connection);
- _dbus_list_clear (&connection->outgoing_messages);
-
- _dbus_list_foreach (&connection->incoming_messages,
- (DBusForeachFunction) dbus_message_unref,
- NULL);
- _dbus_list_clear (&connection->incoming_messages);
-
- _dbus_counter_unref (connection->outgoing_counter);
-
- _dbus_transport_unref (connection->transport);
-
- if (connection->disconnect_message_link)
- {
- DBusMessage *message = connection->disconnect_message_link->data;
- dbus_message_unref (message);
- _dbus_list_free_link (connection->disconnect_message_link);
- }
-
- _dbus_condvar_free_at_location (&connection->dispatch_cond);
- _dbus_condvar_free_at_location (&connection->io_path_cond);
-
- _dbus_cmutex_free_at_location (&connection->io_path_mutex);
- _dbus_cmutex_free_at_location (&connection->dispatch_mutex);
-
- _dbus_rmutex_free_at_location (&connection->slot_mutex);
-
- _dbus_rmutex_free_at_location (&connection->mutex);
-
- dbus_free (connection);
-}
-
-/**
- * Decrements the reference count of a DBusConnection, and finalizes
- * it if the count reaches zero.
- *
- * Note: it is a bug to drop the last reference to a connection that
- * is still connected.
- *
- * For shared connections, libdbus will own a reference
- * as long as the connection is connected, so you can know that either
- * you don't have the last reference, or it's OK to drop the last reference.
- * Most connections are shared. dbus_connection_open() and dbus_bus_get()
- * return shared connections.
- *
- * For private connections, the creator of the connection must arrange for
- * dbus_connection_close() to be called prior to dropping the last reference.
- * Private connections come from dbus_connection_open_private() or dbus_bus_get_private().
- *
- * @param connection the connection.
- */
-void
-dbus_connection_unref (DBusConnection *connection)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (connection->generation == _dbus_current_generation);
-
- old_refcount = _dbus_atomic_dec (&connection->refcount);
-
- _dbus_connection_trace_ref (connection, old_refcount, old_refcount - 1,
- "unref");
-
- if (old_refcount == 1)
- {
-#ifndef DBUS_DISABLE_CHECKS
- if (_dbus_transport_get_is_connected (connection->transport))
- {
- _dbus_warn_check_failed ("The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details.\n%s",
- connection->shareable ?
- "Most likely, the application called unref() too many times and removed a reference belonging to libdbus, since this is a shared connection.\n" :
- "Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.\n");
- return;
- }
-#endif
- _dbus_connection_last_unref (connection);
- }
-}
-
-/*
- * Note that the transport can disconnect itself (other end drops us)
- * and in that case this function never runs. So this function must
- * not do anything more than disconnect the transport and update the
- * dispatch status.
- *
- * If the transport self-disconnects, then we assume someone will
- * dispatch the connection to cause the dispatch status update.
- */
-static void
-_dbus_connection_close_possibly_shared_and_unlock (DBusConnection *connection)
-{
- DBusDispatchStatus status;
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_verbose ("Disconnecting %p\n", connection);
-
- /* We need to ref because update_dispatch_status_and_unlock will unref
- * the connection if it was shared and libdbus was the only remaining
- * refcount holder.
- */
- _dbus_connection_ref_unlocked (connection);
-
- _dbus_transport_disconnect (connection->transport);
-
- /* This has the side effect of queuing the disconnect message link
- * (unless we don't have enough memory, possibly, so don't assert it).
- * After the disconnect message link is queued, dbus_bus_get/dbus_connection_open
- * should never again return the newly-disconnected connection.
- *
- * However, we only unref the shared connection and exit_on_disconnect when
- * the disconnect message reaches the head of the message queue,
- * NOT when it's first queued.
- */
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* This calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- /* Could also call out to user code */
- dbus_connection_unref (connection);
-}
-
-/**
- * Closes a private connection, so no further data can be sent or received.
- * This disconnects the transport (such as a socket) underlying the
- * connection.
- *
- * Attempts to send messages after closing a connection are safe, but will result in
- * error replies generated locally in libdbus.
- *
- * This function does not affect the connection's reference count. It's
- * safe to close a connection more than once; all calls after the
- * first do nothing. It's impossible to "reopen" a connection, a
- * new connection must be created. This function may result in a call
- * to the DBusDispatchStatusFunction set with
- * dbus_connection_set_dispatch_status_function(), as the disconnect
- * message it generates needs to be dispatched.
- *
- * If a connection is dropped by the remote application, it will
- * close itself.
- *
- * You must close a connection prior to releasing the last reference to
- * the connection. If you dbus_connection_unref() for the last time
- * without closing the connection, the results are undefined; it
- * is a bug in your program and libdbus will try to print a warning.
- *
- * You may not close a shared connection. Connections created with
- * dbus_connection_open() or dbus_bus_get() are shared.
- * These connections are owned by libdbus, and applications should
- * only unref them, never close them. Applications can know it is
- * safe to unref these connections because libdbus will be holding a
- * reference as long as the connection is open. Thus, either the
- * connection is closed and it is OK to drop the last reference,
- * or the connection is open and the app knows it does not have the
- * last reference.
- *
- * Connections created with dbus_connection_open_private() or
- * dbus_bus_get_private() are not kept track of or referenced by
- * libdbus. The creator of these connections is responsible for
- * calling dbus_connection_close() prior to releasing the last
- * reference, if the connection is not already disconnected.
- *
- * @param connection the private (unshared) connection to close
- */
-void
-dbus_connection_close (DBusConnection *connection)
-{
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (connection->generation == _dbus_current_generation);
-
- CONNECTION_LOCK (connection);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (connection->shareable)
- {
- CONNECTION_UNLOCK (connection);
-
- _dbus_warn_check_failed ("Applications must not close shared connections - see dbus_connection_close() docs. This is a bug in the application.\n");
- return;
- }
-#endif
-
- _dbus_connection_close_possibly_shared_and_unlock (connection);
-}
-
-static dbus_bool_t
-_dbus_connection_get_is_connected_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
- return _dbus_transport_get_is_connected (connection->transport);
-}
-
-/**
- * Gets whether the connection is currently open. A connection may
- * become disconnected when the remote application closes its end, or
- * exits; a connection may also be disconnected with
- * dbus_connection_close().
- *
- * There are not separate states for "closed" and "disconnected," the two
- * terms are synonymous. This function should really be called
- * get_is_open() but for historical reasons is not.
- *
- * @param connection the connection.
- * @returns #TRUE if the connection is still alive.
- */
-dbus_bool_t
-dbus_connection_get_is_connected (DBusConnection *connection)
-{
- dbus_bool_t res;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
- res = _dbus_connection_get_is_connected_unlocked (connection);
- CONNECTION_UNLOCK (connection);
-
- return res;
-}
-
-/**
- * Gets whether the connection was authenticated. (Note that
- * if the connection was authenticated then disconnected,
- * this function still returns #TRUE)
- *
- * @param connection the connection
- * @returns #TRUE if the connection was ever authenticated
- */
-dbus_bool_t
-dbus_connection_get_is_authenticated (DBusConnection *connection)
-{
- dbus_bool_t res;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_try_to_authenticate (connection->transport);
- CONNECTION_UNLOCK (connection);
-
- return res;
-}
-
-/**
- * Gets whether the connection is not authenticated as a specific
- * user. If the connection is not authenticated, this function
- * returns #TRUE, and if it is authenticated but as an anonymous user,
- * it returns #TRUE. If it is authenticated as a specific user, then
- * this returns #FALSE. (Note that if the connection was authenticated
- * as anonymous then disconnected, this function still returns #TRUE.)
- *
- * If the connection is not anonymous, you can use
- * dbus_connection_get_unix_user() and
- * dbus_connection_get_windows_user() to see who it's authorized as.
- *
- * If you want to prevent non-anonymous authorization, use
- * dbus_server_set_auth_mechanisms() to remove the mechanisms that
- * allow proving user identity (i.e. only allow the ANONYMOUS
- * mechanism).
- *
- * @param connection the connection
- * @returns #TRUE if not authenticated or authenticated as anonymous
- */
-dbus_bool_t
-dbus_connection_get_is_anonymous (DBusConnection *connection)
-{
- dbus_bool_t res;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_get_is_anonymous (connection->transport);
- CONNECTION_UNLOCK (connection);
-
- return res;
-}
-
-/**
- * Gets the ID of the server address we are authenticated to, if this
- * connection is on the client side. If the connection is on the
- * server side, this will always return #NULL - use dbus_server_get_id()
- * to get the ID of your own server, if you are the server side.
- *
- * If a client-side connection is not authenticated yet, the ID may be
- * available if it was included in the server address, but may not be
- * available. The only way to be sure the server ID is available
- * is to wait for authentication to complete.
- *
- * In general, each mode of connecting to a given server will have
- * its own ID. So for example, if the session bus daemon is listening
- * on UNIX domain sockets and on TCP, then each of those modalities
- * will have its own server ID.
- *
- * If you want an ID that identifies an entire session bus, look at
- * dbus_bus_get_id() instead (which is just a convenience wrapper
- * around the org.freedesktop.DBus.GetId method invoked on the bus).
- *
- * You can also get a machine ID; see dbus_get_local_machine_id() to
- * get the machine you are on. There isn't a convenience wrapper, but
- * you can invoke org.freedesktop.DBus.Peer.GetMachineId on any peer
- * to get the machine ID on the other end.
- *
- * The D-Bus specification describes the server ID and other IDs in a
- * bit more detail.
- *
- * @param connection the connection
- * @returns the server ID or #NULL if no memory or the connection is server-side
- */
-char*
-dbus_connection_get_server_id (DBusConnection *connection)
-{
- char *id;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
-
- CONNECTION_LOCK (connection);
- id = _dbus_strdup (_dbus_transport_get_server_id (connection->transport));
- CONNECTION_UNLOCK (connection);
-
- return id;
-}
-
-/**
- * Tests whether a certain type can be send via the connection. This
- * will always return TRUE for all types, with the exception of
- * DBUS_TYPE_UNIX_FD. The function will return TRUE for
- * DBUS_TYPE_UNIX_FD only on systems that know Unix file descriptors
- * and can send them via the chosen transport and when the remote side
- * supports this.
- *
- * This function can be used to do runtime checking for types that
- * might be unknown to the specific D-Bus client implementation
- * version, i.e. it will return FALSE for all types this
- * implementation does not know, including invalid or reserved types.
- *
- * @param connection the connection
- * @param type the type to check
- * @returns TRUE if the type may be send via the connection
- */
-dbus_bool_t
-dbus_connection_can_send_type(DBusConnection *connection,
- int type)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- if (!dbus_type_is_valid (type))
- return FALSE;
-
- if (type != DBUS_TYPE_UNIX_FD)
- return TRUE;
-
-#ifdef HAVE_UNIX_FD_PASSING
- {
- dbus_bool_t b;
-
- CONNECTION_LOCK(connection);
- b = _dbus_transport_can_pass_unix_fd(connection->transport);
- CONNECTION_UNLOCK(connection);
-
- return b;
- }
-#endif
-
- return FALSE;
-}
-
-/**
- * Set whether _exit() should be called when the connection receives a
- * disconnect signal. The call to _exit() comes after any handlers for
- * the disconnect signal run; handlers can cancel the exit by calling
- * this function.
- *
- * By default, exit_on_disconnect is #FALSE; but for message bus
- * connections returned from dbus_bus_get() it will be toggled on
- * by default.
- *
- * @param connection the connection
- * @param exit_on_disconnect #TRUE if _exit() should be called after a disconnect signal
- */
-void
-dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
- dbus_bool_t exit_on_disconnect)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- connection->exit_on_disconnect = exit_on_disconnect != FALSE;
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Preallocates resources needed to send a message, allowing the message
- * to be sent without the possibility of memory allocation failure.
- * Allows apps to create a future guarantee that they can send
- * a message regardless of memory shortages.
- *
- * @param connection the connection we're preallocating for.
- * @returns the preallocated resources, or #NULL
- */
-DBusPreallocatedSend*
-dbus_connection_preallocate_send (DBusConnection *connection)
-{
- DBusPreallocatedSend *preallocated;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
-
- CONNECTION_LOCK (connection);
-
- preallocated =
- _dbus_connection_preallocate_send_unlocked (connection);
-
- CONNECTION_UNLOCK (connection);
-
- return preallocated;
-}
-
-/**
- * Frees preallocated message-sending resources from
- * dbus_connection_preallocate_send(). Should only
- * be called if the preallocated resources are not used
- * to send a message.
- *
- * @param connection the connection
- * @param preallocated the resources
- */
-void
-dbus_connection_free_preallocated_send (DBusConnection *connection,
- DBusPreallocatedSend *preallocated)
-{
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (preallocated != NULL);
- _dbus_return_if_fail (connection == preallocated->connection);
-
- _dbus_list_free_link (preallocated->queue_link);
- _dbus_counter_unref (preallocated->counter_link->data);
- _dbus_list_free_link (preallocated->counter_link);
- dbus_free (preallocated);
-}
-
-/**
- * Sends a message using preallocated resources. This function cannot fail.
- * It works identically to dbus_connection_send() in other respects.
- * Preallocated resources comes from dbus_connection_preallocate_send().
- * This function "consumes" the preallocated resources, they need not
- * be freed separately.
- *
- * @param connection the connection
- * @param preallocated the preallocated resources
- * @param message the message to send
- * @param client_serial return location for client serial assigned to the message
- */
-void
-dbus_connection_send_preallocated (DBusConnection *connection,
- DBusPreallocatedSend *preallocated,
- DBusMessage *message,
- dbus_uint32_t *client_serial)
-{
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (preallocated != NULL);
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (preallocated->connection == connection);
- _dbus_return_if_fail (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL ||
- dbus_message_get_member (message) != NULL);
- _dbus_return_if_fail (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL ||
- (dbus_message_get_interface (message) != NULL &&
- dbus_message_get_member (message) != NULL));
-
- CONNECTION_LOCK (connection);
-
-#ifdef HAVE_UNIX_FD_PASSING
-
- if (!_dbus_transport_can_pass_unix_fd(connection->transport) &&
- message->n_unix_fds > 0)
- {
- /* Refuse to send fds on a connection that cannot handle
- them. Unfortunately we cannot return a proper error here, so
- the best we can is just return. */
- CONNECTION_UNLOCK (connection);
- return;
- }
-
-#endif
-
- _dbus_connection_send_preallocated_and_unlock (connection,
- preallocated,
- message, client_serial);
-}
-
-static dbus_bool_t
-_dbus_connection_send_unlocked_no_update (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *client_serial)
-{
- DBusPreallocatedSend *preallocated;
-
- _dbus_assert (connection != NULL);
- _dbus_assert (message != NULL);
-
- preallocated = _dbus_connection_preallocate_send_unlocked (connection);
- if (preallocated == NULL)
- return FALSE;
-
- _dbus_connection_send_preallocated_unlocked_no_update (connection,
- preallocated,
- message,
- client_serial);
- return TRUE;
-}
-
-/**
- * Adds a message to the outgoing message queue. Does not block to
- * write the message to the network; that happens asynchronously. To
- * force the message to be written, call dbus_connection_flush() however
- * it is not necessary to call dbus_connection_flush() by hand; the
- * message will be sent the next time the main loop is run.
- * dbus_connection_flush() should only be used, for example, if
- * the application was expected to exit before running the main loop.
- *
- * Because this only queues the message, the only reason it can
- * fail is lack of memory. Even if the connection is disconnected,
- * no error will be returned. If the function fails due to lack of memory,
- * it returns #FALSE. The function will never fail for other reasons; even
- * if the connection is disconnected, you can queue an outgoing message,
- * though obviously it won't be sent.
- *
- * The message serial is used by the remote application to send a
- * reply; see dbus_message_get_serial() or the D-Bus specification.
- *
- * dbus_message_unref() can be called as soon as this method returns
- * as the message queue will hold its own ref until the message is sent.
- *
- * @param connection the connection.
- * @param message the message to write.
- * @param serial return location for message serial, or #NULL if you don't care
- * @returns #TRUE on success.
- */
-dbus_bool_t
-dbus_connection_send (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *serial)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (message != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
-#ifdef HAVE_UNIX_FD_PASSING
-
- if (!_dbus_transport_can_pass_unix_fd(connection->transport) &&
- message->n_unix_fds > 0)
- {
- /* Refuse to send fds on a connection that cannot handle
- them. Unfortunately we cannot return a proper error here, so
- the best we can is just return. */
- CONNECTION_UNLOCK (connection);
- return FALSE;
- }
-
-#endif
-
- return _dbus_connection_send_and_unlock (connection,
- message,
- serial);
-}
-
-static dbus_bool_t
-reply_handler_timeout (void *data)
-{
- DBusConnection *connection;
- DBusDispatchStatus status;
- DBusPendingCall *pending = data;
-
- connection = _dbus_pending_call_get_connection_and_lock (pending);
- _dbus_connection_ref_unlocked (connection);
-
- _dbus_pending_call_queue_timeout_error_unlocked (pending,
- connection);
- _dbus_connection_remove_timeout_unlocked (connection,
- _dbus_pending_call_get_timeout_unlocked (pending));
- _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
-
- _dbus_verbose ("middle\n");
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* Unlocks, and calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- dbus_connection_unref (connection);
-
- return TRUE;
-}
-
-/**
- * Queues a message to send, as with dbus_connection_send(),
- * but also returns a #DBusPendingCall used to receive a reply to the
- * message. If no reply is received in the given timeout_milliseconds,
- * this function expires the pending reply and generates a synthetic
- * error reply (generated in-process, not by the remote application)
- * indicating that a timeout occurred.
- *
- * A #DBusPendingCall will see a reply message before any filters or
- * registered object path handlers. See dbus_connection_dispatch() for
- * details on when handlers are run.
- *
- * A #DBusPendingCall will always see exactly one reply message,
- * unless it's cancelled with dbus_pending_call_cancel().
- *
- * If #NULL is passed for the pending_return, the #DBusPendingCall
- * will still be generated internally, and used to track
- * the message reply timeout. This means a timeout error will
- * occur if no reply arrives, unlike with dbus_connection_send().
- *
- * If -1 is passed for the timeout, a sane default timeout is used. -1
- * is typically the best value for the timeout for this reason, unless
- * you want a very short or very long timeout. If #DBUS_TIMEOUT_INFINITE is
- * passed for the timeout, no timeout will be set and the call will block
- * forever.
- *
- * @warning if the connection is disconnected or you try to send Unix
- * file descriptors on a connection that does not support them, the
- * #DBusPendingCall will be set to #NULL, so be careful with this.
- *
- * @param connection the connection
- * @param message the message to send
- * @param pending_return return location for a #DBusPendingCall
- * object, or #NULL if connection is disconnected or when you try to
- * send Unix file descriptors on a connection that does not support
- * them.
- * @param timeout_milliseconds timeout in milliseconds, -1 (or
- * #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
- * timeout
- * @returns #FALSE if no memory, #TRUE otherwise.
- *
- */
-dbus_bool_t
-dbus_connection_send_with_reply (DBusConnection *connection,
- DBusMessage *message,
- DBusPendingCall **pending_return,
- int timeout_milliseconds)
-{
- DBusPendingCall *pending;
- dbus_int32_t serial = -1;
- DBusDispatchStatus status;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
-
- if (pending_return)
- *pending_return = NULL;
-
- CONNECTION_LOCK (connection);
-
-#ifdef HAVE_UNIX_FD_PASSING
-
- if (!_dbus_transport_can_pass_unix_fd(connection->transport) &&
- message->n_unix_fds > 0)
- {
- /* Refuse to send fds on a connection that cannot handle
- them. Unfortunately we cannot return a proper error here, so
- the best we can do is return TRUE but leave *pending_return
- as NULL. */
- CONNECTION_UNLOCK (connection);
- return TRUE;
- }
-
-#endif
-
- if (!_dbus_connection_get_is_connected_unlocked (connection))
- {
- CONNECTION_UNLOCK (connection);
-
- return TRUE;
- }
-
- pending = _dbus_pending_call_new_unlocked (connection,
- timeout_milliseconds,
- reply_handler_timeout);
-
- if (pending == NULL)
- {
- CONNECTION_UNLOCK (connection);
- return FALSE;
- }
-
- /* Assign a serial to the message */
- serial = dbus_message_get_serial (message);
- if (serial == 0)
- {
- serial = _dbus_connection_get_next_client_serial (connection);
- dbus_message_set_serial (message, serial);
- }
-
- if (!_dbus_pending_call_set_timeout_error_unlocked (pending, message, serial))
- goto error;
-
- /* Insert the serial in the pending replies hash;
- * hash takes a refcount on DBusPendingCall.
- * Also, add the timeout.
- */
- if (!_dbus_connection_attach_pending_call_unlocked (connection,
- pending))
- goto error;
-
- if (!_dbus_connection_send_unlocked_no_update (connection, message, NULL))
- {
- _dbus_connection_detach_pending_call_and_unlock (connection,
- pending);
- goto error_unlocked;
- }
-
- if (pending_return)
- *pending_return = pending; /* hand off refcount */
- else
- {
- _dbus_connection_detach_pending_call_unlocked (connection, pending);
- /* we still have a ref to the pending call in this case, we unref
- * after unlocking, below
- */
- }
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* this calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- if (pending_return == NULL)
- dbus_pending_call_unref (pending);
-
- return TRUE;
-
- error:
- CONNECTION_UNLOCK (connection);
- error_unlocked:
- dbus_pending_call_unref (pending);
- return FALSE;
-}
-
-/**
- * Sends a message and blocks a certain time period while waiting for
- * a reply. This function does not reenter the main loop,
- * i.e. messages other than the reply are queued up but not
- * processed. This function is used to invoke method calls on a
- * remote object.
- *
- * If a normal reply is received, it is returned, and removed from the
- * incoming message queue. If it is not received, #NULL is returned
- * and the error is set to #DBUS_ERROR_NO_REPLY. If an error reply is
- * received, it is converted to a #DBusError and returned as an error,
- * then the reply message is deleted and #NULL is returned. If
- * something else goes wrong, result is set to whatever is
- * appropriate, such as #DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_DISCONNECTED.
- *
- * @warning While this function blocks the calling thread will not be
- * processing the incoming message queue. This means you can end up
- * deadlocked if the application you're talking to needs you to reply
- * to a method. To solve this, either avoid the situation, block in a
- * separate thread from the main connection-dispatching thread, or use
- * dbus_pending_call_set_notify() to avoid blocking.
- *
- * @param connection the connection
- * @param message the message to send
- * @param timeout_milliseconds timeout in milliseconds, -1 (or
- * #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
- * timeout
- * @param error return location for error message
- * @returns the message that is the reply or #NULL with an error code if the
- * function fails.
- */
-DBusMessage*
-dbus_connection_send_with_reply_and_block (DBusConnection *connection,
- DBusMessage *message,
- int timeout_milliseconds,
- DBusError *error)
-{
- DBusMessage *reply;
- DBusPendingCall *pending;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
- _dbus_return_val_if_fail (message != NULL, NULL);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
-#ifdef HAVE_UNIX_FD_PASSING
-
- CONNECTION_LOCK (connection);
- if (!_dbus_transport_can_pass_unix_fd(connection->transport) &&
- message->n_unix_fds > 0)
- {
- CONNECTION_UNLOCK (connection);
- dbus_set_error(error, DBUS_ERROR_FAILED, "Cannot send file descriptors on this connection.");
- return NULL;
- }
- CONNECTION_UNLOCK (connection);
-
-#endif
-
- if (!dbus_connection_send_with_reply (connection, message,
- &pending, timeout_milliseconds))
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- if (pending == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_DISCONNECTED, "Connection is closed");
- return NULL;
- }
-
- dbus_pending_call_block (pending);
-
- reply = dbus_pending_call_steal_reply (pending);
- dbus_pending_call_unref (pending);
-
- /* call_complete_and_unlock() called from pending_call_block() should
- * always fill this in.
- */
- _dbus_assert (reply != NULL);
-
- if (dbus_set_error_from_message (error, reply))
- {
- dbus_message_unref (reply);
- return NULL;
- }
- else
- return reply;
-}
-
-/**
- * Blocks until the outgoing message queue is empty.
- * Assumes connection lock already held.
- *
- * If you call this, you MUST call update_dispatch_status afterword...
- *
- * @param connection the connection.
- */
-static DBusDispatchStatus
-_dbus_connection_flush_unlocked (DBusConnection *connection)
-{
- /* We have to specify DBUS_ITERATION_DO_READING here because
- * otherwise we could have two apps deadlock if they are both doing
- * a flush(), and the kernel buffers fill up. This could change the
- * dispatch status.
- */
- DBusDispatchStatus status;
-
- HAVE_LOCK_CHECK (connection);
-
- while (connection->n_outgoing > 0 &&
- _dbus_connection_get_is_connected_unlocked (connection))
- {
- _dbus_verbose ("doing iteration in\n");
- HAVE_LOCK_CHECK (connection);
- _dbus_connection_do_iteration_unlocked (connection,
- NULL,
- DBUS_ITERATION_DO_READING |
- DBUS_ITERATION_DO_WRITING |
- DBUS_ITERATION_BLOCK,
- -1);
- }
-
- HAVE_LOCK_CHECK (connection);
- _dbus_verbose ("middle\n");
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- HAVE_LOCK_CHECK (connection);
- return status;
-}
-
-/**
- * Blocks until the outgoing message queue is empty.
- *
- * @param connection the connection.
- */
-void
-dbus_connection_flush (DBusConnection *connection)
-{
- /* We have to specify DBUS_ITERATION_DO_READING here because
- * otherwise we could have two apps deadlock if they are both doing
- * a flush(), and the kernel buffers fill up. This could change the
- * dispatch status.
- */
- DBusDispatchStatus status;
-
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
-
- status = _dbus_connection_flush_unlocked (connection);
-
- HAVE_LOCK_CHECK (connection);
- /* Unlocks and calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- _dbus_verbose ("end\n");
-}
-
-/**
- * This function implements dbus_connection_read_write_dispatch() and
- * dbus_connection_read_write() (they pass a different value for the
- * dispatch parameter).
- *
- * @param connection the connection
- * @param timeout_milliseconds max time to block or -1 for infinite
- * @param dispatch dispatch new messages or leave them on the incoming queue
- * @returns #TRUE if the disconnect message has not been processed
- */
-static dbus_bool_t
-_dbus_connection_read_write_dispatch (DBusConnection *connection,
- int timeout_milliseconds,
- dbus_bool_t dispatch)
-{
- DBusDispatchStatus dstatus;
- dbus_bool_t progress_possible;
-
- /* Need to grab a ref here in case we're a private connection and
- * the user drops the last ref in a handler we call; see bug
- * https://bugs.freedesktop.org/show_bug.cgi?id=15635
- */
- dbus_connection_ref (connection);
- dstatus = dbus_connection_get_dispatch_status (connection);
-
- if (dispatch && dstatus == DBUS_DISPATCH_DATA_REMAINS)
- {
- _dbus_verbose ("doing dispatch\n");
- dbus_connection_dispatch (connection);
- CONNECTION_LOCK (connection);
- }
- else if (dstatus == DBUS_DISPATCH_NEED_MEMORY)
- {
- _dbus_verbose ("pausing for memory\n");
- _dbus_memory_pause_based_on_timeout (timeout_milliseconds);
- CONNECTION_LOCK (connection);
- }
- else
- {
- CONNECTION_LOCK (connection);
- if (_dbus_connection_get_is_connected_unlocked (connection))
- {
- _dbus_verbose ("doing iteration\n");
- _dbus_connection_do_iteration_unlocked (connection,
- NULL,
- DBUS_ITERATION_DO_READING |
- DBUS_ITERATION_DO_WRITING |
- DBUS_ITERATION_BLOCK,
- timeout_milliseconds);
- }
- }
-
- HAVE_LOCK_CHECK (connection);
- /* If we can dispatch, we can make progress until the Disconnected message
- * has been processed; if we can only read/write, we can make progress
- * as long as the transport is open.
- */
- if (dispatch)
- progress_possible = connection->n_incoming != 0 ||
- connection->disconnect_message_link != NULL;
- else
- progress_possible = _dbus_connection_get_is_connected_unlocked (connection);
-
- CONNECTION_UNLOCK (connection);
-
- dbus_connection_unref (connection);
-
- return progress_possible; /* TRUE if we can make more progress */
-}
-
-
-/**
- * This function is intended for use with applications that don't want
- * to write a main loop and deal with #DBusWatch and #DBusTimeout. An
- * example usage would be:
- *
- * @code
- * while (dbus_connection_read_write_dispatch (connection, -1))
- * ; // empty loop body
- * @endcode
- *
- * In this usage you would normally have set up a filter function to look
- * at each message as it is dispatched. The loop terminates when the last
- * message from the connection (the disconnected signal) is processed.
- *
- * If there are messages to dispatch, this function will
- * dbus_connection_dispatch() once, and return. If there are no
- * messages to dispatch, this function will block until it can read or
- * write, then read or write, then return.
- *
- * The way to think of this function is that it either makes some sort
- * of progress, or it blocks. Note that, while it is blocked on I/O, it
- * cannot be interrupted (even by other threads), which makes this function
- * unsuitable for applications that do more than just react to received
- * messages.
- *
- * The return value indicates whether the disconnect message has been
- * processed, NOT whether the connection is connected. This is
- * important because even after disconnecting, you want to process any
- * messages you received prior to the disconnect.
- *
- * @param connection the connection
- * @param timeout_milliseconds max time to block or -1 for infinite
- * @returns #TRUE if the disconnect message has not been processed
- */
-dbus_bool_t
-dbus_connection_read_write_dispatch (DBusConnection *connection,
- int timeout_milliseconds)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
- return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, TRUE);
-}
-
-/**
- * This function is intended for use with applications that don't want to
- * write a main loop and deal with #DBusWatch and #DBusTimeout. See also
- * dbus_connection_read_write_dispatch().
- *
- * As long as the connection is open, this function will block until it can
- * read or write, then read or write, then return #TRUE.
- *
- * If the connection is closed, the function returns #FALSE.
- *
- * The return value indicates whether reading or writing is still
- * possible, i.e. whether the connection is connected.
- *
- * Note that even after disconnection, messages may remain in the
- * incoming queue that need to be
- * processed. dbus_connection_read_write_dispatch() dispatches
- * incoming messages for you; with dbus_connection_read_write() you
- * have to arrange to drain the incoming queue yourself.
- *
- * @param connection the connection
- * @param timeout_milliseconds max time to block or -1 for infinite
- * @returns #TRUE if still connected
- */
-dbus_bool_t
-dbus_connection_read_write (DBusConnection *connection,
- int timeout_milliseconds)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
- return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, FALSE);
-}
-
-/* We need to call this anytime we pop the head of the queue, and then
- * update_dispatch_status_and_unlock needs to be called afterward
- * which will "process" the disconnected message and set
- * disconnected_message_processed.
- */
-static void
-check_disconnected_message_arrived_unlocked (DBusConnection *connection,
- DBusMessage *head_of_queue)
-{
- HAVE_LOCK_CHECK (connection);
-
- /* checking that the link is NULL is an optimization to avoid the is_signal call */
- if (connection->disconnect_message_link == NULL &&
- dbus_message_is_signal (head_of_queue,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- {
- connection->disconnected_message_arrived = TRUE;
- }
-}
-
-/**
- * Returns the first-received message from the incoming message queue,
- * leaving it in the queue. If the queue is empty, returns #NULL.
- *
- * The caller does not own a reference to the returned message, and
- * must either return it using dbus_connection_return_message() or
- * keep it after calling dbus_connection_steal_borrowed_message(). No
- * one can get at the message while its borrowed, so return it as
- * quickly as possible and don't keep a reference to it after
- * returning it. If you need to keep the message, make a copy of it.
- *
- * dbus_connection_dispatch() will block if called while a borrowed
- * message is outstanding; only one piece of code can be playing with
- * the incoming queue at a time. This function will block if called
- * during a dbus_connection_dispatch().
- *
- * @param connection the connection.
- * @returns next message in the incoming queue.
- */
-DBusMessage*
-dbus_connection_borrow_message (DBusConnection *connection)
-{
- DBusDispatchStatus status;
- DBusMessage *message;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
-
- _dbus_verbose ("start\n");
-
- /* this is called for the side effect that it queues
- * up any messages from the transport
- */
- status = dbus_connection_get_dispatch_status (connection);
- if (status != DBUS_DISPATCH_DATA_REMAINS)
- return NULL;
-
- CONNECTION_LOCK (connection);
-
- _dbus_connection_acquire_dispatch (connection);
-
- /* While a message is outstanding, the dispatch lock is held */
- _dbus_assert (connection->message_borrowed == NULL);
-
- connection->message_borrowed = _dbus_list_get_first (&connection->incoming_messages);
-
- message = connection->message_borrowed;
-
- check_disconnected_message_arrived_unlocked (connection, message);
-
- /* Note that we KEEP the dispatch lock until the message is returned */
- if (message == NULL)
- _dbus_connection_release_dispatch (connection);
-
- CONNECTION_UNLOCK (connection);
-
- _dbus_message_trace_ref (message, -1, -1, "dbus_connection_borrow_message");
-
- /* We don't update dispatch status until it's returned or stolen */
-
- return message;
-}
-
-/**
- * Used to return a message after peeking at it using
- * dbus_connection_borrow_message(). Only called if
- * message from dbus_connection_borrow_message() was non-#NULL.
- *
- * @param connection the connection
- * @param message the message from dbus_connection_borrow_message()
- */
-void
-dbus_connection_return_message (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusDispatchStatus status;
-
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (message == connection->message_borrowed);
- _dbus_return_if_fail (connection->dispatch_acquired);
-
- CONNECTION_LOCK (connection);
-
- _dbus_assert (message == connection->message_borrowed);
-
- connection->message_borrowed = NULL;
-
- _dbus_connection_release_dispatch (connection);
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- _dbus_message_trace_ref (message, -1, -1, "dbus_connection_return_message");
-}
-
-/**
- * Used to keep a message after peeking at it using
- * dbus_connection_borrow_message(). Before using this function, see
- * the caveats/warnings in the documentation for
- * dbus_connection_pop_message().
- *
- * @param connection the connection
- * @param message the message from dbus_connection_borrow_message()
- */
-void
-dbus_connection_steal_borrowed_message (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusMessage *pop_message;
- DBusDispatchStatus status;
-
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (message == connection->message_borrowed);
- _dbus_return_if_fail (connection->dispatch_acquired);
-
- CONNECTION_LOCK (connection);
-
- _dbus_assert (message == connection->message_borrowed);
-
- pop_message = _dbus_list_pop_first (&connection->incoming_messages);
- _dbus_assert (message == pop_message);
- (void) pop_message; /* unused unless asserting */
-
- connection->n_incoming -= 1;
-
- _dbus_verbose ("Incoming message %p stolen from queue, %d incoming\n",
- message, connection->n_incoming);
-
- connection->message_borrowed = NULL;
-
- _dbus_connection_release_dispatch (connection);
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- _dbus_message_trace_ref (message, -1, -1,
- "dbus_connection_steal_borrowed_message");
-}
-
-/* See dbus_connection_pop_message, but requires the caller to own
- * the lock before calling. May drop the lock while running.
- */
-static DBusList*
-_dbus_connection_pop_message_link_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_assert (connection->message_borrowed == NULL);
-
- if (connection->n_incoming > 0)
- {
- DBusList *link;
-
- link = _dbus_list_pop_first_link (&connection->incoming_messages);
- connection->n_incoming -= 1;
-
- _dbus_verbose ("Message %p (%s %s %s %s sig:'%s' serial:%u) removed from incoming queue %p, %d incoming\n",
- link->data,
- dbus_message_type_to_string (dbus_message_get_type (link->data)),
- dbus_message_get_path (link->data) ?
- dbus_message_get_path (link->data) :
- "no path",
- dbus_message_get_interface (link->data) ?
- dbus_message_get_interface (link->data) :
- "no interface",
- dbus_message_get_member (link->data) ?
- dbus_message_get_member (link->data) :
- "no member",
- dbus_message_get_signature (link->data),
- dbus_message_get_serial (link->data),
- connection, connection->n_incoming);
-
- _dbus_message_trace_ref (link->data, -1, -1,
- "_dbus_connection_pop_message_link_unlocked");
-
- check_disconnected_message_arrived_unlocked (connection, link->data);
-
- return link;
- }
- else
- return NULL;
-}
-
-/* See dbus_connection_pop_message, but requires the caller to own
- * the lock before calling. May drop the lock while running.
- */
-static DBusMessage*
-_dbus_connection_pop_message_unlocked (DBusConnection *connection)
-{
- DBusList *link;
-
- HAVE_LOCK_CHECK (connection);
-
- link = _dbus_connection_pop_message_link_unlocked (connection);
-
- if (link != NULL)
- {
- DBusMessage *message;
-
- message = link->data;
-
- _dbus_list_free_link (link);
-
- return message;
- }
- else
- return NULL;
-}
-
-static void
-_dbus_connection_putback_message_link_unlocked (DBusConnection *connection,
- DBusList *message_link)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_assert (message_link != NULL);
- /* You can't borrow a message while a link is outstanding */
- _dbus_assert (connection->message_borrowed == NULL);
- /* We had to have the dispatch lock across the pop/putback */
- _dbus_assert (connection->dispatch_acquired);
-
- _dbus_list_prepend_link (&connection->incoming_messages,
- message_link);
- connection->n_incoming += 1;
-
- _dbus_verbose ("Message %p (%s %s %s '%s') put back into queue %p, %d incoming\n",
- message_link->data,
- dbus_message_type_to_string (dbus_message_get_type (message_link->data)),
- dbus_message_get_interface (message_link->data) ?
- dbus_message_get_interface (message_link->data) :
- "no interface",
- dbus_message_get_member (message_link->data) ?
- dbus_message_get_member (message_link->data) :
- "no member",
- dbus_message_get_signature (message_link->data),
- connection, connection->n_incoming);
-
- _dbus_message_trace_ref (message_link->data, -1, -1,
- "_dbus_connection_putback_message_link_unlocked");
-}
-
-/**
- * Returns the first-received message from the incoming message queue,
- * removing it from the queue. The caller owns a reference to the
- * returned message. If the queue is empty, returns #NULL.
- *
- * This function bypasses any message handlers that are registered,
- * and so using it is usually wrong. Instead, let the main loop invoke
- * dbus_connection_dispatch(). Popping messages manually is only
- * useful in very simple programs that don't share a #DBusConnection
- * with any libraries or other modules.
- *
- * There is a lock that covers all ways of accessing the incoming message
- * queue, so dbus_connection_dispatch(), dbus_connection_pop_message(),
- * dbus_connection_borrow_message(), etc. will all block while one of the others
- * in the group is running.
- *
- * @param connection the connection.
- * @returns next message in the incoming queue.
- */
-DBusMessage*
-dbus_connection_pop_message (DBusConnection *connection)
-{
- DBusMessage *message;
- DBusDispatchStatus status;
-
- _dbus_verbose ("start\n");
-
- /* this is called for the side effect that it queues
- * up any messages from the transport
- */
- status = dbus_connection_get_dispatch_status (connection);
- if (status != DBUS_DISPATCH_DATA_REMAINS)
- return NULL;
-
- CONNECTION_LOCK (connection);
- _dbus_connection_acquire_dispatch (connection);
- HAVE_LOCK_CHECK (connection);
-
- message = _dbus_connection_pop_message_unlocked (connection);
-
- _dbus_verbose ("Returning popped message %p\n", message);
-
- _dbus_connection_release_dispatch (connection);
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- return message;
-}
-
-/**
- * Acquire the dispatcher. This is a separate lock so the main
- * connection lock can be dropped to call out to application dispatch
- * handlers.
- *
- * @param connection the connection.
- */
-static void
-_dbus_connection_acquire_dispatch (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_connection_ref_unlocked (connection);
- CONNECTION_UNLOCK (connection);
-
- _dbus_verbose ("locking dispatch_mutex\n");
- _dbus_cmutex_lock (connection->dispatch_mutex);
-
- while (connection->dispatch_acquired)
- {
- _dbus_verbose ("waiting for dispatch to be acquirable\n");
- _dbus_condvar_wait (connection->dispatch_cond,
- connection->dispatch_mutex);
- }
-
- _dbus_assert (!connection->dispatch_acquired);
-
- connection->dispatch_acquired = TRUE;
-
- _dbus_verbose ("unlocking dispatch_mutex\n");
- _dbus_cmutex_unlock (connection->dispatch_mutex);
-
- CONNECTION_LOCK (connection);
- _dbus_connection_unref_unlocked (connection);
-}
-
-/**
- * Release the dispatcher when you're done with it. Only call
- * after you've acquired the dispatcher. Wakes up at most one
- * thread currently waiting to acquire the dispatcher.
- *
- * @param connection the connection.
- */
-static void
-_dbus_connection_release_dispatch (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- _dbus_verbose ("locking dispatch_mutex\n");
- _dbus_cmutex_lock (connection->dispatch_mutex);
-
- _dbus_assert (connection->dispatch_acquired);
-
- connection->dispatch_acquired = FALSE;
- _dbus_condvar_wake_one (connection->dispatch_cond);
-
- _dbus_verbose ("unlocking dispatch_mutex\n");
- _dbus_cmutex_unlock (connection->dispatch_mutex);
-}
-
-static void
-_dbus_connection_failed_pop (DBusConnection *connection,
- DBusList *message_link)
-{
- _dbus_list_prepend_link (&connection->incoming_messages,
- message_link);
- connection->n_incoming += 1;
-}
-
-/* Note this may be called multiple times since we don't track whether we already did it */
-static void
-notify_disconnected_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- /* Set the weakref in dbus-bus.c to NULL, so nobody will get a disconnected
- * connection from dbus_bus_get(). We make the same guarantee for
- * dbus_connection_open() but in a different way since we don't want to
- * unref right here; we instead check for connectedness before returning
- * the connection from the hash.
- */
- _dbus_bus_notify_shared_connection_disconnected_unlocked (connection);
-
- /* Dump the outgoing queue, we aren't going to be able to
- * send it now, and we'd like accessors like
- * dbus_connection_get_outgoing_size() to be accurate.
- */
- if (connection->n_outgoing > 0)
- {
- DBusList *link;
-
- _dbus_verbose ("Dropping %d outgoing messages since we're disconnected\n",
- connection->n_outgoing);
-
- while ((link = _dbus_list_get_last_link (&connection->outgoing_messages)))
- {
- _dbus_connection_message_sent_unlocked (connection, link->data);
- }
- }
-}
-
-/* Note this may be called multiple times since we don't track whether we already did it */
-static DBusDispatchStatus
-notify_disconnected_and_dispatch_complete_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- if (connection->disconnect_message_link != NULL)
- {
- _dbus_verbose ("Sending disconnect message\n");
-
- /* If we have pending calls, queue their timeouts - we want the Disconnected
- * to be the last message, after these timeouts.
- */
- connection_timeout_and_complete_all_pending_calls_unlocked (connection);
-
- /* We haven't sent the disconnect message already,
- * and all real messages have been queued up.
- */
- _dbus_connection_queue_synthesized_message_link (connection,
- connection->disconnect_message_link);
- connection->disconnect_message_link = NULL;
-
- return DBUS_DISPATCH_DATA_REMAINS;
- }
-
- return DBUS_DISPATCH_COMPLETE;
-}
-
-static DBusDispatchStatus
-_dbus_connection_get_dispatch_status_unlocked (DBusConnection *connection)
-{
- HAVE_LOCK_CHECK (connection);
-
- if (connection->n_incoming > 0)
- return DBUS_DISPATCH_DATA_REMAINS;
- else if (!_dbus_transport_queue_messages (connection->transport))
- return DBUS_DISPATCH_NEED_MEMORY;
- else
- {
- DBusDispatchStatus status;
- dbus_bool_t is_connected;
-
- status = _dbus_transport_get_dispatch_status (connection->transport);
- is_connected = _dbus_transport_get_is_connected (connection->transport);
-
- _dbus_verbose ("dispatch status = %s is_connected = %d\n",
- DISPATCH_STATUS_NAME (status), is_connected);
-
- if (!is_connected)
- {
- /* It's possible this would be better done by having an explicit
- * notification from _dbus_transport_disconnect() that would
- * synchronously do this, instead of waiting for the next dispatch
- * status check. However, probably not good to change until it causes
- * a problem.
- */
- notify_disconnected_unlocked (connection);
-
- /* I'm not sure this is needed; the idea is that we want to
- * queue the Disconnected only after we've read all the
- * messages, but if we're disconnected maybe we are guaranteed
- * to have read them all ?
- */
- if (status == DBUS_DISPATCH_COMPLETE)
- status = notify_disconnected_and_dispatch_complete_unlocked (connection);
- }
-
- if (status != DBUS_DISPATCH_COMPLETE)
- return status;
- else if (connection->n_incoming > 0)
- return DBUS_DISPATCH_DATA_REMAINS;
- else
- return DBUS_DISPATCH_COMPLETE;
- }
-}
-
-static void
-_dbus_connection_update_dispatch_status_and_unlock (DBusConnection *connection,
- DBusDispatchStatus new_status)
-{
- dbus_bool_t changed;
- DBusDispatchStatusFunction function;
- void *data;
-
- HAVE_LOCK_CHECK (connection);
-
- _dbus_connection_ref_unlocked (connection);
-
- changed = new_status != connection->last_dispatch_status;
-
- connection->last_dispatch_status = new_status;
-
- function = connection->dispatch_status_function;
- data = connection->dispatch_status_data;
-
- if (connection->disconnected_message_arrived &&
- !connection->disconnected_message_processed)
- {
- connection->disconnected_message_processed = TRUE;
-
- /* this does an unref, but we have a ref
- * so we should not run the finalizer here
- * inside the lock.
- */
- connection_forget_shared_unlocked (connection);
-
- if (connection->exit_on_disconnect)
- {
- CONNECTION_UNLOCK (connection);
-
- _dbus_verbose ("Exiting on Disconnected signal\n");
- _dbus_exit (1);
- _dbus_assert_not_reached ("Call to exit() returned");
- }
- }
-
- /* We drop the lock */
- CONNECTION_UNLOCK (connection);
-
- if (changed && function)
- {
- _dbus_verbose ("Notifying of change to dispatch status of %p now %d (%s)\n",
- connection, new_status,
- DISPATCH_STATUS_NAME (new_status));
- (* function) (connection, new_status, data);
- }
-
- dbus_connection_unref (connection);
-}
-
-/**
- * Gets the current state of the incoming message queue.
- * #DBUS_DISPATCH_DATA_REMAINS indicates that the message queue
- * may contain messages. #DBUS_DISPATCH_COMPLETE indicates that the
- * incoming queue is empty. #DBUS_DISPATCH_NEED_MEMORY indicates that
- * there could be data, but we can't know for sure without more
- * memory.
- *
- * To process the incoming message queue, use dbus_connection_dispatch()
- * or (in rare cases) dbus_connection_pop_message().
- *
- * Note, #DBUS_DISPATCH_DATA_REMAINS really means that either we
- * have messages in the queue, or we have raw bytes buffered up
- * that need to be parsed. When these bytes are parsed, they
- * may not add up to an entire message. Thus, it's possible
- * to see a status of #DBUS_DISPATCH_DATA_REMAINS but not
- * have a message yet.
- *
- * In particular this happens on initial connection, because all sorts
- * of authentication protocol stuff has to be parsed before the
- * first message arrives.
- *
- * @param connection the connection.
- * @returns current dispatch status
- */
-DBusDispatchStatus
-dbus_connection_get_dispatch_status (DBusConnection *connection)
-{
- DBusDispatchStatus status;
-
- _dbus_return_val_if_fail (connection != NULL, DBUS_DISPATCH_COMPLETE);
-
- _dbus_verbose ("start\n");
-
- CONNECTION_LOCK (connection);
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- CONNECTION_UNLOCK (connection);
-
- return status;
-}
-
-/**
- * Filter funtion for handling the Peer standard interface.
- */
-static DBusHandlerResult
-_dbus_connection_peer_filter_unlocked_no_update (DBusConnection *connection,
- DBusMessage *message)
-{
- dbus_bool_t sent = FALSE;
- DBusMessage *ret = NULL;
- DBusList *expire_link;
-
- if (connection->route_peer_messages && dbus_message_get_destination (message) != NULL)
- {
- /* This means we're letting the bus route this message */
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- if (!dbus_message_has_interface (message, DBUS_INTERFACE_PEER))
- {
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- /* Preallocate a linked-list link, so that if we need to dispose of a
- * message, we can attach it to the expired list */
- expire_link = _dbus_list_alloc_link (NULL);
-
- if (!expire_link)
- return DBUS_HANDLER_RESULT_NEED_MEMORY;
-
- if (dbus_message_is_method_call (message,
- DBUS_INTERFACE_PEER,
- "Ping"))
- {
- ret = dbus_message_new_method_return (message);
- if (ret == NULL)
- goto out;
-
- sent = _dbus_connection_send_unlocked_no_update (connection, ret, NULL);
- }
- else if (dbus_message_is_method_call (message,
- DBUS_INTERFACE_PEER,
- "GetMachineId"))
- {
- DBusString uuid;
-
- ret = dbus_message_new_method_return (message);
- if (ret == NULL)
- goto out;
-
- _dbus_string_init (&uuid);
- if (_dbus_get_local_machine_uuid_encoded (&uuid))
- {
- const char *v_STRING = _dbus_string_get_const_data (&uuid);
- if (dbus_message_append_args (ret,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_INVALID))
- {
- sent = _dbus_connection_send_unlocked_no_update (connection, ret, NULL);
- }
- }
- _dbus_string_free (&uuid);
- }
- else
- {
- /* We need to bounce anything else with this interface, otherwise apps
- * could start extending the interface and when we added extensions
- * here to DBusConnection we'd break those apps.
- */
- ret = dbus_message_new_error (message,
- DBUS_ERROR_UNKNOWN_METHOD,
- "Unknown method invoked on org.freedesktop.DBus.Peer interface");
- if (ret == NULL)
- goto out;
-
- sent = _dbus_connection_send_unlocked_no_update (connection, ret, NULL);
- }
-
-out:
- if (ret == NULL)
- {
- _dbus_list_free_link (expire_link);
- }
- else
- {
- /* It'll be safe to unref the reply when we unlock */
- expire_link->data = ret;
- _dbus_list_prepend_link (&connection->expired_messages, expire_link);
- }
-
- if (!sent)
- return DBUS_HANDLER_RESULT_NEED_MEMORY;
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-/**
-* Processes all builtin filter functions
-*
-* If the spec specifies a standard interface
-* they should be processed from this method
-**/
-static DBusHandlerResult
-_dbus_connection_run_builtin_filters_unlocked_no_update (DBusConnection *connection,
- DBusMessage *message)
-{
- /* We just run one filter for now but have the option to run more
- if the spec calls for it in the future */
-
- return _dbus_connection_peer_filter_unlocked_no_update (connection, message);
-}
-
-/**
- * Processes any incoming data.
- *
- * If there's incoming raw data that has not yet been parsed, it is
- * parsed, which may or may not result in adding messages to the
- * incoming queue.
- *
- * The incoming data buffer is filled when the connection reads from
- * its underlying transport (such as a socket). Reading usually
- * happens in dbus_watch_handle() or dbus_connection_read_write().
- *
- * If there are complete messages in the incoming queue,
- * dbus_connection_dispatch() removes one message from the queue and
- * processes it. Processing has three steps.
- *
- * First, any method replies are passed to #DBusPendingCall or
- * dbus_connection_send_with_reply_and_block() in order to
- * complete the pending method call.
- *
- * Second, any filters registered with dbus_connection_add_filter()
- * are run. If any filter returns #DBUS_HANDLER_RESULT_HANDLED
- * then processing stops after that filter.
- *
- * Third, if the message is a method call it is forwarded to
- * any registered object path handlers added with
- * dbus_connection_register_object_path() or
- * dbus_connection_register_fallback().
- *
- * A single call to dbus_connection_dispatch() will process at most
- * one message; it will not clear the entire message queue.
- *
- * Be careful about calling dbus_connection_dispatch() from inside a
- * message handler, i.e. calling dbus_connection_dispatch()
- * recursively. If threads have been initialized with a recursive
- * mutex function, then this will not deadlock; however, it can
- * certainly confuse your application.
- *
- * @todo some FIXME in here about handling DBUS_HANDLER_RESULT_NEED_MEMORY
- *
- * @param connection the connection
- * @returns dispatch status, see dbus_connection_get_dispatch_status()
- */
-DBusDispatchStatus
-dbus_connection_dispatch (DBusConnection *connection)
-{
- DBusMessage *message;
- DBusList *link, *filter_list_copy, *message_link;
- DBusHandlerResult result;
- DBusPendingCall *pending;
- dbus_int32_t reply_serial;
- DBusDispatchStatus status;
- dbus_bool_t found_object;
-
- _dbus_return_val_if_fail (connection != NULL, DBUS_DISPATCH_COMPLETE);
-
- _dbus_verbose ("\n");
-
- CONNECTION_LOCK (connection);
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
- if (status != DBUS_DISPATCH_DATA_REMAINS)
- {
- /* unlocks and calls out to user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
- return status;
- }
-
- /* We need to ref the connection since the callback could potentially
- * drop the last ref to it
- */
- _dbus_connection_ref_unlocked (connection);
-
- _dbus_connection_acquire_dispatch (connection);
- HAVE_LOCK_CHECK (connection);
-
- message_link = _dbus_connection_pop_message_link_unlocked (connection);
- if (message_link == NULL)
- {
- /* another thread dispatched our stuff */
-
- _dbus_verbose ("another thread dispatched message (during acquire_dispatch above)\n");
-
- _dbus_connection_release_dispatch (connection);
-
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- dbus_connection_unref (connection);
-
- return status;
- }
-
- message = message_link->data;
-
- _dbus_verbose (" dispatching message %p (%s %s %s '%s')\n",
- message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message));
-
- result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- /* Pending call handling must be first, because if you do
- * dbus_connection_send_with_reply_and_block() or
- * dbus_pending_call_block() then no handlers/filters will be run on
- * the reply. We want consistent semantics in the case where we
- * dbus_connection_dispatch() the reply.
- */
-
- reply_serial = dbus_message_get_reply_serial (message);
- pending = _dbus_hash_table_lookup_int (connection->pending_replies,
- reply_serial);
- if (pending)
- {
- _dbus_verbose ("Dispatching a pending reply\n");
- complete_pending_call_and_unlock (connection, pending, message);
- pending = NULL; /* it's probably unref'd */
-
- CONNECTION_LOCK (connection);
- _dbus_verbose ("pending call completed in dispatch\n");
- result = DBUS_HANDLER_RESULT_HANDLED;
- goto out;
- }
-
- result = _dbus_connection_run_builtin_filters_unlocked_no_update (connection, message);
- if (result != DBUS_HANDLER_RESULT_NOT_YET_HANDLED)
- goto out;
-
- if (!_dbus_list_copy (&connection->filter_list, &filter_list_copy))
- {
- _dbus_connection_release_dispatch (connection);
- HAVE_LOCK_CHECK (connection);
-
- _dbus_connection_failed_pop (connection, message_link);
-
- /* unlocks and calls user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection,
- DBUS_DISPATCH_NEED_MEMORY);
- dbus_connection_unref (connection);
-
- return DBUS_DISPATCH_NEED_MEMORY;
- }
-
- _dbus_list_foreach (&filter_list_copy,
- (DBusForeachFunction)_dbus_message_filter_ref,
- NULL);
-
- /* We're still protected from dispatch() reentrancy here
- * since we acquired the dispatcher
- */
- CONNECTION_UNLOCK (connection);
-
- link = _dbus_list_get_first_link (&filter_list_copy);
- while (link != NULL)
- {
- DBusMessageFilter *filter = link->data;
- DBusList *next = _dbus_list_get_next_link (&filter_list_copy, link);
-
- if (filter->function == NULL)
- {
- _dbus_verbose (" filter was removed in a callback function\n");
- link = next;
- continue;
- }
-
- _dbus_verbose (" running filter on message %p\n", message);
- result = (* filter->function) (connection, message, filter->user_data);
-
- if (result != DBUS_HANDLER_RESULT_NOT_YET_HANDLED)
- break;
-
- link = next;
- }
-
- _dbus_list_foreach (&filter_list_copy,
- (DBusForeachFunction)_dbus_message_filter_unref,
- NULL);
- _dbus_list_clear (&filter_list_copy);
-
- CONNECTION_LOCK (connection);
-
- if (result == DBUS_HANDLER_RESULT_NEED_MEMORY)
- {
- _dbus_verbose ("No memory\n");
- goto out;
- }
- else if (result == DBUS_HANDLER_RESULT_HANDLED)
- {
- _dbus_verbose ("filter handled message in dispatch\n");
- goto out;
- }
-
- /* We're still protected from dispatch() reentrancy here
- * since we acquired the dispatcher
- */
- _dbus_verbose (" running object path dispatch on message %p (%s %s %s '%s')\n",
- message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message));
-
- HAVE_LOCK_CHECK (connection);
- result = _dbus_object_tree_dispatch_and_unlock (connection->objects,
- message,
- &found_object);
-
- CONNECTION_LOCK (connection);
-
- if (result != DBUS_HANDLER_RESULT_NOT_YET_HANDLED)
- {
- _dbus_verbose ("object tree handled message in dispatch\n");
- goto out;
- }
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
- {
- DBusMessage *reply;
- DBusString str;
- DBusPreallocatedSend *preallocated;
- DBusList *expire_link;
-
- _dbus_verbose (" sending error %s\n",
- DBUS_ERROR_UNKNOWN_METHOD);
-
- if (!_dbus_string_init (&str))
- {
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_verbose ("no memory for error string in dispatch\n");
- goto out;
- }
-
- if (!_dbus_string_append_printf (&str,
- "Method \"%s\" with signature \"%s\" on interface \"%s\" doesn't exist\n",
- dbus_message_get_member (message),
- dbus_message_get_signature (message),
- dbus_message_get_interface (message)))
- {
- _dbus_string_free (&str);
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_verbose ("no memory for error string in dispatch\n");
- goto out;
- }
-
- reply = dbus_message_new_error (message,
- found_object ? DBUS_ERROR_UNKNOWN_METHOD : DBUS_ERROR_UNKNOWN_OBJECT,
- _dbus_string_get_const_data (&str));
- _dbus_string_free (&str);
-
- if (reply == NULL)
- {
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_verbose ("no memory for error reply in dispatch\n");
- goto out;
- }
-
- expire_link = _dbus_list_alloc_link (reply);
-
- if (expire_link == NULL)
- {
- dbus_message_unref (reply);
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_verbose ("no memory for error send in dispatch\n");
- goto out;
- }
-
- preallocated = _dbus_connection_preallocate_send_unlocked (connection);
-
- if (preallocated == NULL)
- {
- _dbus_list_free_link (expire_link);
- /* It's OK that this is finalized, because it hasn't been seen by
- * anything that could attach user callbacks */
- dbus_message_unref (reply);
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_verbose ("no memory for error send in dispatch\n");
- goto out;
- }
-
- _dbus_connection_send_preallocated_unlocked_no_update (connection, preallocated,
- reply, NULL);
- /* reply will be freed when we release the lock */
- _dbus_list_prepend_link (&connection->expired_messages, expire_link);
-
- result = DBUS_HANDLER_RESULT_HANDLED;
- }
-
- _dbus_verbose (" done dispatching %p (%s %s %s '%s') on connection %p\n", message,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) :
- "no interface",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) :
- "no member",
- dbus_message_get_signature (message),
- connection);
-
- out:
- if (result == DBUS_HANDLER_RESULT_NEED_MEMORY)
- {
- _dbus_verbose ("out of memory\n");
-
- /* Put message back, and we'll start over.
- * Yes this means handlers must be idempotent if they
- * don't return HANDLED; c'est la vie.
- */
- _dbus_connection_putback_message_link_unlocked (connection,
- message_link);
- /* now we don't want to free them */
- message_link = NULL;
- message = NULL;
- }
- else
- {
- _dbus_verbose (" ... done dispatching\n");
- }
-
- _dbus_connection_release_dispatch (connection);
- HAVE_LOCK_CHECK (connection);
-
- if (message != NULL)
- {
- /* We don't want this message to count in maximum message limits when
- * computing the dispatch status, below. We have to drop the lock
- * temporarily, because finalizing a message can trigger callbacks.
- *
- * We have a reference to the connection, and we don't use any cached
- * pointers to the connection's internals below this point, so it should
- * be safe to drop the lock and take it back. */
- CONNECTION_UNLOCK (connection);
- dbus_message_unref (message);
- CONNECTION_LOCK (connection);
- }
-
- if (message_link != NULL)
- _dbus_list_free_link (message_link);
-
- _dbus_verbose ("before final status update\n");
- status = _dbus_connection_get_dispatch_status_unlocked (connection);
-
- /* unlocks and calls user code */
- _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-
- dbus_connection_unref (connection);
-
- return status;
-}
-
-/**
- * Sets the watch functions for the connection. These functions are
- * responsible for making the application's main loop aware of file
- * descriptors that need to be monitored for events, using select() or
- * poll(). When using Qt, typically the DBusAddWatchFunction would
- * create a QSocketNotifier. When using GLib, the DBusAddWatchFunction
- * could call g_io_add_watch(), or could be used as part of a more
- * elaborate GSource. Note that when a watch is added, it may
- * not be enabled.
- *
- * The DBusWatchToggledFunction notifies the application that the
- * watch has been enabled or disabled. Call dbus_watch_get_enabled()
- * to check this. A disabled watch should have no effect, and enabled
- * watch should be added to the main loop. This feature is used
- * instead of simply adding/removing the watch because
- * enabling/disabling can be done without memory allocation. The
- * toggled function may be NULL if a main loop re-queries
- * dbus_watch_get_enabled() every time anyway.
- *
- * The DBusWatch can be queried for the file descriptor to watch using
- * dbus_watch_get_unix_fd() or dbus_watch_get_socket(), and for the
- * events to watch for using dbus_watch_get_flags(). The flags
- * returned by dbus_watch_get_flags() will only contain
- * DBUS_WATCH_READABLE and DBUS_WATCH_WRITABLE, never
- * DBUS_WATCH_HANGUP or DBUS_WATCH_ERROR; all watches implicitly
- * include a watch for hangups, errors, and other exceptional
- * conditions.
- *
- * Once a file descriptor becomes readable or writable, or an exception
- * occurs, dbus_watch_handle() should be called to
- * notify the connection of the file descriptor's condition.
- *
- * dbus_watch_handle() cannot be called during the
- * DBusAddWatchFunction, as the connection will not be ready to handle
- * that watch yet.
- *
- * It is not allowed to reference a DBusWatch after it has been passed
- * to remove_function.
- *
- * If #FALSE is returned due to lack of memory, the failure may be due
- * to a #FALSE return from the new add_function. If so, the
- * add_function may have been called successfully one or more times,
- * but the remove_function will also have been called to remove any
- * successful adds. i.e. if #FALSE is returned the net result
- * should be that dbus_connection_set_watch_functions() has no effect,
- * but the add_function and remove_function may have been called.
- *
- * @note The thread lock on DBusConnection is held while
- * watch functions are invoked, so inside these functions you
- * may not invoke any methods on DBusConnection or it will deadlock.
- * See the comments in the code or http://lists.freedesktop.org/archives/dbus/2007-July/tread.html#8144
- * if you encounter this issue and want to attempt writing a patch.
- *
- * @param connection the connection.
- * @param add_function function to begin monitoring a new descriptor.
- * @param remove_function function to stop monitoring a descriptor.
- * @param toggled_function function to notify of enable/disable
- * @param data data to pass to add_function and remove_function.
- * @param free_data_function function to be called to free the data.
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_connection_set_watch_functions (DBusConnection *connection,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- retval = _dbus_watch_list_set_functions (connection->watches,
- add_function, remove_function,
- toggled_function,
- data, free_data_function);
-
- CONNECTION_UNLOCK (connection);
-
- return retval;
-}
-
-/**
- * Sets the timeout functions for the connection. These functions are
- * responsible for making the application's main loop aware of timeouts.
- * When using Qt, typically the DBusAddTimeoutFunction would create a
- * QTimer. When using GLib, the DBusAddTimeoutFunction would call
- * g_timeout_add.
- *
- * The DBusTimeoutToggledFunction notifies the application that the
- * timeout has been enabled or disabled. Call
- * dbus_timeout_get_enabled() to check this. A disabled timeout should
- * have no effect, and enabled timeout should be added to the main
- * loop. This feature is used instead of simply adding/removing the
- * timeout because enabling/disabling can be done without memory
- * allocation. With Qt, QTimer::start() and QTimer::stop() can be used
- * to enable and disable. The toggled function may be NULL if a main
- * loop re-queries dbus_timeout_get_enabled() every time anyway.
- * Whenever a timeout is toggled, its interval may change.
- *
- * The DBusTimeout can be queried for the timer interval using
- * dbus_timeout_get_interval(). dbus_timeout_handle() should be called
- * repeatedly, each time the interval elapses, starting after it has
- * elapsed once. The timeout stops firing when it is removed with the
- * given remove_function. The timer interval may change whenever the
- * timeout is added, removed, or toggled.
- *
- * @note The thread lock on DBusConnection is held while
- * timeout functions are invoked, so inside these functions you
- * may not invoke any methods on DBusConnection or it will deadlock.
- * See the comments in the code or http://lists.freedesktop.org/archives/dbus/2007-July/thread.html#8144
- * if you encounter this issue and want to attempt writing a patch.
- *
- * @param connection the connection.
- * @param add_function function to add a timeout.
- * @param remove_function function to remove a timeout.
- * @param toggled_function function to notify of enable/disable
- * @param data data to pass to add_function and remove_function.
- * @param free_data_function function to be called to free the data.
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_connection_set_timeout_functions (DBusConnection *connection,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- retval = _dbus_timeout_list_set_functions (connection->timeouts,
- add_function, remove_function,
- toggled_function,
- data, free_data_function);
-
- CONNECTION_UNLOCK (connection);
-
- return retval;
-}
-
-/**
- * Sets the mainloop wakeup function for the connection. This function
- * is responsible for waking up the main loop (if its sleeping in
- * another thread) when some some change has happened to the
- * connection that the mainloop needs to reconsider (e.g. a message
- * has been queued for writing). When using Qt, this typically
- * results in a call to QEventLoop::wakeUp(). When using GLib, it
- * would call g_main_context_wakeup().
- *
- * @param connection the connection.
- * @param wakeup_main_function function to wake up the mainloop
- * @param data data to pass wakeup_main_function
- * @param free_data_function function to be called to free the data.
- */
-void
-dbus_connection_set_wakeup_main_function (DBusConnection *connection,
- DBusWakeupMainFunction wakeup_main_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- void *old_data;
- DBusFreeFunction old_free_data;
-
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- old_data = connection->wakeup_main_data;
- old_free_data = connection->free_wakeup_main_data;
-
- connection->wakeup_main_function = wakeup_main_function;
- connection->wakeup_main_data = data;
- connection->free_wakeup_main_data = free_data_function;
-
- CONNECTION_UNLOCK (connection);
-
- /* Callback outside the lock */
- if (old_free_data)
- (*old_free_data) (old_data);
-}
-
-/**
- * Set a function to be invoked when the dispatch status changes.
- * If the dispatch status is #DBUS_DISPATCH_DATA_REMAINS, then
- * dbus_connection_dispatch() needs to be called to process incoming
- * messages. However, dbus_connection_dispatch() MUST NOT BE CALLED
- * from inside the DBusDispatchStatusFunction. Indeed, almost
- * any reentrancy in this function is a bad idea. Instead,
- * the DBusDispatchStatusFunction should simply save an indication
- * that messages should be dispatched later, when the main loop
- * is re-entered.
- *
- * If you don't set a dispatch status function, you have to be sure to
- * dispatch on every iteration of your main loop, especially if
- * dbus_watch_handle() or dbus_timeout_handle() were called.
- *
- * @param connection the connection
- * @param function function to call on dispatch status changes
- * @param data data for function
- * @param free_data_function free the function data
- */
-void
-dbus_connection_set_dispatch_status_function (DBusConnection *connection,
- DBusDispatchStatusFunction function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- void *old_data;
- DBusFreeFunction old_free_data;
-
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- old_data = connection->dispatch_status_data;
- old_free_data = connection->free_dispatch_status_data;
-
- connection->dispatch_status_function = function;
- connection->dispatch_status_data = data;
- connection->free_dispatch_status_data = free_data_function;
-
- CONNECTION_UNLOCK (connection);
-
- /* Callback outside the lock */
- if (old_free_data)
- (*old_free_data) (old_data);
-}
-
-/**
- * Get the UNIX file descriptor of the connection, if any. This can
- * be used for SELinux access control checks with getpeercon() for
- * example. DO NOT read or write to the file descriptor, or try to
- * select() on it; use DBusWatch for main loop integration. Not all
- * connections will have a file descriptor. So for adding descriptors
- * to the main loop, use dbus_watch_get_unix_fd() and so forth.
- *
- * If the connection is socket-based, you can also use
- * dbus_connection_get_socket(), which will work on Windows too.
- * This function always fails on Windows.
- *
- * Right now the returned descriptor is always a socket, but
- * that is not guaranteed.
- *
- * @param connection the connection
- * @param fd return location for the file descriptor.
- * @returns #TRUE if fd is successfully obtained.
- */
-dbus_bool_t
-dbus_connection_get_unix_fd (DBusConnection *connection,
- int *fd)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (connection->transport != NULL, FALSE);
-
-#ifdef DBUS_WIN
- /* FIXME do this on a lower level */
- return FALSE;
-#endif
-
- return dbus_connection_get_socket(connection, fd);
-}
-
-/**
- * Gets the underlying Windows or UNIX socket file descriptor
- * of the connection, if any. DO NOT read or write to the file descriptor, or try to
- * select() on it; use DBusWatch for main loop integration. Not all
- * connections will have a socket. So for adding descriptors
- * to the main loop, use dbus_watch_get_socket() and so forth.
- *
- * If the connection is not socket-based, this function will return FALSE,
- * even if the connection does have a file descriptor of some kind.
- * i.e. this function always returns specifically a socket file descriptor.
- *
- * @param connection the connection
- * @param fd return location for the file descriptor.
- * @returns #TRUE if fd is successfully obtained.
- */
-dbus_bool_t
-dbus_connection_get_socket(DBusConnection *connection,
- int *fd)
-{
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (connection->transport != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- retval = _dbus_transport_get_socket_fd (connection->transport,
- fd);
-
- CONNECTION_UNLOCK (connection);
-
- return retval;
-}
-
-
-/**
- * Gets the UNIX user ID of the connection if known. Returns #TRUE if
- * the uid is filled in. Always returns #FALSE on non-UNIX platforms
- * for now, though in theory someone could hook Windows to NIS or
- * something. Always returns #FALSE prior to authenticating the
- * connection.
- *
- * The UID is only read by servers from clients; clients can't usually
- * get the UID of servers, because servers do not authenticate to
- * clients. The returned UID is the UID the connection authenticated
- * as.
- *
- * The message bus is a server and the apps connecting to the bus
- * are clients.
- *
- * You can ask the bus to tell you the UID of another connection though
- * if you like; this is done with dbus_bus_get_unix_user().
- *
- * @param connection the connection
- * @param uid return location for the user ID
- * @returns #TRUE if uid is filled in with a valid user ID
- */
-dbus_bool_t
-dbus_connection_get_unix_user (DBusConnection *connection,
- unsigned long *uid)
-{
- dbus_bool_t result;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (uid != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_transport_try_to_authenticate (connection->transport))
- result = FALSE;
- else
- result = _dbus_transport_get_unix_user (connection->transport,
- uid);
-
-#ifdef DBUS_WIN
- _dbus_assert (!result);
-#endif
-
- CONNECTION_UNLOCK (connection);
-
- return result;
-}
-
-/**
- * Gets the process ID of the connection if any.
- * Returns #TRUE if the pid is filled in.
- * Always returns #FALSE prior to authenticating the
- * connection.
- *
- * @param connection the connection
- * @param pid return location for the process ID
- * @returns #TRUE if uid is filled in with a valid process ID
- */
-dbus_bool_t
-dbus_connection_get_unix_process_id (DBusConnection *connection,
- unsigned long *pid)
-{
- dbus_bool_t result;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (pid != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_transport_try_to_authenticate (connection->transport))
- result = FALSE;
- else
- result = _dbus_transport_get_unix_process_id (connection->transport,
- pid);
-
- CONNECTION_UNLOCK (connection);
-
- return result;
-}
-
-/**
- * Gets the ADT audit data of the connection if any.
- * Returns #TRUE if the structure pointer is returned.
- * Always returns #FALSE prior to authenticating the
- * connection.
- *
- * @param connection the connection
- * @param data return location for audit data
- * @param data_size return location for length of audit data
- * @returns #TRUE if audit data is filled in with a valid ucred pointer
- */
-dbus_bool_t
-dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
- void **data,
- dbus_int32_t *data_size)
-{
- dbus_bool_t result;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (data != NULL, FALSE);
- _dbus_return_val_if_fail (data_size != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_transport_try_to_authenticate (connection->transport))
- result = FALSE;
- else
- result = _dbus_transport_get_adt_audit_session_data (connection->transport,
- data,
- data_size);
- CONNECTION_UNLOCK (connection);
-
- return result;
-}
-
-/**
- * Sets a predicate function used to determine whether a given user ID
- * is allowed to connect. When an incoming connection has
- * authenticated with a particular user ID, this function is called;
- * if it returns #TRUE, the connection is allowed to proceed,
- * otherwise the connection is disconnected.
- *
- * If the function is set to #NULL (as it is by default), then
- * only the same UID as the server process will be allowed to
- * connect. Also, root is always allowed to connect.
- *
- * On Windows, the function will be set and its free_data_function will
- * be invoked when the connection is freed or a new function is set.
- * However, the function will never be called, because there are
- * no UNIX user ids to pass to it, or at least none of the existing
- * auth protocols would allow authenticating as a UNIX user on Windows.
- *
- * @param connection the connection
- * @param function the predicate
- * @param data data to pass to the predicate
- * @param free_data_function function to free the data
- */
-void
-dbus_connection_set_unix_user_function (DBusConnection *connection,
- DBusAllowUnixUserFunction function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- void *old_data = NULL;
- DBusFreeFunction old_free_function = NULL;
-
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_unix_user_function (connection->transport,
- function, data, free_data_function,
- &old_data, &old_free_function);
- CONNECTION_UNLOCK (connection);
-
- if (old_free_function != NULL)
- (* old_free_function) (old_data);
-}
-
-/**
- * Gets the Windows user SID of the connection if known. Returns
- * #TRUE if the ID is filled in. Always returns #FALSE on non-Windows
- * platforms for now, though in theory someone could hook UNIX to
- * Active Directory or something. Always returns #FALSE prior to
- * authenticating the connection.
- *
- * The user is only read by servers from clients; clients can't usually
- * get the user of servers, because servers do not authenticate to
- * clients. The returned user is the user the connection authenticated
- * as.
- *
- * The message bus is a server and the apps connecting to the bus
- * are clients.
- *
- * The returned user string has to be freed with dbus_free().
- *
- * The return value indicates whether the user SID is available;
- * if it's available but we don't have the memory to copy it,
- * then the return value is #TRUE and #NULL is given as the SID.
- *
- * @todo We would like to be able to say "You can ask the bus to tell
- * you the user of another connection though if you like; this is done
- * with dbus_bus_get_windows_user()." But this has to be implemented
- * in bus/driver.c and dbus/dbus-bus.c, and is pointless anyway
- * since on Windows we only use the session bus for now.
- *
- * @param connection the connection
- * @param windows_sid_p return location for an allocated copy of the user ID, or #NULL if no memory
- * @returns #TRUE if user is available (returned value may be #NULL anyway if no memory)
- */
-dbus_bool_t
-dbus_connection_get_windows_user (DBusConnection *connection,
- char **windows_sid_p)
-{
- dbus_bool_t result;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (windows_sid_p != NULL, FALSE);
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_transport_try_to_authenticate (connection->transport))
- result = FALSE;
- else
- result = _dbus_transport_get_windows_user (connection->transport,
- windows_sid_p);
-
-#ifdef DBUS_UNIX
- _dbus_assert (!result);
-#endif
-
- CONNECTION_UNLOCK (connection);
-
- return result;
-}
-
-/**
- * Sets a predicate function used to determine whether a given user ID
- * is allowed to connect. When an incoming connection has
- * authenticated with a particular user ID, this function is called;
- * if it returns #TRUE, the connection is allowed to proceed,
- * otherwise the connection is disconnected.
- *
- * If the function is set to #NULL (as it is by default), then
- * only the same user owning the server process will be allowed to
- * connect.
- *
- * On UNIX, the function will be set and its free_data_function will
- * be invoked when the connection is freed or a new function is set.
- * However, the function will never be called, because there is no
- * way right now to authenticate as a Windows user on UNIX.
- *
- * @param connection the connection
- * @param function the predicate
- * @param data data to pass to the predicate
- * @param free_data_function function to free the data
- */
-void
-dbus_connection_set_windows_user_function (DBusConnection *connection,
- DBusAllowWindowsUserFunction function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- void *old_data = NULL;
- DBusFreeFunction old_free_function = NULL;
-
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_windows_user_function (connection->transport,
- function, data, free_data_function,
- &old_data, &old_free_function);
- CONNECTION_UNLOCK (connection);
-
- if (old_free_function != NULL)
- (* old_free_function) (old_data);
-}
-
-/**
- * This function must be called on the server side of a connection when the
- * connection is first seen in the #DBusNewConnectionFunction. If set to
- * #TRUE (the default is #FALSE), then the connection can proceed even if
- * the client does not authenticate as some user identity, i.e. clients
- * can connect anonymously.
- *
- * This setting interacts with the available authorization mechanisms
- * (see dbus_server_set_auth_mechanisms()). Namely, an auth mechanism
- * such as ANONYMOUS that supports anonymous auth must be included in
- * the list of available mechanisms for anonymous login to work.
- *
- * This setting also changes the default rule for connections
- * authorized as a user; normally, if a connection authorizes as
- * a user identity, it is permitted if the user identity is
- * root or the user identity matches the user identity of the server
- * process. If anonymous connections are allowed, however,
- * then any user identity is allowed.
- *
- * You can override the rules for connections authorized as a
- * user identity with dbus_connection_set_unix_user_function()
- * and dbus_connection_set_windows_user_function().
- *
- * @param connection the connection
- * @param value whether to allow authentication as an anonymous user
- */
-void
-dbus_connection_set_allow_anonymous (DBusConnection *connection,
- dbus_bool_t value)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_allow_anonymous (connection->transport, value);
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- *
- * Normally #DBusConnection automatically handles all messages to the
- * org.freedesktop.DBus.Peer interface. However, the message bus wants
- * to be able to route methods on that interface through the bus and
- * to other applications. If routing peer messages is enabled, then
- * messages with the org.freedesktop.DBus.Peer interface that also
- * have a bus destination name set will not be automatically
- * handled by the #DBusConnection and instead will be dispatched
- * normally to the application.
- *
- * If a normal application sets this flag, it can break things badly.
- * So don't set this unless you are the message bus.
- *
- * @param connection the connection
- * @param value #TRUE to pass through org.freedesktop.DBus.Peer messages with a bus name set
- */
-void
-dbus_connection_set_route_peer_messages (DBusConnection *connection,
- dbus_bool_t value)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- connection->route_peer_messages = value;
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Adds a message filter. Filters are handlers that are run on all
- * incoming messages, prior to the objects registered with
- * dbus_connection_register_object_path(). Filters are run in the
- * order that they were added. The same handler can be added as a
- * filter more than once, in which case it will be run more than once.
- * Filters added during a filter callback won't be run on the message
- * being processed.
- *
- * @todo we don't run filters on messages while blocking without
- * entering the main loop, since filters are run as part of
- * dbus_connection_dispatch(). This is probably a feature, as filters
- * could create arbitrary reentrancy. But kind of sucks if you're
- * trying to filter METHOD_RETURN for some reason.
- *
- * @param connection the connection
- * @param function function to handle messages
- * @param user_data user data to pass to the function
- * @param free_data_function function to use for freeing user data
- * @returns #TRUE on success, #FALSE if not enough memory.
- */
-dbus_bool_t
-dbus_connection_add_filter (DBusConnection *connection,
- DBusHandleMessageFunction function,
- void *user_data,
- DBusFreeFunction free_data_function)
-{
- DBusMessageFilter *filter;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (function != NULL, FALSE);
-
- filter = dbus_new0 (DBusMessageFilter, 1);
- if (filter == NULL)
- return FALSE;
-
- _dbus_atomic_inc (&filter->refcount);
-
- CONNECTION_LOCK (connection);
-
- if (!_dbus_list_append (&connection->filter_list,
- filter))
- {
- _dbus_message_filter_unref (filter);
- CONNECTION_UNLOCK (connection);
- return FALSE;
- }
-
- /* Fill in filter after all memory allocated,
- * so we don't run the free_user_data_function
- * if the add_filter() fails
- */
-
- filter->function = function;
- filter->user_data = user_data;
- filter->free_user_data_function = free_data_function;
-
- CONNECTION_UNLOCK (connection);
- return TRUE;
-}
-
-/**
- * Removes a previously-added message filter. It is a programming
- * error to call this function for a handler that has not been added
- * as a filter. If the given handler was added more than once, only
- * one instance of it will be removed (the most recently-added
- * instance).
- *
- * @param connection the connection
- * @param function the handler to remove
- * @param user_data user data for the handler to remove
- *
- */
-void
-dbus_connection_remove_filter (DBusConnection *connection,
- DBusHandleMessageFunction function,
- void *user_data)
-{
- DBusList *link;
- DBusMessageFilter *filter;
-
- _dbus_return_if_fail (connection != NULL);
- _dbus_return_if_fail (function != NULL);
-
- CONNECTION_LOCK (connection);
-
- filter = NULL;
-
- link = _dbus_list_get_last_link (&connection->filter_list);
- while (link != NULL)
- {
- filter = link->data;
-
- if (filter->function == function &&
- filter->user_data == user_data)
- {
- _dbus_list_remove_link (&connection->filter_list, link);
- filter->function = NULL;
-
- break;
- }
-
- link = _dbus_list_get_prev_link (&connection->filter_list, link);
- filter = NULL;
- }
-
- CONNECTION_UNLOCK (connection);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (filter == NULL)
- {
- _dbus_warn_check_failed ("Attempt to remove filter function %p user data %p, but no such filter has been added\n",
- function, user_data);
- return;
- }
-#endif
-
- /* Call application code */
- if (filter->free_user_data_function)
- (* filter->free_user_data_function) (filter->user_data);
-
- filter->free_user_data_function = NULL;
- filter->user_data = NULL;
-
- _dbus_message_filter_unref (filter);
-}
-
-/**
- * Registers a handler for a given path or subsection in the object
- * hierarchy. The given vtable handles messages sent to exactly the
- * given path or also for paths bellow that, depending on fallback
- * parameter.
- *
- * @param connection the connection
- * @param fallback whether to handle messages also for "subdirectory"
- * @param path a '/' delimited string of path elements
- * @param vtable the virtual table
- * @param user_data data to pass to functions in the vtable
- * @param error address where an error can be returned
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) is reported
- */
-static dbus_bool_t
-_dbus_connection_register_object_path (DBusConnection *connection,
- dbus_bool_t fallback,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error)
-{
- char **decomposed_path;
- dbus_bool_t retval;
-
- if (!_dbus_decompose_path (path, strlen (path), &decomposed_path, NULL))
- return FALSE;
-
- CONNECTION_LOCK (connection);
-
- retval = _dbus_object_tree_register (connection->objects,
- fallback,
- (const char **) decomposed_path, vtable,
- user_data, error);
-
- CONNECTION_UNLOCK (connection);
-
- dbus_free_string_array (decomposed_path);
-
- return retval;
-}
-
-/**
- * Registers a handler for a given path in the object hierarchy.
- * The given vtable handles messages sent to exactly the given path.
- *
- * @param connection the connection
- * @param path a '/' delimited string of path elements
- * @param vtable the virtual table
- * @param user_data data to pass to functions in the vtable
- * @param error address where an error can be returned
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) is reported
- */
-dbus_bool_t
-dbus_connection_try_register_object_path (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (path[0] == '/', FALSE);
- _dbus_return_val_if_fail (vtable != NULL, FALSE);
-
- return _dbus_connection_register_object_path (connection, FALSE, path, vtable, user_data, error);
-}
-
-/**
- * Registers a handler for a given path in the object hierarchy.
- * The given vtable handles messages sent to exactly the given path.
- *
- * It is a bug to call this function for object paths which already
- * have a handler. Use dbus_connection_try_register_object_path() if this
- * might be the case.
- *
- * @param connection the connection
- * @param path a '/' delimited string of path elements
- * @param vtable the virtual table
- * @param user_data data to pass to functions in the vtable
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) ocurred
- */
-dbus_bool_t
-dbus_connection_register_object_path (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data)
-{
- dbus_bool_t retval;
- DBusError error = DBUS_ERROR_INIT;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (path[0] == '/', FALSE);
- _dbus_return_val_if_fail (vtable != NULL, FALSE);
-
- retval = _dbus_connection_register_object_path (connection, FALSE, path, vtable, user_data, &error);
-
- if (dbus_error_has_name (&error, DBUS_ERROR_OBJECT_PATH_IN_USE))
- {
- _dbus_warn ("%s\n", error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- return retval;
-}
-
-/**
- * Registers a fallback handler for a given subsection of the object
- * hierarchy. The given vtable handles messages at or below the given
- * path. You can use this to establish a default message handling
- * policy for a whole "subdirectory."
- *
- * @param connection the connection
- * @param path a '/' delimited string of path elements
- * @param vtable the virtual table
- * @param user_data data to pass to functions in the vtable
- * @param error address where an error can be returned
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) is reported
- */
-dbus_bool_t
-dbus_connection_try_register_fallback (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error)
-{
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (path[0] == '/', FALSE);
- _dbus_return_val_if_fail (vtable != NULL, FALSE);
-
- return _dbus_connection_register_object_path (connection, TRUE, path, vtable, user_data, error);
-}
-
-/**
- * Registers a fallback handler for a given subsection of the object
- * hierarchy. The given vtable handles messages at or below the given
- * path. You can use this to establish a default message handling
- * policy for a whole "subdirectory."
- *
- * It is a bug to call this function for object paths which already
- * have a handler. Use dbus_connection_try_register_fallback() if this
- * might be the case.
- *
- * @param connection the connection
- * @param path a '/' delimited string of path elements
- * @param vtable the virtual table
- * @param user_data data to pass to functions in the vtable
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) occured
- */
-dbus_bool_t
-dbus_connection_register_fallback (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data)
-{
- dbus_bool_t retval;
- DBusError error = DBUS_ERROR_INIT;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (path[0] == '/', FALSE);
- _dbus_return_val_if_fail (vtable != NULL, FALSE);
-
- retval = _dbus_connection_register_object_path (connection, TRUE, path, vtable, user_data, &error);
-
- if (dbus_error_has_name (&error, DBUS_ERROR_OBJECT_PATH_IN_USE))
- {
- _dbus_warn ("%s\n", error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- return retval;
-}
-
-/**
- * Unregisters the handler registered with exactly the given path.
- * It's a bug to call this function for a path that isn't registered.
- * Can unregister both fallback paths and object paths.
- *
- * @param connection the connection
- * @param path a '/' delimited string of path elements
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_connection_unregister_object_path (DBusConnection *connection,
- const char *path)
-{
- char **decomposed_path;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (path[0] == '/', FALSE);
-
- if (!_dbus_decompose_path (path, strlen (path), &decomposed_path, NULL))
- return FALSE;
-
- CONNECTION_LOCK (connection);
-
- _dbus_object_tree_unregister_and_unlock (connection->objects, (const char **) decomposed_path);
-
- dbus_free_string_array (decomposed_path);
-
- return TRUE;
-}
-
-/**
- * Gets the user data passed to dbus_connection_register_object_path()
- * or dbus_connection_register_fallback(). If nothing was registered
- * at this path, the data is filled in with #NULL.
- *
- * @param connection the connection
- * @param path the path you registered with
- * @param data_p location to store the user data, or #NULL
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_connection_get_object_path_data (DBusConnection *connection,
- const char *path,
- void **data_p)
-{
- char **decomposed_path;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
- _dbus_return_val_if_fail (data_p != NULL, FALSE);
-
- *data_p = NULL;
-
- if (!_dbus_decompose_path (path, strlen (path), &decomposed_path, NULL))
- return FALSE;
-
- CONNECTION_LOCK (connection);
-
- *data_p = _dbus_object_tree_get_user_data_unlocked (connection->objects, (const char**) decomposed_path);
-
- CONNECTION_UNLOCK (connection);
-
- dbus_free_string_array (decomposed_path);
-
- return TRUE;
-}
-
-/**
- * Lists the registered fallback handlers and object path handlers at
- * the given parent_path. The returned array should be freed with
- * dbus_free_string_array().
- *
- * @param connection the connection
- * @param parent_path the path to list the child handlers of
- * @param child_entries returns #NULL-terminated array of children
- * @returns #FALSE if no memory to allocate the child entries
- */
-dbus_bool_t
-dbus_connection_list_registered (DBusConnection *connection,
- const char *parent_path,
- char ***child_entries)
-{
- char **decomposed_path;
- dbus_bool_t retval;
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (parent_path != NULL, FALSE);
- _dbus_return_val_if_fail (parent_path[0] == '/', FALSE);
- _dbus_return_val_if_fail (child_entries != NULL, FALSE);
-
- if (!_dbus_decompose_path (parent_path, strlen (parent_path), &decomposed_path, NULL))
- return FALSE;
-
- CONNECTION_LOCK (connection);
-
- retval = _dbus_object_tree_list_registered_and_unlock (connection->objects,
- (const char **) decomposed_path,
- child_entries);
- dbus_free_string_array (decomposed_path);
-
- return retval;
-}
-
-static DBusDataSlotAllocator slot_allocator =
- _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (connection_slots));
-
-/**
- * Allocates an integer ID to be used for storing application-specific
- * data on any DBusConnection. The allocated ID may then be used
- * with dbus_connection_set_data() and dbus_connection_get_data().
- * The passed-in slot must be initialized to -1, and is filled in
- * with the slot ID. If the passed-in slot is not -1, it's assumed
- * to be already allocated, and its refcount is incremented.
- *
- * The allocated slot is global, i.e. all DBusConnection objects will
- * have a slot with the given integer ID reserved.
- *
- * @param slot_p address of a global variable storing the slot
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_connection_allocate_data_slot (dbus_int32_t *slot_p)
-{
- return _dbus_data_slot_allocator_alloc (&slot_allocator,
- slot_p);
-}
-
-/**
- * Deallocates a global ID for connection data slots.
- * dbus_connection_get_data() and dbus_connection_set_data() may no
- * longer be used with this slot. Existing data stored on existing
- * DBusConnection objects will be freed when the connection is
- * finalized, but may not be retrieved (and may only be replaced if
- * someone else reallocates the slot). When the refcount on the
- * passed-in slot reaches 0, it is set to -1.
- *
- * @param slot_p address storing the slot to deallocate
- */
-void
-dbus_connection_free_data_slot (dbus_int32_t *slot_p)
-{
- _dbus_return_if_fail (*slot_p >= 0);
-
- _dbus_data_slot_allocator_free (&slot_allocator, slot_p);
-}
-
-/**
- * Stores a pointer on a DBusConnection, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the connection is finalized. The slot number
- * must have been allocated with dbus_connection_allocate_data_slot().
- *
- * @note This function does not take the
- * main thread lock on DBusConnection, which allows it to be
- * used from inside watch and timeout functions. (See the
- * note in docs for dbus_connection_set_watch_functions().)
- * A side effect of this is that you need to know there's
- * a reference held on the connection while invoking
- * dbus_connection_set_data(), or the connection could be
- * finalized during dbus_connection_set_data().
- *
- * @param connection the connection
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-dbus_connection_set_data (DBusConnection *connection,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func)
-{
- DBusFreeFunction old_free_func;
- void *old_data;
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (slot >= 0, FALSE);
-
- SLOTS_LOCK (connection);
-
- retval = _dbus_data_slot_list_set (&slot_allocator,
- &connection->slot_list,
- slot, data, free_data_func,
- &old_free_func, &old_data);
-
- SLOTS_UNLOCK (connection);
-
- if (retval)
- {
- /* Do the actual free outside the connection lock */
- if (old_free_func)
- (* old_free_func) (old_data);
- }
-
- return retval;
-}
-
-/**
- * Retrieves data previously set with dbus_connection_set_data().
- * The slot must still be allocated (must not have been freed).
- *
- * @note This function does not take the
- * main thread lock on DBusConnection, which allows it to be
- * used from inside watch and timeout functions. (See the
- * note in docs for dbus_connection_set_watch_functions().)
- * A side effect of this is that you need to know there's
- * a reference held on the connection while invoking
- * dbus_connection_get_data(), or the connection could be
- * finalized during dbus_connection_get_data().
- *
- * @param connection the connection
- * @param slot the slot to get data from
- * @returns the data, or #NULL if not found
- */
-void*
-dbus_connection_get_data (DBusConnection *connection,
- dbus_int32_t slot)
-{
- void *res;
-
- _dbus_return_val_if_fail (connection != NULL, NULL);
- _dbus_return_val_if_fail (slot >= 0, NULL);
-
- SLOTS_LOCK (connection);
-
- res = _dbus_data_slot_list_get (&slot_allocator,
- &connection->slot_list,
- slot);
-
- SLOTS_UNLOCK (connection);
-
- return res;
-}
-
-/**
- * This function sets a global flag for whether dbus_connection_new()
- * will set SIGPIPE behavior to SIG_IGN.
- *
- * @param will_modify_sigpipe #TRUE to allow sigpipe to be set to SIG_IGN
- */
-void
-dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe)
-{
- _dbus_modify_sigpipe = will_modify_sigpipe != FALSE;
-}
-
-/**
- * Specifies the maximum size message this connection is allowed to
- * receive. Larger messages will result in disconnecting the
- * connection.
- *
- * @param connection a #DBusConnection
- * @param size maximum message size the connection can receive, in bytes
- */
-void
-dbus_connection_set_max_message_size (DBusConnection *connection,
- long size)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_max_message_size (connection->transport,
- size);
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Gets the value set by dbus_connection_set_max_message_size().
- *
- * @param connection the connection
- * @returns the max size of a single message
- */
-long
-dbus_connection_get_max_message_size (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_get_max_message_size (connection->transport);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-/**
- * Specifies the maximum number of unix fds a message on this
- * connection is allowed to receive. Messages with more unix fds will
- * result in disconnecting the connection.
- *
- * @param connection a #DBusConnection
- * @param n maximum message unix fds the connection can receive
- */
-void
-dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
- long n)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_max_message_unix_fds (connection->transport,
- n);
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Gets the value set by dbus_connection_set_max_message_unix_fds().
- *
- * @param connection the connection
- * @returns the max numer of unix fds of a single message
- */
-long
-dbus_connection_get_max_message_unix_fds (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_get_max_message_unix_fds (connection->transport);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-/**
- * Sets the maximum total number of bytes that can be used for all messages
- * received on this connection. Messages count toward the maximum until
- * they are finalized. When the maximum is reached, the connection will
- * not read more data until some messages are finalized.
- *
- * The semantics of the maximum are: if outstanding messages are
- * already above the maximum, additional messages will not be read.
- * The semantics are not: if the next message would cause us to exceed
- * the maximum, we don't read it. The reason is that we don't know the
- * size of a message until after we read it.
- *
- * Thus, the max live messages size can actually be exceeded
- * by up to the maximum size of a single message.
- *
- * Also, if we read say 1024 bytes off the wire in a single read(),
- * and that contains a half-dozen small messages, we may exceed the
- * size max by that amount. But this should be inconsequential.
- *
- * This does imply that we can't call read() with a buffer larger
- * than we're willing to exceed this limit by.
- *
- * @param connection the connection
- * @param size the maximum size in bytes of all outstanding messages
- */
-void
-dbus_connection_set_max_received_size (DBusConnection *connection,
- long size)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_max_received_size (connection->transport,
- size);
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Gets the value set by dbus_connection_set_max_received_size().
- *
- * @param connection the connection
- * @returns the max size of all live messages
- */
-long
-dbus_connection_get_max_received_size (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_get_max_received_size (connection->transport);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-/**
- * Sets the maximum total number of unix fds that can be used for all messages
- * received on this connection. Messages count toward the maximum until
- * they are finalized. When the maximum is reached, the connection will
- * not read more data until some messages are finalized.
- *
- * The semantics are analogous to those of dbus_connection_set_max_received_size().
- *
- * @param connection the connection
- * @param n the maximum size in bytes of all outstanding messages
- */
-void
-dbus_connection_set_max_received_unix_fds (DBusConnection *connection,
- long n)
-{
- _dbus_return_if_fail (connection != NULL);
-
- CONNECTION_LOCK (connection);
- _dbus_transport_set_max_received_unix_fds (connection->transport,
- n);
- CONNECTION_UNLOCK (connection);
-}
-
-/**
- * Gets the value set by dbus_connection_set_max_received_unix_fds().
- *
- * @param connection the connection
- * @returns the max unix fds of all live messages
- */
-long
-dbus_connection_get_max_received_unix_fds (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_transport_get_max_received_unix_fds (connection->transport);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-/**
- * Gets the approximate size in bytes of all messages in the outgoing
- * message queue. The size is approximate in that you shouldn't use
- * it to decide how many bytes to read off the network or anything
- * of that nature, as optimizations may choose to tell small white lies
- * to avoid performance overhead.
- *
- * @param connection the connection
- * @returns the number of bytes that have been queued up but not sent
- */
-long
-dbus_connection_get_outgoing_size (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_counter_get_size_value (connection->outgoing_counter);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-#ifdef DBUS_ENABLE_STATS
-void
-_dbus_connection_get_stats (DBusConnection *connection,
- dbus_uint32_t *in_messages,
- dbus_uint32_t *in_bytes,
- dbus_uint32_t *in_fds,
- dbus_uint32_t *in_peak_bytes,
- dbus_uint32_t *in_peak_fds,
- dbus_uint32_t *out_messages,
- dbus_uint32_t *out_bytes,
- dbus_uint32_t *out_fds,
- dbus_uint32_t *out_peak_bytes,
- dbus_uint32_t *out_peak_fds)
-{
- CONNECTION_LOCK (connection);
-
- if (in_messages != NULL)
- *in_messages = connection->n_incoming;
-
- _dbus_transport_get_stats (connection->transport,
- in_bytes, in_fds, in_peak_bytes, in_peak_fds);
-
- if (out_messages != NULL)
- *out_messages = connection->n_outgoing;
-
- if (out_bytes != NULL)
- *out_bytes = _dbus_counter_get_size_value (connection->outgoing_counter);
-
- if (out_fds != NULL)
- *out_fds = _dbus_counter_get_unix_fd_value (connection->outgoing_counter);
-
- if (out_peak_bytes != NULL)
- *out_peak_bytes = _dbus_counter_get_peak_size_value (connection->outgoing_counter);
-
- if (out_peak_fds != NULL)
- *out_peak_fds = _dbus_counter_get_peak_unix_fd_value (connection->outgoing_counter);
-
- CONNECTION_UNLOCK (connection);
-}
-#endif /* DBUS_ENABLE_STATS */
-
-/**
- * Gets the approximate number of uni fds of all messages in the
- * outgoing message queue.
- *
- * @param connection the connection
- * @returns the number of unix fds that have been queued up but not sent
- */
-long
-dbus_connection_get_outgoing_unix_fds (DBusConnection *connection)
-{
- long res;
-
- _dbus_return_val_if_fail (connection != NULL, 0);
-
- CONNECTION_LOCK (connection);
- res = _dbus_counter_get_unix_fd_value (connection->outgoing_counter);
- CONNECTION_UNLOCK (connection);
- return res;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Returns the address of the transport object of this connection
- *
- * @param connection the connection
- * @returns the address string
- */
-const char*
-_dbus_connection_get_address (DBusConnection *connection)
-{
- return _dbus_transport_get_address (connection->transport);
-}
-#endif
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.h
deleted file mode 100644
index fe4d04ef3a..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-connection.h
+++ /dev/null
@@ -1,496 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-connection.h DBusConnection object
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_CONNECTION_H
-#define DBUS_CONNECTION_H
-
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-shared.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusConnection
- * @{
- */
-
-/* documented in dbus-watch.c */
-typedef struct DBusWatch DBusWatch;
-/* documented in dbus-timeout.c */
-typedef struct DBusTimeout DBusTimeout;
-/** Opaque type representing preallocated resources so a message can be sent without further memory allocation. */
-typedef struct DBusPreallocatedSend DBusPreallocatedSend;
-/** Opaque type representing a method call that has not yet received a reply. */
-typedef struct DBusPendingCall DBusPendingCall;
-/** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */
-typedef struct DBusConnection DBusConnection;
-/** Set of functions that must be implemented to handle messages sent to a particular object path. */
-typedef struct DBusObjectPathVTable DBusObjectPathVTable;
-
-/**
- * Indicates the status of a #DBusWatch.
- */
-typedef enum
-{
- DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */
- DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */
- DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for
- * this, but can be present in
- * current state passed to
- * dbus_watch_handle()).
- */
- DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for
- * it, but can be present in current
- * state passed to
- * dbus_watch_handle()).
- */
- /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
-} DBusWatchFlags;
-
-/**
- * Indicates the status of incoming data on a #DBusConnection. This determines whether
- * dbus_connection_dispatch() needs to be called.
- */
-typedef enum
-{
- DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */
- DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */
- DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */
-} DBusDispatchStatus;
-
-/** Called when libdbus needs a new watch to be monitored by the main
- * loop. Returns #FALSE if it lacks enough memory to add the
- * watch. Set by dbus_connection_set_watch_functions() or
- * dbus_server_set_watch_functions().
- */
-typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
- void *data);
-/** Called when dbus_watch_get_enabled() may return a different value
- * than it did before. Set by dbus_connection_set_watch_functions()
- * or dbus_server_set_watch_functions().
- */
-typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
- void *data);
-/** Called when libdbus no longer needs a watch to be monitored by the
- * main loop. Set by dbus_connection_set_watch_functions() or
- * dbus_server_set_watch_functions().
- */
-typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
- void *data);
-/** Called when libdbus needs a new timeout to be monitored by the main
- * loop. Returns #FALSE if it lacks enough memory to add the
- * watch. Set by dbus_connection_set_timeout_functions() or
- * dbus_server_set_timeout_functions().
- */
-typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
- void *data);
-/** Called when dbus_timeout_get_enabled() may return a different
- * value than it did before.
- * Set by dbus_connection_set_timeout_functions() or
- * dbus_server_set_timeout_functions().
- */
-typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
- void *data);
-/** Called when libdbus no longer needs a timeout to be monitored by the
- * main loop. Set by dbus_connection_set_timeout_functions() or
- * dbus_server_set_timeout_functions().
- */
-typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
- void *data);
-/** Called when the return value of dbus_connection_get_dispatch_status()
- * may have changed. Set with dbus_connection_set_dispatch_status_function().
- */
-typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
- DBusDispatchStatus new_status,
- void *data);
-/**
- * Called when the main loop's thread should be notified that there's now work
- * to do. Set with dbus_connection_set_wakeup_main_function().
- */
-typedef void (* DBusWakeupMainFunction) (void *data);
-
-/**
- * Called during authentication to check whether the given UNIX user
- * ID is allowed to connect, if the client tried to auth as a UNIX
- * user ID. Normally on Windows this would never happen. Set with
- * dbus_connection_set_unix_user_function().
- */
-typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection,
- unsigned long uid,
- void *data);
-
-/**
- * Called during authentication to check whether the given Windows user
- * ID is allowed to connect, if the client tried to auth as a Windows
- * user ID. Normally on UNIX this would never happen. Set with
- * dbus_connection_set_windows_user_function().
- */
-typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection,
- const char *user_sid,
- void *data);
-
-
-/**
- * Called when a pending call now has a reply available. Set with
- * dbus_pending_call_set_notify().
- */
-typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
- void *user_data);
-
-/**
- * Called when a message needs to be handled. The result indicates whether or
- * not more handlers should be run. Set with dbus_connection_add_filter().
- */
-typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
- DBusMessage *message,
- void *user_data);
-DBUS_EXPORT
-DBusConnection* dbus_connection_open (const char *address,
- DBusError *error);
-DBUS_EXPORT
-DBusConnection* dbus_connection_open_private (const char *address,
- DBusError *error);
-DBUS_EXPORT
-DBusConnection* dbus_connection_ref (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_unref (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_close (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection);
-DBUS_EXPORT
-char* dbus_connection_get_server_id (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_can_send_type (DBusConnection *connection,
- int type);
-
-DBUS_EXPORT
-void dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
- dbus_bool_t exit_on_disconnect);
-DBUS_EXPORT
-void dbus_connection_flush (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection,
- int timeout_milliseconds);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_read_write (DBusConnection *connection,
- int timeout_milliseconds);
-DBUS_EXPORT
-DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_return_message (DBusConnection *connection,
- DBusMessage *message);
-DBUS_EXPORT
-void dbus_connection_steal_borrowed_message (DBusConnection *connection,
- DBusMessage *message);
-DBUS_EXPORT
-DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
-DBUS_EXPORT
-DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
-DBUS_EXPORT
-DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_send (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *client_serial);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection,
- DBusMessage *message,
- DBusPendingCall **pending_return,
- int timeout_milliseconds);
-DBUS_EXPORT
-DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection,
- DBusMessage *message,
- int timeout_milliseconds,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-void dbus_connection_set_wakeup_main_function (DBusConnection *connection,
- DBusWakeupMainFunction wakeup_main_function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-void dbus_connection_set_dispatch_status_function (DBusConnection *connection,
- DBusDispatchStatusFunction function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection,
- unsigned long *uid);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection,
- unsigned long *pid);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
- void **data,
- dbus_int32_t *data_size);
-DBUS_EXPORT
-void dbus_connection_set_unix_user_function (DBusConnection *connection,
- DBusAllowUnixUserFunction function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection,
- char **windows_sid_p);
-DBUS_EXPORT
-void dbus_connection_set_windows_user_function (DBusConnection *connection,
- DBusAllowWindowsUserFunction function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-void dbus_connection_set_allow_anonymous (DBusConnection *connection,
- dbus_bool_t value);
-DBUS_EXPORT
-void dbus_connection_set_route_peer_messages (DBusConnection *connection,
- dbus_bool_t value);
-
-
-/* Filters */
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_add_filter (DBusConnection *connection,
- DBusHandleMessageFunction function,
- void *user_data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-void dbus_connection_remove_filter (DBusConnection *connection,
- DBusHandleMessageFunction function,
- void *user_data);
-
-
-/* Other */
-DBUS_EXPORT
-dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_set_data (DBusConnection *connection,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func);
-DBUS_EXPORT
-void* dbus_connection_get_data (DBusConnection *connection,
- dbus_int32_t slot);
-
-DBUS_EXPORT
-void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
-
-DBUS_EXPORT
-void dbus_connection_set_max_message_size (DBusConnection *connection,
- long size);
-DBUS_EXPORT
-long dbus_connection_get_max_message_size (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_set_max_received_size (DBusConnection *connection,
- long size);
-DBUS_EXPORT
-long dbus_connection_get_max_received_size (DBusConnection *connection);
-
-DBUS_EXPORT
-void dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
- long n);
-DBUS_EXPORT
-long dbus_connection_get_max_message_unix_fds (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_set_max_received_unix_fds(DBusConnection *connection,
- long n);
-DBUS_EXPORT
-long dbus_connection_get_max_received_unix_fds(DBusConnection *connection);
-
-DBUS_EXPORT
-long dbus_connection_get_outgoing_size (DBusConnection *connection);
-DBUS_EXPORT
-long dbus_connection_get_outgoing_unix_fds (DBusConnection *connection);
-
-DBUS_EXPORT
-DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
-DBUS_EXPORT
-void dbus_connection_free_preallocated_send (DBusConnection *connection,
- DBusPreallocatedSend *preallocated);
-DBUS_EXPORT
-void dbus_connection_send_preallocated (DBusConnection *connection,
- DBusPreallocatedSend *preallocated,
- DBusMessage *message,
- dbus_uint32_t *client_serial);
-
-
-/* Object tree functionality */
-
-/**
- * Called when a #DBusObjectPathVTable is unregistered (or its connection is freed).
- * Found in #DBusObjectPathVTable.
- */
-typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
- void *user_data);
-/**
- * Called when a message is sent to a registered object path. Found in
- * #DBusObjectPathVTable which is registered with dbus_connection_register_object_path()
- * or dbus_connection_register_fallback().
- */
-typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection,
- DBusMessage *message,
- void *user_data);
-
-/**
- * Virtual table that must be implemented to handle a portion of the
- * object path hierarchy. Attach the vtable to a particular path using
- * dbus_connection_register_object_path() or
- * dbus_connection_register_fallback().
- */
-struct DBusObjectPathVTable
-{
- DBusObjectPathUnregisterFunction unregister_function; /**< Function to unregister this handler */
- DBusObjectPathMessageFunction message_function; /**< Function to handle messages */
-
- void (* dbus_internal_pad1) (void *); /**< Reserved for future expansion */
- void (* dbus_internal_pad2) (void *); /**< Reserved for future expansion */
- void (* dbus_internal_pad3) (void *); /**< Reserved for future expansion */
- void (* dbus_internal_pad4) (void *); /**< Reserved for future expansion */
-};
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection,
- const char *path,
- const DBusObjectPathVTable *vtable,
- void *user_data);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection,
- const char *path);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection,
- const char *path,
- void **data_p);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_list_registered (DBusConnection *connection,
- const char *parent_path,
- char ***child_entries);
-
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection,
- int *fd);
-DBUS_EXPORT
-dbus_bool_t dbus_connection_get_socket (DBusConnection *connection,
- int *fd);
-
-/** @} */
-
-
-/**
- * @addtogroup DBusWatch
- * @{
- */
-
-#ifndef DBUS_DISABLE_DEPRECATED
-DBUS_EXPORT
-DBUS_DEPRECATED int dbus_watch_get_fd (DBusWatch *watch);
-#endif
-
-DBUS_EXPORT
-int dbus_watch_get_unix_fd (DBusWatch *watch);
-DBUS_EXPORT
-int dbus_watch_get_socket (DBusWatch *watch);
-DBUS_EXPORT
-unsigned int dbus_watch_get_flags (DBusWatch *watch);
-DBUS_EXPORT
-void* dbus_watch_get_data (DBusWatch *watch);
-DBUS_EXPORT
-void dbus_watch_set_data (DBusWatch *watch,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_watch_handle (DBusWatch *watch,
- unsigned int flags);
-DBUS_EXPORT
-dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
-
-/** @} */
-
-/**
- * @addtogroup DBusTimeout
- * @{
- */
-
-DBUS_EXPORT
-int dbus_timeout_get_interval (DBusTimeout *timeout);
-DBUS_EXPORT
-void* dbus_timeout_get_data (DBusTimeout *timeout);
-DBUS_EXPORT
-void dbus_timeout_set_data (DBusTimeout *timeout,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
-DBUS_EXPORT
-dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_CONNECTION_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials-util.c
deleted file mode 100644
index d2d164f75a..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials-util.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-credentials-util.c Would be in dbus-credentials.c, but only used for tests/bus
- *
- * Copyright (C) 2007 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-credentials.h"
-
-/**
- * @addtogroup DBusCredentials
- * @{
- */
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-#include <string.h>
-
-static DBusCredentials*
-make_credentials(dbus_uid_t unix_uid,
- dbus_pid_t pid,
- const char *windows_sid)
-{
- DBusCredentials *credentials;
-
- credentials = _dbus_credentials_new ();
-
- if (unix_uid != DBUS_UID_UNSET)
- {
- if (!_dbus_credentials_add_unix_uid (credentials, unix_uid))
- {
- _dbus_credentials_unref (credentials);
- return NULL;
- }
- }
-
- if (pid != DBUS_PID_UNSET)
- {
- if (!_dbus_credentials_add_pid (credentials, pid))
- {
- _dbus_credentials_unref (credentials);
- return NULL;
- }
- }
-
- if (windows_sid != NULL)
- {
- if (!_dbus_credentials_add_windows_sid (credentials, windows_sid))
- {
- _dbus_credentials_unref (credentials);
- return NULL;
- }
- }
-
- return credentials;
-}
-
-#define SAMPLE_SID "whatever a windows sid looks like"
-#define OTHER_SAMPLE_SID "whatever else"
-
-dbus_bool_t
-_dbus_credentials_test (const char *test_data_dir)
-{
- DBusCredentials *creds;
- DBusCredentials *creds2;
-
- if (test_data_dir == NULL)
- return TRUE;
-
- creds = make_credentials (12, 511, SAMPLE_SID);
- if (creds == NULL)
- _dbus_assert_not_reached ("oom");
-
- /* test refcounting */
- _dbus_credentials_ref (creds);
- _dbus_credentials_unref (creds);
-
- _dbus_assert (_dbus_credentials_include (creds, DBUS_CREDENTIAL_UNIX_USER_ID));
- _dbus_assert (_dbus_credentials_include (creds, DBUS_CREDENTIAL_UNIX_PROCESS_ID));
- _dbus_assert (_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
-
- _dbus_assert (_dbus_credentials_get_unix_uid (creds) == 12);
- _dbus_assert (_dbus_credentials_get_pid (creds) == 511);
- _dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds), SAMPLE_SID) == 0);
-
- _dbus_assert (!_dbus_credentials_are_empty (creds));
- _dbus_assert (!_dbus_credentials_are_anonymous (creds));
-
- /* Test copy */
- creds2 = _dbus_credentials_copy (creds);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (_dbus_credentials_include (creds2, DBUS_CREDENTIAL_UNIX_USER_ID));
- _dbus_assert (_dbus_credentials_include (creds2, DBUS_CREDENTIAL_UNIX_PROCESS_ID));
- _dbus_assert (_dbus_credentials_include (creds2, DBUS_CREDENTIAL_WINDOWS_SID));
-
- _dbus_assert (_dbus_credentials_get_unix_uid (creds2) == 12);
- _dbus_assert (_dbus_credentials_get_pid (creds2) == 511);
- _dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds2), SAMPLE_SID) == 0);
-
- _dbus_assert (_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Same user if both unix and windows are the same */
- creds2 = make_credentials (12, DBUS_PID_UNSET, SAMPLE_SID);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (_dbus_credentials_same_user (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Not the same user if Windows is missing */
- creds2 = make_credentials (12, DBUS_PID_UNSET, NULL);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (!_dbus_credentials_same_user (creds, creds2));
- _dbus_assert (_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Not the same user if Windows is different */
- creds2 = make_credentials (12, DBUS_PID_UNSET, OTHER_SAMPLE_SID);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (!_dbus_credentials_same_user (creds, creds2));
- _dbus_assert (!_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Not the same user if Unix is missing */
- creds2 = make_credentials (DBUS_UID_UNSET, DBUS_PID_UNSET, SAMPLE_SID);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (!_dbus_credentials_same_user (creds, creds2));
- _dbus_assert (_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Not the same user if Unix is different */
- creds2 = make_credentials (15, DBUS_PID_UNSET, SAMPLE_SID);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (!_dbus_credentials_same_user (creds, creds2));
- _dbus_assert (!_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Not the same user if both are missing */
- creds2 = make_credentials (DBUS_UID_UNSET, DBUS_PID_UNSET, NULL);
- if (creds2 == NULL)
- _dbus_assert_not_reached ("oom");
-
- _dbus_assert (!_dbus_credentials_same_user (creds, creds2));
- _dbus_assert (_dbus_credentials_are_superset (creds, creds2));
-
- _dbus_credentials_unref (creds2);
-
- /* Clearing credentials works */
- _dbus_credentials_clear (creds);
-
- _dbus_assert (!_dbus_credentials_include (creds, DBUS_CREDENTIAL_UNIX_USER_ID));
- _dbus_assert (!_dbus_credentials_include (creds, DBUS_CREDENTIAL_UNIX_PROCESS_ID));
- _dbus_assert (!_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
-
- _dbus_assert (_dbus_credentials_get_unix_uid (creds) == DBUS_UID_UNSET);
- _dbus_assert (_dbus_credentials_get_pid (creds) == DBUS_PID_UNSET);
- _dbus_assert (_dbus_credentials_get_windows_sid (creds) == NULL);
-
- _dbus_assert (_dbus_credentials_are_empty (creds));
- _dbus_assert (_dbus_credentials_are_anonymous (creds));
-
- _dbus_credentials_unref (creds);
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.c
deleted file mode 100644
index 7325125c20..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-credentials.c Credentials provable through authentication
- *
- * Copyright (C) 2007 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#include <string.h>
-#include "dbus-credentials.h"
-#include "dbus-internals.h"
-
-/**
- * @defgroup DBusCredentials Credentials provable through authentication
- * @ingroup DBusInternals
- * @brief DBusCredentials object
- *
- * Credentials are what you have to prove you have in order to
- * authenticate. The main credentials right now are a unix user
- * account, a Windows user account, or a UNIX process ID.
- */
-
-/**
- * @defgroup DBusCredentialsInternals Credentials implementation details
- * @ingroup DBusInternals
- * @brief DBusCredentials implementation details
- *
- * Private details of credentials code.
- *
- * @{
- */
-
-struct DBusCredentials {
- int refcount;
- dbus_uid_t unix_uid;
- dbus_pid_t pid;
- char *windows_sid;
- void *adt_audit_data;
- dbus_int32_t adt_audit_data_size;
-};
-
-/** @} */
-
-/**
- * @addtogroup DBusCredentials
- * @{
- */
-
-/**
- * Creates a new credentials object.
- *
- * @returns the new object or #NULL if no memory
- */
-DBusCredentials*
-_dbus_credentials_new (void)
-{
- DBusCredentials *creds;
-
- creds = dbus_new (DBusCredentials, 1);
- if (creds == NULL)
- return NULL;
-
- creds->refcount = 1;
- creds->unix_uid = DBUS_UID_UNSET;
- creds->pid = DBUS_PID_UNSET;
- creds->windows_sid = NULL;
- creds->adt_audit_data = NULL;
- creds->adt_audit_data_size = 0;
-
- return creds;
-}
-
-/**
- * Creates a new object with credentials (user ID and process ID) from the current process.
- * @returns the new object or #NULL if no memory
- */
-DBusCredentials*
-_dbus_credentials_new_from_current_process (void)
-{
- DBusCredentials *creds;
-
- creds = _dbus_credentials_new ();
- if (creds == NULL)
- return NULL;
-
- if (!_dbus_credentials_add_from_current_process (creds))
- {
- _dbus_credentials_unref (creds);
- return NULL;
- }
-
- return creds;
-}
-
-/**
- * Increment refcount on credentials.
- *
- * @param credentials the object
- */
-void
-_dbus_credentials_ref (DBusCredentials *credentials)
-{
- _dbus_assert (credentials->refcount > 0);
- credentials->refcount += 1;
-}
-
-/**
- * Decrement refcount on credentials.
- *
- * @param credentials the object
- */
-void
-_dbus_credentials_unref (DBusCredentials *credentials)
-{
- _dbus_assert (credentials->refcount > 0);
-
- credentials->refcount -= 1;
- if (credentials->refcount == 0)
- {
- dbus_free (credentials->windows_sid);
- dbus_free (credentials->adt_audit_data);
- dbus_free (credentials);
- }
-}
-
-/**
- * Add a UNIX process ID to the credentials.
- *
- * @param credentials the object
- * @param pid the process ID
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_pid (DBusCredentials *credentials,
- dbus_pid_t pid)
-{
- credentials->pid = pid;
- return TRUE;
-}
-
-/**
- * Add a UNIX user ID to the credentials.
- *
- * @param credentials the object
- * @param uid the user ID
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_unix_uid(DBusCredentials *credentials,
- dbus_uid_t uid)
-{
- credentials->unix_uid = uid;
- return TRUE;
-
-}
-
-/**
- * Add a Windows user SID to the credentials.
- *
- * @param credentials the object
- * @param windows_sid the user SID
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_windows_sid (DBusCredentials *credentials,
- const char *windows_sid)
-{
- char *copy;
-
- copy = _dbus_strdup (windows_sid);
- if (copy == NULL)
- return FALSE;
-
- dbus_free (credentials->windows_sid);
- credentials->windows_sid = copy;
-
- return TRUE;
-}
-
-/**
- * Add ADT audit data to the credentials.
- *
- * @param credentials the object
- * @param audit_data the audit data
- * @param size the length of audit data
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_adt_audit_data (DBusCredentials *credentials,
- void *audit_data,
- dbus_int32_t size)
-{
- void *copy;
- copy = _dbus_memdup (audit_data, size);
- if (copy == NULL)
- return FALSE;
-
- dbus_free (credentials->adt_audit_data);
- credentials->adt_audit_data = copy;
- credentials->adt_audit_data_size = size;
-
- return TRUE;
-}
-
-/**
- * Checks whether the given credential is present.
- *
- * @param credentials the object
- * @param type the credential to check for
- * @returns #TRUE if the credential is present
- */
-dbus_bool_t
-_dbus_credentials_include (DBusCredentials *credentials,
- DBusCredentialType type)
-{
- switch (type)
- {
- case DBUS_CREDENTIAL_UNIX_PROCESS_ID:
- return credentials->pid != DBUS_PID_UNSET;
- case DBUS_CREDENTIAL_UNIX_USER_ID:
- return credentials->unix_uid != DBUS_UID_UNSET;
- case DBUS_CREDENTIAL_WINDOWS_SID:
- return credentials->windows_sid != NULL;
- case DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID:
- return credentials->adt_audit_data != NULL;
- }
-
- _dbus_assert_not_reached ("Unknown credential enum value");
- return FALSE;
-}
-
-/**
- * Gets the UNIX process ID in the credentials, or #DBUS_PID_UNSET if
- * the credentials object doesn't contain a process ID.
- *
- * @param credentials the object
- * @returns UNIX process ID
- */
-dbus_pid_t
-_dbus_credentials_get_pid (DBusCredentials *credentials)
-{
- return credentials->pid;
-}
-
-/**
- * Gets the UNIX user ID in the credentials, or #DBUS_UID_UNSET if
- * the credentials object doesn't contain a user ID.
- *
- * @param credentials the object
- * @returns UNIX user ID
- */
-dbus_uid_t
-_dbus_credentials_get_unix_uid (DBusCredentials *credentials)
-{
- return credentials->unix_uid;
-}
-
-/**
- * Gets the Windows user SID in the credentials, or #NULL if
- * the credentials object doesn't contain a Windows user SID.
- *
- * @param credentials the object
- * @returns Windows user SID
- */
-const char*
-_dbus_credentials_get_windows_sid (DBusCredentials *credentials)
-{
- return credentials->windows_sid;
-}
-
-/**
- * Gets the ADT audit data in the credentials, or #NULL if
- * the credentials object doesn't contain ADT audit data.
- *
- * @param credentials the object
- * @returns Solaris ADT audit data
- */
-void *
-_dbus_credentials_get_adt_audit_data (DBusCredentials *credentials)
-{
- return credentials->adt_audit_data;
-}
-
-/**
- * Gets the ADT audit data size in the credentials, or 0 if
- * the credentials object doesn't contain ADT audit data.
- *
- * @param credentials the object
- * @returns Solaris ADT audit data size
- */
-dbus_int32_t
-_dbus_credentials_get_adt_audit_data_size (DBusCredentials *credentials)
-{
- return credentials->adt_audit_data_size;
-}
-
-/**
- * Checks whether the first credentials object contains
- * all the credentials found in the second credentials object.
- *
- * @param credentials the object
- * @param possible_subset see if credentials in here are also in the first arg
- * @returns #TRUE if second arg is contained in first
- */
-dbus_bool_t
-_dbus_credentials_are_superset (DBusCredentials *credentials,
- DBusCredentials *possible_subset)
-{
- return
- (possible_subset->pid == DBUS_PID_UNSET ||
- possible_subset->pid == credentials->pid) &&
- (possible_subset->unix_uid == DBUS_UID_UNSET ||
- possible_subset->unix_uid == credentials->unix_uid) &&
- (possible_subset->windows_sid == NULL ||
- (credentials->windows_sid && strcmp (possible_subset->windows_sid,
- credentials->windows_sid) == 0)) &&
- (possible_subset->adt_audit_data == NULL ||
- (credentials->adt_audit_data && memcmp (possible_subset->adt_audit_data,
- credentials->adt_audit_data,
- credentials->adt_audit_data_size) == 0));
-}
-
-/**
- * Checks whether a credentials object contains anything.
- *
- * @param credentials the object
- * @returns #TRUE if there are no credentials in the object
- */
-dbus_bool_t
-_dbus_credentials_are_empty (DBusCredentials *credentials)
-{
- return
- credentials->pid == DBUS_PID_UNSET &&
- credentials->unix_uid == DBUS_UID_UNSET &&
- credentials->windows_sid == NULL &&
- credentials->adt_audit_data == NULL;
-}
-
-/**
- * Checks whether a credentials object contains a user identity.
- *
- * @param credentials the object
- * @returns #TRUE if there are no user identities in the object
- */
-dbus_bool_t
-_dbus_credentials_are_anonymous (DBusCredentials *credentials)
-{
- return
- credentials->unix_uid == DBUS_UID_UNSET &&
- credentials->windows_sid == NULL;
-}
-
-/**
- * Merge all credentials found in the second object into the first object,
- * overwriting the first object if there are any overlaps.
- *
- * @param credentials the object
- * @param other_credentials credentials to merge
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_credentials (DBusCredentials *credentials,
- DBusCredentials *other_credentials)
-{
- return
- _dbus_credentials_add_credential (credentials,
- DBUS_CREDENTIAL_UNIX_PROCESS_ID,
- other_credentials) &&
- _dbus_credentials_add_credential (credentials,
- DBUS_CREDENTIAL_UNIX_USER_ID,
- other_credentials) &&
- _dbus_credentials_add_credential (credentials,
- DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID,
- other_credentials) &&
- _dbus_credentials_add_credential (credentials,
- DBUS_CREDENTIAL_WINDOWS_SID,
- other_credentials);
-}
-
-/**
- * Merge the given credential found in the second object into the first object,
- * overwriting the first object's value for that credential.
- *
- * Does nothing if the second object does not contain the specified credential.
- * i.e., will never delete a credential from the first object.
- *
- * @param credentials the object
- * @param which the credential to overwrite
- * @param other_credentials credentials to merge
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_add_credential (DBusCredentials *credentials,
- DBusCredentialType which,
- DBusCredentials *other_credentials)
-{
- if (which == DBUS_CREDENTIAL_UNIX_PROCESS_ID &&
- other_credentials->pid != DBUS_PID_UNSET)
- {
- if (!_dbus_credentials_add_pid (credentials, other_credentials->pid))
- return FALSE;
- }
- else if (which == DBUS_CREDENTIAL_UNIX_USER_ID &&
- other_credentials->unix_uid != DBUS_UID_UNSET)
- {
- if (!_dbus_credentials_add_unix_uid (credentials, other_credentials->unix_uid))
- return FALSE;
- }
- else if (which == DBUS_CREDENTIAL_WINDOWS_SID &&
- other_credentials->windows_sid != NULL)
- {
- if (!_dbus_credentials_add_windows_sid (credentials, other_credentials->windows_sid))
- return FALSE;
- }
- else if (which == DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID &&
- other_credentials->adt_audit_data != NULL)
- {
- if (!_dbus_credentials_add_adt_audit_data (credentials, other_credentials->adt_audit_data, other_credentials->adt_audit_data_size))
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Clear all credentials in the object.
- *
- * @param credentials the object
- */
-void
-_dbus_credentials_clear (DBusCredentials *credentials)
-{
- credentials->pid = DBUS_PID_UNSET;
- credentials->unix_uid = DBUS_UID_UNSET;
- dbus_free (credentials->windows_sid);
- credentials->windows_sid = NULL;
- dbus_free (credentials->adt_audit_data);
- credentials->adt_audit_data = NULL;
- credentials->adt_audit_data_size = 0;
-}
-
-/**
- * Copy a credentials object.
- *
- * @param credentials the object
- * @returns the copy or #NULL
- */
-DBusCredentials*
-_dbus_credentials_copy (DBusCredentials *credentials)
-{
- DBusCredentials *copy;
-
- copy = _dbus_credentials_new ();
- if (copy == NULL)
- return NULL;
-
- if (!_dbus_credentials_add_credentials (copy, credentials))
- {
- _dbus_credentials_unref (copy);
- return NULL;
- }
-
- return copy;
-}
-
-/**
- * Check whether the user-identifying credentials in two credentials
- * objects are identical. Credentials that are not related to the
- * user are ignored, but any kind of user ID credentials must be the
- * same (UNIX user ID, Windows user SID, etc.) and present in both
- * objects for the function to return #TRUE.
- *
- * @param credentials the object
- * @param other_credentials credentials to compare
- * @returns #TRUE if the two credentials refer to the same user
- */
-dbus_bool_t
-_dbus_credentials_same_user (DBusCredentials *credentials,
- DBusCredentials *other_credentials)
-{
- /* both windows and unix user must be the same (though pretty much
- * in all conceivable cases, one will be unset)
- */
- return credentials->unix_uid == other_credentials->unix_uid &&
- ((!(credentials->windows_sid || other_credentials->windows_sid)) ||
- (credentials->windows_sid && other_credentials->windows_sid &&
- strcmp (credentials->windows_sid, other_credentials->windows_sid) == 0));
-}
-
-/**
- * Convert the credentials in this object to a human-readable
- * string format, and append to the given string.
- *
- * @param credentials the object
- * @param string append to this string
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_credentials_to_string_append (DBusCredentials *credentials,
- DBusString *string)
-{
- dbus_bool_t join;
-
- join = FALSE;
- if (credentials->unix_uid != DBUS_UID_UNSET)
- {
- if (!_dbus_string_append_printf (string, "uid=" DBUS_UID_FORMAT, credentials->unix_uid))
- goto oom;
- join = TRUE;
- }
- if (credentials->pid != DBUS_PID_UNSET)
- {
- if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->pid))
- goto oom;
- join = TRUE;
- }
- else
- join = FALSE;
- if (credentials->windows_sid != NULL)
- {
- if (!_dbus_string_append_printf (string, "%ssid=%s", join ? " " : "", credentials->windows_sid))
- goto oom;
- join = TRUE;
- }
- else
- join = FALSE;
-
- return TRUE;
-oom:
- return FALSE;
-}
-
-/** @} */
-
-/* tests in dbus-credentials-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.h
deleted file mode 100644
index abcc4bb325..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-credentials.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-credentials.h Credentials provable through authentication
- *
- * Copyright (C) 2007 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_CREDENTIALS_H
-#define DBUS_CREDENTIALS_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-
-DBUS_BEGIN_DECLS
-
-typedef enum {
- DBUS_CREDENTIAL_UNIX_PROCESS_ID,
- DBUS_CREDENTIAL_UNIX_USER_ID,
- DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID,
- DBUS_CREDENTIAL_WINDOWS_SID
-} DBusCredentialType;
-
-DBusCredentials* _dbus_credentials_new_from_current_process (void);
-DBusCredentials* _dbus_credentials_new (void);
-void _dbus_credentials_ref (DBusCredentials *credentials);
-void _dbus_credentials_unref (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_add_pid (DBusCredentials *credentials,
- dbus_pid_t pid);
-dbus_bool_t _dbus_credentials_add_unix_uid (DBusCredentials *credentials,
- dbus_uid_t uid);
-dbus_bool_t _dbus_credentials_add_windows_sid (DBusCredentials *credentials,
- const char *windows_sid);
-dbus_bool_t _dbus_credentials_add_adt_audit_data (DBusCredentials *credentials,
- void *audit_data,
- dbus_int32_t size);
-dbus_bool_t _dbus_credentials_include (DBusCredentials *credentials,
- DBusCredentialType type);
-dbus_pid_t _dbus_credentials_get_pid (DBusCredentials *credentials);
-dbus_uid_t _dbus_credentials_get_unix_uid (DBusCredentials *credentials);
-const char* _dbus_credentials_get_windows_sid (DBusCredentials *credentials);
-void * _dbus_credentials_get_adt_audit_data (DBusCredentials *credentials);
-dbus_int32_t _dbus_credentials_get_adt_audit_data_size (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_are_superset (DBusCredentials *credentials,
- DBusCredentials *possible_subset);
-dbus_bool_t _dbus_credentials_are_empty (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_are_anonymous (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_add_credentials (DBusCredentials *credentials,
- DBusCredentials *other_credentials);
-/* must silently allow 'which' to not exist */
-dbus_bool_t _dbus_credentials_add_credential (DBusCredentials *credentials,
- DBusCredentialType which,
- DBusCredentials *other_credentials);
-void _dbus_credentials_clear (DBusCredentials *credentials);
-DBusCredentials* _dbus_credentials_copy (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_same_user (DBusCredentials *credentials,
- DBusCredentials *other_credentials);
-dbus_bool_t _dbus_credentials_to_string_append (DBusCredentials *credentials,
- DBusString *string);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_CREDENTIALS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.c
deleted file mode 100644
index e37c9dd5f7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-dataslot.c storing data on objects
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-dataslot.h"
-#include "dbus-threads-internal.h"
-
-/**
- * @defgroup DBusDataSlot Data slots
- * @ingroup DBusInternals
- * @brief Storing data by ID
- *
- * Types and functions related to storing data by an
- * allocated ID. This is used for dbus_connection_set_data(),
- * dbus_server_set_data(), etc.
- * @{
- */
-
-/**
- * Initializes a data slot allocator object, used to assign
- * integer IDs for data slots.
- *
- * @param allocator the allocator to initialize
- */
-dbus_bool_t
-_dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator,
- DBusGlobalLock lock)
-{
- allocator->allocated_slots = NULL;
- allocator->n_allocated_slots = 0;
- allocator->n_used_slots = 0;
- allocator->lock = lock;
-
- return TRUE;
-}
-
-/**
- * Allocates an integer ID to be used for storing data
- * in a #DBusDataSlotList. If the value at *slot_id_p is
- * not -1, this function just increments the refcount for
- * the existing slot ID. If the value is -1, a new slot ID
- * is allocated and stored at *slot_id_p.
- *
- * @param allocator the allocator
- * @param slot_id_p address to fill with the slot ID
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
- dbus_int32_t *slot_id_p)
-{
- dbus_int32_t slot;
-
- if (!_dbus_lock (allocator->lock))
- return FALSE;
-
- if (*slot_id_p >= 0)
- {
- slot = *slot_id_p;
-
- _dbus_assert (slot < allocator->n_allocated_slots);
- _dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
-
- allocator->allocated_slots[slot].refcount += 1;
-
- goto out;
- }
-
- _dbus_assert (*slot_id_p < 0);
-
- if (allocator->n_used_slots < allocator->n_allocated_slots)
- {
- slot = 0;
- while (slot < allocator->n_allocated_slots)
- {
- if (allocator->allocated_slots[slot].slot_id < 0)
- {
- allocator->allocated_slots[slot].slot_id = slot;
- allocator->allocated_slots[slot].refcount = 1;
- allocator->n_used_slots += 1;
- break;
- }
- ++slot;
- }
-
- _dbus_assert (slot < allocator->n_allocated_slots);
- }
- else
- {
- DBusAllocatedSlot *tmp;
-
- slot = -1;
- tmp = dbus_realloc (allocator->allocated_slots,
- sizeof (DBusAllocatedSlot) * (allocator->n_allocated_slots + 1));
- if (tmp == NULL)
- goto out;
-
- allocator->allocated_slots = tmp;
- slot = allocator->n_allocated_slots;
- allocator->n_allocated_slots += 1;
- allocator->n_used_slots += 1;
- allocator->allocated_slots[slot].slot_id = slot;
- allocator->allocated_slots[slot].refcount = 1;
- }
-
- _dbus_assert (slot >= 0);
- _dbus_assert (slot < allocator->n_allocated_slots);
- _dbus_assert (*slot_id_p < 0);
- _dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
- _dbus_assert (allocator->allocated_slots[slot].refcount == 1);
-
- *slot_id_p = slot;
-
- _dbus_verbose ("Allocated slot %d on allocator %p total %d slots allocated %d used\n",
- slot, allocator, allocator->n_allocated_slots, allocator->n_used_slots);
-
- out:
- _dbus_unlock (allocator->lock);
- return slot >= 0;
-}
-
-/**
- * Deallocates an ID previously allocated with
- * _dbus_data_slot_allocator_alloc(). Existing data stored on
- * existing #DBusDataSlotList objects with this ID will be freed when the
- * data list is finalized, but may not be retrieved (and may only be
- * replaced if someone else reallocates the slot).
- * The slot value is reset to -1 if this is the last unref.
- *
- * @param allocator the allocator
- * @param slot_id_p address where we store the slot
- */
-void
-_dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
- dbus_int32_t *slot_id_p)
-{
- if (!_dbus_lock (allocator->lock))
- _dbus_assert_not_reached ("we should have initialized global locks "
- "before we allocated this slot");
-
- _dbus_assert (*slot_id_p < allocator->n_allocated_slots);
- _dbus_assert (allocator->allocated_slots[*slot_id_p].slot_id == *slot_id_p);
- _dbus_assert (allocator->allocated_slots[*slot_id_p].refcount > 0);
-
- allocator->allocated_slots[*slot_id_p].refcount -= 1;
-
- if (allocator->allocated_slots[*slot_id_p].refcount > 0)
- {
- _dbus_unlock (allocator->lock);
- return;
- }
-
- /* refcount is 0, free the slot */
- _dbus_verbose ("Freeing slot %d on allocator %p total %d allocated %d used\n",
- *slot_id_p, allocator, allocator->n_allocated_slots, allocator->n_used_slots);
-
- allocator->allocated_slots[*slot_id_p].slot_id = -1;
- *slot_id_p = -1;
-
- allocator->n_used_slots -= 1;
-
- if (allocator->n_used_slots == 0)
- {
- dbus_free (allocator->allocated_slots);
- allocator->allocated_slots = NULL;
- allocator->n_allocated_slots = 0;
- }
-
- _dbus_unlock (allocator->lock);
-}
-
-/**
- * Initializes a slot list.
- * @param list the list to initialize.
- */
-void
-_dbus_data_slot_list_init (DBusDataSlotList *list)
-{
- list->slots = NULL;
- list->n_slots = 0;
-}
-
-/**
- * Stores a pointer in the data slot list, along with an optional
- * function to be used for freeing the data when the data is set
- * again, or when the slot list is finalized. The slot number must
- * have been allocated with _dbus_data_slot_allocator_alloc() for the
- * same allocator passed in here. The same allocator has to be used
- * with the slot list every time.
- *
- * @param allocator the allocator to use
- * @param list the data slot list
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @param old_free_func free function for any previously-existing data
- * @param old_data previously-existing data, should be freed with old_free_func
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-_dbus_data_slot_list_set (DBusDataSlotAllocator *allocator,
- DBusDataSlotList *list,
- int slot,
- void *data,
- DBusFreeFunction free_data_func,
- DBusFreeFunction *old_free_func,
- void **old_data)
-{
-#ifndef DBUS_DISABLE_ASSERT
- /* We need to take the allocator lock here, because the allocator could
- * be e.g. realloc()ing allocated_slots. We avoid doing this if asserts
- * are disabled, since then the asserts are empty.
- */
- if (!_dbus_lock (allocator->lock))
- _dbus_assert_not_reached ("we should have initialized global locks "
- "before we allocated this slot");
-
- _dbus_assert (slot < allocator->n_allocated_slots);
- _dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
- _dbus_unlock (allocator->lock);
-#endif
-
- if (slot >= list->n_slots)
- {
- DBusDataSlot *tmp;
- int i;
-
- tmp = dbus_realloc (list->slots,
- sizeof (DBusDataSlot) * (slot + 1));
- if (tmp == NULL)
- return FALSE;
-
- list->slots = tmp;
- i = list->n_slots;
- list->n_slots = slot + 1;
- while (i < list->n_slots)
- {
- list->slots[i].data = NULL;
- list->slots[i].free_data_func = NULL;
- ++i;
- }
- }
-
- _dbus_assert (slot < list->n_slots);
-
- *old_data = list->slots[slot].data;
- *old_free_func = list->slots[slot].free_data_func;
-
- list->slots[slot].data = data;
- list->slots[slot].free_data_func = free_data_func;
-
- return TRUE;
-}
-
-/**
- * Retrieves data previously set with _dbus_data_slot_list_set_data().
- * The slot must still be allocated (must not have been freed).
- *
- * @param allocator the allocator slot was allocated from
- * @param list the data slot list
- * @param slot the slot to get data from
- * @returns the data, or #NULL if not found
- */
-void*
-_dbus_data_slot_list_get (DBusDataSlotAllocator *allocator,
- DBusDataSlotList *list,
- int slot)
-{
-#ifndef DBUS_DISABLE_ASSERT
- /* We need to take the allocator lock here, because the allocator could
- * be e.g. realloc()ing allocated_slots. We avoid doing this if asserts
- * are disabled, since then the asserts are empty.
- */
- if (!_dbus_lock (allocator->lock))
- _dbus_assert_not_reached ("we should have initialized global locks "
- "before we allocated this slot");
-
- _dbus_assert (slot >= 0);
- _dbus_assert (slot < allocator->n_allocated_slots);
- _dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
- _dbus_unlock (allocator->lock);
-#endif
-
- if (slot >= list->n_slots)
- return NULL;
- else
- return list->slots[slot].data;
-}
-
-/**
- * Frees all data slots contained in the list, calling
- * application-provided free functions if they exist.
- *
- * @param list the list to clear
- */
-void
-_dbus_data_slot_list_clear (DBusDataSlotList *list)
-{
- int i;
-
- i = 0;
- while (i < list->n_slots)
- {
- if (list->slots[i].free_data_func)
- (* list->slots[i].free_data_func) (list->slots[i].data);
- list->slots[i].data = NULL;
- list->slots[i].free_data_func = NULL;
- ++i;
- }
-}
-
-/**
- * Frees the data slot list and all data slots contained
- * in it, calling application-provided free functions
- * if they exist.
- *
- * @param list the list to free
- */
-void
-_dbus_data_slot_list_free (DBusDataSlotList *list)
-{
- _dbus_data_slot_list_clear (list);
-
- dbus_free (list->slots);
- list->slots = NULL;
- list->n_slots = 0;
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-static int free_counter;
-
-static void
-test_free_slot_data_func (void *data)
-{
- int i = _DBUS_POINTER_TO_INT (data);
-
- _dbus_assert (free_counter == i);
- ++free_counter;
-}
-
-/**
- * Test function for data slots
- */
-dbus_bool_t
-_dbus_data_slot_test (void)
-{
- DBusDataSlotAllocator allocator;
- DBusDataSlotList list;
- int i;
- DBusFreeFunction old_free_func;
- void *old_data;
-
- if (!_dbus_data_slot_allocator_init (&allocator, _DBUS_LOCK_server_slots))
- _dbus_assert_not_reached ("no memory for allocator");
-
- _dbus_data_slot_list_init (&list);
-
-#define N_SLOTS 100
-
- i = 0;
- while (i < N_SLOTS)
- {
- /* we don't really want apps to rely on this ordered
- * allocation, but it simplifies things to rely on it
- * here.
- */
- dbus_int32_t tmp = -1;
-
- _dbus_data_slot_allocator_alloc (&allocator, &tmp);
-
- if (tmp != i)
- _dbus_assert_not_reached ("did not allocate slots in numeric order\n");
-
- ++i;
- }
-
- i = 0;
- while (i < N_SLOTS)
- {
- if (!_dbus_data_slot_list_set (&allocator, &list,
- i,
- _DBUS_INT_TO_POINTER (i),
- test_free_slot_data_func,
- &old_free_func, &old_data))
- _dbus_assert_not_reached ("no memory to set data");
-
- _dbus_assert (old_free_func == NULL);
- _dbus_assert (old_data == NULL);
-
- _dbus_assert (_dbus_data_slot_list_get (&allocator, &list, i) ==
- _DBUS_INT_TO_POINTER (i));
-
- ++i;
- }
-
- free_counter = 0;
- i = 0;
- while (i < N_SLOTS)
- {
- if (!_dbus_data_slot_list_set (&allocator, &list,
- i,
- _DBUS_INT_TO_POINTER (i),
- test_free_slot_data_func,
- &old_free_func, &old_data))
- _dbus_assert_not_reached ("no memory to set data");
-
- _dbus_assert (old_free_func == test_free_slot_data_func);
- _dbus_assert (_DBUS_POINTER_TO_INT (old_data) == i);
-
- (* old_free_func) (old_data);
- _dbus_assert (i == (free_counter - 1));
-
- _dbus_assert (_dbus_data_slot_list_get (&allocator, &list, i) ==
- _DBUS_INT_TO_POINTER (i));
-
- ++i;
- }
-
- free_counter = 0;
- _dbus_data_slot_list_free (&list);
-
- _dbus_assert (N_SLOTS == free_counter);
-
- i = 0;
- while (i < N_SLOTS)
- {
- dbus_int32_t tmp = i;
-
- _dbus_data_slot_allocator_free (&allocator, &tmp);
- _dbus_assert (tmp == -1);
- ++i;
- }
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.h
deleted file mode 100644
index 1e04fcbc1e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-dataslot.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-dataslot.h storing data on objects
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_DATASLOT_H
-#define DBUS_DATASLOT_H
-
-#include <dbus/dbus-internals.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusDataSlotAllocator DBusDataSlotAllocator;
-typedef struct DBusDataSlotList DBusDataSlotList;
-
-/** Opaque typedef for DBusDataSlot */
-typedef struct DBusDataSlot DBusDataSlot;
-/** DBusDataSlot is used to store application data on the connection */
-struct DBusDataSlot
-{
- void *data; /**< The application data */
- DBusFreeFunction free_data_func; /**< Free the application data */
-};
-
-typedef struct DBusAllocatedSlot DBusAllocatedSlot;
-
-/** An allocated slot for storing data
- */
-struct DBusAllocatedSlot
-{
- dbus_int32_t slot_id; /**< ID of this slot */
- int refcount; /**< Number of uses of the slot */
-};
-
-/**
- * An allocator that tracks a set of slot IDs.
- */
-struct DBusDataSlotAllocator
-{
- DBusAllocatedSlot *allocated_slots; /**< Allocated slots */
- int n_allocated_slots; /**< number of slots malloc'd */
- int n_used_slots; /**< number of slots used */
- DBusGlobalLock lock; /**< index of thread lock */
-};
-
-#define _DBUS_DATA_SLOT_ALLOCATOR_INIT(x) { NULL, 0, 0, x }
-
-/**
- * Data structure that stores the actual user data set at a given
- * slot.
- */
-struct DBusDataSlotList
-{
- DBusDataSlot *slots; /**< Data slots */
- int n_slots; /**< Slots we have storage for in data_slots */
-};
-
-dbus_bool_t _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator,
- DBusGlobalLock lock);
-dbus_bool_t _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
- int *slot_id_p);
-void _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
- int *slot_id_p);
-void _dbus_data_slot_list_init (DBusDataSlotList *list);
-dbus_bool_t _dbus_data_slot_list_set (DBusDataSlotAllocator *allocator,
- DBusDataSlotList *list,
- int slot,
- void *data,
- DBusFreeFunction free_data_func,
- DBusFreeFunction *old_free_func,
- void **old_data);
-void* _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator,
- DBusDataSlotList *list,
- int slot);
-void _dbus_data_slot_list_clear (DBusDataSlotList *list);
-void _dbus_data_slot_list_free (DBusDataSlotList *list);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_DATASLOT_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.c
deleted file mode 100644
index a0571a50e0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-errors.c Error reporting
- *
- * Copyright (C) 2002, 2004 Red Hat Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-errors.h"
-#include "dbus-internals.h"
-#include "dbus-string.h"
-#include "dbus-protocol.h"
-#include <stdarg.h>
-#include <string.h>
-
-/**
- * @defgroup DBusErrorInternals Error reporting internals
- * @ingroup DBusInternals
- * @brief Error reporting internals
- * @{
- */
-
-/**
- * @def DBUS_ERROR_INIT
- *
- * Expands to a suitable initializer for a DBusError on the stack.
- * Declaring a DBusError with:
- *
- * @code
- * DBusError error = DBUS_ERROR_INIT;
- *
- * do_things_with (&error);
- * @endcode
- *
- * is a more concise form of:
- *
- * @code
- * DBusError error;
- *
- * dbus_error_init (&error);
- * do_things_with (&error);
- * @endcode
- */
-
-/**
- * Internals of DBusError
- */
-typedef struct
-{
- char *name; /**< error name */
- char *message; /**< error message */
-
- unsigned int const_message : 1; /**< Message is not owned by DBusError */
-
- unsigned int dummy2 : 1; /**< placeholder */
- unsigned int dummy3 : 1; /**< placeholder */
- unsigned int dummy4 : 1; /**< placeholder */
- unsigned int dummy5 : 1; /**< placeholder */
-
- void *padding1; /**< placeholder */
-
-} DBusRealError;
-
-_DBUS_STATIC_ASSERT (sizeof (DBusRealError) == sizeof (DBusError));
-
-/**
- * Returns a longer message describing an error name.
- * If the error name is unknown, returns the name
- * itself.
- *
- * @param error the error to describe
- * @returns a constant string describing the error.
- */
-static const char*
-message_from_error (const char *error)
-{
- if (strcmp (error, DBUS_ERROR_FAILED) == 0)
- return "Unknown error";
- else if (strcmp (error, DBUS_ERROR_NO_MEMORY) == 0)
- return "Not enough memory available";
- else if (strcmp (error, DBUS_ERROR_IO_ERROR) == 0)
- return "Error reading or writing data";
- else if (strcmp (error, DBUS_ERROR_BAD_ADDRESS) == 0)
- return "Could not parse address";
- else if (strcmp (error, DBUS_ERROR_NOT_SUPPORTED) == 0)
- return "Feature not supported";
- else if (strcmp (error, DBUS_ERROR_LIMITS_EXCEEDED) == 0)
- return "Resource limits exceeded";
- else if (strcmp (error, DBUS_ERROR_ACCESS_DENIED) == 0)
- return "Permission denied";
- else if (strcmp (error, DBUS_ERROR_AUTH_FAILED) == 0)
- return "Could not authenticate to server";
- else if (strcmp (error, DBUS_ERROR_NO_SERVER) == 0)
- return "No server available at address";
- else if (strcmp (error, DBUS_ERROR_TIMEOUT) == 0)
- return "Connection timed out";
- else if (strcmp (error, DBUS_ERROR_NO_NETWORK) == 0)
- return "Network unavailable";
- else if (strcmp (error, DBUS_ERROR_ADDRESS_IN_USE) == 0)
- return "Address already in use";
- else if (strcmp (error, DBUS_ERROR_DISCONNECTED) == 0)
- return "Disconnected.";
- else if (strcmp (error, DBUS_ERROR_INVALID_ARGS) == 0)
- return "Invalid arguments.";
- else if (strcmp (error, DBUS_ERROR_NO_REPLY) == 0)
- return "Did not get a reply message.";
- else if (strcmp (error, DBUS_ERROR_FILE_NOT_FOUND) == 0)
- return "File doesn't exist.";
- else if (strcmp (error, DBUS_ERROR_OBJECT_PATH_IN_USE) == 0)
- return "Object path already in use";
- else
- return error;
-}
-
-/** @} */ /* End of internals */
-
-/**
- * @defgroup DBusErrors Error reporting
- * @ingroup DBus
- * @brief Error reporting
- *
- * Types and functions related to reporting errors.
- *
- *
- * In essence D-Bus error reporting works as follows:
- *
- * @code
- * DBusError error;
- * dbus_error_init (&error);
- * dbus_some_function (arg1, arg2, &error);
- * if (dbus_error_is_set (&error))
- * {
- * fprintf (stderr, "an error occurred: %s\n", error.message);
- * dbus_error_free (&error);
- * }
- * @endcode
- *
- * By convention, all functions allow #NULL instead of a DBusError*,
- * so callers who don't care about the error can ignore it.
- *
- * There are some rules. An error passed to a D-Bus function must
- * always be unset; you can't pass in an error that's already set. If
- * a function has a return code indicating whether an error occurred,
- * and also a #DBusError parameter, then the error will always be set
- * if and only if the return code indicates an error occurred. i.e.
- * the return code and the error are never going to disagree.
- *
- * An error only needs to be freed if it's been set, not if
- * it's merely been initialized.
- *
- * You can check the specific error that occurred using
- * dbus_error_has_name().
- *
- * Errors will not be set for programming errors, such as passing
- * invalid arguments to the libdbus API. Instead, libdbus will print
- * warnings, exit on a failed assertion, or even crash in those cases
- * (in other words, incorrect use of the API results in undefined
- * behavior, possibly accompanied by helpful debugging output if
- * you're lucky).
- *
- * @{
- */
-
-/**
- * Initializes a DBusError structure. Does not allocate any memory;
- * the error only needs to be freed if it is set at some point.
- *
- * @param error the DBusError.
- */
-void
-dbus_error_init (DBusError *error)
-{
- DBusRealError *real;
-
- _dbus_return_if_fail (error != NULL);
-
- _dbus_assert (sizeof (DBusError) == sizeof (DBusRealError));
-
- real = (DBusRealError *)error;
-
- real->name = NULL;
- real->message = NULL;
-
- real->const_message = TRUE;
-}
-
-/**
- * Frees an error that's been set (or just initialized),
- * then reinitializes the error as in dbus_error_init().
- *
- * @param error memory where the error is stored.
- */
-void
-dbus_error_free (DBusError *error)
-{
- DBusRealError *real;
-
- _dbus_return_if_fail (error != NULL);
-
- real = (DBusRealError *)error;
-
- if (!real->const_message)
- {
- dbus_free (real->name);
- dbus_free (real->message);
- }
-
- dbus_error_init (error);
-}
-
-/**
- * Assigns an error name and message to a DBusError. Does nothing if
- * error is #NULL. The message may be #NULL, which means a default
- * message will be deduced from the name. The default message will be
- * totally useless, though, so using a #NULL message is not recommended.
- *
- * Because this function does not copy the error name or message, you
- * must ensure the name and message are global data that won't be
- * freed. You probably want dbus_set_error() instead, in most cases.
- *
- * @param error the error or #NULL
- * @param name the error name (not copied!!!)
- * @param message the error message (not copied!!!)
- */
-void
-dbus_set_error_const (DBusError *error,
- const char *name,
- const char *message)
-{
- DBusRealError *real;
-
- _dbus_return_if_error_is_set (error);
- _dbus_return_if_fail (name != NULL);
-
- if (error == NULL)
- return;
-
- _dbus_assert (error->name == NULL);
- _dbus_assert (error->message == NULL);
-
- if (message == NULL)
- message = message_from_error (name);
-
- real = (DBusRealError *)error;
-
- real->name = (char*) name;
- real->message = (char *)message;
- real->const_message = TRUE;
-}
-
-/**
- * Moves an error src into dest, freeing src and
- * overwriting dest. Both src and dest must be initialized.
- * src is reinitialized to an empty error. dest may not
- * contain an existing error. If the destination is
- * #NULL, just frees and reinits the source error.
- *
- * @param src the source error
- * @param dest the destination error or #NULL
- */
-void
-dbus_move_error (DBusError *src,
- DBusError *dest)
-{
- _dbus_return_if_error_is_set (dest);
-
- if (dest)
- {
- dbus_error_free (dest);
- *dest = *src;
- dbus_error_init (src);
- }
- else
- dbus_error_free (src);
-}
-
-/**
- * Checks whether the error is set and has the given
- * name.
- * @param error the error
- * @param name the name
- * @returns #TRUE if the given named error occurred
- */
-dbus_bool_t
-dbus_error_has_name (const DBusError *error,
- const char *name)
-{
- _dbus_return_val_if_fail (error != NULL, FALSE);
- _dbus_return_val_if_fail (name != NULL, FALSE);
-
- _dbus_assert ((error->name != NULL && error->message != NULL) ||
- (error->name == NULL && error->message == NULL));
-
- if (error->name != NULL)
- {
- DBusString str1, str2;
- _dbus_string_init_const (&str1, error->name);
- _dbus_string_init_const (&str2, name);
- return _dbus_string_equal (&str1, &str2);
- }
- else
- return FALSE;
-}
-
-/**
- * Checks whether an error occurred (the error is set).
- *
- * @param error the error object
- * @returns #TRUE if an error occurred
- */
-dbus_bool_t
-dbus_error_is_set (const DBusError *error)
-{
- _dbus_return_val_if_fail (error != NULL, FALSE);
- _dbus_assert ((error->name != NULL && error->message != NULL) ||
- (error->name == NULL && error->message == NULL));
- return error->name != NULL;
-}
-
-/**
- * Assigns an error name and message to a DBusError.
- * Does nothing if error is #NULL.
- *
- * The format may be #NULL, which means a (pretty much useless)
- * default message will be deduced from the name. This is not a good
- * idea, just go ahead and provide a useful error message. It won't
- * hurt you.
- *
- * If no memory can be allocated for the error message,
- * an out-of-memory error message will be set instead.
- *
- * @param error the error.or #NULL
- * @param name the error name
- * @param format printf-style format string.
- */
-void
-dbus_set_error (DBusError *error,
- const char *name,
- const char *format,
- ...)
-{
- DBusRealError *real;
- DBusString str;
- va_list args;
-
- if (error == NULL)
- return;
-
- /* it's a bug to pile up errors */
- _dbus_return_if_error_is_set (error);
- _dbus_return_if_fail (name != NULL);
-
- _dbus_assert (error->name == NULL);
- _dbus_assert (error->message == NULL);
-
- if (!_dbus_string_init (&str))
- goto nomem;
-
- if (format == NULL)
- {
- if (!_dbus_string_append (&str,
- message_from_error (name)))
- {
- _dbus_string_free (&str);
- goto nomem;
- }
- }
- else
- {
- va_start (args, format);
- if (!_dbus_string_append_printf_valist (&str, format, args))
- {
- _dbus_string_free (&str);
- va_end (args);
- goto nomem;
- }
- va_end (args);
- }
-
- real = (DBusRealError *)error;
-
- if (!_dbus_string_steal_data (&str, &real->message))
- {
- _dbus_string_free (&str);
- goto nomem;
- }
- _dbus_string_free (&str);
-
- real->name = _dbus_strdup (name);
- if (real->name == NULL)
- {
- dbus_free (real->message);
- real->message = NULL;
- goto nomem;
- }
- real->const_message = FALSE;
-
- return;
-
- nomem:
- _DBUS_SET_OOM (error);
-}
-
-/** @} */ /* End public API */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.h
deleted file mode 100644
index e63139a011..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-errors.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-errors.h Error reporting
- *
- * Copyright (C) 2002 Red Hat Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_ERROR_H
-#define DBUS_ERROR_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-protocol.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusErrors
- * @{
- */
-
-/** Mostly-opaque type representing an error that occurred */
-typedef struct DBusError DBusError;
-
-/**
- * Object representing an exception.
- */
-struct DBusError
-{
- const char *name; /**< public error name field */
- const char *message; /**< public error message field */
-
- unsigned int dummy1 : 1; /**< placeholder */
- unsigned int dummy2 : 1; /**< placeholder */
- unsigned int dummy3 : 1; /**< placeholder */
- unsigned int dummy4 : 1; /**< placeholder */
- unsigned int dummy5 : 1; /**< placeholder */
-
- void *padding1; /**< placeholder */
-};
-
-#define DBUS_ERROR_INIT { NULL, NULL, TRUE, 0, 0, 0, 0, NULL }
-
-DBUS_EXPORT
-void dbus_error_init (DBusError *error);
-DBUS_EXPORT
-void dbus_error_free (DBusError *error);
-DBUS_EXPORT
-void dbus_set_error (DBusError *error,
- const char *name,
- const char *message,
- ...);
-DBUS_EXPORT
-void dbus_set_error_const (DBusError *error,
- const char *name,
- const char *message);
-DBUS_EXPORT
-void dbus_move_error (DBusError *src,
- DBusError *dest);
-DBUS_EXPORT
-dbus_bool_t dbus_error_has_name (const DBusError *error,
- const char *name);
-DBUS_EXPORT
-dbus_bool_t dbus_error_is_set (const DBusError *error);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_ERROR_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-file-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-file-unix.c
deleted file mode 100644
index 197593362b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-file-unix.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-file-unix.c unix related file implementation (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "dbus-protocol.h"
-#include "dbus-errors.h"
-#include "dbus-file.h"
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-unix.h"
-
-#include <sys/stat.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/**
- * Appends the contents of the given file to the string,
- * returning error code. At the moment, won't open a file
- * more than a megabyte in size.
- *
- * @param str the string to append to
- * @param filename filename to load
- * @param error place to set an error
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-_dbus_file_get_contents (DBusString *str,
- const DBusString *filename,
- DBusError *error)
-{
- int fd;
- struct stat sb;
- int orig_len;
- int total;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- /* O_BINARY useful on Cygwin */
- fd = open (filename_c, O_RDONLY | O_BINARY);
- if (fd < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to open \"%s\": %s",
- filename_c,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- _dbus_verbose ("file fd %d opened\n", fd);
-
- if (fstat (fd, &sb) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to stat \"%s\": %s",
- filename_c,
- _dbus_strerror (errno));
-
- _dbus_verbose ("fstat() failed: %s",
- _dbus_strerror (errno));
-
- _dbus_close (fd, NULL);
-
- return FALSE;
- }
-
- if (sb.st_size > _DBUS_ONE_MEGABYTE)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "File size %lu of \"%s\" is too large.",
- (unsigned long) sb.st_size, filename_c);
- _dbus_close (fd, NULL);
- return FALSE;
- }
-
- total = 0;
- orig_len = _dbus_string_get_length (str);
- if (sb.st_size > 0 && S_ISREG (sb.st_mode))
- {
- int bytes_read;
-
- while (total < (int) sb.st_size)
- {
- bytes_read = _dbus_read (fd, str,
- sb.st_size - total);
- if (bytes_read <= 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Error reading \"%s\": %s",
- filename_c,
- _dbus_strerror (errno));
-
- _dbus_verbose ("read() failed: %s",
- _dbus_strerror (errno));
-
- _dbus_close (fd, NULL);
- _dbus_string_set_length (str, orig_len);
- return FALSE;
- }
- else
- total += bytes_read;
- }
-
- _dbus_close (fd, NULL);
- return TRUE;
- }
- else if (sb.st_size != 0)
- {
- _dbus_verbose ("Can only open regular files at the moment.\n");
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "\"%s\" is not a regular file",
- filename_c);
- _dbus_close (fd, NULL);
- return FALSE;
- }
- else
- {
- _dbus_close (fd, NULL);
- return TRUE;
- }
-}
-
-/**
- * Writes a string out to a file. If the file exists,
- * it will be atomically overwritten by the new data.
- *
- * @param str the string to write out
- * @param filename the file to save string to
- * @param world_readable If set, ensure the file is world readable
- * @param error error to be filled in on failure
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_string_save_to_file (const DBusString *str,
- const DBusString *filename,
- dbus_bool_t world_readable,
- DBusError *error)
-{
- int fd;
- int bytes_to_write;
- const char *filename_c;
- DBusString tmp_filename;
- const char *tmp_filename_c;
- int total;
- dbus_bool_t need_unlink;
- dbus_bool_t retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- fd = -1;
- retval = FALSE;
- need_unlink = FALSE;
-
- if (!_dbus_string_init (&tmp_filename))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- if (!_dbus_string_copy (filename, 0, &tmp_filename, 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
- if (!_dbus_string_append (&tmp_filename, "."))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
-#define N_TMP_FILENAME_RANDOM_BYTES 8
- if (!_dbus_generate_random_ascii (&tmp_filename, N_TMP_FILENAME_RANDOM_BYTES))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
- filename_c = _dbus_string_get_const_data (filename);
- tmp_filename_c = _dbus_string_get_const_data (&tmp_filename);
-
- fd = open (tmp_filename_c, O_WRONLY | O_BINARY | O_EXCL | O_CREAT,
- world_readable ? 0644 : 0600);
- if (fd < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not create %s: %s", tmp_filename_c,
- _dbus_strerror (errno));
- goto out;
- }
- if (world_readable)
- {
- /* Ensure the file is world readable even in the presence of
- * possibly restrictive umasks;
- * see http://lists.freedesktop.org/archives/dbus/2010-September/013367.html
- */
- if (fchmod (fd, 0644) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not chmod %s: %s", tmp_filename_c,
- _dbus_strerror (errno));
- goto out;
- }
- }
-
- _dbus_verbose ("tmp file fd %d opened\n", fd);
-
- need_unlink = TRUE;
-
- total = 0;
- bytes_to_write = _dbus_string_get_length (str);
-
- while (total < bytes_to_write)
- {
- int bytes_written;
-
- bytes_written = _dbus_write (fd, str, total,
- bytes_to_write - total);
-
- if (bytes_written <= 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not write to %s: %s", tmp_filename_c,
- _dbus_strerror (errno));
-
- goto out;
- }
-
- total += bytes_written;
- }
-
- if (fsync(fd))
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not synchronize file %s: %s",
- tmp_filename_c, _dbus_strerror (errno));
-
- goto out;
- }
-
- if (!_dbus_close (fd, NULL))
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not close file %s: %s",
- tmp_filename_c, _dbus_strerror (errno));
-
- goto out;
- }
-
- fd = -1;
-
- if (rename (tmp_filename_c, filename_c) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not rename %s to %s: %s",
- tmp_filename_c, filename_c,
- _dbus_strerror (errno));
-
- goto out;
- }
-
- need_unlink = FALSE;
-
- retval = TRUE;
-
- out:
- /* close first, then unlink, to prevent ".nfs34234235" garbage
- * files
- */
-
- if (fd >= 0)
- _dbus_close (fd, NULL);
-
- if (need_unlink && unlink (tmp_filename_c) < 0)
- _dbus_verbose ("Failed to unlink temp file %s: %s\n",
- tmp_filename_c, _dbus_strerror (errno));
-
- _dbus_string_free (&tmp_filename);
-
- if (!retval)
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- return retval;
-}
-
-/** Makes the file readable by every user in the system.
- *
- * @param filename the filename
- * @param error error location
- * @returns #TRUE if the file's permissions could be changed.
- */
-dbus_bool_t
-_dbus_make_file_world_readable(const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
- if (chmod (filename_c, 0644) == -1)
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Could not change permissions of file %s: %s\n",
- filename_c,
- _dbus_strerror (errno));
- return FALSE;
- }
- return TRUE;
-}
-
-/** Creates the given file, failing if the file already exists.
- *
- * @param filename the filename
- * @param error error location
- * @returns #TRUE if we created the file and it didn't exist
- */
-dbus_bool_t
-_dbus_create_file_exclusively (const DBusString *filename,
- DBusError *error)
-{
- int fd;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- fd = open (filename_c, O_WRONLY | O_BINARY | O_EXCL | O_CREAT,
- 0600);
- if (fd < 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Could not create file %s: %s\n",
- filename_c,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- _dbus_verbose ("exclusive file fd %d opened\n", fd);
-
- if (!_dbus_close (fd, NULL))
- {
- dbus_set_error (error,
- DBUS_ERROR_FAILED,
- "Could not close file %s: %s\n",
- filename_c,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Deletes the given file.
- *
- * @param filename the filename
- * @param error error location
- *
- * @returns #TRUE if unlink() succeeded
- */
-dbus_bool_t
-_dbus_delete_file (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (unlink (filename_c) < 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to delete file %s: %s\n",
- filename_c, _dbus_strerror (errno));
- return FALSE;
- }
- else
- return TRUE;
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-file-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-file-win.c
deleted file mode 100644
index 06a8ea1ced..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-file-win.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-file-win.c windows related file implementation (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-internals.h"
-#include "dbus-sysdeps-win.h"
-#include "dbus-pipe.h"
-
-#include <windows.h>
-
-
-/**
- * Thin wrapper around the read() system call that appends
- * the data it reads to the DBusString buffer. It appends
- * up to the given count.
- *
- * @param hnd the HANDLE to read from
- * @param buffer the buffer to append data to
- * @param count the amount of data to read
- * @param error place to set an error
- * @returns the number of bytes read or -1
- */
-static int
-_dbus_file_read (HANDLE hnd,
- DBusString *buffer,
- int count,
- DBusError *error)
-{
- BOOL result;
- DWORD bytes_read;
- int start;
- char *data;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_assert (count >= 0);
-
- start = _dbus_string_get_length (buffer);
-
- if (!_dbus_string_lengthen (buffer, count))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return -1;
- }
-
- data = _dbus_string_get_data_len (buffer, start, count);
-
- result = ReadFile (hnd, data, count, &bytes_read, NULL);
- if (result == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to read from 0x%x: %s", hnd, emsg);
- _dbus_win_free_error_string (emsg);
- return -1;
- }
-
- if (bytes_read)
- {
- /* put length back (doesn't actually realloc) */
- _dbus_string_set_length (buffer, start + bytes_read);
-
-#if 0
- if (bytes_read > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_read);
-#endif
- }
-
- return bytes_read;
-}
-
-
-/**
- * Appends the contents of the given file to the string,
- * returning error code. At the moment, won't open a file
- * more than a megabyte in size.
- *
- * @param str the string to append to
- * @param filename filename to load
- * @param error place to set an error
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-_dbus_file_get_contents (DBusString *str,
- const DBusString *filename,
- DBusError *error)
-{
- HANDLE hnd;
- DWORD fsize;
- DWORD fsize_hi;
- int orig_len;
- unsigned int total;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- hnd = CreateFileA (filename_c, GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hnd == INVALID_HANDLE_VALUE)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to open \"%s\": %s", filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- return FALSE;
- }
-
- _dbus_verbose ("file %s hnd %p opened\n", filename_c, hnd);
-
- fsize = GetFileSize (hnd, &fsize_hi);
- if (fsize == 0xFFFFFFFF && GetLastError() != NO_ERROR)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to get file size for \"%s\": %s",
- filename_c, emsg);
- _dbus_win_free_error_string (emsg);
-
- _dbus_verbose ("GetFileSize() failed: %s", emsg);
-
- CloseHandle (hnd);
-
- return FALSE;
- }
-
- if (fsize_hi != 0 || fsize > _DBUS_ONE_MEGABYTE)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "File size %lu/%lu of \"%s\" is too large.",
- (unsigned long) fsize_hi,
- (unsigned long) fsize, filename_c);
- CloseHandle (hnd);
- return FALSE;
- }
-
- total = 0;
- orig_len = _dbus_string_get_length (str);
- if (fsize > 0)
- {
- int bytes_read;
-
- while (total < fsize)
- {
- bytes_read = _dbus_file_read (hnd, str, fsize - total, error);
- if (bytes_read <= 0)
- {
- if (bytes_read == 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Premature EOF reading \"%s\"",
- filename_c);
- }
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- CloseHandle (hnd);
- _dbus_string_set_length (str, orig_len);
- return FALSE;
- }
- else
- total += bytes_read;
- }
-
- CloseHandle (hnd);
- return TRUE;
- }
- else
- {
- CloseHandle (hnd);
- return TRUE;
- }
-}
-
-
-/**
- * Writes a string out to a file. If the file exists,
- * it will be atomically overwritten by the new data.
- *
- * @param str the string to write out
- * @param filename the file to save string to
- * @param world_readable if true, ensure file is world readable
- * @param error error to be filled in on failure
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_string_save_to_file (const DBusString *str,
- const DBusString *filename,
- dbus_bool_t world_readable,
- DBusError *error)
-{
- HANDLE hnd;
- int bytes_to_write;
- const char *filename_c;
- DBusString tmp_filename;
- const char *tmp_filename_c;
- int total;
- const char *str_c;
- dbus_bool_t need_unlink;
- dbus_bool_t retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- hnd = INVALID_HANDLE_VALUE;
- retval = FALSE;
- need_unlink = FALSE;
-
- if (!_dbus_string_init (&tmp_filename))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- if (!_dbus_string_copy (filename, 0, &tmp_filename, 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
- if (!_dbus_string_append (&tmp_filename, "."))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
-#define N_TMP_FILENAME_RANDOM_BYTES 8
- if (!_dbus_generate_random_ascii (&tmp_filename, N_TMP_FILENAME_RANDOM_BYTES))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&tmp_filename);
- return FALSE;
- }
-
- filename_c = _dbus_string_get_const_data (filename);
- tmp_filename_c = _dbus_string_get_const_data (&tmp_filename);
-
- /* TODO - support world-readable in an atomic fashion */
- hnd = CreateFileA (tmp_filename_c, GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
- INVALID_HANDLE_VALUE);
- if (hnd == INVALID_HANDLE_VALUE)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not create \"%s\": %s", filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- goto out;
- }
- if (world_readable)
- {
- if (! _dbus_make_file_world_readable (&tmp_filename, error))
- goto out;
- }
-
- _dbus_verbose ("tmp file %s hnd %p opened\n", tmp_filename_c, hnd);
-
- need_unlink = TRUE;
-
- total = 0;
- bytes_to_write = _dbus_string_get_length (str);
- str_c = _dbus_string_get_const_data (str);
-
- while (total < bytes_to_write)
- {
- DWORD bytes_written;
- BOOL res;
-
- res = WriteFile (hnd, str_c + total, bytes_to_write - total,
- &bytes_written, NULL);
-
- if (res == 0 || bytes_written <= 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not write to %s: %s", tmp_filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- goto out;
- }
-
- total += bytes_written;
- }
-
- if (CloseHandle (hnd) == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not close file %s: %s", tmp_filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- goto out;
- }
-
- hnd = INVALID_HANDLE_VALUE;
-
- /* Unlike rename(), MoveFileEx() can replace existing files */
- if (!MoveFileExA (tmp_filename_c, filename_c, MOVEFILE_REPLACE_EXISTING))
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not rename %s to %s: %s",
- tmp_filename_c, filename_c, emsg);
- _dbus_win_free_error_string (emsg);
-
- goto out;
- }
-
- need_unlink = FALSE;
-
- retval = TRUE;
-
- out:
- /* close first, then unlink */
-
- if (hnd != INVALID_HANDLE_VALUE)
- CloseHandle (hnd);
-
- if (need_unlink && DeleteFileA (tmp_filename_c) == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- _dbus_verbose ("Failed to unlink temp file %s: %s", tmp_filename_c,
- emsg);
- _dbus_win_free_error_string (emsg);
- }
-
- _dbus_string_free (&tmp_filename);
-
- if (!retval)
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- return retval;
-}
-
-
-/** Creates the given file, failing if the file already exists.
- *
- * @param filename the filename
- * @param error error location
- * @returns #TRUE if we created the file and it didn't exist
- */
-dbus_bool_t
-_dbus_create_file_exclusively (const DBusString *filename,
- DBusError *error)
-{
- HANDLE hnd;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- hnd = CreateFileA (filename_c, GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
- INVALID_HANDLE_VALUE);
- if (hnd == INVALID_HANDLE_VALUE)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not create file %s: %s",
- filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- return FALSE;
- }
-
- _dbus_verbose ("exclusive file %s hnd %p opened\n", filename_c, hnd);
-
- if (CloseHandle (hnd) == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not close file %s: %s",
- filename_c, emsg);
- _dbus_win_free_error_string (emsg);
-
- return FALSE;
- }
-
- return TRUE;
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-file.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-file.c
deleted file mode 100644
index 350fbd9a78..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-file.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-unix.c Wrappers around UNIX system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "dbus-file.h"
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-file.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-file.h
deleted file mode 100644
index 24837f4759..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-file.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-file.h dbus file related stuff (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_FILE_H
-#define DBUS_FILE_H
-
-//#include <dbus/dbus-types.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusFile
- * @{
- */
-
-/**
- * File interface
- */
-dbus_bool_t _dbus_file_exists (const char *file);
-dbus_bool_t _dbus_file_get_contents (DBusString *str,
- const DBusString *filename,
- DBusError *error);
-dbus_bool_t _dbus_string_save_to_file (const DBusString *str,
- const DBusString *filename,
- dbus_bool_t world_readable,
- DBusError *error);
-
-dbus_bool_t _dbus_make_file_world_readable (const DBusString *filename,
- DBusError *error);
-
-dbus_bool_t _dbus_create_file_exclusively (const DBusString *filename,
- DBusError *error);
-dbus_bool_t _dbus_delete_file (const DBusString *filename,
- DBusError *error);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.c
deleted file mode 100644
index c80835aaaf..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.c
+++ /dev/null
@@ -1,1831 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-hash.c Generic hash table utility (internal to D-Bus implementation)
- *
- * Copyright (C) 2002 Red Hat, Inc.
- * Copyright (c) 1991-1993 The Regents of the University of California.
- * Copyright (c) 1994 Sun Microsystems, Inc.
- *
- * Hash table implementation based on generic/tclHash.c from the Tcl
- * source code. The original Tcl license applies to portions of the
- * code from tclHash.c; the Tcl license follows this standad D-Bus
- * license information.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-/*
- * The following copyright applies to code from the Tcl distribution.
- *
- * Copyright (c) 1991-1993 The Regents of the University of California.
- * Copyright (c) 1994 Sun Microsystems, Inc.
- *
- * This software is copyrighted by the Regents of the University of
- * California, Sun Microsystems, Inc., Scriptics Corporation, and
- * other parties. The following terms apply to all files associated
- * with the software unless explicitly disclaimed in individual files.
- *
- * The authors hereby grant permission to use, copy, modify,
- * distribute, and license this software and its documentation for any
- * purpose, provided that existing copyright notices are retained in
- * all copies and that this notice is included verbatim in any
- * distributions. No written agreement, license, or royalty fee is
- * required for any of the authorized uses. Modifications to this
- * software may be copyrighted by their authors and need not follow
- * the licensing terms described here, provided that the new terms are
- * clearly indicated on the first page of each file where they apply.
- *
- * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY
- * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
- * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION,
- * OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
- * NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
- * AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- *
- * GOVERNMENT USE: If you are acquiring this software on behalf of the
- * U.S. government, the Government shall have only "Restricted Rights"
- * in the software and related documentation as defined in the Federal
- * Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
- * are acquiring the software on behalf of the Department of Defense,
- * the software shall be classified as "Commercial Computer Software"
- * and the Government shall have only "Restricted Rights" as defined
- * in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
- * foregoing, the authors grant the U.S. Government and others acting
- * in its behalf permission to use and distribute the software in
- * accordance with the terms specified in this license.
- */
-
-#include <config.h>
-#include "dbus-hash.h"
-#include "dbus-internals.h"
-#include "dbus-mempool.h"
-
-/**
- * @defgroup DBusHashTable Hash table
- * @ingroup DBusInternals
- * @brief DBusHashTable data structure
- *
- * Types and functions related to DBusHashTable.
- */
-
-/**
- * @defgroup DBusHashTableInternals Hash table implementation details
- * @ingroup DBusInternals
- * @brief DBusHashTable implementation details
- *
- * The guts of DBusHashTable.
- *
- * @{
- */
-
-/**
- * When there are this many entries per bucket, on average, rebuild
- * the hash table to make it larger.
- */
-#define REBUILD_MULTIPLIER 3
-
-/**
- * Takes a preliminary integer hash value and produces an index into a
- * hash tables bucket list. The idea is to make it so that
- * preliminary values that are arbitrarily similar will end up in
- * different buckets. The hash function was taken from a
- * random-number generator. (This is used to hash integers.)
- *
- * The down_shift drops off the high bits of the hash index, and
- * decreases as we increase the number of hash buckets (to keep more
- * range in the hash index). The mask also strips high bits and strips
- * fewer high bits as the number of hash buckets increases.
- * I don't understand two things: why is the initial downshift 28
- * to keep 4 bits when the initial mask is 011 to keep 2 bits,
- * and why do we have both a mask and a downshift?
- *
- */
-#define RANDOM_INDEX(table, i) \
- (((((intptr_t) (i))*1103515245) >> (table)->down_shift) & (table)->mask)
-
-/**
- * Initial number of buckets in hash table (hash table statically
- * allocates its buckets for this size and below).
- * The initial mask has to be synced to this.
- */
-#define DBUS_SMALL_HASH_TABLE 4
-
-/**
- * Typedef for DBusHashEntry
- */
-typedef struct DBusHashEntry DBusHashEntry;
-
-/**
- * @brief Internal representation of a hash entry.
- *
- * A single entry (key-value pair) in the hash table.
- * Internal to hash table implementation.
- */
-struct DBusHashEntry
-{
- DBusHashEntry *next; /**< Pointer to next entry in this
- * hash bucket, or #NULL for end of
- * chain.
- */
- void *key; /**< Hash key */
- void *value; /**< Hash value */
-};
-
-/**
- * Function used to find and optionally create a hash entry.
- */
-typedef DBusHashEntry* (* DBusFindEntryFunction) (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated);
-
-/**
- * @brief Internals of DBusHashTable.
- *
- * Hash table internals. Hash tables are opaque objects, they must be
- * used via accessor functions.
- */
-struct DBusHashTable {
- int refcount; /**< Reference count */
-
- DBusHashEntry **buckets; /**< Pointer to bucket array. Each
- * element points to first entry in
- * bucket's hash chain, or #NULL.
- */
- DBusHashEntry *static_buckets[DBUS_SMALL_HASH_TABLE];
- /**< Bucket array used for small tables
- * (to avoid mallocs and frees).
- */
- int n_buckets; /**< Total number of buckets allocated
- * at **buckets.
- */
- int n_entries; /**< Total number of entries present
- * in table.
- */
- int hi_rebuild_size; /**< Enlarge table when n_entries gets
- * to be this large.
- */
- int lo_rebuild_size; /**< Shrink table when n_entries gets
- * below this.
- */
- int down_shift; /**< Shift count used in hashing
- * function. Designed to use high-
- * order bits of randomized keys.
- */
- int mask; /**< Mask value used in hashing
- * function.
- */
- DBusHashType key_type; /**< Type of keys used in this table */
-
-
- DBusFindEntryFunction find_function; /**< Function for finding entries */
-
- DBusFreeFunction free_key_function; /**< Function to free keys */
- DBusFreeFunction free_value_function; /**< Function to free values */
-
- DBusMemPool *entry_pool; /**< Memory pool for hash entries */
-};
-
-/**
- * @brief Internals of DBusHashIter.
- */
-typedef struct
-{
- DBusHashTable *table; /**< Pointer to table containing entry. */
- DBusHashEntry **bucket; /**< Pointer to bucket that points to
- * first entry in this entry's chain:
- * used for deleting the entry.
- */
- DBusHashEntry *entry; /**< Current hash entry */
- DBusHashEntry *next_entry; /**< Next entry to be iterated onto in current bucket */
- int next_bucket; /**< index of next bucket */
- int n_entries_on_init; /**< used to detect table resize since initialization */
-} DBusRealHashIter;
-
-_DBUS_STATIC_ASSERT (sizeof (DBusRealHashIter) == sizeof (DBusHashIter));
-
-static DBusHashEntry* find_direct_function (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated);
-static DBusHashEntry* find_string_function (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated);
-static unsigned int string_hash (const char *str);
-static void rebuild_table (DBusHashTable *table);
-static DBusHashEntry* alloc_entry (DBusHashTable *table);
-static void remove_entry (DBusHashTable *table,
- DBusHashEntry **bucket,
- DBusHashEntry *entry);
-static void free_entry (DBusHashTable *table,
- DBusHashEntry *entry);
-static void free_entry_data (DBusHashTable *table,
- DBusHashEntry *entry);
-
-
-/** @} */
-
-/**
- * @addtogroup DBusHashTable
- * @{
- */
-
-/**
- * @typedef DBusHashIter
- *
- * Public opaque hash table iterator object.
- */
-
-/**
- * @typedef DBusHashTable
- *
- * Public opaque hash table object.
- */
-
-/**
- * @typedef DBusHashType
- *
- * Indicates the type of a key in the hash table.
- */
-
-/**
- * Constructs a new hash table. Should be freed with
- * _dbus_hash_table_unref(). If memory cannot be
- * allocated for the hash table, returns #NULL.
- *
- * @param type the type of hash key to use.
- * @param key_free_function function to free hash keys.
- * @param value_free_function function to free hash values.
- * @returns a new DBusHashTable or #NULL if no memory.
- */
-DBusHashTable*
-_dbus_hash_table_new (DBusHashType type,
- DBusFreeFunction key_free_function,
- DBusFreeFunction value_free_function)
-{
- DBusHashTable *table;
- DBusMemPool *entry_pool;
-
- table = dbus_new0 (DBusHashTable, 1);
- if (table == NULL)
- return NULL;
-
- entry_pool = _dbus_mem_pool_new (sizeof (DBusHashEntry), TRUE);
- if (entry_pool == NULL)
- {
- dbus_free (table);
- return NULL;
- }
-
- table->refcount = 1;
- table->entry_pool = entry_pool;
-
- _dbus_assert (DBUS_SMALL_HASH_TABLE == _DBUS_N_ELEMENTS (table->static_buckets));
-
- table->buckets = table->static_buckets;
- table->n_buckets = DBUS_SMALL_HASH_TABLE;
- table->n_entries = 0;
- table->hi_rebuild_size = DBUS_SMALL_HASH_TABLE * REBUILD_MULTIPLIER;
- table->lo_rebuild_size = 0;
- table->down_shift = 28;
- table->mask = 3;
- table->key_type = type;
-
- _dbus_assert (table->mask < table->n_buckets);
-
- switch (table->key_type)
- {
- case DBUS_HASH_INT:
- case DBUS_HASH_UINTPTR:
- table->find_function = find_direct_function;
- break;
- case DBUS_HASH_STRING:
- table->find_function = find_string_function;
- break;
- default:
- _dbus_assert_not_reached ("Unknown hash table type");
- break;
- }
-
- table->free_key_function = key_free_function;
- table->free_value_function = value_free_function;
-
- return table;
-}
-
-
-/**
- * Increments the reference count for a hash table.
- *
- * @param table the hash table to add a reference to.
- * @returns the hash table.
- */
-DBusHashTable *
-_dbus_hash_table_ref (DBusHashTable *table)
-{
- table->refcount += 1;
-
- return table;
-}
-
-/**
- * Decrements the reference count for a hash table,
- * freeing the hash table if the count reaches zero.
- *
- * @param table the hash table to remove a reference from.
- */
-void
-_dbus_hash_table_unref (DBusHashTable *table)
-{
- table->refcount -= 1;
-
- if (table->refcount == 0)
- {
-#if 0
- DBusHashEntry *entry;
- DBusHashEntry *next;
- int i;
-
- /* Free the entries in the table. */
- for (i = 0; i < table->n_buckets; i++)
- {
- entry = table->buckets[i];
- while (entry != NULL)
- {
- next = entry->next;
-
- free_entry (table, entry);
-
- entry = next;
- }
- }
-#else
- DBusHashEntry *entry;
- int i;
-
- /* Free the entries in the table. */
- for (i = 0; i < table->n_buckets; i++)
- {
- entry = table->buckets[i];
- while (entry != NULL)
- {
- free_entry_data (table, entry);
-
- entry = entry->next;
- }
- }
- /* We can do this very quickly with memory pools ;-) */
- _dbus_mem_pool_free (table->entry_pool);
-#endif
-
- /* Free the bucket array, if it was dynamically allocated. */
- if (table->buckets != table->static_buckets)
- dbus_free (table->buckets);
-
- dbus_free (table);
- }
-}
-
-/**
- * Removed all entries from a hash table.
- *
- * @param table the hash table to remove all entries from.
- */
-void
-_dbus_hash_table_remove_all (DBusHashTable *table)
-{
- DBusHashIter iter;
- _dbus_hash_iter_init (table, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- _dbus_hash_iter_remove_entry(&iter);
- }
-}
-
-static DBusHashEntry*
-alloc_entry (DBusHashTable *table)
-{
- DBusHashEntry *entry;
-
- entry = _dbus_mem_pool_alloc (table->entry_pool);
-
- return entry;
-}
-
-static void
-free_entry_data (DBusHashTable *table,
- DBusHashEntry *entry)
-{
- if (table->free_key_function)
- (* table->free_key_function) (entry->key);
- if (table->free_value_function)
- (* table->free_value_function) (entry->value);
-}
-
-static void
-free_entry (DBusHashTable *table,
- DBusHashEntry *entry)
-{
- free_entry_data (table, entry);
- _dbus_mem_pool_dealloc (table->entry_pool, entry);
-}
-
-static void
-remove_entry (DBusHashTable *table,
- DBusHashEntry **bucket,
- DBusHashEntry *entry)
-{
- _dbus_assert (table != NULL);
- _dbus_assert (bucket != NULL);
- _dbus_assert (*bucket != NULL);
- _dbus_assert (entry != NULL);
-
- if (*bucket == entry)
- *bucket = entry->next;
- else
- {
- DBusHashEntry *prev;
- prev = *bucket;
-
- while (prev->next != entry)
- prev = prev->next;
-
- _dbus_assert (prev != NULL);
-
- prev->next = entry->next;
- }
-
- table->n_entries -= 1;
- free_entry (table, entry);
-}
-
-/**
- * Initializes a hash table iterator. To iterate over all entries in a
- * hash table, use the following code (the printf assumes a hash
- * from strings to strings obviously):
- *
- * @code
- * DBusHashIter iter;
- *
- * _dbus_hash_iter_init (table, &iter);
- * while (_dbus_hash_iter_next (&iter))
- * {
- * printf ("The first key is %s and value is %s\n",
- * _dbus_hash_iter_get_string_key (&iter),
- * _dbus_hash_iter_get_value (&iter));
- * }
- *
- *
- * @endcode
- *
- * The iterator is initialized pointing "one before" the first hash
- * entry. The first call to _dbus_hash_iter_next() moves it onto
- * the first valid entry or returns #FALSE if the hash table is
- * empty. Subsequent calls move to the next valid entry or return
- * #FALSE if there are no more entries.
- *
- * Note that it is guaranteed to be safe to remove a hash entry during
- * iteration, but it is not safe to add a hash entry.
- *
- * @param table the hash table to iterate over.
- * @param iter the iterator to initialize.
- */
-void
-_dbus_hash_iter_init (DBusHashTable *table,
- DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
-
- real = (DBusRealHashIter*) iter;
-
- real->table = table;
- real->bucket = NULL;
- real->entry = NULL;
- real->next_entry = NULL;
- real->next_bucket = 0;
- real->n_entries_on_init = table->n_entries;
-}
-
-/**
- * Move the hash iterator forward one step, to the next hash entry.
- * The documentation for _dbus_hash_iter_init() explains in more
- * detail.
- *
- * @param iter the iterator to move forward.
- * @returns #FALSE if there are no more entries to move to.
- */
-dbus_bool_t
-_dbus_hash_iter_next (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
-
- real = (DBusRealHashIter*) iter;
-
- /* if this assertion failed someone probably added hash entries
- * during iteration, which is bad.
- */
- _dbus_assert (real->n_entries_on_init >= real->table->n_entries);
-
- /* Remember that real->entry may have been deleted */
-
- while (real->next_entry == NULL)
- {
- if (real->next_bucket >= real->table->n_buckets)
- {
- /* invalidate iter and return false */
- real->entry = NULL;
- real->table = NULL;
- real->bucket = NULL;
- return FALSE;
- }
-
- real->bucket = &(real->table->buckets[real->next_bucket]);
- real->next_entry = *(real->bucket);
- real->next_bucket += 1;
- }
-
- _dbus_assert (real->next_entry != NULL);
- _dbus_assert (real->bucket != NULL);
-
- real->entry = real->next_entry;
- real->next_entry = real->entry->next;
-
- return TRUE;
-}
-
-/**
- * Removes the current entry from the hash table.
- * If a key_free_function or value_free_function
- * was provided to _dbus_hash_table_new(),
- * frees the key and/or value for this entry.
- *
- * @param iter the hash table iterator.
- */
-void
-_dbus_hash_iter_remove_entry (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
- _dbus_assert (real->bucket != NULL);
-
- remove_entry (real->table, real->bucket, real->entry);
-
- real->entry = NULL; /* make it crash if you try to use this entry */
-}
-
-/**
- * Gets the value of the current entry.
- *
- * @param iter the hash table iterator.
- */
-void*
-_dbus_hash_iter_get_value (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
-
- return real->entry->value;
-}
-
-/**
- * Sets the value of the current entry.
- * If the hash table has a value_free_function
- * it will be used to free the previous value.
- * The hash table will own the passed-in value
- * (it will not be copied).
- *
- * @param iter the hash table iterator.
- * @param value the new value.
- */
-void
-_dbus_hash_iter_set_value (DBusHashIter *iter,
- void *value)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
-
- if (real->table->free_value_function && value != real->entry->value)
- (* real->table->free_value_function) (real->entry->value);
-
- real->entry->value = value;
-}
-
-/**
- * Gets the key for the current entry.
- * Only works for hash tables of type #DBUS_HASH_INT.
- *
- * @param iter the hash table iterator.
- */
-int
-_dbus_hash_iter_get_int_key (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
-
- return _DBUS_POINTER_TO_INT (real->entry->key);
-}
-
-/**
- * Gets the key for the current entry.
- * Only works for hash tables of type #DBUS_HASH_UINTPTR.
- *
- * @param iter the hash table iterator.
- */
-uintptr_t
-_dbus_hash_iter_get_uintptr_key (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
-
- return (uintptr_t) real->entry->key;
-}
-
-/**
- * Gets the key for the current entry.
- * Only works for hash tables of type #DBUS_HASH_STRING
- * @param iter the hash table iterator.
- */
-const char*
-_dbus_hash_iter_get_string_key (DBusHashIter *iter)
-{
- DBusRealHashIter *real;
-
- real = (DBusRealHashIter*) iter;
-
- _dbus_assert (real->table != NULL);
- _dbus_assert (real->entry != NULL);
-
- return real->entry->key;
-}
-
-/**
- * A low-level but efficient interface for manipulating the hash
- * table. It's efficient because you can get, set, and optionally
- * create the hash entry while only running the hash function one
- * time.
- *
- * Note that while calling _dbus_hash_iter_next() on the iterator
- * filled in by this function may work, it's completely
- * undefined which entries are after this iter and which
- * are before it. So it would be silly to iterate using this
- * iterator.
- *
- * If the hash entry is created, its value will be initialized
- * to all bits zero.
- *
- * #FALSE may be returned due to memory allocation failure, or
- * because create_if_not_found was #FALSE and the entry
- * did not exist.
- *
- * If create_if_not_found is #TRUE and the entry is created, the hash
- * table takes ownership of the key that's passed in.
- *
- * For a hash table of type #DBUS_HASH_INT, cast the int
- * key to the key parameter using #_DBUS_INT_TO_POINTER().
- *
- * @param table the hash table.
- * @param key the hash key.
- * @param create_if_not_found if #TRUE, create the entry if it didn't exist.
- * @param iter the iterator to initialize.
- * @returns #TRUE if the hash entry now exists (and the iterator is thus valid).
- */
-dbus_bool_t
-_dbus_hash_iter_lookup (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashIter *iter)
-{
- DBusRealHashIter *real;
- DBusHashEntry *entry;
- DBusHashEntry **bucket;
-
- _dbus_assert (sizeof (DBusHashIter) == sizeof (DBusRealHashIter));
-
- real = (DBusRealHashIter*) iter;
-
- entry = (* table->find_function) (table, key, create_if_not_found, &bucket, NULL);
-
- if (entry == NULL)
- return FALSE;
-
- real->table = table;
- real->bucket = bucket;
- real->entry = entry;
- real->next_entry = entry->next;
- real->next_bucket = (bucket - table->buckets) + 1;
- real->n_entries_on_init = table->n_entries;
-
- _dbus_assert (&(table->buckets[real->next_bucket-1]) == real->bucket);
-
- return TRUE;
-}
-
-static void
-add_allocated_entry (DBusHashTable *table,
- DBusHashEntry *entry,
- unsigned int idx,
- void *key,
- DBusHashEntry ***bucket)
-{
- DBusHashEntry **b;
-
- entry->key = key;
-
- b = &(table->buckets[idx]);
- entry->next = *b;
- *b = entry;
-
- if (bucket)
- *bucket = b;
-
- table->n_entries += 1;
-
- /* note we ONLY rebuild when ADDING - because you can iterate over a
- * table and remove entries safely.
- */
- if (table->n_entries >= table->hi_rebuild_size ||
- table->n_entries < table->lo_rebuild_size)
- rebuild_table (table);
-}
-
-static DBusHashEntry*
-add_entry (DBusHashTable *table,
- unsigned int idx,
- void *key,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated)
-{
- DBusHashEntry *entry;
-
- if (preallocated == NULL)
- {
- entry = alloc_entry (table);
- if (entry == NULL)
- {
- if (bucket)
- *bucket = NULL;
- return NULL;
- }
- }
- else
- {
- entry = (DBusHashEntry*) preallocated;
- }
-
- add_allocated_entry (table, entry, idx, key, bucket);
-
- return entry;
-}
-
-/* This is g_str_hash from GLib which was
- * extensively discussed/tested/profiled
- */
-static unsigned int
-string_hash (const char *str)
-{
- const char *p = str;
- unsigned int h = *p;
-
- if (h)
- for (p += 1; *p != '\0'; p++)
- h = (h << 5) - h + *p;
-
- return h;
-}
-
-/** Key comparison function */
-typedef int (* KeyCompareFunc) (const void *key_a, const void *key_b);
-
-static DBusHashEntry*
-find_generic_function (DBusHashTable *table,
- void *key,
- unsigned int idx,
- KeyCompareFunc compare_func,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated)
-{
- DBusHashEntry *entry;
-
- if (bucket)
- *bucket = NULL;
-
- /* Search all of the entries in this bucket. */
- entry = table->buckets[idx];
- while (entry != NULL)
- {
- if ((compare_func == NULL && key == entry->key) ||
- (compare_func != NULL && (* compare_func) (key, entry->key) == 0))
- {
- if (bucket)
- *bucket = &(table->buckets[idx]);
-
- if (preallocated)
- _dbus_hash_table_free_preallocated_entry (table, preallocated);
-
- return entry;
- }
-
- entry = entry->next;
- }
-
- if (create_if_not_found)
- entry = add_entry (table, idx, key, bucket, preallocated);
- else if (preallocated)
- _dbus_hash_table_free_preallocated_entry (table, preallocated);
-
- return entry;
-}
-
-static DBusHashEntry*
-find_string_function (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated)
-{
- unsigned int idx;
-
- idx = string_hash (key) & table->mask;
-
- return find_generic_function (table, key, idx,
- (KeyCompareFunc) strcmp, create_if_not_found, bucket,
- preallocated);
-}
-
-static DBusHashEntry*
-find_direct_function (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashEntry ***bucket,
- DBusPreallocatedHash *preallocated)
-{
- unsigned int idx;
-
- idx = RANDOM_INDEX (table, key) & table->mask;
-
-
- return find_generic_function (table, key, idx,
- NULL, create_if_not_found, bucket,
- preallocated);
-}
-
-static void
-rebuild_table (DBusHashTable *table)
-{
- int old_size;
- int new_buckets;
- DBusHashEntry **old_buckets;
- DBusHashEntry **old_chain;
- DBusHashEntry *entry;
- dbus_bool_t growing;
-
- /*
- * Allocate and initialize the new bucket array, and set up
- * hashing constants for new array size.
- */
-
- growing = table->n_entries >= table->hi_rebuild_size;
-
- old_size = table->n_buckets;
- old_buckets = table->buckets;
-
- if (growing)
- {
- /* overflow paranoia */
- if (table->n_buckets < _DBUS_INT_MAX / 4 &&
- table->down_shift >= 0)
- new_buckets = table->n_buckets * 4;
- else
- return; /* can't grow anymore */
- }
- else
- {
- new_buckets = table->n_buckets / 4;
- if (new_buckets < DBUS_SMALL_HASH_TABLE)
- return; /* don't bother shrinking this far */
- }
-
- table->buckets = dbus_new0 (DBusHashEntry*, new_buckets);
- if (table->buckets == NULL)
- {
- /* out of memory, yay - just don't reallocate, the table will
- * still work, albeit more slowly.
- */
- table->buckets = old_buckets;
- return;
- }
-
- table->n_buckets = new_buckets;
-
- if (growing)
- {
- table->lo_rebuild_size = table->hi_rebuild_size;
- table->hi_rebuild_size *= 4;
-
- table->down_shift -= 2; /* keep 2 more high bits */
- table->mask = (table->mask << 2) + 3; /* keep 2 more high bits */
- }
- else
- {
- table->hi_rebuild_size = table->lo_rebuild_size;
- table->lo_rebuild_size /= 4;
-
- table->down_shift += 2; /* keep 2 fewer high bits */
- table->mask = table->mask >> 2; /* keep 2 fewer high bits */
- }
-
-#if 0
- printf ("%s table to lo = %d hi = %d downshift = %d mask = 0x%x\n",
- growing ? "GROW" : "SHRINK",
- table->lo_rebuild_size,
- table->hi_rebuild_size,
- table->down_shift,
- table->mask);
-#endif
-
- _dbus_assert (table->lo_rebuild_size >= 0);
- _dbus_assert (table->hi_rebuild_size > table->lo_rebuild_size);
- _dbus_assert (table->mask != 0);
- /* the mask is essentially the max index */
- _dbus_assert (table->mask < table->n_buckets);
-
- /*
- * Rehash all of the existing entries into the new bucket array.
- */
-
- for (old_chain = old_buckets; old_size > 0; old_size--, old_chain++)
- {
- for (entry = *old_chain; entry != NULL; entry = *old_chain)
- {
- unsigned int idx;
- DBusHashEntry **bucket;
-
- *old_chain = entry->next;
- switch (table->key_type)
- {
- case DBUS_HASH_STRING:
- idx = string_hash (entry->key) & table->mask;
- break;
- case DBUS_HASH_INT:
- case DBUS_HASH_UINTPTR:
- idx = RANDOM_INDEX (table, entry->key);
- break;
- default:
- idx = 0;
- _dbus_assert_not_reached ("Unknown hash table type");
- break;
- }
-
- bucket = &(table->buckets[idx]);
- entry->next = *bucket;
- *bucket = entry;
- }
- }
-
- /* Free the old bucket array, if it was dynamically allocated. */
-
- if (old_buckets != table->static_buckets)
- dbus_free (old_buckets);
-}
-
-/**
- * Looks up the value for a given string in a hash table
- * of type #DBUS_HASH_STRING. Returns %NULL if the value
- * is not present. (A not-present entry is indistinguishable
- * from an entry with a value of %NULL.)
- * @param table the hash table.
- * @param key the string to look up.
- * @returns the value of the hash entry.
- */
-void*
-_dbus_hash_table_lookup_string (DBusHashTable *table,
- const char *key)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_STRING);
-
- entry = (* table->find_function) (table, (char*) key, FALSE, NULL, NULL);
-
- if (entry)
- return entry->value;
- else
- return NULL;
-}
-
-/**
- * Looks up the value for a given integer in a hash table
- * of type #DBUS_HASH_INT. Returns %NULL if the value
- * is not present. (A not-present entry is indistinguishable
- * from an entry with a value of %NULL.)
- * @param table the hash table.
- * @param key the integer to look up.
- * @returns the value of the hash entry.
- */
-void*
-_dbus_hash_table_lookup_int (DBusHashTable *table,
- int key)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_INT);
-
- entry = (* table->find_function) (table, _DBUS_INT_TO_POINTER (key), FALSE, NULL, NULL);
-
- if (entry)
- return entry->value;
- else
- return NULL;
-}
-
-/**
- * Looks up the value for a given integer in a hash table
- * of type #DBUS_HASH_UINTPTR. Returns %NULL if the value
- * is not present. (A not-present entry is indistinguishable
- * from an entry with a value of %NULL.)
- * @param table the hash table.
- * @param key the integer to look up.
- * @returns the value of the hash entry.
- */
-void*
-_dbus_hash_table_lookup_uintptr (DBusHashTable *table,
- uintptr_t key)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_UINTPTR);
-
- entry = (* table->find_function) (table, (void*) key, FALSE, NULL, NULL);
-
- if (entry)
- return entry->value;
- else
- return NULL;
-}
-
-/**
- * Removes the hash entry for the given key. If no hash entry
- * for the key exists, does nothing.
- *
- * @param table the hash table.
- * @param key the hash key.
- * @returns #TRUE if the entry existed
- */
-dbus_bool_t
-_dbus_hash_table_remove_string (DBusHashTable *table,
- const char *key)
-{
- DBusHashEntry *entry;
- DBusHashEntry **bucket;
-
- _dbus_assert (table->key_type == DBUS_HASH_STRING);
-
- entry = (* table->find_function) (table, (char*) key, FALSE, &bucket, NULL);
-
- if (entry)
- {
- remove_entry (table, bucket, entry);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * Removes the hash entry for the given key. If no hash entry
- * for the key exists, does nothing.
- *
- * @param table the hash table.
- * @param key the hash key.
- * @returns #TRUE if the entry existed
- */
-dbus_bool_t
-_dbus_hash_table_remove_int (DBusHashTable *table,
- int key)
-{
- DBusHashEntry *entry;
- DBusHashEntry **bucket;
-
- _dbus_assert (table->key_type == DBUS_HASH_INT);
-
- entry = (* table->find_function) (table, _DBUS_INT_TO_POINTER (key), FALSE, &bucket, NULL);
-
- if (entry)
- {
- remove_entry (table, bucket, entry);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * Removes the hash entry for the given key. If no hash entry
- * for the key exists, does nothing.
- *
- * @param table the hash table.
- * @param key the hash key.
- * @returns #TRUE if the entry existed
- */
-dbus_bool_t
-_dbus_hash_table_remove_uintptr (DBusHashTable *table,
- uintptr_t key)
-{
- DBusHashEntry *entry;
- DBusHashEntry **bucket;
-
- _dbus_assert (table->key_type == DBUS_HASH_UINTPTR);
-
- entry = (* table->find_function) (table, (void*) key, FALSE, &bucket, NULL);
-
- if (entry)
- {
- remove_entry (table, bucket, entry);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * Creates a hash entry with the given key and value.
- * The key and value are not copied; they are stored
- * in the hash table by reference. If an entry with the
- * given key already exists, the previous key and value
- * are overwritten (and freed if the hash table has
- * a key_free_function and/or value_free_function).
- *
- * Returns #FALSE if memory for the new hash entry
- * can't be allocated.
- *
- * @param table the hash table.
- * @param key the hash entry key.
- * @param value the hash entry value.
- */
-dbus_bool_t
-_dbus_hash_table_insert_string (DBusHashTable *table,
- char *key,
- void *value)
-{
- DBusPreallocatedHash *preallocated;
-
- _dbus_assert (table->key_type == DBUS_HASH_STRING);
-
- preallocated = _dbus_hash_table_preallocate_entry (table);
- if (preallocated == NULL)
- return FALSE;
-
- _dbus_hash_table_insert_string_preallocated (table, preallocated,
- key, value);
-
- return TRUE;
-}
-
-/**
- * Creates a hash entry with the given key and value.
- * The key and value are not copied; they are stored
- * in the hash table by reference. If an entry with the
- * given key already exists, the previous key and value
- * are overwritten (and freed if the hash table has
- * a key_free_function and/or value_free_function).
- *
- * Returns #FALSE if memory for the new hash entry
- * can't be allocated.
- *
- * @param table the hash table.
- * @param key the hash entry key.
- * @param value the hash entry value.
- */
-dbus_bool_t
-_dbus_hash_table_insert_int (DBusHashTable *table,
- int key,
- void *value)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_INT);
-
- entry = (* table->find_function) (table, _DBUS_INT_TO_POINTER (key), TRUE, NULL, NULL);
-
- if (entry == NULL)
- return FALSE; /* no memory */
-
- if (table->free_key_function && entry->key != _DBUS_INT_TO_POINTER (key))
- (* table->free_key_function) (entry->key);
-
- if (table->free_value_function && entry->value != value)
- (* table->free_value_function) (entry->value);
-
- entry->key = _DBUS_INT_TO_POINTER (key);
- entry->value = value;
-
- return TRUE;
-}
-
-/**
- * Creates a hash entry with the given key and value.
- * The key and value are not copied; they are stored
- * in the hash table by reference. If an entry with the
- * given key already exists, the previous key and value
- * are overwritten (and freed if the hash table has
- * a key_free_function and/or value_free_function).
- *
- * Returns #FALSE if memory for the new hash entry
- * can't be allocated.
- *
- * @param table the hash table.
- * @param key the hash entry key.
- * @param value the hash entry value.
- */
-dbus_bool_t
-_dbus_hash_table_insert_uintptr (DBusHashTable *table,
- uintptr_t key,
- void *value)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_UINTPTR);
-
- entry = (* table->find_function) (table, (void*) key, TRUE, NULL, NULL);
-
- if (entry == NULL)
- return FALSE; /* no memory */
-
- if (table->free_key_function && entry->key != (void*) key)
- (* table->free_key_function) (entry->key);
-
- if (table->free_value_function && entry->value != value)
- (* table->free_value_function) (entry->value);
-
- entry->key = (void*) key;
- entry->value = value;
-
- return TRUE;
-}
-
-/**
- * Preallocate an opaque data blob that allows us to insert into the
- * hash table at a later time without allocating any memory.
- *
- * @param table the hash table
- * @returns the preallocated data, or #NULL if no memory
- */
-DBusPreallocatedHash*
-_dbus_hash_table_preallocate_entry (DBusHashTable *table)
-{
- DBusHashEntry *entry;
-
- entry = alloc_entry (table);
-
- return (DBusPreallocatedHash*) entry;
-}
-
-/**
- * Frees an opaque DBusPreallocatedHash that was *not* used
- * in order to insert into the hash table.
- *
- * @param table the hash table
- * @param preallocated the preallocated data
- */
-void
-_dbus_hash_table_free_preallocated_entry (DBusHashTable *table,
- DBusPreallocatedHash *preallocated)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (preallocated != NULL);
-
- entry = (DBusHashEntry*) preallocated;
-
- /* Don't use free_entry(), since this entry has no key/data */
- _dbus_mem_pool_dealloc (table->entry_pool, entry);
-}
-
-/**
- * Inserts a string-keyed entry into the hash table, using a
- * preallocated data block from
- * _dbus_hash_table_preallocate_entry(). This function cannot fail due
- * to lack of memory. The DBusPreallocatedHash object is consumed and
- * should not be reused or freed. Otherwise this function works
- * just like _dbus_hash_table_insert_string().
- *
- * @param table the hash table
- * @param preallocated the preallocated data
- * @param key the hash key
- * @param value the value
- */
-void
-_dbus_hash_table_insert_string_preallocated (DBusHashTable *table,
- DBusPreallocatedHash *preallocated,
- char *key,
- void *value)
-{
- DBusHashEntry *entry;
-
- _dbus_assert (table->key_type == DBUS_HASH_STRING);
- _dbus_assert (preallocated != NULL);
-
- entry = (* table->find_function) (table, key, TRUE, NULL, preallocated);
-
- _dbus_assert (entry != NULL);
-
- if (table->free_key_function && entry->key != key)
- (* table->free_key_function) (entry->key);
-
- if (table->free_value_function && entry->value != value)
- (* table->free_value_function) (entry->value);
-
- entry->key = key;
- entry->value = value;
-}
-
-/**
- * Gets the number of hash entries in a hash table.
- *
- * @param table the hash table.
- * @returns the number of entries in the table.
- */
-int
-_dbus_hash_table_get_n_entries (DBusHashTable *table)
-{
- return table->n_entries;
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-/* If you're wondering why the hash table test takes
- * forever to run, it's because we call this function
- * in inner loops thus making things quadratic.
- */
-static int
-count_entries (DBusHashTable *table)
-{
- DBusHashIter iter;
- int count;
-
- count = 0;
- _dbus_hash_iter_init (table, &iter);
- while (_dbus_hash_iter_next (&iter))
- ++count;
-
- _dbus_assert (count == _dbus_hash_table_get_n_entries (table));
-
- return count;
-}
-
-/**
- * @ingroup DBusHashTableInternals
- * Unit test for DBusHashTable
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_hash_test (void)
-{
- int i;
- DBusHashTable *table1;
- DBusHashTable *table2;
- DBusHashTable *table3;
- DBusHashIter iter;
-#define N_HASH_KEYS 5000
- char **keys;
- dbus_bool_t ret = FALSE;
-
- keys = dbus_new (char *, N_HASH_KEYS);
- if (keys == NULL)
- _dbus_assert_not_reached ("no memory");
-
- for (i = 0; i < N_HASH_KEYS; i++)
- {
- keys[i] = dbus_malloc (128);
-
- if (keys[i] == NULL)
- _dbus_assert_not_reached ("no memory");
- }
-
- printf ("Computing test hash keys...\n");
- i = 0;
- while (i < N_HASH_KEYS)
- {
- int len;
-
- len = sprintf (keys[i], "Hash key %d", i);
- _dbus_assert (*(keys[i] + len) == '\0');
- ++i;
- }
- printf ("... done.\n");
-
- table1 = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free, dbus_free);
- if (table1 == NULL)
- goto out;
-
- table2 = _dbus_hash_table_new (DBUS_HASH_INT,
- NULL, dbus_free);
- if (table2 == NULL)
- goto out;
-
- table3 = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL, dbus_free);
- if (table3 == NULL)
- goto out;
-
- /* Insert and remove a bunch of stuff, counting the table in between
- * to be sure it's not broken and that iteration works
- */
- i = 0;
- while (i < 3000)
- {
- void *value;
- char *key;
-
- key = _dbus_strdup (keys[i]);
- if (key == NULL)
- goto out;
- value = _dbus_strdup ("Value!");
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_string (table1,
- key, value))
- goto out;
-
- value = _dbus_strdup (keys[i]);
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_int (table2,
- i, value))
- goto out;
-
- value = _dbus_strdup (keys[i]);
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_uintptr (table3,
- i, value))
- goto out;
-
- _dbus_assert (count_entries (table1) == i + 1);
- _dbus_assert (count_entries (table2) == i + 1);
- _dbus_assert (count_entries (table3) == i + 1);
-
- value = _dbus_hash_table_lookup_string (table1, keys[i]);
- _dbus_assert (value != NULL);
- _dbus_assert (strcmp (value, "Value!") == 0);
-
- value = _dbus_hash_table_lookup_int (table2, i);
- _dbus_assert (value != NULL);
- _dbus_assert (strcmp (value, keys[i]) == 0);
-
- value = _dbus_hash_table_lookup_uintptr (table3, i);
- _dbus_assert (value != NULL);
- _dbus_assert (strcmp (value, keys[i]) == 0);
-
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- _dbus_hash_table_remove_string (table1,
- keys[i]);
-
- _dbus_hash_table_remove_int (table2, i);
-
- _dbus_hash_table_remove_uintptr (table3, i);
-
- _dbus_assert (count_entries (table1) == i);
- _dbus_assert (count_entries (table2) == i);
- _dbus_assert (count_entries (table3) == i);
-
- --i;
- }
-
- _dbus_hash_table_ref (table1);
- _dbus_hash_table_ref (table2);
- _dbus_hash_table_ref (table3);
- _dbus_hash_table_unref (table1);
- _dbus_hash_table_unref (table2);
- _dbus_hash_table_unref (table3);
- _dbus_hash_table_unref (table1);
- _dbus_hash_table_unref (table2);
- _dbus_hash_table_unref (table3);
- table3 = NULL;
-
- /* Insert a bunch of stuff then check
- * that iteration works correctly (finds the right
- * values, iter_set_value works, etc.)
- */
- table1 = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free, dbus_free);
- if (table1 == NULL)
- goto out;
-
- table2 = _dbus_hash_table_new (DBUS_HASH_INT,
- NULL, dbus_free);
- if (table2 == NULL)
- goto out;
-
- i = 0;
- while (i < 5000)
- {
- char *key;
- void *value;
-
- key = _dbus_strdup (keys[i]);
- if (key == NULL)
- goto out;
- value = _dbus_strdup ("Value!");
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_string (table1,
- key, value))
- goto out;
-
- value = _dbus_strdup (keys[i]);
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_int (table2,
- i, value))
- goto out;
-
- _dbus_assert (count_entries (table1) == i + 1);
- _dbus_assert (count_entries (table2) == i + 1);
-
- ++i;
- }
-
- _dbus_hash_iter_init (table1, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- const char *key;
- void *value;
-
- key = _dbus_hash_iter_get_string_key (&iter);
- value = _dbus_hash_iter_get_value (&iter);
-
- _dbus_assert (_dbus_hash_table_lookup_string (table1, key) == value);
-
- value = _dbus_strdup ("Different value!");
- if (value == NULL)
- goto out;
-
- _dbus_hash_iter_set_value (&iter, value);
-
- _dbus_assert (_dbus_hash_table_lookup_string (table1, key) == value);
- }
-
- _dbus_hash_iter_init (table1, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- _dbus_hash_iter_remove_entry (&iter);
- _dbus_assert (count_entries (table1) == i - 1);
- --i;
- }
-
- _dbus_hash_iter_init (table2, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- int key;
- void *value;
-
- key = _dbus_hash_iter_get_int_key (&iter);
- value = _dbus_hash_iter_get_value (&iter);
-
- _dbus_assert (_dbus_hash_table_lookup_int (table2, key) == value);
-
- value = _dbus_strdup ("Different value!");
- if (value == NULL)
- goto out;
-
- _dbus_hash_iter_set_value (&iter, value);
-
- _dbus_assert (_dbus_hash_table_lookup_int (table2, key) == value);
- }
-
- i = count_entries (table2);
- _dbus_hash_iter_init (table2, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- _dbus_hash_iter_remove_entry (&iter);
- _dbus_assert (count_entries (table2) + 1 == i);
- --i;
- }
-
- /* add/remove interleaved, to check that we grow/shrink the table
- * appropriately
- */
- i = 0;
- while (i < 1000)
- {
- char *key;
- void *value;
-
- key = _dbus_strdup (keys[i]);
- if (key == NULL)
- goto out;
-
- value = _dbus_strdup ("Value!");
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_insert_string (table1,
- key, value))
- goto out;
-
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- char *key;
- void *value;
-
- key = _dbus_strdup (keys[i]);
- if (key == NULL)
- goto out;
- value = _dbus_strdup ("Value!");
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_table_remove_string (table1, keys[i]))
- goto out;
-
- if (!_dbus_hash_table_insert_string (table1,
- key, value))
- goto out;
-
- if (!_dbus_hash_table_remove_string (table1, keys[i]))
- goto out;
-
- _dbus_assert (_dbus_hash_table_get_n_entries (table1) == i);
-
- --i;
- }
-
- /* nuke these tables */
- _dbus_hash_table_unref (table1);
- _dbus_hash_table_unref (table2);
-
-
- /* Now do a bunch of things again using _dbus_hash_iter_lookup() to
- * be sure that interface works.
- */
- table1 = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free, dbus_free);
- if (table1 == NULL)
- goto out;
-
- table2 = _dbus_hash_table_new (DBUS_HASH_INT,
- NULL, dbus_free);
- if (table2 == NULL)
- goto out;
-
- i = 0;
- while (i < 3000)
- {
- void *value;
- char *key;
-
- key = _dbus_strdup (keys[i]);
- if (key == NULL)
- goto out;
- value = _dbus_strdup ("Value!");
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_iter_lookup (table1,
- key, TRUE, &iter))
- goto out;
- _dbus_assert (_dbus_hash_iter_get_value (&iter) == NULL);
- _dbus_hash_iter_set_value (&iter, value);
-
- value = _dbus_strdup (keys[i]);
- if (value == NULL)
- goto out;
-
- if (!_dbus_hash_iter_lookup (table2,
- _DBUS_INT_TO_POINTER (i), TRUE, &iter))
- goto out;
- _dbus_assert (_dbus_hash_iter_get_value (&iter) == NULL);
- _dbus_hash_iter_set_value (&iter, value);
-
- _dbus_assert (count_entries (table1) == i + 1);
- _dbus_assert (count_entries (table2) == i + 1);
-
- if (!_dbus_hash_iter_lookup (table1, keys[i], FALSE, &iter))
- goto out;
-
- value = _dbus_hash_iter_get_value (&iter);
- _dbus_assert (value != NULL);
- _dbus_assert (strcmp (value, "Value!") == 0);
-
- /* Iterate just to be sure it works, though
- * it's a stupid thing to do
- */
- while (_dbus_hash_iter_next (&iter))
- ;
-
- if (!_dbus_hash_iter_lookup (table2, _DBUS_INT_TO_POINTER (i), FALSE, &iter))
- goto out;
-
- value = _dbus_hash_iter_get_value (&iter);
- _dbus_assert (value != NULL);
- _dbus_assert (strcmp (value, keys[i]) == 0);
-
- /* Iterate just to be sure it works, though
- * it's a stupid thing to do
- */
- while (_dbus_hash_iter_next (&iter))
- ;
-
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- if (!_dbus_hash_iter_lookup (table1, keys[i], FALSE, &iter))
- _dbus_assert_not_reached ("hash entry should have existed");
- _dbus_hash_iter_remove_entry (&iter);
-
- if (!_dbus_hash_iter_lookup (table2, _DBUS_INT_TO_POINTER (i), FALSE, &iter))
- _dbus_assert_not_reached ("hash entry should have existed");
- _dbus_hash_iter_remove_entry (&iter);
-
- _dbus_assert (count_entries (table1) == i);
- _dbus_assert (count_entries (table2) == i);
-
- --i;
- }
-
- _dbus_hash_table_unref (table1);
- _dbus_hash_table_unref (table2);
-
- ret = TRUE;
-
- out:
- for (i = 0; i < N_HASH_KEYS; i++)
- dbus_free (keys[i]);
-
- dbus_free (keys);
-
- return ret;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.h
deleted file mode 100644
index 5aa183c4b5..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-hash.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-hash.h Generic hash table utility (internal to D-Bus implementation)
- *
- * Copyright (C) 2002 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_HASH_H
-#define DBUS_HASH_H
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-sysdeps.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusHashTable
- * @{
- */
-
-/** Hash iterator object. The iterator is on the stack, but its real
- * fields are hidden privately.
- */
-struct DBusHashIter
-{
- void *dummy1; /**< Do not use. */
- void *dummy2; /**< Do not use. */
- void *dummy3; /**< Do not use. */
- void *dummy4; /**< Do not use. */
- int dummy5; /**< Do not use. */
- int dummy6; /**< Do not use. */
-};
-
-typedef struct DBusHashTable DBusHashTable;
-typedef struct DBusHashIter DBusHashIter;
-
-/* Allowing an arbitrary function as with GLib
- * would be nicer for a public API, but for
- * an internal API this saves typing, we can add
- * more whenever we feel like it.
- */
-typedef enum
-{
- DBUS_HASH_STRING, /**< Hash keys are strings. */
- DBUS_HASH_INT, /**< Hash keys are integers. */
- DBUS_HASH_UINTPTR /**< Hash keys are integer capable to hold a pointer. */
-} DBusHashType;
-
-DBusHashTable* _dbus_hash_table_new (DBusHashType type,
- DBusFreeFunction key_free_function,
- DBusFreeFunction value_free_function);
-DBusHashTable* _dbus_hash_table_ref (DBusHashTable *table);
-void _dbus_hash_table_unref (DBusHashTable *table);
-void _dbus_hash_table_remove_all (DBusHashTable *table);
-void _dbus_hash_iter_init (DBusHashTable *table,
- DBusHashIter *iter);
-dbus_bool_t _dbus_hash_iter_next (DBusHashIter *iter);
-void _dbus_hash_iter_remove_entry (DBusHashIter *iter);
-void* _dbus_hash_iter_get_value (DBusHashIter *iter);
-void _dbus_hash_iter_set_value (DBusHashIter *iter,
- void *value);
-int _dbus_hash_iter_get_int_key (DBusHashIter *iter);
-const char* _dbus_hash_iter_get_string_key (DBusHashIter *iter);
-uintptr_t _dbus_hash_iter_get_uintptr_key (DBusHashIter *iter);
-dbus_bool_t _dbus_hash_iter_lookup (DBusHashTable *table,
- void *key,
- dbus_bool_t create_if_not_found,
- DBusHashIter *iter);
-void* _dbus_hash_table_lookup_string (DBusHashTable *table,
- const char *key);
-void* _dbus_hash_table_lookup_int (DBusHashTable *table,
- int key);
-void* _dbus_hash_table_lookup_uintptr (DBusHashTable *table,
- uintptr_t key);
-dbus_bool_t _dbus_hash_table_remove_string (DBusHashTable *table,
- const char *key);
-dbus_bool_t _dbus_hash_table_remove_int (DBusHashTable *table,
- int key);
-dbus_bool_t _dbus_hash_table_remove_uintptr (DBusHashTable *table,
- uintptr_t key);
-dbus_bool_t _dbus_hash_table_insert_string (DBusHashTable *table,
- char *key,
- void *value);
-dbus_bool_t _dbus_hash_table_insert_int (DBusHashTable *table,
- int key,
- void *value);
-dbus_bool_t _dbus_hash_table_insert_uintptr (DBusHashTable *table,
- uintptr_t key,
- void *value);
-int _dbus_hash_table_get_n_entries (DBusHashTable *table);
-
-/* Preallocation */
-
-/** A preallocated hash entry */
-typedef struct DBusPreallocatedHash DBusPreallocatedHash;
-
-DBusPreallocatedHash *_dbus_hash_table_preallocate_entry (DBusHashTable *table);
-void _dbus_hash_table_free_preallocated_entry (DBusHashTable *table,
- DBusPreallocatedHash *preallocated);
-void _dbus_hash_table_insert_string_preallocated (DBusHashTable *table,
- DBusPreallocatedHash *preallocated,
- char *key,
- void *value);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_HASH_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-init-win.cpp b/src/3rd_party/dbus-1.7.8/dbus/dbus-init-win.cpp
deleted file mode 100644
index 687f248ca9..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-init-win.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * dbus-init-win.cpp - once-per-process initialization
- *
- * Copyright © 2013 Intel Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-extern "C"
-{
-#include "dbus-sysdeps-win.h"
-}
-
-class DBusInternalInit
- {
- public:
- DBusInternalInit ()
- {
- _dbus_threads_windows_init_global ();
- }
-
- void must_not_be_omitted ()
- {
- }
- };
-
-static DBusInternalInit init;
-
-extern "C" void
-_dbus_threads_windows_ensure_ctor_linked ()
-{
- /* Do nothing significant, just ensure that the global initializer gets
- * linked in. */
- init.must_not_be_omitted ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.c
deleted file mode 100644
index e248259773..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.c
+++ /dev/null
@@ -1,1037 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-internals.c random utility stuff (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-protocol.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-test.h"
-#include "dbus-valgrind-internal.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef DBUS_USE_OUTPUT_DEBUG_STRING
-#include <windows.h>
-#include <mbstring.h>
-#endif
-
-/**
- * @defgroup DBusInternals D-Bus secret internal implementation details
- * @brief Documentation useful when developing or debugging D-Bus itself.
- *
- */
-
-/**
- * @defgroup DBusInternalsUtils Utilities and portability
- * @ingroup DBusInternals
- * @brief Utility functions (_dbus_assert(), _dbus_warn(), etc.)
- * @{
- */
-
-/**
- * @def _dbus_assert
- *
- * Aborts with an error message if the condition is false.
- *
- * @param condition condition which must be true.
- */
-
-/**
- * @def _dbus_assert_not_reached
- *
- * Aborts with an error message if called.
- * The given explanation will be printed.
- *
- * @param explanation explanation of what happened if the code was reached.
- */
-
-/**
- * @def _DBUS_N_ELEMENTS
- *
- * Computes the number of elements in a fixed-size array using
- * sizeof().
- *
- * @param array the array to count elements in.
- */
-
-/**
- * @def _DBUS_POINTER_TO_INT
- *
- * Safely casts a void* to an integer; should only be used on void*
- * that actually contain integers, for example one created with
- * _DBUS_INT_TO_POINTER. Only guaranteed to preserve 32 bits.
- * (i.e. it's used to store 32-bit ints in pointers, but
- * can't be used to store 64-bit pointers in ints.)
- *
- * @param pointer pointer to extract an integer from.
- */
-/**
- * @def _DBUS_INT_TO_POINTER
- *
- * Safely stuffs an integer into a pointer, to be extracted later with
- * _DBUS_POINTER_TO_INT. Only guaranteed to preserve 32 bits.
- *
- * @param integer the integer to stuff into a pointer.
- */
-/**
- * @def _DBUS_ZERO
- *
- * Sets all bits in an object to zero.
- *
- * @param object the object to be zeroed.
- */
-/**
- * @def _DBUS_INT16_MIN
- *
- * Minimum value of type "int16"
- */
-/**
- * @def _DBUS_INT16_MAX
- *
- * Maximum value of type "int16"
- */
-/**
- * @def _DBUS_UINT16_MAX
- *
- * Maximum value of type "uint16"
- */
-
-/**
- * @def _DBUS_INT32_MIN
- *
- * Minimum value of type "int32"
- */
-/**
- * @def _DBUS_INT32_MAX
- *
- * Maximum value of type "int32"
- */
-/**
- * @def _DBUS_UINT32_MAX
- *
- * Maximum value of type "uint32"
- */
-
-/**
- * @def _DBUS_INT_MIN
- *
- * Minimum value of type "int"
- */
-/**
- * @def _DBUS_INT_MAX
- *
- * Maximum value of type "int"
- */
-/**
- * @def _DBUS_UINT_MAX
- *
- * Maximum value of type "uint"
- */
-
-/**
- * @typedef DBusForeachFunction
- *
- * Used to iterate over each item in a collection, such as
- * a DBusList.
- */
-
-/**
- * @def _DBUS_LOCK_NAME
- *
- * Expands to name of a global lock variable.
- */
-
-/**
- * @def _DBUS_LOCK
- *
- * Locks a global lock, initializing it first if necessary.
- *
- * @returns #FALSE if not enough memory
- */
-
-/**
- * @def _DBUS_UNLOCK
- *
- * Unlocks a global lock
- */
-
-/**
- * Fixed "out of memory" error message, just to avoid
- * making up a different string every time and wasting
- * space.
- */
-const char *_dbus_no_memory_message = "Not enough memory";
-
-static dbus_bool_t warn_initted = FALSE;
-static dbus_bool_t fatal_warnings = FALSE;
-static dbus_bool_t fatal_warnings_on_check_failed = TRUE;
-
-static void
-init_warnings(void)
-{
- if (!warn_initted)
- {
- const char *s;
- s = _dbus_getenv ("DBUS_FATAL_WARNINGS");
- if (s && *s)
- {
- if (*s == '0')
- {
- fatal_warnings = FALSE;
- fatal_warnings_on_check_failed = FALSE;
- }
- else if (*s == '1')
- {
- fatal_warnings = TRUE;
- fatal_warnings_on_check_failed = TRUE;
- }
- else
- {
- fprintf(stderr, "DBUS_FATAL_WARNINGS should be set to 0 or 1 if set, not '%s'",
- s);
- }
- }
-
- warn_initted = TRUE;
- }
-}
-
-/**
- * Prints a warning message to stderr. Can optionally be made to exit
- * fatally by setting DBUS_FATAL_WARNINGS, but this is rarely
- * used. This function should be considered pretty much equivalent to
- * fprintf(stderr). _dbus_warn_check_failed() on the other hand is
- * suitable for use when a programming mistake has been made.
- *
- * @param format printf-style format string.
- */
-void
-_dbus_warn (const char *format,
- ...)
-{
- va_list args;
-
- if (!warn_initted)
- init_warnings ();
-
- va_start (args, format);
- vfprintf (stderr, format, args);
- va_end (args);
-
- if (fatal_warnings)
- {
- fflush (stderr);
- _dbus_abort ();
- }
-}
-
-/**
- * Prints a "critical" warning to stderr when an assertion fails;
- * differs from _dbus_warn primarily in that it prefixes the pid and
- * defaults to fatal. This should be used only when a programming
- * error has been detected. (NOT for unavoidable errors that an app
- * might handle - those should be returned as DBusError.) Calling this
- * means "there is a bug"
- */
-void
-_dbus_warn_check_failed(const char *format,
- ...)
-{
- va_list args;
-
- if (!warn_initted)
- init_warnings ();
-
- fprintf (stderr, "process %lu: ", _dbus_pid_for_log ());
-
- va_start (args, format);
- vfprintf (stderr, format, args);
- va_end (args);
-
- if (fatal_warnings_on_check_failed)
- {
- fflush (stderr);
- _dbus_abort ();
- }
-}
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-
-static dbus_bool_t verbose_initted = FALSE;
-static dbus_bool_t verbose = TRUE;
-
-/** Whether to show the current thread in verbose messages */
-#define PTHREAD_IN_VERBOSE 0
-#if PTHREAD_IN_VERBOSE
-#include <pthread.h>
-#endif
-
-#ifdef DBUS_USE_OUTPUT_DEBUG_STRING
-static char module_name[1024];
-#endif
-
-static inline void
-_dbus_verbose_init (void)
-{
- if (!verbose_initted)
- {
- const char *p = _dbus_getenv ("DBUS_VERBOSE");
- verbose = p != NULL && *p == '1';
- verbose_initted = TRUE;
-#ifdef DBUS_USE_OUTPUT_DEBUG_STRING
- {
- char *last_period, *last_slash;
- GetModuleFileName(0,module_name,sizeof(module_name)-1);
- last_period = _mbsrchr(module_name,'.');
- if (last_period)
- *last_period ='\0';
- last_slash = _mbsrchr(module_name,'\\');
- if (last_slash)
- strcpy(module_name,last_slash+1);
- strcat(module_name,": ");
- }
-#endif
- }
-}
-
-/** @def DBUS_IS_DIR_SEPARATOR(c)
- * macro for checking if character c is a patch separator
- *
- * @todo move to a header file so that others can use this too
- */
-#ifdef DBUS_WIN
-#define DBUS_IS_DIR_SEPARATOR(c) (c == '\\' || c == '/')
-#else
-#define DBUS_IS_DIR_SEPARATOR(c) (c == '/')
-#endif
-
-/**
- remove source root from file path
- the source root is determined by
-*/
-static char *_dbus_file_path_extract_elements_from_tail(const char *file,int level)
-{
- int prefix = 0;
- char *p = (char *)file + strlen(file);
- int i = 0;
-
- for (;p >= file;p--)
- {
- if (DBUS_IS_DIR_SEPARATOR(*p))
- {
- if (++i >= level)
- {
- prefix = p-file+1;
- break;
- }
- }
- }
-
- return (char *)file+prefix;
-}
-
-/**
- * Implementation of dbus_is_verbose() macro if built with verbose logging
- * enabled.
- * @returns whether verbose logging is active.
- */
-dbus_bool_t
-_dbus_is_verbose_real (void)
-{
- _dbus_verbose_init ();
- return verbose;
-}
-
-/**
- * Prints a warning message to stderr
- * if the user has enabled verbose mode.
- * This is the real function implementation,
- * use _dbus_verbose() macro in code.
- *
- * @param format printf-style format string.
- */
-void
-_dbus_verbose_real (
-#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
- const char *file,
- const int line,
- const char *function,
-#endif
- const char *format,
- ...)
-{
- va_list args;
- static dbus_bool_t need_pid = TRUE;
- int len;
-
- /* things are written a bit oddly here so that
- * in the non-verbose case we just have the one
- * conditional and return immediately.
- */
- if (!_dbus_is_verbose_real())
- return;
-
-#ifndef DBUS_USE_OUTPUT_DEBUG_STRING
- /* Print out pid before the line */
- if (need_pid)
- {
-#if PTHREAD_IN_VERBOSE
- fprintf (stderr, "%lu: 0x%lx: ", _dbus_pid_for_log (), pthread_self ());
-#else
- fprintf (stderr, "%lu: ", _dbus_pid_for_log ());
-#endif
- }
-#endif
-
- /* Only print pid again if the next line is a new line */
- len = strlen (format);
- if (format[len-1] == '\n')
- need_pid = TRUE;
- else
- need_pid = FALSE;
-
- va_start (args, format);
-#ifdef DBUS_USE_OUTPUT_DEBUG_STRING
- {
- char buf[1024];
- strcpy(buf,module_name);
-#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
- sprintf (buf+strlen(buf), "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(file,2),line,function);
-#endif
- vsprintf (buf+strlen(buf),format, args);
- va_end (args);
- OutputDebugStringA(buf);
- }
-#else
-#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
- fprintf (stderr, "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(file,2),line,function);
-#endif
-
- vfprintf (stderr, format, args);
- va_end (args);
-
- fflush (stderr);
-#endif
-}
-
-/**
- * Reinitializes the verbose logging code, used
- * as a hack in dbus-spawn.c so that a child
- * process re-reads its pid
- *
- */
-void
-_dbus_verbose_reset_real (void)
-{
- verbose_initted = FALSE;
-}
-
-void
-_dbus_trace_ref (const char *obj_name,
- void *obj,
- int old_refcount,
- int new_refcount,
- const char *why,
- const char *env_var,
- int *enabled)
-{
- _dbus_assert (obj_name != NULL);
- _dbus_assert (obj != NULL);
- _dbus_assert (old_refcount >= -1);
- _dbus_assert (new_refcount >= -1);
-
- if (old_refcount == -1)
- {
- _dbus_assert (new_refcount == -1);
- }
- else
- {
- _dbus_assert (new_refcount >= 0);
- _dbus_assert (old_refcount >= 0);
- _dbus_assert (old_refcount > 0 || new_refcount > 0);
- }
-
- _dbus_assert (why != NULL);
- _dbus_assert (env_var != NULL);
- _dbus_assert (enabled != NULL);
-
- if (*enabled < 0)
- {
- const char *s = _dbus_getenv (env_var);
-
- *enabled = FALSE;
-
- if (s && *s)
- {
- if (*s == '0')
- *enabled = FALSE;
- else if (*s == '1')
- *enabled = TRUE;
- else
- _dbus_warn ("%s should be 0 or 1 if set, not '%s'", env_var, s);
- }
- }
-
- if (*enabled)
- {
- if (old_refcount == -1)
- {
- VALGRIND_PRINTF_BACKTRACE ("%s %p ref stolen (%s)",
- obj_name, obj, why);
- _dbus_verbose ("%s %p ref stolen (%s)",
- obj_name, obj, why);
- }
- else
- {
- VALGRIND_PRINTF_BACKTRACE ("%s %p %d -> %d refs (%s)",
- obj_name, obj,
- old_refcount, new_refcount, why);
- _dbus_verbose ("%s %p %d -> %d refs (%s)",
- obj_name, obj, old_refcount, new_refcount, why);
- }
- }
-}
-
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
-/**
- * Duplicates a string. Result must be freed with
- * dbus_free(). Returns #NULL if memory allocation fails.
- * If the string to be duplicated is #NULL, returns #NULL.
- *
- * @param str string to duplicate.
- * @returns newly-allocated copy.
- */
-char*
-_dbus_strdup (const char *str)
-{
- size_t len;
- char *copy;
-
- if (str == NULL)
- return NULL;
-
- len = strlen (str);
-
- copy = dbus_malloc (len + 1);
- if (copy == NULL)
- return NULL;
-
- memcpy (copy, str, len + 1);
-
- return copy;
-}
-
-/**
- * Duplicates a block of memory. Returns
- * #NULL on failure.
- *
- * @param mem memory to copy
- * @param n_bytes number of bytes to copy
- * @returns the copy
- */
-void*
-_dbus_memdup (const void *mem,
- size_t n_bytes)
-{
- void *copy;
-
- copy = dbus_malloc (n_bytes);
- if (copy == NULL)
- return NULL;
-
- memcpy (copy, mem, n_bytes);
-
- return copy;
-}
-
-/**
- * Duplicates a string array. Result may be freed with
- * dbus_free_string_array(). Returns #NULL if memory allocation fails.
- * If the array to be duplicated is #NULL, returns #NULL.
- *
- * @param array array to duplicate.
- * @returns newly-allocated copy.
- */
-char**
-_dbus_dup_string_array (const char **array)
-{
- int len;
- int i;
- char **copy;
-
- if (array == NULL)
- return NULL;
-
- for (len = 0; array[len] != NULL; ++len)
- ;
-
- copy = dbus_new0 (char*, len + 1);
- if (copy == NULL)
- return NULL;
-
- i = 0;
- while (i < len)
- {
- copy[i] = _dbus_strdup (array[i]);
- if (copy[i] == NULL)
- {
- dbus_free_string_array (copy);
- return NULL;
- }
-
- ++i;
- }
-
- return copy;
-}
-
-/**
- * Checks whether a string array contains the given string.
- *
- * @param array array to search.
- * @param str string to look for
- * @returns #TRUE if array contains string
- */
-dbus_bool_t
-_dbus_string_array_contains (const char **array,
- const char *str)
-{
- int i;
-
- i = 0;
- while (array[i] != NULL)
- {
- if (strcmp (array[i], str) == 0)
- return TRUE;
- ++i;
- }
-
- return FALSE;
-}
-
-/**
- * Generates a new UUID. If you change how this is done,
- * there's some text about it in the spec that should also change.
- *
- * @param uuid the uuid to initialize
- */
-void
-_dbus_generate_uuid (DBusGUID *uuid)
-{
- long now;
-
- /* don't use monotonic time because the UUID may be saved to disk, e.g.
- * it may persist across reboots
- */
- _dbus_get_real_time (&now, NULL);
-
- uuid->as_uint32s[DBUS_UUID_LENGTH_WORDS - 1] = DBUS_UINT32_TO_BE (now);
-
- _dbus_generate_random_bytes_buffer (uuid->as_bytes, DBUS_UUID_LENGTH_BYTES - 4);
-}
-
-/**
- * Hex-encode a UUID.
- *
- * @param uuid the uuid
- * @param encoded string to append hex uuid to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_uuid_encode (const DBusGUID *uuid,
- DBusString *encoded)
-{
- DBusString binary;
- _dbus_string_init_const_len (&binary, uuid->as_bytes, DBUS_UUID_LENGTH_BYTES);
- return _dbus_string_hex_encode (&binary, 0, encoded, _dbus_string_get_length (encoded));
-}
-
-static dbus_bool_t
-_dbus_read_uuid_file_without_creating (const DBusString *filename,
- DBusGUID *uuid,
- DBusError *error)
-{
- DBusString contents;
- DBusString decoded;
- int end;
-
- if (!_dbus_string_init (&contents))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&decoded))
- {
- _dbus_string_free (&contents);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_file_get_contents (&contents, filename, error))
- goto error;
-
- _dbus_string_chop_white (&contents);
-
- if (_dbus_string_get_length (&contents) != DBUS_UUID_LENGTH_HEX)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_FILE_CONTENT,
- "UUID file '%s' should contain a hex string of length %d, not length %d, with no other text",
- _dbus_string_get_const_data (filename),
- DBUS_UUID_LENGTH_HEX,
- _dbus_string_get_length (&contents));
- goto error;
- }
-
- if (!_dbus_string_hex_decode (&contents, 0, &end, &decoded, 0))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- if (end == 0)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_FILE_CONTENT,
- "UUID file '%s' contains invalid hex data",
- _dbus_string_get_const_data (filename));
- goto error;
- }
-
- if (_dbus_string_get_length (&decoded) != DBUS_UUID_LENGTH_BYTES)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_FILE_CONTENT,
- "UUID file '%s' contains %d bytes of hex-encoded data instead of %d",
- _dbus_string_get_const_data (filename),
- _dbus_string_get_length (&decoded),
- DBUS_UUID_LENGTH_BYTES);
- goto error;
- }
-
- _dbus_string_copy_to_buffer (&decoded, uuid->as_bytes, DBUS_UUID_LENGTH_BYTES);
-
- _dbus_string_free (&decoded);
- _dbus_string_free (&contents);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- return TRUE;
-
- error:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_free (&contents);
- _dbus_string_free (&decoded);
- return FALSE;
-}
-
-static dbus_bool_t
-_dbus_create_uuid_file_exclusively (const DBusString *filename,
- DBusGUID *uuid,
- DBusError *error)
-{
- DBusString encoded;
-
- if (!_dbus_string_init (&encoded))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- _dbus_generate_uuid (uuid);
-
- if (!_dbus_uuid_encode (uuid, &encoded))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- if (!_dbus_string_append_byte (&encoded, '\n'))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- if (!_dbus_string_save_to_file (&encoded, filename, TRUE, error))
- goto error;
-
- _dbus_string_free (&encoded);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return TRUE;
-
- error:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_free (&encoded);
- return FALSE;
-}
-
-/**
- * Reads (and optionally writes) a uuid to a file. Initializes the uuid
- * unless an error is returned.
- *
- * @param filename the name of the file
- * @param uuid uuid to be initialized with the loaded uuid
- * @param create_if_not_found #TRUE to create a new uuid and save it if the file doesn't exist
- * @param error the error return
- * @returns #FALSE if the error is set
- */
-dbus_bool_t
-_dbus_read_uuid_file (const DBusString *filename,
- DBusGUID *uuid,
- dbus_bool_t create_if_not_found,
- DBusError *error)
-{
- DBusError read_error = DBUS_ERROR_INIT;
-
- if (_dbus_read_uuid_file_without_creating (filename, uuid, &read_error))
- return TRUE;
-
- if (!create_if_not_found)
- {
- dbus_move_error (&read_error, error);
- return FALSE;
- }
-
- /* If the file exists and contains junk, we want to keep that error
- * message instead of overwriting it with a "file exists" error
- * message when we try to write
- */
- if (dbus_error_has_name (&read_error, DBUS_ERROR_INVALID_FILE_CONTENT))
- {
- dbus_move_error (&read_error, error);
- return FALSE;
- }
- else
- {
- dbus_error_free (&read_error);
- return _dbus_create_uuid_file_exclusively (filename, uuid, error);
- }
-}
-
-/* Protected by _DBUS_LOCK (machine_uuid) */
-static int machine_uuid_initialized_generation = 0;
-static DBusGUID machine_uuid;
-
-/**
- * Gets the hex-encoded UUID of the machine this function is
- * executed on. This UUID is guaranteed to be the same for a given
- * machine at least until it next reboots, though it also
- * makes some effort to be the same forever, it may change if the
- * machine is reconfigured or its hardware is modified.
- *
- * @param uuid_str string to append hex-encoded machine uuid to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_get_local_machine_uuid_encoded (DBusString *uuid_str)
-{
- dbus_bool_t ok;
-
- if (!_DBUS_LOCK (machine_uuid))
- return FALSE;
-
- if (machine_uuid_initialized_generation != _dbus_current_generation)
- {
- DBusError error = DBUS_ERROR_INIT;
-
- if (!_dbus_read_local_machine_uuid (&machine_uuid, FALSE,
- &error))
- {
-#ifndef DBUS_ENABLE_EMBEDDED_TESTS
- /* For the test suite, we may not be installed so just continue silently
- * here. But in a production build, we want to be nice and loud about
- * this.
- */
- _dbus_warn_check_failed ("D-Bus library appears to be incorrectly set up; failed to read machine uuid: %s\n"
- "See the manual page for dbus-uuidgen to correct this issue.\n",
- error.message);
-#endif
-
- dbus_error_free (&error);
-
- _dbus_generate_uuid (&machine_uuid);
- }
- }
-
- ok = _dbus_uuid_encode (&machine_uuid, uuid_str);
-
- _DBUS_UNLOCK (machine_uuid);
-
- return ok;
-}
-
-#ifndef DBUS_DISABLE_CHECKS
-/** String used in _dbus_return_if_fail macro */
-const char *_dbus_return_if_fail_warning_format =
-"arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\n"
-"This is normally a bug in some application using the D-Bus library.\n";
-#endif
-
-#ifndef DBUS_DISABLE_ASSERT
-/**
- * Internals of _dbus_assert(); it's a function
- * rather than a macro with the inline code so
- * that the assertion failure blocks don't show up
- * in test suite coverage, and to shrink code size.
- *
- * @param condition TRUE if assertion succeeded
- * @param condition_text condition as a string
- * @param file file the assertion is in
- * @param line line the assertion is in
- * @param func function the assertion is in
- */
-void
-_dbus_real_assert (dbus_bool_t condition,
- const char *condition_text,
- const char *file,
- int line,
- const char *func)
-{
- if (_DBUS_UNLIKELY (!condition))
- {
- _dbus_warn ("%lu: assertion failed \"%s\" file \"%s\" line %d function %s\n",
- _dbus_pid_for_log (), condition_text, file, line, func);
- _dbus_abort ();
- }
-}
-
-/**
- * Internals of _dbus_assert_not_reached(); it's a function
- * rather than a macro with the inline code so
- * that the assertion failure blocks don't show up
- * in test suite coverage, and to shrink code size.
- *
- * @param explanation what was reached that shouldn't have been
- * @param file file the assertion is in
- * @param line line the assertion is in
- */
-void
-_dbus_real_assert_not_reached (const char *explanation,
- const char *file,
- int line)
-{
- _dbus_warn ("File \"%s\" line %d process %lu should not have been reached: %s\n",
- file, line, _dbus_pid_for_log (), explanation);
- _dbus_abort ();
-}
-#endif /* DBUS_DISABLE_ASSERT */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static dbus_bool_t
-run_failing_each_malloc (int n_mallocs,
- const char *description,
- DBusTestMemoryFunction func,
- void *data)
-{
- n_mallocs += 10; /* fudge factor to ensure reallocs etc. are covered */
-
- while (n_mallocs >= 0)
- {
- _dbus_set_fail_alloc_counter (n_mallocs);
-
- _dbus_verbose ("\n===\n%s: (will fail malloc %d with %d failures)\n===\n",
- description, n_mallocs,
- _dbus_get_fail_alloc_failures ());
-
- if (!(* func) (data))
- return FALSE;
-
- n_mallocs -= 1;
- }
-
- _dbus_set_fail_alloc_counter (_DBUS_INT_MAX);
-
- return TRUE;
-}
-
-/**
- * Tests how well the given function responds to out-of-memory
- * situations. Calls the function repeatedly, failing a different
- * call to malloc() each time. If the function ever returns #FALSE,
- * the test fails. The function should return #TRUE whenever something
- * valid (such as returning an error, or succeeding) occurs, and #FALSE
- * if it gets confused in some way.
- *
- * @param description description of the test used in verbose output
- * @param func function to call
- * @param data data to pass to function
- * @returns #TRUE if the function never returns FALSE
- */
-dbus_bool_t
-_dbus_test_oom_handling (const char *description,
- DBusTestMemoryFunction func,
- void *data)
-{
- int approx_mallocs;
- const char *setting;
- int max_failures_to_try;
- int i;
-
- /* Run once to see about how many mallocs are involved */
-
- _dbus_set_fail_alloc_counter (_DBUS_INT_MAX);
-
- _dbus_verbose ("Running once to count mallocs\n");
-
- if (!(* func) (data))
- return FALSE;
-
- approx_mallocs = _DBUS_INT_MAX - _dbus_get_fail_alloc_counter ();
-
- _dbus_verbose ("\n=================\n%s: about %d mallocs total\n=================\n",
- description, approx_mallocs);
-
- setting = _dbus_getenv ("DBUS_TEST_MALLOC_FAILURES");
- if (setting != NULL)
- {
- DBusString str;
- long v;
- _dbus_string_init_const (&str, setting);
- v = 4;
- if (!_dbus_string_parse_int (&str, 0, &v, NULL))
- _dbus_warn ("couldn't parse '%s' as integer\n", setting);
- max_failures_to_try = v;
- }
- else
- {
- max_failures_to_try = 4;
- }
-
- i = setting ? max_failures_to_try - 1 : 1;
- while (i < max_failures_to_try)
- {
- _dbus_set_fail_alloc_failures (i);
- if (!run_failing_each_malloc (approx_mallocs, description, func, data))
- return FALSE;
- ++i;
- }
-
- _dbus_verbose ("\n=================\n%s: all iterations passed\n=================\n",
- description);
-
- return TRUE;
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.h
deleted file mode 100644
index c5a3c9b86b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-internals.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-internals.h random utility stuff (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifdef DBUS_INSIDE_DBUS_H
-#error "You can't include dbus-internals.h in the public header dbus.h"
-#endif
-
-#ifndef DBUS_INTERNALS_H
-#define DBUS_INTERNALS_H
-
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-threads-internal.h>
-
-DBUS_BEGIN_DECLS
-
-void _dbus_warn (const char *format,
- ...) _DBUS_GNUC_PRINTF (1, 2);
-
-void _dbus_warn_check_failed (const char *format,
- ...) _DBUS_GNUC_PRINTF (1, 2);
-
-
-#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#define _DBUS_FUNCTION_NAME __func__
-#elif defined(__GNUC__) || defined(_MSC_VER)
-#define _DBUS_FUNCTION_NAME __FUNCTION__
-#else
-#define _DBUS_FUNCTION_NAME "unknown function"
-#endif
-
-/*
- * (code from GLib)
- *
- * The _DBUS_LIKELY and _DBUS_UNLIKELY macros let the programmer give hints to
- * the compiler about the expected result of an expression. Some compilers
- * can use this information for optimizations.
- *
- * The _DBUS_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
- * putting assignments in the macro arg
- */
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-#define _DBUS_BOOLEAN_EXPR(expr) \
- __extension__ ({ \
- int _dbus_boolean_var_; \
- if (expr) \
- _dbus_boolean_var_ = 1; \
- else \
- _dbus_boolean_var_ = 0; \
- _dbus_boolean_var_; \
-})
-#define _DBUS_LIKELY(expr) (__builtin_expect (_DBUS_BOOLEAN_EXPR(expr), 1))
-#define _DBUS_UNLIKELY(expr) (__builtin_expect (_DBUS_BOOLEAN_EXPR(expr), 0))
-#else
-#define _DBUS_LIKELY(expr) (expr)
-#define _DBUS_UNLIKELY(expr) (expr)
-#endif
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-
-/*
- at least gnu cc and msvc compiler are known to
- have support for variable macro argument lists
- add other compilers is required
-*/
-#if defined(__GNUC__) || defined(_MSC_VER)
-#define DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
-#endif
-
-#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
-void _dbus_verbose_real (const char *file, const int line, const char *function,
- const char *format,...) _DBUS_GNUC_PRINTF (4, 5);
-# define _dbus_verbose(fmt,...) _dbus_verbose_real( __FILE__,__LINE__,__FUNCTION__,fmt, ## __VA_ARGS__)
-#else
-void _dbus_verbose_real (const char *format,
- ...) _DBUS_GNUC_PRINTF (1, 2);
-# define _dbus_verbose _dbus_verbose_real
-#endif
-void _dbus_verbose_reset_real (void);
-dbus_bool_t _dbus_is_verbose_real (void);
-
-# define _dbus_verbose_reset _dbus_verbose_reset_real
-# define _dbus_is_verbose _dbus_is_verbose_real
-#else
-# ifdef HAVE_ISO_VARARGS
-# define _dbus_verbose(...) do { } while (0)
-# elif defined (HAVE_GNUC_VARARGS)
-# define _dbus_verbose(format...) do { } while (0)
-# else
-static void _dbus_verbose(const char * x,...) {;}
-# endif
-# define _dbus_verbose_reset() do { } while (0)
-# define _dbus_is_verbose() FALSE
-#endif /* !DBUS_ENABLE_VERBOSE_MODE */
-
-void _dbus_trace_ref (const char *obj_name,
- void *obj,
- int old_refcount,
- int new_refcount,
- const char *why,
- const char *env_var,
- int *enabled);
-
-const char* _dbus_strerror (int error_number);
-
-#ifdef DBUS_DISABLE_ASSERT
-#define _dbus_assert(condition) do { } while (0)
-#else
-void _dbus_real_assert (dbus_bool_t condition,
- const char *condition_text,
- const char *file,
- int line,
- const char *func);
-#define _dbus_assert(condition) \
- _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__, _DBUS_FUNCTION_NAME)
-#endif /* !DBUS_DISABLE_ASSERT */
-
-#ifdef DBUS_DISABLE_ASSERT
-#define _dbus_assert_not_reached(explanation) do { } while (0)
-#else
-void _dbus_real_assert_not_reached (const char *explanation,
- const char *file,
- int line) _DBUS_GNUC_NORETURN;
-#define _dbus_assert_not_reached(explanation) \
- _dbus_real_assert_not_reached (explanation, __FILE__, __LINE__)
-#endif /* !DBUS_DISABLE_ASSERT */
-
-#ifdef DBUS_DISABLE_CHECKS
-#define _dbus_return_if_fail(condition)
-#define _dbus_return_val_if_fail(condition, val)
-#else
-
-extern const char *_dbus_return_if_fail_warning_format;
-
-#define _dbus_return_if_fail(condition) do { \
- _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
- if (!(condition)) { \
- _dbus_warn_check_failed (_dbus_return_if_fail_warning_format, \
- _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
- return; \
- } } while (0)
-
-#define _dbus_return_val_if_fail(condition, val) do { \
- _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
- if (!(condition)) { \
- _dbus_warn_check_failed (_dbus_return_if_fail_warning_format, \
- _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
- return (val); \
- } } while (0)
-
-#endif /* !DBUS_DISABLE_ASSERT */
-
-#define _DBUS_N_ELEMENTS(array) ((int) (sizeof ((array)) / sizeof ((array)[0])))
-
-#define _DBUS_POINTER_TO_INT(pointer) ((intptr_t)(pointer))
-#define _DBUS_INT_TO_POINTER(integer) ((void*)((intptr_t)(integer)))
-
-#define _DBUS_ZERO(object) (memset (&(object), '\0', sizeof ((object))))
-
-#define _DBUS_STRUCT_OFFSET(struct_type, member) \
- ((intptr_t) ((unsigned char*) &((struct_type*) 0)->member))
-
-#ifdef DBUS_DISABLE_CHECKS
-/* this is an assert and not an error, but in the typical --disable-checks case (you're trying
- * to really minimize code size), disabling these assertions makes sense.
- */
-#define _DBUS_ASSERT_ERROR_IS_SET(error) do { } while (0)
-#define _DBUS_ASSERT_ERROR_IS_CLEAR(error) do { } while (0)
-#else
-#define _DBUS_ASSERT_ERROR_IS_SET(error) _dbus_assert ((error) == NULL || dbus_error_is_set ((error)))
-#define _DBUS_ASSERT_ERROR_IS_CLEAR(error) _dbus_assert ((error) == NULL || !dbus_error_is_set ((error)))
-#endif
-
-#define _dbus_return_if_error_is_set(error) _dbus_return_if_fail ((error) == NULL || !dbus_error_is_set ((error)))
-#define _dbus_return_val_if_error_is_set(error, val) _dbus_return_val_if_fail ((error) == NULL || !dbus_error_is_set ((error)), (val))
-
-/* This alignment thing is from ORBit2 */
-/* Align a value upward to a boundary, expressed as a number of bytes.
- * E.g. align to an 8-byte boundary with argument of 8.
- */
-
-/*
- * (this + boundary - 1)
- * &
- * ~(boundary - 1)
- */
-
-#define _DBUS_ALIGN_VALUE(this, boundary) \
- (( ((uintptr_t)(this)) + (((uintptr_t)(boundary)) -1)) & (~(((uintptr_t)(boundary))-1)))
-
-#define _DBUS_ALIGN_ADDRESS(this, boundary) \
- ((void*)_DBUS_ALIGN_VALUE(this, boundary))
-
-
-char* _dbus_strdup (const char *str);
-void* _dbus_memdup (const void *mem,
- size_t n_bytes);
-dbus_bool_t _dbus_string_array_contains (const char **array,
- const char *str);
-char** _dbus_dup_string_array (const char **array);
-
-#define _DBUS_INT16_MIN ((dbus_int16_t) 0x8000)
-#define _DBUS_INT16_MAX ((dbus_int16_t) 0x7fff)
-#define _DBUS_UINT16_MAX ((dbus_uint16_t)0xffff)
-#define _DBUS_INT32_MIN ((dbus_int32_t) 0x80000000)
-#define _DBUS_INT32_MAX ((dbus_int32_t) 0x7fffffff)
-#define _DBUS_UINT32_MAX ((dbus_uint32_t)0xffffffff)
-/* using 32-bit here is sort of bogus */
-#define _DBUS_INT_MIN _DBUS_INT32_MIN
-#define _DBUS_INT_MAX _DBUS_INT32_MAX
-#define _DBUS_UINT_MAX _DBUS_UINT32_MAX
-#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (0x7fffffffffffffff)
-#define _DBUS_UINT64_MAX DBUS_UINT64_CONSTANT (0xffffffffffffffff)
-#define _DBUS_ONE_KILOBYTE 1024
-#define _DBUS_ONE_MEGABYTE 1024 * _DBUS_ONE_KILOBYTE
-#define _DBUS_ONE_HOUR_IN_MILLISECONDS (1000 * 60 * 60)
-#define _DBUS_USEC_PER_SECOND (1000000)
-
-#undef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-#undef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
-#undef ABS
-#define ABS(a) (((a) < 0) ? -(a) : (a))
-
-#define _DBUS_ISASCII(c) ((c) != '\0' && (((c) & ~0x7f) == 0))
-
-typedef void (* DBusForeachFunction) (void *element,
- void *data);
-
-dbus_bool_t _dbus_set_fd_nonblocking (int fd,
- DBusError *error);
-
-void _dbus_verbose_bytes (const unsigned char *data,
- int len,
- int offset);
-void _dbus_verbose_bytes_of_string (const DBusString *str,
- int start,
- int len);
-
-extern const char *_dbus_no_memory_message;
-#define _DBUS_SET_OOM(error) dbus_set_error_const ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message)
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/* Memory debugging */
-void _dbus_set_fail_alloc_counter (int until_next_fail);
-int _dbus_get_fail_alloc_counter (void);
-void _dbus_set_fail_alloc_failures (int failures_per_failure);
-int _dbus_get_fail_alloc_failures (void);
-dbus_bool_t _dbus_decrement_fail_alloc_counter (void);
-dbus_bool_t _dbus_disable_mem_pools (void);
-int _dbus_get_malloc_blocks_outstanding (void);
-
-typedef dbus_bool_t (* DBusTestMemoryFunction) (void *data);
-dbus_bool_t _dbus_test_oom_handling (const char *description,
- DBusTestMemoryFunction func,
- void *data);
-#else
-#define _dbus_set_fail_alloc_counter(n)
-#define _dbus_get_fail_alloc_counter _DBUS_INT_MAX
-
-/* These are constant expressions so that blocks
- * they protect should be optimized away
- */
-#define _dbus_decrement_fail_alloc_counter() (FALSE)
-#define _dbus_disable_mem_pools() (FALSE)
-#define _dbus_get_malloc_blocks_outstanding (0)
-#endif /* !DBUS_ENABLE_EMBEDDED_TESTS */
-
-typedef void (* DBusShutdownFunction) (void *data);
-dbus_bool_t _dbus_register_shutdown_func (DBusShutdownFunction function,
- void *data);
-dbus_bool_t _dbus_register_shutdown_func_unlocked (DBusShutdownFunction function,
- void *data);
-
-extern int _dbus_current_generation;
-
-/* The weird case convention is to avoid having to change all the callers,
- * which would be quite a mega-patch. */
-typedef enum
-{
- /* index 0-4 */
- _DBUS_LOCK_list,
- _DBUS_LOCK_connection_slots,
- _DBUS_LOCK_pending_call_slots,
- _DBUS_LOCK_server_slots,
- _DBUS_LOCK_message_slots,
- /* index 5-9 */
- _DBUS_LOCK_bus,
- _DBUS_LOCK_bus_datas,
- _DBUS_LOCK_shutdown_funcs,
- _DBUS_LOCK_system_users,
- _DBUS_LOCK_message_cache,
- /* index 10-12 */
- _DBUS_LOCK_shared_connections,
- _DBUS_LOCK_machine_uuid,
- _DBUS_LOCK_sysdeps,
-
- _DBUS_N_GLOBAL_LOCKS
-} DBusGlobalLock;
-
-dbus_bool_t _dbus_lock (DBusGlobalLock lock) _DBUS_GNUC_WARN_UNUSED_RESULT;
-void _dbus_unlock (DBusGlobalLock lock);
-
-#define _DBUS_LOCK_NAME(name) _DBUS_LOCK_##name
-#define _DBUS_LOCK(name) _dbus_lock (_DBUS_LOCK_##name)
-#define _DBUS_UNLOCK(name) _dbus_unlock (_DBUS_LOCK_##name)
-
-dbus_bool_t _dbus_threads_init_debug (void);
-
-dbus_bool_t _dbus_address_append_escaped (DBusString *escaped,
- const DBusString *unescaped);
-
-void _dbus_set_bad_address (DBusError *error,
- const char *address_problem_type,
- const char *address_problem_field,
- const char *address_problem_other);
-
-#define DBUS_UUID_LENGTH_BYTES 16
-#define DBUS_UUID_LENGTH_WORDS (DBUS_UUID_LENGTH_BYTES / 4)
-#define DBUS_UUID_LENGTH_HEX (DBUS_UUID_LENGTH_BYTES * 2)
-
-/**
- * A globally unique ID ; we have one for each DBusServer, and also one for each
- * machine with libdbus installed on it.
- */
-union DBusGUID
-{
- dbus_uint32_t as_uint32s[DBUS_UUID_LENGTH_WORDS]; /**< guid as four uint32 values */
- char as_bytes[DBUS_UUID_LENGTH_BYTES]; /**< guid as 16 single-byte values */
-};
-
-void _dbus_generate_uuid (DBusGUID *uuid);
-dbus_bool_t _dbus_uuid_encode (const DBusGUID *uuid,
- DBusString *encoded);
-dbus_bool_t _dbus_read_uuid_file (const DBusString *filename,
- DBusGUID *uuid,
- dbus_bool_t create_if_not_found,
- DBusError *error);
-
-dbus_bool_t _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str);
-
-#define _DBUS_PASTE2(a, b) a ## b
-#define _DBUS_PASTE(a, b) _DBUS_PASTE2 (a, b)
-#define _DBUS_STATIC_ASSERT(expr) \
- typedef struct { char _assertion[(expr) ? 1 : -1]; } \
- _DBUS_PASTE (_DBUS_STATIC_ASSERT_, __LINE__)
-
-DBUS_END_DECLS
-
-#endif /* DBUS_INTERNALS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.c
deleted file mode 100644
index f0c64de3eb..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.c
+++ /dev/null
@@ -1,1160 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-keyring.c Store secret cookies in your homedir
- *
- * Copyright (C) 2003, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-keyring.h"
-#include "dbus-protocol.h"
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-sysdeps.h>
-
-/**
- * @defgroup DBusKeyring keyring class
- * @ingroup DBusInternals
- * @brief DBusKeyring data structure
- *
- * Types and functions related to DBusKeyring. DBusKeyring is intended
- * to manage cookies used to authenticate clients to servers. This is
- * essentially the "verify that client can read the user's homedir"
- * authentication mechanism. Both client and server must have access
- * to the homedir.
- *
- * The secret keys are not kept in locked memory, and are written to a
- * file in the user's homedir. However they are transient (only used
- * by a single server instance for a fixed period of time, then
- * discarded). Also, the keys are not sent over the wire.
- *
- * @todo there's a memory leak on some codepath in here, I saw it once
- * when running make check - probably some specific initial cookies
- * present in the cookie file, then depending on what we do with them.
- */
-
-/**
- * @defgroup DBusKeyringInternals DBusKeyring implementation details
- * @ingroup DBusInternals
- * @brief DBusKeyring implementation details
- *
- * The guts of DBusKeyring.
- *
- * @{
- */
-
-/** The maximum age of a key before we create a new key to use in
- * challenges. This isn't super-reliably enforced, since system
- * clocks can change or be wrong, but we make a best effort to only
- * use keys for a short time.
- */
-#define NEW_KEY_TIMEOUT_SECONDS (60*5)
-/**
- * The time after which we drop a key from the secrets file.
- * The EXPIRE_KEYS_TIMEOUT_SECONDS - NEW_KEY_TIMEOUT_SECONDS is the minimum
- * time window a client has to complete authentication.
- */
-#define EXPIRE_KEYS_TIMEOUT_SECONDS (NEW_KEY_TIMEOUT_SECONDS + (60*2))
-/**
- * The maximum amount of time a key can be in the future.
- */
-#define MAX_TIME_TRAVEL_SECONDS (60*5)
-
-/**
- * Maximum number of keys in the keyring before
- * we just ignore the rest
- */
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#define MAX_KEYS_IN_FILE 10
-#else
-#define MAX_KEYS_IN_FILE 256
-#endif
-
-/**
- * A single key from the cookie file
- */
-typedef struct
-{
- dbus_int32_t id; /**< identifier used to refer to the key */
-
- long creation_time; /**< when the key was generated,
- * as unix timestamp. signed long
- * matches struct timeval.
- */
-
- DBusString secret; /**< the actual key */
-
-} DBusKey;
-
-/**
- * @brief Internals of DBusKeyring.
- *
- * DBusKeyring internals. DBusKeyring is an opaque object, it must be
- * used via accessor functions.
- */
-struct DBusKeyring
-{
- int refcount; /**< Reference count */
- DBusString directory; /**< Directory the below two items are inside */
- DBusString filename; /**< Keyring filename */
- DBusString filename_lock; /**< Name of lockfile */
- DBusKey *keys; /**< Keys loaded from the file */
- int n_keys; /**< Number of keys */
- DBusCredentials *credentials; /**< Credentials containing user the keyring is for */
-};
-
-static DBusKeyring*
-_dbus_keyring_new (void)
-{
- DBusKeyring *keyring;
-
- keyring = dbus_new0 (DBusKeyring, 1);
- if (keyring == NULL)
- goto out_0;
-
- if (!_dbus_string_init (&keyring->directory))
- goto out_1;
-
- if (!_dbus_string_init (&keyring->filename))
- goto out_2;
-
- if (!_dbus_string_init (&keyring->filename_lock))
- goto out_3;
-
- keyring->refcount = 1;
- keyring->keys = NULL;
- keyring->n_keys = 0;
-
- return keyring;
-
- out_3:
- _dbus_string_free (&keyring->filename);
- out_2:
- _dbus_string_free (&keyring->directory);
- out_1:
- dbus_free (keyring);
- out_0:
- return NULL;
-}
-
-static void
-free_keys (DBusKey *keys,
- int n_keys)
-{
- int i;
-
- /* should be safe for args NULL, 0 */
-
- i = 0;
- while (i < n_keys)
- {
- _dbus_string_free (&keys[i].secret);
- ++i;
- }
-
- dbus_free (keys);
-}
-
-/* Our locking scheme is highly unreliable. However, there is
- * unfortunately no reliable locking scheme in user home directories;
- * between bugs in Linux NFS, people using Tru64 or other total crap
- * NFS, AFS, random-file-system-of-the-week, and so forth, fcntl() in
- * homedirs simply generates tons of bug reports. This has been
- * learned through hard experience with GConf, unfortunately.
- *
- * This bad hack might work better for the kind of lock we have here,
- * which we don't expect to hold for any length of time. Crashing
- * while we hold it should be unlikely, and timing out such that we
- * delete a stale lock should also be unlikely except when the
- * filesystem is running really slowly. Stuff might break in corner
- * cases but as long as it's not a security-level breakage it should
- * be OK.
- */
-
-/** Maximum number of timeouts waiting for lock before we decide it's stale */
-#define MAX_LOCK_TIMEOUTS 32
-/** Length of each timeout while waiting for a lock */
-#define LOCK_TIMEOUT_MILLISECONDS 250
-
-static dbus_bool_t
-_dbus_keyring_lock (DBusKeyring *keyring)
-{
- int n_timeouts;
-
- n_timeouts = 0;
- while (n_timeouts < MAX_LOCK_TIMEOUTS)
- {
- DBusError error = DBUS_ERROR_INIT;
-
- if (_dbus_create_file_exclusively (&keyring->filename_lock,
- &error))
- break;
-
- _dbus_verbose ("Did not get lock file, sleeping %d milliseconds (%s)\n",
- LOCK_TIMEOUT_MILLISECONDS, error.message);
- dbus_error_free (&error);
-
- _dbus_sleep_milliseconds (LOCK_TIMEOUT_MILLISECONDS);
-
- ++n_timeouts;
- }
-
- if (n_timeouts == MAX_LOCK_TIMEOUTS)
- {
- DBusError error = DBUS_ERROR_INIT;
-
- _dbus_verbose ("Lock file timed out %d times, assuming stale\n",
- n_timeouts);
-
- if (!_dbus_delete_file (&keyring->filename_lock, &error))
- {
- _dbus_verbose ("Couldn't delete old lock file: %s\n",
- error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- if (!_dbus_create_file_exclusively (&keyring->filename_lock,
- &error))
- {
- _dbus_verbose ("Couldn't create lock file after deleting stale one: %s\n",
- error.message);
- dbus_error_free (&error);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-static void
-_dbus_keyring_unlock (DBusKeyring *keyring)
-{
- DBusError error = DBUS_ERROR_INIT;
-
- if (!_dbus_delete_file (&keyring->filename_lock, &error))
- {
- _dbus_warn ("Failed to delete lock file: %s\n",
- error.message);
- dbus_error_free (&error);
- }
-}
-
-static DBusKey*
-find_key_by_id (DBusKey *keys,
- int n_keys,
- int id)
-{
- int i;
-
- i = 0;
- while (i < n_keys)
- {
- if (keys[i].id == id)
- return &keys[i];
-
- ++i;
- }
-
- return NULL;
-}
-
-static dbus_bool_t
-add_new_key (DBusKey **keys_p,
- int *n_keys_p,
- DBusError *error)
-{
- DBusKey *new;
- DBusString bytes;
- int id;
- long timestamp;
- const unsigned char *s;
- dbus_bool_t retval;
- DBusKey *keys;
- int n_keys;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&bytes))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- keys = *keys_p;
- n_keys = *n_keys_p;
- retval = FALSE;
-
- /* Generate an integer ID and then the actual key. */
- retry:
-
- if (!_dbus_generate_random_bytes (&bytes, 4))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- s = (const unsigned char*) _dbus_string_get_const_data (&bytes);
-
- id = s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24);
- if (id < 0)
- id = - id;
- _dbus_assert (id >= 0);
-
- if (find_key_by_id (keys, n_keys, id) != NULL)
- {
- _dbus_string_set_length (&bytes, 0);
- _dbus_verbose ("Key ID %d already existed, trying another one\n",
- id);
- goto retry;
- }
-
- _dbus_verbose ("Creating key with ID %d\n", id);
-
-#define KEY_LENGTH_BYTES 24
- _dbus_string_set_length (&bytes, 0);
- if (!_dbus_generate_random_bytes (&bytes, KEY_LENGTH_BYTES))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- new = dbus_realloc (keys, sizeof (DBusKey) * (n_keys + 1));
- if (new == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- keys = new;
- *keys_p = keys; /* otherwise *keys_p ends up invalid */
- n_keys += 1;
-
- if (!_dbus_string_init (&keys[n_keys-1].secret))
- {
- n_keys -= 1; /* we don't want to free the one we didn't init */
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- _dbus_get_real_time (&timestamp, NULL);
-
- keys[n_keys-1].id = id;
- keys[n_keys-1].creation_time = timestamp;
- if (!_dbus_string_move (&bytes, 0,
- &keys[n_keys-1].secret,
- 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&keys[n_keys-1].secret);
- n_keys -= 1;
- goto out;
- }
-
- retval = TRUE;
-
- out:
- *n_keys_p = n_keys;
-
- _dbus_string_free (&bytes);
- return retval;
-}
-
-/**
- * Reloads the keyring file, optionally adds one new key to the file,
- * removes all expired keys from the file iff a key was added, then
- * resaves the file. Stores the keys from the file in keyring->keys.
- * Note that the file is only resaved (written to) if a key is added,
- * this means that only servers ever write to the file and need to
- * lock it, which avoids a lot of lock contention at login time and
- * such.
- *
- * @param keyring the keyring
- * @param add_new #TRUE to add a new key to the file, expire keys, and resave
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-static dbus_bool_t
-_dbus_keyring_reload (DBusKeyring *keyring,
- dbus_bool_t add_new,
- DBusError *error)
-{
- DBusString contents;
- DBusString line;
- dbus_bool_t retval;
- dbus_bool_t have_lock;
- DBusKey *keys;
- int n_keys;
- int i;
- long now;
- DBusError tmp_error;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_check_dir_is_private_to_user (&keyring->directory, error))
- return FALSE;
-
- if (!_dbus_string_init (&contents))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- if (!_dbus_string_init (&line))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&contents);
- return FALSE;
- }
-
- keys = NULL;
- n_keys = 0;
- retval = FALSE;
- have_lock = FALSE;
-
- _dbus_get_real_time (&now, NULL);
-
- if (add_new)
- {
- if (!_dbus_keyring_lock (keyring))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Could not lock keyring file to add to it");
- goto out;
- }
-
- have_lock = TRUE;
- }
-
- dbus_error_init (&tmp_error);
- if (!_dbus_file_get_contents (&contents,
- &keyring->filename,
- &tmp_error))
- {
- _dbus_verbose ("Failed to load keyring file: %s\n",
- tmp_error.message);
- /* continue with empty keyring file, so we recreate it */
- dbus_error_free (&tmp_error);
- }
-
- if (!_dbus_string_validate_ascii (&contents, 0,
- _dbus_string_get_length (&contents)))
- {
- _dbus_warn ("Secret keyring file contains non-ASCII! Ignoring existing contents\n");
- _dbus_string_set_length (&contents, 0);
- }
-
- /* FIXME this is badly inefficient for large keyring files
- * (not that large keyring files exist outside of test suites)
- */
- while (_dbus_string_pop_line (&contents, &line))
- {
- int next;
- long val;
- int id;
- long timestamp;
- int len;
- int end;
- DBusKey *new;
-
- /* Don't load more than the max. */
- if (n_keys >= (add_new ? MAX_KEYS_IN_FILE - 1 : MAX_KEYS_IN_FILE))
- break;
-
- next = 0;
- if (!_dbus_string_parse_int (&line, 0, &val, &next))
- {
- _dbus_verbose ("could not parse secret key ID at start of line\n");
- continue;
- }
-
- if (val > _DBUS_INT32_MAX || val < 0)
- {
- _dbus_verbose ("invalid secret key ID at start of line\n");
- continue;
- }
-
- id = val;
-
- _dbus_string_skip_blank (&line, next, &next);
-
- if (!_dbus_string_parse_int (&line, next, &timestamp, &next))
- {
- _dbus_verbose ("could not parse secret key timestamp\n");
- continue;
- }
-
- if (timestamp < 0 ||
- (now + MAX_TIME_TRAVEL_SECONDS) < timestamp ||
- (now - EXPIRE_KEYS_TIMEOUT_SECONDS) > timestamp)
- {
- _dbus_verbose ("dropping/ignoring %ld-seconds old key with timestamp %ld as current time is %ld\n",
- now - timestamp, timestamp, now);
- continue;
- }
-
- _dbus_string_skip_blank (&line, next, &next);
-
- len = _dbus_string_get_length (&line);
-
- if ((len - next) == 0)
- {
- _dbus_verbose ("no secret key after ID and timestamp\n");
- continue;
- }
-
- /* We have all three parts */
- new = dbus_realloc (keys, sizeof (DBusKey) * (n_keys + 1));
- if (new == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- keys = new;
- n_keys += 1;
-
- if (!_dbus_string_init (&keys[n_keys-1].secret))
- {
- n_keys -= 1; /* we don't want to free the one we didn't init */
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- keys[n_keys-1].id = id;
- keys[n_keys-1].creation_time = timestamp;
- if (!_dbus_string_hex_decode (&line, next, &end,
- &keys[n_keys-1].secret, 0))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- if (_dbus_string_get_length (&line) != end)
- {
- _dbus_verbose ("invalid hex encoding in keyring file\n");
- _dbus_string_free (&keys[n_keys - 1].secret);
- n_keys -= 1;
- continue;
- }
- }
-
- _dbus_verbose ("Successfully loaded %d existing keys\n",
- n_keys);
-
- if (add_new)
- {
- if (!add_new_key (&keys, &n_keys, error))
- {
- _dbus_verbose ("Failed to generate new key: %s\n",
- error ? error->message : "(unknown)");
- goto out;
- }
-
- _dbus_string_set_length (&contents, 0);
-
- i = 0;
- while (i < n_keys)
- {
- if (!_dbus_string_append_int (&contents,
- keys[i].id))
- goto nomem;
-
- if (!_dbus_string_append_byte (&contents, ' '))
- goto nomem;
-
- if (!_dbus_string_append_int (&contents,
- keys[i].creation_time))
- goto nomem;
-
- if (!_dbus_string_append_byte (&contents, ' '))
- goto nomem;
-
- if (!_dbus_string_hex_encode (&keys[i].secret, 0,
- &contents,
- _dbus_string_get_length (&contents)))
- goto nomem;
-
- if (!_dbus_string_append_byte (&contents, '\n'))
- goto nomem;
-
- ++i;
- continue;
-
- nomem:
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto out;
- }
-
- if (!_dbus_string_save_to_file (&contents, &keyring->filename,
- FALSE, error))
- goto out;
- }
-
- if (keyring->keys)
- free_keys (keyring->keys, keyring->n_keys);
- keyring->keys = keys;
- keyring->n_keys = n_keys;
- keys = NULL;
- n_keys = 0;
-
- retval = TRUE;
-
- out:
- if (have_lock)
- _dbus_keyring_unlock (keyring);
-
- if (! ((retval == TRUE && (error == NULL || error->name == NULL)) ||
- (retval == FALSE && (error == NULL || error->name != NULL))))
- {
- if (error && error->name)
- _dbus_verbose ("error is %s: %s\n", error->name, error->message);
- _dbus_warn ("returning %d but error pointer %p name %s\n",
- retval, error, error->name ? error->name : "(none)");
- _dbus_assert_not_reached ("didn't handle errors properly");
- }
-
- if (keys != NULL)
- {
- i = 0;
- while (i < n_keys)
- {
- _dbus_string_zero (&keys[i].secret);
- _dbus_string_free (&keys[i].secret);
- ++i;
- }
-
- dbus_free (keys);
- }
-
- _dbus_string_free (&contents);
- _dbus_string_free (&line);
-
- return retval;
-}
-
-/** @} */ /* end of internals */
-
-/**
- * @addtogroup DBusKeyring
- *
- * @{
- */
-
-/**
- * Increments reference count of the keyring
- *
- * @param keyring the keyring
- * @returns the keyring
- */
-DBusKeyring *
-_dbus_keyring_ref (DBusKeyring *keyring)
-{
- keyring->refcount += 1;
-
- return keyring;
-}
-
-/**
- * Decrements refcount and finalizes if it reaches
- * zero.
- *
- * @param keyring the keyring
- */
-void
-_dbus_keyring_unref (DBusKeyring *keyring)
-{
- keyring->refcount -= 1;
-
- if (keyring->refcount == 0)
- {
- if (keyring->credentials)
- _dbus_credentials_unref (keyring->credentials);
-
- _dbus_string_free (&keyring->filename);
- _dbus_string_free (&keyring->filename_lock);
- _dbus_string_free (&keyring->directory);
- free_keys (keyring->keys, keyring->n_keys);
- dbus_free (keyring);
- }
-}
-
-/**
- * Creates a new keyring that lives in the ~/.dbus-keyrings directory
- * of the user represented by @p credentials. If the @p credentials are
- * #NULL or empty, uses those of the current process.
- *
- * @param credentials a set of credentials representing a user or #NULL
- * @param context which keyring to get
- * @param error return location for errors
- * @returns the keyring or #NULL on error
- */
-DBusKeyring*
-_dbus_keyring_new_for_credentials (DBusCredentials *credentials,
- const DBusString *context,
- DBusError *error)
-{
- DBusString ringdir;
- DBusKeyring *keyring;
- dbus_bool_t error_set;
- DBusError tmp_error;
- DBusCredentials *our_credentials;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (_dbus_check_setuid ())
- {
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to create DBus keyring when setuid");
- return NULL;
- }
-
- keyring = NULL;
- error_set = FALSE;
- our_credentials = NULL;
-
- if (!_dbus_string_init (&ringdir))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (credentials != NULL)
- {
- our_credentials = _dbus_credentials_copy (credentials);
- }
- else
- {
- our_credentials = _dbus_credentials_new_from_current_process ();
- }
-
- if (our_credentials == NULL)
- goto failed;
-
- if (_dbus_credentials_are_anonymous (our_credentials))
- {
- if (!_dbus_credentials_add_from_current_process (our_credentials))
- goto failed;
- }
-
- if (!_dbus_append_keyring_directory_for_credentials (&ringdir,
- our_credentials))
- goto failed;
-
- keyring = _dbus_keyring_new ();
- if (keyring == NULL)
- goto failed;
-
- _dbus_assert (keyring->credentials == NULL);
- keyring->credentials = our_credentials;
- our_credentials = NULL; /* so we don't unref it again later */
-
- /* should have been validated already, but paranoia check here */
- if (!_dbus_keyring_validate_context (context))
- {
- error_set = TRUE;
- dbus_set_error_const (error,
- DBUS_ERROR_FAILED,
- "Invalid context in keyring creation");
- goto failed;
- }
-
- /* Save keyring dir in the keyring object */
- if (!_dbus_string_copy (&ringdir, 0,
- &keyring->directory, 0))
- goto failed;
-
- /* Create keyring->filename based on keyring dir and context */
- if (!_dbus_string_copy (&keyring->directory, 0,
- &keyring->filename, 0))
- goto failed;
-
- if (!_dbus_concat_dir_and_file (&keyring->filename,
- context))
- goto failed;
-
- /* Create lockfile name */
- if (!_dbus_string_copy (&keyring->filename, 0,
- &keyring->filename_lock, 0))
- goto failed;
-
- if (!_dbus_string_append (&keyring->filename_lock, ".lock"))
- goto failed;
-
- /* Reload keyring */
- dbus_error_init (&tmp_error);
- if (!_dbus_keyring_reload (keyring, FALSE, &tmp_error))
- {
- _dbus_verbose ("didn't load an existing keyring: %s\n",
- tmp_error.message);
- dbus_error_free (&tmp_error);
- }
-
- /* We don't fail fatally if we can't create the directory,
- * but the keyring will probably always be empty
- * unless someone else manages to create it
- */
- dbus_error_init (&tmp_error);
- if (!_dbus_create_directory (&keyring->directory,
- &tmp_error))
- {
- _dbus_verbose ("Creating keyring directory: %s\n",
- tmp_error.message);
- dbus_error_free (&tmp_error);
- }
-
- _dbus_string_free (&ringdir);
-
- return keyring;
-
- failed:
- if (!error_set)
- dbus_set_error_const (error,
- DBUS_ERROR_NO_MEMORY,
- NULL);
- if (our_credentials)
- _dbus_credentials_unref (our_credentials);
- if (keyring)
- _dbus_keyring_unref (keyring);
- _dbus_string_free (&ringdir);
- return NULL;
-
-}
-
-/**
- * Checks whether the context is a valid context.
- * Contexts that might cause confusion when used
- * in filenames are not allowed (contexts can't
- * start with a dot or contain dir separators).
- *
- * @todo this is the most inefficient implementation
- * imaginable.
- *
- * @param context the context
- * @returns #TRUE if valid
- */
-dbus_bool_t
-_dbus_keyring_validate_context (const DBusString *context)
-{
- if (_dbus_string_get_length (context) == 0)
- {
- _dbus_verbose ("context is zero-length\n");
- return FALSE;
- }
-
- if (!_dbus_string_validate_ascii (context, 0,
- _dbus_string_get_length (context)))
- {
- _dbus_verbose ("context not valid ascii\n");
- return FALSE;
- }
-
- /* no directory separators */
- if (_dbus_string_find (context, 0, "/", NULL))
- {
- _dbus_verbose ("context contains a slash\n");
- return FALSE;
- }
-
- if (_dbus_string_find (context, 0, "\\", NULL))
- {
- _dbus_verbose ("context contains a backslash\n");
- return FALSE;
- }
-
- /* prevent attempts to use dotfiles or ".." or ".lock"
- * all of which might allow some kind of attack
- */
- if (_dbus_string_find (context, 0, ".", NULL))
- {
- _dbus_verbose ("context contains a dot\n");
- return FALSE;
- }
-
- /* no spaces/tabs, those are used for separators in the protocol */
- if (_dbus_string_find_blank (context, 0, NULL))
- {
- _dbus_verbose ("context contains a blank\n");
- return FALSE;
- }
-
- if (_dbus_string_find (context, 0, "\n", NULL))
- {
- _dbus_verbose ("context contains a newline\n");
- return FALSE;
- }
-
- if (_dbus_string_find (context, 0, "\r", NULL))
- {
- _dbus_verbose ("context contains a carriage return\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static DBusKey*
-find_recent_key (DBusKeyring *keyring)
-{
- int i;
- long tv_sec, tv_usec;
-
- _dbus_get_real_time (&tv_sec, &tv_usec);
-
- i = 0;
- while (i < keyring->n_keys)
- {
- DBusKey *key = &keyring->keys[i];
-
- _dbus_verbose ("Key %d is %ld seconds old\n",
- i, tv_sec - key->creation_time);
-
- if ((tv_sec - NEW_KEY_TIMEOUT_SECONDS) < key->creation_time)
- return key;
-
- ++i;
- }
-
- return NULL;
-}
-
-/**
- * Gets a recent key to use for authentication.
- * If no recent key exists, creates one. Returns
- * the key ID. If a key can't be written to the keyring
- * file so no recent key can be created, returns -1.
- * All valid keys are > 0.
- *
- * @param keyring the keyring
- * @param error error on failure
- * @returns key ID to use for auth, or -1 on failure
- */
-int
-_dbus_keyring_get_best_key (DBusKeyring *keyring,
- DBusError *error)
-{
- DBusKey *key;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- key = find_recent_key (keyring);
- if (key)
- return key->id;
-
- /* All our keys are too old, or we've never loaded the
- * keyring. Create a new one.
- */
- if (!_dbus_keyring_reload (keyring, TRUE,
- error))
- return -1;
-
- key = find_recent_key (keyring);
- if (key)
- return key->id;
- else
- {
- dbus_set_error_const (error,
- DBUS_ERROR_FAILED,
- "No recent-enough key found in keyring, and unable to create a new key");
- return -1;
- }
-}
-
-/**
- * Checks whether the keyring is for the same user as the given credentials.
- *
- * @param keyring the keyring
- * @param credentials the credentials to check
- *
- * @returns #TRUE if the keyring belongs to the given user
- */
-dbus_bool_t
-_dbus_keyring_is_for_credentials (DBusKeyring *keyring,
- DBusCredentials *credentials)
-{
- return _dbus_credentials_same_user (keyring->credentials,
- credentials);
-}
-
-/**
- * Gets the hex-encoded secret key for the given ID.
- * Returns #FALSE if not enough memory. Returns #TRUE
- * but empty key on any other error such as unknown
- * key ID.
- *
- * @param keyring the keyring
- * @param key_id the key ID
- * @param hex_key string to append hex-encoded key to
- * @returns #TRUE if we had enough memory
- */
-dbus_bool_t
-_dbus_keyring_get_hex_key (DBusKeyring *keyring,
- int key_id,
- DBusString *hex_key)
-{
- DBusKey *key;
-
- key = find_key_by_id (keyring->keys,
- keyring->n_keys,
- key_id);
- if (key == NULL)
- return TRUE; /* had enough memory, so TRUE */
-
- return _dbus_string_hex_encode (&key->secret, 0,
- hex_key,
- _dbus_string_get_length (hex_key));
-}
-
-/** @} */ /* end of exposed API */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-dbus_bool_t
-_dbus_keyring_test (void)
-{
- DBusString context;
- DBusKeyring *ring1;
- DBusKeyring *ring2;
- int id;
- DBusError error;
- int i;
-
- ring1 = NULL;
- ring2 = NULL;
-
- /* Context validation */
-
- _dbus_string_init_const (&context, "foo");
- _dbus_assert (_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "org_freedesktop_blah");
- _dbus_assert (_dbus_keyring_validate_context (&context));
-
- _dbus_string_init_const (&context, "");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, ".foo");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "bar.foo");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "bar/foo");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "bar\\foo");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "foo\xfa\xf0");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "foo\x80");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "foo\x7f");
- _dbus_assert (_dbus_keyring_validate_context (&context));
- _dbus_string_init_const (&context, "foo bar");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
-
- if (!_dbus_string_init (&context))
- _dbus_assert_not_reached ("no memory");
- if (!_dbus_string_append_byte (&context, '\0'))
- _dbus_assert_not_reached ("no memory");
- _dbus_assert (!_dbus_keyring_validate_context (&context));
- _dbus_string_free (&context);
-
- /* Now verify that if we create a key in keyring 1,
- * it is properly loaded in keyring 2
- */
-
- _dbus_string_init_const (&context, "org_freedesktop_dbus_testsuite");
- dbus_error_init (&error);
- ring1 = _dbus_keyring_new_for_credentials (NULL, &context,
- &error);
- _dbus_assert (ring1 != NULL);
- _dbus_assert (error.name == NULL);
-
- id = _dbus_keyring_get_best_key (ring1, &error);
- if (id < 0)
- {
- fprintf (stderr, "Could not load keyring: %s\n", error.message);
- dbus_error_free (&error);
- goto failure;
- }
-
- ring2 = _dbus_keyring_new_for_credentials (NULL, &context, &error);
- _dbus_assert (ring2 != NULL);
- _dbus_assert (error.name == NULL);
-
- if (ring1->n_keys != ring2->n_keys)
- {
- fprintf (stderr, "Different number of keys in keyrings\n");
- goto failure;
- }
-
- /* We guarantee we load and save keeping keys in a fixed
- * order
- */
- i = 0;
- while (i < ring1->n_keys)
- {
- if (ring1->keys[i].id != ring2->keys[i].id)
- {
- fprintf (stderr, "Keyring 1 has first key ID %d and keyring 2 has %d\n",
- ring1->keys[i].id, ring2->keys[i].id);
- goto failure;
- }
-
- if (ring1->keys[i].creation_time != ring2->keys[i].creation_time)
- {
- fprintf (stderr, "Keyring 1 has first key time %ld and keyring 2 has %ld\n",
- ring1->keys[i].creation_time, ring2->keys[i].creation_time);
- goto failure;
- }
-
- if (!_dbus_string_equal (&ring1->keys[i].secret,
- &ring2->keys[i].secret))
- {
- fprintf (stderr, "Keyrings 1 and 2 have different secrets for same ID/timestamp\n");
- goto failure;
- }
-
- ++i;
- }
-
- printf (" %d keys in test\n", ring1->n_keys);
-
- /* Test ref/unref */
- _dbus_keyring_ref (ring1);
- _dbus_keyring_ref (ring2);
- _dbus_keyring_unref (ring1);
- _dbus_keyring_unref (ring2);
-
-
- /* really unref */
- _dbus_keyring_unref (ring1);
- _dbus_keyring_unref (ring2);
-
- return TRUE;
-
- failure:
- if (ring1)
- _dbus_keyring_unref (ring1);
- if (ring2)
- _dbus_keyring_unref (ring2);
-
- return FALSE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.h
deleted file mode 100644
index 200e31bc40..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-keyring.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-keyring.h Store secret cookies in your homedir
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_KEYRING_H
-#define DBUS_KEYRING_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-credentials.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusKeyring DBusKeyring;
-
-DBusKeyring* _dbus_keyring_new_for_credentials (DBusCredentials *credentials,
- const DBusString *context,
- DBusError *error);
-DBusKeyring* _dbus_keyring_ref (DBusKeyring *keyring);
-void _dbus_keyring_unref (DBusKeyring *keyring);
-dbus_bool_t _dbus_keyring_validate_context (const DBusString *context);
-int _dbus_keyring_get_best_key (DBusKeyring *keyring,
- DBusError *error);
-dbus_bool_t _dbus_keyring_is_for_credentials (DBusKeyring *keyring,
- DBusCredentials *credentials);
-dbus_bool_t _dbus_keyring_get_hex_key (DBusKeyring *keyring,
- int key_id,
- DBusString *hex_key);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_KEYRING_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-list.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-list.c
deleted file mode 100644
index c4c1856f9f..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-list.c
+++ /dev/null
@@ -1,1350 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-list.c Generic linked list utility (internal to D-Bus implementation)
- *
- * Copyright (C) 2002 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-list.h"
-#include "dbus-mempool.h"
-#include "dbus-threads-internal.h"
-
-/**
- * @defgroup DBusList Linked list
- * @ingroup DBusInternals
- * @brief DBusList data structure
- *
- * Types and functions related to DBusList.
- */
-
-/* Protected by _DBUS_LOCK (list) */
-static DBusMemPool *list_pool;
-
-/**
- * @defgroup DBusListInternals Linked list implementation details
- * @ingroup DBusInternals
- * @brief DBusList implementation details
- *
- * The guts of DBusList.
- *
- * @{
- */
-
-/* the mem pool is probably a speed hit, with the thread
- * lock, though it does still save memory - unknown.
- */
-static DBusList*
-alloc_link (void *data)
-{
- DBusList *link;
-
- if (!_DBUS_LOCK (list))
- return FALSE;
-
- if (list_pool == NULL)
- {
- list_pool = _dbus_mem_pool_new (sizeof (DBusList), TRUE);
-
- if (list_pool == NULL)
- {
- _DBUS_UNLOCK (list);
- return NULL;
- }
-
- link = _dbus_mem_pool_alloc (list_pool);
- if (link == NULL)
- {
- _dbus_mem_pool_free (list_pool);
- list_pool = NULL;
- _DBUS_UNLOCK (list);
- return NULL;
- }
- }
- else
- {
- link = _dbus_mem_pool_alloc (list_pool);
- }
-
- if (link)
- link->data = data;
-
- _DBUS_UNLOCK (list);
-
- return link;
-}
-
-static void
-free_link (DBusList *link)
-{
- if (!_DBUS_LOCK (list))
- _dbus_assert_not_reached ("we should have initialized global locks "
- "before we allocated a linked-list link");
-
- if (_dbus_mem_pool_dealloc (list_pool, link))
- {
- _dbus_mem_pool_free (list_pool);
- list_pool = NULL;
- }
-
- _DBUS_UNLOCK (list);
-}
-
-static void
-link_before (DBusList **list,
- DBusList *before_this_link,
- DBusList *link)
-{
- if (*list == NULL)
- {
- link->prev = link;
- link->next = link;
- *list = link;
- }
- else
- {
- link->next = before_this_link;
- link->prev = before_this_link->prev;
- before_this_link->prev = link;
- link->prev->next = link;
-
- if (before_this_link == *list)
- *list = link;
- }
-}
-
-static void
-link_after (DBusList **list,
- DBusList *after_this_link,
- DBusList *link)
-{
- if (*list == NULL)
- {
- link->prev = link;
- link->next = link;
- *list = link;
- }
- else
- {
- link->prev = after_this_link;
- link->next = after_this_link->next;
- after_this_link->next = link;
- link->next->prev = link;
- }
-}
-
-#ifdef DBUS_ENABLE_STATS
-void
-_dbus_list_get_stats (dbus_uint32_t *in_use_p,
- dbus_uint32_t *in_free_list_p,
- dbus_uint32_t *allocated_p)
-{
- if (!_DBUS_LOCK (list))
- {
- *in_use_p = 0;
- *in_free_list_p = 0;
- *allocated_p = 0;
- return;
- }
-
- _dbus_mem_pool_get_stats (list_pool, in_use_p, in_free_list_p, allocated_p);
- _DBUS_UNLOCK (list);
-}
-#endif
-
-/** @} */
-
-/**
- * @addtogroup DBusList
- * @{
- */
-
-/**
- * @struct DBusList
- *
- * A node in a linked list.
- *
- * DBusList is a circular list; that is, the tail of the list
- * points back to the head of the list. The empty list is
- * represented by a #NULL pointer.
- */
-
-/**
- * @def _dbus_list_get_next_link
- *
- * Gets the next link in the list, or #NULL if
- * there are no more links. Used for iteration.
- *
- * @code
- * DBusList *link;
- * link = _dbus_list_get_first_link (&list);
- * while (link != NULL)
- * {
- * printf ("value is %p\n", link->data);
- * link = _dbus_list_get_next_link (&link);
- * }
- * @endcode
- *
- * @param list address of the list head.
- * @param link current link.
- * @returns the next link, or %NULL if none.
- *
- */
-
-/**
- * @def _dbus_list_get_prev_link
- *
- * Gets the previous link in the list, or #NULL if
- * there are no more links. Used for iteration.
- *
- * @code
- * DBusList *link;
- * link = _dbus_list_get_last_link (&list);
- * while (link != NULL)
- * {
- * printf ("value is %p\n", link->data);
- * link = _dbus_list_get_prev_link (&link);
- * }
- * @endcode
- *
- * @param list address of the list head.
- * @param link current link.
- * @returns the previous link, or %NULL if none.
- *
- */
-
-/**
- * Allocates a linked list node. Useful for preallocating
- * nodes and using _dbus_list_append_link() to avoid
- * allocations.
- *
- * @param data the value to store in the link.
- * @returns a newly allocated link.
- */
-DBusList*
-_dbus_list_alloc_link (void *data)
-{
- return alloc_link (data);
-}
-
-/**
- * Frees a linked list node allocated with _dbus_list_alloc_link.
- * Does not free the data in the node.
- *
- * @param link the list node
- */
-void
-_dbus_list_free_link (DBusList *link)
-{
- free_link (link);
-}
-
-
-/**
- * Appends a value to the list. May return #FALSE
- * if insufficient memory exists to add a list link.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @param data the value to append.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_list_append (DBusList **list,
- void *data)
-{
- if (!_dbus_list_prepend (list, data))
- return FALSE;
-
- /* Now cycle the list forward one so the prepended node is the tail */
- *list = (*list)->next;
-
- return TRUE;
-}
-
-/**
- * Prepends a value to the list. May return #FALSE
- * if insufficient memory exists to add a list link.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @param data the value to prepend.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_list_prepend (DBusList **list,
- void *data)
-{
- DBusList *link;
-
- link = alloc_link (data);
- if (link == NULL)
- return FALSE;
-
- link_before (list, *list, link);
-
- return TRUE;
-}
-
-/**
- * Appends a link to the list.
- * Cannot fail due to out of memory.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @param link the link to append.
- */
-void
-_dbus_list_append_link (DBusList **list,
- DBusList *link)
-{
- _dbus_list_prepend_link (list, link);
-
- /* Now cycle the list forward one so the prepended node is the tail */
- *list = (*list)->next;
-}
-
-/**
- * Prepends a link to the list.
- * Cannot fail due to out of memory.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @param link the link to prepend.
- */
-void
-_dbus_list_prepend_link (DBusList **list,
- DBusList *link)
-{
- link_before (list, *list, link);
-}
-
-/**
- * Inserts data into the list after the given existing link.
- *
- * @param list the list to modify
- * @param after_this_link existing link to insert after, or #NULL to prepend
- * @param data the value to insert
- * @returns #TRUE on success, #FALSE if memory allocation fails
- */
-dbus_bool_t
-_dbus_list_insert_after (DBusList **list,
- DBusList *after_this_link,
- void *data)
-{
- DBusList *link;
-
- if (after_this_link == NULL)
- return _dbus_list_prepend (list, data);
- else
- {
- link = alloc_link (data);
- if (link == NULL)
- return FALSE;
-
- link_after (list, after_this_link, link);
- }
-
- return TRUE;
-}
-
-/**
- * Inserts a link into the list before the given existing link.
- *
- * @param list the list to modify
- * @param before_this_link existing link to insert before, or #NULL to append
- * @param link the link to insert
- */
-void
-_dbus_list_insert_before_link (DBusList **list,
- DBusList *before_this_link,
- DBusList *link)
-{
- if (before_this_link == NULL)
- _dbus_list_append_link (list, link);
- else
- link_before (list, before_this_link, link);
-}
-
-/**
- * Inserts a link into the list after the given existing link.
- *
- * @param list the list to modify
- * @param after_this_link existing link to insert after, or #NULL to prepend
- * @param link the link to insert
- */
-void
-_dbus_list_insert_after_link (DBusList **list,
- DBusList *after_this_link,
- DBusList *link)
-{
- if (after_this_link == NULL)
- _dbus_list_prepend_link (list, link);
- else
- link_after (list, after_this_link, link);
-}
-
-/**
- * Removes a value from the list. Only removes the
- * first value equal to the given data pointer,
- * even if multiple values exist which match.
- * This is a linear-time operation.
- *
- * @param list address of the list head.
- * @param data the value to remove.
- * @returns #TRUE if a value was found to remove.
- */
-dbus_bool_t
-_dbus_list_remove (DBusList **list,
- void *data)
-{
- DBusList *link;
-
- link = *list;
- while (link != NULL)
- {
- if (link->data == data)
- {
- _dbus_list_remove_link (list, link);
- return TRUE;
- }
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return FALSE;
-}
-
-/**
- * Removes a value from the list. Only removes the
- * last value equal to the given data pointer,
- * even if multiple values exist which match.
- * This is a linear-time operation.
- *
- * @param list address of the list head.
- * @param data the value to remove.
- * @returns #TRUE if a value was found to remove.
- */
-dbus_bool_t
-_dbus_list_remove_last (DBusList **list,
- void *data)
-{
- DBusList *link;
-
- link = _dbus_list_find_last (list, data);
- if (link)
- {
- _dbus_list_remove_link (list, link);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * Finds a value in the list. Returns the last link
- * with value equal to the given data pointer.
- * This is a linear-time operation.
- * Returns #NULL if no value found that matches.
- *
- * @param list address of the list head.
- * @param data the value to find.
- * @returns the link if found
- */
-DBusList*
-_dbus_list_find_last (DBusList **list,
- void *data)
-{
- DBusList *link;
-
- link = _dbus_list_get_last_link (list);
-
- while (link != NULL)
- {
- if (link->data == data)
- return link;
-
- link = _dbus_list_get_prev_link (list, link);
- }
-
- return NULL;
-}
-
-/**
- * Removes the given link from the list, but doesn't
- * free it. _dbus_list_remove_link() both removes the
- * link and also frees it.
- *
- * @param list the list
- * @param link the link in the list
- */
-void
-_dbus_list_unlink (DBusList **list,
- DBusList *link)
-{
- if (link->next == link)
- {
- /* one-element list */
- *list = NULL;
- }
- else
- {
- link->prev->next = link->next;
- link->next->prev = link->prev;
-
- if (*list == link)
- *list = link->next;
- }
-
- link->next = NULL;
- link->prev = NULL;
-}
-
-/**
- * Removes a link from the list. This is a constant-time operation.
- *
- * @param list address of the list head.
- * @param link the list link to remove.
- */
-void
-_dbus_list_remove_link (DBusList **list,
- DBusList *link)
-{
- _dbus_list_unlink (list, link);
- free_link (link);
-}
-
-/**
- * Frees all links in the list and sets the list head to #NULL. Does
- * not free the data in each link, for obvious reasons. This is a
- * linear-time operation.
- *
- * @param list address of the list head.
- */
-void
-_dbus_list_clear (DBusList **list)
-{
- DBusList *link;
-
- link = *list;
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (list, link);
-
- free_link (link);
-
- link = next;
- }
-
- *list = NULL;
-}
-
-/**
- * Gets the first link in the list.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @returns the first link, or #NULL for an empty list.
- */
-DBusList*
-_dbus_list_get_first_link (DBusList **list)
-{
- return *list;
-}
-
-/**
- * Gets the last link in the list.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @returns the last link, or #NULL for an empty list.
- */
-DBusList*
-_dbus_list_get_last_link (DBusList **list)
-{
- if (*list == NULL)
- return NULL;
- else
- return (*list)->prev;
-}
-
-/**
- * Gets the last data in the list.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @returns the last data in the list, or #NULL for an empty list.
- */
-void*
-_dbus_list_get_last (DBusList **list)
-{
- if (*list == NULL)
- return NULL;
- else
- return (*list)->prev->data;
-}
-
-/**
- * Gets the first data in the list.
- * This is a constant-time operation.
- *
- * @param list address of the list head.
- * @returns the first data in the list, or #NULL for an empty list.
- */
-void*
-_dbus_list_get_first (DBusList **list)
-{
- if (*list == NULL)
- return NULL;
- else
- return (*list)->data;
-}
-
-/**
- * Removes the first link in the list and returns it. This is a
- * constant-time operation.
- *
- * @param list address of the list head.
- * @returns the first link in the list, or #NULL for an empty list.
- */
-DBusList*
-_dbus_list_pop_first_link (DBusList **list)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (list);
- if (link == NULL)
- return NULL;
-
- _dbus_list_unlink (list, link);
-
- return link;
-}
-
-/**
- * Removes the first value in the list and returns it. This is a
- * constant-time operation.
- *
- * @param list address of the list head.
- * @returns the first data in the list, or #NULL for an empty list.
- */
-void*
-_dbus_list_pop_first (DBusList **list)
-{
- DBusList *link;
- void *data;
-
- link = _dbus_list_get_first_link (list);
- if (link == NULL)
- return NULL;
-
- data = link->data;
- _dbus_list_remove_link (list, link);
-
- return data;
-}
-
-/**
- * Removes the last value in the list and returns it. This is a
- * constant-time operation.
- *
- * @param list address of the list head.
- * @returns the last data in the list, or #NULL for an empty list.
- */
-void*
-_dbus_list_pop_last (DBusList **list)
-{
- DBusList *link;
- void *data;
-
- link = _dbus_list_get_last_link (list);
- if (link == NULL)
- return NULL;
-
- data = link->data;
- _dbus_list_remove_link (list, link);
-
- return data;
-}
-
-/**
- * Copies a list. This is a linear-time operation. If there isn't
- * enough memory to copy the entire list, the destination list will be
- * set to #NULL.
- *
- * @param list address of the head of the list to copy.
- * @param dest address where the copied list should be placed.
- * @returns #TRUE on success, #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_list_copy (DBusList **list,
- DBusList **dest)
-{
- DBusList *link;
-
- _dbus_assert (list != dest);
-
- *dest = NULL;
-
- link = *list;
- while (link != NULL)
- {
- if (!_dbus_list_append (dest, link->data))
- {
- /* free what we have so far */
- _dbus_list_clear (dest);
- return FALSE;
- }
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return TRUE;
-}
-
-/**
- * Gets the length of a list. This is a linear-time
- * operation.
- *
- * @param list address of the head of the list
- * @returns number of elements in the list.
- */
-int
-_dbus_list_get_length (DBusList **list)
-{
- DBusList *link;
- int length;
-
- length = 0;
-
- link = *list;
- while (link != NULL)
- {
- ++length;
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return length;
-}
-
-/**
- * Calls the given function for each element in the list. The
- * function is passed the list element as its first argument, and the
- * given data as its second argument.
- *
- * @param list address of the head of the list.
- * @param function function to call for each element.
- * @param data extra data for the function.
- *
- */
-void
-_dbus_list_foreach (DBusList **list,
- DBusForeachFunction function,
- void *data)
-{
- DBusList *link;
-
- link = *list;
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (list, link);
-
- (* function) (link->data, data);
-
- link = next;
- }
-}
-
-/**
- * Check whether length is exactly one.
- *
- * @param list the list
- * @returns #TRUE if length is exactly one
- */
-dbus_bool_t
-_dbus_list_length_is_one (DBusList **list)
-{
- return (*list != NULL &&
- (*list)->next == *list);
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-static void
-verify_list (DBusList **list)
-{
- DBusList *link;
- int length;
-
- link = *list;
-
- if (link == NULL)
- return;
-
- if (link->next == link)
- {
- _dbus_assert (link->prev == link);
- _dbus_assert (*list == link);
- return;
- }
-
- length = 0;
- do
- {
- length += 1;
- _dbus_assert (link->prev->next == link);
- _dbus_assert (link->next->prev == link);
- link = link->next;
- }
- while (link != *list);
-
- _dbus_assert (length == _dbus_list_get_length (list));
-
- if (length == 1)
- _dbus_assert (_dbus_list_length_is_one (list));
- else
- _dbus_assert (!_dbus_list_length_is_one (list));
-}
-
-static dbus_bool_t
-is_ascending_sequence (DBusList **list)
-{
- DBusList *link;
- int prev;
-
- prev = _DBUS_INT_MIN;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- int v = _DBUS_POINTER_TO_INT (link->data);
-
- if (v <= prev)
- return FALSE;
-
- prev = v;
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-is_descending_sequence (DBusList **list)
-{
- DBusList *link;
- int prev;
-
- prev = _DBUS_INT_MAX;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- int v = _DBUS_POINTER_TO_INT (link->data);
-
- if (v >= prev)
- return FALSE;
-
- prev = v;
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-all_even_values (DBusList **list)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- int v = _DBUS_POINTER_TO_INT (link->data);
-
- if ((v % 2) != 0)
- return FALSE;
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-all_odd_values (DBusList **list)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (list);
- while (link != NULL)
- {
- int v = _DBUS_POINTER_TO_INT (link->data);
-
- if ((v % 2) == 0)
- return FALSE;
-
- link = _dbus_list_get_next_link (list, link);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-lists_equal (DBusList **list1,
- DBusList **list2)
-{
- DBusList *link1;
- DBusList *link2;
-
- link1 = _dbus_list_get_first_link (list1);
- link2 = _dbus_list_get_first_link (list2);
- while (link1 && link2)
- {
- if (link1->data != link2->data)
- return FALSE;
-
- link1 = _dbus_list_get_next_link (list1, link1);
- link2 = _dbus_list_get_next_link (list2, link2);
- }
-
- if (link1 || link2)
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * @ingroup DBusListInternals
- * Unit test for DBusList
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_list_test (void)
-{
- DBusList *list1;
- DBusList *list2;
- DBusList *link1;
- DBusList *link2;
- DBusList *copy1;
- DBusList *copy2;
- int i;
-
- list1 = NULL;
- list2 = NULL;
-
- /* Test append and prepend */
-
- i = 0;
- while (i < 10)
- {
- if (!_dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("could not allocate for append");
-
- if (!_dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("count not allocate for prepend");
- ++i;
-
- verify_list (&list1);
- verify_list (&list2);
-
- _dbus_assert (_dbus_list_get_length (&list1) == i);
- _dbus_assert (_dbus_list_get_length (&list2) == i);
- }
-
- _dbus_assert (is_ascending_sequence (&list1));
- _dbus_assert (is_descending_sequence (&list2));
-
- /* Test list clear */
- _dbus_list_clear (&list1);
- _dbus_list_clear (&list2);
-
- verify_list (&list1);
- verify_list (&list2);
-
- /* Test get_first, get_last, pop_first, pop_last */
-
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- void *got_data1;
- void *got_data2;
-
- void *data1;
- void *data2;
-
- got_data1 = _dbus_list_get_last (&list1);
- got_data2 = _dbus_list_get_first (&list2);
-
- data1 = _dbus_list_pop_last (&list1);
- data2 = _dbus_list_pop_first (&list2);
-
- _dbus_assert (got_data1 == data1);
- _dbus_assert (got_data2 == data2);
-
- _dbus_assert (_DBUS_POINTER_TO_INT (data1) == i);
- _dbus_assert (_DBUS_POINTER_TO_INT (data2) == i);
-
- verify_list (&list1);
- verify_list (&list2);
-
- _dbus_assert (is_ascending_sequence (&list1));
- _dbus_assert (is_descending_sequence (&list2));
-
- --i;
- }
-
- _dbus_assert (list1 == NULL);
- _dbus_assert (list2 == NULL);
-
- /* Test get_first_link, get_last_link, pop_first_link, pop_last_link */
-
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- DBusList *got_link1;
- DBusList *got_link2;
-
- DBusList *link2;
-
- void *data1_indirect;
- void *data1;
- void *data2;
-
- got_link1 = _dbus_list_get_last_link (&list1);
- got_link2 = _dbus_list_get_first_link (&list2);
-
- link2 = _dbus_list_pop_first_link (&list2);
-
- _dbus_assert (got_link2 == link2);
-
- data1_indirect = got_link1->data;
- /* this call makes got_link1 invalid */
- data1 = _dbus_list_pop_last (&list1);
- _dbus_assert (data1 == data1_indirect);
- data2 = link2->data;
-
- _dbus_list_free_link (link2);
-
- _dbus_assert (_DBUS_POINTER_TO_INT (data1) == i);
- _dbus_assert (_DBUS_POINTER_TO_INT (data2) == i);
-
- verify_list (&list1);
- verify_list (&list2);
-
- _dbus_assert (is_ascending_sequence (&list1));
- _dbus_assert (is_descending_sequence (&list2));
-
- --i;
- }
-
- _dbus_assert (list1 == NULL);
- _dbus_assert (list2 == NULL);
-
- /* Test iteration */
-
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
-
- verify_list (&list1);
- verify_list (&list2);
-
- _dbus_assert (_dbus_list_get_length (&list1) == i);
- _dbus_assert (_dbus_list_get_length (&list2) == i);
- }
-
- _dbus_assert (is_ascending_sequence (&list1));
- _dbus_assert (is_descending_sequence (&list2));
-
- --i;
- link2 = _dbus_list_get_first_link (&list2);
- while (link2 != NULL)
- {
- verify_list (&link2); /* pretend this link is the head */
-
- _dbus_assert (_DBUS_POINTER_TO_INT (link2->data) == i);
-
- link2 = _dbus_list_get_next_link (&list2, link2);
- --i;
- }
-
- i = 0;
- link1 = _dbus_list_get_first_link (&list1);
- while (link1 != NULL)
- {
- verify_list (&link1); /* pretend this link is the head */
-
- _dbus_assert (_DBUS_POINTER_TO_INT (link1->data) == i);
-
- link1 = _dbus_list_get_next_link (&list1, link1);
- ++i;
- }
-
- --i;
- link1 = _dbus_list_get_last_link (&list1);
- while (link1 != NULL)
- {
- verify_list (&link1); /* pretend this link is the head */
-
- _dbus_assert (_DBUS_POINTER_TO_INT (link1->data) == i);
-
- link1 = _dbus_list_get_prev_link (&list1, link1);
- --i;
- }
-
- _dbus_list_clear (&list1);
- _dbus_list_clear (&list2);
-
- /* Test remove */
-
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- if ((i % 2) == 0)
- {
- if (!_dbus_list_remove (&list1, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("element should have been in list");
- if (!_dbus_list_remove (&list2, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("element should have been in list");
-
- verify_list (&list1);
- verify_list (&list2);
- }
- --i;
- }
-
- _dbus_assert (all_odd_values (&list1));
- _dbus_assert (all_odd_values (&list2));
-
- _dbus_list_clear (&list1);
- _dbus_list_clear (&list2);
-
- /* test removing the other half of the elements */
-
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- --i;
- while (i >= 0)
- {
- if ((i % 2) != 0)
- {
- if (!_dbus_list_remove (&list1, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("element should have been in list");
- if (!_dbus_list_remove (&list2, _DBUS_INT_TO_POINTER (i)))
- _dbus_assert_not_reached ("element should have been in list");
-
- verify_list (&list1);
- verify_list (&list2);
- }
- --i;
- }
-
- _dbus_assert (all_even_values (&list1));
- _dbus_assert (all_even_values (&list2));
-
- /* clear list using remove_link */
- while (list1 != NULL)
- {
- _dbus_list_remove_link (&list1, list1);
- verify_list (&list1);
- }
- while (list2 != NULL)
- {
- _dbus_list_remove_link (&list2, list2);
- verify_list (&list2);
- }
-
- /* Test remove link more generally */
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- --i;
- link2 = _dbus_list_get_first_link (&list2);
- while (link2 != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&list2, link2);
-
- _dbus_assert (_DBUS_POINTER_TO_INT (link2->data) == i);
-
- if ((i % 2) == 0)
- _dbus_list_remove_link (&list2, link2);
-
- verify_list (&list2);
-
- link2 = next;
- --i;
- }
-
- _dbus_assert (all_odd_values (&list2));
- _dbus_list_clear (&list2);
-
- i = 0;
- link1 = _dbus_list_get_first_link (&list1);
- while (link1 != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&list1, link1);
-
- _dbus_assert (_DBUS_POINTER_TO_INT (link1->data) == i);
-
- if ((i % 2) != 0)
- _dbus_list_remove_link (&list1, link1);
-
- verify_list (&list1);
-
- link1 = next;
- ++i;
- }
-
- _dbus_assert (all_even_values (&list1));
- _dbus_list_clear (&list1);
-
- /* Test copying a list */
- i = 0;
- while (i < 10)
- {
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (i));
- _dbus_list_prepend (&list2, _DBUS_INT_TO_POINTER (i));
- ++i;
- }
-
- /* bad pointers, because they are allowed in the copy dest */
- copy1 = _DBUS_INT_TO_POINTER (0x342234);
- copy2 = _DBUS_INT_TO_POINTER (23);
-
- _dbus_list_copy (&list1, &copy1);
- verify_list (&list1);
- verify_list (&copy1);
- _dbus_assert (lists_equal (&list1, &copy1));
-
- _dbus_list_copy (&list2, &copy2);
- verify_list (&list2);
- verify_list (&copy2);
- _dbus_assert (lists_equal (&list2, &copy2));
-
- /* Now test copying empty lists */
- _dbus_list_clear (&list1);
- _dbus_list_clear (&list2);
- _dbus_list_clear (&copy1);
- _dbus_list_clear (&copy2);
-
- /* bad pointers, because they are allowed in the copy dest */
- copy1 = _DBUS_INT_TO_POINTER (0x342234);
- copy2 = _DBUS_INT_TO_POINTER (23);
-
- _dbus_list_copy (&list1, &copy1);
- verify_list (&list1);
- verify_list (&copy1);
- _dbus_assert (lists_equal (&list1, &copy1));
-
- _dbus_list_copy (&list2, &copy2);
- verify_list (&list2);
- verify_list (&copy2);
- _dbus_assert (lists_equal (&list2, &copy2));
-
- _dbus_list_clear (&list1);
- _dbus_list_clear (&list2);
-
- /* insert_after on empty list */
- _dbus_list_insert_after (&list1, NULL,
- _DBUS_INT_TO_POINTER (0));
- verify_list (&list1);
-
- /* inserting after first element */
- _dbus_list_insert_after (&list1, list1,
- _DBUS_INT_TO_POINTER (1));
- verify_list (&list1);
- _dbus_assert (is_ascending_sequence (&list1));
-
- /* inserting at the end */
- _dbus_list_insert_after (&list1, list1->next,
- _DBUS_INT_TO_POINTER (2));
- verify_list (&list1);
- _dbus_assert (is_ascending_sequence (&list1));
-
- /* using insert_after to prepend */
- _dbus_list_insert_after (&list1, NULL,
- _DBUS_INT_TO_POINTER (-1));
- verify_list (&list1);
- _dbus_assert (is_ascending_sequence (&list1));
-
- _dbus_list_clear (&list1);
-
- /* using remove_last */
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (2));
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (1));
- _dbus_list_append (&list1, _DBUS_INT_TO_POINTER (3));
-
- _dbus_list_remove_last (&list1, _DBUS_INT_TO_POINTER (2));
-
- verify_list (&list1);
- _dbus_assert (is_ascending_sequence (&list1));
-
- _dbus_list_clear (&list1);
-
- return TRUE;
-}
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-list.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-list.h
deleted file mode 100644
index 910d738387..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-list.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-list.h Generic linked list utility (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_LIST_H
-#define DBUS_LIST_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-sysdeps.h>
-
-DBUS_BEGIN_DECLS
-
-struct DBusList
-{
- DBusList *prev; /**< Previous list node. */
- DBusList *next; /**< Next list node. */
- void *data; /**< Data stored at this element. */
-};
-dbus_bool_t _dbus_list_append (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_prepend (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_insert_before (DBusList **list,
- DBusList *before_this_link,
- void *data);
-dbus_bool_t _dbus_list_insert_after (DBusList **list,
- DBusList *after_this_link,
- void *data);
-void _dbus_list_insert_before_link (DBusList **list,
- DBusList *before_this_link,
- DBusList *link);
-void _dbus_list_insert_after_link (DBusList **list,
- DBusList *after_this_link,
- DBusList *link);
-dbus_bool_t _dbus_list_remove (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_remove_last (DBusList **list,
- void *data);
-void _dbus_list_remove_link (DBusList **list,
- DBusList *link);
-DBusList* _dbus_list_find_last (DBusList **list,
- void *data);
-void _dbus_list_clear (DBusList **list);
-DBusList* _dbus_list_get_first_link (DBusList **list);
-DBusList* _dbus_list_get_last_link (DBusList **list);
-void* _dbus_list_get_last (DBusList **list);
-void* _dbus_list_get_first (DBusList **list);
-void* _dbus_list_pop_first (DBusList **list);
-void* _dbus_list_pop_last (DBusList **list);
-DBusList* _dbus_list_pop_first_link (DBusList **list);
-dbus_bool_t _dbus_list_copy (DBusList **list,
- DBusList **dest);
-int _dbus_list_get_length (DBusList **list);
-DBusList* _dbus_list_alloc_link (void *data);
-void _dbus_list_free_link (DBusList *link);
-void _dbus_list_unlink (DBusList **list,
- DBusList *link);
-void _dbus_list_append_link (DBusList **list,
- DBusList *link);
-void _dbus_list_prepend_link (DBusList **list,
- DBusList *link);
-dbus_bool_t _dbus_list_length_is_one (DBusList **list);
-
-
-void _dbus_list_foreach (DBusList **list,
- DBusForeachFunction function,
- void *data);
-
-#define _dbus_list_get_next_link(list, link) ((link)->next == *(list) ? NULL : (link)->next)
-#define _dbus_list_get_prev_link(list, link) ((link) == *(list) ? NULL : (link)->prev)
-
-/* if DBUS_ENABLE_STATS */
-void _dbus_list_get_stats (dbus_uint32_t *in_use_p,
- dbus_uint32_t *in_free_list_p,
- dbus_uint32_t *allocated_p);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_LIST_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-macros.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-macros.h
deleted file mode 100644
index cae4100e46..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-macros.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-macros.h generic macros
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_MACROS_H
-#define DBUS_MACROS_H
-
-#ifdef __cplusplus
-# define DBUS_BEGIN_DECLS extern "C" {
-# define DBUS_END_DECLS }
-#else
-# define DBUS_BEGIN_DECLS
-# define DBUS_END_DECLS
-#endif
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-#ifndef NULL
-# ifdef __cplusplus
-# define NULL (0L)
-# else /* !__cplusplus */
-# define NULL ((void*) 0)
-# endif /* !__cplusplus */
-#endif
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-# define DBUS_DEPRECATED __attribute__ ((__deprecated__))
-#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
-# define DBUS_DEPRECATED __declspec(deprecated)
-#else
-# define DBUS_DEPRECATED
-#endif
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-# define _DBUS_GNUC_EXTENSION __extension__
-#else
-# define _DBUS_GNUC_EXTENSION
-#endif
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
-#define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \
- __attribute__((__format__ (__printf__, format_idx, arg_idx)))
-#define _DBUS_GNUC_NORETURN \
- __attribute__((__noreturn__))
-#else /* !__GNUC__ */
-#define _DBUS_GNUC_PRINTF( format_idx, arg_idx )
-#define _DBUS_GNUC_NORETURN
-#endif /* !__GNUC__ */
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-#define DBUS_MALLOC __attribute__((__malloc__))
-#else
-#define DBUS_MALLOC
-#endif
-
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-#define DBUS_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
-#define DBUS_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
-#else
-#define DBUS_ALLOC_SIZE(x)
-#define DBUS_ALLOC_SIZE2(x,y)
-#endif
-
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#define _DBUS_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-#else
-#define _DBUS_GNUC_WARN_UNUSED_RESULT
-#endif
-
-/** @def _DBUS_GNUC_PRINTF
- * used to tell gcc about printf format strings
- */
-/** @def _DBUS_GNUC_NORETURN
- * used to tell gcc about functions that never return, such as _dbus_abort()
- */
-/** @def _DBUS_GNUC_WARN_UNUSED_RESULT
- * used to tell gcc about functions whose result must be used
- */
-
-/* Normally docs are in .c files, but there isn't a .c file for this. */
-/**
- * @defgroup DBusMacros Utility macros
- * @ingroup DBus
- * @brief #TRUE, #FALSE, #NULL, and so on
- *
- * Utility macros.
- *
- * @{
- */
-
-/**
- * @def DBUS_BEGIN_DECLS
- *
- * Macro used prior to declaring functions in the D-Bus header
- * files. Expands to "extern "C"" when using a C++ compiler,
- * and expands to nothing when using a C compiler.
- *
- * Please don't use this in your own code, consider it
- * D-Bus internal.
- */
-/**
- * @def DBUS_END_DECLS
- *
- * Macro used after declaring functions in the D-Bus header
- * files. Expands to "}" when using a C++ compiler,
- * and expands to nothing when using a C compiler.
- *
- * Please don't use this in your own code, consider it
- * D-Bus internal.
- */
-/**
- * @def TRUE
- *
- * Expands to "1"
- */
-/**
- * @def FALSE
- *
- * Expands to "0"
- */
-/**
- * @def NULL
- *
- * A null pointer, defined appropriately for C or C++.
- */
-/**
- * @def DBUS_DEPRECATED
- *
- * Tells the compiler to warn about a function or type if it's used.
- * Code marked in this way should also be enclosed in
- * @code
- * #ifndef DBUS_DISABLE_DEPRECATED
- * deprecated stuff here
- * #endif
- * @endcode
- *
- * Please don't use this in your own code, consider it
- * D-Bus internal.
- */
-/**
- * @def _DBUS_GNUC_EXTENSION
- *
- * Tells gcc not to warn about extensions to the C standard in the
- * following expression, even if compiling with -pedantic. Do not use
- * this macro in your own code; please consider it to be internal to libdbus.
- */
-
-/*
- * @def DBUS_EXPORT
- *
- * Declare the following symbol as public. This is currently a noop on
- * platforms other than Windows.
- */
-
-#if defined(_WIN32)
-# if defined(DBUS_STATIC_BUILD)
-# define DBUS_EXPORT
-# elif defined(dbus_1_EXPORTS)
-# define DBUS_EXPORT __declspec(dllexport)
-# else
-# define DBUS_EXPORT __declspec(dllimport)
-# endif
-#else
-#define DBUS_EXPORT
-#endif
-
-/** @} */
-
-#endif /* DBUS_MACROS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.c
deleted file mode 100644
index 7ff9dc2c78..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.c
+++ /dev/null
@@ -1,919 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-mainloop.c Main loop utility
- *
- * Copyright © 2003, 2004 Red Hat, Inc.
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-mainloop.h"
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include <dbus/dbus-hash.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-socket-set.h>
-#include <dbus/dbus-watch.h>
-
-#define MAINLOOP_SPEW 0
-
-struct DBusLoop
-{
- int refcount;
- /** fd => dbus_malloc'd DBusList ** of references to DBusWatch */
- DBusHashTable *watches;
- DBusSocketSet *socket_set;
- DBusList *timeouts;
- int callback_list_serial;
- int watch_count;
- int timeout_count;
- int depth; /**< number of recursive runs */
- DBusList *need_dispatch;
- /** TRUE if we will skip a watch next time because it was OOM; becomes
- * FALSE between polling, and dealing with the results of the poll */
- unsigned oom_watch_pending : 1;
-};
-
-typedef struct
-{
- DBusTimeout *timeout;
- unsigned long last_tv_sec;
- unsigned long last_tv_usec;
-} TimeoutCallback;
-
-#define TIMEOUT_CALLBACK(callback) ((TimeoutCallback*)callback)
-
-static TimeoutCallback*
-timeout_callback_new (DBusTimeout *timeout)
-{
- TimeoutCallback *cb;
-
- cb = dbus_new (TimeoutCallback, 1);
- if (cb == NULL)
- return NULL;
-
- cb->timeout = timeout;
- _dbus_get_monotonic_time (&cb->last_tv_sec,
- &cb->last_tv_usec);
- return cb;
-}
-
-static void
-timeout_callback_free (TimeoutCallback *cb)
-{
- dbus_free (cb);
-}
-
-static void
-free_watch_table_entry (void *data)
-{
- DBusList **watches = data;
- DBusWatch *watch;
-
- /* DBusHashTable sometimes calls free_function(NULL) even if you never
- * have NULL as a value */
- if (watches == NULL)
- return;
-
- for (watch = _dbus_list_pop_first (watches);
- watch != NULL;
- watch = _dbus_list_pop_first (watches))
- {
- _dbus_watch_unref (watch);
- }
-
- _dbus_assert (*watches == NULL);
- dbus_free (watches);
-}
-
-DBusLoop*
-_dbus_loop_new (void)
-{
- DBusLoop *loop;
-
- loop = dbus_new0 (DBusLoop, 1);
- if (loop == NULL)
- return NULL;
-
- loop->watches = _dbus_hash_table_new (DBUS_HASH_INT, NULL,
- free_watch_table_entry);
-
- loop->socket_set = _dbus_socket_set_new (0);
-
- if (loop->watches == NULL || loop->socket_set == NULL)
- {
- if (loop->watches != NULL)
- _dbus_hash_table_unref (loop->watches);
-
- if (loop->socket_set != NULL)
- _dbus_socket_set_free (loop->socket_set);
-
- dbus_free (loop);
- return NULL;
- }
-
- loop->refcount = 1;
-
- return loop;
-}
-
-DBusLoop *
-_dbus_loop_ref (DBusLoop *loop)
-{
- _dbus_assert (loop != NULL);
- _dbus_assert (loop->refcount > 0);
-
- loop->refcount += 1;
-
- return loop;
-}
-
-void
-_dbus_loop_unref (DBusLoop *loop)
-{
- _dbus_assert (loop != NULL);
- _dbus_assert (loop->refcount > 0);
-
- loop->refcount -= 1;
- if (loop->refcount == 0)
- {
- while (loop->need_dispatch)
- {
- DBusConnection *connection = _dbus_list_pop_first (&loop->need_dispatch);
-
- dbus_connection_unref (connection);
- }
-
- _dbus_hash_table_unref (loop->watches);
- _dbus_socket_set_free (loop->socket_set);
- dbus_free (loop);
- }
-}
-
-static DBusList **
-ensure_watch_table_entry (DBusLoop *loop,
- int fd)
-{
- DBusList **watches;
-
- watches = _dbus_hash_table_lookup_int (loop->watches, fd);
-
- if (watches == NULL)
- {
- watches = dbus_new0 (DBusList *, 1);
-
- if (watches == NULL)
- return watches;
-
- if (!_dbus_hash_table_insert_int (loop->watches, fd, watches))
- {
- dbus_free (watches);
- watches = NULL;
- }
- }
-
- return watches;
-}
-
-static void
-cull_watches_for_invalid_fd (DBusLoop *loop,
- int fd)
-{
- DBusList *link;
- DBusList **watches;
-
- _dbus_warn ("invalid request, socket fd %d not open\n", fd);
- watches = _dbus_hash_table_lookup_int (loop->watches, fd);
-
- if (watches != NULL)
- {
- for (link = _dbus_list_get_first_link (watches);
- link != NULL;
- link = _dbus_list_get_next_link (watches, link))
- _dbus_watch_invalidate (link->data);
- }
-
- _dbus_hash_table_remove_int (loop->watches, fd);
-}
-
-static dbus_bool_t
-gc_watch_table_entry (DBusLoop *loop,
- DBusList **watches,
- int fd)
-{
- /* If watches is already NULL we have nothing to do */
- if (watches == NULL)
- return FALSE;
-
- /* We can't GC hash table entries if they're non-empty lists */
- if (*watches != NULL)
- return FALSE;
-
- _dbus_hash_table_remove_int (loop->watches, fd);
- return TRUE;
-}
-
-static void
-refresh_watches_for_fd (DBusLoop *loop,
- DBusList **watches,
- int fd)
-{
- DBusList *link;
- unsigned int flags = 0;
- dbus_bool_t interested = FALSE;
-
- _dbus_assert (fd != -1);
-
- if (watches == NULL)
- watches = _dbus_hash_table_lookup_int (loop->watches, fd);
-
- /* we allocated this in the first _dbus_loop_add_watch for the fd, and keep
- * it until there are none left */
- _dbus_assert (watches != NULL);
-
- for (link = _dbus_list_get_first_link (watches);
- link != NULL;
- link = _dbus_list_get_next_link (watches, link))
- {
- if (dbus_watch_get_enabled (link->data) &&
- !_dbus_watch_get_oom_last_time (link->data))
- {
- flags |= dbus_watch_get_flags (link->data);
- interested = TRUE;
- }
- }
-
- if (interested)
- _dbus_socket_set_enable (loop->socket_set, fd, flags);
- else
- _dbus_socket_set_disable (loop->socket_set, fd);
-}
-
-dbus_bool_t
-_dbus_loop_add_watch (DBusLoop *loop,
- DBusWatch *watch)
-{
- int fd;
- DBusList **watches;
-
- fd = dbus_watch_get_socket (watch);
- _dbus_assert (fd != -1);
-
- watches = ensure_watch_table_entry (loop, fd);
-
- if (watches == NULL)
- return FALSE;
-
- if (!_dbus_list_append (watches, _dbus_watch_ref (watch)))
- {
- _dbus_watch_unref (watch);
- gc_watch_table_entry (loop, watches, fd);
-
- return FALSE;
- }
-
- if (_dbus_list_length_is_one (watches))
- {
- if (!_dbus_socket_set_add (loop->socket_set, fd,
- dbus_watch_get_flags (watch),
- dbus_watch_get_enabled (watch)))
- {
- _dbus_hash_table_remove_int (loop->watches, fd);
- return FALSE;
- }
- }
- else
- {
- /* we're modifying, not adding, which can't fail with OOM */
- refresh_watches_for_fd (loop, watches, fd);
- }
-
- loop->callback_list_serial += 1;
- loop->watch_count += 1;
- return TRUE;
-}
-
-void
-_dbus_loop_toggle_watch (DBusLoop *loop,
- DBusWatch *watch)
-{
- refresh_watches_for_fd (loop, NULL, dbus_watch_get_socket (watch));
-}
-
-void
-_dbus_loop_remove_watch (DBusLoop *loop,
- DBusWatch *watch)
-{
- DBusList **watches;
- DBusList *link;
- int fd;
-
- /* This relies on people removing watches before they invalidate them,
- * which has been safe since fd.o #33336 was fixed. Assert about it
- * so we don't regress. */
- fd = dbus_watch_get_socket (watch);
- _dbus_assert (fd != -1);
-
- watches = _dbus_hash_table_lookup_int (loop->watches, fd);
-
- if (watches != NULL)
- {
- link = _dbus_list_get_first_link (watches);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (watches, link);
- DBusWatch *this = link->data;
-
- if (this == watch)
- {
- _dbus_list_remove_link (watches, link);
- loop->callback_list_serial += 1;
- loop->watch_count -= 1;
- _dbus_watch_unref (this);
-
- /* if that was the last watch for that fd, drop the hash table
- * entry, and stop reserving space for it in the socket set */
- if (gc_watch_table_entry (loop, watches, fd))
- {
- _dbus_socket_set_remove (loop->socket_set, fd);
- }
-
- return;
- }
-
- link = next;
- }
- }
-
- _dbus_warn ("could not find watch %p to remove\n", watch);
-}
-
-dbus_bool_t
-_dbus_loop_add_timeout (DBusLoop *loop,
- DBusTimeout *timeout)
-{
- TimeoutCallback *tcb;
-
- tcb = timeout_callback_new (timeout);
- if (tcb == NULL)
- return FALSE;
-
- if (_dbus_list_append (&loop->timeouts, tcb))
- {
- loop->callback_list_serial += 1;
- loop->timeout_count += 1;
- }
- else
- {
- timeout_callback_free (tcb);
- return FALSE;
- }
-
- return TRUE;
-}
-
-void
-_dbus_loop_remove_timeout (DBusLoop *loop,
- DBusTimeout *timeout)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&loop->timeouts);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&loop->timeouts, link);
- TimeoutCallback *this = link->data;
-
- if (this->timeout == timeout)
- {
- _dbus_list_remove_link (&loop->timeouts, link);
- loop->callback_list_serial += 1;
- loop->timeout_count -= 1;
- timeout_callback_free (this);
-
- return;
- }
-
- link = next;
- }
-
- _dbus_warn ("could not find timeout %p to remove\n", timeout);
-}
-
-/* Convolutions from GLib, there really must be a better way
- * to do this.
- */
-static dbus_bool_t
-check_timeout (unsigned long tv_sec,
- unsigned long tv_usec,
- TimeoutCallback *tcb,
- int *timeout)
-{
- long sec_remaining;
- long msec_remaining;
- unsigned long expiration_tv_sec;
- unsigned long expiration_tv_usec;
- long interval_seconds;
- long interval_milliseconds;
- int interval;
-
- /* I'm pretty sure this function could suck (a lot) less */
-
- interval = dbus_timeout_get_interval (tcb->timeout);
-
- interval_seconds = interval / 1000L;
- interval_milliseconds = interval % 1000L;
-
- expiration_tv_sec = tcb->last_tv_sec + interval_seconds;
- expiration_tv_usec = tcb->last_tv_usec + interval_milliseconds * 1000;
- if (expiration_tv_usec >= 1000000)
- {
- expiration_tv_usec -= 1000000;
- expiration_tv_sec += 1;
- }
-
- sec_remaining = expiration_tv_sec - tv_sec;
- /* need to force this to be signed, as it is intended to sometimes
- * produce a negative result
- */
- msec_remaining = ((long) expiration_tv_usec - (long) tv_usec) / 1000L;
-
-#if MAINLOOP_SPEW
- _dbus_verbose ("Interval is %ld seconds %ld msecs\n",
- interval_seconds,
- interval_milliseconds);
- _dbus_verbose ("Now is %lu seconds %lu usecs\n",
- tv_sec, tv_usec);
- _dbus_verbose ("Last is %lu seconds %lu usecs\n",
- tcb->last_tv_sec, tcb->last_tv_usec);
- _dbus_verbose ("Exp is %lu seconds %lu usecs\n",
- expiration_tv_sec, expiration_tv_usec);
- _dbus_verbose ("Pre-correction, sec_remaining %ld msec_remaining %ld\n",
- sec_remaining, msec_remaining);
-#endif
-
- /* We do the following in a rather convoluted fashion to deal with
- * the fact that we don't have an integral type big enough to hold
- * the difference of two timevals in milliseconds.
- */
- if (sec_remaining < 0 || (sec_remaining == 0 && msec_remaining < 0))
- {
- *timeout = 0;
- }
- else
- {
- if (msec_remaining < 0)
- {
- msec_remaining += 1000;
- sec_remaining -= 1;
- }
-
- if (sec_remaining > (_DBUS_INT_MAX / 1000) ||
- msec_remaining > _DBUS_INT_MAX)
- *timeout = _DBUS_INT_MAX;
- else
- *timeout = sec_remaining * 1000 + msec_remaining;
- }
-
- if (*timeout > interval)
- {
- /* This indicates that the system clock probably moved backward */
- _dbus_verbose ("System clock set backward! Resetting timeout.\n");
-
- tcb->last_tv_sec = tv_sec;
- tcb->last_tv_usec = tv_usec;
-
- *timeout = interval;
- }
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" timeout expires in %d milliseconds\n", *timeout);
-#endif
-
- return *timeout == 0;
-}
-
-dbus_bool_t
-_dbus_loop_dispatch (DBusLoop *loop)
-{
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" %d connections to dispatch\n", _dbus_list_get_length (&loop->need_dispatch));
-#endif
-
- if (loop->need_dispatch == NULL)
- return FALSE;
-
- next:
- while (loop->need_dispatch != NULL)
- {
- DBusConnection *connection = _dbus_list_pop_first (&loop->need_dispatch);
-
- while (TRUE)
- {
- DBusDispatchStatus status;
-
- status = dbus_connection_dispatch (connection);
-
- if (status == DBUS_DISPATCH_COMPLETE)
- {
- dbus_connection_unref (connection);
- goto next;
- }
- else
- {
- if (status == DBUS_DISPATCH_NEED_MEMORY)
- _dbus_wait_for_memory ();
- }
- }
- }
-
- return TRUE;
-}
-
-dbus_bool_t
-_dbus_loop_queue_dispatch (DBusLoop *loop,
- DBusConnection *connection)
-{
- if (_dbus_list_append (&loop->need_dispatch, connection))
- {
- dbus_connection_ref (connection);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/* Returns TRUE if we invoked any timeouts or have ready file
- * descriptors, which is just used in test code as a debug hack
- */
-
-dbus_bool_t
-_dbus_loop_iterate (DBusLoop *loop,
- dbus_bool_t block)
-{
-#define N_STACK_DESCRIPTORS 64
- dbus_bool_t retval;
- DBusSocketEvent ready_fds[N_STACK_DESCRIPTORS];
- int i;
- DBusList *link;
- int n_ready;
- int initial_serial;
- long timeout;
- int orig_depth;
-
- retval = FALSE;
-
- orig_depth = loop->depth;
-
-#if MAINLOOP_SPEW
- _dbus_verbose ("Iteration block=%d depth=%d timeout_count=%d watch_count=%d\n",
- block, loop->depth, loop->timeout_count, loop->watch_count);
-#endif
-
- if (_dbus_hash_table_get_n_entries (loop->watches) == 0 &&
- loop->timeouts == NULL)
- goto next_iteration;
-
- timeout = -1;
- if (loop->timeout_count > 0)
- {
- unsigned long tv_sec;
- unsigned long tv_usec;
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
-
- link = _dbus_list_get_first_link (&loop->timeouts);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&loop->timeouts, link);
- TimeoutCallback *tcb = link->data;
-
- if (dbus_timeout_get_enabled (tcb->timeout))
- {
- int msecs_remaining;
-
- check_timeout (tv_sec, tv_usec, tcb, &msecs_remaining);
-
- if (timeout < 0)
- timeout = msecs_remaining;
- else
- timeout = MIN (msecs_remaining, timeout);
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" timeout added, %d remaining, aggregate timeout %ld\n",
- msecs_remaining, timeout);
-#endif
-
- _dbus_assert (timeout >= 0);
-
- if (timeout == 0)
- break; /* it's not going to get shorter... */
- }
-#if MAINLOOP_SPEW
- else
- {
- _dbus_verbose (" skipping disabled timeout\n");
- }
-#endif
-
- link = next;
- }
- }
-
- /* Never block if we have stuff to dispatch */
- if (!block || loop->need_dispatch != NULL)
- {
- timeout = 0;
-#if MAINLOOP_SPEW
- _dbus_verbose (" timeout is 0 as we aren't blocking\n");
-#endif
- }
-
- /* if a watch was OOM last time, don't wait longer than the OOM
- * wait to re-enable it
- */
- if (loop->oom_watch_pending)
- timeout = MIN (timeout, _dbus_get_oom_wait ());
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" polling on %d descriptors timeout %ld\n", _DBUS_N_ELEMENTS (ready_fds), timeout);
-#endif
-
- n_ready = _dbus_socket_set_poll (loop->socket_set, ready_fds,
- _DBUS_N_ELEMENTS (ready_fds), timeout);
-
- /* re-enable any watches we skipped this time */
- if (loop->oom_watch_pending)
- {
- DBusHashIter hash_iter;
-
- loop->oom_watch_pending = FALSE;
-
- _dbus_hash_iter_init (loop->watches, &hash_iter);
-
- while (_dbus_hash_iter_next (&hash_iter))
- {
- DBusList **watches;
- int fd;
- dbus_bool_t changed;
-
- changed = FALSE;
- fd = _dbus_hash_iter_get_int_key (&hash_iter);
- watches = _dbus_hash_iter_get_value (&hash_iter);
-
- for (link = _dbus_list_get_first_link (watches);
- link != NULL;
- link = _dbus_list_get_next_link (watches, link))
- {
- DBusWatch *watch = link->data;
-
- if (_dbus_watch_get_oom_last_time (watch))
- {
- _dbus_watch_set_oom_last_time (watch, FALSE);
- changed = TRUE;
- }
- }
-
- if (changed)
- refresh_watches_for_fd (loop, watches, fd);
- }
-
- retval = TRUE; /* return TRUE here to keep the loop going,
- * since we don't know the watch was inactive */
- }
-
- initial_serial = loop->callback_list_serial;
-
- if (loop->timeout_count > 0)
- {
- unsigned long tv_sec;
- unsigned long tv_usec;
-
- _dbus_get_monotonic_time (&tv_sec, &tv_usec);
-
- /* It'd be nice to avoid this O(n) thingy here */
- link = _dbus_list_get_first_link (&loop->timeouts);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&loop->timeouts, link);
- TimeoutCallback *tcb = link->data;
-
- if (initial_serial != loop->callback_list_serial)
- goto next_iteration;
-
- if (loop->depth != orig_depth)
- goto next_iteration;
-
- if (dbus_timeout_get_enabled (tcb->timeout))
- {
- int msecs_remaining;
-
- if (check_timeout (tv_sec, tv_usec,
- tcb, &msecs_remaining))
- {
- /* Save last callback time and fire this timeout */
- tcb->last_tv_sec = tv_sec;
- tcb->last_tv_usec = tv_usec;
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" invoking timeout\n");
-#endif
-
- /* can theoretically return FALSE on OOM, but we just
- * let it fire again later - in practice that's what
- * every wrapper callback in dbus-daemon used to do */
- dbus_timeout_handle (tcb->timeout);
-
- retval = TRUE;
- }
- else
- {
-#if MAINLOOP_SPEW
- _dbus_verbose (" timeout has not expired\n");
-#endif
- }
- }
-#if MAINLOOP_SPEW
- else
- {
- _dbus_verbose (" skipping invocation of disabled timeout\n");
- }
-#endif
-
- link = next;
- }
- }
-
- if (n_ready > 0)
- {
- for (i = 0; i < n_ready; i++)
- {
- DBusList **watches;
- DBusList *next;
- unsigned int condition;
- dbus_bool_t any_oom;
-
- /* FIXME I think this "restart if we change the watches"
- * approach could result in starving watches
- * toward the end of the list.
- */
- if (initial_serial != loop->callback_list_serial)
- goto next_iteration;
-
- if (loop->depth != orig_depth)
- goto next_iteration;
-
- _dbus_assert (ready_fds[i].flags != 0);
-
- if (_DBUS_UNLIKELY (ready_fds[i].flags & _DBUS_WATCH_NVAL))
- {
- cull_watches_for_invalid_fd (loop, ready_fds[i].fd);
- goto next_iteration;
- }
-
- condition = ready_fds[i].flags;
- _dbus_assert ((condition & _DBUS_WATCH_NVAL) == 0);
-
- /* condition may still be 0 if we got some
- * weird POLLFOO thing like POLLWRBAND
- */
- if (condition == 0)
- continue;
-
- watches = _dbus_hash_table_lookup_int (loop->watches,
- ready_fds[i].fd);
-
- if (watches == NULL)
- continue;
-
- any_oom = FALSE;
-
- for (link = _dbus_list_get_first_link (watches);
- link != NULL;
- link = next)
- {
- DBusWatch *watch = link->data;
-
- next = _dbus_list_get_next_link (watches, link);
-
- if (dbus_watch_get_enabled (watch))
- {
- dbus_bool_t oom;
-
- oom = !dbus_watch_handle (watch, condition);
-
- if (oom)
- {
- _dbus_watch_set_oom_last_time (watch, TRUE);
- loop->oom_watch_pending = TRUE;
- any_oom = TRUE;
- }
-
-#if MAINLOOP_SPEW
- _dbus_verbose (" Invoked watch, oom = %d\n", oom);
-#endif
- retval = TRUE;
-
- /* We re-check this every time, in case the callback
- * added/removed watches, which might make our position in
- * the linked list invalid. See the FIXME above. */
- if (initial_serial != loop->callback_list_serial ||
- loop->depth != orig_depth)
- {
- if (any_oom)
- refresh_watches_for_fd (loop, NULL, ready_fds[i].fd);
-
- goto next_iteration;
- }
- }
- }
-
- if (any_oom)
- refresh_watches_for_fd (loop, watches, ready_fds[i].fd);
- }
- }
-
- next_iteration:
-#if MAINLOOP_SPEW
- _dbus_verbose (" moving to next iteration\n");
-#endif
-
- if (_dbus_loop_dispatch (loop))
- retval = TRUE;
-
-#if MAINLOOP_SPEW
- _dbus_verbose ("Returning %d\n", retval);
-#endif
-
- return retval;
-}
-
-void
-_dbus_loop_run (DBusLoop *loop)
-{
- int our_exit_depth;
-
- _dbus_assert (loop->depth >= 0);
-
- _dbus_loop_ref (loop);
-
- our_exit_depth = loop->depth;
- loop->depth += 1;
-
- _dbus_verbose ("Running main loop, depth %d -> %d\n",
- loop->depth - 1, loop->depth);
-
- while (loop->depth != our_exit_depth)
- _dbus_loop_iterate (loop, TRUE);
-
- _dbus_loop_unref (loop);
-}
-
-void
-_dbus_loop_quit (DBusLoop *loop)
-{
- _dbus_assert (loop->depth > 0);
-
- loop->depth -= 1;
-
- _dbus_verbose ("Quit main loop, depth %d -> %d\n",
- loop->depth + 1, loop->depth);
-}
-
-int
-_dbus_get_oom_wait (void)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- /* make tests go fast */
- return 0;
-#else
- return 500;
-#endif
-}
-
-void
-_dbus_wait_for_memory (void)
-{
- _dbus_verbose ("Waiting for more memory\n");
- _dbus_sleep_milliseconds (_dbus_get_oom_wait ());
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.h
deleted file mode 100644
index a76cb6f0ab..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-mainloop.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-mainloop.h Main loop utility
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MAINLOOP_H
-#define DBUS_MAINLOOP_H
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include <dbus/dbus.h>
-
-typedef struct DBusLoop DBusLoop;
-
-typedef dbus_bool_t (* DBusWatchFunction) (DBusWatch *watch,
- unsigned int condition,
- void *data);
-
-DBusLoop* _dbus_loop_new (void);
-DBusLoop* _dbus_loop_ref (DBusLoop *loop);
-void _dbus_loop_unref (DBusLoop *loop);
-dbus_bool_t _dbus_loop_add_watch (DBusLoop *loop,
- DBusWatch *watch);
-void _dbus_loop_remove_watch (DBusLoop *loop,
- DBusWatch *watch);
-void _dbus_loop_toggle_watch (DBusLoop *loop,
- DBusWatch *watch);
-dbus_bool_t _dbus_loop_add_timeout (DBusLoop *loop,
- DBusTimeout *timeout);
-void _dbus_loop_remove_timeout (DBusLoop *loop,
- DBusTimeout *timeout);
-
-dbus_bool_t _dbus_loop_queue_dispatch (DBusLoop *loop,
- DBusConnection *connection);
-
-void _dbus_loop_run (DBusLoop *loop);
-void _dbus_loop_quit (DBusLoop *loop);
-dbus_bool_t _dbus_loop_iterate (DBusLoop *loop,
- dbus_bool_t block);
-dbus_bool_t _dbus_loop_dispatch (DBusLoop *loop);
-
-int _dbus_get_oom_wait (void);
-void _dbus_wait_for_memory (void);
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* DBUS_MAINLOOP_H */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.c
deleted file mode 100644
index eafc2a9ad7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.c
+++ /dev/null
@@ -1,1922 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-basic.c Marshalling routines for basic (primitive) types
- *
- * Copyright (C) 2002 CodeFactory AB
- * Copyright (C) 2003, 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-signature.h"
-
-#include <string.h>
-
-#if defined(__GNUC__) && (__GNUC__ >= 4)
-# define _DBUS_ASSERT_ALIGNMENT(type, op, val) \
- _DBUS_STATIC_ASSERT (__extension__ __alignof__ (type) op val)
-#else
- /* not gcc, so probably no alignof operator: just use a no-op statement
- * that's valid in the same contexts */
-# define _DBUS_ASSERT_ALIGNMENT(type, op, val) \
- _DBUS_STATIC_ASSERT (TRUE)
-#endif
-
-/* True by definition, but just for completeness... */
-_DBUS_STATIC_ASSERT (sizeof (char) == 1);
-_DBUS_ASSERT_ALIGNMENT (char, ==, 1);
-
-_DBUS_STATIC_ASSERT (sizeof (dbus_int16_t) == 2);
-_DBUS_ASSERT_ALIGNMENT (dbus_int16_t, <=, 2);
-_DBUS_STATIC_ASSERT (sizeof (dbus_uint16_t) == 2);
-_DBUS_ASSERT_ALIGNMENT (dbus_uint16_t, <=, 2);
-
-_DBUS_STATIC_ASSERT (sizeof (dbus_int32_t) == 4);
-_DBUS_ASSERT_ALIGNMENT (dbus_int32_t, <=, 4);
-_DBUS_STATIC_ASSERT (sizeof (dbus_uint32_t) == 4);
-_DBUS_ASSERT_ALIGNMENT (dbus_uint32_t, <=, 4);
-_DBUS_STATIC_ASSERT (sizeof (dbus_bool_t) == 4);
-_DBUS_ASSERT_ALIGNMENT (dbus_bool_t, <=, 4);
-
-_DBUS_STATIC_ASSERT (sizeof (double) == 8);
-_DBUS_ASSERT_ALIGNMENT (double, <=, 8);
-
-_DBUS_STATIC_ASSERT (sizeof (dbus_int64_t) == 8);
-_DBUS_ASSERT_ALIGNMENT (dbus_int64_t, <=, 8);
-_DBUS_STATIC_ASSERT (sizeof (dbus_uint64_t) == 8);
-_DBUS_ASSERT_ALIGNMENT (dbus_uint64_t, <=, 8);
-
-_DBUS_STATIC_ASSERT (sizeof (DBusBasicValue) >= 8);
-/* The alignment of a DBusBasicValue might conceivably be > 8 because of the
- * pointer, so we don't assert about it */
-
-_DBUS_STATIC_ASSERT (sizeof (DBus8ByteStruct) == 8);
-_DBUS_ASSERT_ALIGNMENT (DBus8ByteStruct, <=, 8);
-
-/**
- * @defgroup DBusMarshal marshaling and unmarshaling
- * @ingroup DBusInternals
- * @brief functions to marshal/unmarshal data from the wire
- *
- * Types and functions related to converting primitive data types from
- * wire format to native machine format, and vice versa.
- *
- * A signature is just a string with multiple types one after the other.
- * for example a type is "i" or "(ii)", a signature is "i(ii)"
- * where i is int and (ii) is struct { int; int; }
- *
- * @{
- */
-
-static void
-pack_2_octets (dbus_uint16_t value,
- int byte_order,
- unsigned char *data)
-{
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 2) == data);
-
- if ((byte_order) == DBUS_LITTLE_ENDIAN)
- *((dbus_uint16_t*)(data)) = DBUS_UINT16_TO_LE (value);
- else
- *((dbus_uint16_t*)(data)) = DBUS_UINT16_TO_BE (value);
-}
-
-static void
-pack_4_octets (dbus_uint32_t value,
- int byte_order,
- unsigned char *data)
-{
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 4) == data);
-
- if ((byte_order) == DBUS_LITTLE_ENDIAN)
- *((dbus_uint32_t*)(data)) = DBUS_UINT32_TO_LE (value);
- else
- *((dbus_uint32_t*)(data)) = DBUS_UINT32_TO_BE (value);
-}
-
-static void
-pack_8_octets (DBusBasicValue value,
- int byte_order,
- unsigned char *data)
-{
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 8) == data);
-
- if ((byte_order) == DBUS_LITTLE_ENDIAN)
- *((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_LE (value.u64);
- else
- *((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_BE (value.u64);
-}
-
-/**
- * Packs a 32 bit unsigned integer into a data pointer.
- *
- * @param value the value
- * @param byte_order the byte order to use
- * @param data the data pointer
- */
-void
-_dbus_pack_uint32 (dbus_uint32_t value,
- int byte_order,
- unsigned char *data)
-{
- pack_4_octets (value, byte_order, data);
-}
-
-static void
-swap_8_octets (DBusBasicValue *value,
- int byte_order)
-{
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- {
- value->u64 = DBUS_UINT64_SWAP_LE_BE (value->u64);
- }
-}
-
-#ifndef _dbus_unpack_uint16
-/**
- * Unpacks a 16 bit unsigned integer from a data pointer
- *
- * @param byte_order The byte order to use
- * @param data the data pointer
- * @returns the integer
- */
-dbus_uint16_t
-_dbus_unpack_uint16 (int byte_order,
- const unsigned char *data)
-{
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 2) == data);
-
- if (byte_order == DBUS_LITTLE_ENDIAN)
- return DBUS_UINT16_FROM_LE (*(dbus_uint16_t*)data);
- else
- return DBUS_UINT16_FROM_BE (*(dbus_uint16_t*)data);
-}
-#endif /* _dbus_unpack_uint16 */
-
-#ifndef _dbus_unpack_uint32
-/**
- * Unpacks a 32 bit unsigned integer from a data pointer
- *
- * @param byte_order The byte order to use
- * @param data the data pointer
- * @returns the integer
- */
-dbus_uint32_t
-_dbus_unpack_uint32 (int byte_order,
- const unsigned char *data)
-{
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 4) == data);
-
- if (byte_order == DBUS_LITTLE_ENDIAN)
- return DBUS_UINT32_FROM_LE (*(dbus_uint32_t*)data);
- else
- return DBUS_UINT32_FROM_BE (*(dbus_uint32_t*)data);
-}
-#endif /* _dbus_unpack_uint32 */
-
-static void
-set_2_octets (DBusString *str,
- int offset,
- dbus_uint16_t value,
- int byte_order)
-{
- char *data;
-
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
- byte_order == DBUS_BIG_ENDIAN);
-
- data = _dbus_string_get_data_len (str, offset, 2);
-
- pack_2_octets (value, byte_order, data);
-}
-
-static void
-set_4_octets (DBusString *str,
- int offset,
- dbus_uint32_t value,
- int byte_order)
-{
- char *data;
-
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
- byte_order == DBUS_BIG_ENDIAN);
-
- data = _dbus_string_get_data_len (str, offset, 4);
-
- pack_4_octets (value, byte_order, data);
-}
-
-static void
-set_8_octets (DBusString *str,
- int offset,
- DBusBasicValue value,
- int byte_order)
-{
- char *data;
-
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
- byte_order == DBUS_BIG_ENDIAN);
-
- data = _dbus_string_get_data_len (str, offset, 8);
-
- pack_8_octets (value, byte_order, data);
-}
-
-/**
- * Sets the 4 bytes at the given offset to a marshaled unsigned
- * integer, replacing anything found there previously.
- *
- * @param str the string to write the marshalled int to
- * @param pos the byte offset where int should be written
- * @param value the value
- * @param byte_order the byte order to use
- *
- */
-void
-_dbus_marshal_set_uint32 (DBusString *str,
- int pos,
- dbus_uint32_t value,
- int byte_order)
-{
- set_4_octets (str, pos, value, byte_order);
-}
-
-/**
- * Sets the existing marshaled string at the given offset with
- * a new marshaled string. The given offset must point to
- * an existing string or the wrong length will be deleted
- * and replaced with the new string.
- *
- * Note: no attempt is made by this function to re-align
- * any data which has been already marshalled after this
- * string. Use with caution.
- *
- * @param str the string to write the marshalled string to
- * @param pos the position of the marshaled string length
- * @param value the value
- * @param byte_order the byte order to use
- * @param old_end_pos place to store byte after the nul byte of the old value
- * @param new_end_pos place to store byte after the nul byte of the new value
- * @returns #TRUE on success, #FALSE if no memory
- *
- */
-static dbus_bool_t
-set_string (DBusString *str,
- int pos,
- const char *value,
- int byte_order,
- int *old_end_pos,
- int *new_end_pos)
-{
- int old_len, new_len;
- DBusString dstr;
-
- _dbus_string_init_const (&dstr, value);
-
- _dbus_assert (_DBUS_ALIGN_VALUE (pos, 4) == (unsigned) pos);
- old_len = _dbus_unpack_uint32 (byte_order,
- _dbus_string_get_const_data_len (str, pos, 4));
-
- new_len = _dbus_string_get_length (&dstr);
-
- if (!_dbus_string_replace_len (&dstr, 0, new_len,
- str, pos + 4, old_len))
- return FALSE;
-
- _dbus_marshal_set_uint32 (str, pos, new_len, byte_order);
-
- if (old_end_pos)
- *old_end_pos = pos + 4 + old_len + 1;
- if (new_end_pos)
- *new_end_pos = pos + 4 + new_len + 1;
-
- return TRUE;
-}
-
-/**
- * Sets the existing marshaled signature at the given offset to a new
- * marshaled signature. Same basic ideas as set_string().
- *
- * @param str the string to write the marshalled signature to
- * @param pos the position of the marshaled signature length
- * @param value the value
- * @param byte_order the byte order to use
- * @param old_end_pos place to store byte after the nul byte of the old value
- * @param new_end_pos place to store byte after the nul byte of the new value
- * @returns #TRUE on success, #FALSE if no memory
- *
- */
-static dbus_bool_t
-set_signature (DBusString *str,
- int pos,
- const char *value,
- int byte_order,
- int *old_end_pos,
- int *new_end_pos)
-{
- int old_len, new_len;
- DBusString dstr;
-
- _dbus_string_init_const (&dstr, value);
-
- old_len = _dbus_string_get_byte (str, pos);
- new_len = _dbus_string_get_length (&dstr);
-
- if (!_dbus_string_replace_len (&dstr, 0, new_len,
- str, pos + 1, old_len))
- return FALSE;
-
- _dbus_string_set_byte (str, pos, new_len);
-
- if (old_end_pos)
- *old_end_pos = pos + 1 + old_len + 1;
- if (new_end_pos)
- *new_end_pos = pos + 1 + new_len + 1;
-
- return TRUE;
-}
-
-/**
- * Sets an existing basic type value to a new value.
- * Arguments work the same way as _dbus_marshal_basic_type().
- *
- * @param str the string
- * @param pos location of the current value
- * @param type the type of the current and new values
- * @param value the address of the new value
- * @param byte_order byte order for marshaling
- * @param old_end_pos location to store end position of the old value, or #NULL
- * @param new_end_pos location to store end position of the new value, or #NULL
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_marshal_set_basic (DBusString *str,
- int pos,
- int type,
- const void *value,
- int byte_order,
- int *old_end_pos,
- int *new_end_pos)
-{
- const DBusBasicValue *vp;
-
- vp = value;
-
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- _dbus_string_set_byte (str, pos, vp->byt);
- if (old_end_pos)
- *old_end_pos = pos + 1;
- if (new_end_pos)
- *new_end_pos = pos + 1;
- return TRUE;
- break;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- pos = _DBUS_ALIGN_VALUE (pos, 2);
- set_2_octets (str, pos, vp->u16, byte_order);
- if (old_end_pos)
- *old_end_pos = pos + 2;
- if (new_end_pos)
- *new_end_pos = pos + 2;
- return TRUE;
- break;
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- pos = _DBUS_ALIGN_VALUE (pos, 4);
- set_4_octets (str, pos, vp->u32, byte_order);
- if (old_end_pos)
- *old_end_pos = pos + 4;
- if (new_end_pos)
- *new_end_pos = pos + 4;
- return TRUE;
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- pos = _DBUS_ALIGN_VALUE (pos, 8);
- set_8_octets (str, pos, *vp, byte_order);
- if (old_end_pos)
- *old_end_pos = pos + 8;
- if (new_end_pos)
- *new_end_pos = pos + 8;
- return TRUE;
- break;
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- pos = _DBUS_ALIGN_VALUE (pos, 4);
- _dbus_assert (vp->str != NULL);
- return set_string (str, pos, vp->str, byte_order,
- old_end_pos, new_end_pos);
- break;
- case DBUS_TYPE_SIGNATURE:
- _dbus_assert (vp->str != NULL);
- return set_signature (str, pos, vp->str, byte_order,
- old_end_pos, new_end_pos);
- break;
- default:
- _dbus_assert_not_reached ("not a basic type");
- return FALSE;
- break;
- }
-}
-
-/**
- * Convenience function to demarshal a 32 bit unsigned integer.
- *
- * @param str the string containing the data
- * @param byte_order the byte order
- * @param pos the position in the string
- * @param new_pos the new position of the string
- * @returns the demarshaled integer.
- */
-dbus_uint32_t
-_dbus_marshal_read_uint32 (const DBusString *str,
- int pos,
- int byte_order,
- int *new_pos)
-{
- pos = _DBUS_ALIGN_VALUE (pos, 4);
-
- if (new_pos)
- *new_pos = pos + 4;
-
- _dbus_assert (pos + 4 <= _dbus_string_get_length (str));
-
- return _dbus_unpack_uint32 (byte_order,
- _dbus_string_get_const_data (str) + pos);
-}
-
-/**
- * Demarshals a basic-typed value. The "value" pointer is always
- * the address of a variable of the basic type. So e.g.
- * if the basic type is "double" then the pointer is
- * a double*, and if it's "char*" then the pointer is
- * a "char**".
- *
- * A value of type #DBusBasicValue is guaranteed to be large enough to
- * hold any of the types that may be returned, which is handy if you
- * are trying to do things generically. For example you can pass
- * a DBusBasicValue* in to this function, and then pass the same
- * DBusBasicValue* in to _dbus_marshal_basic_type() in order to
- * move a value from one place to another.
- *
- * @param str the string containing the data
- * @param pos position in the string
- * @param type type of value to demarshal
- * @param value pointer to return value data
- * @param byte_order the byte order
- * @param new_pos pointer to update with new position, or #NULL
- **/
-void
-_dbus_marshal_read_basic (const DBusString *str,
- int pos,
- int type,
- void *value,
- int byte_order,
- int *new_pos)
-{
- const char *str_data;
-
- _dbus_assert (dbus_type_is_basic (type));
-
- str_data = _dbus_string_get_const_data (str);
-
- /* Below we volatile types to avoid aliasing issues;
- * see http://bugs.freedesktop.org/show_bug.cgi?id=20137
- */
-
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- {
- volatile unsigned char *vp = value;
- *vp = (unsigned char) _dbus_string_get_byte (str, pos);
- (pos)++;
- }
- break;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- {
- volatile dbus_uint16_t *vp = value;
- pos = _DBUS_ALIGN_VALUE (pos, 2);
- *vp = *(dbus_uint16_t *)(str_data + pos);
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- *vp = DBUS_UINT16_SWAP_LE_BE (*vp);
- pos += 2;
- }
- break;
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_UNIX_FD:
- {
- volatile dbus_uint32_t *vp = value;
- pos = _DBUS_ALIGN_VALUE (pos, 4);
- *vp = *(dbus_uint32_t *)(str_data + pos);
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- *vp = DBUS_UINT32_SWAP_LE_BE (*vp);
- pos += 4;
- }
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- {
- volatile dbus_uint64_t *vp = value;
- pos = _DBUS_ALIGN_VALUE (pos, 8);
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- *vp = DBUS_UINT64_SWAP_LE_BE (*(dbus_uint64_t*)(str_data + pos));
- else
- *vp = *(dbus_uint64_t*)(str_data + pos);
- pos += 8;
- }
- break;
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- {
- int len;
- volatile char **vp = value;
-
- len = _dbus_marshal_read_uint32 (str, pos, byte_order, &pos);
-
- *vp = (char*) str_data + pos;
-
- pos += len + 1; /* length plus nul */
- }
- break;
- case DBUS_TYPE_SIGNATURE:
- {
- int len;
- volatile char **vp = value;
-
- len = _dbus_string_get_byte (str, pos);
- pos += 1;
-
- *vp = (char*) str_data + pos;
-
- pos += len + 1; /* length plus nul */
- }
- break;
- default:
- _dbus_warn_check_failed ("type %s %d not a basic type\n",
- _dbus_type_to_string (type), type);
- _dbus_assert_not_reached ("not a basic type");
- break;
- }
-
- if (new_pos)
- *new_pos = pos;
-}
-
-static dbus_bool_t
-marshal_2_octets (DBusString *str,
- int insert_at,
- dbus_uint16_t value,
- int byte_order,
- int *pos_after)
-{
- dbus_bool_t retval;
- int orig_len;
-
- _dbus_assert (sizeof (value) == 2);
-
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- value = DBUS_UINT16_SWAP_LE_BE (value);
-
- orig_len = _dbus_string_get_length (str);
-
- retval = _dbus_string_insert_2_aligned (str, insert_at,
- (const unsigned char *)&value);
-
- if (pos_after)
- {
- *pos_after = insert_at + (_dbus_string_get_length (str) - orig_len);
- _dbus_assert (*pos_after <= _dbus_string_get_length (str));
- }
-
- return retval;
-}
-
-static dbus_bool_t
-marshal_4_octets (DBusString *str,
- int insert_at,
- dbus_uint32_t value,
- int byte_order,
- int *pos_after)
-{
- dbus_bool_t retval;
- int orig_len;
-
- _dbus_assert (sizeof (value) == 4);
-
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- value = DBUS_UINT32_SWAP_LE_BE (value);
-
- orig_len = _dbus_string_get_length (str);
-
- retval = _dbus_string_insert_4_aligned (str, insert_at,
- (const unsigned char *)&value);
-
- if (pos_after)
- {
- *pos_after = insert_at + (_dbus_string_get_length (str) - orig_len);
- _dbus_assert (*pos_after <= _dbus_string_get_length (str));
- }
-
- return retval;
-}
-
-static dbus_bool_t
-marshal_8_octets (DBusString *str,
- int insert_at,
- DBusBasicValue value,
- int byte_order,
- int *pos_after)
-{
- dbus_bool_t retval;
- int orig_len;
-
- _dbus_assert (sizeof (value) == 8);
-
- swap_8_octets (&value, byte_order);
-
- orig_len = _dbus_string_get_length (str);
-
- retval = _dbus_string_insert_8_aligned (str, insert_at,
- (const unsigned char *)&value);
-
- if (pos_after)
- *pos_after = insert_at + _dbus_string_get_length (str) - orig_len;
-
- return retval;
-}
-
-enum
- {
- MARSHAL_AS_STRING,
- MARSHAL_AS_SIGNATURE,
- MARSHAL_AS_BYTE_ARRAY
- };
-
-static dbus_bool_t
-marshal_len_followed_by_bytes (int marshal_as,
- DBusString *str,
- int insert_at,
- const unsigned char *value,
- int data_len, /* doesn't include nul if any */
- int byte_order,
- int *pos_after)
-{
- int pos;
- DBusString value_str;
- int value_len;
-
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN || byte_order == DBUS_BIG_ENDIAN);
- if (insert_at > _dbus_string_get_length (str))
- _dbus_warn ("insert_at = %d string len = %d data_len = %d\n",
- insert_at, _dbus_string_get_length (str), data_len);
-
- if (marshal_as == MARSHAL_AS_BYTE_ARRAY)
- value_len = data_len;
- else
- value_len = data_len + 1; /* value has a nul */
-
- _dbus_string_init_const_len (&value_str, value, value_len);
-
- pos = insert_at;
-
- if (marshal_as == MARSHAL_AS_SIGNATURE)
- {
- _dbus_assert (data_len <= DBUS_MAXIMUM_SIGNATURE_LENGTH);
- _dbus_assert (data_len <= 255); /* same as max sig len right now */
-
- if (!_dbus_string_insert_byte (str, pos, data_len))
- goto oom;
-
- pos += 1;
- }
- else
- {
- if (!marshal_4_octets (str, pos, data_len,
- byte_order, &pos))
- goto oom;
- }
-
- if (!_dbus_string_copy_len (&value_str, 0, value_len,
- str, pos))
- goto oom;
-
-#if 0
- /* too expensive */
- _dbus_assert (_dbus_string_equal_substring (&value_str, 0, value_len,
- str, pos));
- _dbus_verbose_bytes_of_string (str, pos, value_len);
-#endif
-
- pos += value_len;
-
- if (pos_after)
- *pos_after = pos;
-
- return TRUE;
-
- oom:
- /* Delete what we've inserted */
- _dbus_string_delete (str, insert_at, pos - insert_at);
-
- return FALSE;
-}
-
-static dbus_bool_t
-marshal_string (DBusString *str,
- int insert_at,
- const char *value,
- int byte_order,
- int *pos_after)
-{
- return marshal_len_followed_by_bytes (MARSHAL_AS_STRING,
- str, insert_at, value,
- strlen (value),
- byte_order, pos_after);
-}
-
-static dbus_bool_t
-marshal_signature (DBusString *str,
- int insert_at,
- const char *value,
- int *pos_after)
-{
- return marshal_len_followed_by_bytes (MARSHAL_AS_SIGNATURE,
- str, insert_at, value,
- strlen (value),
- DBUS_COMPILER_BYTE_ORDER, /* irrelevant */
- pos_after);
-}
-
-/**
- * Marshals a basic-typed value. The "value" pointer is always the
- * address of a variable containing the basic type value.
- * So for example for int32 it will be dbus_int32_t*, and
- * for string it will be const char**. This is for symmetry
- * with _dbus_marshal_read_basic() and to have a simple
- * consistent rule.
- *
- * @param str string to marshal to
- * @param insert_at where to insert the value
- * @param type type of value
- * @param value pointer to a variable containing the value
- * @param byte_order byte order
- * @param pos_after #NULL or the position after the type
- * @returns #TRUE on success
- **/
-dbus_bool_t
-_dbus_marshal_write_basic (DBusString *str,
- int insert_at,
- int type,
- const void *value,
- int byte_order,
- int *pos_after)
-{
- const DBusBasicValue *vp;
-
- _dbus_assert (dbus_type_is_basic (type));
-
- vp = value;
-
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- if (!_dbus_string_insert_byte (str, insert_at, vp->byt))
- return FALSE;
- if (pos_after)
- *pos_after = insert_at + 1;
- return TRUE;
- break;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- return marshal_2_octets (str, insert_at, vp->u16,
- byte_order, pos_after);
- break;
- case DBUS_TYPE_BOOLEAN:
- return marshal_4_octets (str, insert_at, vp->u32 != FALSE,
- byte_order, pos_after);
- break;
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- return marshal_4_octets (str, insert_at, vp->u32,
- byte_order, pos_after);
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- return marshal_8_octets (str, insert_at, *vp, byte_order, pos_after);
- break;
-
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- _dbus_assert (vp->str != NULL);
- return marshal_string (str, insert_at, vp->str, byte_order, pos_after);
- break;
- case DBUS_TYPE_SIGNATURE:
- _dbus_assert (vp->str != NULL);
- return marshal_signature (str, insert_at, vp->str, pos_after);
- break;
- default:
- _dbus_assert_not_reached ("not a basic type");
- return FALSE;
- break;
- }
-}
-
-static dbus_bool_t
-marshal_1_octets_array (DBusString *str,
- int insert_at,
- const unsigned char *value,
- int n_elements,
- int byte_order,
- int *pos_after)
-{
- int pos;
- DBusString value_str;
-
- _dbus_string_init_const_len (&value_str, value, n_elements);
-
- pos = insert_at;
-
- if (!_dbus_string_copy_len (&value_str, 0, n_elements,
- str, pos))
- return FALSE;
-
- pos += n_elements;
-
- if (pos_after)
- *pos_after = pos;
-
- return TRUE;
-}
-
-/**
- * Swaps the elements of an array to the opposite byte order
- *
- * @param data start of array
- * @param n_elements number of elements
- * @param alignment size of each element
- */
-void
-_dbus_swap_array (unsigned char *data,
- int n_elements,
- int alignment)
-{
- unsigned char *d;
- unsigned char *end;
-
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, alignment) == data);
-
- /* we use const_data and cast it off so DBusString can be a const string
- * for the unit tests. don't ask.
- */
- d = data;
- end = d + (n_elements * alignment);
-
- if (alignment == 8)
- {
- while (d != end)
- {
- *((dbus_uint64_t*)d) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)d));
- d += 8;
- }
- }
- else if (alignment == 4)
- {
- while (d != end)
- {
- *((dbus_uint32_t*)d) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)d));
- d += 4;
- }
- }
- else
- {
- _dbus_assert (alignment == 2);
-
- while (d != end)
- {
- *((dbus_uint16_t*)d) = DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t*)d));
- d += 2;
- }
- }
-}
-
-static void
-swap_array (DBusString *str,
- int array_start,
- int n_elements,
- int byte_order,
- int alignment)
-{
- _dbus_assert (_DBUS_ALIGN_VALUE (array_start, alignment) == (unsigned) array_start);
-
- if (byte_order != DBUS_COMPILER_BYTE_ORDER)
- {
- /* we use const_data and cast it off so DBusString can be a const string
- * for the unit tests. don't ask.
- */
- _dbus_swap_array ((unsigned char*) (_dbus_string_get_const_data (str) + array_start),
- n_elements, alignment);
- }
-}
-
-static dbus_bool_t
-marshal_fixed_multi (DBusString *str,
- int insert_at,
- const DBusBasicValue *value,
- int n_elements,
- int byte_order,
- int alignment,
- int *pos_after)
-{
- int old_string_len;
- int array_start;
- DBusString t;
- int len_in_bytes;
-
- _dbus_assert (n_elements <= DBUS_MAXIMUM_ARRAY_LENGTH / alignment);
-
- old_string_len = _dbus_string_get_length (str);
-
- len_in_bytes = n_elements * alignment;
- array_start = insert_at;
-
- /* Note that we do alignment padding unconditionally
- * even if the array is empty; this means that
- * padding + len is always equal to the number of bytes
- * in the array.
- */
-
- if (!_dbus_string_insert_alignment (str, &array_start, alignment))
- goto error;
-
- _dbus_string_init_const_len (&t,
- (const unsigned char*) value,
- len_in_bytes);
-
- if (!_dbus_string_copy (&t, 0,
- str, array_start))
- goto error;
-
- swap_array (str, array_start, n_elements, byte_order, alignment);
-
- if (pos_after)
- *pos_after = array_start + len_in_bytes;
-
- return TRUE;
-
- error:
- _dbus_string_delete (str, insert_at,
- _dbus_string_get_length (str) - old_string_len);
-
- return FALSE;
-}
-
-/**
- * Marshals a block of values of fixed-length type all at once, as an
- * optimization. dbus_type_is_fixed() returns #TRUE for fixed-length
- * types, which are the basic types minus the string-like types.
- *
- * The value argument should be the adddress of an
- * array, so e.g. "const dbus_uint32_t**"
- *
- * @param str string to marshal to
- * @param insert_at where to insert the value
- * @param element_type type of array elements
- * @param value address of an array to marshal
- * @param n_elements number of elements in the array
- * @param byte_order byte order
- * @param pos_after #NULL or the position after the type
- * @returns #TRUE on success
- **/
-dbus_bool_t
-_dbus_marshal_write_fixed_multi (DBusString *str,
- int insert_at,
- int element_type,
- const void *value,
- int n_elements,
- int byte_order,
- int *pos_after)
-{
- const void* vp = *(const DBusBasicValue**)value;
-
- _dbus_assert (dbus_type_is_fixed (element_type));
- _dbus_assert (n_elements >= 0);
-
-#if 0
- _dbus_verbose ("writing %d elements of %s\n",
- n_elements, _dbus_type_to_string (element_type));
-#endif
-
- switch (element_type)
- {
- case DBUS_TYPE_BYTE:
- return marshal_1_octets_array (str, insert_at, vp, n_elements, byte_order, pos_after);
- break;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 2, pos_after);
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 4, pos_after);
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- return marshal_fixed_multi (str, insert_at, vp, n_elements, byte_order, 8, pos_after);
- break;
-
- default:
- _dbus_assert_not_reached ("non fixed type in array write");
- break;
- }
-
- return FALSE;
-}
-
-
-/**
- * Skips over a basic-typed value, reporting the following position.
- *
- * @param str the string containing the data
- * @param type type of value to read
- * @param byte_order the byte order
- * @param pos pointer to position in the string,
- * updated on return to new position
- **/
-void
-_dbus_marshal_skip_basic (const DBusString *str,
- int type,
- int byte_order,
- int *pos)
-{
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
- byte_order == DBUS_BIG_ENDIAN);
-
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- (*pos)++;
- break;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- *pos = _DBUS_ALIGN_VALUE (*pos, 2);
- *pos += 2;
- break;
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- *pos = _DBUS_ALIGN_VALUE (*pos, 4);
- *pos += 4;
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- *pos = _DBUS_ALIGN_VALUE (*pos, 8);
- *pos += 8;
- break;
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- {
- int len;
-
- len = _dbus_marshal_read_uint32 (str, *pos, byte_order, pos);
-
- *pos += len + 1; /* length plus nul */
- }
- break;
- case DBUS_TYPE_SIGNATURE:
- {
- int len;
-
- len = _dbus_string_get_byte (str, *pos);
-
- *pos += len + 2; /* length byte plus length plus nul */
- }
- break;
- default:
- _dbus_warn ("type %s not a basic type\n",
- _dbus_type_to_string (type));
- _dbus_assert_not_reached ("not a basic type");
- break;
- }
-}
-
-/**
- * Skips an array, returning the next position.
- *
- * @param str the string containing the data
- * @param element_type the type of array elements
- * @param byte_order the byte order
- * @param pos pointer to position in the string,
- * updated on return to new position
- */
-void
-_dbus_marshal_skip_array (const DBusString *str,
- int element_type,
- int byte_order,
- int *pos)
-{
- dbus_uint32_t array_len;
- int i;
- int alignment;
-
- i = _DBUS_ALIGN_VALUE (*pos, 4);
-
- array_len = _dbus_marshal_read_uint32 (str, i, byte_order, &i);
-
- alignment = _dbus_type_get_alignment (element_type);
-
- i = _DBUS_ALIGN_VALUE (i, alignment);
-
- *pos = i + array_len;
-}
-
-/**
- * Gets the alignment requirement for the given type;
- * will be 1, 4, or 8.
- *
- * @param typecode the type
- * @returns alignment of 1, 4, or 8
- */
-int
-_dbus_type_get_alignment (int typecode)
-{
- switch (typecode)
- {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_VARIANT:
- case DBUS_TYPE_SIGNATURE:
- return 1;
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- return 2;
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- /* this stuff is 4 since it starts with a length */
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- case DBUS_TYPE_ARRAY:
- return 4;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- /* struct is 8 since it could contain an 8-aligned item
- * and it's simpler to just always align structs to 8;
- * we want the amount of padding in a struct of a given
- * type to be predictable, not location-dependent.
- * DICT_ENTRY is always the same as struct.
- */
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_DICT_ENTRY:
- return 8;
-
- default:
- _dbus_assert_not_reached ("unknown typecode in _dbus_type_get_alignment()");
- return 0;
- }
-}
-
-/**
- * Returns a string describing the given type.
- *
- * @param typecode the type to describe
- * @returns a constant string describing the type
- */
-const char *
-_dbus_type_to_string (int typecode)
-{
- switch (typecode)
- {
- case DBUS_TYPE_INVALID:
- return "invalid";
- case DBUS_TYPE_BOOLEAN:
- return "boolean";
- case DBUS_TYPE_BYTE:
- return "byte";
- case DBUS_TYPE_INT16:
- return "int16";
- case DBUS_TYPE_UINT16:
- return "uint16";
- case DBUS_TYPE_INT32:
- return "int32";
- case DBUS_TYPE_UINT32:
- return "uint32";
- case DBUS_TYPE_INT64:
- return "int64";
- case DBUS_TYPE_UINT64:
- return "uint64";
- case DBUS_TYPE_DOUBLE:
- return "double";
- case DBUS_TYPE_STRING:
- return "string";
- case DBUS_TYPE_OBJECT_PATH:
- return "object_path";
- case DBUS_TYPE_SIGNATURE:
- return "signature";
- case DBUS_TYPE_STRUCT:
- return "struct";
- case DBUS_TYPE_DICT_ENTRY:
- return "dict_entry";
- case DBUS_TYPE_ARRAY:
- return "array";
- case DBUS_TYPE_VARIANT:
- return "variant";
- case DBUS_STRUCT_BEGIN_CHAR:
- return "begin_struct";
- case DBUS_STRUCT_END_CHAR:
- return "end_struct";
- case DBUS_DICT_ENTRY_BEGIN_CHAR:
- return "begin_dict_entry";
- case DBUS_DICT_ENTRY_END_CHAR:
- return "end_dict_entry";
- case DBUS_TYPE_UNIX_FD:
- return "unix_fd";
- default:
- return "unknown";
- }
-}
-
-/**
- * If in verbose mode, print a block of binary data.
- *
- * @param data the data
- * @param len the length of the data
- * @param offset where to start counting for byte indexes
- */
-void
-_dbus_verbose_bytes (const unsigned char *data,
- int len,
- int offset)
-{
- int i;
- const unsigned char *aligned;
-
- _dbus_assert (len >= 0);
-
- if (!_dbus_is_verbose())
- return;
-
- /* Print blanks on first row if appropriate */
- aligned = _DBUS_ALIGN_ADDRESS (data, 4);
- if (aligned > data)
- aligned -= 4;
- _dbus_assert (aligned <= data);
-
- if (aligned != data)
- {
- _dbus_verbose ("%4ld\t%p: ", - (long)(data - aligned), aligned);
- while (aligned != data)
- {
- _dbus_verbose (" ");
- ++aligned;
- }
- }
-
- /* now print the bytes */
- i = 0;
- while (i < len)
- {
- if (_DBUS_ALIGN_ADDRESS (&data[i], 4) == &data[i])
- {
- _dbus_verbose ("%4d\t%p: ",
- offset + i, &data[i]);
- }
-
- if (data[i] >= 32 &&
- data[i] <= 126)
- _dbus_verbose (" '%c' ", data[i]);
- else
- _dbus_verbose ("0x%s%x ",
- data[i] <= 0xf ? "0" : "", data[i]);
-
- ++i;
-
- if (_DBUS_ALIGN_ADDRESS (&data[i], 4) == &data[i])
- {
- if (i > 3)
- _dbus_verbose ("BE: %d LE: %d",
- _dbus_unpack_uint32 (DBUS_BIG_ENDIAN, &data[i-4]),
- _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN, &data[i-4]));
-
- if (i > 7 &&
- _DBUS_ALIGN_ADDRESS (&data[i], 8) == &data[i])
- {
-#ifdef DBUS_INT64_PRINTF_MODIFIER
- _dbus_verbose (" u64: 0x%" DBUS_INT64_PRINTF_MODIFIER "x",
- *(dbus_uint64_t*)&data[i-8]);
-#endif
- _dbus_verbose (" dbl: %g",
- *(double*)&data[i-8]);
- }
-
- _dbus_verbose ("\n");
- }
- }
-
- _dbus_verbose ("\n");
-}
-
-/**
- * Dump the given part of the string to verbose log.
- *
- * @param str the string
- * @param start the start of range to dump
- * @param len length of range
- */
-void
-_dbus_verbose_bytes_of_string (const DBusString *str,
- int start,
- int len)
-{
- const char *d;
- int real_len;
-
- real_len = _dbus_string_get_length (str);
-
- _dbus_assert (start >= 0);
-
- if (start > real_len)
- {
- _dbus_verbose (" [%d,%d) is not inside string of length %d\n",
- start, len, real_len);
- return;
- }
-
- if ((start + len) > real_len)
- {
- _dbus_verbose (" [%d,%d) extends outside string of length %d\n",
- start, len, real_len);
- len = real_len - start;
- }
-
- d = _dbus_string_get_const_data_len (str, start, len);
-
- _dbus_verbose_bytes (d, len, start);
-}
-
-static int
-map_type_char_to_type (int t)
-{
- if (t == DBUS_STRUCT_BEGIN_CHAR)
- return DBUS_TYPE_STRUCT;
- else if (t == DBUS_DICT_ENTRY_BEGIN_CHAR)
- return DBUS_TYPE_DICT_ENTRY;
- else
- {
- _dbus_assert (t != DBUS_STRUCT_END_CHAR);
- _dbus_assert (t != DBUS_DICT_ENTRY_END_CHAR);
- return t;
- }
-}
-
-/**
- * Get the first type in the signature. The difference between this
- * and just getting the first byte of the signature is that you won't
- * get DBUS_STRUCT_BEGIN_CHAR, you'll get DBUS_TYPE_STRUCT
- * instead.
- *
- * @param str string containing signature
- * @param pos where the signature starts
- * @returns the first type in the signature
- */
-int
-_dbus_first_type_in_signature (const DBusString *str,
- int pos)
-{
- return map_type_char_to_type (_dbus_string_get_byte (str, pos));
-}
-
-/**
- * Similar to #_dbus_first_type_in_signature, but operates
- * on a C string buffer.
- *
- * @param str a C string buffer
- * @param pos where the signature starts
- * @returns the first type in the signature
- */
-int
-_dbus_first_type_in_signature_c_str (const char *str,
- int pos)
-{
- return map_type_char_to_type (str[pos]);
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-/**
- * Reads a block of fixed-length basic values, as an optimization
- * vs. reading each one individually into a new buffer.
- *
- * This function returns the data in-place; it does not make a copy,
- * and it does not swap the bytes.
- *
- * If you ask for #DBUS_TYPE_DOUBLE you will get a "const double*" back
- * and the "value" argument should be a "const double**" and so on.
- *
- * @param str the string to read from
- * @param pos position to read from
- * @param element_type type of array elements
- * @param value place to return the array
- * @param n_elements number of array elements to read
- * @param byte_order the byte order, used to read the array length
- * @param new_pos #NULL or location to store a position after the elements
- */
-void
-_dbus_marshal_read_fixed_multi (const DBusString *str,
- int pos,
- int element_type,
- void *value,
- int n_elements,
- int byte_order,
- int *new_pos)
-{
- int array_len;
- int alignment;
-
- _dbus_assert (dbus_type_is_fixed (element_type));
- _dbus_assert (dbus_type_is_basic (element_type));
-
-#if 0
- _dbus_verbose ("reading %d elements of %s\n",
- n_elements, _dbus_type_to_string (element_type));
-#endif
-
- alignment = _dbus_type_get_alignment (element_type);
-
- pos = _DBUS_ALIGN_VALUE (pos, alignment);
-
- array_len = n_elements * alignment;
-
- *(const DBusBasicValue**) value = (void*) _dbus_string_get_const_data_len (str, pos, array_len);
- if (new_pos)
- *new_pos = pos + array_len;
-}
-
-static void
-swap_test_array (void *array,
- int len_bytes,
- int byte_order,
- int alignment)
-{
- DBusString t;
-
- if (alignment == 1)
- return;
-
- _dbus_string_init_const_len (&t, array, len_bytes);
- swap_array (&t, 0, len_bytes / alignment, byte_order, alignment);
-}
-
-#define MARSHAL_BASIC(typename, byte_order, literal) \
- do { \
- v_##typename = literal; \
- if (!_dbus_marshal_write_basic (&str, pos, DBUS_TYPE_##typename, \
- &v_##typename, \
- byte_order, NULL)) \
- _dbus_assert_not_reached ("no memory"); \
- } while (0)
-
-#define DEMARSHAL_BASIC(typename, byte_order) \
- do { \
- _dbus_marshal_read_basic (&str, pos, DBUS_TYPE_##typename, &v_##typename, \
- byte_order, &pos); \
- } while (0)
-
-#define DEMARSHAL_BASIC_AND_CHECK(typename, byte_order, literal) \
- do { \
- DEMARSHAL_BASIC (typename, byte_order); \
- if (literal != v_##typename) \
- { \
- _dbus_verbose_bytes_of_string (&str, dump_pos, \
- _dbus_string_get_length (&str) - dump_pos); \
- _dbus_assert_not_reached ("demarshaled wrong value"); \
- } \
- } while (0)
-
-#define MARSHAL_TEST(typename, byte_order, literal) \
- do { \
- MARSHAL_BASIC (typename, byte_order, literal); \
- dump_pos = pos; \
- DEMARSHAL_BASIC_AND_CHECK (typename, byte_order, literal); \
- } while (0)
-
-#define MARSHAL_TEST_STRCMP(typename, byte_order, literal) \
- do { \
- MARSHAL_BASIC (typename, byte_order, literal); \
- dump_pos = pos; \
- DEMARSHAL_BASIC (typename, byte_order); \
- if (strcmp (literal, v_##typename) != 0) \
- { \
- _dbus_verbose_bytes_of_string (&str, dump_pos, \
- _dbus_string_get_length (&str) - dump_pos); \
- _dbus_warn ("literal '%s'\nvalue '%s'\n", literal, v_##typename); \
- _dbus_assert_not_reached ("demarshaled wrong value"); \
- } \
- } while (0)
-
-#define MARSHAL_FIXED_ARRAY(typename, byte_order, literal) \
- do { \
- int next; \
- v_UINT32 = sizeof(literal); \
- if (!_dbus_marshal_write_basic (&str, pos, DBUS_TYPE_UINT32, &v_UINT32, \
- byte_order, &next)) \
- _dbus_assert_not_reached ("no memory"); \
- v_ARRAY_##typename = literal; \
- if (!_dbus_marshal_write_fixed_multi (&str, next, DBUS_TYPE_##typename, \
- &v_ARRAY_##typename, _DBUS_N_ELEMENTS(literal), \
- byte_order, NULL)) \
- _dbus_assert_not_reached ("no memory"); \
- } while (0)
-
-#define DEMARSHAL_FIXED_ARRAY(typename, byte_order) \
- do { \
- int next; \
- alignment = _dbus_type_get_alignment (DBUS_TYPE_##typename); \
- v_UINT32 = _dbus_marshal_read_uint32 (&str, dump_pos, byte_order, &next); \
- _dbus_marshal_read_fixed_multi (&str, next, DBUS_TYPE_##typename, &v_ARRAY_##typename, \
- v_UINT32/alignment, \
- byte_order, NULL); \
- swap_test_array (v_ARRAY_##typename, v_UINT32, \
- byte_order, alignment); \
- } while (0)
-
-#define DEMARSHAL_FIXED_ARRAY_AND_CHECK(typename, byte_order, literal) \
- do { \
- DEMARSHAL_FIXED_ARRAY (typename, byte_order); \
- if (memcmp (literal, v_ARRAY_##typename, sizeof (literal) != 0)) \
- { \
- _dbus_verbose ("MARSHALED DATA\n"); \
- _dbus_verbose_bytes_of_string (&str, dump_pos, \
- _dbus_string_get_length (&str) - dump_pos); \
- _dbus_verbose ("LITERAL DATA\n"); \
- _dbus_verbose_bytes ((char*)literal, sizeof (literal), 0); \
- _dbus_verbose ("READ DATA\n"); \
- _dbus_verbose_bytes ((char*)v_ARRAY_##typename, sizeof (literal), 0); \
- _dbus_assert_not_reached ("demarshaled wrong fixed array value"); \
- } \
- } while (0)
-
-#define MARSHAL_TEST_FIXED_ARRAY(typename, byte_order, literal) \
- do { \
- MARSHAL_FIXED_ARRAY (typename, byte_order, literal); \
- dump_pos = pos; \
- DEMARSHAL_FIXED_ARRAY_AND_CHECK (typename, byte_order, literal); \
- } while (0)
-
-dbus_bool_t
-_dbus_marshal_test (void)
-{
- int alignment;
- DBusString str;
- int pos, dump_pos;
- unsigned char array1[5] = { 3, 4, 0, 1, 9 };
- dbus_int16_t array2[3] = { 124, 457, 780 };
- dbus_int32_t array4[3] = { 123, 456, 789 };
- dbus_int64_t array8[3] = { DBUS_INT64_CONSTANT (0x123ffffffff),
- DBUS_INT64_CONSTANT (0x456ffffffff),
- DBUS_INT64_CONSTANT (0x789ffffffff) };
- dbus_int64_t *v_ARRAY_INT64;
- unsigned char *v_ARRAY_BYTE;
- dbus_int16_t *v_ARRAY_INT16;
- dbus_uint16_t *v_ARRAY_UINT16;
- dbus_int32_t *v_ARRAY_INT32;
- dbus_uint32_t *v_ARRAY_UINT32;
- DBusString t;
- double v_DOUBLE;
- double t_DOUBLE;
- dbus_int16_t v_INT16;
- dbus_uint16_t v_UINT16;
- dbus_int32_t v_INT32;
- dbus_uint32_t v_UINT32;
- dbus_int64_t v_INT64;
- dbus_uint64_t v_UINT64;
- unsigned char v_BYTE;
- dbus_bool_t v_BOOLEAN;
- const char *v_STRING;
- const char *v_SIGNATURE;
- const char *v_OBJECT_PATH;
- int byte_order;
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- pos = 0;
-
- /* Marshal doubles */
- MARSHAL_BASIC (DOUBLE, DBUS_BIG_ENDIAN, 3.14);
- DEMARSHAL_BASIC (DOUBLE, DBUS_BIG_ENDIAN);
- t_DOUBLE = 3.14;
- if (!_DBUS_DOUBLES_BITWISE_EQUAL (t_DOUBLE, v_DOUBLE))
- _dbus_assert_not_reached ("got wrong double value");
-
- MARSHAL_BASIC (DOUBLE, DBUS_LITTLE_ENDIAN, 3.14);
- DEMARSHAL_BASIC (DOUBLE, DBUS_LITTLE_ENDIAN);
- t_DOUBLE = 3.14;
- if (!_DBUS_DOUBLES_BITWISE_EQUAL (t_DOUBLE, v_DOUBLE))
- _dbus_assert_not_reached ("got wrong double value");
-
- /* Marshal signed 16 integers */
- MARSHAL_TEST (INT16, DBUS_BIG_ENDIAN, -12345);
- MARSHAL_TEST (INT16, DBUS_LITTLE_ENDIAN, -12345);
-
- /* Marshal unsigned 16 integers */
- MARSHAL_TEST (UINT16, DBUS_BIG_ENDIAN, 0x1234);
- MARSHAL_TEST (UINT16, DBUS_LITTLE_ENDIAN, 0x1234);
-
- /* Marshal signed integers */
- MARSHAL_TEST (INT32, DBUS_BIG_ENDIAN, -12345678);
- MARSHAL_TEST (INT32, DBUS_LITTLE_ENDIAN, -12345678);
-
- /* Marshal unsigned integers */
- MARSHAL_TEST (UINT32, DBUS_BIG_ENDIAN, 0x12345678);
- MARSHAL_TEST (UINT32, DBUS_LITTLE_ENDIAN, 0x12345678);
-
- /* Marshal signed integers */
- MARSHAL_TEST (INT64, DBUS_BIG_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
- MARSHAL_TEST (INT64, DBUS_LITTLE_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
-
- /* Marshal unsigned integers */
- MARSHAL_TEST (UINT64, DBUS_BIG_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
- MARSHAL_TEST (UINT64, DBUS_LITTLE_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
-
- /* Marshal byte */
- MARSHAL_TEST (BYTE, DBUS_BIG_ENDIAN, 5);
- MARSHAL_TEST (BYTE, DBUS_LITTLE_ENDIAN, 5);
-
- /* Marshal all possible bools! */
- MARSHAL_TEST (BOOLEAN, DBUS_BIG_ENDIAN, FALSE);
- MARSHAL_TEST (BOOLEAN, DBUS_LITTLE_ENDIAN, FALSE);
- MARSHAL_TEST (BOOLEAN, DBUS_BIG_ENDIAN, TRUE);
- MARSHAL_TEST (BOOLEAN, DBUS_LITTLE_ENDIAN, TRUE);
-
- /* Marshal strings */
- MARSHAL_TEST_STRCMP (STRING, DBUS_BIG_ENDIAN, "");
- MARSHAL_TEST_STRCMP (STRING, DBUS_LITTLE_ENDIAN, "");
- MARSHAL_TEST_STRCMP (STRING, DBUS_BIG_ENDIAN, "This is the dbus test string");
- MARSHAL_TEST_STRCMP (STRING, DBUS_LITTLE_ENDIAN, "This is the dbus test string");
-
- /* object paths */
- MARSHAL_TEST_STRCMP (OBJECT_PATH, DBUS_BIG_ENDIAN, "/a/b/c");
- MARSHAL_TEST_STRCMP (OBJECT_PATH, DBUS_LITTLE_ENDIAN, "/a/b/c");
-
- /* signatures */
- MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_BIG_ENDIAN, "");
- MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_LITTLE_ENDIAN, "");
- MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_BIG_ENDIAN, "a(ii)");
- MARSHAL_TEST_STRCMP (SIGNATURE, DBUS_LITTLE_ENDIAN, "a(ii)");
-
- /* Arrays */
- MARSHAL_TEST_FIXED_ARRAY (INT16, DBUS_BIG_ENDIAN, array2);
- MARSHAL_TEST_FIXED_ARRAY (INT16, DBUS_LITTLE_ENDIAN, array2);
- MARSHAL_TEST_FIXED_ARRAY (UINT16, DBUS_BIG_ENDIAN, array2);
- MARSHAL_TEST_FIXED_ARRAY (UINT16, DBUS_LITTLE_ENDIAN, array2);
-
- MARSHAL_TEST_FIXED_ARRAY (INT32, DBUS_BIG_ENDIAN, array4);
- MARSHAL_TEST_FIXED_ARRAY (INT32, DBUS_LITTLE_ENDIAN, array4);
- MARSHAL_TEST_FIXED_ARRAY (UINT32, DBUS_BIG_ENDIAN, array4);
- MARSHAL_TEST_FIXED_ARRAY (UINT32, DBUS_LITTLE_ENDIAN, array4);
-
- MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_BIG_ENDIAN, array1);
- MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_LITTLE_ENDIAN, array1);
-
- MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_BIG_ENDIAN, array8);
- MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_LITTLE_ENDIAN, array8);
-
-#if 0
-
- /*
- * FIXME restore the set/pack tests
- */
-
- /* set/pack 64-bit integers */
- _dbus_string_set_length (&str, 8);
-
- /* signed little */
- _dbus_marshal_set_int64 (&str, DBUS_LITTLE_ENDIAN,
- 0, DBUS_INT64_CONSTANT (-0x123456789abc7));
-
- _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
- _dbus_unpack_int64 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed big */
- _dbus_marshal_set_int64 (&str, DBUS_BIG_ENDIAN,
- 0, DBUS_INT64_CONSTANT (-0x123456789abc7));
-
- _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
- _dbus_unpack_int64 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed little pack */
- _dbus_pack_int64 (DBUS_INT64_CONSTANT (-0x123456789abc7),
- DBUS_LITTLE_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
- _dbus_unpack_int64 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed big pack */
- _dbus_pack_int64 (DBUS_INT64_CONSTANT (-0x123456789abc7),
- DBUS_BIG_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (DBUS_INT64_CONSTANT (-0x123456789abc7) ==
- _dbus_unpack_int64 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned little */
- _dbus_marshal_set_uint64 (&str, DBUS_LITTLE_ENDIAN,
- 0, DBUS_UINT64_CONSTANT (0x123456789abc7));
-
- _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
- _dbus_unpack_uint64 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned big */
- _dbus_marshal_set_uint64 (&str, DBUS_BIG_ENDIAN,
- 0, DBUS_UINT64_CONSTANT (0x123456789abc7));
-
- _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
- _dbus_unpack_uint64 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned little pack */
- _dbus_pack_uint64 (DBUS_UINT64_CONSTANT (0x123456789abc7),
- DBUS_LITTLE_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
- _dbus_unpack_uint64 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned big pack */
- _dbus_pack_uint64 (DBUS_UINT64_CONSTANT (0x123456789abc7),
- DBUS_BIG_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
- _dbus_unpack_uint64 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* set/pack 32-bit integers */
- _dbus_string_set_length (&str, 4);
-
- /* signed little */
- _dbus_marshal_set_int32 (&str, DBUS_LITTLE_ENDIAN,
- 0, -0x123456);
-
- _dbus_assert (-0x123456 ==
- _dbus_unpack_int32 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed big */
- _dbus_marshal_set_int32 (&str, DBUS_BIG_ENDIAN,
- 0, -0x123456);
-
- _dbus_assert (-0x123456 ==
- _dbus_unpack_int32 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed little pack */
- _dbus_pack_int32 (-0x123456,
- DBUS_LITTLE_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (-0x123456 ==
- _dbus_unpack_int32 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* signed big pack */
- _dbus_pack_int32 (-0x123456,
- DBUS_BIG_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (-0x123456 ==
- _dbus_unpack_int32 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned little */
- _dbus_marshal_set_uint32 (&str,
- 0, 0x123456,
- DBUS_LITTLE_ENDIAN);
-
- _dbus_assert (0x123456 ==
- _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned big */
- _dbus_marshal_set_uint32 (&str,
- 0, 0x123456,
- DBUS_BIG_ENDIAN);
-
- _dbus_assert (0x123456 ==
- _dbus_unpack_uint32 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned little pack */
- _dbus_pack_uint32 (0x123456,
- DBUS_LITTLE_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (0x123456 ==
- _dbus_unpack_uint32 (DBUS_LITTLE_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
- /* unsigned big pack */
- _dbus_pack_uint32 (0x123456,
- DBUS_BIG_ENDIAN,
- _dbus_string_get_data (&str));
-
- _dbus_assert (0x123456 ==
- _dbus_unpack_uint32 (DBUS_BIG_ENDIAN,
- _dbus_string_get_const_data (&str)));
-
-#endif /* set/pack tests for integers */
-
- /* Strings in-place set */
- byte_order = DBUS_LITTLE_ENDIAN;
- while (TRUE)
- {
- /* Init a string */
- _dbus_string_set_length (&str, 0);
-
- /* reset pos for the macros */
- pos = 0;
-
- MARSHAL_TEST_STRCMP (STRING, byte_order, "Hello world");
-
- /* Set it to something longer */
- _dbus_string_init_const (&t, "Hello world foo");
-
- v_STRING = _dbus_string_get_const_data (&t);
- _dbus_marshal_set_basic (&str, 0, DBUS_TYPE_STRING,
- &v_STRING, byte_order, NULL, NULL);
-
- _dbus_marshal_read_basic (&str, 0, DBUS_TYPE_STRING,
- &v_STRING, byte_order,
- NULL);
- _dbus_assert (strcmp (v_STRING, "Hello world foo") == 0);
-
- /* Set it to something shorter */
- _dbus_string_init_const (&t, "Hello");
-
- v_STRING = _dbus_string_get_const_data (&t);
- _dbus_marshal_set_basic (&str, 0, DBUS_TYPE_STRING,
- &v_STRING, byte_order, NULL, NULL);
- _dbus_marshal_read_basic (&str, 0, DBUS_TYPE_STRING,
- &v_STRING, byte_order,
- NULL);
- _dbus_assert (strcmp (v_STRING, "Hello") == 0);
-
- /* Do the other byte order */
- if (byte_order == DBUS_LITTLE_ENDIAN)
- byte_order = DBUS_BIG_ENDIAN;
- else
- break;
- }
-
- /* Clean up */
- _dbus_string_free (&str);
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.h
deleted file mode 100644
index 9df67cb816..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-basic.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-basic.h Marshalling routines for basic (primitive) types
- *
- * Copyright (C) 2002 CodeFactory AB
- * Copyright (C) 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MARSHAL_BASIC_H
-#define DBUS_MARSHAL_BASIC_H
-
-#ifdef HAVE_BYTESWAP_H
-#include <byteswap.h>
-#endif
-
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-arch-deps.h>
-#include <dbus/dbus-string.h>
-
-#ifdef WORDS_BIGENDIAN
-#define DBUS_COMPILER_BYTE_ORDER DBUS_BIG_ENDIAN
-#else
-#define DBUS_COMPILER_BYTE_ORDER DBUS_LITTLE_ENDIAN
-#endif
-
-#ifdef HAVE_BYTESWAP_H
-#define DBUS_UINT16_SWAP_LE_BE_CONSTANT(val) bswap_16(val)
-#define DBUS_UINT32_SWAP_LE_BE_CONSTANT(val) bswap_32(val)
-#else /* HAVE_BYTESWAP_H */
-
-#define DBUS_UINT16_SWAP_LE_BE_CONSTANT(val) ((dbus_uint16_t) ( \
- (dbus_uint16_t) ((dbus_uint16_t) (val) >> 8) | \
- (dbus_uint16_t) ((dbus_uint16_t) (val) << 8)))
-
-#define DBUS_UINT32_SWAP_LE_BE_CONSTANT(val) ((dbus_uint32_t) ( \
- (((dbus_uint32_t) (val) & (dbus_uint32_t) 0x000000ffU) << 24) | \
- (((dbus_uint32_t) (val) & (dbus_uint32_t) 0x0000ff00U) << 8) | \
- (((dbus_uint32_t) (val) & (dbus_uint32_t) 0x00ff0000U) >> 8) | \
- (((dbus_uint32_t) (val) & (dbus_uint32_t) 0xff000000U) >> 24)))
-
-#endif /* HAVE_BYTESWAP_H */
-
-#ifdef HAVE_BYTESWAP_H
-#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val) bswap_64(val)
-#else /* HAVE_BYTESWAP_H */
-
-#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val) ((dbus_uint64_t) ( \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00000000000000ff)) << 56) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x000000000000ff00)) << 40) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x0000000000ff0000)) << 24) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00000000ff000000)) << 8) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x000000ff00000000)) >> 8) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x0000ff0000000000)) >> 24) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00ff000000000000)) >> 40) | \
- (((dbus_uint64_t) (val) & \
- (dbus_uint64_t) DBUS_UINT64_CONSTANT (0xff00000000000000)) >> 56)))
-
-#endif /* HAVE_BYTESWAP_H */
-
-#define DBUS_UINT16_SWAP_LE_BE(val) (DBUS_UINT16_SWAP_LE_BE_CONSTANT (val))
-#define DBUS_INT16_SWAP_LE_BE(val) ((dbus_int16_t)DBUS_UINT16_SWAP_LE_BE_CONSTANT (val))
-
-#define DBUS_UINT32_SWAP_LE_BE(val) (DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
-#define DBUS_INT32_SWAP_LE_BE(val) ((dbus_int32_t)DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
-
-#define DBUS_UINT64_SWAP_LE_BE(val) (DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
-#define DBUS_INT64_SWAP_LE_BE(val) ((dbus_int64_t)DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
-
-#ifdef WORDS_BIGENDIAN
-
-# define DBUS_INT16_TO_BE(val) ((dbus_int16_t) (val))
-# define DBUS_UINT16_TO_BE(val) ((dbus_uint16_t) (val))
-# define DBUS_INT16_TO_LE(val) (DBUS_INT16_SWAP_LE_BE (val))
-# define DBUS_UINT16_TO_LE(val) (DBUS_UINT16_SWAP_LE_BE (val))
-# define DBUS_INT32_TO_BE(val) ((dbus_int32_t) (val))
-# define DBUS_UINT32_TO_BE(val) ((dbus_uint32_t) (val))
-# define DBUS_INT32_TO_LE(val) (DBUS_INT32_SWAP_LE_BE (val))
-# define DBUS_UINT32_TO_LE(val) (DBUS_UINT32_SWAP_LE_BE (val))
-# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) (val))
-# define DBUS_UINT64_TO_BE(val) ((dbus_uint64_t) (val))
-# define DBUS_INT64_TO_LE(val) (DBUS_INT64_SWAP_LE_BE (val))
-# define DBUS_UINT64_TO_LE(val) (DBUS_UINT64_SWAP_LE_BE (val))
-
-#else /* WORDS_BIGENDIAN */
-
-# define DBUS_INT16_TO_LE(val) ((dbus_int16_t) (val))
-# define DBUS_UINT16_TO_LE(val) ((dbus_uint16_t) (val))
-# define DBUS_INT16_TO_BE(val) ((dbus_int16_t) DBUS_UINT16_SWAP_LE_BE (val))
-# define DBUS_UINT16_TO_BE(val) (DBUS_UINT16_SWAP_LE_BE (val))
-# define DBUS_INT32_TO_LE(val) ((dbus_int32_t) (val))
-# define DBUS_UINT32_TO_LE(val) ((dbus_uint32_t) (val))
-# define DBUS_INT32_TO_BE(val) ((dbus_int32_t) DBUS_UINT32_SWAP_LE_BE (val))
-# define DBUS_UINT32_TO_BE(val) (DBUS_UINT32_SWAP_LE_BE (val))
-# define DBUS_INT64_TO_LE(val) ((dbus_int64_t) (val))
-# define DBUS_UINT64_TO_LE(val) ((dbus_uint64_t) (val))
-# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) DBUS_UINT64_SWAP_LE_BE (val))
-# define DBUS_UINT64_TO_BE(val) (DBUS_UINT64_SWAP_LE_BE (val))
-#endif
-
-/* The transformation is symmetric, so the FROM just maps to the TO. */
-#define DBUS_INT16_FROM_LE(val) (DBUS_INT16_TO_LE (val))
-#define DBUS_UINT16_FROM_LE(val) (DBUS_UINT16_TO_LE (val))
-#define DBUS_INT16_FROM_BE(val) (DBUS_INT16_TO_BE (val))
-#define DBUS_UINT16_FROM_BE(val) (DBUS_UINT16_TO_BE (val))
-#define DBUS_INT32_FROM_LE(val) (DBUS_INT32_TO_LE (val))
-#define DBUS_UINT32_FROM_LE(val) (DBUS_UINT32_TO_LE (val))
-#define DBUS_INT32_FROM_BE(val) (DBUS_INT32_TO_BE (val))
-#define DBUS_UINT32_FROM_BE(val) (DBUS_UINT32_TO_BE (val))
-#define DBUS_INT64_FROM_LE(val) (DBUS_INT64_TO_LE (val))
-#define DBUS_UINT64_FROM_LE(val) (DBUS_UINT64_TO_LE (val))
-#define DBUS_INT64_FROM_BE(val) (DBUS_INT64_TO_BE (val))
-#define DBUS_UINT64_FROM_BE(val) (DBUS_UINT64_TO_BE (val))
-
-#ifdef DBUS_DISABLE_ASSERT
-#define _dbus_unpack_uint16(byte_order, data) \
- (((byte_order) == DBUS_LITTLE_ENDIAN) ? \
- DBUS_UINT16_FROM_LE (*(dbus_uint16_t*)(data)) : \
- DBUS_UINT16_FROM_BE (*(dbus_uint16_t*)(data)))
-
-#define _dbus_unpack_uint32(byte_order, data) \
- (((byte_order) == DBUS_LITTLE_ENDIAN) ? \
- DBUS_UINT32_FROM_LE (*(dbus_uint32_t*)(data)) : \
- DBUS_UINT32_FROM_BE (*(dbus_uint32_t*)(data)))
-#endif
-
-#ifndef _dbus_unpack_uint16
-dbus_uint16_t _dbus_unpack_uint16 (int byte_order,
- const unsigned char *data);
-#endif
-
-void _dbus_pack_uint32 (dbus_uint32_t value,
- int byte_order,
- unsigned char *data);
-#ifndef _dbus_unpack_uint32
-dbus_uint32_t _dbus_unpack_uint32 (int byte_order,
- const unsigned char *data);
-#endif
-
-dbus_bool_t _dbus_marshal_set_basic (DBusString *str,
- int pos,
- int type,
- const void *value,
- int byte_order,
- int *old_end_pos,
- int *new_end_pos);
-dbus_bool_t _dbus_marshal_write_basic (DBusString *str,
- int insert_at,
- int type,
- const void *value,
- int byte_order,
- int *pos_after);
-dbus_bool_t _dbus_marshal_write_fixed_multi (DBusString *str,
- int insert_at,
- int element_type,
- const void *value,
- int n_elements,
- int byte_order,
- int *pos_after);
-void _dbus_marshal_read_basic (const DBusString *str,
- int pos,
- int type,
- void *value,
- int byte_order,
- int *new_pos);
-void _dbus_marshal_read_fixed_multi (const DBusString *str,
- int pos,
- int element_type,
- void *value,
- int n_elements,
- int byte_order,
- int *new_pos);
-void _dbus_marshal_skip_basic (const DBusString *str,
- int type,
- int byte_order,
- int *pos);
-void _dbus_marshal_skip_array (const DBusString *str,
- int element_type,
- int byte_order,
- int *pos);
-void _dbus_marshal_set_uint32 (DBusString *str,
- int pos,
- dbus_uint32_t value,
- int byte_order);
-dbus_uint32_t _dbus_marshal_read_uint32 (const DBusString *str,
- int pos,
- int byte_order,
- int *new_pos);
-int _dbus_type_get_alignment (int typecode);
-int _dbus_type_get_alignment (int typecode);
-const char* _dbus_type_to_string (int typecode);
-
-int _dbus_first_type_in_signature (const DBusString *str,
- int pos);
-
-int _dbus_first_type_in_signature_c_str (const char *str,
- int pos);
-
-void _dbus_swap_array (unsigned char *data,
- int n_elements,
- int alignment);
-
-#endif /* DBUS_MARSHAL_BASIC_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap-util.c
deleted file mode 100644
index 57874859cf..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap-util.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-byteswap-util.c Would be in dbus-marshal-byteswap.c but tests/bus only
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-marshal-byteswap.h"
-#include "dbus-test.h"
-#include <stdio.h>
-
-static void
-do_byteswap_test (int byte_order)
-{
- int sequence;
- DBusString signature;
- DBusString body;
- int opposite_order;
-
- if (!_dbus_string_init (&signature) || !_dbus_string_init (&body))
- _dbus_assert_not_reached ("oom");
-
- opposite_order = byte_order == DBUS_LITTLE_ENDIAN ? DBUS_BIG_ENDIAN : DBUS_LITTLE_ENDIAN;
-
- sequence = 0;
- while (dbus_internal_do_not_use_generate_bodies (sequence,
- byte_order,
- &signature, &body))
- {
- DBusString copy;
- DBusTypeReader body_reader;
- DBusTypeReader copy_reader;
-
- if (!_dbus_string_init (&copy))
- _dbus_assert_not_reached ("oom");
-
- if (!_dbus_string_copy (&body, 0, &copy, 0))
- _dbus_assert_not_reached ("oom");
-
- _dbus_marshal_byteswap (&signature, 0,
- byte_order,
- opposite_order,
- &copy, 0);
-
- _dbus_type_reader_init (&body_reader, byte_order, &signature, 0,
- &body, 0);
- _dbus_type_reader_init (&copy_reader, opposite_order, &signature, 0,
- &copy, 0);
-
- if (!_dbus_type_reader_equal_values (&body_reader, &copy_reader))
- {
- _dbus_verbose_bytes_of_string (&signature, 0,
- _dbus_string_get_length (&signature));
- _dbus_verbose_bytes_of_string (&body, 0,
- _dbus_string_get_length (&body));
- _dbus_verbose_bytes_of_string (&copy, 0,
- _dbus_string_get_length (&copy));
-
- _dbus_warn ("Byte-swapped data did not have same values as original data\n");
- _dbus_assert_not_reached ("test failed");
- }
-
- _dbus_string_free (&copy);
-
- _dbus_string_set_length (&signature, 0);
- _dbus_string_set_length (&body, 0);
- ++sequence;
- }
-
- _dbus_string_free (&signature);
- _dbus_string_free (&body);
-
- printf (" %d blocks swapped from order '%c' to '%c'\n",
- sequence, byte_order, opposite_order);
-}
-
-dbus_bool_t
-_dbus_marshal_byteswap_test (void)
-{
- do_byteswap_test (DBUS_LITTLE_ENDIAN);
- do_byteswap_test (DBUS_BIG_ENDIAN);
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.c
deleted file mode 100644
index e6711be605..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-byteswap.c Swap a block of marshaled data
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-marshal-byteswap.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-signature.h"
-
-/**
- * @addtogroup DBusMarshal
- * @{
- */
-
-static void
-byteswap_body_helper (DBusTypeReader *reader,
- dbus_bool_t walk_reader_to_end,
- int old_byte_order,
- int new_byte_order,
- unsigned char *p,
- unsigned char **new_p)
-{
- int current_type;
-
- while ((current_type = _dbus_type_reader_get_current_type (reader)) != DBUS_TYPE_INVALID)
- {
- switch (current_type)
- {
- case DBUS_TYPE_BYTE:
- ++p;
- break;
-
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- {
- p = _DBUS_ALIGN_ADDRESS (p, 2);
- *((dbus_uint16_t*)p) = DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t*)p));
- p += 2;
- }
- break;
-
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- {
- p = _DBUS_ALIGN_ADDRESS (p, 4);
- *((dbus_uint32_t*)p) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)p));
- p += 4;
- }
- break;
-
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- {
- p = _DBUS_ALIGN_ADDRESS (p, 8);
- *((dbus_uint64_t*)p) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)p));
- p += 8;
- }
- break;
-
- case DBUS_TYPE_ARRAY:
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- {
- dbus_uint32_t array_len;
-
- p = _DBUS_ALIGN_ADDRESS (p, 4);
-
- array_len = _dbus_unpack_uint32 (old_byte_order, p);
-
- *((dbus_uint32_t*)p) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)p));
- p += 4;
-
- if (current_type == DBUS_TYPE_ARRAY)
- {
- int elem_type;
- int alignment;
-
- elem_type = _dbus_type_reader_get_element_type (reader);
- alignment = _dbus_type_get_alignment (elem_type);
-
- _dbus_assert ((array_len / alignment) < DBUS_MAXIMUM_ARRAY_LENGTH);
-
- p = _DBUS_ALIGN_ADDRESS (p, alignment);
-
- if (dbus_type_is_fixed (elem_type))
- {
- if (alignment > 1)
- _dbus_swap_array (p, array_len / alignment, alignment);
- p += array_len;
- }
- else
- {
- DBusTypeReader sub;
- const unsigned char *array_end;
-
- array_end = p + array_len;
-
- _dbus_type_reader_recurse (reader, &sub);
-
- while (p < array_end)
- {
- byteswap_body_helper (&sub,
- FALSE,
- old_byte_order,
- new_byte_order,
- p, &p);
- }
- }
- }
- else
- {
- _dbus_assert (current_type == DBUS_TYPE_STRING ||
- current_type == DBUS_TYPE_OBJECT_PATH);
-
- p += (array_len + 1); /* + 1 for nul */
- }
- }
- break;
-
- case DBUS_TYPE_SIGNATURE:
- {
- dbus_uint32_t sig_len;
-
- sig_len = *p;
-
- p += (sig_len + 2); /* +2 for len and nul */
- }
- break;
-
- case DBUS_TYPE_VARIANT:
- {
- /* 1 byte sig len, sig typecodes, align to
- * contained-type-boundary, values.
- */
- dbus_uint32_t sig_len;
- DBusString sig;
- DBusTypeReader sub;
- int contained_alignment;
-
- sig_len = *p;
- ++p;
-
- _dbus_string_init_const_len (&sig, p, sig_len);
-
- p += (sig_len + 1); /* 1 for nul */
-
- contained_alignment = _dbus_type_get_alignment (_dbus_first_type_in_signature (&sig, 0));
-
- p = _DBUS_ALIGN_ADDRESS (p, contained_alignment);
-
- _dbus_type_reader_init_types_only (&sub, &sig, 0);
-
- byteswap_body_helper (&sub, FALSE, old_byte_order, new_byte_order, p, &p);
- }
- break;
-
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_DICT_ENTRY:
- {
- DBusTypeReader sub;
-
- p = _DBUS_ALIGN_ADDRESS (p, 8);
-
- _dbus_type_reader_recurse (reader, &sub);
-
- byteswap_body_helper (&sub, TRUE, old_byte_order, new_byte_order, p, &p);
- }
- break;
-
- case DBUS_TYPE_UNIX_FD:
- /* fds can only be passed on a local machine, so byte order must always match */
- _dbus_assert_not_reached("attempted to byteswap unix fds which makes no sense");
- break;
-
- default:
- _dbus_assert_not_reached ("invalid typecode in supposedly-validated signature");
- break;
- }
-
- if (walk_reader_to_end)
- _dbus_type_reader_next (reader);
- else
- break;
- }
-
- if (new_p)
- *new_p = p;
-}
-
-/**
- * Byteswaps the marshaled data in the given value_str.
- *
- * @param signature the types in the value_str
- * @param signature_start where in signature is the signature
- * @param old_byte_order the old byte order
- * @param new_byte_order the new byte order
- * @param value_str the string containing the body
- * @param value_pos where the values start
- */
-void
-_dbus_marshal_byteswap (const DBusString *signature,
- int signature_start,
- int old_byte_order,
- int new_byte_order,
- DBusString *value_str,
- int value_pos)
-{
- DBusTypeReader reader;
-
- _dbus_assert (value_pos >= 0);
- _dbus_assert (value_pos <= _dbus_string_get_length (value_str));
-
- if (old_byte_order == new_byte_order)
- return;
-
- _dbus_type_reader_init_types_only (&reader,
- signature, signature_start);
-
- byteswap_body_helper (&reader, TRUE,
- old_byte_order, new_byte_order,
- _dbus_string_get_data_len (value_str, value_pos, 0),
- NULL);
-}
-
-/** @} */
-
-/* Tests in dbus-marshal-byteswap-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.h
deleted file mode 100644
index be2dd7583f..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-byteswap.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-byteswap.h Swap a block of marshaled data
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MARSHAL_BYTESWAP_H
-#define DBUS_MARSHAL_BYTESWAP_H
-
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-marshal-recursive.h>
-
-void _dbus_marshal_byteswap (const DBusString *signature,
- int signature_start,
- int old_byte_order,
- int new_byte_order,
- DBusString *value_str,
- int value_pos);
-
-#endif /* DBUS_MARSHAL_BYTESWAP_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.c
deleted file mode 100644
index 48151c6255..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.c
+++ /dev/null
@@ -1,1514 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-header.c Managing marshaling/demarshaling of message headers
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus/dbus-shared.h"
-#include "dbus-marshal-header.h"
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-byteswap.h"
-
-/**
- * @addtogroup DBusMarshal
- *
- * @{
- */
-
-
-/* Not thread locked, but strictly const/read-only so should be OK
- */
-/** Static #DBusString containing the signature of a message header */
-_DBUS_STRING_DEFINE_STATIC(_dbus_header_signature_str, DBUS_HEADER_SIGNATURE);
-/** Static #DBusString containing the local interface */
-_DBUS_STRING_DEFINE_STATIC(_dbus_local_interface_str, DBUS_INTERFACE_LOCAL);
-/** Static #DBusString containing the local path */
-_DBUS_STRING_DEFINE_STATIC(_dbus_local_path_str, DBUS_PATH_LOCAL);
-
-/** Offset from start of _dbus_header_signature_str to the signature of the fields array */
-#define FIELDS_ARRAY_SIGNATURE_OFFSET 6
-/** Offset from start of _dbus_header_signature_str to the signature of an element of the fields array */
-#define FIELDS_ARRAY_ELEMENT_SIGNATURE_OFFSET 7
-
-
-/** Offset to byte order from start of header */
-#define BYTE_ORDER_OFFSET 0
-/** Offset to type from start of header */
-#define TYPE_OFFSET 1
-/** Offset to flags from start of header */
-#define FLAGS_OFFSET 2
-/** Offset to version from start of header */
-#define VERSION_OFFSET 3
-/** Offset to body length from start of header */
-#define BODY_LENGTH_OFFSET 4
-/** Offset to client serial from start of header */
-#define SERIAL_OFFSET 8
-/** Offset to fields array length from start of header */
-#define FIELDS_ARRAY_LENGTH_OFFSET 12
-/** Offset to first field in header */
-#define FIRST_FIELD_OFFSET 16
-
-typedef struct
-{
- unsigned char code; /**< the field code */
- unsigned char type; /**< the value type */
-} HeaderFieldType;
-
-static const HeaderFieldType
-_dbus_header_field_types[DBUS_HEADER_FIELD_LAST+1] = {
- { DBUS_HEADER_FIELD_INVALID, DBUS_TYPE_INVALID },
- { DBUS_HEADER_FIELD_PATH, DBUS_TYPE_OBJECT_PATH },
- { DBUS_HEADER_FIELD_INTERFACE, DBUS_TYPE_STRING },
- { DBUS_HEADER_FIELD_MEMBER, DBUS_TYPE_STRING },
- { DBUS_HEADER_FIELD_ERROR_NAME, DBUS_TYPE_STRING },
- { DBUS_HEADER_FIELD_REPLY_SERIAL, DBUS_TYPE_UINT32 },
- { DBUS_HEADER_FIELD_DESTINATION, DBUS_TYPE_STRING },
- { DBUS_HEADER_FIELD_SENDER, DBUS_TYPE_STRING },
- { DBUS_HEADER_FIELD_SIGNATURE, DBUS_TYPE_SIGNATURE },
- { DBUS_HEADER_FIELD_UNIX_FDS, DBUS_TYPE_UINT32 }
-};
-
-/** Macro to look up the correct type for a field */
-#define EXPECTED_TYPE_OF_FIELD(field) (_dbus_header_field_types[field].type)
-
-/** The most padding we could ever need for a header */
-#define MAX_POSSIBLE_HEADER_PADDING 7
-static dbus_bool_t
-reserve_header_padding (DBusHeader *header)
-{
- _dbus_assert (header->padding <= MAX_POSSIBLE_HEADER_PADDING);
-
- if (!_dbus_string_lengthen (&header->data,
- MAX_POSSIBLE_HEADER_PADDING - header->padding))
- return FALSE;
- header->padding = MAX_POSSIBLE_HEADER_PADDING;
- return TRUE;
-}
-
-static void
-correct_header_padding (DBusHeader *header)
-{
- int unpadded_len;
-
- _dbus_assert (header->padding == 7);
-
- _dbus_string_shorten (&header->data, header->padding);
- unpadded_len = _dbus_string_get_length (&header->data);
-
- if (!_dbus_string_align_length (&header->data, 8))
- _dbus_assert_not_reached ("couldn't pad header though enough padding was preallocated");
-
- header->padding = _dbus_string_get_length (&header->data) - unpadded_len;
-}
-
-/** Compute the end of the header, ignoring padding */
-#define HEADER_END_BEFORE_PADDING(header) \
- (_dbus_string_get_length (&(header)->data) - (header)->padding)
-
-/**
- * Invalidates all fields in the cache. This may be used when the
- * cache is totally uninitialized (contains junk) so should not
- * look at what's in there now.
- *
- * @param header the header
- */
-static void
-_dbus_header_cache_invalidate_all (DBusHeader *header)
-{
- int i;
-
- i = 0;
- while (i <= DBUS_HEADER_FIELD_LAST)
- {
- header->fields[i].value_pos = _DBUS_HEADER_FIELD_VALUE_UNKNOWN;
- ++i;
- }
-}
-
-/**
- * Caches one field
- *
- * @param header the header
- * @param field_code the field
- * @param variant_reader the reader for the variant in the field
- */
-static void
-_dbus_header_cache_one (DBusHeader *header,
- int field_code,
- DBusTypeReader *variant_reader)
-{
- header->fields[field_code].value_pos =
- _dbus_type_reader_get_value_pos (variant_reader);
-
-#if 0
- _dbus_verbose ("cached value_pos %d for field %d\n",
- header->fields[field_code].value_pos, field_code)
-#endif
-}
-
-/**
- * Returns the header's byte order.
- *
- * @param header the header
- * @returns the byte order
- */
-char
-_dbus_header_get_byte_order (const DBusHeader *header)
-{
- _dbus_assert (_dbus_string_get_length (&header->data) > BYTE_ORDER_OFFSET);
-
- return (char) _dbus_string_get_byte (&header->data, BYTE_ORDER_OFFSET);
-}
-
-/**
- * Revalidates the fields cache
- *
- * @param header the header
- */
-static void
-_dbus_header_cache_revalidate (DBusHeader *header)
-{
- DBusTypeReader array;
- DBusTypeReader reader;
- int i;
-
- i = 0;
- while (i <= DBUS_HEADER_FIELD_LAST)
- {
- header->fields[i].value_pos = _DBUS_HEADER_FIELD_VALUE_NONEXISTENT;
- ++i;
- }
-
- _dbus_type_reader_init (&reader,
- _dbus_header_get_byte_order (header),
- &_dbus_header_signature_str,
- FIELDS_ARRAY_SIGNATURE_OFFSET,
- &header->data,
- FIELDS_ARRAY_LENGTH_OFFSET);
-
- _dbus_type_reader_recurse (&reader, &array);
-
- while (_dbus_type_reader_get_current_type (&array) != DBUS_TYPE_INVALID)
- {
- DBusTypeReader sub;
- DBusTypeReader variant;
- unsigned char field_code;
-
- _dbus_type_reader_recurse (&array, &sub);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) == DBUS_TYPE_BYTE);
- _dbus_type_reader_read_basic (&sub, &field_code);
-
- /* Unknown fields should be ignored */
- if (field_code > DBUS_HEADER_FIELD_LAST)
- goto next_field;
-
- _dbus_type_reader_next (&sub);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) == DBUS_TYPE_VARIANT);
- _dbus_type_reader_recurse (&sub, &variant);
-
- _dbus_header_cache_one (header, field_code, &variant);
-
- next_field:
- _dbus_type_reader_next (&array);
- }
-}
-
-/**
- * Checks for a field, updating the cache if required.
- *
- * @param header the header
- * @param field the field to check
- * @returns #FALSE if the field doesn't exist
- */
-static dbus_bool_t
-_dbus_header_cache_check (DBusHeader *header,
- int field)
-{
- _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
-
- if (header->fields[field].value_pos == _DBUS_HEADER_FIELD_VALUE_UNKNOWN)
- _dbus_header_cache_revalidate (header);
-
- if (header->fields[field].value_pos == _DBUS_HEADER_FIELD_VALUE_NONEXISTENT)
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Checks whether a field is known not to exist. It may exist
- * even if it's not known to exist.
- *
- * @param header the header
- * @param field the field to check
- * @returns #FALSE if the field definitely doesn't exist
- */
-static dbus_bool_t
-_dbus_header_cache_known_nonexistent (DBusHeader *header,
- int field)
-{
- _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
-
- return (header->fields[field].value_pos == _DBUS_HEADER_FIELD_VALUE_NONEXISTENT);
-}
-
-/**
- * Writes a struct of { byte, variant } with the given basic type.
- *
- * @param writer the writer (should be ready to write a struct)
- * @param field the header field
- * @param type the type of the value
- * @param value the value as for _dbus_marshal_set_basic()
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-write_basic_field (DBusTypeWriter *writer,
- int field,
- int type,
- const void *value)
-{
- DBusTypeWriter sub;
- DBusTypeWriter variant;
- int start;
- int padding;
- unsigned char field_byte;
- DBusString contained_type;
- char buf[2];
-
- start = writer->value_pos;
- padding = _dbus_string_get_length (writer->value_str) - start;
-
- if (!_dbus_type_writer_recurse (writer, DBUS_TYPE_STRUCT,
- NULL, 0, &sub))
- goto append_failed;
-
- field_byte = field;
- if (!_dbus_type_writer_write_basic (&sub, DBUS_TYPE_BYTE,
- &field_byte))
- goto append_failed;
-
- buf[0] = type;
- buf[1] = '\0';
- _dbus_string_init_const_len (&contained_type, buf, 1);
-
- if (!_dbus_type_writer_recurse (&sub, DBUS_TYPE_VARIANT,
- &contained_type, 0, &variant))
- goto append_failed;
-
- if (!_dbus_type_writer_write_basic (&variant, type, value))
- goto append_failed;
-
- if (!_dbus_type_writer_unrecurse (&sub, &variant))
- goto append_failed;
-
- if (!_dbus_type_writer_unrecurse (writer, &sub))
- goto append_failed;
-
- return TRUE;
-
- append_failed:
- _dbus_string_delete (writer->value_str,
- start,
- _dbus_string_get_length (writer->value_str) - start - padding);
- return FALSE;
-}
-
-/**
- * Sets a struct of { byte, variant } with the given basic type.
- *
- * @param reader the reader (should be iterating over the array pointing at the field to set)
- * @param field the header field
- * @param type the type of the value
- * @param value the value as for _dbus_marshal_set_basic()
- * @param realign_root where to realign from
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-set_basic_field (DBusTypeReader *reader,
- int field,
- int type,
- const void *value,
- const DBusTypeReader *realign_root)
-{
- DBusTypeReader sub;
- DBusTypeReader variant;
-
- _dbus_type_reader_recurse (reader, &sub);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) == DBUS_TYPE_BYTE);
-#ifndef DBUS_DISABLE_ASSERT
- {
- unsigned char v_BYTE;
- _dbus_type_reader_read_basic (&sub, &v_BYTE);
- _dbus_assert (((int) v_BYTE) == field);
- }
-#endif
-
- if (!_dbus_type_reader_next (&sub))
- _dbus_assert_not_reached ("no variant field?");
-
- _dbus_type_reader_recurse (&sub, &variant);
- _dbus_assert (_dbus_type_reader_get_current_type (&variant) == type);
-
- if (!_dbus_type_reader_set_basic (&variant, value, realign_root))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Gets the type of the message.
- *
- * @param header the header
- * @returns the type
- */
-int
-_dbus_header_get_message_type (DBusHeader *header)
-{
- int type;
-
- type = _dbus_string_get_byte (&header->data, TYPE_OFFSET);
- _dbus_assert (type != DBUS_MESSAGE_TYPE_INVALID);
-
- return type;
-}
-
-/**
- * Sets the serial number of a header. This can only be done once on
- * a header.
- *
- * @param header the header
- * @param serial the serial
- */
-void
-_dbus_header_set_serial (DBusHeader *header,
- dbus_uint32_t serial)
-{
- /* we use this function to set the serial on outgoing
- * messages, and to reset the serial in dbus_message_copy;
- * this assertion should catch a double-set on outgoing.
- */
- _dbus_assert (_dbus_header_get_serial (header) == 0 ||
- serial == 0);
-
- _dbus_marshal_set_uint32 (&header->data,
- SERIAL_OFFSET,
- serial,
- _dbus_header_get_byte_order (header));
-}
-
-/**
- * See dbus_message_get_serial()
- *
- * @param header the header
- * @returns the client serial
- */
-dbus_uint32_t
-_dbus_header_get_serial (DBusHeader *header)
-{
- return _dbus_marshal_read_uint32 (&header->data,
- SERIAL_OFFSET,
- _dbus_header_get_byte_order (header),
- NULL);
-}
-
-/**
- * Re-initializes a header that was previously initialized and never
- * freed. After this, to make the header valid you have to call
- * _dbus_header_create().
- *
- * @param header header to re-initialize
- */
-void
-_dbus_header_reinit (DBusHeader *header)
-{
- _dbus_string_set_length (&header->data, 0);
-
- header->padding = 0;
-
- _dbus_header_cache_invalidate_all (header);
-}
-
-/**
- * Initializes a header, but doesn't prepare it for use;
- * to make the header valid, you have to call _dbus_header_create().
- *
- * @param header header to initialize
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_header_init (DBusHeader *header)
-{
- if (!_dbus_string_init_preallocated (&header->data, 32))
- return FALSE;
-
- _dbus_header_reinit (header);
-
- return TRUE;
-}
-
-/**
- * Frees a header.
- *
- * @param header the header
- */
-void
-_dbus_header_free (DBusHeader *header)
-{
- _dbus_string_free (&header->data);
-}
-
-/**
- * Initializes dest with a copy of the given header.
- * Resets the message serial to 0 on the copy.
- *
- * @param header header to copy
- * @param dest destination for copy
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_header_copy (const DBusHeader *header,
- DBusHeader *dest)
-{
- *dest = *header;
-
- if (!_dbus_string_init_preallocated (&dest->data,
- _dbus_string_get_length (&header->data)))
- return FALSE;
-
- if (!_dbus_string_copy (&header->data, 0, &dest->data, 0))
- {
- _dbus_string_free (&dest->data);
- return FALSE;
- }
-
- /* Reset the serial */
- _dbus_header_set_serial (dest, 0);
-
- return TRUE;
-}
-
-/**
- * Fills in the primary fields of the header, so the header is ready
- * for use. #NULL may be specified for some or all of the fields to
- * avoid adding those fields. Some combinations of fields don't make
- * sense, and passing them in will trigger an assertion failure.
- *
- * @param header the header
- * @param byte_order byte order of the header
- * @param message_type the message type
- * @param destination destination field or #NULL
- * @param path path field or #NULL
- * @param interface interface field or #NULL
- * @param member member field or #NULL
- * @param error_name error name or #NULL
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_header_create (DBusHeader *header,
- int byte_order,
- int message_type,
- const char *destination,
- const char *path,
- const char *interface,
- const char *member,
- const char *error_name)
-{
- unsigned char v_BYTE;
- dbus_uint32_t v_UINT32;
- DBusTypeWriter writer;
- DBusTypeWriter array;
-
- _dbus_assert (byte_order == DBUS_LITTLE_ENDIAN ||
- byte_order == DBUS_BIG_ENDIAN);
- _dbus_assert (((interface || message_type != DBUS_MESSAGE_TYPE_SIGNAL) && member) ||
- (error_name) ||
- !(interface || member || error_name));
- _dbus_assert (_dbus_string_get_length (&header->data) == 0);
-
- if (!reserve_header_padding (header))
- return FALSE;
-
- _dbus_type_writer_init_values_only (&writer, byte_order,
- &_dbus_header_signature_str, 0,
- &header->data,
- HEADER_END_BEFORE_PADDING (header));
-
- v_BYTE = byte_order;
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
- &v_BYTE))
- goto oom;
-
- v_BYTE = message_type;
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
- &v_BYTE))
- goto oom;
-
- v_BYTE = 0; /* flags */
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
- &v_BYTE))
- goto oom;
-
- v_BYTE = DBUS_MAJOR_PROTOCOL_VERSION;
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
- &v_BYTE))
- goto oom;
-
- v_UINT32 = 0; /* body length */
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
- &v_UINT32))
- goto oom;
-
- v_UINT32 = 0; /* serial */
- if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
- &v_UINT32))
- goto oom;
-
- if (!_dbus_type_writer_recurse (&writer, DBUS_TYPE_ARRAY,
- &_dbus_header_signature_str,
- FIELDS_ARRAY_SIGNATURE_OFFSET,
- &array))
- goto oom;
-
- /* Marshal all the fields (Marshall Fields?) */
-
- if (path != NULL)
- {
- if (!write_basic_field (&array,
- DBUS_HEADER_FIELD_PATH,
- DBUS_TYPE_OBJECT_PATH,
- &path))
- goto oom;
- }
-
- if (destination != NULL)
- {
- if (!write_basic_field (&array,
- DBUS_HEADER_FIELD_DESTINATION,
- DBUS_TYPE_STRING,
- &destination))
- goto oom;
- }
-
- if (interface != NULL)
- {
- if (!write_basic_field (&array,
- DBUS_HEADER_FIELD_INTERFACE,
- DBUS_TYPE_STRING,
- &interface))
- goto oom;
- }
-
- if (member != NULL)
- {
- if (!write_basic_field (&array,
- DBUS_HEADER_FIELD_MEMBER,
- DBUS_TYPE_STRING,
- &member))
- goto oom;
- }
-
- if (error_name != NULL)
- {
- if (!write_basic_field (&array,
- DBUS_HEADER_FIELD_ERROR_NAME,
- DBUS_TYPE_STRING,
- &error_name))
- goto oom;
- }
-
- if (!_dbus_type_writer_unrecurse (&writer, &array))
- goto oom;
-
- correct_header_padding (header);
-
- return TRUE;
-
- oom:
- _dbus_string_delete (&header->data, 0,
- _dbus_string_get_length (&header->data) - header->padding);
- correct_header_padding (header);
-
- return FALSE;
-}
-
-/**
- * Given data long enough to contain the length of the message body
- * and the fields array, check whether the data is long enough to
- * contain the entire message (assuming the claimed lengths are
- * accurate). Also checks that the lengths are in sanity parameters.
- *
- * @param max_message_length maximum length of a valid message
- * @param validity return location for why the data is invalid if it is
- * @param byte_order return location for byte order
- * @param fields_array_len return location for claimed fields array length
- * @param header_len return location for claimed header length
- * @param body_len return location for claimed body length
- * @param str the data
- * @param start start of data, 8-aligned
- * @param len length of data
- * @returns #TRUE if the data is long enough for the claimed length, and the lengths were valid
- */
-dbus_bool_t
-_dbus_header_have_message_untrusted (int max_message_length,
- DBusValidity *validity,
- int *byte_order,
- int *fields_array_len,
- int *header_len,
- int *body_len,
- const DBusString *str,
- int start,
- int len)
-
-{
- dbus_uint32_t header_len_unsigned;
- dbus_uint32_t fields_array_len_unsigned;
- dbus_uint32_t body_len_unsigned;
-
- _dbus_assert (start >= 0);
- _dbus_assert (start < _DBUS_INT32_MAX / 2);
- _dbus_assert (len >= 0);
-
- _dbus_assert (start == (int) _DBUS_ALIGN_VALUE (start, 8));
-
- *byte_order = _dbus_string_get_byte (str, start + BYTE_ORDER_OFFSET);
-
- if (*byte_order != DBUS_LITTLE_ENDIAN && *byte_order != DBUS_BIG_ENDIAN)
- {
- *validity = DBUS_INVALID_BAD_BYTE_ORDER;
- return FALSE;
- }
-
- _dbus_assert (FIELDS_ARRAY_LENGTH_OFFSET + 4 <= len);
- fields_array_len_unsigned = _dbus_marshal_read_uint32 (str, start + FIELDS_ARRAY_LENGTH_OFFSET,
- *byte_order, NULL);
-
- if (fields_array_len_unsigned > (unsigned) max_message_length)
- {
- *validity = DBUS_INVALID_INSANE_FIELDS_ARRAY_LENGTH;
- return FALSE;
- }
-
- _dbus_assert (BODY_LENGTH_OFFSET + 4 < len);
- body_len_unsigned = _dbus_marshal_read_uint32 (str, start + BODY_LENGTH_OFFSET,
- *byte_order, NULL);
-
- if (body_len_unsigned > (unsigned) max_message_length)
- {
- *validity = DBUS_INVALID_INSANE_BODY_LENGTH;
- return FALSE;
- }
-
- header_len_unsigned = FIRST_FIELD_OFFSET + fields_array_len_unsigned;
- header_len_unsigned = _DBUS_ALIGN_VALUE (header_len_unsigned, 8);
-
- /* overflow should be impossible since the lengths aren't allowed to
- * be huge.
- */
- _dbus_assert (max_message_length < _DBUS_INT32_MAX / 2);
- if (body_len_unsigned + header_len_unsigned > (unsigned) max_message_length)
- {
- *validity = DBUS_INVALID_MESSAGE_TOO_LONG;
- return FALSE;
- }
-
- _dbus_assert (body_len_unsigned < (unsigned) _DBUS_INT32_MAX);
- _dbus_assert (fields_array_len_unsigned < (unsigned) _DBUS_INT32_MAX);
- _dbus_assert (header_len_unsigned < (unsigned) _DBUS_INT32_MAX);
-
- *body_len = body_len_unsigned;
- *fields_array_len = fields_array_len_unsigned;
- *header_len = header_len_unsigned;
-
- *validity = DBUS_VALID;
-
- _dbus_verbose ("have %d bytes, need body %u + header %u = %u\n",
- len, body_len_unsigned, header_len_unsigned,
- body_len_unsigned + header_len_unsigned);
-
- return (body_len_unsigned + header_len_unsigned) <= (unsigned) len;
-}
-
-static DBusValidity
-check_mandatory_fields (DBusHeader *header)
-{
-#define REQUIRE_FIELD(name) do { if (header->fields[DBUS_HEADER_FIELD_##name].value_pos < 0) return DBUS_INVALID_MISSING_##name; } while (0)
-
- switch (_dbus_header_get_message_type (header))
- {
- case DBUS_MESSAGE_TYPE_SIGNAL:
- REQUIRE_FIELD (INTERFACE);
- /* FALL THRU - signals also require the path and member */
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- REQUIRE_FIELD (PATH);
- REQUIRE_FIELD (MEMBER);
- break;
- case DBUS_MESSAGE_TYPE_ERROR:
- REQUIRE_FIELD (ERROR_NAME);
- REQUIRE_FIELD (REPLY_SERIAL);
- break;
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- REQUIRE_FIELD (REPLY_SERIAL);
- break;
- default:
- /* other message types allowed but ignored */
- break;
- }
-
- return DBUS_VALID;
-}
-
-static DBusValidity
-load_and_validate_field (DBusHeader *header,
- int field,
- DBusTypeReader *variant_reader)
-{
- int type;
- int expected_type;
- const DBusString *value_str;
- int value_pos;
- int str_data_pos;
- dbus_uint32_t v_UINT32;
- int bad_string_code;
- dbus_bool_t (* string_validation_func) (const DBusString *str,
- int start, int len);
-
- /* Supposed to have been checked already */
- _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
- _dbus_assert (field != DBUS_HEADER_FIELD_INVALID);
-
- /* Before we can cache a field, we need to know it has the right type */
- type = _dbus_type_reader_get_current_type (variant_reader);
-
- _dbus_assert (_dbus_header_field_types[field].code == field);
-
- expected_type = EXPECTED_TYPE_OF_FIELD (field);
- if (type != expected_type)
- {
- _dbus_verbose ("Field %d should have type %d but has %d\n",
- field, expected_type, type);
- return DBUS_INVALID_HEADER_FIELD_HAS_WRONG_TYPE;
- }
-
- /* If the field was provided twice, we aren't happy */
- if (header->fields[field].value_pos >= 0)
- {
- _dbus_verbose ("Header field %d seen a second time\n", field);
- return DBUS_INVALID_HEADER_FIELD_APPEARS_TWICE;
- }
-
- /* Now we can cache and look at the field content */
- _dbus_verbose ("initially caching field %d\n", field);
- _dbus_header_cache_one (header, field, variant_reader);
-
- string_validation_func = NULL;
-
- /* make compiler happy that all this is initialized */
- v_UINT32 = 0;
- value_str = NULL;
- value_pos = -1;
- str_data_pos = -1;
- bad_string_code = DBUS_VALID;
-
- if (expected_type == DBUS_TYPE_UINT32)
- {
- _dbus_header_get_field_basic (header, field, expected_type,
- &v_UINT32);
- }
- else if (expected_type == DBUS_TYPE_STRING ||
- expected_type == DBUS_TYPE_OBJECT_PATH ||
- expected_type == DBUS_TYPE_SIGNATURE)
- {
- _dbus_header_get_field_raw (header, field,
- &value_str, &value_pos);
- str_data_pos = _DBUS_ALIGN_VALUE (value_pos, 4) + 4;
- }
- else
- {
- _dbus_assert_not_reached ("none of the known fields should have this type");
- }
-
- switch (field)
- {
- case DBUS_HEADER_FIELD_DESTINATION:
- string_validation_func = _dbus_validate_bus_name;
- bad_string_code = DBUS_INVALID_BAD_DESTINATION;
- break;
- case DBUS_HEADER_FIELD_INTERFACE:
- string_validation_func = _dbus_validate_interface;
- bad_string_code = DBUS_INVALID_BAD_INTERFACE;
-
- if (_dbus_string_equal_substring (&_dbus_local_interface_str,
- 0,
- _dbus_string_get_length (&_dbus_local_interface_str),
- value_str, str_data_pos))
- {
- _dbus_verbose ("Message is on the local interface\n");
- return DBUS_INVALID_USES_LOCAL_INTERFACE;
- }
- break;
-
- case DBUS_HEADER_FIELD_MEMBER:
- string_validation_func = _dbus_validate_member;
- bad_string_code = DBUS_INVALID_BAD_MEMBER;
- break;
-
- case DBUS_HEADER_FIELD_ERROR_NAME:
- string_validation_func = _dbus_validate_error_name;
- bad_string_code = DBUS_INVALID_BAD_ERROR_NAME;
- break;
-
- case DBUS_HEADER_FIELD_SENDER:
- string_validation_func = _dbus_validate_bus_name;
- bad_string_code = DBUS_INVALID_BAD_SENDER;
- break;
-
- case DBUS_HEADER_FIELD_PATH:
- /* OBJECT_PATH was validated generically due to its type */
- string_validation_func = NULL;
-
- if (_dbus_string_equal_substring (&_dbus_local_path_str,
- 0,
- _dbus_string_get_length (&_dbus_local_path_str),
- value_str, str_data_pos))
- {
- _dbus_verbose ("Message is from the local path\n");
- return DBUS_INVALID_USES_LOCAL_PATH;
- }
- break;
-
- case DBUS_HEADER_FIELD_REPLY_SERIAL:
- /* Can't be 0 */
- if (v_UINT32 == 0)
- {
- return DBUS_INVALID_BAD_SERIAL;
- }
- break;
-
- case DBUS_HEADER_FIELD_UNIX_FDS:
- /* Every value makes sense */
- break;
-
- case DBUS_HEADER_FIELD_SIGNATURE:
- /* SIGNATURE validated generically due to its type */
- string_validation_func = NULL;
- break;
-
- default:
- _dbus_assert_not_reached ("unknown field shouldn't be seen here");
- break;
- }
-
- if (string_validation_func)
- {
- dbus_uint32_t len;
-
- _dbus_assert (bad_string_code != DBUS_VALID);
-
- len = _dbus_marshal_read_uint32 (value_str, value_pos,
- _dbus_header_get_byte_order (header),
- NULL);
-
-#if 0
- _dbus_verbose ("Validating string header field; code %d if fails\n",
- bad_string_code);
-#endif
- if (!(*string_validation_func) (value_str, str_data_pos, len))
- return bad_string_code;
- }
-
- return DBUS_VALID;
-}
-
-/**
- * Creates a message header from potentially-untrusted data. The
- * return value is #TRUE if there was enough memory and the data was
- * valid. If it returns #TRUE, the header will be created. If it
- * returns #FALSE and *validity == #DBUS_VALIDITY_UNKNOWN_OOM_ERROR,
- * then there wasn't enough memory. If it returns #FALSE
- * and *validity != #DBUS_VALIDITY_UNKNOWN_OOM_ERROR then the data was
- * invalid.
- *
- * The byte_order, fields_array_len, and body_len args should be from
- * _dbus_header_have_message_untrusted(). Validation performed in
- * _dbus_header_have_message_untrusted() is assumed to have been
- * already done.
- *
- * @param header the header (must be initialized)
- * @param mode whether to do validation
- * @param validity return location for invalidity reason
- * @param byte_order byte order from header
- * @param fields_array_len claimed length of fields array
- * @param body_len claimed length of body
- * @param header_len claimed length of header
- * @param str a string
- * @param start start of header, 8-aligned
- * @param len length of string to look at
- * @returns #FALSE if no memory or data was invalid, #TRUE otherwise
- */
-dbus_bool_t
-_dbus_header_load (DBusHeader *header,
- DBusValidationMode mode,
- DBusValidity *validity,
- int byte_order,
- int fields_array_len,
- int header_len,
- int body_len,
- const DBusString *str,
- int start,
- int len)
-{
- int leftover;
- DBusValidity v;
- DBusTypeReader reader;
- DBusTypeReader array_reader;
- unsigned char v_byte;
- dbus_uint32_t v_uint32;
- dbus_uint32_t serial;
- int padding_start;
- int padding_len;
- int i;
-
- _dbus_assert (start == (int) _DBUS_ALIGN_VALUE (start, 8));
- _dbus_assert (header_len <= len);
- _dbus_assert (_dbus_string_get_length (&header->data) == 0);
-
- if (!_dbus_string_copy_len (str, start, header_len, &header->data, 0))
- {
- _dbus_verbose ("Failed to copy buffer into new header\n");
- *validity = DBUS_VALIDITY_UNKNOWN_OOM_ERROR;
- return FALSE;
- }
-
- if (mode == DBUS_VALIDATION_MODE_WE_TRUST_THIS_DATA_ABSOLUTELY)
- {
- leftover = len - header_len - body_len - start;
- }
- else
- {
- v = _dbus_validate_body_with_reason (&_dbus_header_signature_str, 0,
- byte_order,
- &leftover,
- str, start, len);
-
- if (v != DBUS_VALID)
- {
- *validity = v;
- goto invalid;
- }
- }
-
- _dbus_assert (leftover < len);
-
- padding_len = header_len - (FIRST_FIELD_OFFSET + fields_array_len);
- padding_start = start + FIRST_FIELD_OFFSET + fields_array_len;
- _dbus_assert (start + header_len == (int) _DBUS_ALIGN_VALUE (padding_start, 8));
- _dbus_assert (start + header_len == padding_start + padding_len);
-
- if (mode != DBUS_VALIDATION_MODE_WE_TRUST_THIS_DATA_ABSOLUTELY)
- {
- if (!_dbus_string_validate_nul (str, padding_start, padding_len))
- {
- *validity = DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- goto invalid;
- }
- }
-
- header->padding = padding_len;
-
- if (mode == DBUS_VALIDATION_MODE_WE_TRUST_THIS_DATA_ABSOLUTELY)
- {
- *validity = DBUS_VALID;
- return TRUE;
- }
-
- /* We now know the data is well-formed, but we have to check that
- * it's valid.
- */
-
- _dbus_type_reader_init (&reader,
- byte_order,
- &_dbus_header_signature_str, 0,
- str, start);
-
- /* BYTE ORDER */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_BYTE);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == BYTE_ORDER_OFFSET);
- _dbus_type_reader_read_basic (&reader, &v_byte);
- _dbus_type_reader_next (&reader);
-
- _dbus_assert (v_byte == byte_order);
-
- /* MESSAGE TYPE */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_BYTE);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == TYPE_OFFSET);
- _dbus_type_reader_read_basic (&reader, &v_byte);
- _dbus_type_reader_next (&reader);
-
- /* unknown message types are supposed to be ignored, so only validation here is
- * that it isn't invalid
- */
- if (v_byte == DBUS_MESSAGE_TYPE_INVALID)
- {
- *validity = DBUS_INVALID_BAD_MESSAGE_TYPE;
- goto invalid;
- }
-
- /* FLAGS */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_BYTE);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == FLAGS_OFFSET);
- _dbus_type_reader_read_basic (&reader, &v_byte);
- _dbus_type_reader_next (&reader);
-
- /* unknown flags should be ignored */
-
- /* PROTOCOL VERSION */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_BYTE);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == VERSION_OFFSET);
- _dbus_type_reader_read_basic (&reader, &v_byte);
- _dbus_type_reader_next (&reader);
-
- if (v_byte != DBUS_MAJOR_PROTOCOL_VERSION)
- {
- *validity = DBUS_INVALID_BAD_PROTOCOL_VERSION;
- goto invalid;
- }
-
- /* BODY LENGTH */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_UINT32);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == BODY_LENGTH_OFFSET);
- _dbus_type_reader_read_basic (&reader, &v_uint32);
- _dbus_type_reader_next (&reader);
-
- _dbus_assert (body_len == (signed) v_uint32);
-
- /* SERIAL */
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_UINT32);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == SERIAL_OFFSET);
- _dbus_type_reader_read_basic (&reader, &serial);
- _dbus_type_reader_next (&reader);
-
- if (serial == 0)
- {
- *validity = DBUS_INVALID_BAD_SERIAL;
- goto invalid;
- }
-
- _dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_ARRAY);
- _dbus_assert (_dbus_type_reader_get_value_pos (&reader) == FIELDS_ARRAY_LENGTH_OFFSET);
-
- _dbus_type_reader_recurse (&reader, &array_reader);
- while (_dbus_type_reader_get_current_type (&array_reader) != DBUS_TYPE_INVALID)
- {
- DBusTypeReader struct_reader;
- DBusTypeReader variant_reader;
- unsigned char field_code;
-
- _dbus_assert (_dbus_type_reader_get_current_type (&array_reader) == DBUS_TYPE_STRUCT);
-
- _dbus_type_reader_recurse (&array_reader, &struct_reader);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&struct_reader) == DBUS_TYPE_BYTE);
- _dbus_type_reader_read_basic (&struct_reader, &field_code);
- _dbus_type_reader_next (&struct_reader);
-
- if (field_code == DBUS_HEADER_FIELD_INVALID)
- {
- _dbus_verbose ("invalid header field code\n");
- *validity = DBUS_INVALID_HEADER_FIELD_CODE;
- goto invalid;
- }
-
- if (field_code > DBUS_HEADER_FIELD_LAST)
- {
- _dbus_verbose ("unknown header field code %d, skipping\n",
- field_code);
- goto next_field;
- }
-
- _dbus_assert (_dbus_type_reader_get_current_type (&struct_reader) == DBUS_TYPE_VARIANT);
- _dbus_type_reader_recurse (&struct_reader, &variant_reader);
-
- v = load_and_validate_field (header, field_code, &variant_reader);
- if (v != DBUS_VALID)
- {
- _dbus_verbose ("Field %d was invalid\n", field_code);
- *validity = v;
- goto invalid;
- }
-
- next_field:
- _dbus_type_reader_next (&array_reader);
- }
-
- /* Anything we didn't fill in is now known not to exist */
- i = 0;
- while (i <= DBUS_HEADER_FIELD_LAST)
- {
- if (header->fields[i].value_pos == _DBUS_HEADER_FIELD_VALUE_UNKNOWN)
- header->fields[i].value_pos = _DBUS_HEADER_FIELD_VALUE_NONEXISTENT;
- ++i;
- }
-
- v = check_mandatory_fields (header);
- if (v != DBUS_VALID)
- {
- _dbus_verbose ("Mandatory fields were missing, code %d\n", v);
- *validity = v;
- goto invalid;
- }
-
- *validity = DBUS_VALID;
- return TRUE;
-
- invalid:
- _dbus_string_set_length (&header->data, 0);
- return FALSE;
-}
-
-/**
- * Fills in the correct body length.
- *
- * @param header the header
- * @param body_len the length of the body
- */
-void
-_dbus_header_update_lengths (DBusHeader *header,
- int body_len)
-{
- _dbus_marshal_set_uint32 (&header->data,
- BODY_LENGTH_OFFSET,
- body_len,
- _dbus_header_get_byte_order (header));
-}
-
-/**
- * Try to find the given field.
- *
- * @param header the header
- * @param field the field code
- * @param reader a type reader; on success this is left pointing at the struct
- * (uv) for the field, while on failure it is left pointing into empty space
- * at the end of the header fields
- * @param realign_root another type reader; on success or failure it is left
- * pointing to the beginning of the array of fields (i.e. the thing that might
- * need realigning)
- * @returns #TRUE on success
- */
-static dbus_bool_t
-find_field_for_modification (DBusHeader *header,
- int field,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root)
-{
- dbus_bool_t retval;
-
- retval = FALSE;
-
- _dbus_type_reader_init (realign_root,
- _dbus_header_get_byte_order (header),
- &_dbus_header_signature_str,
- FIELDS_ARRAY_SIGNATURE_OFFSET,
- &header->data,
- FIELDS_ARRAY_LENGTH_OFFSET);
-
- _dbus_type_reader_recurse (realign_root, reader);
-
- while (_dbus_type_reader_get_current_type (reader) != DBUS_TYPE_INVALID)
- {
- DBusTypeReader sub;
- unsigned char field_code;
-
- _dbus_type_reader_recurse (reader, &sub);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) == DBUS_TYPE_BYTE);
- _dbus_type_reader_read_basic (&sub, &field_code);
-
- if (field_code == (unsigned) field)
- {
- _dbus_assert (_dbus_type_reader_get_current_type (reader) == DBUS_TYPE_STRUCT);
- retval = TRUE;
- goto done;
- }
-
- _dbus_type_reader_next (reader);
- }
-
- done:
- return retval;
-}
-
-/**
- * Sets the value of a field with basic type. If the value is a string
- * value, it isn't allowed to be #NULL. If the field doesn't exist,
- * it will be created.
- *
- * @param header the header
- * @param field the field to set
- * @param type the type of the value
- * @param value the value as for _dbus_marshal_set_basic()
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_header_set_field_basic (DBusHeader *header,
- int field,
- int type,
- const void *value)
-{
- _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
-
- if (!reserve_header_padding (header))
- return FALSE;
-
- /* If the field exists we set, otherwise we append */
- if (_dbus_header_cache_check (header, field))
- {
- DBusTypeReader reader;
- DBusTypeReader realign_root;
-
- if (!find_field_for_modification (header, field,
- &reader, &realign_root))
- _dbus_assert_not_reached ("field was marked present in cache but wasn't found");
-
- if (!set_basic_field (&reader, field, type, value, &realign_root))
- return FALSE;
- }
- else
- {
- DBusTypeWriter writer;
- DBusTypeWriter array;
-
- _dbus_type_writer_init_values_only (&writer,
- _dbus_header_get_byte_order (header),
- &_dbus_header_signature_str,
- FIELDS_ARRAY_SIGNATURE_OFFSET,
- &header->data,
- FIELDS_ARRAY_LENGTH_OFFSET);
-
- /* recurse into array without creating a new length, and jump to
- * end of array.
- */
- if (!_dbus_type_writer_append_array (&writer,
- &_dbus_header_signature_str,
- FIELDS_ARRAY_ELEMENT_SIGNATURE_OFFSET,
- &array))
- _dbus_assert_not_reached ("recurse into ARRAY should not have used memory");
-
- _dbus_assert (array.u.array.len_pos == FIELDS_ARRAY_LENGTH_OFFSET);
- _dbus_assert (array.u.array.start_pos == FIRST_FIELD_OFFSET);
- _dbus_assert (array.value_pos == HEADER_END_BEFORE_PADDING (header));
-
- if (!write_basic_field (&array,
- field, type, value))
- return FALSE;
-
- if (!_dbus_type_writer_unrecurse (&writer, &array))
- _dbus_assert_not_reached ("unrecurse from ARRAY should not have used memory");
- }
-
- correct_header_padding (header);
-
- /* We could be smarter about this (only invalidate fields after the
- * one we modified, or even only if the one we modified changed
- * length). But this hack is a start.
- */
- _dbus_header_cache_invalidate_all (header);
-
- return TRUE;
-}
-
-/**
- * Gets the value of a field with basic type. If the field
- * doesn't exist, returns #FALSE, otherwise returns #TRUE.
- *
- * @param header the header
- * @param field the field to get
- * @param type the type of the value
- * @param value the value as for _dbus_marshal_read_basic()
- * @returns #FALSE if the field doesn't exist
- */
-dbus_bool_t
-_dbus_header_get_field_basic (DBusHeader *header,
- int field,
- int type,
- void *value)
-{
- _dbus_assert (field != DBUS_HEADER_FIELD_INVALID);
- _dbus_assert (field <= DBUS_HEADER_FIELD_LAST);
- _dbus_assert (_dbus_header_field_types[field].code == field);
- /* in light of this you might ask why the type is passed in;
- * the only rationale I can think of is so the caller has
- * to specify its expectation and breaks if we change it
- */
- _dbus_assert (type == EXPECTED_TYPE_OF_FIELD (field));
-
- if (!_dbus_header_cache_check (header, field))
- return FALSE;
-
- _dbus_assert (header->fields[field].value_pos >= 0);
-
- _dbus_marshal_read_basic (&header->data,
- header->fields[field].value_pos,
- type, value, _dbus_header_get_byte_order (header),
- NULL);
-
- return TRUE;
-}
-
-/**
- * Gets the raw marshaled data for a field. If the field doesn't
- * exist, returns #FALSE, otherwise returns #TRUE. Returns the start
- * of the marshaled data, i.e. usually the byte where the length
- * starts (for strings and arrays) or for basic types just the value
- * itself.
- *
- * @param header the header
- * @param field the field to get
- * @param str return location for the data string
- * @param pos return location for start of field value
- * @returns #FALSE if the field doesn't exist
- */
-dbus_bool_t
-_dbus_header_get_field_raw (DBusHeader *header,
- int field,
- const DBusString **str,
- int *pos)
-{
- if (!_dbus_header_cache_check (header, field))
- return FALSE;
-
- if (str)
- *str = &header->data;
- if (pos)
- *pos = header->fields[field].value_pos;
-
- return TRUE;
-}
-
-/**
- * Deletes a field, if it exists.
- *
- * @param header the header
- * @param field the field to delete
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_header_delete_field (DBusHeader *header,
- int field)
-{
- DBusTypeReader reader;
- DBusTypeReader realign_root;
-
- if (_dbus_header_cache_known_nonexistent (header, field))
- return TRUE; /* nothing to do */
-
- /* Scan to the field we want, delete and realign, reappend
- * padding. Field may turn out not to exist.
- */
- if (!find_field_for_modification (header, field,
- &reader, &realign_root))
- return TRUE; /* nothing to do */
-
- if (!reserve_header_padding (header))
- return FALSE;
-
- if (!_dbus_type_reader_delete (&reader,
- &realign_root))
- return FALSE;
-
- correct_header_padding (header);
-
- _dbus_header_cache_invalidate_all (header);
-
- _dbus_assert (!_dbus_header_cache_check (header, field)); /* Expensive assertion ... */
-
- return TRUE;
-}
-
-/**
- * Toggles a message flag bit, turning on the bit if value = TRUE and
- * flipping it off if value = FALSE.
- *
- * @param header the header
- * @param flag the message flag to toggle
- * @param value toggle on or off
- */
-void
-_dbus_header_toggle_flag (DBusHeader *header,
- dbus_uint32_t flag,
- dbus_bool_t value)
-{
- unsigned char *flags_p;
-
- flags_p = _dbus_string_get_data_len (&header->data, FLAGS_OFFSET, 1);
-
- if (value)
- *flags_p |= flag;
- else
- *flags_p &= ~flag;
-}
-
-/**
- * Gets a message flag bit, returning TRUE if the bit is set.
- *
- * @param header the header
- * @param flag the message flag to get
- * @returns #TRUE if the flag is set
- */
-dbus_bool_t
-_dbus_header_get_flag (DBusHeader *header,
- dbus_uint32_t flag)
-{
- const unsigned char *flags_p;
-
- flags_p = _dbus_string_get_const_data_len (&header->data, FLAGS_OFFSET, 1);
-
- return (*flags_p & flag) != 0;
-}
-
-/**
- * Swaps the header into the given order if required.
- *
- * @param header the header
- * @param new_order the new byte order
- */
-void
-_dbus_header_byteswap (DBusHeader *header,
- int new_order)
-{
- char byte_order;
-
- byte_order = _dbus_header_get_byte_order (header);
-
- if (byte_order == new_order)
- return;
-
- _dbus_marshal_byteswap (&_dbus_header_signature_str,
- 0, byte_order,
- new_order,
- &header->data, 0);
-
- _dbus_string_set_byte (&header->data, BYTE_ORDER_OFFSET, new_order);
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.h
deleted file mode 100644
index 350fe5c440..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-header.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-header.h Managing marshaling/demarshaling of message headers
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MARSHAL_HEADER_H
-#define DBUS_MARSHAL_HEADER_H
-
-#include <dbus/dbus-marshal-basic.h>
-#include <dbus/dbus-marshal-validate.h>
-
-typedef struct DBusHeader DBusHeader;
-typedef struct DBusHeaderField DBusHeaderField;
-
-#define _DBUS_HEADER_FIELD_VALUE_UNKNOWN -1
-#define _DBUS_HEADER_FIELD_VALUE_NONEXISTENT -2
-
-/**
- * Cached information about a header field in the message
- */
-struct DBusHeaderField
-{
- int value_pos; /**< Position of field value, or -1/-2 */
-};
-
-/**
- * Message header data and some cached details of it.
- */
-struct DBusHeader
-{
- DBusString data; /**< Header network data, stored
- * separately from body so we can
- * independently realloc it.
- */
-
- DBusHeaderField fields[DBUS_HEADER_FIELD_LAST + 1]; /**< Track the location
- * of each field in header
- */
-
- dbus_uint32_t padding : 3; /**< bytes of alignment in header */
- dbus_uint32_t byte_order : 8; /**< byte order of header */
-};
-
-dbus_bool_t _dbus_header_init (DBusHeader *header);
-void _dbus_header_free (DBusHeader *header);
-void _dbus_header_reinit (DBusHeader *header);
-dbus_bool_t _dbus_header_create (DBusHeader *header,
- int byte_order,
- int type,
- const char *destination,
- const char *path,
- const char *interface,
- const char *member,
- const char *error_name);
-dbus_bool_t _dbus_header_copy (const DBusHeader *header,
- DBusHeader *dest);
-int _dbus_header_get_message_type (DBusHeader *header);
-void _dbus_header_set_serial (DBusHeader *header,
- dbus_uint32_t serial);
-dbus_uint32_t _dbus_header_get_serial (DBusHeader *header);
-void _dbus_header_update_lengths (DBusHeader *header,
- int body_len);
-dbus_bool_t _dbus_header_set_field_basic (DBusHeader *header,
- int field,
- int type,
- const void *value);
-dbus_bool_t _dbus_header_get_field_basic (DBusHeader *header,
- int field,
- int type,
- void *value);
-dbus_bool_t _dbus_header_get_field_raw (DBusHeader *header,
- int field,
- const DBusString **str,
- int *pos);
-dbus_bool_t _dbus_header_delete_field (DBusHeader *header,
- int field);
-void _dbus_header_toggle_flag (DBusHeader *header,
- dbus_uint32_t flag,
- dbus_bool_t value);
-dbus_bool_t _dbus_header_get_flag (DBusHeader *header,
- dbus_uint32_t flag);
-dbus_bool_t _dbus_header_ensure_signature (DBusHeader *header,
- DBusString **type_str,
- int *type_pos);
-dbus_bool_t _dbus_header_have_message_untrusted (int max_message_length,
- DBusValidity *validity,
- int *byte_order,
- int *fields_array_len,
- int *header_len,
- int *body_len,
- const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_header_load (DBusHeader *header,
- DBusValidationMode mode,
- DBusValidity *validity,
- int byte_order,
- int fields_array_len,
- int header_len,
- int body_len,
- const DBusString *str,
- int start,
- int len);
-void _dbus_header_byteswap (DBusHeader *header,
- int new_order);
-char _dbus_header_get_byte_order (const DBusHeader *header);
-
-
-
-#endif /* DBUS_MARSHAL_HEADER_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive-util.c
deleted file mode 100644
index 4a42b47e2b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive-util.c
+++ /dev/null
@@ -1,3552 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-recursive-util.c Would be in dbus-marshal-recursive.c, but only used in bus/tests
- *
- * Copyright (C) 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-signature.h"
-#include "dbus-internals.h"
-#include <string.h>
-
-static void
-basic_value_zero (DBusBasicValue *value)
-{
- value->u64 = 0;
-}
-
-static dbus_bool_t
-basic_value_equal (int type,
- DBusBasicValue *lhs,
- DBusBasicValue *rhs)
-{
- if (type == DBUS_TYPE_STRING ||
- type == DBUS_TYPE_SIGNATURE ||
- type == DBUS_TYPE_OBJECT_PATH)
- {
- return strcmp (lhs->str, rhs->str) == 0;
- }
- else
- {
- return lhs->u64 == rhs->u64;
- }
-}
-
-static dbus_bool_t
-equal_values_helper (DBusTypeReader *lhs,
- DBusTypeReader *rhs)
-{
- int lhs_type;
- int rhs_type;
-
- lhs_type = _dbus_type_reader_get_current_type (lhs);
- rhs_type = _dbus_type_reader_get_current_type (rhs);
-
- if (lhs_type != rhs_type)
- return FALSE;
-
- if (lhs_type == DBUS_TYPE_INVALID)
- return TRUE;
-
- if (dbus_type_is_basic (lhs_type))
- {
- DBusBasicValue lhs_value;
- DBusBasicValue rhs_value;
-
- basic_value_zero (&lhs_value);
- basic_value_zero (&rhs_value);
-
- _dbus_type_reader_read_basic (lhs, &lhs_value);
- _dbus_type_reader_read_basic (rhs, &rhs_value);
-
- return basic_value_equal (lhs_type, &lhs_value, &rhs_value);
- }
- else
- {
- DBusTypeReader lhs_sub;
- DBusTypeReader rhs_sub;
-
- _dbus_type_reader_recurse (lhs, &lhs_sub);
- _dbus_type_reader_recurse (rhs, &rhs_sub);
-
- return equal_values_helper (&lhs_sub, &rhs_sub);
- }
-}
-
-/**
- * See whether the two readers point to identical data blocks.
- *
- * @param lhs reader 1
- * @param rhs reader 2
- * @returns #TRUE if the data blocks have the same values
- */
-dbus_bool_t
-_dbus_type_reader_equal_values (const DBusTypeReader *lhs,
- const DBusTypeReader *rhs)
-{
- DBusTypeReader copy_lhs = *lhs;
- DBusTypeReader copy_rhs = *rhs;
-
- return equal_values_helper (&copy_lhs, &copy_rhs);
-}
-
-/* TESTS */
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include "dbus-test.h"
-#include "dbus-list.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Whether to do the OOM stuff (only with other expensive tests) */
-#define TEST_OOM_HANDLING 0
-/* We do start offset 0 through 9, to get various alignment cases. Still this
- * obviously makes the test suite run 10x as slow.
- */
-#define MAX_INITIAL_OFFSET 9
-
-/* Largest iteration count to test copying, realignment,
- * etc. with. i.e. we only test this stuff with some of the smaller
- * data sets.
- */
-#define MAX_ITERATIONS_FOR_EXPENSIVE_TESTS 1000
-
-typedef struct
-{
- int byte_order;
- int initial_offset;
- DBusString signature;
- DBusString body;
-} DataBlock;
-
-typedef struct
-{
- int saved_sig_len;
- int saved_body_len;
-} DataBlockState;
-
-#define N_FENCE_BYTES 5
-#define FENCE_BYTES_STR "abcde"
-#define INITIAL_PADDING_BYTE '\0'
-
-static dbus_bool_t
-data_block_init (DataBlock *block,
- int byte_order,
- int initial_offset)
-{
- if (!_dbus_string_init (&block->signature))
- return FALSE;
-
- if (!_dbus_string_init (&block->body))
- {
- _dbus_string_free (&block->signature);
- return FALSE;
- }
-
- if (!_dbus_string_insert_bytes (&block->signature, 0, initial_offset,
- INITIAL_PADDING_BYTE) ||
- !_dbus_string_insert_bytes (&block->body, 0, initial_offset,
- INITIAL_PADDING_BYTE) ||
- !_dbus_string_append (&block->signature, FENCE_BYTES_STR) ||
- !_dbus_string_append (&block->body, FENCE_BYTES_STR))
- {
- _dbus_string_free (&block->signature);
- _dbus_string_free (&block->body);
- return FALSE;
- }
-
- block->byte_order = byte_order;
- block->initial_offset = initial_offset;
-
- return TRUE;
-}
-
-static void
-data_block_save (DataBlock *block,
- DataBlockState *state)
-{
- state->saved_sig_len = _dbus_string_get_length (&block->signature) - N_FENCE_BYTES;
- state->saved_body_len = _dbus_string_get_length (&block->body) - N_FENCE_BYTES;
-}
-
-static void
-data_block_restore (DataBlock *block,
- DataBlockState *state)
-{
- _dbus_string_delete (&block->signature,
- state->saved_sig_len,
- _dbus_string_get_length (&block->signature) - state->saved_sig_len - N_FENCE_BYTES);
- _dbus_string_delete (&block->body,
- state->saved_body_len,
- _dbus_string_get_length (&block->body) - state->saved_body_len - N_FENCE_BYTES);
-}
-
-static void
-data_block_verify (DataBlock *block)
-{
- if (!_dbus_string_ends_with_c_str (&block->signature,
- FENCE_BYTES_STR))
- {
- int offset;
-
- offset = _dbus_string_get_length (&block->signature) - N_FENCE_BYTES - 8;
- if (offset < 0)
- offset = 0;
-
- _dbus_verbose_bytes_of_string (&block->signature,
- offset,
- _dbus_string_get_length (&block->signature) - offset);
- _dbus_assert_not_reached ("block did not verify: bad bytes at end of signature");
- }
- if (!_dbus_string_ends_with_c_str (&block->body,
- FENCE_BYTES_STR))
- {
- int offset;
-
- offset = _dbus_string_get_length (&block->body) - N_FENCE_BYTES - 8;
- if (offset < 0)
- offset = 0;
-
- _dbus_verbose_bytes_of_string (&block->body,
- offset,
- _dbus_string_get_length (&block->body) - offset);
- _dbus_assert_not_reached ("block did not verify: bad bytes at end of body");
- }
-
- _dbus_assert (_dbus_string_validate_nul (&block->signature,
- 0, block->initial_offset));
- _dbus_assert (_dbus_string_validate_nul (&block->body,
- 0, block->initial_offset));
-}
-
-static void
-data_block_free (DataBlock *block)
-{
- data_block_verify (block);
-
- _dbus_string_free (&block->signature);
- _dbus_string_free (&block->body);
-}
-
-static void
-data_block_reset (DataBlock *block)
-{
- data_block_verify (block);
-
- _dbus_string_delete (&block->signature,
- block->initial_offset,
- _dbus_string_get_length (&block->signature) - N_FENCE_BYTES - block->initial_offset);
- _dbus_string_delete (&block->body,
- block->initial_offset,
- _dbus_string_get_length (&block->body) - N_FENCE_BYTES - block->initial_offset);
-
- data_block_verify (block);
-}
-
-static void
-data_block_init_reader_writer (DataBlock *block,
- DBusTypeReader *reader,
- DBusTypeWriter *writer)
-{
- if (reader)
- _dbus_type_reader_init (reader,
- block->byte_order,
- &block->signature,
- block->initial_offset,
- &block->body,
- block->initial_offset);
-
- if (writer)
- _dbus_type_writer_init (writer,
- block->byte_order,
- &block->signature,
- _dbus_string_get_length (&block->signature) - N_FENCE_BYTES,
- &block->body,
- _dbus_string_get_length (&block->body) - N_FENCE_BYTES);
-}
-
-static void
-real_check_expected_type (DBusTypeReader *reader,
- int expected,
- const char *funcname,
- int line)
-{
- int t;
-
- t = _dbus_type_reader_get_current_type (reader);
-
- if (t != expected)
- {
- _dbus_warn ("Read type %s while expecting %s at %s line %d\n",
- _dbus_type_to_string (t),
- _dbus_type_to_string (expected),
- funcname, line);
-
- _dbus_assert_not_reached ("read wrong type");
- }
-}
-
-#define check_expected_type(reader, expected) real_check_expected_type (reader, expected, _DBUS_FUNCTION_NAME, __LINE__)
-
-#define NEXT_EXPECTING_TRUE(reader) do { if (!_dbus_type_reader_next (reader)) \
- { \
- _dbus_warn ("_dbus_type_reader_next() should have returned TRUE at %s %d\n", \
- _DBUS_FUNCTION_NAME, __LINE__); \
- _dbus_assert_not_reached ("test failed"); \
- } \
-} while (0)
-
-#define NEXT_EXPECTING_FALSE(reader) do { if (_dbus_type_reader_next (reader)) \
- { \
- _dbus_warn ("_dbus_type_reader_next() should have returned FALSE at %s %d\n", \
- _DBUS_FUNCTION_NAME, __LINE__); \
- _dbus_assert_not_reached ("test failed"); \
- } \
- check_expected_type (reader, DBUS_TYPE_INVALID); \
-} while (0)
-
-typedef struct TestTypeNode TestTypeNode;
-typedef struct TestTypeNodeClass TestTypeNodeClass;
-typedef struct TestTypeNodeContainer TestTypeNodeContainer;
-typedef struct TestTypeNodeContainerClass TestTypeNodeContainerClass;
-
-struct TestTypeNode
-{
- const TestTypeNodeClass *klass;
-};
-
-struct TestTypeNodeContainer
-{
- TestTypeNode base;
- DBusList *children;
-};
-
-struct TestTypeNodeClass
-{
- int typecode;
-
- int instance_size;
-
- int subclass_detail; /* a bad hack to avoid a bunch of subclass casting */
-
- dbus_bool_t (* construct) (TestTypeNode *node);
- void (* destroy) (TestTypeNode *node);
-
- dbus_bool_t (* write_value) (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
- dbus_bool_t (* read_value) (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
- dbus_bool_t (* set_value) (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
- dbus_bool_t (* build_signature) (TestTypeNode *node,
- DBusString *str);
- dbus_bool_t (* write_multi) (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int count);
- dbus_bool_t (* read_multi) (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int count);
-};
-
-struct TestTypeNodeContainerClass
-{
- TestTypeNodeClass base;
-};
-
-/* FIXME this could be chilled out substantially by unifying
- * the basic types into basic_write_value/basic_read_value
- * and by merging read_value and set_value into one function
- * taking a flag argument.
- */
-static dbus_bool_t int16_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t int16_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t int16_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t int16_write_multi (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int count);
-static dbus_bool_t int16_read_multi (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int count);
-static dbus_bool_t int32_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t int32_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t int32_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t int32_write_multi (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int count);
-static dbus_bool_t int32_read_multi (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int count);
-static dbus_bool_t int64_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t int64_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t int64_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t string_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t string_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t string_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t bool_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t bool_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t bool_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t byte_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t byte_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t byte_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t double_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t double_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t double_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t object_path_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t object_path_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t object_path_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t signature_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t signature_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t signature_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t struct_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t struct_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t struct_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t struct_build_signature (TestTypeNode *node,
- DBusString *str);
-static dbus_bool_t dict_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t dict_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t dict_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t dict_build_signature (TestTypeNode *node,
- DBusString *str);
-static dbus_bool_t array_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t array_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t array_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static dbus_bool_t array_build_signature (TestTypeNode *node,
- DBusString *str);
-static dbus_bool_t variant_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed);
-static dbus_bool_t variant_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed);
-static dbus_bool_t variant_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed);
-static void container_destroy (TestTypeNode *node);
-
-
-
-static const TestTypeNodeClass int16_class = {
- DBUS_TYPE_INT16,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int16_write_value,
- int16_read_value,
- int16_set_value,
- NULL,
- int16_write_multi,
- int16_read_multi
-};
-
-static const TestTypeNodeClass uint16_class = {
- DBUS_TYPE_UINT16,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int16_write_value, /* recycle from int16 */
- int16_read_value, /* recycle from int16 */
- int16_set_value, /* recycle from int16 */
- NULL,
- int16_write_multi, /* recycle from int16 */
- int16_read_multi /* recycle from int16 */
-};
-
-static const TestTypeNodeClass int32_class = {
- DBUS_TYPE_INT32,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int32_write_value,
- int32_read_value,
- int32_set_value,
- NULL,
- int32_write_multi,
- int32_read_multi
-};
-
-static const TestTypeNodeClass uint32_class = {
- DBUS_TYPE_UINT32,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int32_write_value, /* recycle from int32 */
- int32_read_value, /* recycle from int32 */
- int32_set_value, /* recycle from int32 */
- NULL,
- int32_write_multi, /* recycle from int32 */
- int32_read_multi /* recycle from int32 */
-};
-
-static const TestTypeNodeClass int64_class = {
- DBUS_TYPE_INT64,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int64_write_value,
- int64_read_value,
- int64_set_value,
- NULL,
- NULL, /* FIXME */
- NULL /* FIXME */
-};
-
-static const TestTypeNodeClass uint64_class = {
- DBUS_TYPE_UINT64,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- int64_write_value, /* recycle from int64 */
- int64_read_value, /* recycle from int64 */
- int64_set_value, /* recycle from int64 */
- NULL,
- NULL, /* FIXME */
- NULL /* FIXME */
-};
-
-static const TestTypeNodeClass string_0_class = {
- DBUS_TYPE_STRING,
- sizeof (TestTypeNode),
- 0, /* string length */
- NULL,
- NULL,
- string_write_value,
- string_read_value,
- string_set_value,
- NULL,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass string_1_class = {
- DBUS_TYPE_STRING,
- sizeof (TestTypeNode),
- 1, /* string length */
- NULL,
- NULL,
- string_write_value,
- string_read_value,
- string_set_value,
- NULL,
- NULL,
- NULL
-};
-
-/* with nul, a len 3 string should fill 4 bytes and thus is "special" */
-static const TestTypeNodeClass string_3_class = {
- DBUS_TYPE_STRING,
- sizeof (TestTypeNode),
- 3, /* string length */
- NULL,
- NULL,
- string_write_value,
- string_read_value,
- string_set_value,
- NULL,
- NULL,
- NULL
-};
-
-/* with nul, a len 8 string should fill 9 bytes and thus is "special" (far-fetched I suppose) */
-static const TestTypeNodeClass string_8_class = {
- DBUS_TYPE_STRING,
- sizeof (TestTypeNode),
- 8, /* string length */
- NULL,
- NULL,
- string_write_value,
- string_read_value,
- string_set_value,
- NULL,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass bool_class = {
- DBUS_TYPE_BOOLEAN,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- bool_write_value,
- bool_read_value,
- bool_set_value,
- NULL,
- NULL, /* FIXME */
- NULL /* FIXME */
-};
-
-static const TestTypeNodeClass byte_class = {
- DBUS_TYPE_BYTE,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- byte_write_value,
- byte_read_value,
- byte_set_value,
- NULL,
- NULL, /* FIXME */
- NULL /* FIXME */
-};
-
-static const TestTypeNodeClass double_class = {
- DBUS_TYPE_DOUBLE,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- double_write_value,
- double_read_value,
- double_set_value,
- NULL,
- NULL, /* FIXME */
- NULL /* FIXME */
-};
-
-static const TestTypeNodeClass object_path_class = {
- DBUS_TYPE_OBJECT_PATH,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- object_path_write_value,
- object_path_read_value,
- object_path_set_value,
- NULL,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass signature_class = {
- DBUS_TYPE_SIGNATURE,
- sizeof (TestTypeNode),
- 0,
- NULL,
- NULL,
- signature_write_value,
- signature_read_value,
- signature_set_value,
- NULL,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass struct_1_class = {
- DBUS_TYPE_STRUCT,
- sizeof (TestTypeNodeContainer),
- 1, /* number of times children appear as fields */
- NULL,
- container_destroy,
- struct_write_value,
- struct_read_value,
- struct_set_value,
- struct_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass struct_2_class = {
- DBUS_TYPE_STRUCT,
- sizeof (TestTypeNodeContainer),
- 2, /* number of times children appear as fields */
- NULL,
- container_destroy,
- struct_write_value,
- struct_read_value,
- struct_set_value,
- struct_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass dict_1_class = {
- DBUS_TYPE_ARRAY, /* this is correct, a dict is an array of dict entry */
- sizeof (TestTypeNodeContainer),
- 1, /* number of entries */
- NULL,
- container_destroy,
- dict_write_value,
- dict_read_value,
- dict_set_value,
- dict_build_signature,
- NULL,
- NULL
-};
-
-static dbus_bool_t arrays_write_fixed_in_blocks = FALSE;
-
-static const TestTypeNodeClass array_0_class = {
- DBUS_TYPE_ARRAY,
- sizeof (TestTypeNodeContainer),
- 0, /* number of array elements */
- NULL,
- container_destroy,
- array_write_value,
- array_read_value,
- array_set_value,
- array_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass array_1_class = {
- DBUS_TYPE_ARRAY,
- sizeof (TestTypeNodeContainer),
- 1, /* number of array elements */
- NULL,
- container_destroy,
- array_write_value,
- array_read_value,
- array_set_value,
- array_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass array_2_class = {
- DBUS_TYPE_ARRAY,
- sizeof (TestTypeNodeContainer),
- 2, /* number of array elements */
- NULL,
- container_destroy,
- array_write_value,
- array_read_value,
- array_set_value,
- array_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass array_9_class = {
- DBUS_TYPE_ARRAY,
- sizeof (TestTypeNodeContainer),
- 9, /* number of array elements */
- NULL,
- container_destroy,
- array_write_value,
- array_read_value,
- array_set_value,
- array_build_signature,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass variant_class = {
- DBUS_TYPE_VARIANT,
- sizeof (TestTypeNodeContainer),
- 0,
- NULL,
- container_destroy,
- variant_write_value,
- variant_read_value,
- variant_set_value,
- NULL,
- NULL,
- NULL
-};
-
-static const TestTypeNodeClass* const
-basic_nodes[] = {
- &int16_class,
- &uint16_class,
- &int32_class,
- &uint32_class,
- &int64_class,
- &uint64_class,
- &bool_class,
- &byte_class,
- &double_class,
- &string_0_class,
- &string_1_class,
- &string_3_class,
- &string_8_class,
- &object_path_class,
- &signature_class
-};
-#define N_BASICS (_DBUS_N_ELEMENTS (basic_nodes))
-
-static const TestTypeNodeClass* const
-container_nodes[] = {
- &struct_1_class,
- &array_1_class,
- &struct_2_class,
- &array_0_class,
- &array_2_class,
- &variant_class,
- &dict_1_class /* last since we want struct and array before it */
- /* array_9_class is omitted on purpose, it's too slow;
- * we only use it in one hardcoded test below
- */
-};
-#define N_CONTAINERS (_DBUS_N_ELEMENTS (container_nodes))
-
-static TestTypeNode*
-node_new (const TestTypeNodeClass *klass)
-{
- TestTypeNode *node;
-
- node = dbus_malloc0 (klass->instance_size);
- if (node == NULL)
- return NULL;
-
- node->klass = klass;
-
- if (klass->construct)
- {
- if (!(* klass->construct) (node))
- {
- dbus_free (node);
- return NULL;
- }
- }
-
- return node;
-}
-
-static void
-node_destroy (TestTypeNode *node)
-{
- if (node->klass->destroy)
- (* node->klass->destroy) (node);
- dbus_free (node);
-}
-
-static dbus_bool_t
-node_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- dbus_bool_t retval;
-
- retval = (* node->klass->write_value) (node, block, writer, seed);
-
-#if 0
- /* Handy to see where things break, but too expensive to do all the time */
- data_block_verify (block);
-#endif
-
- return retval;
-}
-
-static dbus_bool_t
-node_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- /* DBusTypeReader restored; */
-
- if (!(* node->klass->read_value) (node, reader, seed))
- return FALSE;
-
- return TRUE;
-}
-
-/* Warning: if this one fails due to OOM, it has side effects (can
- * modify only some of the sub-values). OK in a test suite, but we
- * never do this in real code.
- */
-static dbus_bool_t
-node_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- if (!(* node->klass->set_value) (node, reader, realign_root, seed))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-node_build_signature (TestTypeNode *node,
- DBusString *str)
-{
- if (node->klass->build_signature)
- return (* node->klass->build_signature) (node, str);
- else
- return _dbus_string_append_byte (str, node->klass->typecode);
-}
-
-static dbus_bool_t
-node_append_child (TestTypeNode *node,
- TestTypeNode *child)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
-
- _dbus_assert (node->klass->instance_size >= (int) sizeof (TestTypeNodeContainer));
-
- if (!_dbus_list_append (&container->children, child))
- _dbus_assert_not_reached ("no memory"); /* we never check the return value on node_append_child anyhow - it's run from outside the malloc-failure test code */
-
- return TRUE;
-}
-
-static dbus_bool_t
-node_write_multi (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int n_copies)
-{
- dbus_bool_t retval;
-
- _dbus_assert (node->klass->write_multi != NULL);
- retval = (* node->klass->write_multi) (node, block, writer, seed, n_copies);
-
-#if 0
- /* Handy to see where things break, but too expensive to do all the time */
- data_block_verify (block);
-#endif
-
- return retval;
-}
-
-static dbus_bool_t
-node_read_multi (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int n_copies)
-{
- _dbus_assert (node->klass->read_multi != NULL);
-
- if (!(* node->klass->read_multi) (node, reader, seed, n_copies))
- return FALSE;
-
- return TRUE;
-}
-
-static int n_iterations_completed_total = 0;
-static int n_iterations_completed_this_test = 0;
-static int n_iterations_expected_this_test = 0;
-
-typedef struct
-{
- const DBusString *signature;
- DataBlock *block;
- int type_offset;
- TestTypeNode **nodes;
- int n_nodes;
-} NodeIterationData;
-
-static dbus_bool_t
-run_test_copy (NodeIterationData *nid)
-{
- DataBlock *src;
- DataBlock dest;
- dbus_bool_t retval;
- DBusTypeReader reader;
- DBusTypeWriter writer;
-
- _dbus_verbose ("\n");
-
- src = nid->block;
-
- retval = FALSE;
-
- if (!data_block_init (&dest, src->byte_order, src->initial_offset))
- return FALSE;
-
- data_block_init_reader_writer (src, &reader, NULL);
- data_block_init_reader_writer (&dest, NULL, &writer);
-
- /* DBusTypeWriter assumes it's writing into an existing signature,
- * so doesn't add nul on its own. We have to do that.
- */
- if (!_dbus_string_insert_byte (&dest.signature,
- dest.initial_offset, '\0'))
- goto out;
-
- if (!_dbus_type_writer_write_reader (&writer, &reader))
- goto out;
-
- /* Data blocks should now be identical */
- if (!_dbus_string_equal (&src->signature, &dest.signature))
- {
- _dbus_verbose ("SOURCE\n");
- _dbus_verbose_bytes_of_string (&src->signature, 0,
- _dbus_string_get_length (&src->signature));
- _dbus_verbose ("DEST\n");
- _dbus_verbose_bytes_of_string (&dest.signature, 0,
- _dbus_string_get_length (&dest.signature));
- _dbus_assert_not_reached ("signatures did not match");
- }
-
- if (!_dbus_string_equal (&src->body, &dest.body))
- {
- _dbus_verbose ("SOURCE\n");
- _dbus_verbose_bytes_of_string (&src->body, 0,
- _dbus_string_get_length (&src->body));
- _dbus_verbose ("DEST\n");
- _dbus_verbose_bytes_of_string (&dest.body, 0,
- _dbus_string_get_length (&dest.body));
- _dbus_assert_not_reached ("bodies did not match");
- }
-
- retval = TRUE;
-
- out:
-
- data_block_free (&dest);
-
- return retval;
-}
-
-static dbus_bool_t
-run_test_values_only_write (NodeIterationData *nid)
-{
- DBusTypeReader reader;
- DBusTypeWriter writer;
- int i;
- dbus_bool_t retval;
- int sig_len;
-
- _dbus_verbose ("\n");
-
- retval = FALSE;
-
- data_block_reset (nid->block);
-
- sig_len = _dbus_string_get_length (nid->signature);
-
- _dbus_type_writer_init_values_only (&writer,
- nid->block->byte_order,
- nid->signature, 0,
- &nid->block->body,
- _dbus_string_get_length (&nid->block->body) - N_FENCE_BYTES);
- _dbus_type_reader_init (&reader,
- nid->block->byte_order,
- nid->signature, 0,
- &nid->block->body,
- nid->block->initial_offset);
-
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_write_value (nid->nodes[i], nid->block, &writer, i))
- goto out;
-
- ++i;
- }
-
- /* if we wrote any typecodes then this would fail */
- _dbus_assert (sig_len == _dbus_string_get_length (nid->signature));
-
- /* But be sure we wrote out the values correctly */
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_read_value (nid->nodes[i], &reader, i))
- goto out;
-
- if (i + 1 == nid->n_nodes)
- NEXT_EXPECTING_FALSE (&reader);
- else
- NEXT_EXPECTING_TRUE (&reader);
-
- ++i;
- }
-
- retval = TRUE;
-
- out:
- data_block_reset (nid->block);
- return retval;
-}
-
-/* offset the seed for setting, so we set different numbers than
- * we originally wrote. Don't offset by a huge number since in
- * some cases it's value = possibilities[seed % n_possibilities]
- * and we don't want to wrap around. bool_from_seed
- * is just seed % 2 even.
- */
-#define SET_SEED 1
-static dbus_bool_t
-run_test_set_values (NodeIterationData *nid)
-{
- DBusTypeReader reader;
- DBusTypeReader realign_root;
- dbus_bool_t retval;
- int i;
-
- _dbus_verbose ("\n");
-
- retval = FALSE;
-
- data_block_init_reader_writer (nid->block,
- &reader, NULL);
-
- realign_root = reader;
-
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_set_value (nid->nodes[i],
- &reader, &realign_root,
- i + SET_SEED))
- goto out;
-
- if (i + 1 == nid->n_nodes)
- NEXT_EXPECTING_FALSE (&reader);
- else
- NEXT_EXPECTING_TRUE (&reader);
-
- ++i;
- }
-
- /* Check that the new values were set */
-
- reader = realign_root;
-
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_read_value (nid->nodes[i], &reader,
- i + SET_SEED))
- goto out;
-
- if (i + 1 == nid->n_nodes)
- NEXT_EXPECTING_FALSE (&reader);
- else
- NEXT_EXPECTING_TRUE (&reader);
-
- ++i;
- }
-
- retval = TRUE;
-
- out:
- return retval;
-}
-
-static dbus_bool_t
-run_test_delete_values (NodeIterationData *nid)
-{
- DBusTypeReader reader;
- dbus_bool_t retval;
- int t;
-
- _dbus_verbose ("\n");
-
- retval = FALSE;
-
- data_block_init_reader_writer (nid->block,
- &reader, NULL);
-
- while ((t = _dbus_type_reader_get_current_type (&reader)) != DBUS_TYPE_INVALID)
- {
- /* Right now, deleting only works on array elements. We delete
- * all array elements, and then verify that there aren't any
- * left.
- */
- if (t == DBUS_TYPE_ARRAY)
- {
- DBusTypeReader array;
- int n_elements;
- int elem_type;
-
- _dbus_type_reader_recurse (&reader, &array);
- n_elements = 0;
- while (_dbus_type_reader_get_current_type (&array) != DBUS_TYPE_INVALID)
- {
- n_elements += 1;
- _dbus_type_reader_next (&array);
- }
-
- /* reset to start of array */
- _dbus_type_reader_recurse (&reader, &array);
- _dbus_verbose ("recursing into deletion loop reader.value_pos = %d array.value_pos = %d array.u.start_pos = %d\n",
- reader.value_pos, array.value_pos, array.u.array.start_pos);
- while ((elem_type = _dbus_type_reader_get_current_type (&array)) != DBUS_TYPE_INVALID)
- {
- /* We don't want to always delete from the same part of the array. */
- static int cycle = 0;
- int elem;
-
- _dbus_assert (n_elements > 0);
-
- elem = cycle;
- if (elem == 3 || elem >= n_elements) /* end of array */
- elem = n_elements - 1;
-
- _dbus_verbose ("deleting array element %d of %d type %s cycle %d reader pos %d elem pos %d\n",
- elem, n_elements, _dbus_type_to_string (elem_type),
- cycle, reader.value_pos, array.value_pos);
- while (elem > 0)
- {
- if (!_dbus_type_reader_next (&array))
- _dbus_assert_not_reached ("should have had another element\n");
- --elem;
- }
-
- if (!_dbus_type_reader_delete (&array, &reader))
- goto out;
-
- n_elements -= 1;
-
- /* reset */
- _dbus_type_reader_recurse (&reader, &array);
-
- if (cycle > 2)
- cycle = 0;
- else
- cycle += 1;
- }
- }
- _dbus_type_reader_next (&reader);
- }
-
- /* Check that there are no array elements left */
- data_block_init_reader_writer (nid->block,
- &reader, NULL);
-
- while ((t = _dbus_type_reader_get_current_type (&reader)) != DBUS_TYPE_INVALID)
- {
- _dbus_type_reader_next (&reader);
- }
-
- retval = TRUE;
-
- out:
- return retval;
-}
-
-static dbus_bool_t
-run_test_nodes_iteration (void *data)
-{
- NodeIterationData *nid = data;
- DBusTypeReader reader;
- DBusTypeWriter writer;
- int i;
- dbus_bool_t retval;
-
- /* Stuff to do:
- * 1. write the value
- * 2. strcmp-compare with the signature we built
- * 3. read the value
- * 4. type-iterate the signature and the value and see if they are the same type-wise
- */
- retval = FALSE;
-
- data_block_init_reader_writer (nid->block,
- &reader, &writer);
-
- /* DBusTypeWriter assumes it's writing into an existing signature,
- * so doesn't add nul on its own. We have to do that.
- */
- if (!_dbus_string_insert_byte (&nid->block->signature,
- nid->type_offset, '\0'))
- goto out;
-
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_write_value (nid->nodes[i], nid->block, &writer, i))
- goto out;
-
- ++i;
- }
-
- if (!_dbus_string_equal_substring (nid->signature, 0, _dbus_string_get_length (nid->signature),
- &nid->block->signature, nid->type_offset))
- {
- _dbus_warn ("Expected signature '%s' and got '%s' with initial offset %d\n",
- _dbus_string_get_const_data (nid->signature),
- _dbus_string_get_const_data_len (&nid->block->signature, nid->type_offset, 0),
- nid->type_offset);
- _dbus_assert_not_reached ("wrong signature");
- }
-
- i = 0;
- while (i < nid->n_nodes)
- {
- if (!node_read_value (nid->nodes[i], &reader, i))
- goto out;
-
- if (i + 1 == nid->n_nodes)
- NEXT_EXPECTING_FALSE (&reader);
- else
- NEXT_EXPECTING_TRUE (&reader);
-
- ++i;
- }
-
- if (n_iterations_expected_this_test <= MAX_ITERATIONS_FOR_EXPENSIVE_TESTS)
- {
- /* this set values test uses code from copy and
- * values_only_write so would ideally be last so you get a
- * simpler test case for problems with copying or values_only
- * writing; but it also needs an already-written DataBlock so it
- * has to go first. Comment it out if it breaks, and see if the
- * later tests also break - debug them first if so.
- */
- if (!run_test_set_values (nid))
- goto out;
-
- if (!run_test_delete_values (nid))
- goto out;
-
- if (!run_test_copy (nid))
- goto out;
-
- if (!run_test_values_only_write (nid))
- goto out;
- }
-
- /* FIXME type-iterate both signature and value and compare the resulting
- * tree to the node tree perhaps
- */
-
- retval = TRUE;
-
- out:
-
- data_block_reset (nid->block);
-
- return retval;
-}
-
-static void
-run_test_nodes_in_one_configuration (TestTypeNode **nodes,
- int n_nodes,
- const DBusString *signature,
- int byte_order,
- int initial_offset)
-{
- DataBlock block;
- NodeIterationData nid;
-
- if (!data_block_init (&block, byte_order, initial_offset))
- _dbus_assert_not_reached ("no memory");
-
- nid.signature = signature;
- nid.block = &block;
- nid.type_offset = initial_offset;
- nid.nodes = nodes;
- nid.n_nodes = n_nodes;
-
- if (TEST_OOM_HANDLING &&
- n_iterations_expected_this_test <= MAX_ITERATIONS_FOR_EXPENSIVE_TESTS)
- {
- _dbus_test_oom_handling ("running test node",
- run_test_nodes_iteration,
- &nid);
- }
- else
- {
- if (!run_test_nodes_iteration (&nid))
- _dbus_assert_not_reached ("no memory");
- }
-
- data_block_free (&block);
-}
-
-static void
-run_test_nodes (TestTypeNode **nodes,
- int n_nodes)
-{
- int i;
- DBusString signature;
-
- if (!_dbus_string_init (&signature))
- _dbus_assert_not_reached ("no memory");
-
- i = 0;
- while (i < n_nodes)
- {
- if (! node_build_signature (nodes[i], &signature))
- _dbus_assert_not_reached ("no memory");
-
- ++i;
- }
-
- _dbus_verbose (">>> test nodes with signature '%s'\n",
- _dbus_string_get_const_data (&signature));
-
- i = 0;
- while (i <= MAX_INITIAL_OFFSET)
- {
- run_test_nodes_in_one_configuration (nodes, n_nodes, &signature,
- DBUS_LITTLE_ENDIAN, i);
- run_test_nodes_in_one_configuration (nodes, n_nodes, &signature,
- DBUS_BIG_ENDIAN, i);
-
- ++i;
- }
-
- n_iterations_completed_this_test += 1;
- n_iterations_completed_total += 1;
-
- if (n_iterations_completed_this_test == n_iterations_expected_this_test)
- {
- fprintf (stderr, " 100%% %d this test (%d cumulative)\n",
- n_iterations_completed_this_test,
- n_iterations_completed_total);
- }
- /* this happens to turn out well with mod == 1 */
- else if ((n_iterations_completed_this_test %
- (int)(n_iterations_expected_this_test / 10.0)) == 1)
- {
- fprintf (stderr, " %d%% ", (int) (n_iterations_completed_this_test / (double) n_iterations_expected_this_test * 100));
- }
-
- _dbus_string_free (&signature);
-}
-
-#define N_VALUES (N_BASICS * N_CONTAINERS + N_BASICS)
-
-static TestTypeNode*
-value_generator (int *ip)
-{
- int i = *ip;
- const TestTypeNodeClass *child_klass;
- const TestTypeNodeClass *container_klass;
- TestTypeNode *child;
- TestTypeNode *node;
-
- _dbus_assert (i <= N_VALUES);
-
- if (i == N_VALUES)
- {
- return NULL;
- }
- else if (i < N_BASICS)
- {
- node = node_new (basic_nodes[i]);
- }
- else
- {
- /* imagine an array:
- * container 0 of basic 0
- * container 0 of basic 1
- * container 0 of basic 2
- * container 1 of basic 0
- * container 1 of basic 1
- * container 1 of basic 2
- */
- i -= N_BASICS;
-
- container_klass = container_nodes[i / N_BASICS];
- child_klass = basic_nodes[i % N_BASICS];
-
- node = node_new (container_klass);
- child = node_new (child_klass);
-
- node_append_child (node, child);
- }
-
- *ip += 1; /* increment the generator */
-
- return node;
-}
-
-static void
-build_body (TestTypeNode **nodes,
- int n_nodes,
- int byte_order,
- DBusString *signature,
- DBusString *body)
-{
- int i;
- DataBlock block;
- DBusTypeReader reader;
- DBusTypeWriter writer;
-
- i = 0;
- while (i < n_nodes)
- {
- if (! node_build_signature (nodes[i], signature))
- _dbus_assert_not_reached ("no memory");
-
- ++i;
- }
-
- if (!data_block_init (&block, byte_order, 0))
- _dbus_assert_not_reached ("no memory");
-
- data_block_init_reader_writer (&block,
- &reader, &writer);
-
- /* DBusTypeWriter assumes it's writing into an existing signature,
- * so doesn't add nul on its own. We have to do that.
- */
- if (!_dbus_string_insert_byte (&block.signature,
- 0, '\0'))
- _dbus_assert_not_reached ("no memory");
-
- i = 0;
- while (i < n_nodes)
- {
- if (!node_write_value (nodes[i], &block, &writer, i))
- _dbus_assert_not_reached ("no memory");
-
- ++i;
- }
-
- if (!_dbus_string_copy_len (&block.body, 0,
- _dbus_string_get_length (&block.body) - N_FENCE_BYTES,
- body, 0))
- _dbus_assert_not_reached ("oom");
-
- data_block_free (&block);
-}
-
-dbus_bool_t
-dbus_internal_do_not_use_generate_bodies (int sequence,
- int byte_order,
- DBusString *signature,
- DBusString *body)
-{
- TestTypeNode *nodes[1];
- int i;
- int n_nodes;
-
- nodes[0] = value_generator (&sequence);
-
- if (nodes[0] == NULL)
- return FALSE;
-
- n_nodes = 1;
-
- build_body (nodes, n_nodes, byte_order, signature, body);
-
-
- i = 0;
- while (i < n_nodes)
- {
- node_destroy (nodes[i]);
- ++i;
- }
-
- return TRUE;
-}
-
-static void
-make_and_run_values_inside_container (const TestTypeNodeClass *container_klass,
- int n_nested)
-{
- TestTypeNode *root;
- TestTypeNode *container;
- TestTypeNode *child;
- int i;
-
- root = node_new (container_klass);
- container = root;
- for (i = 1; i < n_nested; i++)
- {
- child = node_new (container_klass);
- node_append_child (container, child);
- container = child;
- }
-
- /* container should now be the most-nested container */
-
- i = 0;
- while ((child = value_generator (&i)))
- {
- node_append_child (container, child);
-
- run_test_nodes (&root, 1);
-
- _dbus_list_clear (&((TestTypeNodeContainer*)container)->children);
- node_destroy (child);
- }
-
- node_destroy (root);
-}
-
-static void
-start_next_test (const char *format,
- int expected)
-{
- n_iterations_completed_this_test = 0;
- n_iterations_expected_this_test = expected;
-
- fprintf (stderr, ">>> >>> ");
- fprintf (stderr, format,
- n_iterations_expected_this_test);
-}
-
-static void
-make_and_run_test_nodes (void)
-{
- int i, j, k, m;
-
- /* We try to do this in order of "complicatedness" so that test
- * failures tend to show up in the simplest test case that
- * demonstrates the failure. There are also some tests that run
- * more than once for this reason, first while going through simple
- * cases, second while going through a broader range of complex
- * cases.
- */
- /* Each basic node. The basic nodes should include:
- *
- * - each fixed-size type (in such a way that it has different values each time,
- * so we can tell if we mix two of them up)
- * - strings of various lengths
- * - object path
- * - signature
- */
- /* Each container node. The container nodes should include:
- *
- * struct with 1 and 2 copies of the contained item
- * array with 0, 1, 2 copies of the contained item
- * variant
- */
- /* Let a "value" be a basic node, or a container containing a single basic node.
- * Let n_values be the number of such values i.e. (n_container * n_basic + n_basic)
- * When iterating through all values to make combinations, do the basic types
- * first and the containers second.
- */
- /* Each item is shown with its number of iterations to complete so
- * we can keep a handle on this unit test
- */
-
- /* FIXME test just an empty body, no types at all */
-
- start_next_test ("Each value by itself %d iterations\n", N_VALUES);
- {
- TestTypeNode *node;
- i = 0;
- while ((node = value_generator (&i)))
- {
- run_test_nodes (&node, 1);
-
- node_destroy (node);
- }
- }
-
- start_next_test ("Each value by itself with arrays as blocks %d iterations\n", N_VALUES);
- arrays_write_fixed_in_blocks = TRUE;
- {
- TestTypeNode *node;
- i = 0;
- while ((node = value_generator (&i)))
- {
- run_test_nodes (&node, 1);
-
- node_destroy (node);
- }
- }
- arrays_write_fixed_in_blocks = FALSE;
-
- start_next_test ("All values in one big toplevel %d iteration\n", 1);
- {
- TestTypeNode *nodes[N_VALUES];
-
- i = 0;
- while ((nodes[i] = value_generator (&i)))
- ;
-
- run_test_nodes (nodes, N_VALUES);
-
- for (i = 0; i < N_VALUES; i++)
- node_destroy (nodes[i]);
- }
-
- start_next_test ("Each value,value pair combination as toplevel, in both orders %d iterations\n",
- N_VALUES * N_VALUES);
- {
- TestTypeNode *nodes[2];
-
- i = 0;
- while ((nodes[0] = value_generator (&i)))
- {
- j = 0;
- while ((nodes[1] = value_generator (&j)))
- {
- run_test_nodes (nodes, 2);
-
- node_destroy (nodes[1]);
- }
-
- node_destroy (nodes[0]);
- }
- }
-
- start_next_test ("Each container containing each value %d iterations\n",
- N_CONTAINERS * N_VALUES);
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *container_klass = container_nodes[i];
-
- make_and_run_values_inside_container (container_klass, 1);
- }
-
- start_next_test ("Each container containing each value with arrays as blocks %d iterations\n",
- N_CONTAINERS * N_VALUES);
- arrays_write_fixed_in_blocks = TRUE;
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *container_klass = container_nodes[i];
-
- make_and_run_values_inside_container (container_klass, 1);
- }
- arrays_write_fixed_in_blocks = FALSE;
-
- start_next_test ("Each container of same container of each value %d iterations\n",
- N_CONTAINERS * N_VALUES);
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *container_klass = container_nodes[i];
-
- make_and_run_values_inside_container (container_klass, 2);
- }
-
- start_next_test ("Each container of same container of same container of each value %d iterations\n",
- N_CONTAINERS * N_VALUES);
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *container_klass = container_nodes[i];
-
- make_and_run_values_inside_container (container_klass, 3);
- }
-
- start_next_test ("Each value,value pair inside a struct %d iterations\n",
- N_VALUES * N_VALUES);
- {
- TestTypeNode *val1, *val2;
- TestTypeNode *node;
-
- node = node_new (&struct_1_class);
-
- i = 0;
- while ((val1 = value_generator (&i)))
- {
- j = 0;
- while ((val2 = value_generator (&j)))
- {
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
-
- node_append_child (node, val1);
- node_append_child (node, val2);
-
- run_test_nodes (&node, 1);
-
- _dbus_list_clear (&container->children);
- node_destroy (val2);
- }
- node_destroy (val1);
- }
- node_destroy (node);
- }
-
- start_next_test ("All values in one big struct %d iteration\n",
- 1);
- {
- TestTypeNode *node;
- TestTypeNode *child;
-
- node = node_new (&struct_1_class);
-
- i = 0;
- while ((child = value_generator (&i)))
- node_append_child (node, child);
-
- run_test_nodes (&node, 1);
-
- node_destroy (node);
- }
-
- start_next_test ("Each value in a large array %d iterations\n",
- N_VALUES);
- {
- TestTypeNode *val;
- TestTypeNode *node;
-
- node = node_new (&array_9_class);
-
- i = 0;
- while ((val = value_generator (&i)))
- {
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
-
- node_append_child (node, val);
-
- run_test_nodes (&node, 1);
-
- _dbus_list_clear (&container->children);
- node_destroy (val);
- }
-
- node_destroy (node);
- }
-
- if (_dbus_getenv ("DBUS_TEST_SLOW") == NULL ||
- atoi (_dbus_getenv ("DBUS_TEST_SLOW")) < 1)
- {
- fprintf (stderr, "skipping remaining marshal-recursive tests, "
- "run with DBUS_TEST_SLOW=1 (or more) to enable\n");
- goto out;
- }
-
- start_next_test ("Each container of each container of each value %d iterations\n",
- N_CONTAINERS * N_CONTAINERS * N_VALUES);
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *outer_container_klass = container_nodes[i];
- TestTypeNode *outer_container = node_new (outer_container_klass);
-
- for (j = 0; j < N_CONTAINERS; j++)
- {
- TestTypeNode *child;
- const TestTypeNodeClass *inner_container_klass = container_nodes[j];
- TestTypeNode *inner_container = node_new (inner_container_klass);
-
- node_append_child (outer_container, inner_container);
-
- m = 0;
- while ((child = value_generator (&m)))
- {
- node_append_child (inner_container, child);
-
- run_test_nodes (&outer_container, 1);
-
- _dbus_list_clear (&((TestTypeNodeContainer*)inner_container)->children);
- node_destroy (child);
- }
- _dbus_list_clear (&((TestTypeNodeContainer*)outer_container)->children);
- node_destroy (inner_container);
- }
- node_destroy (outer_container);
- }
-
- start_next_test ("Each container of each container of each container of each value %d iterations\n",
- N_CONTAINERS * N_CONTAINERS * N_CONTAINERS * N_VALUES);
- for (i = 0; i < N_CONTAINERS; i++)
- {
- const TestTypeNodeClass *outer_container_klass = container_nodes[i];
- TestTypeNode *outer_container = node_new (outer_container_klass);
-
- for (j = 0; j < N_CONTAINERS; j++)
- {
- const TestTypeNodeClass *inner_container_klass = container_nodes[j];
- TestTypeNode *inner_container = node_new (inner_container_klass);
-
- node_append_child (outer_container, inner_container);
-
- for (k = 0; k < N_CONTAINERS; k++)
- {
- TestTypeNode *child;
- const TestTypeNodeClass *center_container_klass = container_nodes[k];
- TestTypeNode *center_container = node_new (center_container_klass);
-
- node_append_child (inner_container, center_container);
-
- m = 0;
- while ((child = value_generator (&m)))
- {
- node_append_child (center_container, child);
-
- run_test_nodes (&outer_container, 1);
-
- _dbus_list_clear (&((TestTypeNodeContainer*)center_container)->children);
- node_destroy (child);
- }
- _dbus_list_clear (&((TestTypeNodeContainer*)inner_container)->children);
- node_destroy (center_container);
- }
- _dbus_list_clear (&((TestTypeNodeContainer*)outer_container)->children);
- node_destroy (inner_container);
- }
- node_destroy (outer_container);
- }
-
- /* This one takes a really long time (10 minutes on a Core2), so only enable
- * it if you're really sure */
- if (atoi (_dbus_getenv ("DBUS_TEST_SLOW")) < 2)
- {
- fprintf (stderr, "skipping really slow marshal-recursive test, "
- "run with DBUS_TEST_SLOW=2 (or more) to enable\n");
- goto out;
- }
-
- start_next_test ("Each value,value,value triplet combination as toplevel, in all orders %d iterations\n",
- N_VALUES * N_VALUES * N_VALUES);
- {
- TestTypeNode *nodes[3];
-
- i = 0;
- while ((nodes[0] = value_generator (&i)))
- {
- j = 0;
- while ((nodes[1] = value_generator (&j)))
- {
- k = 0;
- while ((nodes[2] = value_generator (&k)))
- {
- run_test_nodes (nodes, 3);
-
- node_destroy (nodes[2]);
- }
- node_destroy (nodes[1]);
- }
- node_destroy (nodes[0]);
- }
- }
-
-out:
- fprintf (stderr, "%d total iterations of recursive marshaling tests\n",
- n_iterations_completed_total);
- fprintf (stderr, "each iteration ran at initial offsets 0 through %d in both big and little endian\n",
- MAX_INITIAL_OFFSET);
- fprintf (stderr, "out of memory handling %s tested\n",
- TEST_OOM_HANDLING ? "was" : "was not");
-}
-
-dbus_bool_t
-_dbus_marshal_recursive_test (void)
-{
- make_and_run_test_nodes ();
-
- return TRUE;
-}
-
-/*
- *
- *
- * Implementations of each type node class
- *
- *
- *
- */
-#define MAX_MULTI_COUNT 5
-
-#define SAMPLE_INT16 1234
-#define SAMPLE_INT16_ALTERNATE 6785
-static dbus_int16_t
-int16_from_seed (int seed)
-{
- /* Generate an integer value that's predictable from seed. We could
- * just use seed itself, but that would only ever touch one byte of
- * the int so would miss some kinds of bug.
- */
- dbus_int16_t v;
-
- v = 42; /* just to quiet compiler afaik */
- switch (seed % 5)
- {
- case 0:
- v = SAMPLE_INT16;
- break;
- case 1:
- v = SAMPLE_INT16_ALTERNATE;
- break;
- case 2:
- v = -1;
- break;
- case 3:
- v = _DBUS_INT16_MAX;
- break;
- case 4:
- v = 1;
- break;
- }
-
- if (seed > 1)
- v *= seed; /* wraps around eventually, which is fine */
-
- return v;
-}
-
-static dbus_bool_t
-int16_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- /* also used for uint16 */
- dbus_int16_t v;
-
- v = int16_from_seed (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-int16_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- /* also used for uint16 */
- dbus_int16_t v;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (dbus_int16_t*) &v);
-
- _dbus_assert (v == int16_from_seed (seed));
-
- return TRUE;
-}
-
-static dbus_bool_t
-int16_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- /* also used for uint16 */
- dbus_int16_t v;
-
- v = int16_from_seed (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-static dbus_bool_t
-int16_write_multi (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int count)
-{
- /* also used for uint16 */
- dbus_int16_t values[MAX_MULTI_COUNT];
- dbus_int16_t *v_ARRAY_INT16 = values;
- int i;
-
- for (i = 0; i < count; ++i)
- values[i] = int16_from_seed (seed + i);
-
- return _dbus_type_writer_write_fixed_multi (writer,
- node->klass->typecode,
- &v_ARRAY_INT16, count);
-}
-
-static dbus_bool_t
-int16_read_multi (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int count)
-{
- /* also used for uint16 */
- dbus_int16_t *values;
- int n_elements;
- int i;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_fixed_multi (reader,
- &values,
- &n_elements);
-
- if (n_elements != count)
- _dbus_warn ("got %d elements expected %d\n", n_elements, count);
- _dbus_assert (n_elements == count);
-
- for (i = 0; i < count; i++)
- _dbus_assert (((dbus_int16_t)_dbus_unpack_uint16 (reader->byte_order,
- (const unsigned char*)values + (i * 2))) ==
- int16_from_seed (seed + i));
-
- return TRUE;
-}
-
-
-#define SAMPLE_INT32 12345678
-#define SAMPLE_INT32_ALTERNATE 53781429
-static dbus_int32_t
-int32_from_seed (int seed)
-{
- /* Generate an integer value that's predictable from seed. We could
- * just use seed itself, but that would only ever touch one byte of
- * the int so would miss some kinds of bug.
- */
- dbus_int32_t v;
-
- v = 42; /* just to quiet compiler afaik */
- switch (seed % 5)
- {
- case 0:
- v = SAMPLE_INT32;
- break;
- case 1:
- v = SAMPLE_INT32_ALTERNATE;
- break;
- case 2:
- v = -1;
- break;
- case 3:
- v = _DBUS_INT_MAX;
- break;
- case 4:
- v = 1;
- break;
- }
-
- if (seed > 1)
- v *= seed; /* wraps around eventually, which is fine */
-
- return v;
-}
-
-static dbus_bool_t
-int32_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- /* also used for uint32 */
- dbus_int32_t v;
-
- v = int32_from_seed (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-int32_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- /* also used for uint32 */
- dbus_int32_t v;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (dbus_int32_t*) &v);
-
- _dbus_assert (v == int32_from_seed (seed));
-
- return TRUE;
-}
-
-static dbus_bool_t
-int32_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- /* also used for uint32 */
- dbus_int32_t v;
-
- v = int32_from_seed (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-static dbus_bool_t
-int32_write_multi (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed,
- int count)
-{
- /* also used for uint32 */
- dbus_int32_t values[MAX_MULTI_COUNT];
- dbus_int32_t *v_ARRAY_INT32 = values;
- int i;
-
- for (i = 0; i < count; ++i)
- values[i] = int32_from_seed (seed + i);
-
- return _dbus_type_writer_write_fixed_multi (writer,
- node->klass->typecode,
- &v_ARRAY_INT32, count);
-}
-
-static dbus_bool_t
-int32_read_multi (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed,
- int count)
-{
- /* also used for uint32 */
- dbus_int32_t *values;
- int n_elements;
- int i;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_fixed_multi (reader,
- &values,
- &n_elements);
-
- if (n_elements != count)
- _dbus_warn ("got %d elements expected %d\n", n_elements, count);
- _dbus_assert (n_elements == count);
-
- for (i = 0; i < count; i++)
- _dbus_assert (((int)_dbus_unpack_uint32 (reader->byte_order,
- (const unsigned char*)values + (i * 4))) ==
- int32_from_seed (seed + i));
-
- return TRUE;
-}
-
-static dbus_int64_t
-int64_from_seed (int seed)
-{
- dbus_int32_t v32;
- dbus_int64_t v;
-
- v32 = int32_from_seed (seed);
-
- v = - (dbus_int32_t) ~ v32;
- v |= (((dbus_int64_t)v32) << 32);
-
- return v;
-}
-
-static dbus_bool_t
-int64_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- /* also used for uint64 */
- dbus_int64_t v;
-
- v = int64_from_seed (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-int64_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- /* also used for uint64 */
- dbus_int64_t v;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (dbus_int64_t*) &v);
-
- _dbus_assert (v == int64_from_seed (seed));
-
- return TRUE;
-}
-
-static dbus_bool_t
-int64_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- /* also used for uint64 */
- dbus_int64_t v;
-
- v = int64_from_seed (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-#define MAX_SAMPLE_STRING_LEN 10
-static void
-string_from_seed (char *buf,
- int len,
- int seed)
-{
- int i;
- unsigned char v;
-
- _dbus_assert (len < MAX_SAMPLE_STRING_LEN);
-
- /* vary the length slightly, though we also have multiple string
- * value types for this, varying it here tests the set_value code
- */
- switch (seed % 3)
- {
- case 1:
- len += 2;
- break;
- case 2:
- len -= 2;
- break;
- }
- if (len < 0)
- len = 0;
-
- v = (unsigned char) ('A' + seed);
-
- i = 0;
- while (i < len)
- {
- if (v < 'A' || v > 'z')
- v = 'A';
-
- buf[i] = v;
-
- v += 1;
- ++i;
- }
-
- buf[i] = '\0';
-}
-
-static dbus_bool_t
-string_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- char buf[MAX_SAMPLE_STRING_LEN + 1]="";
- const char *v_string = buf;
-
-
- string_from_seed (buf, node->klass->subclass_detail,
- seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v_string);
-}
-
-static dbus_bool_t
-string_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- const char *v;
- char buf[MAX_SAMPLE_STRING_LEN + 1];
- v = buf;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (const char **) &v);
-
- string_from_seed (buf, node->klass->subclass_detail,
- seed);
-
- if (strcmp (buf, v) != 0)
- {
- _dbus_warn ("read string '%s' expected '%s'\n",
- v, buf);
- _dbus_assert_not_reached ("test failed");
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-string_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- char buf[MAX_SAMPLE_STRING_LEN + 1];
- const char *v_string = buf;
-
- string_from_seed (buf, node->klass->subclass_detail,
- seed);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- {
- const char *old;
- _dbus_type_reader_read_basic (reader, &old);
- _dbus_verbose ("SETTING new string '%s' len %d in place of '%s' len %d\n",
- v_string, strlen (v_string), old, strlen (old));
- }
-#endif
-
- return _dbus_type_reader_set_basic (reader,
- &v_string,
- realign_root);
-}
-
-#define BOOL_FROM_SEED(seed) ((dbus_bool_t)((seed) % 2))
-
-static dbus_bool_t
-bool_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- dbus_bool_t v;
-
- v = BOOL_FROM_SEED (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-bool_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- dbus_bool_t v;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (unsigned char*) &v);
-
- _dbus_assert (v == BOOL_FROM_SEED (seed));
-
- return TRUE;
-}
-
-static dbus_bool_t
-bool_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- dbus_bool_t v;
-
- v = BOOL_FROM_SEED (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-#define BYTE_FROM_SEED(seed) ((unsigned char) int32_from_seed (seed))
-
-static dbus_bool_t
-byte_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- unsigned char v;
-
- v = BYTE_FROM_SEED (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-byte_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- unsigned char v;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (unsigned char*) &v);
-
- _dbus_assert (v == BYTE_FROM_SEED (seed));
-
- return TRUE;
-}
-
-
-static dbus_bool_t
-byte_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- unsigned char v;
-
- v = BYTE_FROM_SEED (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-static double
-double_from_seed (int seed)
-{
- return SAMPLE_INT32 * (double) seed + 0.3;
-}
-
-static dbus_bool_t
-double_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- double v;
-
- v = double_from_seed (seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v);
-}
-
-static dbus_bool_t
-double_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- double v;
- double expected;
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (double*) &v);
-
- expected = double_from_seed (seed);
-
- if (!_DBUS_DOUBLES_BITWISE_EQUAL (v, expected))
- {
-#ifdef DBUS_INT64_PRINTF_MODIFIER
- _dbus_warn ("Expected double %g got %g\n bits = 0x%" DBUS_INT64_PRINTF_MODIFIER "x vs.\n bits = 0x%" DBUS_INT64_PRINTF_MODIFIER "x)\n",
- expected, v,
- *(dbus_uint64_t*)(char*)&expected,
- *(dbus_uint64_t*)(char*)&v);
-#endif
- _dbus_assert_not_reached ("test failed");
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-double_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- double v;
-
- v = double_from_seed (seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v,
- realign_root);
-}
-
-#define MAX_SAMPLE_OBJECT_PATH_LEN 10
-static void
-object_path_from_seed (char *buf,
- int seed)
-{
- int i;
- unsigned char v;
- int len;
-
- len = seed % 9;
- _dbus_assert (len < MAX_SAMPLE_OBJECT_PATH_LEN);
-
- v = (unsigned char) ('A' + seed);
-
- if (len < 2)
- {
- buf[0] = '/';
- i = 1;
- }
- else
- {
- i = 0;
- while (i + 1 < len)
- {
- if (v < 'A' || v > 'z')
- v = 'A';
-
- buf[i] = '/';
- ++i;
- buf[i] = v;
- ++i;
-
- v += 1;
- }
- }
-
- buf[i] = '\0';
-}
-
-static dbus_bool_t
-object_path_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- char buf[MAX_SAMPLE_OBJECT_PATH_LEN + 1];
- const char *v_string = buf;
-
- object_path_from_seed (buf, seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v_string);
-}
-
-static dbus_bool_t
-object_path_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- const char *v;
- char buf[MAX_SAMPLE_OBJECT_PATH_LEN + 1];
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (const char **) &v);
-
- object_path_from_seed (buf, seed);
-
- if (strcmp (buf, v) != 0)
- {
- _dbus_warn ("read object path '%s' expected '%s'\n",
- v, buf);
- _dbus_assert_not_reached ("test failed");
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-object_path_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- char buf[MAX_SAMPLE_OBJECT_PATH_LEN + 1];
- const char *v_string = buf;
-
- object_path_from_seed (buf, seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v_string,
- realign_root);
-}
-
-#define MAX_SAMPLE_SIGNATURE_LEN 10
-static void
-signature_from_seed (char *buf,
- int seed)
-{
- /* try to avoid ascending, descending, or alternating length to help find bugs */
- const char *sample_signatures[] = {
- "asax"
- "",
- "asau(xxxx)",
- "x",
- "ai",
- "a(ii)"
- };
-
- strcpy (buf, sample_signatures[seed % _DBUS_N_ELEMENTS(sample_signatures)]);
-}
-
-static dbus_bool_t
-signature_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- char buf[MAX_SAMPLE_SIGNATURE_LEN + 1];
- const char *v_string = buf;
-
- signature_from_seed (buf, seed);
-
- return _dbus_type_writer_write_basic (writer,
- node->klass->typecode,
- &v_string);
-}
-
-static dbus_bool_t
-signature_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- const char *v;
- char buf[MAX_SAMPLE_SIGNATURE_LEN + 1];
-
- check_expected_type (reader, node->klass->typecode);
-
- _dbus_type_reader_read_basic (reader,
- (const char **) &v);
-
- signature_from_seed (buf, seed);
-
- if (strcmp (buf, v) != 0)
- {
- _dbus_warn ("read signature value '%s' expected '%s'\n",
- v, buf);
- _dbus_assert_not_reached ("test failed");
- }
-
- return TRUE;
-}
-
-
-static dbus_bool_t
-signature_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- char buf[MAX_SAMPLE_SIGNATURE_LEN + 1];
- const char *v_string = buf;
-
- signature_from_seed (buf, seed);
-
- return _dbus_type_reader_set_basic (reader,
- &v_string,
- realign_root);
-}
-
-static dbus_bool_t
-struct_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DataBlockState saved;
- DBusTypeWriter sub;
- int i;
- int n_copies;
-
- n_copies = node->klass->subclass_detail;
-
- _dbus_assert (container->children != NULL);
-
- data_block_save (block, &saved);
-
- if (!_dbus_type_writer_recurse (writer, DBUS_TYPE_STRUCT,
- NULL, 0,
- &sub))
- return FALSE;
-
- i = 0;
- while (i < n_copies)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- if (!node_write_value (child, block, &sub, seed + i))
- {
- data_block_restore (block, &saved);
- return FALSE;
- }
-
- link = next;
- }
-
- ++i;
- }
-
- if (!_dbus_type_writer_unrecurse (writer, &sub))
- {
- data_block_restore (block, &saved);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-struct_read_or_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DBusTypeReader sub;
- int i;
- int n_copies;
-
- n_copies = node->klass->subclass_detail;
-
- check_expected_type (reader, DBUS_TYPE_STRUCT);
-
- _dbus_type_reader_recurse (reader, &sub);
-
- i = 0;
- while (i < n_copies)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- if (realign_root == NULL)
- {
- if (!node_read_value (child, &sub, seed + i))
- return FALSE;
- }
- else
- {
- if (!node_set_value (child, &sub, realign_root, seed + i))
- return FALSE;
- }
-
- if (i == (n_copies - 1) && next == NULL)
- NEXT_EXPECTING_FALSE (&sub);
- else
- NEXT_EXPECTING_TRUE (&sub);
-
- link = next;
- }
-
- ++i;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-struct_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- return struct_read_or_set_value (node, reader, NULL, seed);
-}
-
-static dbus_bool_t
-struct_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- return struct_read_or_set_value (node, reader, realign_root, seed);
-}
-
-static dbus_bool_t
-struct_build_signature (TestTypeNode *node,
- DBusString *str)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- int i;
- int orig_len;
- int n_copies;
-
- n_copies = node->klass->subclass_detail;
-
- orig_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_append_byte (str, DBUS_STRUCT_BEGIN_CHAR))
- goto oom;
-
- i = 0;
- while (i < n_copies)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- if (!node_build_signature (child, str))
- goto oom;
-
- link = next;
- }
-
- ++i;
- }
-
- if (!_dbus_string_append_byte (str, DBUS_STRUCT_END_CHAR))
- goto oom;
-
- return TRUE;
-
- oom:
- _dbus_string_set_length (str, orig_len);
- return FALSE;
-}
-
-static dbus_bool_t
-array_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DataBlockState saved;
- DBusTypeWriter sub;
- DBusString element_signature;
- int i;
- int n_copies;
- int element_type;
- TestTypeNode *child;
-
- n_copies = node->klass->subclass_detail;
-
- _dbus_assert (container->children != NULL);
-
- data_block_save (block, &saved);
-
- if (!_dbus_string_init (&element_signature))
- return FALSE;
-
- child = _dbus_list_get_first (&container->children);
-
- if (!node_build_signature (child,
- &element_signature))
- goto oom;
-
- element_type = _dbus_first_type_in_signature (&element_signature, 0);
-
- if (!_dbus_type_writer_recurse (writer, DBUS_TYPE_ARRAY,
- &element_signature, 0,
- &sub))
- goto oom;
-
- if (arrays_write_fixed_in_blocks &&
- dbus_type_is_fixed (element_type) &&
- child->klass->write_multi)
- {
- if (!node_write_multi (child, block, &sub, seed, n_copies))
- goto oom;
- }
- else
- {
- i = 0;
- while (i < n_copies)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- if (!node_write_value (child, block, &sub, seed + i))
- goto oom;
-
- link = next;
- }
-
- ++i;
- }
- }
-
- if (!_dbus_type_writer_unrecurse (writer, &sub))
- goto oom;
-
- _dbus_string_free (&element_signature);
- return TRUE;
-
- oom:
- data_block_restore (block, &saved);
- _dbus_string_free (&element_signature);
- return FALSE;
-}
-
-static dbus_bool_t
-array_read_or_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DBusTypeReader sub;
- int i;
- int n_copies;
- TestTypeNode *child;
-
- n_copies = node->klass->subclass_detail;
-
- check_expected_type (reader, DBUS_TYPE_ARRAY);
-
- child = _dbus_list_get_first (&container->children);
-
- if (n_copies > 0)
- {
- _dbus_type_reader_recurse (reader, &sub);
-
- if (realign_root == NULL && arrays_write_fixed_in_blocks &&
- dbus_type_is_fixed (_dbus_type_reader_get_element_type (reader)) &&
- child->klass->read_multi)
- {
- if (!node_read_multi (child, &sub, seed, n_copies))
- return FALSE;
- }
- else
- {
- i = 0;
- while (i < n_copies)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- _dbus_assert (child->klass->typecode ==
- _dbus_type_reader_get_element_type (reader));
-
- if (realign_root == NULL)
- {
- if (!node_read_value (child, &sub, seed + i))
- return FALSE;
- }
- else
- {
- if (!node_set_value (child, &sub, realign_root, seed + i))
- return FALSE;
- }
-
- if (i == (n_copies - 1) && next == NULL)
- NEXT_EXPECTING_FALSE (&sub);
- else
- NEXT_EXPECTING_TRUE (&sub);
-
- link = next;
- }
-
- ++i;
- }
- }
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-array_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- return array_read_or_set_value (node, reader, NULL, seed);
-}
-
-static dbus_bool_t
-array_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- return array_read_or_set_value (node, reader, realign_root, seed);
-}
-
-static dbus_bool_t
-array_build_signature (TestTypeNode *node,
- DBusString *str)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- int orig_len;
-
- orig_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_append_byte (str, DBUS_TYPE_ARRAY))
- goto oom;
-
- if (!node_build_signature (_dbus_list_get_first (&container->children),
- str))
- goto oom;
-
- return TRUE;
-
- oom:
- _dbus_string_set_length (str, orig_len);
- return FALSE;
-}
-
- /* 10 is random just to add another seed that we use in the suite */
-#define VARIANT_SEED 10
-
-static dbus_bool_t
-variant_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DataBlockState saved;
- DBusTypeWriter sub;
- DBusString content_signature;
- TestTypeNode *child;
-
- _dbus_assert (container->children != NULL);
- _dbus_assert (_dbus_list_length_is_one (&container->children));
-
- child = _dbus_list_get_first (&container->children);
-
- data_block_save (block, &saved);
-
- if (!_dbus_string_init (&content_signature))
- return FALSE;
-
- if (!node_build_signature (child,
- &content_signature))
- goto oom;
-
- if (!_dbus_type_writer_recurse (writer, DBUS_TYPE_VARIANT,
- &content_signature, 0,
- &sub))
- goto oom;
-
- if (!node_write_value (child, block, &sub, seed + VARIANT_SEED))
- goto oom;
-
- if (!_dbus_type_writer_unrecurse (writer, &sub))
- goto oom;
-
- _dbus_string_free (&content_signature);
- return TRUE;
-
- oom:
- data_block_restore (block, &saved);
- _dbus_string_free (&content_signature);
- return FALSE;
-}
-
-static dbus_bool_t
-variant_read_or_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DBusTypeReader sub;
- TestTypeNode *child;
-
- _dbus_assert (container->children != NULL);
- _dbus_assert (_dbus_list_length_is_one (&container->children));
-
- child = _dbus_list_get_first (&container->children);
-
- check_expected_type (reader, DBUS_TYPE_VARIANT);
-
- _dbus_type_reader_recurse (reader, &sub);
-
- if (realign_root == NULL)
- {
- if (!node_read_value (child, &sub, seed + VARIANT_SEED))
- return FALSE;
- }
- else
- {
- if (!node_set_value (child, &sub, realign_root, seed + VARIANT_SEED))
- return FALSE;
- }
-
- NEXT_EXPECTING_FALSE (&sub);
-
- return TRUE;
-}
-
-static dbus_bool_t
-variant_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- return variant_read_or_set_value (node, reader, NULL, seed);
-}
-
-static dbus_bool_t
-variant_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- return variant_read_or_set_value (node, reader, realign_root, seed);
-}
-
-static dbus_bool_t
-dict_write_value (TestTypeNode *node,
- DataBlock *block,
- DBusTypeWriter *writer,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DataBlockState saved;
- DBusTypeWriter sub;
- DBusString entry_value_signature;
- DBusString dict_entry_signature;
- int i;
- int n_entries;
- TestTypeNode *child;
-
- n_entries = node->klass->subclass_detail;
-
- _dbus_assert (container->children != NULL);
-
- data_block_save (block, &saved);
-
- if (!_dbus_string_init (&entry_value_signature))
- return FALSE;
-
- if (!_dbus_string_init (&dict_entry_signature))
- {
- _dbus_string_free (&entry_value_signature);
- return FALSE;
- }
-
- child = _dbus_list_get_first (&container->children);
-
- if (!node_build_signature (child,
- &entry_value_signature))
- goto oom;
-
- if (!_dbus_string_append (&dict_entry_signature,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_INT32_AS_STRING))
- goto oom;
-
- if (!_dbus_string_copy (&entry_value_signature, 0,
- &dict_entry_signature,
- _dbus_string_get_length (&dict_entry_signature)))
- goto oom;
-
- if (!_dbus_string_append_byte (&dict_entry_signature,
- DBUS_DICT_ENTRY_END_CHAR))
- goto oom;
-
- if (!_dbus_type_writer_recurse (writer, DBUS_TYPE_ARRAY,
- &dict_entry_signature, 0,
- &sub))
- goto oom;
-
- i = 0;
- while (i < n_entries)
- {
- DBusTypeWriter entry_sub;
- dbus_int32_t key;
-
- if (!_dbus_type_writer_recurse (&sub, DBUS_TYPE_DICT_ENTRY,
- NULL, 0,
- &entry_sub))
- goto oom;
-
- key = int32_from_seed (seed + i);
-
- if (!_dbus_type_writer_write_basic (&entry_sub,
- DBUS_TYPE_INT32,
- &key))
- goto oom;
-
- if (!node_write_value (child, block, &entry_sub, seed + i))
- goto oom;
-
- if (!_dbus_type_writer_unrecurse (&sub, &entry_sub))
- goto oom;
-
- ++i;
- }
-
- if (!_dbus_type_writer_unrecurse (writer, &sub))
- goto oom;
-
- _dbus_string_free (&entry_value_signature);
- _dbus_string_free (&dict_entry_signature);
- return TRUE;
-
- oom:
- data_block_restore (block, &saved);
- _dbus_string_free (&entry_value_signature);
- _dbus_string_free (&dict_entry_signature);
- return FALSE;
-}
-
-static dbus_bool_t
-dict_read_or_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DBusTypeReader sub;
- int i;
- int n_entries;
- TestTypeNode *child;
-
- n_entries = node->klass->subclass_detail;
-
- check_expected_type (reader, DBUS_TYPE_ARRAY);
-
- child = _dbus_list_get_first (&container->children);
-
- if (n_entries > 0)
- {
- _dbus_type_reader_recurse (reader, &sub);
-
- check_expected_type (&sub, DBUS_TYPE_DICT_ENTRY);
-
- i = 0;
- while (i < n_entries)
- {
- DBusTypeReader entry_sub;
-
- check_expected_type (&sub, DBUS_TYPE_DICT_ENTRY);
-
- _dbus_type_reader_recurse (&sub, &entry_sub);
-
- if (realign_root == NULL)
- {
- dbus_int32_t v;
-
- check_expected_type (&entry_sub, DBUS_TYPE_INT32);
-
- _dbus_type_reader_read_basic (&entry_sub,
- (dbus_int32_t*) &v);
-
- _dbus_assert (v == int32_from_seed (seed + i));
-
- NEXT_EXPECTING_TRUE (&entry_sub);
-
- if (!node_read_value (child, &entry_sub, seed + i))
- return FALSE;
-
- NEXT_EXPECTING_FALSE (&entry_sub);
- }
- else
- {
- dbus_int32_t v;
-
- v = int32_from_seed (seed + i);
-
- if (!_dbus_type_reader_set_basic (&entry_sub,
- &v,
- realign_root))
- return FALSE;
-
- NEXT_EXPECTING_TRUE (&entry_sub);
-
- if (!node_set_value (child, &entry_sub, realign_root, seed + i))
- return FALSE;
-
- NEXT_EXPECTING_FALSE (&entry_sub);
- }
-
- if (i == (n_entries - 1))
- NEXT_EXPECTING_FALSE (&sub);
- else
- NEXT_EXPECTING_TRUE (&sub);
-
- ++i;
- }
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-dict_read_value (TestTypeNode *node,
- DBusTypeReader *reader,
- int seed)
-{
- return dict_read_or_set_value (node, reader, NULL, seed);
-}
-
-static dbus_bool_t
-dict_set_value (TestTypeNode *node,
- DBusTypeReader *reader,
- DBusTypeReader *realign_root,
- int seed)
-{
- return dict_read_or_set_value (node, reader, realign_root, seed);
-}
-
-static dbus_bool_t
-dict_build_signature (TestTypeNode *node,
- DBusString *str)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- int orig_len;
-
- orig_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_append_byte (str, DBUS_TYPE_ARRAY))
- goto oom;
-
- if (!_dbus_string_append (str, DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_INT32_AS_STRING))
- goto oom;
-
- if (!node_build_signature (_dbus_list_get_first (&container->children),
- str))
- goto oom;
-
- if (!_dbus_string_append_byte (str, DBUS_DICT_ENTRY_END_CHAR))
- goto oom;
-
- return TRUE;
-
- oom:
- _dbus_string_set_length (str, orig_len);
- return FALSE;
-}
-
-static void
-container_destroy (TestTypeNode *node)
-{
- TestTypeNodeContainer *container = (TestTypeNodeContainer*) node;
- DBusList *link;
-
- link = _dbus_list_get_first_link (&container->children);
- while (link != NULL)
- {
- TestTypeNode *child = link->data;
- DBusList *next = _dbus_list_get_next_link (&container->children, link);
-
- node_destroy (child);
-
- _dbus_list_free_link (link);
-
- link = next;
- }
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.c
deleted file mode 100644
index 4adfd2e9f3..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.c
+++ /dev/null
@@ -1,2752 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-recursive.c Marshalling routines for recursive types
- *
- * Copyright (C) 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-signature.h"
-#include "dbus-internals.h"
-
-/**
- * @addtogroup DBusMarshal
- * @{
- */
-
-static dbus_bool_t _dbus_type_reader_greater_than (const DBusTypeReader *lhs,
- const DBusTypeReader *rhs);
-
-static void _dbus_type_writer_set_enabled (DBusTypeWriter *writer,
- dbus_bool_t enabled);
-static dbus_bool_t _dbus_type_writer_write_reader_partial (DBusTypeWriter *writer,
- DBusTypeReader *reader,
- const DBusTypeReader *start_after,
- int start_after_new_pos,
- int start_after_new_len,
- DBusList **fixups);
-
-/** turn this on to get deluged in TypeReader verbose spam */
-#define RECURSIVE_MARSHAL_READ_TRACE 0
-
-/** turn this on to get deluged in TypeWriter verbose spam */
-#define RECURSIVE_MARSHAL_WRITE_TRACE 0
-
-static void
-free_fixups (DBusList **fixups)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (fixups);
- while (link != NULL)
- {
- DBusList *next;
-
- next = _dbus_list_get_next_link (fixups, link);
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
-
- link = next;
- }
-
- *fixups = NULL;
-}
-
-static void
-apply_and_free_fixups (DBusList **fixups,
- DBusTypeReader *reader)
-{
- DBusList *link;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- if (*fixups)
- _dbus_verbose (" %d FIXUPS to apply\n",
- _dbus_list_get_length (fixups));
-#endif
-
- link = _dbus_list_get_first_link (fixups);
- while (link != NULL)
- {
- DBusList *next;
-
- next = _dbus_list_get_next_link (fixups, link);
-
- if (reader)
- {
- DBusArrayLenFixup *f;
-
- f = link->data;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" applying FIXUP to reader %p at pos %d new_len = %d old len %d\n",
- reader, f->len_pos_in_reader, f->new_len,
- _dbus_marshal_read_uint32 (reader->value_str,
- f->len_pos_in_reader,
- reader->byte_order, NULL));
-#endif
-
- _dbus_marshal_set_uint32 ((DBusString*) reader->value_str,
- f->len_pos_in_reader,
- f->new_len,
- reader->byte_order);
- }
-
- dbus_free (link->data);
- _dbus_list_free_link (link);
-
- link = next;
- }
-
- *fixups = NULL;
-}
-
-/**
- * Virtual table for a type reader.
- */
-struct DBusTypeReaderClass
-{
- const char *name; /**< name for debugging */
- int id; /**< index in all_reader_classes */
- dbus_bool_t types_only; /**< only iterates over types, not values */
- void (* recurse) (DBusTypeReader *sub,
- DBusTypeReader *parent); /**< recurse with this reader as sub */
- dbus_bool_t (* check_finished) (const DBusTypeReader *reader); /**< check whether reader is at the end */
- void (* next) (DBusTypeReader *reader,
- int current_type); /**< go to the next value */
-};
-
-static int
-element_type_get_alignment (const DBusString *str,
- int pos)
-{
- return _dbus_type_get_alignment (_dbus_first_type_in_signature (str, pos));
-}
-
-static void
-reader_init (DBusTypeReader *reader,
- int byte_order,
- const DBusString *type_str,
- int type_pos,
- const DBusString *value_str,
- int value_pos)
-{
- reader->byte_order = byte_order;
- reader->finished = FALSE;
- reader->type_str = type_str;
- reader->type_pos = type_pos;
- reader->value_str = value_str;
- reader->value_pos = value_pos;
-}
-
-static void
-base_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- /* point subreader at the same place as parent */
- reader_init (sub,
- parent->byte_order,
- parent->type_str,
- parent->type_pos,
- parent->value_str,
- parent->value_pos);
-}
-
-static void
-struct_or_dict_entry_types_only_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- base_reader_recurse (sub, parent);
-
- _dbus_assert (_dbus_string_get_byte (sub->type_str,
- sub->type_pos) == DBUS_STRUCT_BEGIN_CHAR ||
- _dbus_string_get_byte (sub->type_str,
- sub->type_pos) == DBUS_DICT_ENTRY_BEGIN_CHAR);
-
- sub->type_pos += 1;
-}
-
-static void
-struct_or_dict_entry_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- struct_or_dict_entry_types_only_reader_recurse (sub, parent);
-
- /* struct and dict entry have 8 byte alignment */
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, 8);
-}
-
-static void
-array_types_only_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- base_reader_recurse (sub, parent);
-
- /* point type_pos at the array element type */
- sub->type_pos += 1;
-
- /* Init with values likely to crash things if misused */
- sub->u.array.start_pos = _DBUS_INT_MAX;
- sub->array_len_offset = 7;
-}
-
-/** compute position of array length given array_len_offset, which is
- the offset back from start_pos to end of the len */
-#define ARRAY_READER_LEN_POS(reader) \
- ((reader)->u.array.start_pos - ((int)(reader)->array_len_offset) - 4)
-
-static int
-array_reader_get_array_len (const DBusTypeReader *reader)
-{
- dbus_uint32_t array_len;
- int len_pos;
-
- len_pos = ARRAY_READER_LEN_POS (reader);
-
- _dbus_assert (_DBUS_ALIGN_VALUE (len_pos, 4) == (unsigned) len_pos);
- array_len = _dbus_unpack_uint32 (reader->byte_order,
- _dbus_string_get_const_data_len (reader->value_str, len_pos, 4));
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" reader %p len_pos %d array len %u len_offset %d\n",
- reader, len_pos, array_len, reader->array_len_offset);
-#endif
-
- _dbus_assert (reader->u.array.start_pos - len_pos - 4 < 8);
-
- return array_len;
-}
-
-static void
-array_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- int alignment;
- int len_pos;
-
- array_types_only_reader_recurse (sub, parent);
-
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, 4);
-
- len_pos = sub->value_pos;
-
- sub->value_pos += 4; /* for the length */
-
- alignment = element_type_get_alignment (sub->type_str,
- sub->type_pos);
-
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, alignment);
-
- sub->u.array.start_pos = sub->value_pos;
- _dbus_assert ((sub->u.array.start_pos - (len_pos + 4)) < 8); /* only 3 bits in array_len_offset */
- sub->array_len_offset = sub->u.array.start_pos - (len_pos + 4);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p array start = %d len_offset = %d array len = %d array element type = %s\n",
- sub,
- sub->u.array.start_pos,
- sub->array_len_offset,
- array_reader_get_array_len (sub),
- _dbus_type_to_string (_dbus_first_type_in_signature (sub->type_str,
- sub->type_pos)));
-#endif
-}
-
-static void
-variant_reader_recurse (DBusTypeReader *sub,
- DBusTypeReader *parent)
-{
- int sig_len;
- int contained_alignment;
-
- base_reader_recurse (sub, parent);
-
- /* Variant is 1 byte sig length (without nul), signature with nul,
- * padding to 8-boundary, then values
- */
-
- sig_len = _dbus_string_get_byte (sub->value_str, sub->value_pos);
-
- sub->type_str = sub->value_str;
- sub->type_pos = sub->value_pos + 1;
-
- sub->value_pos = sub->type_pos + sig_len + 1;
-
- contained_alignment = _dbus_type_get_alignment (_dbus_first_type_in_signature (sub->type_str,
- sub->type_pos));
-
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, contained_alignment);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p variant containing '%s'\n",
- sub,
- _dbus_string_get_const_data_len (sub->type_str,
- sub->type_pos, 0));
-#endif
-}
-
-static dbus_bool_t
-array_reader_check_finished (const DBusTypeReader *reader)
-{
- int end_pos;
-
- /* return the array element type if elements remain, and
- * TYPE_INVALID otherwise
- */
-
- end_pos = reader->u.array.start_pos + array_reader_get_array_len (reader);
-
- _dbus_assert (reader->value_pos <= end_pos);
- _dbus_assert (reader->value_pos >= reader->u.array.start_pos);
-
- return reader->value_pos == end_pos;
-}
-
-static void
-skip_one_complete_type (const DBusString *type_str,
- int *type_pos)
-{
- _dbus_type_signature_next (_dbus_string_get_const_data (type_str),
- type_pos);
-}
-
-/**
- * Skips to the next "complete" type inside a type signature.
- * The signature is read starting at type_pos, and the next
- * type position is stored in the same variable.
- *
- * @param type_str a type signature (must be valid)
- * @param type_pos an integer position in the type signature (in and out)
- */
-void
-_dbus_type_signature_next (const char *type_str,
- int *type_pos)
-{
- const unsigned char *p;
- const unsigned char *start;
-
- _dbus_assert (type_str != NULL);
- _dbus_assert (type_pos != NULL);
-
- start = type_str;
- p = start + *type_pos;
-
- _dbus_assert (*p != DBUS_STRUCT_END_CHAR);
- _dbus_assert (*p != DBUS_DICT_ENTRY_END_CHAR);
-
- while (*p == DBUS_TYPE_ARRAY)
- ++p;
-
- _dbus_assert (*p != DBUS_STRUCT_END_CHAR);
- _dbus_assert (*p != DBUS_DICT_ENTRY_END_CHAR);
-
- if (*p == DBUS_STRUCT_BEGIN_CHAR)
- {
- int depth;
-
- depth = 1;
-
- while (TRUE)
- {
- _dbus_assert (*p != DBUS_TYPE_INVALID);
-
- ++p;
-
- _dbus_assert (*p != DBUS_TYPE_INVALID);
-
- if (*p == DBUS_STRUCT_BEGIN_CHAR)
- depth += 1;
- else if (*p == DBUS_STRUCT_END_CHAR)
- {
- depth -= 1;
- if (depth == 0)
- {
- ++p;
- break;
- }
- }
- }
- }
- else if (*p == DBUS_DICT_ENTRY_BEGIN_CHAR)
- {
- int depth;
-
- depth = 1;
-
- while (TRUE)
- {
- _dbus_assert (*p != DBUS_TYPE_INVALID);
-
- ++p;
-
- _dbus_assert (*p != DBUS_TYPE_INVALID);
-
- if (*p == DBUS_DICT_ENTRY_BEGIN_CHAR)
- depth += 1;
- else if (*p == DBUS_DICT_ENTRY_END_CHAR)
- {
- depth -= 1;
- if (depth == 0)
- {
- ++p;
- break;
- }
- }
- }
- }
- else
- {
- ++p;
- }
-
- *type_pos = (int) (p - start);
-}
-
-static int
-find_len_of_complete_type (const DBusString *type_str,
- int type_pos)
-{
- int end;
-
- end = type_pos;
-
- skip_one_complete_type (type_str, &end);
-
- return end - type_pos;
-}
-
-static void
-base_reader_next (DBusTypeReader *reader,
- int current_type)
-{
- switch (current_type)
- {
- case DBUS_TYPE_DICT_ENTRY:
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_VARIANT:
- /* Scan forward over the entire container contents */
- {
- DBusTypeReader sub;
-
- if (reader->klass->types_only && current_type == DBUS_TYPE_VARIANT)
- ;
- else
- {
- /* Recurse into the struct or variant */
- _dbus_type_reader_recurse (reader, &sub);
-
- /* Skip everything in this subreader */
- while (_dbus_type_reader_next (&sub))
- {
- /* nothing */;
- }
- }
- if (!reader->klass->types_only)
- reader->value_pos = sub.value_pos;
-
- /* Now we are at the end of this container; for variants, the
- * subreader's type_pos is totally inapplicable (it's in the
- * value string) but we know that we increment by one past the
- * DBUS_TYPE_VARIANT
- */
- if (current_type == DBUS_TYPE_VARIANT)
- reader->type_pos += 1;
- else
- reader->type_pos = sub.type_pos;
- }
- break;
-
- case DBUS_TYPE_ARRAY:
- {
- if (!reader->klass->types_only)
- _dbus_marshal_skip_array (reader->value_str,
- _dbus_first_type_in_signature (reader->type_str,
- reader->type_pos + 1),
- reader->byte_order,
- &reader->value_pos);
-
- skip_one_complete_type (reader->type_str, &reader->type_pos);
- }
- break;
-
- default:
- if (!reader->klass->types_only)
- _dbus_marshal_skip_basic (reader->value_str,
- current_type, reader->byte_order,
- &reader->value_pos);
-
- reader->type_pos += 1;
- break;
- }
-}
-
-static void
-struct_reader_next (DBusTypeReader *reader,
- int current_type)
-{
- int t;
-
- base_reader_next (reader, current_type);
-
- /* for STRUCT containers we return FALSE at the end of the struct,
- * for INVALID we return FALSE at the end of the signature.
- * In both cases we arrange for get_current_type() to return INVALID
- * which is defined to happen iff we're at the end (no more next())
- */
- t = _dbus_string_get_byte (reader->type_str, reader->type_pos);
- if (t == DBUS_STRUCT_END_CHAR)
- {
- reader->type_pos += 1;
- reader->finished = TRUE;
- }
-}
-
-static void
-dict_entry_reader_next (DBusTypeReader *reader,
- int current_type)
-{
- int t;
-
- base_reader_next (reader, current_type);
-
- /* for STRUCT containers we return FALSE at the end of the struct,
- * for INVALID we return FALSE at the end of the signature.
- * In both cases we arrange for get_current_type() to return INVALID
- * which is defined to happen iff we're at the end (no more next())
- */
- t = _dbus_string_get_byte (reader->type_str, reader->type_pos);
- if (t == DBUS_DICT_ENTRY_END_CHAR)
- {
- reader->type_pos += 1;
- reader->finished = TRUE;
- }
-}
-
-static void
-array_types_only_reader_next (DBusTypeReader *reader,
- int current_type)
-{
- /* We have one "element" to be iterated over
- * in each array, which is its element type.
- * So the finished flag indicates whether we've
- * iterated over it yet or not.
- */
- reader->finished = TRUE;
-}
-
-static void
-array_reader_next (DBusTypeReader *reader,
- int current_type)
-{
- /* Skip one array element */
- int end_pos;
-
- end_pos = reader->u.array.start_pos + array_reader_get_array_len (reader);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" reader %p array next START start_pos = %d end_pos = %d value_pos = %d current_type = %s\n",
- reader,
- reader->u.array.start_pos,
- end_pos, reader->value_pos,
- _dbus_type_to_string (current_type));
-#endif
-
- _dbus_assert (reader->value_pos < end_pos);
- _dbus_assert (reader->value_pos >= reader->u.array.start_pos);
-
- switch (_dbus_first_type_in_signature (reader->type_str,
- reader->type_pos))
- {
- case DBUS_TYPE_DICT_ENTRY:
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_VARIANT:
- {
- DBusTypeReader sub;
-
- /* Recurse into the struct or variant */
- _dbus_type_reader_recurse (reader, &sub);
-
- /* Skip everything in this element */
- while (_dbus_type_reader_next (&sub))
- {
- /* nothing */;
- }
-
- /* Now we are at the end of this element */
- reader->value_pos = sub.value_pos;
- }
- break;
-
- case DBUS_TYPE_ARRAY:
- {
- _dbus_marshal_skip_array (reader->value_str,
- _dbus_first_type_in_signature (reader->type_str,
- reader->type_pos + 1),
- reader->byte_order,
- &reader->value_pos);
- }
- break;
-
- default:
- {
- _dbus_marshal_skip_basic (reader->value_str,
- current_type, reader->byte_order,
- &reader->value_pos);
- }
- break;
- }
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" reader %p array next END start_pos = %d end_pos = %d value_pos = %d current_type = %s\n",
- reader,
- reader->u.array.start_pos,
- end_pos, reader->value_pos,
- _dbus_type_to_string (current_type));
-#endif
-
- _dbus_assert (reader->value_pos <= end_pos);
-
- if (reader->value_pos == end_pos)
- {
- skip_one_complete_type (reader->type_str,
- &reader->type_pos);
- }
-}
-
-static const DBusTypeReaderClass body_reader_class = {
- "body", 0,
- FALSE,
- NULL, /* body is always toplevel, so doesn't get recursed into */
- NULL,
- base_reader_next
-};
-
-static const DBusTypeReaderClass body_types_only_reader_class = {
- "body types", 1,
- TRUE,
- NULL, /* body is always toplevel, so doesn't get recursed into */
- NULL,
- base_reader_next
-};
-
-static const DBusTypeReaderClass struct_reader_class = {
- "struct", 2,
- FALSE,
- struct_or_dict_entry_reader_recurse,
- NULL,
- struct_reader_next
-};
-
-static const DBusTypeReaderClass struct_types_only_reader_class = {
- "struct types", 3,
- TRUE,
- struct_or_dict_entry_types_only_reader_recurse,
- NULL,
- struct_reader_next
-};
-
-static const DBusTypeReaderClass dict_entry_reader_class = {
- "dict_entry", 4,
- FALSE,
- struct_or_dict_entry_reader_recurse,
- NULL,
- dict_entry_reader_next
-};
-
-static const DBusTypeReaderClass dict_entry_types_only_reader_class = {
- "dict_entry types", 5,
- TRUE,
- struct_or_dict_entry_types_only_reader_recurse,
- NULL,
- dict_entry_reader_next
-};
-
-static const DBusTypeReaderClass array_reader_class = {
- "array", 6,
- FALSE,
- array_reader_recurse,
- array_reader_check_finished,
- array_reader_next
-};
-
-static const DBusTypeReaderClass array_types_only_reader_class = {
- "array types", 7,
- TRUE,
- array_types_only_reader_recurse,
- NULL,
- array_types_only_reader_next
-};
-
-static const DBusTypeReaderClass variant_reader_class = {
- "variant", 8,
- FALSE,
- variant_reader_recurse,
- NULL,
- base_reader_next
-};
-
-#ifndef DBUS_DISABLE_ASSERT
-static const DBusTypeReaderClass * const
-all_reader_classes[] = {
- &body_reader_class,
- &body_types_only_reader_class,
- &struct_reader_class,
- &struct_types_only_reader_class,
- &dict_entry_reader_class,
- &dict_entry_types_only_reader_class,
- &array_reader_class,
- &array_types_only_reader_class,
- &variant_reader_class
-};
-#endif
-
-/**
- * Initializes a type reader.
- *
- * @param reader the reader
- * @param byte_order the byte order of the block to read
- * @param type_str the signature of the block to read
- * @param type_pos location of signature
- * @param value_str the string containing values block
- * @param value_pos start of values block
- */
-void
-_dbus_type_reader_init (DBusTypeReader *reader,
- int byte_order,
- const DBusString *type_str,
- int type_pos,
- const DBusString *value_str,
- int value_pos)
-{
- reader->klass = &body_reader_class;
-
- reader_init (reader, byte_order, type_str, type_pos,
- value_str, value_pos);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p init type_pos = %d value_pos = %d remaining sig '%s'\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0));
-#endif
-}
-
-/**
- * Like _dbus_type_reader_init() but the iteration is over the
- * signature, not over values.
- *
- * @param reader the reader
- * @param type_str the signature string
- * @param type_pos location in the signature string
- */
-void
-_dbus_type_reader_init_types_only (DBusTypeReader *reader,
- const DBusString *type_str,
- int type_pos)
-{
- reader->klass = &body_types_only_reader_class;
-
- reader_init (reader, DBUS_COMPILER_BYTE_ORDER /* irrelevant */,
- type_str, type_pos, NULL, _DBUS_INT_MAX /* crashes if we screw up */);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p init types only type_pos = %d remaining sig '%s'\n",
- reader, reader->type_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0));
-#endif
-}
-
-/**
- * Gets the type of the value the reader is currently pointing to;
- * or for a types-only reader gets the type it's currently pointing to.
- * If the reader is at the end of a block or end of a container such
- * as an array, returns #DBUS_TYPE_INVALID.
- *
- * @param reader the reader
- */
-int
-_dbus_type_reader_get_current_type (const DBusTypeReader *reader)
-{
- int t;
-
- if (reader->finished ||
- (reader->klass->check_finished &&
- (* reader->klass->check_finished) (reader)))
- t = DBUS_TYPE_INVALID;
- else
- t = _dbus_first_type_in_signature (reader->type_str,
- reader->type_pos);
-
- _dbus_assert (t != DBUS_STRUCT_END_CHAR);
- _dbus_assert (t != DBUS_STRUCT_BEGIN_CHAR);
- _dbus_assert (t != DBUS_DICT_ENTRY_END_CHAR);
- _dbus_assert (t != DBUS_DICT_ENTRY_BEGIN_CHAR);
-
-#if 0
- _dbus_verbose (" type reader %p current type_pos = %d type = %s\n",
- reader, reader->type_pos,
- _dbus_type_to_string (t));
-#endif
-
- return t;
-}
-
-/**
- * Gets the type of an element of the array the reader is currently
- * pointing to. It's an error to call this if
- * _dbus_type_reader_get_current_type() doesn't return #DBUS_TYPE_ARRAY
- * for this reader.
- *
- * @param reader the reader
- */
-int
-_dbus_type_reader_get_element_type (const DBusTypeReader *reader)
-{
- int element_type;
-
- _dbus_assert (_dbus_type_reader_get_current_type (reader) == DBUS_TYPE_ARRAY);
-
- element_type = _dbus_first_type_in_signature (reader->type_str,
- reader->type_pos + 1);
-
- return element_type;
-}
-
-/**
- * Gets the current position in the value block
- * @param reader the reader
- */
-int
-_dbus_type_reader_get_value_pos (const DBusTypeReader *reader)
-{
- return reader->value_pos;
-}
-
-/**
- * Get the address of the marshaled value in the data being read. The
- * address may not be aligned; you have to align it to the type of the
- * value you want to read. Most of the demarshal routines do this for
- * you.
- *
- * @param reader the reader
- * @param value_location the address of the marshaled value
- */
-void
-_dbus_type_reader_read_raw (const DBusTypeReader *reader,
- const unsigned char **value_location)
-{
- _dbus_assert (!reader->klass->types_only);
-
- *value_location = _dbus_string_get_const_data_len (reader->value_str,
- reader->value_pos,
- 0);
-}
-
-/**
- * Reads a basic-typed value, as with _dbus_marshal_read_basic().
- *
- * @param reader the reader
- * @param value the address of the value
- */
-void
-_dbus_type_reader_read_basic (const DBusTypeReader *reader,
- void *value)
-{
- int t;
-
- _dbus_assert (!reader->klass->types_only);
-
- t = _dbus_type_reader_get_current_type (reader);
-
- _dbus_marshal_read_basic (reader->value_str,
- reader->value_pos,
- t, value,
- reader->byte_order,
- NULL);
-
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p read basic type_pos = %d value_pos = %d remaining sig '%s'\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0));
-#endif
-}
-
-/**
- * Returns the number of bytes in the array.
- *
- * @param reader the reader to read from
- * @returns the number of bytes in the array
- */
-int
-_dbus_type_reader_get_array_length (const DBusTypeReader *reader)
-{
- _dbus_assert (!reader->klass->types_only);
- _dbus_assert (reader->klass == &array_reader_class);
-
- return array_reader_get_array_len (reader);
-}
-
-/**
- * Reads a block of fixed-length basic values, from the current point
- * in an array to the end of the array. Does not work for arrays of
- * string or container types.
- *
- * This function returns the array in-place; it does not make a copy,
- * and it does not swap the bytes.
- *
- * If you ask for #DBUS_TYPE_DOUBLE you will get a "const double*" back
- * and the "value" argument should be a "const double**" and so on.
- *
- * @param reader the reader to read from
- * @param value place to return the array values
- * @param n_elements place to return number of array elements
- */
-void
-_dbus_type_reader_read_fixed_multi (const DBusTypeReader *reader,
- void *value,
- int *n_elements)
-{
- int element_type;
- int end_pos;
- int remaining_len;
- int alignment;
- int total_len;
-
- _dbus_assert (!reader->klass->types_only);
- _dbus_assert (reader->klass == &array_reader_class);
-
- element_type = _dbus_first_type_in_signature (reader->type_str,
- reader->type_pos);
-
- _dbus_assert (element_type != DBUS_TYPE_INVALID); /* why we don't use get_current_type() */
- _dbus_assert (dbus_type_is_fixed (element_type));
-
- alignment = _dbus_type_get_alignment (element_type);
-
- _dbus_assert (reader->value_pos >= reader->u.array.start_pos);
-
- total_len = array_reader_get_array_len (reader);
- end_pos = reader->u.array.start_pos + total_len;
- remaining_len = end_pos - reader->value_pos;
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose ("end_pos %d total_len %d remaining_len %d value_pos %d\n",
- end_pos, total_len, remaining_len, reader->value_pos);
-#endif
-
- _dbus_assert (remaining_len <= total_len);
-
- if (remaining_len == 0)
- *(const DBusBasicValue**) value = NULL;
- else
- *(const DBusBasicValue**) value =
- (void*) _dbus_string_get_const_data_len (reader->value_str,
- reader->value_pos,
- remaining_len);
-
- *n_elements = remaining_len / alignment;
- _dbus_assert ((remaining_len % alignment) == 0);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p read fixed array type_pos = %d value_pos = %d remaining sig '%s'\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0));
-#endif
-}
-
-/**
- * Initialize a new reader pointing to the first type and
- * corresponding value that's a child of the current container. It's
- * an error to call this if the current type is a non-container.
- *
- * Note that DBusTypeReader traverses values, not types. So if you
- * have an empty array of array of int, you can't recurse into it. You
- * can only recurse into each element.
- *
- * @param reader the reader
- * @param sub a reader to init pointing to the first child
- */
-void
-_dbus_type_reader_recurse (DBusTypeReader *reader,
- DBusTypeReader *sub)
-{
- int t;
-
- t = _dbus_first_type_in_signature (reader->type_str, reader->type_pos);
-
- switch (t)
- {
- case DBUS_TYPE_STRUCT:
- if (reader->klass->types_only)
- sub->klass = &struct_types_only_reader_class;
- else
- sub->klass = &struct_reader_class;
- break;
- case DBUS_TYPE_DICT_ENTRY:
- if (reader->klass->types_only)
- sub->klass = &dict_entry_types_only_reader_class;
- else
- sub->klass = &dict_entry_reader_class;
- break;
- case DBUS_TYPE_ARRAY:
- if (reader->klass->types_only)
- sub->klass = &array_types_only_reader_class;
- else
- sub->klass = &array_reader_class;
- break;
- case DBUS_TYPE_VARIANT:
- if (reader->klass->types_only)
- _dbus_assert_not_reached ("can't recurse into variant typecode");
- else
- sub->klass = &variant_reader_class;
- break;
- default:
- _dbus_verbose ("recursing into type %s\n", _dbus_type_to_string (t));
-#ifndef DBUS_DISABLE_CHECKS
- if (t == DBUS_TYPE_INVALID)
- _dbus_warn_check_failed ("You can't recurse into an empty array or off the end of a message body\n");
-#endif /* DBUS_DISABLE_CHECKS */
-
- _dbus_assert_not_reached ("don't yet handle recursing into this type");
- }
-
- _dbus_assert (sub->klass == all_reader_classes[sub->klass->id]);
-
- (* sub->klass->recurse) (sub, reader);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p RECURSED type_pos = %d value_pos = %d remaining sig '%s'\n",
- sub, sub->type_pos, sub->value_pos,
- _dbus_string_get_const_data_len (sub->type_str, sub->type_pos, 0));
-#endif
-}
-
-/**
- * Skip to the next value on this "level". e.g. the next field in a
- * struct, the next value in an array. Returns FALSE at the end of the
- * current container.
- *
- * @param reader the reader
- * @returns FALSE if nothing more to read at or below this level
- */
-dbus_bool_t
-_dbus_type_reader_next (DBusTypeReader *reader)
-{
- int t;
-
- t = _dbus_type_reader_get_current_type (reader);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p START next() { type_pos = %d value_pos = %d remaining sig '%s' current_type = %s\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0),
- _dbus_type_to_string (t));
-#endif
-
- if (t == DBUS_TYPE_INVALID)
- return FALSE;
-
- (* reader->klass->next) (reader, t);
-
-#if RECURSIVE_MARSHAL_READ_TRACE
- _dbus_verbose (" type reader %p END next() type_pos = %d value_pos = %d remaining sig '%s' current_type = %s\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0),
- _dbus_type_to_string (_dbus_type_reader_get_current_type (reader)));
-#endif
-
- return _dbus_type_reader_get_current_type (reader) != DBUS_TYPE_INVALID;
-}
-
-/**
- * Check whether there's another value on this "level". e.g. the next
- * field in a struct, the next value in an array. Returns FALSE at the
- * end of the current container.
- *
- * You probably don't want to use this; it makes for an awkward for/while
- * loop. A nicer one is "while ((current_type = get_current_type()) != INVALID)"
- *
- * @param reader the reader
- * @returns FALSE if nothing more to read at or below this level
- */
-dbus_bool_t
-_dbus_type_reader_has_next (const DBusTypeReader *reader)
-{
- /* Not efficient but works for now. */
- DBusTypeReader copy;
-
- copy = *reader;
- return _dbus_type_reader_next (&copy);
-}
-
-/**
- * Gets the string and range of said string containing the signature
- * of the current value. Essentially a more complete version of
- * _dbus_type_reader_get_current_type() (returns the full type
- * rather than only the outside of the onion).
- *
- * Note though that the first byte in a struct signature is
- * #DBUS_STRUCT_BEGIN_CHAR while the current type will be
- * #DBUS_TYPE_STRUCT so it isn't true that the first byte of the
- * signature is always the same as the current type. Another
- * difference is that this function will still return a signature when
- * inside an empty array; say you recurse into empty array of int32,
- * the signature is "i" but the current type will always be
- * #DBUS_TYPE_INVALID since there are no elements to be currently
- * pointing to.
- *
- * @param reader the reader
- * @param str_p place to return the string with the type in it
- * @param start_p place to return start of the type
- * @param len_p place to return the length of the type
- */
-void
-_dbus_type_reader_get_signature (const DBusTypeReader *reader,
- const DBusString **str_p,
- int *start_p,
- int *len_p)
-{
- *str_p = reader->type_str;
- *start_p = reader->type_pos;
- *len_p = find_len_of_complete_type (reader->type_str, reader->type_pos);
-}
-
-typedef struct
-{
- DBusString replacement; /**< Marshaled value including alignment padding */
- int padding; /**< How much of the replacement block is padding */
-} ReplacementBlock;
-
-static dbus_bool_t
-replacement_block_init (ReplacementBlock *block,
- DBusTypeReader *reader)
-{
- if (!_dbus_string_init (&block->replacement))
- return FALSE;
-
- /* % 8 is the padding to have the same align properties in
- * our replacement string as we do at the position being replaced
- */
- block->padding = reader->value_pos % 8;
-
- if (!_dbus_string_lengthen (&block->replacement, block->padding))
- goto oom;
-
- return TRUE;
-
- oom:
- _dbus_string_free (&block->replacement);
- return FALSE;
-}
-
-static dbus_bool_t
-replacement_block_replace (ReplacementBlock *block,
- DBusTypeReader *reader,
- const DBusTypeReader *realign_root)
-{
- DBusTypeWriter writer;
- DBusTypeReader realign_reader;
- DBusList *fixups;
- int orig_len;
-
- _dbus_assert (realign_root != NULL);
-
- orig_len = _dbus_string_get_length (&block->replacement);
-
- realign_reader = *realign_root;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("INITIALIZING replacement block writer %p at value_pos %d\n",
- &writer, _dbus_string_get_length (&block->replacement));
-#endif
- _dbus_type_writer_init_values_only (&writer,
- realign_reader.byte_order,
- realign_reader.type_str,
- realign_reader.type_pos,
- &block->replacement,
- _dbus_string_get_length (&block->replacement));
-
- _dbus_assert (realign_reader.value_pos <= reader->value_pos);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("COPYING from reader at value_pos %d to writer %p starting after value_pos %d\n",
- realign_reader.value_pos, &writer, reader->value_pos);
-#endif
- fixups = NULL;
- if (!_dbus_type_writer_write_reader_partial (&writer,
- &realign_reader,
- reader,
- block->padding,
- _dbus_string_get_length (&block->replacement) - block->padding,
- &fixups))
- goto oom;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("REPLACEMENT at padding %d len %d\n", block->padding,
- _dbus_string_get_length (&block->replacement) - block->padding);
- _dbus_verbose_bytes_of_string (&block->replacement, block->padding,
- _dbus_string_get_length (&block->replacement) - block->padding);
- _dbus_verbose ("TO BE REPLACED at value_pos = %d (align pad %d) len %d realign_reader.value_pos %d\n",
- reader->value_pos, reader->value_pos % 8,
- realign_reader.value_pos - reader->value_pos,
- realign_reader.value_pos);
- _dbus_verbose_bytes_of_string (reader->value_str,
- reader->value_pos,
- realign_reader.value_pos - reader->value_pos);
-#endif
-
- /* Move the replacement into position
- * (realign_reader should now be at the end of the block to be replaced)
- */
- if (!_dbus_string_replace_len (&block->replacement, block->padding,
- _dbus_string_get_length (&block->replacement) - block->padding,
- (DBusString*) reader->value_str,
- reader->value_pos,
- realign_reader.value_pos - reader->value_pos))
- goto oom;
-
- /* Process our fixups now that we can't have an OOM error */
- apply_and_free_fixups (&fixups, reader);
-
- return TRUE;
-
- oom:
- _dbus_string_set_length (&block->replacement, orig_len);
- free_fixups (&fixups);
- return FALSE;
-}
-
-static void
-replacement_block_free (ReplacementBlock *block)
-{
- _dbus_string_free (&block->replacement);
-}
-
-/* In the variable-length case, we have to fix alignment after we insert.
- * The strategy is as follows:
- *
- * - pad a new string to have the same alignment as the
- * start of the current basic value
- * - write the new basic value
- * - copy from the original reader to the new string,
- * which will fix the alignment of types following
- * the new value
- * - this copy has to start at realign_root,
- * but not really write anything until it
- * passes the value being set
- * - as an optimization, we can stop copying
- * when the source and dest values are both
- * on an 8-boundary, since we know all following
- * padding and alignment will be identical
- * - copy the new string back to the original
- * string, replacing the relevant part of the
- * original string
- * - now any arrays in the original string that
- * contained the replaced string may have the
- * wrong length; so we have to fix that
- */
-static dbus_bool_t
-reader_set_basic_variable_length (DBusTypeReader *reader,
- int current_type,
- const void *value,
- const DBusTypeReader *realign_root)
-{
- dbus_bool_t retval;
- ReplacementBlock block;
- DBusTypeWriter writer;
-
- _dbus_assert (realign_root != NULL);
-
- retval = FALSE;
-
- if (!replacement_block_init (&block, reader))
- return FALSE;
-
- /* Write the new basic value */
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("INITIALIZING writer %p to write basic value at value_pos %d of replacement string\n",
- &writer, _dbus_string_get_length (&block.replacement));
-#endif
- _dbus_type_writer_init_values_only (&writer,
- reader->byte_order,
- reader->type_str,
- reader->type_pos,
- &block.replacement,
- _dbus_string_get_length (&block.replacement));
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("WRITING basic value to writer %p (replacement string)\n", &writer);
-#endif
- if (!_dbus_type_writer_write_basic (&writer, current_type, value))
- goto out;
-
- if (!replacement_block_replace (&block,
- reader,
- realign_root))
- goto out;
-
- retval = TRUE;
-
- out:
- replacement_block_free (&block);
- return retval;
-}
-
-static void
-reader_set_basic_fixed_length (DBusTypeReader *reader,
- int current_type,
- const void *value)
-{
- _dbus_marshal_set_basic ((DBusString*) reader->value_str,
- reader->value_pos,
- current_type,
- value,
- reader->byte_order,
- NULL, NULL);
-}
-
-/**
- * Sets a new value for the basic type value pointed to by the reader,
- * leaving the reader valid to continue reading. Any other readers
- * will be invalidated if you set a variable-length type such as a
- * string.
- *
- * The provided realign_root is the reader to start from when
- * realigning the data that follows the newly-set value. The reader
- * parameter must point to a value below the realign_root parameter.
- * If the type being set is fixed-length, then realign_root may be
- * #NULL. Only values reachable from realign_root will be realigned,
- * so if your string contains other values you will need to deal with
- * those somehow yourself. It is OK if realign_root is the same
- * reader as the reader parameter, though if you aren't setting the
- * root it may not be such a good idea.
- *
- * @todo DBusTypeReader currently takes "const" versions of the type
- * and value strings, and this function modifies those strings by
- * casting away the const, which is of course bad if we want to get
- * picky. (To be truly clean you'd have an object which contained the
- * type and value strings and set_basic would be a method on that
- * object... this would also make DBusTypeReader the same thing as
- * DBusTypeMark. But since DBusMessage is effectively that object for
- * D-Bus it doesn't seem worth creating some random object.)
- *
- * @todo optimize this by only rewriting until the old and new values
- * are at the same alignment. Frequently this should result in only
- * replacing the value that's immediately at hand.
- *
- * @param reader reader indicating where to set a new value
- * @param value address of the value to set
- * @param realign_root realign from here
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_type_reader_set_basic (DBusTypeReader *reader,
- const void *value,
- const DBusTypeReader *realign_root)
-{
- int current_type;
-
- _dbus_assert (!reader->klass->types_only);
- _dbus_assert (reader->value_str == realign_root->value_str);
- _dbus_assert (reader->value_pos >= realign_root->value_pos);
-
- current_type = _dbus_type_reader_get_current_type (reader);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" SET BASIC type reader %p type_pos = %d value_pos = %d remaining sig '%s' realign_root = %p with value_pos %d current_type = %s\n",
- reader, reader->type_pos, reader->value_pos,
- _dbus_string_get_const_data_len (reader->type_str, reader->type_pos, 0),
- realign_root,
- realign_root ? realign_root->value_pos : -1,
- _dbus_type_to_string (current_type));
- _dbus_verbose_bytes_of_string (realign_root->value_str, realign_root->value_pos,
- _dbus_string_get_length (realign_root->value_str) -
- realign_root->value_pos);
-#endif
-
- _dbus_assert (dbus_type_is_basic (current_type));
-
- if (dbus_type_is_fixed (current_type))
- {
- reader_set_basic_fixed_length (reader, current_type, value);
- return TRUE;
- }
- else
- {
- _dbus_assert (realign_root != NULL);
- return reader_set_basic_variable_length (reader, current_type,
- value, realign_root);
- }
-}
-
-/**
- * Recursively deletes any value pointed to by the reader, leaving the
- * reader valid to continue reading. Any other readers will be
- * invalidated.
- *
- * The provided realign_root is the reader to start from when
- * realigning the data that follows the newly-set value.
- * See _dbus_type_reader_set_basic() for more details on the
- * realign_root paramter.
- *
- * @todo for now this does not delete the typecodes associated with
- * the value, so this function should only be used for array elements.
- *
- * @param reader reader indicating where to delete a value
- * @param realign_root realign from here
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_type_reader_delete (DBusTypeReader *reader,
- const DBusTypeReader *realign_root)
-{
- dbus_bool_t retval;
- ReplacementBlock block;
-
- _dbus_assert (realign_root != NULL);
- _dbus_assert (reader->klass == &array_reader_class);
-
- retval = FALSE;
-
- if (!replacement_block_init (&block, reader))
- return FALSE;
-
- if (!replacement_block_replace (&block,
- reader,
- realign_root))
- goto out;
-
- retval = TRUE;
-
- out:
- replacement_block_free (&block);
- return retval;
-}
-
-/*
- * Compares two readers, which must be iterating over the same value data.
- * Returns #TRUE if the first parameter is further along than the second parameter.
- *
- * @param lhs left-hand-side (first) parameter
- * @param rhs left-hand-side (first) parameter
- * @returns whether lhs is greater than rhs
- */
-static dbus_bool_t
-_dbus_type_reader_greater_than (const DBusTypeReader *lhs,
- const DBusTypeReader *rhs)
-{
- _dbus_assert (lhs->value_str == rhs->value_str);
-
- return lhs->value_pos > rhs->value_pos;
-}
-
-/*
- *
- *
- * DBusTypeWriter
- *
- *
- *
- */
-
-/**
- * Initialize a write iterator, which is used to write out values in
- * serialized D-Bus format.
- *
- * The type_pos passed in is expected to be inside an already-valid,
- * though potentially empty, type signature. This means that the byte
- * after type_pos must be either #DBUS_TYPE_INVALID (aka nul) or some
- * other valid type. #DBusTypeWriter won't enforce that the signature
- * is already valid (you can append the nul byte at the end if you
- * like), but just be aware that you need the nul byte eventually and
- * #DBusTypeWriter isn't going to write it for you.
- *
- * @param writer the writer to init
- * @param byte_order the byte order to marshal into
- * @param type_str the string to write typecodes into
- * @param type_pos where to insert typecodes
- * @param value_str the string to write values into
- * @param value_pos where to insert values
- *
- */
-void
-_dbus_type_writer_init (DBusTypeWriter *writer,
- int byte_order,
- DBusString *type_str,
- int type_pos,
- DBusString *value_str,
- int value_pos)
-{
- writer->byte_order = byte_order;
- writer->type_str = type_str;
- writer->type_pos = type_pos;
- writer->value_str = value_str;
- writer->value_pos = value_pos;
- writer->container_type = DBUS_TYPE_INVALID;
- writer->type_pos_is_expectation = FALSE;
- writer->enabled = TRUE;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("writer %p init remaining sig '%s'\n", writer,
- writer->type_str ?
- _dbus_string_get_const_data_len (writer->type_str, writer->type_pos, 0) :
- "unknown");
-#endif
-}
-
-/**
- * Initialize a write iterator, with the signature to be provided
- * later.
- *
- * @param writer the writer to init
- * @param byte_order the byte order to marshal into
- * @param value_str the string to write values into
- * @param value_pos where to insert values
- *
- */
-void
-_dbus_type_writer_init_types_delayed (DBusTypeWriter *writer,
- int byte_order,
- DBusString *value_str,
- int value_pos)
-{
- _dbus_type_writer_init (writer, byte_order,
- NULL, 0, value_str, value_pos);
-}
-
-/**
- * Adds type string to the writer, if it had none.
- *
- * @param writer the writer to init
- * @param type_str type string to add
- * @param type_pos type position
- *
- */
-void
-_dbus_type_writer_add_types (DBusTypeWriter *writer,
- DBusString *type_str,
- int type_pos)
-{
- if (writer->type_str == NULL) /* keeps us from using this as setter */
- {
- writer->type_str = type_str;
- writer->type_pos = type_pos;
- }
-}
-
-/**
- * Removes type string from the writer.
- *
- * @param writer the writer to remove from
- */
-void
-_dbus_type_writer_remove_types (DBusTypeWriter *writer)
-{
- writer->type_str = NULL;
- writer->type_pos = -1;
-}
-
-/**
- * Like _dbus_type_writer_init(), except the type string
- * passed in should correspond to an existing signature that
- * matches what you're going to write out. The writer will
- * check what you write vs. this existing signature.
- *
- * @param writer the writer to init
- * @param byte_order the byte order to marshal into
- * @param type_str the string with signature
- * @param type_pos start of signature
- * @param value_str the string to write values into
- * @param value_pos where to insert values
- *
- */
-void
-_dbus_type_writer_init_values_only (DBusTypeWriter *writer,
- int byte_order,
- const DBusString *type_str,
- int type_pos,
- DBusString *value_str,
- int value_pos)
-{
- _dbus_type_writer_init (writer, byte_order,
- (DBusString*)type_str, type_pos,
- value_str, value_pos);
-
- writer->type_pos_is_expectation = TRUE;
-}
-
-static dbus_bool_t
-_dbus_type_writer_write_basic_no_typecode (DBusTypeWriter *writer,
- int type,
- const void *value)
-{
- if (writer->enabled)
- return _dbus_marshal_write_basic (writer->value_str,
- writer->value_pos,
- type,
- value,
- writer->byte_order,
- &writer->value_pos);
- else
- return TRUE;
-}
-
-/* If our parent is an array, things are a little bit complicated.
- *
- * The parent must have a complete element type, such as
- * "i" or "aai" or "(ii)" or "a(ii)". There can't be
- * unclosed parens, or an "a" with no following type.
- *
- * To recurse, the only allowed operation is to recurse into the
- * first type in the element type. So for "i" you can't recurse, for
- * "ai" you can recurse into the array, for "(ii)" you can recurse
- * into the struct.
- *
- * If you recurse into the array for "ai", then you must specify
- * "i" for the element type of the array you recurse into.
- *
- * While inside an array at any level, we need to avoid writing to
- * type_str, since the type only appears once for the whole array,
- * it does not appear for each array element.
- *
- * While inside an array type_pos points to the expected next
- * typecode, rather than the next place we could write a typecode.
- */
-static void
-writer_recurse_init_and_check (DBusTypeWriter *writer,
- int container_type,
- DBusTypeWriter *sub)
-{
- _dbus_type_writer_init (sub,
- writer->byte_order,
- writer->type_str,
- writer->type_pos,
- writer->value_str,
- writer->value_pos);
-
- sub->container_type = container_type;
-
- if (writer->type_pos_is_expectation ||
- (sub->container_type == DBUS_TYPE_ARRAY || sub->container_type == DBUS_TYPE_VARIANT))
- sub->type_pos_is_expectation = TRUE;
- else
- sub->type_pos_is_expectation = FALSE;
-
- sub->enabled = writer->enabled;
-
-#ifndef DBUS_DISABLE_CHECKS
- if (writer->type_pos_is_expectation && writer->type_str)
- {
- int expected;
-
- expected = _dbus_first_type_in_signature (writer->type_str, writer->type_pos);
-
- if (expected != sub->container_type)
- {
- if (expected != DBUS_TYPE_INVALID)
- _dbus_warn_check_failed ("Writing an element of type %s, but the expected type here is %s\n"
- "The overall signature expected here was '%s' and we are on byte %d of that signature.\n",
- _dbus_type_to_string (sub->container_type),
- _dbus_type_to_string (expected),
- _dbus_string_get_const_data (writer->type_str), writer->type_pos);
- else
- _dbus_warn_check_failed ("Writing an element of type %s, but no value is expected here\n"
- "The overall signature expected here was '%s' and we are on byte %d of that signature.\n",
- _dbus_type_to_string (sub->container_type),
- _dbus_string_get_const_data (writer->type_str), writer->type_pos);
-
- _dbus_assert_not_reached ("bad array element or variant content written");
- }
- }
-#endif /* DBUS_DISABLE_CHECKS */
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p recurse parent %s type_pos = %d value_pos = %d is_expectation = %d remaining sig '%s' enabled = %d\n",
- writer,
- _dbus_type_to_string (writer->container_type),
- writer->type_pos, writer->value_pos, writer->type_pos_is_expectation,
- writer->type_str ?
- _dbus_string_get_const_data_len (writer->type_str, writer->type_pos, 0) :
- "unknown",
- writer->enabled);
- _dbus_verbose (" type writer %p recurse sub %s type_pos = %d value_pos = %d is_expectation = %d enabled = %d\n",
- sub,
- _dbus_type_to_string (sub->container_type),
- sub->type_pos, sub->value_pos,
- sub->type_pos_is_expectation,
- sub->enabled);
-#endif
-}
-
-static dbus_bool_t
-write_or_verify_typecode (DBusTypeWriter *writer,
- int typecode)
-{
- /* A subwriter inside an array or variant will have type_pos
- * pointing to the expected typecode; a writer not inside an array
- * or variant has type_pos pointing to the next place to insert a
- * typecode.
- */
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p write_or_verify start type_pos = %d remaining sig '%s' enabled = %d\n",
- writer, writer->type_pos,
- writer->type_str ?
- _dbus_string_get_const_data_len (writer->type_str, writer->type_pos, 0) :
- "unknown",
- writer->enabled);
-#endif
-
- if (writer->type_str == NULL)
- return TRUE;
-
- if (writer->type_pos_is_expectation)
- {
-#ifndef DBUS_DISABLE_CHECKS
- {
- int expected;
-
- expected = _dbus_string_get_byte (writer->type_str, writer->type_pos);
-
- if (expected != typecode)
- {
- if (expected != DBUS_TYPE_INVALID)
- _dbus_warn_check_failed ("Array or variant type requires that type %s be written, but %s was written.\n"
- "The overall signature expected here was '%s' and we are on byte %d of that signature.\n",
- _dbus_type_to_string (expected), _dbus_type_to_string (typecode),
- _dbus_string_get_const_data (writer->type_str), writer->type_pos);
- else
- _dbus_warn_check_failed ("Array or variant type wasn't expecting any more values to be written into it, but a value %s was written.\n"
- "The overall signature expected here was '%s' and we are on byte %d of that signature.\n",
- _dbus_type_to_string (typecode),
- _dbus_string_get_const_data (writer->type_str), writer->type_pos);
- _dbus_assert_not_reached ("bad type inserted somewhere inside an array or variant");
- }
- }
-#endif /* DBUS_DISABLE_CHECKS */
-
- /* if immediately inside an array we'd always be appending an element,
- * so the expected type doesn't change; if inside a struct or something
- * below an array, we need to move through said struct or something.
- */
- if (writer->container_type != DBUS_TYPE_ARRAY)
- writer->type_pos += 1;
- }
- else
- {
- if (!_dbus_string_insert_byte (writer->type_str,
- writer->type_pos,
- typecode))
- return FALSE;
-
- writer->type_pos += 1;
- }
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p write_or_verify end type_pos = %d remaining sig '%s'\n",
- writer, writer->type_pos,
- _dbus_string_get_const_data_len (writer->type_str, writer->type_pos, 0));
-#endif
-
- return TRUE;
-}
-
-static dbus_bool_t
-writer_recurse_struct_or_dict_entry (DBusTypeWriter *writer,
- int begin_char,
- const DBusString *contained_type,
- int contained_type_start,
- int contained_type_len,
- DBusTypeWriter *sub)
-{
- /* FIXME right now contained_type is ignored; we could probably
- * almost trivially fix the code so if it's present we
- * write it out and then set type_pos_is_expectation
- */
-
- /* Ensure that we'll be able to add alignment padding and the typecode */
- if (writer->enabled)
- {
- if (!_dbus_string_alloc_space (sub->value_str, 8))
- return FALSE;
- }
-
- if (!write_or_verify_typecode (sub, begin_char))
- _dbus_assert_not_reached ("failed to insert struct typecode after prealloc");
-
- if (writer->enabled)
- {
- if (!_dbus_string_insert_bytes (sub->value_str,
- sub->value_pos,
- _DBUS_ALIGN_VALUE (sub->value_pos, 8) - sub->value_pos,
- '\0'))
- _dbus_assert_not_reached ("should not have failed to insert alignment padding for struct");
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, 8);
- }
-
- return TRUE;
-}
-
-
-static dbus_bool_t
-writer_recurse_array (DBusTypeWriter *writer,
- const DBusString *contained_type,
- int contained_type_start,
- int contained_type_len,
- DBusTypeWriter *sub,
- dbus_bool_t is_array_append)
-{
- dbus_uint32_t value = 0;
- int alignment;
- int aligned;
-
-#ifndef DBUS_DISABLE_CHECKS
- if (writer->container_type == DBUS_TYPE_ARRAY &&
- writer->type_str)
- {
- if (!_dbus_string_equal_substring (contained_type,
- contained_type_start,
- contained_type_len,
- writer->type_str,
- writer->u.array.element_type_pos + 1))
- {
- _dbus_warn_check_failed ("Writing an array of '%s' but this is incompatible with the expected type of elements in the parent array\n",
- _dbus_string_get_const_data_len (contained_type,
- contained_type_start,
- contained_type_len));
- _dbus_assert_not_reached ("incompatible type for child array");
- }
- }
-#endif /* DBUS_DISABLE_CHECKS */
-
- if (writer->enabled && !is_array_append)
- {
- /* 3 pad + 4 bytes for the array length, and 4 bytes possible padding
- * before array values
- */
- if (!_dbus_string_alloc_space (sub->value_str, 3 + 4 + 4))
- return FALSE;
- }
-
- if (writer->type_str != NULL)
- {
- sub->type_pos += 1; /* move to point to the element type, since type_pos
- * should be the expected type for further writes
- */
- sub->u.array.element_type_pos = sub->type_pos;
- }
-
- if (!writer->type_pos_is_expectation)
- {
- /* sub is a toplevel/outermost array so we need to write the type data */
-
- /* alloc space for array typecode, element signature */
- if (!_dbus_string_alloc_space (writer->type_str, 1 + contained_type_len))
- return FALSE;
-
- if (!_dbus_string_insert_byte (writer->type_str,
- writer->type_pos,
- DBUS_TYPE_ARRAY))
- _dbus_assert_not_reached ("failed to insert array typecode after prealloc");
-
- if (!_dbus_string_copy_len (contained_type,
- contained_type_start, contained_type_len,
- sub->type_str,
- sub->u.array.element_type_pos))
- _dbus_assert_not_reached ("should not have failed to insert array element typecodes");
- }
-
- if (writer->type_str != NULL)
- {
- /* If the parent is an array, we hold type_pos pointing at the array element type;
- * otherwise advance it to reflect the array value we just recursed into
- */
- if (writer->container_type != DBUS_TYPE_ARRAY)
- writer->type_pos += 1 + contained_type_len;
- else
- _dbus_assert (writer->type_pos_is_expectation); /* because it's an array */
- }
-
- if (writer->enabled)
- {
- /* Write (or jump over, if is_array_append) the length */
- sub->u.array.len_pos = _DBUS_ALIGN_VALUE (sub->value_pos, 4);
-
- if (is_array_append)
- {
- sub->value_pos += 4;
- }
- else
- {
- if (!_dbus_type_writer_write_basic_no_typecode (sub, DBUS_TYPE_UINT32,
- &value))
- _dbus_assert_not_reached ("should not have failed to insert array len");
- }
-
- _dbus_assert (sub->u.array.len_pos == sub->value_pos - 4);
-
- /* Write alignment padding for array elements
- * Note that we write the padding *even for empty arrays*
- * to avoid wonky special cases
- */
- alignment = element_type_get_alignment (contained_type, contained_type_start);
-
- aligned = _DBUS_ALIGN_VALUE (sub->value_pos, alignment);
- if (aligned != sub->value_pos)
- {
- if (!is_array_append)
- {
- if (!_dbus_string_insert_bytes (sub->value_str,
- sub->value_pos,
- aligned - sub->value_pos,
- '\0'))
- _dbus_assert_not_reached ("should not have failed to insert alignment padding");
- }
-
- sub->value_pos = aligned;
- }
-
- sub->u.array.start_pos = sub->value_pos;
-
- if (is_array_append)
- {
- dbus_uint32_t len;
-
- _dbus_assert (_DBUS_ALIGN_VALUE (sub->u.array.len_pos, 4) ==
- (unsigned) sub->u.array.len_pos);
- len = _dbus_unpack_uint32 (sub->byte_order,
- _dbus_string_get_const_data_len (sub->value_str,
- sub->u.array.len_pos,
- 4));
-
- sub->value_pos += len;
- }
- }
- else
- {
- /* not enabled, so we won't write the len_pos; set it to -1 to so indicate */
- sub->u.array.len_pos = -1;
- sub->u.array.start_pos = sub->value_pos;
- }
-
- _dbus_assert (sub->u.array.len_pos < sub->u.array.start_pos);
- _dbus_assert (is_array_append || sub->u.array.start_pos == sub->value_pos);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p recurse array done remaining sig '%s' array start_pos = %d len_pos = %d value_pos = %d\n", sub,
- sub->type_str ?
- _dbus_string_get_const_data_len (sub->type_str, sub->type_pos, 0) :
- "unknown",
- sub->u.array.start_pos, sub->u.array.len_pos, sub->value_pos);
-#endif
-
- return TRUE;
-}
-
-/* Variant value will normally have:
- * 1 byte signature length not including nul
- * signature typecodes (nul terminated)
- * padding to alignment of contained type
- * body according to signature
- *
- * The signature string can only have a single type
- * in it but that type may be complex/recursive.
- *
- * So a typical variant type with the integer 3 will have these
- * octets:
- * 0x1 'i' '\0' [1 byte padding to alignment boundary] 0x0 0x0 0x0 0x3
- *
- * The main world of hurt for writing out a variant is that the type
- * string is the same string as the value string. Which means
- * inserting to the type string will move the value_pos; and it means
- * that inserting to the type string could break type alignment.
- */
-static dbus_bool_t
-writer_recurse_variant (DBusTypeWriter *writer,
- const DBusString *contained_type,
- int contained_type_start,
- int contained_type_len,
- DBusTypeWriter *sub)
-{
- int contained_alignment;
-
- if (writer->enabled)
- {
- /* Allocate space for the worst case, which is 1 byte sig
- * length, nul byte at end of sig, and 7 bytes padding to
- * 8-boundary.
- */
- if (!_dbus_string_alloc_space (sub->value_str, contained_type_len + 9))
- return FALSE;
- }
-
- /* write VARIANT typecode to the parent's type string */
- if (!write_or_verify_typecode (writer, DBUS_TYPE_VARIANT))
- return FALSE;
-
- /* If not enabled, mark that we have no type_str anymore ... */
-
- if (!writer->enabled)
- {
- sub->type_str = NULL;
- sub->type_pos = -1;
-
- return TRUE;
- }
-
- /* If we're enabled then continue ... */
-
- if (!_dbus_string_insert_byte (sub->value_str,
- sub->value_pos,
- contained_type_len))
- _dbus_assert_not_reached ("should not have failed to insert variant type sig len");
-
- sub->value_pos += 1;
-
- /* Here we switch over to the expected type sig we're about to write */
- sub->type_str = sub->value_str;
- sub->type_pos = sub->value_pos;
-
- if (!_dbus_string_copy_len (contained_type, contained_type_start, contained_type_len,
- sub->value_str, sub->value_pos))
- _dbus_assert_not_reached ("should not have failed to insert variant type sig");
-
- sub->value_pos += contained_type_len;
-
- if (!_dbus_string_insert_byte (sub->value_str,
- sub->value_pos,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("should not have failed to insert variant type nul termination");
-
- sub->value_pos += 1;
-
- contained_alignment = _dbus_type_get_alignment (_dbus_first_type_in_signature (contained_type, contained_type_start));
-
- if (!_dbus_string_insert_bytes (sub->value_str,
- sub->value_pos,
- _DBUS_ALIGN_VALUE (sub->value_pos, contained_alignment) - sub->value_pos,
- '\0'))
- _dbus_assert_not_reached ("should not have failed to insert alignment padding for variant body");
- sub->value_pos = _DBUS_ALIGN_VALUE (sub->value_pos, contained_alignment);
-
- return TRUE;
-}
-
-static dbus_bool_t
-_dbus_type_writer_recurse_contained_len (DBusTypeWriter *writer,
- int container_type,
- const DBusString *contained_type,
- int contained_type_start,
- int contained_type_len,
- DBusTypeWriter *sub,
- dbus_bool_t is_array_append)
-{
- writer_recurse_init_and_check (writer, container_type, sub);
-
- switch (container_type)
- {
- case DBUS_TYPE_STRUCT:
- return writer_recurse_struct_or_dict_entry (writer,
- DBUS_STRUCT_BEGIN_CHAR,
- contained_type,
- contained_type_start, contained_type_len,
- sub);
- break;
- case DBUS_TYPE_DICT_ENTRY:
- return writer_recurse_struct_or_dict_entry (writer,
- DBUS_DICT_ENTRY_BEGIN_CHAR,
- contained_type,
- contained_type_start, contained_type_len,
- sub);
- break;
- case DBUS_TYPE_ARRAY:
- return writer_recurse_array (writer,
- contained_type, contained_type_start, contained_type_len,
- sub, is_array_append);
- break;
- case DBUS_TYPE_VARIANT:
- return writer_recurse_variant (writer,
- contained_type, contained_type_start, contained_type_len,
- sub);
- break;
- default:
- _dbus_assert_not_reached ("tried to recurse into type that doesn't support that");
- return FALSE;
- break;
- }
-}
-
-/**
- * Opens a new container and writes out the initial information for that container.
- *
- * @param writer the writer
- * @param container_type the type of the container to open
- * @param contained_type the array element type or variant content type
- * @param contained_type_start position to look for the type
- * @param sub the new sub-writer to write container contents
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_recurse (DBusTypeWriter *writer,
- int container_type,
- const DBusString *contained_type,
- int contained_type_start,
- DBusTypeWriter *sub)
-{
- int contained_type_len;
-
- if (contained_type)
- contained_type_len = find_len_of_complete_type (contained_type, contained_type_start);
- else
- contained_type_len = 0;
-
- return _dbus_type_writer_recurse_contained_len (writer, container_type,
- contained_type,
- contained_type_start,
- contained_type_len,
- sub,
- FALSE);
-}
-
-/**
- * Append to an existing array. Essentially, the writer will read an
- * existing length at the write location; jump over that length; and
- * write new fields. On unrecurse(), the existing length will be
- * updated.
- *
- * @param writer the writer
- * @param contained_type element type
- * @param contained_type_start position of element type
- * @param sub the subwriter to init
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_append_array (DBusTypeWriter *writer,
- const DBusString *contained_type,
- int contained_type_start,
- DBusTypeWriter *sub)
-{
- int contained_type_len;
-
- if (contained_type)
- contained_type_len = find_len_of_complete_type (contained_type, contained_type_start);
- else
- contained_type_len = 0;
-
- return _dbus_type_writer_recurse_contained_len (writer, DBUS_TYPE_ARRAY,
- contained_type,
- contained_type_start,
- contained_type_len,
- sub,
- TRUE);
-}
-
-static int
-writer_get_array_len (DBusTypeWriter *writer)
-{
- _dbus_assert (writer->container_type == DBUS_TYPE_ARRAY);
- return writer->value_pos - writer->u.array.start_pos;
-}
-
-/**
- * Closes a container created by _dbus_type_writer_recurse()
- * and writes any additional information to the values block.
- *
- * @param writer the writer
- * @param sub the sub-writer created by _dbus_type_writer_recurse()
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_unrecurse (DBusTypeWriter *writer,
- DBusTypeWriter *sub)
-{
- /* type_pos_is_expectation never gets unset once set, or we'd get all hosed */
- _dbus_assert (!writer->type_pos_is_expectation ||
- (writer->type_pos_is_expectation && sub->type_pos_is_expectation));
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p unrecurse type_pos = %d value_pos = %d is_expectation = %d container_type = %s\n",
- writer, writer->type_pos, writer->value_pos, writer->type_pos_is_expectation,
- _dbus_type_to_string (writer->container_type));
- _dbus_verbose (" type writer %p unrecurse sub type_pos = %d value_pos = %d is_expectation = %d container_type = %s\n",
- sub, sub->type_pos, sub->value_pos,
- sub->type_pos_is_expectation,
- _dbus_type_to_string (sub->container_type));
-#endif
-
- if (sub->container_type == DBUS_TYPE_STRUCT)
- {
- if (!write_or_verify_typecode (sub, DBUS_STRUCT_END_CHAR))
- return FALSE;
- }
- else if (sub->container_type == DBUS_TYPE_DICT_ENTRY)
- {
- if (!write_or_verify_typecode (sub, DBUS_DICT_ENTRY_END_CHAR))
- return FALSE;
- }
- else if (sub->container_type == DBUS_TYPE_ARRAY)
- {
- if (sub->u.array.len_pos >= 0) /* len_pos == -1 if we weren't enabled when we passed it */
- {
- dbus_uint32_t len;
-
- /* Set the array length */
- len = writer_get_array_len (sub);
- _dbus_marshal_set_uint32 (sub->value_str,
- sub->u.array.len_pos,
- len,
- sub->byte_order);
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" filled in sub array len to %u at len_pos %d\n",
- len, sub->u.array.len_pos);
-#endif
- }
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- else
- {
- _dbus_verbose (" not filling in sub array len because we were disabled when we passed the len\n");
- }
-#endif
- }
-
- /* Now get type_pos right for the parent writer. Here are the cases:
- *
- * Cases !writer->type_pos_is_expectation:
- * (in these cases we want to update to the new insertion point)
- *
- * - if we recursed into a STRUCT then we didn't know in advance
- * what the types in the struct would be; so we have to fill in
- * that information now.
- * writer->type_pos = sub->type_pos
- *
- * - if we recursed into anything else, we knew the full array
- * type, or knew the single typecode marking VARIANT, so
- * writer->type_pos is already correct.
- * writer->type_pos should remain as-is
- *
- * - note that the parent is never an ARRAY or VARIANT, if it were
- * then type_pos_is_expectation would be TRUE. The parent
- * is thus known to be a toplevel or STRUCT.
- *
- * Cases where writer->type_pos_is_expectation:
- * (in these cases we want to update to next expected type to write)
- *
- * - we recursed from STRUCT into STRUCT and we didn't increment
- * type_pos in the parent just to stay consistent with the
- * !writer->type_pos_is_expectation case (though we could
- * special-case this in recurse_struct instead if we wanted)
- * writer->type_pos = sub->type_pos
- *
- * - we recursed from STRUCT into ARRAY or VARIANT and type_pos
- * for parent should have been incremented already
- * writer->type_pos should remain as-is
- *
- * - we recursed from ARRAY into a sub-element, so type_pos in the
- * parent is the element type and should remain the element type
- * for the benefit of the next child element
- * writer->type_pos should remain as-is
- *
- * - we recursed from VARIANT into its value, so type_pos in the
- * parent makes no difference since there's only one value
- * and we just finished writing it and won't use type_pos again
- * writer->type_pos should remain as-is
- *
- *
- * For all these, DICT_ENTRY is the same as STRUCT
- */
- if (writer->type_str != NULL)
- {
- if ((sub->container_type == DBUS_TYPE_STRUCT ||
- sub->container_type == DBUS_TYPE_DICT_ENTRY) &&
- (writer->container_type == DBUS_TYPE_STRUCT ||
- writer->container_type == DBUS_TYPE_DICT_ENTRY ||
- writer->container_type == DBUS_TYPE_INVALID))
- {
- /* Advance the parent to the next struct field */
- writer->type_pos = sub->type_pos;
- }
- }
-
- writer->value_pos = sub->value_pos;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p unrecursed type_pos = %d value_pos = %d remaining sig '%s'\n",
- writer, writer->type_pos, writer->value_pos,
- writer->type_str ?
- _dbus_string_get_const_data_len (writer->type_str, writer->type_pos, 0) :
- "unknown");
-#endif
-
- return TRUE;
-}
-
-/**
- * Writes out a basic type.
- *
- * @param writer the writer
- * @param type the type to write
- * @param value the address of the value to write
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_write_basic (DBusTypeWriter *writer,
- int type,
- const void *value)
-{
- dbus_bool_t retval;
-
- /* First ensure that our type realloc will succeed */
- if (!writer->type_pos_is_expectation && writer->type_str != NULL)
- {
- if (!_dbus_string_alloc_space (writer->type_str, 1))
- return FALSE;
- }
-
- retval = FALSE;
-
- if (!_dbus_type_writer_write_basic_no_typecode (writer, type, value))
- goto out;
-
- if (!write_or_verify_typecode (writer, type))
- _dbus_assert_not_reached ("failed to write typecode after prealloc");
-
- retval = TRUE;
-
- out:
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p basic type_pos = %d value_pos = %d is_expectation = %d enabled = %d\n",
- writer, writer->type_pos, writer->value_pos, writer->type_pos_is_expectation,
- writer->enabled);
-#endif
-
- return retval;
-}
-
-/**
- * Writes a block of fixed-length basic values, i.e. those that are
- * both dbus_type_is_fixed() and _dbus_type_is_basic(). The block
- * must be written inside an array.
- *
- * The value parameter should be the address of said array of values,
- * so e.g. if it's an array of double, pass in "const double**"
- *
- * @param writer the writer
- * @param element_type type of stuff in the array
- * @param value address of the array
- * @param n_elements number of elements in the array
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_write_fixed_multi (DBusTypeWriter *writer,
- int element_type,
- const void *value,
- int n_elements)
-{
- _dbus_assert (writer->container_type == DBUS_TYPE_ARRAY);
- _dbus_assert (dbus_type_is_fixed (element_type));
- _dbus_assert (writer->type_pos_is_expectation);
- _dbus_assert (n_elements >= 0);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p entering fixed multi type_pos = %d value_pos = %d n_elements %d\n",
- writer, writer->type_pos, writer->value_pos, n_elements);
-#endif
-
- if (!write_or_verify_typecode (writer, element_type))
- _dbus_assert_not_reached ("OOM should not happen if only verifying typecode");
-
- if (writer->enabled)
- {
- if (!_dbus_marshal_write_fixed_multi (writer->value_str,
- writer->value_pos,
- element_type,
- value,
- n_elements,
- writer->byte_order,
- &writer->value_pos))
- return FALSE;
- }
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose (" type writer %p fixed multi written new type_pos = %d new value_pos = %d n_elements %d\n",
- writer, writer->type_pos, writer->value_pos, n_elements);
-#endif
-
- return TRUE;
-}
-
-static void
-enable_if_after (DBusTypeWriter *writer,
- DBusTypeReader *reader,
- const DBusTypeReader *start_after)
-{
- if (start_after)
- {
- if (!writer->enabled && _dbus_type_reader_greater_than (reader, start_after))
- {
- _dbus_type_writer_set_enabled (writer, TRUE);
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("ENABLING writer %p at %d because reader at value_pos %d is after reader at value_pos %d\n",
- writer, writer->value_pos, reader->value_pos, start_after->value_pos);
-#endif
- }
-
- _dbus_assert ((!writer->enabled && !_dbus_type_reader_greater_than (reader, start_after)) ||
- (writer->enabled && _dbus_type_reader_greater_than (reader, start_after)));
- }
-}
-
-static dbus_bool_t
-append_fixup (DBusList **fixups,
- const DBusArrayLenFixup *fixup)
-{
- DBusArrayLenFixup *f;
-
- f = dbus_new (DBusArrayLenFixup, 1);
- if (f == NULL)
- return FALSE;
-
- *f = *fixup;
-
- if (!_dbus_list_append (fixups, f))
- {
- dbus_free (f);
- return FALSE;
- }
-
- _dbus_assert (f->len_pos_in_reader == fixup->len_pos_in_reader);
- _dbus_assert (f->new_len == fixup->new_len);
-
- return TRUE;
-}
-
-/* This loop is trivial if you ignore all the start_after nonsense,
- * so if you're trying to figure it out, start by ignoring that
- */
-static dbus_bool_t
-writer_write_reader_helper (DBusTypeWriter *writer,
- DBusTypeReader *reader,
- const DBusTypeReader *start_after,
- int start_after_new_pos,
- int start_after_new_len,
- DBusList **fixups,
- dbus_bool_t inside_start_after)
-{
- int current_type;
-
- while ((current_type = _dbus_type_reader_get_current_type (reader)) != DBUS_TYPE_INVALID)
- {
- if (dbus_type_is_container (current_type))
- {
- DBusTypeReader subreader;
- DBusTypeWriter subwriter;
- const DBusString *sig_str;
- int sig_start;
- int sig_len;
- dbus_bool_t enabled_at_recurse;
- dbus_bool_t past_start_after;
- int reader_array_len_pos;
- int reader_array_start_pos;
- dbus_bool_t this_is_start_after;
-
- /* type_pos is checked since e.g. in a struct the struct
- * and its first field have the same value_pos.
- * type_str will differ in reader/start_after for variants
- * where type_str is inside the value_str
- */
- if (!inside_start_after && start_after &&
- reader->value_pos == start_after->value_pos &&
- reader->type_str == start_after->type_str &&
- reader->type_pos == start_after->type_pos)
- this_is_start_after = TRUE;
- else
- this_is_start_after = FALSE;
-
- _dbus_type_reader_recurse (reader, &subreader);
-
- if (current_type == DBUS_TYPE_ARRAY)
- {
- reader_array_len_pos = ARRAY_READER_LEN_POS (&subreader);
- reader_array_start_pos = subreader.u.array.start_pos;
- }
- else
- {
- /* quiet gcc */
- reader_array_len_pos = -1;
- reader_array_start_pos = -1;
- }
-
- _dbus_type_reader_get_signature (&subreader, &sig_str,
- &sig_start, &sig_len);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("about to recurse into %s reader at %d subreader at %d writer at %d start_after reader at %d write target len %d inside_start_after = %d this_is_start_after = %d\n",
- _dbus_type_to_string (current_type),
- reader->value_pos,
- subreader.value_pos,
- writer->value_pos,
- start_after ? start_after->value_pos : -1,
- _dbus_string_get_length (writer->value_str),
- inside_start_after, this_is_start_after);
-#endif
-
- if (!inside_start_after && !this_is_start_after)
- enable_if_after (writer, &subreader, start_after);
- enabled_at_recurse = writer->enabled;
- if (!_dbus_type_writer_recurse_contained_len (writer, current_type,
- sig_str, sig_start, sig_len,
- &subwriter, FALSE))
- goto oom;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("recursed into subwriter at %d write target len %d\n",
- subwriter.value_pos,
- _dbus_string_get_length (subwriter.value_str));
-#endif
-
- if (!writer_write_reader_helper (&subwriter, &subreader, start_after,
- start_after_new_pos, start_after_new_len,
- fixups,
- inside_start_after ||
- this_is_start_after))
- goto oom;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("about to unrecurse from %s subreader at %d writer at %d subwriter at %d write target len %d\n",
- _dbus_type_to_string (current_type),
- subreader.value_pos,
- writer->value_pos,
- subwriter.value_pos,
- _dbus_string_get_length (writer->value_str));
-#endif
-
- if (!inside_start_after && !this_is_start_after)
- enable_if_after (writer, &subreader, start_after);
- past_start_after = writer->enabled;
- if (!_dbus_type_writer_unrecurse (writer, &subwriter))
- goto oom;
-
- /* If we weren't enabled when we recursed, we didn't
- * write an array len; if we passed start_after
- * somewhere inside the array, then we need to generate
- * a fixup.
- */
- if (start_after != NULL &&
- !enabled_at_recurse && past_start_after &&
- current_type == DBUS_TYPE_ARRAY &&
- fixups != NULL)
- {
- DBusArrayLenFixup fixup;
- int bytes_written_after_start_after;
- int bytes_before_start_after;
- int old_len;
-
- /* this subwriter access is moderately unkosher since we
- * already unrecursed, but it works as long as unrecurse
- * doesn't break us on purpose
- */
- bytes_written_after_start_after = writer_get_array_len (&subwriter);
-
- bytes_before_start_after =
- start_after->value_pos - reader_array_start_pos;
-
- fixup.len_pos_in_reader = reader_array_len_pos;
- fixup.new_len =
- bytes_before_start_after +
- start_after_new_len +
- bytes_written_after_start_after;
-
- _dbus_assert (_DBUS_ALIGN_VALUE (fixup.len_pos_in_reader, 4) ==
- (unsigned) fixup.len_pos_in_reader);
-
- old_len = _dbus_unpack_uint32 (reader->byte_order,
- _dbus_string_get_const_data_len (reader->value_str,
- fixup.len_pos_in_reader, 4));
-
- if (old_len != fixup.new_len && !append_fixup (fixups, &fixup))
- goto oom;
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("Generated fixup len_pos_in_reader = %d new_len = %d reader_array_start_pos = %d start_after->value_pos = %d bytes_before_start_after = %d start_after_new_len = %d bytes_written_after_start_after = %d\n",
- fixup.len_pos_in_reader,
- fixup.new_len,
- reader_array_start_pos,
- start_after->value_pos,
- bytes_before_start_after,
- start_after_new_len,
- bytes_written_after_start_after);
-#endif
- }
- }
- else
- {
- DBusBasicValue val;
-
- _dbus_assert (dbus_type_is_basic (current_type));
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("Reading basic value %s at %d\n",
- _dbus_type_to_string (current_type),
- reader->value_pos);
-#endif
-
- _dbus_type_reader_read_basic (reader, &val);
-
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("Writing basic value %s at %d write target len %d inside_start_after = %d\n",
- _dbus_type_to_string (current_type),
- writer->value_pos,
- _dbus_string_get_length (writer->value_str),
- inside_start_after);
-#endif
- if (!inside_start_after)
- enable_if_after (writer, reader, start_after);
- if (!_dbus_type_writer_write_basic (writer, current_type, &val))
- goto oom;
-#if RECURSIVE_MARSHAL_WRITE_TRACE
- _dbus_verbose ("Wrote basic value %s, new value_pos %d write target len %d\n",
- _dbus_type_to_string (current_type),
- writer->value_pos,
- _dbus_string_get_length (writer->value_str));
-#endif
- }
-
- _dbus_type_reader_next (reader);
- }
-
- return TRUE;
-
- oom:
- if (fixups)
- apply_and_free_fixups (fixups, NULL); /* NULL for reader to apply to */
-
- return FALSE;
-}
-
-/*
- * Iterate through all values in the given reader, writing a copy of
- * each value to the writer. The reader will be moved forward to its
- * end position.
- *
- * If a reader start_after is provided, it should be a reader for the
- * same data as the reader to be written. Only values occurring after
- * the value pointed to by start_after will be written to the writer.
- *
- * If start_after is provided, then the copy of the reader will be
- * partial. This means that array lengths will not have been copied.
- * The assumption is that you wrote a new version of the value at
- * start_after to the writer. You have to pass in the start position
- * and length of the new value. (If you are deleting the value
- * at start_after, pass in 0 for the length.)
- *
- * If the fixups parameter is non-#NULL, then any array length that
- * was read but not written due to start_after will be provided
- * as a #DBusArrayLenFixup. The fixup contains the position of the
- * array length in the source data, and the correct array length
- * assuming you combine the source data before start_after with
- * the written data at start_after and beyond.
- *
- * @param writer the writer to copy to
- * @param reader the reader to copy from
- * @param start_after #NULL or a reader showing where to start
- * @param start_after_new_pos the position of start_after equivalent in the target data
- * @param start_after_new_len the length of start_after equivalent in the target data
- * @param fixups list to append #DBusArrayLenFixup if the write was partial
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-_dbus_type_writer_write_reader_partial (DBusTypeWriter *writer,
- DBusTypeReader *reader,
- const DBusTypeReader *start_after,
- int start_after_new_pos,
- int start_after_new_len,
- DBusList **fixups)
-{
- DBusTypeWriter orig;
- int orig_type_len;
- int orig_value_len;
- int new_bytes;
- int orig_enabled;
-
- orig = *writer;
- orig_type_len = _dbus_string_get_length (writer->type_str);
- orig_value_len = _dbus_string_get_length (writer->value_str);
- orig_enabled = writer->enabled;
-
- if (start_after)
- _dbus_type_writer_set_enabled (writer, FALSE);
-
- if (!writer_write_reader_helper (writer, reader, start_after,
- start_after_new_pos,
- start_after_new_len,
- fixups, FALSE))
- goto oom;
-
- _dbus_type_writer_set_enabled (writer, orig_enabled);
- return TRUE;
-
- oom:
- if (!writer->type_pos_is_expectation)
- {
- new_bytes = _dbus_string_get_length (writer->type_str) - orig_type_len;
- _dbus_string_delete (writer->type_str, orig.type_pos, new_bytes);
- }
- new_bytes = _dbus_string_get_length (writer->value_str) - orig_value_len;
- _dbus_string_delete (writer->value_str, orig.value_pos, new_bytes);
-
- *writer = orig;
-
- return FALSE;
-}
-
-/**
- * Iterate through all values in the given reader, writing a copy of
- * each value to the writer. The reader will be moved forward to its
- * end position.
- *
- * @param writer the writer to copy to
- * @param reader the reader to copy from
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_type_writer_write_reader (DBusTypeWriter *writer,
- DBusTypeReader *reader)
-{
- return _dbus_type_writer_write_reader_partial (writer, reader, NULL, 0, 0, NULL);
-}
-
-/*
- * If disabled, a writer can still be iterated forward and recursed/unrecursed
- * but won't write any values. Types will still be written unless the
- * writer is a "values only" writer, because the writer needs access to
- * a valid signature to be able to iterate.
- *
- * @param writer the type writer
- * @param enabled #TRUE if values should be written
- */
-static void
-_dbus_type_writer_set_enabled (DBusTypeWriter *writer,
- dbus_bool_t enabled)
-{
- writer->enabled = enabled != FALSE;
-}
-
-/** @} */ /* end of DBusMarshal group */
-
-/* tests in dbus-marshal-recursive-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.h
deleted file mode 100644
index acbfd73103..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-recursive.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-recursive.h Marshalling routines for recursive types
- *
- * Copyright (C) 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MARSHAL_RECURSIVE_H
-#define DBUS_MARSHAL_RECURSIVE_H
-
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-list.h>
-
-typedef struct DBusTypeReader DBusTypeReader;
-typedef struct DBusTypeWriter DBusTypeWriter;
-typedef struct DBusTypeReaderClass DBusTypeReaderClass;
-typedef struct DBusArrayLenFixup DBusArrayLenFixup;
-
-/**
- * The type reader is an iterator for reading values from a block of
- * values.
- */
-struct DBusTypeReader
-{
- dbus_uint32_t byte_order : 8; /**< byte order of the block */
-
- dbus_uint32_t finished : 1; /**< marks we're at end iterator for cases
- * where we don't have another way to tell
- */
- dbus_uint32_t array_len_offset : 3; /**< bytes back from start_pos that len ends */
- const DBusString *type_str; /**< string containing signature of block */
- int type_pos; /**< current position in signature */
- const DBusString *value_str; /**< string containing values of block */
- int value_pos; /**< current position in values */
-
- const DBusTypeReaderClass *klass; /**< the vtable for the reader */
- union
- {
- struct {
- int start_pos; /**< for array readers, the start of the array values */
- } array;
- } u; /**< class-specific data */
-};
-
-/**
- * The type writer is an iterator for writing to a block of values.
- */
-struct DBusTypeWriter
-{
- dbus_uint32_t byte_order : 8; /**< byte order to write values with */
-
- dbus_uint32_t container_type : 8; /**< what are we inside? (e.g. struct, variant, array) */
-
- dbus_uint32_t type_pos_is_expectation : 1; /**< type_pos can be either an insertion point for or an expected next type */
-
- dbus_uint32_t enabled : 1; /**< whether to write values */
-
- DBusString *type_str; /**< where to write typecodes (or read type expectations) */
- int type_pos; /**< current pos in type_str */
- DBusString *value_str; /**< where to write values */
- int value_pos; /**< next position to write */
-
- union
- {
- struct {
- int start_pos; /**< position of first element in the array */
- int len_pos; /**< position of length of the array */
- int element_type_pos; /**< position of array element type in type_str */
- } array;
- } u; /**< class-specific data */
-};
-
-/**
- * When modifying an existing block of values, array lengths may need
- * to be adjusted; those adjustments are described by this struct.
- */
-struct DBusArrayLenFixup
-{
- int len_pos_in_reader; /**< where the length was in the original block */
- int new_len; /**< the new value of the length in the written-out block */
-};
-
-void _dbus_type_reader_init (DBusTypeReader *reader,
- int byte_order,
- const DBusString *type_str,
- int type_pos,
- const DBusString *value_str,
- int value_pos);
-void _dbus_type_reader_init_types_only (DBusTypeReader *reader,
- const DBusString *type_str,
- int type_pos);
-int _dbus_type_reader_get_current_type (const DBusTypeReader *reader);
-int _dbus_type_reader_get_element_type (const DBusTypeReader *reader);
-int _dbus_type_reader_get_value_pos (const DBusTypeReader *reader);
-void _dbus_type_reader_read_basic (const DBusTypeReader *reader,
- void *value);
-int _dbus_type_reader_get_array_length (const DBusTypeReader *reader);
-void _dbus_type_reader_read_fixed_multi (const DBusTypeReader *reader,
- void *value,
- int *n_elements);
-void _dbus_type_reader_read_raw (const DBusTypeReader *reader,
- const unsigned char **value_location);
-void _dbus_type_reader_recurse (DBusTypeReader *reader,
- DBusTypeReader *subreader);
-dbus_bool_t _dbus_type_reader_next (DBusTypeReader *reader);
-dbus_bool_t _dbus_type_reader_has_next (const DBusTypeReader *reader);
-void _dbus_type_reader_get_signature (const DBusTypeReader *reader,
- const DBusString **str_p,
- int *start_p,
- int *len_p);
-dbus_bool_t _dbus_type_reader_set_basic (DBusTypeReader *reader,
- const void *value,
- const DBusTypeReader *realign_root);
-dbus_bool_t _dbus_type_reader_delete (DBusTypeReader *reader,
- const DBusTypeReader *realign_root);
-
-dbus_bool_t _dbus_type_reader_equal_values (const DBusTypeReader *lhs,
- const DBusTypeReader *rhs);
-
-void _dbus_type_signature_next (const char *signature,
- int *type_pos);
-
-void _dbus_type_writer_init (DBusTypeWriter *writer,
- int byte_order,
- DBusString *type_str,
- int type_pos,
- DBusString *value_str,
- int value_pos);
-void _dbus_type_writer_init_types_delayed (DBusTypeWriter *writer,
- int byte_order,
- DBusString *value_str,
- int value_pos);
-void _dbus_type_writer_add_types (DBusTypeWriter *writer,
- DBusString *type_str,
- int type_pos);
-void _dbus_type_writer_remove_types (DBusTypeWriter *writer);
-void _dbus_type_writer_init_values_only (DBusTypeWriter *writer,
- int byte_order,
- const DBusString *type_str,
- int type_pos,
- DBusString *value_str,
- int value_pos);
-dbus_bool_t _dbus_type_writer_write_basic (DBusTypeWriter *writer,
- int type,
- const void *value);
-dbus_bool_t _dbus_type_writer_write_fixed_multi (DBusTypeWriter *writer,
- int element_type,
- const void *value,
- int n_elements);
-dbus_bool_t _dbus_type_writer_recurse (DBusTypeWriter *writer,
- int container_type,
- const DBusString *contained_type,
- int contained_type_start,
- DBusTypeWriter *sub);
-dbus_bool_t _dbus_type_writer_unrecurse (DBusTypeWriter *writer,
- DBusTypeWriter *sub);
-dbus_bool_t _dbus_type_writer_append_array (DBusTypeWriter *writer,
- const DBusString *contained_type,
- int contained_type_start,
- DBusTypeWriter *sub);
-dbus_bool_t _dbus_type_writer_write_reader (DBusTypeWriter *writer,
- DBusTypeReader *reader);
-
-
-#endif /* DBUS_MARSHAL_RECURSIVE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate-util.c
deleted file mode 100644
index d52cb6d84c..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate-util.c
+++ /dev/null
@@ -1,588 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-validate-util.c Would be in dbus-marshal-validate.c, but only used by tests/bus
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include "dbus-internals.h"
-#include "dbus-marshal-validate.h"
-#include "dbus-marshal-recursive.h"
-
-#include "dbus-test.h"
-#include <stdio.h>
-
-typedef struct
-{
- const char *data;
- DBusValidity expected;
-} ValidityTest;
-
-static void
-run_validity_tests (const ValidityTest *tests,
- int n_tests,
- DBusValidity (* func) (const DBusString*,int,int))
-{
- int i;
-
- for (i = 0; i < n_tests; i++)
- {
- DBusString str;
- DBusValidity v;
-
- _dbus_string_init_const (&str, tests[i].data);
-
- v = (*func) (&str, 0, _dbus_string_get_length (&str));
-
- if (v != tests[i].expected)
- {
- _dbus_warn ("Improper validation result %d for '%s'\n",
- v, tests[i].data);
- _dbus_assert_not_reached ("test failed");
- }
-
- ++i;
- }
-}
-
-static const ValidityTest signature_tests[] = {
- { "", DBUS_VALID },
- { "i", DBUS_VALID },
- { "ai", DBUS_VALID },
- { "(i)", DBUS_VALID },
- { "w", DBUS_INVALID_UNKNOWN_TYPECODE },
- { "a", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- { "aaaaaa", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- { "ii(ii)a", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- { "ia", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- /* DBUS_INVALID_SIGNATURE_TOO_LONG, */ /* too hard to test this way */
- { "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION },
- { "((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((ii))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
- DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION },
- { ")", DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED },
- { "i)", DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED },
- { "a)", DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED },
- { "(", DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED },
- { "(i", DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED },
- { "(iiiii", DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED },
- { "(ai", DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED },
- { "()", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
- { "(())", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
- { "a()", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
- { "i()", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
- { "()i", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
- { "(a)", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- { "a{ia}", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
- { "a{}", DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS },
- { "a{aii}", DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE },
- /* { "a{i}", DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD }, */
- /* { "{is}", DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY }, */
- /* { "a{isi}", DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS }, */
-};
-
-dbus_bool_t
-_dbus_marshal_validate_test (void)
-{
- DBusString str;
- int i;
-
- const char *valid_paths[] = {
- "/",
- "/foo/bar",
- "/foo",
- "/foo/bar/baz"
- };
- const char *invalid_paths[] = {
- "bar",
- "bar/baz",
- "/foo/bar/",
- "/foo/"
- "foo/",
- "boo//blah",
- "//",
- "///",
- "foo///blah/",
- "Hello World",
- "",
- " ",
- "foo bar"
- };
-
- const char *valid_interfaces[] = {
- "org.freedesktop.Foo",
- "Bar.Baz",
- "Blah.Blah.Blah.Blah.Blah",
- "a.b",
- "a.b.c.d.e.f.g",
- "a0.b1.c2.d3.e4.f5.g6",
- "abc123.foo27"
- };
- const char *invalid_interfaces[] = {
- ".",
- "",
- "..",
- ".Foo.Bar",
- "..Foo.Bar",
- "Foo.Bar.",
- "Foo.Bar..",
- "Foo",
- "9foo.bar.baz",
- "foo.bar..baz",
- "foo.bar...baz",
- "foo.bar.b..blah",
- ":",
- ":0-1",
- "10",
- ":11.34324",
- "0.0.0",
- "0..0",
- "foo.Bar.%",
- "foo.Bar!!",
- "!Foo.bar.bz",
- "foo.$.blah",
- "",
- " ",
- "foo bar"
- };
-
- const char *valid_unique_names[] = {
- ":0",
- ":a",
- ":",
- ":.a",
- ":.1",
- ":0.1",
- ":000.2222",
- ":.blah",
- ":abce.freedesktop.blah"
- };
- const char *invalid_unique_names[] = {
- //":-",
- ":!",
- //":0-10",
- ":blah.",
- ":blah.",
- ":blah..org",
- ":blah.org..",
- ":..blah.org",
- "",
- " ",
- "foo bar"
- };
-
- const char *valid_members[] = {
- "Hello",
- "Bar",
- "foobar",
- "_foobar",
- "foo89"
- };
-
- const char *invalid_members[] = {
- "9Hello",
- "10",
- "1",
- "foo-bar",
- "blah.org",
- ".blah",
- "blah.",
- "Hello.",
- "!foo",
- "",
- " ",
- "foo bar"
- };
-
- const char *valid_signatures[] = {
- "",
- "sss",
- "i",
- "b"
- };
-
- const char *invalid_signatures[] = {
- " ",
- "not a valid signature",
- "123",
- ".",
- "(",
- "a{(ii)i}" /* https://bugs.freedesktop.org/show_bug.cgi?id=17803 */
- };
-
- /* Signature with reason */
-
- run_validity_tests (signature_tests, _DBUS_N_ELEMENTS (signature_tests),
- _dbus_validate_signature_with_reason);
-
- /* Path validation */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_paths))
- {
- _dbus_string_init_const (&str, valid_paths[i]);
-
- if (!_dbus_validate_path (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Path \"%s\" should have been valid\n", valid_paths[i]);
- _dbus_assert_not_reached ("invalid path");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_paths))
- {
- _dbus_string_init_const (&str, invalid_paths[i]);
-
- if (_dbus_validate_path (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Path \"%s\" should have been invalid\n", invalid_paths[i]);
- _dbus_assert_not_reached ("valid path");
- }
-
- ++i;
- }
-
- /* Interface validation */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_interfaces))
- {
- _dbus_string_init_const (&str, valid_interfaces[i]);
-
- if (!_dbus_validate_interface (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Interface \"%s\" should have been valid\n", valid_interfaces[i]);
- _dbus_assert_not_reached ("invalid interface");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_interfaces))
- {
- _dbus_string_init_const (&str, invalid_interfaces[i]);
-
- if (_dbus_validate_interface (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Interface \"%s\" should have been invalid\n", invalid_interfaces[i]);
- _dbus_assert_not_reached ("valid interface");
- }
-
- ++i;
- }
-
- /* Bus name validation (check that valid interfaces are valid bus names,
- * and invalid interfaces are invalid services except if they start with ':')
- */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_interfaces))
- {
- _dbus_string_init_const (&str, valid_interfaces[i]);
-
- if (!_dbus_validate_bus_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Bus name \"%s\" should have been valid\n", valid_interfaces[i]);
- _dbus_assert_not_reached ("invalid bus name");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_interfaces))
- {
- if (invalid_interfaces[i][0] != ':')
- {
- _dbus_string_init_const (&str, invalid_interfaces[i]);
-
- if (_dbus_validate_bus_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Bus name \"%s\" should have been invalid\n", invalid_interfaces[i]);
- _dbus_assert_not_reached ("valid bus name");
- }
- }
-
- ++i;
- }
-
- /* unique name validation */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_unique_names))
- {
- _dbus_string_init_const (&str, valid_unique_names[i]);
-
- if (!_dbus_validate_bus_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Bus name \"%s\" should have been valid\n", valid_unique_names[i]);
- _dbus_assert_not_reached ("invalid unique name");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_unique_names))
- {
- _dbus_string_init_const (&str, invalid_unique_names[i]);
-
- if (_dbus_validate_bus_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Bus name \"%s\" should have been invalid\n", invalid_unique_names[i]);
- _dbus_assert_not_reached ("valid unique name");
- }
-
- ++i;
- }
-
-
- /* Error name validation (currently identical to interfaces)
- */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_interfaces))
- {
- _dbus_string_init_const (&str, valid_interfaces[i]);
-
- if (!_dbus_validate_error_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Error name \"%s\" should have been valid\n", valid_interfaces[i]);
- _dbus_assert_not_reached ("invalid error name");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_interfaces))
- {
- if (invalid_interfaces[i][0] != ':')
- {
- _dbus_string_init_const (&str, invalid_interfaces[i]);
-
- if (_dbus_validate_error_name (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Error name \"%s\" should have been invalid\n", invalid_interfaces[i]);
- _dbus_assert_not_reached ("valid error name");
- }
- }
-
- ++i;
- }
-
- /* Member validation */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_members))
- {
- _dbus_string_init_const (&str, valid_members[i]);
-
- if (!_dbus_validate_member (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Member \"%s\" should have been valid\n", valid_members[i]);
- _dbus_assert_not_reached ("invalid member");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_members))
- {
- _dbus_string_init_const (&str, invalid_members[i]);
-
- if (_dbus_validate_member (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Member \"%s\" should have been invalid\n", invalid_members[i]);
- _dbus_assert_not_reached ("valid member");
- }
-
- ++i;
- }
-
- /* Signature validation */
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (valid_signatures))
- {
- _dbus_string_init_const (&str, valid_signatures[i]);
-
- if (!_dbus_validate_signature (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Signature \"%s\" should have been valid\n", valid_signatures[i]);
- _dbus_assert_not_reached ("invalid signature");
- }
-
- ++i;
- }
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (invalid_signatures))
- {
- _dbus_string_init_const (&str, invalid_signatures[i]);
-
- if (_dbus_validate_signature (&str, 0,
- _dbus_string_get_length (&str)))
- {
- _dbus_warn ("Signature \"%s\" should have been invalid\n", invalid_signatures[i]);
- _dbus_assert_not_reached ("valid signature");
- }
-
- ++i;
- }
-
- /* Validate claimed length longer than real length */
- _dbus_string_init_const (&str, "abc.efg");
- if (_dbus_validate_bus_name (&str, 0, 8))
- _dbus_assert_not_reached ("validated too-long string");
- if (_dbus_validate_interface (&str, 0, 8))
- _dbus_assert_not_reached ("validated too-long string");
- if (_dbus_validate_error_name (&str, 0, 8))
- _dbus_assert_not_reached ("validated too-long string");
-
- _dbus_string_init_const (&str, "abc");
- if (_dbus_validate_member (&str, 0, 4))
- _dbus_assert_not_reached ("validated too-long string");
-
- _dbus_string_init_const (&str, "sss");
- if (_dbus_validate_signature (&str, 0, 4))
- _dbus_assert_not_reached ("validated too-long signature");
-
- /* Validate string exceeding max name length */
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- while (_dbus_string_get_length (&str) <= DBUS_MAXIMUM_NAME_LENGTH)
- if (!_dbus_string_append (&str, "abc.def"))
- _dbus_assert_not_reached ("no memory");
-
- if (_dbus_validate_bus_name (&str, 0, _dbus_string_get_length (&str)))
- _dbus_assert_not_reached ("validated overmax string");
- if (_dbus_validate_interface (&str, 0, _dbus_string_get_length (&str)))
- _dbus_assert_not_reached ("validated overmax string");
- if (_dbus_validate_error_name (&str, 0, _dbus_string_get_length (&str)))
- _dbus_assert_not_reached ("validated overmax string");
-
- /* overlong member */
- _dbus_string_set_length (&str, 0);
- while (_dbus_string_get_length (&str) <= DBUS_MAXIMUM_NAME_LENGTH)
- if (!_dbus_string_append (&str, "abc"))
- _dbus_assert_not_reached ("no memory");
-
- if (_dbus_validate_member (&str, 0, _dbus_string_get_length (&str)))
- _dbus_assert_not_reached ("validated overmax string");
-
- /* overlong unique name */
- _dbus_string_set_length (&str, 0);
- _dbus_string_append (&str, ":");
- while (_dbus_string_get_length (&str) <= DBUS_MAXIMUM_NAME_LENGTH)
- if (!_dbus_string_append (&str, "abc"))
- _dbus_assert_not_reached ("no memory");
-
- if (_dbus_validate_bus_name (&str, 0, _dbus_string_get_length (&str)))
- _dbus_assert_not_reached ("validated overmax string");
-
- _dbus_string_free (&str);
-
- /* Body validation; test basic validation of valid bodies for both endian */
-
- {
- int sequence;
- DBusString signature;
- DBusString body;
-
- if (!_dbus_string_init (&signature) || !_dbus_string_init (&body))
- _dbus_assert_not_reached ("oom");
-
- sequence = 0;
- while (dbus_internal_do_not_use_generate_bodies (sequence,
- DBUS_LITTLE_ENDIAN,
- &signature, &body))
- {
- DBusValidity validity;
-
- validity = _dbus_validate_body_with_reason (&signature, 0,
- DBUS_LITTLE_ENDIAN,
- NULL, &body, 0,
- _dbus_string_get_length (&body));
- if (validity != DBUS_VALID)
- {
- _dbus_warn ("invalid code %d expected valid on sequence %d little endian\n",
- validity, sequence);
- _dbus_verbose_bytes_of_string (&signature, 0, _dbus_string_get_length (&signature));
- _dbus_verbose_bytes_of_string (&body, 0, _dbus_string_get_length (&body));
- _dbus_assert_not_reached ("test failed");
- }
-
- _dbus_string_set_length (&signature, 0);
- _dbus_string_set_length (&body, 0);
- ++sequence;
- }
-
- sequence = 0;
- while (dbus_internal_do_not_use_generate_bodies (sequence,
- DBUS_BIG_ENDIAN,
- &signature, &body))
- {
- DBusValidity validity;
-
- validity = _dbus_validate_body_with_reason (&signature, 0,
- DBUS_BIG_ENDIAN,
- NULL, &body, 0,
- _dbus_string_get_length (&body));
- if (validity != DBUS_VALID)
- {
- _dbus_warn ("invalid code %d expected valid on sequence %d big endian\n",
- validity, sequence);
- _dbus_verbose_bytes_of_string (&signature, 0, _dbus_string_get_length (&signature));
- _dbus_verbose_bytes_of_string (&body, 0, _dbus_string_get_length (&body));
- _dbus_assert_not_reached ("test failed");
- }
-
- _dbus_string_set_length (&signature, 0);
- _dbus_string_set_length (&body, 0);
- ++sequence;
- }
-
- _dbus_string_free (&signature);
- _dbus_string_free (&body);
- }
-
- return TRUE;
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.c
deleted file mode 100644
index 9187a3e985..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.c
+++ /dev/null
@@ -1,1259 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-validate.c Validation routines for marshaled data
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-marshal-validate.h"
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-signature.h"
-#include "dbus-string.h"
-
-/**
- * @addtogroup DBusMarshal
- *
- * @{
- */
-
-/**
- * Verifies that the range of type_str from type_pos to type_end is a
- * valid signature. If this function returns #TRUE, it will be safe
- * to iterate over the signature with a types-only #DBusTypeReader.
- * The range passed in should NOT include the terminating
- * nul/DBUS_TYPE_INVALID.
- *
- * @param type_str the string
- * @param type_pos where the typecodes start
- * @param len length of typecodes
- * @returns #DBUS_VALID if valid, reason why invalid otherwise
- */
-DBusValidity
-_dbus_validate_signature_with_reason (const DBusString *type_str,
- int type_pos,
- int len)
-{
- const unsigned char *p;
- const unsigned char *end;
- int last;
- int struct_depth;
- int array_depth;
- int dict_entry_depth;
- DBusValidity result;
-
- int element_count;
- DBusList *element_count_stack;
-
- result = DBUS_VALID;
- element_count_stack = NULL;
-
- if (!_dbus_list_append (&element_count_stack, _DBUS_INT_TO_POINTER (0)))
- {
- result = DBUS_VALIDITY_UNKNOWN_OOM_ERROR;
- goto out;
- }
-
- _dbus_assert (type_str != NULL);
- _dbus_assert (type_pos < _DBUS_INT32_MAX - len);
- _dbus_assert (len >= 0);
- _dbus_assert (type_pos >= 0);
-
- if (len > DBUS_MAXIMUM_SIGNATURE_LENGTH)
- {
- result = DBUS_INVALID_SIGNATURE_TOO_LONG;
- goto out;
- }
-
- p = _dbus_string_get_const_data_len (type_str, type_pos, 0);
-
- end = _dbus_string_get_const_data_len (type_str, type_pos + len, 0);
- struct_depth = 0;
- array_depth = 0;
- dict_entry_depth = 0;
- last = DBUS_TYPE_INVALID;
-
- while (p != end)
- {
- switch (*p)
- {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- case DBUS_TYPE_SIGNATURE:
- case DBUS_TYPE_VARIANT:
- break;
-
- case DBUS_TYPE_ARRAY:
- array_depth += 1;
- if (array_depth > DBUS_MAXIMUM_TYPE_RECURSION_DEPTH)
- {
- result = DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION;
- goto out;
- }
- break;
-
- case DBUS_STRUCT_BEGIN_CHAR:
- struct_depth += 1;
-
- if (struct_depth > DBUS_MAXIMUM_TYPE_RECURSION_DEPTH)
- {
- result = DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION;
- goto out;
- }
-
- if (!_dbus_list_append (&element_count_stack,
- _DBUS_INT_TO_POINTER (0)))
- {
- result = DBUS_VALIDITY_UNKNOWN_OOM_ERROR;
- goto out;
- }
-
- break;
-
- case DBUS_STRUCT_END_CHAR:
- if (struct_depth == 0)
- {
- result = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
- goto out;
- }
-
- if (last == DBUS_STRUCT_BEGIN_CHAR)
- {
- result = DBUS_INVALID_STRUCT_HAS_NO_FIELDS;
- goto out;
- }
-
- _dbus_list_pop_last (&element_count_stack);
-
- struct_depth -= 1;
- break;
-
- case DBUS_DICT_ENTRY_BEGIN_CHAR:
- if (last != DBUS_TYPE_ARRAY)
- {
- result = DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY;
- goto out;
- }
-
- dict_entry_depth += 1;
-
- if (dict_entry_depth > DBUS_MAXIMUM_TYPE_RECURSION_DEPTH)
- {
- result = DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION;
- goto out;
- }
-
- if (!_dbus_list_append (&element_count_stack,
- _DBUS_INT_TO_POINTER (0)))
- {
- result = DBUS_VALIDITY_UNKNOWN_OOM_ERROR;
- goto out;
- }
-
- break;
-
- case DBUS_DICT_ENTRY_END_CHAR:
- if (dict_entry_depth == 0)
- {
- result = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
- goto out;
- }
-
- dict_entry_depth -= 1;
-
- element_count =
- _DBUS_POINTER_TO_INT (_dbus_list_pop_last (&element_count_stack));
-
- if (element_count != 2)
- {
- if (element_count == 0)
- result = DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS;
- else if (element_count == 1)
- result = DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD;
- else
- result = DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS;
-
- goto out;
- }
- break;
-
- case DBUS_TYPE_STRUCT: /* doesn't appear in signatures */
- case DBUS_TYPE_DICT_ENTRY: /* ditto */
- default:
- result = DBUS_INVALID_UNKNOWN_TYPECODE;
- goto out;
- }
-
- if (*p != DBUS_TYPE_ARRAY &&
- *p != DBUS_DICT_ENTRY_BEGIN_CHAR &&
- *p != DBUS_STRUCT_BEGIN_CHAR)
- {
- element_count =
- _DBUS_POINTER_TO_INT (_dbus_list_pop_last (&element_count_stack));
-
- ++element_count;
-
- if (!_dbus_list_append (&element_count_stack,
- _DBUS_INT_TO_POINTER (element_count)))
- {
- result = DBUS_VALIDITY_UNKNOWN_OOM_ERROR;
- goto out;
- }
- }
-
- if (array_depth > 0)
- {
- if (*p == DBUS_TYPE_ARRAY && p != end)
- {
- const char *p1;
- p1 = p + 1;
- if (*p1 == DBUS_STRUCT_END_CHAR ||
- *p1 == DBUS_DICT_ENTRY_END_CHAR)
- {
- result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
- goto out;
- }
- }
- else
- {
- array_depth = 0;
- }
- }
-
- if (last == DBUS_DICT_ENTRY_BEGIN_CHAR)
- {
- if (!(dbus_type_is_valid (*p) && dbus_type_is_basic (*p)))
- {
- result = DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE;
- goto out;
- }
- }
-
- last = *p;
- ++p;
- }
-
-
- if (array_depth > 0)
- {
- result = DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE;
- goto out;
- }
-
- if (struct_depth > 0)
- {
- result = DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED;
- goto out;
- }
-
- if (dict_entry_depth > 0)
- {
- result = DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED;
- goto out;
- }
-
- _dbus_assert (last != DBUS_TYPE_ARRAY);
- _dbus_assert (last != DBUS_STRUCT_BEGIN_CHAR);
- _dbus_assert (last != DBUS_DICT_ENTRY_BEGIN_CHAR);
-
- result = DBUS_VALID;
-
-out:
- _dbus_list_clear (&element_count_stack);
- return result;
-}
-
-/* note: this function is also used to validate the header's values,
- * since the header is a valid body with a particular signature.
- */
-static DBusValidity
-validate_body_helper (DBusTypeReader *reader,
- int byte_order,
- dbus_bool_t walk_reader_to_end,
- int total_depth,
- const unsigned char *p,
- const unsigned char *end,
- const unsigned char **new_p)
-{
- int current_type;
-
- /* The spec allows arrays and structs to each nest 32, for total
- * nesting of 2*32. We want to impose the same limit on "dynamic"
- * value nesting (not visible in the signature) which is introduced
- * by DBUS_TYPE_VARIANT.
- */
- if (total_depth > (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH * 2))
- {
- return DBUS_INVALID_NESTED_TOO_DEEPLY;
- }
-
- while ((current_type = _dbus_type_reader_get_current_type (reader)) != DBUS_TYPE_INVALID)
- {
- const unsigned char *a;
- int alignment;
-
-#if 0
- _dbus_verbose (" validating value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
- _dbus_type_to_string (current_type), reader, reader->type_pos, p, end,
- (int) (end - p));
-#endif
-
- /* Guarantee that p has one byte to look at */
- if (p == end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
-
- switch (current_type)
- {
- case DBUS_TYPE_BYTE:
- ++p;
- break;
-
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_UNIX_FD:
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- alignment = _dbus_type_get_alignment (current_type);
- a = _DBUS_ALIGN_ADDRESS (p, alignment);
- if (a >= end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
- while (p != a)
- {
- if (*p != '\0')
- return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- ++p;
- }
-
- if (current_type == DBUS_TYPE_BOOLEAN)
- {
- dbus_uint32_t v = _dbus_unpack_uint32 (byte_order,
- p);
- if (!(v == 0 || v == 1))
- return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
- }
-
- p += alignment;
- break;
-
- case DBUS_TYPE_ARRAY:
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- {
- dbus_uint32_t claimed_len;
-
- a = _DBUS_ALIGN_ADDRESS (p, 4);
- if (a + 4 > end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
- while (p != a)
- {
- if (*p != '\0')
- return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- ++p;
- }
-
- claimed_len = _dbus_unpack_uint32 (byte_order, p);
- p += 4;
-
- /* p may now be == end */
- _dbus_assert (p <= end);
-
- if (current_type == DBUS_TYPE_ARRAY)
- {
- int array_elem_type = _dbus_type_reader_get_element_type (reader);
-
- if (!dbus_type_is_valid (array_elem_type))
- {
- return DBUS_INVALID_UNKNOWN_TYPECODE;
- }
-
- alignment = _dbus_type_get_alignment (array_elem_type);
-
- a = _DBUS_ALIGN_ADDRESS (p, alignment);
-
- /* a may now be == end */
- if (a > end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
-
- while (p != a)
- {
- if (*p != '\0')
- return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- ++p;
- }
- }
-
- if (claimed_len > (unsigned long) (end - p))
- return DBUS_INVALID_LENGTH_OUT_OF_BOUNDS;
-
- if (current_type == DBUS_TYPE_OBJECT_PATH)
- {
- DBusString str;
- _dbus_string_init_const_len (&str, p, claimed_len);
- if (!_dbus_validate_path (&str, 0,
- _dbus_string_get_length (&str)))
- return DBUS_INVALID_BAD_PATH;
-
- p += claimed_len;
- }
- else if (current_type == DBUS_TYPE_STRING)
- {
- DBusString str;
- _dbus_string_init_const_len (&str, p, claimed_len);
- if (!_dbus_string_validate_utf8 (&str, 0,
- _dbus_string_get_length (&str)))
- return DBUS_INVALID_BAD_UTF8_IN_STRING;
-
- p += claimed_len;
- }
- else if (current_type == DBUS_TYPE_ARRAY && claimed_len > 0)
- {
- DBusTypeReader sub;
- DBusValidity validity;
- const unsigned char *array_end;
- int array_elem_type;
-
- if (claimed_len > DBUS_MAXIMUM_ARRAY_LENGTH)
- return DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM;
-
- /* Remember that the reader is types only, so we can't
- * use it to iterate over elements. It stays the same
- * for all elements.
- */
- _dbus_type_reader_recurse (reader, &sub);
-
- array_end = p + claimed_len;
-
- array_elem_type = _dbus_type_reader_get_element_type (reader);
-
- /* avoid recursive call to validate_body_helper if this is an array
- * of fixed-size elements
- */
- if (dbus_type_is_fixed (array_elem_type))
- {
- /* bools need to be handled differently, because they can
- * have an invalid value
- */
- if (array_elem_type == DBUS_TYPE_BOOLEAN)
- {
- dbus_uint32_t v;
- alignment = _dbus_type_get_alignment (array_elem_type);
-
- while (p < array_end)
- {
- v = _dbus_unpack_uint32 (byte_order, p);
-
- if (!(v == 0 || v == 1))
- return DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE;
-
- p += alignment;
- }
- }
-
- else
- {
- p = array_end;
- }
- }
-
- else
- {
- while (p < array_end)
- {
- validity = validate_body_helper (&sub, byte_order, FALSE,
- total_depth + 1,
- p, end, &p);
- if (validity != DBUS_VALID)
- return validity;
- }
- }
-
- if (p != array_end)
- return DBUS_INVALID_ARRAY_LENGTH_INCORRECT;
- }
-
- /* check nul termination */
- if (current_type != DBUS_TYPE_ARRAY)
- {
- if (p == end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
-
- if (*p != '\0')
- return DBUS_INVALID_STRING_MISSING_NUL;
- ++p;
- }
- }
- break;
-
- case DBUS_TYPE_SIGNATURE:
- {
- dbus_uint32_t claimed_len;
- DBusString str;
- DBusValidity validity;
-
- claimed_len = *p;
- ++p;
-
- /* 1 is for nul termination */
- if (claimed_len + 1 > (unsigned long) (end - p))
- return DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
-
- _dbus_string_init_const_len (&str, p, claimed_len);
- validity =
- _dbus_validate_signature_with_reason (&str, 0,
- _dbus_string_get_length (&str));
-
- if (validity != DBUS_VALID)
- return validity;
-
- p += claimed_len;
-
- _dbus_assert (p < end);
- if (*p != DBUS_TYPE_INVALID)
- return DBUS_INVALID_SIGNATURE_MISSING_NUL;
-
- ++p;
-
- _dbus_verbose ("p = %p end = %p claimed_len %u\n", p, end, claimed_len);
- }
- break;
-
- case DBUS_TYPE_VARIANT:
- {
- /* 1 byte sig len, sig typecodes, align to
- * contained-type-boundary, values.
- */
-
- /* In addition to normal signature validation, we need to be sure
- * the signature contains only a single (possibly container) type.
- */
- dbus_uint32_t claimed_len;
- DBusString sig;
- DBusTypeReader sub;
- DBusValidity validity;
- int contained_alignment;
- int contained_type;
- DBusValidity reason;
-
- claimed_len = *p;
- ++p;
-
- /* + 1 for nul */
- if (claimed_len + 1 > (unsigned long) (end - p))
- return DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS;
-
- _dbus_string_init_const_len (&sig, p, claimed_len);
- reason = _dbus_validate_signature_with_reason (&sig, 0,
- _dbus_string_get_length (&sig));
- if (!(reason == DBUS_VALID))
- {
- if (reason == DBUS_VALIDITY_UNKNOWN_OOM_ERROR)
- return reason;
- else
- return DBUS_INVALID_VARIANT_SIGNATURE_BAD;
- }
-
- p += claimed_len;
-
- if (*p != DBUS_TYPE_INVALID)
- return DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL;
- ++p;
-
- contained_type = _dbus_first_type_in_signature (&sig, 0);
- if (contained_type == DBUS_TYPE_INVALID)
- return DBUS_INVALID_VARIANT_SIGNATURE_EMPTY;
-
- contained_alignment = _dbus_type_get_alignment (contained_type);
-
- a = _DBUS_ALIGN_ADDRESS (p, contained_alignment);
- if (a > end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
- while (p != a)
- {
- if (*p != '\0')
- return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- ++p;
- }
-
- _dbus_type_reader_init_types_only (&sub, &sig, 0);
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) != DBUS_TYPE_INVALID);
-
- validity = validate_body_helper (&sub, byte_order, FALSE,
- total_depth + 1,
- p, end, &p);
- if (validity != DBUS_VALID)
- return validity;
-
- if (_dbus_type_reader_next (&sub))
- return DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES;
-
- _dbus_assert (_dbus_type_reader_get_current_type (&sub) == DBUS_TYPE_INVALID);
- }
- break;
-
- case DBUS_TYPE_DICT_ENTRY:
- case DBUS_TYPE_STRUCT:
- {
- DBusTypeReader sub;
- DBusValidity validity;
-
- a = _DBUS_ALIGN_ADDRESS (p, 8);
- if (a > end)
- return DBUS_INVALID_NOT_ENOUGH_DATA;
- while (p != a)
- {
- if (*p != '\0')
- return DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL;
- ++p;
- }
-
- _dbus_type_reader_recurse (reader, &sub);
-
- validity = validate_body_helper (&sub, byte_order, TRUE,
- total_depth + 1,
- p, end, &p);
- if (validity != DBUS_VALID)
- return validity;
- }
- break;
-
- default:
- _dbus_assert_not_reached ("invalid typecode in supposedly-validated signature");
- break;
- }
-
-#if 0
- _dbus_verbose (" validated value of type %s type reader %p type_pos %d p %p end %p %d remain\n",
- _dbus_type_to_string (current_type), reader, reader->type_pos, p, end,
- (int) (end - p));
-#endif
-
- if (p > end)
- {
- _dbus_verbose ("not enough data!!! p = %p end = %p end-p = %d\n",
- p, end, (int) (end - p));
- return DBUS_INVALID_NOT_ENOUGH_DATA;
- }
-
- if (walk_reader_to_end)
- _dbus_type_reader_next (reader);
- else
- break;
- }
-
- if (new_p)
- *new_p = p;
-
- return DBUS_VALID;
-}
-
-/**
- * Verifies that the range of value_str from value_pos to value_end is
- * a legitimate value of type expected_signature. If this function
- * returns #TRUE, it will be safe to iterate over the values with
- * #DBusTypeReader. The signature is assumed to be already valid.
- *
- * If bytes_remaining is not #NULL, then leftover bytes will be stored
- * there and #DBUS_VALID returned. If it is #NULL, then
- * #DBUS_INVALID_TOO_MUCH_DATA will be returned if bytes are left
- * over.
- *
- * @param expected_signature the expected types in the value_str
- * @param expected_signature_start where in expected_signature is the signature
- * @param byte_order the byte order
- * @param bytes_remaining place to store leftover bytes
- * @param value_str the string containing the body
- * @param value_pos where the values start
- * @param len length of values after value_pos
- * @returns #DBUS_VALID if valid, reason why invalid otherwise
- */
-DBusValidity
-_dbus_validate_body_with_reason (const DBusString *expected_signature,
- int expected_signature_start,
- int byte_order,
- int *bytes_remaining,
- const DBusString *value_str,
- int value_pos,
- int len)
-{
- DBusTypeReader reader;
- const unsigned char *p;
- const unsigned char *end;
- DBusValidity validity;
-
- _dbus_assert (len >= 0);
- _dbus_assert (value_pos >= 0);
- _dbus_assert (value_pos <= _dbus_string_get_length (value_str) - len);
-
- _dbus_verbose ("validating body from pos %d len %d sig '%s'\n",
- value_pos, len, _dbus_string_get_const_data_len (expected_signature,
- expected_signature_start,
- 0));
-
- _dbus_type_reader_init_types_only (&reader,
- expected_signature, expected_signature_start);
-
- p = _dbus_string_get_const_data_len (value_str, value_pos, len);
- end = p + len;
-
- validity = validate_body_helper (&reader, byte_order, TRUE, 0, p, end, &p);
- if (validity != DBUS_VALID)
- return validity;
-
- if (bytes_remaining)
- {
- *bytes_remaining = end - p;
- return DBUS_VALID;
- }
- else if (p < end)
- return DBUS_INVALID_TOO_MUCH_DATA;
- else
- {
- _dbus_assert (p == end);
- return DBUS_VALID;
- }
-}
-
-/**
- * Determine wether the given character is valid as the first character
- * in a name.
- */
-#define VALID_INITIAL_NAME_CHARACTER(c) \
- ( ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
- * Determine wether the given character is valid as a second or later
- * character in a name
- */
-#define VALID_NAME_CHARACTER(c) \
- ( ((c) >= '0' && (c) <= '9') || \
- ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
- * Checks that the given range of the string is a valid object path
- * name in the D-Bus protocol. Part of the validation ensures that
- * the object path contains only ASCII.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @todo change spec to disallow more things, such as spaces in the
- * path name
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_path (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *s;
- const unsigned char *end;
- const unsigned char *last_slash;
-
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= _dbus_string_get_length (str));
-
- if (len > _dbus_string_get_length (str) - start)
- return FALSE;
-
- if (len == 0)
- return FALSE;
-
- s = _dbus_string_get_const_data (str) + start;
- end = s + len;
-
- if (*s != '/')
- return FALSE;
- last_slash = s;
- ++s;
-
- while (s != end)
- {
- if (*s == '/')
- {
- if ((s - last_slash) < 2)
- return FALSE; /* no empty path components allowed */
-
- last_slash = s;
- }
- else
- {
- if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
- return FALSE;
- }
-
- ++s;
- }
-
- if ((end - last_slash) < 2 &&
- len > 1)
- return FALSE; /* trailing slash not allowed unless the string is "/" */
-
- return TRUE;
-}
-
-const char *
-_dbus_validity_to_error_message (DBusValidity validity)
-{
- switch (validity)
- {
- case DBUS_VALIDITY_UNKNOWN_OOM_ERROR: return "Out of memory";
- case DBUS_INVALID_FOR_UNKNOWN_REASON: return "Unknown reason";
- case DBUS_VALID_BUT_INCOMPLETE: return "Valid but incomplete";
- case DBUS_VALIDITY_UNKNOWN: return "Validity unknown";
- case DBUS_VALID: return "Valid";
- case DBUS_INVALID_UNKNOWN_TYPECODE: return "Unknown typecode";
- case DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE: return "Missing array element type";
- case DBUS_INVALID_SIGNATURE_TOO_LONG: return "Signature is too long";
- case DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION: return "Exceeded maximum array recursion";
- case DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION: return "Exceeded maximum struct recursion";
- case DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED: return "Struct ended but not started";
- case DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED: return "Struct started but not ended";
- case DBUS_INVALID_STRUCT_HAS_NO_FIELDS: return "Struct has no fields";
- case DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL: return "Alignment padding not null";
- case DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE: return "Boolean is not zero or one";
- case DBUS_INVALID_NOT_ENOUGH_DATA: return "Not enough data";
- case DBUS_INVALID_TOO_MUCH_DATA: return "Too much data";
- case DBUS_INVALID_BAD_BYTE_ORDER: return "Bad byte order";
- case DBUS_INVALID_BAD_PROTOCOL_VERSION: return "Bad protocol version";
- case DBUS_INVALID_BAD_MESSAGE_TYPE: return "Bad message type";
- case DBUS_INVALID_BAD_SERIAL: return "Bad serial";
- case DBUS_INVALID_INSANE_FIELDS_ARRAY_LENGTH: return "Insane fields array length";
- case DBUS_INVALID_INSANE_BODY_LENGTH: return "Insane body length";
- case DBUS_INVALID_MESSAGE_TOO_LONG: return "Message too long";
- case DBUS_INVALID_HEADER_FIELD_CODE: return "Header field code";
- case DBUS_INVALID_HEADER_FIELD_HAS_WRONG_TYPE: return "Header field has wrong type";
- case DBUS_INVALID_USES_LOCAL_INTERFACE: return "Uses local interface";
- case DBUS_INVALID_USES_LOCAL_PATH: return "Uses local path";
- case DBUS_INVALID_HEADER_FIELD_APPEARS_TWICE: return "Header field appears twice";
- case DBUS_INVALID_BAD_DESTINATION: return "Bad destination";
- case DBUS_INVALID_BAD_INTERFACE: return "Bad interface";
- case DBUS_INVALID_BAD_MEMBER: return "Bad member";
- case DBUS_INVALID_BAD_ERROR_NAME: return "Bad error name";
- case DBUS_INVALID_BAD_SENDER: return "Bad sender";
- case DBUS_INVALID_MISSING_PATH: return "Missing path";
- case DBUS_INVALID_MISSING_INTERFACE: return "Missing interface";
- case DBUS_INVALID_MISSING_MEMBER: return "Missing member";
- case DBUS_INVALID_MISSING_ERROR_NAME: return "Missing error name";
- case DBUS_INVALID_MISSING_REPLY_SERIAL: return "Missing reply serial";
- case DBUS_INVALID_LENGTH_OUT_OF_BOUNDS: return "Length out of bounds";
- case DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM: return "Array length exceeds maximum";
- case DBUS_INVALID_BAD_PATH: return "Bad path";
- case DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS: return "Signature length out of bounds";
- case DBUS_INVALID_BAD_UTF8_IN_STRING: return "Bad utf8 in string";
- case DBUS_INVALID_ARRAY_LENGTH_INCORRECT: return "Array length incorrect";
- case DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS: return "Variant signature length out of bounds";
- case DBUS_INVALID_VARIANT_SIGNATURE_BAD: return "Variant signature bad";
- case DBUS_INVALID_VARIANT_SIGNATURE_EMPTY: return "Variant signature empty";
- case DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES: return "Variant signature specifies multiple values";
- case DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL: return "Variant signature missing nul";
- case DBUS_INVALID_STRING_MISSING_NUL: return "String missing nul";
- case DBUS_INVALID_SIGNATURE_MISSING_NUL: return "Signature missing nul";
- case DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION: return "Exceeded maximum dict entry recursion";
- case DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED: return "Dict entry ended but not started";
- case DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED: return "Dict entry started but not ended";
- case DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS: return "Dict entry has no fields";
- case DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD: return "Dict entry has only one field";
- case DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS: return "Dict entry has too many fields";
- case DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY: return "Dict entry not inside array";
- case DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE: return "Dict key must be basic type";
- case DBUS_INVALID_NESTED_TOO_DEEPLY: return "Variants cannot be used to create a hugely recursive tree of values";
- default:
- return "Invalid";
- }
-}
-
-/**
- * Checks that the given range of the string is a valid interface name
- * in the D-Bus protocol. This includes a length restriction and an
- * ASCII subset, see the specification.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_interface (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *s;
- const unsigned char *end;
- const unsigned char *iface;
- const unsigned char *last_dot;
-
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= _dbus_string_get_length (str));
-
- if (len > _dbus_string_get_length (str) - start)
- return FALSE;
-
- if (len > DBUS_MAXIMUM_NAME_LENGTH)
- return FALSE;
-
- if (len == 0)
- return FALSE;
-
- last_dot = NULL;
- iface = _dbus_string_get_const_data (str) + start;
- end = iface + len;
- s = iface;
-
- /* check special cases of first char so it doesn't have to be done
- * in the loop. Note we know len > 0
- */
- if (_DBUS_UNLIKELY (*s == '.')) /* disallow starting with a . */
- return FALSE;
- else if (_DBUS_UNLIKELY (!VALID_INITIAL_NAME_CHARACTER (*s)))
- return FALSE;
- else
- ++s;
-
- while (s != end)
- {
- if (*s == '.')
- {
- if (_DBUS_UNLIKELY ((s + 1) == end))
- return FALSE;
- else if (_DBUS_UNLIKELY (!VALID_INITIAL_NAME_CHARACTER (*(s + 1))))
- return FALSE;
- last_dot = s;
- ++s; /* we just validated the next char, so skip two */
- }
- else if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
- {
- return FALSE;
- }
-
- ++s;
- }
-
- if (_DBUS_UNLIKELY (last_dot == NULL))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Checks that the given range of the string is a valid member name
- * in the D-Bus protocol. This includes a length restriction, etc.,
- * see the specification.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_member (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *s;
- const unsigned char *end;
- const unsigned char *member;
-
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= _dbus_string_get_length (str));
-
- if (len > _dbus_string_get_length (str) - start)
- return FALSE;
-
- if (len > DBUS_MAXIMUM_NAME_LENGTH)
- return FALSE;
-
- if (len == 0)
- return FALSE;
-
- member = _dbus_string_get_const_data (str) + start;
- end = member + len;
- s = member;
-
- /* check special cases of first char so it doesn't have to be done
- * in the loop. Note we know len > 0
- */
-
- if (_DBUS_UNLIKELY (!VALID_INITIAL_NAME_CHARACTER (*s)))
- return FALSE;
- else
- ++s;
-
- while (s != end)
- {
- if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
- {
- return FALSE;
- }
-
- ++s;
- }
-
- return TRUE;
-}
-
-/**
- * Checks that the given range of the string is a valid error name
- * in the D-Bus protocol. This includes a length restriction, etc.,
- * see the specification.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_error_name (const DBusString *str,
- int start,
- int len)
-{
- /* Same restrictions as interface name at the moment */
- return _dbus_validate_interface (str, start, len);
-}
-
-/**
- * Determine wether the given character is valid as the first character
- * in a bus name.
- */
-#define VALID_INITIAL_BUS_NAME_CHARACTER(c) \
- ( ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') || ((c) == '-'))
-
-/**
- * Determine wether the given character is valid as a second or later
- * character in a bus name
- */
-#define VALID_BUS_NAME_CHARACTER(c) \
- ( ((c) >= '0' && (c) <= '9') || \
- ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') || ((c) == '-'))
-
-static dbus_bool_t
-_dbus_validate_bus_name_full (const DBusString *str,
- int start,
- int len,
- dbus_bool_t is_namespace)
-{
- const unsigned char *s;
- const unsigned char *end;
- const unsigned char *iface;
- const unsigned char *last_dot;
-
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= _dbus_string_get_length (str));
-
- if (len > _dbus_string_get_length (str) - start)
- return FALSE;
-
- if (len > DBUS_MAXIMUM_NAME_LENGTH)
- return FALSE;
-
- if (len == 0)
- return FALSE;
-
- last_dot = NULL;
- iface = _dbus_string_get_const_data (str) + start;
- end = iface + len;
- s = iface;
-
- /* check special cases of first char so it doesn't have to be done
- * in the loop. Note we know len > 0
- */
- if (*s == ':')
- {
- /* unique name */
- ++s;
- while (s != end)
- {
- if (*s == '.')
- {
- if (_DBUS_UNLIKELY ((s + 1) == end))
- return FALSE;
- if (_DBUS_UNLIKELY (!VALID_BUS_NAME_CHARACTER (*(s + 1))))
- return FALSE;
- ++s; /* we just validated the next char, so skip two */
- }
- else if (_DBUS_UNLIKELY (!VALID_BUS_NAME_CHARACTER (*s)))
- {
- return FALSE;
- }
-
- ++s;
- }
-
- return TRUE;
- }
- else if (_DBUS_UNLIKELY (*s == '.')) /* disallow starting with a . */
- return FALSE;
- else if (_DBUS_UNLIKELY (!VALID_INITIAL_BUS_NAME_CHARACTER (*s)))
- return FALSE;
- else
- ++s;
-
- while (s != end)
- {
- if (*s == '.')
- {
- if (_DBUS_UNLIKELY ((s + 1) == end))
- return FALSE;
- else if (_DBUS_UNLIKELY (!VALID_INITIAL_BUS_NAME_CHARACTER (*(s + 1))))
- return FALSE;
- last_dot = s;
- ++s; /* we just validated the next char, so skip two */
- }
- else if (_DBUS_UNLIKELY (!VALID_BUS_NAME_CHARACTER (*s)))
- {
- return FALSE;
- }
-
- ++s;
- }
-
- if (!is_namespace && _DBUS_UNLIKELY (last_dot == NULL))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Checks that the given range of the string is a valid bus name in
- * the D-Bus protocol. This includes a length restriction, etc., see
- * the specification.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_bus_name (const DBusString *str,
- int start,
- int len)
-{
- return _dbus_validate_bus_name_full (str, start, len, FALSE);
-}
-
-/**
- * Checks that the given range of the string is a prefix of a valid bus name in
- * the D-Bus protocol. Unlike _dbus_validate_bus_name(), this accepts strings
- * with only one period-separated component.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid name
- */
-dbus_bool_t
-_dbus_validate_bus_namespace (const DBusString *str,
- int start,
- int len)
-{
- return _dbus_validate_bus_name_full (str, start, len, TRUE);
-}
-
-/**
- * Checks that the given range of the string is a valid message type
- * signature in the D-Bus protocol.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is a valid signature
- */
-dbus_bool_t
-_dbus_validate_signature (const DBusString *str,
- int start,
- int len)
-{
- _dbus_assert (start >= 0);
- _dbus_assert (start <= _dbus_string_get_length (str));
- _dbus_assert (len >= 0);
-
- if (len > _dbus_string_get_length (str) - start)
- return FALSE;
-
- return _dbus_validate_signature_with_reason (str, start, len) == DBUS_VALID;
-}
-
-/** define _dbus_check_is_valid_path() */
-DEFINE_DBUS_NAME_CHECK(path)
-/** define _dbus_check_is_valid_interface() */
-DEFINE_DBUS_NAME_CHECK(interface)
-/** define _dbus_check_is_valid_member() */
-DEFINE_DBUS_NAME_CHECK(member)
-/** define _dbus_check_is_valid_error_name() */
-DEFINE_DBUS_NAME_CHECK(error_name)
-/** define _dbus_check_is_valid_bus_name() */
-DEFINE_DBUS_NAME_CHECK(bus_name)
-/** define _dbus_check_is_valid_signature() */
-DEFINE_DBUS_NAME_CHECK(signature)
-/** define _dbus_check_is_valid_utf8() */
-DEFINE_DBUS_NAME_CHECK(utf8)
-
-/** @} */
-
-/* tests in dbus-marshal-validate-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.h
deleted file mode 100644
index 06434201a2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-marshal-validate.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-marshal-validate.h Validation routines for marshaled data
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MARSHAL_VALIDATE_H
-#define DBUS_MARSHAL_VALIDATE_H
-
-/**
- * @addtogroup DBusMarshal
- *
- * @{
- */
-
-/**
- * This is used rather than a bool for high visibility
- */
-typedef enum
-{
- DBUS_VALIDATION_MODE_WE_TRUST_THIS_DATA_ABSOLUTELY,
- DBUS_VALIDATION_MODE_DATA_IS_UNTRUSTED
-} DBusValidationMode;
-
-/**
- * This is primarily used in unit testing, so we can verify that each
- * invalid message is invalid for the expected reasons. Thus we really
- * want a distinct enum value for every codepath leaving the validator
- * functions. Enum values are specified manually for ease of debugging
- * (so you can see the enum value given a printf)
- */
-typedef enum
-{
-#define _DBUS_NEGATIVE_VALIDITY_COUNT 4
- DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4, /**< can't determine validity due to OOM */
- DBUS_INVALID_FOR_UNKNOWN_REASON = -3,
- DBUS_VALID_BUT_INCOMPLETE = -2,
- DBUS_VALIDITY_UNKNOWN = -1,
- DBUS_VALID = 0, /**< the data is valid */
- DBUS_INVALID_UNKNOWN_TYPECODE = 1,
- DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE = 2,
- DBUS_INVALID_SIGNATURE_TOO_LONG = 3, /* this one is impossible right now since
- * you can't put a too-long value in a byte
- */
- DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION = 4,
- DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION = 5,
- DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED = 6,
- DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED = 7,
- DBUS_INVALID_STRUCT_HAS_NO_FIELDS = 8,
- DBUS_INVALID_ALIGNMENT_PADDING_NOT_NUL = 9,
- DBUS_INVALID_BOOLEAN_NOT_ZERO_OR_ONE = 10,
- DBUS_INVALID_NOT_ENOUGH_DATA = 11,
- DBUS_INVALID_TOO_MUCH_DATA = 12, /**< trailing junk makes it invalid */
- DBUS_INVALID_BAD_BYTE_ORDER = 13,
- DBUS_INVALID_BAD_PROTOCOL_VERSION = 14,
- DBUS_INVALID_BAD_MESSAGE_TYPE = 15,
- DBUS_INVALID_BAD_SERIAL = 16,
- DBUS_INVALID_INSANE_FIELDS_ARRAY_LENGTH = 17,
- DBUS_INVALID_INSANE_BODY_LENGTH = 18,
- DBUS_INVALID_MESSAGE_TOO_LONG = 19,
- DBUS_INVALID_HEADER_FIELD_CODE = 20,
- DBUS_INVALID_HEADER_FIELD_HAS_WRONG_TYPE = 21,
- DBUS_INVALID_USES_LOCAL_INTERFACE = 22,
- DBUS_INVALID_USES_LOCAL_PATH = 23,
- DBUS_INVALID_HEADER_FIELD_APPEARS_TWICE = 24,
- DBUS_INVALID_BAD_DESTINATION = 25,
- DBUS_INVALID_BAD_INTERFACE = 26,
- DBUS_INVALID_BAD_MEMBER = 27,
- DBUS_INVALID_BAD_ERROR_NAME = 28,
- DBUS_INVALID_BAD_SENDER = 29,
- DBUS_INVALID_MISSING_PATH = 30,
- DBUS_INVALID_MISSING_INTERFACE = 31,
- DBUS_INVALID_MISSING_MEMBER = 32,
- DBUS_INVALID_MISSING_ERROR_NAME = 33,
- DBUS_INVALID_MISSING_REPLY_SERIAL = 34,
- DBUS_INVALID_LENGTH_OUT_OF_BOUNDS = 35,
- DBUS_INVALID_ARRAY_LENGTH_EXCEEDS_MAXIMUM = 36,
- DBUS_INVALID_BAD_PATH = 37,
- DBUS_INVALID_SIGNATURE_LENGTH_OUT_OF_BOUNDS = 38,
- DBUS_INVALID_BAD_UTF8_IN_STRING = 39,
- DBUS_INVALID_ARRAY_LENGTH_INCORRECT = 40,
- DBUS_INVALID_VARIANT_SIGNATURE_LENGTH_OUT_OF_BOUNDS = 41,
- DBUS_INVALID_VARIANT_SIGNATURE_BAD = 42,
- DBUS_INVALID_VARIANT_SIGNATURE_EMPTY = 43,
- DBUS_INVALID_VARIANT_SIGNATURE_SPECIFIES_MULTIPLE_VALUES = 44,
- DBUS_INVALID_VARIANT_SIGNATURE_MISSING_NUL = 45,
- DBUS_INVALID_STRING_MISSING_NUL = 46,
- DBUS_INVALID_SIGNATURE_MISSING_NUL = 47,
- DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION = 48,
- DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED = 49,
- DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED = 50,
- DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS = 51,
- DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD = 52,
- DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS = 53,
- DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY = 54,
- DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE = 55,
- DBUS_INVALID_MISSING_UNIX_FDS = 56,
- DBUS_INVALID_NESTED_TOO_DEEPLY = 57,
- DBUS_VALIDITY_LAST
-} DBusValidity;
-
-DBusValidity _dbus_validate_signature_with_reason (const DBusString *type_str,
- int type_pos,
- int len);
-DBusValidity _dbus_validate_body_with_reason (const DBusString *expected_signature,
- int expected_signature_start,
- int byte_order,
- int *bytes_remaining,
- const DBusString *value_str,
- int value_pos,
- int len);
-
-const char *_dbus_validity_to_error_message (DBusValidity validity);
-
-dbus_bool_t _dbus_validate_path (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_interface (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_member (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_error_name (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_bus_name (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_bus_namespace (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_validate_signature (const DBusString *str,
- int start,
- int len);
-/* just to have a name consistent with the above: */
-#define _dbus_validate_utf8(s,b,e) _dbus_string_validate_utf8 (s, b, e)
-
-#ifdef DBUS_DISABLE_CHECKS
-
-/* Be sure they don't exist, since we don't want to use them outside of checks
- * and so we want the compile failure.
- */
-#define DECLARE_DBUS_NAME_CHECK(what)
-#define DEFINE_DBUS_NAME_CHECK(what)
-
-#else /* !DBUS_DISABLE_CHECKS */
-
-/** A name check is used in _dbus_return_if_fail(), it's not suitable
- * for validating untrusted data. use _dbus_validate_whatever for that.
- */
-#define DECLARE_DBUS_NAME_CHECK(what) \
-dbus_bool_t _dbus_check_is_valid_##what (const char *name)
-
-/** Define a name check to be used in _dbus_return_if_fail() statements.
- */
-#define DEFINE_DBUS_NAME_CHECK(what) \
-dbus_bool_t \
-_dbus_check_is_valid_##what (const char *name) \
-{ \
- DBusString str; \
- \
- if (name == NULL) \
- return FALSE; \
- \
- _dbus_string_init_const (&str, name); \
- return _dbus_validate_##what (&str, 0, \
- _dbus_string_get_length (&str)); \
-}
-#endif /* !DBUS_DISABLE_CHECKS */
-
-/** defines _dbus_check_is_valid_path() */
-DECLARE_DBUS_NAME_CHECK(path);
-/** defines _dbus_check_is_valid_interface() */
-DECLARE_DBUS_NAME_CHECK(interface);
-/** defines _dbus_check_is_valid_member() */
-DECLARE_DBUS_NAME_CHECK(member);
-/** defines _dbus_check_is_valid_error_name() */
-DECLARE_DBUS_NAME_CHECK(error_name);
-/** defines _dbus_check_is_valid_bus_name() */
-DECLARE_DBUS_NAME_CHECK(bus_name);
-/** defines _dbus_check_is_valid_signature() */
-DECLARE_DBUS_NAME_CHECK(signature);
-/** defines _dbus_check_is_valid_utf8() */
-DECLARE_DBUS_NAME_CHECK(utf8);
-
-/** @} */
-
-#endif /* DBUS_MARSHAL_VALIDATE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.c
deleted file mode 100644
index d59e8f8cdd..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.c
+++ /dev/null
@@ -1,952 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-memory.c D-Bus memory handling
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-memory.h"
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-list.h"
-#include "dbus-threads.h"
-#include <stdlib.h>
-
-/**
- * @defgroup DBusMemory Memory Allocation
- * @ingroup DBus
- * @brief dbus_malloc(), dbus_free(), etc.
- *
- * Functions and macros related to allocating and releasing
- * blocks of memory.
- *
- */
-
-/**
- * @defgroup DBusMemoryInternals Memory allocation implementation details
- * @ingroup DBusInternals
- * @brief internals of dbus_malloc() etc.
- *
- * Implementation details related to allocating and releasing blocks
- * of memory.
- */
-
-/**
- * @addtogroup DBusMemory
- *
- * @{
- */
-
-/**
- * @def dbus_new
- *
- * Safe macro for using dbus_malloc(). Accepts the type
- * to allocate and the number of type instances to
- * allocate as arguments, and returns a memory block
- * cast to the desired type, instead of as a void*.
- *
- * @param type type name to allocate
- * @param count number of instances in the allocated array
- * @returns the new memory block or #NULL on failure
- */
-
-/**
- * @def dbus_new0
- *
- * Safe macro for using dbus_malloc0(). Accepts the type
- * to allocate and the number of type instances to
- * allocate as arguments, and returns a memory block
- * cast to the desired type, instead of as a void*.
- * The allocated array is initialized to all-bits-zero.
- *
- * @param type type name to allocate
- * @param count number of instances in the allocated array
- * @returns the new memory block or #NULL on failure
- */
-
-/**
- * @typedef DBusFreeFunction
- *
- * The type of a function which frees a block of memory.
- *
- * @param memory the memory to free
- */
-
-/** @} */ /* end of public API docs */
-
-/**
- * @addtogroup DBusMemoryInternals
- *
- * @{
- */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static dbus_bool_t debug_initialized = FALSE;
-static int fail_nth = -1;
-static size_t fail_size = 0;
-static int fail_alloc_counter = _DBUS_INT_MAX;
-static int n_failures_per_failure = 1;
-static int n_failures_this_failure = 0;
-static dbus_bool_t guards = FALSE;
-static dbus_bool_t disable_mem_pools = FALSE;
-static dbus_bool_t backtrace_on_fail_alloc = FALSE;
-static dbus_bool_t malloc_cannot_fail = FALSE;
-static DBusAtomic n_blocks_outstanding = {0};
-
-/** value stored in guard padding for debugging buffer overrun */
-#define GUARD_VALUE 0xdeadbeef
-/** size of the information about the block stored in guard mode */
-#define GUARD_INFO_SIZE 8
-/** size of the GUARD_VALUE-filled padding after the header info */
-#define GUARD_START_PAD 16
-/** size of the GUARD_VALUE-filled padding at the end of the block */
-#define GUARD_END_PAD 16
-/** size of stuff at start of block */
-#define GUARD_START_OFFSET (GUARD_START_PAD + GUARD_INFO_SIZE)
-/** total extra size over the requested allocation for guard stuff */
-#define GUARD_EXTRA_SIZE (GUARD_START_OFFSET + GUARD_END_PAD)
-
-static void
-_dbus_initialize_malloc_debug (void)
-{
- if (!debug_initialized)
- {
- debug_initialized = TRUE;
-
- if (_dbus_getenv ("DBUS_MALLOC_FAIL_NTH") != NULL)
- {
- fail_nth = atoi (_dbus_getenv ("DBUS_MALLOC_FAIL_NTH"));
- fail_alloc_counter = fail_nth;
- _dbus_verbose ("Will fail dbus_malloc every %d times\n", fail_nth);
- }
-
- if (_dbus_getenv ("DBUS_MALLOC_FAIL_GREATER_THAN") != NULL)
- {
- fail_size = atoi (_dbus_getenv ("DBUS_MALLOC_FAIL_GREATER_THAN"));
- _dbus_verbose ("Will fail mallocs over %ld bytes\n",
- (long) fail_size);
- }
-
- if (_dbus_getenv ("DBUS_MALLOC_GUARDS") != NULL)
- {
- guards = TRUE;
- _dbus_verbose ("Will use dbus_malloc guards\n");
- }
-
- if (_dbus_getenv ("DBUS_DISABLE_MEM_POOLS") != NULL)
- {
- disable_mem_pools = TRUE;
- _dbus_verbose ("Will disable memory pools\n");
- }
-
- if (_dbus_getenv ("DBUS_MALLOC_BACKTRACES") != NULL)
- {
- backtrace_on_fail_alloc = TRUE;
- _dbus_verbose ("Will backtrace on failing a dbus_malloc\n");
- }
-
- if (_dbus_getenv ("DBUS_MALLOC_CANNOT_FAIL") != NULL)
- {
- malloc_cannot_fail = TRUE;
- _dbus_verbose ("Will abort if system malloc() and friends fail\n");
- }
- }
-}
-
-/**
- * Whether to turn off mem pools, useful for leak checking.
- *
- * @returns #TRUE if mempools should not be used.
- */
-dbus_bool_t
-_dbus_disable_mem_pools (void)
-{
- _dbus_initialize_malloc_debug ();
- return disable_mem_pools;
-}
-
-/**
- * Sets the number of allocations until we simulate a failed
- * allocation. If set to 0, the next allocation to run
- * fails; if set to 1, one succeeds then the next fails; etc.
- * Set to _DBUS_INT_MAX to not fail anything.
- *
- * @param until_next_fail number of successful allocs before one fails
- */
-void
-_dbus_set_fail_alloc_counter (int until_next_fail)
-{
- _dbus_initialize_malloc_debug ();
-
- fail_alloc_counter = until_next_fail;
-
-#if 0
- _dbus_verbose ("Set fail alloc counter = %d\n", fail_alloc_counter);
-#endif
-}
-
-/**
- * Gets the number of successful allocs until we'll simulate
- * a failed alloc.
- *
- * @returns current counter value
- */
-int
-_dbus_get_fail_alloc_counter (void)
-{
- _dbus_initialize_malloc_debug ();
-
- return fail_alloc_counter;
-}
-
-/**
- * Sets how many mallocs to fail when the fail alloc counter reaches
- * 0.
- *
- * @param failures_per_failure number to fail
- */
-void
-_dbus_set_fail_alloc_failures (int failures_per_failure)
-{
- n_failures_per_failure = failures_per_failure;
-}
-
-/**
- * Gets the number of failures we'll have when the fail malloc
- * counter reaches 0.
- *
- * @returns number of failures planned
- */
-int
-_dbus_get_fail_alloc_failures (void)
-{
- return n_failures_per_failure;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Called when about to alloc some memory; if
- * it returns #TRUE, then the allocation should
- * fail. If it returns #FALSE, then the allocation
- * should not fail.
- *
- * @returns #TRUE if this alloc should fail
- */
-dbus_bool_t
-_dbus_decrement_fail_alloc_counter (void)
-{
- _dbus_initialize_malloc_debug ();
-#ifdef DBUS_WIN_FIXME
- {
- static dbus_bool_t called = 0;
-
- if (!called)
- {
- _dbus_verbose("TODO: memory allocation testing errors disabled for now\n");
- called = 1;
- }
- return FALSE;
- }
-#endif
-
- if (fail_alloc_counter <= 0)
- {
- if (backtrace_on_fail_alloc)
- _dbus_print_backtrace ();
-
- _dbus_verbose ("failure %d\n", n_failures_this_failure);
-
- n_failures_this_failure += 1;
- if (n_failures_this_failure >= n_failures_per_failure)
- {
- if (fail_nth >= 0)
- fail_alloc_counter = fail_nth;
- else
- fail_alloc_counter = _DBUS_INT_MAX;
-
- n_failures_this_failure = 0;
-
- _dbus_verbose ("reset fail alloc counter to %d\n", fail_alloc_counter);
- }
-
- return TRUE;
- }
- else
- {
- fail_alloc_counter -= 1;
- return FALSE;
- }
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-/**
- * Get the number of outstanding malloc()'d blocks.
- *
- * @returns number of blocks
- */
-int
-_dbus_get_malloc_blocks_outstanding (void)
-{
- return _dbus_atomic_get (&n_blocks_outstanding);
-}
-
-/**
- * Where the block came from.
- */
-typedef enum
-{
- SOURCE_UNKNOWN,
- SOURCE_MALLOC,
- SOURCE_REALLOC,
- SOURCE_MALLOC_ZERO,
- SOURCE_REALLOC_NULL
-} BlockSource;
-
-static const char*
-source_string (BlockSource source)
-{
- switch (source)
- {
- case SOURCE_UNKNOWN:
- return "unknown";
- case SOURCE_MALLOC:
- return "malloc";
- case SOURCE_REALLOC:
- return "realloc";
- case SOURCE_MALLOC_ZERO:
- return "malloc0";
- case SOURCE_REALLOC_NULL:
- return "realloc(NULL)";
- }
- _dbus_assert_not_reached ("Invalid malloc block source ID");
- return "invalid!";
-}
-
-static void
-check_guards (void *free_block,
- dbus_bool_t overwrite)
-{
- if (free_block != NULL)
- {
- unsigned char *block = ((unsigned char*)free_block) - GUARD_START_OFFSET;
- size_t requested_bytes = *(dbus_uint32_t*)block;
- BlockSource source = *(dbus_uint32_t*)(block + 4);
- unsigned int i;
- dbus_bool_t failed;
-
- failed = FALSE;
-
-#if 0
- _dbus_verbose ("Checking %d bytes request from source %s\n",
- requested_bytes, source_string (source));
-#endif
-
- i = GUARD_INFO_SIZE;
- while (i < GUARD_START_OFFSET)
- {
- dbus_uint32_t value = *(dbus_uint32_t*) &block[i];
- if (value != GUARD_VALUE)
- {
- _dbus_warn ("Block of %lu bytes from %s had start guard value 0x%ux at %d expected 0x%x\n",
- (long) requested_bytes, source_string (source),
- value, i, GUARD_VALUE);
- failed = TRUE;
- }
-
- i += 4;
- }
-
- i = GUARD_START_OFFSET + requested_bytes;
- while (i < (GUARD_START_OFFSET + requested_bytes + GUARD_END_PAD))
- {
- dbus_uint32_t value = *(dbus_uint32_t*) &block[i];
- if (value != GUARD_VALUE)
- {
- _dbus_warn ("Block of %lu bytes from %s had end guard value 0x%ux at %d expected 0x%x\n",
- (long) requested_bytes, source_string (source),
- value, i, GUARD_VALUE);
- failed = TRUE;
- }
-
- i += 4;
- }
-
- /* set memory to anything but nul bytes */
- if (overwrite)
- memset (free_block, 'g', requested_bytes);
-
- if (failed)
- _dbus_assert_not_reached ("guard value corruption");
- }
-}
-
-static void*
-set_guards (void *real_block,
- size_t requested_bytes,
- BlockSource source)
-{
- unsigned char *block = real_block;
- unsigned int i;
-
- if (block == NULL)
- return NULL;
-
- _dbus_assert (GUARD_START_OFFSET + GUARD_END_PAD == GUARD_EXTRA_SIZE);
-
- *((dbus_uint32_t*)block) = requested_bytes;
- *((dbus_uint32_t*)(block + 4)) = source;
-
- i = GUARD_INFO_SIZE;
- while (i < GUARD_START_OFFSET)
- {
- (*(dbus_uint32_t*) &block[i]) = GUARD_VALUE;
-
- i += 4;
- }
-
- i = GUARD_START_OFFSET + requested_bytes;
- while (i < (GUARD_START_OFFSET + requested_bytes + GUARD_END_PAD))
- {
- (*(dbus_uint32_t*) &block[i]) = GUARD_VALUE;
-
- i += 4;
- }
-
- check_guards (block + GUARD_START_OFFSET, FALSE);
-
- return block + GUARD_START_OFFSET;
-}
-
-#endif
-
-/** @} */ /* End of internals docs */
-
-
-/**
- * @addtogroup DBusMemory
- *
- * @{
- */
-
-/**
- * Allocates the given number of bytes, as with standard
- * malloc(). Guaranteed to return #NULL if bytes is zero
- * on all platforms. Returns #NULL if the allocation fails.
- * The memory must be released with dbus_free().
- *
- * dbus_malloc() memory is NOT safe to free with regular free() from
- * the C library. Free it with dbus_free() only.
- *
- * @param bytes number of bytes to allocate
- * @return allocated memory, or #NULL if the allocation fails.
- */
-void*
-dbus_malloc (size_t bytes)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- _dbus_initialize_malloc_debug ();
-
- if (_dbus_decrement_fail_alloc_counter ())
- {
- _dbus_verbose (" FAILING malloc of %ld bytes\n", (long) bytes);
- return NULL;
- }
-#endif
-
- if (bytes == 0) /* some system mallocs handle this, some don't */
- return NULL;
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- else if (fail_size != 0 && bytes > fail_size)
- return NULL;
- else if (guards)
- {
- void *block;
-
- block = malloc (bytes + GUARD_EXTRA_SIZE);
- if (block)
- {
- _dbus_atomic_inc (&n_blocks_outstanding);
- }
- else if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: malloc (%ld + %ld)\n",
- (long) bytes, (long) GUARD_EXTRA_SIZE);
- _dbus_abort ();
- }
-
- return set_guards (block, bytes, SOURCE_MALLOC);
- }
-#endif
- else
- {
- void *mem;
- mem = malloc (bytes);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (mem)
- {
- _dbus_atomic_inc (&n_blocks_outstanding);
- }
- else if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes);
- _dbus_abort ();
- }
-#endif
-
- return mem;
- }
-}
-
-/**
- * Allocates the given number of bytes, as with standard malloc(), but
- * all bytes are initialized to zero as with calloc(). Guaranteed to
- * return #NULL if bytes is zero on all platforms. Returns #NULL if the
- * allocation fails. The memory must be released with dbus_free().
- *
- * dbus_malloc0() memory is NOT safe to free with regular free() from
- * the C library. Free it with dbus_free() only.
- *
- * @param bytes number of bytes to allocate
- * @return allocated memory, or #NULL if the allocation fails.
- */
-void*
-dbus_malloc0 (size_t bytes)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- _dbus_initialize_malloc_debug ();
-
- if (_dbus_decrement_fail_alloc_counter ())
- {
- _dbus_verbose (" FAILING malloc0 of %ld bytes\n", (long) bytes);
-
- return NULL;
- }
-#endif
-
- if (bytes == 0)
- return NULL;
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- else if (fail_size != 0 && bytes > fail_size)
- return NULL;
- else if (guards)
- {
- void *block;
-
- block = calloc (bytes + GUARD_EXTRA_SIZE, 1);
-
- if (block)
- {
- _dbus_atomic_inc (&n_blocks_outstanding);
- }
- else if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: calloc (%ld + %ld, 1)\n",
- (long) bytes, (long) GUARD_EXTRA_SIZE);
- _dbus_abort ();
- }
-
- return set_guards (block, bytes, SOURCE_MALLOC_ZERO);
- }
-#endif
- else
- {
- void *mem;
- mem = calloc (bytes, 1);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (mem)
- {
- _dbus_atomic_inc (&n_blocks_outstanding);
- }
- else if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: calloc (%ld)\n", (long) bytes);
- _dbus_abort ();
- }
-#endif
-
- return mem;
- }
-}
-
-/**
- * Resizes a block of memory previously allocated by dbus_malloc() or
- * dbus_malloc0(). Guaranteed to free the memory and return #NULL if bytes
- * is zero on all platforms. Returns #NULL if the resize fails.
- * If the resize fails, the memory is not freed.
- *
- * @param memory block to be resized
- * @param bytes new size of the memory block
- * @return allocated memory, or #NULL if the resize fails.
- */
-void*
-dbus_realloc (void *memory,
- size_t bytes)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- _dbus_initialize_malloc_debug ();
-
- if (_dbus_decrement_fail_alloc_counter ())
- {
- _dbus_verbose (" FAILING realloc of %ld bytes\n", (long) bytes);
-
- return NULL;
- }
-#endif
-
- if (bytes == 0) /* guarantee this is safe */
- {
- dbus_free (memory);
- return NULL;
- }
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- else if (fail_size != 0 && bytes > fail_size)
- return NULL;
- else if (guards)
- {
- if (memory)
- {
- size_t old_bytes;
- void *block;
-
- check_guards (memory, FALSE);
-
- block = realloc (((unsigned char*)memory) - GUARD_START_OFFSET,
- bytes + GUARD_EXTRA_SIZE);
-
- if (block == NULL)
- {
- if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: realloc (%p, %ld + %ld)\n",
- memory, (long) bytes, (long) GUARD_EXTRA_SIZE);
- _dbus_abort ();
- }
-
- return NULL;
- }
-
- old_bytes = *(dbus_uint32_t*)block;
- if (bytes >= old_bytes)
- /* old guards shouldn't have moved */
- check_guards (((unsigned char*)block) + GUARD_START_OFFSET, FALSE);
-
- return set_guards (block, bytes, SOURCE_REALLOC);
- }
- else
- {
- void *block;
-
- block = malloc (bytes + GUARD_EXTRA_SIZE);
-
- if (block)
- {
- _dbus_atomic_inc (&n_blocks_outstanding);
- }
- else if (malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: malloc (%ld + %ld)\n",
- (long) bytes, (long) GUARD_EXTRA_SIZE);
- _dbus_abort ();
- }
-
- return set_guards (block, bytes, SOURCE_REALLOC_NULL);
- }
- }
-#endif
- else
- {
- void *mem;
- mem = realloc (memory, bytes);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (mem == NULL && malloc_cannot_fail)
- {
- _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes);
- _dbus_abort ();
- }
-
- if (memory == NULL && mem != NULL)
- _dbus_atomic_inc (&n_blocks_outstanding);
-#endif
- return mem;
- }
-}
-
-/**
- * Frees a block of memory previously allocated by dbus_malloc() or
- * dbus_malloc0(). If passed #NULL, does nothing.
- *
- * @param memory block to be freed
- */
-void
-dbus_free (void *memory)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (guards)
- {
- check_guards (memory, TRUE);
- if (memory)
- {
-#ifdef DBUS_DISABLE_ASSERT
- _dbus_atomic_dec (&n_blocks_outstanding);
-#else
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_dec (&n_blocks_outstanding);
- _dbus_assert (old_value >= 1);
-#endif
-
- free (((unsigned char*)memory) - GUARD_START_OFFSET);
- }
-
- return;
- }
-#endif
-
- if (memory) /* we guarantee it's safe to free (NULL) */
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#ifdef DBUS_DISABLE_ASSERT
- _dbus_atomic_dec (&n_blocks_outstanding);
-#else
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_dec (&n_blocks_outstanding);
- _dbus_assert (old_value >= 1);
-#endif
-#endif
-
- free (memory);
- }
-}
-
-/**
- * Frees a #NULL-terminated array of strings.
- * If passed #NULL, does nothing.
- *
- * @param str_array the array to be freed
- */
-void
-dbus_free_string_array (char **str_array)
-{
- if (str_array)
- {
- int i;
-
- i = 0;
- while (str_array[i])
- {
- dbus_free (str_array[i]);
- i++;
- }
-
- dbus_free (str_array);
- }
-}
-
-/** @} */ /* End of public API docs block */
-
-
-/**
- * @addtogroup DBusMemoryInternals
- *
- * @{
- */
-
-/**
- * _dbus_current_generation is used to track each
- * time that dbus_shutdown() is called, so we can
- * reinit things after it's been called. It is simply
- * incremented each time we shut down.
- */
-int _dbus_current_generation = 1;
-
-/**
- * Represents a function to be called on shutdown.
- */
-typedef struct ShutdownClosure ShutdownClosure;
-
-/**
- * This struct represents a function to be called on shutdown.
- */
-struct ShutdownClosure
-{
- ShutdownClosure *next; /**< Next ShutdownClosure */
- DBusShutdownFunction func; /**< Function to call */
- void *data; /**< Data for function */
-};
-
-/* Protected by _DBUS_LOCK (shutdown_funcs) */
-static ShutdownClosure *registered_globals = NULL;
-
-/**
- * Register a cleanup function to be called exactly once
- * the next time dbus_shutdown() is called.
- *
- * @param func the function
- * @param data data to pass to the function
- * @returns #FALSE on not enough memory
- */
-dbus_bool_t
-_dbus_register_shutdown_func (DBusShutdownFunction func,
- void *data)
-{
- dbus_bool_t ok;
-
- if (!_DBUS_LOCK (shutdown_funcs))
- return FALSE;
-
- ok = _dbus_register_shutdown_func_unlocked (func, data);
- _DBUS_UNLOCK (shutdown_funcs);
- return ok;
-}
-
-dbus_bool_t
-_dbus_register_shutdown_func_unlocked (DBusShutdownFunction func,
- void *data)
-{
- ShutdownClosure *c;
-
- c = dbus_new (ShutdownClosure, 1);
-
- if (c == NULL)
- return FALSE;
-
- c->func = func;
- c->data = data;
-
- c->next = registered_globals;
- registered_globals = c;
-
- return TRUE;
-}
-
-/** @} */ /* End of private API docs block */
-
-
-/**
- * @addtogroup DBusMemory
- *
- * @{
- */
-
-/**
- * Frees all memory allocated internally by libdbus and
- * reverses the effects of dbus_threads_init(). libdbus keeps internal
- * global variables, for example caches and thread locks, and it
- * can be useful to free these internal data structures.
- *
- * dbus_shutdown() does NOT free memory that was returned
- * to the application. It only returns libdbus-internal
- * data structures.
- *
- * You MUST free all memory and release all reference counts
- * returned to you by libdbus prior to calling dbus_shutdown().
- *
- * You can't continue to use any D-Bus objects, such as connections,
- * that were allocated prior to dbus_shutdown(). You can, however,
- * start over; call dbus_threads_init() again, create new connections,
- * and so forth.
- *
- * WARNING: dbus_shutdown() is NOT thread safe, it must be called
- * while NO other threads are using D-Bus. (Remember, you have to free
- * all D-Bus objects and memory before you call dbus_shutdown(), so no
- * thread can be using libdbus.)
- *
- * The purpose of dbus_shutdown() is to allow applications to get
- * clean output from memory leak checkers. dbus_shutdown() may also be
- * useful if you want to dlopen() libdbus instead of linking to it,
- * and want to be able to unload the library again.
- *
- * There is absolutely no requirement to call dbus_shutdown() - in fact,
- * most applications won't bother and should not feel guilty.
- *
- * You have to know that nobody is using libdbus in your application's
- * process before you can call dbus_shutdown(). One implication of this
- * is that calling dbus_shutdown() from a library is almost certainly
- * wrong, since you don't know what the rest of the app is up to.
- *
- */
-void
-dbus_shutdown (void)
-{
- while (registered_globals != NULL)
- {
- ShutdownClosure *c;
-
- c = registered_globals;
- registered_globals = c->next;
-
- (* c->func) (c->data);
-
- dbus_free (c);
- }
-
- /* We wrap this in the thread-initialization lock because
- * dbus_threads_init() uses the current generation to tell whether
- * we're initialized, so we need to make sure that un-initializing
- * propagates into all threads. */
- _dbus_threads_lock_platform_specific ();
- _dbus_current_generation += 1;
- _dbus_threads_unlock_platform_specific ();
-}
-
-/** @} */ /** End of public API docs block */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-
-/**
- * @ingroup DBusMemoryInternals
- * Unit test for DBusMemory
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_memory_test (void)
-{
- dbus_bool_t old_guards;
- void *p;
- size_t size;
-
- old_guards = guards;
- guards = TRUE;
- p = dbus_malloc (4);
- if (p == NULL)
- _dbus_assert_not_reached ("no memory");
- for (size = 4; size < 256; size += 4)
- {
- p = dbus_realloc (p, size);
- if (p == NULL)
- _dbus_assert_not_reached ("no memory");
- }
- for (size = 256; size != 0; size -= 4)
- {
- p = dbus_realloc (p, size);
- if (p == NULL)
- _dbus_assert_not_reached ("no memory");
- }
- dbus_free (p);
- guards = old_guards;
- return TRUE;
-}
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.h
deleted file mode 100644
index 4fd56bd633..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-memory.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-memory.h D-Bus memory handling
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_MEMORY_H
-#define DBUS_MEMORY_H
-
-#include <dbus/dbus-macros.h>
-#include <stddef.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusMemory
- * @{
- */
-
-DBUS_EXPORT
-DBUS_MALLOC
-DBUS_ALLOC_SIZE(1)
-void* dbus_malloc (size_t bytes);
-
-DBUS_EXPORT
-DBUS_MALLOC
-DBUS_ALLOC_SIZE(1)
-void* dbus_malloc0 (size_t bytes);
-
-DBUS_EXPORT
-DBUS_MALLOC
-DBUS_ALLOC_SIZE(2)
-void* dbus_realloc (void *memory,
- size_t bytes);
-DBUS_EXPORT
-void dbus_free (void *memory);
-
-#define dbus_new(type, count) ((type*)dbus_malloc (sizeof (type) * (count)))
-#define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count)))
-
-DBUS_EXPORT
-void dbus_free_string_array (char **str_array);
-
-typedef void (* DBusFreeFunction) (void *memory);
-
-DBUS_EXPORT
-void dbus_shutdown (void);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MEMORY_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.c
deleted file mode 100644
index 524661514d..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.c
+++ /dev/null
@@ -1,647 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-mempool.h Memory pools
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-mempool.h"
-#include "dbus-internals.h"
-#include "dbus-valgrind-internal.h"
-
-/**
- * @defgroup DBusMemPool memory pools
- * @ingroup DBusInternals
- * @brief DBusMemPool object
- *
- * Types and functions related to DBusMemPool. A memory pool is used
- * to decrease memory fragmentation/overhead and increase speed for
- * blocks of small uniformly-sized objects. The main point is to avoid
- * the overhead of a malloc block for each small object, speed is
- * secondary.
- */
-
-/**
- * @defgroup DBusMemPoolInternals Memory pool implementation details
- * @ingroup DBusInternals
- * @brief DBusMemPool implementation details
- *
- * The guts of DBusMemPool.
- *
- * @{
- */
-
-/**
- * typedef so DBusFreedElement struct can refer to itself.
- */
-typedef struct DBusFreedElement DBusFreedElement;
-
-/**
- * struct representing an element on the free list.
- * We just cast freed elements to this so we can
- * make a list out of them.
- */
-struct DBusFreedElement
-{
- DBusFreedElement *next; /**< next element of the free list */
-};
-
-/**
- * The dummy size of the variable-length "elements"
- * field in DBusMemBlock
- */
-#define ELEMENT_PADDING 4
-
-/**
- * Typedef for DBusMemBlock so the struct can recursively
- * point to itself.
- */
-typedef struct DBusMemBlock DBusMemBlock;
-
-/**
- * DBusMemBlock object represents a single malloc()-returned
- * block that gets chunked up into objects in the memory pool.
- */
-struct DBusMemBlock
-{
- DBusMemBlock *next; /**< next block in the list, which is already used up;
- * only saved so we can free all the blocks
- * when we free the mem pool.
- */
-
- /* this is a long so that "elements" is aligned */
- long used_so_far; /**< bytes of this block already allocated as elements. */
-
- unsigned char elements[ELEMENT_PADDING]; /**< the block data, actually allocated to required size */
-};
-
-/**
- * Internals fields of DBusMemPool
- */
-struct DBusMemPool
-{
- int element_size; /**< size of a single object in the pool */
- int block_size; /**< size of most recently allocated block */
- unsigned int zero_elements : 1; /**< whether to zero-init allocated elements */
-
- DBusFreedElement *free_elements; /**< a free list of elements to recycle */
- DBusMemBlock *blocks; /**< blocks of memory from malloc() */
- int allocated_elements; /**< Count of outstanding allocated elements */
-};
-
-/** @} */
-
-/**
- * @addtogroup DBusMemPool
- *
- * @{
- */
-
-/**
- * @typedef DBusMemPool
- *
- * Opaque object representing a memory pool. Memory pools allow
- * avoiding per-malloc-block memory overhead when allocating a lot of
- * small objects that are all the same size. They are slightly
- * faster than calling malloc() also.
- */
-
-/**
- * Creates a new memory pool, or returns #NULL on failure. Objects in
- * the pool must be at least sizeof(void*) bytes each, due to the way
- * memory pools work. To avoid creating 64 bit problems, this means at
- * least 8 bytes on all platforms, unless you are 4 bytes on 32-bit
- * and 8 bytes on 64-bit.
- *
- * @param element_size size of an element allocated from the pool.
- * @param zero_elements whether to zero-initialize elements
- * @returns the new pool or #NULL
- */
-DBusMemPool*
-_dbus_mem_pool_new (int element_size,
- dbus_bool_t zero_elements)
-{
- DBusMemPool *pool;
-
- pool = dbus_new0 (DBusMemPool, 1);
- if (pool == NULL)
- return NULL;
-
- /* Make the element size at least 8 bytes. */
- if (element_size < 8)
- element_size = 8;
-
- /* these assertions are equivalent but the first is more clear
- * to programmers that see it fail.
- */
- _dbus_assert (element_size >= (int) sizeof (void*));
- _dbus_assert (element_size >= (int) sizeof (DBusFreedElement));
-
- /* align the element size to a pointer boundary so we won't get bus
- * errors under other architectures.
- */
- pool->element_size = _DBUS_ALIGN_VALUE (element_size, sizeof (void *));
-
- pool->zero_elements = zero_elements != FALSE;
-
- pool->allocated_elements = 0;
-
- /* pick a size for the first block; it increases
- * for each block we need to allocate. This is
- * actually half the initial block size
- * since _dbus_mem_pool_alloc() unconditionally
- * doubles it prior to creating a new block. */
- pool->block_size = pool->element_size * 8;
-
- _dbus_assert ((pool->block_size %
- pool->element_size) == 0);
-
- VALGRIND_CREATE_MEMPOOL (pool, 0, zero_elements);
-
- return pool;
-}
-
-/**
- * Frees a memory pool (and all elements allocated from it).
- *
- * @param pool the memory pool.
- */
-void
-_dbus_mem_pool_free (DBusMemPool *pool)
-{
- DBusMemBlock *block;
-
- VALGRIND_DESTROY_MEMPOOL (pool);
-
- block = pool->blocks;
- while (block != NULL)
- {
- DBusMemBlock *next = block->next;
-
- dbus_free (block);
-
- block = next;
- }
-
- dbus_free (pool);
-}
-
-/**
- * Allocates an object from the memory pool.
- * The object must be freed with _dbus_mem_pool_dealloc().
- *
- * @param pool the memory pool
- * @returns the allocated object or #NULL if no memory.
- */
-void*
-_dbus_mem_pool_alloc (DBusMemPool *pool)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (_dbus_disable_mem_pools ())
- {
- DBusMemBlock *block;
- int alloc_size;
-
- /* This is obviously really silly, but it's
- * debug-mode-only code that is compiled out
- * when tests are disabled (_dbus_disable_mem_pools()
- * is a constant expression FALSE so this block
- * should vanish)
- */
-
- alloc_size = sizeof (DBusMemBlock) - ELEMENT_PADDING +
- pool->element_size;
-
- if (pool->zero_elements)
- block = dbus_malloc0 (alloc_size);
- else
- block = dbus_malloc (alloc_size);
-
- if (block != NULL)
- {
- block->next = pool->blocks;
- pool->blocks = block;
- pool->allocated_elements += 1;
-
- VALGRIND_MEMPOOL_ALLOC (pool, (void *) &block->elements[0],
- pool->element_size);
- return (void*) &block->elements[0];
- }
- else
- return NULL;
- }
- else
-#endif
- {
- if (_dbus_decrement_fail_alloc_counter ())
- {
- _dbus_verbose (" FAILING mempool alloc\n");
- return NULL;
- }
- else if (pool->free_elements)
- {
- DBusFreedElement *element = pool->free_elements;
-
- pool->free_elements = pool->free_elements->next;
-
- VALGRIND_MEMPOOL_ALLOC (pool, element, pool->element_size);
-
- if (pool->zero_elements)
- memset (element, '\0', pool->element_size);
-
- pool->allocated_elements += 1;
-
- return element;
- }
- else
- {
- void *element;
-
- if (pool->blocks == NULL ||
- pool->blocks->used_so_far == pool->block_size)
- {
- /* Need a new block */
- DBusMemBlock *block;
- int alloc_size;
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- int saved_counter;
-#endif
-
- if (pool->block_size <= _DBUS_INT_MAX / 4) /* avoid overflow */
- {
- /* use a larger block size for our next block */
- pool->block_size *= 2;
- _dbus_assert ((pool->block_size %
- pool->element_size) == 0);
- }
-
- alloc_size = sizeof (DBusMemBlock) - ELEMENT_PADDING + pool->block_size;
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- /* We save/restore the counter, so that memory pools won't
- * cause a given function to have different number of
- * allocations on different invocations. i.e. when testing
- * we want consistent alloc patterns. So we skip our
- * malloc here for purposes of failed alloc simulation.
- */
- saved_counter = _dbus_get_fail_alloc_counter ();
- _dbus_set_fail_alloc_counter (_DBUS_INT_MAX);
-#endif
-
- if (pool->zero_elements)
- block = dbus_malloc0 (alloc_size);
- else
- block = dbus_malloc (alloc_size);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- _dbus_set_fail_alloc_counter (saved_counter);
- _dbus_assert (saved_counter == _dbus_get_fail_alloc_counter ());
-#endif
-
- if (block == NULL)
- return NULL;
-
- block->used_so_far = 0;
- block->next = pool->blocks;
- pool->blocks = block;
- }
-
- element = &pool->blocks->elements[pool->blocks->used_so_far];
-
- pool->blocks->used_so_far += pool->element_size;
-
- pool->allocated_elements += 1;
-
- VALGRIND_MEMPOOL_ALLOC (pool, element, pool->element_size);
- return element;
- }
- }
-}
-
-/**
- * Deallocates an object previously created with
- * _dbus_mem_pool_alloc(). The previous object
- * must have come from this same pool.
- * @param pool the memory pool
- * @param element the element earlier allocated.
- * @returns #TRUE if there are no remaining allocated elements
- */
-dbus_bool_t
-_dbus_mem_pool_dealloc (DBusMemPool *pool,
- void *element)
-{
- VALGRIND_MEMPOOL_FREE (pool, element);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (_dbus_disable_mem_pools ())
- {
- DBusMemBlock *block;
- DBusMemBlock *prev;
-
- /* mmm, fast. ;-) debug-only code, so doesn't matter. */
-
- prev = NULL;
- block = pool->blocks;
-
- while (block != NULL)
- {
- if (block->elements == (unsigned char*) element)
- {
- if (prev)
- prev->next = block->next;
- else
- pool->blocks = block->next;
-
- dbus_free (block);
-
- _dbus_assert (pool->allocated_elements > 0);
- pool->allocated_elements -= 1;
-
- if (pool->allocated_elements == 0)
- _dbus_assert (pool->blocks == NULL);
-
- return pool->blocks == NULL;
- }
- prev = block;
- block = block->next;
- }
-
- _dbus_assert_not_reached ("freed nonexistent block");
- return FALSE;
- }
- else
-#endif
- {
- DBusFreedElement *freed;
-
- freed = element;
- /* used for internal mempool administration */
- VALGRIND_MAKE_MEM_UNDEFINED (freed, sizeof (*freed));
-
- freed->next = pool->free_elements;
- pool->free_elements = freed;
-
- _dbus_assert (pool->allocated_elements > 0);
- pool->allocated_elements -= 1;
-
- return pool->allocated_elements == 0;
- }
-}
-
-#ifdef DBUS_ENABLE_STATS
-void
-_dbus_mem_pool_get_stats (DBusMemPool *pool,
- dbus_uint32_t *in_use_p,
- dbus_uint32_t *in_free_list_p,
- dbus_uint32_t *allocated_p)
-{
- DBusMemBlock *block;
- DBusFreedElement *freed;
- dbus_uint32_t in_use = 0;
- dbus_uint32_t in_free_list = 0;
- dbus_uint32_t allocated = 0;
-
- if (pool != NULL)
- {
- in_use = pool->element_size * pool->allocated_elements;
-
- for (freed = pool->free_elements; freed != NULL; freed = freed->next)
- {
- in_free_list += pool->element_size;
- }
-
- for (block = pool->blocks; block != NULL; block = block->next)
- {
- if (block == pool->blocks)
- allocated += pool->block_size;
- else
- allocated += block->used_so_far;
- }
- }
-
- if (in_use_p != NULL)
- *in_use_p = in_use;
-
- if (in_free_list_p != NULL)
- *in_free_list_p = in_free_list;
-
- if (allocated_p != NULL)
- *allocated_p = allocated;
-}
-#endif /* DBUS_ENABLE_STATS */
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-#include <time.h>
-
-static void
-time_for_size (int size)
-{
- int i;
- int j;
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- clock_t start;
- clock_t end;
-#endif
-#define FREE_ARRAY_SIZE 512
-#define N_ITERATIONS FREE_ARRAY_SIZE * 512
- void *to_free[FREE_ARRAY_SIZE];
- DBusMemPool *pool;
-
- _dbus_verbose ("Timings for size %d\n", size);
-
- _dbus_verbose (" malloc\n");
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- start = clock ();
-#endif
-
- i = 0;
- j = 0;
- while (i < N_ITERATIONS)
- {
- to_free[j] = dbus_malloc (size);
- _dbus_assert (to_free[j] != NULL); /* in a real app of course this is wrong */
-
- ++j;
-
- if (j == FREE_ARRAY_SIZE)
- {
- j = 0;
- while (j < FREE_ARRAY_SIZE)
- {
- dbus_free (to_free[j]);
- ++j;
- }
-
- j = 0;
- }
-
- ++i;
- }
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- end = clock ();
-
- _dbus_verbose (" created/destroyed %d elements in %g seconds\n",
- N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
-
-
-
- _dbus_verbose (" mempools\n");
-
- start = clock ();
-#endif
-
- pool = _dbus_mem_pool_new (size, FALSE);
-
- i = 0;
- j = 0;
- while (i < N_ITERATIONS)
- {
- to_free[j] = _dbus_mem_pool_alloc (pool);
- _dbus_assert (to_free[j] != NULL); /* in a real app of course this is wrong */
-
- ++j;
-
- if (j == FREE_ARRAY_SIZE)
- {
- j = 0;
- while (j < FREE_ARRAY_SIZE)
- {
- _dbus_mem_pool_dealloc (pool, to_free[j]);
- ++j;
- }
-
- j = 0;
- }
-
- ++i;
- }
-
- _dbus_mem_pool_free (pool);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- end = clock ();
-
- _dbus_verbose (" created/destroyed %d elements in %g seconds\n",
- N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
-
- _dbus_verbose (" zeroed malloc\n");
-
- start = clock ();
-#endif
-
- i = 0;
- j = 0;
- while (i < N_ITERATIONS)
- {
- to_free[j] = dbus_malloc0 (size);
- _dbus_assert (to_free[j] != NULL); /* in a real app of course this is wrong */
-
- ++j;
-
- if (j == FREE_ARRAY_SIZE)
- {
- j = 0;
- while (j < FREE_ARRAY_SIZE)
- {
- dbus_free (to_free[j]);
- ++j;
- }
-
- j = 0;
- }
-
- ++i;
- }
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- end = clock ();
-
- _dbus_verbose (" created/destroyed %d elements in %g seconds\n",
- N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
-
- _dbus_verbose (" zeroed mempools\n");
-
- start = clock ();
-#endif
-
- pool = _dbus_mem_pool_new (size, TRUE);
-
- i = 0;
- j = 0;
- while (i < N_ITERATIONS)
- {
- to_free[j] = _dbus_mem_pool_alloc (pool);
- _dbus_assert (to_free[j] != NULL); /* in a real app of course this is wrong */
-
- ++j;
-
- if (j == FREE_ARRAY_SIZE)
- {
- j = 0;
- while (j < FREE_ARRAY_SIZE)
- {
- _dbus_mem_pool_dealloc (pool, to_free[j]);
- ++j;
- }
-
- j = 0;
- }
-
- ++i;
- }
-
- _dbus_mem_pool_free (pool);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- end = clock ();
-
- _dbus_verbose (" created/destroyed %d elements in %g seconds\n",
- N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
-#endif
-}
-
-/**
- * @ingroup DBusMemPoolInternals
- * Unit test for DBusMemPool
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_mem_pool_test (void)
-{
- int i;
- int element_sizes[] = { 4, 8, 16, 50, 124 };
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (element_sizes))
- {
- time_for_size (element_sizes[i]);
- ++i;
- }
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.h
deleted file mode 100644
index 6693eeb23d..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-mempool.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-mempool.h Memory pools
- *
- * Copyright (C) 2002 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MEMPOOL_H
-#define DBUS_MEMPOOL_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusMemPool DBusMemPool;
-
-DBusMemPool* _dbus_mem_pool_new (int element_size,
- dbus_bool_t zero_elements);
-void _dbus_mem_pool_free (DBusMemPool *pool);
-void* _dbus_mem_pool_alloc (DBusMemPool *pool);
-dbus_bool_t _dbus_mem_pool_dealloc (DBusMemPool *pool,
- void *element);
-
-/* if DBUS_ENABLE_STATS */
-void _dbus_mem_pool_get_stats (DBusMemPool *pool,
- dbus_uint32_t *in_use_p,
- dbus_uint32_t *in_free_list_p,
- dbus_uint32_t *allocated_p);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MEMPOOL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.c
deleted file mode 100644
index b742e4c1ee..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.c
+++ /dev/null
@@ -1,1305 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message-factory.c Generator of valid and invalid message data for test suite
- *
- * Copyright (C) 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-message-factory.h"
-#include "dbus-message-private.h"
-#include "dbus-signature.h"
-#include "dbus-test.h"
-#include <stdio.h>
-
-typedef enum
- {
- CHANGE_TYPE_ADJUST,
- CHANGE_TYPE_ABSOLUTE
- } ChangeType;
-
-#define BYTE_ORDER_OFFSET 0
-#define TYPE_OFFSET 1
-#define BODY_LENGTH_OFFSET 4
-#define FIELDS_ARRAY_LENGTH_OFFSET 12
-
-static void
-iter_recurse (DBusMessageDataIter *iter)
-{
- iter->depth += 1;
- _dbus_assert (iter->depth < _DBUS_MESSAGE_DATA_MAX_NESTING);
- _dbus_assert (iter->sequence_nos[iter->depth] >= 0);
-}
-
-static int
-iter_get_sequence (DBusMessageDataIter *iter)
-{
- _dbus_assert (iter->sequence_nos[iter->depth] >= 0);
- return iter->sequence_nos[iter->depth];
-}
-
-static void
-iter_set_sequence (DBusMessageDataIter *iter,
- int sequence)
-{
- _dbus_assert (sequence >= 0);
- iter->sequence_nos[iter->depth] = sequence;
-}
-
-static void
-iter_unrecurse (DBusMessageDataIter *iter)
-{
- iter->depth -= 1;
- _dbus_assert (iter->depth >= 0);
-}
-
-static void
-iter_next (DBusMessageDataIter *iter)
-{
- iter->sequence_nos[iter->depth] += 1;
-}
-
-static dbus_bool_t
-iter_first_in_series (DBusMessageDataIter *iter)
-{
- int i;
-
- i = iter->depth;
- while (i < _DBUS_MESSAGE_DATA_MAX_NESTING)
- {
- if (iter->sequence_nos[i] != 0)
- return FALSE;
- ++i;
- }
- return TRUE;
-}
-
-typedef dbus_bool_t (* DBusInnerGeneratorFunc) (DBusMessageDataIter *iter,
- DBusMessage **message_p);
-typedef dbus_bool_t (* DBusMessageGeneratorFunc) (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity);
-
-static void
-set_reply_serial (DBusMessage *message)
-{
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
- if (!dbus_message_set_reply_serial (message, 100))
- _dbus_assert_not_reached ("oom");
-}
-
-static dbus_bool_t
-generate_trivial_inner (DBusMessageDataIter *iter,
- DBusMessage **message_p)
-{
- DBusMessage *message;
-
- switch (iter_get_sequence (iter))
- {
- case 0:
- message = dbus_message_new_method_call ("org.freedesktop.TextEditor",
- "/foo/bar",
- "org.freedesktop.DocumentFactory",
- "Create");
- break;
- case 1:
- message = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
- set_reply_serial (message);
- break;
- case 2:
- message = dbus_message_new_signal ("/foo/bar",
- "org.freedesktop.DocumentFactory",
- "Created");
- break;
- case 3:
- message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
-
- if (!dbus_message_set_error_name (message,
- "org.freedesktop.TestErrorName"))
- _dbus_assert_not_reached ("oom");
-
- {
- DBusMessageIter iter;
- const char *v_STRING = "This is an error";
-
- dbus_message_iter_init_append (message, &iter);
- if (!dbus_message_iter_append_basic (&iter,
- DBUS_TYPE_STRING,
- &v_STRING))
- _dbus_assert_not_reached ("oom");
- }
-
- set_reply_serial (message);
- break;
- default:
- return FALSE;
- }
-
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
-
- *message_p = message;
-
- return TRUE;
-}
-
-static dbus_bool_t
-generate_many_bodies_inner (DBusMessageDataIter *iter,
- DBusMessage **message_p)
-{
- DBusMessage *message;
- DBusString signature;
- DBusString body;
- char byte_order;
-
- /* Keeping this small makes things go faster */
- message = dbus_message_new_method_call ("o.z.F",
- "/",
- "o.z.B",
- "Nah");
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
-
- byte_order = _dbus_header_get_byte_order (&message->header);
-
- set_reply_serial (message);
-
- if (!_dbus_string_init (&signature) || !_dbus_string_init (&body))
- _dbus_assert_not_reached ("oom");
-
- if (dbus_internal_do_not_use_generate_bodies (iter_get_sequence (iter),
- byte_order,
- &signature, &body))
- {
- const char *v_SIGNATURE;
-
- v_SIGNATURE = _dbus_string_get_const_data (&signature);
- if (!_dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- &v_SIGNATURE))
- _dbus_assert_not_reached ("oom");
-
- if (!_dbus_string_move (&body, 0, &message->body, 0))
- _dbus_assert_not_reached ("oom");
-
- _dbus_marshal_set_uint32 (&message->header.data, BODY_LENGTH_OFFSET,
- _dbus_string_get_length (&message->body),
- byte_order);
-
- *message_p = message;
- }
- else
- {
- dbus_message_unref (message);
- *message_p = NULL;
- }
-
- _dbus_string_free (&signature);
- _dbus_string_free (&body);
-
- return *message_p != NULL;
-}
-
-static void
-generate_from_message (DBusString *data,
- DBusValidity *expected_validity,
- DBusMessage *message)
-{
- dbus_message_set_serial (message, 1);
- dbus_message_lock (message);
-
- *expected_validity = DBUS_VALID;
-
- /* move for efficiency, since we'll nuke the message anyway */
- if (!_dbus_string_move (&message->header.data, 0,
- data, 0))
- _dbus_assert_not_reached ("oom");
-
- if (!_dbus_string_copy (&message->body, 0,
- data, _dbus_string_get_length (data)))
- _dbus_assert_not_reached ("oom");
-}
-
-static dbus_bool_t
-generate_outer (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity,
- DBusInnerGeneratorFunc func)
-{
- DBusMessage *message;
-
- message = NULL;
- if (!(*func)(iter, &message))
- return FALSE;
-
- iter_next (iter);
-
- _dbus_assert (message != NULL);
-
- generate_from_message (data, expected_validity, message);
-
- dbus_message_unref (message);
-
- return TRUE;
-}
-
-static dbus_bool_t
-generate_trivial (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- return generate_outer (iter, data, expected_validity,
- generate_trivial_inner);
-}
-
-static dbus_bool_t
-generate_many_bodies (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- return generate_outer (iter, data, expected_validity,
- generate_many_bodies_inner);
-}
-
-static DBusMessage*
-simple_method_call (void)
-{
- DBusMessage *message;
- /* Keeping this small makes stuff go faster */
- message = dbus_message_new_method_call ("o.b.Q",
- "/f/b",
- "o.b.Z",
- "Fro");
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
- return message;
-}
-
-static DBusMessage*
-simple_signal (void)
-{
- DBusMessage *message;
- message = dbus_message_new_signal ("/f/b",
- "o.b.Z",
- "Fro");
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
- return message;
-}
-
-static DBusMessage*
-simple_method_return (void)
-{
- DBusMessage *message;
- message = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
-
- set_reply_serial (message);
-
- return message;
-}
-
-static DBusMessage*
-simple_error (void)
-{
- DBusMessage *message;
- message = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
- if (message == NULL)
- _dbus_assert_not_reached ("oom");
-
- if (!dbus_message_set_error_name (message, "foo.bar"))
- _dbus_assert_not_reached ("oom");
-
- set_reply_serial (message);
-
- return message;
-}
-
-static DBusMessage*
-message_with_nesting_levels (int levels)
-{
- DBusMessage *message;
- dbus_int32_t v_INT32;
- DBusMessageIter *parents;
- DBusMessageIter *children;
- int i;
-
- /* If levels is higher it breaks sig_refcount in DBusMessageRealIter
- * in dbus-message.c, this assert is just to help you know you need
- * to fix that if you hit it
- */
- _dbus_assert (levels < 256);
-
- parents = dbus_new(DBusMessageIter, levels + 1);
- children = dbus_new(DBusMessageIter, levels + 1);
-
- v_INT32 = 42;
- message = simple_method_call ();
-
- i = 0;
- dbus_message_iter_init_append (message, &parents[i]);
- while (i < levels)
- {
- dbus_message_iter_open_container (&parents[i], DBUS_TYPE_VARIANT,
- i == (levels - 1) ?
- DBUS_TYPE_INT32_AS_STRING :
- DBUS_TYPE_VARIANT_AS_STRING,
- &children[i]);
- ++i;
- parents[i] = children[i-1];
- }
- --i;
- dbus_message_iter_append_basic (&children[i], DBUS_TYPE_INT32, &v_INT32);
- while (i >= 0)
- {
- dbus_message_iter_close_container (&parents[i], &children[i]);
- --i;
- }
-
- dbus_free(parents);
- dbus_free(children);
-
- return message;
-}
-
-static dbus_bool_t
-generate_special (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int item_seq;
- DBusMessage *message;
- int pos;
- dbus_int32_t v_INT32;
-
- _dbus_assert (_dbus_string_get_length (data) == 0);
-
- message = NULL;
- pos = -1;
- v_INT32 = 42;
- item_seq = iter_get_sequence (iter);
-
- if (item_seq == 0)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- /* set an invalid typecode */
- _dbus_string_set_byte (data, pos + 1, '$');
-
- *expected_validity = DBUS_INVALID_UNKNOWN_TYPECODE;
- }
- else if (item_seq == 1)
- {
- char long_sig[DBUS_MAXIMUM_TYPE_RECURSION_DEPTH+2];
- const char *v_STRING;
- int i;
-
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- i = 0;
- while (i < (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH + 1))
- {
- long_sig[i] = DBUS_TYPE_ARRAY;
- ++i;
- }
- long_sig[i] = DBUS_TYPE_INVALID;
-
- v_STRING = long_sig;
- if (!_dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- &v_STRING))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION;
- }
- else if (item_seq == 2)
- {
- char long_sig[DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*2+4];
- const char *v_STRING;
- int i;
-
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- i = 0;
- while (i <= (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH + 1))
- {
- long_sig[i] = DBUS_STRUCT_BEGIN_CHAR;
- ++i;
- }
-
- long_sig[i] = DBUS_TYPE_INT32;
- ++i;
-
- while (i < (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*2 + 3))
- {
- long_sig[i] = DBUS_STRUCT_END_CHAR;
- ++i;
- }
- long_sig[i] = DBUS_TYPE_INVALID;
-
- v_STRING = long_sig;
- if (!_dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- &v_STRING))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION;
- }
- else if (item_seq == 3)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_STRUCT_BEGIN_CHAR);
-
- *expected_validity = DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED;
- }
- else if (item_seq == 4)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_STRUCT_END_CHAR);
-
- *expected_validity = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
- }
- else if (item_seq == 5)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_STRUCT_BEGIN_CHAR);
- _dbus_string_set_byte (data, pos + 2, DBUS_STRUCT_END_CHAR);
-
- *expected_validity = DBUS_INVALID_STRUCT_HAS_NO_FIELDS;
- }
- else if (item_seq == 6)
- {
- message = simple_method_call ();
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, TYPE_OFFSET, DBUS_MESSAGE_TYPE_INVALID);
-
- *expected_validity = DBUS_INVALID_BAD_MESSAGE_TYPE;
- }
- else if (item_seq == 7)
- {
- /* Messages of unknown type are considered valid */
- message = simple_method_call ();
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, TYPE_OFFSET, 100);
-
- *expected_validity = DBUS_VALID;
- }
- else if (item_seq == 8)
- {
- char byte_order;
-
- message = simple_method_call ();
- byte_order = _dbus_header_get_byte_order (&message->header);
- generate_from_message (data, expected_validity, message);
-
- _dbus_marshal_set_uint32 (data, BODY_LENGTH_OFFSET,
- DBUS_MAXIMUM_MESSAGE_LENGTH / 2 + 4,
- byte_order);
- _dbus_marshal_set_uint32 (data, FIELDS_ARRAY_LENGTH_OFFSET,
- DBUS_MAXIMUM_MESSAGE_LENGTH / 2 + 4,
- byte_order);
- *expected_validity = DBUS_INVALID_MESSAGE_TOO_LONG;
- }
- else if (item_seq == 9)
- {
- const char *v_STRING = "not a valid bus name";
- message = simple_method_call ();
-
- if (!_dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_SENDER,
- DBUS_TYPE_STRING, &v_STRING))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_BAD_SENDER;
- }
- else if (item_seq == 10)
- {
- message = simple_method_call ();
-
- if (!dbus_message_set_interface (message, DBUS_INTERFACE_LOCAL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_USES_LOCAL_INTERFACE;
- }
- else if (item_seq == 11)
- {
- message = simple_method_call ();
-
- if (!dbus_message_set_path (message, DBUS_PATH_LOCAL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_USES_LOCAL_PATH;
- }
- else if (item_seq == 12)
- {
- /* Method calls don't have to have interface */
- message = simple_method_call ();
-
- if (!dbus_message_set_interface (message, NULL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_VALID;
- }
- else if (item_seq == 13)
- {
- /* Signals require an interface */
- message = simple_signal ();
-
- if (!dbus_message_set_interface (message, NULL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_MISSING_INTERFACE;
- }
- else if (item_seq == 14)
- {
- message = simple_method_return ();
-
- if (!_dbus_header_delete_field (&message->header, DBUS_HEADER_FIELD_REPLY_SERIAL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_MISSING_REPLY_SERIAL;
- }
- else if (item_seq == 15)
- {
- message = simple_error ();
-
- if (!dbus_message_set_error_name (message, NULL))
- _dbus_assert_not_reached ("oom");
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_MISSING_ERROR_NAME;
- }
- else if (item_seq == 16)
- {
- char long_sig[DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*4+10];
- const char *v_STRING;
- int i;
- int n_begins;
-
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- i = 0;
- while (i <= (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*3 + 3))
- {
- long_sig[i] = DBUS_TYPE_ARRAY;
- ++i;
- long_sig[i] = DBUS_DICT_ENTRY_BEGIN_CHAR;
- ++i;
- long_sig[i] = DBUS_TYPE_INT32;
- ++i;
- }
- n_begins = i / 3;
-
- long_sig[i] = DBUS_TYPE_INT32;
- ++i;
-
- while (n_begins > 0)
- {
- long_sig[i] = DBUS_DICT_ENTRY_END_CHAR;
- ++i;
- n_begins -= 1;
- }
- long_sig[i] = DBUS_TYPE_INVALID;
-
- v_STRING = long_sig;
- if (!_dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- &v_STRING))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION;
- }
- else if (item_seq == 17)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_TYPE_ARRAY);
- _dbus_string_set_byte (data, pos + 2, DBUS_DICT_ENTRY_BEGIN_CHAR);
-
- *expected_validity = DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED;
- }
- else if (item_seq == 18)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_DICT_ENTRY_END_CHAR);
-
- *expected_validity = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
- }
- else if (item_seq == 19)
- {
- message = simple_method_call ();
- if (!dbus_message_append_args (message,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_INVALID))
- _dbus_assert_not_reached ("oom");
-
- _dbus_header_get_field_raw (&message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- NULL, &pos);
- generate_from_message (data, expected_validity, message);
-
- _dbus_string_set_byte (data, pos + 1, DBUS_TYPE_ARRAY);
- _dbus_string_set_byte (data, pos + 2, DBUS_DICT_ENTRY_BEGIN_CHAR);
- _dbus_string_set_byte (data, pos + 3, DBUS_DICT_ENTRY_END_CHAR);
-
- *expected_validity = DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS;
- }
- else if (item_seq == 20)
- {
- /* 64 levels of nesting is OK */
- message = message_with_nesting_levels(64);
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_VALID;
- }
- else if (item_seq == 21)
- {
- /* 65 levels of nesting is not OK */
- message = message_with_nesting_levels(65);
-
- generate_from_message (data, expected_validity, message);
-
- *expected_validity = DBUS_INVALID_NESTED_TOO_DEEPLY;
- }
- else
- {
- return FALSE;
- }
-
- if (message)
- dbus_message_unref (message);
-
- iter_next (iter);
- return TRUE;
-}
-
-static dbus_bool_t
-generate_wrong_length (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int lengths[] = { -42, -17, -16, -15, -9, -8, -7, -6, -5, -4, -3, -2, -1,
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 30 };
- int adjust;
- int len_seq;
-
- restart:
- len_seq = iter_get_sequence (iter);
- if (len_seq == _DBUS_N_ELEMENTS (lengths))
- return FALSE;
-
- _dbus_assert (len_seq < _DBUS_N_ELEMENTS (lengths));
-
- iter_recurse (iter);
- if (!generate_many_bodies (iter, data, expected_validity))
- {
- iter_set_sequence (iter, 0); /* reset to first body */
- iter_unrecurse (iter);
- iter_next (iter); /* next length adjustment */
- goto restart;
- }
- iter_unrecurse (iter);
-
- adjust = lengths[len_seq];
-
- if (adjust < 0)
- {
- if ((_dbus_string_get_length (data) + adjust) < DBUS_MINIMUM_HEADER_SIZE)
- _dbus_string_set_length (data, DBUS_MINIMUM_HEADER_SIZE);
- else
- _dbus_string_shorten (data, - adjust);
- *expected_validity = DBUS_INVALID_FOR_UNKNOWN_REASON;
- }
- else
- {
- if (!_dbus_string_lengthen (data, adjust))
- _dbus_assert_not_reached ("oom");
- *expected_validity = DBUS_INVALID_TOO_MUCH_DATA;
- }
-
- /* Fixup lengths */
- {
- int old_body_len;
- int new_body_len;
- int byte_order;
-
- _dbus_assert (_dbus_string_get_length (data) >= DBUS_MINIMUM_HEADER_SIZE);
-
- byte_order = _dbus_string_get_byte (data, BYTE_ORDER_OFFSET);
- old_body_len = _dbus_marshal_read_uint32 (data,
- BODY_LENGTH_OFFSET,
- byte_order,
- NULL);
- _dbus_assert (old_body_len < _dbus_string_get_length (data));
- new_body_len = old_body_len + adjust;
- if (new_body_len < 0)
- {
- new_body_len = 0;
- /* we just munged the header, and aren't sure how */
- *expected_validity = DBUS_VALIDITY_UNKNOWN;
- }
-
- _dbus_verbose ("changing body len from %u to %u by adjust %d\n",
- old_body_len, new_body_len, adjust);
-
- _dbus_marshal_set_uint32 (data, BODY_LENGTH_OFFSET,
- new_body_len,
- byte_order);
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-generate_byte_changed (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int byte_seq;
- int v_BYTE;
-
- /* This is a little convoluted to make the bodies the
- * outer loop and each byte of each body the inner
- * loop
- */
-
- restart:
- if (!generate_many_bodies (iter, data, expected_validity))
- return FALSE;
-
- iter_recurse (iter);
- byte_seq = iter_get_sequence (iter);
- iter_next (iter);
- iter_unrecurse (iter);
-
- if (byte_seq == _dbus_string_get_length (data))
- {
- _dbus_string_set_length (data, 0);
- /* reset byte count */
- iter_recurse (iter);
- iter_set_sequence (iter, 0);
- iter_unrecurse (iter);
- goto restart;
- }
- else
- {
- /* Undo the "next" in generate_many_bodies */
- iter_set_sequence (iter, iter_get_sequence (iter) - 1);
- }
-
- _dbus_assert (byte_seq < _dbus_string_get_length (data));
- v_BYTE = _dbus_string_get_byte (data, byte_seq);
- v_BYTE += byte_seq; /* arbitrary but deterministic change to the byte */
- _dbus_string_set_byte (data, byte_seq, v_BYTE);
- *expected_validity = DBUS_VALIDITY_UNKNOWN;
-
- return TRUE;
-}
-
-#if 0
-/* This is really expensive and doesn't add too much coverage */
-
-static dbus_bool_t
-find_next_typecode (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int body_seq;
- int byte_seq;
- int base_depth;
-
- base_depth = iter->depth;
-
- restart:
- _dbus_assert (iter->depth == (base_depth + 0));
- _dbus_string_set_length (data, 0);
-
- body_seq = iter_get_sequence (iter);
-
- if (!generate_many_bodies (iter, data, expected_validity))
- return FALSE;
- /* Undo the "next" in generate_many_bodies */
- iter_set_sequence (iter, body_seq);
-
- iter_recurse (iter);
- while (TRUE)
- {
- _dbus_assert (iter->depth == (base_depth + 1));
-
- byte_seq = iter_get_sequence (iter);
-
- _dbus_assert (byte_seq <= _dbus_string_get_length (data));
-
- if (byte_seq == _dbus_string_get_length (data))
- {
- /* reset byte count */
- iter_set_sequence (iter, 0);
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 0));
- iter_next (iter); /* go to the next body */
- goto restart;
- }
-
- _dbus_assert (byte_seq < _dbus_string_get_length (data));
-
- if (dbus_type_is_valid (_dbus_string_get_byte (data, byte_seq)))
- break;
- else
- iter_next (iter);
- }
-
- _dbus_assert (byte_seq == iter_get_sequence (iter));
- _dbus_assert (byte_seq < _dbus_string_get_length (data));
-
- iter_unrecurse (iter);
-
- _dbus_assert (iter->depth == (base_depth + 0));
-
- return TRUE;
-}
-
-static const int typecodes[] = {
- DBUS_TYPE_INVALID,
- DBUS_TYPE_BYTE,
- DBUS_TYPE_BOOLEAN,
- DBUS_TYPE_INT16,
- DBUS_TYPE_UINT16,
- DBUS_TYPE_INT32,
- DBUS_TYPE_UINT32,
- DBUS_TYPE_INT64,
- DBUS_TYPE_UINT64,
- DBUS_TYPE_DOUBLE,
- DBUS_TYPE_STRING,
- DBUS_TYPE_OBJECT_PATH,
- DBUS_TYPE_SIGNATURE,
- DBUS_TYPE_ARRAY,
- DBUS_TYPE_VARIANT,
- DBUS_STRUCT_BEGIN_CHAR,
- DBUS_STRUCT_END_CHAR,
- DBUS_DICT_ENTRY_BEGIN_CHAR,
- DBUS_DICT_ENTRY_END_CHAR,
- DBUS_TYPE_UNIX_FD,
- 255 /* random invalid typecode */
-};
-
-static dbus_bool_t
-generate_typecode_changed (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int byte_seq;
- int typecode_seq;
- int base_depth;
-
- base_depth = iter->depth;
-
- restart:
- _dbus_assert (iter->depth == (base_depth + 0));
- _dbus_string_set_length (data, 0);
-
- if (!find_next_typecode (iter, data, expected_validity))
- return FALSE;
-
- iter_recurse (iter);
- byte_seq = iter_get_sequence (iter);
-
- _dbus_assert (byte_seq < _dbus_string_get_length (data));
-
- iter_recurse (iter);
- typecode_seq = iter_get_sequence (iter);
- iter_next (iter);
-
- _dbus_assert (typecode_seq <= _DBUS_N_ELEMENTS (typecodes));
-
- if (typecode_seq == _DBUS_N_ELEMENTS (typecodes))
- {
- _dbus_assert (iter->depth == (base_depth + 2));
- iter_set_sequence (iter, 0); /* reset typecode sequence */
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 1));
- iter_next (iter); /* go to the next byte_seq */
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 0));
- goto restart;
- }
-
- _dbus_assert (iter->depth == (base_depth + 2));
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 1));
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 0));
-
-#if 0
- printf ("Changing byte %d in message %d to %c\n",
- byte_seq, iter_get_sequence (iter), typecodes[typecode_seq]);
-#endif
-
- _dbus_string_set_byte (data, byte_seq, typecodes[typecode_seq]);
- *expected_validity = DBUS_VALIDITY_UNKNOWN;
- return TRUE;
-}
-#endif
-
-typedef struct
-{
- ChangeType type;
- dbus_uint32_t value; /* cast to signed for adjusts */
-} UIntChange;
-
-static const UIntChange uint32_changes[] = {
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) -1 },
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) -2 },
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) -3 },
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) 1 },
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) 2 },
- { CHANGE_TYPE_ADJUST, (dbus_uint32_t) 3 },
- { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX },
- { CHANGE_TYPE_ABSOLUTE, 0 },
- { CHANGE_TYPE_ABSOLUTE, 1 },
- { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX - 1 },
- { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX - 5 }
-};
-
-static dbus_bool_t
-generate_uint32_changed (DBusMessageDataIter *iter,
- DBusString *data,
- DBusValidity *expected_validity)
-{
- int body_seq;
- int byte_seq;
- int change_seq;
- dbus_uint32_t v_UINT32;
- int byte_order;
- const UIntChange *change;
- int base_depth;
-
- /* Outer loop is each body, next loop is each change,
- * inner loop is each change location
- */
-
- base_depth = iter->depth;
-
- next_body:
- _dbus_assert (iter->depth == (base_depth + 0));
- _dbus_string_set_length (data, 0);
- body_seq = iter_get_sequence (iter);
-
- if (!generate_many_bodies (iter, data, expected_validity))
- return FALSE;
-
- _dbus_assert (iter->depth == (base_depth + 0));
-
- iter_set_sequence (iter, body_seq); /* undo the "next" from generate_many_bodies */
- iter_recurse (iter);
- next_change:
- _dbus_assert (iter->depth == (base_depth + 1));
- change_seq = iter_get_sequence (iter);
-
- if (change_seq == _DBUS_N_ELEMENTS (uint32_changes))
- {
- /* Reset change count */
- iter_set_sequence (iter, 0);
- iter_unrecurse (iter);
- iter_next (iter);
- goto next_body;
- }
-
- _dbus_assert (iter->depth == (base_depth + 1));
-
- iter_recurse (iter);
- _dbus_assert (iter->depth == (base_depth + 2));
- byte_seq = iter_get_sequence (iter);
- /* skip 4 bytes at a time */
- iter_next (iter);
- iter_next (iter);
- iter_next (iter);
- iter_next (iter);
- iter_unrecurse (iter);
-
- _dbus_assert (_DBUS_ALIGN_VALUE (byte_seq, 4) == (unsigned) byte_seq);
- if (byte_seq >= (_dbus_string_get_length (data) - 4))
- {
- /* reset byte count */
- _dbus_assert (iter->depth == (base_depth + 1));
- iter_recurse (iter);
- _dbus_assert (iter->depth == (base_depth + 2));
- iter_set_sequence (iter, 0);
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 1));
- iter_next (iter);
- goto next_change;
- }
-
- _dbus_assert (byte_seq <= (_dbus_string_get_length (data) - 4));
-
- byte_order = _dbus_string_get_byte (data, BYTE_ORDER_OFFSET);
-
- v_UINT32 = _dbus_marshal_read_uint32 (data, byte_seq, byte_order, NULL);
-
- change = &uint32_changes[change_seq];
-
- if (change->type == CHANGE_TYPE_ADJUST)
- {
- v_UINT32 += (int) change->value;
- }
- else
- {
- v_UINT32 = change->value;
- }
-
-#if 0
- printf ("body %d change %d pos %d ",
- body_seq, change_seq, byte_seq);
-
- if (change->type == CHANGE_TYPE_ADJUST)
- printf ("adjust by %d", (int) change->value);
- else
- printf ("set to %u", change->value);
-
- printf (" \t%u -> %u\n",
- _dbus_marshal_read_uint32 (data, byte_seq, byte_order, NULL),
- v_UINT32);
-#endif
-
- _dbus_marshal_set_uint32 (data, byte_seq, v_UINT32, byte_order);
- *expected_validity = DBUS_VALIDITY_UNKNOWN;
-
- _dbus_assert (iter->depth == (base_depth + 1));
- iter_unrecurse (iter);
- _dbus_assert (iter->depth == (base_depth + 0));
-
- return TRUE;
-}
-
-typedef struct
-{
- const char *name;
- DBusMessageGeneratorFunc func;
-} DBusMessageGenerator;
-
-static const DBusMessageGenerator generators[] = {
- { "trivial example of each message type", generate_trivial },
- { "assorted arguments", generate_many_bodies },
- { "assorted special cases", generate_special },
- { "each uint32 modified", generate_uint32_changed },
- { "wrong body lengths", generate_wrong_length },
- { "each byte modified", generate_byte_changed },
-#if 0
- /* This is really expensive and doesn't add too much coverage */
- { "change each typecode", generate_typecode_changed }
-#endif
-};
-
-void
-_dbus_message_data_free (DBusMessageData *data)
-{
- _dbus_string_free (&data->data);
-}
-
-void
-_dbus_message_data_iter_init (DBusMessageDataIter *iter)
-{
- int i;
-
- iter->depth = 0;
- i = 0;
- while (i < _DBUS_MESSAGE_DATA_MAX_NESTING)
- {
- iter->sequence_nos[i] = 0;
- ++i;
- }
- iter->count = 0;
-}
-
-dbus_bool_t
-_dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
- DBusMessageData *data)
-{
- DBusMessageGeneratorFunc func;
- int generator;
-
- restart:
- generator = iter_get_sequence (iter);
-
- if (generator == _DBUS_N_ELEMENTS (generators))
- return FALSE;
-
- iter_recurse (iter);
-
- if (iter_first_in_series (iter))
- {
- printf (" testing message loading: %s ", generators[generator].name);
- fflush (stdout);
- }
-
- func = generators[generator].func;
-
- if (!_dbus_string_init (&data->data))
- _dbus_assert_not_reached ("oom");
-
- if ((*func)(iter, &data->data, &data->expected_validity))
- ;
- else
- {
- iter_set_sequence (iter, 0);
- iter_unrecurse (iter);
- iter_next (iter); /* next generator */
- _dbus_string_free (&data->data);
- printf ("%d test loads cumulative\n", iter->count);
- goto restart;
- }
- iter_unrecurse (iter);
-
- iter->count += 1;
- return TRUE;
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.h
deleted file mode 100644
index fd7a47648a..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-factory.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message-factory.h Generator of valid and invalid message data for test suite
- *
- * Copyright (C) 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_MESSAGE_FACTORY_H
-#define DBUS_MESSAGE_FACTORY_H
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-marshal-basic.h>
-#include <dbus/dbus-marshal-validate.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct
-{
- DBusValidity expected_validity;
-
- DBusString data;
-
-} DBusMessageData;
-
-#define _DBUS_MESSAGE_DATA_MAX_NESTING 10
-typedef struct
-{
- int sequence_nos[_DBUS_MESSAGE_DATA_MAX_NESTING];
- int depth;
- int count;
-} DBusMessageDataIter;
-
-void _dbus_message_data_free (DBusMessageData *data);
-void _dbus_message_data_iter_init (DBusMessageDataIter *iter);
-dbus_bool_t _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
- DBusMessageData *data);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-#endif /* DBUS_MESSAGE_FACTORY_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-internal.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-message-internal.h
deleted file mode 100644
index 5d6594e379..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-internal.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message-internal.h DBusMessage object internal interfaces
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_MESSAGE_INTERNAL_H
-#define DBUS_MESSAGE_INTERNAL_H
-
-#include <dbus/dbus-marshal-validate.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-resources.h>
-#include <dbus/dbus-list.h>
-
-DBUS_BEGIN_DECLS
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-void _dbus_message_trace_ref (DBusMessage *message,
- int old_refcount,
- int new_refcount,
- const char *why);
-#else
-/* this bypasses any "unused" warnings for the old and new refcount */
-#define _dbus_message_trace_ref(m, o, n, w) \
- do \
- {\
- (void) (o); \
- (void) (n); \
- } while (0)
-#endif
-
-typedef struct DBusMessageLoader DBusMessageLoader;
-
-void _dbus_message_get_network_data (DBusMessage *message,
- const DBusString **header,
- const DBusString **body);
-void _dbus_message_get_unix_fds (DBusMessage *message,
- const int **fds,
- unsigned *n_fds);
-
-void _dbus_message_lock (DBusMessage *message);
-void _dbus_message_unlock (DBusMessage *message);
-dbus_bool_t _dbus_message_add_counter (DBusMessage *message,
- DBusCounter *counter);
-void _dbus_message_add_counter_link (DBusMessage *message,
- DBusList *link);
-void _dbus_message_remove_counter (DBusMessage *message,
- DBusCounter *counter);
-
-DBusMessageLoader* _dbus_message_loader_new (void);
-DBusMessageLoader* _dbus_message_loader_ref (DBusMessageLoader *loader);
-void _dbus_message_loader_unref (DBusMessageLoader *loader);
-
-void _dbus_message_loader_get_buffer (DBusMessageLoader *loader,
- DBusString **buffer);
-void _dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer);
-
-dbus_bool_t _dbus_message_loader_get_unix_fds (DBusMessageLoader *loader,
- int **fds,
- unsigned *max_n_fds);
-void _dbus_message_loader_return_unix_fds (DBusMessageLoader *loader,
- int *fds,
- unsigned n_fds);
-
-dbus_bool_t _dbus_message_loader_queue_messages (DBusMessageLoader *loader);
-DBusMessage* _dbus_message_loader_peek_message (DBusMessageLoader *loader);
-DBusMessage* _dbus_message_loader_pop_message (DBusMessageLoader *loader);
-DBusList* _dbus_message_loader_pop_message_link (DBusMessageLoader *loader);
-void _dbus_message_loader_putback_message_link (DBusMessageLoader *loader,
- DBusList *link);
-
-dbus_bool_t _dbus_message_loader_get_is_corrupted (DBusMessageLoader *loader);
-DBusValidity _dbus_message_loader_get_corruption_reason (DBusMessageLoader *loader);
-
-void _dbus_message_loader_set_max_message_size (DBusMessageLoader *loader,
- long size);
-long _dbus_message_loader_get_max_message_size (DBusMessageLoader *loader);
-
-void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader *loader,
- long n);
-long _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader *loader);
-
-typedef struct DBusInitialFDs DBusInitialFDs;
-DBusInitialFDs *_dbus_check_fdleaks_enter (void);
-void _dbus_check_fdleaks_leave (DBusInitialFDs *fds);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MESSAGE_INTERNAL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-private.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-message-private.h
deleted file mode 100644
index e1578abd6c..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-private.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message-private.h header shared between dbus-message.c and dbus-message-util.c
- *
- * Copyright (C) 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_MESSAGE_PRIVATE_H
-#define DBUS_MESSAGE_PRIVATE_H
-
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-message-internal.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-dataslot.h>
-#include <dbus/dbus-marshal-header.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusMessageInternals
- * @{
- */
-
-/**
- * @typedef DBusMessageLoader
- *
- * The DBusMessageLoader object encapsulates the process of converting
- * a byte stream into a series of DBusMessage. It buffers the incoming
- * bytes as efficiently as possible, and generates a queue of
- * messages. DBusMessageLoader is typically used as part of a
- * DBusTransport implementation. The DBusTransport then hands off
- * the loaded messages to a DBusConnection, making the messages
- * visible to the application.
- *
- * @todo write tests for break-loader that a) randomly delete header
- * fields and b) set string fields to zero-length and other funky
- * values.
- *
- */
-
-/**
- * Implementation details of DBusMessageLoader.
- * All members are private.
- */
-struct DBusMessageLoader
-{
- int refcount; /**< Reference count. */
-
- DBusString data; /**< Buffered data */
-
- DBusList *messages; /**< Complete messages. */
-
- long max_message_size; /**< Maximum size of a message */
- long max_message_unix_fds; /**< Maximum unix fds in a message */
-
- DBusValidity corruption_reason; /**< why we were corrupted */
-
- unsigned int corrupted : 1; /**< We got broken data, and are no longer working */
-
- unsigned int buffer_outstanding : 1; /**< Someone is using the buffer to read */
-
-#ifdef HAVE_UNIX_FD_PASSING
- unsigned int unix_fds_outstanding : 1; /**< Someone is using the unix fd array to read */
-
- int *unix_fds; /**< File descriptors that have been read from the transport but not yet been handed to any message. Array will be allocated at first use. */
- unsigned n_unix_fds_allocated; /**< Number of file descriptors this array has space for */
- unsigned n_unix_fds; /**< Number of valid file descriptors in array */
-#endif
-};
-
-
-/** How many bits are in the changed_stamp used to validate iterators */
-#define CHANGED_STAMP_BITS 21
-
-/**
- * @brief Internals of DBusMessage
- *
- * Object representing a message received from or to be sent to
- * another application. This is an opaque object, all members
- * are private.
- */
-struct DBusMessage
-{
- DBusAtomic refcount; /**< Reference count */
-
- DBusHeader header; /**< Header network data and associated cache */
-
- DBusString body; /**< Body network data. */
-
- unsigned int locked : 1; /**< Message being sent, no modifications allowed. */
-
-#ifndef DBUS_DISABLE_CHECKS
- unsigned int in_cache : 1; /**< Has been "freed" since it's in the cache (this is a debug feature) */
-#endif
-
- DBusList *counters; /**< 0-N DBusCounter used to track message size/unix fds. */
- long size_counter_delta; /**< Size we incremented the size counters by. */
-
- dbus_uint32_t changed_stamp : CHANGED_STAMP_BITS; /**< Incremented when iterators are invalidated. */
-
- DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
-
-#ifndef DBUS_DISABLE_CHECKS
- int generation; /**< _dbus_current_generation when message was created */
-#endif
-
-#ifdef HAVE_UNIX_FD_PASSING
- int *unix_fds;
- /**< Unix file descriptors associated with this message. These are
- closed when the message is destroyed, hence make sure to dup()
- them when adding or removing them here. */
- unsigned n_unix_fds; /**< Number of valid fds in the array */
- unsigned n_unix_fds_allocated; /**< Allocated size of the array */
-
- long unix_fd_counter_delta; /**< Size we incremented the unix fd counter by */
-#endif
-};
-
-dbus_bool_t _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
- DBusError *error,
- int first_arg_type,
- va_list var_args);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MESSAGE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-message-util.c
deleted file mode 100644
index f615af83d6..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message-util.c
+++ /dev/null
@@ -1,1724 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message-util.c Would be in dbus-message.c, but only used by bus/tests
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat Inc.
- * Copyright (C) 2002, 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-message-private.h"
-#include "dbus-marshal-recursive.h"
-#include "dbus-string.h"
-#ifdef HAVE_UNIX_FD_PASSING
-#include "dbus-sysdeps-unix.h"
-#endif
-
-#ifdef __linux__
-/* Necessary for the Linux-specific fd leak checking code only */
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <errno.h>
-#endif
-
-/**
- * @addtogroup DBusMessage
- * @{
- */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Reads arguments from a message iterator given a variable argument
- * list. Only arguments of basic type and arrays of fixed-length
- * basic type may be read with this function. See
- * dbus_message_get_args() for more details.
- *
- * @param iter the message iterator
- * @param error error to be filled in on failure
- * @param first_arg_type the first argument type
- * @param ... location for first argument value, then list of type-location pairs
- * @returns #FALSE if the error was set
- */
-static dbus_bool_t
-dbus_message_iter_get_args (DBusMessageIter *iter,
- DBusError *error,
- int first_arg_type,
- ...)
-{
- dbus_bool_t retval;
- va_list var_args;
-
- _dbus_return_val_if_fail (iter != NULL, FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- va_start (var_args, first_arg_type);
- retval = _dbus_message_iter_get_args_valist (iter, error, first_arg_type, var_args);
- va_end (var_args);
-
- return retval;
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include "dbus-message-factory.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-static int validities_seen[DBUS_VALIDITY_LAST + _DBUS_NEGATIVE_VALIDITY_COUNT];
-
-static void
-reset_validities_seen (void)
-{
- int i;
- i = 0;
- while (i < _DBUS_N_ELEMENTS (validities_seen))
- {
- validities_seen[i] = 0;
- ++i;
- }
-}
-
-static void
-record_validity_seen (DBusValidity validity)
-{
- validities_seen[validity + _DBUS_NEGATIVE_VALIDITY_COUNT] += 1;
-}
-
-static void
-print_validities_seen (dbus_bool_t not_seen)
-{
- int i;
- i = 0;
- while (i < _DBUS_N_ELEMENTS (validities_seen))
- {
- if ((i - _DBUS_NEGATIVE_VALIDITY_COUNT) == DBUS_VALIDITY_UNKNOWN ||
- (i - _DBUS_NEGATIVE_VALIDITY_COUNT) == DBUS_INVALID_FOR_UNKNOWN_REASON)
- ;
- else if ((not_seen && validities_seen[i] == 0) ||
- (!not_seen && validities_seen[i] > 0))
- printf ("validity %3d seen %d times\n",
- i - _DBUS_NEGATIVE_VALIDITY_COUNT,
- validities_seen[i]);
- ++i;
- }
-}
-
-static void
-check_memleaks (void)
-{
- dbus_shutdown ();
-
- if (_dbus_get_malloc_blocks_outstanding () != 0)
- {
- _dbus_warn ("%d dbus_malloc blocks were not freed in %s\n",
- _dbus_get_malloc_blocks_outstanding (), __FILE__);
- _dbus_assert_not_reached ("memleaks");
- }
-}
-
-#ifdef __linux__
-struct DBusInitialFDs {
- fd_set set;
-};
-#endif
-
-DBusInitialFDs *
-_dbus_check_fdleaks_enter (void)
-{
-#ifdef __linux__
- DIR *d;
- DBusInitialFDs *fds;
-
- /* this is plain malloc so it won't interfere with leak checking */
- fds = malloc (sizeof (DBusInitialFDs));
- _dbus_assert (fds != NULL);
-
- /* This works on Linux only */
-
- if ((d = opendir ("/proc/self/fd")))
- {
- struct dirent *de;
-
- while ((de = readdir(d)))
- {
- long l;
- char *e = NULL;
- int fd;
-
- if (de->d_name[0] == '.')
- continue;
-
- errno = 0;
- l = strtol (de->d_name, &e, 10);
- _dbus_assert (errno == 0 && e && !*e);
-
- fd = (int) l;
-
- if (fd < 3)
- continue;
-
- if (fd == dirfd (d))
- continue;
-
- FD_SET (fd, &fds->set);
- }
-
- closedir (d);
- }
-
- return fds;
-#else
- return NULL;
-#endif
-}
-
-void
-_dbus_check_fdleaks_leave (DBusInitialFDs *fds)
-{
-#ifdef __linux__
- DIR *d;
-
- /* This works on Linux only */
-
- if ((d = opendir ("/proc/self/fd")))
- {
- struct dirent *de;
-
- while ((de = readdir(d)))
- {
- long l;
- char *e = NULL;
- int fd;
-
- if (de->d_name[0] == '.')
- continue;
-
- errno = 0;
- l = strtol (de->d_name, &e, 10);
- _dbus_assert (errno == 0 && e && !*e);
-
- fd = (int) l;
-
- if (fd < 3)
- continue;
-
- if (fd == dirfd (d))
- continue;
-
- if (FD_ISSET (fd, &fds->set))
- continue;
-
- _dbus_warn ("file descriptor %i leaked in %s.\n", fd, __FILE__);
- _dbus_assert_not_reached ("fdleaks");
- }
-
- closedir (d);
- }
-
- free (fds);
-#else
- _dbus_assert (fds == NULL);
-#endif
-}
-
-static dbus_bool_t
-check_have_valid_message (DBusMessageLoader *loader)
-{
- DBusMessage *message;
- dbus_bool_t retval;
-
- message = NULL;
- retval = FALSE;
-
- if (_dbus_message_loader_get_is_corrupted (loader))
- {
- _dbus_warn ("loader corrupted on message that was expected to be valid; invalid reason %d\n",
- loader->corruption_reason);
- goto failed;
- }
-
- message = _dbus_message_loader_pop_message (loader);
- if (message == NULL)
- {
- _dbus_warn ("didn't load message that was expected to be valid (message not popped)\n");
- goto failed;
- }
-
- if (_dbus_string_get_length (&loader->data) > 0)
- {
- _dbus_warn ("had leftover bytes from expected-to-be-valid single message\n");
- goto failed;
- }
-
-#if 0
- /* FIXME */
- /* Verify that we're able to properly deal with the message.
- * For example, this would detect improper handling of messages
- * in nonstandard byte order.
- */
- if (!check_message_handling (message))
- goto failed;
-#endif
-
- record_validity_seen (DBUS_VALID);
-
- retval = TRUE;
-
- failed:
- if (message)
- dbus_message_unref (message);
-
- return retval;
-}
-
-static dbus_bool_t
-check_invalid_message (DBusMessageLoader *loader,
- DBusValidity expected_validity)
-{
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_message_loader_get_is_corrupted (loader))
- {
- _dbus_warn ("loader not corrupted on message that was expected to be invalid\n");
- goto failed;
- }
-
- record_validity_seen (loader->corruption_reason);
-
- if (expected_validity != DBUS_INVALID_FOR_UNKNOWN_REASON &&
- loader->corruption_reason != expected_validity)
- {
- _dbus_warn ("expected message to be corrupted for reason %d and was corrupted for %d instead\n",
- expected_validity, loader->corruption_reason);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
- return retval;
-}
-
-static dbus_bool_t
-check_incomplete_message (DBusMessageLoader *loader)
-{
- DBusMessage *message;
- dbus_bool_t retval;
-
- message = NULL;
- retval = FALSE;
-
- if (_dbus_message_loader_get_is_corrupted (loader))
- {
- _dbus_warn ("loader corrupted on message that was expected to be valid (but incomplete), corruption reason %d\n",
- loader->corruption_reason);
- goto failed;
- }
-
- message = _dbus_message_loader_pop_message (loader);
- if (message != NULL)
- {
- _dbus_warn ("loaded message that was expected to be incomplete\n");
- goto failed;
- }
-
- record_validity_seen (DBUS_VALID_BUT_INCOMPLETE);
- retval = TRUE;
-
- failed:
- if (message)
- dbus_message_unref (message);
- return retval;
-}
-
-static dbus_bool_t
-check_loader_results (DBusMessageLoader *loader,
- DBusValidity expected_validity)
-{
- if (!_dbus_message_loader_queue_messages (loader))
- _dbus_assert_not_reached ("no memory to queue messages");
-
- if (expected_validity == DBUS_VALID)
- return check_have_valid_message (loader);
- else if (expected_validity == DBUS_VALID_BUT_INCOMPLETE)
- return check_incomplete_message (loader);
- else if (expected_validity == DBUS_VALIDITY_UNKNOWN)
- {
- /* here we just know we didn't segfault and that was the
- * only test. Also, we record that we got coverage
- * for the validity reason.
- */
- if (_dbus_message_loader_get_is_corrupted (loader))
- record_validity_seen (loader->corruption_reason);
-
- return TRUE;
- }
- else
- return check_invalid_message (loader, expected_validity);
-}
-
-/**
- * Loads the message in the given message file.
- *
- * @param filename filename to load
- * @param data string to load message into
- * @returns #TRUE if the message was loaded
- */
-dbus_bool_t
-dbus_internal_do_not_use_load_message_file (const DBusString *filename,
- DBusString *data)
-{
- dbus_bool_t retval;
- DBusError error = DBUS_ERROR_INIT;
-
- retval = FALSE;
-
- _dbus_verbose ("Loading raw %s\n", _dbus_string_get_const_data (filename));
- if (!_dbus_file_get_contents (data, filename, &error))
- {
- _dbus_warn ("Could not load message file %s: %s\n",
- _dbus_string_get_const_data (filename),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
-
- return retval;
-}
-
-/**
- * Tries loading the message in the given message file
- * and verifies that DBusMessageLoader can handle it.
- *
- * @param filename filename to load
- * @param expected_validity what the message has to be like to return #TRUE
- * @returns #TRUE if the message has the expected validity
- */
-dbus_bool_t
-dbus_internal_do_not_use_try_message_file (const DBusString *filename,
- DBusValidity expected_validity)
-{
- DBusString data;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&data))
- _dbus_assert_not_reached ("could not allocate string\n");
-
- if (!dbus_internal_do_not_use_load_message_file (filename, &data))
- goto failed;
-
- retval = dbus_internal_do_not_use_try_message_data (&data, expected_validity);
-
- failed:
-
- if (!retval)
- {
- if (_dbus_string_get_length (&data) > 0)
- _dbus_verbose_bytes_of_string (&data, 0,
- _dbus_string_get_length (&data));
-
- _dbus_warn ("Failed message loader test on %s\n",
- _dbus_string_get_const_data (filename));
- }
-
- _dbus_string_free (&data);
-
- return retval;
-}
-
-/**
- * Tries loading the given message data.
- *
- *
- * @param data the message data
- * @param expected_validity what the message has to be like to return #TRUE
- * @returns #TRUE if the message has the expected validity
- */
-dbus_bool_t
-dbus_internal_do_not_use_try_message_data (const DBusString *data,
- DBusValidity expected_validity)
-{
- DBusMessageLoader *loader;
- dbus_bool_t retval;
- int len;
- int i;
-
- loader = NULL;
- retval = FALSE;
-
- /* Write the data one byte at a time */
-
- loader = _dbus_message_loader_new ();
-
- /* check some trivial loader functions */
- _dbus_message_loader_ref (loader);
- _dbus_message_loader_unref (loader);
- _dbus_message_loader_get_max_message_size (loader);
-
- len = _dbus_string_get_length (data);
- for (i = 0; i < len; i++)
- {
- DBusString *buffer;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_append_byte (buffer,
- _dbus_string_get_byte (data, i));
- _dbus_message_loader_return_buffer (loader, buffer);
- }
-
- if (!check_loader_results (loader, expected_validity))
- goto failed;
-
- _dbus_message_loader_unref (loader);
- loader = NULL;
-
- /* Write the data all at once */
-
- loader = _dbus_message_loader_new ();
-
- {
- DBusString *buffer;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_copy (data, 0, buffer,
- _dbus_string_get_length (buffer));
- _dbus_message_loader_return_buffer (loader, buffer);
- }
-
- if (!check_loader_results (loader, expected_validity))
- goto failed;
-
- _dbus_message_loader_unref (loader);
- loader = NULL;
-
- /* Write the data 2 bytes at a time */
-
- loader = _dbus_message_loader_new ();
-
- len = _dbus_string_get_length (data);
- for (i = 0; i < len; i += 2)
- {
- DBusString *buffer;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_append_byte (buffer,
- _dbus_string_get_byte (data, i));
- if ((i+1) < len)
- _dbus_string_append_byte (buffer,
- _dbus_string_get_byte (data, i+1));
- _dbus_message_loader_return_buffer (loader, buffer);
- }
-
- if (!check_loader_results (loader, expected_validity))
- goto failed;
-
- _dbus_message_loader_unref (loader);
- loader = NULL;
-
- retval = TRUE;
-
- failed:
-
- if (loader)
- _dbus_message_loader_unref (loader);
-
- return retval;
-}
-
-static dbus_bool_t
-process_test_subdir (const DBusString *test_base_dir,
- const char *subdir,
- DBusValidity expected_validity,
- DBusForeachMessageFileFunc function,
- void *user_data)
-{
- DBusString test_directory;
- DBusString filename;
- DBusDirIter *dir;
- dbus_bool_t retval;
- DBusError error = DBUS_ERROR_INIT;
-
- retval = FALSE;
- dir = NULL;
-
- if (!_dbus_string_init (&test_directory))
- _dbus_assert_not_reached ("didn't allocate test_directory\n");
-
- _dbus_string_init_const (&filename, subdir);
-
- if (!_dbus_string_copy (test_base_dir, 0,
- &test_directory, 0))
- _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
-
- if (!_dbus_concat_dir_and_file (&test_directory, &filename))
- _dbus_assert_not_reached ("couldn't allocate full path");
-
- _dbus_string_free (&filename);
- if (!_dbus_string_init (&filename))
- _dbus_assert_not_reached ("didn't allocate filename string\n");
-
- dir = _dbus_directory_open (&test_directory, &error);
- if (dir == NULL)
- {
- _dbus_warn ("Could not open %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- printf ("Testing %s:\n", subdir);
-
- next:
- while (_dbus_directory_get_next_file (dir, &filename, &error))
- {
- DBusString full_path;
-
- if (!_dbus_string_init (&full_path))
- _dbus_assert_not_reached ("couldn't init string");
-
- if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
- _dbus_assert_not_reached ("couldn't copy dir to full_path");
-
- if (!_dbus_concat_dir_and_file (&full_path, &filename))
- _dbus_assert_not_reached ("couldn't concat file to dir");
-
- if (_dbus_string_ends_with_c_str (&filename, ".message-raw"))
- ;
- else
- {
- if (_dbus_string_ends_with_c_str (&filename, ".message"))
- {
- printf ("SKIP: Could not load %s, message builder language no longer supported\n",
- _dbus_string_get_const_data (&filename));
- }
-
- _dbus_verbose ("Skipping non-.message file %s\n",
- _dbus_string_get_const_data (&filename));
- _dbus_string_free (&full_path);
- goto next;
- }
-
- printf (" %s\n",
- _dbus_string_get_const_data (&filename));
-
- if (! (*function) (&full_path,
- expected_validity, user_data))
- {
- _dbus_string_free (&full_path);
- goto failed;
- }
- else
- _dbus_string_free (&full_path);
- }
-
- if (dbus_error_is_set (&error))
- {
- _dbus_warn ("Could not get next file in %s: %s\n",
- _dbus_string_get_const_data (&test_directory),
- error.message);
- dbus_error_free (&error);
- goto failed;
- }
-
- retval = TRUE;
-
- failed:
-
- if (dir)
- _dbus_directory_close (dir);
- _dbus_string_free (&test_directory);
- _dbus_string_free (&filename);
-
- return retval;
-}
-
-/**
- * Runs the given function on every message file in the test suite.
- * The function should return #FALSE on test failure or fatal error.
- *
- * @param test_data_dir root dir of the test suite data files (top_srcdir/test/data)
- * @param func the function to run
- * @param user_data data for function
- * @returns #FALSE if there's a failure
- */
-dbus_bool_t
-dbus_internal_do_not_use_foreach_message_file (const char *test_data_dir,
- DBusForeachMessageFileFunc func,
- void *user_data)
-{
- DBusString test_directory;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- _dbus_string_init_const (&test_directory, test_data_dir);
-
- if (!process_test_subdir (&test_directory, "valid-messages",
- DBUS_VALID, func, user_data))
- goto failed;
-
- check_memleaks ();
-
- if (!process_test_subdir (&test_directory, "invalid-messages",
- DBUS_INVALID_FOR_UNKNOWN_REASON, func, user_data))
- goto failed;
-
- check_memleaks ();
-
- if (!process_test_subdir (&test_directory, "incomplete-messages",
- DBUS_VALID_BUT_INCOMPLETE, func, user_data))
- goto failed;
-
- check_memleaks ();
-
- retval = TRUE;
-
- failed:
-
- _dbus_string_free (&test_directory);
-
- return retval;
-}
-
-#if 0
-#define GET_AND_CHECK(iter, typename, literal) \
- do { \
- if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_##typename) \
- _dbus_assert_not_reached ("got wrong argument type from message iter"); \
- dbus_message_iter_get_basic (&iter, &v_##typename); \
- if (v_##typename != literal) \
- _dbus_assert_not_reached ("got wrong value from message iter"); \
- } while (0)
-
-#define GET_AND_CHECK_STRCMP(iter, typename, literal) \
- do { \
- if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_##typename) \
- _dbus_assert_not_reached ("got wrong argument type from message iter"); \
- dbus_message_iter_get_basic (&iter, &v_##typename); \
- if (strcmp (v_##typename, literal) != 0) \
- _dbus_assert_not_reached ("got wrong value from message iter"); \
- } while (0)
-
-#define GET_AND_CHECK_AND_NEXT(iter, typename, literal) \
- do { \
- GET_AND_CHECK(iter, typename, literal); \
- if (!dbus_message_iter_next (&iter)) \
- _dbus_assert_not_reached ("failed to move iter to next"); \
- } while (0)
-
-#define GET_AND_CHECK_STRCMP_AND_NEXT(iter, typename, literal) \
- do { \
- GET_AND_CHECK_STRCMP(iter, typename, literal); \
- if (!dbus_message_iter_next (&iter)) \
- _dbus_assert_not_reached ("failed to move iter to next"); \
- } while (0)
-
-static void
-message_iter_test (DBusMessage *message)
-{
- DBusMessageIter iter, array, array2;
- const char *v_STRING;
- double v_DOUBLE;
- dbus_int16_t v_INT16;
- dbus_uint16_t v_UINT16;
- dbus_int32_t v_INT32;
- dbus_uint32_t v_UINT32;
- dbus_int64_t v_INT64;
- dbus_uint64_t v_UINT64;
- unsigned char v_BYTE;
- dbus_bool_t v_BOOLEAN;
-
- const dbus_int32_t *our_int_array;
- int len;
-
- dbus_message_iter_init (message, &iter);
-
- GET_AND_CHECK_STRCMP_AND_NEXT (iter, STRING, "Test string");
- GET_AND_CHECK_AND_NEXT (iter, INT32, -0x12345678);
- GET_AND_CHECK_AND_NEXT (iter, UINT32, 0xedd1e);
- GET_AND_CHECK_AND_NEXT (iter, DOUBLE, 3.14159);
-
- if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_ARRAY)
- _dbus_assert_not_reached ("Argument type not an array");
-
- if (dbus_message_iter_get_element_type (&iter) != DBUS_TYPE_DOUBLE)
- _dbus_assert_not_reached ("Array type not double");
-
- dbus_message_iter_recurse (&iter, &array);
-
- GET_AND_CHECK_AND_NEXT (array, DOUBLE, 1.5);
- GET_AND_CHECK (array, DOUBLE, 2.5);
-
- if (dbus_message_iter_next (&array))
- _dbus_assert_not_reached ("Didn't reach end of array");
-
- if (!dbus_message_iter_next (&iter))
- _dbus_assert_not_reached ("Reached end of arguments");
-
- GET_AND_CHECK_AND_NEXT (iter, BYTE, 0xF0);
-
- if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_ARRAY)
- _dbus_assert_not_reached ("no array");
-
- if (dbus_message_iter_get_element_type (&iter) != DBUS_TYPE_INT32)
- _dbus_assert_not_reached ("Array type not int32");
-
- /* Empty array */
- dbus_message_iter_recurse (&iter, &array);
-
- if (dbus_message_iter_next (&array))
- _dbus_assert_not_reached ("Didn't reach end of array");
-
- if (!dbus_message_iter_next (&iter))
- _dbus_assert_not_reached ("Reached end of arguments");
-
- GET_AND_CHECK (iter, BYTE, 0xF0);
-
- if (dbus_message_iter_next (&iter))
- _dbus_assert_not_reached ("Didn't reach end of arguments");
-}
-#endif
-
-static void
-verify_test_message (DBusMessage *message)
-{
- DBusMessageIter iter;
- DBusError error = DBUS_ERROR_INIT;
- dbus_int16_t our_int16;
- dbus_uint16_t our_uint16;
- dbus_int32_t our_int;
- dbus_uint32_t our_uint;
- const char *our_str;
- double our_double;
- double v_DOUBLE;
- dbus_bool_t our_bool;
- unsigned char our_byte_1, our_byte_2;
- const dbus_uint32_t *our_uint32_array = (void*)0xdeadbeef;
- int our_uint32_array_len;
- dbus_int32_t *our_int32_array = (void*)0xdeadbeef;
- int our_int32_array_len;
- dbus_int64_t our_int64;
- dbus_uint64_t our_uint64;
- dbus_int64_t *our_uint64_array = (void*)0xdeadbeef;
- int our_uint64_array_len;
- const dbus_int64_t *our_int64_array = (void*)0xdeadbeef;
- int our_int64_array_len;
- const double *our_double_array = (void*)0xdeadbeef;
- int our_double_array_len;
- const unsigned char *our_byte_array = (void*)0xdeadbeef;
- int our_byte_array_len;
- const dbus_bool_t *our_boolean_array = (void*)0xdeadbeef;
- int our_boolean_array_len;
- char **our_string_array;
- int our_string_array_len;
-
- dbus_message_iter_init (message, &iter);
-
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_INT16, &our_int16,
- DBUS_TYPE_UINT16, &our_uint16,
- DBUS_TYPE_INT32, &our_int,
- DBUS_TYPE_UINT32, &our_uint,
- DBUS_TYPE_INT64, &our_int64,
- DBUS_TYPE_UINT64, &our_uint64,
- DBUS_TYPE_STRING, &our_str,
- DBUS_TYPE_DOUBLE, &our_double,
- DBUS_TYPE_BOOLEAN, &our_bool,
- DBUS_TYPE_BYTE, &our_byte_1,
- DBUS_TYPE_BYTE, &our_byte_2,
- DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32,
- &our_uint32_array, &our_uint32_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
- &our_int32_array, &our_int32_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_UINT64,
- &our_uint64_array, &our_uint64_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_INT64,
- &our_int64_array, &our_int64_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_DOUBLE,
- &our_double_array, &our_double_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
- &our_byte_array, &our_byte_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BOOLEAN,
- &our_boolean_array, &our_boolean_array_len,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array, &our_string_array_len,
- 0))
- {
- _dbus_warn ("error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- _dbus_assert_not_reached ("Could not get arguments");
- }
-
- if (our_int16 != -0x123)
- _dbus_assert_not_reached ("16-bit integers differ!");
-
- if (our_uint16 != 0x123)
- _dbus_assert_not_reached ("16-bit uints differ!");
-
- if (our_int != -0x12345678)
- _dbus_assert_not_reached ("integers differ!");
-
- if (our_uint != 0x12300042)
- _dbus_assert_not_reached ("uints differ!");
-
- if (our_int64 != DBUS_INT64_CONSTANT (-0x123456789abcd))
- _dbus_assert_not_reached ("64-bit integers differ!");
- if (our_uint64 != DBUS_UINT64_CONSTANT (0x123456789abcd))
- _dbus_assert_not_reached ("64-bit unsigned integers differ!");
-
- v_DOUBLE = 3.14159;
- if (! _DBUS_DOUBLES_BITWISE_EQUAL (our_double, v_DOUBLE))
- _dbus_assert_not_reached ("doubles differ!");
-
- if (strcmp (our_str, "Test string") != 0)
- _dbus_assert_not_reached ("strings differ!");
-
- if (!our_bool)
- _dbus_assert_not_reached ("booleans differ");
-
- if (our_byte_1 != 42)
- _dbus_assert_not_reached ("bytes differ!");
-
- if (our_byte_2 != 24)
- _dbus_assert_not_reached ("bytes differ!");
-
- if (our_uint32_array_len != 4 ||
- our_uint32_array[0] != 0x12345678 ||
- our_uint32_array[1] != 0x23456781 ||
- our_uint32_array[2] != 0x34567812 ||
- our_uint32_array[3] != 0x45678123)
- _dbus_assert_not_reached ("uint array differs");
-
- if (our_int32_array_len != 4 ||
- our_int32_array[0] != 0x12345678 ||
- our_int32_array[1] != -0x23456781 ||
- our_int32_array[2] != 0x34567812 ||
- our_int32_array[3] != -0x45678123)
- _dbus_assert_not_reached ("int array differs");
-
- if (our_uint64_array_len != 4 ||
- our_uint64_array[0] != 0x12345678 ||
- our_uint64_array[1] != 0x23456781 ||
- our_uint64_array[2] != 0x34567812 ||
- our_uint64_array[3] != 0x45678123)
- _dbus_assert_not_reached ("uint64 array differs");
-
- if (our_int64_array_len != 4 ||
- our_int64_array[0] != 0x12345678 ||
- our_int64_array[1] != -0x23456781 ||
- our_int64_array[2] != 0x34567812 ||
- our_int64_array[3] != -0x45678123)
- _dbus_assert_not_reached ("int64 array differs");
-
- if (our_double_array_len != 3)
- _dbus_assert_not_reached ("double array had wrong length");
-
- /* On all IEEE machines (i.e. everything sane) exact equality
- * should be preserved over the wire
- */
- v_DOUBLE = 0.1234;
- if (! _DBUS_DOUBLES_BITWISE_EQUAL (our_double_array[0], v_DOUBLE))
- _dbus_assert_not_reached ("double array had wrong values");
- v_DOUBLE = 9876.54321;
- if (! _DBUS_DOUBLES_BITWISE_EQUAL (our_double_array[1], v_DOUBLE))
- _dbus_assert_not_reached ("double array had wrong values");
- v_DOUBLE = -300.0;
- if (! _DBUS_DOUBLES_BITWISE_EQUAL (our_double_array[2], v_DOUBLE))
- _dbus_assert_not_reached ("double array had wrong values");
-
- if (our_byte_array_len != 4)
- _dbus_assert_not_reached ("byte array had wrong length");
-
- if (our_byte_array[0] != 'a' ||
- our_byte_array[1] != 'b' ||
- our_byte_array[2] != 'c' ||
- our_byte_array[3] != 234)
- _dbus_assert_not_reached ("byte array had wrong values");
-
- if (our_boolean_array_len != 5)
- _dbus_assert_not_reached ("bool array had wrong length");
-
- if (our_boolean_array[0] != TRUE ||
- our_boolean_array[1] != FALSE ||
- our_boolean_array[2] != TRUE ||
- our_boolean_array[3] != TRUE ||
- our_boolean_array[4] != FALSE)
- _dbus_assert_not_reached ("bool array had wrong values");
-
- if (our_string_array_len != 4)
- _dbus_assert_not_reached ("string array was wrong length");
-
- if (strcmp (our_string_array[0], "Foo") != 0 ||
- strcmp (our_string_array[1], "bar") != 0 ||
- strcmp (our_string_array[2], "") != 0 ||
- strcmp (our_string_array[3], "woo woo woo woo") != 0)
- _dbus_assert_not_reached ("string array had wrong values");
-
- dbus_free_string_array (our_string_array);
-
- if (dbus_message_iter_next (&iter))
- _dbus_assert_not_reached ("Didn't reach end of arguments");
-}
-
-static void
-verify_test_message_args_ignored (DBusMessage *message)
-{
- DBusMessageIter iter;
- DBusError error = DBUS_ERROR_INIT;
- dbus_uint32_t our_uint;
- DBusInitialFDs *initial_fds;
-
- initial_fds = _dbus_check_fdleaks_enter ();
-
- /* parse with empty signature: "" */
- dbus_message_iter_init (message, &iter);
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_INVALID))
- {
- _dbus_warn ("error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- }
- else
- {
- _dbus_assert (!dbus_error_is_set (&error));
- _dbus_verbose ("arguments ignored.\n");
- }
-
- /* parse with shorter signature: "u" */
- dbus_message_iter_init (message, &iter);
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_UINT32, &our_uint,
- DBUS_TYPE_INVALID))
- {
- _dbus_warn ("error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- }
- else
- {
- _dbus_assert (!dbus_error_is_set (&error));
- _dbus_verbose ("arguments ignored.\n");
- }
-
- _dbus_check_fdleaks_leave (initial_fds);
-}
-
-static void
-verify_test_message_memleak (DBusMessage *message)
-{
- DBusMessageIter iter;
- DBusError error = DBUS_ERROR_INIT;
- dbus_uint32_t our_uint1;
- dbus_uint32_t our_uint2;
- dbus_uint32_t our_uint3;
- char **our_string_array1;
- int our_string_array_len1;
- char **our_string_array2;
- int our_string_array_len2;
- int our_unix_fd1;
- int our_unix_fd2;
- DBusInitialFDs *initial_fds;
-
- initial_fds = _dbus_check_fdleaks_enter ();
-
- /* parse with wrong signature: "uashuu" */
- dbus_error_free (&error);
- dbus_message_iter_init (message, &iter);
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_UINT32, &our_uint1,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array1, &our_string_array_len1,
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &our_unix_fd1,
-#endif
- DBUS_TYPE_UINT32, &our_uint2,
- DBUS_TYPE_UINT32, &our_uint3,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("expected error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- /* ensure array of string and unix fd not leaked */
- _dbus_assert (our_string_array1 == NULL);
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_assert (our_unix_fd1 == -1);
-#endif
- }
- else
- {
- _dbus_warn ("error: parse with wrong signature: 'uashuu'.\n");
- }
-
- /* parse with wrong signature: "uashuashu" */
- dbus_message_iter_init (message, &iter);
- dbus_error_free (&error);
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_UINT32, &our_uint1,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array1, &our_string_array_len1,
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &our_unix_fd1,
-#endif
- DBUS_TYPE_UINT32, &our_uint2,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array2, &our_string_array_len2,
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &our_unix_fd2,
-#endif
- DBUS_TYPE_UINT32, &our_uint3,
- DBUS_TYPE_INVALID))
- {
- _dbus_verbose ("expected error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- /* ensure array of string and unix fd not leaked */
- _dbus_assert (our_string_array1 == NULL);
- _dbus_assert (our_string_array2 == NULL);
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_assert (our_unix_fd1 == -1);
- _dbus_assert (our_unix_fd2 == -1);
-#endif
- }
- else
- {
- _dbus_warn ("error: parse with wrong signature: 'uashuashu'.\n");
- }
-
- /* parse with correct signature: "uashuash" */
- dbus_message_iter_init (message, &iter);
- dbus_error_free (&error);
- if (!dbus_message_iter_get_args (&iter, &error,
- DBUS_TYPE_UINT32, &our_uint1,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array1, &our_string_array_len1,
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &our_unix_fd1,
-#endif
- DBUS_TYPE_UINT32, &our_uint2,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &our_string_array2, &our_string_array_len2,
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &our_unix_fd2,
-#endif
- DBUS_TYPE_INVALID))
- {
- _dbus_warn ("error: %s - %s\n", error.name,
- (error.message != NULL) ? error.message : "no message");
- _dbus_assert_not_reached ("Could not get arguments");
- }
- else
- {
- dbus_free_string_array (our_string_array1);
- dbus_free_string_array (our_string_array2);
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_close (our_unix_fd1, &error);
- _dbus_close (our_unix_fd2, &error);
-#endif
- }
- _dbus_check_fdleaks_leave (initial_fds);
-}
-
-/**
- * @ingroup DBusMessageInternals
- * Unit test for DBusMessage.
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_message_test (const char *test_data_dir)
-{
- DBusMessage *message, *message_without_unix_fds;
- DBusMessageLoader *loader;
- int i;
- const char *data;
- DBusMessage *copy;
- const char *name1;
- const char *name2;
- const dbus_uint32_t our_uint32_array[] =
- { 0x12345678, 0x23456781, 0x34567812, 0x45678123 };
- const dbus_int32_t our_int32_array[] =
- { 0x12345678, -0x23456781, 0x34567812, -0x45678123 };
- const dbus_uint32_t *v_ARRAY_UINT32 = our_uint32_array;
- const dbus_int32_t *v_ARRAY_INT32 = our_int32_array;
- const dbus_uint64_t our_uint64_array[] =
- { 0x12345678, 0x23456781, 0x34567812, 0x45678123 };
- const dbus_int64_t our_int64_array[] =
- { 0x12345678, -0x23456781, 0x34567812, -0x45678123 };
- const dbus_uint64_t *v_ARRAY_UINT64 = our_uint64_array;
- const dbus_int64_t *v_ARRAY_INT64 = our_int64_array;
- const char *our_string_array[] = { "Foo", "bar", "", "woo woo woo woo" };
- const char *our_string_array1[] = { "foo", "Bar", "", "Woo woo Woo woo" };
- const char **v_ARRAY_STRING = our_string_array;
- const char **v1_ARRAY_STRING = our_string_array1;
- const double our_double_array[] = { 0.1234, 9876.54321, -300.0 };
- const double *v_ARRAY_DOUBLE = our_double_array;
- const unsigned char our_byte_array[] = { 'a', 'b', 'c', 234 };
- const unsigned char *v_ARRAY_BYTE = our_byte_array;
- const dbus_bool_t our_boolean_array[] = { TRUE, FALSE, TRUE, TRUE, FALSE };
- const dbus_bool_t *v_ARRAY_BOOLEAN = our_boolean_array;
- char sig[64];
- const char *s;
- const char *v_STRING;
- double v_DOUBLE;
- dbus_int16_t v_INT16;
- dbus_uint16_t v_UINT16;
- dbus_int32_t v_INT32;
- dbus_uint32_t v_UINT32;
- dbus_uint32_t v1_UINT32;
- dbus_int64_t v_INT64;
- dbus_uint64_t v_UINT64;
- unsigned char v_BYTE;
- unsigned char v2_BYTE;
- dbus_bool_t v_BOOLEAN;
- DBusMessageIter iter, array_iter, struct_iter;
-#ifdef HAVE_UNIX_FD_PASSING
- int v_UNIX_FD;
- int v1_UNIX_FD;
-#endif
- char **decomposed;
- DBusInitialFDs *initial_fds;
-
- initial_fds = _dbus_check_fdleaks_enter ();
-
- message = dbus_message_new_method_call ("org.freedesktop.DBus.TestService",
- "/org/freedesktop/TestPath",
- "Foo.TestInterface",
- "TestMethod");
- _dbus_assert (dbus_message_has_destination (message, "org.freedesktop.DBus.TestService"));
- _dbus_assert (dbus_message_is_method_call (message, "Foo.TestInterface",
- "TestMethod"));
- _dbus_assert (strcmp (dbus_message_get_path (message),
- "/org/freedesktop/TestPath") == 0);
- dbus_message_set_serial (message, 1234);
-
- /* string length including nul byte not a multiple of 4 */
- if (!dbus_message_set_sender (message, "org.foo.bar1"))
- _dbus_assert_not_reached ("out of memory");
-
- _dbus_assert (dbus_message_has_sender (message, "org.foo.bar1"));
- dbus_message_set_reply_serial (message, 5678);
-
- _dbus_verbose_bytes_of_string (&message->header.data, 0,
- _dbus_string_get_length (&message->header.data));
- _dbus_verbose_bytes_of_string (&message->body, 0,
- _dbus_string_get_length (&message->body));
-
- if (!dbus_message_set_sender (message, NULL))
- _dbus_assert_not_reached ("out of memory");
-
-
- _dbus_verbose_bytes_of_string (&message->header.data, 0,
- _dbus_string_get_length (&message->header.data));
- _dbus_verbose_bytes_of_string (&message->body, 0,
- _dbus_string_get_length (&message->body));
-
-
- _dbus_assert (!dbus_message_has_sender (message, "org.foo.bar1"));
- _dbus_assert (dbus_message_get_serial (message) == 1234);
- _dbus_assert (dbus_message_get_reply_serial (message) == 5678);
- _dbus_assert (dbus_message_has_destination (message, "org.freedesktop.DBus.TestService"));
-
- _dbus_assert (dbus_message_get_no_reply (message) == FALSE);
- dbus_message_set_no_reply (message, TRUE);
- _dbus_assert (dbus_message_get_no_reply (message) == TRUE);
- dbus_message_set_no_reply (message, FALSE);
- _dbus_assert (dbus_message_get_no_reply (message) == FALSE);
-
- /* Set/get some header fields */
-
- if (!dbus_message_set_path (message, "/foo"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_path (message),
- "/foo") == 0);
-
- if (!dbus_message_set_interface (message, "org.Foo"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_interface (message),
- "org.Foo") == 0);
-
- if (!dbus_message_set_member (message, "Bar"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_member (message),
- "Bar") == 0);
-
- /* Set/get them with longer values */
- if (!dbus_message_set_path (message, "/foo/bar"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_path (message),
- "/foo/bar") == 0);
-
- if (!dbus_message_set_interface (message, "org.Foo.Bar"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_interface (message),
- "org.Foo.Bar") == 0);
-
- if (!dbus_message_set_member (message, "BarFoo"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_member (message),
- "BarFoo") == 0);
-
- /* Realloc shorter again */
-
- if (!dbus_message_set_path (message, "/foo"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_path (message),
- "/foo") == 0);
-
- if (!dbus_message_set_interface (message, "org.Foo"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_interface (message),
- "org.Foo") == 0);
-
- if (!dbus_message_set_member (message, "Bar"))
- _dbus_assert_not_reached ("out of memory");
- _dbus_assert (strcmp (dbus_message_get_member (message),
- "Bar") == 0);
-
- /* Path decomposing */
- dbus_message_set_path (message, NULL);
- dbus_message_get_path_decomposed (message, &decomposed);
- _dbus_assert (decomposed == NULL);
- dbus_free_string_array (decomposed);
-
- dbus_message_set_path (message, "/");
- dbus_message_get_path_decomposed (message, &decomposed);
- _dbus_assert (decomposed != NULL);
- _dbus_assert (decomposed[0] == NULL);
- dbus_free_string_array (decomposed);
-
- dbus_message_set_path (message, "/a/b");
- dbus_message_get_path_decomposed (message, &decomposed);
- _dbus_assert (decomposed != NULL);
- _dbus_assert (strcmp (decomposed[0], "a") == 0);
- _dbus_assert (strcmp (decomposed[1], "b") == 0);
- _dbus_assert (decomposed[2] == NULL);
- dbus_free_string_array (decomposed);
-
- dbus_message_set_path (message, "/spam/eggs");
- dbus_message_get_path_decomposed (message, &decomposed);
- _dbus_assert (decomposed != NULL);
- _dbus_assert (strcmp (decomposed[0], "spam") == 0);
- _dbus_assert (strcmp (decomposed[1], "eggs") == 0);
- _dbus_assert (decomposed[2] == NULL);
- dbus_free_string_array (decomposed);
-
- dbus_message_unref (message);
-
- /* Test the vararg functions */
- message = dbus_message_new_method_call ("org.freedesktop.DBus.TestService",
- "/org/freedesktop/TestPath",
- "Foo.TestInterface",
- "TestMethod");
- dbus_message_set_serial (message, 1);
- dbus_message_set_reply_serial (message, 5678);
-
- v_INT16 = -0x123;
- v_UINT16 = 0x123;
- v_INT32 = -0x12345678;
- v_UINT32 = 0x12300042;
- v_INT64 = DBUS_INT64_CONSTANT (-0x123456789abcd);
- v_UINT64 = DBUS_UINT64_CONSTANT (0x123456789abcd);
- v_STRING = "Test string";
- v_DOUBLE = 3.14159;
- v_BOOLEAN = TRUE;
- v_BYTE = 42;
- v2_BYTE = 24;
-#ifdef HAVE_UNIX_FD_PASSING
- v_UNIX_FD = 1;
- v1_UNIX_FD = 2;
-#endif
-
- dbus_message_append_args (message,
- DBUS_TYPE_INT16, &v_INT16,
- DBUS_TYPE_UINT16, &v_UINT16,
- DBUS_TYPE_INT32, &v_INT32,
- DBUS_TYPE_UINT32, &v_UINT32,
- DBUS_TYPE_INT64, &v_INT64,
- DBUS_TYPE_UINT64, &v_UINT64,
- DBUS_TYPE_STRING, &v_STRING,
- DBUS_TYPE_DOUBLE, &v_DOUBLE,
- DBUS_TYPE_BOOLEAN, &v_BOOLEAN,
- DBUS_TYPE_BYTE, &v_BYTE,
- DBUS_TYPE_BYTE, &v2_BYTE,
- DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &v_ARRAY_UINT32,
- _DBUS_N_ELEMENTS (our_uint32_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY_INT32,
- _DBUS_N_ELEMENTS (our_int32_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_UINT64, &v_ARRAY_UINT64,
- _DBUS_N_ELEMENTS (our_uint64_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_INT64, &v_ARRAY_INT64,
- _DBUS_N_ELEMENTS (our_int64_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_DOUBLE, &v_ARRAY_DOUBLE,
- _DBUS_N_ELEMENTS (our_double_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &v_ARRAY_BYTE,
- _DBUS_N_ELEMENTS (our_byte_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_BOOLEAN, &v_ARRAY_BOOLEAN,
- _DBUS_N_ELEMENTS (our_boolean_array),
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &v_ARRAY_STRING,
- _DBUS_N_ELEMENTS (our_string_array),
-
- DBUS_TYPE_INVALID);
-
- i = 0;
- sig[i++] = DBUS_TYPE_INT16;
- sig[i++] = DBUS_TYPE_UINT16;
- sig[i++] = DBUS_TYPE_INT32;
- sig[i++] = DBUS_TYPE_UINT32;
- sig[i++] = DBUS_TYPE_INT64;
- sig[i++] = DBUS_TYPE_UINT64;
- sig[i++] = DBUS_TYPE_STRING;
- sig[i++] = DBUS_TYPE_DOUBLE;
- sig[i++] = DBUS_TYPE_BOOLEAN;
- sig[i++] = DBUS_TYPE_BYTE;
- sig[i++] = DBUS_TYPE_BYTE;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_UINT32;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_INT32;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_UINT64;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_INT64;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_DOUBLE;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_BYTE;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_BOOLEAN;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_STRING;
-
- message_without_unix_fds = dbus_message_copy(message);
- _dbus_assert(message_without_unix_fds);
-#ifdef HAVE_UNIX_FD_PASSING
- dbus_message_append_args (message,
- DBUS_TYPE_UNIX_FD, &v_UNIX_FD,
- DBUS_TYPE_INVALID);
- sig[i++] = DBUS_TYPE_UNIX_FD;
-#endif
- sig[i++] = DBUS_TYPE_INVALID;
-
- _dbus_assert (i < (int) _DBUS_N_ELEMENTS (sig));
-
- _dbus_verbose ("HEADER\n");
- _dbus_verbose_bytes_of_string (&message->header.data, 0,
- _dbus_string_get_length (&message->header.data));
- _dbus_verbose ("BODY\n");
- _dbus_verbose_bytes_of_string (&message->body, 0,
- _dbus_string_get_length (&message->body));
-
- _dbus_verbose ("Signature expected \"%s\" actual \"%s\"\n",
- sig, dbus_message_get_signature (message));
-
- s = dbus_message_get_signature (message);
-
- _dbus_assert (dbus_message_has_signature (message, sig));
- _dbus_assert (strcmp (s, sig) == 0);
-
- verify_test_message (message);
-
- copy = dbus_message_copy (message);
-
- _dbus_assert (dbus_message_get_reply_serial (message) ==
- dbus_message_get_reply_serial (copy));
- _dbus_assert (message->header.padding == copy->header.padding);
-
- _dbus_assert (_dbus_string_get_length (&message->header.data) ==
- _dbus_string_get_length (&copy->header.data));
-
- _dbus_assert (_dbus_string_get_length (&message->body) ==
- _dbus_string_get_length (&copy->body));
-
- verify_test_message (copy);
-
- name1 = dbus_message_get_interface (message);
- name2 = dbus_message_get_interface (copy);
-
- _dbus_assert (strcmp (name1, name2) == 0);
-
- name1 = dbus_message_get_member (message);
- name2 = dbus_message_get_member (copy);
-
- _dbus_assert (strcmp (name1, name2) == 0);
-
- dbus_message_unref (copy);
-
- /* Message loader test */
- dbus_message_lock (message);
- loader = _dbus_message_loader_new ();
-
- /* check ref/unref */
- _dbus_message_loader_ref (loader);
- _dbus_message_loader_unref (loader);
-
- /* Write the header data one byte at a time */
- data = _dbus_string_get_const_data (&message->header.data);
- for (i = 0; i < _dbus_string_get_length (&message->header.data); i++)
- {
- DBusString *buffer;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer);
- }
-
- /* Write the body data one byte at a time */
- data = _dbus_string_get_const_data (&message->body);
- for (i = 0; i < _dbus_string_get_length (&message->body); i++)
- {
- DBusString *buffer;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer);
- }
-
-#ifdef HAVE_UNIX_FD_PASSING
- {
- int *unix_fds;
- unsigned n_unix_fds;
- /* Write unix fd */
- _dbus_message_loader_get_unix_fds(loader, &unix_fds, &n_unix_fds);
- _dbus_assert(n_unix_fds > 0);
- _dbus_assert(message->n_unix_fds == 1);
- unix_fds[0] = _dbus_dup(message->unix_fds[0], NULL);
- _dbus_assert(unix_fds[0] >= 0);
- _dbus_message_loader_return_unix_fds(loader, unix_fds, 1);
- }
-#endif
-
- dbus_message_unref (message);
-
- /* Now pop back the message */
- if (!_dbus_message_loader_queue_messages (loader))
- _dbus_assert_not_reached ("no memory to queue messages");
-
- if (_dbus_message_loader_get_is_corrupted (loader))
- _dbus_assert_not_reached ("message loader corrupted");
-
- message = _dbus_message_loader_pop_message (loader);
- if (!message)
- _dbus_assert_not_reached ("received a NULL message");
-
- if (dbus_message_get_reply_serial (message) != 5678)
- _dbus_assert_not_reached ("reply serial fields differ");
-
- dbus_message_unref (message);
-
- /* ovveride the serial, since it was reset by dbus_message_copy() */
- dbus_message_set_serial(message_without_unix_fds, 8901);
-
- dbus_message_lock (message_without_unix_fds);
-
- verify_test_message (message_without_unix_fds);
-
- {
- /* Marshal and demarshal the message. */
-
- DBusMessage *message2;
- DBusError error = DBUS_ERROR_INIT;
- char *marshalled = NULL;
- int len = 0;
- char garbage_header[DBUS_MINIMUM_HEADER_SIZE] = "xxx";
-
- if (!dbus_message_marshal (message_without_unix_fds, &marshalled, &len))
- _dbus_assert_not_reached ("failed to marshal message");
-
- _dbus_assert (len != 0);
- _dbus_assert (marshalled != NULL);
-
- _dbus_assert (dbus_message_demarshal_bytes_needed (marshalled, len) == len);
- message2 = dbus_message_demarshal (marshalled, len, &error);
-
- _dbus_assert (message2 != NULL);
- _dbus_assert (!dbus_error_is_set (&error));
- verify_test_message (message2);
-
- dbus_message_unref (message2);
- dbus_free (marshalled);
-
- /* Demarshal invalid message. */
-
- message2 = dbus_message_demarshal ("invalid", 7, &error);
- _dbus_assert (message2 == NULL);
- _dbus_assert (dbus_error_is_set (&error));
- dbus_error_free (&error);
-
- /* Demarshal invalid (empty) message. */
-
- message2 = dbus_message_demarshal ("", 0, &error);
- _dbus_assert (message2 == NULL);
- _dbus_assert (dbus_error_is_set (&error));
- dbus_error_free (&error);
-
- /* Bytes needed to demarshal empty message: 0 (more) */
-
- _dbus_assert (dbus_message_demarshal_bytes_needed ("", 0) == 0);
-
- /* Bytes needed to demarshal invalid message: -1 (error). */
-
- _dbus_assert (dbus_message_demarshal_bytes_needed (garbage_header, DBUS_MINIMUM_HEADER_SIZE) == -1);
- }
-
- dbus_message_unref (message_without_unix_fds);
- _dbus_message_loader_unref (loader);
-
- check_memleaks ();
- _dbus_check_fdleaks_leave (initial_fds);
- initial_fds = _dbus_check_fdleaks_enter ();
-
- /* Check that we can abandon a container */
- message = dbus_message_new_method_call ("org.freedesktop.DBus.TestService",
- "/org/freedesktop/TestPath",
- "Foo.TestInterface",
- "Method");
-
- dbus_message_iter_init_append (message, &iter);
-
- _dbus_assert (dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY,
- (DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING),
- &array_iter));
- _dbus_assert (dbus_message_iter_open_container (&array_iter, DBUS_TYPE_STRUCT,
- NULL, &struct_iter));
-
- s = "peaches";
- _dbus_assert (dbus_message_iter_append_basic (&struct_iter, DBUS_TYPE_STRING,
- &s));
-
- /* uh-oh, error, try and unwind */
-
- dbus_message_iter_abandon_container (&array_iter, &struct_iter);
- dbus_message_iter_abandon_container (&array_iter, &iter);
-
- dbus_message_unref (message);
-
- /* Check we should not leak array of string or unix fd, fd.o#21259 */
- message = dbus_message_new_method_call ("org.freedesktop.DBus.TestService",
- "/org/freedesktop/TestPath",
- "Foo.TestInterface",
- "Method");
-
- /* signature "uashuash" */
- dbus_message_append_args (message,
- DBUS_TYPE_UINT32, &v_UINT32,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &v_ARRAY_STRING,
- _DBUS_N_ELEMENTS (our_string_array),
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &v_UNIX_FD,
-#endif
- DBUS_TYPE_UINT32, &v1_UINT32,
- DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &v1_ARRAY_STRING,
- _DBUS_N_ELEMENTS (our_string_array1),
-#ifdef HAVE_UNIX_FD_PASSING
- DBUS_TYPE_UNIX_FD, &v1_UNIX_FD,
-#endif
-
- DBUS_TYPE_INVALID);
-
- i = 0;
- sig[i++] = DBUS_TYPE_UINT32;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_STRING;
-#ifdef HAVE_UNIX_FD_PASSING
- sig[i++] = DBUS_TYPE_UNIX_FD;
-#endif
- sig[i++] = DBUS_TYPE_UINT32;
- sig[i++] = DBUS_TYPE_ARRAY;
- sig[i++] = DBUS_TYPE_STRING;
-#ifdef HAVE_UNIX_FD_PASSING
- sig[i++] = DBUS_TYPE_UNIX_FD;
-#endif
- sig[i++] = DBUS_TYPE_INVALID;
-
- _dbus_assert (i < (int) _DBUS_N_ELEMENTS (sig));
-
- verify_test_message_args_ignored (message);
- verify_test_message_memleak (message);
-
- dbus_message_unref (message);
-
- /* Load all the sample messages from the message factory */
- {
- DBusMessageDataIter diter;
- DBusMessageData mdata;
- int count;
-
- reset_validities_seen ();
-
- count = 0;
- _dbus_message_data_iter_init (&diter);
-
- while (_dbus_message_data_iter_get_and_next (&diter,
- &mdata))
- {
- if (!dbus_internal_do_not_use_try_message_data (&mdata.data,
- mdata.expected_validity))
- {
- _dbus_warn ("expected validity %d and did not get it\n",
- mdata.expected_validity);
- _dbus_assert_not_reached ("message data failed");
- }
-
- _dbus_message_data_free (&mdata);
-
- count += 1;
- }
-
- printf ("%d sample messages tested\n", count);
-
- print_validities_seen (FALSE);
- print_validities_seen (TRUE);
- }
-
- check_memleaks ();
- _dbus_check_fdleaks_leave (initial_fds);
-
- /* Now load every message in test_data_dir if we have one */
- if (test_data_dir == NULL)
- return TRUE;
-
- initial_fds = _dbus_check_fdleaks_enter ();
-
- if (!dbus_internal_do_not_use_foreach_message_file (test_data_dir,
- (DBusForeachMessageFileFunc)
- dbus_internal_do_not_use_try_message_file,
- NULL))
- _dbus_assert_not_reached ("foreach_message_file test failed");
-
- _dbus_check_fdleaks_leave (initial_fds);
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-message.c
deleted file mode 100644
index 32ac37a260..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message.c
+++ /dev/null
@@ -1,4840 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message.c DBusMessage object
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat Inc.
- * Copyright (C) 2002, 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-validate.h"
-#include "dbus-marshal-byteswap.h"
-#include "dbus-marshal-header.h"
-#include "dbus-signature.h"
-#include "dbus-message-private.h"
-#include "dbus-object-tree.h"
-#include "dbus-memory.h"
-#include "dbus-list.h"
-#include "dbus-threads-internal.h"
-#ifdef HAVE_UNIX_FD_PASSING
-#include "dbus-sysdeps-unix.h"
-#endif
-
-#include <string.h>
-
-#define _DBUS_TYPE_IS_STRINGLIKE(type) \
- (type == DBUS_TYPE_STRING || type == DBUS_TYPE_SIGNATURE || \
- type == DBUS_TYPE_OBJECT_PATH)
-
-static void dbus_message_finalize (DBusMessage *message);
-
-/**
- * @defgroup DBusMessageInternals DBusMessage implementation details
- * @ingroup DBusInternals
- * @brief DBusMessage private implementation details.
- *
- * The guts of DBusMessage and its methods.
- *
- * @{
- */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static dbus_bool_t
-_dbus_enable_message_cache (void)
-{
- static int enabled = -1;
-
- if (enabled < 0)
- {
- const char *s = _dbus_getenv ("DBUS_MESSAGE_CACHE");
-
- enabled = TRUE;
-
- if (s && *s)
- {
- if (*s == '0')
- enabled = FALSE;
- else if (*s == '1')
- enabled = TRUE;
- else
- _dbus_warn ("DBUS_MESSAGE_CACHE should be 0 or 1 if set, not '%s'",
- s);
- }
- }
-
- return enabled;
-}
-#else
- /* constant expression, should be optimized away */
-# define _dbus_enable_message_cache() (TRUE)
-#endif
-
-#ifndef _dbus_message_trace_ref
-void
-_dbus_message_trace_ref (DBusMessage *message,
- int old_refcount,
- int new_refcount,
- const char *why)
-{
- static int enabled = -1;
-
- _dbus_trace_ref ("DBusMessage", message, old_refcount, new_refcount, why,
- "DBUS_MESSAGE_TRACE", &enabled);
-}
-#endif
-
-/* Not thread locked, but strictly const/read-only so should be OK
- */
-/** An static string representing an empty signature */
-_DBUS_STRING_DEFINE_STATIC(_dbus_empty_signature_str, "");
-
-/* these have wacky values to help trap uninitialized iterators;
- * but has to fit in 3 bits
- */
-enum {
- DBUS_MESSAGE_ITER_TYPE_READER = 3,
- DBUS_MESSAGE_ITER_TYPE_WRITER = 7
-};
-
-/** typedef for internals of message iterator */
-typedef struct DBusMessageRealIter DBusMessageRealIter;
-
-/**
- * @brief Internals of DBusMessageIter
- *
- * Object representing a position in a message. All fields are internal.
- */
-struct DBusMessageRealIter
-{
- DBusMessage *message; /**< Message used */
- dbus_uint32_t changed_stamp : CHANGED_STAMP_BITS; /**< stamp to detect invalid iters */
- dbus_uint32_t iter_type : 3; /**< whether this is a reader or writer iter */
- dbus_uint32_t sig_refcount : 8; /**< depth of open_signature() */
- union
- {
- DBusTypeWriter writer; /**< writer */
- DBusTypeReader reader; /**< reader */
- } u; /**< the type writer or reader that does all the work */
-};
-
-static void
-get_const_signature (DBusHeader *header,
- const DBusString **type_str_p,
- int *type_pos_p)
-{
- if (_dbus_header_get_field_raw (header,
- DBUS_HEADER_FIELD_SIGNATURE,
- type_str_p,
- type_pos_p))
- {
- *type_pos_p += 1; /* skip the signature length which is 1 byte */
- }
- else
- {
- *type_str_p = &_dbus_empty_signature_str;
- *type_pos_p = 0;
- }
-}
-
-/**
- * Swaps the message to compiler byte order if required
- *
- * @param message the message
- */
-static void
-_dbus_message_byteswap (DBusMessage *message)
-{
- const DBusString *type_str;
- int type_pos;
- char byte_order;
-
- byte_order = _dbus_header_get_byte_order (&message->header);
-
- if (byte_order == DBUS_COMPILER_BYTE_ORDER)
- return;
-
- _dbus_verbose ("Swapping message into compiler byte order\n");
-
- get_const_signature (&message->header, &type_str, &type_pos);
-
- _dbus_marshal_byteswap (type_str, type_pos,
- byte_order,
- DBUS_COMPILER_BYTE_ORDER,
- &message->body, 0);
-
- _dbus_header_byteswap (&message->header, DBUS_COMPILER_BYTE_ORDER);
- _dbus_assert (_dbus_header_get_byte_order (&message->header) ==
- DBUS_COMPILER_BYTE_ORDER);
-}
-
-/** byte-swap the message if it doesn't match our byte order.
- * Called only when we need the message in our own byte order,
- * normally when reading arrays of integers or doubles.
- * Otherwise should not be called since it would do needless
- * work.
- */
-#define ensure_byte_order(message) _dbus_message_byteswap (message)
-
-/**
- * Gets the data to be sent over the network for this message.
- * The header and then the body should be written out.
- * This function is guaranteed to always return the same
- * data once a message is locked (with dbus_message_lock()).
- *
- * @param message the message.
- * @param header return location for message header data.
- * @param body return location for message body data.
- */
-void
-_dbus_message_get_network_data (DBusMessage *message,
- const DBusString **header,
- const DBusString **body)
-{
- _dbus_assert (message->locked);
-
- *header = &message->header.data;
- *body = &message->body;
-}
-
-/**
- * Gets the unix fds to be sent over the network for this message.
- * This function is guaranteed to always return the same data once a
- * message is locked (with dbus_message_lock()).
- *
- * @param message the message.
- * @param fds return location of unix fd array
- * @param n_fds return number of entries in array
- */
-void _dbus_message_get_unix_fds(DBusMessage *message,
- const int **fds,
- unsigned *n_fds)
-{
- _dbus_assert (message->locked);
-
-#ifdef HAVE_UNIX_FD_PASSING
- *fds = message->unix_fds;
- *n_fds = message->n_unix_fds;
-#else
- *fds = NULL;
- *n_fds = 0;
-#endif
-}
-
-/**
- * Sets the serial number of a message.
- * This can only be done once on a message.
- *
- * DBusConnection will automatically set the serial to an appropriate value
- * when the message is sent; this function is only needed when encapsulating
- * messages in another protocol, or otherwise bypassing DBusConnection.
- *
- * @param message the message
- * @param serial the serial
- */
-void
-dbus_message_set_serial (DBusMessage *message,
- dbus_uint32_t serial)
-{
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (!message->locked);
-
- _dbus_header_set_serial (&message->header, serial);
-}
-
-/**
- * Adds a counter to be incremented immediately with the size/unix fds
- * of this message, and decremented by the size/unix fds of this
- * message when this message if finalized. The link contains a
- * counter with its refcount already incremented, but the counter
- * itself not incremented. Ownership of link and counter refcount is
- * passed to the message.
- *
- * This function may be called with locks held. As a result, the counter's
- * notify function is not called; the caller is expected to either call
- * _dbus_counter_notify() on the counter when they are no longer holding
- * locks, or take the same action that would be taken by the notify function.
- *
- * @param message the message
- * @param link link with counter as data
- */
-void
-_dbus_message_add_counter_link (DBusMessage *message,
- DBusList *link)
-{
- /* right now we don't recompute the delta when message
- * size changes, and that's OK for current purposes
- * I think, but could be important to change later.
- * Do recompute it whenever there are no outstanding counters,
- * since it's basically free.
- */
- if (message->counters == NULL)
- {
- message->size_counter_delta =
- _dbus_string_get_length (&message->header.data) +
- _dbus_string_get_length (&message->body);
-
-#ifdef HAVE_UNIX_FD_PASSING
- message->unix_fd_counter_delta = message->n_unix_fds;
-#endif
-
-#if 0
- _dbus_verbose ("message has size %ld\n",
- message->size_counter_delta);
-#endif
- }
-
- _dbus_list_append_link (&message->counters, link);
-
- _dbus_counter_adjust_size (link->data, message->size_counter_delta);
-
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_counter_adjust_unix_fd (link->data, message->unix_fd_counter_delta);
-#endif
-}
-
-/**
- * Adds a counter to be incremented immediately with the size/unix fds
- * of this message, and decremented by the size/unix fds of this
- * message when this message if finalized.
- *
- * This function may be called with locks held. As a result, the counter's
- * notify function is not called; the caller is expected to either call
- * _dbus_counter_notify() on the counter when they are no longer holding
- * locks, or take the same action that would be taken by the notify function.
- *
- * @param message the message
- * @param counter the counter
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_message_add_counter (DBusMessage *message,
- DBusCounter *counter)
-{
- DBusList *link;
-
- link = _dbus_list_alloc_link (counter);
- if (link == NULL)
- return FALSE;
-
- _dbus_counter_ref (counter);
- _dbus_message_add_counter_link (message, link);
-
- return TRUE;
-}
-
-/**
- * Removes a counter tracking the size/unix fds of this message, and
- * decrements the counter by the size/unix fds of this message.
- *
- * @param message the message
- * @param counter the counter
- */
-void
-_dbus_message_remove_counter (DBusMessage *message,
- DBusCounter *counter)
-{
- DBusList *link;
-
- link = _dbus_list_find_last (&message->counters,
- counter);
- _dbus_assert (link != NULL);
-
- _dbus_list_remove_link (&message->counters, link);
-
- _dbus_counter_adjust_size (counter, - message->size_counter_delta);
-
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_counter_adjust_unix_fd (counter, - message->unix_fd_counter_delta);
-#endif
-
- _dbus_counter_notify (counter);
- _dbus_counter_unref (counter);
-}
-
-/**
- * Locks a message. Allows checking that applications don't keep a
- * reference to a message in the outgoing queue and change it
- * underneath us. Messages are locked when they enter the outgoing
- * queue (dbus_connection_send_message()), and the library complains
- * if the message is modified while locked. This function may also
- * called externally, for applications wrapping D-Bus in another protocol.
- *
- * @param message the message to lock.
- */
-void
-dbus_message_lock (DBusMessage *message)
-{
- if (!message->locked)
- {
- _dbus_header_update_lengths (&message->header,
- _dbus_string_get_length (&message->body));
-
- /* must have a signature if you have a body */
- _dbus_assert (_dbus_string_get_length (&message->body) == 0 ||
- dbus_message_get_signature (message) != NULL);
-
- message->locked = TRUE;
- }
-}
-
-static dbus_bool_t
-set_or_delete_string_field (DBusMessage *message,
- int field,
- int typecode,
- const char *value)
-{
- if (value == NULL)
- return _dbus_header_delete_field (&message->header, field);
- else
- return _dbus_header_set_field_basic (&message->header,
- field,
- typecode,
- &value);
-}
-
-#if 0
-/* Probably we don't need to use this */
-/**
- * Sets the signature of the message, i.e. the arguments in the
- * message payload. The signature includes only "in" arguments for
- * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
- * #DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from
- * what you might expect (it does not include the signature of the
- * entire C++-style method).
- *
- * The signature is a string made up of type codes such as
- * #DBUS_TYPE_INT32. The string is terminated with nul (nul is also
- * the value of #DBUS_TYPE_INVALID). The macros such as
- * #DBUS_TYPE_INT32 evaluate to integers; to assemble a signature you
- * may find it useful to use the string forms, such as
- * #DBUS_TYPE_INT32_AS_STRING.
- *
- * An "unset" or #NULL signature is considered the same as an empty
- * signature. In fact dbus_message_get_signature() will never return
- * #NULL.
- *
- * @param message the message
- * @param signature the type signature or #NULL to unset
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-_dbus_message_set_signature (DBusMessage *message,
- const char *signature)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (signature == NULL ||
- _dbus_check_is_valid_signature (signature));
- /* can't delete the signature if you have a message body */
- _dbus_return_val_if_fail (_dbus_string_get_length (&message->body) == 0 ||
- signature != NULL);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- signature);
-}
-#endif
-
-/* Message Cache
- *
- * We cache some DBusMessage to reduce the overhead of allocating
- * them. In my profiling this consistently made about an 8%
- * difference. It avoids the malloc for the message, the malloc for
- * the slot list, the malloc for the header string and body string,
- * and the associated free() calls. It does introduce another global
- * lock which could be a performance issue in certain cases.
- *
- * For the echo client/server the round trip time goes from around
- * .000077 to .000069 with the message cache on my laptop. The sysprof
- * change is as follows (numbers are cumulative percentage):
- *
- * with message cache implemented as array as it is now (0.000069 per):
- * new_empty_header 1.46
- * mutex_lock 0.56 # i.e. _DBUS_LOCK(message_cache)
- * mutex_unlock 0.25
- * self 0.41
- * unref 2.24
- * self 0.68
- * list_clear 0.43
- * mutex_lock 0.33 # i.e. _DBUS_LOCK(message_cache)
- * mutex_unlock 0.25
- *
- * with message cache implemented as list (0.000070 per roundtrip):
- * new_empty_header 2.72
- * list_pop_first 1.88
- * unref 3.3
- * list_prepend 1.63
- *
- * without cache (0.000077 per roundtrip):
- * new_empty_header 6.7
- * string_init_preallocated 3.43
- * dbus_malloc 2.43
- * dbus_malloc0 2.59
- *
- * unref 4.02
- * string_free 1.82
- * dbus_free 1.63
- * dbus_free 0.71
- *
- * If you implement the message_cache with a list, the primary reason
- * it's slower is that you add another thread lock (on the DBusList
- * mempool).
- */
-
-/** Avoid caching huge messages */
-#define MAX_MESSAGE_SIZE_TO_CACHE 10 * _DBUS_ONE_KILOBYTE
-
-/** Avoid caching too many messages */
-#define MAX_MESSAGE_CACHE_SIZE 5
-
-/* Protected by _DBUS_LOCK (message_cache) */
-static DBusMessage *message_cache[MAX_MESSAGE_CACHE_SIZE];
-static int message_cache_count = 0;
-static dbus_bool_t message_cache_shutdown_registered = FALSE;
-
-static void
-dbus_message_cache_shutdown (void *data)
-{
- int i;
-
- if (!_DBUS_LOCK (message_cache))
- _dbus_assert_not_reached ("we would have initialized global locks "
- "before registering a shutdown function");
-
- i = 0;
- while (i < MAX_MESSAGE_CACHE_SIZE)
- {
- if (message_cache[i])
- dbus_message_finalize (message_cache[i]);
-
- ++i;
- }
-
- message_cache_count = 0;
- message_cache_shutdown_registered = FALSE;
-
- _DBUS_UNLOCK (message_cache);
-}
-
-/**
- * Tries to get a message from the message cache. The retrieved
- * message will have junk in it, so it still needs to be cleared out
- * in dbus_message_new_empty_header()
- *
- * @returns the message, or #NULL if none cached
- */
-static DBusMessage*
-dbus_message_get_cached (void)
-{
- DBusMessage *message;
- int i;
-
- message = NULL;
-
- if (!_DBUS_LOCK (message_cache))
- {
- /* we'd have initialized global locks before caching anything,
- * so there can't be anything in the cache */
- return NULL;
- }
-
- _dbus_assert (message_cache_count >= 0);
-
- if (message_cache_count == 0)
- {
- _DBUS_UNLOCK (message_cache);
- return NULL;
- }
-
- /* This is not necessarily true unless count > 0, and
- * message_cache is uninitialized until the shutdown is
- * registered
- */
- _dbus_assert (message_cache_shutdown_registered);
-
- i = 0;
- while (i < MAX_MESSAGE_CACHE_SIZE)
- {
- if (message_cache[i])
- {
- message = message_cache[i];
- message_cache[i] = NULL;
- message_cache_count -= 1;
- break;
- }
- ++i;
- }
- _dbus_assert (message_cache_count >= 0);
- _dbus_assert (i < MAX_MESSAGE_CACHE_SIZE);
- _dbus_assert (message != NULL);
-
- _dbus_assert (_dbus_atomic_get (&message->refcount) == 0);
-
- _dbus_assert (message->counters == NULL);
-
- _DBUS_UNLOCK (message_cache);
-
- return message;
-}
-
-#ifdef HAVE_UNIX_FD_PASSING
-static void
-close_unix_fds(int *fds, unsigned *n_fds)
-{
- DBusError e;
- int i;
-
- if (*n_fds <= 0)
- return;
-
- dbus_error_init(&e);
-
- for (i = 0; i < *n_fds; i++)
- {
- if (!_dbus_close(fds[i], &e))
- {
- _dbus_warn("Failed to close file descriptor: %s\n", e.message);
- dbus_error_free(&e);
- }
- }
-
- *n_fds = 0;
-
- /* We don't free the array here, in case we can recycle it later */
-}
-#endif
-
-static void
-free_counter (void *element,
- void *data)
-{
- DBusCounter *counter = element;
- DBusMessage *message = data;
-
- _dbus_counter_adjust_size (counter, - message->size_counter_delta);
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_counter_adjust_unix_fd (counter, - message->unix_fd_counter_delta);
-#endif
-
- _dbus_counter_notify (counter);
- _dbus_counter_unref (counter);
-}
-
-/**
- * Tries to cache a message, otherwise finalize it.
- *
- * @param message the message
- */
-static void
-dbus_message_cache_or_finalize (DBusMessage *message)
-{
- dbus_bool_t was_cached;
- int i;
-
- _dbus_assert (_dbus_atomic_get (&message->refcount) == 0);
-
- /* This calls application code and has to be done first thing
- * without holding the lock
- */
- _dbus_data_slot_list_clear (&message->slot_list);
-
- _dbus_list_foreach (&message->counters,
- free_counter, message);
- _dbus_list_clear (&message->counters);
-
-#ifdef HAVE_UNIX_FD_PASSING
- close_unix_fds(message->unix_fds, &message->n_unix_fds);
-#endif
-
- was_cached = FALSE;
-
- if (!_DBUS_LOCK (message_cache))
- {
- /* The only way to get a non-null message goes through
- * dbus_message_get_cached() which takes the lock. */
- _dbus_assert_not_reached ("we would have initialized global locks "
- "the first time we constructed a message");
- }
-
- if (!message_cache_shutdown_registered)
- {
- _dbus_assert (message_cache_count == 0);
-
- if (!_dbus_register_shutdown_func (dbus_message_cache_shutdown, NULL))
- goto out;
-
- i = 0;
- while (i < MAX_MESSAGE_CACHE_SIZE)
- {
- message_cache[i] = NULL;
- ++i;
- }
-
- message_cache_shutdown_registered = TRUE;
- }
-
- _dbus_assert (message_cache_count >= 0);
-
- if (!_dbus_enable_message_cache ())
- goto out;
-
- if ((_dbus_string_get_length (&message->header.data) +
- _dbus_string_get_length (&message->body)) >
- MAX_MESSAGE_SIZE_TO_CACHE)
- goto out;
-
- if (message_cache_count >= MAX_MESSAGE_CACHE_SIZE)
- goto out;
-
- /* Find empty slot */
- i = 0;
- while (message_cache[i] != NULL)
- ++i;
-
- _dbus_assert (i < MAX_MESSAGE_CACHE_SIZE);
-
- _dbus_assert (message_cache[i] == NULL);
- message_cache[i] = message;
- message_cache_count += 1;
- was_cached = TRUE;
-#ifndef DBUS_DISABLE_CHECKS
- message->in_cache = TRUE;
-#endif
-
- out:
- _dbus_assert (_dbus_atomic_get (&message->refcount) == 0);
-
- _DBUS_UNLOCK (message_cache);
-
- if (!was_cached)
- dbus_message_finalize (message);
-}
-
-#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
-static dbus_bool_t
-_dbus_message_iter_check (DBusMessageRealIter *iter)
-{
- char byte_order;
-
- if (iter == NULL)
- {
- _dbus_warn_check_failed ("dbus message iterator is NULL\n");
- return FALSE;
- }
-
- byte_order = _dbus_header_get_byte_order (&iter->message->header);
-
- if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_READER)
- {
- if (iter->u.reader.byte_order != byte_order)
- {
- _dbus_warn_check_failed ("dbus message changed byte order since iterator was created\n");
- return FALSE;
- }
- /* because we swap the message into compiler order when you init an iter */
- _dbus_assert (iter->u.reader.byte_order == DBUS_COMPILER_BYTE_ORDER);
- }
- else if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER)
- {
- if (iter->u.writer.byte_order != byte_order)
- {
- _dbus_warn_check_failed ("dbus message changed byte order since append iterator was created\n");
- return FALSE;
- }
- /* because we swap the message into compiler order when you init an iter */
- _dbus_assert (iter->u.writer.byte_order == DBUS_COMPILER_BYTE_ORDER);
- }
- else
- {
- _dbus_warn_check_failed ("dbus message iterator looks uninitialized or corrupted\n");
- return FALSE;
- }
-
- if (iter->changed_stamp != iter->message->changed_stamp)
- {
- _dbus_warn_check_failed ("dbus message iterator invalid because the message has been modified (or perhaps the iterator is just uninitialized)\n");
- return FALSE;
- }
-
- return TRUE;
-}
-#endif /* DBUS_ENABLE_CHECKS || DBUS_ENABLE_ASSERT */
-
-/**
- * Implementation of the varargs arg-getting functions.
- * dbus_message_get_args() is the place to go for complete
- * documentation.
- *
- * @see dbus_message_get_args
- * @param iter the message iter
- * @param error error to be filled in
- * @param first_arg_type type of the first argument
- * @param var_args return location for first argument, followed by list of type/location pairs
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-_dbus_message_iter_get_args_valist (DBusMessageIter *iter,
- DBusError *error,
- int first_arg_type,
- va_list var_args)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- int spec_type, msg_type, i, j;
- dbus_bool_t retval;
- va_list copy_args;
-
- _dbus_assert (_dbus_message_iter_check (real));
-
- retval = FALSE;
-
- spec_type = first_arg_type;
- i = 0;
-
- /* copy var_args first, then we can do another iteration over it to
- * free memory and close unix fds if parse failed at some point.
- */
- va_copy (copy_args, var_args);
-
- while (spec_type != DBUS_TYPE_INVALID)
- {
- msg_type = dbus_message_iter_get_arg_type (iter);
-
- if (msg_type != spec_type)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Argument %d is specified to be of type \"%s\", but "
- "is actually of type \"%s\"\n", i,
- _dbus_type_to_string (spec_type),
- _dbus_type_to_string (msg_type));
-
- goto out;
- }
-
- if (spec_type == DBUS_TYPE_UNIX_FD)
- {
-#ifdef HAVE_UNIX_FD_PASSING
- DBusBasicValue idx;
- int *pfd, nfd;
-
- pfd = va_arg (var_args, int*);
- _dbus_assert(pfd);
-
- _dbus_type_reader_read_basic(&real->u.reader, &idx);
-
- if (idx.u32 >= real->message->n_unix_fds)
- {
- dbus_set_error (error, DBUS_ERROR_INCONSISTENT_MESSAGE,
- "Message refers to file descriptor at index %i,"
- "but has only %i descriptors attached.\n",
- idx.u32,
- real->message->n_unix_fds);
- goto out;
- }
-
- if ((nfd = _dbus_dup(real->message->unix_fds[idx.u32], error)) < 0)
- goto out;
-
- *pfd = nfd;
-#else
- dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
- "Platform does not support file desciptor passing.\n");
- goto out;
-#endif
- }
- else if (dbus_type_is_basic (spec_type))
- {
- DBusBasicValue *ptr;
-
- ptr = va_arg (var_args, DBusBasicValue*);
-
- _dbus_assert (ptr != NULL);
-
- _dbus_type_reader_read_basic (&real->u.reader,
- ptr);
- }
- else if (spec_type == DBUS_TYPE_ARRAY)
- {
- int element_type;
- int spec_element_type;
- const DBusBasicValue **ptr;
- int *n_elements_p;
- DBusTypeReader array;
-
- spec_element_type = va_arg (var_args, int);
- element_type = _dbus_type_reader_get_element_type (&real->u.reader);
-
- if (spec_element_type != element_type)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Argument %d is specified to be an array of \"%s\", but "
- "is actually an array of \"%s\"\n",
- i,
- _dbus_type_to_string (spec_element_type),
- _dbus_type_to_string (element_type));
-
- goto out;
- }
-
- if (dbus_type_is_fixed (spec_element_type) &&
- element_type != DBUS_TYPE_UNIX_FD)
- {
- ptr = va_arg (var_args, const DBusBasicValue**);
- n_elements_p = va_arg (var_args, int*);
-
- _dbus_assert (ptr != NULL);
- _dbus_assert (n_elements_p != NULL);
-
- _dbus_type_reader_recurse (&real->u.reader, &array);
-
- _dbus_type_reader_read_fixed_multi (&array,
- (void *) ptr, n_elements_p);
- }
- else if (_DBUS_TYPE_IS_STRINGLIKE (spec_element_type))
- {
- char ***str_array_p;
- int n_elements;
- char **str_array;
-
- str_array_p = va_arg (var_args, char***);
- n_elements_p = va_arg (var_args, int*);
-
- _dbus_assert (str_array_p != NULL);
- _dbus_assert (n_elements_p != NULL);
-
- /* Count elements in the array */
- _dbus_type_reader_recurse (&real->u.reader, &array);
-
- n_elements = 0;
- while (_dbus_type_reader_get_current_type (&array) != DBUS_TYPE_INVALID)
- {
- ++n_elements;
- _dbus_type_reader_next (&array);
- }
-
- str_array = dbus_new0 (char*, n_elements + 1);
- if (str_array == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- /* Now go through and dup each string */
- _dbus_type_reader_recurse (&real->u.reader, &array);
-
- j = 0;
- while (j < n_elements)
- {
- const char *s;
- _dbus_type_reader_read_basic (&array,
- (void *) &s);
-
- str_array[j] = _dbus_strdup (s);
- if (str_array[j] == NULL)
- {
- dbus_free_string_array (str_array);
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- ++j;
-
- if (!_dbus_type_reader_next (&array))
- _dbus_assert (j == n_elements);
- }
-
- _dbus_assert (_dbus_type_reader_get_current_type (&array) == DBUS_TYPE_INVALID);
- _dbus_assert (j == n_elements);
- _dbus_assert (str_array[j] == NULL);
-
- *str_array_p = str_array;
- *n_elements_p = n_elements;
- }
-#ifndef DBUS_DISABLE_CHECKS
- else
- {
- _dbus_warn ("you can't read arrays of container types (struct, variant, array) with %s for now\n",
- _DBUS_FUNCTION_NAME);
- goto out;
- }
-#endif
- }
-#ifndef DBUS_DISABLE_CHECKS
- else
- {
- _dbus_warn ("you can only read arrays and basic types with %s for now\n",
- _DBUS_FUNCTION_NAME);
- goto out;
- }
-#endif
-
- /* how many arguments already handled */
- i++;
-
- spec_type = va_arg (var_args, int);
- if (!_dbus_type_reader_next (&real->u.reader) && spec_type != DBUS_TYPE_INVALID)
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Message has only %d arguments, but more were expected", i);
- goto out;
- }
- }
-
- retval = TRUE;
-
- out:
- /* there may memory or unix fd leak in the above iteration if parse failed.
- * so we have another iteration over copy_args to free memory and close
- * unix fds.
- */
- if (!retval)
- {
- spec_type = first_arg_type;
- j = 0;
-
- while (j < i)
- {
- if (spec_type == DBUS_TYPE_UNIX_FD)
- {
-#ifdef HAVE_UNIX_FD_PASSING
- int *pfd;
-
- pfd = va_arg (copy_args, int *);
- _dbus_assert(pfd);
- if (*pfd >= 0)
- {
- _dbus_close (*pfd, NULL);
- *pfd = -1;
- }
-#endif
- }
- else if (dbus_type_is_basic (spec_type))
- {
- /* move the index forward */
- va_arg (copy_args, DBusBasicValue *);
- }
- else if (spec_type == DBUS_TYPE_ARRAY)
- {
- int spec_element_type;
-
- spec_element_type = va_arg (copy_args, int);
- if (dbus_type_is_fixed (spec_element_type))
- {
- /* move the index forward */
- va_arg (copy_args, const DBusBasicValue **);
- va_arg (copy_args, int *);
- }
- else if (_DBUS_TYPE_IS_STRINGLIKE (spec_element_type))
- {
- char ***str_array_p;
-
- str_array_p = va_arg (copy_args, char ***);
- /* move the index forward */
- va_arg (copy_args, int *);
- _dbus_assert (str_array_p != NULL);
- dbus_free_string_array (*str_array_p);
- *str_array_p = NULL;
- }
- }
-
- spec_type = va_arg (copy_args, int);
- j++;
- }
- }
-
- va_end (copy_args);
- return retval;
-}
-
-/** @} */
-
-/**
- * @defgroup DBusMessage DBusMessage
- * @ingroup DBus
- * @brief Message to be sent or received over a #DBusConnection.
- *
- * A DBusMessage is the most basic unit of communication over a
- * DBusConnection. A DBusConnection represents a stream of messages
- * received from a remote application, and a stream of messages
- * sent to a remote application.
- *
- * A message has a message type, returned from
- * dbus_message_get_type(). This indicates whether the message is a
- * method call, a reply to a method call, a signal, or an error reply.
- *
- * A message has header fields such as the sender, destination, method
- * or signal name, and so forth. DBusMessage has accessor functions for
- * these, such as dbus_message_get_member().
- *
- * Convenience functions dbus_message_is_method_call(), dbus_message_is_signal(),
- * and dbus_message_is_error() check several header fields at once and are
- * slightly more efficient than checking the header fields with individual
- * accessor functions.
- *
- * Finally, a message has arguments. The number and types of arguments
- * are in the message's signature header field (accessed with
- * dbus_message_get_signature()). Simple argument values are usually
- * retrieved with dbus_message_get_args() but more complex values such
- * as structs may require the use of #DBusMessageIter.
- *
- * The D-Bus specification goes into some more detail about header fields and
- * message types.
- *
- * @{
- */
-
-/**
- * @typedef DBusMessage
- *
- * Opaque data type representing a message received from or to be
- * sent to another application.
- */
-
-/**
- * Returns the serial of a message or 0 if none has been specified.
- * The message's serial number is provided by the application sending
- * the message and is used to identify replies to this message.
- *
- * All messages received on a connection will have a serial provided
- * by the remote application.
- *
- * For messages you're sending, dbus_connection_send() will assign a
- * serial and return it to you.
- *
- * @param message the message
- * @returns the serial
- */
-dbus_uint32_t
-dbus_message_get_serial (DBusMessage *message)
-{
- _dbus_return_val_if_fail (message != NULL, 0);
-
- return _dbus_header_get_serial (&message->header);
-}
-
-/**
- * Sets the reply serial of a message (the serial of the message this
- * is a reply to).
- *
- * @param message the message
- * @param reply_serial the serial we're replying to
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_reply_serial (DBusMessage *message,
- dbus_uint32_t reply_serial)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (reply_serial != 0, FALSE); /* 0 is invalid */
-
- return _dbus_header_set_field_basic (&message->header,
- DBUS_HEADER_FIELD_REPLY_SERIAL,
- DBUS_TYPE_UINT32,
- &reply_serial);
-}
-
-/**
- * Returns the serial that the message is a reply to or 0 if none.
- *
- * @param message the message
- * @returns the reply serial
- */
-dbus_uint32_t
-dbus_message_get_reply_serial (DBusMessage *message)
-{
- dbus_uint32_t v_UINT32;
-
- _dbus_return_val_if_fail (message != NULL, 0);
-
- if (_dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_REPLY_SERIAL,
- DBUS_TYPE_UINT32,
- &v_UINT32))
- return v_UINT32;
- else
- return 0;
-}
-
-static void
-dbus_message_finalize (DBusMessage *message)
-{
- _dbus_assert (_dbus_atomic_get (&message->refcount) == 0);
-
- /* This calls application callbacks! */
- _dbus_data_slot_list_free (&message->slot_list);
-
- _dbus_list_foreach (&message->counters,
- free_counter, message);
- _dbus_list_clear (&message->counters);
-
- _dbus_header_free (&message->header);
- _dbus_string_free (&message->body);
-
-#ifdef HAVE_UNIX_FD_PASSING
- close_unix_fds(message->unix_fds, &message->n_unix_fds);
- dbus_free(message->unix_fds);
-#endif
-
- _dbus_assert (_dbus_atomic_get (&message->refcount) == 0);
-
- dbus_free (message);
-}
-
-static DBusMessage*
-dbus_message_new_empty_header (void)
-{
- DBusMessage *message;
- dbus_bool_t from_cache;
-
- message = dbus_message_get_cached ();
-
- if (message != NULL)
- {
- from_cache = TRUE;
- }
- else
- {
- from_cache = FALSE;
- message = dbus_new0 (DBusMessage, 1);
- if (message == NULL)
- return NULL;
-#ifndef DBUS_DISABLE_CHECKS
- message->generation = _dbus_current_generation;
-#endif
-
-#ifdef HAVE_UNIX_FD_PASSING
- message->unix_fds = NULL;
- message->n_unix_fds_allocated = 0;
-#endif
- }
-
- _dbus_atomic_inc (&message->refcount);
-
- _dbus_message_trace_ref (message, 0, 1, "new_empty_header");
-
- message->locked = FALSE;
-#ifndef DBUS_DISABLE_CHECKS
- message->in_cache = FALSE;
-#endif
- message->counters = NULL;
- message->size_counter_delta = 0;
- message->changed_stamp = 0;
-
-#ifdef HAVE_UNIX_FD_PASSING
- message->n_unix_fds = 0;
- message->n_unix_fds_allocated = 0;
- message->unix_fd_counter_delta = 0;
-#endif
-
- if (!from_cache)
- _dbus_data_slot_list_init (&message->slot_list);
-
- if (from_cache)
- {
- _dbus_header_reinit (&message->header);
- _dbus_string_set_length (&message->body, 0);
- }
- else
- {
- if (!_dbus_header_init (&message->header))
- {
- dbus_free (message);
- return NULL;
- }
-
- if (!_dbus_string_init_preallocated (&message->body, 32))
- {
- _dbus_header_free (&message->header);
- dbus_free (message);
- return NULL;
- }
- }
-
- return message;
-}
-
-/**
- * Constructs a new message of the given message type.
- * Types include #DBUS_MESSAGE_TYPE_METHOD_CALL,
- * #DBUS_MESSAGE_TYPE_SIGNAL, and so forth.
- *
- * Usually you want to use dbus_message_new_method_call(),
- * dbus_message_new_method_return(), dbus_message_new_signal(),
- * or dbus_message_new_error() instead.
- *
- * @param message_type type of message
- * @returns new message or #NULL if no memory
- */
-DBusMessage*
-dbus_message_new (int message_type)
-{
- DBusMessage *message;
-
- _dbus_return_val_if_fail (message_type != DBUS_MESSAGE_TYPE_INVALID, NULL);
-
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return NULL;
-
- if (!_dbus_header_create (&message->header,
- DBUS_COMPILER_BYTE_ORDER,
- message_type,
- NULL, NULL, NULL, NULL, NULL))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- return message;
-}
-
-/**
- * Constructs a new message to invoke a method on a remote
- * object. Returns #NULL if memory can't be allocated for the
- * message. The destination may be #NULL in which case no destination
- * is set; this is appropriate when using D-Bus in a peer-to-peer
- * context (no message bus). The interface may be #NULL, which means
- * that if multiple methods with the given name exist it is undefined
- * which one will be invoked.
- *
- * The path and method names may not be #NULL.
- *
- * Destination, path, interface, and method name can't contain
- * any invalid characters (see the D-Bus specification).
- *
- * @param destination name that the message should be sent to or #NULL
- * @param path object path the message should be sent to
- * @param iface interface to invoke method on, or #NULL
- * @param method method to invoke
- *
- * @returns a new DBusMessage, free with dbus_message_unref()
- */
-DBusMessage*
-dbus_message_new_method_call (const char *destination,
- const char *path,
- const char *iface,
- const char *method)
-{
- DBusMessage *message;
-
- _dbus_return_val_if_fail (path != NULL, NULL);
- _dbus_return_val_if_fail (method != NULL, NULL);
- _dbus_return_val_if_fail (destination == NULL ||
- _dbus_check_is_valid_bus_name (destination), NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_path (path), NULL);
- _dbus_return_val_if_fail (iface == NULL ||
- _dbus_check_is_valid_interface (iface), NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_member (method), NULL);
-
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return NULL;
-
- if (!_dbus_header_create (&message->header,
- DBUS_COMPILER_BYTE_ORDER,
- DBUS_MESSAGE_TYPE_METHOD_CALL,
- destination, path, iface, method, NULL))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- return message;
-}
-
-/**
- * Constructs a message that is a reply to a method call. Returns
- * #NULL if memory can't be allocated for the message.
- *
- * @param method_call the message being replied to
- * @returns a new DBusMessage, free with dbus_message_unref()
- */
-DBusMessage*
-dbus_message_new_method_return (DBusMessage *method_call)
-{
- DBusMessage *message;
- const char *sender;
-
- _dbus_return_val_if_fail (method_call != NULL, NULL);
-
- sender = dbus_message_get_sender (method_call);
-
- /* sender is allowed to be null here in peer-to-peer case */
-
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return NULL;
-
- if (!_dbus_header_create (&message->header,
- DBUS_COMPILER_BYTE_ORDER,
- DBUS_MESSAGE_TYPE_METHOD_RETURN,
- sender, NULL, NULL, NULL, NULL))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- dbus_message_set_no_reply (message, TRUE);
-
- if (!dbus_message_set_reply_serial (message,
- dbus_message_get_serial (method_call)))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- return message;
-}
-
-/**
- * Constructs a new message representing a signal emission. Returns
- * #NULL if memory can't be allocated for the message. A signal is
- * identified by its originating object path, interface, and the name
- * of the signal.
- *
- * Path, interface, and signal name must all be valid (the D-Bus
- * specification defines the syntax of these fields).
- *
- * @param path the path to the object emitting the signal
- * @param iface the interface the signal is emitted from
- * @param name name of the signal
- * @returns a new DBusMessage, free with dbus_message_unref()
- */
-DBusMessage*
-dbus_message_new_signal (const char *path,
- const char *iface,
- const char *name)
-{
- DBusMessage *message;
-
- _dbus_return_val_if_fail (path != NULL, NULL);
- _dbus_return_val_if_fail (iface != NULL, NULL);
- _dbus_return_val_if_fail (name != NULL, NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_path (path), NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_interface (iface), NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_member (name), NULL);
-
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return NULL;
-
- if (!_dbus_header_create (&message->header,
- DBUS_COMPILER_BYTE_ORDER,
- DBUS_MESSAGE_TYPE_SIGNAL,
- NULL, path, iface, name, NULL))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- dbus_message_set_no_reply (message, TRUE);
-
- return message;
-}
-
-/**
- * Creates a new message that is an error reply to another message.
- * Error replies are most common in response to method calls, but
- * can be returned in reply to any message.
- *
- * The error name must be a valid error name according to the syntax
- * given in the D-Bus specification. If you don't want to make
- * up an error name just use #DBUS_ERROR_FAILED.
- *
- * @param reply_to the message we're replying to
- * @param error_name the error name
- * @param error_message the error message string (or #NULL for none, but please give a message)
- * @returns a new error message object, free with dbus_message_unref()
- */
-DBusMessage*
-dbus_message_new_error (DBusMessage *reply_to,
- const char *error_name,
- const char *error_message)
-{
- DBusMessage *message;
- const char *sender;
- DBusMessageIter iter;
-
- _dbus_return_val_if_fail (reply_to != NULL, NULL);
- _dbus_return_val_if_fail (error_name != NULL, NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_error_name (error_name), NULL);
-
- sender = dbus_message_get_sender (reply_to);
-
- /* sender may be NULL for non-message-bus case or
- * when the message bus is dealing with an unregistered
- * connection.
- */
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return NULL;
-
- if (!_dbus_header_create (&message->header,
- DBUS_COMPILER_BYTE_ORDER,
- DBUS_MESSAGE_TYPE_ERROR,
- sender, NULL, NULL, NULL, error_name))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- dbus_message_set_no_reply (message, TRUE);
-
- if (!dbus_message_set_reply_serial (message,
- dbus_message_get_serial (reply_to)))
- {
- dbus_message_unref (message);
- return NULL;
- }
-
- if (error_message != NULL)
- {
- dbus_message_iter_init_append (message, &iter);
- if (!dbus_message_iter_append_basic (&iter,
- DBUS_TYPE_STRING,
- &error_message))
- {
- dbus_message_unref (message);
- return NULL;
- }
- }
-
- return message;
-}
-
-/**
- * Creates a new message that is an error reply to another message, allowing
- * you to use printf formatting.
- *
- * See dbus_message_new_error() for details - this function is the same
- * aside from the printf formatting.
- *
- * @todo add _DBUS_GNUC_PRINTF to this (requires moving _DBUS_GNUC_PRINTF to
- * public header, see DBUS_DEPRECATED for an example)
- *
- * @param reply_to the original message
- * @param error_name the error name
- * @param error_format the error message format as with printf
- * @param ... format string arguments
- * @returns a new error message
- */
-DBusMessage*
-dbus_message_new_error_printf (DBusMessage *reply_to,
- const char *error_name,
- const char *error_format,
- ...)
-{
- va_list args;
- DBusString str;
- DBusMessage *message;
-
- _dbus_return_val_if_fail (reply_to != NULL, NULL);
- _dbus_return_val_if_fail (error_name != NULL, NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_error_name (error_name), NULL);
-
- if (!_dbus_string_init (&str))
- return NULL;
-
- va_start (args, error_format);
-
- if (_dbus_string_append_printf_valist (&str, error_format, args))
- message = dbus_message_new_error (reply_to, error_name,
- _dbus_string_get_const_data (&str));
- else
- message = NULL;
-
- _dbus_string_free (&str);
-
- va_end (args);
-
- return message;
-}
-
-
-/**
- * Creates a new message that is an exact replica of the message
- * specified, except that its refcount is set to 1, its message serial
- * is reset to 0, and if the original message was "locked" (in the
- * outgoing message queue and thus not modifiable) the new message
- * will not be locked.
- *
- * @todo This function can't be used in programs that try to recover from OOM errors.
- *
- * @param message the message
- * @returns the new message.or #NULL if not enough memory or Unix file descriptors (in case the message to copy includes Unix file descriptors) can be allocated.
- */
-DBusMessage *
-dbus_message_copy (const DBusMessage *message)
-{
- DBusMessage *retval;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- retval = dbus_new0 (DBusMessage, 1);
- if (retval == NULL)
- return NULL;
-
- _dbus_atomic_inc (&retval->refcount);
-
- retval->locked = FALSE;
-#ifndef DBUS_DISABLE_CHECKS
- retval->generation = message->generation;
-#endif
-
- if (!_dbus_header_copy (&message->header, &retval->header))
- {
- dbus_free (retval);
- return NULL;
- }
-
- if (!_dbus_string_init_preallocated (&retval->body,
- _dbus_string_get_length (&message->body)))
- {
- _dbus_header_free (&retval->header);
- dbus_free (retval);
- return NULL;
- }
-
- if (!_dbus_string_copy (&message->body, 0,
- &retval->body, 0))
- goto failed_copy;
-
-#ifdef HAVE_UNIX_FD_PASSING
- retval->unix_fds = dbus_new(int, message->n_unix_fds);
- if (retval->unix_fds == NULL && message->n_unix_fds > 0)
- goto failed_copy;
-
- retval->n_unix_fds_allocated = message->n_unix_fds;
-
- for (retval->n_unix_fds = 0;
- retval->n_unix_fds < message->n_unix_fds;
- retval->n_unix_fds++)
- {
- retval->unix_fds[retval->n_unix_fds] = _dbus_dup(message->unix_fds[retval->n_unix_fds], NULL);
-
- if (retval->unix_fds[retval->n_unix_fds] < 0)
- goto failed_copy;
- }
-
-#endif
-
- _dbus_message_trace_ref (retval, 0, 1, "copy");
- return retval;
-
- failed_copy:
- _dbus_header_free (&retval->header);
- _dbus_string_free (&retval->body);
-
-#ifdef HAVE_UNIX_FD_PASSING
- close_unix_fds(retval->unix_fds, &retval->n_unix_fds);
- dbus_free(retval->unix_fds);
-#endif
-
- dbus_free (retval);
-
- return NULL;
-}
-
-
-/**
- * Increments the reference count of a DBusMessage.
- *
- * @param message the message
- * @returns the message
- * @see dbus_message_unref
- */
-DBusMessage *
-dbus_message_ref (DBusMessage *message)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
- _dbus_return_val_if_fail (message->generation == _dbus_current_generation, NULL);
- _dbus_return_val_if_fail (!message->in_cache, NULL);
-
- old_refcount = _dbus_atomic_inc (&message->refcount);
- _dbus_assert (old_refcount >= 1);
- _dbus_message_trace_ref (message, old_refcount, old_refcount + 1, "ref");
-
- return message;
-}
-
-/**
- * Decrements the reference count of a DBusMessage, freeing the
- * message if the count reaches 0.
- *
- * @param message the message
- * @see dbus_message_ref
- */
-void
-dbus_message_unref (DBusMessage *message)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (message->generation == _dbus_current_generation);
- _dbus_return_if_fail (!message->in_cache);
-
- old_refcount = _dbus_atomic_dec (&message->refcount);
-
- _dbus_assert (old_refcount >= 1);
-
- _dbus_message_trace_ref (message, old_refcount, old_refcount - 1, "unref");
-
- if (old_refcount == 1)
- {
- /* Calls application callbacks! */
- dbus_message_cache_or_finalize (message);
- }
-}
-
-/**
- * Gets the type of a message. Types include
- * #DBUS_MESSAGE_TYPE_METHOD_CALL, #DBUS_MESSAGE_TYPE_METHOD_RETURN,
- * #DBUS_MESSAGE_TYPE_ERROR, #DBUS_MESSAGE_TYPE_SIGNAL, but other
- * types are allowed and all code must silently ignore messages of
- * unknown type. #DBUS_MESSAGE_TYPE_INVALID will never be returned.
- *
- * @param message the message
- * @returns the type of the message
- */
-int
-dbus_message_get_type (DBusMessage *message)
-{
- _dbus_return_val_if_fail (message != NULL, DBUS_MESSAGE_TYPE_INVALID);
-
- return _dbus_header_get_message_type (&message->header);
-}
-
-/**
- * Appends fields to a message given a variable argument list. The
- * variable argument list should contain the type of each argument
- * followed by the value to append. Appendable types are basic types,
- * and arrays of fixed-length basic types (except arrays of Unix file
- * descriptors). To append variable-length basic types, or any more
- * complex value, you have to use an iterator rather than this
- * function.
- *
- * To append a basic type, specify its type code followed by the
- * address of the value. For example:
- *
- * @code
- *
- * dbus_int32_t v_INT32 = 42;
- * const char *v_STRING = "Hello World";
- * dbus_message_append_args (message,
- * DBUS_TYPE_INT32, &v_INT32,
- * DBUS_TYPE_STRING, &v_STRING,
- * DBUS_TYPE_INVALID);
- * @endcode
- *
- * To append an array of fixed-length basic types (except Unix file
- * descriptors), pass in the DBUS_TYPE_ARRAY typecode, the element
- * typecode, the address of the array pointer, and a 32-bit integer
- * giving the number of elements in the array. So for example: @code
- * const dbus_int32_t array[] = { 1, 2, 3 }; const dbus_int32_t
- * *v_ARRAY = array; dbus_message_append_args (message,
- * DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY, 3, DBUS_TYPE_INVALID);
- * @endcode
- *
- * This function does not support arrays of Unix file descriptors. If
- * you need those you need to manually recurse into the array.
- *
- * For Unix file descriptors this function will internally duplicate
- * the descriptor you passed in. Hence you may close the descriptor
- * immediately after this call.
- *
- * @warning in C, given "int array[]", "&array == array" (the
- * comp.lang.c FAQ says otherwise, but gcc and the FAQ don't agree).
- * So if you're using an array instead of a pointer you have to create
- * a pointer variable, assign the array to it, then take the address
- * of the pointer variable. For strings it works to write
- * const char *array = "Hello" and then use &array though.
- *
- * The last argument to this function must be #DBUS_TYPE_INVALID,
- * marking the end of the argument list. If you don't do this
- * then libdbus won't know to stop and will read invalid memory.
- *
- * String/signature/path arrays should be passed in as "const char***
- * address_of_array" and "int n_elements"
- *
- * @todo support DBUS_TYPE_STRUCT and DBUS_TYPE_VARIANT and complex arrays
- *
- * @todo If this fails due to lack of memory, the message is hosed and
- * you have to start over building the whole message.
- *
- * @param message the message
- * @param first_arg_type type of the first argument
- * @param ... value of first argument, list of additional type-value pairs
- * @returns #TRUE on success
- */
-dbus_bool_t
-dbus_message_append_args (DBusMessage *message,
- int first_arg_type,
- ...)
-{
- dbus_bool_t retval;
- va_list var_args;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
-
- va_start (var_args, first_arg_type);
- retval = dbus_message_append_args_valist (message,
- first_arg_type,
- var_args);
- va_end (var_args);
-
- return retval;
-}
-
-/**
- * Like dbus_message_append_args() but takes a va_list for use by language bindings.
- *
- * @todo for now, if this function fails due to OOM it will leave
- * the message half-written and you have to discard the message
- * and start over.
- *
- * @see dbus_message_append_args.
- * @param message the message
- * @param first_arg_type type of first argument
- * @param var_args value of first argument, then list of type/value pairs
- * @returns #TRUE on success
- */
-dbus_bool_t
-dbus_message_append_args_valist (DBusMessage *message,
- int first_arg_type,
- va_list var_args)
-{
- int type;
- DBusMessageIter iter;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
-
- type = first_arg_type;
-
- dbus_message_iter_init_append (message, &iter);
-
- while (type != DBUS_TYPE_INVALID)
- {
- if (dbus_type_is_basic (type))
- {
- const DBusBasicValue *value;
- value = va_arg (var_args, const DBusBasicValue*);
-
- if (!dbus_message_iter_append_basic (&iter,
- type,
- value))
- goto failed;
- }
- else if (type == DBUS_TYPE_ARRAY)
- {
- int element_type;
- DBusMessageIter array;
- char buf[2];
-
- element_type = va_arg (var_args, int);
-
- buf[0] = element_type;
- buf[1] = '\0';
- if (!dbus_message_iter_open_container (&iter,
- DBUS_TYPE_ARRAY,
- buf,
- &array))
- goto failed;
-
- if (dbus_type_is_fixed (element_type) &&
- element_type != DBUS_TYPE_UNIX_FD)
- {
- const DBusBasicValue **value;
- int n_elements;
-
- value = va_arg (var_args, const DBusBasicValue**);
- n_elements = va_arg (var_args, int);
-
- if (!dbus_message_iter_append_fixed_array (&array,
- element_type,
- value,
- n_elements)) {
- dbus_message_iter_abandon_container (&iter, &array);
- goto failed;
- }
- }
- else if (_DBUS_TYPE_IS_STRINGLIKE (element_type))
- {
- const char ***value_p;
- const char **value;
- int n_elements;
- int i;
-
- value_p = va_arg (var_args, const char***);
- n_elements = va_arg (var_args, int);
-
- value = *value_p;
-
- i = 0;
- while (i < n_elements)
- {
- if (!dbus_message_iter_append_basic (&array,
- element_type,
- &value[i])) {
- dbus_message_iter_abandon_container (&iter, &array);
- goto failed;
- }
- ++i;
- }
- }
- else
- {
- _dbus_warn ("arrays of %s can't be appended with %s for now\n",
- _dbus_type_to_string (element_type),
- _DBUS_FUNCTION_NAME);
- goto failed;
- }
-
- if (!dbus_message_iter_close_container (&iter, &array))
- goto failed;
- }
-#ifndef DBUS_DISABLE_CHECKS
- else
- {
- _dbus_warn ("type %s isn't supported yet in %s\n",
- _dbus_type_to_string (type), _DBUS_FUNCTION_NAME);
- goto failed;
- }
-#endif
-
- type = va_arg (var_args, int);
- }
-
- return TRUE;
-
- failed:
- return FALSE;
-}
-
-/**
- * Gets arguments from a message given a variable argument list. The
- * supported types include those supported by
- * dbus_message_append_args(); that is, basic types and arrays of
- * fixed-length basic types. The arguments are the same as they would
- * be for dbus_message_iter_get_basic() or
- * dbus_message_iter_get_fixed_array().
- *
- * In addition to those types, arrays of string, object path, and
- * signature are supported; but these are returned as allocated memory
- * and must be freed with dbus_free_string_array(), while the other
- * types are returned as const references. To get a string array
- * pass in "char ***array_location" and "int *n_elements".
- *
- * Similar to dbus_message_get_fixed_array() this function does not
- * support arrays of type DBUS_TYPE_UNIX_FD. If you need to parse
- * messages with arrays of Unix file descriptors you need to recurse
- * into the array manually.
- *
- * Unix file descriptors that are read with this function will have
- * the FD_CLOEXEC flag set. If you need them without this flag set,
- * make sure to unset it with fcntl().
- *
- * The variable argument list should contain the type of the argument
- * followed by a pointer to where the value should be stored. The list
- * is terminated with #DBUS_TYPE_INVALID.
- *
- * Except for string arrays, the returned values are constant; do not
- * free them. They point into the #DBusMessage.
- *
- * If the requested arguments are not present, or do not have the
- * requested types, then an error will be set.
- *
- * If more arguments than requested are present, the requested
- * arguments are returned and the extra arguments are ignored.
- *
- * @todo support DBUS_TYPE_STRUCT and DBUS_TYPE_VARIANT and complex arrays
- *
- * @param message the message
- * @param error error to be filled in on failure
- * @param first_arg_type the first argument type
- * @param ... location for first argument value, then list of type-location pairs
- * @returns #FALSE if the error was set
- */
-dbus_bool_t
-dbus_message_get_args (DBusMessage *message,
- DBusError *error,
- int first_arg_type,
- ...)
-{
- dbus_bool_t retval;
- va_list var_args;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- va_start (var_args, first_arg_type);
- retval = dbus_message_get_args_valist (message, error, first_arg_type, var_args);
- va_end (var_args);
-
- return retval;
-}
-
-/**
- * Like dbus_message_get_args but takes a va_list for use by language bindings.
- *
- * @see dbus_message_get_args
- * @param message the message
- * @param error error to be filled in
- * @param first_arg_type type of the first argument
- * @param var_args return location for first argument, followed by list of type/location pairs
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-dbus_message_get_args_valist (DBusMessage *message,
- DBusError *error,
- int first_arg_type,
- va_list var_args)
-{
- DBusMessageIter iter;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- dbus_message_iter_init (message, &iter);
- return _dbus_message_iter_get_args_valist (&iter, error, first_arg_type, var_args);
-}
-
-static void
-_dbus_message_iter_init_common (DBusMessage *message,
- DBusMessageRealIter *real,
- int iter_type)
-{
- _dbus_assert (sizeof (DBusMessageRealIter) <= sizeof (DBusMessageIter));
-
- /* Since the iterator will read or write who-knows-what from the
- * message, we need to get in the right byte order
- */
- ensure_byte_order (message);
-
- real->message = message;
- real->changed_stamp = message->changed_stamp;
- real->iter_type = iter_type;
- real->sig_refcount = 0;
-}
-
-/**
- * Initializes a #DBusMessageIter for reading the arguments of the
- * message passed in.
- *
- * When possible, dbus_message_get_args() is much more convenient.
- * Some types of argument can only be read with #DBusMessageIter
- * however.
- *
- * The easiest way to iterate is like this:
- * @code
- * dbus_message_iter_init (message, &iter);
- * while ((current_type = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID)
- * dbus_message_iter_next (&iter);
- * @endcode
- *
- * #DBusMessageIter contains no allocated memory; it need not be
- * freed, and can be copied by assignment or memcpy().
- *
- * @param message the message
- * @param iter pointer to an iterator to initialize
- * @returns #FALSE if the message has no arguments
- */
-dbus_bool_t
-dbus_message_iter_init (DBusMessage *message,
- DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- const DBusString *type_str;
- int type_pos;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (iter != NULL, FALSE);
-
- get_const_signature (&message->header, &type_str, &type_pos);
-
- _dbus_message_iter_init_common (message, real,
- DBUS_MESSAGE_ITER_TYPE_READER);
-
- _dbus_type_reader_init (&real->u.reader,
- _dbus_header_get_byte_order (&message->header),
- type_str, type_pos,
- &message->body,
- 0);
-
- return _dbus_type_reader_get_current_type (&real->u.reader) != DBUS_TYPE_INVALID;
-}
-
-/**
- * Checks if an iterator has any more fields.
- *
- * @param iter the message iter
- * @returns #TRUE if there are more fields following
- */
-dbus_bool_t
-dbus_message_iter_has_next (DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_READER, FALSE);
-
- return _dbus_type_reader_has_next (&real->u.reader);
-}
-
-/**
- * Moves the iterator to the next field, if any. If there's no next
- * field, returns #FALSE. If the iterator moves forward, returns
- * #TRUE.
- *
- * @param iter the message iter
- * @returns #TRUE if the iterator was moved to the next field
- */
-dbus_bool_t
-dbus_message_iter_next (DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_READER, FALSE);
-
- return _dbus_type_reader_next (&real->u.reader);
-}
-
-/**
- * Returns the argument type of the argument that the message iterator
- * points to. If the iterator is at the end of the message, returns
- * #DBUS_TYPE_INVALID. You can thus write a loop as follows:
- *
- * @code
- * dbus_message_iter_init (message, &iter);
- * while ((current_type = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID)
- * dbus_message_iter_next (&iter);
- * @endcode
- *
- * @param iter the message iter
- * @returns the argument type
- */
-int
-dbus_message_iter_get_arg_type (DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), DBUS_TYPE_INVALID);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_READER, FALSE);
-
- return _dbus_type_reader_get_current_type (&real->u.reader);
-}
-
-/**
- * Returns the element type of the array that the message iterator
- * points to. Note that you need to check that the iterator points to
- * an array prior to using this function.
- *
- * @param iter the message iter
- * @returns the array element type
- */
-int
-dbus_message_iter_get_element_type (DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), DBUS_TYPE_INVALID);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_READER, DBUS_TYPE_INVALID);
- _dbus_return_val_if_fail (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_ARRAY, DBUS_TYPE_INVALID);
-
- return _dbus_type_reader_get_element_type (&real->u.reader);
-}
-
-/**
- * Recurses into a container value when reading values from a message,
- * initializing a sub-iterator to use for traversing the child values
- * of the container.
- *
- * Note that this recurses into a value, not a type, so you can only
- * recurse if the value exists. The main implication of this is that
- * if you have for example an empty array of array of int32, you can
- * recurse into the outermost array, but it will have no values, so
- * you won't be able to recurse further. There's no array of int32 to
- * recurse into.
- *
- * If a container is an array of fixed-length types (except Unix file
- * descriptors), it is much more efficient to use
- * dbus_message_iter_get_fixed_array() to get the whole array in one
- * shot, rather than individually walking over the array elements.
- *
- * Be sure you have somehow checked that
- * dbus_message_iter_get_arg_type() matches the type you are expecting
- * to recurse into. Results of this function are undefined if there is
- * no container to recurse into at the current iterator position.
- *
- * @param iter the message iterator
- * @param sub the sub-iterator to initialize
- */
-void
-dbus_message_iter_recurse (DBusMessageIter *iter,
- DBusMessageIter *sub)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- DBusMessageRealIter *real_sub = (DBusMessageRealIter *)sub;
-
- _dbus_return_if_fail (_dbus_message_iter_check (real));
- _dbus_return_if_fail (sub != NULL);
-
- *real_sub = *real;
- _dbus_type_reader_recurse (&real->u.reader, &real_sub->u.reader);
-}
-
-/**
- * Returns the current signature of a message iterator. This
- * is useful primarily for dealing with variants; one can
- * recurse into a variant and determine the signature of
- * the variant's value.
- *
- * The returned string must be freed with dbus_free().
- *
- * @param iter the message iterator
- * @returns the contained signature, or NULL if out of memory
- */
-char *
-dbus_message_iter_get_signature (DBusMessageIter *iter)
-{
- const DBusString *sig;
- DBusString retstr;
- char *ret;
- int start, len;
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), NULL);
-
- if (!_dbus_string_init (&retstr))
- return NULL;
-
- _dbus_type_reader_get_signature (&real->u.reader, &sig,
- &start, &len);
- if (!_dbus_string_append_len (&retstr,
- _dbus_string_get_const_data (sig) + start,
- len))
- return NULL;
- if (!_dbus_string_steal_data (&retstr, &ret))
- return NULL;
- _dbus_string_free (&retstr);
- return ret;
-}
-
-/**
- * Reads a basic-typed value from the message iterator.
- * Basic types are the non-containers such as integer and string.
- *
- * The value argument should be the address of a location to store
- * the returned value. So for int32 it should be a "dbus_int32_t*"
- * and for string a "const char**". The returned value is
- * by reference and should not be freed.
- *
- * This call duplicates Unix file descriptors when reading them. It is
- * your job to close them when you don't need them anymore.
- *
- * Unix file descriptors that are read with this function will have
- * the FD_CLOEXEC flag set. If you need them without this flag set,
- * make sure to unset it with fcntl().
- *
- * Be sure you have somehow checked that
- * dbus_message_iter_get_arg_type() matches the type you are
- * expecting, or you'll crash when you try to use an integer as a
- * string or something.
- *
- * To read any container type (array, struct, dict) you will need to
- * recurse into the container with dbus_message_iter_recurse(). If
- * the container is an array of fixed-length values (except Unix file
- * descriptors), you can get all the array elements at once with
- * dbus_message_iter_get_fixed_array(). Otherwise, you have to iterate
- * over the container's contents one value at a time.
- *
- * All basic-typed values are guaranteed to fit in a #DBusBasicValue,
- * so in versions of libdbus that have that type, you can write code like this:
- *
- * @code
- * DBusBasicValue value;
- * int type;
- * dbus_message_iter_get_basic (&read_iter, &value);
- * type = dbus_message_iter_get_arg_type (&read_iter);
- * dbus_message_iter_append_basic (&write_iter, type, &value);
- * @endcode
- *
- * (All D-Bus basic types are either numeric and 8 bytes or smaller, or
- * behave like a string; so in older versions of libdbus, DBusBasicValue
- * can be replaced with union { char *string; unsigned char bytes[8]; },
- * for instance.)
- *
- * @param iter the iterator
- * @param value location to store the value
- */
-void
-dbus_message_iter_get_basic (DBusMessageIter *iter,
- void *value)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_if_fail (_dbus_message_iter_check (real));
- _dbus_return_if_fail (value != NULL);
-
- if (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_UNIX_FD)
- {
-#ifdef HAVE_UNIX_FD_PASSING
- DBusBasicValue idx;
-
- _dbus_type_reader_read_basic(&real->u.reader, &idx);
-
- if (idx.u32 >= real->message->n_unix_fds) {
- /* Hmm, we cannot really signal an error here, so let's make
- sure to return an invalid fd. */
- *((int*) value) = -1;
- return;
- }
-
- *((int*) value) = _dbus_dup(real->message->unix_fds[idx.u32], NULL);
-#else
- *((int*) value) = -1;
-#endif
- }
- else
- {
- _dbus_type_reader_read_basic (&real->u.reader,
- value);
- }
-}
-
-/**
- * Returns the number of bytes in the array as marshaled in the wire
- * protocol. The iterator must currently be inside an array-typed
- * value.
- *
- * This function is deprecated on the grounds that it is stupid. Why
- * would you want to know how many bytes are in the array as marshaled
- * in the wire protocol? For now, use the n_elements returned from
- * dbus_message_iter_get_fixed_array() instead, or iterate over the
- * array values and count them.
- *
- * @todo introduce a variant of this get_n_elements that returns
- * the number of elements, though with a non-fixed array it will not
- * be very efficient, so maybe it's not good.
- *
- * @param iter the iterator
- * @returns the number of bytes in the array
- */
-int
-dbus_message_iter_get_array_len (DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_val_if_fail (_dbus_message_iter_check (real), 0);
-
- return _dbus_type_reader_get_array_length (&real->u.reader);
-}
-
-/**
- * Reads a block of fixed-length values from the message iterator.
- * Fixed-length values are those basic types that are not string-like,
- * such as integers, bool, double. The returned block will be from the
- * current position in the array until the end of the array.
- *
- * There is one exception here: although DBUS_TYPE_UNIX_FD is
- * considered a 'fixed' type arrays of this type may not be read with
- * this function.
- *
- * The message iter should be "in" the array (that is, you recurse into the
- * array, and then you call dbus_message_iter_get_fixed_array() on the
- * "sub-iterator" created by dbus_message_iter_recurse()).
- *
- * The value argument should be the address of a location to store the
- * returned array. So for int32 it should be a "const dbus_int32_t**"
- * The returned value is by reference and should not be freed.
- *
- * This function should only be used if dbus_type_is_fixed() returns
- * #TRUE for the element type.
- *
- * If an array's elements are not fixed in size, you have to recurse
- * into the array with dbus_message_iter_recurse() and read the
- * elements one by one.
- *
- * Because the array is not copied, this function runs in constant
- * time and is fast; it's much preferred over walking the entire array
- * with an iterator. (However, you can always use
- * dbus_message_iter_recurse(), even for fixed-length types;
- * dbus_message_iter_get_fixed_array() is just an optimization.)
- *
- * @param iter the iterator
- * @param value location to store the block
- * @param n_elements number of elements in the block
- */
-void
-dbus_message_iter_get_fixed_array (DBusMessageIter *iter,
- void *value,
- int *n_elements)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-#ifndef DBUS_DISABLE_CHECKS
- int subtype = _dbus_type_reader_get_current_type(&real->u.reader);
-
- _dbus_return_if_fail (_dbus_message_iter_check (real));
- _dbus_return_if_fail (value != NULL);
- _dbus_return_if_fail ((subtype == DBUS_TYPE_INVALID) ||
- (dbus_type_is_fixed (subtype) && subtype != DBUS_TYPE_UNIX_FD));
-#endif
-
- _dbus_type_reader_read_fixed_multi (&real->u.reader,
- value, n_elements);
-}
-
-/**
- * Initializes a #DBusMessageIter for appending arguments to the end
- * of a message.
- *
- * @todo If appending any of the arguments fails due to lack of
- * memory, the message is hosed and you have to start over building
- * the whole message.
- *
- * @param message the message
- * @param iter pointer to an iterator to initialize
- */
-void
-dbus_message_iter_init_append (DBusMessage *message,
- DBusMessageIter *iter)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (iter != NULL);
-
- _dbus_message_iter_init_common (message, real,
- DBUS_MESSAGE_ITER_TYPE_WRITER);
-
- /* We create the signature string and point iterators at it "on demand"
- * when a value is actually appended. That means that init() never fails
- * due to OOM.
- */
- _dbus_type_writer_init_types_delayed (&real->u.writer,
- _dbus_header_get_byte_order (&message->header),
- &message->body,
- _dbus_string_get_length (&message->body));
-}
-
-/**
- * Creates a temporary signature string containing the current
- * signature, stores it in the iterator, and points the iterator to
- * the end of it. Used any time we write to the message.
- *
- * @param real an iterator without a type_str
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-_dbus_message_iter_open_signature (DBusMessageRealIter *real)
-{
- DBusString *str;
- const DBusString *current_sig;
- int current_sig_pos;
-
- _dbus_assert (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER);
-
- if (real->u.writer.type_str != NULL)
- {
- _dbus_assert (real->sig_refcount > 0);
- real->sig_refcount += 1;
- return TRUE;
- }
-
- str = dbus_new (DBusString, 1);
- if (str == NULL)
- return FALSE;
-
- if (!_dbus_header_get_field_raw (&real->message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- &current_sig, &current_sig_pos))
- current_sig = NULL;
-
- if (current_sig)
- {
- int current_len;
-
- current_len = _dbus_string_get_byte (current_sig, current_sig_pos);
- current_sig_pos += 1; /* move on to sig data */
-
- if (!_dbus_string_init_preallocated (str, current_len + 4))
- {
- dbus_free (str);
- return FALSE;
- }
-
- if (!_dbus_string_copy_len (current_sig, current_sig_pos, current_len,
- str, 0))
- {
- _dbus_string_free (str);
- dbus_free (str);
- return FALSE;
- }
- }
- else
- {
- if (!_dbus_string_init_preallocated (str, 4))
- {
- dbus_free (str);
- return FALSE;
- }
- }
-
- real->sig_refcount = 1;
-
- _dbus_type_writer_add_types (&real->u.writer,
- str, _dbus_string_get_length (str));
- return TRUE;
-}
-
-/**
- * Sets the new signature as the message signature, frees the
- * signature string, and marks the iterator as not having a type_str
- * anymore. Frees the signature even if it fails, so you can't
- * really recover from failure. Kinda busted.
- *
- * @param real an iterator without a type_str
- * @returns #FALSE if no memory
- */
-static dbus_bool_t
-_dbus_message_iter_close_signature (DBusMessageRealIter *real)
-{
- DBusString *str;
- const char *v_STRING;
- dbus_bool_t retval;
-
- _dbus_assert (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER);
- _dbus_assert (real->u.writer.type_str != NULL);
- _dbus_assert (real->sig_refcount > 0);
-
- real->sig_refcount -= 1;
-
- if (real->sig_refcount > 0)
- return TRUE;
- _dbus_assert (real->sig_refcount == 0);
-
- retval = TRUE;
-
- str = real->u.writer.type_str;
-
- v_STRING = _dbus_string_get_const_data (str);
- if (!_dbus_header_set_field_basic (&real->message->header,
- DBUS_HEADER_FIELD_SIGNATURE,
- DBUS_TYPE_SIGNATURE,
- &v_STRING))
- retval = FALSE;
-
- _dbus_type_writer_remove_types (&real->u.writer);
- _dbus_string_free (str);
- dbus_free (str);
-
- return retval;
-}
-
-/**
- * Frees the signature string and marks the iterator as not having a
- * type_str anymore. Since the new signature is not set, the message
- * will generally be hosed after this is called.
- *
- * @param real an iterator without a type_str
- */
-static void
-_dbus_message_iter_abandon_signature (DBusMessageRealIter *real)
-{
- DBusString *str;
-
- _dbus_assert (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER);
- _dbus_assert (real->u.writer.type_str != NULL);
- _dbus_assert (real->sig_refcount > 0);
-
- real->sig_refcount -= 1;
-
- if (real->sig_refcount > 0)
- return;
- _dbus_assert (real->sig_refcount == 0);
-
- str = real->u.writer.type_str;
-
- _dbus_type_writer_remove_types (&real->u.writer);
- _dbus_string_free (str);
- dbus_free (str);
-}
-
-#ifndef DBUS_DISABLE_CHECKS
-static dbus_bool_t
-_dbus_message_iter_append_check (DBusMessageRealIter *iter)
-{
- if (!_dbus_message_iter_check (iter))
- return FALSE;
-
- if (iter->message->locked)
- {
- _dbus_warn_check_failed ("dbus append iterator can't be used: message is locked (has already been sent)\n");
- return FALSE;
- }
-
- return TRUE;
-}
-#endif /* DBUS_DISABLE_CHECKS */
-
-#ifdef HAVE_UNIX_FD_PASSING
-static int *
-expand_fd_array(DBusMessage *m,
- unsigned n)
-{
- _dbus_assert(m);
-
- /* This makes space for adding n new fds to the array and returns a
- pointer to the place were the first fd should be put. */
-
- if (m->n_unix_fds + n > m->n_unix_fds_allocated)
- {
- unsigned k;
- int *p;
-
- /* Make twice as much space as necessary */
- k = (m->n_unix_fds + n) * 2;
-
- /* Allocate at least four */
- if (k < 4)
- k = 4;
-
- p = dbus_realloc(m->unix_fds, k * sizeof(int));
- if (p == NULL)
- return NULL;
-
- m->unix_fds = p;
- m->n_unix_fds_allocated = k;
- }
-
- return m->unix_fds + m->n_unix_fds;
-}
-#endif
-
-/**
- * Appends a basic-typed value to the message. The basic types are the
- * non-container types such as integer and string.
- *
- * The "value" argument should be the address of a basic-typed value.
- * So for string, const char**. For integer, dbus_int32_t*.
- *
- * For Unix file descriptors this function will internally duplicate
- * the descriptor you passed in. Hence you may close the descriptor
- * immediately after this call.
- *
- * @todo If this fails due to lack of memory, the message is hosed and
- * you have to start over building the whole message.
- *
- * @param iter the append iterator
- * @param type the type of the value
- * @param value the address of the value
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_iter_append_basic (DBusMessageIter *iter,
- int type,
- const void *value)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- dbus_bool_t ret;
-
- _dbus_return_val_if_fail (_dbus_message_iter_append_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER, FALSE);
- _dbus_return_val_if_fail (dbus_type_is_basic (type), FALSE);
- _dbus_return_val_if_fail (value != NULL, FALSE);
-
-#ifndef DBUS_DISABLE_CHECKS
- switch (type)
- {
- const char * const *string_p;
- const dbus_bool_t *bool_p;
-
- case DBUS_TYPE_STRING:
- string_p = value;
- _dbus_return_val_if_fail (_dbus_check_is_valid_utf8 (*string_p), FALSE);
- break;
-
- case DBUS_TYPE_OBJECT_PATH:
- string_p = value;
- _dbus_return_val_if_fail (_dbus_check_is_valid_path (*string_p), FALSE);
- break;
-
- case DBUS_TYPE_SIGNATURE:
- string_p = value;
- _dbus_return_val_if_fail (_dbus_check_is_valid_signature (*string_p), FALSE);
- break;
-
- case DBUS_TYPE_BOOLEAN:
- bool_p = value;
- _dbus_return_val_if_fail (*bool_p == 0 || *bool_p == 1, FALSE);
- break;
-
- default:
- {
- /* nothing to check, all possible values are allowed */
- }
- }
-#endif
-
- if (!_dbus_message_iter_open_signature (real))
- return FALSE;
-
- if (type == DBUS_TYPE_UNIX_FD)
- {
-#ifdef HAVE_UNIX_FD_PASSING
- int *fds;
- dbus_uint32_t u;
-
- /* First step, include the fd in the fd list of this message */
- if (!(fds = expand_fd_array(real->message, 1)))
- return FALSE;
-
- *fds = _dbus_dup(*(int*) value, NULL);
- if (*fds < 0)
- return FALSE;
-
- u = real->message->n_unix_fds;
-
- /* Second step, write the index to the fd */
- if (!(ret = _dbus_type_writer_write_basic (&real->u.writer, DBUS_TYPE_UNIX_FD, &u))) {
- _dbus_close(*fds, NULL);
- return FALSE;
- }
-
- real->message->n_unix_fds += 1;
- u += 1;
-
- /* Final step, update the header accordingly */
- ret = _dbus_header_set_field_basic (&real->message->header,
- DBUS_HEADER_FIELD_UNIX_FDS,
- DBUS_TYPE_UINT32,
- &u);
-
- /* If any of these operations fail the message is
- hosed. However, no memory or fds should be leaked since what
- has been added to message has been added to the message, and
- can hence be accounted for when the message is being
- freed. */
-#else
- ret = FALSE;
-#endif
- }
- else
- {
- ret = _dbus_type_writer_write_basic (&real->u.writer, type, value);
- }
-
- if (!_dbus_message_iter_close_signature (real))
- ret = FALSE;
-
- return ret;
-}
-
-/**
- * Appends a block of fixed-length values to an array. The
- * fixed-length types are all basic types that are not string-like. So
- * int32, double, bool, etc. (Unix file descriptors however are not
- * supported.) You must call dbus_message_iter_open_container() to
- * open an array of values before calling this function. You may call
- * this function multiple times (and intermixed with calls to
- * dbus_message_iter_append_basic()) for the same array.
- *
- * The "value" argument should be the address of the array. So for
- * integer, "dbus_int32_t**" is expected for example.
- *
- * @warning in C, given "int array[]", "&array == array" (the
- * comp.lang.c FAQ says otherwise, but gcc and the FAQ don't agree).
- * So if you're using an array instead of a pointer you have to create
- * a pointer variable, assign the array to it, then take the address
- * of the pointer variable.
- * @code
- * const dbus_int32_t array[] = { 1, 2, 3 };
- * const dbus_int32_t *v_ARRAY = array;
- * if (!dbus_message_iter_append_fixed_array (&iter, DBUS_TYPE_INT32, &v_ARRAY, 3))
- * fprintf (stderr, "No memory!\n");
- * @endcode
- * For strings it works to write const char *array = "Hello" and then
- * use &array though.
- *
- * @todo If this fails due to lack of memory, the message is hosed and
- * you have to start over building the whole message.
- *
- * @param iter the append iterator
- * @param element_type the type of the array elements
- * @param value the address of the array
- * @param n_elements the number of elements to append
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_iter_append_fixed_array (DBusMessageIter *iter,
- int element_type,
- const void *value,
- int n_elements)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- dbus_bool_t ret;
-
- _dbus_return_val_if_fail (_dbus_message_iter_append_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER, FALSE);
- _dbus_return_val_if_fail (dbus_type_is_fixed (element_type) && element_type != DBUS_TYPE_UNIX_FD, FALSE);
- _dbus_return_val_if_fail (real->u.writer.container_type == DBUS_TYPE_ARRAY, FALSE);
- _dbus_return_val_if_fail (value != NULL, FALSE);
- _dbus_return_val_if_fail (n_elements >= 0, FALSE);
- _dbus_return_val_if_fail (n_elements <=
- DBUS_MAXIMUM_ARRAY_LENGTH / _dbus_type_get_alignment (element_type),
- FALSE);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (element_type == DBUS_TYPE_BOOLEAN)
- {
- const dbus_bool_t * const *bools = value;
- int i;
-
- for (i = 0; i < n_elements; i++)
- {
- _dbus_return_val_if_fail ((*bools)[i] == 0 || (*bools)[i] == 1, FALSE);
- }
- }
-#endif
-
- ret = _dbus_type_writer_write_fixed_multi (&real->u.writer, element_type, value, n_elements);
-
- return ret;
-}
-
-/**
- * Appends a container-typed value to the message; you are required to
- * append the contents of the container using the returned
- * sub-iterator, and then call
- * dbus_message_iter_close_container(). Container types are for
- * example struct, variant, and array. For variants, the
- * contained_signature should be the type of the single value inside
- * the variant. For structs and dict entries, contained_signature
- * should be #NULL; it will be set to whatever types you write into
- * the struct. For arrays, contained_signature should be the type of
- * the array elements.
- *
- * @todo If this fails due to lack of memory, the message is hosed and
- * you have to start over building the whole message.
- *
- * @param iter the append iterator
- * @param type the type of the value
- * @param contained_signature the type of container contents
- * @param sub sub-iterator to initialize
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_iter_open_container (DBusMessageIter *iter,
- int type,
- const char *contained_signature,
- DBusMessageIter *sub)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- DBusMessageRealIter *real_sub = (DBusMessageRealIter *)sub;
- DBusString contained_str;
-
- _dbus_return_val_if_fail (_dbus_message_iter_append_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER, FALSE);
- _dbus_return_val_if_fail (dbus_type_is_container (type), FALSE);
- _dbus_return_val_if_fail (sub != NULL, FALSE);
- _dbus_return_val_if_fail ((type == DBUS_TYPE_STRUCT &&
- contained_signature == NULL) ||
- (type == DBUS_TYPE_DICT_ENTRY &&
- contained_signature == NULL) ||
- (type == DBUS_TYPE_VARIANT &&
- contained_signature != NULL) ||
- (type == DBUS_TYPE_ARRAY &&
- contained_signature != NULL), FALSE);
-
- /* this would fail if the contained_signature is a dict entry, since
- * dict entries are invalid signatures standalone (they must be in
- * an array)
- */
- _dbus_return_val_if_fail ((type == DBUS_TYPE_ARRAY && contained_signature && *contained_signature == DBUS_DICT_ENTRY_BEGIN_CHAR) ||
- (contained_signature == NULL ||
- _dbus_check_is_valid_signature (contained_signature)),
- FALSE);
-
- if (!_dbus_message_iter_open_signature (real))
- return FALSE;
-
- *real_sub = *real;
-
- if (contained_signature != NULL)
- {
- _dbus_string_init_const (&contained_str, contained_signature);
-
- return _dbus_type_writer_recurse (&real->u.writer,
- type,
- &contained_str, 0,
- &real_sub->u.writer);
- }
- else
- {
- return _dbus_type_writer_recurse (&real->u.writer,
- type,
- NULL, 0,
- &real_sub->u.writer);
- }
-}
-
-
-/**
- * Closes a container-typed value appended to the message; may write
- * out more information to the message known only after the entire
- * container is written, and may free resources created by
- * dbus_message_iter_open_container().
- *
- * @todo If this fails due to lack of memory, the message is hosed and
- * you have to start over building the whole message.
- *
- * @param iter the append iterator
- * @param sub sub-iterator to close
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_iter_close_container (DBusMessageIter *iter,
- DBusMessageIter *sub)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- DBusMessageRealIter *real_sub = (DBusMessageRealIter *)sub;
- dbus_bool_t ret;
-
- _dbus_return_val_if_fail (_dbus_message_iter_append_check (real), FALSE);
- _dbus_return_val_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER, FALSE);
- _dbus_return_val_if_fail (_dbus_message_iter_append_check (real_sub), FALSE);
- _dbus_return_val_if_fail (real_sub->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER, FALSE);
-
- ret = _dbus_type_writer_unrecurse (&real->u.writer,
- &real_sub->u.writer);
-
- if (!_dbus_message_iter_close_signature (real))
- ret = FALSE;
-
- return ret;
-}
-
-/**
- * Abandons creation of a contained-typed value and frees resources created
- * by dbus_message_iter_open_container(). Once this returns, the message
- * is hosed and you have to start over building the whole message.
- *
- * This should only be used to abandon creation of a message when you have
- * open containers.
- *
- * @param iter the append iterator
- * @param sub sub-iterator to close
- */
-void
-dbus_message_iter_abandon_container (DBusMessageIter *iter,
- DBusMessageIter *sub)
-{
- DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
-#ifndef DBUS_DISABLE_CHECKS
- DBusMessageRealIter *real_sub = (DBusMessageRealIter *)sub;
-
- _dbus_return_if_fail (_dbus_message_iter_append_check (real));
- _dbus_return_if_fail (real->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER);
- _dbus_return_if_fail (_dbus_message_iter_append_check (real_sub));
- _dbus_return_if_fail (real_sub->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER);
-#endif
-
- _dbus_message_iter_abandon_signature (real);
-}
-
-/**
- * Sets a flag indicating that the message does not want a reply; if
- * this flag is set, the other end of the connection may (but is not
- * required to) optimize by not sending method return or error
- * replies. If this flag is set, there is no way to know whether the
- * message successfully arrived at the remote end. Normally you know a
- * message was received when you receive the reply to it.
- *
- * The flag is #FALSE by default, that is by default the other end is
- * required to reply.
- *
- * On the protocol level this toggles #DBUS_HEADER_FLAG_NO_REPLY_EXPECTED
- *
- * @param message the message
- * @param no_reply #TRUE if no reply is desired
- */
-void
-dbus_message_set_no_reply (DBusMessage *message,
- dbus_bool_t no_reply)
-{
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (!message->locked);
-
- _dbus_header_toggle_flag (&message->header,
- DBUS_HEADER_FLAG_NO_REPLY_EXPECTED,
- no_reply);
-}
-
-/**
- * Returns #TRUE if the message does not expect
- * a reply.
- *
- * @param message the message
- * @returns #TRUE if the message sender isn't waiting for a reply
- */
-dbus_bool_t
-dbus_message_get_no_reply (DBusMessage *message)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
-
- return _dbus_header_get_flag (&message->header,
- DBUS_HEADER_FLAG_NO_REPLY_EXPECTED);
-}
-
-/**
- * Sets a flag indicating that an owner for the destination name will
- * be automatically started before the message is delivered. When this
- * flag is set, the message is held until a name owner finishes
- * starting up, or fails to start up. In case of failure, the reply
- * will be an error.
- *
- * The flag is set to #TRUE by default, i.e. auto starting is the default.
- *
- * On the protocol level this toggles #DBUS_HEADER_FLAG_NO_AUTO_START
- *
- * @param message the message
- * @param auto_start #TRUE if auto-starting is desired
- */
-void
-dbus_message_set_auto_start (DBusMessage *message,
- dbus_bool_t auto_start)
-{
- _dbus_return_if_fail (message != NULL);
- _dbus_return_if_fail (!message->locked);
-
- _dbus_header_toggle_flag (&message->header,
- DBUS_HEADER_FLAG_NO_AUTO_START,
- !auto_start);
-}
-
-/**
- * Returns #TRUE if the message will cause an owner for
- * destination name to be auto-started.
- *
- * @param message the message
- * @returns #TRUE if the message will use auto-start
- */
-dbus_bool_t
-dbus_message_get_auto_start (DBusMessage *message)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
-
- return !_dbus_header_get_flag (&message->header,
- DBUS_HEADER_FLAG_NO_AUTO_START);
-}
-
-
-/**
- * Sets the object path this message is being sent to (for
- * DBUS_MESSAGE_TYPE_METHOD_CALL) or the one a signal is being
- * emitted from (for DBUS_MESSAGE_TYPE_SIGNAL).
- *
- * The path must contain only valid characters as defined
- * in the D-Bus specification.
- *
- * @param message the message
- * @param object_path the path or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_path (DBusMessage *message,
- const char *object_path)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (object_path == NULL ||
- _dbus_check_is_valid_path (object_path),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_PATH,
- DBUS_TYPE_OBJECT_PATH,
- object_path);
-}
-
-/**
- * Gets the object path this message is being sent to (for
- * DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted from (for
- * DBUS_MESSAGE_TYPE_SIGNAL). Returns #NULL if none.
- *
- * See also dbus_message_get_path_decomposed().
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the path (should not be freed) or #NULL
- */
-const char*
-dbus_message_get_path (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_PATH,
- DBUS_TYPE_OBJECT_PATH,
- (void *) &v);
- return v;
-}
-
-/**
- * Checks if the message has a particular object path. The object
- * path is the destination object for a method call or the emitting
- * object for a signal.
- *
- * @param message the message
- * @param path the path name
- * @returns #TRUE if there is a path field in the header
- */
-dbus_bool_t
-dbus_message_has_path (DBusMessage *message,
- const char *path)
-{
- const char *msg_path;
- msg_path = dbus_message_get_path (message);
-
- if (msg_path == NULL)
- {
- if (path == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (path == NULL)
- return FALSE;
-
- if (strcmp (msg_path, path) == 0)
- return TRUE;
-
- return FALSE;
-}
-
-/**
- * Gets the object path this message is being sent to
- * (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted
- * from (for DBUS_MESSAGE_TYPE_SIGNAL) in a decomposed
- * format (one array element per path component).
- * Free the returned array with dbus_free_string_array().
- *
- * An empty but non-NULL path array means the path "/".
- * So the path "/foo/bar" becomes { "foo", "bar", NULL }
- * and the path "/" becomes { NULL }.
- *
- * See also dbus_message_get_path().
- *
- * @todo this could be optimized by using the len from the message
- * instead of calling strlen() again
- *
- * @param message the message
- * @param path place to store allocated array of path components; #NULL set here if no path field exists
- * @returns #FALSE if no memory to allocate the array
- */
-dbus_bool_t
-dbus_message_get_path_decomposed (DBusMessage *message,
- char ***path)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (path != NULL, FALSE);
-
- *path = NULL;
-
- v = dbus_message_get_path (message);
- if (v != NULL)
- {
- if (!_dbus_decompose_path (v, strlen (v),
- path, NULL))
- return FALSE;
- }
- return TRUE;
-}
-
-/**
- * Sets the interface this message is being sent to
- * (for DBUS_MESSAGE_TYPE_METHOD_CALL) or
- * the interface a signal is being emitted from
- * (for DBUS_MESSAGE_TYPE_SIGNAL).
- *
- * The interface name must contain only valid characters as defined
- * in the D-Bus specification.
- *
- * @param message the message
- * @param iface the interface or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_interface (DBusMessage *message,
- const char *iface)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (iface == NULL ||
- _dbus_check_is_valid_interface (iface),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_INTERFACE,
- DBUS_TYPE_STRING,
- iface);
-}
-
-/**
- * Gets the interface this message is being sent to
- * (for DBUS_MESSAGE_TYPE_METHOD_CALL) or being emitted
- * from (for DBUS_MESSAGE_TYPE_SIGNAL).
- * The interface name is fully-qualified (namespaced).
- * Returns #NULL if none.
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the message interface (should not be freed) or #NULL
- */
-const char*
-dbus_message_get_interface (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_INTERFACE,
- DBUS_TYPE_STRING,
- (void *) &v);
- return v;
-}
-
-/**
- * Checks if the message has an interface
- *
- * @param message the message
- * @param iface the interface name
- * @returns #TRUE if the interface field in the header matches
- */
-dbus_bool_t
-dbus_message_has_interface (DBusMessage *message,
- const char *iface)
-{
- const char *msg_interface;
- msg_interface = dbus_message_get_interface (message);
-
- if (msg_interface == NULL)
- {
- if (iface == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (iface == NULL)
- return FALSE;
-
- if (strcmp (msg_interface, iface) == 0)
- return TRUE;
-
- return FALSE;
-
-}
-
-/**
- * Sets the interface member being invoked
- * (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted
- * (DBUS_MESSAGE_TYPE_SIGNAL).
- *
- * The member name must contain only valid characters as defined
- * in the D-Bus specification.
- *
- * @param message the message
- * @param member the member or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_member (DBusMessage *message,
- const char *member)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (member == NULL ||
- _dbus_check_is_valid_member (member),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_MEMBER,
- DBUS_TYPE_STRING,
- member);
-}
-
-/**
- * Gets the interface member being invoked
- * (DBUS_MESSAGE_TYPE_METHOD_CALL) or emitted
- * (DBUS_MESSAGE_TYPE_SIGNAL). Returns #NULL if none.
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the member name (should not be freed) or #NULL
- */
-const char*
-dbus_message_get_member (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_MEMBER,
- DBUS_TYPE_STRING,
- (void *) &v);
- return v;
-}
-
-/**
- * Checks if the message has an interface member
- *
- * @param message the message
- * @param member the member name
- * @returns #TRUE if there is a member field in the header
- */
-dbus_bool_t
-dbus_message_has_member (DBusMessage *message,
- const char *member)
-{
- const char *msg_member;
- msg_member = dbus_message_get_member (message);
-
- if (msg_member == NULL)
- {
- if (member == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (member == NULL)
- return FALSE;
-
- if (strcmp (msg_member, member) == 0)
- return TRUE;
-
- return FALSE;
-
-}
-
-/**
- * Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).
- * The name is fully-qualified (namespaced).
- *
- * The error name must contain only valid characters as defined
- * in the D-Bus specification.
- *
- * @param message the message
- * @param error_name the name or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_error_name (DBusMessage *message,
- const char *error_name)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (error_name == NULL ||
- _dbus_check_is_valid_error_name (error_name),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_ERROR_NAME,
- DBUS_TYPE_STRING,
- error_name);
-}
-
-/**
- * Gets the error name (DBUS_MESSAGE_TYPE_ERROR only)
- * or #NULL if none.
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the error name (should not be freed) or #NULL
- */
-const char*
-dbus_message_get_error_name (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_ERROR_NAME,
- DBUS_TYPE_STRING,
- (void *) &v);
- return v;
-}
-
-/**
- * Sets the message's destination. The destination is the name of
- * another connection on the bus and may be either the unique name
- * assigned by the bus to each connection, or a well-known name
- * specified in advance.
- *
- * The destination name must contain only valid characters as defined
- * in the D-Bus specification.
- *
- * @param message the message
- * @param destination the destination name or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_destination (DBusMessage *message,
- const char *destination)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (destination == NULL ||
- _dbus_check_is_valid_bus_name (destination),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_DESTINATION,
- DBUS_TYPE_STRING,
- destination);
-}
-
-/**
- * Gets the destination of a message or #NULL if there is none set.
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the message destination (should not be freed) or #NULL
- */
-const char*
-dbus_message_get_destination (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_DESTINATION,
- DBUS_TYPE_STRING,
- (void *) &v);
- return v;
-}
-
-/**
- * Sets the message sender.
- *
- * The sender must be a valid bus name as defined in the D-Bus
- * specification.
- *
- * Usually you don't want to call this. The message bus daemon will
- * call it to set the origin of each message. If you aren't implementing
- * a message bus daemon you shouldn't need to set the sender.
- *
- * @param message the message
- * @param sender the sender or #NULL to unset
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_message_set_sender (DBusMessage *message,
- const char *sender)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (sender == NULL ||
- _dbus_check_is_valid_bus_name (sender),
- FALSE);
-
- return set_or_delete_string_field (message,
- DBUS_HEADER_FIELD_SENDER,
- DBUS_TYPE_STRING,
- sender);
-}
-
-/**
- * Gets the unique name of the connection which originated this
- * message, or #NULL if unknown or inapplicable. The sender is filled
- * in by the message bus.
- *
- * Note, the returned sender is always the unique bus name.
- * Connections may own multiple other bus names, but those
- * are not found in the sender field.
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the unique name of the sender or #NULL
- */
-const char*
-dbus_message_get_sender (DBusMessage *message)
-{
- const char *v;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- v = NULL; /* in case field doesn't exist */
- _dbus_header_get_field_basic (&message->header,
- DBUS_HEADER_FIELD_SENDER,
- DBUS_TYPE_STRING,
- (void *) &v);
- return v;
-}
-
-/**
- * Gets the type signature of the message, i.e. the arguments in the
- * message payload. The signature includes only "in" arguments for
- * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
- * #DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from
- * what you might expect (that is, it does not include the signature of the
- * entire C++-style method).
- *
- * The signature is a string made up of type codes such as
- * #DBUS_TYPE_INT32. The string is terminated with nul (nul is also
- * the value of #DBUS_TYPE_INVALID).
- *
- * The returned string becomes invalid if the message is
- * modified, since it points into the wire-marshaled message data.
- *
- * @param message the message
- * @returns the type signature
- */
-const char*
-dbus_message_get_signature (DBusMessage *message)
-{
- const DBusString *type_str;
- int type_pos;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- get_const_signature (&message->header, &type_str, &type_pos);
-
- return _dbus_string_get_const_data_len (type_str, type_pos, 0);
-}
-
-static dbus_bool_t
-_dbus_message_has_type_interface_member (DBusMessage *message,
- int type,
- const char *iface,
- const char *member)
-{
- const char *n;
-
- _dbus_assert (message != NULL);
- _dbus_assert (iface != NULL);
- _dbus_assert (member != NULL);
-
- if (dbus_message_get_type (message) != type)
- return FALSE;
-
- /* Optimize by checking the short member name first
- * instead of the longer interface name
- */
-
- n = dbus_message_get_member (message);
-
- if (n && strcmp (n, member) == 0)
- {
- n = dbus_message_get_interface (message);
-
- if (n == NULL || strcmp (n, iface) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * Checks whether the message is a method call with the given
- * interface and member fields. If the message is not
- * #DBUS_MESSAGE_TYPE_METHOD_CALL, or has a different interface or
- * member field, returns #FALSE. If the interface field is missing,
- * then it will be assumed equal to the provided interface. The D-Bus
- * protocol allows method callers to leave out the interface name.
- *
- * @param message the message
- * @param iface the name to check (must not be #NULL)
- * @param method the name to check (must not be #NULL)
- *
- * @returns #TRUE if the message is the specified method call
- */
-dbus_bool_t
-dbus_message_is_method_call (DBusMessage *message,
- const char *iface,
- const char *method)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (iface != NULL, FALSE);
- _dbus_return_val_if_fail (method != NULL, FALSE);
- /* don't check that interface/method are valid since it would be
- * expensive, and not catch many common errors
- */
-
- return _dbus_message_has_type_interface_member (message,
- DBUS_MESSAGE_TYPE_METHOD_CALL,
- iface, method);
-}
-
-/**
- * Checks whether the message is a signal with the given interface and
- * member fields. If the message is not #DBUS_MESSAGE_TYPE_SIGNAL, or
- * has a different interface or member field, returns #FALSE.
- *
- * @param message the message
- * @param iface the name to check (must not be #NULL)
- * @param signal_name the name to check (must not be #NULL)
- *
- * @returns #TRUE if the message is the specified signal
- */
-dbus_bool_t
-dbus_message_is_signal (DBusMessage *message,
- const char *iface,
- const char *signal_name)
-{
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (iface != NULL, FALSE);
- _dbus_return_val_if_fail (signal_name != NULL, FALSE);
- /* don't check that interface/name are valid since it would be
- * expensive, and not catch many common errors
- */
-
- return _dbus_message_has_type_interface_member (message,
- DBUS_MESSAGE_TYPE_SIGNAL,
- iface, signal_name);
-}
-
-/**
- * Checks whether the message is an error reply with the given error
- * name. If the message is not #DBUS_MESSAGE_TYPE_ERROR, or has a
- * different name, returns #FALSE.
- *
- * @param message the message
- * @param error_name the name to check (must not be #NULL)
- *
- * @returns #TRUE if the message is the specified error
- */
-dbus_bool_t
-dbus_message_is_error (DBusMessage *message,
- const char *error_name)
-{
- const char *n;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (error_name != NULL, FALSE);
- /* don't check that error_name is valid since it would be expensive,
- * and not catch many common errors
- */
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
- return FALSE;
-
- n = dbus_message_get_error_name (message);
-
- if (n && strcmp (n, error_name) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Checks whether the message was sent to the given name. If the
- * message has no destination specified or has a different
- * destination, returns #FALSE.
- *
- * @param message the message
- * @param name the name to check (must not be #NULL)
- *
- * @returns #TRUE if the message has the given destination name
- */
-dbus_bool_t
-dbus_message_has_destination (DBusMessage *message,
- const char *name)
-{
- const char *s;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (name != NULL, FALSE);
- /* don't check that name is valid since it would be expensive, and
- * not catch many common errors
- */
-
- s = dbus_message_get_destination (message);
-
- if (s && strcmp (s, name) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Checks whether the message has the given unique name as its sender.
- * If the message has no sender specified or has a different sender,
- * returns #FALSE. Note that a peer application will always have the
- * unique name of the connection as the sender. So you can't use this
- * function to see whether a sender owned a well-known name.
- *
- * Messages from the bus itself will have #DBUS_SERVICE_DBUS
- * as the sender.
- *
- * @param message the message
- * @param name the name to check (must not be #NULL)
- *
- * @returns #TRUE if the message has the given sender
- */
-dbus_bool_t
-dbus_message_has_sender (DBusMessage *message,
- const char *name)
-{
- const char *s;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (name != NULL, FALSE);
- /* don't check that name is valid since it would be expensive, and
- * not catch many common errors
- */
-
- s = dbus_message_get_sender (message);
-
- if (s && strcmp (s, name) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Checks whether the message has the given signature; see
- * dbus_message_get_signature() for more details on what the signature
- * looks like.
- *
- * @param message the message
- * @param signature typecode array
- * @returns #TRUE if message has the given signature
-*/
-dbus_bool_t
-dbus_message_has_signature (DBusMessage *message,
- const char *signature)
-{
- const char *s;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (signature != NULL, FALSE);
- /* don't check that signature is valid since it would be expensive,
- * and not catch many common errors
- */
-
- s = dbus_message_get_signature (message);
-
- if (s && strcmp (s, signature) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Sets a #DBusError based on the contents of the given
- * message. The error is only set if the message
- * is an error message, as in #DBUS_MESSAGE_TYPE_ERROR.
- * The name of the error is set to the name of the message,
- * and the error message is set to the first argument
- * if the argument exists and is a string.
- *
- * The return value indicates whether the error was set (the error is
- * set if and only if the message is an error message). So you can
- * check for an error reply and convert it to DBusError in one go:
- * @code
- * if (dbus_set_error_from_message (error, reply))
- * return error;
- * else
- * process reply;
- * @endcode
- *
- * @param error the error to set
- * @param message the message to set it from
- * @returns #TRUE if the message had type #DBUS_MESSAGE_TYPE_ERROR
- */
-dbus_bool_t
-dbus_set_error_from_message (DBusError *error,
- DBusMessage *message)
-{
- const char *str;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_error_is_set (error, FALSE);
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
- return FALSE;
-
- str = NULL;
- dbus_message_get_args (message, NULL,
- DBUS_TYPE_STRING, &str,
- DBUS_TYPE_INVALID);
-
- dbus_set_error (error, dbus_message_get_error_name (message),
- str ? "%s" : NULL, str);
-
- return TRUE;
-}
-
-/**
- * Checks whether a message contains unix fds
- *
- * @param message the message
- * @returns #TRUE if the message contains unix fds
- */
-dbus_bool_t
-dbus_message_contains_unix_fds(DBusMessage *message)
-{
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_assert(message);
-
- return message->n_unix_fds > 0;
-#else
- return FALSE;
-#endif
-}
-
-/** @} */
-
-/**
- * @addtogroup DBusMessageInternals
- *
- * @{
- */
-
-/**
- * The initial buffer size of the message loader.
- *
- * @todo this should be based on min header size plus some average
- * body size, or something. Or rather, the min header size only, if we
- * want to try to read only the header, store that in a DBusMessage,
- * then read only the body and store that, etc., depends on
- * how we optimize _dbus_message_loader_get_buffer() and what
- * the exact message format is.
- */
-#define INITIAL_LOADER_DATA_LEN 32
-
-/**
- * Creates a new message loader. Returns #NULL if memory can't
- * be allocated.
- *
- * @returns new loader, or #NULL.
- */
-DBusMessageLoader*
-_dbus_message_loader_new (void)
-{
- DBusMessageLoader *loader;
-
- loader = dbus_new0 (DBusMessageLoader, 1);
- if (loader == NULL)
- return NULL;
-
- loader->refcount = 1;
-
- loader->corrupted = FALSE;
- loader->corruption_reason = DBUS_VALID;
-
- /* this can be configured by the app, but defaults to the protocol max */
- loader->max_message_size = DBUS_MAXIMUM_MESSAGE_LENGTH;
-
- /* We set a very relatively conservative default here since due to how
- SCM_RIGHTS works we need to preallocate an fd array of the maximum
- number of unix fds we want to receive in advance. A
- try-and-reallocate loop is not possible. */
- loader->max_message_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS;
-
- if (!_dbus_string_init (&loader->data))
- {
- dbus_free (loader);
- return NULL;
- }
-
- /* preallocate the buffer for speed, ignore failure */
- _dbus_string_set_length (&loader->data, INITIAL_LOADER_DATA_LEN);
- _dbus_string_set_length (&loader->data, 0);
-
-#ifdef HAVE_UNIX_FD_PASSING
- loader->unix_fds = NULL;
- loader->n_unix_fds = loader->n_unix_fds_allocated = 0;
- loader->unix_fds_outstanding = FALSE;
-#endif
-
- return loader;
-}
-
-/**
- * Increments the reference count of the loader.
- *
- * @param loader the loader.
- * @returns the loader
- */
-DBusMessageLoader *
-_dbus_message_loader_ref (DBusMessageLoader *loader)
-{
- loader->refcount += 1;
-
- return loader;
-}
-
-/**
- * Decrements the reference count of the loader and finalizes the
- * loader when the count reaches zero.
- *
- * @param loader the loader.
- */
-void
-_dbus_message_loader_unref (DBusMessageLoader *loader)
-{
- loader->refcount -= 1;
- if (loader->refcount == 0)
- {
-#ifdef HAVE_UNIX_FD_PASSING
- close_unix_fds(loader->unix_fds, &loader->n_unix_fds);
- dbus_free(loader->unix_fds);
-#endif
- _dbus_list_foreach (&loader->messages,
- (DBusForeachFunction) dbus_message_unref,
- NULL);
- _dbus_list_clear (&loader->messages);
- _dbus_string_free (&loader->data);
- dbus_free (loader);
- }
-}
-
-/**
- * Gets the buffer to use for reading data from the network. Network
- * data is read directly into an allocated buffer, which is then used
- * in the DBusMessage, to avoid as many extra memcpy's as possible.
- * The buffer must always be returned immediately using
- * _dbus_message_loader_return_buffer(), even if no bytes are
- * successfully read.
- *
- * @todo this function can be a lot more clever. For example
- * it can probably always return a buffer size to read exactly
- * the body of the next message, thus avoiding any memory wastage
- * or reallocs.
- *
- * @todo we need to enforce a max length on strings in header fields.
- *
- * @param loader the message loader.
- * @param buffer the buffer
- */
-void
-_dbus_message_loader_get_buffer (DBusMessageLoader *loader,
- DBusString **buffer)
-{
- _dbus_assert (!loader->buffer_outstanding);
-
- *buffer = &loader->data;
-
- loader->buffer_outstanding = TRUE;
-}
-
-/**
- * Returns a buffer obtained from _dbus_message_loader_get_buffer(),
- * indicating to the loader how many bytes of the buffer were filled
- * in. This function must always be called, even if no bytes were
- * successfully read.
- *
- * @param loader the loader.
- * @param buffer the buffer.
- */
-void
-_dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer)
-{
- _dbus_assert (loader->buffer_outstanding);
- _dbus_assert (buffer == &loader->data);
-
- loader->buffer_outstanding = FALSE;
-}
-
-/**
- * Gets the buffer to use for reading unix fds from the network.
- *
- * This works similar to _dbus_message_loader_get_buffer()
- *
- * @param loader the message loader.
- * @param fds the array to read fds into
- * @param max_n_fds how many fds to read at most
- * @return TRUE on success, FALSE on OOM
- */
-dbus_bool_t
-_dbus_message_loader_get_unix_fds(DBusMessageLoader *loader,
- int **fds,
- unsigned *max_n_fds)
-{
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_assert (!loader->unix_fds_outstanding);
-
- /* Allocate space where we can put the fds we read. We allocate
- space for max_message_unix_fds since this is an
- upper limit how many fds can be received within a single
- message. Since SCM_RIGHTS doesn't allow a reallocate+retry logic
- we are allocating the maximum possible array size right from the
- beginning. This sucks a bit, however unless SCM_RIGHTS is fixed
- there is no better way. */
-
- if (loader->n_unix_fds_allocated < loader->max_message_unix_fds)
- {
- int *a = dbus_realloc(loader->unix_fds,
- loader->max_message_unix_fds * sizeof(loader->unix_fds[0]));
-
- if (!a)
- return FALSE;
-
- loader->unix_fds = a;
- loader->n_unix_fds_allocated = loader->max_message_unix_fds;
- }
-
- *fds = loader->unix_fds + loader->n_unix_fds;
- *max_n_fds = loader->n_unix_fds_allocated - loader->n_unix_fds;
-
- loader->unix_fds_outstanding = TRUE;
- return TRUE;
-#else
- _dbus_assert_not_reached("Platform doesn't support unix fd passing");
- return FALSE;
-#endif
-}
-
-/**
- * Returns a buffer obtained from _dbus_message_loader_get_unix_fds().
- *
- * This works similar to _dbus_message_loader_return_buffer()
- *
- * @param loader the message loader.
- * @param fds the array fds were read into
- * @param n_fds how many fds were read
- */
-
-void
-_dbus_message_loader_return_unix_fds(DBusMessageLoader *loader,
- int *fds,
- unsigned n_fds)
-{
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_assert(loader->unix_fds_outstanding);
- _dbus_assert(loader->unix_fds + loader->n_unix_fds == fds);
- _dbus_assert(loader->n_unix_fds + n_fds <= loader->n_unix_fds_allocated);
-
- loader->n_unix_fds += n_fds;
- loader->unix_fds_outstanding = FALSE;
-#else
- _dbus_assert_not_reached("Platform doesn't support unix fd passing");
-#endif
-}
-
-/*
- * FIXME when we move the header out of the buffer, that memmoves all
- * buffered messages. Kind of crappy.
- *
- * Also we copy the header and body, which is kind of crappy. To
- * avoid this, we have to allow header and body to be in a single
- * memory block, which is good for messages we read and bad for
- * messages we are creating. But we could move_len() the buffer into
- * this single memory block, and move_len() will just swap the buffers
- * if you're moving the entire buffer replacing the dest string.
- *
- * We could also have the message loader tell the transport how many
- * bytes to read; so it would first ask for some arbitrary number like
- * 256, then if the message was incomplete it would use the
- * header/body len to ask for exactly the size of the message (or
- * blocks the size of a typical kernel buffer for the socket). That
- * way we don't get trailing bytes in the buffer that have to be
- * memmoved. Though I suppose we also don't have a chance of reading a
- * bunch of small messages at once, so the optimization may be stupid.
- *
- * Another approach would be to keep a "start" index into
- * loader->data and only delete it occasionally, instead of after
- * each message is loaded.
- *
- * load_message() returns FALSE if not enough memory OR the loader was corrupted
- */
-static dbus_bool_t
-load_message (DBusMessageLoader *loader,
- DBusMessage *message,
- int byte_order,
- int fields_array_len,
- int header_len,
- int body_len)
-{
- dbus_bool_t oom;
- DBusValidity validity;
- const DBusString *type_str;
- int type_pos;
- DBusValidationMode mode;
- dbus_uint32_t n_unix_fds = 0;
-
- mode = DBUS_VALIDATION_MODE_DATA_IS_UNTRUSTED;
-
- oom = FALSE;
-
-#if 0
- _dbus_verbose_bytes_of_string (&loader->data, 0, header_len /* + body_len */);
-#endif
-
- /* 1. VALIDATE AND COPY OVER HEADER */
- _dbus_assert (_dbus_string_get_length (&message->header.data) == 0);
- _dbus_assert ((header_len + body_len) <= _dbus_string_get_length (&loader->data));
-
- if (!_dbus_header_load (&message->header,
- mode,
- &validity,
- byte_order,
- fields_array_len,
- header_len,
- body_len,
- &loader->data, 0,
- _dbus_string_get_length (&loader->data)))
- {
- _dbus_verbose ("Failed to load header for new message code %d\n", validity);
-
- /* assert here so we can catch any code that still uses DBUS_VALID to indicate
- oom errors. They should use DBUS_VALIDITY_UNKNOWN_OOM_ERROR instead */
- _dbus_assert (validity != DBUS_VALID);
-
- if (validity == DBUS_VALIDITY_UNKNOWN_OOM_ERROR)
- oom = TRUE;
- else
- {
- loader->corrupted = TRUE;
- loader->corruption_reason = validity;
- }
- goto failed;
- }
-
- _dbus_assert (validity == DBUS_VALID);
-
- /* 2. VALIDATE BODY */
- if (mode != DBUS_VALIDATION_MODE_WE_TRUST_THIS_DATA_ABSOLUTELY)
- {
- get_const_signature (&message->header, &type_str, &type_pos);
-
- /* Because the bytes_remaining arg is NULL, this validates that the
- * body is the right length
- */
- validity = _dbus_validate_body_with_reason (type_str,
- type_pos,
- byte_order,
- NULL,
- &loader->data,
- header_len,
- body_len);
- if (validity != DBUS_VALID)
- {
- _dbus_verbose ("Failed to validate message body code %d\n", validity);
-
- loader->corrupted = TRUE;
- loader->corruption_reason = validity;
-
- goto failed;
- }
- }
-
- /* 3. COPY OVER UNIX FDS */
- _dbus_header_get_field_basic(&message->header,
- DBUS_HEADER_FIELD_UNIX_FDS,
- DBUS_TYPE_UINT32,
- &n_unix_fds);
-
-#ifdef HAVE_UNIX_FD_PASSING
-
- if (n_unix_fds > loader->n_unix_fds)
- {
- _dbus_verbose("Message contains references to more unix fds than were sent %u != %u\n",
- n_unix_fds, loader->n_unix_fds);
-
- loader->corrupted = TRUE;
- loader->corruption_reason = DBUS_INVALID_MISSING_UNIX_FDS;
- goto failed;
- }
-
- /* If this was a recycled message there might still be
- some memory allocated for the fds */
- dbus_free(message->unix_fds);
-
- if (n_unix_fds > 0)
- {
- message->unix_fds = _dbus_memdup(loader->unix_fds, n_unix_fds * sizeof(message->unix_fds[0]));
- if (message->unix_fds == NULL)
- {
- _dbus_verbose ("Failed to allocate file descriptor array\n");
- oom = TRUE;
- goto failed;
- }
-
- message->n_unix_fds_allocated = message->n_unix_fds = n_unix_fds;
- loader->n_unix_fds -= n_unix_fds;
- memmove(loader->unix_fds + n_unix_fds, loader->unix_fds, loader->n_unix_fds);
- }
- else
- message->unix_fds = NULL;
-
-#else
-
- if (n_unix_fds > 0)
- {
- _dbus_verbose ("Hmm, message claims to come with file descriptors "
- "but that's not supported on our platform, disconnecting.\n");
-
- loader->corrupted = TRUE;
- loader->corruption_reason = DBUS_INVALID_MISSING_UNIX_FDS;
- goto failed;
- }
-
-#endif
-
- /* 3. COPY OVER BODY AND QUEUE MESSAGE */
-
- if (!_dbus_list_append (&loader->messages, message))
- {
- _dbus_verbose ("Failed to append new message to loader queue\n");
- oom = TRUE;
- goto failed;
- }
-
- _dbus_assert (_dbus_string_get_length (&message->body) == 0);
- _dbus_assert (_dbus_string_get_length (&loader->data) >=
- (header_len + body_len));
-
- if (!_dbus_string_copy_len (&loader->data, header_len, body_len, &message->body, 0))
- {
- _dbus_verbose ("Failed to move body into new message\n");
- oom = TRUE;
- goto failed;
- }
-
- _dbus_string_delete (&loader->data, 0, header_len + body_len);
-
- /* don't waste more than 2k of memory */
- _dbus_string_compact (&loader->data, 2048);
-
- _dbus_assert (_dbus_string_get_length (&message->header.data) == header_len);
- _dbus_assert (_dbus_string_get_length (&message->body) == body_len);
-
- _dbus_verbose ("Loaded message %p\n", message);
-
- _dbus_assert (!oom);
- _dbus_assert (!loader->corrupted);
- _dbus_assert (loader->messages != NULL);
- _dbus_assert (_dbus_list_find_last (&loader->messages, message) != NULL);
-
- return TRUE;
-
- failed:
-
- /* Clean up */
-
- /* does nothing if the message isn't in the list */
- _dbus_list_remove_last (&loader->messages, message);
-
- if (oom)
- _dbus_assert (!loader->corrupted);
- else
- _dbus_assert (loader->corrupted);
-
- _dbus_verbose_bytes_of_string (&loader->data, 0, _dbus_string_get_length (&loader->data));
-
- return FALSE;
-}
-
-/**
- * Converts buffered data into messages, if we have enough data. If
- * we don't have enough data, does nothing.
- *
- * @todo we need to check that the proper named header fields exist
- * for each message type.
- *
- * @todo If a message has unknown type, we should probably eat it
- * right here rather than passing it out to applications. However
- * it's not an error to see messages of unknown type.
- *
- * @param loader the loader.
- * @returns #TRUE if we had enough memory to finish.
- */
-dbus_bool_t
-_dbus_message_loader_queue_messages (DBusMessageLoader *loader)
-{
- while (!loader->corrupted &&
- _dbus_string_get_length (&loader->data) >= DBUS_MINIMUM_HEADER_SIZE)
- {
- DBusValidity validity;
- int byte_order, fields_array_len, header_len, body_len;
-
- if (_dbus_header_have_message_untrusted (loader->max_message_size,
- &validity,
- &byte_order,
- &fields_array_len,
- &header_len,
- &body_len,
- &loader->data, 0,
- _dbus_string_get_length (&loader->data)))
- {
- DBusMessage *message;
-
- _dbus_assert (validity == DBUS_VALID);
-
- message = dbus_message_new_empty_header ();
- if (message == NULL)
- return FALSE;
-
- if (!load_message (loader, message,
- byte_order, fields_array_len,
- header_len, body_len))
- {
- dbus_message_unref (message);
- /* load_message() returns false if corrupted or OOM; if
- * corrupted then return TRUE for not OOM
- */
- return loader->corrupted;
- }
-
- _dbus_assert (loader->messages != NULL);
- _dbus_assert (_dbus_list_find_last (&loader->messages, message) != NULL);
- }
- else
- {
- _dbus_verbose ("Initial peek at header says we don't have a whole message yet, or data broken with invalid code %d\n",
- validity);
- if (validity != DBUS_VALID)
- {
- loader->corrupted = TRUE;
- loader->corruption_reason = validity;
- }
- return TRUE;
- }
- }
-
- return TRUE;
-}
-
-/**
- * Peeks at first loaded message, returns #NULL if no messages have
- * been queued.
- *
- * @param loader the loader.
- * @returns the next message, or #NULL if none.
- */
-DBusMessage*
-_dbus_message_loader_peek_message (DBusMessageLoader *loader)
-{
- if (loader->messages)
- return loader->messages->data;
- else
- return NULL;
-}
-
-/**
- * Pops a loaded message (passing ownership of the message
- * to the caller). Returns #NULL if no messages have been
- * queued.
- *
- * @param loader the loader.
- * @returns the next message, or #NULL if none.
- */
-DBusMessage*
-_dbus_message_loader_pop_message (DBusMessageLoader *loader)
-{
- return _dbus_list_pop_first (&loader->messages);
-}
-
-/**
- * Pops a loaded message inside a list link (passing ownership of the
- * message and link to the caller). Returns #NULL if no messages have
- * been loaded.
- *
- * @param loader the loader.
- * @returns the next message link, or #NULL if none.
- */
-DBusList*
-_dbus_message_loader_pop_message_link (DBusMessageLoader *loader)
-{
- return _dbus_list_pop_first_link (&loader->messages);
-}
-
-/**
- * Returns a popped message link, used to undo a pop.
- *
- * @param loader the loader
- * @param link the link with a message in it
- */
-void
-_dbus_message_loader_putback_message_link (DBusMessageLoader *loader,
- DBusList *link)
-{
- _dbus_list_prepend_link (&loader->messages, link);
-}
-
-/**
- * Checks whether the loader is confused due to bad data.
- * If messages are received that are invalid, the
- * loader gets confused and gives up permanently.
- * This state is called "corrupted."
- *
- * @param loader the loader
- * @returns #TRUE if the loader is hosed.
- */
-dbus_bool_t
-_dbus_message_loader_get_is_corrupted (DBusMessageLoader *loader)
-{
- _dbus_assert ((loader->corrupted && loader->corruption_reason != DBUS_VALID) ||
- (!loader->corrupted && loader->corruption_reason == DBUS_VALID));
- return loader->corrupted;
-}
-
-/**
- * Checks what kind of bad data confused the loader.
- *
- * @param loader the loader
- * @returns why the loader is hosed, or DBUS_VALID if it isn't.
- */
-DBusValidity
-_dbus_message_loader_get_corruption_reason (DBusMessageLoader *loader)
-{
- _dbus_assert ((loader->corrupted && loader->corruption_reason != DBUS_VALID) ||
- (!loader->corrupted && loader->corruption_reason == DBUS_VALID));
-
- return loader->corruption_reason;
-}
-
-/**
- * Sets the maximum size message we allow.
- *
- * @param loader the loader
- * @param size the max message size in bytes
- */
-void
-_dbus_message_loader_set_max_message_size (DBusMessageLoader *loader,
- long size)
-{
- if (size > DBUS_MAXIMUM_MESSAGE_LENGTH)
- {
- _dbus_verbose ("clamping requested max message size %ld to %d\n",
- size, DBUS_MAXIMUM_MESSAGE_LENGTH);
- size = DBUS_MAXIMUM_MESSAGE_LENGTH;
- }
- loader->max_message_size = size;
-}
-
-/**
- * Gets the maximum allowed message size in bytes.
- *
- * @param loader the loader
- * @returns max size in bytes
- */
-long
-_dbus_message_loader_get_max_message_size (DBusMessageLoader *loader)
-{
- return loader->max_message_size;
-}
-
-/**
- * Sets the maximum unix fds per message we allow.
- *
- * @param loader the loader
- * @param n the max number of unix fds in a message
- */
-void
-_dbus_message_loader_set_max_message_unix_fds (DBusMessageLoader *loader,
- long n)
-{
- if (n > DBUS_MAXIMUM_MESSAGE_UNIX_FDS)
- {
- _dbus_verbose ("clamping requested max message unix_fds %ld to %d\n",
- n, DBUS_MAXIMUM_MESSAGE_UNIX_FDS);
- n = DBUS_MAXIMUM_MESSAGE_UNIX_FDS;
- }
- loader->max_message_unix_fds = n;
-}
-
-/**
- * Gets the maximum allowed number of unix fds per message
- *
- * @param loader the loader
- * @returns max unix fds
- */
-long
-_dbus_message_loader_get_max_message_unix_fds (DBusMessageLoader *loader)
-{
- return loader->max_message_unix_fds;
-}
-
-static DBusDataSlotAllocator slot_allocator =
- _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (message_slots));
-
-/**
- * Allocates an integer ID to be used for storing application-specific
- * data on any DBusMessage. The allocated ID may then be used
- * with dbus_message_set_data() and dbus_message_get_data().
- * The passed-in slot must be initialized to -1, and is filled in
- * with the slot ID. If the passed-in slot is not -1, it's assumed
- * to be already allocated, and its refcount is incremented.
- *
- * The allocated slot is global, i.e. all DBusMessage objects will
- * have a slot with the given integer ID reserved.
- *
- * @param slot_p address of a global variable storing the slot
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_message_allocate_data_slot (dbus_int32_t *slot_p)
-{
- return _dbus_data_slot_allocator_alloc (&slot_allocator,
- slot_p);
-}
-
-/**
- * Deallocates a global ID for message data slots.
- * dbus_message_get_data() and dbus_message_set_data() may no
- * longer be used with this slot. Existing data stored on existing
- * DBusMessage objects will be freed when the message is
- * finalized, but may not be retrieved (and may only be replaced if
- * someone else reallocates the slot). When the refcount on the
- * passed-in slot reaches 0, it is set to -1.
- *
- * @param slot_p address storing the slot to deallocate
- */
-void
-dbus_message_free_data_slot (dbus_int32_t *slot_p)
-{
- _dbus_return_if_fail (*slot_p >= 0);
-
- _dbus_data_slot_allocator_free (&slot_allocator, slot_p);
-}
-
-/**
- * Stores a pointer on a DBusMessage, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the message is finalized. The slot number
- * must have been allocated with dbus_message_allocate_data_slot().
- *
- * @param message the message
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-dbus_message_set_data (DBusMessage *message,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func)
-{
- DBusFreeFunction old_free_func;
- void *old_data;
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (slot >= 0, FALSE);
-
- retval = _dbus_data_slot_list_set (&slot_allocator,
- &message->slot_list,
- slot, data, free_data_func,
- &old_free_func, &old_data);
-
- if (retval)
- {
- /* Do the actual free outside the message lock */
- if (old_free_func)
- (* old_free_func) (old_data);
- }
-
- return retval;
-}
-
-/**
- * Retrieves data previously set with dbus_message_set_data().
- * The slot must still be allocated (must not have been freed).
- *
- * @param message the message
- * @param slot the slot to get data from
- * @returns the data, or #NULL if not found
- */
-void*
-dbus_message_get_data (DBusMessage *message,
- dbus_int32_t slot)
-{
- void *res;
-
- _dbus_return_val_if_fail (message != NULL, NULL);
-
- res = _dbus_data_slot_list_get (&slot_allocator,
- &message->slot_list,
- slot);
-
- return res;
-}
-
-/**
- * Utility function to convert a machine-readable (not translated)
- * string into a D-Bus message type.
- *
- * @code
- * "method_call" -> DBUS_MESSAGE_TYPE_METHOD_CALL
- * "method_return" -> DBUS_MESSAGE_TYPE_METHOD_RETURN
- * "signal" -> DBUS_MESSAGE_TYPE_SIGNAL
- * "error" -> DBUS_MESSAGE_TYPE_ERROR
- * anything else -> DBUS_MESSAGE_TYPE_INVALID
- * @endcode
- *
- */
-int
-dbus_message_type_from_string (const char *type_str)
-{
- if (strcmp (type_str, "method_call") == 0)
- return DBUS_MESSAGE_TYPE_METHOD_CALL;
- if (strcmp (type_str, "method_return") == 0)
- return DBUS_MESSAGE_TYPE_METHOD_RETURN;
- else if (strcmp (type_str, "signal") == 0)
- return DBUS_MESSAGE_TYPE_SIGNAL;
- else if (strcmp (type_str, "error") == 0)
- return DBUS_MESSAGE_TYPE_ERROR;
- else
- return DBUS_MESSAGE_TYPE_INVALID;
-}
-
-/**
- * Utility function to convert a D-Bus message type into a
- * machine-readable string (not translated).
- *
- * @code
- * DBUS_MESSAGE_TYPE_METHOD_CALL -> "method_call"
- * DBUS_MESSAGE_TYPE_METHOD_RETURN -> "method_return"
- * DBUS_MESSAGE_TYPE_SIGNAL -> "signal"
- * DBUS_MESSAGE_TYPE_ERROR -> "error"
- * DBUS_MESSAGE_TYPE_INVALID -> "invalid"
- * @endcode
- *
- */
-const char *
-dbus_message_type_to_string (int type)
-{
- switch (type)
- {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- return "method_call";
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- return "method_return";
- case DBUS_MESSAGE_TYPE_SIGNAL:
- return "signal";
- case DBUS_MESSAGE_TYPE_ERROR:
- return "error";
- default:
- return "invalid";
- }
-}
-
-/**
- * Turn a DBusMessage into the marshalled form as described in the D-Bus
- * specification.
- *
- * Generally, this function is only useful for encapsulating D-Bus messages in
- * a different protocol.
- *
- * @param msg the DBusMessage
- * @param marshalled_data_p the location to save the marshalled form to
- * @param len_p the location to save the length of the marshalled form to
- * @returns #FALSE if there was not enough memory
- */
-dbus_bool_t
-dbus_message_marshal (DBusMessage *msg,
- char **marshalled_data_p,
- int *len_p)
-{
- DBusString tmp;
- dbus_bool_t was_locked;
-
- _dbus_return_val_if_fail (msg != NULL, FALSE);
- _dbus_return_val_if_fail (marshalled_data_p != NULL, FALSE);
- _dbus_return_val_if_fail (len_p != NULL, FALSE);
-
- if (!_dbus_string_init (&tmp))
- return FALSE;
-
- /* Ensure the message is locked, to ensure the length header is filled in. */
- was_locked = msg->locked;
-
- if (!was_locked)
- dbus_message_lock (msg);
-
- if (!_dbus_string_copy (&(msg->header.data), 0, &tmp, 0))
- goto fail;
-
- *len_p = _dbus_string_get_length (&tmp);
-
- if (!_dbus_string_copy (&(msg->body), 0, &tmp, *len_p))
- goto fail;
-
- *len_p = _dbus_string_get_length (&tmp);
-
- if (!_dbus_string_steal_data (&tmp, marshalled_data_p))
- goto fail;
-
- _dbus_string_free (&tmp);
-
- if (!was_locked)
- msg->locked = FALSE;
-
- return TRUE;
-
- fail:
- _dbus_string_free (&tmp);
-
- if (!was_locked)
- msg->locked = FALSE;
-
- return FALSE;
-}
-
-/**
- * Demarshal a D-Bus message from the format described in the D-Bus
- * specification.
- *
- * Generally, this function is only useful for encapsulating D-Bus messages in
- * a different protocol.
- *
- * @param str the marshalled DBusMessage
- * @param len the length of str
- * @param error the location to save errors to
- * @returns #NULL if there was an error
- */
-DBusMessage *
-dbus_message_demarshal (const char *str,
- int len,
- DBusError *error)
-{
- DBusMessageLoader *loader;
- DBusString *buffer;
- DBusMessage *msg;
-
- _dbus_return_val_if_fail (str != NULL, NULL);
-
- loader = _dbus_message_loader_new ();
-
- if (loader == NULL)
- return NULL;
-
- _dbus_message_loader_get_buffer (loader, &buffer);
- _dbus_string_append_len (buffer, str, len);
- _dbus_message_loader_return_buffer (loader, buffer);
-
- if (!_dbus_message_loader_queue_messages (loader))
- goto fail_oom;
-
- if (_dbus_message_loader_get_is_corrupted (loader))
- goto fail_corrupt;
-
- msg = _dbus_message_loader_pop_message (loader);
-
- if (!msg)
- goto fail_oom;
-
- _dbus_message_loader_unref (loader);
- return msg;
-
- fail_corrupt:
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS, "Message is corrupted (%s)",
- _dbus_validity_to_error_message (loader->corruption_reason));
- _dbus_message_loader_unref (loader);
- return NULL;
-
- fail_oom:
- _DBUS_SET_OOM (error);
- _dbus_message_loader_unref (loader);
- return NULL;
-}
-
-/**
- * Returns the number of bytes required to be in the buffer to demarshal a
- * D-Bus message.
- *
- * Generally, this function is only useful for encapsulating D-Bus messages in
- * a different protocol.
- *
- * @param buf data to be marshalled
- * @param len the length of @p buf
- * @returns -1 if there was no valid data to be demarshalled, 0 if there wasn't enough data to determine how much should be demarshalled. Otherwise returns the number of bytes to be demarshalled
- *
- */
-int
-dbus_message_demarshal_bytes_needed(const char *buf,
- int len)
-{
- DBusString str;
- int byte_order, fields_array_len, header_len, body_len;
- DBusValidity validity = DBUS_VALID;
- int have_message;
-
- if (!buf || len < DBUS_MINIMUM_HEADER_SIZE)
- return 0;
-
- if (len > DBUS_MAXIMUM_MESSAGE_LENGTH)
- len = DBUS_MAXIMUM_MESSAGE_LENGTH;
- _dbus_string_init_const_len (&str, buf, len);
-
- validity = DBUS_VALID;
- have_message
- = _dbus_header_have_message_untrusted(DBUS_MAXIMUM_MESSAGE_LENGTH,
- &validity, &byte_order,
- &fields_array_len,
- &header_len,
- &body_len,
- &str, 0,
- len);
- _dbus_string_free (&str);
-
- if (validity == DBUS_VALID)
- {
- _dbus_assert (have_message || (header_len + body_len) > len);
- (void) have_message; /* unused unless asserting */
- return header_len + body_len;
- }
- else
- {
- return -1; /* broken! */
- }
-}
-
-/** @} */
-
-/* tests in dbus-message-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-message.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-message.h
deleted file mode 100644
index 4fd44dabd0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-message.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-message.h DBusMessage object
- *
- * Copyright (C) 2002, 2003, 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_MESSAGE_H
-#define DBUS_MESSAGE_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-arch-deps.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-errors.h>
-#include <stdarg.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusMessage
- * @{
- */
-
-typedef struct DBusMessage DBusMessage;
-/** Opaque type representing a message iterator. Can be copied by value, and contains no allocated memory so never needs to be freed and can be allocated on the stack. */
-typedef struct DBusMessageIter DBusMessageIter;
-
-/**
- * DBusMessageIter struct; contains no public fields.
- */
-struct DBusMessageIter
-{
- void *dummy1; /**< Don't use this */
- void *dummy2; /**< Don't use this */
- dbus_uint32_t dummy3; /**< Don't use this */
- int dummy4; /**< Don't use this */
- int dummy5; /**< Don't use this */
- int dummy6; /**< Don't use this */
- int dummy7; /**< Don't use this */
- int dummy8; /**< Don't use this */
- int dummy9; /**< Don't use this */
- int dummy10; /**< Don't use this */
- int dummy11; /**< Don't use this */
- int pad1; /**< Don't use this */
- int pad2; /**< Don't use this */
- void *pad3; /**< Don't use this */
-};
-
-DBUS_EXPORT
-DBusMessage* dbus_message_new (int message_type);
-DBUS_EXPORT
-DBusMessage* dbus_message_new_method_call (const char *bus_name,
- const char *path,
- const char *iface,
- const char *method);
-DBUS_EXPORT
-DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
-DBUS_EXPORT
-DBusMessage* dbus_message_new_signal (const char *path,
- const char *iface,
- const char *name);
-DBUS_EXPORT
-DBusMessage* dbus_message_new_error (DBusMessage *reply_to,
- const char *error_name,
- const char *error_message);
-DBUS_EXPORT
-DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to,
- const char *error_name,
- const char *error_format,
- ...);
-
-DBUS_EXPORT
-DBusMessage* dbus_message_copy (const DBusMessage *message);
-
-DBUS_EXPORT
-DBusMessage* dbus_message_ref (DBusMessage *message);
-DBUS_EXPORT
-void dbus_message_unref (DBusMessage *message);
-DBUS_EXPORT
-int dbus_message_get_type (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_path (DBusMessage *message,
- const char *object_path);
-DBUS_EXPORT
-const char* dbus_message_get_path (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_path (DBusMessage *message,
- const char *object_path);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_interface (DBusMessage *message,
- const char *iface);
-DBUS_EXPORT
-const char* dbus_message_get_interface (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_interface (DBusMessage *message,
- const char *iface);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_member (DBusMessage *message,
- const char *member);
-DBUS_EXPORT
-const char* dbus_message_get_member (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_member (DBusMessage *message,
- const char *member);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_error_name (DBusMessage *message,
- const char *name);
-DBUS_EXPORT
-const char* dbus_message_get_error_name (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_destination (DBusMessage *message,
- const char *destination);
-DBUS_EXPORT
-const char* dbus_message_get_destination (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_sender (DBusMessage *message,
- const char *sender);
-DBUS_EXPORT
-const char* dbus_message_get_sender (DBusMessage *message);
-DBUS_EXPORT
-const char* dbus_message_get_signature (DBusMessage *message);
-DBUS_EXPORT
-void dbus_message_set_no_reply (DBusMessage *message,
- dbus_bool_t no_reply);
-DBUS_EXPORT
-dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
-DBUS_EXPORT
-dbus_bool_t dbus_message_is_method_call (DBusMessage *message,
- const char *iface,
- const char *method);
-DBUS_EXPORT
-dbus_bool_t dbus_message_is_signal (DBusMessage *message,
- const char *iface,
- const char *signal_name);
-DBUS_EXPORT
-dbus_bool_t dbus_message_is_error (DBusMessage *message,
- const char *error_name);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_destination (DBusMessage *message,
- const char *bus_name);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_sender (DBusMessage *message,
- const char *unique_bus_name);
-DBUS_EXPORT
-dbus_bool_t dbus_message_has_signature (DBusMessage *message,
- const char *signature);
-DBUS_EXPORT
-dbus_uint32_t dbus_message_get_serial (DBusMessage *message);
-DBUS_EXPORT
-void dbus_message_set_serial (DBusMessage *message,
- dbus_uint32_t serial);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message,
- dbus_uint32_t reply_serial);
-DBUS_EXPORT
-dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message);
-
-DBUS_EXPORT
-void dbus_message_set_auto_start (DBusMessage *message,
- dbus_bool_t auto_start);
-DBUS_EXPORT
-dbus_bool_t dbus_message_get_auto_start (DBusMessage *message);
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_get_path_decomposed (DBusMessage *message,
- char ***path);
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_append_args (DBusMessage *message,
- int first_arg_type,
- ...);
-DBUS_EXPORT
-dbus_bool_t dbus_message_append_args_valist (DBusMessage *message,
- int first_arg_type,
- va_list var_args);
-DBUS_EXPORT
-dbus_bool_t dbus_message_get_args (DBusMessage *message,
- DBusError *error,
- int first_arg_type,
- ...);
-DBUS_EXPORT
-dbus_bool_t dbus_message_get_args_valist (DBusMessage *message,
- DBusError *error,
- int first_arg_type,
- va_list var_args);
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_contains_unix_fds (DBusMessage *message);
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_init (DBusMessage *message,
- DBusMessageIter *iter);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter);
-DBUS_EXPORT
-char* dbus_message_iter_get_signature (DBusMessageIter *iter);
-DBUS_EXPORT
-int dbus_message_iter_get_arg_type (DBusMessageIter *iter);
-DBUS_EXPORT
-int dbus_message_iter_get_element_type (DBusMessageIter *iter);
-DBUS_EXPORT
-void dbus_message_iter_recurse (DBusMessageIter *iter,
- DBusMessageIter *sub);
-DBUS_EXPORT
-void dbus_message_iter_get_basic (DBusMessageIter *iter,
- void *value);
-#ifndef DBUS_DISABLE_DEPRECATED
-/* This function returns the wire protocol size of the array in bytes,
- * you do not want to know that probably
- */
-DBUS_EXPORT
-DBUS_DEPRECATED int dbus_message_iter_get_array_len (DBusMessageIter *iter);
-#endif
-DBUS_EXPORT
-void dbus_message_iter_get_fixed_array (DBusMessageIter *iter,
- void *value,
- int *n_elements);
-
-
-DBUS_EXPORT
-void dbus_message_iter_init_append (DBusMessage *message,
- DBusMessageIter *iter);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter,
- int type,
- const void *value);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter,
- int element_type,
- const void *value,
- int n_elements);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter,
- int type,
- const char *contained_signature,
- DBusMessageIter *sub);
-DBUS_EXPORT
-dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter,
- DBusMessageIter *sub);
-DBUS_EXPORT
-void dbus_message_iter_abandon_container (DBusMessageIter *iter,
- DBusMessageIter *sub);
-
-DBUS_EXPORT
-void dbus_message_lock (DBusMessage *message);
-
-DBUS_EXPORT
-dbus_bool_t dbus_set_error_from_message (DBusError *error,
- DBusMessage *message);
-
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-void dbus_message_free_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-dbus_bool_t dbus_message_set_data (DBusMessage *message,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func);
-DBUS_EXPORT
-void* dbus_message_get_data (DBusMessage *message,
- dbus_int32_t slot);
-
-DBUS_EXPORT
-int dbus_message_type_from_string (const char *type_str);
-DBUS_EXPORT
-const char* dbus_message_type_to_string (int type);
-
-DBUS_EXPORT
-dbus_bool_t dbus_message_marshal (DBusMessage *msg,
- char **marshalled_data_p,
- int *len_p);
-DBUS_EXPORT
-DBusMessage* dbus_message_demarshal (const char *str,
- int len,
- DBusError *error);
-
-DBUS_EXPORT
-int dbus_message_demarshal_bytes_needed (const char *str,
- int len);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MESSAGE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.c
deleted file mode 100644
index 6ca30f2495..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-misc.c A few assorted public functions that don't fit elsewhere
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-misc.h"
-#include "dbus-internals.h"
-#include "dbus-string.h"
-
-/**
- * @defgroup DBusMisc Miscellaneous
- * @ingroup DBus
- * @brief Miscellaneous API that doesn't cleanly fit anywhere else
- *
- * @{
- */
-
-/**
- * Obtains the machine UUID of the machine this process is running on.
- *
- * The returned string must be freed with dbus_free().
- *
- * This UUID is guaranteed to remain the same until the next reboot
- * (unless the sysadmin foolishly changes it and screws themselves).
- * It will usually remain the same across reboots also, but hardware
- * configuration changes or rebuilding the machine could break that.
- *
- * The idea is that two processes with the same machine ID should be
- * able to use shared memory, UNIX domain sockets, process IDs, and other
- * features of the OS that require both processes to be running
- * on the same OS kernel instance.
- *
- * The machine ID can also be used to create unique per-machine
- * instances. For example, you could use it in bus names or
- * X selection names.
- *
- * The machine ID is preferred over the machine hostname, because
- * the hostname is frequently set to "localhost.localdomain" and
- * may also change at runtime.
- *
- * You can get the machine ID of a remote application by invoking the
- * method GetMachineId from interface org.freedesktop.DBus.Peer.
- *
- * If the remote application has the same machine ID as the one
- * returned by this function, then the remote application is on the
- * same machine as your application.
- *
- * The UUID is not a UUID in the sense of RFC4122; the details
- * are explained in the D-Bus specification.
- *
- * @returns a 32-byte-long hex-encoded UUID string, or #NULL if insufficient memory
- */
-char*
-dbus_get_local_machine_id (void)
-{
- DBusString uuid;
- char *s;
-
- s = NULL;
-
- if (!_dbus_string_init (&uuid))
- return NULL;
-
- if (!_dbus_get_local_machine_uuid_encoded (&uuid) ||
- !_dbus_string_steal_data (&uuid, &s))
- {
- _dbus_string_free (&uuid);
- return NULL;
- }
- else
- {
- _dbus_string_free (&uuid);
- return s;
- }
-
-}
-
-/**
- * @def DBUS_MAJOR_VERSION
- *
- * The COMPILE TIME major version of libdbus, that is, the "X" in "X.Y.Z",
- * as an integer literal. Consider carefully whether to use this or the
- * runtime version from dbus_get_version().
- */
-
-/**
- * @def DBUS_MINOR_VERSION
- *
- * The COMPILE TIME minor version of libdbus, that is, the "Y" in "X.Y.Z",
- * as an integer literal. Consider carefully whether to use this or the
- * runtime version from dbus_get_version().
- */
-
-/**
- * @def DBUS_MICRO_VERSION
- *
- * The COMPILE TIME micro version of libdbus, that is, the "Z" in "X.Y.Z",
- * as an integer literal. Consider carefully whether to use this or the
- * runtime version from dbus_get_version().
- */
-
-/**
- * @def DBUS_VERSION
- *
- * The COMPILE TIME version of libdbus, as a single integer that has 0 in the most
- * significant byte, the major version in the next most significant byte,
- * the minor version in the third most significant, and the micro version in the
- * least significant byte. This means two DBUS_VERSION can be compared to see
- * which is higher.
- *
- * Consider carefully whether to use this or the runtime version from
- * dbus_get_version().
- */
-
-/**
- * @def DBUS_VERSION_STRING
- *
- * The COMPILE TIME version of libdbus, as a string "X.Y.Z".
- *
- * Consider carefully whether to use this or the runtime version from
- * dbus_get_version().
- */
-
-/**
- * Gets the DYNAMICALLY LINKED version of libdbus. Alternatively, there
- * are macros #DBUS_MAJOR_VERSION, #DBUS_MINOR_VERSION, #DBUS_MICRO_VERSION,
- * and #DBUS_VERSION which allow you to test the VERSION YOU ARE COMPILED AGAINST.
- * In other words, you can get either the runtime or the compile-time version.
- * Think carefully about which of these you want in a given case.
- *
- * The libdbus full version number is "MAJOR.MINOR.MICRO" where the
- * MINOR changes if API is added, and the MICRO changes with each
- * release of a MAJOR.MINOR series. The MINOR is an odd number for
- * development releases and an even number for stable releases.
- *
- * @param major_version_p pointer to return the major version, or #NULL
- * @param minor_version_p pointer to return the minor version, or #NULL
- * @param micro_version_p pointer to return the micro version, or #NULL
- *
- */
-void
-dbus_get_version (int *major_version_p,
- int *minor_version_p,
- int *micro_version_p)
-{
- if (major_version_p)
- *major_version_p = DBUS_MAJOR_VERSION;
- if (minor_version_p)
- *minor_version_p = DBUS_MINOR_VERSION;
- if (micro_version_p)
- *micro_version_p = DBUS_MICRO_VERSION;
-}
-
-
-/** @} */ /* End of public API */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include "dbus-test.h"
-#include <stdlib.h>
-
-
-dbus_bool_t
-_dbus_misc_test (void)
-{
- int major, minor, micro;
- DBusString str;
-
- /* make sure we don't crash on NULL */
- dbus_get_version (NULL, NULL, NULL);
-
- /* Now verify that all the compile-time version stuff
- * is right and matches the runtime. These tests
- * are mostly intended to catch various kinds of
- * typo (mixing up major and minor, that sort of thing).
- */
- dbus_get_version (&major, &minor, &micro);
-
- _dbus_assert (major == DBUS_MAJOR_VERSION);
- _dbus_assert (minor == DBUS_MINOR_VERSION);
- _dbus_assert (micro == DBUS_MICRO_VERSION);
-
-#define MAKE_VERSION(x, y, z) (((x) << 16) | ((y) << 8) | (z))
-
- /* check that MAKE_VERSION works and produces the intended ordering */
- _dbus_assert (MAKE_VERSION (1, 0, 0) > MAKE_VERSION (0, 0, 0));
- _dbus_assert (MAKE_VERSION (1, 1, 0) > MAKE_VERSION (1, 0, 0));
- _dbus_assert (MAKE_VERSION (1, 1, 1) > MAKE_VERSION (1, 1, 0));
-
- _dbus_assert (MAKE_VERSION (2, 0, 0) > MAKE_VERSION (1, 1, 1));
- _dbus_assert (MAKE_VERSION (2, 1, 0) > MAKE_VERSION (1, 1, 1));
- _dbus_assert (MAKE_VERSION (2, 1, 1) > MAKE_VERSION (1, 1, 1));
-
- /* check DBUS_VERSION */
- _dbus_assert (MAKE_VERSION (major, minor, micro) == DBUS_VERSION);
-
- /* check that ordering works with DBUS_VERSION */
- _dbus_assert (MAKE_VERSION (major - 1, minor, micro) < DBUS_VERSION);
- _dbus_assert (MAKE_VERSION (major, minor - 1, micro) < DBUS_VERSION);
- _dbus_assert (MAKE_VERSION (major, minor, micro - 1) < DBUS_VERSION);
-
- _dbus_assert (MAKE_VERSION (major + 1, minor, micro) > DBUS_VERSION);
- _dbus_assert (MAKE_VERSION (major, minor + 1, micro) > DBUS_VERSION);
- _dbus_assert (MAKE_VERSION (major, minor, micro + 1) > DBUS_VERSION);
-
- /* Check DBUS_VERSION_STRING */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!(_dbus_string_append_int (&str, major) &&
- _dbus_string_append_byte (&str, '.') &&
- _dbus_string_append_int (&str, minor) &&
- _dbus_string_append_byte (&str, '.') &&
- _dbus_string_append_int (&str, micro)))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_assert (_dbus_string_equal_c_str (&str, DBUS_VERSION_STRING));
-
- _dbus_string_free (&str);
-
- return TRUE;
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.h
deleted file mode 100644
index 6e72d9ed25..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-misc.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-misc.h A few assorted public functions that don't fit elsewhere
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_MISC_H
-#define DBUS_MISC_H
-
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusMisc
- * @{
- */
-DBUS_EXPORT
-char* dbus_get_local_machine_id (void);
-
-DBUS_EXPORT
-void dbus_get_version (int *major_version_p,
- int *minor_version_p,
- int *micro_version_p);
-
-DBUS_EXPORT
-dbus_bool_t dbus_setenv (const char *variable,
- const char *value);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_MISC_H */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.c
deleted file mode 100644
index ef037ef942..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-nonce.c Nonce handling functions used by nonce-tcp (internal to D-Bus implementation)
- *
- * Copyright (C) 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <config.h>
-// major sections of this file are modified code from libassuan, (C) FSF
-#include "dbus-nonce.h"
-#include "dbus-internals.h"
-#include "dbus-protocol.h"
-#include "dbus-sysdeps.h"
-
-#include <stdio.h>
-
-static dbus_bool_t
-do_check_nonce (int fd, const DBusString *nonce, DBusError *error)
-{
- DBusString buffer;
- DBusString p;
- size_t nleft;
- dbus_bool_t result;
- int n;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- nleft = 16;
-
- if ( !_dbus_string_init (&buffer)
- || !_dbus_string_init (&p) ) {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&p);
- _dbus_string_free (&buffer);
- return FALSE;
- }
-
- while (nleft)
- {
- n = _dbus_read_socket (fd, &p, nleft);
- if (n == -1 && _dbus_get_is_errno_eintr())
- ;
- else if (n == -1 && _dbus_get_is_errno_eagain_or_ewouldblock())
- _dbus_sleep_milliseconds (100);
- else if (n==-1)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR, "Could not read nonce from socket (fd=%d)", fd );
- _dbus_string_free (&p);
- _dbus_string_free (&buffer);
- return FALSE;
- }
- else if (!n)
- {
- _dbus_string_free (&p);
- _dbus_string_free (&buffer);
- dbus_set_error (error, DBUS_ERROR_IO_ERROR, "Could not read nonce from socket (fd=%d)", fd );
- return FALSE;
- }
- else
- {
- _dbus_string_append_len(&buffer, _dbus_string_get_const_data (&p), n);
- nleft -= n;
- }
- }
-
- result = _dbus_string_equal_len (&buffer, nonce, 16);
- if (!result)
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "Nonces do not match, access denied (fd=%d)", fd );
-
- _dbus_string_free (&p);
- _dbus_string_free (&buffer);
-
- return result;
-}
-
-/**
- * reads the nonce from the nonce file and stores it in a string
- *
- * @param fname the file to read the nonce from
- * @param nonce returns the nonce. Must be an initialized string, the nonce will be appended.
- * @param error error object to report possible errors
- * @return FALSE iff reading the nonce fails (error is set then)
- */
-dbus_bool_t
-_dbus_read_nonce (const DBusString *fname, DBusString *nonce, DBusError* error)
-{
- FILE *fp;
- char buffer[17];
- size_t nread;
-
- buffer[sizeof buffer - 1] = '\0';
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_verbose ("reading nonce from file: %s\n", _dbus_string_get_const_data (fname));
-
-
- fp = fopen (_dbus_string_get_const_data (fname), "rb");
- if (!fp)
- return FALSE;
- nread = fread (buffer, 1, sizeof buffer - 1, fp);
- fclose (fp);
- if (!nread)
- {
- dbus_set_error (error, DBUS_ERROR_FILE_NOT_FOUND, "Could not read nonce from file %s", _dbus_string_get_const_data (fname));
- return FALSE;
- }
-
- if (!_dbus_string_append_len (nonce, buffer, sizeof buffer - 1 ))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
- return TRUE;
-}
-
-int
-_dbus_accept_with_noncefile (int listen_fd, const DBusNonceFile *noncefile)
-{
- int fd;
- DBusString nonce;
-
- _dbus_assert (noncefile != NULL);
- if (!_dbus_string_init (&nonce))
- return -1;
- //PENDING(kdab): set better errors
- if (_dbus_read_nonce (_dbus_noncefile_get_path(noncefile), &nonce, NULL) != TRUE)
- return -1;
- fd = _dbus_accept (listen_fd);
- if (_dbus_socket_is_invalid (fd))
- return fd;
- if (do_check_nonce(fd, &nonce, NULL) != TRUE) {
- _dbus_verbose ("nonce check failed. Closing socket.\n");
- _dbus_close_socket(fd, NULL);
- return -1;
- }
-
- return fd;
-}
-
-static dbus_bool_t
-generate_and_write_nonce (const DBusString *filename, DBusError *error)
-{
- DBusString nonce;
- dbus_bool_t ret;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&nonce))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- if (!_dbus_generate_random_bytes (&nonce, 16))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&nonce);
- return FALSE;
- }
-
- ret = _dbus_string_save_to_file (&nonce, filename, FALSE, error);
-
- _dbus_string_free (&nonce);
-
- return ret;
-}
-
-/**
- * sends the nonce over a given socket. Blocks while doing so.
- *
- * @param fd the file descriptor to write the nonce data to (usually a socket)
- * @param noncefile the noncefile location to read the nonce from
- * @param error contains error details if FALSE is returned
- * @return TRUE iff the nonce was successfully sent. Note that this does not
- * indicate whether the server accepted the nonce.
- */
-dbus_bool_t
-_dbus_send_nonce (int fd, const DBusString *noncefile, DBusError *error)
-{
- dbus_bool_t read_result;
- int send_result;
- DBusString nonce;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (_dbus_string_get_length (noncefile) == 0)
- return FALSE;
-
- if (!_dbus_string_init (&nonce))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- read_result = _dbus_read_nonce (noncefile, &nonce, error);
- if (!read_result)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_free (&nonce);
- return FALSE;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- send_result = _dbus_write_socket (fd, &nonce, 0, _dbus_string_get_length (&nonce));
-
- _dbus_string_free (&nonce);
-
- if (send_result == -1)
- {
- dbus_set_error (error,
- _dbus_error_from_system_errno (),
- "Failed to send nonce (fd=%d): %s",
- fd, _dbus_strerror_from_errno ());
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-do_noncefile_create (DBusNonceFile *noncefile,
- DBusError *error,
- dbus_bool_t use_subdir)
-{
- DBusString randomStr;
- const char *tmp;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_assert (noncefile);
-
- if (!_dbus_string_init (&randomStr))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
-
- if (!_dbus_generate_random_ascii (&randomStr, 8))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
-
- tmp = _dbus_get_tmpdir ();
-
- if (!_dbus_string_init (&noncefile->dir)
- || tmp == NULL
- || !_dbus_string_append (&noncefile->dir, tmp))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
- if (use_subdir)
- {
- if (!_dbus_string_append (&noncefile->dir, "/dbus_nonce-")
- || !_dbus_string_append (&noncefile->dir, _dbus_string_get_const_data (&randomStr)) )
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
- if (!_dbus_string_init (&noncefile->path)
- || !_dbus_string_copy (&noncefile->dir, 0, &noncefile->path, 0)
- || !_dbus_string_append (&noncefile->path, "/nonce"))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
- if (!_dbus_create_directory (&noncefile->dir, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto on_error;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- }
- else
- {
- if (!_dbus_string_init (&noncefile->path)
- || !_dbus_string_copy (&noncefile->dir, 0, &noncefile->path, 0)
- || !_dbus_string_append (&noncefile->path, "/dbus_nonce-")
- || !_dbus_string_append (&noncefile->path, _dbus_string_get_const_data (&randomStr)))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto on_error;
- }
-
- }
-
- if (!generate_and_write_nonce (&noncefile->path, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- if (use_subdir)
- _dbus_delete_directory (&noncefile->dir, NULL); //we ignore possible errors deleting the dir and return the write error instead
- goto on_error;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_string_free (&randomStr);
-
- return TRUE;
- on_error:
- if (use_subdir)
- _dbus_delete_directory (&noncefile->dir, NULL);
- _dbus_string_free (&noncefile->dir);
- _dbus_string_free (&noncefile->path);
- _dbus_string_free (&randomStr);
- return FALSE;
-}
-
-#ifdef DBUS_WIN
-/**
- * creates a nonce file in a user-readable location and writes a generated nonce to it
- *
- * @param noncefile returns the nonce file location
- * @param error error details if creating the nonce file fails
- * @return TRUE iff the nonce file was successfully created
- */
-dbus_bool_t
-_dbus_noncefile_create (DBusNonceFile *noncefile,
- DBusError *error)
-{
- return do_noncefile_create (noncefile, error, /*use_subdir=*/FALSE);
-}
-
-/**
- * deletes the noncefile and frees the DBusNonceFile object.
- *
- * @param noncefile the nonce file to delete. Contents will be freed.
- * @param error error details if the nonce file could not be deleted
- * @return TRUE
- */
-dbus_bool_t
-_dbus_noncefile_delete (DBusNonceFile *noncefile,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_delete_file (&noncefile->path, error);
- _dbus_string_free (&noncefile->dir);
- _dbus_string_free (&noncefile->path);
- return TRUE;
-}
-
-#else
-/**
- * creates a nonce file in a user-readable location and writes a generated nonce to it.
- * Initializes the noncefile object.
- *
- * @param noncefile returns the nonce file location
- * @param error error details if creating the nonce file fails
- * @return TRUE iff the nonce file was successfully created
- */
-dbus_bool_t
-_dbus_noncefile_create (DBusNonceFile *noncefile,
- DBusError *error)
-{
- return do_noncefile_create (noncefile, error, /*use_subdir=*/TRUE);
-}
-
-/**
- * deletes the noncefile and frees the DBusNonceFile object.
- *
- * @param noncefile the nonce file to delete. Contents will be freed.
- * @param error error details if the nonce file could not be deleted
- * @return TRUE
- */
-dbus_bool_t
-_dbus_noncefile_delete (DBusNonceFile *noncefile,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_delete_directory (&noncefile->dir, error);
- _dbus_string_free (&noncefile->dir);
- _dbus_string_free (&noncefile->path);
- return TRUE;
-}
-#endif
-
-
-/**
- * returns the absolute file path of the nonce file
- *
- * @param noncefile an initialized noncefile object
- * @return the absolute path of the nonce file
- */
-const DBusString*
-_dbus_noncefile_get_path (const DBusNonceFile *noncefile)
-{
- _dbus_assert (noncefile);
- return &noncefile->path;
-}
-
-/**
- * reads data from a file descriptor and checks if the received data matches
- * the data in the given noncefile.
- *
- * @param fd the file descriptor to read the nonce from
- * @param noncefile the nonce file to check the received data against
- * @param error error details on fail
- * @return TRUE iff a nonce could be successfully read from the file descriptor
- * and matches the nonce from the given nonce file
- */
-dbus_bool_t
-_dbus_noncefile_check_nonce (int fd,
- const DBusNonceFile *noncefile,
- DBusError* error)
-{
- return do_check_nonce (fd, _dbus_noncefile_get_path (noncefile), error);
-}
-
-
-/** @} end of nonce */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.h
deleted file mode 100644
index 474ea728e1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-nonce.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-nonce.h Nonce handling functions used by nonce-tcp (internal to D-Bus implementation)
- *
- * Copyright (C) 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-#ifndef DBUS_NONCE_H
-#define DBUS_NONCE_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusNonceFile DBusNonceFile;
-
-struct DBusNonceFile
-{
- DBusString path;
- DBusString dir;
-};
-
-// server
-
-dbus_bool_t _dbus_noncefile_create (DBusNonceFile *noncefile,
- DBusError *error);
-
-dbus_bool_t _dbus_noncefile_delete (DBusNonceFile *noncefile,
- DBusError *error);
-
-dbus_bool_t _dbus_noncefile_check_nonce (int fd,
- const DBusNonceFile *noncefile,
- DBusError *error);
-
-const DBusString* _dbus_noncefile_get_path (const DBusNonceFile *noncefile);
-
-int _dbus_accept_with_noncefile (int listen_fd,
- const DBusNonceFile *noncefile);
-
-// shared
-
-dbus_bool_t _dbus_read_nonce (const DBusString *fname,
- DBusString *nonce,
- DBusError *error);
-
-// client
-
-dbus_bool_t _dbus_send_nonce (int fd,
- const DBusString *noncefile,
- DBusError *error);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_NONCE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.c
deleted file mode 100644
index d256018e83..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.c
+++ /dev/null
@@ -1,2333 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-object-tree.c DBusObjectTree (internals of DBusConnection)
- *
- * Copyright (C) 2003, 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-object-tree.h"
-#include "dbus-connection-internal.h"
-#include "dbus-internals.h"
-#include "dbus-hash.h"
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include <string.h>
-#include <stdlib.h>
-
-/**
- * @defgroup DBusObjectTree A hierarchy of objects with container-contained relationship
- * @ingroup DBusInternals
- * @brief DBusObjectTree is used by DBusConnection to track the object tree
- *
- * Types and functions related to DBusObjectTree. These
- * are all library-internal.
- *
- * @{
- */
-
-/** Subnode of the object hierarchy */
-typedef struct DBusObjectSubtree DBusObjectSubtree;
-
-static DBusObjectSubtree* _dbus_object_subtree_new (const char *name,
- const DBusObjectPathVTable *vtable,
- void *user_data);
-static DBusObjectSubtree* _dbus_object_subtree_ref (DBusObjectSubtree *subtree);
-static void _dbus_object_subtree_unref (DBusObjectSubtree *subtree);
-
-/**
- * Internals of DBusObjectTree
- */
-struct DBusObjectTree
-{
- int refcount; /**< Reference count */
- DBusConnection *connection; /**< Connection this tree belongs to */
-
- DBusObjectSubtree *root; /**< Root of the tree ("/" node) */
-};
-
-/**
- * Struct representing a single registered subtree handler, or node
- * that's a parent of a registered subtree handler. If
- * message_function != NULL there's actually a handler at this node.
- */
-struct DBusObjectSubtree
-{
- DBusAtomic refcount; /**< Reference count */
- DBusObjectSubtree *parent; /**< Parent node */
- DBusObjectPathUnregisterFunction unregister_function; /**< Function to call on unregister */
- DBusObjectPathMessageFunction message_function; /**< Function to handle messages */
- void *user_data; /**< Data for functions */
- DBusObjectSubtree **subtrees; /**< Child nodes */
- int n_subtrees; /**< Number of child nodes */
- int max_subtrees; /**< Number of allocated entries in subtrees */
- unsigned int invoke_as_fallback : 1; /**< Whether to invoke message_function when child nodes don't handle the message */
- char name[1]; /**< Allocated as large as necessary */
-};
-
-/**
- * Creates a new object tree, representing a mapping from paths
- * to handler vtables.
- *
- * @param connection the connection this tree belongs to
- * @returns the new tree or #NULL if no memory
- */
-DBusObjectTree*
-_dbus_object_tree_new (DBusConnection *connection)
-{
- DBusObjectTree *tree;
-
- /* the connection passed in here isn't fully constructed,
- * so don't do anything more than store a pointer to
- * it
- */
-
- tree = dbus_new0 (DBusObjectTree, 1);
- if (tree == NULL)
- goto oom;
-
- tree->refcount = 1;
- tree->connection = connection;
- tree->root = _dbus_object_subtree_new ("/", NULL, NULL);
- if (tree->root == NULL)
- goto oom;
- tree->root->invoke_as_fallback = TRUE;
-
- return tree;
-
- oom:
- if (tree)
- {
- dbus_free (tree);
- }
-
- return NULL;
-}
-
-/**
- * Increment the reference count
- * @param tree the object tree
- * @returns the object tree
- */
-DBusObjectTree *
-_dbus_object_tree_ref (DBusObjectTree *tree)
-{
- _dbus_assert (tree->refcount > 0);
-
- tree->refcount += 1;
-
- return tree;
-}
-
-/**
- * Decrement the reference count
- * @param tree the object tree
- */
-void
-_dbus_object_tree_unref (DBusObjectTree *tree)
-{
- _dbus_assert (tree->refcount > 0);
-
- tree->refcount -= 1;
-
- if (tree->refcount == 0)
- {
- _dbus_object_tree_free_all_unlocked (tree);
-
- dbus_free (tree);
- }
-}
-
-/** Set to 1 to get a bunch of debug spew about finding the
- * subtree nodes
- */
-#define VERBOSE_FIND 0
-
-static DBusObjectSubtree*
-find_subtree_recurse (DBusObjectSubtree *subtree,
- const char **path,
- dbus_bool_t create_if_not_found,
- int *index_in_parent,
- dbus_bool_t *exact_match)
-{
- int i, j;
- dbus_bool_t return_deepest_match;
-
- return_deepest_match = exact_match != NULL;
-
- _dbus_assert (!(return_deepest_match && create_if_not_found));
-
- if (path[0] == NULL)
- {
-#if VERBOSE_FIND
- _dbus_verbose (" path exhausted, returning %s\n",
- subtree->name);
-#endif
- if (exact_match != NULL)
- *exact_match = TRUE;
- return subtree;
- }
-
-#if VERBOSE_FIND
- _dbus_verbose (" searching children of %s for %s\n",
- subtree->name, path[0]);
-#endif
-
- i = 0;
- j = subtree->n_subtrees;
- while (i < j)
- {
- int k, v;
-
- k = (i + j) / 2;
- v = strcmp (path[0], subtree->subtrees[k]->name);
-
-#if VERBOSE_FIND
- _dbus_verbose (" %s cmp %s = %d\n",
- path[0], subtree->subtrees[k]->name,
- v);
-#endif
-
- if (v == 0)
- {
- if (index_in_parent)
- {
-#if VERBOSE_FIND
- _dbus_verbose (" storing parent index %d\n", k);
-#endif
- *index_in_parent = k;
- }
-
- if (return_deepest_match)
- {
- DBusObjectSubtree *next;
-
- next = find_subtree_recurse (subtree->subtrees[k],
- &path[1], create_if_not_found,
- index_in_parent, exact_match);
- if (next == NULL &&
- subtree->invoke_as_fallback)
- {
-#if VERBOSE_FIND
- _dbus_verbose (" no deeper match found, returning %s\n",
- subtree->name);
-#endif
- if (exact_match != NULL)
- *exact_match = FALSE;
- return subtree;
- }
- else
- return next;
- }
- else
- return find_subtree_recurse (subtree->subtrees[k],
- &path[1], create_if_not_found,
- index_in_parent, exact_match);
- }
- else if (v < 0)
- {
- j = k;
- }
- else
- {
- i = k + 1;
- }
- }
-
-#if VERBOSE_FIND
- _dbus_verbose (" no match found, current tree %s, create_if_not_found = %d\n",
- subtree->name, create_if_not_found);
-#endif
-
- if (create_if_not_found)
- {
- DBusObjectSubtree* child;
- int child_pos, new_n_subtrees;
-
-#if VERBOSE_FIND
- _dbus_verbose (" creating subtree %s\n",
- path[0]);
-#endif
-
- child = _dbus_object_subtree_new (path[0],
- NULL, NULL);
- if (child == NULL)
- return NULL;
-
- new_n_subtrees = subtree->n_subtrees + 1;
- if (new_n_subtrees > subtree->max_subtrees)
- {
- int new_max_subtrees;
- DBusObjectSubtree **new_subtrees;
-
- new_max_subtrees = subtree->max_subtrees == 0 ? 1 : 2 * subtree->max_subtrees;
- new_subtrees = dbus_realloc (subtree->subtrees,
- new_max_subtrees * sizeof (DBusObjectSubtree*));
- if (new_subtrees == NULL)
- {
- _dbus_object_subtree_unref (child);
- return NULL;
- }
- subtree->subtrees = new_subtrees;
- subtree->max_subtrees = new_max_subtrees;
- }
-
- /* The binary search failed, so i == j points to the
- place the child should be inserted. */
- child_pos = i;
- _dbus_assert (child_pos < new_n_subtrees &&
- new_n_subtrees <= subtree->max_subtrees);
- if (child_pos + 1 < new_n_subtrees)
- {
- memmove (&subtree->subtrees[child_pos+1],
- &subtree->subtrees[child_pos],
- (new_n_subtrees - child_pos - 1) *
- sizeof subtree->subtrees[0]);
- }
- subtree->subtrees[child_pos] = child;
-
- if (index_in_parent)
- *index_in_parent = child_pos;
- subtree->n_subtrees = new_n_subtrees;
- child->parent = subtree;
-
- return find_subtree_recurse (child,
- &path[1], create_if_not_found,
- index_in_parent, exact_match);
- }
- else
- {
- if (exact_match != NULL)
- *exact_match = FALSE;
- return (return_deepest_match && subtree->invoke_as_fallback) ? subtree : NULL;
- }
-}
-
-static DBusObjectSubtree*
-find_subtree (DBusObjectTree *tree,
- const char **path,
- int *index_in_parent)
-{
- DBusObjectSubtree *subtree;
-
-#if VERBOSE_FIND
- _dbus_verbose ("Looking for exact registered subtree\n");
-#endif
-
- subtree = find_subtree_recurse (tree->root, path, FALSE, index_in_parent, NULL);
-
- if (subtree && subtree->message_function == NULL)
- return NULL;
- else
- return subtree;
-}
-
-static DBusObjectSubtree*
-lookup_subtree (DBusObjectTree *tree,
- const char **path)
-{
-#if VERBOSE_FIND
- _dbus_verbose ("Looking for subtree\n");
-#endif
- return find_subtree_recurse (tree->root, path, FALSE, NULL, NULL);
-}
-
-static DBusObjectSubtree*
-find_handler (DBusObjectTree *tree,
- const char **path,
- dbus_bool_t *exact_match)
-{
-#if VERBOSE_FIND
- _dbus_verbose ("Looking for deepest handler\n");
-#endif
- _dbus_assert (exact_match != NULL);
-
- *exact_match = FALSE; /* ensure always initialized */
-
- return find_subtree_recurse (tree->root, path, FALSE, NULL, exact_match);
-}
-
-static DBusObjectSubtree*
-ensure_subtree (DBusObjectTree *tree,
- const char **path)
-{
-#if VERBOSE_FIND
- _dbus_verbose ("Ensuring subtree\n");
-#endif
- return find_subtree_recurse (tree->root, path, TRUE, NULL, NULL);
-}
-
-static char *flatten_path (const char **path);
-
-/**
- * Registers a new subtree in the global object tree.
- *
- * @param tree the global object tree
- * @param fallback #TRUE to handle messages to children of this path
- * @param path NULL-terminated array of path elements giving path to subtree
- * @param vtable the vtable used to traverse this subtree
- * @param user_data user data to pass to methods in the vtable
- * @param error address where an error can be returned
- * @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_OBJECT_PATH_IN_USE) is reported
- */
-dbus_bool_t
-_dbus_object_tree_register (DBusObjectTree *tree,
- dbus_bool_t fallback,
- const char **path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error)
-{
- DBusObjectSubtree *subtree;
-
- _dbus_assert (tree != NULL);
- _dbus_assert (vtable->message_function != NULL);
- _dbus_assert (path != NULL);
-
- subtree = ensure_subtree (tree, path);
- if (subtree == NULL)
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (subtree->message_function != NULL)
- {
- if (error != NULL)
- {
- char *complete_path = flatten_path (path);
-
- dbus_set_error (error, DBUS_ERROR_OBJECT_PATH_IN_USE,
- "A handler is already registered for %s",
- complete_path ? complete_path
- : "(cannot represent path: out of memory!)");
-
- dbus_free (complete_path);
- }
-
- return FALSE;
- }
-
- subtree->message_function = vtable->message_function;
- subtree->unregister_function = vtable->unregister_function;
- subtree->user_data = user_data;
- subtree->invoke_as_fallback = fallback != FALSE;
-
- return TRUE;
-}
-
-/**
- * Attempts to unregister the given subtree. If the subtree is registered,
- * stores its unregister function and user data for later use and returns
- * #TRUE. If subtree is not registered, simply returns #FALSE. Does not free
- * subtree or remove it from the object tree.
- *
- * @param subtree the subtree to unregister
- * @param unregister_function_out stores subtree's unregister_function
- * @param user_data_out stores subtree's user_data
- * @return #FALSE if the subtree was not registered, #TRUE on success
- */
-static dbus_bool_t
-unregister_subtree (DBusObjectSubtree *subtree,
- DBusObjectPathUnregisterFunction *unregister_function_out,
- void **user_data_out)
-{
- _dbus_assert (subtree != NULL);
- _dbus_assert (unregister_function_out != NULL);
- _dbus_assert (user_data_out != NULL);
-
- /* Confirm subtree is registered */
- if (subtree->message_function != NULL)
- {
- subtree->message_function = NULL;
-
- *unregister_function_out = subtree->unregister_function;
- *user_data_out = subtree->user_data;
-
- subtree->unregister_function = NULL;
- subtree->user_data = NULL;
-
- return TRUE;
- }
- else
- {
- /* Assert that this unregistered subtree is either the root node or has
- children, otherwise we have a dangling path which should never
- happen */
- _dbus_assert (subtree->parent == NULL || subtree->n_subtrees > 0);
-
- /* The subtree is not registered */
- return FALSE;
- }
-}
-
-/**
- * Attempts to remove a child subtree from its parent. If removal is
- * successful, also frees the child. Returns #TRUE on success, #FALSE
- * otherwise. A #FALSE return value tells unregister_and_free_path_recurse to
- * stop attempting to remove ancestors, i.e., that no ancestors of the
- * specified child are eligible for removal.
- *
- * @param parent parent from which to remove child
- * @param child_index parent->subtrees index of child to remove
- * @return #TRUE if removal and free succeed, #FALSE otherwise
- */
-static dbus_bool_t
-attempt_child_removal (DBusObjectSubtree *parent,
- int child_index)
-{
- /* Candidate for removal */
- DBusObjectSubtree* candidate;
-
- _dbus_assert (parent != NULL);
- _dbus_assert (child_index >= 0 && child_index < parent->n_subtrees);
-
- candidate = parent->subtrees[child_index];
- _dbus_assert (candidate != NULL);
-
- if (candidate->n_subtrees == 0 && candidate->message_function == NULL)
- {
- /* The candidate node is childless and is not a registered
- path, so... */
-
- /* ... remove it from its parent... */
- /* Assumes a 0-byte memmove is OK */
- memmove (&parent->subtrees[child_index],
- &parent->subtrees[child_index + 1],
- (parent->n_subtrees - child_index - 1)
- * sizeof (parent->subtrees[0]));
- parent->n_subtrees -= 1;
-
- /* ... and free it */
- candidate->parent = NULL;
- _dbus_object_subtree_unref (candidate);
-
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * Searches the object tree for a registered subtree node at the given path.
- * If a registered node is found, it is removed from the tree and freed, and
- * TRUE is returned. If a registered subtree node is not found at the given
- * path, the tree is not modified and FALSE is returned.
- *
- * The found node's unregister_function and user_data are returned in the
- * corresponding _out arguments. The caller should define these variables and
- * pass their addresses as arguments.
- *
- * Likewise, the caller should define and set to TRUE a boolean variable, then
- * pass its address as the continue_removal_attempts argument.
- *
- * Once a matching registered node is found, removed and freed, the recursive
- * return path is traversed. Along the way, eligible ancestor nodes are
- * removed and freed. An ancestor node is eligible for removal if and only if
- * 1) it has no children, i.e., it has become childless and 2) it is not itself
- * a registered handler.
- *
- * For example, suppose /A/B and /A/C are registered paths, and that these are
- * the only paths in the tree. If B is removed and freed, C is still reachable
- * through A, so A cannot be removed and freed. If C is subsequently removed
- * and freed, then A becomes a childless node and it becomes eligible for
- * removal, and will be removed and freed.
- *
- * Similarly, suppose /A is a registered path, and /A/B is also a registered
- * path, and that these are the only paths in the tree. If B is removed and
- * freed, then even though A has become childless, it can't be freed because it
- * refers to a path that is still registered.
- *
- * @param subtree subtree from which to start the search, root for initial call
- * @param path path to subtree (same as _dbus_object_tree_unregister_and_unlock)
- * @param continue_removal_attempts pointer to a bool, #TRUE for initial call
- * @param unregister_function_out returns the found node's unregister_function
- * @param user_data_out returns the found node's user_data
- * @returns #TRUE if a registered node was found at path, #FALSE otherwise
- */
-static dbus_bool_t
-unregister_and_free_path_recurse
-(DBusObjectSubtree *subtree,
- const char **path,
- dbus_bool_t *continue_removal_attempts,
- DBusObjectPathUnregisterFunction *unregister_function_out,
- void **user_data_out)
-{
- int i, j;
-
- _dbus_assert (continue_removal_attempts != NULL);
- _dbus_assert (*continue_removal_attempts);
- _dbus_assert (unregister_function_out != NULL);
- _dbus_assert (user_data_out != NULL);
-
- if (path[0] == NULL)
- return unregister_subtree (subtree, unregister_function_out, user_data_out);
-
- i = 0;
- j = subtree->n_subtrees;
- while (i < j)
- {
- int k, v;
-
- k = (i + j) / 2;
- v = strcmp (path[0], subtree->subtrees[k]->name);
-
- if (v == 0)
- {
- dbus_bool_t freed;
- freed = unregister_and_free_path_recurse (subtree->subtrees[k],
- &path[1],
- continue_removal_attempts,
- unregister_function_out,
- user_data_out);
- if (freed && *continue_removal_attempts)
- *continue_removal_attempts = attempt_child_removal (subtree, k);
- return freed;
- }
- else if (v < 0)
- {
- j = k;
- }
- else
- {
- i = k + 1;
- }
- }
- return FALSE;
-}
-
-/**
- * Unregisters an object subtree that was registered with the
- * same path.
- *
- * @param tree the global object tree
- * @param path path to the subtree (same as the one passed to _dbus_object_tree_register())
- */
-void
-_dbus_object_tree_unregister_and_unlock (DBusObjectTree *tree,
- const char **path)
-{
- dbus_bool_t found_subtree;
- dbus_bool_t continue_removal_attempts;
- DBusObjectPathUnregisterFunction unregister_function;
- void *user_data;
- DBusConnection *connection;
-
- _dbus_assert (tree != NULL);
- _dbus_assert (path != NULL);
-
- continue_removal_attempts = TRUE;
- unregister_function = NULL;
- user_data = NULL;
-
- found_subtree = unregister_and_free_path_recurse (tree->root,
- path,
- &continue_removal_attempts,
- &unregister_function,
- &user_data);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (found_subtree == FALSE)
- {
- _dbus_warn ("Attempted to unregister path (path[0] = %s path[1] = %s) which isn't registered\n",
- path[0] ? path[0] : "null",
- (path[0] && path[1]) ? path[1] : "null");
- goto unlock;
- }
-#else
- _dbus_assert (found_subtree == TRUE);
-#endif
-
-unlock:
- connection = tree->connection;
-
- /* Unlock and call application code */
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (connection)
-#endif
- {
- _dbus_connection_ref_unlocked (connection);
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (connection);
- }
-
- if (unregister_function)
- (* unregister_function) (connection, user_data);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (connection)
-#endif
- dbus_connection_unref (connection);
-}
-
-static void
-free_subtree_recurse (DBusConnection *connection,
- DBusObjectSubtree *subtree)
-{
- /* Delete them from the end, for slightly
- * more robustness against odd reentrancy.
- */
- while (subtree->n_subtrees > 0)
- {
- DBusObjectSubtree *child;
-
- child = subtree->subtrees[subtree->n_subtrees - 1];
- subtree->subtrees[subtree->n_subtrees - 1] = NULL;
- subtree->n_subtrees -= 1;
- child->parent = NULL;
-
- free_subtree_recurse (connection, child);
- }
-
- /* Call application code */
- if (subtree->unregister_function)
- (* subtree->unregister_function) (connection,
- subtree->user_data);
-
- subtree->message_function = NULL;
- subtree->unregister_function = NULL;
- subtree->user_data = NULL;
-
- /* Now free ourselves */
- _dbus_object_subtree_unref (subtree);
-}
-
-/**
- * Free all the handlers in the tree. Lock on tree's connection
- * must not be held.
- *
- * @param tree the object tree
- */
-void
-_dbus_object_tree_free_all_unlocked (DBusObjectTree *tree)
-{
- if (tree->root)
- free_subtree_recurse (tree->connection,
- tree->root);
- tree->root = NULL;
-}
-
-static dbus_bool_t
-_dbus_object_tree_list_registered_unlocked (DBusObjectTree *tree,
- const char **parent_path,
- char ***child_entries)
-{
- DBusObjectSubtree *subtree;
- char **retval;
-
- _dbus_assert (parent_path != NULL);
- _dbus_assert (child_entries != NULL);
-
- *child_entries = NULL;
-
- subtree = lookup_subtree (tree, parent_path);
- if (subtree == NULL)
- {
- retval = dbus_new0 (char *, 1);
- }
- else
- {
- int i;
- retval = dbus_new0 (char*, subtree->n_subtrees + 1);
- if (retval == NULL)
- goto out;
- i = 0;
- while (i < subtree->n_subtrees)
- {
- retval[i] = _dbus_strdup (subtree->subtrees[i]->name);
- if (retval[i] == NULL)
- {
- dbus_free_string_array (retval);
- retval = NULL;
- goto out;
- }
- ++i;
- }
- }
-
- out:
-
- *child_entries = retval;
- return retval != NULL;
-}
-
-static DBusHandlerResult
-handle_default_introspect_and_unlock (DBusObjectTree *tree,
- DBusMessage *message,
- const char **path)
-{
- DBusString xml;
- DBusHandlerResult result;
- char **children;
- int i;
- DBusMessage *reply;
- DBusMessageIter iter;
- const char *v_STRING;
- dbus_bool_t already_unlocked;
-
- /* We have the connection lock here */
-
- already_unlocked = FALSE;
-
- _dbus_verbose (" considering default Introspect() handler...\n");
-
- reply = NULL;
-
- if (!dbus_message_is_method_call (message,
- DBUS_INTERFACE_INTROSPECTABLE,
- "Introspect"))
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- _dbus_verbose (" using default Introspect() handler!\n");
-
- if (!_dbus_string_init (&xml))
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- return DBUS_HANDLER_RESULT_NEED_MEMORY;
- }
-
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
-
- children = NULL;
- if (!_dbus_object_tree_list_registered_unlocked (tree, path, &children))
- goto out;
-
- if (!_dbus_string_append (&xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE))
- goto out;
-
- if (!_dbus_string_append (&xml, "<node>\n"))
- goto out;
-
- i = 0;
- while (children[i] != NULL)
- {
- if (!_dbus_string_append_printf (&xml, " <node name=\"%s\"/>\n",
- children[i]))
- goto out;
-
- ++i;
- }
-
- if (!_dbus_string_append (&xml, "</node>\n"))
- goto out;
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- goto out;
-
- dbus_message_iter_init_append (reply, &iter);
- v_STRING = _dbus_string_get_const_data (&xml);
- if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &v_STRING))
- goto out;
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- already_unlocked = TRUE;
-
- if (!_dbus_connection_send_and_unlock (tree->connection, reply, NULL))
- goto out;
- }
-
- result = DBUS_HANDLER_RESULT_HANDLED;
-
- out:
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- if (!already_unlocked)
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
- }
-
- _dbus_string_free (&xml);
- dbus_free_string_array (children);
- if (reply)
- dbus_message_unref (reply);
-
- return result;
-}
-
-/**
- * Tries to dispatch a message by directing it to handler for the
- * object path listed in the message header, if any. Messages are
- * dispatched first to the registered handler that matches the largest
- * number of path elements; that is, message to /foo/bar/baz would go
- * to the handler for /foo/bar before the one for /foo.
- *
- * @todo thread problems
- *
- * @param tree the global object tree
- * @param message the message to dispatch
- * @param found_object return location for the object
- * @returns whether message was handled successfully
- */
-DBusHandlerResult
-_dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
- DBusMessage *message,
- dbus_bool_t *found_object)
-{
- char **path;
- dbus_bool_t exact_match;
- DBusList *list;
- DBusList *link;
- DBusHandlerResult result;
- DBusObjectSubtree *subtree;
-
-#if 0
- _dbus_verbose ("Dispatch of message by object path\n");
-#endif
-
- path = NULL;
- if (!dbus_message_get_path_decomposed (message, &path))
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- _dbus_verbose ("No memory to get decomposed path\n");
-
- return DBUS_HANDLER_RESULT_NEED_MEMORY;
- }
-
- if (path == NULL)
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- _dbus_verbose ("No path field in message\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- /* Find the deepest path that covers the path in the message */
- subtree = find_handler (tree, (const char**) path, &exact_match);
-
- if (found_object)
- *found_object = !!subtree;
-
- /* Build a list of all paths that cover the path in the message */
-
- list = NULL;
-
- while (subtree != NULL)
- {
- if (subtree->message_function != NULL && (exact_match || subtree->invoke_as_fallback))
- {
- _dbus_object_subtree_ref (subtree);
-
- /* run deepest paths first */
- if (!_dbus_list_append (&list, subtree))
- {
- result = DBUS_HANDLER_RESULT_NEED_MEMORY;
- _dbus_object_subtree_unref (subtree);
- goto free_and_return;
- }
- }
-
- exact_match = FALSE;
- subtree = subtree->parent;
- }
-
- _dbus_verbose ("%d handlers in the path tree for this message\n",
- _dbus_list_get_length (&list));
-
- /* Invoke each handler in the list */
-
- result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- link = _dbus_list_get_first_link (&list);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&list, link);
- subtree = link->data;
-
- /* message_function is NULL if we're unregistered
- * due to reentrancy
- */
- if (subtree->message_function)
- {
- DBusObjectPathMessageFunction message_function;
- void *user_data;
-
- message_function = subtree->message_function;
- user_data = subtree->user_data;
-
-#if 0
- _dbus_verbose (" (invoking a handler)\n");
-#endif
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- /* FIXME you could unregister the subtree in another thread
- * before we invoke the callback, and I can't figure out a
- * good way to solve this.
- */
-
- result = (* message_function) (tree->connection,
- message,
- user_data);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- _dbus_connection_lock (tree->connection);
-
- if (result != DBUS_HANDLER_RESULT_NOT_YET_HANDLED)
- goto free_and_return;
- }
-
- link = next;
- }
-
- free_and_return:
-
- if (result == DBUS_HANDLER_RESULT_NOT_YET_HANDLED)
- {
- /* This hardcoded default handler does a minimal Introspect()
- */
- result = handle_default_introspect_and_unlock (tree, message,
- (const char**) path);
- }
- else
- {
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
- }
-
- while (list != NULL)
- {
- link = _dbus_list_get_first_link (&list);
- _dbus_object_subtree_unref (link->data);
- _dbus_list_remove_link (&list, link);
- }
-
- dbus_free_string_array (path);
-
- return result;
-}
-
-/**
- * Looks up the data passed to _dbus_object_tree_register() for a
- * handler at the given path.
- *
- * @param tree the global object tree
- * @param path NULL-terminated array of path elements giving path to subtree
- * @returns the object's user_data or #NULL if none found
- */
-void*
-_dbus_object_tree_get_user_data_unlocked (DBusObjectTree *tree,
- const char **path)
-{
- dbus_bool_t exact_match;
- DBusObjectSubtree *subtree;
-
- _dbus_assert (tree != NULL);
- _dbus_assert (path != NULL);
-
- /* Find the deepest path that covers the path in the message */
- subtree = find_handler (tree, (const char**) path, &exact_match);
-
- if ((subtree == NULL) || !exact_match)
- {
- _dbus_verbose ("No object at specified path found\n");
- return NULL;
- }
-
- return subtree->user_data;
-}
-
-/**
- * Allocates a subtree object.
- *
- * @param name name to duplicate.
- * @returns newly-allocated subtree
- */
-static DBusObjectSubtree*
-allocate_subtree_object (const char *name)
-{
- int len;
- DBusObjectSubtree *subtree;
- const size_t front_padding = _DBUS_STRUCT_OFFSET (DBusObjectSubtree, name);
-
- _dbus_assert (name != NULL);
-
- len = strlen (name);
-
- subtree = dbus_malloc0 (MAX (front_padding + (len + 1), sizeof (DBusObjectSubtree)));
-
- if (subtree == NULL)
- return NULL;
-
- memcpy (subtree->name, name, len + 1);
-
- return subtree;
-}
-
-static DBusObjectSubtree*
-_dbus_object_subtree_new (const char *name,
- const DBusObjectPathVTable *vtable,
- void *user_data)
-{
- DBusObjectSubtree *subtree;
-
- subtree = allocate_subtree_object (name);
- if (subtree == NULL)
- goto oom;
-
- _dbus_assert (name != NULL);
-
- subtree->parent = NULL;
-
- if (vtable)
- {
- subtree->message_function = vtable->message_function;
- subtree->unregister_function = vtable->unregister_function;
- }
- else
- {
- subtree->message_function = NULL;
- subtree->unregister_function = NULL;
- }
-
- subtree->user_data = user_data;
- _dbus_atomic_inc (&subtree->refcount);
- subtree->subtrees = NULL;
- subtree->n_subtrees = 0;
- subtree->max_subtrees = 0;
- subtree->invoke_as_fallback = FALSE;
-
- return subtree;
-
- oom:
- return NULL;
-}
-
-static DBusObjectSubtree *
-_dbus_object_subtree_ref (DBusObjectSubtree *subtree)
-{
-#ifdef DBUS_DISABLE_ASSERT
- _dbus_atomic_inc (&subtree->refcount);
-#else
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_inc (&subtree->refcount);
- _dbus_assert (old_value > 0);
-#endif
-
- return subtree;
-}
-
-static void
-_dbus_object_subtree_unref (DBusObjectSubtree *subtree)
-{
- dbus_int32_t old_value;
-
- old_value = _dbus_atomic_dec (&subtree->refcount);
- _dbus_assert (old_value > 0);
-
- if (old_value == 1)
- {
- _dbus_assert (subtree->unregister_function == NULL);
- _dbus_assert (subtree->message_function == NULL);
-
- dbus_free (subtree->subtrees);
- dbus_free (subtree);
- }
-}
-
-/**
- * Lists the registered fallback handlers and object path handlers at
- * the given parent_path. The returned array should be freed with
- * dbus_free_string_array().
- *
- * @param tree the object tree
- * @param parent_path the path to list the child handlers of
- * @param child_entries returns #NULL-terminated array of children
- * @returns #FALSE if no memory to allocate the child entries
- */
-dbus_bool_t
-_dbus_object_tree_list_registered_and_unlock (DBusObjectTree *tree,
- const char **parent_path,
- char ***child_entries)
-{
- dbus_bool_t result;
-
- result = _dbus_object_tree_list_registered_unlocked (tree,
- parent_path,
- child_entries);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (tree->connection)
-#endif
- {
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (tree->connection);
- }
-
- return result;
-}
-
-
-/** Set to 1 to get a bunch of spew about disassembling the path string */
-#define VERBOSE_DECOMPOSE 0
-
-/**
- * Decompose an object path. A path of just "/" is
- * represented as an empty vector of strings.
- * The path need not be nul terminated.
- *
- * @param data the path data
- * @param len the length of the path string
- * @param path address to store new object path
- * @param path_len length of stored path
- */
-dbus_bool_t
-_dbus_decompose_path (const char* data,
- int len,
- char ***path,
- int *path_len)
-{
- char **retval;
- int n_components;
- int i, j, comp;
-
- _dbus_assert (data != NULL);
- _dbus_assert (path != NULL);
-
-#if VERBOSE_DECOMPOSE
- _dbus_verbose ("Decomposing path \"%s\"\n",
- data);
-#endif
-
- n_components = 0;
- if (len > 1) /* if path is not just "/" */
- {
- i = 0;
- while (i < len)
- {
- _dbus_assert (data[i] != '\0');
- if (data[i] == '/')
- n_components += 1;
- ++i;
- }
- }
-
- retval = dbus_new0 (char*, n_components + 1);
-
- if (retval == NULL)
- return FALSE;
-
- comp = 0;
- if (n_components == 0)
- i = 1;
- else
- i = 0;
- while (comp < n_components)
- {
- _dbus_assert (i < len);
-
- if (data[i] == '/')
- ++i;
- j = i;
-
- while (j < len && data[j] != '/')
- ++j;
-
- /* Now [i, j) is the path component */
- _dbus_assert (i < j);
- _dbus_assert (data[i] != '/');
- _dbus_assert (j == len || data[j] == '/');
-
-#if VERBOSE_DECOMPOSE
- _dbus_verbose (" (component in [%d,%d))\n",
- i, j);
-#endif
-
- retval[comp] = _dbus_memdup (&data[i], j - i + 1);
- if (retval[comp] == NULL)
- {
- dbus_free_string_array (retval);
- return FALSE;
- }
- retval[comp][j-i] = '\0';
-#if VERBOSE_DECOMPOSE
- _dbus_verbose (" (component %d = \"%s\")\n",
- comp, retval[comp]);
-#endif
-
- ++comp;
- i = j;
- }
- _dbus_assert (i == len);
-
- *path = retval;
- if (path_len)
- *path_len = n_components;
-
- return TRUE;
-}
-
-/** @} */
-
-static char*
-flatten_path (const char **path)
-{
- DBusString str;
- char *s;
-
- if (!_dbus_string_init (&str))
- return NULL;
-
- if (path[0] == NULL)
- {
- if (!_dbus_string_append_byte (&str, '/'))
- goto nomem;
- }
- else
- {
- int i;
-
- i = 0;
- while (path[i])
- {
- if (!_dbus_string_append_byte (&str, '/'))
- goto nomem;
-
- if (!_dbus_string_append (&str, path[i]))
- goto nomem;
-
- ++i;
- }
- }
-
- if (!_dbus_string_steal_data (&str, &s))
- goto nomem;
-
- _dbus_string_free (&str);
-
- return s;
-
- nomem:
- _dbus_string_free (&str);
- return NULL;
-}
-
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include "dbus-test.h"
-#include <stdio.h>
-
-typedef enum
-{
- STR_EQUAL,
- STR_PREFIX,
- STR_DIFFERENT
-} StrComparison;
-
-/* Returns TRUE if container is a parent of child
- */
-static StrComparison
-path_contains (const char **container,
- const char **child)
-{
- int i;
-
- i = 0;
- while (child[i] != NULL)
- {
- int v;
-
- if (container[i] == NULL)
- return STR_PREFIX; /* container ran out, child continues;
- * thus the container is a parent of the
- * child.
- */
-
- _dbus_assert (container[i] != NULL);
- _dbus_assert (child[i] != NULL);
-
- v = strcmp (container[i], child[i]);
-
- if (v != 0)
- return STR_DIFFERENT; /* they overlap until here and then are different,
- * not overlapping
- */
-
- ++i;
- }
-
- /* Child ran out; if container also did, they are equal;
- * otherwise, the child is a parent of the container.
- */
- if (container[i] == NULL)
- return STR_EQUAL;
- else
- return STR_DIFFERENT;
-}
-
-#if 0
-static void
-spew_subtree_recurse (DBusObjectSubtree *subtree,
- int indent)
-{
- int i;
-
- i = 0;
- while (i < indent)
- {
- _dbus_verbose (" ");
- ++i;
- }
-
- _dbus_verbose ("%s (%d children)\n",
- subtree->name, subtree->n_subtrees);
-
- i = 0;
- while (i < subtree->n_subtrees)
- {
- spew_subtree_recurse (subtree->subtrees[i], indent + 2);
-
- ++i;
- }
-}
-
-static void
-spew_tree (DBusObjectTree *tree)
-{
- spew_subtree_recurse (tree->root, 0);
-}
-#endif
-
-/**
- * Callback data used in tests
- */
-typedef struct
-{
- const char **path; /**< Path */
- dbus_bool_t handler_fallback; /**< true if the handler may be called as fallback */
- dbus_bool_t message_handled; /**< Gets set to true if message handler called */
- dbus_bool_t handler_unregistered; /**< gets set to true if handler is unregistered */
-} TreeTestData;
-
-
-static void
-test_unregister_function (DBusConnection *connection,
- void *user_data)
-{
- TreeTestData *ttd = user_data;
-
- ttd->handler_unregistered = TRUE;
-}
-
-static DBusHandlerResult
-test_message_function (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- TreeTestData *ttd = user_data;
-
- ttd->message_handled = TRUE;
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static dbus_bool_t
-do_register (DBusObjectTree *tree,
- const char **path,
- dbus_bool_t fallback,
- int i,
- TreeTestData *tree_test_data)
-{
- DBusObjectPathVTable vtable = { test_unregister_function,
- test_message_function, NULL };
-
- tree_test_data[i].message_handled = FALSE;
- tree_test_data[i].handler_unregistered = FALSE;
- tree_test_data[i].handler_fallback = fallback;
- tree_test_data[i].path = path;
-
- if (!_dbus_object_tree_register (tree, fallback, path,
- &vtable,
- &tree_test_data[i],
- NULL))
- return FALSE;
-
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path) ==
- &tree_test_data[i]);
-
- return TRUE;
-}
-
-static dbus_bool_t
-do_test_dispatch (DBusObjectTree *tree,
- const char **path,
- int i,
- TreeTestData *tree_test_data,
- int n_test_data)
-{
- DBusMessage *message;
- int j;
- DBusHandlerResult result;
- char *flat;
-
- message = NULL;
-
- flat = flatten_path (path);
- if (flat == NULL)
- goto oom;
-
- message = dbus_message_new_method_call (NULL,
- flat,
- "org.freedesktop.TestInterface",
- "Foo");
- dbus_free (flat);
- if (message == NULL)
- goto oom;
-
- j = 0;
- while (j < n_test_data)
- {
- tree_test_data[j].message_handled = FALSE;
- ++j;
- }
-
- result = _dbus_object_tree_dispatch_and_unlock (tree, message, NULL);
- if (result == DBUS_HANDLER_RESULT_NEED_MEMORY)
- goto oom;
-
- _dbus_assert (tree_test_data[i].message_handled);
-
- j = 0;
- while (j < n_test_data)
- {
- if (tree_test_data[j].message_handled)
- {
- if (tree_test_data[j].handler_fallback)
- _dbus_assert (path_contains (tree_test_data[j].path,
- path) != STR_DIFFERENT);
- else
- _dbus_assert (path_contains (tree_test_data[j].path, path) == STR_EQUAL);
- }
- else
- {
- if (tree_test_data[j].handler_fallback)
- _dbus_assert (path_contains (tree_test_data[j].path,
- path) == STR_DIFFERENT);
- else
- _dbus_assert (path_contains (tree_test_data[j].path, path) != STR_EQUAL);
- }
-
- ++j;
- }
-
- dbus_message_unref (message);
-
- return TRUE;
-
- oom:
- if (message)
- dbus_message_unref (message);
- return FALSE;
-}
-
-static size_t
-string_array_length (const char **array)
-{
- size_t i;
- for (i = 0; array[i]; i++) ;
- return i;
-}
-
-typedef struct
-{
- const char *path;
- const char *result[20];
-} DecomposePathTest;
-
-static DecomposePathTest decompose_tests[] = {
- { "/foo", { "foo", NULL } },
- { "/foo/bar", { "foo", "bar", NULL } },
- { "/", { NULL } },
- { "/a/b", { "a", "b", NULL } },
- { "/a/b/c", { "a", "b", "c", NULL } },
- { "/a/b/c/d", { "a", "b", "c", "d", NULL } },
- { "/foo/bar/q", { "foo", "bar", "q", NULL } },
- { "/foo/bar/this/is/longer", { "foo", "bar", "this", "is", "longer", NULL } }
-};
-
-static dbus_bool_t
-run_decompose_tests (void)
-{
- int i;
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (decompose_tests))
- {
- char **result;
- int result_len;
- int expected_len;
-
- if (!_dbus_decompose_path (decompose_tests[i].path,
- strlen (decompose_tests[i].path),
- &result, &result_len))
- return FALSE;
-
- expected_len = string_array_length (decompose_tests[i].result);
-
- if (result_len != (int) string_array_length ((const char**)result) ||
- expected_len != result_len ||
- path_contains (decompose_tests[i].result,
- (const char**) result) != STR_EQUAL)
- {
- int real_len = string_array_length ((const char**)result);
- _dbus_warn ("Expected decompose of %s to have len %d, returned %d, appears to have %d\n",
- decompose_tests[i].path, expected_len, result_len,
- real_len);
- _dbus_warn ("Decompose resulted in elements: { ");
- i = 0;
- while (i < real_len)
- {
- _dbus_warn ("\"%s\"%s", result[i],
- (i + 1) == real_len ? "" : ", ");
- ++i;
- }
- _dbus_warn ("}\n");
- _dbus_assert_not_reached ("path decompose failed\n");
- }
-
- dbus_free_string_array (result);
-
- ++i;
- }
-
- return TRUE;
-}
-
-static DBusObjectSubtree*
-find_subtree_registered_or_unregistered (DBusObjectTree *tree,
- const char **path)
-{
-#if VERBOSE_FIND
- _dbus_verbose ("Looking for exact subtree, registered or unregistered\n");
-#endif
-
- return find_subtree_recurse (tree->root, path, FALSE, NULL, NULL);
-}
-
-static dbus_bool_t
-object_tree_test_iteration (void *data)
-{
- const char *path0[] = { NULL };
- const char *path1[] = { "foo", NULL };
- const char *path2[] = { "foo", "bar", NULL };
- const char *path3[] = { "foo", "bar", "baz", NULL };
- const char *path4[] = { "foo", "bar", "boo", NULL };
- const char *path5[] = { "blah", NULL };
- const char *path6[] = { "blah", "boof", NULL };
- const char *path7[] = { "blah", "boof", "this", "is", "really", "long", NULL };
- const char *path8[] = { "childless", NULL };
- const char *path9[] = { "blah", "a", NULL };
- const char *path10[] = { "blah", "b", NULL };
- const char *path11[] = { "blah", "c", NULL };
- const char *path12[] = { "blah", "a", "d", NULL };
- const char *path13[] = { "blah", "b", "d", NULL };
- const char *path14[] = { "blah", "c", "d", NULL };
- DBusObjectPathVTable test_vtable = { NULL, test_message_function, NULL };
- DBusObjectTree *tree;
- TreeTestData tree_test_data[9];
- int i;
- dbus_bool_t exact_match;
-
- if (!run_decompose_tests ())
- return FALSE;
-
- tree = NULL;
-
- tree = _dbus_object_tree_new (NULL);
- if (tree == NULL)
- goto out;
-
- if (!do_register (tree, path0, TRUE, 0, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- _dbus_assert (find_handler (tree, path0, &exact_match) && exact_match);
- _dbus_assert (find_handler (tree, path1, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path2, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path3, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path4, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path5, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path6, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path7, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path8, &exact_match) == tree->root && !exact_match);
-
- if (!do_register (tree, path1, TRUE, 1, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- _dbus_assert (find_handler (tree, path0, &exact_match) && exact_match);
- _dbus_assert (find_handler (tree, path1, &exact_match) && exact_match);
- _dbus_assert (find_handler (tree, path2, &exact_match) && !exact_match);
- _dbus_assert (find_handler (tree, path3, &exact_match) && !exact_match);
- _dbus_assert (find_handler (tree, path4, &exact_match) && !exact_match);
- _dbus_assert (find_handler (tree, path5, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path6, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path7, &exact_match) == tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path8, &exact_match) == tree->root && !exact_match);
-
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- if (!do_register (tree, path3, TRUE, 3, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- if (!do_register (tree, path4, TRUE, 4, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- if (!do_register (tree, path5, TRUE, 5, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- _dbus_assert (find_handler (tree, path0, &exact_match) == tree->root && exact_match);
- _dbus_assert (find_handler (tree, path1, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path2, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path3, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path4, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path5, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path6, &exact_match) != tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path7, &exact_match) != tree->root && !exact_match);
- _dbus_assert (find_handler (tree, path8, &exact_match) == tree->root && !exact_match);
-
- if (!do_register (tree, path6, TRUE, 6, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- if (!do_register (tree, path7, TRUE, 7, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- if (!do_register (tree, path8, TRUE, 8, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_assert (find_handler (tree, path0, &exact_match) == tree->root && exact_match);
- _dbus_assert (find_handler (tree, path1, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path2, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path3, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path4, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path5, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path6, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path7, &exact_match) != tree->root && exact_match);
- _dbus_assert (find_handler (tree, path8, &exact_match) != tree->root && exact_match);
-
- /* test the list_registered function */
-
- {
- const char *root[] = { NULL };
- char **child_entries;
- int nb;
-
- _dbus_object_tree_list_registered_unlocked (tree, path1, &child_entries);
- if (child_entries != NULL)
- {
- nb = string_array_length ((const char**)child_entries);
- _dbus_assert (nb == 1);
- dbus_free_string_array (child_entries);
- }
-
- _dbus_object_tree_list_registered_unlocked (tree, path2, &child_entries);
- if (child_entries != NULL)
- {
- nb = string_array_length ((const char**)child_entries);
- _dbus_assert (nb == 2);
- dbus_free_string_array (child_entries);
- }
-
- _dbus_object_tree_list_registered_unlocked (tree, path8, &child_entries);
- if (child_entries != NULL)
- {
- nb = string_array_length ((const char**)child_entries);
- _dbus_assert (nb == 0);
- dbus_free_string_array (child_entries);
- }
-
- _dbus_object_tree_list_registered_unlocked (tree, root, &child_entries);
- if (child_entries != NULL)
- {
- nb = string_array_length ((const char**)child_entries);
- _dbus_assert (nb == 3);
- dbus_free_string_array (child_entries);
- }
- }
-
- /* Check that destroying tree calls unregister funcs */
- _dbus_object_tree_unref (tree);
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (tree_test_data))
- {
- _dbus_assert (tree_test_data[i].handler_unregistered);
- _dbus_assert (!tree_test_data[i].message_handled);
- ++i;
- }
-
- /* Now start again and try the individual unregister function */
- tree = _dbus_object_tree_new (NULL);
- if (tree == NULL)
- goto out;
-
- if (!do_register (tree, path0, TRUE, 0, tree_test_data))
- goto out;
- if (!do_register (tree, path1, TRUE, 1, tree_test_data))
- goto out;
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
- if (!do_register (tree, path3, TRUE, 3, tree_test_data))
- goto out;
- if (!do_register (tree, path4, TRUE, 4, tree_test_data))
- goto out;
- if (!do_register (tree, path5, TRUE, 5, tree_test_data))
- goto out;
- if (!do_register (tree, path6, TRUE, 6, tree_test_data))
- goto out;
- if (!do_register (tree, path7, TRUE, 7, tree_test_data))
- goto out;
- if (!do_register (tree, path8, TRUE, 8, tree_test_data))
- goto out;
-
- _dbus_object_tree_unregister_and_unlock (tree, path0);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path0) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path1);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path1) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path2) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path3);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path3) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path4);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path4) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path5);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path5) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path6);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path6) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path7);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path7) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (find_subtree (tree, path8, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path8);
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path8) == NULL);
-
- _dbus_assert (!find_subtree (tree, path0, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree (tree, path5, NULL));
- _dbus_assert (!find_subtree (tree, path6, NULL));
- _dbus_assert (!find_subtree (tree, path7, NULL));
- _dbus_assert (!find_subtree (tree, path8, NULL));
-
- i = 0;
- while (i < (int) _DBUS_N_ELEMENTS (tree_test_data))
- {
- _dbus_assert (tree_test_data[i].handler_unregistered);
- _dbus_assert (!tree_test_data[i].message_handled);
- ++i;
- }
-
- /* Test removal of newly-childless unregistered nodes */
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
-
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- /* Test that unregistered parents cannot be freed out from under their
- children */
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
-
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
-#if 0
- /* This triggers the "Attempted to unregister path ..." warning message */
- _dbus_object_tree_unregister_and_unlock (tree, path1);
-#endif
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- /* Test that registered parents cannot be freed out from under their
- children, and that if they are unregistered before their children, they
- are still freed when their children are unregistered */
- if (!do_register (tree, path1, TRUE, 1, tree_test_data))
- goto out;
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path1);
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (find_subtree (tree, path2, NULL));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_assert (!find_subtree (tree, path1, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- /* Test with NULL unregister_function and user_data */
- if (!_dbus_object_tree_register (tree, TRUE, path2,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path2) == NULL);
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_assert (!find_subtree (tree, path2, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- /* Test freeing a long path */
- if (!do_register (tree, path3, TRUE, 3, tree_test_data))
- goto out;
-
- _dbus_object_tree_unregister_and_unlock (tree, path3);
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
-
- /* Test freeing multiple children from the same path */
- if (!do_register (tree, path3, TRUE, 3, tree_test_data))
- goto out;
- if (!do_register (tree, path4, TRUE, 4, tree_test_data))
- goto out;
-
- _dbus_assert (find_subtree (tree, path3, NULL));
- _dbus_assert (find_subtree (tree, path4, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path3);
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
- _dbus_assert (find_subtree (tree, path4, NULL));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path4));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
-
- _dbus_object_tree_unregister_and_unlock (tree, path4);
- _dbus_assert (!find_subtree (tree, path4, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path4));
- _dbus_assert (!find_subtree (tree, path3, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
-
- /* Test subtree removal */
- if (!_dbus_object_tree_register (tree, TRUE, path12,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (find_subtree (tree, path12, NULL));
-
- if (!_dbus_object_tree_register (tree, TRUE, path13,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (find_subtree (tree, path13, NULL));
-
- if (!_dbus_object_tree_register (tree, TRUE, path14,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (find_subtree (tree, path14, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path12);
-
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path12));
- _dbus_assert (find_subtree (tree, path13, NULL));
- _dbus_assert (find_subtree (tree, path14, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path9));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
-
- if (!_dbus_object_tree_register (tree, TRUE, path12,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (find_subtree (tree, path12, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path13);
-
- _dbus_assert (find_subtree (tree, path12, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path13));
- _dbus_assert (find_subtree (tree, path14, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path10));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
-
- if (!_dbus_object_tree_register (tree, TRUE, path13,
- &test_vtable,
- NULL,
- NULL))
- goto out;
-
- _dbus_assert (find_subtree (tree, path13, NULL));
-
- _dbus_object_tree_unregister_and_unlock (tree, path14);
-
- _dbus_assert (find_subtree (tree, path12, NULL));
- _dbus_assert (find_subtree (tree, path13, NULL));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path14));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path11));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
-
- _dbus_object_tree_unregister_and_unlock (tree, path12);
-
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path12));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path9));
- _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
-
- _dbus_object_tree_unregister_and_unlock (tree, path13);
-
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path13));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path10));
- _dbus_assert (!find_subtree_registered_or_unregistered (tree, path5));
-
-#if 0
- /* Test attempting to unregister non-existent paths. These trigger
- "Attempted to unregister path ..." warning messages */
- _dbus_object_tree_unregister_and_unlock (tree, path0);
- _dbus_object_tree_unregister_and_unlock (tree, path1);
- _dbus_object_tree_unregister_and_unlock (tree, path2);
- _dbus_object_tree_unregister_and_unlock (tree, path3);
- _dbus_object_tree_unregister_and_unlock (tree, path4);
-#endif
-
- /* Register it all again, and test dispatch */
-
- if (!do_register (tree, path0, TRUE, 0, tree_test_data))
- goto out;
- if (!do_register (tree, path1, FALSE, 1, tree_test_data))
- goto out;
- if (!do_register (tree, path2, TRUE, 2, tree_test_data))
- goto out;
- if (!do_register (tree, path3, TRUE, 3, tree_test_data))
- goto out;
- if (!do_register (tree, path4, TRUE, 4, tree_test_data))
- goto out;
- if (!do_register (tree, path5, TRUE, 5, tree_test_data))
- goto out;
- if (!do_register (tree, path6, FALSE, 6, tree_test_data))
- goto out;
- if (!do_register (tree, path7, TRUE, 7, tree_test_data))
- goto out;
- if (!do_register (tree, path8, TRUE, 8, tree_test_data))
- goto out;
-
-#if 0
- spew_tree (tree);
-#endif
-
- if (!do_test_dispatch (tree, path0, 0, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path1, 1, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path2, 2, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path3, 3, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path4, 4, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path5, 5, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path6, 6, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path7, 7, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
- if (!do_test_dispatch (tree, path8, 8, tree_test_data, _DBUS_N_ELEMENTS (tree_test_data)))
- goto out;
-
- out:
- if (tree)
- {
- /* test ref */
- _dbus_object_tree_ref (tree);
- _dbus_object_tree_unref (tree);
- _dbus_object_tree_unref (tree);
- }
-
- return TRUE;
-}
-
-/**
- * @ingroup DBusObjectTree
- * Unit test for DBusObjectTree
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_object_tree_test (void)
-{
- _dbus_test_oom_handling ("object tree",
- object_tree_test_iteration,
- NULL);
-
- return TRUE;
-}
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.h
deleted file mode 100644
index 5576c25dff..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-object-tree.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-object-tree.h DBusObjectTree (internals of DBusConnection)
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_OBJECT_TREE_H
-#define DBUS_OBJECT_TREE_H
-
-#include <dbus/dbus-connection.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusObjectTree DBusObjectTree;
-
-DBusObjectTree* _dbus_object_tree_new (DBusConnection *connection);
-DBusObjectTree* _dbus_object_tree_ref (DBusObjectTree *tree);
-void _dbus_object_tree_unref (DBusObjectTree *tree);
-
-dbus_bool_t _dbus_object_tree_register (DBusObjectTree *tree,
- dbus_bool_t fallback,
- const char **path,
- const DBusObjectPathVTable *vtable,
- void *user_data,
- DBusError *error);
-void _dbus_object_tree_unregister_and_unlock (DBusObjectTree *tree,
- const char **path);
-DBusHandlerResult _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
- DBusMessage *message,
- dbus_bool_t *found_object);
-void* _dbus_object_tree_get_user_data_unlocked (DBusObjectTree *tree,
- const char **path);
-void _dbus_object_tree_free_all_unlocked (DBusObjectTree *tree);
-
-
-dbus_bool_t _dbus_object_tree_list_registered_and_unlock (DBusObjectTree *tree,
- const char **parent_path,
- char ***child_entries);
-
-dbus_bool_t _dbus_decompose_path (const char *data,
- int len,
- char ***path,
- int *path_len);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_OBJECT_TREE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call-internal.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call-internal.h
deleted file mode 100644
index 1875eea873..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call-internal.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pending-call-internal.h DBusPendingCall internal interfaces
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_PENDING_CALL_INTERNAL_H
-#define DBUS_PENDING_CALL_INTERNAL_H
-
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-list.h>
-
-DBUS_BEGIN_DECLS
-
-dbus_bool_t _dbus_pending_call_is_timeout_added_unlocked (DBusPendingCall *pending);
-void _dbus_pending_call_set_timeout_added_unlocked (DBusPendingCall *pending,
- dbus_bool_t is_added);
-DBusTimeout * _dbus_pending_call_get_timeout_unlocked (DBusPendingCall *pending);
-dbus_uint32_t _dbus_pending_call_get_reply_serial_unlocked (DBusPendingCall *pending);
-void _dbus_pending_call_set_reply_serial_unlocked (DBusPendingCall *pending,
- dbus_uint32_t serial);
-DBusConnection * _dbus_pending_call_get_connection_and_lock (DBusPendingCall *pending);
-DBusConnection * _dbus_pending_call_get_connection_unlocked (DBusPendingCall *pending);
-dbus_bool_t _dbus_pending_call_get_completed_unlocked (DBusPendingCall *pending);
-void _dbus_pending_call_complete (DBusPendingCall *pending);
-void _dbus_pending_call_set_reply_unlocked (DBusPendingCall *pending,
- DBusMessage *message);
-void _dbus_pending_call_queue_timeout_error_unlocked (DBusPendingCall *pending,
- DBusConnection *connection);
-void _dbus_pending_call_set_reply_serial_unlocked (DBusPendingCall *pending,
- dbus_uint32_t serial);
-dbus_bool_t _dbus_pending_call_set_timeout_error_unlocked (DBusPendingCall *pending,
- DBusMessage *message,
- dbus_uint32_t serial);
-DBusPendingCall* _dbus_pending_call_new_unlocked (DBusConnection *connection,
- int timeout_milliseconds,
- DBusTimeoutHandler timeout_handler);
-DBusPendingCall* _dbus_pending_call_ref_unlocked (DBusPendingCall *pending);
-void _dbus_pending_call_unref_and_unlock (DBusPendingCall *pending);
-dbus_bool_t _dbus_pending_call_set_data_unlocked (DBusPendingCall *pending,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_PENDING_CALL_INTERNAL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.c
deleted file mode 100644
index be5341058a..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.c
+++ /dev/null
@@ -1,843 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pending-call.c Object representing a call in progress.
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-connection-internal.h"
-#include "dbus-message-internal.h"
-#include "dbus-pending-call-internal.h"
-#include "dbus-pending-call.h"
-#include "dbus-list.h"
-#include "dbus-threads.h"
-#include "dbus-test.h"
-
-/**
- * @defgroup DBusPendingCallInternals DBusPendingCall implementation details
- * @ingroup DBusInternals
- * @brief DBusPendingCall private implementation details.
- *
- * The guts of DBusPendingCall and its methods.
- *
- * @{
- */
-
-/**
- * @brief Internals of DBusPendingCall
- *
- * Opaque object representing a reply message that we're waiting for.
- */
-
-/**
- * shorter and more visible way to write _dbus_connection_lock()
- */
-#define CONNECTION_LOCK(connection) _dbus_connection_lock(connection)
-/**
- * shorter and more visible way to write _dbus_connection_unlock()
- */
-#define CONNECTION_UNLOCK(connection) _dbus_connection_unlock(connection)
-
-/**
- * Implementation details of #DBusPendingCall - all fields are private.
- */
-struct DBusPendingCall
-{
- DBusAtomic refcount; /**< reference count */
-
- DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
-
- DBusPendingCallNotifyFunction function; /**< Notifier when reply arrives. */
-
- DBusConnection *connection; /**< Connections we're associated with */
- DBusMessage *reply; /**< Reply (after we've received it) */
- DBusTimeout *timeout; /**< Timeout */
-
- DBusList *timeout_link; /**< Preallocated timeout response */
-
- dbus_uint32_t reply_serial; /**< Expected serial of reply */
-
- unsigned int completed : 1; /**< TRUE if completed */
- unsigned int timeout_added : 1; /**< Have added the timeout */
-};
-
-static void
-_dbus_pending_call_trace_ref (DBusPendingCall *pending_call,
- int old_refcount,
- int new_refcount,
- const char *why)
-{
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- static int enabled = -1;
-
- _dbus_trace_ref ("DBusPendingCall", pending_call, old_refcount,
- new_refcount, why, "DBUS_PENDING_CALL_TRACE", &enabled);
-#endif
-}
-
-static dbus_int32_t notify_user_data_slot = -1;
-
-/**
- * Creates a new pending reply object.
- *
- * @param connection connection where reply will arrive
- * @param timeout_milliseconds length of timeout, -1 (or
- * #DBUS_TIMEOUT_USE_DEFAULT) for default,
- * #DBUS_TIMEOUT_INFINITE for no timeout
- * @param timeout_handler timeout handler, takes pending call as data
- * @returns a new #DBusPendingCall or #NULL if no memory.
- */
-DBusPendingCall*
-_dbus_pending_call_new_unlocked (DBusConnection *connection,
- int timeout_milliseconds,
- DBusTimeoutHandler timeout_handler)
-{
- DBusPendingCall *pending;
- DBusTimeout *timeout;
-
- _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1);
-
- if (timeout_milliseconds == -1)
- timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE;
-
- if (!dbus_pending_call_allocate_data_slot (&notify_user_data_slot))
- return NULL;
-
- pending = dbus_new0 (DBusPendingCall, 1);
-
- if (pending == NULL)
- {
- dbus_pending_call_free_data_slot (&notify_user_data_slot);
- return NULL;
- }
-
- if (timeout_milliseconds != DBUS_TIMEOUT_INFINITE)
- {
- timeout = _dbus_timeout_new (timeout_milliseconds,
- timeout_handler,
- pending, NULL);
-
- if (timeout == NULL)
- {
- dbus_pending_call_free_data_slot (&notify_user_data_slot);
- dbus_free (pending);
- return NULL;
- }
-
- pending->timeout = timeout;
- }
- else
- {
- pending->timeout = NULL;
- }
-
- _dbus_atomic_inc (&pending->refcount);
- pending->connection = connection;
- _dbus_connection_ref_unlocked (pending->connection);
-
- _dbus_data_slot_list_init (&pending->slot_list);
-
- _dbus_pending_call_trace_ref (pending, 0, 1, "new_unlocked");
-
- return pending;
-}
-
-/**
- * Sets the reply of a pending call with the given message,
- * or if the message is #NULL, by timing out the pending call.
- *
- * @param pending the pending call
- * @param message the message to complete the call with, or #NULL
- * to time out the call
- */
-void
-_dbus_pending_call_set_reply_unlocked (DBusPendingCall *pending,
- DBusMessage *message)
-{
- if (message == NULL)
- {
- message = pending->timeout_link->data;
- _dbus_list_clear (&pending->timeout_link);
- }
- else
- dbus_message_ref (message);
-
- _dbus_verbose (" handing message %p (%s) to pending call serial %u\n",
- message,
- dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN ?
- "method return" :
- dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR ?
- "error" : "other type",
- pending->reply_serial);
-
- _dbus_assert (pending->reply == NULL);
- _dbus_assert (pending->reply_serial == dbus_message_get_reply_serial (message));
- pending->reply = message;
-}
-
-/**
- * Calls notifier function for the pending call
- * and sets the call to completed.
- *
- * @param pending the pending call
- *
- */
-void
-_dbus_pending_call_complete (DBusPendingCall *pending)
-{
- _dbus_assert (!pending->completed);
-
- pending->completed = TRUE;
-
- if (pending->function)
- {
- void *user_data;
- user_data = dbus_pending_call_get_data (pending,
- notify_user_data_slot);
-
- (* pending->function) (pending, user_data);
- }
-}
-
-/**
- * If the pending call hasn't been timed out, add its timeout
- * error reply to the connection's incoming message queue.
- *
- * @param pending the pending call
- * @param connection the connection the call was sent to
- */
-void
-_dbus_pending_call_queue_timeout_error_unlocked (DBusPendingCall *pending,
- DBusConnection *connection)
-{
- _dbus_assert (connection == pending->connection);
-
- if (pending->timeout_link)
- {
- _dbus_connection_queue_synthesized_message_link (connection,
- pending->timeout_link);
- pending->timeout_link = NULL;
- }
-}
-
-/**
- * Checks to see if a timeout has been added
- *
- * @param pending the pending_call
- * @returns #TRUE if there is a timeout or #FALSE if not
- */
-dbus_bool_t
-_dbus_pending_call_is_timeout_added_unlocked (DBusPendingCall *pending)
-{
- _dbus_assert (pending != NULL);
-
- return pending->timeout_added;
-}
-
-
-/**
- * Sets wether the timeout has been added
- *
- * @param pending the pending_call
- * @param is_added whether or not a timeout is added
- */
-void
-_dbus_pending_call_set_timeout_added_unlocked (DBusPendingCall *pending,
- dbus_bool_t is_added)
-{
- _dbus_assert (pending != NULL);
-
- pending->timeout_added = is_added;
-}
-
-
-/**
- * Retrives the timeout
- *
- * @param pending the pending_call
- * @returns a timeout object or NULL if call has no timeout
- */
-DBusTimeout *
-_dbus_pending_call_get_timeout_unlocked (DBusPendingCall *pending)
-{
- _dbus_assert (pending != NULL);
-
- return pending->timeout;
-}
-
-/**
- * Gets the reply's serial number
- *
- * @param pending the pending_call
- * @returns a serial number for the reply or 0
- */
-dbus_uint32_t
-_dbus_pending_call_get_reply_serial_unlocked (DBusPendingCall *pending)
-{
- _dbus_assert (pending != NULL);
-
- return pending->reply_serial;
-}
-
-/**
- * Sets the reply's serial number
- *
- * @param pending the pending_call
- * @param serial the serial number
- */
-void
-_dbus_pending_call_set_reply_serial_unlocked (DBusPendingCall *pending,
- dbus_uint32_t serial)
-{
- _dbus_assert (pending != NULL);
- _dbus_assert (pending->reply_serial == 0);
-
- pending->reply_serial = serial;
-}
-
-/**
- * Gets the connection associated with this pending call.
- *
- * @param pending the pending_call
- * @returns the connection associated with the pending call
- */
-DBusConnection *
-_dbus_pending_call_get_connection_and_lock (DBusPendingCall *pending)
-{
- _dbus_assert (pending != NULL);
-
- CONNECTION_LOCK (pending->connection);
- return pending->connection;
-}
-
-/**
- * Gets the connection associated with this pending call.
- *
- * @param pending the pending_call
- * @returns the connection associated with the pending call
- */
-DBusConnection *
-_dbus_pending_call_get_connection_unlocked (DBusPendingCall *pending)
-{
- _dbus_assert (pending != NULL);
-
- return pending->connection;
-}
-
-/**
- * Sets the reply message associated with the pending call to a timeout error
- *
- * @param pending the pending_call
- * @param message the message we are sending the error reply to
- * @param serial serial number for the reply
- * @return #FALSE on OOM
- */
-dbus_bool_t
-_dbus_pending_call_set_timeout_error_unlocked (DBusPendingCall *pending,
- DBusMessage *message,
- dbus_uint32_t serial)
-{
- DBusList *reply_link;
- DBusMessage *reply;
-
- reply = dbus_message_new_error (message, DBUS_ERROR_NO_REPLY,
- "Did not receive a reply. Possible causes include: "
- "the remote application did not send a reply, "
- "the message bus security policy blocked the reply, "
- "the reply timeout expired, or "
- "the network connection was broken.");
- if (reply == NULL)
- return FALSE;
-
- reply_link = _dbus_list_alloc_link (reply);
- if (reply_link == NULL)
- {
- /* it's OK to unref this, nothing that could have attached a callback
- * has ever seen it */
- dbus_message_unref (reply);
- return FALSE;
- }
-
- pending->timeout_link = reply_link;
-
- _dbus_pending_call_set_reply_serial_unlocked (pending, serial);
-
- return TRUE;
-}
-
-/**
- * Increments the reference count on a pending call,
- * while the lock on its connection is already held.
- *
- * @param pending the pending call object
- * @returns the pending call object
- */
-DBusPendingCall *
-_dbus_pending_call_ref_unlocked (DBusPendingCall *pending)
-{
- dbus_int32_t old_refcount;
-
- old_refcount = _dbus_atomic_inc (&pending->refcount);
- _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
- "ref_unlocked");
-
- return pending;
-}
-
-
-static void
-_dbus_pending_call_last_unref (DBusPendingCall *pending)
-{
- DBusConnection *connection;
-
- /* If we get here, we should be already detached
- * from the connection, or never attached.
- */
- _dbus_assert (!pending->timeout_added);
-
- connection = pending->connection;
-
- /* this assumes we aren't holding connection lock... */
- _dbus_data_slot_list_free (&pending->slot_list);
-
- if (pending->timeout != NULL)
- _dbus_timeout_unref (pending->timeout);
-
- if (pending->timeout_link)
- {
- dbus_message_unref ((DBusMessage *)pending->timeout_link->data);
- _dbus_list_free_link (pending->timeout_link);
- pending->timeout_link = NULL;
- }
-
- if (pending->reply)
- {
- dbus_message_unref (pending->reply);
- pending->reply = NULL;
- }
-
- dbus_free (pending);
-
- dbus_pending_call_free_data_slot (&notify_user_data_slot);
-
- /* connection lock should not be held. */
- /* Free the connection last to avoid a weird state while
- * calling out to application code where the pending exists
- * but not the connection.
- */
- dbus_connection_unref (connection);
-}
-
-/**
- * Decrements the reference count on a pending call,
- * freeing it if the count reaches 0. Assumes
- * connection lock is already held.
- *
- * @param pending the pending call object
- */
-void
-_dbus_pending_call_unref_and_unlock (DBusPendingCall *pending)
-{
- dbus_int32_t old_refcount;
-
- old_refcount = _dbus_atomic_dec (&pending->refcount);
- _dbus_assert (old_refcount > 0);
- _dbus_pending_call_trace_ref (pending, old_refcount,
- old_refcount - 1, "unref_and_unlock");
-
- CONNECTION_UNLOCK (pending->connection);
-
- if (old_refcount == 1)
- _dbus_pending_call_last_unref (pending);
-}
-
-/**
- * Checks whether the pending call has received a reply
- * yet, or not. Assumes connection lock is held.
- *
- * @param pending the pending call
- * @returns #TRUE if a reply has been received
- */
-dbus_bool_t
-_dbus_pending_call_get_completed_unlocked (DBusPendingCall *pending)
-{
- return pending->completed;
-}
-
-static DBusDataSlotAllocator slot_allocator =
- _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (pending_call_slots));
-
-/**
- * Stores a pointer on a #DBusPendingCall, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the pending call is finalized. The slot number
- * must have been allocated with dbus_pending_call_allocate_data_slot().
- *
- * @param pending the pending_call
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-_dbus_pending_call_set_data_unlocked (DBusPendingCall *pending,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func)
-{
- DBusFreeFunction old_free_func;
- void *old_data;
- dbus_bool_t retval;
-
- retval = _dbus_data_slot_list_set (&slot_allocator,
- &pending->slot_list,
- slot, data, free_data_func,
- &old_free_func, &old_data);
-
- /* Drop locks to call out to app code */
- CONNECTION_UNLOCK (pending->connection);
-
- if (retval)
- {
- if (old_free_func)
- (* old_free_func) (old_data);
- }
-
- CONNECTION_LOCK (pending->connection);
-
- return retval;
-}
-
-/** @} */
-
-/**
- * @defgroup DBusPendingCall DBusPendingCall
- * @ingroup DBus
- * @brief Pending reply to a method call message
- *
- * A DBusPendingCall is an object representing an
- * expected reply. A #DBusPendingCall can be created
- * when you send a message that should have a reply.
- *
- * @{
- */
-
-/**
- * @def DBUS_TIMEOUT_INFINITE
- *
- * An integer constant representing an infinite timeout. This has the
- * numeric value 0x7fffffff (the largest 32-bit signed integer).
- *
- * For source compatibility with D-Bus versions earlier than 1.4.12, use
- * 0x7fffffff, or INT32_MAX (assuming your platform has it).
- */
-
-/**
- * @def DBUS_TIMEOUT_USE_DEFAULT
- *
- * An integer constant representing a request to use the default timeout.
- * This has numeric value -1.
- *
- * For source compatibility with D-Bus versions earlier than 1.4.12, use a
- * literal -1.
- */
-
-/**
- * @typedef DBusPendingCall
- *
- * Opaque data type representing a message pending.
- */
-
-/**
- * Increments the reference count on a pending call.
- *
- * @param pending the pending call object
- * @returns the pending call object
- */
-DBusPendingCall *
-dbus_pending_call_ref (DBusPendingCall *pending)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_val_if_fail (pending != NULL, NULL);
-
- old_refcount = _dbus_atomic_inc (&pending->refcount);
- _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
- "ref");
-
- return pending;
-}
-
-/**
- * Decrements the reference count on a pending call,
- * freeing it if the count reaches 0.
- *
- * @param pending the pending call object
- */
-void
-dbus_pending_call_unref (DBusPendingCall *pending)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_if_fail (pending != NULL);
-
- old_refcount = _dbus_atomic_dec (&pending->refcount);
- _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1,
- "unref");
-
- if (old_refcount == 1)
- _dbus_pending_call_last_unref(pending);
-}
-
-/**
- * Sets a notification function to be called when the reply is
- * received or the pending call times out.
- *
- * @param pending the pending call
- * @param function notifier function
- * @param user_data data to pass to notifier function
- * @param free_user_data function to free the user data
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_pending_call_set_notify (DBusPendingCall *pending,
- DBusPendingCallNotifyFunction function,
- void *user_data,
- DBusFreeFunction free_user_data)
-{
- dbus_bool_t ret = FALSE;
-
- _dbus_return_val_if_fail (pending != NULL, FALSE);
-
- CONNECTION_LOCK (pending->connection);
-
- /* could invoke application code! */
- if (!_dbus_pending_call_set_data_unlocked (pending, notify_user_data_slot,
- user_data, free_user_data))
- goto out;
-
- pending->function = function;
- ret = TRUE;
-
-out:
- CONNECTION_UNLOCK (pending->connection);
-
- return ret;
-}
-
-/**
- * Cancels the pending call, such that any reply or error received
- * will just be ignored. Drops the dbus library's internal reference
- * to the #DBusPendingCall so will free the call if nobody else is
- * holding a reference. However you usually get a reference from
- * dbus_connection_send_with_reply() so probably your app owns a ref
- * also.
- *
- * Note that canceling a pending call will <em>not</em> simulate a
- * timed-out call; if a call times out, then a timeout error reply is
- * received. If you cancel the call, no reply is received unless the
- * the reply was already received before you canceled.
- *
- * @param pending the pending call
- */
-void
-dbus_pending_call_cancel (DBusPendingCall *pending)
-{
- _dbus_return_if_fail (pending != NULL);
-
- _dbus_connection_remove_pending_call (pending->connection,
- pending);
-}
-
-/**
- * Checks whether the pending call has received a reply
- * yet, or not.
- *
- * @param pending the pending call
- * @returns #TRUE if a reply has been received
- */
-dbus_bool_t
-dbus_pending_call_get_completed (DBusPendingCall *pending)
-{
- dbus_bool_t completed;
-
- _dbus_return_val_if_fail (pending != NULL, FALSE);
-
- CONNECTION_LOCK (pending->connection);
- completed = pending->completed;
- CONNECTION_UNLOCK (pending->connection);
-
- return completed;
-}
-
-/**
- * Gets the reply, or returns #NULL if none has been received
- * yet. Ownership of the reply message passes to the caller. This
- * function can only be called once per pending call, since the reply
- * message is tranferred to the caller.
- *
- * @param pending the pending call
- * @returns the reply message or #NULL.
- */
-DBusMessage*
-dbus_pending_call_steal_reply (DBusPendingCall *pending)
-{
- DBusMessage *message;
-
- _dbus_return_val_if_fail (pending != NULL, NULL);
- _dbus_return_val_if_fail (pending->completed, NULL);
- _dbus_return_val_if_fail (pending->reply != NULL, NULL);
-
- CONNECTION_LOCK (pending->connection);
-
- message = pending->reply;
- pending->reply = NULL;
-
- CONNECTION_UNLOCK (pending->connection);
-
- _dbus_message_trace_ref (message, -1, -1, "dbus_pending_call_steal_reply");
- return message;
-}
-
-/**
- * Block until the pending call is completed. The blocking is as with
- * dbus_connection_send_with_reply_and_block(); it does not enter the
- * main loop or process other messages, it simply waits for the reply
- * in question.
- *
- * If the pending call is already completed, this function returns
- * immediately.
- *
- * @todo when you start blocking, the timeout is reset, but it should
- * really only use time remaining since the pending call was created.
- * This requires storing timestamps instead of intervals in the timeout
- *
- * @param pending the pending call
- */
-void
-dbus_pending_call_block (DBusPendingCall *pending)
-{
- _dbus_return_if_fail (pending != NULL);
-
- _dbus_connection_block_pending_call (pending);
-}
-
-/**
- * Allocates an integer ID to be used for storing application-specific
- * data on any DBusPendingCall. The allocated ID may then be used
- * with dbus_pending_call_set_data() and dbus_pending_call_get_data().
- * The passed-in slot must be initialized to -1, and is filled in
- * with the slot ID. If the passed-in slot is not -1, it's assumed
- * to be already allocated, and its refcount is incremented.
- *
- * The allocated slot is global, i.e. all DBusPendingCall objects will
- * have a slot with the given integer ID reserved.
- *
- * @param slot_p address of a global variable storing the slot
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p)
-{
- _dbus_return_val_if_fail (slot_p != NULL, FALSE);
-
- return _dbus_data_slot_allocator_alloc (&slot_allocator,
- slot_p);
-}
-
-/**
- * Deallocates a global ID for #DBusPendingCall data slots.
- * dbus_pending_call_get_data() and dbus_pending_call_set_data() may
- * no longer be used with this slot. Existing data stored on existing
- * DBusPendingCall objects will be freed when the #DBusPendingCall is
- * finalized, but may not be retrieved (and may only be replaced if
- * someone else reallocates the slot). When the refcount on the
- * passed-in slot reaches 0, it is set to -1.
- *
- * @param slot_p address storing the slot to deallocate
- */
-void
-dbus_pending_call_free_data_slot (dbus_int32_t *slot_p)
-{
- _dbus_return_if_fail (slot_p != NULL);
- _dbus_return_if_fail (*slot_p >= 0);
-
- _dbus_data_slot_allocator_free (&slot_allocator, slot_p);
-}
-
-/**
- * Stores a pointer on a #DBusPendingCall, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the pending call is finalized. The slot number
- * must have been allocated with dbus_pending_call_allocate_data_slot().
- *
- * @param pending the pending_call
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-dbus_pending_call_set_data (DBusPendingCall *pending,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func)
-{
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (pending != NULL, FALSE);
- _dbus_return_val_if_fail (slot >= 0, FALSE);
-
-
- CONNECTION_LOCK (pending->connection);
- retval = _dbus_pending_call_set_data_unlocked (pending, slot, data, free_data_func);
- CONNECTION_UNLOCK (pending->connection);
- return retval;
-}
-
-/**
- * Retrieves data previously set with dbus_pending_call_set_data().
- * The slot must still be allocated (must not have been freed).
- *
- * @param pending the pending_call
- * @param slot the slot to get data from
- * @returns the data, or #NULL if not found
- */
-void*
-dbus_pending_call_get_data (DBusPendingCall *pending,
- dbus_int32_t slot)
-{
- void *res;
-
- _dbus_return_val_if_fail (pending != NULL, NULL);
-
- CONNECTION_LOCK (pending->connection);
- res = _dbus_data_slot_list_get (&slot_allocator,
- &pending->slot_list,
- slot);
- CONNECTION_UNLOCK (pending->connection);
-
- return res;
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.h
deleted file mode 100644
index 8a37ec0a5e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pending-call.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pending-call.h Object representing a call in progress.
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_PENDING_CALL_H
-#define DBUS_PENDING_CALL_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-connection.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusPendingCall
- * @{
- */
-
-#define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
-#define DBUS_TIMEOUT_USE_DEFAULT (-1)
-
-DBUS_EXPORT
-DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
-DBUS_EXPORT
-void dbus_pending_call_unref (DBusPendingCall *pending);
-DBUS_EXPORT
-dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending,
- DBusPendingCallNotifyFunction function,
- void *user_data,
- DBusFreeFunction free_user_data);
-DBUS_EXPORT
-void dbus_pending_call_cancel (DBusPendingCall *pending);
-DBUS_EXPORT
-dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending);
-DBUS_EXPORT
-DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending);
-DBUS_EXPORT
-void dbus_pending_call_block (DBusPendingCall *pending);
-
-DBUS_EXPORT
-dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending,
- dbus_int32_t slot,
- void *data,
- DBusFreeFunction free_data_func);
-DBUS_EXPORT
-void* dbus_pending_call_get_data (DBusPendingCall *pending,
- dbus_int32_t slot);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_PENDING_CALL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-unix.c
deleted file mode 100644
index cfc570444d..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-unix.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pipe-unix.c unix related pipe implementation
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-internals.h"
-#include "dbus-pipe.h"
-#include "dbus-sysdeps-unix.h"
-
-#include <errno.h>
-
-/**
- * write data to a pipe.
- *
- * @param pipe the pipe instance
- * @param buffer the buffer to write data from
- * @param start the first byte in the buffer to write
- * @param len the number of bytes to try to write
- * @param error error return
- * @returns the number of bytes written or -1 on error
- */
-int
-_dbus_pipe_write (DBusPipe *pipe,
- const DBusString *buffer,
- int start,
- int len,
- DBusError *error)
-{
- int written;
-
- written = _dbus_write (pipe->fd, buffer, start, len);
- if (written < 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Writing to pipe: %s\n",
- _dbus_strerror (errno));
- }
- return written;
-}
-
-/**
- * close a pipe.
- *
- * @param pipe the pipe instance
- * @param error return location for an error
- * @returns -1 if error is set
- */
-int
-_dbus_pipe_close (DBusPipe *pipe,
- DBusError *error)
-{
- if (!_dbus_close (pipe->fd, error))
- {
- return -1;
- }
- else
- {
- _dbus_pipe_invalidate (pipe);
- return 0;
- }
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-win.c
deleted file mode 100644
index 9c7c25708f..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe-win.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pipe-win.c windows related pipe implementation
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-internals.h"
-#include "dbus-pipe.h"
-
-#include <windows.h>
-#include <io.h>
-
-/**
- * write data to a pipe.
- *
- * @param pipe the pipe instance
- * @param buffer the buffer to write data from
- * @param start the first byte in the buffer to write
- * @param len the number of bytes to try to write
- * @param error error return
- * @returns the number of bytes written or -1 on error
- */
-int
-_dbus_pipe_write (DBusPipe *pipe,
- const DBusString *buffer,
- int start,
- int len,
- DBusError *error)
-{
- const char *buffer_c = _dbus_string_get_const_data (buffer);
- int written;
-
- written = _write (pipe->fd, buffer_c + start, len);
-
- if (written >= 0)
- return written;
-
- dbus_set_error (error, _dbus_error_from_system_errno (),
- "Writing to pipe: %s",
- _dbus_strerror_from_errno ());
- return -1;
-}
-
-/**
- * close a pipe.
- *
- * @param pipe the pipe instance
- * @param error return location for an error
- * @returns #FALSE if error is set
- */
-int
-_dbus_pipe_close (DBusPipe *pipe,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (_close (pipe->fd) != 0)
- {
- dbus_set_error (error, _dbus_error_from_system_errno (),
- "Could not close pipe fd %d: %s", pipe->fd,
- _dbus_strerror_from_errno ());
- return -1;
- }
- else
- {
- _dbus_pipe_invalidate (pipe);
- return 0;
- }
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.c
deleted file mode 100644
index 7b5fe6d456..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-pipe.c pipe implementation (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-pipe.h"
-
-/*
- * init a pipe instance.
- *
- * @param pipe the pipe
- * @param fd the file descriptor to init from
- */
-void
-_dbus_pipe_init (DBusPipe *pipe,
- int fd)
-{
- pipe->fd = fd;
-}
-
-/**
- * init a pipe with stdout
- *
- * @param pipe the pipe
- */
-void
-_dbus_pipe_init_stdout (DBusPipe *pipe)
-{
- _dbus_pipe_init (pipe, 1);
-}
-
-/**
- * check if a pipe is valid; pipes can be set invalid, similar to
- * a -1 file descriptor.
- *
- * @param pipe the pipe instance
- * @returns #FALSE if pipe is not valid
- */
-dbus_bool_t
-_dbus_pipe_is_valid(DBusPipe *pipe)
-{
- return pipe->fd >= 0;
-}
-
-/**
- * Check if a pipe is stdout or stderr.
- *
- * @param pipe the pipe instance
- * @returns #TRUE if pipe is one of the standard out/err channels
- */
-dbus_bool_t
-_dbus_pipe_is_stdout_or_stderr (DBusPipe *pipe)
-{
- return pipe->fd == 1 || pipe->fd == 2;
-}
-
-/**
- * Initializes a pipe to an invalid value.
- * @param pipe the pipe
- */
-void
-_dbus_pipe_invalidate (DBusPipe *pipe)
-{
- pipe->fd = -1;
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.h
deleted file mode 100644
index c2063b5ab8..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-pipe.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.h Wrappers around system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_PIPE_H
-#define DBUS_PIPE_H
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-
-struct DBusPipe {
- int fd;
-};
-
-void _dbus_pipe_init (DBusPipe *pipe,
- int fd);
-void _dbus_pipe_init_stdout (DBusPipe *pipe);
-int _dbus_pipe_write (DBusPipe *pipe,
- const DBusString *buffer,
- int start,
- int len,
- DBusError *error);
-int _dbus_pipe_close (DBusPipe *pipe,
- DBusError *error);
-dbus_bool_t _dbus_pipe_is_valid (DBusPipe *pipe);
-void _dbus_pipe_invalidate (DBusPipe *pipe);
-dbus_bool_t _dbus_pipe_is_stdout_or_stderr (DBusPipe *pipe);
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-protocol.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-protocol.h
deleted file mode 100644
index 60605ab293..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-protocol.h
+++ /dev/null
@@ -1,470 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-protocol.h D-Bus protocol constants
- *
- * Copyright (C) 2002, 2003 CodeFactory AB
- * Copyright (C) 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_PROTOCOL_H
-#define DBUS_PROTOCOL_H
-
-/* Don't include anything in here from anywhere else. It's
- * intended for use by any random library.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* avoids confusing emacs indentation */
-#endif
-#endif
-
-/* Normally docs are in .c files, but there isn't a .c file for this. */
-/**
- * @defgroup DBusProtocol Protocol constants
- * @ingroup DBus
- *
- * @brief Defines constants which are part of the D-Bus protocol
- *
- * This header is intended for use by any library, not only libdbus.
- *
- * @{
- */
-
-
-/* Message byte order */
-#define DBUS_LITTLE_ENDIAN ('l') /**< Code marking LSB-first byte order in the wire protocol. */
-#define DBUS_BIG_ENDIAN ('B') /**< Code marking MSB-first byte order in the wire protocol. */
-
-/** Protocol version. */
-#define DBUS_MAJOR_PROTOCOL_VERSION 1
-
-/** Type code that is never equal to a legitimate type code */
-#define DBUS_TYPE_INVALID ((int) '\0')
-/** #DBUS_TYPE_INVALID as a string literal instead of a int literal */
-#define DBUS_TYPE_INVALID_AS_STRING "\0"
-
-/* Primitive types */
-/** Type code marking an 8-bit unsigned integer */
-#define DBUS_TYPE_BYTE ((int) 'y')
-/** #DBUS_TYPE_BYTE as a string literal instead of a int literal */
-#define DBUS_TYPE_BYTE_AS_STRING "y"
-/** Type code marking a boolean */
-#define DBUS_TYPE_BOOLEAN ((int) 'b')
-/** #DBUS_TYPE_BOOLEAN as a string literal instead of a int literal */
-#define DBUS_TYPE_BOOLEAN_AS_STRING "b"
-/** Type code marking a 16-bit signed integer */
-#define DBUS_TYPE_INT16 ((int) 'n')
-/** #DBUS_TYPE_INT16 as a string literal instead of a int literal */
-#define DBUS_TYPE_INT16_AS_STRING "n"
-/** Type code marking a 16-bit unsigned integer */
-#define DBUS_TYPE_UINT16 ((int) 'q')
-/** #DBUS_TYPE_UINT16 as a string literal instead of a int literal */
-#define DBUS_TYPE_UINT16_AS_STRING "q"
-/** Type code marking a 32-bit signed integer */
-#define DBUS_TYPE_INT32 ((int) 'i')
-/** #DBUS_TYPE_INT32 as a string literal instead of a int literal */
-#define DBUS_TYPE_INT32_AS_STRING "i"
-/** Type code marking a 32-bit unsigned integer */
-#define DBUS_TYPE_UINT32 ((int) 'u')
-/** #DBUS_TYPE_UINT32 as a string literal instead of a int literal */
-#define DBUS_TYPE_UINT32_AS_STRING "u"
-/** Type code marking a 64-bit signed integer */
-#define DBUS_TYPE_INT64 ((int) 'x')
-/** #DBUS_TYPE_INT64 as a string literal instead of a int literal */
-#define DBUS_TYPE_INT64_AS_STRING "x"
-/** Type code marking a 64-bit unsigned integer */
-#define DBUS_TYPE_UINT64 ((int) 't')
-/** #DBUS_TYPE_UINT64 as a string literal instead of a int literal */
-#define DBUS_TYPE_UINT64_AS_STRING "t"
-/** Type code marking an 8-byte double in IEEE 754 format */
-#define DBUS_TYPE_DOUBLE ((int) 'd')
-/** #DBUS_TYPE_DOUBLE as a string literal instead of a int literal */
-#define DBUS_TYPE_DOUBLE_AS_STRING "d"
-/** Type code marking a UTF-8 encoded, nul-terminated Unicode string */
-#define DBUS_TYPE_STRING ((int) 's')
-/** #DBUS_TYPE_STRING as a string literal instead of a int literal */
-#define DBUS_TYPE_STRING_AS_STRING "s"
-/** Type code marking a D-Bus object path */
-#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
-/** #DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal */
-#define DBUS_TYPE_OBJECT_PATH_AS_STRING "o"
-/** Type code marking a D-Bus type signature */
-#define DBUS_TYPE_SIGNATURE ((int) 'g')
-/** #DBUS_TYPE_SIGNATURE as a string literal instead of a int literal */
-#define DBUS_TYPE_SIGNATURE_AS_STRING "g"
-/** Type code marking a unix file descriptor */
-#define DBUS_TYPE_UNIX_FD ((int) 'h')
-/** #DBUS_TYPE_UNIX_FD as a string literal instead of a int literal */
-#define DBUS_TYPE_UNIX_FD_AS_STRING "h"
-
-/* Compound types */
-/** Type code marking a D-Bus array type */
-#define DBUS_TYPE_ARRAY ((int) 'a')
-/** #DBUS_TYPE_ARRAY as a string literal instead of a int literal */
-#define DBUS_TYPE_ARRAY_AS_STRING "a"
-/** Type code marking a D-Bus variant type */
-#define DBUS_TYPE_VARIANT ((int) 'v')
-/** #DBUS_TYPE_VARIANT as a string literal instead of a int literal */
-#define DBUS_TYPE_VARIANT_AS_STRING "v"
-
-/** STRUCT and DICT_ENTRY are sort of special since their codes can't
- * appear in a type string, instead
- * DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
- */
-/** Type code used to represent a struct; however, this type code does not appear
- * in type signatures, instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR will
- * appear in a signature.
- */
-#define DBUS_TYPE_STRUCT ((int) 'r')
-/** #DBUS_TYPE_STRUCT as a string literal instead of a int literal */
-#define DBUS_TYPE_STRUCT_AS_STRING "r"
-/** Type code used to represent a dict entry; however, this type code does not appear
- * in type signatures, instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR will
- * appear in a signature.
- */
-#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
-/** #DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal */
-#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
-
-/** Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR, #DBUS_STRUCT_END_CHAR,
- * #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR - i.e. it is the number of
- * valid types, not the number of distinct characters that may appear in a type signature.
- */
-#define DBUS_NUMBER_OF_TYPES (16)
-
-/* characters other than typecodes that appear in type signatures */
-
-/** Code marking the start of a struct type in a type signature */
-#define DBUS_STRUCT_BEGIN_CHAR ((int) '(')
-/** #DBUS_STRUCT_BEGIN_CHAR as a string literal instead of a int literal */
-#define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "("
-/** Code marking the end of a struct type in a type signature */
-#define DBUS_STRUCT_END_CHAR ((int) ')')
-/** #DBUS_STRUCT_END_CHAR a string literal instead of a int literal */
-#define DBUS_STRUCT_END_CHAR_AS_STRING ")"
-/** Code marking the start of a dict entry type in a type signature */
-#define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{')
-/** #DBUS_DICT_ENTRY_BEGIN_CHAR as a string literal instead of a int literal */
-#define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
-/** Code marking the end of a dict entry type in a type signature */
-#define DBUS_DICT_ENTRY_END_CHAR ((int) '}')
-/** #DBUS_DICT_ENTRY_END_CHAR as a string literal instead of a int literal */
-#define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}"
-
-/** Max length in bytes of a bus name, interface, or member (not object
- * path, paths are unlimited). This is limited because lots of stuff
- * is O(n) in this number, plus it would be obnoxious to type in a
- * paragraph-long method name so most likely something like that would
- * be an exploit.
- */
-#define DBUS_MAXIMUM_NAME_LENGTH 255
-
-/** This one is 255 so it fits in a byte */
-#define DBUS_MAXIMUM_SIGNATURE_LENGTH 255
-
-/** Max length of a match rule string; to keep people from hosing the
- * daemon with some huge rule
- */
-#define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024
-
-/** Max arg number you can match on in a match rule, e.g.
- * arg0='hello' is OK, arg3489720987='hello' is not
- */
-#define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63
-
-/** Max length of a marshaled array in bytes (64M, 2^26) We use signed
- * int for lengths so must be INT_MAX or less. We need something a
- * bit smaller than INT_MAX because the array is inside a message with
- * header info, etc. so an INT_MAX array wouldn't allow the message
- * overhead. The 64M number is an attempt at a larger number than
- * we'd reasonably ever use, but small enough that your bus would chew
- * through it fairly quickly without locking up forever. If you have
- * data that's likely to be larger than this, you should probably be
- * sending it in multiple incremental messages anyhow.
- */
-#define DBUS_MAXIMUM_ARRAY_LENGTH (67108864)
-/** Number of bits you need in an unsigned to store the max array size */
-#define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26
-
-/** The maximum total message size including header and body; similar
- * rationale to max array size.
- */
-#define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2)
-/** Number of bits you need in an unsigned to store the max message size */
-#define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27
-
-/** The maximum total number of unix fds in a message. Similar
- * rationale as DBUS_MAXIMUM_MESSAGE_LENGTH. However we divide by four
- * given that one fd is an int and hence at least 32 bits.
- */
-#define DBUS_MAXIMUM_MESSAGE_UNIX_FDS (DBUS_MAXIMUM_MESSAGE_LENGTH/4)
-/** Number of bits you need in an unsigned to store the max message unix fds */
-#define DBUS_MAXIMUM_MESSAGE_UNIX_FDS_BITS (DBUS_MAXIMUM_MESSAGE_LENGTH_BITS-2)
-
-/** Depth of recursion in the type tree. This is automatically limited
- * to DBUS_MAXIMUM_SIGNATURE_LENGTH since you could only have an array
- * of array of array of ... that fit in the max signature. But that's
- * probably a bit too large.
- */
-#define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32
-
-/* Types of message */
-
-/** This value is never a valid message type, see dbus_message_get_type() */
-#define DBUS_MESSAGE_TYPE_INVALID 0
-/** Message type of a method call message, see dbus_message_get_type() */
-#define DBUS_MESSAGE_TYPE_METHOD_CALL 1
-/** Message type of a method return message, see dbus_message_get_type() */
-#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
-/** Message type of an error reply message, see dbus_message_get_type() */
-#define DBUS_MESSAGE_TYPE_ERROR 3
-/** Message type of a signal message, see dbus_message_get_type() */
-#define DBUS_MESSAGE_TYPE_SIGNAL 4
-
-#define DBUS_NUM_MESSAGE_TYPES 5
-
-/* Header flags */
-
-/** If set, this flag means that the sender of a message does not care about getting
- * a reply, so the recipient need not send one. See dbus_message_set_no_reply().
- */
-#define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1
-/**
- * If set, this flag means that even if the message bus knows how to start an owner for
- * the destination bus name (see dbus_message_set_destination()), it should not
- * do so. If this flag is not set, the bus may launch a program to process the
- * message.
- */
-#define DBUS_HEADER_FLAG_NO_AUTO_START 0x2
-
-/* Header fields */
-
-/** Not equal to any valid header field code */
-#define DBUS_HEADER_FIELD_INVALID 0
-/** Header field code for the path - the path is the object emitting a signal or the object receiving a method call.
- * See dbus_message_set_path().
- */
-#define DBUS_HEADER_FIELD_PATH 1
-/** Header field code for the interface containing a member (method or signal).
- * See dbus_message_set_interface().
- */
-#define DBUS_HEADER_FIELD_INTERFACE 2
-/** Header field code for a member (method or signal). See dbus_message_set_member(). */
-#define DBUS_HEADER_FIELD_MEMBER 3
-/** Header field code for an error name (found in #DBUS_MESSAGE_TYPE_ERROR messages).
- * See dbus_message_set_error_name().
- */
-#define DBUS_HEADER_FIELD_ERROR_NAME 4
-/** Header field code for a reply serial, used to match a #DBUS_MESSAGE_TYPE_METHOD_RETURN message with the
- * message that it's a reply to. See dbus_message_set_reply_serial().
- */
-#define DBUS_HEADER_FIELD_REPLY_SERIAL 5
-/**
- * Header field code for the destination bus name of a message. See dbus_message_set_destination().
- */
-#define DBUS_HEADER_FIELD_DESTINATION 6
-/**
- * Header field code for the sender of a message; usually initialized by the message bus.
- * See dbus_message_set_sender().
- */
-#define DBUS_HEADER_FIELD_SENDER 7
-/**
- * Header field code for the type signature of a message.
- */
-#define DBUS_HEADER_FIELD_SIGNATURE 8
-/**
- * Header field code for the number of unix file descriptors associated
- * with this message.
- */
-#define DBUS_HEADER_FIELD_UNIX_FDS 9
-
-
-/**
- * Value of the highest-numbered header field code, can be used to determine
- * the size of an array indexed by header field code. Remember though
- * that unknown codes must be ignored, so check for that before
- * indexing the array.
- */
-#define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_UNIX_FDS
-
-/** Header format is defined as a signature:
- * byte byte order
- * byte message type ID
- * byte flags
- * byte protocol version
- * uint32 body length
- * uint32 serial
- * array of struct (byte,variant) (field name, value)
- *
- * The length of the header can be computed as the
- * fixed size of the initial data, plus the length of
- * the array at the end, plus padding to an 8-boundary.
- */
-#define DBUS_HEADER_SIGNATURE \
- DBUS_TYPE_BYTE_AS_STRING \
- DBUS_TYPE_BYTE_AS_STRING \
- DBUS_TYPE_BYTE_AS_STRING \
- DBUS_TYPE_BYTE_AS_STRING \
- DBUS_TYPE_UINT32_AS_STRING \
- DBUS_TYPE_UINT32_AS_STRING \
- DBUS_TYPE_ARRAY_AS_STRING \
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
- DBUS_TYPE_BYTE_AS_STRING \
- DBUS_TYPE_VARIANT_AS_STRING \
- DBUS_STRUCT_END_CHAR_AS_STRING
-
-
-/**
- * The smallest header size that can occur. (It won't be valid due to
- * missing required header fields.) This is 4 bytes, two uint32, an
- * array length. This isn't any kind of resource limit, just the
- * necessary/logical outcome of the header signature.
- */
-#define DBUS_MINIMUM_HEADER_SIZE 16
-
-/* Errors */
-/* WARNING these get autoconverted to an enum in dbus-glib.h. Thus,
- * if you change the order it breaks the ABI. Keep them in order.
- * Also, don't change the formatting since that will break the sed
- * script.
- */
-/** A generic error; "something went wrong" - see the error message for more. */
-#define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed"
-/** There was not enough memory to complete an operation. */
-#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
-/** The bus doesn't know how to launch a service to supply the bus name you wanted. */
-#define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown"
-/** The bus name you referenced doesn't exist (i.e. no application owns it). */
-#define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner"
-/** No reply to a message expecting one, usually means a timeout occurred. */
-#define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply"
-/** Something went wrong reading or writing to a socket, for example. */
-#define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError"
-/** A D-Bus bus address was malformed. */
-#define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress"
-/** Requested operation isn't supported (like ENOSYS on UNIX). */
-#define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported"
-/** Some limited resource is exhausted. */
-#define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded"
-/** Security restrictions don't allow doing what you're trying to do. */
-#define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied"
-/** Authentication didn't work. */
-#define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed"
-/** Unable to connect to server (probably caused by ECONNREFUSED on a socket). */
-#define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer"
-/** Certain timeout errors, possibly ETIMEDOUT on a socket.
- * Note that #DBUS_ERROR_NO_REPLY is used for message reply timeouts.
- * @warning this is confusingly-named given that #DBUS_ERROR_TIMED_OUT also exists. We can't fix
- * it for compatibility reasons so just be careful.
- */
-#define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout"
-/** No network access (probably ENETUNREACH on a socket). */
-#define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork"
-/** Can't bind a socket since its address is in use (i.e. EADDRINUSE). */
-#define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse"
-/** The connection is disconnected and you're trying to use it. */
-#define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected"
-/** Invalid arguments passed to a method call. */
-#define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs"
-/** Missing file. */
-#define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound"
-/** Existing file and the operation you're using does not silently overwrite. */
-#define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists"
-/** Method name you invoked isn't known by the object you invoked it on. */
-#define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod"
-/** Object you invoked a method on isn't known. */
-#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
-/** Interface you invoked a method on isn't known by the object. */
-#define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface"
-/** Property you tried to access isn't known by the object. */
-#define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty"
-/** Property you tried to set is read-only. */
-#define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly"
-/** Certain timeout errors, e.g. while starting a service.
- * @warning this is confusingly-named given that #DBUS_ERROR_TIMEOUT also exists. We can't fix
- * it for compatibility reasons so just be careful.
- */
-#define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut"
-/** Tried to remove or modify a match rule that didn't exist. */
-#define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound"
-/** The match rule isn't syntactically valid. */
-#define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid"
-/** While starting a new process, the exec() call failed. */
-#define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed"
-/** While starting a new process, the fork() call failed. */
-#define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed"
-/** While starting a new process, the child exited with a status code. */
-#define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited"
-/** While starting a new process, the child exited on a signal. */
-#define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled"
-/** While starting a new process, something went wrong. */
-#define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed"
-/** We failed to setup the environment correctly. */
-#define DBUS_ERROR_SPAWN_SETUP_FAILED "org.freedesktop.DBus.Error.Spawn.FailedToSetup"
-/** We failed to setup the config parser correctly. */
-#define DBUS_ERROR_SPAWN_CONFIG_INVALID "org.freedesktop.DBus.Error.Spawn.ConfigInvalid"
-/** Bus name was not valid. */
-#define DBUS_ERROR_SPAWN_SERVICE_INVALID "org.freedesktop.DBus.Error.Spawn.ServiceNotValid"
-/** Service file not found in system-services directory. */
-#define DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND "org.freedesktop.DBus.Error.Spawn.ServiceNotFound"
-/** Permissions are incorrect on the setuid helper. */
-#define DBUS_ERROR_SPAWN_PERMISSIONS_INVALID "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid"
-/** Service file invalid (Name, User or Exec missing). */
-#define DBUS_ERROR_SPAWN_FILE_INVALID "org.freedesktop.DBus.Error.Spawn.FileInvalid"
-/** Tried to get a UNIX process ID and it wasn't available. */
-#define DBUS_ERROR_SPAWN_NO_MEMORY "org.freedesktop.DBus.Error.Spawn.NoMemory"
-/** Tried to get a UNIX process ID and it wasn't available. */
-#define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
-/** A type signature is not valid. */
-#define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature"
-/** A file contains invalid syntax or is otherwise broken. */
-#define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent"
-/** Asked for SELinux security context and it wasn't available. */
-#define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"
-/** Asked for ADT audit data and it wasn't available. */
-#define DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN "org.freedesktop.DBus.Error.AdtAuditDataUnknown"
-/** There's already an object with the requested object path. */
-#define DBUS_ERROR_OBJECT_PATH_IN_USE "org.freedesktop.DBus.Error.ObjectPathInUse"
-/** The message meta data does not match the payload. e.g. expected
- number of file descriptors were not sent over the socket this message was received on. */
-#define DBUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error.InconsistentMessage"
-
-/* XML introspection format */
-
-/** XML namespace of the introspection format version 1.0 */
-#define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus"
-/** XML public identifier of the introspection format version 1.0 */
-#define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
-/** XML system identifier of the introspection format version 1.0 */
-#define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
-/** XML document type declaration of the introspection format version 1.0 */
-#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
-
-/** @} */
-
-#ifdef __cplusplus
-#if 0
-{ /* avoids confusing emacs indentation */
-#endif
-}
-#endif
-
-#endif /* DBUS_PROTOCOL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.c
deleted file mode 100644
index 80fb55b2fa..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-resources.c Resource tracking/limits
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-resources.h>
-#include <dbus/dbus-internals.h>
-
-/**
- * @defgroup DBusResources Resource limits related code
- * @ingroup DBusInternals
- * @brief DBusCounter and other stuff related to resource limits
- *
- * Types and functions related to tracking resource limits,
- * such as the maximum amount of memory/unix fds a connection can use
- * for messages, etc.
- */
-
-/**
- * @defgroup DBusResourcesInternals Resource limits implementation details
- * @ingroup DBusInternals
- * @brief Resource limits implementation details
- *
- * Implementation details of resource limits code.
- *
- * @{
- */
-
-/**
- * @brief Internals of DBusCounter.
- *
- * DBusCounter internals. DBusCounter is an opaque object, it must be
- * used via accessor functions.
- */
-struct DBusCounter
-{
- int refcount; /**< reference count */
-
- long size_value; /**< current size counter value */
- long unix_fd_value; /**< current unix fd counter value */
-
-#ifdef DBUS_ENABLE_STATS
- long peak_size_value; /**< largest ever size counter value */
- long peak_unix_fd_value; /**< largest ever unix fd counter value */
-#endif
-
- long notify_size_guard_value; /**< call notify function when crossing this size value */
- long notify_unix_fd_guard_value; /**< call notify function when crossing this unix fd value */
-
- DBusCounterNotifyFunction notify_function; /**< notify function */
- void *notify_data; /**< data for notify function */
- dbus_bool_t notify_pending : 1; /**< TRUE if the guard value has been crossed */
-};
-
-/** @} */ /* end of resource limits internals docs */
-
-/**
- * @addtogroup DBusResources
- * @{
- */
-
-/**
- * Creates a new DBusCounter. DBusCounter is used
- * to count usage of some resource such as memory.
- *
- * @returns new counter or #NULL on failure
- */
-DBusCounter*
-_dbus_counter_new (void)
-{
- DBusCounter *counter;
-
- counter = dbus_new0 (DBusCounter, 1);
- if (counter == NULL)
- return NULL;
-
- counter->refcount = 1;
-
- return counter;
-}
-
-/**
- * Increments refcount of the counter
- *
- * @param counter the counter
- * @returns the counter
- */
-DBusCounter *
-_dbus_counter_ref (DBusCounter *counter)
-{
- _dbus_assert (counter->refcount > 0);
-
- counter->refcount += 1;
-
- return counter;
-}
-
-/**
- * Decrements refcount of the counter and possibly
- * finalizes the counter.
- *
- * @param counter the counter
- */
-void
-_dbus_counter_unref (DBusCounter *counter)
-{
- _dbus_assert (counter->refcount > 0);
-
- counter->refcount -= 1;
-
- if (counter->refcount == 0)
- {
-
- dbus_free (counter);
- }
-}
-
-/**
- * Adjusts the value of the size counter by the given
- * delta which may be positive or negative.
- *
- * This function may be called with locks held. After calling it, when
- * any relevant locks are no longer held you must call _dbus_counter_notify().
- *
- * @param counter the counter
- * @param delta value to add to the size counter's current value
- */
-void
-_dbus_counter_adjust_size (DBusCounter *counter,
- long delta)
-{
- long old = counter->size_value;
-
- counter->size_value += delta;
-
-#ifdef DBUS_ENABLE_STATS
- if (counter->peak_size_value < counter->size_value)
- counter->peak_size_value = counter->size_value;
-#endif
-
-#if 0
- _dbus_verbose ("Adjusting counter %ld by %ld = %ld\n",
- old, delta, counter->size_value);
-#endif
-
- if (counter->notify_function != NULL &&
- ((old < counter->notify_size_guard_value &&
- counter->size_value >= counter->notify_size_guard_value) ||
- (old >= counter->notify_size_guard_value &&
- counter->size_value < counter->notify_size_guard_value)))
- counter->notify_pending = TRUE;
-}
-
-/**
- * Calls the notify function from _dbus_counter_set_notify(),
- * if that function has been specified and the counter has crossed the
- * guard value (in either direction) since the last call to this function.
- *
- * This function must not be called with locks held, since it can call out
- * to user code.
- */
-void
-_dbus_counter_notify (DBusCounter *counter)
-{
- if (counter->notify_pending)
- {
- counter->notify_pending = FALSE;
- (* counter->notify_function) (counter, counter->notify_data);
- }
-}
-
-/**
- * Adjusts the value of the unix fd counter by the given
- * delta which may be positive or negative.
- *
- * This function may be called with locks held. After calling it, when
- * any relevant locks are no longer held you must call _dbus_counter_notify().
- *
- * @param counter the counter
- * @param delta value to add to the unix fds counter's current value
- */
-void
-_dbus_counter_adjust_unix_fd (DBusCounter *counter,
- long delta)
-{
- long old = counter->unix_fd_value;
-
- counter->unix_fd_value += delta;
-
-#ifdef DBUS_ENABLE_STATS
- if (counter->peak_unix_fd_value < counter->unix_fd_value)
- counter->peak_unix_fd_value = counter->unix_fd_value;
-#endif
-
-#if 0
- _dbus_verbose ("Adjusting counter %ld by %ld = %ld\n",
- old, delta, counter->unix_fd_value);
-#endif
-
- if (counter->notify_function != NULL &&
- ((old < counter->notify_unix_fd_guard_value &&
- counter->unix_fd_value >= counter->notify_unix_fd_guard_value) ||
- (old >= counter->notify_unix_fd_guard_value &&
- counter->unix_fd_value < counter->notify_unix_fd_guard_value)))
- counter->notify_pending = TRUE;
-}
-
-/**
- * Gets the current value of the size counter.
- *
- * @param counter the counter
- * @returns its current size value
- */
-long
-_dbus_counter_get_size_value (DBusCounter *counter)
-{
- return counter->size_value;
-}
-
-/**
- * Gets the current value of the unix fd counter.
- *
- * @param counter the counter
- * @returns its current unix fd value
- */
-long
-_dbus_counter_get_unix_fd_value (DBusCounter *counter)
-{
- return counter->unix_fd_value;
-}
-
-/**
- * Sets the notify function for this counter; the notify function is
- * called whenever the counter's values cross the guard values in
- * either direction (moving up, or moving down).
- *
- * @param counter the counter
- * @param size_guard_value the value we're notified if the size counter crosses
- * @param unix_fd_guard_value the value we're notified if the unix fd counter crosses
- * @param function function to call in order to notify
- * @param user_data data to pass to the function
- */
-void
-_dbus_counter_set_notify (DBusCounter *counter,
- long size_guard_value,
- long unix_fd_guard_value,
- DBusCounterNotifyFunction function,
- void *user_data)
-{
- counter->notify_size_guard_value = size_guard_value;
- counter->notify_unix_fd_guard_value = unix_fd_guard_value;
- counter->notify_function = function;
- counter->notify_data = user_data;
- counter->notify_pending = FALSE;
-}
-
-#ifdef DBUS_ENABLE_STATS
-long
-_dbus_counter_get_peak_size_value (DBusCounter *counter)
-{
- return counter->peak_size_value;
-}
-
-long
-_dbus_counter_get_peak_unix_fd_value (DBusCounter *counter)
-{
- return counter->peak_unix_fd_value;
-}
-#endif
-
-/** @} */ /* end of resource limits exported API */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.h
deleted file mode 100644
index 781a5756c8..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-resources.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-resources.h Resource tracking/limits
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_RESOURCES_H
-#define DBUS_RESOURCES_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-connection.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusCounter DBusCounter;
-
-typedef void (* DBusCounterNotifyFunction) (DBusCounter *counter,
- void *user_data);
-
-DBusCounter* _dbus_counter_new (void);
-DBusCounter* _dbus_counter_ref (DBusCounter *counter);
-void _dbus_counter_unref (DBusCounter *counter);
-
-void _dbus_counter_adjust_size (DBusCounter *counter,
- long delta);
-void _dbus_counter_adjust_unix_fd (DBusCounter *counter,
- long delta);
-void _dbus_counter_notify (DBusCounter *counter);
-long _dbus_counter_get_size_value (DBusCounter *counter);
-long _dbus_counter_get_unix_fd_value (DBusCounter *counter);
-
-void _dbus_counter_set_notify (DBusCounter *counter,
- long size_guard_value,
- long unix_fd_guard_value,
- DBusCounterNotifyFunction function,
- void *user_data);
-
-/* if DBUS_ENABLE_STATS */
-long _dbus_counter_get_peak_size_value (DBusCounter *counter);
-long _dbus_counter_get_peak_unix_fd_value (DBusCounter *counter);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_RESOURCES_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.c
deleted file mode 100644
index 8f5ff5fba6..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-debug-pipe.c In-proc debug server implementation
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-server-debug-pipe.h"
-#include "dbus-transport-socket.h"
-#include "dbus-connection-internal.h"
-#include "dbus-hash.h"
-#include "dbus-string.h"
-#include "dbus-protocol.h"
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-/**
- * @defgroup DBusServerDebugPipe DBusServerDebugPipe
- * @ingroup DBusInternals
- * @brief In-process pipe debug server used in unit tests.
- *
- * Types and functions related to DBusServerDebugPipe.
- * This is used for unit testing.
- *
- * @{
- */
-
-/**
- * Opaque object representing a debug server implementation.
- */
-typedef struct DBusServerDebugPipe DBusServerDebugPipe;
-
-/**
- * Implementation details of DBusServerDebugPipe. All members
- * are private.
- */
-struct DBusServerDebugPipe
-{
- DBusServer base; /**< Parent class members. */
-
- char *name; /**< Server name. */
-
- dbus_bool_t disconnected; /**< TRUE if disconnect has been called */
-};
-
-/* FIXME not threadsafe (right now the test suite doesn't use threads anyhow ) */
-static DBusHashTable *server_pipe_hash;
-static int server_pipe_hash_refcount = 0;
-
-static dbus_bool_t
-pipe_hash_ref (void)
-{
- if (!server_pipe_hash)
- {
- _dbus_assert (server_pipe_hash_refcount == 0);
-
- server_pipe_hash = _dbus_hash_table_new (DBUS_HASH_STRING, NULL, NULL);
-
- if (!server_pipe_hash)
- return FALSE;
- }
-
- server_pipe_hash_refcount = 1;
-
- return TRUE;
-}
-
-static void
-pipe_hash_unref (void)
-{
- _dbus_assert (server_pipe_hash != NULL);
- _dbus_assert (server_pipe_hash_refcount > 0);
-
- server_pipe_hash_refcount -= 1;
- if (server_pipe_hash_refcount == 0)
- {
- _dbus_hash_table_unref (server_pipe_hash);
- server_pipe_hash = NULL;
- }
-}
-
-static void
-debug_finalize (DBusServer *server)
-{
- DBusServerDebugPipe *debug_server = (DBusServerDebugPipe*) server;
-
- pipe_hash_unref ();
-
- _dbus_server_finalize_base (server);
-
- dbus_free (debug_server->name);
- dbus_free (server);
-}
-
-static void
-debug_disconnect (DBusServer *server)
-{
- ((DBusServerDebugPipe*)server)->disconnected = TRUE;
-}
-
-static DBusServerVTable debug_vtable = {
- debug_finalize,
- debug_disconnect
-};
-
-/**
- * Creates a new debug server using an in-process pipe
- *
- * @param server_name the name of the server.
- * @param error address where an error can be returned.
- * @returns a new server, or #NULL on failure.
- */
-DBusServer*
-_dbus_server_debug_pipe_new (const char *server_name,
- DBusError *error)
-{
- DBusServerDebugPipe *debug_server;
- DBusString address;
- DBusString name_str;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!pipe_hash_ref ())
- return NULL;
-
- if (_dbus_hash_table_lookup_string (server_pipe_hash, server_name) != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_ADDRESS_IN_USE, NULL);
- pipe_hash_unref ();
- return NULL;
- }
-
- debug_server = dbus_new0 (DBusServerDebugPipe, 1);
- if (debug_server == NULL)
- goto nomem_0;
-
- if (!_dbus_string_init (&address))
- goto nomem_1;
-
- _dbus_string_init_const (&name_str, server_name);
- if (!_dbus_string_append (&address, "debug-pipe:name=") ||
- !_dbus_address_append_escaped (&address, &name_str))
- goto nomem_2;
-
- debug_server->name = _dbus_strdup (server_name);
- if (debug_server->name == NULL)
- goto nomem_2;
-
- if (!_dbus_server_init_base (&debug_server->base,
- &debug_vtable, &address))
- goto nomem_3;
-
- if (!_dbus_hash_table_insert_string (server_pipe_hash,
- debug_server->name,
- debug_server))
- goto nomem_4;
-
- _dbus_string_free (&address);
-
- /* server keeps the pipe hash ref */
-
- _dbus_server_trace_ref (&debug_server->base, 0, 1, "debug_pipe_new");
- return (DBusServer *)debug_server;
-
- nomem_4:
- _dbus_server_finalize_base (&debug_server->base);
- nomem_3:
- dbus_free (debug_server->name);
- nomem_2:
- _dbus_string_free (&address);
- nomem_1:
- dbus_free (debug_server);
- nomem_0:
- pipe_hash_unref ();
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
-}
-
-/**
- * Creates the client-side transport for
- * a debug-pipe connection connected to the
- * given debug-pipe server name.
- *
- * @param server_name name of server to connect to
- * @param error address where an error can be returned.
- * @returns #NULL on no memory or transport
- */
-DBusTransport*
-_dbus_transport_debug_pipe_new (const char *server_name,
- DBusError *error)
-{
- DBusTransport *client_transport;
- DBusTransport *server_transport;
- DBusConnection *connection;
- int client_fd, server_fd;
- DBusServer *server;
- DBusString address;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (server_pipe_hash == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_SERVER, NULL);
- return NULL;
- }
-
- server = _dbus_hash_table_lookup_string (server_pipe_hash,
- server_name);
- if (server == NULL ||
- ((DBusServerDebugPipe*)server)->disconnected)
- {
- dbus_set_error (error, DBUS_ERROR_NO_SERVER, NULL);
- return NULL;
- }
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (!_dbus_string_append (&address, "debug-pipe:name=") ||
- !_dbus_string_append (&address, server_name))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&address);
- return NULL;
- }
-
- if (!_dbus_full_duplex_pipe (&client_fd, &server_fd, FALSE,
- NULL))
- {
- _dbus_verbose ("failed to create full duplex pipe\n");
- dbus_set_error (error, DBUS_ERROR_FAILED, "Could not create full-duplex pipe");
- _dbus_string_free (&address);
- return NULL;
- }
-
- client_transport = _dbus_transport_new_for_socket (client_fd,
- NULL, &address);
- if (client_transport == NULL)
- {
- _dbus_close_socket (client_fd, NULL);
- _dbus_close_socket (server_fd, NULL);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_string_free (&address);
- return NULL;
- }
-
- _dbus_string_free (&address);
-
- client_fd = -1;
-
- server_transport = _dbus_transport_new_for_socket (server_fd,
- &server->guid_hex, NULL);
- if (server_transport == NULL)
- {
- _dbus_transport_unref (client_transport);
- _dbus_close_socket (server_fd, NULL);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- server_fd = -1;
-
- if (!_dbus_transport_set_auth_mechanisms (server_transport,
- (const char**) server->auth_mechanisms))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_transport_unref (server_transport);
- _dbus_transport_unref (client_transport);
- return NULL;
- }
-
- connection = _dbus_connection_new_for_transport (server_transport);
- _dbus_transport_unref (server_transport);
- server_transport = NULL;
-
- if (connection == NULL)
- {
- _dbus_transport_unref (client_transport);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- /* See if someone wants to handle this new connection,
- * self-referencing for paranoia
- */
- if (server->new_connection_function)
- {
- dbus_server_ref (server);
- (* server->new_connection_function) (server, connection,
- server->new_connection_data);
- dbus_server_unref (server);
- }
-
- /* If no one grabbed a reference, the connection will die,
- * and the client transport will get an immediate disconnect
- */
- _dbus_connection_close_if_only_one_ref (connection);
- dbus_connection_unref (connection);
-
- return client_transport;
-}
-
-/**
- * Tries to interpret the address entry as a debug pipe entry.
- *
- * Sets error if the result is not OK.
- *
- * @param entry an address entry
- * @param server_p location to store a new DBusServer, or #NULL on failure.
- * @param error location to store rationale for failure on bad address
- * @returns the outcome
- *
- */
-DBusServerListenResult
-_dbus_server_listen_debug_pipe (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error)
-{
- const char *method;
-
- *server_p = NULL;
-
- method = dbus_address_entry_get_method (entry);
-
- if (strcmp (method, "debug-pipe") == 0)
- {
- const char *name = dbus_address_entry_get_value (entry, "name");
-
- if (name == NULL)
- {
- _dbus_set_bad_address(error, "debug-pipe", "name",
- NULL);
- return DBUS_SERVER_LISTEN_BAD_ADDRESS;
- }
-
- *server_p = _dbus_server_debug_pipe_new (name, error);
-
- if (*server_p)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_OK;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_NOT_HANDLED;
- }
-}
-
-/**
- * Opens a debug pipe transport, used in the test suite.
- *
- * @param entry the address entry to try opening as debug-pipe
- * @param transport_p return location for the opened transport
- * @param error error to be set
- * @returns result of the attempt
- */
-DBusTransportOpenResult
-_dbus_transport_open_debug_pipe (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error)
-{
- const char *method;
-
- method = dbus_address_entry_get_method (entry);
- _dbus_assert (method != NULL);
-
- if (strcmp (method, "debug-pipe") == 0)
- {
- const char *name = dbus_address_entry_get_value (entry, "name");
-
- if (name == NULL)
- {
- _dbus_set_bad_address (error, "debug-pipe", "name",
- NULL);
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- *transport_p = _dbus_transport_debug_pipe_new (name, error);
-
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
- }
-}
-
-
-/** @} */
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.h
deleted file mode 100644
index 4574311dd1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-debug-pipe.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-debug-pipe.h In-proc debug server implementation
- *
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SERVER_DEBUG_PIPE_H
-#define DBUS_SERVER_DEBUG_PIPE_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-server-protected.h>
-#include <dbus/dbus-transport-protected.h>
-
-DBUS_BEGIN_DECLS
-
-DBusServer* _dbus_server_debug_pipe_new (const char *server_name,
- DBusError *error);
-DBusTransport* _dbus_transport_debug_pipe_new (const char *server_name,
- DBusError *error);
-DBusServerListenResult _dbus_server_listen_debug_pipe (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error);
-DBusTransportOpenResult _dbus_transport_open_debug_pipe (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_DEBUG_PIPE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.c
deleted file mode 100644
index 9832875e94..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* dbus-server-launchd.c Server methods for interacting with launchd.
- * Copyright (C) 2007, Tanner Lovelace <lovelace@wayfarer.org>
- * Copyright (C) 2008, Colin Walters <walters@verbum.org>
- * Copyright (C) 2008-2009, Benjamin Reed <rangerrick@befunk.com>
- * Copyright (C) 2009, Jonas Bähr <jonas.baehr@web.de>
- *
- * 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.
- */
-
-#include <config.h>
-#include "dbus-server-launchd.h"
-
-/**
- * @defgroup DBusServerLaunchd DBusServer implementations for Launchd
- * @ingroup DBusInternals
- * @brief Implementation details of DBusServer with Launchd support
- *
- * @{
- */
-
-#ifdef DBUS_ENABLE_LAUNCHD
-#include <launch.h>
-#include <errno.h>
-
-#include "dbus-misc.h"
-#include "dbus-server-socket.h"
-
-/* put other private launchd functions here */
-
-#endif /* DBUS_ENABLE_LAUNCHD */
-
-/**
- * @brief Creates a new server from launchd.
- *
- * launchd has allocaed a socket for us. We now query launchd for the
- * file descriptor of this socket and create a server on it.
- * In addition we inherit launchd's environment which holds a variable
- * containing the path to the socket. This is used to init the server's
- * address which is passed to autolaunched services.
- *
- * @param launchd_env_var the environment variable which holds the unix path to the socket
- * @param error location to store reason for failure.
- * @returns the new server, or #NULL on failure.
- */
-
-DBusServer *
-_dbus_server_new_for_launchd (const char *launchd_env_var, DBusError * error)
- {
-#ifdef DBUS_ENABLE_LAUNCHD
- DBusServer *server;
- DBusString address;
- int launchd_fd;
- launch_data_t sockets_dict, checkin_response;
- launch_data_t checkin_request;
- launch_data_t listening_fd_array, listening_fd;
- launch_data_t environment_dict, environment_param;
- const char *launchd_socket_path, *display;
-
- launchd_socket_path = _dbus_getenv (launchd_env_var);
- display = _dbus_getenv ("DISPLAY");
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (launchd_socket_path == NULL || *launchd_socket_path == '\0')
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "launchd's environment variable %s is empty, but should contain a socket path.\n", launchd_env_var);
- return NULL;
- }
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
- if (!_dbus_string_append (&address, "unix:path="))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto l_failed_0;
- }
- if (!_dbus_string_append (&address, launchd_socket_path))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto l_failed_0;
- }
-
- if ((checkin_request = launch_data_new_string (LAUNCH_KEY_CHECKIN)) == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "launch_data_new_string(\"%s\") Unable to create string.\n",
- LAUNCH_KEY_CHECKIN);
- goto l_failed_0;
- }
-
- if ((checkin_response = launch_msg (checkin_request)) == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR,
- "launch_msg(\"%s\") IPC failure: %s\n",
- LAUNCH_KEY_CHECKIN, strerror (errno));
- goto l_failed_0;
- }
-
- if (LAUNCH_DATA_ERRNO == launch_data_get_type (checkin_response))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED, "Check-in failed: %s\n",
- strerror (launch_data_get_errno (checkin_response)));
- goto l_failed_0;
- }
-
- sockets_dict =
- launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_SOCKETS);
- if (NULL == sockets_dict)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR,
- "No sockets found to answer requests on!\n");
- goto l_failed_0;
- }
-
- listening_fd_array =
- launch_data_dict_lookup (sockets_dict, "unix_domain_listener");
- if (NULL == listening_fd_array)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR,
- "No known sockets found to answer requests on!\n");
- goto l_failed_0;
- }
-
- if (launch_data_array_get_count (listening_fd_array) != 1)
- {
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "Expected 1 socket from launchd, got %d.\n",
- launch_data_array_get_count (listening_fd_array));
- goto l_failed_0;
- }
-
- listening_fd = launch_data_array_get_index (listening_fd_array, 0);
- launchd_fd = launch_data_get_fd (listening_fd);
-
- _dbus_fd_set_close_on_exec (launchd_fd);
-
- if (launchd_fd < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto l_failed_0;
- if (display == NULL || *display == '\0')
- {
- environment_dict = launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_USERENVIRONMENTVARIABLES);
- if (NULL == environment_dict)
- {
- _dbus_warn ("Unable to retrieve user environment from launchd.");
- }
- else
- {
- environment_param = launch_data_dict_lookup (environment_dict, "DISPLAY");
- if (NULL == environment_param)
- {
- _dbus_warn ("Unable to retrieve DISPLAY from launchd.");
- }
- else
- {
- display = launch_data_get_string(environment_param);
- dbus_setenv ("DISPLAY", display);
- }
- }
- }
-
- }
-
- server = _dbus_server_new_for_socket (&launchd_fd, 1, &address, 0);
- if (server == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_SERVER,
- "Unable to listen on launchd fd %d.", launchd_fd);
- goto l_failed_0;
- }
-
- _dbus_string_free (&address);
-
- return server;
-
- l_failed_0:
- _dbus_string_free (&address);
-
- return NULL;
-#else /* DBUS_ENABLE_LAUNCHD */
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "address type 'launchd' requested, but launchd support not compiled in");
- return NULL;
-#endif
- }
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.h
deleted file mode 100644
index 269b91434b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-launchd.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* dbus-server-launchd.h Server methods for interacting with launchd.
-* Copyright (C) 2008, Benjamin Reed <rangerrick@befunk.com>
-*
-* 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.
-*/
-
-#ifndef DBUS_SERVER_LAUNCHD_H
-#define DBUS_SERVER_LAUNCHD_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-server-protected.h>
-
-DBUS_BEGIN_DECLS
-
-DBusServer * _dbus_server_new_for_launchd (const char *launchd_env_var, DBusError * error);
-
-DBUS_END_DECLS
-#endif /* DBUS_SERVER_LAUNCHD_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-protected.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-protected.h
deleted file mode 100644
index dd5234b9b9..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-protected.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-protected.h Used by subclasses of DBusServer object (internal to D-Bus implementation)
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SERVER_PROTECTED_H
-#define DBUS_SERVER_PROTECTED_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-threads-internal.h>
-#include <dbus/dbus-server.h>
-#include <dbus/dbus-address.h>
-#include <dbus/dbus-timeout.h>
-#include <dbus/dbus-watch.h>
-#include <dbus/dbus-resources.h>
-#include <dbus/dbus-dataslot.h>
-#include <dbus/dbus-string.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusServerVTable DBusServerVTable;
-
-/**
- * Virtual table to be implemented by all server "subclasses"
- */
-struct DBusServerVTable
-{
- void (* finalize) (DBusServer *server);
- /**< The finalize method must free the server. */
-
- void (* disconnect) (DBusServer *server);
- /**< Disconnect this server. */
-};
-
-/**
- * @ingroup DBusServerInternals
- * Internals of DBusServer object
- */
-struct DBusServer
-{
- DBusAtomic refcount; /**< Reference count. */
- const DBusServerVTable *vtable; /**< Virtual methods for this instance. */
- DBusRMutex *mutex; /**< Lock on the server object */
-
- DBusGUID guid; /**< Globally unique ID of server */
-
- DBusString guid_hex; /**< Hex-encoded version of GUID */
-
- DBusWatchList *watches; /**< Our watches */
- DBusTimeoutList *timeouts; /**< Our timeouts */
-
- char *address; /**< Address this server is listening on. */
- dbus_bool_t published_address; /**< flag which indicates that server has published its bus address. */
-
- int max_connections; /**< Max number of connections allowed at once. */
-
- DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */
-
- DBusNewConnectionFunction new_connection_function;
- /**< Callback to invoke when a new connection is created. */
- void *new_connection_data;
- /**< Data for new connection callback */
- DBusFreeFunction new_connection_free_data_function;
- /**< Callback to invoke to free new_connection_data
- * when server is finalized or data is replaced.
- */
-
- char **auth_mechanisms; /**< Array of allowed authentication mechanisms */
-
- unsigned int disconnected : 1; /**< TRUE if we are disconnected. */
-
-#ifndef DBUS_DISABLE_CHECKS
- unsigned int have_server_lock : 1; /**< Does someone have the server mutex locked */
-#endif
-};
-
-dbus_bool_t _dbus_server_init_base (DBusServer *server,
- const DBusServerVTable *vtable,
- const DBusString *address);
-void _dbus_server_finalize_base (DBusServer *server);
-dbus_bool_t _dbus_server_add_watch (DBusServer *server,
- DBusWatch *watch);
-void _dbus_server_remove_watch (DBusServer *server,
- DBusWatch *watch);
-void _dbus_server_toggle_watch (DBusServer *server,
- DBusWatch *watch,
- dbus_bool_t enabled);
-dbus_bool_t _dbus_server_add_timeout (DBusServer *server,
- DBusTimeout *timeout);
-void _dbus_server_remove_timeout (DBusServer *server,
- DBusTimeout *timeout);
-void _dbus_server_toggle_timeout (DBusServer *server,
- DBusTimeout *timeout,
- dbus_bool_t enabled);
-
-void _dbus_server_ref_unlocked (DBusServer *server);
-void _dbus_server_unref_unlocked (DBusServer *server);
-
-typedef enum
-{
- DBUS_SERVER_LISTEN_NOT_HANDLED, /**< we aren't in charge of this address type */
- DBUS_SERVER_LISTEN_OK, /**< we set up the listen */
- DBUS_SERVER_LISTEN_BAD_ADDRESS, /**< malformed address */
- DBUS_SERVER_LISTEN_DID_NOT_CONNECT, /**< well-formed address but failed to set it up */
- DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED /**< address is already used */
-} DBusServerListenResult;
-
-DBusServerListenResult _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error);
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-void _dbus_server_trace_ref (DBusServer *server,
- int old_refcount,
- int new_refcount,
- const char *why);
-#else
-#define _dbus_server_trace_ref(s,o,n,w) \
- do \
- {\
- (void) (o); \
- (void) (n); \
- } while (0)
-#endif
-
-#ifdef DBUS_DISABLE_CHECKS
-#define TOOK_LOCK_CHECK(server)
-#define RELEASING_LOCK_CHECK(server)
-#define HAVE_LOCK_CHECK(server)
-#else
-#define TOOK_LOCK_CHECK(server) do { \
- _dbus_assert (!(server)->have_server_lock); \
- (server)->have_server_lock = TRUE; \
- } while (0)
-#define RELEASING_LOCK_CHECK(server) do { \
- _dbus_assert ((server)->have_server_lock); \
- (server)->have_server_lock = FALSE; \
- } while (0)
-#define HAVE_LOCK_CHECK(server) _dbus_assert ((server)->have_server_lock)
-/* A "DO_NOT_HAVE_LOCK_CHECK" is impossible since we need the lock to check the flag */
-#endif
-
-#define TRACE_LOCKS 0
-
-#define SERVER_LOCK(server) do { \
- if (TRACE_LOCKS) { _dbus_verbose ("LOCK\n"); } \
- _dbus_rmutex_lock ((server)->mutex); \
- TOOK_LOCK_CHECK (server); \
- } while (0)
-
-#define SERVER_UNLOCK(server) do { \
- if (TRACE_LOCKS) { _dbus_verbose ("UNLOCK\n"); } \
- RELEASING_LOCK_CHECK (server); \
- _dbus_rmutex_unlock ((server)->mutex); \
- } while (0)
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_PROTECTED_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.c
deleted file mode 100644
index 060a919e48..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-socket.c Server implementation for sockets
- *
- * Copyright (C) 2002, 2003, 2004, 2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-server-socket.h"
-#include "dbus-transport-socket.h"
-#include "dbus-connection-internal.h"
-#include "dbus-memory.h"
-#include "dbus-nonce.h"
-#include "dbus-string.h"
-
-/**
- * @defgroup DBusServerSocket DBusServer implementations for SOCKET
- * @ingroup DBusInternals
- * @brief Implementation details of DBusServer on SOCKET
- *
- * @{
- */
-/**
- *
- * Opaque object representing a Socket server implementation.
- */
-typedef struct DBusServerSocket DBusServerSocket;
-
-/**
- * Implementation details of DBusServerSocket. All members
- * are private.
- */
-struct DBusServerSocket
-{
- DBusServer base; /**< Parent class members. */
- int n_fds; /**< Number of active file handles */
- int *fds; /**< File descriptor or -1 if disconnected. */
- DBusWatch **watch; /**< File descriptor watch. */
- char *socket_name; /**< Name of domain socket, to unlink if appropriate */
- DBusNonceFile *noncefile; /**< Nonce file used to authenticate clients */
-};
-
-static void
-socket_finalize (DBusServer *server)
-{
- DBusServerSocket *socket_server = (DBusServerSocket*) server;
- int i;
-
- _dbus_server_finalize_base (server);
-
- for (i = 0 ; i < socket_server->n_fds ; i++)
- if (socket_server->watch[i])
- {
- _dbus_watch_unref (socket_server->watch[i]);
- socket_server->watch[i] = NULL;
- }
-
- dbus_free (socket_server->fds);
- dbus_free (socket_server->watch);
- dbus_free (socket_server->socket_name);
- if (socket_server->noncefile)
- _dbus_noncefile_delete (socket_server->noncefile, NULL);
- dbus_free (socket_server->noncefile);
- dbus_free (server);
-}
-
-/* Return value is just for memory, not other failures. */
-static dbus_bool_t
-handle_new_client_fd_and_unlock (DBusServer *server,
- int client_fd)
-{
- DBusConnection *connection;
- DBusTransport *transport;
- DBusNewConnectionFunction new_connection_function;
- void *new_connection_data;
-
- _dbus_verbose ("Creating new client connection with fd %d\n", client_fd);
-
- HAVE_LOCK_CHECK (server);
-
- if (!_dbus_set_fd_nonblocking (client_fd, NULL))
- {
- SERVER_UNLOCK (server);
- return TRUE;
- }
-
- transport = _dbus_transport_new_for_socket (client_fd, &server->guid_hex, NULL);
- if (transport == NULL)
- {
- _dbus_close_socket (client_fd, NULL);
- SERVER_UNLOCK (server);
- return FALSE;
- }
-
- if (!_dbus_transport_set_auth_mechanisms (transport,
- (const char **) server->auth_mechanisms))
- {
- _dbus_transport_unref (transport);
- SERVER_UNLOCK (server);
- return FALSE;
- }
-
- /* note that client_fd is now owned by the transport, and will be
- * closed on transport disconnection/finalization
- */
-
- connection = _dbus_connection_new_for_transport (transport);
- _dbus_transport_unref (transport);
- transport = NULL; /* now under the connection lock */
-
- if (connection == NULL)
- {
- SERVER_UNLOCK (server);
- return FALSE;
- }
-
- /* See if someone wants to handle this new connection, self-referencing
- * for paranoia.
- */
- new_connection_function = server->new_connection_function;
- new_connection_data = server->new_connection_data;
-
- _dbus_server_ref_unlocked (server);
- SERVER_UNLOCK (server);
-
- if (new_connection_function)
- {
- (* new_connection_function) (server, connection,
- new_connection_data);
- }
- dbus_server_unref (server);
-
- /* If no one grabbed a reference, the connection will die. */
- _dbus_connection_close_if_only_one_ref (connection);
- dbus_connection_unref (connection);
-
- return TRUE;
-}
-
-static dbus_bool_t
-socket_handle_watch (DBusWatch *watch,
- unsigned int flags,
- void *data)
-{
- DBusServer *server = data;
- DBusServerSocket *socket_server = data;
-
-#ifndef DBUS_DISABLE_ASSERT
- int i;
- dbus_bool_t found = FALSE;
-#endif
-
- SERVER_LOCK (server);
-
-#ifndef DBUS_DISABLE_ASSERT
- for (i = 0 ; i < socket_server->n_fds ; i++)
- {
- if (socket_server->watch[i] == watch)
- found = TRUE;
- }
- _dbus_assert (found);
-#endif
-
- _dbus_verbose ("Handling client connection, flags 0x%x\n", flags);
-
- if (flags & DBUS_WATCH_READABLE)
- {
- int client_fd;
- int listen_fd;
-
- listen_fd = dbus_watch_get_socket (watch);
-
- if (socket_server->noncefile)
- client_fd = _dbus_accept_with_noncefile (listen_fd, socket_server->noncefile);
- else
- client_fd = _dbus_accept (listen_fd);
-
- if (client_fd < 0)
- {
- /* EINTR handled for us */
-
- if (_dbus_get_is_errno_eagain_or_ewouldblock ())
- _dbus_verbose ("No client available to accept after all\n");
- else
- _dbus_verbose ("Failed to accept a client connection: %s\n",
- _dbus_strerror_from_errno ());
-
- SERVER_UNLOCK (server);
- }
- else
- {
- if (!handle_new_client_fd_and_unlock (server, client_fd))
- _dbus_verbose ("Rejected client connection due to lack of memory\n");
- }
- }
-
- if (flags & DBUS_WATCH_ERROR)
- _dbus_verbose ("Error on server listening socket\n");
-
- if (flags & DBUS_WATCH_HANGUP)
- _dbus_verbose ("Hangup on server listening socket\n");
-
- return TRUE;
-}
-
-static void
-socket_disconnect (DBusServer *server)
-{
- DBusServerSocket *socket_server = (DBusServerSocket*) server;
- int i;
-
- HAVE_LOCK_CHECK (server);
-
- for (i = 0 ; i < socket_server->n_fds ; i++)
- {
- if (socket_server->watch[i])
- {
- _dbus_server_remove_watch (server,
- socket_server->watch[i]);
- _dbus_watch_invalidate (socket_server->watch[i]);
- _dbus_watch_unref (socket_server->watch[i]);
- socket_server->watch[i] = NULL;
- }
-
- _dbus_close_socket (socket_server->fds[i], NULL);
- socket_server->fds[i] = -1;
- }
-
- if (socket_server->socket_name != NULL)
- {
- DBusString tmp;
- _dbus_string_init_const (&tmp, socket_server->socket_name);
- _dbus_delete_file (&tmp, NULL);
- }
-
- if (server->published_address)
- _dbus_daemon_unpublish_session_bus_address();
-
- HAVE_LOCK_CHECK (server);
-}
-
-static const DBusServerVTable socket_vtable = {
- socket_finalize,
- socket_disconnect
-};
-
-/**
- * Creates a new server listening on the given file descriptor. The
- * file descriptor should be nonblocking (use
- * _dbus_set_fd_nonblocking() to make it so). The file descriptor
- * should be listening for connections, that is, listen() should have
- * been successfully invoked on it. The server will use accept() to
- * accept new client connections.
- *
- * @param fds list of file descriptors.
- * @param n_fds number of file descriptors
- * @param address the server's address
- * @param noncefile to be used for authentication (NULL if not needed)
- * @returns the new server, or #NULL if no memory.
- *
- */
-DBusServer*
-_dbus_server_new_for_socket (int *fds,
- int n_fds,
- const DBusString *address,
- DBusNonceFile *noncefile)
-{
- DBusServerSocket *socket_server;
- DBusServer *server;
- int i;
-
- socket_server = dbus_new0 (DBusServerSocket, 1);
- if (socket_server == NULL)
- return NULL;
-
- socket_server->noncefile = noncefile;
-
- socket_server->fds = dbus_new (int, n_fds);
- if (!socket_server->fds)
- goto failed_0;
-
- socket_server->watch = dbus_new0 (DBusWatch *, n_fds);
- if (!socket_server->watch)
- goto failed_1;
-
- for (i = 0 ; i < n_fds ; i++)
- {
- DBusWatch *watch;
-
- watch = _dbus_watch_new (fds[i],
- DBUS_WATCH_READABLE,
- TRUE,
- socket_handle_watch, socket_server,
- NULL);
- if (watch == NULL)
- goto failed_2;
-
- socket_server->n_fds++;
- socket_server->fds[i] = fds[i];
- socket_server->watch[i] = watch;
- }
-
- if (!_dbus_server_init_base (&socket_server->base,
- &socket_vtable, address))
- goto failed_2;
-
- server = (DBusServer*)socket_server;
-
- SERVER_LOCK (server);
-
- for (i = 0 ; i < n_fds ; i++)
- {
- if (!_dbus_server_add_watch (&socket_server->base,
- socket_server->watch[i]))
- {
- int j;
- for (j = 0 ; j < i ; j++)
- _dbus_server_remove_watch (server,
- socket_server->watch[j]);
-
- SERVER_UNLOCK (server);
- _dbus_server_finalize_base (&socket_server->base);
- goto failed_2;
- }
- }
-
- SERVER_UNLOCK (server);
-
- _dbus_server_trace_ref (&socket_server->base, 0, 1, "new_for_socket");
- return (DBusServer*) socket_server;
-
- failed_2:
- for (i = 0 ; i < n_fds ; i++)
- {
- if (socket_server->watch[i] != NULL)
- {
- _dbus_watch_unref (socket_server->watch[i]);
- socket_server->watch[i] = NULL;
- }
- }
- dbus_free (socket_server->watch);
-
- failed_1:
- dbus_free (socket_server->fds);
-
- failed_0:
- dbus_free (socket_server);
- return NULL;
-}
-
-/**
- * Creates a new server listening on TCP.
- * If host is NULL, it will default to localhost.
- * If bind is NULL, it will default to the value for the host
- * parameter, and if that is NULL, then localhost
- * If bind is a hostname, it will be resolved and will listen
- * on all returned addresses.
- * If family is NULL, hostname resolution will try all address
- * families, otherwise it can be ipv4 or ipv6 to restrict the
- * addresses considered.
- *
- * @param host the hostname to report for the listen address
- * @param bind the hostname to listen on
- * @param port the port to listen on or 0 to let the OS choose
- * @param family
- * @param error location to store reason for failure.
- * @param use_nonce whether to use a nonce for low-level authentication (nonce-tcp transport) or not (tcp transport)
- * @returns the new server, or #NULL on failure.
- */
-DBusServer*
-_dbus_server_new_for_tcp_socket (const char *host,
- const char *bind,
- const char *port,
- const char *family,
- DBusError *error,
- dbus_bool_t use_nonce)
-{
- DBusServer *server;
- int *listen_fds = NULL;
- int nlisten_fds = 0, i;
- DBusString address;
- DBusString host_str;
- DBusString port_str;
- DBusNonceFile *noncefile;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- noncefile = NULL;
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (!_dbus_string_init (&port_str))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_0;
- }
-
- if (host == NULL)
- host = "localhost";
-
- if (port == NULL)
- port = "0";
-
- if (bind == NULL)
- bind = host;
- else if (strcmp (bind, "*") == 0)
- bind = NULL;
-
- nlisten_fds =_dbus_listen_tcp_socket (bind, port, family,
- &port_str,
- &listen_fds, error);
- if (nlisten_fds <= 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- goto failed_1;
- }
-
- _dbus_string_init_const (&host_str, host);
- if (!_dbus_string_append (&address, use_nonce ? "nonce-tcp:host=" : "tcp:host=") ||
- !_dbus_address_append_escaped (&address, &host_str) ||
- !_dbus_string_append (&address, ",port=") ||
- !_dbus_string_append (&address, _dbus_string_get_const_data(&port_str)))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_2;
- }
- if (family &&
- (!_dbus_string_append (&address, ",family=") ||
- !_dbus_string_append (&address, family)))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_2;
- }
-
- if (use_nonce)
- {
- noncefile = dbus_new0 (DBusNonceFile, 1);
- if (noncefile == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_2;
- }
-
- if (!_dbus_noncefile_create (noncefile, error))
- goto failed_3;
-
- if (!_dbus_string_append (&address, ",noncefile=") ||
- !_dbus_address_append_escaped (&address, _dbus_noncefile_get_path (noncefile)))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_4;
- }
-
- }
-
- server = _dbus_server_new_for_socket (listen_fds, nlisten_fds, &address, noncefile);
- if (server == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- if (noncefile != NULL)
- goto failed_4;
- else
- goto failed_2;
- }
-
- _dbus_string_free (&port_str);
- _dbus_string_free (&address);
- dbus_free(listen_fds);
-
- return server;
-
- failed_4:
- _dbus_noncefile_delete (noncefile, NULL);
-
- failed_3:
- dbus_free (noncefile);
-
- failed_2:
- for (i = 0 ; i < nlisten_fds ; i++)
- _dbus_close_socket (listen_fds[i], NULL);
- dbus_free(listen_fds);
-
- failed_1:
- _dbus_string_free (&port_str);
-
- failed_0:
- _dbus_string_free (&address);
-
- return NULL;
-}
-
-/**
- * Tries to interpret the address entry for various socket-related
- * addresses (well, currently only tcp and nonce-tcp).
- *
- * Sets error if the result is not OK.
- *
- * @param entry an address entry
- * @param server_p a new DBusServer, or #NULL on failure.
- * @param error location to store rationale for failure on bad address
- * @returns the outcome
- *
- */
-DBusServerListenResult
-_dbus_server_listen_socket (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error)
-{
- const char *method;
-
- *server_p = NULL;
-
- method = dbus_address_entry_get_method (entry);
-
- if (strcmp (method, "tcp") == 0 || strcmp (method, "nonce-tcp") == 0)
- {
- const char *host;
- const char *port;
- const char *bind;
- const char *family;
-
- host = dbus_address_entry_get_value (entry, "host");
- bind = dbus_address_entry_get_value (entry, "bind");
- port = dbus_address_entry_get_value (entry, "port");
- family = dbus_address_entry_get_value (entry, "family");
-
- *server_p = _dbus_server_new_for_tcp_socket (host, bind, port,
- family, error, strcmp (method, "nonce-tcp") == 0 ? TRUE : FALSE);
-
- if (*server_p)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_OK;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_NOT_HANDLED;
- }
-}
-
-/**
- * This is a bad hack since it's really unix domain socket
- * specific. Also, the function weirdly adopts ownership
- * of the passed-in string.
- *
- * @param server a socket server
- * @param filename socket filename to report/delete
- *
- */
-void
-_dbus_server_socket_own_filename (DBusServer *server,
- char *filename)
-{
- DBusServerSocket *socket_server = (DBusServerSocket*) server;
-
- socket_server->socket_name = filename;
-}
-
-
-/** @} */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.h
deleted file mode 100644
index 3aec712905..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-socket.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-socket.h Server implementation for sockets
- *
- * Copyright (C) 2002, 2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SERVER_SOCKET_H
-#define DBUS_SERVER_SOCKET_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-server-protected.h>
-#include <dbus/dbus-nonce.h>
-
-DBUS_BEGIN_DECLS
-
-DBusServer* _dbus_server_new_for_socket (int *fds,
- int n_fds,
- const DBusString *address,
- DBusNonceFile *noncefile);
-DBusServer* _dbus_server_new_for_autolaunch (const DBusString *address,
- DBusError *error);
-DBusServer* _dbus_server_new_for_tcp_socket (const char *host,
- const char *bind,
- const char *port,
- const char *family,
- DBusError *error,
- dbus_bool_t use_nonce);
-DBusServerListenResult _dbus_server_listen_socket (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error);
-
-
-void _dbus_server_socket_own_filename (DBusServer *server,
- char *filename);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_SOCKET_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.c
deleted file mode 100644
index d995240480..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-unix.c Server implementation for Unix network protocols.
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-server-unix.h"
-#include "dbus-server-socket.h"
-#include "dbus-server-launchd.h"
-#include "dbus-transport-unix.h"
-#include "dbus-connection-internal.h"
-#include "dbus-sysdeps-unix.h"
-#include "dbus-string.h"
-
-/**
- * @defgroup DBusServerUnix DBusServer implementations for UNIX
- * @ingroup DBusInternals
- * @brief Implementation details of DBusServer on UNIX
- *
- * @{
- */
-
-/**
- * Tries to interpret the address entry in a platform-specific
- * way, creating a platform-specific server type if appropriate.
- * Sets error if the result is not OK.
- *
- * @param entry an address entry
- * @param server_p location to store a new DBusServer, or #NULL on failure.
- * @param error location to store rationale for failure on bad address
- * @returns the outcome
- *
- */
-DBusServerListenResult
-_dbus_server_listen_platform_specific (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error)
-{
- const char *method;
-
- *server_p = NULL;
-
- method = dbus_address_entry_get_method (entry);
-
- if (strcmp (method, "unix") == 0)
- {
- const char *path = dbus_address_entry_get_value (entry, "path");
- const char *tmpdir = dbus_address_entry_get_value (entry, "tmpdir");
- const char *abstract = dbus_address_entry_get_value (entry, "abstract");
-
- if (path == NULL && tmpdir == NULL && abstract == NULL)
- {
- _dbus_set_bad_address(error, "unix",
- "path or tmpdir or abstract",
- NULL);
- return DBUS_SERVER_LISTEN_BAD_ADDRESS;
- }
-
- if ((path && tmpdir) ||
- (path && abstract) ||
- (tmpdir && abstract))
- {
- _dbus_set_bad_address(error, NULL, NULL,
- "cannot specify two of \"path\" and \"tmpdir\" and \"abstract\" at the same time");
- return DBUS_SERVER_LISTEN_BAD_ADDRESS;
- }
-
- if (tmpdir != NULL)
- {
- DBusString full_path;
- DBusString filename;
-
- if (!_dbus_string_init (&full_path))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
-
- if (!_dbus_string_init (&filename))
- {
- _dbus_string_free (&full_path);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
-
- if (!_dbus_string_append (&filename,
- "dbus-") ||
- !_dbus_generate_random_ascii (&filename, 10) ||
- !_dbus_string_append (&full_path, tmpdir) ||
- !_dbus_concat_dir_and_file (&full_path, &filename))
- {
- _dbus_string_free (&full_path);
- _dbus_string_free (&filename);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
-
- /* Always use abstract namespace if possible with tmpdir */
-
- *server_p =
- _dbus_server_new_for_domain_socket (_dbus_string_get_const_data (&full_path),
-#ifdef HAVE_ABSTRACT_SOCKETS
- TRUE,
-#else
- FALSE,
-#endif
- error);
-
- _dbus_string_free (&full_path);
- _dbus_string_free (&filename);
- }
- else
- {
- if (path)
- *server_p = _dbus_server_new_for_domain_socket (path, FALSE, error);
- else
- *server_p = _dbus_server_new_for_domain_socket (abstract, TRUE, error);
- }
-
- if (*server_p != NULL)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_OK;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
- else if (strcmp (method, "systemd") == 0)
- {
- int i, n, *fds;
- DBusString address;
-
- n = _dbus_listen_systemd_sockets (&fds, error);
- if (n < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
-
- if (!_dbus_string_init (&address))
- goto systemd_oom;
-
- for (i = 0; i < n; i++)
- {
- if (i > 0)
- {
- if (!_dbus_string_append (&address, ";"))
- goto systemd_oom;
- }
- if (!_dbus_append_address_from_socket (fds[i], &address, error))
- goto systemd_err;
- }
-
- *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
- if (*server_p == NULL)
- goto systemd_oom;
-
- dbus_free (fds);
-
- return DBUS_SERVER_LISTEN_OK;
- systemd_oom:
- _DBUS_SET_OOM (error);
- systemd_err:
- for (i = 0; i < n; i++)
- {
- _dbus_close_socket (fds[i], NULL);
- }
- dbus_free (fds);
- _dbus_string_free (&address);
-
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
-#ifdef DBUS_ENABLE_LAUNCHD
- else if (strcmp (method, "launchd") == 0)
- {
- const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
- if (launchd_env_var == NULL)
- {
- _dbus_set_bad_address (error, "launchd", "env", NULL);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- *server_p = _dbus_server_new_for_launchd (launchd_env_var, error);
-
- if (*server_p != NULL)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_OK;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
-#endif
- else
- {
- /* If we don't handle the method, we return NULL with the
- * error unset
- */
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_NOT_HANDLED;
- }
-}
-
-/**
- * Creates a new server listening on the given Unix domain socket.
- *
- * @param path the path for the domain socket.
- * @param abstract #TRUE to use abstract socket namespace
- * @param error location to store reason for failure.
- * @returns the new server, or #NULL on failure.
- */
-DBusServer*
-_dbus_server_new_for_domain_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error)
-{
- DBusServer *server;
- int listen_fd;
- DBusString address;
- char *path_copy;
- DBusString path_str;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- _dbus_string_init_const (&path_str, path);
- if ((abstract &&
- !_dbus_string_append (&address, "unix:abstract=")) ||
- (!abstract &&
- !_dbus_string_append (&address, "unix:path=")) ||
- !_dbus_address_append_escaped (&address, &path_str))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_0;
- }
-
- if (abstract)
- {
- path_copy = NULL;
- }
- else
- {
- path_copy = _dbus_strdup (path);
- if (path_copy == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_0;
- }
- }
-
- listen_fd = _dbus_listen_unix_socket (path, abstract, error);
-
- if (listen_fd < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed_1;
- }
-
- server = _dbus_server_new_for_socket (&listen_fd, 1, &address, 0);
- if (server == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_2;
- }
-
- if (path_copy != NULL)
- _dbus_server_socket_own_filename(server, path_copy);
-
- _dbus_string_free (&address);
-
- return server;
-
- failed_2:
- _dbus_close_socket (listen_fd, NULL);
- failed_1:
- dbus_free (path_copy);
- failed_0:
- _dbus_string_free (&address);
-
- return NULL;
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.h
deleted file mode 100644
index 92b996caa3..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-unix.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-unix.h Server implementation for Unix network protocols.
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SERVER_UNIX_H
-#define DBUS_SERVER_UNIX_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-server-protected.h>
-
-DBUS_BEGIN_DECLS
-
-DBusServer* _dbus_server_new_for_domain_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_UNIX_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.c
deleted file mode 100644
index bb6da48353..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-win.c Server implementation for WIN network protocols.
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- * Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-server-win.h"
-#include "dbus-server-socket.h"
-
-/**
- * @defgroup DBusServerWin DBusServer implementations for Windows
- * @ingroup DBusInternals
- * @brief Implementation details of DBusServer on Windows
- *
- * @{
- */
-
-/**
- * Tries to interpret the address entry in a platform-specific
- * way, creating a platform-specific server type if appropriate.
- * Sets error if the result is not OK.
- *
- * @param entry an address entry
- * @param server_p location to store a new DBusServer, or #NULL on failure.
- * @param error location to store rationale for failure on bad address
- * @returns the outcome
- *
- */
-DBusServerListenResult
-_dbus_server_listen_platform_specific (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error)
-{
- const char *method;
-
- *server_p = NULL;
-
- method = dbus_address_entry_get_method (entry);
-
- if (strcmp (method, "autolaunch") == 0)
- {
- const char *host = "localhost";
- const char *bind = "localhost";
- const char *port = "0";
- const char *family = "ipv4";
- const char *scope = dbus_address_entry_get_value (entry, "scope");
-
- if (_dbus_daemon_is_session_bus_address_published (scope))
- return DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED;
-
- *server_p = _dbus_server_new_for_tcp_socket (host, bind, port,
- family, error, FALSE);
- if (*server_p)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- (*server_p)->published_address =
- _dbus_daemon_publish_session_bus_address ((*server_p)->address, scope);
- return DBUS_SERVER_LISTEN_OK;
- }
- else
- {
- // make sure no handle is open
- _dbus_daemon_unpublish_session_bus_address ();
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
- return DBUS_SERVER_LISTEN_NOT_HANDLED;
- }
-}
-
-/** @} */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.h
deleted file mode 100644
index 65c2756855..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server-win.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server-win.h Server implementation for windows network protocols.
- *
- * Copyright (C) 2002 Red Hat Inc.
- * Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SERVER_WIN_H
-#define DBUS_SERVER_WIN_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-server-protected.h>
-
-DBUS_BEGIN_DECLS
-
-/* add definitions here */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_WIN_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-server.c
deleted file mode 100644
index 19d8590c96..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server.c
+++ /dev/null
@@ -1,1241 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server.c DBusServer object
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-server.h"
-#include "dbus-server-unix.h"
-#include "dbus-server-socket.h"
-#include "dbus-string.h"
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-server-debug-pipe.h"
-#endif
-#include "dbus-address.h"
-#include "dbus-protocol.h"
-
-/**
- * @defgroup DBusServer DBusServer
- * @ingroup DBus
- * @brief Server that listens for new connections.
- *
- * A DBusServer represents a server that other applications
- * can connect to. Each connection from another application
- * is represented by a #DBusConnection.
- *
- * @todo Thread safety hasn't been tested much for #DBusServer
- * @todo Need notification to apps of disconnection, may matter for some transports
- */
-
-/**
- * @defgroup DBusServerInternals DBusServer implementation details
- * @ingroup DBusInternals
- * @brief Implementation details of DBusServer
- *
- * @{
- */
-
-#ifndef _dbus_server_trace_ref
-void
-_dbus_server_trace_ref (DBusServer *server,
- int old_refcount,
- int new_refcount,
- const char *why)
-{
- static int enabled = -1;
-
- _dbus_trace_ref ("DBusServer", server, old_refcount, new_refcount, why,
- "DBUS_SERVER_TRACE", &enabled);
-}
-#endif
-
-/* this is a little fragile since it assumes the address doesn't
- * already have a guid, but it shouldn't
- */
-static char*
-copy_address_with_guid_appended (const DBusString *address,
- const DBusString *guid_hex)
-{
- DBusString with_guid;
- char *retval;
-
- if (!_dbus_string_init (&with_guid))
- return NULL;
-
- if (!_dbus_string_copy (address, 0, &with_guid,
- _dbus_string_get_length (&with_guid)) ||
- !_dbus_string_append (&with_guid, ",guid=") ||
- !_dbus_string_copy (guid_hex, 0,
- &with_guid, _dbus_string_get_length (&with_guid)))
- {
- _dbus_string_free (&with_guid);
- return NULL;
- }
-
- retval = NULL;
- _dbus_string_steal_data (&with_guid, &retval);
-
- _dbus_string_free (&with_guid);
-
- return retval; /* may be NULL if steal_data failed */
-}
-
-/**
- * Initializes the members of the DBusServer base class.
- * Chained up to by subclass constructors.
- *
- * @param server the server.
- * @param vtable the vtable for the subclass.
- * @param address the server's address
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_server_init_base (DBusServer *server,
- const DBusServerVTable *vtable,
- const DBusString *address)
-{
- server->vtable = vtable;
-
-#ifdef DBUS_DISABLE_ASSERT
- _dbus_atomic_inc (&server->refcount);
-#else
- {
- dbus_int32_t old_refcount = _dbus_atomic_inc (&server->refcount);
-
- _dbus_assert (old_refcount == 0);
- }
-#endif
-
- server->address = NULL;
- server->watches = NULL;
- server->timeouts = NULL;
- server->published_address = FALSE;
-
- if (!_dbus_string_init (&server->guid_hex))
- return FALSE;
-
- _dbus_generate_uuid (&server->guid);
-
- if (!_dbus_uuid_encode (&server->guid, &server->guid_hex))
- goto failed;
-
- server->address = copy_address_with_guid_appended (address,
- &server->guid_hex);
- if (server->address == NULL)
- goto failed;
-
- _dbus_rmutex_new_at_location (&server->mutex);
- if (server->mutex == NULL)
- goto failed;
-
- server->watches = _dbus_watch_list_new ();
- if (server->watches == NULL)
- goto failed;
-
- server->timeouts = _dbus_timeout_list_new ();
- if (server->timeouts == NULL)
- goto failed;
-
- _dbus_data_slot_list_init (&server->slot_list);
-
- _dbus_verbose ("Initialized server on address %s\n", server->address);
-
- return TRUE;
-
- failed:
- _dbus_rmutex_free_at_location (&server->mutex);
- server->mutex = NULL;
- if (server->watches)
- {
- _dbus_watch_list_free (server->watches);
- server->watches = NULL;
- }
- if (server->timeouts)
- {
- _dbus_timeout_list_free (server->timeouts);
- server->timeouts = NULL;
- }
- if (server->address)
- {
- dbus_free (server->address);
- server->address = NULL;
- }
- _dbus_string_free (&server->guid_hex);
-
- return FALSE;
-}
-
-/**
- * Finalizes the members of the DBusServer base class.
- * Chained up to by subclass finalizers.
- *
- * @param server the server.
- */
-void
-_dbus_server_finalize_base (DBusServer *server)
-{
- /* We don't have the lock, but nobody should be accessing
- * concurrently since they don't have a ref
- */
-#ifndef DBUS_DISABLE_CHECKS
- _dbus_assert (!server->have_server_lock);
-#endif
- _dbus_assert (server->disconnected);
-
- /* calls out to application code... */
- _dbus_data_slot_list_free (&server->slot_list);
-
- dbus_server_set_new_connection_function (server, NULL, NULL, NULL);
-
- _dbus_watch_list_free (server->watches);
- _dbus_timeout_list_free (server->timeouts);
-
- _dbus_rmutex_free_at_location (&server->mutex);
-
- dbus_free (server->address);
-
- dbus_free_string_array (server->auth_mechanisms);
-
- _dbus_string_free (&server->guid_hex);
-}
-
-
-/** Function to be called in protected_change_watch() with refcount held */
-typedef dbus_bool_t (* DBusWatchAddFunction) (DBusWatchList *list,
- DBusWatch *watch);
-/** Function to be called in protected_change_watch() with refcount held */
-typedef void (* DBusWatchRemoveFunction) (DBusWatchList *list,
- DBusWatch *watch);
-/** Function to be called in protected_change_watch() with refcount held */
-typedef void (* DBusWatchToggleFunction) (DBusWatchList *list,
- DBusWatch *watch,
- dbus_bool_t enabled);
-
-static dbus_bool_t
-protected_change_watch (DBusServer *server,
- DBusWatch *watch,
- DBusWatchAddFunction add_function,
- DBusWatchRemoveFunction remove_function,
- DBusWatchToggleFunction toggle_function,
- dbus_bool_t enabled)
-{
- DBusWatchList *watches;
- dbus_bool_t retval;
-
- HAVE_LOCK_CHECK (server);
-
- /* This isn't really safe or reasonable; a better pattern is the "do
- * everything, then drop lock and call out" one; but it has to be
- * propagated up through all callers
- */
-
- watches = server->watches;
- if (watches)
- {
- server->watches = NULL;
- _dbus_server_ref_unlocked (server);
- SERVER_UNLOCK (server);
-
- if (add_function)
- retval = (* add_function) (watches, watch);
- else if (remove_function)
- {
- retval = TRUE;
- (* remove_function) (watches, watch);
- }
- else
- {
- retval = TRUE;
- (* toggle_function) (watches, watch, enabled);
- }
-
- SERVER_LOCK (server);
- server->watches = watches;
- _dbus_server_unref_unlocked (server);
-
- return retval;
- }
- else
- return FALSE;
-}
-
-/**
- * Adds a watch for this server, chaining out to application-provided
- * watch handlers.
- *
- * @param server the server.
- * @param watch the watch to add.
- */
-dbus_bool_t
-_dbus_server_add_watch (DBusServer *server,
- DBusWatch *watch)
-{
- HAVE_LOCK_CHECK (server);
- return protected_change_watch (server, watch,
- _dbus_watch_list_add_watch,
- NULL, NULL, FALSE);
-}
-
-/**
- * Removes a watch previously added with _dbus_server_remove_watch().
- *
- * @param server the server.
- * @param watch the watch to remove.
- */
-void
-_dbus_server_remove_watch (DBusServer *server,
- DBusWatch *watch)
-{
- HAVE_LOCK_CHECK (server);
- protected_change_watch (server, watch,
- NULL,
- _dbus_watch_list_remove_watch,
- NULL, FALSE);
-}
-
-/**
- * Toggles a watch and notifies app via server's
- * DBusWatchToggledFunction if available. It's an error to call this
- * function on a watch that was not previously added.
- *
- * @param server the server.
- * @param watch the watch to toggle.
- * @param enabled whether to enable or disable
- */
-void
-_dbus_server_toggle_watch (DBusServer *server,
- DBusWatch *watch,
- dbus_bool_t enabled)
-{
- _dbus_assert (watch != NULL);
-
- HAVE_LOCK_CHECK (server);
- protected_change_watch (server, watch,
- NULL, NULL,
- _dbus_watch_list_toggle_watch,
- enabled);
-}
-
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef dbus_bool_t (* DBusTimeoutAddFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout);
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef void (* DBusTimeoutRemoveFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout);
-/** Function to be called in protected_change_timeout() with refcount held */
-typedef void (* DBusTimeoutToggleFunction) (DBusTimeoutList *list,
- DBusTimeout *timeout,
- dbus_bool_t enabled);
-
-
-static dbus_bool_t
-protected_change_timeout (DBusServer *server,
- DBusTimeout *timeout,
- DBusTimeoutAddFunction add_function,
- DBusTimeoutRemoveFunction remove_function,
- DBusTimeoutToggleFunction toggle_function,
- dbus_bool_t enabled)
-{
- DBusTimeoutList *timeouts;
- dbus_bool_t retval;
-
- HAVE_LOCK_CHECK (server);
-
- /* This isn't really safe or reasonable; a better pattern is the "do everything, then
- * drop lock and call out" one; but it has to be propagated up through all callers
- */
-
- timeouts = server->timeouts;
- if (timeouts)
- {
- server->timeouts = NULL;
- _dbus_server_ref_unlocked (server);
- SERVER_UNLOCK (server);
-
- if (add_function)
- retval = (* add_function) (timeouts, timeout);
- else if (remove_function)
- {
- retval = TRUE;
- (* remove_function) (timeouts, timeout);
- }
- else
- {
- retval = TRUE;
- (* toggle_function) (timeouts, timeout, enabled);
- }
-
- SERVER_LOCK (server);
- server->timeouts = timeouts;
- _dbus_server_unref_unlocked (server);
-
- return retval;
- }
- else
- return FALSE;
-}
-
-/**
- * Adds a timeout for this server, chaining out to
- * application-provided timeout handlers. The timeout should be
- * repeatedly handled with dbus_timeout_handle() at its given interval
- * until it is removed.
- *
- * @param server the server.
- * @param timeout the timeout to add.
- */
-dbus_bool_t
-_dbus_server_add_timeout (DBusServer *server,
- DBusTimeout *timeout)
-{
- return protected_change_timeout (server, timeout,
- _dbus_timeout_list_add_timeout,
- NULL, NULL, FALSE);
-}
-
-/**
- * Removes a timeout previously added with _dbus_server_add_timeout().
- *
- * @param server the server.
- * @param timeout the timeout to remove.
- */
-void
-_dbus_server_remove_timeout (DBusServer *server,
- DBusTimeout *timeout)
-{
- protected_change_timeout (server, timeout,
- NULL,
- _dbus_timeout_list_remove_timeout,
- NULL, FALSE);
-}
-
-/**
- * Toggles a timeout and notifies app via server's
- * DBusTimeoutToggledFunction if available. It's an error to call this
- * function on a timeout that was not previously added.
- *
- * @param server the server.
- * @param timeout the timeout to toggle.
- * @param enabled whether to enable or disable
- */
-void
-_dbus_server_toggle_timeout (DBusServer *server,
- DBusTimeout *timeout,
- dbus_bool_t enabled)
-{
- protected_change_timeout (server, timeout,
- NULL, NULL,
- _dbus_timeout_list_toggle_timeout,
- enabled);
-}
-
-
-/**
- * Like dbus_server_ref() but does not acquire the lock (must already be held)
- *
- * @param server the server.
- */
-void
-_dbus_server_ref_unlocked (DBusServer *server)
-{
- dbus_int32_t old_refcount;
-
- _dbus_assert (server != NULL);
- HAVE_LOCK_CHECK (server);
-
- old_refcount = _dbus_atomic_inc (&server->refcount);
- _dbus_assert (old_refcount > 0);
- _dbus_server_trace_ref (server, old_refcount, old_refcount + 1,
- "ref_unlocked");
-}
-
-/**
- * Like dbus_server_unref() but does not acquire the lock (must already be held)
- *
- * @param server the server.
- */
-void
-_dbus_server_unref_unlocked (DBusServer *server)
-{
- dbus_int32_t old_refcount;
-
- /* Keep this in sync with dbus_server_unref */
-
- _dbus_assert (server != NULL);
-
- HAVE_LOCK_CHECK (server);
-
- old_refcount = _dbus_atomic_dec (&server->refcount);
- _dbus_assert (old_refcount > 0);
-
- _dbus_server_trace_ref (server, old_refcount, old_refcount - 1,
- "unref_unlocked");
-
- if (old_refcount == 1)
- {
- _dbus_assert (server->disconnected);
-
- SERVER_UNLOCK (server);
-
- _dbus_assert (server->vtable->finalize != NULL);
-
- (* server->vtable->finalize) (server);
- }
-}
-
-/** @} */
-
-/**
- * @addtogroup DBusServer
- *
- * @{
- */
-
-
-/**
- * @typedef DBusServer
- *
- * An opaque object representing a server that listens for
- * connections from other applications. Each time a connection
- * is made, a new DBusConnection is created and made available
- * via an application-provided DBusNewConnectionFunction.
- * The DBusNewConnectionFunction is provided with
- * dbus_server_set_new_connection_function().
- *
- */
-
-static const struct {
- DBusServerListenResult (* func) (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error);
-} listen_funcs[] = {
- { _dbus_server_listen_socket }
- , { _dbus_server_listen_platform_specific }
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- , { _dbus_server_listen_debug_pipe }
-#endif
-};
-
-/**
- * Listens for new connections on the given address. If there are
- * multiple semicolon-separated address entries in the address, tries
- * each one and listens on the first one that works.
- *
- * Returns #NULL and sets error if listening fails for any reason.
- * Otherwise returns a new #DBusServer.
- * dbus_server_set_new_connection_function(),
- * dbus_server_set_watch_functions(), and
- * dbus_server_set_timeout_functions() should be called immediately to
- * render the server fully functional.
- *
- * To free the server, applications must call first
- * dbus_server_disconnect() and then dbus_server_unref().
- *
- * @param address the address of this server.
- * @param error location to store reason for failure.
- * @returns a new #DBusServer, or #NULL on failure.
- *
- */
-DBusServer*
-dbus_server_listen (const char *address,
- DBusError *error)
-{
- DBusServer *server;
- DBusAddressEntry **entries;
- int len, i;
- DBusError first_connect_error = DBUS_ERROR_INIT;
- dbus_bool_t handled_once;
-
- _dbus_return_val_if_fail (address != NULL, NULL);
- _dbus_return_val_if_error_is_set (error, NULL);
-
- if (!dbus_parse_address (address, &entries, &len, error))
- return NULL;
-
- server = NULL;
- handled_once = FALSE;
-
- for (i = 0; i < len; i++)
- {
- int j;
-
- for (j = 0; j < (int) _DBUS_N_ELEMENTS (listen_funcs); ++j)
- {
- DBusServerListenResult result;
- DBusError tmp_error = DBUS_ERROR_INIT;
-
- result = (* listen_funcs[j].func) (entries[i],
- &server,
- &tmp_error);
-
- if (result == DBUS_SERVER_LISTEN_OK)
- {
- _dbus_assert (server != NULL);
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
- handled_once = TRUE;
- goto out;
- }
- else if (result == DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED)
- {
- _dbus_assert (server == NULL);
- dbus_set_error (error,
- DBUS_ERROR_ADDRESS_IN_USE,
- "Address '%s' already used",
- dbus_address_entry_get_method (entries[0]));
- handled_once = TRUE;
- goto out;
- }
- else if (result == DBUS_SERVER_LISTEN_BAD_ADDRESS)
- {
- _dbus_assert (server == NULL);
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- dbus_move_error (&tmp_error, error);
- handled_once = TRUE;
- goto out;
- }
- else if (result == DBUS_SERVER_LISTEN_NOT_HANDLED)
- {
- _dbus_assert (server == NULL);
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- /* keep trying addresses */
- }
- else if (result == DBUS_SERVER_LISTEN_DID_NOT_CONNECT)
- {
- _dbus_assert (server == NULL);
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- if (!dbus_error_is_set (&first_connect_error))
- dbus_move_error (&tmp_error, &first_connect_error);
- else
- dbus_error_free (&tmp_error);
-
- handled_once = TRUE;
-
- /* keep trying addresses */
- }
- }
-
- _dbus_assert (server == NULL);
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- }
-
- out:
-
- if (!handled_once)
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- if (len > 0)
- dbus_set_error (error,
- DBUS_ERROR_BAD_ADDRESS,
- "Unknown address type '%s'",
- dbus_address_entry_get_method (entries[0]));
- else
- dbus_set_error (error,
- DBUS_ERROR_BAD_ADDRESS,
- "Empty address '%s'",
- address);
- }
-
- dbus_address_entries_free (entries);
-
- if (server == NULL)
- {
- _dbus_assert (error == NULL || dbus_error_is_set (&first_connect_error) ||
- dbus_error_is_set (error));
-
- if (error && dbus_error_is_set (error))
- {
- /* already set the error */
- }
- else
- {
- /* didn't set the error but either error should be
- * NULL or first_connect_error should be set.
- */
- _dbus_assert (error == NULL || dbus_error_is_set (&first_connect_error));
- dbus_move_error (&first_connect_error, error);
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (&first_connect_error); /* be sure we freed it */
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- return NULL;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return server;
- }
-}
-
-/**
- * Increments the reference count of a DBusServer.
- *
- * @param server the server.
- * @returns the server
- */
-DBusServer *
-dbus_server_ref (DBusServer *server)
-{
- dbus_int32_t old_refcount;
-
- _dbus_return_val_if_fail (server != NULL, NULL);
-
- old_refcount = _dbus_atomic_inc (&server->refcount);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (_DBUS_UNLIKELY (old_refcount <= 0))
- {
- _dbus_atomic_dec (&server->refcount);
- _dbus_warn_check_failed (_dbus_return_if_fail_warning_format,
- _DBUS_FUNCTION_NAME, "old_refcount > 0",
- __FILE__, __LINE__);
- return NULL;
- }
-#endif
-
- _dbus_server_trace_ref (server, old_refcount, old_refcount + 1, "ref");
-
- return server;
-}
-
-/**
- * Decrements the reference count of a DBusServer. Finalizes the
- * server if the reference count reaches zero.
- *
- * The server must be disconnected before the refcount reaches zero.
- *
- * @param server the server.
- */
-void
-dbus_server_unref (DBusServer *server)
-{
- dbus_int32_t old_refcount;
-
- /* keep this in sync with unref_unlocked */
-
- _dbus_return_if_fail (server != NULL);
-
- old_refcount = _dbus_atomic_dec (&server->refcount);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (_DBUS_UNLIKELY (old_refcount <= 0))
- {
- /* undo side-effect first
- * please do not try to simplify the code here by using
- * _dbus_atomic_get(), why we don't use it is
- * because it issues another atomic operation even though
- * DBUS_DISABLE_CHECKS defined.
- * Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
- */
- _dbus_atomic_inc (&server->refcount);
- _dbus_warn_check_failed (_dbus_return_if_fail_warning_format,
- _DBUS_FUNCTION_NAME, "old_refcount > 0",
- __FILE__, __LINE__);
- return;
- }
-#endif
-
- _dbus_server_trace_ref (server, old_refcount, old_refcount - 1, "unref");
-
- if (old_refcount == 1)
- {
- /* lock not held! */
- _dbus_assert (server->disconnected);
-
- _dbus_assert (server->vtable->finalize != NULL);
-
- (* server->vtable->finalize) (server);
- }
-}
-
-/**
- * Releases the server's address and stops listening for
- * new clients. If called more than once, only the first
- * call has an effect. Does not modify the server's
- * reference count.
- *
- * @param server the server.
- */
-void
-dbus_server_disconnect (DBusServer *server)
-{
- _dbus_return_if_fail (server != NULL);
-
- dbus_server_ref (server);
- SERVER_LOCK (server);
-
- _dbus_assert (server->vtable->disconnect != NULL);
-
- if (!server->disconnected)
- {
- /* this has to be first so recursive calls to disconnect don't happen */
- server->disconnected = TRUE;
-
- (* server->vtable->disconnect) (server);
- }
-
- SERVER_UNLOCK (server);
- dbus_server_unref (server);
-}
-
-/**
- * Returns #TRUE if the server is still listening for new connections.
- *
- * @param server the server.
- */
-dbus_bool_t
-dbus_server_get_is_connected (DBusServer *server)
-{
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (server != NULL, FALSE);
-
- SERVER_LOCK (server);
- retval = !server->disconnected;
- SERVER_UNLOCK (server);
-
- return retval;
-}
-
-/**
- * Returns the address of the server, as a newly-allocated
- * string which must be freed by the caller.
- *
- * @param server the server
- * @returns the address or #NULL if no memory
- */
-char*
-dbus_server_get_address (DBusServer *server)
-{
- char *retval;
-
- _dbus_return_val_if_fail (server != NULL, NULL);
-
- SERVER_LOCK (server);
- retval = _dbus_strdup (server->address);
- SERVER_UNLOCK (server);
-
- return retval;
-}
-
-/**
- * Returns the unique ID of the server, as a newly-allocated
- * string which must be freed by the caller. This ID is
- * normally used by clients to tell when two #DBusConnection
- * would be equivalent (because the server address passed
- * to dbus_connection_open() will have the same guid in the
- * two cases). dbus_connection_open() can re-use an existing
- * connection with the same ID instead of opening a new
- * connection.
- *
- * This is an ID unique to each #DBusServer. Remember that
- * a #DBusServer represents only one mode of connecting,
- * so e.g. a bus daemon can listen on multiple addresses
- * which will mean it has multiple #DBusServer each with
- * their own ID.
- *
- * The ID is not a UUID in the sense of RFC4122; the details
- * are explained in the D-Bus specification.
- *
- * @param server the server
- * @returns the id of the server or #NULL if no memory
- */
-char*
-dbus_server_get_id (DBusServer *server)
-{
- char *retval;
-
- _dbus_return_val_if_fail (server != NULL, NULL);
-
- SERVER_LOCK (server);
- retval = NULL;
- _dbus_string_copy_data (&server->guid_hex, &retval);
- SERVER_UNLOCK (server);
-
- return retval;
-}
-
-/**
- * Sets a function to be used for handling new connections. The given
- * function is passed each new connection as the connection is
- * created. If the new connection function increments the connection's
- * reference count, the connection will stay alive. Otherwise, the
- * connection will be unreferenced and closed. The new connection
- * function may also close the connection itself, which is considered
- * good form if the connection is not wanted.
- *
- * The connection here is private in the sense of
- * dbus_connection_open_private(), so if the new connection function
- * keeps a reference it must arrange for the connection to be closed.
- * i.e. libdbus does not own this connection once the new connection
- * function takes a reference.
- *
- * @param server the server.
- * @param function a function to handle new connections.
- * @param data data to pass to the new connection handler.
- * @param free_data_function function to free the data.
- */
-void
-dbus_server_set_new_connection_function (DBusServer *server,
- DBusNewConnectionFunction function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- DBusFreeFunction old_free_function;
- void *old_data;
-
- _dbus_return_if_fail (server != NULL);
-
- SERVER_LOCK (server);
- old_free_function = server->new_connection_free_data_function;
- old_data = server->new_connection_data;
-
- server->new_connection_function = function;
- server->new_connection_data = data;
- server->new_connection_free_data_function = free_data_function;
- SERVER_UNLOCK (server);
-
- if (old_free_function != NULL)
- (* old_free_function) (old_data);
-}
-
-/**
- * Sets the watch functions for the server. These functions are
- * responsible for making the application's main loop aware of file
- * descriptors that need to be monitored for events.
- *
- * This function behaves exactly like dbus_connection_set_watch_functions();
- * see the documentation for that routine.
- *
- * @param server the server.
- * @param add_function function to begin monitoring a new descriptor.
- * @param remove_function function to stop monitoring a descriptor.
- * @param toggled_function function to notify when the watch is enabled/disabled
- * @param data data to pass to add_function and remove_function.
- * @param free_data_function function to be called to free the data.
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_server_set_watch_functions (DBusServer *server,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- dbus_bool_t result;
- DBusWatchList *watches;
-
- _dbus_return_val_if_fail (server != NULL, FALSE);
-
- SERVER_LOCK (server);
- watches = server->watches;
- server->watches = NULL;
- if (watches)
- {
- SERVER_UNLOCK (server);
- result = _dbus_watch_list_set_functions (watches,
- add_function,
- remove_function,
- toggled_function,
- data,
- free_data_function);
- SERVER_LOCK (server);
- }
- else
- {
- _dbus_warn_check_failed ("Re-entrant call to %s\n", _DBUS_FUNCTION_NAME);
- result = FALSE;
- }
- server->watches = watches;
- SERVER_UNLOCK (server);
-
- return result;
-}
-
-/**
- * Sets the timeout functions for the server. These functions are
- * responsible for making the application's main loop aware of timeouts.
- *
- * This function behaves exactly like dbus_connection_set_timeout_functions();
- * see the documentation for that routine.
- *
- * @param server the server.
- * @param add_function function to add a timeout.
- * @param remove_function function to remove a timeout.
- * @param toggled_function function to notify when the timeout is enabled/disabled
- * @param data data to pass to add_function and remove_function.
- * @param free_data_function function to be called to free the data.
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-dbus_server_set_timeout_functions (DBusServer *server,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- dbus_bool_t result;
- DBusTimeoutList *timeouts;
-
- _dbus_return_val_if_fail (server != NULL, FALSE);
-
- SERVER_LOCK (server);
- timeouts = server->timeouts;
- server->timeouts = NULL;
- if (timeouts)
- {
- SERVER_UNLOCK (server);
- result = _dbus_timeout_list_set_functions (timeouts,
- add_function,
- remove_function,
- toggled_function,
- data,
- free_data_function);
- SERVER_LOCK (server);
- }
- else
- {
- _dbus_warn_check_failed ("Re-entrant call to %s\n", _DBUS_FUNCTION_NAME);
- result = FALSE;
- }
- server->timeouts = timeouts;
- SERVER_UNLOCK (server);
-
- return result;
-}
-
-/**
- * Sets the authentication mechanisms that this server offers to
- * clients, as a #NULL-terminated array of mechanism names. This
- * function only affects connections created <em>after</em> it is
- * called. Pass #NULL instead of an array to use all available
- * mechanisms (this is the default behavior).
- *
- * The D-Bus specification describes some of the supported mechanisms.
- *
- * @param server the server
- * @param mechanisms #NULL-terminated array of mechanisms
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-dbus_server_set_auth_mechanisms (DBusServer *server,
- const char **mechanisms)
-{
- char **copy;
-
- _dbus_return_val_if_fail (server != NULL, FALSE);
-
- SERVER_LOCK (server);
-
- if (mechanisms != NULL)
- {
- copy = _dbus_dup_string_array (mechanisms);
- if (copy == NULL)
- return FALSE;
- }
- else
- copy = NULL;
-
- dbus_free_string_array (server->auth_mechanisms);
- server->auth_mechanisms = copy;
-
- SERVER_UNLOCK (server);
-
- return TRUE;
-}
-
-static DBusDataSlotAllocator slot_allocator =
- _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (server_slots));
-
-/**
- * Allocates an integer ID to be used for storing application-specific
- * data on any DBusServer. The allocated ID may then be used
- * with dbus_server_set_data() and dbus_server_get_data().
- * The slot must be initialized with -1. If a nonnegative
- * slot is passed in, the refcount is incremented on that
- * slot, rather than creating a new slot.
- *
- * The allocated slot is global, i.e. all DBusServer objects will have
- * a slot with the given integer ID reserved.
- *
- * @param slot_p address of global variable storing the slot ID
- * @returns #FALSE on no memory
- */
-dbus_bool_t
-dbus_server_allocate_data_slot (dbus_int32_t *slot_p)
-{
- return _dbus_data_slot_allocator_alloc (&slot_allocator,
- slot_p);
-}
-
-/**
- * Deallocates a global ID for server data slots.
- * dbus_server_get_data() and dbus_server_set_data()
- * may no longer be used with this slot.
- * Existing data stored on existing DBusServer objects
- * will be freed when the server is finalized,
- * but may not be retrieved (and may only be replaced
- * if someone else reallocates the slot).
- *
- * @param slot_p address of the slot to deallocate
- */
-void
-dbus_server_free_data_slot (dbus_int32_t *slot_p)
-{
- _dbus_return_if_fail (*slot_p >= 0);
-
- _dbus_data_slot_allocator_free (&slot_allocator, slot_p);
-}
-
-/**
- * Stores a pointer on a DBusServer, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the server is finalized. The slot number
- * must have been allocated with dbus_server_allocate_data_slot().
- *
- * @param server the server
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
-dbus_server_set_data (DBusServer *server,
- int slot,
- void *data,
- DBusFreeFunction free_data_func)
-{
- DBusFreeFunction old_free_func;
- void *old_data;
- dbus_bool_t retval;
-
- _dbus_return_val_if_fail (server != NULL, FALSE);
-
- SERVER_LOCK (server);
-
- retval = _dbus_data_slot_list_set (&slot_allocator,
- &server->slot_list,
- slot, data, free_data_func,
- &old_free_func, &old_data);
-
-
- SERVER_UNLOCK (server);
-
- if (retval)
- {
- /* Do the actual free outside the server lock */
- if (old_free_func)
- (* old_free_func) (old_data);
- }
-
- return retval;
-}
-
-/**
- * Retrieves data previously set with dbus_server_set_data().
- * The slot must still be allocated (must not have been freed).
- *
- * @param server the server
- * @param slot the slot to get data from
- * @returns the data, or #NULL if not found
- */
-void*
-dbus_server_get_data (DBusServer *server,
- int slot)
-{
- void *res;
-
- _dbus_return_val_if_fail (server != NULL, NULL);
-
- SERVER_LOCK (server);
-
- res = _dbus_data_slot_list_get (&slot_allocator,
- &server->slot_list,
- slot);
-
- SERVER_UNLOCK (server);
-
- return res;
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <string.h>
-
-dbus_bool_t
-_dbus_server_test (void)
-{
- const char *valid_addresses[] = {
- "tcp:port=1234",
- "tcp:host=localhost,port=1234",
- "tcp:host=localhost,port=1234;tcp:port=5678",
-#ifdef DBUS_UNIX
- "unix:path=./boogie",
- "tcp:port=1234;unix:path=./boogie",
-#endif
- };
-
- DBusServer *server;
- int i;
-
- for (i = 0; i < _DBUS_N_ELEMENTS (valid_addresses); i++)
- {
- DBusError error = DBUS_ERROR_INIT;
- char *address;
- char *id;
-
- server = dbus_server_listen (valid_addresses[i], &error);
- if (server == NULL)
- {
- _dbus_warn ("server listen error: %s: %s\n", error.name, error.message);
- dbus_error_free (&error);
- _dbus_assert_not_reached ("Failed to listen for valid address.");
- }
-
- id = dbus_server_get_id (server);
- _dbus_assert (id != NULL);
- address = dbus_server_get_address (server);
- _dbus_assert (address != NULL);
-
- if (strstr (address, id) == NULL)
- {
- _dbus_warn ("server id '%s' is not in the server address '%s'\n",
- id, address);
- _dbus_assert_not_reached ("bad server id or address");
- }
-
- dbus_free (id);
- dbus_free (address);
-
- dbus_server_disconnect (server);
- dbus_server_unref (server);
- }
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-server.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-server.h
deleted file mode 100644
index bdbefa0f99..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-server.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-server.h DBusServer object
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_SERVER_H
-#define DBUS_SERVER_H
-
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-protocol.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusServer
- * @{
- */
-
-typedef struct DBusServer DBusServer;
-
-/** Called when a new connection to the server is available. Must reference and save the new
- * connection, or close the new connection. Set with dbus_server_set_new_connection_function().
- */
-typedef void (* DBusNewConnectionFunction) (DBusServer *server,
- DBusConnection *new_connection,
- void *data);
-
-DBUS_EXPORT
-DBusServer* dbus_server_listen (const char *address,
- DBusError *error);
-DBUS_EXPORT
-DBusServer* dbus_server_ref (DBusServer *server);
-DBUS_EXPORT
-void dbus_server_unref (DBusServer *server);
-DBUS_EXPORT
-void dbus_server_disconnect (DBusServer *server);
-DBUS_EXPORT
-dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
-DBUS_EXPORT
-char* dbus_server_get_address (DBusServer *server);
-DBUS_EXPORT
-char* dbus_server_get_id (DBusServer *server);
-DBUS_EXPORT
-void dbus_server_set_new_connection_function (DBusServer *server,
- DBusNewConnectionFunction function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_server_set_watch_functions (DBusServer *server,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-DBUS_EXPORT
-dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server,
- const char **mechanisms);
-
-DBUS_EXPORT
-dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-void dbus_server_free_data_slot (dbus_int32_t *slot_p);
-DBUS_EXPORT
-dbus_bool_t dbus_server_set_data (DBusServer *server,
- int slot,
- void *data,
- DBusFreeFunction free_data_func);
-DBUS_EXPORT
-void* dbus_server_get_data (DBusServer *server,
- int slot);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SERVER_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.c
deleted file mode 100644
index febfba2030..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.c
+++ /dev/null
@@ -1,969 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sha.c SHA-1 implementation
- *
- * Copyright (C) 2003 Red Hat Inc.
- * Copyright (C) 1995 A. M. Kuchling
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-sha.h"
-#include "dbus-marshal-basic.h" /* for byteswap routines */
-#include <string.h>
-
-/* The following comments have the history of where this code
- * comes from. I actually copied it from GNet in GNOME CVS.
- * - hp@redhat.com
- */
-
-/*
- * sha.h : Implementation of the Secure Hash Algorithm
- *
- * Part of the Python Cryptography Toolkit, version 1.0.0
- *
- * Copyright (C) 1995, A.M. Kuchling
- *
- * Distribute and use freely; there are no restrictions on further
- * dissemination and usage except those imposed by the laws of your
- * country of residence.
- *
- */
-
-/* SHA: NIST's Secure Hash Algorithm */
-
-/* Based on SHA code originally posted to sci.crypt by Peter Gutmann
- in message <30ajo5$oe8@ccu2.auckland.ac.nz>.
- Modified to test for endianness on creation of SHA objects by AMK.
- Also, the original specification of SHA was found to have a weakness
- by NSA/NIST. This code implements the fixed version of SHA.
-*/
-
-/* Here's the first paragraph of Peter Gutmann's posting:
-
-The following is my SHA (FIPS 180) code updated to allow use of the "fixed"
-SHA, thanks to Jim Gillogly and an anonymous contributor for the information on
-what's changed in the new version. The fix is a simple change which involves
-adding a single rotate in the initial expansion function. It is unknown
-whether this is an optimal solution to the problem which was discovered in the
-SHA or whether it's simply a bandaid which fixes the problem with a minimum of
-effort (for example the reengineering of a great many Capstone chips).
-*/
-
-/**
- * @defgroup DBusSHA SHA implementation
- * @ingroup DBusInternals
- * @brief SHA-1 hash
- *
- * Types and functions related to computing SHA-1 hash.
- */
-
-/**
- * @defgroup DBusSHAInternals SHA implementation details
- * @ingroup DBusInternals
- * @brief Internals of SHA implementation.
- *
- * The implementation of SHA-1 (see http://www.itl.nist.gov/fipspubs/fip180-1.htm).
- * This SHA implementation was written by A.M. Kuchling
- *
- * @{
- */
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/* The SHA block size and message digest sizes, in bytes */
-
-#define SHA_DATASIZE 64
-#define SHA_DIGESTSIZE 20
-
-/* The SHA f()-functions. The f1 and f3 functions can be optimized to
- save one boolean operation each - thanks to Rich Schroeppel,
- rcs@cs.arizona.edu for discovering this */
-
-/*#define f1(x,y,z) ( ( x & y ) | ( ~x & z ) ) // Rounds 0-19 */
-#define f1(x,y,z) ( z ^ ( x & ( y ^ z ) ) ) /* Rounds 0-19 */
-#define f2(x,y,z) ( x ^ y ^ z ) /* Rounds 20-39 */
-/*#define f3(x,y,z) ( ( x & y ) | ( x & z ) | ( y & z ) ) // Rounds 40-59 */
-#define f3(x,y,z) ( ( x & y ) | ( z & ( x | y ) ) ) /* Rounds 40-59 */
-#define f4(x,y,z) ( x ^ y ^ z ) /* Rounds 60-79 */
-
-/* The SHA Mysterious Constants */
-
-#define K1 0x5A827999L /* Rounds 0-19 */
-#define K2 0x6ED9EBA1L /* Rounds 20-39 */
-#define K3 0x8F1BBCDCL /* Rounds 40-59 */
-#define K4 0xCA62C1D6L /* Rounds 60-79 */
-
-/* SHA initial values */
-
-#define h0init 0x67452301L
-#define h1init 0xEFCDAB89L
-#define h2init 0x98BADCFEL
-#define h3init 0x10325476L
-#define h4init 0xC3D2E1F0L
-
-/* Note that it may be necessary to add parentheses to these macros if they
- are to be called with expressions as arguments */
-/* 32-bit rotate left - kludged with shifts */
-
-#define ROTL(n,X) ( ( ( X ) << n ) | ( ( X ) >> ( 32 - n ) ) )
-
-/* The initial expanding function. The hash function is defined over an
- 80-word expanded input array W, where the first 16 are copies of the input
- data, and the remaining 64 are defined by
-
- W[ i ] = W[ i - 16 ] ^ W[ i - 14 ] ^ W[ i - 8 ] ^ W[ i - 3 ]
-
- This implementation generates these values on the fly in a circular
- buffer - thanks to Colin Plumb, colin@nyx10.cs.du.edu for this
- optimization.
-
- The updated SHA changes the expanding function by adding a rotate of 1
- bit. Thanks to Jim Gillogly, jim@rand.org, and an anonymous contributor
- for this information */
-
-#define expand(W,i) ( W[ i & 15 ] = ROTL( 1, ( W[ i & 15 ] ^ W[ (i - 14) & 15 ] ^ \
- W[ (i - 8) & 15 ] ^ W[ (i - 3) & 15 ] ) ) )
-
-
-/* The prototype SHA sub-round. The fundamental sub-round is:
-
- a' = e + ROTL( 5, a ) + f( b, c, d ) + k + data;
- b' = a;
- c' = ROTL( 30, b );
- d' = c;
- e' = d;
-
- but this is implemented by unrolling the loop 5 times and renaming the
- variables ( e, a, b, c, d ) = ( a', b', c', d', e' ) each iteration.
- This code is then replicated 20 times for each of the 4 functions, using
- the next 20 values from the W[] array each time */
-
-#define subRound(a, b, c, d, e, f, k, data) \
- ( e += ROTL( 5, a ) + f( b, c, d ) + k + data, b = ROTL( 30, b ) )
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-
-/* Perform the SHA transformation. Note that this code, like MD5, seems to
- break some optimizing compilers due to the complexity of the expressions
- and the size of the basic block. It may be necessary to split it into
- sections, e.g. based on the four subrounds
-
- Note that this corrupts the context->data area */
-
-static void
-SHATransform(dbus_uint32_t *digest, dbus_uint32_t *data)
-{
- dbus_uint32_t A, B, C, D, E; /* Local vars */
- dbus_uint32_t eData[16]; /* Expanded data */
-
- /* Set up first buffer and local data buffer */
- A = digest[0];
- B = digest[1];
- C = digest[2];
- D = digest[3];
- E = digest[4];
- memmove (eData, data, SHA_DATASIZE);
-
- /* Heavy mangling, in 4 sub-rounds of 20 interations each. */
- subRound (A, B, C, D, E, f1, K1, eData[0]);
- subRound (E, A, B, C, D, f1, K1, eData[1]);
- subRound (D, E, A, B, C, f1, K1, eData[2]);
- subRound (C, D, E, A, B, f1, K1, eData[3]);
- subRound (B, C, D, E, A, f1, K1, eData[4]);
- subRound (A, B, C, D, E, f1, K1, eData[5]);
- subRound (E, A, B, C, D, f1, K1, eData[6]);
- subRound (D, E, A, B, C, f1, K1, eData[7]);
- subRound (C, D, E, A, B, f1, K1, eData[8]);
- subRound (B, C, D, E, A, f1, K1, eData[9]);
- subRound (A, B, C, D, E, f1, K1, eData[10]);
- subRound (E, A, B, C, D, f1, K1, eData[11]);
- subRound (D, E, A, B, C, f1, K1, eData[12]);
- subRound (C, D, E, A, B, f1, K1, eData[13]);
- subRound (B, C, D, E, A, f1, K1, eData[14]);
- subRound (A, B, C, D, E, f1, K1, eData[15]);
- subRound (E, A, B, C, D, f1, K1, expand ( eData, 16) );
- subRound (D, E, A, B, C, f1, K1, expand ( eData, 17) );
- subRound (C, D, E, A, B, f1, K1, expand ( eData, 18) );
- subRound (B, C, D, E, A, f1, K1, expand ( eData, 19) );
-
- subRound (A, B, C, D, E, f2, K2, expand ( eData, 20) );
- subRound (E, A, B, C, D, f2, K2, expand ( eData, 21) );
- subRound (D, E, A, B, C, f2, K2, expand ( eData, 22) );
- subRound (C, D, E, A, B, f2, K2, expand ( eData, 23) );
- subRound (B, C, D, E, A, f2, K2, expand ( eData, 24) );
- subRound (A, B, C, D, E, f2, K2, expand ( eData, 25) );
- subRound (E, A, B, C, D, f2, K2, expand ( eData, 26) );
- subRound (D, E, A, B, C, f2, K2, expand ( eData, 27) );
- subRound (C, D, E, A, B, f2, K2, expand ( eData, 28) );
- subRound (B, C, D, E, A, f2, K2, expand ( eData, 29) );
- subRound (A, B, C, D, E, f2, K2, expand ( eData, 30) );
- subRound (E, A, B, C, D, f2, K2, expand ( eData, 31) );
- subRound (D, E, A, B, C, f2, K2, expand ( eData, 32) );
- subRound (C, D, E, A, B, f2, K2, expand ( eData, 33) );
- subRound (B, C, D, E, A, f2, K2, expand ( eData, 34) );
- subRound (A, B, C, D, E, f2, K2, expand ( eData, 35) );
- subRound (E, A, B, C, D, f2, K2, expand ( eData, 36) );
- subRound (D, E, A, B, C, f2, K2, expand ( eData, 37) );
- subRound (C, D, E, A, B, f2, K2, expand ( eData, 38) );
- subRound (B, C, D, E, A, f2, K2, expand ( eData, 39) );
-
- subRound (A, B, C, D, E, f3, K3, expand ( eData, 40) );
- subRound (E, A, B, C, D, f3, K3, expand ( eData, 41) );
- subRound (D, E, A, B, C, f3, K3, expand ( eData, 42) );
- subRound (C, D, E, A, B, f3, K3, expand ( eData, 43) );
- subRound (B, C, D, E, A, f3, K3, expand ( eData, 44) );
- subRound (A, B, C, D, E, f3, K3, expand ( eData, 45) );
- subRound (E, A, B, C, D, f3, K3, expand ( eData, 46) );
- subRound (D, E, A, B, C, f3, K3, expand ( eData, 47) );
- subRound (C, D, E, A, B, f3, K3, expand ( eData, 48) );
- subRound (B, C, D, E, A, f3, K3, expand ( eData, 49) );
- subRound (A, B, C, D, E, f3, K3, expand ( eData, 50) );
- subRound (E, A, B, C, D, f3, K3, expand ( eData, 51) );
- subRound (D, E, A, B, C, f3, K3, expand ( eData, 52) );
- subRound (C, D, E, A, B, f3, K3, expand ( eData, 53) );
- subRound (B, C, D, E, A, f3, K3, expand ( eData, 54) );
- subRound (A, B, C, D, E, f3, K3, expand ( eData, 55) );
- subRound (E, A, B, C, D, f3, K3, expand ( eData, 56) );
- subRound (D, E, A, B, C, f3, K3, expand ( eData, 57) );
- subRound (C, D, E, A, B, f3, K3, expand ( eData, 58) );
- subRound (B, C, D, E, A, f3, K3, expand ( eData, 59) );
-
- subRound (A, B, C, D, E, f4, K4, expand ( eData, 60) );
- subRound (E, A, B, C, D, f4, K4, expand ( eData, 61) );
- subRound (D, E, A, B, C, f4, K4, expand ( eData, 62) );
- subRound (C, D, E, A, B, f4, K4, expand ( eData, 63) );
- subRound (B, C, D, E, A, f4, K4, expand ( eData, 64) );
- subRound (A, B, C, D, E, f4, K4, expand ( eData, 65) );
- subRound (E, A, B, C, D, f4, K4, expand ( eData, 66) );
- subRound (D, E, A, B, C, f4, K4, expand ( eData, 67) );
- subRound (C, D, E, A, B, f4, K4, expand ( eData, 68) );
- subRound (B, C, D, E, A, f4, K4, expand ( eData, 69) );
- subRound (A, B, C, D, E, f4, K4, expand ( eData, 70) );
- subRound (E, A, B, C, D, f4, K4, expand ( eData, 71) );
- subRound (D, E, A, B, C, f4, K4, expand ( eData, 72) );
- subRound (C, D, E, A, B, f4, K4, expand ( eData, 73) );
- subRound (B, C, D, E, A, f4, K4, expand ( eData, 74) );
- subRound (A, B, C, D, E, f4, K4, expand ( eData, 75) );
- subRound (E, A, B, C, D, f4, K4, expand ( eData, 76) );
- subRound (D, E, A, B, C, f4, K4, expand ( eData, 77) );
- subRound (C, D, E, A, B, f4, K4, expand ( eData, 78) );
- subRound (B, C, D, E, A, f4, K4, expand ( eData, 79) );
-
- /* Build message digest */
- digest[0] += A;
- digest[1] += B;
- digest[2] += C;
- digest[3] += D;
- digest[4] += E;
-}
-
-/* When run on a little-endian CPU we need to perform byte reversal on an
- array of longwords. */
-
-#ifdef WORDS_BIGENDIAN
-#define swap_words(buffer, byte_count)
-#else
-static void
-swap_words (dbus_uint32_t *buffer,
- int byte_count)
-{
- byte_count /= sizeof (dbus_uint32_t);
- while (byte_count--)
- {
- *buffer = DBUS_UINT32_SWAP_LE_BE (*buffer);
- ++buffer;
- }
-}
-#endif
-
-static void
-sha_init (DBusSHAContext *context)
-{
- /* Set the h-vars to their initial values */
- context->digest[0] = h0init;
- context->digest[1] = h1init;
- context->digest[2] = h2init;
- context->digest[3] = h3init;
- context->digest[4] = h4init;
-
- /* Initialise bit count */
- context->count_lo = context->count_hi = 0;
-}
-
-static void
-sha_append (DBusSHAContext *context,
- const unsigned char *buffer,
- unsigned int count)
-{
- dbus_uint32_t tmp;
- unsigned int dataCount;
-
- /* Update bitcount */
- tmp = context->count_lo;
- if (( context->count_lo = tmp + ( ( dbus_uint32_t) count << 3) ) < tmp)
- context->count_hi++; /* Carry from low to high */
- context->count_hi += count >> 29;
-
- /* Get count of bytes already in data */
- dataCount = (int) (tmp >> 3) & 0x3F;
-
- /* Handle any leading odd-sized chunks */
- if (dataCount)
- {
- unsigned char *p = (unsigned char *) context->data + dataCount;
-
- dataCount = SHA_DATASIZE - dataCount;
- if (count < dataCount)
- {
- memmove (p, buffer, count);
- return;
- }
- memmove (p, buffer, dataCount);
- swap_words (context->data, SHA_DATASIZE);
- SHATransform (context->digest, context->data);
- buffer += dataCount;
- count -= dataCount;
- }
-
- /* Process data in SHA_DATASIZE chunks */
- while (count >= SHA_DATASIZE)
- {
- memmove (context->data, buffer, SHA_DATASIZE);
- swap_words (context->data, SHA_DATASIZE);
- SHATransform (context->digest, context->data);
- buffer += SHA_DATASIZE;
- count -= SHA_DATASIZE;
- }
-
- /* Handle any remaining bytes of data. */
- memmove (context->data, buffer, count);
-}
-
-
-/* Final wrapup - pad to SHA_DATASIZE-byte boundary with the bit pattern
- 1 0* (64-bit count of bits processed, MSB-first) */
-
-static void
-sha_finish (DBusSHAContext *context, unsigned char digest[20])
-{
- int count;
- unsigned char *data_p;
-
- /* Compute number of bytes mod 64 */
- count = (int) context->count_lo;
- count = (count >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- data_p = (unsigned char *) context->data + count;
- *data_p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = SHA_DATASIZE - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8)
- {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset (data_p, 0, count);
- swap_words (context->data, SHA_DATASIZE);
- SHATransform (context->digest, context->data);
-
- /* Now fill the next block with 56 bytes */
- memset (context->data, 0, SHA_DATASIZE - 8);
- }
- else
- /* Pad block to 56 bytes */
- memset (data_p, 0, count - 8);
-
- /* Append length in bits and transform */
- context->data[14] = context->count_hi;
- context->data[15] = context->count_lo;
-
- swap_words (context->data, SHA_DATASIZE - 8);
- SHATransform (context->digest, context->data);
- swap_words (context->digest, SHA_DIGESTSIZE);
- memmove (digest, context->digest, SHA_DIGESTSIZE);
-}
-
-/** @} */ /* End of internals */
-
-/**
- * @addtogroup DBusSHA
- *
- * @{
- */
-
-/**
- * Initializes the SHA context.
- *
- * @param context an uninitialized context, typically on the stack.
- */
-void
-_dbus_sha_init (DBusSHAContext *context)
-{
- sha_init (context);
-}
-
-/**
- * Feeds more data into an existing shasum computation.
- *
- * @param context the SHA context
- * @param data the additional data to hash
- */
-void
-_dbus_sha_update (DBusSHAContext *context,
- const DBusString *data)
-{
- unsigned int inputLen;
- const unsigned char *input;
-
- input = (const unsigned char*) _dbus_string_get_const_data (data);
- inputLen = _dbus_string_get_length (data);
-
- sha_append (context, input, inputLen);
-}
-
-/**
- * SHA finalization. Ends an SHA message-digest operation, writing the
- * the message digest and zeroing the context. The results are
- * returned as a raw 20-byte digest, not as the ascii-hex-digits
- * string form of the digest.
- *
- * @param context the SHA context
- * @param results string to append the 20-byte SHA digest to
- * @returns #FALSE if not enough memory to append the digest
- *
- */
-dbus_bool_t
-_dbus_sha_final (DBusSHAContext *context,
- DBusString *results)
-{
- unsigned char digest[20];
-
- sha_finish (context, digest);
-
- if (!_dbus_string_append_len (results, digest, 20))
- return FALSE;
-
- /* some kind of security paranoia, though it seems pointless
- * to me given the nonzeroed stuff flying around
- */
- _DBUS_ZERO(*context);
-
- return TRUE;
-}
-
-/**
- * Computes the ASCII hex-encoded shasum of the given data and
- * appends it to the output string.
- *
- * @param data input data to be hashed
- * @param ascii_output string to append ASCII shasum to
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_sha_compute (const DBusString *data,
- DBusString *ascii_output)
-{
- DBusSHAContext context;
- DBusString digest;
-
- _dbus_sha_init (&context);
-
- _dbus_sha_update (&context, data);
-
- if (!_dbus_string_init (&digest))
- return FALSE;
-
- if (!_dbus_sha_final (&context, &digest))
- goto error;
-
- if (!_dbus_string_hex_encode (&digest, 0, ascii_output,
- _dbus_string_get_length (ascii_output)))
- goto error;
-
- _dbus_string_free (&digest);
-
- return TRUE;
-
- error:
- _dbus_string_free (&digest);
- return FALSE;
-}
-
-/** @} */ /* end of exported functions */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-static dbus_bool_t
-check_sha_binary (const unsigned char *input,
- int input_len,
- const char *expected)
-{
- DBusString input_str;
- DBusString expected_str;
- DBusString results;
-
- _dbus_string_init_const_len (&input_str, input, input_len);
- _dbus_string_init_const (&expected_str, expected);
-
- if (!_dbus_string_init (&results))
- _dbus_assert_not_reached ("no memory for SHA-1 results");
-
- if (!_dbus_sha_compute (&input_str, &results))
- _dbus_assert_not_reached ("no memory for SHA-1 results");
-
- if (!_dbus_string_equal (&expected_str, &results))
- {
- _dbus_warn ("Expected hash %s got %s for SHA-1 sum\n",
- expected,
- _dbus_string_get_const_data (&results));
- _dbus_string_free (&results);
- return FALSE;
- }
-
- _dbus_string_free (&results);
- return TRUE;
-}
-
-static dbus_bool_t
-check_sha_str (const char *input,
- const char *expected)
-{
- return check_sha_binary (input, strlen (input), expected);
-}
-
-static dbus_bool_t
-decode_compact_string (const DBusString *line,
- DBusString *decoded)
-{
- int n_bits;
- dbus_bool_t current_b;
- int offset;
- int next;
- long val;
- int length_bytes;
-
- offset = 0;
- next = 0;
-
- if (!_dbus_string_parse_int (line, offset, &val, &next))
- {
- fprintf (stderr, "could not parse length at start of compact string: %s\n",
- _dbus_string_get_const_data (line));
- return FALSE;
- }
-
- _dbus_string_skip_blank (line, next, &next);
-
- offset = next;
- if (!_dbus_string_parse_int (line, offset, &val, &next))
- {
- fprintf (stderr, "could not parse start bit 'b' in compact string: %s\n",
- _dbus_string_get_const_data (line));
- return FALSE;
- }
-
- if (!(val == 0 || val == 1))
- {
- fprintf (stderr, "the value 'b' must be 0 or 1, see sha-1/Readme.txt\n");
- return FALSE;
- }
-
- _dbus_string_skip_blank (line, next, &next);
-
- current_b = val;
- n_bits = 0;
-
- while (next < _dbus_string_get_length (line))
- {
- int total_bits;
-
- offset = next;
-
- if (_dbus_string_get_byte (line, offset) == '^')
- break;
-
- if (!_dbus_string_parse_int (line, offset, &val, &next))
- {
- fprintf (stderr, "could not parse bit count in compact string\n");
- return FALSE;
- }
-
- /* We now append "val" copies of "current_b" bits to the string */
- total_bits = n_bits + val;
- while (n_bits < total_bits)
- {
- int byte_containing_next_bit = n_bits / 8;
- int bit_containing_next_bit = 7 - (n_bits % 8);
- unsigned char old_byte;
-
- if (byte_containing_next_bit >= _dbus_string_get_length (decoded))
- {
- if (!_dbus_string_set_length (decoded, byte_containing_next_bit + 1))
- _dbus_assert_not_reached ("no memory to extend to next byte");
- }
-
- old_byte = _dbus_string_get_byte (decoded, byte_containing_next_bit);
- old_byte |= current_b << bit_containing_next_bit;
-
-#if 0
- printf ("Appending bit %d to byte %d at bit %d resulting in byte 0x%x\n",
- current_b, byte_containing_next_bit,
- bit_containing_next_bit, old_byte);
-#endif
-
- _dbus_string_set_byte (decoded, byte_containing_next_bit, old_byte);
-
- ++n_bits;
- }
-
- _dbus_string_skip_blank (line, next, &next);
-
- current_b = !current_b;
- }
-
- length_bytes = (n_bits / 8 + ((n_bits % 8) ? 1 : 0));
-
- if (_dbus_string_get_length (decoded) != length_bytes)
- {
- fprintf (stderr, "Expected length %d bytes %d bits for compact string, got %d bytes\n",
- length_bytes, n_bits, _dbus_string_get_length (decoded));
- return FALSE;
- }
- else
- return TRUE;
-}
-
-static dbus_bool_t
-get_next_expected_result (DBusString *results,
- DBusString *result)
-{
- DBusString line;
- dbus_bool_t retval;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&line))
- _dbus_assert_not_reached ("no memory");
-
- next_iteration:
- while (_dbus_string_pop_line (results, &line))
- {
- _dbus_string_delete_leading_blanks (&line);
-
- if (_dbus_string_get_length (&line) == 0)
- goto next_iteration;
- else if (_dbus_string_starts_with_c_str (&line, "#"))
- goto next_iteration;
- else if (_dbus_string_starts_with_c_str (&line, "H>"))
- {
- /* don't print */
- }
- else if (_dbus_string_starts_with_c_str (&line, "D>") ||
- _dbus_string_starts_with_c_str (&line, "<D"))
- goto next_iteration;
- else
- {
- int i;
-
- if (!_dbus_string_move (&line, 0, result, 0))
- _dbus_assert_not_reached ("no memory");
-
- i = 0;
- while (i < _dbus_string_get_length (result))
- {
- switch (_dbus_string_get_byte (result, i))
- {
- case 'A':
- _dbus_string_set_byte (result, i, 'a');
- break;
- case 'B':
- _dbus_string_set_byte (result, i, 'b');
- break;
- case 'C':
- _dbus_string_set_byte (result, i, 'c');
- break;
- case 'D':
- _dbus_string_set_byte (result, i, 'd');
- break;
- case 'E':
- _dbus_string_set_byte (result, i, 'e');
- break;
- case 'F':
- _dbus_string_set_byte (result, i, 'f');
- break;
- case '^':
- case ' ':
- _dbus_string_delete (result, i, 1);
- --i; /* to offset ++i below */
- break;
- }
-
- ++i;
- }
-
- break;
- }
- }
-
- retval = TRUE;
-
- /* out: */
- _dbus_string_free (&line);
- return retval;
-}
-
-static dbus_bool_t
-process_test_data (const char *test_data_dir)
-{
- DBusString tests_file;
- DBusString results_file;
- DBusString tests;
- DBusString results;
- DBusString line;
- DBusString tmp;
- int line_no;
- dbus_bool_t retval;
- int success_count;
- DBusError error = DBUS_ERROR_INIT;
-
- retval = FALSE;
-
- if (!_dbus_string_init (&tests_file))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&results_file))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&tests))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&results))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&line))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&tests_file, test_data_dir))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&results_file, test_data_dir))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_init_const (&tmp, "sha-1/byte-messages.sha1");
- if (!_dbus_concat_dir_and_file (&tests_file, &tmp))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_init_const (&tmp, "sha-1/byte-hashes.sha1");
- if (!_dbus_concat_dir_and_file (&results_file, &tmp))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_file_get_contents (&tests, &tests_file, &error))
- {
- fprintf (stderr, "could not load test data file %s: %s\n",
- _dbus_string_get_const_data (&tests_file),
- error.message);
- dbus_error_free (&error);
- goto out;
- }
-
- if (!_dbus_file_get_contents (&results, &results_file, &error))
- {
- fprintf (stderr, "could not load results data file %s: %s\n",
- _dbus_string_get_const_data (&results_file), error.message);
- dbus_error_free (&error);
- goto out;
- }
-
- success_count = 0;
- line_no = 0;
- next_iteration:
- while (_dbus_string_pop_line (&tests, &line))
- {
- line_no += 1;
-
- _dbus_string_delete_leading_blanks (&line);
-
- if (_dbus_string_get_length (&line) == 0)
- goto next_iteration;
- else if (_dbus_string_starts_with_c_str (&line, "#"))
- goto next_iteration;
- else if (_dbus_string_starts_with_c_str (&line, "H>"))
- {
- printf ("SHA-1: %s\n", _dbus_string_get_const_data (&line));
-
- if (_dbus_string_find (&line, 0, "Type 3", NULL))
- {
- /* See sha-1/Readme.txt - the "Type 3" tests are
- * random seeds, rather than data to be hashed.
- * we'd have to do a little bit more implementation
- * to use those tests.
- */
-
- printf (" (ending tests due to Type 3 tests seen - this is normal)\n");
- break;
- }
- }
- else if (_dbus_string_starts_with_c_str (&line, "D>") ||
- _dbus_string_starts_with_c_str (&line, "<D"))
- goto next_iteration;
- else
- {
- DBusString test;
- DBusString result;
- DBusString next_line;
- DBusString expected;
- dbus_bool_t success;
-
- success = FALSE;
-
- if (!_dbus_string_init (&next_line))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&expected))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&test))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&result))
- _dbus_assert_not_reached ("no memory");
-
- /* the "compact strings" are "^"-terminated not
- * newline-terminated so readahead to find the
- * "^"
- */
- while (!_dbus_string_find (&line, 0, "^", NULL) &&
- _dbus_string_pop_line (&tests, &next_line))
- {
- if (!_dbus_string_append_byte (&line, ' ') ||
- !_dbus_string_move (&next_line, 0, &line,
- _dbus_string_get_length (&line)))
- _dbus_assert_not_reached ("no memory");
- }
-
- if (!decode_compact_string (&line, &test))
- {
- fprintf (stderr, "Failed to decode line %d as a compact string\n",
- line_no);
- goto failure;
- }
-
- if (!_dbus_sha_compute (&test, &result))
- _dbus_assert_not_reached ("no memory for SHA-1 result");
-
- if (!get_next_expected_result (&results, &expected))
- {
- fprintf (stderr, "Failed to read an expected result\n");
- goto failure;
- }
-
- if (!_dbus_string_equal (&result, &expected))
- {
- fprintf (stderr, " for line %d got hash %s expected %s\n",
- line_no,
- _dbus_string_get_const_data (&result),
- _dbus_string_get_const_data (&expected));
- goto failure;
- }
- else
- {
- success_count += 1;
- }
-
- success = TRUE;
-
- failure:
- _dbus_string_free (&test);
- _dbus_string_free (&result);
- _dbus_string_free (&next_line);
- _dbus_string_free (&expected);
-
- if (!success)
- goto out;
- }
- }
-
- retval = TRUE;
-
- printf ("Passed the %d SHA-1 tests in the test file\n",
- success_count);
-
- out:
- _dbus_string_free (&tests_file);
- _dbus_string_free (&results_file);
- _dbus_string_free (&tests);
- _dbus_string_free (&results);
- _dbus_string_free (&line);
-
- return retval;
-}
-
-/**
- * @ingroup DBusSHAInternals
- * Unit test for SHA computation.
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_sha_test (const char *test_data_dir)
-{
- unsigned char all_bytes[256];
- int i;
-
- if (test_data_dir != NULL)
- {
- if (!process_test_data (test_data_dir))
- return FALSE;
- }
- else
- printf ("No test data dir\n");
-
- i = 0;
- while (i < 256)
- {
- all_bytes[i] = i;
- ++i;
- }
-
- if (!check_sha_binary (all_bytes, 256,
- "4916d6bdb7f78e6803698cab32d1586ea457dfc8"))
- return FALSE;
-
-#define CHECK(input,expected) if (!check_sha_str (input, expected)) return FALSE
-
- CHECK ("", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
- CHECK ("a", "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8");
- CHECK ("abc", "a9993e364706816aba3e25717850c26c9cd0d89d");
- CHECK ("message digest", "c12252ceda8be8994d5fa0290a47231c1d16aae3");
- CHECK ("abcdefghijklmnopqrstuvwxyz", "32d10c7b8cf96570ca04ce37f2a19d84240d3a89");
- CHECK ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
- "761c457bf73b14d27e9e9265c46f4b4dda11f940");
- CHECK ("12345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "50abf5706a150990a08b2c5ea40fa0e585554732");
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.h
deleted file mode 100644
index c48035b993..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sha.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sha.h SHA-1 implementation
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_SHA_H
-#define DBUS_SHA_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-string.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusSHAContext DBusSHAContext;
-
-/**
- * Struct storing state of the SHA algorithm
- */
-struct DBusSHAContext
-{
- dbus_uint32_t digest[5]; /**< Message digest */
- dbus_uint32_t count_lo; /**< 64-bit bit count */
- dbus_uint32_t count_hi; /**< No clue */
- dbus_uint32_t data[16]; /**< SHA data buffer */
-};
-
-void _dbus_sha_init (DBusSHAContext *context);
-void _dbus_sha_update (DBusSHAContext *context,
- const DBusString *data);
-dbus_bool_t _dbus_sha_final (DBusSHAContext *context,
- DBusString *results);
-dbus_bool_t _dbus_sha_compute (const DBusString *data,
- DBusString *ascii_output);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SHA_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-shared.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-shared.h
deleted file mode 100644
index 6a5767041e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-shared.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-shared.h Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs
- *
- * Copyright (C) 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SHARED_H
-#define DBUS_SHARED_H
-
-/* Don't include anything in here from anywhere else. It's
- * intended for use by any random library.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* avoids confusing emacs indentation */
-#endif
-#endif
-
-/* Normally docs are in .c files, but there isn't a .c file for this. */
-/**
- * @defgroup DBusShared Shared constants
- * @ingroup DBus
- *
- * @brief Shared header included by both libdbus and C/C++ bindings such as the GLib bindings.
- *
- * Usually a C/C++ binding such as the GLib or Qt binding won't want to include dbus.h in its
- * public headers. However, a few constants and macros may be useful to include; those are
- * found here and in dbus-protocol.h
- *
- * @{
- */
-
-
-/**
- * Well-known bus types. See dbus_bus_get().
- */
-typedef enum
-{
- DBUS_BUS_SESSION, /**< The login session bus */
- DBUS_BUS_SYSTEM, /**< The systemwide bus */
- DBUS_BUS_STARTER /**< The bus that started us, if any */
-} DBusBusType;
-
-/**
- * Results that a message handler can return.
- */
-typedef enum
-{
- DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
- DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
- DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */
-} DBusHandlerResult;
-
-/* Bus names */
-
-/** The bus name used to talk to the bus itself. */
-#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
-
-/* Paths */
-/** The object path used to talk to the bus itself. */
-#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
-/** The object path used in local/in-process-generated messages. */
-#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
-
-/* Interfaces, these #define don't do much other than
- * catch typos at compile time
- */
-/** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
-#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
-/** The interface supported by introspectable objects */
-#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
-/** The interface supported by objects with properties */
-#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
-/** The interface supported by most dbus peers */
-#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
-
-/** This is a special interface whose methods can only be invoked
- * by the local implementation (messages from remote apps aren't
- * allowed to specify this interface).
- */
-#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
-
-/* Owner flags */
-#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
-#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
-#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
-
-/* Replies to request for a name */
-#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
-#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
-#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */
-#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
-
-/* Replies to releasing a name */
-#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */
-#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
-#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
-
-/* Replies to service starts */
-#define DBUS_START_REPLY_SUCCESS 1 /**< Service was auto started */
-#define DBUS_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
-
-/** @} */
-
-#ifdef __cplusplus
-#if 0
-{ /* avoids confusing emacs indentation */
-#endif
-}
-#endif
-
-#endif /* DBUS_SHARED_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.c
deleted file mode 100644
index 2384961c8e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.c
+++ /dev/null
@@ -1,641 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-shell.c Shell command line utility functions.
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <string.h>
-#include "dbus-internals.h"
-#include "dbus-list.h"
-#include "dbus-memory.h"
-#include "dbus-protocol.h"
-#include "dbus-shell.h"
-#include "dbus-string.h"
-
-/* Single quotes preserve the literal string exactly. escape
- * sequences are not allowed; not even \' - if you want a '
- * in the quoted text, you have to do something like 'foo'\''bar'
- *
- * Double quotes allow $ ` " \ and newline to be escaped with backslash.
- * Otherwise double quotes preserve things literally.
- */
-
-static dbus_bool_t
-unquote_string_inplace (char* str, char** end)
-{
- char* dest;
- char* s;
- char quote_char;
-
- dest = s = str;
-
- quote_char = *s;
-
- if (!(*s == '"' || *s == '\''))
- {
- *end = str;
- return FALSE;
- }
-
- /* Skip the initial quote mark */
- ++s;
-
- if (quote_char == '"')
- {
- while (*s)
- {
- _dbus_assert(s > dest); /* loop invariant */
-
- switch (*s)
- {
- case '"':
- /* End of the string, return now */
- *dest = '\0';
- ++s;
- *end = s;
- return TRUE;
-
- case '\\':
- /* Possible escaped quote or \ */
- ++s;
- switch (*s)
- {
- case '"':
- case '\\':
- case '`':
- case '$':
- case '\n':
- *dest = *s;
- ++s;
- ++dest;
- break;
-
- default:
- /* not an escaped char */
- *dest = '\\';
- ++dest;
- /* ++s already done. */
- break;
- }
- break;
-
- default:
- *dest = *s;
- ++dest;
- ++s;
- break;
- }
-
- _dbus_assert(s > dest); /* loop invariant */
- }
- }
- else
- {
- while (*s)
- {
- _dbus_assert(s > dest); /* loop invariant */
-
- if (*s == '\'')
- {
- /* End of the string, return now */
- *dest = '\0';
- ++s;
- *end = s;
- return TRUE;
- }
- else
- {
- *dest = *s;
- ++dest;
- ++s;
- }
-
- _dbus_assert(s > dest); /* loop invariant */
- }
- }
-
- /* If we reach here this means the close quote was never encountered */
-
- *dest = '\0';
-
- *end = s;
- return FALSE;
-}
-
-/**
- * Unquotes a string as the shell (/bin/sh) would. Only handles
- * quotes; if a string contains file globs, arithmetic operators,
- * variables, backticks, redirections, or other special-to-the-shell
- * features, the result will be different from the result a real shell
- * would produce (the variables, backticks, etc. will be passed
- * through literally instead of being expanded). This function is
- * guaranteed to succeed if applied to the result of
- * _dbus_shell_quote(). If it fails, it returns %NULL.
- * The @p quoted_string need not actually contain quoted or
- * escaped text; _dbus_shell_unquote() simply goes through the string and
- * unquotes/unescapes anything that the shell would. Both single and
- * double quotes are handled, as are escapes including escaped
- * newlines. The return value must be freed with dbus_free().
- *
- * Shell quoting rules are a bit strange. Single quotes preserve the
- * literal string exactly. escape sequences are not allowed; not even
- * \' - if you want a ' in the quoted text, you have to do something
- * like 'foo'\''bar'. Double quotes allow $, `, ", \, and newline to
- * be escaped with backslash. Otherwise double quotes preserve things
- * literally.
- *
- * @param quoted_string shell-quoted string
- **/
-char*
-_dbus_shell_unquote (const char *quoted_string)
-{
- char *unquoted;
- char *end;
- char *start;
- char *ret;
- DBusString retval;
-
- unquoted = _dbus_strdup (quoted_string);
- if (unquoted == NULL)
- return NULL;
-
- start = unquoted;
- end = unquoted;
- if (!_dbus_string_init (&retval))
- {
- dbus_free (unquoted);
- return NULL;
- }
-
- /* The loop allows cases such as
- * "foo"blah blah'bar'woo foo"baz"la la la\'\''foo'
- */
- while (*start)
- {
- /* Append all non-quoted chars, honoring backslash escape
- */
-
- while (*start && !(*start == '"' || *start == '\''))
- {
- if (*start == '\\')
- {
- /* all characters can get escaped by backslash,
- * except newline, which is removed if it follows
- * a backslash outside of quotes
- */
-
- ++start;
- if (*start)
- {
- if (*start != '\n')
- {
- if (!_dbus_string_append_byte (&retval, *start))
- goto error;
- }
- ++start;
- }
- }
- else
- {
- if (!_dbus_string_append_byte (&retval, *start))
- goto error;
- ++start;
- }
- }
-
- if (*start)
- {
- if (!unquote_string_inplace (start, &end))
- goto error;
- else
- {
- if (!_dbus_string_append (&retval, start))
- goto error;
- start = end;
- }
- }
- }
-
- ret = _dbus_strdup (_dbus_string_get_data (&retval));
- if (!ret)
- goto error;
-
- dbus_free (unquoted);
- _dbus_string_free (&retval);
-
- return ret;
-
- error:
- dbus_free (unquoted);
- _dbus_string_free (&retval);
- return NULL;
-}
-
-/* _dbus_shell_parse_argv() does a semi-arbitrary weird subset of the way
- * the shell parses a command line. We don't do variable expansion,
- * don't understand that operators are tokens, don't do tilde expansion,
- * don't do command substitution, no arithmetic expansion, IFS gets ignored,
- * don't do filename globs, don't remove redirection stuff, etc.
- *
- * READ THE UNIX98 SPEC on "Shell Command Language" before changing
- * the behavior of this code.
- *
- * Steps to parsing the argv string:
- *
- * - tokenize the string (but since we ignore operators,
- * our tokenization may diverge from what the shell would do)
- * note that tokenization ignores the internals of a quoted
- * word and it always splits on spaces, not on IFS even
- * if we used IFS. We also ignore "end of input indicator"
- * (I guess this is control-D?)
- *
- * Tokenization steps, from UNIX98 with operator stuff removed,
- * are:
- *
- * 1) "If the current character is backslash, single-quote or
- * double-quote (\, ' or ") and it is not quoted, it will affect
- * quoting for subsequent characters up to the end of the quoted
- * text. The rules for quoting are as described in Quoting
- * . During token recognition no substitutions will be actually
- * performed, and the result token will contain exactly the
- * characters that appear in the input (except for newline
- * character joining), unmodified, including any embedded or
- * enclosing quotes or substitution operators, between the quote
- * mark and the end of the quoted text. The token will not be
- * delimited by the end of the quoted field."
- *
- * 2) "If the current character is an unquoted newline character,
- * the current token will be delimited."
- *
- * 3) "If the current character is an unquoted blank character, any
- * token containing the previous character is delimited and the
- * current character will be discarded."
- *
- * 4) "If the previous character was part of a word, the current
- * character will be appended to that word."
- *
- * 5) "If the current character is a "#", it and all subsequent
- * characters up to, but excluding, the next newline character
- * will be discarded as a comment. The newline character that
- * ends the line is not considered part of the comment. The
- * "#" starts a comment only when it is at the beginning of a
- * token. Since the search for the end-of-comment does not
- * consider an escaped newline character specially, a comment
- * cannot be continued to the next line."
- *
- * 6) "The current character will be used as the start of a new word."
- *
- *
- * - for each token (word), perform portions of word expansion, namely
- * field splitting (using default whitespace IFS) and quote
- * removal. Field splitting may increase the number of words.
- * Quote removal does not increase the number of words.
- *
- * "If the complete expansion appropriate for a word results in an
- * empty field, that empty field will be deleted from the list of
- * fields that form the completely expanded command, unless the
- * original word contained single-quote or double-quote characters."
- * - UNIX98 spec
- *
- *
- */
-
-static dbus_bool_t
-delimit_token (DBusString *token,
- DBusList **retval,
- DBusError *error)
-{
- char *str;
-
- str = _dbus_strdup (_dbus_string_get_data (token));
- if (!str)
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_list_append (retval, str))
- {
- dbus_free (str);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static DBusList*
-tokenize_command_line (const char *command_line, DBusError *error)
-{
- char current_quote;
- const char *p;
- DBusString current_token;
- DBusList *retval = NULL;
- dbus_bool_t quoted;;
-
- current_quote = '\0';
- quoted = FALSE;
- p = command_line;
-
- if (!_dbus_string_init (&current_token))
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- while (*p)
- {
- if (current_quote == '\\')
- {
- if (*p == '\n')
- {
- /* we append nothing; backslash-newline become nothing */
- }
- else
- {
- if (!_dbus_string_append_byte (&current_token, '\\') ||
- !_dbus_string_append_byte (&current_token, *p))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
- }
-
- current_quote = '\0';
- }
- else if (current_quote == '#')
- {
- /* Discard up to and including next newline */
- while (*p && *p != '\n')
- ++p;
-
- current_quote = '\0';
-
- if (*p == '\0')
- break;
- }
- else if (current_quote)
- {
- if (*p == current_quote &&
- /* check that it isn't an escaped double quote */
- !(current_quote == '"' && quoted))
- {
- /* close the quote */
- current_quote = '\0';
- }
-
- /* Everything inside quotes, and the close quote,
- * gets appended literally.
- */
-
- if (!_dbus_string_append_byte (&current_token, *p))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
- }
- else
- {
- switch (*p)
- {
- case '\n':
- if (!delimit_token (&current_token, &retval, error))
- goto error;
-
- _dbus_string_free (&current_token);
-
- if (!_dbus_string_init (&current_token))
- {
- _DBUS_SET_OOM (error);
- goto init_error;
- }
-
- break;
-
- case ' ':
- case '\t':
- /* If the current token contains the previous char, delimit
- * the current token. A nonzero length
- * token should always contain the previous char.
- */
- if (_dbus_string_get_length (&current_token) > 0)
- {
- if (!delimit_token (&current_token, &retval, error))
- goto error;
-
- _dbus_string_free (&current_token);
-
- if (!_dbus_string_init (&current_token))
- {
- _DBUS_SET_OOM (error);
- goto init_error;
- }
-
- }
-
- /* discard all unquoted blanks (don't add them to a token) */
- break;
-
-
- /* single/double quotes are appended to the token,
- * escapes are maybe appended next time through the loop,
- * comment chars are never appended.
- */
-
- case '\'':
- case '"':
- if (!_dbus_string_append_byte (&current_token, *p))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- /* FALL THRU */
-
- case '#':
- case '\\':
- current_quote = *p;
- break;
-
- default:
- /* Combines rules 4) and 6) - if we have a token, append to it,
- * otherwise create a new token.
- */
- if (!_dbus_string_append_byte (&current_token, *p))
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
- break;
- }
- }
-
- /* We need to count consecutive backslashes mod 2,
- * to detect escaped doublequotes.
- */
- if (*p != '\\')
- quoted = FALSE;
- else
- quoted = !quoted;
-
- ++p;
- }
-
- if (!delimit_token (&current_token, &retval, error))
- goto error;
-
- if (current_quote)
- {
- dbus_set_error_const (error, DBUS_ERROR_INVALID_ARGS, "Unclosed quotes in command line");
- goto error;
- }
-
- if (retval == NULL)
- {
- dbus_set_error_const (error, DBUS_ERROR_INVALID_ARGS, "No tokens found in command line");
- goto error;
- }
-
- _dbus_string_free (&current_token);
-
- return retval;
-
- error:
- _dbus_string_free (&current_token);
-
- init_error:
- if (retval)
- {
- _dbus_list_foreach (&retval, (DBusForeachFunction) dbus_free, NULL);
- _dbus_list_clear (&retval);
- }
-
- return NULL;
-}
-
-/**
- * _dbus_shell_parse_argv:
- *
- * Parses a command line into an argument vector, in much the same way
- * the shell would, but without many of the expansions the shell would
- * perform (variable expansion, globs, operators, filename expansion,
- * etc. are not supported). The results are defined to be the same as
- * those you would get from a UNIX98 /bin/sh, as long as the input
- * contains none of the unsupported shell expansions. If the input
- * does contain such expansions, they are passed through
- * literally. Free the returned vector with dbus_free_string_array().
- *
- * @param command_line command line to parse
- * @param argcp return location for number of args
- * @param argvp return location for array of args
- * @param error error information
- **/
-dbus_bool_t
-_dbus_shell_parse_argv (const char *command_line,
- int *argcp,
- char ***argvp,
- DBusError *error)
-{
- /* Code based on poptParseArgvString() from libpopt */
- int argc = 0;
- char **argv = NULL;
- DBusList *tokens = NULL;
- int i;
- DBusList *tmp_list;
-
- if (!command_line)
- {
- _dbus_verbose ("Command line is NULL\n");
- return FALSE;
- }
-
- tokens = tokenize_command_line (command_line, error);
- if (tokens == NULL)
- {
- _dbus_verbose ("No tokens for command line '%s'\n", command_line);
- return FALSE;
- }
-
- /* Because we can't have introduced any new blank space into the
- * tokens (we didn't do any new expansions), we don't need to
- * perform field splitting. If we were going to honor IFS or do any
- * expansions, we would have to do field splitting on each word
- * here. Also, if we were going to do any expansion we would need to
- * remove any zero-length words that didn't contain quotes
- * originally; but since there's no expansion we know all words have
- * nonzero length, unless they contain quotes.
- *
- * So, we simply remove quotes, and don't do any field splitting or
- * empty word removal, since we know there was no way to introduce
- * such things.
- */
-
- argc = _dbus_list_get_length (&tokens);
- argv = dbus_new (char *, argc + 1);
- if (!argv)
- {
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- i = 0;
- tmp_list = tokens;
- while (tmp_list)
- {
- argv[i] = _dbus_shell_unquote (tmp_list->data);
-
- if (!argv[i])
- {
- int j;
- for (j = 0; j < i; j++)
- dbus_free(argv[j]);
-
- dbus_free (argv);
- _DBUS_SET_OOM (error);
- goto error;
- }
-
- tmp_list = _dbus_list_get_next_link (&tokens, tmp_list);
- ++i;
- }
- argv[argc] = NULL;
-
- _dbus_list_foreach (&tokens, (DBusForeachFunction) dbus_free, NULL);
- _dbus_list_clear (&tokens);
-
- if (argcp)
- *argcp = argc;
-
- if (argvp)
- *argvp = argv;
- else
- dbus_free_string_array (argv);
-
- return TRUE;
-
- error:
- _dbus_list_foreach (&tokens, (DBusForeachFunction) dbus_free, NULL);
- _dbus_list_clear (&tokens);
-
- return FALSE;
-
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.h
deleted file mode 100644
index 06da274ee2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-shell.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-shell.h Shell command line utility functions.
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-
-#ifndef DBUS_SHELL_H
-#define DBUS_SHELL_H
-
-DBUS_BEGIN_DECLS
-
-char* _dbus_shell_unquote (const char *quoted_string);
-dbus_bool_t _dbus_shell_parse_argv (const char *command_line,
- int *argcp,
- char ***argvp,
- DBusError *error);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SHELL_H */
-
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.c
deleted file mode 100644
index 8a4701c9eb..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-signature.c Routines for reading recursive type signatures
- *
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "dbus-signature.h"
-#include "dbus-marshal-recursive.h"
-#include "dbus-marshal-basic.h"
-#include "dbus-internals.h"
-#include "dbus-test.h"
-
-/**
- * Implementation details of #DBusSignatureIter, all fields are private
- */
-typedef struct
-{
- const char *pos; /**< current position in the signature string */
- unsigned int finished : 1; /**< true if we are at the end iter */
- unsigned int in_array : 1; /**< true if we are a subiterator pointing to an array's element type */
-} DBusSignatureRealIter;
-
-/** macro that checks whether a typecode is a container type */
-#define TYPE_IS_CONTAINER(typecode) \
- ((typecode) == DBUS_TYPE_STRUCT || \
- (typecode) == DBUS_TYPE_DICT_ENTRY || \
- (typecode) == DBUS_TYPE_VARIANT || \
- (typecode) == DBUS_TYPE_ARRAY)
-
-
-/**
- * @defgroup DBusSignature Type signature parsing
- * @ingroup DBus
- * @brief Parsing D-Bus type signatures
- * @{
- */
-
-/**
- * Initializes a #DBusSignatureIter for reading a type signature. This
- * function is not safe to use on invalid signatures; be sure to
- * validate potentially invalid signatures with dbus_signature_validate
- * before using this function.
- *
- * @param iter pointer to an iterator to initialize
- * @param signature the type signature
- */
-void
-dbus_signature_iter_init (DBusSignatureIter *iter,
- const char *signature)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
-
- real_iter->pos = signature;
- real_iter->finished = FALSE;
- real_iter->in_array = FALSE;
-}
-
-/**
- * Returns the current type pointed to by the iterator.
- * If the iterator is pointing at a type code such as 's', then
- * it will be returned directly.
- *
- * However, when the parser encounters a container type start
- * character such as '(' for a structure, the corresponding type for
- * the container will be returned, e.g. DBUS_TYPE_STRUCT, not '('.
- * In this case, you should initialize a sub-iterator with
- * dbus_signature_iter_recurse() to parse the container type.
- *
- * @param iter pointer to an iterator
- * @returns current type (e.g. #DBUS_TYPE_STRING, #DBUS_TYPE_ARRAY)
- */
-int
-dbus_signature_iter_get_current_type (const DBusSignatureIter *iter)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
-
- return _dbus_first_type_in_signature_c_str (real_iter->pos, 0);
-}
-
-/**
- * Returns the signature of the single complete type starting at the
- * given iterator.
- *
- * For example, if the iterator is pointing at the start of "(ii)ii"
- * (which is "a struct of two ints, followed by an int, followed by an
- * int"), then "(ii)" would be returned. If the iterator is pointing at
- * one of the "i" then just that "i" would be returned.
- *
- * @param iter pointer to an iterator
- * @returns current signature; or #NULL if no memory. Should be freed with dbus_free()
- */
-char *
-dbus_signature_iter_get_signature (const DBusSignatureIter *iter)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
- DBusString str;
- char *ret;
- int pos;
-
- if (!_dbus_string_init (&str))
- return NULL;
-
- pos = 0;
- _dbus_type_signature_next (real_iter->pos, &pos);
-
- if (!_dbus_string_append_len (&str, real_iter->pos, pos))
- return NULL;
- if (!_dbus_string_steal_data (&str, &ret))
- ret = NULL;
- _dbus_string_free (&str);
-
- return ret;
-}
-
-/**
- * Convenience function for returning the element type of an array;
- * This function allows you to avoid initializing a sub-iterator and
- * getting its current type.
- *
- * Undefined behavior results if you invoke this function when the
- * current type of the iterator is not #DBUS_TYPE_ARRAY.
- *
- * @param iter pointer to an iterator
- * @returns current array element type
- */
-int
-dbus_signature_iter_get_element_type (const DBusSignatureIter *iter)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
-
- _dbus_return_val_if_fail (dbus_signature_iter_get_current_type (iter) == DBUS_TYPE_ARRAY, DBUS_TYPE_INVALID);
-
- return _dbus_first_type_in_signature_c_str (real_iter->pos, 1);
-}
-
-/**
- * Skip to the next value on this "level". e.g. the next field in a
- * struct, the next value in an array. Returns #FALSE at the end of the
- * current container.
- *
- * @param iter the iterator
- * @returns FALSE if nothing more to read at or below this level
- */
-dbus_bool_t
-dbus_signature_iter_next (DBusSignatureIter *iter)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
-
- if (real_iter->finished)
- return FALSE;
- else
- {
- int pos;
-
- if (real_iter->in_array)
- {
- real_iter->finished = TRUE;
- return FALSE;
- }
-
- pos = 0;
- _dbus_type_signature_next (real_iter->pos, &pos);
- real_iter->pos += pos;
-
- if (*real_iter->pos == DBUS_STRUCT_END_CHAR
- || *real_iter->pos == DBUS_DICT_ENTRY_END_CHAR)
- {
- real_iter->finished = TRUE;
- return FALSE;
- }
-
- return *real_iter->pos != DBUS_TYPE_INVALID;
- }
-}
-
-/**
- * Initialize a new iterator pointing to the first type in the current
- * container.
- *
- * The results are undefined when calling this if the current type is
- * a non-container (i.e. if dbus_type_is_container() returns #FALSE
- * for the result of dbus_signature_iter_get_current_type()).
- *
- * @param iter the current interator
- * @param subiter an iterator to initialize pointing to the first child
- */
-void
-dbus_signature_iter_recurse (const DBusSignatureIter *iter,
- DBusSignatureIter *subiter)
-{
- DBusSignatureRealIter *real_iter = (DBusSignatureRealIter *) iter;
- DBusSignatureRealIter *real_sub_iter = (DBusSignatureRealIter *) subiter;
-
- _dbus_return_if_fail (dbus_type_is_container (dbus_signature_iter_get_current_type (iter)));
-
- *real_sub_iter = *real_iter;
- real_sub_iter->in_array = FALSE;
- real_sub_iter->pos++;
-
- if (dbus_signature_iter_get_current_type (iter) == DBUS_TYPE_ARRAY)
- real_sub_iter->in_array = TRUE;
-}
-
-/**
- * Check a type signature for validity. Remember that #NULL can always
- * be passed instead of a DBusError*, if you don't care about having
- * an error name and message.
- *
- * @param signature a potentially invalid type signature
- * @param error error return
- * @returns #TRUE if signature is valid or #FALSE if an error is set
- */
-dbus_bool_t
-dbus_signature_validate (const char *signature,
- DBusError *error)
-
-{
- DBusString str;
- DBusValidity reason;
-
- _dbus_string_init_const (&str, signature);
- reason = _dbus_validate_signature_with_reason (&str, 0, _dbus_string_get_length (&str));
-
- if (reason == DBUS_VALID)
- return TRUE;
- else
- {
- dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, _dbus_validity_to_error_message (reason));
- return FALSE;
- }
-}
-
-/**
- * Check that a type signature is both valid and contains exactly one
- * complete type. "One complete type" means a single basic type,
- * array, struct, or dictionary, though the struct or array may be
- * arbitrarily recursive and complex. More than one complete type
- * would mean for example "ii" or two integers in sequence.
- *
- * @param signature a potentially invalid type signature
- * @param error error return
- * @returns #TRUE if signature is valid and has exactly one complete type
- */
-dbus_bool_t
-dbus_signature_validate_single (const char *signature,
- DBusError *error)
-{
- DBusSignatureIter iter;
-
- if (!dbus_signature_validate (signature, error))
- return FALSE;
-
- dbus_signature_iter_init (&iter, signature);
- if (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_INVALID)
- goto lose;
- if (!dbus_signature_iter_next (&iter))
- return TRUE;
- lose:
- dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, "Exactly one complete type required in signature");
- return FALSE;
-}
-
-/**
- * A "container type" can contain basic types, or nested
- * container types. #DBUS_TYPE_INVALID is not a container type.
- *
- * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
- * to this function. The valid type-codes are defined by dbus-protocol.h
- * and can be checked with dbus_type_is_valid().
- *
- * @param typecode either a valid type-code or DBUS_TYPE_INVALID
- * @returns #TRUE if type is a container
- */
-dbus_bool_t
-dbus_type_is_container (int typecode)
-{
- /* only reasonable (non-line-noise) typecodes are allowed */
- _dbus_return_val_if_fail (dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID,
- FALSE);
- return TYPE_IS_CONTAINER (typecode);
-}
-
-/**
- * A "basic type" is a somewhat arbitrary concept, but the intent is
- * to include those types that are fully-specified by a single
- * typecode, with no additional type information or nested values. So
- * all numbers and strings are basic types and structs, arrays, and
- * variants are not basic types. #DBUS_TYPE_INVALID is not a basic
- * type.
- *
- * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
- * to this function. The valid type-codes are defined by dbus-protocol.h
- * and can be checked with dbus_type_is_valid().
- *
- * @param typecode either a valid type-code or DBUS_TYPE_INVALID
- * @returns #TRUE if type is basic
- */
-dbus_bool_t
-dbus_type_is_basic (int typecode)
-{
- /* only reasonable (non-line-noise) typecodes are allowed */
- _dbus_return_val_if_fail (dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID,
- FALSE);
-
- /* everything that isn't invalid or a container */
- return !(typecode == DBUS_TYPE_INVALID || TYPE_IS_CONTAINER (typecode));
-}
-
-/**
- * Tells you whether values of this type can change length if you set
- * them to some other value. For this purpose, you assume that the
- * first byte of the old and new value would be in the same location,
- * so alignment padding is not a factor.
- *
- * This function is useful to determine whether
- * dbus_message_iter_get_fixed_array() may be used.
- *
- * Some structs are fixed-size (if they contain only fixed-size types)
- * but struct is not considered a fixed type for purposes of this
- * function.
- *
- * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
- * to this function. The valid type-codes are defined by dbus-protocol.h
- * and can be checked with dbus_type_is_valid().
- *
- * @param typecode either a valid type-code or DBUS_TYPE_INVALID
- * @returns #FALSE if the type can occupy different lengths
- */
-dbus_bool_t
-dbus_type_is_fixed (int typecode)
-{
- /* only reasonable (non-line-noise) typecodes are allowed */
- _dbus_return_val_if_fail (dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID,
- FALSE);
-
- switch (typecode)
- {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- case DBUS_TYPE_UNIX_FD:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-/**
- * Return #TRUE if the argument is a valid typecode.
- * #DBUS_TYPE_INVALID surprisingly enough is not considered valid, and
- * random unknown bytes aren't either. This function is safe with
- * untrusted data.
- *
- * @param typecode a potential type-code
- * @returns #TRUE if valid
- */
-dbus_bool_t
-dbus_type_is_valid (int typecode)
-{
- switch (typecode)
- {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- case DBUS_TYPE_DOUBLE:
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- case DBUS_TYPE_SIGNATURE:
- case DBUS_TYPE_ARRAY:
- case DBUS_TYPE_STRUCT:
- case DBUS_TYPE_DICT_ENTRY:
- case DBUS_TYPE_VARIANT:
- case DBUS_TYPE_UNIX_FD:
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
-/** @} */ /* end of DBusSignature group */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-/**
- * @ingroup DBusSignatureInternals
- * Unit test for DBusSignature.
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_signature_test (void)
-{
- DBusSignatureIter iter;
- DBusSignatureIter subiter;
- DBusSignatureIter subsubiter;
- DBusSignatureIter subsubsubiter;
- const char *sig;
- dbus_bool_t boolres;
-
- _dbus_assert (sizeof (DBusSignatureIter) >= sizeof (DBusSignatureRealIter));
-
- sig = "";
- _dbus_assert (dbus_signature_validate (sig, NULL));
- _dbus_assert (!dbus_signature_validate_single (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_INVALID);
-
- sig = DBUS_TYPE_STRING_AS_STRING;
- _dbus_assert (dbus_signature_validate (sig, NULL));
- _dbus_assert (dbus_signature_validate_single (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_STRING);
-
- sig = DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_BYTE_AS_STRING;
- _dbus_assert (dbus_signature_validate (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_STRING);
- boolres = dbus_signature_iter_next (&iter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_BYTE);
-
- sig = DBUS_TYPE_UINT16_AS_STRING
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_UINT32_AS_STRING
- DBUS_TYPE_VARIANT_AS_STRING
- DBUS_TYPE_DOUBLE_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING;
- _dbus_assert (dbus_signature_validate (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_UINT16);
- boolres = dbus_signature_iter_next (&iter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_STRUCT);
- dbus_signature_iter_recurse (&iter, &subiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_STRING);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_UINT32);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_VARIANT);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_DOUBLE);
-
- sig = DBUS_TYPE_UINT16_AS_STRING
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_UINT32_AS_STRING
- DBUS_TYPE_BYTE_AS_STRING
- DBUS_TYPE_ARRAY_AS_STRING
- DBUS_TYPE_ARRAY_AS_STRING
- DBUS_TYPE_DOUBLE_AS_STRING
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_BYTE_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING;
- _dbus_assert (dbus_signature_validate (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_UINT16);
- boolres = dbus_signature_iter_next (&iter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_STRUCT);
- dbus_signature_iter_recurse (&iter, &subiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_UINT32);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_BYTE);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_ARRAY);
- _dbus_assert (dbus_signature_iter_get_element_type (&subiter) == DBUS_TYPE_ARRAY);
-
- dbus_signature_iter_recurse (&subiter, &subsubiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subsubiter) == DBUS_TYPE_ARRAY);
- _dbus_assert (dbus_signature_iter_get_element_type (&subsubiter) == DBUS_TYPE_DOUBLE);
-
- dbus_signature_iter_recurse (&subsubiter, &subsubsubiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subsubsubiter) == DBUS_TYPE_DOUBLE);
- boolres = dbus_signature_iter_next (&subiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subiter) == DBUS_TYPE_STRUCT);
- dbus_signature_iter_recurse (&subiter, &subsubiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subsubiter) == DBUS_TYPE_BYTE);
-
- sig = DBUS_TYPE_ARRAY_AS_STRING
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_INT16_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING
- DBUS_TYPE_VARIANT_AS_STRING;
- _dbus_assert (dbus_signature_validate (sig, NULL));
- _dbus_assert (!dbus_signature_validate_single (sig, NULL));
- dbus_signature_iter_init (&iter, sig);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_ARRAY);
- _dbus_assert (dbus_signature_iter_get_element_type (&iter) == DBUS_TYPE_DICT_ENTRY);
-
- dbus_signature_iter_recurse (&iter, &subiter);
- dbus_signature_iter_recurse (&subiter, &subsubiter);
- _dbus_assert (dbus_signature_iter_get_current_type (&subsubiter) == DBUS_TYPE_INT16);
- boolres = dbus_signature_iter_next (&subsubiter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&subsubiter) == DBUS_TYPE_STRING);
- boolres = dbus_signature_iter_next (&subsubiter);
- _dbus_assert (!boolres);
-
- boolres = dbus_signature_iter_next (&iter);
- _dbus_assert (boolres);
- _dbus_assert (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_VARIANT);
- boolres = dbus_signature_iter_next (&iter);
- _dbus_assert (!boolres);
-
- sig = DBUS_TYPE_DICT_ENTRY_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_TYPE_ARRAY_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_TYPE_UINT32_AS_STRING
- DBUS_TYPE_ARRAY_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_TYPE_ARRAY_AS_STRING
- DBUS_TYPE_DICT_ENTRY_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_DICT_ENTRY_END_CHAR_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_INT32_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_INT32_AS_STRING
- DBUS_TYPE_STRING_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_STRUCT_END_CHAR_AS_STRING
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
-
- sig = DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_BOOLEAN_AS_STRING;
- _dbus_assert (!dbus_signature_validate (sig, NULL));
- return TRUE;
-#if 0
- oom:
- _dbus_assert_not_reached ("out of memory");
- return FALSE;
-#endif
-}
-
-#endif
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.h
deleted file mode 100644
index 443941c81b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-signature.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-signatures.h utility functions for D-Bus types
- *
- * Copyright (C) 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_SIGNATURES_H
-#define DBUS_SIGNATURES_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusSignature
- * @{
- */
-
-/**
- * DBusSignatureIter struct; contains no public fields
- */
-typedef struct
-{
- void *dummy1; /**< Don't use this */
- void *dummy2; /**< Don't use this */
- dbus_uint32_t dummy8; /**< Don't use this */
- int dummy12; /**< Don't use this */
- int dummy17; /**< Don't use this */
-} DBusSignatureIter;
-
-DBUS_EXPORT
-void dbus_signature_iter_init (DBusSignatureIter *iter,
- const char *signature);
-
-DBUS_EXPORT
-int dbus_signature_iter_get_current_type (const DBusSignatureIter *iter);
-
-DBUS_EXPORT
-char * dbus_signature_iter_get_signature (const DBusSignatureIter *iter);
-
-DBUS_EXPORT
-int dbus_signature_iter_get_element_type (const DBusSignatureIter *iter);
-
-DBUS_EXPORT
-dbus_bool_t dbus_signature_iter_next (DBusSignatureIter *iter);
-
-DBUS_EXPORT
-void dbus_signature_iter_recurse (const DBusSignatureIter *iter,
- DBusSignatureIter *subiter);
-
-DBUS_EXPORT
-dbus_bool_t dbus_signature_validate (const char *signature,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_signature_validate_single (const char *signature,
- DBusError *error);
-
-DBUS_EXPORT
-dbus_bool_t dbus_type_is_valid (int typecode);
-
-DBUS_EXPORT
-dbus_bool_t dbus_type_is_basic (int typecode);
-DBUS_EXPORT
-dbus_bool_t dbus_type_is_container (int typecode);
-DBUS_EXPORT
-dbus_bool_t dbus_type_is_fixed (int typecode);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SIGNATURE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-epoll.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-epoll.c
deleted file mode 100644
index 4cd9a563af..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-epoll.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-socket-set-epoll.c - a socket set implemented via Linux epoll(4)
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-socket-set.h"
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-sysdeps.h>
-
-#ifndef __linux__
-# error This file is for Linux epoll(4)
-#endif
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/epoll.h>
-#include <unistd.h>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-typedef struct {
- DBusSocketSet parent;
- int epfd;
-} DBusSocketSetEpoll;
-
-static inline DBusSocketSetEpoll *
-socket_set_epoll_cast (DBusSocketSet *set)
-{
- _dbus_assert (set->cls == &_dbus_socket_set_epoll_class);
- return (DBusSocketSetEpoll *) set;
-}
-
-/* this is safe to call on a partially-allocated socket set */
-static void
-socket_set_epoll_free (DBusSocketSet *set)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
-
- if (self == NULL)
- return;
-
- if (self->epfd != -1)
- close (self->epfd);
-
- dbus_free (self);
-}
-
-DBusSocketSet *
-_dbus_socket_set_epoll_new (void)
-{
- DBusSocketSetEpoll *self;
-
- self = dbus_new0 (DBusSocketSetEpoll, 1);
-
- if (self == NULL)
- return NULL;
-
- self->parent.cls = &_dbus_socket_set_epoll_class;
-
- self->epfd = epoll_create1 (EPOLL_CLOEXEC);
-
- if (self->epfd == -1)
- {
- int flags;
-
- /* the size hint is ignored unless you have a rather old kernel,
- * but must be positive on some versions, so just pick something
- * arbitrary; it's a hint, not a limit */
- self->epfd = epoll_create (42);
-
- flags = fcntl (self->epfd, F_GETFD, 0);
-
- if (flags != -1)
- fcntl (self->epfd, F_SETFD, flags | FD_CLOEXEC);
- }
-
- if (self->epfd == -1)
- {
- socket_set_epoll_free ((DBusSocketSet *) self);
- return NULL;
- }
-
- return (DBusSocketSet *) self;
-}
-
-static uint32_t
-watch_flags_to_epoll_events (unsigned int flags)
-{
- uint32_t events = 0;
-
- if (flags & DBUS_WATCH_READABLE)
- events |= EPOLLIN;
- if (flags & DBUS_WATCH_WRITABLE)
- events |= EPOLLOUT;
-
- return events;
-}
-
-static unsigned int
-epoll_events_to_watch_flags (uint32_t events)
-{
- short flags = 0;
-
- if (events & EPOLLIN)
- flags |= DBUS_WATCH_READABLE;
- if (events & EPOLLOUT)
- flags |= DBUS_WATCH_WRITABLE;
- if (events & EPOLLHUP)
- flags |= DBUS_WATCH_HANGUP;
- if (events & EPOLLERR)
- flags |= DBUS_WATCH_ERROR;
-
- return flags;
-}
-
-static dbus_bool_t
-socket_set_epoll_add (DBusSocketSet *set,
- int fd,
- unsigned int flags,
- dbus_bool_t enabled)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
- struct epoll_event event;
- int err;
-
- event.data.fd = fd;
-
- if (enabled)
- {
- event.events = watch_flags_to_epoll_events (flags);
- }
- else
- {
- /* We need to add *something* to reserve space in the kernel's data
- * structures: see socket_set_epoll_disable for more details */
- event.events = EPOLLET;
- }
-
- if (epoll_ctl (self->epfd, EPOLL_CTL_ADD, fd, &event) == 0)
- return TRUE;
-
- /* Anything except ENOMEM, ENOSPC means we have an internal error. */
- err = errno;
- switch (err)
- {
- case ENOMEM:
- case ENOSPC:
- /* be silent: this is basically OOM, which our callers are expected
- * to cope with */
- break;
-
- case EBADF:
- _dbus_warn ("Bad fd %d\n", fd);
- break;
-
- case EEXIST:
- _dbus_warn ("fd %d added and then added again\n", fd);
- break;
-
- default:
- _dbus_warn ("Misc error when trying to watch fd %d: %s\n", fd,
- strerror (err));
- break;
- }
-
- return FALSE;
-}
-
-static void
-socket_set_epoll_enable (DBusSocketSet *set,
- int fd,
- unsigned int flags)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
- struct epoll_event event;
- int err;
-
- event.data.fd = fd;
- event.events = watch_flags_to_epoll_events (flags);
-
- if (epoll_ctl (self->epfd, EPOLL_CTL_MOD, fd, &event) == 0)
- return;
-
- err = errno;
-
- /* Enabling a file descriptor isn't allowed to fail, even for OOM, so we
- * do our best to avoid all of these. */
- switch (err)
- {
- case EBADF:
- _dbus_warn ("Bad fd %d\n", fd);
- break;
-
- case ENOENT:
- _dbus_warn ("fd %d enabled before it was added\n", fd);
- break;
-
- case ENOMEM:
- _dbus_warn ("Insufficient memory to change watch for fd %d\n", fd);
- break;
-
- default:
- _dbus_warn ("Misc error when trying to watch fd %d: %s\n", fd,
- strerror (err));
- break;
- }
-}
-
-static void
-socket_set_epoll_disable (DBusSocketSet *set,
- int fd)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
- struct epoll_event event;
- int err;
-
- /* The naive thing to do would be EPOLL_CTL_DEL, but that'll probably
- * free resources in the kernel. When we come to do socket_set_epoll_enable,
- * there might not be enough resources to bring it back!
- *
- * The next idea you might have is to set the flags to 0. However, events
- * always trigger on EPOLLERR and EPOLLHUP, even if libdbus isn't actually
- * delivering them to a DBusWatch. Because epoll is level-triggered by
- * default, we'll busy-loop on an unhandled error or hangup; not good.
- *
- * So, let's set it to be edge-triggered: then the worst case is that
- * we return from poll immediately on one iteration, ignore it because no
- * watch is enabled, then go back to normal. When we re-enable a watch
- * we'll switch back to level-triggered and be notified again (verified to
- * work on 2.6.32). Compile this file with -DTEST_BEHAVIOUR_OF_EPOLLET for
- * test code.
- */
- event.data.fd = fd;
- event.events = EPOLLET;
-
- if (epoll_ctl (self->epfd, EPOLL_CTL_MOD, fd, &event) == 0)
- return;
-
- err = errno;
- _dbus_warn ("Error when trying to watch fd %d: %s\n", fd,
- strerror (err));
-}
-
-static void
-socket_set_epoll_remove (DBusSocketSet *set,
- int fd)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
- int err;
- /* Kernels < 2.6.9 require a non-NULL struct pointer, even though its
- * contents are ignored */
- struct epoll_event dummy = { 0 };
-
- if (epoll_ctl (self->epfd, EPOLL_CTL_DEL, fd, &dummy) == 0)
- return;
-
- err = errno;
- _dbus_warn ("Error when trying to remove fd %d: %s\n", fd, strerror (err));
-}
-
-/* Optimally, this should be the same as in DBusLoop: we use it to translate
- * between struct epoll_event and DBusSocketEvent without allocating heap
- * memory. */
-#define N_STACK_DESCRIPTORS 64
-
-static int
-socket_set_epoll_poll (DBusSocketSet *set,
- DBusSocketEvent *revents,
- int max_events,
- int timeout_ms)
-{
- DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
- struct epoll_event events[N_STACK_DESCRIPTORS];
- int n_ready;
- int i;
-
- _dbus_assert (max_events > 0);
-
- n_ready = epoll_wait (self->epfd, events,
- MIN (_DBUS_N_ELEMENTS (events), max_events),
- timeout_ms);
-
- if (n_ready <= 0)
- return n_ready;
-
- for (i = 0; i < n_ready; i++)
- {
- revents[i].fd = events[i].data.fd;
- revents[i].flags = epoll_events_to_watch_flags (events[i].events);
- }
-
- return n_ready;
-}
-
-DBusSocketSetClass _dbus_socket_set_epoll_class = {
- socket_set_epoll_free,
- socket_set_epoll_add,
- socket_set_epoll_remove,
- socket_set_epoll_enable,
- socket_set_epoll_disable,
- socket_set_epoll_poll
-};
-
-#ifdef TEST_BEHAVIOUR_OF_EPOLLET
-/* usage: cat /dev/null | ./epoll
- *
- * desired output:
- * ctl ADD: 0
- * wait for HUP, edge-triggered: 1
- * wait for HUP again: 0
- * ctl MOD: 0
- * wait for HUP: 1
- */
-
-#include <sys/epoll.h>
-
-#include <stdio.h>
-
-int
-main (void)
-{
- struct epoll_event input;
- struct epoll_event output;
- int epfd = epoll_create1 (EPOLL_CLOEXEC);
- int fd = 0; /* stdin */
- int ret;
-
- input.events = EPOLLHUP | EPOLLET;
- ret = epoll_ctl (epfd, EPOLL_CTL_ADD, fd, &input);
- printf ("ctl ADD: %d\n", ret);
-
- ret = epoll_wait (epfd, &output, 1, -1);
- printf ("wait for HUP, edge-triggered: %d\n", ret);
-
- ret = epoll_wait (epfd, &output, 1, 1);
- printf ("wait for HUP again: %d\n", ret);
-
- input.events = EPOLLHUP;
- ret = epoll_ctl (epfd, EPOLL_CTL_MOD, fd, &input);
- printf ("ctl MOD: %d\n", ret);
-
- ret = epoll_wait (epfd, &output, 1, -1);
- printf ("wait for HUP: %d\n", ret);
-
- return 0;
-}
-
-#endif /* TEST_BEHAVIOUR_OF_EPOLLET */
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-poll.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-poll.c
deleted file mode 100644
index e322a3b4e2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set-poll.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-socket-set-poll.c - a socket set implemented via _dbus_poll
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-socket-set.h"
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-watch.h>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-typedef struct {
- DBusSocketSet parent;
- DBusPollFD *fds;
- int n_fds;
- int n_reserved;
- int n_allocated;
-} DBusSocketSetPoll;
-
-#define REALLOC_INCREMENT 8
-#define MINIMUM_SIZE 8
-
-/* If we're in the regression tests, force reallocation to happen sooner */
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#define DEFAULT_SIZE_HINT 1
-#else
-#define DEFAULT_SIZE_HINT MINIMUM_SIZE
-#endif
-
-static inline DBusSocketSetPoll *
-socket_set_poll_cast (DBusSocketSet *set)
-{
- _dbus_assert (set->cls == &_dbus_socket_set_poll_class);
- return (DBusSocketSetPoll *) set;
-}
-
-/* this is safe to call on a partially-allocated socket set */
-static void
-socket_set_poll_free (DBusSocketSet *set)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
-
- dbus_free (self->fds);
- dbus_free (self);
- _dbus_verbose ("freed socket set %p\n", self);
-}
-
-DBusSocketSet *
-_dbus_socket_set_poll_new (int size_hint)
-{
- DBusSocketSetPoll *ret;
-
- if (size_hint <= 0)
- size_hint = DEFAULT_SIZE_HINT;
-
- ret = dbus_new0 (DBusSocketSetPoll, 1);
-
- if (ret == NULL)
- return NULL;
-
- ret->parent.cls = &_dbus_socket_set_poll_class;
- ret->n_fds = 0;
- ret->n_allocated = size_hint;
-
- ret->fds = dbus_new0 (DBusPollFD, size_hint);
-
- if (ret->fds == NULL)
- {
- /* socket_set_poll_free specifically supports half-constructed
- * socket sets */
- socket_set_poll_free ((DBusSocketSet *) ret);
- return NULL;
- }
-
- _dbus_verbose ("new socket set at %p\n", ret);
- return (DBusSocketSet *) ret;
-}
-
-static short
-watch_flags_to_poll_events (unsigned int flags)
-{
- short events = 0;
-
- if (flags & DBUS_WATCH_READABLE)
- events |= _DBUS_POLLIN;
- if (flags & DBUS_WATCH_WRITABLE)
- events |= _DBUS_POLLOUT;
-
- return events;
-}
-
-static dbus_bool_t
-socket_set_poll_add (DBusSocketSet *set,
- int fd,
- unsigned int flags,
- dbus_bool_t enabled)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
-#ifndef DBUS_DISABLE_ASSERT
- int i;
-
- for (i = 0; i < self->n_fds; i++)
- _dbus_assert (self->fds[i].fd != fd);
-#endif
-
- if (self->n_reserved >= self->n_allocated)
- {
- DBusPollFD *new_fds = dbus_realloc (self->fds,
- sizeof (DBusPollFD) * (self->n_allocated + REALLOC_INCREMENT));
-
- _dbus_verbose ("inflating set %p from %d en/%d res/%d alloc to %d\n",
- self, self->n_fds, self->n_reserved, self->n_allocated,
- self->n_allocated + REALLOC_INCREMENT);
-
- if (new_fds == NULL)
- return FALSE;
-
- self->fds = new_fds;
- self->n_allocated += REALLOC_INCREMENT;
- }
-
- _dbus_verbose ("before adding fd %d to %p, %d en/%d res/%d alloc\n",
- fd, self, self->n_fds, self->n_reserved, self->n_allocated);
- _dbus_assert (self->n_reserved >= self->n_fds);
- _dbus_assert (self->n_allocated > self->n_reserved);
-
- self->n_reserved++;
-
- if (enabled)
- {
- self->fds[self->n_fds].fd = fd;
- self->fds[self->n_fds].events = watch_flags_to_poll_events (flags);
- self->n_fds++;
- }
-
- return TRUE;
-}
-
-static void
-socket_set_poll_enable (DBusSocketSet *set,
- int fd,
- unsigned int flags)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
- int i;
-
- for (i = 0; i < self->n_fds; i++)
- {
- if (self->fds[i].fd == fd)
- {
- self->fds[i].events = watch_flags_to_poll_events (flags);
- return;
- }
- }
-
- /* we allocated space when the socket was added */
- _dbus_assert (self->n_fds < self->n_reserved);
- _dbus_assert (self->n_reserved <= self->n_allocated);
-
- self->fds[self->n_fds].fd = fd;
- self->fds[self->n_fds].events = watch_flags_to_poll_events (flags);
- self->n_fds++;
-}
-
-static void
-socket_set_poll_disable (DBusSocketSet *set,
- int fd)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
- int i;
-
- for (i = 0; i < self->n_fds; i++)
- {
- if (self->fds[i].fd == fd)
- {
- if (i != self->n_fds - 1)
- {
- self->fds[i].fd = self->fds[self->n_fds - 1].fd;
- self->fds[i].events = self->fds[self->n_fds - 1].events;
- }
-
- self->n_fds--;
- return;
- }
- }
-}
-
-static void
-socket_set_poll_remove (DBusSocketSet *set,
- int fd)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
-
- socket_set_poll_disable (set, fd);
- self->n_reserved--;
-
- _dbus_verbose ("after removing fd %d from %p, %d en/%d res/%d alloc\n",
- fd, self, self->n_fds, self->n_reserved, self->n_allocated);
- _dbus_assert (self->n_fds <= self->n_reserved);
- _dbus_assert (self->n_reserved <= self->n_allocated);
-
- if (self->n_reserved + MINIMUM_SIZE < self->n_allocated / 2)
- {
- /* Our array is twice as big as it needs to be - deflate it until it's
- * only slightly larger than the number reserved. */
- DBusPollFD *new_fds = dbus_realloc (self->fds,
- sizeof (DBusPollFD) * (self->n_reserved + MINIMUM_SIZE));
-
- _dbus_verbose ("before deflating %p, %d en/%d res/%d alloc\n",
- self, self->n_fds, self->n_reserved, self->n_allocated);
-
- if (_DBUS_UNLIKELY (new_fds == NULL))
- {
- /* Weird. Oh well, never mind, the too-big array is untouched */
- return;
- }
-
- self->fds = new_fds;
- self->n_allocated = self->n_reserved;
- }
-}
-
-static unsigned int
-watch_flags_from_poll_revents (short revents)
-{
- unsigned int condition = 0;
-
- if (revents & _DBUS_POLLIN)
- condition |= DBUS_WATCH_READABLE;
- if (revents & _DBUS_POLLOUT)
- condition |= DBUS_WATCH_WRITABLE;
- if (revents & _DBUS_POLLHUP)
- condition |= DBUS_WATCH_HANGUP;
- if (revents & _DBUS_POLLERR)
- condition |= DBUS_WATCH_ERROR;
-
- if (_DBUS_UNLIKELY (revents & _DBUS_POLLNVAL))
- condition |= _DBUS_WATCH_NVAL;
-
- return condition;
-}
-
-/** This is basically Linux's epoll_wait(2) implemented in terms of poll(2);
- * it returns results into a caller-supplied buffer so we can be reentrant. */
-static int
-socket_set_poll_poll (DBusSocketSet *set,
- DBusSocketEvent *revents,
- int max_events,
- int timeout_ms)
-{
- DBusSocketSetPoll *self = socket_set_poll_cast (set);
- int i;
- int n_events;
- int n_ready;
-
- _dbus_assert (max_events > 0);
-
- for (i = 0; i < self->n_fds; i++)
- self->fds[i].revents = 0;
-
- n_ready = _dbus_poll (self->fds, self->n_fds, timeout_ms);
-
- if (n_ready <= 0)
- return n_ready;
-
- n_events = 0;
-
- for (i = 0; i < self->n_fds; i++)
- {
- if (self->fds[i].revents != 0)
- {
- revents[n_events].fd = self->fds[i].fd;
- revents[n_events].flags = watch_flags_from_poll_revents (self->fds[i].revents);
-
- n_events += 1;
-
- /* We ignore events beyond max_events because we have nowhere to
- * put them. _dbus_poll is level-triggered, so we'll just be told
- * about them next time round the main loop anyway. */
- if (n_events == max_events)
- return n_events;
- }
- }
-
- return n_events;
-}
-
-DBusSocketSetClass _dbus_socket_set_poll_class = {
- socket_set_poll_free,
- socket_set_poll_add,
- socket_set_poll_remove,
- socket_set_poll_enable,
- socket_set_poll_disable,
- socket_set_poll_poll
-};
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.c
deleted file mode 100644
index 210d600e3e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * dbus-socket-set.c - used to bolt file descriptors onto a bus
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <dbus/dbus-socket-set.h>
-
-DBusSocketSet *
-_dbus_socket_set_new (int size_hint)
-{
- DBusSocketSet *ret;
-
-#ifdef DBUS_HAVE_LINUX_EPOLL
- ret = _dbus_socket_set_epoll_new ();
-
- if (ret != NULL)
- return ret;
-#endif
-
- ret = _dbus_socket_set_poll_new (size_hint);
-
- if (ret != NULL)
- return ret;
-
- return NULL;
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.h
deleted file mode 100644
index 3b71a92502..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-socket-set.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * dbus-socket-set.h - used to bolt file descriptors onto a bus
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SOCKET_SET_H
-#define DBUS_SOCKET_SET_H
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include <dbus/dbus.h>
-
-typedef struct {
- int fd;
- unsigned int flags;
-} DBusSocketEvent;
-
-typedef struct DBusSocketSet DBusSocketSet;
-
-typedef struct DBusSocketSetClass DBusSocketSetClass;
-struct DBusSocketSetClass {
- void (*free) (DBusSocketSet *self);
- dbus_bool_t (*add) (DBusSocketSet *self,
- int fd,
- unsigned int flags,
- dbus_bool_t enabled);
- void (*remove) (DBusSocketSet *self,
- int fd);
- void (*enable) (DBusSocketSet *self,
- int fd,
- unsigned int flags);
- void (*disable) (DBusSocketSet *self,
- int fd);
- int (*poll) (DBusSocketSet *self,
- DBusSocketEvent *revents,
- int max_events,
- int timeout_ms);
-};
-
-struct DBusSocketSet {
- DBusSocketSetClass *cls;
-};
-
-DBusSocketSet *_dbus_socket_set_new (int size_hint);
-
-static inline void
-_dbus_socket_set_free (DBusSocketSet *self)
-{
- (self->cls->free) (self);
-}
-
-static inline dbus_bool_t
-_dbus_socket_set_add (DBusSocketSet *self,
- int fd,
- unsigned int flags,
- dbus_bool_t enabled)
-{
- return (self->cls->add) (self, fd, flags, enabled);
-}
-
-static inline void
-_dbus_socket_set_remove (DBusSocketSet *self,
- int fd)
-{
- (self->cls->remove) (self, fd);
-}
-
-static inline void
-_dbus_socket_set_enable (DBusSocketSet *self,
- int fd,
- unsigned int flags)
-{
- (self->cls->enable) (self, fd, flags);
-}
-
-static inline void
-_dbus_socket_set_disable (DBusSocketSet *self,
- int fd)
-{
- (self->cls->disable) (self, fd);
-}
-
-
-static inline int
-_dbus_socket_set_poll (DBusSocketSet *self,
- DBusSocketEvent *revents,
- int max_events,
- int timeout_ms)
-{
- return (self->cls->poll) (self, revents, max_events, timeout_ms);
-}
-
-/* concrete implementations, not necessarily built on all platforms */
-
-extern DBusSocketSetClass _dbus_socket_set_poll_class;
-extern DBusSocketSetClass _dbus_socket_set_epoll_class;
-
-DBusSocketSet *_dbus_socket_set_poll_new (int size_hint);
-DBusSocketSet *_dbus_socket_set_epoll_new (void);
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* multiple-inclusion guard */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sockets-win.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sockets-win.h
deleted file mode 100644
index 4e1ab8ca09..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sockets-win.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sockets.h Wrappers around socket features (internal to D-BUS implementation)
- *
- * Copyright (C) 2005 Novell, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SOCKETS_H
-#define DBUS_SOCKETS_H
-
-#if defined(DBUS_WIN) || defined(DBUS_WINCE)
-
-
-
-#ifndef STRICT
-#define STRICT
-#include <winsock2.h>
-#undef STRICT
-#endif
-#include <winsock2.h>
-
-#undef interface
-
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#define DBUS_SOCKET_IS_INVALID(s) ((SOCKET)(s) == INVALID_SOCKET)
-#define DBUS_SOCKET_API_RETURNS_ERROR(n) ((n) == SOCKET_ERROR)
-#define DBUS_SOCKET_SET_ERRNO() (_dbus_win_set_errno (WSAGetLastError()))
-
-#define DBUS_CLOSE_SOCKET(s) closesocket(s)
-
-#else
-
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <errno.h>
-
-#define DBUS_SOCKET_IS_INVALID(s) ((s) < 0)
-#define DBUS_SOCKET_API_RETURNS_ERROR(n) ((n) < 0)
-#define DBUS_SOCKET_SET_ERRNO() /* empty */
-
-#define DBUS_CLOSE_SOCKET(s) close(s)
-
-#endif /* !Win32 */
-
-#endif /* DBUS_SOCKETS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn-win.c
deleted file mode 100644
index 7da7a431bf..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn-win.c
+++ /dev/null
@@ -1,1046 +0,0 @@
-#include <config.h>
-
-//#define SPAWN_DEBUG
-
-#if !defined(SPAWN_DEBUG) || defined(_MSC_VER)
-#define PING()
-#else
-#define PING() fprintf (stderr, "%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__); fflush (stderr)
-#endif
-
-#include <stdio.h>
-
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-spawn-win32.c Wrapper around g_spawn
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2005 Novell, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include "dbus-spawn.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-win.h"
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-protocol.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-//#define STRICT
-//#include <windows.h>
-//#undef STRICT
-#include <winsock2.h>
-#undef interface
-
-#include <stdlib.h>
-
-#ifndef DBUS_WINCE
-#include <process.h>
-#endif
-
-/**
- * Babysitter implementation details
- */
-struct DBusBabysitter
- {
- int refcount;
-
- HANDLE start_sync_event;
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
- HANDLE end_sync_event;
-#endif
-
- char *log_name;
- DBusSpawnChildSetupFunc child_setup;
- void *user_data;
-
- int argc;
- char **argv;
- char **envp;
-
- HANDLE child_handle;
- int socket_to_babysitter; /* Connection to the babysitter thread */
- int socket_to_main;
-
- DBusWatchList *watches;
- DBusWatch *sitter_watch;
- DBusBabysitterFinishedFunc finished_cb;
- void *finished_data;
-
- dbus_bool_t have_spawn_errno;
- int spawn_errno;
- dbus_bool_t have_child_status;
- int child_status;
- };
-
-static DBusBabysitter*
-_dbus_babysitter_new (void)
-{
- DBusBabysitter *sitter;
-
- sitter = dbus_new0 (DBusBabysitter, 1);
- if (sitter == NULL)
- return NULL;
-
- sitter->refcount = 1;
-
- sitter->start_sync_event = CreateEvent (NULL, FALSE, FALSE, NULL);
- if (sitter->start_sync_event == NULL)
- {
- _dbus_babysitter_unref (sitter);
- return NULL;
- }
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- sitter->end_sync_event = CreateEvent (NULL, FALSE, FALSE, NULL);
- if (sitter->end_sync_event == NULL)
- {
- _dbus_babysitter_unref (sitter);
- return NULL;
- }
-#endif
-
- sitter->child_handle = NULL;
-
- sitter->socket_to_babysitter = sitter->socket_to_main = -1;
-
- sitter->argc = 0;
- sitter->argv = NULL;
- sitter->envp = NULL;
-
- sitter->watches = _dbus_watch_list_new ();
- if (sitter->watches == NULL)
- {
- _dbus_babysitter_unref (sitter);
- return NULL;
- }
-
- sitter->have_spawn_errno = FALSE;
- sitter->have_child_status = FALSE;
-
- return sitter;
-}
-
-/**
- * Increment the reference count on the babysitter object.
- *
- * @param sitter the babysitter
- * @returns the babysitter
- */
-DBusBabysitter *
-_dbus_babysitter_ref (DBusBabysitter *sitter)
-{
- PING();
- _dbus_assert (sitter != NULL);
- _dbus_assert (sitter->refcount > 0);
-
- sitter->refcount += 1;
-
- return sitter;
-}
-
-static void
-close_socket_to_babysitter (DBusBabysitter *sitter)
-{
- _dbus_verbose ("Closing babysitter\n");
-
- if (sitter->sitter_watch != NULL)
- {
- _dbus_assert (sitter->watches != NULL);
- _dbus_watch_list_remove_watch (sitter->watches, sitter->sitter_watch);
- _dbus_watch_invalidate (sitter->sitter_watch);
- _dbus_watch_unref (sitter->sitter_watch);
- sitter->sitter_watch = NULL;
- }
-
- if (sitter->socket_to_babysitter != -1)
- {
- _dbus_close_socket (sitter->socket_to_babysitter, NULL);
- sitter->socket_to_babysitter = -1;
- }
-}
-
-/**
- * Decrement the reference count on the babysitter object.
- *
- * @param sitter the babysitter
- */
-void
-_dbus_babysitter_unref (DBusBabysitter *sitter)
-{
- int i;
-
- PING();
- _dbus_assert (sitter != NULL);
- _dbus_assert (sitter->refcount > 0);
-
- sitter->refcount -= 1;
-
- if (sitter->refcount == 0)
- {
- close_socket_to_babysitter (sitter);
-
- if (sitter->socket_to_main != -1)
- {
- _dbus_close_socket (sitter->socket_to_main, NULL);
- sitter->socket_to_main = -1;
- }
-
- PING();
- if (sitter->argv != NULL)
- {
- for (i = 0; i < sitter->argc; i++)
- if (sitter->argv[i] != NULL)
- {
- dbus_free (sitter->argv[i]);
- sitter->argv[i] = NULL;
- }
- dbus_free (sitter->argv);
- sitter->argv = NULL;
- }
-
- if (sitter->envp != NULL)
- {
- char **e = sitter->envp;
-
- while (*e)
- dbus_free (*e++);
- dbus_free (sitter->envp);
- sitter->envp = NULL;
- }
-
- if (sitter->child_handle != NULL)
- {
- CloseHandle (sitter->child_handle);
- sitter->child_handle = NULL;
- }
-
- if (sitter->sitter_watch)
- {
- _dbus_watch_invalidate (sitter->sitter_watch);
- _dbus_watch_unref (sitter->sitter_watch);
- sitter->sitter_watch = NULL;
- }
-
- if (sitter->watches)
- _dbus_watch_list_free (sitter->watches);
-
- if (sitter->start_sync_event != NULL)
- {
- PING();
- CloseHandle (sitter->start_sync_event);
- sitter->start_sync_event = NULL;
- }
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (sitter->end_sync_event != NULL)
- {
- CloseHandle (sitter->end_sync_event);
- sitter->end_sync_event = NULL;
- }
-#endif
-
- dbus_free (sitter->log_name);
-
- dbus_free (sitter);
- }
-}
-
-void
-_dbus_babysitter_kill_child (DBusBabysitter *sitter)
-{
- PING();
- if (sitter->child_handle == NULL)
- return; /* child is already dead, or we're so hosed we'll never recover */
-
- PING();
- TerminateProcess (sitter->child_handle, 12345);
-}
-
-/**
- * Checks whether the child has exited, without blocking.
- *
- * @param sitter the babysitter
- */
-dbus_bool_t
-_dbus_babysitter_get_child_exited (DBusBabysitter *sitter)
-{
- PING();
- return (sitter->child_handle == NULL);
-}
-
-/**
- * Gets the exit status of the child. We do this so implementation specific
- * detail is not cluttering up dbus, for example the system launcher code.
- * This can only be called if the child has exited, i.e. call
- * _dbus_babysitter_get_child_exited(). It returns FALSE if the child
- * did not return a status code, e.g. because the child was signaled
- * or we failed to ever launch the child in the first place.
- *
- * @param sitter the babysitter
- * @param status the returned status code
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_babysitter_get_child_exit_status (DBusBabysitter *sitter,
- int *status)
-{
- if (!_dbus_babysitter_get_child_exited (sitter))
- _dbus_assert_not_reached ("Child has not exited");
-
- if (!sitter->have_child_status ||
- sitter->child_status == STILL_ACTIVE)
- return FALSE;
-
- *status = sitter->child_status;
- return TRUE;
-}
-
-/**
- * Sets the #DBusError with an explanation of why the spawned
- * child process exited (on a signal, or whatever). If
- * the child process has not exited, does nothing (error
- * will remain unset).
- *
- * @param sitter the babysitter
- * @param error an error to fill in
- */
-void
-_dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
- DBusError *error)
-{
- PING();
- if (!_dbus_babysitter_get_child_exited (sitter))
- return;
-
- PING();
- if (sitter->have_spawn_errno)
- {
- char *emsg = _dbus_win_error_string (sitter->spawn_errno);
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "Failed to execute program %s: %s",
- sitter->log_name, emsg);
- _dbus_win_free_error_string (emsg);
- }
- else if (sitter->have_child_status)
- {
- PING();
- dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
- "Process %s exited with status %d",
- sitter->log_name, sitter->child_status);
- }
- else
- {
- PING();
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Process %s exited, status unknown",
- sitter->log_name);
- }
- PING();
-}
-
-dbus_bool_t
-_dbus_babysitter_set_watch_functions (DBusBabysitter *sitter,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- PING();
- return _dbus_watch_list_set_functions (sitter->watches,
- add_function,
- remove_function,
- toggled_function,
- data,
- free_data_function);
-}
-
-static dbus_bool_t
-handle_watch (DBusWatch *watch,
- unsigned int condition,
- void *data)
-{
- DBusBabysitter *sitter = data;
-
- /* On Unix dbus-spawn uses a babysitter *process*, thus it has to
- * actually send the exit statuses, error codes and whatnot through
- * sockets and/or pipes. On Win32, the babysitter is jus a thread,
- * so it can set the status fields directly in the babysitter struct
- * just fine. The socket pipe is used just so we can watch it with
- * select(), as soon as anything is written to it we know that the
- * babysitter thread has recorded the status in the babysitter
- * struct.
- */
-
- PING();
- close_socket_to_babysitter (sitter);
- PING();
-
- if (_dbus_babysitter_get_child_exited (sitter) &&
- sitter->finished_cb != NULL)
- {
- sitter->finished_cb (sitter, sitter->finished_data);
- sitter->finished_cb = NULL;
- }
-
- return TRUE;
-}
-
-/* protect_argv lifted from GLib, relicensed by author, Tor Lillqvist */
-static int
-protect_argv (char **argv,
- char ***new_argv)
-{
- int i;
- int argc = 0;
-
- while (argv[argc])
- ++argc;
- *new_argv = dbus_malloc ((argc + 1) * sizeof (char *));
- if (*new_argv == NULL)
- return -1;
-
- for (i = 0; i < argc; i++)
- (*new_argv)[i] = NULL;
-
- /* Quote each argv element if necessary, so that it will get
- * reconstructed correctly in the C runtime startup code. Note that
- * the unquoting algorithm in the C runtime is really weird, and
- * rather different than what Unix shells do. See stdargv.c in the C
- * runtime sources (in the Platform SDK, in src/crt).
- *
- * Note that an new_argv[0] constructed by this function should
- * *not* be passed as the filename argument to a spawn* or exec*
- * family function. That argument should be the real file name
- * without any quoting.
- */
- for (i = 0; i < argc; i++)
- {
- char *p = argv[i];
- char *q;
- int len = 0;
- int need_dblquotes = FALSE;
- while (*p)
- {
- if (*p == ' ' || *p == '\t')
- need_dblquotes = TRUE;
- else if (*p == '"')
- len++;
- else if (*p == '\\')
- {
- char *pp = p;
- while (*pp && *pp == '\\')
- pp++;
- if (*pp == '"')
- len++;
- }
- len++;
- p++;
- }
-
- q = (*new_argv)[i] = dbus_malloc (len + need_dblquotes*2 + 1);
-
- if (q == NULL)
- return -1;
-
-
- p = argv[i];
-
- if (need_dblquotes)
- *q++ = '"';
-
- while (*p)
- {
- if (*p == '"')
- *q++ = '\\';
- else if (*p == '\\')
- {
- char *pp = p;
- while (*pp && *pp == '\\')
- pp++;
- if (*pp == '"')
- *q++ = '\\';
- }
- *q++ = *p;
- p++;
- }
-
- if (need_dblquotes)
- *q++ = '"';
- *q++ = '\0';
- /* printf ("argv[%d]:%s, need_dblquotes:%s len:%d => %s\n", i, argv[i], need_dblquotes?"TRUE":"FALSE", len, (*new_argv)[i]); */
- }
- (*new_argv)[argc] = NULL;
-
- return argc;
-}
-
-
-/* From GPGME, relicensed by g10 Code GmbH. */
-static char *
-compose_string (char **strings, char separator)
-{
- int i;
- int n = 0;
- char *buf;
- char *p;
-
- if (!strings || !strings[0])
- return 0;
- for (i = 0; strings[i]; i++)
- n += strlen (strings[i]) + 1;
- n++;
-
- buf = p = malloc (n);
- if (!buf)
- return NULL;
- for (i = 0; strings[i]; i++)
- {
- strcpy (p, strings[i]);
- p += strlen (strings[i]);
- *(p++) = separator;
- }
- p--;
- *(p++) = '\0';
- *p = '\0';
-
- return buf;
-}
-
-static char *
-build_commandline (char **argv)
-{
- return compose_string (argv, ' ');
-}
-
-static char *
-build_env_string (char** envp)
-{
- return compose_string (envp, '\0');
-}
-
-static HANDLE
-spawn_program (char* name, char** argv, char** envp)
-{
- PROCESS_INFORMATION pi = { NULL, 0, 0, 0 };
- STARTUPINFOA si;
- char *arg_string, *env_string;
- BOOL result;
-
-#ifdef DBUS_WINCE
- if (argv && argv[0])
- arg_string = build_commandline (argv + 1);
- else
- arg_string = NULL;
-#else
- arg_string = build_commandline (argv);
-#endif
- if (!arg_string)
- return INVALID_HANDLE_VALUE;
-
- env_string = build_env_string(envp);
-
- memset (&si, 0, sizeof (si));
- si.cb = sizeof (si);
-#ifdef DBUS_WINCE
- result = CreateProcessA (name, arg_string, NULL, NULL, FALSE, 0,
-#else
- result = CreateProcessA (NULL, arg_string, NULL, NULL, FALSE, 0,
-#endif
- (LPVOID)env_string, NULL, &si, &pi);
- free (arg_string);
- if (env_string)
- free (env_string);
-
- if (!result)
- return INVALID_HANDLE_VALUE;
-
- CloseHandle (pi.hThread);
- return pi.hProcess;
-}
-
-
-static DWORD __stdcall
-babysitter (void *parameter)
-{
- DBusBabysitter *sitter = (DBusBabysitter *) parameter;
-
- PING();
- _dbus_babysitter_ref (sitter);
-
- if (sitter->child_setup)
- {
- PING();
- (*sitter->child_setup) (sitter->user_data);
- }
-
- _dbus_verbose ("babysitter: spawning %s\n", sitter->log_name);
-
- PING();
- sitter->child_handle = spawn_program (sitter->log_name,
- sitter->argv, sitter->envp);
-
- PING();
- if (sitter->child_handle == (HANDLE) -1)
- {
- sitter->child_handle = NULL;
- sitter->have_spawn_errno = TRUE;
- sitter->spawn_errno = GetLastError();
- }
-
- PING();
- SetEvent (sitter->start_sync_event);
-
- if (sitter->child_handle != NULL)
- {
- int ret;
- DWORD status;
-
- PING();
- WaitForSingleObject (sitter->child_handle, INFINITE);
-
- PING();
- ret = GetExitCodeProcess (sitter->child_handle, &status);
-
- sitter->child_status = status;
- sitter->have_child_status = TRUE;
-
- CloseHandle (sitter->child_handle);
- sitter->child_handle = NULL;
- }
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- SetEvent (sitter->end_sync_event);
-#endif
-
- PING();
- send (sitter->socket_to_main, " ", 1, 0);
-
- _dbus_babysitter_unref (sitter);
-
- return 0;
-}
-
-dbus_bool_t
-_dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
- const char *log_name,
- char **argv,
- char **envp,
- DBusSpawnChildSetupFunc child_setup,
- void *user_data,
- DBusError *error)
-{
- DBusBabysitter *sitter;
- HANDLE sitter_thread;
- DWORD sitter_thread_id;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_assert (argv[0] != NULL);
-
- *sitter_p = NULL;
-
- PING();
- sitter = _dbus_babysitter_new ();
- if (sitter == NULL)
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- sitter->child_setup = child_setup;
- sitter->user_data = user_data;
-
- sitter->log_name = _dbus_strdup (log_name);
- if (sitter->log_name == NULL && log_name != NULL)
- {
- _DBUS_SET_OOM (error);
- goto out0;
- }
-
- if (sitter->log_name == NULL)
- sitter->log_name = _dbus_strdup (argv[0]);
-
- if (sitter->log_name == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out0;
- }
-
- PING();
- if (!_dbus_full_duplex_pipe (&sitter->socket_to_babysitter,
- &sitter->socket_to_main,
- FALSE, error))
- goto out0;
-
- sitter->sitter_watch = _dbus_watch_new (sitter->socket_to_babysitter,
- DBUS_WATCH_READABLE,
- TRUE, handle_watch, sitter, NULL);
- PING();
- if (sitter->sitter_watch == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out0;
- }
-
- PING();
- if (!_dbus_watch_list_add_watch (sitter->watches, sitter->sitter_watch))
- {
- /* we need to free it early so the destructor won't try to remove it
- * without it having been added, which DBusLoop doesn't allow */
- _dbus_watch_invalidate (sitter->sitter_watch);
- _dbus_watch_unref (sitter->sitter_watch);
- sitter->sitter_watch = NULL;
-
- _DBUS_SET_OOM (error);
- goto out0;
- }
-
- sitter->argc = protect_argv (argv, &sitter->argv);
- if (sitter->argc == -1)
- {
- _DBUS_SET_OOM (error);
- goto out0;
- }
- sitter->envp = envp;
-
- PING();
- sitter_thread = (HANDLE) CreateThread (NULL, 0, babysitter,
- sitter, 0, &sitter_thread_id);
-
- if (sitter_thread == 0)
- {
- PING();
- dbus_set_error_const (error, DBUS_ERROR_SPAWN_FORK_FAILED,
- "Failed to create new thread");
- goto out0;
- }
- CloseHandle (sitter_thread);
-
- PING();
- WaitForSingleObject (sitter->start_sync_event, INFINITE);
-
- PING();
- if (sitter_p != NULL)
- *sitter_p = sitter;
- else
- _dbus_babysitter_unref (sitter);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- PING();
- return TRUE;
-
-out0:
- _dbus_babysitter_unref (sitter);
-
- return FALSE;
-}
-
-void
-_dbus_babysitter_set_result_function (DBusBabysitter *sitter,
- DBusBabysitterFinishedFunc finished,
- void *user_data)
-{
- sitter->finished_cb = finished;
- sitter->finished_data = user_data;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-static char *
-get_test_exec (const char *exe,
- DBusString *scratch_space)
-{
- const char *dbus_test_exec;
-
- dbus_test_exec = _dbus_getenv ("DBUS_TEST_EXEC");
-
- if (dbus_test_exec == NULL)
- dbus_test_exec = DBUS_TEST_EXEC;
-
- if (!_dbus_string_init (scratch_space))
- return NULL;
-
- if (!_dbus_string_append_printf (scratch_space, "%s/%s%s",
- dbus_test_exec, exe, DBUS_EXEEXT))
- {
- _dbus_string_free (scratch_space);
- return NULL;
- }
-
- return _dbus_string_get_data (scratch_space);
-}
-
-#define LIVE_CHILDREN(sitter) ((sitter)->child_handle != NULL)
-
-static void
-_dbus_babysitter_block_for_child_exit (DBusBabysitter *sitter)
-{
- if (sitter->child_handle == NULL)
- return;
-
- WaitForSingleObject (sitter->end_sync_event, INFINITE);
-}
-
-static dbus_bool_t
-check_spawn_nonexistent (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter;
- DBusError error;
-
- sitter = NULL;
-
- dbus_error_init (&error);
-
- /*** Test launching nonexistent binary */
-
- argv[0] = "/this/does/not/exist/32542sdgafgafdg";
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_nonexistent", argv, NULL,
- NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching nonexistent executable\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_EXEC_FAILED)))
- {
- _dbus_warn ("Not expecting error when launching nonexistent executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_segfault (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter;
- DBusError error;
- DBusString argv0;
-
- sitter = NULL;
-
- dbus_error_init (&error);
-
- /*** Test launching segfault binary */
-
- argv[0] = get_test_exec ("test-segfault", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_segfault", argv, NULL,
- NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching segfaulting binary\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_EXITED)))
- {
- _dbus_warn ("Not expecting error when launching segfaulting executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_exit (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter;
- DBusError error;
- DBusString argv0;
-
- sitter = NULL;
-
- dbus_error_init (&error);
-
- /*** Test launching exit failure binary */
-
- argv[0] = get_test_exec ("test-exit", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_exit", argv, NULL,
- NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching binary that exited with failure code\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_EXITED)))
- {
- _dbus_warn ("Not expecting error when launching exiting executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_and_kill (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter;
- DBusError error;
- DBusString argv0;
-
- sitter = NULL;
-
- dbus_error_init (&error);
-
- /*** Test launching sleeping binary then killing it */
-
- argv[0] = get_test_exec ("test-sleep-forever", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_and_kill", argv, NULL,
- NULL, NULL,
- &error))
- {
- _dbus_babysitter_kill_child (sitter);
-
- _dbus_babysitter_block_for_child_exit (sitter);
-
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error after killing spawned binary\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_EXITED)))
- {
- _dbus_warn ("Not expecting error when killing executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-dbus_bool_t
-_dbus_spawn_test (const char *test_data_dir)
-{
- if (!_dbus_test_oom_handling ("spawn_nonexistent",
- check_spawn_nonexistent,
- NULL))
- return FALSE;
-
- /* Don't run the obnoxious segfault test by default,
- * it's a pain to have to click all those error boxes.
- */
- if (getenv ("DO_SEGFAULT_TEST"))
- if (!_dbus_test_oom_handling ("spawn_segfault",
- check_spawn_segfault,
- NULL))
- return FALSE;
-
- if (!_dbus_test_oom_handling ("spawn_exit",
- check_spawn_exit,
- NULL))
- return FALSE;
-
- if (!_dbus_test_oom_handling ("spawn_and_kill",
- check_spawn_and_kill,
- NULL))
- return FALSE;
-
- return TRUE;
-}
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.c
deleted file mode 100644
index d1478f0081..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.c
+++ /dev/null
@@ -1,1684 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-spawn.c Wrapper around fork/exec
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "dbus-spawn.h"
-#include "dbus-sysdeps-unix.h"
-#include "dbus-internals.h"
-#include "dbus-test.h"
-#include "dbus-protocol.h"
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <stdlib.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_SYSTEMD
-#include <systemd/sd-journal.h>
-#endif
-
-extern char **environ;
-
-/**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-/*
- * I'm pretty sure this whole spawn file could be made simpler,
- * if you thought about it a bit.
- */
-
-/**
- * Enumeration for status of a read()
- */
-typedef enum
-{
- READ_STATUS_OK, /**< Read succeeded */
- READ_STATUS_ERROR, /**< Some kind of error */
- READ_STATUS_EOF /**< EOF returned */
-} ReadStatus;
-
-static ReadStatus
-read_ints (int fd,
- int *buf,
- int n_ints_in_buf,
- int *n_ints_read,
- DBusError *error)
-{
- size_t bytes = 0;
- ReadStatus retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- retval = READ_STATUS_OK;
-
- while (TRUE)
- {
- ssize_t chunk;
- size_t to_read;
-
- to_read = sizeof (int) * n_ints_in_buf - bytes;
-
- if (to_read == 0)
- break;
-
- again:
-
- chunk = read (fd,
- ((char*)buf) + bytes,
- to_read);
-
- if (chunk < 0 && errno == EINTR)
- goto again;
-
- if (chunk < 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_SPAWN_FAILED,
- "Failed to read from child pipe (%s)",
- _dbus_strerror (errno));
-
- retval = READ_STATUS_ERROR;
- break;
- }
- else if (chunk == 0)
- {
- retval = READ_STATUS_EOF;
- break; /* EOF */
- }
- else /* chunk > 0 */
- bytes += chunk;
- }
-
- *n_ints_read = (int)(bytes / sizeof(int));
-
- return retval;
-}
-
-static ReadStatus
-read_pid (int fd,
- pid_t *buf,
- DBusError *error)
-{
- size_t bytes = 0;
- ReadStatus retval;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- retval = READ_STATUS_OK;
-
- while (TRUE)
- {
- ssize_t chunk;
- size_t to_read;
-
- to_read = sizeof (pid_t) - bytes;
-
- if (to_read == 0)
- break;
-
- again:
-
- chunk = read (fd,
- ((char*)buf) + bytes,
- to_read);
- if (chunk < 0 && errno == EINTR)
- goto again;
-
- if (chunk < 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_SPAWN_FAILED,
- "Failed to read from child pipe (%s)",
- _dbus_strerror (errno));
-
- retval = READ_STATUS_ERROR;
- break;
- }
- else if (chunk == 0)
- {
- retval = READ_STATUS_EOF;
- break; /* EOF */
- }
- else /* chunk > 0 */
- bytes += chunk;
- }
-
- return retval;
-}
-
-/* The implementation uses an intermediate child between the main process
- * and the grandchild. The grandchild is our spawned process. The intermediate
- * child is a babysitter process; it keeps track of when the grandchild
- * exits/crashes, and reaps the grandchild.
- *
- * We automatically reap the babysitter process, killing it if necessary,
- * when the DBusBabysitter's refcount goes to zero.
- *
- * Processes:
- *
- * main process
- * | fork() A
- * \- babysitter
- * | fork () B
- * \- grandchild --> exec --> spawned process
- *
- * IPC:
- * child_err_report_pipe
- * /-----------<---------<--------------\
- * | ^
- * v |
- * main process babysitter grandchild
- * ^ ^
- * v v
- * \-------<->-------/
- * babysitter_pipe
- *
- * child_err_report_pipe is genuinely a pipe.
- * The READ_END (also called error_pipe_from_child) is used in the main
- * process. The WRITE_END (also called child_err_report_fd) is used in
- * the grandchild process.
- *
- * On failure, the grandchild process sends CHILD_EXEC_FAILED + errno.
- * On success, the pipe just closes (because it's close-on-exec) without
- * sending any bytes.
- *
- * babysitter_pipe is mis-named: it's really a bidirectional socketpair.
- * The [0] end (also called socket_to_babysitter) is used in the main
- * process, the [1] end (also called parent_pipe) is used in the babysitter.
- *
- * If the fork() labelled B in the diagram above fails, the babysitter sends
- * CHILD_FORK_FAILED + errno.
- * On success, the babysitter sends CHILD_PID + the grandchild's pid.
- * On SIGCHLD, the babysitter sends CHILD_EXITED + the exit status.
- * The main process doesn't explicitly send anything, but when it exits,
- * the babysitter gets POLLHUP or POLLERR.
- */
-
-/* Messages from children to parents */
-enum
-{
- CHILD_EXITED, /* This message is followed by the exit status int */
- CHILD_FORK_FAILED, /* Followed by errno */
- CHILD_EXEC_FAILED, /* Followed by errno */
- CHILD_PID /* Followed by pid_t */
-};
-
-/**
- * Babysitter implementation details
- */
-struct DBusBabysitter
-{
- int refcount; /**< Reference count */
-
- char *log_name; /**< the name under which to log messages about this
- process being spawned */
-
- int socket_to_babysitter; /**< Connection to the babysitter process */
- int error_pipe_from_child; /**< Connection to the process that does the exec() */
-
- pid_t sitter_pid; /**< PID Of the babysitter */
- pid_t grandchild_pid; /**< PID of the grandchild */
-
- DBusWatchList *watches; /**< Watches */
-
- DBusWatch *error_watch; /**< Error pipe watch */
- DBusWatch *sitter_watch; /**< Sitter pipe watch */
-
- DBusBabysitterFinishedFunc finished_cb;
- void *finished_data;
-
- int errnum; /**< Error number */
- int status; /**< Exit status code */
- unsigned int have_child_status : 1; /**< True if child status has been reaped */
- unsigned int have_fork_errnum : 1; /**< True if we have an error code from fork() */
- unsigned int have_exec_errnum : 1; /**< True if we have an error code from exec() */
-};
-
-static DBusBabysitter*
-_dbus_babysitter_new (void)
-{
- DBusBabysitter *sitter;
-
- sitter = dbus_new0 (DBusBabysitter, 1);
- if (sitter == NULL)
- return NULL;
-
- sitter->refcount = 1;
-
- sitter->socket_to_babysitter = -1;
- sitter->error_pipe_from_child = -1;
-
- sitter->sitter_pid = -1;
- sitter->grandchild_pid = -1;
-
- sitter->watches = _dbus_watch_list_new ();
- if (sitter->watches == NULL)
- goto failed;
-
- return sitter;
-
- failed:
- _dbus_babysitter_unref (sitter);
- return NULL;
-}
-
-/**
- * Increment the reference count on the babysitter object.
- *
- * @param sitter the babysitter
- * @returns the babysitter
- */
-DBusBabysitter *
-_dbus_babysitter_ref (DBusBabysitter *sitter)
-{
- _dbus_assert (sitter != NULL);
- _dbus_assert (sitter->refcount > 0);
-
- sitter->refcount += 1;
-
- return sitter;
-}
-
-static void close_socket_to_babysitter (DBusBabysitter *sitter);
-static void close_error_pipe_from_child (DBusBabysitter *sitter);
-
-/**
- * Decrement the reference count on the babysitter object.
- * When the reference count of the babysitter object reaches
- * zero, the babysitter is killed and the child that was being
- * babysat gets emancipated.
- *
- * @param sitter the babysitter
- */
-void
-_dbus_babysitter_unref (DBusBabysitter *sitter)
-{
- _dbus_assert (sitter != NULL);
- _dbus_assert (sitter->refcount > 0);
-
- sitter->refcount -= 1;
- if (sitter->refcount == 0)
- {
- /* If we haven't forked other babysitters
- * since this babysitter and socket were
- * created then this close will cause the
- * babysitter to wake up from poll with
- * a hangup and then the babysitter will
- * quit itself.
- */
- close_socket_to_babysitter (sitter);
-
- close_error_pipe_from_child (sitter);
-
- if (sitter->sitter_pid > 0)
- {
- int status;
- int ret;
-
- /* It's possible the babysitter died on its own above
- * from the close, or was killed randomly
- * by some other process, so first try to reap it
- */
- ret = waitpid (sitter->sitter_pid, &status, WNOHANG);
-
- /* If we couldn't reap the child then kill it, and
- * try again
- */
- if (ret == 0)
- kill (sitter->sitter_pid, SIGKILL);
-
- if (ret == 0)
- {
- do
- {
- ret = waitpid (sitter->sitter_pid, &status, 0);
- }
- while (_DBUS_UNLIKELY (ret < 0 && errno == EINTR));
- }
-
- if (ret < 0)
- {
- if (errno == ECHILD)
- _dbus_warn ("Babysitter process not available to be reaped; should not happen\n");
- else
- _dbus_warn ("Unexpected error %d in waitpid() for babysitter: %s\n",
- errno, _dbus_strerror (errno));
- }
- else
- {
- _dbus_verbose ("Reaped %ld, waiting for babysitter %ld\n",
- (long) ret, (long) sitter->sitter_pid);
-
- if (WIFEXITED (sitter->status))
- _dbus_verbose ("Babysitter exited with status %d\n",
- WEXITSTATUS (sitter->status));
- else if (WIFSIGNALED (sitter->status))
- _dbus_verbose ("Babysitter received signal %d\n",
- WTERMSIG (sitter->status));
- else
- _dbus_verbose ("Babysitter exited abnormally\n");
- }
-
- sitter->sitter_pid = -1;
- }
-
- if (sitter->watches)
- _dbus_watch_list_free (sitter->watches);
-
- dbus_free (sitter->log_name);
-
- dbus_free (sitter);
- }
-}
-
-static ReadStatus
-read_data (DBusBabysitter *sitter,
- int fd)
-{
- int what;
- int got;
- DBusError error = DBUS_ERROR_INIT;
- ReadStatus r;
-
- r = read_ints (fd, &what, 1, &got, &error);
-
- switch (r)
- {
- case READ_STATUS_ERROR:
- _dbus_warn ("Failed to read data from fd %d: %s\n", fd, error.message);
- dbus_error_free (&error);
- return r;
-
- case READ_STATUS_EOF:
- return r;
-
- case READ_STATUS_OK:
- break;
- }
-
- if (got == 1)
- {
- switch (what)
- {
- case CHILD_EXITED:
- case CHILD_FORK_FAILED:
- case CHILD_EXEC_FAILED:
- {
- int arg;
-
- r = read_ints (fd, &arg, 1, &got, &error);
-
- switch (r)
- {
- case READ_STATUS_ERROR:
- _dbus_warn ("Failed to read arg from fd %d: %s\n", fd, error.message);
- dbus_error_free (&error);
- return r;
- case READ_STATUS_EOF:
- return r;
- case READ_STATUS_OK:
- break;
- }
-
- if (got == 1)
- {
- if (what == CHILD_EXITED)
- {
- sitter->have_child_status = TRUE;
- sitter->status = arg;
- sitter->errnum = 0;
- _dbus_verbose ("recorded child status exited = %d signaled = %d exitstatus = %d termsig = %d\n",
- WIFEXITED (sitter->status), WIFSIGNALED (sitter->status),
- WEXITSTATUS (sitter->status), WTERMSIG (sitter->status));
- }
- else if (what == CHILD_FORK_FAILED)
- {
- sitter->have_fork_errnum = TRUE;
- sitter->errnum = arg;
- _dbus_verbose ("recorded fork errnum %d\n", sitter->errnum);
- }
- else if (what == CHILD_EXEC_FAILED)
- {
- sitter->have_exec_errnum = TRUE;
- sitter->errnum = arg;
- _dbus_verbose ("recorded exec errnum %d\n", sitter->errnum);
- }
- }
- }
- break;
- case CHILD_PID:
- {
- pid_t pid = -1;
-
- r = read_pid (fd, &pid, &error);
-
- switch (r)
- {
- case READ_STATUS_ERROR:
- _dbus_warn ("Failed to read PID from fd %d: %s\n", fd, error.message);
- dbus_error_free (&error);
- return r;
- case READ_STATUS_EOF:
- return r;
- case READ_STATUS_OK:
- break;
- }
-
- sitter->grandchild_pid = pid;
-
- _dbus_verbose ("recorded grandchild pid %d\n", sitter->grandchild_pid);
- }
- break;
- default:
- _dbus_warn ("Unknown message received from babysitter process\n");
- break;
- }
- }
-
- return r;
-}
-
-static void
-close_socket_to_babysitter (DBusBabysitter *sitter)
-{
- _dbus_verbose ("Closing babysitter\n");
-
- if (sitter->sitter_watch != NULL)
- {
- _dbus_assert (sitter->watches != NULL);
- _dbus_watch_list_remove_watch (sitter->watches, sitter->sitter_watch);
- _dbus_watch_invalidate (sitter->sitter_watch);
- _dbus_watch_unref (sitter->sitter_watch);
- sitter->sitter_watch = NULL;
- }
-
- if (sitter->socket_to_babysitter >= 0)
- {
- _dbus_close_socket (sitter->socket_to_babysitter, NULL);
- sitter->socket_to_babysitter = -1;
- }
-}
-
-static void
-close_error_pipe_from_child (DBusBabysitter *sitter)
-{
- _dbus_verbose ("Closing child error\n");
-
- if (sitter->error_watch != NULL)
- {
- _dbus_assert (sitter->watches != NULL);
- _dbus_watch_list_remove_watch (sitter->watches, sitter->error_watch);
- _dbus_watch_invalidate (sitter->error_watch);
- _dbus_watch_unref (sitter->error_watch);
- sitter->error_watch = NULL;
- }
-
- if (sitter->error_pipe_from_child >= 0)
- {
- _dbus_close_socket (sitter->error_pipe_from_child, NULL);
- sitter->error_pipe_from_child = -1;
- }
-}
-
-static void
-handle_babysitter_socket (DBusBabysitter *sitter,
- int revents)
-{
- /* Even if we have POLLHUP, we want to keep reading
- * data until POLLIN goes away; so this function only
- * looks at HUP/ERR if no IN is set.
- */
- if (revents & _DBUS_POLLIN)
- {
- _dbus_verbose ("Reading data from babysitter\n");
- if (read_data (sitter, sitter->socket_to_babysitter) != READ_STATUS_OK)
- close_socket_to_babysitter (sitter);
- }
- else if (revents & (_DBUS_POLLERR | _DBUS_POLLHUP))
- {
- close_socket_to_babysitter (sitter);
- }
-}
-
-static void
-handle_error_pipe (DBusBabysitter *sitter,
- int revents)
-{
- if (revents & _DBUS_POLLIN)
- {
- _dbus_verbose ("Reading data from child error\n");
- if (read_data (sitter, sitter->error_pipe_from_child) != READ_STATUS_OK)
- close_error_pipe_from_child (sitter);
- }
- else if (revents & (_DBUS_POLLERR | _DBUS_POLLHUP))
- {
- close_error_pipe_from_child (sitter);
- }
-}
-
-/* returns whether there were any poll events handled */
-static dbus_bool_t
-babysitter_iteration (DBusBabysitter *sitter,
- dbus_bool_t block)
-{
- DBusPollFD fds[2];
- int i;
- dbus_bool_t descriptors_ready;
-
- descriptors_ready = FALSE;
-
- i = 0;
-
- if (sitter->error_pipe_from_child >= 0)
- {
- fds[i].fd = sitter->error_pipe_from_child;
- fds[i].events = _DBUS_POLLIN;
- fds[i].revents = 0;
- ++i;
- }
-
- if (sitter->socket_to_babysitter >= 0)
- {
- fds[i].fd = sitter->socket_to_babysitter;
- fds[i].events = _DBUS_POLLIN;
- fds[i].revents = 0;
- ++i;
- }
-
- if (i > 0)
- {
- int ret;
-
- do
- {
- ret = _dbus_poll (fds, i, 0);
- }
- while (ret < 0 && errno == EINTR);
-
- if (ret == 0 && block)
- {
- do
- {
- ret = _dbus_poll (fds, i, -1);
- }
- while (ret < 0 && errno == EINTR);
- }
-
- if (ret > 0)
- {
- descriptors_ready = TRUE;
-
- while (i > 0)
- {
- --i;
- if (fds[i].fd == sitter->error_pipe_from_child)
- handle_error_pipe (sitter, fds[i].revents);
- else if (fds[i].fd == sitter->socket_to_babysitter)
- handle_babysitter_socket (sitter, fds[i].revents);
- }
- }
- }
-
- return descriptors_ready;
-}
-
-/**
- * Macro returns #TRUE if the babysitter still has live sockets open to the
- * babysitter child or the grandchild.
- */
-#define LIVE_CHILDREN(sitter) ((sitter)->socket_to_babysitter >= 0 || (sitter)->error_pipe_from_child >= 0)
-
-/**
- * Blocks until the babysitter process gives us the PID of the spawned grandchild,
- * then kills the spawned grandchild.
- *
- * @param sitter the babysitter object
- */
-void
-_dbus_babysitter_kill_child (DBusBabysitter *sitter)
-{
- /* be sure we have the PID of the child */
- while (LIVE_CHILDREN (sitter) &&
- sitter->grandchild_pid == -1)
- babysitter_iteration (sitter, TRUE);
-
- _dbus_verbose ("Got child PID %ld for killing\n",
- (long) sitter->grandchild_pid);
-
- if (sitter->grandchild_pid == -1)
- return; /* child is already dead, or we're so hosed we'll never recover */
-
- kill (sitter->grandchild_pid, SIGKILL);
-}
-
-/**
- * Checks whether the child has exited, without blocking.
- *
- * @param sitter the babysitter
- */
-dbus_bool_t
-_dbus_babysitter_get_child_exited (DBusBabysitter *sitter)
-{
-
- /* Be sure we're up-to-date */
- while (LIVE_CHILDREN (sitter) &&
- babysitter_iteration (sitter, FALSE))
- ;
-
- /* We will have exited the babysitter when the child has exited */
- return sitter->socket_to_babysitter < 0;
-}
-
-/**
- * Gets the exit status of the child. We do this so implementation specific
- * detail is not cluttering up dbus, for example the system launcher code.
- * This can only be called if the child has exited, i.e. call
- * _dbus_babysitter_get_child_exited(). It returns FALSE if the child
- * did not return a status code, e.g. because the child was signaled
- * or we failed to ever launch the child in the first place.
- *
- * @param sitter the babysitter
- * @param status the returned status code
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_babysitter_get_child_exit_status (DBusBabysitter *sitter,
- int *status)
-{
- if (!_dbus_babysitter_get_child_exited (sitter))
- _dbus_assert_not_reached ("Child has not exited");
-
- if (!sitter->have_child_status ||
- !(WIFEXITED (sitter->status)))
- return FALSE;
-
- *status = WEXITSTATUS (sitter->status);
- return TRUE;
-}
-
-/**
- * Sets the #DBusError with an explanation of why the spawned
- * child process exited (on a signal, or whatever). If
- * the child process has not exited, does nothing (error
- * will remain unset).
- *
- * @param sitter the babysitter
- * @param error an error to fill in
- */
-void
-_dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
- DBusError *error)
-{
- if (!_dbus_babysitter_get_child_exited (sitter))
- return;
-
- /* Note that if exec fails, we will also get a child status
- * from the babysitter saying the child exited,
- * so we need to give priority to the exec error
- */
- if (sitter->have_exec_errnum)
- {
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "Failed to execute program %s: %s",
- sitter->log_name, _dbus_strerror (sitter->errnum));
- }
- else if (sitter->have_fork_errnum)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Failed to fork a new process %s: %s",
- sitter->log_name, _dbus_strerror (sitter->errnum));
- }
- else if (sitter->have_child_status)
- {
- if (WIFEXITED (sitter->status))
- dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
- "Process %s exited with status %d",
- sitter->log_name, WEXITSTATUS (sitter->status));
- else if (WIFSIGNALED (sitter->status))
- dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED,
- "Process %s received signal %d",
- sitter->log_name, WTERMSIG (sitter->status));
- else
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Process %s exited abnormally",
- sitter->log_name);
- }
- else
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Process %s exited, reason unknown",
- sitter->log_name);
- }
-}
-
-/**
- * Sets watch functions to notify us when the
- * babysitter object needs to read/write file descriptors.
- *
- * @param sitter the babysitter
- * @param add_function function to begin monitoring a new descriptor.
- * @param remove_function function to stop monitoring a descriptor.
- * @param toggled_function function to notify when the watch is enabled/disabled
- * @param data data to pass to add_function and remove_function.
- * @param free_data_function function to be called to free the data.
- * @returns #FALSE on failure (no memory)
- */
-dbus_bool_t
-_dbus_babysitter_set_watch_functions (DBusBabysitter *sitter,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- return _dbus_watch_list_set_functions (sitter->watches,
- add_function,
- remove_function,
- toggled_function,
- data,
- free_data_function);
-}
-
-static dbus_bool_t
-handle_watch (DBusWatch *watch,
- unsigned int condition,
- void *data)
-{
- DBusBabysitter *sitter = _dbus_babysitter_ref (data);
- int revents;
- int fd;
-
- revents = 0;
- if (condition & DBUS_WATCH_READABLE)
- revents |= _DBUS_POLLIN;
- if (condition & DBUS_WATCH_ERROR)
- revents |= _DBUS_POLLERR;
- if (condition & DBUS_WATCH_HANGUP)
- revents |= _DBUS_POLLHUP;
-
- fd = dbus_watch_get_socket (watch);
-
- if (fd == sitter->error_pipe_from_child)
- handle_error_pipe (sitter, revents);
- else if (fd == sitter->socket_to_babysitter)
- handle_babysitter_socket (sitter, revents);
-
- while (LIVE_CHILDREN (sitter) &&
- babysitter_iteration (sitter, FALSE))
- ;
-
- /* fd.o #32992: if the handle_* methods closed their sockets, they previously
- * didn't always remove the watches. Check that we don't regress. */
- _dbus_assert (sitter->socket_to_babysitter != -1 || sitter->sitter_watch == NULL);
- _dbus_assert (sitter->error_pipe_from_child != -1 || sitter->error_watch == NULL);
-
- if (_dbus_babysitter_get_child_exited (sitter) &&
- sitter->finished_cb != NULL)
- {
- sitter->finished_cb (sitter, sitter->finished_data);
- sitter->finished_cb = NULL;
- }
-
- _dbus_babysitter_unref (sitter);
- return TRUE;
-}
-
-/** Helps remember which end of the pipe is which */
-#define READ_END 0
-/** Helps remember which end of the pipe is which */
-#define WRITE_END 1
-
-
-/* Avoids a danger in re-entrant situations (calling close()
- * on a file descriptor twice, and another module has
- * re-opened it since the first close).
- *
- * This previously claimed to be relevant for threaded situations, but by
- * trivial inspection, it is not thread-safe. It doesn't actually
- * matter, since this module is only used in the -util variant of the
- * library, which is only used in single-threaded situations.
- */
-static int
-close_and_invalidate (int *fd)
-{
- int ret;
-
- if (*fd < 0)
- return -1;
- else
- {
- ret = _dbus_close_socket (*fd, NULL);
- *fd = -1;
- }
-
- return ret;
-}
-
-static dbus_bool_t
-make_pipe (int p[2],
- DBusError *error)
-{
- int retval;
-
-#ifdef HAVE_PIPE2
- dbus_bool_t cloexec_done;
-
- retval = pipe2 (p, O_CLOEXEC);
- cloexec_done = retval >= 0;
-
- /* Check if kernel seems to be too old to know pipe2(). We assume
- that if pipe2 is available, O_CLOEXEC is too. */
- if (retval < 0 && errno == ENOSYS)
-#endif
- {
- retval = pipe(p);
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (retval < 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_SPAWN_FAILED,
- "Failed to create pipe for communicating with child process (%s)",
- _dbus_strerror (errno));
- return FALSE;
- }
-
-#ifdef HAVE_PIPE2
- if (!cloexec_done)
-#endif
- {
- _dbus_fd_set_close_on_exec (p[0]);
- _dbus_fd_set_close_on_exec (p[1]);
- }
-
- return TRUE;
-}
-
-static void
-do_write (int fd, const void *buf, size_t count)
-{
- size_t bytes_written;
- int ret;
-
- bytes_written = 0;
-
- again:
-
- ret = write (fd, ((const char*)buf) + bytes_written, count - bytes_written);
-
- if (ret < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- _dbus_warn ("Failed to write data to pipe!\n");
- exit (1); /* give up, we suck */
- }
- }
- else
- bytes_written += ret;
-
- if (bytes_written < count)
- goto again;
-}
-
-static void
-write_err_and_exit (int fd, int msg)
-{
- int en = errno;
-
- do_write (fd, &msg, sizeof (msg));
- do_write (fd, &en, sizeof (en));
-
- exit (1);
-}
-
-static void
-write_pid (int fd, pid_t pid)
-{
- int msg = CHILD_PID;
-
- do_write (fd, &msg, sizeof (msg));
- do_write (fd, &pid, sizeof (pid));
-}
-
-static void
-write_status_and_exit (int fd, int status)
-{
- int msg = CHILD_EXITED;
-
- do_write (fd, &msg, sizeof (msg));
- do_write (fd, &status, sizeof (status));
-
- exit (0);
-}
-
-static void
-do_exec (int child_err_report_fd,
- char **argv,
- char **envp,
- DBusSpawnChildSetupFunc child_setup,
- void *user_data)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- int i, max_open;
-#endif
-
- _dbus_verbose_reset ();
- _dbus_verbose ("Child process has PID " DBUS_PID_FORMAT "\n",
- _dbus_getpid ());
-
- if (child_setup)
- (* child_setup) (user_data);
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- max_open = sysconf (_SC_OPEN_MAX);
-
- for (i = 3; i < max_open; i++)
- {
- int retval;
-
- if (i == child_err_report_fd)
- continue;
-
- retval = fcntl (i, F_GETFD);
-
- if (retval != -1 && !(retval & FD_CLOEXEC))
- _dbus_warn ("Fd %d did not have the close-on-exec flag set!\n", i);
- }
-#endif
-
- if (envp == NULL)
- {
- _dbus_assert (environ != NULL);
-
- envp = environ;
- }
-
- execve (argv[0], argv, envp);
-
- /* Exec failed */
- write_err_and_exit (child_err_report_fd,
- CHILD_EXEC_FAILED);
-}
-
-static void
-check_babysit_events (pid_t grandchild_pid,
- int parent_pipe,
- int revents)
-{
- pid_t ret;
- int status;
-
- do
- {
- ret = waitpid (grandchild_pid, &status, WNOHANG);
- /* The man page says EINTR can't happen with WNOHANG,
- * but there are reports of it (maybe only with valgrind?)
- */
- }
- while (ret < 0 && errno == EINTR);
-
- if (ret == 0)
- {
- _dbus_verbose ("no child exited\n");
-
- ; /* no child exited */
- }
- else if (ret < 0)
- {
- /* This isn't supposed to happen. */
- _dbus_warn ("unexpected waitpid() failure in check_babysit_events(): %s\n",
- _dbus_strerror (errno));
- exit (1);
- }
- else if (ret == grandchild_pid)
- {
- /* Child exited */
- _dbus_verbose ("reaped child pid %ld\n", (long) ret);
-
- write_status_and_exit (parent_pipe, status);
- }
- else
- {
- _dbus_warn ("waitpid() reaped pid %d that we've never heard of\n",
- (int) ret);
- exit (1);
- }
-
- if (revents & _DBUS_POLLIN)
- {
- _dbus_verbose ("babysitter got POLLIN from parent pipe\n");
- }
-
- if (revents & (_DBUS_POLLERR | _DBUS_POLLHUP))
- {
- /* Parent is gone, so we just exit */
- _dbus_verbose ("babysitter got POLLERR or POLLHUP from parent\n");
- exit (0);
- }
-}
-
-static int babysit_sigchld_pipe = -1;
-
-static void
-babysit_signal_handler (int signo)
-{
- char b = '\0';
- again:
- if (write (babysit_sigchld_pipe, &b, 1) <= 0)
- if (errno == EINTR)
- goto again;
-}
-
-static void
-babysit (pid_t grandchild_pid,
- int parent_pipe)
-{
- int sigchld_pipe[2];
-
- /* We don't exec, so we keep parent state, such as the pid that
- * _dbus_verbose() uses. Reset the pid here.
- */
- _dbus_verbose_reset ();
-
- /* I thought SIGCHLD would just wake up the poll, but
- * that didn't seem to work, so added this pipe.
- * Probably the pipe is more likely to work on busted
- * operating systems anyhow.
- */
- if (pipe (sigchld_pipe) < 0)
- {
- _dbus_warn ("Not enough file descriptors to create pipe in babysitter process\n");
- exit (1);
- }
-
- babysit_sigchld_pipe = sigchld_pipe[WRITE_END];
-
- _dbus_set_signal_handler (SIGCHLD, babysit_signal_handler);
-
- write_pid (parent_pipe, grandchild_pid);
-
- check_babysit_events (grandchild_pid, parent_pipe, 0);
-
- while (TRUE)
- {
- DBusPollFD pfds[2];
-
- pfds[0].fd = parent_pipe;
- pfds[0].events = _DBUS_POLLIN;
- pfds[0].revents = 0;
-
- pfds[1].fd = sigchld_pipe[READ_END];
- pfds[1].events = _DBUS_POLLIN;
- pfds[1].revents = 0;
-
- if (_dbus_poll (pfds, _DBUS_N_ELEMENTS (pfds), -1) < 0 && errno != EINTR)
- {
- _dbus_warn ("_dbus_poll() error: %s\n", strerror (errno));
- exit (1);
- }
-
- if (pfds[0].revents != 0)
- {
- check_babysit_events (grandchild_pid, parent_pipe, pfds[0].revents);
- }
- else if (pfds[1].revents & _DBUS_POLLIN)
- {
- char b;
- if (read (sigchld_pipe[READ_END], &b, 1) == -1)
- {
- /* ignore */
- }
- /* do waitpid check */
- check_babysit_events (grandchild_pid, parent_pipe, 0);
- }
- }
-
- exit (1);
-}
-
-/**
- * Spawns a new process. The child_setup
- * function is passed the given user_data and is run in the child
- * just before calling exec().
- *
- * Also creates a "babysitter" which tracks the status of the
- * child process, advising the parent if the child exits.
- * If the spawn fails, no babysitter is created.
- * If sitter_p is #NULL, no babysitter is kept.
- *
- * @param sitter_p return location for babysitter or #NULL
- * @log_name the name under which to log messages about this process being spawned
- * @param argv the executable and arguments
- * @param env the environment, or #NULL to copy the parent's
- * @param child_setup function to call in child pre-exec()
- * @param user_data user data for setup function
- * @param error error object to be filled in if function fails
- * @returns #TRUE on success, #FALSE if error is filled in
- */
-dbus_bool_t
-_dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
- const char *log_name,
- char **argv,
- char **env,
- DBusSpawnChildSetupFunc child_setup,
- void *user_data,
- DBusError *error)
-{
- DBusBabysitter *sitter;
- int child_err_report_pipe[2] = { -1, -1 };
- int babysitter_pipe[2] = { -1, -1 };
- pid_t pid;
-#ifdef HAVE_SYSTEMD
- int fd_out = -1;
- int fd_err = -1;
-#endif
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_assert (argv[0] != NULL);
-
- if (sitter_p != NULL)
- *sitter_p = NULL;
-
- sitter = NULL;
-
- sitter = _dbus_babysitter_new ();
- if (sitter == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- sitter->log_name = _dbus_strdup (log_name);
- if (sitter->log_name == NULL && log_name != NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- if (sitter->log_name == NULL)
- sitter->log_name = _dbus_strdup (argv[0]);
-
- if (sitter->log_name == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- if (!make_pipe (child_err_report_pipe, error))
- goto cleanup_and_fail;
-
- if (!_dbus_full_duplex_pipe (&babysitter_pipe[0], &babysitter_pipe[1], TRUE, error))
- goto cleanup_and_fail;
-
- /* Setting up the babysitter is only useful in the parent,
- * but we don't want to run out of memory and fail
- * after we've already forked, since then we'd leak
- * child processes everywhere.
- */
- sitter->error_watch = _dbus_watch_new (child_err_report_pipe[READ_END],
- DBUS_WATCH_READABLE,
- TRUE, handle_watch, sitter, NULL);
- if (sitter->error_watch == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- if (!_dbus_watch_list_add_watch (sitter->watches, sitter->error_watch))
- {
- /* we need to free it early so the destructor won't try to remove it
- * without it having been added, which DBusLoop doesn't allow */
- _dbus_watch_invalidate (sitter->error_watch);
- _dbus_watch_unref (sitter->error_watch);
- sitter->error_watch = NULL;
-
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- sitter->sitter_watch = _dbus_watch_new (babysitter_pipe[0],
- DBUS_WATCH_READABLE,
- TRUE, handle_watch, sitter, NULL);
- if (sitter->sitter_watch == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- if (!_dbus_watch_list_add_watch (sitter->watches, sitter->sitter_watch))
- {
- /* we need to free it early so the destructor won't try to remove it
- * without it having been added, which DBusLoop doesn't allow */
- _dbus_watch_invalidate (sitter->sitter_watch);
- _dbus_watch_unref (sitter->sitter_watch);
- sitter->sitter_watch = NULL;
-
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto cleanup_and_fail;
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-#ifdef HAVE_SYSTEMD
- /* This may fail, but it's not critical.
- * In particular, if we were compiled with journald support but are now
- * running on a non-systemd system, this is going to fail, so we
- * have to cope gracefully. */
- fd_out = sd_journal_stream_fd (sitter->log_name, LOG_INFO, FALSE);
- fd_err = sd_journal_stream_fd (sitter->log_name, LOG_WARNING, FALSE);
-#endif
-
- pid = fork ();
-
- if (pid < 0)
- {
- dbus_set_error (error,
- DBUS_ERROR_SPAWN_FORK_FAILED,
- "Failed to fork (%s)",
- _dbus_strerror (errno));
- goto cleanup_and_fail;
- }
- else if (pid == 0)
- {
- /* Immediate child, this is the babysitter process. */
- int grandchild_pid;
-
- /* Be sure we crash if the parent exits
- * and we write to the err_report_pipe
- */
- signal (SIGPIPE, SIG_DFL);
-
- /* Close the parent's end of the pipes. */
- close_and_invalidate (&child_err_report_pipe[READ_END]);
- close_and_invalidate (&babysitter_pipe[0]);
-
- /* Create the child that will exec () */
- grandchild_pid = fork ();
-
- if (grandchild_pid < 0)
- {
- write_err_and_exit (babysitter_pipe[1],
- CHILD_FORK_FAILED);
- _dbus_assert_not_reached ("Got to code after write_err_and_exit()");
- }
- else if (grandchild_pid == 0)
- {
- /* Go back to ignoring SIGPIPE, since it's evil
- */
- signal (SIGPIPE, SIG_IGN);
-
- close_and_invalidate (&babysitter_pipe[1]);
-#ifdef HAVE_SYSTEMD
- /* log to systemd journal if possible */
- if (fd_out >= 0)
- dup2 (fd_out, STDOUT_FILENO);
- if (fd_err >= 0)
- dup2 (fd_err, STDERR_FILENO);
- close_and_invalidate (&fd_out);
- close_and_invalidate (&fd_err);
-#endif
- do_exec (child_err_report_pipe[WRITE_END],
- argv,
- env,
- child_setup, user_data);
- _dbus_assert_not_reached ("Got to code after exec() - should have exited on error");
- }
- else
- {
- close_and_invalidate (&child_err_report_pipe[WRITE_END]);
-#ifdef HAVE_SYSTEMD
- close_and_invalidate (&fd_out);
- close_and_invalidate (&fd_err);
-#endif
- babysit (grandchild_pid, babysitter_pipe[1]);
- _dbus_assert_not_reached ("Got to code after babysit()");
- }
- }
- else
- {
- /* Close the uncared-about ends of the pipes */
- close_and_invalidate (&child_err_report_pipe[WRITE_END]);
- close_and_invalidate (&babysitter_pipe[1]);
-#ifdef HAVE_SYSTEMD
- close_and_invalidate (&fd_out);
- close_and_invalidate (&fd_err);
-#endif
-
- sitter->socket_to_babysitter = babysitter_pipe[0];
- babysitter_pipe[0] = -1;
-
- sitter->error_pipe_from_child = child_err_report_pipe[READ_END];
- child_err_report_pipe[READ_END] = -1;
-
- sitter->sitter_pid = pid;
-
- if (sitter_p != NULL)
- *sitter_p = sitter;
- else
- _dbus_babysitter_unref (sitter);
-
- dbus_free_string_array (env);
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- return TRUE;
- }
-
- cleanup_and_fail:
-
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- close_and_invalidate (&child_err_report_pipe[READ_END]);
- close_and_invalidate (&child_err_report_pipe[WRITE_END]);
- close_and_invalidate (&babysitter_pipe[0]);
- close_and_invalidate (&babysitter_pipe[1]);
-#ifdef HAVE_SYSTEMD
- close_and_invalidate (&fd_out);
- close_and_invalidate (&fd_err);
-#endif
-
- if (sitter != NULL)
- _dbus_babysitter_unref (sitter);
-
- return FALSE;
-}
-
-void
-_dbus_babysitter_set_result_function (DBusBabysitter *sitter,
- DBusBabysitterFinishedFunc finished,
- void *user_data)
-{
- sitter->finished_cb = finished;
- sitter->finished_data = user_data;
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-static char *
-get_test_exec (const char *exe,
- DBusString *scratch_space)
-{
- const char *dbus_test_exec;
-
- dbus_test_exec = _dbus_getenv ("DBUS_TEST_EXEC");
-
- if (dbus_test_exec == NULL)
- dbus_test_exec = DBUS_TEST_EXEC;
-
- if (!_dbus_string_init (scratch_space))
- return NULL;
-
- if (!_dbus_string_append_printf (scratch_space, "%s/%s%s",
- dbus_test_exec, exe, DBUS_EXEEXT))
- {
- _dbus_string_free (scratch_space);
- return NULL;
- }
-
- return _dbus_string_get_data (scratch_space);
-}
-
-static void
-_dbus_babysitter_block_for_child_exit (DBusBabysitter *sitter)
-{
- while (LIVE_CHILDREN (sitter))
- babysitter_iteration (sitter, TRUE);
-}
-
-static dbus_bool_t
-check_spawn_nonexistent (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter = NULL;
- DBusError error = DBUS_ERROR_INIT;
-
- /*** Test launching nonexistent binary */
-
- argv[0] = "/this/does/not/exist/32542sdgafgafdg";
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_nonexistent", argv,
- NULL, NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching nonexistent executable\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_EXEC_FAILED)))
- {
- _dbus_warn ("Not expecting error when launching nonexistent executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_segfault (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter = NULL;
- DBusError error = DBUS_ERROR_INIT;
- DBusString argv0;
-
- /*** Test launching segfault binary */
-
- argv[0] = get_test_exec ("test-segfault", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_segfault", argv,
- NULL, NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching segfaulting binary\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_SIGNALED)))
- {
- _dbus_warn ("Not expecting error when launching segfaulting executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_exit (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter = NULL;
- DBusError error = DBUS_ERROR_INIT;
- DBusString argv0;
-
- /*** Test launching exit failure binary */
-
- argv[0] = get_test_exec ("test-exit", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_exit", argv,
- NULL, NULL, NULL,
- &error))
- {
- _dbus_babysitter_block_for_child_exit (sitter);
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error launching binary that exited with failure code\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_EXITED)))
- {
- _dbus_warn ("Not expecting error when launching exiting executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-static dbus_bool_t
-check_spawn_and_kill (void *data)
-{
- char *argv[4] = { NULL, NULL, NULL, NULL };
- DBusBabysitter *sitter = NULL;
- DBusError error = DBUS_ERROR_INIT;
- DBusString argv0;
-
- /*** Test launching sleeping binary then killing it */
-
- argv[0] = get_test_exec ("test-sleep-forever", &argv0);
-
- if (argv[0] == NULL)
- {
- /* OOM was simulated, never mind */
- return TRUE;
- }
-
- if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_and_kill", argv,
- NULL, NULL, NULL,
- &error))
- {
- _dbus_babysitter_kill_child (sitter);
-
- _dbus_babysitter_block_for_child_exit (sitter);
-
- _dbus_babysitter_set_child_exit_error (sitter, &error);
- }
-
- _dbus_string_free (&argv0);
-
- if (sitter)
- _dbus_babysitter_unref (sitter);
-
- if (!dbus_error_is_set (&error))
- {
- _dbus_warn ("Did not get an error after killing spawned binary\n");
- return FALSE;
- }
-
- if (!(dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY) ||
- dbus_error_has_name (&error, DBUS_ERROR_SPAWN_CHILD_SIGNALED)))
- {
- _dbus_warn ("Not expecting error when killing executable: %s: %s\n",
- error.name, error.message);
- dbus_error_free (&error);
- return FALSE;
- }
-
- dbus_error_free (&error);
-
- return TRUE;
-}
-
-dbus_bool_t
-_dbus_spawn_test (const char *test_data_dir)
-{
- if (!_dbus_test_oom_handling ("spawn_nonexistent",
- check_spawn_nonexistent,
- NULL))
- return FALSE;
-
- if (!_dbus_test_oom_handling ("spawn_segfault",
- check_spawn_segfault,
- NULL))
- return FALSE;
-
- if (!_dbus_test_oom_handling ("spawn_exit",
- check_spawn_exit,
- NULL))
- return FALSE;
-
- if (!_dbus_test_oom_handling ("spawn_and_kill",
- check_spawn_and_kill,
- NULL))
- return FALSE;
-
- return TRUE;
-}
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.h
deleted file mode 100644
index e6baae97e3..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-spawn.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-spawn.h Wrapper around fork/exec
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SPAWN_H
-#define DBUS_SPAWN_H
-
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-watch.h>
-
-DBUS_BEGIN_DECLS
-
-typedef void (* DBusSpawnChildSetupFunc) (void *user_data);
-
-typedef struct DBusBabysitter DBusBabysitter;
-
-typedef void (* DBusBabysitterFinishedFunc) (DBusBabysitter *sitter,
- void *user_data);
-
-dbus_bool_t _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
- const char *log_name,
- char **argv,
- char **env,
- DBusSpawnChildSetupFunc child_setup,
- void *user_data,
- DBusError *error);
-void _dbus_babysitter_set_result_function (DBusBabysitter *sitter,
- DBusBabysitterFinishedFunc finished,
- void *user_data);
-DBusBabysitter* _dbus_babysitter_ref (DBusBabysitter *sitter);
-void _dbus_babysitter_unref (DBusBabysitter *sitter);
-void _dbus_babysitter_kill_child (DBusBabysitter *sitter);
-dbus_bool_t _dbus_babysitter_get_child_exited (DBusBabysitter *sitter);
-void _dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
- DBusError *error);
-dbus_bool_t _dbus_babysitter_get_child_exit_status (DBusBabysitter *sitter,
- int *status);
-dbus_bool_t _dbus_babysitter_set_watch_functions (DBusBabysitter *sitter,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SPAWN_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-string-private.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-string-private.h
deleted file mode 100644
index 2e6de900fd..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-string-private.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-string-private.h String utility class (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_STRING_PRIVATE_H
-#define DBUS_STRING_PRIVATE_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-types.h>
-
-#ifndef DBUS_CAN_USE_DBUS_STRING_PRIVATE
-#error "Don't go including dbus-string-private.h for no good reason"
-#endif
-
-DBUS_BEGIN_DECLS
-
-/**
- * @brief Internals of DBusString.
- *
- * DBusString internals. DBusString is an opaque objects, it must be
- * used via accessor functions.
- */
-typedef struct
-{
- unsigned char *str; /**< String data, plus nul termination */
- int len; /**< Length without nul */
- int allocated; /**< Allocated size of data */
- unsigned int constant : 1; /**< String data is not owned by DBusString */
- unsigned int locked : 1; /**< DBusString has been locked and can't be changed */
- unsigned int invalid : 1; /**< DBusString is invalid (e.g. already freed) */
- unsigned int align_offset : 3; /**< str - align_offset is the actual malloc block */
-} DBusRealString;
-
-_DBUS_STATIC_ASSERT (sizeof (DBusRealString) == sizeof (DBusString));
-
-/**
- * @defgroup DBusStringInternals DBusString implementation details
- * @ingroup DBusInternals
- * @brief DBusString implementation details
- *
- * The guts of DBusString.
- *
- * @{
- */
-
-/**
- * The maximum length of a DBusString
- */
-#define _DBUS_STRING_MAX_LENGTH (_DBUS_INT32_MAX - _DBUS_STRING_ALLOCATION_PADDING)
-
-/**
- * Checks a bunch of assertions about a string object
- *
- * @param real the DBusRealString
- */
-#define DBUS_GENERIC_STRING_PREAMBLE(real) \
- do { \
- (void) real; /* might be unused unless asserting */ \
- _dbus_assert ((real) != NULL); \
- _dbus_assert (!(real)->invalid); \
- _dbus_assert ((real)->len >= 0); \
- _dbus_assert ((real)->allocated >= 0); \
- _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); \
- _dbus_assert ((real)->len <= _DBUS_STRING_MAX_LENGTH); \
- } while (0)
-
-/**
- * Checks assertions about a string object that needs to be
- * modifiable - may not be locked or const. Also declares
- * the "real" variable pointing to DBusRealString.
- * @param str the string
- */
-#define DBUS_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
- DBUS_GENERIC_STRING_PREAMBLE (real); \
- _dbus_assert (!(real)->constant); \
- _dbus_assert (!(real)->locked)
-
-/**
- * Checks assertions about a string object that may be locked but
- * can't be const. i.e. a string object that we can free. Also
- * declares the "real" variable pointing to DBusRealString.
- *
- * @param str the string
- */
-#define DBUS_LOCKED_STRING_PREAMBLE(str) DBusRealString *real = (DBusRealString*) str; \
- DBUS_GENERIC_STRING_PREAMBLE (real); \
- _dbus_assert (!(real)->constant)
-
-/**
- * Checks assertions about a string that may be const or locked. Also
- * declares the "real" variable pointing to DBusRealString.
- * @param str the string.
- */
-#define DBUS_CONST_STRING_PREAMBLE(str) const DBusRealString *real = (DBusRealString*) str; \
- DBUS_GENERIC_STRING_PREAMBLE (real)
-
-/**
- * Checks for ASCII blank byte
- * @param c the byte
- */
-#define DBUS_IS_ASCII_BLANK(c) ((c) == ' ' || (c) == '\t')
-
-/**
- * Checks for ASCII whitespace byte
- * @param c the byte
- */
-#define DBUS_IS_ASCII_WHITE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r')
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_STRING_PRIVATE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-string-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-string-util.c
deleted file mode 100644
index 3babc0534d..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-string-util.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-string-util.c Would be in dbus-string.c, but not used in libdbus
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2006 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-string.h"
-#define DBUS_CAN_USE_DBUS_STRING_PRIVATE 1
-#include "dbus-string-private.h"
-
-/**
- * @addtogroup DBusString
- * @{
- */
-
-/**
- * Returns whether a string ends with the given suffix
- *
- * @todo memcmp might make this faster.
- *
- * @param a the string
- * @param c_str the C-style string
- * @returns #TRUE if the string ends with the suffix
- */
-dbus_bool_t
-_dbus_string_ends_with_c_str (const DBusString *a,
- const char *c_str)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- unsigned long c_str_len;
- const DBusRealString *real_a = (const DBusRealString*) a;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- _dbus_assert (c_str != NULL);
-
- c_str_len = strlen (c_str);
- if (((unsigned long)real_a->len) < c_str_len)
- return FALSE;
-
- ap = real_a->str + (real_a->len - c_str_len);
- bp = (const unsigned char*) c_str;
- a_end = real_a->str + real_a->len;
- while (ap != a_end)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- _dbus_assert (*ap == '\0');
- _dbus_assert (*bp == '\0');
-
- return TRUE;
-}
-
-/**
- * Find the given byte scanning backward from the given start.
- * Sets *found to -1 if the byte is not found.
- *
- * @param str the string
- * @param start the place to start scanning (will not find the byte at this point)
- * @param byte the byte to find
- * @param found return location for where it was found
- * @returns #TRUE if found
- */
-dbus_bool_t
-_dbus_string_find_byte_backward (const DBusString *str,
- int start,
- unsigned char byte,
- int *found)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
- _dbus_assert (found != NULL);
-
- i = start - 1;
- while (i >= 0)
- {
- if (real->str[i] == byte)
- break;
-
- --i;
- }
-
- if (found)
- *found = i;
-
- return i >= 0;
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-test.h"
-#include <stdio.h>
-
-static void
-test_hex_roundtrip (const unsigned char *data,
- int len)
-{
- DBusString orig;
- DBusString encoded;
- DBusString decoded;
- int end;
-
- if (len < 0)
- len = strlen (data);
-
- if (!_dbus_string_init (&orig))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_init (&encoded))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_init (&decoded))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_append_len (&orig, data, len))
- _dbus_assert_not_reached ("couldn't append orig data");
-
- if (!_dbus_string_hex_encode (&orig, 0, &encoded, 0))
- _dbus_assert_not_reached ("could not encode");
-
- if (!_dbus_string_hex_decode (&encoded, 0, &end, &decoded, 0))
- _dbus_assert_not_reached ("could not decode");
-
- _dbus_assert (_dbus_string_get_length (&encoded) == end);
-
- if (!_dbus_string_equal (&orig, &decoded))
- {
- const char *s;
-
- printf ("Original string %d bytes encoded %d bytes decoded %d bytes\n",
- _dbus_string_get_length (&orig),
- _dbus_string_get_length (&encoded),
- _dbus_string_get_length (&decoded));
- printf ("Original: %s\n", data);
- s = _dbus_string_get_const_data (&decoded);
- printf ("Decoded: %s\n", s);
- _dbus_assert_not_reached ("original string not the same as string decoded from hex");
- }
-
- _dbus_string_free (&orig);
- _dbus_string_free (&encoded);
- _dbus_string_free (&decoded);
-}
-
-typedef void (* TestRoundtripFunc) (const unsigned char *data,
- int len);
-static void
-test_roundtrips (TestRoundtripFunc func)
-{
- (* func) ("Hello this is a string\n", -1);
- (* func) ("Hello this is a string\n1", -1);
- (* func) ("Hello this is a string\n12", -1);
- (* func) ("Hello this is a string\n123", -1);
- (* func) ("Hello this is a string\n1234", -1);
- (* func) ("Hello this is a string\n12345", -1);
- (* func) ("", 0);
- (* func) ("1", 1);
- (* func) ("12", 2);
- (* func) ("123", 3);
- (* func) ("1234", 4);
- (* func) ("12345", 5);
- (* func) ("", 1);
- (* func) ("1", 2);
- (* func) ("12", 3);
- (* func) ("123", 4);
- (* func) ("1234", 5);
- (* func) ("12345", 6);
- {
- unsigned char buf[512];
- int i;
-
- i = 0;
- while (i < _DBUS_N_ELEMENTS (buf))
- {
- buf[i] = i;
- ++i;
- }
- i = 0;
- while (i < _DBUS_N_ELEMENTS (buf))
- {
- (* func) (buf, i);
- ++i;
- }
- }
-}
-
-/**
- * @ingroup DBusStringInternals
- * Unit test for DBusString.
- *
- * @todo Need to write tests for _dbus_string_copy() and
- * _dbus_string_move() moving to/from each of start/middle/end of a
- * string. Also need tests for _dbus_string_move_len ()
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_string_test (void)
-{
- DBusString str;
- DBusString other;
- int i, a, end;
- long v;
- int lens[] = { 0, 1, 2, 3, 4, 5, 10, 16, 17, 18, 25, 31, 32, 33, 34, 35, 63, 64, 65, 66, 67, 68, 69, 70, 71, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136 };
- char *s;
-
- /* Test shortening and setting length */
- i = 0;
- while (i < _DBUS_N_ELEMENTS (lens))
- {
- int j;
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_set_length (&str, lens[i]))
- _dbus_assert_not_reached ("failed to set string length");
-
- j = lens[i];
- while (j > 0)
- {
- _dbus_assert (_dbus_string_get_length (&str) == j);
- if (j > 0)
- {
- _dbus_string_shorten (&str, 1);
- _dbus_assert (_dbus_string_get_length (&str) == (j - 1));
- }
- --j;
- }
-
- _dbus_string_free (&str);
-
- ++i;
- }
-
- /* Test equality */
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("oom");
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("oom");
-
- _dbus_string_init_const (&other, "H");
- _dbus_assert (_dbus_string_equal_substring (&str, 0, 1, &other, 0));
- _dbus_assert (_dbus_string_equal_substring (&str, 1, 0, &other, 1));
- _dbus_string_init_const (&other, "Hello");
- _dbus_assert (_dbus_string_equal_substring (&str, 0, 5, &other, 0));
- _dbus_assert (_dbus_string_equal_substring (&str, 1, 4, &other, 1));
- _dbus_assert (_dbus_string_equal_substring (&str, 2, 3, &other, 2));
- _dbus_assert (_dbus_string_equal_substring (&str, 3, 2, &other, 3));
- _dbus_assert (_dbus_string_equal_substring (&str, 4, 1, &other, 4));
- _dbus_assert (_dbus_string_equal_substring (&str, 5, 0, &other, 5));
-
- _dbus_assert (_dbus_string_equal_substring (&other, 0, 5, &str, 0));
- _dbus_assert (_dbus_string_equal_substring (&other, 1, 4, &str, 1));
- _dbus_assert (_dbus_string_equal_substring (&other, 2, 3, &str, 2));
- _dbus_assert (_dbus_string_equal_substring (&other, 3, 2, &str, 3));
- _dbus_assert (_dbus_string_equal_substring (&other, 4, 1, &str, 4));
- _dbus_assert (_dbus_string_equal_substring (&other, 5, 0, &str, 5));
-
-
- _dbus_string_init_const (&other, "World");
- _dbus_assert (_dbus_string_equal_substring (&str, 6, 5, &other, 0));
- _dbus_assert (_dbus_string_equal_substring (&str, 7, 4, &other, 1));
- _dbus_assert (_dbus_string_equal_substring (&str, 8, 3, &other, 2));
- _dbus_assert (_dbus_string_equal_substring (&str, 9, 2, &other, 3));
- _dbus_assert (_dbus_string_equal_substring (&str, 10, 1, &other, 4));
- _dbus_assert (_dbus_string_equal_substring (&str, 11, 0, &other, 5));
-
- _dbus_assert (_dbus_string_equal_substring (&other, 0, 5, &str, 6));
- _dbus_assert (_dbus_string_equal_substring (&other, 1, 4, &str, 7));
- _dbus_assert (_dbus_string_equal_substring (&other, 2, 3, &str, 8));
- _dbus_assert (_dbus_string_equal_substring (&other, 3, 2, &str, 9));
- _dbus_assert (_dbus_string_equal_substring (&other, 4, 1, &str, 10));
- _dbus_assert (_dbus_string_equal_substring (&other, 5, 0, &str, 11));
-
- _dbus_string_free (&str);
-
- /* Test appending data */
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- i = 0;
- while (i < 10)
- {
- if (!_dbus_string_append (&str, "a"))
- _dbus_assert_not_reached ("failed to append string to string\n");
-
- _dbus_assert (_dbus_string_get_length (&str) == i * 2 + 1);
-
- if (!_dbus_string_append_byte (&str, 'b'))
- _dbus_assert_not_reached ("failed to append byte to string\n");
-
- _dbus_assert (_dbus_string_get_length (&str) == i * 2 + 2);
-
- ++i;
- }
-
- _dbus_string_free (&str);
-
- /* Check steal_data */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_steal_data (&str, &s))
- _dbus_assert_not_reached ("failed to steal data");
-
- _dbus_assert (_dbus_string_get_length (&str) == 0);
- _dbus_assert (((int)strlen (s)) == i);
-
- dbus_free (s);
-
- /* Check move */
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_move (&str, 0, &other, 0))
- _dbus_assert_not_reached ("could not move");
-
- _dbus_assert (_dbus_string_get_length (&str) == 0);
- _dbus_assert (_dbus_string_get_length (&other) == i);
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- if (!_dbus_string_move (&str, 0, &other, _dbus_string_get_length (&other)))
- _dbus_assert_not_reached ("could not move");
-
- _dbus_assert (_dbus_string_get_length (&str) == 0);
- _dbus_assert (_dbus_string_get_length (&other) == i * 2);
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- if (!_dbus_string_move (&str, 0, &other, _dbus_string_get_length (&other) / 2))
- _dbus_assert_not_reached ("could not move");
-
- _dbus_assert (_dbus_string_get_length (&str) == 0);
- _dbus_assert (_dbus_string_get_length (&other) == i * 3);
-
- _dbus_string_free (&other);
-
- /* Check copy */
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_copy (&str, 0, &other, 0))
- _dbus_assert_not_reached ("could not copy");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i);
-
- if (!_dbus_string_copy (&str, 0, &other, _dbus_string_get_length (&other)))
- _dbus_assert_not_reached ("could not copy");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i * 2);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Hello WorldHello World"));
-
- if (!_dbus_string_copy (&str, 0, &other, _dbus_string_get_length (&other) / 2))
- _dbus_assert_not_reached ("could not copy");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i * 3);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Hello WorldHello WorldHello World"));
-
- _dbus_string_free (&str);
- _dbus_string_free (&other);
-
- /* Check replace */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_replace_len (&str, 0, _dbus_string_get_length (&str),
- &other, 0, _dbus_string_get_length (&other)))
- _dbus_assert_not_reached ("could not replace");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i);
- _dbus_assert (_dbus_string_equal_c_str (&other, "Hello World"));
-
- if (!_dbus_string_replace_len (&str, 0, _dbus_string_get_length (&str),
- &other, 5, 1))
- _dbus_assert_not_reached ("could not replace center space");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i * 2 - 1);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "HelloHello WorldWorld"));
-
-
- if (!_dbus_string_replace_len (&str, 1, 1,
- &other,
- _dbus_string_get_length (&other) - 1,
- 1))
- _dbus_assert_not_reached ("could not replace end character");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == i * 2 - 1);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "HelloHello WorldWorle"));
-
- _dbus_string_free (&str);
- _dbus_string_free (&other);
-
- /* Different tests are provided because different behaviours are
- * implemented in _dbus_string_replace_len() in function of replacing and
- * replaced lengths
- */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append (&str, "Hello World"))
- _dbus_assert_not_reached ("could not append to string");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_append (&other, "Foo String"))
- _dbus_assert_not_reached ("could not append to string");
-
- a = _dbus_string_get_length (&other);
-
- if (!_dbus_string_replace_len (&str, 0, 6,
- &other, 4, 0))
- _dbus_assert_not_reached ("could not replace 0 length");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 6);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Foo Hello String"));
-
- if (!_dbus_string_replace_len (&str, 5, 6,
- &other,
- _dbus_string_get_length (&other),
- 0))
- _dbus_assert_not_reached ("could not replace at the end");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 6 + 6);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Foo Hello String World"));
-
- if (!_dbus_string_replace_len (&str, 0, 5,
- &other,
- _dbus_string_get_length (&other) - 5,
- 5))
- _dbus_assert_not_reached ("could not replace same length");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 6 + 6);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Foo Hello String Hello"));
-
- if (!_dbus_string_replace_len (&str, 6, 5,
- &other, 4, 12))
- _dbus_assert_not_reached ("could not replace with shorter string");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 5);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "Foo World Hello"));
-
- if (!_dbus_string_replace_len (&str, 0, 1,
- &other, 0, 3))
- _dbus_assert_not_reached ("could not replace at the beginning");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 3);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "H World Hello"));
-
- if (!_dbus_string_replace_len (&str, 6, 5,
- &other,
- _dbus_string_get_length (&other) - 5,
- 5))
- _dbus_assert_not_reached ("could not replace same length");
-
- _dbus_assert (_dbus_string_get_length (&str) == i);
- _dbus_assert (_dbus_string_get_length (&other) == a + 3);
- _dbus_assert (_dbus_string_equal_c_str (&other,
- "H World World"));
-
- _dbus_string_free (&str);
- _dbus_string_free (&other);
-
- /* Check insert/set/get byte */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append (&str, "Hello"))
- _dbus_assert_not_reached ("failed to append Hello");
-
- _dbus_assert (_dbus_string_get_byte (&str, 0) == 'H');
- _dbus_assert (_dbus_string_get_byte (&str, 1) == 'e');
- _dbus_assert (_dbus_string_get_byte (&str, 2) == 'l');
- _dbus_assert (_dbus_string_get_byte (&str, 3) == 'l');
- _dbus_assert (_dbus_string_get_byte (&str, 4) == 'o');
-
- _dbus_string_set_byte (&str, 1, 'q');
- _dbus_assert (_dbus_string_get_byte (&str, 1) == 'q');
-
- if (!_dbus_string_insert_bytes (&str, 0, 1, 255))
- _dbus_assert_not_reached ("can't insert byte");
-
- if (!_dbus_string_insert_bytes (&str, 2, 4, 'Z'))
- _dbus_assert_not_reached ("can't insert byte");
-
- if (!_dbus_string_insert_bytes (&str, _dbus_string_get_length (&str), 1, 'W'))
- _dbus_assert_not_reached ("can't insert byte");
-
- _dbus_assert (_dbus_string_get_byte (&str, 0) == 255);
- _dbus_assert (_dbus_string_get_byte (&str, 1) == 'H');
- _dbus_assert (_dbus_string_get_byte (&str, 2) == 'Z');
- _dbus_assert (_dbus_string_get_byte (&str, 3) == 'Z');
- _dbus_assert (_dbus_string_get_byte (&str, 4) == 'Z');
- _dbus_assert (_dbus_string_get_byte (&str, 5) == 'Z');
- _dbus_assert (_dbus_string_get_byte (&str, 6) == 'q');
- _dbus_assert (_dbus_string_get_byte (&str, 7) == 'l');
- _dbus_assert (_dbus_string_get_byte (&str, 8) == 'l');
- _dbus_assert (_dbus_string_get_byte (&str, 9) == 'o');
- _dbus_assert (_dbus_string_get_byte (&str, 10) == 'W');
-
- _dbus_string_free (&str);
-
- /* Check append/parse int/double */
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append_int (&str, 27))
- _dbus_assert_not_reached ("failed to append int");
-
- i = _dbus_string_get_length (&str);
-
- if (!_dbus_string_parse_int (&str, 0, &v, &end))
- _dbus_assert_not_reached ("failed to parse int");
-
- _dbus_assert (v == 27);
- _dbus_assert (end == i);
-
- _dbus_string_free (&str);
-
- /* Test find */
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("failed to init string");
-
- if (!_dbus_string_append (&str, "Hello"))
- _dbus_assert_not_reached ("couldn't append to string");
-
- if (!_dbus_string_find (&str, 0, "He", &i))
- _dbus_assert_not_reached ("didn't find 'He'");
- _dbus_assert (i == 0);
-
- if (!_dbus_string_find (&str, 0, "Hello", &i))
- _dbus_assert_not_reached ("didn't find 'Hello'");
- _dbus_assert (i == 0);
-
- if (!_dbus_string_find (&str, 0, "ello", &i))
- _dbus_assert_not_reached ("didn't find 'ello'");
- _dbus_assert (i == 1);
-
- if (!_dbus_string_find (&str, 0, "lo", &i))
- _dbus_assert_not_reached ("didn't find 'lo'");
- _dbus_assert (i == 3);
-
- if (!_dbus_string_find (&str, 2, "lo", &i))
- _dbus_assert_not_reached ("didn't find 'lo'");
- _dbus_assert (i == 3);
-
- if (_dbus_string_find (&str, 4, "lo", &i))
- _dbus_assert_not_reached ("did find 'lo'");
-
- if (!_dbus_string_find (&str, 0, "l", &i))
- _dbus_assert_not_reached ("didn't find 'l'");
- _dbus_assert (i == 2);
-
- if (!_dbus_string_find (&str, 0, "H", &i))
- _dbus_assert_not_reached ("didn't find 'H'");
- _dbus_assert (i == 0);
-
- if (!_dbus_string_find (&str, 0, "", &i))
- _dbus_assert_not_reached ("didn't find ''");
- _dbus_assert (i == 0);
-
- if (_dbus_string_find (&str, 0, "Hello!", NULL))
- _dbus_assert_not_reached ("Did find 'Hello!'");
-
- if (_dbus_string_find (&str, 0, "Oh, Hello", NULL))
- _dbus_assert_not_reached ("Did find 'Oh, Hello'");
-
- if (_dbus_string_find (&str, 0, "ill", NULL))
- _dbus_assert_not_reached ("Did find 'ill'");
-
- if (_dbus_string_find (&str, 0, "q", NULL))
- _dbus_assert_not_reached ("Did find 'q'");
-
- if (!_dbus_string_find_to (&str, 0, 2, "He", NULL))
- _dbus_assert_not_reached ("Didn't find 'He'");
-
- if (_dbus_string_find_to (&str, 0, 2, "Hello", NULL))
- _dbus_assert_not_reached ("Did find 'Hello'");
-
- if (!_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str), 'H', &i))
- _dbus_assert_not_reached ("Did not find 'H'");
- _dbus_assert (i == 0);
-
- if (!_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str), 'o', &i))
- _dbus_assert_not_reached ("Did not find 'o'");
- _dbus_assert (i == _dbus_string_get_length (&str) - 1);
-
- if (_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str) - 1, 'o', &i))
- _dbus_assert_not_reached ("Did find 'o'");
- _dbus_assert (i == -1);
-
- if (_dbus_string_find_byte_backward (&str, 1, 'e', &i))
- _dbus_assert_not_reached ("Did find 'e'");
- _dbus_assert (i == -1);
-
- if (!_dbus_string_find_byte_backward (&str, 2, 'e', &i))
- _dbus_assert_not_reached ("Didn't find 'e'");
- _dbus_assert (i == 1);
-
- _dbus_string_free (&str);
-
- /* Hex encoding */
- _dbus_string_init_const (&str, "cafebabe, this is a bogus hex string");
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("could not init string");
-
- if (!_dbus_string_hex_decode (&str, 0, &end, &other, 0))
- _dbus_assert_not_reached ("deccoded bogus hex string with no error");
-
- _dbus_assert (end == 8);
-
- _dbus_string_free (&other);
-
- test_roundtrips (test_hex_roundtrip);
-
- _dbus_string_free (&str);
-
- {
- int found, found_len;
-
- _dbus_string_init_const (&str, "012\r\n567\n90");
-
- if (!_dbus_string_find_eol (&str, 0, &found, &found_len) || found != 3 || found_len != 2)
- _dbus_assert_not_reached ("Did not find '\\r\\n'");
- if (found != 3 || found_len != 2)
- _dbus_assert_not_reached ("invalid return values");
-
- if (!_dbus_string_find_eol (&str, 5, &found, &found_len))
- _dbus_assert_not_reached ("Did not find '\\n'");
- if (found != 8 || found_len != 1)
- _dbus_assert_not_reached ("invalid return values");
-
- if (_dbus_string_find_eol (&str, 9, &found, &found_len))
- _dbus_assert_not_reached ("Found not expected '\\n'");
- else if (found != 11 || found_len != 0)
- _dbus_assert_not_reached ("invalid return values '\\n'");
-
- found = -1;
- found_len = -1;
- _dbus_string_init_const (&str, "");
- if (_dbus_string_find_eol (&str, 0, &found, &found_len))
- _dbus_assert_not_reached ("found an eol in an empty string");
- _dbus_assert (found == 0);
- _dbus_assert (found_len == 0);
-
- found = -1;
- found_len = -1;
- _dbus_string_init_const (&str, "foobar");
- if (_dbus_string_find_eol (&str, 0, &found, &found_len))
- _dbus_assert_not_reached ("found eol in string that lacks one");
- _dbus_assert (found == 6);
- _dbus_assert (found_len == 0);
-
- found = -1;
- found_len = -1;
- _dbus_string_init_const (&str, "foobar\n");
- if (!_dbus_string_find_eol (&str, 0, &found, &found_len))
- _dbus_assert_not_reached ("did not find eol in string that has one at end");
- _dbus_assert (found == 6);
- _dbus_assert (found_len == 1);
- }
-
- {
- DBusString line;
-
-#define FIRST_LINE "this is a line"
-#define SECOND_LINE "this is a second line"
- /* third line is empty */
-#define THIRD_LINE ""
-#define FOURTH_LINE "this is a fourth line"
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, FIRST_LINE "\n" SECOND_LINE "\r\n" THIRD_LINE "\n" FOURTH_LINE))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&line))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_pop_line (&str, &line))
- _dbus_assert_not_reached ("failed to pop first line");
-
- _dbus_assert (_dbus_string_equal_c_str (&line, FIRST_LINE));
-
- if (!_dbus_string_pop_line (&str, &line))
- _dbus_assert_not_reached ("failed to pop second line");
-
- _dbus_assert (_dbus_string_equal_c_str (&line, SECOND_LINE));
-
- if (!_dbus_string_pop_line (&str, &line))
- _dbus_assert_not_reached ("failed to pop third line");
-
- _dbus_assert (_dbus_string_equal_c_str (&line, THIRD_LINE));
-
- if (!_dbus_string_pop_line (&str, &line))
- _dbus_assert_not_reached ("failed to pop fourth line");
-
- _dbus_assert (_dbus_string_equal_c_str (&line, FOURTH_LINE));
-
- _dbus_string_free (&str);
- _dbus_string_free (&line);
- }
-
- {
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- for (i = 0; i < 10000; i++)
- if (!_dbus_string_append (&str, "abcdefghijklmnopqrstuvwxyz"))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_set_length (&str, 10))
- _dbus_assert_not_reached ("failed to set length");
-
- /* actually compact */
- if (!_dbus_string_compact (&str, 2048))
- _dbus_assert_not_reached ("failed to compact after set_length");
-
- /* peek inside to make sure it worked */
- if (((DBusRealString *)&str)->allocated > 30)
- _dbus_assert_not_reached ("compacting string didn't do anything");
-
- if (!_dbus_string_equal_c_str (&str, "abcdefghij"))
- _dbus_assert_not_reached ("unexpected content after compact");
-
- /* compact nothing */
- if (!_dbus_string_compact (&str, 2048))
- _dbus_assert_not_reached ("failed to compact 2nd time");
-
- if (!_dbus_string_equal_c_str (&str, "abcdefghij"))
- _dbus_assert_not_reached ("unexpected content after 2nd compact");
-
- /* and make sure it still works...*/
- if (!_dbus_string_append (&str, "123456"))
- _dbus_assert_not_reached ("failed to append after compact");
-
- if (!_dbus_string_equal_c_str (&str, "abcdefghij123456"))
- _dbus_assert_not_reached ("unexpected content after append");
-
- /* after growing automatically, this should do nothing */
- if (!_dbus_string_compact (&str, 20000))
- _dbus_assert_not_reached ("failed to compact after grow");
-
- /* but this one will do something */
- if (!_dbus_string_compact (&str, 0))
- _dbus_assert_not_reached ("failed to compact after grow");
-
- if (!_dbus_string_equal_c_str (&str, "abcdefghij123456"))
- _dbus_assert_not_reached ("unexpected content");
-
- if (!_dbus_string_append (&str, "!@#$%"))
- _dbus_assert_not_reached ("failed to append after compact");
-
- if (!_dbus_string_equal_c_str (&str, "abcdefghij123456!@#$%"))
- _dbus_assert_not_reached ("unexpected content");
-
- _dbus_string_free (&str);
- }
-
- {
- const char two_strings[] = "one\ttwo";
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_init (&other))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, two_strings))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_split_on_byte (&str, '\t', &other))
- _dbus_assert_not_reached ("no memory or delimiter not found");
-
- if (strcmp (_dbus_string_get_data (&str), "one") != 0)
- _dbus_assert_not_reached ("left side after split on tab is wrong");
-
- if (strcmp (_dbus_string_get_data (&other), "two") != 0)
- _dbus_assert_not_reached ("right side after split on tab is wrong");
-
- _dbus_string_free (&str);
- _dbus_string_free (&other);
- }
-
- {
- const char upper_string[] = "TOUPPERSTRING";
- const char lower_string[] = "toupperstring";
- const char lower2_string[] = "toupperSTRING";
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, upper_string))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_tolower_ascii (&str, 0, _dbus_string_get_length(&str));
-
- if (!_dbus_string_equal_c_str (&str, lower_string))
- _dbus_assert_not_reached ("_dbus_string_tolower_ascii failed");
-
- _dbus_string_free (&str);
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, upper_string))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_tolower_ascii (&str, 0, 7);
-
- if (!_dbus_string_equal_c_str (&str, lower2_string))
- _dbus_assert_not_reached ("_dbus_string_tolower_ascii failed in partial conversion");
-
- _dbus_string_free (&str);
- }
-
- {
- const char lower_string[] = "toupperstring";
- const char upper_string[] = "TOUPPERSTRING";
- const char upper2_string[] = "TOUPPERstring";
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, lower_string))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_toupper_ascii (&str, 0, _dbus_string_get_length(&str));
-
- if (!_dbus_string_equal_c_str (&str, upper_string))
- _dbus_assert_not_reached ("_dbus_string_toupper_ascii failed");
-
- _dbus_string_free (&str);
-
- if (!_dbus_string_init (&str))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_append (&str, lower_string))
- _dbus_assert_not_reached ("no memory");
-
- _dbus_string_toupper_ascii (&str, 0, 7);
-
- if (!_dbus_string_equal_c_str (&str, upper2_string))
- _dbus_assert_not_reached ("_dbus_string_toupper_ascii failed in partial conversion");
-
- _dbus_string_free (&str);
- }
-
- return TRUE;
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-string.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-string.c
deleted file mode 100644
index c4e2e7fcb2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-string.c
+++ /dev/null
@@ -1,2675 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-string.c String utility class (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2006 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-string.h"
-/* we allow a system header here, for speed/convenience */
-#include <string.h>
-/* for vsnprintf */
-#include <stdio.h>
-#define DBUS_CAN_USE_DBUS_STRING_PRIVATE 1
-#include "dbus-string-private.h"
-#include "dbus-marshal-basic.h" /* probably should be removed by moving the usage of DBUS_TYPE
- * into the marshaling-related files
- */
-/* for DBUS_VA_COPY */
-#include "dbus-sysdeps.h"
-
-/**
- * @defgroup DBusString DBusString class
- * @ingroup DBusInternals
- * @brief DBusString data structure for safer string handling
- *
- * Types and functions related to DBusString. DBusString is intended
- * to be a string class that makes it hard to mess up security issues
- * (and just in general harder to write buggy code). It should be
- * used (or extended and then used) rather than the libc stuff in
- * string.h. The string class is a bit inconvenient at spots because
- * it handles out-of-memory failures and tries to be extra-robust.
- *
- * A DBusString has a maximum length set at initialization time; this
- * can be used to ensure that a buffer doesn't get too big. The
- * _dbus_string_lengthen() method checks for overflow, and for max
- * length being exceeded.
- *
- * Try to avoid conversion to a plain C string, i.e. add methods on
- * the string object instead, only convert to C string when passing
- * things out to the public API. In particular, no sprintf, strcpy,
- * strcat, any of that should be used. The GString feature of
- * accepting negative numbers for "length of string" is also absent,
- * because it could keep us from detecting bogus huge lengths. i.e. if
- * we passed in some bogus huge length it would be taken to mean
- * "current length of string" instead of "broken crack"
- *
- * @todo #DBusString needs a lot of cleaning up; some of the
- * API is no longer used, and the API is pretty inconsistent.
- * In particular all the "append" APIs, especially those involving
- * alignment but probably lots of them, are no longer used by the
- * marshaling code which always does "inserts" now.
- */
-
-/**
- * @addtogroup DBusString
- * @{
- */
-
-static void
-fixup_alignment (DBusRealString *real)
-{
- unsigned char *aligned;
- unsigned char *real_block;
- unsigned int old_align_offset;
-
- /* we have to have extra space in real->allocated for the align offset and nul byte */
- _dbus_assert (real->len <= real->allocated - _DBUS_STRING_ALLOCATION_PADDING);
-
- old_align_offset = real->align_offset;
- real_block = real->str - old_align_offset;
-
- aligned = _DBUS_ALIGN_ADDRESS (real_block, 8);
-
- real->align_offset = aligned - real_block;
- real->str = aligned;
-
- if (old_align_offset != real->align_offset)
- {
- /* Here comes the suck */
- memmove (real_block + real->align_offset,
- real_block + old_align_offset,
- real->len + 1);
- }
-
- _dbus_assert (real->align_offset < 8);
- _dbus_assert (_DBUS_ALIGN_ADDRESS (real->str, 8) == real->str);
-}
-
-static void
-undo_alignment (DBusRealString *real)
-{
- if (real->align_offset != 0)
- {
- memmove (real->str - real->align_offset,
- real->str,
- real->len + 1);
-
- real->str = real->str - real->align_offset;
- real->align_offset = 0;
- }
-}
-
-/**
- * Initializes a string that can be up to the given allocation size
- * before it has to realloc. The string starts life with zero length.
- * The string must eventually be freed with _dbus_string_free().
- *
- * @param str memory to hold the string
- * @param allocate_size amount to preallocate
- * @returns #TRUE on success, #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_init_preallocated (DBusString *str,
- int allocate_size)
-{
- DBusRealString *real;
-
- _dbus_assert (str != NULL);
-
- _dbus_assert (sizeof (DBusString) == sizeof (DBusRealString));
-
- real = (DBusRealString*) str;
-
- /* It's very important not to touch anything
- * other than real->str if we're going to fail,
- * since we also use this function to reset
- * an existing string, e.g. in _dbus_string_steal_data()
- */
-
- real->str = dbus_malloc (_DBUS_STRING_ALLOCATION_PADDING + allocate_size);
- if (real->str == NULL)
- return FALSE;
-
- real->allocated = _DBUS_STRING_ALLOCATION_PADDING + allocate_size;
- real->len = 0;
- real->str[real->len] = '\0';
-
- real->constant = FALSE;
- real->locked = FALSE;
- real->invalid = FALSE;
- real->align_offset = 0;
-
- fixup_alignment (real);
-
- return TRUE;
-}
-
-/**
- * Initializes a string. The string starts life with zero length. The
- * string must eventually be freed with _dbus_string_free().
- *
- * @param str memory to hold the string
- * @returns #TRUE on success, #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_init (DBusString *str)
-{
- return _dbus_string_init_preallocated (str, 0);
-}
-
-/**
- * Initializes a constant string. The value parameter is not copied
- * (should be static), and the string may never be modified.
- * It is safe but not necessary to call _dbus_string_free()
- * on a const string. The string has a length limit of MAXINT - 8.
- *
- * @param str memory to use for the string
- * @param value a string to be stored in str (not copied!!!)
- */
-void
-_dbus_string_init_const (DBusString *str,
- const char *value)
-{
- _dbus_assert (value != NULL);
-
- _dbus_string_init_const_len (str, value,
- strlen (value));
-}
-
-/**
- * Initializes a constant string with a length. The value parameter is
- * not copied (should be static), and the string may never be
- * modified. It is safe but not necessary to call _dbus_string_free()
- * on a const string.
- *
- * @param str memory to use for the string
- * @param value a string to be stored in str (not copied!!!)
- * @param len the length to use
- */
-void
-_dbus_string_init_const_len (DBusString *str,
- const char *value,
- int len)
-{
- DBusRealString *real;
-
- _dbus_assert (str != NULL);
- _dbus_assert (len == 0 || value != NULL);
- _dbus_assert (len <= _DBUS_STRING_MAX_LENGTH);
- _dbus_assert (len >= 0);
-
- real = (DBusRealString*) str;
-
- real->str = (unsigned char*) value;
- real->len = len;
- real->allocated = real->len + _DBUS_STRING_ALLOCATION_PADDING; /* a lie, just to avoid special-case assertions... */
- real->constant = TRUE;
- real->locked = TRUE;
- real->invalid = FALSE;
- real->align_offset = 0;
-
- /* We don't require const strings to be 8-byte aligned as the
- * memory is coming from elsewhere.
- */
-}
-
-/**
- * Frees a string created by _dbus_string_init().
- *
- * @param str memory where the string is stored.
- */
-void
-_dbus_string_free (DBusString *str)
-{
- DBusRealString *real = (DBusRealString*) str;
- DBUS_GENERIC_STRING_PREAMBLE (real);
-
- if (real->constant)
- return;
-
- /* so it's safe if @p str returned by a failed
- * _dbus_string_init call
- * Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65959
- */
- if (real->str == NULL)
- return;
-
- dbus_free (real->str - real->align_offset);
-
- real->invalid = TRUE;
-}
-
-static dbus_bool_t
-compact (DBusRealString *real,
- int max_waste)
-{
- unsigned char *new_str;
- int new_allocated;
- int waste;
-
- waste = real->allocated - (real->len + _DBUS_STRING_ALLOCATION_PADDING);
-
- if (waste <= max_waste)
- return TRUE;
-
- new_allocated = real->len + _DBUS_STRING_ALLOCATION_PADDING;
-
- new_str = dbus_realloc (real->str - real->align_offset, new_allocated);
- if (_DBUS_UNLIKELY (new_str == NULL))
- return FALSE;
-
- real->str = new_str + real->align_offset;
- real->allocated = new_allocated;
- fixup_alignment (real);
-
- return TRUE;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/* Not using this feature at the moment,
- * so marked DBUS_ENABLE_EMBEDDED_TESTS-only
- */
-/**
- * Locks a string such that any attempts to change the string will
- * result in aborting the program. Also, if the string is wasting a
- * lot of memory (allocation is sufficiently larger than what the
- * string is really using), _dbus_string_lock() will realloc the
- * string's data to "compact" it.
- *
- * @param str the string to lock.
- */
-void
-_dbus_string_lock (DBusString *str)
-{
- DBUS_LOCKED_STRING_PREAMBLE (str); /* can lock multiple times */
-
- real->locked = TRUE;
-
- /* Try to realloc to avoid excess memory usage, since
- * we know we won't change the string further
- */
-#define MAX_WASTE 48
- compact (real, MAX_WASTE);
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-static dbus_bool_t
-reallocate_for_length (DBusRealString *real,
- int new_length)
-{
- int new_allocated;
- unsigned char *new_str;
-
- /* at least double our old allocation to avoid O(n), avoiding
- * overflow
- */
- if (real->allocated > (_DBUS_STRING_MAX_LENGTH + _DBUS_STRING_ALLOCATION_PADDING) / 2)
- new_allocated = _DBUS_STRING_MAX_LENGTH + _DBUS_STRING_ALLOCATION_PADDING;
- else
- new_allocated = real->allocated * 2;
-
- /* if you change the code just above here, run the tests without
- * the following assert-only hack before you commit
- */
- /* This is keyed off asserts in addition to tests so when you
- * disable asserts to profile, you don't get this destroyer
- * of profiles.
- */
-#if defined (DBUS_ENABLE_EMBEDDED_TESTS) && !defined (DBUS_DISABLE_ASSERT)
- new_allocated = 0; /* ensure a realloc every time so that we go
- * through all malloc failure codepaths
- */
-#endif
-
- /* But be sure we always alloc at least space for the new length */
- new_allocated = MAX (new_allocated,
- new_length + _DBUS_STRING_ALLOCATION_PADDING);
-
- _dbus_assert (new_allocated >= real->allocated); /* code relies on this */
- new_str = dbus_realloc (real->str - real->align_offset, new_allocated);
- if (_DBUS_UNLIKELY (new_str == NULL))
- return FALSE;
-
- real->str = new_str + real->align_offset;
- real->allocated = new_allocated;
- fixup_alignment (real);
-
- return TRUE;
-}
-
-/**
- * Compacts the string to avoid wasted memory. Wasted memory is
- * memory that is allocated but not actually required to store the
- * current length of the string. The compact is only done if more
- * than the given amount of memory is being wasted (otherwise the
- * waste is ignored and the call does nothing).
- *
- * @param str the string
- * @param max_waste the maximum amount of waste to ignore
- * @returns #FALSE if the compact failed due to realloc failure
- */
-dbus_bool_t
-_dbus_string_compact (DBusString *str,
- int max_waste)
-{
- DBUS_STRING_PREAMBLE (str);
-
- return compact (real, max_waste);
-}
-
-static dbus_bool_t
-set_length (DBusRealString *real,
- int new_length)
-{
- /* Note, we are setting the length not including nul termination */
-
- /* exceeding max length is the same as failure to allocate memory */
- if (_DBUS_UNLIKELY (new_length > _DBUS_STRING_MAX_LENGTH))
- return FALSE;
- else if (new_length > (real->allocated - _DBUS_STRING_ALLOCATION_PADDING) &&
- _DBUS_UNLIKELY (!reallocate_for_length (real, new_length)))
- return FALSE;
- else
- {
- real->len = new_length;
- real->str[new_length] = '\0';
- return TRUE;
- }
-}
-
-static dbus_bool_t
-open_gap (int len,
- DBusRealString *dest,
- int insert_at)
-{
- if (len == 0)
- return TRUE;
-
- if (len > _DBUS_STRING_MAX_LENGTH - dest->len)
- return FALSE; /* detected overflow of dest->len + len below */
-
- if (!set_length (dest, dest->len + len))
- return FALSE;
-
- memmove (dest->str + insert_at + len,
- dest->str + insert_at,
- dest->len - len - insert_at);
-
- return TRUE;
-}
-
-#ifndef _dbus_string_get_data
-/**
- * Gets the raw character buffer from the string. The returned buffer
- * will be nul-terminated, but note that strings may contain binary
- * data so there may be extra nul characters prior to the termination.
- * This function should be little-used, extend DBusString or add
- * stuff to dbus-sysdeps.c instead. It's an error to use this
- * function on a const string.
- *
- * @param str the string
- * @returns the data
- */
-char*
-_dbus_string_get_data (DBusString *str)
-{
- DBUS_STRING_PREAMBLE (str);
-
- return (char*) real->str;
-}
-#endif /* _dbus_string_get_data */
-
-/* only do the function if we don't have the macro */
-#ifndef _dbus_string_get_const_data
-/**
- * Gets the raw character buffer from a const string.
- *
- * @param str the string
- * @returns the string data
- */
-const char*
-_dbus_string_get_const_data (const DBusString *str)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
-
- return (const char*) real->str;
-}
-#endif /* _dbus_string_get_const_data */
-
-/**
- * Gets a sub-portion of the raw character buffer from the
- * string. The "len" field is required simply for error
- * checking, to be sure you don't try to use more
- * string than exists. The nul termination of the
- * returned buffer remains at the end of the entire
- * string, not at start + len.
- *
- * @param str the string
- * @param start byte offset to return
- * @param len length of segment to return
- * @returns the string data
- */
-char*
-_dbus_string_get_data_len (DBusString *str,
- int start,
- int len)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len <= real->len - start);
-
- return (char*) real->str + start;
-}
-
-/* only do the function if we don't have the macro */
-#ifndef _dbus_string_get_const_data_len
-/**
- * const version of _dbus_string_get_data_len().
- *
- * @param str the string
- * @param start byte offset to return
- * @param len length of segment to return
- * @returns the string data
- */
-const char*
-_dbus_string_get_const_data_len (const DBusString *str,
- int start,
- int len)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len <= real->len - start);
-
- return (const char*) real->str + start;
-}
-#endif /* _dbus_string_get_const_data_len */
-
-/* only do the function if we don't have the macro */
-#ifndef _dbus_string_set_byte
-/**
- * Sets the value of the byte at the given position.
- *
- * @param str the string
- * @param i the position
- * @param byte the new value
- */
-void
-_dbus_string_set_byte (DBusString *str,
- int i,
- unsigned char byte)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (i < real->len);
- _dbus_assert (i >= 0);
-
- real->str[i] = byte;
-}
-#endif /* _dbus_string_set_byte */
-
-/* only have the function if we didn't create a macro */
-#ifndef _dbus_string_get_byte
-/**
- * Gets the byte at the given position. It is
- * allowed to ask for the nul byte at the end of
- * the string.
- *
- * @param str the string
- * @param start the position
- * @returns the byte at that position
- */
-unsigned char
-_dbus_string_get_byte (const DBusString *str,
- int start)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
-
- return real->str[start];
-}
-#endif /* _dbus_string_get_byte */
-
-/**
- * Inserts a number of bytes of a given value at the
- * given position.
- *
- * @param str the string
- * @param i the position
- * @param n_bytes number of bytes
- * @param byte the value to insert
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_insert_bytes (DBusString *str,
- int i,
- int n_bytes,
- unsigned char byte)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (i <= real->len);
- _dbus_assert (i >= 0);
- _dbus_assert (n_bytes >= 0);
-
- if (n_bytes == 0)
- return TRUE;
-
- if (!open_gap (n_bytes, real, i))
- return FALSE;
-
- memset (real->str + i, byte, n_bytes);
-
- return TRUE;
-}
-
-/**
- * Inserts a single byte at the given position.
- *
- * @param str the string
- * @param i the position
- * @param byte the value to insert
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_insert_byte (DBusString *str,
- int i,
- unsigned char byte)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (i <= real->len);
- _dbus_assert (i >= 0);
-
- if (!open_gap (1, real, i))
- return FALSE;
-
- real->str[i] = byte;
-
- return TRUE;
-}
-
-/**
- * Like _dbus_string_get_data(), but removes the
- * gotten data from the original string. The caller
- * must free the data returned. This function may
- * fail due to lack of memory, and return #FALSE.
- *
- * @param str the string
- * @param data_return location to return the buffer
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_steal_data (DBusString *str,
- char **data_return)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (data_return != NULL);
-
- undo_alignment (real);
-
- *data_return = (char*) real->str;
-
- /* reset the string */
- if (!_dbus_string_init (str))
- {
- /* hrm, put it back then */
- real->str = (unsigned char*) *data_return;
- *data_return = NULL;
- fixup_alignment (real);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Copies the data from the string into a char*
- *
- * @param str the string
- * @param data_return place to return the data
- * @returns #TRUE on success, #FALSE on no memory
- */
-dbus_bool_t
-_dbus_string_copy_data (const DBusString *str,
- char **data_return)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (data_return != NULL);
-
- *data_return = dbus_malloc (real->len + 1);
- if (*data_return == NULL)
- return FALSE;
-
- memcpy (*data_return, real->str, real->len + 1);
-
- return TRUE;
-}
-
-/**
- * Copies the contents of a DBusString into a different buffer. It is
- * a bug if avail_len is too short to hold the string contents. nul
- * termination is not copied, just the supplied bytes.
- *
- * @param str a string
- * @param buffer a C buffer to copy data to
- * @param avail_len maximum length of C buffer
- */
-void
-_dbus_string_copy_to_buffer (const DBusString *str,
- char *buffer,
- int avail_len)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
-
- _dbus_assert (avail_len >= 0);
- _dbus_assert (avail_len >= real->len);
-
- memcpy (buffer, real->str, real->len);
-}
-
-/**
- * Copies the contents of a DBusString into a different buffer. It is
- * a bug if avail_len is too short to hold the string contents plus a
- * nul byte.
- *
- * @param str a string
- * @param buffer a C buffer to copy data to
- * @param avail_len maximum length of C buffer
- */
-void
-_dbus_string_copy_to_buffer_with_nul (const DBusString *str,
- char *buffer,
- int avail_len)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
-
- _dbus_assert (avail_len >= 0);
- _dbus_assert (avail_len > real->len);
-
- memcpy (buffer, real->str, real->len+1);
-}
-
-/* Only have the function if we don't have the macro */
-#ifndef _dbus_string_get_length
-/**
- * Gets the length of a string (not including nul termination).
- *
- * @returns the length.
- */
-int
-_dbus_string_get_length (const DBusString *str)
-{
- DBUS_CONST_STRING_PREAMBLE (str);
-
- return real->len;
-}
-#endif /* !_dbus_string_get_length */
-
-/**
- * Makes a string longer by the given number of bytes. Checks whether
- * adding additional_length to the current length would overflow an
- * integer, and checks for exceeding a string's max length.
- * The new bytes are not initialized, other than nul-terminating
- * the end of the string. The uninitialized bytes may contain
- * nul bytes or other junk.
- *
- * @param str a string
- * @param additional_length length to add to the string.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_string_lengthen (DBusString *str,
- int additional_length)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (additional_length >= 0);
-
- if (_DBUS_UNLIKELY (additional_length > _DBUS_STRING_MAX_LENGTH - real->len))
- return FALSE; /* would overflow */
-
- return set_length (real,
- real->len + additional_length);
-}
-
-/**
- * Makes a string shorter by the given number of bytes.
- *
- * @param str a string
- * @param length_to_remove length to remove from the string.
- */
-void
-_dbus_string_shorten (DBusString *str,
- int length_to_remove)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (length_to_remove >= 0);
- _dbus_assert (length_to_remove <= real->len);
-
- set_length (real,
- real->len - length_to_remove);
-}
-
-/**
- * Sets the length of a string. Can be used to truncate or lengthen
- * the string. If the string is lengthened, the function may fail and
- * return #FALSE. Newly-added bytes are not initialized, as with
- * _dbus_string_lengthen().
- *
- * @param str a string
- * @param length new length of the string.
- * @returns #FALSE on failure.
- */
-dbus_bool_t
-_dbus_string_set_length (DBusString *str,
- int length)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (length >= 0);
-
- return set_length (real, length);
-}
-
-static dbus_bool_t
-align_insert_point_then_open_gap (DBusString *str,
- int *insert_at_p,
- int alignment,
- int gap_size)
-{
- unsigned long new_len; /* ulong to avoid _DBUS_ALIGN_VALUE overflow */
- unsigned long gap_pos;
- int insert_at;
- int delta;
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (alignment >= 1);
- _dbus_assert (alignment <= 8); /* it has to be a bug if > 8 */
-
- insert_at = *insert_at_p;
-
- _dbus_assert (insert_at <= real->len);
-
- gap_pos = _DBUS_ALIGN_VALUE (insert_at, alignment);
- new_len = real->len + (gap_pos - insert_at) + gap_size;
-
- if (_DBUS_UNLIKELY (new_len > (unsigned long) _DBUS_STRING_MAX_LENGTH))
- return FALSE;
-
- delta = new_len - real->len;
- _dbus_assert (delta >= 0);
-
- if (delta == 0) /* only happens if gap_size == 0 and insert_at is aligned already */
- {
- _dbus_assert (((unsigned long) *insert_at_p) == gap_pos);
- return TRUE;
- }
-
- if (_DBUS_UNLIKELY (!open_gap (new_len - real->len,
- real, insert_at)))
- return FALSE;
-
- /* nul the padding if we had to add any padding */
- if (gap_size < delta)
- {
- memset (&real->str[insert_at], '\0',
- gap_pos - insert_at);
- }
-
- *insert_at_p = gap_pos;
-
- return TRUE;
-}
-
-static dbus_bool_t
-align_length_then_lengthen (DBusString *str,
- int alignment,
- int then_lengthen_by)
-{
- int insert_at;
-
- insert_at = _dbus_string_get_length (str);
-
- return align_insert_point_then_open_gap (str,
- &insert_at,
- alignment, then_lengthen_by);
-}
-
-/**
- * Align the length of a string to a specific alignment (typically 4 or 8)
- * by appending nul bytes to the string.
- *
- * @param str a string
- * @param alignment the alignment
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_align_length (DBusString *str,
- int alignment)
-{
- return align_length_then_lengthen (str, alignment, 0);
-}
-
-/**
- * Preallocate extra_bytes such that a future lengthening of the
- * string by extra_bytes is guaranteed to succeed without an out of
- * memory error.
- *
- * @param str a string
- * @param extra_bytes bytes to alloc
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_alloc_space (DBusString *str,
- int extra_bytes)
-{
- if (!_dbus_string_lengthen (str, extra_bytes))
- return FALSE;
- _dbus_string_shorten (str, extra_bytes);
-
- return TRUE;
-}
-
-static dbus_bool_t
-append (DBusRealString *real,
- const char *buffer,
- int buffer_len)
-{
- if (buffer_len == 0)
- return TRUE;
-
- if (!_dbus_string_lengthen ((DBusString*)real, buffer_len))
- return FALSE;
-
- memcpy (real->str + (real->len - buffer_len),
- buffer,
- buffer_len);
-
- return TRUE;
-}
-
-/**
- * Appends a nul-terminated C-style string to a DBusString.
- *
- * @param str the DBusString
- * @param buffer the nul-terminated characters to append
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_append (DBusString *str,
- const char *buffer)
-{
- unsigned long buffer_len;
-
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (buffer != NULL);
-
- buffer_len = strlen (buffer);
- if (buffer_len > (unsigned long) _DBUS_STRING_MAX_LENGTH)
- return FALSE;
-
- return append (real, buffer, buffer_len);
-}
-
-/** assign 2 bytes from one string to another */
-#define ASSIGN_2_OCTETS(p, octets) \
- *((dbus_uint16_t*)(p)) = *((dbus_uint16_t*)(octets));
-
-/** assign 4 bytes from one string to another */
-#define ASSIGN_4_OCTETS(p, octets) \
- *((dbus_uint32_t*)(p)) = *((dbus_uint32_t*)(octets));
-
-/** assign 8 bytes from one string to another */
-#define ASSIGN_8_OCTETS(p, octets) \
- *((dbus_uint64_t*)(p)) = *((dbus_uint64_t*)(octets));
-
-/**
- * Inserts 2 bytes aligned on a 2 byte boundary
- * with any alignment padding initialized to 0.
- *
- * @param str the DBusString
- * @param insert_at where to insert
- * @param octets 2 bytes to insert
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_insert_2_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[2])
-{
- DBUS_STRING_PREAMBLE (str);
-
- if (!align_insert_point_then_open_gap (str, &insert_at, 2, 2))
- return FALSE;
-
- ASSIGN_2_OCTETS (real->str + insert_at, octets);
-
- return TRUE;
-}
-
-/**
- * Inserts 4 bytes aligned on a 4 byte boundary
- * with any alignment padding initialized to 0.
- *
- * @param str the DBusString
- * @param insert_at where to insert
- * @param octets 4 bytes to insert
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_insert_4_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[4])
-{
- DBUS_STRING_PREAMBLE (str);
-
- if (!align_insert_point_then_open_gap (str, &insert_at, 4, 4))
- return FALSE;
-
- ASSIGN_4_OCTETS (real->str + insert_at, octets);
-
- return TRUE;
-}
-
-/**
- * Inserts 8 bytes aligned on an 8 byte boundary
- * with any alignment padding initialized to 0.
- *
- * @param str the DBusString
- * @param insert_at where to insert
- * @param octets 8 bytes to insert
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_insert_8_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[8])
-{
- DBUS_STRING_PREAMBLE (str);
-
- if (!align_insert_point_then_open_gap (str, &insert_at, 8, 8))
- return FALSE;
-
- _dbus_assert (_DBUS_ALIGN_VALUE (insert_at, 8) == (unsigned) insert_at);
-
- ASSIGN_8_OCTETS (real->str + insert_at, octets);
-
- return TRUE;
-}
-
-
-/**
- * Inserts padding at *insert_at such to align it to the given
- * boundary. Initializes the padding to nul bytes. Sets *insert_at
- * to the aligned position.
- *
- * @param str the DBusString
- * @param insert_at location to be aligned
- * @param alignment alignment boundary (1, 2, 4, or 8)
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_insert_alignment (DBusString *str,
- int *insert_at,
- int alignment)
-{
- DBUS_STRING_PREAMBLE (str);
-
- if (!align_insert_point_then_open_gap (str, insert_at, alignment, 0))
- return FALSE;
-
- _dbus_assert (_DBUS_ALIGN_VALUE (*insert_at, alignment) == (unsigned) *insert_at);
-
- return TRUE;
-}
-
-/**
- * Appends a printf-style formatted string
- * to the #DBusString.
- *
- * @param str the string
- * @param format printf format
- * @param args variable argument list
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_append_printf_valist (DBusString *str,
- const char *format,
- va_list args)
-{
- int len;
- va_list args_copy;
-
- DBUS_STRING_PREAMBLE (str);
-
- DBUS_VA_COPY (args_copy, args);
-
- /* Measure the message length without terminating nul */
- len = _dbus_printf_string_upper_bound (format, args);
-
- if (len < 0)
- return FALSE;
-
- if (!_dbus_string_lengthen (str, len))
- {
- /* don't leak the copy */
- va_end (args_copy);
- return FALSE;
- }
-
- vsprintf ((char*) (real->str + (real->len - len)),
- format, args_copy);
-
- va_end (args_copy);
-
- return TRUE;
-}
-
-/**
- * Appends a printf-style formatted string
- * to the #DBusString.
- *
- * @param str the string
- * @param format printf format
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_append_printf (DBusString *str,
- const char *format,
- ...)
-{
- va_list args;
- dbus_bool_t retval;
-
- va_start (args, format);
- retval = _dbus_string_append_printf_valist (str, format, args);
- va_end (args);
-
- return retval;
-}
-
-/**
- * Appends block of bytes with the given length to a DBusString.
- *
- * @param str the DBusString
- * @param buffer the bytes to append
- * @param len the number of bytes to append
- * @returns #FALSE if not enough memory.
- */
-dbus_bool_t
-_dbus_string_append_len (DBusString *str,
- const char *buffer,
- int len)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (buffer != NULL);
- _dbus_assert (len >= 0);
-
- return append (real, buffer, len);
-}
-
-/**
- * Appends a single byte to the string, returning #FALSE
- * if not enough memory.
- *
- * @param str the string
- * @param byte the byte to append
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_append_byte (DBusString *str,
- unsigned char byte)
-{
- DBUS_STRING_PREAMBLE (str);
-
- if (!set_length (real, real->len + 1))
- return FALSE;
-
- real->str[real->len-1] = byte;
-
- return TRUE;
-}
-
-static void
-delete (DBusRealString *real,
- int start,
- int len)
-{
- if (len == 0)
- return;
-
- memmove (real->str + start, real->str + start + len, real->len - (start + len));
- real->len -= len;
- real->str[real->len] = '\0';
-}
-
-/**
- * Deletes a segment of a DBusString with length len starting at
- * start. (Hint: to clear an entire string, setting length to 0
- * with _dbus_string_set_length() is easier.)
- *
- * @param str the DBusString
- * @param start where to start deleting
- * @param len the number of bytes to delete
- */
-void
-_dbus_string_delete (DBusString *str,
- int start,
- int len)
-{
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len <= real->len - start);
-
- delete (real, start, len);
-}
-
-static dbus_bool_t
-copy (DBusRealString *source,
- int start,
- int len,
- DBusRealString *dest,
- int insert_at)
-{
- if (len == 0)
- return TRUE;
-
- if (!open_gap (len, dest, insert_at))
- return FALSE;
-
- memmove (dest->str + insert_at,
- source->str + start,
- len);
-
- return TRUE;
-}
-
-/**
- * Checks assertions for two strings we're copying a segment between,
- * and declares real_source/real_dest variables.
- *
- * @param source the source string
- * @param start the starting offset
- * @param dest the dest string
- * @param insert_at where the copied segment is inserted
- */
-#define DBUS_STRING_COPY_PREAMBLE(source, start, dest, insert_at) \
- DBusRealString *real_source = (DBusRealString*) source; \
- DBusRealString *real_dest = (DBusRealString*) dest; \
- _dbus_assert ((source) != (dest)); \
- DBUS_GENERIC_STRING_PREAMBLE (real_source); \
- DBUS_GENERIC_STRING_PREAMBLE (real_dest); \
- _dbus_assert (!real_dest->constant); \
- _dbus_assert (!real_dest->locked); \
- _dbus_assert ((start) >= 0); \
- _dbus_assert ((start) <= real_source->len); \
- _dbus_assert ((insert_at) >= 0); \
- _dbus_assert ((insert_at) <= real_dest->len)
-
-/**
- * Moves the end of one string into another string. Both strings
- * must be initialized, valid strings.
- *
- * @param source the source string
- * @param start where to chop off the source string
- * @param dest the destination string
- * @param insert_at where to move the chopped-off part of source string
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_string_move (DBusString *source,
- int start,
- DBusString *dest,
- int insert_at)
-{
- DBusRealString *real_source = (DBusRealString*) source;
- _dbus_assert (start <= real_source->len);
-
- return _dbus_string_move_len (source, start,
- real_source->len - start,
- dest, insert_at);
-}
-
-/**
- * Like _dbus_string_move(), but does not delete the section
- * of the source string that's copied to the dest string.
- *
- * @param source the source string
- * @param start where to start copying the source string
- * @param dest the destination string
- * @param insert_at where to place the copied part of source string
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_string_copy (const DBusString *source,
- int start,
- DBusString *dest,
- int insert_at)
-{
- DBUS_STRING_COPY_PREAMBLE (source, start, dest, insert_at);
-
- return copy (real_source, start,
- real_source->len - start,
- real_dest,
- insert_at);
-}
-
-/**
- * Like _dbus_string_move(), but can move a segment from
- * the middle of the source string.
- *
- * @param source the source string
- * @param start first byte of source string to move
- * @param len length of segment to move
- * @param dest the destination string
- * @param insert_at where to move the bytes from the source string
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_string_move_len (DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int insert_at)
-
-{
- DBUS_STRING_COPY_PREAMBLE (source, start, dest, insert_at);
- _dbus_assert (len >= 0);
- _dbus_assert ((start + len) <= real_source->len);
-
-
- if (len == 0)
- {
- return TRUE;
- }
- else if (start == 0 &&
- len == real_source->len &&
- real_dest->len == 0)
- {
- /* Short-circuit moving an entire existing string to an empty string
- * by just swapping the buffers.
- */
- /* we assume ->constant doesn't matter as you can't have
- * a constant string involved in a move.
- */
-#define ASSIGN_DATA(a, b) do { \
- (a)->str = (b)->str; \
- (a)->len = (b)->len; \
- (a)->allocated = (b)->allocated; \
- (a)->align_offset = (b)->align_offset; \
- } while (0)
-
- DBusRealString tmp;
-
- ASSIGN_DATA (&tmp, real_source);
- ASSIGN_DATA (real_source, real_dest);
- ASSIGN_DATA (real_dest, &tmp);
-
- return TRUE;
- }
- else
- {
- if (!copy (real_source, start, len,
- real_dest,
- insert_at))
- return FALSE;
-
- delete (real_source, start,
- len);
-
- return TRUE;
- }
-}
-
-/**
- * Like _dbus_string_copy(), but can copy a segment from the middle of
- * the source string.
- *
- * @param source the source string
- * @param start where to start copying the source string
- * @param len length of segment to copy
- * @param dest the destination string
- * @param insert_at where to place the copied segment of source string
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_string_copy_len (const DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int insert_at)
-{
- DBUS_STRING_COPY_PREAMBLE (source, start, dest, insert_at);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real_source->len);
- _dbus_assert (len <= real_source->len - start);
-
- return copy (real_source, start, len,
- real_dest,
- insert_at);
-}
-
-/**
- * Replaces a segment of dest string with a segment of source string.
- *
- * @param source the source string
- * @param start where to start copying the source string
- * @param len length of segment to copy
- * @param dest the destination string
- * @param replace_at start of segment of dest string to replace
- * @param replace_len length of segment of dest string to replace
- * @returns #FALSE if not enough memory
- *
- */
-dbus_bool_t
-_dbus_string_replace_len (const DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int replace_at,
- int replace_len)
-{
- DBUS_STRING_COPY_PREAMBLE (source, start, dest, replace_at);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real_source->len);
- _dbus_assert (len <= real_source->len - start);
- _dbus_assert (replace_at >= 0);
- _dbus_assert (replace_at <= real_dest->len);
- _dbus_assert (replace_len <= real_dest->len - replace_at);
-
- if (len == replace_len)
- {
- memmove (real_dest->str + replace_at,
- real_source->str + start, len);
- }
- else if (len < replace_len)
- {
- memmove (real_dest->str + replace_at,
- real_source->str + start, len);
- delete (real_dest, replace_at + len,
- replace_len - len);
- }
- else
- {
- int diff;
-
- _dbus_assert (len > replace_len);
-
- diff = len - replace_len;
-
- /* First of all we check if destination string can be enlarged as
- * required, then we overwrite previous bytes
- */
-
- if (!copy (real_source, start + replace_len, diff,
- real_dest, replace_at + replace_len))
- return FALSE;
-
- memmove (real_dest->str + replace_at,
- real_source->str + start, replace_len);
- }
-
- return TRUE;
-}
-
-/**
- * Looks for the first occurance of a byte, deletes that byte,
- * and moves everything after the byte to the beginning of a
- * separate string. Both strings must be initialized, valid
- * strings.
- *
- * @param source the source string
- * @param byte the byte to remove and split the string at
- * @param tail the split off string
- * @returns #FALSE if not enough memory or if byte could not be found
- *
- */
-dbus_bool_t
-_dbus_string_split_on_byte (DBusString *source,
- unsigned char byte,
- DBusString *tail)
-{
- int byte_position;
- char byte_string[2] = "";
- int head_length;
- int tail_length;
-
- byte_string[0] = (char) byte;
-
- if (!_dbus_string_find (source, 0, byte_string, &byte_position))
- return FALSE;
-
- head_length = byte_position;
- tail_length = _dbus_string_get_length (source) - head_length - 1;
-
- if (!_dbus_string_move_len (source, byte_position + 1, tail_length,
- tail, 0))
- return FALSE;
-
- /* remove the trailing delimiter byte from the head now.
- */
- if (!_dbus_string_set_length (source, head_length))
- return FALSE;
-
- return TRUE;
-}
-
-/* Unicode macros and utf8_validate() from GLib Owen Taylor, Havoc
- * Pennington, and Tom Tromey are the authors and authorized relicense.
- */
-
-/** computes length and mask of a unicode character
- * @param Char the char
- * @param Mask the mask variable to assign to
- * @param Len the length variable to assign to
- */
-#define UTF8_COMPUTE(Char, Mask, Len) \
- if (Char < 128) \
- { \
- Len = 1; \
- Mask = 0x7f; \
- } \
- else if ((Char & 0xe0) == 0xc0) \
- { \
- Len = 2; \
- Mask = 0x1f; \
- } \
- else if ((Char & 0xf0) == 0xe0) \
- { \
- Len = 3; \
- Mask = 0x0f; \
- } \
- else if ((Char & 0xf8) == 0xf0) \
- { \
- Len = 4; \
- Mask = 0x07; \
- } \
- else if ((Char & 0xfc) == 0xf8) \
- { \
- Len = 5; \
- Mask = 0x03; \
- } \
- else if ((Char & 0xfe) == 0xfc) \
- { \
- Len = 6; \
- Mask = 0x01; \
- } \
- else \
- { \
- Len = 0; \
- Mask = 0; \
- }
-
-/**
- * computes length of a unicode character in UTF-8
- * @param Char the char
- */
-#define UTF8_LENGTH(Char) \
- ((Char) < 0x80 ? 1 : \
- ((Char) < 0x800 ? 2 : \
- ((Char) < 0x10000 ? 3 : \
- ((Char) < 0x200000 ? 4 : \
- ((Char) < 0x4000000 ? 5 : 6)))))
-
-/**
- * Gets a UTF-8 value.
- *
- * @param Result variable for extracted unicode char.
- * @param Chars the bytes to decode
- * @param Count counter variable
- * @param Mask mask for this char
- * @param Len length for this char in bytes
- */
-#define UTF8_GET(Result, Chars, Count, Mask, Len) \
- (Result) = (Chars)[0] & (Mask); \
- for ((Count) = 1; (Count) < (Len); ++(Count)) \
- { \
- if (((Chars)[(Count)] & 0xc0) != 0x80) \
- { \
- (Result) = -1; \
- break; \
- } \
- (Result) <<= 6; \
- (Result) |= ((Chars)[(Count)] & 0x3f); \
- }
-
-/**
- * Check whether a Unicode (5.2) char is in a valid range.
- *
- * The first check comes from the Unicode guarantee to never encode
- * a point above 0x0010ffff, since UTF-16 couldn't represent it.
- *
- * The second check covers surrogate pairs (category Cs).
- *
- * @param Char the character
- */
-#define UNICODE_VALID(Char) \
- ((Char) < 0x110000 && \
- (((Char) & 0xFFFFF800) != 0xD800))
-
-/**
- * Finds the given substring in the string,
- * returning #TRUE and filling in the byte index
- * where the substring was found, if it was found.
- * Returns #FALSE if the substring wasn't found.
- * Sets *start to the length of the string if the substring
- * is not found.
- *
- * @param str the string
- * @param start where to start looking
- * @param substr the substring
- * @param found return location for where it was found, or #NULL
- * @returns #TRUE if found
- */
-dbus_bool_t
-_dbus_string_find (const DBusString *str,
- int start,
- const char *substr,
- int *found)
-{
- return _dbus_string_find_to (str, start,
- ((const DBusRealString*)str)->len,
- substr, found);
-}
-
-/**
- * Finds end of line ("\r\n" or "\n") in the string,
- * returning #TRUE and filling in the byte index
- * where the eol string was found, if it was found.
- * Returns #FALSE if eol wasn't found.
- *
- * @param str the string
- * @param start where to start looking
- * @param found return location for where eol was found or string length otherwise
- * @param found_len return length of found eol string or zero otherwise
- * @returns #TRUE if found
- */
-dbus_bool_t
-_dbus_string_find_eol (const DBusString *str,
- int start,
- int *found,
- int *found_len)
-{
- int i;
-
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
-
- i = start;
- while (i < real->len)
- {
- if (real->str[i] == '\r')
- {
- if ((i+1) < real->len && real->str[i+1] == '\n') /* "\r\n" */
- {
- if (found)
- *found = i;
- if (found_len)
- *found_len = 2;
- return TRUE;
- }
- else /* only "\r" */
- {
- if (found)
- *found = i;
- if (found_len)
- *found_len = 1;
- return TRUE;
- }
- }
- else if (real->str[i] == '\n') /* only "\n" */
- {
- if (found)
- *found = i;
- if (found_len)
- *found_len = 1;
- return TRUE;
- }
- ++i;
- }
-
- if (found)
- *found = real->len;
-
- if (found_len)
- *found_len = 0;
-
- return FALSE;
-}
-
-/**
- * Finds the given substring in the string,
- * up to a certain position,
- * returning #TRUE and filling in the byte index
- * where the substring was found, if it was found.
- * Returns #FALSE if the substring wasn't found.
- * Sets *start to the length of the string if the substring
- * is not found.
- *
- * @param str the string
- * @param start where to start looking
- * @param end where to stop looking
- * @param substr the substring
- * @param found return location for where it was found, or #NULL
- * @returns #TRUE if found
- */
-dbus_bool_t
-_dbus_string_find_to (const DBusString *str,
- int start,
- int end,
- const char *substr,
- int *found)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (substr != NULL);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
- _dbus_assert (substr != NULL);
- _dbus_assert (end <= real->len);
- _dbus_assert (start <= end);
-
- /* we always "find" an empty string */
- if (*substr == '\0')
- {
- if (found)
- *found = start;
- return TRUE;
- }
-
- i = start;
- while (i < end)
- {
- if (real->str[i] == substr[0])
- {
- int j = i + 1;
-
- while (j < end)
- {
- if (substr[j - i] == '\0')
- break;
- else if (real->str[j] != substr[j - i])
- break;
-
- ++j;
- }
-
- if (substr[j - i] == '\0')
- {
- if (found)
- *found = i;
- return TRUE;
- }
- }
-
- ++i;
- }
-
- if (found)
- *found = end;
-
- return FALSE;
-}
-
-/**
- * Finds a blank (space or tab) in the string. Returns #TRUE
- * if found, #FALSE otherwise. If a blank is not found sets
- * *found to the length of the string.
- *
- * @param str the string
- * @param start byte index to start looking
- * @param found place to store the location of the first blank
- * @returns #TRUE if a blank was found
- */
-dbus_bool_t
-_dbus_string_find_blank (const DBusString *str,
- int start,
- int *found)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
-
- i = start;
- while (i < real->len)
- {
- if (real->str[i] == ' ' ||
- real->str[i] == '\t')
- {
- if (found)
- *found = i;
- return TRUE;
- }
-
- ++i;
- }
-
- if (found)
- *found = real->len;
-
- return FALSE;
-}
-
-/**
- * Skips blanks from start, storing the first non-blank in *end
- * (blank is space or tab).
- *
- * @param str the string
- * @param start where to start
- * @param end where to store the first non-blank byte index
- */
-void
-_dbus_string_skip_blank (const DBusString *str,
- int start,
- int *end)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
-
- i = start;
- while (i < real->len)
- {
- if (!DBUS_IS_ASCII_BLANK (real->str[i]))
- break;
-
- ++i;
- }
-
- _dbus_assert (i == real->len || !DBUS_IS_ASCII_WHITE (real->str[i]));
-
- if (end)
- *end = i;
-}
-
-
-/**
- * Skips whitespace from start, storing the first non-whitespace in *end.
- * (whitespace is space, tab, newline, CR).
- *
- * @param str the string
- * @param start where to start
- * @param end where to store the first non-whitespace byte index
- */
-void
-_dbus_string_skip_white (const DBusString *str,
- int start,
- int *end)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start <= real->len);
- _dbus_assert (start >= 0);
-
- i = start;
- while (i < real->len)
- {
- if (!DBUS_IS_ASCII_WHITE (real->str[i]))
- break;
-
- ++i;
- }
-
- _dbus_assert (i == real->len || !(DBUS_IS_ASCII_WHITE (real->str[i])));
-
- if (end)
- *end = i;
-}
-
-/**
- * Skips whitespace from end, storing the start index of the trailing
- * whitespace in *start. (whitespace is space, tab, newline, CR).
- *
- * @param str the string
- * @param end where to start scanning backward
- * @param start where to store the start of whitespace chars
- */
-void
-_dbus_string_skip_white_reverse (const DBusString *str,
- int end,
- int *start)
-{
- int i;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (end <= real->len);
- _dbus_assert (end >= 0);
-
- i = end;
- while (i > 0)
- {
- if (!DBUS_IS_ASCII_WHITE (real->str[i-1]))
- break;
- --i;
- }
-
- _dbus_assert (i >= 0 && (i == 0 || !(DBUS_IS_ASCII_WHITE (real->str[i-1]))));
-
- if (start)
- *start = i;
-}
-
-/**
- * Assigns a newline-terminated or \\r\\n-terminated line from the front
- * of the string to the given dest string. The dest string's previous
- * contents are deleted. If the source string contains no newline,
- * moves the entire source string to the dest string.
- *
- * @todo owen correctly notes that this is a stupid function (it was
- * written purely for test code,
- * e.g. dbus-message-builder.c). Probably should be enforced as test
- * code only with ifdef DBUS_ENABLE_EMBEDDED_TESTS
- *
- * @param source the source string
- * @param dest the destination string (contents are replaced)
- * @returns #FALSE if no memory, or source has length 0
- */
-dbus_bool_t
-_dbus_string_pop_line (DBusString *source,
- DBusString *dest)
-{
- int eol, eol_len;
-
- _dbus_string_set_length (dest, 0);
-
- eol = 0;
- eol_len = 0;
- if (!_dbus_string_find_eol (source, 0, &eol, &eol_len))
- {
- _dbus_assert (eol == _dbus_string_get_length (source));
- if (eol == 0)
- {
- /* If there's no newline and source has zero length, we're done */
- return FALSE;
- }
- /* otherwise, the last line of the file has no eol characters */
- }
-
- /* remember eol can be 0 if it's an empty line, but eol_len should not be zero also
- * since find_eol returned TRUE
- */
-
- if (!_dbus_string_move_len (source, 0, eol + eol_len, dest, 0))
- return FALSE;
-
- /* remove line ending */
- if (!_dbus_string_set_length (dest, eol))
- {
- _dbus_assert_not_reached ("out of memory when shortening a string");
- return FALSE;
- }
-
- return TRUE;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Deletes up to and including the first blank space
- * in the string.
- *
- * @param str the string
- */
-void
-_dbus_string_delete_first_word (DBusString *str)
-{
- int i;
-
- if (_dbus_string_find_blank (str, 0, &i))
- _dbus_string_skip_blank (str, i, &i);
-
- _dbus_string_delete (str, 0, i);
-}
-#endif
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Deletes any leading blanks in the string
- *
- * @param str the string
- */
-void
-_dbus_string_delete_leading_blanks (DBusString *str)
-{
- int i;
-
- _dbus_string_skip_blank (str, 0, &i);
-
- if (i > 0)
- _dbus_string_delete (str, 0, i);
-}
-#endif
-
-/**
- * Deletes leading and trailing whitespace
- *
- * @param str the string
- */
-void
-_dbus_string_chop_white(DBusString *str)
-{
- int i;
-
- _dbus_string_skip_white (str, 0, &i);
-
- if (i > 0)
- _dbus_string_delete (str, 0, i);
-
- _dbus_string_skip_white_reverse (str, _dbus_string_get_length (str), &i);
-
- _dbus_string_set_length (str, i);
-}
-
-/**
- * Tests two DBusString for equality.
- *
- * @todo memcmp is probably faster
- *
- * @param a first string
- * @param b second string
- * @returns #TRUE if equal
- */
-dbus_bool_t
-_dbus_string_equal (const DBusString *a,
- const DBusString *b)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- const DBusRealString *real_a = (const DBusRealString*) a;
- const DBusRealString *real_b = (const DBusRealString*) b;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- DBUS_GENERIC_STRING_PREAMBLE (real_b);
-
- if (real_a->len != real_b->len)
- return FALSE;
-
- ap = real_a->str;
- bp = real_b->str;
- a_end = real_a->str + real_a->len;
- while (ap != a_end)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- return TRUE;
-}
-
-/**
- * Tests two DBusString for equality up to the given length.
- * The strings may be shorter than the given length.
- *
- * @todo write a unit test
- *
- * @todo memcmp is probably faster
- *
- * @param a first string
- * @param b second string
- * @param len the maximum length to look at
- * @returns #TRUE if equal for the given number of bytes
- */
-dbus_bool_t
-_dbus_string_equal_len (const DBusString *a,
- const DBusString *b,
- int len)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- const DBusRealString *real_a = (const DBusRealString*) a;
- const DBusRealString *real_b = (const DBusRealString*) b;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- DBUS_GENERIC_STRING_PREAMBLE (real_b);
-
- if (real_a->len != real_b->len &&
- (real_a->len < len || real_b->len < len))
- return FALSE;
-
- ap = real_a->str;
- bp = real_b->str;
- a_end = real_a->str + MIN (real_a->len, len);
- while (ap != a_end)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- return TRUE;
-}
-
-/**
- * Tests two sub-parts of two DBusString for equality. The specified
- * range of the first string must exist; the specified start position
- * of the second string must exist.
- *
- * @todo write a unit test
- *
- * @todo memcmp is probably faster
- *
- * @param a first string
- * @param a_start where to start substring in first string
- * @param a_len length of substring in first string
- * @param b second string
- * @param b_start where to start substring in second string
- * @returns #TRUE if the two substrings are equal
- */
-dbus_bool_t
-_dbus_string_equal_substring (const DBusString *a,
- int a_start,
- int a_len,
- const DBusString *b,
- int b_start)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- const DBusRealString *real_a = (const DBusRealString*) a;
- const DBusRealString *real_b = (const DBusRealString*) b;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- DBUS_GENERIC_STRING_PREAMBLE (real_b);
- _dbus_assert (a_start >= 0);
- _dbus_assert (a_len >= 0);
- _dbus_assert (a_start <= real_a->len);
- _dbus_assert (a_len <= real_a->len - a_start);
- _dbus_assert (b_start >= 0);
- _dbus_assert (b_start <= real_b->len);
-
- if (a_len > real_b->len - b_start)
- return FALSE;
-
- ap = real_a->str + a_start;
- bp = real_b->str + b_start;
- a_end = ap + a_len;
- while (ap != a_end)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- _dbus_assert (bp <= (real_b->str + real_b->len));
-
- return TRUE;
-}
-
-/**
- * Checks whether a string is equal to a C string.
- *
- * @param a the string
- * @param c_str the C string
- * @returns #TRUE if equal
- */
-dbus_bool_t
-_dbus_string_equal_c_str (const DBusString *a,
- const char *c_str)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- const DBusRealString *real_a = (const DBusRealString*) a;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- _dbus_assert (c_str != NULL);
-
- ap = real_a->str;
- bp = (const unsigned char*) c_str;
- a_end = real_a->str + real_a->len;
- while (ap != a_end && *bp)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- if (ap != a_end || *bp)
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Checks whether a string starts with the given C string.
- *
- * @param a the string
- * @param c_str the C string
- * @returns #TRUE if string starts with it
- */
-dbus_bool_t
-_dbus_string_starts_with_c_str (const DBusString *a,
- const char *c_str)
-{
- const unsigned char *ap;
- const unsigned char *bp;
- const unsigned char *a_end;
- const DBusRealString *real_a = (const DBusRealString*) a;
- DBUS_GENERIC_STRING_PREAMBLE (real_a);
- _dbus_assert (c_str != NULL);
-
- ap = real_a->str;
- bp = (const unsigned char*) c_str;
- a_end = real_a->str + real_a->len;
- while (ap != a_end && *bp)
- {
- if (*ap != *bp)
- return FALSE;
-
- ++ap;
- ++bp;
- }
-
- if (*bp == '\0')
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Appends a two-character hex digit to a string, where the hex digit
- * has the value of the given byte.
- *
- * @param str the string
- * @param byte the byte
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_append_byte_as_hex (DBusString *str,
- unsigned char byte)
-{
- const char hexdigits[16] = {
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'a', 'b', 'c', 'd', 'e', 'f'
- };
-
- if (!_dbus_string_append_byte (str,
- hexdigits[(byte >> 4)]))
- return FALSE;
-
- if (!_dbus_string_append_byte (str,
- hexdigits[(byte & 0x0f)]))
- {
- _dbus_string_set_length (str,
- _dbus_string_get_length (str) - 1);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Encodes a string in hex, the way MD5 and SHA-1 are usually
- * encoded. (Each byte is two hex digits.)
- *
- * @param source the string to encode
- * @param start byte index to start encoding
- * @param dest string where encoded data should be placed
- * @param insert_at where to place encoded data
- * @returns #TRUE if encoding was successful, #FALSE if no memory etc.
- */
-dbus_bool_t
-_dbus_string_hex_encode (const DBusString *source,
- int start,
- DBusString *dest,
- int insert_at)
-{
- DBusString result;
- const unsigned char *p;
- const unsigned char *end;
- dbus_bool_t retval;
-
- _dbus_assert (start <= _dbus_string_get_length (source));
-
- if (!_dbus_string_init (&result))
- return FALSE;
-
- retval = FALSE;
-
- p = (const unsigned char*) _dbus_string_get_const_data (source);
- end = p + _dbus_string_get_length (source);
- p += start;
-
- while (p != end)
- {
- if (!_dbus_string_append_byte_as_hex (&result, *p))
- goto out;
-
- ++p;
- }
-
- if (!_dbus_string_move (&result, 0, dest, insert_at))
- goto out;
-
- retval = TRUE;
-
- out:
- _dbus_string_free (&result);
- return retval;
-}
-
-/**
- * Decodes a string from hex encoding.
- *
- * @param source the string to decode
- * @param start byte index to start decode
- * @param end_return return location of the end of the hex data, or #NULL
- * @param dest string where decoded data should be placed
- * @param insert_at where to place decoded data
- * @returns #TRUE if decoding was successful, #FALSE if no memory.
- */
-dbus_bool_t
-_dbus_string_hex_decode (const DBusString *source,
- int start,
- int *end_return,
- DBusString *dest,
- int insert_at)
-{
- DBusString result;
- const unsigned char *p;
- const unsigned char *end;
- dbus_bool_t retval;
- dbus_bool_t high_bits;
-
- _dbus_assert (start <= _dbus_string_get_length (source));
-
- if (!_dbus_string_init (&result))
- return FALSE;
-
- retval = FALSE;
-
- high_bits = TRUE;
- p = (const unsigned char*) _dbus_string_get_const_data (source);
- end = p + _dbus_string_get_length (source);
- p += start;
-
- while (p != end)
- {
- unsigned int val;
-
- switch (*p)
- {
- case '0':
- val = 0;
- break;
- case '1':
- val = 1;
- break;
- case '2':
- val = 2;
- break;
- case '3':
- val = 3;
- break;
- case '4':
- val = 4;
- break;
- case '5':
- val = 5;
- break;
- case '6':
- val = 6;
- break;
- case '7':
- val = 7;
- break;
- case '8':
- val = 8;
- break;
- case '9':
- val = 9;
- break;
- case 'a':
- case 'A':
- val = 10;
- break;
- case 'b':
- case 'B':
- val = 11;
- break;
- case 'c':
- case 'C':
- val = 12;
- break;
- case 'd':
- case 'D':
- val = 13;
- break;
- case 'e':
- case 'E':
- val = 14;
- break;
- case 'f':
- case 'F':
- val = 15;
- break;
- default:
- goto done;
- }
-
- if (high_bits)
- {
- if (!_dbus_string_append_byte (&result,
- val << 4))
- goto out;
- }
- else
- {
- int len;
- unsigned char b;
-
- len = _dbus_string_get_length (&result);
-
- b = _dbus_string_get_byte (&result, len - 1);
-
- b |= val;
-
- _dbus_string_set_byte (&result, len - 1, b);
- }
-
- high_bits = !high_bits;
-
- ++p;
- }
-
- done:
- if (!_dbus_string_move (&result, 0, dest, insert_at))
- goto out;
-
- if (end_return)
- *end_return = p - (const unsigned char*) _dbus_string_get_const_data (source);
-
- retval = TRUE;
-
- out:
- _dbus_string_free (&result);
- return retval;
-}
-
-/**
- * Checks that the given range of the string is valid ASCII with no
- * nul bytes. If the given range is not entirely contained in the
- * string, returns #FALSE.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is all valid ASCII
- */
-dbus_bool_t
-_dbus_string_validate_ascii (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *s;
- const unsigned char *end;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len >= 0);
-
- if (len > real->len - start)
- return FALSE;
-
- s = real->str + start;
- end = s + len;
- while (s != end)
- {
- if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s)))
- return FALSE;
-
- ++s;
- }
-
- return TRUE;
-}
-
-/**
- * Converts the given range of the string to lower case.
- *
- * @param str the string
- * @param start first byte index to convert
- * @param len number of bytes to convert
- */
-void
-_dbus_string_tolower_ascii (const DBusString *str,
- int start,
- int len)
-{
- unsigned char *s;
- unsigned char *end;
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len >= 0);
- _dbus_assert (len <= real->len - start);
-
- s = real->str + start;
- end = s + len;
-
- while (s != end)
- {
- if (*s >= 'A' && *s <= 'Z')
- *s += 'a' - 'A';
- ++s;
- }
-}
-
-/**
- * Converts the given range of the string to upper case.
- *
- * @param str the string
- * @param start first byte index to convert
- * @param len number of bytes to convert
- */
-void
-_dbus_string_toupper_ascii (const DBusString *str,
- int start,
- int len)
-{
- unsigned char *s;
- unsigned char *end;
- DBUS_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len >= 0);
- _dbus_assert (len <= real->len - start);
-
- s = real->str + start;
- end = s + len;
-
- while (s != end)
- {
- if (*s >= 'a' && *s <= 'z')
- *s += 'A' - 'a';
- ++s;
- }
-}
-
-/**
- * Checks that the given range of the string is valid UTF-8. If the
- * given range is not entirely contained in the string, returns
- * #FALSE. If the string contains any nul bytes in the given range,
- * returns #FALSE. If the start and start+len are not on character
- * boundaries, returns #FALSE.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is all valid UTF-8
- */
-dbus_bool_t
-_dbus_string_validate_utf8 (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *p;
- const unsigned char *end;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (start <= real->len);
- _dbus_assert (len >= 0);
-
- /* we are doing _DBUS_UNLIKELY() here which might be
- * dubious in a generic library like GLib, but in D-Bus
- * we know we're validating messages and that it would
- * only be evil/broken apps that would have invalid
- * UTF-8. Also, this function seems to be a performance
- * bottleneck in profiles.
- */
-
- if (_DBUS_UNLIKELY (len > real->len - start))
- return FALSE;
-
- p = real->str + start;
- end = p + len;
-
- while (p < end)
- {
- int i, mask, char_len;
- dbus_unichar_t result;
-
- /* nul bytes considered invalid */
- if (*p == '\0')
- break;
-
- /* Special-case ASCII; this makes us go a lot faster in
- * D-Bus profiles where we are typically validating
- * function names and such. We have to know that
- * all following checks will pass for ASCII though,
- * comments follow ...
- */
- if (*p < 128)
- {
- ++p;
- continue;
- }
-
- UTF8_COMPUTE (*p, mask, char_len);
-
- if (_DBUS_UNLIKELY (char_len == 0)) /* ASCII: char_len == 1 */
- break;
-
- /* check that the expected number of bytes exists in the remaining length */
- if (_DBUS_UNLIKELY ((end - p) < char_len)) /* ASCII: p < end and char_len == 1 */
- break;
-
- UTF8_GET (result, p, i, mask, char_len);
-
- /* Check for overlong UTF-8 */
- if (_DBUS_UNLIKELY (UTF8_LENGTH (result) != char_len)) /* ASCII: UTF8_LENGTH == 1 */
- break;
-#if 0
- /* The UNICODE_VALID check below will catch this */
- if (_DBUS_UNLIKELY (result == (dbus_unichar_t)-1)) /* ASCII: result = ascii value */
- break;
-#endif
-
- if (_DBUS_UNLIKELY (!UNICODE_VALID (result))) /* ASCII: always valid */
- break;
-
- /* UNICODE_VALID should have caught it */
- _dbus_assert (result != (dbus_unichar_t)-1);
-
- p += char_len;
- }
-
- /* See that we covered the entire length if a length was
- * passed in
- */
- if (_DBUS_UNLIKELY (p != end))
- return FALSE;
- else
- return TRUE;
-}
-
-/**
- * Checks that the given range of the string is all nul bytes. If the
- * given range is not entirely contained in the string, returns
- * #FALSE.
- *
- * @todo this is inconsistent with most of DBusString in that
- * it allows a start,len range that extends past the string end.
- *
- * @param str the string
- * @param start first byte index to check
- * @param len number of bytes to check
- * @returns #TRUE if the byte range exists and is all nul bytes
- */
-dbus_bool_t
-_dbus_string_validate_nul (const DBusString *str,
- int start,
- int len)
-{
- const unsigned char *s;
- const unsigned char *end;
- DBUS_CONST_STRING_PREAMBLE (str);
- _dbus_assert (start >= 0);
- _dbus_assert (len >= 0);
- _dbus_assert (start <= real->len);
-
- if (len > real->len - start)
- return FALSE;
-
- s = real->str + start;
- end = s + len;
- while (s != end)
- {
- if (_DBUS_UNLIKELY (*s != '\0'))
- return FALSE;
- ++s;
- }
-
- return TRUE;
-}
-
-/**
- * Clears all allocated bytes in the string to zero.
- *
- * @param str the string
- */
-void
-_dbus_string_zero (DBusString *str)
-{
- DBUS_STRING_PREAMBLE (str);
-
- memset (real->str - real->align_offset, '\0', real->allocated);
-}
-/** @} */
-
-/* tests are in dbus-string-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-string.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-string.h
deleted file mode 100644
index 86fb8c39b4..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-string.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-string.h String utility class (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2006 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_STRING_H
-#define DBUS_STRING_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-memory.h>
-
-#include <stdarg.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * DBusString object
- */
-
-typedef struct DBusString DBusString;
-
-struct DBusString
-{
-#if defined(DBUS_WIN) && defined(_DEBUG)
- const char *dummy1; /**< placeholder */
-#else
- const void *dummy1; /**< placeholder */
-#endif
- int dummy2; /**< placeholder */
- int dummy3; /**< placeholder */
- unsigned int dummy_bit1 : 1; /**< placeholder */
- unsigned int dummy_bit2 : 1; /**< placeholder */
- unsigned int dummy_bit3 : 1; /**< placeholder */
- unsigned int dummy_bits : 3; /**< placeholder */
-};
-
-#ifdef DBUS_DISABLE_ASSERT
-/* Some simple inlining hacks; the current linker is not smart enough
- * to inline non-exported symbols across files in the library.
- * Note that these break type safety (due to the casts)
- */
-#define _dbus_string_get_data(s) ((char*)(((DBusString*)(s))->dummy1))
-#define _dbus_string_get_length(s) (((DBusString*)(s))->dummy2)
-#define _dbus_string_set_byte(s, i, b) ((((unsigned char*)(((DBusString*)(s))->dummy1))[(i)]) = (unsigned char) (b))
-#define _dbus_string_get_byte(s, i) (((const unsigned char*)(((DBusString*)(s))->dummy1))[(i)])
-#define _dbus_string_get_const_data(s) ((const char*)(((DBusString*)(s))->dummy1))
-#define _dbus_string_get_const_data_len(s,start,len) (((const char*)(((DBusString*)(s))->dummy1)) + (start))
-#endif
-
-dbus_bool_t _dbus_string_init (DBusString *str);
-void _dbus_string_init_const (DBusString *str,
- const char *value);
-void _dbus_string_init_const_len (DBusString *str,
- const char *value,
- int len);
-dbus_bool_t _dbus_string_init_preallocated (DBusString *str,
- int allocate_size);
-void _dbus_string_free (DBusString *str);
-void _dbus_string_lock (DBusString *str);
-dbus_bool_t _dbus_string_compact (DBusString *str,
- int max_waste);
-#ifndef _dbus_string_get_data
-char* _dbus_string_get_data (DBusString *str);
-#endif /* _dbus_string_get_data */
-#ifndef _dbus_string_get_const_data
-const char* _dbus_string_get_const_data (const DBusString *str);
-#endif /* _dbus_string_get_const_data */
-char* _dbus_string_get_data_len (DBusString *str,
- int start,
- int len);
-#ifndef _dbus_string_get_const_data_len
-const char* _dbus_string_get_const_data_len (const DBusString *str,
- int start,
- int len);
-#endif
-#ifndef _dbus_string_set_byte
-void _dbus_string_set_byte (DBusString *str,
- int i,
- unsigned char byte);
-#endif
-#ifndef _dbus_string_get_byte
-unsigned char _dbus_string_get_byte (const DBusString *str,
- int start);
-#endif /* _dbus_string_get_byte */
-dbus_bool_t _dbus_string_insert_bytes (DBusString *str,
- int i,
- int n_bytes,
- unsigned char byte);
-dbus_bool_t _dbus_string_insert_byte (DBusString *str,
- int i,
- unsigned char byte);
-dbus_bool_t _dbus_string_steal_data (DBusString *str,
- char **data_return);
-dbus_bool_t _dbus_string_steal_data_len (DBusString *str,
- char **data_return,
- int start,
- int len);
-dbus_bool_t _dbus_string_copy_data (const DBusString *str,
- char **data_return);
-dbus_bool_t _dbus_string_copy_data_len (const DBusString *str,
- char **data_return,
- int start,
- int len);
-void _dbus_string_copy_to_buffer (const DBusString *str,
- char *buffer,
- int len);
-void _dbus_string_copy_to_buffer_with_nul (const DBusString *str,
- char *buffer,
- int avail_len);
-#ifndef _dbus_string_get_length
-int _dbus_string_get_length (const DBusString *str);
-#endif /* !_dbus_string_get_length */
-
-dbus_bool_t _dbus_string_lengthen (DBusString *str,
- int additional_length);
-void _dbus_string_shorten (DBusString *str,
- int length_to_remove);
-dbus_bool_t _dbus_string_set_length (DBusString *str,
- int length);
-dbus_bool_t _dbus_string_align_length (DBusString *str,
- int alignment);
-dbus_bool_t _dbus_string_alloc_space (DBusString *str,
- int extra_bytes);
-dbus_bool_t _dbus_string_append (DBusString *str,
- const char *buffer);
-dbus_bool_t _dbus_string_append_len (DBusString *str,
- const char *buffer,
- int len);
-dbus_bool_t _dbus_string_append_int (DBusString *str,
- long value);
-dbus_bool_t _dbus_string_append_uint (DBusString *str,
- unsigned long value);
-dbus_bool_t _dbus_string_append_byte (DBusString *str,
- unsigned char byte);
-dbus_bool_t _dbus_string_append_printf (DBusString *str,
- const char *format,
- ...) _DBUS_GNUC_PRINTF (2, 3);
-dbus_bool_t _dbus_string_append_printf_valist (DBusString *str,
- const char *format,
- va_list args);
-dbus_bool_t _dbus_string_insert_2_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[2]);
-dbus_bool_t _dbus_string_insert_4_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[4]);
-dbus_bool_t _dbus_string_insert_8_aligned (DBusString *str,
- int insert_at,
- const unsigned char octets[8]);
-dbus_bool_t _dbus_string_insert_alignment (DBusString *str,
- int *insert_at,
- int alignment);
-void _dbus_string_delete (DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_string_move (DBusString *source,
- int start,
- DBusString *dest,
- int insert_at);
-dbus_bool_t _dbus_string_copy (const DBusString *source,
- int start,
- DBusString *dest,
- int insert_at);
-dbus_bool_t _dbus_string_move_len (DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int insert_at);
-dbus_bool_t _dbus_string_copy_len (const DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int insert_at);
-dbus_bool_t _dbus_string_replace_len (const DBusString *source,
- int start,
- int len,
- DBusString *dest,
- int replace_at,
- int replace_len);
-dbus_bool_t _dbus_string_split_on_byte (DBusString *source,
- unsigned char byte,
- DBusString *tail);
-dbus_bool_t _dbus_string_parse_int (const DBusString *str,
- int start,
- long *value_return,
- int *end_return);
-dbus_bool_t _dbus_string_parse_uint (const DBusString *str,
- int start,
- unsigned long *value_return,
- int *end_return);
-dbus_bool_t _dbus_string_find (const DBusString *str,
- int start,
- const char *substr,
- int *found);
-dbus_bool_t _dbus_string_find_eol (const DBusString *str,
- int start,
- int *found,
- int *found_len);
-dbus_bool_t _dbus_string_find_to (const DBusString *str,
- int start,
- int end,
- const char *substr,
- int *found);
-dbus_bool_t _dbus_string_find_byte_backward (const DBusString *str,
- int start,
- unsigned char byte,
- int *found);
-dbus_bool_t _dbus_string_find_blank (const DBusString *str,
- int start,
- int *found);
-void _dbus_string_skip_blank (const DBusString *str,
- int start,
- int *end);
-void _dbus_string_skip_white (const DBusString *str,
- int start,
- int *end);
-void _dbus_string_skip_white_reverse (const DBusString *str,
- int end,
- int *start);
-dbus_bool_t _dbus_string_equal (const DBusString *a,
- const DBusString *b);
-dbus_bool_t _dbus_string_equal_c_str (const DBusString *a,
- const char *c_str);
-dbus_bool_t _dbus_string_equal_len (const DBusString *a,
- const DBusString *b,
- int len);
-dbus_bool_t _dbus_string_equal_substring (const DBusString *a,
- int a_start,
- int a_len,
- const DBusString *b,
- int b_start);
-dbus_bool_t _dbus_string_starts_with_c_str (const DBusString *a,
- const char *c_str);
-dbus_bool_t _dbus_string_ends_with_c_str (const DBusString *a,
- const char *c_str);
-dbus_bool_t _dbus_string_pop_line (DBusString *source,
- DBusString *dest);
-void _dbus_string_delete_first_word (DBusString *str);
-void _dbus_string_delete_leading_blanks (DBusString *str);
-void _dbus_string_chop_white (DBusString *str);
-dbus_bool_t _dbus_string_append_byte_as_hex (DBusString *str,
- unsigned char byte);
-dbus_bool_t _dbus_string_hex_encode (const DBusString *source,
- int start,
- DBusString *dest,
- int insert_at);
-dbus_bool_t _dbus_string_hex_decode (const DBusString *source,
- int start,
- int *end_return,
- DBusString *dest,
- int insert_at);
-void _dbus_string_tolower_ascii (const DBusString *str,
- int start,
- int len);
-void _dbus_string_toupper_ascii (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_string_validate_ascii (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_string_validate_utf8 (const DBusString *str,
- int start,
- int len);
-dbus_bool_t _dbus_string_validate_nul (const DBusString *str,
- int start,
- int len);
-void _dbus_string_zero (DBusString *str);
-
-
-/**
- * We allocate 1 byte for nul termination, plus 7 bytes for possible
- * align_offset, so we always need 8 bytes on top of the string's
- * length to be in the allocated block.
- */
-#define _DBUS_STRING_ALLOCATION_PADDING 8
-
-/**
- * Defines a static const variable with type #DBusString called "name"
- * containing the given string literal.
- *
- * @param name the name of the variable
- * @param str the string value
- */
-#define _DBUS_STRING_DEFINE_STATIC(name, str) \
- static const char _dbus_static_string_##name[] = str; \
- static const DBusString name = { _dbus_static_string_##name, \
- sizeof(_dbus_static_string_##name), \
- sizeof(_dbus_static_string_##name) + \
- _DBUS_STRING_ALLOCATION_PADDING, \
- TRUE, TRUE, FALSE, 0 }
-
-DBUS_END_DECLS
-
-#endif /* DBUS_STRING_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.c
deleted file mode 100644
index 7ef659cbc0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-syntax.c - utility functions for strings with special syntax
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-syntax.h"
-
-#include "dbus-internals.h"
-#include "dbus-marshal-validate.h"
-#include "dbus-shared.h"
-
-/**
- * @defgroup DBusSyntax Utility functions for strings with special syntax
- * @ingroup DBus
- * @brief Parsing D-Bus type signatures
- * @{
- */
-
-/**
- * Check an object path for validity. Remember that #NULL can always
- * be passed instead of a DBusError *, if you don't care about having
- * an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param path a potentially invalid object path, which must not be #NULL
- * @param error error return
- * @returns #TRUE if path is valid
- */
-dbus_bool_t
-dbus_validate_path (const char *path,
- DBusError *error)
-{
- DBusString str;
- int len;
-
- _dbus_return_val_if_fail (path != NULL, FALSE);
-
- _dbus_string_init_const (&str, path);
- len = _dbus_string_get_length (&str);
-
- /* In general, it ought to be valid... */
- if (_DBUS_LIKELY (_dbus_validate_path (&str, 0, len)))
- return TRUE;
-
- /* slow path: string is invalid, find out why */
-
- if (!_dbus_string_validate_utf8 (&str, 0, len))
- {
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Object path was not valid UTF-8");
- return FALSE;
- }
-
- /* FIXME: later, diagnose exactly how it was invalid */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Object path was not valid: '%s'", path);
- return FALSE;
-}
-
-/**
- * Check an interface name for validity. Remember that #NULL can always
- * be passed instead of a DBusError *, if you don't care about having
- * an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param name a potentially invalid interface name, which must not be #NULL
- * @param error error return
- * @returns #TRUE if name is valid
- */
-dbus_bool_t
-dbus_validate_interface (const char *name,
- DBusError *error)
-{
- DBusString str;
- int len;
-
- _dbus_return_val_if_fail (name != NULL, FALSE);
-
- _dbus_string_init_const (&str, name);
- len = _dbus_string_get_length (&str);
-
- /* In general, it ought to be valid... */
- if (_DBUS_LIKELY (_dbus_validate_interface (&str, 0, len)))
- return TRUE;
-
- /* slow path: string is invalid, find out why */
-
- if (!_dbus_string_validate_utf8 (&str, 0, len))
- {
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Interface name was not valid UTF-8");
- return FALSE;
- }
-
- /* FIXME: later, diagnose exactly how it was invalid */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Interface name was not valid: '%s'", name);
- return FALSE;
-}
-
-/**
- * Check a member (method/signal) name for validity. Remember that #NULL
- * can always be passed instead of a DBusError *, if you don't care about
- * having an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param name a potentially invalid member name, which must not be #NULL
- * @param error error return
- * @returns #TRUE if name is valid
- */
-dbus_bool_t
-dbus_validate_member (const char *name,
- DBusError *error)
-{
- DBusString str;
- int len;
-
- _dbus_return_val_if_fail (name != NULL, FALSE);
-
- _dbus_string_init_const (&str, name);
- len = _dbus_string_get_length (&str);
-
- /* In general, it ought to be valid... */
- if (_DBUS_LIKELY (_dbus_validate_member (&str, 0, len)))
- return TRUE;
-
- /* slow path: string is invalid, find out why */
-
- if (!_dbus_string_validate_utf8 (&str, 0, len))
- {
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Member name was not valid UTF-8");
- return FALSE;
- }
-
- /* FIXME: later, diagnose exactly how it was invalid */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Member name was not valid: '%s'", name);
- return FALSE;
-}
-
-/**
- * Check an error name for validity. Remember that #NULL
- * can always be passed instead of a DBusError *, if you don't care about
- * having an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param name a potentially invalid error name, which must not be #NULL
- * @param error error return
- * @returns #TRUE if name is valid
- */
-dbus_bool_t
-dbus_validate_error_name (const char *name,
- DBusError *error)
-{
- DBusString str;
- int len;
-
- _dbus_return_val_if_fail (name != NULL, FALSE);
-
- _dbus_string_init_const (&str, name);
- len = _dbus_string_get_length (&str);
-
- /* In general, it ought to be valid... */
- if (_DBUS_LIKELY (_dbus_validate_error_name (&str, 0, len)))
- return TRUE;
-
- /* slow path: string is invalid, find out why */
-
- if (!_dbus_string_validate_utf8 (&str, 0, len))
- {
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Error name was not valid UTF-8");
- return FALSE;
- }
-
- /* FIXME: later, diagnose exactly how it was invalid */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Error name was not valid: '%s'", name);
- return FALSE;
-}
-
-/**
- * Check a bus name for validity. Remember that #NULL
- * can always be passed instead of a DBusError *, if you don't care about
- * having an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param name a potentially invalid bus name, which must not be #NULL
- * @param error error return
- * @returns #TRUE if name is valid
- */
-dbus_bool_t
-dbus_validate_bus_name (const char *name,
- DBusError *error)
-{
- DBusString str;
- int len;
-
- _dbus_return_val_if_fail (name != NULL, FALSE);
-
- _dbus_string_init_const (&str, name);
- len = _dbus_string_get_length (&str);
-
- /* In general, it ought to be valid... */
- if (_DBUS_LIKELY (_dbus_validate_bus_name (&str, 0, len)))
- return TRUE;
-
- /* slow path: string is invalid, find out why */
-
- if (!_dbus_string_validate_utf8 (&str, 0, len))
- {
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Bus name was not valid UTF-8");
- return FALSE;
- }
-
- /* FIXME: later, diagnose exactly how it was invalid */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "Bus name was not valid: '%s'", name);
- return FALSE;
-}
-
-/**
- * Check a string for validity. Strings on D-Bus must be valid UTF-8.
- * Remember that #NULL can always be passed instead of a DBusError *,
- * if you don't care about having an error name and message.
- *
- * This function is suitable for validating C strings, but is not suitable
- * for validating untrusted data from a network unless the string's length
- * is also checked, since it assumes that the string ends at the first zero
- * byte according to normal C conventions.
- *
- * @param alleged_utf8 a string to be checked, which must not be #NULL
- * @param error error return
- * @returns #TRUE if alleged_utf8 is valid UTF-8
- */
-dbus_bool_t
-dbus_validate_utf8 (const char *alleged_utf8,
- DBusError *error)
-{
- DBusString str;
-
- _dbus_return_val_if_fail (alleged_utf8 != NULL, FALSE);
-
- _dbus_string_init_const (&str, alleged_utf8);
-
- if (_DBUS_LIKELY (_dbus_string_validate_utf8 (&str, 0,
- _dbus_string_get_length (&str))))
- return TRUE;
-
- /* don't quote the actual string here, since a DBusError also needs to
- * be valid UTF-8 */
- dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
- "String was not valid UTF-8");
- return FALSE;
-}
-
-/** @} */ /* end of group */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.h
deleted file mode 100644
index daf20f06e1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-syntax.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-syntax.h - utility functions for strings with special syntax
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_SYNTAX_H
-#define DBUS_SYNTAX_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-DBUS_EXPORT
-dbus_bool_t dbus_validate_path (const char *path,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_validate_interface (const char *name,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_validate_member (const char *name,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_validate_error_name (const char *name,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_validate_bus_name (const char *name,
- DBusError *error);
-DBUS_EXPORT
-dbus_bool_t dbus_validate_utf8 (const char *alleged_utf8,
- DBusError *error);
-
-DBUS_END_DECLS
-
-#endif /* multiple-inclusion guard */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-pthread.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-pthread.c
deleted file mode 100644
index 1300ec3516..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-pthread.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-pthread.c Implements threads using pthreads (internal to libdbus)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-threads.h"
-
-#include <sys/time.h>
-#include <pthread.h>
-#include <string.h>
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include <config.h>
-
-#ifdef HAVE_MONOTONIC_CLOCK
-/* Whether we have a "monotonic" clock; i.e. a clock not affected by
- * changes in system time.
- * This is initialized once in check_monotonic_clock below.
- * https://bugs.freedesktop.org/show_bug.cgi?id=18121
- */
-static dbus_bool_t have_monotonic_clock = 0;
-#endif
-
-struct DBusRMutex {
- pthread_mutex_t lock; /**< the lock */
-};
-
-struct DBusCMutex {
- pthread_mutex_t lock; /**< the lock */
-};
-
-struct DBusCondVar {
- pthread_cond_t cond; /**< the condition */
-};
-
-#define DBUS_MUTEX(m) ((DBusMutex*) m)
-#define DBUS_MUTEX_PTHREAD(m) ((DBusMutexPThread*) m)
-
-#define DBUS_COND_VAR(c) ((DBusCondVar*) c)
-#define DBUS_COND_VAR_PTHREAD(c) ((DBusCondVarPThread*) c)
-
-
-#ifdef DBUS_DISABLE_ASSERT
-/* (tmp != 0) is a no-op usage to silence compiler */
-#define PTHREAD_CHECK(func_name, result_or_call) \
- do { int tmp = (result_or_call); if (tmp != 0) {;} } while (0)
-#else
-#define PTHREAD_CHECK(func_name, result_or_call) do { \
- int tmp = (result_or_call); \
- if (tmp != 0) { \
- _dbus_warn_check_failed ("pthread function %s failed with %d %s in %s\n", \
- func_name, tmp, strerror(tmp), _DBUS_FUNCTION_NAME); \
- } \
-} while (0)
-#endif /* !DBUS_DISABLE_ASSERT */
-
-DBusCMutex *
-_dbus_platform_cmutex_new (void)
-{
- DBusCMutex *pmutex;
- int result;
-
- pmutex = dbus_new (DBusCMutex, 1);
- if (pmutex == NULL)
- return NULL;
-
- result = pthread_mutex_init (&pmutex->lock, NULL);
-
- if (result == ENOMEM || result == EAGAIN)
- {
- dbus_free (pmutex);
- return NULL;
- }
- else
- {
- PTHREAD_CHECK ("pthread_mutex_init", result);
- }
-
- return pmutex;
-}
-
-DBusRMutex *
-_dbus_platform_rmutex_new (void)
-{
- DBusRMutex *pmutex;
- pthread_mutexattr_t mutexattr;
- int result;
-
- pmutex = dbus_new (DBusRMutex, 1);
- if (pmutex == NULL)
- return NULL;
-
- pthread_mutexattr_init (&mutexattr);
- pthread_mutexattr_settype (&mutexattr, PTHREAD_MUTEX_RECURSIVE);
- result = pthread_mutex_init (&pmutex->lock, &mutexattr);
- pthread_mutexattr_destroy (&mutexattr);
-
- if (result == ENOMEM || result == EAGAIN)
- {
- dbus_free (pmutex);
- return NULL;
- }
- else
- {
- PTHREAD_CHECK ("pthread_mutex_init", result);
- }
-
- return pmutex;
-}
-
-void
-_dbus_platform_cmutex_free (DBusCMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_destroy", pthread_mutex_destroy (&mutex->lock));
- dbus_free (mutex);
-}
-
-void
-_dbus_platform_rmutex_free (DBusRMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_destroy", pthread_mutex_destroy (&mutex->lock));
- dbus_free (mutex);
-}
-
-void
-_dbus_platform_cmutex_lock (DBusCMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_lock", pthread_mutex_lock (&mutex->lock));
-}
-
-void
-_dbus_platform_rmutex_lock (DBusRMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_lock", pthread_mutex_lock (&mutex->lock));
-}
-
-void
-_dbus_platform_cmutex_unlock (DBusCMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_unlock", pthread_mutex_unlock (&mutex->lock));
-}
-
-void
-_dbus_platform_rmutex_unlock (DBusRMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_mutex_unlock", pthread_mutex_unlock (&mutex->lock));
-}
-
-DBusCondVar *
-_dbus_platform_condvar_new (void)
-{
- DBusCondVar *pcond;
- pthread_condattr_t attr;
- int result;
-
- pcond = dbus_new (DBusCondVar, 1);
- if (pcond == NULL)
- return NULL;
-
- pthread_condattr_init (&attr);
-#ifdef HAVE_MONOTONIC_CLOCK
- if (have_monotonic_clock)
- pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
-#endif
-
- result = pthread_cond_init (&pcond->cond, &attr);
- pthread_condattr_destroy (&attr);
-
- if (result == EAGAIN || result == ENOMEM)
- {
- dbus_free (pcond);
- return NULL;
- }
- else
- {
- PTHREAD_CHECK ("pthread_cond_init", result);
- }
-
- return pcond;
-}
-
-void
-_dbus_platform_condvar_free (DBusCondVar *cond)
-{
- PTHREAD_CHECK ("pthread_cond_destroy", pthread_cond_destroy (&cond->cond));
- dbus_free (cond);
-}
-
-void
-_dbus_platform_condvar_wait (DBusCondVar *cond,
- DBusCMutex *mutex)
-{
- PTHREAD_CHECK ("pthread_cond_wait", pthread_cond_wait (&cond->cond, &mutex->lock));
-}
-
-dbus_bool_t
-_dbus_platform_condvar_wait_timeout (DBusCondVar *cond,
- DBusCMutex *mutex,
- int timeout_milliseconds)
-{
- struct timeval time_now;
- struct timespec end_time;
- int result;
-
-#ifdef HAVE_MONOTONIC_CLOCK
- if (have_monotonic_clock)
- {
- struct timespec monotonic_timer;
- clock_gettime (CLOCK_MONOTONIC,&monotonic_timer);
- time_now.tv_sec = monotonic_timer.tv_sec;
- time_now.tv_usec = monotonic_timer.tv_nsec / 1000;
- }
- else
- /* This else falls through to gettimeofday */
-#endif
- gettimeofday (&time_now, NULL);
-
- end_time.tv_sec = time_now.tv_sec + timeout_milliseconds / 1000;
- end_time.tv_nsec = (time_now.tv_usec + (timeout_milliseconds % 1000) * 1000) * 1000;
- if (end_time.tv_nsec > 1000*1000*1000)
- {
- end_time.tv_sec += 1;
- end_time.tv_nsec -= 1000*1000*1000;
- }
-
- result = pthread_cond_timedwait (&cond->cond, &mutex->lock, &end_time);
-
- if (result != ETIMEDOUT)
- {
- PTHREAD_CHECK ("pthread_cond_timedwait", result);
- }
-
- /* return true if we did not time out */
- return result != ETIMEDOUT;
-}
-
-void
-_dbus_platform_condvar_wake_one (DBusCondVar *cond)
-{
- PTHREAD_CHECK ("pthread_cond_signal", pthread_cond_signal (&cond->cond));
-}
-
-static void
-check_monotonic_clock (void)
-{
-#ifdef HAVE_MONOTONIC_CLOCK
- struct timespec dummy;
- if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0)
- have_monotonic_clock = TRUE;
-#endif
-}
-
-dbus_bool_t
-_dbus_threads_init_platform_specific (void)
-{
- /* These have static variables, and we need to handle both the case
- * where dbus_threads_init() has been called and when it hasn't;
- * so initialize them before any threads are allowed to enter.
- */
- check_monotonic_clock ();
- (void) _dbus_check_setuid ();
-
- return TRUE;
-}
-
-static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-void
-_dbus_threads_lock_platform_specific (void)
-{
- pthread_mutex_lock (&init_mutex);
-}
-
-void
-_dbus_threads_unlock_platform_specific (void)
-{
- pthread_mutex_unlock (&init_mutex);
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-thread-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-thread-win.c
deleted file mode 100644
index 0887a549e6..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-thread-win.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-pthread.c Implements threads using Windows threads (internal to libdbus)
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-win.h"
-#include "dbus-threads.h"
-#include "dbus-list.h"
-
-#include <windows.h>
-
-static dbus_bool_t global_init_done = FALSE;
-static CRITICAL_SECTION init_lock;
-
-/* Called from C++ code in dbus-init-win.cpp. */
-void
-_dbus_threads_windows_init_global (void)
-{
- /* this ensures that the object that acts as our global constructor
- * actually gets linked in when we're linked statically */
- _dbus_threads_windows_ensure_ctor_linked ();
-
- InitializeCriticalSection (&init_lock);
- global_init_done = TRUE;
-}
-
-struct DBusCondVar {
- DBusList *list; /**< list thread-local-stored events waiting on the cond variable */
- CRITICAL_SECTION lock; /**< lock protecting the list */
-};
-
-static DWORD dbus_cond_event_tls = TLS_OUT_OF_INDEXES;
-
-
-static HMODULE dbus_dll_hmodule;
-
-void *
-_dbus_win_get_dll_hmodule (void)
-{
- return dbus_dll_hmodule;
-}
-
-#ifdef DBUS_WINCE
-#define hinst_t HANDLE
-#else
-#define hinst_t HINSTANCE
-#endif
-
-BOOL WINAPI DllMain (hinst_t, DWORD, LPVOID);
-
-/* We need this to free the TLS events on thread exit */
-BOOL WINAPI
-DllMain (hinst_t hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
-{
- HANDLE event;
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- dbus_dll_hmodule = hinstDLL;
- break;
- case DLL_THREAD_DETACH:
- if (dbus_cond_event_tls != TLS_OUT_OF_INDEXES)
- {
- event = TlsGetValue(dbus_cond_event_tls);
- CloseHandle (event);
- TlsSetValue(dbus_cond_event_tls, NULL);
- }
- break;
- case DLL_PROCESS_DETACH:
- if (dbus_cond_event_tls != TLS_OUT_OF_INDEXES)
- {
- event = TlsGetValue(dbus_cond_event_tls);
- CloseHandle (event);
- TlsSetValue(dbus_cond_event_tls, NULL);
-
- TlsFree(dbus_cond_event_tls);
- }
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-DBusCMutex *
-_dbus_platform_cmutex_new (void)
-{
- HANDLE handle;
- handle = CreateMutex (NULL, FALSE, NULL);
- return (DBusCMutex *) handle;
-}
-
-DBusRMutex *
-_dbus_platform_rmutex_new (void)
-{
- HANDLE handle;
- handle = CreateMutex (NULL, FALSE, NULL);
- return (DBusRMutex *) handle;
-}
-
-void
-_dbus_platform_cmutex_free (DBusCMutex *mutex)
-{
- CloseHandle ((HANDLE *) mutex);
-}
-
-void
-_dbus_platform_rmutex_free (DBusRMutex *mutex)
-{
- CloseHandle ((HANDLE *) mutex);
-}
-
-void
-_dbus_platform_cmutex_lock (DBusCMutex *mutex)
-{
- WaitForSingleObject ((HANDLE *) mutex, INFINITE);
-}
-
-void
-_dbus_platform_rmutex_lock (DBusRMutex *mutex)
-{
- WaitForSingleObject ((HANDLE *) mutex, INFINITE);
-}
-
-void
-_dbus_platform_cmutex_unlock (DBusCMutex *mutex)
-{
- ReleaseMutex ((HANDLE *) mutex);
-}
-
-void
-_dbus_platform_rmutex_unlock (DBusRMutex *mutex)
-{
- ReleaseMutex ((HANDLE *) mutex);
-}
-
-DBusCondVar *
-_dbus_platform_condvar_new (void)
-{
- DBusCondVar *cond;
-
- cond = dbus_new (DBusCondVar, 1);
- if (cond == NULL)
- return NULL;
-
- cond->list = NULL;
-
- InitializeCriticalSection (&cond->lock);
- return cond;
-}
-
-void
-_dbus_platform_condvar_free (DBusCondVar *cond)
-{
- DeleteCriticalSection (&cond->lock);
- _dbus_list_clear (&cond->list);
- dbus_free (cond);
-}
-
-static dbus_bool_t
-_dbus_condvar_wait_win32 (DBusCondVar *cond,
- DBusCMutex *mutex,
- int milliseconds)
-{
- DWORD retval;
- dbus_bool_t ret;
- HANDLE event = TlsGetValue (dbus_cond_event_tls);
-
- if (!event)
- {
- event = CreateEvent (0, FALSE, FALSE, NULL);
- if (event == 0)
- return FALSE;
- TlsSetValue (dbus_cond_event_tls, event);
- }
-
- EnterCriticalSection (&cond->lock);
-
- /* The event must not be signaled. Check this */
- _dbus_assert (WaitForSingleObject (event, 0) == WAIT_TIMEOUT);
-
- ret = _dbus_list_append (&cond->list, event);
-
- LeaveCriticalSection (&cond->lock);
-
- if (!ret)
- return FALSE; /* Prepend failed */
-
- _dbus_platform_cmutex_unlock (mutex);
- retval = WaitForSingleObject (event, milliseconds);
- _dbus_platform_cmutex_lock (mutex);
-
- if (retval == WAIT_TIMEOUT)
- {
- EnterCriticalSection (&cond->lock);
- _dbus_list_remove (&cond->list, event);
-
- /* In the meantime we could have been signaled, so we must again
- * wait for the signal, this time with no timeout, to reset
- * it. retval is set again to honour the late arrival of the
- * signal */
- retval = WaitForSingleObject (event, 0);
-
- LeaveCriticalSection (&cond->lock);
- }
-
-#ifndef DBUS_DISABLE_ASSERT
- EnterCriticalSection (&cond->lock);
-
- /* Now event must not be inside the array, check this */
- _dbus_assert (_dbus_list_remove (&cond->list, event) == FALSE);
-
- LeaveCriticalSection (&cond->lock);
-#endif /* !G_DISABLE_ASSERT */
-
- return retval != WAIT_TIMEOUT;
-}
-
-void
-_dbus_platform_condvar_wait (DBusCondVar *cond,
- DBusCMutex *mutex)
-{
- _dbus_condvar_wait_win32 (cond, mutex, INFINITE);
-}
-
-dbus_bool_t
-_dbus_platform_condvar_wait_timeout (DBusCondVar *cond,
- DBusCMutex *mutex,
- int timeout_milliseconds)
-{
- return _dbus_condvar_wait_win32 (cond, mutex, timeout_milliseconds);
-}
-
-void
-_dbus_platform_condvar_wake_one (DBusCondVar *cond)
-{
- EnterCriticalSection (&cond->lock);
-
- if (cond->list != NULL)
- {
- SetEvent (_dbus_list_pop_first (&cond->list));
- /* Avoid live lock by pushing the waiter to the mutex lock
- instruction, which is fair. If we don't do this, we could
- acquire the condition variable again before the waiter has a
- chance itself, leading to starvation. */
- Sleep (0);
- }
- LeaveCriticalSection (&cond->lock);
-}
-
-dbus_bool_t
-_dbus_threads_init_platform_specific (void)
-{
- /* We reuse this over several generations, because we can't
- * free the events once they are in use
- */
- if (dbus_cond_event_tls == TLS_OUT_OF_INDEXES)
- {
- dbus_cond_event_tls = TlsAlloc ();
- if (dbus_cond_event_tls == TLS_OUT_OF_INDEXES)
- return FALSE;
- }
-
- return TRUE;
-}
-
-void
-_dbus_threads_lock_platform_specific (void)
-{
- _dbus_assert (global_init_done);
- EnterCriticalSection (&init_lock);
-}
-
-void
-_dbus_threads_unlock_platform_specific (void)
-{
- _dbus_assert (global_init_done);
- LeaveCriticalSection (&init_lock);
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.c
deleted file mode 100644
index 07080045fa..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.c
+++ /dev/null
@@ -1,4099 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-unix.c Wrappers around UNIX system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-unix.h"
-#include "dbus-threads.h"
-#include "dbus-protocol.h"
-#include "dbus-transport.h"
-#include "dbus-string.h"
-#include "dbus-userdb.h"
-#include "dbus-list.h"
-#include "dbus-credentials.h"
-#include "dbus-nonce.h"
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <dirent.h>
-#include <sys/un.h>
-#include <pwd.h>
-#include <time.h>
-#include <locale.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <grp.h>
-#include <arpa/inet.h>
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_WRITEV
-#include <sys/uio.h>
-#endif
-#ifdef HAVE_POLL
-#include <sys/poll.h>
-#endif
-#ifdef HAVE_BACKTRACE
-#include <execinfo.h>
-#endif
-#ifdef HAVE_GETPEERUCRED
-#include <ucred.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#ifdef HAVE_ADT
-#include <bsm/adt.h>
-#endif
-
-#include "sd-daemon.h"
-
-#if !DBUS_USE_SYNC
-#include <pthread.h>
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-#ifndef AI_ADDRCONFIG
-#define AI_ADDRCONFIG 0
-#endif
-
-#ifndef HAVE_SOCKLEN_T
-#define socklen_t int
-#endif
-
-#if defined (__sun) || defined (__sun__)
-/*
- * CMS_SPACE etc. definitions for Solaris < 10, based on
- * http://mailman.videolan.org/pipermail/vlc-devel/2006-May/024402.html
- * via
- * http://wiki.opencsw.org/porting-faq#toc10
- *
- * These are only redefined for Solaris, for now: if your OS needs these too,
- * please file a bug. (Or preferably, improve your OS so they're not needed.)
- */
-
-# ifndef CMSG_ALIGN
-# ifdef __sun__
-# define CMSG_ALIGN(len) _CMSG_DATA_ALIGN (len)
-# else
- /* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */
-# define CMSG_ALIGN(len) (((len) + sizeof (long) - 1) & \
- ~(sizeof (long) - 1))
-# endif
-# endif
-
-# ifndef CMSG_SPACE
-# define CMSG_SPACE(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + \
- CMSG_ALIGN (len))
-# endif
-
-# ifndef CMSG_LEN
-# define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-# endif
-
-#endif /* Solaris */
-
-static dbus_bool_t
-_dbus_open_socket (int *fd_p,
- int domain,
- int type,
- int protocol,
- DBusError *error)
-{
-#ifdef SOCK_CLOEXEC
- dbus_bool_t cloexec_done;
-
- *fd_p = socket (domain, type | SOCK_CLOEXEC, protocol);
- cloexec_done = *fd_p >= 0;
-
- /* Check if kernel seems to be too old to know SOCK_CLOEXEC */
- if (*fd_p < 0 && (errno == EINVAL || errno == EPROTOTYPE))
-#endif
- {
- *fd_p = socket (domain, type, protocol);
- }
-
- if (*fd_p >= 0)
- {
-#ifdef SOCK_CLOEXEC
- if (!cloexec_done)
-#endif
- {
- _dbus_fd_set_close_on_exec(*fd_p);
- }
-
- _dbus_verbose ("socket fd %d opened\n", *fd_p);
- return TRUE;
- }
- else
- {
- dbus_set_error(error,
- _dbus_error_from_errno (errno),
- "Failed to open socket: %s",
- _dbus_strerror (errno));
- return FALSE;
- }
-}
-
-/**
- * Opens a UNIX domain socket (as in the socket() call).
- * Does not bind the socket.
- *
- * This will set FD_CLOEXEC for the socket returned
- *
- * @param fd return location for socket descriptor
- * @param error return location for an error
- * @returns #FALSE if error is set
- */
-static dbus_bool_t
-_dbus_open_unix_socket (int *fd,
- DBusError *error)
-{
- return _dbus_open_socket(fd, PF_UNIX, SOCK_STREAM, 0, error);
-}
-
-/**
- * Closes a socket. Should not be used on non-socket
- * file descriptors or handles.
- *
- * @param fd the socket
- * @param error return location for an error
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_close_socket (int fd,
- DBusError *error)
-{
- return _dbus_close (fd, error);
-}
-
-/**
- * Like _dbus_read(), but only works on sockets so is
- * available on Windows.
- *
- * @param fd the socket
- * @param buffer string to append data to
- * @param count max amount of data to read
- * @returns number of bytes appended to the string
- */
-int
-_dbus_read_socket (int fd,
- DBusString *buffer,
- int count)
-{
- return _dbus_read (fd, buffer, count);
-}
-
-/**
- * Like _dbus_write(), but only supports sockets
- * and is thus available on Windows.
- *
- * @param fd the file descriptor to write
- * @param buffer the buffer to write data from
- * @param start the first byte in the buffer to write
- * @param len the number of bytes to try to write
- * @returns the number of bytes written or -1 on error
- */
-int
-_dbus_write_socket (int fd,
- const DBusString *buffer,
- int start,
- int len)
-{
-#if HAVE_DECL_MSG_NOSIGNAL
- const char *data;
- int bytes_written;
-
- data = _dbus_string_get_const_data_len (buffer, start, len);
-
- again:
-
- bytes_written = send (fd, data, len, MSG_NOSIGNAL);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- return bytes_written;
-
-#else
- return _dbus_write (fd, buffer, start, len);
-#endif
-}
-
-/**
- * Like _dbus_read_socket() but also tries to read unix fds from the
- * socket. When there are more fds to read than space in the array
- * passed this function will fail with ENOSPC.
- *
- * @param fd the socket
- * @param buffer string to append data to
- * @param count max amount of data to read
- * @param fds array to place read file descriptors in
- * @param n_fds on input space in fds array, on output how many fds actually got read
- * @returns number of bytes appended to string
- */
-int
-_dbus_read_socket_with_unix_fds (int fd,
- DBusString *buffer,
- int count,
- int *fds,
- int *n_fds) {
-#ifndef HAVE_UNIX_FD_PASSING
- int r;
-
- if ((r = _dbus_read_socket(fd, buffer, count)) < 0)
- return r;
-
- *n_fds = 0;
- return r;
-
-#else
- int bytes_read;
- int start;
- struct msghdr m;
- struct iovec iov;
-
- _dbus_assert (count >= 0);
- _dbus_assert (*n_fds >= 0);
-
- start = _dbus_string_get_length (buffer);
-
- if (!_dbus_string_lengthen (buffer, count))
- {
- errno = ENOMEM;
- return -1;
- }
-
- _DBUS_ZERO(iov);
- iov.iov_base = _dbus_string_get_data_len (buffer, start, count);
- iov.iov_len = count;
-
- _DBUS_ZERO(m);
- m.msg_iov = &iov;
- m.msg_iovlen = 1;
-
- /* Hmm, we have no clue how long the control data will actually be
- that is queued for us. The least we can do is assume that the
- caller knows. Hence let's make space for the number of fds that
- we shall read at max plus the cmsg header. */
- m.msg_controllen = CMSG_SPACE(*n_fds * sizeof(int));
-
- /* It's probably safe to assume that systems with SCM_RIGHTS also
- know alloca() */
- m.msg_control = alloca(m.msg_controllen);
- memset(m.msg_control, 0, m.msg_controllen);
-
- again:
-
- bytes_read = recvmsg(fd, &m, 0
-#ifdef MSG_CMSG_CLOEXEC
- |MSG_CMSG_CLOEXEC
-#endif
- );
-
- if (bytes_read < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- /* put length back (note that this doesn't actually realloc anything) */
- _dbus_string_set_length (buffer, start);
- return -1;
- }
- }
- else
- {
- struct cmsghdr *cm;
- dbus_bool_t found = FALSE;
-
- if (m.msg_flags & MSG_CTRUNC)
- {
- /* Hmm, apparently the control data was truncated. The bad
- thing is that we might have completely lost a couple of fds
- without chance to recover them. Hence let's treat this as a
- serious error. */
-
- errno = ENOSPC;
- _dbus_string_set_length (buffer, start);
- return -1;
- }
-
- for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
- if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
- {
- unsigned i;
-
- _dbus_assert(cm->cmsg_len <= CMSG_LEN(*n_fds * sizeof(int)));
- *n_fds = (cm->cmsg_len - CMSG_LEN(0)) / sizeof(int);
-
- memcpy(fds, CMSG_DATA(cm), *n_fds * sizeof(int));
- found = TRUE;
-
- /* Linux doesn't tell us whether MSG_CMSG_CLOEXEC actually
- worked, hence we need to go through this list and set
- CLOEXEC everywhere in any case */
- for (i = 0; i < *n_fds; i++)
- _dbus_fd_set_close_on_exec(fds[i]);
-
- break;
- }
-
- if (!found)
- *n_fds = 0;
-
- /* put length back (doesn't actually realloc) */
- _dbus_string_set_length (buffer, start + bytes_read);
-
-#if 0
- if (bytes_read > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_read);
-#endif
-
- return bytes_read;
- }
-#endif
-}
-
-int
-_dbus_write_socket_with_unix_fds(int fd,
- const DBusString *buffer,
- int start,
- int len,
- const int *fds,
- int n_fds) {
-
-#ifndef HAVE_UNIX_FD_PASSING
-
- if (n_fds > 0) {
- errno = ENOTSUP;
- return -1;
- }
-
- return _dbus_write_socket(fd, buffer, start, len);
-#else
- return _dbus_write_socket_with_unix_fds_two(fd, buffer, start, len, NULL, 0, 0, fds, n_fds);
-#endif
-}
-
-int
-_dbus_write_socket_with_unix_fds_two(int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2,
- const int *fds,
- int n_fds) {
-
-#ifndef HAVE_UNIX_FD_PASSING
-
- if (n_fds > 0) {
- errno = ENOTSUP;
- return -1;
- }
-
- return _dbus_write_socket_two(fd,
- buffer1, start1, len1,
- buffer2, start2, len2);
-#else
-
- struct msghdr m;
- struct cmsghdr *cm;
- struct iovec iov[2];
- int bytes_written;
-
- _dbus_assert (len1 >= 0);
- _dbus_assert (len2 >= 0);
- _dbus_assert (n_fds >= 0);
-
- _DBUS_ZERO(iov);
- iov[0].iov_base = (char*) _dbus_string_get_const_data_len (buffer1, start1, len1);
- iov[0].iov_len = len1;
-
- if (buffer2)
- {
- iov[1].iov_base = (char*) _dbus_string_get_const_data_len (buffer2, start2, len2);
- iov[1].iov_len = len2;
- }
-
- _DBUS_ZERO(m);
- m.msg_iov = iov;
- m.msg_iovlen = buffer2 ? 2 : 1;
-
- if (n_fds > 0)
- {
- m.msg_controllen = CMSG_SPACE(n_fds * sizeof(int));
- m.msg_control = alloca(m.msg_controllen);
- memset(m.msg_control, 0, m.msg_controllen);
-
- cm = CMSG_FIRSTHDR(&m);
- cm->cmsg_level = SOL_SOCKET;
- cm->cmsg_type = SCM_RIGHTS;
- cm->cmsg_len = CMSG_LEN(n_fds * sizeof(int));
- memcpy(CMSG_DATA(cm), fds, n_fds * sizeof(int));
- }
-
- again:
-
- bytes_written = sendmsg (fd, &m, 0
-#if HAVE_DECL_MSG_NOSIGNAL
- |MSG_NOSIGNAL
-#endif
- );
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
-#if 0
- if (bytes_written > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_written);
-#endif
-
- return bytes_written;
-#endif
-}
-
-/**
- * Like _dbus_write_two() but only works on sockets and is thus
- * available on Windows.
- *
- * @param fd the file descriptor
- * @param buffer1 first buffer
- * @param start1 first byte to write in first buffer
- * @param len1 number of bytes to write from first buffer
- * @param buffer2 second buffer, or #NULL
- * @param start2 first byte to write in second buffer
- * @param len2 number of bytes to write in second buffer
- * @returns total bytes written from both buffers, or -1 on error
- */
-int
-_dbus_write_socket_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2)
-{
-#if HAVE_DECL_MSG_NOSIGNAL
- struct iovec vectors[2];
- const char *data1;
- const char *data2;
- int bytes_written;
- struct msghdr m;
-
- _dbus_assert (buffer1 != NULL);
- _dbus_assert (start1 >= 0);
- _dbus_assert (start2 >= 0);
- _dbus_assert (len1 >= 0);
- _dbus_assert (len2 >= 0);
-
- data1 = _dbus_string_get_const_data_len (buffer1, start1, len1);
-
- if (buffer2 != NULL)
- data2 = _dbus_string_get_const_data_len (buffer2, start2, len2);
- else
- {
- data2 = NULL;
- start2 = 0;
- len2 = 0;
- }
-
- vectors[0].iov_base = (char*) data1;
- vectors[0].iov_len = len1;
- vectors[1].iov_base = (char*) data2;
- vectors[1].iov_len = len2;
-
- _DBUS_ZERO(m);
- m.msg_iov = vectors;
- m.msg_iovlen = data2 ? 2 : 1;
-
- again:
-
- bytes_written = sendmsg (fd, &m, MSG_NOSIGNAL);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- return bytes_written;
-
-#else
- return _dbus_write_two (fd, buffer1, start1, len1,
- buffer2, start2, len2);
-#endif
-}
-
-dbus_bool_t
-_dbus_socket_is_invalid (int fd)
-{
- return fd < 0 ? TRUE : FALSE;
-}
-
-/**
- * Thin wrapper around the read() system call that appends
- * the data it reads to the DBusString buffer. It appends
- * up to the given count, and returns the same value
- * and same errno as read(). The only exception is that
- * _dbus_read() handles EINTR for you. Also, _dbus_read() can
- * return ENOMEM, even though regular UNIX read doesn't.
- *
- * Unlike _dbus_read_socket(), _dbus_read() is not available
- * on Windows.
- *
- * @param fd the file descriptor to read from
- * @param buffer the buffer to append data to
- * @param count the amount of data to read
- * @returns the number of bytes read or -1
- */
-int
-_dbus_read (int fd,
- DBusString *buffer,
- int count)
-{
- int bytes_read;
- int start;
- char *data;
-
- _dbus_assert (count >= 0);
-
- start = _dbus_string_get_length (buffer);
-
- if (!_dbus_string_lengthen (buffer, count))
- {
- errno = ENOMEM;
- return -1;
- }
-
- data = _dbus_string_get_data_len (buffer, start, count);
-
- again:
-
- bytes_read = read (fd, data, count);
-
- if (bytes_read < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- /* put length back (note that this doesn't actually realloc anything) */
- _dbus_string_set_length (buffer, start);
- return -1;
- }
- }
- else
- {
- /* put length back (doesn't actually realloc) */
- _dbus_string_set_length (buffer, start + bytes_read);
-
-#if 0
- if (bytes_read > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_read);
-#endif
-
- return bytes_read;
- }
-}
-
-/**
- * Thin wrapper around the write() system call that writes a part of a
- * DBusString and handles EINTR for you.
- *
- * @param fd the file descriptor to write
- * @param buffer the buffer to write data from
- * @param start the first byte in the buffer to write
- * @param len the number of bytes to try to write
- * @returns the number of bytes written or -1 on error
- */
-int
-_dbus_write (int fd,
- const DBusString *buffer,
- int start,
- int len)
-{
- const char *data;
- int bytes_written;
-
- data = _dbus_string_get_const_data_len (buffer, start, len);
-
- again:
-
- bytes_written = write (fd, data, len);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
-#if 0
- if (bytes_written > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_written);
-#endif
-
- return bytes_written;
-}
-
-/**
- * Like _dbus_write() but will use writev() if possible
- * to write both buffers in sequence. The return value
- * is the number of bytes written in the first buffer,
- * plus the number written in the second. If the first
- * buffer is written successfully and an error occurs
- * writing the second, the number of bytes in the first
- * is returned (i.e. the error is ignored), on systems that
- * don't have writev. Handles EINTR for you.
- * The second buffer may be #NULL.
- *
- * @param fd the file descriptor
- * @param buffer1 first buffer
- * @param start1 first byte to write in first buffer
- * @param len1 number of bytes to write from first buffer
- * @param buffer2 second buffer, or #NULL
- * @param start2 first byte to write in second buffer
- * @param len2 number of bytes to write in second buffer
- * @returns total bytes written from both buffers, or -1 on error
- */
-int
-_dbus_write_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2)
-{
- _dbus_assert (buffer1 != NULL);
- _dbus_assert (start1 >= 0);
- _dbus_assert (start2 >= 0);
- _dbus_assert (len1 >= 0);
- _dbus_assert (len2 >= 0);
-
-#ifdef HAVE_WRITEV
- {
- struct iovec vectors[2];
- const char *data1;
- const char *data2;
- int bytes_written;
-
- data1 = _dbus_string_get_const_data_len (buffer1, start1, len1);
-
- if (buffer2 != NULL)
- data2 = _dbus_string_get_const_data_len (buffer2, start2, len2);
- else
- {
- data2 = NULL;
- start2 = 0;
- len2 = 0;
- }
-
- vectors[0].iov_base = (char*) data1;
- vectors[0].iov_len = len1;
- vectors[1].iov_base = (char*) data2;
- vectors[1].iov_len = len2;
-
- again:
-
- bytes_written = writev (fd,
- vectors,
- data2 ? 2 : 1);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- return bytes_written;
- }
-#else /* HAVE_WRITEV */
- {
- int ret1, ret2;
-
- ret1 = _dbus_write (fd, buffer1, start1, len1);
- if (ret1 == len1 && buffer2 != NULL)
- {
- ret2 = _dbus_write (fd, buffer2, start2, len2);
- if (ret2 < 0)
- ret2 = 0; /* we can't report an error as the first write was OK */
-
- return ret1 + ret2;
- }
- else
- return ret1;
- }
-#endif /* !HAVE_WRITEV */
-}
-
-#define _DBUS_MAX_SUN_PATH_LENGTH 99
-
-/**
- * @def _DBUS_MAX_SUN_PATH_LENGTH
- *
- * Maximum length of the path to a UNIX domain socket,
- * sockaddr_un::sun_path member. POSIX requires that all systems
- * support at least 100 bytes here, including the nul termination.
- * We use 99 for the max value to allow for the nul.
- *
- * We could probably also do sizeof (addr.sun_path)
- * but this way we are the same on all platforms
- * which is probably a good idea.
- */
-
-/**
- * Creates a socket and connects it to the UNIX domain socket at the
- * given path. The connection fd is returned, and is set up as
- * nonblocking.
- *
- * Uses abstract sockets instead of filesystem-linked sockets if
- * requested (it's possible only on Linux; see "man 7 unix" on Linux).
- * On non-Linux abstract socket usage always fails.
- *
- * This will set FD_CLOEXEC for the socket returned.
- *
- * @param path the path to UNIX domain socket
- * @param abstract #TRUE to use abstract namespace
- * @param error return location for error code
- * @returns connection file descriptor or -1 on error
- */
-int
-_dbus_connect_unix_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error)
-{
- int fd;
- size_t path_len;
- struct sockaddr_un addr;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_verbose ("connecting to unix socket %s abstract=%d\n",
- path, abstract);
-
-
- if (!_dbus_open_unix_socket (&fd, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return -1;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- _DBUS_ZERO (addr);
- addr.sun_family = AF_UNIX;
- path_len = strlen (path);
-
- if (abstract)
- {
-#ifdef HAVE_ABSTRACT_SOCKETS
- addr.sun_path[0] = '\0'; /* this is what says "use abstract" */
- path_len++; /* Account for the extra nul byte added to the start of sun_path */
-
- if (path_len > _DBUS_MAX_SUN_PATH_LENGTH)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Abstract socket name too long\n");
- _dbus_close (fd, NULL);
- return -1;
- }
-
- strncpy (&addr.sun_path[1], path, path_len);
- /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */
-#else /* HAVE_ABSTRACT_SOCKETS */
- dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
- "Operating system does not support abstract socket namespace\n");
- _dbus_close (fd, NULL);
- return -1;
-#endif /* ! HAVE_ABSTRACT_SOCKETS */
- }
- else
- {
- if (path_len > _DBUS_MAX_SUN_PATH_LENGTH)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Socket name too long\n");
- _dbus_close (fd, NULL);
- return -1;
- }
-
- strncpy (addr.sun_path, path, path_len);
- }
-
- if (connect (fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to connect to socket %s: %s",
- path, _dbus_strerror (errno));
-
- _dbus_close (fd, NULL);
- return -1;
- }
-
- if (!_dbus_set_fd_nonblocking (fd, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _dbus_close (fd, NULL);
- return -1;
- }
-
- return fd;
-}
-
-/**
- * Creates a UNIX domain socket and connects it to the specified
- * process to execute.
- *
- * This will set FD_CLOEXEC for the socket returned.
- *
- * @param path the path to the executable
- * @param argv the argument list for the process to execute.
- * argv[0] typically is identical to the path of the executable
- * @param error return location for error code
- * @returns connection file descriptor or -1 on error
- */
-int
-_dbus_connect_exec (const char *path,
- char *const argv[],
- DBusError *error)
-{
- int fds[2];
- pid_t pid;
- int retval;
- dbus_bool_t cloexec_done = 0;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_verbose ("connecting to process %s\n", path);
-
-#ifdef SOCK_CLOEXEC
- retval = socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds);
- cloexec_done = (retval >= 0);
-
- if (retval < 0 && (errno == EINVAL || errno == EPROTOTYPE))
-#endif
- {
- retval = socketpair (AF_UNIX, SOCK_STREAM, 0, fds);
- }
-
- if (retval < 0)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to create socket pair: %s",
- _dbus_strerror (errno));
- return -1;
- }
-
- if (!cloexec_done)
- {
- _dbus_fd_set_close_on_exec (fds[0]);
- _dbus_fd_set_close_on_exec (fds[1]);
- }
-
- pid = fork ();
- if (pid < 0)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to fork() to call %s: %s",
- path, _dbus_strerror (errno));
- close (fds[0]);
- close (fds[1]);
- return -1;
- }
-
- if (pid == 0)
- {
- /* child */
- close (fds[0]);
-
- dup2 (fds[1], STDIN_FILENO);
- dup2 (fds[1], STDOUT_FILENO);
-
- if (fds[1] != STDIN_FILENO &&
- fds[1] != STDOUT_FILENO)
- close (fds[1]);
-
- /* Inherit STDERR and the controlling terminal from the
- parent */
-
- _dbus_close_all ();
-
- execvp (path, argv);
-
- fprintf (stderr, "Failed to execute process %s: %s\n", path, _dbus_strerror (errno));
-
- _exit(1);
- }
-
- /* parent */
- close (fds[1]);
-
- if (!_dbus_set_fd_nonblocking (fds[0], error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- close (fds[0]);
- return -1;
- }
-
- return fds[0];
-}
-
-/**
- * Creates a socket and binds it to the given path,
- * then listens on the socket. The socket is
- * set to be nonblocking.
- *
- * Uses abstract sockets instead of filesystem-linked
- * sockets if requested (it's possible only on Linux;
- * see "man 7 unix" on Linux).
- * On non-Linux abstract socket usage always fails.
- *
- * This will set FD_CLOEXEC for the socket returned
- *
- * @param path the socket name
- * @param abstract #TRUE to use abstract namespace
- * @param error return location for errors
- * @returns the listening file descriptor or -1 on error
- */
-int
-_dbus_listen_unix_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error)
-{
- int listen_fd;
- struct sockaddr_un addr;
- size_t path_len;
- unsigned int reuseaddr;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _dbus_verbose ("listening on unix socket %s abstract=%d\n",
- path, abstract);
-
- if (!_dbus_open_unix_socket (&listen_fd, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return -1;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- _DBUS_ZERO (addr);
- addr.sun_family = AF_UNIX;
- path_len = strlen (path);
-
- if (abstract)
- {
-#ifdef HAVE_ABSTRACT_SOCKETS
- /* remember that abstract names aren't nul-terminated so we rely
- * on sun_path being filled in with zeroes above.
- */
- addr.sun_path[0] = '\0'; /* this is what says "use abstract" */
- path_len++; /* Account for the extra nul byte added to the start of sun_path */
-
- if (path_len > _DBUS_MAX_SUN_PATH_LENGTH)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Abstract socket name too long\n");
- _dbus_close (listen_fd, NULL);
- return -1;
- }
-
- strncpy (&addr.sun_path[1], path, path_len);
- /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */
-#else /* HAVE_ABSTRACT_SOCKETS */
- dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
- "Operating system does not support abstract socket namespace\n");
- _dbus_close (listen_fd, NULL);
- return -1;
-#endif /* ! HAVE_ABSTRACT_SOCKETS */
- }
- else
- {
- /* Discussed security implications of this with Nalin,
- * and we couldn't think of where it would kick our ass, but
- * it still seems a bit sucky. It also has non-security suckage;
- * really we'd prefer to exit if the socket is already in use.
- * But there doesn't seem to be a good way to do this.
- *
- * Just to be extra careful, I threw in the stat() - clearly
- * the stat() can't *fix* any security issue, but it at least
- * avoids inadvertent/accidental data loss.
- */
- {
- struct stat sb;
-
- if (stat (path, &sb) == 0 &&
- S_ISSOCK (sb.st_mode))
- unlink (path);
- }
-
- if (path_len > _DBUS_MAX_SUN_PATH_LENGTH)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Abstract socket name too long\n");
- _dbus_close (listen_fd, NULL);
- return -1;
- }
-
- strncpy (addr.sun_path, path, path_len);
- }
-
- reuseaddr = 1;
- if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
- {
- _dbus_warn ("Failed to set socket option\"%s\": %s",
- path, _dbus_strerror (errno));
- }
-
- if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to bind socket \"%s\": %s",
- path, _dbus_strerror (errno));
- _dbus_close (listen_fd, NULL);
- return -1;
- }
-
- if (listen (listen_fd, 30 /* backlog */) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to listen on socket \"%s\": %s",
- path, _dbus_strerror (errno));
- _dbus_close (listen_fd, NULL);
- return -1;
- }
-
- if (!_dbus_set_fd_nonblocking (listen_fd, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_close (listen_fd, NULL);
- return -1;
- }
-
- /* Try opening up the permissions, but if we can't, just go ahead
- * and continue, maybe it will be good enough.
- */
- if (!abstract && chmod (path, 0777) < 0)
- _dbus_warn ("Could not set mode 0777 on socket %s\n",
- path);
-
- return listen_fd;
-}
-
-/**
- * Acquires one or more sockets passed in from systemd. The sockets
- * are set to be nonblocking.
- *
- * This will set FD_CLOEXEC for the sockets returned.
- *
- * @param fds the file descriptors
- * @param error return location for errors
- * @returns the number of file descriptors
- */
-int
-_dbus_listen_systemd_sockets (int **fds,
- DBusError *error)
-{
- int r, n;
- unsigned fd;
- int *new_fds;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- n = sd_listen_fds (TRUE);
- if (n < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (-n),
- "Failed to acquire systemd socket: %s",
- _dbus_strerror (-n));
- return -1;
- }
-
- if (n <= 0)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "No socket received.");
- return -1;
- }
-
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++)
- {
- r = sd_is_socket (fd, AF_UNSPEC, SOCK_STREAM, 1);
- if (r < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (-r),
- "Failed to verify systemd socket type: %s",
- _dbus_strerror (-r));
- return -1;
- }
-
- if (!r)
- {
- dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
- "Passed socket has wrong type.");
- return -1;
- }
- }
-
- /* OK, the file descriptors are all good, so let's take posession of
- them then. */
-
- new_fds = dbus_new (int, n);
- if (!new_fds)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Failed to allocate file handle array.");
- goto fail;
- }
-
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++)
- {
- if (!_dbus_set_fd_nonblocking (fd, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto fail;
- }
-
- new_fds[fd - SD_LISTEN_FDS_START] = fd;
- }
-
- *fds = new_fds;
- return n;
-
- fail:
-
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++)
- {
- _dbus_close (fd, NULL);
- }
-
- dbus_free (new_fds);
- return -1;
-}
-
-/**
- * Creates a socket and connects to a socket at the given host
- * and port. The connection fd is returned, and is set up as
- * nonblocking.
- *
- * This will set FD_CLOEXEC for the socket returned
- *
- * @param host the host name to connect to
- * @param port the port to connect to
- * @param family the address family to listen on, NULL for all
- * @param error return location for error code
- * @returns connection file descriptor or -1 on error
- */
-int
-_dbus_connect_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusError *error)
-{
- return _dbus_connect_tcp_socket_with_nonce (host, port, family, (const char*)NULL, error);
-}
-
-int
-_dbus_connect_tcp_socket_with_nonce (const char *host,
- const char *port,
- const char *family,
- const char *noncefile,
- DBusError *error)
-{
- int saved_errno = 0;
- int fd = -1, res;
- struct addrinfo hints;
- struct addrinfo *ai, *tmp;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- _DBUS_ZERO (hints);
-
- if (!family)
- hints.ai_family = AF_UNSPEC;
- else if (!strcmp(family, "ipv4"))
- hints.ai_family = AF_INET;
- else if (!strcmp(family, "ipv6"))
- hints.ai_family = AF_INET6;
- else
- {
- dbus_set_error (error,
- DBUS_ERROR_BAD_ADDRESS,
- "Unknown address family %s", family);
- return -1;
- }
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_ADDRCONFIG;
-
- if ((res = getaddrinfo(host, port, &hints, &ai)) != 0)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to lookup host/port: \"%s:%s\": %s (%d)",
- host, port, gai_strerror(res), res);
- return -1;
- }
-
- tmp = ai;
- while (tmp)
- {
- if (!_dbus_open_socket (&fd, tmp->ai_family, SOCK_STREAM, 0, error))
- {
- freeaddrinfo(ai);
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return -1;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- if (connect (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
- {
- saved_errno = errno;
- _dbus_close(fd, NULL);
- fd = -1;
- tmp = tmp->ai_next;
- continue;
- }
-
- break;
- }
- freeaddrinfo(ai);
-
- if (fd == -1)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (saved_errno),
- "Failed to connect to socket \"%s:%s\" %s",
- host, port, _dbus_strerror(saved_errno));
- return -1;
- }
-
- if (noncefile != NULL)
- {
- DBusString noncefileStr;
- dbus_bool_t ret;
- _dbus_string_init_const (&noncefileStr, noncefile);
- ret = _dbus_send_nonce (fd, &noncefileStr, error);
- _dbus_string_free (&noncefileStr);
-
- if (!ret)
- {
- _dbus_close (fd, NULL);
- return -1;
- }
- }
-
- if (!_dbus_set_fd_nonblocking (fd, error))
- {
- _dbus_close (fd, NULL);
- return -1;
- }
-
- return fd;
-}
-
-/**
- * Creates a socket and binds it to the given path, then listens on
- * the socket. The socket is set to be nonblocking. In case of port=0
- * a random free port is used and returned in the port parameter.
- * If inaddr_any is specified, the hostname is ignored.
- *
- * This will set FD_CLOEXEC for the socket returned
- *
- * @param host the host name to listen on
- * @param port the port to listen on, if zero a free port will be used
- * @param family the address family to listen on, NULL for all
- * @param retport string to return the actual port listened on
- * @param fds_p location to store returned file descriptors
- * @param error return location for errors
- * @returns the number of listening file descriptors or -1 on error
- */
-int
-_dbus_listen_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusString *retport,
- int **fds_p,
- DBusError *error)
-{
- int saved_errno;
- int nlisten_fd = 0, *listen_fd = NULL, res, i;
- struct addrinfo hints;
- struct addrinfo *ai, *tmp;
- unsigned int reuseaddr;
-
- *fds_p = NULL;
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- _DBUS_ZERO (hints);
-
- if (!family)
- hints.ai_family = AF_UNSPEC;
- else if (!strcmp(family, "ipv4"))
- hints.ai_family = AF_INET;
- else if (!strcmp(family, "ipv6"))
- hints.ai_family = AF_INET6;
- else
- {
- dbus_set_error (error,
- DBUS_ERROR_BAD_ADDRESS,
- "Unknown address family %s", family);
- return -1;
- }
-
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
-
- redo_lookup_with_port:
- ai = NULL;
- if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to lookup host/port: \"%s:%s\": %s (%d)",
- host ? host : "*", port, gai_strerror(res), res);
- goto failed;
- }
-
- tmp = ai;
- while (tmp)
- {
- int fd = -1, *newlisten_fd;
- if (!_dbus_open_socket (&fd, tmp->ai_family, SOCK_STREAM, 0, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET(error);
- goto failed;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- reuseaddr = 1;
- if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
- {
- _dbus_warn ("Failed to set socket option \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror (errno));
- }
-
- if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
- {
- saved_errno = errno;
- _dbus_close(fd, NULL);
- if (saved_errno == EADDRINUSE)
- {
- /* Depending on kernel policy, it may or may not
- be neccessary to bind to both IPv4 & 6 addresses
- so ignore EADDRINUSE here */
- tmp = tmp->ai_next;
- continue;
- }
- dbus_set_error (error, _dbus_error_from_errno (saved_errno),
- "Failed to bind socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror (saved_errno));
- goto failed;
- }
-
- if (listen (fd, 30 /* backlog */) < 0)
- {
- saved_errno = errno;
- _dbus_close (fd, NULL);
- dbus_set_error (error, _dbus_error_from_errno (saved_errno),
- "Failed to listen on socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror (saved_errno));
- goto failed;
- }
-
- newlisten_fd = dbus_realloc(listen_fd, sizeof(int)*(nlisten_fd+1));
- if (!newlisten_fd)
- {
- saved_errno = errno;
- _dbus_close (fd, NULL);
- dbus_set_error (error, _dbus_error_from_errno (saved_errno),
- "Failed to allocate file handle array: %s",
- _dbus_strerror (saved_errno));
- goto failed;
- }
- listen_fd = newlisten_fd;
- listen_fd[nlisten_fd] = fd;
- nlisten_fd++;
-
- if (!_dbus_string_get_length(retport))
- {
- /* If the user didn't specify a port, or used 0, then
- the kernel chooses a port. After the first address
- is bound to, we need to force all remaining addresses
- to use the same port */
- if (!port || !strcmp(port, "0"))
- {
- int result;
- struct sockaddr_storage addr;
- socklen_t addrlen;
- char portbuf[50];
-
- addrlen = sizeof(addr);
- result = getsockname(fd, (struct sockaddr*) &addr, &addrlen);
-
- if (result == -1 ||
- (res = getnameinfo ((struct sockaddr*)&addr, addrlen, NULL, 0,
- portbuf, sizeof(portbuf),
- NI_NUMERICHOST)) != 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to resolve port \"%s:%s\": %s (%s)",
- host ? host : "*", port, gai_strerror(res), res);
- goto failed;
- }
- if (!_dbus_string_append(retport, portbuf))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- /* Release current address list & redo lookup */
- port = _dbus_string_get_const_data(retport);
- freeaddrinfo(ai);
- goto redo_lookup_with_port;
- }
- else
- {
- if (!_dbus_string_append(retport, port))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
- }
- }
-
- tmp = tmp->ai_next;
- }
- freeaddrinfo(ai);
- ai = NULL;
-
- if (!nlisten_fd)
- {
- errno = EADDRINUSE;
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to bind socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror (errno));
- goto failed;
- }
-
- for (i = 0 ; i < nlisten_fd ; i++)
- {
- if (!_dbus_set_fd_nonblocking (listen_fd[i], error))
- {
- goto failed;
- }
- }
-
- *fds_p = listen_fd;
-
- return nlisten_fd;
-
- failed:
- if (ai)
- freeaddrinfo(ai);
- for (i = 0 ; i < nlisten_fd ; i++)
- _dbus_close(listen_fd[i], NULL);
- dbus_free(listen_fd);
- return -1;
-}
-
-static dbus_bool_t
-write_credentials_byte (int server_fd,
- DBusError *error)
-{
- int bytes_written;
- char buf[1] = { '\0' };
-#if defined(HAVE_CMSGCRED)
- union {
- struct cmsghdr hdr;
- char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
- } cmsg;
- struct iovec iov;
- struct msghdr msg;
- iov.iov_base = buf;
- iov.iov_len = 1;
-
- _DBUS_ZERO(msg);
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
-
- msg.msg_control = (caddr_t) &cmsg;
- msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
- _DBUS_ZERO(cmsg);
- cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred));
- cmsg.hdr.cmsg_level = SOL_SOCKET;
- cmsg.hdr.cmsg_type = SCM_CREDS;
-#endif
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- again:
-
-#if defined(HAVE_CMSGCRED)
- bytes_written = sendmsg (server_fd, &msg, 0
-#if HAVE_DECL_MSG_NOSIGNAL
- |MSG_NOSIGNAL
-#endif
- );
-#else
- bytes_written = send (server_fd, buf, 1, 0
-#if HAVE_DECL_MSG_NOSIGNAL
- |MSG_NOSIGNAL
-#endif
- );
-#endif
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- if (bytes_written < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to write credentials byte: %s",
- _dbus_strerror (errno));
- return FALSE;
- }
- else if (bytes_written == 0)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR,
- "wrote zero bytes writing credentials byte");
- return FALSE;
- }
- else
- {
- _dbus_assert (bytes_written == 1);
- _dbus_verbose ("wrote credentials byte\n");
- return TRUE;
- }
-}
-
-/**
- * Reads a single byte which must be nul (an error occurs otherwise),
- * and reads unix credentials if available. Clears the credentials
- * object, then adds pid/uid if available, so any previous credentials
- * stored in the object are lost.
- *
- * Return value indicates whether a byte was read, not whether
- * we got valid credentials. On some systems, such as Linux,
- * reading/writing the byte isn't actually required, but we do it
- * anyway just to avoid multiple codepaths.
- *
- * Fails if no byte is available, so you must select() first.
- *
- * The point of the byte is that on some systems we have to
- * use sendmsg()/recvmsg() to transmit credentials.
- *
- * @param client_fd the client file descriptor
- * @param credentials object to add client credentials to
- * @param error location to store error code
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_read_credentials_socket (int client_fd,
- DBusCredentials *credentials,
- DBusError *error)
-{
- struct msghdr msg;
- struct iovec iov;
- char buf;
- dbus_uid_t uid_read;
- dbus_pid_t pid_read;
- int bytes_read;
-
-#ifdef HAVE_CMSGCRED
- union {
- struct cmsghdr hdr;
- char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
- } cmsg;
-#endif
-
- uid_read = DBUS_UID_UNSET;
- pid_read = DBUS_PID_UNSET;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* The POSIX spec certainly doesn't promise this, but
- * we need these assertions to fail as soon as we're wrong about
- * it so we can do the porting fixups
- */
- _dbus_assert (sizeof (pid_t) <= sizeof (dbus_pid_t));
- _dbus_assert (sizeof (uid_t) <= sizeof (dbus_uid_t));
- _dbus_assert (sizeof (gid_t) <= sizeof (dbus_gid_t));
-
- _dbus_credentials_clear (credentials);
-
- iov.iov_base = &buf;
- iov.iov_len = 1;
-
- _DBUS_ZERO(msg);
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
-
-#if defined(HAVE_CMSGCRED)
- _DBUS_ZERO(cmsg);
- msg.msg_control = (caddr_t) &cmsg;
- msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
-#endif
-
- again:
- bytes_read = recvmsg (client_fd, &msg, 0);
-
- if (bytes_read < 0)
- {
- if (errno == EINTR)
- goto again;
-
- /* EAGAIN or EWOULDBLOCK would be unexpected here since we would
- * normally only call read_credentials if the socket was ready
- * for reading
- */
-
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to read credentials byte: %s",
- _dbus_strerror (errno));
- return FALSE;
- }
- else if (bytes_read == 0)
- {
- /* this should not happen unless we are using recvmsg wrong,
- * so is essentially here for paranoia
- */
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to read credentials byte (zero-length read)");
- return FALSE;
- }
- else if (buf != '\0')
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Credentials byte was not nul");
- return FALSE;
- }
-
-#if defined(HAVE_CMSGCRED)
- if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred))
- || cmsg.hdr.cmsg_type != SCM_CREDS)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Message from recvmsg() was not SCM_CREDS");
- return FALSE;
- }
-#endif
-
- _dbus_verbose ("read credentials byte\n");
-
- {
-#ifdef SO_PEERCRED
- /* Supported by at least Linux and OpenBSD, with minor differences.
- *
- * This mechanism passes the process ID through and does not require
- * the peer's cooperation, so we prefer it over all others. Notably,
- * Linux also supports SCM_CREDENTIALS, which is similar to FreeBSD
- * SCM_CREDS; it's implemented in GIO, but we don't use it in dbus at all,
- * because this is much less fragile.
- */
-#ifdef __OpenBSD__
- struct sockpeercred cr;
-#else
- struct ucred cr;
-#endif
- int cr_len = sizeof (cr);
-
- if (getsockopt (client_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 &&
- cr_len == sizeof (cr))
- {
- pid_read = cr.pid;
- uid_read = cr.uid;
- }
- else
- {
- _dbus_verbose ("Failed to getsockopt() credentials, returned len %d/%d: %s\n",
- cr_len, (int) sizeof (cr), _dbus_strerror (errno));
- }
-#elif defined(HAVE_CMSGCRED)
- /* We only check for HAVE_CMSGCRED, but we're really assuming that the
- * presence of that struct implies SCM_CREDS. Supported by at least
- * FreeBSD and DragonflyBSD.
- *
- * This mechanism requires the peer to help us (it has to send us a
- * SCM_CREDS message) but it does pass the process ID through,
- * which makes it better than getpeereid().
- */
- struct cmsgcred *cred;
-
- cred = (struct cmsgcred *) CMSG_DATA (&cmsg.hdr);
- pid_read = cred->cmcred_pid;
- uid_read = cred->cmcred_euid;
-
-#elif defined(HAVE_GETPEERUCRED)
- /* Supported in at least Solaris >= 10. It should probably be higher
- * up this list, because it carries the pid and we use this code path
- * for audit data. */
- ucred_t * ucred = NULL;
- if (getpeerucred (client_fd, &ucred) == 0)
- {
- pid_read = ucred_getpid (ucred);
- uid_read = ucred_geteuid (ucred);
-#ifdef HAVE_ADT
- /* generate audit session data based on socket ucred */
- adt_session_data_t *adth = NULL;
- adt_export_data_t *data = NULL;
- size_t size = 0;
- if (adt_start_session (&adth, NULL, 0) || (adth == NULL))
- {
- _dbus_verbose ("Failed to adt_start_session(): %s\n", _dbus_strerror (errno));
- }
- else
- {
- if (adt_set_from_ucred (adth, ucred, ADT_NEW))
- {
- _dbus_verbose ("Failed to adt_set_from_ucred(): %s\n", _dbus_strerror (errno));
- }
- else
- {
- size = adt_export_session_data (adth, &data);
- if (size <= 0)
- {
- _dbus_verbose ("Failed to adt_export_session_data(): %s\n", _dbus_strerror (errno));
- }
- else
- {
- _dbus_credentials_add_adt_audit_data (credentials, data, size);
- free (data);
- }
- }
- (void) adt_end_session (adth);
- }
-#endif /* HAVE_ADT */
- }
- else
- {
- _dbus_verbose ("Failed to getpeerucred() credentials: %s\n", _dbus_strerror (errno));
- }
- if (ucred != NULL)
- ucred_free (ucred);
-
- /* ----------------------------------------------------------------
- * When adding new mechanisms, please add them above this point
- * if they support passing the process ID through, or below if not.
- * ---------------------------------------------------------------- */
-
-#elif defined(HAVE_GETPEEREID)
- /* getpeereid() originates from D.J. Bernstein and is fairly
- * widely-supported. According to a web search, it might be present in
- * any/all of:
- *
- * - AIX?
- * - Blackberry?
- * - Cygwin
- * - FreeBSD 4.6+ (but we prefer SCM_CREDS: it carries the pid)
- * - Mac OS X
- * - Minix 3.1.8+
- * - MirBSD?
- * - NetBSD 5.0+ (but LOCAL_PEEREID would be better: it carries the pid)
- * - OpenBSD 3.0+ (but we prefer SO_PEERCRED: it carries the pid)
- * - QNX?
- */
- uid_t euid;
- gid_t egid;
- if (getpeereid (client_fd, &euid, &egid) == 0)
- {
- uid_read = euid;
- }
- else
- {
- _dbus_verbose ("Failed to getpeereid() credentials: %s\n", _dbus_strerror (errno));
- }
-#else /* no supported mechanism */
-
-#warning Socket credentials not supported on this Unix OS
-#warning Please tell https://bugs.freedesktop.org/enter_bug.cgi?product=DBus
-
- /* Please add other operating systems known to support at least one of
- * the mechanisms above to this list, keeping alphabetical order.
- * Everything not in this list is best-effort.
- */
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__linux__) || \
- defined(__OpenBSD__) || \
- defined(__NetBSD__)
-# error Credentials passing not working on this OS is a regression!
-#endif
-
- _dbus_verbose ("Socket credentials not supported on this OS\n");
-#endif
- }
-
- _dbus_verbose ("Credentials:"
- " pid "DBUS_PID_FORMAT
- " uid "DBUS_UID_FORMAT
- "\n",
- pid_read,
- uid_read);
-
- if (pid_read != DBUS_PID_UNSET)
- {
- if (!_dbus_credentials_add_pid (credentials, pid_read))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- if (uid_read != DBUS_UID_UNSET)
- {
- if (!_dbus_credentials_add_unix_uid (credentials, uid_read))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- * Sends a single nul byte with our UNIX credentials as ancillary
- * data. Returns #TRUE if the data was successfully written. On
- * systems that don't support sending credentials, just writes a byte,
- * doesn't send any credentials. On some systems, such as Linux,
- * reading/writing the byte isn't actually required, but we do it
- * anyway just to avoid multiple codepaths.
- *
- * Fails if no byte can be written, so you must select() first.
- *
- * The point of the byte is that on some systems we have to
- * use sendmsg()/recvmsg() to transmit credentials.
- *
- * @param server_fd file descriptor for connection to server
- * @param error return location for error code
- * @returns #TRUE if the byte was sent
- */
-dbus_bool_t
-_dbus_send_credentials_socket (int server_fd,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (write_credentials_byte (server_fd, error))
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Accepts a connection on a listening socket.
- * Handles EINTR for you.
- *
- * This will enable FD_CLOEXEC for the returned socket.
- *
- * @param listen_fd the listen file descriptor
- * @returns the connection fd of the client, or -1 on error
- */
-int
-_dbus_accept (int listen_fd)
-{
- int client_fd;
- struct sockaddr addr;
- socklen_t addrlen;
-#ifdef HAVE_ACCEPT4
- dbus_bool_t cloexec_done;
-#endif
-
- addrlen = sizeof (addr);
-
- retry:
-
-#ifdef HAVE_ACCEPT4
- /*
- * At compile-time, we assume that if accept4() is available in
- * libc headers, SOCK_CLOEXEC is too. At runtime, it is still
- * not necessarily true that either is supported by the running kernel.
- */
- client_fd = accept4 (listen_fd, &addr, &addrlen, SOCK_CLOEXEC);
- cloexec_done = client_fd >= 0;
-
- if (client_fd < 0 && (errno == ENOSYS || errno == EINVAL))
-#endif
- {
- client_fd = accept (listen_fd, &addr, &addrlen);
- }
-
- if (client_fd < 0)
- {
- if (errno == EINTR)
- goto retry;
- }
-
- _dbus_verbose ("client fd %d accepted\n", client_fd);
-
-#ifdef HAVE_ACCEPT4
- if (!cloexec_done)
-#endif
- {
- _dbus_fd_set_close_on_exec(client_fd);
- }
-
- return client_fd;
-}
-
-/**
- * Checks to make sure the given directory is
- * private to the user
- *
- * @param dir the name of the directory
- * @param error error return
- * @returns #FALSE on failure
- **/
-dbus_bool_t
-_dbus_check_dir_is_private_to_user (DBusString *dir, DBusError *error)
-{
- const char *directory;
- struct stat sb;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- directory = _dbus_string_get_const_data (dir);
-
- if (stat (directory, &sb) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "%s", _dbus_strerror (errno));
-
- return FALSE;
- }
-
- if ((S_IROTH & sb.st_mode) || (S_IWOTH & sb.st_mode) ||
- (S_IRGRP & sb.st_mode) || (S_IWGRP & sb.st_mode))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "%s directory is not private to the user", directory);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-fill_user_info_from_passwd (struct passwd *p,
- DBusUserInfo *info,
- DBusError *error)
-{
- _dbus_assert (p->pw_name != NULL);
- _dbus_assert (p->pw_dir != NULL);
-
- info->uid = p->pw_uid;
- info->primary_gid = p->pw_gid;
- info->username = _dbus_strdup (p->pw_name);
- info->homedir = _dbus_strdup (p->pw_dir);
-
- if (info->username == NULL ||
- info->homedir == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-fill_user_info (DBusUserInfo *info,
- dbus_uid_t uid,
- const DBusString *username,
- DBusError *error)
-{
- const char *username_c;
-
- /* exactly one of username/uid provided */
- _dbus_assert (username != NULL || uid != DBUS_UID_UNSET);
- _dbus_assert (username == NULL || uid == DBUS_UID_UNSET);
-
- info->uid = DBUS_UID_UNSET;
- info->primary_gid = DBUS_GID_UNSET;
- info->group_ids = NULL;
- info->n_group_ids = 0;
- info->username = NULL;
- info->homedir = NULL;
-
- if (username != NULL)
- username_c = _dbus_string_get_const_data (username);
- else
- username_c = NULL;
-
- /* For now assuming that the getpwnam() and getpwuid() flavors
- * are always symmetrical, if not we have to add more configure
- * checks
- */
-
-#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
- {
- struct passwd *p;
- int result;
- size_t buflen;
- char *buf;
- struct passwd p_str;
-
- /* retrieve maximum needed size for buf */
- buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
-
- /* sysconf actually returns a long, but everything else expects size_t,
- * so just recast here.
- * https://bugs.freedesktop.org/show_bug.cgi?id=17061
- */
- if ((long) buflen <= 0)
- buflen = 1024;
-
- result = -1;
- while (1)
- {
- buf = dbus_malloc (buflen);
- if (buf == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- p = NULL;
-#ifdef HAVE_POSIX_GETPWNAM_R
- if (uid != DBUS_UID_UNSET)
- result = getpwuid_r (uid, &p_str, buf, buflen,
- &p);
- else
- result = getpwnam_r (username_c, &p_str, buf, buflen,
- &p);
-#else
- if (uid != DBUS_UID_UNSET)
- p = getpwuid_r (uid, &p_str, buf, buflen);
- else
- p = getpwnam_r (username_c, &p_str, buf, buflen);
- result = 0;
-#endif /* !HAVE_POSIX_GETPWNAM_R */
- //Try a bigger buffer if ERANGE was returned
- if (result == ERANGE && buflen < 512 * 1024)
- {
- dbus_free (buf);
- buflen *= 2;
- }
- else
- {
- break;
- }
- }
- if (result == 0 && p == &p_str)
- {
- if (!fill_user_info_from_passwd (p, info, error))
- {
- dbus_free (buf);
- return FALSE;
- }
- dbus_free (buf);
- }
- else
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "User \"%s\" unknown or no memory to allocate password entry\n",
- username_c ? username_c : "???");
- _dbus_verbose ("User %s unknown\n", username_c ? username_c : "???");
- dbus_free (buf);
- return FALSE;
- }
- }
-#else /* ! HAVE_GETPWNAM_R */
- {
- /* I guess we're screwed on thread safety here */
- struct passwd *p;
-
- if (uid != DBUS_UID_UNSET)
- p = getpwuid (uid);
- else
- p = getpwnam (username_c);
-
- if (p != NULL)
- {
- if (!fill_user_info_from_passwd (p, info, error))
- {
- return FALSE;
- }
- }
- else
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "User \"%s\" unknown or no memory to allocate password entry\n",
- username_c ? username_c : "???");
- _dbus_verbose ("User %s unknown\n", username_c ? username_c : "???");
- return FALSE;
- }
- }
-#endif /* ! HAVE_GETPWNAM_R */
-
- /* Fill this in so we can use it to get groups */
- username_c = info->username;
-
-#ifdef HAVE_GETGROUPLIST
- {
- gid_t *buf;
- int buf_count;
- int i;
- int initial_buf_count;
-
- initial_buf_count = 17;
- buf_count = initial_buf_count;
- buf = dbus_new (gid_t, buf_count);
- if (buf == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- if (getgrouplist (username_c,
- info->primary_gid,
- buf, &buf_count) < 0)
- {
- gid_t *new;
- /* Presumed cause of negative return code: buf has insufficient
- entries to hold the entire group list. The Linux behavior in this
- case is to pass back the actual number of groups in buf_count, but
- on Mac OS X 10.5, buf_count is unhelpfully left alone.
- So as a hack, try to help out a bit by guessing a larger
- number of groups, within reason.. might still fail, of course,
- but we can at least print a more informative message. I looked up
- the "right way" to do this by downloading Apple's own source code
- for the "id" command, and it turns out that they use an
- undocumented library function getgrouplist_2 (!) which is not
- declared in any header in /usr/include (!!). That did not seem
- like the way to go here.
- */
- if (buf_count == initial_buf_count)
- {
- buf_count *= 16; /* Retry with an arbitrarily scaled-up array */
- }
- new = dbus_realloc (buf, buf_count * sizeof (buf[0]));
- if (new == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_free (buf);
- goto failed;
- }
-
- buf = new;
-
- errno = 0;
- if (getgrouplist (username_c, info->primary_gid, buf, &buf_count) < 0)
- {
- if (errno == 0)
- {
- _dbus_warn ("It appears that username \"%s\" is in more than %d groups.\nProceeding with just the first %d groups.",
- username_c, buf_count, buf_count);
- }
- else
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to get groups for username \"%s\" primary GID "
- DBUS_GID_FORMAT ": %s\n",
- username_c, info->primary_gid,
- _dbus_strerror (errno));
- dbus_free (buf);
- goto failed;
- }
- }
- }
-
- info->group_ids = dbus_new (dbus_gid_t, buf_count);
- if (info->group_ids == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_free (buf);
- goto failed;
- }
-
- for (i = 0; i < buf_count; ++i)
- info->group_ids[i] = buf[i];
-
- info->n_group_ids = buf_count;
-
- dbus_free (buf);
- }
-#else /* HAVE_GETGROUPLIST */
- {
- /* We just get the one group ID */
- info->group_ids = dbus_new (dbus_gid_t, 1);
- if (info->group_ids == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- info->n_group_ids = 1;
-
- (info->group_ids)[0] = info->primary_gid;
- }
-#endif /* HAVE_GETGROUPLIST */
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- return TRUE;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
-}
-
-/**
- * Gets user info for the given username.
- *
- * @param info user info object to initialize
- * @param username the username
- * @param error error return
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_user_info_fill (DBusUserInfo *info,
- const DBusString *username,
- DBusError *error)
-{
- return fill_user_info (info, DBUS_UID_UNSET,
- username, error);
-}
-
-/**
- * Gets user info for the given user ID.
- *
- * @param info user info object to initialize
- * @param uid the user ID
- * @param error error return
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_user_info_fill_uid (DBusUserInfo *info,
- dbus_uid_t uid,
- DBusError *error)
-{
- return fill_user_info (info, uid,
- NULL, error);
-}
-
-/**
- * Adds the credentials of the current process to the
- * passed-in credentials object.
- *
- * @param credentials credentials to add to
- * @returns #FALSE if no memory; does not properly roll back on failure, so only some credentials may have been added
- */
-dbus_bool_t
-_dbus_credentials_add_from_current_process (DBusCredentials *credentials)
-{
- /* The POSIX spec certainly doesn't promise this, but
- * we need these assertions to fail as soon as we're wrong about
- * it so we can do the porting fixups
- */
- _dbus_assert (sizeof (pid_t) <= sizeof (dbus_pid_t));
- _dbus_assert (sizeof (uid_t) <= sizeof (dbus_uid_t));
- _dbus_assert (sizeof (gid_t) <= sizeof (dbus_gid_t));
-
- if (!_dbus_credentials_add_pid(credentials, _dbus_getpid()))
- return FALSE;
- if (!_dbus_credentials_add_unix_uid(credentials, _dbus_geteuid()))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * Append to the string the identity we would like to have when we
- * authenticate, on UNIX this is the current process UID and on
- * Windows something else, probably a Windows SID string. No escaping
- * is required, that is done in dbus-auth.c. The username here
- * need not be anything human-readable, it can be the machine-readable
- * form i.e. a user id.
- *
- * @param str the string to append to
- * @returns #FALSE on no memory
- */
-dbus_bool_t
-_dbus_append_user_from_current_process (DBusString *str)
-{
- return _dbus_string_append_uint (str,
- _dbus_geteuid ());
-}
-
-/**
- * Gets our process ID
- * @returns process ID
- */
-dbus_pid_t
-_dbus_getpid (void)
-{
- return getpid ();
-}
-
-/** Gets our UID
- * @returns process UID
- */
-dbus_uid_t
-_dbus_getuid (void)
-{
- return getuid ();
-}
-
-/** Gets our effective UID
- * @returns process effective UID
- */
-dbus_uid_t
-_dbus_geteuid (void)
-{
- return geteuid ();
-}
-
-/**
- * The only reason this is separate from _dbus_getpid() is to allow it
- * on Windows for logging but not for other purposes.
- *
- * @returns process ID to put in log messages
- */
-unsigned long
-_dbus_pid_for_log (void)
-{
- return getpid ();
-}
-
-/**
- * Gets a UID from a UID string.
- *
- * @param uid_str the UID in string form
- * @param uid UID to fill in
- * @returns #TRUE if successfully filled in UID
- */
-dbus_bool_t
-_dbus_parse_uid (const DBusString *uid_str,
- dbus_uid_t *uid)
-{
- int end;
- long val;
-
- if (_dbus_string_get_length (uid_str) == 0)
- {
- _dbus_verbose ("UID string was zero length\n");
- return FALSE;
- }
-
- val = -1;
- end = 0;
- if (!_dbus_string_parse_int (uid_str, 0, &val,
- &end))
- {
- _dbus_verbose ("could not parse string as a UID\n");
- return FALSE;
- }
-
- if (end != _dbus_string_get_length (uid_str))
- {
- _dbus_verbose ("string contained trailing stuff after UID\n");
- return FALSE;
- }
-
- *uid = val;
-
- return TRUE;
-}
-
-#if !DBUS_USE_SYNC
-/* To be thread-safe by default on platforms that don't necessarily have
- * atomic operations (notably Debian armel, which is armv4t), we must
- * use a mutex that can be initialized statically, like this.
- * GLib >= 2.32 uses a similar system.
- */
-static pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-/**
- * Atomically increments an integer
- *
- * @param atomic pointer to the integer to increment
- * @returns the value before incrementing
- */
-dbus_int32_t
-_dbus_atomic_inc (DBusAtomic *atomic)
-{
-#if DBUS_USE_SYNC
- return __sync_add_and_fetch(&atomic->value, 1)-1;
-#else
- dbus_int32_t res;
-
- pthread_mutex_lock (&atomic_mutex);
- res = atomic->value;
- atomic->value += 1;
- pthread_mutex_unlock (&atomic_mutex);
-
- return res;
-#endif
-}
-
-/**
- * Atomically decrement an integer
- *
- * @param atomic pointer to the integer to decrement
- * @returns the value before decrementing
- */
-dbus_int32_t
-_dbus_atomic_dec (DBusAtomic *atomic)
-{
-#if DBUS_USE_SYNC
- return __sync_sub_and_fetch(&atomic->value, 1)+1;
-#else
- dbus_int32_t res;
-
- pthread_mutex_lock (&atomic_mutex);
- res = atomic->value;
- atomic->value -= 1;
- pthread_mutex_unlock (&atomic_mutex);
-
- return res;
-#endif
-}
-
-/**
- * Atomically get the value of an integer. It may change at any time
- * thereafter, so this is mostly only useful for assertions.
- *
- * @param atomic pointer to the integer to get
- * @returns the value at this moment
- */
-dbus_int32_t
-_dbus_atomic_get (DBusAtomic *atomic)
-{
-#if DBUS_USE_SYNC
- __sync_synchronize ();
- return atomic->value;
-#else
- dbus_int32_t res;
-
- pthread_mutex_lock (&atomic_mutex);
- res = atomic->value;
- pthread_mutex_unlock (&atomic_mutex);
-
- return res;
-#endif
-}
-
-/**
- * Wrapper for poll().
- *
- * @param fds the file descriptors to poll
- * @param n_fds number of descriptors in the array
- * @param timeout_milliseconds timeout or -1 for infinite
- * @returns numbers of fds with revents, or <0 on error
- */
-int
-_dbus_poll (DBusPollFD *fds,
- int n_fds,
- int timeout_milliseconds)
-{
-#if defined(HAVE_POLL) && !defined(BROKEN_POLL)
- /* This big thing is a constant expression and should get optimized
- * out of existence. So it's more robust than a configure check at
- * no cost.
- */
- if (_DBUS_POLLIN == POLLIN &&
- _DBUS_POLLPRI == POLLPRI &&
- _DBUS_POLLOUT == POLLOUT &&
- _DBUS_POLLERR == POLLERR &&
- _DBUS_POLLHUP == POLLHUP &&
- _DBUS_POLLNVAL == POLLNVAL &&
- sizeof (DBusPollFD) == sizeof (struct pollfd) &&
- _DBUS_STRUCT_OFFSET (DBusPollFD, fd) ==
- _DBUS_STRUCT_OFFSET (struct pollfd, fd) &&
- _DBUS_STRUCT_OFFSET (DBusPollFD, events) ==
- _DBUS_STRUCT_OFFSET (struct pollfd, events) &&
- _DBUS_STRUCT_OFFSET (DBusPollFD, revents) ==
- _DBUS_STRUCT_OFFSET (struct pollfd, revents))
- {
- return poll ((struct pollfd*) fds,
- n_fds,
- timeout_milliseconds);
- }
- else
- {
- /* We have to convert the DBusPollFD to an array of
- * struct pollfd, poll, and convert back.
- */
- _dbus_warn ("didn't implement poll() properly for this system yet\n");
- return -1;
- }
-#else /* ! HAVE_POLL */
-
- fd_set read_set, write_set, err_set;
- int max_fd = 0;
- int i;
- struct timeval tv;
- int ready;
-
- FD_ZERO (&read_set);
- FD_ZERO (&write_set);
- FD_ZERO (&err_set);
-
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
- if (fdp->events & _DBUS_POLLIN)
- FD_SET (fdp->fd, &read_set);
-
- if (fdp->events & _DBUS_POLLOUT)
- FD_SET (fdp->fd, &write_set);
-
- FD_SET (fdp->fd, &err_set);
-
- max_fd = MAX (max_fd, fdp->fd);
- }
-
- tv.tv_sec = timeout_milliseconds / 1000;
- tv.tv_usec = (timeout_milliseconds % 1000) * 1000;
-
- ready = select (max_fd + 1, &read_set, &write_set, &err_set,
- timeout_milliseconds < 0 ? NULL : &tv);
-
- if (ready > 0)
- {
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
- fdp->revents = 0;
-
- if (FD_ISSET (fdp->fd, &read_set))
- fdp->revents |= _DBUS_POLLIN;
-
- if (FD_ISSET (fdp->fd, &write_set))
- fdp->revents |= _DBUS_POLLOUT;
-
- if (FD_ISSET (fdp->fd, &err_set))
- fdp->revents |= _DBUS_POLLERR;
- }
- }
-
- return ready;
-#endif
-}
-
-/**
- * Get current time, as in gettimeofday(). Use the monotonic clock if
- * available, to avoid problems when the system time changes.
- *
- * @param tv_sec return location for number of seconds
- * @param tv_usec return location for number of microseconds
- */
-void
-_dbus_get_monotonic_time (long *tv_sec,
- long *tv_usec)
-{
-#ifdef HAVE_MONOTONIC_CLOCK
- struct timespec ts;
- clock_gettime (CLOCK_MONOTONIC, &ts);
-
- if (tv_sec)
- *tv_sec = ts.tv_sec;
- if (tv_usec)
- *tv_usec = ts.tv_nsec / 1000;
-#else
- struct timeval t;
-
- gettimeofday (&t, NULL);
-
- if (tv_sec)
- *tv_sec = t.tv_sec;
- if (tv_usec)
- *tv_usec = t.tv_usec;
-#endif
-}
-
-/**
- * Get current time, as in gettimeofday(). Never uses the monotonic
- * clock.
- *
- * @param tv_sec return location for number of seconds
- * @param tv_usec return location for number of microseconds
- */
-void
-_dbus_get_real_time (long *tv_sec,
- long *tv_usec)
-{
- struct timeval t;
-
- gettimeofday (&t, NULL);
-
- if (tv_sec)
- *tv_sec = t.tv_sec;
- if (tv_usec)
- *tv_usec = t.tv_usec;
-}
-
-/**
- * Creates a directory; succeeds if the directory
- * is created or already existed.
- *
- * @param filename directory filename
- * @param error initialized error object
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_create_directory (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (mkdir (filename_c, 0700) < 0)
- {
- if (errno == EEXIST)
- return TRUE;
-
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to create directory %s: %s\n",
- filename_c, _dbus_strerror (errno));
- return FALSE;
- }
- else
- return TRUE;
-}
-
-/**
- * Appends the given filename to the given directory.
- *
- * @todo it might be cute to collapse multiple '/' such as "foo//"
- * concat "//bar"
- *
- * @param dir the directory name
- * @param next_component the filename
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_concat_dir_and_file (DBusString *dir,
- const DBusString *next_component)
-{
- dbus_bool_t dir_ends_in_slash;
- dbus_bool_t file_starts_with_slash;
-
- if (_dbus_string_get_length (dir) == 0 ||
- _dbus_string_get_length (next_component) == 0)
- return TRUE;
-
- dir_ends_in_slash = '/' == _dbus_string_get_byte (dir,
- _dbus_string_get_length (dir) - 1);
-
- file_starts_with_slash = '/' == _dbus_string_get_byte (next_component, 0);
-
- if (dir_ends_in_slash && file_starts_with_slash)
- {
- _dbus_string_shorten (dir, 1);
- }
- else if (!(dir_ends_in_slash || file_starts_with_slash))
- {
- if (!_dbus_string_append_byte (dir, '/'))
- return FALSE;
- }
-
- return _dbus_string_copy (next_component, 0, dir,
- _dbus_string_get_length (dir));
-}
-
-/** nanoseconds in a second */
-#define NANOSECONDS_PER_SECOND 1000000000
-/** microseconds in a second */
-#define MICROSECONDS_PER_SECOND 1000000
-/** milliseconds in a second */
-#define MILLISECONDS_PER_SECOND 1000
-/** nanoseconds in a millisecond */
-#define NANOSECONDS_PER_MILLISECOND 1000000
-/** microseconds in a millisecond */
-#define MICROSECONDS_PER_MILLISECOND 1000
-
-/**
- * Sleeps the given number of milliseconds.
- * @param milliseconds number of milliseconds
- */
-void
-_dbus_sleep_milliseconds (int milliseconds)
-{
-#ifdef HAVE_NANOSLEEP
- struct timespec req;
- struct timespec rem;
-
- req.tv_sec = milliseconds / MILLISECONDS_PER_SECOND;
- req.tv_nsec = (milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND;
- rem.tv_sec = 0;
- rem.tv_nsec = 0;
-
- while (nanosleep (&req, &rem) < 0 && errno == EINTR)
- req = rem;
-#elif defined (HAVE_USLEEP)
- usleep (milliseconds * MICROSECONDS_PER_MILLISECOND);
-#else /* ! HAVE_USLEEP */
- sleep (MAX (milliseconds / 1000, 1));
-#endif
-}
-
-static dbus_bool_t
-_dbus_generate_pseudorandom_bytes (DBusString *str,
- int n_bytes)
-{
- int old_len;
- char *p;
-
- old_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_lengthen (str, n_bytes))
- return FALSE;
-
- p = _dbus_string_get_data_len (str, old_len, n_bytes);
-
- _dbus_generate_pseudorandom_bytes_buffer (p, n_bytes);
-
- return TRUE;
-}
-
-/**
- * Generates the given number of random bytes,
- * using the best mechanism we can come up with.
- *
- * @param str the string
- * @param n_bytes the number of random bytes to append to string
- * @returns #TRUE on success, #FALSE if no memory
- */
-dbus_bool_t
-_dbus_generate_random_bytes (DBusString *str,
- int n_bytes)
-{
- int old_len;
- int fd;
-
- /* FALSE return means "no memory", if it could
- * mean something else then we'd need to return
- * a DBusError. So we always fall back to pseudorandom
- * if the I/O fails.
- */
-
- old_len = _dbus_string_get_length (str);
- fd = -1;
-
- /* note, urandom on linux will fall back to pseudorandom */
- fd = open ("/dev/urandom", O_RDONLY);
- if (fd < 0)
- return _dbus_generate_pseudorandom_bytes (str, n_bytes);
-
- _dbus_verbose ("/dev/urandom fd %d opened\n", fd);
-
- if (_dbus_read (fd, str, n_bytes) != n_bytes)
- {
- _dbus_close (fd, NULL);
- _dbus_string_set_length (str, old_len);
- return _dbus_generate_pseudorandom_bytes (str, n_bytes);
- }
-
- _dbus_verbose ("Read %d bytes from /dev/urandom\n",
- n_bytes);
-
- _dbus_close (fd, NULL);
-
- return TRUE;
-}
-
-/**
- * Exit the process, returning the given value.
- *
- * @param code the exit code
- */
-void
-_dbus_exit (int code)
-{
- _exit (code);
-}
-
-/**
- * A wrapper around strerror() because some platforms
- * may be lame and not have strerror(). Also, never
- * returns NULL.
- *
- * @param error_number errno.
- * @returns error description.
- */
-const char*
-_dbus_strerror (int error_number)
-{
- const char *msg;
-
- msg = strerror (error_number);
- if (msg == NULL)
- msg = "unknown";
-
- return msg;
-}
-
-/**
- * signal (SIGPIPE, SIG_IGN);
- */
-void
-_dbus_disable_sigpipe (void)
-{
- signal (SIGPIPE, SIG_IGN);
-}
-
-/**
- * Sets the file descriptor to be close
- * on exec. Should be called for all file
- * descriptors in D-Bus code.
- *
- * @param fd the file descriptor
- */
-void
-_dbus_fd_set_close_on_exec (intptr_t fd)
-{
- int val;
-
- val = fcntl (fd, F_GETFD, 0);
-
- if (val < 0)
- return;
-
- val |= FD_CLOEXEC;
-
- fcntl (fd, F_SETFD, val);
-}
-
-/**
- * Closes a file descriptor.
- *
- * @param fd the file descriptor
- * @param error error object
- * @returns #FALSE if error set
- */
-dbus_bool_t
-_dbus_close (int fd,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- again:
- if (close (fd) < 0)
- {
- if (errno == EINTR)
- goto again;
-
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not close fd %d", fd);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Duplicates a file descriptor. Makes sure the fd returned is >= 3
- * (i.e. avoids stdin/stdout/stderr). Sets O_CLOEXEC.
- *
- * @param fd the file descriptor to duplicate
- * @param error address of error location.
- * @returns duplicated file descriptor
- * */
-int
-_dbus_dup(int fd,
- DBusError *error)
-{
- int new_fd;
-
-#ifdef F_DUPFD_CLOEXEC
- dbus_bool_t cloexec_done;
-
- new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
- cloexec_done = new_fd >= 0;
-
- if (new_fd < 0 && errno == EINVAL)
-#endif
- {
- new_fd = fcntl(fd, F_DUPFD, 3);
- }
-
- if (new_fd < 0) {
-
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not duplicate fd %d", fd);
- return -1;
- }
-
-#ifdef F_DUPFD_CLOEXEC
- if (!cloexec_done)
-#endif
- {
- _dbus_fd_set_close_on_exec(new_fd);
- }
-
- return new_fd;
-}
-
-/**
- * Sets a file descriptor to be nonblocking.
- *
- * @param fd the file descriptor.
- * @param error address of error location.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_set_fd_nonblocking (int fd,
- DBusError *error)
-{
- int val;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- val = fcntl (fd, F_GETFL, 0);
- if (val < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to get flags from file descriptor %d: %s",
- fd, _dbus_strerror (errno));
- _dbus_verbose ("Failed to get flags for fd %d: %s\n", fd,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- if (fcntl (fd, F_SETFL, val | O_NONBLOCK) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set nonblocking flag of file descriptor %d: %s",
- fd, _dbus_strerror (errno));
- _dbus_verbose ("Failed to set fd %d nonblocking: %s\n",
- fd, _dbus_strerror (errno));
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * On GNU libc systems, print a crude backtrace to stderr. On other
- * systems, print "no backtrace support" and block for possible gdb
- * attachment if an appropriate environment variable is set.
- */
-void
-_dbus_print_backtrace (void)
-{
-#if defined (HAVE_BACKTRACE) && defined (DBUS_BUILT_R_DYNAMIC)
- void *bt[500];
- int bt_size;
- int i;
- char **syms;
-
- bt_size = backtrace (bt, 500);
-
- syms = backtrace_symbols (bt, bt_size);
-
- i = 0;
- while (i < bt_size)
- {
- /* don't use dbus_warn since it can _dbus_abort() */
- fprintf (stderr, " %s\n", syms[i]);
- ++i;
- }
- fflush (stderr);
-
- free (syms);
-#elif defined (HAVE_BACKTRACE) && ! defined (DBUS_BUILT_R_DYNAMIC)
- fprintf (stderr, " D-Bus not built with -rdynamic so unable to print a backtrace\n");
-#else
- fprintf (stderr, " D-Bus not compiled with backtrace support so unable to print a backtrace\n");
-#endif
-}
-
-/**
- * Creates a full-duplex pipe (as in socketpair()).
- * Sets both ends of the pipe nonblocking.
- *
- * Marks both file descriptors as close-on-exec
- *
- * @param fd1 return location for one end
- * @param fd2 return location for the other end
- * @param blocking #TRUE if pipe should be blocking
- * @param error error return
- * @returns #FALSE on failure (if error is set)
- */
-dbus_bool_t
-_dbus_full_duplex_pipe (int *fd1,
- int *fd2,
- dbus_bool_t blocking,
- DBusError *error)
-{
-#ifdef HAVE_SOCKETPAIR
- int fds[2];
- int retval;
-
-#ifdef SOCK_CLOEXEC
- dbus_bool_t cloexec_done;
-
- retval = socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds);
- cloexec_done = retval >= 0;
-
- if (retval < 0 && (errno == EINVAL || errno == EPROTOTYPE))
-#endif
- {
- retval = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
- }
-
- if (retval < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not create full-duplex pipe");
- return FALSE;
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-#ifdef SOCK_CLOEXEC
- if (!cloexec_done)
-#endif
- {
- _dbus_fd_set_close_on_exec (fds[0]);
- _dbus_fd_set_close_on_exec (fds[1]);
- }
-
- if (!blocking &&
- (!_dbus_set_fd_nonblocking (fds[0], NULL) ||
- !_dbus_set_fd_nonblocking (fds[1], NULL)))
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not set full-duplex pipe nonblocking");
-
- _dbus_close (fds[0], NULL);
- _dbus_close (fds[1], NULL);
-
- return FALSE;
- }
-
- *fd1 = fds[0];
- *fd2 = fds[1];
-
- _dbus_verbose ("full-duplex pipe %d <-> %d\n",
- *fd1, *fd2);
-
- return TRUE;
-#else
- _dbus_warn ("_dbus_full_duplex_pipe() not implemented on this OS\n");
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "_dbus_full_duplex_pipe() not implemented on this OS");
- return FALSE;
-#endif
-}
-
-/**
- * Measure the length of the given format string and arguments,
- * not including the terminating nul.
- *
- * @param format a printf-style format string
- * @param args arguments for the format string
- * @returns length of the given format string and args, or -1 if no memory
- */
-int
-_dbus_printf_string_upper_bound (const char *format,
- va_list args)
-{
- char static_buf[1024];
- int bufsize = sizeof (static_buf);
- int len;
- va_list args_copy;
-
- DBUS_VA_COPY (args_copy, args);
- len = vsnprintf (static_buf, bufsize, format, args_copy);
- va_end (args_copy);
-
- /* If vsnprintf() returned non-negative, then either the string fits in
- * static_buf, or this OS has the POSIX and C99 behaviour where vsnprintf
- * returns the number of characters that were needed, or this OS returns the
- * truncated length.
- *
- * We ignore the possibility that snprintf might just ignore the length and
- * overrun the buffer (64-bit Solaris 7), because that's pathological.
- * If your libc is really that bad, come back when you have a better one. */
- if (len == bufsize)
- {
- /* This could be the truncated length (Tru64 and IRIX have this bug),
- * or the real length could be coincidentally the same. Which is it?
- * If vsnprintf returns the truncated length, we'll go to the slow
- * path. */
- DBUS_VA_COPY (args_copy, args);
-
- if (vsnprintf (static_buf, 1, format, args_copy) == 1)
- len = -1;
-
- va_end (args_copy);
- }
-
- /* If vsnprintf() returned negative, we have to do more work.
- * HP-UX returns negative. */
- while (len < 0)
- {
- char *buf;
-
- bufsize *= 2;
-
- buf = dbus_malloc (bufsize);
-
- if (buf == NULL)
- return -1;
-
- DBUS_VA_COPY (args_copy, args);
- len = vsnprintf (buf, bufsize, format, args_copy);
- va_end (args_copy);
-
- dbus_free (buf);
-
- /* If the reported length is exactly the buffer size, round up to the
- * next size, in case vsnprintf has been returning the truncated
- * length */
- if (len == bufsize)
- len = -1;
- }
-
- return len;
-}
-
-/**
- * Gets the temporary files directory by inspecting the environment variables
- * TMPDIR, TMP, and TEMP in that order. If none of those are set "/tmp" is returned
- *
- * @returns location of temp directory, or #NULL if no memory for locking
- */
-const char*
-_dbus_get_tmpdir(void)
-{
- /* Protected by _DBUS_LOCK_sysdeps */
- static const char* tmpdir = NULL;
-
- if (!_DBUS_LOCK (sysdeps))
- return NULL;
-
- if (tmpdir == NULL)
- {
- /* TMPDIR is what glibc uses, then
- * glibc falls back to the P_tmpdir macro which
- * just expands to "/tmp"
- */
- if (tmpdir == NULL)
- tmpdir = getenv("TMPDIR");
-
- /* These two env variables are probably
- * broken, but maybe some OS uses them?
- */
- if (tmpdir == NULL)
- tmpdir = getenv("TMP");
- if (tmpdir == NULL)
- tmpdir = getenv("TEMP");
-
- /* And this is the sane fallback. */
- if (tmpdir == NULL)
- tmpdir = "/tmp";
- }
-
- _DBUS_UNLOCK (sysdeps);
-
- _dbus_assert(tmpdir != NULL);
-
- return tmpdir;
-}
-
-#if defined(DBUS_ENABLE_X11_AUTOLAUNCH) || defined(DBUS_ENABLE_LAUNCHD)
-/**
- * Execute a subprocess, returning up to 1024 bytes of output
- * into @p result.
- *
- * If successful, returns #TRUE and appends the output to @p
- * result. If a failure happens, returns #FALSE and
- * sets an error in @p error.
- *
- * @note It's not an error if the subprocess terminates normally
- * without writing any data to stdout. Verify the @p result length
- * before and after this function call to cover this case.
- *
- * @param progname initial path to exec (may or may not be absolute)
- * @param path_fallback if %TRUE, search PATH for executable
- * @param argv NULL-terminated list of arguments
- * @param result a DBusString where the output can be append
- * @param error a DBusError to store the error in case of failure
- * @returns #TRUE on success, #FALSE if an error happened
- */
-static dbus_bool_t
-_read_subprocess_line_argv (const char *progpath,
- dbus_bool_t path_fallback,
- char * const *argv,
- DBusString *result,
- DBusError *error)
-{
- int result_pipe[2] = { -1, -1 };
- int errors_pipe[2] = { -1, -1 };
- pid_t pid;
- int ret;
- int status;
- int orig_len;
-
- dbus_bool_t retval;
- sigset_t new_set, old_set;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- retval = FALSE;
-
- /* We need to block any existing handlers for SIGCHLD temporarily; they
- * will cause waitpid() below to fail.
- * https://bugs.freedesktop.org/show_bug.cgi?id=21347
- */
- sigemptyset (&new_set);
- sigaddset (&new_set, SIGCHLD);
- sigprocmask (SIG_BLOCK, &new_set, &old_set);
-
- orig_len = _dbus_string_get_length (result);
-
-#define READ_END 0
-#define WRITE_END 1
- if (pipe (result_pipe) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to create a pipe to call %s: %s",
- progpath, _dbus_strerror (errno));
- _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
- progpath, _dbus_strerror (errno));
- goto out;
- }
- if (pipe (errors_pipe) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to create a pipe to call %s: %s",
- progpath, _dbus_strerror (errno));
- _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
- progpath, _dbus_strerror (errno));
- goto out;
- }
-
- pid = fork ();
- if (pid < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to fork() to call %s: %s",
- progpath, _dbus_strerror (errno));
- _dbus_verbose ("Failed to fork() to call %s: %s\n",
- progpath, _dbus_strerror (errno));
- goto out;
- }
-
- if (pid == 0)
- {
- /* child process */
- int fd;
-
- fd = open ("/dev/null", O_RDWR);
- if (fd == -1)
- /* huh?! can't open /dev/null? */
- _exit (1);
-
- _dbus_verbose ("/dev/null fd %d opened\n", fd);
-
- /* set-up stdXXX */
- close (result_pipe[READ_END]);
- close (errors_pipe[READ_END]);
-
- if (dup2 (fd, 0) == -1) /* setup stdin */
- _exit (1);
- if (dup2 (result_pipe[WRITE_END], 1) == -1) /* setup stdout */
- _exit (1);
- if (dup2 (errors_pipe[WRITE_END], 2) == -1) /* setup stderr */
- _exit (1);
-
- _dbus_close_all ();
-
- sigprocmask (SIG_SETMASK, &old_set, NULL);
-
- /* If it looks fully-qualified, try execv first */
- if (progpath[0] == '/')
- {
- execv (progpath, argv);
- /* Ok, that failed. Now if path_fallback is given, let's
- * try unqualified. This is mostly a hack to work
- * around systems which ship dbus-launch in /usr/bin
- * but everything else in /bin (because dbus-launch
- * depends on X11).
- */
- if (path_fallback)
- /* We must have a slash, because we checked above */
- execvp (strrchr (progpath, '/')+1, argv);
- }
- else
- execvp (progpath, argv);
-
- /* still nothing, we failed */
- _exit (1);
- }
-
- /* parent process */
- close (result_pipe[WRITE_END]);
- close (errors_pipe[WRITE_END]);
- result_pipe[WRITE_END] = -1;
- errors_pipe[WRITE_END] = -1;
-
- ret = 0;
- do
- {
- ret = _dbus_read (result_pipe[READ_END], result, 1024);
- }
- while (ret > 0);
-
- /* reap the child process to avoid it lingering as zombie */
- do
- {
- ret = waitpid (pid, &status, 0);
- }
- while (ret == -1 && errno == EINTR);
-
- /* We succeeded if the process exited with status 0 and
- anything was read */
- if (!WIFEXITED (status) || WEXITSTATUS (status) != 0 )
- {
- /* The process ended with error */
- DBusString error_message;
- if (!_dbus_string_init (&error_message))
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- ret = 0;
- do
- {
- ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024);
- }
- while (ret > 0);
-
- _dbus_string_set_length (result, orig_len);
- if (_dbus_string_get_length (&error_message) > 0)
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "%s terminated abnormally with the following error: %s",
- progpath, _dbus_string_get_data (&error_message));
- else
- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
- "%s terminated abnormally without any error message",
- progpath);
- goto out;
- }
-
- retval = TRUE;
-
- out:
- sigprocmask (SIG_SETMASK, &old_set, NULL);
-
- if (retval)
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- if (result_pipe[0] != -1)
- close (result_pipe[0]);
- if (result_pipe[1] != -1)
- close (result_pipe[1]);
- if (errors_pipe[0] != -1)
- close (errors_pipe[0]);
- if (errors_pipe[1] != -1)
- close (errors_pipe[1]);
-
- return retval;
-}
-#endif
-
-/**
- * Returns the address of a new session bus.
- *
- * If successful, returns #TRUE and appends the address to @p
- * address. If a failure happens, returns #FALSE and
- * sets an error in @p error.
- *
- * @param scope scope of autolaunch (Windows only)
- * @param address a DBusString where the address can be stored
- * @param error a DBusError to store the error in case of failure
- * @returns #TRUE on success, #FALSE if an error happened
- */
-dbus_bool_t
-_dbus_get_autolaunch_address (const char *scope,
- DBusString *address,
- DBusError *error)
-{
-#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
- /* Perform X11-based autolaunch. (We also support launchd-based autolaunch,
- * but that's done elsewhere, and if it worked, this function wouldn't
- * be called.) */
- const char *display;
- char *argv[6];
- int i;
- DBusString uuid;
- dbus_bool_t retval;
-
- if (_dbus_check_setuid ())
- {
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to autolaunch when setuid");
- return FALSE;
- }
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- retval = FALSE;
-
- /* fd.o #19997: if $DISPLAY isn't set to something useful, then
- * dbus-launch-x11 is just going to fail. Rather than trying to
- * run it, we might as well bail out early with a nice error. */
- display = _dbus_getenv ("DISPLAY");
-
- if (display == NULL || display[0] == '\0')
- {
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to autolaunch a dbus-daemon without a $DISPLAY for X11");
- return FALSE;
- }
-
- if (!_dbus_string_init (&uuid))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_get_local_machine_uuid_encoded (&uuid))
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- i = 0;
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (_dbus_getenv ("DBUS_USE_TEST_BINARY") != NULL)
- argv[i] = TEST_BUS_LAUNCH_BINARY;
- else
-#endif
- argv[i] = DBUS_BINDIR "/dbus-launch";
- ++i;
- argv[i] = "--autolaunch";
- ++i;
- argv[i] = _dbus_string_get_data (&uuid);
- ++i;
- argv[i] = "--binary-syntax";
- ++i;
- argv[i] = "--close-stderr";
- ++i;
- argv[i] = NULL;
- ++i;
-
- _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
-
- retval = _read_subprocess_line_argv (argv[0],
- TRUE,
- argv, address, error);
-
- out:
- _dbus_string_free (&uuid);
- return retval;
-#else
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Using X11 for dbus-daemon autolaunch was disabled at compile time, "
- "set your DBUS_SESSION_BUS_ADDRESS instead");
- return FALSE;
-#endif
-}
-
-/**
- * Reads the uuid of the machine we're running on from
- * the dbus configuration. Optionally try to create it
- * (only root can do this usually).
- *
- * On UNIX, reads a file that gets created by dbus-uuidgen
- * in a post-install script. On Windows, if there's a standard
- * machine uuid we could just use that, but I can't find one
- * with the right properties (the hardware profile guid can change
- * without rebooting I believe). If there's no standard one
- * we might want to use the registry instead of a file for
- * this, and I'm not sure how we'd ensure the uuid gets created.
- *
- * @param machine_id guid to init with the machine's uuid
- * @param create_if_not_found try to create the uuid if it doesn't exist
- * @param error the error return
- * @returns #FALSE if the error is set
- */
-dbus_bool_t
-_dbus_read_local_machine_uuid (DBusGUID *machine_id,
- dbus_bool_t create_if_not_found,
- DBusError *error)
-{
- DBusString filename;
- dbus_bool_t b;
-
- _dbus_string_init_const (&filename, DBUS_MACHINE_UUID_FILE);
-
- b = _dbus_read_uuid_file (&filename, machine_id, create_if_not_found, error);
- if (b)
- return TRUE;
-
- dbus_error_free (error);
-
- /* Fallback to the system machine ID */
- _dbus_string_init_const (&filename, "/etc/machine-id");
- return _dbus_read_uuid_file (&filename, machine_id, FALSE, error);
-}
-
-/**
- * quries launchd for a specific env var which holds the socket path.
- * @param socket_path append the socket path to this DBusString
- * @param launchd_env_var the env var to look up
- * @param error a DBusError to store the error in case of failure
- * @return the value of the env var
- */
-dbus_bool_t
-_dbus_lookup_launchd_socket (DBusString *socket_path,
- const char *launchd_env_var,
- DBusError *error)
-{
-#ifdef DBUS_ENABLE_LAUNCHD
- char *argv[4];
- int i;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (_dbus_check_setuid ())
- {
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to find launchd socket when setuid");
- return FALSE;
- }
-
- i = 0;
- argv[i] = "launchctl";
- ++i;
- argv[i] = "getenv";
- ++i;
- argv[i] = (char*)launchd_env_var;
- ++i;
- argv[i] = NULL;
- ++i;
-
- _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
-
- if (!_read_subprocess_line_argv(argv[0], TRUE, argv, socket_path, error))
- {
- return FALSE;
- }
-
- /* no error, but no result either */
- if (_dbus_string_get_length(socket_path) == 0)
- {
- return FALSE;
- }
-
- /* strip the carriage-return */
- _dbus_string_shorten(socket_path, 1);
- return TRUE;
-#else /* DBUS_ENABLE_LAUNCHD */
- dbus_set_error(error, DBUS_ERROR_NOT_SUPPORTED,
- "can't lookup socket from launchd; launchd support not compiled in");
- return FALSE;
-#endif
-}
-
-#ifdef DBUS_ENABLE_LAUNCHD
-static dbus_bool_t
-_dbus_lookup_session_address_launchd (DBusString *address, DBusError *error)
-{
- dbus_bool_t valid_socket;
- DBusString socket_path;
-
- if (_dbus_check_setuid ())
- {
- dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to find launchd socket when setuid");
- return FALSE;
- }
-
- if (!_dbus_string_init (&socket_path))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- valid_socket = _dbus_lookup_launchd_socket (&socket_path, "DBUS_LAUNCHD_SESSION_BUS_SOCKET", error);
-
- if (dbus_error_is_set(error))
- {
- _dbus_string_free(&socket_path);
- return FALSE;
- }
-
- if (!valid_socket)
- {
- dbus_set_error(error, "no socket path",
- "launchd did not provide a socket path, "
- "verify that org.freedesktop.dbus-session.plist is loaded!");
- _dbus_string_free(&socket_path);
- return FALSE;
- }
- if (!_dbus_string_append (address, "unix:path="))
- {
- _DBUS_SET_OOM (error);
- _dbus_string_free(&socket_path);
- return FALSE;
- }
- if (!_dbus_string_copy (&socket_path, 0, address,
- _dbus_string_get_length (address)))
- {
- _DBUS_SET_OOM (error);
- _dbus_string_free(&socket_path);
- return FALSE;
- }
-
- _dbus_string_free(&socket_path);
- return TRUE;
-}
-#endif
-
-/**
- * Determines the address of the session bus by querying a
- * platform-specific method.
- *
- * The first parameter will be a boolean specifying whether
- * or not a dynamic session lookup is supported on this platform.
- *
- * If supported is TRUE and the return value is #TRUE, the
- * address will be appended to @p address.
- * If a failure happens, returns #FALSE and sets an error in
- * @p error.
- *
- * If supported is FALSE, ignore the return value.
- *
- * @param supported returns whether this method is supported
- * @param address a DBusString where the address can be stored
- * @param error a DBusError to store the error in case of failure
- * @returns #TRUE on success, #FALSE if an error happened
- */
-dbus_bool_t
-_dbus_lookup_session_address (dbus_bool_t *supported,
- DBusString *address,
- DBusError *error)
-{
-#ifdef DBUS_ENABLE_LAUNCHD
- *supported = TRUE;
- return _dbus_lookup_session_address_launchd (address, error);
-#else
- /* On non-Mac Unix platforms, if the session address isn't already
- * set in DBUS_SESSION_BUS_ADDRESS environment variable, we punt and
- * fall back to the autolaunch: global default; see
- * init_session_address in dbus/dbus-bus.c. */
- *supported = FALSE;
- return TRUE;
-#endif
-}
-
-/**
- * Called when the bus daemon is signaled to reload its configuration; any
- * caches should be nuked. Of course any caches that need explicit reload
- * are probably broken, but c'est la vie.
- *
- *
- */
-void
-_dbus_flush_caches (void)
-{
- _dbus_user_database_flush_system ();
-}
-
-/**
- * Appends the directory in which a keyring for the given credentials
- * should be stored. The credentials should have either a Windows or
- * UNIX user in them. The directory should be an absolute path.
- *
- * On UNIX the directory is ~/.dbus-keyrings while on Windows it should probably
- * be something else, since the dotfile convention is not normal on Windows.
- *
- * @param directory string to append directory to
- * @param credentials credentials the directory should be for
- *
- * @returns #FALSE on no memory
- */
-dbus_bool_t
-_dbus_append_keyring_directory_for_credentials (DBusString *directory,
- DBusCredentials *credentials)
-{
- DBusString homedir;
- DBusString dotdir;
- dbus_uid_t uid;
-
- _dbus_assert (credentials != NULL);
- _dbus_assert (!_dbus_credentials_are_anonymous (credentials));
-
- if (!_dbus_string_init (&homedir))
- return FALSE;
-
- uid = _dbus_credentials_get_unix_uid (credentials);
- _dbus_assert (uid != DBUS_UID_UNSET);
-
- if (!_dbus_homedir_from_uid (uid, &homedir))
- goto failed;
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- {
- const char *override;
-
- override = _dbus_getenv ("DBUS_TEST_HOMEDIR");
- if (override != NULL && *override != '\0')
- {
- _dbus_string_set_length (&homedir, 0);
- if (!_dbus_string_append (&homedir, override))
- goto failed;
-
- _dbus_verbose ("Using fake homedir for testing: %s\n",
- _dbus_string_get_const_data (&homedir));
- }
- else
- {
- /* Not strictly thread-safe, but if we fail at thread-safety here,
- * the worst that will happen is some extra warnings. */
- static dbus_bool_t already_warned = FALSE;
- if (!already_warned)
- {
- _dbus_warn ("Using your real home directory for testing, set DBUS_TEST_HOMEDIR to avoid\n");
- already_warned = TRUE;
- }
- }
- }
-#endif
-
- _dbus_string_init_const (&dotdir, ".dbus-keyrings");
- if (!_dbus_concat_dir_and_file (&homedir,
- &dotdir))
- goto failed;
-
- if (!_dbus_string_copy (&homedir, 0,
- directory, _dbus_string_get_length (directory))) {
- goto failed;
- }
-
- _dbus_string_free (&homedir);
- return TRUE;
-
- failed:
- _dbus_string_free (&homedir);
- return FALSE;
-}
-
-//PENDING(kdab) docs
-dbus_bool_t
-_dbus_daemon_publish_session_bus_address (const char* addr,
- const char *scope)
-{
- return TRUE;
-}
-
-//PENDING(kdab) docs
-void
-_dbus_daemon_unpublish_session_bus_address (void)
-{
-
-}
-
-/**
- * See if errno is EAGAIN or EWOULDBLOCK (this has to be done differently
- * for Winsock so is abstracted)
- *
- * @returns #TRUE if errno == EAGAIN or errno == EWOULDBLOCK
- */
-dbus_bool_t
-_dbus_get_is_errno_eagain_or_ewouldblock (void)
-{
- return errno == EAGAIN || errno == EWOULDBLOCK;
-}
-
-/**
- * Removes a directory; Directory must be empty
- *
- * @param filename directory filename
- * @param error initialized error object
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_delete_directory (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (rmdir (filename_c) != 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to remove directory %s: %s\n",
- filename_c, _dbus_strerror (errno));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Checks whether file descriptors may be passed via the socket
- *
- * @param fd the socket
- * @return TRUE when fd passing over this socket is supported
- *
- */
-dbus_bool_t
-_dbus_socket_can_pass_unix_fd(int fd) {
-
-#ifdef SCM_RIGHTS
- union {
- struct sockaddr sa;
- struct sockaddr_storage storage;
- struct sockaddr_un un;
- } sa_buf;
-
- socklen_t sa_len = sizeof(sa_buf);
-
- _DBUS_ZERO(sa_buf);
-
- if (getsockname(fd, &sa_buf.sa, &sa_len) < 0)
- return FALSE;
-
- return sa_buf.sa.sa_family == AF_UNIX;
-
-#else
- return FALSE;
-
-#endif
-}
-
-/**
- * Closes all file descriptors except the first three (i.e. stdin,
- * stdout, stderr).
- */
-void
-_dbus_close_all (void)
-{
- int maxfds, i;
-
-#ifdef __linux__
- DIR *d;
-
- /* On Linux we can optimize this a bit if /proc is available. If it
- isn't available, fall back to the brute force way. */
-
- d = opendir ("/proc/self/fd");
- if (d)
- {
- for (;;)
- {
- struct dirent buf, *de;
- int k, fd;
- long l;
- char *e = NULL;
-
- k = readdir_r (d, &buf, &de);
- if (k != 0 || !de)
- break;
-
- if (de->d_name[0] == '.')
- continue;
-
- errno = 0;
- l = strtol (de->d_name, &e, 10);
- if (errno != 0 || e == NULL || *e != '\0')
- continue;
-
- fd = (int) l;
- if (fd < 3)
- continue;
-
- if (fd == dirfd (d))
- continue;
-
- close (fd);
- }
-
- closedir (d);
- return;
- }
-#endif
-
- maxfds = sysconf (_SC_OPEN_MAX);
-
- /* Pick something reasonable if for some reason sysconf says
- * unlimited.
- */
- if (maxfds < 0)
- maxfds = 1024;
-
- /* close all inherited fds */
- for (i = 3; i < maxfds; i++)
- close (i);
-}
-
-/**
- * **NOTE**: If you modify this function, please also consider making
- * the corresponding change in GLib. See
- * glib/gutils.c:g_check_setuid().
- *
- * Returns TRUE if the current process was executed as setuid (or an
- * equivalent __libc_enable_secure is available). See:
- * http://osdir.com/ml/linux.lfs.hardened/2007-04/msg00032.html
- */
-dbus_bool_t
-_dbus_check_setuid (void)
-{
- /* TODO: get __libc_enable_secure exported from glibc.
- * See http://www.openwall.com/lists/owl-dev/2012/08/14/1
- */
-#if 0 && defined(HAVE_LIBC_ENABLE_SECURE)
- {
- /* See glibc/include/unistd.h */
- extern int __libc_enable_secure;
- return __libc_enable_secure;
- }
-#elif defined(HAVE_ISSETUGID)
- /* BSD: http://www.freebsd.org/cgi/man.cgi?query=issetugid&sektion=2 */
- return issetugid ();
-#else
- uid_t ruid, euid, suid; /* Real, effective and saved user ID's */
- gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */
-
- /* We call into this function from _dbus_threads_init_platform_specific()
- * to make sure these are initialized before we start threading. */
- static dbus_bool_t check_setuid_initialised;
- static dbus_bool_t is_setuid;
-
- if (_DBUS_UNLIKELY (!check_setuid_initialised))
- {
-#ifdef HAVE_GETRESUID
- if (getresuid (&ruid, &euid, &suid) != 0 ||
- getresgid (&rgid, &egid, &sgid) != 0)
-#endif /* HAVE_GETRESUID */
- {
- suid = ruid = getuid ();
- sgid = rgid = getgid ();
- euid = geteuid ();
- egid = getegid ();
- }
-
- check_setuid_initialised = TRUE;
- is_setuid = (ruid != euid || ruid != suid ||
- rgid != egid || rgid != sgid);
-
- }
- return is_setuid;
-#endif
-}
-
-/**
- * Read the address from the socket and append it to the string
- *
- * @param fd the socket
- * @param address
- * @param error return location for error code
- */
-dbus_bool_t
-_dbus_append_address_from_socket (int fd,
- DBusString *address,
- DBusError *error)
-{
- union {
- struct sockaddr sa;
- struct sockaddr_storage storage;
- struct sockaddr_un un;
- struct sockaddr_in ipv4;
- struct sockaddr_in6 ipv6;
- } socket;
- char hostip[INET6_ADDRSTRLEN];
- int size = sizeof (socket);
-
- if (getsockname (fd, &socket.sa, &size))
- goto err;
-
- switch (socket.sa.sa_family)
- {
- case AF_UNIX:
- if (socket.un.sun_path[0]=='\0')
- {
- if (_dbus_string_append_printf (address, "unix:abstract=%s", &(socket.un.sun_path[1])))
- return TRUE;
- }
- else
- {
- if (_dbus_string_append_printf (address, "unix:path=%s", socket.un.sun_path))
- return TRUE;
- }
- break;
- case AF_INET:
- if (inet_ntop (AF_INET, &socket.ipv4.sin_addr, hostip, sizeof (hostip)))
- if (_dbus_string_append_printf (address, "tcp:family=ipv4,host=%s,port=%u",
- hostip, ntohs (socket.ipv4.sin_port)))
- return TRUE;
- break;
-#ifdef AF_INET6
- case AF_INET6:
- if (inet_ntop (AF_INET6, &socket.ipv6.sin6_addr, hostip, sizeof (hostip)))
- if (_dbus_string_append_printf (address, "tcp:family=ipv6,host=%s,port=%u",
- hostip, ntohs (socket.ipv6.sin6_port)))
- return TRUE;
- break;
-#endif
- default:
- dbus_set_error (error,
- _dbus_error_from_errno (EINVAL),
- "Failed to read address from socket: Unknown socket type.");
- return FALSE;
- }
- err:
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to open socket: %s",
- _dbus_strerror (errno));
- return FALSE;
-}
-
-/* tests in dbus-sysdeps-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.h
deleted file mode 100644
index a265b335cb..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-unix.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-unix.h UNIX-specific wrappers around system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SYSDEPS_UNIX_H
-#define DBUS_SYSDEPS_UNIX_H
-
-#include <dbus/dbus-sysdeps.h>
-
-#ifdef DBUS_WIN
-#error "Don't include this on Windows"
-#endif
-
-DBUS_BEGIN_DECLS
-
-/**
- * @defgroup DBusSysdepsUnix UNIX-specific internal API
- * @ingroup DBusInternals
- * @brief Internal system-dependent API available on UNIX only
- * @{
- */
-
-dbus_bool_t
-_dbus_close (int fd,
- DBusError *error);
-int _dbus_dup (int fd,
- DBusError *error);
-int
-_dbus_read (int fd,
- DBusString *buffer,
- int count);
-int
-_dbus_write (int fd,
- const DBusString *buffer,
- int start,
- int len);
-int
-_dbus_write_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2);
-
-int _dbus_connect_unix_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error);
-int _dbus_listen_unix_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error);
-
-int _dbus_connect_exec (const char *path,
- char *const argv[],
- DBusError *error);
-
-int _dbus_listen_systemd_sockets (int **fd,
- DBusError *error);
-
-dbus_bool_t _dbus_read_credentials (int client_fd,
- DBusCredentials *credentials,
- DBusError *error);
-dbus_bool_t _dbus_send_credentials (int server_fd,
- DBusError *error);
-
-dbus_bool_t _dbus_lookup_launchd_socket (DBusString *socket_path,
- const char *launchd_env_var,
- DBusError *error);
-
-/** Information about a UNIX user */
-typedef struct DBusUserInfo DBusUserInfo;
-/** Information about a UNIX group */
-typedef struct DBusGroupInfo DBusGroupInfo;
-
-/**
- * Information about a UNIX user
- */
-struct DBusUserInfo
-{
- dbus_uid_t uid; /**< UID */
- dbus_gid_t primary_gid; /**< GID */
- dbus_gid_t *group_ids; /**< Groups IDs, *including* above primary group */
- int n_group_ids; /**< Size of group IDs array */
- char *username; /**< Username */
- char *homedir; /**< Home directory */
-};
-
-/**
- * Information about a UNIX group
- */
-struct DBusGroupInfo
-{
- dbus_gid_t gid; /**< GID */
- char *groupname; /**< Group name */
-};
-
-dbus_bool_t _dbus_user_info_fill (DBusUserInfo *info,
- const DBusString *username,
- DBusError *error);
-dbus_bool_t _dbus_user_info_fill_uid (DBusUserInfo *info,
- dbus_uid_t uid,
- DBusError *error);
-void _dbus_user_info_free (DBusUserInfo *info);
-
-dbus_bool_t _dbus_group_info_fill (DBusGroupInfo *info,
- const DBusString *groupname,
- DBusError *error);
-dbus_bool_t _dbus_group_info_fill_gid (DBusGroupInfo *info,
- dbus_gid_t gid,
- DBusError *error);
-void _dbus_group_info_free (DBusGroupInfo *info);
-
-dbus_uid_t _dbus_getuid (void);
-dbus_uid_t _dbus_geteuid (void);
-
-dbus_bool_t _dbus_parse_uid (const DBusString *uid_str,
- dbus_uid_t *uid);
-
-void _dbus_close_all (void);
-
-dbus_bool_t _dbus_append_address_from_socket (int fd,
- DBusString *address,
- DBusError *error);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SYSDEPS_UNIX_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-unix.c
deleted file mode 100644
index 0d8a66c714..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-unix.c
+++ /dev/null
@@ -1,1358 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-util-unix.c Would be in dbus-sysdeps-unix.c, but not used in libdbus
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-unix.h"
-#include "dbus-internals.h"
-#include "dbus-pipe.h"
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#define DBUS_USERDB_INCLUDES_PRIVATE 1
-#include "dbus-userdb.h"
-#include "dbus-test.h"
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#include <grp.h>
-#include <sys/socket.h>
-#include <dirent.h>
-#include <sys/un.h>
-
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-#endif
-
-#ifdef HAVE_SYS_SYSLIMITS_H
-#include <sys/syslimits.h>
-#endif
-
-#include "sd-daemon.h"
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-
-/**
- * Does the chdir, fork, setsid, etc. to become a daemon process.
- *
- * @param pidfile #NULL, or pidfile to create
- * @param print_pid_pipe pipe to print daemon's pid to, or -1 for none
- * @param error return location for errors
- * @param keep_umask #TRUE to keep the original umask
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_become_daemon (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- DBusError *error,
- dbus_bool_t keep_umask)
-{
- const char *s;
- pid_t child_pid;
- int dev_null_fd;
-
- _dbus_verbose ("Becoming a daemon...\n");
-
- _dbus_verbose ("chdir to /\n");
- if (chdir ("/") < 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Could not chdir() to root directory");
- return FALSE;
- }
-
- _dbus_verbose ("forking...\n");
- switch ((child_pid = fork ()))
- {
- case -1:
- _dbus_verbose ("fork failed\n");
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to fork daemon: %s", _dbus_strerror (errno));
- return FALSE;
- break;
-
- case 0:
- _dbus_verbose ("in child, closing std file descriptors\n");
-
- /* silently ignore failures here, if someone
- * doesn't have /dev/null we may as well try
- * to continue anyhow
- */
-
- dev_null_fd = open ("/dev/null", O_RDWR);
- if (dev_null_fd >= 0)
- {
- dup2 (dev_null_fd, 0);
- dup2 (dev_null_fd, 1);
-
- s = _dbus_getenv ("DBUS_DEBUG_OUTPUT");
- if (s == NULL || *s == '\0')
- dup2 (dev_null_fd, 2);
- else
- _dbus_verbose ("keeping stderr open due to DBUS_DEBUG_OUTPUT\n");
- close (dev_null_fd);
- }
-
- if (!keep_umask)
- {
- /* Get a predictable umask */
- _dbus_verbose ("setting umask\n");
- umask (022);
- }
-
- _dbus_verbose ("calling setsid()\n");
- if (setsid () == -1)
- _dbus_assert_not_reached ("setsid() failed");
-
- break;
-
- default:
- if (!_dbus_write_pid_to_file_and_pipe (pidfile, print_pid_pipe,
- child_pid, error))
- {
- _dbus_verbose ("pid file or pipe write failed: %s\n",
- error->message);
- kill (child_pid, SIGTERM);
- return FALSE;
- }
-
- _dbus_verbose ("parent exiting\n");
- _exit (0);
- break;
- }
-
- return TRUE;
-}
-
-
-/**
- * Creates a file containing the process ID.
- *
- * @param filename the filename to write to
- * @param pid our process ID
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-static dbus_bool_t
-_dbus_write_pid_file (const DBusString *filename,
- unsigned long pid,
- DBusError *error)
-{
- const char *cfilename;
- int fd;
- FILE *f;
-
- cfilename = _dbus_string_get_const_data (filename);
-
- fd = open (cfilename, O_WRONLY|O_CREAT|O_EXCL|O_BINARY, 0644);
-
- if (fd < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to open \"%s\": %s", cfilename,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- if ((f = fdopen (fd, "w")) == NULL)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to fdopen fd %d: %s", fd, _dbus_strerror (errno));
- _dbus_close (fd, NULL);
- return FALSE;
- }
-
- if (fprintf (f, "%lu\n", pid) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to write to \"%s\": %s", cfilename,
- _dbus_strerror (errno));
-
- fclose (f);
- return FALSE;
- }
-
- if (fclose (f) == EOF)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to close \"%s\": %s", cfilename,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Writes the given pid_to_write to a pidfile (if non-NULL) and/or to a
- * pipe (if non-NULL). Does nothing if pidfile and print_pid_pipe are both
- * NULL.
- *
- * @param pidfile the file to write to or #NULL
- * @param print_pid_pipe the pipe to write to or #NULL
- * @param pid_to_write the pid to write out
- * @param error error on failure
- * @returns FALSE if error is set
- */
-dbus_bool_t
-_dbus_write_pid_to_file_and_pipe (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- dbus_pid_t pid_to_write,
- DBusError *error)
-{
- if (pidfile)
- {
- _dbus_verbose ("writing pid file %s\n", _dbus_string_get_const_data (pidfile));
- if (!_dbus_write_pid_file (pidfile,
- pid_to_write,
- error))
- {
- _dbus_verbose ("pid file write failed\n");
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return FALSE;
- }
- }
- else
- {
- _dbus_verbose ("No pid file requested\n");
- }
-
- if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe))
- {
- DBusString pid;
- int bytes;
-
- _dbus_verbose ("writing our pid to pipe %d\n",
- print_pid_pipe->fd);
-
- if (!_dbus_string_init (&pid))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append_int (&pid, pid_to_write) ||
- !_dbus_string_append (&pid, "\n"))
- {
- _dbus_string_free (&pid);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- bytes = _dbus_string_get_length (&pid);
- if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes)
- {
- /* _dbus_pipe_write sets error only on failure, not short write */
- if (error != NULL && !dbus_error_is_set(error))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Printing message bus PID: did not write enough bytes\n");
- }
- _dbus_string_free (&pid);
- return FALSE;
- }
-
- _dbus_string_free (&pid);
- }
- else
- {
- _dbus_verbose ("No pid pipe to write to\n");
- }
-
- return TRUE;
-}
-
-/**
- * Verify that after the fork we can successfully change to this user.
- *
- * @param user the username given in the daemon configuration
- * @returns #TRUE if username is valid
- */
-dbus_bool_t
-_dbus_verify_daemon_user (const char *user)
-{
- DBusString u;
-
- _dbus_string_init_const (&u, user);
-
- return _dbus_get_user_id_and_primary_group (&u, NULL, NULL);
-}
-
-
-/* The HAVE_LIBAUDIT case lives in selinux.c */
-#ifndef HAVE_LIBAUDIT
-/**
- * Changes the user and group the bus is running as.
- *
- * @param user the user to become
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_change_to_daemon_user (const char *user,
- DBusError *error)
-{
- dbus_uid_t uid;
- dbus_gid_t gid;
- DBusString u;
-
- _dbus_string_init_const (&u, user);
-
- if (!_dbus_get_user_id_and_primary_group (&u, &uid, &gid))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "User '%s' does not appear to exist?",
- user);
- return FALSE;
- }
-
- /* setgroups() only works if we are a privileged process,
- * so we don't return error on failure; the only possible
- * failure is that we don't have perms to do it.
- *
- * not sure this is right, maybe if setuid()
- * is going to work then setgroups() should also work.
- */
- if (setgroups (0, NULL) < 0)
- _dbus_warn ("Failed to drop supplementary groups: %s\n",
- _dbus_strerror (errno));
-
- /* Set GID first, or the setuid may remove our permission
- * to change the GID
- */
- if (setgid (gid) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set GID to %lu: %s", gid,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- if (setuid (uid) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set UID to %lu: %s", uid,
- _dbus_strerror (errno));
- return FALSE;
- }
-
- return TRUE;
-}
-#endif /* !HAVE_LIBAUDIT */
-
-
-/**
- * Attempt to ensure that the current process can open
- * at least @p limit file descriptors.
- *
- * If @p limit is lower than the current, it will not be
- * lowered. No error is returned if the request can
- * not be satisfied.
- *
- * @param limit number of file descriptors
- */
-void
-_dbus_request_file_descriptor_limit (unsigned int limit)
-{
-#ifdef HAVE_SETRLIMIT
- struct rlimit lim;
- struct rlimit target_lim;
-
- /* No point to doing this practically speaking
- * if we're not uid 0. We expect the system
- * bus to use this before we change UID, and
- * the session bus takes the Linux default
- * of 1024 for both cur and max.
- */
- if (getuid () != 0)
- return;
-
- if (getrlimit (RLIMIT_NOFILE, &lim) < 0)
- return;
-
- if (lim.rlim_cur >= limit)
- return;
-
- /* Ignore "maximum limit", assume we have the "superuser"
- * privileges. On Linux this is CAP_SYS_RESOURCE.
- */
- target_lim.rlim_cur = target_lim.rlim_max = limit;
- /* Also ignore errors; if we fail, we will at least work
- * up to whatever limit we had, which seems better than
- * just outright aborting.
- *
- * However, in the future we should probably log this so OS builders
- * have a chance to notice any misconfiguration like dbus-daemon
- * being started without CAP_SYS_RESOURCE.
- */
- setrlimit (RLIMIT_NOFILE, &target_lim);
-#endif
-}
-
-void
-_dbus_init_system_log (dbus_bool_t is_daemon)
-{
-#ifdef HAVE_SYSLOG_H
- int logopts = LOG_PID;
-
-#if HAVE_DECL_LOG_PERROR
-#ifdef HAVE_SYSTEMD
- if (!is_daemon || sd_booted () <= 0)
-#endif
- logopts |= LOG_PERROR;
-#endif
-
- openlog ("dbus", logopts, LOG_DAEMON);
-#endif
-}
-
-/**
- * Log a message to the system log file (e.g. syslog on Unix).
- *
- * @param severity a severity value
- * @param msg a printf-style format string
- */
-void
-_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
-{
- va_list args;
-
- va_start (args, msg);
-
- _dbus_system_logv (severity, msg, args);
-
- va_end (args);
-}
-
-/**
- * Log a message to the system log file (e.g. syslog on Unix).
- *
- * @param severity a severity value
- * @param msg a printf-style format string
- * @param args arguments for the format string
- *
- * If the FATAL severity is given, this function will terminate the program
- * with an error code.
- */
-void
-_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
-{
- va_list tmp;
-#ifdef HAVE_SYSLOG_H
- int flags;
- switch (severity)
- {
- case DBUS_SYSTEM_LOG_INFO:
- flags = LOG_DAEMON | LOG_NOTICE;
- break;
- case DBUS_SYSTEM_LOG_SECURITY:
- flags = LOG_AUTH | LOG_NOTICE;
- break;
- case DBUS_SYSTEM_LOG_FATAL:
- flags = LOG_DAEMON|LOG_CRIT;
- break;
- default:
- return;
- }
-
- DBUS_VA_COPY (tmp, args);
- vsyslog (flags, msg, tmp);
- va_end (tmp);
-#endif
-
-#if !defined(HAVE_SYSLOG_H) || !HAVE_DECL_LOG_PERROR
- {
- /* vsyslog() won't write to stderr, so we'd better do it */
- DBUS_VA_COPY (tmp, args);
- fprintf (stderr, "dbus[" DBUS_PID_FORMAT "]: ", _dbus_getpid ());
- vfprintf (stderr, msg, tmp);
- fputc ('\n', stderr);
- va_end (tmp);
- }
-#endif
-
- if (severity == DBUS_SYSTEM_LOG_FATAL)
- exit (1);
-}
-
-/** Installs a UNIX signal handler
- *
- * @param sig the signal to handle
- * @param handler the handler
- */
-void
-_dbus_set_signal_handler (int sig,
- DBusSignalHandler handler)
-{
- struct sigaction act;
- sigset_t empty_mask;
-
- sigemptyset (&empty_mask);
- act.sa_handler = handler;
- act.sa_mask = empty_mask;
- act.sa_flags = 0;
- sigaction (sig, &act, NULL);
-}
-
-/** Checks if a file exists
-*
-* @param file full path to the file
-* @returns #TRUE if file exists
-*/
-dbus_bool_t
-_dbus_file_exists (const char *file)
-{
- return (access (file, F_OK) == 0);
-}
-
-/** Checks if user is at the console
-*
-* @param username user to check
-* @param error return location for errors
-* @returns #TRUE is the user is at the consolei and there are no errors
-*/
-dbus_bool_t
-_dbus_user_at_console (const char *username,
- DBusError *error)
-{
-
- DBusString u, f;
- dbus_bool_t result;
-
- result = FALSE;
- if (!_dbus_string_init (&f))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append (&f, DBUS_CONSOLE_AUTH_DIR))
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- _dbus_string_init_const (&u, username);
-
- if (!_dbus_concat_dir_and_file (&f, &u))
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
-
- result = _dbus_file_exists (_dbus_string_get_const_data (&f));
-
- out:
- _dbus_string_free (&f);
-
- return result;
-}
-
-
-/**
- * Checks whether the filename is an absolute path
- *
- * @param filename the filename
- * @returns #TRUE if an absolute path
- */
-dbus_bool_t
-_dbus_path_is_absolute (const DBusString *filename)
-{
- if (_dbus_string_get_length (filename) > 0)
- return _dbus_string_get_byte (filename, 0) == '/';
- else
- return FALSE;
-}
-
-/**
- * stat() wrapper.
- *
- * @param filename the filename to stat
- * @param statbuf the stat info to fill in
- * @param error return location for error
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-_dbus_stat (const DBusString *filename,
- DBusStat *statbuf,
- DBusError *error)
-{
- const char *filename_c;
- struct stat sb;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (stat (filename_c, &sb) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "%s", _dbus_strerror (errno));
- return FALSE;
- }
-
- statbuf->mode = sb.st_mode;
- statbuf->nlink = sb.st_nlink;
- statbuf->uid = sb.st_uid;
- statbuf->gid = sb.st_gid;
- statbuf->size = sb.st_size;
- statbuf->atime = sb.st_atime;
- statbuf->mtime = sb.st_mtime;
- statbuf->ctime = sb.st_ctime;
-
- return TRUE;
-}
-
-
-/**
- * Internals of directory iterator
- */
-struct DBusDirIter
-{
- DIR *d; /**< The DIR* from opendir() */
-
-};
-
-/**
- * Open a directory to iterate over.
- *
- * @param filename the directory name
- * @param error exception return object or #NULL
- * @returns new iterator, or #NULL on error
- */
-DBusDirIter*
-_dbus_directory_open (const DBusString *filename,
- DBusError *error)
-{
- DIR *d;
- DBusDirIter *iter;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- d = opendir (filename_c);
- if (d == NULL)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to read directory \"%s\": %s",
- filename_c,
- _dbus_strerror (errno));
- return NULL;
- }
- iter = dbus_new0 (DBusDirIter, 1);
- if (iter == NULL)
- {
- closedir (d);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Could not allocate memory for directory iterator");
- return NULL;
- }
-
- iter->d = d;
-
- return iter;
-}
-
-/**
- * Get next file in the directory. Will not return "." or ".." on
- * UNIX. If an error occurs, the contents of "filename" are
- * undefined. The error is never set if the function succeeds.
- *
- * This function is not re-entrant, and not necessarily thread-safe.
- * Only use it for test code or single-threaded utilities.
- *
- * @param iter the iterator
- * @param filename string to be set to the next file in the dir
- * @param error return location for error
- * @returns #TRUE if filename was filled in with a new filename
- */
-dbus_bool_t
-_dbus_directory_get_next_file (DBusDirIter *iter,
- DBusString *filename,
- DBusError *error)
-{
- struct dirent *ent;
- int err;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- again:
- errno = 0;
- ent = readdir (iter->d);
-
- if (!ent)
- {
- err = errno;
-
- if (err != 0)
- dbus_set_error (error,
- _dbus_error_from_errno (err),
- "%s", _dbus_strerror (err));
-
- return FALSE;
- }
- else if (ent->d_name[0] == '.' &&
- (ent->d_name[1] == '\0' ||
- (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
- goto again;
- else
- {
- _dbus_string_set_length (filename, 0);
- if (!_dbus_string_append (filename, ent->d_name))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "No memory to read directory entry");
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- }
-}
-
-/**
- * Closes a directory iteration.
- */
-void
-_dbus_directory_close (DBusDirIter *iter)
-{
- closedir (iter->d);
- dbus_free (iter);
-}
-
-static dbus_bool_t
-fill_user_info_from_group (struct group *g,
- DBusGroupInfo *info,
- DBusError *error)
-{
- _dbus_assert (g->gr_name != NULL);
-
- info->gid = g->gr_gid;
- info->groupname = _dbus_strdup (g->gr_name);
-
- /* info->members = dbus_strdupv (g->gr_mem) */
-
- if (info->groupname == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-fill_group_info (DBusGroupInfo *info,
- dbus_gid_t gid,
- const DBusString *groupname,
- DBusError *error)
-{
- const char *group_c_str;
-
- _dbus_assert (groupname != NULL || gid != DBUS_GID_UNSET);
- _dbus_assert (groupname == NULL || gid == DBUS_GID_UNSET);
-
- if (groupname)
- group_c_str = _dbus_string_get_const_data (groupname);
- else
- group_c_str = NULL;
-
- /* For now assuming that the getgrnam() and getgrgid() flavors
- * always correspond to the pwnam flavors, if not we have
- * to add more configure checks.
- */
-
-#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
- {
- struct group *g;
- int result;
- size_t buflen;
- char *buf;
- struct group g_str;
- dbus_bool_t b;
-
- /* retrieve maximum needed size for buf */
- buflen = sysconf (_SC_GETGR_R_SIZE_MAX);
-
- /* sysconf actually returns a long, but everything else expects size_t,
- * so just recast here.
- * https://bugs.freedesktop.org/show_bug.cgi?id=17061
- */
- if ((long) buflen <= 0)
- buflen = 1024;
-
- result = -1;
- while (1)
- {
- buf = dbus_malloc (buflen);
- if (buf == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
- }
-
- g = NULL;
-#ifdef HAVE_POSIX_GETPWNAM_R
- if (group_c_str)
- result = getgrnam_r (group_c_str, &g_str, buf, buflen,
- &g);
- else
- result = getgrgid_r (gid, &g_str, buf, buflen,
- &g);
-#else
- g = getgrnam_r (group_c_str, &g_str, buf, buflen);
- result = 0;
-#endif /* !HAVE_POSIX_GETPWNAM_R */
- /* Try a bigger buffer if ERANGE was returned:
- https://bugs.freedesktop.org/show_bug.cgi?id=16727
- */
- if (result == ERANGE && buflen < 512 * 1024)
- {
- dbus_free (buf);
- buflen *= 2;
- }
- else
- {
- break;
- }
- }
-
- if (result == 0 && g == &g_str)
- {
- b = fill_user_info_from_group (g, info, error);
- dbus_free (buf);
- return b;
- }
- else
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Group %s unknown or failed to look it up\n",
- group_c_str ? group_c_str : "???");
- dbus_free (buf);
- return FALSE;
- }
- }
-#else /* ! HAVE_GETPWNAM_R */
- {
- /* I guess we're screwed on thread safety here */
- struct group *g;
-
- g = getgrnam (group_c_str);
-
- if (g != NULL)
- {
- return fill_user_info_from_group (g, info, error);
- }
- else
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Group %s unknown or failed to look it up\n",
- group_c_str ? group_c_str : "???");
- return FALSE;
- }
- }
-#endif /* ! HAVE_GETPWNAM_R */
-}
-
-/**
- * Initializes the given DBusGroupInfo struct
- * with information about the given group name.
- *
- * @param info the group info struct
- * @param groupname name of group
- * @param error the error return
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_group_info_fill (DBusGroupInfo *info,
- const DBusString *groupname,
- DBusError *error)
-{
- return fill_group_info (info, DBUS_GID_UNSET,
- groupname, error);
-
-}
-
-/**
- * Initializes the given DBusGroupInfo struct
- * with information about the given group ID.
- *
- * @param info the group info struct
- * @param gid group ID
- * @param error the error return
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_group_info_fill_gid (DBusGroupInfo *info,
- dbus_gid_t gid,
- DBusError *error)
-{
- return fill_group_info (info, gid, NULL, error);
-}
-
-/**
- * Parse a UNIX user from the bus config file. On Windows, this should
- * simply always fail (just return #FALSE).
- *
- * @param username the username text
- * @param uid_p place to return the uid
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_parse_unix_user_from_config (const DBusString *username,
- dbus_uid_t *uid_p)
-{
- return _dbus_get_user_id (username, uid_p);
-
-}
-
-/**
- * Parse a UNIX group from the bus config file. On Windows, this should
- * simply always fail (just return #FALSE).
- *
- * @param groupname the groupname text
- * @param gid_p place to return the gid
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_parse_unix_group_from_config (const DBusString *groupname,
- dbus_gid_t *gid_p)
-{
- return _dbus_get_group_id (groupname, gid_p);
-}
-
-/**
- * Gets all groups corresponding to the given UNIX user ID. On UNIX,
- * just calls _dbus_groups_from_uid(). On Windows, should always
- * fail since we don't know any UNIX groups.
- *
- * @param uid the UID
- * @param group_ids return location for array of group IDs
- * @param n_group_ids return location for length of returned array
- * @returns #TRUE if the UID existed and we got some credentials
- */
-dbus_bool_t
-_dbus_unix_groups_from_uid (dbus_uid_t uid,
- dbus_gid_t **group_ids,
- int *n_group_ids)
-{
- return _dbus_groups_from_uid (uid, group_ids, n_group_ids);
-}
-
-/**
- * Checks to see if the UNIX user ID is at the console.
- * Should always fail on Windows (set the error to
- * #DBUS_ERROR_NOT_SUPPORTED).
- *
- * @param uid UID of person to check
- * @param error return location for errors
- * @returns #TRUE if the UID is the same as the console user and there are no errors
- */
-dbus_bool_t
-_dbus_unix_user_is_at_console (dbus_uid_t uid,
- DBusError *error)
-{
- return _dbus_is_console_user (uid, error);
-
-}
-
-/**
- * Checks to see if the UNIX user ID matches the UID of
- * the process. Should always return #FALSE on Windows.
- *
- * @param uid the UNIX user ID
- * @returns #TRUE if this uid owns the process.
- */
-dbus_bool_t
-_dbus_unix_user_is_process_owner (dbus_uid_t uid)
-{
- return uid == _dbus_geteuid ();
-}
-
-/**
- * Checks to see if the Windows user SID matches the owner of
- * the process. Should always return #FALSE on UNIX.
- *
- * @param windows_sid the Windows user SID
- * @returns #TRUE if this user owns the process.
- */
-dbus_bool_t
-_dbus_windows_user_is_process_owner (const char *windows_sid)
-{
- return FALSE;
-}
-
-/** @} */ /* End of DBusInternalsUtils functions */
-
-/**
- * @addtogroup DBusString
- *
- * @{
- */
-/**
- * Get the directory name from a complete filename
- * @param filename the filename
- * @param dirname string to append directory name to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_get_dirname (const DBusString *filename,
- DBusString *dirname)
-{
- int sep;
-
- _dbus_assert (filename != dirname);
- _dbus_assert (filename != NULL);
- _dbus_assert (dirname != NULL);
-
- /* Ignore any separators on the end */
- sep = _dbus_string_get_length (filename);
- if (sep == 0)
- return _dbus_string_append (dirname, "."); /* empty string passed in */
-
- while (sep > 0 && _dbus_string_get_byte (filename, sep - 1) == '/')
- --sep;
-
- _dbus_assert (sep >= 0);
-
- if (sep == 0)
- return _dbus_string_append (dirname, "/");
-
- /* Now find the previous separator */
- _dbus_string_find_byte_backward (filename, sep, '/', &sep);
- if (sep < 0)
- return _dbus_string_append (dirname, ".");
-
- /* skip multiple separators */
- while (sep > 0 && _dbus_string_get_byte (filename, sep - 1) == '/')
- --sep;
-
- _dbus_assert (sep >= 0);
-
- if (sep == 0 &&
- _dbus_string_get_byte (filename, 0) == '/')
- return _dbus_string_append (dirname, "/");
- else
- return _dbus_string_copy_len (filename, 0, sep - 0,
- dirname, _dbus_string_get_length (dirname));
-}
-/** @} */ /* DBusString stuff */
-
-static void
-string_squash_nonprintable (DBusString *str)
-{
- unsigned char *buf;
- int i, len;
-
- buf = _dbus_string_get_data (str);
- len = _dbus_string_get_length (str);
-
- for (i = 0; i < len; i++)
- {
- unsigned char c = (unsigned char) buf[i];
- if (c == '\0')
- buf[i] = ' ';
- else if (c < 0x20 || c > 127)
- buf[i] = '?';
- }
-}
-
-/**
- * Get a printable string describing the command used to execute
- * the process with pid. This string should only be used for
- * informative purposes such as logging; it may not be trusted.
- *
- * The command is guaranteed to be printable ASCII and no longer
- * than max_len.
- *
- * @param pid Process id
- * @param str Append command to this string
- * @param max_len Maximum length of returned command
- * @param error return location for errors
- * @returns #FALSE on error
- */
-dbus_bool_t
-_dbus_command_for_pid (unsigned long pid,
- DBusString *str,
- int max_len,
- DBusError *error)
-{
- /* This is all Linux-specific for now */
- DBusString path;
- DBusString cmdline;
- int fd;
-
- if (!_dbus_string_init (&path))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_init (&cmdline))
- {
- _DBUS_SET_OOM (error);
- _dbus_string_free (&path);
- return FALSE;
- }
-
- if (!_dbus_string_append_printf (&path, "/proc/%ld/cmdline", pid))
- goto oom;
-
- fd = open (_dbus_string_get_const_data (&path), O_RDONLY);
- if (fd < 0)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to open \"%s\": %s",
- _dbus_string_get_const_data (&path),
- _dbus_strerror (errno));
- goto fail;
- }
-
- if (!_dbus_read (fd, &cmdline, max_len))
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to read from \"%s\": %s",
- _dbus_string_get_const_data (&path),
- _dbus_strerror (errno));
- _dbus_close (fd, NULL);
- goto fail;
- }
-
- if (!_dbus_close (fd, error))
- goto fail;
-
- string_squash_nonprintable (&cmdline);
-
- if (!_dbus_string_copy (&cmdline, 0, str, _dbus_string_get_length (str)))
- goto oom;
-
- _dbus_string_free (&cmdline);
- _dbus_string_free (&path);
- return TRUE;
-oom:
- _DBUS_SET_OOM (error);
-fail:
- _dbus_string_free (&cmdline);
- _dbus_string_free (&path);
- return FALSE;
-}
-
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
- *
- * @param configure_time_path
- * @return real path
- */
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path)
-{
- return configure_time_path;
-}
-
-#define DBUS_UNIX_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
-#define DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
-
-/**
- * Returns the standard directories for a session bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_HOME=${XDG_DATA_HOME-$HOME/.local/share}
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_session_servicedirs (DBusList **dirs)
-{
- const char *xdg_data_home;
- const char *xdg_data_dirs;
- DBusString servicedir_path;
-
- if (!_dbus_string_init (&servicedir_path))
- return FALSE;
-
- xdg_data_home = _dbus_getenv ("XDG_DATA_HOME");
- xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
-
- if (xdg_data_home != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, xdg_data_home))
- goto oom;
- }
- else
- {
- const DBusString *homedir;
- DBusString local_share;
-
- if (!_dbus_homedir_from_current_process (&homedir))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _dbus_string_get_const_data (homedir)))
- goto oom;
-
- _dbus_string_init_const (&local_share, "/.local/share");
- if (!_dbus_concat_dir_and_file (&servicedir_path, &local_share))
- goto oom;
- }
-
- if (!_dbus_string_append (&servicedir_path, ":"))
- goto oom;
-
- if (xdg_data_dirs != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, xdg_data_dirs))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, ":"))
- goto oom;
- }
- else
- {
- if (!_dbus_string_append (&servicedir_path, "/usr/local/share:/usr/share:"))
- goto oom;
- }
-
- /*
- * add configured datadir to defaults
- * this may be the same as an xdg dir
- * however the config parser should take
- * care of duplicates
- */
- if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
- goto oom;
-
- if (!_dbus_split_paths_and_append (&servicedir_path,
- DBUS_UNIX_STANDARD_SESSION_SERVICEDIR,
- dirs))
- goto oom;
-
- _dbus_string_free (&servicedir_path);
- return TRUE;
-
- oom:
- _dbus_string_free (&servicedir_path);
- return FALSE;
-}
-
-
-/**
- * Returns the standard directories for a system bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * On Windows there is no system bus and this function can return nothing.
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_system_servicedirs (DBusList **dirs)
-{
- /*
- * DBUS_DATADIR may be the same as one of the standard directories. However,
- * the config parser should take care of the duplicates.
- *
- * Also, append /lib as counterpart of /usr/share on the root
- * directory (the root directory does not know /share), in order to
- * facilitate early boot system bus activation where /usr might not
- * be available.
- */
- static const char standard_search_path[] =
- "/usr/local/share:"
- "/usr/share:"
- DBUS_DATADIR ":"
- "/lib";
- DBusString servicedir_path;
-
- _dbus_string_init_const (&servicedir_path, standard_search_path);
-
- return _dbus_split_paths_and_append (&servicedir_path,
- DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR,
- dirs);
-}
-
-/**
- * Append the absolute path of the system.conf file
- * (there is no system bus on Windows so this can just
- * return FALSE and print a warning or something)
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
-{
- return _dbus_string_append (str, DBUS_SYSTEM_CONFIG_FILE);
-}
-
-/**
- * Append the absolute path of the session.conf file.
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
-{
- return _dbus_string_append (str, DBUS_SESSION_CONFIG_FILE);
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-win.c
deleted file mode 100644
index 4678b11ee1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util-win.c
+++ /dev/null
@@ -1,1736 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-util.c Would be in dbus-sysdeps.c, but not used in libdbus
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#define STRSAFE_NO_DEPRECATE
-
-#include "dbus-sysdeps.h"
-#include "dbus-internals.h"
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-win.h"
-#include "dbus-sockets-win.h"
-#include "dbus-memory.h"
-#include "dbus-pipe.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#include <winsock2.h> // WSA error codes
-
-#ifndef DBUS_WINCE
-#include <io.h>
-#include <lm.h>
-#include <sys/stat.h>
-#endif
-
-
-/**
- * Does the chdir, fork, setsid, etc. to become a daemon process.
- *
- * @param pidfile #NULL, or pidfile to create
- * @param print_pid_pipe file descriptor to print daemon's pid to, or -1 for none
- * @param error return location for errors
- * @param keep_umask #TRUE to keep the original umask
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_become_daemon (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- DBusError *error,
- dbus_bool_t keep_umask)
-{
- dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
- "Cannot daemonize on Windows");
- return FALSE;
-}
-
-/**
- * Creates a file containing the process ID.
- *
- * @param filename the filename to write to
- * @param pid our process ID
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-static dbus_bool_t
-_dbus_write_pid_file (const DBusString *filename,
- unsigned long pid,
- DBusError *error)
-{
- const char *cfilename;
- HANDLE hnd;
- char pidstr[20];
- int total;
- int bytes_to_write;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- cfilename = _dbus_string_get_const_data (filename);
-
- hnd = CreateFileA (cfilename, GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
- INVALID_HANDLE_VALUE);
- if (hnd == INVALID_HANDLE_VALUE)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not create PID file %s: %s",
- cfilename, emsg);
- _dbus_win_free_error_string (emsg);
- return FALSE;
- }
-
- if (snprintf (pidstr, sizeof (pidstr), "%lu\n", pid) < 0)
- {
- dbus_set_error (error, _dbus_error_from_system_errno (),
- "Failed to format PID for \"%s\": %s", cfilename,
- _dbus_strerror_from_errno ());
- CloseHandle (hnd);
- return FALSE;
- }
-
- total = 0;
- bytes_to_write = strlen (pidstr);;
-
- while (total < bytes_to_write)
- {
- DWORD bytes_written;
- BOOL res;
-
- res = WriteFile (hnd, pidstr + total, bytes_to_write - total,
- &bytes_written, NULL);
-
- if (res == 0 || bytes_written <= 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not write to %s: %s", cfilename, emsg);
- _dbus_win_free_error_string (emsg);
- CloseHandle (hnd);
- return FALSE;
- }
-
- total += bytes_written;
- }
-
- if (CloseHandle (hnd) == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Could not close file %s: %s",
- cfilename, emsg);
- _dbus_win_free_error_string (emsg);
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Writes the given pid_to_write to a pidfile (if non-NULL) and/or to a
- * pipe (if non-NULL). Does nothing if pidfile and print_pid_pipe are both
- * NULL.
- *
- * @param pidfile the file to write to or #NULL
- * @param print_pid_pipe the pipe to write to or #NULL
- * @param pid_to_write the pid to write out
- * @param error error on failure
- * @returns FALSE if error is set
- */
-dbus_bool_t
-_dbus_write_pid_to_file_and_pipe (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- dbus_pid_t pid_to_write,
- DBusError *error)
-{
- if (pidfile)
- {
- _dbus_verbose ("writing pid file %s\n", _dbus_string_get_const_data (pidfile));
- if (!_dbus_write_pid_file (pidfile,
- pid_to_write,
- error))
- {
- _dbus_verbose ("pid file write failed\n");
- _DBUS_ASSERT_ERROR_IS_SET(error);
- return FALSE;
- }
- }
- else
- {
- _dbus_verbose ("No pid file requested\n");
- }
-
- if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe))
- {
- DBusString pid;
- int bytes;
-
- _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd);
-
- if (!_dbus_string_init (&pid))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append_int (&pid, pid_to_write) ||
- !_dbus_string_append (&pid, "\n"))
- {
- _dbus_string_free (&pid);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- bytes = _dbus_string_get_length (&pid);
- if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes)
- {
- /* _dbus_pipe_write sets error only on failure, not short write */
- if (error != NULL && !dbus_error_is_set(error))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Printing message bus PID: did not write enough bytes\n");
- }
- _dbus_string_free (&pid);
- return FALSE;
- }
-
- _dbus_string_free (&pid);
- }
- else
- {
- _dbus_verbose ("No pid pipe to write to\n");
- }
-
- return TRUE;
-}
-
-/**
- * Verify that after the fork we can successfully change to this user.
- *
- * @param user the username given in the daemon configuration
- * @returns #TRUE if username is valid
- */
-dbus_bool_t
-_dbus_verify_daemon_user (const char *user)
-{
- return TRUE;
-}
-
-/**
- * Changes the user and group the bus is running as.
- *
- * @param user the user to become
- * @param error return location for errors
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_change_to_daemon_user (const char *user,
- DBusError *error)
-{
- return TRUE;
-}
-
-void
-_dbus_request_file_descriptor_limit (unsigned int limit)
-{
-}
-
-void
-_dbus_init_system_log (dbus_bool_t is_daemon)
-{
- /* OutputDebugStringA doesn't need any special initialization, do nothing */
-}
-
-/**
- * Log a message to the system log file (e.g. syslog on Unix).
- *
- * @param severity a severity value
- * @param msg a printf-style format string
- */
-void
-_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
-{
- va_list args;
-
- va_start (args, msg);
-
- _dbus_system_logv (severity, msg, args);
-
- va_end (args);
-}
-
-/**
- * Log a message to the system log file (e.g. syslog on Unix).
- *
- * @param severity a severity value
- * @param msg a printf-style format string
- * @param args arguments for the format string
- *
- * If the FATAL severity is given, this function will terminate the program
- * with an error code.
- */
-void
-_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
-{
- char *s = "";
- char buf[1024];
-
- switch(severity)
- {
- case DBUS_SYSTEM_LOG_INFO: s = "info"; break;
- case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break;
- case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break;
- }
-
- sprintf(buf,"%s%s",s,msg);
- vsprintf(buf,buf,args);
- OutputDebugStringA(buf);
-
- if (severity == DBUS_SYSTEM_LOG_FATAL)
- exit (1);
-}
-
-/** Installs a signal handler
- *
- * @param sig the signal to handle
- * @param handler the handler
- */
-void
-_dbus_set_signal_handler (int sig,
- DBusSignalHandler handler)
-{
- _dbus_verbose ("_dbus_set_signal_handler() has to be implemented\n");
-}
-
-/**
- * stat() wrapper.
- *
- * @param filename the filename to stat
- * @param statbuf the stat info to fill in
- * @param error return location for error
- * @returns #FALSE if error was set
- */
-dbus_bool_t
-_dbus_stat(const DBusString *filename,
- DBusStat *statbuf,
- DBusError *error)
-{
- const char *filename_c;
- WIN32_FILE_ATTRIBUTE_DATA wfad;
- char *lastdot;
- DWORD rc;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (!GetFileAttributesExA (filename_c, GetFileExInfoStandard, &wfad))
- {
- _dbus_win_set_error_from_win_error (error, GetLastError ());
- return FALSE;
- }
-
- if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- statbuf->mode = _S_IFDIR;
- else
- statbuf->mode = _S_IFREG;
-
- statbuf->mode |= _S_IREAD;
- if (wfad.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
- statbuf->mode |= _S_IWRITE;
-
- lastdot = strrchr (filename_c, '.');
- if (lastdot && stricmp (lastdot, ".exe") == 0)
- statbuf->mode |= _S_IEXEC;
-
- statbuf->mode |= (statbuf->mode & 0700) >> 3;
- statbuf->mode |= (statbuf->mode & 0700) >> 6;
-
- statbuf->nlink = 1;
-
-#ifdef ENABLE_UID_TO_SID
- {
- PSID owner_sid, group_sid;
- PSECURITY_DESCRIPTOR sd;
-
- sd = NULL;
- rc = GetNamedSecurityInfo ((char *) filename_c, SE_FILE_OBJECT,
- OWNER_SECURITY_INFORMATION |
- GROUP_SECURITY_INFORMATION,
- &owner_sid, &group_sid,
- NULL, NULL,
- &sd);
- if (rc != ERROR_SUCCESS)
- {
- _dbus_win_set_error_from_win_error (error, rc);
- if (sd != NULL)
- LocalFree (sd);
- return FALSE;
- }
-
- /* FIXME */
- statbuf->uid = _dbus_win_sid_to_uid_t (owner_sid);
- statbuf->gid = _dbus_win_sid_to_uid_t (group_sid);
-
- LocalFree (sd);
- }
-#else
- statbuf->uid = DBUS_UID_UNSET;
- statbuf->gid = DBUS_GID_UNSET;
-#endif
-
- statbuf->size = ((dbus_int64_t) wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow;
-
- statbuf->atime =
- (((dbus_int64_t) wfad.ftLastAccessTime.dwHighDateTime << 32) +
- wfad.ftLastAccessTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
-
- statbuf->mtime =
- (((dbus_int64_t) wfad.ftLastWriteTime.dwHighDateTime << 32) +
- wfad.ftLastWriteTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
-
- statbuf->ctime =
- (((dbus_int64_t) wfad.ftCreationTime.dwHighDateTime << 32) +
- wfad.ftCreationTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
-
- return TRUE;
-}
-
-
-/* This file is part of the KDE project
-Copyright (C) 2000 Werner Almesberger
-
-libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this program; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.
-*/
-#define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */
-#define HAVE_DD_LOCK /* have locking mechanism */
-
-#define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */
-
-#define __dirfd(dir) (dir)->dd_fd
-
-/* struct dirent - same as Unix */
-struct dirent
- {
- long d_ino; /* inode (always 1 in WIN32) */
- off_t d_off; /* offset to this dirent */
- unsigned short d_reclen; /* length of d_name */
- char d_name[_MAX_FNAME+1]; /* filename (null terminated) */
- };
-
-/* typedef DIR - not the same as Unix */
-typedef struct
- {
- HANDLE handle; /* FindFirst/FindNext handle */
- short offset; /* offset into directory */
- short finished; /* 1 if there are not more files */
- WIN32_FIND_DATAA fileinfo; /* from FindFirst/FindNext */
- char *dir; /* the dir we are reading */
- struct dirent dent; /* the dirent to return */
- }
-DIR;
-
-/**********************************************************************
-* Implement dirent-style opendir/readdir/closedir on Window 95/NT
-*
-* Functions defined are opendir(), readdir() and closedir() with the
-* same prototypes as the normal dirent.h implementation.
-*
-* Does not implement telldir(), seekdir(), rewinddir() or scandir().
-* The dirent struct is compatible with Unix, except that d_ino is
-* always 1 and d_off is made up as we go along.
-*
-* Error codes are not available with errno but GetLastError.
-*
-* The DIR typedef is not compatible with Unix.
-**********************************************************************/
-
-static DIR * _dbus_opendir(const char *dir)
-{
- DIR *dp;
- char *filespec;
- HANDLE handle;
- int index;
-
- filespec = malloc(strlen(dir) + 2 + 1);
- strcpy(filespec, dir);
- index = strlen(filespec) - 1;
- if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
- filespec[index] = '\0';
- strcat(filespec, "\\*");
-
- dp = (DIR *)malloc(sizeof(DIR));
- dp->offset = 0;
- dp->finished = 0;
- dp->dir = strdup(dir);
-
- handle = FindFirstFileA(filespec, &(dp->fileinfo));
- if (handle == INVALID_HANDLE_VALUE)
- {
- if (GetLastError() == ERROR_NO_MORE_FILES)
- dp->finished = 1;
- else
- return NULL;
- }
-
- dp->handle = handle;
- free(filespec);
-
- return dp;
-}
-
-static struct dirent * _dbus_readdir(DIR *dp)
-{
- int saved_err = GetLastError();
-
- if (!dp || dp->finished)
- return NULL;
-
- if (dp->offset != 0)
- {
- if (FindNextFileA(dp->handle, &(dp->fileinfo)) == 0)
- {
- if (GetLastError() == ERROR_NO_MORE_FILES)
- {
- SetLastError(saved_err);
- dp->finished = 1;
- }
- return NULL;
- }
- }
- dp->offset++;
-
- strncpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME);
- dp->dent.d_ino = 1;
- dp->dent.d_reclen = strlen(dp->dent.d_name);
- dp->dent.d_off = dp->offset;
-
- return &(dp->dent);
-}
-
-
-static int _dbus_closedir(DIR *dp)
-{
- if (!dp)
- return 0;
- FindClose(dp->handle);
- if (dp->dir)
- free(dp->dir);
- if (dp)
- free(dp);
-
- return 0;
-}
-
-
-/**
- * Internals of directory iterator
- */
-struct DBusDirIter
- {
- DIR *d; /**< The DIR* from opendir() */
-
- };
-
-/**
- * Open a directory to iterate over.
- *
- * @param filename the directory name
- * @param error exception return object or #NULL
- * @returns new iterator, or #NULL on error
- */
-DBusDirIter*
-_dbus_directory_open (const DBusString *filename,
- DBusError *error)
-{
- DIR *d;
- DBusDirIter *iter;
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- d = _dbus_opendir (filename_c);
- if (d == NULL)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to read directory \"%s\": %s",
- filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- return NULL;
- }
- iter = dbus_new0 (DBusDirIter, 1);
- if (iter == NULL)
- {
- _dbus_closedir (d);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Could not allocate memory for directory iterator");
- return NULL;
- }
-
- iter->d = d;
-
- return iter;
-}
-
-/**
- * Get next file in the directory. Will not return "." or ".." on
- * UNIX. If an error occurs, the contents of "filename" are
- * undefined. The error is never set if the function succeeds.
- *
- * @todo for thread safety, I think we have to use
- * readdir_r(). (GLib has the same issue, should file a bug.)
- *
- * @param iter the iterator
- * @param filename string to be set to the next file in the dir
- * @param error return location for error
- * @returns #TRUE if filename was filled in with a new filename
- */
-dbus_bool_t
-_dbus_directory_get_next_file (DBusDirIter *iter,
- DBusString *filename,
- DBusError *error)
-{
- struct dirent *ent;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-again:
- SetLastError (0);
- ent = _dbus_readdir (iter->d);
- if (ent == NULL)
- {
- if (GetLastError() != 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to get next in directory: %s", emsg);
- _dbus_win_free_error_string (emsg);
- }
- return FALSE;
- }
- else if (ent->d_name[0] == '.' &&
- (ent->d_name[1] == '\0' ||
- (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
- goto again;
- else
- {
- _dbus_string_set_length (filename, 0);
- if (!_dbus_string_append (filename, ent->d_name))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "No memory to read directory entry");
- return FALSE;
- }
- else
- return TRUE;
- }
-}
-
-/**
- * Closes a directory iteration.
- */
-void
-_dbus_directory_close (DBusDirIter *iter)
-{
- _dbus_closedir (iter->d);
- dbus_free (iter);
-}
-
-/** @} */ /* End of DBusInternalsUtils functions */
-
-/**
- * @addtogroup DBusString
- *
- * @{
- */
-/**
- * Get the directory name from a complete filename
- * @param filename the filename
- * @param dirname string to append directory name to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_string_get_dirname(const DBusString *filename,
- DBusString *dirname)
-{
- int sep;
-
- _dbus_assert (filename != dirname);
- _dbus_assert (filename != NULL);
- _dbus_assert (dirname != NULL);
-
- /* Ignore any separators on the end */
- sep = _dbus_string_get_length (filename);
- if (sep == 0)
- return _dbus_string_append (dirname, "."); /* empty string passed in */
-
- while (sep > 0 &&
- (_dbus_string_get_byte (filename, sep - 1) == '/' ||
- _dbus_string_get_byte (filename, sep - 1) == '\\'))
- --sep;
-
- _dbus_assert (sep >= 0);
-
- if (sep == 0 ||
- (sep == 2 &&
- _dbus_string_get_byte (filename, 1) == ':' &&
- isalpha (_dbus_string_get_byte (filename, 0))))
- return _dbus_string_copy_len (filename, 0, sep + 1,
- dirname, _dbus_string_get_length (dirname));
-
- {
- int sep1, sep2;
- _dbus_string_find_byte_backward (filename, sep, '/', &sep1);
- _dbus_string_find_byte_backward (filename, sep, '\\', &sep2);
-
- sep = MAX (sep1, sep2);
- }
- if (sep < 0)
- return _dbus_string_append (dirname, ".");
-
- while (sep > 0 &&
- (_dbus_string_get_byte (filename, sep - 1) == '/' ||
- _dbus_string_get_byte (filename, sep - 1) == '\\'))
- --sep;
-
- _dbus_assert (sep >= 0);
-
- if ((sep == 0 ||
- (sep == 2 &&
- _dbus_string_get_byte (filename, 1) == ':' &&
- isalpha (_dbus_string_get_byte (filename, 0))))
- &&
- (_dbus_string_get_byte (filename, sep) == '/' ||
- _dbus_string_get_byte (filename, sep) == '\\'))
- return _dbus_string_copy_len (filename, 0, sep + 1,
- dirname, _dbus_string_get_length (dirname));
- else
- return _dbus_string_copy_len (filename, 0, sep - 0,
- dirname, _dbus_string_get_length (dirname));
-}
-
-
-/**
- * Checks to see if the UNIX user ID matches the UID of
- * the process. Should always return #FALSE on Windows.
- *
- * @param uid the UNIX user ID
- * @returns #TRUE if this uid owns the process.
- */
-dbus_bool_t
-_dbus_unix_user_is_process_owner (dbus_uid_t uid)
-{
- return FALSE;
-}
-
-dbus_bool_t _dbus_windows_user_is_process_owner (const char *windows_sid)
-{
- return TRUE;
-}
-
-/*=====================================================================
- unix emulation functions - should be removed sometime in the future
- =====================================================================*/
-
-/**
- * Checks to see if the UNIX user ID is at the console.
- * Should always fail on Windows (set the error to
- * #DBUS_ERROR_NOT_SUPPORTED).
- *
- * @param uid UID of person to check
- * @param error return location for errors
- * @returns #TRUE if the UID is the same as the console user and there are no errors
- */
-dbus_bool_t
-_dbus_unix_user_is_at_console (dbus_uid_t uid,
- DBusError *error)
-{
- dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
- "UNIX user IDs not supported on Windows\n");
- return FALSE;
-}
-
-
-/**
- * Parse a UNIX group from the bus config file. On Windows, this should
- * simply always fail (just return #FALSE).
- *
- * @param groupname the groupname text
- * @param gid_p place to return the gid
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_parse_unix_group_from_config (const DBusString *groupname,
- dbus_gid_t *gid_p)
-{
- return FALSE;
-}
-
-/**
- * Parse a UNIX user from the bus config file. On Windows, this should
- * simply always fail (just return #FALSE).
- *
- * @param username the username text
- * @param uid_p place to return the uid
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_parse_unix_user_from_config (const DBusString *username,
- dbus_uid_t *uid_p)
-{
- return FALSE;
-}
-
-
-/**
- * Gets all groups corresponding to the given UNIX user ID. On UNIX,
- * just calls _dbus_groups_from_uid(). On Windows, should always
- * fail since we don't know any UNIX groups.
- *
- * @param uid the UID
- * @param group_ids return location for array of group IDs
- * @param n_group_ids return location for length of returned array
- * @returns #TRUE if the UID existed and we got some credentials
- */
-dbus_bool_t
-_dbus_unix_groups_from_uid (dbus_uid_t uid,
- dbus_gid_t **group_ids,
- int *n_group_ids)
-{
- return FALSE;
-}
-
-
-
-/** @} */ /* DBusString stuff */
-
-/************************************************************************
-
- error handling
-
- ************************************************************************/
-
-
-
-
-
-/* lan manager error codes */
-const char*
-_dbus_lm_strerror(int error_number)
-{
-#ifdef DBUS_WINCE
- // TODO
- return "unknown";
-#else
- const char *msg;
- switch (error_number)
- {
- case NERR_NetNotStarted:
- return "The workstation driver is not installed.";
- case NERR_UnknownServer:
- return "The server could not be located.";
- case NERR_ShareMem:
- return "An internal error occurred. The network cannot access a shared memory segment.";
- case NERR_NoNetworkResource:
- return "A network resource shortage occurred.";
- case NERR_RemoteOnly:
- return "This operation is not supported on workstations.";
- case NERR_DevNotRedirected:
- return "The device is not connected.";
- case NERR_ServerNotStarted:
- return "The Server service is not started.";
- case NERR_ItemNotFound:
- return "The queue is empty.";
- case NERR_UnknownDevDir:
- return "The device or directory does not exist.";
- case NERR_RedirectedPath:
- return "The operation is invalid on a redirected resource.";
- case NERR_DuplicateShare:
- return "The name has already been shared.";
- case NERR_NoRoom:
- return "The server is currently out of the requested resource.";
- case NERR_TooManyItems:
- return "Requested addition of items exceeds the maximum allowed.";
- case NERR_InvalidMaxUsers:
- return "The Peer service supports only two simultaneous users.";
- case NERR_BufTooSmall:
- return "The API return buffer is too small.";
- case NERR_RemoteErr:
- return "A remote API error occurred.";
- case NERR_LanmanIniError:
- return "An error occurred when opening or reading the configuration file.";
- case NERR_NetworkError:
- return "A general network error occurred.";
- case NERR_WkstaInconsistentState:
- return "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
- case NERR_WkstaNotStarted:
- return "The Workstation service has not been started.";
- case NERR_BrowserNotStarted:
- return "The requested information is not available.";
- case NERR_InternalError:
- return "An internal error occurred.";
- case NERR_BadTransactConfig:
- return "The server is not configured for transactions.";
- case NERR_InvalidAPI:
- return "The requested API is not supported on the remote server.";
- case NERR_BadEventName:
- return "The event name is invalid.";
- case NERR_DupNameReboot:
- return "The computer name already exists on the network. Change it and restart the computer.";
- case NERR_CfgCompNotFound:
- return "The specified component could not be found in the configuration information.";
- case NERR_CfgParamNotFound:
- return "The specified parameter could not be found in the configuration information.";
- case NERR_LineTooLong:
- return "A line in the configuration file is too long.";
- case NERR_QNotFound:
- return "The printer does not exist.";
- case NERR_JobNotFound:
- return "The print job does not exist.";
- case NERR_DestNotFound:
- return "The printer destination cannot be found.";
- case NERR_DestExists:
- return "The printer destination already exists.";
- case NERR_QExists:
- return "The printer queue already exists.";
- case NERR_QNoRoom:
- return "No more printers can be added.";
- case NERR_JobNoRoom:
- return "No more print jobs can be added.";
- case NERR_DestNoRoom:
- return "No more printer destinations can be added.";
- case NERR_DestIdle:
- return "This printer destination is idle and cannot accept control operations.";
- case NERR_DestInvalidOp:
- return "This printer destination request contains an invalid control function.";
- case NERR_ProcNoRespond:
- return "The print processor is not responding.";
- case NERR_SpoolerNotLoaded:
- return "The spooler is not running.";
- case NERR_DestInvalidState:
- return "This operation cannot be performed on the print destination in its current state.";
- case NERR_QInvalidState:
- return "This operation cannot be performed on the printer queue in its current state.";
- case NERR_JobInvalidState:
- return "This operation cannot be performed on the print job in its current state.";
- case NERR_SpoolNoMemory:
- return "A spooler memory allocation failure occurred.";
- case NERR_DriverNotFound:
- return "The device driver does not exist.";
- case NERR_DataTypeInvalid:
- return "The data type is not supported by the print processor.";
- case NERR_ProcNotFound:
- return "The print processor is not installed.";
- case NERR_ServiceTableLocked:
- return "The service database is locked.";
- case NERR_ServiceTableFull:
- return "The service table is full.";
- case NERR_ServiceInstalled:
- return "The requested service has already been started.";
- case NERR_ServiceEntryLocked:
- return "The service does not respond to control actions.";
- case NERR_ServiceNotInstalled:
- return "The service has not been started.";
- case NERR_BadServiceName:
- return "The service name is invalid.";
- case NERR_ServiceCtlTimeout:
- return "The service is not responding to the control function.";
- case NERR_ServiceCtlBusy:
- return "The service control is busy.";
- case NERR_BadServiceProgName:
- return "The configuration file contains an invalid service program name.";
- case NERR_ServiceNotCtrl:
- return "The service could not be controlled in its present state.";
- case NERR_ServiceKillProc:
- return "The service ended abnormally.";
- case NERR_ServiceCtlNotValid:
- return "The requested pause or stop is not valid for this service.";
- case NERR_NotInDispatchTbl:
- return "The service control dispatcher could not find the service name in the dispatch table.";
- case NERR_BadControlRecv:
- return "The service control dispatcher pipe read failed.";
- case NERR_ServiceNotStarting:
- return "A thread for the new service could not be created.";
- case NERR_AlreadyLoggedOn:
- return "This workstation is already logged on to the local-area network.";
- case NERR_NotLoggedOn:
- return "The workstation is not logged on to the local-area network.";
- case NERR_BadUsername:
- return "The user name or group name parameter is invalid.";
- case NERR_BadPassword:
- return "The password parameter is invalid.";
- case NERR_UnableToAddName_W:
- return "@W The logon processor did not add the message alias.";
- case NERR_UnableToAddName_F:
- return "The logon processor did not add the message alias.";
- case NERR_UnableToDelName_W:
- return "@W The logoff processor did not delete the message alias.";
- case NERR_UnableToDelName_F:
- return "The logoff processor did not delete the message alias.";
- case NERR_LogonsPaused:
- return "Network logons are paused.";
- case NERR_LogonServerConflict:
- return "A centralized logon-server conflict occurred.";
- case NERR_LogonNoUserPath:
- return "The server is configured without a valid user path.";
- case NERR_LogonScriptError:
- return "An error occurred while loading or running the logon script.";
- case NERR_StandaloneLogon:
- return "The logon server was not specified. Your computer will be logged on as STANDALONE.";
- case NERR_LogonServerNotFound:
- return "The logon server could not be found.";
- case NERR_LogonDomainExists:
- return "There is already a logon domain for this computer.";
- case NERR_NonValidatedLogon:
- return "The logon server could not validate the logon.";
- case NERR_ACFNotFound:
- return "The security database could not be found.";
- case NERR_GroupNotFound:
- return "The group name could not be found.";
- case NERR_UserNotFound:
- return "The user name could not be found.";
- case NERR_ResourceNotFound:
- return "The resource name could not be found.";
- case NERR_GroupExists:
- return "The group already exists.";
- case NERR_UserExists:
- return "The user account already exists.";
- case NERR_ResourceExists:
- return "The resource permission list already exists.";
- case NERR_NotPrimary:
- return "This operation is only allowed on the primary domain controller of the domain.";
- case NERR_ACFNotLoaded:
- return "The security database has not been started.";
- case NERR_ACFNoRoom:
- return "There are too many names in the user accounts database.";
- case NERR_ACFFileIOFail:
- return "A disk I/O failure occurred.";
- case NERR_ACFTooManyLists:
- return "The limit of 64 entries per resource was exceeded.";
- case NERR_UserLogon:
- return "Deleting a user with a session is not allowed.";
- case NERR_ACFNoParent:
- return "The parent directory could not be located.";
- case NERR_CanNotGrowSegment:
- return "Unable to add to the security database session cache segment.";
- case NERR_SpeGroupOp:
- return "This operation is not allowed on this special group.";
- case NERR_NotInCache:
- return "This user is not cached in user accounts database session cache.";
- case NERR_UserInGroup:
- return "The user already belongs to this group.";
- case NERR_UserNotInGroup:
- return "The user does not belong to this group.";
- case NERR_AccountUndefined:
- return "This user account is undefined.";
- case NERR_AccountExpired:
- return "This user account has expired.";
- case NERR_InvalidWorkstation:
- return "The user is not allowed to log on from this workstation.";
- case NERR_InvalidLogonHours:
- return "The user is not allowed to log on at this time.";
- case NERR_PasswordExpired:
- return "The password of this user has expired.";
- case NERR_PasswordCantChange:
- return "The password of this user cannot change.";
- case NERR_PasswordHistConflict:
- return "This password cannot be used now.";
- case NERR_PasswordTooShort:
- return "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.";
- case NERR_PasswordTooRecent:
- return "The password of this user is too recent to change.";
- case NERR_InvalidDatabase:
- return "The security database is corrupted.";
- case NERR_DatabaseUpToDate:
- return "No updates are necessary to this replicant network/local security database.";
- case NERR_SyncRequired:
- return "This replicant database is outdated; synchronization is required.";
- case NERR_UseNotFound:
- return "The network connection could not be found.";
- case NERR_BadAsgType:
- return "This asg_type is invalid.";
- case NERR_DeviceIsShared:
- return "This device is currently being shared.";
- case NERR_NoComputerName:
- return "The computer name could not be added as a message alias. The name may already exist on the network.";
- case NERR_MsgAlreadyStarted:
- return "The Messenger service is already started.";
- case NERR_MsgInitFailed:
- return "The Messenger service failed to start.";
- case NERR_NameNotFound:
- return "The message alias could not be found on the network.";
- case NERR_AlreadyForwarded:
- return "This message alias has already been forwarded.";
- case NERR_AddForwarded:
- return "This message alias has been added but is still forwarded.";
- case NERR_AlreadyExists:
- return "This message alias already exists locally.";
- case NERR_TooManyNames:
- return "The maximum number of added message aliases has been exceeded.";
- case NERR_DelComputerName:
- return "The computer name could not be deleted.";
- case NERR_LocalForward:
- return "Messages cannot be forwarded back to the same workstation.";
- case NERR_GrpMsgProcessor:
- return "An error occurred in the domain message processor.";
- case NERR_PausedRemote:
- return "The message was sent, but the recipient has paused the Messenger service.";
- case NERR_BadReceive:
- return "The message was sent but not received.";
- case NERR_NameInUse:
- return "The message alias is currently in use. Try again later.";
- case NERR_MsgNotStarted:
- return "The Messenger service has not been started.";
- case NERR_NotLocalName:
- return "The name is not on the local computer.";
- case NERR_NoForwardName:
- return "The forwarded message alias could not be found on the network.";
- case NERR_RemoteFull:
- return "The message alias table on the remote station is full.";
- case NERR_NameNotForwarded:
- return "Messages for this alias are not currently being forwarded.";
- case NERR_TruncatedBroadcast:
- return "The broadcast message was truncated.";
- case NERR_InvalidDevice:
- return "This is an invalid device name.";
- case NERR_WriteFault:
- return "A write fault occurred.";
- case NERR_DuplicateName:
- return "A duplicate message alias exists on the network.";
- case NERR_DeleteLater:
- return "@W This message alias will be deleted later.";
- case NERR_IncompleteDel:
- return "The message alias was not successfully deleted from all networks.";
- case NERR_MultipleNets:
- return "This operation is not supported on computers with multiple networks.";
- case NERR_NetNameNotFound:
- return "This shared resource does not exist.";
- case NERR_DeviceNotShared:
- return "This device is not shared.";
- case NERR_ClientNameNotFound:
- return "A session does not exist with that computer name.";
- case NERR_FileIdNotFound:
- return "There is not an open file with that identification number.";
- case NERR_ExecFailure:
- return "A failure occurred when executing a remote administration command.";
- case NERR_TmpFile:
- return "A failure occurred when opening a remote temporary file.";
- case NERR_TooMuchData:
- return "The data returned from a remote administration command has been truncated to 64K.";
- case NERR_DeviceShareConflict:
- return "This device cannot be shared as both a spooled and a non-spooled resource.";
- case NERR_BrowserTableIncomplete:
- return "The information in the list of servers may be incorrect.";
- case NERR_NotLocalDomain:
- return "The computer is not active in this domain.";
-#ifdef NERR_IsDfsShare
-
- case NERR_IsDfsShare:
- return "The share must be removed from the Distributed File System before it can be deleted.";
-#endif
-
- case NERR_DevInvalidOpCode:
- return "The operation is invalid for this device.";
- case NERR_DevNotFound:
- return "This device cannot be shared.";
- case NERR_DevNotOpen:
- return "This device was not open.";
- case NERR_BadQueueDevString:
- return "This device name list is invalid.";
- case NERR_BadQueuePriority:
- return "The queue priority is invalid.";
- case NERR_NoCommDevs:
- return "There are no shared communication devices.";
- case NERR_QueueNotFound:
- return "The queue you specified does not exist.";
- case NERR_BadDevString:
- return "This list of devices is invalid.";
- case NERR_BadDev:
- return "The requested device is invalid.";
- case NERR_InUseBySpooler:
- return "This device is already in use by the spooler.";
- case NERR_CommDevInUse:
- return "This device is already in use as a communication device.";
- case NERR_InvalidComputer:
- return "This computer name is invalid.";
- case NERR_MaxLenExceeded:
- return "The string and prefix specified are too long.";
- case NERR_BadComponent:
- return "This path component is invalid.";
- case NERR_CantType:
- return "Could not determine the type of input.";
- case NERR_TooManyEntries:
- return "The buffer for types is not big enough.";
- case NERR_ProfileFileTooBig:
- return "Profile files cannot exceed 64K.";
- case NERR_ProfileOffset:
- return "The start offset is out of range.";
- case NERR_ProfileCleanup:
- return "The system cannot delete current connections to network resources.";
- case NERR_ProfileUnknownCmd:
- return "The system was unable to parse the command line in this file.";
- case NERR_ProfileLoadErr:
- return "An error occurred while loading the profile file.";
- case NERR_ProfileSaveErr:
- return "@W Errors occurred while saving the profile file. The profile was partially saved.";
- case NERR_LogOverflow:
- return "Log file %1 is full.";
- case NERR_LogFileChanged:
- return "This log file has changed between reads.";
- case NERR_LogFileCorrupt:
- return "Log file %1 is corrupt.";
- case NERR_SourceIsDir:
- return "The source path cannot be a directory.";
- case NERR_BadSource:
- return "The source path is illegal.";
- case NERR_BadDest:
- return "The destination path is illegal.";
- case NERR_DifferentServers:
- return "The source and destination paths are on different servers.";
- case NERR_RunSrvPaused:
- return "The Run server you requested is paused.";
- case NERR_ErrCommRunSrv:
- return "An error occurred when communicating with a Run server.";
- case NERR_ErrorExecingGhost:
- return "An error occurred when starting a background process.";
- case NERR_ShareNotFound:
- return "The shared resource you are connected to could not be found.";
- case NERR_InvalidLana:
- return "The LAN adapter number is invalid.";
- case NERR_OpenFiles:
- return "There are open files on the connection.";
- case NERR_ActiveConns:
- return "Active connections still exist.";
- case NERR_BadPasswordCore:
- return "This share name or password is invalid.";
- case NERR_DevInUse:
- return "The device is being accessed by an active process.";
- case NERR_LocalDrive:
- return "The drive letter is in use locally.";
- case NERR_AlertExists:
- return "The specified client is already registered for the specified event.";
- case NERR_TooManyAlerts:
- return "The alert table is full.";
- case NERR_NoSuchAlert:
- return "An invalid or nonexistent alert name was raised.";
- case NERR_BadRecipient:
- return "The alert recipient is invalid.";
- case NERR_AcctLimitExceeded:
- return "A user's session with this server has been deleted.";
- case NERR_InvalidLogSeek:
- return "The log file does not contain the requested record number.";
- case NERR_BadUasConfig:
- return "The user accounts database is not configured correctly.";
- case NERR_InvalidUASOp:
- return "This operation is not permitted when the Netlogon service is running.";
- case NERR_LastAdmin:
- return "This operation is not allowed on the last administrative account.";
- case NERR_DCNotFound:
- return "Could not find domain controller for this domain.";
- case NERR_LogonTrackingError:
- return "Could not set logon information for this user.";
- case NERR_NetlogonNotStarted:
- return "The Netlogon service has not been started.";
- case NERR_CanNotGrowUASFile:
- return "Unable to add to the user accounts database.";
- case NERR_TimeDiffAtDC:
- return "This server's clock is not synchronized with the primary domain controller's clock.";
- case NERR_PasswordMismatch:
- return "A password mismatch has been detected.";
- case NERR_NoSuchServer:
- return "The server identification does not specify a valid server.";
- case NERR_NoSuchSession:
- return "The session identification does not specify a valid session.";
- case NERR_NoSuchConnection:
- return "The connection identification does not specify a valid connection.";
- case NERR_TooManyServers:
- return "There is no space for another entry in the table of available servers.";
- case NERR_TooManySessions:
- return "The server has reached the maximum number of sessions it supports.";
- case NERR_TooManyConnections:
- return "The server has reached the maximum number of connections it supports.";
- case NERR_TooManyFiles:
- return "The server cannot open more files because it has reached its maximum number.";
- case NERR_NoAlternateServers:
- return "There are no alternate servers registered on this server.";
- case NERR_TryDownLevel:
- return "Try down-level (remote admin protocol) version of API instead.";
- case NERR_UPSDriverNotStarted:
- return "The UPS driver could not be accessed by the UPS service.";
- case NERR_UPSInvalidConfig:
- return "The UPS service is not configured correctly.";
- case NERR_UPSInvalidCommPort:
- return "The UPS service could not access the specified Comm Port.";
- case NERR_UPSSignalAsserted:
- return "The UPS indicated a line fail or low battery situation. Service not started.";
- case NERR_UPSShutdownFailed:
- return "The UPS service failed to perform a system shut down.";
- case NERR_BadDosRetCode:
- return "The program below returned an MS-DOS error code:";
- case NERR_ProgNeedsExtraMem:
- return "The program below needs more memory:";
- case NERR_BadDosFunction:
- return "The program below called an unsupported MS-DOS function:";
- case NERR_RemoteBootFailed:
- return "The workstation failed to boot.";
- case NERR_BadFileCheckSum:
- return "The file below is corrupt.";
- case NERR_NoRplBootSystem:
- return "No loader is specified in the boot-block definition file.";
- case NERR_RplLoadrNetBiosErr:
- return "NetBIOS returned an error: The NCB and SMB are dumped above.";
- case NERR_RplLoadrDiskErr:
- return "A disk I/O error occurred.";
- case NERR_ImageParamErr:
- return "Image parameter substitution failed.";
- case NERR_TooManyImageParams:
- return "Too many image parameters cross disk sector boundaries.";
- case NERR_NonDosFloppyUsed:
- return "The image was not generated from an MS-DOS diskette formatted with /S.";
- case NERR_RplBootRestart:
- return "Remote boot will be restarted later.";
- case NERR_RplSrvrCallFailed:
- return "The call to the Remoteboot server failed.";
- case NERR_CantConnectRplSrvr:
- return "Cannot connect to the Remoteboot server.";
- case NERR_CantOpenImageFile:
- return "Cannot open image file on the Remoteboot server.";
- case NERR_CallingRplSrvr:
- return "Connecting to the Remoteboot server...";
- case NERR_StartingRplBoot:
- return "Connecting to the Remoteboot server...";
- case NERR_RplBootServiceTerm:
- return "Remote boot service was stopped; check the error log for the cause of the problem.";
- case NERR_RplBootStartFailed:
- return "Remote boot startup failed; check the error log for the cause of the problem.";
- case NERR_RPL_CONNECTED:
- return "A second connection to a Remoteboot resource is not allowed.";
- case NERR_BrowserConfiguredToNotRun:
- return "The browser service was configured with MaintainServerList=No.";
- case NERR_RplNoAdaptersStarted:
- return "Service failed to start since none of the network adapters started with this service.";
- case NERR_RplBadRegistry:
- return "Service failed to start due to bad startup information in the registry.";
- case NERR_RplBadDatabase:
- return "Service failed to start because its database is absent or corrupt.";
- case NERR_RplRplfilesShare:
- return "Service failed to start because RPLFILES share is absent.";
- case NERR_RplNotRplServer:
- return "Service failed to start because RPLUSER group is absent.";
- case NERR_RplCannotEnum:
- return "Cannot enumerate service records.";
- case NERR_RplWkstaInfoCorrupted:
- return "Workstation record information has been corrupted.";
- case NERR_RplWkstaNotFound:
- return "Workstation record was not found.";
- case NERR_RplWkstaNameUnavailable:
- return "Workstation name is in use by some other workstation.";
- case NERR_RplProfileInfoCorrupted:
- return "Profile record information has been corrupted.";
- case NERR_RplProfileNotFound:
- return "Profile record was not found.";
- case NERR_RplProfileNameUnavailable:
- return "Profile name is in use by some other profile.";
- case NERR_RplProfileNotEmpty:
- return "There are workstations using this profile.";
- case NERR_RplConfigInfoCorrupted:
- return "Configuration record information has been corrupted.";
- case NERR_RplConfigNotFound:
- return "Configuration record was not found.";
- case NERR_RplAdapterInfoCorrupted:
- return "Adapter ID record information has been corrupted.";
- case NERR_RplInternal:
- return "An internal service error has occurred.";
- case NERR_RplVendorInfoCorrupted:
- return "Vendor ID record information has been corrupted.";
- case NERR_RplBootInfoCorrupted:
- return "Boot block record information has been corrupted.";
- case NERR_RplWkstaNeedsUserAcct:
- return "The user account for this workstation record is missing.";
- case NERR_RplNeedsRPLUSERAcct:
- return "The RPLUSER local group could not be found.";
- case NERR_RplBootNotFound:
- return "Boot block record was not found.";
- case NERR_RplIncompatibleProfile:
- return "Chosen profile is incompatible with this workstation.";
- case NERR_RplAdapterNameUnavailable:
- return "Chosen network adapter ID is in use by some other workstation.";
- case NERR_RplConfigNotEmpty:
- return "There are profiles using this configuration.";
- case NERR_RplBootInUse:
- return "There are workstations, profiles, or configurations using this boot block.";
- case NERR_RplBackupDatabase:
- return "Service failed to backup Remoteboot database.";
- case NERR_RplAdapterNotFound:
- return "Adapter record was not found.";
- case NERR_RplVendorNotFound:
- return "Vendor record was not found.";
- case NERR_RplVendorNameUnavailable:
- return "Vendor name is in use by some other vendor record.";
- case NERR_RplBootNameUnavailable:
- return "(boot name, vendor ID) is in use by some other boot block record.";
- case NERR_RplConfigNameUnavailable:
- return "Configuration name is in use by some other configuration.";
- case NERR_DfsInternalCorruption:
- return "The internal database maintained by the Dfs service is corrupt.";
- case NERR_DfsVolumeDataCorrupt:
- return "One of the records in the internal Dfs database is corrupt.";
- case NERR_DfsNoSuchVolume:
- return "There is no DFS name whose entry path matches the input Entry Path.";
- case NERR_DfsVolumeAlreadyExists:
- return "A root or link with the given name already exists.";
- case NERR_DfsAlreadyShared:
- return "The server share specified is already shared in the Dfs.";
- case NERR_DfsNoSuchShare:
- return "The indicated server share does not support the indicated DFS namespace.";
- case NERR_DfsNotALeafVolume:
- return "The operation is not valid on this portion of the namespace.";
- case NERR_DfsLeafVolume:
- return "The operation is not valid on this portion of the namespace.";
- case NERR_DfsVolumeHasMultipleServers:
- return "The operation is ambiguous because the link has multiple servers.";
- case NERR_DfsCantCreateJunctionPoint:
- return "Unable to create a link.";
- case NERR_DfsServerNotDfsAware:
- return "The server is not Dfs Aware.";
- case NERR_DfsBadRenamePath:
- return "The specified rename target path is invalid.";
- case NERR_DfsVolumeIsOffline:
- return "The specified DFS link is offline.";
- case NERR_DfsNoSuchServer:
- return "The specified server is not a server for this link.";
- case NERR_DfsCyclicalName:
- return "A cycle in the Dfs name was detected.";
- case NERR_DfsNotSupportedInServerDfs:
- return "The operation is not supported on a server-based Dfs.";
- case NERR_DfsDuplicateService:
- return "This link is already supported by the specified server-share.";
- case NERR_DfsCantRemoveLastServerShare:
- return "Can't remove the last server-share supporting this root or link.";
- case NERR_DfsVolumeIsInterDfs:
- return "The operation is not supported for an Inter-DFS link.";
- case NERR_DfsInconsistent:
- return "The internal state of the Dfs Service has become inconsistent.";
- case NERR_DfsServerUpgraded:
- return "The Dfs Service has been installed on the specified server.";
- case NERR_DfsDataIsIdentical:
- return "The Dfs data being reconciled is identical.";
- case NERR_DfsCantRemoveDfsRoot:
- return "The DFS root cannot be deleted. Uninstall DFS if required.";
- case NERR_DfsChildOrParentInDfs:
- return "A child or parent directory of the share is already in a Dfs.";
- case NERR_DfsInternalError:
- return "Dfs internal error.";
- /* the following are not defined in mingw */
-#if 0
-
- case NERR_SetupAlreadyJoined:
- return "This machine is already joined to a domain.";
- case NERR_SetupNotJoined:
- return "This machine is not currently joined to a domain.";
- case NERR_SetupDomainController:
- return "This machine is a domain controller and cannot be unjoined from a domain.";
- case NERR_DefaultJoinRequired:
- return "The destination domain controller does not support creating machine accounts in OUs.";
- case NERR_InvalidWorkgroupName:
- return "The specified workgroup name is invalid.";
- case NERR_NameUsesIncompatibleCodePage:
- return "The specified computer name is incompatible with the default language used on the domain controller.";
- case NERR_ComputerAccountNotFound:
- return "The specified computer account could not be found.";
- case NERR_PersonalSku:
- return "This version of Windows cannot be joined to a domain.";
- case NERR_PasswordMustChange:
- return "The password must change at the next logon.";
- case NERR_AccountLockedOut:
- return "The account is locked out.";
- case NERR_PasswordTooLong:
- return "The password is too long.";
- case NERR_PasswordNotComplexEnough:
- return "The password does not meet the complexity policy.";
- case NERR_PasswordFilterError:
- return "The password does not meet the requirements of the password filter DLLs.";
-#endif
-
- }
- msg = strerror (error_number);
- if (msg == NULL)
- msg = "unknown";
-
- return msg;
-#endif //DBUS_WINCE
-}
-
-/**
- * Get a printable string describing the command used to execute
- * the process with pid. This string should only be used for
- * informative purposes such as logging; it may not be trusted.
- *
- * The command is guaranteed to be printable ASCII and no longer
- * than max_len.
- *
- * @param pid Process id
- * @param str Append command to this string
- * @param max_len Maximum length of returned command
- * @param error return location for errors
- * @returns #FALSE on error
- */
-dbus_bool_t
-_dbus_command_for_pid (unsigned long pid,
- DBusString *str,
- int max_len,
- DBusError *error)
-{
- // FIXME
- return FALSE;
-}
-
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
- *
- * @param configure_time_path
- * @return real path
- */
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path)
-{
-#ifndef DBUS_PREFIX
- return configure_time_path;
-#else
- static char retval[1000];
- static char runtime_prefix[1000];
- int len = 1000;
- int i;
-
- if (!configure_time_path)
- return NULL;
-
- if ((!_dbus_get_install_root(runtime_prefix, len) ||
- strncmp (configure_time_path, DBUS_PREFIX "/",
- strlen (DBUS_PREFIX) + 1))) {
- strcat (retval, configure_time_path);
- return retval;
- }
-
- strcpy (retval, runtime_prefix);
- strcat (retval, configure_time_path + strlen (DBUS_PREFIX) + 1);
-
- /* Somehow, in some situations, backslashes get collapsed in the string.
- * Since windows C library accepts both forward and backslashes as
- * path separators, convert all backslashes to forward slashes.
- */
-
- for(i = 0; retval[i] != '\0'; i++) {
- if(retval[i] == '\\')
- retval[i] = '/';
- }
- return retval;
-#endif
-}
-
-/**
- * return the relocated DATADIR
- *
- * @returns relocated DATADIR static string
- */
-
-static const char *
-_dbus_windows_get_datadir (void)
-{
- return _dbus_replace_install_prefix(DBUS_DATADIR);
-}
-
-#undef DBUS_DATADIR
-#define DBUS_DATADIR _dbus_windows_get_datadir ()
-
-
-#define DBUS_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
-#define DBUS_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
-
-/**
- * Returns the standard directories for a session bus to look for service
- * activation files
- *
- * On Windows this should be data directories:
- *
- * %CommonProgramFiles%/dbus
- *
- * and
- *
- * relocated DBUS_DATADIR
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_session_servicedirs (DBusList **dirs)
-{
- const char *common_progs;
- DBusString servicedir_path;
-
- if (!_dbus_string_init (&servicedir_path))
- return FALSE;
-
-#ifdef DBUS_WINCE
- {
- /* On Windows CE, we adjust datadir dynamically to installation location. */
- const char *data_dir = _dbus_getenv ("DBUS_DATADIR");
-
- if (data_dir != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, data_dir))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
- }
- }
-#else
-/*
- the code for accessing services requires absolute base pathes
- in case DBUS_DATADIR is relative make it absolute
-*/
-#ifdef DBUS_WIN
- {
- DBusString p;
-
- _dbus_string_init_const (&p, DBUS_DATADIR);
-
- if (!_dbus_path_is_absolute (&p))
- {
- char install_root[1000];
- if (_dbus_get_install_root (install_root, sizeof(install_root)))
- if (!_dbus_string_append (&servicedir_path, install_root))
- goto oom;
- }
- }
-#endif
- if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
-#endif
-
- common_progs = _dbus_getenv ("CommonProgramFiles");
-
- if (common_progs != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, common_progs))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
- }
-
- if (!_dbus_split_paths_and_append (&servicedir_path,
- DBUS_STANDARD_SESSION_SERVICEDIR,
- dirs))
- goto oom;
-
- _dbus_string_free (&servicedir_path);
- return TRUE;
-
- oom:
- _dbus_string_free (&servicedir_path);
- return FALSE;
-}
-
-/**
- * Returns the standard directories for a system bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * On Windows there is no system bus and this function can return nothing.
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_system_servicedirs (DBusList **dirs)
-{
- *dirs = NULL;
- return TRUE;
-}
-
-/**
- * Append the absolute path of the system.conf file
- * (there is no system bus on Windows so this can just
- * return FALSE and print a warning or something)
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
-{
- return _dbus_get_config_file_name(str, "system.conf");
-}
-
-/**
- * Append the absolute path of the session.conf file.
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
-{
- return _dbus_get_config_file_name(str, "session.conf");
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util.c
deleted file mode 100644
index 6b361ef0d2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-util.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-util.c Tests for dbus-sysdeps.h API
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-sysdeps.h"
-#include "dbus-internals.h"
-#include "dbus-string.h"
-#include "dbus-test.h"
-
-#include <stdlib.h>
-
-#ifdef DBUS_WIN
- /* do nothing, it's in stdlib.h */
-#elif (defined __APPLE__)
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-#else
-extern char **environ;
-#endif
-
-/**
- * Gets a #NULL-terminated list of key=value pairs from the
- * environment. Use dbus_free_string_array to free it.
- *
- * @returns the environment or #NULL on OOM
- */
-char **
-_dbus_get_environment (void)
-{
- int i, length;
- char **environment;
-
- _dbus_assert (environ != NULL);
-
- for (length = 0; environ[length] != NULL; length++);
-
- /* Add one for NULL */
- length++;
-
- environment = dbus_new0 (char *, length);
-
- if (environment == NULL)
- return NULL;
-
- for (i = 0; environ[i] != NULL; i++)
- {
- environment[i] = _dbus_strdup (environ[i]);
-
- if (environment[i] == NULL)
- break;
- }
-
- if (environ[i] != NULL)
- {
- dbus_free_string_array (environment);
- environment = NULL;
- }
-
- return environment;
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static void
-check_dirname (const char *filename,
- const char *dirname)
-{
- DBusString f, d;
-
- _dbus_string_init_const (&f, filename);
-
- if (!_dbus_string_init (&d))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_get_dirname (&f, &d))
- _dbus_assert_not_reached ("no memory");
-
- if (!_dbus_string_equal_c_str (&d, dirname))
- {
- _dbus_warn ("For filename \"%s\" got dirname \"%s\" and expected \"%s\"\n",
- filename,
- _dbus_string_get_const_data (&d),
- dirname);
- exit (1);
- }
-
- _dbus_string_free (&d);
-}
-
-static void
-check_path_absolute (const char *path,
- dbus_bool_t expected)
-{
- DBusString p;
-
- _dbus_string_init_const (&p, path);
-
- if (_dbus_path_is_absolute (&p) != expected)
- {
- _dbus_warn ("For path \"%s\" expected absolute = %d got %d\n",
- path, expected, _dbus_path_is_absolute (&p));
- exit (1);
- }
-}
-
-/**
- * Unit test for dbus-sysdeps.c.
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_sysdeps_test (void)
-{
-#ifdef DBUS_WIN
- check_dirname ("foo\\bar", "foo");
- check_dirname ("foo\\\\bar", "foo");
- check_dirname ("foo/\\/bar", "foo");
- check_dirname ("foo\\bar/", "foo");
- check_dirname ("foo//bar\\", "foo");
- check_dirname ("foo\\bar/", "foo");
- check_dirname ("foo/bar\\\\", "foo");
- check_dirname ("\\foo", "\\");
- check_dirname ("\\\\foo", "\\");
- check_dirname ("\\", "\\");
- check_dirname ("\\\\", "\\");
- check_dirname ("\\/", "\\");
- check_dirname ("/\\/", "/");
- check_dirname ("c:\\foo\\bar", "c:\\foo");
- check_dirname ("c:\\foo", "c:\\");
- check_dirname ("c:/foo", "c:/");
- check_dirname ("c:\\", "c:\\");
- check_dirname ("c:/", "c:/");
- check_dirname ("", ".");
-#else
- check_dirname ("foo", ".");
- check_dirname ("foo/bar", "foo");
- check_dirname ("foo//bar", "foo");
- check_dirname ("foo///bar", "foo");
- check_dirname ("foo/bar/", "foo");
- check_dirname ("foo//bar/", "foo");
- check_dirname ("foo///bar/", "foo");
- check_dirname ("foo/bar//", "foo");
- check_dirname ("foo//bar////", "foo");
- check_dirname ("foo///bar///////", "foo");
- check_dirname ("/foo", "/");
- check_dirname ("////foo", "/");
- check_dirname ("/foo/bar", "/foo");
- check_dirname ("/foo//bar", "/foo");
- check_dirname ("/foo///bar", "/foo");
- check_dirname ("/", "/");
- check_dirname ("///", "/");
- check_dirname ("", ".");
-#endif
-
-#ifdef DBUS_WIN
- check_path_absolute ("c:/", TRUE);
- check_path_absolute ("c:/foo", TRUE);
- check_path_absolute ("", FALSE);
- check_path_absolute ("foo", FALSE);
- check_path_absolute ("foo/bar", FALSE);
- check_path_absolute ("", FALSE);
- check_path_absolute ("foo\\bar", FALSE);
- check_path_absolute ("c:\\", TRUE);
- check_path_absolute ("c:\\foo", TRUE);
- check_path_absolute ("c:", TRUE);
- check_path_absolute ("c:\\foo\\bar", TRUE);
- check_path_absolute ("\\", TRUE);
- check_path_absolute ("/", TRUE);
-#else
- check_path_absolute ("/", TRUE);
- check_path_absolute ("/foo", TRUE);
- check_path_absolute ("", FALSE);
- check_path_absolute ("foo", FALSE);
- check_path_absolute ("foo/bar", FALSE);
-#endif
-
- return TRUE;
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.c
deleted file mode 100644
index 1c974c504d..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.c
+++ /dev/null
@@ -1,3723 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.c Wrappers around system/libc features (internal to D-BUS implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2005 Novell, Inc.
- * Copyright (C) 2006 Peter Kümmel <syntheticpp@gmx.net>
- * Copyright (C) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de>
- * Copyright (C) 2006-2013 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#define STRSAFE_NO_DEPRECATE
-
-#ifndef DBUS_WINCE
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#endif
-
-#include "dbus-internals.h"
-#include "dbus-sha.h"
-#include "dbus-sysdeps.h"
-#include "dbus-threads.h"
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-win.h"
-#include "dbus-protocol.h"
-#include "dbus-hash.h"
-#include "dbus-sockets-win.h"
-#include "dbus-list.h"
-#include "dbus-nonce.h"
-#include "dbus-credentials.h"
-
-#include <windows.h>
-#include <ws2tcpip.h>
-#include <wincrypt.h>
-#include <iphlpapi.h>
-
-/* Declarations missing in mingw's and windows sdk 7.0 headers */
-extern BOOL WINAPI ConvertStringSidToSidA (LPCSTR StringSid, PSID *Sid);
-extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid);
-
-#include <stdio.h>
-
-#include <string.h>
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifndef DBUS_WINCE
-#include <mbstring.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_WS2TCPIP_H
-/* getaddrinfo for Windows CE (and Windows). */
-#include <ws2tcpip.h>
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-typedef int socklen_t;
-
-
-void
-_dbus_win_set_errno (int err)
-{
-#ifdef DBUS_WINCE
- SetLastError (err);
-#else
- errno = err;
-#endif
-}
-
-static BOOL is_winxp_sp3_or_lower();
-
-/*
- * _MIB_TCPROW_EX and friends are not available in system headers
- * and are mapped to attribute identical ...OWNER_PID typedefs.
- */
-typedef MIB_TCPROW_OWNER_PID _MIB_TCPROW_EX;
-typedef MIB_TCPTABLE_OWNER_PID MIB_TCPTABLE_EX;
-typedef PMIB_TCPTABLE_OWNER_PID PMIB_TCPTABLE_EX;
-typedef DWORD (WINAPI *ProcAllocateAndGetTcpExtTableFromStack)(PMIB_TCPTABLE_EX*,BOOL,HANDLE,DWORD,DWORD);
-static ProcAllocateAndGetTcpExtTableFromStack lpfnAllocateAndGetTcpExTableFromStack = NULL;
-
-/**
- * AllocateAndGetTcpExTableFromStack() is undocumented and not exported,
- * but is the only way to do this in older XP versions.
- * @return true if the procedures could be loaded
- */
-static BOOL
-load_ex_ip_helper_procedures(void)
-{
- HMODULE hModule = LoadLibrary ("iphlpapi.dll");
- if (hModule == NULL)
- {
- _dbus_verbose ("could not load iphlpapi.dll\n");
- return FALSE;
- }
-
- lpfnAllocateAndGetTcpExTableFromStack = (ProcAllocateAndGetTcpExtTableFromStack)GetProcAddress (hModule, "AllocateAndGetTcpExTableFromStack");
- if (lpfnAllocateAndGetTcpExTableFromStack == NULL)
- {
- _dbus_verbose ("could not find function AllocateAndGetTcpExTableFromStack in iphlpapi.dll\n");
- return FALSE;
- }
- return TRUE;
-}
-
-/**
- * get pid from localhost tcp connection using peer_port
- * This function is available on WinXP >= SP3
- * @param peer_port peers tcp port
- * @return process id or 0 if connection has not been found
- */
-static dbus_pid_t
-get_pid_from_extended_tcp_table(int peer_port)
-{
- dbus_pid_t result;
- DWORD errorCode, size, i;
- MIB_TCPTABLE_OWNER_PID *tcp_table;
-
- if ((errorCode =
- GetExtendedTcpTable (NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0)) == ERROR_INSUFFICIENT_BUFFER)
- {
- tcp_table = (MIB_TCPTABLE_OWNER_PID *) dbus_malloc (size);
- if (tcp_table == NULL)
- {
- _dbus_verbose ("Error allocating memory\n");
- return 0;
- }
- }
- else
- {
- _dbus_win_warn_win_error ("unexpected error returned from GetExtendedTcpTable", errorCode);
- return 0;
- }
-
- if ((errorCode = GetExtendedTcpTable (tcp_table, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0)) != NO_ERROR)
- {
- _dbus_verbose ("Error fetching tcp table %d\n", (int)errorCode);
- dbus_free (tcp_table);
- return 0;
- }
-
- result = 0;
- for (i = 0; i < tcp_table->dwNumEntries; i++)
- {
- MIB_TCPROW_OWNER_PID *p = &tcp_table->table[i];
- int local_address = ntohl (p->dwLocalAddr);
- int local_port = ntohs (p->dwLocalPort);
- if (p->dwState == MIB_TCP_STATE_ESTAB
- && local_address == INADDR_LOOPBACK && local_port == peer_port)
- result = p->dwOwningPid;
- }
-
- dbus_free (tcp_table);
- _dbus_verbose ("got pid %lu\n", result);
- return result;
-}
-
-/**
- * get pid from localhost tcp connection using peer_port
- * This function is available on all WinXP versions, but
- * not in wine (at least version <= 1.6.0)
- * @param peer_port peers tcp port
- * @return process id or 0 if connection has not been found
- */
-static dbus_pid_t
-get_pid_from_tcp_ex_table(int peer_port)
-{
- dbus_pid_t result;
- DWORD errorCode, i;
- PMIB_TCPTABLE_EX tcp_table = NULL;
-
- if (!load_ex_ip_helper_procedures ())
- {
- _dbus_verbose
- ("Error not been able to load iphelper procedures\n");
- return 0;
- }
-
- errorCode = lpfnAllocateAndGetTcpExTableFromStack (&tcp_table, TRUE, GetProcessHeap(), 0, 2);
-
- if (errorCode != NO_ERROR)
- {
- _dbus_verbose
- ("Error not been able to call AllocateAndGetTcpExTableFromStack()\n");
- return 0;
- }
-
- result = 0;
- for (i = 0; i < tcp_table->dwNumEntries; i++)
- {
- _MIB_TCPROW_EX *p = &tcp_table->table[i];
- int local_port = ntohs (p->dwLocalPort);
- int local_address = ntohl (p->dwLocalAddr);
- if (local_address == INADDR_LOOPBACK && local_port == peer_port)
- {
- result = p->dwOwningPid;
- break;
- }
- }
-
- HeapFree (GetProcessHeap(), 0, tcp_table);
- _dbus_verbose ("got pid %lu\n", result);
- return result;
-}
-
-/**
- * @brief return peer process id from tcp handle for localhost connections
- * @param handle tcp socket descriptor
- * @return process id or 0 in case the process id could not be fetched
- */
-static dbus_pid_t
-_dbus_get_peer_pid_from_tcp_handle (int handle)
-{
- struct sockaddr_storage addr;
- socklen_t len = sizeof (addr);
- int peer_port;
-
- dbus_pid_t result;
- dbus_bool_t is_localhost = FALSE;
-
- getpeername (handle, (struct sockaddr *) &addr, &len);
-
- if (addr.ss_family == AF_INET)
- {
- struct sockaddr_in *s = (struct sockaddr_in *) &addr;
- peer_port = ntohs (s->sin_port);
- is_localhost = (ntohl (s->sin_addr.s_addr) == INADDR_LOOPBACK);
- }
- else if (addr.ss_family == AF_INET6)
- {
- _dbus_verbose ("FIXME [61922]: IPV6 support not working on windows\n");
- return 0;
- /*
- struct sockaddr_in6 *s = (struct sockaddr_in6 * )&addr;
- peer_port = ntohs (s->sin6_port);
- is_localhost = (memcmp(s->sin6_addr.s6_addr, in6addr_loopback.s6_addr, 16) == 0);
- _dbus_verbose ("IPV6 %08x %08x\n", s->sin6_addr.s6_addr, in6addr_loopback.s6_addr);
- */
- }
- else
- {
- _dbus_verbose ("no idea what address family %d is\n", addr.ss_family);
- return 0;
- }
-
- if (!is_localhost)
- {
- _dbus_verbose ("could not fetch process id from remote process\n");
- return 0;
- }
-
- if (peer_port == 0)
- {
- _dbus_verbose
- ("Error not been able to fetch tcp peer port from connection\n");
- return 0;
- }
-
- _dbus_verbose ("trying to get peers pid");
-
- result = get_pid_from_extended_tcp_table (peer_port);
- if (result > 0)
- return result;
- result = get_pid_from_tcp_ex_table (peer_port);
- return result;
-}
-
-/* Convert GetLastError() to a dbus error. */
-const char*
-_dbus_win_error_from_last_error (void)
-{
- switch (GetLastError())
- {
- case 0:
- return DBUS_ERROR_FAILED;
-
- case ERROR_NO_MORE_FILES:
- case ERROR_TOO_MANY_OPEN_FILES:
- return DBUS_ERROR_LIMITS_EXCEEDED; /* kernel out of memory */
-
- case ERROR_ACCESS_DENIED:
- case ERROR_CANNOT_MAKE:
- return DBUS_ERROR_ACCESS_DENIED;
-
- case ERROR_NOT_ENOUGH_MEMORY:
- return DBUS_ERROR_NO_MEMORY;
-
- case ERROR_FILE_EXISTS:
- return DBUS_ERROR_FILE_EXISTS;
-
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- return DBUS_ERROR_FILE_NOT_FOUND;
- }
-
- return DBUS_ERROR_FAILED;
-}
-
-
-char*
-_dbus_win_error_string (int error_number)
-{
- char *msg;
-
- FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, error_number, 0,
- (LPSTR) &msg, 0, NULL);
-
- if (msg[strlen (msg) - 1] == '\n')
- msg[strlen (msg) - 1] = '\0';
- if (msg[strlen (msg) - 1] == '\r')
- msg[strlen (msg) - 1] = '\0';
-
- return msg;
-}
-
-void
-_dbus_win_free_error_string (char *string)
-{
- LocalFree (string);
-}
-
-/**
- * Socket interface
- *
- */
-
-/**
- * Thin wrapper around the read() system call that appends
- * the data it reads to the DBusString buffer. It appends
- * up to the given count, and returns the same value
- * and same errno as read(). The only exception is that
- * _dbus_read_socket() handles EINTR for you.
- * _dbus_read_socket() can return ENOMEM, even though
- * regular UNIX read doesn't.
- *
- * @param fd the file descriptor to read from
- * @param buffer the buffer to append data to
- * @param count the amount of data to read
- * @returns the number of bytes read or -1
- */
-
-int
-_dbus_read_socket (int fd,
- DBusString *buffer,
- int count)
-{
- int bytes_read;
- int start;
- char *data;
-
- _dbus_assert (count >= 0);
-
- start = _dbus_string_get_length (buffer);
-
- if (!_dbus_string_lengthen (buffer, count))
- {
- _dbus_win_set_errno (ENOMEM);
- return -1;
- }
-
- data = _dbus_string_get_data_len (buffer, start, count);
-
- again:
-
- _dbus_verbose ("recv: count=%d fd=%d\n", count, fd);
- bytes_read = recv (fd, data, count, 0);
-
- if (bytes_read == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO();
- _dbus_verbose ("recv: failed: %s (%d)\n", _dbus_strerror (errno), errno);
- bytes_read = -1;
- }
- else
- _dbus_verbose ("recv: = %d\n", bytes_read);
-
- if (bytes_read < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- /* put length back (note that this doesn't actually realloc anything) */
- _dbus_string_set_length (buffer, start);
- return -1;
- }
- }
- else
- {
- /* put length back (doesn't actually realloc) */
- _dbus_string_set_length (buffer, start + bytes_read);
-
-#if 0
- if (bytes_read > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_read);
-#endif
-
- return bytes_read;
- }
-}
-
-/**
- * Thin wrapper around the write() system call that writes a part of a
- * DBusString and handles EINTR for you.
- *
- * @param fd the file descriptor to write
- * @param buffer the buffer to write data from
- * @param start the first byte in the buffer to write
- * @param len the number of bytes to try to write
- * @returns the number of bytes written or -1 on error
- */
-int
-_dbus_write_socket (int fd,
- const DBusString *buffer,
- int start,
- int len)
-{
- const char *data;
- int bytes_written;
-
- data = _dbus_string_get_const_data_len (buffer, start, len);
-
- again:
-
- _dbus_verbose ("send: len=%d fd=%d\n", len, fd);
- bytes_written = send (fd, data, len, 0);
-
- if (bytes_written == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO();
- _dbus_verbose ("send: failed: %s\n", _dbus_strerror_from_errno ());
- bytes_written = -1;
- }
- else
- _dbus_verbose ("send: = %d\n", bytes_written);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
-#if 0
- if (bytes_written > 0)
- _dbus_verbose_bytes_of_string (buffer, start, bytes_written);
-#endif
-
- return bytes_written;
-}
-
-
-/**
- * Closes a file descriptor.
- *
- * @param fd the file descriptor
- * @param error error object
- * @returns #FALSE if error set
- */
-dbus_bool_t
-_dbus_close_socket (int fd,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- again:
- if (closesocket (fd) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
-
- if (errno == EINTR)
- goto again;
-
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not close socket: socket=%d, , %s",
- fd, _dbus_strerror_from_errno ());
- return FALSE;
- }
- _dbus_verbose ("_dbus_close_socket: socket=%d, \n", fd);
-
- return TRUE;
-}
-
-/**
- * Sets the file descriptor to be close
- * on exec. Should be called for all file
- * descriptors in D-Bus code.
- *
- * @param handle the Windows HANDLE
- */
-void
-_dbus_fd_set_close_on_exec (intptr_t handle)
-{
- if ( !SetHandleInformation( (HANDLE) handle,
- HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE,
- 0 /*disable both flags*/ ) )
- {
- _dbus_win_warn_win_error ("Disabling socket handle inheritance failed:", GetLastError());
- }
-}
-
-/**
- * Sets a file descriptor to be nonblocking.
- *
- * @param handle the file descriptor.
- * @param error address of error location.
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_set_fd_nonblocking (int handle,
- DBusError *error)
-{
- u_long one = 1;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (ioctlsocket (handle, FIONBIO, &one) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to set socket %d:%d to nonblocking: %s", handle,
- _dbus_strerror_from_errno ());
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/**
- * Like _dbus_write() but will use writev() if possible
- * to write both buffers in sequence. The return value
- * is the number of bytes written in the first buffer,
- * plus the number written in the second. If the first
- * buffer is written successfully and an error occurs
- * writing the second, the number of bytes in the first
- * is returned (i.e. the error is ignored), on systems that
- * don't have writev. Handles EINTR for you.
- * The second buffer may be #NULL.
- *
- * @param fd the file descriptor
- * @param buffer1 first buffer
- * @param start1 first byte to write in first buffer
- * @param len1 number of bytes to write from first buffer
- * @param buffer2 second buffer, or #NULL
- * @param start2 first byte to write in second buffer
- * @param len2 number of bytes to write in second buffer
- * @returns total bytes written from both buffers, or -1 on error
- */
-int
-_dbus_write_socket_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2)
-{
- WSABUF vectors[2];
- const char *data1;
- const char *data2;
- int rc;
- DWORD bytes_written;
-
- _dbus_assert (buffer1 != NULL);
- _dbus_assert (start1 >= 0);
- _dbus_assert (start2 >= 0);
- _dbus_assert (len1 >= 0);
- _dbus_assert (len2 >= 0);
-
-
- data1 = _dbus_string_get_const_data_len (buffer1, start1, len1);
-
- if (buffer2 != NULL)
- data2 = _dbus_string_get_const_data_len (buffer2, start2, len2);
- else
- {
- data2 = NULL;
- start2 = 0;
- len2 = 0;
- }
-
- vectors[0].buf = (char*) data1;
- vectors[0].len = len1;
- vectors[1].buf = (char*) data2;
- vectors[1].len = len2;
-
- again:
-
- _dbus_verbose ("WSASend: len1+2=%d+%d fd=%d\n", len1, len2, fd);
- rc = WSASend (fd,
- vectors,
- data2 ? 2 : 1,
- &bytes_written,
- 0,
- NULL,
- NULL);
-
- if (rc == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- _dbus_verbose ("WSASend: failed: %s\n", _dbus_strerror_from_errno ());
- bytes_written = -1;
- }
- else
- _dbus_verbose ("WSASend: = %ld\n", bytes_written);
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- return bytes_written;
-}
-
-dbus_bool_t
-_dbus_socket_is_invalid (int fd)
-{
- return fd == INVALID_SOCKET ? TRUE : FALSE;
-}
-
-#if 0
-
-/**
- * Opens the client side of a Windows named pipe. The connection D-BUS
- * file descriptor index is returned. It is set up as nonblocking.
- *
- * @param path the path to named pipe socket
- * @param error return location for error code
- * @returns connection D-BUS file descriptor or -1 on error
- */
-int
-_dbus_connect_named_pipe (const char *path,
- DBusError *error)
-{
- _dbus_assert_not_reached ("not implemented");
-}
-
-#endif
-
-/**
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_win_startup_winsock (void)
-{
- /* Straight from MSDN, deuglified */
-
- /* Protected by _DBUS_LOCK_sysdeps */
- static dbus_bool_t beenhere = FALSE;
-
- WORD wVersionRequested;
- WSADATA wsaData;
- int err;
-
- if (!_DBUS_LOCK (sysdeps))
- return FALSE;
-
- if (beenhere)
- goto out;
-
- wVersionRequested = MAKEWORD (2, 0);
-
- err = WSAStartup (wVersionRequested, &wsaData);
- if (err != 0)
- {
- _dbus_assert_not_reached ("Could not initialize WinSock");
- _dbus_abort ();
- }
-
- /* Confirm that the WinSock DLL supports 2.0. Note that if the DLL
- * supports versions greater than 2.0 in addition to 2.0, it will
- * still return 2.0 in wVersion since that is the version we
- * requested.
- */
- if (LOBYTE (wsaData.wVersion) != 2 ||
- HIBYTE (wsaData.wVersion) != 0)
- {
- _dbus_assert_not_reached ("No usable WinSock found");
- _dbus_abort ();
- }
-
- beenhere = TRUE;
-
-out:
- _DBUS_UNLOCK (sysdeps);
- return TRUE;
-}
-
-
-
-
-
-
-
-
-
-/************************************************************************
-
- UTF / string code
-
- ************************************************************************/
-
-/**
- * Measure the message length without terminating nul
- */
-int _dbus_printf_string_upper_bound (const char *format,
- va_list args)
-{
- /* MSVCRT's vsnprintf semantics are a bit different */
- char buf[1024];
- int bufsize;
- int len;
- va_list args_copy;
-
- bufsize = sizeof (buf);
- DBUS_VA_COPY (args_copy, args);
- len = _vsnprintf (buf, bufsize - 1, format, args_copy);
- va_end (args_copy);
-
- while (len == -1) /* try again */
- {
- char *p;
-
- bufsize *= 2;
-
- p = malloc (bufsize);
-
- if (p == NULL)
- return -1;
-
- DBUS_VA_COPY (args_copy, args);
- len = _vsnprintf (p, bufsize - 1, format, args_copy);
- va_end (args_copy);
- free (p);
- }
-
- return len;
-}
-
-
-/**
- * Returns the UTF-16 form of a UTF-8 string. The result should be
- * freed with dbus_free() when no longer needed.
- *
- * @param str the UTF-8 string
- * @param error return location for error code
- */
-wchar_t *
-_dbus_win_utf8_to_utf16 (const char *str,
- DBusError *error)
-{
- DBusString s;
- int n;
- wchar_t *retval;
-
- _dbus_string_init_const (&s, str);
-
- if (!_dbus_string_validate_utf8 (&s, 0, _dbus_string_get_length (&s)))
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid UTF-8");
- return NULL;
- }
-
- n = MultiByteToWideChar (CP_UTF8, 0, str, -1, NULL, 0);
-
- if (n == 0)
- {
- _dbus_win_set_error_from_win_error (error, GetLastError ());
- return NULL;
- }
-
- retval = dbus_new (wchar_t, n);
-
- if (!retval)
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- if (MultiByteToWideChar (CP_UTF8, 0, str, -1, retval, n) != n)
- {
- dbus_free (retval);
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "MultiByteToWideChar inconsistency");
- return NULL;
- }
-
- return retval;
-}
-
-/**
- * Returns the UTF-8 form of a UTF-16 string. The result should be
- * freed with dbus_free() when no longer needed.
- *
- * @param str the UTF-16 string
- * @param error return location for error code
- */
-char *
-_dbus_win_utf16_to_utf8 (const wchar_t *str,
- DBusError *error)
-{
- int n;
- char *retval;
-
- n = WideCharToMultiByte (CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
-
- if (n == 0)
- {
- _dbus_win_set_error_from_win_error (error, GetLastError ());
- return NULL;
- }
-
- retval = dbus_malloc (n);
-
- if (!retval)
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- if (WideCharToMultiByte (CP_UTF8, 0, str, -1, retval, n, NULL, NULL) != n)
- {
- dbus_free (retval);
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "WideCharToMultiByte inconsistency");
- return NULL;
- }
-
- return retval;
-}
-
-
-
-
-
-
-/************************************************************************
-
-
- ************************************************************************/
-
-dbus_bool_t
-_dbus_win_account_to_sid (const wchar_t *waccount,
- void **ppsid,
- DBusError *error)
-{
- dbus_bool_t retval = FALSE;
- DWORD sid_length, wdomain_length;
- SID_NAME_USE use;
- wchar_t *wdomain;
-
- *ppsid = NULL;
-
- sid_length = 0;
- wdomain_length = 0;
- if (!LookupAccountNameW (NULL, waccount, NULL, &sid_length,
- NULL, &wdomain_length, &use) &&
- GetLastError () != ERROR_INSUFFICIENT_BUFFER)
- {
- _dbus_win_set_error_from_win_error (error, GetLastError ());
- return FALSE;
- }
-
- *ppsid = dbus_malloc (sid_length);
- if (!*ppsid)
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- wdomain = dbus_new (wchar_t, wdomain_length);
- if (!wdomain)
- {
- _DBUS_SET_OOM (error);
- goto out1;
- }
-
- if (!LookupAccountNameW (NULL, waccount, (PSID) *ppsid, &sid_length,
- wdomain, &wdomain_length, &use))
- {
- _dbus_win_set_error_from_win_error (error, GetLastError ());
- goto out2;
- }
-
- if (!IsValidSid ((PSID) *ppsid))
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID");
- goto out2;
- }
-
- retval = TRUE;
-
-out2:
- dbus_free (wdomain);
-out1:
- if (!retval)
- {
- dbus_free (*ppsid);
- *ppsid = NULL;
- }
-
- return retval;
-}
-
-/** @} end of sysdeps-win */
-
-
-/**
- * The only reason this is separate from _dbus_getpid() is to allow it
- * on Windows for logging but not for other purposes.
- *
- * @returns process ID to put in log messages
- */
-unsigned long
-_dbus_pid_for_log (void)
-{
- return _dbus_getpid ();
-}
-
-#ifndef DBUS_WINCE
-
-static BOOL is_winxp_sp3_or_lower()
-{
- OSVERSIONINFOEX osvi;
- DWORDLONG dwlConditionMask = 0;
- int op=VER_LESS_EQUAL;
-
- // Initialize the OSVERSIONINFOEX structure.
-
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- osvi.dwMajorVersion = 5;
- osvi.dwMinorVersion = 1;
- osvi.wServicePackMajor = 3;
- osvi.wServicePackMinor = 0;
-
- // Initialize the condition mask.
-
- VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op );
- VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op );
- VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR, op );
- VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMINOR, op );
-
- // Perform the test.
-
- return VerifyVersionInfo(
- &osvi,
- VER_MAJORVERSION | VER_MINORVERSION |
- VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
- dwlConditionMask);
-}
-
-/** Gets our SID
- * @param sid points to sid buffer, need to be freed with LocalFree()
- * @param process_id the process id for which the sid should be returned
- * @returns process sid
- */
-static dbus_bool_t
-_dbus_getsid(char **sid, dbus_pid_t process_id)
-{
- HANDLE process_token = INVALID_HANDLE_VALUE;
- TOKEN_USER *token_user = NULL;
- DWORD n;
- PSID psid;
- int retval = FALSE;
-
- HANDLE process_handle = OpenProcess(is_winxp_sp3_or_lower() ? PROCESS_QUERY_INFORMATION : PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id);
-
- if (!OpenProcessToken (process_handle, TOKEN_QUERY, &process_token))
- {
- _dbus_win_warn_win_error ("OpenProcessToken failed", GetLastError ());
- goto failed;
- }
- if ((!GetTokenInformation (process_token, TokenUser, NULL, 0, &n)
- && GetLastError () != ERROR_INSUFFICIENT_BUFFER)
- || (token_user = alloca (n)) == NULL
- || !GetTokenInformation (process_token, TokenUser, token_user, n, &n))
- {
- _dbus_win_warn_win_error ("GetTokenInformation failed", GetLastError ());
- goto failed;
- }
- psid = token_user->User.Sid;
- if (!IsValidSid (psid))
- {
- _dbus_verbose("%s invalid sid\n",__FUNCTION__);
- goto failed;
- }
- if (!ConvertSidToStringSidA (psid, sid))
- {
- _dbus_verbose("%s invalid sid\n",__FUNCTION__);
- goto failed;
- }
-//okay:
- retval = TRUE;
-
-failed:
- CloseHandle (process_handle);
- if (process_token != INVALID_HANDLE_VALUE)
- CloseHandle (process_token);
-
- _dbus_verbose("_dbus_getsid() got '%s' and returns %d\n", *sid, retval);
- return retval;
-}
-#endif
-
-/************************************************************************
-
- pipes
-
- ************************************************************************/
-
-/**
- * Creates a full-duplex pipe (as in socketpair()).
- * Sets both ends of the pipe nonblocking.
- *
- * @param fd1 return location for one end
- * @param fd2 return location for the other end
- * @param blocking #TRUE if pipe should be blocking
- * @param error error return
- * @returns #FALSE on failure (if error is set)
- */
-dbus_bool_t
-_dbus_full_duplex_pipe (int *fd1,
- int *fd2,
- dbus_bool_t blocking,
- DBusError *error)
-{
- SOCKET temp, socket1 = -1, socket2 = -1;
- struct sockaddr_in saddr;
- int len;
- u_long arg;
-
- if (!_dbus_win_startup_winsock ())
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- temp = socket (AF_INET, SOCK_STREAM, 0);
- if (temp == INVALID_SOCKET)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out0;
- }
-
- _DBUS_ZERO (saddr);
- saddr.sin_family = AF_INET;
- saddr.sin_port = 0;
- saddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
-
- if (bind (temp, (struct sockaddr *)&saddr, sizeof (saddr)) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out0;
- }
-
- if (listen (temp, 1) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out0;
- }
-
- len = sizeof (saddr);
- if (getsockname (temp, (struct sockaddr *)&saddr, &len) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out0;
- }
-
- socket1 = socket (AF_INET, SOCK_STREAM, 0);
- if (socket1 == INVALID_SOCKET)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out0;
- }
-
- if (connect (socket1, (struct sockaddr *)&saddr, len) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out1;
- }
-
- socket2 = accept (temp, (struct sockaddr *) &saddr, &len);
- if (socket2 == INVALID_SOCKET)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out1;
- }
-
- if (!blocking)
- {
- arg = 1;
- if (ioctlsocket (socket1, FIONBIO, &arg) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out2;
- }
-
- arg = 1;
- if (ioctlsocket (socket2, FIONBIO, &arg) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- goto out2;
- }
- }
-
- *fd1 = socket1;
- *fd2 = socket2;
-
- _dbus_verbose ("full-duplex pipe %d:%d <-> %d:%d\n",
- *fd1, socket1, *fd2, socket2);
-
- closesocket (temp);
-
- return TRUE;
-
-out2:
- closesocket (socket2);
-out1:
- closesocket (socket1);
-out0:
- closesocket (temp);
-
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Could not setup socket pair: %s",
- _dbus_strerror_from_errno ());
-
- return FALSE;
-}
-
-/**
- * Wrapper for poll().
- *
- * @param fds the file descriptors to poll
- * @param n_fds number of descriptors in the array
- * @param timeout_milliseconds timeout or -1 for infinite
- * @returns numbers of fds with revents, or <0 on error
- */
-int
-_dbus_poll (DBusPollFD *fds,
- int n_fds,
- int timeout_milliseconds)
-{
-#define USE_CHRIS_IMPL 0
-
-#if USE_CHRIS_IMPL
-
-#define DBUS_POLL_CHAR_BUFFER_SIZE 2000
- char msg[DBUS_POLL_CHAR_BUFFER_SIZE];
- char *msgp;
-
- int ret = 0;
- int i;
- struct timeval tv;
- int ready;
-
-#define DBUS_STACK_WSAEVENTS 256
- WSAEVENT eventsOnStack[DBUS_STACK_WSAEVENTS];
- WSAEVENT *pEvents = NULL;
- if (n_fds > DBUS_STACK_WSAEVENTS)
- pEvents = calloc(sizeof(WSAEVENT), n_fds);
- else
- pEvents = eventsOnStack;
-
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- msgp = msg;
- msgp += sprintf (msgp, "WSAEventSelect: to=%d\n\t", timeout_milliseconds);
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
-
- if (fdp->events & _DBUS_POLLIN)
- msgp += sprintf (msgp, "R:%d ", fdp->fd);
-
- if (fdp->events & _DBUS_POLLOUT)
- msgp += sprintf (msgp, "W:%d ", fdp->fd);
-
- msgp += sprintf (msgp, "E:%d\n\t", fdp->fd);
-
- // FIXME: more robust code for long msg
- // create on heap when msg[] becomes too small
- if (msgp >= msg + DBUS_POLL_CHAR_BUFFER_SIZE)
- {
- _dbus_assert_not_reached ("buffer overflow in _dbus_poll");
- }
- }
-
- msgp += sprintf (msgp, "\n");
- _dbus_verbose ("%s",msg);
-#endif
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
- WSAEVENT ev;
- long lNetworkEvents = FD_OOB;
-
- ev = WSACreateEvent();
-
- if (fdp->events & _DBUS_POLLIN)
- lNetworkEvents |= FD_READ | FD_ACCEPT | FD_CLOSE;
-
- if (fdp->events & _DBUS_POLLOUT)
- lNetworkEvents |= FD_WRITE | FD_CONNECT;
-
- WSAEventSelect(fdp->fd, ev, lNetworkEvents);
-
- pEvents[i] = ev;
- }
-
-
- ready = WSAWaitForMultipleEvents (n_fds, pEvents, FALSE, timeout_milliseconds, FALSE);
-
- if (DBUS_SOCKET_API_RETURNS_ERROR (ready))
- {
- DBUS_SOCKET_SET_ERRNO ();
- if (errno != WSAEWOULDBLOCK)
- _dbus_verbose ("WSAWaitForMultipleEvents: failed: %s\n", _dbus_strerror_from_errno ());
- ret = -1;
- }
- else if (ready == WSA_WAIT_TIMEOUT)
- {
- _dbus_verbose ("WSAWaitForMultipleEvents: WSA_WAIT_TIMEOUT\n");
- ret = 0;
- }
- else if (ready >= WSA_WAIT_EVENT_0 && ready < (int)(WSA_WAIT_EVENT_0 + n_fds))
- {
- msgp = msg;
- msgp += sprintf (msgp, "WSAWaitForMultipleEvents: =%d\n\t", ready);
-
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
- WSANETWORKEVENTS ne;
-
- fdp->revents = 0;
-
- WSAEnumNetworkEvents(fdp->fd, pEvents[i], &ne);
-
- if (ne.lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE))
- fdp->revents |= _DBUS_POLLIN;
-
- if (ne.lNetworkEvents & (FD_WRITE | FD_CONNECT))
- fdp->revents |= _DBUS_POLLOUT;
-
- if (ne.lNetworkEvents & (FD_OOB))
- fdp->revents |= _DBUS_POLLERR;
-
- if (ne.lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE))
- msgp += sprintf (msgp, "R:%d ", fdp->fd);
-
- if (ne.lNetworkEvents & (FD_WRITE | FD_CONNECT))
- msgp += sprintf (msgp, "W:%d ", fdp->fd);
-
- if (ne.lNetworkEvents & (FD_OOB))
- msgp += sprintf (msgp, "E:%d ", fdp->fd);
-
- msgp += sprintf (msgp, "lNetworkEvents:%d ", ne.lNetworkEvents);
-
- if(ne.lNetworkEvents)
- ret++;
-
- WSAEventSelect(fdp->fd, pEvents[i], 0);
- }
-
- msgp += sprintf (msgp, "\n");
- _dbus_verbose ("%s",msg);
- }
- else
- {
- _dbus_verbose ("WSAWaitForMultipleEvents: failed for unknown reason!");
- ret = -1;
- }
-
- for(i = 0; i < n_fds; i++)
- {
- WSACloseEvent(pEvents[i]);
- }
-
- if (n_fds > DBUS_STACK_WSAEVENTS)
- free(pEvents);
-
- return ret;
-
-#else /* USE_CHRIS_IMPL */
-
-#define DBUS_POLL_CHAR_BUFFER_SIZE 2000
- char msg[DBUS_POLL_CHAR_BUFFER_SIZE];
- char *msgp;
-
- fd_set read_set, write_set, err_set;
- int max_fd = 0;
- int i;
- struct timeval tv;
- int ready;
-
- FD_ZERO (&read_set);
- FD_ZERO (&write_set);
- FD_ZERO (&err_set);
-
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- msgp = msg;
- msgp += sprintf (msgp, "select: to=%d\n\t", timeout_milliseconds);
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
-
- if (fdp->events & _DBUS_POLLIN)
- msgp += sprintf (msgp, "R:%d ", fdp->fd);
-
- if (fdp->events & _DBUS_POLLOUT)
- msgp += sprintf (msgp, "W:%d ", fdp->fd);
-
- msgp += sprintf (msgp, "E:%d\n\t", fdp->fd);
-
- // FIXME: more robust code for long msg
- // create on heap when msg[] becomes too small
- if (msgp >= msg + DBUS_POLL_CHAR_BUFFER_SIZE)
- {
- _dbus_assert_not_reached ("buffer overflow in _dbus_poll");
- }
- }
-
- msgp += sprintf (msgp, "\n");
- _dbus_verbose ("%s",msg);
-#endif
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
- if (fdp->events & _DBUS_POLLIN)
- FD_SET (fdp->fd, &read_set);
-
- if (fdp->events & _DBUS_POLLOUT)
- FD_SET (fdp->fd, &write_set);
-
- FD_SET (fdp->fd, &err_set);
-
- max_fd = MAX (max_fd, fdp->fd);
- }
-
- // Avoid random lockups with send(), for lack of a better solution so far
- tv.tv_sec = timeout_milliseconds < 0 ? 1 : timeout_milliseconds / 1000;
- tv.tv_usec = timeout_milliseconds < 0 ? 0 : (timeout_milliseconds % 1000) * 1000;
-
- ready = select (max_fd + 1, &read_set, &write_set, &err_set, &tv);
-
- if (DBUS_SOCKET_API_RETURNS_ERROR (ready))
- {
- DBUS_SOCKET_SET_ERRNO ();
- if (errno != WSAEWOULDBLOCK)
- _dbus_verbose ("select: failed: %s\n", _dbus_strerror_from_errno ());
- }
- else if (ready == 0)
- _dbus_verbose ("select: = 0\n");
- else
- if (ready > 0)
- {
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- msgp = msg;
- msgp += sprintf (msgp, "select: = %d:\n\t", ready);
-
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
- if (FD_ISSET (fdp->fd, &read_set))
- msgp += sprintf (msgp, "R:%d ", fdp->fd);
-
- if (FD_ISSET (fdp->fd, &write_set))
- msgp += sprintf (msgp, "W:%d ", fdp->fd);
-
- if (FD_ISSET (fdp->fd, &err_set))
- msgp += sprintf (msgp, "E:%d\n\t", fdp->fd);
- }
- msgp += sprintf (msgp, "\n");
- _dbus_verbose ("%s",msg);
-#endif
-
- for (i = 0; i < n_fds; i++)
- {
- DBusPollFD *fdp = &fds[i];
-
- fdp->revents = 0;
-
- if (FD_ISSET (fdp->fd, &read_set))
- fdp->revents |= _DBUS_POLLIN;
-
- if (FD_ISSET (fdp->fd, &write_set))
- fdp->revents |= _DBUS_POLLOUT;
-
- if (FD_ISSET (fdp->fd, &err_set))
- fdp->revents |= _DBUS_POLLERR;
- }
- }
- return ready;
-#endif /* USE_CHRIS_IMPL */
-}
-
-
-
-
-/******************************************************************************
-
-Original CVS version of dbus-sysdeps.c
-
-******************************************************************************/
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.c Wrappers around system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2005 Novell, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-
-/**
- * Exit the process, returning the given value.
- *
- * @param code the exit code
- */
-void
-_dbus_exit (int code)
-{
- _exit (code);
-}
-
-/**
- * Creates a socket and connects to a socket at the given host
- * and port. The connection fd is returned, and is set up as
- * nonblocking.
- *
- * @param host the host name to connect to
- * @param port the port to connect to
- * @param family the address family to listen on, NULL for all
- * @param error return location for error code
- * @returns connection file descriptor or -1 on error
- */
-int
-_dbus_connect_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusError *error)
-{
- return _dbus_connect_tcp_socket_with_nonce (host, port, family, (const char*)NULL, error);
-}
-
-int
-_dbus_connect_tcp_socket_with_nonce (const char *host,
- const char *port,
- const char *family,
- const char *noncefile,
- DBusError *error)
-{
- int fd = -1, res;
- struct addrinfo hints;
- struct addrinfo *ai, *tmp;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_win_startup_winsock ())
- {
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- _DBUS_ZERO (hints);
-
- if (!family)
- hints.ai_family = AF_UNSPEC;
- else if (!strcmp(family, "ipv4"))
- hints.ai_family = AF_INET;
- else if (!strcmp(family, "ipv6"))
- hints.ai_family = AF_INET6;
- else
- {
- dbus_set_error (error,
- DBUS_ERROR_INVALID_ARGS,
- "Unknown address family %s", family);
- return -1;
- }
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
- hints.ai_flags = AI_ADDRCONFIG;
-#else
- hints.ai_flags = 0;
-#endif
-
- if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (res),
- "Failed to lookup host/port: \"%s:%s\": %s (%d)",
- host, port, _dbus_strerror(res), res);
- return -1;
- }
-
- tmp = ai;
- while (tmp)
- {
- if ((fd = socket (tmp->ai_family, SOCK_STREAM, 0)) == INVALID_SOCKET)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to open socket: %s",
- _dbus_strerror_from_errno ());
- freeaddrinfo(ai);
- return -1;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- if (connect (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- closesocket(fd);
- fd = -1;
- tmp = tmp->ai_next;
- continue;
- }
-
- break;
- }
- freeaddrinfo(ai);
-
- if (fd == -1)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to connect to socket \"%s:%s\" %s",
- host, port, _dbus_strerror_from_errno ());
- return -1;
- }
-
- if (noncefile != NULL)
- {
- DBusString noncefileStr;
- dbus_bool_t ret;
- if (!_dbus_string_init (&noncefileStr) ||
- !_dbus_string_append(&noncefileStr, noncefile))
- {
- closesocket (fd);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return -1;
- }
-
- ret = _dbus_send_nonce (fd, &noncefileStr, error);
-
- _dbus_string_free (&noncefileStr);
-
- if (!ret)
- {
- closesocket (fd);
- return -1;
- }
- }
-
- _dbus_fd_set_close_on_exec (fd);
-
- if (!_dbus_set_fd_nonblocking (fd, error))
- {
- closesocket (fd);
- return -1;
- }
-
- return fd;
-}
-
-/**
- * Creates a socket and binds it to the given path, then listens on
- * the socket. The socket is set to be nonblocking. In case of port=0
- * a random free port is used and returned in the port parameter.
- * If inaddr_any is specified, the hostname is ignored.
- *
- * @param host the host name to listen on
- * @param port the port to listen on, if zero a free port will be used
- * @param family the address family to listen on, NULL for all
- * @param retport string to return the actual port listened on
- * @param fds_p location to store returned file descriptors
- * @param error return location for errors
- * @returns the number of listening file descriptors or -1 on error
- */
-
-int
-_dbus_listen_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusString *retport,
- int **fds_p,
- DBusError *error)
-{
- int nlisten_fd = 0, *listen_fd = NULL, res, i, port_num = -1;
- struct addrinfo hints;
- struct addrinfo *ai, *tmp;
-
- // On Vista, sockaddr_gen must be a sockaddr_in6, and not a sockaddr_in6_old
- //That's required for family == IPv6(which is the default on Vista if family is not given)
- //So we use our own union instead of sockaddr_gen:
-
- typedef union {
- struct sockaddr Address;
- struct sockaddr_in AddressIn;
- struct sockaddr_in6 AddressIn6;
- } mysockaddr_gen;
-
- *fds_p = NULL;
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_win_startup_winsock ())
- {
- _DBUS_SET_OOM (error);
- return -1;
- }
-
- _DBUS_ZERO (hints);
-
- if (!family)
- hints.ai_family = AF_UNSPEC;
- else if (!strcmp(family, "ipv4"))
- hints.ai_family = AF_INET;
- else if (!strcmp(family, "ipv6"))
- hints.ai_family = AF_INET6;
- else
- {
- dbus_set_error (error,
- DBUS_ERROR_INVALID_ARGS,
- "Unknown address family %s", family);
- return -1;
- }
-
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
- hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
-#else
- hints.ai_flags = AI_PASSIVE;
-#endif
-
- redo_lookup_with_port:
- if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)
- {
- dbus_set_error (error,
- _dbus_error_from_errno (res),
- "Failed to lookup host/port: \"%s:%s\": %s (%d)",
- host ? host : "*", port, _dbus_strerror(res), res);
- return -1;
- }
-
- tmp = ai;
- while (tmp)
- {
- int fd = -1, *newlisten_fd;
- if ((fd = socket (tmp->ai_family, SOCK_STREAM, 0)) == INVALID_SOCKET)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error,
- _dbus_error_from_errno (errno),
- "Failed to open socket: %s",
- _dbus_strerror_from_errno ());
- goto failed;
- }
- _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-
- if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to bind socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror_from_errno ());
- closesocket (fd);
- goto failed;
- }
-
- if (listen (fd, 30 /* backlog */) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to listen on socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror_from_errno ());
- closesocket (fd);
- goto failed;
- }
-
- newlisten_fd = dbus_realloc(listen_fd, sizeof(int)*(nlisten_fd+1));
- if (!newlisten_fd)
- {
- closesocket (fd);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "Failed to allocate file handle array");
- goto failed;
- }
- listen_fd = newlisten_fd;
- listen_fd[nlisten_fd] = fd;
- nlisten_fd++;
-
- if (!_dbus_string_get_length(retport))
- {
- /* If the user didn't specify a port, or used 0, then
- the kernel chooses a port. After the first address
- is bound to, we need to force all remaining addresses
- to use the same port */
- if (!port || !strcmp(port, "0"))
- {
- mysockaddr_gen addr;
- socklen_t addrlen = sizeof(addr);
- char portbuf[10];
-
- if (getsockname(fd, &addr.Address, &addrlen) == SOCKET_ERROR)
- {
- DBUS_SOCKET_SET_ERRNO ();
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to resolve port \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror_from_errno());
- goto failed;
- }
- snprintf( portbuf, sizeof( portbuf ) - 1, "%d", addr.AddressIn.sin_port );
- if (!_dbus_string_append(retport, portbuf))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- /* Release current address list & redo lookup */
- port = _dbus_string_get_const_data(retport);
- freeaddrinfo(ai);
- goto redo_lookup_with_port;
- }
- else
- {
- if (!_dbus_string_append(retport, port))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
- }
- }
-
- tmp = tmp->ai_next;
- }
- freeaddrinfo(ai);
- ai = NULL;
-
- if (!nlisten_fd)
- {
- _dbus_win_set_errno (WSAEADDRINUSE);
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to bind socket \"%s:%s\": %s",
- host ? host : "*", port, _dbus_strerror_from_errno ());
- return -1;
- }
-
- sscanf(_dbus_string_get_const_data(retport), "%d", &port_num);
-
- for (i = 0 ; i < nlisten_fd ; i++)
- {
- _dbus_fd_set_close_on_exec (listen_fd[i]);
- if (!_dbus_set_fd_nonblocking (listen_fd[i], error))
- {
- goto failed;
- }
- }
-
- *fds_p = listen_fd;
-
- return nlisten_fd;
-
- failed:
- if (ai)
- freeaddrinfo(ai);
- for (i = 0 ; i < nlisten_fd ; i++)
- closesocket (listen_fd[i]);
- dbus_free(listen_fd);
- return -1;
-}
-
-
-/**
- * Accepts a connection on a listening socket.
- * Handles EINTR for you.
- *
- * @param listen_fd the listen file descriptor
- * @returns the connection fd of the client, or -1 on error
- */
-int
-_dbus_accept (int listen_fd)
-{
- int client_fd;
-
- retry:
- client_fd = accept (listen_fd, NULL, NULL);
-
- if (DBUS_SOCKET_IS_INVALID (client_fd))
- {
- DBUS_SOCKET_SET_ERRNO ();
- if (errno == EINTR)
- goto retry;
- }
-
- _dbus_verbose ("client fd %d accepted\n", client_fd);
-
- return client_fd;
-}
-
-
-
-
-dbus_bool_t
-_dbus_send_credentials_socket (int handle,
- DBusError *error)
-{
-/* FIXME: for the session bus credentials shouldn't matter (?), but
- * for the system bus they are presumably essential. A rough outline
- * of a way to implement the credential transfer would be this:
- *
- * client waits to *read* a byte.
- *
- * server creates a named pipe with a random name, sends a byte
- * contining its length, and its name.
- *
- * client reads the name, connects to it (using Win32 API).
- *
- * server waits for connection to the named pipe, then calls
- * ImpersonateNamedPipeClient(), notes its now-current credentials,
- * calls RevertToSelf(), closes its handles to the named pipe, and
- * is done. (Maybe there is some other way to get the SID of a named
- * pipe client without having to use impersonation?)
- *
- * client closes its handles and is done.
- *
- * Ralf: Why not sending credentials over the given this connection ?
- * Using named pipes makes it impossible to be connected from a unix client.
- *
- */
- int bytes_written;
- DBusString buf;
-
- _dbus_string_init_const_len (&buf, "\0", 1);
-again:
- bytes_written = _dbus_write_socket (handle, &buf, 0, 1 );
-
- if (bytes_written < 0 && errno == EINTR)
- goto again;
-
- if (bytes_written < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to write credentials byte: %s",
- _dbus_strerror_from_errno ());
- return FALSE;
- }
- else if (bytes_written == 0)
- {
- dbus_set_error (error, DBUS_ERROR_IO_ERROR,
- "wrote zero bytes writing credentials byte");
- return FALSE;
- }
- else
- {
- _dbus_assert (bytes_written == 1);
- _dbus_verbose ("wrote 1 zero byte, credential sending isn't implemented yet\n");
- return TRUE;
- }
- return TRUE;
-}
-
-/**
- * Reads a single byte which must be nul (an error occurs otherwise),
- * and reads unix credentials if available. Fills in pid/uid/gid with
- * -1 if no credentials are available. Return value indicates whether
- * a byte was read, not whether we got valid credentials. On some
- * systems, such as Linux, reading/writing the byte isn't actually
- * required, but we do it anyway just to avoid multiple codepaths.
- *
- * Fails if no byte is available, so you must select() first.
- *
- * The point of the byte is that on some systems we have to
- * use sendmsg()/recvmsg() to transmit credentials.
- *
- * @param handle the client file descriptor
- * @param credentials struct to fill with credentials of client
- * @param error location to store error code
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_read_credentials_socket (int handle,
- DBusCredentials *credentials,
- DBusError *error)
-{
- int bytes_read = 0;
- DBusString buf;
-
- char *sid = NULL;
- dbus_pid_t pid;
- int retval = FALSE;
-
- // could fail due too OOM
- if (_dbus_string_init (&buf))
- {
- bytes_read = _dbus_read_socket (handle, &buf, 1 );
-
- if (bytes_read > 0)
- _dbus_verbose ("got one zero byte from server\n");
-
- _dbus_string_free (&buf);
- }
-
- pid = _dbus_get_peer_pid_from_tcp_handle (handle);
- if (pid == 0)
- return TRUE;
-
- _dbus_credentials_add_pid (credentials, pid);
-
- if (_dbus_getsid (&sid, pid))
- {
- if (!_dbus_credentials_add_windows_sid (credentials, sid))
- goto out;
- }
-
- retval = TRUE;
-
-out:
- if (sid)
- LocalFree (sid);
-
- return retval;
-}
-
-/**
-* Checks to make sure the given directory is
-* private to the user
-*
-* @param dir the name of the directory
-* @param error error return
-* @returns #FALSE on failure
-**/
-dbus_bool_t
-_dbus_check_dir_is_private_to_user (DBusString *dir, DBusError *error)
-{
- /* TODO */
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return TRUE;
-}
-
-
-/**
- * Appends the given filename to the given directory.
- *
- * @todo it might be cute to collapse multiple '/' such as "foo//"
- * concat "//bar"
- *
- * @param dir the directory name
- * @param next_component the filename
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_concat_dir_and_file (DBusString *dir,
- const DBusString *next_component)
-{
- dbus_bool_t dir_ends_in_slash;
- dbus_bool_t file_starts_with_slash;
-
- if (_dbus_string_get_length (dir) == 0 ||
- _dbus_string_get_length (next_component) == 0)
- return TRUE;
-
- dir_ends_in_slash =
- ('/' == _dbus_string_get_byte (dir, _dbus_string_get_length (dir) - 1) ||
- '\\' == _dbus_string_get_byte (dir, _dbus_string_get_length (dir) - 1));
-
- file_starts_with_slash =
- ('/' == _dbus_string_get_byte (next_component, 0) ||
- '\\' == _dbus_string_get_byte (next_component, 0));
-
- if (dir_ends_in_slash && file_starts_with_slash)
- {
- _dbus_string_shorten (dir, 1);
- }
- else if (!(dir_ends_in_slash || file_starts_with_slash))
- {
- if (!_dbus_string_append_byte (dir, '\\'))
- return FALSE;
- }
-
- return _dbus_string_copy (next_component, 0, dir,
- _dbus_string_get_length (dir));
-}
-
-/*---------------- DBusCredentials ----------------------------------*/
-
-/**
- * Adds the credentials corresponding to the given username.
- *
- * @param credentials credentials to fill in
- * @param username the username
- * @returns #TRUE if the username existed and we got some credentials
- */
-dbus_bool_t
-_dbus_credentials_add_from_user (DBusCredentials *credentials,
- const DBusString *username)
-{
- return _dbus_credentials_add_windows_sid (credentials,
- _dbus_string_get_const_data(username));
-}
-
-/**
- * Adds the credentials of the current process to the
- * passed-in credentials object.
- *
- * @param credentials credentials to add to
- * @returns #FALSE if no memory; does not properly roll back on failure, so only some credentials may have been added
- */
-
-dbus_bool_t
-_dbus_credentials_add_from_current_process (DBusCredentials *credentials)
-{
- dbus_bool_t retval = FALSE;
- char *sid = NULL;
-
- if (!_dbus_getsid(&sid, _dbus_getpid()))
- goto failed;
-
- if (!_dbus_credentials_add_pid (credentials, _dbus_getpid()))
- goto failed;
-
- if (!_dbus_credentials_add_windows_sid (credentials,sid))
- goto failed;
-
- retval = TRUE;
- goto end;
-failed:
- retval = FALSE;
-end:
- if (sid)
- LocalFree(sid);
-
- return retval;
-}
-
-/**
- * Append to the string the identity we would like to have when we
- * authenticate, on UNIX this is the current process UID and on
- * Windows something else, probably a Windows SID string. No escaping
- * is required, that is done in dbus-auth.c. The username here
- * need not be anything human-readable, it can be the machine-readable
- * form i.e. a user id.
- *
- * @param str the string to append to
- * @returns #FALSE on no memory
- * @todo to which class belongs this
- */
-dbus_bool_t
-_dbus_append_user_from_current_process (DBusString *str)
-{
- dbus_bool_t retval = FALSE;
- char *sid = NULL;
-
- if (!_dbus_getsid(&sid, _dbus_getpid()))
- return FALSE;
-
- retval = _dbus_string_append (str,sid);
-
- LocalFree(sid);
- return retval;
-}
-
-/**
- * Gets our process ID
- * @returns process ID
- */
-dbus_pid_t
-_dbus_getpid (void)
-{
- return GetCurrentProcessId ();
-}
-
-/** nanoseconds in a second */
-#define NANOSECONDS_PER_SECOND 1000000000
-/** microseconds in a second */
-#define MICROSECONDS_PER_SECOND 1000000
-/** milliseconds in a second */
-#define MILLISECONDS_PER_SECOND 1000
-/** nanoseconds in a millisecond */
-#define NANOSECONDS_PER_MILLISECOND 1000000
-/** microseconds in a millisecond */
-#define MICROSECONDS_PER_MILLISECOND 1000
-
-/**
- * Sleeps the given number of milliseconds.
- * @param milliseconds number of milliseconds
- */
-void
-_dbus_sleep_milliseconds (int milliseconds)
-{
- Sleep (milliseconds);
-}
-
-
-/**
- * Get current time, as in gettimeofday(). Never uses the monotonic
- * clock.
- *
- * @param tv_sec return location for number of seconds
- * @param tv_usec return location for number of microseconds
- */
-void
-_dbus_get_real_time (long *tv_sec,
- long *tv_usec)
-{
- FILETIME ft;
- dbus_uint64_t time64;
-
- GetSystemTimeAsFileTime (&ft);
-
- memcpy (&time64, &ft, sizeof (time64));
-
- /* Convert from 100s of nanoseconds since 1601-01-01
- * to Unix epoch. Yes, this is Y2038 unsafe.
- */
- time64 -= DBUS_INT64_CONSTANT (116444736000000000);
- time64 /= 10;
-
- if (tv_sec)
- *tv_sec = time64 / 1000000;
-
- if (tv_usec)
- *tv_usec = time64 % 1000000;
-}
-
-/**
- * Get current time, as in gettimeofday(). Use the monotonic clock if
- * available, to avoid problems when the system time changes.
- *
- * @param tv_sec return location for number of seconds
- * @param tv_usec return location for number of microseconds
- */
-void
-_dbus_get_monotonic_time (long *tv_sec,
- long *tv_usec)
-{
- /* no implementation yet, fall back to wall-clock time */
- _dbus_get_real_time (tv_sec, tv_usec);
-}
-
-/**
- * signal (SIGPIPE, SIG_IGN);
- */
-void
-_dbus_disable_sigpipe (void)
-{
-}
-
-/**
- * Creates a directory; succeeds if the directory
- * is created or already existed.
- *
- * @param filename directory filename
- * @param error initialized error object
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_create_directory (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (!CreateDirectoryA (filename_c, NULL))
- {
- if (GetLastError () == ERROR_ALREADY_EXISTS)
- return TRUE;
-
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to create directory %s: %s\n",
- filename_c, _dbus_strerror_from_errno ());
- return FALSE;
- }
- else
- return TRUE;
-}
-
-
-/**
- * Generates the given number of random bytes,
- * using the best mechanism we can come up with.
- *
- * @param str the string
- * @param n_bytes the number of random bytes to append to string
- * @returns #TRUE on success, #FALSE if no memory
- */
-dbus_bool_t
-_dbus_generate_random_bytes (DBusString *str,
- int n_bytes)
-{
- int old_len;
- char *p;
- HCRYPTPROV hprov;
-
- old_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_lengthen (str, n_bytes))
- return FALSE;
-
- p = _dbus_string_get_data_len (str, old_len, n_bytes);
-
- if (!CryptAcquireContext (&hprov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
- return FALSE;
-
- if (!CryptGenRandom (hprov, n_bytes, p))
- {
- CryptReleaseContext (hprov, 0);
- return FALSE;
- }
-
- CryptReleaseContext (hprov, 0);
-
- return TRUE;
-}
-
-/**
- * Gets the temporary files directory by inspecting the environment variables
- * TMPDIR, TMP, and TEMP in that order. If none of those are set "/tmp" is returned
- *
- * @returns location of temp directory, or #NULL if no memory for locking
- */
-const char*
-_dbus_get_tmpdir(void)
-{
- /* Protected by _DBUS_LOCK_sysdeps */
- static const char* tmpdir = NULL;
- static char buf[1000];
-
- if (!_DBUS_LOCK (sysdeps))
- return NULL;
-
- if (tmpdir == NULL)
- {
- char *last_slash;
-
- if (!GetTempPathA (sizeof (buf), buf))
- {
- _dbus_warn ("GetTempPath failed\n");
- _dbus_abort ();
- }
-
- /* Drop terminating backslash or slash */
- last_slash = _mbsrchr (buf, '\\');
- if (last_slash > buf && last_slash[1] == '\0')
- last_slash[0] = '\0';
- last_slash = _mbsrchr (buf, '/');
- if (last_slash > buf && last_slash[1] == '\0')
- last_slash[0] = '\0';
-
- tmpdir = buf;
- }
-
- _DBUS_UNLOCK (sysdeps);
-
- _dbus_assert(tmpdir != NULL);
-
- return tmpdir;
-}
-
-
-/**
- * Deletes the given file.
- *
- * @param filename the filename
- * @param error error location
- *
- * @returns #TRUE if unlink() succeeded
- */
-dbus_bool_t
-_dbus_delete_file (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (DeleteFileA (filename_c) == 0)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Failed to delete file %s: %s\n",
- filename_c, _dbus_strerror_from_errno ());
- return FALSE;
- }
- else
- return TRUE;
-}
-
-#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_ENABLE_EMBEDDED_TESTS)
-
-#if defined(_MSC_VER) || defined(DBUS_WINCE)
-# ifdef BACKTRACES
-# undef BACKTRACES
-# endif
-#else
-# define BACKTRACES
-#endif
-
-#ifdef BACKTRACES
-/*
- * Backtrace Generator
- *
- * Copyright 2004 Eric Poech
- * Copyright 2004 Robert Shearman
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <winver.h>
-#include <imagehlp.h>
-#include <stdio.h>
-
-#define DPRINTF _dbus_warn
-
-#ifdef _MSC_VER
-#define BOOL int
-
-#define __i386__
-#endif
-
-//#define MAKE_FUNCPTR(f) static typeof(f) * p##f
-
-//MAKE_FUNCPTR(StackWalk);
-//MAKE_FUNCPTR(SymGetModuleBase);
-//MAKE_FUNCPTR(SymFunctionTableAccess);
-//MAKE_FUNCPTR(SymInitialize);
-//MAKE_FUNCPTR(SymGetSymFromAddr);
-//MAKE_FUNCPTR(SymGetModuleInfo);
-static BOOL (WINAPI *pStackWalk)(
- DWORD MachineType,
- HANDLE hProcess,
- HANDLE hThread,
- LPSTACKFRAME StackFrame,
- PVOID ContextRecord,
- PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
- PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
- PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
- PTRANSLATE_ADDRESS_ROUTINE TranslateAddress
-);
-#ifdef _WIN64
-static DWORD64 (WINAPI *pSymGetModuleBase)(
- HANDLE hProcess,
- DWORD64 dwAddr
-);
-static PVOID (WINAPI *pSymFunctionTableAccess)(
- HANDLE hProcess,
- DWORD64 AddrBase
-);
-#else
-static DWORD (WINAPI *pSymGetModuleBase)(
- HANDLE hProcess,
- DWORD dwAddr
-);
-static PVOID (WINAPI *pSymFunctionTableAccess)(
- HANDLE hProcess,
- DWORD AddrBase
-);
-#endif
-static BOOL (WINAPI *pSymInitialize)(
- HANDLE hProcess,
- PSTR UserSearchPath,
- BOOL fInvadeProcess
-);
-static BOOL (WINAPI *pSymGetSymFromAddr)(
- HANDLE hProcess,
- DWORD Address,
- PDWORD Displacement,
- PIMAGEHLP_SYMBOL Symbol
-);
-static BOOL (WINAPI *pSymGetModuleInfo)(
- HANDLE hProcess,
- DWORD dwAddr,
- PIMAGEHLP_MODULE ModuleInfo
-);
-static DWORD (WINAPI *pSymSetOptions)(
- DWORD SymOptions
-);
-
-
-static BOOL init_backtrace()
-{
- HMODULE hmodDbgHelp = LoadLibraryA("dbghelp");
-/*
- #define GETFUNC(x) \
- p##x = (typeof(x)*)GetProcAddress(hmodDbgHelp, #x); \
- if (!p##x) \
- { \
- return FALSE; \
- }
- */
-
-
-// GETFUNC(StackWalk);
-// GETFUNC(SymGetModuleBase);
-// GETFUNC(SymFunctionTableAccess);
-// GETFUNC(SymInitialize);
-// GETFUNC(SymGetSymFromAddr);
-// GETFUNC(SymGetModuleInfo);
-
-#define FUNC(x) #x
-
- pStackWalk = (BOOL (WINAPI *)(
-DWORD MachineType,
-HANDLE hProcess,
-HANDLE hThread,
-LPSTACKFRAME StackFrame,
-PVOID ContextRecord,
-PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
-PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
-PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
-PTRANSLATE_ADDRESS_ROUTINE TranslateAddress
-))GetProcAddress (hmodDbgHelp, FUNC(StackWalk));
-#ifdef _WIN64
- pSymGetModuleBase=(DWORD64 (WINAPI *)(
- HANDLE hProcess,
- DWORD64 dwAddr
-))GetProcAddress (hmodDbgHelp, FUNC(SymGetModuleBase));
- pSymFunctionTableAccess=(PVOID (WINAPI *)(
- HANDLE hProcess,
- DWORD64 AddrBase
-))GetProcAddress (hmodDbgHelp, FUNC(SymFunctionTableAccess));
-#else
- pSymGetModuleBase=(DWORD (WINAPI *)(
- HANDLE hProcess,
- DWORD dwAddr
-))GetProcAddress (hmodDbgHelp, FUNC(SymGetModuleBase));
- pSymFunctionTableAccess=(PVOID (WINAPI *)(
- HANDLE hProcess,
- DWORD AddrBase
-))GetProcAddress (hmodDbgHelp, FUNC(SymFunctionTableAccess));
-#endif
- pSymInitialize = (BOOL (WINAPI *)(
- HANDLE hProcess,
- PSTR UserSearchPath,
- BOOL fInvadeProcess
-))GetProcAddress (hmodDbgHelp, FUNC(SymInitialize));
- pSymGetSymFromAddr = (BOOL (WINAPI *)(
- HANDLE hProcess,
- DWORD Address,
- PDWORD Displacement,
- PIMAGEHLP_SYMBOL Symbol
-))GetProcAddress (hmodDbgHelp, FUNC(SymGetSymFromAddr));
- pSymGetModuleInfo = (BOOL (WINAPI *)(
- HANDLE hProcess,
- DWORD dwAddr,
- PIMAGEHLP_MODULE ModuleInfo
-))GetProcAddress (hmodDbgHelp, FUNC(SymGetModuleInfo));
-pSymSetOptions = (DWORD (WINAPI *)(
-DWORD SymOptions
-))GetProcAddress (hmodDbgHelp, FUNC(SymSetOptions));
-
-
- pSymSetOptions(SYMOPT_UNDNAME);
-
- pSymInitialize(GetCurrentProcess(), NULL, TRUE);
-
- return TRUE;
-}
-
-static void dump_backtrace_for_thread(HANDLE hThread)
-{
- STACKFRAME sf;
- CONTEXT context;
- DWORD dwImageType;
-
- if (!pStackWalk)
- if (!init_backtrace())
- return;
-
- /* can't use this function for current thread as GetThreadContext
- * doesn't support getting context from current thread */
- if (hThread == GetCurrentThread())
- return;
-
- DPRINTF("Backtrace:\n");
-
- _DBUS_ZERO(context);
- context.ContextFlags = CONTEXT_FULL;
-
- SuspendThread(hThread);
-
- if (!GetThreadContext(hThread, &context))
- {
- DPRINTF("Couldn't get thread context (error %ld)\n", GetLastError());
- ResumeThread(hThread);
- return;
- }
-
- _DBUS_ZERO(sf);
-
-#ifdef __i386__
- sf.AddrFrame.Offset = context.Ebp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrPC.Offset = context.Eip;
- sf.AddrPC.Mode = AddrModeFlat;
- dwImageType = IMAGE_FILE_MACHINE_I386;
-#elif _M_X64
- dwImageType = IMAGE_FILE_MACHINE_AMD64;
- sf.AddrPC.Offset = context.Rip;
- sf.AddrPC.Mode = AddrModeFlat;
- sf.AddrFrame.Offset = context.Rsp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrStack.Offset = context.Rsp;
- sf.AddrStack.Mode = AddrModeFlat;
-#elif _M_IA64
- dwImageType = IMAGE_FILE_MACHINE_IA64;
- sf.AddrPC.Offset = context.StIIP;
- sf.AddrPC.Mode = AddrModeFlat;
- sf.AddrFrame.Offset = context.IntSp;
- sf.AddrFrame.Mode = AddrModeFlat;
- sf.AddrBStore.Offset= context.RsBSP;
- sf.AddrBStore.Mode = AddrModeFlat;
- sf.AddrStack.Offset = context.IntSp;
- sf.AddrStack.Mode = AddrModeFlat;
-#else
-# error You need to fill in the STACKFRAME structure for your architecture
-#endif
-
- while (pStackWalk(dwImageType, GetCurrentProcess(),
- hThread, &sf, &context, NULL, pSymFunctionTableAccess,
- pSymGetModuleBase, NULL))
- {
- BYTE buffer[256];
- IMAGEHLP_SYMBOL * pSymbol = (IMAGEHLP_SYMBOL *)buffer;
- DWORD dwDisplacement;
-
- pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
- pSymbol->MaxNameLength = sizeof(buffer) - sizeof(IMAGEHLP_SYMBOL) + 1;
-
- if (!pSymGetSymFromAddr(GetCurrentProcess(), sf.AddrPC.Offset,
- &dwDisplacement, pSymbol))
- {
- IMAGEHLP_MODULE ModuleInfo;
- ModuleInfo.SizeOfStruct = sizeof(ModuleInfo);
-
- if (!pSymGetModuleInfo(GetCurrentProcess(), sf.AddrPC.Offset,
- &ModuleInfo))
- DPRINTF("1\t%p\n", (void*)sf.AddrPC.Offset);
- else
- DPRINTF("2\t%s+0x%lx\n", ModuleInfo.ImageName,
- sf.AddrPC.Offset - ModuleInfo.BaseOfImage);
- }
- else if (dwDisplacement)
- DPRINTF("3\t%s+0x%lx\n", pSymbol->Name, dwDisplacement);
- else
- DPRINTF("4\t%s\n", pSymbol->Name);
- }
-
- ResumeThread(hThread);
-}
-
-static DWORD WINAPI dump_thread_proc(LPVOID lpParameter)
-{
- dump_backtrace_for_thread((HANDLE)lpParameter);
- return 0;
-}
-
-/* cannot get valid context from current thread, so we have to execute
- * backtrace from another thread */
-static void dump_backtrace()
-{
- HANDLE hCurrentThread;
- HANDLE hThread;
- DWORD dwThreadId;
- DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
- GetCurrentProcess(), &hCurrentThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
- hThread = CreateThread(NULL, 0, dump_thread_proc, (LPVOID)hCurrentThread,
- 0, &dwThreadId);
- WaitForSingleObject(hThread, INFINITE);
- CloseHandle(hThread);
- CloseHandle(hCurrentThread);
-}
-#endif
-#endif /* asserts or tests enabled */
-
-#ifdef BACKTRACES
-void _dbus_print_backtrace(void)
-{
- init_backtrace();
- dump_backtrace();
-}
-#else
-void _dbus_print_backtrace(void)
-{
- _dbus_verbose (" D-Bus not compiled with backtrace support\n");
-}
-#endif
-
-static dbus_uint32_t fromAscii(char ascii)
-{
- if(ascii >= '0' && ascii <= '9')
- return ascii - '0';
- if(ascii >= 'A' && ascii <= 'F')
- return ascii - 'A' + 10;
- if(ascii >= 'a' && ascii <= 'f')
- return ascii - 'a' + 10;
- return 0;
-}
-
-dbus_bool_t _dbus_read_local_machine_uuid (DBusGUID *machine_id,
- dbus_bool_t create_if_not_found,
- DBusError *error)
-{
-#ifdef DBUS_WINCE
- return TRUE;
- // TODO
-#else
- HW_PROFILE_INFOA info;
- char *lpc = &info.szHwProfileGuid[0];
- dbus_uint32_t u;
-
- // the hw-profile guid lives long enough
- if(!GetCurrentHwProfileA(&info))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); // FIXME
- return FALSE;
- }
-
- // Form: {12340001-4980-1920-6788-123456789012}
- lpc++;
- // 12340001
- u = ((fromAscii(lpc[0]) << 0) |
- (fromAscii(lpc[1]) << 4) |
- (fromAscii(lpc[2]) << 8) |
- (fromAscii(lpc[3]) << 12) |
- (fromAscii(lpc[4]) << 16) |
- (fromAscii(lpc[5]) << 20) |
- (fromAscii(lpc[6]) << 24) |
- (fromAscii(lpc[7]) << 28));
- machine_id->as_uint32s[0] = u;
-
- lpc += 9;
- // 4980-1920
- u = ((fromAscii(lpc[0]) << 0) |
- (fromAscii(lpc[1]) << 4) |
- (fromAscii(lpc[2]) << 8) |
- (fromAscii(lpc[3]) << 12) |
- (fromAscii(lpc[5]) << 16) |
- (fromAscii(lpc[6]) << 20) |
- (fromAscii(lpc[7]) << 24) |
- (fromAscii(lpc[8]) << 28));
- machine_id->as_uint32s[1] = u;
-
- lpc += 10;
- // 6788-1234
- u = ((fromAscii(lpc[0]) << 0) |
- (fromAscii(lpc[1]) << 4) |
- (fromAscii(lpc[2]) << 8) |
- (fromAscii(lpc[3]) << 12) |
- (fromAscii(lpc[5]) << 16) |
- (fromAscii(lpc[6]) << 20) |
- (fromAscii(lpc[7]) << 24) |
- (fromAscii(lpc[8]) << 28));
- machine_id->as_uint32s[2] = u;
-
- lpc += 9;
- // 56789012
- u = ((fromAscii(lpc[0]) << 0) |
- (fromAscii(lpc[1]) << 4) |
- (fromAscii(lpc[2]) << 8) |
- (fromAscii(lpc[3]) << 12) |
- (fromAscii(lpc[4]) << 16) |
- (fromAscii(lpc[5]) << 20) |
- (fromAscii(lpc[6]) << 24) |
- (fromAscii(lpc[7]) << 28));
- machine_id->as_uint32s[3] = u;
-#endif
- return TRUE;
-}
-
-static
-HANDLE _dbus_global_lock (const char *mutexname)
-{
- HANDLE mutex;
- DWORD gotMutex;
-
- mutex = CreateMutexA( NULL, FALSE, mutexname );
- if( !mutex )
- {
- return FALSE;
- }
-
- gotMutex = WaitForSingleObject( mutex, INFINITE );
- switch( gotMutex )
- {
- case WAIT_ABANDONED:
- ReleaseMutex (mutex);
- CloseHandle (mutex);
- return 0;
- case WAIT_FAILED:
- case WAIT_TIMEOUT:
- return 0;
- }
-
- return mutex;
-}
-
-static
-void _dbus_global_unlock (HANDLE mutex)
-{
- ReleaseMutex (mutex);
- CloseHandle (mutex);
-}
-
-// for proper cleanup in dbus-daemon
-static HANDLE hDBusDaemonMutex = NULL;
-static HANDLE hDBusSharedMem = NULL;
-// sync _dbus_daemon_publish_session_bus_address, _dbus_daemon_unpublish_session_bus_address and _dbus_daemon_already_runs
-static const char *cUniqueDBusInitMutex = "UniqueDBusInitMutex";
-// sync _dbus_get_autolaunch_address
-static const char *cDBusAutolaunchMutex = "DBusAutolaunchMutex";
-// mutex to determine if dbus-daemon is already started (per user)
-static const char *cDBusDaemonMutex = "DBusDaemonMutex";
-// named shm for dbus adress info (per user)
-static const char *cDBusDaemonAddressInfo = "DBusDaemonAddressInfo";
-
-static dbus_bool_t
-_dbus_get_install_root_as_hash(DBusString *out)
-{
- DBusString install_path;
-
- char path[MAX_PATH*2];
- int path_size = sizeof(path);
-
- if (!_dbus_get_install_root(path,path_size))
- return FALSE;
-
- _dbus_string_init(&install_path);
- _dbus_string_append(&install_path,path);
-
- _dbus_string_init(out);
- _dbus_string_tolower_ascii(&install_path,0,_dbus_string_get_length(&install_path));
-
- if (!_dbus_sha_compute (&install_path, out))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-_dbus_get_address_string (DBusString *out, const char *basestring, const char *scope)
-{
- _dbus_string_init(out);
- _dbus_string_append(out,basestring);
-
- if (!scope)
- {
- return TRUE;
- }
- else if (strcmp(scope,"*install-path") == 0
- // for 1.3 compatibility
- || strcmp(scope,"install-path") == 0)
- {
- DBusString temp;
- if (!_dbus_get_install_root_as_hash(&temp))
- {
- _dbus_string_free(out);
- return FALSE;
- }
- _dbus_string_append(out,"-");
- _dbus_string_append(out,_dbus_string_get_const_data(&temp));
- _dbus_string_free(&temp);
- }
- else if (strcmp(scope,"*user") == 0)
- {
- _dbus_string_append(out,"-");
- if (!_dbus_append_user_from_current_process(out))
- {
- _dbus_string_free(out);
- return FALSE;
- }
- }
- else if (strlen(scope) > 0)
- {
- _dbus_string_append(out,"-");
- _dbus_string_append(out,scope);
- return TRUE;
- }
- return TRUE;
-}
-
-static dbus_bool_t
-_dbus_get_shm_name (DBusString *out,const char *scope)
-{
- return _dbus_get_address_string (out,cDBusDaemonAddressInfo,scope);
-}
-
-static dbus_bool_t
-_dbus_get_mutex_name (DBusString *out,const char *scope)
-{
- return _dbus_get_address_string (out,cDBusDaemonMutex,scope);
-}
-
-dbus_bool_t
-_dbus_daemon_is_session_bus_address_published (const char *scope)
-{
- HANDLE lock;
- DBusString mutex_name;
-
- if (!_dbus_get_mutex_name(&mutex_name,scope))
- {
- _dbus_string_free( &mutex_name );
- return FALSE;
- }
-
- if (hDBusDaemonMutex)
- return TRUE;
-
- // sync _dbus_daemon_publish_session_bus_address, _dbus_daemon_unpublish_session_bus_address and _dbus_daemon_already_runs
- lock = _dbus_global_lock( cUniqueDBusInitMutex );
-
- // we use CreateMutex instead of OpenMutex because of possible race conditions,
- // see http://msdn.microsoft.com/en-us/library/ms684315%28VS.85%29.aspx
- hDBusDaemonMutex = CreateMutexA( NULL, FALSE, _dbus_string_get_const_data(&mutex_name) );
-
- /* The client uses mutex ownership to detect a running server, so the server should do so too.
- Fortunally the client deletes the mutex in the lock protected area, so checking presence
- will work too. */
-
- _dbus_global_unlock( lock );
-
- _dbus_string_free( &mutex_name );
-
- if (hDBusDaemonMutex == NULL)
- return FALSE;
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- CloseHandle(hDBusDaemonMutex);
- hDBusDaemonMutex = NULL;
- return TRUE;
- }
- // mutex wasn't created before, so return false.
- // We leave the mutex name allocated for later reusage
- // in _dbus_daemon_publish_session_bus_address.
- return FALSE;
-}
-
-dbus_bool_t
-_dbus_daemon_publish_session_bus_address (const char* address, const char *scope)
-{
- HANDLE lock;
- char *shared_addr = NULL;
- DBusString shm_name;
- DBusString mutex_name;
-
- _dbus_assert (address);
-
- if (!_dbus_get_mutex_name(&mutex_name,scope))
- {
- _dbus_string_free( &mutex_name );
- return FALSE;
- }
-
- // sync _dbus_daemon_publish_session_bus_address, _dbus_daemon_unpublish_session_bus_address and _dbus_daemon_already_runs
- lock = _dbus_global_lock( cUniqueDBusInitMutex );
-
- if (!hDBusDaemonMutex)
- {
- hDBusDaemonMutex = CreateMutexA( NULL, FALSE, _dbus_string_get_const_data(&mutex_name) );
- }
- _dbus_string_free( &mutex_name );
-
- // acquire the mutex
- if (WaitForSingleObject( hDBusDaemonMutex, 10 ) != WAIT_OBJECT_0)
- {
- _dbus_global_unlock( lock );
- CloseHandle( hDBusDaemonMutex );
- return FALSE;
- }
-
- if (!_dbus_get_shm_name(&shm_name,scope))
- {
- _dbus_string_free( &shm_name );
- _dbus_global_unlock( lock );
- return FALSE;
- }
-
- // create shm
- hDBusSharedMem = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
- 0, strlen( address ) + 1, _dbus_string_get_const_data(&shm_name) );
- _dbus_assert( hDBusSharedMem );
-
- shared_addr = MapViewOfFile( hDBusSharedMem, FILE_MAP_WRITE, 0, 0, 0 );
-
- _dbus_assert (shared_addr);
-
- strcpy( shared_addr, address);
-
- // cleanup
- UnmapViewOfFile( shared_addr );
-
- _dbus_global_unlock( lock );
- _dbus_verbose( "published session bus address at %s\n",_dbus_string_get_const_data (&shm_name) );
-
- _dbus_string_free( &shm_name );
- return TRUE;
-}
-
-void
-_dbus_daemon_unpublish_session_bus_address (void)
-{
- HANDLE lock;
-
- // sync _dbus_daemon_publish_session_bus_address, _dbus_daemon_unpublish_session_bus_address and _dbus_daemon_already_runs
- lock = _dbus_global_lock( cUniqueDBusInitMutex );
-
- CloseHandle( hDBusSharedMem );
-
- hDBusSharedMem = NULL;
-
- ReleaseMutex( hDBusDaemonMutex );
-
- CloseHandle( hDBusDaemonMutex );
-
- hDBusDaemonMutex = NULL;
-
- _dbus_global_unlock( lock );
-}
-
-static dbus_bool_t
-_dbus_get_autolaunch_shm (DBusString *address, DBusString *shm_name)
-{
- HANDLE sharedMem;
- char *shared_addr;
- int i;
-
- // read shm
- for(i=0;i<20;++i) {
- // we know that dbus-daemon is available, so we wait until shm is available
- sharedMem = OpenFileMappingA( FILE_MAP_READ, FALSE, _dbus_string_get_const_data(shm_name));
- if( sharedMem == 0 )
- Sleep( 100 );
- if ( sharedMem != 0)
- break;
- }
-
- if( sharedMem == 0 )
- return FALSE;
-
- shared_addr = MapViewOfFile( sharedMem, FILE_MAP_READ, 0, 0, 0 );
-
- if( !shared_addr )
- return FALSE;
-
- _dbus_string_init( address );
-
- _dbus_string_append( address, shared_addr );
-
- // cleanup
- UnmapViewOfFile( shared_addr );
-
- CloseHandle( sharedMem );
-
- return TRUE;
-}
-
-static dbus_bool_t
-_dbus_daemon_already_runs (DBusString *address, DBusString *shm_name, const char *scope)
-{
- HANDLE lock;
- HANDLE daemon;
- DBusString mutex_name;
- dbus_bool_t bRet = TRUE;
-
- if (!_dbus_get_mutex_name(&mutex_name,scope))
- {
- _dbus_string_free( &mutex_name );
- return FALSE;
- }
-
- // sync _dbus_daemon_publish_session_bus_address, _dbus_daemon_unpublish_session_bus_address and _dbus_daemon_already_runs
- lock = _dbus_global_lock( cUniqueDBusInitMutex );
-
- // do checks
- daemon = CreateMutexA( NULL, FALSE, _dbus_string_get_const_data(&mutex_name) );
- if(WaitForSingleObject( daemon, 10 ) != WAIT_TIMEOUT)
- {
- ReleaseMutex (daemon);
- CloseHandle (daemon);
-
- _dbus_global_unlock( lock );
- _dbus_string_free( &mutex_name );
- return FALSE;
- }
-
- // read shm
- bRet = _dbus_get_autolaunch_shm( address, shm_name );
-
- // cleanup
- CloseHandle ( daemon );
-
- _dbus_global_unlock( lock );
- _dbus_string_free( &mutex_name );
-
- return bRet;
-}
-
-dbus_bool_t
-_dbus_get_autolaunch_address (const char *scope, DBusString *address,
- DBusError *error)
-{
- HANDLE mutex;
- STARTUPINFOA si;
- PROCESS_INFORMATION pi;
- dbus_bool_t retval = FALSE;
- LPSTR lpFile;
- char dbus_exe_path[MAX_PATH];
- char dbus_args[MAX_PATH * 2];
- const char * daemon_name = DBUS_DAEMON_NAME ".exe";
- DBusString shm_name;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_get_shm_name(&shm_name,scope))
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "could not determine shm name");
- return FALSE;
- }
-
- mutex = _dbus_global_lock ( cDBusAutolaunchMutex );
-
- if (_dbus_daemon_already_runs(address,&shm_name,scope))
- {
- _dbus_verbose( "found running dbus daemon at %s\n",
- _dbus_string_get_const_data (&shm_name) );
- retval = TRUE;
- goto out;
- }
-
- if (!SearchPathA(NULL, daemon_name, NULL, sizeof(dbus_exe_path), dbus_exe_path, &lpFile))
- {
- // Look in directory containing dbus shared library
- HMODULE hmod;
- char dbus_module_path[MAX_PATH];
- DWORD rc;
-
- _dbus_verbose( "did not found dbus daemon executable on default search path, "
- "trying path where dbus shared library is located");
-
- hmod = _dbus_win_get_dll_hmodule();
- rc = GetModuleFileNameA(hmod, dbus_module_path, sizeof(dbus_module_path));
- if (rc <= 0)
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "could not retrieve dbus shared library file name");
- retval = FALSE;
- goto out;
- }
- else
- {
- char *ext_idx = strrchr(dbus_module_path, '\\');
- if (ext_idx)
- *ext_idx = '\0';
- if (!SearchPathA(dbus_module_path, daemon_name, NULL, sizeof(dbus_exe_path), dbus_exe_path, &lpFile))
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "could not find dbus-daemon executable");
- retval = FALSE;
- printf ("please add the path to %s to your PATH environment variable\n", daemon_name);
- printf ("or start the daemon manually\n\n");
- goto out;
- }
- _dbus_verbose( "found dbus daemon executable at %s",dbus_module_path);
- }
- }
-
-
- // Create process
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- _snprintf(dbus_args, sizeof(dbus_args) - 1, "\"%s\" %s", dbus_exe_path, " --session");
-
-// argv[i] = "--config-file=bus\\session.conf";
-// printf("create process \"%s\" %s\n", dbus_exe_path, dbus_args);
- if(CreateProcessA(dbus_exe_path, dbus_args, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
- {
- CloseHandle (pi.hThread);
- CloseHandle (pi.hProcess);
- retval = _dbus_get_autolaunch_shm( address, &shm_name );
- if (retval == FALSE)
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "Failed to get autolaunch address from launched dbus-daemon");
- }
- else
- {
- dbus_set_error_const (error, DBUS_ERROR_FAILED, "Failed to launch dbus-daemon");
- retval = FALSE;
- }
-
-out:
- if (retval)
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
- _dbus_global_unlock (mutex);
-
- return retval;
- }
-
-
-/** Makes the file readable by every user in the system.
- *
- * @param filename the filename
- * @param error error location
- * @returns #TRUE if the file's permissions could be changed.
- */
-dbus_bool_t
-_dbus_make_file_world_readable(const DBusString *filename,
- DBusError *error)
-{
- // TODO
- return TRUE;
-}
-
-/**
- * Atomically increments an integer
- *
- * @param atomic pointer to the integer to increment
- * @returns the value before incrementing
- *
- */
-dbus_int32_t
-_dbus_atomic_inc (DBusAtomic *atomic)
-{
- // +/- 1 is needed here!
- // no volatile argument with mingw
- return InterlockedIncrement (&atomic->value) - 1;
-}
-
-/**
- * Atomically decrement an integer
- *
- * @param atomic pointer to the integer to decrement
- * @returns the value before decrementing
- *
- */
-dbus_int32_t
-_dbus_atomic_dec (DBusAtomic *atomic)
-{
- // +/- 1 is needed here!
- // no volatile argument with mingw
- return InterlockedDecrement (&atomic->value) + 1;
-}
-
-/**
- * Atomically get the value of an integer. It may change at any time
- * thereafter, so this is mostly only useful for assertions.
- *
- * @param atomic pointer to the integer to get
- * @returns the value at this moment
- */
-dbus_int32_t
-_dbus_atomic_get (DBusAtomic *atomic)
-{
- /* In this situation, GLib issues a MemoryBarrier() and then returns
- * atomic->value. However, mingw from mingw.org (not to be confused with
- * mingw-w64 from mingw-w64.sf.net) does not have MemoryBarrier in its
- * headers, so we have to get a memory barrier some other way.
- *
- * InterlockedIncrement is older, and is documented on MSDN to be a full
- * memory barrier, so let's use that.
- */
- long dummy = 0;
-
- InterlockedExchange (&dummy, 1);
-
- return atomic->value;
-}
-
-/**
- * Called when the bus daemon is signaled to reload its configuration; any
- * caches should be nuked. Of course any caches that need explicit reload
- * are probably broken, but c'est la vie.
- *
- *
- */
-void
-_dbus_flush_caches (void)
-{
-}
-
-/**
- * See if errno is EAGAIN or EWOULDBLOCK (this has to be done differently
- * for Winsock so is abstracted)
- *
- * @returns #TRUE if errno == EAGAIN or errno == EWOULDBLOCK
- */
-dbus_bool_t
-_dbus_get_is_errno_eagain_or_ewouldblock (void)
-{
- return errno == WSAEWOULDBLOCK;
-}
-
-/**
- * return the absolute path of the dbus installation
- *
- * @param prefix buffer for installation path
- * @param len length of buffer
- * @returns #FALSE on failure
- */
-dbus_bool_t
-_dbus_get_install_root(char *prefix, int len)
-{
- //To find the prefix, we cut the filename and also \bin\ if present
- DWORD pathLength;
- char *lastSlash;
- SetLastError( 0 );
- pathLength = GetModuleFileNameA(_dbus_win_get_dll_hmodule(), prefix, len);
- if ( pathLength == 0 || GetLastError() != 0 ) {
- *prefix = '\0';
- return FALSE;
- }
- lastSlash = _mbsrchr(prefix, '\\');
- if (lastSlash == NULL) {
- *prefix = '\0';
- return FALSE;
- }
- //cut off binary name
- lastSlash[1] = 0;
-
- //cut possible "\\bin"
-
- //this fails if we are in a double-byte system codepage and the
- //folder's name happens to end with the *bytes*
- //"\\bin"... (I.e. the second byte of some Han character and then
- //the Latin "bin", but that is not likely I think...
- if (lastSlash - prefix >= 4 && strnicmp(lastSlash - 4, "\\bin", 4) == 0)
- lastSlash[-3] = 0;
- else if (lastSlash - prefix >= 10 && strnicmp(lastSlash - 10, "\\bin\\debug", 10) == 0)
- lastSlash[-9] = 0;
- else if (lastSlash - prefix >= 12 && strnicmp(lastSlash - 12, "\\bin\\release", 12) == 0)
- lastSlash[-11] = 0;
-
- return TRUE;
-}
-
-/**
- find config file either from installation or build root according to
- the following path layout
- install-root/
- bin/dbus-daemon[d].exe
- etc/<config-file>.conf *or* etc/dbus-1/<config-file>.conf
- (the former above is what dbus4win uses, the latter above is
- what a "normal" Unix-style "make install" uses)
-
- build-root/
- bin/dbus-daemon[d].exe
- bus/<config-file>.conf
-*/
-dbus_bool_t
-_dbus_get_config_file_name(DBusString *config_file, char *s)
-{
- char path[MAX_PATH*2];
- int path_size = sizeof(path);
-
- if (!_dbus_get_install_root(path,path_size))
- return FALSE;
-
- if(strlen(s) + 4 + strlen(path) > sizeof(path)-2)
- return FALSE;
- strcat(path,"etc\\");
- strcat(path,s);
- if (_dbus_file_exists(path))
- {
- // find path from executable
- if (!_dbus_string_append (config_file, path))
- return FALSE;
- }
- else
- {
- if (!_dbus_get_install_root(path,path_size))
- return FALSE;
- if(strlen(s) + 11 + strlen(path) > sizeof(path)-2)
- return FALSE;
- strcat(path,"etc\\dbus-1\\");
- strcat(path,s);
-
- if (_dbus_file_exists(path))
- {
- if (!_dbus_string_append (config_file, path))
- return FALSE;
- }
- else
- {
- if (!_dbus_get_install_root(path,path_size))
- return FALSE;
- if(strlen(s) + 4 + strlen(path) > sizeof(path)-2)
- return FALSE;
- strcat(path,"bus\\");
- strcat(path,s);
-
- if (_dbus_file_exists(path))
- {
- if (!_dbus_string_append (config_file, path))
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-/* See comment in dbus-sysdeps-unix.c */
-dbus_bool_t
-_dbus_lookup_session_address (dbus_bool_t *supported,
- DBusString *address,
- DBusError *error)
-{
- /* Probably fill this in with something based on COM? */
- *supported = FALSE;
- return TRUE;
-}
-
-/**
- * Appends the directory in which a keyring for the given credentials
- * should be stored. The credentials should have either a Windows or
- * UNIX user in them. The directory should be an absolute path.
- *
- * On UNIX the directory is ~/.dbus-keyrings while on Windows it should probably
- * be something else, since the dotfile convention is not normal on Windows.
- *
- * @param directory string to append directory to
- * @param credentials credentials the directory should be for
- *
- * @returns #FALSE on no memory
- */
-dbus_bool_t
-_dbus_append_keyring_directory_for_credentials (DBusString *directory,
- DBusCredentials *credentials)
-{
- DBusString homedir;
- DBusString dotdir;
- const char *homepath;
- const char *homedrive;
-
- _dbus_assert (credentials != NULL);
- _dbus_assert (!_dbus_credentials_are_anonymous (credentials));
-
- if (!_dbus_string_init (&homedir))
- return FALSE;
-
- homedrive = _dbus_getenv("HOMEDRIVE");
- if (homedrive != NULL && *homedrive != '\0')
- {
- _dbus_string_append(&homedir,homedrive);
- }
-
- homepath = _dbus_getenv("HOMEPATH");
- if (homepath != NULL && *homepath != '\0')
- {
- _dbus_string_append(&homedir,homepath);
- }
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- {
- const char *override;
-
- override = _dbus_getenv ("DBUS_TEST_HOMEDIR");
- if (override != NULL && *override != '\0')
- {
- _dbus_string_set_length (&homedir, 0);
- if (!_dbus_string_append (&homedir, override))
- goto failed;
-
- _dbus_verbose ("Using fake homedir for testing: %s\n",
- _dbus_string_get_const_data (&homedir));
- }
- else
- {
- /* Not strictly thread-safe, but if we fail at thread-safety here,
- * the worst that will happen is some extra warnings. */
- static dbus_bool_t already_warned = FALSE;
- if (!already_warned)
- {
- _dbus_warn ("Using your real home directory for testing, set DBUS_TEST_HOMEDIR to avoid\n");
- already_warned = TRUE;
- }
- }
- }
-#endif
-
-#ifdef DBUS_WINCE
- /* It's not possible to create a .something directory in Windows CE
- using the file explorer. */
-#define KEYRING_DIR "dbus-keyrings"
-#else
-#define KEYRING_DIR ".dbus-keyrings"
-#endif
-
- _dbus_string_init_const (&dotdir, KEYRING_DIR);
- if (!_dbus_concat_dir_and_file (&homedir,
- &dotdir))
- goto failed;
-
- if (!_dbus_string_copy (&homedir, 0,
- directory, _dbus_string_get_length (directory))) {
- goto failed;
- }
-
- _dbus_string_free (&homedir);
- return TRUE;
-
- failed:
- _dbus_string_free (&homedir);
- return FALSE;
-}
-
-/** Checks if a file exists
-*
-* @param file full path to the file
-* @returns #TRUE if file exists
-*/
-dbus_bool_t
-_dbus_file_exists (const char *file)
-{
- DWORD attributes = GetFileAttributesA (file);
-
- if (attributes != INVALID_FILE_ATTRIBUTES && GetLastError() != ERROR_PATH_NOT_FOUND)
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * A wrapper around strerror() because some platforms
- * may be lame and not have strerror().
- *
- * @param error_number errno.
- * @returns error description.
- */
-const char*
-_dbus_strerror (int error_number)
-{
-#ifdef DBUS_WINCE
- // TODO
- return "unknown";
-#else
- const char *msg;
-
- switch (error_number)
- {
- case WSAEINTR:
- return "Interrupted function call";
- case WSAEACCES:
- return "Permission denied";
- case WSAEFAULT:
- return "Bad address";
- case WSAEINVAL:
- return "Invalid argument";
- case WSAEMFILE:
- return "Too many open files";
- case WSAEWOULDBLOCK:
- return "Resource temporarily unavailable";
- case WSAEINPROGRESS:
- return "Operation now in progress";
- case WSAEALREADY:
- return "Operation already in progress";
- case WSAENOTSOCK:
- return "Socket operation on nonsocket";
- case WSAEDESTADDRREQ:
- return "Destination address required";
- case WSAEMSGSIZE:
- return "Message too long";
- case WSAEPROTOTYPE:
- return "Protocol wrong type for socket";
- case WSAENOPROTOOPT:
- return "Bad protocol option";
- case WSAEPROTONOSUPPORT:
- return "Protocol not supported";
- case WSAESOCKTNOSUPPORT:
- return "Socket type not supported";
- case WSAEOPNOTSUPP:
- return "Operation not supported";
- case WSAEPFNOSUPPORT:
- return "Protocol family not supported";
- case WSAEAFNOSUPPORT:
- return "Address family not supported by protocol family";
- case WSAEADDRINUSE:
- return "Address already in use";
- case WSAEADDRNOTAVAIL:
- return "Cannot assign requested address";
- case WSAENETDOWN:
- return "Network is down";
- case WSAENETUNREACH:
- return "Network is unreachable";
- case WSAENETRESET:
- return "Network dropped connection on reset";
- case WSAECONNABORTED:
- return "Software caused connection abort";
- case WSAECONNRESET:
- return "Connection reset by peer";
- case WSAENOBUFS:
- return "No buffer space available";
- case WSAEISCONN:
- return "Socket is already connected";
- case WSAENOTCONN:
- return "Socket is not connected";
- case WSAESHUTDOWN:
- return "Cannot send after socket shutdown";
- case WSAETIMEDOUT:
- return "Connection timed out";
- case WSAECONNREFUSED:
- return "Connection refused";
- case WSAEHOSTDOWN:
- return "Host is down";
- case WSAEHOSTUNREACH:
- return "No route to host";
- case WSAEPROCLIM:
- return "Too many processes";
- case WSAEDISCON:
- return "Graceful shutdown in progress";
- case WSATYPE_NOT_FOUND:
- return "Class type not found";
- case WSAHOST_NOT_FOUND:
- return "Host not found";
- case WSATRY_AGAIN:
- return "Nonauthoritative host not found";
- case WSANO_RECOVERY:
- return "This is a nonrecoverable error";
- case WSANO_DATA:
- return "Valid name, no data record of requested type";
- case WSA_INVALID_HANDLE:
- return "Specified event object handle is invalid";
- case WSA_INVALID_PARAMETER:
- return "One or more parameters are invalid";
- case WSA_IO_INCOMPLETE:
- return "Overlapped I/O event object not in signaled state";
- case WSA_IO_PENDING:
- return "Overlapped operations will complete later";
- case WSA_NOT_ENOUGH_MEMORY:
- return "Insufficient memory available";
- case WSA_OPERATION_ABORTED:
- return "Overlapped operation aborted";
-#ifdef WSAINVALIDPROCTABLE
-
- case WSAINVALIDPROCTABLE:
- return "Invalid procedure table from service provider";
-#endif
-#ifdef WSAINVALIDPROVIDER
-
- case WSAINVALIDPROVIDER:
- return "Invalid service provider version number";
-#endif
-#ifdef WSAPROVIDERFAILEDINIT
-
- case WSAPROVIDERFAILEDINIT:
- return "Unable to initialize a service provider";
-#endif
-
- case WSASYSCALLFAILURE:
- return "System call failure";
- }
- msg = strerror (error_number);
- if (msg == NULL)
- msg = "unknown";
-
- return msg;
-#endif //DBUS_WINCE
-}
-
-/**
- * Assigns an error name and message corresponding to a Win32 error
- * code to a DBusError. Does nothing if error is #NULL.
- *
- * @param error the error.
- * @param code the Win32 error code
- */
-void
-_dbus_win_set_error_from_win_error (DBusError *error,
- int code)
-{
- char *msg;
-
- /* As we want the English message, use the A API */
- FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, code, MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US),
- (LPSTR) &msg, 0, NULL);
- if (msg)
- {
- char *msg_copy;
-
- msg_copy = dbus_malloc (strlen (msg));
- strcpy (msg_copy, msg);
- LocalFree (msg);
-
- dbus_set_error (error, "win32.error", "%s", msg_copy);
- }
- else
- dbus_set_error (error, "win32.error", "Unknown error code %d or FormatMessage failed", code);
-}
-
-void
-_dbus_win_warn_win_error (const char *message,
- unsigned long code)
-{
- DBusError error;
-
- dbus_error_init (&error);
- _dbus_win_set_error_from_win_error (&error, code);
- _dbus_warn ("%s: %s\n", message, error.message);
- dbus_error_free (&error);
-}
-
-/**
- * Removes a directory; Directory must be empty
- *
- * @param filename directory filename
- * @param error initialized error object
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_delete_directory (const DBusString *filename,
- DBusError *error)
-{
- const char *filename_c;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- filename_c = _dbus_string_get_const_data (filename);
-
- if (RemoveDirectoryA (filename_c) == 0)
- {
- char *emsg = _dbus_win_error_string (GetLastError ());
- dbus_set_error (error, _dbus_win_error_from_last_error (),
- "Failed to remove directory %s: %s",
- filename_c, emsg);
- _dbus_win_free_error_string (emsg);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Checks whether the filename is an absolute path
- *
- * @param filename the filename
- * @returns #TRUE if an absolute path
- */
-dbus_bool_t
-_dbus_path_is_absolute (const DBusString *filename)
-{
- if (_dbus_string_get_length (filename) > 0)
- return _dbus_string_get_byte (filename, 1) == ':'
- || _dbus_string_get_byte (filename, 0) == '\\'
- || _dbus_string_get_byte (filename, 0) == '/';
- else
- return FALSE;
-}
-
-dbus_bool_t
-_dbus_check_setuid (void)
-{
- return FALSE;
-}
-
-/** @} end of sysdeps-win */
-/* tests in dbus-sysdeps-util.c */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.h
deleted file mode 100644
index 90d14de066..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-win.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.c Wrappers around system/libc features (internal to D-BUS implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2005 Novell, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SYSDEPS_WIN_H
-#define DBUS_SYSDEPS_WIN_H
-
-extern void *_dbus_win_get_dll_hmodule (void);
-#define _WINSOCKAPI_
-
-#include "dbus-hash.h"
-#include "dbus-string.h"
-#include <ctype.h>
-#include <malloc.h>
-#include <windows.h>
-#undef interface
-
-#define DBUS_CONSOLE_DIR "/var/run/console/"
-
-
-void _dbus_win_set_errno (int err);
-const char* _dbus_win_error_from_last_error (void);
-
-dbus_bool_t _dbus_win_startup_winsock (void);
-void _dbus_win_warn_win_error (const char *message,
- unsigned long code);
-
-char * _dbus_win_error_string (int error_number);
-void _dbus_win_free_error_string (char *string);
-
-extern const char* _dbus_lm_strerror (int error_number);
-
-
-dbus_bool_t _dbus_win_account_to_sid (const wchar_t *waccount,
- void **ppsid,
- DBusError *error);
-
-dbus_bool_t
-_dbus_win32_sid_to_name_and_domain (dbus_uid_t uid,
- wchar_t **wname,
- wchar_t **wdomain,
- DBusError *error);
-
-
-/* Don't define DBUS_CONSOLE_DIR on Win32 */
-
-wchar_t *_dbus_win_utf8_to_utf16 (const char *str,
- DBusError *error);
-char *_dbus_win_utf16_to_utf8 (const wchar_t *str,
- DBusError *error);
-
-void _dbus_win_set_error_from_win_error (DBusError *error, int code);
-
-dbus_bool_t
-_dbus_win_sid_to_name_and_domain (dbus_uid_t uid,
- wchar_t **wname,
- wchar_t **wdomain,
- DBusError *error);
-
-dbus_bool_t _dbus_file_exists (const char *filename);
-
-dbus_bool_t _dbus_get_config_file_name(DBusString *config_file,
- char *s);
-
-dbus_bool_t _dbus_get_install_root(char *prefix, int len);
-
-void _dbus_threads_windows_init_global (void);
-void _dbus_threads_windows_ensure_ctor_linked (void);
-
-#endif
-
-/** @} end of sysdeps-win.h */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.c
deleted file mode 100644
index e276f046e1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.c
+++ /dev/null
@@ -1,1165 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-wince-glue.c Wrappers for Windows CE around system/libc features (internal to D-BUS implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- * Copyright (C) 2005 Novell, Inc.
- * Copyright (C) 2006 Ralf Habacker <ralf.habacker@freenet.de>
- * Copyright (C) 2006 Peter Kümmel <syntheticpp@gmx.net>
- * Copyright (C) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-sysdeps-win.h"
-
-#include <windows.h>
-/* Including shlobj.h creates trouble on some compilers. Just chicken
- out here by defining just what we need. */
-#ifndef CSIDL_PERSONAL
-#define CSIDL_PERSONAL 5
-#endif
-
-
-/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
-static char *
-stpcpy (char *dest, const char *src)
-{
- char *d = dest;
- const char *s = src;
-
- do
- *d++ = *s;
- while (*s++ != '\0');
-
- return d - 1;
-}
-
-
-/* This is special cased, because we must avoid using many dbus
- functions (such as memory allocations): Those functions may in turn
- cause verbose output and check the flag! */
-static char *
-get_verbose_setting()
-{
- const wchar_t dir[] = L"Software\\freedesktop\\DBus";
- const wchar_t name[] = L"Verbose";
- HKEY root_key;
- HKEY key_handle;
- DWORD nbytes;
- DWORD n1;
- DWORD type;
- wchar_t *result_w = NULL;
- char *result;
- int len;
-
- root_key = HKEY_LOCAL_MACHINE;
- if (RegOpenKeyExW (root_key, dir, 0, KEY_READ, &key_handle))
- return NULL;
-
- nbytes = 1;
- if (RegQueryValueExW (key_handle, name, 0, NULL, NULL, &nbytes))
- {
- RegCloseKey (key_handle);
- return NULL;
- }
- /* Round up to multiple of wchar_t, convert to number of wchar_t's, and add 1. */
- n1 = ((nbytes + sizeof(wchar_t) - 1) / sizeof (wchar_t)) + 1;
- result_w = malloc (n1 * sizeof (wchar_t));
- if (!result_w)
- {
- RegCloseKey (key_handle);
- return NULL;
- }
- if (RegQueryValueExW (key_handle, name, 0, &type, (LPBYTE) result_w, &nbytes))
- {
- RegCloseKey (key_handle);
- free (result_w);
- return NULL;
- }
- RegCloseKey (key_handle);
- result_w[n1 - 1] = 0; /* Make sure it is really a string. */
-
- /* NOTE: REG_MULTI_SZ and REG_EXPAND_SZ not supported, because they
- are not needed in this module. */
- if (type != REG_SZ)
- {
- free (result_w);
- return NULL;
- }
-
- len = WideCharToMultiByte (CP_UTF8, 0, result_w, -1, NULL, 0, NULL, NULL);
- if (len < 0)
- {
- free (result_w);
- return NULL;
- }
-
- result = malloc (len + 1);
- if (!result)
- {
- free (result_w);
- return NULL;
- }
-
- len = WideCharToMultiByte (CP_UTF8, 0, result_w, -1, result, len, NULL, NULL);
- free (result_w);
- if (len < 0)
- {
- free (result);
- return NULL;
- }
- return result;
-}
-
-
-/* Return a string from the W32 Registry or NULL in case of error.
- Caller must release the return value. A NULL for root is an alias
- for HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE in turn. */
-static char *
-read_w32_registry_string (const char *root, const char *dir, const char *name)
-{
- HKEY root_key, key_handle;
- DWORD n1, nbytes, type;
- char *result = NULL;
-
- if ( !root )
- root_key = HKEY_CURRENT_USER;
- else if ( !strcmp( root, "HKEY_CLASSES_ROOT" ) )
- root_key = HKEY_CLASSES_ROOT;
- else if ( !strcmp( root, "HKEY_CURRENT_USER" ) )
- root_key = HKEY_CURRENT_USER;
- else if ( !strcmp( root, "HKEY_LOCAL_MACHINE" ) )
- root_key = HKEY_LOCAL_MACHINE;
- else if ( !strcmp( root, "HKEY_USERS" ) )
- root_key = HKEY_USERS;
- else
- return NULL;
-
- if (RegOpenKeyExA (root_key, dir, 0, KEY_READ, &key_handle))
- {
- if (root)
- return NULL; /* no need for a RegClose, so return direct */
- /* It seems to be common practise to fall back to HKLM. */
- if (RegOpenKeyExA (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &key_handle))
- return NULL; /* still no need for a RegClose, so return direct */
- }
-
- nbytes = 1;
- if (RegQueryValueExA (key_handle, name, 0, NULL, NULL, &nbytes))
- {
- if (root)
- goto out;
- /* Try to fallback to HKLM also for a missing value. */
- RegCloseKey (key_handle);
- if (RegOpenKeyExA (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &key_handle))
- return NULL; /* Nope. */
- if (RegQueryValueExA (key_handle, name, 0, NULL, NULL, &nbytes))
- goto out;
- }
- n1 = nbytes + 1;
- result = malloc (n1);
- if (!result)
- goto out;
- if (RegQueryValueExA (key_handle, name, 0, &type, result, &n1))
- {
- free(result);
- result = NULL;
- goto out;
- }
- result[nbytes] = 0; /* Make sure it is really a string. */
-
- out:
- RegCloseKey (key_handle);
- return result;
-}
-
-
-static char *
-find_inst_dir ()
-{
- return read_w32_registry_string ("HKEY_LOCAL_MACHINE",
- "Software\\freedesktop\\DBus",
- "Install Directory");
-}
-
-
-static char *
-find_env_in_registry (const char *name)
-{
- return read_w32_registry_string ("HKEY_LOCAL_MACHINE",
- "Software\\freedesktop\\DBus",
- name);
-}
-
-
-static char *
-find_program_in_inst_dir (const char *name)
-{
- char *result = NULL;
- char *tmp;
-
- tmp = find_inst_dir ();
- if (!tmp)
- return NULL;
-
- result = malloc (strlen (tmp) + 5 + strlen (name) + 1);
- if (!result)
- {
- free (tmp);
- return NULL;
- }
-
- strcpy (stpcpy (stpcpy (result, tmp), "\\bin\\"), name);
- free (tmp);
-
- return result;
-}
-
-
-static char *
-find_inst_subdir (const char *name)
-{
- char *result = NULL;
- char *tmp;
-
- tmp = find_inst_dir ();
- if (!tmp)
- return NULL;
-
- result = malloc (strlen (tmp) + 1 + strlen (name) + 1);
- if (!result)
- {
- free (tmp);
- return NULL;
- }
-
- strcpy (stpcpy (stpcpy (result, tmp), "\\"), name);
- free (tmp);
-
- return result;
-}
-
-
-static char *
-find_my_documents_folder ()
-{
- /* One for safety, just in case. */
- char dir[MAX_PATH + 1];
- char *result;
-
- dir[0] = '\0';
- /* May return false even if successful. */
- SHGetSpecialFolderPathA (0, dir, CSIDL_PERSONAL, 0);
- if (dir[0] == '\0')
- return NULL;
-
- result = malloc (strlen (dir) + 1);
- if (!result)
- return NULL;
- strcpy (result, dir);
- return result;
-}
-
-
-#define MAX_ENV 30
-
-char *environ[MAX_ENV + 1];
-
-char *
-getenv (const char *name)
-{
- static char *past_result;
- char **envp;
- int idx;
-
- if (past_result)
- {
- free (past_result);
- past_result = NULL;
- }
-
- if (! strcmp (name, "DBUS_VERBOSE"))
- return past_result = get_verbose_setting ();
- else if (! strcmp (name, "HOMEPATH"))
- return past_result = find_my_documents_folder ();
- else if (! strcmp (name, "DBUS_DATADIR"))
- return past_result = find_inst_subdir ("share");
-
- for (envp = environ; *envp != 0; envp++)
- {
- const char *varp = name;
- char *ep = *envp;
- int same_name = 0;
-
- while (*varp == *ep && *varp != '\0')
- {
- ++ep;
- ++varp;
- };
-
- if (*varp == '\0' && *ep == '=')
- return ep + 1;
- }
-
- return NULL;
-}
-
-
-int
-putenv (char *str)
-{
- char **envp;
- int idx;
- for (envp = environ; *envp != 0; envp++)
- {
- char *varp = str;
- char *ep = *envp;
- int same_name = 0;
-
- while (*varp == *ep && *varp != '\0')
- {
- if (*varp == '=')
- same_name = 1;
- ++ep;
- ++varp;
- };
-
- if (*varp == *ep && *varp == '\0')
- return 0;
- if (same_name)
- {
- *envp = str;
- return 0;
- }
- }
-
- idx = envp - environ;
- if (idx > MAX_ENV)
- {
- _dbus_win_set_errno (ENOMEM);
- return -1;
- }
-
- environ[idx] = str;
- return 0;
-}
-
-
-clock_t
-clock (void)
-{
- return GetTickCount ();
-}
-
-
-void
-abort (void)
-{
- /* This is what windows does. */
- exit (3);
-}
-
-
-void
-GetSystemTimeAsFileTime (LPFILETIME ftp)
-{
- SYSTEMTIME st;
- GetSystemTime (&st);
- SystemTimeToFileTime (&st, ftp);
-}
-
-
-unsigned char*
-_mbsrchr (const unsigned char* str, unsigned int ch)
-{
- /* FIXME. This is not multi-byte safe. */
- return strrchr (str, ch);
-}
-
-
-HANDLE OpenFileMappingA(DWORD dwDesiredAccess,
- BOOL bInheritHandle,
- LPCSTR lpName)
-{
- DWORD flProtect = 0;
- HANDLE hMapping;
-
- if (dwDesiredAccess & FILE_MAP_READ)
- flProtect |= PAGE_READONLY;
-
- if (dwDesiredAccess & FILE_MAP_WRITE)
- flProtect |= PAGE_READWRITE;
-
- SetLastError (0);
- hMapping = CreateFileMappingA(INVALID_HANDLE_VALUE,
- NULL, flProtect, 0, 0, lpName);
- if (hMapping != INVALID_HANDLE_VALUE)
- {
- /* Just in case Windows CE changes its behaviour, we check for
- the right error value here. */
- if (GetLastError () != ERROR_ALREADY_EXISTS)
- {
- CloseHandle(hMapping);
- hMapping = INVALID_HANDLE_VALUE;
- }
- }
- return hMapping;
-}
-
-
-BOOL
-MoveFileExA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags)
-{
- _dbus_assert (dwFlags == MOVEFILE_REPLACE_EXISTING);
-
- if (_dbus_file_exists (lpNewFileName))
- {
- BOOL result = DeleteFileA (lpNewFileName);
- if (result == 0)
- return FALSE;
- }
- return MoveFileA (lpExistingFileName, lpNewFileName);
-}
-
-
-BOOL
-SetHandleInformation (HANDLE hObject, DWORD dwMask, DWORD dwFlags)
-{
- _dbus_assert (dwMask == (HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE));
- _dbus_assert (dwFlags == 0);
-
- /* Not supported on Windows CE, and actually the default. So just
- return overwhelming success. */
- return 1;
-}
-
-
-DWORD
-SearchPathA (LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension,
- DWORD nBufferLength, LPSTR lpBuffer, LPSTR* lpFilePart)
-{
- char *filename;
- char *filepart;
- int filename_len;
-
- _dbus_assert (lpPath == NULL);
- _dbus_assert (lpExtension == NULL);
-
- filename = find_program_in_inst_dir (lpFileName);
- if (!filename)
- {
- SetLastError (ERROR_FILE_NOT_FOUND);
- return 0;
- }
-
- filename_len = strlen (filename) + 1;
- if (filename_len > nBufferLength)
- {
- free (filename);
- return filename_len;
- }
-
- strcpy (lpBuffer, filename);
- free (filename);
-
- filepart = _mbsrchr (lpBuffer, '\\');
- if (!filepart)
- filepart = lpBuffer;
- *lpFilePart = filepart;
-
- return filename_len - 1;
-}
-
-
-/** Gets our SID
- * @param sid points to sid buffer, need to be freed with LocalFree()
- * @returns process sid
- */
-dbus_bool_t
-_dbus_getsid(char **sid)
-{
- /* There is nothing like this on Windows CE, so we fake it. */
- static const char asid[] = "S-1-5-21-515967899-920026266-1708537768-1000";
- char *buf = LocalAlloc (LMEM_FIXED, sizeof (asid));
- if (!buf)
- {
- _dbus_win_warn_win_error ("LocalAlloc failed", GetLastError ());
- return FALSE;
- }
-
- memcpy (buf, asid, sizeof (asid));
- *sid = buf;
- return TRUE;
-}
-
-
-BOOL
-LookupAccountNameW (LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid, PDWORD cbSid,
- LPWSTR ReferencedDomainName, PDWORD cchReferencedDomainName, PSID_NAME_USE peUse)
-{
- /* Currently not needed. */
- return FALSE;
-}
-
-
-BOOL
-IsValidSid (PSID psid)
-{
- /* Currently not needed. */
- return FALSE;
-}
-
-
-HANDLE
-CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwSharedMode,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
- HANDLE hTemplateFile)
-{
- wchar_t *filename;
- HANDLE result;
- int err;
-
- filename = _dbus_win_utf8_to_utf16 (lpFileName, NULL);
- if (!filename)
- return INVALID_HANDLE_VALUE;
-
- result = CreateFileW (filename, dwDesiredAccess, dwSharedMode,
- lpSecurityAttributes, dwCreationDisposition,
- dwFlagsAndAttributes, hTemplateFile);
-
- err = GetLastError ();
- dbus_free (filename);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-DeleteFileA (LPCSTR lpFileName)
-{
- wchar_t *filename;
- BOOL result;
- int err;
-
- filename = _dbus_win_utf8_to_utf16 (lpFileName, NULL);
- if (!filename)
- return FALSE;
-
- result = DeleteFileW (filename);
-
- err = GetLastError ();
- dbus_free (filename);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-MoveFileA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName)
-{
- wchar_t *existing_filename;
- wchar_t *new_filename;
- BOOL result;
- int err;
-
- existing_filename = _dbus_win_utf8_to_utf16 (lpExistingFileName, NULL);
- if (! existing_filename)
- return FALSE;
-
- new_filename = _dbus_win_utf8_to_utf16 (lpNewFileName, NULL);
- if (! new_filename)
- {
- dbus_free (existing_filename);
- return FALSE;
- }
-
- result = MoveFileW (existing_filename, new_filename);
-
- err = GetLastError ();
- dbus_free (existing_filename);
- dbus_free (new_filename);
- SetLastError (err);
- return result;
-}
-
-
-DWORD
-GetFileAttributesA(LPCSTR lpFileName)
-{
- wchar_t *filename;
- DWORD result;
- int err;
-
- filename = _dbus_win_utf8_to_utf16 (lpFileName, NULL);
- if (!filename)
- return INVALID_FILE_ATTRIBUTES;
-
- result = GetFileAttributesW (filename);
-
- err = GetLastError ();
- dbus_free (filename);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-GetFileAttributesExA (LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId,
- PVOID lpFileInformation)
-{
- wchar_t *filename;
- DWORD result;
- int err;
-
- filename = _dbus_win_utf8_to_utf16 (lpFileName, NULL);
- if (!filename)
- return INVALID_FILE_ATTRIBUTES;
-
- result = GetFileAttributesExW (filename, fInfoLevelId, lpFileInformation);
-
- err = GetLastError ();
- dbus_free (filename);
- SetLastError (err);
- return result;
-}
-
-
-HANDLE
-CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
- DWORD flProtect, DWORD dwMaximumSizeHigh,
- DWORD dwMaximumSizeLow, LPCSTR lpName)
-{
- wchar_t *name;
- HANDLE result;
- int err;
-
- if (lpName)
- {
- name = _dbus_win_utf8_to_utf16 (lpName, NULL);
- if (!name)
- return INVALID_HANDLE_VALUE;
- }
- else
- name = NULL;
-
- result = CreateFileMappingW (hFile, lpAttributes, flProtect,
- dwMaximumSizeHigh, dwMaximumSizeLow,
- name);
-
- err = GetLastError ();
- dbus_free (name);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-CreateDirectoryA (LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
- wchar_t *pathname;
- BOOL result;
- int err;
-
- pathname = _dbus_win_utf8_to_utf16 (lpPathName, NULL);
- if (!pathname)
- return FALSE;
-
- result = CreateDirectoryW (pathname, lpSecurityAttributes);
-
- err = GetLastError ();
- dbus_free (pathname);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-RemoveDirectoryA (LPCSTR lpPathName)
-{
- wchar_t *pathname;
- BOOL result;
- int err;
-
- pathname = _dbus_win_utf8_to_utf16 (lpPathName, NULL);
- if (!pathname)
- return FALSE;
-
- result = RemoveDirectoryW (pathname);
-
- err = GetLastError ();
- dbus_free (pathname);
- SetLastError (err);
- return result;
-}
-
-
-static BOOL
-convert_find_data (LPWIN32_FIND_DATAW fdw, LPWIN32_FIND_DATAA fda)
-{
- char *filename;
- int len;
-
- fda->dwFileAttributes = fdw->dwFileAttributes;
- fda->ftCreationTime = fdw->ftCreationTime;
- fda->ftLastAccessTime = fdw->ftLastAccessTime;
- fda->ftLastWriteTime = fdw->ftLastWriteTime;
- fda->nFileSizeHigh = fdw->nFileSizeHigh;
- fda->nFileSizeLow = fdw->nFileSizeLow;
-
- filename = _dbus_win_utf16_to_utf8 (fdw->cFileName, NULL);
- if (!filename)
- return FALSE;
-
- len = sizeof (fda->cFileName);
- strncpy (fda->cFileName, filename, len);
- fda->cFileName[len - 1] = '\0';
-
- return TRUE;
-}
-
-
-HANDLE
-FindFirstFileA (LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
-{
- wchar_t *pathname;
- WIN32_FIND_DATAW find_file_data;
- HANDLE result;
- int err;
-
- pathname = _dbus_win_utf8_to_utf16 (lpFileName, NULL);
- if (!pathname)
- return INVALID_HANDLE_VALUE;
-
- result = FindFirstFileW (pathname, &find_file_data);
- if (result != INVALID_HANDLE_VALUE)
- {
- BOOL res = convert_find_data (&find_file_data, lpFindFileData);
- if (! res)
- {
- err = GetLastError ();
- FindClose (result);
- SetLastError (err);
- result = INVALID_HANDLE_VALUE;
- }
- }
-
- err = GetLastError ();
- dbus_free (pathname);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-FindNextFileA (HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData)
-{
- WIN32_FIND_DATAW find_file_data;
- BOOL result;
- int err;
-
- result = FindNextFileW (hFindFile, &find_file_data);
- if (result)
- result = convert_find_data (&find_file_data, lpFindFileData);
-
- return result;
-}
-
-
-HANDLE
-CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
- LPCSTR lpName)
-{
- wchar_t *name;
- HANDLE result;
- int err;
-
- if (lpName)
- {
- name = _dbus_win_utf8_to_utf16 (lpName, NULL);
- if (!name)
- return INVALID_HANDLE_VALUE;
- }
- else
- name = NULL;
-
- result = CreateMutexW (lpMutexAttributes, bInitialOwner, name);
-
- err = GetLastError ();
- dbus_free (name);
- SetLastError (err);
- return result;
-}
-
-
-BOOL
-CreateProcessA (LPCSTR pszImageName, LPSTR pszCmdLine,
- LPSECURITY_ATTRIBUTES psaProcess,
- LPSECURITY_ATTRIBUTES psaThread, BOOL fInheritHandles,
- DWORD fdwCreate, PVOID pvEnvironment, LPCSTR pszCurDir,
- LPSTARTUPINFOA psiStartInfo,
- LPPROCESS_INFORMATION pProcInfo)
-{
- wchar_t *image_name = NULL;
- wchar_t *cmd_line = NULL;
- BOOL result;
- int err;
-
- _dbus_assert (psaProcess == NULL);
- _dbus_assert (psaThread == NULL);
- _dbus_assert (fInheritHandles == FALSE);
- _dbus_assert (pvEnvironment == NULL);
- _dbus_assert (pszCurDir == NULL);
- /* psiStartInfo is generally not NULL. */
-
- if (pszImageName)
- {
- image_name = _dbus_win_utf8_to_utf16 (pszImageName, NULL);
- if (!image_name)
- return 0;
- }
- if (pszCmdLine)
- {
- cmd_line = _dbus_win_utf8_to_utf16 (pszCmdLine, NULL);
- if (!cmd_line)
- {
- if (image_name)
- dbus_free (image_name);
- return 0;
- }
- }
-
- result = CreateProcessW (image_name, cmd_line, NULL, NULL, FALSE,
- fdwCreate, NULL, NULL, NULL, pProcInfo);
-
- err = GetLastError ();
- dbus_free (image_name);
- dbus_free (cmd_line);
- SetLastError (err);
- return result;
-}
-
-
-LONG
-RegOpenKeyExA (HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions,
- REGSAM samDesired, PHKEY phkResult)
-{
- wchar_t *subkey;
- LONG result;
- int err;
-
- if (lpSubKey)
- {
- subkey = _dbus_win_utf8_to_utf16 (lpSubKey, NULL);
- if (!subkey)
- return 0;
- }
- else
- subkey = NULL;
-
- result = RegOpenKeyEx (hKey, subkey, ulOptions, samDesired, phkResult);
-
- err = GetLastError ();
- dbus_free (subkey);
- SetLastError (err);
- return result;
-}
-
-
-LONG
-RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved,
- LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
-{
- wchar_t *name;
- LONG err;
- BYTE *data;
- DWORD data_len;
- DWORD type;
-
- if (lpValueName)
- {
- name = _dbus_win_utf8_to_utf16 (lpValueName, NULL);
- if (!name)
- return GetLastError ();
- }
- else
- name = NULL;
-
- data_len = 0;
- err = RegQueryValueExW (hKey, name, lpReserved, lpType, NULL, &data_len);
- if (err || !lpcbData)
- {
- dbus_free (name);
- return err;
- }
-
- data = malloc (data_len + sizeof (wchar_t));
- if (!data)
- {
- dbus_free (name);
- return ERROR_NOT_ENOUGH_MEMORY;
- }
-
- err = RegQueryValueExW (hKey, name, lpReserved, &type, data, &data_len);
- if (lpType)
- *lpType = type;
- dbus_free (name);
- /* If err is ERROR_MORE_DATA, there probably was a race condition.
- We can punt this to the caller just as well. */
- if (err)
- {
- free (data);
- return err;
- }
-
- /* NOTE: REG_MULTI_SZ and REG_EXPAND_SZ not supported, because they
- are not needed in this module. */
- if (type == REG_SZ)
- {
- char *data_c;
- int data_c_len;
-
- /* This is valid since we allocated one more above. */
- data[data_len] = '\0';
- data[data_len + 1] = '\0';
-
- /* The cast is valid because malloc guarantees alignment of
- basic types. */
- data_c = _dbus_win_utf16_to_utf8 ((wchar_t*) data, NULL);
- if (!data_c)
- {
- free (data);
- return GetLastError();
- }
-
- data_c_len = strlen (data_c) + 1;
- _dbus_assert (data_c_len <= data_len + sizeof (wchar_t));
- memcpy (data, data_c, data_c_len);
- data_len = data_c_len;
- dbus_free (data_c);
- }
-
- /* DATA and DATA_LEN now contain the result. */
- if (lpData)
- {
- if (data_len > *lpcbData)
- err = ERROR_MORE_DATA;
- else
- memcpy (lpData, data, data_len);
- }
- free (data);
- *lpcbData = data_len;
- return err;
-}
-
-
-DWORD
-FormatMessageA (DWORD dwFlags, PCVOID lpSource, DWORD dwMessageId,
- DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize,
- va_list* Arguments)
-{
- LPWSTR buffer_w = NULL;
- LPSTR buffer_c;
- DWORD len;
- char *buffer_new;
- DWORD buffer_new_len;
- BOOL buffer_w_free;
-
- len = FormatMessageW (dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER,
- lpSource, dwMessageId, dwLanguageId,
- (LPWSTR) &buffer_w, 0, Arguments);
- if (len == 0)
- return 0;
-
- buffer_c = _dbus_win_utf16_to_utf8 (buffer_w, NULL);
- if (! buffer_c)
- {
- LocalFree (buffer_w);
- return 0;
- }
-
- if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER)
- {
- /* We need to return a buffer that's freeable with LocalFree. */
- buffer_new = (char *) buffer_w;
- buffer_new_len = sizeof (wchar_t) * (len + 1);
- buffer_w_free = FALSE;
- /* Avoid alignment issue by using memcpy. */
- memcpy (lpBuffer, &buffer_new, sizeof (buffer_new));
- }
- else
- {
- buffer_new = lpBuffer;
- buffer_new_len = nSize;
- buffer_w_free = TRUE;
- }
-
- strncpy (buffer_new, buffer_c, buffer_new_len);
- dbus_free (buffer_c);
- buffer_new[buffer_new_len - 1] = '\0';
- if (buffer_w_free)
- LocalFree (buffer_w);
-
- /* strlen is correct (not _mbstrlen), because we want storage and
- not string length. */
- return strlen (buffer_new);
-}
-
-
-DWORD
-GetModuleFileNameA (HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
-{
- wchar_t *filename_w;
- char *filename_c;
- DWORD len;
-
- if (nSize == 0)
- {
- /* Windows XP/2000. */
- SetLastError (0);
- return 0;
- }
-
- filename_w = malloc (sizeof (wchar_t) * nSize);
- if (! filename_w)
- return 0;
-
- len = GetModuleFileNameW (hModule, filename_w, nSize);
- if (len == 0)
- {
- /* Note: If we fail with ERROR_INSUFFICIENT_BUFFER, this is still
- (approximately) correct. */
- free (filename_w);
- return 0;
- }
-
- filename_w[nSize - 1] = '\0';
- filename_c = _dbus_win_utf16_to_utf8 (filename_w, NULL);
- free (filename_w);
- if (! filename_c)
- return 0;
-
- strncpy (lpFilename, filename_c, nSize);
- dbus_free (filename_c);
- lpFilename[nSize - 1] = '\0';
- /* strlen is correct (not _mbstrlen), because we want storage and
- not string length. */
- return strlen (lpFilename);
-}
-
-
-DWORD
-GetTempPathA (DWORD nBufferLength, LPSTR lpBuffer)
-{
- wchar_t dummy[1];
- DWORD len;
-
- len = GetTempPathW (0, dummy);
- if (len == 0)
- return 0;
-
- _dbus_assert (len <= MAX_PATH);
-
- /* Better be safe than sorry. MSDN doesn't say if len is with or
- without terminating 0. */
- len++;
-
- {
- wchar_t *buffer_w;
- DWORD len_w;
- char *buffer_c;
- DWORD len_c;
-
- buffer_w = malloc (sizeof (wchar_t) * len);
- if (! buffer_w)
- return 0;
-
- len_w = GetTempPathW (len, buffer_w);
- /* Give up if we still can't get at it. */
- if (len_w == 0 || len_w >= len)
- {
- free (buffer_w);
- return 0;
- }
-
- /* Better be really safe. */
- buffer_w[len_w] = '\0';
-
- buffer_c = _dbus_win_utf16_to_utf8 (buffer_w, NULL);
- free (buffer_w);
- if (! buffer_c)
- return 0;
-
- /* strlen is correct (not _mbstrlen), because we want storage and
- not string length. */
- len_c = strlen (buffer_c) + 1;
- if (len_c > nBufferLength)
- return len_c;
-
- strcpy (lpBuffer, buffer_c);
- dbus_free (buffer_c);
- return len_c - 1;
- }
-}
-
-
-BOOL
-SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR lpszPath, int nFolder,
- BOOL fCreate)
-{
- wchar_t path[MAX_PATH];
- char *path_c;
- BOOL result;
-
- path[0] = (wchar_t) 0;
- result = SHGetSpecialFolderPathW (hwndOwner, path, nFolder, fCreate);
- /* Note: May return false even if succeeds. */
-
- path[MAX_PATH - 1] = (wchar_t) 0;
- path_c = _dbus_win_utf16_to_utf8 (path, NULL);
- if (! path_c)
- return 0;
-
- strncpy (lpszPath, path_c, MAX_PATH);
- dbus_free (path_c);
- lpszPath[MAX_PATH - 1] = '\0';
- return result;
-}
-
-
-void
-OutputDebugStringA (LPCSTR lpOutputString)
-{
- wchar_t *str;
- HANDLE result;
- int err;
-
- str = _dbus_win_utf8_to_utf16 (lpOutputString, NULL);
- if (!str)
- return;
-
- OutputDebugStringW (str);
-
- err = GetLastError ();
- dbus_free (str);
- SetLastError (err);
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.h
deleted file mode 100644
index f5ac6c8a0e..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps-wince-glue.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps-wince-glue.h Emulation of system/libc features for Windows CE (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SYSDEPS_WINCE_GLUE_H
-#define DBUS_SYSDEPS_WINCE_GLUE_H
-
-#include <time.h>
-#include <stdarg.h>
-
-/* For getaddrinfo, configure/cmake defined _WIN32_WCE to something >= 0x0401. */
-#include <windows.h>
-#undef interface
-
-DBUS_BEGIN_DECLS
-
-/* shlobj.h declares these only for _WIN32_IE that we don't want to define.
- In any case, with mingw32ce we only get a SHGetSpecialFolderPath. */
-#define SHGetSpecialFolderPathW SHGetSpecialFolderPath
-BOOL WINAPI SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
-BOOL WINAPI SHGetSpecialFolderPathW(HWND,LPWSTR,int,BOOL);
-
-#ifndef TLS_OUT_OF_INDEXES
-#define TLS_OUT_OF_INDEXES 0xffffffff
-#endif
-
-
-/* Seriously. Windows CE does not have errno. Don't you hate it when
- that happens? */
-#define errno ((int)GetLastError ())
-
-#define ENOENT ERROR_FILE_NOT_FOUND
-#define EMFILE ERROR_TOO_MANY_OPEN_FILES
-#define EACCES ERROR_ACCESS_DENIED
-#define EBADF ERROR_INVALID_HANDLE
-#define ENOMEM ERROR_NOT_ENOUGH_MEMORY
-#define EXDEV ERROR_NOT_SAME_DEVICE
-#define ENFILE ERROR_NO_MORE_FILES
-#define EROFS ERROR_WRITE_PROTECT
-#define ENOLCK ERROR_SHARING_BUFFER_EXCEEDED
-#define ENOSYS ERROR_NOT_SUPPORTED
-#define EEXIST ERROR_FILE_EXISTS
-#define EPERM ERROR_CANNOT_MAKE
-#define EINVAL ERROR_INVALID_PARAMETER
-#define EINTR ERROR_INVALID_AT_INTERRUPT_TIME
-#define EPIPE ERROR_BROKEN_PIPE
-#define ENOSPC ERROR_DISK_FULL
-#define ENOTEMPTY ERROR_DIR_NOT_EMPTY
-#define EBUSY ERROR_BUSY
-#define ENAMETOOLONG ERROR_FILENAME_EXCED_RANGE
-#define EAGAIN ERROR_MORE_DATA
-#define ENOTDIR ERROR_DIRECTORY
-#define ERANGE ERROR_ARITHMETIC_OVERFLOW
-#define ENXIO ERROR_FILE_INVALID
-#define EFAULT ERROR_PROCESS_ABORTED
-#define EIO ERROR_IO_DEVICE
-#define EDEADLOCK ERROR_POSSIBLE_DEADLOCK
-#define ENODEV ERROR_BAD_DEVICE
-
-/* Windows CE is missing more stuff that is pretty standard. */
-
-#define strdup _strdup
-#define stricmp _stricmp
-#define strnicmp _strnicmp
-
-#define environ _dbus_wince_environ
-extern char *environ[];
-
-#define getenv _dbus_wince_getenv
-char *getenv (const char *name);
-
-#define putenv _dbus_wince_putenv
-int putenv (char *str);
-
-#define clock _dbus_wince_clock
-clock_t clock (void);
-
-#define abort _dbus_wince_abort
-void abort (void);
-
-#define _S_IFMT 0170000 /* file type mask */
-#define _S_IFDIR 0040000 /* directory */
-#define _S_IFCHR 0020000 /* character special */
-#define _S_IFIFO 0010000 /* pipe */
-#define _S_IFREG 0100000 /* regular */
-#define _S_IREAD 0000400 /* read permission, owner */
-#define _S_IWRITE 0000200 /* write permission, owner */
-#define _S_IEXEC 0000100 /* execute/search permission, owner */
-
-#ifndef __OFF_T_DEFINED
-typedef long off_t;
-#define __OFF_T_DEFINED
-#endif
-#ifndef _INTPTR_T_DEFINED
-typedef int intptr_t;
-#define _INTPTR_T_DEFINED
-#endif
-#ifndef _UINTPTR_T_DEFINED
-typedef unsigned int uintptr_t;
-#define _UINTPTR_T_DEFINED
-#endif
-
-#ifndef _MAX_FNAME
-#define _MAX_FNAME 256
-#endif
-
-#ifndef _IOFBF
-#define _IOFBF 0
-#endif
-#ifndef _IOLBF
-#define _IOLBF 1
-#endif
-#ifndef _IONBF
-#define _IONBF 2
-#endif
-
-
-/* Windows CE is missing some Windows functions that we want. */
-
-#define GetSystemTimeAsFileTime _dbus_wince_GetSystemTimeAsFileTime
-void GetSystemTimeAsFileTime (LPFILETIME ftp);
-
-#define _mbsrchr _dbus_wince_mbsrchr
-unsigned char* _mbsrchr (const unsigned char*, unsigned int);
-
-#define OpenFileMappingA _dbus_wince_OpenFileMappingA
-HANDLE OpenFileMappingA(DWORD,BOOL,LPCSTR);
-
-#define MoveFileExA _dbus_wince_MoveFileExA
-BOOL MoveFileExA(LPCSTR,LPCSTR,DWORD);
-#ifndef MOVEFILE_REPLACE_EXISTING
-#define MOVEFILE_REPLACE_EXISTING 0x00000001
-#endif
-
-#define SetHandleInformation _dbus_wince_SetHandleInformation
-BOOL SetHandleInformation(HANDLE,DWORD,DWORD);
-#ifndef HANDLE_FLAG_INHERIT
-#define HANDLE_FLAG_INHERIT 0x01
-#endif
-#ifndef HANDLE_FLAG_PROTECT
-#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x02
-#endif
-
-#define SearchPathA _dbus_wince_SearchPathA
-DWORD SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
-
-/* Instead of emulating all functions needed for this, we replace the
- whole thing. */
-dbus_bool_t _dbus_getsid(char **sid);
-
-
-#define LookupAccountNameW _dbus_wince_LookupAccountNameW
-BOOL LookupAccountNameW(LPCWSTR,LPCWSTR,PSID,PDWORD,LPWSTR,PDWORD,PSID_NAME_USE);
-
-#define IsValidSid _dbus_wince_IsValidSid
-BOOL IsValidSid(PSID);
-
-
-/* Windows CE does only have the UNICODE interfaces (FooW), but we
- want to use the ASCII interfaces (FooA). We implement them
- here. */
-
-#define CreateFileA _dbus_wince_CreateFileA
-HANDLE CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
-
-#define DeleteFileA _dbus_wince_DeleteFileA
-BOOL DeleteFileA(LPCSTR);
-
-#define GetFileAttributesA _dbus_wince_GetFileAttributesA
-DWORD GetFileAttributesA(LPCSTR);
-
-#define GetFileAttributesExA _dbus_wince_GetFileAttributesExA
-BOOL GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,PVOID);
-
-#define CreateFileMappingA _dbus_wince_CreateFileMappingA
-HANDLE CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCSTR);
-
-#define CreateDirectoryA _dbus_wince_CreateDirectoryA
-BOOL CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
-
-#define RemoveDirectoryA _dbus_wince_RemoveDirectoryA
-BOOL RemoveDirectoryA(LPCSTR);
-
-#define FindFirstFileA _dbus_wince_FindFirstFileA
-HANDLE FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
-
-#define FindNextFileA _dbus_wince_FindNextFileA
-BOOL FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
-
-#define CreateMutexA _dbus_wince_CreateMutexA
-HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
-
-#define CreateProcessA _dbus_wince_CreateProcessA
-BOOL CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
-#ifndef CREATE_NO_WINDOW
-#define CREATE_NO_WINDOW 0x08000000
-#endif
-
-
-#define RegOpenKeyExA _dbus_wince_RegOpenKeyExA
-LONG RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
-
-#define RegQueryValueExA _dbus_wince_RegQueryValueExA
-LONG WINAPI RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
-
-
-#define FormatMessageA _dbus_wince_FormatMessageA
-DWORD FormatMessageA(DWORD,PCVOID,DWORD,DWORD,LPSTR,DWORD,va_list*);
-
-#define GetModuleFileNameA _dbus_wince_GetModuleFileNameA
-DWORD GetModuleFileNameA(HINSTANCE,LPSTR,DWORD);
-
-#define GetTempPathA _dbus_wince_GetTempPathA
-DWORD GetTempPathA(DWORD,LPSTR);
-
-#define SHGetSpecialFolderPathA _dbus_wince_SHGetSpecialFolderPathA
-BOOL SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
-
-
-#define OutputDebugStringA _dbus_wince_OutputDebugStringA
-void OutputDebugStringA(LPCSTR);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_SYSDEPS_WINCE_GLUE_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.c
deleted file mode 100644
index de3a18cb97..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.c
+++ /dev/null
@@ -1,776 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.c Wrappers around system/libc features shared between UNIX and Windows (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-sysdeps.h"
-#include "dbus-threads.h"
-#include "dbus-protocol.h"
-#include "dbus-string.h"
-#include "dbus-list.h"
-#include "dbus-misc.h"
-
-/* NOTE: If you include any unix/windows-specific headers here, you are probably doing something
- * wrong and should be putting some code in dbus-sysdeps-unix.c or dbus-sysdeps-win.c.
- *
- * These are the standard ANSI C headers...
- */
-#if HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef DBUS_WIN
- #include <stdlib.h>
-#elif (defined __APPLE__)
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-#else
-extern char **environ;
-#endif
-
-/**
- * @defgroup DBusSysdeps Internal system-dependent API
- * @ingroup DBusInternals
- * @brief Internal system-dependent API available on UNIX and Windows
- *
- * The system-dependent API has a dual purpose. First, it encapsulates
- * all usage of operating system APIs for ease of auditing and to
- * avoid cluttering the rest of the code with bizarre OS quirks and
- * headers. Second, it abstracts different operating system APIs for
- * portability.
- *
- * @{
- */
-
-/**
- * Aborts the program with SIGABRT (dumping core).
- */
-void
-_dbus_abort (void)
-{
- const char *s;
-
- _dbus_print_backtrace ();
-
- s = _dbus_getenv ("DBUS_BLOCK_ON_ABORT");
- if (s && *s)
- {
- /* don't use _dbus_warn here since it can _dbus_abort() */
- fprintf (stderr, " Process %lu sleeping for gdb attach\n", _dbus_pid_for_log ());
- _dbus_sleep_milliseconds (1000 * 180);
- }
-
- abort ();
- _dbus_exit (1); /* in case someone manages to ignore SIGABRT ? */
-}
-
-/**
- * @ingroup DBusMisc
- *
- * Wrapper for setenv(). If the value is #NULL, unsets
- * the environment variable.
- *
- * There is an unfixable memleak in that it is unsafe to
- * free memory malloced for use with setenv. This is because
- * we can not rely on internal implementation details of
- * the underlying libc library.
- *
- * This function is not thread-safe, because altering the environment
- * in Unix is not thread-safe in general.
- *
- * @param varname name of environment variable
- * @param value value of environment variable, or #NULL to unset
- * @returns #TRUE on success, #FALSE if not enough memory.
- */
-dbus_bool_t
-dbus_setenv (const char *varname,
- const char *value)
-{
- _dbus_assert (varname != NULL);
-
- if (value == NULL)
- {
-#ifdef HAVE_UNSETENV
- unsetenv (varname);
- return TRUE;
-#else
- char *putenv_value;
- size_t len;
-
- len = strlen (varname);
-
- /* Use system malloc to avoid memleaks that dbus_malloc
- * will get upset about.
- */
-
- putenv_value = malloc (len + 2);
- if (putenv_value == NULL)
- return FALSE;
-
- strcpy (putenv_value, varname);
-#if defined(DBUS_WIN)
- strcat (putenv_value, "=");
-#endif
-
- return (putenv (putenv_value) == 0);
-#endif
- }
- else
- {
-#ifdef HAVE_SETENV
- return (setenv (varname, value, TRUE) == 0);
-#else
- char *putenv_value;
- size_t len;
- size_t varname_len;
- size_t value_len;
-
- varname_len = strlen (varname);
- value_len = strlen (value);
-
- len = varname_len + value_len + 1 /* '=' */ ;
-
- /* Use system malloc to avoid memleaks that dbus_malloc
- * will get upset about.
- */
-
- putenv_value = malloc (len + 1);
- if (putenv_value == NULL)
- return FALSE;
-
- strcpy (putenv_value, varname);
- strcpy (putenv_value + varname_len, "=");
- strcpy (putenv_value + varname_len + 1, value);
-
- return (putenv (putenv_value) == 0);
-#endif
- }
-}
-
-/**
- * Wrapper for getenv().
- *
- * @param varname name of environment variable
- * @returns value of environment variable or #NULL if unset
- */
-const char*
-_dbus_getenv (const char *varname)
-{
- /* Don't respect any environment variables if the current process is
- * setuid. This is the equivalent of glibc's __secure_getenv().
- */
- if (_dbus_check_setuid ())
- return NULL;
- return getenv (varname);
-}
-
-/**
- * Wrapper for clearenv().
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_clearenv (void)
-{
- dbus_bool_t rc = TRUE;
-
-#ifdef HAVE_CLEARENV
- if (clearenv () != 0)
- rc = FALSE;
-#else
-
- if (environ != NULL)
- environ[0] = NULL;
-#endif
-
- return rc;
-}
-
-/**
- * Split paths into a list of char strings
- *
- * @param dirs string with pathes
- * @param suffix string concated to each path in dirs
- * @param dir_list contains a list of splitted pathes
- * return #TRUE is pathes could be splittes,#FALSE in oom case
- */
-dbus_bool_t
-_dbus_split_paths_and_append (DBusString *dirs,
- const char *suffix,
- DBusList **dir_list)
-{
- int start;
- int i;
- int len;
- char *cpath;
- DBusString file_suffix;
-
- start = 0;
- i = 0;
-
- _dbus_string_init_const (&file_suffix, suffix);
-
- len = _dbus_string_get_length (dirs);
-
- while (_dbus_string_find (dirs, start, _DBUS_PATH_SEPARATOR, &i))
- {
- DBusString path;
-
- if (!_dbus_string_init (&path))
- goto oom;
-
- if (!_dbus_string_copy_len (dirs,
- start,
- i - start,
- &path,
- 0))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- _dbus_string_chop_white (&path);
-
- /* check for an empty path */
- if (_dbus_string_get_length (&path) == 0)
- goto next;
-
- if (!_dbus_concat_dir_and_file (&path,
- &file_suffix))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- if (!_dbus_string_copy_data(&path, &cpath))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- if (!_dbus_list_append (dir_list, cpath))
- {
- _dbus_string_free (&path);
- dbus_free (cpath);
- goto oom;
- }
-
- next:
- _dbus_string_free (&path);
- start = i + 1;
- }
-
- if (start != len)
- {
- DBusString path;
-
- if (!_dbus_string_init (&path))
- goto oom;
-
- if (!_dbus_string_copy_len (dirs,
- start,
- len - start,
- &path,
- 0))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- if (!_dbus_concat_dir_and_file (&path,
- &file_suffix))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- if (!_dbus_string_copy_data(&path, &cpath))
- {
- _dbus_string_free (&path);
- goto oom;
- }
-
- if (!_dbus_list_append (dir_list, cpath))
- {
- _dbus_string_free (&path);
- dbus_free (cpath);
- goto oom;
- }
-
- _dbus_string_free (&path);
- }
-
- return TRUE;
-
- oom:
- _dbus_list_foreach (dir_list, (DBusForeachFunction)dbus_free, NULL);
- _dbus_list_clear (dir_list);
- return FALSE;
-}
-
-/** @} */
-
-/**
- * @addtogroup DBusString
- *
- * @{
- */
-/**
- * Appends an integer to a DBusString.
- *
- * @param str the string
- * @param value the integer value
- * @returns #FALSE if not enough memory or other failure.
- */
-dbus_bool_t
-_dbus_string_append_int (DBusString *str,
- long value)
-{
- /* this calculation is from comp.lang.c faq */
-#define MAX_LONG_LEN ((sizeof (long) * 8 + 2) / 3 + 1) /* +1 for '-' */
- int orig_len;
- int i;
- char *buf;
-
- orig_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_lengthen (str, MAX_LONG_LEN))
- return FALSE;
-
- buf = _dbus_string_get_data_len (str, orig_len, MAX_LONG_LEN);
-
- snprintf (buf, MAX_LONG_LEN, "%ld", value);
-
- i = 0;
- while (*buf)
- {
- ++buf;
- ++i;
- }
-
- _dbus_string_shorten (str, MAX_LONG_LEN - i);
-
- return TRUE;
-}
-
-/**
- * Appends an unsigned integer to a DBusString.
- *
- * @param str the string
- * @param value the integer value
- * @returns #FALSE if not enough memory or other failure.
- */
-dbus_bool_t
-_dbus_string_append_uint (DBusString *str,
- unsigned long value)
-{
- /* this is wrong, but definitely on the high side. */
-#define MAX_ULONG_LEN (MAX_LONG_LEN * 2)
- int orig_len;
- int i;
- char *buf;
-
- orig_len = _dbus_string_get_length (str);
-
- if (!_dbus_string_lengthen (str, MAX_ULONG_LEN))
- return FALSE;
-
- buf = _dbus_string_get_data_len (str, orig_len, MAX_ULONG_LEN);
-
- snprintf (buf, MAX_ULONG_LEN, "%lu", value);
-
- i = 0;
- while (*buf)
- {
- ++buf;
- ++i;
- }
-
- _dbus_string_shorten (str, MAX_ULONG_LEN - i);
-
- return TRUE;
-}
-
-/**
- * Parses an integer contained in a DBusString. Either return parameter
- * may be #NULL if you aren't interested in it. The integer is parsed
- * and stored in value_return. Return parameters are not initialized
- * if the function returns #FALSE.
- *
- * @param str the string
- * @param start the byte index of the start of the integer
- * @param value_return return location of the integer value or #NULL
- * @param end_return return location of the end of the integer, or #NULL
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_parse_int (const DBusString *str,
- int start,
- long *value_return,
- int *end_return)
-{
- long v;
- const char *p;
- char *end;
-
- p = _dbus_string_get_const_data_len (str, start,
- _dbus_string_get_length (str) - start);
-
- end = NULL;
- _dbus_set_errno_to_zero ();
- v = strtol (p, &end, 0);
- if (end == NULL || end == p || errno != 0)
- return FALSE;
-
- if (value_return)
- *value_return = v;
- if (end_return)
- *end_return = start + (end - p);
-
- return TRUE;
-}
-
-/**
- * Parses an unsigned integer contained in a DBusString. Either return
- * parameter may be #NULL if you aren't interested in it. The integer
- * is parsed and stored in value_return. Return parameters are not
- * initialized if the function returns #FALSE.
- *
- * @param str the string
- * @param start the byte index of the start of the integer
- * @param value_return return location of the integer value or #NULL
- * @param end_return return location of the end of the integer, or #NULL
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_string_parse_uint (const DBusString *str,
- int start,
- unsigned long *value_return,
- int *end_return)
-{
- unsigned long v;
- const char *p;
- char *end;
-
- p = _dbus_string_get_const_data_len (str, start,
- _dbus_string_get_length (str) - start);
-
- end = NULL;
- _dbus_set_errno_to_zero ();
- v = strtoul (p, &end, 0);
- if (end == NULL || end == p || errno != 0)
- return FALSE;
-
- if (value_return)
- *value_return = v;
- if (end_return)
- *end_return = start + (end - p);
-
- return TRUE;
-}
-
-/** @} */ /* DBusString group */
-
-/**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-void
-_dbus_generate_pseudorandom_bytes_buffer (char *buffer,
- int n_bytes)
-{
- long tv_usec;
- int i;
-
- /* fall back to pseudorandom */
- _dbus_verbose ("Falling back to pseudorandom for %d bytes\n",
- n_bytes);
-
- _dbus_get_real_time (NULL, &tv_usec);
- srand (tv_usec);
-
- i = 0;
- while (i < n_bytes)
- {
- double r;
- unsigned int b;
-
- r = rand ();
- b = (r / (double) RAND_MAX) * 255.0;
-
- buffer[i] = b;
-
- ++i;
- }
-}
-
-/**
- * Fills n_bytes of the given buffer with random bytes.
- *
- * @param buffer an allocated buffer
- * @param n_bytes the number of bytes in buffer to write to
- */
-void
-_dbus_generate_random_bytes_buffer (char *buffer,
- int n_bytes)
-{
- DBusString str;
-
- if (!_dbus_string_init (&str))
- {
- _dbus_generate_pseudorandom_bytes_buffer (buffer, n_bytes);
- return;
- }
-
- if (!_dbus_generate_random_bytes (&str, n_bytes))
- {
- _dbus_string_free (&str);
- _dbus_generate_pseudorandom_bytes_buffer (buffer, n_bytes);
- return;
- }
-
- _dbus_string_copy_to_buffer (&str, buffer, n_bytes);
-
- _dbus_string_free (&str);
-}
-
-/**
- * Generates the given number of random bytes, where the bytes are
- * chosen from the alphanumeric ASCII subset.
- *
- * @param str the string
- * @param n_bytes the number of random ASCII bytes to append to string
- * @returns #TRUE on success, #FALSE if no memory or other failure
- */
-dbus_bool_t
-_dbus_generate_random_ascii (DBusString *str,
- int n_bytes)
-{
- static const char letters[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
- int i;
- int len;
-
- if (!_dbus_generate_random_bytes (str, n_bytes))
- return FALSE;
-
- len = _dbus_string_get_length (str);
- i = len - n_bytes;
- while (i < len)
- {
- _dbus_string_set_byte (str, i,
- letters[_dbus_string_get_byte (str, i) %
- (sizeof (letters) - 1)]);
-
- ++i;
- }
-
- _dbus_assert (_dbus_string_validate_ascii (str, len - n_bytes,
- n_bytes));
-
- return TRUE;
-}
-
-/**
- * Converts a UNIX errno, or Windows errno or WinSock error value into
- * a #DBusError name.
- *
- * @todo should cover more errnos, specifically those
- * from open().
- *
- * @param error_number the errno.
- * @returns an error name
- */
-const char*
-_dbus_error_from_errno (int error_number)
-{
- switch (error_number)
- {
- case 0:
- return DBUS_ERROR_FAILED;
-
-#ifdef EPROTONOSUPPORT
- case EPROTONOSUPPORT:
- return DBUS_ERROR_NOT_SUPPORTED;
-#elif defined(WSAEPROTONOSUPPORT)
- case WSAEPROTONOSUPPORT:
- return DBUS_ERROR_NOT_SUPPORTED;
-#endif
-#ifdef EAFNOSUPPORT
- case EAFNOSUPPORT:
- return DBUS_ERROR_NOT_SUPPORTED;
-#elif defined(WSAEAFNOSUPPORT)
- case WSAEAFNOSUPPORT:
- return DBUS_ERROR_NOT_SUPPORTED;
-#endif
-#ifdef ENFILE
- case ENFILE:
- return DBUS_ERROR_LIMITS_EXCEEDED; /* kernel out of memory */
-#endif
-#ifdef EMFILE
- case EMFILE:
- return DBUS_ERROR_LIMITS_EXCEEDED;
-#endif
-#ifdef EACCES
- case EACCES:
- return DBUS_ERROR_ACCESS_DENIED;
-#endif
-#ifdef EPERM
- case EPERM:
- return DBUS_ERROR_ACCESS_DENIED;
-#endif
-#ifdef ENOBUFS
- case ENOBUFS:
- return DBUS_ERROR_NO_MEMORY;
-#endif
-#ifdef ENOMEM
- case ENOMEM:
- return DBUS_ERROR_NO_MEMORY;
-#endif
-#ifdef ECONNREFUSED
- case ECONNREFUSED:
- return DBUS_ERROR_NO_SERVER;
-#elif defined(WSAECONNREFUSED)
- case WSAECONNREFUSED:
- return DBUS_ERROR_NO_SERVER;
-#endif
-#ifdef ETIMEDOUT
- case ETIMEDOUT:
- return DBUS_ERROR_TIMEOUT;
-#elif defined(WSAETIMEDOUT)
- case WSAETIMEDOUT:
- return DBUS_ERROR_TIMEOUT;
-#endif
-#ifdef ENETUNREACH
- case ENETUNREACH:
- return DBUS_ERROR_NO_NETWORK;
-#elif defined(WSAENETUNREACH)
- case WSAENETUNREACH:
- return DBUS_ERROR_NO_NETWORK;
-#endif
-#ifdef EADDRINUSE
- case EADDRINUSE:
- return DBUS_ERROR_ADDRESS_IN_USE;
-#elif defined(WSAEADDRINUSE)
- case WSAEADDRINUSE:
- return DBUS_ERROR_ADDRESS_IN_USE;
-#endif
-#ifdef EEXIST
- case EEXIST:
- return DBUS_ERROR_FILE_EXISTS;
-#endif
-#ifdef ENOENT
- case ENOENT:
- return DBUS_ERROR_FILE_NOT_FOUND;
-#endif
- }
-
- return DBUS_ERROR_FAILED;
-}
-
-/**
- * Converts the current system errno value into a #DBusError name.
- *
- * @returns an error name
- */
-const char*
-_dbus_error_from_system_errno (void)
-{
- return _dbus_error_from_errno (errno);
-}
-
-/**
- * Assign 0 to the global errno variable
- */
-void
-_dbus_set_errno_to_zero (void)
-{
-#ifdef DBUS_WINCE
- SetLastError (0);
-#else
- errno = 0;
-#endif
-}
-
-/**
- * See if errno is set
- * @returns #TRUE if errno is not 0
- */
-dbus_bool_t
-_dbus_get_is_errno_nonzero (void)
-{
- return errno != 0;
-}
-
-/**
- * See if errno is ENOMEM
- * @returns #TRUE if errno == ENOMEM
- */
-dbus_bool_t
-_dbus_get_is_errno_enomem (void)
-{
- return errno == ENOMEM;
-}
-
-/**
- * See if errno is EINTR
- * @returns #TRUE if errno == EINTR
- */
-dbus_bool_t
-_dbus_get_is_errno_eintr (void)
-{
- return errno == EINTR;
-}
-
-/**
- * See if errno is EPIPE
- * @returns #TRUE if errno == EPIPE
- */
-dbus_bool_t
-_dbus_get_is_errno_epipe (void)
-{
- return errno == EPIPE;
-}
-
-/**
- * Get error message from errno
- * @returns _dbus_strerror(errno)
- */
-const char*
-_dbus_strerror_from_errno (void)
-{
- return _dbus_strerror (errno);
-}
-
-/** @} end of sysdeps */
-
-/* tests in dbus-sysdeps-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.h
deleted file mode 100644
index e586946fb1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-sysdeps.h
+++ /dev/null
@@ -1,569 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-sysdeps.h Wrappers around system/libc features (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat, Inc.
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_SYSDEPS_H
-#define DBUS_SYSDEPS_H
-
-#include "config.h"
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-file.h>
-#include <dbus/dbus-string.h>
-
-/* this is perhaps bogus, but strcmp() etc. are faster if we use the
- * stuff straight out of string.h, so have this here for now.
- */
-#include <string.h>
-#include <stdarg.h>
-
-/* AIX sys/poll.h does #define events reqevents, and other
- * wonderousness, so must include sys/poll before declaring
- * DBusPollFD
- */
-#ifdef HAVE_POLL
-#include <sys/poll.h>
-#endif
-
-#ifdef DBUS_WINCE
-/* Windows CE lacks some system functions (such as errno and clock).
- We bring them in here. */
-#include "dbus-sysdeps-wince-glue.h"
-#endif
-
-DBUS_BEGIN_DECLS
-
-#ifdef DBUS_WIN
-#define _DBUS_PATH_SEPARATOR ";"
-#else
-#define _DBUS_PATH_SEPARATOR ":"
-#endif
-
-/* Forward declarations */
-
-
-/** An opaque list type */
-typedef struct DBusList DBusList;
-
-/** Object that contains a list of credentials such as UNIX or Windows user ID */
-typedef struct DBusCredentials DBusCredentials;
-
-/** A wrapper around a pipe descriptor or handle */
-typedef struct DBusPipe DBusPipe;
-
-/**
- * @addtogroup DBusSysdeps
- *
- * @{
- */
-
-void _dbus_abort (void) _DBUS_GNUC_NORETURN;
-
-dbus_bool_t _dbus_check_setuid (void);
-const char* _dbus_getenv (const char *varname);
-dbus_bool_t _dbus_clearenv (void);
-char ** _dbus_get_environment (void);
-
-/** A process ID */
-typedef unsigned long dbus_pid_t;
-/** A user ID */
-typedef unsigned long dbus_uid_t;
-/** A group ID */
-typedef unsigned long dbus_gid_t;
-
-/** an invalid PID used to represent an uninitialized dbus_pid_t field */
-#define DBUS_PID_UNSET ((dbus_pid_t) -1)
-/** an invalid UID used to represent an uninitialized dbus_uid_t field */
-#define DBUS_UID_UNSET ((dbus_uid_t) -1)
-/** an invalid GID used to represent an uninitialized dbus_gid_t field */
-#define DBUS_GID_UNSET ((dbus_gid_t) -1)
-
-/** an appropriate printf format for dbus_pid_t */
-#define DBUS_PID_FORMAT "%lu"
-/** an appropriate printf format for dbus_uid_t */
-#define DBUS_UID_FORMAT "%lu"
-/** an appropriate printf format for dbus_gid_t */
-#define DBUS_GID_FORMAT "%lu"
-
-
-/**
- * Socket interface
- *
- * @todo Use for the file descriptors a struct
- * - struct DBusSocket{ int d; }; -
- * instead of int to get type-safety which
- * will be checked by the compiler.
- *
- */
-
-dbus_bool_t _dbus_close_socket (int fd,
- DBusError *error);
-int _dbus_read_socket (int fd,
- DBusString *buffer,
- int count);
-int _dbus_write_socket (int fd,
- const DBusString *buffer,
- int start,
- int len);
-int _dbus_write_socket_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2);
-
-int _dbus_read_socket_with_unix_fds (int fd,
- DBusString *buffer,
- int count,
- int *fds,
- int *n_fds);
-int _dbus_write_socket_with_unix_fds (int fd,
- const DBusString *buffer,
- int start,
- int len,
- const int *fds,
- int n_fds);
-int _dbus_write_socket_with_unix_fds_two (int fd,
- const DBusString *buffer1,
- int start1,
- int len1,
- const DBusString *buffer2,
- int start2,
- int len2,
- const int *fds,
- int n_fds);
-
-dbus_bool_t _dbus_socket_is_invalid (int fd);
-
-int _dbus_connect_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusError *error);
-int _dbus_connect_tcp_socket_with_nonce (const char *host,
- const char *port,
- const char *family,
- const char *noncefile,
- DBusError *error);
-int _dbus_listen_tcp_socket (const char *host,
- const char *port,
- const char *family,
- DBusString *retport,
- int **fds_p,
- DBusError *error);
-int _dbus_accept (int listen_fd);
-
-
-dbus_bool_t _dbus_read_credentials_socket (int client_fd,
- DBusCredentials *credentials,
- DBusError *error);
-dbus_bool_t _dbus_send_credentials_socket (int server_fd,
- DBusError *error);
-
-dbus_bool_t _dbus_credentials_add_from_user (DBusCredentials *credentials,
- const DBusString *username);
-dbus_bool_t _dbus_credentials_add_from_current_process (DBusCredentials *credentials);
-dbus_bool_t _dbus_append_user_from_current_process (DBusString *str);
-
-dbus_bool_t _dbus_parse_unix_user_from_config (const DBusString *username,
- dbus_uid_t *uid_p);
-dbus_bool_t _dbus_parse_unix_group_from_config (const DBusString *groupname,
- dbus_gid_t *gid_p);
-dbus_bool_t _dbus_unix_groups_from_uid (dbus_uid_t uid,
- dbus_gid_t **group_ids,
- int *n_group_ids);
-dbus_bool_t _dbus_unix_user_is_at_console (dbus_uid_t uid,
- DBusError *error);
-dbus_bool_t _dbus_unix_user_is_process_owner (dbus_uid_t uid);
-dbus_bool_t _dbus_windows_user_is_process_owner (const char *windows_sid);
-
-dbus_bool_t _dbus_append_keyring_directory_for_credentials (DBusString *directory,
- DBusCredentials *credentials);
-
-dbus_bool_t _dbus_daemon_is_session_bus_address_published (const char *scope);
-
-dbus_bool_t _dbus_daemon_publish_session_bus_address (const char* address, const char* shm_name);
-
-void _dbus_daemon_unpublish_session_bus_address (void);
-
-dbus_bool_t _dbus_socket_can_pass_unix_fd(int fd);
-
-/** Opaque type representing an atomically-modifiable integer
- * that can be used from multiple threads.
- */
-typedef struct DBusAtomic DBusAtomic;
-
-/**
- * An atomic integer safe to increment or decrement from multiple threads.
- */
-struct DBusAtomic
-{
-#ifdef DBUS_WIN
- volatile long value; /**< Value of the atomic integer. */
-#else
- volatile dbus_int32_t value; /**< Value of the atomic integer. */
-#endif
-};
-
-/* The value we get from autofoo is in the form of a cpp expression;
- * convert that to a conventional defined/undef switch. (We can't get
- * the conventional defined/undef because of multiarch builds only running
- * ./configure once, on Darwin.) */
-#if DBUS_HAVE_ATOMIC_INT_COND
-# define DBUS_HAVE_ATOMIC_INT 1
-#else
-# undef DBUS_HAVE_ATOMIC_INT
-#endif
-
-dbus_int32_t _dbus_atomic_inc (DBusAtomic *atomic);
-dbus_int32_t _dbus_atomic_dec (DBusAtomic *atomic);
-dbus_int32_t _dbus_atomic_get (DBusAtomic *atomic);
-
-
-/* AIX uses different values for poll */
-
-#ifdef _AIX
-/** There is data to read */
-#define _DBUS_POLLIN 0x0001
-/** There is urgent data to read */
-#define _DBUS_POLLPRI 0x0004
-/** Writing now will not block */
-#define _DBUS_POLLOUT 0x0002
-/** Error condition */
-#define _DBUS_POLLERR 0x4000
-/** Hung up */
-#define _DBUS_POLLHUP 0x2000
-/** Invalid request: fd not open */
-#define _DBUS_POLLNVAL 0x8000
-#elif defined(__HAIKU__)
-/** There is data to read */
-#define _DBUS_POLLIN 0x0001
-/** Writing now will not block */
-#define _DBUS_POLLOUT 0x0002
-/** Error condition */
-#define _DBUS_POLLERR 0x0004
-/** There is urgent data to read */
-#define _DBUS_POLLPRI 0x0020
-/** Hung up */
-#define _DBUS_POLLHUP 0x0080
-/** Invalid request: fd not open */
-#define _DBUS_POLLNVAL 0x1000
-#elif defined(__QNX__)
-/** Writing now will not block */
-#define _DBUS_POLLOUT 0x0002
-/** There is data to read */
-#define _DBUS_POLLIN 0x0005
-/** There is urgent data to read */
-#define _DBUS_POLLPRI 0x0008
-/** Error condition */
-#define _DBUS_POLLERR 0x0020
-/** Hung up */
-#define _DBUS_POLLHUP 0x0040
-/** Invalid request: fd not open */
-#define _DBUS_POLLNVAL 0x1000
-#else
-/** There is data to read */
-#define _DBUS_POLLIN 0x0001
-/** There is urgent data to read */
-#define _DBUS_POLLPRI 0x0002
-/** Writing now will not block */
-#define _DBUS_POLLOUT 0x0004
-/** Error condition */
-#define _DBUS_POLLERR 0x0008
-/** Hung up */
-#define _DBUS_POLLHUP 0x0010
-/** Invalid request: fd not open */
-#define _DBUS_POLLNVAL 0x0020
-#endif
-
-/**
- * A portable struct pollfd wrapper.
- */
-typedef struct
-{
- int fd; /**< File descriptor */
- short events; /**< Events to poll for */
- short revents; /**< Events that occurred */
-} DBusPollFD;
-
-int _dbus_poll (DBusPollFD *fds,
- int n_fds,
- int timeout_milliseconds);
-
-void _dbus_sleep_milliseconds (int milliseconds);
-
-void _dbus_get_monotonic_time (long *tv_sec,
- long *tv_usec);
-
-void _dbus_get_real_time (long *tv_sec,
- long *tv_usec);
-
-/**
- * directory interface
- */
-dbus_bool_t _dbus_create_directory (const DBusString *filename,
- DBusError *error);
-dbus_bool_t _dbus_delete_directory (const DBusString *filename,
- DBusError *error);
-
-dbus_bool_t _dbus_concat_dir_and_file (DBusString *dir,
- const DBusString *next_component);
-dbus_bool_t _dbus_string_get_dirname (const DBusString *filename,
- DBusString *dirname);
-dbus_bool_t _dbus_path_is_absolute (const DBusString *filename);
-
-dbus_bool_t _dbus_get_standard_session_servicedirs (DBusList **dirs);
-dbus_bool_t _dbus_get_standard_system_servicedirs (DBusList **dirs);
-
-dbus_bool_t _dbus_append_system_config_file (DBusString *str);
-dbus_bool_t _dbus_append_session_config_file (DBusString *str);
-
-/** Opaque type for reading a directory listing */
-typedef struct DBusDirIter DBusDirIter;
-
-DBusDirIter* _dbus_directory_open (const DBusString *filename,
- DBusError *error);
-dbus_bool_t _dbus_directory_get_next_file (DBusDirIter *iter,
- DBusString *filename,
- DBusError *error);
-void _dbus_directory_close (DBusDirIter *iter);
-
-dbus_bool_t _dbus_check_dir_is_private_to_user (DBusString *dir,
- DBusError *error);
-
-void _dbus_fd_set_close_on_exec (intptr_t fd);
-
-const char* _dbus_get_tmpdir (void);
-
-/**
- * Random numbers
- */
-void _dbus_generate_pseudorandom_bytes_buffer (char *buffer,
- int n_bytes);
-void _dbus_generate_random_bytes_buffer (char *buffer,
- int n_bytes);
-dbus_bool_t _dbus_generate_random_bytes (DBusString *str,
- int n_bytes);
-dbus_bool_t _dbus_generate_random_ascii (DBusString *str,
- int n_bytes);
-
-const char* _dbus_error_from_errno (int error_number);
-const char* _dbus_error_from_system_errno (void);
-
-void _dbus_set_errno_to_zero (void);
-dbus_bool_t _dbus_get_is_errno_nonzero (void);
-dbus_bool_t _dbus_get_is_errno_eagain_or_ewouldblock (void);
-dbus_bool_t _dbus_get_is_errno_enomem (void);
-dbus_bool_t _dbus_get_is_errno_eintr (void);
-dbus_bool_t _dbus_get_is_errno_epipe (void);
-const char* _dbus_strerror_from_errno (void);
-
-void _dbus_disable_sigpipe (void);
-
-
-void _dbus_exit (int code) _DBUS_GNUC_NORETURN;
-
-int _dbus_printf_string_upper_bound (const char *format,
- va_list args);
-
-
-/**
- * Portable struct with stat() results
- */
-typedef struct
-{
- unsigned long mode; /**< File mode */
- unsigned long nlink; /**< Number of hard links */
- dbus_uid_t uid; /**< User owning file */
- dbus_gid_t gid; /**< Group owning file */
- unsigned long size; /**< Size of file */
- unsigned long atime; /**< Access time */
- unsigned long mtime; /**< Modify time */
- unsigned long ctime; /**< Creation time */
-} DBusStat;
-
-dbus_bool_t _dbus_stat (const DBusString *filename,
- DBusStat *statbuf,
- DBusError *error);
-dbus_bool_t _dbus_full_duplex_pipe (int *fd1,
- int *fd2,
- dbus_bool_t blocking,
- DBusError *error);
-
-void _dbus_print_backtrace (void);
-
-dbus_bool_t _dbus_become_daemon (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- DBusError *error,
- dbus_bool_t keep_umask);
-
-dbus_bool_t _dbus_verify_daemon_user (const char *user);
-dbus_bool_t _dbus_change_to_daemon_user (const char *user,
- DBusError *error);
-
-dbus_bool_t _dbus_write_pid_to_file_and_pipe (const DBusString *pidfile,
- DBusPipe *print_pid_pipe,
- dbus_pid_t pid_to_write,
- DBusError *error);
-
-dbus_bool_t _dbus_command_for_pid (unsigned long pid,
- DBusString *str,
- int max_len,
- DBusError *error);
-
-/** A UNIX signal handler */
-typedef void (* DBusSignalHandler) (int sig);
-
-void _dbus_set_signal_handler (int sig,
- DBusSignalHandler handler);
-
-dbus_bool_t _dbus_user_at_console (const char *username,
- DBusError *error);
-
-void _dbus_init_system_log (dbus_bool_t is_daemon);
-
-typedef enum {
- DBUS_SYSTEM_LOG_INFO,
- DBUS_SYSTEM_LOG_SECURITY,
- DBUS_SYSTEM_LOG_FATAL
-} DBusSystemLogSeverity;
-
-void _dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (2, 3);
-void _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args);
-
-/* Define DBUS_VA_COPY() to do the right thing for copying va_list variables.
- * config.h may have already defined DBUS_VA_COPY as va_copy or __va_copy.
- */
-#if !defined (DBUS_VA_COPY)
-# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
-# define DBUS_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
-# elif defined (DBUS_VA_COPY_AS_ARRAY)
-# define DBUS_VA_COPY(ap1, ap2) memcpy ((ap1), (ap2), sizeof (va_list))
-# else /* va_list is a pointer */
-# define DBUS_VA_COPY(ap1, ap2) ((ap1) = (ap2))
-# endif /* va_list is a pointer */
-#endif /* !DBUS_VA_COPY */
-
-
-/**
- * Casts a primitive C type to a byte array and then indexes
- * a particular byte of the array.
- */
-#define _DBUS_BYTE_OF_PRIMITIVE(p, i) \
- (((const char*)&(p))[(i)])
-/** On x86 there is an 80-bit FPU, and if you do "a == b" it may have a
- * or b in an 80-bit register, thus failing to compare the two 64-bit
- * doubles for bitwise equality. So this macro compares the two doubles
- * bitwise.
- */
-#define _DBUS_DOUBLES_BITWISE_EQUAL(a, b) \
- (_DBUS_BYTE_OF_PRIMITIVE (a, 0) == _DBUS_BYTE_OF_PRIMITIVE (b, 0) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 1) == _DBUS_BYTE_OF_PRIMITIVE (b, 1) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 2) == _DBUS_BYTE_OF_PRIMITIVE (b, 2) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 3) == _DBUS_BYTE_OF_PRIMITIVE (b, 3) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 4) == _DBUS_BYTE_OF_PRIMITIVE (b, 4) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 5) == _DBUS_BYTE_OF_PRIMITIVE (b, 5) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 6) == _DBUS_BYTE_OF_PRIMITIVE (b, 6) && \
- _DBUS_BYTE_OF_PRIMITIVE (a, 7) == _DBUS_BYTE_OF_PRIMITIVE (b, 7))
-
-dbus_bool_t _dbus_get_autolaunch_address (const char *scope,
- DBusString *address,
- DBusError *error);
-
-dbus_bool_t _dbus_lookup_session_address (dbus_bool_t *supported,
- DBusString *address,
- DBusError *error);
-
-/** Type representing a universally unique ID
- * @todo rename to UUID instead of GUID
- */
-typedef union DBusGUID DBusGUID;
-
-dbus_bool_t _dbus_read_local_machine_uuid (DBusGUID *machine_id,
- dbus_bool_t create_if_not_found,
- DBusError *error);
-
-/**
- * Initialize threads as in dbus_threads_init_default(), appropriately
- * for the platform.
- * @returns #FALSE if no memory
- */
-dbus_bool_t _dbus_threads_init_platform_specific (void);
-
-/**
- * Lock a static mutex used to protect _dbus_threads_init_platform_specific().
- */
-void _dbus_threads_lock_platform_specific (void);
-
-/**
- * Undo _dbus_threads_lock_platform_specific().
- */
-void _dbus_threads_unlock_platform_specific (void);
-
-dbus_bool_t _dbus_split_paths_and_append (DBusString *dirs,
- const char *suffix,
- DBusList **dir_list);
-
-unsigned long _dbus_pid_for_log (void);
-
-/* FIXME move back to dbus-sysdeps-unix.h probably -
- * the PID file handling just needs a little more abstraction
- * in the bus daemon first.
- */
-dbus_pid_t _dbus_getpid (void);
-
-dbus_bool_t _dbus_change_to_daemon_user (const char *user,
- DBusError *error);
-
-void _dbus_flush_caches (void);
-
-void _dbus_request_file_descriptor_limit (unsigned int limit);
-
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
- *
- * @param configure_time_path
- * @return real path
- */
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path);
-
-/** @} */
-
-DBUS_END_DECLS
-
-
-#ifdef DBUS_WIN
-#include "dbus-sysdeps-win.h"
-#endif
-
-#endif /* DBUS_SYSDEPS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-test-main.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-test-main.c
deleted file mode 100644
index f6ef7821d5..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-test-main.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-test.c Program to run all tests
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-
-#include <config.h>
-#include "dbus-types.h"
-#include "dbus-test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_LOCALE_H
-#include <locale.h>
-#endif
-
-int
-main (int argc,
- char **argv)
-{
- const char *test_data_dir;
- const char *specific_test;
-
-#if HAVE_SETLOCALE
- setlocale(LC_ALL, "");
-#endif
-
- if (argc > 1)
- test_data_dir = argv[1];
- else
- test_data_dir = NULL;
-
- if (argc > 2)
- specific_test = argv[2];
- else
- specific_test = NULL;
-
- dbus_internal_do_not_use_run_tests (test_data_dir, specific_test);
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-test.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-test.c
deleted file mode 100644
index b707ee22da..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-test.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-test.c Program to run all tests
- *
- * Copyright (C) 2002, 2003, 2004, 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-test.h"
-#include "dbus-sysdeps.h"
-#include "dbus-internals.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-static void
-die (const char *failure)
-{
- fprintf (stderr, "Unit test failed: %s\n", failure);
- exit (1);
-}
-
-static void
-check_memleaks (void)
-{
- dbus_shutdown ();
-
- printf ("%s: checking for memleaks\n", "dbus-test");
- if (_dbus_get_malloc_blocks_outstanding () != 0)
- {
- _dbus_warn ("%d dbus_malloc blocks were not freed\n",
- _dbus_get_malloc_blocks_outstanding ());
- die ("memleaks");
- }
-}
-
-typedef dbus_bool_t (*TestFunc)(void);
-typedef dbus_bool_t (*TestDataFunc)(const char *data);
-
-static void
-run_test (const char *test_name,
- const char *specific_test,
- TestFunc test)
-{
- if (!specific_test || strcmp (specific_test, test_name) == 0)
- {
- printf ("%s: running %s tests\n", "dbus-test", test_name);
- if (!test ())
- die (test_name);
-
- check_memleaks ();
- }
-}
-
-static void
-run_data_test (const char *test_name,
- const char *specific_test,
- TestDataFunc test,
- const char *test_data_dir)
-{
- if (!specific_test || strcmp (specific_test, test_name) == 0)
- {
- printf ("%s: running %s tests\n", "dbus-test", test_name);
- if (!test (test_data_dir))
- die (test_name);
-
- check_memleaks ();
- }
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-/**
- * An exported symbol to be run in order to execute
- * unit tests. Should not be used by
- * any app other than our test app, this symbol
- * won't exist in some builds of the library.
- * (with --enable-tests=no)
- *
- * @param test_data_dir the directory with test data (test/data normally)
- * @param specific_test run specific test or #NULL to run all tests
- */
-void
-dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test)
-{
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- if (!_dbus_threads_init_debug ())
- die ("debug threads init");
-
- if (test_data_dir == NULL)
- test_data_dir = _dbus_getenv ("DBUS_TEST_DATA");
-
- if (test_data_dir != NULL)
- printf ("Test data in %s\n", test_data_dir);
- else
- printf ("No test data!\n");
-
- run_test ("string", specific_test, _dbus_string_test);
-
- run_test ("sysdeps", specific_test, _dbus_sysdeps_test);
-
- run_test ("data-slot", specific_test, _dbus_data_slot_test);
-
- run_test ("misc", specific_test, _dbus_misc_test);
-
- run_test ("address", specific_test, _dbus_address_test);
-
- run_test ("server", specific_test, _dbus_server_test);
-
- run_test ("object-tree", specific_test, _dbus_object_tree_test);
-
- run_test ("signature", specific_test, _dbus_signature_test);
-
- run_test ("marshalling", specific_test, _dbus_marshal_test);
-
- run_test ("marshal-recursive", specific_test, _dbus_marshal_recursive_test);
-
- run_test ("byteswap", specific_test, _dbus_marshal_byteswap_test);
-
- run_test ("memory", specific_test, _dbus_memory_test);
-
-#if 1
- run_test ("mem-pool", specific_test, _dbus_mem_pool_test);
-#endif
-
- run_test ("list", specific_test, _dbus_list_test);
-
- run_test ("marshal-validate", specific_test, _dbus_marshal_validate_test);
-
- run_data_test ("message", specific_test, _dbus_message_test, test_data_dir);
-
- run_test ("hash", specific_test, _dbus_hash_test);
-
-#if !defined(DBUS_WINCE)
- run_data_test ("spawn", specific_test, _dbus_spawn_test, test_data_dir);
-#endif
-
- run_data_test ("credentials", specific_test, _dbus_credentials_test, test_data_dir);
-
-#ifdef DBUS_UNIX
- run_data_test ("userdb", specific_test, _dbus_userdb_test, test_data_dir);
-
- run_test ("transport-unix", specific_test, _dbus_transport_unix_test);
-#endif
-
- run_test ("keyring", specific_test, _dbus_keyring_test);
-
- run_data_test ("sha", specific_test, _dbus_sha_test, test_data_dir);
-
- run_data_test ("auth", specific_test, _dbus_auth_test, test_data_dir);
-
- printf ("%s: completed successfully\n", "dbus-test");
-#else
- printf ("Not compiled with unit tests, not running any\n");
-#endif
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-test.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-test.h
deleted file mode 100644
index f254388b21..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-test.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-test.h Declarations of test functions.
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_TEST_H
-#define DBUS_TEST_H
-
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-marshal-validate.h>
-
-dbus_bool_t _dbus_hash_test (void);
-dbus_bool_t _dbus_list_test (void);
-dbus_bool_t _dbus_marshal_test (void);
-dbus_bool_t _dbus_marshal_recursive_test (void);
-dbus_bool_t _dbus_marshal_byteswap_test (void);
-dbus_bool_t _dbus_marshal_validate_test (void);
-dbus_bool_t _dbus_misc_test (void);
-dbus_bool_t _dbus_signature_test (void);
-dbus_bool_t _dbus_mem_pool_test (void);
-dbus_bool_t _dbus_string_test (void);
-dbus_bool_t _dbus_address_test (void);
-dbus_bool_t _dbus_server_test (void);
-dbus_bool_t _dbus_message_test (const char *test_data_dir);
-dbus_bool_t _dbus_auth_test (const char *test_data_dir);
-dbus_bool_t _dbus_sha_test (const char *test_data_dir);
-dbus_bool_t _dbus_keyring_test (void);
-dbus_bool_t _dbus_data_slot_test (void);
-dbus_bool_t _dbus_sysdeps_test (void);
-dbus_bool_t _dbus_spawn_test (const char *test_data_dir);
-dbus_bool_t _dbus_userdb_test (const char *test_data_dir);
-dbus_bool_t _dbus_transport_unix_test (void);
-dbus_bool_t _dbus_memory_test (void);
-dbus_bool_t _dbus_object_tree_test (void);
-dbus_bool_t _dbus_credentials_test (const char *test_data_dir);
-
-void dbus_internal_do_not_use_run_tests (const char *test_data_dir,
- const char *specific_test);
-dbus_bool_t dbus_internal_do_not_use_try_message_file (const DBusString *filename,
- DBusValidity expected_validity);
-dbus_bool_t dbus_internal_do_not_use_try_message_data (const DBusString *data,
- DBusValidity expected_validity);
-dbus_bool_t dbus_internal_do_not_use_load_message_file (const DBusString *filename,
- DBusString *data);
-
-
-/* returns FALSE on fatal failure */
-typedef dbus_bool_t (* DBusForeachMessageFileFunc) (const DBusString *filename,
- DBusValidity expected_validity,
- void *data);
-
-dbus_bool_t dbus_internal_do_not_use_foreach_message_file (const char *test_data_dir,
- DBusForeachMessageFileFunc func,
- void *user_data);
-dbus_bool_t dbus_internal_do_not_use_generate_bodies (int sequence,
- int byte_order,
- DBusString *signature,
- DBusString *body);
-
-
-#endif /* DBUS_TEST_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads-internal.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-threads-internal.h
deleted file mode 100644
index 64e8bac092..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads-internal.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-threads-internal.h D-Bus thread primitives
- *
- * Copyright (C) 2002, 2005 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_THREADS_INTERNAL_H
-#define DBUS_THREADS_INTERNAL_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-threads.h>
-
-/**
- * @addtogroup DBusThreadsInternals
- * @{
- */
-
-/**
- * A mutex which is recursive if possible, else non-recursive.
- * This is typically recursive, but that cannot be relied upon.
- */
-typedef struct DBusRMutex DBusRMutex;
-
-/**
- * A mutex suitable for use with condition variables.
- * This is typically non-recursive.
- */
-typedef struct DBusCMutex DBusCMutex;
-
-/** @} */
-
-DBUS_BEGIN_DECLS
-
-void _dbus_rmutex_lock (DBusRMutex *mutex);
-void _dbus_rmutex_unlock (DBusRMutex *mutex);
-void _dbus_rmutex_new_at_location (DBusRMutex **location_p);
-void _dbus_rmutex_free_at_location (DBusRMutex **location_p);
-
-void _dbus_cmutex_lock (DBusCMutex *mutex);
-void _dbus_cmutex_unlock (DBusCMutex *mutex);
-void _dbus_cmutex_new_at_location (DBusCMutex **location_p);
-void _dbus_cmutex_free_at_location (DBusCMutex **location_p);
-
-DBusCondVar* _dbus_condvar_new (void);
-void _dbus_condvar_free (DBusCondVar *cond);
-void _dbus_condvar_wait (DBusCondVar *cond,
- DBusCMutex *mutex);
-dbus_bool_t _dbus_condvar_wait_timeout (DBusCondVar *cond,
- DBusCMutex *mutex,
- int timeout_milliseconds);
-void _dbus_condvar_wake_one (DBusCondVar *cond);
-void _dbus_condvar_new_at_location (DBusCondVar **location_p);
-void _dbus_condvar_free_at_location (DBusCondVar **location_p);
-
-/* Private to threading implementations and dbus-threads.c */
-
-DBusRMutex *_dbus_platform_rmutex_new (void);
-void _dbus_platform_rmutex_free (DBusRMutex *mutex);
-void _dbus_platform_rmutex_lock (DBusRMutex *mutex);
-void _dbus_platform_rmutex_unlock (DBusRMutex *mutex);
-
-DBusCMutex *_dbus_platform_cmutex_new (void);
-void _dbus_platform_cmutex_free (DBusCMutex *mutex);
-void _dbus_platform_cmutex_lock (DBusCMutex *mutex);
-void _dbus_platform_cmutex_unlock (DBusCMutex *mutex);
-
-DBusCondVar* _dbus_platform_condvar_new (void);
-void _dbus_platform_condvar_free (DBusCondVar *cond);
-void _dbus_platform_condvar_wait (DBusCondVar *cond,
- DBusCMutex *mutex);
-dbus_bool_t _dbus_platform_condvar_wait_timeout (DBusCondVar *cond,
- DBusCMutex *mutex,
- int timeout_milliseconds);
-void _dbus_platform_condvar_wake_one (DBusCondVar *cond);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_THREADS_INTERNAL_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.c
deleted file mode 100644
index 12d40493bb..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.c
+++ /dev/null
@@ -1,454 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-threads.h D-Bus threads handling
- *
- * Copyright (C) 2002, 2003, 2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#include "dbus-threads.h"
-#include "dbus-internals.h"
-#include "dbus-threads-internal.h"
-#include "dbus-list.h"
-
-static int thread_init_generation = 0;
-
-/**
- * @defgroup DBusThreadsInternals Thread functions
- * @ingroup DBusInternals
- * @brief _dbus_rmutex_lock(), etc.
- *
- * Functions and macros related to threads and thread locks.
- *
- * @{
- */
-
-/**
- * Creates a new mutex
- * or creates a no-op mutex if threads are not initialized.
- * May return #NULL even if threads are initialized, indicating
- * out-of-memory.
- *
- * If possible, the mutex returned by this function is recursive, to
- * avoid deadlocks. However, that cannot be relied on.
- *
- * @param location_p the location of the new mutex, can return #NULL on OOM
- */
-void
-_dbus_rmutex_new_at_location (DBusRMutex **location_p)
-{
- _dbus_assert (location_p != NULL);
-
- if (!dbus_threads_init_default ())
- {
- *location_p = NULL;
- return;
- }
-
- *location_p = _dbus_platform_rmutex_new ();
-}
-
-/**
- * Creates a new mutex
- * or creates a no-op mutex if threads are not initialized.
- * May return #NULL even if threads are initialized, indicating
- * out-of-memory.
- *
- * The returned mutex is suitable for use with condition variables.
- *
- * @param location_p the location of the new mutex, can return #NULL on OOM
- */
-void
-_dbus_cmutex_new_at_location (DBusCMutex **location_p)
-{
- _dbus_assert (location_p != NULL);
-
- if (!dbus_threads_init_default ())
- {
- *location_p = NULL;
- return;
- }
-
- *location_p = _dbus_platform_cmutex_new ();
-}
-
-/**
- * Frees a DBusRMutex; does nothing if passed a #NULL pointer.
- */
-void
-_dbus_rmutex_free_at_location (DBusRMutex **location_p)
-{
- if (location_p == NULL)
- return;
-
- if (*location_p != NULL)
- _dbus_platform_rmutex_free (*location_p);
-}
-
-/**
- * Frees a DBusCMutex; does nothing if passed a #NULL pointer.
- */
-void
-_dbus_cmutex_free_at_location (DBusCMutex **location_p)
-{
- if (location_p == NULL)
- return;
-
- if (*location_p != NULL)
- _dbus_platform_cmutex_free (*location_p);
-}
-
-/**
- * Locks a mutex. Does nothing if passed a #NULL pointer.
- * Locks may be recursive if threading implementation initialized
- * recursive locks.
- */
-void
-_dbus_rmutex_lock (DBusRMutex *mutex)
-{
- if (mutex == NULL)
- return;
-
- _dbus_platform_rmutex_lock (mutex);
-}
-
-/**
- * Locks a mutex. Does nothing if passed a #NULL pointer.
- * Locks may be recursive if threading implementation initialized
- * recursive locks.
- */
-void
-_dbus_cmutex_lock (DBusCMutex *mutex)
-{
- if (mutex == NULL)
- return;
-
- _dbus_platform_cmutex_lock (mutex);
-}
-
-/**
- * Unlocks a mutex. Does nothing if passed a #NULL pointer.
- *
- * @returns #TRUE on success
- */
-void
-_dbus_rmutex_unlock (DBusRMutex *mutex)
-{
- if (mutex == NULL)
- return;
-
- _dbus_platform_rmutex_unlock (mutex);
-}
-
-/**
- * Unlocks a mutex. Does nothing if passed a #NULL pointer.
- *
- * @returns #TRUE on success
- */
-void
-_dbus_cmutex_unlock (DBusCMutex *mutex)
-{
- if (mutex == NULL)
- return;
-
- _dbus_platform_cmutex_unlock (mutex);
-}
-
-/**
- * Creates a new condition variable using the function supplied
- * to dbus_threads_init(), or creates a no-op condition variable
- * if threads are not initialized. May return #NULL even if
- * threads are initialized, indicating out-of-memory.
- *
- * @returns new mutex or #NULL
- */
-DBusCondVar *
-_dbus_condvar_new (void)
-{
- if (!dbus_threads_init_default ())
- return NULL;
-
- return _dbus_platform_condvar_new ();
-}
-
-
-/**
- * This does the same thing as _dbus_condvar_new. It however
- * gives another level of indirection by allocating a pointer
- * to point to the condvar location; this used to be useful.
- *
- * @returns the location of a new condvar or #NULL on OOM
- */
-
-void
-_dbus_condvar_new_at_location (DBusCondVar **location_p)
-{
- _dbus_assert (location_p != NULL);
-
- *location_p = _dbus_condvar_new();
-}
-
-
-/**
- * Frees a conditional variable created with dbus_condvar_new(); does
- * nothing if passed a #NULL pointer.
- */
-void
-_dbus_condvar_free (DBusCondVar *cond)
-{
- if (cond == NULL)
- return;
-
- _dbus_platform_condvar_free (cond);
-}
-
-/**
- * Frees a condition variable; does nothing if passed a #NULL pointer.
- */
-void
-_dbus_condvar_free_at_location (DBusCondVar **location_p)
-{
- if (location_p == NULL)
- return;
-
- if (*location_p != NULL)
- _dbus_platform_condvar_free (*location_p);
-}
-
-/**
- * Atomically unlocks the mutex and waits for the conditions
- * variable to be signalled. Locks the mutex again before
- * returning.
- * Does nothing if passed a #NULL pointer.
- */
-void
-_dbus_condvar_wait (DBusCondVar *cond,
- DBusCMutex *mutex)
-{
- if (cond == NULL || mutex == NULL)
- return;
-
- _dbus_platform_condvar_wait (cond, mutex);
-}
-
-/**
- * Atomically unlocks the mutex and waits for the conditions variable
- * to be signalled, or for a timeout. Locks the mutex again before
- * returning. Does nothing if passed a #NULL pointer. Return value
- * is #FALSE if we timed out, #TRUE otherwise.
- *
- * @param cond the condition variable
- * @param mutex the mutex
- * @param timeout_milliseconds the maximum time to wait
- * @returns #FALSE if the timeout occurred, #TRUE if not
- */
-dbus_bool_t
-_dbus_condvar_wait_timeout (DBusCondVar *cond,
- DBusCMutex *mutex,
- int timeout_milliseconds)
-{
- if (cond == NULL || mutex == NULL)
- return TRUE;
-
- return _dbus_platform_condvar_wait_timeout (cond, mutex,
- timeout_milliseconds);
-}
-
-/**
- * If there are threads waiting on the condition variable, wake
- * up exactly one.
- * Does nothing if passed a #NULL pointer.
- */
-void
-_dbus_condvar_wake_one (DBusCondVar *cond)
-{
- if (cond == NULL)
- return;
-
- _dbus_platform_condvar_wake_one (cond);
-}
-
-static DBusRMutex *global_locks[_DBUS_N_GLOBAL_LOCKS] = { NULL };
-
-static void
-shutdown_global_locks (void *nil)
-{
- int i;
-
- for (i = 0; i < _DBUS_N_GLOBAL_LOCKS; i++)
- {
- _dbus_assert (global_locks[i] != NULL);
- _dbus_platform_rmutex_free (global_locks[i]);
- global_locks[i] = NULL;
- }
-}
-
-static dbus_bool_t
-init_global_locks (void)
-{
- int i;
- dbus_bool_t ok;
-
- for (i = 0; i < _DBUS_N_GLOBAL_LOCKS; i++)
- {
- _dbus_assert (global_locks[i] == NULL);
-
- global_locks[i] = _dbus_platform_rmutex_new ();
-
- if (global_locks[i] == NULL)
- goto failed;
- }
-
- _dbus_platform_rmutex_lock (global_locks[_DBUS_LOCK_shutdown_funcs]);
- ok = _dbus_register_shutdown_func_unlocked (shutdown_global_locks, NULL);
- _dbus_platform_rmutex_unlock (global_locks[_DBUS_LOCK_shutdown_funcs]);
-
- if (!ok)
- goto failed;
-
- return TRUE;
-
- failed:
- for (i = i - 1; i >= 0; i--)
- {
- _dbus_platform_rmutex_free (global_locks[i]);
- global_locks[i] = NULL;
- }
-
- return FALSE;
-}
-
-dbus_bool_t
-_dbus_lock (DBusGlobalLock lock)
-{
- _dbus_assert (lock >= 0);
- _dbus_assert (lock < _DBUS_N_GLOBAL_LOCKS);
-
- if (thread_init_generation != _dbus_current_generation &&
- !dbus_threads_init_default ())
- return FALSE;
-
- _dbus_platform_rmutex_lock (global_locks[lock]);
- return TRUE;
-}
-
-void
-_dbus_unlock (DBusGlobalLock lock)
-{
- _dbus_assert (lock >= 0);
- _dbus_assert (lock < _DBUS_N_GLOBAL_LOCKS);
-
- _dbus_platform_rmutex_unlock (global_locks[lock]);
-}
-
-/** @} */ /* end of internals */
-
-/**
- * @defgroup DBusThreads Thread functions
- * @ingroup DBus
- * @brief dbus_threads_init() and dbus_threads_init_default()
- *
- * Functions and macros related to threads and thread locks.
- *
- * If threads are initialized, the D-Bus library has locks on all
- * global data structures. In addition, each #DBusConnection has a
- * lock, so only one thread at a time can touch the connection. (See
- * @ref DBusConnection for more on connection locking.)
- *
- * Most other objects, however, do not have locks - they can only be
- * used from a single thread at a time, unless you lock them yourself.
- * For example, a #DBusMessage can't be modified from two threads
- * at once.
- *
- * @{
- */
-
-/**
- * Initializes threads, like dbus_threads_init_default().
- * This version previously allowed user-specified threading
- * primitives, but since D-Bus 1.6 it ignores them and behaves
- * exactly like dbus_threads_init_default().
- *
- * @param functions ignored, formerly functions for using threads
- * @returns #TRUE on success, #FALSE if no memory
- */
-dbus_bool_t
-dbus_threads_init (const DBusThreadFunctions *functions)
-{
- _dbus_threads_lock_platform_specific ();
-
- if (thread_init_generation == _dbus_current_generation)
- {
- _dbus_threads_unlock_platform_specific ();
- return TRUE;
- }
-
- if (!_dbus_threads_init_platform_specific() ||
- !init_global_locks ())
- {
- _dbus_threads_unlock_platform_specific ();
- return FALSE;
- }
-
- thread_init_generation = _dbus_current_generation;
-
- _dbus_threads_unlock_platform_specific ();
- return TRUE;
-}
-
-
-
-/* Default thread implemenation */
-
-/**
- * Initializes threads. If this function is not called, the D-Bus
- * library will not lock any data structures. If it is called, D-Bus
- * will do locking, at some cost in efficiency.
- *
- * Since D-Bus 1.7 it is safe to call this function from any thread,
- * any number of times (but it must be called before any other
- * libdbus API is used).
- *
- * In D-Bus 1.6 or older, this function must be called in the main thread
- * before any other thread starts. As a result, it is not sufficient to
- * call this function in a library or plugin, unless the library or plugin
- * imposes a similar requirement on its callers.
- *
- * dbus_shutdown() reverses the effects of this function when it
- * resets all global state in libdbus.
- *
- * @returns #TRUE on success, #FALSE if not enough memory
- */
-dbus_bool_t
-dbus_threads_init_default (void)
-{
- return dbus_threads_init (NULL);
-}
-
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-dbus_bool_t
-_dbus_threads_init_debug (void)
-{
- return dbus_threads_init (NULL);
-}
-
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.h
deleted file mode 100644
index 6d28a0b631..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-threads.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-threads.h D-Bus threads handling
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_THREADS_H
-#define DBUS_THREADS_H
-
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-types.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusThreads
- * @{
- */
-
-/** An opaque mutex type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
-typedef struct DBusMutex DBusMutex;
-/** An opaque condition variable type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
-typedef struct DBusCondVar DBusCondVar;
-
-/** Deprecated, provide DBusRecursiveMutexNewFunction instead. */
-typedef DBusMutex* (* DBusMutexNewFunction) (void);
-/** Deprecated, provide DBusRecursiveMutexFreeFunction instead. */
-typedef void (* DBusMutexFreeFunction) (DBusMutex *mutex);
-/** Deprecated, provide DBusRecursiveMutexLockFunction instead. Return value is lock success, but gets ignored in practice. */
-typedef dbus_bool_t (* DBusMutexLockFunction) (DBusMutex *mutex);
-/** Deprecated, provide DBusRecursiveMutexUnlockFunction instead. Return value is unlock success, but gets ignored in practice. */
-typedef dbus_bool_t (* DBusMutexUnlockFunction) (DBusMutex *mutex);
-
-/** Creates a new recursively-lockable mutex, or returns #NULL if not
- * enough memory. Can only fail due to lack of memory. Found in
- * #DBusThreadFunctions. Do not just use PTHREAD_MUTEX_RECURSIVE for
- * this, because it does not save/restore the recursion count when
- * waiting on a condition. libdbus requires the Java-style behavior
- * where the mutex is fully unlocked to wait on a condition.
- */
-typedef DBusMutex* (* DBusRecursiveMutexNewFunction) (void);
-/** Frees a recursively-lockable mutex. Found in #DBusThreadFunctions.
- */
-typedef void (* DBusRecursiveMutexFreeFunction) (DBusMutex *mutex);
-/** Locks a recursively-lockable mutex. Found in #DBusThreadFunctions.
- * Can only fail due to lack of memory.
- */
-typedef void (* DBusRecursiveMutexLockFunction) (DBusMutex *mutex);
-/** Unlocks a recursively-lockable mutex. Found in #DBusThreadFunctions.
- * Can only fail due to lack of memory.
- */
-typedef void (* DBusRecursiveMutexUnlockFunction) (DBusMutex *mutex);
-
-/** Creates a new condition variable. Found in #DBusThreadFunctions.
- * Can only fail (returning #NULL) due to lack of memory.
- */
-typedef DBusCondVar* (* DBusCondVarNewFunction) (void);
-/** Frees a condition variable. Found in #DBusThreadFunctions.
- */
-typedef void (* DBusCondVarFreeFunction) (DBusCondVar *cond);
-
-/** Waits on a condition variable. Found in
- * #DBusThreadFunctions. Must work with either a recursive or
- * nonrecursive mutex, whichever the thread implementation
- * provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with
- * condition variables (does not save/restore the recursion count) so
- * don't try using simply pthread_cond_wait() and a
- * PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right.
- *
- * Has no error conditions. Must succeed if it returns.
- */
-typedef void (* DBusCondVarWaitFunction) (DBusCondVar *cond,
- DBusMutex *mutex);
-
-/** Waits on a condition variable with a timeout. Found in
- * #DBusThreadFunctions. Returns #TRUE if the wait did not
- * time out, and #FALSE if it did.
- *
- * Has no error conditions. Must succeed if it returns.
- */
-typedef dbus_bool_t (* DBusCondVarWaitTimeoutFunction) (DBusCondVar *cond,
- DBusMutex *mutex,
- int timeout_milliseconds);
-/** Wakes one waiting thread on a condition variable. Found in #DBusThreadFunctions.
- *
- * Has no error conditions. Must succeed if it returns.
- */
-typedef void (* DBusCondVarWakeOneFunction) (DBusCondVar *cond);
-
-/** Wakes all waiting threads on a condition variable. Found in #DBusThreadFunctions.
- *
- * Has no error conditions. Must succeed if it returns.
- */
-typedef void (* DBusCondVarWakeAllFunction) (DBusCondVar *cond);
-
-/**
- * Flags indicating which functions are present in #DBusThreadFunctions. Used to allow
- * the library to detect older callers of dbus_threads_init() if new possible functions
- * are added to #DBusThreadFunctions.
- */
-typedef enum
-{
- DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK = 1 << 0,
- DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK = 1 << 1,
- DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK = 1 << 2,
- DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK = 1 << 3,
- DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK = 1 << 4,
- DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK = 1 << 5,
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK = 1 << 6,
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK = 1 << 7,
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK = 1 << 8,
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK = 1 << 9,
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK = 1 << 10,
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK = 1 << 11,
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK = 1 << 12,
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK = 1 << 13,
- DBUS_THREAD_FUNCTIONS_ALL_MASK = (1 << 14) - 1
-} DBusThreadFunctionsMask;
-
-/**
- * Functions that must be implemented to make the D-Bus library
- * thread-aware.
- *
- * If you supply both recursive and non-recursive mutexes,
- * libdbus will use the non-recursive version for condition variables,
- * and the recursive version in other contexts.
- *
- * The condition variable functions have to work with nonrecursive
- * mutexes if you provide those, or with recursive mutexes if you
- * don't.
- */
-typedef struct
-{
- unsigned int mask; /**< Mask indicating which functions are present. */
-
- DBusMutexNewFunction mutex_new; /**< Function to create a mutex; optional and deprecated. */
- DBusMutexFreeFunction mutex_free; /**< Function to free a mutex; optional and deprecated. */
- DBusMutexLockFunction mutex_lock; /**< Function to lock a mutex; optional and deprecated. */
- DBusMutexUnlockFunction mutex_unlock; /**< Function to unlock a mutex; optional and deprecated. */
-
- DBusCondVarNewFunction condvar_new; /**< Function to create a condition variable */
- DBusCondVarFreeFunction condvar_free; /**< Function to free a condition variable */
- DBusCondVarWaitFunction condvar_wait; /**< Function to wait on a condition */
- DBusCondVarWaitTimeoutFunction condvar_wait_timeout; /**< Function to wait on a condition with a timeout */
- DBusCondVarWakeOneFunction condvar_wake_one; /**< Function to wake one thread waiting on the condition */
- DBusCondVarWakeAllFunction condvar_wake_all; /**< Function to wake all threads waiting on the condition */
-
- DBusRecursiveMutexNewFunction recursive_mutex_new; /**< Function to create a recursive mutex */
- DBusRecursiveMutexFreeFunction recursive_mutex_free; /**< Function to free a recursive mutex */
- DBusRecursiveMutexLockFunction recursive_mutex_lock; /**< Function to lock a recursive mutex */
- DBusRecursiveMutexUnlockFunction recursive_mutex_unlock; /**< Function to unlock a recursive mutex */
-
- void (* padding1) (void); /**< Reserved for future expansion */
- void (* padding2) (void); /**< Reserved for future expansion */
- void (* padding3) (void); /**< Reserved for future expansion */
- void (* padding4) (void); /**< Reserved for future expansion */
-
-} DBusThreadFunctions;
-
-DBUS_EXPORT
-dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions);
-DBUS_EXPORT
-dbus_bool_t dbus_threads_init_default (void);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_THREADS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.c
deleted file mode 100644
index a1d6ce5971..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-timeout.c DBusTimeout implementation
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-timeout.h"
-#include "dbus-list.h"
-
-/**
- * @defgroup DBusTimeoutInternals DBusTimeout implementation details
- * @ingroup DBusInternals
- * @brief implementation details for DBusTimeout
- *
- * @{
- */
-
-/**
- * Internals of DBusTimeout
- */
-struct DBusTimeout
-{
- int refcount; /**< Reference count */
- int interval; /**< Timeout interval in milliseconds. */
-
- DBusTimeoutHandler handler; /**< Timeout handler. */
- void *handler_data; /**< Timeout handler data. */
- DBusFreeFunction free_handler_data_function; /**< Free the timeout handler data. */
-
- void *data; /**< Application data. */
- DBusFreeFunction free_data_function; /**< Free the application data. */
- unsigned int enabled : 1; /**< True if timeout is active. */
-};
-
-/**
- * Creates a new DBusTimeout, enabled by default.
- * @param interval the timeout interval in milliseconds.
- * @param handler function to call when the timeout occurs.
- * @param data data to pass to the handler
- * @param free_data_function function to be called to free the data.
- * @returns the new DBusTimeout object,
- */
-DBusTimeout*
-_dbus_timeout_new (int interval,
- DBusTimeoutHandler handler,
- void *data,
- DBusFreeFunction free_data_function)
-{
- DBusTimeout *timeout;
-
- timeout = dbus_new0 (DBusTimeout, 1);
- if (timeout == NULL)
- return NULL;
-
- timeout->refcount = 1;
- timeout->interval = interval;
-
- timeout->handler = handler;
- timeout->handler_data = data;
- timeout->free_handler_data_function = free_data_function;
-
- timeout->enabled = TRUE;
-
- return timeout;
-}
-
-/**
- * Increments the reference count of a DBusTimeout object.
- *
- * @param timeout the timeout object.
- * @returns the timeout object.
- */
-DBusTimeout *
-_dbus_timeout_ref (DBusTimeout *timeout)
-{
- timeout->refcount += 1;
-
- return timeout;
-}
-
-/**
- * Decrements the reference count of a DBusTimeout object
- * and finalizes the object if the count reaches zero.
- *
- * @param timeout the timeout object.
- */
-void
-_dbus_timeout_unref (DBusTimeout *timeout)
-{
- _dbus_assert (timeout != NULL);
- _dbus_assert (timeout->refcount > 0);
-
- timeout->refcount -= 1;
- if (timeout->refcount == 0)
- {
- dbus_timeout_set_data (timeout, NULL, NULL); /* call free_data_function */
-
- if (timeout->free_handler_data_function)
- (* timeout->free_handler_data_function) (timeout->handler_data);
-
- dbus_free (timeout);
- }
-}
-
-/**
- * Changes the timeout interval. Note that you have to disable and
- * re-enable the timeout using the timeout toggle function
- * (_dbus_connection_toggle_timeout_unlocked() etc.) to notify the
- * application of this change.
- *
- * @param timeout the timeout
- * @param interval the new interval
- */
-void
-_dbus_timeout_set_interval (DBusTimeout *timeout,
- int interval)
-{
- _dbus_assert (interval >= 0);
-
- timeout->interval = interval;
-}
-
-/**
- * Changes the timeout's enabled-ness. Note that you should use
- * _dbus_connection_toggle_timeout_unlocked() etc. instead, if
- * the timeout is passed out to an application main loop.
- * i.e. you can't use this function in the D-Bus library, it's
- * only used in the message bus daemon implementation.
- *
- * @param timeout the timeout
- * @param enabled #TRUE if timeout should be enabled.
- */
-void
-_dbus_timeout_set_enabled (DBusTimeout *timeout,
- dbus_bool_t enabled)
-{
- timeout->enabled = enabled != FALSE;
-}
-
-
-/**
- * @typedef DBusTimeoutList
- *
- * Opaque data type representing a list of timeouts
- * and a set of DBusAddTimeoutFunction/DBusRemoveTimeoutFunction.
- * Automatically handles removing/re-adding timeouts
- * when the DBusAddTimeoutFunction is updated or changed.
- * Holds a reference count to each timeout.
- *
- */
-
-/**
- * DBusTimeoutList implementation details. All fields
- * are private.
- *
- */
-struct DBusTimeoutList
-{
- DBusList *timeouts; /**< Timeout objects. */
-
- DBusAddTimeoutFunction add_timeout_function; /**< Callback for adding a timeout. */
- DBusRemoveTimeoutFunction remove_timeout_function; /**< Callback for removing a timeout. */
- DBusTimeoutToggledFunction timeout_toggled_function; /**< Callback when timeout is enabled/disabled or changes interval */
- void *timeout_data; /**< Data for timeout callbacks */
- DBusFreeFunction timeout_free_data_function; /**< Free function for timeout callback data */
-};
-
-/**
- * Creates a new timeout list. Returns #NULL if insufficient
- * memory exists.
- *
- * @returns the new timeout list, or #NULL on failure.
- */
-DBusTimeoutList*
-_dbus_timeout_list_new (void)
-{
- DBusTimeoutList *timeout_list;
-
- timeout_list = dbus_new0 (DBusTimeoutList, 1);
- if (timeout_list == NULL)
- return NULL;
-
- return timeout_list;
-}
-
-/**
- * Frees a DBusTimeoutList.
- *
- * @param timeout_list the timeout list.
- */
-void
-_dbus_timeout_list_free (DBusTimeoutList *timeout_list)
-{
- /* free timeout_data and remove timeouts as a side effect */
- _dbus_timeout_list_set_functions (timeout_list,
- NULL, NULL, NULL, NULL, NULL);
-
- _dbus_list_foreach (&timeout_list->timeouts,
- (DBusForeachFunction) _dbus_timeout_unref,
- NULL);
- _dbus_list_clear (&timeout_list->timeouts);
-
- dbus_free (timeout_list);
-}
-
-/**
- * Sets the timeout functions. This function is the "backend"
- * for dbus_connection_set_timeout_functions().
- *
- * @param timeout_list the timeout list
- * @param add_function the add timeout function.
- * @param remove_function the remove timeout function.
- * @param toggled_function toggle notify function, or #NULL
- * @param data the data for those functions.
- * @param free_data_function the function to free the data.
- * @returns #FALSE if no memory
- *
- */
-dbus_bool_t
-_dbus_timeout_list_set_functions (DBusTimeoutList *timeout_list,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- /* Add timeouts with the new function, failing on OOM */
- if (add_function != NULL)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&timeout_list->timeouts);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&timeout_list->timeouts,
- link);
-
- if (!(* add_function) (link->data, data))
- {
- /* remove it all again and return FALSE */
- DBusList *link2;
-
- link2 = _dbus_list_get_first_link (&timeout_list->timeouts);
- while (link2 != link)
- {
- DBusList *next = _dbus_list_get_next_link (&timeout_list->timeouts,
- link2);
-
- (* remove_function) (link2->data, data);
-
- link2 = next;
- }
-
- return FALSE;
- }
-
- link = next;
- }
- }
-
- /* Remove all current timeouts from previous timeout handlers */
-
- if (timeout_list->remove_timeout_function != NULL)
- {
- _dbus_list_foreach (&timeout_list->timeouts,
- (DBusForeachFunction) timeout_list->remove_timeout_function,
- timeout_list->timeout_data);
- }
-
- if (timeout_list->timeout_free_data_function != NULL)
- (* timeout_list->timeout_free_data_function) (timeout_list->timeout_data);
-
- timeout_list->add_timeout_function = add_function;
- timeout_list->remove_timeout_function = remove_function;
- timeout_list->timeout_toggled_function = toggled_function;
- timeout_list->timeout_data = data;
- timeout_list->timeout_free_data_function = free_data_function;
-
- return TRUE;
-}
-
-/**
- * Adds a new timeout to the timeout list, invoking the
- * application DBusAddTimeoutFunction if appropriate.
- *
- * @param timeout_list the timeout list.
- * @param timeout the timeout to add.
- * @returns #TRUE on success, #FALSE If no memory.
- */
-dbus_bool_t
-_dbus_timeout_list_add_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout)
-{
- if (!_dbus_list_append (&timeout_list->timeouts, timeout))
- return FALSE;
-
- _dbus_timeout_ref (timeout);
-
- if (timeout_list->add_timeout_function != NULL)
- {
- if (!(* timeout_list->add_timeout_function) (timeout,
- timeout_list->timeout_data))
- {
- _dbus_list_remove_last (&timeout_list->timeouts, timeout);
- _dbus_timeout_unref (timeout);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- * Removes a timeout from the timeout list, invoking the
- * application's DBusRemoveTimeoutFunction if appropriate.
- *
- * @param timeout_list the timeout list.
- * @param timeout the timeout to remove.
- */
-void
-_dbus_timeout_list_remove_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout)
-{
- if (!_dbus_list_remove (&timeout_list->timeouts, timeout))
- _dbus_assert_not_reached ("Nonexistent timeout was removed");
-
- if (timeout_list->remove_timeout_function != NULL)
- (* timeout_list->remove_timeout_function) (timeout,
- timeout_list->timeout_data);
-
- _dbus_timeout_unref (timeout);
-}
-
-/**
- * Sets a timeout to the given enabled state, invoking the
- * application's DBusTimeoutToggledFunction if appropriate.
- *
- * @param timeout_list the timeout list.
- * @param timeout the timeout to toggle.
- * @param enabled #TRUE to enable
- */
-void
-_dbus_timeout_list_toggle_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout,
- dbus_bool_t enabled)
-{
- enabled = !!enabled;
-
- if (enabled == timeout->enabled)
- return;
-
- timeout->enabled = enabled;
-
- if (timeout_list->timeout_toggled_function != NULL)
- (* timeout_list->timeout_toggled_function) (timeout,
- timeout_list->timeout_data);
-}
-
-/** @} */
-
-/**
- * @defgroup DBusTimeout DBusTimeout
- * @ingroup DBus
- * @brief Object representing a timeout
- *
- * Types and functions related to DBusTimeout. A timeout
- * represents a timeout that the main loop needs to monitor,
- * as in Qt's QTimer or GLib's g_timeout_add().
- *
- * Use dbus_connection_set_timeout_functions() or dbus_server_set_timeout_functions()
- * to be notified when libdbus needs to add or remove timeouts.
- *
- * @{
- */
-
-
-/**
- * @typedef DBusTimeout
- *
- * Opaque object representing a timeout.
- */
-
-/**
- * Gets the timeout interval. The dbus_timeout_handle()
- * should be called each time this interval elapses,
- * starting after it elapses once.
- *
- * The interval may change during the life of the
- * timeout; if so, the timeout will be disabled and
- * re-enabled (calling the "timeout toggled function")
- * to notify you of the change.
- *
- * @param timeout the DBusTimeout object.
- * @returns the interval in milliseconds.
- */
-int
-dbus_timeout_get_interval (DBusTimeout *timeout)
-{
- return timeout->interval;
-}
-
-/**
- * Gets data previously set with dbus_timeout_set_data()
- * or #NULL if none.
- *
- * @param timeout the DBusTimeout object.
- * @returns previously-set data.
- */
-void*
-dbus_timeout_get_data (DBusTimeout *timeout)
-{
- return timeout->data;
-}
-
-/**
- * Sets data which can be retrieved with dbus_timeout_get_data().
- * Intended for use by the DBusAddTimeoutFunction and
- * DBusRemoveTimeoutFunction to store their own data. For example with
- * Qt you might store the QTimer for this timeout and with GLib
- * you might store a g_timeout_add result id.
- *
- * @param timeout the DBusTimeout object.
- * @param data the data.
- * @param free_data_function function to be called to free the data.
- */
-void
-dbus_timeout_set_data (DBusTimeout *timeout,
- void *data,
- DBusFreeFunction free_data_function)
-{
- if (timeout->free_data_function != NULL)
- (* timeout->free_data_function) (timeout->data);
-
- timeout->data = data;
- timeout->free_data_function = free_data_function;
-}
-
-/**
- * Calls the timeout handler for this timeout.
- * This function should be called when the timeout
- * occurs.
- *
- * If this function returns #FALSE, then there wasn't
- * enough memory to handle the timeout. Typically just
- * letting the timeout fire again next time it naturally
- * times out is an adequate response to that problem,
- * but you could try to do more if you wanted.
- *
- * @param timeout the DBusTimeout object.
- * @returns #FALSE if there wasn't enough memory
- */
-dbus_bool_t
-dbus_timeout_handle (DBusTimeout *timeout)
-{
- return (* timeout->handler) (timeout->handler_data);
-}
-
-
-/**
- * Returns whether a timeout is enabled or not. If not
- * enabled, it should not be polled by the main loop.
- *
- * @param timeout the DBusTimeout object
- * @returns #TRUE if the timeout is enabled
- */
-dbus_bool_t
-dbus_timeout_get_enabled (DBusTimeout *timeout)
-{
- return timeout->enabled;
-}
-
-/** @} end public API docs */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.h
deleted file mode 100644
index d0a8af4a8b..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-timeout.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-timeout.h DBusTimeout internal interfaces
- *
- * Copyright (C) 2003 CodeFactory AB
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TIMEOUT_H
-#define DBUS_TIMEOUT_H
-
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-internals.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusTimeoutInternals
- * @{
- */
-
-/* Public methods on DBusTimeout are in dbus-connection.h */
-
-typedef struct DBusTimeoutList DBusTimeoutList;
-
-/** function to run when the timeout is handled */
-typedef dbus_bool_t (* DBusTimeoutHandler) (void *data);
-
-DBusTimeout* _dbus_timeout_new (int interval,
- DBusTimeoutHandler handler,
- void *data,
- DBusFreeFunction free_data_function);
-DBusTimeout* _dbus_timeout_ref (DBusTimeout *timeout);
-void _dbus_timeout_unref (DBusTimeout *timeout);
-void _dbus_timeout_set_interval (DBusTimeout *timeout,
- int interval);
-void _dbus_timeout_set_enabled (DBusTimeout *timeout,
- dbus_bool_t enabled);
-
-DBusTimeoutList *_dbus_timeout_list_new (void);
-void _dbus_timeout_list_free (DBusTimeoutList *timeout_list);
-dbus_bool_t _dbus_timeout_list_set_functions (DBusTimeoutList *timeout_list,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-dbus_bool_t _dbus_timeout_list_add_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout);
-void _dbus_timeout_list_remove_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout);
-void _dbus_timeout_list_toggle_timeout (DBusTimeoutList *timeout_list,
- DBusTimeout *timeout,
- dbus_bool_t enabled);
-
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TIMEOUT_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-protected.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-protected.h
deleted file mode 100644
index 396f0ffde7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-protected.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-protected.h Used by subclasses of DBusTransport object (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TRANSPORT_PROTECTED_H
-#define DBUS_TRANSPORT_PROTECTED_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-transport.h>
-#include <dbus/dbus-message-internal.h>
-#include <dbus/dbus-auth.h>
-#include <dbus/dbus-resources.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusTransportVTable DBusTransportVTable;
-
-/**
- * The virtual table that must be implemented to
- * create a new kind of transport.
- */
-struct DBusTransportVTable
-{
- void (* finalize) (DBusTransport *transport);
- /**< The finalize method must free the transport. */
-
- dbus_bool_t (* handle_watch) (DBusTransport *transport,
- DBusWatch *watch,
- unsigned int flags);
- /**< The handle_watch method handles reading/writing
- * data as indicated by the flags.
- */
-
- void (* disconnect) (DBusTransport *transport);
- /**< Disconnect this transport. */
-
- dbus_bool_t (* connection_set) (DBusTransport *transport);
- /**< Called when transport->connection has been filled in */
-
- void (* do_iteration) (DBusTransport *transport,
- unsigned int flags,
- int timeout_milliseconds);
- /**< Called to do a single "iteration" (block on select/poll
- * followed by reading or writing data).
- */
-
- void (* live_messages_changed) (DBusTransport *transport);
- /**< Outstanding messages counter changed */
-
- dbus_bool_t (* get_socket_fd) (DBusTransport *transport,
- int *fd_p);
- /**< Get socket file descriptor */
-};
-
-/**
- * Object representing a transport such as a socket.
- * A transport can shuttle messages from point A to point B,
- * and is the backend for a #DBusConnection.
- *
- */
-struct DBusTransport
-{
- int refcount; /**< Reference count. */
-
- const DBusTransportVTable *vtable; /**< Virtual methods for this instance. */
-
- DBusConnection *connection; /**< Connection owning this transport. */
-
- DBusMessageLoader *loader; /**< Message-loading buffer. */
-
- DBusAuth *auth; /**< Authentication conversation */
-
- DBusCredentials *credentials; /**< Credentials of other end read from the socket */
-
- long max_live_messages_size; /**< Max total size of received messages. */
- long max_live_messages_unix_fds; /**< Max total unix fds of received messages. */
-
- DBusCounter *live_messages; /**< Counter for size/unix fds of all live messages. */
-
- char *address; /**< Address of the server we are connecting to (#NULL for the server side of a transport) */
-
- char *expected_guid; /**< GUID we expect the server to have, #NULL on server side or if we don't have an expectation */
-
- DBusAllowUnixUserFunction unix_user_function; /**< Function for checking whether a user is authorized. */
- void *unix_user_data; /**< Data for unix_user_function */
-
- DBusFreeFunction free_unix_user_data; /**< Function to free unix_user_data */
-
- DBusAllowWindowsUserFunction windows_user_function; /**< Function for checking whether a user is authorized. */
- void *windows_user_data; /**< Data for windows_user_function */
-
- DBusFreeFunction free_windows_user_data; /**< Function to free windows_user_data */
-
- unsigned int disconnected : 1; /**< #TRUE if we are disconnected. */
- unsigned int authenticated : 1; /**< Cache of auth state; use _dbus_transport_peek_is_authenticated() to query value */
- unsigned int send_credentials_pending : 1; /**< #TRUE if we need to send credentials */
- unsigned int receive_credentials_pending : 1; /**< #TRUE if we need to receive credentials */
- unsigned int is_server : 1; /**< #TRUE if on the server side */
- unsigned int unused_bytes_recovered : 1; /**< #TRUE if we've recovered unused bytes from auth */
- unsigned int allow_anonymous : 1; /**< #TRUE if an anonymous client can connect */
-};
-
-dbus_bool_t _dbus_transport_init_base (DBusTransport *transport,
- const DBusTransportVTable *vtable,
- const DBusString *server_guid,
- const DBusString *address);
-void _dbus_transport_finalize_base (DBusTransport *transport);
-
-
-typedef enum
-{
- DBUS_TRANSPORT_OPEN_NOT_HANDLED, /**< we aren't in charge of this address type */
- DBUS_TRANSPORT_OPEN_OK, /**< we set up the listen */
- DBUS_TRANSPORT_OPEN_BAD_ADDRESS, /**< malformed address */
- DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT /**< well-formed address but failed to set it up */
-} DBusTransportOpenResult;
-
-DBusTransportOpenResult _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error);
-
-#define DBUS_TRANSPORT_CAN_SEND_UNIX_FD(x) \
- _dbus_auth_get_unix_fd_negotiated((x)->auth)
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TRANSPORT_PROTECTED_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.c
deleted file mode 100644
index 44c7af7df6..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.c
+++ /dev/null
@@ -1,1431 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-socket.c Socket subclasses of DBusTransport
- *
- * Copyright (C) 2002, 2003, 2004, 2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-connection-internal.h"
-#include "dbus-nonce.h"
-#include "dbus-transport-socket.h"
-#include "dbus-transport-protected.h"
-#include "dbus-watch.h"
-#include "dbus-credentials.h"
-
-/**
- * @defgroup DBusTransportSocket DBusTransport implementations for sockets
- * @ingroup DBusInternals
- * @brief Implementation details of DBusTransport on sockets
- *
- * @{
- */
-
-/**
- * Opaque object representing a socket file descriptor transport.
- */
-typedef struct DBusTransportSocket DBusTransportSocket;
-
-/**
- * Implementation details of DBusTransportSocket. All members are private.
- */
-struct DBusTransportSocket
-{
- DBusTransport base; /**< Parent instance */
- int fd; /**< File descriptor. */
- DBusWatch *read_watch; /**< Watch for readability. */
- DBusWatch *write_watch; /**< Watch for writability. */
-
- int max_bytes_read_per_iteration; /**< To avoid blocking too long. */
- int max_bytes_written_per_iteration; /**< To avoid blocking too long. */
-
- int message_bytes_written; /**< Number of bytes of current
- * outgoing message that have
- * been written.
- */
- DBusString encoded_outgoing; /**< Encoded version of current
- * outgoing message.
- */
- DBusString encoded_incoming; /**< Encoded version of current
- * incoming data.
- */
-};
-
-static void
-free_watches (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- _dbus_verbose ("start\n");
-
- if (socket_transport->read_watch)
- {
- if (transport->connection)
- _dbus_connection_remove_watch_unlocked (transport->connection,
- socket_transport->read_watch);
- _dbus_watch_invalidate (socket_transport->read_watch);
- _dbus_watch_unref (socket_transport->read_watch);
- socket_transport->read_watch = NULL;
- }
-
- if (socket_transport->write_watch)
- {
- if (transport->connection)
- _dbus_connection_remove_watch_unlocked (transport->connection,
- socket_transport->write_watch);
- _dbus_watch_invalidate (socket_transport->write_watch);
- _dbus_watch_unref (socket_transport->write_watch);
- socket_transport->write_watch = NULL;
- }
-
- _dbus_verbose ("end\n");
-}
-
-static void
-socket_finalize (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- _dbus_verbose ("\n");
-
- free_watches (transport);
-
- _dbus_string_free (&socket_transport->encoded_outgoing);
- _dbus_string_free (&socket_transport->encoded_incoming);
-
- _dbus_transport_finalize_base (transport);
-
- _dbus_assert (socket_transport->read_watch == NULL);
- _dbus_assert (socket_transport->write_watch == NULL);
-
- dbus_free (transport);
-}
-
-static void
-check_write_watch (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- dbus_bool_t needed;
-
- if (transport->connection == NULL)
- return;
-
- if (transport->disconnected)
- {
- _dbus_assert (socket_transport->write_watch == NULL);
- return;
- }
-
- _dbus_transport_ref (transport);
-
- if (_dbus_transport_try_to_authenticate (transport))
- needed = _dbus_connection_has_messages_to_send_unlocked (transport->connection);
- else
- {
- if (transport->send_credentials_pending)
- needed = TRUE;
- else
- {
- DBusAuthState auth_state;
-
- auth_state = _dbus_auth_do_work (transport->auth);
-
- /* If we need memory we install the write watch just in case,
- * if there's no need for it, it will get de-installed
- * next time we try reading.
- */
- if (auth_state == DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND ||
- auth_state == DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
- needed = TRUE;
- else
- needed = FALSE;
- }
- }
-
- _dbus_verbose ("check_write_watch(): needed = %d on connection %p watch %p fd = %d outgoing messages exist %d\n",
- needed, transport->connection, socket_transport->write_watch,
- socket_transport->fd,
- _dbus_connection_has_messages_to_send_unlocked (transport->connection));
-
- _dbus_connection_toggle_watch_unlocked (transport->connection,
- socket_transport->write_watch,
- needed);
-
- _dbus_transport_unref (transport);
-}
-
-static void
-check_read_watch (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- dbus_bool_t need_read_watch;
-
- _dbus_verbose ("fd = %d\n",socket_transport->fd);
-
- if (transport->connection == NULL)
- return;
-
- if (transport->disconnected)
- {
- _dbus_assert (socket_transport->read_watch == NULL);
- return;
- }
-
- _dbus_transport_ref (transport);
-
- if (_dbus_transport_try_to_authenticate (transport))
- need_read_watch =
- (_dbus_counter_get_size_value (transport->live_messages) < transport->max_live_messages_size) &&
- (_dbus_counter_get_unix_fd_value (transport->live_messages) < transport->max_live_messages_unix_fds);
- else
- {
- if (transport->receive_credentials_pending)
- need_read_watch = TRUE;
- else
- {
- /* The reason to disable need_read_watch when not WAITING_FOR_INPUT
- * is to avoid spinning on the file descriptor when we're waiting
- * to write or for some other part of the auth process
- */
- DBusAuthState auth_state;
-
- auth_state = _dbus_auth_do_work (transport->auth);
-
- /* If we need memory we install the read watch just in case,
- * if there's no need for it, it will get de-installed
- * next time we try reading. If we're authenticated we
- * install it since we normally have it installed while
- * authenticated.
- */
- if (auth_state == DBUS_AUTH_STATE_WAITING_FOR_INPUT ||
- auth_state == DBUS_AUTH_STATE_WAITING_FOR_MEMORY ||
- auth_state == DBUS_AUTH_STATE_AUTHENTICATED)
- need_read_watch = TRUE;
- else
- need_read_watch = FALSE;
- }
- }
-
- _dbus_verbose (" setting read watch enabled = %d\n", need_read_watch);
- _dbus_connection_toggle_watch_unlocked (transport->connection,
- socket_transport->read_watch,
- need_read_watch);
-
- _dbus_transport_unref (transport);
-}
-
-static void
-do_io_error (DBusTransport *transport)
-{
- _dbus_transport_ref (transport);
- _dbus_transport_disconnect (transport);
- _dbus_transport_unref (transport);
-}
-
-/* return value is whether we successfully read any new data. */
-static dbus_bool_t
-read_data_into_auth (DBusTransport *transport,
- dbus_bool_t *oom)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- DBusString *buffer;
- int bytes_read;
-
- *oom = FALSE;
-
- _dbus_auth_get_buffer (transport->auth, &buffer);
-
- bytes_read = _dbus_read_socket (socket_transport->fd,
- buffer, socket_transport->max_bytes_read_per_iteration);
-
- _dbus_auth_return_buffer (transport->auth, buffer,
- bytes_read > 0 ? bytes_read : 0);
-
- if (bytes_read > 0)
- {
- _dbus_verbose (" read %d bytes in auth phase\n", bytes_read);
-
- return TRUE;
- }
- else if (bytes_read < 0)
- {
- /* EINTR already handled for us */
-
- if (_dbus_get_is_errno_enomem ())
- {
- *oom = TRUE;
- }
- else if (_dbus_get_is_errno_eagain_or_ewouldblock ())
- ; /* do nothing, just return FALSE below */
- else
- {
- _dbus_verbose ("Error reading from remote app: %s\n",
- _dbus_strerror_from_errno ());
- do_io_error (transport);
- }
-
- return FALSE;
- }
- else
- {
- _dbus_assert (bytes_read == 0);
-
- _dbus_verbose ("Disconnected from remote app\n");
- do_io_error (transport);
-
- return FALSE;
- }
-}
-
-/* Return value is whether we successfully wrote any bytes */
-static dbus_bool_t
-write_data_from_auth (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- int bytes_written;
- const DBusString *buffer;
-
- if (!_dbus_auth_get_bytes_to_send (transport->auth,
- &buffer))
- return FALSE;
-
- bytes_written = _dbus_write_socket (socket_transport->fd,
- buffer,
- 0, _dbus_string_get_length (buffer));
-
- if (bytes_written > 0)
- {
- _dbus_auth_bytes_sent (transport->auth, bytes_written);
- return TRUE;
- }
- else if (bytes_written < 0)
- {
- /* EINTR already handled for us */
-
- if (_dbus_get_is_errno_eagain_or_ewouldblock ())
- ;
- else
- {
- _dbus_verbose ("Error writing to remote app: %s\n",
- _dbus_strerror_from_errno ());
- do_io_error (transport);
- }
- }
-
- return FALSE;
-}
-
-/* FALSE on OOM */
-static dbus_bool_t
-exchange_credentials (DBusTransport *transport,
- dbus_bool_t do_reading,
- dbus_bool_t do_writing)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- DBusError error = DBUS_ERROR_INIT;
-
- _dbus_verbose ("exchange_credentials: do_reading = %d, do_writing = %d\n",
- do_reading, do_writing);
-
- if (do_writing && transport->send_credentials_pending)
- {
- if (_dbus_send_credentials_socket (socket_transport->fd,
- &error))
- {
- transport->send_credentials_pending = FALSE;
- }
- else
- {
- _dbus_verbose ("Failed to write credentials: %s\n", error.message);
- dbus_error_free (&error);
- do_io_error (transport);
- }
- }
-
- if (do_reading && transport->receive_credentials_pending)
- {
- /* FIXME this can fail due to IO error _or_ OOM, broken
- * (somewhat tricky to fix since the OOM error can be set after
- * we already read the credentials byte, so basically we need to
- * separate reading the byte and storing it in the
- * transport->credentials). Does not really matter for now
- * because storing in credentials never actually fails on unix.
- */
- if (_dbus_read_credentials_socket (socket_transport->fd,
- transport->credentials,
- &error))
- {
- transport->receive_credentials_pending = FALSE;
- }
- else
- {
- _dbus_verbose ("Failed to read credentials %s\n", error.message);
- dbus_error_free (&error);
- do_io_error (transport);
- }
- }
-
- if (!(transport->send_credentials_pending ||
- transport->receive_credentials_pending))
- {
- if (!_dbus_auth_set_credentials (transport->auth,
- transport->credentials))
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-do_authentication (DBusTransport *transport,
- dbus_bool_t do_reading,
- dbus_bool_t do_writing,
- dbus_bool_t *auth_completed)
-{
- dbus_bool_t oom;
- dbus_bool_t orig_auth_state;
-
- oom = FALSE;
-
- orig_auth_state = _dbus_transport_try_to_authenticate (transport);
-
- /* This is essential to avoid the check_write_watch() at the end,
- * we don't want to add a write watch in do_iteration before
- * we try writing and get EAGAIN
- */
- if (orig_auth_state)
- {
- if (auth_completed)
- *auth_completed = FALSE;
- return TRUE;
- }
-
- _dbus_transport_ref (transport);
-
- while (!_dbus_transport_try_to_authenticate (transport) &&
- _dbus_transport_get_is_connected (transport))
- {
- if (!exchange_credentials (transport, do_reading, do_writing))
- {
- /* OOM */
- oom = TRUE;
- goto out;
- }
-
- if (transport->send_credentials_pending ||
- transport->receive_credentials_pending)
- {
- _dbus_verbose ("send_credentials_pending = %d receive_credentials_pending = %d\n",
- transport->send_credentials_pending,
- transport->receive_credentials_pending);
- goto out;
- }
-
-#define TRANSPORT_SIDE(t) ((t)->is_server ? "server" : "client")
- switch (_dbus_auth_do_work (transport->auth))
- {
- case DBUS_AUTH_STATE_WAITING_FOR_INPUT:
- _dbus_verbose (" %s auth state: waiting for input\n",
- TRANSPORT_SIDE (transport));
- if (!do_reading || !read_data_into_auth (transport, &oom))
- goto out;
- break;
-
- case DBUS_AUTH_STATE_WAITING_FOR_MEMORY:
- _dbus_verbose (" %s auth state: waiting for memory\n",
- TRANSPORT_SIDE (transport));
- oom = TRUE;
- goto out;
- break;
-
- case DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND:
- _dbus_verbose (" %s auth state: bytes to send\n",
- TRANSPORT_SIDE (transport));
- if (!do_writing || !write_data_from_auth (transport))
- goto out;
- break;
-
- case DBUS_AUTH_STATE_NEED_DISCONNECT:
- _dbus_verbose (" %s auth state: need to disconnect\n",
- TRANSPORT_SIDE (transport));
- do_io_error (transport);
- break;
-
- case DBUS_AUTH_STATE_AUTHENTICATED:
- _dbus_verbose (" %s auth state: authenticated\n",
- TRANSPORT_SIDE (transport));
- break;
- }
- }
-
- out:
- if (auth_completed)
- *auth_completed = (orig_auth_state != _dbus_transport_try_to_authenticate (transport));
-
- check_read_watch (transport);
- check_write_watch (transport);
- _dbus_transport_unref (transport);
-
- if (oom)
- return FALSE;
- else
- return TRUE;
-}
-
-/* returns false on oom */
-static dbus_bool_t
-do_writing (DBusTransport *transport)
-{
- int total;
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- dbus_bool_t oom;
-
- /* No messages without authentication! */
- if (!_dbus_transport_try_to_authenticate (transport))
- {
- _dbus_verbose ("Not authenticated, not writing anything\n");
- return TRUE;
- }
-
- if (transport->disconnected)
- {
- _dbus_verbose ("Not connected, not writing anything\n");
- return TRUE;
- }
-
-#if 1
- _dbus_verbose ("do_writing(), have_messages = %d, fd = %d\n",
- _dbus_connection_has_messages_to_send_unlocked (transport->connection),
- socket_transport->fd);
-#endif
-
- oom = FALSE;
- total = 0;
-
- while (!transport->disconnected &&
- _dbus_connection_has_messages_to_send_unlocked (transport->connection))
- {
- int bytes_written;
- DBusMessage *message;
- const DBusString *header;
- const DBusString *body;
- int header_len, body_len;
- int total_bytes_to_write;
-
- if (total > socket_transport->max_bytes_written_per_iteration)
- {
- _dbus_verbose ("%d bytes exceeds %d bytes written per iteration, returning\n",
- total, socket_transport->max_bytes_written_per_iteration);
- goto out;
- }
-
- message = _dbus_connection_get_message_to_send (transport->connection);
- _dbus_assert (message != NULL);
- dbus_message_lock (message);
-
-#if 0
- _dbus_verbose ("writing message %p\n", message);
-#endif
-
- _dbus_message_get_network_data (message,
- &header, &body);
-
- header_len = _dbus_string_get_length (header);
- body_len = _dbus_string_get_length (body);
-
- if (_dbus_auth_needs_encoding (transport->auth))
- {
- /* Does fd passing even make sense with encoded data? */
- _dbus_assert(!DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport));
-
- if (_dbus_string_get_length (&socket_transport->encoded_outgoing) == 0)
- {
- if (!_dbus_auth_encode_data (transport->auth,
- header, &socket_transport->encoded_outgoing))
- {
- oom = TRUE;
- goto out;
- }
-
- if (!_dbus_auth_encode_data (transport->auth,
- body, &socket_transport->encoded_outgoing))
- {
- _dbus_string_set_length (&socket_transport->encoded_outgoing, 0);
- oom = TRUE;
- goto out;
- }
- }
-
- total_bytes_to_write = _dbus_string_get_length (&socket_transport->encoded_outgoing);
-
-#if 0
- _dbus_verbose ("encoded message is %d bytes\n",
- total_bytes_to_write);
-#endif
-
- bytes_written =
- _dbus_write_socket (socket_transport->fd,
- &socket_transport->encoded_outgoing,
- socket_transport->message_bytes_written,
- total_bytes_to_write - socket_transport->message_bytes_written);
- }
- else
- {
- total_bytes_to_write = header_len + body_len;
-
-#if 0
- _dbus_verbose ("message is %d bytes\n",
- total_bytes_to_write);
-#endif
-
-#ifdef HAVE_UNIX_FD_PASSING
- if (socket_transport->message_bytes_written <= 0 && DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport))
- {
- /* Send the fds along with the first byte of the message */
- const int *unix_fds;
- unsigned n;
-
- _dbus_message_get_unix_fds(message, &unix_fds, &n);
-
- bytes_written =
- _dbus_write_socket_with_unix_fds_two (socket_transport->fd,
- header,
- socket_transport->message_bytes_written,
- header_len - socket_transport->message_bytes_written,
- body,
- 0, body_len,
- unix_fds,
- n);
-
- if (bytes_written > 0 && n > 0)
- _dbus_verbose("Wrote %i unix fds\n", n);
- }
- else
-#endif
- {
- if (socket_transport->message_bytes_written < header_len)
- {
- bytes_written =
- _dbus_write_socket_two (socket_transport->fd,
- header,
- socket_transport->message_bytes_written,
- header_len - socket_transport->message_bytes_written,
- body,
- 0, body_len);
- }
- else
- {
- bytes_written =
- _dbus_write_socket (socket_transport->fd,
- body,
- (socket_transport->message_bytes_written - header_len),
- body_len -
- (socket_transport->message_bytes_written - header_len));
- }
- }
- }
-
- if (bytes_written < 0)
- {
- /* EINTR already handled for us */
-
- /* For some discussion of why we also ignore EPIPE here, see
- * http://lists.freedesktop.org/archives/dbus/2008-March/009526.html
- */
-
- if (_dbus_get_is_errno_eagain_or_ewouldblock () || _dbus_get_is_errno_epipe ())
- goto out;
- else
- {
- _dbus_verbose ("Error writing to remote app: %s\n",
- _dbus_strerror_from_errno ());
- do_io_error (transport);
- goto out;
- }
- }
- else
- {
- _dbus_verbose (" wrote %d bytes of %d\n", bytes_written,
- total_bytes_to_write);
-
- total += bytes_written;
- socket_transport->message_bytes_written += bytes_written;
-
- _dbus_assert (socket_transport->message_bytes_written <=
- total_bytes_to_write);
-
- if (socket_transport->message_bytes_written == total_bytes_to_write)
- {
- socket_transport->message_bytes_written = 0;
- _dbus_string_set_length (&socket_transport->encoded_outgoing, 0);
- _dbus_string_compact (&socket_transport->encoded_outgoing, 2048);
-
- _dbus_connection_message_sent_unlocked (transport->connection,
- message);
- }
- }
- }
-
- out:
- if (oom)
- return FALSE;
- else
- return TRUE;
-}
-
-/* returns false on out-of-memory */
-static dbus_bool_t
-do_reading (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- DBusString *buffer;
- int bytes_read;
- int total;
- dbus_bool_t oom;
-
- _dbus_verbose ("fd = %d\n",socket_transport->fd);
-
- /* No messages without authentication! */
- if (!_dbus_transport_try_to_authenticate (transport))
- return TRUE;
-
- oom = FALSE;
-
- total = 0;
-
- again:
-
- /* See if we've exceeded max messages and need to disable reading */
- check_read_watch (transport);
-
- if (total > socket_transport->max_bytes_read_per_iteration)
- {
- _dbus_verbose ("%d bytes exceeds %d bytes read per iteration, returning\n",
- total, socket_transport->max_bytes_read_per_iteration);
- goto out;
- }
-
- _dbus_assert (socket_transport->read_watch != NULL ||
- transport->disconnected);
-
- if (transport->disconnected)
- goto out;
-
- if (!dbus_watch_get_enabled (socket_transport->read_watch))
- return TRUE;
-
- if (_dbus_auth_needs_decoding (transport->auth))
- {
- /* Does fd passing even make sense with encoded data? */
- _dbus_assert(!DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport));
-
- if (_dbus_string_get_length (&socket_transport->encoded_incoming) > 0)
- bytes_read = _dbus_string_get_length (&socket_transport->encoded_incoming);
- else
- bytes_read = _dbus_read_socket (socket_transport->fd,
- &socket_transport->encoded_incoming,
- socket_transport->max_bytes_read_per_iteration);
-
- _dbus_assert (_dbus_string_get_length (&socket_transport->encoded_incoming) ==
- bytes_read);
-
- if (bytes_read > 0)
- {
- _dbus_message_loader_get_buffer (transport->loader,
- &buffer);
-
- if (!_dbus_auth_decode_data (transport->auth,
- &socket_transport->encoded_incoming,
- buffer))
- {
- _dbus_verbose ("Out of memory decoding incoming data\n");
- _dbus_message_loader_return_buffer (transport->loader,
- buffer);
-
- oom = TRUE;
- goto out;
- }
-
- _dbus_message_loader_return_buffer (transport->loader,
- buffer);
-
- _dbus_string_set_length (&socket_transport->encoded_incoming, 0);
- _dbus_string_compact (&socket_transport->encoded_incoming, 2048);
- }
- }
- else
- {
- _dbus_message_loader_get_buffer (transport->loader,
- &buffer);
-
-#ifdef HAVE_UNIX_FD_PASSING
- if (DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport))
- {
- int *fds, n_fds;
-
- if (!_dbus_message_loader_get_unix_fds(transport->loader, &fds, &n_fds))
- {
- _dbus_verbose ("Out of memory reading file descriptors\n");
- _dbus_message_loader_return_buffer (transport->loader, buffer);
- oom = TRUE;
- goto out;
- }
-
- bytes_read = _dbus_read_socket_with_unix_fds(socket_transport->fd,
- buffer,
- socket_transport->max_bytes_read_per_iteration,
- fds, &n_fds);
-
- if (bytes_read >= 0 && n_fds > 0)
- _dbus_verbose("Read %i unix fds\n", n_fds);
-
- _dbus_message_loader_return_unix_fds(transport->loader, fds, bytes_read < 0 ? 0 : n_fds);
- }
- else
-#endif
- {
- bytes_read = _dbus_read_socket (socket_transport->fd,
- buffer, socket_transport->max_bytes_read_per_iteration);
- }
-
- _dbus_message_loader_return_buffer (transport->loader,
- buffer);
- }
-
- if (bytes_read < 0)
- {
- /* EINTR already handled for us */
-
- if (_dbus_get_is_errno_enomem ())
- {
- _dbus_verbose ("Out of memory in read()/do_reading()\n");
- oom = TRUE;
- goto out;
- }
- else if (_dbus_get_is_errno_eagain_or_ewouldblock ())
- goto out;
- else
- {
- _dbus_verbose ("Error reading from remote app: %s\n",
- _dbus_strerror_from_errno ());
- do_io_error (transport);
- goto out;
- }
- }
- else if (bytes_read == 0)
- {
- _dbus_verbose ("Disconnected from remote app\n");
- do_io_error (transport);
- goto out;
- }
- else
- {
- _dbus_verbose (" read %d bytes\n", bytes_read);
-
- total += bytes_read;
-
- if (!_dbus_transport_queue_messages (transport))
- {
- oom = TRUE;
- _dbus_verbose (" out of memory when queueing messages we just read in the transport\n");
- goto out;
- }
-
- /* Try reading more data until we get EAGAIN and return, or
- * exceed max bytes per iteration. If in blocking mode of
- * course we'll block instead of returning.
- */
- goto again;
- }
-
- out:
- if (oom)
- return FALSE;
- else
- return TRUE;
-}
-
-static dbus_bool_t
-unix_error_with_read_to_come (DBusTransport *itransport,
- DBusWatch *watch,
- unsigned int flags)
-{
- DBusTransportSocket *transport = (DBusTransportSocket *) itransport;
-
- if (!(flags & DBUS_WATCH_HANGUP || flags & DBUS_WATCH_ERROR))
- return FALSE;
-
- /* If we have a read watch enabled ...
- we -might have data incoming ... => handle the HANGUP there */
- if (watch != transport->read_watch &&
- _dbus_watch_get_enabled (transport->read_watch))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-socket_handle_watch (DBusTransport *transport,
- DBusWatch *watch,
- unsigned int flags)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- _dbus_assert (watch == socket_transport->read_watch ||
- watch == socket_transport->write_watch);
- _dbus_assert (watch != NULL);
-
- /* If we hit an error here on a write watch, don't disconnect the transport yet because data can
- * still be in the buffer and do_reading may need several iteration to read
- * it all (because of its max_bytes_read_per_iteration limit).
- */
- if (!(flags & DBUS_WATCH_READABLE) && unix_error_with_read_to_come (transport, watch, flags))
- {
- _dbus_verbose ("Hang up or error on watch\n");
- _dbus_transport_disconnect (transport);
- return TRUE;
- }
-
- if (watch == socket_transport->read_watch &&
- (flags & DBUS_WATCH_READABLE))
- {
- dbus_bool_t auth_finished;
-#if 1
- _dbus_verbose ("handling read watch %p flags = %x\n",
- watch, flags);
-#endif
- if (!do_authentication (transport, TRUE, FALSE, &auth_finished))
- return FALSE;
-
- /* We don't want to do a read immediately following
- * a successful authentication. This is so we
- * have a chance to propagate the authentication
- * state further up. Specifically, we need to
- * process any pending data from the auth object.
- */
- if (!auth_finished)
- {
- if (!do_reading (transport))
- {
- _dbus_verbose ("no memory to read\n");
- return FALSE;
- }
- }
- else
- {
- _dbus_verbose ("Not reading anything since we just completed the authentication\n");
- }
- }
- else if (watch == socket_transport->write_watch &&
- (flags & DBUS_WATCH_WRITABLE))
- {
-#if 1
- _dbus_verbose ("handling write watch, have_outgoing_messages = %d\n",
- _dbus_connection_has_messages_to_send_unlocked (transport->connection));
-#endif
- if (!do_authentication (transport, FALSE, TRUE, NULL))
- return FALSE;
-
- if (!do_writing (transport))
- {
- _dbus_verbose ("no memory to write\n");
- return FALSE;
- }
-
- /* See if we still need the write watch */
- check_write_watch (transport);
- }
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- else
- {
- if (watch == socket_transport->read_watch)
- _dbus_verbose ("asked to handle read watch with non-read condition 0x%x\n",
- flags);
- else if (watch == socket_transport->write_watch)
- _dbus_verbose ("asked to handle write watch with non-write condition 0x%x\n",
- flags);
- else
- _dbus_verbose ("asked to handle watch %p on fd %d that we don't recognize\n",
- watch, dbus_watch_get_socket (watch));
- }
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
- return TRUE;
-}
-
-static void
-socket_disconnect (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- _dbus_verbose ("\n");
-
- free_watches (transport);
-
- _dbus_close_socket (socket_transport->fd, NULL);
- socket_transport->fd = -1;
-}
-
-static dbus_bool_t
-socket_connection_set (DBusTransport *transport)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- _dbus_watch_set_handler (socket_transport->write_watch,
- _dbus_connection_handle_watch,
- transport->connection, NULL);
-
- _dbus_watch_set_handler (socket_transport->read_watch,
- _dbus_connection_handle_watch,
- transport->connection, NULL);
-
- if (!_dbus_connection_add_watch_unlocked (transport->connection,
- socket_transport->write_watch))
- return FALSE;
-
- if (!_dbus_connection_add_watch_unlocked (transport->connection,
- socket_transport->read_watch))
- {
- _dbus_connection_remove_watch_unlocked (transport->connection,
- socket_transport->write_watch);
- return FALSE;
- }
-
- check_read_watch (transport);
- check_write_watch (transport);
-
- return TRUE;
-}
-
-/**
- * @todo We need to have a way to wake up the select sleep if
- * a new iteration request comes in with a flag (read/write) that
- * we're not currently serving. Otherwise a call that just reads
- * could block a write call forever (if there are no incoming
- * messages).
- */
-static void
-socket_do_iteration (DBusTransport *transport,
- unsigned int flags,
- int timeout_milliseconds)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
- DBusPollFD poll_fd;
- int poll_res;
- int poll_timeout;
-
- _dbus_verbose (" iteration flags = %s%s timeout = %d read_watch = %p write_watch = %p fd = %d\n",
- flags & DBUS_ITERATION_DO_READING ? "read" : "",
- flags & DBUS_ITERATION_DO_WRITING ? "write" : "",
- timeout_milliseconds,
- socket_transport->read_watch,
- socket_transport->write_watch,
- socket_transport->fd);
-
- /* the passed in DO_READING/DO_WRITING flags indicate whether to
- * read/write messages, but regardless of those we may need to block
- * for reading/writing to do auth. But if we do reading for auth,
- * we don't want to read any messages yet if not given DO_READING.
- */
-
- poll_fd.fd = socket_transport->fd;
- poll_fd.events = 0;
-
- if (_dbus_transport_try_to_authenticate (transport))
- {
- /* This is kind of a hack; if we have stuff to write, then try
- * to avoid the poll. This is probably about a 5% speedup on an
- * echo client/server.
- *
- * If both reading and writing were requested, we want to avoid this
- * since it could have funky effects:
- * - both ends spinning waiting for the other one to read
- * data so they can finish writing
- * - prioritizing all writing ahead of reading
- */
- if ((flags & DBUS_ITERATION_DO_WRITING) &&
- !(flags & (DBUS_ITERATION_DO_READING | DBUS_ITERATION_BLOCK)) &&
- !transport->disconnected &&
- _dbus_connection_has_messages_to_send_unlocked (transport->connection))
- {
- do_writing (transport);
-
- if (transport->disconnected ||
- !_dbus_connection_has_messages_to_send_unlocked (transport->connection))
- goto out;
- }
-
- /* If we get here, we decided to do the poll() after all */
- _dbus_assert (socket_transport->read_watch);
- if (flags & DBUS_ITERATION_DO_READING)
- poll_fd.events |= _DBUS_POLLIN;
-
- _dbus_assert (socket_transport->write_watch);
- if (flags & DBUS_ITERATION_DO_WRITING)
- poll_fd.events |= _DBUS_POLLOUT;
- }
- else
- {
- DBusAuthState auth_state;
-
- auth_state = _dbus_auth_do_work (transport->auth);
-
- if (transport->receive_credentials_pending ||
- auth_state == DBUS_AUTH_STATE_WAITING_FOR_INPUT)
- poll_fd.events |= _DBUS_POLLIN;
-
- if (transport->send_credentials_pending ||
- auth_state == DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND)
- poll_fd.events |= _DBUS_POLLOUT;
- }
-
- if (poll_fd.events)
- {
- if (flags & DBUS_ITERATION_BLOCK)
- poll_timeout = timeout_milliseconds;
- else
- poll_timeout = 0;
-
- /* For blocking selects we drop the connection lock here
- * to avoid blocking out connection access during a potentially
- * indefinite blocking call. The io path is still protected
- * by the io_path_cond condvar, so we won't reenter this.
- */
- if (flags & DBUS_ITERATION_BLOCK)
- {
- _dbus_verbose ("unlock pre poll\n");
- _dbus_connection_unlock (transport->connection);
- }
-
- again:
- poll_res = _dbus_poll (&poll_fd, 1, poll_timeout);
-
- if (poll_res < 0 && _dbus_get_is_errno_eintr ())
- goto again;
-
- if (flags & DBUS_ITERATION_BLOCK)
- {
- _dbus_verbose ("lock post poll\n");
- _dbus_connection_lock (transport->connection);
- }
-
- if (poll_res >= 0)
- {
- if (poll_res == 0)
- poll_fd.revents = 0; /* some concern that posix does not guarantee this;
- * valgrind flags it as an error. though it probably
- * is guaranteed on linux at least.
- */
-
- if (poll_fd.revents & _DBUS_POLLERR)
- do_io_error (transport);
- else
- {
- dbus_bool_t need_read = (poll_fd.revents & _DBUS_POLLIN) > 0;
- dbus_bool_t need_write = (poll_fd.revents & _DBUS_POLLOUT) > 0;
- dbus_bool_t authentication_completed;
-
- _dbus_verbose ("in iteration, need_read=%d need_write=%d\n",
- need_read, need_write);
- do_authentication (transport, need_read, need_write,
- &authentication_completed);
-
- /* See comment in socket_handle_watch. */
- if (authentication_completed)
- goto out;
-
- if (need_read && (flags & DBUS_ITERATION_DO_READING))
- do_reading (transport);
- if (need_write && (flags & DBUS_ITERATION_DO_WRITING))
- do_writing (transport);
- }
- }
- else
- {
- _dbus_verbose ("Error from _dbus_poll(): %s\n",
- _dbus_strerror_from_errno ());
- }
- }
-
-
- out:
- /* We need to install the write watch only if we did not
- * successfully write everything. Note we need to be careful that we
- * don't call check_write_watch *before* do_writing, since it's
- * inefficient to add the write watch, and we can avoid it most of
- * the time since we can write immediately.
- *
- * However, we MUST always call check_write_watch(); DBusConnection code
- * relies on the fact that running an iteration will notice that
- * messages are pending.
- */
- check_write_watch (transport);
-
- _dbus_verbose (" ... leaving do_iteration()\n");
-}
-
-static void
-socket_live_messages_changed (DBusTransport *transport)
-{
- /* See if we should look for incoming messages again */
- check_read_watch (transport);
-}
-
-
-static dbus_bool_t
-socket_get_socket_fd (DBusTransport *transport,
- int *fd_p)
-{
- DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
-
- *fd_p = socket_transport->fd;
-
- return TRUE;
-}
-
-static const DBusTransportVTable socket_vtable = {
- socket_finalize,
- socket_handle_watch,
- socket_disconnect,
- socket_connection_set,
- socket_do_iteration,
- socket_live_messages_changed,
- socket_get_socket_fd
-};
-
-/**
- * Creates a new transport for the given socket file descriptor. The file
- * descriptor must be nonblocking (use _dbus_set_fd_nonblocking() to
- * make it so). This function is shared by various transports that
- * boil down to a full duplex file descriptor.
- *
- * @param fd the file descriptor.
- * @param server_guid non-#NULL if this transport is on the server side of a connection
- * @param address the transport's address
- * @returns the new transport, or #NULL if no memory.
- */
-DBusTransport*
-_dbus_transport_new_for_socket (int fd,
- const DBusString *server_guid,
- const DBusString *address)
-{
- DBusTransportSocket *socket_transport;
-
- socket_transport = dbus_new0 (DBusTransportSocket, 1);
- if (socket_transport == NULL)
- return NULL;
-
- if (!_dbus_string_init (&socket_transport->encoded_outgoing))
- goto failed_0;
-
- if (!_dbus_string_init (&socket_transport->encoded_incoming))
- goto failed_1;
-
- socket_transport->write_watch = _dbus_watch_new (fd,
- DBUS_WATCH_WRITABLE,
- FALSE,
- NULL, NULL, NULL);
- if (socket_transport->write_watch == NULL)
- goto failed_2;
-
- socket_transport->read_watch = _dbus_watch_new (fd,
- DBUS_WATCH_READABLE,
- FALSE,
- NULL, NULL, NULL);
- if (socket_transport->read_watch == NULL)
- goto failed_3;
-
- if (!_dbus_transport_init_base (&socket_transport->base,
- &socket_vtable,
- server_guid, address))
- goto failed_4;
-
-#ifdef HAVE_UNIX_FD_PASSING
- _dbus_auth_set_unix_fd_possible(socket_transport->base.auth, _dbus_socket_can_pass_unix_fd(fd));
-#endif
-
- socket_transport->fd = fd;
- socket_transport->message_bytes_written = 0;
-
- /* These values should probably be tunable or something. */
- socket_transport->max_bytes_read_per_iteration = 2048;
- socket_transport->max_bytes_written_per_iteration = 2048;
-
- return (DBusTransport*) socket_transport;
-
- failed_4:
- _dbus_watch_invalidate (socket_transport->read_watch);
- _dbus_watch_unref (socket_transport->read_watch);
- failed_3:
- _dbus_watch_invalidate (socket_transport->write_watch);
- _dbus_watch_unref (socket_transport->write_watch);
- failed_2:
- _dbus_string_free (&socket_transport->encoded_incoming);
- failed_1:
- _dbus_string_free (&socket_transport->encoded_outgoing);
- failed_0:
- dbus_free (socket_transport);
- return NULL;
-}
-
-/**
- * Creates a new transport for the given hostname and port.
- * If host is NULL, it will default to localhost
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param family the address family to connect to
- * @param noncefile path to nonce file
- * @param error location to store reason for failure.
- * @returns a new transport, or #NULL on failure.
- */
-DBusTransport*
-_dbus_transport_new_for_tcp_socket (const char *host,
- const char *port,
- const char *family,
- const char *noncefile,
- DBusError *error)
-{
- int fd;
- DBusTransport *transport;
- DBusString address;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (host == NULL)
- host = "localhost";
-
- if (!_dbus_string_append (&address, noncefile ? "nonce-tcp:" : "tcp:"))
- goto error;
-
- if (!_dbus_string_append (&address, "host=") ||
- !_dbus_string_append (&address, host))
- goto error;
-
- if (!_dbus_string_append (&address, ",port=") ||
- !_dbus_string_append (&address, port))
- goto error;
-
- if (family != NULL &&
- (!_dbus_string_append (&address, ",family=") ||
- !_dbus_string_append (&address, family)))
- goto error;
-
- if (noncefile != NULL &&
- (!_dbus_string_append (&address, ",noncefile=") ||
- !_dbus_string_append (&address, noncefile)))
- goto error;
-
- fd = _dbus_connect_tcp_socket_with_nonce (host, port, family, noncefile, error);
- if (fd < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_free (&address);
- return NULL;
- }
-
- _dbus_verbose ("Successfully connected to tcp socket %s:%s\n",
- host, port);
-
- transport = _dbus_transport_new_for_socket (fd, NULL, &address);
- _dbus_string_free (&address);
- if (transport == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_close_socket (fd, NULL);
- fd = -1;
- }
-
- return transport;
-
-error:
- _dbus_string_free (&address);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
-}
-
-/**
- * Opens a TCP socket transport.
- *
- * @param entry the address entry to try opening as a tcp transport.
- * @param transport_p return location for the opened transport
- * @param error error to be set
- * @returns result of the attempt
- */
-DBusTransportOpenResult
-_dbus_transport_open_socket(DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error)
-{
- const char *method;
- dbus_bool_t isTcp;
- dbus_bool_t isNonceTcp;
-
- method = dbus_address_entry_get_method (entry);
- _dbus_assert (method != NULL);
-
- isTcp = strcmp (method, "tcp") == 0;
- isNonceTcp = strcmp (method, "nonce-tcp") == 0;
-
- if (isTcp || isNonceTcp)
- {
- const char *host = dbus_address_entry_get_value (entry, "host");
- const char *port = dbus_address_entry_get_value (entry, "port");
- const char *family = dbus_address_entry_get_value (entry, "family");
- const char *noncefile = dbus_address_entry_get_value (entry, "noncefile");
-
- if ((isNonceTcp == TRUE) != (noncefile != NULL)) {
- _dbus_set_bad_address (error, method, "noncefile", NULL);
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- if (port == NULL)
- {
- _dbus_set_bad_address (error, method, "port", NULL);
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- *transport_p = _dbus_transport_new_for_tcp_socket (host, port, family, noncefile, error);
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
- }
-}
-
-/** @} */
-
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.h
deleted file mode 100644
index 8aefae37c2..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-socket.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-socket.h Socket subclasses of DBusTransport
- *
- * Copyright (C) 2002, 2006 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TRANSPORT_SOCKET_H
-#define DBUS_TRANSPORT_SOCKET_H
-
-#include <dbus/dbus-transport-protected.h>
-
-DBUS_BEGIN_DECLS
-
-DBusTransport* _dbus_transport_new_for_socket (int fd,
- const DBusString *server_guid,
- const DBusString *address);
-DBusTransport* _dbus_transport_new_for_tcp_socket (const char *host,
- const char *port,
- const char *family,
- const char *noncefile,
- DBusError *error);
-DBusTransportOpenResult _dbus_transport_open_socket (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error);
-
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TRANSPORT_SOCKET_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.c
deleted file mode 100644
index 9a9fea5054..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-unix.c UNIX socket subclasses of DBusTransport
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include "dbus-internals.h"
-#include "dbus-connection-internal.h"
-#include "dbus-transport-unix.h"
-#include "dbus-transport-socket.h"
-#include "dbus-transport-protected.h"
-#include "dbus-watch.h"
-#include "dbus-sysdeps-unix.h"
-#include "dbus-test.h"
-
-/**
- * @defgroup DBusTransportUnix DBusTransport implementations for UNIX
- * @ingroup DBusInternals
- * @brief Implementation details of DBusTransport on UNIX
- *
- * @{
- */
-
-/**
- * Creates a new transport for the given Unix domain socket
- * path. This creates a client-side of a transport.
- *
- * @todo once we add a way to escape paths in a dbus
- * address, this function needs to do escaping.
- *
- * @param path the path to the domain socket.
- * @param abstract #TRUE to use abstract socket namespace
- * @param error address where an error can be returned.
- * @returns a new transport, or #NULL on failure.
- */
-DBusTransport*
-_dbus_transport_new_for_domain_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error)
-{
- int fd;
- DBusTransport *transport;
- DBusString address;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- fd = -1;
-
- if ((abstract &&
- !_dbus_string_append (&address, "unix:abstract=")) ||
- (!abstract &&
- !_dbus_string_append (&address, "unix:path=")) ||
- !_dbus_string_append (&address, path))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_0;
- }
-
- fd = _dbus_connect_unix_socket (path, abstract, error);
- if (fd < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed_0;
- }
-
- _dbus_verbose ("Successfully connected to unix socket %s\n",
- path);
-
- transport = _dbus_transport_new_for_socket (fd, NULL, &address);
- if (transport == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_1;
- }
-
- _dbus_string_free (&address);
-
- return transport;
-
- failed_1:
- _dbus_close_socket (fd, NULL);
- failed_0:
- _dbus_string_free (&address);
- return NULL;
-}
-
-/**
- * Creates a new transport for the given binary and arguments. This
- * creates a client-side of a transport. The process will be forked
- * off and executed with stdin/stdout connected to a local AF_UNIX
- * socket.
- *
- * @param path the path to the domain socket.
- * @param argv Parameters list
- * @param error address where an error can be returned.
- * @returns a new transport, or #NULL on failure.
- */
-static DBusTransport*
-_dbus_transport_new_for_exec (const char *path,
- char *const argv[],
- DBusError *error)
-{
- int fd;
- DBusTransport *transport;
- DBusString address;
- unsigned i;
- char *escaped;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- fd = -1;
-
- escaped = dbus_address_escape_value (path);
- if (!escaped)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- if (!_dbus_string_append (&address, "unixexec:path=") ||
- !_dbus_string_append (&address, escaped))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- dbus_free (escaped);
- goto failed;
- }
-
- dbus_free (escaped);
-
- if (argv)
- {
- for (i = 0; argv[i]; i++)
- {
- dbus_bool_t success;
-
- escaped = dbus_address_escape_value (argv[i]);
- if (!escaped)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- success = _dbus_string_append_printf (&address, ",argv%u=%s", i, escaped);
- dbus_free (escaped);
-
- if (!success)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
- }
- }
-
- fd = _dbus_connect_exec (path, argv, error);
- if (fd < 0)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto failed;
- }
-
- _dbus_verbose ("Successfully connected to process %s\n",
- path);
-
- transport = _dbus_transport_new_for_socket (fd, NULL, &address);
- if (transport == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed;
- }
-
- _dbus_string_free (&address);
-
- return transport;
-
- failed:
- if (fd >= 0)
- _dbus_close_socket (fd, NULL);
-
- _dbus_string_free (&address);
- return NULL;
-}
-
-/**
- * Opens platform specific transport types.
- *
- * @param entry the address entry to try opening
- * @param transport_p return location for the opened transport
- * @param error error to be set
- * @returns result of the attempt
- */
-DBusTransportOpenResult
-_dbus_transport_open_platform_specific (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error)
-{
- const char *method;
-
- method = dbus_address_entry_get_method (entry);
- _dbus_assert (method != NULL);
-
- if (strcmp (method, "unix") == 0)
- {
- const char *path = dbus_address_entry_get_value (entry, "path");
- const char *tmpdir = dbus_address_entry_get_value (entry, "tmpdir");
- const char *abstract = dbus_address_entry_get_value (entry, "abstract");
-
- if (tmpdir != NULL)
- {
- _dbus_set_bad_address (error, NULL, NULL,
- "cannot use the \"tmpdir\" option for an address to connect to, only in an address to listen on");
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- if (path == NULL && abstract == NULL)
- {
- _dbus_set_bad_address (error, "unix",
- "path or abstract",
- NULL);
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- if (path != NULL && abstract != NULL)
- {
- _dbus_set_bad_address (error, NULL, NULL,
- "can't specify both \"path\" and \"abstract\" options in an address");
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- if (path)
- *transport_p = _dbus_transport_new_for_domain_socket (path, FALSE,
- error);
- else
- *transport_p = _dbus_transport_new_for_domain_socket (abstract, TRUE,
- error);
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
- else if (strcmp (method, "unixexec") == 0)
- {
- const char *path;
- unsigned i;
- char **argv;
-
- path = dbus_address_entry_get_value (entry, "path");
- if (path == NULL)
- {
- _dbus_set_bad_address (error, NULL, NULL,
- "No process path specified");
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- /* First count argv arguments */
- for (i = 1; ; i++)
- {
- char t[4+20+1]; /* "argv" plus space for a formatted base 10 64bit integer, plus NUL */
-
- snprintf (t, sizeof(t), "argv%u", i);
-
- if (!dbus_address_entry_get_value (entry, t))
- break;
- }
-
- /* Allocate string array */
- argv = dbus_new0 (char*, i+1);
- if (!argv)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
-
- /* Fill in string array */
- for (i = 0; ; i++)
- {
- char t[4+20+1];
- const char *p;
-
- snprintf (t, sizeof(t), "argv%u", i);
-
- p = dbus_address_entry_get_value (entry, t);
- if (!p)
- {
- if (i == 0)
- /* If argv0 isn't specified, fill in the path instead */
- p = path;
- else
- break;
- }
-
- argv[i] = _dbus_strdup (p);
- if (!argv[i])
- {
- dbus_free_string_array (argv);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- }
-
- *transport_p = _dbus_transport_new_for_exec (path, argv, error);
- dbus_free_string_array (argv);
-
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
-#ifdef DBUS_ENABLE_LAUNCHD
- else if (strcmp (method, "launchd") == 0)
- {
- DBusError tmp_error = DBUS_ERROR_INIT;
- const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
- const char *launchd_socket;
- DBusString socket_path;
- dbus_bool_t valid_socket;
-
- if (!_dbus_string_init (&socket_path))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (launchd_env_var == NULL)
- {
- _dbus_set_bad_address (error, "launchd", "env", NULL);
- return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
- }
-
- valid_socket = _dbus_lookup_launchd_socket (&socket_path, launchd_env_var, error);
-
- if (dbus_error_is_set(error))
- {
- _dbus_string_free(&socket_path);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
-
- if (!valid_socket)
- {
- dbus_set_error(&tmp_error, DBUS_ERROR_BAD_ADDRESS,
- "launchd's env var %s does not exist", launchd_env_var);
- dbus_error_free(error);
- dbus_move_error(&tmp_error, error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
-
- launchd_socket = _dbus_string_get_const_data(&socket_path);
- *transport_p = _dbus_transport_new_for_domain_socket (launchd_socket, FALSE, error);
-
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
-#endif
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
- }
-}
-
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-
-dbus_bool_t
-_dbus_transport_unix_test (void)
-{
- DBusConnection *c;
- DBusError error;
- dbus_bool_t ret;
- const char *address;
-
- dbus_error_init (&error);
-
- c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);
- _dbus_assert (c != NULL);
- _dbus_assert (!dbus_error_is_set (&error));
-
- address = _dbus_connection_get_address (c);
- _dbus_assert (address != NULL);
-
- /* Let's see if the address got parsed, reordered and formatted correctly */
- ret = strcmp (address, "unixexec:path=/bin/false,argv0=false,argv1=foobar") == 0;
-
- dbus_connection_unref (c);
-
- return ret;
-}
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.h
deleted file mode 100644
index 783a831355..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-unix.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-unix.h UNIX socket subclasses of DBusTransport
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TRANSPORT_UNIX_H
-#define DBUS_TRANSPORT_UNIX_H
-
-#include <dbus/dbus-transport.h>
-
-DBUS_BEGIN_DECLS
-
-DBusTransport* _dbus_transport_new_for_domain_socket (const char *path,
- dbus_bool_t abstract,
- DBusError *error);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TRANSPORT_UNIX_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.c
deleted file mode 100644
index 8fc15749c8..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-win.c Windows socket subclasses of DBusTransport
- *
- * Copyright (C) 2002, 2003, 2004 Red Hat Inc.
- * Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-connection-internal.h"
-#include "dbus-transport-socket.h"
-#include "dbus-transport-protected.h"
-#include "dbus-watch.h"
-#include "dbus-sysdeps-win.h"
-
-/**
- * @defgroup DBusTransportUnix DBusTransport implementations for UNIX
- * @ingroup DBusInternals
- * @brief Implementation details of DBusTransport on UNIX
- *
- * @{
- */
-
-/**
- * Opens platform specific transport types.
- *
- * @param entry the address entry to try opening
- * @param transport_p return location for the opened transport
- * @param error error to be set
- * @returns result of the attempt
- */
-DBusTransportOpenResult
-_dbus_transport_open_platform_specific (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error)
-{
- /* currently no Windows-specific transports */
- return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.h
deleted file mode 100644
index af997a2783..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport-win.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport-win.h Windows socket subclasses of DBusTransport
- *
- * Copyright (C) 2002 Red Hat Inc.
- * Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TRANSPORT_WIN_H
-#define DBUS_TRANSPORT_WIN_H
-
-#include <dbus/dbus-transport.h>
-
-DBUS_BEGIN_DECLS
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TRANSPORT_WIN_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.c
deleted file mode 100644
index ecc3182765..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.c
+++ /dev/null
@@ -1,1537 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport.c DBusTransport object (internal to D-Bus implementation)
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-transport-protected.h"
-#include "dbus-transport-unix.h"
-#include "dbus-transport-socket.h"
-#include "dbus-connection-internal.h"
-#include "dbus-watch.h"
-#include "dbus-auth.h"
-#include "dbus-address.h"
-#include "dbus-credentials.h"
-#include "dbus-mainloop.h"
-#include "dbus-message.h"
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include "dbus-server-debug-pipe.h"
-#endif
-
-/**
- * @defgroup DBusTransport DBusTransport object
- * @ingroup DBusInternals
- * @brief "Backend" for a DBusConnection.
- *
- * Types and functions related to DBusTransport. A transport is an
- * abstraction that can send and receive data via various kinds of
- * network connections or other IPC mechanisms.
- *
- * @{
- */
-
-/**
- * @typedef DBusTransport
- *
- * Opaque object representing a way message stream.
- * DBusTransport abstracts various kinds of actual
- * transport mechanism, such as different network protocols,
- * or encryption schemes.
- */
-
-static void
-live_messages_notify (DBusCounter *counter,
- void *user_data)
-{
- DBusTransport *transport = user_data;
-
- _dbus_transport_ref (transport);
-
-#if 0
- _dbus_verbose ("Size counter value is now %d\n",
- (int) _dbus_counter_get_size_value (counter));
- _dbus_verbose ("Unix FD counter value is now %d\n",
- (int) _dbus_counter_get_unix_fd_value (counter));
-#endif
-
- /* disable or re-enable the read watch for the transport if
- * required.
- */
- if (transport->vtable->live_messages_changed)
- {
- _dbus_connection_lock (transport->connection);
- (* transport->vtable->live_messages_changed) (transport);
- _dbus_connection_unlock (transport->connection);
- }
-
- _dbus_transport_unref (transport);
-}
-
-/**
- * Initializes the base class members of DBusTransport. Chained up to
- * by subclasses in their constructor. The server GUID is the
- * globally unique ID for the server creating this connection
- * and will be #NULL for the client side of a connection. The GUID
- * is in hex format.
- *
- * @param transport the transport being created.
- * @param vtable the subclass vtable.
- * @param server_guid non-#NULL if this transport is on the server side of a connection
- * @param address the address of the transport
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_transport_init_base (DBusTransport *transport,
- const DBusTransportVTable *vtable,
- const DBusString *server_guid,
- const DBusString *address)
-{
- DBusMessageLoader *loader;
- DBusAuth *auth;
- DBusCounter *counter;
- char *address_copy;
- DBusCredentials *creds;
-
- loader = _dbus_message_loader_new ();
- if (loader == NULL)
- return FALSE;
-
- if (server_guid)
- auth = _dbus_auth_server_new (server_guid);
- else
- auth = _dbus_auth_client_new ();
- if (auth == NULL)
- {
- _dbus_message_loader_unref (loader);
- return FALSE;
- }
-
- counter = _dbus_counter_new ();
- if (counter == NULL)
- {
- _dbus_auth_unref (auth);
- _dbus_message_loader_unref (loader);
- return FALSE;
- }
-
- creds = _dbus_credentials_new ();
- if (creds == NULL)
- {
- _dbus_counter_unref (counter);
- _dbus_auth_unref (auth);
- _dbus_message_loader_unref (loader);
- return FALSE;
- }
-
- if (server_guid)
- {
- _dbus_assert (address == NULL);
- address_copy = NULL;
- }
- else
- {
- _dbus_assert (address != NULL);
-
- if (!_dbus_string_copy_data (address, &address_copy))
- {
- _dbus_credentials_unref (creds);
- _dbus_counter_unref (counter);
- _dbus_auth_unref (auth);
- _dbus_message_loader_unref (loader);
- return FALSE;
- }
- }
-
- transport->refcount = 1;
- transport->vtable = vtable;
- transport->loader = loader;
- transport->auth = auth;
- transport->live_messages = counter;
- transport->authenticated = FALSE;
- transport->disconnected = FALSE;
- transport->is_server = (server_guid != NULL);
- transport->send_credentials_pending = !transport->is_server;
- transport->receive_credentials_pending = transport->is_server;
- transport->address = address_copy;
-
- transport->unix_user_function = NULL;
- transport->unix_user_data = NULL;
- transport->free_unix_user_data = NULL;
-
- transport->windows_user_function = NULL;
- transport->windows_user_data = NULL;
- transport->free_windows_user_data = NULL;
-
- transport->expected_guid = NULL;
-
- /* Try to default to something that won't totally hose the system,
- * but doesn't impose too much of a limitation.
- */
- transport->max_live_messages_size = _DBUS_ONE_MEGABYTE * 63;
-
- /* On Linux RLIMIT_NOFILE defaults to 1024, so allowing 4096 fds live
- should be more than enough */
- transport->max_live_messages_unix_fds = 4096;
-
- /* credentials read from socket if any */
- transport->credentials = creds;
-
- _dbus_counter_set_notify (transport->live_messages,
- transport->max_live_messages_size,
- transport->max_live_messages_unix_fds,
- live_messages_notify,
- transport);
-
- if (transport->address)
- _dbus_verbose ("Initialized transport on address %s\n", transport->address);
-
- return TRUE;
-}
-
-/**
- * Finalizes base class members of DBusTransport.
- * Chained up to from subclass finalizers.
- *
- * @param transport the transport.
- */
-void
-_dbus_transport_finalize_base (DBusTransport *transport)
-{
- if (!transport->disconnected)
- _dbus_transport_disconnect (transport);
-
- if (transport->free_unix_user_data != NULL)
- (* transport->free_unix_user_data) (transport->unix_user_data);
-
- if (transport->free_windows_user_data != NULL)
- (* transport->free_windows_user_data) (transport->windows_user_data);
-
- _dbus_message_loader_unref (transport->loader);
- _dbus_auth_unref (transport->auth);
- _dbus_counter_set_notify (transport->live_messages,
- 0, 0, NULL, NULL);
- _dbus_counter_unref (transport->live_messages);
- dbus_free (transport->address);
- dbus_free (transport->expected_guid);
- if (transport->credentials)
- _dbus_credentials_unref (transport->credentials);
-}
-
-
-/**
- * Verifies if a given D-Bus address is a valid address
- * by attempting to connect to it. If it is, returns the
- * opened DBusTransport object. If it isn't, returns #NULL
- * and sets @p error.
- *
- * @param address the address to be checked.
- * @param error address where an error can be returned.
- * @returns a new transport, or #NULL on failure.
- */
-static DBusTransport*
-check_address (const char *address, DBusError *error)
-{
- DBusAddressEntry **entries;
- DBusTransport *transport = NULL;
- int len, i;
-
- _dbus_assert (address != NULL);
-
- if (!dbus_parse_address (address, &entries, &len, error))
- return NULL; /* not a valid address */
-
- for (i = 0; i < len; i++)
- {
- transport = _dbus_transport_open (entries[i], error);
- if (transport != NULL)
- break;
- }
-
- dbus_address_entries_free (entries);
- return transport;
-}
-
-/**
- * Creates a new transport for the "autostart" method.
- * This creates a client-side of a transport.
- *
- * @param scope scope of autolaunch (Windows only)
- * @param error address where an error can be returned.
- * @returns a new transport, or #NULL on failure.
- */
-static DBusTransport*
-_dbus_transport_new_for_autolaunch (const char *scope, DBusError *error)
-{
- DBusString address;
- DBusTransport *result = NULL;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_init (&address))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (!_dbus_get_autolaunch_address (scope, &address, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- goto out;
- }
-
- result = check_address (_dbus_string_get_const_data (&address), error);
- if (result == NULL)
- _DBUS_ASSERT_ERROR_IS_SET (error);
- else
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- out:
- _dbus_string_free (&address);
- return result;
-}
-
-static DBusTransportOpenResult
-_dbus_transport_open_autolaunch (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error)
-{
- const char *method;
-
- method = dbus_address_entry_get_method (entry);
- _dbus_assert (method != NULL);
-
- if (strcmp (method, "autolaunch") == 0)
- {
- const char *scope = dbus_address_entry_get_value (entry, "scope");
-
- *transport_p = _dbus_transport_new_for_autolaunch (scope, error);
-
- if (*transport_p == NULL)
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
- }
-}
-
-static const struct {
- DBusTransportOpenResult (* func) (DBusAddressEntry *entry,
- DBusTransport **transport_p,
- DBusError *error);
-} open_funcs[] = {
- { _dbus_transport_open_socket },
- { _dbus_transport_open_platform_specific },
- { _dbus_transport_open_autolaunch }
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- , { _dbus_transport_open_debug_pipe }
-#endif
-};
-
-/**
- * Try to open a new transport for the given address entry. (This
- * opens a client-side-of-the-connection transport.)
- *
- * @param entry the address entry
- * @param error location to store reason for failure.
- * @returns new transport of #NULL on failure.
- */
-DBusTransport*
-_dbus_transport_open (DBusAddressEntry *entry,
- DBusError *error)
-{
- DBusTransport *transport;
- const char *expected_guid_orig;
- char *expected_guid;
- int i;
- DBusError tmp_error = DBUS_ERROR_INIT;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- transport = NULL;
- expected_guid_orig = dbus_address_entry_get_value (entry, "guid");
- expected_guid = _dbus_strdup (expected_guid_orig);
-
- if (expected_guid_orig != NULL && expected_guid == NULL)
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- for (i = 0; i < (int) _DBUS_N_ELEMENTS (open_funcs); ++i)
- {
- DBusTransportOpenResult result;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
- result = (* open_funcs[i].func) (entry, &transport, &tmp_error);
-
- switch (result)
- {
- case DBUS_TRANSPORT_OPEN_OK:
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
- goto out;
- break;
- case DBUS_TRANSPORT_OPEN_NOT_HANDLED:
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
- /* keep going through the loop of open funcs */
- break;
- case DBUS_TRANSPORT_OPEN_BAD_ADDRESS:
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- goto out;
- break;
- case DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT:
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- goto out;
- break;
- }
- }
-
- out:
-
- if (transport == NULL)
- {
- if (!dbus_error_is_set (&tmp_error))
- _dbus_set_bad_address (&tmp_error,
- NULL, NULL,
- "Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")");
-
- _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
- dbus_move_error(&tmp_error, error);
- dbus_free (expected_guid);
- }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
-
- /* In the case of autostart the initial guid is NULL
- * and the autostart transport recursively calls
- * _dbus_open_transport wich returns a transport
- * with a guid. That guid is the definitive one.
- *
- * FIXME: if more transports are added they may have
- * an effect on the expected_guid semantics (i.e.
- * expected_guid and transport->expected_guid may
- * both have values). This is very unlikely though
- * we should either throw asserts here for those
- * corner cases or refactor the code so it is
- * clearer on what is expected and what is not
- */
- if(expected_guid)
- transport->expected_guid = expected_guid;
- }
-
- return transport;
-}
-
-/**
- * Increments the reference count for the transport.
- *
- * @param transport the transport.
- * @returns the transport.
- */
-DBusTransport *
-_dbus_transport_ref (DBusTransport *transport)
-{
- _dbus_assert (transport->refcount > 0);
-
- transport->refcount += 1;
-
- return transport;
-}
-
-/**
- * Decrements the reference count for the transport.
- * Disconnects and finalizes the transport if
- * the reference count reaches zero.
- *
- * @param transport the transport.
- */
-void
-_dbus_transport_unref (DBusTransport *transport)
-{
- _dbus_assert (transport != NULL);
- _dbus_assert (transport->refcount > 0);
-
- transport->refcount -= 1;
- if (transport->refcount == 0)
- {
- _dbus_verbose ("finalizing\n");
-
- _dbus_assert (transport->vtable->finalize != NULL);
-
- (* transport->vtable->finalize) (transport);
- }
-}
-
-/**
- * Closes our end of the connection to a remote application. Further
- * attempts to use this transport will fail. Only the first call to
- * _dbus_transport_disconnect() will have an effect.
- *
- * @param transport the transport.
- *
- */
-void
-_dbus_transport_disconnect (DBusTransport *transport)
-{
- _dbus_verbose ("start\n");
-
- _dbus_assert (transport->vtable->disconnect != NULL);
-
- if (transport->disconnected)
- return;
-
- (* transport->vtable->disconnect) (transport);
-
- transport->disconnected = TRUE;
-
- _dbus_verbose ("end\n");
-}
-
-/**
- * Returns #TRUE if the transport has not been disconnected.
- * Disconnection can result from _dbus_transport_disconnect()
- * or because the server drops its end of the connection.
- *
- * @param transport the transport.
- * @returns whether we're connected
- */
-dbus_bool_t
-_dbus_transport_get_is_connected (DBusTransport *transport)
-{
- return !transport->disconnected;
-}
-
-static dbus_bool_t
-auth_via_unix_user_function (DBusTransport *transport)
-{
- DBusCredentials *auth_identity;
- dbus_bool_t allow;
- DBusConnection *connection;
- DBusAllowUnixUserFunction unix_user_function;
- void *unix_user_data;
- dbus_uid_t uid;
-
- /* Dropping the lock here probably isn't that safe. */
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
- _dbus_assert (auth_identity != NULL);
-
- connection = transport->connection;
- unix_user_function = transport->unix_user_function;
- unix_user_data = transport->unix_user_data;
- uid = _dbus_credentials_get_unix_uid (auth_identity);
-
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (connection);
-
- allow = (* unix_user_function) (connection,
- uid,
- unix_user_data);
-
- _dbus_verbose ("lock post unix user function\n");
- _dbus_connection_lock (connection);
-
- if (allow)
- {
- _dbus_verbose ("Client UID "DBUS_UID_FORMAT" authorized\n", uid);
- }
- else
- {
- _dbus_verbose ("Client UID "DBUS_UID_FORMAT
- " was rejected, disconnecting\n",
- _dbus_credentials_get_unix_uid (auth_identity));
- _dbus_transport_disconnect (transport);
- }
-
- return allow;
-}
-
-static dbus_bool_t
-auth_via_windows_user_function (DBusTransport *transport)
-{
- DBusCredentials *auth_identity;
- dbus_bool_t allow;
- DBusConnection *connection;
- DBusAllowWindowsUserFunction windows_user_function;
- void *windows_user_data;
- char *windows_sid;
-
- /* Dropping the lock here probably isn't that safe. */
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
- _dbus_assert (auth_identity != NULL);
-
- connection = transport->connection;
- windows_user_function = transport->windows_user_function;
- windows_user_data = transport->unix_user_data;
- windows_sid = _dbus_strdup (_dbus_credentials_get_windows_sid (auth_identity));
-
- if (windows_sid == NULL)
- {
- /* OOM */
- return FALSE;
- }
-
- _dbus_verbose ("unlock\n");
- _dbus_connection_unlock (connection);
-
- allow = (* windows_user_function) (connection,
- windows_sid,
- windows_user_data);
-
- _dbus_verbose ("lock post windows user function\n");
- _dbus_connection_lock (connection);
-
- if (allow)
- {
- _dbus_verbose ("Client SID '%s' authorized\n", windows_sid);
- }
- else
- {
- _dbus_verbose ("Client SID '%s' was rejected, disconnecting\n",
- _dbus_credentials_get_windows_sid (auth_identity));
- _dbus_transport_disconnect (transport);
- }
-
- return allow;
-}
-
-static dbus_bool_t
-auth_via_default_rules (DBusTransport *transport)
-{
- DBusCredentials *auth_identity;
- DBusCredentials *our_identity;
- dbus_bool_t allow;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
- _dbus_assert (auth_identity != NULL);
-
- /* By default, connection is allowed if the client is 1) root or 2)
- * has the same UID as us or 3) anonymous is allowed.
- */
-
- our_identity = _dbus_credentials_new_from_current_process ();
- if (our_identity == NULL)
- {
- /* OOM */
- return FALSE;
- }
-
- if (transport->allow_anonymous ||
- _dbus_credentials_get_unix_uid (auth_identity) == 0 ||
- _dbus_credentials_same_user (our_identity,
- auth_identity))
- {
- if (_dbus_credentials_include(our_identity,DBUS_CREDENTIAL_WINDOWS_SID))
- _dbus_verbose ("Client authorized as SID '%s'"
- "matching our SID '%s'\n",
- _dbus_credentials_get_windows_sid(auth_identity),
- _dbus_credentials_get_windows_sid(our_identity));
- else
- _dbus_verbose ("Client authorized as UID "DBUS_UID_FORMAT
- " matching our UID "DBUS_UID_FORMAT"\n",
- _dbus_credentials_get_unix_uid(auth_identity),
- _dbus_credentials_get_unix_uid(our_identity));
- /* We have authenticated! */
- allow = TRUE;
- }
- else
- {
- if (_dbus_credentials_include(our_identity,DBUS_CREDENTIAL_WINDOWS_SID))
- _dbus_verbose ("Client authorized as SID '%s'"
- " but our SID is '%s', disconnecting\n",
- (_dbus_credentials_get_windows_sid(auth_identity) ?
- _dbus_credentials_get_windows_sid(auth_identity) : "<null>"),
- (_dbus_credentials_get_windows_sid(our_identity) ?
- _dbus_credentials_get_windows_sid(our_identity) : "<null>"));
- else
- _dbus_verbose ("Client authorized as UID "DBUS_UID_FORMAT
- " but our UID is "DBUS_UID_FORMAT", disconnecting\n",
- _dbus_credentials_get_unix_uid(auth_identity),
- _dbus_credentials_get_unix_uid(our_identity));
- _dbus_transport_disconnect (transport);
- allow = FALSE;
- }
-
- _dbus_credentials_unref (our_identity);
-
- return allow;
-}
-
-/**
- * Returns #TRUE if we have been authenticated. It will return #TRUE even if
- * the transport is now disconnected, but was ever authenticated before
- * disconnecting.
- *
- * This replaces the older _dbus_transport_get_is_authenticated() which
- * had side-effects.
- *
- * @param transport the transport
- * @returns whether we're authenticated
- */
-dbus_bool_t
-_dbus_transport_peek_is_authenticated (DBusTransport *transport)
-{
- return transport->authenticated;
-}
-
-/**
- * Returns #TRUE if we have been authenticated. It will return #TRUE even if
- * the transport is now disconnected, but was ever authenticated before
- * disconnecting.
- *
- * If we have not finished authenticating, but we have enough buffered input
- * to finish the job, then this function will do so before it returns.
- *
- * This used to be called _dbus_transport_get_is_authenticated(), but that
- * name seems inappropriate for a function with side-effects.
- *
- * @todo we drop connection->mutex when calling the unix_user_function,
- * and windows_user_function, which may not be safe really.
- *
- * @param transport the transport
- * @returns whether we're authenticated
- */
-dbus_bool_t
-_dbus_transport_try_to_authenticate (DBusTransport *transport)
-{
- if (transport->authenticated)
- return TRUE;
- else
- {
- dbus_bool_t maybe_authenticated;
-
- if (transport->disconnected)
- return FALSE;
-
- /* paranoia ref since we call user callbacks sometimes */
- _dbus_connection_ref_unlocked (transport->connection);
-
- maybe_authenticated =
- (!(transport->send_credentials_pending ||
- transport->receive_credentials_pending));
-
- if (maybe_authenticated)
- {
- switch (_dbus_auth_do_work (transport->auth))
- {
- case DBUS_AUTH_STATE_AUTHENTICATED:
- /* leave as maybe_authenticated */
- break;
- default:
- maybe_authenticated = FALSE;
- }
- }
-
- /* If we're the client, verify the GUID
- */
- if (maybe_authenticated && !transport->is_server)
- {
- const char *server_guid;
-
- server_guid = _dbus_auth_get_guid_from_server (transport->auth);
- _dbus_assert (server_guid != NULL);
-
- if (transport->expected_guid &&
- strcmp (transport->expected_guid, server_guid) != 0)
- {
- _dbus_verbose ("Client expected GUID '%s' and we got '%s' from the server\n",
- transport->expected_guid, server_guid);
- _dbus_transport_disconnect (transport);
- _dbus_connection_unref_unlocked (transport->connection);
- return FALSE;
- }
- }
-
- /* If we're the server, see if we want to allow this identity to proceed.
- */
- if (maybe_authenticated && transport->is_server)
- {
- dbus_bool_t allow;
- DBusCredentials *auth_identity;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
- _dbus_assert (auth_identity != NULL);
-
- /* If we have an auth'd user and a user function, delegate
- * deciding whether auth credentials are good enough to the
- * app; otherwise, use our default decision process.
- */
- if (transport->unix_user_function != NULL &&
- _dbus_credentials_include (auth_identity, DBUS_CREDENTIAL_UNIX_USER_ID))
- {
- allow = auth_via_unix_user_function (transport);
- }
- else if (transport->windows_user_function != NULL &&
- _dbus_credentials_include (auth_identity, DBUS_CREDENTIAL_WINDOWS_SID))
- {
- allow = auth_via_windows_user_function (transport);
- }
- else
- {
- allow = auth_via_default_rules (transport);
- }
-
- if (!allow)
- maybe_authenticated = FALSE;
- }
-
- transport->authenticated = maybe_authenticated;
-
- _dbus_connection_unref_unlocked (transport->connection);
- return maybe_authenticated;
- }
-}
-
-/**
- * See dbus_connection_get_is_anonymous().
- *
- * @param transport the transport
- * @returns #TRUE if not authenticated or authenticated as anonymous
- */
-dbus_bool_t
-_dbus_transport_get_is_anonymous (DBusTransport *transport)
-{
- DBusCredentials *auth_identity;
-
- if (!transport->authenticated)
- return TRUE;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
-
- if (_dbus_credentials_are_anonymous (auth_identity))
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Returns TRUE if the transport supports sending unix fds.
- *
- * @param transport the transport
- * @returns #TRUE if TRUE it is possible to send unix fds across the transport.
- */
-dbus_bool_t
-_dbus_transport_can_pass_unix_fd(DBusTransport *transport)
-{
- return DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport);
-}
-
-/**
- * Gets the address of a transport. It will be
- * #NULL for a server-side transport.
- *
- * @param transport the transport
- * @returns transport's address
- */
-const char*
-_dbus_transport_get_address (DBusTransport *transport)
-{
- return transport->address;
-}
-
-/**
- * Gets the id of the server we are connected to (see
- * dbus_server_get_id()). Only works on client side.
- *
- * @param transport the transport
- * @returns transport's server's id or #NULL if we are the server side
- */
-const char*
-_dbus_transport_get_server_id (DBusTransport *transport)
-{
- if (transport->is_server)
- return NULL;
- else if (transport->authenticated)
- return _dbus_auth_get_guid_from_server (transport->auth);
- else
- return transport->expected_guid;
-}
-
-/**
- * Handles a watch by reading data, writing data, or disconnecting
- * the transport, as appropriate for the given condition.
- *
- * @param transport the transport.
- * @param watch the watch.
- * @param condition the current state of the watched file descriptor.
- * @returns #FALSE if not enough memory to fully handle the watch
- */
-dbus_bool_t
-_dbus_transport_handle_watch (DBusTransport *transport,
- DBusWatch *watch,
- unsigned int condition)
-{
- dbus_bool_t retval;
-
- _dbus_assert (transport->vtable->handle_watch != NULL);
-
- if (transport->disconnected)
- return TRUE;
-
- if (dbus_watch_get_socket (watch) < 0)
- {
- _dbus_warn_check_failed ("Tried to handle an invalidated watch; this watch should have been removed\n");
- return TRUE;
- }
-
- _dbus_watch_sanitize_condition (watch, &condition);
-
- _dbus_transport_ref (transport);
- _dbus_watch_ref (watch);
- retval = (* transport->vtable->handle_watch) (transport, watch, condition);
- _dbus_watch_unref (watch);
- _dbus_transport_unref (transport);
-
- return retval;
-}
-
-/**
- * Sets the connection using this transport. Allows the transport
- * to add watches to the connection, queue incoming messages,
- * and pull outgoing messages.
- *
- * @param transport the transport.
- * @param connection the connection.
- * @returns #FALSE if not enough memory
- */
-dbus_bool_t
-_dbus_transport_set_connection (DBusTransport *transport,
- DBusConnection *connection)
-{
- _dbus_assert (transport->vtable->connection_set != NULL);
- _dbus_assert (transport->connection == NULL);
-
- transport->connection = connection;
-
- _dbus_transport_ref (transport);
- if (!(* transport->vtable->connection_set) (transport))
- transport->connection = NULL;
- _dbus_transport_unref (transport);
-
- return transport->connection != NULL;
-}
-
-/**
- * Get the socket file descriptor, if any.
- *
- * @param transport the transport
- * @param fd_p pointer to fill in with the descriptor
- * @returns #TRUE if a descriptor was available
- */
-dbus_bool_t
-_dbus_transport_get_socket_fd (DBusTransport *transport,
- int *fd_p)
-{
- dbus_bool_t retval;
-
- if (transport->vtable->get_socket_fd == NULL)
- return FALSE;
-
- if (transport->disconnected)
- return FALSE;
-
- _dbus_transport_ref (transport);
-
- retval = (* transport->vtable->get_socket_fd) (transport,
- fd_p);
-
- _dbus_transport_unref (transport);
-
- return retval;
-}
-
-/**
- * Performs a single poll()/select() on the transport's file
- * descriptors and then reads/writes data as appropriate,
- * queueing incoming messages and sending outgoing messages.
- * This is the backend for _dbus_connection_do_iteration().
- * See _dbus_connection_do_iteration() for full details.
- *
- * @param transport the transport.
- * @param flags indicates whether to read or write, and whether to block.
- * @param timeout_milliseconds if blocking, timeout or -1 for no timeout.
- */
-void
-_dbus_transport_do_iteration (DBusTransport *transport,
- unsigned int flags,
- int timeout_milliseconds)
-{
- _dbus_assert (transport->vtable->do_iteration != NULL);
-
- _dbus_verbose ("Transport iteration flags 0x%x timeout %d connected = %d\n",
- flags, timeout_milliseconds, !transport->disconnected);
-
- if ((flags & (DBUS_ITERATION_DO_WRITING |
- DBUS_ITERATION_DO_READING)) == 0)
- return; /* Nothing to do */
-
- if (transport->disconnected)
- return;
-
- _dbus_transport_ref (transport);
- (* transport->vtable->do_iteration) (transport, flags,
- timeout_milliseconds);
- _dbus_transport_unref (transport);
-
- _dbus_verbose ("end\n");
-}
-
-static dbus_bool_t
-recover_unused_bytes (DBusTransport *transport)
-{
- if (_dbus_auth_needs_decoding (transport->auth))
- {
- DBusString plaintext;
- const DBusString *encoded;
- DBusString *buffer;
- int orig_len;
-
- if (!_dbus_string_init (&plaintext))
- goto nomem;
-
- _dbus_auth_get_unused_bytes (transport->auth,
- &encoded);
-
- if (!_dbus_auth_decode_data (transport->auth,
- encoded, &plaintext))
- {
- _dbus_string_free (&plaintext);
- goto nomem;
- }
-
- _dbus_message_loader_get_buffer (transport->loader,
- &buffer);
-
- orig_len = _dbus_string_get_length (buffer);
-
- if (!_dbus_string_move (&plaintext, 0, buffer,
- orig_len))
- {
- _dbus_string_free (&plaintext);
- goto nomem;
- }
-
- _dbus_verbose (" %d unused bytes sent to message loader\n",
- _dbus_string_get_length (buffer) -
- orig_len);
-
- _dbus_message_loader_return_buffer (transport->loader,
- buffer);
-
- _dbus_auth_delete_unused_bytes (transport->auth);
-
- _dbus_string_free (&plaintext);
- }
- else
- {
- const DBusString *bytes;
- DBusString *buffer;
- int orig_len;
- dbus_bool_t succeeded;
-
- _dbus_message_loader_get_buffer (transport->loader,
- &buffer);
-
- orig_len = _dbus_string_get_length (buffer);
-
- _dbus_auth_get_unused_bytes (transport->auth,
- &bytes);
-
- succeeded = TRUE;
- if (!_dbus_string_copy (bytes, 0, buffer, _dbus_string_get_length (buffer)))
- succeeded = FALSE;
-
- _dbus_verbose (" %d unused bytes sent to message loader\n",
- _dbus_string_get_length (buffer) -
- orig_len);
-
- _dbus_message_loader_return_buffer (transport->loader,
- buffer);
-
- if (succeeded)
- _dbus_auth_delete_unused_bytes (transport->auth);
- else
- goto nomem;
- }
-
- return TRUE;
-
- nomem:
- _dbus_verbose ("Not enough memory to transfer unused bytes from auth conversation\n");
- return FALSE;
-}
-
-/**
- * Reports our current dispatch status (whether there's buffered
- * data to be queued as messages, or not, or we need memory).
- *
- * @param transport the transport
- * @returns current status
- */
-DBusDispatchStatus
-_dbus_transport_get_dispatch_status (DBusTransport *transport)
-{
- if (_dbus_counter_get_size_value (transport->live_messages) >= transport->max_live_messages_size ||
- _dbus_counter_get_unix_fd_value (transport->live_messages) >= transport->max_live_messages_unix_fds)
- return DBUS_DISPATCH_COMPLETE; /* complete for now */
-
- if (!_dbus_transport_try_to_authenticate (transport))
- {
- if (_dbus_auth_do_work (transport->auth) ==
- DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
- return DBUS_DISPATCH_NEED_MEMORY;
- else if (!_dbus_transport_try_to_authenticate (transport))
- return DBUS_DISPATCH_COMPLETE;
- }
-
- if (!transport->unused_bytes_recovered &&
- !recover_unused_bytes (transport))
- return DBUS_DISPATCH_NEED_MEMORY;
-
- transport->unused_bytes_recovered = TRUE;
-
- if (!_dbus_message_loader_queue_messages (transport->loader))
- return DBUS_DISPATCH_NEED_MEMORY;
-
- if (_dbus_message_loader_peek_message (transport->loader) != NULL)
- return DBUS_DISPATCH_DATA_REMAINS;
- else
- return DBUS_DISPATCH_COMPLETE;
-}
-
-/**
- * Processes data we've read while handling a watch, potentially
- * converting some of it to messages and queueing those messages on
- * the connection.
- *
- * @param transport the transport
- * @returns #TRUE if we had enough memory to queue all messages
- */
-dbus_bool_t
-_dbus_transport_queue_messages (DBusTransport *transport)
-{
- DBusDispatchStatus status;
-
-#if 0
- _dbus_verbose ("_dbus_transport_queue_messages()\n");
-#endif
-
- /* Queue any messages */
- while ((status = _dbus_transport_get_dispatch_status (transport)) == DBUS_DISPATCH_DATA_REMAINS)
- {
- DBusMessage *message;
- DBusList *link;
-
- link = _dbus_message_loader_pop_message_link (transport->loader);
- _dbus_assert (link != NULL);
-
- message = link->data;
-
- _dbus_verbose ("queueing received message %p\n", message);
-
- if (!_dbus_message_add_counter (message, transport->live_messages))
- {
- _dbus_message_loader_putback_message_link (transport->loader,
- link);
- status = DBUS_DISPATCH_NEED_MEMORY;
- break;
- }
- else
- {
- /* We didn't call the notify function when we added the counter, so
- * catch up now. Since we have the connection's lock, it's desirable
- * that we bypass the notify function and call this virtual method
- * directly. */
- if (transport->vtable->live_messages_changed)
- (* transport->vtable->live_messages_changed) (transport);
-
- /* pass ownership of link and message ref to connection */
- _dbus_connection_queue_received_message_link (transport->connection,
- link);
- }
- }
-
- if (_dbus_message_loader_get_is_corrupted (transport->loader))
- {
- _dbus_verbose ("Corrupted message stream, disconnecting\n");
- _dbus_transport_disconnect (transport);
- }
-
- return status != DBUS_DISPATCH_NEED_MEMORY;
-}
-
-/**
- * See dbus_connection_set_max_message_size().
- *
- * @param transport the transport
- * @param size the max size of a single message
- */
-void
-_dbus_transport_set_max_message_size (DBusTransport *transport,
- long size)
-{
- _dbus_message_loader_set_max_message_size (transport->loader, size);
-}
-
-/**
- * See dbus_connection_set_max_message_unix_fds().
- *
- * @param transport the transport
- * @param n the max number of unix fds of a single message
- */
-void
-_dbus_transport_set_max_message_unix_fds (DBusTransport *transport,
- long n)
-{
- _dbus_message_loader_set_max_message_unix_fds (transport->loader, n);
-}
-
-/**
- * See dbus_connection_get_max_message_size().
- *
- * @param transport the transport
- * @returns max message size
- */
-long
-_dbus_transport_get_max_message_size (DBusTransport *transport)
-{
- return _dbus_message_loader_get_max_message_size (transport->loader);
-}
-
-/**
- * See dbus_connection_get_max_message_unix_fds().
- *
- * @param transport the transport
- * @returns max message unix fds
- */
-long
-_dbus_transport_get_max_message_unix_fds (DBusTransport *transport)
-{
- return _dbus_message_loader_get_max_message_unix_fds (transport->loader);
-}
-
-/**
- * See dbus_connection_set_max_received_size().
- *
- * @param transport the transport
- * @param size the max size of all incoming messages
- */
-void
-_dbus_transport_set_max_received_size (DBusTransport *transport,
- long size)
-{
- transport->max_live_messages_size = size;
- _dbus_counter_set_notify (transport->live_messages,
- transport->max_live_messages_size,
- transport->max_live_messages_unix_fds,
- live_messages_notify,
- transport);
-}
-
-/**
- * See dbus_connection_set_max_received_unix_fds().
- *
- * @param transport the transport
- * @param n the max unix fds of all incoming messages
- */
-void
-_dbus_transport_set_max_received_unix_fds (DBusTransport *transport,
- long n)
-{
- transport->max_live_messages_unix_fds = n;
- _dbus_counter_set_notify (transport->live_messages,
- transport->max_live_messages_size,
- transport->max_live_messages_unix_fds,
- live_messages_notify,
- transport);
-}
-
-/**
- * See dbus_connection_get_max_received_size().
- *
- * @param transport the transport
- * @returns max bytes for all live messages
- */
-long
-_dbus_transport_get_max_received_size (DBusTransport *transport)
-{
- return transport->max_live_messages_size;
-}
-
-/**
- * See dbus_connection_set_max_received_unix_fds().
- *
- * @param transport the transport
- * @returns max unix fds for all live messages
- */
-long
-_dbus_transport_get_max_received_unix_fds (DBusTransport *transport)
-{
- return transport->max_live_messages_unix_fds;
-}
-
-/**
- * See dbus_connection_get_unix_user().
- *
- * @param transport the transport
- * @param uid return location for the user ID
- * @returns #TRUE if uid is filled in with a valid user ID
- */
-dbus_bool_t
-_dbus_transport_get_unix_user (DBusTransport *transport,
- unsigned long *uid)
-{
- DBusCredentials *auth_identity;
-
- *uid = _DBUS_INT32_MAX; /* better than some root or system user in
- * case of bugs in the caller. Caller should
- * never use this value on purpose, however.
- */
-
- if (!transport->authenticated)
- return FALSE;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
-
- if (_dbus_credentials_include (auth_identity,
- DBUS_CREDENTIAL_UNIX_USER_ID))
- {
- *uid = _dbus_credentials_get_unix_uid (auth_identity);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * See dbus_connection_get_unix_process_id().
- *
- * @param transport the transport
- * @param pid return location for the process ID
- * @returns #TRUE if uid is filled in with a valid process ID
- */
-dbus_bool_t
-_dbus_transport_get_unix_process_id (DBusTransport *transport,
- unsigned long *pid)
-{
- DBusCredentials *auth_identity;
-
- *pid = DBUS_PID_UNSET; /* Caller should never use this value on purpose,
- * but we set it to a safe number, INT_MAX,
- * just to root out possible bugs in bad callers.
- */
-
- if (!transport->authenticated)
- return FALSE;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
-
- if (_dbus_credentials_include (auth_identity,
- DBUS_CREDENTIAL_UNIX_PROCESS_ID))
- {
- *pid = _dbus_credentials_get_pid (auth_identity);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * See dbus_connection_get_adt_audit_session_data().
- *
- * @param transport the transport
- * @param data return location for the ADT audit data
- * @param data_size return length of audit data
- * @returns #TRUE if audit data is filled in with a valid ucred
- */
-dbus_bool_t
-_dbus_transport_get_adt_audit_session_data (DBusTransport *transport,
- void **data,
- int *data_size)
-{
- DBusCredentials *auth_identity;
-
- *data = NULL;
- *data_size = 0;
-
- if (!transport->authenticated)
- return FALSE;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
-
- if (_dbus_credentials_include (auth_identity,
- DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID))
- {
- *data = (void *) _dbus_credentials_get_adt_audit_data (auth_identity);
- *data_size = _dbus_credentials_get_adt_audit_data_size (auth_identity);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * See dbus_connection_set_unix_user_function().
- *
- * @param transport the transport
- * @param function the predicate
- * @param data data to pass to the predicate
- * @param free_data_function function to free the data
- * @param old_data the old user data to be freed
- * @param old_free_data_function old free data function to free it with
- */
-void
-_dbus_transport_set_unix_user_function (DBusTransport *transport,
- DBusAllowUnixUserFunction function,
- void *data,
- DBusFreeFunction free_data_function,
- void **old_data,
- DBusFreeFunction *old_free_data_function)
-{
- *old_data = transport->unix_user_data;
- *old_free_data_function = transport->free_unix_user_data;
-
- transport->unix_user_function = function;
- transport->unix_user_data = data;
- transport->free_unix_user_data = free_data_function;
-}
-
-/**
- * See dbus_connection_get_windows_user().
- *
- * @param transport the transport
- * @param windows_sid_p return location for the user ID
- * @returns #TRUE if user is available; the returned value may still be #NULL if no memory to copy it
- */
-dbus_bool_t
-_dbus_transport_get_windows_user (DBusTransport *transport,
- char **windows_sid_p)
-{
- DBusCredentials *auth_identity;
-
- *windows_sid_p = NULL;
-
- if (!transport->authenticated)
- return FALSE;
-
- auth_identity = _dbus_auth_get_identity (transport->auth);
-
- if (_dbus_credentials_include (auth_identity,
- DBUS_CREDENTIAL_WINDOWS_SID))
- {
- /* If no memory, we are supposed to return TRUE and set NULL */
- *windows_sid_p = _dbus_strdup (_dbus_credentials_get_windows_sid (auth_identity));
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-/**
- * See dbus_connection_set_windows_user_function().
- *
- * @param transport the transport
- * @param function the predicate
- * @param data data to pass to the predicate
- * @param free_data_function function to free the data
- * @param old_data the old user data to be freed
- * @param old_free_data_function old free data function to free it with
- */
-
-void
-_dbus_transport_set_windows_user_function (DBusTransport *transport,
- DBusAllowWindowsUserFunction function,
- void *data,
- DBusFreeFunction free_data_function,
- void **old_data,
- DBusFreeFunction *old_free_data_function)
-{
- *old_data = transport->windows_user_data;
- *old_free_data_function = transport->free_windows_user_data;
-
- transport->windows_user_function = function;
- transport->windows_user_data = data;
- transport->free_windows_user_data = free_data_function;
-}
-
-/**
- * Sets the SASL authentication mechanisms supported by this transport.
- *
- * @param transport the transport
- * @param mechanisms the #NULL-terminated array of mechanisms
- *
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_transport_set_auth_mechanisms (DBusTransport *transport,
- const char **mechanisms)
-{
- return _dbus_auth_set_mechanisms (transport->auth, mechanisms);
-}
-
-/**
- * See dbus_connection_set_allow_anonymous()
- *
- * @param transport the transport
- * @param value #TRUE to allow anonymous connection
- */
-void
-_dbus_transport_set_allow_anonymous (DBusTransport *transport,
- dbus_bool_t value)
-{
- transport->allow_anonymous = value != FALSE;
-}
-
-#ifdef DBUS_ENABLE_STATS
-void
-_dbus_transport_get_stats (DBusTransport *transport,
- dbus_uint32_t *queue_bytes,
- dbus_uint32_t *queue_fds,
- dbus_uint32_t *peak_queue_bytes,
- dbus_uint32_t *peak_queue_fds)
-{
- if (queue_bytes != NULL)
- *queue_bytes = _dbus_counter_get_size_value (transport->live_messages);
-
- if (queue_fds != NULL)
- *queue_fds = _dbus_counter_get_unix_fd_value (transport->live_messages);
-
- if (peak_queue_bytes != NULL)
- *peak_queue_bytes = _dbus_counter_get_peak_size_value (transport->live_messages);
-
- if (peak_queue_fds != NULL)
- *peak_queue_fds = _dbus_counter_get_peak_unix_fd_value (transport->live_messages);
-}
-#endif /* DBUS_ENABLE_STATS */
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.h
deleted file mode 100644
index 80fa24efeb..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-transport.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-transport.h DBusTransport object (internal to D-BUS implementation)
- *
- * Copyright (C) 2002, 2004 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_TRANSPORT_H
-#define DBUS_TRANSPORT_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-address.h>
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusTransport DBusTransport;
-
-DBusTransport* _dbus_transport_open (DBusAddressEntry *entry,
- DBusError *error);
-DBusTransport* _dbus_transport_ref (DBusTransport *transport);
-void _dbus_transport_unref (DBusTransport *transport);
-void _dbus_transport_disconnect (DBusTransport *transport);
-dbus_bool_t _dbus_transport_get_is_connected (DBusTransport *transport);
-dbus_bool_t _dbus_transport_peek_is_authenticated (DBusTransport *transport);
-dbus_bool_t _dbus_transport_try_to_authenticate (DBusTransport *transport);
-dbus_bool_t _dbus_transport_get_is_anonymous (DBusTransport *transport);
-dbus_bool_t _dbus_transport_can_pass_unix_fd (DBusTransport *transport);
-
-const char* _dbus_transport_get_address (DBusTransport *transport);
-const char* _dbus_transport_get_server_id (DBusTransport *transport);
-dbus_bool_t _dbus_transport_handle_watch (DBusTransport *transport,
- DBusWatch *watch,
- unsigned int condition);
-dbus_bool_t _dbus_transport_set_connection (DBusTransport *transport,
- DBusConnection *connection);
-void _dbus_transport_do_iteration (DBusTransport *transport,
- unsigned int flags,
- int timeout_milliseconds);
-DBusDispatchStatus _dbus_transport_get_dispatch_status (DBusTransport *transport);
-dbus_bool_t _dbus_transport_queue_messages (DBusTransport *transport);
-
-void _dbus_transport_set_max_message_size (DBusTransport *transport,
- long size);
-long _dbus_transport_get_max_message_size (DBusTransport *transport);
-void _dbus_transport_set_max_received_size (DBusTransport *transport,
- long size);
-long _dbus_transport_get_max_received_size (DBusTransport *transport);
-
-void _dbus_transport_set_max_message_unix_fds (DBusTransport *transport,
- long n);
-long _dbus_transport_get_max_message_unix_fds (DBusTransport *transport);
-void _dbus_transport_set_max_received_unix_fds(DBusTransport *transport,
- long n);
-long _dbus_transport_get_max_received_unix_fds(DBusTransport *transport);
-
-dbus_bool_t _dbus_transport_get_socket_fd (DBusTransport *transport,
- int *fd_p);
-dbus_bool_t _dbus_transport_get_unix_user (DBusTransport *transport,
- unsigned long *uid);
-dbus_bool_t _dbus_transport_get_unix_process_id (DBusTransport *transport,
- unsigned long *pid);
-dbus_bool_t _dbus_transport_get_adt_audit_session_data (DBusTransport *transport,
- void **data,
- int *data_size);
-void _dbus_transport_set_unix_user_function (DBusTransport *transport,
- DBusAllowUnixUserFunction function,
- void *data,
- DBusFreeFunction free_data_function,
- void **old_data,
- DBusFreeFunction *old_free_data_function);
-dbus_bool_t _dbus_transport_get_windows_user (DBusTransport *transport,
- char **windows_sid_p);
-void _dbus_transport_set_windows_user_function (DBusTransport *transport,
- DBusAllowWindowsUserFunction function,
- void *data,
- DBusFreeFunction free_data_function,
- void **old_data,
- DBusFreeFunction *old_free_data_function);
-dbus_bool_t _dbus_transport_set_auth_mechanisms (DBusTransport *transport,
- const char **mechanisms);
-void _dbus_transport_set_allow_anonymous (DBusTransport *transport,
- dbus_bool_t value);
-
-/* if DBUS_ENABLE_STATS */
-void _dbus_transport_get_stats (DBusTransport *transport,
- dbus_uint32_t *queue_bytes,
- dbus_uint32_t *queue_fds,
- dbus_uint32_t *peak_queue_bytes,
- dbus_uint32_t *peak_queue_fds);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_TRANSPORT_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-types.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-types.h
deleted file mode 100644
index 021a55af90..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-types.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-types.h types such as dbus_bool_t
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_TYPES_H
-#define DBUS_TYPES_H
-
-#include <stddef.h>
-#include <dbus/dbus-arch-deps.h>
-
-typedef dbus_uint32_t dbus_unichar_t;
-/* boolean size must be fixed at 4 bytes due to wire protocol! */
-typedef dbus_uint32_t dbus_bool_t;
-
-/* Normally docs are in .c files, but there isn't a .c file for this. */
-/**
- * @defgroup DBusTypes Basic types
- * @ingroup DBus
- * @brief dbus_bool_t, dbus_int32_t, etc.
- *
- * Typedefs for common primitive types.
- *
- * @{
- */
-
-/**
- * @typedef dbus_bool_t
- *
- * A boolean, valid values are #TRUE and #FALSE.
- */
-
-/**
- * @typedef dbus_uint32_t
- *
- * A 32-bit unsigned integer on all platforms.
- */
-
-/**
- * @typedef dbus_int32_t
- *
- * A 32-bit signed integer on all platforms.
- */
-
-/**
- * @typedef dbus_uint16_t
- *
- * A 16-bit unsigned integer on all platforms.
- */
-
-/**
- * @typedef dbus_int16_t
- *
- * A 16-bit signed integer on all platforms.
- */
-
-
-/**
- * @typedef dbus_uint64_t
- *
- * A 64-bit unsigned integer.
- */
-
-/**
- * @typedef dbus_int64_t
- *
- * A 64-bit signed integer.
- */
-
-/**
- * @def DBUS_HAVE_INT64
- *
- * Always defined.
- *
- * In older libdbus versions, this would be undefined if there was no
- * 64-bit integer type on that platform. libdbus no longer supports
- * such platforms.
- */
-
-/**
- * @def DBUS_INT64_CONSTANT
- *
- * Declare a 64-bit signed integer constant. The macro
- * adds the necessary "LL" or whatever after the integer,
- * giving a literal such as "325145246765LL"
- */
-
-/**
- * @def DBUS_UINT64_CONSTANT
- *
- * Declare a 64-bit unsigned integer constant. The macro
- * adds the necessary "ULL" or whatever after the integer,
- * giving a literal such as "325145246765ULL"
- */
-
-/**
- * An 8-byte struct you could use to access int64 without having
- * int64 support. Use #dbus_int64_t or #dbus_uint64_t instead.
- */
-typedef struct
-{
- dbus_uint32_t first32; /**< first 32 bits in the 8 bytes (beware endian issues) */
- dbus_uint32_t second32; /**< second 32 bits in the 8 bytes (beware endian issues) */
-} DBus8ByteStruct;
-
-/**
- * A simple value union that lets you access bytes as if they
- * were various types; useful when dealing with basic types via
- * void pointers and varargs.
- *
- * This union also contains a pointer member (which can be used
- * to retrieve a string from dbus_message_iter_get_basic(), for
- * instance), so on future platforms it could conceivably be larger
- * than 8 bytes.
- */
-typedef union
-{
- unsigned char bytes[8]; /**< as 8 individual bytes */
- dbus_int16_t i16; /**< as int16 */
- dbus_uint16_t u16; /**< as int16 */
- dbus_int32_t i32; /**< as int32 */
- dbus_uint32_t u32; /**< as int32 */
- dbus_bool_t bool_val; /**< as boolean */
- dbus_int64_t i64; /**< as int64 */
- dbus_uint64_t u64; /**< as int64 */
- DBus8ByteStruct eight; /**< as 8-byte struct */
- double dbl; /**< as double */
- unsigned char byt; /**< as byte */
- char *str; /**< as char* (string, object path or signature) */
- int fd; /**< as Unix file descriptor */
-} DBusBasicValue;
-
-/** @} */
-
-#endif /* DBUS_TYPES_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb-util.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb-util.c
deleted file mode 100644
index 888a23e9f5..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb-util.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-userdb-util.c Would be in dbus-userdb.c, but not used in libdbus
- *
- * Copyright (C) 2003, 2004, 2005 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#include <unistd.h>
-#define DBUS_USERDB_INCLUDES_PRIVATE 1
-#include "dbus-userdb.h"
-#include "dbus-test.h"
-#include "dbus-internals.h"
-#include "dbus-protocol.h"
-#include <string.h>
-
-#if HAVE_SYSTEMD
-#include <systemd/sd-login.h>
-#endif
-
-/**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-/**
- * Checks to see if the UID sent in is the console user
- *
- * @param uid UID of person to check
- * @param error return location for errors
- * @returns #TRUE if the UID is the same as the console user and there are no errors
- */
-dbus_bool_t
-_dbus_is_console_user (dbus_uid_t uid,
- DBusError *error)
-{
-
- DBusUserDatabase *db;
- const DBusUserInfo *info;
- dbus_bool_t result = FALSE;
-
-#ifdef HAVE_SYSTEMD
- /* check if we have logind */
- if (access ("/run/systemd/seats/", F_OK) >= 0)
- {
- int r;
-
- /* Check whether this user is logged in on at least one physical
- seat */
- r = sd_uid_get_seats (uid, 0, NULL);
- if (r < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (-r),
- "Failed to determine seats of user \"" DBUS_UID_FORMAT "\": %s",
- uid,
- _dbus_strerror (-r));
- return FALSE;
- }
-
- return (r > 0);
- }
-#endif
-
-#ifdef HAVE_CONSOLE_OWNER_FILE
-
- DBusString f;
- DBusStat st;
-
- if (!_dbus_string_init (&f))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_string_append(&f, DBUS_CONSOLE_OWNER_FILE))
- {
- _dbus_string_free(&f);
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (_dbus_stat(&f, &st, NULL) && (st.uid == uid))
- {
- _dbus_string_free(&f);
- return TRUE;
- }
-
- _dbus_string_free(&f);
-
-#endif /* HAVE_CONSOLE_OWNER_FILE */
-
- if (!_dbus_user_database_lock_system ())
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED, "Could not get system database.");
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- /* TPTD: this should be cache-safe, we've locked the DB and
- _dbus_user_at_console doesn't pass it on. */
- info = _dbus_user_database_lookup (db, uid, NULL, error);
-
- if (info == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- result = _dbus_user_at_console (info->username, error);
-
- _dbus_user_database_unlock_system ();
-
- return result;
-}
-
-/**
- * Gets user ID given username
- *
- * @param username the username
- * @param uid return location for UID
- * @returns #TRUE if username existed and we got the UID
- */
-dbus_bool_t
-_dbus_get_user_id (const DBusString *username,
- dbus_uid_t *uid)
-{
- return _dbus_get_user_id_and_primary_group (username, uid, NULL);
-}
-
-/**
- * Gets group ID given groupname
- *
- * @param groupname the groupname
- * @param gid return location for GID
- * @returns #TRUE if group name existed and we got the GID
- */
-dbus_bool_t
-_dbus_get_group_id (const DBusString *groupname,
- dbus_gid_t *gid)
-{
- DBusUserDatabase *db;
- const DBusGroupInfo *info;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_groupname (db, groupname,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- *gid = info->gid;
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-
-/**
- * Gets user ID and primary group given username
- *
- * @param username the username
- * @param uid_p return location for UID
- * @param gid_p return location for GID
- * @returns #TRUE if username existed and we got the UID and GID
- */
-dbus_bool_t
-_dbus_get_user_id_and_primary_group (const DBusString *username,
- dbus_uid_t *uid_p,
- dbus_gid_t *gid_p)
-{
- DBusUserDatabase *db;
- const DBusUserInfo *info;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_username (db, username,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (uid_p)
- *uid_p = info->uid;
- if (gid_p)
- *gid_p = info->primary_gid;
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-
-/**
- * Looks up a gid or group name in the user database. Only one of
- * name or GID can be provided. There are wrapper functions for this
- * that are better to use, this one does no locking or anything on the
- * database and otherwise sort of sucks.
- *
- * @param db the database
- * @param gid the group ID or #DBUS_GID_UNSET
- * @param groupname group name or #NULL
- * @param error error to fill in
- * @returns the entry in the database
- */
-DBusGroupInfo*
-_dbus_user_database_lookup_group (DBusUserDatabase *db,
- dbus_gid_t gid,
- const DBusString *groupname,
- DBusError *error)
-{
- DBusGroupInfo *info;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- /* See if the group is really a number */
- if (gid == DBUS_UID_UNSET)
- {
- unsigned long n;
-
- if (_dbus_is_a_number (groupname, &n))
- gid = n;
- }
-
- if (gid != DBUS_GID_UNSET)
- info = _dbus_hash_table_lookup_uintptr (db->groups, gid);
- else
- info = _dbus_hash_table_lookup_string (db->groups_by_name,
- _dbus_string_get_const_data (groupname));
- if (info)
- {
- _dbus_verbose ("Using cache for GID "DBUS_GID_FORMAT" information\n",
- info->gid);
- return info;
- }
- else
- {
- if (gid != DBUS_GID_UNSET)
- _dbus_verbose ("No cache for GID "DBUS_GID_FORMAT"\n",
- gid);
- else
- _dbus_verbose ("No cache for groupname \"%s\"\n",
- _dbus_string_get_const_data (groupname));
-
- info = dbus_new0 (DBusGroupInfo, 1);
- if (info == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (gid != DBUS_GID_UNSET)
- {
- if (!_dbus_group_info_fill_gid (info, gid, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_group_info_free_allocated (info);
- return NULL;
- }
- }
- else
- {
- if (!_dbus_group_info_fill (info, groupname, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_group_info_free_allocated (info);
- return NULL;
- }
- }
-
- /* don't use these past here */
- gid = DBUS_GID_UNSET;
- groupname = NULL;
-
- if (!_dbus_hash_table_insert_uintptr (db->groups, info->gid, info))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_group_info_free_allocated (info);
- return NULL;
- }
-
-
- if (!_dbus_hash_table_insert_string (db->groups_by_name,
- info->groupname,
- info))
- {
- _dbus_hash_table_remove_uintptr (db->groups, info->gid);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- return info;
- }
-}
-
-
-/**
- * Gets the user information for the given group name,
- * returned group info should not be freed.
- *
- * @param db user database
- * @param groupname the group name
- * @param info return location for const ref to group info
- * @param error error location
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_user_database_get_groupname (DBusUserDatabase *db,
- const DBusString *groupname,
- const DBusGroupInfo **info,
- DBusError *error)
-{
- *info = _dbus_user_database_lookup_group (db, DBUS_GID_UNSET, groupname, error);
- return *info != NULL;
-}
-
-/**
- * Gets the user information for the given GID,
- * returned group info should not be freed.
- *
- * @param db user database
- * @param gid the group ID
- * @param info return location for const ref to group info
- * @param error error location
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_user_database_get_gid (DBusUserDatabase *db,
- dbus_gid_t gid,
- const DBusGroupInfo **info,
- DBusError *error)
-{
- *info = _dbus_user_database_lookup_group (db, gid, NULL, error);
- return *info != NULL;
-}
-
-
-/**
- * Gets all groups corresponding to the given UID. Returns #FALSE
- * if no memory, or user isn't known, but always initializes
- * group_ids to a NULL array.
- *
- * @param uid the UID
- * @param group_ids return location for array of group IDs
- * @param n_group_ids return location for length of returned array
- * @returns #TRUE if the UID existed and we got some credentials
- */
-dbus_bool_t
-_dbus_groups_from_uid (dbus_uid_t uid,
- dbus_gid_t **group_ids,
- int *n_group_ids)
-{
- DBusUserDatabase *db;
- const DBusUserInfo *info;
- *group_ids = NULL;
- *n_group_ids = 0;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_uid (db, uid,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- _dbus_assert (info->uid == uid);
-
- if (info->n_group_ids > 0)
- {
- *group_ids = dbus_new (dbus_gid_t, info->n_group_ids);
- if (*group_ids == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- *n_group_ids = info->n_group_ids;
-
- memcpy (*group_ids, info->group_ids, info->n_group_ids * sizeof (dbus_gid_t));
- }
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-/** @} */
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#include <stdio.h>
-
-/**
- * Unit test for dbus-userdb.c.
- *
- * @returns #TRUE on success.
- */
-dbus_bool_t
-_dbus_userdb_test (const char *test_data_dir)
-{
- const DBusString *username;
- const DBusString *homedir;
- dbus_uid_t uid;
- unsigned long *group_ids;
- int n_group_ids, i;
- DBusError error;
-
- if (!_dbus_username_from_current_process (&username))
- _dbus_assert_not_reached ("didn't get username");
-
- if (!_dbus_homedir_from_current_process (&homedir))
- _dbus_assert_not_reached ("didn't get homedir");
-
- if (!_dbus_get_user_id (username, &uid))
- _dbus_assert_not_reached ("didn't get uid");
-
- if (!_dbus_groups_from_uid (uid, &group_ids, &n_group_ids))
- _dbus_assert_not_reached ("didn't get groups");
-
- printf (" Current user: %s homedir: %s gids:",
- _dbus_string_get_const_data (username),
- _dbus_string_get_const_data (homedir));
-
- for (i=0; i<n_group_ids; i++)
- printf(" %ld", group_ids[i]);
-
- printf ("\n");
-
- dbus_error_init (&error);
- printf ("Is Console user: %i\n",
- _dbus_is_console_user (uid, &error));
- printf ("Invocation was OK: %s\n", error.message ? error.message : "yes");
- dbus_error_free (&error);
- printf ("Is Console user 4711: %i\n",
- _dbus_is_console_user (4711, &error));
- printf ("Invocation was OK: %s\n", error.message ? error.message : "yes");
- dbus_error_free (&error);
-
- dbus_free (group_ids);
-
- return TRUE;
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.c
deleted file mode 100644
index 52f927a3d0..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.c
+++ /dev/null
@@ -1,687 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-userdb.c User database abstraction
- *
- * Copyright (C) 2003, 2004 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#define DBUS_USERDB_INCLUDES_PRIVATE 1
-#include "dbus-userdb.h"
-#include "dbus-hash.h"
-#include "dbus-test.h"
-#include "dbus-internals.h"
-#include "dbus-protocol.h"
-#include "dbus-credentials.h"
-#include <string.h>
-
-/**
- * @addtogroup DBusInternalsUtils
- * @{
- */
-
-/**
- * Frees the given #DBusUserInfo's members with _dbus_user_info_free()
- * and also calls dbus_free() on the block itself
- *
- * @param info the info
- */
-void
-_dbus_user_info_free_allocated (DBusUserInfo *info)
-{
- if (info == NULL) /* hash table will pass NULL */
- return;
-
- _dbus_user_info_free (info);
- dbus_free (info);
-}
-
-/**
- * Frees the given #DBusGroupInfo's members with _dbus_group_info_free()
- * and also calls dbus_free() on the block itself
- *
- * @param info the info
- */
-void
-_dbus_group_info_free_allocated (DBusGroupInfo *info)
-{
- if (info == NULL) /* hash table will pass NULL */
- return;
-
- _dbus_group_info_free (info);
- dbus_free (info);
-}
-
-/**
- * Frees the members of info
- * (but not info itself)
- * @param info the user info struct
- */
-void
-_dbus_user_info_free (DBusUserInfo *info)
-{
- dbus_free (info->group_ids);
- dbus_free (info->username);
- dbus_free (info->homedir);
-}
-
-/**
- * Frees the members of info (but not info itself).
- *
- * @param info the group info
- */
-void
-_dbus_group_info_free (DBusGroupInfo *info)
-{
- dbus_free (info->groupname);
-}
-
-/**
- * Checks if a given string is actually a number
- * and converts it if it is
- *
- * @param str the string to check
- * @param num the memory location of the unsigned long to fill in
- * @returns TRUE if str is a number and num is filled in
- */
-dbus_bool_t
-_dbus_is_a_number (const DBusString *str,
- unsigned long *num)
-{
- int end;
-
- if (_dbus_string_parse_uint (str, 0, num, &end) &&
- end == _dbus_string_get_length (str))
- return TRUE;
- else
- return FALSE;
-}
-
-/**
- * Looks up a uid or username in the user database. Only one of name
- * or UID can be provided. There are wrapper functions for this that
- * are better to use, this one does no locking or anything on the
- * database and otherwise sort of sucks.
- *
- * @param db the database
- * @param uid the user ID or #DBUS_UID_UNSET
- * @param username username or #NULL
- * @param error error to fill in
- * @returns the entry in the database
- */
-DBusUserInfo*
-_dbus_user_database_lookup (DBusUserDatabase *db,
- dbus_uid_t uid,
- const DBusString *username,
- DBusError *error)
-{
- DBusUserInfo *info;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_assert (uid != DBUS_UID_UNSET || username != NULL);
-
- /* See if the username is really a number */
- if (uid == DBUS_UID_UNSET)
- {
- unsigned long n;
-
- if (_dbus_is_a_number (username, &n))
- uid = n;
- }
-
- if (uid != DBUS_UID_UNSET)
- info = _dbus_hash_table_lookup_uintptr (db->users, uid);
- else
- info = _dbus_hash_table_lookup_string (db->users_by_name, _dbus_string_get_const_data (username));
-
- if (info)
- {
- _dbus_verbose ("Using cache for UID "DBUS_UID_FORMAT" information\n",
- info->uid);
- return info;
- }
- else
- {
- if (uid != DBUS_UID_UNSET)
- _dbus_verbose ("No cache for UID "DBUS_UID_FORMAT"\n",
- uid);
- else
- _dbus_verbose ("No cache for user \"%s\"\n",
- _dbus_string_get_const_data (username));
-
- info = dbus_new0 (DBusUserInfo, 1);
- if (info == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- if (uid != DBUS_UID_UNSET)
- {
- if (!_dbus_user_info_fill_uid (info, uid, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_user_info_free_allocated (info);
- return NULL;
- }
- }
- else
- {
- if (!_dbus_user_info_fill (info, username, error))
- {
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_user_info_free_allocated (info);
- return NULL;
- }
- }
-
- /* be sure we don't use these after here */
- uid = DBUS_UID_UNSET;
- username = NULL;
-
- /* insert into hash */
- if (!_dbus_hash_table_insert_uintptr (db->users, info->uid, info))
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- _dbus_user_info_free_allocated (info);
- return NULL;
- }
-
- if (!_dbus_hash_table_insert_string (db->users_by_name,
- info->username,
- info))
- {
- _dbus_hash_table_remove_uintptr (db->users, info->uid);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
- return info;
- }
-}
-
-static dbus_bool_t database_locked = FALSE;
-static DBusUserDatabase *system_db = NULL;
-static DBusString process_username;
-static DBusString process_homedir;
-
-static void
-shutdown_system_db (void *data)
-{
- if (system_db != NULL)
- _dbus_user_database_unref (system_db);
- system_db = NULL;
- _dbus_string_free (&process_username);
- _dbus_string_free (&process_homedir);
-}
-
-static dbus_bool_t
-init_system_db (void)
-{
- _dbus_assert (database_locked);
-
- if (system_db == NULL)
- {
- DBusError error = DBUS_ERROR_INIT;
- const DBusUserInfo *info;
-
- system_db = _dbus_user_database_new ();
- if (system_db == NULL)
- return FALSE;
-
- if (!_dbus_user_database_get_uid (system_db,
- _dbus_getuid (),
- &info,
- &error))
- {
- _dbus_user_database_unref (system_db);
- system_db = NULL;
-
- if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
- {
- dbus_error_free (&error);
- return FALSE;
- }
- else
- {
- /* This really should not happen. */
- _dbus_warn ("Could not get password database information for UID of current process: %s\n",
- error.message);
- dbus_error_free (&error);
- return FALSE;
- }
- }
-
- if (!_dbus_string_init (&process_username))
- {
- _dbus_user_database_unref (system_db);
- system_db = NULL;
- return FALSE;
- }
-
- if (!_dbus_string_init (&process_homedir))
- {
- _dbus_string_free (&process_username);
- _dbus_user_database_unref (system_db);
- system_db = NULL;
- return FALSE;
- }
-
- if (!_dbus_string_append (&process_username,
- info->username) ||
- !_dbus_string_append (&process_homedir,
- info->homedir) ||
- !_dbus_register_shutdown_func (shutdown_system_db, NULL))
- {
- _dbus_string_free (&process_username);
- _dbus_string_free (&process_homedir);
- _dbus_user_database_unref (system_db);
- system_db = NULL;
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- * Locks global system user database.
- */
-dbus_bool_t
-_dbus_user_database_lock_system (void)
-{
- if (_DBUS_LOCK (system_users))
- {
- database_locked = TRUE;
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-/**
- * Unlocks global system user database.
- */
-void
-_dbus_user_database_unlock_system (void)
-{
- database_locked = FALSE;
- _DBUS_UNLOCK (system_users);
-}
-
-/**
- * Gets the system global user database;
- * must be called with lock held (_dbus_user_database_lock_system()).
- *
- * @returns the database or #NULL if no memory
- */
-DBusUserDatabase*
-_dbus_user_database_get_system (void)
-{
- _dbus_assert (database_locked);
-
- init_system_db ();
-
- return system_db;
-}
-
-/**
- * Flushes the system global user database;
- */
-void
-_dbus_user_database_flush_system (void)
-{
- if (!_dbus_user_database_lock_system ())
- {
- /* nothing to flush */
- return;
- }
-
- if (system_db != NULL)
- _dbus_user_database_flush (system_db);
-
- _dbus_user_database_unlock_system ();
-}
-
-/**
- * Gets username of user owning current process. The returned string
- * is valid until dbus_shutdown() is called.
- *
- * @param username place to store pointer to username
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_username_from_current_process (const DBusString **username)
-{
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- if (!init_system_db ())
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
- *username = &process_username;
- _dbus_user_database_unlock_system ();
-
- return TRUE;
-}
-
-/**
- * Gets homedir of user owning current process. The returned string
- * is valid until dbus_shutdown() is called.
- *
- * @param homedir place to store pointer to homedir
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_homedir_from_current_process (const DBusString **homedir)
-{
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- if (!init_system_db ())
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
- *homedir = &process_homedir;
- _dbus_user_database_unlock_system ();
-
- return TRUE;
-}
-
-/**
- * Gets the home directory for the given user.
- *
- * @param username the username
- * @param homedir string to append home directory to
- * @returns #TRUE if user existed and we appended their homedir
- */
-dbus_bool_t
-_dbus_homedir_from_username (const DBusString *username,
- DBusString *homedir)
-{
- DBusUserDatabase *db;
- const DBusUserInfo *info;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_username (db, username,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_string_append (homedir, info->homedir))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-
-/**
- * Gets the home directory for the given user.
- *
- * @param uid the uid
- * @param homedir string to append home directory to
- * @returns #TRUE if user existed and we appended their homedir
- */
-dbus_bool_t
-_dbus_homedir_from_uid (dbus_uid_t uid,
- DBusString *homedir)
-{
- DBusUserDatabase *db;
- const DBusUserInfo *info;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_uid (db, uid,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_string_append (homedir, info->homedir))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-
-/**
- * Adds the credentials corresponding to the given username.
- *
- * Used among other purposes to parses a desired identity provided
- * from a client in the auth protocol. On UNIX this means parsing a
- * UID, on Windows probably parsing an SID string.
- *
- * @todo this is broken because it treats OOM and parse error
- * the same way. Needs a #DBusError.
- *
- * @param credentials credentials to fill in
- * @param username the username
- * @returns #TRUE if the username existed and we got some credentials
- */
-dbus_bool_t
-_dbus_credentials_add_from_user (DBusCredentials *credentials,
- const DBusString *username)
-{
- DBusUserDatabase *db;
- const DBusUserInfo *info;
-
- /* FIXME: this can't distinguish ENOMEM from other errors */
- if (!_dbus_user_database_lock_system ())
- return FALSE;
-
- db = _dbus_user_database_get_system ();
- if (db == NULL)
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_user_database_get_username (db, username,
- &info, NULL))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- if (!_dbus_credentials_add_unix_uid(credentials, info->uid))
- {
- _dbus_user_database_unlock_system ();
- return FALSE;
- }
-
- _dbus_user_database_unlock_system ();
- return TRUE;
-}
-
-/**
- * Creates a new user database object used to look up and
- * cache user information.
- * @returns new database, or #NULL on out of memory
- */
-DBusUserDatabase*
-_dbus_user_database_new (void)
-{
- DBusUserDatabase *db;
-
- db = dbus_new0 (DBusUserDatabase, 1);
- if (db == NULL)
- return NULL;
-
- db->refcount = 1;
-
- db->users = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL, (DBusFreeFunction) _dbus_user_info_free_allocated);
-
- if (db->users == NULL)
- goto failed;
-
- db->groups = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
- NULL, (DBusFreeFunction) _dbus_group_info_free_allocated);
-
- if (db->groups == NULL)
- goto failed;
-
- db->users_by_name = _dbus_hash_table_new (DBUS_HASH_STRING,
- NULL, NULL);
- if (db->users_by_name == NULL)
- goto failed;
-
- db->groups_by_name = _dbus_hash_table_new (DBUS_HASH_STRING,
- NULL, NULL);
- if (db->groups_by_name == NULL)
- goto failed;
-
- return db;
-
- failed:
- _dbus_user_database_unref (db);
- return NULL;
-}
-
-/**
- * Flush all information out of the user database.
- */
-void
-_dbus_user_database_flush (DBusUserDatabase *db)
-{
- _dbus_hash_table_remove_all(db->users_by_name);
- _dbus_hash_table_remove_all(db->groups_by_name);
- _dbus_hash_table_remove_all(db->users);
- _dbus_hash_table_remove_all(db->groups);
-}
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-/**
- * Increments refcount of user database.
- * @param db the database
- * @returns the database
- */
-DBusUserDatabase *
-_dbus_user_database_ref (DBusUserDatabase *db)
-{
- _dbus_assert (db->refcount > 0);
-
- db->refcount += 1;
-
- return db;
-}
-#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
-/**
- * Decrements refcount of user database.
- * @param db the database
- */
-void
-_dbus_user_database_unref (DBusUserDatabase *db)
-{
- _dbus_assert (db->refcount > 0);
-
- db->refcount -= 1;
- if (db->refcount == 0)
- {
- if (db->users)
- _dbus_hash_table_unref (db->users);
-
- if (db->groups)
- _dbus_hash_table_unref (db->groups);
-
- if (db->users_by_name)
- _dbus_hash_table_unref (db->users_by_name);
-
- if (db->groups_by_name)
- _dbus_hash_table_unref (db->groups_by_name);
-
- dbus_free (db);
- }
-}
-
-/**
- * Gets the user information for the given UID,
- * returned user info should not be freed.
- *
- * @param db user database
- * @param uid the user ID
- * @param info return location for const ref to user info
- * @param error error location
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_user_database_get_uid (DBusUserDatabase *db,
- dbus_uid_t uid,
- const DBusUserInfo **info,
- DBusError *error)
-{
- *info = _dbus_user_database_lookup (db, uid, NULL, error);
- return *info != NULL;
-}
-
-/**
- * Gets the user information for the given username.
- *
- * @param db user database
- * @param username the user name
- * @param info return location for const ref to user info
- * @param error error location
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-_dbus_user_database_get_username (DBusUserDatabase *db,
- const DBusString *username,
- const DBusUserInfo **info,
- DBusError *error)
-{
- *info = _dbus_user_database_lookup (db, DBUS_UID_UNSET, username, error);
- return *info != NULL;
-}
-
-/** @} */
-
-/* Tests in dbus-userdb-util.c */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.h
deleted file mode 100644
index d6b72d8cf1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-userdb.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-userdb.h User database abstraction
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_USERDB_H
-#define DBUS_USERDB_H
-
-#include <dbus/dbus-sysdeps-unix.h>
-
-#ifdef DBUS_WIN
-#error "Don't include this on Windows"
-#endif
-
-DBUS_BEGIN_DECLS
-
-typedef struct DBusUserDatabase DBusUserDatabase;
-
-#ifdef DBUS_USERDB_INCLUDES_PRIVATE
-#include <dbus/dbus-hash.h>
-
-/**
- * Internals of DBusUserDatabase
- */
-struct DBusUserDatabase
-{
- int refcount; /**< Reference count */
-
- DBusHashTable *users; /**< Users in the database by UID */
- DBusHashTable *groups; /**< Groups in the database by GID */
- DBusHashTable *users_by_name; /**< Users in the database by name */
- DBusHashTable *groups_by_name; /**< Groups in the database by name */
-
-};
-
-
-DBusUserDatabase* _dbus_user_database_new (void);
-DBusUserDatabase* _dbus_user_database_ref (DBusUserDatabase *db);
-void _dbus_user_database_flush (DBusUserDatabase *db);
-void _dbus_user_database_unref (DBusUserDatabase *db);
-dbus_bool_t _dbus_user_database_get_uid (DBusUserDatabase *db,
- dbus_uid_t uid,
- const DBusUserInfo **info,
- DBusError *error);
-dbus_bool_t _dbus_user_database_get_gid (DBusUserDatabase *db,
- dbus_gid_t gid,
- const DBusGroupInfo **info,
- DBusError *error);
-dbus_bool_t _dbus_user_database_get_username (DBusUserDatabase *db,
- const DBusString *username,
- const DBusUserInfo **info,
- DBusError *error);
-dbus_bool_t _dbus_user_database_get_groupname (DBusUserDatabase *db,
- const DBusString *groupname,
- const DBusGroupInfo **info,
- DBusError *error);
-
-DBusUserInfo* _dbus_user_database_lookup (DBusUserDatabase *db,
- dbus_uid_t uid,
- const DBusString *username,
- DBusError *error);
-DBusGroupInfo* _dbus_user_database_lookup_group (DBusUserDatabase *db,
- dbus_gid_t gid,
- const DBusString *groupname,
- DBusError *error);
-void _dbus_user_info_free_allocated (DBusUserInfo *info);
-void _dbus_group_info_free_allocated (DBusGroupInfo *info);
-#endif /* DBUS_USERDB_INCLUDES_PRIVATE */
-
-DBusUserDatabase* _dbus_user_database_get_system (void);
-dbus_bool_t _dbus_user_database_lock_system (void) _DBUS_GNUC_WARN_UNUSED_RESULT;
-void _dbus_user_database_unlock_system (void);
-void _dbus_user_database_flush_system (void);
-
-dbus_bool_t _dbus_get_user_id (const DBusString *username,
- dbus_uid_t *uid);
-dbus_bool_t _dbus_get_group_id (const DBusString *group_name,
- dbus_gid_t *gid);
-dbus_bool_t _dbus_get_user_id_and_primary_group (const DBusString *username,
- dbus_uid_t *uid_p,
- dbus_gid_t *gid_p);
-dbus_bool_t _dbus_credentials_from_uid (dbus_uid_t user_id,
- DBusCredentials *credentials);
-dbus_bool_t _dbus_groups_from_uid (dbus_uid_t uid,
- dbus_gid_t **group_ids,
- int *n_group_ids);
-dbus_bool_t _dbus_is_console_user (dbus_uid_t uid,
- DBusError *error);
-
-dbus_bool_t _dbus_is_a_number (const DBusString *str,
- unsigned long *num);
-
-dbus_bool_t _dbus_username_from_current_process (const DBusString **username);
-dbus_bool_t _dbus_homedir_from_current_process (const DBusString **homedir);
-dbus_bool_t _dbus_homedir_from_username (const DBusString *username,
- DBusString *homedir);
-
-dbus_bool_t _dbus_homedir_from_uid (dbus_uid_t uid,
- DBusString *homedir);
-
-DBUS_END_DECLS
-
-#endif /* DBUS_USERDB_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.c
deleted file mode 100644
index 6d7c0aecc7..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-uuidgen.c The guts of the dbus-uuidgen binary live in libdbus, in this file.
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#include "dbus-uuidgen.h"
-#include "dbus-internals.h"
-#include "dbus-string.h"
-#include "dbus-protocol.h"
-
-#ifdef DBUS_WIN
-#error "dbus-uuidgen should not be needed on Windows"
-#endif
-
-/**
- * @defgroup DBusInternalsUuidgen dbus-uuidgen implementation
- * @ingroup DBusInternals
- * @brief Functions for dbus-uuidgen binary
- *
- * These are not considered part of the ABI, and if you call them
- * you will get screwed by future changes.
- *
- * @{
- */
-
-static dbus_bool_t
-return_uuid (DBusGUID *uuid,
- char **uuid_p,
- DBusError *error)
-{
- if (uuid_p)
- {
- DBusString encoded;
-
- if (!_dbus_string_init (&encoded))
- {
- _DBUS_SET_OOM (error);
- return FALSE;
- }
-
- if (!_dbus_uuid_encode (uuid, &encoded) ||
- !_dbus_string_steal_data (&encoded, uuid_p))
- {
- _DBUS_SET_OOM (error);
- _dbus_string_free (&encoded);
- return FALSE;
- }
- _dbus_string_free (&encoded);
- }
- return TRUE;
-}
-
-/**
- * For use by the dbus-uuidgen binary ONLY, do not call this.
- * We can and will change this function without modifying
- * the libdbus soname.
- *
- * @param filename the file or #NULL for the machine ID file
- * @param uuid_p out param to return the uuid
- * @param create_if_not_found whether to create it if not already there
- * @param error error return
- * @returns #FALSE if error is set
- */
-dbus_bool_t
-dbus_internal_do_not_use_get_uuid (const char *filename,
- char **uuid_p,
- dbus_bool_t create_if_not_found,
- DBusError *error)
-{
- DBusGUID uuid;
-
- if (filename)
- {
- DBusString filename_str;
- _dbus_string_init_const (&filename_str, filename);
- if (!_dbus_read_uuid_file (&filename_str, &uuid, create_if_not_found, error))
- goto error;
- }
- else
- {
- if (!_dbus_read_local_machine_uuid (&uuid, create_if_not_found, error))
- goto error;
- }
-
- if (!return_uuid(&uuid, uuid_p, error))
- goto error;
-
- return TRUE;
-
- error:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- return FALSE;
-}
-
-/**
- * For use by the dbus-uuidgen binary ONLY, do not call this.
- * We can and will change this function without modifying
- * the libdbus soname.
- *
- * @param uuid_p out param to return the uuid
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-dbus_internal_do_not_use_create_uuid (char **uuid_p)
-{
- DBusGUID uuid;
-
- _dbus_generate_uuid (&uuid);
- return return_uuid (&uuid, uuid_p, NULL);
-}
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.h
deleted file mode 100644
index 9c1b8595d1..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-uuidgen.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-uuidgen.h The guts of the dbus-uuidgen binary live in libdbus, in this file.
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifdef DBUS_INSIDE_DBUS_H
-#error "You can't include dbus-uuidgen.h in the public header dbus.h"
-#endif
-
-#ifndef DBUS_UUIDGEN_H
-#define DBUS_UUIDGEN_H
-
-#include <dbus/dbus-types.h>
-#include <dbus/dbus-errors.h>
-
-DBUS_BEGIN_DECLS
-
-dbus_bool_t dbus_internal_do_not_use_get_uuid (const char *filename,
- char **uuid_p,
- dbus_bool_t create_if_not_found,
- DBusError *error);
-dbus_bool_t dbus_internal_do_not_use_ensure_uuid (const char *filename,
- char **uuid_p,
- DBusError *error);
-dbus_bool_t dbus_internal_do_not_use_create_uuid (char **uuid_p);
-
-
-DBUS_END_DECLS
-
-#endif /* DBUS_UUIDGEN_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-valgrind-internal.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-valgrind-internal.h
deleted file mode 100644
index 6760b40def..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-valgrind-internal.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-valgrind-internal.h - valgrind glue
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef DBUS_VALGRIND_INTERNAL_H
-#define DBUS_VALGRIND_INTERNAL_H
-
-#include "config.h"
-#include "dbus-internals.h"
-
-#ifdef WITH_VALGRIND
-# include <memcheck.h>
-# include <valgrind.h>
-#else
-# define VALGRIND_CREATE_MEMPOOL(_1, _2, _3) do { } while (0)
-# define VALGRIND_DESTROY_MEMPOOL(_1) do { } while (0)
-# define VALGRIND_MEMPOOL_ALLOC(_1, _2, _3) do { } while (0)
-# define VALGRIND_MEMPOOL_FREE(_1, _2) do { } while (0)
-
-/* Recent gcc will warn if you have a statement that's just a macro
- * expanding to (0), but not if you have an inline stub function that
- * always returns 0, so let's do the latter. */
-static inline int
-VALGRIND_MAKE_MEM_UNDEFINED (void *addr,
- size_t len)
-{
- return 0;
-}
-
-static inline int
-VALGRIND_PRINTF (const char *format,
- ...)
-{
- return 0;
-}
-
-static inline int
-VALGRIND_PRINTF_BACKTRACE (const char *format,
- ...)
-{
- return 0;
-}
-
-# define RUNNING_ON_VALGRIND 0
-#endif /* WITH_VALGRIND */
-
-#endif /* header guard */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.c b/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.c
deleted file mode 100644
index b82c57d407..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-watch.c DBusWatch implementation
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-internals.h"
-#include "dbus-watch.h"
-#include "dbus-list.h"
-
-/**
- * @defgroup DBusWatchInternals DBusWatch implementation details
- * @ingroup DBusInternals
- * @brief implementation details for DBusWatch
- *
- * @{
- */
-
-/**
- * Implementation of DBusWatch
- */
-struct DBusWatch
-{
- int refcount; /**< Reference count */
- int fd; /**< File descriptor. */
- unsigned int flags; /**< Conditions to watch. */
-
- DBusWatchHandler handler; /**< Watch handler. */
- void *handler_data; /**< Watch handler data. */
- DBusFreeFunction free_handler_data_function; /**< Free the watch handler data. */
-
- void *data; /**< Application data. */
- DBusFreeFunction free_data_function; /**< Free the application data. */
- unsigned int enabled : 1; /**< Whether it's enabled. */
- unsigned int oom_last_time : 1; /**< Whether it was OOM last time. */
-};
-
-dbus_bool_t
-_dbus_watch_get_enabled (DBusWatch *watch)
-{
- return watch->enabled;
-}
-
-dbus_bool_t
-_dbus_watch_get_oom_last_time (DBusWatch *watch)
-{
- return watch->oom_last_time;
-}
-
-void
-_dbus_watch_set_oom_last_time (DBusWatch *watch,
- dbus_bool_t oom)
-{
- watch->oom_last_time = oom;
-}
-
-/**
- * Creates a new DBusWatch. Used to add a file descriptor to be polled
- * by a main loop.
- *
- * @param fd the file descriptor to be watched.
- * @param flags the conditions to watch for on the descriptor.
- * @param enabled the initial enabled state
- * @param handler the handler function
- * @param data data for handler function
- * @param free_data_function function to free the data
- * @returns the new DBusWatch object.
- */
-DBusWatch*
-_dbus_watch_new (int fd,
- unsigned int flags,
- dbus_bool_t enabled,
- DBusWatchHandler handler,
- void *data,
- DBusFreeFunction free_data_function)
-{
- DBusWatch *watch;
-
-#define VALID_WATCH_FLAGS (DBUS_WATCH_WRITABLE | DBUS_WATCH_READABLE)
-
- _dbus_assert ((flags & VALID_WATCH_FLAGS) == flags);
-
- watch = dbus_new0 (DBusWatch, 1);
- if (watch == NULL)
- return NULL;
-
- watch->refcount = 1;
- watch->fd = fd;
- watch->flags = flags;
- watch->enabled = enabled;
-
- watch->handler = handler;
- watch->handler_data = data;
- watch->free_handler_data_function = free_data_function;
-
- return watch;
-}
-
-/**
- * Increments the reference count of a DBusWatch object.
- *
- * @param watch the watch object.
- * @returns the watch object.
- */
-DBusWatch *
-_dbus_watch_ref (DBusWatch *watch)
-{
- watch->refcount += 1;
-
- return watch;
-}
-
-/**
- * Decrements the reference count of a DBusWatch object
- * and finalizes the object if the count reaches zero.
- *
- * @param watch the watch object.
- */
-void
-_dbus_watch_unref (DBusWatch *watch)
-{
- _dbus_assert (watch != NULL);
- _dbus_assert (watch->refcount > 0);
-
- watch->refcount -= 1;
- if (watch->refcount == 0)
- {
- if (watch->fd != -1)
- _dbus_warn ("this watch should have been invalidated");
-
- dbus_watch_set_data (watch, NULL, NULL); /* call free_data_function */
-
- if (watch->free_handler_data_function)
- (* watch->free_handler_data_function) (watch->handler_data);
-
- dbus_free (watch);
- }
-}
-
-/**
- * Clears the file descriptor from a now-invalid watch object so that
- * no one tries to use it. This is because a watch may stay alive due
- * to reference counts after the file descriptor is closed.
- * Invalidation makes it easier to catch bugs. It also
- * keeps people from doing dorky things like assuming file descriptors
- * are unique (never recycled).
- *
- * @param watch the watch object.
- */
-void
-_dbus_watch_invalidate (DBusWatch *watch)
-{
- watch->fd = -1;
- watch->flags = 0;
-}
-
-/**
- * Sanitizes the given condition so that it only contains
- * flags that the DBusWatch requested. e.g. if the
- * watch is a DBUS_WATCH_READABLE watch then
- * DBUS_WATCH_WRITABLE will be stripped from the condition.
- *
- * @param watch the watch object.
- * @param condition address of the condition to sanitize.
- */
-void
-_dbus_watch_sanitize_condition (DBusWatch *watch,
- unsigned int *condition)
-{
- if (!(watch->flags & DBUS_WATCH_READABLE))
- *condition &= ~DBUS_WATCH_READABLE;
- if (!(watch->flags & DBUS_WATCH_WRITABLE))
- *condition &= ~DBUS_WATCH_WRITABLE;
-}
-
-
-/**
- * @typedef DBusWatchList
- *
- * Opaque data type representing a list of watches
- * and a set of DBusAddWatchFunction/DBusRemoveWatchFunction.
- * Automatically handles removing/re-adding watches
- * when the DBusAddWatchFunction is updated or changed.
- * Holds a reference count to each watch.
- *
- * Used in the implementation of both DBusServer and
- * DBusClient.
- *
- */
-
-/**
- * DBusWatchList implementation details. All fields
- * are private.
- *
- */
-struct DBusWatchList
-{
- DBusList *watches; /**< Watch objects. */
-
- DBusAddWatchFunction add_watch_function; /**< Callback for adding a watch. */
- DBusRemoveWatchFunction remove_watch_function; /**< Callback for removing a watch. */
- DBusWatchToggledFunction watch_toggled_function; /**< Callback on toggling enablement */
- void *watch_data; /**< Data for watch callbacks */
- DBusFreeFunction watch_free_data_function; /**< Free function for watch callback data */
-};
-
-/**
- * Creates a new watch list. Returns #NULL if insufficient
- * memory exists.
- *
- * @returns the new watch list, or #NULL on failure.
- */
-DBusWatchList*
-_dbus_watch_list_new (void)
-{
- DBusWatchList *watch_list;
-
- watch_list = dbus_new0 (DBusWatchList, 1);
- if (watch_list == NULL)
- return NULL;
-
- return watch_list;
-}
-
-/**
- * Frees a DBusWatchList.
- *
- * @param watch_list the watch list.
- */
-void
-_dbus_watch_list_free (DBusWatchList *watch_list)
-{
- /* free watch_data and removes watches as a side effect */
- _dbus_watch_list_set_functions (watch_list,
- NULL, NULL, NULL, NULL, NULL);
- _dbus_list_foreach (&watch_list->watches,
- (DBusForeachFunction) _dbus_watch_unref,
- NULL);
- _dbus_list_clear (&watch_list->watches);
-
- dbus_free (watch_list);
-}
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-static const char*
-watch_flags_to_string (int flags)
-{
- const char *watch_type;
-
- if ((flags & DBUS_WATCH_READABLE) &&
- (flags & DBUS_WATCH_WRITABLE))
- watch_type = "readwrite";
- else if (flags & DBUS_WATCH_READABLE)
- watch_type = "read";
- else if (flags & DBUS_WATCH_WRITABLE)
- watch_type = "write";
- else
- watch_type = "not read or write";
- return watch_type;
-}
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
-/**
- * Sets the watch functions. This function is the "backend"
- * for dbus_connection_set_watch_functions() and
- * dbus_server_set_watch_functions().
- *
- * @param watch_list the watch list.
- * @param add_function the add watch function.
- * @param remove_function the remove watch function.
- * @param toggled_function function on toggling enabled flag, or #NULL
- * @param data the data for those functions.
- * @param free_data_function the function to free the data.
- * @returns #FALSE if not enough memory
- *
- */
-dbus_bool_t
-_dbus_watch_list_set_functions (DBusWatchList *watch_list,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function)
-{
- /* Add watches with the new watch function, failing on OOM */
- if (add_function != NULL)
- {
- DBusList *link;
-
- link = _dbus_list_get_first_link (&watch_list->watches);
- while (link != NULL)
- {
- DBusList *next = _dbus_list_get_next_link (&watch_list->watches,
- link);
-
- _dbus_verbose ("Adding a %s watch on fd %d using newly-set add watch function\n",
- watch_flags_to_string (dbus_watch_get_flags (link->data)),
- dbus_watch_get_socket (link->data));
-
- if (!(* add_function) (link->data, data))
- {
- /* remove it all again and return FALSE */
- DBusList *link2;
-
- link2 = _dbus_list_get_first_link (&watch_list->watches);
- while (link2 != link)
- {
- DBusList *next = _dbus_list_get_next_link (&watch_list->watches,
- link2);
-
- _dbus_verbose ("Removing watch on fd %d using newly-set remove function because initial add failed\n",
- dbus_watch_get_socket (link2->data));
-
- (* remove_function) (link2->data, data);
-
- link2 = next;
- }
-
- return FALSE;
- }
-
- link = next;
- }
- }
-
- /* Remove all current watches from previous watch handlers */
-
- if (watch_list->remove_watch_function != NULL)
- {
- _dbus_verbose ("Removing all pre-existing watches\n");
-
- _dbus_list_foreach (&watch_list->watches,
- (DBusForeachFunction) watch_list->remove_watch_function,
- watch_list->watch_data);
- }
-
- if (watch_list->watch_free_data_function != NULL)
- (* watch_list->watch_free_data_function) (watch_list->watch_data);
-
- watch_list->add_watch_function = add_function;
- watch_list->remove_watch_function = remove_function;
- watch_list->watch_toggled_function = toggled_function;
- watch_list->watch_data = data;
- watch_list->watch_free_data_function = free_data_function;
-
- return TRUE;
-}
-
-/**
- * Adds a new watch to the watch list, invoking the
- * application DBusAddWatchFunction if appropriate.
- *
- * @param watch_list the watch list.
- * @param watch the watch to add.
- * @returns #TRUE on success, #FALSE if no memory.
- */
-dbus_bool_t
-_dbus_watch_list_add_watch (DBusWatchList *watch_list,
- DBusWatch *watch)
-{
- if (!_dbus_list_append (&watch_list->watches, watch))
- return FALSE;
-
- _dbus_watch_ref (watch);
-
- if (watch_list->add_watch_function != NULL)
- {
- _dbus_verbose ("Adding watch on fd %d\n",
- dbus_watch_get_socket (watch));
-
- if (!(* watch_list->add_watch_function) (watch,
- watch_list->watch_data))
- {
- _dbus_list_remove_last (&watch_list->watches, watch);
- _dbus_watch_unref (watch);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- * Removes a watch from the watch list, invoking the
- * application's DBusRemoveWatchFunction if appropriate.
- *
- * @param watch_list the watch list.
- * @param watch the watch to remove.
- */
-void
-_dbus_watch_list_remove_watch (DBusWatchList *watch_list,
- DBusWatch *watch)
-{
- if (!_dbus_list_remove (&watch_list->watches, watch))
- _dbus_assert_not_reached ("Nonexistent watch was removed");
-
- if (watch_list->remove_watch_function != NULL)
- {
- _dbus_verbose ("Removing watch on fd %d\n",
- dbus_watch_get_socket (watch));
-
- (* watch_list->remove_watch_function) (watch,
- watch_list->watch_data);
- }
-
- _dbus_watch_unref (watch);
-}
-
-/**
- * Sets a watch to the given enabled state, invoking the
- * application's DBusWatchToggledFunction if appropriate.
- *
- * @param watch_list the watch list.
- * @param watch the watch to toggle.
- * @param enabled #TRUE to enable
- */
-void
-_dbus_watch_list_toggle_watch (DBusWatchList *watch_list,
- DBusWatch *watch,
- dbus_bool_t enabled)
-{
- enabled = !!enabled;
-
- if (enabled == watch->enabled)
- return;
-
- watch->enabled = enabled;
-
- if (watch_list->watch_toggled_function != NULL)
- {
- _dbus_verbose ("Toggling watch %p on fd %d to %d\n",
- watch, dbus_watch_get_socket (watch), watch->enabled);
-
- (* watch_list->watch_toggled_function) (watch,
- watch_list->watch_data);
- }
-}
-
-/**
- * Sets the handler for the watch.
- *
- * @todo this function only exists because of the weird
- * way connection watches are done, see the note
- * in docs for _dbus_connection_handle_watch().
- *
- * @param watch the watch
- * @param handler the new handler
- * @param data the data
- * @param free_data_function free data with this
- */
-void
-_dbus_watch_set_handler (DBusWatch *watch,
- DBusWatchHandler handler,
- void *data,
- DBusFreeFunction free_data_function)
-{
- if (watch->free_handler_data_function)
- (* watch->free_handler_data_function) (watch->handler_data);
-
- watch->handler = handler;
- watch->handler_data = data;
- watch->free_handler_data_function = free_data_function;
-}
-
-/** @} */
-
-/**
- * @defgroup DBusWatch DBusWatch
- * @ingroup DBus
- * @brief Object representing a file descriptor to be watched.
- *
- * Types and functions related to DBusWatch. A watch represents
- * a file descriptor that the main loop needs to monitor,
- * as in Qt's QSocketNotifier or GLib's g_io_add_watch().
- *
- * Use dbus_connection_set_watch_functions() or dbus_server_set_watch_functions()
- * to be notified when libdbus needs to add or remove watches.
- *
- * @{
- */
-
-/**
- * @typedef DBusWatch
- *
- * Opaque object representing a file descriptor
- * to be watched for changes in readability,
- * writability, or hangup.
- */
-
-/**
- * Deprecated former name of dbus_watch_get_unix_fd().
- *
- * @param watch the DBusWatch object.
- * @returns the file descriptor to watch.
- */
-int
-dbus_watch_get_fd (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, -1);
-
- return dbus_watch_get_unix_fd(watch);
-}
-
-/**
- * Returns a UNIX file descriptor to be watched,
- * which may be a pipe, socket, or other type of
- * descriptor. On UNIX this is preferred to
- * dbus_watch_get_socket() since it works with
- * more kinds of #DBusWatch.
- *
- * Always returns -1 on Windows. On Windows you use
- * dbus_watch_get_socket() to get a Winsock socket to watch.
- *
- * @param watch the DBusWatch object.
- * @returns the file descriptor to watch.
- */
-int
-dbus_watch_get_unix_fd (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, -1);
-
- /* FIXME remove #ifdef and do this on a lower level
- * (watch should have set_socket and set_unix_fd and track
- * which it has, and the transport should provide the
- * appropriate watch type)
- */
-#ifdef DBUS_UNIX
- return watch->fd;
-#else
- return dbus_watch_get_socket( watch );
-#endif
-}
-
-/**
- * Returns a socket to be watched, on UNIX this will return -1 if our
- * transport is not socket-based so dbus_watch_get_unix_fd() is
- * preferred.
- *
- * On Windows, dbus_watch_get_unix_fd() returns -1 but this function
- * returns a Winsock socket (assuming the transport is socket-based,
- * as it always is for now).
- *
- * @param watch the DBusWatch object.
- * @returns the socket to watch.
- */
-int
-dbus_watch_get_socket (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, -1);
-
- return watch->fd;
-}
-
-/**
- * Gets flags from DBusWatchFlags indicating
- * what conditions should be monitored on the
- * file descriptor.
- *
- * The flags returned will only contain DBUS_WATCH_READABLE
- * and DBUS_WATCH_WRITABLE, never DBUS_WATCH_HANGUP or
- * DBUS_WATCH_ERROR; all watches implicitly include a watch
- * for hangups, errors, and other exceptional conditions.
- *
- * @param watch the DBusWatch object.
- * @returns the conditions to watch.
- */
-unsigned int
-dbus_watch_get_flags (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, 0);
- _dbus_assert ((watch->flags & VALID_WATCH_FLAGS) == watch->flags);
-
- return watch->flags;
-}
-
-/**
- * Gets data previously set with dbus_watch_set_data()
- * or #NULL if none.
- *
- * @param watch the DBusWatch object.
- * @returns previously-set data.
- */
-void*
-dbus_watch_get_data (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, NULL);
-
- return watch->data;
-}
-
-/**
- * Sets data which can be retrieved with dbus_watch_get_data().
- * Intended for use by the DBusAddWatchFunction and
- * DBusRemoveWatchFunction to store their own data. For example with
- * Qt you might store the QSocketNotifier for this watch and with GLib
- * you might store a GSource.
- *
- * @param watch the DBusWatch object.
- * @param data the data.
- * @param free_data_function function to be called to free the data.
- */
-void
-dbus_watch_set_data (DBusWatch *watch,
- void *data,
- DBusFreeFunction free_data_function)
-{
- _dbus_return_if_fail (watch != NULL);
-
- _dbus_verbose ("Setting watch fd %d data to data = %p function = %p from data = %p function = %p\n",
- dbus_watch_get_socket (watch),
- data, free_data_function, watch->data, watch->free_data_function);
-
- if (watch->free_data_function != NULL)
- (* watch->free_data_function) (watch->data);
-
- watch->data = data;
- watch->free_data_function = free_data_function;
-}
-
-/**
- * Returns whether a watch is enabled or not. If not
- * enabled, it should not be polled by the main loop.
- *
- * @param watch the DBusWatch object
- * @returns #TRUE if the watch is enabled
- */
-dbus_bool_t
-dbus_watch_get_enabled (DBusWatch *watch)
-{
- _dbus_return_val_if_fail (watch != NULL, FALSE);
-
- return watch->enabled;
-}
-
-
-/**
- * Called to notify the D-Bus library when a previously-added watch is
- * ready for reading or writing, or has an exception such as a hangup.
- *
- * If this function returns #FALSE, then the file descriptor may still
- * be ready for reading or writing, but more memory is needed in order
- * to do the reading or writing. If you ignore the #FALSE return, your
- * application may spin in a busy loop on the file descriptor until
- * memory becomes available, but nothing more catastrophic should
- * happen.
- *
- * dbus_watch_handle() cannot be called during the
- * DBusAddWatchFunction, as the connection will not be ready to handle
- * that watch yet.
- *
- * It is not allowed to reference a DBusWatch after it has been passed
- * to remove_function.
- *
- * @param watch the DBusWatch object.
- * @param flags the poll condition using #DBusWatchFlags values
- * @returns #FALSE if there wasn't enough memory
- */
-dbus_bool_t
-dbus_watch_handle (DBusWatch *watch,
- unsigned int flags)
-{
- _dbus_return_val_if_fail (watch != NULL, FALSE);
-
-#ifndef DBUS_DISABLE_CHECKS
- if (watch->fd < 0 || watch->flags == 0)
- {
- _dbus_warn_check_failed ("Watch is invalid, it should have been removed\n");
- return TRUE;
- }
-#endif
-
- _dbus_return_val_if_fail (watch->fd >= 0 /* fails if watch was removed */, TRUE);
-
- _dbus_watch_sanitize_condition (watch, &flags);
-
- if (flags == 0)
- {
- _dbus_verbose ("After sanitization, watch flags on fd %d were 0\n",
- watch->fd);
- return TRUE;
- }
- else
- return (* watch->handler) (watch, flags,
- watch->handler_data);
-}
-
-
-/** @} */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.h b/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.h
deleted file mode 100644
index c583214140..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus-watch.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-watch.h DBusWatch internal interfaces
- *
- * Copyright (C) 2002 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_WATCH_H
-#define DBUS_WATCH_H
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-connection.h>
-
-DBUS_BEGIN_DECLS
-
-/**
- * @addtogroup DBusWatchInternals
- * @{
- */
-
-/* Public methods on DBusWatch are in dbus-connection.h */
-
-typedef struct DBusWatchList DBusWatchList;
-
-#define _DBUS_WATCH_NVAL (1<<4)
-
-/** function to run when the watch is handled */
-typedef dbus_bool_t (* DBusWatchHandler) (DBusWatch *watch,
- unsigned int flags,
- void *data);
-
-DBusWatch* _dbus_watch_new (int fd,
- unsigned int flags,
- dbus_bool_t enabled,
- DBusWatchHandler handler,
- void *data,
- DBusFreeFunction free_data_function);
-DBusWatch* _dbus_watch_ref (DBusWatch *watch);
-void _dbus_watch_unref (DBusWatch *watch);
-void _dbus_watch_invalidate (DBusWatch *watch);
-void _dbus_watch_sanitize_condition (DBusWatch *watch,
- unsigned int *condition);
-void _dbus_watch_set_handler (DBusWatch *watch,
- DBusWatchHandler handler,
- void *data,
- DBusFreeFunction free_data_function);
-
-
-DBusWatchList* _dbus_watch_list_new (void);
-void _dbus_watch_list_free (DBusWatchList *watch_list);
-dbus_bool_t _dbus_watch_list_set_functions (DBusWatchList *watch_list,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function);
-dbus_bool_t _dbus_watch_list_add_watch (DBusWatchList *watch_list,
- DBusWatch *watch);
-void _dbus_watch_list_remove_watch (DBusWatchList *watch_list,
- DBusWatch *watch);
-void _dbus_watch_list_toggle_watch (DBusWatchList *watch_list,
- DBusWatch *watch,
- dbus_bool_t enabled);
-dbus_bool_t _dbus_watch_get_enabled (DBusWatch *watch);
-
-dbus_bool_t _dbus_watch_get_oom_last_time (DBusWatch *watch);
-void _dbus_watch_set_oom_last_time (DBusWatch *watch,
- dbus_bool_t oom);
-
-/** @} */
-
-DBUS_END_DECLS
-
-#endif /* DBUS_WATCH_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/dbus.h b/src/3rd_party/dbus-1.7.8/dbus/dbus.h
deleted file mode 100644
index 932ceab383..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/dbus.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus.h Convenience header including all other headers
- *
- * Copyright (C) 2002, 2003 Red Hat Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_H
-#define DBUS_H
-
-#define DBUS_INSIDE_DBUS_H 1
-
-#include <dbus/dbus-arch-deps.h>
-#include <dbus/dbus-address.h>
-#include <dbus/dbus-bus.h>
-#include <dbus/dbus-connection.h>
-#include <dbus/dbus-errors.h>
-#include <dbus/dbus-macros.h>
-#include <dbus/dbus-message.h>
-#include <dbus/dbus-misc.h>
-#include <dbus/dbus-pending-call.h>
-#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-server.h>
-#include <dbus/dbus-shared.h>
-#include <dbus/dbus-signature.h>
-#include <dbus/dbus-syntax.h>
-#include <dbus/dbus-threads.h>
-#include <dbus/dbus-types.h>
-
-#undef DBUS_INSIDE_DBUS_H
-
-/**
- * @defgroup DBus D-Bus low-level public API
- * @brief The low-level public API of the D-Bus library
- *
- * libdbus provides a low-level C API intended primarily for use by
- * bindings to specific object systems and languages. D-Bus is most
- * convenient when used with the GLib bindings, Python bindings, Qt
- * bindings, Mono bindings, and so forth. This low-level API has a
- * lot of complexity useful only for bindings.
- *
- * @{
- */
-
-/** @} */
-
-/**
- * @mainpage
- *
- * This manual documents the <em>low-level</em> D-Bus C API. <b>If you use
- * this low-level API directly, you're signing up for some pain.</b>
- *
- * Caveats aside, you might get started learning the low-level API by reading
- * about @ref DBusConnection and @ref DBusMessage.
- *
- * There are several other places to look for D-Bus information, such
- * as the tutorial and the specification; those can be found at <a
- * href="http://www.freedesktop.org/wiki/Software/dbus">the D-Bus
- * website</a>. If you're interested in a sysadmin or package
- * maintainer's perspective on the dbus-daemon itself and its
- * configuration, be sure to check out the man pages as well.
- *
- * The low-level API documented in this manual deliberately lacks
- * most convenience functions - those are left up to higher-level libraries
- * based on frameworks such as GLib, Qt, Python, Mono, Java,
- * etc. These higher-level libraries (often called "D-Bus bindings")
- * have features such as object systems and main loops that allow a
- * <em>much</em> more convenient API.
- *
- * The low-level API also contains plenty of clutter to support
- * integration with arbitrary object systems, languages, main loops,
- * and so forth. These features add a lot of noise to the API that you
- * probably don't care about unless you're coding a binding.
- *
- * This manual also contains docs for @ref DBusInternals "D-Bus internals",
- * so you can use it to get oriented to the D-Bus source code if you're
- * interested in patching the code. You should also read the
- * file HACKING which comes with the source code if you plan to contribute to
- * D-Bus.
- *
- * As you read the code, you can identify internal D-Bus functions
- * because they start with an underscore ('_') character. Also, any
- * identifier or macro that lacks a DBus, dbus_, or DBUS_ namepace
- * prefix is internal, with a couple of exceptions such as #NULL,
- * #TRUE, and #FALSE.
- */
-
-#endif /* DBUS_H */
diff --git a/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.c b/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.c
deleted file mode 100644
index 485b301023..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
- Copyright 2010 Lennart Poettering
-
- 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.
-***/
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <limits.h>
-
-#if defined(__linux__) && !defined(SD_DAEMON_DISABLE_MQ)
-# include <mqueue.h>
-#endif
-
-#include "sd-daemon.h"
-
-#if (__GNUC__ >= 4)
-# ifdef SD_EXPORT_SYMBOLS
-/* Export symbols */
-# define _sd_export_ __attribute__ ((visibility("default")))
-# else
-/* Don't export the symbols */
-# define _sd_export_ __attribute__ ((visibility("hidden")))
-# endif
-#else
-# define _sd_export_
-#endif
-
-_sd_export_ int sd_listen_fds(int unset_environment) {
-
-#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
- return 0;
-#else
- int r, fd;
- const char *e;
- char *p = NULL;
- unsigned long l;
-
- e = getenv("LISTEN_PID");
- if (!e) {
- r = 0;
- goto finish;
- }
-
- errno = 0;
- l = strtoul(e, &p, 10);
-
- if (errno > 0) {
- r = -errno;
- goto finish;
- }
-
- if (!p || p == e || *p || l <= 0) {
- r = -EINVAL;
- goto finish;
- }
-
- /* Is this for us? */
- if (getpid() != (pid_t) l) {
- r = 0;
- goto finish;
- }
-
- e = getenv("LISTEN_FDS");
- if (!e) {
- r = 0;
- goto finish;
- }
-
- errno = 0;
- l = strtoul(e, &p, 10);
-
- if (errno > 0) {
- r = -errno;
- goto finish;
- }
-
- if (!p || p == e || *p) {
- r = -EINVAL;
- goto finish;
- }
-
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) {
- int flags;
-
- flags = fcntl(fd, F_GETFD);
- if (flags < 0) {
- r = -errno;
- goto finish;
- }
-
- if (flags & FD_CLOEXEC)
- continue;
-
- if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
- r = -errno;
- goto finish;
- }
- }
-
- r = (int) l;
-
-finish:
- if (unset_environment) {
- unsetenv("LISTEN_PID");
- unsetenv("LISTEN_FDS");
- }
-
- return r;
-#endif
-}
-
-_sd_export_ int sd_is_fifo(int fd, const char *path) {
- struct stat st_fd;
-
- if (fd < 0)
- return -EINVAL;
-
- if (fstat(fd, &st_fd) < 0)
- return -errno;
-
- if (!S_ISFIFO(st_fd.st_mode))
- return 0;
-
- if (path) {
- struct stat st_path;
-
- if (stat(path, &st_path) < 0) {
-
- if (errno == ENOENT || errno == ENOTDIR)
- return 0;
-
- return -errno;
- }
-
- return
- st_path.st_dev == st_fd.st_dev &&
- st_path.st_ino == st_fd.st_ino;
- }
-
- return 1;
-}
-
-_sd_export_ int sd_is_special(int fd, const char *path) {
- struct stat st_fd;
-
- if (fd < 0)
- return -EINVAL;
-
- if (fstat(fd, &st_fd) < 0)
- return -errno;
-
- if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode))
- return 0;
-
- if (path) {
- struct stat st_path;
-
- if (stat(path, &st_path) < 0) {
-
- if (errno == ENOENT || errno == ENOTDIR)
- return 0;
-
- return -errno;
- }
-
- if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode))
- return
- st_path.st_dev == st_fd.st_dev &&
- st_path.st_ino == st_fd.st_ino;
- else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
- return st_path.st_rdev == st_fd.st_rdev;
- else
- return 0;
- }
-
- return 1;
-}
-
-static int sd_is_socket_internal(int fd, int type, int listening) {
- struct stat st_fd;
-
- if (fd < 0 || type < 0)
- return -EINVAL;
-
- if (fstat(fd, &st_fd) < 0)
- return -errno;
-
- if (!S_ISSOCK(st_fd.st_mode))
- return 0;
-
- if (type != 0) {
- int other_type = 0;
- socklen_t l = sizeof(other_type);
-
- if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0)
- return -errno;
-
- if (l != sizeof(other_type))
- return -EINVAL;
-
- if (other_type != type)
- return 0;
- }
-
- if (listening >= 0) {
- int accepting = 0;
- socklen_t l = sizeof(accepting);
-
- if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0)
- return -errno;
-
- if (l != sizeof(accepting))
- return -EINVAL;
-
- if (!accepting != !listening)
- return 0;
- }
-
- return 1;
-}
-
-union sockaddr_union {
- struct sockaddr sa;
- struct sockaddr_in in4;
- struct sockaddr_in6 in6;
- struct sockaddr_un un;
- struct sockaddr_storage storage;
-};
-
-_sd_export_ int sd_is_socket(int fd, int family, int type, int listening) {
- int r;
-
- if (family < 0)
- return -EINVAL;
-
- r = sd_is_socket_internal(fd, type, listening);
- if (r <= 0)
- return r;
-
- if (family > 0) {
- union sockaddr_union sockaddr = {};
- socklen_t l = sizeof(sockaddr);
-
- if (getsockname(fd, &sockaddr.sa, &l) < 0)
- return -errno;
-
- if (l < sizeof(sa_family_t))
- return -EINVAL;
-
- return sockaddr.sa.sa_family == family;
- }
-
- return 1;
-}
-
-_sd_export_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
- union sockaddr_union sockaddr = {};
- socklen_t l = sizeof(sockaddr);
- int r;
-
- if (family != 0 && family != AF_INET && family != AF_INET6)
- return -EINVAL;
-
- r = sd_is_socket_internal(fd, type, listening);
- if (r <= 0)
- return r;
-
- if (getsockname(fd, &sockaddr.sa, &l) < 0)
- return -errno;
-
- if (l < sizeof(sa_family_t))
- return -EINVAL;
-
- if (sockaddr.sa.sa_family != AF_INET &&
- sockaddr.sa.sa_family != AF_INET6)
- return 0;
-
- if (family > 0)
- if (sockaddr.sa.sa_family != family)
- return 0;
-
- if (port > 0) {
- if (sockaddr.sa.sa_family == AF_INET) {
- if (l < sizeof(struct sockaddr_in))
- return -EINVAL;
-
- return htons(port) == sockaddr.in4.sin_port;
- } else {
- if (l < sizeof(struct sockaddr_in6))
- return -EINVAL;
-
- return htons(port) == sockaddr.in6.sin6_port;
- }
- }
-
- return 1;
-}
-
-_sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
- union sockaddr_union sockaddr = {};
- socklen_t l = sizeof(sockaddr);
- int r;
-
- r = sd_is_socket_internal(fd, type, listening);
- if (r <= 0)
- return r;
-
- if (getsockname(fd, &sockaddr.sa, &l) < 0)
- return -errno;
-
- if (l < sizeof(sa_family_t))
- return -EINVAL;
-
- if (sockaddr.sa.sa_family != AF_UNIX)
- return 0;
-
- if (path) {
- if (length == 0)
- length = strlen(path);
-
- if (length == 0)
- /* Unnamed socket */
- return l == offsetof(struct sockaddr_un, sun_path);
-
- if (path[0])
- /* Normal path socket */
- return
- (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) &&
- memcmp(path, sockaddr.un.sun_path, length+1) == 0;
- else
- /* Abstract namespace socket */
- return
- (l == offsetof(struct sockaddr_un, sun_path) + length) &&
- memcmp(path, sockaddr.un.sun_path, length) == 0;
- }
-
- return 1;
-}
-
-_sd_export_ int sd_is_mq(int fd, const char *path) {
-#if !defined(__linux__) || defined(SD_DAEMON_DISABLE_MQ)
- return 0;
-#else
- struct mq_attr attr;
-
- if (fd < 0)
- return -EINVAL;
-
- if (mq_getattr(fd, &attr) < 0)
- return -errno;
-
- if (path) {
- char fpath[PATH_MAX];
- struct stat a, b;
-
- if (path[0] != '/')
- return -EINVAL;
-
- if (fstat(fd, &a) < 0)
- return -errno;
-
- strncpy(stpcpy(fpath, "/dev/mqueue"), path, sizeof(fpath) - 12);
- fpath[sizeof(fpath)-1] = 0;
-
- if (stat(fpath, &b) < 0)
- return -errno;
-
- if (a.st_dev != b.st_dev ||
- a.st_ino != b.st_ino)
- return 0;
- }
-
- return 1;
-#endif
-}
-
-_sd_export_ int sd_notify(int unset_environment, const char *state) {
-#if defined(DISABLE_SYSTEMD) || !defined(__linux__) || !defined(SOCK_CLOEXEC)
- return 0;
-#else
- int fd = -1, r;
- struct msghdr msghdr;
- struct iovec iovec;
- union sockaddr_union sockaddr;
- const char *e;
-
- if (!state) {
- r = -EINVAL;
- goto finish;
- }
-
- e = getenv("NOTIFY_SOCKET");
- if (!e)
- return 0;
-
- /* Must be an abstract socket, or an absolute path */
- if ((e[0] != '@' && e[0] != '/') || e[1] == 0) {
- r = -EINVAL;
- goto finish;
- }
-
- fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd < 0) {
- r = -errno;
- goto finish;
- }
-
- memset(&sockaddr, 0, sizeof(sockaddr));
- sockaddr.sa.sa_family = AF_UNIX;
- strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));
-
- if (sockaddr.un.sun_path[0] == '@')
- sockaddr.un.sun_path[0] = 0;
-
- memset(&iovec, 0, sizeof(iovec));
- iovec.iov_base = (char*) state;
- iovec.iov_len = strlen(state);
-
- memset(&msghdr, 0, sizeof(msghdr));
- msghdr.msg_name = &sockaddr;
- msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
-
- if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
- msghdr.msg_namelen = sizeof(struct sockaddr_un);
-
- msghdr.msg_iov = &iovec;
- msghdr.msg_iovlen = 1;
-
- if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) {
- r = -errno;
- goto finish;
- }
-
- r = 1;
-
-finish:
- if (unset_environment)
- unsetenv("NOTIFY_SOCKET");
-
- if (fd >= 0)
- close(fd);
-
- return r;
-#endif
-}
-
-_sd_export_ int sd_notifyf(int unset_environment, const char *format, ...) {
-#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
- return 0;
-#else
- va_list ap;
- char *p = NULL;
- int r;
-
- va_start(ap, format);
- r = vasprintf(&p, format, ap);
- va_end(ap);
-
- if (r < 0 || !p)
- return -ENOMEM;
-
- r = sd_notify(unset_environment, p);
- free(p);
-
- return r;
-#endif
-}
-
-_sd_export_ int sd_booted(void) {
-#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
- return 0;
-#else
- struct stat st;
-
- /* We test whether the runtime unit file directory has been
- * created. This takes place in mount-setup.c, so is
- * guaranteed to happen very early during boot. */
-
- if (lstat("/run/systemd/system/", &st) < 0)
- return 0;
-
- return !!S_ISDIR(st.st_mode);
-#endif
-}
diff --git a/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.h b/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.h
deleted file mode 100644
index fb7456d50f..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/sd-daemon.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#ifndef foosddaemonhfoo
-#define foosddaemonhfoo
-
-/***
- Copyright 2010 Lennart Poettering
-
- 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.
-***/
-
-#include <sys/types.h>
-#include <inttypes.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- Reference implementation of a few systemd related interfaces for
- writing daemons. These interfaces are trivial to implement. To
- simplify porting we provide this reference implementation.
- Applications are welcome to reimplement the algorithms described
- here if they do not want to include these two source files.
-
- The following functionality is provided:
-
- - Support for logging with log levels on stderr
- - File descriptor passing for socket-based activation
- - Daemon startup and status notification
- - Detection of systemd boots
-
- You may compile this with -DDISABLE_SYSTEMD to disable systemd
- support. This makes all those calls NOPs that are directly related to
- systemd (i.e. only sd_is_xxx() will stay useful).
-
- Since this is drop-in code we don't want any of our symbols to be
- exported in any case. Hence we declare hidden visibility for all of
- them.
-
- You may find an up-to-date version of these source files online:
-
- http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h
- http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c
-
- This should compile on non-Linux systems, too, but with the
- exception of the sd_is_xxx() calls all functions will become NOPs.
-
- See sd-daemon(3) for more information.
-*/
-
-#ifndef _sd_printf_attr_
-#if __GNUC__ >= 4
-#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
-#else
-#define _sd_printf_attr_(a,b)
-#endif
-#endif
-
-/*
- Log levels for usage on stderr:
-
- fprintf(stderr, SD_NOTICE "Hello World!\n");
-
- This is similar to printk() usage in the kernel.
-*/
-#define SD_EMERG "<0>" /* system is unusable */
-#define SD_ALERT "<1>" /* action must be taken immediately */
-#define SD_CRIT "<2>" /* critical conditions */
-#define SD_ERR "<3>" /* error conditions */
-#define SD_WARNING "<4>" /* warning conditions */
-#define SD_NOTICE "<5>" /* normal but significant condition */
-#define SD_INFO "<6>" /* informational */
-#define SD_DEBUG "<7>" /* debug-level messages */
-
-/* The first passed file descriptor is fd 3 */
-#define SD_LISTEN_FDS_START 3
-
-/*
- Returns how many file descriptors have been passed, or a negative
- errno code on failure. Optionally, removes the $LISTEN_FDS and
- $LISTEN_PID file descriptors from the environment (recommended, but
- problematic in threaded environments). If r is the return value of
- this function you'll find the file descriptors passed as fds
- SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative
- errno style error code on failure. This function call ensures that
- the FD_CLOEXEC flag is set for the passed file descriptors, to make
- sure they are not passed on to child processes. If FD_CLOEXEC shall
- not be set, the caller needs to unset it after this call for all file
- descriptors that are used.
-
- See sd_listen_fds(3) for more information.
-*/
-int sd_listen_fds(int unset_environment);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is a FIFO in the file system stored under the
- specified path, 0 otherwise. If path is NULL a path name check will
- not be done and the call only verifies if the file descriptor
- refers to a FIFO. Returns a negative errno style error code on
- failure.
-
- See sd_is_fifo(3) for more information.
-*/
-int sd_is_fifo(int fd, const char *path);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is a special character device on the file
- system stored under the specified path, 0 otherwise.
- If path is NULL a path name check will not be done and the call
- only verifies if the file descriptor refers to a special character.
- Returns a negative errno style error code on failure.
-
- See sd_is_special(3) for more information.
-*/
-int sd_is_special(int fd, const char *path);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is a socket of the specified family (AF_INET,
- ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If
- family is 0 a socket family check will not be done. If type is 0 a
- socket type check will not be done and the call only verifies if
- the file descriptor refers to a socket. If listening is > 0 it is
- verified that the socket is in listening mode. (i.e. listen() has
- been called) If listening is == 0 it is verified that the socket is
- not in listening mode. If listening is < 0 no listening mode check
- is done. Returns a negative errno style error code on failure.
-
- See sd_is_socket(3) for more information.
-*/
-int sd_is_socket(int fd, int family, int type, int listening);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is an Internet socket, of the specified family
- (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM,
- SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version
- check is not done. If type is 0 a socket type check will not be
- done. If port is 0 a socket port check will not be done. The
- listening flag is used the same way as in sd_is_socket(). Returns a
- negative errno style error code on failure.
-
- See sd_is_socket_inet(3) for more information.
-*/
-int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is an AF_UNIX socket of the specified type
- (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0
- a socket type check will not be done. If path is NULL a socket path
- check will not be done. For normal AF_UNIX sockets set length to
- 0. For abstract namespace sockets set length to the length of the
- socket name (including the initial 0 byte), and pass the full
- socket path in path (including the initial 0 byte). The listening
- flag is used the same way as in sd_is_socket(). Returns a negative
- errno style error code on failure.
-
- See sd_is_socket_unix(3) for more information.
-*/
-int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
-
-/*
- Helper call for identifying a passed file descriptor. Returns 1 if
- the file descriptor is a POSIX Message Queue of the specified name,
- 0 otherwise. If path is NULL a message queue name check is not
- done. Returns a negative errno style error code on failure.
-*/
-int sd_is_mq(int fd, const char *path);
-
-/*
- Informs systemd about changed daemon state. This takes a number of
- newline separated environment-style variable assignments in a
- string. The following variables are known:
-
- READY=1 Tells systemd that daemon startup is finished (only
- relevant for services of Type=notify). The passed
- argument is a boolean "1" or "0". Since there is
- little value in signaling non-readiness the only
- value daemons should send is "READY=1".
-
- STATUS=... Passes a single-line status string back to systemd
- that describes the daemon state. This is free-from
- and can be used for various purposes: general state
- feedback, fsck-like programs could pass completion
- percentages and failing programs could pass a human
- readable error message. Example: "STATUS=Completed
- 66% of file system check..."
-
- ERRNO=... If a daemon fails, the errno-style error code,
- formatted as string. Example: "ERRNO=2" for ENOENT.
-
- BUSERROR=... If a daemon fails, the D-Bus error-style error
- code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut"
-
- MAINPID=... The main pid of a daemon, in case systemd did not
- fork off the process itself. Example: "MAINPID=4711"
-
- WATCHDOG=1 Tells systemd to update the watchdog timestamp.
- Services using this feature should do this in
- regular intervals. A watchdog framework can use the
- timestamps to detect failed services.
-
- Daemons can choose to send additional variables. However, it is
- recommended to prefix variable names not listed above with X_.
-
- Returns a negative errno-style error code on failure. Returns > 0
- if systemd could be notified, 0 if it couldn't possibly because
- systemd is not running.
-
- Example: When a daemon finished starting up, it could issue this
- call to notify systemd about it:
-
- sd_notify(0, "READY=1");
-
- See sd_notifyf() for more complete examples.
-
- See sd_notify(3) for more information.
-*/
-int sd_notify(int unset_environment, const char *state);
-
-/*
- Similar to sd_notify() but takes a format string.
-
- Example 1: A daemon could send the following after initialization:
-
- sd_notifyf(0, "READY=1\n"
- "STATUS=Processing requests...\n"
- "MAINPID=%lu",
- (unsigned long) getpid());
-
- Example 2: A daemon could send the following shortly before
- exiting, on failure:
-
- sd_notifyf(0, "STATUS=Failed to start up: %s\n"
- "ERRNO=%i",
- strerror(errno),
- errno);
-
- See sd_notifyf(3) for more information.
-*/
-int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
-
-/*
- Returns > 0 if the system was booted with systemd. Returns < 0 on
- error. Returns 0 if the system was not booted with systemd. Note
- that all of the functions above handle non-systemd boots just
- fine. You should NOT protect them with a call to this function. Also
- note that this function checks whether the system, not the user
- session is controlled by systemd. However the functions above work
- for both user and system services.
-
- See sd_booted(3) for more information.
-*/
-int sd_booted(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/dbus/versioninfo.rc.in b/src/3rd_party/dbus-1.7.8/dbus/versioninfo.rc.in
deleted file mode 100644
index b745b39abd..0000000000
--- a/src/3rd_party/dbus-1.7.8/dbus/versioninfo.rc.in
+++ /dev/null
@@ -1,52 +0,0 @@
-/* versioninfo.rc.in - for dbus
- * Copyright (C) 2005 g10 Code GmbH
- *
- * This file is free software; as a special exception the author gives
- * unlimited permission to copy and/or distribute it, with or without
- * modifications, as long as this notice is preserved.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* This file is processed by configure to create versioninfo.rc */
-
-#line __LINE__ "versioninfo.rc.in"
-
-#include <afxres.h>
-
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION @BUILD_FILEVERSION@
- PRODUCTVERSION @BUILD_FILEVERSION@
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x21L
-#else
- FILEFLAGS 0x20L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "Provided under the terms of the GNU Lesser General Public License.\0"
- VALUE "CompanyName", "FreeDesktop.org\0"
- VALUE "FileDescription", "dbus - FreeDesktop message bus system\0"
- VALUE "FileVersion", "@DBUS_VERSION@\0"
- VALUE "InternalName", "dbus\0"
- VALUE "LegalCopyright", "Copyright 2009 FreeDesktop.org\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "dbus-1.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "dbus\0"
- VALUE "ProductVersion", "@DBUS_VERSION@\0"
- VALUE "SpecialBuild", "@BUILD_TIMESTAMP@\0"
- END
- END
-END
-
diff --git a/src/3rd_party/dbus-1.7.8/depcomp b/src/3rd_party/dbus-1.7.8/depcomp
deleted file mode 100755
index 4ebd5b3a2f..0000000000
--- a/src/3rd_party/dbus-1.7.8/depcomp
+++ /dev/null
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say). Also, it might not be
-## supported by the other compilers which use the 'gcc' depmode.
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The second -e expression handles DOS-style file names with drive
- # letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
-## Some versions of gcc put a space before the ':'. On the theory
-## that the space means something, we add a space to the output as
-## well. hp depmode also adds that space, but also prefixes the VPATH
-## to the object. Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like '#:fec' to the end of the
- # dependency line.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
- | tr "$nl" ' ' >> "$depfile"
- echo >> "$depfile"
- # The second pass generates a dummy entry for each header file.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile"
- ;;
-
-xlc)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts '$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- aix_post_process_depfile
- ;;
-
-tcc)
- # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
- # FIXME: That version still under development at the moment of writing.
- # Make that this statement remains true also for stable, released
- # versions.
- # It will wrap lines (doesn't matter whether long or short) with a
- # trailing '\', as in:
- #
- # foo.o : \
- # foo.c \
- # foo.h \
- #
- # It will put a trailing '\' even on the last line, and will use leading
- # spaces rather than leading tabs (at least since its commit 0394caf7
- # "Emit spaces for -MD").
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
- # We have to change lines of the first kind to '$object: \'.
- sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
- # And for each line of the second kind, we have to emit a 'dep.h:'
- # dummy dependency, to avoid the deleted-header problem.
- sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file. A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
- # Portland's C compiler understands '-MD'.
- # Will always output deps to 'file.d' where file is the root name of the
- # source file under compilation, even if file resides in a subdirectory.
- # The object file name does not affect the name of the '.d' file.
- # pgcc 10.2 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\' :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- set_dir_from "$object"
- # Use the source, not the object, to determine the base name, since
- # that's sadly what pgcc will do too.
- set_base_from "$source"
- tmpdepfile=$base.d
-
- # For projects that build the same source file twice into different object
- # files, the pgcc approach of using the *source* file root name can cause
- # problems in parallel builds. Use a locking strategy to avoid stomping on
- # the same $tmpdepfile.
- lockdir=$base.d-lock
- trap "
- echo '$0: caught signal, cleaning up...' >&2
- rmdir '$lockdir'
- exit 1
- " 1 2 13 15
- numtries=100
- i=$numtries
- while test $i -gt 0; do
- # mkdir is a portable test-and-set.
- if mkdir "$lockdir" 2>/dev/null; then
- # This process acquired the lock.
- "$@" -MD
- stat=$?
- # Release the lock.
- rmdir "$lockdir"
- break
- else
- # If the lock is being held by a different process, wait
- # until the winning process is done or we timeout.
- while test -d "$lockdir" && test $i -gt 0; do
- sleep 1
- i=`expr $i - 1`
- done
- fi
- i=`expr $i - 1`
- done
- trap - 1 2 13 15
- if test $i -le 0; then
- echo "$0: failed to acquire lock after $numtries attempts" >&2
- echo "$0: check lockdir '$lockdir'" >&2
- exit 1
- fi
-
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add 'dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- set_dir_from "$object"
- set_base_from "$object"
-
- if test "$libtool" = yes; then
- # Libtool generates 2 separate objects for the 2 libraries. These
- # two compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir$base.o.d # libtool 1.5
- tmpdepfile2=$dir.libs/$base.o.d # Likewise.
- tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- # Same post-processing that is required for AIX mode.
- aix_post_process_depfile
- ;;
-
-msvc7)
- if test "$libtool" = yes; then
- showIncludes=-Wc,-showIncludes
- else
- showIncludes=-showIncludes
- fi
- "$@" $showIncludes > "$tmpdepfile"
- stat=$?
- grep -v '^Note: including file: ' "$tmpdepfile"
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The first sed program below extracts the file names and escapes
- # backslashes for cygpath. The second sed program outputs the file
- # name when reading, but also accumulates all include files in the
- # hold buffer in order to output them again at the end. This only
- # works with sed implementations that can handle large buffers.
- sed < "$tmpdepfile" -n '
-/^Note: including file: *\(.*\)/ {
- s//\1/
- s/\\/\\\\/g
- p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
- s/.*/'"$tab"'/
- G
- p
-}' >> "$depfile"
- echo >> "$depfile" # make sure the fragment doesn't end with a backslash
- rm -f "$tmpdepfile"
- ;;
-
-msvc7msys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for ':'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
- "$@" $dashmflag |
- sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this sed invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no eat=no
- for arg
- do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- if test $eat = yes; then
- eat=no
- continue
- fi
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- # makedepend may prepend the VPATH from the source file name to the object.
- # No need to regex-escape $object, excess matching of '.' is harmless.
- sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process the last invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed '1,2d' "$tmpdepfile" \
- | tr ' ' "$nl" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E \
- | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- | sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- IFS=" "
- for arg
- do
- case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
- echo "$tab" >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/doc/Makefile.am b/src/3rd_party/dbus-1.7.8/doc/Makefile.am
deleted file mode 100644
index b9a4c106ee..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/Makefile.am
+++ /dev/null
@@ -1,161 +0,0 @@
-apidir = @htmldir@/api
-
-man_pages = \
- dbus-cleanup-sockets.1 \
- dbus-daemon.1 \
- dbus-launch.1 \
- dbus-monitor.1 \
- dbus-run-session.1 \
- dbus-send.1 \
- dbus-uuidgen.1 \
- $(NULL)
-
-MAN_XML_FILES = $(patsubst %.1,%.1.xml,$(man_pages))
-
-if DBUS_XML_DOCS_ENABLED
-man1_MANS = $(man_pages)
-endif
-
-MAN_HTML_FILES = $(patsubst %.1,%.1.html,$(man_pages))
-
-DTDS = \
- busconfig.dtd \
- introspect.dtd
-
-dist_doc_DATA = system-activation.txt
-
-# uploaded and distributed, but not installed
-STATIC_DOCS = \
- dbus-faq.xml \
- dbus-specification.xml \
- dbus-test-plan.xml \
- dbus-tutorial.xml \
- dcop-howto.txt \
- introspect.xsl \
- $(DTDS)
-
-EXTRA_DIST = \
- file-boilerplate.c \
- doxygen_to_devhelp.xsl \
- $(STATIC_DOCS)
-
-html_DATA =
-
-dist_html_DATA =
-
-# diagram.png/diagram.svg aren't really HTML, but must go in the same
-# directory as the HTML to avoid broken links
-STATIC_HTML = \
- diagram.png \
- diagram.svg \
- $(NULL)
-
-dist_html_DATA += $(STATIC_HTML)
-
-XMLTO_HTML = \
- dbus-faq.html \
- dbus-specification.html \
- dbus-test-plan.html \
- dbus-tutorial.html \
- $(MAN_HTML_FILES) \
- $(NULL)
-
-if DBUS_XML_DOCS_ENABLED
-html_DATA += $(XMLTO_HTML)
-
-%.html: %.xml
- $(XMLTO) html-nochunks $<
-
-%.1: %.1.xml
- $(XMLTO) man $<
-endif
-
-if DBUS_DOXYGEN_DOCS_ENABLED
-all-local:: doxygen.stamp
-
-doxygen.stamp: $(wildcard $(top_srcdir)/dbus/*.[ch])
- $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
- @touch $@
-
-if DBUS_HAVE_XSLTPROC
-html_DATA += dbus.devhelp
-
-dbus.devhelp: $(srcdir)/doxygen_to_devhelp.xsl doxygen.stamp
- $(XSLTPROC) -o $@ $< api/xml/index.xml
-endif
-
-# this assumes CREATE_SUBDIRS isn't set to YES in Doxyfile
-# (which it isn't currently)
-install-data-local:: doxygen.stamp
- $(MKDIR_P) $(DESTDIR)$(apidir)
- $(INSTALL_DATA) api/html/* $(DESTDIR)$(apidir)
-
-uninstall-local::
- rm -f $(DESTDIR)$(apidir)/*.html
- rm -f $(DESTDIR)$(apidir)/*.png
- rm -f $(DESTDIR)$(apidir)/*.css
- rm -f $(DESTDIR)$(apidir)/*.js
- rm -f $(DESTDIR)$(htmldir)/*.html
- rm -f $(DESTDIR)$(docdir)/*.txt
- rm -f $(DESTDIR)$(htmldir)/*.png
- rm -f $(DESTDIR)$(htmldir)/*.svg
- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(apidir) || \
- rmdir $(DESTDIR)$(apidir)
-endif
-
-if DBUS_CAN_UPLOAD_DOCS
-BONUS_FILES = \
- $(top_srcdir)/README \
- $(top_srcdir)/HACKING \
- $(top_srcdir)/AUTHORS \
- $(top_srcdir)/NEWS \
- $(top_srcdir)/COPYING \
- $(top_srcdir)/ChangeLog
-
-dbus-docs: $(STATIC_DOCS) $(MAN_XML_FILES) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp $(XMLTO_HTML)
- $(AM_V_at)rm -rf $@ $@.tmp
- $(AM_V_GEN)$(MKDIR_P) $@.tmp/api
- $(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp
- $(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp
- $(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp
- $(AM_V_at)cp $(XMLTO_HTML) @abs_builddir@/$@.tmp
- $(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp
- $(AM_V_at)cp $(MAN_XML_FILES) @abs_builddir@/$@.tmp
- $(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp
- $(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api
- $(AM_V_at)mv $@.tmp $@
-
-dbus-docs.tar.gz: dbus-docs
- $(AM_V_GEN)tar czf $@ $<
-
-DOC_SERVER = dbus.freedesktop.org
-DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
-
-SPECIFICATION_SERVER = specifications.freedesktop.org
-SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
-
-maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
- scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)/
- rsync -rpvzP --chmod=Dg+s,ug+rwX,o=rX \
- dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
- cd $(srcdir) && scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)/
-else
-maintainer-upload-docs:
- @echo "Can't upload documentation! Re-run configure with"
- @echo " --enable-doxygen-docs --enable-xml-docs"
- @echo "and ensure that man2html is installed."
- @false
-endif
-
-CLEANFILES = \
- $(man1_MANS) \
- $(MAN_XML_FILES) \
- $(XMLTO_HTML) \
- $(NULL)
-
-clean-local:
- rm -f $(html_DATA)
- rm -rf api
- rm -rf dbus-docs dbus-docs.tmp
- rm -f *.1.html
- rm -f doxygen.stamp
diff --git a/src/3rd_party/dbus-1.7.8/doc/Makefile.in b/src/3rd_party/dbus-1.7.8/doc/Makefile.in
deleted file mode 100644
index e58e7693ed..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/Makefile.in
+++ /dev/null
@@ -1,809 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-@DBUS_XML_DOCS_ENABLED_TRUE@am__append_1 = $(XMLTO_HTML)
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@@DBUS_HAVE_XSLTPROC_TRUE@am__append_2 = dbus.devhelp
-subdir = doc
-DIST_COMMON = $(dist_doc_DATA) $(dist_html_DATA) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/dbus-cleanup-sockets.1.xml.in \
- $(srcdir)/dbus-daemon.1.xml.in $(srcdir)/dbus-launch.1.xml.in \
- $(srcdir)/dbus-monitor.1.xml.in \
- $(srcdir)/dbus-run-session.1.xml.in \
- $(srcdir)/dbus-send.1.xml.in $(srcdir)/dbus-uuidgen.1.xml.in \
- TODO
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = dbus-cleanup-sockets.1.xml dbus-daemon.1.xml \
- dbus-launch.1.xml dbus-monitor.1.xml dbus-run-session.1.xml \
- dbus-send.1.xml dbus-uuidgen.1.xml
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)" \
- "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)"
-NROFF = nroff
-MANS = $(man1_MANS)
-DATA = $(dist_doc_DATA) $(dist_html_DATA) $(html_DATA)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-apidir = @htmldir@/api
-man_pages = \
- dbus-cleanup-sockets.1 \
- dbus-daemon.1 \
- dbus-launch.1 \
- dbus-monitor.1 \
- dbus-run-session.1 \
- dbus-send.1 \
- dbus-uuidgen.1 \
- $(NULL)
-
-MAN_XML_FILES = $(patsubst %.1,%.1.xml,$(man_pages))
-@DBUS_XML_DOCS_ENABLED_TRUE@man1_MANS = $(man_pages)
-MAN_HTML_FILES = $(patsubst %.1,%.1.html,$(man_pages))
-DTDS = \
- busconfig.dtd \
- introspect.dtd
-
-dist_doc_DATA = system-activation.txt
-
-# uploaded and distributed, but not installed
-STATIC_DOCS = \
- dbus-faq.xml \
- dbus-specification.xml \
- dbus-test-plan.xml \
- dbus-tutorial.xml \
- dcop-howto.txt \
- introspect.xsl \
- $(DTDS)
-
-EXTRA_DIST = \
- file-boilerplate.c \
- doxygen_to_devhelp.xsl \
- $(STATIC_DOCS)
-
-html_DATA = $(am__append_1) $(am__append_2)
-dist_html_DATA = $(STATIC_HTML)
-
-# diagram.png/diagram.svg aren't really HTML, but must go in the same
-# directory as the HTML to avoid broken links
-STATIC_HTML = \
- diagram.png \
- diagram.svg \
- $(NULL)
-
-XMLTO_HTML = \
- dbus-faq.html \
- dbus-specification.html \
- dbus-test-plan.html \
- dbus-tutorial.html \
- $(MAN_HTML_FILES) \
- $(NULL)
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@BONUS_FILES = \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/README \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/HACKING \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/AUTHORS \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/NEWS \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/COPYING \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/ChangeLog
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@DOC_SERVER = dbus.freedesktop.org
-@DBUS_CAN_UPLOAD_DOCS_TRUE@DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
-@DBUS_CAN_UPLOAD_DOCS_TRUE@SPECIFICATION_SERVER = specifications.freedesktop.org
-@DBUS_CAN_UPLOAD_DOCS_TRUE@SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
-CLEANFILES = \
- $(man1_MANS) \
- $(MAN_XML_FILES) \
- $(XMLTO_HTML) \
- $(NULL)
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-dbus-cleanup-sockets.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-cleanup-sockets.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-daemon.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-daemon.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-launch.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-launch.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-monitor.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-monitor.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-run-session.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-run-session.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-send.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-send.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-dbus-uuidgen.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-uuidgen.1.xml.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-man1: $(man1_MANS)
- @$(NORMAL_INSTALL)
- @list1='$(man1_MANS)'; \
- list2=''; \
- test -n "$(man1dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.1[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
- done; }
-
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-install-dist_docDATA: $(dist_doc_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
- done
-
-uninstall-dist_docDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
-install-dist_htmlDATA: $(dist_html_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done
-
-uninstall-dist_htmlDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
-install-htmlDATA: $(html_DATA)
- @$(NORMAL_INSTALL)
- @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done
-
-uninstall-htmlDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @list='$(MANS)'; if test -n "$$list"; then \
- list=`for p in $$list; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
- if test -n "$$list" && \
- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
- echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
- echo " typically \`make maintainer-clean' will remove them" >&2; \
- exit 1; \
- else :; fi; \
- else :; fi
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@all-local:
-all-am: Makefile $(MANS) $(DATA) all-local
-installdirs:
- for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@uninstall-local:
-@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@install-data-local:
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-local mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-data-local install-dist_docDATA \
- install-dist_htmlDATA install-htmlDATA install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dist_docDATA uninstall-dist_htmlDATA \
- uninstall-htmlDATA uninstall-local uninstall-man
-
-uninstall-man: uninstall-man1
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am all-local check check-am clean clean-generic \
- clean-libtool clean-local distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-data-local install-dist_docDATA install-dist_htmlDATA \
- install-dvi install-dvi-am install-exec install-exec-am \
- install-html install-html-am install-htmlDATA install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
- uninstall-dist_docDATA uninstall-dist_htmlDATA \
- uninstall-htmlDATA uninstall-local uninstall-man \
- uninstall-man1
-
-
-@DBUS_XML_DOCS_ENABLED_TRUE@%.html: %.xml
-@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) html-nochunks $<
-
-@DBUS_XML_DOCS_ENABLED_TRUE@%.1: %.1.xml
-@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) man $<
-
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@all-local:: doxygen.stamp
-
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@doxygen.stamp: $(wildcard $(top_srcdir)/dbus/*.[ch])
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ $(AM_V_GEN)cd $(top_builddir) && doxygen Doxyfile
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ @touch $@
-
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@@DBUS_HAVE_XSLTPROC_TRUE@dbus.devhelp: $(srcdir)/doxygen_to_devhelp.xsl doxygen.stamp
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@@DBUS_HAVE_XSLTPROC_TRUE@ $(XSLTPROC) -o $@ $< api/xml/index.xml
-
-# this assumes CREATE_SUBDIRS isn't set to YES in Doxyfile
-# (which it isn't currently)
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@install-data-local:: doxygen.stamp
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ $(MKDIR_P) $(DESTDIR)$(apidir)
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ $(INSTALL_DATA) api/html/* $(DESTDIR)$(apidir)
-
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@uninstall-local::
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(apidir)/*.html
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(apidir)/*.png
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(apidir)/*.css
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(apidir)/*.js
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(htmldir)/*.html
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(docdir)/*.txt
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(htmldir)/*.png
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rm -f $(DESTDIR)$(htmldir)/*.svg
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(apidir) || \
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rmdir $(DESTDIR)$(apidir)
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@dbus-docs: $(STATIC_DOCS) $(MAN_XML_FILES) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp $(XMLTO_HTML)
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)rm -rf $@ $@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_GEN)$(MKDIR_P) $@.tmp/api
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(XMLTO_HTML) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(MAN_XML_FILES) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)mv $@.tmp $@
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@dbus-docs.tar.gz: dbus-docs
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_GEN)tar czf $@ $<
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)/
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ rsync -rpvzP --chmod=Dg+s,ug+rwX,o=rX \
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ cd $(srcdir) && scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)/
-@DBUS_CAN_UPLOAD_DOCS_FALSE@maintainer-upload-docs:
-@DBUS_CAN_UPLOAD_DOCS_FALSE@ @echo "Can't upload documentation! Re-run configure with"
-@DBUS_CAN_UPLOAD_DOCS_FALSE@ @echo " --enable-doxygen-docs --enable-xml-docs"
-@DBUS_CAN_UPLOAD_DOCS_FALSE@ @echo "and ensure that man2html is installed."
-@DBUS_CAN_UPLOAD_DOCS_FALSE@ @false
-
-clean-local:
- rm -f $(html_DATA)
- rm -rf api
- rm -rf dbus-docs dbus-docs.tmp
- rm -f *.1.html
- rm -f doxygen.stamp
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/doc/TODO b/src/3rd_party/dbus-1.7.8/doc/TODO
deleted file mode 100644
index eb4e797ff6..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/TODO
+++ /dev/null
@@ -1,155 +0,0 @@
-Important for 1.2
-===
-
- - System bus activation
-
- - Windows port
-
-Important for 1.0 GLib Bindings
-===
-
- - Test point-to-point mode
-
- - Add support for getting sender
-
- - format_version in the object info doesn't look like it's handled correctly. The creator
- of the object info should specify some fixed number per struct version; the library
- should handle only specific numbers it knows about. There's no assumption that all
- numbers >= the given one are compatible. The idea is that new versions of the lib
- can offer totally different object info structs, but old versions
- keep working.
-
-Important for 1.0 Python bindings
-===
-
- - Hammer down API
-
- - Fix removing of signals from the match tree
-
- - Fix refcounting and userdata lifecycles
-
- - Write a generic mainloop
-
-Might as Well for 1.0
-===
-
- - protocol version in each message is pretty silly
-
-Can Be Post 1.0
-===
-
- - revamp dbus-launch a bit,
- see http://lists.freedesktop.org/archives/dbus/2006-October/005906.html
- for some thoughts.
-
- - clean up the creds issue on *BSD's in dbus/dbus-sysdeps-unix.c.
- They should work as is but we need to rearange it to make it
- clearer which method is being used. configure.in should
- be fixed up to make that decition.
-
- - _dbus_connection_unref_unlocked() is essentially always broken because
- the connection finalizer calls non-unlocked functions. One fix is to make
- the finalizer run with the lock held, but since it calls out to the app that may
- be pretty broken. More likely all the uses of unref_unlocked are just wrong.
-
- - if the GUID is obtained only during authentication, not in the address,
- we could still share the connection
-
- - Allow a dbus_g_proxy_to_string()/g_object_to_string() that
- would convert the proxy to an "IOR" and dbus_g_proxy_from_string()
- that would decode; using these, dbus-glib users could avoid
- DBusConnection entirely. Of course the same applies to other kinds
- of binding. This would use dbus_connection_open()'s connection-sharing
- feature to avoid massive proliferation of connections.
-
- - DBusWatchList/TimeoutList duplicate a lot of code, as do
- protected_change_watch/protected_change_timeout in dbus-connection.c
- and dbus-server.c. This could all be mopped up, cut-and-paste
- fixed, code size reduced.
-
- - change .service files to allow Names=list in addition to Name=string
-
- - The message bus internal code still says "service" for
- "name", "base service" for "unique name", "activate" for
- "start"; would be nice to clean up.
-
- - Property list feature on message bus (list of properties associated
- with a connection). May also include message matching rules
- that involve the properties of the source or destination
- connection.
-
- - Disconnecting the remote end on invalid UTF-8 is probably not a good
- idea. The definition of "valid" is slightly fuzzy. I think it might
- be better to just silently "fix" the UTF-8, or perhaps return an error.
-
- - build and install the Doxygen manual in Makefile when --enable-docs
-
- - if you send the same message to multiple connections, the serial number
- will only be right for one of them. Probably need to just write() the serial
- number, rather than putting it in the DBusMessage, or something.
-
- - perhaps the bus driver should have properties that reflect attributes
- of the session, such as hostname, architecture, operating system,
- etc. Could be useful for code that wants to special-case behavior
- for a particular host or class of hosts, for example.
-
- - currently the security policy stuff for messages to/from
- the bus driver is kind of strange; basically it's hardcoded that
- you can always talk to the driver, but the default config file
- has rules for it anyway, or something. it's conceptually
- screwy at the moment.
-
- - when making a method call, if the call serial were globally unique,
- we could forward the call serial along with any method calls made
- as a result of the first method call, and allow reentrancy that was
- strictly part of the call stack of said method call. But I don't
- really see how to do this without making the user pass around the
- call serial to all method calls all the time, or disallowing
- async calls.
-
- If done post 1.0 will probably be an optional/ugly-API type
- of thing.
-
- - I don't want to introduce DBusObject, but refcounting and object
- data could still be factored out into an internal "base class"
- perhaps.
-
- - Keep convenience wrappers in sync with bus methods
-
- - document the auth protocol as a set of states and transitions, and
- then reimplement it in those terms
-
- - recursive dispatch, see dbus_connection_dispatch()
-
- - do we need per-display activation; if so I'd like to do this by setting a
- "display ID" property on screen 0, with a GUID, and keying activation by
- said GUID. Otherwise you get all kinds of unrobust
- string/hostname-based mess. per-screen is then done by appending screen number
- to the display. If displays have a deterministic ID like this, you can
- do per-display by simply including GUID in the service name.
-
- - optimization and profiling!
-
- - Match rules aren't in the spec (probably a lot of methods on the bus
- are not)
-
- - the "break loader" and valid/invalid message tests are all disabled;
- they need to be fixed and re-enabled with the new message args stuff.
- I think I want to drop the .message files thing and just have code
- that generates messages, more like the tests for
- dbus-marshal-recursive.c (this is mostly done now, just needs some
- cleanup)
-
- - just before 1.0, try a HAVE_INT64=0 build and be sure it runs
-
- - Windows port needs recursive mutexes
-
-Should Be Post 1.0
-===
-
- - look into supporting the concept of a "connection" generically
- (what does this TODO item mean?)
-
- - test/name-test should be named test/with-bus or something like that
-
-
diff --git a/src/3rd_party/dbus-1.7.8/doc/busconfig.dtd b/src/3rd_party/dbus-1.7.8/doc/busconfig.dtd
deleted file mode 100644
index 0cc519b4d7..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/busconfig.dtd
+++ /dev/null
@@ -1,65 +0,0 @@
-<!ELEMENT busconfig (user |
- type |
- fork |
- keep_umask |
- listen |
- pidfile |
- includedir |
- servicedir |
- servicehelper |
- auth |
- include |
- policy |
- limit |
- selinux)*>
-
-<!ELEMENT user (#PCDATA)>
-<!ELEMENT listen (#PCDATA)>
-<!ELEMENT includedir (#PCDATA)>
-<!ELEMENT servicedir (#PCDATA)>
-<!ELEMENT servicehelper (#PCDATA)>
-<!ELEMENT auth (#PCDATA)>
-<!ELEMENT type (#PCDATA)>
-<!ELEMENT pidfile (#PCDATA)>
-<!ELEMENT fork EMPTY>
-<!ELEMENT keep_umask EMPTY>
-
-<!ELEMENT include (#PCDATA)>
-<!ATTLIST include
- ignore_missing (yes|no) "no"
- if_selinux_enabled (yes|no) "no"
- selinux_root_relative (yes|no) "no">
-
-<!ELEMENT policy (allow|deny)*>
-<!ATTLIST policy
- context (default|mandatory) #IMPLIED
- user CDATA #IMPLIED
- group CDATA #IMPLIED
- at_console (yes|no) #IMPLIED>
-
-<!ELEMENT allow EMPTY>
-<!ATTLIST allow
- user CDATA #IMPLIED
- send CDATA #IMPLIED
- receive CDATA #IMPLIED
- own CDATA #IMPLIED
- send_to CDATA #IMPLIED
- receive_from CDATA #IMPLIED>
-
-<!ELEMENT deny EMPTY>
-<!ATTLIST deny
- user CDATA #IMPLIED
- send CDATA #IMPLIED
- receive CDATA #IMPLIED
- own CDATA #IMPLIED
- send_to CDATA #IMPLIED
- receive_from CDATA #IMPLIED>
-
-<!ELEMENT limit (#PCDATA)>
-<!ATTLIST limit name CDATA #REQUIRED>
-
-<!ELEMENT selinux (associate)*>
-<!ELEMENT associate EMPTY>
-<!ATTLIST associate
- own CDATA #REQUIRED
- context CDATA #REQUIRED>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-cleanup-sockets.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-cleanup-sockets.1.xml.in
deleted file mode 100644
index 6d98083dfd..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-cleanup-sockets.1.xml.in
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbuscleanupsockets1'>
-
-<!-- dbus&bsol;-cleanup&bsol;-sockets manual page.
- Copyright (C) 2003 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-cleanup-sockets</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-cleanup-sockets</refname>
-<refpurpose>clean up leftover sockets in a directory</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-cleanup-sockets</command> <arg choice='opt'><replaceable>DIRECTORY</replaceable></arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-cleanup-sockets</command> command cleans up unused D-Bus
-connection sockets. See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for
-more information about the big picture.</para>
-
-
-<para>If given no arguments, <command>dbus-cleanup-sockets</command> cleans up sockets
-in the standard default socket directory for the
-per-user-login-session message bus; this is usually /tmp.
-Optionally, you can pass a different directory on the command line.</para>
-
-
-<para>On Linux, this program is essentially useless, because D-Bus defaults
-to using "abstract sockets" that exist only in memory and don't have a
-corresponding file in /tmp.</para>
-
-
-<para>On most other flavors of UNIX, it's possible for the socket files to
-leak when programs using D-Bus exit abnormally or without closing
-their D-Bus connections. Thus, it might be interesting to run
-dbus-cleanup-sockets in a cron job to mop up any leaked sockets.
-Or you can just ignore the leaked sockets, they aren't really hurting
-anything, other than cluttering the output of "ls /tmp"</para>
-
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>dbus-cleanup-sockets was adapted by Havoc Pennington from
-linc-cleanup-sockets written by Michael Meeks.</para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-daemon.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-daemon.1.xml.in
deleted file mode 100644
index 1a1e42cd2c..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-daemon.1.xml.in
+++ /dev/null
@@ -1,926 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbusdaemon1'>
-
-<!-- dbus&bsol;-daemon manual page.
- Copyright (C) 2003,2008 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-daemon</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-daemon</refname>
-<refpurpose>Message bus daemon</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-daemon</command></cmdsynopsis>
-<cmdsynopsis>
- <command>dbus-daemon</command> <arg choice='opt'>--version </arg>
- <arg choice='opt'>--session </arg>
- <arg choice='opt'>--system </arg>
- <arg choice='opt'>--config-file=<replaceable>FILE</replaceable></arg>
- <arg choice='opt'><arg choice='plain'>--print-address </arg><arg choice='opt'><replaceable>=DESCRIPTOR</replaceable></arg></arg>
- <arg choice='opt'><arg choice='plain'>--print-pid </arg><arg choice='opt'><replaceable>=DESCRIPTOR</replaceable></arg></arg>
- <arg choice='opt'>--fork </arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para><command>dbus-daemon</command> is the D-Bus message bus daemon. See
-<ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information about
-the big picture. D-Bus is first a library that provides one-to-one
-communication between any two applications; <command>dbus-daemon</command> is an
-application that uses this library to implement a message bus
-daemon. Multiple programs connect to the message bus daemon and can
-exchange messages with one another.</para>
-
-<para>There are two standard message bus instances: the systemwide message bus
-(installed on many systems as the "messagebus" init service) and the
-per-user-login-session message bus (started each time a user logs in).
-<command>dbus-daemon</command> is used for both of these instances, but with
-a different configuration file.</para>
-
-<para>The --session option is equivalent to
-"--config-file=@EXPANDED_SYSCONFDIR@/dbus-1/session.conf" and the --system
-option is equivalent to
-"--config-file=@EXPANDED_SYSCONFDIR@/dbus-1/system.conf". By creating
-additional configuration files and using the --config-file option,
-additional special-purpose message bus daemons could be created.</para>
-
-<para>The systemwide daemon is normally launched by an init script,
-standardly called simply "messagebus".</para>
-
-<para>The systemwide daemon is largely used for broadcasting system events,
-such as changes to the printer queue, or adding/removing devices.</para>
-
-<para>The per-session daemon is used for various interprocess communication
-among desktop applications (however, it is not tied to X or the GUI
-in any way).</para>
-
-<para>SIGHUP will cause the D-Bus daemon to PARTIALLY reload its
-configuration file and to flush its user/group information caches. Some
-configuration changes would require kicking all apps off the bus; so they will
-only take effect if you restart the daemon. Policy changes should take effect
-with SIGHUP.</para>
-
-</refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<para>The following options are supported:</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--config-file=FILE</option></term>
- <listitem>
-<para>Use the given configuration file.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--fork</option></term>
- <listitem>
-<para>Force the message bus to fork and become a daemon, even if
-the configuration file does not specify that it should.
-In most contexts the configuration file already gets this
-right, though. This option is not supported on Windows.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--nofork</option></term>
- <listitem>
- <para>Force the message bus not to fork and become a daemon, even if
- the configuration file specifies that it should. On Windows,
- the dbus-daemon never forks, so this option is allowed but does
- nothing.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--print-address[=DESCRIPTOR]</option></term>
- <listitem>
-<para>Print the address of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
-launch the message bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--print-pid[=DESCRIPTOR]</option></term>
- <listitem>
-<para>Print the process ID of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
-launch the message bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--session</option></term>
- <listitem>
-<para>Use the standard configuration file for the per-login-session message
-bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--system</option></term>
- <listitem>
-<para>Use the standard configuration file for the systemwide message bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--version</option></term>
- <listitem>
-<para>Print the version of the daemon.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--introspect</option></term>
- <listitem>
-<para>Print the introspection information for all D-Bus internal interfaces.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--address[=ADDRESS]</option></term>
- <listitem>
-<para>Set the address to listen on. This option overrides the address
-configured in the configuration file.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--systemd-activation</option></term>
- <listitem>
-<para>Enable systemd-style service activation. Only useful in conjunction
-with the systemd system and session manager on Linux.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--nopidfile</option></term>
- <listitem>
-<para>Don't write a PID file even if one is configured in the configuration
-files.</para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='configuration_file'><title>CONFIGURATION FILE</title>
-<para>A message bus daemon has a configuration file that specializes it
-for a particular application. For example, one configuration
-file might set up the message bus to be a systemwide message bus,
-while another might set it up to be a per-user-login-session bus.</para>
-
-<para>The configuration file also establishes resource limits, security
-parameters, and so forth.</para>
-
-<para>The configuration file is not part of any interoperability
-specification and its backward compatibility is not guaranteed; this
-document is documentation, not specification.</para>
-
-<para>The standard systemwide and per-session message bus setups are
-configured in the files "@EXPANDED_SYSCONFDIR@/dbus-1/system.conf" and
-"@EXPANDED_SYSCONFDIR@/dbus-1/session.conf". These files normally
-&lt;include&gt; a system-local.conf or session-local.conf; you can put local
-overrides in those files to avoid modifying the primary configuration
-files.</para>
-
-
-<para>The configuration file is an XML document. It must have the following
-doctype declaration:</para>
-<literallayout remap='.nf'>
-
- &lt;!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "<ulink url='http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd'>http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd</ulink>"&gt;
-
-</literallayout> <!-- .fi -->
-
-
-<para>The following elements may be present in the configuration file.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;busconfig&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Root element.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;type&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>The well-known type of the message bus. Currently known values are
-"system" and "session"; if other values are set, they should be
-either added to the D-Bus specification, or namespaced. The last
-&lt;type&gt; element "wins" (previous values are ignored). This element
-only controls which message bus specific environment variables are
-set in activated clients. Most of the policy that distinguishes a
-session bus from the system bus is controlled from the other elements
-in the configuration file.</para>
-
-
-<para>If the well-known type of the message bus is "session", then the
-DBUS_STARTER_BUS_TYPE environment variable will be set to "session"
-and the DBUS_SESSION_BUS_ADDRESS environment variable will be set
-to the address of the session bus. Likewise, if the type of the
-message bus is "system", then the DBUS_STARTER_BUS_TYPE environment
-variable will be set to "system" and the DBUS_SESSION_BUS_ADDRESS
-environment variable will be set to the address of the system bus
-(which is normally well known anyway).</para>
-
-
-<para>Example: &lt;type&gt;session&lt;/type&gt;</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;include&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Include a file &lt;include&gt;filename.conf&lt;/include&gt; at this point. If the
-filename is relative, it is located relative to the configuration file
-doing the including.</para>
-
-
-<para>&lt;include&gt; has an optional attribute "ignore_missing=(yes|no)"
-which defaults to "no" if not provided. This attribute
-controls whether it's a fatal error for the included file
-to be absent.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;includedir&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Include all files in &lt;includedir&gt;foo.d&lt;/includedir&gt; at this
-point. Files in the directory are included in undefined order.
-Only files ending in ".conf" are included.</para>
-
-
-<para>This is intended to allow extension of the system bus by particular
-packages. For example, if CUPS wants to be able to send out
-notification of printer queue changes, it could install a file to
-@EXPANDED_SYSCONFDIR@/dbus-1/system.d that allowed all apps to receive
-this message and allowed the printer daemon user to send it.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;user&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>The user account the daemon should run as, as either a username or a
-UID. If the daemon cannot change to this UID on startup, it will exit.
-If this element is not present, the daemon will not change or care
-about its UID.</para>
-
-
-<para>The last &lt;user&gt; entry in the file "wins", the others are ignored.</para>
-
-
-<para>The user is changed after the bus has completed initialization. So
-sockets etc. will be created before changing user, but no data will be
-read from clients before changing user. This means that sockets
-and PID files can be created in a location that requires root
-privileges for writing.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;fork&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>If present, the bus daemon becomes a real daemon (forks
-into the background, etc.). This is generally used
-rather than the --fork command line option.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;keep_umask&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>If present, the bus daemon keeps its original umask when forking.
-This may be useful to avoid affecting the behavior of child processes.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;syslog&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>If present, the bus daemon will log to syslog.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;pidfile&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>If present, the bus daemon will write its pid to the specified file.
-The --nopidfile command-line option takes precedence over this setting.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;allow_anonymous&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>If present, connections that authenticated using the ANONYMOUS
-mechanism will be authorized to connect. This option has no practical
-effect unless the ANONYMOUS mechanism has also been enabled using the
-<emphasis remap='I'>&lt;auth&gt;</emphasis> element, described below.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;listen&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Add an address that the bus should listen on. The
-address is in the standard D-Bus format that contains
-a transport name plus possible parameters/options.</para>
-
-
-<para>Example: &lt;listen&gt;unix:path=/tmp/foo&lt;/listen&gt;</para>
-
-
-<para>Example: &lt;listen&gt;tcp:host=localhost,port=1234&lt;/listen&gt;</para>
-
-
-<para>If there are multiple &lt;listen&gt; elements, then the bus listens
-on multiple addresses. The bus will pass its address to
-started services or other interested parties with
-the last address given in &lt;listen&gt; first. That is,
-apps will try to connect to the last &lt;listen&gt; address first.</para>
-
-
-<para>tcp sockets can accept IPv4 addresses, IPv6 addresses or hostnames.
-If a hostname resolves to multiple addresses, the server will bind
-to all of them. The family=ipv4 or family=ipv6 options can be used
-to force it to bind to a subset of addresses</para>
-
-
-<para>Example: &lt;listen&gt;tcp:host=localhost,port=0,family=ipv4&lt;/listen&gt;</para>
-
-
-<para>A special case is using a port number of zero (or omitting the port),
-which means to choose an available port selected by the operating
-system. The port number chosen can be obtained with the
---print-address command line parameter and will be present in other
-cases where the server reports its own address, such as when
-DBUS_SESSION_BUS_ADDRESS is set.</para>
-
-
-<para>Example: &lt;listen&gt;tcp:host=localhost,port=0&lt;/listen&gt;</para>
-
-
-<para>tcp addresses also allow a bind=hostname option, which will override
-the host option specifying what address to bind to, without changing
-the address reported by the bus. The bind option can also take a
-special name '*' to cause the bus to listen on all local address
-(INADDR_ANY). The specified host should be a valid name of the local
-machine or weird stuff will happen.</para>
-
-
-<para>Example: &lt;listen&gt;tcp:host=localhost,bind=*,port=0&lt;/listen&gt;</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;auth&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Lists permitted authorization mechanisms. If this element doesn't
-exist, then all known mechanisms are allowed. If there are multiple
-&lt;auth&gt; elements, all the listed mechanisms are allowed. The order in
-which mechanisms are listed is not meaningful.</para>
-
-
-<para>Example: &lt;auth&gt;EXTERNAL&lt;/auth&gt;</para>
-
-
-<para>Example: &lt;auth&gt;DBUS_COOKIE_SHA1&lt;/auth&gt;</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;servicedir&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>Adds a directory to scan for .service files. Directories are
-scanned starting with the first to appear in the config file
-(the first .service file found that provides a particular
-service will be used).</para>
-
-
-<para>Service files tell the bus how to automatically start a program.
-They are primarily used with the per-user-session bus,
-not the systemwide bus.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;standard_session_servicedirs/&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>&lt;standard_session_servicedirs/&gt; is equivalent to specifying a series
-of &lt;servicedir/&gt; elements for each of the data directories in the "XDG
-Base Directory Specification" with the subdirectory "dbus-1/services",
-so for example "/usr/share/dbus-1/services" would be among the
-directories searched.</para>
-
-
-<para>The "XDG Base Directory Specification" can be found at
-<ulink url='http://freedesktop.org/wiki/Standards/basedir-spec'>http://freedesktop.org/wiki/Standards/basedir-spec</ulink> if it hasn't moved,
-otherwise try your favorite search engine.</para>
-
-
-<para>The &lt;standard_session_servicedirs/&gt; option is only relevant to the
-per-user-session bus daemon defined in
-@EXPANDED_SYSCONFDIR@/dbus-1/session.conf. Putting it in any other
-configuration file would probably be nonsense.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;standard_system_servicedirs/&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>&lt;standard_system_servicedirs/&gt; specifies the standard system-wide
-activation directories that should be searched for service files.
-This option defaults to @EXPANDED_DATADIR@/dbus-1/system-services.</para>
-
-
-<para>The &lt;standard_system_servicedirs/&gt; option is only relevant to the
-per-system bus daemon defined in
-@EXPANDED_SYSCONFDIR@/dbus-1/system.conf. Putting it in any other
-configuration file would probably be nonsense.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;servicehelper/&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>&lt;servicehelper/&gt; specifies the setuid helper that is used to launch
-system daemons with an alternate user. Typically this should be
-the dbus-daemon-launch-helper executable in located in libexec.</para>
-
-
-<para>The &lt;servicehelper/&gt; option is only relevant to the per-system bus daemon
-defined in @EXPANDED_SYSCONFDIR@/dbus-1/system.conf. Putting it in any other
-configuration file would probably be nonsense.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;limit&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>&lt;limit&gt; establishes a resource limit. For example:</para>
-<literallayout remap='.nf'>
- &lt;limit name="max_message_size"&gt;64&lt;/limit&gt;
- &lt;limit name="max_completed_connections"&gt;512&lt;/limit&gt;
-</literallayout> <!-- .fi -->
-
-
-<para>The name attribute is mandatory.
-Available limit names are:</para>
-<literallayout remap='.nf'>
- "max_incoming_bytes" : total size in bytes of messages
- incoming from a single connection
- "max_incoming_unix_fds" : total number of unix fds of messages
- incoming from a single connection
- "max_outgoing_bytes" : total size in bytes of messages
- queued up for a single connection
- "max_outgoing_unix_fds" : total number of unix fds of messages
- queued up for a single connection
- "max_message_size" : max size of a single message in
- bytes
- "max_message_unix_fds" : max unix fds of a single message
- "service_start_timeout" : milliseconds (thousandths) until
- a started service has to connect
- "auth_timeout" : milliseconds (thousandths) a
- connection is given to
- authenticate
- "max_completed_connections" : max number of authenticated connections
- "max_incomplete_connections" : max number of unauthenticated
- connections
- "max_connections_per_user" : max number of completed connections from
- the same user
- "max_pending_service_starts" : max number of service launches in
- progress at the same time
- "max_names_per_connection" : max number of names a single
- connection can own
- "max_match_rules_per_connection": max number of match rules for a single
- connection
- "max_replies_per_connection" : max number of pending method
- replies per connection
- (number of calls-in-progress)
- "reply_timeout" : milliseconds (thousandths)
- until a method call times out
-</literallayout> <!-- .fi -->
-
-
-<para>The max incoming/outgoing queue sizes allow a new message to be queued
-if one byte remains below the max. So you can in fact exceed the max
-by max_message_size.</para>
-
-
-<para>max_completed_connections divided by max_connections_per_user is the
-number of users that can work together to denial-of-service all other users by using
-up all connections on the systemwide bus.</para>
-
-
-<para>Limits are normally only of interest on the systemwide bus, not the user session
-buses.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;policy&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>The &lt;policy&gt; element defines a security policy to be applied to a particular
-set of connections to the bus. A policy is made up of
-&lt;allow&gt; and &lt;deny&gt; elements. Policies are normally used with the systemwide bus;
-they are analogous to a firewall in that they allow expected traffic
-and prevent unexpected traffic.</para>
-
-
-<para>Currently, the system bus has a default-deny policy for sending method calls
-and owning bus names. Everything else, in particular reply messages, receive
-checks, and signals has a default allow policy.</para>
-
-
-<para>In general, it is best to keep system services as small, targeted programs which
-run in their own process and provide a single bus name. Then, all that is needed
-is an &lt;allow&gt; rule for the "own" permission to let the process claim the bus
-name, and a "send_destination" rule to allow traffic from some or all uids to
-your service.</para>
-
-
-<para>The &lt;policy&gt; element has one of four attributes:</para>
-<literallayout remap='.nf'>
- context="(default|mandatory)"
- at_console="(true|false)"
- user="username or userid"
- group="group name or gid"
-</literallayout> <!-- .fi -->
-
-
-<para>Policies are applied to a connection as follows:</para>
-<literallayout remap='.nf'>
- - all context="default" policies are applied
- - all group="connection's user's group" policies are applied
- in undefined order
- - all user="connection's auth user" policies are applied
- in undefined order
- - all at_console="true" policies are applied
- - all at_console="false" policies are applied
- - all context="mandatory" policies are applied
-</literallayout> <!-- .fi -->
-
-
-<para>Policies applied later will override those applied earlier,
-when the policies overlap. Multiple policies with the same
-user/group/context are applied in the order they appear
-in the config file.</para>
-
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;deny&gt;</emphasis></term>
- <listitem>
-<para><emphasis remap='I'>&lt;allow&gt;</emphasis></para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-
-<para>A &lt;deny&gt; element appears below a &lt;policy&gt; element and prohibits some
-action. The &lt;allow&gt; element makes an exception to previous &lt;deny&gt;
-statements, and works just like &lt;deny&gt; but with the inverse meaning.</para>
-
-
-<para>The possible attributes of these elements are:</para>
-<literallayout remap='.nf'>
- send_interface="interface_name"
- send_member="method_or_signal_name"
- send_error="error_name"
- send_destination="name"
- send_type="method_call" | "method_return" | "signal" | "error"
- send_path="/path/name"
-
- receive_interface="interface_name"
- receive_member="method_or_signal_name"
- receive_error="error_name"
- receive_sender="name"
- receive_type="method_call" | "method_return" | "signal" | "error"
- receive_path="/path/name"
-
- send_requested_reply="true" | "false"
- receive_requested_reply="true" | "false"
-
- eavesdrop="true" | "false"
-
- own="name"
- own_prefix="name"
- user="username"
- group="groupname"
-</literallayout> <!-- .fi -->
-
-
-<para>Examples:</para>
-<literallayout remap='.nf'>
- &lt;deny send_destination="org.freedesktop.Service" send_interface="org.freedesktop.System" send_member="Reboot"/&gt;
- &lt;deny send_destination="org.freedesktop.System"/&gt;
- &lt;deny receive_sender="org.freedesktop.System"/&gt;
- &lt;deny user="john"/&gt;
- &lt;deny group="enemies"/&gt;
-</literallayout> <!-- .fi -->
-
-
-<para>The &lt;deny&gt; element's attributes determine whether the deny "matches" a
-particular action. If it matches, the action is denied (unless later
-rules in the config file allow it).</para>
-
-<para>send_destination and receive_sender rules mean that messages may not be
-sent to or received from the *owner* of the given name, not that
-they may not be sent *to that name*. That is, if a connection
-owns services A, B, C, and sending to A is denied, sending to B or C
-will not work either.</para>
-
-<para>The other send_* and receive_* attributes are purely textual/by-value
-matches against the given field in the message header.</para>
-
-<para>"Eavesdropping" occurs when an application receives a message that
-was explicitly addressed to a name the application does not own, or
-is a reply to such a message. Eavesdropping thus only applies to
-messages that are addressed to services and replies to such messages
-(i.e. it does not apply to signals).</para>
-
-<para>For &lt;allow&gt;, eavesdrop="true" indicates that the rule matches even
-when eavesdropping. eavesdrop="false" is the default and means that
-the rule only allows messages to go to their specified recipient.
-For &lt;deny&gt;, eavesdrop="true" indicates that the rule matches
-only when eavesdropping. eavesdrop="false" is the default for &lt;deny&gt;
-also, but here it means that the rule applies always, even when
-not eavesdropping. The eavesdrop attribute can only be combined with
-send and receive rules (with send_* and receive_* attributes).</para>
-
-<para>The [send|receive]_requested_reply attribute works similarly to the eavesdrop
-attribute. It controls whether the &lt;deny&gt; or &lt;allow&gt; matches a reply
-that is expected (corresponds to a previous method call message).
-This attribute only makes sense for reply messages (errors and method
-returns), and is ignored for other message types.</para>
-
-
-<para>For &lt;allow&gt;, [send|receive]_requested_reply="true" is the default and indicates that
-only requested replies are allowed by the
-rule. [send|receive]_requested_reply="false" means that the rule allows any reply
-even if unexpected.</para>
-
-
-<para>For &lt;deny&gt;, [send|receive]_requested_reply="false" is the default but indicates that
-the rule matches only when the reply was not
-requested. [send|receive]_requested_reply="true" indicates that the rule applies
-always, regardless of pending reply state.</para>
-
-
-<para>user and group denials mean that the given user or group may
-not connect to the message bus.</para>
-
-
-<para>For "name", "username", "groupname", etc.
-the character "*" can be substituted, meaning "any." Complex globs
-like "foo.bar.*" aren't allowed for now because they'd be work to
-implement and maybe encourage sloppy security anyway.</para>
-
-
-<para>&lt;allow own_prefix="a.b"/&gt; allows you to own the name "a.b" or any
-name whose first dot-separated elements are "a.b": in particular,
-you can own "a.b.c" or "a.b.c.d", but not "a.bc" or "a.c".
-This is useful when services like Telepathy and ReserveDevice
-define a meaning for subtrees of well-known names, such as
-org.freedesktop.Telepathy.ConnectionManager.(anything)
-and org.freedesktop.ReserveDevice1.(anything).</para>
-
-
-<para>It does not make sense to deny a user or group inside a &lt;policy&gt;
-for a user or group; user/group denials can only be inside
-context="default" or context="mandatory" policies.</para>
-
-
-<para>A single &lt;deny&gt; rule may specify combinations of attributes such as
-send_destination and send_interface and send_type. In this case, the
-denial applies only if both attributes match the message being denied.
-e.g. &lt;deny send_interface="foo.bar" send_destination="foo.blah"/&gt; would
-deny messages with the given interface AND the given bus name.
-To get an OR effect you specify multiple &lt;deny&gt; rules.</para>
-
-
-<para>You can't include both send_ and receive_ attributes on the same
-rule, since "whether the message can be sent" and "whether it can be
-received" are evaluated separately.</para>
-
-
-<para>Be careful with send_interface/receive_interface, because the
-interface field in messages is optional. In particular, do NOT
-specify &lt;deny send_interface="org.foo.Bar"/&gt;! This will cause
-no-interface messages to be blocked for all services, which is
-almost certainly not what you intended. Always use rules of
-the form: &lt;deny send_interface="org.foo.Bar" send_destination="org.foo.Service"/&gt;</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;selinux&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>The &lt;selinux&gt; element contains settings related to Security Enhanced Linux.
-More details below.</para>
-
-<itemizedlist remap='TP'>
-
- <listitem><para><emphasis remap='I'>&lt;associate&gt;</emphasis></para></listitem>
-
-
-</itemizedlist>
-
-<para>An &lt;associate&gt; element appears below an &lt;selinux&gt; element and
-creates a mapping. Right now only one kind of association is possible:</para>
-<literallayout remap='.nf'>
- &lt;associate own="org.freedesktop.Foobar" context="foo_t"/&gt;
-</literallayout> <!-- .fi -->
-
-
-<para>This means that if a connection asks to own the name
-"org.freedesktop.Foobar" then the source context will be the context
-of the connection and the target context will be "foo_t" - see the
-short discussion of SELinux below.</para>
-
-
-<para>Note, the context here is the target context when requesting a name,
-NOT the context of the connection owning the name.</para>
-
-
-<para>There's currently no way to set a default for owning any name, if
-we add this syntax it will look like:</para>
-<literallayout remap='.nf'>
- &lt;associate own="*" context="foo_t"/&gt;
-</literallayout> <!-- .fi -->
-<para>If you find a reason this is useful, let the developers know.
-Right now the default will be the security context of the bus itself.</para>
-
-
-<para>If two &lt;associate&gt; elements specify the same name, the element
-appearing later in the configuration file will be used.</para>
-
-</refsect1>
-
-<refsect1 id='selinux'><title>SELinux</title>
-<para>See <ulink url='http://www.nsa.gov/selinux/'>http://www.nsa.gov/selinux/</ulink> for full details on SELinux. Some useful excerpts:</para>
-
-
-<para>Every subject (process) and object (e.g. file, socket, IPC object,
-etc) in the system is assigned a collection of security attributes,
-known as a security context. A security context contains all of the
-security attributes associated with a particular subject or object
-that are relevant to the security policy.</para>
-
-
-<para>In order to better encapsulate security contexts and to provide
-greater efficiency, the policy enforcement code of SELinux typically
-handles security identifiers (SIDs) rather than security contexts. A
-SID is an integer that is mapped by the security server to a security
-context at runtime.</para>
-
-
-<para>When a security decision is required, the policy enforcement code
-passes a pair of SIDs (typically the SID of a subject and the SID of
-an object, but sometimes a pair of subject SIDs or a pair of object
-SIDs), and an object security class to the security server. The object
-security class indicates the kind of object, e.g. a process, a regular
-file, a directory, a TCP socket, etc.</para>
-
-
-<para>Access decisions specify whether or not a permission is granted for a
-given pair of SIDs and class. Each object class has a set of
-associated permissions defined to control operations on objects with
-that class.</para>
-
-
-<para>D-Bus performs SELinux security checks in two places.</para>
-
-
-<para>First, any time a message is routed from one connection to another
-connection, the bus daemon will check permissions with the security context of
-the first connection as source, security context of the second connection
-as target, object class "dbus" and requested permission "send_msg".</para>
-
-
-<para>If a security context is not available for a connection
-(impossible when using UNIX domain sockets), then the target
-context used is the context of the bus daemon itself.
-There is currently no way to change this default, because we're
-assuming that only UNIX domain sockets will be used to
-connect to the systemwide bus. If this changes, we'll
-probably add a way to set the default connection context.</para>
-
-
-<para>Second, any time a connection asks to own a name,
-the bus daemon will check permissions with the security
-context of the connection as source, the security context specified
-for the name in the config file as target, object
-class "dbus" and requested permission "acquire_svc".</para>
-
-
-<para>The security context for a bus name is specified with the
-&lt;associate&gt; element described earlier in this document.
-If a name has no security context associated in the
-configuration file, the security context of the bus daemon
-itself will be used.</para>
-
-</refsect1>
-
-<refsect1 id='debugging'><title>DEBUGGING</title>
-<para>If you're trying to figure out where your messages are going or why
-you aren't getting messages, there are several things you can try.</para>
-
-<para>Remember that the system bus is heavily locked down and if you
-haven't installed a security policy file to allow your message
-through, it won't work. For the session bus, this is not a concern.</para>
-
-<para>The simplest way to figure out what's happening on the bus is to run
-the <emphasis remap='I'>dbus-monitor</emphasis> program, which comes with the D-Bus
-package. You can also send test messages with <emphasis remap='I'>dbus-send</emphasis>. These
-programs have their own man pages.</para>
-
-<para>If you want to know what the daemon itself is doing, you might consider
-running a separate copy of the daemon to test against. This will allow you
-to put the daemon under a debugger, or run it with verbose output, without
-messing up your real session and system daemons.</para>
-
-<para>To run a separate test copy of the daemon, for example you might open a terminal
-and type:</para>
-<literallayout remap='.nf'>
- DBUS_VERBOSE=1 dbus-daemon --session --print-address
-</literallayout> <!-- .fi -->
-
-<para>The test daemon address will be printed when the daemon starts. You will need
-to copy-and-paste this address and use it as the value of the
-DBUS_SESSION_BUS_ADDRESS environment variable when you launch the applications
-you want to test. This will cause those applications to connect to your
-test bus instead of the DBUS_SESSION_BUS_ADDRESS of your real session bus.</para>
-
-<para>DBUS_VERBOSE=1 will have NO EFFECT unless your copy of D-Bus
-was compiled with verbose mode enabled. This is not recommended in
-production builds due to performance impact. You may need to rebuild
-D-Bus if your copy was not built with debugging in mind. (DBUS_VERBOSE
-also affects the D-Bus library and thus applications using D-Bus; it may
-be useful to see verbose output on both the client side and from the daemon.)</para>
-
-<para>If you want to get fancy, you can create a custom bus
-configuration for your test bus (see the session.conf and system.conf
-files that define the two default configurations for example). This
-would allow you to specify a different directory for .service files,
-for example.</para>
-
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-faq.xml b/src/3rd_party/dbus-1.7.8/doc/dbus-faq.xml
deleted file mode 100644
index 0d296d9266..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-faq.xml
+++ /dev/null
@@ -1,674 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
-[
-]>
-
-<article id="index">
- <articleinfo>
- <title>D-Bus FAQ</title>
- <releaseinfo>Version 0.3</releaseinfo>
- <date>17 November 2006</date>
- <authorgroup>
- <author>
- <firstname>Havoc</firstname>
- <surname>Pennington</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>hp@pobox.com</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>David</firstname>
- <othername role="mi">A</othername>
- <surname>Wheeler</surname>
- </author>
- </authorgroup>
- </articleinfo>
-
- <qandaset id="faq">
-
- <qandaentry>
- <question>
- <para>
- What is D-Bus?
- </para>
- </question>
- <answer>
- <para>
- This is probably best answered by reading the D-Bus <ulink url="dbus-tutorial.html">tutorial</ulink> or
- the introduction to the <ulink url="dbus-specification.html">specification</ulink>. In
- short, it is a system consisting of 1) a wire protocol for exposing a
- typical object-oriented language/framework to other applications; and
- 2) a bus daemon that allows applications to find and monitor one another.
- Phrased differently, D-Bus is 1) an interprocess communication (IPC) system and 2) some higher-level
- structure (lifecycle tracking, service activation, security policy) provided by two bus daemons,
- one systemwide and one per-user-session.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry>
- <question>
- <para>
- Is D-Bus stable/finished?
- </para>
- </question>
- <answer>
- <para>
- The low-level library "libdbus" and the protocol specification are considered
- ABI stable. The <ulink url="README">README</ulink>
- file has a discussion of the API/ABI stability guarantees.
- Higher-level bindings (such as those for Qt, GLib, Python, Java, C#) each
- have their own release schedules and degree of maturity, not linked to
- the low-level library and bus daemon release. Check the project page for
- the binding you're considering to understand that project's policies.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry>
- <question>
- <para>
- How is the reference implementation licensed? Can I use it in
- proprietary applications?
- </para>
- </question>
- <answer>
- <para>
- The short answer is yes, you can use it in proprietary applications.
- You should read the <ulink url="COPYING">COPYING</ulink> file, which
- offers you the choice of two licenses. These are the GPL and the
- AFL. The GPL requires that your application be licensed under the GPL
- as well. The AFL is an "X-style" or "BSD-style" license compatible
- with proprietary licensing, but it does have some requirements; in
- particular it prohibits you from filing a lawsuit alleging that the
- D-Bus software infringes your patents <emphasis>while you continue to
- use D-Bus</emphasis>. If you're going to sue, you have to stop using
- the software. Read the licenses to determine their meaning, this FAQ
- entry is not intended to change the meaning or terms of the licenses.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry>
- <question>
- <para>
- What is the difference between a bus name, and object path,
- and an interface?
- </para>
- </question>
- <answer>
- <para>
- If you imagine a C++ program that implements a network service, then
- the bus name is the hostname of the computer running this C++ program,
- the object path is a C++ object instance pointer, and an interface is
- a C++ class (a pure virtual or abstract class, to be exact).
- </para>
- <para>
- In Java terms, the object path is an object reference,
- and an interface is a Java interface.
- </para>
- <para>
- People get confused because if they write an application
- with a single object instance and a single interface,
- then the bus name, object path, and interface look
- redundant. For example, you might have a text editor
- that uses the bus name <literal>org.freedesktop.TextEditor</literal>,
- has a global singleton object called
- <literal>/org/freedesktop/TextEditor</literal>, and
- that singleton object could implement the interface
- <literal>org.freedesktop.TextEditor</literal>.
- </para>
- <para>
- However, a text editor application could as easily own multiple bus
- names (for example, <literal>org.kde.KWrite</literal> in addition to
- generic <literal>TextEditor</literal>), have multiple objects (maybe
- <literal>/org/kde/documents/4352</literal> where the number changes
- according to the document), and each object could implement multiple
- interfaces, such as <literal>org.freedesktop.DBus.Introspectable</literal>,
- <literal>org.freedesktop.BasicTextField</literal>,
- <literal>org.kde.RichTextDocument</literal>.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="service">
- <question>
- <para>
- What is a "service"?
- </para>
- </question>
- <answer>
- <para>
- A service is a program that can be launched by the bus daemon
- to provide some functionality to other programs. Services
- are normally launched according to the bus name they will
- have.
- </para>
- <para>
- People often misuse the word "service" for any
- bus name, but this tends to be ambiguous and confusing so is discouraged.
- In the D-Bus docs we try to use "service" only when talking about
- programs the bus knows how to launch, i.e. a service always has a
- .service file.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="components">
- <question>
- <para>
- Is D-Bus a "component system"?
- </para>
- </question>
- <answer>
- <para>
- It helps to keep these concepts separate in your mind:
- <orderedlist>
- <listitem>
- <para>
- Object/component system
- </para>
- </listitem>
- <listitem>
- <para>
- GUI control/widget embedding interfaces
- </para>
- </listitem>
- <listitem>
- <para>
- Interprocess communication system or wire protocol
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- D-Bus is not a component system. "Component system" was originally
- defined by COM, and was essentially a workaround for the limitations
- of the C++ object system (adding introspection, runtime location of
- objects, ABI guarantees, and so forth). With the C# language and CLR,
- Microsoft added these features to the primary object system, leaving
- COM obsolete. Similarly, Java has much less need for something like
- COM than C++ did. Even QObject (from Qt) and GObject (from GLib) offer
- some of the same features found in COM.
- </para>
- <para>
- Component systems are not about GUI control embedding. Embedding
- a spreadsheet in a word processor document is a matter of defining
- some specific <emphasis>interfaces</emphasis> that objects
- can implement. These interfaces provide methods related to
- GUI controls. So an object implementing those interfaces
- can be embedded.
- </para>
- <para>
- The word "component" just means "object with some fancy features" and
- in modern languages all objects are effectively "components."
- </para>
- <para>
- So components are fancy objects, and some objects are GUI controls.
- </para>
- <para>
- A third, unrelated feature is interprocess communication or IPC.
- D-Bus is an IPC system. Given an object (or "component" if you must),
- you can expose the functionality of that object over an IPC system.
- Examples of IPC systems are DCOM, CORBA, SOAP, XML-RPC, and D-Bus.
- You can use any of these IPC systems with any object/component system,
- though some of them are "tuned" for specific object systems.
- You can think of an IPC system primarily as a wire protocol.
- </para>
- <para>
- If you combine an IPC system with a set of GUI control interfaces,
- then you can have an out-of-process or dynamically-loaded GUI control.
- </para>
- <para>
- Another related concept is the <firstterm>plugin</firstterm> or
- <firstterm>extension</firstterm>. Generic plugin systems such as the
- <ulink url="http://eclipse.org">Eclipse</ulink> system are not so different
- from component/object systems, though perhaps a "plugin" tends to be a
- bundle of objects with a user-visible name and can be
- downloaded/packaged as a unit.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="speed">
- <question>
- <para>
- How fast is the D-Bus reference implementation?
- </para>
- </question>
- <answer>
- <para>
- Of course it depends a bit on what you're doing.
- <ulink url="http://lists.freedesktop.org/pipermail/dbus/2004-November/001779.html">
- This mail</ulink> contains some benchmarking. At the time of that
- benchmark, D-Bus one-to-one communication was about 2.5x slower than
- simply pushing the data raw over a socket. After the recent rewrite of
- the marshaling code, D-Bus is slower than that because a lot of
- optimization work was lost. But it can probably be sped up again.
- </para>
- <para>
- D-Bus communication with the intermediate bus daemon should be
- (and as last profiled, was) about twice as slow as one-to-one
- mode, because a round trip involves four socket reads/writes rather
- than two socket reads/writes.
- </para>
- <para>
- The overhead comes from a couple of places; part of it is simply
- "abstraction penalty" (there are layers of code to support
- multiple main loops, multiple transport types, security, etc.).
- Probably the largest part comes from data validation
- (because the reference implementation does not trust incoming data).
- It would be simple to add a "no validation" mode, but probably
- not a good idea all things considered.
- </para>
- <para>
- Raw bandwidth isn't the only concern; D-Bus is designed to
- enable asynchronous communication and avoid round trips.
- This is frequently a more important performance issue
- than throughput.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="size">
- <question>
- <para>
- How large is the D-Bus reference implementation?
- </para>
- </question>
- <answer>
- <para>
- A production build (with assertions, unit tests, and verbose logging
- disabled) is on the order of a 150K shared library.
- </para>
- <para>
- A much, much smaller implementation would be possible by omitting out
- of memory handling, hardcoding a main loop (or always using blocking
- I/O), skipping validation, and otherwise simplifying things.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="other-ipc">
- <question>
- <para>
- How does D-Bus differ from other interprocess communication
- or networking protocols?
- </para>
- </question>
- <answer>
- <para>
- Keep in mind, it is not only an IPC system; it also includes
- lifecycle tracking, service activation, security policy, and other
- higher-level structure and assumptions.
- </para>
- <para>
- The best place to start is to read the D-Bus <ulink url="dbus-tutorial.html">tutorial</ulink>, so
- you have a concrete idea what D-Bus actually is. If you
- understand other protocols on a wire format level, you
- may also want to read the D-Bus <ulink url="dbus-specification.html">specification</ulink> to see what
- D-Bus looks like on a low level.
- </para>
- <para>
- As the <ulink url="dbus-tutorial.html">tutorial</ulink> and <ulink url="dbus-specification.html">specification</ulink> both explain, D-Bus is tuned
- for some specific use cases. Thus, it probably isn't tuned
- for what you want to do, unless you are doing the things
- D-Bus was designed for. Don't make the mistake of thinking
- that any system involving "IPC" is the same thing.
- </para>
- <para>
- The D-Bus authors would not recommend using D-Bus
- for applications where it doesn't make sense.
- The following questions compare D-Bus to some other
- protocols primarily to help you understand D-Bus
- and decide whether it's appropriate; D-Bus is neither intended
- nor claimed to be the right choice for every application.
- </para>
- <para>
- It should be possible to bridge D-Bus to other IPC systems,
- just as D-Bus can be bridged to object systems.
- </para>
- <para>
- Note: the D-Bus mailing list subscribers are <emphasis>very much not
- interested</emphasis> in debating which IPC system is the One True
- System. So if you want to discuss that, please use another forum.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="corba">
- <question>
- <para>
- How does D-Bus differ from CORBA?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- <ulink url="http://www.omg.org">CORBA</ulink> is designed to support
- object-oriented IPC between objects, automatically marshalling
- parameters as necessary. CORBA is strongly supported by the <ulink
- url="http://www.omg.org">Open Management Group (OMG)</ulink>, which
- produces various standards and supporting documents for CORBA and has
- the backing of many large organizations. There are many CORBA ORBs
- available, both proprietary ORBs and free / open source software ORBs
- (the latter include <ulink
- url="http://orbit-resource.sourceforge.net/">ORBit</ulink>, <ulink
- url="http://www.mico.org/">MICO</ulink>, and <ulink
- url="http://www.theaceorb.com/">The ACE Orb (TAO)</ulink>). Many
- organizations continue to use CORBA ORBs for various kinds of IPC.
- </para>
- <para>
- Both GNOME and KDE have used CORBA and then moved away from it. KDE
- had more success with a system called DCOP, and GNOME layered a system
- called Bonobo on top of CORBA. Without custom extensions, CORBA does
- not support many of the things one wants to do in a desktop
- environment with the GNOME/KDE architecture.
- </para>
- <para>
- CORBA on the other hand has a number of features of interest for
- enterprise and web application development, though XML systems such as
- SOAP are the latest fad.
- </para>
- <para>
- Like D-Bus, CORBA uses a fast binary protocol (IIOP). Both systems
- work in terms of objects and methods, and have concepts such as
- "oneway" calls. Only D-Bus has direct support for "signals" as in
- GLib/Qt (or Java listeners, or C# delegates).
- </para>
- <para>
- D-Bus hardcodes and specifies a lot of things that CORBA leaves open-ended,
- because CORBA is more generic and D-Bus has two specific use-cases in mind.
- This makes D-Bus a bit simpler.
- </para>
- <para>
- However, unlike CORBA D-Bus does <emphasis>not</emphasis> specify the
- API for the language bindings. Instead, "native" bindings adapted
- specifically to the conventions of a framework such as QObject,
- GObject, C#, Java, Python, etc. are encouraged. The libdbus reference
- implementation is designed to be a backend for bindings of this
- nature, rather than to be used directly. The rationale is that an IPC
- system API should not "leak" all over a program; it should come into
- play only just before data goes over the wire. As an aside, OMG is
- apparently working on a simpler C++ binding for CORBA.
- </para>
- <para>
- Many CORBA implementations such as ORBit are faster than the libdbus
- reference implementation. One reason is that D-Bus considers data
- from the other end of the connection to be untrusted and extensively
- validates it. But generally speaking other priorities were placed
- ahead of raw speed in the libdbus implementation. A fast D-Bus
- implementation along the lines of ORBit should be possible, of course.
- </para>
- <para>
- On a more trivial note, D-Bus involves substantially fewer acronyms
- than CORBA.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="xmlrpcsoap">
- <question>
- <para>
- How does D-Bus differ from XML-RPC and SOAP?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- In <ulink url="http://www.w3.org/TR/SOAP/">SOAP</ulink> and <ulink
- url="http://www.xmlrpc.com">XML-RPC</ulink>, RPC calls are transformed
- into an XML-based format, then sent over the wire (typically using the
- HTTP protocol), where they are processed and returned. XML-RPC is the
- simple protocol (its spec is only a page or two), and SOAP is the
- full-featured protocol.
- </para>
- <para>
- XML-RPC and SOAP impose XML parsing overhead that is normally
- irrelevant in the context of the Internet, but significant for
- constant fine-grained IPC among applications in a desktop session.
- </para>
- <para>
- D-Bus offers persistent connections and with the bus daemon
- supports lifecycle tracking of other applications connected
- to the bus. With XML-RPC and SOAP, typically each method call
- exists in isolation and has its own HTTP connection.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="dce">
- <question>
- <para>
- How does D-Bus differ from DCE?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- <ulink url="http://www.opengroup.org/dce/">Distributed Computing
- Environment (DCE)</ulink> is an industry-standard vendor-neutral
- standard that includes an IPC mechanism. <ulink
- url="http://www.opengroup.org/comm/press/05-01-12.htm">The Open Group
- has released an implementation as open source software</ulink>. DCE
- is quite capable, and includes a vast amount of functionality such as
- a distributed time service. As the name implies, DCE is intended for
- use in a large, multi-computer distributed application. D-Bus would
- not be well-suited for this.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="dcom">
- <question>
- <para>
- How does D-Bus differ from DCOM and COM?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- Comparing D-Bus to COM is apples and oranges;
- see <xref linkend="components"/>.
- </para>
- <para>
- DCOM (distributed COM) is a Windows IPC system designed for use with
- the COM object system. It's similar in some ways to DCE and CORBA.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="internet-communications-engine">
- <question>
- <para>
- How does D-Bus differ from ZeroC's Internet Communications Engine (Ice)
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- The <ulink url="http://www.zeroc.com/ice.html"> Internet
- Communications Engine (Ice)</ulink> is a powerful IPC mechanism more
- on the level of SOAP or CORBA than D-Bus. Ice has a "dual-license"
- business around it; i.e. you can use it under the GPL, or pay for a
- proprietary license.
- </para>
- </answer>
- </qandaentry>
-
- <qandaentry id="inter-client-exchange">
- <question>
- <para>
- How does D-Bus differ from Inter-Client Exchange (ICE)?
- </para>
- </question>
- <answer>
- <para>
- <ulink url="http://www.x.org/X11R6.8.1/docs/ICE/ice.pdf">ICE</ulink>
- was developed for the X Session Management protocol (XSMP), as part of
- the X Window System (X11R6.1). The idea was to allow desktop sessions
- to contain nongraphical clients in addition to X clients.
- </para>
- <para>
- ICE is a binary protocol designed for desktop use, and KDE's DCOP
- builds on ICE. ICE is substantially simpler than D-Bus (in contrast
- to most of the other IPC systems mentioned here, which are more
- complex). ICE doesn't really define a mapping to objects and methods
- (DCOP adds that layer). The reference implementation of ICE (libICE)
- is often considered to be horrible (and horribly insecure).
- </para>
- <para>
- DCOP and XSMP are the only two widely-used applications of ICE,
- and both could in principle be replaced by D-Bus. (Though whether
- GNOME and KDE will bother is an open question.)
- </para>
- </answer>
- </qandaentry>
-
-
-
- <qandaentry id="dcop">
- <question>
- <para>
- How does D-Bus differ from DCOP?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- D-Bus is intentionally pretty similar to <ulink
- url="http://developer.kde.org/documentation/library/kdeqt/dcop.html">DCOP</ulink>,
- and can be thought of as a "DCOP the next generation" suitable for
- sharing between the various open source desktop projects.
- </para>
- <para>
- D-Bus is a bit more complex than DCOP, though the Qt binding for D-Bus
- should not be more complex for programmers. The additional complexity
- of D-Bus arises from its separation of object references vs. bus names
- vs. interfaces as distinct concepts, and its support for one-to-one
- connections in addition to connections over the bus. The libdbus
- reference implementation has a lot of API to support multiple bindings
- and main loops, and performs data validation and out-of-memory handling
- in order to support secure applications such as the systemwide bus.
- </para>
- <para>
- D-Bus is probably somewhat slower than DCOP due to data validation
- and more "layers" in the reference implementation. A comparison
- hasn't been posted to the list though.
- </para>
- <para>
- At this time, KDE has not committed to using D-Bus, but there have
- been discussions of KDE bridging D-Bus and DCOP, or even changing
- DCOP's implementation to use D-Bus internally (so that GNOME and KDE
- would end up using exactly the same bus). See the KDE mailing list
- archives for some of these discussions.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="yet-more-ipc">
- <question>
- <para>
- How does D-Bus differ from [yet more IPC mechanisms]?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- There are countless uses of network sockets in the world. <ulink
- url="http://www.mbus.org/">MBUS</ulink>, Sun ONC/RPC, Jabber/XMPP,
- SIP, are some we can think of quickly.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry id="which-ipc">
- <question>
- <para>
- Which IPC mechanism should I use?
- </para>
- </question>
- <answer>
- <para>
- Start by reading <xref linkend="other-ipc"/>.
- </para>
- <para>
- If you're writing an Internet or Intranet application, XML-RPC or SOAP
- work for many people. These are standard, available for most
- languages, simple to debug and easy to use.
- </para>
- <para>
- If you're writing a desktop application for UNIX,
- then D-Bus is of course our recommendation for
- talking to other parts of the desktop session.
- </para>
- <para>
- D-Bus is also designed for communications between system daemons and
- communications between the desktop and system daemons.
- </para>
- <para>
- If you're doing something complicated such as clustering,
- distributed swarms, peer-to-peer, or whatever then
- the authors of this FAQ don't have expertise in these
- areas and you should ask someone else or try a search engine.
- D-Bus is most likely a poor choice but could be appropriate
- for some things.
- </para>
- <para>
- Note: the D-Bus mailing list is probably not the place to
- discuss which system is appropriate for your application,
- though you are welcome to ask specific questions about
- D-Bus <emphasis>after reading this FAQ, the tutorial, and
- searching the list archives</emphasis>. The best way
- to search the list archives is probably to use
- an Internet engine such as Google. On Google,
- include "site:freedesktop.org" in your search.
- </para>
- </answer>
- </qandaentry>
-
-
- <qandaentry>
- <question>
- <para>
- How can I submit a bug or patch?
- </para>
- </question>
- <answer>
- <para>
- The D-Bus <ulink url="http://dbus.freedesktop.org">web site</ulink>
- has a link to the bug tracker, which is the best place to store
- patches. You can also post them to the list, especially if you want
- to discuss the patch or get feedback.
- </para>
- </answer>
- </qandaentry>
-
- </qandaset>
-
-</article>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-launch.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-launch.1.xml.in
deleted file mode 100644
index 31dd6eac81..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-launch.1.xml.in
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbuslaunch1'>
-
-<!-- dbus&bsol;-launch manual page.
- Copyright (C) 2003 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-launch</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-launch</refname>
-<refpurpose>Utility to start a message bus from a shell script</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-launch</command>
- <arg choice='opt'>--version </arg>
- <arg choice='opt'>--help </arg>
- <arg choice='opt'>--sh-syntax </arg>
- <arg choice='opt'>--csh-syntax </arg>
- <arg choice='opt'>--auto-syntax </arg>
- <arg choice='opt'>--binary-syntax </arg>
- <arg choice='opt'>--close-stderr </arg>
- <arg choice='opt'>--exit-with-session </arg>
- <arg choice='opt'>--autolaunch=<replaceable>MACHINEID</replaceable></arg>
- <arg choice='opt'>--config-file=<replaceable>FILENAME</replaceable></arg>
- <arg choice='opt'><replaceable>PROGRAM</replaceable></arg>
- <arg choice='opt' rep='repeat'><replaceable>ARGS</replaceable></arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-launch</command> command is used to start a session bus
-instance of <emphasis remap='I'>dbus-daemon</emphasis> from a shell script.
-It would normally be called from a user's login
-scripts. Unlike the daemon itself, <command>dbus-launch</command> exits, so
-backticks or the $() construct can be used to read information from
-<command>dbus-launch</command>.</para>
-
-<para>With no arguments, <command>dbus-launch</command> will launch a session bus
-instance and print the address and PID of that instance to standard
-output.</para>
-
-<para>You may specify a program to be run; in this case, <command>dbus-launch</command>
-will launch a session bus instance, set the appropriate environment
-variables so the specified program can find the bus, and then execute the
-specified program, with the specified arguments. See below for
-examples.</para>
-
-<para>If you launch a program, <command>dbus-launch</command> will not print the
-information about the new bus to standard output.</para>
-
-<para>When <command>dbus-launch</command> prints bus information to standard output, by
-default it is in a simple key-value pairs format. However, you may
-request several alternate syntaxes using the --sh-syntax, --csh-syntax,
---binary-syntax, or
---auto-syntax options. Several of these cause <command>dbus-launch</command> to emit shell code
-to set up the environment.</para>
-
-<para>With the --auto-syntax option, <command>dbus-launch</command> looks at the value
-of the SHELL environment variable to determine which shell syntax
-should be used. If SHELL ends in "csh", then csh-compatible code is
-emitted; otherwise Bourne shell code is emitted. Instead of passing
---auto-syntax, you may explicitly specify a particular one by using
---sh-syntax for Bourne syntax, or --csh-syntax for csh syntax.
-In scripts, it's more robust to avoid --auto-syntax and you hopefully
-know which shell your script is written in.</para>
-
-
-<para>See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information
-about D-Bus. See also the man page for <emphasis remap='I'>dbus-daemon</emphasis>.</para>
-
-</refsect1>
-
-<refsect1 id='examples'><title>EXAMPLES</title>
-<para>Distributions running
-<command>dbus-launch</command>
-as part of a standard X session should run
-<emphasis remap='B'>dbus-launch --exit-with-session</emphasis>
-after the X server has started and become available, as a wrapper around
-the "main" X client (typically a session manager or window manager), as in
-these examples:</para>
-
- <blockquote remap='RS'>
-<para><emphasis remap='B'>dbus-launch --exit-with-session gnome-session</emphasis></para>
-
-<para><emphasis remap='B'>dbus-launch --exit-with-session openbox</emphasis></para>
-
-<para><emphasis remap='B'>dbus-launch --exit-with-session ~/.xsession</emphasis>
- </para></blockquote> <!-- remap='RE' -->
-
-<para>If your distribution does not do this, you can achieve similar results
-by running your session or window manager in the same way in a script
-run by your X session, such as
-<filename>~/.xsession</filename>,
-<filename>~/.xinitrc</filename>
-or
-<filename>~/.Xclients</filename>.</para>
-
-<para>To start a D-Bus session within a text\(hymode session,
- do not use <emphasis remap='B'>dbus-launch</emphasis>.
- Instead, see <citerefentry><refentrytitle>dbus-run-session</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
-</para>
-
-<literallayout remap='.nf'>
- ## test for an existing bus daemon, just to be safe
- if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
- ## if not found, launch a new one
- eval `dbus-launch --sh-syntax`
- echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
- fi
-</literallayout> <!-- .fi -->
-<para>Note that in this case, dbus-launch will exit, and dbus-daemon will not be
-terminated automatically on logout.</para>
-
-</refsect1>
-
-<refsect1 id='automatic_launching'><title>AUTOMATIC LAUNCHING</title>
-<para>If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use
-D-Bus, by default the process will attempt to invoke dbus-launch with
-the --autolaunch option to start up a new session bus or find the
-existing bus address on the X display or in a file in
-~/.dbus/session-bus/</para>
-
-
-<para>Whenever an autolaunch occurs, the application that had to
-start a new bus will be in its own little world; it can effectively
-end up starting a whole new session if it tries to use a lot of
-bus services. This can be suboptimal or even totally broken, depending
-on the app and what it tries to do.</para>
-
-
-<para>There are two common reasons for autolaunch. One is ssh to a remote
-machine. The ideal fix for that would be forwarding of
-DBUS_SESSION_BUS_ADDRESS in the same way that DISPLAY is forwarded.
-In the meantime, you can edit the session.conf config file to
-have your session bus listen on TCP, and manually set
-DBUS_SESSION_BUS_ADDRESS, if you like.</para>
-
-
-<para>The second common reason for autolaunch is an su to another user, and
-display of X applications running as the second user on the display
-belonging to the first user. Perhaps the ideal fix in this case
-would be to allow the second user to connect to the session bus of the
-first user, just as they can connect to the first user's display.
-However, a mechanism for that has not been coded.</para>
-
-
-<para>You can always avoid autolaunch by manually setting
-DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default
-address if none is set is "autolaunch:", so if any other address is
-set there will be no autolaunch. You can however include autolaunch in
-an explicit session bus address as a fallback, for example
-DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" - in that case if
-the first address doesn't work, processes will autolaunch. (The bus
-address variable contains a comma-separated list of addresses to try.)</para>
-
-
-<para>The --autolaunch option is considered an internal implementation
-detail of libdbus, and in fact there are plans to change it. There's
-no real reason to use it outside of the libdbus implementation anyhow.</para>
-
-</refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<para>The following options are supported:</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--auto-syntax</option></term>
- <listitem>
-<para>Choose --csh-syntax or --sh-syntax based on the SHELL environment variable.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--binary-syntax</option></term>
- <listitem>
-<para>Write to stdout a nul-terminated bus address, then the bus PID as a
-binary integer of size sizeof(pid_t), then the bus X window ID as a
-binary integer of size sizeof(long). Integers are in the machine's
-byte order, not network byte order or any other canonical byte order.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--close-stderr</option></term>
- <listitem>
-<para>Close the standard error output stream before starting the D-Bus
-daemon. This is useful if you want to capture dbus-launch error
-messages but you don't want dbus-daemon to keep the stream open to
-your application.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--config-file=FILENAME</option></term>
- <listitem>
-<para>Pass --config-file=FILENAME to the bus daemon, instead of passing it
-the --session argument. See the man page for dbus-daemon</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--csh-syntax</option></term>
- <listitem>
-<para>Emit csh compatible code to set up environment variables.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--exit-with-session</option></term>
- <listitem>
-<para>If this option is provided, a persistent "babysitter" process will be
-created that watches stdin for HUP and tries to connect to the X
-server. If this process gets a HUP on stdin or loses its X connection,
-it kills the message bus daemon.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--autolaunch=MACHINEID</option></term>
- <listitem>
-<para>This option implies that <command>dbus-launch</command> should scan for a
-previously-started session and reuse the values found there. If no
-session is found, it will start a new session. The
---exit-with-session option is implied if --autolaunch is given.
-This option is for the exclusive use of libdbus, you do not want to
-use it manually. It may change in the future.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--sh-syntax</option></term>
- <listitem>
-<para>Emit Bourne-shell compatible code to set up environment variables.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--version</option></term>
- <listitem>
-<para>Print the version of dbus-launch</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--help</option></term>
- <listitem>
-<para>Print the help info of dbus-launch</para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='notes'><title>NOTES</title>
-<para>If you run
-<emphasis remap='B'>dbus-launch myapp</emphasis>
-(with any other options), dbus-daemon will
-<emphasis remap='I'>not</emphasis>
-exit when
-<emphasis remap='B'>myapp</emphasis>
-terminates: this is because
-<emphasis remap='B'>myapp</emphasis>
-is assumed to be part of a larger session, rather than a session in its
-own right.</para>
-
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-monitor.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-monitor.1.xml.in
deleted file mode 100644
index af05e3aaf5..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-monitor.1.xml.in
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbusmonitor1'>
-
-<!-- dbus&bsol;-monitor manual page.
- Copyright (C) 2003 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-monitor</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-monitor</refname>
-<refpurpose>debug probe to print message bus messages</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-monitor</command>
- <group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg><arg choice='plain'>--address <replaceable>ADDRESS</replaceable></arg></group>
- <group choice='opt'><arg choice='plain'>--profile </arg><arg choice='plain'>--monitor </arg></group>
- <arg choice='opt'><arg choice='plain'><replaceable>watch</replaceable></arg><arg choice='plain'><replaceable>expressions</replaceable></arg></arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-monitor</command> command is used to monitor messages going
-through a D-Bus message bus. See
-<ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information about
-the big picture.</para>
-
-
-<para>There are two well-known message buses: the systemwide message bus
-(installed on many systems as the "messagebus" service) and the
-per-user-login-session message bus (started each time a user logs in).
-The --system and --session options direct <command>dbus-monitor</command> to
-monitor the system or session buses respectively. If neither is
-specified, <command>dbus-monitor</command> monitors the session bus.</para>
-
-
-<para><command>dbus-monitor</command> has two different output modes, the 'classic'-style
-monitoring mode and profiling mode. The profiling format is a compact
-format with a single line per message and microsecond-resolution timing
-information. The --profile and --monitor options select the profiling
-and monitoring output format respectively. If neither is specified,
-<command>dbus-monitor</command> uses the monitoring output format.</para>
-
-
-<para>In order to get <command>dbus-monitor</command> to see the messages you are interested
-in, you should specify a set of watch expressions as you would expect to
-be passed to the <emphasis remap='I'>dbus_bus_add_match</emphasis> function.</para>
-
-
-<para>The message bus configuration may keep <command>dbus-monitor</command> from seeing
-all messages, especially if you run the monitor as a non-root user.</para>
-
-</refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--system</option></term>
- <listitem>
-<para>Monitor the system message bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--session</option></term>
- <listitem>
-<para>Monitor the session message bus. (This is the default.)</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--address ADDRESS</option></term>
- <listitem>
-<para>Monitor an arbitrary message bus given at ADDRESS.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--profile</option></term>
- <listitem>
-<para>Use the profiling output format.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--monitor</option></term>
- <listitem>
-<para>Use the monitoring output format. (This is the default.)</para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='example'><title>EXAMPLE</title>
-<para>Here is an example of using dbus-monitor to watch for the gnome typing
-monitor to say things</para>
-<literallayout remap='.nf'>
-
- dbus-monitor "type='signal',sender='org.gnome.TypingMonitor',interface='org.gnome.TypingMonitor'"
-
-</literallayout> <!-- .fi -->
-
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>dbus-monitor was written by Philip Blundell.
-The profiling output mode was added by Olli Salli.</para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-run-session.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-run-session.1.xml.in
deleted file mode 100644
index 5181a8b1ac..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-run-session.1.xml.in
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbusrunsession1'>
-<refmeta>
-<refentrytitle>dbus-run-session</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-run-session</refname>
-<refpurpose>start a process as a new D-Bus session</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-run-session</command>
- <arg choice='opt'><arg choice='plain'>--config-file </arg><arg choice='plain'><replaceable>FILENAME</replaceable></arg></arg>
- <arg choice='opt'><arg choice='plain'>--dbus-daemon </arg><arg choice='plain'><replaceable>BINARY</replaceable></arg></arg>
- <arg choice='opt'>-- </arg>
- <arg choice='plain'><replaceable>PROGRAM</replaceable></arg>
- <arg choice='opt' rep='repeat'><replaceable>ARGUMENTS</replaceable></arg>
-</cmdsynopsis>
-<cmdsynopsis>
- <command>dbus-run-session</command> <arg choice='plain'>--help </arg>
-</cmdsynopsis>
-<cmdsynopsis>
- <command>dbus-run-session</command> <arg choice='plain'>--version </arg>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para><command>dbus-run-session</command>
-is used to start a session bus instance of
-<emphasis remap='B'>dbus-daemon</emphasis>
-from a shell script, and start a specified program in that session. The
-<emphasis remap='B'>dbus-daemon</emphasis>
-will run for as long as the program does, after which it will terminate.</para>
-
-<para>One use is to run a shell with its own
-<emphasis remap='B'>dbus-daemon</emphasis>
-in a text&hyphen;mode or SSH session, and have the
-<emphasis remap='B'>dbus-daemon</emphasis>
-terminate automatically on leaving the sub&hyphen;shell, like this:</para>
-
-<para> dbus-run-session -- bash</para>
-
-<para>or to replace the login shell altogether, by combining <command>dbus-run-session</command>
-with the <emphasis remap='B'>exec</emphasis> builtin:</para>
-
-<para> exec dbus-run-session -- bash</para>
-
-<para>Another use is to run regression tests and similar things in an isolated
-D-Bus session, to avoid either interfering with the "real" D-Bus session
-or relying on there already being a D-Bus session active, for instance:</para>
-
-<para> dbus-run-session -- make check</para>
-
-<para>or (in
-<citerefentry><refentrytitle>automake</refentrytitle><manvolnum>1</manvolnum></citerefentry>):</para>
-
-<literallayout remap='.nf'>
- TESTS_ENVIRONMENT = MY_DEBUG=all dbus-run-session --
-
-</literallayout></refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--config-file=</option><replaceable>FILENAME</replaceable>, <option>--config-file</option> <replaceable>FILENAME</replaceable></term>
- <listitem>
-<para>Pass
-<option>--config-file=</option><replaceable>FILENAME</replaceable>
-to the bus daemon, instead of passing it the
-<option>--session</option>
-argument. See
-<citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--dbus-daemon=</option><replaceable>BINARY</replaceable>, <option>--dbus-daemon</option> <replaceable>BINARY</replaceable></term>
- <listitem>
-<para>Run <emphasis remap='I'>BINARY</emphasis> as <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>, instead of searching the <envar>PATH</envar>
-in the usual way for an executable called <emphasis remap='B'>dbus-daemon</emphasis>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--help</option></term>
- <listitem>
-<para>Print usage information and exit.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--version</option></term>
- <listitem>
-<para>Print the version of dbus-run-session and exit.</para>
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='exit_status'><title>EXIT STATUS</title>
-<para><command>dbus-run-session</command>
-exits with the exit status of
-<emphasis remap='I'>PROGRAM</emphasis>,
-0 if the
-<option>--help</option> or <option>--version</option>
-options were used, 127 on an error within
-<command>dbus-run-session</command>
-itself, or
-128+<emphasis remap='I'>n</emphasis>
-if the
-<emphasis remap='I'>PROGRAM</emphasis>
-was killed by signal
-<emphasis remap='I'>n</emphasis>.</para>
-</refsect1>
-
-<refsect1 id='environment'><title>ENVIRONMENT</title>
-<para><envar>PATH</envar>
-is searched to find
-<emphasis remap='I'>PROGRAM</emphasis>,
-and (if the --dbus-daemon option is not used or its argument does not
-contain a
-<emphasis remap='B'>/</emphasis> character) to find <emphasis remap='B'>dbus-daemon</emphasis>.</para>
-
-<para>The session bus' address is made available to
-<emphasis remap='I'>PROGRAM</emphasis>
-in the environment variable
-<emphasis remap='B'>DBUS_SESSION_BUS_ADDRESS</emphasis>.</para>
-
-<para>The variables
- <emphasis remap='B'>DBUS_SESSION_BUS_PID</emphasis>,
- <emphasis remap='B'>DBUS_SESSION_BUS_WINDOWID</emphasis>,
- <emphasis remap='B'>DBUS_STARTER_BUS_TYPE</emphasis> and
- <emphasis remap='B'>DBUS_STARTER_ADDRESS</emphasis>
- are removed from the environment, if present.</para>
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-
-<refsect1 id='see_also'><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>dbus-launch</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-send.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-send.1.xml.in
deleted file mode 100644
index 67b6dfd27b..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-send.1.xml.in
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbussend1'>
-
-<!-- dbus&bsol;-send manual page.
- Copyright (C) 2003 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-send</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-send</refname>
-<refpurpose>Send a message to a message bus</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-send</command>
- <group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg><arg choice='plain'>--address=<replaceable>ADDRESS</replaceable></arg></group>
- <arg choice='opt'>--dest=<replaceable>NAME</replaceable></arg>
- <arg choice='opt'><arg choice='plain'>--print-reply </arg><arg choice='opt'><replaceable>=literal</replaceable></arg></arg>
- <arg choice='opt'>--reply-timeout=<replaceable>MSEC</replaceable></arg>
- <arg choice='opt'>--type=<replaceable>TYPE</replaceable></arg>
- <arg choice='plain'><replaceable>OBJECT_PATH</replaceable></arg>
- <arg choice='plain'><replaceable>INTERFACE.MEMBER</replaceable></arg>
- <arg choice='opt' rep='repeat'><replaceable>CONTENTS</replaceable></arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-send</command> command is used to send a message to a D-Bus message
-bus. See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more
-information about the big picture.</para>
-
-
-<para>There are two well-known message buses: the systemwide message bus
-(installed on many systems as the "messagebus" service) and the
-per-user-login-session message bus (started each time a user logs in).
-The <option>--system</option> and <option>--session</option> options direct
-<command>dbus-send</command> to send messages to the system or session buses respectively.
-If neither is specified, <command>dbus-send</command> sends to the session bus.</para>
-
-
-<para>Nearly all uses of <command>dbus-send</command> must provide the <option>--dest</option> argument
-which is the name of a connection on the bus to send the message to. If
-<option>--dest</option> is omitted, no destination is set.</para>
-
-
-<para>The object path and the name of the message to send must always be
-specified. Following arguments, if any, are the message contents
-(message arguments). These are given as type-specified values and
-may include containers (arrays, dicts, and variants) as described below.</para>
-
-<literallayout remap='.nf'>
-&lt;contents&gt; ::= &lt;item&gt; | &lt;container&gt; [ &lt;item&gt; | &lt;container&gt;...]
-&lt;item&gt; ::= &lt;type&gt;:&lt;value&gt;
-&lt;container&gt; ::= &lt;array&gt; | &lt;dict&gt; | &lt;variant&gt;
-&lt;array&gt; ::= array:&lt;type&gt;:&lt;value&gt;[,&lt;value&gt;...]
-&lt;dict&gt; ::= dict:&lt;type&gt;:&lt;type&gt;:&lt;key&gt;,&lt;value&gt;[,&lt;key&gt;,&lt;value&gt;...]
-&lt;variant&gt; ::= variant:&lt;type&gt;:&lt;value&gt;
-&lt;type&gt; ::= string | int16 | uint 16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
-</literallayout> <!-- .fi -->
-
-<para>D-Bus supports more types than these, but <command>dbus-send</command> currently
-does not. Also, <command>dbus-send</command> does not permit empty containers
-or nested containers (e.g. arrays of variants).</para>
-
-
-<para>Here is an example invocation:</para>
-<literallayout remap='.nf'>
-
- dbus-send --dest=org.freedesktop.ExampleName &bsol;
- /org/freedesktop/sample/object/name &bsol;
- org.freedesktop.ExampleInterface.ExampleMethod &bsol;
- int32:47 string:'hello world' double:65.32 &bsol;
- array:string:"1st item","next item","last item" &bsol;
- dict:string:int32:"one",1,"two",2,"three",3 &bsol;
- variant:int32:-8 &bsol;
- objpath:/org/freedesktop/sample/object/name
-
-</literallayout> <!-- .fi -->
-
-<para>Note that the interface is separated from a method or signal
-name by a dot, though in the actual protocol the interface
-and the interface member are separate fields.</para>
-
-</refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<para>The following options are supported:</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--dest=</option><replaceable>NAME</replaceable></term>
- <listitem>
-<para>Specify the name of the connection to receive the message.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--print-reply</option></term>
- <listitem>
-<para>Block for a reply to the message sent, and print any reply received
-in a human-readable form. It also means the message type (<option>--type=</option>) is <emphasis remap='B'>method_call</emphasis>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--print-reply=literal</option></term>
- <listitem>
-<para>Block for a reply to the message sent, and print the body of the
-reply. If the reply is an object path or a string, it is printed
-literally, with no punctuation, escape characters etc.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--reply-timeout=</option><replaceable>MSEC</replaceable></term>
- <listitem>
-<para>Wait for a reply for up to <emphasis remap='I'>MSEC</emphasis> milliseconds.
-The default is implementation&hyphen;defined, typically 25 seconds.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--system</option></term>
- <listitem>
-<para>Send to the system message bus.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--session</option></term>
- <listitem>
-<para>Send to the session message bus. (This is the default.)</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--address=</option><replaceable>ADDRESS</replaceable></term>
- <listitem>
-<para>Send to <replaceable>ADDRESS</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--type=</option><replaceable>TYPE</replaceable></term>
- <listitem>
-<para>Specify <emphasis remap='B'>method_call</emphasis> or <emphasis remap='B'>signal</emphasis> (defaults to "<emphasis remap='B'>signal</emphasis>").</para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>dbus-send was written by Philip Blundell.</para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-specification.xml b/src/3rd_party/dbus-1.7.8/doc/dbus-specification.xml
deleted file mode 100644
index bc374b9b58..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-specification.xml
+++ /dev/null
@@ -1,6116 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
-[
-]>
-<article id="index">
- <articleinfo>
- <title>D-Bus Specification</title>
- <releaseinfo>Version 0.22</releaseinfo>
- <date>2013-10-09</date>
- <authorgroup>
- <author>
- <firstname>Havoc</firstname>
- <surname>Pennington</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>hp@pobox.com</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>Anders</firstname>
- <surname>Carlsson</surname>
- <affiliation>
- <orgname>CodeFactory AB</orgname>
- <address>
- <email>andersca@codefactory.se</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>Alexander</firstname>
- <surname>Larsson</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>alexl@redhat.com</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>Sven</firstname>
- <surname>Herzberg</surname>
- <affiliation>
- <orgname>Imendio AB</orgname>
- <address>
- <email>sven@imendio.com</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>Simon</firstname>
- <surname>McVittie</surname>
- <affiliation>
- <orgname>Collabora Ltd.</orgname>
- <address>
- <email>simon.mcvittie@collabora.co.uk</email>
- </address>
- </affiliation>
- </author>
- <author>
- <firstname>David</firstname>
- <surname>Zeuthen</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>davidz@redhat.com</email>
- </address>
- </affiliation>
- </author>
- </authorgroup>
- <revhistory>
- <revision>
- <revnumber>0.22</revnumber>
- <date>2013-10-09</date>
- <authorinitials></authorinitials>
- <revremark>add GetConnectionCredentials, document
- GetAtdAuditSessionData, document GetConnectionSELinuxSecurityContext,
- document and correct .service file syntax and naming
- </revremark>
- </revision>
- <revision>
- <revnumber>0.21</revnumber>
- <date>2013-04-25</date>
- <authorinitials>smcv</authorinitials>
- <revremark>allow Unicode noncharacters in UTF-8 (Unicode
- Corrigendum #9)</revremark>
- </revision>
- <revision>
- <revnumber>0.20</revnumber>
- <date>22 February 2013</date>
- <authorinitials>smcv, walters</authorinitials>
- <revremark>reorganise for clarity, remove false claims about
- basic types, mention /o/fd/DBus</revremark>
- </revision>
- <revision>
- <revnumber>0.19</revnumber>
- <date>20 February 2012</date>
- <authorinitials>smcv/lp</authorinitials>
- <revremark>formally define unique connection names and well-known
- bus names; document best practices for interface, bus, member and
- error names, and object paths; document the search path for session
- and system services on Unix; document the systemd transport</revremark>
- </revision>
- <revision>
- <revnumber>0.18</revnumber>
- <date>29 July 2011</date>
- <authorinitials>smcv</authorinitials>
- <revremark>define eavesdropping, unicast, broadcast; add eavesdrop
- match keyword; promote type system to a top-level section</revremark>
- </revision>
- <revision>
- <revnumber>0.17</revnumber>
- <date>1 June 2011</date>
- <authorinitials>smcv/davidz</authorinitials>
- <revremark>define ObjectManager; reserve extra pseudo-type-codes used
- by GVariant</revremark>
- </revision>
- <revision>
- <revnumber>0.16</revnumber>
- <date>11 April 2011</date>
- <authorinitials></authorinitials>
- <revremark>add path_namespace, arg0namespace; argNpath matches object
- paths</revremark>
- </revision>
- <revision>
- <revnumber>0.15</revnumber>
- <date>3 November 2010</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.14</revnumber>
- <date>12 May 2010</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.13</revnumber>
- <date>23 Dezember 2009</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.12</revnumber>
- <date>7 November, 2006</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.11</revnumber>
- <date>6 February 2005</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.10</revnumber>
- <date>28 January 2005</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.9</revnumber>
- <date>7 Januar 2005</date>
- <authorinitials></authorinitials>
- <revremark></revremark>
- </revision>
- <revision>
- <revnumber>0.8</revnumber>
- <date>06 September 2003</date>
- <authorinitials></authorinitials>
- <revremark>First released document.</revremark>
- </revision>
- </revhistory>
- </articleinfo>
-
- <sect1 id="introduction">
- <title>Introduction</title>
- <para>
- D-Bus is a system for low-overhead, easy to use
- interprocess communication (IPC). In more detail:
- <itemizedlist>
- <listitem>
- <para>
- D-Bus is <emphasis>low-overhead</emphasis> because it uses a
- binary protocol, and does not have to convert to and from a text
- format such as XML. Because D-Bus is intended for potentially
- high-resolution same-machine IPC, not primarily for Internet IPC,
- this is an interesting optimization. D-Bus is also designed to
- avoid round trips and allow asynchronous operation, much like
- the X protocol.
- </para>
- </listitem>
- <listitem>
- <para>
- D-Bus is <emphasis>easy to use</emphasis> because it works in terms
- of <firstterm>messages</firstterm> rather than byte streams, and
- automatically handles a lot of the hard IPC issues. Also, the D-Bus
- library is designed to be wrapped in a way that lets developers use
- their framework's existing object/type system, rather than learning
- a new one specifically for IPC.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- The base D-Bus protocol is a one-to-one (peer-to-peer or client-server)
- protocol, specified in <xref linkend="message-protocol"/>. That is, it is
- a system for one application to talk to a single other
- application. However, the primary intended application of the protocol is the
- D-Bus <firstterm>message bus</firstterm>, specified in <xref
- linkend="message-bus"/>. The message bus is a special application that
- accepts connections from multiple other applications, and forwards
- messages among them.
- </para>
-
- <para>
- Uses of D-Bus include notification of system changes (notification of when
- a camera is plugged in to a computer, or a new version of some software
- has been installed), or desktop interoperability, for example a file
- monitoring service or a configuration service.
- </para>
-
- <para>
- D-Bus is designed for two specific use cases:
- <itemizedlist>
- <listitem>
- <para>
- A "system bus" for notifications from the system to user sessions,
- and to allow the system to request input from user sessions.
- </para>
- </listitem>
- <listitem>
- <para>
- A "session bus" used to implement desktop environments such as
- GNOME and KDE.
- </para>
- </listitem>
- </itemizedlist>
- D-Bus is not intended to be a generic IPC system for any possible
- application, and intentionally omits many features found in other
- IPC systems for this reason.
- </para>
-
- <para>
- At the same time, the bus daemons offer a number of features not found in
- other IPC systems, such as single-owner "bus names" (similar to X
- selections), on-demand startup of services, and security policies.
- In many ways, these features are the primary motivation for developing
- D-Bus; other systems would have sufficed if IPC were the only goal.
- </para>
-
- <para>
- D-Bus may turn out to be useful in unanticipated applications, but future
- versions of this spec and the reference implementation probably will not
- incorporate features that interfere with the core use cases.
- </para>
-
- <para>
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in RFC 2119. However, the
- document could use a serious audit to be sure it makes sense to do
- so. Also, they are not capitalized.
- </para>
-
- <sect2 id="stability">
- <title>Protocol and Specification Stability</title>
- <para>
- The D-Bus protocol is frozen (only compatible extensions are allowed) as
- of November 8, 2006. However, this specification could still use a fair
- bit of work to make interoperable reimplementation possible without
- reference to the D-Bus reference implementation. Thus, this
- specification is not marked 1.0. To mark it 1.0, we'd like to see
- someone invest significant effort in clarifying the specification
- language, and growing the specification to cover more aspects of the
- reference implementation's behavior.
- </para>
- <para>
- Until this work is complete, any attempt to reimplement D-Bus will
- probably require looking at the reference implementation and/or asking
- questions on the D-Bus mailing list about intended behavior.
- Questions on the list are very welcome.
- </para>
- <para>
- Nonetheless, this document should be a useful starting point and is
- to our knowledge accurate, though incomplete.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="type-system">
- <title>Type System</title>
-
- <para>
- D-Bus has a type system, in which values of various types can be
- serialized into a sequence of bytes referred to as the
- <firstterm>wire format</firstterm> in a standard way.
- Converting a value from some other representation into the wire
- format is called <firstterm>marshaling</firstterm> and converting
- it back from the wire format is <firstterm>unmarshaling</firstterm>.
- </para>
-
- <para>
- The D-Bus protocol does not include type tags in the marshaled data; a
- block of marshaled values must have a known <firstterm>type
- signature</firstterm>. The type signature is made up of zero or more
- <firstterm id="term-single-complete-type">single complete
- types</firstterm>, each made up of one or more
- <firstterm>type codes</firstterm>.
- </para>
-
- <para>
- A type code is an ASCII character representing the
- type of a value. Because ASCII characters are used, the type signature
- will always form a valid ASCII string. A simple string compare
- determines whether two type signatures are equivalent.
- </para>
-
- <para>
- A single complete type is a sequence of type codes that fully describes
- one type: either a basic type, or a single fully-described container type.
- A single complete type is a basic type code, a variant type code,
- an array with its element type, or a struct with its fields (all of which
- are defined below). So the following signatures are not single complete
- types:
- <programlisting>
- "aa"
- </programlisting>
- <programlisting>
- "(ii"
- </programlisting>
- <programlisting>
- "ii)"
- </programlisting>
- And the following signatures contain multiple complete types:
- <programlisting>
- "ii"
- </programlisting>
- <programlisting>
- "aiai"
- </programlisting>
- <programlisting>
- "(ii)(ii)"
- </programlisting>
- Note however that a single complete type may <emphasis>contain</emphasis>
- multiple other single complete types, by containing a struct or dict
- entry.
- </para>
-
- <sect2 id="basic-types">
- <title>Basic types</title>
-
- <para>
- The simplest type codes are the <firstterm id="term-basic-type">basic
- types</firstterm>, which are the types whose structure is entirely
- defined by their 1-character type code. Basic types consist of
- fixed types and string-like types.
- </para>
-
- <para>
- The <firstterm id="term-fixed-type">fixed types</firstterm>
- are basic types whose values have a fixed length, namely BYTE,
- BOOLEAN, DOUBLE, UNIX_FD, and signed or unsigned integers of length
- 16, 32 or 64 bits.
- </para>
-
- <para>
- As a simple example, the type code for 32-bit integer (<literal>INT32</literal>) is
- the ASCII character 'i'. So the signature for a block of values
- containing a single <literal>INT32</literal> would be:
- <programlisting>
- "i"
- </programlisting>
- A block of values containing two <literal>INT32</literal> would have this signature:
- <programlisting>
- "ii"
- </programlisting>
- </para>
-
- <para>
- The characteristics of the fixed types are listed in this table.
-
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional name</entry>
- <entry>ASCII type-code</entry>
- <entry>Encoding</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>BYTE</literal></entry>
- <entry><literal>y</literal> (121)</entry>
- <entry>Unsigned 8-bit integer</entry>
- </row>
- <row>
- <entry><literal>BOOLEAN</literal></entry>
- <entry><literal>b</literal> (98)</entry>
- <entry>Boolean value: 0 is false, 1 is true, any other value
- allowed by the marshalling format is invalid</entry>
- </row>
- <row>
- <entry><literal>INT16</literal></entry>
- <entry><literal>n</literal> (110)</entry>
- <entry>Signed (two's complement) 16-bit integer</entry>
- </row>
- <row>
- <entry><literal>UINT16</literal></entry>
- <entry><literal>q</literal> (113)</entry>
- <entry>Unsigned 16-bit integer</entry>
- </row>
- <row>
- <entry><literal>INT32</literal></entry>
- <entry><literal>i</literal> (105)</entry>
- <entry>Signed (two's complement) 32-bit integer</entry>
- </row>
- <row>
- <entry><literal>UINT32</literal></entry>
- <entry><literal>u</literal> (117)</entry>
- <entry>Unsigned 32-bit integer</entry>
- </row>
- <row>
- <entry><literal>INT64</literal></entry>
- <entry><literal>x</literal> (120)</entry>
- <entry>Signed (two's complement) 64-bit integer
- (mnemonic: x and t are the first characters in "sixty" not
- already used for something more common)</entry>
- </row>
- <row>
- <entry><literal>UINT64</literal></entry>
- <entry><literal>t</literal> (116)</entry>
- <entry>Unsigned 64-bit integer</entry>
- </row>
- <row>
- <entry><literal>DOUBLE</literal></entry>
- <entry><literal>d</literal> (100)</entry>
- <entry>IEEE 754 double-precision floating point</entry>
- </row>
- <row>
- <entry><literal>UNIX_FD</literal></entry>
- <entry><literal>h</literal> (104)</entry>
- <entry>Unsigned 32-bit integer representing an index into an
- out-of-band array of file descriptors, transferred via some
- platform-specific mechanism (mnemonic: h for handle)</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <para>
- The <firstterm id="term-string-like-type">string-like types</firstterm>
- are basic types with a variable length. The value of any string-like
- type is conceptually 0 or more Unicode codepoints encoded in UTF-8,
- none of which may be U+0000. The UTF-8 text must be validated
- strictly: in particular, it must not contain overlong sequences
- or codepoints above U+10FFFF.
- </para>
-
- <para>
- Since D-Bus Specification version 0.21, in accordance with Unicode
- Corrigendum #9, the "noncharacters" U+FDD0..U+FDEF, U+nFFFE and
- U+nFFFF are allowed in UTF-8 strings (but note that older versions of
- D-Bus rejected these noncharacters).
- </para>
-
- <para>
- The marshalling formats for the string-like types all end with a
- single zero (NUL) byte, but that byte is not considered to be part of
- the text.
- </para>
-
- <para>
- The characteristics of the string-like types are listed in this table.
-
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional name</entry>
- <entry>ASCII type-code</entry>
- <entry>Validity constraints</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>STRING</literal></entry>
- <entry><literal>s</literal> (115)</entry>
- <entry>No extra constraints</entry>
- </row>
- <row>
- <entry><literal>OBJECT_PATH</literal></entry>
- <entry><literal>o</literal> (111)</entry>
- <entry>Must be
- <link linkend="message-protocol-marshaling-object-path">a
- syntactically valid object path</link></entry>
- </row>
- <row>
- <entry><literal>SIGNATURE</literal></entry>
- <entry><literal>g</literal> (103)</entry>
- <entry>Zero or more
- <firstterm linkend="term-single-complete-type">single
- complete types</firstterm></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <sect3 id="message-protocol-marshaling-object-path">
- <title>Valid Object Paths</title>
-
- <para>
- An object path is a name used to refer to an object instance.
- Conceptually, each participant in a D-Bus message exchange may have
- any number of object instances (think of C++ or Java objects) and each
- such instance will have a path. Like a filesystem, the object
- instances in an application form a hierarchical tree.
- </para>
-
- <para>
- Object paths are often namespaced by starting with a reversed
- domain name and containing an interface version number, in the
- same way as
- <link linkend="message-protocol-names-interface">interface
- names</link> and
- <link linkend="message-protocol-names-bus">well-known
- bus names</link>.
- This makes it possible to implement more than one service, or
- more than one version of a service, in the same process,
- even if the services share a connection but cannot otherwise
- co-operate (for instance, if they are implemented by different
- plugins).
- </para>
-
- <para>
- For instance, if the owner of <literal>example.com</literal> is
- developing a D-Bus API for a music player, they might use the
- hierarchy of object paths that start with
- <literal>/com/example/MusicPlayer1</literal> for its objects.
- </para>
-
- <para>
- The following rules define a valid object path. Implementations must
- not send or accept messages with invalid object paths.
- <itemizedlist>
- <listitem>
- <para>
- The path may be of any length.
- </para>
- </listitem>
- <listitem>
- <para>
- The path must begin with an ASCII '/' (integer 47) character,
- and must consist of elements separated by slash characters.
- </para>
- </listitem>
- <listitem>
- <para>
- Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_"
- </para>
- </listitem>
- <listitem>
- <para>
- No element may be the empty string.
- </para>
- </listitem>
- <listitem>
- <para>
- Multiple '/' characters cannot occur in sequence.
- </para>
- </listitem>
- <listitem>
- <para>
- A trailing '/' character is not allowed unless the
- path is the root path (a single '/' character).
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- </sect3>
-
- <sect3 id="message-protocol-marshaling-signature">
- <title>Valid Signatures</title>
- <para>
- An implementation must not send or accept invalid signatures.
- Valid signatures will conform to the following rules:
- <itemizedlist>
- <listitem>
- <para>
- The signature is a list of single complete types.
- Arrays must have element types, and structs must
- have both open and close parentheses.
- </para>
- </listitem>
- <listitem>
- <para>
- Only type codes, open and close parentheses, and open and
- close curly brackets are allowed in the signature. The
- <literal>STRUCT</literal> type code
- is not allowed in signatures, because parentheses
- are used instead. Similarly, the
- <literal>DICT_ENTRY</literal> type code is not allowed in
- signatures, because curly brackets are used instead.
- </para>
- </listitem>
- <listitem>
- <para>
- The maximum depth of container type nesting is 32 array type
- codes and 32 open parentheses. This implies that the maximum
- total depth of recursion is 64, for an "array of array of array
- of ... struct of struct of struct of ..." where there are 32
- array and 32 struct.
- </para>
- </listitem>
- <listitem>
- <para>
- The maximum length of a signature is 255.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- When signatures appear in messages, the marshalling format
- guarantees that they will be followed by a nul byte (which can
- be interpreted as either C-style string termination or the INVALID
- type-code), but this is not conceptually part of the signature.
- </para>
- </sect3>
-
- </sect2>
-
- <sect2 id="container-types">
- <title>Container types</title>
-
- <para>
- In addition to basic types, there are four <firstterm>container</firstterm>
- types: <literal>STRUCT</literal>, <literal>ARRAY</literal>, <literal>VARIANT</literal>,
- and <literal>DICT_ENTRY</literal>.
- </para>
-
- <para>
- <literal>STRUCT</literal> has a type code, ASCII character 'r', but this type
- code does not appear in signatures. Instead, ASCII characters
- '(' and ')' are used to mark the beginning and end of the struct.
- So for example, a struct containing two integers would have this
- signature:
- <programlisting>
- "(ii)"
- </programlisting>
- Structs can be nested, so for example a struct containing
- an integer and another struct:
- <programlisting>
- "(i(ii))"
- </programlisting>
- The value block storing that struct would contain three integers; the
- type signature allows you to distinguish "(i(ii))" from "((ii)i)" or
- "(iii)" or "iii".
- </para>
-
- <para>
- The <literal>STRUCT</literal> type code 'r' is not currently used in the D-Bus protocol,
- but is useful in code that implements the protocol. This type code
- is specified to allow such code to interoperate in non-protocol contexts.
- </para>
-
- <para>
- Empty structures are not allowed; there must be at least one
- type code between the parentheses.
- </para>
-
- <para>
- <literal>ARRAY</literal> has ASCII character 'a' as type code. The array type code must be
- followed by a <firstterm>single complete type</firstterm>. The single
- complete type following the array is the type of each array element. So
- the simple example is:
- <programlisting>
- "ai"
- </programlisting>
- which is an array of 32-bit integers. But an array can be of any type,
- such as this array-of-struct-with-two-int32-fields:
- <programlisting>
- "a(ii)"
- </programlisting>
- Or this array of array of integer:
- <programlisting>
- "aai"
- </programlisting>
- </para>
-
- <para>
- <literal>VARIANT</literal> has ASCII character 'v' as its type code. A marshaled value of
- type <literal>VARIANT</literal> will have the signature of a single complete type as part
- of the <emphasis>value</emphasis>. This signature will be followed by a
- marshaled value of that type.
- </para>
-
- <para>
- Unlike a message signature, the variant signature can
- contain only a single complete type. So "i", "ai"
- or "(ii)" is OK, but "ii" is not. Use of variants may not
- cause a total message depth to be larger than 64, including
- other container types such as structures.
- </para>
-
- <para>
- A <literal>DICT_ENTRY</literal> works exactly like a struct, but rather
- than parentheses it uses curly braces, and it has more restrictions.
- The restrictions are: it occurs only as an array element type; it has
- exactly two single complete types inside the curly braces; the first
- single complete type (the "key") must be a basic type rather than a
- container type. Implementations must not accept dict entries outside of
- arrays, must not accept dict entries with zero, one, or more than two
- fields, and must not accept dict entries with non-basic-typed keys. A
- dict entry is always a key-value pair.
- </para>
-
- <para>
- The first field in the <literal>DICT_ENTRY</literal> is always the key.
- A message is considered corrupt if the same key occurs twice in the same
- array of <literal>DICT_ENTRY</literal>. However, for performance reasons
- implementations are not required to reject dicts with duplicate keys.
- </para>
-
- <para>
- In most languages, an array of dict entry would be represented as a
- map, hash table, or dict object.
- </para>
- </sect2>
-
- <sect2>
- <title>Summary of types</title>
-
- <para>
- The following table summarizes the D-Bus types.
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Code</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>INVALID</literal></entry>
- <entry>0 (ASCII NUL)</entry>
- <entry>Not a valid type code, used to terminate signatures</entry>
- </row><row>
- <entry><literal>BYTE</literal></entry>
- <entry>121 (ASCII 'y')</entry>
- <entry>8-bit unsigned integer</entry>
- </row><row>
- <entry><literal>BOOLEAN</literal></entry>
- <entry>98 (ASCII 'b')</entry>
- <entry>Boolean value, 0 is <literal>FALSE</literal> and 1 is <literal>TRUE</literal>. Everything else is invalid.</entry>
- </row><row>
- <entry><literal>INT16</literal></entry>
- <entry>110 (ASCII 'n')</entry>
- <entry>16-bit signed integer</entry>
- </row><row>
- <entry><literal>UINT16</literal></entry>
- <entry>113 (ASCII 'q')</entry>
- <entry>16-bit unsigned integer</entry>
- </row><row>
- <entry><literal>INT32</literal></entry>
- <entry>105 (ASCII 'i')</entry>
- <entry>32-bit signed integer</entry>
- </row><row>
- <entry><literal>UINT32</literal></entry>
- <entry>117 (ASCII 'u')</entry>
- <entry>32-bit unsigned integer</entry>
- </row><row>
- <entry><literal>INT64</literal></entry>
- <entry>120 (ASCII 'x')</entry>
- <entry>64-bit signed integer</entry>
- </row><row>
- <entry><literal>UINT64</literal></entry>
- <entry>116 (ASCII 't')</entry>
- <entry>64-bit unsigned integer</entry>
- </row><row>
- <entry><literal>DOUBLE</literal></entry>
- <entry>100 (ASCII 'd')</entry>
- <entry>IEEE 754 double</entry>
- </row><row>
- <entry><literal>STRING</literal></entry>
- <entry>115 (ASCII 's')</entry>
- <entry>UTF-8 string (<emphasis>must</emphasis> be valid UTF-8). Must be nul terminated and contain no other nul bytes.</entry>
- </row><row>
- <entry><literal>OBJECT_PATH</literal></entry>
- <entry>111 (ASCII 'o')</entry>
- <entry>Name of an object instance</entry>
- </row><row>
- <entry><literal>SIGNATURE</literal></entry>
- <entry>103 (ASCII 'g')</entry>
- <entry>A type signature</entry>
- </row><row>
- <entry><literal>ARRAY</literal></entry>
- <entry>97 (ASCII 'a')</entry>
- <entry>Array</entry>
- </row><row>
- <entry><literal>STRUCT</literal></entry>
- <entry>114 (ASCII 'r'), 40 (ASCII '('), 41 (ASCII ')')</entry>
- <entry>Struct; type code 114 'r' is reserved for use in
- bindings and implementations to represent the general
- concept of a struct, and must not appear in signatures
- used on D-Bus.</entry>
- </row><row>
- <entry><literal>VARIANT</literal></entry>
- <entry>118 (ASCII 'v') </entry>
- <entry>Variant type (the type of the value is part of the value itself)</entry>
- </row><row>
- <entry><literal>DICT_ENTRY</literal></entry>
- <entry>101 (ASCII 'e'), 123 (ASCII '{'), 125 (ASCII '}') </entry>
- <entry>Entry in a dict or map (array of key-value pairs).
- Type code 101 'e' is reserved for use in bindings and
- implementations to represent the general concept of a
- dict or dict-entry, and must not appear in signatures
- used on D-Bus.</entry>
- </row><row>
- <entry><literal>UNIX_FD</literal></entry>
- <entry>104 (ASCII 'h')</entry>
- <entry>Unix file descriptor</entry>
- </row>
- <row>
- <entry>(reserved)</entry>
- <entry>109 (ASCII 'm')</entry>
- <entry>Reserved for <ulink
- url="https://bugs.freedesktop.org/show_bug.cgi?id=27857">a
- 'maybe' type compatible with the one in GVariant</ulink>,
- and must not appear in signatures used on D-Bus until
- specified here</entry>
- </row>
- <row>
- <entry>(reserved)</entry>
- <entry>42 (ASCII '*')</entry>
- <entry>Reserved for use in bindings/implementations to
- represent any <firstterm>single complete type</firstterm>,
- and must not appear in signatures used on D-Bus.</entry>
- </row>
- <row>
- <entry>(reserved)</entry>
- <entry>63 (ASCII '?')</entry>
- <entry>Reserved for use in bindings/implementations to
- represent any <firstterm>basic type</firstterm>, and must
- not appear in signatures used on D-Bus.</entry>
- </row>
- <row>
- <entry>(reserved)</entry>
- <entry>64 (ASCII '@'), 38 (ASCII '&amp;'),
- 94 (ASCII '^')</entry>
- <entry>Reserved for internal use by bindings/implementations,
- and must not appear in signatures used on D-Bus.
- GVariant uses these type-codes to encode calling
- conventions.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- </sect2>
- </sect1>
-
- <sect1 id="message-protocol-marshaling">
- <title>Marshaling (Wire Format)</title>
-
- <para>
- D-Bus defines a marshalling format for its type system, which is
- used in D-Bus messages. This is not the only possible marshalling
- format for the type system: for instance, GVariant (part of GLib)
- re-uses the D-Bus type system but implements an alternative marshalling
- format.
- </para>
-
- <sect2>
- <title>Byte order and alignment</title>
-
- <para>
- Given a type signature, a block of bytes can be converted into typed
- values. This section describes the format of the block of bytes. Byte
- order and alignment issues are handled uniformly for all D-Bus types.
- </para>
-
- <para>
- A block of bytes has an associated byte order. The byte order
- has to be discovered in some way; for D-Bus messages, the
- byte order is part of the message header as described in
- <xref linkend="message-protocol-messages"/>. For now, assume
- that the byte order is known to be either little endian or big
- endian.
- </para>
-
- <para>
- Each value in a block of bytes is aligned "naturally," for example
- 4-byte values are aligned to a 4-byte boundary, and 8-byte values to an
- 8-byte boundary. To properly align a value, <firstterm>alignment
- padding</firstterm> may be necessary. The alignment padding must always
- be the minimum required padding to properly align the following value;
- and it must always be made up of nul bytes. The alignment padding must
- not be left uninitialized (it can't contain garbage), and more padding
- than required must not be used.
- </para>
-
- <para>
- As an exception to natural alignment, <literal>STRUCT</literal> and
- <literal>DICT_ENTRY</literal> values are always aligned to an 8-byte
- boundary, regardless of the alignments of their contents.
- </para>
- </sect2>
-
- <sect2>
- <title>Marshalling basic types</title>
-
- <para>
- To marshal and unmarshal fixed types, you simply read one value
- from the data block corresponding to each type code in the signature.
- All signed integer values are encoded in two's complement, DOUBLE
- values are IEEE 754 double-precision floating-point, and BOOLEAN
- values are encoded in 32 bits (of which only the least significant
- bit is used).
- </para>
-
- <para>
- The string-like types are all marshalled as a
- fixed-length unsigned integer <varname>n</varname> giving the
- length of the variable part, followed by <varname>n</varname>
- nonzero bytes of UTF-8 text, followed by a single zero (nul) byte
- which is not considered to be part of the text. The alignment
- of the string-like type is the same as the alignment of
- <varname>n</varname>.
- </para>
-
- <para>
- For the STRING and OBJECT_PATH types, <varname>n</varname> is
- encoded in 4 bytes, leading to 4-byte alignment.
- For the SIGNATURE type, <varname>n</varname> is encoded as a single
- byte. As a result, alignment padding is never required before a
- SIGNATURE.
- </para>
- </sect2>
-
- <sect2>
- <title>Marshalling containers</title>
-
- <para>
- Arrays are marshalled as a <literal>UINT32</literal>
- <varname>n</varname> giving the length of the array data in bytes,
- followed by alignment padding to the alignment boundary of the array
- element type, followed by the <varname>n</varname> bytes of the
- array elements marshalled in sequence. <varname>n</varname> does not
- include the padding after the length, or any padding after the
- last element.
- </para>
-
- <para>
- For instance, if the current position in the message is a multiple
- of 8 bytes and the byte-order is big-endian, an array containing only
- the 64-bit integer 5 would be marshalled as:
-
- <screen>
-00 00 00 08 <lineannotation>8 bytes of data</lineannotation>
-00 00 00 00 <lineannotation>padding to 8-byte boundary</lineannotation>
-00 00 00 00 00 00 00 05 <lineannotation>first element = 5</lineannotation>
- </screen>
- </para>
-
- <para>
- Arrays have a maximum length defined to be 2 to the 26th power or
- 67108864. Implementations must not send or accept arrays exceeding this
- length.
- </para>
-
- <para>
- Structs and dict entries are marshalled in the same way as their
- contents, but their alignment is always to an 8-byte boundary,
- even if their contents would normally be less strictly aligned.
- </para>
-
- <para>
- Variants are marshalled as the <literal>SIGNATURE</literal> of
- the contents (which must be a single complete type), followed by a
- marshalled value with the type given by that signature. The
- variant has the same 1-byte alignment as the signature, which means
- that alignment padding before a variant is never needed.
- Use of variants may not cause a total message depth to be larger
- than 64, including other container types such as structures.
- </para>
- </sect2>
-
- <sect2>
- <title>Summary of D-Bus marshalling</title>
-
- <para>
- Given all this, the types are marshaled on the wire as follows:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Encoding</entry>
- <entry>Alignment</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>INVALID</literal></entry>
- <entry>Not applicable; cannot be marshaled.</entry>
- <entry>N/A</entry>
- </row><row>
- <entry><literal>BYTE</literal></entry>
- <entry>A single 8-bit byte.</entry>
- <entry>1</entry>
- </row><row>
- <entry><literal>BOOLEAN</literal></entry>
- <entry>As for <literal>UINT32</literal>, but only 0 and 1 are valid values.</entry>
- <entry>4</entry>
- </row><row>
- <entry><literal>INT16</literal></entry>
- <entry>16-bit signed integer in the message's byte order.</entry>
- <entry>2</entry>
- </row><row>
- <entry><literal>UINT16</literal></entry>
- <entry>16-bit unsigned integer in the message's byte order.</entry>
- <entry>2</entry>
- </row><row>
- <entry><literal>INT32</literal></entry>
- <entry>32-bit signed integer in the message's byte order.</entry>
- <entry>4</entry>
- </row><row>
- <entry><literal>UINT32</literal></entry>
- <entry>32-bit unsigned integer in the message's byte order.</entry>
- <entry>4</entry>
- </row><row>
- <entry><literal>INT64</literal></entry>
- <entry>64-bit signed integer in the message's byte order.</entry>
- <entry>8</entry>
- </row><row>
- <entry><literal>UINT64</literal></entry>
- <entry>64-bit unsigned integer in the message's byte order.</entry>
- <entry>8</entry>
- </row><row>
- <entry><literal>DOUBLE</literal></entry>
- <entry>64-bit IEEE 754 double in the message's byte order.</entry>
- <entry>8</entry>
- </row><row>
- <entry><literal>STRING</literal></entry>
- <entry>A <literal>UINT32</literal> indicating the string's
- length in bytes excluding its terminating nul, followed by
- non-nul string data of the given length, followed by a terminating nul
- byte.
- </entry>
- <entry>
- 4 (for the length)
- </entry>
- </row><row>
- <entry><literal>OBJECT_PATH</literal></entry>
- <entry>Exactly the same as <literal>STRING</literal> except the
- content must be a valid object path (see above).
- </entry>
- <entry>
- 4 (for the length)
- </entry>
- </row><row>
- <entry><literal>SIGNATURE</literal></entry>
- <entry>The same as <literal>STRING</literal> except the length is a single
- byte (thus signatures have a maximum length of 255)
- and the content must be a valid signature (see above).
- </entry>
- <entry>
- 1
- </entry>
- </row><row>
- <entry><literal>ARRAY</literal></entry>
- <entry>
- A <literal>UINT32</literal> giving the length of the array data in bytes, followed by
- alignment padding to the alignment boundary of the array element type,
- followed by each array element.
- </entry>
- <entry>
- 4 (for the length)
- </entry>
- </row><row>
- <entry><literal>STRUCT</literal></entry>
- <entry>
- A struct must start on an 8-byte boundary regardless of the
- type of the struct fields. The struct value consists of each
- field marshaled in sequence starting from that 8-byte
- alignment boundary.
- </entry>
- <entry>
- 8
- </entry>
- </row><row>
- <entry><literal>VARIANT</literal></entry>
- <entry>
- The marshaled <literal>SIGNATURE</literal> of a single
- complete type, followed by a marshaled value with the type
- given in the signature.
- </entry>
- <entry>
- 1 (alignment of the signature)
- </entry>
- </row><row>
- <entry><literal>DICT_ENTRY</literal></entry>
- <entry>
- Identical to STRUCT.
- </entry>
- <entry>
- 8
- </entry>
- </row><row>
- <entry><literal>UNIX_FD</literal></entry>
- <entry>32-bit unsigned integer in the message's byte
- order. The actual file descriptors need to be
- transferred out-of-band via some platform specific
- mechanism. On the wire, values of this type store the index to the
- file descriptor in the array of file descriptors that
- accompany the message.</entry>
- <entry>4</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- </sect2>
-
- </sect1>
-
- <sect1 id="message-protocol">
- <title>Message Protocol</title>
-
- <para>
- A <firstterm>message</firstterm> consists of a
- <firstterm>header</firstterm> and a <firstterm>body</firstterm>. If you
- think of a message as a package, the header is the address, and the body
- contains the package contents. The message delivery system uses the header
- information to figure out where to send the message and how to interpret
- it; the recipient interprets the body of the message.
- </para>
-
- <para>
- The body of the message is made up of zero or more
- <firstterm>arguments</firstterm>, which are typed values, such as an
- integer or a byte array.
- </para>
-
- <para>
- Both header and body use the D-Bus <link linkend="type-system">type
- system</link> and format for serializing data.
- </para>
-
- <sect2 id="message-protocol-messages">
- <title>Message Format</title>
-
- <para>
- A message consists of a header and a body. The header is a block of
- values with a fixed signature and meaning. The body is a separate block
- of values, with a signature specified in the header.
- </para>
-
- <para>
- The length of the header must be a multiple of 8, allowing the body to
- begin on an 8-byte boundary when storing the entire message in a single
- buffer. If the header does not naturally end on an 8-byte boundary
- up to 7 bytes of nul-initialized alignment padding must be added.
- </para>
-
- <para>
- The message body need not end on an 8-byte boundary.
- </para>
-
- <para>
- The maximum length of a message, including header, header alignment padding,
- and body is 2 to the 27th power or 134217728. Implementations must not
- send or accept messages exceeding this size.
- </para>
-
- <para>
- The signature of the header is:
- <programlisting>
- "yyyyuua(yv)"
- </programlisting>
- Written out more readably, this is:
- <programlisting>
- BYTE, BYTE, BYTE, BYTE, UINT32, UINT32, ARRAY of STRUCT of (BYTE,VARIANT)
- </programlisting>
- </para>
-
- <para>
- These values have the following meanings:
- <informaltable>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>1st <literal>BYTE</literal></entry>
- <entry>Endianness flag; ASCII 'l' for little-endian
- or ASCII 'B' for big-endian. Both header and body are
- in this endianness.</entry>
- </row>
- <row>
- <entry>2nd <literal>BYTE</literal></entry>
- <entry><firstterm>Message type</firstterm>. Unknown types must be ignored.
- Currently-defined types are described below.
- </entry>
- </row>
- <row>
- <entry>3rd <literal>BYTE</literal></entry>
- <entry>Bitwise OR of flags. Unknown flags
- must be ignored. Currently-defined flags are described below.
- </entry>
- </row>
- <row>
- <entry>4th <literal>BYTE</literal></entry>
- <entry>Major protocol version of the sending application. If
- the major protocol version of the receiving application does not
- match, the applications will not be able to communicate and the
- D-Bus connection must be disconnected. The major protocol
- version for this version of the specification is 1.
- </entry>
- </row>
- <row>
- <entry>1st <literal>UINT32</literal></entry>
- <entry>Length in bytes of the message body, starting
- from the end of the header. The header ends after
- its alignment padding to an 8-boundary.
- </entry>
- </row>
- <row>
- <entry>2nd <literal>UINT32</literal></entry>
- <entry>The serial of this message, used as a cookie
- by the sender to identify the reply corresponding
- to this request. This must not be zero.
- </entry>
- </row>
- <row>
- <entry><literal>ARRAY</literal> of <literal>STRUCT</literal> of (<literal>BYTE</literal>,<literal>VARIANT</literal>)</entry>
- <entry>An array of zero or more <firstterm>header
- fields</firstterm> where the byte is the field code, and the
- variant is the field value. The message type determines
- which fields are required.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- <firstterm>Message types</firstterm> that can appear in the second byte
- of the header are:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional name</entry>
- <entry>Decimal value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>INVALID</literal></entry>
- <entry>0</entry>
- <entry>This is an invalid type.</entry>
- </row>
- <row>
- <entry><literal>METHOD_CALL</literal></entry>
- <entry>1</entry>
- <entry>Method call.</entry>
- </row>
- <row>
- <entry><literal>METHOD_RETURN</literal></entry>
- <entry>2</entry>
- <entry>Method reply with returned data.</entry>
- </row>
- <row>
- <entry><literal>ERROR</literal></entry>
- <entry>3</entry>
- <entry>Error reply. If the first argument exists and is a
- string, it is an error message.</entry>
- </row>
- <row>
- <entry><literal>SIGNAL</literal></entry>
- <entry>4</entry>
- <entry>Signal emission.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- Flags that can appear in the third byte of the header:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional name</entry>
- <entry>Hex value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>NO_REPLY_EXPECTED</literal></entry>
- <entry>0x1</entry>
- <entry>This message does not expect method return replies or
- error replies; the reply can be omitted as an
- optimization. However, it is compliant with this specification
- to return the reply despite this flag and the only harm
- from doing so is extra network traffic.
- </entry>
- </row>
- <row>
- <entry><literal>NO_AUTO_START</literal></entry>
- <entry>0x2</entry>
- <entry>The bus must not launch an owner
- for the destination name in response to this message.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <sect3 id="message-protocol-header-fields">
- <title>Header Fields</title>
-
- <para>
- The array at the end of the header contains <firstterm>header
- fields</firstterm>, where each field is a 1-byte field code followed
- by a field value. A header must contain the required header fields for
- its message type, and zero or more of any optional header
- fields. Future versions of this protocol specification may add new
- fields. Implementations must ignore fields they do not
- understand. Implementations must not invent their own header fields;
- only changes to this specification may introduce new header fields.
- </para>
-
- <para>
- Again, if an implementation sees a header field code that it does not
- expect, it must ignore that field, as it will be part of a new
- (but compatible) version of this specification. This also applies
- to known header fields appearing in unexpected messages, for
- example: if a signal has a reply serial it must be ignored
- even though it has no meaning as of this version of the spec.
- </para>
-
- <para>
- However, implementations must not send or accept known header fields
- with the wrong type stored in the field value. So for example a
- message with an <literal>INTERFACE</literal> field of type
- <literal>UINT32</literal> would be considered corrupt.
- </para>
-
- <para>
- Here are the currently-defined header fields:
- <informaltable>
- <tgroup cols="5">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Decimal Code</entry>
- <entry>Type</entry>
- <entry>Required In</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>INVALID</literal></entry>
- <entry>0</entry>
- <entry>N/A</entry>
- <entry>not allowed</entry>
- <entry>Not a valid field name (error if it appears in a message)</entry>
- </row>
- <row>
- <entry><literal>PATH</literal></entry>
- <entry>1</entry>
- <entry><literal>OBJECT_PATH</literal></entry>
- <entry><literal>METHOD_CALL</literal>, <literal>SIGNAL</literal></entry>
- <entry>The object to send a call to,
- or the object a signal is emitted from.
- The special path
- <literal>/org/freedesktop/DBus/Local</literal> is reserved;
- implementations should not send messages with this path,
- and the reference implementation of the bus daemon will
- disconnect any application that attempts to do so.
- </entry>
- </row>
- <row>
- <entry><literal>INTERFACE</literal></entry>
- <entry>2</entry>
- <entry><literal>STRING</literal></entry>
- <entry><literal>SIGNAL</literal></entry>
- <entry>
- The interface to invoke a method call on, or
- that a signal is emitted from. Optional for
- method calls, required for signals.
- The special interface
- <literal>org.freedesktop.DBus.Local</literal> is reserved;
- implementations should not send messages with this
- interface, and the reference implementation of the bus
- daemon will disconnect any application that attempts to
- do so.
- </entry>
- </row>
- <row>
- <entry><literal>MEMBER</literal></entry>
- <entry>3</entry>
- <entry><literal>STRING</literal></entry>
- <entry><literal>METHOD_CALL</literal>, <literal>SIGNAL</literal></entry>
- <entry>The member, either the method name or signal name.</entry>
- </row>
- <row>
- <entry><literal>ERROR_NAME</literal></entry>
- <entry>4</entry>
- <entry><literal>STRING</literal></entry>
- <entry><literal>ERROR</literal></entry>
- <entry>The name of the error that occurred, for errors</entry>
- </row>
- <row>
- <entry><literal>REPLY_SERIAL</literal></entry>
- <entry>5</entry>
- <entry><literal>UINT32</literal></entry>
- <entry><literal>ERROR</literal>, <literal>METHOD_RETURN</literal></entry>
- <entry>The serial number of the message this message is a reply
- to. (The serial number is the second <literal>UINT32</literal> in the header.)</entry>
- </row>
- <row>
- <entry><literal>DESTINATION</literal></entry>
- <entry>6</entry>
- <entry><literal>STRING</literal></entry>
- <entry>optional</entry>
- <entry>The name of the connection this message is intended for.
- Only used in combination with the message bus, see
- <xref linkend="message-bus"/>.</entry>
- </row>
- <row>
- <entry><literal>SENDER</literal></entry>
- <entry>7</entry>
- <entry><literal>STRING</literal></entry>
- <entry>optional</entry>
- <entry>Unique name of the sending connection.
- The message bus fills in this field so it is reliable; the field is
- only meaningful in combination with the message bus.</entry>
- </row>
- <row>
- <entry><literal>SIGNATURE</literal></entry>
- <entry>8</entry>
- <entry><literal>SIGNATURE</literal></entry>
- <entry>optional</entry>
- <entry>The signature of the message body.
- If omitted, it is assumed to be the
- empty signature "" (i.e. the body must be 0-length).</entry>
- </row>
- <row>
- <entry><literal>UNIX_FDS</literal></entry>
- <entry>9</entry>
- <entry><literal>UINT32</literal></entry>
- <entry>optional</entry>
- <entry>The number of Unix file descriptors that
- accompany the message. If omitted, it is assumed
- that no Unix file descriptors accompany the
- message. The actual file descriptors need to be
- transferred via platform specific mechanism
- out-of-band. They must be sent at the same time as
- part of the message itself. They may not be sent
- before the first byte of the message itself is
- transferred or after the last byte of the message
- itself.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-protocol-names">
- <title>Valid Names</title>
- <para>
- The various names in D-Bus messages have some restrictions.
- </para>
- <para>
- There is a <firstterm>maximum name length</firstterm>
- of 255 which applies to bus names, interfaces, and members.
- </para>
- <sect3 id="message-protocol-names-interface">
- <title>Interface names</title>
- <para>
- Interfaces have names with type <literal>STRING</literal>, meaning that
- they must be valid UTF-8. However, there are also some
- additional restrictions that apply to interface names
- specifically:
- <itemizedlist>
- <listitem><para>Interface names are composed of 1 or more elements separated by
- a period ('.') character. All elements must contain at least
- one character.
- </para>
- </listitem>
- <listitem><para>Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_" and must not begin with a digit.
- </para>
- </listitem>
-
- <listitem><para>Interface names must contain at least one '.' (period)
- character (and thus at least two elements).
- </para></listitem>
-
- <listitem><para>Interface names must not begin with a '.' (period) character.</para></listitem>
- <listitem><para>Interface names must not exceed the maximum name length.</para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- Interface names should start with the reversed DNS domain name of
- the author of the interface (in lower-case), like interface names
- in Java. It is conventional for the rest of the interface name
- to consist of words run together, with initial capital letters
- on all words ("CamelCase"). Several levels of hierarchy can be used.
- It is also a good idea to include the major version of the interface
- in the name, and increment it if incompatible changes are made;
- this way, a single object can implement several versions of an
- interface in parallel, if necessary.
- </para>
-
- <para>
- For instance, if the owner of <literal>example.com</literal> is
- developing a D-Bus API for a music player, they might define
- interfaces called <literal>com.example.MusicPlayer1</literal>,
- <literal>com.example.MusicPlayer1.Track</literal> and
- <literal>com.example.MusicPlayer1.Seekable</literal>.
- </para>
-
- <para>
- D-Bus does not distinguish between the concepts that would be
- called classes and interfaces in Java: either can be identified on
- D-Bus by an interface name.
- </para>
- </sect3>
- <sect3 id="message-protocol-names-bus">
- <title>Bus names</title>
- <para>
- Connections have one or more bus names associated with them.
- A connection has exactly one bus name that is a <firstterm>unique
- connection name</firstterm>. The unique connection name remains
- with the connection for its entire lifetime.
- A bus name is of type <literal>STRING</literal>,
- meaning that it must be valid UTF-8. However, there are also
- some additional restrictions that apply to bus names
- specifically:
- <itemizedlist>
- <listitem><para>Bus names that start with a colon (':')
- character are unique connection names. Other bus names
- are called <firstterm>well-known bus names</firstterm>.
- </para>
- </listitem>
- <listitem><para>Bus names are composed of 1 or more elements separated by
- a period ('.') character. All elements must contain at least
- one character.
- </para>
- </listitem>
- <listitem><para>Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_-". Only elements that are part of a unique
- connection name may begin with a digit, elements in
- other bus names must not begin with a digit.
- </para>
- </listitem>
-
- <listitem><para>Bus names must contain at least one '.' (period)
- character (and thus at least two elements).
- </para></listitem>
-
- <listitem><para>Bus names must not begin with a '.' (period) character.</para></listitem>
- <listitem><para>Bus names must not exceed the maximum name length.</para></listitem>
- </itemizedlist>
- </para>
- <para>
- Note that the hyphen ('-') character is allowed in bus names but
- not in interface names.
- </para>
-
- <para>
- Like <link linkend="message-protocol-names-interface">interface
- names</link>, well-known bus names should start with the
- reversed DNS domain name of the author of the interface (in
- lower-case), and it is conventional for the rest of the well-known
- bus name to consist of words run together, with initial
- capital letters. As with interface names, including a version
- number in well-known bus names is a good idea; it's possible to
- have the well-known bus name for more than one version
- simultaneously if backwards compatibility is required.
- </para>
-
- <para>
- If a well-known bus name implies the presence of a "main" interface,
- that "main" interface is often given the same name as
- the well-known bus name, and situated at the corresponding object
- path. For instance, if the owner of <literal>example.com</literal>
- is developing a D-Bus API for a music player, they might define
- that any application that takes the well-known name
- <literal>com.example.MusicPlayer1</literal> should have an object
- at the object path <literal>/com/example/MusicPlayer1</literal>
- which implements the interface
- <literal>com.example.MusicPlayer1</literal>.
- </para>
- </sect3>
- <sect3 id="message-protocol-names-member">
- <title>Member names</title>
- <para>
- Member (i.e. method or signal) names:
- <itemizedlist>
- <listitem><para>Must only contain the ASCII characters
- "[A-Z][a-z][0-9]_" and may not begin with a
- digit.</para></listitem>
- <listitem><para>Must not contain the '.' (period) character.</para></listitem>
- <listitem><para>Must not exceed the maximum name length.</para></listitem>
- <listitem><para>Must be at least 1 byte in length.</para></listitem>
- </itemizedlist>
- </para>
-
- <para>
- It is conventional for member names on D-Bus to consist of
- capitalized words with no punctuation ("camel-case").
- Method names should usually be verbs, such as
- <literal>GetItems</literal>, and signal names should usually be
- a description of an event, such as <literal>ItemsChanged</literal>.
- </para>
- </sect3>
- <sect3 id="message-protocol-names-error">
- <title>Error names</title>
- <para>
- Error names have the same restrictions as interface names.
- </para>
-
- <para>
- Error names have the same naming conventions as interface
- names, and often contain <literal>.Error.</literal>; for instance,
- the owner of <literal>example.com</literal> might define the
- errors <literal>com.example.MusicPlayer.Error.FileNotFound</literal>
- and <literal>com.example.MusicPlayer.Error.OutOfMemory</literal>.
- The errors defined by D-Bus itself, such as
- <literal>org.freedesktop.DBus.Error.Failed</literal>, follow a
- similar pattern.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-protocol-types">
- <title>Message Types</title>
- <para>
- Each of the message types (<literal>METHOD_CALL</literal>, <literal>METHOD_RETURN</literal>, <literal>ERROR</literal>, and
- <literal>SIGNAL</literal>) has its own expected usage conventions and header fields.
- This section describes these conventions.
- </para>
- <sect3 id="message-protocol-types-method">
- <title>Method Calls</title>
- <para>
- Some messages invoke an operation on a remote object. These are
- called method call messages and have the type tag <literal>METHOD_CALL</literal>. Such
- messages map naturally to methods on objects in a typical program.
- </para>
- <para>
- A method call message is required to have a <literal>MEMBER</literal> header field
- indicating the name of the method. Optionally, the message has an
- <literal>INTERFACE</literal> field giving the interface the method is a part of. In the
- absence of an <literal>INTERFACE</literal> field, if two interfaces on the same object have
- a method with the same name, it is undefined which of the two methods
- will be invoked. Implementations may also choose to return an error in
- this ambiguous case. However, if a method name is unique
- implementations must not require an interface field.
- </para>
- <para>
- Method call messages also include a <literal>PATH</literal> field
- indicating the object to invoke the method on. If the call is passing
- through a message bus, the message will also have a
- <literal>DESTINATION</literal> field giving the name of the connection
- to receive the message.
- </para>
- <para>
- When an application handles a method call message, it is required to
- return a reply. The reply is identified by a <literal>REPLY_SERIAL</literal> header field
- indicating the serial number of the <literal>METHOD_CALL</literal> being replied to. The
- reply can have one of two types; either <literal>METHOD_RETURN</literal> or <literal>ERROR</literal>.
- </para>
- <para>
- If the reply has type <literal>METHOD_RETURN</literal>, the arguments to the reply message
- are the return value(s) or "out parameters" of the method call.
- If the reply has type <literal>ERROR</literal>, then an "exception" has been thrown,
- and the call fails; no return value will be provided. It makes
- no sense to send multiple replies to the same method call.
- </para>
- <para>
- Even if a method call has no return values, a <literal>METHOD_RETURN</literal>
- reply is required, so the caller will know the method
- was successfully processed.
- </para>
- <para>
- The <literal>METHOD_RETURN</literal> or <literal>ERROR</literal> reply message must have the <literal>REPLY_SERIAL</literal>
- header field.
- </para>
- <para>
- If a <literal>METHOD_CALL</literal> message has the flag <literal>NO_REPLY_EXPECTED</literal>,
- then as an optimization the application receiving the method
- call may choose to omit the reply message (regardless of
- whether the reply would have been <literal>METHOD_RETURN</literal> or <literal>ERROR</literal>).
- However, it is also acceptable to ignore the <literal>NO_REPLY_EXPECTED</literal>
- flag and reply anyway.
- </para>
- <para>
- Unless a message has the flag <literal>NO_AUTO_START</literal>, if the
- destination name does not exist then a program to own the destination
- name will be started before the message is delivered. The message
- will be held until the new program is successfully started or has
- failed to start; in case of failure, an error will be returned. This
- flag is only relevant in the context of a message bus, it is ignored
- during one-to-one communication with no intermediate bus.
- </para>
- <sect4 id="message-protocol-types-method-apis">
- <title>Mapping method calls to native APIs</title>
- <para>
- APIs for D-Bus may map method calls to a method call in a specific
- programming language, such as C++, or may map a method call written
- in an IDL to a D-Bus message.
- </para>
- <para>
- In APIs of this nature, arguments to a method are often termed "in"
- (which implies sent in the <literal>METHOD_CALL</literal>), or "out" (which implies
- returned in the <literal>METHOD_RETURN</literal>). Some APIs such as CORBA also have
- "inout" arguments, which are both sent and received, i.e. the caller
- passes in a value which is modified. Mapped to D-Bus, an "inout"
- argument is equivalent to an "in" argument, followed by an "out"
- argument. You can't pass things "by reference" over the wire, so
- "inout" is purely an illusion of the in-process API.
- </para>
- <para>
- Given a method with zero or one return values, followed by zero or more
- arguments, where each argument may be "in", "out", or "inout", the
- caller constructs a message by appending each "in" or "inout" argument,
- in order. "out" arguments are not represented in the caller's message.
- </para>
- <para>
- The recipient constructs a reply by appending first the return value
- if any, then each "out" or "inout" argument, in order.
- "in" arguments are not represented in the reply message.
- </para>
- <para>
- Error replies are normally mapped to exceptions in languages that have
- exceptions.
- </para>
- <para>
- In converting from native APIs to D-Bus, it is perhaps nice to
- map D-Bus naming conventions ("FooBar") to native conventions
- such as "fooBar" or "foo_bar" automatically. This is OK
- as long as you can say that the native API is one that
- was specifically written for D-Bus. It makes the most sense
- when writing object implementations that will be exported
- over the bus. Object proxies used to invoke remote D-Bus
- objects probably need the ability to call any D-Bus method,
- and thus a magic name mapping like this could be a problem.
- </para>
- <para>
- This specification doesn't require anything of native API bindings;
- the preceding is only a suggested convention for consistency
- among bindings.
- </para>
- </sect4>
- </sect3>
-
- <sect3 id="message-protocol-types-signal">
- <title>Signal Emission</title>
- <para>
- Unlike method calls, signal emissions have no replies.
- A signal emission is simply a single message of type <literal>SIGNAL</literal>.
- It must have three header fields: <literal>PATH</literal> giving the object
- the signal was emitted from, plus <literal>INTERFACE</literal> and <literal>MEMBER</literal> giving
- the fully-qualified name of the signal. The <literal>INTERFACE</literal> header is required
- for signals, though it is optional for method calls.
- </para>
- </sect3>
-
- <sect3 id="message-protocol-types-errors">
- <title>Errors</title>
- <para>
- Messages of type <literal>ERROR</literal> are most commonly replies
- to a <literal>METHOD_CALL</literal>, but may be returned in reply
- to any kind of message. The message bus for example
- will return an <literal>ERROR</literal> in reply to a signal emission if
- the bus does not have enough memory to send the signal.
- </para>
- <para>
- An <literal>ERROR</literal> may have any arguments, but if the first
- argument is a <literal>STRING</literal>, it must be an error message.
- The error message may be logged or shown to the user
- in some way.
- </para>
- </sect3>
-
- <sect3 id="message-protocol-types-notation">
- <title>Notation in this document</title>
- <para>
- This document uses a simple pseudo-IDL to describe particular method
- calls and signals. Here is an example of a method call:
- <programlisting>
- org.freedesktop.DBus.StartServiceByName (in STRING name, in UINT32 flags,
- out UINT32 resultcode)
- </programlisting>
- This means <literal>INTERFACE</literal> = org.freedesktop.DBus, <literal>MEMBER</literal> = StartServiceByName,
- <literal>METHOD_CALL</literal> arguments are <literal>STRING</literal> and <literal>UINT32</literal>, <literal>METHOD_RETURN</literal> argument
- is <literal>UINT32</literal>. Remember that the <literal>MEMBER</literal> field can't contain any '.' (period)
- characters so it's known that the last part of the name in
- the "IDL" is the member name.
- </para>
- <para>
- In C++ that might end up looking like this:
- <programlisting>
- unsigned int org::freedesktop::DBus::StartServiceByName (const char *name,
- unsigned int flags);
- </programlisting>
- or equally valid, the return value could be done as an argument:
- <programlisting>
- void org::freedesktop::DBus::StartServiceByName (const char *name,
- unsigned int flags,
- unsigned int *resultcode);
- </programlisting>
- It's really up to the API designer how they want to make
- this look. You could design an API where the namespace wasn't used
- in C++, using STL or Qt, using varargs, or whatever you wanted.
- </para>
- <para>
- Signals are written as follows:
- <programlisting>
- org.freedesktop.DBus.NameLost (STRING name)
- </programlisting>
- Signals don't specify "in" vs. "out" because only
- a single direction is possible.
- </para>
- <para>
- It isn't especially encouraged to use this lame pseudo-IDL in actual
- API implementations; you might use the native notation for the
- language you're using, or you might use COM or CORBA IDL, for example.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-protocol-handling-invalid">
- <title>Invalid Protocol and Spec Extensions</title>
-
- <para>
- For security reasons, the D-Bus protocol should be strictly parsed and
- validated, with the exception of defined extension points. Any invalid
- protocol or spec violations should result in immediately dropping the
- connection without notice to the other end. Exceptions should be
- carefully considered, e.g. an exception may be warranted for a
- well-understood idiosyncrasy of a widely-deployed implementation. In
- cases where the other end of a connection is 100% trusted and known to
- be friendly, skipping validation for performance reasons could also make
- sense in certain cases.
- </para>
-
- <para>
- Generally speaking violations of the "must" requirements in this spec
- should be considered possible attempts to exploit security, and violations
- of the "should" suggestions should be considered legitimate (though perhaps
- they should generate an error in some cases).
- </para>
-
- <para>
- The following extension points are built in to D-Bus on purpose and must
- not be treated as invalid protocol. The extension points are intended
- for use by future versions of this spec, they are not intended for third
- parties. At the moment, the only way a third party could extend D-Bus
- without breaking interoperability would be to introduce a way to negotiate new
- feature support as part of the auth protocol, using EXTENSION_-prefixed
- commands. There is not yet a standard way to negotiate features.
- <itemizedlist>
- <listitem>
- <para>
- In the authentication protocol (see <xref linkend="auth-protocol"/>) unknown
- commands result in an ERROR rather than a disconnect. This enables
- future extensions to the protocol. Commands starting with EXTENSION_ are
- reserved for third parties.
- </para>
- </listitem>
- <listitem>
- <para>
- The authentication protocol supports pluggable auth mechanisms.
- </para>
- </listitem>
- <listitem>
- <para>
- The address format (see <xref linkend="addresses"/>) supports new
- kinds of transport.
- </para>
- </listitem>
- <listitem>
- <para>
- Messages with an unknown type (something other than
- <literal>METHOD_CALL</literal>, <literal>METHOD_RETURN</literal>,
- <literal>ERROR</literal>, <literal>SIGNAL</literal>) are ignored.
- Unknown-type messages must still be well-formed in the same way
- as the known messages, however. They still have the normal
- header and body.
- </para>
- </listitem>
- <listitem>
- <para>
- Header fields with an unknown or unexpected field code must be ignored,
- though again they must still be well-formed.
- </para>
- </listitem>
- <listitem>
- <para>
- New standard interfaces (with new methods and signals) can of course be added.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- </sect2>
-
- </sect1>
-
- <sect1 id="auth-protocol">
- <title>Authentication Protocol</title>
- <para>
- Before the flow of messages begins, two applications must
- authenticate. A simple plain-text protocol is used for
- authentication; this protocol is a SASL profile, and maps fairly
- directly from the SASL specification. The message encoding is
- NOT used here, only plain text messages.
- </para>
- <para>
- In examples, "C:" and "S:" indicate lines sent by the client and
- server respectively.
- </para>
- <sect2 id="auth-protocol-overview">
- <title>Protocol Overview</title>
- <para>
- The protocol is a line-based protocol, where each line ends with
- \r\n. Each line begins with an all-caps ASCII command name containing
- only the character range [A-Z_], a space, then any arguments for the
- command, then the \r\n ending the line. The protocol is
- case-sensitive. All bytes must be in the ASCII character set.
-
- Commands from the client to the server are as follows:
-
- <itemizedlist>
- <listitem><para>AUTH [mechanism] [initial-response]</para></listitem>
- <listitem><para>CANCEL</para></listitem>
- <listitem><para>BEGIN</para></listitem>
- <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
- <listitem><para>ERROR [human-readable error explanation]</para></listitem>
- <listitem><para>NEGOTIATE_UNIX_FD</para></listitem>
- </itemizedlist>
-
- From server to client are as follows:
-
- <itemizedlist>
- <listitem><para>REJECTED &lt;space-separated list of mechanism names&gt;</para></listitem>
- <listitem><para>OK &lt;GUID in hex&gt;</para></listitem>
- <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
- <listitem><para>ERROR</para></listitem>
- <listitem><para>AGREE_UNIX_FD</para></listitem>
- </itemizedlist>
- </para>
- <para>
- Unofficial extensions to the command set must begin with the letters
- "EXTENSION_", to avoid conflicts with future official commands.
- For example, "EXTENSION_COM_MYDOMAIN_DO_STUFF".
- </para>
- </sect2>
- <sect2 id="auth-nul-byte">
- <title>Special credentials-passing nul byte</title>
- <para>
- Immediately after connecting to the server, the client must send a
- single nul byte. This byte may be accompanied by credentials
- information on some operating systems that use sendmsg() with
- SCM_CREDS or SCM_CREDENTIALS to pass credentials over UNIX domain
- sockets. However, the nul byte must be sent even on other kinds of
- socket, and even on operating systems that do not require a byte to be
- sent in order to transmit credentials. The text protocol described in
- this document begins after the single nul byte. If the first byte
- received from the client is not a nul byte, the server may disconnect
- that client.
- </para>
- <para>
- A nul byte in any context other than the initial byte is an error;
- the protocol is ASCII-only.
- </para>
- <para>
- The credentials sent along with the nul byte may be used with the
- SASL mechanism EXTERNAL.
- </para>
- </sect2>
- <sect2 id="auth-command-auth">
- <title>AUTH command</title>
- <para>
- If an AUTH command has no arguments, it is a request to list
- available mechanisms. The server must respond with a REJECTED
- command listing the mechanisms it understands, or with an error.
- </para>
- <para>
- If an AUTH command specifies a mechanism, and the server supports
- said mechanism, the server should begin exchanging SASL
- challenge-response data with the client using DATA commands.
- </para>
- <para>
- If the server does not support the mechanism given in the AUTH
- command, it must send either a REJECTED command listing the mechanisms
- it does support, or an error.
- </para>
- <para>
- If the [initial-response] argument is provided, it is intended for use
- with mechanisms that have no initial challenge (or an empty initial
- challenge), as if it were the argument to an initial DATA command. If
- the selected mechanism has an initial challenge and [initial-response]
- was provided, the server should reject authentication by sending
- REJECTED.
- </para>
- <para>
- If authentication succeeds after exchanging DATA commands,
- an OK command must be sent to the client.
- </para>
- <para>
- The first octet received by the server after the \r\n of the BEGIN
- command from the client must be the first octet of the
- authenticated/encrypted stream of D-Bus messages.
- </para>
- <para>
- If BEGIN is received by the server, the first octet received
- by the client after the \r\n of the OK command must be the
- first octet of the authenticated/encrypted stream of D-Bus
- messages.
- </para>
- </sect2>
- <sect2 id="auth-command-cancel">
- <title>CANCEL Command</title>
- <para>
- At any time up to sending the BEGIN command, the client may send a
- CANCEL command. On receiving the CANCEL command, the server must
- send a REJECTED command and abort the current authentication
- exchange.
- </para>
- </sect2>
- <sect2 id="auth-command-data">
- <title>DATA Command</title>
- <para>
- The DATA command may come from either client or server, and simply
- contains a hex-encoded block of data to be interpreted
- according to the SASL mechanism in use.
- </para>
- <para>
- Some SASL mechanisms support sending an "empty string";
- FIXME we need some way to do this.
- </para>
- </sect2>
- <sect2 id="auth-command-begin">
- <title>BEGIN Command</title>
- <para>
- The BEGIN command acknowledges that the client has received an
- OK command from the server, and that the stream of messages
- is about to begin.
- </para>
- <para>
- The first octet received by the server after the \r\n of the BEGIN
- command from the client must be the first octet of the
- authenticated/encrypted stream of D-Bus messages.
- </para>
- </sect2>
- <sect2 id="auth-command-rejected">
- <title>REJECTED Command</title>
- <para>
- The REJECTED command indicates that the current authentication
- exchange has failed, and further exchange of DATA is inappropriate.
- The client would normally try another mechanism, or try providing
- different responses to challenges.
- </para><para>
- Optionally, the REJECTED command has a space-separated list of
- available auth mechanisms as arguments. If a server ever provides
- a list of supported mechanisms, it must provide the same list
- each time it sends a REJECTED message. Clients are free to
- ignore all lists received after the first.
- </para>
- </sect2>
- <sect2 id="auth-command-ok">
- <title>OK Command</title>
- <para>
- The OK command indicates that the client has been
- authenticated. The client may now proceed with negotiating
- Unix file descriptor passing. To do that it shall send
- NEGOTIATE_UNIX_FD to the server.
- </para>
- <para>
- Otherwise, the client must respond to the OK command by
- sending a BEGIN command, followed by its stream of messages,
- or by disconnecting. The server must not accept additional
- commands using this protocol after the BEGIN command has been
- received. Further communication will be a stream of D-Bus
- messages (optionally encrypted, as negotiated) rather than
- this protocol.
- </para>
- <para>
- If a client sends BEGIN the first octet received by the client
- after the \r\n of the OK command must be the first octet of
- the authenticated/encrypted stream of D-Bus messages.
- </para>
- <para>
- The OK command has one argument, which is the GUID of the server.
- See <xref linkend="addresses"/> for more on server GUIDs.
- </para>
- </sect2>
- <sect2 id="auth-command-error">
- <title>ERROR Command</title>
- <para>
- The ERROR command indicates that either server or client did not
- know a command, does not accept the given command in the current
- context, or did not understand the arguments to the command. This
- allows the protocol to be extended; a client or server can send a
- command present or permitted only in new protocol versions, and if
- an ERROR is received instead of an appropriate response, fall back
- to using some other technique.
- </para>
- <para>
- If an ERROR is sent, the server or client that sent the
- error must continue as if the command causing the ERROR had never been
- received. However, the the server or client receiving the error
- should try something other than whatever caused the error;
- if only canceling/rejecting the authentication.
- </para>
- <para>
- If the D-Bus protocol changes incompatibly at some future time,
- applications implementing the new protocol would probably be able to
- check for support of the new protocol by sending a new command and
- receiving an ERROR from applications that don't understand it. Thus the
- ERROR feature of the auth protocol is an escape hatch that lets us
- negotiate extensions or changes to the D-Bus protocol in the future.
- </para>
- </sect2>
- <sect2 id="auth-command-negotiate-unix-fd">
- <title>NEGOTIATE_UNIX_FD Command</title>
- <para>
- The NEGOTIATE_UNIX_FD command indicates that the client
- supports Unix file descriptor passing. This command may only
- be sent after the connection is authenticated, i.e. after OK
- was received by the client. This command may only be sent on
- transports that support Unix file descriptor passing.
- </para>
- <para>
- On receiving NEGOTIATE_UNIX_FD the server must respond with
- either AGREE_UNIX_FD or ERROR. It shall respond the former if
- the transport chosen supports Unix file descriptor passing and
- the server supports this feature. It shall respond the latter
- if the transport does not support Unix file descriptor
- passing, the server does not support this feature, or the
- server decides not to enable file descriptor passing due to
- security or other reasons.
- </para>
- </sect2>
- <sect2 id="auth-command-agree-unix-fd">
- <title>AGREE_UNIX_FD Command</title>
- <para>
- The AGREE_UNIX_FD command indicates that the server supports
- Unix file descriptor passing. This command may only be sent
- after the connection is authenticated, and the client sent
- NEGOTIATE_UNIX_FD to enable Unix file descriptor passing. This
- command may only be sent on transports that support Unix file
- descriptor passing.
- </para>
- <para>
- On receiving AGREE_UNIX_FD the client must respond with BEGIN,
- followed by its stream of messages, or by disconnecting. The
- server must not accept additional commands using this protocol
- after the BEGIN command has been received. Further
- communication will be a stream of D-Bus messages (optionally
- encrypted, as negotiated) rather than this protocol.
- </para>
- </sect2>
- <sect2 id="auth-command-future">
- <title>Future Extensions</title>
- <para>
- Future extensions to the authentication and negotiation
- protocol are possible. For that new commands may be
- introduced. If a client or server receives an unknown command
- it shall respond with ERROR and not consider this fatal. New
- commands may be introduced both before, and after
- authentication, i.e. both before and after the OK command.
- </para>
- </sect2>
- <sect2 id="auth-examples">
- <title>Authentication examples</title>
-
- <para>
- <figure>
- <title>Example of successful magic cookie authentication</title>
- <programlisting>
- (MAGIC_COOKIE is a made up mechanism)
-
- C: AUTH MAGIC_COOKIE 3138363935333137393635383634
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of finding out mechanisms then picking one</title>
- <programlisting>
- C: AUTH
- S: REJECTED KERBEROS_V4 SKEY
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of client sends unknown command then falls back to regular auth</title>
- <programlisting>
- C: FOOBAR
- S: ERROR
- C: AUTH MAGIC_COOKIE 3736343435313230333039
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of server doesn't support initial auth mechanism</title>
- <programlisting>
- C: AUTH MAGIC_COOKIE 3736343435313230333039
- S: REJECTED KERBEROS_V4 SKEY
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of wrong password or the like followed by successful retry</title>
- <programlisting>
- C: AUTH MAGIC_COOKIE 3736343435313230333039
- S: REJECTED KERBEROS_V4 SKEY
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: REJECTED
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of skey cancelled and restarted</title>
- <programlisting>
- C: AUTH MAGIC_COOKIE 3736343435313230333039
- S: REJECTED KERBEROS_V4 SKEY
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: CANCEL
- S: REJECTED
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of successful magic cookie authentication with successful negotiation of Unix FD passing</title>
- <programlisting>
- (MAGIC_COOKIE is a made up mechanism)
-
- C: AUTH MAGIC_COOKIE 3138363935333137393635383634
- S: OK 1234deadbeef
- C: NEGOTIATE_UNIX_FD
- S: AGREE_UNIX_FD
- C: BEGIN
- </programlisting>
- </figure>
- <figure>
- <title>Example of successful magic cookie authentication with unsuccessful negotiation of Unix FD passing</title>
- <programlisting>
- (MAGIC_COOKIE is a made up mechanism)
-
- C: AUTH MAGIC_COOKIE 3138363935333137393635383634
- S: OK 1234deadbeef
- C: NEGOTIATE_UNIX_FD
- S: ERROR
- C: BEGIN
- </programlisting>
- </figure>
- </para>
- </sect2>
- <sect2 id="auth-states">
- <title>Authentication state diagrams</title>
-
- <para>
- This section documents the auth protocol in terms of
- a state machine for the client and the server. This is
- probably the most robust way to implement the protocol.
- </para>
-
- <sect3 id="auth-states-client">
- <title>Client states</title>
-
- <para>
- To more precisely describe the interaction between the
- protocol state machine and the authentication mechanisms the
- following notation is used: MECH(CHALL) means that the
- server challenge CHALL was fed to the mechanism MECH, which
- returns one of
-
- <itemizedlist>
- <listitem>
- <para>
- CONTINUE(RESP) means continue the auth conversation
- and send RESP as the response to the server;
- </para>
- </listitem>
-
- <listitem>
- <para>
- OK(RESP) means that after sending RESP to the server
- the client side of the auth conversation is finished
- and the server should return "OK";
- </para>
- </listitem>
-
- <listitem>
- <para>
- ERROR means that CHALL was invalid and could not be
- processed.
- </para>
- </listitem>
- </itemizedlist>
-
- Both RESP and CHALL may be empty.
- </para>
-
- <para>
- The Client starts by getting an initial response from the
- default mechanism and sends AUTH MECH RESP, or AUTH MECH if
- the mechanism did not provide an initial response. If the
- mechanism returns CONTINUE, the client starts in state
- <emphasis>WaitingForData</emphasis>, if the mechanism
- returns OK the client starts in state
- <emphasis>WaitingForOK</emphasis>.
- </para>
-
- <para>
- The client should keep track of available mechanisms and
- which it mechanisms it has already attempted. This list is
- used to decide which AUTH command to send. When the list is
- exhausted, the client should give up and close the
- connection.
- </para>
-
- <formalpara>
- <title><emphasis>WaitingForData</emphasis></title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Receive DATA CHALL
- <simplelist>
- <member>
- MECH(CHALL) returns CONTINUE(RESP) &rarr; send
- DATA RESP, goto
- <emphasis>WaitingForData</emphasis>
- </member>
-
- <member>
- MECH(CHALL) returns OK(RESP) &rarr; send DATA
- RESP, goto <emphasis>WaitingForOK</emphasis>
- </member>
-
- <member>
- MECH(CHALL) returns ERROR &rarr; send ERROR
- [msg], goto <emphasis>WaitingForData</emphasis>
- </member>
- </simplelist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive REJECTED [mechs] &rarr;
- send AUTH [next mech], goto
- WaitingForData or <emphasis>WaitingForOK</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- Receive ERROR &rarr; send
- CANCEL, goto
- <emphasis>WaitingForReject</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- Receive OK &rarr; send
- BEGIN, terminate auth
- conversation, authenticated
- </para>
- </listitem>
- <listitem>
- <para>
- Receive anything else &rarr; send
- ERROR, goto
- <emphasis>WaitingForData</emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
- <formalpara>
- <title><emphasis>WaitingForOK</emphasis></title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Receive OK &rarr; send BEGIN, terminate auth
- conversation, <emphasis>authenticated</emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
- Receive REJECTED [mechs] &rarr; send AUTH [next mech],
- goto <emphasis>WaitingForData</emphasis> or
- <emphasis>WaitingForOK</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive DATA &rarr; send CANCEL, goto
- <emphasis>WaitingForReject</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive ERROR &rarr; send CANCEL, goto
- <emphasis>WaitingForReject</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive anything else &rarr; send ERROR, goto
- <emphasis>WaitingForOK</emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
- <formalpara>
- <title><emphasis>WaitingForReject</emphasis></title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Receive REJECTED [mechs] &rarr; send AUTH [next mech],
- goto <emphasis>WaitingForData</emphasis> or
- <emphasis>WaitingForOK</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive anything else &rarr; terminate auth
- conversation, disconnect
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
- </sect3>
-
- <sect3 id="auth-states-server">
- <title>Server states</title>
-
- <para>
- For the server MECH(RESP) means that the client response
- RESP was fed to the the mechanism MECH, which returns one of
-
- <itemizedlist>
- <listitem>
- <para>
- CONTINUE(CHALL) means continue the auth conversation and
- send CHALL as the challenge to the client;
- </para>
- </listitem>
-
- <listitem>
- <para>
- OK means that the client has been successfully
- authenticated;
- </para>
- </listitem>
-
- <listitem>
- <para>
- REJECTED means that the client failed to authenticate or
- there was an error in RESP.
- </para>
- </listitem>
- </itemizedlist>
-
- The server starts out in state
- <emphasis>WaitingForAuth</emphasis>. If the client is
- rejected too many times the server must disconnect the
- client.
- </para>
-
- <formalpara>
- <title><emphasis>WaitingForAuth</emphasis></title>
- <para>
- <itemizedlist>
-
- <listitem>
- <para>
- Receive AUTH &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive AUTH MECH RESP
-
- <simplelist>
- <member>
- MECH not valid mechanism &rarr; send REJECTED
- [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </member>
-
- <member>
- MECH(RESP) returns CONTINUE(CHALL) &rarr; send
- DATA CHALL, goto
- <emphasis>WaitingForData</emphasis>
- </member>
-
- <member>
- MECH(RESP) returns OK &rarr; send OK, goto
- <emphasis>WaitingForBegin</emphasis>
- </member>
-
- <member>
- MECH(RESP) returns REJECTED &rarr; send REJECTED
- [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </member>
- </simplelist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive BEGIN &rarr; terminate
- auth conversation, disconnect
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive ERROR &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive anything else &rarr; send
- ERROR, goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
-
- <formalpara>
- <title><emphasis>WaitingForData</emphasis></title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Receive DATA RESP
- <simplelist>
- <member>
- MECH(RESP) returns CONTINUE(CHALL) &rarr; send
- DATA CHALL, goto
- <emphasis>WaitingForData</emphasis>
- </member>
-
- <member>
- MECH(RESP) returns OK &rarr; send OK, goto
- <emphasis>WaitingForBegin</emphasis>
- </member>
-
- <member>
- MECH(RESP) returns REJECTED &rarr; send REJECTED
- [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </member>
- </simplelist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive BEGIN &rarr; terminate auth conversation,
- disconnect
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive CANCEL &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive ERROR &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive anything else &rarr; send ERROR, goto
- <emphasis>WaitingForData</emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
- <formalpara>
- <title><emphasis>WaitingForBegin</emphasis></title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Receive BEGIN &rarr; terminate auth conversation,
- client authenticated
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive CANCEL &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive ERROR &rarr; send REJECTED [mechs], goto
- <emphasis>WaitingForAuth</emphasis>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Receive anything else &rarr; send ERROR, goto
- <emphasis>WaitingForBegin</emphasis>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>
-
- </sect3>
-
- </sect2>
- <sect2 id="auth-mechanisms">
- <title>Authentication mechanisms</title>
- <para>
- This section describes some new authentication mechanisms.
- D-Bus also allows any standard SASL mechanism of course.
- </para>
- <sect3 id="auth-mechanisms-sha">
- <title>DBUS_COOKIE_SHA1</title>
- <para>
- The DBUS_COOKIE_SHA1 mechanism is designed to establish that a client
- has the ability to read a private file owned by the user being
- authenticated. If the client can prove that it has access to a secret
- cookie stored in this file, then the client is authenticated.
- Thus the security of DBUS_COOKIE_SHA1 depends on a secure home
- directory.
- </para>
- <para>
- Throughout this description, "hex encoding" must output the digits
- from a to f in lower-case; the digits A to F must not be used
- in the DBUS_COOKIE_SHA1 mechanism.
- </para>
- <para>
- Authentication proceeds as follows:
- <itemizedlist>
- <listitem>
- <para>
- The client sends the username it would like to authenticate
- as, hex-encoded.
- </para>
- </listitem>
- <listitem>
- <para>
- The server sends the name of its "cookie context" (see below); a
- space character; the integer ID of the secret cookie the client
- must demonstrate knowledge of; a space character; then a
- randomly-generated challenge string, all of this hex-encoded into
- one, single string.
- </para>
- </listitem>
- <listitem>
- <para>
- The client locates the cookie and generates its own
- randomly-generated challenge string. The client then concatenates
- the server's decoded challenge, a ":" character, its own challenge,
- another ":" character, and the cookie. It computes the SHA-1 hash
- of this composite string as a hex digest. It concatenates the
- client's challenge string, a space character, and the SHA-1 hex
- digest, hex-encodes the result and sends it back to the server.
- </para>
- </listitem>
- <listitem>
- <para>
- The server generates the same concatenated string used by the
- client and computes its SHA-1 hash. It compares the hash with
- the hash received from the client; if the two hashes match, the
- client is authenticated.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Each server has a "cookie context," which is a name that identifies a
- set of cookies that apply to that server. A sample context might be
- "org_freedesktop_session_bus". Context names must be valid ASCII,
- nonzero length, and may not contain the characters slash ("/"),
- backslash ("\"), space (" "), newline ("\n"), carriage return ("\r"),
- tab ("\t"), or period ("."). There is a default context,
- "org_freedesktop_general" that's used by servers that do not specify
- otherwise.
- </para>
- <para>
- Cookies are stored in a user's home directory, in the directory
- <filename>~/.dbus-keyrings/</filename>. This directory must
- not be readable or writable by other users. If it is,
- clients and servers must ignore it. The directory
- contains cookie files named after the cookie context.
- </para>
- <para>
- A cookie file contains one cookie per line. Each line
- has three space-separated fields:
- <itemizedlist>
- <listitem>
- <para>
- The cookie ID number, which must be a non-negative integer and
- may not be used twice in the same file.
- </para>
- </listitem>
- <listitem>
- <para>
- The cookie's creation time, in UNIX seconds-since-the-epoch
- format.
- </para>
- </listitem>
- <listitem>
- <para>
- The cookie itself, a hex-encoded random block of bytes. The cookie
- may be of any length, though obviously security increases
- as the length increases.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Only server processes modify the cookie file.
- They must do so with this procedure:
- <itemizedlist>
- <listitem>
- <para>
- Create a lockfile name by appending ".lock" to the name of the
- cookie file. The server should attempt to create this file
- using <literal>O_CREAT | O_EXCL</literal>. If file creation
- fails, the lock fails. Servers should retry for a reasonable
- period of time, then they may choose to delete an existing lock
- to keep users from having to manually delete a stale
- lock. <footnote><para>Lockfiles are used instead of real file
- locking <literal>fcntl()</literal> because real locking
- implementations are still flaky on network
- filesystems.</para></footnote>
- </para>
- </listitem>
- <listitem>
- <para>
- Once the lockfile has been created, the server loads the cookie
- file. It should then delete any cookies that are old (the
- timeout can be fairly short), or more than a reasonable
- time in the future (so that cookies never accidentally
- become permanent, if the clock was set far into the future
- at some point). If no recent keys remain, the
- server may generate a new key.
- </para>
- </listitem>
- <listitem>
- <para>
- The pruned and possibly added-to cookie file
- must be resaved atomically (using a temporary
- file which is rename()'d).
- </para>
- </listitem>
- <listitem>
- <para>
- The lock must be dropped by deleting the lockfile.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Clients need not lock the file in order to load it,
- because servers are required to save the file atomically.
- </para>
- </sect3>
- </sect2>
- </sect1>
- <sect1 id="addresses">
- <title>Server Addresses</title>
- <para>
- Server addresses consist of a transport name followed by a colon, and
- then an optional, comma-separated list of keys and values in the form key=value.
- Each value is escaped.
- </para>
- <para>
- For example:
- <programlisting>unix:path=/tmp/dbus-test</programlisting>
- Which is the address to a unix socket with the path /tmp/dbus-test.
- </para>
- <para>
- Value escaping is similar to URI escaping but simpler.
- <itemizedlist>
- <listitem>
- <para>
- The set of optionally-escaped bytes is:
- <literal>[0-9A-Za-z_-/.\]</literal>. To escape, each
- <emphasis>byte</emphasis> (note, not character) which is not in the
- set of optionally-escaped bytes must be replaced with an ASCII
- percent (<literal>%</literal>) and the value of the byte in hex.
- The hex value must always be two digits, even if the first digit is
- zero. The optionally-escaped bytes may be escaped if desired.
- </para>
- </listitem>
- <listitem>
- <para>
- To unescape, append each byte in the value; if a byte is an ASCII
- percent (<literal>%</literal>) character then append the following
- hex value instead. It is an error if a <literal>%</literal> byte
- does not have two hex digits following. It is an error if a
- non-optionally-escaped byte is seen unescaped.
- </para>
- </listitem>
- </itemizedlist>
- The set of optionally-escaped bytes is intended to preserve address
- readability and convenience.
- </para>
-
- <para>
- A server may specify a key-value pair with the key <literal>guid</literal>
- and the value a hex-encoded 16-byte sequence. <xref linkend="uuids"/>
- describes the format of the <literal>guid</literal> field. If present,
- this UUID may be used to distinguish one server address from another. A
- server should use a different UUID for each address it listens on. For
- example, if a message bus daemon offers both UNIX domain socket and TCP
- connections, but treats clients the same regardless of how they connect,
- those two connections are equivalent post-connection but should have
- distinct UUIDs to distinguish the kinds of connection.
- </para>
-
- <para>
- The intent of the address UUID feature is to allow a client to avoid
- opening multiple identical connections to the same server, by allowing the
- client to check whether an address corresponds to an already-existing
- connection. Comparing two addresses is insufficient, because addresses
- can be recycled by distinct servers, and equivalent addresses may look
- different if simply compared as strings (for example, the host in a TCP
- address can be given as an IP address or as a hostname).
- </para>
-
- <para>
- Note that the address key is <literal>guid</literal> even though the
- rest of the API and documentation says "UUID," for historical reasons.
- </para>
-
- <para>
- [FIXME clarify if attempting to connect to each is a requirement
- or just a suggestion]
- When connecting to a server, multiple server addresses can be
- separated by a semi-colon. The library will then try to connect
- to the first address and if that fails, it'll try to connect to
- the next one specified, and so forth. For example
- <programlisting>unix:path=/tmp/dbus-test;unix:path=/tmp/dbus-test2</programlisting>
- </para>
-
- </sect1>
-
- <sect1 id="transports">
- <title>Transports</title>
- <para>
- [FIXME we need to specify in detail each transport and its possible arguments]
-
- Current transports include: unix domain sockets (including
- abstract namespace on linux), launchd, systemd, TCP/IP, an executed subprocess and a debug/testing transport
- using in-process pipes. Future possible transports include one that
- tunnels over X11 protocol.
- </para>
-
- <sect2 id="transports-unix-domain-sockets">
- <title>Unix Domain Sockets</title>
- <para>
- Unix domain sockets can be either paths in the file system or on Linux
- kernels, they can be abstract which are similar to paths but
- do not show up in the file system.
- </para>
-
- <para>
- When a socket is opened by the D-Bus library it truncates the path
- name right before the first trailing Nul byte. This is true for both
- normal paths and abstract paths. Note that this is a departure from
- previous versions of D-Bus that would create sockets with a fixed
- length path name. Names which were shorter than the fixed length
- would be padded by Nul bytes.
- </para>
- <para>
- Unix domain sockets are not available on Windows.
- </para>
- <sect3 id="transports-unix-domain-sockets-addresses">
- <title>Server Address Format</title>
- <para>
- Unix domain socket addresses are identified by the "unix:" prefix
- and support the following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>path</entry>
- <entry>(path)</entry>
- <entry>path of the unix domain socket. If set, the "tmpdir" and "abstract" key must not be set.</entry>
- </row>
- <row>
- <entry>tmpdir</entry>
- <entry>(path)</entry>
- <entry>temporary directory in which a socket file with a random file name starting with 'dbus-' will be created by the server. This key can only be used in server addresses, not in client addresses. If set, the "path" and "abstract" key must not be set.</entry>
- </row>
- <row>
- <entry>abstract</entry>
- <entry>(string)</entry>
- <entry>unique string (path) in the abstract namespace. If set, the "path" or "tempdir" key must not be set.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
- </sect2>
- <sect2 id="transports-launchd">
- <title>launchd</title>
- <para>
- launchd is an open-source server management system that replaces init, inetd
- and cron on Apple Mac OS X versions 10.4 and above. It provides a common session
- bus address for each user and deprecates the X11-enabled D-Bus launcher on OSX.
- </para>
-
- <para>
- launchd allocates a socket and provides it with the unix path through the
- DBUS_LAUNCHD_SESSION_BUS_SOCKET variable in launchd's environment. Every process
- spawned by launchd (or dbus-daemon, if it was started by launchd) can access
- it through its environment.
- Other processes can query for the launchd socket by executing:
- $ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
- This is normally done by the D-Bus client library so doesn't have to be done
- manually.
- </para>
- <para>
- launchd is not available on Microsoft Windows.
- </para>
- <sect3 id="transports-launchd-addresses">
- <title>Server Address Format</title>
- <para>
- launchd addresses are identified by the "launchd:" prefix
- and support the following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>env</entry>
- <entry>(environment variable)</entry>
- <entry>path of the unix domain socket for the launchd created dbus-daemon.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
- </sect2>
- <sect2 id="transports-systemd">
- <title>systemd</title>
- <para>
- systemd is an open-source server management system that
- replaces init and inetd on newer Linux systems. It supports
- socket activation. The D-Bus systemd transport is used to acquire
- socket activation file descriptors from systemd and use them
- as D-Bus transport when the current process is spawned by
- socket activation from it.
- </para>
- <para>
- The systemd transport accepts only one or more Unix domain or
- TCP streams sockets passed in via socket activation.
- </para>
- <para>
- The systemd transport is not available on non-Linux operating systems.
- </para>
- <para>
- The systemd transport defines no parameter keys.
- </para>
- </sect2>
- <sect2 id="transports-tcp-sockets">
- <title>TCP Sockets</title>
- <para>
- The tcp transport provides TCP/IP based connections between clients
- located on the same or different hosts.
- </para>
- <para>
- Using tcp transport without any additional secure authentification mechanismus
- over a network is unsecure.
- </para>
- <para>
- Windows notes: Because of the tcp stack on Windows does not provide sending
- credentials over a tcp connection, the EXTERNAL authentification
- mechanismus does not work.
- </para>
- <sect3 id="transports-tcp-sockets-addresses">
- <title>Server Address Format</title>
- <para>
- TCP/IP socket addresses are identified by the "tcp:" prefix
- and support the following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>host</entry>
- <entry>(string)</entry>
- <entry>dns name or ip address</entry>
- </row>
- <row>
- <entry>port</entry>
- <entry>(number)</entry>
- <entry>The tcp port the server will open. A zero value let the server
- choose a free port provided from the underlaying operating system.
- libdbus is able to retrieve the real used port from the server.
- </entry>
- </row>
- <row>
- <entry>family</entry>
- <entry>(string)</entry>
- <entry>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
- </sect2>
- <sect2 id="transports-nonce-tcp-sockets">
- <title>Nonce-secured TCP Sockets</title>
- <para>
- The nonce-tcp transport provides a secured TCP transport, using a
- simple authentication mechanism to ensure that only clients with read
- access to a certain location in the filesystem can connect to the server.
- The server writes a secret, the nonce, to a file and an incoming client
- connection is only accepted if the client sends the nonce right after
- the connect. The nonce mechanism requires no setup and is orthogonal to
- the higher-level authentication mechanisms described in the
- Authentication section.
- </para>
-
- <para>
- On start, the server generates a random 16 byte nonce and writes it
- to a file in the user's temporary directory. The nonce file location
- is published as part of the server's D-Bus address using the
- "noncefile" key-value pair.
-
- After an accept, the server reads 16 bytes from the socket. If the
- read bytes do not match the nonce stored in the nonce file, the
- server MUST immediately drop the connection.
- If the nonce match the received byte sequence, the client is accepted
- and the transport behaves like an unsecured tcp transport.
- </para>
- <para>
- After a successful connect to the server socket, the client MUST read
- the nonce from the file published by the server via the noncefile=
- key-value pair and send it over the socket. After that, the
- transport behaves like an unsecured tcp transport.
- </para>
- <sect3 id="transports-nonce-tcp-sockets-addresses">
- <title>Server Address Format</title>
- <para>
- Nonce TCP/IP socket addresses uses the "nonce-tcp:" prefix
- and support the following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>host</entry>
- <entry>(string)</entry>
- <entry>dns name or ip address</entry>
- </row>
- <row>
- <entry>port</entry>
- <entry>(number)</entry>
- <entry>The tcp port the server will open. A zero value let the server
- choose a free port provided from the underlaying operating system.
- libdbus is able to retrieve the real used port from the server.
- </entry>
- </row>
- <row>
- <entry>family</entry>
- <entry>(string)</entry>
- <entry>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</entry>
- </row>
- <row>
- <entry>noncefile</entry>
- <entry>(path)</entry>
- <entry>file location containing the secret</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
- </sect2>
- <sect2 id="transports-exec">
- <title>Executed Subprocesses on Unix</title>
- <para>
- This transport forks off a process and connects its standard
- input and standard output with an anonymous Unix domain
- socket. This socket is then used for communication by the
- transport. This transport may be used to use out-of-process
- forwarder programs as basis for the D-Bus protocol.
- </para>
- <para>
- The forked process will inherit the standard error output and
- process group from the parent process.
- </para>
- <para>
- Executed subprocesses are not available on Windows.
- </para>
- <sect3 id="transports-exec-addresses">
- <title>Server Address Format</title>
- <para>
- Executed subprocess addresses are identified by the "unixexec:" prefix
- and support the following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>path</entry>
- <entry>(path)</entry>
- <entry>Path of the binary to execute, either an absolute
- path or a binary name that is searched for in the default
- search path of the OS. This corresponds to the first
- argument of execlp(). This key is mandatory.</entry>
- </row>
- <row>
- <entry>argv0</entry>
- <entry>(string)</entry>
- <entry>The program name to use when executing the
- binary. If omitted the same value as specified for path=
- will be used. This corresponds to the second argument of
- execlp().</entry>
- </row>
- <row>
- <entry>argv1, argv2, ...</entry>
- <entry>(string)</entry>
- <entry>Arguments to pass to the binary. This corresponds
- to the third and later arguments of execlp(). If a
- specific argvX is not specified no further argvY for Y > X
- are taken into account.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
- </sect2>
- </sect1>
- <sect1 id="meta-transports">
- <title>Meta Transports</title>
- <para>
- Meta transports are a kind of transport with special enhancements or
- behavior. Currently available meta transports include: autolaunch
- </para>
-
- <sect2 id="meta-transports-autolaunch">
- <title>Autolaunch</title>
- <para>The autolaunch transport provides a way for dbus clients to autodetect
- a running dbus session bus and to autolaunch a session bus if not present.
- </para>
- <sect3 id="meta-transports-autolaunch-addresses">
- <title>Server Address Format</title>
- <para>
- Autolaunch addresses uses the "autolaunch:" prefix and support the
- following key/value pairs:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>scope</entry>
- <entry>(string)</entry>
- <entry>scope of autolaunch (Windows only)
- <itemizedlist>
- <listitem>
- <para>
- "*install-path" - limit session bus to dbus installation path.
- The dbus installation path is determined from the location of
- the shared dbus library. If the library is located in a 'bin'
- subdirectory the installation root is the directory above,
- otherwise the directory where the library lives is taken as
- installation root.
- <programlisting>
- &lt;install-root&gt;/bin/[lib]dbus-1.dll
- &lt;install-root&gt;/[lib]dbus-1.dll
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- "*user" - limit session bus to the recent user.
- </para>
- </listitem>
- <listitem>
- <para>
- other values - specify dedicated session bus like "release",
- "debug" or other
- </para>
- </listitem>
- </itemizedlist>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect3>
-
- <sect3 id="meta-transports-autolaunch-windows-implementation">
- <title>Windows implementation</title>
- <para>
- On start, the server opens a platform specific transport, creates a mutex
- and a shared memory section containing the related session bus address.
- This mutex will be inspected by the dbus client library to detect a
- running dbus session bus. The access to the mutex and the shared memory
- section are protected by global locks.
- </para>
- <para>
- In the recent implementation the autolaunch transport uses a tcp transport
- on localhost with a port choosen from the operating system. This detail may
- change in the future.
- </para>
- <para>
- Disclaimer: The recent implementation is in an early state and may not
- work in all cirumstances and/or may have security issues. Because of this
- the implementation is not documentated yet.
- </para>
- </sect3>
- </sect2>
- </sect1>
-
- <sect1 id="uuids">
- <title>UUIDs</title>
- <para>
- A working D-Bus implementation uses universally-unique IDs in two places.
- First, each server address has a UUID identifying the address,
- as described in <xref linkend="addresses"/>. Second, each operating
- system kernel instance running a D-Bus client or server has a UUID
- identifying that kernel, retrieved by invoking the method
- org.freedesktop.DBus.Peer.GetMachineId() (see <xref
- linkend="standard-interfaces-peer"/>).
- </para>
- <para>
- The term "UUID" in this document is intended literally, i.e. an
- identifier that is universally unique. It is not intended to refer to
- RFC4122, and in fact the D-Bus UUID is not compatible with that RFC.
- </para>
- <para>
- The UUID must contain 128 bits of data and be hex-encoded. The
- hex-encoded string may not contain hyphens or other non-hex-digit
- characters, and it must be exactly 32 characters long. To generate a
- UUID, the current reference implementation concatenates 96 bits of random
- data followed by the 32-bit time in seconds since the UNIX epoch (in big
- endian byte order).
- </para>
- <para>
- It would also be acceptable and probably better to simply generate 128
- bits of random data, as long as the random number generator is of high
- quality. The timestamp could conceivably help if the random bits are not
- very random. With a quality random number generator, collisions are
- extremely unlikely even with only 96 bits, so it's somewhat academic.
- </para>
- <para>
- Implementations should, however, stick to random data for the first 96 bits
- of the UUID.
- </para>
- </sect1>
-
- <sect1 id="standard-interfaces">
- <title>Standard Interfaces</title>
- <para>
- See <xref linkend="message-protocol-types-notation"/> for details on
- the notation used in this section. There are some standard interfaces
- that may be useful across various D-Bus applications.
- </para>
- <sect2 id="standard-interfaces-peer">
- <title><literal>org.freedesktop.DBus.Peer</literal></title>
- <para>
- The <literal>org.freedesktop.DBus.Peer</literal> interface
- has two methods:
- <programlisting>
- org.freedesktop.DBus.Peer.Ping ()
- org.freedesktop.DBus.Peer.GetMachineId (out STRING machine_uuid)
- </programlisting>
- </para>
- <para>
- On receipt of the <literal>METHOD_CALL</literal> message
- <literal>org.freedesktop.DBus.Peer.Ping</literal>, an application should do
- nothing other than reply with a <literal>METHOD_RETURN</literal> as
- usual. It does not matter which object path a ping is sent to. The
- reference implementation handles this method automatically.
- </para>
- <para>
- On receipt of the <literal>METHOD_CALL</literal> message
- <literal>org.freedesktop.DBus.Peer.GetMachineId</literal>, an application should
- reply with a <literal>METHOD_RETURN</literal> containing a hex-encoded
- UUID representing the identity of the machine the process is running on.
- This UUID must be the same for all processes on a single system at least
- until that system next reboots. It should be the same across reboots
- if possible, but this is not always possible to implement and is not
- guaranteed.
- It does not matter which object path a GetMachineId is sent to. The
- reference implementation handles this method automatically.
- </para>
- <para>
- The UUID is intended to be per-instance-of-the-operating-system, so may represent
- a virtual machine running on a hypervisor, rather than a physical machine.
- Basically if two processes see the same UUID, they should also see the same
- shared memory, UNIX domain sockets, process IDs, and other features that require
- a running OS kernel in common between the processes.
- </para>
- <para>
- The UUID is often used where other programs might use a hostname. Hostnames
- can change without rebooting, however, or just be "localhost" - so the UUID
- is more robust.
- </para>
- <para>
- <xref linkend="uuids"/> explains the format of the UUID.
- </para>
- </sect2>
-
- <sect2 id="standard-interfaces-introspectable">
- <title><literal>org.freedesktop.DBus.Introspectable</literal></title>
- <para>
- This interface has one method:
- <programlisting>
- org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data)
- </programlisting>
- </para>
- <para>
- Objects instances may implement
- <literal>Introspect</literal> which returns an XML description of
- the object, including its interfaces (with signals and methods), objects
- below it in the object path tree, and its properties.
- </para>
- <para>
- <xref linkend="introspection-format"/> describes the format of this XML string.
- </para>
- </sect2>
- <sect2 id="standard-interfaces-properties">
- <title><literal>org.freedesktop.DBus.Properties</literal></title>
- <para>
- Many native APIs will have a concept of object <firstterm>properties</firstterm>
- or <firstterm>attributes</firstterm>. These can be exposed via the
- <literal>org.freedesktop.DBus.Properties</literal> interface.
- </para>
- <para>
- <programlisting>
- org.freedesktop.DBus.Properties.Get (in STRING interface_name,
- in STRING property_name,
- out VARIANT value);
- org.freedesktop.DBus.Properties.Set (in STRING interface_name,
- in STRING property_name,
- in VARIANT value);
- org.freedesktop.DBus.Properties.GetAll (in STRING interface_name,
- out DICT&lt;STRING,VARIANT&gt; props);
- </programlisting>
- </para>
- <para>
- It is conventional to give D-Bus properties names consisting of
- capitalized words without punctuation ("CamelCase"), like
- <link linkend="message-protocol-names-member">member names</link>.
- For instance, the GObject property
- <literal>connection-status</literal> or the Qt property
- <literal>connectionStatus</literal> could be represented on D-Bus
- as <literal>ConnectionStatus</literal>.
- </para>
- <para>
- Strictly speaking, D-Bus property names are not required to follow
- the same naming restrictions as member names, but D-Bus property
- names that would not be valid member names (in particular,
- GObject-style dash-separated property names) can cause interoperability
- problems and should be avoided.
- </para>
- <para>
- The available properties and whether they are writable can be determined
- by calling <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>,
- see <xref linkend="standard-interfaces-introspectable"/>.
- </para>
- <para>
- An empty string may be provided for the interface name; in this case,
- if there are multiple properties on an object with the same name,
- the results are undefined (picking one by according to an arbitrary
- deterministic rule, or returning an error, are the reasonable
- possibilities).
- </para>
- <para>
- If one or more properties change on an object, the
- <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
- signal may be emitted (this signal was added in 0.14):
- </para>
- <para>
- <programlisting>
- org.freedesktop.DBus.Properties.PropertiesChanged (STRING interface_name,
- DICT&lt;STRING,VARIANT&gt; changed_properties,
- ARRAY&lt;STRING&gt; invalidated_properties);
- </programlisting>
- </para>
- <para>
- where <literal>changed_properties</literal> is a dictionary
- containing the changed properties with the new values and
- <literal>invalidated_properties</literal> is an array of
- properties that changed but the value is not conveyed.
- </para>
- <para>
- Whether the <literal>PropertiesChanged</literal> signal is
- supported can be determined by calling
- <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>. Note
- that the signal may be supported for an object but it may
- differ how whether and how it is used on a per-property basis
- (for e.g. performance or security reasons). Each property (or
- the parent interface) must be annotated with the
- <literal>org.freedesktop.DBus.Property.EmitsChangedSignal</literal>
- annotation to convey this (usually the default value
- <literal>true</literal> is sufficient meaning that the
- annotation does not need to be used). See <xref
- linkend="introspection-format"/> for details on this
- annotation.
- </para>
- </sect2>
-
- <sect2 id="standard-interfaces-objectmanager">
- <title><literal>org.freedesktop.DBus.ObjectManager</literal></title>
- <para>
- An API can optionally make use of this interface for one or
- more sub-trees of objects. The root of each sub-tree implements
- this interface so other applications can get all objects,
- interfaces and properties in a single method call. It is
- appropriate to use this interface if users of the tree of
- objects are expected to be interested in all interfaces of all
- objects in the tree; a more granular API should be used if
- users of the objects are expected to be interested in a small
- subset of the objects, a small subset of their interfaces, or
- both.
- </para>
- <para>
- The method that applications can use to get all objects and
- properties is <literal>GetManagedObjects</literal>:
- </para>
- <para>
- <programlisting>
- org.freedesktop.DBus.ObjectManager.GetManagedObjects (out DICT&lt;OBJPATH,DICT&lt;STRING,DICT&lt;STRING,VARIANT&gt;&gt;&gt; objpath_interfaces_and_properties);
- </programlisting>
- </para>
- <para>
- The return value of this method is a dict whose keys are
- object paths. All returned object paths are children of the
- object path implementing this interface, i.e. their object
- paths start with the ObjectManager's object path plus '/'.
- </para>
- <para>
- Each value is a dict whose keys are interfaces names. Each
- value in this inner dict is the same dict that would be
- returned by the <link
- linkend="standard-interfaces-properties">org.freedesktop.DBus.Properties.GetAll()</link>
- method for that combination of object path and interface. If
- an interface has no properties, the empty dict is returned.
- </para>
- <para>
- Changes are emitted using the following two signals:
- </para>
- <para>
- <programlisting>
- org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH object_path,
- DICT&lt;STRING,DICT&lt;STRING,VARIANT&gt;&gt; interfaces_and_properties);
- org.freedesktop.DBus.ObjectManager.InterfacesRemoved (OBJPATH object_path,
- ARRAY&lt;STRING&gt; interfaces);
- </programlisting>
- </para>
- <para>
- The <literal>InterfacesAdded</literal> signal is emitted when
- either a new object is added or when an existing object gains
- one or more interfaces. The
- <literal>InterfacesRemoved</literal> signal is emitted
- whenever an object is removed or it loses one or more
- interfaces. The second parameter of the
- <literal>InterfacesAdded</literal> signal contains a dict with
- the interfaces and properties (if any) that have been added to
- the given object path. Similarly, the second parameter of the
- <literal>InterfacesRemoved</literal> signal contains an array
- of the interfaces that were removed. Note that changes on
- properties on existing interfaces are not reported using this
- interface - an application should also monitor the existing <link
- linkend="standard-interfaces-properties">PropertiesChanged</link>
- signal on each object.
- </para>
- <para>
- Applications SHOULD NOT export objects that are children of an
- object (directly or otherwise) implementing this interface but
- which are not returned in the reply from the
- <literal>GetManagedObjects()</literal> method of this
- interface on the given object.
- </para>
- <para>
- The intent of the <literal>ObjectManager</literal> interface
- is to make it easy to write a robust client
- implementation. The trivial client implementation only needs
- to make two method calls:
- </para>
- <para>
- <programlisting>
- org.freedesktop.DBus.AddMatch (bus_proxy,
- "type='signal',name='org.example.App',path_namespace='/org/example/App'");
- objects = org.freedesktop.DBus.ObjectManager.GetManagedObjects (app_proxy);
- </programlisting>
- </para>
- <para>
- on the message bus and the remote application's
- <literal>ObjectManager</literal>, respectively. Whenever a new
- remote object is created (or an existing object gains a new
- interface), the <literal>InterfacesAdded</literal> signal is
- emitted, and since this signal contains all properties for the
- interfaces, no calls to the
- <literal>org.freedesktop.Properties</literal> interface on the
- remote object are needed. Additionally, since the initial
- <literal>AddMatch()</literal> rule already includes signal
- messages from the newly created child object, no new
- <literal>AddMatch()</literal> call is needed.
- </para>
-
- <para>
- <emphasis>
- The <literal>org.freedesktop.DBus.ObjectManager</literal>
- interface was added in version 0.17 of the D-Bus
- specification.
- </emphasis>
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="introspection-format">
- <title>Introspection Data Format</title>
- <para>
- As described in <xref linkend="standard-interfaces-introspectable"/>,
- objects may be introspected at runtime, returning an XML string
- that describes the object. The same XML format may be used in
- other contexts as well, for example as an "IDL" for generating
- static language bindings.
- </para>
- <para>
- Here is an example of introspection data:
- <programlisting>
- &lt;!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"&gt;
- &lt;node name="/com/example/sample_object"&gt;
- &lt;interface name="com.example.SampleInterface"&gt;
- &lt;method name="Frobate"&gt;
- &lt;arg name="foo" type="i" direction="in"/&gt;
- &lt;arg name="bar" type="s" direction="out"/&gt;
- &lt;arg name="baz" type="a{us}" direction="out"/&gt;
- &lt;annotation name="org.freedesktop.DBus.Deprecated" value="true"/&gt;
- &lt;/method&gt;
- &lt;method name="Bazify"&gt;
- &lt;arg name="bar" type="(iiu)" direction="in"/&gt;
- &lt;arg name="bar" type="v" direction="out"/&gt;
- &lt;/method&gt;
- &lt;method name="Mogrify"&gt;
- &lt;arg name="bar" type="(iiav)" direction="in"/&gt;
- &lt;/method&gt;
- &lt;signal name="Changed"&gt;
- &lt;arg name="new_value" type="b"/&gt;
- &lt;/signal&gt;
- &lt;property name="Bar" type="y" access="readwrite"/&gt;
- &lt;/interface&gt;
- &lt;node name="child_of_sample_object"/&gt;
- &lt;node name="another_child_of_sample_object"/&gt;
- &lt;/node&gt;
- </programlisting>
- </para>
- <para>
- A more formal DTD and spec needs writing, but here are some quick notes.
- <itemizedlist>
- <listitem>
- <para>
- Only the root &lt;node&gt; element can omit the node name, as it's
- known to be the object that was introspected. If the root
- &lt;node&gt; does have a name attribute, it must be an absolute
- object path. If child &lt;node&gt; have object paths, they must be
- relative.
- </para>
- </listitem>
- <listitem>
- <para>
- If a child &lt;node&gt; has any sub-elements, then they
- must represent a complete introspection of the child.
- If a child &lt;node&gt; is empty, then it may or may
- not have sub-elements; the child must be introspected
- in order to find out. The intent is that if an object
- knows that its children are "fast" to introspect
- it can go ahead and return their information, but
- otherwise it can omit it.
- </para>
- </listitem>
- <listitem>
- <para>
- The direction element on &lt;arg&gt; may be omitted,
- in which case it defaults to "in" for method calls
- and "out" for signals. Signals only allow "out"
- so while direction may be specified, it's pointless.
- </para>
- </listitem>
- <listitem>
- <para>
- The possible directions are "in" and "out",
- unlike CORBA there is no "inout"
- </para>
- </listitem>
- <listitem>
- <para>
- The possible property access flags are
- "readwrite", "read", and "write"
- </para>
- </listitem>
- <listitem>
- <para>
- Multiple interfaces can of course be listed for
- one &lt;node&gt;.
- </para>
- </listitem>
- <listitem>
- <para>
- The "name" attribute on arguments is optional.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Method, interface, property, and signal elements may have
- "annotations", which are generic key/value pairs of metadata.
- They are similar conceptually to Java's annotations and C# attributes.
- Well-known annotations:
- </para>
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values (separated by ,)</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>org.freedesktop.DBus.Deprecated</entry>
- <entry>true,false</entry>
- <entry>Whether or not the entity is deprecated; defaults to false</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.GLib.CSymbol</entry>
- <entry>(string)</entry>
- <entry>The C symbol; may be used for methods and interfaces</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.Method.NoReply</entry>
- <entry>true,false</entry>
- <entry>If set, don't expect a reply to the method call; defaults to false.</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.Property.EmitsChangedSignal</entry>
- <entry>true,invalidates,false</entry>
- <entry>
- <para>
- If set to <literal>false</literal>, the
- <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
- signal, see <xref
- linkend="standard-interfaces-properties"/> is not
- guaranteed to be emitted if the property changes.
- </para>
- <para>
- If set to <literal>invalidates</literal> the signal
- is emitted but the value is not included in the
- signal.
- </para>
- <para>
- If set to <literal>true</literal> the signal is
- emitted with the value included.
- </para>
- <para>
- The value for the annotation defaults to
- <literal>true</literal> if the enclosing interface
- element does not specify the annotation. Otherwise it
- defaults to the value specified in the enclosing
- interface element.
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect1>
- <sect1 id="message-bus">
- <title>Message Bus Specification</title>
- <sect2 id="message-bus-overview">
- <title>Message Bus Overview</title>
- <para>
- The message bus accepts connections from one or more applications.
- Once connected, applications can exchange messages with other
- applications that are also connected to the bus.
- </para>
- <para>
- In order to route messages among connections, the message bus keeps a
- mapping from names to connections. Each connection has one
- unique-for-the-lifetime-of-the-bus name automatically assigned.
- Applications may request additional names for a connection. Additional
- names are usually "well-known names" such as
- "com.example.TextEditor". When a name is bound to a connection,
- that connection is said to <firstterm>own</firstterm> the name.
- </para>
- <para>
- The bus itself owns a special name,
- <literal>org.freedesktop.DBus</literal>, with an object
- located at <literal>/org/freedesktop/DBus</literal> that
- implements the <literal>org.freedesktop.DBus</literal>
- interface. This service allows applications to make
- administrative requests of the bus itself. For example,
- applications can ask the bus to assign a name to a connection.
- </para>
- <para>
- Each name may have <firstterm>queued owners</firstterm>. When an
- application requests a name for a connection and the name is already in
- use, the bus will optionally add the connection to a queue waiting for
- the name. If the current owner of the name disconnects or releases
- the name, the next connection in the queue will become the new owner.
- </para>
-
- <para>
- This feature causes the right thing to happen if you start two text
- editors for example; the first one may request "com.example.TextEditor",
- and the second will be queued as a possible owner of that name. When
- the first exits, the second will take over.
- </para>
-
- <para>
- Applications may send <firstterm>unicast messages</firstterm> to
- a specific recipient or to the message bus itself, or
- <firstterm>broadcast messages</firstterm> to all interested recipients.
- See <xref linkend="message-bus-routing"/> for details.
- </para>
- </sect2>
-
- <sect2 id="message-bus-names">
- <title>Message Bus Names</title>
- <para>
- Each connection has at least one name, assigned at connection time and
- returned in response to the
- <literal>org.freedesktop.DBus.Hello</literal> method call. This
- automatically-assigned name is called the connection's <firstterm>unique
- name</firstterm>. Unique names are never reused for two different
- connections to the same bus.
- </para>
- <para>
- Ownership of a unique name is a prerequisite for interaction with
- the message bus. It logically follows that the unique name is always
- the first name that an application comes to own, and the last
- one that it loses ownership of.
- </para>
- <para>
- Unique connection names must begin with the character ':' (ASCII colon
- character); bus names that are not unique names must not begin
- with this character. (The bus must reject any attempt by an application
- to manually request a name beginning with ':'.) This restriction
- categorically prevents "spoofing"; messages sent to a unique name
- will always go to the expected connection.
- </para>
- <para>
- When a connection is closed, all the names that it owns are deleted (or
- transferred to the next connection in the queue if any).
- </para>
- <para>
- A connection can request additional names to be associated with it using
- the <literal>org.freedesktop.DBus.RequestName</literal> message. <xref
- linkend="message-protocol-names-bus"/> describes the format of a valid
- name. These names can be released again using the
- <literal>org.freedesktop.DBus.ReleaseName</literal> message.
- </para>
-
- <sect3 id="bus-messages-request-name">
- <title><literal>org.freedesktop.DBus.RequestName</literal></title>
- <para>
- As a method:
- <programlisting>
- UINT32 RequestName (in STRING name, in UINT32 flags)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name to request</entry>
- </row>
- <row>
- <entry>1</entry>
- <entry>UINT32</entry>
- <entry>Flags</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>UINT32</entry>
- <entry>Return value</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This method call should be sent to
- <literal>org.freedesktop.DBus</literal> and asks the message bus to
- assign the given name to the method caller. Each name maintains a
- queue of possible owners, where the head of the queue is the primary
- or current owner of the name. Each potential owner in the queue
- maintains the DBUS_NAME_FLAG_ALLOW_REPLACEMENT and
- DBUS_NAME_FLAG_DO_NOT_QUEUE settings from its latest RequestName
- call. When RequestName is invoked the following occurs:
- <itemizedlist>
- <listitem>
- <para>
- If the method caller is currently the primary owner of the name,
- the DBUS_NAME_FLAG_ALLOW_REPLACEMENT and DBUS_NAME_FLAG_DO_NOT_QUEUE
- values are updated with the values from the new RequestName call,
- and nothing further happens.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If the current primary owner (head of the queue) has
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT set, and the RequestName
- invocation has the DBUS_NAME_FLAG_REPLACE_EXISTING flag, then
- the caller of RequestName replaces the current primary owner at
- the head of the queue and the current primary owner moves to the
- second position in the queue. If the caller of RequestName was
- in the queue previously its flags are updated with the values from
- the new RequestName in addition to moving it to the head of the queue.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If replacement is not possible, and the method caller is
- currently in the queue but not the primary owner, its flags are
- updated with the values from the new RequestName call.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If replacement is not possible, and the method caller is
- currently not in the queue, the method caller is appended to the
- queue.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If any connection in the queue has DBUS_NAME_FLAG_DO_NOT_QUEUE
- set and is not the primary owner, it is removed from the
- queue. This can apply to the previous primary owner (if it
- was replaced) or the method caller (if it updated the
- DBUS_NAME_FLAG_DO_NOT_QUEUE flag while still stuck in the
- queue, or if it was just added to the queue with that flag set).
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Note that DBUS_NAME_FLAG_REPLACE_EXISTING results in "jumping the
- queue," even if another application already in the queue had specified
- DBUS_NAME_FLAG_REPLACE_EXISTING. This comes up if a primary owner
- that does not allow replacement goes away, and the next primary owner
- does allow replacement. In this case, queued items that specified
- DBUS_NAME_FLAG_REPLACE_EXISTING <emphasis>do not</emphasis>
- automatically replace the new primary owner. In other words,
- DBUS_NAME_FLAG_REPLACE_EXISTING is not saved, it is only used at the
- time RequestName is called. This is deliberate to avoid an infinite loop
- anytime two applications are both DBUS_NAME_FLAG_ALLOW_REPLACEMENT
- and DBUS_NAME_FLAG_REPLACE_EXISTING.
- </para>
- <para>
- The flags argument contains any of the following values logically ORed
- together:
-
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>DBUS_NAME_FLAG_ALLOW_REPLACEMENT</entry>
- <entry>0x1</entry>
- <entry>
-
- If an application A specifies this flag and succeeds in
- becoming the owner of the name, and another application B
- later calls RequestName with the
- DBUS_NAME_FLAG_REPLACE_EXISTING flag, then application A
- will lose ownership and receive a
- <literal>org.freedesktop.DBus.NameLost</literal> signal, and
- application B will become the new owner. If DBUS_NAME_FLAG_ALLOW_REPLACEMENT
- is not specified by application A, or DBUS_NAME_FLAG_REPLACE_EXISTING
- is not specified by application B, then application B will not replace
- application A as the owner.
-
- </entry>
- </row>
- <row>
- <entry>DBUS_NAME_FLAG_REPLACE_EXISTING</entry>
- <entry>0x2</entry>
- <entry>
-
- Try to replace the current owner if there is one. If this
- flag is not set the application will only become the owner of
- the name if there is no current owner. If this flag is set,
- the application will replace the current owner if
- the current owner specified DBUS_NAME_FLAG_ALLOW_REPLACEMENT.
-
- </entry>
- </row>
- <row>
- <entry>DBUS_NAME_FLAG_DO_NOT_QUEUE</entry>
- <entry>0x4</entry>
- <entry>
-
- Without this flag, if an application requests a name that is
- already owned, the application will be placed in a queue to
- own the name when the current owner gives it up. If this
- flag is given, the application will not be placed in the
- queue, the request for the name will simply fail. This flag
- also affects behavior when an application is replaced as
- name owner; by default the application moves back into the
- waiting queue, unless this flag was provided when the application
- became the name owner.
-
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
- The return code can be one of the following values:
-
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER</entry>
- <entry>1</entry> <entry>The caller is now the primary owner of
- the name, replacing any previous owner. Either the name had no
- owner before, or the caller specified
- DBUS_NAME_FLAG_REPLACE_EXISTING and the current owner specified
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT.</entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_IN_QUEUE</entry>
- <entry>2</entry>
-
- <entry>The name already had an owner,
- DBUS_NAME_FLAG_DO_NOT_QUEUE was not specified, and either
- the current owner did not specify
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT or the requesting
- application did not specify DBUS_NAME_FLAG_REPLACE_EXISTING.
- </entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_EXISTS</entry> <entry>3</entry>
- <entry>The name already has an owner,
- DBUS_NAME_FLAG_DO_NOT_QUEUE was specified, and either
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT was not specified by the
- current owner, or DBUS_NAME_FLAG_REPLACE_EXISTING was not
- specified by the requesting application.</entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER</entry>
- <entry>4</entry>
- <entry>The application trying to request ownership of a name is already the owner of it.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- </sect3>
-
- <sect3 id="bus-messages-release-name">
- <title><literal>org.freedesktop.DBus.ReleaseName</literal></title>
- <para>
- As a method:
- <programlisting>
- UINT32 ReleaseName (in STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name to release</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>UINT32</entry>
- <entry>Return value</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This method call should be sent to
- <literal>org.freedesktop.DBus</literal> and asks the message bus to
- release the method caller's claim to the given name. If the caller is
- the primary owner, a new primary owner will be selected from the
- queue if any other owners are waiting. If the caller is waiting in
- the queue for the name, the caller will removed from the queue and
- will not be made an owner of the name if it later becomes available.
- If there are no other owners in the queue for the name, it will be
- removed from the bus entirely.
-
- The return code can be one of the following values:
-
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Conventional Name</entry>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>DBUS_RELEASE_NAME_REPLY_RELEASED</entry>
- <entry>1</entry> <entry>The caller has released his claim on
- the given name. Either the caller was the primary owner of
- the name, and the name is now unused or taken by somebody
- waiting in the queue for the name, or the caller was waiting
- in the queue for the name and has now been removed from the
- queue.</entry>
- </row>
- <row>
- <entry>DBUS_RELEASE_NAME_REPLY_NON_EXISTENT</entry>
- <entry>2</entry>
- <entry>The given name does not exist on this bus.</entry>
- </row>
- <row>
- <entry>DBUS_RELEASE_NAME_REPLY_NOT_OWNER</entry>
- <entry>3</entry>
- <entry>The caller was not the primary owner of this name,
- and was also not waiting in the queue to own this name.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- </sect3>
-
- <sect3 id="bus-messages-list-queued-owners">
- <title><literal>org.freedesktop.DBus.ListQueuedOwners</literal></title>
- <para>
- As a method:
- <programlisting>
- ARRAY of STRING ListQueuedOwners (in STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>The well-known bus name to query, such as
- <literal>com.example.cappuccino</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of STRING</entry>
- <entry>The unique bus names of connections currently queued
- for the name</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This method call should be sent to
- <literal>org.freedesktop.DBus</literal> and lists the connections
- currently queued for a bus name (see
- <xref linkend="term-queued-owner"/>).
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-bus-routing">
- <title>Message Bus Message Routing</title>
-
- <para>
- Messages may have a <literal>DESTINATION</literal> field (see <xref
- linkend="message-protocol-header-fields"/>), resulting in a
- <firstterm>unicast message</firstterm>. If the
- <literal>DESTINATION</literal> field is present, it specifies a message
- recipient by name. Method calls and replies normally specify this field.
- The message bus must send messages (of any type) with the
- <literal>DESTINATION</literal> field set to the specified recipient,
- regardless of whether the recipient has set up a match rule matching
- the message.
- </para>
-
- <para>
- When the message bus receives a signal, if the
- <literal>DESTINATION</literal> field is absent, it is considered to
- be a <firstterm>broadcast signal</firstterm>, and is sent to all
- applications with <firstterm>message matching rules</firstterm> that
- match the message. Most signal messages are broadcasts.
- </para>
-
- <para>
- Unicast signal messages (those with a <literal>DESTINATION</literal>
- field) are not commonly used, but they are treated like any unicast
- message: they are delivered to the specified receipient,
- regardless of its match rules. One use for unicast signals is to
- avoid a race condition in which a signal is emitted before the intended
- recipient can call <xref linkend="bus-messages-add-match"/> to
- receive that signal: if the signal is sent directly to that recipient
- using a unicast message, it does not need to add a match rule at all,
- and there is no race condition. Another use for unicast signals,
- on message buses whose security policy prevents eavesdropping, is to
- send sensitive information which should only be visible to one
- recipient.
- </para>
-
- <para>
- When the message bus receives a method call, if the
- <literal>DESTINATION</literal> field is absent, the call is taken to be
- a standard one-to-one message and interpreted by the message bus
- itself. For example, sending an
- <literal>org.freedesktop.DBus.Peer.Ping</literal> message with no
- <literal>DESTINATION</literal> will cause the message bus itself to
- reply to the ping immediately; the message bus will not make this
- message visible to other applications.
- </para>
-
- <para>
- Continuing the <literal>org.freedesktop.DBus.Peer.Ping</literal> example, if
- the ping message were sent with a <literal>DESTINATION</literal> name of
- <literal>com.yoyodyne.Screensaver</literal>, then the ping would be
- forwarded, and the Yoyodyne Corporation screensaver application would be
- expected to reply to the ping.
- </para>
-
- <para>
- Message bus implementations may impose a security policy which
- prevents certain messages from being sent or received.
- When a message cannot be sent or received due to a security
- policy, the message bus should send an error reply, unless the
- original message had the <literal>NO_REPLY</literal> flag.
- </para>
-
- <sect3 id="message-bus-routing-eavesdropping">
- <title>Eavesdropping</title>
- <para>
- Receiving a unicast message whose <literal>DESTINATION</literal>
- indicates a different recipient is called
- <firstterm>eavesdropping</firstterm>. On a message bus which acts as
- a security boundary (like the standard system bus), the security
- policy should usually prevent eavesdropping, since unicast messages
- are normally kept private and may contain security-sensitive
- information.
- </para>
-
- <para>
- Eavesdropping is mainly useful for debugging tools, such as
- the <literal>dbus-monitor</literal> tool in the reference
- implementation of D-Bus. Tools which eavesdrop on the message bus
- should be careful to avoid sending a reply or error in response to
- messages intended for a different client.
- </para>
-
- <para>
- Clients may attempt to eavesdrop by adding match rules
- (see <xref linkend="message-bus-routing-match-rules"/>) containing
- the <literal>eavesdrop='true'</literal> match. If the message bus'
- security policy does not allow eavesdropping, the match rule can
- still be added, but will not have any practical effect. For
- compatibility with older message bus implementations, if adding such
- a match rule results in an error reply, the client may fall back to
- adding the same rule with the <literal>eavesdrop</literal> match
- omitted.
- </para>
- </sect3>
-
- <sect3 id="message-bus-routing-match-rules">
- <title>Match Rules</title>
- <para>
- An important part of the message bus routing protocol is match
- rules. Match rules describe the messages that should be sent to a
- client, based on the contents of the message. Broadcast signals
- are only sent to clients which have a suitable match rule: this
- avoids waking up client processes to deal with signals that are
- not relevant to that client.
- </para>
- <para>
- Messages that list a client as their <literal>DESTINATION</literal>
- do not need to match the client's match rules, and are sent to that
- client regardless. As a result, match rules are mainly used to
- receive a subset of broadcast signals.
- </para>
- <para>
- Match rules can also be used for eavesdropping
- (see <xref linkend="message-bus-routing-eavesdropping"/>),
- if the security policy of the message bus allows it.
- </para>
- <para>
- Match rules are added using the AddMatch bus method
- (see <xref linkend="bus-messages-add-match"/>). Rules are
- specified as a string of comma separated key/value pairs.
- Excluding a key from the rule indicates a wildcard match.
- For instance excluding the the member from a match rule but
- adding a sender would let all messages from that sender through.
- An example of a complete rule would be
- "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='Foo',path='/bar/foo',destination=':452345.34',arg2='bar'"
- </para>
- <para>
- The following table describes the keys that can be used to create
- a match rule.
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Key</entry>
- <entry>Possible Values</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>type</literal></entry>
- <entry>'signal', 'method_call', 'method_return', 'error'</entry>
- <entry>Match on the message type. An example of a type match is type='signal'</entry>
- </row>
- <row>
- <entry><literal>sender</literal></entry>
- <entry>A bus or unique name (see <xref linkend="term-bus-name"/>
- and <xref linkend="term-unique-name"/> respectively)
- </entry>
- <entry>Match messages sent by a particular sender. An example of a sender match
- is sender='org.freedesktop.Hal'</entry>
- </row>
- <row>
- <entry><literal>interface</literal></entry>
- <entry>An interface name (see <xref linkend="message-protocol-names-interface"/>)</entry>
- <entry>Match messages sent over or to a particular interface. An example of an
- interface match is interface='org.freedesktop.Hal.Manager'.
- If a message omits the interface header, it must not match any rule
- that specifies this key.</entry>
- </row>
- <row>
- <entry><literal>member</literal></entry>
- <entry>Any valid method or signal name</entry>
- <entry>Matches messages which have the give method or signal name. An example of
- a member match is member='NameOwnerChanged'</entry>
- </row>
- <row>
- <entry><literal>path</literal></entry>
- <entry>An object path (see <xref linkend="message-protocol-marshaling-object-path"/>)</entry>
- <entry>Matches messages which are sent from or to the given object. An example of a
- path match is path='/org/freedesktop/Hal/Manager'</entry>
- </row>
- <row>
- <entry><literal>path_namespace</literal></entry>
- <entry>An object path</entry>
- <entry>
- <para>
- Matches messages which are sent from or to an
- object for which the object path is either the
- given value, or that value followed by one or
- more path components.
- </para>
-
- <para>
- For example,
- <literal>path_namespace='/com/example/foo'</literal>
- would match signals sent by
- <literal>/com/example/foo</literal>
- or by
- <literal>/com/example/foo/bar</literal>,
- but not by
- <literal>/com/example/foobar</literal>.
- </para>
-
- <para>
- Using both <literal>path</literal> and
- <literal>path_namespace</literal> in the same match
- rule is not allowed.
- </para>
-
- <para>
- <emphasis>
- This match key was added in version 0.16 of the
- D-Bus specification and implemented by the bus
- daemon in dbus 1.5.0 and later.
- </emphasis>
- </para>
- </entry>
- </row>
- <row>
- <entry><literal>destination</literal></entry>
- <entry>A unique name (see <xref linkend="term-unique-name"/>)</entry>
- <entry>Matches messages which are being sent to the given unique name. An
- example of a destination match is destination=':1.0'</entry>
- </row>
- <row>
- <entry><literal>arg[0, 1, 2, 3, ...]</literal></entry>
- <entry>Any string</entry>
- <entry>Arg matches are special and are used for further restricting the
- match based on the arguments in the body of a message. Only arguments of type
- STRING can be matched in this way. An example of an argument match
- would be arg3='Foo'. Only argument indexes from 0 to 63 should be
- accepted.</entry>
- </row>
- <row>
- <entry><literal>arg[0, 1, 2, 3, ...]path</literal></entry>
- <entry>Any string</entry>
- <entry>
- <para>Argument path matches provide a specialised form of wildcard matching for
- path-like namespaces. They can match arguments whose type is either STRING or
- OBJECT_PATH. As with normal argument matches,
- if the argument is exactly equal to the string given in the match
- rule then the rule is satisfied. Additionally, there is also a
- match when either the string given in the match rule or the
- appropriate message argument ends with '/' and is a prefix of the
- other. An example argument path match is arg0path='/aa/bb/'. This
- would match messages with first arguments of '/', '/aa/',
- '/aa/bb/', '/aa/bb/cc/' and '/aa/bb/cc'. It would not match
- messages with first arguments of '/aa/b', '/aa' or even '/aa/bb'.</para>
-
- <para>This is intended for monitoring “directories” in file system-like
- hierarchies, as used in the <citetitle>dconf</citetitle> configuration
- system. An application interested in all nodes in a particular hierarchy would
- monitor <literal>arg0path='/ca/example/foo/'</literal>. Then the service could
- emit a signal with zeroth argument <literal>"/ca/example/foo/bar"</literal> to
- represent a modification to the “bar” property, or a signal with zeroth
- argument <literal>"/ca/example/"</literal> to represent atomic modification of
- many properties within that directory, and the interested application would be
- notified in both cases.</para>
- <para>
- <emphasis>
- This match key was added in version 0.12 of the
- D-Bus specification, implemented for STRING
- arguments by the bus daemon in dbus 1.2.0 and later,
- and implemented for OBJECT_PATH arguments in dbus 1.5.0
- and later.
- </emphasis>
- </para>
- </entry>
- </row>
- <row>
- <entry><literal>arg0namespace</literal></entry>
- <entry>Like a bus name, except that the string is not
- required to contain a '.' (period)</entry>
- <entry>
- <para>Match messages whose first argument is of type STRING, and is a bus name
- or interface name within the specified namespace. This is primarily intended
- for watching name owner changes for a group of related bus names, rather than
- for a single name or all name changes.</para>
-
- <para>Because every valid interface name is also a valid
- bus name, this can also be used for messages whose
- first argument is an interface name.</para>
-
- <para>For example, the match rule
- <literal>member='NameOwnerChanged',arg0namespace='com.example.backend'</literal>
- matches name owner changes for bus names such as
- <literal>com.example.backend.foo</literal>,
- <literal>com.example.backend.foo.bar</literal>, and
- <literal>com.example.backend</literal> itself.</para>
-
- <para>See also <xref linkend='bus-messages-name-owner-changed'/>.</para>
- <para>
- <emphasis>
- This match key was added in version 0.16 of the
- D-Bus specification and implemented by the bus
- daemon in dbus 1.5.0 and later.
- </emphasis>
- </para>
- </entry>
- </row>
- <row>
- <entry><literal>eavesdrop</literal></entry>
- <entry><literal>'true'</literal>, <literal>'false'</literal></entry>
- <entry>Since D-Bus 1.5.6, match rules do not
- match messages which have a <literal>DESTINATION</literal>
- field unless the match rule specifically
- requests this
- (see <xref linkend="message-bus-routing-eavesdropping"/>)
- by specifying <literal>eavesdrop='true'</literal>
- in the match rule. <literal>eavesdrop='false'</literal>
- restores the default behaviour. Messages are
- delivered to their <literal>DESTINATION</literal>
- regardless of match rules, so this match does not
- affect normal delivery of unicast messages.
- If the message bus has a security policy which forbids
- eavesdropping, this match may still be used without error,
- but will not have any practical effect.
- In older versions of D-Bus, this match was not allowed
- in match rules, and all match rules behaved as if
- <literal>eavesdrop='true'</literal> had been used.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- </sect3>
- </sect2>
- <sect2 id="message-bus-starting-services">
- <title>Message Bus Starting Services</title>
- <para>
- The message bus can start applications on behalf of other applications.
- In CORBA terms, this would be called <firstterm>activation</firstterm>.
- An application that can be started in this way is called a
- <firstterm>service</firstterm>.
- </para>
- <para>
- With D-Bus, starting a service is normally done by name. That is,
- applications ask the message bus to start some program that will own a
- well-known name, such as <literal>com.example.TextEditor</literal>.
- This implies a contract documented along with the name
- <literal>com.example.TextEditor</literal> for which object
- the owner of that name will provide, and what interfaces those
- objects will have.
- </para>
- <para>
- To find an executable corresponding to a particular name, the bus daemon
- looks for <firstterm>service description files</firstterm>. Service
- description files define a mapping from names to executables. Different
- kinds of message bus will look for these files in different places, see
- <xref linkend="message-bus-types"/>.
- </para>
- <para>
- Service description files have the ".service" file
- extension. The message bus will only load service description files
- ending with .service; all other files will be ignored. The file format
- is similar to that of <ulink
- url="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html">desktop
- entries</ulink>. All service description files must be in UTF-8
- encoding. To ensure that there will be no name collisions, service files
- must be namespaced using the same mechanism as messages and service
- names.
- </para>
-
- <para>
- On the well-known system bus, the name of a service description file
- must be its well-known name plus <literal>.service</literal>,
- for instance
- <literal>com.example.ConfigurationDatabase.service</literal>.
- </para>
-
- <para>
- On the well-known session bus, services should follow the same
- service description file naming convention as on the system bus,
- but for backwards compatibility they are not required to do so.
- </para>
-
- <para>
- [FIXME the file format should be much better specified than "similar to
- .desktop entries" esp. since desktop entries are already
- badly-specified. ;-)]
- These sections from the specification apply to service files as well:
-
- <itemizedlist>
- <listitem><para>General syntax</para></listitem>
- <listitem><para>Comment format</para></listitem>
- </itemizedlist>
-
- Service description files must contain a
- <literal>D-BUS Service</literal> group with at least the keys
- <literal>Name</literal> (the well-known name of the service)
- and <literal>Exec</literal> (the command to be executed).
-
- <figure>
- <title>Example service description file</title>
- <programlisting>
- # Sample service description file
- [D-BUS Service]
- Name=com.example.ConfigurationDatabase
- Exec=/usr/bin/sample-configd
- </programlisting>
- </figure>
- </para>
-
- <para>
- Additionally, service description files for the well-known system
- bus on Unix must contain a <literal>User</literal> key, whose value
- is the name of a user account (e.g. <literal>root</literal>).
- The system service will be run as that user.
- </para>
-
- <para>
- When an application asks to start a service by name, the bus daemon tries to
- find a service that will own that name. It then tries to spawn the
- executable associated with it. If this fails, it will report an
- error.
- </para>
-
- <para>
- On the well-known system bus, it is not possible for two .service files
- in the same directory to offer the same service, because they are
- constrained to have names that match the service name.
- </para>
-
- <para>
- On the well-known session bus, if two .service files in the same
- directory offer the same service name, the result is undefined.
- Distributors should avoid this situation, for instance by naming
- session services' .service files according to their service name.
- </para>
-
- <para>
- If two .service files in different directories offer the same
- service name, the one in the higher-priority directory is used:
- for instance, on the system bus, .service files in
- /usr/local/share/dbus-1/system-services take precedence over those
- in /usr/share/dbus-1/system-services.
- </para>
- <para>
- The executable launched will have the environment variable
- <literal>DBUS_STARTER_ADDRESS</literal> set to the address of the
- message bus so it can connect and request the appropriate names.
- </para>
- <para>
- The executable being launched may want to know whether the message bus
- starting it is one of the well-known message buses (see <xref
- linkend="message-bus-types"/>). To facilitate this, the bus must also set
- the <literal>DBUS_STARTER_BUS_TYPE</literal> environment variable if it is one
- of the well-known buses. The currently-defined values for this variable
- are <literal>system</literal> for the systemwide message bus,
- and <literal>session</literal> for the per-login-session message
- bus. The new executable must still connect to the address given
- in <literal>DBUS_STARTER_ADDRESS</literal>, but may assume that the
- resulting connection is to the well-known bus.
- </para>
- <para>
- [FIXME there should be a timeout somewhere, either specified
- in the .service file, by the client, or just a global value
- and if the client being activated fails to connect within that
- timeout, an error should be sent back.]
- </para>
-
- <sect3 id="message-bus-starting-services-scope">
- <title>Message Bus Service Scope</title>
- <para>
- The "scope" of a service is its "per-", such as per-session,
- per-machine, per-home-directory, or per-display. The reference
- implementation doesn't yet support starting services in a different
- scope from the message bus itself. So e.g. if you start a service
- on the session bus its scope is per-session.
- </para>
- <para>
- We could add an optional scope to a bus name. For example, for
- per-(display,session pair), we could have a unique ID for each display
- generated automatically at login and set on screen 0 by executing a
- special "set display ID" binary. The ID would be stored in a
- <literal>_DBUS_DISPLAY_ID</literal> property and would be a string of
- random bytes. This ID would then be used to scope names.
- Starting/locating a service could be done by ID-name pair rather than
- only by name.
- </para>
- <para>
- Contrast this with a per-display scope. To achieve that, we would
- want a single bus spanning all sessions using a given display.
- So we might set a <literal>_DBUS_DISPLAY_BUS_ADDRESS</literal>
- property on screen 0 of the display, pointing to this bus.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-bus-types">
- <title>Well-known Message Bus Instances</title>
- <para>
- Two standard message bus instances are defined here, along with how
- to locate them and where their service files live.
- </para>
- <sect3 id="message-bus-types-login">
- <title>Login session message bus</title>
- <para>
- Each time a user logs in, a <firstterm>login session message
- bus</firstterm> may be started. All applications in the user's login
- session may interact with one another using this message bus.
- </para>
- <para>
- The address of the login session message bus is given
- in the <literal>DBUS_SESSION_BUS_ADDRESS</literal> environment
- variable. If that variable is not set, applications may
- also try to read the address from the X Window System root
- window property <literal>_DBUS_SESSION_BUS_ADDRESS</literal>.
- The root window property must have type <literal>STRING</literal>.
- The environment variable should have precedence over the
- root window property.
- </para>
- <para>The address of the login session message bus is given in the
- <literal>DBUS_SESSION_BUS_ADDRESS</literal> environment variable. If
- DBUS_SESSION_BUS_ADDRESS is not set, or if it's set to the string
- "autolaunch:", the system should use platform-specific methods of
- locating a running D-Bus session server, or starting one if a running
- instance cannot be found. Note that this mechanism is not recommended
- for attempting to determine if a daemon is running. It is inherently
- racy to attempt to make this determination, since the bus daemon may
- be started just before or just after the determination is made.
- Therefore, it is recommended that applications do not try to make this
- determination for their functionality purposes, and instead they
- should attempt to start the server.</para>
-
- <sect4 id="message-bus-types-login-x-windows">
- <title>X Windowing System</title>
- <para>
- For the X Windowing System, the application must locate the
- window owner of the selection represented by the atom formed by
- concatenating:
- <itemizedlist>
- <listitem>
- <para>the literal string "_DBUS_SESSION_BUS_SELECTION_"</para>
- </listitem>
-
- <listitem>
- <para>the current user's username</para>
- </listitem>
-
- <listitem>
- <para>the literal character '_' (underscore)</para>
- </listitem>
-
- <listitem>
- <para>the machine's ID</para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- The following properties are defined for the window that owns
- this X selection:
- <informaltable frame="all">
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- <para>Atom</para>
- </entry>
-
- <entry>
- <para>meaning</para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>_DBUS_SESSION_BUS_ADDRESS</para>
- </entry>
-
- <entry>
- <para>the actual address of the server socket</para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>_DBUS_SESSION_BUS_PID</para>
- </entry>
-
- <entry>
- <para>the PID of the server process</para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <para>
- At least the _DBUS_SESSION_BUS_ADDRESS property MUST be
- present in this window.
- </para>
-
- <para>
- If the X selection cannot be located or if reading the
- properties from the window fails, the implementation MUST conclude
- that there is no D-Bus server running and proceed to start a new
- server. (See below on concurrency issues)
- </para>
-
- <para>
- Failure to connect to the D-Bus server address thus obtained
- MUST be treated as a fatal connection error and should be reported
- to the application.
- </para>
-
- <para>
- As an alternative, an implementation MAY find the information
- in the following file located in the current user's home directory,
- in subdirectory .dbus/session-bus/:
- <itemizedlist>
- <listitem>
- <para>the machine's ID</para>
- </listitem>
-
- <listitem>
- <para>the literal character '-' (dash)</para>
- </listitem>
-
- <listitem>
- <para>the X display without the screen number, with the
- following prefixes removed, if present: ":", "localhost:"
- ."localhost.localdomain:". That is, a display of
- "localhost:10.0" produces just the number "10"</para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- The contents of this file NAME=value assignment pairs and
- lines starting with # are comments (no comments are allowed
- otherwise). The following variable names are defined:
- <informaltable
- frame="all">
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- <para>Variable</para>
- </entry>
-
- <entry>
- <para>meaning</para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>DBUS_SESSION_BUS_ADDRESS</para>
- </entry>
-
- <entry>
- <para>the actual address of the server socket</para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>DBUS_SESSION_BUS_PID</para>
- </entry>
-
- <entry>
- <para>the PID of the server process</para>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>DBUS_SESSION_BUS_WINDOWID</para>
- </entry>
-
- <entry>
- <para>the window ID</para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <para>
- At least the DBUS_SESSION_BUS_ADDRESS variable MUST be present
- in this file.
- </para>
-
- <para>
- Failure to open this file MUST be interpreted as absence of a
- running server. Therefore, the implementation MUST proceed to
- attempting to launch a new bus server if the file cannot be
- opened.
- </para>
-
- <para>
- However, success in opening this file MUST NOT lead to the
- conclusion that the server is running. Thus, a failure to connect to
- the bus address obtained by the alternative method MUST NOT be
- considered a fatal error. If the connection cannot be established,
- the implementation MUST proceed to check the X selection settings or
- to start the server on its own.
- </para>
-
- <para>
- If the implementation concludes that the D-Bus server is not
- running it MUST attempt to start a new server and it MUST also
- ensure that the daemon started as an effect of the "autolaunch"
- mechanism provides the lookup mechanisms described above, so
- subsequent calls can locate the newly started server. The
- implementation MUST also ensure that if two or more concurrent
- initiations happen, only one server remains running and all other
- initiations are able to obtain the address of this server and
- connect to it. In other words, the implementation MUST ensure that
- the X selection is not present when it attempts to set it, without
- allowing another process to set the selection between the
- verification and the setting (e.g., by using XGrabServer /
- XungrabServer).
- </para>
- </sect4>
- <sect4>
- <title></title>
- <para>
- On Unix systems, the session bus should search for .service files
- in <literal>$XDG_DATA_DIRS/dbus-1/services</literal> as defined
- by the
- <ulink url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG Base Directory Specification</ulink>.
- Implementations may also search additional locations, which
- should be searched with lower priority than anything in
- XDG_DATA_HOME, XDG_DATA_DIRS or their respective defaults;
- for example, the reference implementation also
- looks in <literal>${datadir}/dbus-1/services</literal> as
- set at compile time.
- </para>
- <para>
- As described in the XDG Base Directory Specification, software
- packages should install their session .service files to their
- configured <literal>${datadir}/dbus-1/services</literal>,
- where <literal>${datadir}</literal> is as defined by the GNU
- coding standards. System administrators or users can arrange
- for these service files to be read by setting XDG_DATA_DIRS or by
- symlinking them into the default locations.
- </para>
- </sect4>
- </sect3>
- <sect3 id="message-bus-types-system">
- <title>System message bus</title>
- <para>
- A computer may have a <firstterm>system message bus</firstterm>,
- accessible to all applications on the system. This message bus may be
- used to broadcast system events, such as adding new hardware devices,
- changes in the printer queue, and so forth.
- </para>
- <para>
- The address of the system message bus is given
- in the <literal>DBUS_SYSTEM_BUS_ADDRESS</literal> environment
- variable. If that variable is not set, applications should try
- to connect to the well-known address
- <literal>unix:path=/var/run/dbus/system_bus_socket</literal>.
- <footnote>
- <para>
- The D-Bus reference implementation actually honors the
- <literal>$(localstatedir)</literal> configure option
- for this address, on both client and server side.
- </para>
- </footnote>
- </para>
- <para>
- On Unix systems, the system bus should default to searching
- for .service files in
- <literal>/usr/local/share/dbus-1/system-services</literal>,
- <literal>/usr/share/dbus-1/system-services</literal> and
- <literal>/lib/dbus-1/system-services</literal>, with that order
- of precedence. It may also search other implementation-specific
- locations, but should not vary these locations based on environment
- variables.
- <footnote>
- <para>
- The system bus is security-sensitive and is typically executed
- by an init system with a clean environment. Its launch helper
- process is particularly security-sensitive, and specifically
- clears its own environment.
- </para>
- </footnote>
- </para>
- <para>
- Software packages should install their system .service
- files to their configured
- <literal>${datadir}/dbus-1/system-services</literal>,
- where <literal>${datadir}</literal> is as defined by the GNU
- coding standards. System administrators can arrange
- for these service files to be read by editing the system bus'
- configuration file or by symlinking them into the default
- locations.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="message-bus-messages">
- <title>Message Bus Messages</title>
- <para>
- The special message bus name <literal>org.freedesktop.DBus</literal>
- responds to a number of additional messages.
- </para>
-
- <sect3 id="bus-messages-hello">
- <title><literal>org.freedesktop.DBus.Hello</literal></title>
- <para>
- As a method:
- <programlisting>
- STRING Hello ()
- </programlisting>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique name assigned to the connection</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- Before an application is able to send messages to other applications
- it must send the <literal>org.freedesktop.DBus.Hello</literal> message
- to the message bus to obtain a unique name. If an application without
- a unique name tries to send a message to another application, or a
- message to the message bus itself that isn't the
- <literal>org.freedesktop.DBus.Hello</literal> message, it will be
- disconnected from the bus.
- </para>
- <para>
- There is no corresponding "disconnect" request; if a client wishes to
- disconnect from the bus, it simply closes the socket (or other
- communication channel).
- </para>
- </sect3>
- <sect3 id="bus-messages-list-names">
- <title><literal>org.freedesktop.DBus.ListNames</literal></title>
- <para>
- As a method:
- <programlisting>
- ARRAY of STRING ListNames ()
- </programlisting>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of STRING</entry>
- <entry>Array of strings where each string is a bus name</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- Returns a list of all currently-owned names on the bus.
- </para>
- </sect3>
- <sect3 id="bus-messages-list-activatable-names">
- <title><literal>org.freedesktop.DBus.ListActivatableNames</literal></title>
- <para>
- As a method:
- <programlisting>
- ARRAY of STRING ListActivatableNames ()
- </programlisting>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of STRING</entry>
- <entry>Array of strings where each string is a bus name</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- Returns a list of all names that can be activated on the bus.
- </para>
- </sect3>
- <sect3 id="bus-messages-name-exists">
- <title><literal>org.freedesktop.DBus.NameHasOwner</literal></title>
- <para>
- As a method:
- <programlisting>
- BOOLEAN NameHasOwner (in STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name to check</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>BOOLEAN</entry>
- <entry>Return value, true if the name exists</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- Checks if the specified name exists (currently has an owner).
- </para>
- </sect3>
-
- <sect3 id="bus-messages-name-owner-changed">
- <title><literal>org.freedesktop.DBus.NameOwnerChanged</literal></title>
- <para>
- This is a signal:
- <programlisting>
- NameOwnerChanged (STRING name, STRING old_owner, STRING new_owner)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name with a new owner</entry>
- </row>
- <row>
- <entry>1</entry>
- <entry>STRING</entry>
- <entry>Old owner or empty string if none</entry>
- </row>
- <row>
- <entry>2</entry>
- <entry>STRING</entry>
- <entry>New owner or empty string if none</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This signal indicates that the owner of a name has changed.
- It's also the signal to use to detect the appearance of
- new names on the bus.
- </para>
- </sect3>
- <sect3 id="bus-messages-name-lost">
- <title><literal>org.freedesktop.DBus.NameLost</literal></title>
- <para>
- This is a signal:
- <programlisting>
- NameLost (STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name which was lost</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This signal is sent to a specific application when it loses
- ownership of a name.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-name-acquired">
- <title><literal>org.freedesktop.DBus.NameAcquired</literal></title>
- <para>
- This is a signal:
- <programlisting>
- NameAcquired (STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name which was acquired</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- This signal is sent to a specific application when it gains
- ownership of a name.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-start-service-by-name">
- <title><literal>org.freedesktop.DBus.StartServiceByName</literal></title>
- <para>
- As a method:
- <programlisting>
- UINT32 StartServiceByName (in STRING name, in UINT32 flags)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name of the service to start</entry>
- </row>
- <row>
- <entry>1</entry>
- <entry>UINT32</entry>
- <entry>Flags (currently not used)</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>UINT32</entry>
- <entry>Return value</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Tries to launch the executable associated with a name. For more information, see <xref linkend="message-bus-starting-services"/>.
-
- </para>
- <para>
- The return value can be one of the following values:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Identifier</entry>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>DBUS_START_REPLY_SUCCESS</entry>
- <entry>1</entry>
- <entry>The service was successfully started.</entry>
- </row>
- <row>
- <entry>DBUS_START_REPLY_ALREADY_RUNNING</entry>
- <entry>2</entry>
- <entry>A connection already owns the given name.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- </sect3>
-
- <sect3 id="bus-messages-update-activation-environment">
- <title><literal>org.freedesktop.DBus.UpdateActivationEnvironment</literal></title>
- <para>
- As a method:
- <programlisting>
- UpdateActivationEnvironment (in ARRAY of DICT&lt;STRING,STRING&gt; environment)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of DICT&lt;STRING,STRING&gt;</entry>
- <entry>Environment to add or update</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Normally, session bus activated services inherit the environment of the bus daemon. This method adds to or modifies that environment when activating services.
- </para>
- <para>
- Some bus instances, such as the standard system bus, may disable access to this method for some or all callers.
- </para>
- <para>
- Note, both the environment variable names and values must be valid UTF-8. There's no way to update the activation environment with data that is invalid UTF-8.
- </para>
-
- </sect3>
-
- <sect3 id="bus-messages-get-name-owner">
- <title><literal>org.freedesktop.DBus.GetNameOwner</literal></title>
- <para>
- As a method:
- <programlisting>
- STRING GetNameOwner (in STRING name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Name to get the owner of</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Return value, a unique connection name</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Returns the unique connection name of the primary owner of the name
- given. If the requested name doesn't have an owner, returns a
- <literal>org.freedesktop.DBus.Error.NameHasNoOwner</literal> error.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-connection-unix-user">
- <title><literal>org.freedesktop.DBus.GetConnectionUnixUser</literal></title>
- <para>
- As a method:
- <programlisting>
- UINT32 GetConnectionUnixUser (in STRING bus_name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique or well-known bus name of the connection to
- query, such as <literal>:12.34</literal> or
- <literal>com.example.tea</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>UINT32</entry>
- <entry>Unix user ID</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Returns the Unix user ID of the process connected to the server. If
- unable to determine it (for instance, because the process is not on the
- same machine as the bus daemon), an error is returned.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-connection-unix-process-id">
- <title><literal>org.freedesktop.DBus.GetConnectionUnixProcessID</literal></title>
- <para>
- As a method:
- <programlisting>
- UINT32 GetConnectionUnixProcessID (in STRING bus_name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique or well-known bus name of the connection to
- query, such as <literal>:12.34</literal> or
- <literal>com.example.tea</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>UINT32</entry>
- <entry>Unix process id</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Returns the Unix process ID of the process connected to the server. If
- unable to determine it (for instance, because the process is not on the
- same machine as the bus daemon), an error is returned.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-connection-credentials">
- <title><literal>org.freedesktop.DBus.GetConnectionCredentials</literal></title>
- <para>
- As a method:
- <programlisting>
- DICT&lt;STRING,VARIANT&gt; GetConnectionCredentials (in STRING bus_name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique or well-known bus name of the connection to
- query, such as <literal>:12.34</literal> or
- <literal>com.example.tea</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>DICT&lt;STRING,VARIANT&gt;</entry>
- <entry>Credentials</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <para>
- Returns as many credentials as possible for the process connected to
- the server. If unable to determine certain credentials (for instance,
- because the process is not on the same machine as the bus daemon,
- or because this version of the bus daemon does not support a
- particular security framework), or if the values of those credentials
- cannot be represented as documented here, then those credentials
- are omitted.
- </para>
-
- <para>
- Keys in the returned dictionary not containing "." are defined
- by this specification. Bus daemon implementors supporting
- credentials frameworks not mentioned in this document should either
- contribute patches to this specification, or use keys containing
- "." and starting with a reversed domain name.
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Key</entry>
- <entry>Value type</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>UnixUserID</entry>
- <entry>UINT32</entry>
- <entry>The numeric Unix user ID, as defined by POSIX</entry>
- </row>
- <row>
- <entry>ProcessID</entry>
- <entry>UINT32</entry>
- <entry>The numeric process ID, on platforms that have
- this concept. On Unix, this is the process ID defined by
- POSIX.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-
- <para>
- This method was added in D-Bus 1.7 to reduce the round-trips
- required to list a process's credentials. In older versions, calling
- this method will fail: applications should recover by using the
- separate methods such as
- <xref linkend="bus-messages-get-connection-unix-user"/>
- instead.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-adt-audit-session-data">
- <title><literal>org.freedesktop.DBus.GetAdtAuditSessionData</literal></title>
- <para>
- As a method:
- <programlisting>
- ARRAY of BYTE GetAdtAuditSessionData (in STRING bus_name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique or well-known bus name of the connection to
- query, such as <literal>:12.34</literal> or
- <literal>com.example.tea</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of BYTE</entry>
- <entry>auditing data as returned by
- adt_export_session_data()</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Returns auditing data used by Solaris ADT, in an unspecified
- binary format. If you know what this means, please contribute
- documentation via the D-Bus bug tracking system.
- This method is on the core DBus interface for historical reasons;
- the same information should be made available via
- <xref linkend="bus-messages-get-connection-credentials"/>
- in future.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-connection-selinux-security-context">
- <title><literal>org.freedesktop.DBus.GetConnectionSELinuxSecurityContext</literal></title>
- <para>
- As a method:
- <programlisting>
- ARRAY of BYTE GetConnectionSELinuxSecurityContext (in STRING bus_name)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique or well-known bus name of the connection to
- query, such as <literal>:12.34</literal> or
- <literal>com.example.tea</literal></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>ARRAY of BYTE</entry>
- <entry>some sort of string of bytes, not necessarily UTF-8,
- not including '\0'</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Returns the security context used by SELinux, in an unspecified
- format. If you know what this means, please contribute
- documentation via the D-Bus bug tracking system.
- This method is on the core DBus interface for historical reasons;
- the same information should be made available via
- <xref linkend="bus-messages-get-connection-credentials"/>
- in future.
- </para>
- </sect3>
-
-
- <sect3 id="bus-messages-add-match">
- <title><literal>org.freedesktop.DBus.AddMatch</literal></title>
- <para>
- As a method:
- <programlisting>
- AddMatch (in STRING rule)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Match rule to add to the connection</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Adds a match rule to match messages going through the message bus (see <xref linkend='message-bus-routing-match-rules'/>).
- If the bus does not have enough resources the <literal>org.freedesktop.DBus.Error.OOM</literal>
- error is returned.
- </para>
- </sect3>
- <sect3 id="bus-messages-remove-match">
- <title><literal>org.freedesktop.DBus.RemoveMatch</literal></title>
- <para>
- As a method:
- <programlisting>
- RemoveMatch (in STRING rule)
- </programlisting>
- Message arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Match rule to remove from the connection</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Removes the first rule that matches (see <xref linkend='message-bus-routing-match-rules'/>).
- If the rule is not found the <literal>org.freedesktop.DBus.Error.MatchRuleNotFound</literal>
- error is returned.
- </para>
- </sect3>
-
- <sect3 id="bus-messages-get-id">
- <title><literal>org.freedesktop.DBus.GetId</literal></title>
- <para>
- As a method:
- <programlisting>
- GetId (out STRING id)
- </programlisting>
- Reply arguments:
- <informaltable>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Argument</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>0</entry>
- <entry>STRING</entry>
- <entry>Unique ID identifying the bus daemon</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Gets the unique ID of the bus. The unique ID here is shared among all addresses the
- bus daemon is listening on (TCP, UNIX domain socket, etc.) and its format is described in
- <xref linkend="uuids"/>. Each address the bus is listening on also has its own unique
- ID, as described in <xref linkend="addresses"/>. The per-bus and per-address IDs are not related.
- There is also a per-machine ID, described in <xref linkend="standard-interfaces-peer"/> and returned
- by org.freedesktop.DBus.Peer.GetMachineId().
- For a desktop session bus, the bus ID can be used as a way to uniquely identify a user's session.
- </para>
- </sect3>
-
- </sect2>
-
- </sect1>
-<!--
- <appendix id="implementation-notes">
- <title>Implementation notes</title>
- <sect1 id="implementation-notes-subsection">
- <title></title>
- <para>
- </para>
- </sect1>
- </appendix>
--->
-
- <glossary><title>Glossary</title>
- <para>
- This glossary defines some of the terms used in this specification.
- </para>
-
- <glossentry id="term-bus-name"><glossterm>Bus Name</glossterm>
- <glossdef>
- <para>
- The message bus maintains an association between names and
- connections. (Normally, there's one connection per application.) A
- bus name is simply an identifier used to locate connections. For
- example, the hypothetical <literal>com.yoyodyne.Screensaver</literal>
- name might be used to send a message to a screensaver from Yoyodyne
- Corporation. An application is said to <firstterm>own</firstterm> a
- name if the message bus has associated the application's connection
- with the name. Names may also have <firstterm>queued
- owners</firstterm> (see <xref linkend="term-queued-owner"/>).
- The bus assigns a unique name to each connection,
- see <xref linkend="term-unique-name"/>. Other names
- can be thought of as "well-known names" and are
- used to find applications that offer specific functionality.
- </para>
-
- <para>
- See <xref linkend="message-protocol-names-bus"/> for details of
- the syntax and naming conventions for bus names.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-message"><glossterm>Message</glossterm>
- <glossdef>
- <para>
- A message is the atomic unit of communication via the D-Bus
- protocol. It consists of a <firstterm>header</firstterm> and a
- <firstterm>body</firstterm>; the body is made up of
- <firstterm>arguments</firstterm>.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-message-bus"><glossterm>Message Bus</glossterm>
- <glossdef>
- <para>
- The message bus is a special application that forwards
- or routes messages between a group of applications
- connected to the message bus. It also manages
- <firstterm>names</firstterm> used for routing
- messages.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-name"><glossterm>Name</glossterm>
- <glossdef>
- <para>
- See <xref linkend="term-bus-name"/>. "Name" may
- also be used to refer to some of the other names
- in D-Bus, such as interface names.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="namespace"><glossterm>Namespace</glossterm>
- <glossdef>
- <para>
- Used to prevent collisions when defining new interfaces, bus names
- etc. The convention used is the same one Java uses for defining
- classes: a reversed domain name.
- See <xref linkend="message-protocol-names-bus"/>,
- <xref linkend="message-protocol-names-interface"/>,
- <xref linkend="message-protocol-names-error"/>,
- <xref linkend="message-protocol-marshaling-object-path"/>.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-object"><glossterm>Object</glossterm>
- <glossdef>
- <para>
- Each application contains <firstterm>objects</firstterm>, which have
- <firstterm>interfaces</firstterm> and
- <firstterm>methods</firstterm>. Objects are referred to by a name,
- called a <firstterm>path</firstterm>.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="one-to-one"><glossterm>One-to-One</glossterm>
- <glossdef>
- <para>
- An application talking directly to another application, without going
- through a message bus. One-to-one connections may be "peer to peer" or
- "client to server." The D-Bus protocol has no concept of client
- vs. server after a connection has authenticated; the flow of messages
- is symmetrical (full duplex).
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-path"><glossterm>Path</glossterm>
- <glossdef>
- <para>
- Object references (object names) in D-Bus are organized into a
- filesystem-style hierarchy, so each object is named by a path. As in
- LDAP, there's no difference between "files" and "directories"; a path
- can refer to an object, while still having child objects below it.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-queued-owner"><glossterm>Queued Name Owner</glossterm>
- <glossdef>
- <para>
- Each bus name has a primary owner; messages sent to the name go to the
- primary owner. However, certain names also maintain a queue of
- secondary owners "waiting in the wings." If the primary owner releases
- the name, then the first secondary owner in the queue automatically
- becomes the new owner of the name.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-service"><glossterm>Service</glossterm>
- <glossdef>
- <para>
- A service is an executable that can be launched by the bus daemon.
- Services normally guarantee some particular features, for example they
- may guarantee that they will request a specific name such as
- "com.example.Screensaver", have a singleton object
- "/com/example/Application", and that object will implement the
- interface "com.example.Screensaver.Control".
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-service-description-files"><glossterm>Service Description Files</glossterm>
- <glossdef>
- <para>
- ".service files" tell the bus about service applications that can be
- launched (see <xref linkend="term-service"/>). Most importantly they
- provide a mapping from bus names to services that will request those
- names when they start up.
- </para>
- </glossdef>
- </glossentry>
-
- <glossentry id="term-unique-name"><glossterm>Unique Connection Name</glossterm>
- <glossdef>
- <para>
- The special name automatically assigned to each connection by the
- message bus. This name will never change owner, and will be unique
- (never reused during the lifetime of the message bus).
- It will begin with a ':' character.
- </para>
- </glossdef>
- </glossentry>
-
- </glossary>
-</article>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-test-plan.xml b/src/3rd_party/dbus-1.7.8/doc/dbus-test-plan.xml
deleted file mode 100644
index ee91114918..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-test-plan.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
-[
-]>
-
-<article id="index">
- <articleinfo>
- <title>D-Bus Test Plan</title>
- <date>14 February 2003</date>
- <authorgroup>
- <author>
- <firstname>Anders</firstname>
- <surname>Carlsson</surname>
- <affiliation>
- <orgname>CodeFactory AB</orgname>
- <address><email>andersca@codefactory.se</email></address>
- </affiliation>
- </author>
- </authorgroup>
- </articleinfo>
- <sect1 id="introduction">
- <title>Introduction</title>
- <para>
- This document tries to explain the details of the test plan for D-Bus
- </para>
- <sect2 id="importance-of-testing">
- <title>The importance of testing</title>
- <para>
- As with any big library or program, testing is important. It
- can help find bugs and regressions and make the code better
- overall.
- </para>
- <para>
- D-Bus is a large and complex piece of software (about 25,000
- lines of code for the client library, and 2,500 lines of code
- for the bus daemon) and it's therefore important to try to make sure
- that all parts of the software is functioning correctly.
- </para>
- <para>
- D-Bus can be built with support for testing by passing
- <literal>--enable-tests</literal>. to the configure script. It
- is recommended that production systems build without testing
- since that reduces the D-Bus client library size.
- </para>
- </sect2>
- </sect1>
- <sect1 id="client-library">
- <title>Testing the D-Bus client library</title>
- <para>
- The tests for the client library consist of the dbus-test
- program which is a unit test for all aspects of the client
- library. Whenever a bug in the client library is found and
- fixed, a test is added to make sure that the bug won't occur again.
- </para>
- <sect2 id="data-structures">
- <title>Data Structures</title>
- <para>
- The D-Bus client library consists of some data structures that
- are used internally; a linked list class, a hashtable class and
- a string class. All aspects of those are tested by dbus-test.
- </para>
- </sect2>
- <sect2 id="message-loader">
- <title>Message loader</title>
- <para>
- The message loader is the part of D-Bus that takes messages in
- raw character form and parses them, turning them into DBusMessages.
- </para>
- <para>
- This is one of the parts of D-Bus that
- <emphasis>must</emphasis> be absolutely bug-free and
- robust. The message loader should be able to handle invalid
- and incomplete messages without crashing. Not doing so is a
- serious issue and can easily result in D-Bus being exploitable
- to DoS attacks.
- </para>
- <para>
- To solve these problems, there is a testing feature called the
- Message Builder. The message builder can take a serialized
- message in string-form and convert it into a raw character
- string which can then be loaded by the message loader.
- </para>
- <figure>
- <title>Example of a message in string form</title>
- <programlisting>
- # Standard org.freedesktop.DBus.Hello message
-
- VALID_HEADER
- FIELD_NAME name
- TYPE STRING
- STRING 'org.freedesktop.DBus.Hello'
- FIELD_NAME srvc
- TYPE STRING
- STRING 'org.freedesktop.DBus'
- ALIGN 8
- END_LENGTH Header
- START_LENGTH Body
- END_LENGTH Body
- </programlisting>
- </figure>
- <para>
- The file format of messages in string form is documented in
- the D-Bus Reference Manual.
- </para>
- <para>
- The message test part of dbus-test is using the message
- builder to build different kinds of messages, both valid,
- invalid, and invalid ones, to make sure that the loader won't
- crash or leak memory of any of those, and that the loader
- knows if a message is valid or not.
- </para>
- <para>
- There is also a test program called
- <literal>break-loader</literal> that loads a message in
- string-form into raw character form using the message
- builder. It then randomly changes the message, it can for
- example replace single bytes of data or modify the length of
- the message. This is to simulate network errors. The
- break-loader program saves all the messages leading to errors
- so it can easily be run for a long period of time.
- </para>
- </sect2>
- <sect2 id="authentication">
- <title>Authentication</title>
- <para>
- For testing authentication, there is a testing feature that
- can read authentication sequences from a file and play them
- back to a dummy server and client to make sure that
- authentication is working according to the specification.
- </para>
- <figure>
- <title>Example of an authentication script</title>
- <programlisting>
- ## this tests a successful auth of type EXTERNAL
-
- SERVER
- SEND 'AUTH EXTERNAL USERNAME_HEX'
- EXPECT_COMMAND OK
- EXPECT_STATE WAITING_FOR_INPUT
- SEND 'BEGIN'
- EXPECT_STATE AUTHENTICATED
- </programlisting>
- </figure>
- </sect2>
- </sect1>
- <sect1 id="daemon">
- <title>Testing the D-Bus bus daemon</title>
- <para>
- Since the D-Bus bus daemon is using the D-Bus client library it
- will benefit from all tests done on the client library, but
- there is still the issue of testing client-server communication.
- This is more complicated since it it may require another process
- running.
- </para>
- <sect2 id="debug-transport">
- <title>The debug transport</title>
- <para>
- In D-Bus, a <emphasis>transport</emphasis> is a class that
- handles sending and receiving raw data over a certain
- medium. The transport that is used most in D-Bus is the UNIX
- transport with sends and recevies data over a UNIX socket. A
- transport that tunnels data through X11 client messages is
- also under development.
- </para>
- <para>
- The D-Bus debug transport is a specialized transport that
- works in-process. This means that a client and server that
- exists in the same process can talk to eachother without using
- a socket.
- </para>
- </sect2>
- <sect2 id="bus-test">
- <title>The bus-test program</title>
- <para>
- The bus-test program is a program that is used to test various
- parts of the D-Bus bus daemon; robustness and that it conforms
- to the specifications.
- </para>
- <para>
- The test program has the necessary code from the bus daemon
- linked in, and it uses the debug transport for
- communication. This means that the bus daemon code can be
- tested without the real bus actually running, which makes
- testing easier.
- </para>
- <para>
- The bus-test program should test all major features of the
- bus, such as service registration, notification when things
- occurs and message matching.
- </para>
- </sect2>
- </sect1>
- <sect1 id="other-tests">
- <title>Other tests</title>
-
- <sect2 id="oom-robustness">
- <title>Out-Of-Memory robustness</title>
- <para>
- Since D-Bus should be able to be used in embedded devices, and
- also as a system service, it should be able to cope with
- low-memory situations without exiting or crashing.
- </para>
- <para>
- In practice, this means that both the client and server code
- must be able to handle dbus_malloc returning NULL.
- </para>
- <para>
- To test this, two environment variables
- exist. <literal>DBUS_MALLOC_FAIL_NTH</literal> will make every
- nth call to dbus_malloc return NULL, and
- <literal>DBUS_MALLOC_FAIL_GREATER_THAN</literal> will make any
- dbus_malloc call with a request for more than the specified
- number of bytes fail.
- </para>
- </sect2>
-
- <sect2 id="leaks-and-other-stuff">
- <title>Memory leaks and code robustness</title>
- <para>
- Naturally there are some things that tests can't be written
- for, for example things like memory leaks and out-of-bounds
- memory reading or writing.
- </para>
- <para>
- Luckily there exists good tools for catching such errors. One
- free good tool is <ulink url="http://devel-home.kde.org/~sewardj/">Valgrind</ulink>, which runs the program in a
- virtual CPU which makes catching errors easy. All test programs can be run under Valgrind,
- </para>
- </sect2>
- </sect1>
-</article>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-tutorial.xml b/src/3rd_party/dbus-1.7.8/doc/dbus-tutorial.xml
deleted file mode 100644
index c7580d155b..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-tutorial.xml
+++ /dev/null
@@ -1,1667 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
-[
-]>
-
-<article id="index">
- <articleinfo>
- <title>D-Bus Tutorial</title>
- <releaseinfo>Version 0.5.0</releaseinfo>
- <date>20 August 2006</date>
- <authorgroup>
- <author>
- <firstname>Havoc</firstname>
- <surname>Pennington</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address><email>hp@pobox.com</email></address>
- </affiliation>
- </author>
- <author>
- <firstname>David</firstname>
- <surname>Wheeler</surname>
- </author>
- <author>
- <firstname>John</firstname>
- <surname>Palmieri</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address><email>johnp@redhat.com</email></address>
- </affiliation>
- </author>
- <author>
- <firstname>Colin</firstname>
- <surname>Walters</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address><email>walters@redhat.com</email></address>
- </affiliation>
- </author>
- </authorgroup>
- </articleinfo>
-
- <sect1 id="meta">
- <title>Tutorial Work In Progress</title>
-
- <para>
- This tutorial is not complete; it probably contains some useful information, but
- also has plenty of gaps. Right now, you'll also need to refer to the D-Bus specification,
- Doxygen reference documentation, and look at some examples of how other apps use D-Bus.
- </para>
-
- <para>
- Enhancing the tutorial is definitely encouraged - send your patches or suggestions to the
- mailing list. If you create a D-Bus binding, please add a section to the tutorial for your
- binding, if only a short section with a couple of examples.
- </para>
-
- </sect1>
-
- <sect1 id="whatis">
- <title>What is D-Bus?</title>
- <para>
- D-Bus is a system for <firstterm>interprocess communication</firstterm>
- (IPC). Architecturally, it has several layers:
-
- <itemizedlist>
- <listitem>
- <para>
- A library, <firstterm>libdbus</firstterm>, that allows two
- applications to connect to each other and exchange messages.
- </para>
- </listitem>
- <listitem>
- <para>
- A <firstterm>message bus daemon</firstterm> executable, built on
- libdbus, that multiple applications can connect to. The daemon can
- route messages from one application to zero or more other
- applications.
- </para>
- </listitem>
- <listitem>
- <para>
- <firstterm>Wrapper libraries</firstterm> or <firstterm>bindings</firstterm>
- based on particular application frameworks. For example, libdbus-glib and
- libdbus-qt. There are also bindings to languages such as
- Python. These wrapper libraries are the API most people should use,
- as they simplify the details of D-Bus programming. libdbus is
- intended to be a low-level backend for the higher level bindings.
- Much of the libdbus API is only useful for binding implementation.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- libdbus only supports one-to-one connections, just like a raw network
- socket. However, rather than sending byte streams over the connection, you
- send <firstterm>messages</firstterm>. Messages have a header identifying
- the kind of message, and a body containing a data payload. libdbus also
- abstracts the exact transport used (sockets vs. whatever else), and
- handles details such as authentication.
- </para>
-
- <para>
- The message bus daemon forms the hub of a wheel. Each spoke of the wheel
- is a one-to-one connection to an application using libdbus. An
- application sends a message to the bus daemon over its spoke, and the bus
- daemon forwards the message to other connected applications as
- appropriate. Think of the daemon as a router.
- </para>
-
- <para>
- The bus daemon has multiple instances on a typical computer. The
- first instance is a machine-global singleton, that is, a system daemon
- similar to sendmail or Apache. This instance has heavy security
- restrictions on what messages it will accept, and is used for systemwide
- communication. The other instances are created one per user login session.
- These instances allow applications in the user's session to communicate
- with one another.
- </para>
-
- <para>
- The systemwide and per-user daemons are separate. Normal within-session
- IPC does not involve the systemwide message bus process and vice versa.
- </para>
-
- <sect2 id="uses">
- <title>D-Bus applications</title>
- <para>
- There are many, many technologies in the world that have "Inter-process
- communication" or "networking" in their stated purpose: <ulink
- url="http://www.omg.org">CORBA</ulink>, <ulink
- url="http://www.opengroup.org/dce/">DCE</ulink>, <ulink
- url="http://www.microsoft.com/com/">DCOM</ulink>, <ulink
- url="http://developer.kde.org/documentation/library/kdeqt/dcop.html">DCOP</ulink>, <ulink
- url="http://www.xmlrpc.com">XML-RPC</ulink>, <ulink
- url="http://www.w3.org/TR/SOAP/">SOAP</ulink>, <ulink
- url="http://www.mbus.org/">MBUS</ulink>, <ulink
- url="http://www.zeroc.com/ice.html">Internet Communications Engine (ICE)</ulink>,
- and probably hundreds more.
- Each of these is tailored for particular kinds of application.
- D-Bus is designed for two specific cases:
- <itemizedlist>
- <listitem>
- <para>
- Communication between desktop applications in the same desktop
- session; to allow integration of the desktop session as a whole,
- and address issues of process lifecycle (when do desktop components
- start and stop running).
- </para>
- </listitem>
- <listitem>
- <para>
- Communication between the desktop session and the operating system,
- where the operating system would typically include the kernel
- and any system daemons or processes.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- For the within-desktop-session use case, the GNOME and KDE desktops
- have significant previous experience with different IPC solutions
- such as CORBA and DCOP. D-Bus is built on that experience and
- carefully tailored to meet the needs of these desktop projects
- in particular. D-Bus may or may not be appropriate for other
- applications; the FAQ has some comparisons to other IPC systems.
- </para>
- <para>
- The problem solved by the systemwide or communication-with-the-OS case
- is explained well by the following text from the Linux Hotplug project:
- <blockquote>
- <para>
- A gap in current Linux support is that policies with any sort of
- dynamic "interact with user" component aren't currently
- supported. For example, that's often needed the first time a network
- adapter or printer is connected, and to determine appropriate places
- to mount disk drives. It would seem that such actions could be
- supported for any case where a responsible human can be identified:
- single user workstations, or any system which is remotely
- administered.
- </para>
-
- <para>
- This is a classic "remote sysadmin" problem, where in this case
- hotplugging needs to deliver an event from one security domain
- (operating system kernel, in this case) to another (desktop for
- logged-in user, or remote sysadmin). Any effective response must go
- the other way: the remote domain taking some action that lets the
- kernel expose the desired device capabilities. (The action can often
- be taken asynchronously, for example letting new hardware be idle
- until a meeting finishes.) At this writing, Linux doesn't have
- widely adopted solutions to such problems. However, the new D-Bus
- work may begin to solve that problem.
- </para>
- </blockquote>
- </para>
- <para>
- D-Bus may happen to be useful for purposes other than the one it was
- designed for. Its general properties that distinguish it from
- other forms of IPC are:
- <itemizedlist>
- <listitem>
- <para>
- Binary protocol designed to be used asynchronously
- (similar in spirit to the X Window System protocol).
- </para>
- </listitem>
- <listitem>
- <para>
- Stateful, reliable connections held open over time.
- </para>
- </listitem>
- <listitem>
- <para>
- The message bus is a daemon, not a "swarm" or
- distributed architecture.
- </para>
- </listitem>
- <listitem>
- <para>
- Many implementation and deployment issues are specified rather
- than left ambiguous/configurable/pluggable.
- </para>
- </listitem>
- <listitem>
- <para>
- Semantics are similar to the existing DCOP system, allowing
- KDE to adopt it more easily.
- </para>
- </listitem>
- <listitem>
- <para>
- Security features to support the systemwide mode of the
- message bus.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- </sect1>
- <sect1 id="concepts">
- <title>Concepts</title>
- <para>
- Some basic concepts apply no matter what application framework you're
- using to write a D-Bus application. The exact code you write will be
- different for GLib vs. Qt vs. Python applications, however.
- </para>
-
- <para>
- Here is a diagram (<ulink url="diagram.png">png</ulink> <ulink
- url="diagram.svg">svg</ulink>) that may help you visualize the concepts
- that follow.
- </para>
-
- <sect2 id="objects">
- <title>Native Objects and Object Paths</title>
- <para>
- Your programming framework probably defines what an "object" is like;
- usually with a base class. For example: java.lang.Object, GObject, QObject,
- python's base Object, or whatever. Let's call this a <firstterm>native object</firstterm>.
- </para>
- <para>
- The low-level D-Bus protocol, and corresponding libdbus API, does not care about native objects.
- However, it provides a concept called an
- <firstterm>object path</firstterm>. The idea of an object path is that
- higher-level bindings can name native object instances, and allow remote applications
- to refer to them.
- </para>
- <para>
- The object path
- looks like a filesystem path, for example an object could be
- named <literal>/org/kde/kspread/sheets/3/cells/4/5</literal>.
- Human-readable paths are nice, but you are free to create an
- object named <literal>/com/mycompany/c5yo817y0c1y1c5b</literal>
- if it makes sense for your application.
- </para>
- <para>
- Namespacing object paths is smart, by starting them with the components
- of a domain name you own (e.g. <literal>/org/kde</literal>). This
- keeps different code modules in the same process from stepping
- on one another's toes.
- </para>
- </sect2>
-
- <sect2 id="members">
- <title>Methods and Signals</title>
-
- <para>
- Each object has <firstterm>members</firstterm>; the two kinds of member
- are <firstterm>methods</firstterm> and
- <firstterm>signals</firstterm>. Methods are operations that can be
- invoked on an object, with optional input (aka arguments or "in
- parameters") and output (aka return values or "out parameters").
- Signals are broadcasts from the object to any interested observers
- of the object; signals may contain a data payload.
- </para>
-
- <para>
- Both methods and signals are referred to by name, such as
- "Frobate" or "OnClicked".
- </para>
-
- </sect2>
-
- <sect2 id="interfaces">
- <title>Interfaces</title>
- <para>
- Each object supports one or more <firstterm>interfaces</firstterm>.
- Think of an interface as a named group of methods and signals,
- just as it is in GLib or Qt or Java. Interfaces define the
- <emphasis>type</emphasis> of an object instance.
- </para>
- <para>
- DBus identifies interfaces with a simple namespaced string,
- something like <literal>org.freedesktop.Introspectable</literal>.
- Most bindings will map these interface names directly to
- the appropriate programming language construct, for example
- to Java interfaces or C++ pure virtual classes.
- </para>
- </sect2>
-
- <sect2 id="proxies">
- <title>Proxies</title>
- <para>
- A <firstterm>proxy object</firstterm> is a convenient native object created to
- represent a remote object in another process. The low-level DBus API involves manually creating
- a method call message, sending it, then manually receiving and processing
- the method reply message. Higher-level bindings provide proxies as an alternative.
- Proxies look like a normal native object; but when you invoke a method on the proxy
- object, the binding converts it into a DBus method call message, waits for the reply
- message, unpacks the return value, and returns it from the native method..
- </para>
- <para>
- In pseudocode, programming without proxies might look like this:
- <programlisting>
- Message message = new Message("/remote/object/path", "MethodName", arg1, arg2);
- Connection connection = getBusConnection();
- connection.send(message);
- Message reply = connection.waitForReply(message);
- if (reply.isError()) {
-
- } else {
- Object returnValue = reply.getReturnValue();
- }
- </programlisting>
- </para>
- <para>
- Programming with proxies might look like this:
- <programlisting>
- Proxy proxy = new Proxy(getBusConnection(), "/remote/object/path");
- Object returnValue = proxy.MethodName(arg1, arg2);
- </programlisting>
- </para>
- </sect2>
-
- <sect2 id="bus-names">
- <title>Bus Names</title>
-
- <para>
- When each application connects to the bus daemon, the daemon immediately
- assigns it a name, called the <firstterm>unique connection name</firstterm>.
- A unique name begins with a ':' (colon) character. These names are never
- reused during the lifetime of the bus daemon - that is, you know
- a given name will always refer to the same application.
- An example of a unique name might be
- <literal>:34-907</literal>. The numbers after the colon have
- no meaning other than their uniqueness.
- </para>
-
- <para>
- When a name is mapped
- to a particular application's connection, that application is said to
- <firstterm>own</firstterm> that name.
- </para>
-
- <para>
- Applications may ask to own additional <firstterm>well-known
- names</firstterm>. For example, you could write a specification to
- define a name called <literal>com.mycompany.TextEditor</literal>.
- Your definition could specify that to own this name, an application
- should have an object at the path
- <literal>/com/mycompany/TextFileManager</literal> supporting the
- interface <literal>org.freedesktop.FileHandler</literal>.
- </para>
-
- <para>
- Applications could then send messages to this bus name,
- object, and interface to execute method calls.
- </para>
-
- <para>
- You could think of the unique names as IP addresses, and the
- well-known names as domain names. So
- <literal>com.mycompany.TextEditor</literal> might map to something like
- <literal>:34-907</literal> just as <literal>mycompany.com</literal> maps
- to something like <literal>192.168.0.5</literal>.
- </para>
-
- <para>
- Names have a second important use, other than routing messages. They
- are used to track lifecycle. When an application exits (or crashes), its
- connection to the message bus will be closed by the operating system
- kernel. The message bus then sends out notification messages telling
- remaining applications that the application's names have lost their
- owner. By tracking these notifications, your application can reliably
- monitor the lifetime of other applications.
- </para>
-
- <para>
- Bus names can also be used to coordinate single-instance applications.
- If you want to be sure only one
- <literal>com.mycompany.TextEditor</literal> application is running for
- example, have the text editor application exit if the bus name already
- has an owner.
- </para>
-
- </sect2>
-
- <sect2 id="addresses">
- <title>Addresses</title>
-
- <para>
- Applications using D-Bus are either servers or clients. A server
- listens for incoming connections; a client connects to a server. Once
- the connection is established, it is a symmetric flow of messages; the
- client-server distinction only matters when setting up the
- connection.
- </para>
-
- <para>
- If you're using the bus daemon, as you probably are, your application
- will be a client of the bus daemon. That is, the bus daemon listens
- for connections and your application initiates a connection to the bus
- daemon.
- </para>
-
- <para>
- A D-Bus <firstterm>address</firstterm> specifies where a server will
- listen, and where a client will connect. For example, the address
- <literal>unix:path=/tmp/abcdef</literal> specifies that the server will
- listen on a UNIX domain socket at the path
- <literal>/tmp/abcdef</literal> and the client will connect to that
- socket. An address can also specify TCP/IP sockets, or any other
- transport defined in future iterations of the D-Bus specification.
- </para>
-
- <para>
- When using D-Bus with a message bus daemon,
- libdbus automatically discovers the address of the per-session bus
- daemon by reading an environment variable. It discovers the
- systemwide bus daemon by checking a well-known UNIX domain socket path
- (though you can override this address with an environment variable).
- </para>
-
- <para>
- If you're using D-Bus without a bus daemon, it's up to you to
- define which application will be the server and which will be
- the client, and specify a mechanism for them to agree on
- the server's address. This is an unusual case.
- </para>
-
- </sect2>
-
- <sect2 id="bigpicture">
- <title>Big Conceptual Picture</title>
-
- <para>
- Pulling all these concepts together, to specify a particular
- method call on a particular object instance, a number of
- nested components have to be named:
- <programlisting>
- Address -&gt; [Bus Name] -&gt; Path -&gt; Interface -&gt; Method
- </programlisting>
- The bus name is in brackets to indicate that it's optional -- you only
- provide a name to route the method call to the right application
- when using the bus daemon. If you have a direct connection to another
- application, bus names aren't used; there's no bus daemon.
- </para>
-
- <para>
- The interface is also optional, primarily for historical
- reasons; DCOP does not require specifying the interface,
- instead simply forbidding duplicate method names
- on the same object instance. D-Bus will thus let you
- omit the interface, but if your method name is ambiguous
- it is undefined which method will be invoked.
- </para>
-
- </sect2>
-
- <sect2 id="messages">
- <title>Messages - Behind the Scenes</title>
- <para>
- D-Bus works by sending messages between processes. If you're using
- a sufficiently high-level binding, you may never work with messages directly.
- </para>
- <para>
- There are 4 message types:
- <itemizedlist>
- <listitem>
- <para>
- Method call messages ask to invoke a method
- on an object.
- </para>
- </listitem>
- <listitem>
- <para>
- Method return messages return the results
- of invoking a method.
- </para>
- </listitem>
- <listitem>
- <para>
- Error messages return an exception caused by
- invoking a method.
- </para>
- </listitem>
- <listitem>
- <para>
- Signal messages are notifications that a given signal
- has been emitted (that an event has occurred).
- You could also think of these as "event" messages.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- A method call maps very simply to messages: you send a method call
- message, and receive either a method return message or an error message
- in reply.
- </para>
- <para>
- Each message has a <firstterm>header</firstterm>, including <firstterm>fields</firstterm>,
- and a <firstterm>body</firstterm>, including <firstterm>arguments</firstterm>. You can think
- of the header as the routing information for the message, and the body as the payload.
- Header fields might include the sender bus name, destination bus name, method or signal name,
- and so forth. One of the header fields is a <firstterm>type signature</firstterm> describing the
- values found in the body. For example, the letter "i" means "32-bit integer" so the signature
- "ii" means the payload has two 32-bit integers.
- </para>
- </sect2>
-
- <sect2 id="callprocedure">
- <title>Calling a Method - Behind the Scenes</title>
-
- <para>
- A method call in DBus consists of two messages; a method call message sent from process A to process B,
- and a matching method reply message sent from process B to process A. Both the call and the reply messages
- are routed through the bus daemon. The caller includes a different serial number in each call message, and the
- reply message includes this number to allow the caller to match replies to calls.
- </para>
-
- <para>
- The call message will contain any arguments to the method.
- The reply message may indicate an error, or may contain data returned by the method.
- </para>
-
- <para>
- A method invocation in DBus happens as follows:
- <itemizedlist>
- <listitem>
- <para>
- The language binding may provide a proxy, such that invoking a method on
- an in-process object invokes a method on a remote object in another process. If so, the
- application calls a method on the proxy, and the proxy
- constructs a method call message to send to the remote process.
- </para>
- </listitem>
- <listitem>
- <para>
- For more low-level APIs, the application may construct a method call message itself, without
- using a proxy.
- </para>
- </listitem>
- <listitem>
- <para>
- In either case, the method call message contains: a bus name belonging to the remote process; the name of the method;
- the arguments to the method; an object path inside the remote process; and optionally the name of the
- interface that specifies the method.
- </para>
- </listitem>
- <listitem>
- <para>
- The method call message is sent to the bus daemon.
- </para>
- </listitem>
- <listitem>
- <para>
- The bus daemon looks at the destination bus name. If a process owns that name,
- the bus daemon forwards the method call to that process. Otherwise, the bus daemon
- creates an error message and sends it back as the reply to the method call message.
- </para>
- </listitem>
- <listitem>
- <para>
- The receiving process unpacks the method call message. In a simple low-level API situation, it
- may immediately run the method and send a method reply message to the bus daemon.
- When using a high-level binding API, the binding might examine the object path, interface,
- and method name, and convert the method call message into an invocation of a method on
- a native object (GObject, java.lang.Object, QObject, etc.), then convert the return
- value from the native method into a method reply message.
- </para>
- </listitem>
- <listitem>
- <para>
- The bus daemon receives the method reply message and sends it to the process that
- made the method call.
- </para>
- </listitem>
- <listitem>
- <para>
- The process that made the method call looks at the method reply and makes use of any
- return values included in the reply. The reply may also indicate that an error occurred.
- When using a binding, the method reply message may be converted into the return value of
- of a proxy method, or into an exception.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- The bus daemon never reorders messages. That is, if you send two method call messages to the same recipient,
- they will be received in the order they were sent. The recipient is not required to reply to the calls
- in order, however; for example, it may process each method call in a separate thread, and return reply messages
- in an undefined order depending on when the threads complete. Method calls have a unique serial
- number used by the method caller to match reply messages to call messages.
- </para>
-
- </sect2>
-
- <sect2 id="signalprocedure">
- <title>Emitting a Signal - Behind the Scenes</title>
-
- <para>
- A signal in DBus consists of a single message, sent by one process to any number of other processes.
- That is, a signal is a unidirectional broadcast. The signal may contain arguments (a data payload), but
- because it is a broadcast, it never has a "return value." Contrast this with a method call
- (see <xref linkend="callprocedure"/>) where the method call message has a matching method reply message.
- </para>
-
- <para>
- The emitter (aka sender) of a signal has no knowledge of the signal recipients. Recipients register
- with the bus daemon to receive signals based on "match rules" - these rules would typically include the sender and
- the signal name. The bus daemon sends each signal only to recipients who have expressed interest in that
- signal.
- </para>
-
- <para>
- A signal in DBus happens as follows:
- <itemizedlist>
- <listitem>
- <para>
- A signal message is created and sent to the bus daemon. When using the low-level API this may be
- done manually, with certain bindings it may be done for you by the binding when a native object
- emits a native signal or event.
- </para>
- </listitem>
- <listitem>
- <para>
- The signal message contains the name of the interface that specifies the signal;
- the name of the signal; the bus name of the process sending the signal; and
- any arguments
- </para>
- </listitem>
- <listitem>
- <para>
- Any process on the message bus can register "match rules" indicating which signals it
- is interested in. The bus has a list of registered match rules.
- </para>
- </listitem>
- <listitem>
- <para>
- The bus daemon examines the signal and determines which processes are interested in it.
- It sends the signal message to these processes.
- </para>
- </listitem>
- <listitem>
- <para>
- Each process receiving the signal decides what to do with it; if using a binding,
- the binding may choose to emit a native signal on a proxy object. If using the
- low-level API, the process may just look at the signal sender and name and decide
- what to do based on that.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- </sect2>
-
- <sect2 id="introspection">
- <title>Introspection</title>
-
- <para>
- D-Bus objects may support the interface <literal>org.freedesktop.DBus.Introspectable</literal>.
- This interface has one method <literal>Introspect</literal> which takes no arguments and returns
- an XML string. The XML string describes the interfaces, methods, and signals of the object.
- See the D-Bus specification for more details on this introspection format.
- </para>
-
- </sect2>
-
- </sect1>
-
- <sect1 id="glib-client">
- <title>GLib API: Using Remote Objects</title>
-
- <para>
- The GLib binding is defined in the header file
- <literal>&lt;dbus/dbus-glib.h&gt;</literal>.
- </para>
-
- <sect2 id="glib-typemappings">
- <title>D-Bus - GLib type mappings</title>
- <para>
- The heart of the GLib bindings for D-Bus is the mapping it
- provides between D-Bus "type signatures" and GLib types
- (<literal>GType</literal>). The D-Bus type system is composed of
- a number of "basic" types, along with several "container" types.
- </para>
- <sect3 id="glib-basic-typemappings">
- <title>Basic type mappings</title>
- <para>
- Below is a list of the basic types, along with their associated
- mapping to a <literal>GType</literal>.
- <informaltable>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>D-Bus basic type</entry>
- <entry>GType</entry>
- <entry>Free function</entry>
- <entry>Notes</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>BYTE</literal></entry>
- <entry><literal>G_TYPE_UCHAR</literal></entry>
- <entry></entry>
- <entry></entry>
- </row><row>
- <entry><literal>BOOLEAN</literal></entry>
- <entry><literal>G_TYPE_BOOLEAN</literal></entry>
- <entry></entry>
- <entry></entry>
- </row><row>
- <entry><literal>INT16</literal></entry>
- <entry><literal>G_TYPE_INT</literal></entry>
- <entry></entry>
- <entry>Will be changed to a <literal>G_TYPE_INT16</literal> once GLib has it</entry>
- </row><row>
- <entry><literal>UINT16</literal></entry>
- <entry><literal>G_TYPE_UINT</literal></entry>
- <entry></entry>
- <entry>Will be changed to a <literal>G_TYPE_UINT16</literal> once GLib has it</entry>
- </row><row>
- <entry><literal>INT32</literal></entry>
- <entry><literal>G_TYPE_INT</literal></entry>
- <entry></entry>
- <entry>Will be changed to a <literal>G_TYPE_INT32</literal> once GLib has it</entry>
- </row><row>
- <entry><literal>UINT32</literal></entry>
- <entry><literal>G_TYPE_UINT</literal></entry>
- <entry></entry>
- <entry>Will be changed to a <literal>G_TYPE_UINT32</literal> once GLib has it</entry>
- </row><row>
- <entry><literal>INT64</literal></entry>
- <entry><literal>G_TYPE_GINT64</literal></entry>
- <entry></entry>
- <entry></entry>
- </row><row>
- <entry><literal>UINT64</literal></entry>
- <entry><literal>G_TYPE_GUINT64</literal></entry>
- <entry></entry>
- <entry></entry>
- </row><row>
- <entry><literal>DOUBLE</literal></entry>
- <entry><literal>G_TYPE_DOUBLE</literal></entry>
- <entry></entry>
- <entry></entry>
- </row><row>
- <entry><literal>STRING</literal></entry>
- <entry><literal>G_TYPE_STRING</literal></entry>
- <entry><literal>g_free</literal></entry>
- <entry></entry>
- </row><row>
- <entry><literal>OBJECT_PATH</literal></entry>
- <entry><literal>DBUS_TYPE_G_PROXY</literal></entry>
- <entry><literal>g_object_unref</literal></entry>
- <entry>The returned proxy does not have an interface set; use <literal>dbus_g_proxy_set_interface</literal> to invoke methods</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- As you can see, the basic mapping is fairly straightforward.
- </para>
- </sect3>
- <sect3 id="glib-container-typemappings">
- <title>Container type mappings</title>
- <para>
- The D-Bus type system also has a number of "container"
- types, such as <literal>DBUS_TYPE_ARRAY</literal> and
- <literal>DBUS_TYPE_STRUCT</literal>. The D-Bus type system
- is fully recursive, so one can for example have an array of
- array of strings (i.e. type signature
- <literal>aas</literal>).
- </para>
- <para>
- However, not all of these types are in common use; for
- example, at the time of this writing the author knows of no
- one using <literal>DBUS_TYPE_STRUCT</literal>, or a
- <literal>DBUS_TYPE_ARRAY</literal> containing any non-basic
- type. The approach the GLib bindings take is pragmatic; try
- to map the most common types in the most obvious way, and
- let using less common and more complex types be less
- "natural".
- </para>
- <para>
- First, D-Bus type signatures which have an "obvious"
- corresponding built-in GLib type are mapped using that type:
- <informaltable>
- <tgroup cols="6">
- <thead>
- <row>
- <entry>D-Bus type signature</entry>
- <entry>Description</entry>
- <entry>GType</entry>
- <entry>C typedef</entry>
- <entry>Free function</entry>
- <entry>Notes</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>as</literal></entry>
- <entry>Array of strings</entry>
- <entry><literal>G_TYPE_STRV</literal></entry>
- <entry><literal>char **</literal></entry>
- <entry><literal>g_strfreev</literal></entry>
- <entry></entry>
- </row><row>
- <entry><literal>v</literal></entry>
- <entry>Generic value container</entry>
- <entry><literal>G_TYPE_VALUE</literal></entry>
- <entry><literal>GValue *</literal></entry>
- <entry><literal>g_value_unset</literal></entry>
- <entry>The calling conventions for values expect that method callers have allocated return values; see below.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- The next most common recursive type signatures are arrays of
- basic values. The most obvious mapping for arrays of basic
- types is a <literal>GArray</literal>. Now, GLib does not
- provide a builtin <literal>GType</literal> for
- <literal>GArray</literal>. However, we actually need more than
- that - we need a "parameterized" type which includes the
- contained type. Why we need this we will see below.
- </para>
- <para>
- The approach taken is to create these types in the D-Bus GLib
- bindings; however, there is nothing D-Bus specific about them.
- In the future, we hope to include such "fundamental" types in GLib
- itself.
- <informaltable>
- <tgroup cols="6">
- <thead>
- <row>
- <entry>D-Bus type signature</entry>
- <entry>Description</entry>
- <entry>GType</entry>
- <entry>C typedef</entry>
- <entry>Free function</entry>
- <entry>Notes</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>ay</literal></entry>
- <entry>Array of bytes</entry>
- <entry><literal>DBUS_TYPE_G_BYTE_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>au</literal></entry>
- <entry>Array of uint</entry>
- <entry><literal>DBUS_TYPE_G_UINT_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>ai</literal></entry>
- <entry>Array of int</entry>
- <entry><literal>DBUS_TYPE_G_INT_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>ax</literal></entry>
- <entry>Array of int64</entry>
- <entry><literal>DBUS_TYPE_G_INT64_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>at</literal></entry>
- <entry>Array of uint64</entry>
- <entry><literal>DBUS_TYPE_G_UINT64_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>ad</literal></entry>
- <entry>Array of double</entry>
- <entry><literal>DBUS_TYPE_G_DOUBLE_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>ab</literal></entry>
- <entry>Array of boolean</entry>
- <entry><literal>DBUS_TYPE_G_BOOLEAN_ARRAY</literal></entry>
- <entry><literal>GArray *</literal></entry>
- <entry>g_array_free</entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- <para>
- D-Bus also includes a special type DBUS_TYPE_DICT_ENTRY which
- is only valid in arrays. It's intended to be mapped to a "dictionary"
- type by bindings. The obvious GLib mapping here is GHashTable. Again,
- however, there is no builtin <literal>GType</literal> for a GHashTable.
- Moreover, just like for arrays, we need a parameterized type so that
- the bindings can communiate which types are contained in the hash table.
- </para>
- <para>
- At present, only strings are supported. Work is in progress to
- include more types.
- <informaltable>
- <tgroup cols="6">
- <thead>
- <row>
- <entry>D-Bus type signature</entry>
- <entry>Description</entry>
- <entry>GType</entry>
- <entry>C typedef</entry>
- <entry>Free function</entry>
- <entry>Notes</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>a{ss}</literal></entry>
- <entry>Dictionary mapping strings to strings</entry>
- <entry><literal>DBUS_TYPE_G_STRING_STRING_HASHTABLE</literal></entry>
- <entry><literal>GHashTable *</literal></entry>
- <entry>g_hash_table_destroy</entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
- </sect3>
- <sect3 id="glib-generic-typemappings">
- <title>Arbitrarily recursive type mappings</title>
- <para>
- Finally, it is possible users will want to write or invoke D-Bus
- methods which have arbitrarily complex type signatures not
- directly supported by these bindings. For this case, we have a
- <literal>DBusGValue</literal> which acts as a kind of special
- variant value which may be iterated over manually. The
- <literal>GType</literal> associated is
- <literal>DBUS_TYPE_G_VALUE</literal>.
- </para>
- <para>
- TODO insert usage of <literal>DBUS_TYPE_G_VALUE</literal> here.
- </para>
- </sect3>
- </sect2>
- <sect2 id="sample-program-1">
- <title>A sample program</title>
- <para>Here is a D-Bus program using the GLib bindings.
-<programlisting>
-int
-main (int argc, char **argv)
-{
- DBusGConnection *connection;
- GError *error;
- DBusGProxy *proxy;
- char **name_list;
- char **name_list_ptr;
-
- g_type_init ();
-
- error = NULL;
- connection = dbus_g_bus_get (DBUS_BUS_SESSION,
- &amp;error);
- if (connection == NULL)
- {
- g_printerr ("Failed to open connection to bus: %s\n",
- error-&gt;message);
- g_error_free (error);
- exit (1);
- }
-
- /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
-
- proxy = dbus_g_proxy_new_for_name (connection,
- DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS);
-
- /* Call ListNames method, wait for reply */
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "ListNames", &amp;error, G_TYPE_INVALID,
- G_TYPE_STRV, &amp;name_list, G_TYPE_INVALID))
- {
- /* Just do demonstrate remote exceptions versus regular GError */
- if (error->domain == DBUS_GERROR &amp;&amp; error->code == DBUS_GERROR_REMOTE_EXCEPTION)
- g_printerr ("Caught remote method exception %s: %s",
- dbus_g_error_get_name (error),
- error-&gt;message);
- else
- g_printerr ("Error: %s\n", error-&gt;message);
- g_error_free (error);
- exit (1);
- }
-
- /* Print the results */
-
- g_print ("Names on the message bus:\n");
-
- for (name_list_ptr = name_list; *name_list_ptr; name_list_ptr++)
- {
- g_print (" %s\n", *name_list_ptr);
- }
- g_strfreev (name_list);
-
- g_object_unref (proxy);
-
- return 0;
-}
-</programlisting>
- </para>
- </sect2>
- <sect2 id="glib-program-setup">
- <title>Program initalization</title>
- <para>
- A connection to the bus is acquired using
- <literal>dbus_g_bus_get</literal>. Next, a proxy
- is created for the object "/org/freedesktop/DBus" with
- interface <literal>org.freedesktop.DBus</literal>
- on the service <literal>org.freedesktop.DBus</literal>.
- This is a proxy for the message bus itself.
- </para>
- </sect2>
- <sect2 id="glib-method-invocation">
- <title>Understanding method invocation</title>
- <para>
- You have a number of choices for method invocation. First, as
- used above, <literal>dbus_g_proxy_call</literal> sends a
- method call to the remote object, and blocks until a reply is
- recieved. The outgoing arguments are specified in the varargs
- array, terminated with <literal>G_TYPE_INVALID</literal>.
- Next, pointers to return values are specified, followed again
- by <literal>G_TYPE_INVALID</literal>.
- </para>
- <para>
- To invoke a method asynchronously, use
- <literal>dbus_g_proxy_begin_call</literal>. This returns a
- <literal>DBusGPendingCall</literal> object; you may then set a
- notification function using
- <literal>dbus_g_pending_call_set_notify</literal>.
- </para>
- </sect2>
- <sect2 id="glib-signal-connection">
- <title>Connecting to object signals</title>
- <para>
- You may connect to signals using
- <literal>dbus_g_proxy_add_signal</literal> and
- <literal>dbus_g_proxy_connect_signal</literal>. You must
- invoke <literal>dbus_g_proxy_add_signal</literal> to specify
- the signature of your signal handlers; you may then invoke
- <literal>dbus_g_proxy_connect_signal</literal> multiple times.
- </para>
- <para>
- Note that it will often be the case that there is no builtin
- marshaller for the type signature of a remote signal. In that
- case, you must generate a marshaller yourself by using
- <application>glib-genmarshal</application>, and then register
- it using <literal>dbus_g_object_register_marshaller</literal>.
- </para>
- </sect2>
- <sect2 id="glib-error-handling">
- <title>Error handling and remote exceptions</title>
- <para>
- All of the GLib binding methods such as
- <literal>dbus_g_proxy_end_call</literal> return a
- <literal>GError</literal>. This <literal>GError</literal> can
- represent two different things:
- <itemizedlist>
- <listitem>
- <para>
- An internal D-Bus error, such as an out-of-memory
- condition, an I/O error, or a network timeout. Errors
- generated by the D-Bus library itself have the domain
- <literal>DBUS_GERROR</literal>, and a corresponding code
- such as <literal>DBUS_GERROR_NO_MEMORY</literal>. It will
- not be typical for applications to handle these errors
- specifically.
- </para>
- </listitem>
- <listitem>
- <para>
- A remote D-Bus exception, thrown by the peer, bus, or
- service. D-Bus remote exceptions have both a textual
- "name" and a "message". The GLib bindings store this
- information in the <literal>GError</literal>, but some
- special rules apply.
- </para>
- <para>
- The set error will have the domain
- <literal>DBUS_GERROR</literal> as above, and will also
- have the code
- <literal>DBUS_GERROR_REMOTE_EXCEPTION</literal>. In order
- to access the remote exception name, you must use a
- special accessor, such as
- <literal>dbus_g_error_has_name</literal> or
- <literal>dbus_g_error_get_name</literal>. The remote
- exception detailed message is accessible via the regular
- GError <literal>message</literal> member.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- <sect2 id="glib-more-examples">
- <title>More examples of method invocation</title>
- <sect3 id="glib-sending-stuff">
- <title>Sending an integer and string, receiving an array of bytes</title>
- <para>
-<programlisting>
- GArray *arr;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "Foobar", &amp;error,
- G_TYPE_INT, 42, G_TYPE_STRING, "hello",
- G_TYPE_INVALID,
- DBUS_TYPE_G_UCHAR_ARRAY, &amp;arr, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (arr != NULL);
- printf ("got back %u values", arr->len);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-sending-hash">
- <title>Sending a GHashTable</title>
- <para>
-<programlisting>
- GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal);
- guint32 ret;
-
- g_hash_table_insert (hash, "foo", "bar");
- g_hash_table_insert (hash, "baz", "whee");
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "HashSize", &amp;error,
- DBUS_TYPE_G_STRING_STRING_HASH, hash, G_TYPE_INVALID,
- G_TYPE_UINT, &amp;ret, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (ret == 2);
- g_hash_table_destroy (hash);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-receiving-bool-int">
- <title>Receiving a boolean and a string</title>
- <para>
-<programlisting>
- gboolean boolret;
- char *strret;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "GetStuff", &amp;error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &amp;boolret,
- G_TYPE_STRING, &amp;strret,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- printf ("%s %s", boolret ? "TRUE" : "FALSE", strret);
- g_free (strret);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-sending-str-arrays">
- <title>Sending two arrays of strings</title>
- <para>
-<programlisting>
- /* NULL terminate */
- char *strs_static[] = {"foo", "bar", "baz", NULL};
- /* Take pointer to array; cannot pass array directly */
- char **strs_static_p = strs_static;
- char **strs_dynamic;
-
- strs_dynamic = g_new (char *, 4);
- strs_dynamic[0] = g_strdup ("hello");
- strs_dynamic[1] = g_strdup ("world");
- strs_dynamic[2] = g_strdup ("!");
- /* NULL terminate */
- strs_dynamic[3] = NULL;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "TwoStrArrays", &amp;error,
- G_TYPE_STRV, strs_static_p,
- G_TYPE_STRV, strs_dynamic,
- G_TYPE_INVALID,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_strfreev (strs_dynamic);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-getting-str-array">
- <title>Sending a boolean, receiving an array of strings</title>
- <para>
-<programlisting>
- char **strs;
- char **strs_p;
- gboolean blah;
-
- error = NULL;
- blah = TRUE;
- if (!dbus_g_proxy_call (proxy, "GetStrs", &amp;error,
- G_TYPE_BOOLEAN, blah,
- G_TYPE_INVALID,
- G_TYPE_STRV, &amp;strs,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- for (strs_p = strs; *strs_p; strs_p++)
- printf ("got string: \"%s\"", *strs_p);
- g_strfreev (strs);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-sending-variant">
- <title>Sending a variant</title>
- <para>
-<programlisting>
- GValue val = {0, };
-
- g_value_init (&amp;val, G_TYPE_STRING);
- g_value_set_string (&amp;val, "hello world");
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "SendVariant", &amp;error,
- G_TYPE_VALUE, &amp;val, G_TYPE_INVALID,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (ret == 2);
- g_value_unset (&amp;val);
-</programlisting>
- </para>
- </sect3>
- <sect3 id="glib-receiving-variant">
- <title>Receiving a variant</title>
- <para>
-<programlisting>
- GValue val = {0, };
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "GetVariant", &amp;error, G_TYPE_INVALID,
- G_TYPE_VALUE, &amp;val, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- if (G_VALUE_TYPE (&amp;val) == G_TYPE_STRING)
- printf ("%s\n", g_value_get_string (&amp;val));
- else if (G_VALUE_TYPE (&amp;val) == G_TYPE_INT)
- printf ("%d\n", g_value_get_int (&amp;val));
- else
- ...
- g_value_unset (&amp;val);
-</programlisting>
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="glib-generated-bindings">
- <title>Generated Bindings</title>
- <para>
- By using the Introspection XML files, convenient client-side bindings
- can be automatically created to ease the use of a remote DBus object.
- </para>
- <para>
- Here is a sample XML file which describes an object that exposes
- one method, named <literal>ManyArgs</literal>.
- <programlisting>
-&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
-&lt;node name="/com/example/MyObject"&gt;
- &lt;interface name="com.example.MyObject"&gt;
- &lt;method name="ManyArgs"&gt;
- &lt;arg type="u" name="x" direction="in" /&gt;
- &lt;arg type="s" name="str" direction="in" /&gt;
- &lt;arg type="d" name="trouble" direction="in" /&gt;
- &lt;arg type="d" name="d_ret" direction="out" /&gt;
- &lt;arg type="s" name="str_ret" direction="out" /&gt;
- &lt;/method&gt;
- &lt;/interface&gt;
-&lt;/node&gt;
-</programlisting>
- </para>
- <para>
- Run <literal>dbus-binding-tool --mode=glib-client
- <replaceable>FILENAME</replaceable> &gt;
- <replaceable>HEADER_NAME</replaceable></literal> to generate the header
- file. For example: <command>dbus-binding-tool --mode=glib-client
- my-object.xml &gt; my-object-bindings.h</command>. This will generate
- inline functions with the following prototypes:
- <programlisting>
-/* This is a blocking call */
-gboolean
-com_example_MyObject_many_args (DBusGProxy *proxy, const guint IN_x,
- const char * IN_str, const gdouble IN_trouble,
- gdouble* OUT_d_ret, char ** OUT_str_ret,
- GError **error);
-
-/* This is a non-blocking call */
-DBusGProxyCall*
-com_example_MyObject_many_args_async (DBusGProxy *proxy, const guint IN_x,
- const char * IN_str, const gdouble IN_trouble,
- com_example_MyObject_many_args_reply callback,
- gpointer userdata);
-
-/* This is the typedef for the non-blocking callback */
-typedef void
-(*com_example_MyObject_many_args_reply)
-(DBusGProxy *proxy, gdouble OUT_d_ret, char * OUT_str_ret,
- GError *error, gpointer userdata);
-</programlisting>
- The first argument in all functions is a <literal>DBusGProxy
- *</literal>, which you should create with the usual
- <literal>dbus_g_proxy_new_*</literal> functions. Following that are the
- "in" arguments, and then either the "out" arguments and a
- <literal>GError *</literal> for the synchronous (blocking) function, or
- callback and user data arguments for the asynchronous (non-blocking)
- function. The callback in the asynchronous function passes the
- <literal>DBusGProxy *</literal>, the returned "out" arguments, an
- <literal>GError *</literal> which is set if there was an error otherwise
- <literal>NULL</literal>, and the user data.
- </para>
- <para>
- As with the server-side bindings support (see <xref
- linkend="glib-server"/>), the exact behaviour of the client-side
- bindings can be manipulated using "annotations". Currently the only
- annotation used by the client bindings is
- <literal>org.freedesktop.DBus.GLib.NoReply</literal>, which sets the
- flag indicating that the client isn't expecting a reply to the method
- call, so a reply shouldn't be sent. This is often used to speed up
- rapid method calls where there are no "out" arguments, and not knowing
- if the method succeeded is an acceptable compromise to half the traffic
- on the bus.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="glib-server">
- <title>GLib API: Implementing Objects</title>
- <para>
- At the moment, to expose a GObject via D-Bus, you must
- write XML by hand which describes the methods exported
- by the object. In the future, this manual step will
- be obviated by the upcoming GLib introspection support.
- </para>
- <para>
- Here is a sample XML file which describes an object that exposes
- one method, named <literal>ManyArgs</literal>.
-<programlisting>
-&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
-
-&lt;node name="/com/example/MyObject"&gt;
-
- &lt;interface name="com.example.MyObject"&gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object"/&gt;
- &lt;method name="ManyArgs"&gt;
- &lt;!-- This is optional, and in this case is redunundant --&gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object_many_args"/&gt;
- &lt;arg type="u" name="x" direction="in" /&gt;
- &lt;arg type="s" name="str" direction="in" /&gt;
- &lt;arg type="d" name="trouble" direction="in" /&gt;
- &lt;arg type="d" name="d_ret" direction="out" /&gt;
- &lt;arg type="s" name="str_ret" direction="out" /&gt;
- &lt;/method&gt;
- &lt;/interface&gt;
-&lt;/node&gt;
-</programlisting>
- </para>
- <para>
- This XML is in the same format as the D-Bus introspection XML
- format. Except we must include an "annotation" which give the C
- symbols corresponding to the object implementation prefix
- (<literal>my_object</literal>). In addition, if particular
- methods symbol names deviate from C convention
- (i.e. <literal>ManyArgs</literal> -&gt;
- <literal>many_args</literal>), you may specify an annotation
- giving the C symbol.
- </para>
- <para>
- Once you have written this XML, run <literal>dbus-binding-tool --mode=glib-server <replaceable>FILENAME</replaceable> &gt; <replaceable>HEADER_NAME</replaceable>.</literal> to
- generate a header file. For example: <command>dbus-binding-tool --mode=glib-server my-object.xml &gt; my-object-glue.h</command>.
- </para>
- <para>
- Next, include the generated header in your program, and invoke
- <literal>dbus_g_object_class_install_info</literal> in the class
- initializer, passing the object class and "object info" included in the
- header. For example:
- <programlisting>
- dbus_g_object_type_install_info (COM_FOO_TYPE_MY_OBJECT, &amp;com_foo_my_object_info);
- </programlisting>
- This should be done exactly once per object class.
- </para>
- <para>
- To actually implement the method, just define a C function named e.g.
- <literal>my_object_many_args</literal> in the same file as the info
- header is included. At the moment, it is required that this function
- conform to the following rules:
- <itemizedlist>
- <listitem>
- <para>
- The function must return a value of type <literal>gboolean</literal>;
- <literal>TRUE</literal> on success, and <literal>FALSE</literal>
- otherwise.
- </para>
- </listitem>
- <listitem>
- <para>
- The first parameter is a pointer to an instance of the object.
- </para>
- </listitem>
- <listitem>
- <para>
- Following the object instance pointer are the method
- input values.
- </para>
- </listitem>
- <listitem>
- <para>
- Following the input values are pointers to return values.
- </para>
- </listitem>
- <listitem>
- <para>
- The final parameter must be a <literal>GError **</literal>.
- If the function returns <literal>FALSE</literal> for an
- error, the error parameter must be initalized with
- <literal>g_set_error</literal>.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Finally, you can export an object using <literal>dbus_g_connection_register_g_object</literal>. For example:
- <programlisting>
- dbus_g_connection_register_g_object (connection,
- "/com/foo/MyObject",
- obj);
- </programlisting>
- </para>
-
- <sect2 id="glib-annotations">
- <title>Server-side Annotations</title>
- <para>
- There are several annotations that are used when generating the
- server-side bindings. The most common annotation is
- <literal>org.freedesktop.DBus.GLib.CSymbol</literal> but there are other
- annotations which are often useful.
- <variablelist>
- <varlistentry>
- <term><literal>org.freedesktop.DBus.GLib.CSymbol</literal></term>
- <listitem>
- <para>
- This annotation is used to specify the C symbol names for
- the various types (interface, method, etc), if it differs from the
- name DBus generates.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>org.freedesktop.DBus.GLib.Async</literal></term>
- <listitem>
- <para>
- This annotation marks the method implementation as an
- asynchronous function, which doesn't return a response straight
- away but will send the response at some later point to complete
- the call. This is used to implement non-blocking services where
- method calls can take time.
- </para>
- <para>
- When a method is asynchronous, the function prototype is
- different. It is required that the function conform to the
- following rules:
- <itemizedlist>
- <listitem>
- <para>
- The function must return a value of type <literal>gboolean</literal>;
- <literal>TRUE</literal> on success, and <literal>FALSE</literal>
- otherwise. TODO: the return value is currently ignored.
- </para>
- </listitem>
- <listitem>
- <para>
- The first parameter is a pointer to an instance of the object.
- </para>
- </listitem>
- <listitem>
- <para>
- Following the object instance pointer are the method
- input values.
- </para>
- </listitem>
- <listitem>
- <para>
- The final parameter must be a
- <literal>DBusGMethodInvocation *</literal>. This is used
- when sending the response message back to the client, by
- calling <literal>dbus_g_method_return</literal> or
- <literal>dbus_g_method_return_error</literal>.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>org.freedesktop.DBus.GLib.Const</literal></term>
- <listitem>
- <para>This attribute can only be applied to "out"
- <literal>&lt;arg&gt;</literal> nodes, and specifies that the
- parameter isn't being copied when returned. For example, this
- turns a 's' argument from a <literal>char **</literal> to a
- <literal>const char **</literal>, and results in the argument not
- being freed by DBus after the message is sent.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>org.freedesktop.DBus.GLib.ReturnVal</literal></term>
- <listitem>
- <para>
- This attribute can only be applied to "out"
- <literal>&lt;arg&gt;</literal> nodes, and alters the expected
- function signature. It currently can be set to two values:
- <literal>""</literal> or <literal>"error"</literal>. The
- argument marked with this attribute is not returned via a
- pointer argument, but by the function's return value. If the
- attribute's value is the empty string, the <literal>GError
- *</literal> argument is also omitted so there is no standard way
- to return an error value. This is very useful for interfacing
- with existing code, as it is possible to match existing APIs.
- If the attribute's value is <literal>"error"</literal>, then the
- final argument is a <literal>GError *</literal> as usual.
- </para>
- <para>
- Some examples to demonstrate the usage. This introspection XML:
- <programlisting>
-&lt;method name="Increment"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" /&gt;
-&lt;/method&gt;
- </programlisting>
- Expects the following function declaration:
- <programlisting>
-gboolean
-my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error);
- </programlisting>
- </para>
- <para>
- This introspection XML:
- <programlisting>
-&lt;method name="IncrementRetval"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" &gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/&gt;
- &lt;/arg&gt;
-&lt;/method&gt;
- </programlisting>
- Expects the following function declaration:
- <programlisting>
-gint32
-my_object_increment_retval (MyObject *obj, gint32 x)
- </programlisting>
- </para>
- <para>
- This introspection XML:
- <programlisting>
-&lt;method name="IncrementRetvalError"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" &gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/&gt;
- &lt;/arg&gt;
-&lt;/method&gt;
- </programlisting>
- Expects the following function declaration:
- <programlisting>
-gint32
-my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error)
- </programlisting>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="python-client">
- <title>Python API</title>
- <para>
- The Python API, dbus-python, is now documented separately in
- <ulink url="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html">the dbus-python tutorial</ulink> (also available in doc/tutorial.txt,
- and doc/tutorial.html if built with python-docutils, in the dbus-python
- source distribution).
- </para>
- </sect1>
-
- <sect1 id="qt-client">
- <title>Qt API: Using Remote Objects</title>
- <para>
-
- The Qt bindings are not yet documented.
-
- </para>
- </sect1>
-
- <sect1 id="qt-server">
- <title>Qt API: Implementing Objects</title>
- <para>
- The Qt bindings are not yet documented.
- </para>
- </sect1>
-</article>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dbus-uuidgen.1.xml.in b/src/3rd_party/dbus-1.7.8/doc/dbus-uuidgen.1.xml.in
deleted file mode 100644
index fbd268124a..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dbus-uuidgen.1.xml.in
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id='dbusuuidgen1'>
-
-<!-- dbus&bsol;-uuidgen manual page.
- Copyright (C) 2006 Red Hat, Inc. -->
-
-<refmeta>
-<refentrytitle>dbus-uuidgen</refentrytitle>
-<manvolnum>1</manvolnum>
-<refmiscinfo class="manual">User Commands</refmiscinfo>
-<refmiscinfo class="source">D-Bus</refmiscinfo>
-<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
-</refmeta>
-<refnamediv>
-<refname>dbus-uuidgen</refname>
-<refpurpose>Utility to generate UUIDs</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dbus-uuidgen</command> <arg choice='opt'>--version </arg>
- <arg choice='opt'><arg choice='plain'>--ensure </arg><arg choice='opt'><replaceable>=FILENAME</replaceable></arg></arg>
- <arg choice='opt'><arg choice='plain'>--get </arg><arg choice='opt'><replaceable>=FILENAME</replaceable></arg></arg>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-uuidgen</command> command generates or reads a universally unique ID.</para>
-
-
-<para>Note that the D-Bus UUID has no relationship to RFC 4122 and does not generate
-UUIDs compatible with that spec. Many systems have a separate command
-for that (often called "uuidgen").</para>
-
-
-<para>See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information
-about D-Bus.</para>
-
-
-<para>The primary usage of <command>dbus-uuidgen</command> is to run in the post-install
-script of a D-Bus package like this:</para>
-<literallayout remap='.nf'>
- dbus-uuidgen --ensure
-</literallayout> <!-- .fi -->
-
-
-<para>This will ensure that /var/lib/dbus/machine-id exists and has the uuid in it.
-It won't overwrite an existing uuid, since this id should remain fixed
-for a single machine until the next reboot at least.</para>
-
-
-<para>The important properties of the machine UUID are that 1) it remains
-unchanged until the next reboot and 2) it is different for any two
-running instances of the OS kernel. That is, if two processes see the
-same UUID, they should also see the same shared memory, UNIX domain
-sockets, local X displays, localhost.localdomain resolution, process
-IDs, and so forth.</para>
-
-
-<para>If you run <command>dbus-uuidgen</command> with no options it just prints a new uuid made
-up out of thin air.</para>
-
-
-<para>If you run it with --get, it prints the machine UUID by default, or
-the UUID in the specified file if you specify a file.</para>
-
-
-<para>If you try to change an existing machine-id on a running system, it will
-probably result in bad things happening. Don't try to change this file. Also,
-don't make it the same on two different systems; it needs to be different
-anytime there are two different kernels running.</para>
-
-
-<para>The UUID should be different on two different virtual machines,
-because there are two different kernels.</para>
-
-</refsect1>
-
-<refsect1 id='options'><title>OPTIONS</title>
-<para>The following options are supported:</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><option>--get[=FILENAME]</option></term>
- <listitem>
-<para>If a filename is not given, defaults to localstatedir/lib/dbus/machine-id
-(localstatedir is usually /var). If this file exists and is valid, the
-uuid in the file is printed on stdout. Otherwise, the command exits
-with a nonzero status.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ensure[=FILENAME]</option></term>
- <listitem>
-<para>If a filename is not given, defaults to localstatedir/lib/dbus/machine-id
-(localstatedir is usually /var). If this file exists then it will be
-validated, and a failure code returned if it contains the wrong thing.
-If the file does not exist, it will be created with a new uuid in it.
-On success, prints no output.</para>
-
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--version</option></term>
- <listitem>
-<para>Print the version of dbus-uuidgen</para>
-
- </listitem>
- </varlistentry>
-</variablelist>
-</refsect1>
-
-<refsect1 id='author'><title>AUTHOR</title>
-<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
-
-</refsect1>
-
-<refsect1 id='bugs'><title>BUGS</title>
-<para>Please send bug reports to the D-Bus mailing list or bug tracker,
-see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
-</refsect1>
-</refentry>
diff --git a/src/3rd_party/dbus-1.7.8/doc/dcop-howto.txt b/src/3rd_party/dbus-1.7.8/doc/dcop-howto.txt
deleted file mode 100644
index dfd3bcf8f4..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/dcop-howto.txt
+++ /dev/null
@@ -1,559 +0,0 @@
- DCOP: Desktop COmmunications Protocol
-
- Preston Brown <pbrown@kde.org>
- October 14, 1999
-
- Revised and extended by Matthias Ettrich <ettrich@kde.org>
- Mar 29, 2000
-
- Extended with DCOP Signals by Waldo Bastian <bastian@kde.org>
- Feb 19, 2001
-
-
-Motivation and Background:
---------------------------
-
-The motivation behind building a protocol like DCOP is simple. For
-the past year, we have been attempting to enable interprocess
-communication between KDE applications. KDE already has an extremely
-simple IPC mechanism called KWMcom, which is (was!) used for communicating
-between the panel and the window manager for instance. It is about as
-simple as it gets, passing messages via X Atoms. For this reason it
-is limited in the size and complexity of the data that can be passed
-(X atoms must be small to remain efficient) and it also makes it so
-that X is required. CORBA was thought to be a more effective IPC/RPC
-solution. However, after a year of attempting to make heavy use of
-CORBA in KDE, we have realized that it is a bit slow and memory
-intensive for simple use. It also has no authentication available.
-
-What we really needed was an extremely simple protocol with basic
-authorization, along the lines of MIT-MAGIC-COOKIE, as used by X. It
-would not be able to do NEARLY what CORBA was able to do, but for the
-simple tasks required it would be sufficient. Some examples of such
-tasks might be an application sending a message to the panel saying,
-"I have started, stop displaying the 'application starting' wait
-state," or having a new application that starts query to see if any
-other applications of the same name are running. If they are, simply
-call a function on the remote application to create a new window,
-rather than starting a new process.
-
-Implementation:
----------------
-
-DCOP is a simple IPC/RPC mechanism built to operate over sockets.
-Either unix domain sockets or tcp/ip sockets are supported. DCOP is
-built on top of the Inter Client Exchange (ICE) protocol, which comes
-standard as a part of X11R6 and later. It also depends on Qt, but
-beyond that it does not require any other libraries. Because of this,
-it is extremely lightweight, enabling it to be linked into all KDE
-applications with low overhead.
-
-Model:
-------
-
-The model is simple. Each application using DCOP is a client. They
-communicate to each other through a DCOP server, which functions like
-a traffic director, dispatching messages/calls to the proper
-destinations. All clients are peers of each other.
-
-Two types of actions are possible with DCOP: "send and forget"
-messages, which do not block, and "calls," which block waiting for
-some data to be returned.
-
-Any data that will be sent is serialized (marshalled, for you CORBA
-types) using the built-in QDataStream operators available in all of
-the Qt classes. This is fast and easy. In fact it's so little work
-that you can easily write the marshalling code by hand. In addition,
-there's a simple IDL-like compiler available (dcopidl and dcopidl2cpp)
-that generates stubs and skeletons for you. Using the dcopidl compiler
-has the additional benefit of type safety.
-
-This HOWTO describes the manual method first and covers the dcopidl
-compiler later.
-
-Establishing the Connection:
-----------------------------
-
-KApplication has gained a method called "KApplication::dcopClient()"
-which returns a pointer to a DCOPClient instance. The first time this
-method is called, the client class will be created. DCOPClients have
-unique identifiers attached to them which are based on what
-KApplication::name() returns. In fact, if there is only a single
-instance of the program running, the appId will be equal to
-KApplication::name().
-
-To actually enable DCOP communication to begin, you must use
-DCOPClient::attach(). This will attempt to attach to the DCOP server.
-If no server is found or there is any other type of error, attach()
-will return false. KApplication will catch a dcop signal and display an
-appropriate error message box in that case.
-
-After connecting with the server via DCOPClient::attach(), you need to
-register this appId with the server so it knows about you. Otherwise,
-you are communicating anonymously. Use the
-DCOPClient::registerAs(const QCString &name) to do so. In the simple
-case:
-
-/*
- * returns the appId that is actually registered, which _may_ be
- * different from what you passed
- */
-appId = client->registerAs(kApp->name());
-
-If you never retrieve the DCOPClient pointer from KApplication, the
-object will not be created and thus there will be no memory overhead.
-
-You may also detach from the server by calling DCOPClient::detach().
-If you wish to attach again you will need to re-register as well. If
-you only wish to change the ID under which you are registered, simply
-call DCOPClient::registerAs() with the new name.
-
-KUniqueApplication automatically registers itself to DCOP. If you
-are using KUniqueApplication you should not attach or register
-yourself, this is already done. The appId is by definition
-equal to kapp->name(). You can retrieve the registered DCOP client
-by calling kapp->dcopClient().
-
-Sending Data to a Remote Application:
--------------------------------------
-
-To actually communicate, you have one of two choices. You may either
-call the "send" or the "call" method. Both methods require three
-identification parameters: an application identifier, a remote object,
-a remote function. Sending is asynchronous (i.e. it returns immediately)
-and may or may not result in your own application being sent a message at
-some point in the future. Then "send" requires one and "call" requires
-two data parameters.
-
-The remote object must be specified as an object hierarchy. That is,
-if the toplevel object is called "fooObject" and has the child
-"barObject", you would reference this object as "fooObject/barObject".
-Functions must be described by a full function signature. If the
-remote function is called "doIt", and it takes an int, it would be
-described as "doIt(int)". Please note that the return type is not
-specified here, as it is not part of the function signature (or at
-least the C++ understanding of a function signature). You will get
-the return type of a function back as an extra parameter to
-DCOPClient::call(). See the section on call() for more details.
-
-In order to actually get the data to the remote client, it must be
-"serialized" via a QDataStream operating on a QByteArray. This is how
-the data parameter is "built". A few examples will make clear how this
-works.
-
-Say you want to call "doIt" as described above, and not block (or wait
-for a response). You will not receive the return value of the remotely
-called function, but you will not hang while the RPC is processed either.
-The return value of send() indicates whether DCOP communication succeeded
-or not.
-
-QByteArray data;
-QDataStream arg(data, IO_WriteOnly);
-arg << 5;
-if (!client->send("someAppId", "fooObject/barObject", "doIt(int)",
- data))
- qDebug("there was some error using DCOP.");
-
-OK, now let's say we wanted to get the data back from the remotely
-called function. You have to execute a call() instead of a send().
-The returned value will then be available in the data parameter "reply".
-The actual return value of call() is still whether or not DCOP
-communication was successful.
-
-QByteArray data, replyData;
-QCString replyType;
-QDataStream arg(data, IO_WriteOnly);
-arg << 5;
-if (!client->call("someAppId", "fooObject/barObject", "doIt(int)",
- data, replyType, replyData))
- qDebug("there was some error using DCOP.");
-else {
- QDataStream reply(replyData, IO_ReadOnly);
- if (replyType == "QString") {
- QString result;
- reply >> result;
- print("the result is: %s",result.latin1());
- } else
- qDebug("doIt returned an unexpected type of reply!");
-}
-
-N.B.: You cannot call() a method belonging to an application which has
-registered with an unique numeric id appended to its textual name (see
-dcopclient.h for more info). In this case, DCOP would not know which
-application it should connect with to call the method. This is not an issue
-with send(), as you can broadcast to all applications that have registered
-with appname-<numeric_id> by using a wildcard (e.g. 'konsole-*'), which
-will send your signal to all applications called 'konsole'.
-
-Receiving Data via DCOP:
-------------------------
-
-Currently the only real way to receive data from DCOP is to multiply
-inherit from the normal class that you are inheriting (usually some
-sort of QWidget subclass or QObject) as well as the DCOPObject class.
-DCOPObject provides one very important method: DCOPObject::process().
-This is a pure virtual method that you must implement in order to
-process DCOP messages that you receive. It takes a function
-signature, QByteArray of parameters, and a reference to a QByteArray
-for the reply data that you must fill in.
-
-Think of DCOPObject::process() as a sort of dispatch agent. In the
-future, there will probably be a precompiler for your sources to write
-this method for you. However, until that point you need to examine
-the incoming function signature and take action accordingly. Here is
-an example implementation.
-
-bool BarObject::process(const QCString &fun, const QByteArray &data,
- QCString &replyType, QByteArray &replyData)
-{
- if (fun == "doIt(int)") {
- QDataStream arg(data, IO_ReadOnly);
- int i; // parameter
- arg >> i;
- QString result = self->doIt (i);
- QDataStream reply(replyData, IO_WriteOnly);
- reply << result;
- replyType = "QString";
- return true;
- } else {
- qDebug("unknown function call to BarObject::process()");
- return false;
- }
-}
-
-Receiving Calls and processing them:
-------------------------------------
-
-If your applications is able to process incoming function calls
-right away the above code is all you need. When your application
-needs to do more complex tasks you might want to do the processing
-out of 'process' function call and send the result back later when
-it becomes available.
-
-For this you can ask your DCOPClient for a transactionId. You can
-then return from the 'process' function and when the result is
-available finish the transaction. In the mean time your application
-can receive incoming DCOP function calls from other clients.
-
-Such code could like this:
-
-bool BarObject::process(const QCString &fun, const QByteArray &data,
- QCString &, QByteArray &)
-{
- if (fun == "doIt(int)") {
- QDataStream arg(data, IO_ReadOnly);
- int i; // parameter
- arg >> i;
- QString result = self->doIt(i);
-
- DCOPClientTransaction *myTransaction;
- myTransaction = kapp->dcopClient()->beginTransaction();
-
- // start processing...
- // Calls slotProcessingDone when finished.
- startProcessing( myTransaction, i);
-
- return true;
- } else {
- qDebug("unknown function call to BarObject::process()");
- return false;
- }
-}
-
-slotProcessingDone(DCOPClientTransaction *myTransaction, const QString &result)
-{
- QCString replyType = "QString";
- QByteArray replyData;
- QDataStream reply(replyData, IO_WriteOnly);
- reply << result;
- kapp->dcopClient()->endTransaction( myTransaction, replyType, replyData );
-}
-
-DCOP Signals
-------------
-
-Sometimes a component wants to send notifications via DCOP to other
-components but does not know which components will be interested in these
-notifications. One could use a broadcast in such a case but this is a very
-crude method. For a more sophisticated method DCOP signals have been invented.
-
-DCOP signals are very similair to Qt signals, there are some differences
-though. A DCOP signal can be connected to a DCOP function. Whenever the DCOP
-signal gets emitted, the DCOP functions to which the signal is connected are
-being called. DCOP signals are, just like Qt signals, one way. They do not
-provide a return value.
-
-A DCOP signal originates from a DCOP Object/DCOP Client combination (sender).
-It can be connected to a function of another DCOP Object/DCOP Client
-combination (receiver).
-
-There are two major differences between connections of Qt signals and
-connections of DCOP signals. In DCOP, unlike Qt, a signal connections can
-have an anonymous sender and, unlike Qt, a DCOP signal connection can be
-non-volatile.
-
-With DCOP one can connect a signal without specifying the sending DCOP Object
-or DCOP Client. In that case signals from any DCOP Object and/or DCOP Client
-will be delivered. This allows the specification of certain events without
-tying oneself to a certain object that implementes the events.
-
-Another DCOP feature are so called non-volatile connections. With Qt signal
-connections, the connection gets deleted when either sender or receiver of
-the signal gets deleted. A volatile DCOP signal connection will behave the
-same. However, a non-volatile DCOP signal connection will not get deleted
-when the sending object gets deleted. Once a new object gets created with
-the same name as the original sending object, the connection will be restored.
-There is no difference between the two when the receiving object gets deleted,
-in that case the signal connection will always be deleted.
-
-A receiver can create a non-volatile connection while the sender doesn't (yet)
-exist. An anonymous DCOP connection should always be non-volatile.
-
-The following example shows how KLauncher emits a signal whenever it notices
-that an application that was started via KLauncher terminates.
-
- QByteArray params;
- QDataStream stream(params, IO_WriteOnly);
- stream << pid;
- kapp->dcopClient()->emitDCOPSignal("clientDied(pid_t)", params);
-
-The task manager of the KDE panel connects to this signal. It uses an
-anonymous connection (it doesn't require that the signal is being emitted
-by KLauncher) that is non-volatile:
-
- connectDCOPSignal(0, 0, "clientDied(pid_t)", "clientDied(pid_t)", false);
-
-It connects the clientDied(pid_t) signal to its own clientDied(pid_t) DCOP
-function. In this case the signal and the function to call have the same name.
-This isn't needed as long as the arguments of both signal and receiving function
-match. The receiving function may ignore one or more of the trailing arguments
-of the signal. E.g. it is allowed to connect the clientDied(pid_t) signal to
-a clientDied(void) DCOP function.
-
-Using the dcopidl compiler
----------------------
-
-dcopidl makes setting up a DCOP server easy. Instead of having to implement
-the process() method and unmarshalling (retrieving from QByteArray) parameters
-manually, you can let dcopidl create the necessary code on your behalf.
-
-This also allows you to describe the interface for your class in a
-single, separate header file.
-
-Writing an IDL file is very similar to writing a normal C++ header. An
-exception is the keyword 'ASYNC'. It indicates that a call to this
-function shall be processed asynchronously. For the C++ compiler, it
-expands to 'void'.
-
-Example:
-
-#ifndef MY_INTERFACE_H
-#define MY_INTERFACE_H
-
-#include <dcopobject.h>
-
-class MyInterface : virtual public DCOPObject
-{
- K_DCOP
-
- k_dcop:
-
- virtual ASYNC myAsynchronousMethod(QString someParameter) = 0;
- virtual QRect mySynchronousMethod() = 0;
-};
-
-#endif
-
-As you can see, you're essentially declaring an abstract base class, which
-virtually inherits from DCOPObject.
-
-If you're using the standard KDE build scripts, then you can simply
-add this file (which you would call MyInterface.h) to your sources
-directory. Then you edit your Makefile.am, adding 'MyInterface.skel'
-to your SOURCES list and MyInterface.h to include_HEADERS.
-
-The build scripts will use dcopidl to parse MyInterface.h, converting
-it to an XML description in MyInterface.kidl. Next, a file called
-MyInterface_skel.cpp will automatically be created, compiled and
-linked with your binary.
-
-The next thing you have to do is to choose which of your classes will
-implement the interface described in MyInterface.h. Alter the inheritance
-of this class such that it virtually inherits from MyInterface. Then
-add declarations to your class interface similar to those on MyInterface.h,
-but virtual, not pure virtual.
-
-Example:
-
-class MyClass: public QObject, virtual public MyInterface
-{
- Q_OBJECT
-
- public:
- MyClass();
- ~MyClass();
-
- ASYNC myAsynchronousMethod(QString someParameter);
- QRect mySynchronousMethod();
-};
-
-Note: (Qt issue) Remember that if you are inheriting from QObject, you must
-place it first in the list of inherited classes.
-
-In the implementation of your class' ctor, you must explicitly initialize
-those classes from which you are inheriting from. This is, of course, good
-practise, but it is essential here as you need to tell DCOPObject the name of
-the interface which your are implementing.
-
-Example:
-
-MyClass::MyClass()
- : QObject(),
- DCOPObject("MyInterface")
-{
- // whatever...
-}
-
-Now you can simply implement the methods you have declared in your interface,
-exactly the same as you would normally.
-
-Example:
-
-void MyClass::myAsynchronousMethod(QString someParameter)
-{
- qDebug("myAsyncMethod called with param `" + someParameter + "'");
-}
-
-
-It is not necessary (though very clean) to define an interface as an
-abstract class of its own, like we did in the example above. We could
-just as well have defined a k_dcop section directly within MyClass:
-
-class MyClass: public QObject, virtual public DCOPObject
-{
- Q_OBJECT
- K_DCOP
-
- public:
- MyClass();
- ~MyClass();
-
- k_dcop:
- ASYNC myAsynchronousMethod(QString someParameter);
- QRect mySynchronousMethod();
-};
-
-In addition to skeletons, dcopidl2cpp also generate stubs. Those make
-it easy to call a DCOP interface without doing the marshalling
-manually. To use a stub, add MyInterface.stub to the SOURCES list of
-your Makefile.am. The stub class will then be called MyInterface_stub.
-
-Conclusion:
------------
-
-Hopefully this document will get you well on your way into the world
-of inter-process communication with KDE! Please direct all comments
-and/or suggestions to Preston Brown <pbrown@kde.org> and Matthias
-Ettrich <ettrich@kde.org>.
-
-
-Inter-user communication
-------------------------
-
-Sometimes it might be interesting to use DCOP between processes
-belonging to different users, e.g. a frontend process running
-with the user's id, and a backend process running as root.
-
-To do this, two steps have to be taken:
-
-a) both processes need to talk to the same DCOP server
-b) the authentication must be ensured
-
-For the first step, you simply pass the server address (as
-found in .DCOPserver) to the second process. For the authentication,
-you can use the ICEAUTHORITY environment variable to tell the
-second process where to find the authentication information.
-(Note that this implies that the second process is able to
-read the authentication file, so it will probably only work
-if the second process runs as root. If it should run as another
-user, a similar approach to what kdesu does with xauth must
-be taken. In fact, it would be a very good idea to add DCOP
-support to kdesu!)
-
-For example
-
-ICEAUTHORITY=~user/.ICEauthority kdesu root -c kcmroot -dcopserver `cat ~user/.DCOPserver`
-
-will, after kdesu got the root password, execute kcmroot as root, talking
-to the user's dcop server.
-
-
-NOTE: DCOP communication is not encrypted, so please do not
-pass important information around this way.
-
-
-Performance Tests:
-------------------
-A few back-of-the-napkin tests folks:
-
-Code:
-
-#include <kapplication.h>
-
-int main(int argc, char **argv)
-{
- KApplication *app;
-
- app = new KApplication(argc, argv, "testit");
- return app->exec();
-}
-
-Compiled with:
-
-g++ -O2 -o testit testit.cpp -I$QTDIR/include -L$QTDIR/lib -lkdecore
-
-on Linux yields the following memory use statistics:
-
-VmSize: 8076 kB
-VmLck: 0 kB
-VmRSS: 4532 kB
-VmData: 208 kB
-VmStk: 20 kB
-VmExe: 4 kB
-VmLib: 6588 kB
-
-If I create the KApplication's DCOPClient, and call attach() and
-registerAs(), it changes to this:
-
-VmSize: 8080 kB
-VmLck: 0 kB
-VmRSS: 4624 kB
-VmData: 208 kB
-VmStk: 20 kB
-VmExe: 4 kB
-VmLib: 6588 kB
-
-Basically it appears that using DCOP causes 100k more memory to be
-resident, but no more data or stack. So this will be shared between all
-processes, right? 100k to enable DCOP in all apps doesn't seem bad at
-all. :)
-
-OK now for some timings. Just creating a KApplication and then exiting
-(i.e. removing the call to KApplication::exec) takes this much time:
-
-0.28user 0.02system 0:00.32elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
-0inputs+0outputs (1084major+62minor)pagefaults 0swaps
-
-I.e. about 1/3 of a second on my PII-233. Now, if we create our DCOP
-object and attach to the server, it takes this long:
-
-0.27user 0.03system 0:00.34elapsed 87%CPU (0avgtext+0avgdata 0maxresident)k
-0inputs+0outputs (1107major+65minor)pagefaults 0swaps
-
-I.e. about 1/3 of a second. Basically DCOPClient creation and attaching
-gets lost in the statistical variation ("noise"). I was getting times
-between .32 and .48 over several runs for both of the example programs, so
-obviously system load is more relevant than the extra two calls to
-DCOPClient::attach and DCOPClient::registerAs, as well as the actual
-DCOPClient constructor time.
-
diff --git a/src/3rd_party/dbus-1.7.8/doc/diagram.png b/src/3rd_party/dbus-1.7.8/doc/diagram.png
deleted file mode 100644
index 5cb84a996e..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/diagram.png
+++ /dev/null
Binary files differ
diff --git a/src/3rd_party/dbus-1.7.8/doc/diagram.svg b/src/3rd_party/dbus-1.7.8/doc/diagram.svg
deleted file mode 100644
index 193c56796a..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/diagram.svg
+++ /dev/null
@@ -1,590 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
-"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- id="svg1"
- sodipodi:version="0.32"
- inkscape:version="0.39"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- width="841.88975pt"
- height="595.27559pt"
- sodipodi:docbase="/home/hp/dbus-cvs/dbus/doc"
- sodipodi:docname="diagram.svg">
- <defs
- id="defs3">
- <marker
- style="overflow:visible;"
- id="Arrow1M"
- refX="0.0"
- refY="0.0"
- orient="auto"
- inkscape:stockid="Arrow1M">
- <path
- transform="scale(0.4)"
- style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
- d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
- id="path3519"
- sodipodi:nodetypes="ccccc" />
- </marker>
- <marker
- style="overflow:visible;"
- id="Arrow2L"
- refX="0.0"
- refY="0.0"
- orient="auto"
- inkscape:stockid="Arrow2L">
- <path
- transform="scale(1.1) translate(-5,0)"
- d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
- style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
- id="path3515"
- sodipodi:nodetypes="cccc" />
- </marker>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.90210318"
- inkscape:cx="420.94487"
- inkscape:cy="297.63779"
- inkscape:window-width="1024"
- inkscape:window-height="701"
- showgrid="false"
- inkscape:grid-bbox="false"
- inkscape:grid-points="true"
- inkscape:window-x="0"
- inkscape:window-y="24"
- gridspacingy="2.5000000mm"
- gridspacingx="2.5000000mm"
- showguides="true"
- inkscape:guide-bbox="true">
- <sodipodi:guide
- orientation="horizontal"
- position="268.85797"
- id="guide3566" />
- <sodipodi:guide
- orientation="horizontal"
- position="294.31223"
- id="guide4235" />
- <sodipodi:guide
- orientation="horizontal"
- position="300.40909"
- id="guide4882" />
- </sodipodi:namedview>
- <metadata
- id="metadata4">
- <rdf:RDF
- id="RDF5">
- <cc:Work
- rdf:about=""
- id="Work6">
- <dc:format
- id="format7">image/svg+xml</dc:format>
- <dc:type
- id="type9"
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:3.7500000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;"
- id="rect908"
- width="325.23203"
- height="354.33072"
- x="17.716536"
- y="372.04724" />
- <text
- xml:space="preserve"
- style="font-size:18.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="70.778252"
- y="712.73920"
- id="text1532"
- sodipodi:linespacing="100%"><tspan
- id="tspan1533">Application Process 1</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.5000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.5000000 2.5000000 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect1535"
- width="148.46259"
- height="46.656849"
- x="106.29921"
- y="378.54001" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="180.61389"
- y="400.40048"
- id="text2158"
- sodipodi:linespacing="100%"><tspan
- id="tspan2159">DBusConnection</tspan><tspan
- sodipodi:role="line"
- id="tspan2161"
- x="180.61389"
- y="414.40048">Instance</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.9950929;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.9950928 2.9950928 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect2170"
- width="148.46259"
- height="66.966240"
- x="28.702768"
- y="549.21259" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="103.01745"
- y="577.56586"
- id="text2171"
- sodipodi:linespacing="100%"><tspan
- x="103.01745"
- y="577.56586"
- sodipodi:role="line"
- id="tspan2176">C/C++/Python/etc.</tspan><tspan
- x="103.01745"
- y="591.56586"
- sodipodi:role="line"
- id="tspan2178">Object Instance</tspan></text>
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3535"
- d="M 98.938952,408.61479 C 98.744753,409.20303 97.917886,409.67295 97.440945,410.11435 C 95.534947,411.94763 94.266934,414.11555 93.172614,416.33858 C 91.902056,419.02725 90.969281,421.79944 90.107252,424.59229 C 89.589105,426.27374 88.983534,427.90634 88.266907,429.53700 C 87.919667,430.33438 87.622593,431.17598 87.120464,431.91970 C 86.832222,432.30665 86.469422,432.65145 86.167985,433.03184 C 86.015931,433.22254 85.868997,433.41563 85.722131,433.60898 L 82.914336,433.11743 C 83.063402,432.91879 83.213428,432.72069 83.368121,432.52498 C 83.654681,432.15308 83.980737,431.80834 84.285389,431.44731 C 84.811957,430.77175 85.122523,429.97914 85.482400,429.23872 C 86.253056,427.64929 86.903084,426.03861 87.474578,424.39321 C 88.439548,421.58552 89.442843,418.78792 90.703938,416.05898 C 91.810966,413.77525 92.999191,411.45961 94.849464,409.50748 C 95.094704,409.24876 96.091789,407.90149 95.865737,408.61479 L 98.938952,408.61479 z " />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;"
- x="34.109497"
- y="446.13382"
- id="text3536"><tspan
- id="tspan3537">Locate Object</tspan><tspan
- sodipodi:role="line"
- id="tspan3539"
- x="34.109497"
- y="458.13382">via Object Path</tspan></text>
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3541"
- d="M 60.509867,462.78767 C 60.704066,463.37591 61.530933,463.84583 62.007874,464.28723 C 63.913872,466.12051 65.181885,468.28843 66.276205,470.51146 C 67.546763,473.20013 68.479538,475.97232 69.341567,478.76517 C 69.859714,480.44662 70.465285,482.07922 71.181912,483.70988 C 71.529152,484.50726 71.826226,485.34886 72.328355,486.09258 C 72.616597,486.47953 72.979397,486.82433 73.280834,487.20472 C 73.432888,487.39542 73.579822,487.58851 73.726688,487.78186 L 76.534483,487.29031 C 76.385417,487.09167 76.235391,486.89357 76.080698,486.69786 C 75.794138,486.32596 75.468082,485.98122 75.163430,485.62019 C 74.636862,484.94463 74.326296,484.15202 73.966419,483.41160 C 73.195763,481.82217 72.545735,480.21149 71.974241,478.56609 C 71.009271,475.75840 70.005976,472.96080 68.744881,470.23186 C 67.637853,467.94813 66.449628,465.63249 64.599355,463.68036 C 64.354115,463.42164 63.357030,462.07437 63.583082,462.78767 L 60.509867,462.78767 z " />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="49.100315"
- y="501.60959"
- id="text3542"
- sodipodi:linespacing="100%"><tspan
- x="49.100315"
- y="501.60959"
- sodipodi:role="line"
- id="tspan3547">Bindings Marshal</tspan><tspan
- x="49.100315"
- y="513.60959"
- sodipodi:role="line"
- id="tspan3549">to Method Call</tspan></text>
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3551"
- d="M 95.295239,519.43211 C 95.101039,520.02035 94.274169,520.49027 93.797229,520.93167 C 91.891239,522.76495 90.623219,524.93287 89.528899,527.15590 C 88.258339,529.84457 87.325569,532.61676 86.463539,535.40961 C 85.945389,537.09106 85.339819,538.72366 84.623199,540.35432 C 84.275959,541.15170 83.978879,541.99330 83.476749,542.73702 C 83.188509,543.12397 82.825709,543.46877 82.524269,543.84916 C 82.372219,544.03986 82.225289,544.23295 82.078419,544.42630 L 79.270619,543.93475 C 79.419689,543.73611 79.569719,543.53801 79.724409,543.34230 C 80.010969,542.97040 80.337029,542.62566 80.641679,542.26463 C 81.168249,541.58907 81.478809,540.79646 81.838689,540.05604 C 82.609339,538.46661 83.259369,536.85593 83.830869,535.21053 C 84.795839,532.40284 85.799129,529.60524 87.060229,526.87630 C 88.167249,524.59257 89.355479,522.27693 91.205749,520.32480 C 91.450989,520.06608 92.448079,518.71881 92.222029,519.43211 L 95.295239,519.43211 z " />
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3552"
- d="M 261.83533,408.61479 C 262.02953,409.20303 262.85640,409.67295 263.33334,410.11435 C 265.23934,411.94763 266.50735,414.11555 267.60167,416.33858 C 268.87223,419.02725 269.80501,421.79944 270.66703,424.59229 C 271.18518,426.27374 271.79075,427.90634 272.50738,429.53700 C 272.85462,430.33438 273.15169,431.17598 273.65382,431.91970 C 273.94206,432.30665 274.30486,432.65145 274.60630,433.03184 C 274.75836,433.22254 274.90529,433.41563 275.05216,433.60898 L 277.85995,433.11743 C 277.71088,432.91879 277.56086,432.72069 277.40617,432.52498 C 277.11961,432.15308 276.79355,431.80834 276.48890,431.44731 C 275.96233,430.77175 275.65176,429.97914 275.29189,429.23872 C 274.52123,427.64929 273.87120,426.03861 273.29971,424.39321 C 272.33474,421.58552 271.33144,418.78792 270.07035,416.05898 C 268.96332,413.77525 267.77510,411.45961 265.92482,409.50748 C 265.67958,409.24876 264.68250,407.90149 264.90855,408.61479 L 261.83533,408.61479 z " />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="223.98749"
- y="446.13382"
- id="text3553"
- sodipodi:linespacing="100%"><tspan
- x="223.98749"
- y="446.13382"
- sodipodi:role="line"
- id="tspan3562">Marshal Method</tspan><tspan
- x="223.98749"
- y="458.13382"
- sodipodi:role="line"
- id="tspan3564">Call to Message</tspan></text>
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3567"
- d="M 278.96485,463.29453 C 278.77065,463.88277 277.94378,464.35269 277.46684,464.79409 C 275.56085,466.62737 274.29283,468.79529 273.19851,471.01832 C 271.92795,473.70699 270.99518,476.47918 270.13315,479.27203 C 269.61500,480.95348 269.00943,482.58608 268.29281,484.21674 C 267.94557,485.01412 267.64849,485.85572 267.14636,486.59944 C 266.85812,486.98639 266.49532,487.33119 266.19388,487.71158 C 266.04183,487.90228 265.89490,488.09537 265.74803,488.28872 L 262.94023,487.79717 C 263.08930,487.59853 263.23933,487.40043 263.39402,487.20472 C 263.68058,486.83282 264.00664,486.48808 264.31129,486.12705 C 264.83786,485.45149 265.14842,484.65888 265.50830,483.91846 C 266.27895,482.32903 266.92898,480.71835 267.50048,479.07295 C 268.46545,476.26526 269.46874,473.46766 270.72984,470.73872 C 271.83686,468.45499 273.02509,466.13935 274.87536,464.18722 C 275.12060,463.92850 276.11769,462.58123 275.89164,463.29453 L 278.96485,463.29453 z " />
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.7377086;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.7377084 2.7377084 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect3568"
- width="124.01746"
- height="66.979813"
- x="189.79265"
- y="495.08902" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="248.94049"
- y="523.44220"
- id="text3569"
- sodipodi:linespacing="100%"><tspan
- x="248.94049"
- y="523.44220"
- sodipodi:role="line"
- id="tspan3574">Bindings Proxy</tspan><tspan
- x="248.94049"
- y="537.44220"
- sodipodi:role="line"
- id="tspan3576">Object Instance</tspan></text>
- <path
- style="fill:#000000;fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- id="path3578"
- d="M 259.03547,566.92913 C 259.22967,567.51737 260.05653,567.98729 260.53348,568.42869 C 262.43947,570.26197 263.70749,572.42989 264.80181,574.65292 C 266.07236,577.34159 267.00514,580.11378 267.86717,582.90663 C 268.38532,584.58808 268.99089,586.22068 269.70751,587.85134 C 270.05475,588.64872 270.35183,589.49032 270.85396,590.23404 C 271.14220,590.62099 271.50500,590.96579 271.80644,591.34618 C 271.95849,591.53688 272.10542,591.72997 272.25229,591.92332 L 275.06008,591.43177 C 274.91102,591.23313 274.76099,591.03503 274.60630,590.83932 C 274.31974,590.46742 273.99368,590.12268 273.68903,589.76165 C 273.16246,589.08609 272.85190,588.29348 272.49202,587.55306 C 271.72136,585.96363 271.07134,584.35295 270.49984,582.70755 C 269.53487,579.89986 268.53158,577.10226 267.27048,574.37332 C 266.16345,572.08959 264.97523,569.77395 263.12496,567.82182 C 262.87972,567.56310 261.88263,566.21583 262.10868,566.92913 L 259.03547,566.92913 z " />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="217.40741"
- y="607.90881"
- id="text3579"
- sodipodi:linespacing="100%"><tspan
- x="217.40741"
- y="607.90881"
- sodipodi:role="line"
- id="tspan3584">Application Code</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.96172028pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 26.574803,408.60009 C 26.574803,539.68912 26.574803,539.68911 26.574803,531.49606"
- id="path3586"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="25.977146"
- y="386.45212"
- id="text4220"
- sodipodi:linespacing="100%"><tspan
- id="tspan4221">Incoming</tspan><tspan
- sodipodi:role="line"
- id="tspan4223"
- x="25.977146"
- y="398.45212">Call</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:end;writing-mode:lr;"
- x="335.61411"
- y="386.45212"
- id="text4226"
- sodipodi:linespacing="100%"><tspan
- x="335.61411"
- y="386.45212"
- sodipodi:role="line"
- id="tspan4231">Outgoing</tspan><tspan
- x="335.61411"
- y="398.45212"
- sodipodi:role="line"
- id="tspan4233">Call</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.96172028pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-start:url(#Arrow1M);marker-end:none;"
- d="M 327.75591,416.33858 C 327.75591,547.42761 327.75591,547.42760 327.75591,539.23455"
- id="path4236"
- sodipodi:nodetypes="cc" />
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:5.7914310;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;"
- id="rect4870"
- width="885.86591"
- height="310.27252"
- x="88.582680"
- y="8.8582621" />
- <text
- xml:space="preserve"
- style="font-size:18.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="515.42737"
- y="305.44489"
- id="text4871"
- sodipodi:linespacing="100%"><tspan
- x="515.42737"
- y="305.44489"
- sodipodi:role="line"
- id="tspan4874">Bus Daemon Process</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:3.7500000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;"
- id="rect4876"
- width="325.23203"
- height="354.33072"
- x="708.66144"
- y="373.08359" />
- <text
- xml:space="preserve"
- style="font-size:18.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="761.72314"
- y="713.77551"
- id="text4877"
- sodipodi:linespacing="100%"><tspan
- x="761.72314"
- y="713.77551"
- sodipodi:role="line"
- id="tspan4880">Application Process 2</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="823.49664"
- y="505.18018"
- id="text4883"
- sodipodi:linespacing="100%"><tspan
- x="823.49664"
- y="505.18018"
- sodipodi:role="line"
- id="tspan4888">Same Stuff as in</tspan><tspan
- x="823.49664"
- y="517.18018"
- sodipodi:role="line"
- id="tspan4890">Process 1</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="47.891071"
- y="638.05420"
- id="text4892"
- sodipodi:linespacing="100%"><tspan
- x="47.891071"
- y="638.05420"
- sodipodi:role="line"
- id="tspan4901">(Object Instance Has</tspan><tspan
- x="47.891071"
- y="650.05420"
- sodipodi:role="line"
- id="tspan4903">1 or More Interfaces)</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.2500000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;marker-start:url(#Arrow1M);marker-end:url(#Arrow1M);stroke-dasharray:none;"
- d="M 162.57260,358.02041 C 165.25213,354.60516 186.01858,328.13688 184.00893,330.69832"
- id="path4905"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;"
- x="190.57170"
- y="342.62018"
- id="text5539"><tspan
- id="tspan5540">Socket</tspan><tspan
- sodipodi:role="line"
- id="tspan5544"
- x="190.57170"
- y="354.62018">(Bidirectional Message Stream)</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.2500000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;marker-start:url(#Arrow1M);marker-end:url(#Arrow1M);"
- d="M 827.53876,363.18897 C 824.85916,359.77372 804.09276,333.30544 806.10236,335.86688"
- id="path5546"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;"
- x="840.79150"
- y="345.73135"
- id="text5547"><tspan
- id="tspan5548">Socket</tspan><tspan
- sodipodi:role="line"
- id="tspan5550"
- x="840.79150"
- y="357.73135">(Bidirectional Message Stream)</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.5000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.5000000 2.5000000 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect5552"
- width="148.46259"
- height="46.656849"
- x="124.01575"
- y="263.38251" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="198.33043"
- y="285.24298"
- id="text5553"
- sodipodi:linespacing="100%"><tspan
- id="tspan5554">DBusConnection</tspan><tspan
- sodipodi:role="line"
- id="tspan5556"
- x="198.33043"
- y="299.24298">Instance</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.5000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.5000000 2.5000000 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect5558"
- width="148.46259"
- height="46.656849"
- x="719.64764"
- y="263.38251" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="793.96234"
- y="285.24298"
- id="text5559"
- sodipodi:linespacing="100%"><tspan
- id="tspan5560">DBusConnection</tspan><tspan
- sodipodi:role="line"
- id="tspan5562"
- x="793.96234"
- y="299.24298">Instance</tspan></text>
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.5000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.5000000 2.5000000 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect5564"
- width="148.46259"
- height="46.656849"
- x="763.77222"
- y="378.54001" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="838.08691"
- y="400.40048"
- id="text5565"
- sodipodi:linespacing="100%"><tspan
- id="tspan5566">DBusConnection</tspan><tspan
- sodipodi:role="line"
- id="tspan5568"
- x="838.08691"
- y="414.40048">Instance</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 186.02362,248.03149 C 106.29921,26.574797 372.04724,26.574797 372.04724,26.574797"
- id="path5571"
- sodipodi:nodetypes="cc" />
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.1854961;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:2.1854960 2.1854960 ;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;"
- id="rect6205"
- width="148.46259"
- height="35.656227"
- x="391.89175"
- y="17.493374" />
- <text
- xml:space="preserve"
- style="font-size:14.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="466.20642"
- y="39.577003"
- id="text6206"
- sodipodi:linespacing="100%"><tspan
- x="466.20642"
- y="39.577003"
- sodipodi:role="line"
- id="tspan6211">Message Dispatcher</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 806.10236,248.03149 C 814.96063,17.716530 549.21260,26.574797 558.07087,26.574797"
- id="path6213"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:start;writing-mode:lr;"
- x="380.24341"
- y="71.125053"
- id="text6214"
- sodipodi:linespacing="100%"><tspan
- x="380.24341"
- y="71.125053"
- sodipodi:role="line"
- id="tspan6860">if (message is signal)</tspan><tspan
- x="380.24341"
- y="83.125053"
- sodipodi:role="line"
- id="tspan6862"> broadcast</tspan><tspan
- x="380.24341"
- y="95.125053"
- sodipodi:role="line"
- id="tspan6864">else</tspan><tspan
- x="380.24341"
- y="107.12505"
- sodipodi:role="line"
- id="tspan6866"> find destination named by message</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 380.90551,79.724404 C 177.16536,53.149601 203.74016,256.88976 203.74016,248.03149"
- id="path6868"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 451.77165,79.724404 C 788.38583,44.291333 779.52756,256.88976 779.52756,248.03149"
- id="path6869"
- sodipodi:nodetypes="cc" />
- <rect
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#6a6a6a;stroke-width:2.5000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;stroke-miterlimit:4.0000000;stroke-dasharray:1.2500000,1.2500000;stroke-dashoffset:0.0000000;"
- id="rect7503"
- width="318.89764"
- height="168.30708"
- x="345.47244"
- y="115.15748" />
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;"
- x="507.10016"
- y="132.70409"
- id="text8137"
- sodipodi:linespacing="100%"><tspan
- id="tspan8138">Destination Table</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:12.000000;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans;font-stretch:normal;font-variant:normal;text-anchor:start;writing-mode:lr;"
- x="422.71124"
- y="158.39366"
- id="text8140"
- sodipodi:linespacing="120%"><tspan
- x="422.71124"
- y="158.39366"
- sodipodi:role="line"
- id="tspan8818">Connection 1</tspan><tspan
- x="422.71124"
- y="172.79366"
- sodipodi:role="line"
- id="tspan8820">Connection 2</tspan><tspan
- x="422.71124"
- y="187.19366"
- sodipodi:role="line"
- id="tspan8822">&quot;The Session Manager&quot;</tspan><tspan
- x="422.71124"
- y="201.59366"
- sodipodi:role="line"
- id="tspan8824">&quot;The Window Manager&quot;</tspan><tspan
- x="422.71124"
- y="215.99366"
- sodipodi:role="line"
- id="tspan8826">&quot;The Screensaver&quot;</tspan><tspan
- x="422.71124"
- y="230.39366"
- sodipodi:role="line"
- id="tspan8828">&quot;The Text Editor&quot;</tspan><tspan
- x="422.71124"
- y="244.79366"
- sodipodi:role="line"
- id="tspan8830">&quot;The Hardware Directory&quot;</tspan><tspan
- x="422.71124"
- y="259.19367"
- sodipodi:role="line"
- id="tspan8832">&quot;The Address Book&quot;</tspan><tspan
- x="422.71124"
- y="273.59367"
- sodipodi:role="line"
- id="tspan8834">&quot;The Dictionary&quot;</tspan></text>
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 416.33858,150.59055 C 239.17323,97.440935 221.45669,256.88976 221.45669,248.03149"
- id="path8179"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 504.92126,168.30708 C 726.37795,106.29921 770.66929,265.74802 761.81102,239.17322"
- id="path8180"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
- d=""
- id="path8181"
- sodipodi:nodetypes="" />
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 584.64567,239.17322 C 717.51969,194.88188 761.81102,256.88976 752.95276,248.03149"
- id="path8182"
- sodipodi:nodetypes="cc" />
- <path
- style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;marker-end:url(#Arrow1M);"
- d="M 416.33858,177.16535 C 301.18111,124.01574 230.31496,265.74803 239.17323,248.03149"
- id="path8184"
- sodipodi:nodetypes="cc" />
-</svg>
diff --git a/src/3rd_party/dbus-1.7.8/doc/doxygen_to_devhelp.xsl b/src/3rd_party/dbus-1.7.8/doc/doxygen_to_devhelp.xsl
deleted file mode 100644
index 72098f9fda..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/doxygen_to_devhelp.xsl
+++ /dev/null
@@ -1,40 +0,0 @@
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- version="1.0">
-
-<xsl:output method="xml" version="1.0" indent="yes"/>
-
-<xsl:param name="prefix"></xsl:param>
-
-<xsl:template match="/">
- <book title="D-Bus: A system for interprocess communication"
- name="dbus"
- link="dbus-tutorial.html">
- <chapters>
- <sub name="Tutorial" link="{$prefix}dbus-tutorial.html"/>
- <sub name="FAQ" link="{$prefix}dbus-faq.html"/>
- <sub name="Specification" link="{$prefix}dbus-specification.html"/>
- <sub name="API Reference" link="{$prefix}api/index.html"/>
- </chapters>
-
- <functions>
- <xsl:apply-templates select="doxygenindex/compound[@kind='group']/member[@kind='function']"/>
- </functions>
- </book>
-</xsl:template>
-
-<xsl:template match="member">
- <xsl:param name="name"><xsl:value-of select="name"/></xsl:param>
- <xsl:param name="refid"><xsl:value-of select="@refid"/></xsl:param>
- <xsl:param name="before"><xsl:value-of select="substring-before($refid,'_1')"/></xsl:param>
- <xsl:param name="after"><xsl:value-of select="substring-after($refid,'_1')"/></xsl:param>
- <xsl:param name="link"><xsl:value-of select="$before"/>.html#<xsl:value-of select="$after"/></xsl:param>
- <xsl:if test="starts-with($name,'dbus') or starts-with($name, 'DBus')">
- <xsl:if test="starts-with($refid,'group__') and contains($refid, '_1')">
- <function name="{$name}" link="{$prefix}api/{$link}"/>
- </xsl:if>
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/src/3rd_party/dbus-1.7.8/doc/file-boilerplate.c b/src/3rd_party/dbus-1.7.8/doc/file-boilerplate.c
deleted file mode 100644
index bc365f805f..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/file-boilerplate.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* FILENAME BRIEF FILE DESCRIPTION
- *
- * Copyright (C) YEAR COPYRIGHT HOLDER
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_FOO_H
-#define DBUS_FOO_H
-
-#endif /* DBUS_FOO_H */
diff --git a/src/3rd_party/dbus-1.7.8/doc/introspect.dtd b/src/3rd_party/dbus-1.7.8/doc/introspect.dtd
deleted file mode 100644
index ba263d3260..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/introspect.dtd
+++ /dev/null
@@ -1,37 +0,0 @@
-<!-- DTD for D-Bus Introspection data -->
-<!-- (C) 2005-02-02 David A. Wheeler; released under the D-Bus licenses,
- GNU GPL version 2 (or greater) and AFL 1.1 (or greater) -->
-
-<!-- see D-Bus specification for documentation -->
-
-<!ELEMENT node (node|interface)*>
-<!ATTLIST node name CDATA #IMPLIED>
-
-<!ELEMENT interface (method|signal|property|annotation)*>
-<!ATTLIST interface name CDATA #REQUIRED>
-
-<!ELEMENT method (arg|annotation)*>
-<!ATTLIST method name CDATA #REQUIRED>
-
-<!ELEMENT signal (arg|annotation)*>
-<!ATTLIST signal name CDATA #REQUIRED>
-
-<!ELEMENT arg EMPTY>
-<!ATTLIST arg name CDATA #IMPLIED>
-<!ATTLIST arg type CDATA #REQUIRED>
-<!-- Method arguments SHOULD include "direction",
- while signal and error arguments SHOULD not (since there's no point).
- The DTD format can't express that subtlety. -->
-<!ATTLIST arg direction (in|out) "in">
-
-<!-- AKA "attribute" -->
-<!ELEMENT property (annotation)*>
-<!ATTLIST property name CDATA #REQUIRED>
-<!ATTLIST property type CDATA #REQUIRED>
-<!ATTLIST property access (read|write|readwrite) #REQUIRED>
-
-<!ELEMENT annotation EMPTY> <!-- Generic metadata -->
-<!ATTLIST annotation name CDATA #REQUIRED>
-<!ATTLIST annotation value CDATA #REQUIRED>
-
-
diff --git a/src/3rd_party/dbus-1.7.8/doc/introspect.xsl b/src/3rd_party/dbus-1.7.8/doc/introspect.xsl
deleted file mode 100644
index 2a34474186..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/introspect.xsl
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-15"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
-
-<!--
- Copyright (C) 2005 Lennart Poettering.
-
- Licensed under the Academic Free License version 2.1
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--->
-
-<!-- $Id$ -->
-
-<xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/>
-
-<xsl:template match="/">
- <html>
- <head>
- <title>DBUS Introspection data</title>
- <style type="text/css">
- body { color: black; background-color: white }
- h1 { font-family: sans-serif }
- ul { list-style-type: none; margin-bottom: 10px }
- li { font-family: sans-serif }
- .keyword { font-style: italic }
- .type { font-weight: bold }
- .symbol { font-family: monospace }
- .interface { padding: 10px; margin: 10px }
- </style>
- </head>
- <body>
- <xsl:for-each select="node/interface">
- <div class="interface">
- <h1>
- <span class="keyword">interface</span><xsl:text> </xsl:text>
- <span class="symbol"><xsl:value-of select="@name"/></span>
- </h1>
-
- <ul>
-
- <xsl:apply-templates select="annotation"/>
-
- <xsl:for-each select="method|signal|property">
- <li>
- <span class="keyword"><xsl:value-of select="name()"/></span>
- <xsl:text> </xsl:text>
- <span class="symbol"><xsl:value-of select="@name"/></span>
-
- <ul>
- <xsl:apply-templates select="annotation"/>
- <xsl:for-each select="arg">
- <li>
- <span class="keyword">
- <xsl:choose>
- <xsl:when test="@direction != &quot;&quot;">
- <xsl:value-of select="@direction"/>
- </xsl:when>
- <xsl:when test="name(..) = &quot;signal&quot;">
- out
- </xsl:when>
- <xsl:otherwise>
- in
- </xsl:otherwise>
- </xsl:choose>
- </span>
-
- <xsl:text> </xsl:text>
-
- <span class="type"><xsl:value-of select="@type"/></span><xsl:text> </xsl:text>
- <span class="symbol"><xsl:value-of select="@name"/></span><xsl:text> </xsl:text>
- </li>
- </xsl:for-each>
- </ul>
-
- </li>
- </xsl:for-each>
-
- </ul>
- </div>
- </xsl:for-each>
- </body>
- </html>
-</xsl:template>
-
-
-<xsl:template match="annotation">
- <li>
- <span class="keyword">annotation</span>
- <code><xsl:value-of select="@name"/></code><xsl:text> = </xsl:text>
- <code><xsl:value-of select="@value"/></code>
- </li>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/src/3rd_party/dbus-1.7.8/doc/system-activation.txt b/src/3rd_party/dbus-1.7.8/doc/system-activation.txt
deleted file mode 100644
index dd195f750a..0000000000
--- a/src/3rd_party/dbus-1.7.8/doc/system-activation.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-D-BUS System Activation
-
-Introduction:
-
-The dbus-daemon runs as the dbus user, and is therefore unprivileged.
-Earlier attempts [1] by David Zeuthen at launching system scripts using a
-custom DBUS protocol were reviewed, but deemed too difficult to audit, and
-also due to a multi-threaded design, too difficult to test.
-In the next few paragraphs I will outline a simpler setuid approach for
-launching daemons as a configured user.
-
-Scope:
-
-Launching programs using dbus has been a topic of interest for many months.
-This would allow simple systems to only start services that are needed,
-and that are automatically started only when first requested.
-This removes the need for an init system, and means that we can trivially
-startup services in parallel.
-This has immediate pressing need for OLPC, with a longer term evaluation for
-perhaps Fedora and RHEL.
-
-Details:
-
-Setuid applications have to used only when absolutely necessary.
-In this implementation I have an single executable,
-dbus-daemon-launch-helper, with the ownership root:dbus.
-This has the permissions 4750, i.e. u+rwx g+rx +setuid.
-It is located in /usr/libexec/ and thus is not designed to be invoked by a
-user directly.
-
-The helper must not be passed input that can be changed maliciously, and
-therefore passing a random path with user id is totally out of the question.
-In this implementation a similar idea as discussed with Davids' patch was
-taken, that to pass a single name argument to the helper.
-The service filename of "org.me.test.service" is then searched for in
-/usr/share/dbus-1/system-services or other specified directories.
-
-If applications want to be activated on the system _and_ session busses, then
-service files should be installed in both directories.
-
-A typical service file would look like:
-
-[D-BUS Service]
-Name=org.me.test
-Exec=/usr/sbin/dbus-test-server.py
-User=ftp
-
-This gives the user to switch to, and also the path of the executable.
-The service name must match that specified in the /etc/dbus-1/system.d conf file.
-
-Precautions taken:
-
-* Only the bus name is passed to the helper, and this is validated
-* We are super paranoid about the user that called us, and what permissions we have.
-* We clear all environment variables except for DBUS_VERBOSE which is used for debugging
-* Anything out of the ordinary causes the helper to abort.
-
-Launching services:
-
-Trivial methods on services can be called directly and the launch helper will
-start the service and execute the method on the service. The lauching of the
-service is completely transparent to the caller, e.g.:
-
-dbus-send --system --print-reply \
- --dest=org.freedesktop.Hal \
- /org/freedesktop/Hal/Manager \
- org.freedesktop.Hal.Manager.DeviceExists \
- string:/org/freedesktop/Hal/devices/computer
-
-If you wish to activate the service without calling a well known method,
-the standard dbus method StartServiceByName can be used:
-
-dbus-send --system --print-reply \
- --dest=org.freedesktop.DBus \
- /org/freedesktop/DBus \
- org.freedesktop.DBus.StartServiceByName \
- string:org.freedesktop.Hal uint32:0
-
-[1] http://lists.freedesktop.org/archives/dbus/2006-October/006096.html
-
diff --git a/src/3rd_party/dbus-1.7.8/install-sh b/src/3rd_party/dbus-1.7.8/install-sh
deleted file mode 100755
index 377bb8687f..0000000000
--- a/src/3rd_party/dbus-1.7.8/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# 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
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/ltmain.sh b/src/3rd_party/dbus-1.7.8/ltmain.sh
deleted file mode 100644
index 68c6d96ca5..0000000000
--- a/src/3rd_party/dbus-1.7.8/ltmain.sh
+++ /dev/null
@@ -1,9661 +0,0 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --no-warn don't display warning messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.3
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.3"
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-} # func_dirname may be replaced by extended shell implementation
-
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname may be replaced by extended shell implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
- s@/\./@/@g
- t dotsl
- s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test "$func_normal_abspath_tpath" = / ; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result" ; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=${func_dirname_result}
- if test "x$func_relative_path_tlibdir" = x ; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
-
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test "x$func_stripname_result" != x ; then
- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
- fi
-
- # Normalisation. If bindir is libdir, return empty string,
- # else relative path ending with a slash; either way, target
- # file name can be directly appended.
- if test ! -z "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result/"
- func_relative_path_result=$func_stripname_result
- fi
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=$func_dirname_result
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
- *)
- save_IFS="$IFS"
- IFS=${PATH_SEPARATOR-:}
- for progdir in $PATH; do
- IFS="$save_IFS"
- test -x "$progdir/$progname" && break
- done
- IFS="$save_IFS"
- test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $opt_verbose && func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- my_directory_path="$1"
- my_dir_list=
-
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
-
- # If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
- done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
- done
- IFS="$save_mkdir_p_IFS"
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
- fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$opt_dry_run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
-
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
- ;;
- *)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
- esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- case $1 in
- *[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg="$1" ;;
- esac
-
- case $my_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
- ;;
- esac
-
- func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result. All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
-}
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $opt_debug
-
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
- p
- d
- }
- /^# .* home page:/b print
- /^# General help using/b print
- ' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- $opt_debug
-
- func_error "missing argument for $1."
- exit_cmd=exit
-}
-
-
-# func_split_short_opt shortopt
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
-{
- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
-
-
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
-{
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
-
- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
-
-exit_cmd=:
-
-
-
-
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
- func_quote_for_eval "${2}"
- eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
-
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
-
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
-
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
- re_begincf='^# ### BEGIN LIBTOOL'
- re_endcf='^# ### END LIBTOOL'
-
- # Default configuration.
- $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
- done
-
- exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
- echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- echo "enable shared libraries"
- else
- echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- echo "enable static libraries"
- else
- echo "disable static libraries"
- fi
-
- exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
- # Global variable:
- tagname="$1"
-
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
- fi
-
- exit $EXIT_MISMATCH
- fi
-}
-
-
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
-compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
-execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
-finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
-install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
-link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly. This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
- # this just eases exit handling
- while test $# -gt 0; do
- opt="$1"
- shift
- case $opt in
- --debug|-x) opt_debug='set -x'
- func_echo "enabling shell trace mode"
- $opt_debug
- ;;
- --dry-run|--dryrun|-n)
- opt_dry_run=:
- ;;
- --config)
- opt_config=:
-func_config
- ;;
- --dlopen|-dlopen)
- optarg="$1"
- opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
- shift
- ;;
- --preserve-dup-deps)
- opt_preserve_dup_deps=:
- ;;
- --features)
- opt_features=:
-func_features
- ;;
- --finish)
- opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
- ;;
- --help)
- opt_help=:
- ;;
- --help-all)
- opt_help_all=:
-opt_help=': help-all'
- ;;
- --mode)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_mode="$optarg"
-case $optarg in
- # Valid mode arguments:
- clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
-esac
- shift
- ;;
- --no-silent|--no-quiet)
- opt_silent=false
-func_append preserve_args " $opt"
- ;;
- --no-warning|--no-warn)
- opt_warning=false
-func_append preserve_args " $opt"
- ;;
- --no-verbose)
- opt_verbose=false
-func_append preserve_args " $opt"
- ;;
- --silent|--quiet)
- opt_silent=:
-func_append preserve_args " $opt"
- opt_verbose=false
- ;;
- --verbose|-v)
- opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
- ;;
- --tag)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
- shift
- ;;
-
- -\?|-h) func_usage ;;
- --help) func_help ;;
- --version) func_version ;;
-
- # Separate optargs to long options:
- --*=*)
- func_split_long_opt "$opt"
- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- shift
- ;;
-
- # Separate non-argument short options:
- -\?*|-h*|-n*|-v*)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
-
- --) break ;;
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set dummy "$opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
- # Validate options:
-
- # save first non-option argument
- if test "$#" -gt 0; then
- nonopt="$opt"
- shift
- fi
-
- # preserve --debug
- test "$opt_debug" = : || func_append preserve_args " --debug"
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
-
- $opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
-
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$opt_mode' for more information."
- }
-
-
- # Bail if the options were screwed
- $exit_cmd $EXIT_FAILURE
-}
-
-
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
- test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs. To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
- lalib_p=no
- if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
- for lalib_p_l in 1 2 3 4
- do
- read lalib_p_line
- case "$lalib_p_line" in
- \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
- esac
- done
- exec 0<&5 5<&-
- fi
- test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
- func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
- func_ltwrapper_exec_suffix=
- case $1 in
- *.exe) ;;
- *) func_ltwrapper_exec_suffix=.exe ;;
- esac
- $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
- func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
- $opt_debug
- save_ifs=$IFS; IFS='~'
- for cmd in $1; do
- IFS=$save_ifs
- eval cmd=\"$cmd\"
- func_show_eval "$cmd" "${2-:}"
- done
- IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
- $opt_debug
- case $1 in
- */* | *\\*) . "$1" ;;
- *) . "./$1" ;;
- esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot. Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
- func_resolve_sysroot_result=$1
- case $func_resolve_sysroot_result in
- =*)
- func_stripname '=' '' "$func_resolve_sysroot_result"
- func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
- ;;
- esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
- case "$lt_sysroot:$1" in
- ?*:"$lt_sysroot"*)
- func_stripname "$lt_sysroot" '' "$1"
- func_replace_sysroot_result="=$func_stripname_result"
- ;;
- *)
- # Including no sysroot.
- func_replace_sysroot_result=$1
- ;;
- esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- $opt_debug
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case "$@ " in
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
-# else
-# func_verbose "using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
- else
- write_lobj=none
- fi
-
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
- else
- write_oldobj=none
- fi
-
- $opt_dry_run || {
- cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
- $MV "${write_libobj}T" "${write_libobj}"
- }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
- $opt_debug
- func_convert_core_file_wine_to_w32_result="$1"
- if test -n "$1"; then
- # Unfortunately, winepath does not exit with a non-zero error code, so we
- # are forced to check the contents of stdout. On the other hand, if the
- # command is not found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both error code of
- # zero AND non-empty stdout, which explains the odd construction:
- func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
- func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- $SED -e "$lt_sed_naive_backslashify"`
- else
- func_convert_core_file_wine_to_w32_result=
- fi
- fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
- $opt_debug
- # unfortunately, winepath doesn't convert paths, only file names
- func_convert_core_path_wine_to_w32_result=""
- if test -n "$1"; then
- oldIFS=$IFS
- IFS=:
- for func_convert_core_path_wine_to_w32_f in $1; do
- IFS=$oldIFS
- func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- if test -n "$func_convert_core_file_wine_to_w32_result" ; then
- if test -z "$func_convert_core_path_wine_to_w32_result"; then
- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
- else
- func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
- fi
- fi
- done
- IFS=$oldIFS
- fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
- $opt_debug
- if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
- func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
- if test "$?" -ne 0; then
- # on failure, ensure result is empty
- func_cygpath_result=
- fi
- else
- func_cygpath_result=
- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
- fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format. Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
- $opt_debug
- # awkward: cmd appends spaces to result
- func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
- $opt_debug
- if test -z "$2" && test -n "$1" ; then
- func_error "Could not determine host file name corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_file_result="$1"
- fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
- $opt_debug
- if test -z "$4" && test -n "$3"; then
- func_error "Could not determine the host path corresponding to"
- func_error " \`$3'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This is a deliberately simplistic "conversion" and
- # should not be "improved". See libtool.info.
- if test "x$1" != "x$2"; then
- lt_replace_pathsep_chars="s|$1|$2|g"
- func_to_host_path_result=`echo "$3" |
- $SED -e "$lt_replace_pathsep_chars"`
- else
- func_to_host_path_result="$3"
- fi
- fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
- $opt_debug
- case $4 in
- $1 ) func_to_host_path_result="$3$func_to_host_path_result"
- ;;
- esac
- case $4 in
- $2 ) func_append func_to_host_path_result "$3"
- ;;
- esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via `$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
- $opt_debug
- $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result. If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
- $opt_debug
- case ,$2, in
- *,"$to_tool_file_cmd",*)
- func_to_tool_file_result=$1
- ;;
- *)
- $to_tool_file_cmd "$1"
- func_to_tool_file_result=$func_to_host_file_result
- ;;
- esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
- func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_msys_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
- # LT_CYGPATH in this case.
- func_to_host_file_result=`cygpath -m "$1"`
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format. Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_file_wine_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_cygpath -u "$func_convert_core_msys_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
- func_convert_core_file_wine_to_w32 "$1"
- func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via `$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format. If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-# file name conversion function : func_convert_file_X_to_Y ()
-# path conversion function : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same. If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
- $opt_debug
- if test -z "$to_host_path_cmd"; then
- func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- to_host_path_cmd="func_convert_path_${func_stripname_result}"
- fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
- $opt_debug
- func_init_to_host_path_cmd
- $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
- func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from ARG. MSYS
- # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
- # and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_msys_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format. Requires a wine environment and
-# a working winepath. Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
- $opt_debug
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
- pie_flag=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
- arg_mode=target
- continue
- ;;
-
- -pie | -fpie | -fPIE)
- func_append pie_flag " $arg"
- continue
- ;;
-
- -shared | -static | -prefer-pic | -prefer-non-pic)
- func_append later " $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
- func_append_quoted lastarg "$arg"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$lastarg"
- lastarg=$func_stripname_result
-
- # Add the arguments to base_compile.
- func_append base_compile " $lastarg"
- continue
- ;;
-
- *)
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- func_append_quoted base_compile "$lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- func_fatal_error "you must specify an argument for -Xcompile"
- ;;
- target)
- func_fatal_error "you must specify a target with \`-o'"
- ;;
- *)
- # Get the name of the library object.
- test -z "$libobj" && {
- func_basename "$srcfile"
- libobj="$func_basename_result"
- }
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- case $libobj in
- *.[cCFSifmso] | \
- *.ada | *.adb | *.ads | *.asm | \
- *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
- func_xform "$libobj"
- libobj=$func_xform_result
- ;;
- esac
-
- case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
- *)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- continue
- ;;
-
- -static)
- build_libtool_libs=no
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
- && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
- func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
- lobj=${xdir}$objdir/$objname
-
- test -z "$base_compile" && \
- func_fatal_help "you must specify a compilation command"
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
- func_append removelist " $output_obj"
- $ECHO "$srcfile" > "$lockfile"
- fi
-
- $opt_dry_run || $RM $removelist
- func_append removelist " $lockfile"
- trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
- func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
- srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- func_mkdir_p "$xdir$objdir"
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- func_append command " -o $lobj"
- fi
-
- func_show_eval_locale "$command" \
- 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- func_show_eval '$MV "$output_obj" "$lobj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- func_append command " -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- func_append command "$suppress_output"
- func_show_eval_locale "$command" \
- '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- fi
-
- $opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- removelist=$lockfile
- $RM "$lockfile"
- fi
- }
-
- exit $EXIT_SUCCESS
-}
-
-$opt_help || {
- test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
- # We need to display help for each of the modes.
- case $opt_mode in
- "")
- # Generic help is extracted from the usage comments
- # at the start of this file.
- func_help
- ;;
-
- clean)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
- compile)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to build PIC objects only
- -prefer-non-pic try to build non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
- execute)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
- finish)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
- install)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
- -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
- link)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -bindir BINDIR specify path to binaries directory (for systems where
- libraries must be found in the PATH setting at runtime)
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
- -Wc,FLAG
- -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
- -Wl,FLAG
- -Xlinker FLAG pass linker-specific FLAG directly to the linker
- -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
- uninstall)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
- *)
- func_fatal_help "invalid operation mode \`$opt_mode'"
- ;;
- esac
-
- echo
- $ECHO "Try \`$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
- if test "$opt_help" = :; then
- func_mode_help
- else
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- func_mode_help
- done
- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- echo
- func_mode_help
- done
- } |
- sed '1d
- /^When reporting/,/^Report/{
- H
- d
- }
- $x
- /information about other modes/d
- /more detailed .*MODE/d
- s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
- fi
- exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
- $opt_debug
- # The first argument is the command name.
- cmd="$nonopt"
- test -z "$cmd" && \
- func_fatal_help "you must specify a COMMAND"
-
- # Handle -dlopen flags immediately.
- for file in $opt_dlopen; do
- test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
-
- dir=
- case $file in
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
-
- # Read the libtool library.
- dlname=
- library_names=
- func_source "$file"
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
-
- if test -f "$dir/$objdir/$dlname"; then
- func_append dir "/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- ;;
-
- *)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -* | *.la | *.lo ) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if func_ltwrapper_script_p "$file"; then
- func_source "$file"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- elif func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- func_source "$func_ltwrapper_scriptname_result"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- func_append_quoted args "$file"
- done
-
- if test "X$opt_dry_run" = Xfalse; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- echo "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $opt_debug
- libs=
- libdirs=
- admincmds=
-
- for opt in "$nonopt" ${1+"$@"}
- do
- if test -d "$opt"; then
- func_append libdirs " $opt"
-
- elif test -f "$opt"; then
- if func_lalib_unsafe_p "$opt"; then
- func_append libs " $opt"
- else
- func_warning "\`$opt' is not a valid libtool archive"
- fi
-
- else
- func_fatal_error "invalid argument \`$opt'"
- fi
- done
-
- if test -n "$libs"; then
- if test -n "$lt_sysroot"; then
- sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
- sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
- else
- sysroot_cmd=
- fi
-
- # Remove sysroot references
- if $opt_dry_run; then
- for lib in $libs; do
- echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
- done
- else
- tmpdir=`func_mktempdir`
- for lib in $libs; do
- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
- > $tmpdir/tmp-la
- mv -f $tmpdir/tmp-la $lib
- done
- ${RM}r "$tmpdir"
- fi
- fi
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || func_append admincmds "
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- echo
-
- echo "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
- fi
- exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
- $opt_debug
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac; then
- # Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
- arg=$1
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
- install_shared_prog=$install_prog
- case " $install_prog " in
- *[\\\ /]cp\ *) install_cp=: ;;
- *) install_cp=false ;;
- esac
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- no_mode=:
- for arg
- do
- arg2=
- if test -n "$dest"; then
- func_append files " $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- if $install_cp; then :; else
- prev=$arg
- fi
- ;;
- -g | -m | -o)
- prev=$arg
- ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- if test "x$prev" = x-m && test -n "$install_override_mode"; then
- arg2=$install_override_mode
- no_mode=false
- fi
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
- if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
- fi
- func_append install_shared_prog " $func_quote_for_eval_result"
- done
-
- test -z "$install_prog" && \
- func_fatal_help "you must specify an install program"
-
- test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
-
- if test -n "$install_override_mode" && $no_mode; then
- if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
- fi
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- func_fatal_help "no file or destination specified"
- else
- func_fatal_help "you must specify a destination"
- fi
- fi
-
- # Strip any trailing slash from the destination.
- func_stripname '' '/' "$dest"
- dest=$func_stripname_result
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files; shift
- test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- func_fatal_help "\`$destdir' must be an absolute directory name"
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- func_append staticlibs " $file"
- ;;
-
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
-
- library_names=
- old_library=
- relink_command=
- func_source "$file"
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) func_append current_libdirs " $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) func_append future_libdirs " $libdir" ;;
- esac
- fi
-
- func_dirname "$file" "/" ""
- dir="$func_dirname_result"
- func_append dir "$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- func_warning "relinking \`$file'"
- func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
- fi
-
- # See the names of the shared library.
- set dummy $library_names; shift
- if test -n "$1"; then
- realname="$1"
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
- 'exit $?'
- tstripme="$stripme"
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- case $realname in
- *.dll.a)
- tstripme=""
- ;;
- esac
- ;;
- esac
- if test -n "$tstripme" && test -n "$striplib"; then
- func_show_eval "$striplib $destdir/$realname" 'exit $?'
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- test "$linkname" != "$realname" \
- && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- func_execute_cmds "$postinstall_cmds" 'exit $?'
- fi
-
- # Install the pseudo-library for information purposes.
- func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
- func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
- # Maybe install the static library, too.
- test -n "$old_library" && func_append staticlibs " $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- func_lo2o "$destfile"
- staticdest=$func_lo2o_result
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
- ;;
- esac
-
- # Install the libtool object if requested.
- test -n "$destfile" && \
- func_show_eval "$install_prog $file $destfile" 'exit $?'
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- func_lo2o "$file"
- staticobj=$func_lo2o_result
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin* | *mingw*)
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- wrapper=$func_ltwrapper_scriptname_result
- else
- func_stripname '' '.exe' "$file"
- wrapper=$func_stripname_result
- fi
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if func_ltwrapper_script_p "$wrapper"; then
- notinst_deplibs=
- relink_command=
-
- func_source "$wrapper"
-
- # Check the variables that should have been set.
- test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- func_source "$lib"
- fi
- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
- fi
- done
-
- relink_command=
- func_source "$wrapper"
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- $opt_dry_run || {
- if test "$finalize" = yes; then
- tmpdir=`func_mktempdir`
- func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
- $opt_silent || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
- }
- if eval "$relink_command"; then :
- else
- func_error "error: relink \`$file' with the above command before installing it"
- $opt_dry_run || ${RM}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- func_warning "cannot relink \`$file'"
- fi
- }
- else
- # Install the binary that we compiled earlier.
- file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- func_stripname '' '.exe' "$destfile"
- destfile=$func_stripname_result
- ;;
- esac
- ;;
- esac
- func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
- $opt_dry_run || if test -n "$outputname"; then
- ${RM}r "$tmpdir"
- fi
- ;;
- esac
- done
-
- for file in $staticlibs; do
- func_basename "$file"
- name="$func_basename_result"
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
-
- func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
- fi
-
- # Do each command in the postinstall commands.
- func_execute_cmds "$old_postinstall_cmds" 'exit $?'
- done
-
- test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- $opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
- my_dlsyms=
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
- else
- func_error "not configured to extract global symbols from dlpreopened files"
- fi
- fi
-
- if test -n "$my_dlsyms"; then
- case $my_dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
-
- func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
- # Parse the name list into a source file.
- func_verbose "creating $output_objdir/$my_dlsyms"
-
- $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
-
- $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- for progfile in $progfiles; do
- func_to_tool_file "$progfile" func_convert_file_msys_to_w32
- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
- $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $opt_dry_run || {
- eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- if test -n "$export_symbols_regex"; then
- $opt_dry_run || {
- eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $opt_dry_run || {
- $RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- else
- $opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- fi
- fi
-
- for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
- func_basename "$dlprefile"
- name="$func_basename_result"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- # if an import library, we need to obtain dlname
- if func_win32_import_lib_p "$dlprefile"; then
- func_tr_sh "$dlprefile"
- eval "curr_lafile=\$libfile_$func_tr_sh_result"
- dlprefile_dlbasename=""
- if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
- # Use subshell, to avoid clobbering current variable values
- dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
- if test -n "$dlprefile_dlname" ; then
- func_basename "$dlprefile_dlname"
- dlprefile_dlbasename="$func_basename_result"
- else
- # no lafile. user explicitly requested -dlpreopen <import library>.
- $sharedlib_from_linklib_cmd "$dlprefile"
- dlprefile_dlbasename=$sharedlib_from_linklib_result
- fi
- fi
- $opt_dry_run || {
- if test -n "$dlprefile_dlbasename" ; then
- eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
- else
- func_warning "Could not compute DLL name from $name"
- eval '$ECHO ": $name " >> "$nlist"'
- fi
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
- }
- else # not an import lib
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- fi
- ;;
- *)
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- ;;
- esac
- done
-
- $opt_dry_run || {
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $MV "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if $GREP -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- $GREP -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
- else
- echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
- fi
-
- echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols. */
-typedef struct {
- const char *name;
- void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
-
- case $need_lib_prefix in
- no)
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- *)
- eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- esac
- echo >> "$output_objdir/$my_dlsyms" "\
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- } # !$opt_dry_run
-
- pic_flag_for_symtable=
- case "$compile_command " in
- *" -static "*) ;;
- *)
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
- *-*-hpux*)
- pic_flag_for_symtable=" $pic_flag" ;;
- *)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
- ;;
- esac
- ;;
- esac
- symtab_cflags=
- for arg in $LTCFLAGS; do
- case $arg in
- -pie | -fpie | -fPIE) ;;
- *) func_append symtab_cflags " $arg" ;;
- esac
- done
-
- # Now compile the dynamic symbol file.
- func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
- # Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
- # Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- else
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- fi
- ;;
- *)
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- ;;
- esac
- ;;
- *)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
- fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
- $opt_debug
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- $SED -n -e '
- 1,100{
- / I /{
- s,.*,import,
- p
- q
- }
- }'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
- $opt_debug
- sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
- $opt_debug
- match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
- $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
- $SED '/^Contents of section '"$match_literal"':/{
- # Place marker at beginning of archive member dllname section
- s/.*/====MARK====/
- p
- d
- }
- # These lines can sometimes be longer than 43 characters, but
- # are always uninteresting
- /:[ ]*file format pe[i]\{,1\}-/d
- /^In archive [^:]*:/d
- # Ensure marker is printed
- /^====MARK====/p
- # Remove all lines with less than 43 characters
- /^.\{43\}/!d
- # From remaining lines, remove first 43 characters
- s/^.\{43\}//' |
- $SED -n '
- # Join marker and all lines until next marker into a single line
- /^====MARK====/ b para
- H
- $ b para
- b
- :para
- x
- s/\n//g
- # Remove the marker
- s/^====MARK====//
- # Remove trailing dots and whitespace
- s/[\. \t]*$//
- # Print
- /./p' |
- # we now have a list, one entry per line, of the stringified
- # contents of the appropriate section of all members of the
- # archive which possess that section. Heuristic: eliminate
- # all those which have a first or second character that is
- # a '.' (that is, objdump's representation of an unprintable
- # character.) This should work for all archives with less than
- # 0x302f exports -- but will fail for DLLs whose name actually
- # begins with a literal '.' or a single character followed by
- # a '.'.
- #
- # Of those that remain, print the first one.
- $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
- test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
- test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
- $opt_debug
- if func_cygming_gnu_implib_p "$1" ; then
- # binutils import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
- elif func_cygming_ms_implib_p "$1" ; then
- # ms-generated import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
- else
- # unknown
- sharedlib_from_linklib_result=""
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- if test "$lock_old_archive_extraction" = yes; then
- lockfile=$f_ex_an_ar_oldlib.lock
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- fi
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
- 'stat=$?; rm -f "$lockfile"; exit $stat'
- if test "$lock_old_archive_extraction" = yes; then
- $opt_dry_run || rm -f "$lockfile"
- fi
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
- fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- $opt_debug
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- func_basename "$my_xlib"
- my_xlib="$func_basename_result"
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- func_arith $extracted_serial + 1
- extracted_serial=$func_arith_result
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
-
- func_mkdir_p "$my_xdir"
-
- case $host in
- *-darwin*)
- func_verbose "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- $opt_dry_run || {
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
- darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
- if test -n "$darwin_arches"; then
- darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
- $LIPO -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- $RM -rf unfat-$$
- cd "$darwin_orig_dir"
- else
- cd $darwin_orig_dir
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- } # !$opt_dry_run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
- done
-
- func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=${1-no}
-
- $ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
- generated_by_libtool_version='$macro_version'
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$ECHO are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- file=\"\$0\""
-
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
- $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
- ECHO=\"$qECHO\"
- fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
- lt_script_arg0=\$0
- shift
- for lt_opt
- do
- case \"\$lt_opt\" in
- --lt-debug) lt_option_debug=1 ;;
- --lt-dump-script)
- lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
- test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
- lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
- cat \"\$lt_dump_D/\$lt_dump_F\"
- exit 0
- ;;
- --lt-*)
- \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
- exit 1
- ;;
- esac
- done
-
- # Print the debug banner immediately:
- if test -n \"\$lt_option_debug\"; then
- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
- fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
- lt_dump_args_N=1;
- for lt_arg
- do
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
- lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
- done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
- case \" \$* \" in
- *\\ --lt-*)
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done ;;
- esac
- func_exec_program_core \${1+\"\$@\"}
-}
-
- # Parse options
- func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
- # Find the directory that this script lives in.
- thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
- done
-
- # Usually 'no', except on cygwin/mingw when embedded into
- # the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
- if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
- # special case for '.'
- if test \"\$thisdir\" = \".\"; then
- thisdir=\`pwd\`
- fi
- # remove .libs from thisdir
- case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
- $objdir ) thisdir=. ;;
- esac
- fi
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $ECHO "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $MKDIR \"\$progdir\"
- else
- $RM \"\$progdir/\$file\"
- fi"
-
- $ECHO "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $ECHO \"\$relink_command_output\" >&2
- $RM \"\$progdir/\$file\"
- exit 1
- fi
- fi
-
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $RM \"\$progdir/\$program\";
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $RM \"\$progdir/\$file\"
- fi"
- else
- $ECHO "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $ECHO "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # fixup the dll searchpath if we need to.
- #
- # Fix the DLL searchpath if we need to. Do this before prepending
- # to shlibpath, because on Windows, both are PATH and uninstalled
- # libraries must come first.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $ECHO "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- $ECHO "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
- func_exec_program \${1+\"\$@\"}
- fi
- else
- # The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- exit 1
- fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
- cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-*/
-EOF
- cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-# include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined(__CYGWIN__)
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined (other platforms) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#elif defined(__MINGW32__)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
- cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_path "$temp_rpath"
- cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * LIB_PATH_VALUE = "";
-EOF
- fi
-
- if test -n "$dllsearchpath"; then
- func_to_host_path "$dllsearchpath:"
- cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE = "";
-EOF
- fi
-
- if test "$fast_install" = yes; then
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
- else
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
- fi
-
-
- cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int newargc;
- char *tmp_pathspec;
- char *actual_cwrapper_path;
- char *actual_cwrapper_name;
- char *target_name;
- char *lt_argv_zero;
- intptr_t rval = 127;
-
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, argc + 1);
-
- /* very simple arg parsing; don't want to rely on getopt
- * also, copy all non cwrapper options to newargz, except
- * argz[0], which is handled differently
- */
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], dumpscript_opt) == 0)
- {
-EOF
- case "$host" in
- *mingw* | *cygwin* )
- # make stdout use "unix" line endings
- echo " setmode(1,_O_BINARY);"
- ;;
- esac
-
- cat <<"EOF"
- lt_dump_script (stdout);
- return 0;
- }
- if (strcmp (argv[i], debug_opt) == 0)
- {
- lt_debug = 1;
- continue;
- }
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal (__FILE__, __LINE__,
- "unrecognized %s option: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
-EOF
- cat <<EOF
- /* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-EOF
- cat <<"EOF"
- lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
- lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
- tmp_pathspec = find_executable (argv[0]);
- if (tmp_pathspec == NULL)
- lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (before symlink chase) at: %s\n",
- tmp_pathspec);
-
- actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (after symlink chase) at: %s\n",
- actual_cwrapper_path);
- XFREE (tmp_pathspec);
-
- actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
- strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
- /* wrapper name transforms */
- strendzap (actual_cwrapper_name, ".exe");
- tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
- XFREE (actual_cwrapper_name);
- actual_cwrapper_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- /* target_name transforms -- use actual target program name; might have lt- prefix */
- target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
- strendzap (target_name, ".exe");
- tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
- XFREE (target_name);
- target_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- lt_debugprintf (__FILE__, __LINE__,
- "(main) libtool target name: %s\n",
- target_name);
-EOF
-
- cat <<EOF
- newargz[0] =
- XMALLOC (char, (strlen (actual_cwrapper_path) +
- strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
- strcpy (newargz[0], actual_cwrapper_path);
- strcat (newargz[0], "$objdir");
- strcat (newargz[0], "/");
-EOF
-
- cat <<"EOF"
- /* stop here, and copy so we don't have to do this twice */
- tmp_pathspec = xstrdup (newargz[0]);
-
- /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
- strcat (newargz[0], actual_cwrapper_name);
-
- /* DO want the lt- prefix here if it exists, so use target_name */
- lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
- XFREE (tmp_pathspec);
- tmp_pathspec = NULL;
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- {
- char* p;
- while ((p = strchr (newargz[0], '\\')) != NULL)
- {
- *p = '/';
- }
- while ((p = strchr (lt_argv_zero, '\\')) != NULL)
- {
- *p = '/';
- }
- }
-EOF
- ;;
- esac
-
- cat <<"EOF"
- XFREE (target_name);
- XFREE (actual_cwrapper_path);
- XFREE (actual_cwrapper_name);
-
- lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
- lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
- be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
- because on Windows, both *_VARNAMEs are PATH but uninstalled
- libraries must come first. */
- lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
- lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
- nonnull (lt_argv_zero));
- for (i = 0; i < newargc; i++)
- {
- lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
- i, nonnull (newargz[i]));
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- /* execv doesn't actually work on mingw as expected on unix */
- newargz = prepare_spawn (newargz);
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
- if (rval == -1)
- {
- /* failed to start process */
- lt_debugprintf (__FILE__, __LINE__,
- "(main) failed to launch target \"%s\": %s\n",
- lt_argv_zero, nonnull (strerror (errno)));
- return 127;
- }
- return rval;
-EOF
- ;;
- *)
- cat <<"EOF"
- execv (lt_argv_zero, newargz);
- return rval; /* =127, but avoids unused variable warning */
-EOF
- ;;
- esac
-
- cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
- void *p = (void *) malloc (num);
- if (!p)
- lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
- string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char) name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable (const char *path)
-{
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0)
- && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
- return 1;
- else
- return 0;
-}
-
-int
-make_executable (const char *path)
-{
- int rval = 0;
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if (stat (path, &st) >= 0)
- {
- rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
- }
- return rval;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise
- Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
- int has_slash = 0;
- const char *p;
- const char *p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char *concat_name;
-
- lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
- nonempty (wrapper));
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char *path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char *q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR (*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name =
- XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name =
- XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
- return xstrdup (pathspec);
-#else
- char buf[LT_PATHMAX];
- struct stat s;
- char *tmp_pathspec = xstrdup (pathspec);
- char *p;
- int has_symlinks = 0;
- while (strlen (tmp_pathspec) && !has_symlinks)
- {
- lt_debugprintf (__FILE__, __LINE__,
- "checking path component for symlinks: %s\n",
- tmp_pathspec);
- if (lstat (tmp_pathspec, &s) == 0)
- {
- if (S_ISLNK (s.st_mode) != 0)
- {
- has_symlinks = 1;
- break;
- }
-
- /* search backwards for last DIR_SEPARATOR */
- p = tmp_pathspec + strlen (tmp_pathspec) - 1;
- while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- p--;
- if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- {
- /* no more DIR_SEPARATORS left */
- break;
- }
- *p = '\0';
- }
- else
- {
- lt_fatal (__FILE__, __LINE__,
- "error accessing file \"%s\": %s",
- tmp_pathspec, nonnull (strerror (errno)));
- }
- }
- XFREE (tmp_pathspec);
-
- if (!has_symlinks)
- {
- return xstrdup (pathspec);
- }
-
- tmp_pathspec = realpath (pathspec, buf);
- if (tmp_pathspec == 0)
- {
- lt_fatal (__FILE__, __LINE__,
- "could not follow symlinks for %s", pathspec);
- }
- return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert (str != NULL);
- assert (pat != NULL);
-
- len = strlen (str);
- patlen = strlen (pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp (str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
- va_list args;
- if (lt_debug)
- {
- (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
- }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
- int line, const char *mode,
- const char *message, va_list ap)
-{
- fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
- va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
- return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
- return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_setenv) setting '%s' to '%s'\n",
- nonnull (name), nonnull (value));
- {
-#ifdef HAVE_SETENV
- /* always make a copy, for consistency with !HAVE_SETENV */
- char *str = xstrdup (value);
- setenv (name, str, 1);
-#else
- int len = strlen (name) + 1 + strlen (value) + 1;
- char *str = XMALLOC (char, len);
- sprintf (str, "%s=%s", name, value);
- if (putenv (str) != EXIT_SUCCESS)
- {
- XFREE (str);
- }
-#endif
- }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
- char *new_value;
- if (orig_value && *orig_value)
- {
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
- new_value = XMALLOC (char, add_len + orig_value_len + 1);
- if (to_end)
- {
- strcpy (new_value, orig_value);
- strcpy (new_value + orig_value_len, add);
- }
- else
- {
- strcpy (new_value, add);
- strcpy (new_value + add_len, orig_value);
- }
- }
- else
- {
- new_value = xstrdup (add);
- }
- return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- /* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
- {
- new_value[len-1] = '\0';
- }
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-EOF
- case $host_os in
- mingw*)
- cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
- Note that spawn() does not by itself call the command interpreter
- (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
- ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&v);
- v.dwPlatformId == VER_PLATFORM_WIN32_NT;
- }) ? "cmd.exe" : "command.com").
- Instead it simply concatenates the arguments, separated by ' ', and calls
- CreateProcess(). We must quote the arguments since Win32 CreateProcess()
- interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
- special way:
- - Space and tab are interpreted as delimiters. They are not treated as
- delimiters if they are surrounded by double quotes: "...".
- - Unescaped double quotes are removed from the input. Their only effect is
- that within double quotes, space and tab are treated like normal
- characters.
- - Backslashes not followed by double quotes are not special.
- - But 2*n+1 backslashes followed by a double quote become
- n backslashes followed by a double quote (n >= 0):
- \" -> "
- \\\" -> \"
- \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
- size_t argc;
- char **new_argv;
- size_t i;
-
- /* Count number of arguments. */
- for (argc = 0; argv[argc] != NULL; argc++)
- ;
-
- /* Allocate new argument vector. */
- new_argv = XMALLOC (char *, argc + 1);
-
- /* Put quoted arguments into the new argument vector. */
- for (i = 0; i < argc; i++)
- {
- const char *string = argv[i];
-
- if (string[0] == '\0')
- new_argv[i] = xstrdup ("\"\"");
- else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
- {
- int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
- size_t length;
- unsigned int backslashes;
- const char *s;
- char *quoted_string;
- char *p;
-
- length = 0;
- backslashes = 0;
- if (quote_around)
- length++;
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- length += backslashes + 1;
- length++;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- length += backslashes + 1;
-
- quoted_string = XMALLOC (char, length + 1);
-
- p = quoted_string;
- backslashes = 0;
- if (quote_around)
- *p++ = '"';
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- {
- unsigned int j;
- for (j = backslashes + 1; j > 0; j--)
- *p++ = '\\';
- }
- *p++ = c;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- {
- unsigned int j;
- for (j = backslashes; j > 0; j--)
- *p++ = '\\';
- *p++ = '"';
- }
- *p = '\0';
-
- new_argv[i] = quoted_string;
- }
- else
- new_argv[i] = (char *) string;
- }
- new_argv[argc] = NULL;
-
- return new_argv;
-}
-EOF
- ;;
- esac
-
- cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
- func_emit_wrapper yes |
- $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/ fputs ("\1", f);/p
-g
-D'
- cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
- $opt_debug
- case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
- *import*) : ;;
- *) false ;;
- esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
- $opt_debug
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args=$nonopt
- base_compile="$nonopt $@"
- compile_command=$nonopt
- finalize_command=$nonopt
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
- new_inherited_linker_flags=
-
- avoid_version=no
- bindir=
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
- weak_libs=
- single_module="${wl}-single_module"
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- break
- ;;
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- func_warning "complete static linking is impossible in this configuration"
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- func_append compile_command " @OUTPUT@"
- func_append finalize_command " @OUTPUT@"
- ;;
- esac
-
- case $prev in
- bindir)
- bindir="$arg"
- prev=
- continue
- ;;
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- func_append compile_command " @SYMFILE@"
- func_append finalize_command " @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- func_append dlfiles " $arg"
- else
- func_append dlprefiles " $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- framework)
- case $host in
- *-*-darwin*)
- case "$deplibs " in
- *" $qarg.ltframework "*) ;;
- *) func_append deplibs " $qarg.ltframework" # this is fixed later
- ;;
- esac
- ;;
- esac
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat "$save_arg"`
- do
-# func_append moreargs " $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- done
- else
- func_fatal_error "link input file \`$arg' does not exist"
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) func_append rpath " $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) func_append xrpath " $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- weak)
- func_append weak_libs " $arg"
- prev=
- continue
- ;;
- xcclinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xcompiler)
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xlinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $wl$qarg"
- prev=
- func_append compile_command " $wl$qarg"
- func_append finalize_command " $wl$qarg"
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- # See comment for -static flag below, for more details.
- func_append compile_command " $link_static_flag"
- func_append finalize_command " $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -bindir)
- prev=bindir
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- func_fatal_error "more than one -exported-symbols argument is not allowed"
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework)
- prev=framework
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- func_stripname "-L" '' "$arg"
- if test -z "$func_stripname_result"; then
- if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
- else
- func_fatal_error "need path for \`-L' option"
- fi
- fi
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "* | *" $arg "*)
- # Will only happen for absolute or sysroot arguments
- ;;
- *)
- # Preserve sysroot, but never include relative directories
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
- *) func_append deplibs " -L$dir" ;;
- esac
- func_append lib_search_path " $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- ::) dllsearchpath=$dir;;
- *) func_append dllsearchpath ":$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- func_append deplibs " System.ltframework"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- func_append deplibs " $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- # Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- case "$new_inherited_linker_flags " in
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
- continue
- ;;
-
- -multi_module)
- single_module="${wl}-multi_module"
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
- # The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- func_stripname '-R' '' "$arg"
- dir=$func_stripname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- continue
- ;;
-
- -shared)
- # The effects of -shared are defined in a previous loop.
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -static | -static-libtool-libs)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
-
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -weak)
- prev=weak
- continue
- ;;
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # -msg_* for osf cc
- -msg_*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- # Flags to be passed through unchanged, with rationale:
- # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
- # -r[0-9][0-9]* specify processor for the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
- # +DA*, +DD* enable 64-bit mode for the HP compiler
- # -q* compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
- # -F/path path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
- # @file GCC response files
- # -tp=* Portland pgcc target processor selection
- # --sysroot=* for sysroot support
- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- func_append compiler_flags " $arg"
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- *.$objext)
- # A standard object.
- func_append objs " $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- func_append deplibs " $arg"
- func_append old_deplibs " $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- func_resolve_sysroot "$arg"
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- func_append dlfiles " $func_resolve_sysroot_result"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- func_append dlprefiles " $func_resolve_sysroot_result"
- prev=
- else
- func_append deplibs " $func_resolve_sysroot_result"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
- done # argument parsing loop
-
- test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- func_basename "$output"
- outputname="$func_basename_result"
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
- func_to_tool_file "$output_objdir/"
- tool_output_objdir=$func_to_tool_file_result
- # Create the object directory.
- func_mkdir_p "$output_objdir"
-
- # Determine the type of output
- case $output in
- "")
- func_fatal_help "you must specify an output file"
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if $opt_preserve_dup_deps ; then
- case "$libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append libs " $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if $opt_duplicate_compiler_generated_deps; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
- esac
- func_append pre_post_deps " $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- notinst_path= # paths that contain not-installed libtool libraries
-
- case $linkmode in
- lib)
- passes="conv dlpreopen link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
-
- for pass in $passes; do
- # The preopen pass in lib mode reverses $deplibs; put it back here
- # so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
- ## FIXME: Find the place where the list is rebuilt in the wrong
- ## order, and fix it there properly
- tmp_deplibs=
- for deplib in $deplibs; do
- tmp_deplibs="$deplib $tmp_deplibs"
- done
- deplibs="$tmp_deplibs"
- fi
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
- esac
- fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
- # Collect and forward deplibs of preopened libtool libs
- for lib in $dlprefiles; do
- # Ignore non-libtool-libs
- dependency_libs=
- func_resolve_sysroot "$lib"
- case $lib in
- *.la) func_source "$func_resolve_sysroot_result" ;;
- esac
-
- # Collect preopened libtool deplibs, except any this library
- # has declared as weak libs
- for deplib in $dependency_libs; do
- func_basename "$deplib"
- deplib_base=$func_basename_result
- case " $weak_libs " in
- *" $deplib_base "*) ;;
- *) func_append deplibs " $deplib" ;;
- esac
- done
- done
- libs="$dlprefiles"
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
-
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append compiler_flags " $deplib"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
- continue
- fi
- func_stripname '-l' '' "$deplib"
- name=$func_stripname_result
- if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
- else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
- fi
- for searchdir in $searchdirs; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if func_lalib_p "$lib"; then
- library_names=
- old_library=
- func_source "$lib"
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- *.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- *)
- func_warning "\`-L' is ignored for archives/objects"
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- func_stripname '-R' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la)
- func_resolve_sysroot "$deplib"
- lib=$func_resolve_sysroot_result
- ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
- case " $dlpreconveniencelibs " in
- *" $deplib "*) ;;
- *)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- ;;
- esac
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- func_append newdlprefiles " $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append newdlfiles " $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
-
- if test "$found" = yes || test -f "$lib"; then :
- else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- fi
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
-
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- inherited_linker_flags=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- func_source "$lib"
-
- # Convert "-framework foo" to "foo.ltframework"
- if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
- for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- case " $new_inherited_linker_flags " in
- *" $tmp_inherited_linker_flag "*) ;;
- *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
- esac
- done
- fi
- dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && func_append dlfiles " $dlopen"
- test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
- # It is a libtool convenience library, so add in its objects.
- func_append convenience " $ladir/$objdir/$old_library"
- func_append old_convenience " $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- if test -n "$old_library" &&
- { test "$prefer_static_libs" = yes ||
- test "$prefer_static_libs,$installed" = "built,no"; }; then
- linklib=$old_library
- else
- for l in $old_library $library_names; do
- linklib="$l"
- done
- fi
- if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- func_append dlprefiles " $lib $dependency_libs"
- else
- func_append newdlfiles " $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
- func_warning "passing it literally to the linker, although it might fail"
- abs_ladir="$ladir"
- fi
- ;;
- esac
- func_basename "$lib"
- laname="$func_basename_result"
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library \`$lib' was moved."
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- fi
- fi # $installed = yes
- func_stripname 'lib' '.la' "$laname"
- name=$func_stripname_result
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- fi
- case "$host" in
- # special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
- # Linker will automatically link against shared library if both
- # static and shared are present. Therefore, ensure we extract
- # symbols from the import library if a shared library is present
- # (otherwise, the dlopen module name will be incorrect). We do
- # this by putting the import library name into $newdlprefiles.
- # We recover the dlopen module name by 'saving' the la file
- # name in a special purpose variable, and (later) extracting the
- # dlname from the la file.
- if test -n "$dlname"; then
- func_tr_sh "$dir/$linklib"
- eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
- func_append newdlprefiles " $dir/$linklib"
- else
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- fi
- ;;
- * )
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- func_append newdlprefiles " $dir/$dlname"
- else
- func_append newdlprefiles " $dir/$linklib"
- fi
- ;;
- esac
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- func_append newlib_search_path " $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
- *"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc*)
- # No point in relinking DLLs because paths are not encoded
- func_append notinst_deplibs " $lib"
- need_relink=no
- ;;
- *)
- if test "$installed" = no; then
- func_append notinst_deplibs " $lib"
- need_relink=yes
- fi
- ;;
- esac
- # This is a shared library
-
- # Warn about portability, can't link against -module's on some
- # systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
- for dlpremoduletest in $dlprefiles; do
- if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
- break
- fi
- done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- echo
- if test "$linkmode" = prog; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
- else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $ECHO "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- shift
- realname="$1"
- shift
- libname=`eval "\\$ECHO \"$libname_spec\""`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc*)
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- func_basename "$soroot"
- soname="$func_basename_result"
- func_stripname 'lib' '.dll' "$soname"
- newlib=libimp-$func_stripname_result.a
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- func_verbose "extracting exported symbol list from \`$soname'"
- func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
- func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$opt_mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
- # link against it, someone is ignoring the earlier warnings
- if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
- if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- elif test -n "$old_library"; then
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$absdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- func_fatal_configuration "unsupported hardcode properties"
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) func_append compile_shlibpath "$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$opt_mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system can not link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) func_stripname '-R' '' "$libdir"
- temp_xrpath=$func_stripname_result
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) func_append xrpath " $temp_xrpath";;
- esac;;
- *) func_append temp_deplibs " $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- func_append newlib_search_path " $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result";;
- *) func_resolve_sysroot "$deplib" ;;
- esac
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $func_resolve_sysroot_result "*)
- func_append specialdeplibs " $func_resolve_sysroot_result" ;;
- esac
- fi
- func_append tmp_libs " $func_resolve_sysroot_result"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- path=
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- func_resolve_sysroot "$deplib"
- deplib=$func_resolve_sysroot_result
- func_dirname "$deplib" "" "."
- dir=$func_dirname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
- absdir="$dir"
- fi
- ;;
- esac
- if $GREP "^installed=no" $deplib > /dev/null; then
- case $host in
- *-*-darwin*)
- depdepl=
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- fi
- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
- path=
- fi
- fi
- ;;
- *)
- path="-L$absdir/$objdir"
- ;;
- esac
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
-
- path="-L$absdir"
- fi
- ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
- compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- else
- compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- fi
- fi
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) func_append lib_search_path " $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- func_append tmp_libs " $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
-
- test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- func_append objs "$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- func_stripname 'lib' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- func_stripname '' '.la' "$outputname"
- libname=$func_stripname_result
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
- func_append libobjs " $objs"
- fi
- fi
-
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
-
- set dummy $rpath
- shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
-
- install_libdir="$1"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- shift
- IFS="$save_ifs"
-
- test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- # correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|qnx|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_minor"
- lt_irix_increment=no
- ;;
- *)
- func_fatal_configuration "$modename: unknown library version type \`$version_type'"
- ;;
- esac
- ;;
- no)
- current="$1"
- revision="$2"
- age="$3"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- func_arith $current + 1
- minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current"
- ;;
-
- irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
- func_arith $current - $age
- else
- func_arith $current - $age + 1
- fi
- major=$func_arith_result
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- func_arith $revision - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux) # correct to gnu/linux during the next big refactor
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- func_arith $current - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- func_append verstring ":${current}.0"
- ;;
-
- qnx)
- major=".$current"
- versuffix=".$current"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
-
- *)
- func_fatal_configuration "unknown library version type \`$version_type'"
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- func_warning "undefined symbols not allowed in $host shared libraries"
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
-
- fi
-
- func_generate_dlsyms "$libname" "$libname" "yes"
- func_append libobjs " $symfileobj"
- test "X$libobjs" = "X " && libobjs=
-
- if test "$opt_mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$ECHO "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext | *.gcno)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- func_append removelist " $p"
- ;;
- *) ;;
- esac
- done
- test -n "$removelist" && \
- func_show_eval "${RM}r \$removelist"
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- func_append oldlibs " $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
- # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
- # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
- #done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- func_replace_sysroot "$libdir"
- func_append temp_xrpath " -R$func_replace_sysroot_result"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) func_append dlfiles " $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) func_append dlprefiles " $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- func_append deplibs " System.ltframework"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- func_append deplibs " -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method; shift
- file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- if test -n "$file_magic_glob"; then
- libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
- else
- libnameglob=$libname
- fi
- test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- if test "$want_nocaseglob" = yes; then
- shopt -s nocaseglob
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- $nocaseglob
- else
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- fi
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null |
- $GREP " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- $SED -e 10q |
- $EGREP "$file_magic_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
- $EGREP "$match_pattern_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
- done
- fi
- case $tmp_deplibs in
- *[!\ \ ]*)
- echo
- if test "X$deplibs_check_method" = "Xnone"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- ;;
- esac
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- echo "*** The inter-library dependencies that have been dropped here will be"
- echo "*** automatically added whenever a program is linked with this library"
- echo "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- echo
- echo "*** Since this library must not contain undefined symbols,"
- echo "*** because either the platform does not support them or"
- echo "*** it was explicitly requested with -no-undefined,"
- echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- case $host in
- *-*-darwin*)
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- # Remove ${wl} instances when linking with ld.
- # FIXME: should test the right _cmds variable.
- case $archive_cmds in
- *\$LD\ *) wl= ;;
- esac
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append dep_rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- shift
- realname="$1"
- shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- func_append linknames " $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- test "X$libobjs" = "X " && libobjs=
-
- delfiles=
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
- func_append delfiles " $export_symbols"
- fi
-
- orig_export_symbols=
- case $host_os in
- cygwin* | mingw* | cegcc*)
- if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- # exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- # and it's NOT already a .def file. Must figure out
- # which of the given symbols are data symbols and tag
- # them as such. So, trigger use of export_symbols_cmds.
- # export_symbols gets reassigned inside the "prepare
- # the list of exported symbols" if statement, so the
- # include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
- export_symbols=
- always_export_symbols=yes
- fi
- fi
- ;;
- esac
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd1 in $cmds; do
- IFS="$save_ifs"
- # Take the normal branch if the nm_file_list_spec branch
- # doesn't work or if tool conversion is not needed.
- case $nm_file_list_spec~$to_tool_file_cmd in
- *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
- try_normal_branch=yes
- eval cmd=\"$cmd1\"
- func_len " $cmd"
- len=$func_len_result
- ;;
- *)
- try_normal_branch=no
- ;;
- esac
- if test "$try_normal_branch" = yes \
- && { test "$len" -lt "$max_cmd_len" \
- || test "$max_cmd_len" -le -1; }
- then
- func_show_eval "$cmd" 'exit $?'
- skipped_export=false
- elif test -n "$nm_file_list_spec"; then
- func_basename "$output"
- output_la=$func_basename_result
- save_libobjs=$libobjs
- save_output=$output
- output=${output_objdir}/${output_la}.nm
- func_to_tool_file "$output"
- libobjs=$nm_file_list_spec$func_to_tool_file_result
- func_append delfiles " $output"
- func_verbose "creating $NM input file list: $output"
- for obj in $save_libobjs; do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > "$output"
- eval cmd=\"$cmd1\"
- func_show_eval "$cmd" 'exit $?'
- output=$save_output
- libobjs=$save_libobjs
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- func_verbose "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- func_append tmp_deplibs " $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
- test -z "$libobjs"; then
- # extract the archives, so we have objects to list.
- # TODO: could optimize this to just extract one archive.
- whole_archive_flag_spec=
- fi
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- else
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- func_append linker_flags " $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- func_len " $test_cmds" &&
- len=$func_len_result &&
- test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise
- # or, if using GNU ld and skipped_export is not :, use a linker
- # script.
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- func_basename "$output"
- output_la=$func_basename_result
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- last_robj=
- k=1
-
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
- func_verbose "creating linker input file list: $output"
- : > $output
- set x $save_libobjs
- shift
- firstobj=
- if test "$compiler_needs_object" = yes; then
- firstobj="$1 "
- shift
- fi
- for obj
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
- else
- if test -n "$save_libobjs"; then
- func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
- eval test_cmds=\"$reload_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
-
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- if test "X$objlist" = X ||
- test "$len" -lt "$max_cmd_len"; then
- func_append objlist " $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- reload_objs=$objlist
- eval concat_cmds=\"$reload_cmds\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- func_arith $k + 1
- k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
- objlist=" $obj"
- func_len " $last_robj"
- func_arith $len0 + $func_len_result
- len=$func_arith_result
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
- fi
- func_append delfiles " $output"
-
- else
- output=
- fi
-
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- fi
- fi
-
- test -n "$save_libobjs" &&
- func_verbose "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
-
- if ${skipped_export-false}; then
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
- fi
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
- fi
-
- if test -n "$delfiles"; then
- # Append the command to remove temporary files to $cmds.
- eval cmds=\"\$cmds~\$RM $delfiles\"
- fi
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
-
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- func_show_eval '${RM}r "$gentop"'
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
-
- case $output in
- *.lo)
- test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
- libobj=$output
- func_lo2o "$libobj"
- obj=$func_lo2o_result
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $opt_dry_run || $RM $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
- else
- gentop="$output_objdir/${obj}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # If we're not building shared, we need to use non_pic_objs
- test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- func_execute_cmds "$reload_cmds" 'exit $?'
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- func_execute_cmds "$reload_cmds" 'exit $?'
- fi
-
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) func_stripname '' '.exe' "$output"
- output=$func_stripname_result.exe;;
- esac
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
-
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- case $host in
- *-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- func_append compile_command " ${wl}-bind_at_load"
- func_append finalize_command " ${wl}-bind_at_load"
- ;;
- esac
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- func_append compile_command " $compile_deplibs"
- func_append finalize_command " $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- ::) dllsearchpath=$libdir;;
- *) func_append dllsearchpath ":$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- fi
-
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
- # template prelinking step
- if test -n "$prelink_cmds"; then
- func_execute_cmds "$prelink_cmds" 'exit $?'
- fi
-
- wrappers_required=yes
- case $host in
- *cegcc* | *mingw32ce*)
- # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=no
- ;;
- *cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- *)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- esac
- if test "$wrappers_required" = no; then
- # Replace the output file specification.
- compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- exit_status=0
- func_show_eval "$link_command" 'exit_status=$?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
- fi
-
- exit $exit_status
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- func_append rpath "$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $opt_dry_run || $RM $output
- # Link the executable and exit
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output_objdir/$outputname"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Now create the wrapper script.
- func_verbose "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- fi
-
- # Only actually do things if not in dry run mode.
- $opt_dry_run || {
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) func_stripname '' '.exe' "$output"
- output=$func_stripname_result ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- func_stripname '' '.exe' "$outputname"
- outputname=$func_stripname_result ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- func_dirname_and_basename "$output" "" "."
- output_name=$func_basename_result
- output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_cwrapperexe_src > $cwrappersource
-
- # The wrapper executable is built using the $host compiler,
- # because it contains $host paths and files. If cross-
- # compiling, it, like the target executable, must be
- # executed on the $host or under an emulation environment.
- $opt_dry_run || {
- $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
- $STRIP $cwrapper
- }
-
- # Now, create the wrapper script for func_source use:
- func_ltwrapper_scriptname $cwrapper
- $RM $func_ltwrapper_scriptname_result
- trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
- $opt_dry_run || {
- # note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
- else
- func_emit_wrapper no > $func_ltwrapper_scriptname_result
- fi
- }
- ;;
- * )
- $RM $output
- trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_wrapper no > $output
- chmod +x $output
- ;;
- esac
- }
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save $symfileobj"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- func_append oldobjs " $symfileobj"
- fi
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $addlibs
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- func_basename "$obj"
- $ECHO "$func_basename_result"
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- echo "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
- func_mkdir_p "$gentop"
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- func_basename "$obj"
- objbase="$func_basename_result"
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- func_arith $counter + 1
- counter=$func_arith_result
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- func_append oldobjs " $gentop/$newobj"
- ;;
- *) func_append oldobjs " $obj" ;;
- esac
- done
- fi
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
- eval cmds=\"$old_archive_cmds\"
-
- func_len " $cmds"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- elif test -n "$archiver_list_spec"; then
- func_verbose "using command file archive linking..."
- for obj in $oldobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > $output_objdir/$libname.libcmd
- func_to_tool_file "$output_objdir/$libname.libcmd"
- oldobjs=" $archiver_list_spec$func_to_tool_file_result"
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- func_verbose "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
- oldobjs=
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- eval test_cmds=\"$old_archive_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
- for obj in $save_oldobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- func_append objlist " $obj"
- if test "$len" -lt "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- len=$len0
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- func_execute_cmds "$cmds" 'exit $?'
- done
-
- test -n "$generated" && \
- func_show_eval "${RM}r$generated"
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- func_verbose "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
- # Only create the output if not a dry run.
- $opt_dry_run || {
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- func_basename "$deplib"
- name="$func_basename_result"
- func_resolve_sysroot "$deplib"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
- ;;
- -L*)
- func_stripname -L '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -L$func_replace_sysroot_result"
- ;;
- -R*)
- func_stripname -R '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -R$func_replace_sysroot_result"
- ;;
- *) func_append newdependency_libs " $deplib" ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
-
- for lib in $dlfiles; do
- case $lib in
- *.la)
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- *) func_append newdlfiles " $lib" ;;
- esac
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- *.la)
- # Only pass preopened files to the pseudo-archive (for
- # eventual linking with the app. that links it) if we
- # didn't already link the preopened objects directly into
- # the library:
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- esac
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlfiles " $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlprefiles " $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $RM $output
- # place dlname in correct position for cygwin
- # In fact, it would be nice if we could use this code for all target
- # systems that can't hard-code library paths into their executables
- # and that have no shared library path variable independent of PATH,
- # but it turns out we can't easily determine that from inspecting
- # libtool variables, so we have to hard-code the OSs to which it
- # applies here; at the moment, that means platforms that use the PE
- # object format with DLL files. See the long comment at the top of
- # tests/bindir.at for full details.
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
- # If a -bindir argument was supplied, place the dll there.
- if test "x$bindir" != x ;
- then
- func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result$dlname
- else
- # Otherwise fall back on heuristic.
- tdlname=../bin/$dlname
- fi
- ;;
- esac
- $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $ECHO >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- }
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
- ;;
- esac
- exit $EXIT_SUCCESS
-}
-
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
- func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
- $opt_debug
- RM="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) func_append RM " $arg"; rmforce=yes ;;
- -*) func_append RM " $arg" ;;
- *) func_append files " $arg" ;;
- esac
- done
-
- test -z "$RM" && \
- func_fatal_help "you must specify an RM program"
-
- rmdirs=
-
- for file in $files; do
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- odir="$objdir"
- else
- odir="$dir/$objdir"
- fi
- func_basename "$file"
- name="$func_basename_result"
- test "$opt_mode" = uninstall && odir="$dir"
-
- # Remember odir for removal later, being careful to avoid duplicates
- if test "$opt_mode" = clean; then
- case " $rmdirs " in
- *" $odir "*) ;;
- *) func_append rmdirs " $odir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if { test -L "$file"; } >/dev/null 2>&1 ||
- { test -h "$file"; } >/dev/null 2>&1 ||
- test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- func_source $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- func_append rmfiles " $odir/$n"
- done
- test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
- case "$opt_mode" in
- clean)
- case " $library_names " in
- *" $dlname "*) ;;
- *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
- esac
- test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if func_lalib_p "$file"; then
-
- # Read the .lo file
- func_source $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
- func_append rmfiles " $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
- func_append rmfiles " $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$opt_mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- func_stripname '' '.exe' "$name"
- noexename=$func_stripname_result
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- func_append rmfiles " $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- relink_command=
- func_source $func_ltwrapper_scriptname_result
- func_append rmfiles " $func_ltwrapper_scriptname_result"
- else
- relink_command=
- func_source $dir/$noexename
- fi
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- func_append rmfiles " $odir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- func_show_eval "$RM $rmfiles" 'exit_status=1'
- done
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- func_show_eval "rmdir $dir >/dev/null 2>&1"
- fi
- done
-
- exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
-
-test -z "$opt_mode" && {
- help="$generic_help"
- func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$opt_mode'"
-
-if test -n "$exec_cmd"; then
- eval exec "$exec_cmd"
- exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
diff --git a/src/3rd_party/dbus-1.7.8/m4/as-ac-expand.m4 b/src/3rd_party/dbus-1.7.8/m4/as-ac-expand.m4
deleted file mode 100644
index deebd2bf81..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/as-ac-expand.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
-dnl autostars m4 macro for expanding directories using configure's prefix
-
-dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
-
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
-
-dnl example:
-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
-
-AC_DEFUN([AS_AC_EXPAND],
-[
- EXP_VAR=[$1]
- FROM_VAR=[$2]
-
- dnl first expand prefix and exec_prefix if necessary
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- dnl if no prefix given, then use /usr/local, the default prefix
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- dnl if no exec_prefix given, then use prefix
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- dnl loop until it doesn't change anymore
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- dnl clean up
- full_var=$new_full_var
- AC_SUBST([$1], "$full_var")
-
- dnl restore prefix and exec_prefix
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-])
diff --git a/src/3rd_party/dbus-1.7.8/m4/compiler.m4 b/src/3rd_party/dbus-1.7.8/m4/compiler.m4
deleted file mode 100644
index 5a197ada63..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/compiler.m4
+++ /dev/null
@@ -1,67 +0,0 @@
-# compiler.m4 - autoconf macros for compiler settings
-#
-# Copyright © 2005 Scott James Remnant <scott@netsplit.com>.
-#
-# 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.
-
-
-# COMPILER_WARNINGS
-# ----------------------
-# Add configure option to enable additional compiler warnings and treat
-# them as errors.
-AC_DEFUN([COMPILER_WARNINGS],
-[AC_ARG_ENABLE(compiler-warnings,
- AS_HELP_STRING([--enable-compiler-warnings],
- [Enable additional compiler warnings]),
-[if test "x$enable_compiler_warnings" = "xyes"; then
- if test "x$GCC" = "xyes"; then
- CFLAGS="-Wall -Werror $CFLAGS"
- fi
- if test "x$GXX" = "xyes"; then
- CXXFLAGS="-Wall -Werror $CXXFLAGS"
- fi
-fi])dnl
-])# COMPILER_WARNINGS
-
-# COMPILER_OPTIMISATIONS
-# ---------------------------
-# Add configure option to disable optimisations.
-AC_DEFUN([COMPILER_OPTIMISATIONS],
-[AC_ARG_ENABLE(compiler-optimisations,
- AS_HELP_STRING([--disable-compiler-optimisations],
- [Disable compiler optimisations]),
-[if test "x$enable_compiler_optimisations" = "xno"; then
- [CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"`]
-fi])dnl
-])# COMPILER_OPTIMISATIONS
-
-# COMPILER_COVERAGE
-# ----------------------
-# Add configure option to enable coverage data.
-AC_DEFUN([COMPILER_COVERAGE],
-[AC_ARG_ENABLE(compiler-coverage,
- AS_HELP_STRING([--enable-compiler-coverage],
- [Enable generation of coverage data]),
-[if test "x$enable_compiler_coverage" = "xyes"; then
- if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
- fi
-fi],[enable_compiler_coverage=no])dnl
-])# COMPILER_COVERAGE
diff --git a/src/3rd_party/dbus-1.7.8/m4/libtool.m4 b/src/3rd_party/dbus-1.7.8/m4/libtool.m4
deleted file mode 100644
index 02b4bbec52..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/libtool.m4
+++ /dev/null
@@ -1,7991 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
- [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script. The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- _LT_PROG_REPLACE_SHELLFNS
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-# autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
- [C], [_LT_LANG(C)],
- [C++], [_LT_LANG(CXX)],
- [Go], [_LT_LANG(GO)],
- [Java], [_LT_LANG(GCJ)],
- [Fortran 77], [_LT_LANG(F77)],
- [Fortran], [_LT_LANG(FC)],
- [Windows Resource], [_LT_LANG(RC)],
- [m4_ifdef([_LT_LANG_]$1[_CONFIG],
- [_LT_LANG($1)],
- [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
- [LT_SUPPORTED_TAG([$1])dnl
- m4_append([_LT_TAGS], [$1 ])dnl
- m4_define([_LT_LANG_]$1[_enabled], [])dnl
- _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC], [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
- if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
- fi
-fi
-if test -z "$GOC"; then
- AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [LT_LANG(CXX)],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
- [LT_LANG(F77)],
- [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
- [LT_LANG(FC)],
- [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
- [LT_LANG(GCJ)],
- [m4_ifdef([AC_PROG_GCJ],
- [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([A][M_PROG_GCJ],
- [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([LT_PROG_GCJ],
- [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
- [LT_LANG(GO)],
- [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
- [LT_LANG(RC)],
- [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
-
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
-
- AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
- [lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
- [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
- lt_aix_libpath_sed='[
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }]'
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi],[])
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
- fi
- ])
- aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-case "$ECHO" in
- printf*) AC_MSG_RESULT([printf]) ;;
- print*) AC_MSG_RESULT([print -r]) ;;
- *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
- test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test "X`printf %s $ECHO`" = "X$ECHO" \
- || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[ --with-sysroot[=DIR] Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted. We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- AC_MSG_RESULT([${with_sysroot}])
- AC_MSG_ERROR([The sysroot must be an absolute path.])
- ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
- [lt_cv_ar_at_file=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
- [echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
- ])
- ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
- [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
- [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
- [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[23]].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[[3-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
- [lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [lt_cv_shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
- ])
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
- [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
- [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
- [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
- AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
- [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&AS_MESSAGE_LOG_FD
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
- esac
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT@&t@_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
- [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Intel*\ [[CF]]*Compiler*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- *Portland\ Group*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
- *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- m4_if($1, [], [
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- _LT_LINKER_OPTION([if $CC understands -b],
- _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
- [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
- [lt_cv_irix_exported_symbol],
- [save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(
- [AC_LANG_SOURCE(
- [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
- [C++], [[int foo (void) { return 0; }]],
- [Fortran 77], [[
- subroutine foo
- end]],
- [Fortran], [[
- subroutine foo
- end]])])],
- [lt_cv_irix_exported_symbol=yes],
- [lt_cv_irix_exported_symbol=no])
- LDFLAGS="$save_LDFLAGS"])
- if test "$lt_cv_irix_exported_symbol" = yes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_CACHE_CHECK([whether -lc should be explicitly linked in],
- [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
- [$RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- ])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
- [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report which library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
- _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case ${prev}${p} in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test "$pre_test_object_deps_done" = no; then
- case ${prev} in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${F77-"f77"}
- CFLAGS=$FFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
- CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${FC-"f95"}
- CFLAGS=$FCFLAGS
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
- func_split_long_opt_name=${1%%=*}
- func_split_long_opt_arg=${1#*=}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-
- _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-
- _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
- func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
- eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
- [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
- [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/src/3rd_party/dbus-1.7.8/m4/ltoptions.m4 b/src/3rd_party/dbus-1.7.8/m4/ltoptions.m4
deleted file mode 100644
index 5d9acd8e23..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/ltoptions.m4
+++ /dev/null
@@ -1,384 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/src/3rd_party/dbus-1.7.8/m4/ltsugar.m4 b/src/3rd_party/dbus-1.7.8/m4/ltsugar.m4
deleted file mode 100644
index 9000a057d3..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/src/3rd_party/dbus-1.7.8/m4/ltversion.m4 b/src/3rd_party/dbus-1.7.8/m4/ltversion.m4
deleted file mode 100644
index 07a8602d48..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/src/3rd_party/dbus-1.7.8/m4/lt~obsolete.m4 b/src/3rd_party/dbus-1.7.8/m4/lt~obsolete.m4
deleted file mode 100644
index c573da90c5..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/src/3rd_party/dbus-1.7.8/m4/pkg.m4 b/src/3rd_party/dbus-1.7.8/m4/pkg.m4
deleted file mode 100644
index 64be7479eb..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/pkg.m4
+++ /dev/null
@@ -1,155 +0,0 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_ifval([$2], [$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
-
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
- [pkg_failed=yes])
- else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
- ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT
-])],
- [AC_MSG_RESULT([no])
- $4])
-elif test $pkg_failed = untried; then
- ifelse([$4], , [AC_MSG_FAILURE(dnl
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
- [$4])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- ifelse([$3], , :, [$3])
-fi[]dnl
-])# PKG_CHECK_MODULES
diff --git a/src/3rd_party/dbus-1.7.8/m4/tp-compiler-flag.m4 b/src/3rd_party/dbus-1.7.8/m4/tp-compiler-flag.m4
deleted file mode 100644
index 06deaba058..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/tp-compiler-flag.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-dnl A version of AS_COMPILER_FLAG that supports both C and C++.
-dnl Based on:
-
-dnl as-compiler-flag.m4 0.1.0
-dnl autostars m4 macro for detection of compiler flags
-dnl David Schleef <ds@schleef.org>
-dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
-
-dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
-dnl Tries to compile with the given CFLAGS and CXXFLAGS.
-dnl
-dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected
-dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise.
-
-AC_DEFUN([TP_COMPILER_FLAG],
-[
- AC_MSG_CHECKING([to see if compiler understands $1])
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CFLAGS="$CFLAGS $1"
- CXXFLAGS="$CXXFLAGS $1"
-
- AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-
- if test "X$flag_ok" = Xyes ; then
- $2
- true
- else
- $3
- true
- fi
- AC_MSG_RESULT([$flag_ok])
-])
-
-dnl TP_ADD_COMPILER_FLAG(VARIABLE, CFLAGS)
-dnl Append CFLAGS to VARIABLE if the compiler supports them.
-AC_DEFUN([TP_ADD_COMPILER_FLAG],
-[
- TP_COMPILER_FLAG([$2], [$1="[$]$1 $2"])
-])
diff --git a/src/3rd_party/dbus-1.7.8/m4/tp-compiler-warnings.m4 b/src/3rd_party/dbus-1.7.8/m4/tp-compiler-warnings.m4
deleted file mode 100644
index ee4af31013..0000000000
--- a/src/3rd_party/dbus-1.7.8/m4/tp-compiler-warnings.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-dnl TP_COMPILER_WARNINGS(VARIABLE, WERROR_BY_DEFAULT, DESIRABLE, UNDESIRABLE)
-dnl $1 (VARIABLE): the variable to put flags into
-dnl $2 (WERROR_BY_DEFAULT): a command returning true if -Werror should be the
-dnl default
-dnl $3 (DESIRABLE): warning flags we want (e.g. all extra shadow)
-dnl $4 (UNDESIRABLE): warning flags we don't want (e.g.
-dnl missing-field-initializers unused-parameter)
-AC_DEFUN([TP_COMPILER_WARNINGS],
-[
- AC_REQUIRE([AC_ARG_ENABLE])dnl
- AC_REQUIRE([AC_HELP_STRING])dnl
- AC_REQUIRE([TP_COMPILER_FLAG])dnl
-
- tp_warnings=""
- for tp_flag in $3; do
- TP_COMPILER_FLAG([-W$tp_flag], [tp_warnings="$tp_warnings -W$tp_flag"])
- done
-
- tp_error_flags="-Werror"
- TP_COMPILER_FLAG([-Werror], [tp_werror=yes], [tp_werror=no])
-
- for tp_flag in $4; do
- TP_COMPILER_FLAG([-Wno-$tp_flag],
- [tp_warnings="$tp_warnings -Wno-$tp_flag"])
-dnl Yes, we do need to use both -Wno-foo and -Wno-error=foo. Simon says:
-dnl some warnings we explicitly don't want, like unused-parameter, but
-dnl they're in -Wall. when a distro using cdbs compiles us, we have:
-dnl -Werror -Wno-unused-parameter -Wall
-dnl ^ from us ^ from cdbs
-dnl which turns -Wunused-parameter back on, in effect
- TP_COMPILER_FLAG([-Wno-error=$tp_flag],
- [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no])
- done
-
- AC_ARG_ENABLE([Werror],
- AC_HELP_STRING([--disable-Werror],
- [compile without -Werror (normally enabled in development builds)]),
- tp_werror=$enableval, :)
-
- if test "x$tp_werror" = xyes && $2; then
-dnl We put -Wno-error=foo before -Wno-foo because clang interprets -Wall
-dnl -Werror -Wno-foo -Wno-error=foo as “make foo a non-fatal warning”, but does
-dnl what we want if you reverse them.
- $1="$tp_error_flags $tp_warnings"
- else
- $1="$tp_warnings"
- fi
-
-])
diff --git a/src/3rd_party/dbus-1.7.8/missing b/src/3rd_party/dbus-1.7.8/missing
deleted file mode 100755
index cdea514931..0000000000
--- a/src/3rd_party/dbus-1.7.8/missing
+++ /dev/null
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2012-06-26.16; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-case $1 in
-
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
-
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
- ;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
- -e '2,$s/^/ /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/3rd_party/dbus-1.7.8/test/Makefile.am b/src/3rd_party/dbus-1.7.8/test/Makefile.am
deleted file mode 100644
index 870ce32130..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/Makefile.am
+++ /dev/null
@@ -1,375 +0,0 @@
-## the "name-test" subdir in fact contains a bunch of tests now that need a temporary bus
-## to be running to do stuff with. The directory should be renamed.
-## We want to build the current directory first to pick up the testutils lib
-SUBDIRS= . name-test
-DIST_SUBDIRS=name-test
-
-# CPPFLAGS for binaries that are normally dynamic
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(DBUS_STATIC_BUILD_CPPFLAGS) \
- $(GLIB_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
- $(NULL)
-
-# improve backtraces from test stuff
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-# CPPFLAGS for binaries that are always static
-static_cppflags = \
- $(AM_CPPFLAGS) \
- -DDBUS_STATIC_BUILD \
- -DDBUS_COMPILATION \
- -DDBUS_TEST_USE_INTERNAL \
- $(NULL)
-
-noinst_LTLIBRARIES = libdbus-testutils-internal.la
-
-# You can link either libdbus-testutils, dbus-glib and libdbus-1,
-# or libdbus-testutils-internal and libdbus-internal - never both in the
-# same binary.
-if DBUS_WITH_DBUS_GLIB
-noinst_LTLIBRARIES += libdbus-testutils.la
-libdbus_testutils_la_SOURCES = \
- test-utils.c \
- test-utils.h \
- $(NULL)
-libdbus_testutils_la_LIBADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS) \
- $(NULL)
-testutils_shared_if_possible_cppflags = $(AM_CPPFLAGS)
-testutils_shared_if_possible_libs = libdbus-testutils.la
-else
-testutils_shared_if_possible_cppflags = $(static_cppflags)
-testutils_shared_if_possible_libs = libdbus-testutils-internal.la
-endif
-
-libdbus_testutils_internal_la_CPPFLAGS = \
- $(static_cppflags) \
- $(NULL)
-libdbus_testutils_internal_la_SOURCES = \
- test-utils.c \
- test-utils.h \
- $(NULL)
-libdbus_testutils_internal_la_LIBADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(NULL)
-
-if DBUS_ENABLE_EMBEDDED_TESTS
-## break-loader removed for now
-## these binaries are used in tests but are not themselves tests
-TEST_BINARIES = \
- spawn-test \
- test-exit \
- test-names \
- test-segfault \
- test-service \
- test-shell-service \
- test-sleep-forever \
- $(NULL)
-
-## These are conceptually part of directories that come earlier in SUBDIRS
-## order, but we don't want to run them til we arrive in this directory,
-## since they depend on stuff from this directory
-TESTS = \
- ../bus/bus-test$(EXEEXT) \
- ../bus/bus-test-system$(EXEEXT) \
- ../dbus/dbus-test$(EXEEXT) \
- $(NULL)
-
-if DBUS_UNIX
-TESTS += ../bus/bus-test-launch-helper$(EXEEXT)
-endif
-
-else !DBUS_ENABLE_EMBEDDED_TESTS
-
-TEST_BINARIES=
-TESTS=
-
-endif !DBUS_ENABLE_EMBEDDED_TESTS
-
-noinst_PROGRAMS= $(TEST_BINARIES)
-
-test_service_CPPFLAGS = $(static_cppflags)
-test_service_LDADD = libdbus-testutils-internal.la
-test_names_CPPFLAGS = $(static_cppflags)
-test_names_LDADD = libdbus-testutils-internal.la
-## break_loader_CPPFLAGS = $(static_cppflags)
-## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-test_shell_service_CPPFLAGS = $(static_cppflags)
-test_shell_service_LDADD = libdbus-testutils-internal.la
-shell_test_CPPFLAGS = $(static_cppflags)
-shell_test_LDADD = libdbus-testutils-internal.la
-spawn_test_CPPFLAGS = $(static_cppflags)
-spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-
-test_printf_SOURCES = internals/printf.c
-test_printf_CPPFLAGS = $(static_cppflags)
-test_printf_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-
-test_refs_SOURCES = internals/refs.c
-test_refs_CPPFLAGS = $(static_cppflags)
-test_refs_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
-
-test_syslog_SOURCES = internals/syslog.c
-test_syslog_CPPFLAGS = $(static_cppflags)
-test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
-
-EXTRA_DIST = dbus-test-runner
-
-testexecdir = $(libdir)/dbus-1.0/test
-
-testexec_PROGRAMS =
-
-installable_tests = \
- shell-test \
- test-printf \
- $(NULL)
-installable_manual_tests = \
- $(NULL)
-
-if DBUS_WITH_GLIB
-installable_tests += \
- test-corrupt \
- test-dbus-daemon \
- test-dbus-daemon-eavesdrop \
- test-loopback \
- test-marshal \
- test-refs \
- test-relay \
- test-syntax \
- test-syslog \
- $(NULL)
-installable_manual_tests += \
- manual-authz \
- $(NULL)
-endif DBUS_WITH_GLIB
-
-installcheck_tests =
-installcheck_environment = \
- DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
- DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
-
-TESTS_ENVIRONMENT = \
- DBUS_BLOCK_ON_ABORT=1 \
- DBUS_FATAL_WARNINGS=1 \
- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
- $(NULL)
-
-manual_authz_SOURCES = manual-authz.c
-manual_authz_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-manual_authz_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_corrupt_SOURCES = corrupt.c
-test_corrupt_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_corrupt_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_loopback_SOURCES = loopback.c
-test_loopback_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_loopback_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_relay_SOURCES = relay.c
-test_relay_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_relay_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_dbus_daemon_SOURCES = dbus-daemon.c
-test_dbus_daemon_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_dbus_daemon_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
-test_dbus_daemon_eavesdrop_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_dbus_daemon_eavesdrop_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_marshal_SOURCES = marshal.c
-test_marshal_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_syntax_SOURCES = syntax.c
-test_syntax_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS) \
- $(NULL)
-
-if DBUS_ENABLE_MODULAR_TESTS
-TESTS += $(installable_tests)
-installcheck_tests += $(installable_tests)
-
-if DBUS_ENABLE_INSTALLED_TESTS
- testexec_PROGRAMS += $(installable_tests) $(installable_manual_tests)
-else !DBUS_ENABLE_INSTALLED_TESTS
- noinst_PROGRAMS += $(installable_tests) $(installable_manual_tests)
-endif !DBUS_ENABLE_INSTALLED_TESTS
-
-endif DBUS_ENABLE_MODULAR_TESTS
-
-# If we're installing the tests into a DESTDIR we can't run them
-# again using the installed copy, because we don't know how to
-# do a portable equivalent of setting LD_LIBRARY_PATH.
-installcheck-local:
- $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
- TESTS_ENVIRONMENT='$$(installcheck_environment)'
-if DBUS_ENABLE_INSTALLED_TESTS
- test -n "$(DESTDIR)" || \
- $(installcheck_environment) \
- $(srcdir)/dbus-test-runner \
- $(testexecdir) \
- $(testexec_PROGRAMS)
-endif DBUS_ENABLE_INSTALLED_TESTS
-
-in_data = \
- data/valid-config-files-system/debug-allow-all-fail.conf.in \
- data/valid-config-files-system/debug-allow-all-pass.conf.in \
- data/valid-config-files/debug-allow-all-sha1.conf.in \
- data/valid-config-files/debug-allow-all.conf.in \
- data/valid-config-files/incoming-limit.conf.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- $(NULL)
-
-EXTRA_DIST += $(in_data)
-
-static_data = \
- name-test/tmp-session-like-system.conf \
- data/auth/anonymous-client-successful.auth-script \
- data/auth/anonymous-server-successful.auth-script \
- data/auth/cancel.auth-script \
- data/auth/client-out-of-mechanisms.auth-script \
- data/auth/external-failed.auth-script \
- data/auth/external-root.auth-script \
- data/auth/external-silly.auth-script \
- data/auth/external-successful.auth-script \
- data/auth/extra-bytes.auth-script \
- data/auth/fail-after-n-attempts.auth-script \
- data/auth/fallback.auth-script \
- data/auth/invalid-command-client.auth-script \
- data/auth/invalid-command.auth-script \
- data/auth/invalid-hex-encoding.auth-script \
- data/auth/mechanisms.auth-script \
- data/equiv-config-files/basic/basic-1.conf \
- data/equiv-config-files/basic/basic-2.conf \
- data/equiv-config-files/basic/basic.d/basic.conf \
- data/equiv-config-files/entities/basic.d/basic.conf \
- data/equiv-config-files/entities/entities-1.conf \
- data/equiv-config-files/entities/entities-2.conf \
- data/incomplete-messages/missing-body.message \
- data/invalid-config-files/badselinux-1.conf \
- data/invalid-config-files/badselinux-2.conf \
- data/invalid-config-files/circular-1.conf \
- data/invalid-config-files/circular-2.conf \
- data/invalid-config-files/circular-3.conf \
- data/invalid-config-files/not-well-formed.conf \
- data/invalid-config-files/truncated-file.conf \
- data/invalid-messages/array-of-nil.message \
- data/invalid-messages/array-with-mixed-types.message \
- data/invalid-messages/bad-boolean-array.message \
- data/invalid-messages/bad-boolean.message \
- data/invalid-messages/bad-endian.message \
- data/invalid-messages/bad-header-field-alignment.message \
- data/invalid-messages/boolean-has-no-value.message-raw \
- data/invalid-messages/local-namespace.message \
- data/invalid-messages/no-dot-in-name.message \
- data/invalid-messages/not-nul-header-padding.message \
- data/invalid-messages/overlong-name.message \
- data/invalid-messages/too-little-header-padding.message \
- data/invalid-messages/too-much-header-padding-by-far.message \
- data/invalid-messages/too-much-header-padding.message \
- data/invalid-messages/too-short-dict.message \
- data/sha-1/Readme.txt \
- data/sha-1/bit-hashes.sha1 \
- data/sha-1/bit-messages.sha1 \
- data/sha-1/byte-hashes.sha1 \
- data/sha-1/byte-messages.sha1 \
- data/valid-config-files/basic.conf \
- data/valid-config-files/basic.d/basic.conf \
- data/valid-config-files/entities.conf \
- data/valid-config-files/many-rules.conf \
- data/valid-config-files/system.d/test.conf \
- data/valid-messages/array-of-array-of-uint32.message \
- data/valid-messages/dict-simple.message \
- data/valid-messages/dict.message \
- data/valid-messages/emptiness.message \
- data/valid-messages/lots-of-arguments.message \
- data/valid-messages/no-padding.message \
- data/valid-messages/opposite-endian.message \
- data/valid-messages/recursive-types.message \
- data/valid-messages/simplest-manual.message \
- data/valid-messages/simplest.message \
- data/valid-messages/standard-acquire-service.message \
- data/valid-messages/standard-hello.message \
- data/valid-messages/standard-list-services.message \
- data/valid-messages/standard-service-exists.message \
- data/valid-messages/unknown-header-field.message \
- $(NULL)
-
-EXTRA_DIST += $(static_data)
-
-## copy tests to builddir so that generated tests and static tests
-## are all in one place.
-all-local:
- $(AM_V_at)$(MKDIR_P) data/valid-config-files/session.d
- $(AM_V_at)set -e && \
- if test $(srcdir) = . || test $(srcdir) -ef .; then \
- echo '-- No need to copy test data as srcdir = builddir'; \
- else \
- for F in $(static_data); do \
- $(MKDIR_P) $${F%/*}; \
- rm -f $$F; \
- cp $(srcdir)/$$F $$F; \
- done; \
- fi
-
-## this doesn't clean most copied test data files when srcdir=builddir
-clean-local:
- $(AM_V_at)if test $(srcdir) = . || test $(srcdir) -ef .; then \
- echo '-- No need to clean test data as srcdir = builddir'; \
- else \
- rm -f $(static_data); \
- fi
-
-imported_data = \
- data/valid-config-files/session.conf \
- data/valid-config-files/system.conf \
- $(NULL)
-
-noinst_DATA = $(imported_data)
-CLEANFILES = $(noinst_DATA)
-
-$(imported_data): data/valid-config-files/%.conf: $(top_builddir)/bus/%.conf
- $(AM_V_at)$(MKDIR_P) data/valid-config-files
- $(AM_V_GEN)cp $< $@
diff --git a/src/3rd_party/dbus-1.7.8/test/Makefile.in b/src/3rd_party/dbus-1.7.8/test/Makefile.in
deleted file mode 100644
index 90ebd74dc9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/Makefile.in
+++ /dev/null
@@ -1,1648 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-
-# You can link either libdbus-testutils, dbus-glib and libdbus-1,
-# or libdbus-testutils-internal and libdbus-internal - never both in the
-# same binary.
-@DBUS_WITH_DBUS_GLIB_TRUE@am__append_1 = libdbus-testutils.la
-@DBUS_ENABLE_EMBEDDED_TESTS_FALSE@TESTS = $(am__EXEEXT_8)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS = ../bus/bus-test$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ ../bus/bus-test-system$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ ../dbus/dbus-test$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(am__append_2) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(am__EXEEXT_8)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = ../bus/bus-test-launch-helper$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_6)
-testexec_PROGRAMS = $(am__EXEEXT_7)
-@DBUS_WITH_GLIB_TRUE@am__append_3 = \
-@DBUS_WITH_GLIB_TRUE@ test-corrupt \
-@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon \
-@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon-eavesdrop \
-@DBUS_WITH_GLIB_TRUE@ test-loopback \
-@DBUS_WITH_GLIB_TRUE@ test-marshal \
-@DBUS_WITH_GLIB_TRUE@ test-refs \
-@DBUS_WITH_GLIB_TRUE@ test-relay \
-@DBUS_WITH_GLIB_TRUE@ test-syntax \
-@DBUS_WITH_GLIB_TRUE@ test-syslog \
-@DBUS_WITH_GLIB_TRUE@ $(NULL)
-
-@DBUS_WITH_GLIB_TRUE@am__append_4 = \
-@DBUS_WITH_GLIB_TRUE@ manual-authz \
-@DBUS_WITH_GLIB_TRUE@ $(NULL)
-
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_5 = $(installable_tests)
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_6 = $(installable_tests)
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_7 = $(installable_tests) $(installable_manual_tests)
-@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_8 = $(installable_tests) $(installable_manual_tests)
-subdir = test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libdbus_testutils_internal_la_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la
-am_libdbus_testutils_internal_la_OBJECTS = \
- libdbus_testutils_internal_la-test-utils.lo
-libdbus_testutils_internal_la_OBJECTS = \
- $(am_libdbus_testutils_internal_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__DEPENDENCIES_1 =
-@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_DEPENDENCIES = \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(top_builddir)/dbus/libdbus-1.la \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(am__DEPENDENCIES_1) \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(am__DEPENDENCIES_1)
-am__libdbus_testutils_la_SOURCES_DIST = test-utils.c test-utils.h
-@DBUS_WITH_DBUS_GLIB_TRUE@am_libdbus_testutils_la_OBJECTS = \
-@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.lo
-libdbus_testutils_la_OBJECTS = $(am_libdbus_testutils_la_OBJECTS)
-@DBUS_WITH_DBUS_GLIB_TRUE@am_libdbus_testutils_la_rpath =
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = spawn-test$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-exit$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-names$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-segfault$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-service$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shell-service$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-sleep-forever$(EXEEXT)
-@DBUS_WITH_GLIB_TRUE@am__EXEEXT_2 = test-corrupt$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon-eavesdrop$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-loopback$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-marshal$(EXEEXT) test-refs$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-relay$(EXEEXT) test-syntax$(EXEEXT) \
-@DBUS_WITH_GLIB_TRUE@ test-syslog$(EXEEXT)
-am__EXEEXT_3 = shell-test$(EXEEXT) test-printf$(EXEEXT) \
- $(am__EXEEXT_2)
-@DBUS_WITH_GLIB_TRUE@am__EXEEXT_4 = manual-authz$(EXEEXT)
-am__EXEEXT_5 = $(am__EXEEXT_4)
-@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3) \
-@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@ $(am__EXEEXT_5)
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_7 = $(am__EXEEXT_3) \
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@ $(am__EXEEXT_5)
-am__installdirs = "$(DESTDIR)$(testexecdir)"
-PROGRAMS = $(noinst_PROGRAMS) $(testexec_PROGRAMS)
-am_manual_authz_OBJECTS = manual_authz-manual-authz.$(OBJEXT)
-manual_authz_OBJECTS = $(am_manual_authz_OBJECTS)
-manual_authz_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
- $(am__DEPENDENCIES_1)
-shell_test_SOURCES = shell-test.c
-shell_test_OBJECTS = shell_test-shell-test.$(OBJEXT)
-shell_test_DEPENDENCIES = libdbus-testutils-internal.la
-spawn_test_SOURCES = spawn-test.c
-spawn_test_OBJECTS = spawn_test-spawn-test.$(OBJEXT)
-spawn_test_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-am_test_corrupt_OBJECTS = test_corrupt-corrupt.$(OBJEXT)
-test_corrupt_OBJECTS = $(am_test_corrupt_OBJECTS)
-test_corrupt_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
- $(am__DEPENDENCIES_1)
-am_test_dbus_daemon_OBJECTS = test_dbus_daemon-dbus-daemon.$(OBJEXT)
-test_dbus_daemon_OBJECTS = $(am_test_dbus_daemon_OBJECTS)
-test_dbus_daemon_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
- $(am__DEPENDENCIES_1)
-am_test_dbus_daemon_eavesdrop_OBJECTS = \
- test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.$(OBJEXT)
-test_dbus_daemon_eavesdrop_OBJECTS = \
- $(am_test_dbus_daemon_eavesdrop_OBJECTS)
-test_dbus_daemon_eavesdrop_DEPENDENCIES = \
- $(testutils_shared_if_possible_libs) $(am__DEPENDENCIES_1)
-test_exit_SOURCES = test-exit.c
-test_exit_OBJECTS = test-exit.$(OBJEXT)
-test_exit_LDADD = $(LDADD)
-am_test_loopback_OBJECTS = test_loopback-loopback.$(OBJEXT)
-test_loopback_OBJECTS = $(am_test_loopback_OBJECTS)
-test_loopback_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
- $(am__DEPENDENCIES_1)
-am_test_marshal_OBJECTS = marshal.$(OBJEXT)
-test_marshal_OBJECTS = $(am_test_marshal_OBJECTS)
-test_marshal_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
- $(am__DEPENDENCIES_1)
-test_names_SOURCES = test-names.c
-test_names_OBJECTS = test_names-test-names.$(OBJEXT)
-test_names_DEPENDENCIES = libdbus-testutils-internal.la
-am_test_printf_OBJECTS = test_printf-printf.$(OBJEXT)
-test_printf_OBJECTS = $(am_test_printf_OBJECTS)
-test_printf_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-am_test_refs_OBJECTS = test_refs-refs.$(OBJEXT)
-test_refs_OBJECTS = $(am_test_refs_OBJECTS)
-test_refs_DEPENDENCIES = libdbus-testutils-internal.la \
- $(am__DEPENDENCIES_1)
-am_test_relay_OBJECTS = test_relay-relay.$(OBJEXT)
-test_relay_OBJECTS = $(am_test_relay_OBJECTS)
-test_relay_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
- $(am__DEPENDENCIES_1)
-test_segfault_SOURCES = test-segfault.c
-test_segfault_OBJECTS = test-segfault.$(OBJEXT)
-test_segfault_LDADD = $(LDADD)
-test_service_SOURCES = test-service.c
-test_service_OBJECTS = test_service-test-service.$(OBJEXT)
-test_service_DEPENDENCIES = libdbus-testutils-internal.la
-test_shell_service_SOURCES = test-shell-service.c
-test_shell_service_OBJECTS = \
- test_shell_service-test-shell-service.$(OBJEXT)
-test_shell_service_DEPENDENCIES = libdbus-testutils-internal.la
-test_sleep_forever_SOURCES = test-sleep-forever.c
-test_sleep_forever_OBJECTS = test-sleep-forever.$(OBJEXT)
-test_sleep_forever_LDADD = $(LDADD)
-am_test_syntax_OBJECTS = syntax.$(OBJEXT)
-test_syntax_OBJECTS = $(am_test_syntax_OBJECTS)
-test_syntax_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
- $(am__DEPENDENCIES_1)
-am_test_syslog_OBJECTS = test_syslog-syslog.$(OBJEXT)
-test_syslog_OBJECTS = $(am_test_syslog_OBJECTS)
-test_syslog_DEPENDENCIES = libdbus-testutils-internal.la \
- $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
- $(libdbus_testutils_la_SOURCES) $(manual_authz_SOURCES) \
- shell-test.c spawn-test.c $(test_corrupt_SOURCES) \
- $(test_dbus_daemon_SOURCES) \
- $(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
- $(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
- $(test_printf_SOURCES) $(test_refs_SOURCES) \
- $(test_relay_SOURCES) test-segfault.c test-service.c \
- test-shell-service.c test-sleep-forever.c \
- $(test_syntax_SOURCES) $(test_syslog_SOURCES)
-DIST_SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
- $(am__libdbus_testutils_la_SOURCES_DIST) \
- $(manual_authz_SOURCES) shell-test.c spawn-test.c \
- $(test_corrupt_SOURCES) $(test_dbus_daemon_SOURCES) \
- $(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
- $(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
- $(test_printf_SOURCES) $(test_refs_SOURCES) \
- $(test_relay_SOURCES) test-segfault.c test-service.c \
- test-shell-service.c test-sleep-forever.c \
- $(test_syntax_SOURCES) $(test_syslog_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DATA = $(noinst_DATA)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
-ETAGS = etags
-CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_8 = $(am__EXEEXT_3)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = . name-test
-DIST_SUBDIRS = name-test
-
-# CPPFLAGS for binaries that are normally dynamic
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(DBUS_STATIC_BUILD_CPPFLAGS) \
- $(GLIB_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
- $(NULL)
-
-
-# improve backtraces from test stuff
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-# CPPFLAGS for binaries that are always static
-static_cppflags = \
- $(AM_CPPFLAGS) \
- -DDBUS_STATIC_BUILD \
- -DDBUS_COMPILATION \
- -DDBUS_TEST_USE_INTERNAL \
- $(NULL)
-
-noinst_LTLIBRARIES = libdbus-testutils-internal.la $(am__append_1)
-@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_SOURCES = \
-@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.c \
-@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.h \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(NULL)
-
-@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_LIBADD = \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(top_builddir)/dbus/libdbus-1.la \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(GLIB_LIBS) \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(DBUS_GLIB_LIBS) \
-@DBUS_WITH_DBUS_GLIB_TRUE@ $(NULL)
-
-@DBUS_WITH_DBUS_GLIB_FALSE@testutils_shared_if_possible_cppflags = $(static_cppflags)
-@DBUS_WITH_DBUS_GLIB_TRUE@testutils_shared_if_possible_cppflags = $(AM_CPPFLAGS)
-@DBUS_WITH_DBUS_GLIB_FALSE@testutils_shared_if_possible_libs = libdbus-testutils-internal.la
-@DBUS_WITH_DBUS_GLIB_TRUE@testutils_shared_if_possible_libs = libdbus-testutils.la
-libdbus_testutils_internal_la_CPPFLAGS = \
- $(static_cppflags) \
- $(NULL)
-
-libdbus_testutils_internal_la_SOURCES = \
- test-utils.c \
- test-utils.h \
- $(NULL)
-
-libdbus_testutils_internal_la_LIBADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
- $(NULL)
-
-@DBUS_ENABLE_EMBEDDED_TESTS_FALSE@TEST_BINARIES =
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TEST_BINARIES = \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ spawn-test \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-exit \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-names \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-segfault \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-service \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shell-service \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-sleep-forever \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(NULL)
-
-test_service_CPPFLAGS = $(static_cppflags)
-test_service_LDADD = libdbus-testutils-internal.la
-test_names_CPPFLAGS = $(static_cppflags)
-test_names_LDADD = libdbus-testutils-internal.la
-test_shell_service_CPPFLAGS = $(static_cppflags)
-test_shell_service_LDADD = libdbus-testutils-internal.la
-shell_test_CPPFLAGS = $(static_cppflags)
-shell_test_LDADD = libdbus-testutils-internal.la
-spawn_test_CPPFLAGS = $(static_cppflags)
-spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-test_printf_SOURCES = internals/printf.c
-test_printf_CPPFLAGS = $(static_cppflags)
-test_printf_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-test_refs_SOURCES = internals/refs.c
-test_refs_CPPFLAGS = $(static_cppflags)
-test_refs_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
-test_syslog_SOURCES = internals/syslog.c
-test_syslog_CPPFLAGS = $(static_cppflags)
-test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
-EXTRA_DIST = dbus-test-runner $(in_data) $(static_data)
-testexecdir = $(libdir)/dbus-1.0/test
-installable_tests = shell-test test-printf $(NULL) $(am__append_3)
-installable_manual_tests = $(NULL) $(am__append_4)
-installcheck_tests = $(am__append_6)
-installcheck_environment = \
- DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
- DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
-
-TESTS_ENVIRONMENT = \
- DBUS_BLOCK_ON_ABORT=1 \
- DBUS_FATAL_WARNINGS=1 \
- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
- $(NULL)
-
-manual_authz_SOURCES = manual-authz.c
-manual_authz_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-manual_authz_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_corrupt_SOURCES = corrupt.c
-test_corrupt_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_corrupt_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_loopback_SOURCES = loopback.c
-test_loopback_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_loopback_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_relay_SOURCES = relay.c
-test_relay_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_relay_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_dbus_daemon_SOURCES = dbus-daemon.c
-test_dbus_daemon_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_dbus_daemon_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
-test_dbus_daemon_eavesdrop_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
-test_dbus_daemon_eavesdrop_LDADD = \
- $(testutils_shared_if_possible_libs) \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_marshal_SOURCES = marshal.c
-test_marshal_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS) \
- $(NULL)
-
-test_syntax_SOURCES = syntax.c
-test_syntax_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS) \
- $(NULL)
-
-in_data = \
- data/valid-config-files-system/debug-allow-all-fail.conf.in \
- data/valid-config-files-system/debug-allow-all-pass.conf.in \
- data/valid-config-files/debug-allow-all-sha1.conf.in \
- data/valid-config-files/debug-allow-all.conf.in \
- data/valid-config-files/incoming-limit.conf.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
- data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- $(NULL)
-
-static_data = \
- name-test/tmp-session-like-system.conf \
- data/auth/anonymous-client-successful.auth-script \
- data/auth/anonymous-server-successful.auth-script \
- data/auth/cancel.auth-script \
- data/auth/client-out-of-mechanisms.auth-script \
- data/auth/external-failed.auth-script \
- data/auth/external-root.auth-script \
- data/auth/external-silly.auth-script \
- data/auth/external-successful.auth-script \
- data/auth/extra-bytes.auth-script \
- data/auth/fail-after-n-attempts.auth-script \
- data/auth/fallback.auth-script \
- data/auth/invalid-command-client.auth-script \
- data/auth/invalid-command.auth-script \
- data/auth/invalid-hex-encoding.auth-script \
- data/auth/mechanisms.auth-script \
- data/equiv-config-files/basic/basic-1.conf \
- data/equiv-config-files/basic/basic-2.conf \
- data/equiv-config-files/basic/basic.d/basic.conf \
- data/equiv-config-files/entities/basic.d/basic.conf \
- data/equiv-config-files/entities/entities-1.conf \
- data/equiv-config-files/entities/entities-2.conf \
- data/incomplete-messages/missing-body.message \
- data/invalid-config-files/badselinux-1.conf \
- data/invalid-config-files/badselinux-2.conf \
- data/invalid-config-files/circular-1.conf \
- data/invalid-config-files/circular-2.conf \
- data/invalid-config-files/circular-3.conf \
- data/invalid-config-files/not-well-formed.conf \
- data/invalid-config-files/truncated-file.conf \
- data/invalid-messages/array-of-nil.message \
- data/invalid-messages/array-with-mixed-types.message \
- data/invalid-messages/bad-boolean-array.message \
- data/invalid-messages/bad-boolean.message \
- data/invalid-messages/bad-endian.message \
- data/invalid-messages/bad-header-field-alignment.message \
- data/invalid-messages/boolean-has-no-value.message-raw \
- data/invalid-messages/local-namespace.message \
- data/invalid-messages/no-dot-in-name.message \
- data/invalid-messages/not-nul-header-padding.message \
- data/invalid-messages/overlong-name.message \
- data/invalid-messages/too-little-header-padding.message \
- data/invalid-messages/too-much-header-padding-by-far.message \
- data/invalid-messages/too-much-header-padding.message \
- data/invalid-messages/too-short-dict.message \
- data/sha-1/Readme.txt \
- data/sha-1/bit-hashes.sha1 \
- data/sha-1/bit-messages.sha1 \
- data/sha-1/byte-hashes.sha1 \
- data/sha-1/byte-messages.sha1 \
- data/valid-config-files/basic.conf \
- data/valid-config-files/basic.d/basic.conf \
- data/valid-config-files/entities.conf \
- data/valid-config-files/many-rules.conf \
- data/valid-config-files/system.d/test.conf \
- data/valid-messages/array-of-array-of-uint32.message \
- data/valid-messages/dict-simple.message \
- data/valid-messages/dict.message \
- data/valid-messages/emptiness.message \
- data/valid-messages/lots-of-arguments.message \
- data/valid-messages/no-padding.message \
- data/valid-messages/opposite-endian.message \
- data/valid-messages/recursive-types.message \
- data/valid-messages/simplest-manual.message \
- data/valid-messages/simplest.message \
- data/valid-messages/standard-acquire-service.message \
- data/valid-messages/standard-hello.message \
- data/valid-messages/standard-list-services.message \
- data/valid-messages/standard-service-exists.message \
- data/valid-messages/unknown-header-field.message \
- $(NULL)
-
-imported_data = \
- data/valid-config-files/session.conf \
- data/valid-config-files/system.conf \
- $(NULL)
-
-noinst_DATA = $(imported_data)
-CLEANFILES = $(noinst_DATA)
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu test/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libdbus-testutils-internal.la: $(libdbus_testutils_internal_la_OBJECTS) $(libdbus_testutils_internal_la_DEPENDENCIES) $(EXTRA_libdbus_testutils_internal_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libdbus_testutils_internal_la_OBJECTS) $(libdbus_testutils_internal_la_LIBADD) $(LIBS)
-libdbus-testutils.la: $(libdbus_testutils_la_OBJECTS) $(libdbus_testutils_la_DEPENDENCIES) $(EXTRA_libdbus_testutils_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(am_libdbus_testutils_la_rpath) $(libdbus_testutils_la_OBJECTS) $(libdbus_testutils_la_LIBADD) $(LIBS)
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-testexecPROGRAMS: $(testexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(testexec_PROGRAMS)'; test -n "$(testexecdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(testexecdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(testexecdir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testexecdir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testexecdir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-testexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(testexec_PROGRAMS)'; test -n "$(testexecdir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(testexecdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(testexecdir)" && rm -f $$files
-
-clean-testexecPROGRAMS:
- @list='$(testexec_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-manual-authz$(EXEEXT): $(manual_authz_OBJECTS) $(manual_authz_DEPENDENCIES) $(EXTRA_manual_authz_DEPENDENCIES)
- @rm -f manual-authz$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(manual_authz_OBJECTS) $(manual_authz_LDADD) $(LIBS)
-shell-test$(EXEEXT): $(shell_test_OBJECTS) $(shell_test_DEPENDENCIES) $(EXTRA_shell_test_DEPENDENCIES)
- @rm -f shell-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(shell_test_OBJECTS) $(shell_test_LDADD) $(LIBS)
-spawn-test$(EXEEXT): $(spawn_test_OBJECTS) $(spawn_test_DEPENDENCIES) $(EXTRA_spawn_test_DEPENDENCIES)
- @rm -f spawn-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(spawn_test_OBJECTS) $(spawn_test_LDADD) $(LIBS)
-test-corrupt$(EXEEXT): $(test_corrupt_OBJECTS) $(test_corrupt_DEPENDENCIES) $(EXTRA_test_corrupt_DEPENDENCIES)
- @rm -f test-corrupt$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_corrupt_OBJECTS) $(test_corrupt_LDADD) $(LIBS)
-test-dbus-daemon$(EXEEXT): $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_DEPENDENCIES) $(EXTRA_test_dbus_daemon_DEPENDENCIES)
- @rm -f test-dbus-daemon$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_LDADD) $(LIBS)
-test-dbus-daemon-eavesdrop$(EXEEXT): $(test_dbus_daemon_eavesdrop_OBJECTS) $(test_dbus_daemon_eavesdrop_DEPENDENCIES) $(EXTRA_test_dbus_daemon_eavesdrop_DEPENDENCIES)
- @rm -f test-dbus-daemon-eavesdrop$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_dbus_daemon_eavesdrop_OBJECTS) $(test_dbus_daemon_eavesdrop_LDADD) $(LIBS)
-test-exit$(EXEEXT): $(test_exit_OBJECTS) $(test_exit_DEPENDENCIES) $(EXTRA_test_exit_DEPENDENCIES)
- @rm -f test-exit$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_exit_OBJECTS) $(test_exit_LDADD) $(LIBS)
-test-loopback$(EXEEXT): $(test_loopback_OBJECTS) $(test_loopback_DEPENDENCIES) $(EXTRA_test_loopback_DEPENDENCIES)
- @rm -f test-loopback$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_loopback_OBJECTS) $(test_loopback_LDADD) $(LIBS)
-test-marshal$(EXEEXT): $(test_marshal_OBJECTS) $(test_marshal_DEPENDENCIES) $(EXTRA_test_marshal_DEPENDENCIES)
- @rm -f test-marshal$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_marshal_OBJECTS) $(test_marshal_LDADD) $(LIBS)
-test-names$(EXEEXT): $(test_names_OBJECTS) $(test_names_DEPENDENCIES) $(EXTRA_test_names_DEPENDENCIES)
- @rm -f test-names$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_names_OBJECTS) $(test_names_LDADD) $(LIBS)
-test-printf$(EXEEXT): $(test_printf_OBJECTS) $(test_printf_DEPENDENCIES) $(EXTRA_test_printf_DEPENDENCIES)
- @rm -f test-printf$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_printf_OBJECTS) $(test_printf_LDADD) $(LIBS)
-test-refs$(EXEEXT): $(test_refs_OBJECTS) $(test_refs_DEPENDENCIES) $(EXTRA_test_refs_DEPENDENCIES)
- @rm -f test-refs$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_refs_OBJECTS) $(test_refs_LDADD) $(LIBS)
-test-relay$(EXEEXT): $(test_relay_OBJECTS) $(test_relay_DEPENDENCIES) $(EXTRA_test_relay_DEPENDENCIES)
- @rm -f test-relay$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_relay_OBJECTS) $(test_relay_LDADD) $(LIBS)
-test-segfault$(EXEEXT): $(test_segfault_OBJECTS) $(test_segfault_DEPENDENCIES) $(EXTRA_test_segfault_DEPENDENCIES)
- @rm -f test-segfault$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_segfault_OBJECTS) $(test_segfault_LDADD) $(LIBS)
-test-service$(EXEEXT): $(test_service_OBJECTS) $(test_service_DEPENDENCIES) $(EXTRA_test_service_DEPENDENCIES)
- @rm -f test-service$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_service_OBJECTS) $(test_service_LDADD) $(LIBS)
-test-shell-service$(EXEEXT): $(test_shell_service_OBJECTS) $(test_shell_service_DEPENDENCIES) $(EXTRA_test_shell_service_DEPENDENCIES)
- @rm -f test-shell-service$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_shell_service_OBJECTS) $(test_shell_service_LDADD) $(LIBS)
-test-sleep-forever$(EXEEXT): $(test_sleep_forever_OBJECTS) $(test_sleep_forever_DEPENDENCIES) $(EXTRA_test_sleep_forever_DEPENDENCIES)
- @rm -f test-sleep-forever$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_sleep_forever_OBJECTS) $(test_sleep_forever_LDADD) $(LIBS)
-test-syntax$(EXEEXT): $(test_syntax_OBJECTS) $(test_syntax_DEPENDENCIES) $(EXTRA_test_syntax_DEPENDENCIES)
- @rm -f test-syntax$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_syntax_OBJECTS) $(test_syntax_LDADD) $(LIBS)
-test-syslog$(EXEEXT): $(test_syslog_OBJECTS) $(test_syslog_DEPENDENCIES) $(EXTRA_test_syslog_DEPENDENCIES)
- @rm -f test-syslog$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_syslog_OBJECTS) $(test_syslog_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_testutils_internal_la-test-utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manual_authz-manual-authz.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marshal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_test-shell-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_test-spawn-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-segfault.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep-forever.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_corrupt-corrupt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dbus_daemon-dbus-daemon.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loopback-loopback.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_names-test-names.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_printf-printf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refs-refs.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_relay-relay.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_service-test-service.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_shell_service-test-shell-service.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_syslog-syslog.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-libdbus_testutils_internal_la-test-utils.lo: test-utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_testutils_internal_la-test-utils.lo -MD -MP -MF $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Tpo -c -o libdbus_testutils_internal_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Tpo $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-utils.c' object='libdbus_testutils_internal_la-test-utils.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_testutils_internal_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
-
-manual_authz-manual-authz.o: manual-authz.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT manual_authz-manual-authz.o -MD -MP -MF $(DEPDIR)/manual_authz-manual-authz.Tpo -c -o manual_authz-manual-authz.o `test -f 'manual-authz.c' || echo '$(srcdir)/'`manual-authz.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/manual_authz-manual-authz.Tpo $(DEPDIR)/manual_authz-manual-authz.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manual-authz.c' object='manual_authz-manual-authz.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o manual_authz-manual-authz.o `test -f 'manual-authz.c' || echo '$(srcdir)/'`manual-authz.c
-
-manual_authz-manual-authz.obj: manual-authz.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT manual_authz-manual-authz.obj -MD -MP -MF $(DEPDIR)/manual_authz-manual-authz.Tpo -c -o manual_authz-manual-authz.obj `if test -f 'manual-authz.c'; then $(CYGPATH_W) 'manual-authz.c'; else $(CYGPATH_W) '$(srcdir)/manual-authz.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/manual_authz-manual-authz.Tpo $(DEPDIR)/manual_authz-manual-authz.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manual-authz.c' object='manual_authz-manual-authz.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o manual_authz-manual-authz.obj `if test -f 'manual-authz.c'; then $(CYGPATH_W) 'manual-authz.c'; else $(CYGPATH_W) '$(srcdir)/manual-authz.c'; fi`
-
-shell_test-shell-test.o: shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shell_test-shell-test.o -MD -MP -MF $(DEPDIR)/shell_test-shell-test.Tpo -c -o shell_test-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/shell_test-shell-test.Tpo $(DEPDIR)/shell_test-shell-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='shell_test-shell-test.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shell_test-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
-
-shell_test-shell-test.obj: shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shell_test-shell-test.obj -MD -MP -MF $(DEPDIR)/shell_test-shell-test.Tpo -c -o shell_test-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/shell_test-shell-test.Tpo $(DEPDIR)/shell_test-shell-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='shell_test-shell-test.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shell_test-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
-
-spawn_test-spawn-test.o: spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spawn_test-spawn-test.o -MD -MP -MF $(DEPDIR)/spawn_test-spawn-test.Tpo -c -o spawn_test-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spawn_test-spawn-test.Tpo $(DEPDIR)/spawn_test-spawn-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='spawn_test-spawn-test.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spawn_test-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
-
-spawn_test-spawn-test.obj: spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spawn_test-spawn-test.obj -MD -MP -MF $(DEPDIR)/spawn_test-spawn-test.Tpo -c -o spawn_test-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spawn_test-spawn-test.Tpo $(DEPDIR)/spawn_test-spawn-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='spawn_test-spawn-test.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spawn_test-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
-
-test_corrupt-corrupt.o: corrupt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_corrupt-corrupt.o -MD -MP -MF $(DEPDIR)/test_corrupt-corrupt.Tpo -c -o test_corrupt-corrupt.o `test -f 'corrupt.c' || echo '$(srcdir)/'`corrupt.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_corrupt-corrupt.Tpo $(DEPDIR)/test_corrupt-corrupt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='corrupt.c' object='test_corrupt-corrupt.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_corrupt-corrupt.o `test -f 'corrupt.c' || echo '$(srcdir)/'`corrupt.c
-
-test_corrupt-corrupt.obj: corrupt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_corrupt-corrupt.obj -MD -MP -MF $(DEPDIR)/test_corrupt-corrupt.Tpo -c -o test_corrupt-corrupt.obj `if test -f 'corrupt.c'; then $(CYGPATH_W) 'corrupt.c'; else $(CYGPATH_W) '$(srcdir)/corrupt.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_corrupt-corrupt.Tpo $(DEPDIR)/test_corrupt-corrupt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='corrupt.c' object='test_corrupt-corrupt.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_corrupt-corrupt.obj `if test -f 'corrupt.c'; then $(CYGPATH_W) 'corrupt.c'; else $(CYGPATH_W) '$(srcdir)/corrupt.c'; fi`
-
-test_dbus_daemon-dbus-daemon.o: dbus-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon-dbus-daemon.o -MD -MP -MF $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo -c -o test_dbus_daemon-dbus-daemon.o `test -f 'dbus-daemon.c' || echo '$(srcdir)/'`dbus-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo $(DEPDIR)/test_dbus_daemon-dbus-daemon.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-daemon.c' object='test_dbus_daemon-dbus-daemon.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon-dbus-daemon.o `test -f 'dbus-daemon.c' || echo '$(srcdir)/'`dbus-daemon.c
-
-test_dbus_daemon-dbus-daemon.obj: dbus-daemon.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon-dbus-daemon.obj -MD -MP -MF $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo -c -o test_dbus_daemon-dbus-daemon.obj `if test -f 'dbus-daemon.c'; then $(CYGPATH_W) 'dbus-daemon.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo $(DEPDIR)/test_dbus_daemon-dbus-daemon.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-daemon.c' object='test_dbus_daemon-dbus-daemon.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon-dbus-daemon.obj `if test -f 'dbus-daemon.c'; then $(CYGPATH_W) 'dbus-daemon.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon.c'; fi`
-
-test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o: dbus-daemon-eavesdrop.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o -MD -MP -MF $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Tpo -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o `test -f 'dbus-daemon-eavesdrop.c' || echo '$(srcdir)/'`dbus-daemon-eavesdrop.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Tpo $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-daemon-eavesdrop.c' object='test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o `test -f 'dbus-daemon-eavesdrop.c' || echo '$(srcdir)/'`dbus-daemon-eavesdrop.c
-
-test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj: dbus-daemon-eavesdrop.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj -MD -MP -MF $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Tpo -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj `if test -f 'dbus-daemon-eavesdrop.c'; then $(CYGPATH_W) 'dbus-daemon-eavesdrop.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon-eavesdrop.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Tpo $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-daemon-eavesdrop.c' object='test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj `if test -f 'dbus-daemon-eavesdrop.c'; then $(CYGPATH_W) 'dbus-daemon-eavesdrop.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon-eavesdrop.c'; fi`
-
-test_loopback-loopback.o: loopback.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_loopback-loopback.o -MD -MP -MF $(DEPDIR)/test_loopback-loopback.Tpo -c -o test_loopback-loopback.o `test -f 'loopback.c' || echo '$(srcdir)/'`loopback.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_loopback-loopback.Tpo $(DEPDIR)/test_loopback-loopback.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loopback.c' object='test_loopback-loopback.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_loopback-loopback.o `test -f 'loopback.c' || echo '$(srcdir)/'`loopback.c
-
-test_loopback-loopback.obj: loopback.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_loopback-loopback.obj -MD -MP -MF $(DEPDIR)/test_loopback-loopback.Tpo -c -o test_loopback-loopback.obj `if test -f 'loopback.c'; then $(CYGPATH_W) 'loopback.c'; else $(CYGPATH_W) '$(srcdir)/loopback.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_loopback-loopback.Tpo $(DEPDIR)/test_loopback-loopback.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loopback.c' object='test_loopback-loopback.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_loopback-loopback.obj `if test -f 'loopback.c'; then $(CYGPATH_W) 'loopback.c'; else $(CYGPATH_W) '$(srcdir)/loopback.c'; fi`
-
-test_names-test-names.o: test-names.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_names-test-names.o -MD -MP -MF $(DEPDIR)/test_names-test-names.Tpo -c -o test_names-test-names.o `test -f 'test-names.c' || echo '$(srcdir)/'`test-names.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_names-test-names.Tpo $(DEPDIR)/test_names-test-names.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-names.c' object='test_names-test-names.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_names-test-names.o `test -f 'test-names.c' || echo '$(srcdir)/'`test-names.c
-
-test_names-test-names.obj: test-names.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_names-test-names.obj -MD -MP -MF $(DEPDIR)/test_names-test-names.Tpo -c -o test_names-test-names.obj `if test -f 'test-names.c'; then $(CYGPATH_W) 'test-names.c'; else $(CYGPATH_W) '$(srcdir)/test-names.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_names-test-names.Tpo $(DEPDIR)/test_names-test-names.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-names.c' object='test_names-test-names.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_names-test-names.obj `if test -f 'test-names.c'; then $(CYGPATH_W) 'test-names.c'; else $(CYGPATH_W) '$(srcdir)/test-names.c'; fi`
-
-test_printf-printf.o: internals/printf.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_printf-printf.o -MD -MP -MF $(DEPDIR)/test_printf-printf.Tpo -c -o test_printf-printf.o `test -f 'internals/printf.c' || echo '$(srcdir)/'`internals/printf.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_printf-printf.Tpo $(DEPDIR)/test_printf-printf.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/printf.c' object='test_printf-printf.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_printf-printf.o `test -f 'internals/printf.c' || echo '$(srcdir)/'`internals/printf.c
-
-test_printf-printf.obj: internals/printf.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_printf-printf.obj -MD -MP -MF $(DEPDIR)/test_printf-printf.Tpo -c -o test_printf-printf.obj `if test -f 'internals/printf.c'; then $(CYGPATH_W) 'internals/printf.c'; else $(CYGPATH_W) '$(srcdir)/internals/printf.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_printf-printf.Tpo $(DEPDIR)/test_printf-printf.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/printf.c' object='test_printf-printf.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_printf-printf.obj `if test -f 'internals/printf.c'; then $(CYGPATH_W) 'internals/printf.c'; else $(CYGPATH_W) '$(srcdir)/internals/printf.c'; fi`
-
-test_refs-refs.o: internals/refs.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_refs-refs.o -MD -MP -MF $(DEPDIR)/test_refs-refs.Tpo -c -o test_refs-refs.o `test -f 'internals/refs.c' || echo '$(srcdir)/'`internals/refs.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refs-refs.Tpo $(DEPDIR)/test_refs-refs.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/refs.c' object='test_refs-refs.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_refs-refs.o `test -f 'internals/refs.c' || echo '$(srcdir)/'`internals/refs.c
-
-test_refs-refs.obj: internals/refs.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_refs-refs.obj -MD -MP -MF $(DEPDIR)/test_refs-refs.Tpo -c -o test_refs-refs.obj `if test -f 'internals/refs.c'; then $(CYGPATH_W) 'internals/refs.c'; else $(CYGPATH_W) '$(srcdir)/internals/refs.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refs-refs.Tpo $(DEPDIR)/test_refs-refs.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/refs.c' object='test_refs-refs.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_refs-refs.obj `if test -f 'internals/refs.c'; then $(CYGPATH_W) 'internals/refs.c'; else $(CYGPATH_W) '$(srcdir)/internals/refs.c'; fi`
-
-test_relay-relay.o: relay.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_relay-relay.o -MD -MP -MF $(DEPDIR)/test_relay-relay.Tpo -c -o test_relay-relay.o `test -f 'relay.c' || echo '$(srcdir)/'`relay.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_relay-relay.Tpo $(DEPDIR)/test_relay-relay.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relay.c' object='test_relay-relay.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_relay-relay.o `test -f 'relay.c' || echo '$(srcdir)/'`relay.c
-
-test_relay-relay.obj: relay.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_relay-relay.obj -MD -MP -MF $(DEPDIR)/test_relay-relay.Tpo -c -o test_relay-relay.obj `if test -f 'relay.c'; then $(CYGPATH_W) 'relay.c'; else $(CYGPATH_W) '$(srcdir)/relay.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_relay-relay.Tpo $(DEPDIR)/test_relay-relay.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relay.c' object='test_relay-relay.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_relay-relay.obj `if test -f 'relay.c'; then $(CYGPATH_W) 'relay.c'; else $(CYGPATH_W) '$(srcdir)/relay.c'; fi`
-
-test_service-test-service.o: test-service.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_service-test-service.o -MD -MP -MF $(DEPDIR)/test_service-test-service.Tpo -c -o test_service-test-service.o `test -f 'test-service.c' || echo '$(srcdir)/'`test-service.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_service-test-service.Tpo $(DEPDIR)/test_service-test-service.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-service.c' object='test_service-test-service.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_service-test-service.o `test -f 'test-service.c' || echo '$(srcdir)/'`test-service.c
-
-test_service-test-service.obj: test-service.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_service-test-service.obj -MD -MP -MF $(DEPDIR)/test_service-test-service.Tpo -c -o test_service-test-service.obj `if test -f 'test-service.c'; then $(CYGPATH_W) 'test-service.c'; else $(CYGPATH_W) '$(srcdir)/test-service.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_service-test-service.Tpo $(DEPDIR)/test_service-test-service.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-service.c' object='test_service-test-service.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_service-test-service.obj `if test -f 'test-service.c'; then $(CYGPATH_W) 'test-service.c'; else $(CYGPATH_W) '$(srcdir)/test-service.c'; fi`
-
-test_shell_service-test-shell-service.o: test-shell-service.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_shell_service-test-shell-service.o -MD -MP -MF $(DEPDIR)/test_shell_service-test-shell-service.Tpo -c -o test_shell_service-test-shell-service.o `test -f 'test-shell-service.c' || echo '$(srcdir)/'`test-shell-service.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_shell_service-test-shell-service.Tpo $(DEPDIR)/test_shell_service-test-shell-service.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-shell-service.c' object='test_shell_service-test-shell-service.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_shell_service-test-shell-service.o `test -f 'test-shell-service.c' || echo '$(srcdir)/'`test-shell-service.c
-
-test_shell_service-test-shell-service.obj: test-shell-service.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_shell_service-test-shell-service.obj -MD -MP -MF $(DEPDIR)/test_shell_service-test-shell-service.Tpo -c -o test_shell_service-test-shell-service.obj `if test -f 'test-shell-service.c'; then $(CYGPATH_W) 'test-shell-service.c'; else $(CYGPATH_W) '$(srcdir)/test-shell-service.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_shell_service-test-shell-service.Tpo $(DEPDIR)/test_shell_service-test-shell-service.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-shell-service.c' object='test_shell_service-test-shell-service.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_shell_service-test-shell-service.obj `if test -f 'test-shell-service.c'; then $(CYGPATH_W) 'test-shell-service.c'; else $(CYGPATH_W) '$(srcdir)/test-shell-service.c'; fi`
-
-test_syslog-syslog.o: internals/syslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_syslog_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_syslog-syslog.o -MD -MP -MF $(DEPDIR)/test_syslog-syslog.Tpo -c -o test_syslog-syslog.o `test -f 'internals/syslog.c' || echo '$(srcdir)/'`internals/syslog.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_syslog-syslog.Tpo $(DEPDIR)/test_syslog-syslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/syslog.c' object='test_syslog-syslog.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_syslog_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_syslog-syslog.o `test -f 'internals/syslog.c' || echo '$(srcdir)/'`internals/syslog.c
-
-test_syslog-syslog.obj: internals/syslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_syslog_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_syslog-syslog.obj -MD -MP -MF $(DEPDIR)/test_syslog-syslog.Tpo -c -o test_syslog-syslog.obj `if test -f 'internals/syslog.c'; then $(CYGPATH_W) 'internals/syslog.c'; else $(CYGPATH_W) '$(srcdir)/internals/syslog.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_syslog-syslog.Tpo $(DEPDIR)/test_syslog-syslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/syslog.c' object='test_syslog-syslog.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_syslog_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_syslog-syslog.obj `if test -f 'internals/syslog.c'; then $(CYGPATH_W) 'internals/syslog.c'; else $(CYGPATH_W) '$(srcdir)/internals/syslog.c'; fi`
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- $(am__tty_colors); \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- col=$$red; res=XPASS; \
- ;; \
- *) \
- col=$$grn; res=PASS; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- col=$$lgn; res=XFAIL; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- col=$$red; res=FAIL; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- col=$$blu; res=SKIP; \
- fi; \
- echo "$${col}$$res$${std}: $$tst"; \
- done; \
- if test "$$all" -eq 1; then \
- tests="test"; \
- All=""; \
- else \
- tests="tests"; \
- All="All "; \
- fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="$$All$$all $$tests passed"; \
- else \
- if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
- banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all $$tests failed"; \
- else \
- if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
- banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- if test "$$skip" -eq 1; then \
- skipped="($$skip test was not run)"; \
- else \
- skipped="($$skip tests were not run)"; \
- fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- if test "$$failed" -eq 0; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- fi; \
- echo "$${col}$$dashes$${std}"; \
- echo "$${col}$$banner$${std}"; \
- test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
- test -z "$$report" || echo "$${col}$$report$${std}"; \
- echo "$${col}$$dashes$${std}"; \
- test "$$failed" -eq 0; \
- else :; fi
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: check-recursive
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) all-local
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(testexecdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
- clean-testexecPROGRAMS mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am: install-testexecPROGRAMS
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am: installcheck-local
-
-maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-testexecPROGRAMS
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
- ctags-recursive install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am all-local check check-TESTS check-am clean \
- clean-generic clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
- clean-testexecPROGRAMS ctags ctags-recursive distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip install-testexecPROGRAMS installcheck \
- installcheck-am installcheck-local installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-testexecPROGRAMS
-
-
-# If we're installing the tests into a DESTDIR we can't run them
-# again using the installed copy, because we don't know how to
-# do a portable equivalent of setting LD_LIBRARY_PATH.
-installcheck-local:
- $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
- TESTS_ENVIRONMENT='$$(installcheck_environment)'
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ test -n "$(DESTDIR)" || \
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(installcheck_environment) \
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(srcdir)/dbus-test-runner \
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(testexecdir) \
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(testexec_PROGRAMS)
-
-all-local:
- $(AM_V_at)$(MKDIR_P) data/valid-config-files/session.d
- $(AM_V_at)set -e && \
- if test $(srcdir) = . || test $(srcdir) -ef .; then \
- echo '-- No need to copy test data as srcdir = builddir'; \
- else \
- for F in $(static_data); do \
- $(MKDIR_P) $${F%/*}; \
- rm -f $$F; \
- cp $(srcdir)/$$F $$F; \
- done; \
- fi
-
-clean-local:
- $(AM_V_at)if test $(srcdir) = . || test $(srcdir) -ef .; then \
- echo '-- No need to clean test data as srcdir = builddir'; \
- else \
- rm -f $(static_data); \
- fi
-
-$(imported_data): data/valid-config-files/%.conf: $(top_builddir)/bus/%.conf
- $(AM_V_at)$(MKDIR_P) data/valid-config-files
- $(AM_V_GEN)cp $< $@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/test/corrupt.c b/src/3rd_party/dbus-1.7.8/test/corrupt.c
deleted file mode 100644
index 1a7d44607f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/corrupt.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/* Regression test for being disconnected by a corrupt message (fd.o #15578)
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <dbus/dbus.h>
-
-#include "test-utils.h"
-
-typedef struct {
- DBusError e;
- TestMainContext *ctx;
-
- DBusServer *server;
- DBusConnection *server_conn;
- /* queue of DBusMessage */
- GQueue client_messages;
-
- DBusConnection *client_conn;
-} Fixture;
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-static DBusHandlerResult
-client_message_cb (DBusConnection *client_conn,
- DBusMessage *message,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (client_conn == f->client_conn);
- g_queue_push_tail (&f->client_messages, dbus_message_ref (message));
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void
-new_conn_cb (DBusServer *server,
- DBusConnection *server_conn,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (f->server_conn == NULL);
- f->server_conn = dbus_connection_ref (server_conn);
- test_connection_setup (f->ctx, server_conn);
-}
-
-static void
-setup (Fixture *f,
- gconstpointer addr)
-{
- f->ctx = test_main_context_get ();
- dbus_error_init (&f->e);
- g_queue_init (&f->client_messages);
-
- f->server = dbus_server_listen (addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->server != NULL);
-
- dbus_server_set_new_connection_function (f->server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->server);
-}
-
-static void
-test_connect (Fixture *f,
- gconstpointer addr G_GNUC_UNUSED)
-{
- dbus_bool_t have_mem;
-
- g_assert (f->server_conn == NULL);
-
- f->client_conn = dbus_connection_open_private (
- dbus_server_get_address (f->server), &f->e);
- assert_no_error (&f->e);
- g_assert (f->client_conn != NULL);
- test_connection_setup (f->ctx, f->client_conn);
-
- while (f->server_conn == NULL)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- have_mem = dbus_connection_add_filter (f->client_conn,
- client_message_cb, f, NULL);
- g_assert (have_mem);
-}
-
-static void
-test_message (Fixture *f,
- gconstpointer addr)
-{
- dbus_bool_t have_mem;
- dbus_uint32_t serial;
- DBusMessage *outgoing, *incoming;
-
- test_connect (f, addr);
-
- outgoing = dbus_message_new_signal ("/com/example/Hello",
- "com.example.Hello", "Greeting");
- g_assert (outgoing != NULL);
-
- have_mem = dbus_connection_send (f->server_conn, outgoing, &serial);
- g_assert (have_mem);
- g_assert (serial != 0);
-
- while (g_queue_is_empty (&f->client_messages))
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- g_assert_cmpuint (g_queue_get_length (&f->client_messages), ==, 1);
-
- incoming = g_queue_pop_head (&f->client_messages);
-
- g_assert (!dbus_message_contains_unix_fds (incoming));
- g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
- "com.example.Hello");
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Greeting");
- g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
- g_assert_cmpstr (dbus_message_get_path (incoming), ==, "/com/example/Hello");
- g_assert_cmpuint (dbus_message_get_serial (incoming), ==, serial);
-
- dbus_message_unref (incoming);
-
- dbus_message_unref (outgoing);
-}
-
-static void
-send_n_bytes (GSocket *socket,
- const gchar *blob,
- gssize blob_len)
-{
- gssize len, total_sent;
- GError *gerror = NULL;
-
- total_sent = 0;
-
- while (total_sent < blob_len)
- {
- len = g_socket_send (socket,
- blob + total_sent,
- blob_len - total_sent,
- NULL, &gerror);
-
- /* this is NULL-safe: a NULL error does not match */
- if (g_error_matches (gerror, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
- {
- /* we could wait for G_IO_OUT, but life's too short; just sleep */
- g_clear_error (&gerror);
- g_usleep (G_USEC_PER_SEC / 10);
- continue;
- }
-
- g_assert_no_error (gerror);
- g_assert (len >= 0);
- total_sent += len;
- }
-}
-
-/* Enough bytes for it to be obvious that this connection is broken */
-#define CORRUPT_LEN 1024
-
-/* All-zero is not a valid D-Bus message header - for a start, this is
- * protocol version 1, not 0 */
-static const gchar not_a_dbus_message[CORRUPT_LEN] = { 0 };
-
-static void
-test_corrupt (Fixture *f,
- gconstpointer addr)
-{
- GSocket *socket;
- GError *gerror = NULL;
- int fd;
- DBusMessage *incoming;
-
- test_message (f, addr);
-
- dbus_connection_flush (f->server_conn);
-
- /* OK, now the connection is working, let's break it! Don't try this
- * at home; splicing arbitrary bytes into the middle of the stream is
- * specifically documented as not a valid thing to do. Who'd have thought? */
- if (!dbus_connection_get_socket (f->server_conn, &fd))
- g_error ("failed to steal fd from server connection");
-
- socket = g_socket_new_from_fd (fd, &gerror);
- g_assert_no_error (gerror);
- g_assert (socket != NULL);
-
- send_n_bytes (socket, not_a_dbus_message, CORRUPT_LEN);
-
- /* Now spin on the client connection: the server just sent it complete
- * rubbish, so it should disconnect */
- while (g_queue_is_empty (&f->client_messages))
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- incoming = g_queue_pop_head (&f->client_messages);
-
- g_assert (!dbus_message_contains_unix_fds (incoming));
- g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
- "org.freedesktop.DBus.Local");
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Disconnected");
- g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
- g_assert_cmpstr (dbus_message_get_path (incoming), ==,
- "/org/freedesktop/DBus/Local");
-
- dbus_message_unref (incoming);
-
- /* Free the DBusConnection before the GSocket, because GSocket is
- * going to close our fd. GSocket tolerates closing an already-closed
- * fd, whereas DBusLoop + DBusSocketSetEpoll doesn't. On Unix
- * we could use dup() but that isn't portable to Windows :-(
- */
- dbus_connection_close (f->server_conn);
- dbus_connection_unref (f->server_conn);
- f->server_conn = NULL;
-
- g_object_unref (socket);
-}
-
-static void
-test_byte_order (Fixture *f,
- gconstpointer addr)
-{
- GSocket *socket;
- GError *gerror = NULL;
- int fd;
- char *blob;
- const gchar *arg = not_a_dbus_message;
- const gchar * const *args = &arg;
- int blob_len;
- DBusMessage *message;
- dbus_bool_t mem;
-
- test_message (f, addr);
-
- message = dbus_message_new_signal ("/", "a.b", "c");
- g_assert (message != NULL);
- /* Append 0xFF bytes, so that the length of the body when byte-swapped
- * is 0xFF000000, which is invalid */
- mem = dbus_message_append_args (message,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &args, 0xFF,
- DBUS_TYPE_INVALID);
- g_assert (mem);
- mem = dbus_message_marshal (message, &blob, &blob_len);
- g_assert (mem);
- g_assert_cmpuint (blob_len, >, 0xFF);
- g_assert (blob != NULL);
-
- dbus_message_unref (message);
-
- /* Break the message by changing its claimed byte order, without actually
- * byteswapping anything. We happen to know that byte order is the first
- * byte. */
- if (blob[0] == 'B')
- blob[0] = 'l';
- else
- blob[0] = 'B';
-
- /* OK, now the connection is working, let's break it */
-
- dbus_connection_flush (f->server_conn);
-
- if (!dbus_connection_get_socket (f->server_conn, &fd))
- g_error ("failed to steal fd from server connection");
-
- socket = g_socket_new_from_fd (fd, &gerror);
- g_assert_no_error (gerror);
- g_assert (socket != NULL);
-
- send_n_bytes (socket, blob, blob_len);
-
- dbus_free (blob);
-
- /* Now spin on the client connection: the server just sent it a faulty
- * message, so it should disconnect */
- while (g_queue_is_empty (&f->client_messages))
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- message = g_queue_pop_head (&f->client_messages);
-
- g_assert (!dbus_message_contains_unix_fds (message));
- g_assert_cmpstr (dbus_message_get_destination (message), ==, NULL);
- g_assert_cmpstr (dbus_message_get_error_name (message), ==, NULL);
- g_assert_cmpstr (dbus_message_get_interface (message), ==,
- "org.freedesktop.DBus.Local");
- g_assert_cmpstr (dbus_message_get_member (message), ==, "Disconnected");
- g_assert_cmpstr (dbus_message_get_sender (message), ==, NULL);
- g_assert_cmpstr (dbus_message_get_signature (message), ==, "");
- g_assert_cmpstr (dbus_message_get_path (message), ==,
- "/org/freedesktop/DBus/Local");
-
- dbus_message_unref (message);
-
- /* Free the DBusConnection before the GSocket, as above. */
- dbus_connection_close (f->server_conn);
- dbus_connection_unref (f->server_conn);
- f->server_conn = NULL;
-
- g_object_unref (socket);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer addr G_GNUC_UNUSED)
-{
- if (f->client_conn != NULL)
- {
- dbus_connection_close (f->client_conn);
- dbus_connection_unref (f->client_conn);
- f->client_conn = NULL;
- }
-
- if (f->server_conn != NULL)
- {
- dbus_connection_close (f->server_conn);
- dbus_connection_unref (f->server_conn);
- f->server_conn = NULL;
- }
-
- if (f->server != NULL)
- {
- dbus_server_disconnect (f->server);
- dbus_server_unref (f->server);
- f->server = NULL;
- }
-
- test_main_context_unref (f->ctx);
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_type_init ();
-
- g_test_add ("/corrupt/tcp", Fixture, "tcp:host=127.0.0.1", setup,
- test_corrupt, teardown);
-
-#ifdef DBUS_UNIX
- g_test_add ("/corrupt/unix", Fixture, "unix:tmpdir=/tmp", setup,
- test_corrupt, teardown);
-#endif
-
- g_test_add ("/corrupt/byte-order/tcp", Fixture, "tcp:host=127.0.0.1", setup,
- test_byte_order, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-client-successful.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-client-successful.auth-script
deleted file mode 100644
index 9a1620bc52..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-client-successful.auth-script
+++ /dev/null
@@ -1,16 +0,0 @@
-## this tests that a client can login anonymously
-
-CLIENT
-
-## Reject whatever mechanism the client picks first
-EXPECT_COMMAND AUTH
-SEND 'REJECTED DBUS_TEST_NONEXISTENT_MECH1 ANONYMOUS DBUS_TEST_NONEXISTENT_MECH2'
-
-## And this time we get ANONYMOUS
-
-EXPECT_COMMAND AUTH
-## of course real DBUS_COOKIE_SHA1 would not send this here...
-SEND 'OK 1234deadbeef'
-
-EXPECT_COMMAND BEGIN
-EXPECT_STATE AUTHENTICATED
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-server-successful.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-server-successful.auth-script
deleted file mode 100644
index 172ae9de97..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/anonymous-server-successful.auth-script
+++ /dev/null
@@ -1,13 +0,0 @@
-## this tests the server side in a successful auth of type ANONYMOUS
-
-SERVER
-## verify that prior to doing anything, we haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
-SEND 'AUTH ANONYMOUS 442d42757320312e312e31'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'BEGIN'
-EXPECT_STATE AUTHENTICATED
-## verify that we are still anonymous
-EXPECT_HAVE_NO_CREDENTIALS
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/cancel.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/cancel.auth-script
deleted file mode 100644
index f2c519aa2e..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/cancel.auth-script
+++ /dev/null
@@ -1,19 +0,0 @@
-## this tests canceling EXTERNAL
-
-SERVER
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'CANCEL'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-## now start over and see if it works
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'BEGIN'
-EXPECT_STATE AUTHENTICATED
-
-
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/client-out-of-mechanisms.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/client-out-of-mechanisms.auth-script
deleted file mode 100644
index ce6d3ad4aa..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/client-out-of-mechanisms.auth-script
+++ /dev/null
@@ -1,7 +0,0 @@
-## this tests that tests that the client disconnects when it's out of
-## known mechanisms
-
-CLIENT
-EXPECT_COMMAND AUTH
-SEND 'REJECTED BONGO_MD5'
-EXPECT_STATE NEED_DISCONNECT
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/external-failed.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/external-failed.auth-script
deleted file mode 100644
index 7c4e90018c..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/external-failed.auth-script
+++ /dev/null
@@ -1,11 +0,0 @@
-## this tests that auth of type EXTERNAL without credentials will fail
-
-SERVER
-NO_CREDENTIALS
-## verify that prior to doing anything, we haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-## verify that we still haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/external-root.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/external-root.auth-script
deleted file mode 100644
index b4c4b43946..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/external-root.auth-script
+++ /dev/null
@@ -1,11 +0,0 @@
-## this tests we can auth EXTERNAL as ourselves, with root credentials
-UNIX_ONLY
-SERVER
-ROOT_CREDENTIALS
-## 30 is ASCII '0' in hex
-SEND 'AUTH EXTERNAL 30'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'BEGIN'
-EXPECT_STATE AUTHENTICATED
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/external-silly.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/external-silly.auth-script
deleted file mode 100644
index 4e18ee8d71..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/external-silly.auth-script
+++ /dev/null
@@ -1,12 +0,0 @@
-## this tests we can't auth if socket reports silly credentials but we ask for our own uid
-
-SERVER
-## verify that prior to doing anything, we haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
-SILLY_CREDENTIALS
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-## verify that we still haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/external-successful.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/external-successful.auth-script
deleted file mode 100644
index 222938ccce..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/external-successful.auth-script
+++ /dev/null
@@ -1,12 +0,0 @@
-## this tests a successful auth of type EXTERNAL
-
-SERVER
-## verify that prior to doing anything, we haven't authed as anyone
-EXPECT_HAVE_NO_CREDENTIALS
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'BEGIN'
-EXPECT_STATE AUTHENTICATED
-## verify that we now have some credentials
-EXPECT_HAVE_SOME_CREDENTIALS
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/extra-bytes.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/extra-bytes.auth-script
deleted file mode 100644
index cd1e01d220..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/extra-bytes.auth-script
+++ /dev/null
@@ -1,10 +0,0 @@
-## this tests that we have the expected extra bytes at the end
-
-SERVER
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND OK
-EXPECT_STATE WAITING_FOR_INPUT
-SEND 'BEGIN\r\nHello'
-EXPECT_STATE AUTHENTICATED_WITH_UNUSED_BYTES
-EXPECT_UNUSED 'Hello\r\n'
-EXPECT_STATE AUTHENTICATED
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/fail-after-n-attempts.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/fail-after-n-attempts.auth-script
deleted file mode 100644
index 0ced386b31..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/fail-after-n-attempts.auth-script
+++ /dev/null
@@ -1,34 +0,0 @@
-## this tests that after retrying too often we fail
-
-SERVER
-NO_CREDENTIALS
-
-# 1
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-# 2
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-# 3
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-# 4
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-# 5
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
-# 6
-SEND 'AUTH EXTERNAL USERID_HEX'
-EXPECT_COMMAND REJECTED
-EXPECT_STATE NEED_DISCONNECT
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/fallback.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/fallback.auth-script
deleted file mode 100644
index 0d880c0020..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/fallback.auth-script
+++ /dev/null
@@ -1,17 +0,0 @@
-## this tests that a client can fallback to a secondary auth mech
-
-CLIENT
-
-## Will try EXTERNAL by default first without first calling AUTH alone.
-
-EXPECT_COMMAND AUTH
-SEND 'REJECTED EXTERNAL DBUS_COOKIE_SHA1 DBUS_TEST_NONEXISTENT_MECH'
-
-## And this time we get DBUS_COOKIE_SHA1
-
-EXPECT_COMMAND AUTH
-## of course real DBUS_COOKIE_SHA1 would not send this here...
-SEND 'OK 1234deadbeef'
-
-EXPECT_COMMAND BEGIN
-EXPECT_STATE AUTHENTICATED
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command-client.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command-client.auth-script
deleted file mode 100644
index ac17e7bebe..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command-client.auth-script
+++ /dev/null
@@ -1,8 +0,0 @@
-## this tests that receiving a nonexistent command is handled properly
-## by a client
-
-CLIENT
-EXPECT_COMMAND AUTH
-SEND 'NONEXISTENT_COMMAND foo bar baz blah blah'
-EXPECT_COMMAND ERROR
-EXPECT_STATE WAITING_FOR_INPUT
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command.auth-script
deleted file mode 100644
index c49cb8d36d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-command.auth-script
+++ /dev/null
@@ -1,7 +0,0 @@
-## this tests that receiving a nonexistent command is handled properly
-## by a server
-
-SERVER
-SEND 'NONEXISTENT_COMMAND foo bar baz blah blah'
-EXPECT_COMMAND ERROR
-EXPECT_STATE WAITING_FOR_INPUT
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-hex-encoding.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-hex-encoding.auth-script
deleted file mode 100644
index 1f15c4360f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/invalid-hex-encoding.auth-script
+++ /dev/null
@@ -1,6 +0,0 @@
-## this tests an invalid hex encoding followed by successful authentication
-
-SERVER
-SEND 'AUTH EXTERNAL willy'
-EXPECT_COMMAND ERROR
-EXPECT_STATE WAITING_FOR_INPUT
diff --git a/src/3rd_party/dbus-1.7.8/test/data/auth/mechanisms.auth-script b/src/3rd_party/dbus-1.7.8/test/data/auth/mechanisms.auth-script
deleted file mode 100644
index be447916d1..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/auth/mechanisms.auth-script
+++ /dev/null
@@ -1,8 +0,0 @@
-## this tests that the server sends a list of mechanisms
-## in response to blank AUTH
-
-SERVER
-SEND AUTH
-EXPECT_COMMAND REJECTED
-EXPECT_STATE WAITING_FOR_INPUT
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-1.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-1.conf
deleted file mode 100644
index 99f41e802e..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-1.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- </policy>
-
- <limit name="max_incoming_bytes">5000</limit>
- <limit name="max_outgoing_bytes">5000</limit>
- <limit name="max_message_size">300</limit>
- <limit name="service_start_timeout">5000</limit>
- <limit name="auth_timeout">6000</limit>
- <limit name="max_completed_connections">50</limit>
- <limit name="max_incomplete_connections">80</limit>
- <limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_service_starts">64</limit>
- <limit name="max_names_per_connection">256</limit>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-2.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-2.conf
deleted file mode 100644
index 49e707e896..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic-2.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-<include>basic-1.conf</include>
-</busconfig> \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic.d/basic.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic.d/basic.conf
deleted file mode 100644
index d109d71dc9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/basic/basic.d/basic.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/basic.d/basic.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/basic.d/basic.conf
deleted file mode 100644
index d109d71dc9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/basic.d/basic.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-1.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-1.conf
deleted file mode 100644
index 3d3cea79a7..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-1.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-<!-- This config file contains XML entities -->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/&lt;bar&gt;</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.&#100;</includedir>
- <servicedir>/usr/&amp;share/foo</servicedir>
- <include ignore_missing="ye&#115;">nonexistent.conf&#110;</include>
- <policy context="&#100;efault">
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-2.conf b/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-2.conf
deleted file mode 100644
index 9ffabeae4a..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/equiv-config-files/entities/entities-2.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-<include>entities-1.conf</include>
-</busconfig> \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/test/data/incomplete-messages/missing-body.message b/src/3rd_party/dbus-1.7.8/test/data/incomplete-messages/missing-body.message
deleted file mode 100644
index 138e9ea582..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/incomplete-messages/missing-body.message
+++ /dev/null
@@ -1,19 +0,0 @@
-## message that's missing an expected body
-
-VALID_HEADER method_call
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-ALIGN 8
-END_LENGTH Header
-
-## create the body, then chop it off
-START_LENGTH Body
-TYPE INT32
-INT32 37
-END_LENGTH Body
-
-CHOP 8
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-1.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-1.conf
deleted file mode 100644
index 4852ded250..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-1.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include selinux_root_relative="jomoma">blah</include>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-2.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-2.conf
deleted file mode 100644
index ac3b95c42f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/badselinux-2.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include if_selinux_enabled="moo">blah</include>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-1.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-1.conf
deleted file mode 100644
index faa895a393..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-1.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-<include>circular-1.conf</include>
-</busconfig> \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-2.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-2.conf
deleted file mode 100644
index 46a7e78e99..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-2.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-<include>circular-3.conf</include>
-</busconfig> \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-3.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-3.conf
deleted file mode 100644
index 87e354d934..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/circular-3.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-<include>circular-2.conf</include>
-</busconfig> \ No newline at end of file
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/not-well-formed.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/not-well-formed.conf
deleted file mode 100644
index 9e59cbc0ee..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/not-well-formed.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</foo>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/truncated-file.conf b/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/truncated-file.conf
deleted file mode 100644
index e8d60883bd..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-config-files/truncated-file.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="y
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-of-nil.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-of-nil.message
deleted file mode 100644
index 1197a13625..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-of-nil.message
+++ /dev/null
@@ -1,31 +0,0 @@
-# Message with an array of NIL (not allowed)
-
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-TYPE ARRAY
-TYPE NIL
-UINT32 5
-
-## we want it to fail because of type nil, not because the length is no good
-## so pad out the message with 5 bytes
-BYTE 1
-BYTE 2
-BYTE 3
-BYTE 4
-BYTE 5
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-with-mixed-types.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-with-mixed-types.message
deleted file mode 100644
index dea2d1e568..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/array-with-mixed-types.message
+++ /dev/null
@@ -1,52 +0,0 @@
-# Message with an array of array where the child arrays are of
-# different types
-
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-
-TYPE ARRAY
-TYPE ARRAY
-TYPE UINT32
-
-LENGTH Array
-START_LENGTH Array
-
-## array of uint32
-LENGTH SubArray1
-START_LENGTH SubArray1
-UINT32 1
-UINT32 2
-UINT32 3
-END_LENGTH SubArray1
-
-## array of uint32
-LENGTH SubArray2
-START_LENGTH SubArray2
-UINT32 4
-UINT32 5
-END_LENGTH SubArray2
-
-## array of boolean
-LENGTH SubArray3
-START_LENGTH SubArray3
-BOOLEAN false
-BOOLEAN true
-END_LENGTH SubArray3
-
-END_LENGTH Array
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean-array.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean-array.message
deleted file mode 100644
index 48000afd7b..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean-array.message
+++ /dev/null
@@ -1,27 +0,0 @@
-## a message with an invalid boolean array
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-TYPE ARRAY
-TYPE BOOLEAN
-ALIGN 4
-INT32 3
-BYTE 0
-BYTE 1
-BYTE 3
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean.message
deleted file mode 100644
index 09026db834..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-boolean.message
+++ /dev/null
@@ -1,22 +0,0 @@
-## a message with an invalid boolean value
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-TYPE BOOLEAN
-BYTE 3
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-endian.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-endian.message
deleted file mode 100644
index e979baae6f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-endian.message
+++ /dev/null
@@ -1,25 +0,0 @@
-## message with invalid endianness tag
-
-BYTE 'i'
-BYTE 1
-BYTE 0
-BYTE 0
-
-LENGTH Header
-LENGTH Body
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-header-field-alignment.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-header-field-alignment.message
deleted file mode 100644
index 22c0d7eec7..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/bad-header-field-alignment.message
+++ /dev/null
@@ -1,38 +0,0 @@
-## last field incorrectly aligned to 4 bytes
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-HEADER_FIELD UNKNOWN
-TYPE STRING
-STRING 'a'
-
-ALIGN 4
-
-HEADER_FIELD UNKNOWN
-TYPE ARRAY
-TYPE BYTE
-ALIGN 4
-LENGTH ThisByteArray
-START_LENGTH ThisByteArray
-BYTE 1
-BYTE 2
-END_LENGTH ThisByteArray
-
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/boolean-has-no-value.message-raw b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/boolean-has-no-value.message-raw
deleted file mode 100644
index 11b15c86bf..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/boolean-has-no-value.message-raw
+++ /dev/null
Binary files differ
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/local-namespace.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/local-namespace.message
deleted file mode 100644
index 8a72018873..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/local-namespace.message
+++ /dev/null
@@ -1,21 +0,0 @@
-## a message that is in the org.freedesktop.Local. namespace and thus
-## invalid
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.DBus.Local'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Disconnected'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/no-dot-in-name.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/no-dot-in-name.message
deleted file mode 100644
index 6d6317a5a5..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/no-dot-in-name.message
+++ /dev/null
@@ -1,19 +0,0 @@
-## a message with dotless interface
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'NoDotInHere'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/not-nul-header-padding.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/not-nul-header-padding.message
deleted file mode 100644
index be846da0dd..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/not-nul-header-padding.message
+++ /dev/null
@@ -1,25 +0,0 @@
-## has one non-nul byte in header padding
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-HEADER_FIELD UNKNOWN
-TYPE STRING
-STRING 'a'
-ALIGN 8
-## kill a padding byte and replace it
-CHOP 1
-BYTE 'q'
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/overlong-name.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/overlong-name.message
deleted file mode 100644
index c1f9079068..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/overlong-name.message
+++ /dev/null
@@ -1,20 +0,0 @@
-## a message with too-long name field
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.foo.bar.this.is.really.long 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200'
-
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-little-header-padding.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-little-header-padding.message
deleted file mode 100644
index 358815a56f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-little-header-padding.message
+++ /dev/null
@@ -1,24 +0,0 @@
-## has one byte missing from header padding
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-HEADER_FIELD UNKNOWN
-TYPE STRING
-STRING 'a'
-ALIGN 8
-## kill a padding byte
-CHOP 1
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding-by-far.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding-by-far.message
deleted file mode 100644
index 2d2be3a595..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding-by-far.message
+++ /dev/null
@@ -1,26 +0,0 @@
-## has one byte extra header padding
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-HEADER_FIELD UNKNOWN
-TYPE STRING
-STRING 'a'
-ALIGN 8
-BYTE 0
-ALIGN 8
-BYTE 0
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding.message
deleted file mode 100644
index 0b1c294c4d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-much-header-padding.message
+++ /dev/null
@@ -1,23 +0,0 @@
-## has one byte extra header padding
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-HEADER_FIELD UNKNOWN
-TYPE STRING
-STRING 'a'
-ALIGN 8
-BYTE 0
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-short-dict.message b/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-short-dict.message
deleted file mode 100644
index ffc3cc529f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-messages/too-short-dict.message
+++ /dev/null
@@ -1,28 +0,0 @@
-# Message with lots of different argument types
-
-VALID_HEADER method_call
-
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-
-ALIGN 8
-
-END_LENGTH Header
-
-START_LENGTH Body
-TYPE DICT
-LENGTH Dict
-START_LENGTH Dict
-STRING 'uint32'
-TYPE UINT32
-UINT32 0x8765432
-STRING 'uint32'
-END_LENGTH Dict
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in b/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in
deleted file mode 100644
index 189214e636..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteNoExec
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in b/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in
deleted file mode 100644
index 7822ffc40c..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Exec=@DBUS_TEST_EXEC@/test-service@EXEEXT@
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in b/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in
deleted file mode 100644
index 691e009655..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteNoUser
-Exec=@DBUS_TEST_EXEC@/test-service@EXEEXT@
diff --git a/src/3rd_party/dbus-1.7.8/test/data/sha-1/Readme.txt b/src/3rd_party/dbus-1.7.8/test/data/sha-1/Readme.txt
deleted file mode 100644
index cf7b02329f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/sha-1/Readme.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-Test suite from http://csrc.nist.gov/cryptval/shs.html
-
- Sample Vectors for SHA-1 Testing
-
- This file describes tests and vectors that can be used in verifying the correctness of
-an SHA-1 implementation. However, use of these vectors does not take the place of validation
-obtained through the Cryptographic Module Validation Program.
-
- There are three areas of the Secure Hash Standard for which test vectors are supplied:
-short messages of varying length, selected long messages, and pseudorandomly generated messages.
-Since it is possible for an implementation to correctly handle the hashing of byte-oriented
-messages (and not messages of a non-byte length), the SHS tests each come in two flavors. For
-both byte oriented and bit oriented messages, the message lengths are given in bits.
-
-Type I Test: Messages of Varying Length
-
- An implementation of the SHS must be able to correctly generate message digests for
-messages of arbitrary length. This functionality can be tested by supplying the implementation
-with 1025 pseudorandomly generated messages with lengths from 0 to 1024 bits (for an implementation
-that only hashes byte-oriented data correctly, 129 messages of length 0, 8, 16, 24,...,1024 bits
-will be supplied).
-
-Type II Test: Selected Long Messages
-
- Additional testing of an implementation can be performed by testing that the implementation
-can correctly generate digests for longer messages. A list of 100 messages, each of length > 1024,
-is supplied. These can be used to verify the hashing of longer message lengths. For bit oriented
-testing the messages are from 1025 to 103425 bits long (length=1025+i*1024, where 0<=i<100). For
-byte oriented testing the messages are from 1032 to 103432 (length=1032+i*1024, where 0<=i<100).
-
-Type III Test: Pseudorandomly Generated Messages
-
- This test determines whether the implementation can compute message digests for messages
-that are generated using a given seed. A sequence of 100 message digests is generated using this
-seed. The digests are generated according to the following pseudocode:
-
-procedure MonteCarlo(string SEED)
-{
- integer i, j, a;
- string M;
-
- M := SEED;
- for j = 0 to 99 do {
- for i = 1 to 50000 do {
- for a = 1 to (j/4*8 + 24) do M := M || ’0’; /*‘0' is the binary zero bit. */
- M := M || i; /* Here, the value for ‘i’ is expressed as a 32-bit word
- and concatenated with ‘M’. The first bit
- concatenated with ‘M’ is the most significant bit of
- this 32-bit word. */
- M := SHA(M);
- }
- print(M);
- }
- }
-
-NOTE: In the above procedure, || denotes concatenation. Also, M || i denotes appending the 32-bit
-word representing the value ‘i’, as defined in section 2 of the SHS. Within the procedure, M is a string
-of variable length. The initial length of 416 bits ensures that the length of M never exceeds 512 bits
-during execution of the above procedure, and it ensures that messages will be of a byte length. Each
-element printed should be 160 bits in length.
-
-
-File formats:
-
-There are two files included for each test type (bit-oriented and byte-oriented). One file contains
-the messages and the other file contains the hashes.
-
-The message files provided use "compact strings" to store the message values. Compact strings are
-used to represented the messages in a compact form. A compact string has the form
- z || b || n(1) || n(2) || ... || n(z)
-where z>=0 that represents the number of n, b is either 0 or 1, and each n(i) is a decimal integer
-representing a positive number. The length of the compact string is given by the summation of the n(i).
-
-The compact string is interpreted as the representation of the bit string consisting of b repeated n(1) times,
-followed by 1-b repeated n(2) times, followed by b repeated n(3) times, and so on.
-
-Example:
- M = 5 1 7 13 5 1 2
- where z = 5 and b = 1. Then the compact string M represents the bit string
- 1111111000000000000011111011
- where 1 is repeated 7 times, 0 is repeated 13 times, 1 is repeated 5 times,
- 0 is repeated 1 time, and 1 is repeated 2 times.
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-hashes.sha1 b/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-hashes.sha1
deleted file mode 100644
index e30e90ba49..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-hashes.sha1
+++ /dev/null
@@ -1,1239 +0,0 @@
-# Configuration information for "SHA-1 Test"
-# SHA tests are configured for BIT oriented implementations
-H>SHS Type 1 Hashes<H
-D>
-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709 ^
-59C4526AA2CC59F9A5F56B5579BA7108E7CCB61A ^
-6E42FB84067CFF056C43A49E484997AF23190879 ^
-C63FBB9A87171A176E6E054890E29A8C5F125F6C ^
-3109E33C1C4B9A0169D1599169D0E5A520A1E71C ^
-9195E1E73CC68D7170F44BD1D83CB624BC87FA0B ^
-64F7C374527278C0436DBC8DE5AABEC2BBF634BC ^
-154B622EA426FB151B1FF1BE1CE871752B9EDEB4 ^
-12BDD00FD4038756CBCF8ECDAD1B0CD862603CD8 ^
-6700F93E1691E83735279E167F67AF61FEE9813B ^
-84AF20A06799F366435BA20F99B9A10955B6D276 ^
-C622FE003FD16220357F88FC6B9DE4789E77C321 ^
-C8DEA5A98DADA1F9662D5C150618140A150ECA46 ^
-FBB7127E77A39D856EC849D755C868CA7B9F11E9 ^
-B7D8A7A39AB33ED8C3AFD8F76201BF0904149437 ^
-154535460A12B9E100E251BB3A4D4DBCD80A309A ^
-82FC6020C7A9B62F334F7156ADA608532DCA6A3B ^
-9DD980B8073B32D21E9B2324F982024375C2951F ^
-419F97A9899486DC53C58C761CEB564314FD47BD ^
-A212E43EBFB31388F64C0C0B0B1CC7019704B744 ^
-D8F1623C186A5615F58E846C9D164F35A8956E44 ^
-AA32848DE1499365730A3650A3A7703FD404259A ^
-79BDB01E55B61A8C1AFBF63D3CE2DCCAB8CF3DFB ^
-23BF3164A448A727BA71457EBA9FCFABFBAC4F70 ^
-BA26E846EBEF7434B63F5862FDA005A1CEB5656E ^
-98622869A474EA85FE575CD979354248141A14A7 ^
-5C9E7E6951D386205542DA0680E07E60EC61D64E ^
-8EF07A02A7023AA0E6EE4BE1518627A521D1F9D5 ^
-CDEA382A5DFDA1C633F8BBC77F291F40E8801CE3 ^
-3C0A709FEF85DDBCC1B362AA162010461F31AECD ^
-10ABD6B8D97E688AF5CDA7955CD3CC0850A4A75F ^
-0EC53133F7FF955CA37D25491B592DFC0256BF23 ^
-1A46A67FEED1604523C062AACC2455223B366D05 ^
-FA3DD749E8F3D9029D9261F25157B3C0E2DF6834 ^
-43DCAC2CF20E7CCB1DED6E379CC302F302655F3B ^
-8BA25BDF331671CCB4B60961E4AF356224027862 ^
-AC3A3EA0FB8727334A4478ED165128581BBC5BEA ^
-CA4406A231EA2CA06CD1D8F3C77FEF9118B1501A ^
-5B83465B8EED14871FB51D9E6CE499FB2E4B4209 ^
-9445F521861946D4063E0CA3F41F580855A7454E ^
-C2410140818962F95506B407AE8514F11F892AEC ^
-F8F826FE0D93F415426ADB6956242116CBAB2426 ^
-C803F7539AA036CBB31B735238120FB85180D8C8 ^
-162EB5163692D9BC7B4529D214BBB932157361B6 ^
-D4B0D876A1952ADB5D27A1A6BF71BCF22731A4C5 ^
-CB5CD26AA39E45F248706604EDB9A2DB8EDC1BF6 ^
-F1AC987F30FF0375F6115C0CCD6E22DDFD0FAFE7 ^
-692E209D3A6A0228EB9823DCB738B16BDF97A4E9 ^
-FB9E1E71F7645EEEEB3DDE66716DC44444CD657C ^
-D51F071E360D96124DA49AD37E37DE17B564920D ^
-0667AFCDBB82B4213447D0B22006DC4A1320CD21 ^
-8FBFC65FEB2565F2FB8A9966B74702350C87CF40 ^
-8A8BBCD6AF76E71067EB0AF54F90EE5AC2B5882F ^
-8D831EF2344E336CC27281227185A34356B856A6 ^
-DE7AA7424F92CBC50966FC4E6A577F98905998FC ^
-1064EE6BEF704F3A618CB9C58F299B22A4D34293 ^
-95F8CF7E864FEBBF77E46067063D08D5175FC508 ^
-79381F230970F120D19B115BF864C794878E7797 ^
-D82A30F49538561D5A7D1324ECAD321DD05E1202 ^
-5926CEEAE43D29A7BE4C0EDCA626C43ABE00416A ^
-563458C9F2C16C5AF96915FCD9306F1D9BA579C9 ^
-C92B0BD604E45D7479AE19F641B2DB067E4CA774 ^
-D69D013EE5C871D3AE3E388090BC1AAF9852A83C ^
-7C341ECDEE7298605933465EA9ADBE7E044C8A79 ^
-83EC687D22A13EDDCD470C52C45276A6E1554982 ^
-6D27928F014269CEC4E8745EB73FA714BE2DC62E ^
-75C0BF312C05231DAF7E9CD4CA33ACA78BCAA59A ^
-015D799C602DD4E30D2C0104A57B1E214A423D66 ^
-D2F43ECAD20F0B4C57DD07D3CECE562B6B72C7FB ^
-27948CE5A56D57248D4DF683DC3FE023D2B9B43A ^
-2D5A984BF32DE28242744406469E18B7A5178A97 ^
-FFC5C4ECF0CC051320E071D14C7DCA4A4DDA305A ^
-CED8A5487AD13AF0003129659DE2556183836C54 ^
-599BB509863CC5D275416F6DB6C5D2BD827DC347 ^
-3981DAC895DDB9294D933C1CE78828E3A558B152 ^
-91EB715904123D326B23ACD684DFBD7203CABECB ^
-5A9AC8C3705AF14DDE50E6CF2FE5B0C15C4BD282 ^
-E2620DFB42B5ECAF85F590A71DF696906AC41C4D ^
-CBAADDA7B5DB389BF1775AE50040081A05A0EE48 ^
-AAF80D079F3F980BF9D5366C5B1991A3E3D9FDCE ^
-2A861F616604C526ACB157732DC431E81BC9A1F6 ^
-FBDB22AA0B87718F464C0D1AA39695A1BDCE053F ^
-4331BA331522D4F9CD6137858DB9AA16AC95316E ^
-33F6BFE23A4C0E04B8BF642CD96437EF0055AAF7 ^
-2046138F7899FDB2063CD84B84E821525172C03B ^
-E4FDC812C5F7A37FC7A81005F1E78BFF59666887 ^
-6477F931AC20B2FCE1C92171FA4DCF2D266B3DC5 ^
-ED0DD516FA7FE2DB7AFCC3DBEED0879A0C10F1C2 ^
-FCEDA0311C085368A5751BCAD8EAED2063C2D40A ^
-23EB08B5100C8FBAF7B3049887A11CC531B6CD78 ^
-A6C42B757DF078A69FFF6819A8ABC46E1B09F435 ^
-0615EE4840B1F1CD628636D1B4F4495639DEDEBC ^
-E2288110007AE6DBCCFC74B7735F4D94B0AA10A1 ^
-159E01DC348EB067E90A63BC6FEFBF4C45A01F9A ^
-A16286459CC989AE662C731F3D7D0CD487DCCB3B ^
-8FDAFE2DE37215E142E27A65A881F80E0430BF49 ^
-1BF978B58D98FC15731F4111E7C7A49F9CFD7C65 ^
-C1F61CD4B4DB14AA60C6448C0398EEC72107826C ^
-5CF0A7F6F46A730CD9103A54F1EC8A7549FA5788 ^
-FDC104217940BE5A7AD1C02D128B31747C972A5C ^
-DFF58BEF4FF418D26A35B55215CE419D3579A194 ^
-3A2EFD444F4AA7A3DB9765E027CE5D82B51F6737 ^
-EB616B6F97C5BFD02C1B9E4AFBA8A5151DD4167F ^
-62F31F9A28D0587BD8253601A7EFB698B03205FA ^
-E87645B2CB7DF66DA2771ABE0CEDA0F625FC8AFA ^
-E801C3071CA6AEE278B222747BFA819C118A2DDD ^
-EC70223BD963C122E4FCE2928934DDD2D7661CBC ^
-82261D26377A5A5DC69E0F39D0BBF59A1B2B2248 ^
-2E4DE781E4407AE536F70DC5A5DBEB178DBA2FC3 ^
-AD3D958B884CAA28D5858DA103463C300862DEE6 ^
-2A6A563C7FE33129637FABB4D40F5F0EE8B5C500 ^
-7EA6003A8BEF4D5BFA6BFEFBCB6A5B3B1A3B7991 ^
-6DDC620DB14882575D5BA1219284CF1C3068094F ^
-91AD7E588EC829739C3632656DE1915AC23C8CF5 ^
-311A491C1B5D8A26EA2A77A36B5D53FDABA1FB2A ^
-9D4B752AA8FDAF92897B03C4D65B65EABBDF062C ^
-C569FF6F0592664F690B008EE7A12EDA5740F0C7 ^
-1AE35E9CD3D0A8A165B2758E1DC4F9D1CD30FBF9 ^
-819A83318700EA861CB69F6CD8ED4ECD78CC3CB7 ^
-98099B550A82CE22EFAE48B5935F636D5814FDB4 ^
-CFADB998167DB289A7C17BA94DF7EDA00B29085E ^
-3F5A90A8F757936987938DFB95F10239F91AC264 ^
-7402265908EEA5DA183490FEF2EA2E55C9FC2862 ^
-EA6EF0F7050EDA6B78F35597E85B7A85AE0097E4 ^
-73F2780548F7C79E15945D7EE2A3E03B30DF35CA ^
-8EC3C93C7307E14E9C65F26DD847CEB195DE277A ^
-CFBC571A35B82FB0B7CB59753C4E8DE36A751195 ^
-3C4802A956CF93A148B9034FB8F041ECD8DD4532 ^
-5DA269C1D5CCEE3C7A66E31BD9F5E0B83BA06CE1 ^
-706D90C00800DB9790AF66788D1B3DC81E3FF7A1 ^
-59AC856447FDD27421C52EA66E465C64C5033722 ^
-EACA9E82D043F2B6E12E64CF03D82ED92FD6A64D ^
-8160755BA09C74F79DE8F9496BF0C9248DB7D45E ^
-8CE4390C185BDFC8BC9C4D3BEB1AB757C44F6434 ^
-1A1ADB628EB7B9CAA821AE9DE417E09A42A97113 ^
-97C4F92A46EF3F9169A977E1643C10745ECDAA4E ^
-408E53C03D10E2B32222F2B54D118AC4D65A9386 ^
-710628E811C207784E3255DA8432CE6E14B61FE7 ^
-4F6DB622778F4B1B6203BD239312D86589F1B261 ^
-888AD8FC1CA5B893294FDB8FC94AB7762018C1F8 ^
-AE36C2F54223BC082DDA0D528B70B2AEA190779C ^
-4BD2BF914223DCD0CBBCC444323FBF0E487F27B6 ^
-7526D5DF7B2ECFAC7BFF62DD7A4B5F38463305F8 ^
-0ED7C87B68F50813AAD5E50159CBE0BBF9BF05D2 ^
-4D5CD4E40A6668893EEA15F025ECB8187475DF4F ^
-D38446E842C0A94F175B772BDC707CD2EE79D098 ^
-DDA868BC2903C55CF273F48E9B92C09D90CD0179 ^
-0841268B95ECFAAB9FE3787BA7261227A1F23294 ^
-D3DDF20B4C0DB668421DE1F242B65A8C83FA867B ^
-112F3CF7DACA7527819D16704EB41302A4EE52AA ^
-96072A3EA4463A156B3BD9EAEC16ADB0905160C9 ^
-715F195F09E3EAD3D70AE51DEF1C9709500C0A6A ^
-8A112CA82CFEB5F3001B7A00591462F4120DDC02 ^
-50FC91E915270D1202F6FC8792BE16ECB73CE405 ^
-907736EC45BE7BEDA1B154EA282C51B5795991F8 ^
-05D49462991278720EB44BEA656AB4442C8845C3 ^
-6FD56D08A2D4630F72AC97E3C94A9575F3046729 ^
-DD1883376CF713C8D7AEBFEC60D51FF8E2A806E8 ^
-E0457FE00F9DEEE958DD6AD948EDF9CD9412F73A ^
-BA6538E91B276504C84E213B325B4A7703E924B4 ^
-C20A9B848503650DE9463B9992EB977422BB53DF ^
-BA4A565E5C0F9FAC89D55A2B784F291C7BAD4255 ^
-6510E09AAD8288AB81CA54DD5656DF57D0EABBE6 ^
-33996C9C5AD04883BCEB9771A5C4A272F88550B1 ^
-7B96F3C1272AD765DBDC35A59243F6A8F75FA351 ^
-5AA76B16EA4DFB267D88FF7DBE4F055184A56E56 ^
-33B9CCEB1A6EDC8C91F6034245B2E3AAC898C678 ^
-701A32FC0B1163BC55DB76FA46F69B574B3803A0 ^
-5D6F44A4B5175BA873BFA3369DC8BFB0AD1AC26C ^
-0727F12D8E554EDCB435AE3BD6425B197DF6EE2E ^
-6E1F46DC4FAD671759AC969998694BD79326246E ^
-85233F9CFD0780BD60240A22E037C14EB8286C33 ^
-B66CC7332341FA9261D96362F0BBD7B676F95E02 ^
-782A78F2FC32E0B627702C541341ED28B009BB6F ^
-6B7935265C529880DA5B166EDD660BAE14A770A9 ^
-49C298B1C10D380BACE26E907C213C90052D7523 ^
-49CE4D4FF9FFF6724DA032FF33F8C5A7792D24E2 ^
-CD2C4F19C12B086C071BB6B20E8E8210AFDD2D50 ^
-39710F77BE564C417C80CB6E4B87BE72FA805A40 ^
-F74A6A45F5B2979B5E773007B90804F322F13AD8 ^
-6FD6A34339047CF13F777C4B7D9E287F499FB19C ^
-FDB04F04D3B364A6953C341E343E310F2383A655 ^
-981E8717538CE98998E950EAD28596B527736841 ^
-E099987DB0CC61CF607C9852336CDAF478DEE33F ^
-E9C42F25A3E3542D1510DD09BF516AD809D42702 ^
-F7E580FB21C725CBEA563B193896862B9BEF7F24 ^
-D778A3287F68F47B0AA421410292D47805997A94 ^
-534DFE759735723649EDC89BCB063C0CCFEEC34F ^
-9381FB5BD26677A7760FC0288532755062986DF1 ^
-27E97EE829820399595DA0A0047B74D3C4E0DBF1 ^
-D38450071D1B079A9FD518D2F317C83C33094F43 ^
-0221B8E4D2FA66D2EBE1B04E679662CE41405E48 ^
-B9BC4FDC4A5CE00EFB911C3062D6F33304701C28 ^
-461B4206618B766C89E6D9AB2F8DB07903860234 ^
-122A9306B102F2C50B7364E1D24FECB0662E2958 ^
-61E91F5D167066EC904134AB1C4F9D116C9D3E80 ^
-6B7558BD8F4D3C5914A9AB5D7418F7DB77583B55 ^
-CE48EA94843854555DC48D24D32405DAB9DBA612 ^
-5A722AAC576F4078C001D06DA91C28131A4F92C5 ^
-9B8FE0F1E6573CC6832BA69DEC9F6E646228A374 ^
-F98429CA2799E5CAAEDDFB168B782A54384EF0A8 ^
-142877754AB95F57AA541CB978BA400E812AECC9 ^
-6D84D053CCD9E68CAC5780892409F61B39DDFD48 ^
-B58CC9CE0AE3DAAA02E3C040100D4B568D29E0FA ^
-17FB18FA32A8237D32CF83A9664B1B2E40DC5B11 ^
-C7F65E54E608CEF1C7A120BE8A29FA6C94B680D2 ^
-9C46329BA34077394B439C5476B91D9DF019BA76 ^
-3612B381B80A1DF6DA75AB2656BD5BA8DE6996B5 ^
-EDD9BCA1C431200D3234C099791C81D8605091AB ^
-C1951DDECB9796C0D39ED9AFCCBB65200AEAB0CB ^
-55E4F7846D9B90D8B31EAA5B9371D395590B6528 ^
-5D40B432ADBDF3A01355FFFDDBA47586B3DC7C52 ^
-AF5C675D2249F4CD20E70DC9E18B88D3ACFBD6BF ^
-B0EB6796A21876FAAF50FCDBA2EB121C4B742166 ^
-3C577C70B76810DDF9AD579910347312B881C30F ^
-0C16897D20C5F352FA6110C70F9A8C33CA35CA21 ^
-DBE0B4341526060C5B37576F6B972A1EB8954059 ^
-1567B10E33FBBE20033F5A52EB810348ED154F19 ^
-C1E47289412D3ACC208620A1EA676CE2815DD4FB ^
-ABC227EFFDCE3758061C77971860247E850382AD ^
-B29EACEC903BB8AF7CC1A63516163640FFE62822 ^
-5C8976A1A4FCC6B6FAB5EE631E3CDC561ED5FB10 ^
-1A1EA5107CC46BE909DF8165C3EFEE8676161991 ^
-268E86BA3A81FADDB20F74DD44C5BC71A98C3D08 ^
-05057E5E7934AC9A9141D39B8D4F5EA6AA14F74F ^
-C03EA72C4D68945726DF63803564E434426302BA ^
-54AF20BFBFEAD6BB2DD68E65D39D427DF7E17FD9 ^
-FDE938DB0843A844DC0F6601497A39ACF167D6DD ^
-ED0292D0BD869B66E80014824A3D7886CD6D3590 ^
-749B69964F5C0D9D02BF5CF903B2E56D09CF1B9C ^
-6B143D30366C45F159B83A8D1AE8AAEC88E44136 ^
-01169D65E71014946D0BF64BF439068978AA5B3A ^
-4C36E0A8C19C0AA6C80DF0611BA3404C1025E9CC ^
-A4DA9EEC2F682AF5B2EE7CC8525EB07DF66E5945 ^
-F1349AD0124D11613CFA46D498671484E5F37790 ^
-6A8E82D2D27D3EDD6E8B119F746761B8FE83182A ^
-52E7C7C4AE02659953079DAE20F442353EE2BB29 ^
-49C8D822724274B85DE62D9DF586FE880AF396E6 ^
-57866C0BB976B4F8AAA7ACF3C9A0F700E73216DA ^
-541A675DD37C5D6F2CF242163A5CF6B728DF9995 ^
-55B26D9344D4D644CBB69C4789473543262E8B91 ^
-3A8F3F0A96297020EEA583E9A280D53E0248DE26 ^
-D1FF7A0CD0B69A76B5B80D2BB5736B8440DA7F7B ^
-53E715FA39D3732F38FB4748D46409D998D67973 ^
-377781ABB4AB4E974B9C1670867E74F87AB4950A ^
-8E7DA96971265ACC0FF7C381127C966DF9F9F13A ^
-28038713A33ACAAC730FB4DDC3A707886E598DD5 ^
-5F6BD44D07A1C811D5B75661A61BB69A81444EE2 ^
-D465E6C767BD02D457D601765DD0FE5521BA2AC7 ^
-487D9E02912004E961968F387C21A65A0E653AE7 ^
-1F54DF00052B3740301C43420CC2CB85B2770095 ^
-7C5BB678083868EB817E616BD09421B910021649 ^
-4D31526E4E2FE3BD6DD4B3F59DC2EE2A52A9FB42 ^
-669F9FA9D71FB92D51ADE15C70742FB31B013901 ^
-38D1E74FE26AA43D45DABC160DEFF113B7740211 ^
-3724EF50CDEAEB856123BEBB190F38834461664D ^
-E2634112D2977A179D4C9AF35F220D3A626AA04C ^
-F14CF8133FF66A3E20D25E5DCFF70605F6B8A0BC ^
-809E04A38340D010B78B5287C8FDD20C391FB61B ^
-E5349D4D6EC31E2CF41001DFC440ADFF6D25B4F7 ^
-139F25FDC344EC2456F6E4DD9938F65693F0CB2D ^
-7C628B0954D4340B0851C89F1106589C5C6465C6 ^
-E65E65D7050258B6B6B5B35866840B5ACE0DBF0D ^
-77D33B87E0C13529D3AAC4D6606213EFE81FF398 ^
-5BA456BA49ABE50BBCB772FAACB71D4F3AECBD45 ^
-801A21F7AB73585AE3531058DB9512BD69BA5CB1 ^
-192AC4D5210EC863604FC1BA388AEA8455D4175D ^
-FD9F103EDFC4CC9F9C424266EE54A79C1C987F9E ^
-361AC46D96A69DD6E416D4563D7C69D3B487EFC1 ^
-3A7629045C0193FE08928F7D41B801827593116B ^
-545B2F5FD015F81BDE1DAFAFCA184D25590560C9 ^
-FEF2C50DA33621206450E21D92951B25385991A3 ^
-913A417AC1ECE08952A60E0035F70993F161EF05 ^
-4FFC95481F6F625B1B8E67B133F11619CE5C1460 ^
-5D6D0765B156FE028780331B6A53F84DFB130F0A ^
-2C5EC89F1018D34AB11E0CB6FDC812F82470B168 ^
-34D62CDFF955233FE7A5308925C24CBCDC0579B8 ^
-1148994D30F80C5689D7BB19CFBE33546872B4FC ^
-074FCA22A8A63F446C8D196612F7C812C22CCD8B ^
-228FE29FD13928D8FF0B850E50DB41DB406EFCBB ^
-EFF7BBF8F2F7DF36AD51EF3D748AAB8D8DAB7B7D ^
-C3AEA6AA17971C0A143ACE54A8CF515F9EEB0BD6 ^
-4C3A980E40602D4621C2AF1BEB1CAE27DF19AD32 ^
-E5CE2A41C72229D584E40FBA67C697EFA08F451D ^
-64A5368264959C73FB0A12F85D4FA16F8E25FF08 ^
-8FB770AEC165A93A6D99A0DC52F38444E0313073 ^
-BCFF3C5E5C56876A3DD8C4C90D4E819B67D71394 ^
-0EF20523757E25611C49C1F259D94381B08FB90A ^
-5D9F05DAB91C46ADDCE4B163C6FCDFB5230BDFFA ^
-11B3BDC5F3BE09148DA07CD42EC9C28C718D6A5B ^
-1EAD76EF18840B3176296FA57791D832B7E4035C ^
-AF8EBCBBDF5B8CFC203FBD8644B154445690B02E ^
-0A156DAD35A10AA7E41C5CB3B3043A051B7180B6 ^
-9B3E5F797BA246E5DE660B9A36E52C204BACE822 ^
-78780359CD24A2B7157FD6D55CDFA6F9DE149FF5 ^
-F2DADAB4275633F7ECDFA971D824A31B1C8D6643 ^
-EA68BA8F16D8368E6673A5C5AEE86BA5C36F2D97 ^
-788AA9451196E2BDD031E747B098D73BE113C093 ^
-18FE259B3573F52F23DAD33F05D9C91942B516DD ^
-0E4787F46AE8D5D7CC9589B76D00D60983079D75 ^
-148E4FDF031CAFB726099DCD1EB591BC2F24D179 ^
-3981DF8658AC2FA5C3151A424262324D41940DBA ^
-3C50A3800636EF877D89059F66CD697A9DF44BD1 ^
-D9BAB0471E2DB97FD5F3A42884DFC708768F62F9 ^
-52DD1063326E2550B6EF40D5EE4E1AD67C7BB6BA ^
-13CA27827127C698810AECA158DCAA7894F0C912 ^
-086BDB17EC1B8CAC68030A56FBD4C741D4F95DBA ^
-F7F389BC5ED225BD6399CC43EF22AFD77E895D06 ^
-67F173AD3A24C26E95E2EA8B37FC0259B1DE955C ^
-A7F348A3B6F67CCF7C7C69ED065B3FBFA832A8A2 ^
-ECECBB25354468FB62AC87D5CEB688E4A671DC42 ^
-62330BC400108DFAFF298EFB76BDC28CDC153AC1 ^
-BB0ECF9CB3CE448B4EA9C57CF5F1F997F81082B4 ^
-12C9741672CE8DBA14CC66AF3338B61E234F9E68 ^
-DB4CB5961A2FF6964CEDECAED3DA03D140112EA4 ^
-45E4D2BE3D9729BE9F69ADB245A5A9CC75064534 ^
-E35253550C84BEFC26C2E97F0C236CFF1D85C36F ^
-7D6D950A168107702CE3B6BCEF9298F9C8FC8F3C ^
-812F459AB5887364D1F2A9A00CBEE5FC352C39A2 ^
-7EE27F33C59B68C34604416D38606BD3F5CB6B06 ^
-D57E2A4F15DF5C50F2485909EE3149735C6DFB84 ^
-3D12D88B61EF0972808D8CAD41D8A16AA7ECCC87 ^
-CF9A7CEA9B105ADAB6BBA3CFB6D090B76603F7CE ^
-1D43CA164CAD0B616BE5763D7F5EA88355953F4B ^
-3600F085A53FB0115C26DA90D1180FD34EEB6301 ^
-E9F9C088C30A37E6CDF067F724BE6C4786F27C9E ^
-2BB86B47EA34400D434F8F4F94830CBDA9D4E573 ^
-3255A7D9A7A0B56D0D9C665EC13F7A8C8F05DA7B ^
-453597500A7D5BEC8CFB950926A2BFC0F92E149B ^
-A15EC452476870AC459B942F6A6B73822A07899C ^
-5B1821BFAF917BAB3DB1284A1D1FD40EA011BCBC ^
-8DDC25C7CA330A18CF39827B7CBEC00B874AF193 ^
-283832F45BB5E69649FC10DD607BAF8BAD61783E ^
-F39426F9C0474596B0251F0CBB5F92385D862D24 ^
-714E32DD5BB8FCC75B1013E6F1F56F96D97B36F2 ^
-988AC4592D50113B13F6EDB5C113A22E4D0F518E ^
-93BF1463788B7F4A4A06AD4C17482DC260797A3F ^
-5532535ACC8AC5668977B2A2F322B23AEB443DB2 ^
-85CC7AF0929F206FA44FCAACDC24C4E78345BD80 ^
-392196E3F2F4074D1D485A52119012D8C05740B6 ^
-3BA88B91F1EA18E712292301FBBC375E9B48BFC6 ^
-3DAAD1DAB1795F2C1C8C5CF5305B549ABFB85398 ^
-6EC93AFA3AB617708276E99066FDC331C84F028D ^
-CDA219303B91AF3C3FBD0B926758914984AD7C8D ^
-599CE24745EB5408554077354BD10A65F6BC3037 ^
-0798C1B53F949D643F7BD66C194715E7CAFC6E19 ^
-A17230F164E98AB83AC1141730B23389F0EB473D ^
-2C2B95173F1B06165E17EAE36A53C7AB641267C3 ^
-A7F408EF449DC92961617D4C51B55AE4E4536E97 ^
-2266C5133B6D6B08A09897AEFA355C768F718C6C ^
-343F10EE6EB34DF005E749D1C4A98F64537272B1 ^
-90EEB76B126E632308F8655FD49C52000027AA48 ^
-C7EA3C7D4AA8DCBE9580C4434075017934268419 ^
-455D4E7C988356A56588C40313D28E425AE219F9 ^
-5C0F3090992138D34B4E33029CF83A64ED8AB03D ^
-CB3C5288839D6FE79EB2E50D3AC34BBC4A942E46 ^
-E605842205079D83BDD489DCF6F8A2D1EE074C60 ^
-ABCBEC56EA20B6B369C85A931B2201FECB826F4A ^
-480C1CB97C3419DA610D9783E6047E6C9A6101A4 ^
-874818464DA1753D3AEDDB7D3B46E2D04614D7E6 ^
-C95B65E3A37ED4A2FE2B27A2D52BF1BFD307ED20 ^
-5E188A4F625C05482BF161C45F5094844CE70461 ^
-6B2EBCFE74E0BF32480D4BCF9A5698A527AEBEAD ^
-ABD3E28A2A528B7963EA8D8896651A17337304D9 ^
-B873FDE2C312C2279EC8950EC2C2E9DF990F006F ^
-4F1A18714689BDB766AF686623BEF08DAFDFE1F5 ^
-BA886793A89E7EC62692A8690164BF072EAF7AA4 ^
-A15C8DDAA0448DE7B361552FC51AF0D72C0737FA ^
-6FB516CBB4CCE9681C44EFABABC7A26C79C79CB5 ^
-C6DA89D3F7EC4D2FCDB36432042A78EAC9F04DC6 ^
-2A94A9023F7D54DB26C8C2A6A4C951126712C2E5 ^
-B0F115B8BF0A1464A378420A1F1F574AA1869FC8 ^
-A3C1794F58FFDC361BCAD4779B5DEF48E02ABD1A ^
-2DBA5D80C4B17167E715A8012876095577030D5C ^
-062C3CB7A059766125B368AD6C19BE8FAA981950 ^
-ECEA96EB623919DF4E22FB106616EF1FB2ACF5AF ^
-C0CD5E555861FFBCB2FF4045A46CE30AE6CA1758 ^
-A0150D931980E1D82A21928837F7E9E198E5D1B9 ^
-BF877B202812184CA74DE61FE34DB95BA2AC5D0B ^
-C863A0D2232E901920752F2AF92C201FC73609B5 ^
-C54E676209D81CFED2E7ECEA6F7E35A5459A58AE ^
-CBF376E8571F81792AAC49BA7E1D7F41713ACDCE ^
-9CD248C07EEF6303C71901AC484F30788D9269F9 ^
-AEA41C5B2260E0DC57094C5E1F80A70B85E79E77 ^
-B1016F26E32624C5328566B243329A2F75A36D06 ^
-3EDE118F7E2764CC49FBC3873508D38A2C6A4592 ^
-03DF0C882FEED72F81B303414178976ABD089EEF ^
-2A8E36B6A545D1ABE7B02D6DDD782AE032F7ED41 ^
-D90588E606FBDF3CC6030756DF92FB3729441E6F ^
-BCC413133B6D84621B482A7D2163EA955AC733BF ^
-BE1F36D34DEC54306EF20D8326FF603A716F4331 ^
-A2BAE41EA01E8AE9D59F5E8E663D22C9F414B0F6 ^
-D2295FE26206DE9ED169FEA487B198E7CA0DE78B ^
-06B13130DD10C94A24CB50DE6A612867F85E17FA ^
-2CF4C4F2F270AF63D7035903231CF7E7180E66E5 ^
-0A9EE3293A2C9B2ACC2F9B99BF17AAC618347857 ^
-C338F14C156D8777ECFC36ADF1850B64EE9E6179 ^
-E9BC6DA35AEB1CC399733CD0AD3B22E4E2C83E92 ^
-7A42F820210158AD33935CB77D78C28F9FE7A940 ^
-ECDEFA7817A436E43C3DFA35069F87948181A58A ^
-761EBF336F1229BF80702C9C7798DAC37ACF3086 ^
-1975B716880B49BA0863136736942E688C9EEC7C ^
-A4232C3227DBB91581B86FABB1C5AB0A29801DFC ^
-49947AF1D9488F146BE4C77782CB2FCF6EB13FC9 ^
-A3402AE17DB9E6EC899B0E15973073CF9404A2DF ^
-DCAFC2DC5BAB38629DFA0DE1454C300E5B9A2D66 ^
-A7F915F745E30E4CF6AFFABF214AB6D950C66FAE ^
-764515277D4AF73A14FAE2D9CFA4F9BAF306CCB5 ^
-B021EB08A436B02658EAA7BA3C88D49F1219C035 ^
-B97FE9E1C5918FEFBEDD986B757CCF4EC4AFA75D ^
-6917353596BFAF1A5A06119ECDABB37CB017D71E ^
-FCB4BCEBEBBAB66142AD2A5B35AB5DBF78C6A463 ^
-BCA454B69F4486960C633D2C4453FD01D6758BCE ^
-5CD25E62AD97AA5DB3A9CEE99C58439DFBF6073B ^
-E8405E583D31B3B8E8B365087F2AB391753324A4 ^
-39E32AE405420DEB07275224817B57187079886F ^
-63AC20AFAEDAFBFC018755F4CEB13A042BDEFDFE ^
-27245C74B61D19EA28FED81E59AA48EFC22946C9 ^
-7254C8F5A2DF0E747760E2EB353C4AB24E253602 ^
-32DD49B796ABCA76356AA9AB07D669CB7BC7F899 ^
-B83F3FBE6DB38223253344E69C399C474E4C64A5 ^
-B3E0EB484AE5B10B017F509730F350481A60F634 ^
-A99FC247C177D66CBC6C21C10C21E10FB2F33EF9 ^
-A7D033A946AA0315CD2E4B7025164B77E5979CBE ^
-F2DE5CD912D5CFE727B353ADECB6B7FD11E80189 ^
-111BA90582E17CB5E1BB70AB72C99FCF647876A0 ^
-9AF7F1A742235C0E396F6D1319BD1104518F8475 ^
-923B3E5246FB50FB5448742B8EA8CF4920E70702 ^
-CBFC4563334D104E4DF24443A295F4E9A7D7D4AA ^
-48F4BEDE76C6DDE9B72A9FED50D0BDBD0DF7E7AE ^
-2A21E7828C064DB0D684561622802C86A504DD37 ^
-2D599572D6E57A437A2A845546FBEF9F2FA11AD8 ^
-CB4CFD92FFEFFDDFD87A4786D60E28C7622C71DF ^
-FA6DB9D1EB92461454E7DADC36C9CE7A1F30C63E ^
-98C264B7CDF774C7D82F4DA5E1160AE4370665CB ^
-D503D3C5CAF7A2D124A7F9F0E7D8D0F5E29B6F19 ^
-AEFF5AF0023868EF6E3AD49F2C30D65E963B6308 ^
-73B1464B9D05509BE72E83C819F9D618B3121336 ^
-791774666D2629D4304BC81138B4D8A7599E77D6 ^
-362A2D419BAF263F1E77C5689F611AE301C044F2 ^
-B4D4796D1BC1851DDB75F5D3BA3089D1D0E0A15D ^
-B7C4FD404A73C0AE43FABAEB471FDB6F9B24A27C ^
-B9DC118349DDAB37DD82B65E092277C1E2F20C5F ^
-144782913DF2FA8F76D210A7A321F362FA5DA779 ^
-29D64351A178E52EDDA9A4B2F5279B70F3FEF39C ^
-31098A70FB95128BECC2C729CE5A2A4BCA121845 ^
-9C05D6B171C60C37822CDBD7E8C1C57286E27461 ^
-6FF7C4960E35463A8FDB77844A29DDAD1FF04F53 ^
-2E08B9088646737620F1B448E81EA5E42C40C595 ^
-AF2342D8F4BF12F9E524E44BCD42066F84620727 ^
-543A1A99B497DBB7776403F3252A9B2E11A0610A ^
-A2A46BEF09D21A9BA32AAE4FCF7A846D128F0358 ^
-81960A20A755F84B3623D1E2A395EDB12DFDE73F ^
-B016C90B350A5A9AD4C1F3AFE49E3EB21AAE8B7A ^
-41D03A8D79E8BAAE116C2F5573D869D97D7F6E0B ^
-831237F5BDAC37C58BA31F6131982AFE680BAC1F ^
-2E8ACF5FDE18542BDC2D0B95D3AED7FC48B5993B ^
-171763D880D45885EA61F5ED04BB51B79C6A2724 ^
-405AD282A2141C38D3D731F9DF630667064B9ED0 ^
-07F2ECB944D01DDF9C68AA68762BF07F385E7E6D ^
-EB5FEBB813E4DD7BF852FB32466025F7D4E79DD9 ^
-52DE090DB027385F17C9FD41F61272525FE108B1 ^
-103E352A261134E1154ED3C312D890646FED38AE ^
-65C73969E35E8F307B518ABBDE85654CAD13D0C7 ^
-FB380C0099EADED9ED8DD48D70E15C7A26E2F417 ^
-EF9E122E0B8F968EF262E1A98BBFED7B461846B9 ^
-771A162BDE3CC4C07BE7A1DD25470286F133020E ^
-5F892353DC5C65A1D8C9510ACEC43DD96F432742 ^
-4E658B8743D510221B968F2C78C72A588A5DF6D6 ^
-5D5295ACEC24F8A52ECC5B174E4884732BD216E2 ^
-7791BD0E1C4136D97C46CCD66D36E98443C4182A ^
-515419AE59BE4E824E575E497F361C3382C21783 ^
-7669D0D083B3A0A7B631EE4871AD2A2AF8C512F9 ^
-90A1A9BD93501D9AFE5040DDEE395F94E5594EE4 ^
-B8E48F79618CDE951296F1D28B87653C3CDA6FDB ^
-FE94D5373EF009ED2C06F632C739717791EB6BB6 ^
-B5C3871DA2466E4635DD3BCD085A2B8E222CE8F4 ^
-43032D022D24B65394F7A707C8441C2A7F3CD980 ^
-87C13448017DB3B6C553250C59DF4D3D57676788 ^
-F38FCA4589543051935D4F1525710AB366161F22 ^
-921E3C3DE773F987452CAE28D3C10DF9804632DB ^
-32308D5BCA33E694071B8C17470C6469EDC1DCCE ^
-AC5258297BA22FE60B464DEE22349C70FDFAB219 ^
-599322BC214D7248216F0C6ECF00CC34C792C5FB ^
-99EBA91FAFC27288B3FF32DE55BF17BC6D76B16C ^
-899DF7C21779CC0F54EDCD441051CACBD2B06941 ^
-E5E0BA18BF3C99062BA444847876C5CA2DB8F9C4 ^
-94B8B90566B2E3BDDA8FF8D37BDD9F95CF9BE0B2 ^
-86422BAD65C5E0B22F02B9D1510B9D24F4227AC9 ^
-427694B772A08400381D472854FA5FD4D4CC1D62 ^
-3732DA8EBA84CB4591DD4A87BAE958635C85DD71 ^
-D41C28C028E42AD1DF5057C97BB953B03AE8F6AE ^
-4C44286F5979D44AB4CA5E3776F30CA04CE539EC ^
-E695D9B049A1497A86765195BA7884E8869142DE ^
-2A5DE9C5489375B8EFDB09CA29D32FDADAA07402 ^
-012356EB46A587763ECD1EC9F3114B8B8B7987B7 ^
-6B803DF07E5A47FBBE412149D8258B526D2BE96B ^
-14A1090C3B382482AAD5EF49B30D842317792745 ^
-C2A576DE385017FA84855388EE6CB1F51F43A6C4 ^
-5746B8C88CE540313A0429E64841ECD0AD569299 ^
-298EFB87E9C09299DEC17171902682D919899C9D ^
-55AEB7930CD6202CD52E6513ED4C35824B574198 ^
-ECDAA8404F88334E9C2C6FCC9209795581654C25 ^
-061FFFCE8F69BE0D0C9B63E30BB065C6CC73DF33 ^
-229F3A8BD2F6FFB5CE2DB330ACFBC4C4D7796D7F ^
-0BABE60803248059F3B05E06E273B5F41A619C9A ^
-5F496A5AAA1FC38B76069BF9F08C63777EE7530C ^
-91FC8994FAA03E9A2D9D565F04478C6DF035AFE3 ^
-A68552B9049E192BBF98E82E2A69E405FFC2D93F ^
-7910393D1D9D8B876EC89FE9100320D371789C23 ^
-9B923F97F2D2B057950DC3C0E89981F22F96EC2F ^
-1EAD9C237CF3B1CB95E7ED79EF2E5842E9263447 ^
-F51E5C202D698C75F8F0C2926081D4C28F641812 ^
-8842D9CD97868196B31F34C02BA63CE34493DCA2 ^
-26C8977BC36C3298582CE6703F62DFE4488E0DDE ^
-955BEF358ACA4D44E33F31051A3B92D96BA669E3 ^
-68D841B29DA285DA53A31E823462E794B3126914 ^
-BB52C1806605DD37113035390D97036EFB3FE2BF ^
-BC55772BC9B6066112512E1A8B633411B9508FA2 ^
-BDD2CA4B43157C04CE7043F57B7E2610D3E175D9 ^
-8E493F25E110F6244FBD7585CF18F285933950EC ^
-650242DF99E985DE23A5CFC25C8CA72C80D7F23E ^
-56A061FE49B428798C329336D4B184BFE69C4102 ^
-59FF817CEE946CB948056227607A119F4C7DDA89 ^
-BD4F03F1878CEA86E2AD981C6A80701E0AD30B4A ^
-A635F528CC4028877184E8918CF73E1AEE6F777F ^
-15DCAE87F7E40CA577C61C2AA5B6D90F0CBE6DCE ^
-D67BD85A353CEBB99ADE4CD86B54673DD6D64360 ^
-1619DE7229032800CDF071830CBCC3208B1EDB09 ^
-09DC18BEE0C2DD9A2C7189AA6D3DEB8B7CC41CE5 ^
-4165ED470D85FEDD9593577A9101306C31825E00 ^
-C52942DABF4F9D72B31B2B3291705EF5201B3343 ^
-88296035BE79F5281B91C0F1006E57C28671CBF3 ^
-82593804880F168B9FF50D89CD149E9F263EB557 ^
-52E4F42FC2EC2EB7C0A728D2251A14A6C5EA5A00 ^
-C91B243CBA2031B29F365BA4451FEFD6A902298A ^
-90F6F5A65E6BC9430A34C06631208AAE8B7555F5 ^
-7535D77C8809B4EA21678BF9686791418FC71931 ^
-027070AC6B5D77BFA0398B8AD556A23AB8E99EBF ^
-B48335F6FB6EA27CE2156A1D3E00E42D3E3A8489 ^
-B67303D71BF125F2441BFC599106177A32E43BAA ^
-46E98D49BDC5A4604F62AAF76E964838291BFAF4 ^
-F1ACC562D96999493EEBD2531A289264C3E1BEF6 ^
-0B261712C3F4D0D74EBDDD052E1A058BCFF412D0 ^
-50446AA7A1A81A97B1DD524AD0DB4D09971D383C ^
-E3A51B6AA5AA586803EF2183DECA0CB5CA869B11 ^
-C81B52FD60ABEA8CD5E3184E206F693211F008E4 ^
-197270C0DF693622DFE871857A7C87B7BE2E439F ^
-43453DF7620D71CAD56DEF9CEE616AD9E7C73EBA ^
-3E3C6EE1141AB3D7EA5215ACEF4E876EFA89D03B ^
-5773C28260C2B2D325883AE73B04D28BFD2E8884 ^
-EB6F26A0E774022773CD86E1C8DFEA461CE6F8F8 ^
-6C26410B11A0CFC97849F6E43E77B8E48D5C5363 ^
-F0236CEF2298ED3D86A95E9F5247C17499A772DD ^
-704B5496CE0AFF4289F3D915230F69ADC7A1ED7B ^
-B0D4FF6B50F09FBBA19F76693AC9CA87768E2758 ^
-10DE4F687577CCAD9E16AEDC9958021D90DE8726 ^
-785741949059E8508DB8D132A9B053EB4277119A ^
-CB041BAF13AD22778A1C73A8AAAB7458B664B1C5 ^
-B4B0ADDBEFA078AA497045629840FD965BEEC33D ^
-68F0E43B7DF89F484F3CBD6984C95168142E4A82 ^
-D042BE14A23D0CA1A0466179C119F2A959E1E118 ^
-DD23CC2824A881FDB6566AE6A57B1A2D1624E895 ^
-15B75E7E13B374039B8C9FB4A1122BB8A22FAD6F ^
-849F0D379A2775CCB5EBB0A88839516F30A665FB ^
-8B4125FF2EBFA9459075459C1EE149D68C4F98F6 ^
-1D632D3EEC63D18243FF48702AB894EA05A1AED3 ^
-F2C2E1082004EDCBE3DF96C25D8860C0F5B432BD ^
-4B96C3C284E9E12C3D2F18AB8C8FC6776F30C6DB ^
-F40DC8B94D9FE9910117BCD66F3FFB22F6977447 ^
-D65D126DF604DE306AEB41A641DE0B214449D69C ^
-90FBEFF058E825EB940122B6D8B7492FC574B32A ^
-AE4414AD47216DA0AFD9AD1E22C882F665429C54 ^
-5F9D97E91B7E4810AE765A09803ABFA50B6F64E4 ^
-A2D4E6AF7AFD87E303E867D0E03E1945A0F0B72C ^
-14ABF713982D4DC7C1CCFCE7A48680576082DCAC ^
-BEB8F77A7D211D9451B698D65FBC0B5E38D26086 ^
-B35F660629962D5F1F8529203999FCA0169F2675 ^
-07AC5B04166E739A9FB87FCCA74112AD93A08128 ^
-2D8272C9D620A730561EDFDAF2A129666CEBB5C9 ^
-C25C1971EAB264F44CEE1F44614579EE6D8C7858 ^
-76F8234E2F0A533E810545F79AE28A7C46056AF3 ^
-35025EA09EA111E299814FBC958977DDBC3A2387 ^
-0A2EF548A38D84F6A1CBB2AE01D48D296D6CD8FD ^
-6F546DD1623E92DDA185BDA01618DF7E7E7B82F6 ^
-A0C1C2AED8C3F436DE200E2A3F4C2A9D2DA8DD7D ^
-8DC10195B967FC7FE57B338494C2C42FB43599D5 ^
-0D9192B27851CAA766D90A5376CE255B2FDE906A ^
-7799450D003824356EDFEE1B408AA59E830175A8 ^
-2EA6F3188D3010EDF4EBB55E009CC4D99296F578 ^
-2A73ACB83FB8E25D65FBC1B8085BE67342F5858E ^
-67F9928A27118ECC38EE231E05977A694AD0F7AA ^
-27E2078CC9FDDF5C5DD6CE629F3EF071B2107936 ^
-F50540B4DEE071C64D861872F1E0BC4C7DE75B52 ^
-87DC9AF771F2EE543F96DB0C924AE650A063F854 ^
-76DB885DD797249A4E2F794171DD559FF056A9FB ^
-9AC2E9CD3881BF14D758A7FEBDA81BC9DDD31652 ^
-D3D8595D75AF4D1EEEBEA8166CAFB156E827DE90 ^
-5F7D9D9BD0DDC5A2AD4772610FE2A4923A826486 ^
-F437BB6CFAA9139A1201FEB58841B18C3809F00E ^
-8C3EB402D92E6543D885A9FDE2FC80B9D4340E8E ^
-134307C50C24BBD7822DBA30F644B874EBB54F0A ^
-24774DA4669C2037F7B2A43BCD1C8D574715F071 ^
-69FEF8FBC9034D05F3C9BD9C663D2198AB48FA30 ^
-0390F1C49421806B19DF1F886902F37088DF77DF ^
-DD535B129F482256503AD2744B712BFEB8BF216B ^
-ABEC552E41020144EFE06854149BE03F1BD7F6F6 ^
-3FC8C8A14D1452713E76EDD5EF95C239F3F8A4E4 ^
-8861A84429E238D94E75D3CC191FB4D128215F7D ^
-DBA6377C376AED4D1E79C198EA864B6E6D90C494 ^
-4E5DBF823DC5BFF56C999A1FD0ABBC51155017D3 ^
-6699420C6FF512BE5CABFE1EBAEFB0AE40CDD902 ^
-77CAE0D7EDFD2D13506D096D66A32B9907AB9B23 ^
-F6022F2A1545842915029B344B19F4C69757925D ^
-6ECD085FF34032636E7BE7269D29DA62BC4BFB5B ^
-60CC512BE506BE1A580CEEAD2A009DB8D7A1BBC6 ^
-0F34DFD7EDFA6A5DD132B2EE77B52EEAD98DC701 ^
-1BD542585AB33A0A3694BE45D6C7EEBC266D4806 ^
-1524F20389EBC2D7DE777F96156DF9B2A8652373 ^
-451282E6DA707668886AF7E77DB4C58F73CA6EC2 ^
-BB7D59890BC39F7F87D4DD7E2583C737B2B40B86 ^
-255D67E3AF65376A1D71FFCCF505812481AF182B ^
-4D559BC171516F79E22938DE999685F9FF05383D ^
-2F7EB16081B2338D631153D5B70DE67F050E348F ^
-5902CE6CF7700D2E23CEDEE742E273F4A6A39F6D ^
-7D37A7515D1E04D44CA0F314306919C0307FF4AD ^
-18C215A5B8AA9CA5C55DF8BCFC79683E9982B159 ^
-63520C9DD2CF321388DC89CC69D0D9F6772A3553 ^
-5FA13E6697196EBD0E40FEAED4B945CC93375DAD ^
-BF8CA60D07D1B69767056B2F80A9AC4B1F9FA99D ^
-6CDD13431EB70D9E346102B708E9F8AB233CF959 ^
-4CB448B4131DEB8F1AC3085765303CF214436A26 ^
-1FDC9CC58A748A9478A9E55C66C6446775382ECD ^
-0EDC5CC7CF8C6CB318616D62CC08CD1449960315 ^
-D5D0D540287D21AA519CE90B6E3D81958A2E307D ^
-BA5CCD323B987F54E06AE04A09957BC417ADA611 ^
-26846FD68BA956CEB2899DDC18324843DC211485 ^
-12BD70565F701BB35B87364B47F73C93287E7672 ^
-C57A0F96959C7DEDD353462099EFE380CB273E90 ^
-9900D5268B99165BE1AA2A6B41B9FB66455B865C ^
-D5AC2C2BF36B04EAEF95E8B93958BE28B5A4C836 ^
-82788DAA7F95292B266CA17E86631D866D68FD47 ^
-37B9E638610418C4CE4CF9AAC0D3E64F033D3D74 ^
-9845A156240CE847508A1D3762362FA90216E59D ^
-9E59DC76EA01567183A4B4AD65CD31F169706CA9 ^
-B2B4A1500A176C883268447A09DE920F0CF77F76 ^
-E14FA11B60B9389D3B9B2C1E7C45931992F666AE ^
-922D169C624E79DABDB79B76E777F6994C339EF9 ^
-AE99C2F46A3939CC5EE3F8CF68D6EA486392C23D ^
-154F915F90340CBB03B9514810FD399EED06CE3B ^
-C440E1E74C75266822919080966AB74D96FF43E2 ^
-405155FA99EF5E4A0F4E93D107CAEC89A80B94A2 ^
-0AA9625455A0CCDF37D486B4538E790BE407A59C ^
-46D633F7F2EC56496D53138A56D11D9ABDB701E1 ^
-75C1BD5738EB5380E25EC4FCFCC7BB3FD8164460 ^
-B618C9E52303919BF762D452F5681D23ABFF23B6 ^
-D08BE1F5485939677D294C4198FA15B118938B3F ^
-F931441259B793DABAF082D1B0024ACAD3CB48A6 ^
-096E206E3753BBEEC8F0F0D3F97EBF2EB3063B1D ^
-13AA397D03C60AA4414271D33CAC2361C138422B ^
-777E2979834E8C6E89D219E9109F0A2852961EFA ^
-13960A648DB8B7CF541A56B9009A5F7FBCC1ABAB ^
-B3447A3C462B53945F8295032FC9A057BC301FB7 ^
-8C42386A2436DE83E1959E92B44EBF61E6C8D093 ^
-D9EF91B04DD4371968E1978CBFEDB50C2BABBE67 ^
-E84042479D1D669AB5871B71D1342AD6D15105C2 ^
-4ACD112CD8CAC72DF2D4DA76910C2CD3BE1EC25D ^
-AA20982E2B138FB2407EF99509075CE8366F10BC ^
-5E3BC535BBFF471686885331CD9831C80FEB18CD ^
-53C55C80D64411221C7311654921523D2BD0E227 ^
-3FB8C850B9BC7A923767D036992AD79ED7F0E1AD ^
-AF0BCA4D440D6599BB91396A0823DE64764C2112 ^
-30B13703A702572257D54DC09463768F5AAEF759 ^
-59C44B99EDC297B476402310044554B3F29F9CCF ^
-FED078596C584810E5336545F6F6B93027D9CBD6 ^
-6499E70E5455F9C8FFD2D5F600009A43FAE710ED ^
-D26C0718A9C8222F30D021E8FA6508935E80BC85 ^
-1F4152447ECB8D7CD725B57B65E30F79B466BBDE ^
-6C4958665DDDFC828C1427E57D23359E9C5D1190 ^
-B88EAD843C4897B2A691612B837E5A5D9F58172C ^
-A51097DC1883B160AB799D2D103C443336EAC2CA ^
-5DA1B85BBF4F3912C5E964242A61EBE83A3DA5B8 ^
-4E9A45C0410F0211DD4D9123BFB8C29C53A5E03A ^
-C2B7C89F7DEA6E5A6CF909388471DEC4CA362255 ^
-4EF3B7E7846115212B3E77C29AACA6198422BEF2 ^
-78C74563BB2CF819F83E73CC00072378C114639F ^
-FAF96E836C381EC80FE1EA8AF76E9D8D8AD95FBD ^
-3B30A2BBF84AB70E8220349CBA249DB87FFDCBFF ^
-6CE0CC298D12597F801E0F1BDE66CA9DDF6AE66A ^
-8274B1DB8C0C7390C383C837FDABDEBBEDD1A8C1 ^
-D0F90D63ACD0126C84D714AD7C9EB673DFB459B2 ^
-D1E63EB5C373C78EDF968E0651DC1171907258F7 ^
-1530DC99565BE2B5AE91D1D70B027EDFD4EC6E93 ^
-FEC0946FB9CC04713C67BA36FA36EA9211131281 ^
-BD2BA680D2200AFC5CAFB362A5517BE9DAB7E593 ^
-5FB57E1AAD5BD9C1D176E1CA03C1A5A8E33DDE2D ^
-F6D5E7B1B28C9070115DB6665309B8DDF5F81281 ^
-BFE88F7A0FD5F6A1B26A5E15D0A109A1DA7C1FC1 ^
-E5668AA40375C8CA35FB3046EDD8AD9EDBA82FE3 ^
-C854D5C5A0A100411FCC9189D6307C47B57228CF ^
-1EE384076308AC6B80FB66856D5FA19952B3D6D5 ^
-CAA4DCFEE058D22D726292B2C722D3147F1DCD63 ^
-1887C76092C9275B2DE333014C99FD13E5E533BA ^
-AEAC6ACB4561985DCFF6C9696BE836FBF75E24E9 ^
-CA46F23773B30BF0ABF5C38EB9D0EE021D713F8C ^
-2EF007988B2161FED07E5181C342E724D3F640A3 ^
-F0F1422DFD34EDE00A8B0741F4F395234480FDB8 ^
-2C471BF867F5A02CC241E35D95C97B43D6536E7D ^
-D4906C8804B241E28F3F2E6380019FB739EC8503 ^
-632183EEF8C6EC8EAA3016A43E568DC38E29379C ^
-1808120D461A867C90222469985769AF1756EE5B ^
-08C2F97B6FA6E1433DAF56403CDFE8CEECF6BCFE ^
-2767E111977A20D318EAE19D59E1E551A4AA7F1E ^
-B1A7158CE56666BCD1FDE7DC87B40C92705BFDE5 ^
-7CE90514AD734390F6FE58BAE8FFCD66391E9595 ^
-C57F4C2D8B78DB8464EF1F719B8B1DA270867480 ^
-C97938F34C6DF26BFD509658838F7C35FDB0C58B ^
-A5CAA6946300B1C4B5F53A69AAAD67961C4C6821 ^
-DDF684947B1667A77A22C7DFE8B6A0A8484E2509 ^
-8FB1310F1F215E4EF62C41566C523275BC929670 ^
-1573CC447B398532BFB9A2E5AB3880F23CA7C27D ^
-D6E0B674B9E4D283C0AAC355989CC0E8BBF09678 ^
-7D083BB9C3E005B41FE32629F84B9E292D80FC67 ^
-D3E2591B7D7CD29E9ACE61DF6019D8787AC93BE6 ^
-7159B10AACA9E7610C7404DE961ABFDB17B89156 ^
-B4A0248088E850FFC5CCA99EA2F28ECACBFF1960 ^
-CA63F54FDB6C46E877760EF4E50E56F3164A417F ^
-C41DF52EB252961619BD4861C4AACCF1AB392B69 ^
-FE3EFE453C8705E1CEDD06F15DF5B35A7311DB32 ^
-5E2E8BB04B327E91572992A8A61063F7A76A93FF ^
-8EA0191E8491400038CC5B1416E5A56622EF1E8F ^
-47727D4D7E8D9738608AEEDEB0E12C9F2427EBCB ^
-7340F405BC428DA514E7B2F39728CD77FA2177F9 ^
-5E451C7A51AEBABCEF9FDFBF3538AFECB968872B ^
-528038274803D6DB419F6923993A45C999433336 ^
-281D30FD3C725A4646A6287329140BEA4AC7A5B8 ^
-922A57DBF62C01DA19B89F90F36C433817F089B0 ^
-C79AB225BBD03145A981DBE7BF6FDD16A5E95D8A ^
-301B4D0E270F2AEC6E1372560385D37875EB682C ^
-1EF2EC6A3642C7FD61C4F1C3DFC55302535254B7 ^
-1D94ECF29D2310B1A5A2042CFA616BA0D19E7C41 ^
-52DDA9BEEFAAAE667A6D12BE414FAD8619750040 ^
-B14486D16D1521D1283698E651A10FC14AFF8996 ^
-4BBFBD0244BFEE440DBEDC8361806CADFF673253 ^
-662E0E466C9D700C50C5F98CD77CFECF8278D708 ^
-1AC5B8197B0689681B0F474832F316CD25147AF3 ^
-8720E012F16588A3C368689113902119C9791FF2 ^
-D892C1E257A997A8DF95B229C9D24C99F60EF205 ^
-57F5C45286EC3D29CEC19939C04045D9C38E761E ^
-07151D2EC889D24730AAA5282FA4DFC49A66E439 ^
-6AC94690EA6DB4A8DC982271490EE18282A3B33D ^
-32DD19F12AC0854998C7B14D1D96C15FA8995DBD ^
-7817A25C6CF1EBFAA8DED7A80063D1A299AF8B18 ^
-01C5EAC1830D1F5A7F186E039663CE925FCBACDF ^
-B9F32F67FF4937F44094CB4A62BE12474AC3E1AA ^
-05BE2CD6882447472AD2E02B08590EDED62C7638 ^
-CEF149F6D6FC8987C3693D5F5CCAC0CDDD3D0787 ^
-6A7CC99DAD86DA9797B1F8336356C9864F279D35 ^
-3A72F8EFE64CF60D49589AB92D48301620CEC0ED ^
-F1F5939419E375182A2AA928DAE3CF6C378E4589 ^
-3EC1C1B74B8881F86C1D3EDE42F6689C61132710 ^
-7164A5B4A69A004FD76EA4C6CDFE0273D35CFF71 ^
-224325A309FDF2378C5776B1751BB0694ED30C28 ^
-64E0FECBF5F94517EA9E0F4E1E16FC700EE275B8 ^
-69CDF3321850BB640D5231D3B3458F83738CCE6C ^
-0684349A2ABEC06CE05100EB69D01CD4FB7AB193 ^
-1DFA49225C0FD725046AFCAFED17B1ABA6871FB7 ^
-ECF4B1B9C78A802F748D58BF6E27FAF1B274EEC3 ^
-A44B67EF91F2AAA9EB2DA8B166A1A316886E8909 ^
-CF38B0F7DDD2F72A891B41AD026FCC3282218747 ^
-F917033D4494A1CCC8580C1DBED6F28FEB3E2E57 ^
-3C326F550039F815ECF5E236F6DDE5DB0E2E9F65 ^
-7332001002A11FDAF501914A867398625398D5CD ^
-DEA189DC41AF695109ADCD93906EB5372B512A57 ^
-E0F14BCA9240B27E44647ECEB4A40408E2880DB9 ^
-77545EF84146F952212D9E1FDBAF62243CDA630A ^
-D162F654DEB5BB0D54179319D8DF9F1BB6D8A13B ^
-3BF79007252537CC2EB11E148842E7AC443CA91A ^
-6CB2F291C7198C9E4112B991FD4D829DBAD7EFB1 ^
-C850258036781C0AE8A083D6A791D3FAEC946C99 ^
-DC64C5037BDC93A3D38613D203FB3D7C82A18A24 ^
-620B7714289FD82ABB9FC776B644571F72A9557F ^
-4BEBC1EF44C30B0B033153F883D5C58E4AE6876D ^
-E3815A4E6BF3B50EE312E5A795B3E9AA2D7832AD ^
-9CB13D19C64752209D5D4D7033FAF9DE8960C147 ^
-3182B9F03D0ABA3BD91A1EB8CDD0F465FD9CCB51 ^
-73D8E8B9E6A04E88E29797CC5E2F489350D978A7 ^
-732734CCEC18944BCA784B953DCC0E582225AB89 ^
-A2152DB03048AE27B47C25DDF99D249504A8ADF1 ^
-AB70B32A28D9BFAAE1CA868C4A161B6D4B3A92E5 ^
-AB8B90085B47050B87F4BDAFDF971790B7950900 ^
-B315A8C87011BACA969A1B79EBAC80A7343742E6 ^
-B78A044908CDA9640633DC8BE828E22F90E6D7F3 ^
-AC2BC5246C1BD99231CDCCF3CECDEF5688E58D71 ^
-0679F888F8C353B807F544C2379BB5A4AE8EB9A4 ^
-464B5754E3D42864CC0A98B4E696C827E3254317 ^
-7E5385C8A1BFF0FF476905BB6B7515B6D438CC0D ^
-0F5C968CA2FCB4A17E0AF0B94682B3AC347C2D12 ^
-4F5E353500D63C99F58A28F5870064FA278FC7BA ^
-E7A104651C4D6DFD0778EC8AC8E4F001BC7B9DD3 ^
-23DCF9A854D1D5B5599B14A0E9A19AB4F2E3BB77 ^
-588E429FA1C3055C4DCC99EE5407A64115B54345 ^
-39215ACE01669CADFB81E9FB085710EB5B97461B ^
-23566449DD29A315D413604A2DBCFAE0D40579A2 ^
-1EA87C13DA38FE4C59691D96AF590EAF3908C0F1 ^
-5A6170FC6BD7E8C01140E16F248C56890B51323A ^
-FF328DFB506B72FDB8DF5716E291A1830BC539D4 ^
-7B4DA846F9074254C676F00948BD4C9698148C4D ^
-2AC310393EE1ECC5844A4BEC15A9CFC1B5022294 ^
-3AE36316FA94B369D7320A8B71304CE6490FECCD ^
-7078C7041275BCBE8403DE24D16A646B4462882B ^
-8325A8716A2C879888BA9F674C869B1FF31BF363 ^
-586200B55B5D537B59B5E0BC6FD9BACE1E72C6EE ^
-0B675E7F434756F5E310B80B58F861E789495F5D ^
-749C4C0856CC4629DC397678C0E8BDCBD649A6E2 ^
-25327C66FF46C4466F81EE635E8EC02C5CA60F2A ^
-BD9DFB59EB5E53BA6988734FBE0894194A119D33 ^
-3084040E5ECA5E77406B4DF3CB7F324ACC96B506 ^
-1E14A09FEDB61CEBE255B94F533C4018E5AF4BAE ^
-C8840C051A204F8A13420CF17FE77EEE2FD7945D ^
-4790265B5231F9A1738CB9F8423BEEF219DF110D ^
-354947C0F2F25EB491D21BD0BD1D809FDD140A66 ^
-23762BF3CDF3F484C70D2003B55E6F447BAF46FA ^
-E5BFC99555CED5C1743B152A64AE08C9ED1365D6 ^
-4CB44DC507F716BED4B4CAC742E79E1A2DFA308F ^
-62790EC14E8CFD1A0D6FAF93D7984A1E9416FD5C ^
-5C2D3ED988F5BD9579D2F710D5DD68B11584295C ^
-CF8414ED85FA0135E44B37A8F8B40756BAED23DF ^
-03432064C1C05D28393C9AC5878C9A9BAA6E5C7E ^
-C37A6D64CF81CDF7DBB1B81509A67A0A1BB5F278 ^
-F341D89B75E599048A911D0AE756E0065669B4FB ^
-269E1529285414A74B76586EA4FCECA895C7D1EC ^
-FF9BB39F9FEA1EA63D944BF12ADC98D1D4255096 ^
-DD114F2DF3D92977F9DB98AEC04F367CFF9FBA2D ^
-69B53BB13375F9E123FC30098CD9EDB3C1A1FDF8 ^
-2A60984DC79682E96C29CC7050E1ACF988D9E4D6 ^
-09AC4CA1A40A7D83A463AF0804C4EDA208E09D36 ^
-A2EE2473C270A0637FAAF17DA54237D37E0C6960 ^
-B3A7817ADE962DCEEA7FB6F960EBE2BC1F9BCBA7 ^
-85A46CCE01A7968104496225483ECE2C198F2A27 ^
-BC028F5ECD8773AE47563F1216E0BC36A9E37E4E ^
-C65C40CCC3DD80045D6A4EFF3E9C7D6E4E0E5583 ^
-BD9C189A639FD3D70167367DF61F14868CE7E313 ^
-C6899A84B8E66548BFB50781632CC3D2D1BE8B9E ^
-92F3C8E436227976F32F005469DE91B2363150DC ^
-7D2A80A5C5CC88988F38334AFFE31C04AA1AFC9C ^
-D60FACFA57F663C4A399B1FDDD75973910F27294 ^
-CEEB9661BED2E89DDB07A21EEBF590BB1AD644A0 ^
-0465C9DF2E0886AC79F46BBBEB0A243DF7D6BAAA ^
-98073013597B7AE84CB884BD932E20E6CB47709C ^
-3CB4F76B602BF6B58B316A2D8D169D432F02CE23 ^
-5CD4EB05E8612974BD9C3B19E48D192BE8B96A09 ^
-BB188D5FDE806BD30648B6058143F1802F15FA10 ^
-84EF1D3DE5C1144C2C928CD4D9070A6E79543417 ^
-73BE2AA66F5FD6BF63273EA136350D29491A3305 ^
-53CF3BB07761910BBB486C3C0C643943D5BF17C3 ^
-9A774BDBD27C3704871B52CD5F7F924C8EE4A67D ^
-B106B6582F0F6C9E2EFBC4860CFC7028F2C47F74 ^
-FEAFF44298CBB7517B14B81A6AAD501828C773A0 ^
-B5BB48BED969F15D162301966C537A81C40CF4B3 ^
-3495D7E36747B824D33465B5DB72D6C623EDA72F ^
-D7F49178B43847D9984B923DEAA6DE9571690B92 ^
-3AB7E26BDB0409E55063AFFF456B7A29CF098AF0 ^
-7984E1565BADCD2249EDCA0A3AADB4346104A556 ^
-42DD99B41801B0C347580DF1FDFB2397D55D2A85 ^
-8D59C00401EFB314A0DFA4D82E1D85711C77E246 ^
-50CF74894F7CF5A9F37C37B47327047E910D88A1 ^
-1FC40E2840C4B68F40C205B6BB06C3E106B6B8D8 ^
-A49F56DFC293411736F27C19FA2A362A545C761E ^
-221E48845FE8B3D2C79AFED37414C0D732A69F4F ^
-AFC12E7BDF9F48FAB1B595FD656776A39F0F6CA8 ^
-5EAA114491E88938276FC3ACCDE659623C024BD7 ^
-5081444C3F81E18114B289020D9AEC75FB205597 ^
-D4F69156DE85C61E9B4150AC9F6F6A54F8E193A6 ^
-3D7C7EF4D362DE137AF0625925B36837C1FC7572 ^
-575D772F9C1CBCA8FF38243348E0DFE02643C28C ^
-0C821F27FD82C55CB4D76D386F41DDC92F79493E ^
-C3D0101DDF552A11C8E1EE6BFADB72A983F38571 ^
-F4D650440127390F3A3C2EE991C185CE7650FAEB ^
-54460FDAFEF3022BC2C7D1D497CBE5CED73624C2 ^
-9B3F7B9D594AAF6A26F5C21BD6E4717F46267418 ^
-14E2B34F0B2C89DAE1732400C02E2CA19A767F8E ^
-1072ABC4DFD2FDC6C114314D3C08457772421713 ^
-C9EA4B020C11DEB794D1D05957473A46A906B472 ^
-90BA4272464A020612F0085B7DB9367B7BA8E15E ^
-8713A3997A3CD5DA87E97AB94851B68E748268CF ^
-370358D54C819703E20EF63A2498C8586B48D44E ^
-0DE40249A8B215E98E849008FB7CAE80EC23F4A6 ^
-BBDB96306594D13598BB0109258E488D486D98E4 ^
-DF7DB9CB2FD8A86854C5DEFCE59C4E2F0245F582 ^
-84DE32ED88B3D2BD5F4E33BA3398CD2EC1E9BDF3 ^
-D20967844FED11CA71D28D72B28ACFDB14A7DBB2 ^
-B13A0A6A7723BCD9098E2B04FA04320C4A0E605D ^
-BE66BE38F97E7DDB02EDC8E0ACE97CDF83F034FE ^
-28ECC25FFB394AA8DE18F8ADE8B3577955346FBB ^
-45068B6A0F61D0AEF708AF7D848683DABE817C2C ^
-EAAD829C32C3AD4EAEA8B7E6090A5CF6B2FCAA82 ^
-F445FEB22DF5A9E49E2CF7AAD7CC1F5F72F18B77 ^
-73C424FA0B7863F1F170A850F6A0F85C87820841 ^
-71F0155D40CC55F3D64BEA645608FD184E2543F2 ^
-4542FFCF50267B77502D1A0ED0C2A5050CAD5200 ^
-FB48F26F320D7A4B803ED459BDF92BC1F8703631 ^
-C9F9A37E34BEA6220BEBC167E34B0BAC6B55A6B6 ^
-B0C836CC2831FB8BFE5988360CC39FAA6A904A89 ^
-B0CF783D84BF5383EF30EF2071E0FBA9ABB553EA ^
-8411C8D1A4FC3F130143DEC5232B59BBDDF11B7C ^
-ACB6D9EB22D474CFD5836C8CE22F387E12DC20B7 ^
-D582FA3DE1DC425AE6A394FE5AC321DFE96B9305 ^
-15CA32D0E246F395DE22FAF8F0FD90036C4016C8 ^
-F1832FEECBFFF1330C7A6AC47D6FC1880E79550D ^
-C4846BEA159D1D43427CB5802C46E479F9157392 ^
-C84FF09BA6A2EE9BD1972B8C0BF25240F5A7EE72 ^
-4E6B4F363D7FDB4083AA6F5E7979966FB8FF6C5A ^
-7A543B81CB4DC93081D8CB6AED436A31C4018A84 ^
-85990A1C35B86BA244F60BA0EBD6F6E801552FD4 ^
-D3E07F5D14AE219D3CB59B034764C40056BA95F4 ^
-F4C4DCCC63E8FC5402E93CF50533E51D1BECED43 ^
-3806AFF9AD3859B150F1E2A40FBC047FB624CB14 ^
-B51A4E4FA213D22548CFF28323C6679D2693110A ^
-A7C70C19BAC1040698C7AE6A23B0688B58405153 ^
-E74FD8C457581CD09F75EE3D43485130609FA9B7 ^
-86ED1E49D4CA868934D7C254D3AE0D5BF7323CD7 ^
-A16507DABC3A0CF7137150C4E6F88D5AC9A0AA3C ^
-DDC76D7BA54354112C2D7D31E1A80F0048551E5E ^
-D943F6028146EEB0386BB3084FD354CE86ABCF00 ^
-4ABCAB65C7DAA52BDBD13BCC9098643F5A165329 ^
-D75FE22162C538BA1E2687D66E2923CEC7375E01 ^
-1A11A2B12D93FB030B0C3441D7AAC06DAD6FB527 ^
-F8F3D414C26D09C6CA1B88BE44BE69AC879D3C5C ^
-D2D0BC98795740002B2EB6EA6AECA5559340B54B ^
-A8A3838BA45AB6B05D1D464E8681AD61B136B6A5 ^
-5B162923200439D870F57AEC584A67CA2E8939B9 ^
-A8FE0B55CFB15D977E871152905D8FDB18AA6B59 ^
-02D5D4928969C7A852B5A8AC772A3D1EB424C9A3 ^
-4ECE08DFF1FDE1258B1BF0423E1E31D83C57557F ^
-F701430EF6CB54BF0D138B54FB13A1B586A1CDCC ^
-E3242A71106CB77D25A60D164BD17FE07EAC4951 ^
-D8B18DE86132672EDB330190BE895E3106F92D2C ^
-8CF05FF1387C61A8CC3724BB1283AAD3E2F85EEF ^
-797B311DC2B5D14B5277E49A38A787D3D6A58C2D ^
-6472BC5881A62BA95651DBB3DFF9B3885949C9B6 ^
-86AED4B53D8617FC135D0E1FCB762271B2545A45 ^
-E3C888A1C00301AA7CE203A5590D82C1CE77C6D4 ^
-8A081A7A672F91493AC09D95B29FABD043DA83DD ^
-D47F87022DB4FAE551FF3FA09FFF02D92D112527 ^
-B2271E377E9B158ACBCA1EDAE0ED6BA4C59CB722 ^
-71EDE0C9488A21E62456D06EE393F390478C3F31 ^
-437A1B709176598020EBA1E92386C3979A18915D ^
-E3F4AC4384848071C8A9F9868376D941DEC2A9FB ^
-00444CAF6A3F4210FD97DCB8F10F43B28D890600 ^
-9B6BB350E30CEE209C77A3E20BB6ACE867546313 ^
-935D2688AE2B16B79B517BFB79D48CE7E4F0F4E9 ^
-16B21F19ADE7B6DEE665D45A847491B7F055C46D ^
-853397C3565C807AE72EDFA37F4198E801103FD4 ^
-10992C2FFE5127006BAFB2172359701AB10FA4BE ^
-C82D6BA4BA621E36872ACEE4AE3BDF33C2381B07 ^
-D7852DBC8FF592E08A1F1EE57A70BEFF327D8EBD ^
-CF67308422F072415EFB75B43D5B67C7F5362B0D ^
-30DDF35E1E99243F85311A0994D91B8AA543F729 ^
-DB2FE340F62A89400AE4A16B61435204405350D3 ^
-744980FA26DE503743EED298B966ED5FA8471DF6 ^
-D2C8B803D3DDB54CDE6464D126CE3009A9F0FB73 ^
-885700ECC04EB97943A9C100EB6EC4ACFE59DF81 ^
-770F9CAC5D4E9C878A6636EB0306EE8DDF0CF915 ^
-03C3F0553D7CF16CFE3D3F01C0A4CE26A914512C ^
-93B304BDB138DB6790DFF8A84FFF3D3506770CDC ^
-D5C5FA0488C5A6E14770F216B575997950A94184 ^
-2F695B8EB18C28250D7C8B35BA000042EABDB245 ^
-0353FFA7F7085D3B7888F96B8498486EE7DE16CD ^
-239FE3AAC0D3739F5EEEC82B2BF6F5F47D058548 ^
-16DE8684395CCA8A5DBAC72ECFAFA4BC3DBFC5D6 ^
-AEB2BA742708DBC048B01FD77B1560CD3A23E707 ^
-FAAE178B97175A7A68E51BD7EEC06234723B670A ^
-B3F1311247D920110972772C3DC30F789D3FDBAB ^
-466F682842C07D2C770B41B66A66BE9F6651C046 ^
-39724BD29138F776ED20633B66A3A241FACD817E ^
-5931F19A1985CD5F7171A5D2B81CE1CB3BA8EBBB ^
-27DE5C33A18DF1A731051D6644DE8900E30E242E ^
-A4E1C4F20A34C033589ED0985E80168A28C2377A ^
-9BE820B134475CA31513EE1C79D06E299D70E017 ^
-98F396D147EDF3D3079A6B2DCDDE92D48C9CC52B ^
-D6108901909418CF7E7AECD9E4D1CA121E992E90 ^
-F2E8F0FF1C652356E6056644B81FF8270A07F56A ^
-EA1669ED509120F2B42CFA547A3FD6002FFB862D ^
-219BAB55653B03A3CA7886212DF27B23C082B2E0 ^
-BBE95F8BBEEB6F9A0062D151A7155630F2010B88 ^
-FF6BFC90FE3EAB299892A5D9CA4D17DF2C6C604E ^
-8D0E1DBFCC419AEB1C7827C7649333E34AC7E30C ^
-EF3847F7FEA054F0E080836D0F2BFB676E3573EE ^
-F60A15E6A28A5CCC9C4EFB1B3107A54C9AAEC26C ^
-76328CDE5EFE6961B2CED4E3457D219229E161F7 ^
-FFAF03FB632A042B837F8660412B72B1099394B1 ^
-211BA6675C52CBD9E7F5F5B366A64A2466532AA7 ^
-51E05B7481381358782FDF73CB958E1434CF3330 ^
-BB5CEAD1F3B68227CB032B2B8E5B627461071637 ^
-3EBCF1D78998D4D11C094BF28FD522EA9F5A1E37 ^
-3E7186CB1D39C64CEFD28BDA2CCAA073E71A5327 ^
-415B6A0083386054D3B77026A38654D45D3BA106 ^
-2297372256479E31E139AA16E63C27C207519C0C ^
-65A79FC4B322F655ADCF63432D295349FDCA9E7B ^
-2D1130EE6E4156151C637B46527FAC54D9E79DF7 ^
-80E18DE7C798F040C008B3BFE3054261740E1444 ^
-0710A3A300290CC1C3BAB56CF00A682C1B711BB7 ^
-C6BE5E337A1A976C253CBF356687F359548B6A3E ^
-3D6E4E514277223BADE6A317C478F17EA6EBC9DC ^
-25C66C904C35EBAD2613A30B73283E0FC23CCC10 ^
-125709FDFD511180B08DB77366DC7E5A2B46F0CB ^
-AFB5C53BB272826DB7A1C030B89C7F3AE956F65A ^
-D166E71D8142E26E58E0F7A69C50CF19CFE225FC ^
-426007235D8F06FDCFF20CE7FD00E994F2FC422C ^
-8CA2730163EA816BF9B63CC653B443A8E8BD7656 ^
-BB2DA623B5FD10032BAFA1A2F9FB1E13F74AC4EB ^
-82238EC3C90BAF3227885BE78534A1B08213660C ^
-64BA275EE9422356EAC19A46A4C5C9BDB4D63C05 ^
-4995323B85FD3879631B439BF4F8D7D39639A7FA ^
-41F95B512991A4E05B219479842285900DF8425E ^
-3CEBE929AC763F2FD85F21354C9158E5169A844E ^
-BAD5D53D67CBCD7767B6009546A91D59188DE99D ^
-E9C2909F6F0A3079890193C8772E745A317C48B0 ^
-BB97E31E9B8EAA8CE758DD775D8326F94720E198 ^
-109471A1C3A427C65C4BBAF8C785DB99C748E5FA ^
-751D9CC64F00176E424A1F331C63EAF2910A75CB ^
-27EC395B07FC740569612741E5CF13A9A6048010 ^
-F674BD87556FD0F71D9BF23A0ECCE9F39AC82099 ^
-93B2F9109A25C511865D15E1683C0683555FFC01 ^
-<D
-
-H>SHS Type 2 Hashes<H
-D>
-EFA3EC89797EE3F1A5BE4B8D34747136CA7DFB99 ^
-D146D467E321E4EA4C73E8424029BEA461F3D90B ^
-25ACD32DED334AD20DDCCF01059B6B8B864E8D7A ^
-25416D69665007C3EDD24161F3DF0F6ACBD0E859 ^
-542A29E5C04A5B79AD0986FAD49BE741F09942B9 ^
-5B197E1011286E5C130F9379843DE89776C37C59 ^
-467277EB8887EDE0F2369C6E7D12281EE3B51857 ^
-BC1610204E15A37D533B74412683767898B35DFF ^
-3DC7C4726B3EF75AB89193701C990F86AA6DE80F ^
-4AD4348E5022685C70A2B9806698664C281E7123 ^
-A33E4996BD9980ED505F8AAAF0F6D64E97D7E619 ^
-06280ACC2D0DA15EAD7C963253349C86A6C3C6C4 ^
-33BE29779F42EE504A3CDAE0422F7B9C5CC994DE ^
-412941272C5CE344AC144B69D4BA5F61F1474F4E ^
-C33ECAC1FA74D54685669F8B9F85918471A88D60 ^
-C48272E42F921A2749D60418965D8A7CB1C7BF0D ^
-44ABEEAD2C278098062D934460E565ED3C646880 ^
-08DF185007816E3EF01D6226C72B03256478F23F ^
-289E89F8F15DD709701AA22B12C69E8F90C93F1D ^
-5B93CAB369C99B85EEE3130F833B7BB06D4FC041 ^
-7B2872C58FB340C9A1D068B618E4980B04FDFF2D ^
-62783421CF58EA66366ADDCBFA96968FB1369918 ^
-C8BD732D0181051698160B2FBC2025476297C96B ^
-038D587CC069C9B89DBC2FE9D86A98C031D340B9 ^
-3059031A68585DA8F09B87B0BE3413987EB390BF ^
-1B74A4A95713083609B27E67140708EDA15F80B1 ^
-6EACEA69922C7ACE38E0560A91DA459C0CC89B55 ^
-60E21F5299EC719D2832A82268B24AF6B2815DEB ^
-3D7D51782A532F4F410AA2AB3DC9178C21A55F0A ^
-B2423D96008FB800E5E35E19DA6BEA27487585E0 ^
-5038FE9AEAC82966A4EE5CC69ACC8ACCF55E63DC ^
-90BF0A90F88F5F1DA51E4494E2D5D4C6250D2D4B ^
-F858434E0A5FD61A220CC792380801D19E0D9F77 ^
-C31E0BB45FF1DC0DE44C77C53C59B15C3BDE9EB4 ^
-DF5628CF6445C409B51F46A86488A95DD34A3DA5 ^
-744CDCC9A51B1AD14FAFD673D4104433B7A24739 ^
-CEA5E7B91773DFE13649ACA78907769B5BEBCA1F ^
-DC23EC1A04F7417D9704B844E9F39F39EAABE6D8 ^
-D39DDE97297B7D1C9FFD6B6733349D0B8E802688 ^
-65219E79F5A3C61FC075660258A9C5F13A159271 ^
-D2A86164D1366B60F146651464761B01353F9028 ^
-8E3D1E4E0438EABC58AB967B1CDDDAE3CDD9B078 ^
-EE9BEEC73D0E760CFD05CF62382A461C7DE3CE2A ^
-5C4FDD604751596BE5419D4AC256C3D982012149 ^
-43ECD0DE83F087815CF257982914611E4BFF698C ^
-1A1BCA41BA127DF4264D3795E2EBCEDCD1BD8EC7 ^
-FF82BC6904520E186803FFE861DCE7E566D75F03 ^
-764546FFA014DF8278974BE66D01485251B8B0CF ^
-A06BC97DACB07EF207808684978841C425AE1238 ^
-6C7E6E0E89F2A070EDF3C4333353869942F3D883 ^
-572437B2B35C5BA00EBC74521B12D20E6F14ACBC ^
-08703186E74A9397CEBB1B2034A6770995AF3D0F ^
-E4F9055356AABA933EEF0C0B07B6FCE90361D208 ^
-2020203EFD4C5FFA02E593B7A658024B33FB368E ^
-2BB2F32D64ADA56A3E53A6D750A05F8D2B5D7A7D ^
-C719AEE4708E7A242440C9429B7236DFDEC02B4B ^
-924A26B46649287197E142CB42506C96E309EB26 ^
-0463F94B5452A2D8BA3A0DBFE9C490A371C19975 ^
-9FB2FE5393238EAAF58034BC934B190784A10DD3 ^
-AD4A6962A6A59CA32789AC3BBA368583B9122AF4 ^
-2A89459657F9E2685D794E7AEAF30A05B06AA573 ^
-9B65CB91D0A24773AC8675FE9862E28A7B84954F ^
-9CB7CADEDD391A3689B04427B461C4113717B6C8 ^
-F1B922D7EC240FC99692EC28C1A6CC7D907B1018 ^
-DE301A1413C36A5CB891FBCD9CF9258DF4EF14A4 ^
-B330738D2AD53448C287BEEFE5C5583F2B817A03 ^
-B80EBE0104A25840CAEF6AD74C4676D524571A29 ^
-3B5CD01661A279BA72DFC1272E683573B4F16DCD ^
-1412D6A2DBBC9D00641A71164A690C640852B56E ^
-0EF514429CAC95CDCBE8A2E60C2AA8B892AC5B33 ^
-5F32CFF3B07D47EC13EB54E7C39E4F5216FDBDC5 ^
-B931966169D171DE8F9488E8B5E0960124BC7451 ^
-E5034D3A5A573442781EF0C6EEA7BD39FAD0B94A ^
-F97CAC5013135944FDF8BDCF02B4CC61241BEA6A ^
-FF74C93CF32506B4E17A0B596AB564989F20F1D4 ^
-5CA42E33BCE4301B8FBCE56BFBDB43EF79E956D8 ^
-87F5D981EDFA01A2E9885BD52CC4E649A2330621 ^
-63F43844ECDDF338203DFB116FA79CBAF4E5C92B ^
-92C5E2A5D380D2BB5E19E9E65DC9A77F4B8B25F4 ^
-E3D78501969ACDD78A71042E7B0BD0C14882E402 ^
-4E1FD6F5CFE29A0E33248F2E2EFB74E7E0A99765 ^
-5FF5DADC93B2E452A60677C8CD0CBAF7BD4895E4 ^
-CA490FAA2D6723F9F682D5C96586460D0C8B2010 ^
-94F099C2FF7DB694FD2DCF5A9A6B06855B2A9948 ^
-CF3B1E0DA7BE87180BF1847DEBEC706788C53B8B ^
-F85305C4BF149B92068D363EF19B914DB90618DA ^
-B4BAFCA3176B80E9800E319FB3BB74E5D65BEB64 ^
-38CCF51915A38559A96E6F3258148D5E63230984 ^
-6FF43B0D25C7171FF178DEAB13D7F488D21C4216 ^
-3E4A034152D86E4568A2197A5328E8E97363287E ^
-F231D4C3ABBE0FDF77C71EB2C28E50ACD9584537 ^
-23E1A4F73F288233847E647CF8623289F1F89E55 ^
-726DAEAE724E79232611CBB216B7722594E814FB ^
-0E5FE512B0AF52B4183119508CB01AF5338C63E3 ^
-4A5D3E12EB29B224202C0B319B086535E99F5E32 ^
-363574A910830EDCFDAED1055975F0613D1B5C95 ^
-4820BE6C74AD34D8A43A5DD0130CBDE3F890C53B ^
-FEB6E5BF7A66ED9B838A10305F850052DDF9207E ^
-D50B331AD6925545264B6614C3B4C39375AB1F65 ^
-36B1BF39BF4AEF05FB054BD02FAD9062D2337239 ^
-<D
-
-H>SHS Type 3 Hashes<H
-D>
-9B30CAFDD7F5E525221EC036D55A9C8D78294DBD ^
-9BCA33B3DAD2201D0F1981CCD0AF4874E162A6DB ^
-8B06697E4A75DA5F020CEB860A29040B3DF6EF21 ^
-F0D48401AE22498E281CDAAF045FFEBAA87A9776 ^
-6247DF62DF5D4857A795996039B5A6271F7A2031 ^
-D98433C3372F1405FCC2475959B9F35DF27D32E9 ^
-C4D14B2873B0BDF01CA7C1628EE01D61682CF1C8 ^
-C027A9C010F8EBE89FC88C1C9FB68DAB09A0CFCD ^
-4D8D19F35FAECDEB015E116130A0A4C836A42A6A ^
-928E2E95D3F09D8EE63CB8F10296EE6EF7455FFF ^
-55F3E770DCA28CFB711D059174CC7A9EC2B2DD7B ^
-4500987086FD8C275330E0F27E8A3ED8596D01AA ^
-60BC57D16F50E2ADD1724E0C7DDD5E47DDF8E300 ^
-59D174272AE602AC092EE7EF393AC19B87B8E865 ^
-8C25614E6E4D825D6AEDD93A62D1A0458583EE84 ^
-695390D1E57BCC4CDD442879F0978BD823322E5C ^
-6F353EE6B5F4B8272E4A0D3D4BBCC83B1B942516 ^
-4B3F671874220DCCF49B580189E6B13FFF0F531D ^
-BC6C473B4824D8E2FA04DDA86A5865D4A36E8E91 ^
-1BFEC269FD18D25DC5C56ACD83810022775F3EC8 ^
-3E9921E2F685413C0AEA64801945B48CB76E195E ^
-EEC7221FBAC5F27B56CF68C396B7EBBCAA3C0B05 ^
-F86DDD2A8229532C3F183EA9903AD228A2521593 ^
-FA17B5DF33E4326BCDCB27F1CE8B83BE8B8EF890 ^
-A4AFC0B41D30CE796C2B4B06E368A5D390735889 ^
-745AF12B4EF985E4D2F848D7C7ADB6B32404B6E6 ^
-5CE4B657409033BF67DB7B0CA480EC2ACCA801EC ^
-0B5AABC9D3A8E861103D6B5B9B994F9C743BF058 ^
-86A1198983A73298BF4EB41A61EAAC3E4B06B408 ^
-460A107A6AF329B330DE9425B3077755553AD370 ^
-62C81D06AFE8C8F3E642AD42374FFE486DE86F2F ^
-FC1EECA32F7E434BBC74F4360808EDB141087BDC ^
-BF494B4E8D3311F167B1EAAE58A3343683F337EE ^
-961247D01E1C4CC0D71307637CD559D530521FD5 ^
-B34F846411BE61E15361922E0E2AF83F3F03B291 ^
-CD845B240FC2551DCB2CE487646648CF249AE8F0 ^
-5C124B615FAC548DAA35AD0287E032EC77D220BD ^
-3C74771D838CCF7FAE2DAB100CEA7B46BE2FFF3F ^
-62860DB8C0C897C7369A1AB61747B04C0AE9F8A6 ^
-C98400CDD7FE71C7B35488C16D3395C04300EDFA ^
-95167E2BBFC0349C0DB7CB7BD2030BC30F9F286A ^
-9F835DBB27076B5F0D8880603F417CE83A0D2242 ^
-08442B715C84B7A8B2C7FFB46010AE56A0C8C05D ^
-B7132DBA522C54F42903CAEB705167485AAD30B0 ^
-9E99F03ED08374EFA4F9A26551A909F40BEE503C ^
-999977E6AFFAE0451E93E7F77C7D177DE121402C ^
-30E0BB7F21433A348E3B446F08D80CEAAE06DB71 ^
-B3A41EEDF017DA7B20FBD9111BA6E2E59842CED2 ^
-5B9CA331BD03D97E8D057DFD35C9E600F90C57DC ^
-5338A25B31CC9C64552B6F6742F9FEBDC13D9733 ^
-1B3A55BF6FD748B3B650EA5BE839B61530C871C0 ^
-1503F21523CE8BC5A19E6A7F5CB0EC34A7E9F75C ^
-7F6A16B30377D3D0014B0B0B4C8639160C721DDB ^
-8F621F8CFB6AF216746D8B99C913267DB14ADB08 ^
-42E9177C487B4B711A4451C360BD7E2C6DA73446 ^
-5B2497CA6EC2426B12653D711E6BFDBEEFD4A389 ^
-30F4690FD4F09AC8E29B926F64C673539D7FB65D ^
-CE12D1AA4961245E606097B672EC3E16103D0D16 ^
-9BE5D693BC0CC56B34B8DDB92FACEC2F8F4B638A ^
-D2040005AE230EFDAE95942372607577EFA5DBC2 ^
-8A920F9407C74FA37D9C93C3606B996DB945841D ^
-F26915C08DC1D3D31D9CA73F18F04DBB57E8A672 ^
-E449381C8148837B9E44251B17825530D8754C94 ^
-BD8402B21520E40E31D1EAFD9C99A9E409C3A77D ^
-624CCE538A78CF0FF788B9BE433A008FA7779280 ^
-B796B521B90D55396E8EC02AD9B69B7E91093E4C ^
-5C4D584F97C1D8FAF810CEF3A4CA0915FB0B630A ^
-A179FEAF341BA97B1D0278822ACCAE5FCF8F4ADE ^
-693DCF85919E06A5423F92780E79C2C0C4528D67 ^
-DB94BEADFEA3682051D622519AF9F87BAB28C5F9 ^
-2E20D1925FBD460E7A5E6B48A92964A7DDCB874F ^
-86651FD71862CF72F01F099F68CC164DEF0E9625 ^
-D5948BDCA91D6707015C79BBC2BC74C1B60573F5 ^
-8870B8A6884FF54E0E400441FB2EC74F2452F39C ^
-7DF1C3C052E8396D251E9D522C4227344DF92C11 ^
-59A290A0BD41B973DEE35947CB240006DBCEC582 ^
-DD0EDB3AA60CDEBB85DC01258B9F49F3A5E83589 ^
-FC6794E4B4F2735773A195F9BB2022C70AA4C754 ^
-8BBC40A02D87A8CF14D6CBA0A2C9857D93EFDEFA ^
-D28FF6E2366097135EE565F10263E8798140C5DC ^
-2E4289EBE02E75E53B52D6724CDC16B89ECF3DC6 ^
-F2E716831CC0CB5CB2A623197D14C2C9FC25A914 ^
-47B926A13D65377A8E2AF27A84E175BE93739E38 ^
-D368B8ACC50353EC8070936C73242A2BF6CEC3AA ^
-8556025BED695B975CB924DDFB372F6899A7B09D ^
-9B4ED89E63D17B7210A3FC1BBF0FDA607694F5D9 ^
-0D2221F5CDA184EC7F6CCA29A75F502FCA25673A ^
-3C152CCB811DD9BC16529B23DFA1757D744FE676 ^
-48D1808CD62F868FB6F45560137CFB1DFD856266 ^
-8A3FA42A984C95CA75D6AE51391AAAC0688C2ABD ^
-AB570D91E9B6F3F1188DC8639A3B144837EF1ED8 ^
-673F62A7D205D5C90B7454E81A5EDA9A60650D91 ^
-D00575E45FA324FA05142359BC3A07C803836EE4 ^
-B908BE44A2A66F7370DCC022378A9C2F9BA70B38 ^
-1EF79029F88E7A091D6F2FA2F44A96829C120C62 ^
-491CB2EE0994EE6A4FAC59C4B9FBC9CF8183DE8C ^
-CEAAC4E211E7DDDCE3931C47ACA3D626B62E5054 ^
-BE2041CB55A4882A8335A46B744ECB8611336F5D ^
-E4C0BC6857AFFE0C2B77B38FC01829B44247B6CC ^
-122A6AF11DEB6C3B97E6ADF5E077B5D6363887E3 ^
-<D
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-messages.sha1 b/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-messages.sha1
deleted file mode 100644
index 3dc6bd688d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/sha-1/bit-messages.sha1
+++ /dev/null
@@ -1,4009 +0,0 @@
-# Configuration information for "SHA-1 Test"
-# SHA tests are configured for BIT oriented implementations
-H>SHS Type 1 Strings<H
-D>
-0 1 ^
-1 1 1 ^
-2 1 1 1 ^
-3 0 1 1 1 ^
-2 0 2 2 ^
-4 1 1 1 2 1 ^
-3 0 2 2 2 ^
-4 1 1 2 2 2 ^
-5 1 2 2 1 1 2 ^
-5 0 2 2 1 1 3 ^
-4 0 3 3 3 1 ^
-5 0 2 2 3 2 2 ^
-5 1 2 3 3 1 3 ^
-5 0 3 3 3 2 2 ^
-6 0 2 3 1 2 3 3 ^
-7 1 3 3 3 1 1 1 3 ^
-7 0 2 3 1 2 3 2 3 ^
-6 1 2 4 3 3 3 2 ^
-7 0 2 4 3 3 1 1 4 ^
-8 0 2 3 1 1 2 2 4 4 ^
-7 0 2 4 2 3 1 4 4 ^
-9 0 4 1 2 1 1 2 4 4 2 ^
-8 1 4 4 1 1 4 2 2 4 ^
-7 0 3 3 4 3 4 4 2 ^
-11 0 1 3 1 1 2 1 2 4 4 4 1 ^
-6 0 4 3 4 5 5 4 ^
-7 1 2 5 2 4 5 4 4 ^
-12 1 1 2 3 3 1 1 1 4 2 1 5 3 ^
-11 0 2 3 3 3 1 2 2 4 1 5 2 ^
-8 1 3 3 5 5 2 5 2 4 ^
-9 1 5 4 5 1 2 1 5 3 4 ^
-9 1 5 1 5 2 3 4 4 4 3 ^
-12 1 1 2 5 1 1 5 5 1 4 1 5 1 ^
-12 1 5 3 2 1 3 2 2 2 1 4 5 3 ^
-10 0 5 1 4 5 5 4 1 1 3 5 ^
-12 1 1 5 2 3 1 5 1 3 3 5 1 5 ^
-12 0 1 1 2 3 2 5 1 3 3 6 4 5 ^
-11 1 3 1 5 1 3 4 3 1 5 5 6 ^
-8 1 4 6 4 5 4 4 5 6 ^
-10 1 6 5 4 3 3 3 2 6 2 5 ^
-10 1 2 3 4 4 5 5 2 5 6 4 ^
-13 1 3 1 3 1 4 1 6 6 5 1 2 6 2 ^
-10 1 4 3 3 6 6 6 3 2 6 3 ^
-13 0 3 5 3 1 4 1 4 3 5 3 4 1 6 ^
-10 0 2 5 5 2 6 6 5 2 6 5 ^
-12 1 2 2 5 3 6 6 4 3 2 4 3 5 ^
-13 1 2 6 3 6 5 2 3 2 1 2 3 5 6 ^
-13 1 3 5 6 2 1 1 6 2 4 5 4 5 3 ^
-16 1 2 1 4 3 2 3 2 5 3 4 1 4 1 5 3 5 ^
-11 1 3 1 3 6 7 7 4 1 6 5 6 ^
-12 0 2 5 2 7 5 5 4 2 2 6 7 3 ^
-13 1 6 4 4 1 4 2 5 2 4 2 7 4 6 ^
-12 1 3 4 7 6 7 1 4 4 3 2 5 6 ^
-16 0 3 2 4 5 6 1 1 1 5 3 4 1 4 4 5 4 ^
-14 1 5 1 3 7 6 3 1 3 7 3 1 5 7 2 ^
-14 0 1 5 3 2 7 1 5 5 4 6 5 3 6 2 ^
-14 0 4 7 6 6 2 3 5 1 1 3 6 2 3 7 ^
-13 1 6 4 6 3 7 5 1 4 5 1 7 4 4 ^
-13 0 7 5 3 1 4 7 4 2 2 7 5 4 7 ^
-15 1 7 3 6 1 1 2 7 5 1 5 4 6 1 6 4 ^
-16 0 2 5 3 2 7 2 3 5 2 1 3 3 3 7 5 7 ^
-18 1 3 7 2 4 1 7 3 4 1 5 1 5 1 1 6 1 2 7 ^
-17 0 2 1 7 3 7 1 2 1 4 3 6 6 6 2 2 5 4 ^
-22 1 2 2 1 1 2 6 2 4 1 1 3 5 2 3 4 5 6 1 1 2 6 3 ^
-12 1 7 8 7 2 1 3 5 7 8 7 4 5 ^
-15 1 3 5 5 2 2 2 7 4 2 8 7 4 5 5 4 ^
-16 0 1 4 4 6 1 2 7 1 6 4 1 8 4 7 4 6 ^
-16 0 8 7 7 2 5 2 1 5 6 1 1 5 1 5 6 5 ^
-14 0 7 3 2 3 8 3 3 8 2 8 3 7 7 4 ^
-14 0 4 2 6 5 4 5 3 8 8 4 8 2 6 4 ^
-14 0 8 7 1 3 5 8 2 8 1 4 5 2 8 8 ^
-16 0 5 5 2 2 4 2 4 7 6 1 5 8 3 8 7 2 ^
-16 0 1 6 6 6 6 4 2 2 6 4 2 4 4 6 7 6 ^
-16 1 2 3 7 4 1 7 7 5 7 2 4 7 2 6 6 3 ^
-13 0 7 4 8 6 5 7 6 3 5 7 5 8 3 ^
-16 1 4 1 1 5 4 3 6 5 5 8 5 4 8 5 3 8 ^
-13 0 7 4 4 5 8 3 8 3 8 6 6 6 8 ^
-14 1 5 4 7 5 8 4 6 1 6 2 7 8 6 8 ^
-18 1 3 4 4 5 3 4 1 6 3 7 6 7 3 3 2 8 4 5 ^
-19 0 5 8 1 2 1 3 5 3 1 6 6 3 7 4 5 7 1 4 7 ^
-17 0 5 7 7 2 2 6 4 7 1 7 8 1 5 3 2 7 6 ^
-14 0 9 3 6 9 3 4 7 6 9 1 7 2 9 6 ^
-21 1 8 6 5 2 2 4 3 1 1 6 2 8 4 2 5 4 5 1 2 5 6 ^
-16 1 2 6 5 4 9 8 1 8 1 7 6 7 7 1 2 9 ^
-15 0 6 9 5 4 7 1 7 3 9 4 7 7 5 2 8 ^
-16 0 1 7 8 2 7 2 9 8 8 3 4 5 2 4 8 7 ^
-16 1 1 6 8 2 8 1 6 7 7 5 9 2 9 2 8 5 ^
-16 0 4 2 9 6 2 6 6 7 9 9 1 9 4 1 5 7 ^
-18 1 6 9 2 7 2 8 5 8 4 3 4 4 6 6 3 1 6 4 ^
-19 0 1 7 4 4 4 6 1 6 3 9 5 6 4 7 2 2 5 5 8 ^
-17 1 8 5 3 7 3 5 6 4 1 9 2 6 5 7 9 1 9 ^
-18 0 8 8 6 3 5 3 3 5 5 3 8 3 2 5 5 4 7 8 ^
-16 1 4 7 7 2 7 3 8 5 7 5 6 8 5 2 8 8 ^
-19 0 3 7 2 3 9 5 9 7 7 6 5 3 1 1 5 2 3 9 6 ^
-18 0 2 4 6 7 8 1 2 9 7 2 3 5 8 9 1 7 9 4 ^
-21 1 4 1 8 3 3 1 7 3 5 7 4 1 8 3 6 3 5 7 6 8 2 ^
-17 0 4 8 3 7 9 8 6 8 4 2 8 7 2 4 4 5 7 ^
-18 1 3 9 7 1 4 5 6 9 2 9 1 3 8 4 7 8 7 4 ^
-25 1 2 4 8 1 7 2 7 5 5 3 2 3 2 1 2 1 1 2 4 2 8 7 8 7 4 ^
-25 0 9 4 6 5 8 1 1 1 3 2 1 3 1 1 1 5 3 3 6 5 7 4 5 6 8 ^
-19 1 7 5 6 6 8 2 4 1 8 7 1 6 3 4 8 5 8 5 6 ^
-19 0 6 1 2 1 7 1 10 7 4 5 1 6 4 6 8 7 10 9 6 ^
-16 0 10 10 5 5 9 7 2 5 4 3 6 3 10 10 5 8 ^
-18 1 2 3 5 9 8 5 10 6 8 4 2 2 4 7 9 6 9 4 ^
-18 0 5 10 3 1 4 5 4 6 8 3 7 7 7 5 9 2 9 9 ^
-18 1 4 9 7 5 4 4 10 6 9 3 6 6 8 6 2 4 6 6 ^
-17 0 5 7 4 8 5 9 10 4 9 1 4 8 6 6 5 9 6 ^
-17 1 3 4 8 9 1 5 8 10 5 10 3 8 1 6 8 9 9 ^
-18 0 8 3 6 1 3 10 3 7 6 5 9 3 10 9 4 6 10 5 ^
-16 1 9 1 9 6 5 7 7 10 9 6 1 5 7 10 8 9 ^
-20 0 6 4 10 10 4 3 9 8 10 3 3 5 2 1 8 1 3 2 9 9 ^
-17 1 10 6 10 6 8 3 6 7 3 10 8 6 6 4 4 9 5 ^
-19 1 9 4 3 4 7 3 8 10 2 4 10 7 6 10 1 3 5 7 9 ^
-21 1 2 2 2 3 9 2 8 3 9 3 7 7 4 9 9 5 4 2 6 10 7 ^
-17 1 5 9 8 8 9 10 9 1 8 3 10 2 7 2 10 4 9 ^
-23 0 5 4 10 4 10 7 8 3 1 1 3 4 2 1 1 10 2 1 4 10 10 10 4 ^
-19 0 9 2 5 7 9 6 7 1 8 9 1 2 1 10 8 10 4 7 10 ^
-22 1 2 6 8 8 9 7 2 1 3 3 10 6 2 6 2 6 5 2 5 10 5 9 ^
-22 1 8 7 8 10 1 6 3 7 4 5 5 5 1 9 2 2 5 5 2 10 9 4 ^
-21 0 1 10 2 6 10 9 4 3 3 7 10 2 9 6 10 2 1 5 6 3 10 ^
-21 1 8 5 7 10 5 6 7 3 3 1 2 9 4 8 6 3 9 1 7 7 9 ^
-22 0 5 5 6 5 2 3 5 3 11 4 5 1 10 6 4 11 8 3 6 5 6 7 ^
-20 0 2 1 9 9 3 6 1 8 11 6 7 11 6 1 10 6 7 5 5 8 ^
-19 0 4 1 7 10 4 8 10 8 10 4 11 9 6 1 4 5 6 11 4 ^
-19 1 9 2 4 11 11 11 7 1 1 6 8 1 9 8 5 11 5 4 10 ^
-20 0 8 3 10 1 7 6 10 8 2 9 3 8 6 8 9 3 7 5 1 11 ^
-22 0 4 5 8 4 10 6 5 4 5 3 3 4 1 5 9 4 10 9 6 7 3 11 ^
-21 0 6 5 8 7 8 11 2 1 11 10 3 3 2 9 1 3 6 9 10 10 2 ^
-24 1 3 1 1 9 4 2 5 7 3 10 11 5 6 7 1 7 7 8 7 2 2 7 4 9 ^
-23 1 9 4 6 3 7 5 10 9 8 9 3 2 1 7 2 2 7 6 2 8 3 6 10 ^
-22 1 7 10 2 10 5 1 8 7 7 3 8 6 6 8 3 2 11 6 3 4 7 6 ^
-20 1 11 3 7 2 10 10 7 5 2 4 3 5 11 3 11 8 9 5 5 10 ^
-19 0 6 2 6 8 5 9 4 9 10 9 8 3 2 10 11 2 6 11 11 ^
-20 1 8 2 4 2 7 3 9 9 11 8 2 11 4 8 4 8 10 6 9 8 ^
-21 0 6 10 10 7 9 2 5 11 9 10 7 3 1 4 5 4 10 1 2 8 10 ^
-18 1 8 11 6 10 8 9 11 6 7 7 2 6 2 6 10 6 9 11 ^
-21 0 5 11 1 6 8 11 8 10 5 10 3 7 8 9 9 1 1 1 10 2 10 ^
-25 1 5 10 2 9 9 9 7 2 2 4 6 1 11 7 3 3 5 5 2 11 2 5 5 10 2 ^
-21 1 1 8 1 11 6 9 3 6 11 7 11 8 6 9 4 4 10 7 1 8 7 ^
-23 1 7 7 5 11 1 4 7 11 11 11 9 2 1 3 8 2 8 7 4 5 2 5 8 ^
-24 1 4 11 5 10 7 7 9 5 1 5 6 2 9 1 5 7 9 9 11 1 1 3 1 11 ^
-27 1 10 4 6 8 5 7 11 4 10 8 6 4 3 4 4 2 1 1 3 3 1 11 2 3 4 10 6 ^
-21 1 7 11 2 7 10 10 9 10 1 3 10 4 3 11 10 2 5 3 9 11 4 ^
-22 0 7 9 10 9 5 2 6 6 9 2 7 4 9 8 4 9 2 5 9 8 10 3 ^
-21 0 12 2 6 12 7 9 3 5 11 6 11 3 5 4 4 11 10 2 1 10 10 ^
-27 1 1 4 12 2 10 1 6 5 5 4 1 10 3 1 12 3 2 11 5 1 4 6 4 6 11 11 4 ^
-22 1 8 9 4 8 12 5 5 9 3 5 2 3 4 12 12 8 5 3 1 9 10 9 ^
-24 0 5 12 8 6 2 4 11 11 2 7 11 9 4 5 2 1 8 3 10 2 5 2 8 9 ^
-21 0 3 7 7 7 5 9 11 5 9 11 2 9 7 5 6 11 2 12 4 9 7 ^
-26 0 4 4 6 4 7 2 4 2 5 7 2 6 11 5 9 8 2 5 10 2 10 8 8 5 2 11 ^
-23 1 3 3 2 6 9 10 5 6 8 5 8 11 3 6 10 4 6 9 2 11 10 3 10 ^
-25 1 1 3 12 3 7 4 5 5 3 8 9 2 4 8 7 7 9 1 9 11 4 5 7 7 10 ^
-20 1 11 9 8 10 11 1 7 12 6 7 4 2 12 12 2 3 9 10 8 8 ^
-20 0 12 11 1 4 10 6 10 3 9 7 12 4 11 8 4 6 12 4 7 12 ^
-24 0 8 6 4 8 2 2 9 2 9 6 3 6 3 3 10 12 2 7 8 7 8 12 10 7 ^
-26 0 5 11 11 7 3 3 9 10 3 9 3 3 7 2 9 9 1 2 4 12 2 5 5 6 10 4 ^
-22 1 12 9 10 10 12 12 7 8 2 7 1 6 8 2 8 7 6 3 1 1 12 12 ^
-22 1 11 10 2 11 10 8 1 2 8 12 8 3 9 5 7 9 8 7 11 1 10 4 ^
-22 0 10 1 8 6 12 2 11 7 10 4 10 6 5 7 10 11 3 3 8 8 4 12 ^
-26 0 8 5 5 12 1 8 6 7 6 11 8 10 4 3 7 6 1 5 1 1 9 1 5 8 9 12 ^
-21 0 1 12 4 11 12 9 2 12 12 3 12 5 4 12 4 1 5 8 12 9 10 ^
-26 1 5 3 8 1 11 4 7 3 3 10 4 9 6 6 4 3 9 11 1 3 7 10 7 9 6 11 ^
-23 0 7 12 3 5 8 9 7 10 8 11 10 11 6 1 8 1 1 6 3 9 8 12 6 ^
-25 0 1 5 5 6 5 12 1 1 1 11 9 9 3 11 9 6 1 11 3 1 12 8 11 11 10 ^
-22 1 10 9 7 3 10 2 6 4 11 3 11 6 4 5 5 11 12 9 7 8 12 9 ^
-22 0 8 5 10 7 12 8 3 4 4 5 8 9 12 6 8 10 6 7 11 4 8 10 ^
-26 0 3 5 3 11 11 2 1 9 1 10 4 4 6 9 4 7 6 5 10 10 1 8 9 9 6 12 ^
-24 0 12 11 4 10 1 3 7 5 11 9 11 7 2 11 5 4 7 8 1 6 12 7 4 9 ^
-28 0 1 12 10 2 2 2 4 9 11 4 11 7 2 4 3 11 7 10 5 10 5 5 3 5 2 7 5 9 ^
-26 1 4 1 4 2 13 6 11 5 6 8 5 1 5 6 3 8 1 5 8 9 9 10 12 13 12 2 ^
-26 0 12 3 1 11 2 12 6 8 6 8 11 4 11 10 9 6 3 3 2 2 2 13 2 1 13 9 ^
-22 0 3 3 12 13 13 7 12 2 8 11 9 10 10 1 1 13 11 13 4 1 11 3 ^
-26 1 2 6 2 8 12 3 7 12 8 9 8 3 12 7 4 9 2 6 4 9 9 4 8 2 4 12 ^
-24 1 8 11 11 3 13 2 10 3 10 8 6 6 4 4 13 4 2 4 8 1 11 12 9 10 ^
-29 1 1 2 5 1 1 10 3 2 4 9 11 8 2 5 2 8 10 2 10 11 7 8 12 6 1 9 8 4 12 ^
-23 0 6 12 7 10 7 7 13 2 2 7 10 2 8 13 10 7 11 2 5 9 11 13 1 ^
-25 1 3 11 2 10 5 11 5 7 10 8 10 1 10 3 11 7 9 5 3 3 4 5 13 12 8 ^
-26 1 5 13 9 4 3 3 4 3 13 1 6 11 10 8 13 3 4 11 9 1 9 1 7 8 7 11 ^
-22 1 1 3 13 8 11 3 4 10 10 12 7 2 11 4 7 7 6 13 13 9 13 11 ^
-26 1 7 9 7 8 9 9 5 1 13 3 3 4 9 2 1 8 9 3 9 12 8 10 10 6 11 3 ^
-23 1 3 8 12 8 10 4 3 8 5 5 7 11 13 11 12 11 4 12 3 6 5 11 8 ^
-27 0 3 10 9 6 9 7 2 10 4 4 5 5 2 12 13 5 3 1 10 1 4 7 8 13 13 12 3 ^
-30 0 2 6 5 4 7 3 10 6 13 6 3 9 6 2 10 5 3 8 4 1 11 3 5 3 7 11 1 12 9 7 ^
-29 0 5 2 13 6 5 2 6 3 2 9 5 3 6 6 4 10 2 4 7 7 10 13 9 6 10 6 5 9 8 ^
-31 1 9 8 2 7 3 5 11 3 7 7 5 6 2 1 1 6 2 11 5 4 5 7 9 1 11 10 2 3 9 12 10 ^
-28 0 11 1 4 1 12 10 5 5 1 7 2 3 10 7 12 9 2 8 2 6 10 5 12 12 4 9 2 13 ^
-26 1 11 9 8 12 4 12 7 3 4 4 6 1 2 7 12 4 6 8 10 11 11 1 10 2 9 12 ^
-28 0 10 9 7 10 1 10 9 12 7 10 7 6 6 5 3 2 3 1 3 12 1 4 13 3 9 7 9 8 ^
-27 1 4 11 1 5 6 9 12 12 13 13 13 1 2 13 1 2 1 12 12 3 2 2 8 3 13 7 7 ^
-29 0 6 5 5 2 4 2 11 4 4 13 9 13 7 3 12 8 3 7 6 4 12 3 1 8 11 1 6 13 6 ^
-23 1 11 6 6 11 7 13 11 6 7 4 4 12 2 13 5 12 5 7 9 6 11 11 11 ^
-23 0 11 13 11 7 4 3 6 12 13 10 11 5 12 13 11 6 1 1 4 7 13 10 7 ^
-27 1 7 5 13 5 4 8 7 3 9 6 7 11 7 1 9 3 8 5 8 8 2 13 13 8 5 13 4 ^
-30 1 2 5 8 4 13 10 6 4 2 6 1 1 12 4 13 5 10 4 10 8 5 7 1 5 5 12 4 8 6 12 ^
-28 1 12 1 12 11 10 2 3 10 1 2 6 11 12 9 11 12 2 1 9 4 1 5 7 2 12 11 4 11 ^
-29 0 6 8 7 8 8 12 2 7 4 12 11 5 5 3 5 13 4 11 8 8 9 2 2 1 6 2 8 6 12 ^
-28 1 7 13 5 7 11 3 1 9 2 5 12 8 6 2 5 9 10 10 11 4 5 12 5 4 6 5 6 13 ^
-25 1 14 4 8 2 9 11 7 4 3 2 8 14 6 14 7 13 5 5 14 6 5 11 6 6 13 ^
-26 1 3 5 12 1 11 13 1 3 3 10 11 5 6 12 11 12 7 14 4 3 6 6 10 11 14 4 ^
-27 0 4 2 3 10 7 12 13 8 8 12 10 13 1 7 10 2 7 2 13 10 2 3 3 6 4 13 14 ^
-24 1 11 1 9 14 4 14 14 8 10 13 4 3 2 7 6 6 8 14 5 11 7 14 14 1 ^
-22 1 13 13 10 9 13 8 14 9 3 14 3 11 9 9 12 13 2 10 1 5 8 12 ^
-25 0 9 10 9 8 4 14 6 9 3 13 10 11 3 1 4 6 10 3 4 3 12 12 14 11 13 ^
-26 1 11 8 11 7 8 10 9 12 11 6 10 6 3 9 9 1 7 5 6 7 7 12 4 5 8 11 ^
-26 1 12 10 8 14 7 4 13 13 8 4 5 3 2 4 7 14 3 10 6 9 13 9 2 1 9 14 ^
-28 0 6 12 2 4 7 8 11 10 12 2 14 3 1 1 1 12 5 13 9 12 5 9 10 5 1 12 10 8 ^
-29 1 2 6 5 14 14 3 6 13 1 2 6 2 12 1 2 10 1 4 5 14 10 12 11 2 3 14 14 12 5 ^
-30 1 5 2 3 5 11 12 3 7 12 7 9 8 3 3 14 10 5 2 9 3 8 6 11 8 7 8 1 6 12 7 ^
-28 1 14 5 2 14 7 8 1 5 4 12 9 6 12 1 1 7 9 5 14 11 9 4 1 10 1 14 10 12 ^
-27 0 7 2 8 5 3 14 8 9 4 6 11 3 11 6 12 1 7 14 9 14 6 10 6 1 8 14 10 ^
-26 1 6 14 2 2 12 10 5 10 10 8 3 7 13 10 1 14 1 14 7 11 12 9 1 8 8 12 ^
-30 0 6 13 5 13 3 5 8 8 8 2 5 5 4 2 13 14 7 2 12 12 3 3 5 7 5 11 3 7 13 7 ^
-26 0 13 7 2 8 4 10 14 2 7 1 10 8 11 11 2 13 9 11 2 9 11 7 13 11 2 14 ^
-31 1 7 7 8 5 13 4 1 12 14 1 9 11 3 5 3 13 11 7 3 2 9 1 3 13 6 3 10 12 1 13 3 ^
-23 0 9 8 8 7 14 13 6 13 14 12 13 12 7 4 14 10 1 3 9 7 11 14 5 ^
-27 1 1 10 4 12 4 11 5 13 13 4 12 13 7 12 12 4 13 6 2 7 5 2 8 7 13 12 3 ^
-26 1 7 6 11 12 14 12 3 12 8 7 4 9 14 1 8 11 6 5 10 10 6 8 5 2 11 14 ^
-33 1 1 11 1 5 3 8 1 12 14 5 1 3 7 2 3 9 3 4 14 4 4 10 8 5 14 1 11 12 12 10 4 13
-2 ^
-32 0 11 4 4 9 5 5 8 9 5 10 4 2 4 7 9 9 6 3 5 1 8 3 2 13 3 14 9 8 9 10 14 5 ^
-28 0 12 9 5 8 7 2 14 12 3 8 14 6 6 4 7 5 7 10 7 11 10 1 9 6 7 12 8 9 ^
-25 0 9 9 2 11 13 12 11 11 6 14 13 10 5 6 8 10 4 3 11 11 14 5 5 10 7 ^
-30 0 13 9 14 11 4 8 12 9 5 9 1 2 9 13 12 6 1 14 11 10 7 8 6 1 4 3 2 2 2 13 ^
-33 1 13 5 9 6 13 9 1 13 2 6 8 9 1 3 12 13 3 4 4 12 5 2 1 12 1 6 2 1 8 2 14 13 9
-^
-32 1 8 6 7 1 4 4 6 1 13 3 3 1 13 7 6 11 6 4 9 10 4 8 13 1 9 10 12 7 10 11 10 5 ^
-30 0 12 6 6 3 4 13 1 4 11 10 2 6 14 6 9 12 6 2 2 11 9 13 4 7 9 14 2 11 8 7 ^
-26 1 2 11 13 2 9 11 8 11 11 15 13 13 3 15 2 12 1 15 3 8 4 9 13 1 13 7 ^
-32 1 9 6 1 2 2 1 15 3 15 1 10 1 4 11 14 14 6 10 2 5 9 10 10 9 1 2 14 10 12 1 1
-15 ^
-29 1 13 2 3 8 12 5 14 9 8 9 2 14 1 4 6 15 10 9 2 7 9 4 8 7 9 10 11 11 5 ^
-34 1 12 2 7 2 12 8 2 8 6 3 12 4 4 10 1 14 12 11 5 15 3 3 3 14 13 2 2 3 8 2 1 8
-8 8 ^
-31 0 6 2 7 10 1 13 10 6 6 6 2 8 7 6 7 14 3 12 6 8 9 3 11 1 3 10 12 11 11 9 9 ^
-24 1 13 15 4 7 11 13 10 14 14 13 4 11 5 6 11 8 12 13 9 1 10 9 10 7 ^
-33 0 3 1 3 3 4 13 1 6 14 8 3 4 3 2 1 14 14 14 5 13 13 11 10 13 4 3 10 11 3 6 1
-10 7 ^
-28 0 7 9 13 9 15 2 4 12 10 10 4 12 3 8 5 6 13 1 6 15 1 8 9 6 12 11 7 14 ^
-32 1 3 1 13 6 4 1 9 4 5 7 1 8 8 11 10 5 15 14 2 8 14 9 7 12 2 4 13 7 4 3 9 14 ^
-31 1 14 12 13 8 4 12 2 6 5 12 9 3 11 8 5 13 5 10 5 2 3 7 12 14 4 1 7 3 6 9 9 ^
-32 1 10 15 7 2 13 5 7 2 5 2 10 7 11 5 5 9 8 2 9 3 3 6 3 13 10 3 5 7 15 11 10 12
-^
-38 0 2 3 7 1 6 3 3 12 5 2 9 4 5 11 2 1 7 6 14 7 14 10 4 11 6 3 11 2 10 6 4 8 1
-4 9 4 15 4 ^
-27 0 7 7 4 14 2 3 14 15 10 7 12 7 5 8 7 15 15 14 10 2 3 1 10 12 15 9 9 ^
-31 1 15 3 9 9 5 4 2 6 14 4 9 5 12 8 1 6 1 4 8 7 10 14 3 10 14 8 11 9 8 10 9 ^
-28 0 14 11 8 3 5 5 7 2 11 4 4 4 6 14 13 10 14 10 3 9 6 9 7 5 10 15 15 15 ^
-30 1 8 13 4 2 13 6 4 7 4 4 15 2 2 12 13 3 14 12 7 11 6 2 14 2 6 6 9 14 13 12 ^
-27 1 13 14 15 12 14 5 14 15 11 4 1 1 9 5 13 10 6 5 5 6 14 13 1 5 3 14 13 ^
-29 0 4 2 13 12 15 7 3 15 5 1 6 7 6 13 1 14 11 9 5 15 6 13 3 6 11 7 15 8 9 ^
-31 0 5 4 4 14 3 13 8 13 3 7 13 7 9 12 3 11 15 11 5 14 1 3 4 10 12 7 12 1 2 13 4
-^
-28 1 12 7 13 14 7 7 1 9 13 8 5 14 2 5 9 9 15 9 13 7 8 9 8 1 12 3 9 15 ^
-34 1 6 12 4 14 12 5 3 15 4 4 6 8 2 11 8 4 2 5 1 15 15 1 15 2 11 4 10 9 4 7 3 2
-15 6 ^
-26 0 14 5 6 5 11 12 14 12 12 11 15 2 14 9 15 1 7 12 11 12 13 14 1 1 12 5 ^
-32 0 2 2 4 5 2 11 12 5 4 12 9 14 5 5 8 6 2 15 15 6 13 11 3 5 15 5 11 3 12 7 10
-8 ^
-26 1 2 15 14 9 14 7 6 15 9 3 4 8 8 12 14 2 9 11 14 6 11 15 10 8 14 8 ^
-34 1 15 7 4 5 10 1 13 7 1 1 8 3 13 11 2 8 15 11 12 6 6 1 3 2 2 11 3 13 9 10 3 6
-12 15 ^
-25 0 15 7 10 2 10 15 5 10 13 12 8 15 3 1 11 14 15 8 15 12 9 6 8 13 13 ^
-27 0 10 8 13 10 15 13 5 8 4 10 10 6 7 13 6 12 12 9 12 2 5 10 12 10 8 15 6 ^
-28 0 5 3 8 12 15 8 14 15 9 12 12 3 10 13 6 11 10 4 13 14 8 9 1 8 1 5 11 12 ^
-29 0 9 12 4 13 15 5 9 11 7 14 11 1 11 7 8 8 11 1 13 15 12 1 5 8 3 8 10 7 14 ^
-30 0 1 5 13 12 14 5 3 6 4 12 15 6 6 10 11 13 9 1 11 6 10 3 7 14 4 14 11 7 8 13 ^
-34 1 1 12 5 1 7 4 6 7 5 11 1 4 7 12 10 10 8 15 13 4 11 15 11 6 9 1 2 15 5 1 5
-12 6 13 ^
-35 1 12 15 4 11 13 3 6 5 10 8 1 3 9 3 11 1 2 16 12 10 6 1 9 1 16 5 6 15 1 12 4
-4 2 15 4 ^
-27 0 15 11 15 5 11 9 7 15 16 6 16 12 3 2 10 16 5 5 7 1 7 11 13 7 9 11 12 ^
-31 1 5 5 5 4 13 13 14 4 7 12 6 4 8 2 9 9 13 13 3 3 6 7 16 7 6 15 5 8 15 6 15 ^
-30 1 6 16 15 11 14 14 4 7 10 3 4 10 3 6 7 14 4 6 6 5 2 7 8 16 2 12 16 10 14 7 ^
-36 1 2 3 7 14 6 9 4 4 5 9 7 12 3 9 2 5 1 3 10 11 11 6 12 7 1 7 12 2 1 2 8 12 15
-16 9 13 ^
-34 1 6 3 12 11 16 15 8 8 8 14 13 7 7 8 2 7 6 2 2 14 7 1 4 2 4 11 11 5 7 2 12 1
-14 11 ^
-29 0 12 11 2 9 8 5 6 14 10 12 5 11 5 3 1 13 15 9 12 11 13 4 14 5 16 3 5 13 15 ^
-30 1 5 16 11 2 6 13 16 3 6 4 9 10 9 8 6 14 8 9 5 13 6 5 14 2 8 15 8 7 14 11 ^
-28 1 14 10 13 13 11 10 13 9 8 4 11 14 11 6 10 10 1 9 13 16 5 3 4 7 9 12 10 8 ^
-36 1 10 15 12 8 8 10 13 5 6 11 4 6 2 3 5 6 11 1 1 8 6 13 15 6 3 15 5 10 1 6 2 5
-2 11 10 10 ^
-31 1 4 14 7 2 14 3 1 12 7 15 13 1 5 9 8 3 3 14 12 13 2 15 12 7 16 12 3 8 11 5
-15 ^
-34 0 10 2 10 16 4 16 7 8 1 16 6 14 9 5 12 16 8 9 4 4 4 1 7 13 10 1 7 10 5 7 4 1
-5 15 ^
-30 0 16 3 8 7 3 8 8 11 8 13 4 16 8 16 1 4 16 11 4 12 1 14 5 1 16 11 8 14 12 9 ^
-33 0 7 9 9 16 11 7 6 1 11 14 12 14 10 9 11 8 11 7 5 10 15 2 6 9 3 9 4 2 1 1 9
-14 6 ^
-32 0 5 8 14 15 4 1 6 1 10 8 1 15 15 3 10 7 8 10 12 4 3 11 15 8 5 3 3 16 15 7 14
-13 ^
-36 0 3 10 12 2 11 9 2 1 4 3 8 10 14 2 11 3 2 4 15 14 5 2 8 16 16 1 5 7 5 9 5 15
-9 11 3 14 ^
-31 1 5 4 14 4 8 3 3 1 10 4 15 15 13 2 13 9 7 13 11 9 1 15 15 15 16 7 7 6 5 13 9
-^
-30 0 14 16 12 1 11 11 7 3 7 3 3 13 4 13 14 5 15 12 5 14 16 14 4 5 9 6 6 3 16 11
-^
-28 1 10 16 10 14 13 6 16 14 3 14 15 7 13 12 4 1 8 4 10 6 1 13 6 14 11 3 16 14 ^
-33 0 15 11 13 8 11 1 15 2 10 9 9 14 8 13 2 13 8 1 2 1 3 12 8 5 4 11 10 14 8 9 4
-5 16 ^
-34 1 12 12 6 7 13 13 12 1 13 14 1 1 6 3 13 2 16 3 1 16 9 9 15 3 13 1 8 3 2 6 12
-8 9 13 ^
-27 0 11 12 15 14 12 10 8 15 9 15 2 7 5 11 8 9 7 16 6 15 4 15 7 11 15 4 14 ^
-29 1 9 1 14 7 4 14 16 11 10 11 12 14 6 12 11 15 7 14 3 15 6 1 12 5 12 13 3 6 14
-^
-28 0 6 10 7 7 9 10 7 11 12 16 9 6 9 14 10 10 2 7 4 15 16 13 11 8 10 15 10 15 ^
-32 1 8 12 1 10 3 7 15 14 9 16 14 1 15 3 14 9 2 2 12 14 7 3 5 14 5 15 10 2 14 1
-15 8 ^
-33 0 9 16 10 16 6 13 1 6 2 8 13 5 7 2 15 11 12 6 8 7 1 5 8 13 9 4 8 12 9 15 1
-10 13 ^
-30 0 10 4 16 4 13 12 2 4 14 6 11 3 15 8 4 12 3 11 16 16 16 2 13 7 10 2 13 10 15
-10 ^
-33 1 16 2 15 10 4 1 13 12 12 9 12 7 16 4 12 4 2 16 4 9 16 8 2 6 15 2 3 4 9 12 6
-8 12 ^
-34 1 13 11 11 4 9 13 14 2 9 6 8 6 10 11 9 3 12 9 13 4 10 3 5 1 14 11 11 16 1 2
-2 11 6 14 ^
-33 1 15 12 6 5 16 2 14 2 10 12 2 5 5 6 10 13 12 3 10 8 16 9 5 12 15 4 11 13 3 6
-5 10 8 ^
-35 1 1 3 9 3 11 1 2 16 12 10 6 1 9 1 16 5 6 15 1 12 4 4 2 15 13 15 11 15 5 11 9
-7 15 16 4 ^
-36 0 16 12 3 2 10 16 5 5 7 1 7 11 13 7 9 11 2 5 5 5 4 13 13 14 4 7 12 6 4 8 2 9
-9 13 13 4 ^
-35 0 3 6 7 16 7 6 15 5 8 15 6 4 6 16 15 11 14 14 4 7 10 3 4 10 3 6 7 14 4 6 6 5
-2 7 16 ^
-31 0 7 4 8 17 16 16 11 14 2 10 14 15 10 9 1 14 10 14 6 6 16 3 2 3 8 3 12 8 11
-17 2 ^
-30 1 9 7 16 14 4 11 15 5 13 9 5 12 17 17 13 8 2 6 8 16 1 12 5 17 2 9 8 10 13 6 ^
-27 0 11 17 12 5 14 9 11 9 11 4 11 13 16 6 10 5 8 3 17 16 14 1 15 15 15 6 17 ^
-29 1 2 11 6 13 11 13 4 6 7 11 11 12 16 13 1 16 16 14 16 2 4 16 11 6 15 7 4 17
-11 ^
-32 0 5 7 6 3 14 16 5 17 11 13 1 1 14 13 3 6 14 5 17 5 4 8 14 3 16 7 13 4 14 8 9
-17 ^
-31 1 8 12 8 15 9 6 6 1 5 13 16 5 8 4 6 10 6 11 16 17 15 15 12 4 13 5 3 4 10 15
-16 ^
-33 0 7 15 16 12 12 11 8 13 14 5 8 1 11 10 9 3 14 3 1 9 6 15 12 16 4 5 9 7 1 9 4
-8 17 ^
-36 1 7 9 16 11 11 6 13 7 1 7 8 1 14 12 2 7 4 5 15 16 12 3 1 6 11 4 15 8 9 9 2 1
-13 2 14 14 ^
-29 1 6 8 8 15 13 13 10 2 16 12 17 6 7 14 13 12 13 3 14 12 12 2 15 2 5 15 10 7
-15 ^
-38 1 5 15 7 8 10 10 1 11 2 4 3 11 11 3 5 2 3 11 5 12 12 8 6 2 17 15 6 16 15 4 3
-14 6 3 2 10 5 15 ^
-30 0 12 11 15 14 2 16 14 7 6 15 9 3 11 8 8 5 16 2 16 2 16 6 9 6 12 10 16 7 15
-10 ^
-36 0 11 5 3 16 1 15 7 10 17 10 10 13 2 2 17 6 2 5 6 6 10 12 2 9 11 12 6 1 1 8
-12 2 6 16 12 16 ^
-30 1 10 17 5 1 6 14 17 8 12 10 11 16 15 1 8 3 9 13 7 7 16 8 13 11 10 8 15 3 15
-12 ^
-31 1 14 8 4 12 1 6 5 13 15 3 5 11 14 11 14 17 5 10 17 7 8 13 5 12 15 3 6 17 7
-17 7 ^
-31 0 12 3 10 10 4 13 13 8 11 13 7 17 11 1 10 1 5 11 11 9 14 13 15 8 14 2 7 16
-11 8 15 ^
-32 1 7 16 17 17 4 1 13 15 5 1 5 6 14 15 1 5 1 9 9 17 12 13 12 7 12 3 7 15 4 16
-12 13 ^
-36 0 8 17 1 11 4 10 2 6 10 3 16 16 2 7 13 9 15 7 17 14 3 10 16 13 6 7 5 2 1 4
-16 3 10 1 15 5 ^
-32 0 4 6 4 15 11 4 2 17 9 15 5 10 7 12 15 16 15 17 12 14 9 2 13 4 9 2 4 15 2 11
-9 16 ^
-29 0 4 4 3 17 2 14 17 17 1 17 13 11 15 17 4 9 15 8 11 16 9 10 8 9 12 15 1 17 11
-^
-35 0 16 4 2 14 14 15 1 2 12 9 1 10 16 10 11 7 1 12 17 8 2 15 11 1 7 17 12 7 3 7
-6 9 9 14 6 ^
-36 0 2 15 17 10 11 9 5 9 4 17 16 3 11 2 10 12 11 5 3 8 17 15 3 3 4 7 2 1 10 7
-14 4 16 6 12 8 ^
-36 1 12 14 6 9 3 17 11 10 6 8 14 6 11 7 10 8 6 17 4 4 9 8 2 8 14 8 7 14 1 3 6 8
-11 10 17 1 ^
-39 1 12 14 9 4 11 7 6 6 13 14 2 13 1 14 9 7 7 15 2 2 5 15 13 17 3 15 16 9 1 1 2
-3 2 12 1 3 3 13 9 ^
-34 0 13 10 15 5 8 10 15 10 8 7 5 5 14 4 13 11 12 4 4 12 10 13 12 4 10 3 3 7 9
-13 16 9 17 1 ^
-36 0 4 12 1 9 12 13 5 10 1 3 15 4 1 13 17 1 8 9 6 12 4 7 7 10 17 13 17 6 17 9 6
-9 3 5 17 10 ^
-34 0 1 4 10 12 17 14 11 8 5 16 5 5 2 13 13 16 9 13 10 9 9 5 3 13 6 4 3 9 15 14
-14 7 3 16 ^
-38 1 9 17 3 6 5 16 10 14 9 1 16 7 3 5 4 17 14 7 12 6 2 8 8 17 7 2 4 5 7 12 2 1
-7 11 3 14 9 15 ^
-41 0 2 12 3 4 1 4 1 16 10 5 16 8 7 2 10 3 5 9 16 8 16 13 3 12 5 5 11 2 2 7 4 2
-8 16 4 14 5 14 10 4 17 ^
-36 0 6 1 2 7 1 15 13 1 17 4 7 4 8 17 16 16 11 14 2 10 14 15 10 9 1 14 10 14 6 6
-16 3 2 3 8 14 ^
-32 1 12 8 11 17 3 9 7 16 14 4 11 15 5 13 9 5 12 17 17 13 8 2 6 8 16 1 12 5 17 2
-9 14 ^
-29 0 10 13 14 11 17 12 5 14 9 11 9 11 4 11 13 16 6 10 5 8 3 17 16 14 1 15 15 15
-14 ^
-32 0 13 2 11 6 13 11 13 4 6 7 11 11 12 16 13 1 16 16 14 16 2 4 16 11 6 15 7 4
-17 6 5 15 ^
-35 1 6 3 14 16 5 17 11 13 1 1 14 13 3 6 14 5 17 5 4 8 14 3 16 7 13 4 14 8 9 3 8
-12 8 15 11 ^
-33 1 6 6 1 5 13 16 5 8 4 6 10 6 11 16 17 15 15 12 4 13 5 3 4 10 15 12 7 15 16
-12 12 11 11 ^
-40 0 13 14 5 8 1 11 10 9 3 14 3 1 9 6 15 12 16 4 5 9 7 1 9 4 8 5 7 9 16 11 11 6
-13 7 1 7 8 1 14 10 ^
-34 0 2 10 15 10 14 8 18 9 9 12 12 3 13 12 6 4 9 17 13 13 5 7 3 2 1 17 14 4 16 6
-13 1 13 13 ^
-35 1 6 10 1 3 18 3 11 7 9 5 7 11 17 1 9 16 5 15 10 17 3 8 15 17 8 15 11 3 15 17
-11 1 1 4 15 ^
-36 1 14 18 4 2 18 8 15 6 4 6 3 15 11 16 10 17 17 9 6 3 2 6 16 4 9 12 6 8 1 11 3
-2 12 2 14 16 ^
-37 0 4 1 5 11 16 18 16 8 11 15 2 18 7 5 14 5 15 13 3 3 5 4 3 11 4 4 5 10 3 12
-17 1 4 17 10 10 17 ^
-35 0 1 3 4 2 1 12 5 14 11 10 4 6 14 9 1 5 8 2 9 15 12 13 7 16 2 13 17 15 9 18
-15 9 13 16 17 ^
-34 1 18 10 4 11 13 9 6 1 17 6 8 6 5 11 5 14 16 9 13 11 10 9 15 4 14 7 14 3 1 15
-5 5 18 16 ^
-34 0 13 8 13 16 5 17 5 10 1 8 8 12 6 13 18 9 6 17 3 16 2 8 9 8 7 2 14 14 8 10
-13 9 11 11 ^
-40 0 7 11 4 6 9 10 11 12 2 14 1 13 1 7 1 15 7 9 8 2 1 4 9 14 17 8 17 15 3 4 15
-15 2 2 3 16 13 2 9 12 ^
-33 0 14 6 6 5 2 13 4 16 11 3 10 18 2 15 5 9 4 8 4 18 18 17 18 3 14 12 9 11 15
-16 1 9 16 ^
-32 1 18 5 10 6 7 17 7 12 3 13 8 12 3 8 9 3 17 12 8 18 6 14 3 6 14 14 10 14 13
-17 18 8 ^
-36 1 18 12 17 9 17 2 12 5 9 12 1 18 10 5 5 2 18 3 6 16 18 3 1 2 10 15 2 5 8 16
-10 14 3 9 8 13 ^
-33 1 16 14 1 16 15 16 17 4 12 12 16 5 3 9 14 5 7 17 12 11 12 18 14 2 7 7 15 8 3
-5 1 8 13 ^
-34 1 7 6 7 14 9 15 15 18 16 3 10 5 16 6 8 11 4 1 10 1 16 4 12 17 15 14 8 5 4 6
-4 17 16 16 ^
-38 0 4 5 18 18 12 9 3 9 6 9 7 6 10 15 4 9 17 5 17 5 6 1 6 2 8 17 7 7 4 4 13 16
-3 4 10 16 12 13 ^
-33 0 16 7 18 3 3 11 9 13 14 15 18 2 12 10 3 15 3 1 10 6 15 13 17 13 5 9 7 11 9
-5 18 15 12 ^
-33 1 16 11 1 6 18 13 8 1 18 8 1 5 13 1 18 5 15 15 16 12 13 2 17 12 14 17 8 1 10
-12 10 4 18 ^
-34 0 5 6 18 18 7 10 13 14 10 12 7 4 10 8 16 16 15 5 13 14 4 14 2 4 12 6 11 5 17
-8 5 1 14 16 ^
-31 1 17 9 11 2 11 11 3 13 13 11 12 13 5 12 12 11 6 13 4 18 15 12 18 6 6 7 15 13
-12 14 16 ^
-38 1 4 11 2 5 6 12 10 2 7 15 11 8 14 7 16 16 1 4 3 9 14 16 3 18 1 7 17 1 7 3 16
-17 6 16 12 5 3 17 ^
-40 1 10 15 18 10 8 10 2 5 11 2 7 3 5 6 7 1 12 2 9 2 4 15 1 11 11 17 3 3 16 8 3
-11 18 16 11 6 15 8 8 13 ^
-40 1 10 3 17 7 10 18 13 14 8 7 8 14 2 2 8 6 3 7 5 6 9 5 12 10 7 6 5 16 4 14 2
-15 3 15 9 15 1 9 7 12 ^
-35 0 14 15 12 7 2 16 18 8 18 1 13 12 1 1 14 14 13 3 14 7 2 10 10 11 14 3 12 5
-13 6 17 14 1 11 13 ^
-34 0 7 12 8 12 17 17 18 17 13 2 4 7 5 1 15 7 14 17 11 6 10 9 18 9 14 13 3 8 4
-13 8 7 13 7 ^
-35 0 4 16 8 17 10 2 13 10 2 2 6 2 3 18 17 2 17 4 18 7 16 18 14 4 11 7 4 15 17 6
-11 11 14 17 4 ^
-37 0 10 17 16 13 15 14 6 1 14 11 8 16 6 2 16 13 7 8 6 2 15 1 9 12 4 4 11 13 7 2
-11 9 18 4 5 4 18 ^
-39 0 2 14 9 9 1 8 13 11 15 8 5 9 10 16 9 2 7 1 1 17 13 6 11 10 8 5 12 15 6 15
-10 12 4 18 1 2 8 11 15 ^
-32 1 16 10 12 18 11 16 12 11 17 17 4 7 13 7 10 7 10 6 1 12 7 18 11 18 2 10 15
-10 14 8 18 2 ^
-40 1 9 12 12 3 13 12 6 4 9 17 13 13 5 7 3 2 1 17 14 4 16 6 13 1 13 6 6 10 1 3
-18 3 11 7 9 5 7 11 17 12 ^
-36 1 9 16 5 15 10 17 3 8 15 17 8 15 11 3 15 17 11 1 1 4 3 14 18 4 2 18 8 15 6 4
-6 3 15 11 16 8 ^
-39 1 17 17 9 6 3 2 6 16 4 9 12 6 8 1 11 3 2 12 2 14 12 4 1 5 11 16 18 16 8 11
-15 2 18 7 5 14 5 15 10 ^
-47 1 3 3 5 4 3 11 4 4 5 10 3 12 17 1 4 17 10 10 9 1 3 4 2 1 12 5 14 11 10 4 6
-14 9 1 5 8 2 9 15 12 13 7 16 2 13 17 3 ^
-34 1 9 18 15 9 13 16 18 10 4 11 13 9 6 1 17 6 8 6 5 11 5 14 16 9 13 11 10 9 15
-4 14 7 14 9 ^
-37 1 1 15 5 5 18 13 13 8 13 16 5 17 5 10 1 8 8 12 6 13 18 9 6 17 3 16 2 8 9 8 7
-2 14 14 8 10 13 ^
-42 0 9 11 10 7 11 4 6 9 10 11 12 2 14 1 13 1 7 1 15 7 9 8 2 1 4 9 14 17 8 17 15
-3 4 15 15 2 2 3 16 13 2 17 ^
-36 0 16 14 6 6 5 2 13 4 16 11 3 10 18 2 15 5 9 4 8 4 18 18 17 18 3 14 12 9 11
-15 16 1 9 2 18 6 ^
-33 1 10 6 7 17 7 12 3 13 8 12 3 8 9 3 17 12 8 18 6 14 3 6 14 14 10 14 13 17 18
-14 18 12 13 ^
-39 1 9 17 2 12 5 9 12 1 18 10 5 5 2 18 3 6 16 18 3 1 2 10 15 2 5 8 16 10 14 3 9
-8 10 16 14 1 16 15 14 ^
-30 1 17 19 5 7 14 4 11 3 6 18 13 7 18 18 19 19 13 9 10 19 14 12 4 15 15 18 2 10
-7 15 ^
-34 1 2 13 8 19 15 1 11 14 7 7 17 6 16 4 16 17 2 18 12 5 14 19 17 1 8 12 6 6 6
-19 13 10 16 5 ^
-36 1 14 13 6 16 14 15 4 13 15 4 4 11 4 10 3 17 4 19 6 17 14 3 2 16 1 14 16 5 17
-8 1 1 19 13 12 12 ^
-34 0 17 11 13 5 19 11 18 19 1 3 12 11 8 4 11 13 17 3 8 9 4 5 12 15 12 6 7 16 16
-12 1 13 17 15 ^
-40 0 18 9 3 16 2 16 4 19 6 6 18 3 13 1 5 3 2 6 15 11 6 4 14 15 15 9 13 8 1 9 15
-2 7 5 11 5 12 7 16 15 ^
-37 0 18 4 3 1 4 11 15 7 6 9 1 14 7 1 17 17 16 14 13 14 12 14 9 12 11 18 7 14 3
-1 6 1 15 8 15 19 9 ^
-32 0 3 9 9 7 7 10 12 13 7 11 12 16 9 9 9 17 13 13 2 17 10 4 18 17 19 16 11 11
-13 18 13 12 ^
-35 0 8 15 18 10 6 10 18 17 9 2 14 1 17 18 6 14 12 5 5 15 17 10 3 8 8 1 10 5 1
-18 18 9 16 10 14 ^
-38 1 6 16 1 6 3 5 8 16 8 7 5 18 11 15 17 6 11 10 4 8 14 16 6 7 8 12 12 18 1 10
-4 7 1 19 7 19 15 12 ^
-34 0 1 14 6 11 18 5 4 12 6 14 2 19 2 5 13 10 10 2 16 10 18 16 19 2 15 10 7 18
-16 17 15 15 9 13 ^
-38 1 10 16 4 15 7 5 19 1 15 16 11 19 9 18 2 4 6 12 9 8 7 13 14 11 4 12 13 5 9 6
-5 6 16 11 9 3 15 6 ^
-40 0 16 1 13 6 8 18 11 11 2 1 2 2 14 9 13 1 15 6 5 16 19 14 19 7 18 5 2 2 3 13
-13 12 13 11 2 12 2 12 18 5 ^
-35 0 7 8 13 6 9 8 17 10 11 1 9 14 4 19 19 3 15 13 9 18 12 17 1 16 8 9 15 1 12 4
-4 19 18 13 11 ^
-36 1 14 18 8 14 9 3 4 18 16 9 19 12 3 17 5 10 16 5 8 4 4 10 14 13 4 9 11 19 8 8
-5 1 13 16 14 13 ^
-41 1 10 15 3 4 8 2 12 9 16 3 16 3 6 17 3 10 19 7 6 1 5 11 18 9 4 6 2 15 11 17
-17 17 4 10 13 3 7 10 3 9 14 ^
-42 0 7 9 3 3 8 19 10 8 2 19 12 19 13 6 19 3 4 17 6 9 1 7 2 9 7 18 6 15 2 2 4 3
-10 11 11 6 12 10 18 4 12 10 ^
-35 1 4 5 11 12 15 19 12 10 6 15 14 19 18 11 8 11 17 16 7 7 11 2 10 6 19 5 14 7
-1 7 3 19 4 17 15 ^
-36 1 5 10 2 18 1 17 8 12 17 2 9 8 8 3 14 10 15 2 14 8 3 1 16 18 12 18 11 16 7
-17 5 19 2 19 12 19 ^
-37 0 16 14 2 9 16 2 6 6 7 9 10 9 11 9 14 11 15 5 16 9 2 17 2 8 15 8 4 3 14 14
-16 16 13 11 10 16 14 ^
-40 0 11 7 14 14 14 6 10 10 1 6 13 19 5 6 4 7 12 12 10 5 10 15 15 8 5 13 17 13 5
-6 14 1 9 2 6 5 17 9 11 13 ^
-38 0 18 8 6 13 15 3 3 15 5 13 18 3 2 5 5 14 7 13 4 17 7 2 17 3 18 15 7 15 16 18
-5 12 8 6 3 17 12 13 ^
-38 1 19 15 9 7 17 16 15 3 11 11 5 2 13 19 16 2 4 16 7 8 1 2 9 17 12 3 5 18 19
-11 17 9 1 4 1 18 10 10 ^
-41 1 13 1 7 13 5 7 4 1 8 13 16 3 5 7 6 8 8 14 8 13 7 19 8 16 18 4 2 8 7 12 4 14
-5 1 3 19 17 11 14 15 19 ^
-39 0 10 9 12 19 11 10 3 18 14 17 18 17 7 12 14 8 11 7 2 10 17 15 5 3 12 3 12 1
-2 1 1 12 14 10 2 8 17 18 2 ^
-45 1 4 9 4 16 5 18 1 1 10 10 11 3 10 12 1 3 11 1 11 5 3 3 16 15 10 17 14 15 6
-13 12 2 3 14 3 9 19 4 4 8 10 14 5 11 9 ^
-35 0 2 7 15 14 8 2 11 19 19 4 5 10 8 9 5 15 9 17 19 5 7 14 4 11 3 6 18 13 7 18
-18 19 19 13 13 ^
-35 1 10 19 14 12 4 15 15 18 2 10 7 9 2 13 8 19 15 1 11 14 7 7 17 6 16 4 16 17 2
-18 12 5 14 19 9 ^
-38 1 1 8 12 6 6 6 19 13 10 16 13 14 13 6 16 14 15 4 13 15 4 4 11 4 10 3 17 4 19
-6 17 14 3 2 16 1 14 19 ^
-38 0 5 17 8 1 1 19 13 12 12 17 11 13 5 19 11 18 19 1 3 12 11 8 4 11 13 17 3 8 9
-4 5 12 15 12 6 7 16 11 ^
-43 0 12 1 13 17 4 18 9 3 16 2 16 4 19 6 6 18 3 13 1 5 3 2 6 15 11 6 4 14 15 15
-9 13 8 1 9 15 2 7 5 11 5 12 16 ^
-39 1 16 6 18 4 3 1 4 11 15 7 6 9 1 14 7 1 17 17 16 14 13 14 12 14 9 12 11 18 7
-14 3 1 6 1 15 8 15 19 12 ^
-35 0 3 9 9 7 7 10 12 13 7 11 12 16 9 9 9 17 13 13 2 17 10 4 18 17 19 16 11 11
-13 18 13 8 8 15 6 ^
-40 0 10 6 10 18 17 9 2 14 1 17 18 6 14 12 5 5 15 17 10 3 8 8 1 10 5 1 18 18 9
-16 10 19 6 16 1 6 3 5 8 16 ^
-40 0 8 7 5 18 11 15 17 6 11 10 4 8 14 16 6 7 8 12 12 18 1 10 4 7 1 19 7 19 15 2
-1 14 6 11 18 5 4 12 6 19 ^
-35 0 2 19 2 5 13 10 10 2 16 10 18 16 19 2 15 10 7 18 16 17 15 15 9 15 10 16 4
-15 7 5 19 1 15 16 6 ^
-43 1 19 9 18 2 4 6 12 9 8 7 13 14 11 4 12 13 5 9 6 5 6 16 11 9 3 15 12 16 1 13
-6 8 18 11 11 2 1 2 2 14 9 13 11 ^
-39 1 15 6 5 16 19 14 19 7 18 5 2 2 3 13 13 12 13 11 2 12 2 12 18 7 8 13 6 9 8
-17 10 11 1 9 14 4 19 19 3 ^
-34 1 15 13 9 18 12 17 1 16 8 9 15 1 12 4 4 19 18 13 15 14 18 8 14 9 3 4 18 16 9
-19 12 3 17 15 ^
-45 1 10 16 5 8 4 4 10 14 13 4 9 11 19 8 8 5 1 13 16 14 1 10 15 3 4 8 2 12 9 16
-3 16 3 6 17 3 10 19 7 6 1 5 11 18 2 ^
-43 1 15 4 13 14 3 4 1 3 1 5 11 4 9 7 20 8 15 4 16 7 19 11 1 11 2 13 13 11 12 13
-15 12 1 5 13 3 8 15 12 8 16 16 6 ^
-44 0 5 13 12 14 5 3 1 4 16 12 20 1 6 15 11 18 4 17 16 6 10 3 2 9 9 14 6 2 8 6 7
-10 17 12 20 6 7 5 16 1 4 2 17 9 ^
-38 0 15 8 20 18 20 11 15 11 11 9 6 2 15 5 17 12 1 9 1 3 5 11 7 2 2 6 18 2 9 11
-8 16 11 16 15 18 18 18 ^
-35 1 20 2 17 17 10 8 13 20 4 18 6 18 9 4 1 1 18 5 2 17 15 16 19 15 1 10 17 16 4
-16 14 14 11 15 10 ^
-38 0 5 9 15 10 9 17 18 14 15 12 6 1 16 8 18 8 13 12 10 14 14 13 9 2 14 17 9 1
-20 10 4 2 12 9 4 13 16 5 ^
-36 0 14 10 11 16 17 12 18 12 7 17 8 7 3 1 3 17 4 9 5 17 14 17 11 5 20 19 8 19
-14 13 2 18 3 3 18 13 ^
-41 1 13 8 14 6 18 7 10 1 13 10 11 11 16 1 2 8 7 1 7 14 8 17 6 8 4 3 11 17 3 5 7
-16 11 11 14 7 13 20 20 7 20 ^
-40 1 13 15 14 16 14 8 9 16 5 1 6 3 17 18 16 9 1 15 9 10 9 19 1 3 3 20 11 13 17
-1 19 8 3 4 3 7 1 14 19 17 ^
-37 1 18 13 11 5 18 4 19 10 6 19 11 17 10 10 7 9 13 16 9 10 18 4 12 5 16 5 20 12
-3 8 10 1 18 1 6 20 14 ^
-36 0 8 9 6 12 11 7 7 3 17 13 6 20 17 9 20 16 10 12 17 8 11 8 11 10 5 10 14 18 8
-19 9 12 12 2 20 12 ^
-38 0 12 16 20 3 9 9 19 17 13 13 4 17 2 11 7 14 3 6 16 13 10 13 5 16 10 2 8 2 17
-19 4 17 7 19 6 9 15 7 ^
-41 1 20 7 2 18 5 7 18 5 2 15 7 11 10 9 3 2 14 19 3 11 8 18 15 5 3 5 12 15 16 10
-17 7 19 16 2 1 16 6 3 19 10 ^
-46 0 5 18 9 9 11 2 1 12 11 14 12 14 10 4 11 6 8 16 7 5 11 20 8 17 4 14 4 15 3 2
-2 4 3 2 3 14 15 10 2 12 7 3 7 20 20 5 ^
-41 1 10 2 3 1 10 12 15 14 11 20 3 16 14 9 4 18 1 19 20 9 5 12 13 6 6 1 9 13 7
-15 9 8 5 19 3 16 9 8 10 20 8 ^
-39 1 11 13 19 5 7 16 18 16 4 4 4 6 9 13 10 19 15 3 14 6 4 12 10 15 15 4 8 13 13
-9 18 13 6 4 7 20 4 20 7 ^
-31 1 18 18 12 16 13 19 19 5 7 2 6 11 18 9 18 6 11 14 14 18 10 13 19 20 17 11 14
-5 19 20 13 ^
-46 1 20 1 1 4 13 10 6 5 6 19 18 1 3 9 14 20 7 18 7 15 2 3 15 5 1 1 2 6 13 1 19
-6 14 16 5 15 11 13 3 6 11 2 20 8 1 20 ^
-37 0 4 20 19 3 18 3 8 19 7 8 12 14 12 19 11 15 6 19 1 19 4 10 16 17 7 17 1 2 13
-18 12 2 18 19 2 7 15 ^
-42 1 9 18 8 5 14 2 5 4 4 20 14 13 7 8 14 8 1 7 19 9 7 11 12 4 19 12 10 19 20 4
-4 1 8 2 16 16 8 20 2 1 20 13 ^
-37 1 1 15 7 6 20 10 14 9 12 19 18 20 6 14 6 5 6 17 14 12 12 16 4 2 19 14 15 17
-7 12 11 12 8 14 1 17 7 ^
-39 0 15 18 2 4 10 18 11 17 5 9 17 4 19 5 5 8 6 2 20 15 6 5 18 11 3 10 20 10 16
-3 12 7 5 14 18 15 14 9 14 ^
-44 0 14 7 6 15 9 3 4 8 8 12 19 2 9 16 19 6 16 20 5 3 19 7 4 7 4 5 10 5 1 18 7
-17 6 3 3 13 16 2 3 20 16 12 6 16 ^
-38 0 17 19 2 2 11 19 13 4 15 8 1 12 9 20 2 5 2 10 20 5 15 13 7 13 15 19 17 11 9
-15 8 15 17 9 6 16 8 13 ^
-38 1 18 10 8 8 10 15 13 8 4 5 15 6 12 13 1 17 12 4 7 18 10 12 10 3 15 20 5 19 8
-17 20 13 14 10 9 12 17 5 ^
-46 1 10 18 6 6 15 4 13 14 3 4 1 3 1 5 11 4 9 7 20 8 15 4 16 7 19 11 1 11 2 13
-13 11 12 13 15 12 1 5 13 3 8 15 12 8 16 6 ^
-45 1 17 5 13 12 14 5 3 1 4 16 12 20 1 6 15 11 18 4 17 16 6 10 3 2 9 9 14 6 2 8
-6 7 10 17 12 20 6 7 5 16 1 4 2 17 16 ^
-40 0 15 8 20 18 20 11 15 11 11 9 6 2 15 5 17 12 1 9 1 3 5 11 7 2 2 6 18 2 9 11
-8 16 11 16 15 18 18 3 20 19 ^
-38 0 17 17 10 8 13 20 4 18 6 18 9 4 1 1 18 5 2 17 15 16 19 15 1 10 17 16 4 16
-14 14 11 15 2 5 9 15 10 15 ^
-38 0 17 18 14 15 12 6 1 16 8 18 8 13 12 10 14 14 13 9 2 14 17 9 1 20 10 4 2 12
-9 4 13 16 7 14 10 11 16 19 ^
-39 0 12 18 12 7 17 8 7 3 1 3 17 4 9 5 17 14 17 11 5 20 19 8 19 14 13 2 18 3 3
-18 17 13 8 14 6 18 7 10 12 ^
-41 0 13 10 11 11 16 1 2 8 7 1 7 14 8 17 6 8 4 3 11 17 3 5 7 16 11 11 14 7 13 20
-20 7 16 13 15 14 16 14 8 9 16 ^
-43 1 5 1 6 3 17 18 16 9 1 15 9 10 9 19 1 3 3 20 11 13 17 1 19 8 3 4 3 7 1 14 19
-19 18 13 11 5 18 4 19 10 6 19 4 ^
-41 1 17 10 10 7 9 13 16 9 10 18 4 12 5 16 5 20 12 3 8 10 1 18 1 6 20 12 8 9 6
-12 11 7 7 3 17 13 6 20 17 9 15 ^
-37 0 16 10 12 17 8 11 8 11 10 5 10 14 18 8 19 9 12 12 2 20 13 12 16 20 3 9 9 19
-17 13 13 4 17 2 11 7 16 ^
-43 0 3 6 16 13 10 13 5 16 10 2 8 2 17 19 4 17 7 19 6 9 15 15 20 7 2 18 5 7 18 5
-2 15 7 11 10 9 3 2 14 19 3 11 14 ^
-43 1 18 15 5 3 5 12 15 16 10 17 7 19 16 2 1 16 6 3 19 12 5 18 9 9 11 2 1 12 11
-14 12 14 10 4 11 6 8 16 7 5 11 20 2 ^
-45 0 17 4 14 4 15 3 2 2 4 3 2 3 14 15 10 2 12 7 3 7 20 20 19 10 2 3 1 10 12 15
-14 11 20 3 16 14 9 4 18 1 19 20 9 5 18 ^
-42 0 13 6 6 1 9 13 7 15 9 8 5 19 3 16 9 8 10 20 14 11 13 19 5 7 16 18 16 4 4 4
-6 9 13 10 19 15 3 14 6 4 12 18 ^
-36 1 15 15 4 8 13 13 9 18 13 6 4 7 20 4 20 18 18 12 16 13 19 19 5 7 2 6 11 18 9
-18 6 11 14 14 18 15 ^
-43 1 13 19 20 17 11 14 5 19 20 11 20 1 1 4 13 10 6 5 6 19 18 1 3 9 14 20 7 18 7
-15 2 3 15 5 1 1 2 6 13 1 19 6 19 ^
-40 1 16 5 15 11 13 3 6 11 2 20 8 1 5 4 20 19 3 18 3 8 19 7 8 12 14 12 19 11 15
-6 19 1 19 4 10 16 17 7 17 16 ^
-39 1 12 19 20 1 13 12 10 8 21 15 7 19 13 6 8 19 20 18 2 12 14 3 10 6 2 6 2 17
-16 2 5 21 5 17 19 7 8 11 15 ^
-33 0 12 17 14 18 15 16 16 16 12 20 13 2 5 5 2 10 20 16 12 10 2 17 21 20 15 14
-14 18 21 13 9 17 10 ^
-40 1 2 12 16 17 3 9 19 5 7 10 5 11 17 18 14 14 12 2 20 15 8 17 3 20 11 12 18 7
-12 7 9 8 3 18 14 3 5 17 9 14 ^
-43 0 8 21 11 8 8 16 21 12 5 8 7 20 10 14 7 1 9 5 4 5 2 21 12 1 1 9 20 14 11 9
-19 16 3 1 14 10 2 8 20 18 7 8 18 ^
-40 1 2 19 6 11 18 11 15 6 5 16 14 9 7 21 3 15 21 16 8 7 3 6 14 17 17 5 10 20 10
-15 10 1 15 18 6 10 9 7 16 6 ^
-39 0 11 15 12 2 9 1 1 6 6 13 8 20 6 18 8 5 8 1 1 17 20 20 19 17 13 14 17 12 5 3
-18 20 20 11 18 15 13 16 7 ^
-48 1 7 10 1 19 10 7 17 7 16 3 8 4 4 15 17 13 9 11 2 2 11 7 13 4 17 7 1 5 13 19
-16 5 14 16 2 11 18 5 11 6 4 7 3 17 2 1 18 12 ^
-41 1 21 18 3 5 16 6 11 2 8 8 7 14 13 21 6 14 12 6 12 19 14 3 16 3 2 7 11 14 8
-16 10 19 12 19 4 5 6 13 19 12 13 ^
-44 1 7 5 12 4 13 21 2 5 17 15 15 1 13 5 21 6 4 12 14 15 5 18 12 1 19 2 14 1 8 8
-11 6 20 10 3 21 8 20 2 4 1 16 11 21 ^
-42 1 5 3 8 16 15 8 12 14 20 16 18 7 2 18 2 18 19 7 4 19 3 1 20 7 15 1 4 5 12 10
-19 6 11 4 4 9 20 20 8 2 20 18 ^
-42 1 19 2 8 4 15 7 2 2 6 18 20 16 1 18 17 13 3 14 2 1 2 10 14 19 12 9 15 20 1 7
-15 17 7 12 18 1 15 14 8 21 21 5 ^
-43 1 7 20 10 11 10 1 9 21 7 5 1 12 15 2 9 17 4 13 5 4 11 21 14 13 3 20 21 1 3
-12 18 11 4 14 20 5 3 14 13 15 9 21 3 ^
-40 1 19 8 1 5 9 5 9 16 17 9 6 12 6 16 7 4 3 1 21 16 19 15 18 17 17 17 21 13 20
-9 6 6 9 1 13 17 21 1 9 14 ^
-36 0 11 12 13 18 19 19 15 12 20 2 16 12 9 21 17 16 8 2 14 6 4 1 6 16 15 19 19
-21 9 13 18 3 16 8 13 11 ^
-47 0 21 15 4 21 4 2 3 8 15 19 8 6 16 2 15 3 12 3 11 3 17 12 21 6 3 4 13 1 12 4
-10 2 6 7 6 9 12 21 10 10 11 2 13 19 2 14 17 ^
-44 1 11 8 10 19 1 11 11 9 3 13 15 4 3 18 9 14 5 15 18 5 6 17 11 19 2 4 12 8 18
-12 17 3 4 8 5 19 16 16 6 1 13 1 18 18 ^
-39 1 10 18 15 11 5 1 17 4 17 19 11 18 21 9 2 10 10 5 5 20 18 13 5 15 3 6 3 10
-10 16 13 13 14 16 20 19 11 16 8 ^
-42 1 6 8 15 13 11 13 15 18 11 20 17 20 4 16 10 14 1 4 16 4 17 8 3 7 7 18 16 20
-2 9 9 4 20 7 16 4 11 4 10 6 20 4 ^
-41 0 17 6 19 17 2 15 6 5 7 4 8 11 16 9 10 15 20 12 15 8 6 17 5 9 3 3 4 19 20 12
-5 19 21 5 21 11 14 19 1 17 6 ^
-39 0 9 4 19 3 17 1 14 21 14 7 6 5 20 14 21 20 4 6 21 7 11 20 12 9 11 6 16 18 18
-10 11 20 6 12 11 5 7 21 3 ^
-43 1 18 6 15 21 10 4 14 9 19 10 3 3 5 13 1 8 12 3 13 9 7 10 17 10 6 8 3 17 18 3
-21 19 6 17 15 4 9 15 9 15 14 4 18 ^
-45 1 14 8 10 13 4 11 10 7 6 21 1 14 5 11 7 7 2 13 13 3 9 13 8 14 9 3 7 18 4 9 9
-5 15 13 17 10 15 16 20 8 19 9 10 9 13 ^
-40 1 19 14 21 2 18 13 10 4 18 16 4 21 15 10 18 19 3 12 12 14 4 13 11 1 11 1 10
-2 12 4 21 10 21 18 9 2 16 7 20 7 ^
-41 0 7 12 19 20 1 13 12 10 8 21 15 7 19 13 6 8 19 20 18 2 12 14 3 10 6 2 6 2 17
-16 2 5 21 5 17 19 7 8 11 10 21 ^
-35 0 17 14 18 15 16 16 16 12 20 13 2 5 5 2 10 20 16 12 10 2 17 21 20 15 14 14
-18 21 13 9 17 21 2 12 10 ^
-40 0 17 3 9 19 5 7 10 5 11 17 18 14 14 12 2 20 15 8 17 3 20 11 12 18 7 12 7 9 8
-3 18 14 3 5 17 9 18 8 21 20 ^
-46 1 8 8 16 21 12 5 8 7 20 10 14 7 1 9 5 4 5 2 21 12 1 1 9 20 14 11 9 19 16 3 1
-14 10 2 8 20 18 7 8 15 2 19 6 11 18 10 ^
-44 1 15 6 5 16 14 9 7 21 3 15 21 16 8 7 3 6 14 17 17 5 10 20 10 15 10 1 15 18 6
-10 9 7 16 14 11 15 12 2 9 1 1 6 6 19 ^
-38 1 8 20 6 18 8 5 8 1 1 17 20 20 19 17 13 14 17 12 5 3 18 20 20 11 18 15 13 16
-13 7 10 1 19 10 7 17 7 15 ^
-50 0 3 8 4 4 15 17 13 9 11 2 2 11 7 13 4 17 7 1 5 13 19 16 5 14 16 2 11 18 5 11
-6 4 7 3 17 2 1 18 13 21 18 3 5 16 6 11 2 8 8 18 ^
-42 1 14 13 21 6 14 12 6 12 19 14 3 16 3 2 7 11 14 8 16 10 19 12 19 4 5 6 13 19
-12 13 7 5 12 4 13 21 2 5 17 15 15 12 ^
-45 1 13 5 21 6 4 12 14 15 5 18 12 1 19 2 14 1 8 8 11 6 20 10 3 21 8 20 2 4 1 16
-11 1 5 3 8 16 15 8 12 14 20 16 18 7 18 ^
-46 0 18 2 18 19 7 4 19 3 1 20 7 15 1 4 5 12 10 19 6 11 4 4 9 20 20 8 2 20 3 19
-2 8 4 15 7 2 2 6 18 20 16 1 18 17 13 14 ^
-43 1 14 2 1 2 10 14 19 12 9 15 20 1 7 15 17 7 12 18 1 15 14 8 21 21 19 7 20 10
-11 10 1 9 21 7 5 1 12 15 2 9 17 4 19 ^
-45 1 5 4 11 21 14 13 3 20 21 1 3 12 18 11 4 14 20 5 3 14 13 15 9 21 11 19 8 1 5
-9 5 9 16 17 9 6 12 6 16 7 4 3 1 21 15 ^
-35 0 19 15 18 17 17 17 21 13 20 9 6 6 9 1 13 17 21 1 9 16 11 12 13 18 19 19 15
-12 20 2 16 12 9 21 12 ^
-44 1 16 8 2 14 6 4 1 6 16 15 19 19 21 9 13 18 3 16 8 13 21 15 4 21 4 2 3 8 15
-19 8 6 16 2 15 3 12 3 11 3 17 12 21 9 ^
-48 0 3 4 13 1 12 4 10 2 6 7 6 9 12 21 10 10 11 2 13 19 2 14 17 11 8 10 19 1 11
-11 9 3 13 15 4 3 18 9 14 5 15 18 5 6 17 11 19 15 ^
-44 0 4 12 8 18 12 17 3 4 8 5 19 16 16 6 1 13 1 18 1 10 18 15 11 5 1 17 4 17 19
-11 18 21 9 2 10 10 5 5 20 18 13 5 15 18 ^
-39 1 6 3 10 10 16 13 13 14 16 20 19 11 16 21 6 8 15 13 11 13 15 18 11 20 17 20
-4 16 10 14 1 4 16 4 17 8 3 7 21 ^
-46 1 18 16 20 2 9 9 4 20 7 16 4 11 4 10 6 20 14 17 6 19 17 2 15 6 5 7 4 8 11 16
-9 10 15 20 12 15 8 6 17 5 9 3 3 4 19 3 ^
-40 0 12 5 19 21 5 21 11 14 19 1 17 8 9 4 19 3 17 1 14 21 14 7 6 5 20 14 21 20 4
-6 21 7 11 20 12 9 11 6 16 11 ^
-44 0 18 10 11 20 6 12 11 5 7 21 19 18 6 15 21 10 4 14 9 19 10 3 3 5 13 1 8 12 3
-13 9 7 10 17 10 6 8 3 17 18 3 21 19 8 ^
-47 0 4 12 22 5 11 20 16 15 4 17 22 1 8 16 11 6 13 18 3 14 8 13 2 19 16 1 19 1 5
-3 16 9 8 20 7 5 1 11 15 2 3 17 3 12 7 4 19 ^
-42 0 18 16 13 7 1 19 5 12 18 12 6 15 19 4 4 9 13 13 8 17 13 18 12 2 8 4 7 17 17
-14 11 13 1 16 11 2 21 3 22 17 16 11 ^
-39 0 18 22 12 20 17 13 1 7 10 7 20 11 1 7 8 14 14 12 15 13 15 18 15 11 18 1 17
-14 15 20 16 20 8 2 17 10 4 21 2 ^
-44 1 19 19 14 22 21 18 13 14 1 3 12 11 11 4 22 13 5 18 7 21 9 22 19 12 8 16 5
-17 5 9 1 2 9 6 12 6 1 7 4 3 15 1 14 16 ^
-42 1 12 3 10 2 10 14 21 13 17 6 6 17 1 21 2 14 16 17 9 11 20 21 11 12 12 8 20
-13 2 9 20 9 14 10 1 16 2 22 6 4 16 18 ^
-51 0 15 1 12 4 14 9 21 3 3 9 8 21 15 14 8 4 14 4 2 3 8 12 8 6 1 2 18 20 15 3 19
-3 10 20 14 6 3 4 21 1 12 4 18 2 6 7 6 9 20 14 13 ^
-40 1 10 19 17 21 12 15 17 7 10 11 8 10 12 1 19 19 9 18 21 4 18 11 9 22 5 15 8
-15 3 5 6 2 19 12 17 4 20 8 11 20 ^
-45 0 2 18 4 16 20 12 9 9 6 16 21 16 3 16 18 3 19 5 16 2 4 2 12 11 15 11 14 17 2
-10 18 5 5 13 3 21 5 3 6 18 18 10 1 21 15 ^
-45 1 7 1 13 12 19 1 14 6 8 21 19 21 11 19 13 2 13 4 1 10 22 16 4 9 4 10 16 3 7
-15 11 9 13 17 15 9 9 15 4 13 15 9 4 19 9 ^
-46 0 18 6 13 22 10 6 12 2 17 15 6 5 7 4 8 11 1 9 10 8 5 20 16 6 10 5 17 3 3 19
-12 13 20 5 12 14 5 14 11 22 12 16 10 8 9 16 ^
-39 0 15 12 3 2 16 22 14 22 7 6 5 13 22 14 13 4 6 14 7 11 13 20 9 19 6 9 11 11
-18 19 13 6 20 19 20 7 22 12 12 ^
-41 0 6 14 18 19 7 17 12 10 3 18 15 5 21 16 8 20 3 21 9 15 18 10 15 10 6 8 18 2
-11 3 14 4 6 10 19 9 8 17 8 22 20 ^
-36 1 7 22 16 18 21 4 11 10 15 6 22 16 22 5 19 15 7 7 2 21 21 3 17 21 16 22 9 3
-7 11 4 17 17 20 21 21 ^
-37 1 18 9 5 8 12 17 18 17 16 12 22 14 17 11 21 10 4 3 1 4 14 10 11 4 3 20 20 22
-19 21 19 16 19 16 10 17 17 ^
-40 1 19 14 18 14 3 9 17 1 7 13 6 7 15 20 12 13 16 21 20 10 8 22 7 12 21 6 16 4
-13 11 2 12 15 22 3 18 6 17 6 22 ^
-42 0 10 9 2 5 22 5 10 4 7 8 19 10 20 10 22 11 8 1 9 1 20 13 21 17 5 5 17 10 13
-9 20 18 17 2 14 13 22 22 3 14 21 10 ^
-46 0 2 14 2 20 1 10 18 9 12 5 7 18 20 19 10 11 22 7 12 2 13 8 8 2 3 13 19 20 3
-7 20 7 9 8 3 11 22 3 5 10 9 11 16 14 19 16 ^
-46 1 15 8 1 14 20 5 8 7 13 10 22 7 16 9 5 4 5 2 14 20 1 1 15 17 13 22 19 17 4 1
-3 1 22 10 15 15 2 16 13 11 7 16 17 12 6 20 ^
-40 1 3 19 8 6 5 9 15 22 17 7 14 18 14 9 16 7 18 14 22 2 2 5 18 13 18 8 18 16 8
-11 15 6 18 9 7 9 22 19 20 15 ^
-44 0 9 16 16 6 6 21 8 13 6 11 8 5 16 16 1 10 13 13 4 10 21 22 15 10 20 5 3 3 13
-15 13 11 11 15 21 1 21 7 10 1 12 18 7 20 ^
-51 0 7 1 18 8 4 19 2 21 17 19 2 2 19 7 21 19 2 7 15 15 16 5 21 12 1 5 22 1 17
-19 11 5 11 6 4 7 3 10 2 1 3 6 14 11 18 5 1 6 11 17 8 ^
-39 1 8 15 22 21 14 6 22 20 6 20 12 22 18 1 3 2 7 19 22 8 9 18 4 20 12 4 5 6 21
-12 20 21 7 5 20 4 21 14 14 ^
-45 0 15 5 2 16 15 21 5 14 15 6 4 12 22 5 11 20 16 15 4 17 22 1 8 16 11 6 13 18
-3 14 8 13 2 19 16 1 19 1 5 3 16 9 8 20 14 ^
-48 1 5 1 11 15 2 3 17 3 12 7 4 12 18 16 13 7 1 19 5 12 18 12 6 15 19 4 4 9 13
-13 8 17 13 18 12 2 8 4 7 17 17 14 11 13 1 16 11 22 ^
-38 0 21 3 22 17 16 17 18 22 12 20 17 13 1 7 10 7 20 11 1 7 8 14 14 12 15 13 15
-18 15 11 18 1 17 14 15 20 16 10 ^
-43 0 8 2 17 10 4 21 5 19 19 14 22 21 18 13 14 1 3 12 11 11 4 22 13 5 18 7 21 9
-22 19 12 8 16 5 17 5 9 1 2 9 6 12 22 ^
-47 1 1 7 4 3 15 1 14 1 12 3 10 2 10 14 21 13 17 6 6 17 1 21 2 14 16 17 9 11 20
-21 11 12 12 8 20 13 2 9 20 9 14 10 1 16 2 22 20 ^
-53 0 4 16 14 15 1 12 4 14 9 21 3 3 9 8 21 15 14 8 4 14 4 2 3 8 12 8 6 1 2 18 20
-15 3 19 3 10 20 14 6 3 4 21 1 12 4 18 2 6 7 6 9 20 15 ^
-42 1 10 10 19 17 21 12 15 17 7 10 11 8 10 12 1 19 19 9 18 21 4 18 11 9 22 5 15
-8 15 3 5 6 2 19 12 17 4 20 8 11 20 12 ^
-45 0 18 4 16 20 12 9 9 6 16 21 16 3 16 18 3 19 5 16 2 4 2 12 11 15 11 14 17 2
-10 18 5 5 13 3 21 5 3 6 18 18 10 1 21 21 18 ^
-45 0 1 13 12 19 1 14 6 8 21 19 21 11 19 13 2 13 4 1 10 22 16 4 9 4 10 16 3 7 15
-11 9 13 17 15 9 9 15 4 13 15 9 4 19 19 19 ^
-49 0 6 13 22 10 6 12 2 17 15 6 5 7 4 8 11 1 9 10 8 5 20 16 6 10 5 17 3 3 19 12
-13 20 5 12 14 5 14 11 22 12 16 10 8 9 4 15 12 3 22 ^
-39 0 16 22 14 22 7 6 5 13 22 14 13 4 6 14 7 11 13 20 9 19 6 9 11 11 18 19 13 6
-20 19 20 7 22 12 11 6 14 18 17 ^
-43 1 7 17 12 10 3 18 15 5 21 16 8 20 3 21 9 15 18 10 15 10 6 8 18 2 11 3 14 4 6
-10 19 9 8 17 8 22 4 7 22 16 18 21 11 ^
-39 0 11 10 15 6 22 16 22 5 19 15 7 7 2 21 21 3 17 21 16 22 9 3 7 11 4 17 17 20
-21 10 18 9 5 8 12 17 18 17 17 ^
-40 1 12 22 14 17 11 21 10 4 3 1 4 14 10 11 4 3 20 20 22 19 21 19 16 19 16 10 17
-20 19 14 18 14 3 9 17 1 7 13 6 18 ^
-44 1 15 20 12 13 16 21 20 10 8 22 7 12 21 6 16 4 13 11 2 12 15 22 3 18 6 17 6 2
-10 9 2 5 22 5 10 4 7 8 19 10 20 10 22 7 ^
-43 0 8 1 9 1 20 13 21 17 5 5 17 10 13 9 20 18 17 2 14 13 22 22 3 14 21 9 2 14 2
-20 1 10 18 9 12 5 7 18 20 19 10 11 19 ^
-53 1 7 12 2 13 8 8 2 3 13 19 20 3 7 20 7 9 8 3 11 22 3 5 10 9 11 16 14 19 8 15
-8 1 14 20 5 8 7 13 10 22 7 16 9 5 4 5 2 14 20 1 1 15 8 ^
-42 0 13 22 19 17 4 1 3 1 22 10 15 15 2 16 13 11 7 16 17 12 6 19 3 19 8 6 5 9 15
-22 17 7 14 18 14 9 16 7 18 14 22 19 ^
-43 0 2 5 18 13 18 8 18 16 8 11 15 6 18 9 7 9 22 19 20 17 9 16 16 6 6 21 8 13 6
-11 8 5 16 16 1 10 13 13 4 10 21 22 14 ^
-48 0 10 20 5 3 3 13 15 13 11 11 15 21 1 21 7 10 1 12 18 7 2 7 1 18 8 4 19 2 21
-17 19 2 2 19 7 21 19 2 7 15 15 16 5 21 12 1 5 21 ^
-49 1 1 17 19 11 5 11 6 4 7 3 10 2 1 3 6 14 11 18 5 1 6 11 17 8 8 15 22 21 14 6
-22 20 6 20 12 22 18 1 3 2 7 19 22 8 9 18 4 20 10 ^
-45 1 4 5 6 21 12 20 21 7 5 20 4 21 14 2 15 5 2 16 15 21 5 14 15 6 4 12 22 5 11
-20 16 15 4 17 22 1 8 16 11 6 13 18 3 14 13 ^
-52 0 13 2 19 16 1 19 1 5 3 16 9 8 20 7 5 1 11 15 2 3 17 3 12 7 4 12 18 16 13 7
-1 19 5 12 18 12 6 15 19 4 4 9 13 13 8 17 13 18 12 2 8 15 ^
-46 0 20 1 1 11 21 2 3 16 8 12 21 22 1 16 1 10 22 17 4 14 7 2 16 9 18 23 9 4 8
-16 7 9 18 11 11 17 20 2 7 10 20 8 10 16 14 14 ^
-41 1 20 4 16 4 18 1 14 12 19 13 15 19 19 11 22 13 10 2 11 16 10 17 8 8 6 22 2
-15 10 9 13 18 14 22 8 6 18 16 15 14 20 ^
-43 1 14 3 12 14 17 11 3 9 19 10 20 16 11 3 17 7 21 23 12 23 11 13 2 14 14 16 13
-12 11 5 14 3 8 4 13 8 17 17 18 17 2 12 22 ^
-43 1 17 3 11 12 16 5 1 22 6 16 11 20 3 18 17 6 22 14 13 21 21 3 18 13 20 11 18
-19 11 6 1 10 18 7 17 5 16 1 7 10 4 20 22 ^
-46 0 8 10 12 4 11 21 6 13 16 17 6 23 1 9 14 4 11 23 23 19 1 13 6 20 1 9 12 8 5
-23 17 16 8 8 3 10 13 7 6 10 8 14 9 15 20 20 ^
-46 0 20 21 15 12 19 17 1 6 4 5 8 4 12 10 6 5 4 17 3 3 16 13 5 21 16 10 21 18 19
-15 16 12 6 12 17 8 7 8 11 14 1 23 10 15 15 13 ^
-43 0 21 13 15 18 21 10 10 23 3 13 13 9 16 2 17 19 3 22 11 5 18 19 13 7 7 8 19 2
-12 2 19 16 23 9 16 6 3 19 12 5 10 9 17 ^
-47 0 21 3 2 1 7 14 14 7 6 2 20 3 6 19 19 10 2 22 12 17 12 1 20 7 7 15 20 6 18 8
-3 14 23 18 15 4 7 5 23 15 7 14 10 10 19 17 11 ^
-44 0 4 15 17 11 15 11 8 9 17 5 12 18 14 6 20 17 21 12 16 9 22 9 20 15 2 22 11 2
-6 11 9 8 2 4 14 19 3 21 21 23 8 2 11 15 ^
-37 0 8 4 20 22 6 21 18 22 10 19 9 14 17 23 21 10 7 15 13 16 5 4 10 13 14 20 23
-12 20 23 18 10 12 8 21 11 19 ^
-39 0 12 7 19 14 18 14 18 22 6 9 22 5 23 13 6 8 23 20 22 5 22 15 19 20 9 9 1 13
-13 10 14 13 5 22 14 21 9 21 3 ^
-45 1 14 14 4 18 13 12 23 7 3 15 5 17 14 23 14 5 17 22 11 1 8 13 23 6 21 3 6 11
-7 23 8 6 21 4 4 22 19 13 8 5 19 7 5 23 3 ^
-50 1 4 19 11 23 11 21 14 1 3 20 2 20 7 4 17 2 5 13 4 23 5 22 7 7 9 17 13 5 6 2
-21 1 17 7 9 21 23 1 1 12 3 1 15 22 4 12 6 20 5 23 ^
-46 1 23 4 12 22 8 18 16 3 16 4 2 13 1 15 15 1 23 2 3 4 10 1 12 7 11 2 7 22 22
-21 22 13 3 12 22 12 4 3 23 10 14 17 15 9 23 20 ^
-44 0 19 12 21 22 9 17 12 2 18 18 12 21 2 19 4 21 20 4 9 14 5 21 8 22 10 15 23
-14 8 5 11 19 5 7 5 3 11 4 15 18 9 2 23 4 ^
-46 0 9 16 14 15 6 15 1 11 4 16 16 20 14 2 9 19 14 6 3 7 10 16 22 23 7 7 12 5 2
-8 9 5 7 1 17 19 21 19 18 15 3 20 22 14 9 16 ^
-44 1 10 18 11 3 5 9 10 11 22 12 12 15 23 2 10 18 23 5 18 21 20 23 3 9 3 22 7 8
-7 4 1 14 16 16 13 18 2 21 18 15 5 5 16 21 ^
-46 0 2 2 6 23 13 22 20 12 17 4 10 21 2 20 2 8 8 7 20 13 3 20 23 16 6 23 9 12 20
-3 10 5 6 19 18 12 13 14 8 1 1 8 9 13 19 23 ^
-47 0 9 20 20 5 15 13 17 3 15 22 3 1 19 8 15 8 19 9 21 7 12 1 16 21 11 8 10 15
-16 8 1 5 5 20 22 13 11 22 4 4 7 6 22 10 3 21 4 ^
-45 1 9 19 22 18 3 23 6 4 6 19 15 13 17 4 13 9 15 4 6 7 13 11 1 20 15 12 18 18
-16 7 13 4 11 7 11 6 17 9 18 15 21 17 5 20 11 ^
-49 0 1 22 16 18 5 8 11 2 23 10 11 5 2 1 19 16 3 19 16 15 21 5 3 7 18 4 9 15 3 8
-20 1 21 1 21 17 9 6 17 10 16 2 9 7 16 19 15 17 9 ^
-51 0 17 20 19 6 6 14 2 2 5 1 2 10 17 1 18 6 18 20 1 1 11 21 2 3 16 8 12 21 22 1
-16 1 10 22 17 4 14 7 2 16 9 18 23 9 4 8 16 7 9 18 17 ^
-45 1 11 17 20 2 7 10 20 8 10 16 14 11 20 4 16 4 18 1 14 12 19 13 15 19 19 11 22
-13 10 2 11 16 10 17 8 8 6 22 2 15 10 9 13 18 8 ^
-44 0 22 8 6 18 16 15 14 15 14 3 12 14 17 11 3 9 19 10 20 16 11 3 17 7 21 23 12
-23 11 13 2 14 14 16 13 12 11 5 14 3 8 4 13 20 ^
-43 0 17 17 18 17 2 12 3 17 3 11 12 16 5 1 22 6 16 11 20 3 18 17 6 22 14 13 21
-21 3 18 13 20 11 18 19 11 6 1 10 18 7 17 20 ^
-50 1 16 1 7 10 4 20 10 8 10 12 4 11 21 6 13 16 17 6 23 1 9 14 4 11 23 23 19 1
-13 6 20 1 9 12 8 5 23 17 16 8 8 3 10 13 7 6 10 8 14 17 ^
-46 1 15 20 18 20 21 15 12 19 17 1 6 4 5 8 4 12 10 6 5 4 17 3 3 16 13 5 21 16 10
-21 18 19 15 16 12 6 12 17 8 7 8 11 14 1 23 21 ^
-45 0 15 15 2 21 13 15 18 21 10 10 23 3 13 13 9 16 2 17 19 3 22 11 5 18 19 13 7
-7 8 19 2 12 2 19 16 23 9 16 6 3 19 12 5 10 15 ^
-48 1 20 21 3 2 1 7 14 14 7 6 2 20 3 6 19 19 10 2 22 12 17 12 1 20 7 7 15 20 6
-18 8 3 14 23 18 15 4 7 5 23 15 7 14 10 10 19 17 12 ^
-47 0 4 15 17 11 15 11 8 9 17 5 12 18 14 6 20 17 21 12 16 9 22 9 20 15 2 22 11 2
-6 11 9 8 2 4 14 19 3 21 21 23 8 2 11 4 8 4 20 ^
-39 0 22 6 21 18 22 10 19 9 14 17 23 21 10 7 15 13 16 5 4 10 13 14 20 23 12 20
-23 18 10 12 8 21 11 6 12 7 19 14 14 ^
-40 0 14 18 22 6 9 22 5 23 13 6 8 23 20 22 5 22 15 19 20 9 9 1 13 13 10 14 13 5
-22 14 21 9 21 19 14 14 4 18 13 12 ^
-46 0 23 7 3 15 5 17 14 23 14 5 17 22 11 1 8 13 23 6 21 3 6 11 7 23 8 6 21 4 4
-22 19 13 8 5 19 7 5 23 1 4 19 11 23 11 21 9 ^
-52 0 1 3 20 2 20 7 4 17 2 5 13 4 23 5 22 7 7 9 17 13 5 6 2 21 1 17 7 9 21 23 1
-1 12 3 1 15 22 4 12 6 20 5 19 23 4 12 22 8 18 16 3 22 ^
-48 0 4 2 13 1 15 15 1 23 2 3 4 10 1 12 7 11 2 7 22 22 21 22 13 3 12 22 12 4 3
-23 10 14 17 15 9 23 4 19 12 21 22 9 17 12 2 18 18 9 ^
-46 0 21 2 19 4 21 20 4 9 14 5 21 8 22 10 15 23 14 8 5 11 19 5 7 5 3 11 4 15 18
-9 2 23 22 9 16 14 15 6 15 1 11 4 16 16 20 22 ^
-47 0 2 9 19 14 6 3 7 10 16 22 23 7 7 12 5 2 8 9 5 7 1 17 19 21 19 18 15 3 20 22
-14 9 11 10 18 11 3 5 9 10 11 22 12 12 15 23 22 ^
-45 0 10 18 23 5 18 21 20 23 3 9 3 22 7 8 7 4 1 14 16 16 13 18 2 21 18 15 5 5 16
-12 2 2 6 23 13 22 20 12 17 4 10 21 2 20 19 ^
-47 0 8 8 7 20 13 3 20 23 16 6 23 9 12 20 3 10 5 6 19 18 12 13 14 8 1 1 8 9 13
-19 12 9 20 20 5 15 13 17 3 15 22 3 1 19 8 15 23 ^
-48 0 19 9 21 7 12 1 16 21 11 8 10 15 16 8 1 5 5 20 22 13 11 22 4 4 7 6 22 10 3
-21 1 9 19 22 18 3 23 6 4 6 19 15 13 17 4 13 9 17 ^
-49 1 4 6 7 13 11 1 20 15 12 18 18 16 7 13 4 11 7 11 6 17 9 18 15 21 17 5 20 6 1
-22 16 18 5 8 11 2 23 10 11 5 2 1 19 16 3 19 16 15 18 ^
-55 1 5 3 7 18 4 9 15 3 8 20 1 21 1 21 17 9 6 17 10 16 2 9 7 16 19 15 17 10 17
-20 19 6 6 14 2 2 5 1 2 10 17 1 18 6 18 20 1 1 11 21 2 3 16 8 17 ^
-47 0 21 22 1 16 1 10 22 17 4 14 7 2 16 9 18 23 9 4 8 16 7 9 18 11 11 17 20 2 7
-10 20 8 10 16 14 11 20 4 16 4 18 1 14 12 19 13 19 ^
-45 1 19 19 11 22 13 10 2 11 16 10 17 8 8 6 22 2 15 10 9 13 18 14 22 8 6 18 16
-15 14 15 14 3 12 14 17 11 3 9 19 10 20 16 11 3 21 ^
-47 1 7 21 23 12 23 11 13 2 14 14 16 13 12 11 5 14 3 8 4 13 8 17 17 18 17 2 12 3
-17 3 11 12 16 5 1 22 6 16 11 20 3 18 17 6 22 14 20 ^
-47 1 21 21 3 18 13 20 11 18 19 11 6 1 10 18 7 17 5 16 1 7 10 4 20 10 8 10 12 4
-11 21 6 13 16 17 6 23 1 9 14 4 11 23 23 19 1 13 22 ^
-51 0 20 1 9 12 8 5 23 17 16 8 8 3 10 13 7 6 10 8 14 9 15 20 18 20 21 15 12 19
-17 1 6 4 5 8 4 12 10 6 5 4 17 3 3 16 13 5 21 16 10 21 21 ^
-52 0 15 13 4 8 12 22 9 6 3 1 13 16 12 23 10 14 2 1 6 11 8 19 24 16 2 5 21 2 7
-22 4 5 23 3 12 20 8 4 5 17 9 18 18 18 4 10 13 2 4 7 24 21 ^
-51 1 10 21 4 8 24 2 6 19 10 6 22 22 14 22 13 21 5 22 2 4 18 5 11 21 1 7 8 4 17
-5 14 1 2 10 9 12 5 11 10 20 4 14 3 1 3 21 12 11 17 22 21 ^
-43 1 7 5 21 14 15 19 20 12 6 12 18 19 4 7 12 10 5 22 3 15 21 7 23 7 2 22 4 18
-18 3 24 10 17 24 23 18 6 11 18 22 8 6 20 ^
-45 0 2 12 10 14 12 9 2 23 16 20 14 17 9 16 7 21 6 22 24 19 11 9 19 21 15 11 19
-2 2 7 8 10 8 9 8 15 9 14 6 16 8 21 21 22 13 ^
-50 1 17 9 4 24 21 15 15 16 16 13 9 10 16 14 12 7 12 15 15 5 10 10 23 5 13 22 3
-5 1 4 11 14 7 6 10 17 14 6 3 13 18 16 3 5 15 23 8 5 3 22 ^
-47 0 8 12 20 20 9 2 13 24 17 2 2 17 3 13 20 2 6 3 15 7 13 1 18 7 22 18 24 20 14
-7 17 16 20 3 11 6 5 2 18 14 16 22 14 11 7 18 22 ^
-48 1 17 24 12 12 3 13 19 16 22 4 16 4 6 23 8 18 11 2 3 20 22 9 21 8 23 1 23 20
-7 16 13 23 4 13 3 7 4 23 6 13 19 2 3 7 2 9 9 19 ^
-45 1 6 13 4 22 6 19 20 1 9 7 14 1 15 3 23 24 22 18 12 12 17 19 10 8 11 22 12 10
-2 20 15 18 17 18 7 11 12 21 6 12 4 7 18 17 18 ^
-44 0 2 14 24 14 1 23 1 11 15 10 6 18 20 7 1 8 1 16 6 20 23 23 21 10 10 12 24 10
-11 23 2 12 23 9 3 24 24 19 14 10 18 15 14 12 ^
-50 1 16 11 22 2 15 24 8 22 1 4 24 9 10 15 3 9 5 4 17 15 9 12 19 19 1 3 10 6 8 3
-17 8 18 24 19 3 4 15 4 9 2 24 5 20 13 7 20 17 19 11 ^
-43 0 13 8 10 19 15 11 1 14 17 20 22 10 7 11 16 9 21 22 17 23 12 15 4 24 7 21 18
-2 21 16 1 19 18 20 11 3 15 19 18 1 6 14 15 ^
-45 0 5 5 19 13 10 24 19 16 24 15 13 2 19 15 24 21 17 4 13 17 1 1 9 1 10 2 18 1
-21 19 5 18 12 2 22 16 23 15 19 6 18 9 1 23 20 ^
-49 0 21 13 14 11 18 12 13 3 19 9 20 22 20 2 11 12 6 1 12 16 18 2 9 8 4 3 11 17
-11 5 4 19 16 11 23 13 18 1 20 8 2 16 16 21 4 19 5 5 24 ^
-46 0 24 13 23 6 24 5 17 12 5 1 15 17 17 21 11 13 9 23 11 14 21 7 6 9 6 14 7 16
-2 17 1 24 23 4 12 14 4 2 11 23 12 4 23 21 21 4 ^
-49 1 15 13 15 14 15 8 14 9 17 7 15 2 23 2 1 17 6 14 19 24 2 8 8 7 7 10 14 13 7
-9 11 16 11 8 8 18 13 13 18 10 1 20 18 22 19 12 9 16 12 ^
-43 1 13 6 9 17 20 10 5 7 20 18 8 15 23 21 20 5 15 11 3 3 14 21 10 24 6 21 21 6
-23 10 3 21 23 17 20 8 16 10 22 5 16 1 24 ^
-50 0 24 3 9 16 6 7 3 20 12 17 18 21 5 9 7 1 9 12 19 5 7 6 24 11 11 20 23 10 4 7
-1 19 7 19 17 23 15 5 12 21 20 3 1 14 2 15 22 3 16 11 ^
-45 1 10 19 10 20 16 19 17 10 4 21 20 16 21 14 14 8 17 10 19 1 17 4 3 22 23 14
-16 9 22 8 20 24 1 5 11 11 6 4 13 15 12 1 11 13 22 ^
-45 0 3 8 5 6 5 16 12 11 2 17 14 19 23 16 5 6 20 21 9 24 9 22 23 22 12 8 13 23
-17 5 3 16 22 15 22 7 17 3 2 13 13 11 24 13 17 ^
-42 1 21 11 14 20 24 24 4 9 13 5 8 9 18 7 12 1 21 8 24 15 1 22 19 24 14 13 8 20
-14 18 23 19 9 8 14 23 11 4 4 22 20 17 ^
-49 1 17 15 20 6 15 8 24 4 20 19 8 19 14 21 24 18 3 10 16 3 6 4 1 10 15 13 4 8
-12 22 9 6 3 1 13 16 12 23 10 14 2 1 6 11 8 19 24 16 23 ^
-50 0 5 21 2 7 22 4 5 23 3 12 20 8 4 5 17 9 18 18 18 4 10 13 2 4 7 24 8 10 21 4
-8 24 2 6 19 10 6 22 22 14 22 13 21 5 22 2 4 18 5 24 ^
-53 1 21 1 7 8 4 17 5 14 1 2 10 9 12 5 11 10 20 4 14 3 1 3 21 12 11 17 22 11 7 5
-21 14 15 19 20 12 6 12 18 19 4 7 12 10 5 22 3 15 21 7 23 7 18 ^
-43 1 22 4 18 18 3 24 10 17 24 23 18 6 11 18 22 8 6 6 2 12 10 14 12 9 2 23 16 20
-14 17 9 16 7 21 6 22 24 19 11 9 19 21 6 ^
-49 1 11 19 2 2 7 8 10 8 9 8 15 9 14 6 16 8 21 21 22 6 17 9 4 24 21 15 15 16 16
-13 9 10 16 14 12 7 12 15 15 5 10 10 23 5 13 22 3 5 22 ^
-52 0 4 11 14 7 6 10 17 14 6 3 13 18 16 3 5 15 23 8 5 3 18 8 12 20 20 9 2 13 24
-17 2 2 17 3 13 20 2 6 3 15 7 13 1 18 7 22 18 24 20 14 7 23 ^
-45 1 16 20 3 11 6 5 2 18 14 16 22 14 11 7 18 16 17 24 12 12 3 13 19 16 22 4 16
-4 6 23 8 18 11 2 3 20 22 9 21 8 23 1 23 20 23 ^
-51 1 16 13 23 4 13 3 7 4 23 6 13 19 2 3 7 2 9 9 15 6 13 4 22 6 19 20 1 9 7 14 1
-15 3 23 24 22 18 12 12 17 19 10 8 11 22 12 10 2 20 15 15 ^
-48 1 17 18 7 11 12 21 6 12 4 7 18 17 3 2 14 24 14 1 23 1 11 15 10 6 18 20 7 1 8
-1 16 6 20 23 23 21 10 10 12 24 10 11 23 2 12 23 9 20 ^
-49 1 24 24 19 14 10 18 15 14 5 16 11 22 2 15 24 8 22 1 4 24 9 10 15 3 9 5 4 17
-15 9 12 19 19 1 3 10 6 8 3 17 8 18 24 19 3 4 15 4 24 ^
-43 0 2 24 5 20 13 7 20 17 19 22 13 8 10 19 15 11 1 14 17 20 22 10 7 11 16 9 21
-22 17 23 12 15 4 24 7 21 18 2 21 16 1 19 11 ^
-48 1 20 11 3 15 19 18 1 6 14 5 5 5 19 13 10 24 19 16 24 15 13 2 19 15 24 21 17
-4 13 17 1 1 9 1 10 2 18 1 21 19 5 18 12 2 22 16 23 19 ^
-50 1 19 6 18 9 1 23 22 21 13 14 11 18 12 13 3 19 9 20 22 20 2 11 12 6 1 12 16
-18 2 9 8 4 3 11 17 11 5 4 19 16 11 23 13 18 1 20 8 2 16 16 ^
-48 1 16 21 4 19 5 5 20 24 13 23 6 24 5 17 12 5 1 15 17 17 21 11 13 9 23 11 14
-21 7 6 9 6 14 7 16 2 17 1 24 23 4 12 14 4 2 11 23 15 ^
-50 1 4 23 21 21 16 15 13 15 14 15 8 14 9 17 7 15 2 23 2 1 17 6 14 19 24 2 8 8 7
-7 10 14 13 7 9 11 16 11 8 8 18 13 13 18 10 1 20 18 22 3 ^
-44 1 12 9 16 17 13 6 9 17 20 10 5 7 20 18 8 15 23 21 20 5 15 11 3 3 14 21 10 24
-6 21 21 6 23 10 3 21 23 17 20 8 16 10 22 12 ^
-53 0 16 1 5 24 3 9 16 6 7 3 20 12 17 18 21 5 9 7 1 9 12 19 5 7 6 24 11 11 20 23
-10 4 7 1 19 7 19 17 23 15 5 12 21 20 3 1 14 2 15 22 3 16 9 ^
-46 1 10 19 10 20 16 19 17 10 4 21 20 16 21 14 14 8 17 10 19 1 17 4 3 22 23 14
-16 9 22 8 20 24 1 5 11 11 6 4 13 15 12 1 11 13 21 21 ^
-46 0 8 5 6 5 16 12 11 2 17 14 19 23 16 5 6 20 21 9 24 9 22 23 22 12 8 13 23 17
-5 3 16 22 15 22 7 17 3 2 13 13 11 24 13 12 21 7 ^
-43 1 14 20 24 24 4 9 13 5 8 9 18 7 12 1 21 8 24 15 1 22 19 24 14 13 8 20 14 18
-23 19 9 8 14 23 11 4 4 22 20 13 17 15 24 ^
-55 0 6 15 8 24 4 20 19 8 19 14 21 24 18 3 10 16 3 6 4 1 10 15 13 4 8 12 22 9 6
-3 1 13 16 12 23 10 14 2 1 6 11 8 19 24 16 2 5 21 2 7 22 4 5 23 4 ^
-55 1 12 20 8 4 5 17 9 18 18 18 4 10 13 2 4 7 24 8 10 21 4 8 24 2 6 19 10 6 22
-22 14 22 13 21 5 22 2 4 18 5 11 21 1 7 8 4 17 5 14 1 2 10 9 12 14 ^
-49 0 11 10 20 4 14 3 1 3 21 12 11 17 22 11 7 5 21 14 15 19 20 12 6 12 18 19 4 7
-12 10 5 22 3 15 21 7 23 7 2 22 4 18 18 3 24 10 17 24 12 ^
-50 0 18 6 11 18 22 8 6 6 2 12 10 14 12 9 2 23 16 20 14 17 9 16 7 21 6 22 24 19
-11 9 19 21 15 11 19 2 2 7 8 10 8 9 8 15 9 14 6 16 8 22 ^
-51 1 21 22 6 17 9 4 24 21 15 15 16 16 13 9 10 16 14 12 7 12 15 15 5 10 10 23 5
-13 22 3 5 1 4 11 14 7 6 10 17 14 6 3 13 18 16 3 5 15 23 8 21 ^
-51 1 5 3 18 8 12 20 20 9 2 13 24 17 2 2 17 3 13 20 2 6 3 15 7 13 1 18 7 22 18
-24 20 14 7 17 16 20 3 11 6 5 2 18 14 16 22 14 11 7 18 16 20 ^
-52 0 24 12 12 3 13 19 16 22 4 16 4 6 23 8 18 11 2 3 20 22 9 21 8 23 1 23 20 7
-16 13 23 4 13 3 7 4 23 6 13 19 2 3 7 2 9 9 15 6 13 4 22 16 ^
-49 1 19 20 1 9 7 14 1 15 3 23 24 22 18 12 12 17 19 10 8 11 22 12 10 2 20 15 18
-17 18 7 11 12 21 6 12 4 7 18 17 3 2 14 24 14 1 23 1 11 16 ^
-47 0 10 6 18 20 7 1 8 1 16 6 20 23 23 21 10 10 12 24 10 11 23 2 12 23 9 3 24 24
-19 14 10 18 15 14 5 16 11 22 2 15 24 8 22 1 4 24 3 ^
-45 0 17 6 24 11 7 21 9 17 8 25 5 5 22 16 13 5 2 16 4 25 25 8 18 13 13 3 1 22 23
-24 18 12 21 19 2 4 24 13 11 2 7 24 22 17 21 ^
-46 1 15 1 8 3 10 15 18 15 8 10 16 20 20 7 18 22 11 18 9 11 15 22 20 18 6 24 15
-25 4 22 12 17 4 6 17 20 2 4 2 5 20 15 19 24 18 15 ^
-52 1 8 2 5 23 2 10 21 8 5 2 9 16 16 15 6 22 23 5 6 21 5 21 24 3 6 10 17 19 9 15
-11 23 16 17 1 3 12 3 20 4 5 5 3 21 22 15 4 21 20 7 22 18 ^
-43 0 9 24 4 18 7 7 25 24 22 21 23 24 14 20 12 6 7 4 2 12 25 15 3 9 23 8 16 25
-11 14 4 10 19 23 16 13 9 20 25 17 11 8 19 ^
-55 0 19 25 17 7 16 21 6 4 8 2 15 9 2 9 19 3 6 3 3 10 25 13 15 7 8 20 21 12 10
-12 5 24 11 20 3 13 13 16 9 13 10 3 9 16 3 7 15 9 9 14 2 13 17 25 3 ^
-46 0 18 5 19 23 9 25 9 10 23 12 12 7 13 8 15 7 1 6 21 2 8 7 6 16 14 14 12 15 13
-24 10 15 11 10 8 14 15 21 25 21 16 9 18 20 22 21 ^
-50 1 20 11 14 23 22 10 13 14 8 19 12 2 11 20 23 13 4 10 6 5 7 23 11 3 16 8 21 4
-8 18 5 12 14 8 6 20 19 24 8 23 17 3 7 19 1 18 1 14 22 11 ^
-44 1 14 5 8 22 18 14 25 17 11 12 22 2 12 12 16 12 13 18 17 12 17 14 18 8 25 9
-23 5 3 8 14 24 17 7 3 3 23 17 22 19 19 17 16 19 ^
-51 0 24 14 16 20 23 20 9 19 16 7 12 16 5 8 9 7 10 21 24 10 11 19 1 21 14 14 19
-3 22 8 12 20 1 18 5 6 5 12 14 1 1 11 9 22 3 24 9 6 1 11 20 ^
-47 0 1 12 8 11 11 17 10 22 7 3 10 2 6 4 24 16 24 19 4 5 18 11 12 9 20 21 25 2
-21 18 10 20 25 21 3 17 17 5 8 22 25 19 8 10 19 7 25 ^
-55 1 4 8 18 3 18 3 11 24 2 14 9 1 10 4 4 13 19 22 4 7 19 5 10 10 1 8 22 22 6 8
-13 12 11 17 23 14 16 7 5 11 22 24 7 2 11 13 18 4 20 8 1 6 25 20 16 ^
-51 1 20 1 25 10 15 15 2 17 13 9 24 17 24 20 13 15 17 3 11 20 10 5 13 23 18 5 3
-18 15 7 5 7 4 15 20 16 2 17 1 7 4 12 7 25 14 1 4 7 19 19 22 ^
-52 0 3 13 12 4 3 14 4 14 11 6 3 25 18 16 20 24 12 19 18 25 6 23 6 15 5 4 4 6 14
-13 20 5 14 15 2 13 21 11 5 17 2 2 10 11 13 14 12 11 21 15 23 20 ^
-50 1 2 5 7 23 10 20 6 12 1 19 10 24 21 22 25 16 12 19 22 15 10 18 24 1 5 16 10
-18 2 19 14 3 5 1 7 20 7 16 6 20 6 6 25 10 22 20 2 1 15 18 ^
-48 0 23 25 23 4 11 15 15 6 9 22 22 19 22 25 6 19 6 2 20 21 7 22 18 10 7 17 4 16
-12 10 25 12 23 23 9 2 22 1 20 2 8 3 14 7 1 2 3 24 ^
-38 1 21 21 23 20 22 11 25 20 24 25 1 9 21 20 14 10 14 19 9 17 15 13 5 15 24 21
-12 13 25 22 21 1 16 23 7 24 15 22 ^
-54 1 22 5 25 3 4 2 9 12 24 6 19 1 14 9 5 9 1 17 9 4 23 21 1 3 15 16 11 1 12 18
-6 2 7 8 17 8 21 13 22 9 21 4 9 1 13 17 21 10 9 18 24 23 13 24 ^
-43 1 23 23 19 23 22 17 18 23 18 21 17 1 10 12 4 6 1 21 11 18 2 6 6 12 18 13 16
-16 18 19 13 11 21 19 15 12 15 16 19 2 23 19 23 ^
-48 0 1 2 25 14 11 25 24 16 8 14 21 21 16 6 13 1 23 15 8 17 4 3 4 9 23 12 8 8 24
-13 6 11 3 8 24 19 8 23 1 24 24 18 25 13 2 6 25 14 ^
-51 1 9 3 5 11 19 11 16 5 4 17 24 23 15 14 10 7 14 17 25 15 10 14 6 18 18 4 1 13
-10 16 1 25 16 2 24 5 1 17 6 17 6 24 11 7 21 9 17 8 25 5 23 ^
-48 1 22 16 13 5 2 16 4 25 25 8 18 13 13 3 1 22 23 24 18 12 21 19 2 4 24 13 11 2
-7 24 22 17 5 15 1 8 3 10 15 18 15 8 10 16 20 20 7 25 ^
-49 0 22 11 18 9 11 15 22 20 18 6 24 15 25 4 22 12 17 4 6 17 20 2 4 2 5 20 15 19
-24 18 9 8 2 5 23 2 10 21 8 5 2 9 16 16 15 6 22 23 17 ^
-47 1 6 21 5 21 24 3 6 10 17 19 9 15 11 23 16 17 1 3 12 3 20 4 5 5 3 21 22 15 4
-21 20 7 22 14 9 24 4 18 7 7 25 24 22 21 23 24 14 ^
-53 0 20 12 6 7 4 2 12 25 15 3 9 23 8 16 25 11 14 4 10 19 23 16 13 9 20 25 17 11
-8 4 19 25 17 7 16 21 6 4 8 2 15 9 2 9 19 3 6 3 3 10 25 13 15 ^
-54 1 7 8 20 21 12 10 12 5 24 11 20 3 13 13 16 9 13 10 3 9 16 3 7 15 9 9 14 2 13
-17 25 2 18 5 19 23 9 25 9 10 23 12 12 7 13 8 15 7 1 6 21 2 8 25 ^
-44 1 6 16 14 14 12 15 13 24 10 15 11 10 8 14 15 21 25 21 16 9 18 20 22 21 20 11
-14 23 22 10 13 14 8 19 12 2 11 20 23 13 4 10 6 25 ^
-49 1 7 23 11 3 16 8 21 4 8 18 5 12 14 8 6 20 19 24 8 23 17 3 7 19 1 18 1 14 22
-13 14 5 8 22 18 14 25 17 11 12 22 2 12 12 16 12 13 18 25 ^
-45 1 12 17 14 18 8 25 9 23 5 3 8 14 24 17 7 3 3 23 17 22 19 19 17 16 22 24 14
-16 20 23 20 9 19 16 7 12 16 5 8 9 7 10 21 24 7 ^
-58 0 11 19 1 21 14 14 19 3 22 8 12 20 1 18 5 6 5 12 14 1 1 11 9 22 3 24 9 6 1
-11 16 1 12 8 11 11 17 10 22 7 3 10 2 6 4 24 16 24 19 4 5 18 11 12 9 20 21 7 ^
-54 1 2 21 18 10 20 25 21 3 17 17 5 8 22 25 19 8 10 19 7 11 4 8 18 3 18 3 11 24
-2 14 9 1 10 4 4 13 19 22 4 7 19 5 10 10 1 8 22 22 6 8 13 12 11 21 ^
-47 1 23 14 16 7 5 11 22 24 7 2 11 13 18 4 20 8 1 6 25 20 17 20 1 25 10 15 15 2
-17 13 9 24 17 24 20 13 15 17 3 11 20 10 5 13 23 18 21 ^
-57 1 3 18 15 7 5 7 4 15 20 16 2 17 1 7 4 12 7 25 14 1 4 7 19 19 20 3 13 12 4 3
-14 4 14 11 6 3 25 18 16 20 24 12 19 18 25 6 23 6 15 5 4 4 6 14 13 20 7 ^
-51 1 14 15 2 13 21 11 5 17 2 2 10 11 13 14 12 11 21 15 23 3 2 5 7 23 10 20 6 12
-1 19 10 24 21 22 25 16 12 19 22 15 10 18 24 1 5 16 10 18 2 19 8 ^
-49 0 3 5 1 7 20 7 16 6 20 6 6 25 10 22 20 2 1 15 14 23 25 23 4 11 15 15 6 9 22
-22 19 22 25 6 19 6 2 20 21 7 22 18 10 7 17 4 16 12 24 ^
-46 0 10 25 12 23 23 9 2 22 1 20 2 8 3 14 7 1 2 3 19 21 21 23 20 22 11 25 20 24
-25 1 9 21 20 14 10 14 19 9 17 15 13 5 15 24 21 14 ^
-55 0 13 25 22 21 1 16 23 7 24 15 3 22 5 25 3 4 2 9 12 24 6 19 1 14 9 5 9 1 17 9
-4 23 21 1 3 15 16 11 1 12 18 6 2 7 8 17 8 21 13 22 9 21 4 9 22 ^
-45 1 13 17 21 10 9 18 24 23 13 7 23 23 19 23 22 17 18 23 18 21 17 1 10 12 4 6 1
-21 11 18 2 6 6 12 18 13 16 16 18 19 13 11 21 19 8 ^
-50 1 12 15 16 19 2 23 19 4 1 2 25 14 11 25 24 16 8 14 21 21 16 6 13 1 23 15 8
-17 4 3 4 9 23 12 8 8 24 13 6 11 3 8 24 19 8 23 1 24 24 12 ^
-53 0 25 13 2 6 25 7 9 3 5 11 19 11 16 5 4 17 24 23 15 14 10 7 14 17 25 15 10 14
-6 18 18 4 1 13 10 16 1 25 16 2 24 5 1 17 6 17 6 24 11 7 21 9 19 ^
-51 1 8 25 5 5 22 16 13 5 2 16 4 25 25 8 18 13 13 3 1 22 23 24 18 12 21 19 2 4
-24 13 11 2 7 24 22 17 5 15 1 8 3 10 15 18 15 8 10 16 20 20 8 ^
-50 1 18 22 11 18 9 11 15 22 20 18 6 24 15 25 4 22 12 17 4 6 17 20 2 4 2 5 20 15
-19 24 18 9 8 2 5 23 2 10 21 8 5 2 9 16 16 15 6 22 23 18 ^
-48 1 6 21 5 21 24 3 6 10 17 19 9 15 11 23 16 17 1 3 12 3 20 4 5 5 3 21 22 15 4
-21 20 7 22 14 9 24 4 18 7 7 25 24 22 21 23 24 14 19 ^
-55 0 12 6 7 4 2 12 25 15 3 9 23 8 16 25 11 14 4 10 19 23 16 13 9 20 25 17 11 8
-4 19 25 17 7 16 21 6 4 8 2 15 9 2 9 19 3 6 3 3 10 25 13 15 7 8 24 ^
-56 0 21 12 10 12 5 24 11 20 3 13 13 16 9 13 10 3 9 16 3 7 15 9 9 14 2 13 17 25
-2 18 5 19 23 9 25 9 10 23 12 12 7 13 8 15 7 1 6 21 2 8 7 6 16 14 14 22 ^
-47 0 15 13 24 10 15 11 10 8 14 15 21 25 21 16 9 18 20 22 21 20 11 14 23 22 10
-13 14 8 19 12 2 11 20 23 13 4 10 6 5 7 23 11 3 16 8 21 12 ^
-49 0 4 8 18 5 12 14 8 6 20 19 24 8 23 17 3 7 19 1 18 1 14 22 13 14 5 8 22 18 14
-25 17 11 12 22 2 12 12 16 12 13 18 17 12 17 14 18 8 25 22 ^
-46 1 23 5 3 8 14 24 17 7 3 3 23 17 22 19 19 17 16 22 24 14 16 20 23 20 9 19 16
-7 12 16 5 8 9 7 10 21 24 10 11 19 1 21 14 14 19 20 ^
-57 1 22 8 12 20 1 18 5 6 5 12 14 1 1 11 9 22 3 24 9 6 1 11 16 1 12 8 11 11 17
-10 22 7 3 10 2 6 4 24 16 24 19 4 5 18 11 12 9 20 21 25 2 21 18 10 20 25 7 ^
-56 1 3 17 17 5 8 22 25 19 8 10 19 7 11 4 8 18 3 18 3 11 24 2 14 9 1 10 4 4 13
-19 22 4 7 19 5 10 10 1 8 22 22 6 8 13 12 11 17 23 14 16 7 5 11 22 24 18 ^
-54 1 2 11 13 18 4 20 8 1 6 25 20 17 20 1 25 10 15 15 2 17 13 9 24 17 24 20 13
-15 17 3 11 20 10 5 13 23 18 5 3 18 15 7 5 7 4 15 20 16 2 17 1 7 4 23 ^
-56 0 7 25 14 1 4 7 19 19 20 3 13 12 4 3 14 4 14 11 6 3 25 18 16 20 24 12 19 18
-25 6 23 6 15 5 4 4 6 14 13 20 5 14 15 2 13 21 11 5 17 2 2 10 11 13 14 24 ^
-49 0 12 11 20 3 14 2 3 2 23 12 12 17 24 11 8 6 24 16 15 22 21 14 6 12 20 19 5 5
-12 11 6 23 2 16 23 7 24 6 21 2 17 17 5 25 11 25 20 25 19 ^
-54 0 18 6 12 19 25 7 6 5 2 14 12 16 1 15 7 1 26 19 19 13 20 11 17 6 20 5 24 24
-1 21 11 9 20 21 15 10 19 26 3 2 6 7 12 9 10 8 14 10 15 5 17 8 21 7 ^
-56 0 20 25 6 19 8 3 22 16 16 16 17 13 11 10 17 15 12 6 13 14 17 4 12 10 24 5 13
-24 3 5 2 5 11 14 8 5 10 17 16 8 4 14 21 15 3 6 17 25 8 2 3 3 19 10 13 23 ^
-51 1 22 8 2 13 25 17 2 1 19 1 14 20 2 5 4 15 8 14 20 7 25 20 26 20 16 7 17 17
-22 1 13 6 5 1 18 14 15 23 15 10 5 19 18 18 26 12 13 3 25 12 18 ^
-51 1 16 24 4 16 3 6 26 26 10 20 13 1 20 24 10 21 7 25 2 25 22 9 15 16 26 5 12 1
-7 4 24 7 14 20 1 4 7 3 10 10 15 6 13 6 22 6 20 22 2 26 26 ^
-47 1 6 14 1 16 3 24 25 24 17 12 14 18 18 9 9 11 22 13 9 2 22 15 20 20 18 8 13
-13 21 8 11 5 26 8 19 17 4 2 15 26 13 24 26 11 16 9 24 ^
-52 0 8 18 21 6 1 8 1 16 4 20 23 23 24 10 11 12 10 10 25 1 11 25 10 3 26 26 20
-15 11 19 16 17 3 16 12 25 15 9 23 1 2 24 8 10 18 2 9 5 4 17 16 12 ^
-50 0 12 20 20 1 3 11 5 9 3 17 9 17 24 21 3 4 16 2 10 1 25 5 22 16 6 21 19 21 23
-15 9 9 21 17 11 1 15 17 23 24 11 7 10 26 15 8 22 22 18 16 ^
-48 0 11 17 5 26 7 23 19 3 24 17 2 19 18 26 21 12 5 18 22 20 7 15 6 4 5 20 13 10
-23 18 16 25 18 15 2 20 14 24 22 17 3 15 16 1 10 2 12 16 ^
-47 0 21 1 21 21 4 18 13 1 24 18 23 17 19 6 19 9 26 25 23 23 14 13 13 20 12 13 4
-21 10 22 21 22 1 12 12 7 13 16 18 8 9 4 3 10 18 12 25 ^
-47 1 5 19 19 12 24 13 18 1 22 8 1 17 18 24 3 22 7 7 19 26 13 26 6 26 6 18 12 5
-26 17 18 19 22 10 12 8 23 11 17 23 25 5 5 11 4 13 20 ^
-52 0 18 4 19 23 3 13 15 4 3 9 24 14 5 25 21 22 18 17 12 15 14 16 10 14 9 19 7
-16 3 23 4 26 18 5 16 21 24 2 8 8 8 7 11 13 14 7 9 12 18 11 10 20 ^
-47 1 20 12 14 19 11 21 21 22 19 13 10 16 19 14 7 8 16 20 10 3 9 23 18 7 26 16
-22 21 21 5 14 11 2 2 16 22 11 26 7 22 23 5 23 10 4 22 5 ^
-50 0 19 20 9 16 10 24 4 19 26 4 25 4 8 17 7 7 2 23 11 18 19 23 6 10 9 1 9 14 19
-5 6 6 25 12 11 21 26 12 3 8 20 8 21 18 25 25 14 4 11 25 ^
-45 1 23 4 14 3 17 26 22 26 2 15 9 8 25 19 12 23 17 20 17 10 4 23 20 17 21 14 14
-9 18 11 18 2 18 4 2 22 25 15 18 10 23 8 21 26 15 ^
-54 0 7 14 10 6 6 15 15 13 2 11 15 22 2 9 4 4 6 16 11 11 3 16 13 19 25 16 5 7 20
-22 9 25 11 24 24 25 13 8 15 23 16 6 3 18 23 16 23 8 20 4 1 1 14 16 ^
-43 1 12 24 14 14 26 23 13 26 14 21 25 25 4 9 13 5 8 9 21 8 12 26 24 9 24 15 1
-23 22 16 14 8 22 15 19 24 20 7 8 15 24 12 18 ^
-57 0 4 23 21 13 19 15 21 7 15 7 3 21 20 8 22 14 23 26 19 2 10 18 3 5 3 1 9 15
-15 3 7 13 23 9 7 1 13 17 14 25 9 16 2 2 6 13 7 19 25 17 1 5 21 2 7 22 5 ^
-55 1 6 25 3 12 19 6 2 4 24 17 9 18 20 19 4 11 14 1 6 8 26 6 9 22 4 10 2 7 21 9
-8 24 25 14 22 12 22 3 23 3 3 20 6 11 23 6 1 7 5 18 5 15 25 26 23 ^
-53 0 1 10 11 11 4 12 11 20 3 14 2 3 2 23 12 12 17 24 11 8 6 24 16 15 22 21 14 6
-12 20 19 5 5 12 11 6 23 2 16 23 7 24 6 21 2 17 17 5 25 11 25 20 26 ^
-54 0 24 18 6 12 19 25 7 6 5 2 14 12 16 1 15 7 1 26 19 19 13 20 11 17 6 20 5 24
-24 1 21 11 9 20 21 15 10 19 26 3 2 6 7 12 9 10 8 14 10 15 5 17 8 23 ^
-58 0 1 20 25 6 19 8 3 22 16 16 16 17 13 11 10 17 15 12 6 13 14 17 4 12 10 24 5
-13 24 3 5 2 5 11 14 8 5 10 17 16 8 4 14 21 15 3 6 17 25 8 2 3 3 19 10 13 22 19 ^
-52 1 8 2 13 25 17 2 1 19 1 14 20 2 5 4 15 8 14 20 7 25 20 26 20 16 7 17 17 22 1
-13 6 5 1 18 14 15 23 15 10 5 19 18 18 26 12 13 3 25 12 21 16 22 ^
-56 1 4 16 3 6 26 26 10 20 13 1 20 24 10 21 7 25 2 25 22 9 15 16 26 5 12 1 7 4
-24 7 14 20 1 4 7 3 10 10 15 6 13 6 22 6 20 22 2 26 9 6 14 1 16 3 24 12 ^
-52 0 24 17 12 14 18 18 9 9 11 22 13 9 2 22 15 20 20 18 8 13 13 21 8 11 5 26 8
-19 17 4 2 15 26 13 24 26 11 16 9 1 8 18 21 6 1 8 1 16 4 20 23 5 ^
-54 0 24 10 11 12 10 10 25 1 11 25 10 3 26 26 20 15 11 19 16 17 3 16 12 25 15 9
-23 1 2 24 8 10 18 2 9 5 4 17 16 9 12 20 20 1 3 11 5 9 3 17 9 17 24 20 ^
-49 1 3 4 16 2 10 1 25 5 22 16 6 21 19 21 23 15 9 9 21 17 11 1 15 17 23 24 11 7
-10 26 15 8 22 22 18 26 11 17 5 26 7 23 19 3 24 17 2 19 8 ^
-49 0 26 21 12 5 18 22 20 7 15 6 4 5 20 13 10 23 18 16 25 18 15 2 20 14 24 22 17
-3 15 16 1 10 2 12 2 21 1 21 21 4 18 13 1 24 18 23 17 19 23 ^
-50 1 19 9 26 25 23 23 14 13 13 20 12 13 4 21 10 22 21 22 1 12 12 7 13 16 18 8 9
-4 3 10 18 12 4 5 19 19 12 24 13 18 1 22 8 1 17 18 24 3 22 21 ^
-48 1 7 19 26 13 26 6 26 6 18 12 5 26 17 18 19 22 10 12 8 23 11 17 23 25 5 5 11
-4 13 7 18 4 19 23 3 13 15 4 3 9 24 14 5 25 21 22 18 25 ^
-53 1 12 15 14 16 10 14 9 19 7 16 3 23 4 26 18 5 16 21 24 2 8 8 8 7 11 13 14 7 9
-12 18 11 10 7 20 12 14 19 11 21 21 22 19 13 10 16 19 14 7 8 16 20 7 ^
-49 0 3 9 23 18 7 26 16 22 21 21 5 14 11 2 2 16 22 11 26 7 22 23 5 23 10 4 22 24
-19 20 9 16 10 24 4 19 26 4 25 4 8 17 7 7 2 23 11 18 19 ^
-49 0 23 6 10 9 1 9 14 19 5 6 6 25 12 11 21 26 12 3 8 20 8 21 18 25 25 14 4 11
-24 23 4 14 3 17 26 22 26 2 15 9 8 25 19 12 23 17 20 17 10 ^
-54 0 4 23 20 17 21 14 14 9 18 11 18 2 18 4 2 22 25 15 18 10 23 8 21 26 7 14 10
-6 6 15 15 13 2 11 15 22 2 9 4 4 6 16 11 11 3 16 13 19 25 16 5 7 20 23 ^
-47 0 9 25 11 24 24 25 13 8 15 23 16 6 3 18 23 16 23 8 20 4 1 1 14 13 12 24 14
-14 26 23 13 26 14 21 25 25 4 9 13 5 8 9 21 8 12 26 15 ^
-51 1 9 24 15 1 23 22 16 14 8 22 15 19 24 20 7 8 15 24 12 4 4 23 21 13 19 15 21
-7 15 7 3 21 20 8 22 14 23 26 19 2 10 18 3 5 3 1 9 15 15 3 24 ^
-60 0 13 23 9 7 1 13 17 14 25 9 16 2 2 6 13 7 19 25 17 1 5 21 2 7 22 5 6 25 3 12
-19 6 2 4 24 17 9 18 20 19 4 11 14 1 6 8 26 6 9 22 4 10 2 7 21 9 8 24 25 10 ^
-59 0 22 12 22 3 23 3 3 20 6 11 23 6 1 7 5 18 5 15 25 26 1 1 10 11 11 4 12 11 20
-3 14 2 3 2 23 12 12 17 24 11 8 6 24 16 15 22 21 14 6 12 20 19 5 5 12 11 6 23 8 ^
-50 0 16 23 7 24 6 21 2 17 17 5 25 11 25 20 25 24 18 6 12 19 25 7 6 5 2 14 12 16
-1 15 7 1 26 19 19 13 20 11 17 6 20 5 24 24 1 21 11 9 20 14 ^
-60 0 15 10 19 26 3 2 6 7 12 9 10 8 14 10 15 5 17 8 21 1 20 25 6 19 8 3 22 16 16
-16 17 13 11 10 17 15 12 6 13 14 17 4 12 10 24 5 13 24 3 5 2 5 11 14 8 5 10 17
-16 13 ^
-57 0 4 14 21 15 3 6 17 25 8 2 3 3 19 10 13 22 22 8 2 13 25 17 2 1 19 1 14 20 2
-5 4 15 8 14 20 7 25 20 26 20 16 7 17 17 22 1 13 6 5 1 18 14 15 23 15 10 21 ^
-52 1 19 18 18 26 12 13 3 25 12 21 16 24 4 16 3 6 26 26 10 20 13 1 20 24 10 21 7
-25 2 25 22 9 15 16 26 5 12 1 7 4 24 7 14 20 1 4 7 3 10 10 15 19 ^
-51 0 13 6 22 6 20 22 2 26 9 6 14 1 16 3 24 25 24 17 12 14 18 18 9 9 11 22 13 9
-2 22 15 20 20 18 8 13 13 21 8 11 5 26 8 19 17 4 2 15 26 13 21 ^
-52 1 24 26 11 16 9 1 8 18 21 6 1 8 1 16 4 20 23 23 24 10 11 12 10 10 25 1 11 25
-10 3 26 26 20 15 11 19 16 17 3 16 12 25 15 9 23 1 2 24 8 10 18 15 ^
-55 1 9 5 4 17 16 9 12 20 20 1 3 11 5 9 3 17 9 17 24 21 3 4 16 2 10 1 25 5 22 16
-6 21 19 21 23 15 9 9 21 17 11 1 15 17 23 24 11 7 10 26 15 8 22 22 11 ^
-50 1 26 11 17 5 26 7 23 19 3 24 17 2 19 18 26 21 12 5 18 22 20 7 15 6 4 5 20 13
-10 23 18 16 25 18 15 2 20 14 24 22 17 3 15 16 1 10 2 12 2 25 ^
-51 0 1 21 21 4 18 13 1 24 18 23 17 19 6 19 9 26 25 23 23 14 13 13 20 12 13 4 21
-10 22 21 22 1 12 12 7 13 16 18 8 9 4 3 10 18 12 4 5 19 19 12 24 ^
-53 1 13 18 1 22 8 1 17 18 24 3 22 7 7 19 26 13 26 6 26 6 18 12 5 26 17 18 19 22
-10 12 8 23 11 17 23 25 5 5 11 4 13 7 18 4 19 23 3 13 15 4 3 9 18 ^
-51 1 14 5 25 21 22 18 17 12 15 14 16 10 14 9 19 7 16 3 23 4 26 18 5 16 21 24 2
-8 8 8 7 11 13 14 7 9 12 18 11 10 7 20 12 14 19 11 21 21 22 19 26 ^
-49 0 10 16 19 14 7 8 16 20 10 3 9 23 18 7 26 16 22 21 21 5 14 11 2 2 16 22 11
-26 7 22 23 5 23 10 4 22 24 19 20 9 16 10 24 4 19 26 4 25 14 ^
-52 0 8 17 7 7 2 23 11 18 19 23 6 10 9 1 9 14 19 5 6 6 25 12 11 21 26 12 3 8 20
-8 21 18 25 25 14 4 11 24 23 4 14 3 17 26 22 26 2 15 9 8 25 24 ^
-55 1 12 23 17 20 17 10 4 23 20 17 21 14 14 9 18 11 18 2 18 4 2 22 25 15 18 10
-23 8 21 26 7 14 10 6 6 15 15 13 2 11 15 22 2 9 4 4 6 16 11 11 3 16 13 19 15 ^
-49 0 16 5 7 20 22 9 25 11 24 24 25 13 8 15 23 16 6 3 18 23 16 23 8 20 4 1 1 14
-13 12 24 14 14 26 23 13 26 14 21 25 25 4 9 13 5 8 9 21 9 ^
-55 0 22 24 9 27 23 1 13 18 24 1 8 24 8 6 14 1 4 5 15 27 12 20 1 17 5 4 14 25 14
-3 19 24 24 14 8 13 12 19 8 3 6 13 7 10 23 19 10 17 17 11 6 13 8 18 18 ^
-51 0 7 3 25 1 17 8 26 25 11 23 14 27 1 22 11 9 7 19 4 15 18 2 27 20 11 5 20 22
-19 15 5 6 17 8 1 19 22 9 23 10 26 27 26 14 12 3 14 15 11 2 26 ^
-50 0 6 22 20 8 25 4 25 24 23 20 3 3 16 2 2 27 2 15 14 27 3 17 12 27 27 7 26 2
-22 11 9 10 24 15 1 27 11 27 4 1 25 25 16 6 2 22 12 17 21 14 ^
-52 0 8 9 22 17 12 7 18 14 23 2 6 4 23 9 4 22 16 18 23 8 11 25 17 27 16 10 3 24
-8 20 20 18 18 13 4 2 18 22 15 25 26 9 3 1 2 19 15 1 24 17 16 18 ^
-49 0 9 14 11 8 16 19 16 22 10 16 24 25 7 22 12 20 15 23 22 18 22 14 6 26 21 10
-21 7 13 2 16 7 24 16 22 13 10 7 11 16 5 9 25 13 9 14 14 17 14 ^
-54 1 2 10 5 25 5 7 10 22 10 1 24 3 11 7 23 5 17 14 3 18 5 13 26 15 5 13 23 18
-17 3 18 3 27 15 6 25 24 22 27 17 4 25 23 15 9 15 21 8 7 7 15 3 13 25 ^
-47 0 25 3 4 10 24 12 7 16 25 18 21 21 20 27 13 14 23 27 1 21 9 21 14 22 9 9 5
-15 13 17 3 4 9 16 1 8 23 17 23 26 8 24 10 20 25 27 25 ^
-58 1 8 26 8 10 4 3 8 14 5 5 7 11 13 11 26 11 4 26 17 20 19 11 10 3 10 14 9 6 9
-7 16 10 4 4 19 19 2 26 13 19 17 15 24 15 4 21 22 13 13 12 22 2 14 20 5 18 7 25 ^
-58 0 17 24 20 13 6 17 9 20 2 10 19 3 22 4 1 11 3 5 3 21 11 15 12 23 26 5 2 27 6
-5 16 6 3 2 23 5 3 20 20 4 24 2 18 21 7 14 10 27 23 6 24 6 19 23 3 9 22 15 ^
-54 0 21 17 19 25 17 7 21 19 6 16 15 15 20 14 2 25 19 14 18 19 7 9 1 14 11 10 16
-3 23 14 26 10 11 1 18 1 12 24 19 19 1 7 2 3 24 7 12 9 2 8 16 20 24 25 ^
-49 1 26 26 4 9 2 7 25 9 8 12 18 14 26 7 17 18 4 20 1 16 14 21 26 4 6 8 24 11 25
-15 24 16 23 4 10 23 21 24 15 10 9 26 7 14 24 21 6 20 19 ^
-56 1 17 16 17 1 3 12 1 4 13 3 9 21 23 7 18 11 1 19 20 23 12 12 27 13 13 15 16
-13 1 16 15 12 26 3 16 16 8 17 13 21 4 6 5 19 14 16 4 16 11 14 18 18 27 9 13 22 ^
-51 1 3 26 22 3 7 6 4 26 3 15 8 25 1 20 13 9 11 20 6 11 21 27 25 20 7 4 18 26 16
-27 5 12 19 7 23 6 25 25 2 11 13 25 21 18 17 6 12 14 13 24 13 ^
-48 1 14 19 26 27 25 6 1 15 4 7 27 24 27 21 5 27 19 18 8 21 3 23 20 21 25 21 1 9
-17 22 5 22 8 2 13 27 8 19 27 21 2 5 8 4 27 10 6 25 ^
-52 0 2 6 1 1 26 18 13 5 10 18 10 8 5 21 15 5 14 19 12 4 8 20 21 26 1 12 25 10 2
-17 10 15 2 20 25 26 23 25 12 16 15 9 18 15 19 21 16 26 11 18 20 26 ^
-53 0 6 22 7 8 8 12 2 21 18 12 11 5 19 3 19 27 18 25 22 22 23 16 2 1 20 16 14 22
-6 15 22 1 21 6 6 10 2 26 12 11 6 27 14 7 20 26 20 17 7 19 5 23 14 ^
-61 0 16 12 7 15 17 7 5 11 12 15 7 1 10 10 8 4 2 4 17 4 11 17 26 23 24 4 5 12 5
-1 6 9 6 8 27 5 11 11 24 24 13 17 2 24 26 19 11 22 21 2 2 14 21 13 1 23 10 25 8
-15 13 ^
-52 0 19 23 2 9 26 6 23 13 5 24 12 21 11 14 4 12 10 12 22 4 3 20 17 10 13 16 9
-10 27 9 12 13 20 10 12 23 23 11 19 13 25 22 8 1 5 16 20 9 19 9 24 26 ^
-51 0 12 15 6 21 27 22 26 24 18 9 15 8 22 24 9 27 23 1 13 18 24 1 8 24 8 6 14 1
-4 5 15 27 12 20 1 17 5 4 14 25 14 3 19 24 24 14 8 13 12 19 22 ^
-56 0 3 6 13 7 10 23 19 10 17 17 11 6 13 8 18 6 7 3 25 1 17 8 26 25 11 23 14 27
-1 22 11 9 7 19 4 15 18 2 27 20 11 5 20 22 19 15 5 6 17 8 1 19 22 9 23 17 ^
-50 0 26 27 26 14 12 3 14 15 11 2 12 6 22 20 8 25 4 25 24 23 20 3 3 16 2 2 27 2
-15 14 27 3 17 12 27 27 7 26 2 22 11 9 10 24 15 1 27 11 27 21 ^
-52 0 1 25 25 16 6 2 22 12 17 21 12 8 9 22 17 12 7 18 14 23 2 6 4 23 9 4 22 16
-18 23 8 11 25 17 27 16 10 3 24 8 20 20 18 18 13 4 2 18 22 15 25 10 ^
-52 0 9 3 1 2 19 15 1 24 17 16 18 9 14 11 8 16 19 16 22 10 16 24 25 7 22 12 20
-15 23 22 18 22 14 6 26 21 10 21 7 13 2 16 7 24 16 22 13 10 7 11 16 13 ^
-53 1 9 25 13 9 14 14 17 25 2 10 5 25 5 7 10 22 10 1 24 3 11 7 23 5 17 14 3 18 5
-13 26 15 5 13 23 18 17 3 18 3 27 15 6 25 24 22 27 17 4 25 23 15 15 ^
-52 1 15 21 8 7 7 15 3 13 22 25 3 4 10 24 12 7 16 25 18 21 21 20 27 13 14 23 27
-1 21 9 21 14 22 9 9 5 15 13 17 3 4 9 16 1 8 23 17 23 26 8 24 14 ^
-58 0 20 25 27 3 8 26 8 10 4 3 8 14 5 5 7 11 13 11 26 11 4 26 17 20 19 11 10 3
-10 14 9 6 9 7 16 10 4 4 19 19 2 26 13 19 17 15 24 15 4 21 22 13 13 12 22 2 14
-18 ^
-60 0 5 18 7 17 24 20 13 6 17 9 20 2 10 19 3 22 4 1 11 3 5 3 21 11 15 12 23 26 5
-2 27 6 5 16 6 3 2 23 5 3 20 20 4 24 2 18 21 7 14 10 27 23 6 24 6 19 23 3 9 25 ^
-55 0 16 21 17 19 25 17 7 21 19 6 16 15 15 20 14 2 25 19 14 18 19 7 9 1 14 11 10
-16 3 23 14 26 10 11 1 18 1 12 24 19 19 1 7 2 3 24 7 12 9 2 8 16 20 24 27 ^
-51 1 26 26 4 9 2 7 25 9 8 12 18 14 26 7 17 18 4 20 1 16 14 21 26 4 6 8 24 11 25
-15 24 16 23 4 10 23 21 24 15 10 9 26 7 14 24 21 6 20 5 17 15 ^
-57 0 17 1 3 12 1 4 13 3 9 21 23 7 18 11 1 19 20 23 12 12 27 13 13 15 16 13 1 16
-15 12 26 3 16 16 8 17 13 21 4 6 5 19 14 16 4 16 11 14 18 18 27 9 13 21 3 26 23 ^
-52 0 3 7 6 4 26 3 15 8 25 1 20 13 9 11 20 6 11 21 27 25 20 7 4 18 26 16 27 5 12
-19 7 23 6 25 25 2 11 13 25 21 18 17 6 12 14 13 24 11 14 19 26 12 ^
-55 1 25 6 1 15 4 7 27 24 27 21 5 27 19 18 8 21 3 23 20 21 25 21 1 9 17 22 5 22
-8 2 13 27 8 19 27 21 2 5 8 4 27 10 6 18 2 6 1 1 26 18 13 5 10 18 11 ^
-52 0 8 5 21 15 5 14 19 12 4 8 20 21 26 1 12 25 10 2 17 10 15 2 20 25 26 23 25
-12 16 15 9 18 15 19 21 16 26 11 18 20 6 22 7 8 8 12 2 21 18 12 11 27 ^
-53 1 19 3 19 27 18 25 22 22 23 16 2 1 20 16 14 22 6 15 22 1 21 6 6 10 2 26 12
-11 6 27 14 7 20 26 20 17 7 19 5 23 18 16 12 7 15 17 7 5 11 12 15 7 22 ^
-57 1 10 10 8 4 2 4 17 4 11 17 26 23 24 4 5 12 5 1 6 9 6 8 27 5 11 11 24 24 13
-17 2 24 26 19 11 22 21 2 2 14 21 13 1 23 10 25 8 15 26 19 23 2 9 26 6 23 22 ^
-52 1 5 24 12 21 11 14 4 12 10 12 22 4 3 20 17 10 13 16 9 10 27 9 12 13 20 10 12
-23 23 11 19 13 25 22 8 1 5 16 20 9 19 9 24 20 12 15 6 21 27 22 26 16 ^
-58 0 18 9 15 8 22 24 9 27 23 1 13 18 24 1 8 24 8 6 14 1 4 5 15 27 12 20 1 17 5
-4 14 25 14 3 19 24 24 14 8 13 12 19 8 3 6 13 7 10 23 19 10 17 17 11 6 13 8 22 ^
-55 0 6 7 3 25 1 17 8 26 25 11 23 14 27 1 22 11 9 7 19 4 15 18 2 27 20 11 5 20
-22 19 15 5 6 17 8 1 19 22 9 23 10 26 27 26 14 12 3 14 15 11 2 12 6 22 16 ^
-53 0 8 25 4 25 24 23 20 3 3 16 2 2 27 2 15 14 27 3 17 12 27 27 7 26 2 22 11 9
-10 24 15 1 27 11 27 4 1 25 25 16 6 2 22 12 17 21 12 8 9 22 17 12 18 ^
-54 0 7 18 14 23 2 6 4 23 9 4 22 16 18 23 8 11 25 17 27 16 10 3 24 8 20 20 18 18
-13 4 2 18 22 15 25 26 9 3 1 2 19 15 1 24 17 16 18 9 14 11 8 16 19 27 ^
-52 0 22 10 16 24 25 7 22 12 20 15 23 22 18 22 14 6 26 21 10 21 7 13 2 16 7 24
-16 22 13 10 7 11 16 5 9 25 13 9 14 14 17 25 2 10 5 25 5 7 10 22 10 22 ^
-54 1 24 3 11 7 23 5 17 14 3 18 5 13 26 15 5 13 23 18 17 3 18 3 27 15 6 25 24 22
-27 17 4 25 23 15 9 15 21 8 7 7 15 3 13 22 25 3 4 10 24 12 7 16 25 10 ^
-56 0 21 21 20 27 13 14 23 27 1 21 9 21 14 22 9 9 5 15 13 17 3 4 9 16 1 8 23 17
-23 26 8 24 10 20 25 27 3 8 26 8 10 4 3 8 14 5 5 7 11 13 11 26 11 4 26 2 ^
-61 1 20 19 11 10 3 10 14 9 6 9 7 16 10 4 4 19 19 2 26 13 19 17 15 24 15 4 21 22
-13 13 12 22 2 14 20 5 18 7 17 24 20 13 6 17 9 20 2 10 19 3 22 4 1 11 3 5 3 21
-11 15 22 ^
-53 0 23 26 5 2 27 6 5 16 6 3 2 23 5 3 20 20 4 24 2 18 21 7 14 10 27 23 6 24 6
-19 23 3 9 22 16 21 17 19 25 17 7 21 19 6 16 15 15 20 14 2 25 19 25 ^
-60 0 18 19 7 9 1 14 11 10 16 3 23 14 26 10 11 1 18 1 12 24 19 19 1 7 2 3 24 7
-12 9 2 8 16 20 24 5 26 26 4 9 2 7 25 9 8 12 18 14 26 7 17 18 4 20 1 16 14 21 26
-18 ^
-54 0 6 8 24 11 25 15 24 16 23 4 10 23 21 24 15 10 9 26 7 14 24 21 6 20 5 17 16
-17 1 3 12 1 4 13 3 9 21 23 7 18 11 1 19 20 23 12 12 27 13 13 15 16 13 24 ^
-57 0 1 16 15 12 26 3 16 16 8 17 13 21 4 6 5 19 14 16 4 16 11 14 18 18 27 9 13
-21 3 26 22 3 7 6 4 26 3 15 8 25 1 20 13 9 11 20 6 11 21 27 25 20 7 4 18 26 10 ^
-48 0 27 5 12 19 7 23 6 25 25 2 11 13 25 21 18 17 6 12 14 13 24 11 14 19 26 27
-25 6 1 15 4 7 27 24 27 21 5 27 19 18 8 21 3 23 20 21 25 8 ^
-60 1 1 9 17 22 5 22 8 2 13 27 8 19 27 21 2 5 8 4 27 10 6 18 2 6 1 1 26 18 13 5
-10 18 10 8 5 21 15 5 14 19 12 4 8 20 21 26 1 12 25 10 2 17 10 15 2 20 25 26 23
-21 ^
-54 1 12 16 15 9 18 15 19 21 16 26 11 18 20 6 22 7 8 8 12 2 21 18 12 11 5 19 3
-19 27 18 25 22 22 23 16 2 1 20 16 14 22 6 15 22 1 21 6 6 10 2 26 12 11 24 ^
-60 0 27 14 7 20 26 20 17 7 19 5 23 18 16 12 7 15 17 7 5 11 12 15 7 1 10 10 8 4
-2 4 17 4 11 17 26 23 24 4 5 12 5 1 6 9 6 8 27 5 11 11 24 24 13 17 2 24 26 19 11
-22 ^
-55 0 21 2 2 14 21 13 1 23 10 25 8 15 26 19 23 2 9 26 6 23 13 5 24 12 21 11 14 4
-12 10 12 22 4 3 20 17 10 13 16 9 10 27 9 12 13 20 10 12 23 23 11 19 13 25 13 ^
-55 0 8 1 5 16 20 9 19 9 24 20 12 15 6 21 27 22 26 24 18 9 15 8 22 24 9 27 23 1
-13 18 24 1 8 24 8 6 14 1 4 5 15 27 12 20 1 17 5 4 14 25 14 3 19 24 16 ^
-60 0 14 8 13 12 19 8 3 6 13 7 10 23 19 10 17 17 11 6 13 8 18 6 7 3 25 1 17 8 26
-25 11 23 14 27 1 22 11 9 7 19 4 15 18 2 27 20 11 5 20 22 19 15 5 6 17 8 1 19 22
-10 ^
-55 1 15 9 11 26 19 22 27 2 21 8 20 23 26 12 10 21 9 15 13 25 7 26 1 13 5 9 1 3
-9 21 22 7 1 23 28 1 2 8 22 12 18 28 5 18 14 7 11 17 20 20 7 21 13 8 22 ^
-52 1 21 22 2 16 20 15 28 9 3 22 13 10 23 4 16 11 14 1 10 8 14 14 15 18 13 12 21
-18 25 15 27 17 5 1 23 7 17 20 11 14 10 4 21 17 19 25 17 22 18 21 19 17 ^
-57 0 10 15 26 20 8 13 19 7 8 18 7 12 14 6 8 22 21 11 10 14 23 25 9 15 22 18 6
-17 24 7 13 6 12 7 2 18 18 26 13 13 16 8 24 10 3 26 9 20 1 12 2 14 13 23 12 25 5
-^
-57 0 24 11 6 3 8 27 8 21 26 3 11 19 18 5 5 25 26 24 4 23 15 15 23 21 24 5 15 21
-3 3 18 2 24 27 11 20 10 11 4 5 12 2 23 6 5 3 1 14 26 15 12 6 28 12 19 20 9 ^
-55 0 6 23 4 7 7 3 10 24 28 6 10 9 6 20 14 27 10 19 11 1 15 21 5 10 7 11 8 16 9
-27 5 2 6 6 27 20 24 21 2 20 16 14 24 17 15 3 2 26 25 25 14 24 20 28 28 ^
-59 1 17 5 9 10 25 20 12 9 18 3 16 4 10 7 18 23 17 2 8 1 28 7 2 15 5 18 11 23 2
-1 18 22 14 7 20 21 2 11 12 3 15 12 4 1 27 21 16 27 19 18 13 21 14 5 20 9 19 27
-25 ^
-55 0 3 5 16 16 22 2 13 7 4 13 19 27 15 7 16 25 3 4 4 17 12 13 11 12 26 6 1 10
-15 18 4 19 10 27 9 4 25 13 21 25 26 21 20 12 25 21 7 17 28 27 3 13 14 19 18 ^
-53 1 23 19 4 28 3 20 18 9 7 15 4 26 5 6 20 5 23 28 10 24 19 13 28 1 9 12 23 16
-10 13 2 19 21 6 25 22 28 23 16 7 20 4 2 22 11 26 22 6 9 17 11 21 10 ^
-47 0 1 3 28 11 27 25 12 8 26 26 28 24 13 22 17 6 4 24 15 17 18 4 22 23 9 24 12
-27 27 25 9 13 15 11 9 22 28 26 11 18 15 10 6 16 17 14 24 ^
-55 1 25 27 16 28 22 24 1 1 11 7 24 3 28 7 5 28 16 15 1 7 14 9 7 6 15 25 19 9 3
-19 23 1 26 20 17 17 1 16 24 9 16 8 15 6 21 17 22 9 28 8 8 5 4 24 26 ^
-47 1 14 4 21 26 23 7 8 27 23 23 22 19 24 25 16 19 12 22 10 20 3 7 14 1 20 6 26
-23 27 4 16 20 18 12 20 15 19 16 18 20 27 11 11 17 24 18 16 ^
-50 0 19 1 25 23 2 15 16 26 27 23 14 12 28 22 15 8 19 2 20 13 1 24 2 25 1 6 19
-19 8 11 24 24 21 13 27 5 11 28 17 7 25 6 23 24 14 25 12 5 13 25 ^
-60 0 2 5 8 10 16 11 5 26 18 19 21 3 12 11 13 4 14 22 22 14 16 13 3 22 16 23 5
-19 6 13 10 26 17 27 26 4 3 25 6 14 2 3 5 7 23 11 22 8 25 2 9 25 18 17 8 2 14 4
-19 22 ^
-54 1 5 27 13 9 2 27 28 2 17 23 10 27 18 26 7 22 16 3 27 1 26 21 28 10 3 6 2 2
-10 17 13 16 6 17 21 23 13 20 22 5 6 11 12 12 8 23 13 17 9 23 20 3 28 21 ^
-56 0 12 17 25 28 19 5 21 4 27 8 1 19 14 20 6 7 9 1 6 22 3 19 26 14 8 6 7 19 15
-23 1 17 16 6 26 14 5 22 25 4 7 10 16 21 10 18 19 24 16 23 8 3 17 28 18 13 ^
-58 0 2 5 3 21 21 15 6 24 1 4 24 18 10 22 1 21 12 5 4 4 20 25 24 26 8 25 11 2 7
-27 22 19 4 18 27 10 28 4 12 24 8 16 12 11 16 17 25 8 12 16 1 9 9 10 5 24 23 11 ^
-62 1 5 14 18 8 4 9 5 17 8 28 1 22 4 11 3 2 17 3 14 9 27 13 18 24 9 8 7 28 25 14
-21 27 24 6 18 16 2 12 15 9 14 10 1 8 17 4 6 15 26 11 15 2 28 20 26 16 3 7 5 8 9
-24 ^
-50 1 10 12 25 11 9 13 24 15 20 2 4 8 2 22 20 19 4 15 14 28 13 25 10 10 12 28 24
-22 26 28 15 9 11 26 19 22 27 2 21 8 20 23 26 12 10 21 9 15 13 17 ^
-60 1 7 26 1 13 5 9 1 3 9 21 22 7 1 23 28 1 2 8 22 12 18 28 5 18 14 7 11 17 20
-20 7 21 13 8 28 21 22 2 16 20 15 28 9 3 22 13 10 23 4 16 11 14 1 10 8 14 14 15
-18 17 ^
-52 0 12 21 18 25 15 27 17 5 1 23 7 17 20 11 14 10 4 21 17 19 25 17 22 18 21 19
-17 10 15 26 20 8 13 19 7 8 18 7 12 14 6 8 22 21 11 10 14 23 25 9 15 19 ^
-57 1 18 6 17 24 7 13 6 12 7 2 18 18 26 13 13 16 8 24 10 3 26 9 20 1 12 2 14 13
-23 12 25 3 24 11 6 3 8 27 8 21 26 3 11 19 18 5 5 25 26 24 4 23 15 15 23 21 12 ^
-67 1 5 15 21 3 3 18 2 24 27 11 20 10 11 4 5 12 2 23 6 5 3 1 14 26 15 12 6 28 12
-19 20 6 23 4 7 7 3 10 24 28 6 10 9 6 20 14 27 10 19 11 1 15 21 5 10 7 11 8 16 9
-27 5 2 6 6 27 2 ^
-56 1 24 21 2 20 16 14 24 17 15 3 2 26 25 25 14 24 20 28 14 17 5 9 10 25 20 12 9
-18 3 16 4 10 7 18 23 17 2 8 1 28 7 2 15 5 18 11 23 2 1 18 22 14 7 20 21 24 ^
-60 1 11 12 3 15 12 4 1 27 21 16 27 19 18 13 21 14 5 20 9 19 27 6 3 5 16 16 22 2
-13 7 4 13 19 27 15 7 16 25 3 4 4 17 12 13 11 12 26 6 1 10 15 18 4 19 10 27 9 4
-25 27 ^
-51 0 21 25 26 21 20 12 25 21 7 17 28 27 3 13 14 19 3 23 19 4 28 3 20 18 9 7 15
-4 26 5 6 20 5 23 28 10 24 19 13 28 1 9 12 23 16 10 13 2 19 21 23 ^
-49 1 25 22 28 23 16 7 20 4 2 22 11 26 22 6 9 17 11 21 5 1 3 28 11 27 25 12 8 26
-26 28 24 13 22 17 6 4 24 15 17 18 4 22 23 9 24 12 27 27 9 ^
-56 0 9 13 15 11 9 22 28 26 11 18 15 10 6 16 17 14 11 25 27 16 28 22 24 1 1 11 7
-24 3 28 7 5 28 16 15 1 7 14 9 7 6 15 25 19 9 3 19 23 1 26 20 17 17 1 16 16 ^
-51 0 9 16 8 15 6 21 17 22 9 28 8 8 5 4 24 27 14 4 21 26 23 7 8 27 23 23 22 19
-24 25 16 19 12 22 10 20 3 7 14 1 20 6 26 23 27 4 16 20 18 12 22 ^
-51 0 15 19 16 18 20 27 11 11 17 24 18 1 19 1 25 23 2 15 16 26 27 23 14 12 28 22
-15 8 19 2 20 13 1 24 2 25 1 6 19 19 8 11 24 24 21 13 27 5 11 28 16 ^
-59 0 7 25 6 23 24 14 25 12 5 13 26 2 5 8 10 16 11 5 26 18 19 21 3 12 11 13 4 14
-22 22 14 16 13 3 22 16 23 5 19 6 13 10 26 17 27 26 4 3 25 6 14 2 3 5 7 23 11 22
-10 ^
-59 0 25 2 9 25 18 17 8 2 14 4 19 1 5 27 13 9 2 27 28 2 17 23 10 27 18 26 7 22
-16 3 27 1 26 21 28 10 3 6 2 2 10 17 13 16 6 17 21 23 13 20 22 5 6 11 12 12 8 23
-7 ^
-56 1 17 9 23 20 3 28 27 12 17 25 28 19 5 21 4 27 8 1 19 14 20 6 7 9 1 6 22 3 19
-26 14 8 6 7 19 15 23 1 17 16 6 26 14 5 22 25 4 7 10 16 21 10 18 19 24 16 ^
-57 1 23 8 3 17 28 18 10 2 5 3 21 21 15 6 24 1 4 24 18 10 22 1 21 12 5 4 4 20 25
-24 26 8 25 11 2 7 27 22 19 4 18 27 10 28 4 12 24 8 16 12 11 16 17 25 8 12 18 ^
-63 0 1 9 9 10 5 24 23 18 5 14 18 8 4 9 5 17 8 28 1 22 4 11 3 2 17 3 14 9 27 13
-18 24 9 8 7 28 25 14 21 27 24 6 18 16 2 12 15 9 14 10 1 8 17 4 6 15 26 11 15 2
-28 20 16 ^
-52 1 16 3 7 5 8 9 26 10 12 25 11 9 13 24 15 20 2 4 8 2 22 20 19 4 15 14 28 13
-25 10 10 12 28 24 22 26 28 15 9 11 26 19 22 27 2 21 8 20 23 26 12 28 ^
-60 0 21 9 15 13 25 7 26 1 13 5 9 1 3 9 21 22 7 1 23 28 1 2 8 22 12 18 28 5 18
-14 7 11 17 20 20 7 21 13 8 28 21 22 2 16 20 15 28 9 3 22 13 10 23 4 16 11 14 1
-10 20 ^
-54 1 14 14 15 18 13 12 21 18 25 15 27 17 5 1 23 7 17 20 11 14 10 4 21 17 19 25
-17 22 18 21 19 17 10 15 26 20 8 13 19 7 8 18 7 12 14 6 8 22 21 11 10 14 23 11 ^
-58 0 9 15 22 18 6 17 24 7 13 6 12 7 2 18 18 26 13 13 16 8 24 10 3 26 9 20 1 12
-2 14 13 23 12 25 3 24 11 6 3 8 27 8 21 26 3 11 19 18 5 5 25 26 24 4 23 15 15 27
-^
-64 1 21 24 5 15 21 3 3 18 2 24 27 11 20 10 11 4 5 12 2 23 6 5 3 1 14 26 15 12 6
-28 12 19 20 6 23 4 7 7 3 10 24 28 6 10 9 6 20 14 27 10 19 11 1 15 21 5 10 7 11
-8 16 9 27 20 ^
-58 1 2 6 6 27 20 24 21 2 20 16 14 24 17 15 3 2 26 25 25 14 24 20 28 14 17 5 9
-10 25 20 12 9 18 3 16 4 10 7 18 23 17 2 8 1 28 7 2 15 5 18 11 23 2 1 18 22 14
-28 ^
-62 0 20 21 2 11 12 3 15 12 4 1 27 21 16 27 19 18 13 21 14 5 20 9 19 27 6 3 5 16
-16 22 2 13 7 4 13 19 27 15 7 16 25 3 4 4 17 12 13 11 12 26 6 1 10 15 18 4 19 10
-27 9 4 26 ^
-52 0 13 21 25 26 21 20 12 25 21 7 17 28 27 3 13 14 19 3 23 19 4 28 3 20 18 9 7
-15 4 26 5 6 20 5 23 28 10 24 19 13 28 1 9 12 23 16 10 13 2 19 21 27 ^
-49 1 25 22 28 23 16 7 20 4 2 22 11 26 22 6 9 17 11 21 5 1 3 28 11 27 25 12 8 26
-26 28 24 13 22 17 6 4 24 15 17 18 4 22 23 9 24 12 27 27 26 ^
-57 0 9 13 15 11 9 22 28 26 11 18 15 10 6 16 17 14 11 25 27 16 28 22 24 1 1 11 7
-24 3 28 7 5 28 16 15 1 7 14 9 7 6 15 25 19 9 3 19 23 1 26 20 17 17 1 16 24 9 ^
-52 1 9 16 8 15 6 21 17 22 9 28 8 8 5 4 24 27 14 4 21 26 23 7 8 27 23 23 22 19
-24 25 16 19 12 22 10 20 3 7 14 1 20 6 26 23 27 4 16 20 18 12 20 19 ^
-52 1 19 16 18 20 27 11 11 17 24 18 1 19 1 25 23 2 15 16 26 27 23 14 12 28 22 15
-8 19 2 20 13 1 24 2 25 1 6 19 19 8 11 24 24 21 13 27 5 11 28 17 7 24 ^
-59 0 6 23 24 14 25 12 5 13 26 2 5 8 10 16 11 5 26 18 19 21 3 12 11 13 4 14 22
-22 14 16 13 3 22 16 23 5 19 6 13 10 26 17 27 26 4 3 25 6 14 2 3 5 7 23 11 22 8
-25 26 ^
-59 0 9 25 18 17 8 2 14 4 19 1 5 27 13 9 2 27 28 2 17 23 10 27 18 26 7 22 16 3
-27 1 26 21 28 10 3 6 2 2 10 17 13 16 6 17 21 23 13 20 22 5 6 11 12 12 8 23 13
-17 21 ^
-56 1 23 20 3 28 27 12 17 25 28 19 5 21 4 27 8 1 19 14 20 6 7 9 1 6 22 3 19 26
-14 8 6 7 19 15 23 1 17 16 6 26 14 5 22 25 4 7 10 16 21 10 18 19 24 16 23 20 ^
-60 0 3 17 28 18 10 2 5 3 21 21 15 6 24 1 4 24 18 10 22 1 21 12 5 4 4 20 25 24
-26 8 25 11 2 7 27 22 19 4 18 27 10 28 4 12 24 8 16 12 11 16 17 25 8 12 16 1 9 9
-10 21 ^
-60 0 24 23 18 5 14 18 8 4 9 5 17 8 28 1 22 4 11 3 2 17 3 14 9 27 13 18 24 9 8 7
-28 25 14 21 27 24 6 18 16 2 12 15 9 14 10 1 8 17 4 6 15 26 11 15 2 28 20 26 16
-25 ^
-53 1 7 5 8 9 26 10 12 25 11 9 13 24 15 20 2 4 8 2 22 20 19 4 15 14 28 13 25 10
-10 12 28 24 22 26 28 15 9 11 26 19 22 27 2 21 8 20 23 26 12 10 21 9 24 ^
-62 1 13 25 7 26 1 13 5 9 1 3 9 21 22 7 1 23 28 1 2 8 22 12 18 28 5 18 14 7 11
-17 20 20 7 21 13 8 28 21 22 2 16 20 15 28 9 3 22 13 10 23 4 16 11 14 1 10 8 14
-14 15 18 13 ^
-54 0 12 21 18 25 15 27 17 5 1 23 7 17 20 11 14 10 4 21 17 19 25 17 22 18 21 19
-17 10 15 26 20 8 13 19 7 8 18 7 12 14 6 8 22 21 11 10 14 23 25 9 15 22 18 13 ^
-58 0 17 24 7 13 6 12 7 2 18 18 26 13 13 16 8 24 10 3 26 9 20 1 12 2 14 13 23 12
-25 3 24 11 6 3 8 27 8 21 26 3 11 19 18 5 5 25 26 24 4 23 15 15 23 21 24 5 15 26
-^
-67 1 3 3 18 2 24 27 11 20 10 11 4 5 12 2 23 6 5 3 1 14 26 15 12 6 28 12 19 20 6
-23 4 7 7 3 10 24 28 6 10 9 6 20 14 27 10 19 11 1 15 21 5 10 7 11 8 16 9 27 5 2
-6 6 27 20 24 21 12 ^
-62 0 20 16 14 24 17 15 3 2 26 25 25 14 24 20 28 14 17 5 9 10 25 20 12 9 18 3 16
-4 10 7 18 23 17 2 8 1 28 7 2 15 5 18 11 23 2 1 18 22 14 7 20 21 2 11 12 3 15 12
-4 1 27 18 ^
-61 1 4 9 14 16 15 8 11 21 20 10 10 21 23 20 2 11 23 1 11 1 5 3 23 16 15 27 14 5
-16 3 22 2 3 24 3 19 29 4 4 10 8 20 14 15 1 26 12 27 25 4 28 22 11 19 19 24 5 20
-8 9 26 ^
-55 1 25 19 17 19 15 7 24 24 21 3 20 16 8 3 17 28 18 29 9 23 9 10 29 4 12 24 15
-5 8 22 17 29 12 3 8 29 15 21 21 4 7 20 7 10 7 26 10 16 24 6 7 12 8 12 28 ^
-52 1 24 9 17 11 28 12 26 26 6 29 13 10 20 6 23 10 4 3 26 26 14 20 20 25 14 13
-15 24 14 11 4 23 27 24 20 9 16 17 24 13 12 6 1 14 26 25 7 8 21 1 19 27 ^
-65 0 3 2 2 17 21 13 5 9 21 28 9 1 13 2 21 8 24 1 3 27 13 18 19 4 15 12 5 2 16
-27 16 6 2 1 23 17 14 28 19 23 6 22 16 4 19 6 16 28 3 3 1 15 13 22 6 15 11 6 4
-24 25 15 19 23 12 ^
-55 0 1 9 15 10 12 7 25 11 25 2 27 6 6 18 4 13 1 4 11 25 17 6 29 21 24 27 21 17
-17 26 24 13 4 22 24 29 2 11 8 17 4 23 11 26 1 25 28 15 19 10 3 9 29 27 24 ^
-53 1 22 3 27 21 2 26 19 9 19 27 23 3 12 17 10 4 8 27 19 16 1 21 23 28 23 18 8
-25 18 26 20 8 17 19 2 4 11 7 18 6 24 2 25 25 5 27 20 3 28 20 18 21 11 ^
-55 0 25 10 1 28 28 29 16 20 19 26 16 21 6 23 15 28 26 28 7 15 18 11 5 17 20 26
-1 10 14 8 4 16 26 17 8 10 22 22 18 1 20 24 7 1 9 7 19 5 22 1 4 26 11 10 20 ^
-58 0 5 14 2 6 4 2 9 22 15 13 20 22 26 18 16 9 2 15 20 27 8 6 17 5 15 9 25 10 26
-4 5 27 5 19 21 5 6 11 29 19 8 2 24 26 22 19 18 17 23 14 21 14 22 13 20 5 29 12 ^
-54 0 5 26 6 21 29 3 5 12 16 11 13 16 18 18 10 11 20 21 12 11 12 22 14 19 3 21
-15 6 25 26 29 24 19 17 18 25 22 12 13 23 23 12 10 13 1 22 10 2 22 2 28 10 17 28
-^
-56 0 3 6 19 28 17 11 1 9 14 4 29 29 23 25 13 19 18 2 7 21 6 8 29 5 11 22 14 14
-9 28 13 25 24 28 8 14 9 3 14 18 26 9 9 12 13 17 25 16 5 8 4 24 10 24 23 25 ^
-49 0 29 21 9 18 28 25 11 3 16 4 21 25 3 4 18 12 12 29 26 13 26 23 26 7 23 10 9
-27 26 21 25 21 18 9 24 16 22 5 21 7 7 27 4 20 23 13 27 10 27 ^
-58 1 29 7 19 13 13 8 19 20 18 2 19 22 29 3 10 6 9 13 24 17 16 9 20 21 27 2 19 7
-8 26 25 12 2 14 3 1 1 16 12 20 28 24 12 5 24 25 20 1 12 25 9 2 6 20 15 14 29 20
-^
-56 0 21 28 1 17 6 17 27 1 2 10 16 19 5 14 10 27 11 17 3 29 14 27 17 5 2 18 20
-11 27 18 22 27 22 9 8 18 3 14 10 5 2 24 18 23 21 26 8 22 8 1 6 27 27 15 29 18 ^
-64 0 2 29 22 8 16 20 4 12 9 6 12 16 16 7 9 20 29 11 9 4 1 15 25 16 29 10 22 7 2
-8 5 18 14 23 24 4 6 26 3 11 6 12 1 7 14 24 14 6 10 21 16 23 29 25 6 14 17 2 12
-10 5 10 15 25 ^
-62 1 8 15 3 7 13 25 16 14 1 29 22 26 15 27 9 1 8 8 28 6 13 5 13 3 15 5 23 8 23
-2 5 5 4 17 13 14 7 17 12 27 3 18 5 7 5 26 18 15 22 28 16 13 7 2 23 19 25 29 17
-7 16 22 ^
-55 1 23 11 11 15 2 13 9 26 2 24 26 7 28 11 2 29 7 22 23 5 28 19 1 27 29 1 24 11
-18 20 3 13 11 7 3 15 17 24 1 18 13 6 3 25 27 16 28 18 24 8 23 7 29 28 15 ^
-52 0 28 14 12 28 27 22 4 14 25 1 3 9 7 11 14 15 16 10 19 12 19 11 20 13 28 4 27
-28 7 27 12 4 28 21 17 22 20 17 15 15 23 22 13 12 21 22 21 11 12 14 12 28 ^
-62 0 27 8 7 4 9 14 16 15 8 11 21 20 10 10 21 23 20 2 11 23 1 11 1 5 3 23 16 15
-27 14 5 16 3 22 2 3 24 3 19 29 4 4 10 8 20 14 15 1 26 12 27 25 4 28 22 11 19 19
-24 5 20 18 ^
-58 0 9 5 25 19 17 19 15 7 24 24 21 3 20 16 8 3 17 28 18 29 9 23 9 10 29 4 12 24
-15 5 8 22 17 29 12 3 8 29 15 21 21 4 7 20 7 10 7 26 10 16 24 6 7 12 8 12 15 16 ^
-56 0 9 17 11 28 12 26 26 6 29 13 10 20 6 23 10 4 3 26 26 14 20 20 25 14 13 15
-24 14 11 4 23 27 24 20 9 16 17 24 13 12 6 1 14 26 25 7 8 21 1 19 3 2 2 17 21 23
-^
-64 1 5 9 21 28 9 1 13 2 21 8 24 1 3 27 13 18 19 4 15 12 5 2 16 27 16 6 2 1 23
-17 14 28 19 23 6 22 16 4 19 6 16 28 3 3 1 15 13 22 6 15 11 6 4 24 25 15 19 23
-28 1 9 15 10 24 ^
-54 0 7 25 11 25 2 27 6 6 18 4 13 1 4 11 25 17 6 29 21 24 27 21 17 17 26 24 13 4
-22 24 29 2 11 8 17 4 23 11 26 1 25 28 15 19 10 3 9 29 27 7 22 3 27 29 ^
-54 1 2 26 19 9 19 27 23 3 12 17 10 4 8 27 19 16 1 21 23 28 23 18 8 25 18 26 20
-8 17 19 2 4 11 7 18 6 24 2 25 25 5 27 20 3 28 20 18 21 10 25 10 1 28 27 ^
-60 0 29 16 20 19 26 16 21 6 23 15 28 26 28 7 15 18 11 5 17 20 26 1 10 14 8 4 16
-26 17 8 10 22 22 18 1 20 24 7 1 9 7 19 5 22 1 4 26 11 10 28 5 14 2 6 4 2 9 22
-15 22 ^
-54 1 20 22 26 18 16 9 2 15 20 27 8 6 17 5 15 9 25 10 26 4 5 27 5 19 21 5 6 11
-29 19 8 2 24 26 22 19 18 17 23 14 21 14 22 13 20 5 29 6 5 26 6 21 29 28 ^
-57 1 5 12 16 11 13 16 18 18 10 11 20 21 12 11 12 22 14 19 3 21 15 6 25 26 29 24
-19 17 18 25 22 12 13 23 23 12 10 13 1 22 10 2 22 2 28 10 17 18 3 6 19 28 17 11
-1 9 23 ^
-54 0 14 4 29 29 23 25 13 19 18 2 7 21 6 8 29 5 11 22 14 14 9 28 13 25 24 28 8
-14 9 3 14 18 26 9 9 12 13 17 25 16 5 8 4 24 10 24 23 4 29 21 9 18 28 27 ^
-52 1 11 3 16 4 21 25 3 4 18 12 12 29 26 13 26 23 26 7 23 10 9 27 26 21 25 21 18
-9 24 16 22 5 21 7 7 27 4 20 23 13 27 10 23 29 7 19 13 13 8 19 20 23 ^
-61 0 2 19 22 29 3 10 6 9 13 24 17 16 9 20 21 27 2 19 7 8 26 25 12 2 14 3 1 1 16
-12 20 28 24 12 5 24 25 20 1 12 25 9 2 6 20 15 14 29 18 21 28 1 17 6 17 27 1 2
-10 16 19 ^
-57 1 5 14 10 27 11 17 3 29 14 27 17 5 2 18 20 11 27 18 22 27 22 9 8 18 3 14 10
-5 2 24 18 23 21 26 8 22 8 1 6 27 27 15 29 20 2 29 22 8 16 20 4 12 9 6 12 16 24 ^
-64 0 7 9 20 29 11 9 4 1 15 25 16 29 10 22 7 2 8 5 18 14 23 24 4 6 26 3 11 6 12
-1 7 14 24 14 6 10 21 16 23 29 25 6 14 17 2 12 10 5 10 15 25 8 15 3 7 13 25 16
-14 1 29 22 26 10 ^
-63 1 27 9 1 8 8 28 6 13 5 13 3 15 5 23 8 23 2 5 5 4 17 13 14 7 17 12 27 3 18 5
-7 5 26 18 15 22 28 16 13 7 2 23 19 25 29 17 7 16 25 23 11 11 15 2 13 9 26 2 24
-26 7 28 11 ^
-56 1 2 29 7 22 23 5 28 19 1 27 29 1 24 11 18 20 3 13 11 7 3 15 17 24 1 18 13 6
-3 25 27 16 28 18 24 8 23 7 29 28 6 28 14 12 28 27 22 4 14 25 1 3 9 7 11 29 ^
-54 0 15 16 10 19 12 19 11 20 13 28 4 27 28 7 27 12 4 28 21 17 22 20 17 15 15 23
-22 13 12 21 22 21 11 12 14 12 18 27 8 7 4 9 14 16 15 8 11 21 20 10 10 21 23 22 ^
-63 0 2 11 23 1 11 1 5 3 23 16 15 27 14 5 16 3 22 2 3 24 3 19 29 4 4 10 8 20 14
-15 1 26 12 27 25 4 28 22 11 19 19 24 5 20 8 9 5 25 19 17 19 15 7 24 24 21 3 20
-16 8 3 17 19 ^
-59 0 18 29 9 23 9 10 29 4 12 24 15 5 8 22 17 29 12 3 8 29 15 21 21 4 7 20 7 10
-7 26 10 16 24 6 7 12 8 12 15 24 9 17 11 28 12 26 26 6 29 13 10 20 6 23 10 4 3
-26 10 ^
-62 0 14 20 20 25 14 13 15 24 14 11 4 23 27 24 20 9 16 17 24 13 12 6 1 14 26 25
-7 8 21 1 19 3 2 2 17 21 13 5 9 21 28 9 1 13 2 21 8 24 1 3 27 13 18 19 4 15 12 5
-2 16 27 29 ^
-62 0 6 2 1 23 17 14 28 19 23 6 22 16 4 19 6 16 28 3 3 1 15 13 22 6 15 11 6 4 24
-25 15 19 23 28 1 9 15 10 12 7 25 11 25 2 27 6 6 18 4 13 1 4 11 25 17 6 29 21 24
-27 21 18 ^
-54 1 17 26 24 13 4 22 24 29 2 11 8 17 4 23 11 26 1 25 28 15 19 10 3 9 29 27 7
-22 3 27 21 2 26 19 9 19 27 23 3 12 17 10 4 8 27 19 16 1 21 23 28 23 18 17 ^
-52 0 25 18 26 20 8 17 19 2 4 11 7 18 6 24 2 25 25 5 27 20 3 28 20 18 21 10 25
-10 1 28 28 29 16 20 19 26 16 21 6 23 15 28 26 28 7 15 18 11 5 17 20 13 ^
-68 0 1 10 14 8 4 16 26 17 8 10 22 22 18 1 20 24 7 1 9 7 19 5 22 1 4 26 11 10 28
-5 14 2 6 4 2 9 22 15 13 20 22 26 18 16 9 2 15 20 27 8 6 17 5 15 9 25 10 26 4 5
-27 5 19 21 5 6 11 19 ^
-54 1 19 8 2 24 26 22 19 18 17 23 14 21 14 22 13 20 5 29 6 5 26 6 21 29 3 5 12
-16 11 13 16 18 18 10 11 20 21 12 11 12 22 14 19 3 21 15 6 25 26 29 24 19 17 24 ^
-59 0 25 22 12 13 23 23 12 10 13 1 22 10 2 22 2 28 10 17 18 3 6 19 28 17 11 1 9
-14 4 29 29 23 25 13 19 18 2 7 21 6 8 29 5 11 22 14 14 9 28 13 25 24 28 8 14 9 3
-14 16 ^
-53 0 26 9 9 12 13 17 25 16 5 8 4 24 10 24 23 4 29 21 9 18 28 25 11 3 16 4 21 25
-3 4 18 12 12 29 26 13 26 23 26 7 23 10 9 27 26 21 25 21 18 9 24 16 17 ^
-59 0 5 21 7 7 27 4 20 23 13 27 10 23 29 7 19 13 13 8 19 20 18 2 19 22 29 3 10 6
-9 13 24 17 16 9 20 21 27 2 19 7 8 26 25 12 2 14 3 1 1 16 12 20 28 24 12 5 24 25
-19 ^
-60 0 1 12 25 9 2 6 20 15 14 29 18 21 28 1 17 6 17 27 1 2 10 16 19 5 14 10 27 11
-17 3 29 14 27 17 5 2 18 20 11 27 18 22 27 22 9 8 18 3 14 10 5 2 24 18 23 21 26
-8 22 13 ^
-62 0 1 6 27 27 15 29 20 2 29 22 8 16 20 4 12 9 6 12 16 16 7 9 20 29 11 9 4 1 15
-25 16 29 10 22 7 2 8 5 18 14 23 24 4 6 26 3 11 6 12 1 7 14 24 14 6 10 21 16 23
-29 25 24 ^
-67 0 14 17 2 12 10 5 10 15 25 8 15 3 7 13 25 16 14 1 29 22 26 15 27 9 1 8 8 28
-6 13 5 13 3 15 5 23 8 23 2 5 5 4 17 13 14 7 17 12 27 3 18 5 7 5 26 18 15 22 28
-16 13 7 2 23 19 25 14 ^
-58 1 17 7 16 25 23 11 11 15 2 13 9 26 2 24 26 7 28 11 2 29 7 22 23 5 28 19 1 27
-29 1 24 11 18 20 3 13 11 7 3 15 17 24 1 18 13 6 3 25 27 16 28 18 24 8 23 7 29
-11 ^
-55 0 6 28 14 12 28 27 22 4 14 25 1 3 9 7 11 14 15 16 10 19 12 19 11 20 13 28 4
-27 28 7 27 12 4 28 21 17 22 20 17 15 15 23 22 13 12 21 22 21 11 12 14 12 18 27
-10 ^
-65 0 7 4 9 14 16 15 8 11 21 20 10 10 21 23 20 2 11 23 1 11 1 5 3 23 16 15 27 14
-5 16 3 22 2 3 24 3 19 29 4 4 10 8 20 14 15 1 26 12 27 25 4 28 22 11 19 19 24 5
-20 8 9 5 25 19 20 ^
-59 1 19 15 7 24 24 21 3 20 16 8 3 17 28 18 29 9 23 9 10 29 4 12 24 15 5 8 22 17
-29 12 3 8 29 15 21 21 4 7 20 7 10 7 26 10 16 24 6 7 12 8 12 15 24 9 17 11 28 12
-23 ^
-61 0 26 6 29 13 10 20 6 23 10 4 3 26 26 14 20 20 25 14 13 15 24 14 11 4 23 27
-24 20 9 16 17 24 13 12 6 1 14 26 25 7 8 21 1 19 3 2 2 17 21 13 5 9 21 28 9 1 13
-2 21 8 29 ^
-68 0 1 3 27 13 18 19 4 15 12 5 2 16 27 16 6 2 1 23 17 14 28 19 23 6 22 16 4 19
-6 16 28 3 3 1 15 13 22 6 15 11 6 4 24 25 15 19 23 28 1 9 15 10 12 7 25 11 25 2
-27 6 6 18 4 13 1 4 11 26 ^
-54 1 17 6 29 21 24 27 21 17 17 26 24 13 4 22 24 29 2 11 8 17 4 23 11 26 1 25 28
-15 19 10 3 9 29 27 7 22 3 27 21 2 26 19 9 19 27 23 3 12 17 10 4 8 27 20 ^
-52 1 16 1 21 23 28 23 18 8 25 18 26 20 8 17 19 2 4 11 7 18 6 24 2 25 25 5 27 20
-3 28 20 18 21 10 25 10 1 28 28 29 16 20 19 26 16 21 6 23 15 28 26 12 ^
-67 0 7 15 18 11 5 17 20 26 1 10 14 8 4 16 26 17 8 10 22 22 18 1 20 24 7 1 9 7
-19 5 22 1 4 26 11 10 28 5 14 2 6 4 2 9 22 15 13 20 22 26 18 16 9 2 15 20 27 8 6
-17 5 15 9 25 10 26 19 ^
-58 0 5 27 5 19 21 5 6 11 29 19 8 2 24 26 22 19 18 17 23 14 21 14 22 13 20 5 29
-6 5 26 6 21 29 3 5 12 16 11 13 16 18 18 10 11 20 21 12 11 12 22 14 19 3 21 15 6
-25 27 ^
-57 0 29 24 19 17 18 25 22 12 13 23 23 12 10 13 1 22 10 2 22 2 28 10 17 18 3 6
-19 28 17 11 1 9 14 4 29 29 23 25 13 19 18 2 7 21 6 8 29 5 11 22 14 14 9 28 13
-25 25 ^
-52 0 15 29 9 28 20 2 30 26 21 17 8 28 17 22 29 24 8 11 18 29 15 6 7 27 27 17 24
-18 23 11 19 8 30 5 24 22 12 25 15 28 23 5 10 21 5 8 7 3 10 19 17 18 ^
-62 0 9 15 29 10 7 4 1 16 21 16 29 13 18 5 3 8 15 8 21 29 20 5 27 2 13 27 7 7 30
-2 18 26 10 2 5 29 21 15 25 26 24 8 12 20 3 9 10 30 7 12 24 5 13 1 6 10 25 13 9
-29 30 7 ^
-62 0 29 17 26 6 25 4 7 25 8 15 26 30 11 2 9 6 22 6 21 28 3 3 6 12 13 15 7 17 16
-26 3 19 3 5 2 29 16 16 22 26 13 12 9 19 16 27 25 16 7 15 22 22 5 6 13 4 12 11
-27 5 19 15 ^
-57 0 9 30 9 1 28 3 21 22 7 17 2 25 1 28 21 11 17 20 28 12 10 10 3 15 13 20 1 20
-11 1 30 22 23 15 26 12 21 7 27 9 27 29 5 26 16 11 23 28 18 1 13 23 30 6 3 11 25
-^
-61 1 16 10 13 13 19 15 18 7 22 10 29 3 25 30 8 22 13 4 4 27 22 18 21 23 17 15
-16 19 20 17 10 17 21 20 6 14 14 1 10 18 4 5 5 9 17 18 14 5 12 22 22 11 8 18 24
-21 3 7 21 9 22 ^
-58 1 3 4 23 14 17 25 27 10 5 16 30 23 2 4 25 3 16 28 4 6 6 17 12 18 2 23 7 29
-23 29 27 19 7 20 21 25 5 17 9 7 1 21 20 19 29 19 14 8 23 23 19 3 18 17 3 29 14
-17 ^
-62 1 23 28 5 22 8 10 1 1 11 27 18 3 2 22 28 14 24 12 1 3 30 29 11 22 19 7 16 1
-11 4 28 8 20 25 2 6 8 5 14 11 21 9 16 8 25 6 26 27 1 29 12 8 16 4 17 5 30 30 24
-12 19 21 ^
-57 1 25 11 13 12 27 16 14 3 24 20 24 23 22 9 14 19 26 8 13 6 13 25 19 5 1 19 1
-17 28 30 13 21 11 4 10 23 25 7 5 11 20 7 24 29 27 13 16 17 1 15 12 29 4 16 27
-12 21 ^
-65 0 2 2 24 17 13 22 20 22 4 20 16 2 17 3 11 29 1 5 10 14 23 3 14 9 2 7 18 20
-13 2 16 25 24 4 4 14 7 13 8 20 12 23 1 26 7 9 19 6 16 3 8 26 21 10 26 23 24 28
-16 12 14 25 22 16 15 ^
-53 0 21 24 27 30 15 10 15 2 18 13 26 28 23 16 23 10 2 11 26 26 4 29 18 4 24 24
-1 24 13 5 21 29 26 2 10 16 6 5 7 23 19 11 28 22 21 1 24 19 7 26 18 30 26 ^
-58 0 21 6 18 22 2 1 14 2 14 5 25 1 27 24 6 23 16 5 1 20 29 22 25 9 25 10 3 28
-28 25 19 18 16 24 14 15 5 28 12 28 26 29 2 15 15 9 5 18 19 22 12 15 4 6 15 24
-16 22 ^
-59 0 4 26 25 18 27 19 20 4 26 12 3 22 1 22 30 3 28 10 9 24 14 29 6 30 3 10 20
-14 6 3 19 21 21 28 16 18 11 30 11 20 30 1 9 8 11 5 19 10 24 4 22 4 2 26 5 15 20
-8 25 ^
-55 1 13 30 18 8 1 25 28 20 20 15 21 18 18 12 16 13 24 9 21 2 28 6 1 23 9 18 27
-27 4 9 13 10 8 14 16 15 12 11 14 21 14 10 11 25 17 17 30 21 13 27 26 26 22 14
-21 ^
-57 0 17 21 19 9 9 20 23 13 7 10 28 24 10 22 27 23 27 8 17 14 6 4 21 26 15 1 8
-29 27 6 28 15 3 27 25 25 14 19 13 29 8 24 2 8 2 4 12 19 11 10 6 26 14 22 24 30
-2 ^
-56 1 11 12 2 12 17 23 8 8 12 28 13 14 28 2 17 4 8 3 26 9 23 21 30 30 20 4 13 28
-29 9 3 17 7 19 30 28 1 2 20 9 12 24 15 30 20 27 3 23 11 6 29 25 23 26 17 23 ^
-61 1 10 22 15 23 6 25 5 4 30 2 19 23 15 27 14 26 1 1 7 19 12 7 6 20 18 14 4 15
-17 28 7 11 7 8 9 22 17 12 5 23 18 25 18 6 12 26 30 12 30 14 3 1 18 10 20 27 21
-8 6 24 30 ^
-54 0 20 11 24 7 2 4 18 15 14 30 16 19 2 27 15 4 19 25 29 29 7 14 18 9 11 9 27
-11 15 29 9 28 20 2 30 26 21 17 8 28 17 22 29 24 8 11 18 29 15 6 7 27 27 7 ^
-63 1 24 18 23 11 19 8 30 5 24 22 12 25 15 28 23 5 10 21 5 8 7 3 10 19 17 6 9 15
-29 10 7 4 1 16 21 16 29 13 18 5 3 8 15 8 21 29 20 5 27 2 13 27 7 7 30 2 18 26
-10 2 5 29 12 ^
-63 1 15 25 26 24 8 12 20 3 9 10 30 7 12 24 5 13 1 6 10 25 13 9 29 30 17 29 17
-26 6 25 4 7 25 8 15 26 30 11 2 9 6 22 6 21 28 3 3 6 12 13 15 7 17 16 26 3 19 3
-5 2 29 16 17 ^
-60 1 22 26 13 12 9 19 16 27 25 16 7 15 22 22 5 6 13 4 12 11 27 5 19 28 9 30 9 1
-28 3 21 22 7 17 2 25 1 28 21 11 17 20 28 12 10 10 3 15 13 20 1 20 11 1 30 22 23
-15 26 6 ^
-56 0 21 7 27 9 27 29 5 26 16 11 23 28 18 1 13 23 30 6 3 11 11 16 10 13 13 19 15
-18 7 22 10 29 3 25 30 8 22 13 4 4 27 22 18 21 23 17 15 16 19 20 17 10 17 21 20
-11 ^
-64 1 14 14 1 10 18 4 5 5 9 17 18 14 5 12 22 22 11 8 18 24 21 3 7 21 9 4 3 4 23
-14 17 25 27 10 5 16 30 23 2 4 25 3 16 28 4 6 6 17 12 18 2 23 7 29 23 29 27 19 7
-20 21 25 5 30 ^
-63 1 9 7 1 21 20 19 29 19 14 8 23 23 19 3 18 17 3 29 14 27 23 28 5 22 8 10 1 1
-11 27 18 3 2 22 28 14 24 12 1 3 30 29 11 22 19 7 16 1 11 4 28 8 20 25 2 6 8 5
-14 11 21 9 29 ^
-57 0 8 25 6 26 27 1 29 12 8 16 4 17 5 30 30 24 12 19 24 25 11 13 12 27 16 14 3
-24 20 24 23 22 9 14 19 26 8 13 6 13 25 19 5 1 19 1 17 28 30 13 21 11 4 10 23 25
-6 ^
-68 0 5 11 20 7 24 29 27 13 16 17 1 15 12 29 4 16 27 12 6 2 2 24 17 13 22 20 22
-4 20 16 2 17 3 11 29 1 5 10 14 23 3 14 9 2 7 18 20 13 2 16 25 24 4 4 14 7 13 8
-20 12 23 1 26 7 9 19 6 30 ^
-54 1 3 8 26 21 10 26 23 24 28 16 12 14 25 22 16 2 21 24 27 30 15 10 15 2 18 13
-26 28 23 16 23 10 2 11 26 26 4 29 18 4 24 24 1 24 13 5 21 29 26 2 10 16 6 27 ^
-56 0 7 23 19 11 28 22 21 1 24 19 7 26 18 30 25 21 6 18 22 2 1 14 2 14 5 25 1 27
-24 6 23 16 5 1 20 29 22 25 9 25 10 3 28 28 25 19 18 16 24 14 15 5 28 12 28 9 ^
-58 0 29 2 15 15 9 5 18 19 22 12 15 4 6 15 24 16 9 4 26 25 18 27 19 20 4 26 12 3
-22 1 22 30 3 28 10 9 24 14 29 6 30 3 10 20 14 6 3 19 21 21 28 16 18 11 30 11 20
-29 ^
-65 0 1 9 8 11 5 19 10 24 4 22 4 2 26 5 15 20 8 3 13 30 18 8 1 25 28 20 20 15 21
-18 18 12 16 13 24 9 21 2 28 6 1 23 9 18 27 27 4 9 13 10 8 14 16 15 12 11 14 21
-14 10 11 25 17 17 20 ^
-55 0 21 13 27 26 26 22 14 13 17 21 19 9 9 20 23 13 7 10 28 24 10 22 27 23 27 8
-17 14 6 4 21 26 15 1 8 29 27 6 28 15 3 27 25 25 14 19 13 29 8 24 2 8 2 4 30 ^
-57 1 19 11 10 6 26 14 22 24 30 10 11 12 2 12 17 23 8 8 12 28 13 14 28 2 17 4 8
-3 26 9 23 21 30 30 20 4 13 28 29 9 3 17 7 19 30 28 1 2 20 9 12 24 15 30 20 27
-30 ^
-59 0 23 11 6 29 25 23 26 17 20 10 22 15 23 6 25 5 4 30 2 19 23 15 27 14 26 1 1
-7 19 12 7 6 20 18 14 4 15 17 28 7 11 7 8 9 22 17 12 5 23 18 25 18 6 12 26 30 12
-30 18 ^
-56 0 3 1 18 10 20 27 21 8 6 24 26 20 11 24 7 2 4 18 15 14 30 16 19 2 27 15 4 19
-25 29 29 7 14 18 9 11 9 27 11 15 29 9 28 20 2 30 26 21 17 8 28 17 22 29 24 7 ^
-62 0 11 18 29 15 6 7 27 27 17 24 18 23 11 19 8 30 5 24 22 12 25 15 28 23 5 10
-21 5 8 7 3 10 19 17 6 9 15 29 10 7 4 1 16 21 16 29 13 18 5 3 8 15 8 21 29 20 5
-27 2 13 27 7 ^
-62 1 7 30 2 18 26 10 2 5 29 21 15 25 26 24 8 12 20 3 9 10 30 7 12 24 5 13 1 6
-10 25 13 9 29 30 17 29 17 26 6 25 4 7 25 8 15 26 30 11 2 9 6 22 6 21 28 3 3 6
-12 13 15 26 ^
-62 0 17 16 26 3 19 3 5 2 29 16 16 22 26 13 12 9 19 16 27 25 16 7 15 22 22 5 6
-13 4 12 11 27 5 19 28 9 30 9 1 28 3 21 22 7 17 2 25 1 28 21 11 17 20 28 12 10
-10 3 15 13 20 19 ^
-56 1 20 11 1 30 22 23 15 26 12 21 7 27 9 27 29 5 26 16 11 23 28 18 1 13 23 30 6
-3 11 11 16 10 13 13 19 15 18 7 22 10 29 3 25 30 8 22 13 4 4 27 22 18 21 23 17
-22 ^
-66 1 16 19 20 17 10 17 21 20 6 14 14 1 10 18 4 5 5 9 17 18 14 5 12 22 22 11 8
-18 24 21 3 7 21 9 4 3 4 23 14 17 25 27 10 5 16 30 23 2 4 25 3 16 28 4 6 6 17 12
-18 2 23 7 29 23 29 24 ^
-62 0 19 7 20 21 25 5 17 9 7 1 21 20 19 29 19 14 8 23 23 19 3 18 17 3 29 14 27
-23 28 5 22 8 10 1 1 11 27 18 3 2 22 28 14 24 12 1 3 30 29 11 22 19 7 16 1 11 4
-28 8 20 25 7 ^
-59 0 6 8 5 14 11 21 9 16 8 25 6 26 27 1 29 12 8 16 4 17 5 30 30 24 12 19 24 25
-11 13 12 27 16 14 3 24 20 24 23 22 9 14 19 26 8 13 6 13 25 19 5 1 19 1 17 28 30
-13 26 ^
-70 0 11 4 10 23 25 7 5 11 20 7 24 29 27 13 16 17 1 15 12 29 4 16 27 12 6 2 2 24
-17 13 22 20 22 4 20 16 2 17 3 11 29 1 5 10 14 23 3 14 9 2 7 18 20 13 2 16 25 24
-4 4 14 7 13 8 20 12 23 1 26 7 ^
-54 1 9 19 6 16 3 8 26 21 10 26 23 24 28 16 12 14 25 22 16 2 21 24 27 30 15 10
-15 2 18 13 26 28 23 16 23 10 2 11 26 26 4 29 18 4 24 24 1 24 13 5 21 29 26 27 ^
-58 1 10 16 6 5 7 23 19 11 28 22 21 1 24 19 7 26 18 30 25 21 6 18 22 2 1 14 2 14
-5 25 1 27 24 6 23 16 5 1 20 29 22 25 9 25 10 3 28 28 25 19 18 16 24 14 15 5 28
-28 ^
-58 1 28 26 29 2 15 15 9 5 18 19 22 12 15 4 6 15 24 16 9 4 26 25 18 27 19 20 4
-26 12 3 22 1 22 30 3 28 10 9 24 14 29 6 30 3 10 20 14 6 3 19 21 21 28 16 18 11
-30 22 ^
-65 1 20 30 1 9 8 11 5 19 10 24 4 22 4 2 26 5 15 20 8 3 13 30 18 8 1 25 28 20 20
-15 21 18 18 12 16 13 24 9 21 2 28 6 1 23 9 18 27 27 4 9 13 10 8 14 16 15 12 11
-14 21 14 10 11 25 20 ^
-53 0 17 30 21 13 27 26 26 22 14 13 17 21 19 9 9 20 23 13 7 10 28 24 10 22 27 23
-27 8 17 14 6 4 21 26 15 1 8 29 27 6 28 15 3 27 25 25 14 19 13 29 8 24 15 ^
-61 0 8 2 4 12 19 11 10 6 26 14 22 24 30 10 11 12 2 12 17 23 8 8 12 28 13 14 28
-2 17 4 8 3 26 9 23 21 30 30 20 4 13 28 29 9 3 17 7 19 30 28 1 2 20 9 12 24 15
-30 20 27 20 ^
-60 0 23 11 6 29 25 23 26 17 20 10 22 15 23 6 25 5 4 30 2 19 23 15 27 14 26 1 1
-7 19 12 7 6 20 18 14 4 15 17 28 7 11 7 8 9 22 17 12 5 23 18 25 18 6 12 26 30 12
-30 14 20 ^
-56 0 3 1 18 10 20 27 21 8 6 24 26 20 11 24 7 2 4 18 15 14 30 16 19 2 27 15 4 19
-25 29 29 7 14 18 9 11 9 27 11 15 29 9 28 20 2 30 26 21 17 8 28 17 22 29 24 23 ^
-62 0 11 18 29 15 6 7 27 27 17 24 18 23 11 19 8 30 5 24 22 12 25 15 28 23 5 10
-21 5 8 7 3 10 19 17 6 9 15 29 10 7 4 1 16 21 16 29 13 18 5 3 8 15 8 21 29 20 5
-27 2 13 27 23 ^
-64 1 7 30 2 18 26 10 2 5 29 21 15 25 26 24 8 12 20 3 9 10 30 7 12 24 5 13 1 6
-10 25 13 9 29 30 17 29 17 26 6 25 4 7 25 8 15 26 30 11 2 9 6 22 6 21 28 3 3 6
-12 13 15 7 17 18 ^
-65 0 26 3 19 3 5 2 29 16 16 22 26 13 12 9 19 16 27 25 16 7 15 22 22 5 6 13 4 12
-11 27 5 19 28 9 30 9 1 28 3 21 22 7 17 2 25 1 28 21 11 17 20 28 12 10 10 3 15
-13 20 1 20 11 1 30 5 ^
-57 0 23 15 26 12 21 7 27 9 27 29 5 26 16 11 23 28 18 1 13 23 30 6 3 11 11 16 10
-13 13 19 15 18 7 22 10 29 3 25 30 8 22 13 4 4 27 22 18 21 23 17 15 16 19 20 17
-10 25 ^
-66 1 21 20 6 14 14 1 10 18 4 5 5 9 17 18 14 5 12 22 22 11 8 18 24 21 3 7 21 9 4
-3 4 23 14 17 25 27 10 5 16 30 23 2 4 25 3 16 28 4 6 6 17 12 18 2 23 7 29 23 29
-27 19 7 20 21 25 20 ^
-65 1 17 9 7 1 21 20 19 29 19 14 8 23 23 19 3 18 17 3 29 14 27 23 28 5 22 8 10 1
-1 11 27 18 3 2 22 28 14 24 12 1 3 30 29 11 22 19 7 16 1 11 4 28 8 20 25 2 6 8 5
-14 11 21 9 16 28 ^
-59 1 25 6 26 27 1 29 12 8 16 4 17 5 30 30 24 12 19 24 25 11 13 12 27 16 14 3 24
-20 24 23 22 9 14 19 26 8 13 6 13 25 19 5 1 19 1 17 28 30 13 21 11 4 10 23 25 7
-5 11 23 ^
-70 0 20 7 24 29 27 13 16 17 1 15 12 29 4 16 27 12 6 2 2 24 17 13 22 20 22 4 20
-16 2 17 3 11 29 1 5 10 14 23 3 14 9 2 7 18 20 13 2 16 25 24 4 4 14 7 13 8 20 12
-23 1 26 7 9 19 6 16 3 8 26 25 ^
-56 0 10 26 23 24 28 16 12 14 25 22 16 2 21 24 27 30 15 10 15 2 18 13 26 28 23
-16 23 10 2 11 26 26 4 29 18 4 24 24 1 24 13 5 21 29 26 2 10 16 6 5 7 23 19 11
-28 24 ^
-59 1 21 1 24 19 7 26 18 30 25 21 6 18 22 2 1 14 2 14 5 25 1 27 24 6 23 16 5 1
-20 29 22 25 9 25 10 3 28 28 25 19 18 16 24 14 15 5 28 12 28 26 29 2 15 15 9 5
-18 19 13 ^
-63 1 12 15 4 6 15 24 16 9 4 26 25 18 27 19 20 4 26 12 3 22 1 22 30 3 28 10 9 24
-14 29 6 30 3 10 20 14 6 3 19 21 21 28 16 18 11 30 11 20 30 1 9 8 11 5 19 10 24
-4 22 4 2 26 20 ^
-59 1 15 20 8 3 13 30 18 8 1 25 28 20 20 15 21 18 18 12 16 13 24 9 21 2 28 6 1
-23 9 18 27 27 4 9 13 10 8 14 16 15 12 11 14 21 14 10 11 25 17 17 30 21 13 27 26
-26 22 14 23 ^
-61 0 16 21 30 25 8 9 18 30 17 4 6 31 26 16 25 18 23 9 20 8 7 25 26 11 27 17 28
-2 23 2 12 24 2 8 6 3 12 20 16 4 10 17 30 12 11 5 31 19 19 19 30 13 18 2 3 8 2
-17 8 24 28 ^
-69 0 22 2 7 26 1 13 26 6 6 6 18 24 7 6 7 30 19 12 22 24 25 3 11 17 3 10 12 11
-11 25 7 13 31 4 7 27 13 10 30 16 30 16 29 4 27 5 6 27 8 12 29 9 1 10 9 26 4 19
-1 3 3 4 16 13 17 6 16 14 28 ^
-62 0 3 20 3 2 1 30 14 14 21 29 13 11 10 29 20 19 26 27 19 6 17 26 26 7 9 13 16
-9 31 2 20 28 10 10 4 28 3 24 21 6 29 16 1 22 31 1 24 9 16 22 28 11 7 7 3 17 13
-22 4 17 9 27 ^
-60 0 21 23 17 24 16 24 11 26 5 31 30 2 24 14 9 23 28 18 4 13 23 4 3 9 9 14 12
-13 8 20 12 18 6 21 12 25 3 27 8 21 13 5 26 21 18 19 23 16 12 14 20 17 16 7 16
-19 22 9 15 25 ^
-64 0 31 7 18 29 5 7 2 5 16 18 10 7 11 21 21 9 8 18 25 19 3 6 19 29 10 3 5 23 15
-16 27 26 12 2 19 23 1 22 3 19 28 5 2 9 4 21 11 18 1 23 6 30 23 30 26 20 11 22
-19 27 2 16 10 31 ^
-60 0 4 24 17 20 25 20 15 8 23 23 20 30 18 16 3 30 15 26 23 28 7 21 8 7 31 31 14
-26 18 3 1 26 28 15 25 11 31 3 25 9 21 20 2 6 14 4 9 5 28 8 17 22 1 4 8 7 10 14
-19 19 ^
-62 0 14 8 27 9 24 26 4 30 11 8 19 5 21 7 2 27 20 16 20 20 22 14 13 16 26 14 10
-3 25 22 25 23 21 10 15 15 29 8 13 4 2 13 22 20 7 4 20 31 16 2 2 28 13 19 14 12
-23 27 6 2 14 24 ^
-62 0 22 6 25 30 29 31 13 14 16 31 12 16 30 5 14 31 11 4 1 1 25 21 13 26 22 21 5
-22 14 29 1 21 3 14 30 4 2 29 12 15 23 3 15 5 1 6 23 22 13 1 14 27 25 5 15 6 13
-3 22 11 23 21 ^
-56 1 24 6 5 20 4 14 3 29 8 29 19 7 29 23 25 28 19 11 15 27 21 14 1 19 20 26 12
-7 12 1 18 13 29 28 23 29 14 23 7 1 9 29 24 5 30 18 5 25 25 31 25 13 7 24 25 11 ^
-54 0 1 12 19 9 7 6 28 20 14 28 21 19 31 20 20 6 24 18 27 24 4 18 21 1 31 15 1
-15 2 27 4 26 25 4 23 19 2 31 22 30 21 22 5 27 12 30 28 28 27 15 18 14 25 23 ^
-59 1 17 7 28 11 28 29 30 1 17 12 10 2 18 20 21 2 11 12 5 4 12 25 14 5 5 24 22
-18 31 15 22 29 11 3 21 31 21 27 3 28 7 10 25 2 15 30 9 30 7 22 15 9 3 20 24 24
-28 14 25 ^
-58 0 9 27 14 22 27 31 10 8 14 7 15 7 20 5 26 1 29 7 17 17 8 3 13 27 18 8 31 27
-28 22 22 17 19 18 18 11 19 13 25 10 19 6 28 4 31 23 10 18 26 31 5 10 13 12 8 15
-19 24 ^
-56 1 11 14 15 24 15 12 9 22 16 16 24 13 2 26 24 29 26 15 13 21 24 20 10 10 22
-23 13 6 12 28 25 12 2 21 26 28 26 8 16 15 4 5 19 24 12 31 8 30 31 9 28 12 3 26
-29 8 ^
-65 0 27 10 20 13 30 8 25 1 8 1 5 11 20 9 12 4 29 15 21 25 27 7 14 11 1 11 16 23
-8 8 11 1 13 15 28 1 16 5 8 3 24 10 23 24 17 5 13 28 30 5 3 16 6 20 28 31 6 22
-10 11 29 25 17 27 23 ^
-60 0 26 3 23 14 4 30 27 23 24 21 17 12 21 17 23 4 22 7 5 27 1 20 23 12 26 10 24
-31 29 4 11 15 11 6 9 17 18 15 5 17 21 28 6 9 6 8 10 21 16 11 2 23 18 27 29 18 9
-11 24 24 ^
-58 1 11 15 29 29 3 31 18 12 17 31 19 8 4 25 29 17 29 9 25 6 1 2 18 17 15 19 15
-1 26 17 20 27 30 30 6 10 18 5 9 10 26 9 17 2 30 10 28 17 1 27 29 2 19 16 8 28
-16 28 ^
-61 1 30 25 8 9 18 30 17 4 6 31 26 16 25 18 23 9 20 8 7 25 26 11 27 17 28 2 23 2
-12 24 2 8 6 3 12 20 16 4 10 17 30 12 11 5 31 19 19 19 30 13 18 2 3 8 2 17 8 24
-30 22 29 ^
-70 0 7 26 1 13 26 6 6 6 18 24 7 6 7 30 19 12 22 24 25 3 11 17 3 10 12 11 11 25
-7 13 31 4 7 27 13 10 30 16 30 16 29 4 27 5 6 27 8 12 29 9 1 10 9 26 4 19 1 3 3
-4 16 13 17 6 16 14 24 3 20 21 ^
-62 1 2 1 30 14 14 21 29 13 11 10 29 20 19 26 27 19 6 17 26 26 7 9 13 16 9 31 2
-20 28 10 10 4 28 3 24 21 6 29 16 1 22 31 1 24 9 16 22 28 11 7 7 3 17 13 22 4 17
-9 4 21 23 21 ^
-62 1 24 16 24 11 26 5 31 30 2 24 14 9 23 28 18 4 13 23 4 3 9 9 14 12 13 8 20 12
-18 6 21 12 25 3 27 8 21 13 5 26 21 18 19 23 16 12 14 20 17 16 7 16 19 22 9 15
-10 31 7 18 29 7 ^
-66 1 7 2 5 16 18 10 7 11 21 21 9 8 18 25 19 3 6 19 29 10 3 5 23 15 16 27 26 12
-2 19 23 1 22 3 19 28 5 2 9 4 21 11 18 1 23 6 30 23 30 26 20 11 22 19 27 2 16 10
-6 4 24 17 20 25 20 21 ^
-62 1 8 23 23 20 30 18 16 3 30 15 26 23 28 7 21 8 7 31 31 14 26 18 3 1 26 28 15
-25 11 31 3 25 9 21 20 2 6 14 4 9 5 28 8 17 22 1 4 8 7 10 14 19 10 14 8 27 9 24
-26 4 30 8 ^
-62 1 8 19 5 21 7 2 27 20 16 20 20 22 14 13 16 26 14 10 3 25 22 25 23 21 10 15
-15 29 8 13 4 2 13 22 20 7 4 20 31 16 2 2 28 13 19 14 12 23 27 6 2 14 2 22 6 25
-30 29 31 13 14 21 ^
-65 0 31 12 16 30 5 14 31 11 4 1 1 25 21 13 26 22 21 5 22 14 29 1 21 3 14 30 4 2
-29 12 15 23 3 15 5 1 6 23 22 13 1 14 27 25 5 15 6 13 3 22 11 23 31 24 6 5 20 4
-14 3 29 8 29 19 31 ^
-55 1 29 23 25 28 19 11 15 27 21 14 1 19 20 26 12 7 12 1 18 13 29 28 23 29 14 23
-7 1 9 29 24 5 30 18 5 25 25 31 25 13 7 24 25 24 1 12 19 9 7 6 28 20 14 28 27 ^
-53 1 19 31 20 20 6 24 18 27 24 4 18 21 1 31 15 1 15 2 27 4 26 25 4 23 19 2 31
-22 30 21 22 5 27 12 30 28 28 27 15 18 14 25 15 17 7 28 11 28 29 30 1 17 21 ^
-61 0 10 2 18 20 21 2 11 12 5 4 12 25 14 5 5 24 22 18 31 15 22 29 11 3 21 31 21
-27 3 28 7 10 25 2 15 30 9 30 7 22 15 9 3 20 24 24 28 14 18 9 27 14 22 27 31 10
-8 14 7 15 19 ^
-59 1 20 5 26 1 29 7 17 17 8 3 13 27 18 8 31 27 28 22 22 17 19 18 18 11 19 13 25
-10 19 6 28 4 31 23 10 18 26 31 5 10 13 12 8 15 19 17 11 14 15 24 15 12 9 22 16
-16 24 13 23 ^
-57 0 26 24 29 26 15 13 21 24 20 10 10 22 23 13 6 12 28 25 12 2 21 26 28 26 8 16
-15 4 5 19 24 12 31 8 30 31 9 28 12 3 26 29 22 27 10 20 13 30 8 25 1 8 1 5 11 20
-16 ^
-61 1 12 4 29 15 21 25 27 7 14 11 1 11 16 23 8 8 11 1 13 15 28 1 16 5 8 3 24 10
-23 24 17 5 13 28 30 5 3 16 6 20 28 31 6 22 10 11 29 25 17 27 22 26 3 23 14 4 30
-27 23 24 31 ^
-61 1 17 12 21 17 23 4 22 7 5 27 1 20 23 12 26 10 24 31 29 4 11 15 11 6 9 17 18
-15 5 17 21 28 6 9 6 8 10 21 16 11 2 23 18 27 29 18 9 11 24 27 11 15 29 29 3 31
-18 12 17 31 12 ^
-60 1 8 4 25 29 17 29 9 25 6 1 2 18 17 15 19 15 1 26 17 20 27 30 30 6 10 18 5 9
-10 26 9 17 2 30 10 28 17 1 27 29 2 19 16 8 28 16 21 30 25 8 9 18 30 17 4 6 31
-26 16 18 ^
-67 1 18 23 9 20 8 7 25 26 11 27 17 28 2 23 2 12 24 2 8 6 3 12 20 16 4 10 17 30
-12 11 5 31 19 19 19 30 13 18 2 3 8 2 17 8 24 30 22 2 7 26 1 13 26 6 6 6 18 24 7
-6 7 30 19 12 22 24 28 ^
-69 1 3 11 17 3 10 12 11 11 25 7 13 31 4 7 27 13 10 30 16 30 16 29 4 27 5 6 27 8
-12 29 9 1 10 9 26 4 19 1 3 3 4 16 13 17 6 16 14 24 3 20 3 2 1 30 14 14 21 29 13
-11 10 29 20 19 26 27 19 6 28 ^
-62 1 26 26 7 9 13 16 9 31 2 20 28 10 10 4 28 3 24 21 6 29 16 1 22 31 1 24 9 16
-22 28 11 7 7 3 17 13 22 4 17 9 4 21 23 17 24 16 24 11 26 5 31 30 2 24 14 9 23
-28 18 4 13 26 ^
-70 1 4 3 9 9 14 12 13 8 20 12 18 6 21 12 25 3 27 8 21 13 5 26 21 18 19 23 16 12
-14 20 17 16 7 16 19 22 9 15 10 31 7 18 29 5 7 2 5 16 18 10 7 11 21 21 9 8 18 25
-19 3 6 19 29 10 3 5 23 15 16 17 ^
-60 1 26 12 2 19 23 1 22 3 19 28 5 2 9 4 21 11 18 1 23 6 30 23 30 26 20 11 22 19
-27 2 16 10 6 4 24 17 20 25 20 15 8 23 23 20 30 18 16 3 30 15 26 23 28 7 21 8 7
-31 31 7 ^
-66 0 26 18 3 1 26 28 15 25 11 31 3 25 9 21 20 2 6 14 4 9 5 28 8 17 22 1 4 8 7
-10 14 19 10 14 8 27 9 24 26 4 30 11 8 19 5 21 7 2 27 20 16 20 20 22 14 13 16 26
-14 10 3 25 22 25 23 17 ^
-64 1 10 15 15 29 8 13 4 2 13 22 20 7 4 20 31 16 2 2 28 13 19 14 12 23 27 6 2 14
-2 22 6 25 30 29 31 13 14 16 31 12 16 30 5 14 31 11 4 1 1 25 21 13 26 22 21 5 22
-14 29 1 21 3 14 27 ^
-64 0 4 2 29 12 15 23 3 15 5 1 6 23 22 13 1 14 27 25 5 15 6 13 3 22 11 23 31 24
-6 5 20 4 14 3 29 8 29 19 7 29 23 25 28 19 11 15 27 21 14 1 19 20 26 12 7 12 1
-18 13 29 28 23 29 13 ^
-58 0 23 7 1 9 29 24 5 30 18 5 25 25 31 25 13 7 24 25 24 1 12 19 9 7 6 28 20 14
-28 21 19 31 20 20 6 24 18 27 24 4 18 21 1 31 15 1 15 2 27 4 26 25 4 23 19 2 31
-28 ^
-57 0 30 21 22 5 27 12 30 28 28 27 15 18 14 25 15 17 7 28 11 28 29 30 1 17 12 10
-2 18 20 21 2 11 12 5 4 12 25 14 5 5 24 22 18 31 15 22 29 11 3 21 31 21 27 3 28
-7 26 ^
-59 0 25 2 15 30 9 30 7 22 15 9 3 20 24 24 28 14 18 9 27 14 22 27 31 10 8 14 7
-15 7 20 5 26 1 29 7 17 17 8 3 13 27 18 8 31 27 28 22 22 17 19 18 18 11 19 13 25
-10 19 19 ^
-59 0 28 4 31 23 10 18 26 31 5 10 13 12 8 15 19 17 11 14 15 24 15 12 9 22 16 16
-24 13 2 26 24 29 26 15 13 21 24 20 10 10 22 23 13 6 12 28 25 12 2 21 26 28 26 8
-16 15 4 5 31 ^
-66 1 24 12 31 8 30 31 9 28 12 3 26 29 22 27 10 20 13 30 8 25 1 8 1 5 11 20 9 12
-4 29 15 21 25 27 7 14 11 1 11 16 23 8 8 11 1 13 15 28 1 16 5 8 3 24 10 23 24 17
-5 13 28 30 5 3 16 21 ^
-59 0 20 28 31 6 22 10 11 29 25 17 27 22 26 3 23 14 4 30 27 23 24 21 17 12 21 17
-23 4 22 7 5 27 1 20 23 12 26 10 24 31 29 4 11 15 11 6 9 17 18 15 5 17 21 28 6 9
-6 8 26 ^
-59 0 21 16 11 2 23 18 27 29 18 9 11 24 27 11 15 29 29 3 31 18 12 17 31 19 8 4
-25 29 17 29 9 25 6 1 2 18 17 15 19 15 1 26 17 20 27 30 30 6 10 18 5 9 10 26 9
-17 2 30 24 ^
-61 0 28 17 1 27 29 2 19 16 8 28 16 21 30 25 8 9 18 30 17 4 6 31 26 16 25 18 23
-9 20 8 7 25 26 11 27 17 28 2 23 2 12 24 2 8 6 3 12 20 16 4 10 17 30 12 11 5 31
-19 19 19 25 ^
-74 0 13 18 2 3 8 2 17 8 24 30 22 2 7 26 1 13 26 6 6 6 18 24 7 6 7 30 19 12 22
-24 25 3 11 17 3 10 12 11 11 25 7 13 31 4 7 27 13 10 30 16 30 16 29 4 27 5 6 27
-8 12 29 9 1 10 9 26 4 19 1 3 3 4 16 16 ^
-64 1 17 6 16 14 24 3 20 3 2 1 30 14 14 21 29 13 11 10 29 20 19 26 27 19 6 17 26
-26 7 9 13 16 9 31 2 20 28 10 10 4 28 3 24 21 6 29 16 1 22 31 1 24 9 16 22 28 11
-7 7 3 17 13 22 27 ^
-65 0 17 9 4 21 23 17 24 16 24 11 26 5 31 30 2 24 14 9 23 28 18 4 13 23 4 3 9 9
-14 12 13 8 20 12 18 6 21 12 25 3 27 8 21 13 5 26 21 18 19 23 16 12 14 20 17 16
-7 16 19 22 9 15 10 31 1 ^
-68 1 18 29 5 7 2 5 16 18 10 7 11 21 21 9 8 18 25 19 3 6 19 29 10 3 5 23 15 16
-27 26 12 2 19 23 1 22 3 19 28 5 2 9 4 21 11 18 1 23 6 30 23 30 26 20 11 22 19
-27 2 16 10 6 4 24 17 20 25 20 ^
-63 0 15 8 23 23 20 30 18 16 3 30 15 26 23 28 7 21 8 7 31 31 14 26 18 3 1 26 28
-15 25 11 31 3 25 9 21 20 2 6 14 4 9 5 28 8 17 22 1 4 8 7 10 14 19 10 14 8 27 9
-24 26 4 30 24 ^
-64 1 8 19 5 21 7 2 27 20 16 20 20 22 14 13 16 26 14 10 3 25 22 25 23 21 10 15
-15 29 8 13 4 2 13 22 20 7 4 20 31 16 2 2 28 13 19 14 12 23 27 6 2 14 2 22 6 25
-30 29 31 13 14 16 31 5 ^
-67 0 16 30 5 14 31 11 4 1 1 25 21 13 26 22 21 5 22 14 29 1 21 3 14 30 4 2 29 12
-15 23 3 15 5 1 6 23 22 13 1 14 27 25 5 15 6 13 3 22 11 23 31 24 6 5 20 4 14 3
-29 8 29 19 7 29 23 25 21 ^
-58 0 19 11 15 27 21 14 1 19 20 26 12 7 12 1 18 13 29 28 23 29 14 23 7 1 9 29 24
-5 30 18 5 25 25 31 25 13 7 24 25 24 1 12 19 9 7 6 28 20 14 28 21 19 31 20 20 6
-24 22 ^
-60 0 27 24 4 18 21 1 31 15 1 15 2 27 4 26 25 4 23 19 2 31 22 30 21 22 5 27 12
-30 28 28 27 15 18 14 25 15 17 7 28 11 28 29 30 1 17 12 10 2 18 20 21 2 11 12 5
-4 12 25 14 22 ^
-60 1 5 24 22 18 31 15 22 29 11 3 21 31 21 27 3 28 7 10 25 2 15 30 9 30 7 22 15
-9 3 20 24 24 28 14 18 9 27 14 22 27 31 10 8 14 7 15 7 20 5 26 1 29 7 17 17 8 3
-13 27 31 ^
-58 0 8 31 27 28 22 22 17 19 18 18 11 19 13 25 10 19 6 28 4 31 23 10 18 26 31 5
-10 13 12 8 15 19 17 11 14 15 24 15 12 9 22 16 16 24 13 2 26 24 29 26 15 13 21
-24 20 10 10 25 ^
-65 0 23 13 6 12 28 25 12 2 21 26 28 26 8 16 15 4 5 19 24 12 31 8 30 31 9 28 12
-3 26 29 22 27 10 20 13 30 8 25 1 8 1 5 11 20 9 12 4 29 15 21 25 27 7 14 11 1 11
-16 23 8 8 11 1 13 21 ^
-60 1 28 1 16 5 8 3 24 10 23 24 17 5 13 28 30 5 3 16 6 20 28 31 6 22 10 11 29 25
-17 27 22 26 3 23 14 4 30 27 23 24 21 17 12 21 17 23 4 22 7 5 27 1 20 23 12 26
-10 24 31 11 ^
-64 1 4 11 15 11 6 9 17 18 15 5 17 21 28 6 9 6 8 10 21 16 11 2 23 18 27 29 18 9
-11 24 27 11 15 29 29 3 31 18 12 17 31 19 8 4 25 29 17 29 9 25 6 1 2 18 17 15 19
-15 1 26 17 20 27 25 ^
-64 0 30 6 10 18 5 9 10 26 9 17 2 30 10 28 17 1 27 29 2 19 16 8 28 16 21 30 25 8
-9 18 30 17 4 6 31 26 16 25 18 23 9 20 8 7 25 26 11 27 17 28 2 23 2 12 24 2 8 6
-3 12 20 16 4 31 ^
-60 0 28 5 24 16 10 27 28 19 29 19 22 10 23 17 25 7 26 5 5 27 1 20 24 13 27 16
-24 32 31 5 12 21 13 6 11 21 20 15 3 14 18 32 2 9 6 10 13 23 16 17 3 20 19 27 29
-21 5 11 28 14 ^
-<D
-
-H>SHS Type 2 Strings<H
-D>
-60 1 16 13 19 5 16 14 27 2 22 7 5 28 15 18 25 17 13 12 29 24 21 29 25 16 5 17
-22 24 8 8 18 3 13 10 28 3 23 28 12 8 3 25 5 25 24 7 14 30 27 32 30 23 8 15 27
-28 13 8 12 21 ^
-86 1 33 5 40 26 3 19 12 36 43 5 35 37 5 14 11 45 35 16 10 8 32 4 15 35 26 2 39
-22 37 22 30 29 28 36 45 14 36 4 29 37 30 34 36 20 9 42 29 9 11 11 18 42 13 6 20
-42 20 30 22 35 34 6 14 41 19 30 17 35 33 26 41 15 5 44 39 8 20 3 44 32 15 18 10
-15 10 36 ^
-112 0 10 44 24 53 35 22 40 20 15 51 22 18 22 42 6 54 49 38 21 7 13 30 16 7 52
-16 22 13 38 7 11 44 33 9 25 13 37 42 14 45 53 30 38 5 25 5 35 38 22 28 10 29 52
-31 39 35 23 5 17 14 31 46 5 41 54 43 33 13 23 46 45 3 46 3 55 15 6 53 28 52 22
-27 45 32 53 51 15 37 15 49 36 35 35 15 3 13 22 25 3 4 10 24 12 7 44 25 18 21 21
-20 55 24 ^
-123 1 43 9 1 52 4 21 49 61 18 50 23 13 46 62 23 45 62 9 56 18 23 31 8 30 27 36
-13 38 4 58 53 47 24 18 41 58 19 12 18 52 42 29 44 45 26 63 34 32 41 64 15 26 55
-19 2 49 6 30 53 13 54 12 53 37 12 37 29 60 53 21 47 42 45 52 40 10 28 47 43 17
-16 17 61 36 12 34 60 37 13 52 58 37 39 29 34 11 45 8 36 1 50 50 5 51 13 15 32
-51 33 61 16 31 50 58 63 16 5 30 17 24 10 26 52 ^
-144 1 64 62 63 30 15 1 35 28 16 40 20 14 50 33 19 38 30 27 55 10 16 46 47 7 55
-12 53 26 56 33 29 55 25 17 48 43 21 43 18 24 63 27 68 46 38 33 35 10 18 11 27 5
-9 58 35 70 36 36 39 47 2 10 66 47 5 18 21 44 71 51 57 3 22 7 56 55 28 25 14 40
-16 24 48 37 66 50 24 45 18 39 53 29 64 60 26 50 6 47 61 46 44 60 17 4 58 45 26
-20 26 32 8 7 68 37 3 24 44 47 64 54 71 57 12 68 27 58 29 54 43 42 60 13 14 56
-49 1 32 9 61 43 36 33 20 59 ^
-166 0 7 38 57 33 61 73 7 64 1 49 35 76 14 27 21 45 68 38 58 73 13 72 47 73 33 8
-66 23 38 4 56 77 47 10 71 13 20 31 41 6 51 3 18 17 61 47 14 48 76 46 28 34 43 1
-56 4 25 7 65 41 1 34 37 23 59 59 27 26 13 15 14 75 60 14 1 28 59 26 65 61 16 23
-17 28 6 19 2 35 49 30 29 48 2 63 73 59 1 3 76 41 11 19 18 43 54 63 67 51 4 9 78
-60 8 72 31 35 77 54 58 20 36 58 51 76 40 20 37 49 3 75 1 29 20 57 64 22 25 6 25
-59 32 43 58 40 51 77 1 2 36 10 12 28 39 11 46 2 41 27 27 53 76 13 66 69 76 28 ^
-186 1 5 73 38 30 30 48 21 75 80 40 21 8 53 9 26 30 34 81 71 71 51 23 75 33 41
-23 32 5 8 66 40 72 40 16 66 45 14 48 34 21 41 27 3 55 27 37 23 41 65 4 57 51 74
-22 19 75 42 16 19 46 16 10 48 20 19 37 41 14 57 9 17 55 38 5 60 7 46 20 43 36
-39 52 20 10 62 45 23 46 7 35 75 29 70 35 36 34 25 12 15 84 26 10 6 71 29 79 33
-32 25 59 76 82 64 58 7 8 19 41 74 2 53 65 24 1 55 51 36 21 79 28 5 17 41 36 63
-51 18 48 25 46 45 36 77 76 22 57 14 44 63 56 45 56 20 1 64 49 9 12 28 30 72 82
-73 33 3 22 30 43 56 67 62 2 57 13 50 20 57 38 43 61 9 8 57 65 76 9 ^
-183 1 54 34 83 10 33 51 86 81 82 69 18 8 22 64 19 86 62 58 33 37 17 34 5 29 83
-42 76 50 54 66 39 9 1 36 43 17 65 6 35 56 72 71 83 88 10 1 8 87 22 6 21 78 25
-89 43 62 40 55 85 31 89 74 63 46 28 24 26 31 17 7 8 27 19 12 85 17 20 27 77 10
-2 54 80 17 52 74 76 69 78 11 20 80 4 29 24 85 75 18 39 23 70 83 29 57 67 72 70
-33 4 15 46 42 2 69 13 53 33 69 64 33 64 14 40 69 59 78 71 19 85 16 65 38 82 55
-40 56 40 24 84 29 25 44 68 13 85 76 64 32 18 25 45 23 6 80 31 30 30 58 14 13 72
-57 14 41 28 52 73 26 76 83 56 54 2 36 11 65 66 38 50 8 41 88 77 ^
-200 1 25 57 40 46 78 57 34 78 61 36 66 57 38 80 22 32 68 71 30 74 37 81 66 77
-66 55 2 51 24 93 61 40 68 45 61 12 63 24 89 59 52 72 43 20 20 69 36 40 88 46 9
-62 55 77 84 20 18 6 77 15 52 39 75 3 26 4 85 17 62 29 11 92 46 58 29 59 28 42
-80 71 96 2 49 85 37 63 4 61 14 2 53 87 25 86 6 75 76 93 41 39 93 92 42 56 41 63
-26 28 18 77 11 50 78 79 1 12 12 91 29 13 58 5 56 92 66 59 4 39 47 95 5 5 62 33
-13 80 69 60 43 51 22 30 32 42 5 38 3 50 7 48 90 56 96 68 47 41 61 60 96 20 14 4
-19 19 23 25 13 9 38 52 17 11 96 48 19 25 88 42 7 74 59 48 70 55 24 18 28 44 46
-3 24 38 56 19 96 22 50 60 17 96 ^
-195 1 25 51 45 35 66 19 61 60 9 31 93 64 70 30 42 86 53 1 71 46 42 22 38 96 10
-99 34 76 26 55 73 63 63 97 23 92 81 64 46 1 30 31 35 86 91 88 64 87 16 37 69 84
-94 60 100 3 47 52 8 71 87 57 29 76 43 18 45 46 15 65 12 44 42 66 60 15 68 19 58
-39 62 76 9 92 101 57 32 4 34 15 41 62 32 89 71 43 35 31 41 21 17 82 33 96 27 62
-29 82 57 46 62 15 24 99 37 83 40 52 46 56 80 98 3 91 74 6 27 7 58 94 10 41 79
-97 84 77 74 26 99 95 61 19 17 24 55 15 85 84 30 45 93 44 100 44 39 59 46 18 95
-3 41 15 82 77 16 48 18 51 83 20 82 60 53 53 12 99 92 54 5 99 51 39 100 61 2 31
-52 49 86 94 16 78 84 91 42 ^
-212 0 56 98 16 98 78 22 72 33 103 104 52 84 12 65 15 85 101 97 84 31 51 26 100
-100 38 80 13 2 78 7 24 44 84 103 27 7 28 16 33 99 25 103 54 14 42 62 87 92 27
-22 42 5 52 100 84 73 72 63 24 48 56 52 23 5 17 76 31 1 95 58 43 60 50 62 30 23
-35 79 20 35 3 72 32 45 51 87 41 84 27 79 77 70 102 15 54 15 100 8 52 69 105 3
-30 84 42 93 66 89 69 74 24 33 42 97 4 38 99 106 13 93 6 106 74 100 54 45 21 59
-56 37 9 50 32 75 79 31 77 9 61 1 8 68 6 60 81 7 100 99 14 61 48 25 73 26 70 72
-94 3 11 98 31 5 67 7 39 92 73 88 101 32 105 34 82 81 11 72 48 10 59 71 51 71 35
-33 27 49 49 19 98 47 43 75 64 17 15 24 94 49 4 84 58 58 74 39 47 104 82 5 63 69
-90 19 ^
-236 1 29 79 41 40 72 51 12 92 34 52 44 69 104 21 97 89 96 48 21 4 61 40 28 67
-34 23 85 44 22 62 52 33 84 23 30 73 74 4 79 12 81 47 80 53 47 89 40 19 80 62 34
-61 29 41 95 43 1 70 63 55 53 18 19 13 48 10 19 89 49 4 52 53 56 76 10 8 104 77
-15 28 38 75 109 3 85 90 8 40 8 93 90 43 39 14 60 17 36 78 56 105 80 35 75 36 58
-82 50 100 98 45 74 13 66 95 72 71 95 34 14 98 72 33 38 37 52 6 14 107 59 3 29
-61 67 98 92 5 93 17 98 36 87 41 75 71 57 88 17 25 91 84 3 58 20 92 69 51 50 36
-31 14 25 18 30 18 1 41 104 30 82 59 87 70 34 96 28 47 62 81 103 109 103 100 7
-17 16 104 1 12 34 5 102 42 16 22 71 39 5 73 45 45 54 41 13 2 26 41 22 100 109
-30 44 4 90 108 53 38 104 68 28 56 47 51 94 22 7 81 85 26 50 9 72 98 54 59 96 52
-^
-232 1 92 72 47 37 33 38 92 17 8 28 88 22 62 69 32 89 75 3 72 96 85 13 105 24 38
-37 94 115 83 72 108 114 24 93 76 103 60 99 102 9 43 10 59 95 46 33 93 15 26 69
-44 2 86 107 55 45 61 65 92 66 9 55 39 70 83 29 98 67 13 111 15 20 31 62 8 2 51
-20 19 33 44 14 115 71 112 97 10 41 28 53 51 26 57 15 38 98 55 106 22 56 31 50
-95 107 110 84 70 10 108 96 73 100 25 36 55 88 71 63 96 30 90 96 79 22 7 30 23
-28 59 89 8 51 99 47 86 34 18 43 65 98 104 107 49 7 79 71 8 57 21 29 80 2 74 78
-44 57 9 61 22 13 68 52 91 74 98 43 30 58 68 95 101 72 102 76 42 99 108 47 25 73
-27 104 34 59 52 36 104 20 98 14 97 4 50 46 106 83 17 22 105 79 77 46 39 15 113
-20 37 100 106 65 66 76 7 12 72 35 8 22 50 40 68 101 23 54 96 44 51 87 18 6 46
-110 ^
-245 0 70 30 81 46 53 119 85 6 104 47 92 72 70 5 70 15 115 68 105 33 97 13 85
-106 14 61 29 22 86 45 57 69 91 38 38 28 66 13 60 95 103 3 15 5 113 38 23 62 5
-65 94 107 73 104 37 47 102 117 3 78 35 7 95 56 78 45 52 28 46 43 37 32 53 19 55
-29 47 97 76 115 83 71 11 45 62 73 99 116 2 24 116 7 28 41 2 29 37 52 23 5 118
-79 31 57 89 61 24 101 78 50 93 73 41 7 33 45 47 24 1 48 73 36 3 25 87 46 28 108
-54 68 53 67 119 28 36 118 104 42 88 27 112 4 74 85 1 63 39 97 71 74 75 76 10 49
-12 79 11 50 103 118 94 117 118 37 27 12 94 60 28 51 47 82 110 17 15 105 23 52
-43 12 21 22 81 41 12 74 90 42 108 117 98 67 4 69 44 76 105 38 101 21 80 70 10
-111 23 110 32 101 83 91 101 31 5 3 83 76 15 90 57 74 95 46 33 112 62 63 54 63
-49 59 4 64 40 68 110 74 105 91 86 102 27 55 34 88 55 ^
-240 0 55 79 75 84 113 22 4 113 109 31 33 17 96 11 29 63 98 103 107 116 34 14 9
-95 38 18 51 75 33 109 118 55 66 4 76 7 75 70 82 74 23 1 26 69 40 112 99 47 65
-31 70 119 52 103 88 85 86 28 16 12 76 25 22 78 64 21 86 27 61 77 72 108 2 18
-106 119 121 54 16 85 72 2 73 26 88 66 60 80 35 24 117 63 24 44 67 52 122 119 33
-72 16 99 98 69 54 19 42 28 53 114 32 117 81 100 57 49 123 56 21 68 80 53 95 1
-45 95 107 98 87 1 27 24 99 116 16 67 1 113 91 84 25 40 25 72 3 28 90 87 112 80
-16 117 45 77 36 90 105 59 88 122 64 108 108 71 98 18 50 115 93 105 77 35 6 46
-55 47 102 4 26 87 111 120 81 113 4 57 105 3 84 94 115 61 3 121 72 71 24 62 14
-60 99 61 96 103 51 107 6 65 81 114 83 121 109 49 104 30 73 82 92 94 9 8 11 98
-19 10 55 97 22 97 95 88 67 15 20 39 65 13 123 77 ^
-253 1 45 7 15 24 51 5 98 115 24 49 90 104 117 66 128 94 64 80 12 43 91 46 111
-59 58 77 30 14 88 60 123 68 41 44 68 40 104 118 41 43 93 90 105 92 16 127 26 54
-125 114 79 71 24 48 21 25 118 40 103 49 91 44 67 65 25 119 109 18 48 23 69 112
-38 61 64 87 84 104 119 110 122 92 22 1 8 83 34 100 32 62 41 46 112 34 102 76 56
-39 4 127 30 13 19 110 124 7 16 128 95 4 124 11 104 116 126 49 95 3 55 96 70 90
-101 4 122 96 75 118 39 128 99 92 18 42 20 87 83 35 75 111 61 67 71 28 101 9 56
-34 105 95 71 23 73 71 26 57 15 23 76 55 99 89 128 98 117 68 43 88 62 38 62 39 2
-83 36 15 26 60 128 96 73 74 10 1 12 42 22 2 77 33 33 32 57 13 14 82 57 12 39 3
-58 80 14 87 85 44 69 109 19 117 67 68 44 63 106 37 88 64 82 56 37 89 4 126 55
-98 114 84 99 91 43 92 21 26 58 84 102 75 116 124 5 101 5 97 46 109 15 29 79 72
-93 92 110 ^
-289 1 83 5 76 20 32 15 10 1 103 18 22 116 98 9 51 104 102 44 33 15 12 24 31 89
-1 6 28 101 8 64 72 106 30 5 52 89 111 39 108 64 85 17 57 124 22 105 78 115 3 40
-108 66 108 77 128 103 44 35 38 13 95 10 111 63 98 117 61 51 126 69 96 70 70 59
-39 13 97 33 112 2 77 7 123 70 83 29 66 67 49 79 19 104 115 14 60 2 55 40 71 33
-28 114 51 91 17 46 45 128 57 87 62 25 115 38 50 55 90 74 8 51 102 79 43 94 36
-122 94 12 41 36 25 104 91 24 7 99 80 30 126 32 63 122 107 114 27 28 79 41 12 35
-51 115 122 70 22 79 65 2 88 27 17 59 15 23 44 57 5 65 6 26 78 80 125 93 84 100
-45 22 129 68 36 111 74 118 11 50 42 120 47 21 8 86 112 26 67 60 99 45 93 47 8
-38 59 52 56 124 20 82 18 117 24 18 46 106 19 117 26 41 47 45 130 7 15 1 4 5 100
-10 85 50 44 11 48 92 119 108 42 118 24 20 69 107 90 96 48 103 7 2 90 50 18 130
-126 45 106 17 35 25 102 68 23 68 120 58 41 34 75 103 20 45 117 37 61 73 34 62 1
-125 58 74 21 21 129 7 86 110 76 66 124 ^
-263 1 100 135 7 75 23 5 81 110 31 118 29 1 62 11 41 88 109 119 102 37 3 30 123
-47 31 56 134 29 124 116 118 99 21 56 77 91 23 37 135 81 44 51 67 95 51 133 30
-57 67 116 122 48 100 7 132 97 106 69 93 4 95 125 102 103 119 81 57 133 96 37
-118 50 117 113 81 127 17 45 103 32 121 129 60 43 65 127 30 36 132 110 52 53 35
-71 12 76 22 72 130 112 99 76 26 21 73 63 63 97 23 58 115 132 114 1 132 31 35 18
-23 54 30 53 118 37 35 84 94 60 100 3 47 18 110 105 87 57 63 76 43 52 45 46 49
-65 12 10 42 66 60 117 34 19 92 5 28 76 9 126 101 125 32 38 34 15 7 62 32 21 3
-43 69 31 109 123 51 116 135 130 129 130 63 14 57 80 62 15 126 31 105 83 108 120
-80 124 46 98 105 91 6 6 27 7 58 128 78 7 79 63 84 77 74 128 65 61 95 121 17 24
-123 117 51 50 64 79 59 44 134 78 73 59 114 18 27 3 109 49 82 43 118 116 52 119
-15 122 82 26 87 53 114 133 92 88 39 99 17 107 134 95 104 31 52 49 94 ^
-286 0 120 16 104 136 117 82 138 32 65 114 119 137 121 8 12 46 126 26 119 73 130
-60 76 113 100 14 133 26 116 34 120 80 95 84 53 15 24 44 51 4 10 23 77 24 99 66
-37 54 63 42 136 21 34 76 5 17 128 101 1 59 40 113 112 32 97 31 93 105 79 91 18
-39 1 103 132 51 68 124 111 13 97 43 128 69 84 85 72 15 12 26 87 16 16 92 101 13
-77 4 118 89 103 56 42 16 60 44 39 126 46 18 83 93 41 105 3 82 106 115 91 6 4 54
-115 15 120 109 113 48 41 9 95 20 62 67 105 111 25 132 7 116 46 138 44 83 61 124
-131 35 107 6 109 81 114 67 41 137 77 56 74 73 34 12 14 69 52 11 98 47 54 83 81
-6 1 15 88 35 139 80 83 49 89 27 47 130 92 133 87 51 112 76 49 109 49 57 93 73
-22 117 50 64 58 97 139 36 131 111 133 58 33 8 88 55 38 90 46 30 118 57 29 82 74
-41 117 38 46 94 92 5 105 15 117 70 103 68 60 120 48 21 110 85 40 81 38 58 129
-56 10 99 86 76 81 26 23 25 68 16 28 127 65 18 71 75 77 100 26 11 130 104 28 34
-56 106 7 8 120 112 12 58 21 130 124 67 61 19 87 119 ^
-286 1 35 94 61 130 98 35 88 34 65 104 56 126 118 50 87 10 81 109 90 86 118 32 6
-114 88 39 38 39 62 3 12 134 72 137 35 75 81 115 106 140 112 11 123 41 103 45 95
-84 71 107 13 26 110 96 62 16 109 84 59 53 38 27 8 28 13 32 137 17 138 41 122 36
-99 65 99 83 36 112 29 49 70 96 126 136 131 116 3 18 17 126 142 14 37 141 141
-123 42 13 20 83 42 139 83 54 49 58 42 7 137 29 48 16 121 127 34 52 140 106 128
-58 36 124 83 24 69 54 61 112 17 6 95 97 24 57 86 124 59 71 119 67 1 109 54 68
-49 57 132 32 5 71 113 40 80 104 75 106 133 31 126 130 104 62 9 39 44 66 116 141
-135 96 132 19 41 121 126 124 77 8 4 60 82 6 101 124 89 51 123 48 40 85 77 21
-112 10 69 66 115 87 16 108 30 84 65 80 103 32 131 134 73 47 10 63 39 50 93 37
-135 114 69 48 34 58 23 27 133 37 9 40 98 41 115 99 70 83 29 42 67 133 55 79 80
-91 122 12 2 115 112 23 33 16 102 3 19 60 101 130 105 116 117 27 2 1 103 38 14
-55 78 26 116 123 54 67 139 82 74 70 84 72 17 132 25 68 31 120 103 140 ^
-285 1 65 30 51 119 48 107 92 84 69 28 136 143 54 20 6 70 47 142 64 4 65 59 73
-99 134 146 102 125 116 57 137 137 72 48 128 78 5 80 63 54 85 30 22 129 68 21 21
-74 28 128 107 27 60 2 93 95 71 37 11 37 15 39 102 3 104 65 80 59 52 113 34 20
-67 60 27 81 135 46 106 106 102 68 128 17 15 100 124 15 43 136 122 100 67 142 35
-14 53 120 2 89 93 99 73 9 122 39 77 15 96 90 43 79 134 60 92 105 55 96 31 119
-77 97 72 23 140 38 30 43 83 136 88 107 117 72 109 118 58 91 119 73 95 100 59
-138 123 54 49 143 50 133 66 106 45 80 88 42 93 5 59 77 101 74 110 104 40 92 19
-77 76 86 102 129 3 144 101 139 134 56 90 18 91 94 85 55 10 137 11 58 1 107 113
-70 22 7 56 29 143 111 8 46 45 116 122 129 89 7 121 53 95 14 49 118 62 125 91 37
-97 15 35 100 63 140 63 50 51 58 26 127 6 45 59 102 121 114 85 141 135 10 72 19
-106 66 66 41 53 13 38 1 21 103 50 108 46 66 70 43 140 124 40 63 144 97 137 47
-60 88 103 115 132 145 116 143 115 10 133 9 118 37 105 51 94 60 67 117 116 ^
-305 1 109 110 75 42 12 139 137 43 128 106 107 19 126 12 101 148 127 15 117 125
-125 62 96 13 76 70 96 101 110 138 8 95 76 143 17 32 97 79 149 39 31 94 123 21
-41 135 55 84 70 33 135 118 50 62 121 81 1 45 144 93 60 5 64 137 8 105 91 82 67
-27 113 119 53 18 98 79 48 84 32 135 128 5 1 20 76 17 85 108 72 36 141 140 49
-150 105 104 3 149 14 54 18 148 64 49 125 37 28 28 101 22 104 91 32 82 117 12
-114 69 58 2 58 115 9 108 47 59 65 14 92 7 4 86 98 16 82 92 95 38 94 10 10 48 97
-104 66 115 97 142 115 122 119 40 97 16 32 47 34 88 89 26 50 12 76 80 51 40 9
-133 24 44 40 122 84 108 22 142 140 99 44 15 54 8 42 125 150 130 21 79 124 62 46
-119 15 29 91 57 150 42 138 71 61 68 80 114 6 1 70 121 18 35 113 56 87 86 10 73
-14 29 41 72 89 1 133 87 101 123 59 90 142 77 133 52 78 48 34 138 134 27 17 60
-131 147 61 93 148 39 132 49 62 71 36 91 4 139 49 100 120 43 113 144 30 94 73
-127 40 34 50 100 110 88 114 94 35 138 33 72 61 58 65 24 107 6 54 81 114 56 137
-71 11 23 19 73 1 108 110 25 148 11 98 132 150 17 70 146 50 ^
-314 1 99 88 7 139 24 13 35 47 97 145 74 36 119 3 51 84 48 119 53 49 15 79 17
-120 103 148 64 30 41 97 120 75 111 63 58 131 134 18 13 10 48 18 16 48 43 15 54
-18 41 47 122 144 80 92 145 77 1 33 89 54 46 78 48 21 54 43 40 53 24 16 73 42 94
-29 44 34 151 152 23 123 12 142 140 43 37 88 29 19 35 72 96 151 130 62 112 34 36
-91 120 50 112 138 2 105 60 68 137 131 5 17 19 139 74 11 120 78 149 58 128 15
-104 16 126 78 20 57 134 71 49 90 76 108 126 100 54 68 39 132 153 42 147 146 124
-62 87 35 75 61 65 46 100 82 105 113 31 63 5 95 54 71 77 127 150 80 36 144 2 130
-59 74 39 3 152 121 122 18 117 12 117 141 118 135 62 36 69 5 39 53 150 52 153
-143 30 66 96 126 131 56 137 8 7 86 142 14 7 111 141 93 136 137 134 43 12 89 23
-44 9 152 146 121 97 19 38 110 91 67 14 32 110 66 68 8 130 84 73 118 59 24 41 72
-121 150 55 37 138 27 104 66 124 9 51 109 47 125 109 148 8 29 47 72 146 149 61
-93 10 20 54 15 76 133 125 106 110 94 32 9 29 148 36 66 121 125 56 112 9 1 111
-116 94 57 8 108 50 62 140 71 74 89 1 83 152 20 85 17 145 102 39 56 115 47 150
-108 64 98 ^
-335 1 28 103 19 92 95 152 152 10 11 13 155 67 11 83 101 69 153 152 45 141 14
-120 129 140 119 59 2 89 73 70 83 29 16 67 81 29 1 54 65 96 117 2 37 47 128 33 3
-89 108 98 139 49 78 27 103 39 119 94 132 90 38 132 55 65 131 90 58 2 54 100 69
-118 22 44 19 7 148 93 25 29 123 81 64 131 55 30 1 89 38 97 82 64 9 28 86 123
-151 10 133 40 154 102 4 111 65 9 63 59 124 116 72 105 76 57 137 97 32 145 108
-78 112 50 43 34 75 20 22 129 68 11 118 74 125 118 57 17 20 129 53 65 61 144 1
-17 142 156 52 100 54 15 20 59 52 63 131 20 57 124 31 125 46 106 76 92 8 98 154
-152 80 114 15 140 136 112 100 17 92 25 151 150 80 99 69 83 49 43 156 102 19 57
-122 96 30 3 39 134 40 32 75 5 76 127 138 99 17 57 52 150 130 18 127 33 23 116
-107 78 77 77 42 69 68 48 41 69 33 75 40 49 128 103 4 146 93 10 83 66 96 152 30
-38 12 33 5 39 47 41 34 60 74 20 42 156 67 46 56 102 89 3 124 81 99 104 56 50 8
-61 74 55 15 87 108 28 138 47 93 60 2 124 46 126 103 91 145 36 25 116 122 79 79
-7 111 13 85 121 9 98 32 125 81 134 77 112 15 70 33 110 13 50 148 8 133 127 153
-45 19 42 121 94 45 91 95 117 22 9 46 6 26 31 53 150 8 148 128 53 141 ^
-326 0 80 123 24 147 1 112 82 159 63 74 97 109 33 151 32 89 87 132 117 46 129 59
-115 91 114 118 37 21 9 94 60 25 89 47 79 110 55 12 143 99 87 43 88 56 57 160 76
-12 71 128 77 146 117 95 105 42 66 3 76 20 76 101 100 118 149 45 26 143 148 32
-57 39 129 19 31 84 123 1 152 135 5 54 30 13 125 68 30 62 101 51 142 5 94 83 20
-116 24 107 109 105 91 42 17 27 93 69 3 139 68 79 38 84 2 85 128 126 122 131 46
-17 35 98 42 26 111 100 29 120 55 84 114 109 145 14 18 138 14 9 85 7 18 129 91 2
-94 51 133 82 87 123 64 39 8 103 38 75 110 78 7 9 45 115 42 138 135 86 78 16 62
-52 75 159 54 151 121 149 77 74 16 85 47 102 105 82 119 10 67 137 153 148 135 28
-49 26 151 153 36 80 11 130 113 24 44 30 102 24 58 133 122 140 99 24 156 54 119
-42 115 140 90 132 19 94 2 157 99 136 19 71 7 130 153 108 51 21 58 70 74 137 1
-40 111 149 5 103 6 27 76 141 23 125 140 1 72 29 152 103 87 51 93 29 80 132 77
-123 153 68 159 14 98 114 158 121 158 81 137 41 93 118 140 122 19 22 31 147 41 4
-89 150 50 120 144 113 104 20 44 53 97 20 4 90 60 48 84 74 25 138 23 62 61 159 5
-14 107 6 4 81 114 46 97 11 112 154 130 73 132 60 ^
-325 0 58 137 96 11 98 67 98 103 57 146 21 59 88 151 139 148 127 25 17 47 115 34
-160 109 107 51 64 28 69 13 49 149 69 141 90 93 118 64 10 1 67 80 35 111 13 58
-101 124 132 147 154 18 162 6 162 33 5 34 142 41 161 82 114 70 92 145 57 155 137
-114 79 44 36 48 48 21 14 13 40 33 14 150 33 32 54 143 14 4 101 142 23 93 136
-132 120 147 17 38 163 143 5 52 46 151 130 32 72 34 124 150 51 100 112 128 126
-65 10 28 87 81 159 131 19 99 54 125 110 58 119 28 78 129 104 140 126 38 154 27
-114 61 153 90 66 98 76 50 158 48 39 82 123 22 147 136 114 52 37 35 75 41 15 150
-60 52 55 103 21 23 129 95 24 71 47 97 130 50 140 144 106 100 9 64 19 117 122 71
-92 8 77 156 97 121 98 85 2 36 39 109 143 23 120 156 133 93 154 36 66 116 131
-160 127 162 161 46 142 14 141 81 141 63 86 117 104 3 146 39 127 34 133 102 106
-91 57 9 28 60 61 7 158 12 80 26 8 122 80 44 63 68 49 158 21 32 81 150 15 141
-108 161 64 46 124 123 31 99 27 105 109 98 112 9 37 12 116 149 51 73 144 124 4
-119 46 133 75 86 90 84 2 9 19 108 6 16 101 115 16 92 163 125 101 106 64 37 8 68
-40 42 130 41 24 89 115 43 112 85 121 125 92 154 9 46 115 7 140 108 158 ^
-336 0 38 42 155 103 9 62 65 102 122 10 138 160 125 47 158 43 91 69 123 132 35
-121 4 110 89 130 69 29 139 69 53 70 83 29 163 67 41 9 108 34 45 76 87 2 144 164
-98 33 160 79 78 48 89 9 38 134 93 146 79 54 122 80 38 112 55 55 101 70 8 129 44
-70 59 98 149 24 136 124 138 63 25 166 83 51 34 91 45 30 118 59 28 87 72 44 116
-28 36 103 101 113 10 114 62 111 71 65 126 53 19 114 86 42 85 36 57 137 57 159
-95 88 78 72 20 23 14 65 10 22 129 68 1 68 74 75 108 7 7 147 109 13 35 51 104
-158 164 122 126 2 50 4 132 127 59 52 13 81 20 47 107 74 148 115 46 106 46 82
-115 68 144 142 60 104 15 90 136 102 100 134 42 15 141 100 40 49 49 73 166 13
-156 82 166 37 82 96 137 130 166 134 20 139 45 122 56 107 98 79 124 17 32 130
-120 165 77 23 130 96 67 68 47 37 12 29 18 38 158 19 160 55 147 39 118 83 121 96
-43 137 33 66 86 112 147 155 149 140 5 19 17 148 161 10 44 159 146 57 16 26 102
-49 3 104 61 59 74 56 10 165 31 54 25 142 157 37 58 165 128 154 73 50 149 94 36
-76 63 71 135 26 5 116 122 29 69 7 101 140 75 81 136 78 2 125 71 84 57 62 162 40
-3 80 130 50 98 125 93 127 153 45 146 149 121 74 5 41 55 77 139 166 153 113 153
-21 53 140 145 148 88 162 ^
-341 0 4 62 78 167 102 144 94 55 141 63 29 97 91 24 115 166 80 69 132 99 1 120
-23 88 64 87 118 37 137 152 94 60 168 71 47 52 110 37 155 125 63 42 43 52 11 12
-151 31 12 44 110 32 128 117 68 87 24 39 164 76 145 58 101 91 100 140 151 143
-130 32 21 3 111 1 31 75 123 153 116 135 130 27 164 165 116 23 12 62 83 24 133
-139 49 74 154 80 158 80 64 105 91 6 142 27 75 24 128 112 41 79 29 84 145 40 128
-99 95 95 19 17 160 89 15 17 84 64 11 93 10 66 78 73 127 148 18 129 139 143 49
-150 9 84 82 154 85 15 88 82 60 87 19 12 133 58 20 39 65 51 141 134 27 70 167
-120 117 86 60 16 44 16 57 132 18 142 85 104 59 47 141 58 2 66 96 46 119 153 40
-110 126 103 90 144 13 26 106 144 80 145 134 103 95 24 44 21 84 140 13 97 104
-140 99 6 147 54 83 42 106 131 54 96 135 67 118 121 81 109 10 53 132 112 117 81
-33 155 49 61 38 119 1 13 102 131 148 94 131 143 67 123 148 89 104 135 72 145
-152 76 87 6 66 2 71 123 77 114 108 59 123 166 62 96 140 94 149 116 36 128 23 93
-91 95 113 162 156 165 111 166 4 44 105 5 120 99 113 68 11 169 35 70 2 147 125
-81 15 12 57 56 16 138 14 53 61 114 121 5 107 6 129 81 114 37 61 127 67 136 94
-73 114 32 34 119 72 11 98 37 74 73 51 146 161 35 146 ^
-349 0 142 139 121 91 16 163 2 88 171 133 100 62 51 46 10 24 150 49 131 60 114
-63 84 91 64 165 138 40 44 172 111 141 58 74 115 96 129 145 164 153 170 126 24
-169 16 115 41 125 46 87 61 92 145 39 155 92 78 70 35 27 21 48 21 151 159 40 15
-5 132 170 23 18 107 160 150 56 133 23 66 109 123 102 102 172 166 145 116 151 34
-1 151 130 5 36 34 97 114 15 82 128 112 119 99 29 138 165 42 36 159 95 19 63 36
-89 101 40 92 1 33 93 104 113 126 2 136 96 52 108 90 57 89 31 5 113 30 39 37 96
-4 147 127 105 43 165 35 75 23 143 105 24 25 10 94 12 160 102 95 170 71 20 70
-112 23 95 144 61 73 137 55 1 81 95 26 65 172 41 147 79 103 80 40 121 36 12 64
-98 169 93 111 115 48 127 9 39 107 131 115 118 162 161 10 142 14 123 54 141 36
-41 99 77 140 128 167 82 25 106 57 70 64 21 19 15 34 126 149 167 53 163 127 86
-35 8 54 23 40 140 3 169 45 150 152 96 81 143 28 28 124 87 13 90 9 87 109 53 67
-164 28 131 89 149 42 55 126 79 132 74 19 133 30 68 72 75 148 9 10 72 152 144 83
-106 153 74 163 98 92 97 37 19 8 32 31 24 121 14 152 89 79 7 76 155 85 76 107 83
-154 155 37 115 144 131 108 116 26 36 137 103 3 44 47 72 104 10 120 154 107 35
-152 19 85 69 105 120 29 109 171 104 65 124 39 11 127 57 41 70 83 29 157 67 164 ^
-370 1 167 63 16 27 58 60 2 99 128 71 33 160 70 51 3 44 149 2 89 84 101 43 18
-113 71 38 94 55 46 74 52 139 102 35 43 50 80 122 6 100 88 129 36 25 148 47 24 7
-55 36 30 82 32 19 78 63 26 71 28 167 85 56 167 95 159 78 26 66 35 65 90 44 159
-105 59 15 67 57 137 21 132 50 70 78 36 169 5 172 56 1 22 129 68 168 23 74 30 99
-138 174 120 91 153 8 42 68 158 155 104 99 133 5 135 96 82 59 52 144 36 20 38 62
-29 112 106 46 106 19 73 70 41 135 133 42 95 15 45 136 93 100 98 173 6 132 55 4
-4 31 64 130 162 156 64 157 19 46 96 92 103 139 134 2 94 18 86 38 89 62 61 79
-157 14 112 111 156 32 14 85 78 31 59 20 1 161 169 149 29 122 150 133 37 102 30
-109 65 85 51 174 110 164 66 77 76 111 119 131 95 5 1 166 103 134 141 17 158 123
-137 48 165 175 102 13 3 86 43 23 47 56 150 165 4 36 174 115 157 168 13 147 119
-109 55 41 140 67 27 31 27 53 126 17 163 116 122 160 60 7 92 113 66 45 109 60
-151 125 62 39 39 17 153 13 152 53 94 50 53 89 57 127 153 45 119 104 121 56 145
-172 19 41 103 166 108 68 126 12 53 131 127 148 52 134 168 50 48 155 72 132 82
-37 129 63 175 97 79 18 91 148 74 57 132 87 147 114 175 70 46 69 118 37 107 140
-94 60 156 59 47 34 110 25 143 113 39 12 43 28 157 158 145 1 12 26 98 2 116 117
-50 75 12 21 164 76 121 46 101 85 88 134 146 127 143 79 ^
-364 0 32 164 146 93 162 31 66 123 144 80 135 94 137 156 107 157 173 62 65 176
-124 112 4 65 127 44 131 53 19 105 91 149 106 27 57 158 92 85 14 79 20 84 127
-174 128 72 68 59 171 17 124 80 167 8 57 28 172 66 144 48 42 37 109 121 18 120
-103 116 13 132 39 73 145 76 158 43 82 33 51 153 164 97 13 2 3 20 24 114 98 9 25
-131 102 99 86 42 16 26 159 39 105 161 133 49 59 41 20 105 31 136 30 87 10 119
-135 13 83 99 58 45 99 156 26 61 135 143 80 118 107 76 77 24 44 12 66 95 147 61
-86 140 99 167 138 54 47 42 97 122 18 60 90 40 73 85 63 82 1 35 96 94 81 54 15
-128 40 52 2 101 1 165 93 113 130 85 95 98 58 105 112 53 68 108 72 100 152 49 87
-140 39 154 62 114 77 105 63 50 87 157 26 78 122 67 140 71 170 119 5 93 64 50
-104 144 129 138 75 130 4 178 60 139 120 54 113 32 2 133 17 43 163 129 89 72 149
-155 30 38 7 138 5 44 61 69 76 175 107 6 93 81 114 28 25 82 22 118 58 73 96 175
-177 92 36 11 98 171 38 28 42 146 125 178 88 136 139 103 67 10 151 151 70 153
-115 94 32 51 34 177 173 132 49 119 54 96 45 78 73 64 159 120 22 20 154 111 117
-58 56 109 72 117 139 152 147 170 102 18 169 4 97 41 101 22 69 55 92 145 27 155
-62 54 64 29 21 3 48 21 133 147 40 3 178 120 152 17 173 83 148 138 26 127 23 48
-91 117 90 72 166 142 133 98 139 22 150 151 130 140 ^
-372 0 34 70 78 161 64 92 112 110 72 175 102 138 179 173 159 59 19 27 18 53 92
-22 65 156 170 57 104 86 126 148 118 155 78 43 63 90 48 80 168 142 68 12 39 174
-69 168 147 118 96 34 129 35 75 5 107 60 170 180 147 85 3 133 75 95 152 71 175
-43 94 178 50 144 16 46 101 46 165 45 68 163 38 172 5 138 61 85 62 177 76 36 167
-19 53 151 66 66 97 3 100 164 12 98 131 70 109 162 161 156 142 14 105 27 141 9
-178 81 50 113 110 131 37 16 79 12 34 37 167 173 10 152 7 81 140 158 26 136 82
-50 172 154 45 160 31 122 167 142 9 150 125 51 54 125 174 10 124 51 177 81 173
-69 109 8 22 155 19 86 62 149 33 37 108 34 96 29 174 133 167 50 54 66 130 9 1 36
-134 108 65 97 126 56 163 71 83 88 10 1 8 178 22 6 112 169 116 89 43 153 40 146
-85 31 89 74 154 137 28 115 117 122 108 98 8 27 110 103 176 17 20 27 77 10 93
-145 80 17 143 165 76 69 78 102 20 91 171 95 29 115 176 166 109 39 23 70 83 29
-148 67 163 161 33 4 15 46 42 2 69 104 53 33 160 64 33 155 14 131 160 59 78 71
-19 176 107 65 38 82 55 40 56 40 115 84 29 25 44 68 104 176 76 64 123 18 25 136
-23 6 171 31 30 30 58 14 13 72 57 14 41 28 143 73 26 167 83 147 54 2 36 11 65 66
-38 141 99 41 179 55 158 57 137 179 114 20 58 78 12 157 175 166 50 177 22 129 68
-168 175 74 93 114 174 102 79 135 172 36 44 158 149 92 81 109 157 111 72 119 ^
-372 0 59 52 112 180 20 30 22 173 80 98 46 106 179 65 30 17 127 125 26 87 15 5
-136 85 100 66 141 182 124 15 156 148 15 56 98 146 156 48 149 3 14 96 52 79 115
-134 170 54 178 54 22 73 30 45 39 133 182 96 103 148 176 6 45 62 183 51 180 153
-145 145 117 21 90 118 109 21 62 22 101 49 53 11 142 86 132 66 69 44 79 87 115
-55 5 169 150 63 110 109 177 150 91 129 40 149 159 102 165 3 70 27 175 23 56 126
-165 164 20 158 91 157 136 157 131 111 69 39 33 132 43 19 175 179 37 118 9 155
-116 122 128 52 7 84 89 58 13 85 44 135 125 54 183 23 161 145 173 136 29 62 50
-13 57 25 127 153 45 95 64 121 40 121 140 171 9 71 166 68 28 102 4 53 123 111
-148 20 102 160 34 8 139 32 116 66 13 113 63 143 97 63 10 59 124 66 41 132 71
-115 106 151 46 22 45 118 37 67 124 94 60 140 43 47 10 110 9 127 97 7 156 43 180
-125 126 137 145 12 2 82 146 100 117 26 59 180 181 164 76 89 30 101 77 72 126
-114 95 143 102 32 149 131 83 157 31 61 123 139 60 135 74 169 122 151 102 137
-168 62 55 166 119 97 163 60 112 24 116 38 178 105 91 134 86 27 47 138 72 70 183
-79 15 84 117 154 128 57 53 39 161 17 104 75 157 3 42 8 167 51 124 38 22 17 99
-106 18 115 83 101 177 122 179 14 68 140 71 143 18 82 18 31 133 154 77 172 176
-167 179 9 99 78 183 111 92 89 86 32 16 16 144 29 90 146 128 29 34 31 5 85 16
-116 10 82 174 119 125 79 ^
-391 0 59 75 18 5 59 132 26 21 127 119 80 94 83 52 61 24 44 4 50 55 115 29 70
-140 99 159 130 54 15 42 89 114 173 28 50 16 33 53 47 58 180 19 64 78 49 30 186
-104 32 44 157 85 1 149 85 97 114 77 63 58 50 89 80 21 36 84 72 60 152 25 87 108
-15 138 54 106 77 97 23 42 55 149 181 62 106 43 132 31 138 111 176 93 40 10 96
-128 105 114 43 98 4 146 20 107 120 14 113 181 101 1 19 155 113 57 64 117 131 6
-22 186 138 184 36 61 29 36 175 107 6 61 81 114 20 180 42 169 102 26 73 80 151
-153 68 4 11 98 139 6 175 34 146 93 154 88 128 139 79 35 2 135 119 46 129 91 86
-179 51 18 169 141 108 49 103 46 72 21 70 49 64 151 96 185 175 130 111 85 58 32
-101 40 101 131 136 139 170 70 10 169 175 73 41 69 177 45 47 92 145 11 155 22 22
-56 21 13 166 48 21 109 131 40 174 178 104 128 9 149 51 132 122 173 119 23 24 67
-109 74 32 158 110 117 74 123 6 118 151 130 150 167 34 55 58 146 54 72 112 105
-57 160 82 123 159 153 159 39 19 7 8 33 87 12 50 146 150 37 104 71 126 133 108
-145 68 38 38 90 43 75 148 122 43 2 39 154 54 163 147 113 91 29 109 35 75 182 87
-35 155 170 127 80 185 118 60 95 142 71 165 28 84 168 25 144 178 31 81 41 160 25
-53 143 23 172 172 133 51 75 52 157 51 36 157 181 28 141 51 41 87 165 85 154 184
-93 131 45 104 162 161 141 142 14 95 12 141 181 158 71 35 98 100 111 12 11 64
-174 14 22 152 173 5 132 179 56 135 153 11 121 57 30 152 139 40 140 53 ^
-384 1 106 159 118 167 150 101 11 30 109 150 184 124 19 169 73 165 53 109 158
-172 147 11 46 38 149 25 21 92 184 64 179 158 133 135 34 38 58 114 9 183 4 118
-76 49 89 102 40 163 47 75 80 176 175 8 154 14 180 104 153 84 89 11 129 8 138 85
-181 73 66 154 121 20 115 93 114 108 82 182 19 86 103 176 183 186 177 53 10 69
-137 56 1 135 141 68 69 54 86 12 75 171 87 187 107 144 150 93 23 7 70 83 29 140
-67 139 153 183 178 189 30 18 2 29 72 29 33 160 56 9 123 164 107 136 19 70 31
-177 152 99 57 38 66 55 32 32 24 83 60 21 1 36 52 80 168 44 32 115 184 25 120
-181 172 155 189 22 30 26 180 5 64 49 188 1 28 111 57 176 167 67 131 22 160 186
-169 65 34 30 117 91 17 163 39 134 57 137 155 90 170 42 78 170 141 167 158 42
-177 22 129 68 168 143 74 150 85 82 174 78 63 111 156 28 12 158 141 76 57 77 125
-79 40 12 59 52 88 156 20 24 182 149 56 92 46 106 167 59 189 121 119 14 81 15
-165 136 79 100 42 117 182 118 175 138 124 3 50 74 134 156 36 143 181 180 96 22
-61 97 134 164 24 166 30 10 61 6 33 9 115 176 84 97 142 152 15 50 165 45 168 135
-133 127 93 15 66 94 91 9 32 16 95 37 29 171 118 68 108 66 63 20 55 63 103 25 5
-163 138 33 92 85 165 144 67 123 34 137 147 102 147 3 58 15 157 5 56 108 165 152
-8 146 73 157 112 133 119 105 39 27 27 126 25 13 151 161 25 112 3 149 116 122
-104 46 7 78 71 52 179 67 32 123 125 48 159 11 137 139 161 110 ^
-394 0 2 26 50 161 21 182 127 153 45 68 19 121 22 94 104 144 166 35 166 23 176
-75 188 53 114 93 148 177 66 151 16 156 121 180 98 48 179 95 63 107 97 45 1 23
-97 57 23 132 53 79 97 124 19 188 18 118 37 22 106 94 60 122 25 47 176 110 184
-109 79 164 120 43 153 89 90 128 109 12 168 64 110 82 117 192 41 171 163 164 76
-53 12 101 68 54 117 78 59 143 84 32 122 104 65 148 31 52 123 130 24 135 38 151
-95 142 93 101 159 62 37 148 110 70 127 51 85 181 89 11 142 105 91 107 50 27 29
-102 36 43 165 79 6 84 99 118 128 30 26 3 143 17 68 66 139 187 15 165 158 24 88
-20 179 174 81 79 18 106 47 74 150 104 179 162 59 131 62 116 166 82 184 188 97
-136 41 136 167 140 143 175 72 42 174 148 75 74 71 86 14 16 191 117 11 63 119
-119 186 182 13 171 49 182 80 167 73 147 119 107 164 41 57 181 168 29 114 26 184
-121 101 80 76 65 34 49 24 44 191 38 25 91 5 58 140 99 153 124 54 184 42 83 108
-155 4 20 191 3 29 35 40 180 7 40 66 25 12 180 86 26 38 139 73 1 137 79 85 102
-71 39 28 44 77 56 190 12 66 72 30 152 7 87 84 190 126 48 100 77 91 186 36 31
-143 163 50 94 25 126 1 114 105 170 93 22 173 90 116 87 96 19 74 4 122 183 83
-120 177 113 169 181 77 182 1 149 101 33 58 93 113 181 10 186 138 184 30 61 192
-6 175 107 6 37 81 114 14 162 12 145 90 2 73 68 133 135 50 173 11 98 115 175 151
-28 146 69 136 88 122 139 61 11 189 123 95 28 111 73 80 155 51 6 163 117 90 49
-91 40 54 189 ^
-390 0 62 25 64 143 72 169 151 106 111 53 58 8 93 8 85 123 120 131 170 38 2 169
-167 49 41 37 153 21 39 92 145 190 155 177 185 48 13 5 150 48 21 85 115 40 166
-178 88 104 1 125 19 116 106 141 111 23 43 101 58 187 150 78 101 50 107 185 86
-151 130 134 143 34 31 26 122 38 40 112 97 33 136 50 99 127 121 159 7 19 170 187
-1 79 191 26 130 118 5 104 47 126 109 92 129 52 30 193 90 35 67 116 90 3 181 39
-122 30 155 147 105 83 21 77 35 75 174 55 190 131 154 95 72 185 94 36 95 126 71
-149 4 68 152 180 144 146 7 49 33 152 188 29 111 194 172 148 125 35 59 36 125 11
-36 141 149 183 125 27 1 71 133 61 138 168 85 131 5 96 162 161 117 142 14 79 183
-141 165 126 55 11 74 84 79 167 3 40 142 177 193 128 173 192 100 163 16 127 145
-182 97 17 193 120 115 32 108 18 96 154 103 152 150 86 181 15 99 135 179 124 194
-164 68 160 43 109 138 152 142 6 21 23 149 20 11 82 164 44 159 148 133 115 24 28
-53 104 9 183 179 108 56 39 84 87 30 163 32 70 75 166 170 8 139 9 175 99 143 64
-89 186 114 183 133 85 161 63 61 154 111 15 115 78 109 108 72 177 14 71 103 176
-173 176 157 38 10 54 132 41 186 130 126 63 69 39 76 7 65 171 82 172 102 124 140
-83 13 192 70 83 29 135 67 124 148 163 173 184 20 3 2 4 52 14 33 160 51 189 103
-144 92 121 189 65 6 162 137 94 52 38 56 55 27 17 14 63 45 16 181 31 42 65 163
-24 12 110 174 25 110 166 162 145 174 17 30 6 170 59 44 183 171 28 91 47 156 172
-^
-400 1 51 115 188 136 154 145 65 2 22 93 83 191 147 23 110 57 137 131 66 138 26
-78 146 125 159 150 34 177 22 129 68 168 111 74 118 77 50 174 54 47 87 140 20
-178 158 133 60 33 45 93 47 8 170 59 52 56 124 20 16 150 117 24 84 46 106 151 51
-158 173 113 111 196 73 15 133 136 71 100 10 85 182 110 143 114 92 185 42 42 118
-156 20 135 173 156 96 180 37 73 134 156 182 150 196 192 45 172 17 167 91 168 68
-89 134 120 190 173 34 141 37 152 111 117 103 61 7 34 62 67 191 190 8 87 21 195
-139 86 44 76 66 55 186 23 31 87 183 5 155 122 191 68 53 149 136 35 115 26 121
-131 102 123 3 42 197 133 179 56 84 165 136 190 130 49 157 80 101 103 97 197 11
-19 118 1 5 119 137 9 104 193 141 116 122 72 38 7 70 47 44 155 43 16 107 125 40
-127 193 105 131 145 108 185 6 50 141 1 167 127 153 45 53 192 121 12 79 84 129
-151 15 166 196 156 60 188 53 109 83 148 162 46 146 6 136 111 160 88 38 169 85
-63 87 97 35 194 3 82 52 13 132 43 59 92 109 4 178 3 118 37 195 96 94 60 112 15
-47 166 110 179 99 69 149 100 43 138 69 70 123 89 12 158 54 90 72 117 182 31 166
-153 164 76 33 2 101 63 44 112 58 39 143 74 32 107 89 55 143 31 47 123 125 4 135
-18 141 80 137 88 81 154 62 27 138 105 55 107 46 70 166 74 194 122 105 91 92 30
-27 19 82 16 28 155 79 1 84 89 98 128 15 11 181 133 17 48 61 129 187 150 153 9
-68 10 164 159 71 64 18 101 27 59 135 94 179 142 54 126 57 101 146 82 174 173 77
-126 21 116 162 125 123 165 57 22 169 153 ^
-394 0 47 60 57 86 16 184 96 197 42 98 112 165 154 199 157 21 168 52 146 66 126
-119 93 150 20 36 153 140 194 93 26 156 114 80 80 55 44 13 35 24 44 191 24 190
-63 177 44 140 99 146 117 54 163 42 76 101 134 176 185 177 168 1 21 19 180 193
-12 52 197 191 173 65 19 31 118 59 1 123 72 71 88 64 11 193 37 63 28 169 184 45
-72 195 152 186 87 56 176 112 41 93 77 84 158 29 3 136 142 36 80 4 119 166 86 98
-163 93 1 145 83 102 66 75 191 46 4 94 155 55 120 149 113 148 181 49 175 180 142
-87 5 51 65 92 167 196 186 138 184 23 61 164 171 175 107 6 9 81 114 7 141 177
-117 76 174 73 54 112 114 29 152 11 98 87 154 123 21 146 41 115 88 115 139 40
-183 189 109 67 7 90 52 73 127 51 192 156 89 69 49 77 33 33 182 57 10 64 138 57
-159 136 91 111 33 58 193 88 188 75 118 110 126 170 18 197 169 162 34 41 17 138
-6 34 92 145 185 155 157 170 43 8 140 48 21 70 105 40 161 178 78 89 196 110 199
-106 96 121 106 23 185 28 96 48 167 145 58 91 35 97 180 66 151 130 124 128 34 16
-6 107 28 20 112 92 18 121 30 84 107 101 159 187 19 155 182 181 74 186 11 120 98
-185 104 32 126 94 82 119 42 25 173 90 30 62 96 70 178 176 39 102 15 150 147 100
-78 16 57 35 75 169 35 170 116 144 75 67 185 79 21 95 116 71 139 189 58 142 160
-144 126 192 29 28 147 173 14 91 184 172 133 120 25 49 26 105 186 36 131 129 163
-115 12 176 61 113 46 128 158 80 131 180 91 162 161 102 142 14 69 173 141 155
-106 45 196 59 74 59 147 195 ^
-412 0 16 110 153 177 104 173 192 68 147 179 119 137 166 73 180 169 88 91 24 76
-10 80 146 79 128 150 62 149 194 83 111 171 124 170 156 60 152 27 109 106 120
-134 201 184 202 149 12 198 66 132 12 127 132 133 83 8 12 45 88 9 183 155 92 24
-23 76 63 14 163 8 62 67 150 162 8 115 1 167 91 127 32 89 162 90 159 125 85 129
-47 53 154 95 7 115 54 101 108 56 169 6 47 103 176 157 160 125 14 10 30 124 17
-178 122 102 55 69 15 60 202 49 171 74 148 94 92 124 67 200 184 70 83 29 127 67
-100 140 131 165 176 4 182 2 167 20 193 33 160 43 173 71 112 68 97 157 57 169
-138 113 86 44 38 40 55 19 196 201 31 21 8 165 23 26 41 155 195 183 102 158 25
-94 142 146 129 150 9 30 177 154 195 51 36 175 139 28 59 31 124 167 41 105 173
-121 134 130 65 185 17 78 78 181 137 13 95 57 137 116 51 118 16 78 131 115 154
-145 29 177 22 129 68 168 91 74 98 72 30 174 39 37 72 130 15 163 158 128 50 18
-25 73 27 191 150 59 52 36 104 20 11 130 97 4 79 46 106 141 46 138 163 108 106
-191 68 15 113 136 66 100 193 65 182 105 123 99 72 180 37 22 108 156 10 130 168
-141 96 160 22 58 134 151 162 140 181 187 35 157 7 147 76 163 58 84 129 100 190
-153 24 126 32 142 96 107 88 41 2 14 42 52 186 170 3 82 11 180 119 66 29 56 66
-50 171 3 11 77 163 5 150 112 171 53 33 139 131 15 110 21 111 121 102 108 3 32
-192 118 169 56 69 165 126 185 120 34 157 60 81 93 92 177 1 14 113 189 99 122
-202 99 193 136 116 122 52 33 7 65 32 39 140 28 6 97 125 35 107 188 85 126 135
-98 175 189 50 121 184 116 ^
-413 1 127 153 45 32 164 121 203 58 56 108 130 192 166 168 128 39 188 53 102 69
-148 141 18 139 197 108 97 132 74 24 155 71 63 59 97 21 194 180 61 45 204 132 29
-31 85 88 188 164 187 118 37 167 82 94 60 98 1 47 152 110 172 85 55 128 72 43
-117 41 42 116 61 12 144 40 62 58 117 168 17 159 139 164 76 5 193 101 56 30 105
-30 11 143 60 32 86 68 41 136 31 40 123 118 181 135 195 127 59 130 81 53 147 62
-13 124 98 34 79 39 49 145 53 180 94 105 91 71 2 27 5 54 193 7 141 79 199 84 75
-70 128 199 195 160 119 17 20 54 115 187 184 129 146 193 40 201 143 138 57 43 18
-94 204 38 114 80 179 114 47 119 50 80 118 82 160 152 49 112 198 88 155 104 95
-151 36 199 162 100 27 50 47 86 195 16 179 81 192 27 83 107 150 134 194 147 1
-158 32 131 61 111 119 83 140 5 21 133 120 174 78 26 136 109 65 80 40 29 203 25
-24 44 191 14 170 43 162 34 140 99 141 112 54 148 42 71 96 119 161 165 167 148
-186 11 4 180 188 197 42 182 181 168 50 14 26 103 49 1 113 67 61 78 59 196 173
-32 53 8 154 169 30 72 175 152 176 87 36 166 102 36 88 77 79 138 24 188 131 127
-26 70 194 114 146 66 93 158 93 191 125 78 92 51 60 176 26 4 74 135 35 120 129
-113 133 181 29 170 170 137 77 190 46 45 77 157 191 186 138 184 18 61 144 151
-175 107 6 194 81 114 2 126 157 97 66 159 73 44 97 99 14 137 11 98 67 139 103 16
-146 21 100 88 110 139 25 168 189 99 47 197 75 37 68 107 51 187 151 69 54 49 67
-28 18 172 52 200 64 133 42 149 121 76 111 13 58 183 83 173 65 113 100 121 170
-203 197 169 157 19 202 ^
-434 1 193 114 190 26 92 145 177 155 125 146 35 200 124 48 21 46 89 40 153 178
-62 65 196 86 175 90 80 89 98 23 169 4 88 32 135 137 26 75 11 81 172 34 151 130
-108 104 34 200 182 83 12 196 112 84 202 97 206 60 75 69 159 163 19 131 174 157
-66 178 195 104 66 161 104 8 126 70 66 103 26 17 141 90 22 54 64 38 146 168 39
-70 199 142 147 92 70 8 25 35 75 161 3 138 92 128 43 59 185 55 205 95 100 71 123
-173 42 126 128 144 94 176 205 20 139 149 198 59 168 172 109 112 9 33 10 73 154
-36 115 97 131 99 196 144 45 81 22 112 142 72 131 148 83 162 161 78 142 14 53
-157 141 139 74 29 180 35 58 27 115 198 1 90 138 167 89 173 192 48 137 159 114
-132 156 58 160 154 68 76 19 56 5 70 141 64 113 150 47 129 184 73 96 166 124 155
-151 55 147 17 109 86 100 129 201 164 192 149 7 193 56 112 200 107 122 133 63
-206 2 40 78 9 183 140 82 4 13 71 48 4 163 201 57 62 140 157 8 100 204 162 86
-117 12 89 147 75 144 120 85 109 37 48 154 85 2 115 39 96 108 46 164 1 32 103
-176 147 150 105 207 10 15 119 2 173 117 87 50 69 50 202 39 171 69 133 89 72 114
-57 195 179 70 83 29 122 67 85 135 111 160 171 202 172 2 147 183 33 160 38 163
-51 92 53 82 137 52 149 123 98 81 39 38 30 55 14 186 196 11 6 3 155 18 16 26 150
-180 168 97 148 25 84 127 136 119 135 4 30 162 144 195 46 31 170 119 28 39 21
-104 167 31 95 158 106 114 115 65 170 12 63 73 171 127 3 80 57 137 101 36 98 6
-78 116 105 149 140 24 177 22 129 68 168 71 74 78 67 10 174 24 27 57 120 10 148
-158 123 40 3 5 53 7 176 130 59 52 16 84 20 6 110 77 192 74 46 106 131 41 118
-153 144 ^
-438 1 99 184 61 15 85 136 59 100 172 37 182 98 95 78 44 173 30 204 94 156 206
-123 161 120 96 132 1 37 134 144 134 126 160 180 21 136 203 119 55 156 44 77 122
-72 190 125 10 105 25 128 75 93 67 13 205 196 14 31 179 142 206 75 207 159 91 38
-8 28 66 43 150 185 193 63 135 5 143 98 143 32 5 125 124 197 103 14 97 107 102
-87 3 18 185 97 155 56 48 165 112 178 106 13 157 32 53 79 85 149 197 7 106 175
-203 71 101 195 92 193 129 116 122 24 26 7 58 11 32 119 7 202 83 125 28 79 181
-57 119 121 84 161 168 50 93 163 131 127 153 45 17 144 121 198 43 36 93 115 177
-166 148 108 24 188 53 97 59 148 126 208 134 192 88 87 112 64 14 145 61 63 39 97
-11 194 165 46 40 199 132 19 11 80 73 178 154 177 118 37 147 72 94 60 88 201 47
-142 110 167 75 45 113 52 43 102 21 22 111 41 12 134 30 42 48 117 158 7 154 129
-164 76 195 188 101 51 20 100 10 201 143 50 32 71 53 31 131 31 35 123 113 166
-135 180 117 44 125 76 33 142 62 3 114 93 19 59 34 34 130 38 170 74 105 91 56
-192 27 205 34 178 202 131 79 199 84 65 50 128 189 185 145 109 17 49 105 187 174
-114 141 183 20 196 128 123 47 28 18 89 189 23 99 70 179 94 42 114 45 65 98 82
-150 137 29 102 183 68 150 89 75 141 21 184 157 80 7 40 37 86 190 16 174 66 187
-12 68 102 135 114 189 137 191 148 12 116 56 96 119 73 130 200 6 113 100 154 63
-26 116 104 50 80 25 14 193 15 24 44 191 4 150 23 147 24 140 99 136 107 54 133
-42 66 91 104 146 145 157 128 171 1 199 180 183 182 32 167 171 163 35 9 21 88 39
-1 103 62 51 68 54 181 153 27 43 198 139 154 15 72 155 152 166 87 16 156 92 31
-83 77 74 118 19 173 126 202 ^
-431 0 10 54 178 106 114 34 85 150 93 175 93 70 76 27 36 152 207 4 42 103 3 120
-97 113 109 181 210 162 154 129 61 166 38 13 53 141 183 186 138 184 10 61 112
-119 175 107 6 170 81 114 207 102 125 65 50 135 73 28 73 75 203 113 11 98 35 115
-71 8 146 202 76 88 102 139 1 144 189 83 15 181 51 13 60 75 51 179 143 37 30 49
-51 20 207 156 44 184 64 125 18 133 97 52 111 194 58 167 75 149 49 105 84 113
-170 179 197 169 149 208 41 178 99 180 21 92 145 172 155 105 131 30 208 200 114
-48 21 31 79 40 148 178 52 50 196 71 160 80 70 69 93 23 159 202 83 22 115 132 6
-65 209 71 167 14 151 130 98 89 34 190 167 68 2 181 112 79 192 82 191 45 55 49
-159 148 19 116 169 142 61 173 185 94 46 146 104 206 126 55 56 93 16 12 121 90
-17 49 44 18 126 163 39 50 189 137 147 87 65 3 5 35 75 156 196 118 77 118 23 54
-185 40 195 95 90 71 113 163 32 116 108 144 74 166 190 15 134 134 188 39 158 172
-94 107 212 23 53 134 36 105 77 111 89 186 124 35 61 7 102 132 67 131 128 78 162
-161 63 142 14 43 147 141 129 54 19 170 20 48 7 95 198 199 70 123 157 74 173 192
-28 127 139 109 127 146 43 140 139 48 61 14 36 60 136 49 98 150 32 109 174 63 81
-161 124 140 146 50 142 7 109 66 80 124 201 144 182 149 2 188 46 92 185 87 112
-133 43 201 205 35 68 9 183 125 72 197 3 66 33 207 163 191 52 57 130 152 8 85
-204 157 81 107 205 89 132 60 129 115 85 89 27 43 154 75 210 115 24 91 108 36
-159 209 17 103 176 137 140 85 197 10 114 200 168 112 72 45 69 198 40 202 29 171
-64 118 84 52 104 47 190 174 70 83 29 117 67 70 130 91 155 166 197 162 2 127 193
-173 82 ^
-464 1 160 31 149 23 64 32 61 109 45 121 102 77 74 32 38 16 55 7 172 189 198 200
-211 141 11 2 5 143 159 147 90 134 25 70 106 122 105 114 212 30 141 130 195 39
-24 163 91 28 11 7 76 167 17 81 137 85 86 94 65 149 5 42 66 157 113 204 59 57
-137 80 15 70 207 78 95 91 142 133 17 177 22 129 68 168 43 74 50 60 197 174 3 13
-36 106 3 127 158 116 26 197 192 25 194 155 102 59 52 203 56 20 214 82 49 171 67
-46 106 117 34 90 139 96 94 179 56 15 65 136 54 100 157 17 182 93 75 63 24 168
-25 189 84 156 201 118 156 105 96 112 201 22 134 139 114 116 145 175 11 121 198
-99 40 151 34 72 117 52 190 105 90 20 118 60 83 52 208 205 181 209 16 174 122
-206 70 202 144 71 18 208 8 66 38 135 170 178 53 115 5 138 88 123 17 200 115 119
-182 98 9 87 97 102 72 3 8 180 82 145 56 33 165 102 173 96 213 157 12 33 69 80
-129 192 2 101 165 203 51 86 190 87 193 124 116 122 4 21 7 53 211 27 104 207 197
-73 125 23 59 176 37 114 111 74 151 153 50 73 148 116 127 153 45 2 124 121 193
-28 16 78 100 162 166 128 88 9 188 53 92 49 148 111 193 129 187 68 77 92 54 4
-135 51 63 19 97 1 194 150 31 35 194 132 9 206 75 58 168 144 167 118 37 127 62
-94 60 78 196 47 132 110 162 65 35 98 32 43 87 1 2 106 21 12 124 20 22 38 117
-148 212 149 119 164 76 180 183 101 46 10 95 205 186 143 40 32 56 38 21 126 31
-30 123 108 151 135 165 107 29 120 71 13 137 62 208 104 88 4 39 29 19 115 23 160
-54 105 91 41 177 27 200 14 163 192 121 79 199 84 55 30 128 179 175 130 99 17
-195 44 95 187 164 99 136 173 191 113 108 37 13 18 84 174 8 84 60 179 74 37 109
-40 50 78 82 140 122 9 92 168 48 145 74 55 131 6 169 152 60 202 30 27 86 185 16
-169 51 182 212 53 97 185 ^
-452 1 82 181 121 167 132 198 92 48 72 119 57 114 184 200 81 68 122 39 26 84 96
-26 80 1 208 177 217 24 44 191 206 118 209 123 8 140 99 128 99 54 109 42 58 83
-80 122 113 141 96 147 203 183 180 175 158 16 143 155 155 11 1 13 64 23 1 87 54
-35 52 46 157 121 19 27 174 115 130 209 72 123 152 150 87 202 140 76 23 75 77 66
-86 11 149 118 88 44 168 101 94 14 80 145 93 165 73 65 66 12 21 137 192 4 22 83
-201 120 77 113 94 181 195 157 144 124 51 151 33 211 38 131 178 186 138 184 5 61
-92 99 175 107 6 155 81 114 207 87 105 45 40 120 73 18 58 60 193 98 11 98 15 100
-51 3 146 187 61 88 97 139 204 129 189 73 213 171 36 216 55 55 51 174 138 17 15
-49 41 15 197 146 39 174 64 120 3 123 82 37 111 179 58 157 70 134 39 100 74 108
-170 164 197 169 144 198 41 163 84 170 16 92 145 167 155 85 116 25 208 200 104
-48 21 16 69 40 143 178 42 35 196 56 145 70 60 49 88 23 149 192 78 12 95 127 204
-55 199 61 162 212 151 130 88 74 34 180 152 53 210 166 112 74 182 67 176 30 35
-29 159 133 19 101 164 127 56 168 175 84 26 131 104 196 126 40 46 83 6 7 101 90
-12 44 24 216 106 158 39 30 179 132 147 82 60 216 203 35 75 151 181 98 62 108 3
-49 185 25 185 95 80 71 103 153 22 106 88 144 54 156 175 10 129 119 178 19 148
-172 79 102 207 13 208 33 114 36 95 57 91 79 176 104 25 41 210 92 122 62 131 108
-73 162 161 48 142 14 33 137 141 119 34 9 160 5 38 205 75 198 189 50 108 147 59
-173 192 8 117 119 104 122 136 28 120 124 28 46 9 16 213 50 131 34 83 150 17 89
-164 53 66 156 124 125 141 45 137 215 109 46 60 119 201 124 172 149 215 183 36
-72 170 67 102 133 23 196 200 30 58 9 183 110 62 182 211 61 18 202 163 97 ^
-463 1 45 50 116 145 8 64 204 150 74 93 184 89 111 39 108 108 85 61 13 36 154 61
-210 115 3 84 108 22 152 209 216 103 176 123 126 57 183 10 199 107 186 161 105
-51 38 69 184 26 202 15 171 57 97 77 24 90 33 183 167 70 83 29 110 67 49 123 63
-148 159 190 148 2 99 172 159 33 160 26 139 3 44 17 46 89 40 101 87 62 69 27 38
-6 55 2 162 184 183 190 211 131 6 212 210 138 144 132 85 124 25 60 91 112 95 99
-212 30 126 120 195 34 19 158 71 28 211 217 56 167 7 71 122 70 66 79 65 134 27
-61 147 103 199 44 57 137 65 50 202 78 80 81 137 128 12 177 22 129 68 168 23 74
-30 55 182 174 208 3 21 96 218 112 158 111 16 187 177 5 179 140 82 59 52 188 36
-20 214 62 29 156 62 46 106 107 29 70 129 91 89 174 51 15 45 136 49 100 142 217
-182 88 55 48 4 163 20 174 74 156 196 113 151 90 96 92 191 7 134 134 94 106 130
-170 1 106 193 79 25 146 24 67 112 32 190 85 210 75 15 108 45 73 37 193 205 166
-194 1 169 102 206 65 197 129 51 218 198 208 66 33 120 155 163 43 95 5 133 78
-103 2 185 105 114 167 93 4 77 87 102 57 3 218 175 67 135 56 18 165 92 168 86
-203 157 212 13 59 75 109 187 217 96 155 203 31 71 185 82 193 119 116 122 204 16
-7 48 201 22 89 197 192 63 125 18 39 171 17 109 101 64 141 138 50 53 133 101 127
-153 45 207 104 121 188 13 216 63 85 147 166 108 68 214 188 53 87 39 148 96 178
-124 182 48 67 72 44 214 125 41 63 219 97 211 194 135 16 30 189 132 219 191 70
-43 158 134 157 118 37 107 52 94 60 68 191 47 122 110 157 55 25 83 12 43 72 201
-202 101 1 12 114 10 2 28 117 138 207 144 109 164 76 165 178 101 41 90 190 171
-143 30 32 41 23 11 121 31 25 123 103 136 135 150 97 14 115 66 213 132 62 203 94
-83 209 19 24 4 100 8 150 160 ^
-474 0 105 91 20 156 27 193 208 142 178 107 79 199 84 41 2 128 165 161 109 85 17
-174 37 81 187 150 78 129 159 194 184 92 87 23 214 18 77 153 209 63 46 179 46 30
-102 33 29 50 82 126 101 203 78 147 20 138 53 27 117 207 148 145 32 181 16 13 86
-178 16 162 30 175 198 32 90 99 66 177 113 155 124 186 80 44 60 119 49 106 176
-192 65 52 106 27 26 68 92 14 80 211 200 169 213 24 44 191 202 102 197 111 140
-99 124 95 54 97 42 54 79 68 110 97 133 80 135 199 175 180 171 146 8 131 147 151
-221 219 9 52 15 1 79 50 27 44 42 145 105 15 19 162 103 118 201 72 107 152 142
-87 190 132 68 19 71 77 62 70 7 137 114 76 214 36 160 97 78 220 76 141 93 157 57
-61 58 9 125 180 4 6 67 189 120 61 113 82 181 183 153 136 120 43 139 29 199 26
-123 174 186 138 184 1 61 76 83 175 107 6 143 81 114 207 75 89 29 32 108 73 10
-46 48 185 86 11 98 221 88 35 221 146 175 49 88 93 139 196 117 189 65 201 163 24
-208 51 39 51 170 134 1 3 49 33 11 189 138 35 166 64 116 213 115 70 25 111 167
-58 149 66 122 31 96 66 104 170 152 197 169 140 190 41 151 72 162 12 92 145 163
-155 69 104 21 208 200 96 48 21 4 61 40 139 178 34 23 196 44 133 62 52 33 84 23
-141 184 74 4 79 123 192 47 191 53 158 200 151 130 80 62 34 172 140 41 206 154
-112 70 174 55 164 18 19 13 159 121 19 89 160 115 52 164 167 76 10 119 104 188
-126 28 38 75 220 3 85 90 8 40 8 204 90 154 39 14 171 128 147 78 56 216 191 35
-75 147 169 82 50 100 209 45 185 13 177 95 72 71 95 145 14 98 72 144 38 148 163
-6 125 107 170 3 140 172 67 98 203 5 204 17 98 36 87 41 75 71 168 88 17 25 202
-84 114 58 131 92 69 162 161 36 142 14 25 129 141 111 18 1 152 215 30 193 59 198
-181 34 96 139 47 173 192 214 109 103 100 118 128 16 104 112 198 ^
-466 0 25 2 213 213 36 124 13 62 150 221 61 150 39 45 149 124 104 134 38 130 208
-109 18 32 112 201 96 158 149 215 176 22 44 149 39 88 133 220 189 193 23 44 9
-183 89 48 161 204 54 222 195 163 167 40 45 106 140 8 49 204 145 69 83 169 89 96
-24 93 103 85 41 3 31 154 51 210 115 213 79 108 12 147 209 206 103 176 113 116
-37 173 10 189 102 176 156 100 36 33 69 174 16 202 5 171 52 82 72 4 80 23 178
-162 70 83 29 105 67 34 118 43 143 154 185 138 2 79 157 149 33 160 21 129 208 24
-2 31 69 35 81 72 47 64 22 38 221 55 222 152 179 168 180 211 121 1 207 200 133
-129 117 80 114 25 50 76 102 85 84 212 30 111 110 195 29 14 153 51 28 196 212 36
-167 222 61 107 55 46 64 65 119 220 12 56 137 93 194 29 57 137 50 210 30 197 78
-65 71 132 123 7 177 22 129 68 168 3 74 10 50 167 174 198 218 6 86 218 97 158
-106 6 177 162 210 164 125 62 59 52 173 16 20 214 42 9 141 57 46 106 97 24 50
-119 86 84 169 46 15 25 136 44 100 127 202 182 83 35 33 209 158 15 159 64 156
-191 108 146 75 96 72 181 217 134 129 74 96 115 165 216 91 188 59 10 141 14 62
-107 12 190 65 205 60 10 98 30 63 22 178 205 151 179 211 164 82 206 60 192 114
-31 203 188 193 66 28 105 140 148 33 75 5 128 68 83 212 170 95 109 152 88 224 67
-77 102 42 3 213 170 52 125 56 3 165 82 163 76 193 157 197 218 49 70 89 182 217
-91 145 203 11 56 180 77 193 114 116 122 189 11 7 43 191 17 74 187 187 53 125 13
-19 166 222 104 91 54 131 123 50 33 118 86 127 153 45 197 84 121 183 223 201 48
-70 132 166 88 48 204 188 53 82 29 148 81 163 119 177 28 57 52 34 209 115 31 63
-204 97 206 194 120 1 25 184 132 214 176 65 28 148 124 147 118 37 87 42 94 60 58
-186 47 112 110 152 45 15 68 217 43 57 186 187 218 ^
-477 1 200 12 100 223 201 14 117 124 200 137 95 164 76 144 171 101 34 213 83 169
-150 143 16 32 20 2 224 114 31 18 123 96 115 135 129 83 220 108 59 192 125 62
-196 80 76 195 218 17 210 79 214 136 6 105 91 5 141 27 188 193 127 168 97 79 199
-84 31 209 128 155 151 94 75 17 159 32 71 187 140 63 124 149 179 179 77 72 13
-204 18 72 138 199 48 36 179 26 25 97 28 14 30 82 116 86 188 68 132 133 38 7 107
-197 133 140 12 166 6 3 86 173 16 157 15 170 188 17 85 84 46 172 103 140 114 171
-65 39 45 119 39 96 166 182 45 32 86 12 26 48 87 226 80 201 190 159 208 24 44
-191 197 82 182 96 217 140 99 119 90 54 82 42 49 74 53 95 77 123 60 120 194 165
-180 166 131 225 116 137 146 211 219 4 37 5 1 69 45 17 34 37 130 85 10 9 147 88
-103 191 72 87 152 132 87 175 122 58 14 66 77 57 50 2 122 109 61 209 26 150 92
-58 205 71 136 93 147 37 56 48 212 221 110 165 4 213 47 174 120 41 113 67 181
-168 148 126 115 33 124 24 184 11 113 169 186 138 184 223 61 56 63 175 107 6 128
-81 114 207 60 69 9 22 93 73 31 33 175 71 11 98 206 73 15 221 146 160 34 88 88
-139 186 102 189 55 186 153 9 198 46 19 51 165 129 208 215 49 23 6 179 128 30
-156 64 111 203 105 55 10 111 152 58 139 61 107 21 91 56 99 170 137 197 169 135
-180 41 136 57 152 7 92 145 158 155 49 89 16 208 200 86 48 21 216 51 40 134 178
-24 8 196 29 118 52 42 13 79 23 131 174 69 221 59 118 177 37 181 43 153 185 151
-130 70 47 34 162 125 26 201 139 112 65 164 40 149 3 226 220 159 106 19 74 155
-100 47 159 157 66 217 104 104 178 126 13 28 65 215 225 65 90 3 35 215 189 70
-149 39 221 161 123 147 73 51 216 176 35 75 142 154 62 35 90 194 40 185 225 167
-95 62 71 85 135 4 88 52 144 18 138 148 1 120 92 160 210 130 172 52 93 198 222
-199 224 19 ^
-479 0 36 73 13 47 57 154 60 3 226 188 70 100 51 131 64 62 162 161 15 142 14 11
-115 141 97 219 216 138 201 16 172 31 198 167 6 75 125 26 173 192 193 95 75 93
-111 114 224 76 91 213 13 227 201 213 28 120 1 50 150 213 45 142 31 33 145 124
-92 130 34 126 204 109 2 16 108 201 80 150 149 215 172 14 28 137 23 80 133 208
-185 189 19 36 9 183 77 40 149 200 50 214 191 163 159 36 41 98 136 8 37 204 141
-65 75 157 89 84 12 81 99 85 25 224 27 154 43 210 115 205 75 108 4 143 209 198
-103 176 105 108 21 165 10 181 98 168 152 96 24 29 69 166 8 202 226 171 48 70 68
-217 72 15 174 158 70 83 29 101 67 22 114 27 139 150 181 130 2 63 145 141 33 160
-17 121 196 8 219 19 53 31 65 60 35 60 18 38 217 55 222 144 175 156 172 211 113
-226 203 192 129 117 105 76 106 25 42 64 94 77 72 212 30 99 102 195 25 10 149 35
-28 184 208 20 167 218 53 95 43 30 52 65 107 220 52 129 85 190 17 57 137 38 202
-14 193 78 53 63 128 119 3 177 22 129 68 168 216 74 223 46 155 174 190 214 223
-78 218 85 158 102 227 169 150 198 152 113 46 59 52 161 20 214 26 222 129 53 46
-106 89 20 34 111 82 80 165 42 15 9 136 40 100 115 190 182 79 19 21 197 154 11
-147 56 156 187 104 142 63 96 56 173 209 134 125 58 88 103 161 212 79 184 43 227
-137 6 58 103 225 190 49 201 48 6 90 18 55 10 166 205 139 167 203 160 66 206 56
-188 102 15 191 180 181 66 24 93 128 136 25 59 5 124 60 67 204 158 87 105 140 84
-224 59 69 102 30 3 209 166 40 117 56 220 165 74 159 68 185 157 185 206 41 66 73
-178 217 87 137 203 224 44 176 73 193 110 116 122 177 7 7 39 183 13 62 179 183
-45 125 9 3 162 210 100 83 46 123 111 50 17 106 74 127 153 45 189 68 121 179 215
-189 36 58 120 166 72 32 196 188 53 78 21 148 69 151 115 173 12 49 36 26 205 107
-23 63 192 112 ^
-485 1 200 194 102 214 19 178 132 208 158 59 10 136 112 135 118 37 63 30 94 60
-46 180 47 100 110 146 33 3 50 199 43 39 168 169 90 188 12 92 219 189 6 117 116
-196 133 87 164 76 132 167 101 30 209 79 157 138 143 8 32 8 221 220 110 31 14
-123 92 103 135 117 75 212 104 55 180 121 62 192 72 72 187 206 13 202 67 206 128
-221 105 91 224 129 27 184 181 115 160 89 79 199 84 23 197 128 147 143 82 67 17
-147 28 63 187 132 51 120 141 167 175 65 60 5 196 18 68 126 191 36 28 179 10 21
-93 24 2 14 82 108 74 176 60 120 215 129 26 222 99 189 121 136 227 154 229 226
-86 169 16 153 3 166 180 5 81 72 30 168 95 128 106 159 53 35 33 119 31 88 158
-174 29 16 70 26 32 83 218 80 193 182 151 204 24 44 191 193 66 170 84 213 140 99
-115 86 54 70 42 45 70 41 83 61 115 44 108 190 157 180 162 119 221 104 129 142
-203 219 25 228 1 61 41 9 26 33 118 69 6 1 135 76 91 183 72 71 152 124 87 163
-114 50 10 62 77 53 34 229 110 105 49 205 18 142 88 42 193 67 132 93 139 21 52
-40 204 213 98 153 4 201 31 162 120 25 113 55 181 156 144 118 111 25 112 20 172
-230 105 165 186 138 184 223 61 40 47 175 107 6 116 81 114 207 48 53 224 14 81
-73 223 19 21 167 59 11 98 194 61 230 221 146 148 22 88 84 139 178 90 189 47 174
-145 228 190 42 3 51 161 125 196 207 49 15 2 171 120 26 148 64 107 195 97 43 229
-111 140 58 131 57 95 13 87 48 95 170 125 197 169 131 172 41 124 45 144 3 92 145
-154 155 33 77 12 208 200 78 48 21 208 43 40 130 178 16 227 196 17 106 44 34 228
-75 23 123 166 65 217 43 114 165 29 173 35 149 173 151 130 62 35 34 154 113 14
-197 127 112 61 156 28 137 222 214 208 159 94 19 62 151 88 43 155 149 58 205 92
-104 170 126 1 20 57 211 225 49 90 230 31 203 177 54 145 39 209 153 119 147 69
-47 216 164 35 75 138 142 46 23 82 182 36 185 198 ^
-483 1 155 95 50 71 73 123 225 76 28 144 227 126 130 228 114 74 148 192 118 172
-34 87 192 216 193 206 54 36 65 230 31 49 146 44 228 214 180 62 92 47 131 48 58
-162 161 3 142 14 3 107 141 89 207 212 130 193 8 160 15 198 159 223 63 117 14
-173 192 181 87 59 89 107 106 216 60 79 201 1 227 189 213 20 116 222 38 150 205
-29 134 23 21 141 124 80 126 30 122 200 109 219 104 201 64 142 149 215 168 6 12
-125 7 72 133 196 181 185 15 28 9 183 65 32 137 196 46 206 187 163 151 32 37 90
-132 8 25 204 137 61 67 145 89 72 69 95 85 9 220 23 154 35 210 115 197 71 108
-229 139 209 190 103 176 97 100 5 157 10 173 94 160 148 92 12 25 69 158 202 222
-171 44 58 64 205 64 7 170 154 70 83 29 97 67 10 110 11 135 146 177 122 2 47 133
-133 33 160 13 113 184 225 211 7 37 27 49 48 23 56 14 38 213 55 222 136 171 144
-164 211 105 226 199 184 125 105 93 72 98 25 34 52 86 69 60 212 30 87 94 195 21
-6 145 19 28 172 204 4 167 214 45 83 31 14 40 65 95 220 221 48 121 77 186 5 57
-137 26 194 231 189 78 41 55 124 115 232 177 22 129 68 168 204 74 211 42 143 174
-182 210 215 70 218 73 158 98 223 161 138 186 140 101 30 59 52 149 217 20 214 10
-210 117 49 46 106 81 16 18 103 78 76 161 38 15 226 136 36 100 103 178 182 75 3
-9 185 150 7 135 48 156 183 100 138 51 96 40 165 201 134 121 42 80 91 157 208 67
-180 27 219 133 231 54 99 213 190 33 197 36 2 82 6 47 231 154 205 127 155 195
-156 50 206 52 184 90 232 179 172 169 66 20 81 116 124 17 43 5 120 52 51 196 146
-79 101 128 80 224 51 61 102 18 3 205 162 28 109 56 212 165 66 155 60 177 157
-173 194 33 62 57 174 217 83 129 203 212 32 172 69 193 106 116 122 165 3 7 35
-175 9 50 171 179 37 125 5 220 158 198 96 75 38 115 99 50 1 94 62 127 153 45 181
-52 121 175 207 177 24 46 108 164 ^
-499 0 44 4 182 188 53 71 7 148 48 130 108 166 220 35 8 12 198 93 9 63 171 97
-195 194 87 204 14 173 132 203 143 54 231 126 102 125 118 37 43 20 94 60 36 175
-47 90 110 141 23 229 35 184 43 24 153 154 85 173 12 82 214 174 232 117 106 191
-128 77 164 76 117 162 101 25 204 74 142 123 143 234 32 229 211 215 105 31 9 123
-87 88 135 102 65 202 99 50 165 116 62 187 62 67 177 191 8 192 52 196 118 206
-105 91 214 114 27 179 166 100 150 79 79 199 84 13 182 128 137 133 67 57 17 132
-23 53 187 122 36 115 131 152 170 50 45 231 186 18 63 111 181 21 18 179 226 16
-88 19 223 230 82 98 59 161 50 105 200 124 11 207 89 179 106 131 212 139 224 221
-86 164 16 148 224 161 170 226 76 57 10 163 85 113 96 144 38 30 18 119 21 78 148
-164 9 232 50 221 26 12 78 208 80 183 172 141 199 24 44 191 188 46 155 69 208
-140 99 110 81 54 55 42 40 65 26 68 41 105 24 93 185 147 180 157 104 216 89 119
-137 193 219 231 10 223 1 51 36 235 16 28 103 49 1 227 120 61 76 173 72 51 152
-114 87 148 104 40 5 57 77 48 14 229 95 100 34 200 8 132 83 22 178 62 127 93 129
-1 47 30 194 203 83 138 4 186 11 147 120 5 113 40 181 141 139 108 106 15 97 15
-157 220 95 160 186 138 184 223 61 20 27 175 107 6 101 81 114 207 33 33 209 4 66
-73 218 4 6 157 44 11 98 179 46 215 221 146 133 7 88 79 139 168 75 189 37 159
-135 218 180 37 219 51 156 120 181 197 49 5 233 161 110 21 138 64 102 185 87 28
-219 111 125 58 121 52 80 3 82 38 90 170 110 197 169 126 162 41 109 30 134 234
-92 145 149 155 13 62 7 208 200 68 48 21 198 33 40 125 178 6 217 196 2 91 34 24
-213 70 23 113 156 60 212 23 109 150 19 163 25 144 158 151 130 52 20 34 144 98
-235 192 112 112 56 146 13 122 212 199 193 159 79 19 47 146 73 38 150 139 48 190
-77 104 160 126 222 10 47 206 225 29 90 230 26 188 162 34 140 39 194 143 114 147
-64 42 216 149 174 ^
-473 1 75 131 121 18 2 68 161 29 185 203 145 95 40 71 63 113 220 66 8 144 212
-116 115 228 109 59 138 177 108 172 19 82 187 211 188 191 34 36 55 215 11 39 136
-24 223 199 170 52 82 42 131 28 53 162 161 226 142 14 231 97 141 79 192 207 120
-183 236 145 233 198 149 208 48 107 237 173 192 166 77 39 84 102 96 206 40 64
-186 224 227 174 213 10 111 212 23 150 195 9 124 13 6 136 124 65 121 25 117 195
-109 204 218 99 201 44 132 149 215 163 234 230 110 225 62 133 181 176 180 10 18
-9 183 50 22 122 191 41 196 182 163 141 27 32 80 127 8 10 204 132 56 57 130 89
-57 223 54 90 85 227 215 18 154 25 210 115 187 66 108 224 134 209 180 103 176 87
-90 223 147 10 163 89 150 143 87 235 20 69 148 228 202 217 171 39 43 59 190 54
-235 165 149 70 83 29 92 67 233 105 229 130 141 172 112 2 27 118 123 33 160 8
-103 169 210 201 230 17 22 29 33 8 51 9 38 208 55 222 126 166 129 154 211 95 226
-194 174 120 90 78 67 88 25 24 37 76 59 45 212 30 72 84 195 16 1 140 237 28 157
-199 222 167 209 35 68 16 232 25 65 80 220 211 43 111 67 181 228 57 137 11 184
-216 184 78 26 45 119 110 232 177 22 129 68 168 189 74 196 37 128 174 172 205
-205 60 218 58 158 93 218 151 123 171 125 86 10 59 52 134 202 20 214 228 195 102
-44 46 106 71 11 236 93 73 71 156 33 15 211 136 31 100 88 163 182 70 221 232 170
-145 2 120 38 156 178 95 133 36 96 20 155 191 134 116 22 70 76 152 203 52 175 7
-209 128 226 49 94 198 190 13 192 21 235 72 229 37 221 139 205 112 140 185 151
-30 206 47 179 75 217 164 162 154 66 15 66 101 109 7 23 5 115 42 31 186 131 69
-96 113 75 224 41 51 102 3 3 200 157 13 99 56 202 165 56 150 50 167 157 158 179
-23 57 37 169 217 78 119 203 197 17 167 64 193 101 116 122 150 236 7 30 165 4 35
-161 174 27 125 205 153 148 ^
-502 1 89 61 24 101 78 50 213 73 41 127 153 45 167 24 121 168 193 156 3 25 87
-166 28 228 174 188 53 67 239 148 36 118 104 162 208 27 232 4 194 85 1 63 159 97
-191 194 75 196 10 169 132 199 131 50 223 118 94 117 118 37 27 12 94 60 28 171
-47 82 110 137 15 225 23 172 43 12 141 142 81 161 12 74 210 162 228 117 98 187
-124 69 164 76 105 158 101 21 200 70 130 111 143 230 32 221 203 211 101 31 5 123
-83 76 135 90 57 194 95 46 153 112 62 183 54 63 169 179 4 184 40 188 110 194 105
-91 206 102 27 175 154 88 142 71 79 199 84 5 170 128 129 125 55 49 17 120 19 45
-187 114 24 111 123 140 166 38 33 227 178 18 59 99 173 9 10 179 214 12 84 15 215
-218 82 90 47 149 42 93 188 120 239 195 81 171 94 127 200 127 220 217 86 160 16
-144 216 157 162 218 72 45 234 159 77 101 88 132 26 26 6 119 13 70 140 156 233
-220 34 213 26 236 74 200 80 175 164 133 195 24 44 191 184 30 143 57 204 140 99
-106 77 54 43 42 36 61 14 56 25 97 8 81 181 139 180 153 92 212 77 111 133 185
-219 231 238 219 1 43 32 231 8 24 91 33 237 223 108 49 64 165 72 35 152 106 87
-136 96 32 1 53 77 44 238 229 83 96 22 196 124 79 6 166 58 123 93 121 225 43 22
-186 195 71 126 4 174 235 135 120 229 113 28 181 129 135 100 102 7 85 11 145 212
-87 156 186 138 184 223 61 4 11 175 107 6 89 81 114 207 21 17 197 236 54 73 214
-232 234 149 32 11 98 167 34 203 221 146 121 235 88 75 139 160 63 189 29 147 127
-210 172 33 207 51 152 116 169 189 49 237 233 153 102 17 130 64 98 177 79 16 211
-111 113 58 113 48 68 235 78 30 86 170 98 197 169 122 154 41 97 18 126 234 92
-145 145 155 237 50 3 208 200 60 48 21 190 25 40 121 178 238 209 196 230 79 26
-16 201 66 23 105 148 56 208 7 105 138 11 155 17 140 146 151 130 44 8 34 136 86
-227 188 100 112 52 138 1 110 204 187 181 159 67 19 35 142 61 34 146 131 40 178
-65 104 152 126 214 2 39 202 173 ^
-486 1 5 90 230 20 170 144 10 134 39 176 131 108 147 58 36 216 131 35 75 127 109
-2 232 60 149 25 185 195 137 95 32 71 55 105 216 58 234 144 200 108 103 228 105
-47 130 165 100 172 7 78 183 207 184 179 18 36 47 203 237 31 128 8 219 187 162
-44 74 38 131 12 49 162 161 218 142 14 227 89 141 71 180 203 112 175 232 133 221
-198 141 196 36 99 229 173 192 154 69 23 80 98 88 198 24 52 174 216 227 162 213
-2 107 204 11 150 187 235 116 5 236 132 124 53 117 21 113 191 109 192 206 95 201
-28 124 149 215 159 230 218 98 213 54 133 169 172 176 6 10 9 183 38 14 110 187
-37 188 178 163 133 23 28 72 123 8 240 204 128 52 49 118 89 45 215 42 86 85 215
-211 14 154 17 210 115 179 62 108 220 130 209 172 103 176 79 82 211 139 10 155
-85 142 139 83 227 16 69 140 224 202 213 171 35 31 55 178 46 231 161 145 70 83
-29 88 67 225 101 217 126 137 168 104 2 11 106 115 33 160 4 95 157 198 193 222 1
-18 13 21 238 47 5 38 204 55 222 118 162 117 146 211 87 226 190 166 116 78 66 63
-80 25 16 25 68 51 33 212 30 60 76 195 12 239 136 225 28 145 195 210 167 205 27
-56 4 220 13 65 68 220 203 39 103 59 177 220 57 137 241 176 204 180 78 14 37 115
-106 232 177 22 129 68 168 177 74 184 33 116 174 164 201 197 52 218 46 158 89
-214 143 111 159 113 74 236 59 52 122 190 20 214 216 183 90 40 46 106 63 7 224
-85 69 67 152 29 15 199 136 27 100 76 151 182 66 209 224 158 141 240 108 30 156
-174 91 129 24 96 4 147 183 134 112 6 62 64 148 199 40 171 233 201 124 222 45 90
-186 190 239 188 9 235 64 221 29 213 127 205 100 128 177 147 14 206 43 175 63
-205 152 154 142 66 11 54 89 97 241 7 5 111 34 15 178 119 61 92 101 71 224 33 43
-102 233 3 196 153 1 91 56 194 165 48 146 42 159 157 146 167 15 53 21 165 217 74
-111 203 185 5 163 60 193 97 116 122 138 236 7 26 157 23 153 170 184 ^
-505 1 125 238 187 147 165 85 53 16 93 66 50 201 61 29 127 153 45 159 8 121 164
-185 144 235 13 75 166 12 216 166 188 53 63 235 148 24 106 100 158 196 19 220
-240 190 77 237 63 147 97 187 194 63 188 6 165 132 195 119 46 215 110 86 109 118
-37 11 4 94 60 20 167 47 74 110 133 7 221 11 160 43 129 130 77 149 12 66 206 150
-224 117 90 183 120 61 164 76 93 154 101 17 196 66 118 99 143 226 32 213 195 207
-97 31 1 123 79 64 135 78 49 186 91 42 141 108 62 179 46 59 161 167 176 28 180
-102 182 105 91 198 90 27 171 142 76 134 63 79 199 84 241 158 128 121 117 43 41
-17 108 15 37 187 106 12 107 115 128 162 26 21 223 170 18 55 87 165 241 2 179
-202 8 80 11 207 206 82 82 35 137 34 81 176 116 231 183 73 163 82 123 188 115
-216 213 86 156 16 140 208 153 154 210 68 33 222 155 69 89 80 120 14 22 238 119
-5 62 132 148 221 208 18 205 26 224 70 192 80 167 156 125 191 24 44 191 180 14
-131 45 200 140 99 102 73 54 31 42 32 57 2 44 9 89 236 69 177 131 180 149 80 208
-65 103 129 177 219 231 230 215 1 35 28 227 20 79 17 237 219 96 37 52 157 72 19
-152 98 87 124 88 24 241 49 77 40 226 229 71 92 10 192 236 116 75 234 154 54 119
-93 113 213 39 14 178 187 59 114 4 162 223 123 120 217 113 16 181 117 131 92 98
-243 73 7 133 204 79 152 186 138 184 223 61 232 239 175 107 6 77 81 114 207 9 1
-185 232 42 73 210 224 226 141 20 11 98 155 22 191 221 146 109 227 88 71 139 152
-51 189 21 135 119 202 164 29 195 51 148 112 157 181 49 233 233 145 94 13 122 64
-94 169 71 4 203 111 101 58 105 44 56 231 74 22 82 170 86 197 169 118 146 41 85
-6 118 234 92 145 141 155 225 38 243 208 200 52 48 21 182 17 40 117 178 234 201
-196 222 67 18 8 189 62 23 97 140 52 204 235 101 126 3 147 9 136 134 151 130 36
-240 34 128 74 219 184 88 112 48 130 233 98 196 175 169 159 55 19 23 138 49 30
-142 123 32 166 53 104 144 126 206 238 31 198 203 ^
-483 1 235 90 230 16 158 132 240 130 39 164 123 104 147 54 32 216 119 35 75 123
-97 232 224 52 137 21 185 187 129 95 24 71 47 97 212 50 222 144 188 100 91 228
-101 35 122 153 92 172 241 74 179 203 180 167 2 36 39 191 225 23 120 238 215 175
-154 36 66 34 131 242 45 162 161 210 142 14 223 81 141 63 168 199 104 167 228
-121 209 198 133 184 24 91 221 173 192 142 61 7 76 94 80 190 8 40 162 208 227
-150 213 240 103 196 245 150 179 223 108 243 228 128 124 41 113 17 109 187 109
-180 194 91 201 12 116 149 215 155 226 206 86 201 46 133 157 168 172 2 2 9 183
-26 6 98 183 33 180 174 163 125 19 24 64 119 8 232 204 124 48 41 106 89 33 207
-30 82 85 203 207 10 154 9 210 115 171 58 108 216 126 209 164 103 176 71 74 199
-131 10 147 81 134 135 79 219 12 69 132 220 202 209 171 31 19 51 166 38 227 157
-141 70 83 29 84 67 217 97 205 122 133 164 96 2 241 94 107 33 160 87 145 186 185
-214 231 14 243 9 230 43 1 38 200 55 222 110 158 105 138 211 79 226 186 158 112
-66 54 59 72 25 8 13 60 43 21 212 30 48 68 195 8 239 132 213 28 133 191 198 167
-201 19 44 238 208 1 65 56 220 195 35 95 51 173 212 57 137 233 168 192 176 78 2
-29 111 102 232 177 22 129 68 168 165 74 172 29 104 174 156 197 189 44 218 34
-158 85 210 135 99 147 101 62 224 59 52 110 178 20 214 204 171 78 36 46 106 55 3
-212 77 65 63 148 25 15 187 136 23 100 64 139 182 62 197 216 146 137 240 96 22
-156 170 87 125 12 96 234 139 175 134 108 236 54 52 144 195 28 167 221 193 120
-218 41 86 174 190 227 184 243 235 56 213 21 205 115 205 88 116 169 143 244 206
-39 171 51 193 140 146 130 66 7 42 77 85 237 237 5 107 26 245 170 107 53 88 89
-67 224 25 35 102 225 3 192 149 235 83 56 186 165 40 142 34 151 157 134 155 7 49
-5 161 217 70 103 203 173 239 159 56 193 93 116 122 126 236 7 22 149 242 178 ^
-507 1 141 164 7 125 238 175 143 153 81 45 8 85 54 50 189 49 17 127 153 45 151
-240 121 160 177 132 227 1 63 166 244 204 158 188 53 59 231 148 12 94 96 154 184
-11 208 236 186 69 233 63 135 97 183 194 51 180 2 161 132 191 107 42 207 102 78
-101 118 37 243 244 94 60 12 163 47 66 110 129 247 217 247 148 43 236 117 118 73
-137 12 58 202 138 220 117 82 179 116 53 164 76 81 150 101 13 192 62 106 87 143
-222 32 205 187 203 93 31 245 123 75 52 135 66 41 178 87 38 129 104 62 175 38 55
-153 155 244 168 16 172 94 170 105 91 190 78 27 167 130 64 126 55 79 199 84 237
-146 128 113 109 31 33 17 96 11 29 187 98 103 107 116 158 14 9 219 162 18 51 75
-157 233 242 179 190 4 76 7 199 194 82 74 23 125 26 69 164 112 223 171 65 155 70
-119 176 103 212 209 86 152 16 136 200 149 146 202 64 21 210 151 61 77 72 108 2
-18 230 119 245 54 124 140 209 196 2 197 26 212 66 184 80 159 148 117 187 24 44
-191 176 246 119 33 196 140 99 98 69 54 19 42 28 53 238 32 241 81 224 57 173 123
-180 145 68 204 53 95 125 169 219 231 222 211 1 27 24 223 240 16 67 1 237 215 84
-25 40 149 72 3 152 90 87 112 80 16 241 45 77 36 214 229 59 88 246 188 232 108
-71 222 142 50 115 93 105 201 35 6 170 179 47 102 4 150 211 111 120 205 113 4
-181 105 127 84 94 239 61 3 121 196 71 148 186 138 184 223 61 220 227 175 107 6
-65 81 114 207 245 233 173 228 30 73 206 216 218 133 8 11 98 143 10 179 221 146
-97 219 88 67 139 144 39 189 13 123 111 194 156 25 183 51 144 108 145 173 49 229
-233 137 86 9 114 64 90 161 63 240 195 111 89 58 97 40 44 227 70 14 78 170 74
-197 169 114 138 41 73 242 110 234 92 145 137 155 213 26 243 208 200 44 48 21
-174 9 40 113 178 230 193 196 214 55 10 177 58 23 89 132 48 200 223 97 114 243
-139 1 132 122 151 130 28 232 34 120 62 211 180 76 112 44 122 225 86 188 163 157
-159 43 19 11 134 37 26 138 115 24 154 41 104 136 126 198 234 140 ^
-490 1 192 225 223 90 230 12 146 120 228 126 39 152 115 100 147 50 28 216 107 35
-75 119 85 220 216 44 125 17 185 179 121 95 16 71 39 89 208 42 210 144 176 92 79
-228 97 23 114 141 84 172 233 70 175 199 176 155 236 36 31 179 213 15 112 226
-211 163 146 28 58 30 131 230 41 162 161 202 142 14 219 73 141 55 156 195 96 159
-224 109 197 198 125 172 12 83 213 173 192 130 53 241 72 90 72 182 242 28 150
-200 227 138 213 236 99 188 237 150 171 211 100 239 220 124 124 29 109 13 105
-183 109 168 182 87 201 246 108 149 215 151 222 194 74 189 38 133 145 164 168
-248 244 9 183 14 248 86 179 29 172 170 163 117 15 20 56 115 8 224 204 120 44 33
-94 89 21 199 18 78 85 191 203 6 154 1 210 115 163 54 108 212 122 209 156 103
-176 63 66 187 123 10 139 77 126 131 75 211 8 69 124 216 202 205 171 27 7 47 154
-30 223 153 137 70 83 29 80 67 209 93 193 118 129 160 88 2 229 82 99 33 160 246
-79 133 174 177 206 219 10 231 247 222 39 247 38 196 55 222 102 154 93 130 211
-71 226 182 150 108 54 42 55 64 25 1 52 35 9 212 30 36 60 195 4 239 128 201 28
-121 187 186 167 197 11 32 230 196 239 65 44 220 187 31 87 43 169 204 57 137 225
-160 180 172 78 240 21 107 98 232 177 22 129 68 168 153 74 160 25 92 174 148 193
-181 36 218 22 158 81 206 127 87 135 89 50 212 59 52 98 166 20 214 192 159 66 32
-46 106 47 249 200 69 61 59 144 21 15 175 136 19 100 52 127 182 58 185 208 134
-133 240 84 14 156 166 83 121 96 222 131 167 134 104 224 46 40 140 191 16 163
-209 185 116 214 37 82 162 190 215 180 235 235 48 205 13 197 103 205 76 104 161
-139 232 206 35 167 39 181 128 138 118 66 3 30 65 73 233 225 5 103 18 233 162 95
-45 84 77 63 224 17 27 102 217 3 188 145 227 75 56 178 165 32 138 26 143 157 122
-143 249 45 239 157 217 66 95 203 161 231 155 52 193 89 116 122 114 236 7 18 141
-242 249 137 162 3 125 238 69 ^
-514 1 139 141 77 37 77 42 50 177 37 5 127 153 45 143 228 121 156 169 120 219
-241 51 166 232 192 150 188 53 55 227 148 82 92 150 172 3 196 232 182 61 229 63
-123 97 179 194 39 172 250 157 132 187 95 38 199 94 70 93 118 37 231 240 94 60 4
-159 47 58 110 125 243 213 239 136 43 228 105 106 69 125 12 50 198 126 216 117
-74 175 112 45 164 76 69 146 101 9 188 58 94 75 143 218 32 197 179 199 89 31 245
-123 71 40 135 54 33 170 83 34 117 100 62 171 30 51 145 143 244 160 4 164 86 158
-105 91 182 66 27 163 118 52 118 47 79 199 84 233 134 128 105 101 19 25 17 84 7
-21 187 90 240 99 99 104 154 2 249 215 154 18 47 63 149 225 238 179 178 72 3 191
-182 82 66 11 113 18 57 152 108 215 159 57 147 58 115 164 91 208 205 86 148 16
-132 192 145 138 194 60 9 198 147 53 65 64 96 242 14 222 119 241 46 116 132 197
-184 238 189 26 200 62 176 80 151 140 109 183 24 44 191 172 234 107 21 192 140
-99 94 65 54 7 42 24 49 230 20 229 73 212 45 169 115 180 141 56 200 41 87 121
-161 219 231 214 207 1 19 20 219 236 12 55 237 237 211 72 13 28 141 72 239 152
-82 87 100 72 8 241 41 77 32 202 229 47 84 238 184 228 100 67 210 130 46 111 93
-97 189 31 250 162 171 35 90 4 138 199 99 120 193 113 244 181 93 123 76 90 235
-49 251 109 188 63 144 186 138 184 223 61 208 215 175 107 6 53 81 114 207 237
-221 161 224 18 73 202 208 210 125 248 11 98 131 250 167 221 146 85 211 88 63
-139 136 27 189 5 111 103 186 148 21 171 51 140 104 133 165 49 225 233 129 78 5
-106 64 86 153 55 232 187 111 77 58 89 36 32 223 66 6 74 170 62 197 169 110 130
-41 61 234 102 234 92 145 133 155 201 14 243 208 200 36 48 21 166 1 40 109 178
-226 185 196 206 43 2 244 165 54 23 81 124 44 196 211 93 102 239 131 245 128 110
-151 130 20 224 34 112 50 203 176 64 112 40 114 217 74 180 151 145 159 31 19 251
-130 25 22 134 107 16 142 29 104 128 126 190 230 15 190 225 217 90 230 10 140
-114 222 124 39 146 111 217 ^
-510 0 147 46 24 216 95 35 75 115 73 208 208 36 113 13 185 171 113 95 8 71 31 81
-204 34 198 144 164 84 67 228 93 11 106 129 76 172 225 66 171 195 172 143 224 36
-23 167 201 7 104 214 207 151 138 20 50 26 131 218 37 162 161 194 142 14 215 65
-141 47 144 191 88 151 220 97 185 198 117 160 75 205 173 192 118 45 229 68 86 64
-174 230 16 138 192 227 126 213 232 95 180 229 150 163 199 92 235 212 120 124 17
-105 9 101 179 109 156 170 83 201 234 100 149 215 147 218 182 62 177 30 133 133
-160 164 248 240 9 183 2 244 74 175 25 164 166 163 109 11 16 48 111 8 216 204
-116 40 25 82 89 9 191 6 74 85 179 199 2 154 247 210 115 155 50 108 208 118 209
-148 103 176 55 58 175 115 10 131 73 118 127 71 203 4 69 116 212 202 201 171 23
-249 43 142 22 219 149 133 70 83 29 76 67 201 89 181 114 125 156 80 2 217 70 91
-33 160 246 71 121 162 169 198 207 6 219 239 214 35 247 38 192 55 222 94 150 81
-122 211 63 226 178 142 104 42 30 51 56 25 246 243 44 27 251 212 30 24 52 195
-239 124 189 28 109 183 174 167 193 3 20 222 184 231 65 32 220 179 27 79 35 165
-196 57 137 217 152 168 168 78 232 13 103 94 232 177 22 129 68 168 141 74 148 21
-80 174 140 189 173 28 218 10 158 77 202 119 75 123 77 38 200 59 52 86 154 20
-214 180 147 54 28 46 106 39 249 188 61 57 55 140 17 15 163 136 15 100 40 115
-182 54 173 200 122 129 240 72 6 156 162 79 117 242 96 210 123 159 134 100 212
-38 28 136 187 4 159 197 177 112 210 33 78 150 190 203 176 227 235 40 197 5 189
-91 205 64 92 153 135 220 206 31 163 27 169 116 130 106 66 253 18 53 61 229 213
-5 99 10 221 154 83 37 80 65 59 224 9 19 102 209 3 184 141 219 67 56 170 165 24
-134 18 135 157 110 131 245 41 227 153 217 62 87 203 149 223 151 48 193 85 116
-122 102 236 7 14 133 242 241 129 158 249 125 238 157 137 135 75 33 250 73 36 50
-171 31 253 127 153 45 139 222 121 154 165 114 215 237 45 166 226 186 146 188 53
-53 225 148 248 118 ^
-533 0 87 145 157 250 181 227 177 51 224 63 108 97 174 194 24 162 250 152 132
-182 80 33 189 84 60 83 118 37 216 235 94 60 251 154 47 48 110 120 238 208 229
-121 43 218 90 91 64 110 12 40 193 111 211 117 64 170 107 35 164 76 54 141 101 4
-183 53 79 60 143 213 32 187 169 194 84 31 245 123 66 25 135 39 23 160 78 29 102
-95 62 166 20 46 135 128 244 150 246 154 76 143 105 91 172 51 27 158 103 37 108
-37 79 199 84 228 119 128 95 91 4 15 17 69 2 11 187 80 230 94 89 89 149 244 239
-210 144 18 42 48 139 215 233 179 163 252 67 255 181 167 82 56 253 98 8 42 137
-103 205 144 47 137 43 110 149 76 203 200 86 143 16 127 182 140 128 184 55 251
-183 142 43 50 54 81 232 9 212 119 236 36 106 122 182 169 223 179 26 185 57 166
-80 141 130 99 178 24 44 191 167 219 92 6 187 140 99 89 60 54 249 42 19 44 220 5
-214 63 197 30 164 105 180 136 41 195 26 77 116 151 219 231 204 202 1 9 15 214
-231 7 40 222 237 206 57 255 13 131 72 224 152 72 87 85 62 255 241 36 77 27 187
-229 32 79 228 179 223 90 62 195 115 41 106 93 87 174 26 245 152 161 20 75 4 123
-184 84 120 178 113 234 181 78 118 66 85 230 34 251 94 178 53 139 186 138 184
-223 61 193 200 175 107 6 38 81 114 207 227 206 146 219 3 73 197 198 200 115 238
-11 98 116 240 152 221 146 70 201 88 58 139 126 12 189 252 96 93 176 138 16 156
-51 135 99 118 155 49 220 233 119 68 96 64 81 143 45 222 177 111 62 58 79 31 17
-218 61 253 69 170 47 197 169 105 120 41 46 224 92 234 92 145 128 155 186 256
-243 208 200 26 48 21 156 248 40 104 178 221 175 196 196 28 249 239 150 49 23 71
-114 39 191 196 88 87 234 121 240 123 95 151 130 10 214 34 102 35 193 171 49 112
-35 104 207 59 170 136 130 159 16 19 241 125 10 17 129 97 6 127 14 104 118 126
-180 225 5 185 225 202 90 230 5 125 99 207 119 39 131 101 93 147 43 21 216 86 35
-75 112 64 199 202 30 104 10 185 165 107 95 2 71 25 75 201 28 189 144 155 78 58
-228 90 2 100 120 70 172 219 63 168 192 169 134 215 36 17 158 192 1 98 205 137 ^
-522 1 139 130 12 42 22 131 206 33 162 161 186 142 14 211 57 141 39 132 187 80
-143 216 85 173 198 109 148 246 67 197 173 192 106 37 217 64 82 56 166 218 4 126
-184 227 114 213 228 91 172 221 150 155 187 84 231 204 116 124 5 101 5 97 175
-109 144 158 79 201 222 92 149 215 143 214 170 50 165 22 133 121 156 160 248 236
-9 183 248 240 62 171 21 156 162 163 101 7 12 40 107 8 208 204 112 36 17 70 89
-255 183 252 70 85 167 195 256 154 243 210 115 147 46 108 204 114 209 140 103
-176 47 50 163 107 10 123 69 110 123 67 195 69 108 208 202 197 171 19 241 39 130
-14 215 145 129 70 83 29 72 67 193 85 169 110 121 152 72 2 205 58 83 33 160 246
-63 109 150 161 190 195 2 207 231 206 31 247 38 188 55 222 86 146 69 114 211 55
-226 174 134 100 30 18 47 48 25 242 235 36 19 243 212 30 12 44 195 254 239 120
-177 28 97 179 162 167 189 253 8 214 172 223 65 20 220 171 23 71 27 161 188 57
-137 209 144 156 164 78 224 5 99 90 232 177 22 129 68 168 129 74 136 17 68 174
-132 185 165 20 218 256 158 73 198 111 63 111 65 26 188 59 52 74 142 20 214 168
-135 42 24 46 106 31 249 176 53 53 51 136 13 15 151 136 11 100 28 103 182 50 161
-192 110 125 240 60 256 156 158 75 113 234 96 198 115 151 134 96 200 30 16 132
-183 250 155 185 169 108 206 29 74 138 190 191 172 219 235 32 189 255 181 79 205
-52 80 145 131 208 206 27 159 15 157 104 122 94 66 253 6 41 49 225 201 5 95 2
-209 146 71 29 76 53 55 224 1 11 102 201 3 180 137 211 59 56 162 165 16 130 10
-127 157 98 119 241 37 215 149 217 58 79 203 137 215 147 44 193 81 116 122 90
-236 7 10 125 242 233 121 154 245 125 238 145 133 123 71 25 246 65 24 50 159 19
-245 127 153 45 131 210 121 150 157 102 207 229 33 166 214 174 138 188 53 49 221
-148 240 64 86 144 154 249 178 226 176 49 223 63 105 97 173 194 21 160 250 151
-132 181 77 32 187 82 58 81 118 37 213 234 94 60 250 153 47 46 110 119 237 207
-227 118 43 216 87 88 63 107 12 38 192 108 210 117 62 169 106 33 164 76 51 211 ^
-540 0 101 1 180 50 70 51 143 210 32 181 163 191 81 31 245 123 63 16 135 30 17
-154 75 26 93 92 62 163 14 43 129 119 244 144 240 148 70 134 105 91 166 42 27
-155 94 28 102 31 79 199 84 225 110 128 89 85 255 9 17 60 259 5 187 74 224 91 83
-80 146 238 233 207 138 18 39 39 133 209 230 179 154 252 64 255 175 158 82 50
-247 89 2 33 128 100 199 135 41 131 34 107 140 67 200 197 86 140 16 124 176 137
-122 178 52 245 174 139 37 41 48 72 226 6 206 119 233 30 100 116 173 160 214 173
-26 176 54 160 80 135 124 93 175 24 44 191 164 210 83 257 184 140 99 86 57 54
-243 42 16 41 214 256 205 57 188 21 161 99 180 133 32 192 17 71 113 145 219 231
-198 199 1 3 12 211 228 4 31 213 237 203 48 249 4 125 72 215 152 66 87 76 56 252
-241 33 77 24 178 229 23 76 222 176 220 84 59 186 106 38 103 93 81 165 23 242
-146 155 11 66 4 114 175 75 120 169 113 228 181 69 115 60 82 227 25 251 85 172
-47 136 186 138 184 223 61 184 191 175 107 6 29 81 114 207 221 197 137 216 254
-73 194 192 194 109 232 11 98 107 234 143 221 146 61 195 88 55 139 120 3 189 249
-87 87 170 132 13 147 51 132 96 109 149 49 217 233 113 62 257 90 64 78 137 39
-216 171 111 53 58 73 28 8 215 58 250 66 170 38 197 169 102 114 41 37 218 86 234
-92 145 125 155 177 250 243 208 200 20 48 21 150 245 40 101 178 218 169 196 190
-19 246 236 141 46 23 65 108 36 188 187 85 78 231 115 237 120 86 151 130 4 208
-34 96 26 187 168 40 112 32 98 201 50 164 127 121 159 7 19 235 122 1 14 126 91
-118 5 104 112 126 174 222 259 182 225 193 90 230 2 116 90 198 116 39 122 95 90
-147 40 18 216 77 35 75 109 55 190 196 24 95 7 185 159 101 95 256 71 19 69 198
-22 180 144 146 72 49 228 87 253 94 111 64 172 213 60 165 189 166 125 206 36 11
-149 183 255 92 196 201 133 126 8 38 20 131 200 31 162 161 182 142 14 209 53 141
-35 126 185 76 139 214 79 167 198 105 142 242 63 193 173 192 100 33 211 62 80 52
-162 212 258 120 180 227 108 213 226 89 168 217 150 151 181 80 229 200 114 124
-259 99 3 95 173 109 138 152 77 201 129 ^
-555 0 84 149 215 139 210 158 38 153 14 133 109 152 156 248 232 9 183 240 236 50
-167 17 148 158 163 93 3 8 32 103 8 200 204 108 32 9 58 89 247 175 244 66 85 155
-191 256 154 239 210 115 139 42 108 200 110 209 132 103 176 39 42 151 99 10 115
-65 102 119 63 187 258 69 100 204 202 193 171 15 233 35 118 6 211 141 125 70 83
-29 68 67 185 81 157 106 117 148 64 2 193 46 75 33 160 246 55 97 138 153 182 183
-260 195 223 198 27 247 38 184 55 222 78 142 57 106 211 47 226 170 126 96 18 6
-43 40 25 238 227 28 11 235 212 30 36 195 254 239 116 165 28 85 175 150 167 185
-249 258 206 160 215 65 8 220 163 19 63 19 157 180 57 137 201 136 144 160 78 216
-259 95 86 232 177 22 129 68 168 117 74 124 13 56 174 124 181 157 12 218 248 158
-69 194 103 51 99 53 14 176 59 52 62 130 20 214 156 123 30 20 46 106 23 249 164
-45 49 47 132 9 15 139 136 7 100 16 91 182 46 149 184 98 121 240 48 252 156 154
-71 109 226 96 186 107 143 134 92 188 22 4 128 179 242 151 173 161 104 202 25 70
-126 190 179 168 211 235 24 181 251 173 67 205 40 68 137 127 196 206 23 155 3
-145 92 114 82 66 253 256 29 37 221 189 5 91 256 197 138 59 21 72 41 51 224 255
-3 102 193 3 176 133 203 51 56 154 165 8 126 2 119 157 86 107 237 33 203 145 217
-54 71 203 125 207 143 40 193 77 116 122 78 236 7 6 117 242 225 113 150 241 125
-238 133 129 111 67 17 242 57 12 50 147 7 237 127 153 45 123 198 121 146 149 90
-199 221 21 166 202 162 130 188 53 45 217 148 232 52 82 140 142 245 166 222 172
-41 219 63 93 97 169 194 9 152 250 147 132 177 65 28 179 74 50 73 118 37 201 230
-94 60 246 149 47 38 110 115 233 203 219 106 43 208 75 76 59 95 12 30 188 96 206
-117 54 165 102 25 164 76 39 136 101 261 178 48 64 45 143 208 32 177 159 189 79
-31 245 123 61 10 135 24 13 150 73 24 87 90 62 161 10 41 125 113 244 140 236 144
-66 128 105 91 162 36 27 153 88 22 98 27 79 199 84 223 104 128 85 81 251 5 17 54
-259 1 187 70 220 89 79 74 144 234 229 205 134 18 37 33 129 205 228 179 148 252
-62 255 171 152 82 46 243 83 260 27 122 98 195 129 37 127 28 105 134 207 ^
-545 1 196 193 86 136 16 120 168 133 114 170 48 237 162 135 29 29 40 60 218 2
-198 119 229 22 92 108 161 148 202 165 26 164 50 152 80 127 116 85 171 24 44 191
-160 198 71 249 180 140 99 82 53 54 235 42 12 37 206 248 193 49 176 9 157 91 180
-129 20 188 5 63 109 137 219 231 190 195 1 259 8 207 224 19 201 237 199 36 241
-256 117 72 203 152 58 87 64 48 248 241 29 77 20 166 229 11 72 214 172 216 76 55
-174 94 34 99 93 73 153 19 238 138 147 263 54 4 102 163 63 120 157 113 220 181
-57 111 52 78 223 13 251 73 164 39 132 186 138 184 223 61 172 179 175 107 6 17
-81 114 207 213 185 125 212 246 73 190 184 186 101 224 11 98 95 226 131 221 146
-49 187 88 51 139 112 255 189 245 75 79 162 124 9 135 51 128 92 97 141 49 213
-233 105 54 257 82 64 74 129 31 208 163 111 41 58 65 24 260 211 54 246 62 170 26
-197 169 98 106 41 25 210 78 234 92 145 121 155 165 242 243 208 200 12 48 21 142
-241 40 97 178 214 161 196 182 7 242 232 129 42 23 57 100 32 184 175 81 66 227
-107 233 116 74 151 130 260 200 34 88 14 179 164 28 112 28 90 193 38 156 115 109
-159 259 19 227 118 253 10 122 83 256 106 257 104 104 126 166 218 255 178 225
-181 90 230 262 104 78 186 112 39 110 87 86 147 36 14 216 65 35 75 105 43 178
-188 16 83 3 185 151 93 95 252 71 11 61 194 14 168 144 134 64 37 228 83 245 86
-99 56 172 205 56 161 185 162 113 194 36 3 137 171 251 84 184 197 121 118 30 16
-131 188 27 162 161 174 142 14 205 45 141 27 114 181 68 131 210 67 155 198 97
-130 234 55 185 173 192 88 25 199 58 76 44 154 200 250 108 172 227 96 213 222 85
-160 209 150 143 169 72 225 192 110 124 251 95 263 91 169 109 126 140 73 201 204
-80 149 215 137 208 152 32 147 10 133 103 150 154 248 230 9 183 236 234 44 165
-15 144 156 163 89 1 6 28 101 8 196 204 106 30 5 52 89 243 171 240 64 85 149 189
-256 154 237 210 115 135 40 108 198 108 209 128 103 176 35 38 145 95 10 111 63
-98 117 61 183 258 69 96 202 202 191 171 13 229 33 112 2 209 139 123 70 83 29 66
-67 181 79 151 104 115 146 60 2 187 40 71 33 160 246 51 91 132 178 ^
-563 1 174 171 260 183 215 190 23 247 38 180 55 222 70 138 45 98 211 39 226 166
-118 92 6 260 39 32 25 234 219 20 3 227 212 30 254 28 195 254 239 112 153 28 73
-171 138 167 181 245 250 198 148 207 65 262 220 155 15 55 11 153 172 57 137 193
-128 132 156 78 208 255 91 82 232 177 22 129 68 168 105 74 112 9 44 174 116 177
-149 4 218 240 158 65 190 95 39 87 41 2 164 59 52 50 118 20 214 144 111 18 16 46
-106 15 249 152 37 45 43 128 5 15 127 136 3 100 4 79 182 42 137 176 86 117 240
-36 248 156 150 67 105 218 96 174 99 135 134 88 176 14 258 124 175 234 147 161
-153 100 198 21 66 114 190 167 164 203 235 16 173 247 165 55 205 28 56 129 123
-184 206 19 151 257 133 80 106 70 66 253 248 17 25 217 177 5 87 252 185 130 47
-13 68 29 47 224 251 261 102 185 3 172 129 195 43 56 146 165 122 260 111 157 74
-95 233 29 191 141 217 50 63 203 113 199 139 36 193 73 116 122 66 236 7 2 109
-242 217 105 146 237 125 238 121 125 99 63 9 238 49 50 135 261 229 127 153 45
-115 186 121 142 141 78 191 213 9 166 190 150 122 188 53 41 213 148 224 40 78
-136 130 241 154 218 168 33 215 63 81 97 165 194 263 144 250 143 132 173 53 24
-171 66 42 65 118 37 189 226 94 60 242 145 47 30 110 111 229 199 211 94 43 200
-63 64 55 83 12 22 184 84 202 117 46 161 98 17 164 76 27 132 101 261 174 44 52
-33 143 204 32 169 151 185 75 31 245 123 57 264 135 12 5 142 69 20 75 86 62 157
-2 37 117 101 244 132 228 136 58 116 105 91 154 24 27 149 76 10 90 19 79 199 84
-219 92 128 77 73 243 263 17 42 259 259 187 62 212 85 71 62 140 226 221 201 126
-18 33 21 121 197 224 179 136 252 58 255 163 140 82 38 235 71 256 15 110 94 187
-117 29 119 16 101 122 49 194 191 86 134 16 118 164 131 110 166 46 233 156 133
-25 23 36 54 214 194 119 227 18 88 104 155 142 196 161 26 158 48 148 80 123 112
-81 169 24 44 191 158 192 65 245 178 140 99 80 51 54 231 42 10 35 202 244 187 45
-170 3 155 87 180 127 14 186 265 59 107 133 219 231 186 193 1 257 6 205 222 264
-13 195 237 197 30 237 252 113 72 197 152 54 87 58 44 246 241 27 77 18 160 229 5
-70 210 170 214 72 53 168 88 32 97 93 69 261 ^
-563 1 15 234 130 139 255 42 4 90 151 51 120 145 113 212 181 45 107 44 74 219 1
-251 61 156 31 128 186 138 184 223 61 160 167 175 107 6 5 81 114 207 205 173 113
-208 238 73 186 176 178 93 216 11 98 83 218 119 221 146 37 179 88 47 139 104 247
-189 241 63 71 154 116 5 123 51 124 88 85 133 49 209 233 97 46 257 74 64 70 121
-23 200 155 111 29 58 57 20 252 207 50 242 58 170 14 197 169 94 98 41 13 202 70
-234 92 145 117 155 153 234 243 208 200 4 48 21 134 237 40 93 178 210 153 196
-174 263 238 228 117 38 23 49 92 28 180 163 77 54 223 99 229 112 62 151 130 256
-192 34 80 2 171 160 16 112 24 82 185 26 148 103 97 159 251 19 219 114 245 6 118
-75 252 94 249 104 96 126 158 214 251 174 225 169 90 230 262 92 66 174 108 39 98
-79 82 147 32 10 216 53 35 75 101 31 166 180 8 71 267 185 143 85 95 248 71 3 53
-190 6 156 144 122 56 25 228 79 237 78 87 48 172 197 52 157 181 158 101 182 36
-263 125 159 247 76 172 193 109 110 260 22 12 131 176 23 162 161 166 142 14 201
-37 141 19 102 177 60 123 206 55 143 198 89 118 226 47 177 173 192 76 17 187 54
-72 36 146 188 242 96 164 227 84 213 218 81 152 201 150 135 157 64 221 184 106
-124 243 91 263 87 165 109 114 128 69 201 192 72 149 215 133 204 140 20 135 2
-133 91 146 150 248 226 9 183 228 230 32 161 11 136 152 163 81 265 2 20 97 8 188
-204 102 26 265 40 89 235 163 232 60 85 137 185 256 154 233 210 115 127 36 108
-194 104 209 120 103 176 27 30 133 87 10 103 59 90 113 57 175 258 69 88 198 202
-187 171 9 221 29 100 262 205 135 119 70 83 29 62 67 173 75 139 100 111 142 52 2
-175 28 63 33 160 246 43 79 120 141 170 165 260 177 211 186 21 247 38 178 55 222
-66 136 39 94 211 35 226 164 114 90 256 37 28 25 232 215 16 267 223 212 30 250
-24 195 254 239 110 147 28 67 169 132 167 179 243 246 194 142 203 65 258 220 151
-13 51 7 151 168 57 137 189 124 126 154 78 204 253 89 80 232 177 22 129 68 168
-99 74 106 7 38 174 112 175 145 218 236 158 63 188 91 33 81 35 264 158 59 52 44
-112 20 214 138 105 12 14 46 106 11 249 146 33 43 41 126 3 15 121 136 1 100 266
-73 182 40 131 172 80 115 240 30 246 186 ^
-573 0 146 63 101 210 96 162 91 127 134 84 164 6 250 120 171 226 143 149 145 96
-194 17 62 102 190 155 160 195 235 8 165 243 157 43 205 16 44 121 119 172 206 15
-147 249 121 68 98 58 66 253 240 5 13 213 165 5 83 248 173 122 35 5 64 17 43 224
-247 257 102 177 3 168 125 187 35 56 138 165 262 118 256 103 157 62 83 229 25
-179 137 217 46 55 203 101 191 135 32 193 69 116 122 54 236 7 268 101 242 209 97
-142 233 125 238 109 121 87 59 1 234 41 258 50 123 253 221 127 153 45 107 174
-121 138 133 66 183 205 267 166 178 138 114 188 53 37 209 148 216 28 74 132 118
-237 142 214 164 25 211 63 69 97 161 194 255 136 250 139 132 169 41 20 163 58 34
-57 118 37 177 222 94 60 238 141 47 22 110 107 225 195 203 82 43 192 51 52 51 71
-12 14 180 72 198 117 38 157 94 9 164 76 15 128 101 261 170 40 40 21 143 200 32
-161 143 181 71 31 245 123 53 256 135 267 134 65 16 63 82 62 153 264 33 109 89
-244 124 220 128 50 104 105 91 146 12 27 145 64 268 82 11 79 199 84 215 80 128
-69 65 235 259 17 30 259 255 187 54 204 81 63 50 136 218 213 197 118 18 29 9 113
-189 220 179 124 252 54 255 155 128 82 30 227 59 252 3 98 90 179 105 21 111 4 97
-110 37 190 187 86 130 16 114 156 127 102 158 42 225 144 129 17 11 28 42 206 266
-186 119 223 10 80 96 143 130 184 153 26 146 44 140 80 115 104 73 165 24 44 191
-154 180 53 237 174 140 99 76 47 54 223 42 6 31 194 236 175 37 158 261 151 79
-180 123 2 182 257 51 103 125 219 231 178 189 1 253 2 201 218 264 1 183 237 193
-18 229 244 105 72 185 152 46 87 46 36 242 241 23 77 14 148 229 263 66 202 166
-210 64 49 156 76 28 93 93 61 135 13 232 126 135 251 36 4 84 145 45 120 139 113
-208 181 39 105 40 72 217 265 251 55 152 27 126 186 138 184 223 61 154 161 175
-107 6 269 81 114 207 201 167 107 206 234 73 184 172 174 89 212 11 98 77 214 113
-221 146 31 175 88 45 139 100 243 189 239 57 67 150 112 3 117 51 122 86 79 129
-49 207 233 93 42 257 70 64 68 117 19 196 151 111 23 58 53 18 248 205 48 240 56
-170 8 197 169 92 94 41 7 198 66 234 92 145 115 155 147 230 243 208 200 48 21
-130 235 40 91 178 208 149 196 170 259 236 226 111 36 23 45 88 26 178 157 207 ^
-566 1 42 219 91 225 108 50 151 130 252 184 34 72 262 163 156 4 112 20 74 177 14
-140 91 85 159 243 19 211 110 237 2 114 67 248 82 241 104 88 126 150 210 247 170
-225 157 90 230 262 80 54 162 104 39 86 71 78 147 28 6 216 41 35 75 97 19 154
-172 59 267 185 135 77 95 244 71 267 45 186 270 144 144 110 48 13 228 75 229 70
-75 40 172 189 48 153 177 154 89 170 36 259 113 147 243 68 160 189 97 102 256 14
-8 131 164 19 162 161 158 142 14 197 29 141 11 90 173 52 115 202 43 131 198 81
-106 218 39 169 173 192 64 9 175 50 68 28 138 176 234 84 156 227 72 213 214 77
-144 193 150 127 145 56 217 176 102 124 235 87 263 83 161 109 102 116 65 201 180
-64 149 215 129 200 128 8 123 266 133 79 142 146 248 222 9 183 220 226 20 157 7
-128 148 163 73 265 270 12 93 8 180 204 98 22 261 28 89 227 155 224 56 85 125
-181 256 154 229 210 115 119 32 108 190 100 209 112 103 176 19 22 121 79 10 95
-55 82 109 53 167 258 69 80 194 202 183 171 5 213 25 88 258 201 131 115 70 83 29
-58 67 165 71 127 96 107 138 44 2 163 16 55 33 160 246 35 67 108 133 162 153 260
-165 203 178 17 247 38 174 55 222 58 132 27 86 211 27 226 160 106 86 260 248 33
-20 25 228 207 8 263 215 212 30 242 16 195 254 239 106 135 28 55 165 120 167 175
-239 238 186 130 195 65 250 220 143 9 43 271 147 160 57 137 181 116 114 150 78
-196 249 85 76 232 177 22 129 68 168 87 74 94 3 26 174 104 171 137 264 218 228
-158 59 184 83 21 69 23 256 146 59 52 32 100 20 214 126 93 10 46 106 3 249 134
-25 39 37 122 271 15 109 136 269 100 258 61 182 36 119 164 68 111 240 18 242 156
-144 61 99 206 96 156 87 123 134 82 158 2 246 118 169 222 141 143 141 94 192 15
-60 96 190 149 158 191 235 4 161 241 153 37 205 10 38 117 117 166 206 13 145 245
-115 62 94 52 66 253 236 271 7 211 159 5 81 246 167 118 29 1 62 11 41 224 245
-255 102 173 3 166 123 183 31 56 134 165 260 116 254 99 157 56 77 227 23 173 135
-217 44 51 203 95 187 133 30 193 67 116 122 48 236 7 268 97 242 205 93 140 231
-125 238 103 119 81 57 269 232 37 254 50 117 249 217 127 153 45 103 168 121 136
-129 60 179 201 263 166 172 132 110 188 53 35 207 148 212 262 ^
-589 0 70 128 106 233 130 210 160 17 207 63 57 97 157 194 247 128 250 135 132
-165 29 16 155 50 26 49 118 37 165 218 94 60 234 137 47 14 110 103 221 191 195
-70 43 184 39 40 47 59 12 6 176 60 194 117 30 153 90 1 164 76 3 124 101 261 166
-36 28 9 143 196 32 153 135 177 67 31 245 123 49 248 135 262 263 126 61 12 51 78
-62 149 260 29 101 77 244 116 212 120 42 92 105 91 138 27 141 52 260 74 3 79 199
-84 211 68 128 61 57 227 255 17 18 259 251 187 46 196 77 55 38 132 210 205 193
-110 18 25 271 105 181 216 179 112 252 50 255 147 116 82 22 219 47 248 265 86 86
-171 93 13 103 266 93 98 25 186 183 86 126 16 110 148 123 94 150 38 217 132 125
-9 273 20 30 198 266 178 119 219 2 72 88 131 118 172 145 26 134 40 132 80 107 96
-65 161 24 44 191 150 168 41 229 170 140 99 72 43 54 215 42 2 27 186 228 163 29
-146 253 147 71 180 119 264 178 249 43 99 117 219 231 170 185 1 249 272 197 214
-264 263 171 237 189 6 221 236 97 72 173 152 38 87 34 28 238 241 19 77 10 136
-229 255 62 194 162 206 56 45 144 64 24 89 93 53 123 9 228 118 127 243 24 4 72
-133 33 120 127 113 200 181 27 101 32 68 213 257 251 43 144 19 122 186 138 184
-223 61 142 149 175 107 6 261 81 114 207 193 155 95 202 226 73 180 164 166 81
-204 11 98 65 206 101 221 146 19 167 88 41 139 92 235 189 235 45 59 142 104 273
-105 51 118 82 67 121 49 203 233 85 34 257 62 64 64 109 11 188 143 111 11 58 45
-14 240 201 44 236 52 170 270 197 169 88 86 41 269 190 58 234 92 145 111 155 135
-222 243 208 200 266 48 21 122 231 40 87 178 204 141 196 162 251 232 222 99 32
-23 37 80 22 174 145 71 36 217 87 223 106 44 151 130 250 180 34 68 258 159 154
-272 112 18 70 173 8 136 85 79 159 239 19 207 108 233 112 63 246 76 237 104 84
-126 146 208 245 168 225 151 90 230 262 74 48 156 102 39 80 67 76 147 26 4 216
-35 35 75 95 13 148 168 270 53 267 185 131 73 95 242 71 265 41 184 268 138 144
-104 44 7 228 73 225 66 69 36 172 185 46 151 175 152 83 164 36 257 107 141 241
-64 154 187 91 98 254 10 6 131 158 17 162 161 154 142 14 195 25 141 7 84 171 48
-111 200 37 125 198 77 100 214 35 165 173 192 58 5 169 48 66 24 134 170 230 78
-152 227 66 213 212 75 140 189 150 123 139 52 215 172 124 ^
-584 0 124 227 83 263 79 157 109 90 104 61 201 168 56 149 215 125 196 116 272
-111 262 133 67 138 142 248 218 9 183 212 222 8 153 3 120 144 163 65 265 270 4
-89 8 172 204 94 18 257 16 89 219 147 216 52 85 113 177 256 154 225 210 115 111
-28 108 186 96 209 104 103 176 11 14 109 71 10 87 51 74 105 49 159 258 69 72 190
-202 179 171 1 205 21 76 254 197 127 111 70 83 29 54 67 157 67 115 92 103 134 36
-2 151 4 47 33 160 246 27 55 96 125 154 141 260 153 195 170 13 247 38 170 55 222
-50 128 15 78 211 19 226 156 98 82 252 240 29 12 25 224 199 259 207 212 30 234 8
-195 254 239 102 123 28 43 161 108 167 171 235 230 178 118 187 65 242 220 135 5
-35 267 143 152 57 137 173 108 102 146 78 188 245 81 72 232 177 22 129 68 168 75
-74 82 275 14 174 96 167 129 260 218 220 158 55 180 75 9 57 11 248 134 59 52 20
-88 20 214 114 81 264 6 46 106 271 249 122 17 35 33 118 271 15 97 136 269 100
-250 49 182 32 107 156 56 107 240 6 238 156 140 57 95 198 96 144 79 115 134 78
-146 270 238 114 165 214 137 131 133 90 188 11 56 84 190 137 154 183 235 272 153
-237 145 25 205 274 26 109 113 154 206 9 141 237 103 50 86 40 66 253 228 263 271
-207 147 5 77 242 155 110 17 269 58 275 37 224 241 251 102 165 3 162 119 175 23
-56 126 165 256 112 250 91 157 44 65 223 19 161 131 217 40 43 203 83 179 129 26
-193 63 116 122 36 236 7 268 89 242 197 85 136 227 125 238 91 115 69 53 265 228
-29 246 50 105 241 209 127 153 45 95 156 121 132 121 48 171 193 255 166 160 120
-102 188 53 31 203 148 204 10 68 126 100 231 124 208 158 13 205 63 51 97 155 194
-243 124 250 133 132 163 23 14 151 46 22 45 118 37 159 216 94 60 232 135 47 10
-110 101 219 189 191 64 43 180 33 34 45 53 12 2 174 54 192 117 26 151 88 273 164
-76 273 122 101 261 164 34 22 3 143 194 32 149 131 175 65 31 245 123 47 244 135
-258 261 122 59 10 45 76 62 147 258 27 97 71 244 112 208 116 38 86 105 91 134
-270 27 139 46 256 70 275 79 199 84 209 62 128 57 53 223 253 17 12 259 249 187
-42 192 75 51 32 130 206 201 191 106 18 23 267 101 177 214 179 106 252 48 255
-143 110 82 18 215 41 246 261 80 84 167 87 9 99 262 91 92 19 184 181 86 124 16
-108 144 121 90 146 36 213 126 123 5 269 230 ^
-587 0 18 190 266 170 119 215 272 64 80 119 106 160 137 26 122 36 124 80 99 88
-57 157 24 44 191 146 156 29 221 166 140 99 68 39 54 207 42 276 23 178 220 151
-21 134 245 143 63 180 115 256 174 241 35 95 109 219 231 162 181 1 245 272 193
-210 264 255 159 237 185 272 213 228 89 72 161 152 30 87 22 20 234 241 15 77 6
-124 229 247 58 186 158 202 48 41 132 52 20 85 93 45 111 5 224 110 119 235 12 4
-60 121 21 120 115 113 192 181 15 97 24 64 209 249 251 31 136 11 118 186 138 184
-223 61 130 137 175 107 6 253 81 114 207 185 143 83 198 218 73 176 156 158 73
-196 11 98 53 198 89 221 146 7 159 88 37 139 84 227 189 231 33 51 134 96 273 93
-51 114 78 55 113 49 199 233 77 26 257 54 64 60 101 3 180 135 111 277 58 37 10
-232 197 40 232 48 170 262 197 169 84 78 41 261 182 50 234 92 145 107 155 123
-214 243 208 200 262 48 21 114 227 40 83 178 200 133 196 154 243 228 218 87 28
-23 29 72 18 170 133 67 24 213 79 219 102 32 151 130 246 172 34 60 250 151 150
-264 112 14 62 165 274 128 73 67 159 231 19 199 104 225 274 108 55 242 64 229
-104 76 126 138 204 241 164 225 139 90 230 262 62 36 144 98 39 68 59 72 147 22
-216 23 35 75 91 1 136 160 266 41 267 185 123 65 95 238 71 261 33 180 264 126
-144 92 36 273 228 69 217 58 57 28 172 177 42 147 171 148 71 152 36 253 95 129
-237 56 142 183 79 90 250 2 2 131 146 13 162 161 146 142 14 191 17 141 277 72
-167 40 103 196 25 113 198 69 88 206 27 157 173 192 46 275 157 44 62 16 126 158
-222 66 144 227 54 213 208 71 132 181 150 115 127 44 211 164 96 124 223 81 263
-77 155 109 84 98 59 201 162 52 149 215 123 194 110 268 105 260 133 61 136 140
-248 216 9 183 208 220 2 151 1 116 142 163 61 265 270 87 8 168 204 92 16 255 10
-89 215 143 212 50 85 107 175 256 154 223 210 115 107 26 108 184 94 209 100 103
-176 7 10 103 67 10 83 49 70 103 47 155 258 69 68 188 202 177 171 277 201 19 70
-252 195 125 109 70 83 29 52 67 153 65 109 90 101 132 32 2 145 276 43 33 160 246
-23 49 90 121 150 135 260 147 191 166 11 247 38 168 55 222 46 126 9 74 211 15
-226 154 94 80 248 236 27 8 25 222 195 274 257 203 212 30 230 4 195 254 239 100
-117 28 37 159 102 167 169 233 226 174 112 183 65 238 220 131 3 31 270 ^
-609 1 140 146 57 137 167 102 93 143 78 182 242 78 69 232 177 22 129 68 168 66
-74 73 275 5 174 90 164 123 257 218 214 158 52 177 69 48 2 242 125 59 52 11 79
-20 214 105 72 258 3 46 106 268 249 113 11 32 30 115 271 15 88 136 269 100 244
-40 182 29 98 150 47 104 240 276 235 156 137 54 92 192 96 135 73 109 134 75 137
-267 232 111 162 208 134 122 127 87 185 8 53 75 190 128 151 177 235 269 147 234
-139 16 205 268 17 103 110 145 206 6 138 231 94 41 80 31 66 253 222 257 265 204
-138 5 74 239 146 104 8 266 55 269 34 224 238 248 102 159 3 159 116 169 17 56
-120 165 253 109 247 85 157 35 56 220 16 152 128 217 37 37 203 74 173 126 23 193
-60 116 122 27 236 7 268 83 242 191 79 133 224 125 238 82 112 60 50 262 225 23
-240 50 96 235 203 127 153 45 89 147 121 129 115 39 165 187 249 166 151 111 96
-188 53 28 200 148 198 1 65 123 91 228 115 205 155 7 202 63 42 97 152 194 237
-118 250 130 132 160 14 11 145 40 16 39 118 37 150 213 94 60 229 132 47 4 110 98
-216 186 185 55 43 174 24 25 42 44 12 275 171 45 189 117 20 148 85 270 164 76
-267 119 101 261 161 31 13 273 143 191 32 143 125 172 62 31 245 123 44 238 135
-252 258 116 56 7 36 73 62 144 255 24 91 62 244 106 202 110 32 77 105 91 128 264
-27 136 37 250 64 272 79 199 84 206 53 128 51 47 217 250 17 3 259 246 187 36 186
-72 45 23 127 200 195 188 100 18 20 261 95 171 211 179 97 252 45 255 137 101 82
-12 209 32 243 255 71 81 161 78 3 93 256 88 83 10 181 178 86 121 16 105 138 118
-84 140 33 207 117 120 278 263 10 15 188 266 168 119 214 271 62 78 116 103 157
-135 26 119 35 122 80 97 86 55 156 24 44 191 145 153 26 219 165 140 99 67 38 54
-205 42 276 22 176 218 148 19 131 243 142 61 180 114 254 173 239 33 94 107 219
-231 160 180 1 244 272 192 209 264 253 156 237 184 270 211 226 87 72 158 152 28
-87 19 18 233 241 14 77 5 121 229 245 57 184 157 201 46 40 129 49 19 84 93 43
-108 4 223 108 117 233 9 4 57 118 18 120 112 113 190 181 12 96 22 63 208 247 251
-28 134 9 117 186 138 184 223 61 127 134 175 107 6 251 81 114 207 183 140 80 197
-216 73 175 154 156 71 194 11 98 50 196 86 221 146 4 157 88 36 139 82 225 189
-230 30 49 132 94 273 90 51 113 77 52 111 49 198 233 75 24 257 52 64 59 99 1 178
-133 111 275 58 35 9 230 196 39 231 47 170 216 ^
-589 0 197 169 81 72 41 255 176 44 234 92 145 104 155 114 208 243 208 200 259 48
-21 108 224 40 80 178 197 127 196 148 237 225 215 78 25 23 23 66 15 167 124 64
-15 210 73 216 99 23 151 130 243 166 34 54 244 145 147 258 112 11 56 159 268 122
-64 58 159 225 19 193 101 219 274 105 49 239 55 223 104 70 126 132 201 238 161
-225 130 90 230 262 53 27 135 95 39 59 53 69 147 19 278 216 14 35 75 88 273 127
-154 263 32 267 185 117 59 95 235 71 258 27 177 261 117 144 83 30 267 228 66 211
-52 48 22 172 171 39 144 168 145 62 143 36 250 86 120 234 50 133 180 70 84 247
-277 280 131 137 10 162 161 140 142 14 188 11 141 274 63 164 34 97 193 16 104
-198 63 79 200 21 151 173 192 37 272 148 41 59 10 120 149 216 57 138 227 45 213
-205 68 126 175 150 109 118 38 208 158 93 124 217 78 263 74 152 109 75 89 56 201
-153 46 149 215 120 191 101 262 96 257 133 52 133 137 248 213 9 183 202 217 274
-148 279 110 139 163 55 265 270 275 84 8 162 204 89 13 252 1 89 209 137 206 47
-85 98 172 256 154 220 210 115 101 23 108 181 91 209 94 103 176 1 4 94 61 10 77
-46 64 100 44 149 258 69 62 185 202 174 171 277 195 16 61 249 192 122 106 70 83
-29 49 67 147 62 100 87 98 129 26 2 136 270 37 33 160 246 17 40 81 115 144 126
-260 138 185 160 8 247 38 165 55 222 40 123 68 211 9 226 151 88 77 242 230 24 2
-25 219 189 271 254 197 212 30 224 279 195 254 239 97 108 28 28 156 93 167 166
-230 220 168 103 177 65 232 220 125 25 262 138 142 57 137 163 98 87 141 78 178
-240 76 67 232 177 22 129 68 168 60 74 67 275 280 174 86 162 119 255 218 210 158
-50 175 65 275 42 277 238 119 59 52 5 73 20 214 99 66 254 1 46 106 266 249 107 7
-30 28 113 271 15 82 136 269 100 240 34 182 27 92 146 41 102 240 272 233 156 135
-52 90 188 96 129 69 105 134 73 131 265 228 109 160 204 132 116 123 85 183 6 51
-69 190 122 149 173 235 267 143 232 135 10 205 264 11 99 108 139 206 4 136 227
-88 35 76 25 66 253 218 253 261 202 132 5 72 237 140 100 2 264 53 265 32 224 236
-246 102 155 3 157 114 165 13 56 116 165 251 107 245 81 157 29 50 218 14 146 126
-217 35 33 203 68 169 124 21 193 58 116 122 21 236 7 268 79 242 187 75 131 222
-125 238 76 110 54 48 260 223 19 236 50 90 231 199 127 153 45 270 ^
-623 1 135 121 125 107 27 157 179 241 166 139 99 88 188 53 24 196 148 190 272 61
-119 79 224 103 201 151 282 198 63 30 97 148 194 229 110 250 126 132 156 2 7 137
-32 8 31 118 37 138 209 94 60 225 128 47 279 110 94 212 182 177 43 43 166 12 13
-38 32 12 271 167 33 185 117 12 144 81 266 164 76 259 115 101 261 157 27 1 265
-143 187 32 135 117 168 58 31 245 123 40 230 135 244 254 108 52 3 24 69 62 140
-251 20 83 50 244 98 194 102 24 65 105 91 120 256 27 132 25 242 56 268 79 199 84
-202 41 128 43 39 209 246 17 274 259 242 187 28 178 68 37 11 123 192 187 184 92
-18 16 253 87 163 207 179 85 252 41 255 129 89 82 4 201 20 239 247 59 77 153 66
-278 85 248 84 71 281 177 174 86 117 16 101 130 114 76 132 29 199 105 116 274
-255 2 3 180 266 160 119 210 267 54 70 104 91 145 127 26 107 31 114 80 89 78 47
-152 24 44 191 141 141 14 211 161 140 99 63 34 54 197 42 276 18 168 210 136 11
-119 235 138 53 180 110 246 169 231 25 90 99 219 231 152 176 1 240 272 188 205
-264 245 144 237 180 262 203 218 79 72 146 152 20 87 7 10 229 241 10 77 1 109
-229 237 53 176 153 197 38 36 117 37 15 80 93 35 96 219 100 109 225 280 4 45 106
-6 120 100 113 182 181 92 14 59 204 239 251 16 126 1 113 186 138 184 223 61 115
-122 175 107 6 243 81 114 207 175 128 68 193 208 73 171 146 148 63 186 11 98 38
-188 74 221 146 275 149 88 32 139 74 217 189 226 18 41 124 86 273 78 51 109 73
-40 103 49 194 233 67 16 257 44 64 55 91 276 170 125 111 267 58 27 5 222 192 35
-227 43 170 252 197 169 79 68 41 251 172 40 234 92 145 102 155 108 204 243 208
-200 257 48 21 104 222 40 78 178 195 123 196 144 233 223 213 72 23 23 19 62 13
-165 118 62 9 208 69 214 97 17 151 130 241 162 34 50 240 141 145 254 112 9 52
-155 264 118 58 52 159 221 19 189 99 215 274 103 45 237 49 219 104 66 126 128
-199 236 159 225 124 90 230 262 47 21 129 93 39 53 49 67 147 17 278 216 8 35 75
-86 269 121 150 261 26 267 185 113 55 95 233 71 256 23 175 259 111 144 77 26 263
-228 64 207 48 42 18 172 167 37 142 166 143 56 137 36 248 80 114 232 46 127 178
-64 80 245 275 280 131 131 8 162 161 136 142 14 186 7 141 272 57 162 30 93 191
-10 98 198 59 73 196 17 147 173 192 31 270 142 39 57 6 116 143 212 51 134 227 39
-213 203 66 122 171 150 105 112 34 206 154 91 124 213 76 263 72 150 109 69 83 54
-201 147 42 149 202 ^
-602 1 116 187 89 254 84 253 133 40 129 133 248 209 9 183 194 213 266 144 279
-102 135 163 47 265 270 271 80 8 154 204 85 9 248 274 89 201 129 198 43 85 86
-168 256 154 216 210 115 93 19 108 177 87 209 86 103 176 278 281 82 53 10 69 42
-56 96 40 141 258 69 54 181 202 170 171 277 187 12 49 245 188 118 102 70 83 29
-45 67 139 58 88 83 94 125 18 2 124 262 29 33 160 246 9 28 69 107 136 114 260
-126 177 152 4 247 38 161 55 222 32 119 273 60 211 1 226 147 80 73 234 222 20
-279 25 215 181 267 250 189 212 30 216 275 195 254 239 93 96 28 16 152 81 167
-162 226 212 160 91 169 65 224 220 117 281 17 258 134 134 57 137 155 90 75 137
-78 170 236 72 63 232 177 22 129 68 168 48 74 55 275 272 174 78 158 111 251 218
-202 158 46 171 57 267 30 269 230 107 59 52 278 61 20 214 87 54 246 282 46 106
-262 249 95 284 26 24 109 271 15 70 136 269 100 232 22 182 23 80 138 29 98 240
-264 229 156 131 48 86 180 96 117 61 97 134 69 119 261 220 105 156 196 128 104
-115 81 179 2 47 57 190 110 145 165 235 263 135 228 127 283 205 256 284 91 104
-127 206 132 219 76 23 68 13 66 253 210 245 253 198 120 5 68 233 128 92 275 260
-49 257 28 224 232 242 102 147 3 153 110 157 5 56 108 165 247 103 241 73 157 17
-38 214 10 134 122 217 31 25 203 56 161 120 17 193 54 116 122 9 236 7 268 71 242
-179 67 127 218 125 238 64 106 42 44 256 219 11 228 50 78 223 191 127 153 45 77
-129 121 123 103 21 153 175 237 166 133 93 84 188 53 22 194 148 186 268 59 117
-73 222 97 199 149 280 196 63 24 97 146 194 225 106 250 124 132 154 281 5 133 28
-4 27 118 37 132 207 94 60 223 126 47 277 110 92 210 180 173 37 43 162 6 7 36 26
-12 269 165 27 183 117 8 142 79 264 164 76 255 113 101 261 155 25 280 261 143
-185 32 131 113 166 56 31 245 123 38 226 135 240 252 104 50 1 18 67 62 138 249
-18 79 44 244 94 190 98 20 59 105 91 116 252 27 130 19 238 52 266 79 199 84 200
-35 128 39 35 205 244 17 270 259 240 187 24 174 66 33 5 121 188 183 182 88 18 14
-249 83 159 205 179 79 252 39 255 125 83 82 197 14 237 243 53 75 149 60 276 81
-244 82 65 277 175 172 86 115 16 99 126 112 72 128 27 195 99 114 272 251 283 282
-176 266 156 119 208 265 50 66 98 85 139 123 26 101 29 110 80 85 74 43 150 24 44
-191 139 135 8 207 159 140 99 61 248 ^
-609 1 54 189 42 276 14 160 202 124 3 107 227 134 45 180 106 238 165 223 17 86
-91 219 231 144 172 1 236 272 184 201 264 237 132 237 176 254 195 210 71 72 134
-152 12 87 282 2 225 241 6 77 284 97 229 229 49 168 149 193 30 32 105 25 11 76
-93 27 84 283 215 92 101 217 272 4 33 94 281 120 88 113 174 181 275 88 6 55 200
-231 251 4 118 280 109 186 138 184 223 61 103 110 175 107 6 235 81 114 207 167
-116 56 189 200 73 167 138 140 55 178 11 98 26 180 62 221 146 267 141 88 28 139
-66 209 189 222 6 33 116 78 273 66 51 105 69 28 95 49 190 233 59 8 257 36 64 51
-83 272 162 117 111 259 58 19 1 214 188 31 223 39 170 244 197 169 75 60 41 243
-164 32 234 92 145 98 155 96 196 243 208 200 253 48 21 96 218 40 74 178 191 115
-196 136 225 219 209 60 19 23 11 54 9 161 106 58 284 204 61 210 93 5 151 130 237
-154 34 42 232 133 141 246 112 5 44 147 256 110 46 40 159 213 19 181 95 207 274
-99 37 233 37 211 104 58 126 120 195 232 155 225 112 90 230 262 35 9 117 89 39
-41 41 63 147 13 278 216 283 35 75 82 261 109 142 257 14 267 185 105 47 95 229
-71 252 15 171 255 99 144 65 18 255 228 60 199 40 30 10 172 159 33 138 162 139
-44 125 36 244 68 102 228 38 115 174 52 72 241 271 280 131 119 4 162 161 128 142
-14 182 286 141 268 45 158 22 85 187 285 86 198 51 61 188 9 139 173 192 19 266
-130 35 53 285 108 131 204 39 126 227 27 213 199 62 114 163 150 97 100 26 202
-146 87 124 205 72 263 68 146 109 57 71 50 201 135 34 149 215 114 185 83 250 78
-251 133 34 127 131 248 207 9 183 190 211 262 142 279 98 133 163 43 265 270 269
-78 8 150 204 83 7 246 270 89 197 125 194 41 85 80 166 256 154 214 210 115 89 17
-108 175 85 209 82 103 176 276 279 76 49 10 65 40 52 94 38 137 258 69 50 179 202
-168 171 277 183 10 43 243 186 116 100 70 83 29 43 67 135 56 82 81 92 123 14 2
-118 258 25 33 160 246 5 22 63 103 132 108 260 120 173 148 2 247 38 159 55 222
-28 117 269 56 211 284 226 145 76 71 230 218 18 277 25 213 177 265 248 185 212
-30 212 273 195 254 239 91 90 28 10 150 75 167 160 224 208 156 85 165 65 220 220
-113 281 13 256 132 130 57 137 151 86 69 135 78 166 234 70 61 232 177 22 129 68
-168 42 74 49 275 268 174 74 156 107 249 218 198 158 44 169 53 263 24 265 226
-101 59 52 274 55 20 214 81 48 242 282 46 106 260 145 ^
-614 1 83 280 22 20 105 271 15 58 136 269 100 224 10 182 19 68 130 17 94 240 256
-225 156 127 44 82 172 96 105 53 89 134 65 107 257 212 101 152 188 124 92 107 77
-175 287 43 45 190 98 141 157 235 259 127 224 119 275 205 248 276 83 100 115 206
-285 128 211 64 11 60 1 66 253 202 237 245 194 108 5 64 229 116 84 267 256 45
-249 24 224 228 238 102 139 3 149 106 149 286 56 100 165 243 99 237 65 157 5 26
-210 6 122 118 217 27 17 203 44 153 116 13 193 50 116 122 286 236 7 268 63 242
-171 59 123 214 125 238 52 102 30 40 252 215 3 220 50 66 215 183 127 153 45 69
-117 121 119 95 9 145 167 229 166 121 81 76 188 53 18 190 148 178 260 55 113 61
-218 85 195 145 276 192 63 12 97 142 194 217 98 250 120 132 150 273 1 125 20 285
-19 118 37 120 203 94 60 219 122 47 273 110 88 206 176 165 25 43 154 283 284 32
-14 12 265 161 15 179 117 138 75 260 164 76 247 109 101 261 151 21 272 253 143
-181 32 123 105 162 52 31 245 123 34 218 135 232 248 96 46 286 6 63 62 134 245
-14 71 32 244 86 182 90 12 47 105 91 108 244 27 126 7 230 44 262 79 199 84 196
-23 128 31 27 197 240 17 262 259 236 187 16 166 62 25 282 117 180 175 178 80 18
-10 241 75 151 201 179 67 252 35 255 117 71 82 281 189 2 233 235 41 71 141 48
-272 73 236 78 53 269 171 168 86 111 16 95 118 108 64 120 23 187 87 110 268 243
-279 274 168 266 148 119 204 261 42 58 86 73 127 115 26 89 25 102 80 77 66 35
-146 24 44 191 135 123 285 199 155 140 99 57 28 54 185 42 276 12 156 198 118 288
-101 223 132 41 180 104 234 163 219 13 84 87 219 231 140 170 1 234 272 182 199
-264 233 126 237 174 250 191 206 67 72 128 152 8 87 278 287 223 241 4 77 284 91
-229 225 47 164 147 191 26 30 99 19 9 74 93 23 78 283 213 88 97 213 268 4 27 88
-277 120 82 113 170 181 271 86 2 53 198 227 251 287 114 278 107 186 138 184 223
-61 97 104 175 107 6 231 81 114 207 163 110 50 187 196 73 165 134 136 51 174 11
-98 20 176 56 221 146 263 137 88 26 139 62 205 189 220 29 112 74 273 60 51 103
-67 22 91 49 188 233 55 4 257 32 64 49 79 270 158 113 111 255 58 15 288 210 186
-29 221 37 170 240 197 169 73 56 41 239 160 28 234 92 145 96 155 90 192 243 208
-200 251 48 21 92 216 40 72 178 189 111 196 132 221 217 207 54 17 23 7 50 7 159
-100 56 280 202 57 208 91 288 151 130 235 150 34 38 228 129 139 242 112 226 ^
-619 0 38 141 250 104 37 31 159 207 19 175 92 201 274 96 31 230 28 205 104 52
-126 114 192 229 152 225 103 90 230 262 26 108 86 39 32 35 60 147 10 278 216 277
-35 75 79 255 100 136 254 5 267 185 99 41 95 226 71 249 9 168 252 90 144 56 12
-249 228 57 193 34 21 4 172 153 30 135 159 136 35 116 36 241 59 93 225 32 106
-171 43 66 238 268 280 131 110 1 162 161 122 142 14 179 283 141 265 36 155 16 79
-184 279 77 198 45 52 182 3 133 173 192 10 263 121 32 50 282 102 122 198 30 120
-227 18 213 196 59 108 157 150 91 91 20 199 140 84 124 199 69 263 65 143 109 48
-62 47 201 126 28 149 215 111 182 74 244 69 248 133 25 124 128 248 204 9 183 184
-208 256 139 279 92 130 163 37 265 270 266 75 8 144 204 80 4 243 264 89 191 119
-188 38 85 71 163 256 154 211 210 115 83 14 108 172 82 209 76 103 176 273 276 67
-43 10 59 37 46 91 35 131 258 69 44 176 202 165 171 277 177 7 34 240 183 113 97
-70 83 29 40 67 129 53 73 78 89 120 8 2 109 252 19 33 160 246 289 13 54 97 126
-99 260 111 167 142 289 247 38 156 55 222 22 114 263 50 211 281 226 142 70 68
-224 212 15 274 25 210 171 262 245 179 212 30 206 270 195 254 239 88 81 28 1 147
-66 167 157 221 202 150 76 159 65 214 220 107 281 7 253 129 124 57 137 145 80 60
-132 78 160 231 67 58 232 177 22 129 68 168 33 74 40 275 262 174 68 153 101 246
-218 192 158 41 166 47 257 15 259 220 92 59 52 268 46 20 214 72 39 236 282 46
-106 257 249 80 279 21 19 104 271 15 55 136 269 100 222 7 182 18 65 128 14 93
-240 254 224 156 126 43 81 170 96 102 51 87 134 64 104 256 210 100 151 186 123
-89 105 76 174 287 42 42 190 95 140 155 235 258 125 223 117 273 205 246 274 81
-99 112 206 285 127 209 61 8 58 288 66 253 200 235 243 193 105 5 63 228 113 82
-265 255 44 247 23 224 227 237 102 137 3 148 105 147 285 56 98 165 242 98 236 63
-157 2 23 209 5 119 117 217 26 15 203 41 151 115 12 193 49 116 122 284 236 7 268
-61 242 169 57 122 213 125 238 49 101 27 39 251 214 1 218 50 63 213 181 127 153
-45 67 114 121 118 93 6 143 165 227 166 118 78 74 188 53 17 189 148 176 258 54
-112 58 217 82 194 144 275 191 63 9 97 141 194 215 96 250 119 132 149 271 123 18
-284 17 118 37 117 202 94 60 218 121 47 272 110 87 205 175 163 22 43 152 281 282
-31 11 12 264 160 12 178 117 288 137 74 259 164 76 245 108 101 261 150 20 270
-251 143 180 264 ^
-639 0 117 99 159 49 31 245 123 31 212 135 226 245 90 43 286 289 60 62 131 242
-11 65 23 244 80 176 84 6 38 105 91 102 238 27 123 290 224 38 259 79 199 84 193
-14 128 25 21 191 237 17 256 259 233 187 10 160 59 19 276 114 174 169 175 74 18
-7 235 69 145 198 179 58 252 32 255 111 62 82 278 183 285 230 229 32 68 135 39
-269 67 230 75 44 263 168 165 86 108 16 92 112 105 58 114 20 181 78 107 265 237
-276 268 162 266 142 119 201 258 36 52 77 64 118 109 26 80 22 96 80 71 60 29 143
-24 44 191 132 114 279 193 152 140 99 54 25 54 179 42 276 9 150 192 109 285 92
-217 129 35 180 101 228 160 213 7 81 81 219 231 134 167 1 231 272 179 196 264
-227 117 237 171 244 185 200 61 72 119 152 2 87 272 284 220 241 1 77 284 82 229
-219 44 158 144 188 20 27 90 10 6 71 93 17 69 283 210 82 91 207 262 4 18 79 271
-120 73 113 164 181 265 83 288 50 195 221 251 281 108 275 104 186 138 184 223 61
-88 95 175 107 6 225 81 114 207 157 101 41 184 190 73 162 128 130 45 168 11 98
-11 170 47 221 146 257 131 88 23 139 56 199 189 217 283 23 106 68 273 51 51 100
-64 13 85 49 185 233 49 290 257 26 64 46 73 267 152 107 111 249 58 9 288 204 183
-26 218 34 170 234 197 169 70 50 41 233 154 22 234 92 145 93 155 81 186 243 208
-200 248 48 21 86 213 40 69 178 186 105 196 126 215 214 204 45 14 23 1 44 4 156
-91 53 274 199 51 205 88 282 151 130 232 144 34 32 222 123 136 236 112 34 137
-246 100 31 25 159 203 19 171 90 197 274 94 27 228 22 201 104 48 126 110 190 227
-150 225 97 90 230 262 20 286 102 84 39 26 31 58 147 8 278 216 273 35 75 77 251
-94 132 252 291 267 185 95 37 95 224 71 247 5 166 250 84 144 50 8 245 228 55 189
-30 15 172 149 28 133 157 134 29 110 36 239 53 87 223 28 100 169 37 62 236 266
-280 131 104 291 162 161 118 142 14 177 281 141 263 30 153 12 75 182 275 71 198
-41 46 178 291 129 173 192 4 261 115 30 48 280 98 116 194 24 116 227 12 213 194
-57 104 153 150 87 85 16 197 136 82 124 195 67 263 63 141 109 42 56 45 201 120
-24 149 215 109 180 68 240 63 246 133 19 122 126 248 202 9 183 180 206 252 137
-279 88 128 163 33 265 270 264 73 8 140 204 78 2 241 260 89 187 115 184 36 85 65
-161 256 154 209 210 115 79 12 108 170 80 209 72 103 176 271 274 61 39 10 55 35
-42 89 33 127 258 69 40 174 202 163 171 277 173 5 28 238 181 111 95 70 83 29 38
-67 125 51 67 76 87 118 4 2 103 248 15 33 160 246 287 7 48 93 283 ^
-611 0 87 260 99 159 134 289 247 38 152 55 222 14 110 255 42 211 277 226 138 62
-64 216 204 11 270 25 206 163 258 241 171 212 30 198 266 195 254 239 84 69 28
-283 143 54 167 153 217 194 142 64 151 65 206 220 99 281 293 249 125 116 57 137
-137 72 48 128 78 152 227 63 54 232 177 22 129 68 168 21 74 28 275 254 174 60
-149 93 242 218 184 158 37 162 39 249 3 251 212 80 59 52 260 34 20 214 60 27 228
-282 46 106 253 249 68 275 17 15 100 271 15 43 136 269 100 214 289 182 14 53 120
-2 89 240 246 220 156 122 39 77 162 96 90 43 79 134 60 92 252 202 96 147 178 119
-77 97 72 170 287 38 30 190 83 136 147 235 254 117 219 109 265 205 238 266 73 95
-100 206 285 123 201 49 290 50 280 66 253 192 227 235 189 93 5 59 224 101 74 257
-251 40 239 19 224 223 233 102 129 3 144 101 139 281 56 90 165 238 94 232 55 157
-284 11 205 1 107 113 217 22 7 203 29 143 111 8 193 45 116 122 276 236 7 268 53
-242 161 49 118 209 125 238 37 97 15 35 247 210 287 210 50 51 205 173 127 153 45
-59 102 121 114 85 288 135 157 219 166 106 66 66 188 53 13 185 148 168 250 50
-108 46 213 70 190 140 271 187 63 291 97 137 194 207 88 250 115 132 145 263 290
-115 10 280 9 118 37 105 198 94 60 214 117 47 268 110 83 201 171 155 10 43 144
-273 274 27 293 12 260 156 174 117 284 133 70 255 164 76 237 104 101 261 146 16
-262 243 143 176 32 113 95 157 47 31 245 123 29 208 135 222 243 86 41 286 285 58
-62 129 240 9 61 17 244 76 172 80 2 32 105 91 98 234 27 121 286 220 34 257 79
-199 84 191 8 128 21 17 187 235 17 252 259 231 187 6 156 57 15 272 112 170 165
-173 70 18 5 231 65 141 196 179 52 252 30 255 107 56 82 276 179 281 228 225 26
-66 131 33 267 63 226 73 38 259 166 163 86 106 16 90 108 103 54 110 18 177 72
-105 263 233 274 264 158 266 138 119 199 256 32 48 71 58 112 105 26 74 20 92 80
-67 56 25 141 24 44 191 130 108 275 189 150 140 99 52 23 54 175 42 276 7 146 188
-103 283 86 213 127 31 180 99 224 158 209 3 79 77 219 231 130 165 1 229 272 177
-194 264 223 111 237 169 240 181 196 57 72 113 152 292 87 268 282 218 241 293 77
-284 76 229 215 42 154 142 186 16 25 84 4 4 69 93 13 63 283 208 78 87 203 258 4
-12 73 267 120 67 113 160 181 261 81 286 48 193 217 251 277 104 273 102 186 138
-184 223 61 82 89 175 107 6 221 81 114 207 153 95 35 182 186 73 275 ^
-634 0 120 122 37 160 11 98 295 162 35 221 146 249 123 88 19 139 48 191 189 213
-275 15 98 60 273 39 51 96 60 1 77 49 181 233 41 286 257 18 64 42 65 263 144 99
-111 241 58 1 288 196 179 22 214 30 170 226 197 169 66 42 41 225 146 14 234 92
-145 89 155 69 178 243 208 200 244 48 21 78 209 40 65 178 182 97 196 118 207 210
-200 33 10 23 289 36 152 79 49 266 195 43 201 84 274 151 130 228 136 34 24 214
-115 132 228 112 292 26 129 238 92 19 13 159 195 19 163 86 189 274 90 19 224 10
-193 104 40 126 102 186 223 146 225 85 90 230 262 8 278 90 80 39 14 23 54 147 4
-278 216 265 35 75 73 243 82 124 248 283 267 185 87 29 95 220 71 243 293 162 246
-72 144 38 237 228 51 181 22 3 288 172 141 24 129 153 130 17 98 36 235 41 75 219
-20 88 165 25 54 232 262 280 131 92 291 162 161 110 142 14 173 277 141 259 18
-149 4 67 178 267 59 198 33 34 170 287 121 173 192 288 257 103 26 44 276 90 104
-186 12 108 227 213 190 53 96 145 150 79 73 8 193 128 78 124 187 63 263 59 137
-109 30 44 41 201 108 16 149 215 105 176 56 232 51 242 133 7 118 122 248 198 9
-183 172 202 244 133 279 80 124 163 25 265 270 260 69 8 132 204 74 294 237 252
-89 179 107 176 32 85 53 157 256 154 205 210 115 71 8 108 166 76 209 64 103 176
-267 270 49 31 10 47 31 34 85 29 119 258 69 32 170 202 159 171 277 165 1 16 234
-177 107 91 70 83 29 34 67 117 47 55 72 83 114 292 2 91 240 7 33 160 246 283 291
-36 85 114 81 260 93 155 130 289 247 38 150 55 222 10 108 251 38 211 275 226 136
-58 62 212 200 9 268 25 204 159 256 239 167 212 30 194 264 195 254 239 82 63 28
-279 141 48 167 151 215 190 138 58 147 65 202 220 95 281 291 247 123 112 57 137
-133 68 42 126 78 148 225 61 52 232 177 22 129 68 168 15 74 22 275 250 174 56
-147 89 240 218 180 158 35 160 35 245 293 247 208 74 59 52 256 28 20 214 54 21
-224 282 46 106 251 249 62 273 15 13 98 271 15 37 136 269 100 210 285 182 12 47
-116 292 87 240 242 218 156 120 37 75 158 96 84 39 75 134 58 86 250 198 94 145
-174 117 71 93 70 168 287 36 24 190 77 134 143 235 252 113 217 105 261 205 234
-262 69 93 94 206 285 121 197 43 286 46 276 66 253 188 223 231 187 87 5 57 222
-95 70 253 249 38 235 17 224 221 231 102 125 3 142 99 135 279 56 86 165 236 92
-230 51 157 280 5 203 295 101 111 217 20 3 203 23 139 109 6 193 43 116 122 272
-236 7 268 49 242 157 45 116 207 125 238 31 95 9 33 245 220 ^
-638 0 284 204 50 42 199 167 127 153 45 53 93 121 111 79 282 129 151 213 166 97
-57 60 188 53 10 182 148 162 244 47 105 37 210 61 187 137 268 184 63 285 97 134
-194 201 82 250 112 132 142 257 290 109 4 277 3 118 37 96 195 94 60 211 114 47
-265 110 80 198 168 149 1 43 138 267 268 24 287 12 257 153 288 171 117 281 130
-67 252 164 76 231 101 101 261 143 13 256 237 143 173 32 107 89 154 44 31 245
-123 26 202 135 216 240 80 38 286 279 55 62 126 237 6 55 8 244 70 166 74 293 23
-105 91 92 228 27 118 280 214 28 254 79 199 84 188 296 128 15 11 181 232 17 246
-259 228 187 150 54 9 266 109 164 159 170 64 18 2 225 59 135 193 179 43 252 27
-255 101 47 82 273 173 275 225 219 17 63 125 24 264 57 220 70 29 253 163 160 86
-103 16 87 102 100 48 104 15 171 63 102 260 227 271 258 152 266 132 119 196 253
-26 42 62 49 103 99 26 65 17 86 80 61 50 19 138 24 44 191 127 99 269 183 147 140
-99 49 20 54 169 42 276 4 140 182 94 280 77 207 124 25 180 96 218 155 203 294 76
-71 219 231 124 162 1 226 272 174 191 264 217 102 237 166 234 175 190 51 72 104
-152 289 87 262 279 215 241 293 77 284 67 229 209 39 148 139 183 10 22 75 292 1
-66 93 7 54 283 205 72 81 197 252 4 3 64 261 120 58 113 154 181 255 78 283 45
-190 211 251 271 98 270 99 186 138 184 223 61 73 80 175 107 6 215 81 114 207 147
-86 26 179 180 73 157 118 120 35 158 11 98 293 160 32 221 146 247 121 88 18 139
-46 189 189 212 273 13 96 58 273 36 51 95 59 295 75 49 180 233 39 285 257 16 64
-41 63 262 142 97 111 239 58 296 288 194 178 21 213 29 170 224 197 169 65 40 41
-223 144 12 234 92 145 88 155 66 176 243 208 200 243 48 21 76 208 40 64 178 181
-95 196 116 205 209 199 30 9 23 288 34 296 151 76 48 264 194 41 200 83 272 151
-130 227 134 34 22 212 113 131 226 112 292 24 127 236 90 16 10 159 193 19 161 85
-187 274 89 17 223 7 191 104 38 126 100 185 222 145 225 82 90 230 262 5 276 87
-79 39 11 21 53 147 3 278 216 263 35 75 72 241 79 122 247 281 267 185 85 27 95
-219 71 242 292 161 245 69 144 35 295 235 228 50 179 20 287 172 139 23 128 152
-129 14 95 36 234 38 72 218 18 85 164 22 52 231 261 280 131 89 291 162 161 108
-142 14 172 276 141 258 15 148 2 65 177 265 56 198 31 31 168 286 119 173 192 286
-256 100 25 43 275 88 101 184 9 106 227 294 213 189 52 94 143 150 77 70 6 192
-126 77 124 185 62 263 58 136 109 27 41 40 201 105 14 149 215 104 175 53 230 219
-^
-635 1 239 133 297 115 119 248 195 9 183 166 199 238 130 279 74 121 163 19 265
-270 257 66 8 126 204 71 294 234 246 89 173 101 170 29 85 44 154 256 154 202 210
-115 65 5 108 163 73 209 58 103 176 264 267 40 25 10 41 28 28 82 26 113 258 69
-26 167 202 156 171 277 159 297 7 231 174 104 88 70 83 29 31 67 111 44 46 69 80
-111 289 2 82 234 1 33 160 246 280 285 27 79 108 72 260 84 149 124 289 247 38
-147 55 222 4 105 245 32 211 272 226 133 52 59 206 194 6 265 25 201 153 253 236
-161 212 30 188 261 195 254 239 79 54 28 273 138 39 167 148 212 184 132 49 141
-65 196 220 89 281 288 244 120 106 57 137 127 62 33 123 78 142 222 58 49 232 177
-22 129 68 168 6 74 13 275 244 174 50 144 83 237 218 174 158 32 157 29 239 287
-241 202 65 59 52 250 19 20 214 45 12 218 282 46 106 248 249 53 270 12 10 95 271
-15 28 136 269 100 204 279 182 9 38 110 286 84 240 236 215 156 117 34 72 152 96
-75 33 69 134 55 77 247 192 91 142 168 114 62 87 67 165 287 33 15 190 68 131 137
-235 249 107 214 99 255 205 228 256 63 90 85 206 285 118 191 34 280 40 270 66
-253 182 217 225 184 78 5 54 219 86 64 247 246 35 229 14 224 218 228 102 119 3
-139 96 129 276 56 80 165 233 89 227 45 157 274 295 200 295 92 108 217 17 296
-203 14 133 106 3 193 40 116 122 266 236 7 268 43 242 151 39 113 204 125 238 22
-92 30 242 205 282 200 50 36 195 163 127 153 45 49 87 121 109 75 278 125 147 209
-166 91 51 56 188 53 8 180 148 158 240 45 103 31 208 55 185 135 266 182 63 281
-97 132 194 197 78 250 110 132 140 253 290 105 275 298 118 37 90 193 94 60 209
-112 47 263 110 78 196 166 145 294 43 134 263 264 22 283 12 255 151 284 169 117
-279 128 65 250 164 76 227 99 101 261 141 11 252 233 143 171 32 103 85 152 42 31
-245 123 24 198 135 212 238 76 36 286 275 53 62 124 235 4 51 2 244 66 162 70 291
-17 105 91 88 224 27 116 276 210 24 252 79 199 84 186 292 128 11 7 177 230 17
-242 259 226 187 295 146 52 5 262 107 160 155 168 60 18 221 55 131 191 179 37
-252 25 255 97 41 82 271 169 271 223 215 11 61 121 18 262 53 216 68 23 249 161
-158 86 101 16 85 98 98 44 100 13 167 57 100 258 223 269 254 148 266 128 119 194
-251 22 38 56 43 97 95 26 59 15 82 80 57 46 15 136 24 44 191 125 93 265 179 145
-140 99 47 18 54 165 42 276 2 136 178 88 278 71 203 122 21 180 94 214 153 199
-292 74 67 219 231 120 160 1 224 272 172 189 264 213 96 237 164 230 171 186 153 ^
-638 1 72 92 152 285 87 254 275 211 241 293 77 284 55 229 201 35 140 135 179 2
-18 63 284 298 62 93 300 42 283 201 64 73 189 244 4 292 52 253 120 46 113 146
-181 247 74 279 41 186 203 251 263 90 266 95 186 138 184 223 61 61 68 175 107 6
-207 81 114 207 139 74 14 175 172 73 153 110 112 27 150 11 98 285 152 20 221 146
-239 113 88 14 139 38 181 189 208 265 5 88 50 273 24 51 91 55 287 67 49 176 233
-31 281 257 8 64 37 55 258 134 89 111 231 58 292 288 186 174 17 209 25 170 216
-197 169 61 32 41 215 136 4 234 92 145 84 155 54 168 243 208 200 239 48 21 68
-204 40 60 178 177 87 196 108 197 205 195 18 5 23 284 26 296 147 64 44 256 190
-33 196 79 264 151 130 223 126 34 14 204 105 127 218 112 292 16 119 228 82 4 299
-159 185 19 153 81 179 274 85 9 219 296 183 104 30 126 92 181 218 141 225 70 90
-230 262 294 268 75 75 39 300 13 49 147 300 278 216 255 35 75 68 233 67 114 243
-273 267 185 77 19 95 215 71 238 288 157 241 57 144 23 291 227 228 46 171 12 289
-283 172 131 19 124 148 125 2 83 36 230 26 60 214 10 73 160 10 44 227 257 280
-131 77 291 162 161 100 142 14 168 272 141 254 3 144 295 57 173 257 44 198 23 19
-160 282 111 173 192 278 252 88 21 39 271 80 89 176 298 98 227 286 213 185 48 86
-135 150 69 58 299 188 118 73 124 177 58 263 54 132 109 15 29 36 201 93 6 149
-215 100 171 41 222 36 237 133 293 113 117 248 193 9 183 162 197 234 128 279 70
-119 163 15 265 270 255 64 8 122 204 69 294 232 242 89 169 97 166 27 85 38 152
-256 154 200 210 115 61 3 108 161 71 209 54 103 176 262 265 34 21 10 37 26 24 80
-24 109 258 69 22 165 202 154 171 277 155 297 1 229 172 102 86 70 83 29 29 67
-107 42 40 67 78 109 287 2 76 230 298 33 160 246 278 281 21 75 104 66 260 78 145
-120 289 247 38 145 55 222 103 241 28 211 270 226 131 48 57 202 190 4 263 25 199
-149 251 234 157 212 30 184 259 195 254 239 77 48 28 269 136 33 167 146 210 180
-128 43 137 65 192 220 85 281 286 242 118 102 57 137 123 58 27 121 78 138 220 56
-47 232 177 22 129 68 168 74 7 275 240 174 46 142 79 235 218 170 158 30 155 25
-235 283 237 198 59 59 52 246 13 20 214 39 6 214 282 46 106 246 249 47 268 10 8
-93 271 15 22 136 269 100 200 275 182 7 32 106 282 82 240 232 213 156 115 32 70
-148 96 69 29 65 134 53 71 245 188 89 140 164 112 56 83 65 163 287 31 9 190 62
-129 133 235 247 103 212 95 251 205 224 252 59 88 79 206 285 116 187 28 276 263 ^
-640 0 264 66 253 176 211 219 181 69 5 51 216 77 58 241 243 32 223 11 224 215
-225 102 113 3 136 93 123 273 56 74 165 230 86 224 39 157 268 289 197 295 83 105
-217 14 293 203 5 127 103 193 37 116 122 260 236 7 268 37 242 145 33 110 201 125
-238 13 89 293 27 239 202 279 194 50 27 189 157 127 153 45 43 78 121 106 69 272
-119 141 203 166 82 42 50 188 53 5 177 148 152 234 42 100 22 205 46 182 132 263
-179 63 275 97 129 194 191 72 250 107 132 137 247 290 99 296 272 295 118 37 81
-190 94 60 206 109 47 260 110 75 193 163 139 288 43 128 257 258 19 277 12 252
-148 278 166 117 276 125 62 247 164 76 221 96 101 261 138 8 246 227 143 168 32
-97 79 149 39 31 245 123 21 192 135 206 235 70 33 286 269 50 62 121 232 1 45 295
-244 60 156 64 288 8 105 91 82 218 27 113 270 204 18 249 79 199 84 183 286 128 5
-1 171 227 17 236 259 223 187 292 140 49 301 256 104 154 149 165 54 18 299 215
-49 125 188 179 28 252 22 255 91 32 82 268 163 265 220 209 2 58 115 9 259 47 210
-65 14 243 158 155 86 98 16 82 92 95 38 94 10 161 48 97 255 217 266 248 142 266
-122 119 191 248 16 32 47 34 88 89 26 50 12 76 80 51 40 9 133 24 44 191 122 84
-259 173 142 140 99 44 15 54 159 42 276 301 130 172 79 275 62 197 119 15 180 91
-208 150 193 289 71 61 219 231 114 157 1 221 272 169 186 264 207 87 237 161 224
-165 180 41 72 89 152 284 87 252 274 210 241 293 77 284 52 229 199 34 138 134
-178 17 60 282 298 61 93 299 39 283 200 62 71 187 242 4 290 49 251 120 43 113
-144 181 245 73 278 40 185 201 251 261 88 265 94 186 138 184 223 61 58 65 175
-107 6 205 81 114 207 137 71 11 174 170 73 152 108 110 25 148 11 98 283 150 17
-221 146 237 111 88 13 139 36 179 189 207 263 3 86 48 273 21 51 90 54 285 65 49
-175 233 29 280 257 6 64 36 53 257 132 87 111 229 58 291 288 184 173 16 208 24
-170 214 197 169 60 30 41 213 134 2 234 92 145 83 155 51 166 243 208 200 238 48
-21 66 203 40 59 178 176 85 196 106 195 204 194 15 4 23 283 24 296 146 61 43 254
-189 31 195 78 262 151 130 222 124 34 12 202 103 126 216 112 292 14 117 226 80 1
-297 159 183 19 151 80 177 274 84 7 218 294 181 104 28 126 90 180 217 140 225 67
-90 230 262 292 266 72 74 39 298 11 48 147 300 278 216 253 35 75 67 231 64 112
-242 271 267 185 75 17 95 214 71 237 287 156 240 54 144 20 290 225 228 45 169 10
-287 282 172 129 18 123 147 124 301 80 36 229 23 57 213 8 70 159 7 42 226 256
-280 131 213 ^
-640 0 291 162 161 94 142 14 165 269 141 251 298 141 292 51 170 251 35 198 17 10
-154 279 105 173 192 272 249 79 18 36 268 74 80 170 292 92 227 280 213 182 45 80
-129 150 63 49 296 185 112 70 124 171 55 263 51 129 109 6 20 33 201 84 149 215
-97 168 32 216 27 234 133 287 110 114 248 190 9 183 156 194 228 125 279 64 116
-163 9 265 270 252 61 8 116 204 66 294 229 236 89 163 91 160 24 85 29 149 256
-154 197 210 115 55 108 158 68 209 48 103 176 259 262 25 15 10 31 23 18 77 21
-103 258 69 16 162 202 151 171 277 149 297 296 226 169 99 83 70 83 29 26 67 101
-39 31 64 75 106 284 2 67 224 295 33 160 246 275 275 12 69 98 57 260 69 139 114
-289 247 38 142 55 222 298 100 235 22 211 267 226 128 42 54 196 184 1 260 25 196
-143 248 231 151 212 30 178 256 195 254 239 74 39 28 263 133 24 167 143 207 174
-122 34 131 65 186 220 79 281 283 239 115 96 57 137 117 52 18 118 78 132 217 53
-44 232 177 22 129 68 168 295 74 302 275 234 174 40 139 73 232 218 164 158 27
-152 19 229 277 231 192 50 59 52 240 4 20 214 30 301 208 282 46 106 243 249 38
-265 7 5 90 271 15 13 136 269 100 194 269 182 4 23 100 276 79 240 226 210 156
-112 29 67 142 96 60 23 59 134 50 62 242 182 86 137 158 109 47 77 62 160 287 28
-190 53 126 127 235 244 97 209 89 245 205 218 246 53 85 70 206 285 113 181 19
-270 30 260 66 253 172 207 215 179 63 5 49 214 71 54 237 241 30 219 9 224 213
-223 102 109 3 134 91 119 271 56 70 165 228 84 222 35 157 264 285 195 295 77 103
-217 12 291 203 303 123 101 302 193 35 116 122 256 236 7 268 33 242 141 29 108
-199 125 238 7 87 289 25 237 200 277 190 50 21 185 153 127 153 45 39 72 121 104
-65 268 115 137 199 166 76 36 46 188 53 3 175 148 148 230 40 98 16 203 40 180
-130 261 177 63 271 97 127 194 187 68 250 105 132 135 243 290 95 294 270 293 118
-37 75 188 94 60 204 107 47 258 110 73 191 161 135 284 43 124 253 254 17 273 12
-250 146 274 164 117 274 123 60 245 164 76 217 94 101 261 136 6 242 223 143 166
-32 93 75 147 37 31 245 123 19 188 135 202 233 66 31 286 265 48 62 119 230 303
-41 291 244 56 152 60 286 2 105 91 78 214 27 111 266 200 14 247 79 199 84 181
-282 128 1 301 167 225 17 232 259 221 187 290 136 47 299 252 102 150 145 163 50
-18 299 211 45 121 186 179 22 252 20 255 87 26 82 266 159 261 218 205 300 56 111
-3 257 43 206 63 8 239 156 153 86 96 16 80 88 93 34 90 8 157 42 95 253 213 264
-244 138 266 118 119 189 246 79 ^
-650 0 24 35 22 76 81 26 38 8 68 80 43 32 1 129 24 44 191 118 72 251 165 138 140
-99 40 11 54 151 42 276 301 122 164 67 271 50 189 115 7 180 87 200 146 185 285
-67 53 219 231 106 153 1 217 272 165 182 264 199 75 237 157 216 157 172 33 72 77
-152 280 87 244 270 206 241 293 77 284 40 229 191 30 130 130 174 298 13 48 274
-298 57 93 295 27 283 196 54 63 179 234 4 282 37 243 120 31 113 136 181 237 69
-274 36 181 193 251 253 80 261 90 186 138 184 223 61 46 53 175 107 6 197 81 114
-207 129 59 305 170 162 73 148 100 102 17 140 11 98 275 142 5 221 146 229 103 88
-9 139 28 171 189 203 255 301 78 40 273 9 51 86 50 277 57 49 171 233 21 276 257
-304 64 32 45 253 124 79 111 221 58 287 288 176 169 12 204 20 170 206 197 169 56
-22 41 205 126 300 234 92 145 79 155 39 158 243 208 200 234 48 21 58 199 40 55
-178 172 77 196 98 187 200 190 3 23 279 16 296 142 49 39 246 185 23 191 74 254
-151 130 218 116 34 4 194 95 122 208 112 292 6 109 218 72 295 289 159 175 19 143
-76 169 274 80 305 214 286 173 104 20 126 82 176 213 136 225 55 90 230 262 284
-258 60 70 39 290 3 44 147 300 278 216 245 35 75 63 223 52 104 238 263 267 185
-67 9 95 210 71 233 283 152 236 42 144 8 286 217 228 41 161 2 279 278 172 121 14
-119 143 120 293 68 36 225 11 45 209 58 155 301 34 222 252 280 131 62 291 162
-161 90 142 14 163 267 141 249 294 139 290 47 168 247 29 198 13 4 150 277 101
-173 192 268 247 73 16 34 266 70 74 166 288 88 227 276 213 180 43 76 125 150 59
-43 294 183 108 68 124 167 53 263 49 127 109 14 31 201 78 302 149 215 95 166 26
-212 21 232 133 283 108 112 248 188 9 183 152 192 224 123 279 60 114 163 5 265
-270 250 59 8 112 204 64 294 227 232 89 159 87 156 22 85 23 147 256 154 195 210
-115 51 304 108 156 66 209 44 103 176 257 260 19 11 10 27 21 14 75 19 99 258 69
-12 160 202 149 171 277 145 297 292 224 167 97 81 70 83 29 24 67 97 37 25 62 73
-104 282 2 61 220 293 33 160 246 273 271 6 65 94 51 260 63 135 110 289 247 38
-140 55 222 296 98 231 18 211 265 226 126 38 52 192 180 305 258 25 194 139 246
-229 147 212 30 174 254 195 254 239 72 33 28 259 131 18 167 141 205 170 118 28
-127 65 182 220 75 281 281 237 113 92 57 137 113 48 12 116 78 128 215 51 42 232
-177 22 129 68 168 291 74 298 275 230 174 36 137 69 230 218 160 158 25 150 15
-225 273 227 188 44 59 52 236 304 20 214 24 297 204 282 46 106 241 249 32 263 5
-3 88 271 15 7 136 269 100 190 265 182 2 17 96 283 ^
-649 0 76 240 220 207 156 109 26 64 136 96 51 17 53 134 47 53 239 176 83 134 152
-106 38 71 59 157 287 25 298 190 44 123 121 235 241 91 206 83 239 205 212 240 47
-82 61 206 285 110 175 10 264 24 254 66 253 166 201 209 176 54 5 46 211 62 48
-231 238 27 213 6 224 210 220 102 103 3 131 88 113 268 56 64 165 225 81 219 29
-157 258 279 192 295 68 100 217 9 288 203 297 117 98 302 193 32 116 122 250 236
-7 268 27 242 135 23 105 196 125 238 305 84 283 22 234 197 274 184 50 12 179 147
-127 153 45 33 63 121 101 59 262 109 131 193 166 67 27 40 188 53 172 148 142 224
-37 95 7 200 31 177 127 258 174 63 265 97 124 194 181 62 250 102 132 132 237 290
-89 291 267 290 118 37 66 185 94 60 201 104 47 255 110 70 188 158 129 278 43 118
-247 248 14 267 12 247 143 268 161 117 271 120 57 242 164 76 211 91 101 261 133
-3 236 217 143 163 32 87 69 144 34 31 245 123 16 182 135 196 230 60 28 286 259
-45 62 116 227 303 35 285 244 50 146 54 283 300 105 91 72 208 27 108 260 194 8
-244 79 199 84 178 276 128 302 298 161 222 17 226 259 218 187 287 130 44 296 246
-99 144 139 160 44 18 299 205 39 115 183 179 13 252 17 255 81 17 82 263 153 255
-215 199 294 53 105 301 254 37 200 60 306 233 153 150 86 93 16 77 82 90 28 84 5
-151 33 92 250 207 261 238 132 266 112 119 186 243 6 22 32 19 73 79 26 35 7 66
-80 41 30 306 128 24 44 191 117 69 249 163 137 140 99 39 10 54 149 42 276 301
-120 162 64 270 47 187 114 5 180 86 198 145 183 284 66 51 219 231 104 152 1 216
-272 164 181 264 197 72 237 156 214 155 170 31 72 74 152 279 87 242 269 205 241
-293 77 284 37 229 189 29 128 129 173 297 12 45 272 298 56 93 294 24 283 195 52
-61 177 232 4 280 34 241 120 28 113 134 181 235 68 273 35 180 191 251 251 78 260
-89 186 138 184 223 61 43 50 175 107 6 195 81 114 207 127 56 303 169 160 73 147
-98 100 15 138 11 98 273 140 2 221 146 227 101 88 8 139 26 169 189 202 253 300
-76 38 273 6 51 85 49 275 55 49 170 233 19 275 257 303 64 31 43 252 122 77 111
-219 58 286 288 174 168 11 203 19 170 204 197 169 55 20 41 203 124 299 234 92
-145 78 155 36 156 243 208 200 233 48 21 56 198 40 54 178 171 75 196 96 185 199
-189 306 23 278 14 296 141 46 38 244 184 21 190 73 252 151 130 217 114 34 2 192
-93 121 206 112 292 4 107 216 70 293 287 159 173 19 141 75 167 274 79 304 213
-284 171 104 18 126 80 175 212 135 225 52 90 230 262 282 256 57 69 39 288 1 43
-147 300 278 216 243 35 75 62 221 49 102 237 261 267 140 ^
-649 1 61 3 95 207 71 230 280 149 233 33 144 308 283 211 228 38 155 305 273 275
-172 115 11 116 140 117 287 59 36 222 2 36 206 303 49 152 295 28 219 249 280 131
-53 291 162 161 84 142 14 160 264 141 246 288 136 287 41 165 241 20 198 7 304
-144 274 95 173 192 262 244 64 13 31 263 64 65 160 282 82 227 270 213 177 40 70
-119 150 53 34 291 180 102 65 124 161 50 263 46 124 109 300 5 28 201 69 299 149
-215 92 163 17 206 12 229 133 277 105 109 248 185 9 183 146 189 218 120 279 54
-111 163 308 265 270 247 56 8 106 204 61 294 224 226 89 153 81 150 19 85 14 144
-256 154 192 210 115 45 304 108 153 63 209 38 103 176 254 257 10 5 10 21 18 8 72
-16 93 258 69 6 157 202 146 171 277 139 297 286 221 164 94 78 70 83 29 21 67 91
-34 16 59 70 101 279 2 52 214 290 33 160 246 270 265 306 59 88 42 260 54 129 104
-289 247 38 137 55 222 293 95 225 12 211 262 226 123 32 49 186 174 305 255 25
-191 133 243 226 141 212 30 168 251 195 254 239 69 24 28 253 128 9 167 138 202
-164 112 19 121 65 176 220 69 281 278 234 110 86 57 137 107 42 3 113 78 122 212
-48 39 232 177 22 129 68 168 285 74 292 275 224 174 30 134 63 227 218 154 158 22
-147 9 219 267 221 182 35 59 52 230 298 20 214 15 291 198 282 46 106 238 249 23
-260 2 85 271 15 307 136 269 100 184 259 182 308 8 90 266 74 240 216 205 156 107
-24 62 132 96 45 13 49 134 45 47 237 172 81 132 148 104 32 67 57 155 287 23 294
-190 38 121 117 235 239 87 204 79 235 205 208 236 43 80 55 206 285 108 171 4 260
-20 250 66 253 162 197 205 174 48 5 44 209 56 44 227 236 25 209 4 224 208 218
-102 99 3 129 86 109 266 56 60 165 223 79 217 25 157 254 275 190 295 62 98 217 7
-286 203 293 113 96 302 193 30 116 122 246 236 7 268 23 242 131 19 103 194 125
-238 301 82 279 20 232 195 272 180 50 6 175 143 127 153 45 29 57 121 99 55 258
-105 127 189 166 61 21 36 188 53 307 170 148 138 220 35 93 1 198 25 175 125 256
-172 63 261 97 122 194 177 58 250 100 132 130 233 290 85 289 265 288 118 37 60
-183 94 60 199 102 47 253 110 68 186 156 125 274 43 114 243 244 12 263 12 245
-141 264 159 117 269 118 55 240 164 76 207 89 101 261 131 1 232 213 143 161 32
-83 65 142 32 31 245 123 14 178 135 192 228 56 26 286 255 43 62 114 225 303 31
-281 244 46 142 50 281 296 105 91 68 204 27 106 256 190 4 242 79 199 84 176 272
-128 300 296 157 220 17 222 259 216 187 285 126 42 294 242 97 140 135 158 40 18
-299 201 35 111 181 179 7 252 15 255 77 11 82 261 149 251 69 ^
-655 0 191 286 49 97 293 250 29 192 56 298 225 149 146 86 89 16 73 74 86 20 76 1
-143 21 88 246 199 257 230 124 266 104 119 182 239 309 14 20 7 61 71 26 23 3 58
-80 33 22 302 124 24 44 191 113 57 241 155 133 140 99 35 6 54 141 42 276 301 112
-154 52 266 35 179 110 308 180 82 190 141 175 280 62 43 219 231 96 148 1 212 272
-160 177 264 189 60 237 152 206 147 162 23 72 62 152 275 87 234 265 201 241 293
-77 284 25 229 181 25 120 125 169 293 8 33 264 298 52 93 290 12 283 191 44 53
-169 224 4 272 22 233 120 16 113 126 181 227 64 269 31 176 183 251 243 70 256 85
-186 138 184 223 61 31 38 175 107 6 187 81 114 207 119 44 295 165 152 73 143 90
-92 7 130 11 98 265 132 301 221 146 219 93 88 4 139 18 161 189 198 245 296 68 30
-273 305 51 81 45 267 47 49 166 233 11 271 257 299 64 27 35 248 114 69 111 211
-58 282 288 166 164 7 199 15 170 196 197 169 51 12 41 195 116 295 234 92 145 74
-155 24 148 243 208 200 229 48 21 48 194 40 50 178 167 67 196 88 177 195 185 299
-306 23 274 6 296 137 34 34 236 180 13 186 69 244 151 130 213 106 34 305 184 85
-117 198 112 292 307 99 208 62 285 279 159 165 19 133 71 159 274 75 300 209 276
-163 104 10 126 72 171 208 131 225 40 90 230 262 274 248 45 65 39 280 304 39 147
-300 278 216 235 35 75 58 213 37 94 233 253 267 185 57 310 95 205 71 228 278 147
-231 27 144 304 281 207 228 36 151 303 269 273 172 111 9 114 138 115 283 53 36
-220 307 30 204 301 43 150 291 24 217 247 280 131 47 291 162 161 80 142 14 158
-262 141 244 284 134 285 37 163 237 14 198 3 300 140 272 91 173 192 258 242 58
-11 29 261 60 59 156 278 78 227 266 213 175 38 66 115 150 49 28 289 178 98 63
-124 157 48 263 44 122 109 296 310 26 201 63 297 149 215 90 161 11 202 6 227 133
-273 103 107 248 183 9 183 142 187 214 118 279 50 109 163 306 265 270 245 54 8
-102 204 59 294 222 222 89 149 77 146 17 85 8 142 256 154 190 210 115 41 304 108
-151 61 209 34 103 176 252 255 4 1 10 17 16 4 70 14 89 258 69 2 155 202 144 171
-277 135 297 282 219 162 92 76 70 83 29 19 67 87 32 10 57 68 99 277 2 46 210 288
-33 160 246 268 261 302 55 84 36 260 48 125 100 289 247 38 135 55 222 291 93 221
-8 211 260 226 121 28 47 182 170 305 253 25 189 129 241 224 137 212 30 164 249
-195 254 239 67 18 28 249 126 3 167 136 200 160 108 13 117 65 172 220 65 281 276
-232 108 82 57 137 103 38 308 111 78 118 210 46 37 232 177 22 129 68 168 281 74
-288 275 220 174 26 132 59 225 218 150 158 20 145 5 215 263 100 ^
-661 1 176 26 59 52 224 292 20 214 6 285 192 282 46 106 235 249 14 257 311 309
-82 271 15 301 136 269 100 178 253 182 308 311 84 260 71 240 210 202 156 104 21
-59 126 96 36 7 43 134 42 38 234 166 78 129 142 101 23 61 54 152 287 20 288 190
-29 118 111 235 236 81 201 73 229 205 202 230 37 77 46 206 285 105 165 307 254
-14 244 66 253 156 191 199 171 39 5 41 206 47 38 221 233 22 203 1 224 205 215
-102 93 3 126 83 103 263 56 54 165 220 76 214 19 157 248 269 187 295 53 95 217 4
-283 203 287 107 93 302 193 27 116 122 240 236 7 268 17 242 125 13 100 191 125
-238 295 79 273 17 229 192 269 174 50 309 169 137 127 153 45 23 48 121 96 49 252
-99 121 183 166 52 12 30 188 53 307 167 148 132 214 32 90 304 195 16 172 122 253
-169 63 255 97 119 194 171 52 250 97 132 127 227 290 79 286 262 285 118 37 51
-180 94 60 196 99 47 250 110 65 183 153 119 268 43 108 237 238 9 257 12 242 138
-258 156 117 266 115 52 237 164 76 201 86 101 261 128 310 226 207 143 158 32 77
-59 139 29 31 245 123 11 172 135 186 225 50 23 286 249 40 62 111 222 303 25 275
-244 40 136 44 278 290 105 91 62 198 27 103 250 184 310 239 79 199 84 173 266
-128 297 293 151 217 17 216 259 213 187 282 120 39 291 236 94 134 129 155 34 18
-299 195 29 105 178 179 310 252 12 255 71 2 82 258 143 245 210 189 284 48 95 291
-249 27 190 55 296 223 148 145 86 88 16 72 72 85 18 74 141 18 87 245 197 256 228
-122 266 102 119 181 238 308 12 17 4 58 69 26 20 2 56 80 31 20 301 123 24 44 191
-112 54 239 153 132 140 99 34 5 54 139 42 276 301 110 152 49 265 32 177 109 307
-180 81 188 140 173 279 61 41 219 231 94 147 1 211 272 159 176 264 187 57 237
-151 204 145 160 21 72 59 152 274 87 232 264 200 241 293 77 284 22 229 179 24
-118 124 168 292 7 30 262 298 51 93 289 9 283 190 42 51 167 222 4 270 19 231 120
-13 113 124 181 225 63 268 30 175 181 251 241 68 255 84 186 138 184 223 61 28 35
-175 107 6 185 81 114 207 117 41 293 164 150 73 142 88 90 5 128 11 98 263 130
-299 221 146 217 91 88 3 139 16 159 189 197 243 295 66 28 273 303 51 80 44 265
-45 49 165 233 9 270 257 298 64 26 33 247 112 67 111 209 58 281 288 164 163 6
-198 14 170 194 197 169 50 10 41 193 114 294 234 92 145 73 155 21 146 243 208
-200 228 48 21 46 193 40 49 178 166 65 196 86 175 194 184 297 306 23 273 4 296
-136 31 33 234 179 11 185 68 242 151 130 212 104 34 304 182 83 116 196 112 292
-306 97 206 60 283 277 159 163 19 131 70 157 274 74 299 208 274 161 104 8 126 70
-170 207 130 225 37 90 230 194 ^
-643 0 268 242 36 62 39 274 301 36 147 300 278 216 229 35 75 55 207 28 88 230
-247 267 185 51 307 95 202 71 225 275 144 228 18 144 298 278 201 228 33 145 300
-263 270 172 105 6 111 135 112 277 44 36 217 301 21 201 298 34 147 285 18 214
-244 280 131 38 291 162 161 74 142 14 155 259 141 241 278 131 282 31 160 231 5
-198 311 294 134 269 85 173 192 252 239 49 8 26 258 54 50 150 272 72 227 260 213
-172 35 60 109 150 43 19 286 175 92 60 124 151 45 263 41 119 109 290 304 23 201
-54 294 149 215 87 158 2 196 311 224 133 267 100 104 248 180 9 183 136 184 208
-115 279 44 106 163 303 265 270 242 51 8 96 204 56 294 219 216 89 143 71 140 14
-85 313 139 256 154 187 210 115 35 304 108 148 58 209 28 103 176 249 252 309 309
-10 11 13 312 67 11 83 258 69 310 152 202 141 171 277 129 297 276 216 159 89 73
-70 83 29 16 67 81 29 1 54 65 96 274 2 37 204 285 33 160 246 265 255 296 49 78
-27 260 39 119 94 289 247 38 132 55 222 288 90 215 2 211 257 226 118 22 44 176
-164 305 250 25 186 123 238 221 131 212 30 158 246 195 254 239 64 9 28 243 123
-308 167 133 197 154 102 4 111 65 166 220 59 281 273 229 105 76 57 137 97 32 302
-108 78 112 207 43 34 232 177 22 129 68 168 275 74 282 275 214 174 20 129 53 222
-218 144 158 17 142 313 209 257 211 172 20 59 52 220 288 20 214 281 188 282 46
-106 233 249 8 255 311 309 80 271 15 297 136 269 100 174 249 182 308 307 80 256
-69 240 206 200 156 102 19 57 122 96 30 3 39 134 40 32 232 162 76 127 138 99 17
-57 52 150 287 18 284 190 23 116 107 235 234 77 199 69 225 205 198 226 33 75 40
-206 285 103 161 303 250 10 240 66 253 152 187 195 169 33 5 39 204 41 34 217 231
-20 199 313 224 203 213 102 89 3 124 81 99 261 56 50 165 218 74 212 15 157 244
-265 185 295 47 93 217 2 281 203 283 103 91 302 193 25 116 122 236 236 7 268 13
-242 121 9 98 189 125 238 291 77 269 15 227 190 267 170 50 305 165 133 127 153
-45 19 42 121 94 45 248 95 117 179 166 46 6 26 188 53 307 165 148 128 210 30 88
-300 193 10 170 120 251 167 63 251 97 117 194 167 48 250 95 132 125 223 290 75
-284 260 283 118 37 45 178 94 60 194 97 47 248 110 63 181 151 115 264 43 104 233
-234 7 253 12 240 136 254 154 117 264 113 50 235 164 76 197 84 101 261 126 310
-222 203 143 156 32 73 55 137 27 31 245 123 9 168 135 182 223 46 21 286 245 38
-62 109 220 303 21 271 244 36 132 40 276 286 105 91 58 194 27 101 246 180 308
-237 79 199 84 171 262 128 295 291 147 215 17 212 259 219 ^
-652 1 187 278 112 35 287 228 90 126 121 151 26 18 299 187 21 97 174 179 302 252
-8 255 63 306 82 254 135 237 206 181 276 44 87 283 245 19 182 51 288 215 144 141
-86 84 16 68 64 81 10 66 312 133 6 83 241 189 252 220 114 266 94 119 177 234 304
-4 5 308 46 61 26 8 314 48 80 23 12 297 119 24 44 191 108 42 231 145 128 140 99
-30 1 54 131 42 276 301 102 144 37 261 20 169 105 303 180 77 180 136 165 275 57
-33 219 231 86 143 1 207 272 155 172 264 179 45 237 147 196 137 152 13 72 47 152
-270 87 224 260 196 241 293 77 284 10 229 171 20 110 120 164 288 3 18 254 298 47
-93 285 313 283 186 34 43 159 214 4 262 7 223 120 1 113 116 181 217 59 264 26
-171 173 251 233 60 251 80 186 138 184 223 61 16 23 175 107 6 177 81 114 207 109
-29 285 160 142 73 138 80 82 313 120 11 98 255 122 291 221 146 209 83 88 315 139
-8 151 189 193 235 291 58 20 273 295 51 76 40 257 37 49 161 233 1 266 257 294 64
-22 25 243 104 59 111 201 58 277 288 156 159 2 194 10 170 186 197 169 46 2 41
-185 106 290 234 92 145 69 155 9 138 243 208 200 224 48 21 38 189 40 45 178 162
-57 196 78 167 190 180 289 306 23 269 312 296 132 19 29 226 175 3 181 64 234 151
-130 208 96 34 300 174 75 112 188 112 292 302 89 198 52 275 269 159 155 19 123
-66 149 274 70 295 204 266 153 104 126 62 166 203 126 225 25 90 230 262 264 238
-30 60 39 270 299 34 147 300 278 216 225 35 75 53 203 22 84 228 243 267 185 47
-305 95 200 71 223 273 142 226 12 144 294 276 197 228 31 141 298 259 268 172 101
-4 109 133 110 273 38 36 215 297 15 199 296 28 145 281 14 212 242 280 131 32 291
-162 161 70 142 14 153 257 141 239 274 129 280 27 158 227 315 198 309 290 130
-267 81 173 192 248 237 43 6 24 256 50 44 146 268 68 227 256 213 170 33 56 105
-150 39 13 284 173 88 58 124 147 43 263 39 117 109 286 300 21 201 48 292 149 215
-85 156 312 192 307 222 133 263 98 102 248 178 9 183 132 182 204 113 279 40 104
-163 301 265 270 240 49 8 92 204 54 294 217 212 89 139 67 136 12 85 309 137 256
-154 185 210 115 31 304 108 146 56 209 24 103 176 247 250 305 307 10 7 11 310 65
-9 79 258 69 308 150 202 139 171 277 125 297 272 214 157 87 71 70 83 29 14 67 77
-27 311 52 63 94 272 2 31 200 283 33 160 246 263 251 292 45 74 21 260 33 115 90
-289 247 38 130 55 222 286 88 211 314 211 255 226 116 18 42 172 160 305 248 25
-184 119 236 219 127 212 30 154 244 195 254 239 62 3 28 239 121 304 167 131 195
-150 98 314 107 65 162 220 55 281 271 227 103 72 57 137 93 28 308 ^
-670 0 105 78 106 204 40 31 232 177 22 129 68 168 269 74 276 275 208 174 14 126
-47 219 218 138 158 14 139 310 203 251 205 166 11 59 52 214 282 20 214 308 275
-182 282 46 106 230 249 316 252 311 309 77 271 15 291 136 269 100 168 243 182
-308 301 74 250 66 240 200 197 156 99 16 54 116 96 21 314 33 134 37 23 229 156
-73 124 132 96 8 51 49 147 287 15 278 190 14 113 101 235 231 71 196 63 219 205
-192 220 27 72 31 206 285 100 155 297 244 4 234 66 253 146 181 189 166 24 5 36
-201 32 28 211 228 17 193 313 224 200 210 102 83 3 121 78 93 258 56 44 165 215
-71 209 9 157 238 259 182 295 38 90 217 316 278 203 277 97 88 302 193 22 116 122
-230 236 7 268 7 242 115 3 95 186 125 238 285 74 263 12 224 187 264 164 50 299
-159 127 127 153 45 13 33 121 91 39 242 89 111 173 166 37 314 20 188 53 307 162
-148 122 204 27 85 294 190 1 167 117 248 164 63 245 97 114 194 161 42 250 92 132
-122 217 290 69 281 257 280 118 37 36 175 94 60 191 94 47 245 110 60 178 148 109
-258 43 98 227 228 4 247 12 237 133 248 151 117 261 110 47 232 164 76 191 81 101
-261 123 310 216 197 143 153 32 67 49 134 24 31 245 123 6 162 135 176 220 40 18
-286 239 35 62 106 217 303 15 265 244 30 126 34 273 280 105 91 52 188 27 98 240
-174 305 234 79 199 84 168 256 128 292 288 141 212 17 206 259 208 187 277 110 34
-286 226 89 124 119 150 24 18 299 185 19 95 173 179 300 252 7 255 61 304 82 253
-133 235 205 179 274 43 85 281 244 17 180 50 286 213 143 140 86 83 16 67 62 80 8
-64 312 131 3 82 240 187 251 218 112 266 92 119 176 233 303 2 2 306 43 59 26 5
-314 46 80 21 10 296 118 24 44 191 107 39 229 143 127 140 99 29 54 129 42 276
-301 100 142 34 260 17 167 104 302 180 76 178 135 163 274 56 31 219 231 84 142 1
-206 272 154 171 264 177 42 237 146 194 135 150 11 72 44 152 269 87 222 259 195
-241 293 77 284 7 229 169 19 108 119 163 287 2 15 252 298 46 93 284 311 283 185
-32 41 157 212 4 260 4 221 120 315 113 114 181 215 58 263 25 170 171 251 231 58
-250 79 186 138 184 223 61 13 20 175 107 6 175 81 114 207 107 26 283 159 140 73
-137 78 80 312 118 11 98 253 120 289 221 146 207 81 88 315 139 6 149 189 192 233
-290 56 18 273 293 51 75 39 255 35 49 160 233 316 265 257 293 64 21 23 242 102
-57 111 199 58 276 288 154 158 1 193 9 170 184 197 169 45 41 183 104 289 234 92
-145 68 155 6 136 243 208 200 223 48 21 36 188 40 44 178 161 55 196 76 165 189
-179 287 306 23 268 311 296 131 16 28 224 174 1 180 63 232 151 130 207 94 34 299
-172 73 111 186 112 292 301 87 196 50 273 267 159 153 235 ^
-658 1 117 63 143 274 67 292 201 260 147 104 313 126 56 163 200 123 225 16 90
-230 262 258 232 21 57 39 264 296 31 147 300 278 216 219 35 75 50 197 13 78 225
-237 267 185 41 302 95 197 71 220 270 139 223 3 144 288 273 191 228 28 135 295
-253 265 172 95 1 106 130 107 267 29 36 212 291 6 196 293 19 142 275 8 209 239
-280 131 23 291 162 161 64 142 14 150 254 141 236 268 126 277 21 155 221 309 198
-306 284 124 264 75 173 192 242 234 34 3 21 253 44 35 140 262 62 227 250 213 167
-30 50 99 150 33 4 281 170 82 55 124 141 40 263 36 114 109 280 294 18 201 39 289
-149 215 82 153 306 186 301 219 133 257 95 99 248 175 9 183 126 179 198 110 279
-34 101 163 298 265 270 237 46 8 86 204 51 294 214 206 89 133 61 130 9 85 303
-134 256 154 182 210 115 25 304 108 143 53 209 18 103 176 244 247 299 304 10 1 8
-307 62 6 73 258 69 305 147 202 136 171 277 119 297 266 211 154 84 68 70 83 29
-11 67 71 24 305 49 60 91 269 2 22 194 280 33 160 246 260 245 286 39 68 12 260
-24 109 84 289 247 38 127 55 222 283 85 205 311 211 252 226 113 12 39 166 154
-305 245 25 181 113 233 216 121 212 30 148 241 195 254 239 59 313 28 233 118 298
-167 128 192 144 92 308 101 65 156 220 49 281 268 224 100 66 57 137 87 22 292
-103 78 102 202 38 29 232 177 22 129 68 168 265 74 272 275 204 174 10 124 43 217
-218 134 158 12 137 308 199 247 201 162 5 59 52 210 278 20 214 304 271 178 282
-46 106 228 249 312 250 311 309 75 271 15 287 136 269 100 164 239 182 308 297 70
-246 64 240 196 195 156 97 14 52 112 96 15 312 29 134 35 17 227 152 71 122 128
-94 2 47 47 145 287 13 274 190 8 111 97 235 229 67 194 59 215 205 188 216 23 70
-25 206 285 98 151 293 240 230 66 253 142 177 185 164 18 5 34 199 26 24 207 226
-15 189 313 224 198 208 102 79 3 119 76 89 256 56 40 165 213 69 207 5 157 234
-255 180 295 32 88 217 316 276 203 273 93 86 302 193 20 116 122 226 236 7 268 3
-242 111 318 93 184 125 238 281 72 259 10 222 185 262 160 50 295 155 123 127 153
-45 9 27 121 89 35 238 85 107 169 166 31 310 16 188 53 307 160 148 118 200 25 83
-290 188 314 165 115 246 162 63 241 97 112 194 157 38 250 90 132 120 213 290 65
-279 255 278 118 37 30 173 94 60 189 92 47 243 110 58 176 146 105 254 43 94 223
-224 2 243 12 235 131 244 149 117 259 108 45 230 164 76 187 79 101 261 121 310
-212 193 143 151 32 63 45 132 22 31 245 123 4 158 135 172 218 36 16 286 235 33
-62 104 215 303 11 261 244 26 122 30 271 276 105 91 48 184 27 96 236 170 303 232
-79 199 84 166 252 128 290 283 ^
-649 1 133 208 17 198 259 204 187 273 102 30 282 218 85 116 111 146 16 18 299
-177 11 87 169 179 292 252 3 255 53 296 82 249 125 227 201 171 266 39 77 273 240
-9 172 46 278 205 139 136 86 79 16 63 54 76 56 312 123 312 78 236 179 247 210
-104 266 84 119 172 229 299 315 311 298 31 51 26 314 314 38 80 13 2 292 114 24
-44 191 103 27 221 135 123 140 99 25 317 54 121 42 276 301 92 134 22 256 5 159
-100 298 180 72 170 131 155 270 52 23 219 231 76 138 1 202 272 150 167 264 169
-30 237 142 186 127 142 3 72 32 152 265 87 214 255 191 241 293 77 284 316 229
-161 15 100 115 159 283 319 3 244 298 42 93 280 303 283 181 24 33 149 204 4 252
-313 213 120 307 113 106 181 207 54 259 21 166 163 251 223 50 246 75 186 138 184
-223 61 1 8 175 107 6 167 81 114 207 99 14 275 155 132 73 133 70 72 308 110 11
-98 245 112 281 221 146 199 73 88 315 139 319 141 189 188 225 286 48 10 273 285
-51 71 35 247 27 49 156 233 312 261 257 289 64 17 15 238 94 49 111 191 58 272
-288 146 154 318 189 5 170 176 197 169 41 313 41 175 96 285 234 92 145 64 155
-315 128 243 208 200 219 48 21 28 184 40 40 178 157 47 196 68 157 185 175 279
-306 23 264 307 296 127 4 24 216 170 314 176 59 224 151 130 203 86 34 295 164 65
-107 178 112 292 297 79 188 42 265 259 159 145 19 113 61 139 274 65 290 199 256
-143 104 311 126 52 161 198 121 225 10 90 230 262 254 228 15 55 39 260 294 29
-147 300 278 216 215 35 75 48 193 7 74 223 233 267 185 37 300 95 195 71 218 268
-137 221 318 144 284 271 187 228 26 131 293 249 263 172 91 320 104 128 105 263
-23 36 210 287 194 291 13 140 271 4 207 237 280 131 17 291 162 161 60 142 14 148
-252 141 234 264 124 275 17 153 217 305 198 304 280 120 262 71 173 192 238 232
-28 1 19 251 40 29 136 258 58 227 246 213 165 28 46 95 150 29 319 279 168 78 53
-124 137 38 263 34 112 109 276 290 16 201 33 287 149 215 80 151 302 182 297 217
-133 253 93 97 248 173 9 183 122 177 194 108 279 30 99 163 296 265 270 235 44 8
-82 204 49 294 212 202 89 129 57 126 7 85 299 132 256 154 180 210 115 21 304 108
-141 51 209 14 103 176 242 245 295 302 10 318 6 305 60 4 69 258 69 303 145 202
-134 171 277 115 297 262 209 152 82 66 70 83 29 9 67 67 22 301 47 58 89 267 2 16
-190 278 33 160 246 258 241 282 35 64 6 260 18 105 80 289 247 38 125 55 222 281
-83 201 309 211 250 226 111 8 37 162 150 305 243 25 179 109 231 214 117 212 30
-144 239 195 254 239 57 309 28 229 116 294 167 126 190 140 88 304 97 65 152 220
-45 281 178 ^
-<D
-
-H>SHS Type 3 Strings<H
-D>
-40 1 18 20 11 15 11 11 9 6 2 15 5 17 12 1 9 1 3 5 11 7 2 2 6 18 2 9 11 8 16 11
-16 15 18 18 3 20 2 17 17 16 ^
-<D
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-hashes.sha1 b/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-hashes.sha1
deleted file mode 100644
index 5f33c2bf54..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-hashes.sha1
+++ /dev/null
@@ -1,343 +0,0 @@
-# Configuration information for "SHA-1 Test"
-# SHA tests are configured for BYTE oriented implementations
-H>SHS Type 1 Hashes<H
-D>
-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709 ^
-3CDF2936DA2FC556BFA533AB1EB59CE710AC80E5 ^
-19C1E2048FA7393CFBF2D310AD8209EC11D996E5 ^
-CA775D8C80FAA6F87FA62BECA6CA6089D63B56E5 ^
-71AC973D0E4B50AE9E5043FF4D615381120A25A0 ^
-A6B5B9F854CFB76701C3BDDBF374B3094EA49CBA ^
-D87A0EE74E4B9AD72E6847C87BDEEB3D07844380 ^
-1976B8DD509FE66BF09C9A8D33534D4EF4F63BFD ^
-5A78F439B6DB845BB8A558E4CEB106CD7B7FF783 ^
-F871BCE62436C1E280357416695EE2EF9B83695C ^
-62B243D1B780E1D31CF1BA2DE3F01C72AEEA0E47 ^
-1698994A273404848E56E7FDA4457B5900DE1342 ^
-056F4CDC02791DA7ED1EB2303314F7667518DEEF ^
-9FE2DA967BD8441EEA1C32DF68DDAA9DC1FC8E4B ^
-73A31777B4ACE9384EFA8BBEAD45C51A71ABA6DD ^
-3F9D7C4E2384EDDABFF5DD8A31E23DE3D03F42AC ^
-4814908F72B93FFD011135BEE347DE9A08DA838F ^
-0978374B67A412A3102C5AA0B10E1A6596FC68EB ^
-44AD6CB618BD935460D46D3F921D87B99AB91C1E ^
-02DC989AF265B09CF8485640842128DCF95E9F39 ^
-67507B8D497B35D6E99FC01976D73F54AECA75CF ^
-1EAE0373C1317CB60C36A42A867B716039D441F5 ^
-9C3834589E5BFFAC9F50950E0199B3EC2620BEC8 ^
-209F7ABC7F3B878EE46CDF3A1FBB9C21C3474F32 ^
-05FC054B00D97753A9B3E2DA8FBBA3EE808CEF22 ^
-0C4980EA3A46C757DFBFC5BAA38AC6C8E72DDCE7 ^
-96A460D2972D276928B69864445BEA353BDCFFD2 ^
-F3EF04D8FA8C6FA9850F394A4554C080956FA64B ^
-F2A31D875D1D7B30874D416C4D2EA6BAF0FFBAFE ^
-F4942D3B9E9588DCFDC6312A84DF75D05F111C20 ^
-310207DF35B014E4676D30806FA34424813734DD ^
-4DA1955B2FA7C7E74E3F47D7360CE530BBF57CA3 ^
-74C4BC5B26FB4A08602D40CCEC6C6161B6C11478 ^
-0B103CE297338DFC7395F7715EE47539B556DDB6 ^
-EFC72D99E3D2311CE14190C0B726BDC68F4B0821 ^
-660EDAC0A8F4CE33DA0D8DBAE597650E97687250 ^
-FE0A55A988B3B93946A63EB36B23785A5E6EFC3E ^
-0CBDF2A5781C59F907513147A0DE3CC774B54BF3 ^
-663E40FEE5A44BFCB1C99EA5935A6B5BC9F583B0 ^
-00162134256952DD9AE6B51EFB159B35C3C138C7 ^
-CEB88E4736E354416E2010FC1061B3B53B81664B ^
-A6A2C4B6BCC41DDC67278F3DF4D8D0B9DD7784EF ^
-C23D083CD8820B57800A869F5F261D45E02DC55D ^
-E8AC31927B78DDEC41A31CA7A44EB7177165E7AB ^
-E864EC5DBAB0F9FF6984AB6AD43A8C9B81CC9F9C ^
-CFED6269069417A84D6DE2347220F4B858BCD530 ^
-D9217BFB46C96348722C3783D29D4B1A3FEDA38C ^
-DEC24E5554F79697218D317315FA986229CE3350 ^
-83A099DF7071437BA5495A5B0BFBFEFE1C0EF7F3 ^
-AA3198E30891A83E33CE3BFA0587D86A197D4F80 ^
-9B6ACBEB4989CBEE7015C7D515A75672FFDE3442 ^
-B021EB08A436B02658EAA7BA3C88D49F1219C035 ^
-CAE36DAB8AEA29F62E0855D9CB3CD8E7D39094B1 ^
-02DE8BA699F3C1B0CB5AD89A01F2346E630459D7 ^
-88021458847DD39B4495368F7254941859FAD44B ^
-91A165295C666FE85C2ADBC5A10329DAF0CB81A0 ^
-4B31312EAF8B506811151A9DBD162961F7548C4B ^
-3FE70971B20558F7E9BAC303ED2BC14BDE659A62 ^
-93FB769D5BF49D6C563685954E2AECC024DC02D6 ^
-BC8827C3E614D515E83DEA503989DEA4FDA6EA13 ^
-E83868DBE4A389AB48E61CFC4ED894F32AE112AC ^
-55C95459CDE4B33791B4B2BCAAF840930AF3F3BD ^
-36BB0E2BA438A3E03214D9ED2B28A4D5C578FCAA ^
-3ACBF874199763EBA20F3789DFC59572ACA4CF33 ^
-86BE037C4D509C9202020767D860DAB039CADACE ^
-51B57D7080A87394EEC3EB2E0B242E553F2827C9 ^
-1EFBFA78866315CE6A71E457F3A750A38FACAB41 ^
-57D6CB41AEEC20236F365B3A490C61D0CFA39611 ^
-C532CB64B4BA826372BCCF2B4B5793D5B88BB715 ^
-15833B5631032663E783686A209C6A2B47A1080E ^
-D04F2043C96E10CD83B574B1E1C217052CD4A6B2 ^
-E8882627C64DB743F7DB8B4413DD033FC63BEB20 ^
-CD2D32286B8867BC124A0AF2236FC74BE3622199 ^
-019B70D745375091ED5C7B218445EC986D0F5A82 ^
-E5FF5FEC1DADBAED02BF2DAD4026BE6A96B3F2AF ^
-6F4E23B3F2E2C068D13921FE4E5E053FFED4E146 ^
-25E179602A575C915067566FBA6DA930E97F8678 ^
-67DED0E68E235C8A523E051E86108EEB757EFBFD ^
-AF78536EA83C822796745556D62A3EE82C7BE098 ^
-64D7AC52E47834BE72455F6C64325F9C358B610D ^
-9D4866BAA3639C13E541F250FFA3D8BC157A491F ^
-2E258811961D3EB876F30E7019241A01F9517BEC ^
-8E0EBC487146F83BC9077A1630E0FB3AB3C89E63 ^
-CE8953741FFF3425D2311FBBF4AB481B669DEF70 ^
-789D1D2DAB52086BD90C0E137E2515ED9C6B59B5 ^
-B76CE7472700DD68D6328B7AA8437FB051D15745 ^
-F218669B596C5FFB0B1C14BD03C467FC873230A0 ^
-1FF3BDBE0D504CB0CDFAB17E6C37ABA6B3CFFDED ^
-2F3CBACBB14405A4652ED52793C1814FD8C4FCE0 ^
-982C8AB6CE164F481915AF59AAED9FFF2A391752 ^
-5CD92012D488A07ECE0E47901D0E083B6BD93E3F ^
-69603FEC02920851D4B3B8782E07B92BB2963009 ^
-3E90F76437B1EA44CF98A08D83EA24CECF6E6191 ^
-34C09F107C42D990EB4881D4BF2DDDCAB01563AE ^
-474BE0E5892EB2382109BFC5E3C8249A9283B03D ^
-A04B4F75051786682483252438F6A75BF4705EC6 ^
-BE88A6716083EB50ED9416719D6A247661299383 ^
-C67E38717FEE1A5F65EC6C7C7C42AFC00CD37F04 ^
-959AC4082388E19E9BE5DE571C047EF10C174A8D ^
-BAA7AA7B7753FA0ABDC4A541842B5D238D949F0A ^
-351394DCEBC08155D100FCD488578E6AE71D0E9C ^
-AB8BE94C5AF60D9477EF1252D604E58E27B2A9EE ^
-3429EC74A695FDD3228F152564952308AFE0680A ^
-907FA46C029BC67EAA8E4F46E3C2A232F85BD122 ^
-2644C87D1FBBBC0FC8D65F64BCA2492DA15BAAE4 ^
-110A3EEB408756E2E81ABAF4C5DCD4D4C6AFCF6D ^
-CD4FDC35FAC7E1ADB5DE40F47F256EF74D584959 ^
-8E6E273208AC256F9ECCF296F3F5A37BC8A0F9F7 ^
-FE0606100BDBC268DB39B503E0FDFE3766185828 ^
-6C63C3E58047BCDB35A17F74EEBA4E9B14420809 ^
-BCC2BD305F0BCDA8CF2D478EF9FE080486CB265F ^
-CE5223FD3DD920A3B666481D5625B16457DCB5E8 ^
-948886776E42E4F5FAE1B2D0C906AC3759E3F8B0 ^
-4C12A51FCFE242F832E3D7329304B11B75161EFB ^
-C54BDD2050504D92F551D378AD5FC72C9ED03932 ^
-8F53E8FA79EA09FD1B682AF5ED1515ECA965604C ^
-2D7E17F6294524CE78B33EAB72CDD08E5FF6E313 ^
-64582B4B57F782C9302BFE7D07F74AA176627A3A ^
-6D88795B71D3E386BBD1EB830FB9F161BA98869F ^
-86AD34A6463F12CEE6DE9596ABA72F0DF1397FD1 ^
-7EB46685A57C0D466152DC339C8122548C757ED1 ^
-E7A98FB0692684054407CC221ABC60C199D6F52A ^
-34DF1306662206FD0A5FC2969A4BEEC4EB0197F7 ^
-56CF7EBF08D10F0CB9FE7EE3B63A5C3A02BCB450 ^
-3BAE5CB8226642088DA760A6F78B0CF8EDDEA9F1 ^
-6475DF681E061FA506672C27CBABFA9AA6DDFF62 ^
-79D81991FA4E4957C8062753439DBFD47BBB277D ^
-BAE224477B20302E881F5249F52EC6C34DA8ECEF ^
-EDE4DEB4293CFE4138C2C056B7C46FF821CC0ACC ^
-<D
-
-H>SHS Type 2 Hashes<H
-D>
-A771FA5C812BD0C9596D869EC99E4F4AC988B13F ^
-E99D566212BBBCEEE903946F6100C9C96039A8F4 ^
-B48CE6B1D13903E3925AE0C88CB931388C013F9C ^
-E647D5BAF670D4BF3AFC0A6B72A2424B0C64F194 ^
-65C1CD932A06B05CD0B43AFB3BC7891F6BCEF45C ^
-70FFAE353A5CD0F8A65A8B2746D0F16281B25EC7 ^
-CC8221F2B829B8CF39646BF46888317C3EB378EA ^
-26ACCC2D6D51FF7BF3E5895588907765111BB69B ^
-01072915B8E868D9B28E759CF2BC1AEA4BB92165 ^
-3016115711D74236ADF0C371E47992F87A428598 ^
-BF30417999C1368F008C1F19FECA4D18A5E1C3C9 ^
-62BA49087185F2742C26E1C1F4844112178BF673 ^
-E1F6B9536F384DD3098285BBFD495A474140DC5A ^
-B522DAE1D67726EBA7C4136D4E2F6D6D645AC43E ^
-E9A021C3EB0B9F2C710554D4BF21B19F78E09478 ^
-DF13573188F3BF705E697A3E1F580145F2183377 ^
-188835CFE52ECFA0C4135C2825F245DC29973970 ^
-41B615A34EE2CEC9D84A91B141CFAB115821950B ^
-AB3DD6221D2AFE6613B815DA1C389EEC74AA0337 ^
-0706D414B4AA7FB4A9051AA70D6856A7264054FB ^
-3CBF8151F3A00B1D5A809CBB8C4F3135055A6BD1 ^
-DA5D6A0319272BBCCEA63ACFA6799756FFDA6840 ^
-FB4429C95F6277B346D3B389413758DFFFEEDC98 ^
-2C6E30D9C895B42DCCCFC84C906EC88C09B20DE1 ^
-3DE3189A5E19F225CDCE254DFF23DACD22C61363 ^
-93530A9BC9A817F6922518A73A1505C411D05DA2 ^
-E31354345F832D31E05C1B842D405D4BD4588EC8 ^
-3FF76957E80B60CF74D015AD431FCA147B3AF232 ^
-34AE3B806BE143A84DCE82E4B830EB7D3D2BAC69 ^
-D7447E53D66BB5E4C26E8B41F83EFD107BF4ADDA ^
-77DD2A4482705BC2E9DC96EC0A13395771AC850C ^
-EAA1465DB1F59DE3F25EB8629602B568E693BB57 ^
-9329D5B40E0DC43AA25FED69A0FA9C211A948411 ^
-E94C0B6AA62AA08C625FAF817DDF8F51EC645273 ^
-7FF02B909D82AD668E31E547E0FB66CB8E213771 ^
-5BB3570858FA1744123BAC2873B0BB9810F53FA1 ^
-905F43940B3591CE39D1145ACB1ECA80AB5E43CD ^
-336C79FBD82F33E490C577E3F791C3CBFE842AFF ^
-5C6D07A6B44F7A75A64F6CE592F3BAE91E022210 ^
-7E0D3E9D33127F4A30EB8D9C134A58409FA8695B ^
-9A5F50DFCFB19286206C229019F0ABF25283028C ^
-DCA737E269F9D8626D488988C996E06B352C0708 ^
-B8FFC1D4972FCE63241E0E77850AC46DDE75DBFA ^
-E9C9BF41C8549354151B977003CE1D830BE667DB ^
-0942908960B54F96CB43452E583F4F9CB66E398A ^
-FCE34051C34D4B81B85DDC4B543CDE8007E284B3 ^
-61E8916532503627F4024D13884640A46F1D61D4 ^
-F008D5D7853B6A17B7466CD9E18BD135E520FAF4 ^
-BD8D2E873CF659B5C77AAC1616827EF8A3B1A3B3 ^
-B25A04DD425302ED211A1C2412D2410FA10C63B6 ^
-A404E21588123E0893718B4B44E91414A785B91F ^
-A1E13BC55BF6DAD83CF3AABDA3287AD68681EA64 ^
-D5FD35FFABED6733C92365929DF0FB4CAE864D15 ^
-C12E9C280EE9C079E0506FF89F9B20536E0A83EF ^
-E22769DC00748A9BBD6C05BBC8E81F2CD1DC4E2D ^
-F29835A93475740E888E8C14318F3CA45A3C8606 ^
-1A1D77C6D0F97C4B620FAA90F3F8644408E4B13D ^
-4EC84870E9BDD25F523C6DFB6EDD605052CA4EAA ^
-D689513FED08B80C39B67371959BC4E3FECB0537 ^
-C4FED58F209FC3C34AD19F86A6DACADC86C04D33 ^
-051888C6D00029C176DE792B84DECE2DC1C74B00 ^
-1A3540BEE05518505827954F58B751C475AEECE0 ^
-DFA19180359D5A7A38E842F172359CAF4208FC05 ^
-7B0FA84EBBCFF7D7F4500F73D79660C4A3431B67 ^
-9E886081C9ACAAD0F97B10810D1DE6FCDCE6B5F4 ^
-A4D46E4BA0AE4B012F75B1B50D0534D578AE9CB6 ^
-6342B199EE64C7B2C9CBCD4F2DCB65ACEF51516F ^
-AABFD63688EB678357869130083E1B52F6EA861D ^
-F732B7372DAF44801F81EFFE3108726239837936 ^
-5E9347FE4574CDCB80281ED092191199BADD7B42 ^
-D5776B7DFFF75C1358ABDBBB3F27A20BB6CA7C55 ^
-022B7ADA472FB7A9DA9219621C9C5F563D3792F6 ^
-7F1DE4ECA20362DA624653D225A5B3F7964A9FF2 ^
-CA0F2B1BFB4469C11ED006A994734F0F2F5EFD17 ^
-833D63F5C2EA0CD43EC15F2B9DD97FF12B030479 ^
-14FD356190416C00592B86FF7CA50B622F85593A ^
-4AB6B57EDDEF1CE935622F935C1619AE7C1667D6 ^
-B456A6A968ACD66CAA974F96A9A916E700AA3C5D ^
-FD1C257FE046B2A27E2F0CD55ED2DECA845F01D7 ^
-66E0D01780F1063E2929EAAD74826BC64060E38C ^
-A8478DF406F179FD4EF97F4574D7F99EA1CE9EB8 ^
-248E58CF09A372114FC2F93B09C5FC14F3D0059E ^
-F15767DE91796A6816977EFA4FCED4B7FD9B8A57 ^
-36A6BC5E680E15675D9696338C88B36248BBBAF4 ^
-4DEA6251B2A6DF017A8093AB066EE3863A4EC369 ^
-D30E70E357D57E3D82CA554B8A3D58DFF528FA94 ^
-70CA84D827F7FD61446233F88CF2F990B0F3E2AA ^
-8D500C9CFDE0288530A2106B70BED39326C52C3C ^
-F3D4D139EDFC24596377BC97A96FB7621F27FFC7 ^
-5509BAFFAC6D507860CEFC5AB5832CB63CD4B687 ^
-0C0AEA0C2FD7A620C77866B1A177481E26B4F592 ^
-149176007FEE58A591E3F00F8DB658B605F8390C ^
-17C0D7B0256159F3626786FFDB20237AE154FA84 ^
-741A58618ABEB1D983D67AFDCBC49AA397A3B8E0 ^
-B738D6B3409EB9ED2F1719B84D13F7C36169CDEC ^
-3D33DE31F64055D3B128AC9A6AA3F92DFD4F5330 ^
-B6925F4DF94949B8844C867428BA3DEDF4CF2B51 ^
-CF5E7256292ABEC431D8E8B9CBEAF22AF072377E ^
-975DCE94902923977F129C0E4ACF40AD28DDB9AA ^
-333B0259B18CE64D6B52CF563DD3041E5F63A516 ^
-<D
-
-H>SHS Type 3 Hashes<H
-D>
-80E044703A880C20EC41F645120A8A5B5D194ECE ^
-E142829CA08FC9787F17AA16CE727396169B2713 ^
-6A2BAF62469D311F9257A0727F52C7EAA87CCEB4 ^
-362E3E7136CA611D7FBF687D3BBDC54CDA64843F ^
-F5900ADC6223A5D24A7526ABFC60FA8E2D59A5AB ^
-AD0CAC6A21D5B10833DDE7FA85927D74EDA142A9 ^
-47AD337EAFFDC177AAF7CBD035BE6F398B9D0536 ^
-9CF58595DF80872535BCC7C056E223546F0BB4EE ^
-7151CEB1918278CED2902B1D663D596F8D1B986F ^
-ADDC9F09AA4026EF6C4B7F1A84D3A13B4CDC65B3 ^
-921FE78A863A317B1FA1FB3CA3BE1948DE7EF754 ^
-64BE10732D71D52CE8A486DA23E6B453DF7C6FBD ^
-4A450659470DD759ABFAE1D73972A6D2E63AC16C ^
-0D665E4BBF30B7EAB955BDE84759E185EECAB4CB ^
-0C1B8EE94D61CDD0837EAED9FE33DE4A8334B596 ^
-D93BFE2A6227A4BF9B7C61EBCE4A8CDE131593FE ^
-BDA883F804B470C90BD6AC490DFC34EBC27F9648 ^
-46A0969373552213632591C52030C38E5DBDC49E ^
-4781289E48B910C550DC23CA7D3AF5324C03532D ^
-693A34CFCDDED0F3AC72E7197FCE9BB66A8E3981 ^
-AE088AF1D8865140963B3ABFB63E32E04CD1506F ^
-ADF0F8F1D85CA97586F5DC6DC5FD11FA39270F55 ^
-E484F5AD86C5F4D09E366ADF6E0DE73449F97B28 ^
-81C49842BA3D7072FB42288E03CE737A2672C091 ^
-F6CC71AD897C23A16835490DED289BFD45500AB0 ^
-23E71AED62FE8E28F34F58E7FE5594EC5EB0486C ^
-92BA7934AA5867EE52960F4E0EDFB90AA7B69305 ^
-C3D1CC8CBD1B6FFEE0D90CE962CD9C09AB1548AA ^
-3CE37A583B71A6A77BE325066A0F00C5D11DFC3E ^
-76EF5D236E1042D356A3234A422C092F86003064 ^
-8C3F703436C6C882E60263540A8E4C3E5646DC15 ^
-6138F9F3AB43B988DD3857422CCB304352459F40 ^
-B812DE98775B4690B4FC2ECFCAB61C73C7271DC7 ^
-06660985CD80D48E7B9F88455B4233924C3B64BB ^
-76AB4B6378D6F63499A94EB67EB1CB31AFF8D775 ^
-F31F6B0BE7AB059A1F59A46481967E88392979E6 ^
-0C1638498FBB7DB9600B98B4B22EF85E0FE245FB ^
-5607C6AF600939736795AC523FA43B736F41A118 ^
-8A03244866BDD21B9D8A82E98436C894FAD86ECC ^
-8A75BFD911AF87303B9B8FB7A1A47CCA52D3D98A ^
-16F0F3B5D37411236A1E3D6B1EDAB74CDA25ED4B ^
-AC72BF45477481F58A302628DC5299FFA32E7C9F ^
-74CFFD5881F75AC20726E1447DCF7F47024380EF ^
-5BFBECEECBC27DA05729C4D1AC8C1286EA6DCEC9 ^
-012AACBC0579FA4CB4F107E9A9AD1A86AD2F6A4D ^
-F7D552CBC5EF90F1A579388B5A8A9EC71EB67681 ^
-10C70115C4C34753274BFED477DF01440A67A361 ^
-078D2FACD293B6B6219D89899C16AA1AA8E3DE82 ^
-83C6BF9FB0D3091ADF374EBFA0A69916F17E6D26 ^
-2CDB1924DA62AB64C007C6505FF657E4ADDEA9C1 ^
-E95D209BCB9864B076FF4DFCA8F8BD75D62D1B48 ^
-632824CF5025F8F90AD2923BDDF449550D64C0F5 ^
-02B1C0B41FC27EC5A32E586F1AC480BF0061E56A ^
-28156BC6769AE390BF32C6512C46169181E1536D ^
-F730E6E287D992E7F3E013B6F1E088F0B9C41598 ^
-B056A6A832FA5FE964EF77FF3E0BE1C32E0D58C0 ^
-D5B3D19AFBB48FB56BA6D44A82DE6BD08DB208DE ^
-0215AD79BD6B8023C05FD2F8966211897DF6337A ^
-EC4CF38C244EB6526A44F70570925247145DA8CA ^
-C0D931262ECE93DA5A6ABC89CD6AD3162EA6B09E ^
-6BB48FAC26AA2B4859BBDEFCFB53AE4D1D9A0340 ^
-58611D43741E67A7F0DA9CB337A59DCD1EBE758E ^
-7C2AEC216AF231509E47B7EED06BB17859812B7E ^
-F60EE5DBF4A7A676EC98B3DDB1CDD6CDF3CDA33B ^
-0492E59B1F4C94E97F29A26C3EE7D57E1B0FDD72 ^
-4FCF549D902D9BE1101A756DB9E45415FB61BCD2 ^
-95C71D26AD6B38CC771376B4A4F962F12E1E3D4F ^
-F6A2449E773C72FB886B3C43E2B30EC2A1B7454A ^
-CDE86695E00AEC9A5DB6FDDB5D5A5934448D58E0 ^
-502318A758FABFF6AC53844E9E2BCD159C678510 ^
-589D295148F95F75DAE964DD743FE981FA236D4E ^
-7973DD33AE3599A556BACC77E8656E782E029EFF ^
-9F5BE43AADD43C6DB3883C9DA4B52E1A50257AEE ^
-454289D8FFB237A56D5214EAE88F0A9D328FEA1A ^
-7E686B36595BEB4C0D4528FF960EDB55088A028D ^
-F9789D1EF19A0084AC0E9F43A4BC0EE0478939EF ^
-2F32B0E7CC8BE19C325545C816E77056D7BBE70F ^
-6B1617746F073CFCD2CEBCAFBBE6FD0E28ED2D56 ^
-CF8D2EA3888AD76761799383E5A15979F6DB7A88 ^
-557AF6D9D5947203C60E98C9A79B92B8BD085E2B ^
-C61A217423DE68ED6CD34C91756C8DD3A650A2A2 ^
-73F3F79C151B6C1BD9369EDB26B932C2362B0593 ^
-364141E5FBCDE83F210C5BBBEB6810F6299DE14B ^
-F806BECD025D264FD59E93D9E3606A674C40F216 ^
-E0C761A57F00CBFB07D49BCB034C36A7122F4C5B ^
-5D3831044B9E0032FBE3C3425FFD13698F413B33 ^
-7EB1AB41E9997753C5D530DF118E71E72D7B86FC ^
-CC053EA1556269D7E8BCBA30B208FCBF0EE2EE64 ^
-A57739B1DD41E7DC0C40D6B6159A7E73CE2748AA ^
-90DA527C9DB9ACC2FD530D560A2F1191A80D0567 ^
-6AC1F2A0B8CA0E5ABC9FDF1ADCE588FBDF5CC53E ^
-43C1A0A0EE4163EC929726989F92B03639B233AB ^
-8927F299462413AC29A74080E54D8EE2DB7165E7 ^
-0C8D7E22226D91B423E781B508F31517EAAB607B ^
-7286E20D7F08D18A893254FBD3CC833F7973DCAF ^
-0CB8C235928B8E936C43B8F29EF3758B9FD54A7B ^
-F67C24CC23E440CA3F206CEEB5504ECA54CD5CA3 ^
-D78A25DEAA1E7ADADDB3C145ED0E5263BA4F2910 ^
-00AA68174D29492C578AC853FFCD55908292D41A ^
-D5570EEDB09A62A5948F7F311F7ED5EF247F9AD9 ^
-<D
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-messages.sha1 b/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-messages.sha1
deleted file mode 100644
index 7ad9078699..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/sha-1/byte-messages.sha1
+++ /dev/null
@@ -1,2294 +0,0 @@
-# Configuration information for "SHA-1 Test"
-# SHA tests are configured for BYTE oriented implementations
-H>SHS Type 1 Strings<H
-D>
-0 1 ^
-5 0 2 1 2 1 2 ^
-5 0 1 3 4 4 4 ^
-7 0 4 3 4 4 1 4 4 ^
-10 0 4 1 5 3 4 4 3 1 3 4 ^
-10 0 3 1 6 5 5 1 3 6 6 4 ^
-13 1 3 2 5 3 3 3 4 6 6 1 4 6 2 ^
-16 1 3 5 5 1 2 1 3 3 6 3 5 2 3 5 7 2 ^
-15 1 8 1 5 3 2 7 4 5 6 7 3 3 1 6 3 ^
-15 1 4 6 8 2 1 4 2 5 1 6 8 8 6 4 7 ^
-18 1 1 2 7 3 8 6 7 5 4 3 4 3 5 3 3 2 6 8 ^
-16 0 9 8 1 8 1 7 6 7 7 1 2 6 9 5 4 7 ^
-18 0 7 1 7 3 9 4 7 7 5 2 8 1 7 8 2 7 2 9 ^
-19 1 2 3 1 8 8 6 9 10 3 10 8 9 2 4 1 5 1 5 9 ^
-19 1 8 5 4 8 1 3 9 5 7 7 2 7 2 7 8 7 4 8 10 ^
-20 1 1 9 7 4 1 4 5 1 10 8 6 4 4 9 9 9 8 2 9 10 ^
-19 1 11 6 7 7 2 6 2 6 10 6 9 10 5 11 1 6 8 11 4 ^
-22 0 10 5 10 3 7 8 9 9 1 1 1 10 2 1 5 10 2 9 9 9 7 8 ^
-21 0 1 10 1 6 9 4 2 5 2 11 8 12 12 9 8 1 3 10 7 11 12 ^
-24 1 3 9 5 12 3 4 2 9 12 11 6 6 1 1 9 5 9 1 4 9 4 10 8 9 ^
-25 1 3 2 3 11 1 12 5 6 2 7 8 4 8 8 9 9 8 4 9 1 4 8 10 9 9 ^
-23 0 11 10 7 10 10 6 10 9 4 5 10 5 8 4 1 10 12 4 6 1 8 11 6 ^
-22 0 12 8 10 4 3 8 5 5 7 11 13 11 12 11 4 12 3 6 5 11 10 5 ^
-26 1 10 9 6 9 7 2 10 4 4 5 5 2 12 13 5 3 1 10 1 4 7 8 13 13 12 9 ^
-31 0 2 6 5 4 7 3 10 6 13 6 3 9 6 2 10 5 3 8 4 1 11 3 5 3 7 11 1 12 9 12 5 ^
-27 1 14 5 1 3 7 2 3 9 3 4 14 4 4 10 8 5 14 1 11 12 12 10 4 13 7 11 9 ^
-30 1 4 9 5 5 8 9 5 10 4 2 4 7 9 9 6 3 5 1 8 3 2 13 3 14 9 8 9 10 14 10 ^
-27 0 12 9 5 8 7 2 14 12 3 8 14 6 6 4 7 5 7 10 7 11 10 1 9 6 7 12 14 ^
-24 0 12 9 9 2 11 13 12 11 11 6 14 13 10 5 6 8 10 4 3 11 11 14 5 14 ^
-24 0 15 4 5 3 8 12 15 8 14 15 9 12 12 3 10 13 6 11 10 4 13 14 8 8 ^
-28 1 1 8 1 5 11 4 9 12 4 13 15 5 9 11 7 14 11 1 11 7 8 8 11 1 13 15 12 13 ^
-32 1 5 8 3 8 10 7 8 1 5 13 12 14 5 3 6 4 12 15 6 6 10 11 13 9 1 11 6 10 3 7 14
-2 ^
-31 0 10 3 5 1 14 11 11 16 1 2 2 11 6 13 15 12 6 5 16 2 14 2 10 12 2 5 5 6 10 13
-15 ^
-34 0 3 10 8 16 9 5 12 15 4 11 13 3 6 5 10 8 1 3 9 3 11 1 2 16 12 10 6 1 9 1 16
-5 6 14 ^
-30 1 1 12 4 4 2 15 13 15 11 15 5 11 9 7 15 16 6 16 12 3 2 10 16 5 5 7 1 7 11 16
-^
-34 0 7 9 11 2 5 5 5 4 13 13 14 4 7 12 6 4 8 2 9 9 13 13 3 3 6 7 16 7 6 15 5 8
-15 14 ^
-36 1 4 6 16 15 11 14 14 4 7 10 3 4 10 3 6 7 14 4 6 6 5 2 7 8 16 2 12 16 10 14 3
-2 3 7 14 3 ^
-32 0 15 10 9 1 14 10 14 6 6 16 3 2 3 8 3 12 8 11 17 3 9 7 16 14 4 11 15 5 13 9
-5 17 ^
-30 0 17 17 13 8 2 6 8 16 1 12 5 17 2 9 8 10 13 14 11 17 12 5 14 9 11 9 11 4 11
-12 ^
-30 1 16 6 10 5 8 3 17 16 14 1 15 15 15 6 13 2 11 6 13 11 13 4 6 7 11 11 12 16
-13 16 ^
-33 1 16 16 14 16 2 4 16 11 6 15 7 4 17 6 5 7 6 3 14 16 5 17 11 13 1 1 14 13 3 6
-14 5 16 ^
-39 1 2 16 13 7 8 6 2 15 1 9 12 4 4 11 13 7 2 11 9 18 4 5 4 8 2 14 9 9 1 8 13 11
-15 8 5 9 10 16 7 ^
-34 0 2 7 1 1 17 13 6 11 10 8 5 12 15 6 15 10 12 4 18 1 2 8 11 12 16 10 12 18 11
-16 12 11 17 6 ^
-34 1 4 7 13 7 10 7 10 6 1 12 7 18 11 18 2 10 15 10 14 8 18 9 9 12 12 3 13 12 6
-4 9 17 13 17 ^
-40 0 5 7 3 2 1 17 14 4 16 6 13 1 13 6 6 10 1 3 18 3 11 7 9 5 7 11 17 1 9 16 5
-15 10 17 3 8 15 17 8 12 ^
-40 0 11 3 15 17 11 1 1 4 3 14 18 4 2 18 8 15 6 4 6 3 15 11 16 10 17 17 9 6 3 2
-6 16 4 9 12 6 8 1 11 17 ^
-37 1 2 19 12 8 16 14 2 9 16 2 6 6 7 9 10 9 11 9 14 11 15 5 16 9 2 17 2 8 15 8 4
-3 14 14 16 16 12 ^
-37 1 11 10 16 12 11 7 14 14 14 6 10 10 1 6 13 19 5 6 4 7 12 12 10 5 10 15 15 8
-5 13 17 13 5 6 14 1 19 ^
-38 1 2 6 5 17 9 11 18 18 8 6 13 15 3 3 15 5 13 18 3 2 5 5 14 7 13 4 17 7 2 17 3
-18 15 7 15 16 18 11 ^
-38 1 12 8 6 3 17 12 13 19 15 9 7 17 16 15 3 11 11 5 2 13 19 16 2 4 16 7 8 1 2 9
-17 12 3 5 18 19 11 9 ^
-39 1 14 16 14 8 9 16 5 1 6 3 17 18 16 9 1 15 9 10 9 19 1 3 3 20 11 13 17 1 19 8
-3 4 3 7 1 14 19 19 19 ^
-37 1 18 13 11 5 18 4 19 10 6 19 11 17 10 10 7 9 13 16 9 10 18 4 12 5 16 5 20 12
-3 8 10 1 18 1 6 20 14 ^
-36 0 8 9 6 12 11 7 7 3 17 13 6 20 17 9 20 16 10 12 17 8 11 8 11 10 5 10 14 18 8
-19 9 12 12 2 20 19 ^
-39 0 12 16 20 3 9 9 19 17 13 13 4 17 2 11 7 14 3 6 16 13 10 13 5 16 10 2 8 2 17
-19 4 17 7 19 6 9 15 15 6 ^
-43 0 7 2 18 5 7 18 5 2 15 7 11 10 9 3 2 14 19 3 11 8 18 15 5 3 5 12 15 16 10 17
-7 19 16 2 1 16 6 3 19 12 5 18 16 ^
-49 1 9 11 2 1 12 11 14 12 14 10 4 11 6 8 16 7 5 11 20 8 17 4 14 4 15 3 2 2 4 3
-2 3 14 15 10 2 12 7 3 7 20 20 19 10 2 3 1 10 20 ^
-36 0 19 20 12 5 19 21 5 21 11 14 19 1 17 8 9 4 19 3 17 1 14 21 14 7 6 5 20 14
-21 20 4 6 21 7 11 12 ^
-41 0 12 9 11 6 16 18 18 10 11 20 6 12 11 5 7 21 19 18 6 15 21 10 4 14 9 19 10 3
-3 5 13 1 8 12 3 13 9 7 10 17 14 ^
-45 0 10 6 8 3 17 18 3 21 19 6 17 15 4 9 15 9 15 14 4 7 14 8 10 13 4 11 10 7 6
-21 1 14 5 11 7 7 2 13 13 3 9 13 8 14 20 ^
-39 1 3 7 18 4 9 9 5 15 13 17 10 15 16 20 8 19 9 10 9 1 19 14 21 2 18 13 10 4 18
-16 4 21 15 10 18 19 3 12 18 ^
-41 0 14 4 13 11 1 11 1 10 2 12 4 21 10 21 18 9 2 16 7 20 6 7 12 19 20 1 13 12
-10 8 21 15 7 19 13 6 8 19 20 18 19 ^
-37 0 11 18 1 17 14 15 20 16 20 8 2 17 10 4 21 5 19 19 14 22 21 18 13 14 1 3 12
-11 11 4 22 13 5 18 7 21 21 ^
-48 0 9 22 19 12 8 16 5 17 5 9 1 2 9 6 12 6 1 7 4 3 15 1 14 1 12 3 10 2 10 14 21
-13 17 6 6 17 1 21 2 14 16 17 9 11 20 21 11 18 ^
-50 1 12 8 20 13 2 9 20 9 14 10 1 16 2 22 6 4 16 14 15 1 12 4 14 9 21 3 3 9 8 21
-15 14 8 4 14 4 2 3 8 12 8 6 1 2 18 20 15 3 19 10 ^
-44 0 10 20 14 6 3 4 21 1 12 4 18 2 6 7 6 9 20 14 10 10 19 17 21 12 15 17 7 10
-11 8 10 12 1 19 19 9 18 21 4 18 11 9 22 5 ^
-47 0 15 8 15 3 5 6 2 19 12 17 4 20 8 11 20 2 18 4 16 20 12 9 9 6 16 21 16 3 16
-18 3 19 5 16 2 4 2 12 11 15 11 14 17 2 10 18 8 ^
-48 1 5 13 3 21 5 3 6 18 18 10 1 21 21 7 1 13 12 19 1 14 6 8 21 19 21 11 19 13 2
-13 4 1 10 22 16 4 9 4 10 16 3 7 15 11 9 13 17 12 ^
-45 0 14 7 6 2 20 3 6 19 19 10 2 22 12 17 12 1 20 7 7 15 20 6 18 8 3 14 23 18 15
-4 7 5 23 15 7 14 10 10 19 17 2 4 15 17 21 ^
-45 1 15 11 8 9 17 5 12 18 14 6 20 17 21 12 16 9 22 9 20 15 2 22 11 2 6 11 9 8 2
-4 14 19 3 21 21 23 8 2 11 4 8 4 20 22 11 ^
-38 0 21 18 22 10 19 9 14 17 23 21 10 7 15 13 16 5 4 10 13 14 20 23 12 20 23 18
-10 12 8 21 11 6 12 7 19 14 18 17 ^
-40 0 18 22 6 9 22 5 23 13 6 8 23 20 22 5 22 15 19 20 9 9 1 13 13 10 14 13 5 22
-14 21 9 21 19 14 14 4 18 13 12 14 ^
-48 1 7 3 15 5 17 14 23 14 5 17 22 11 1 8 13 23 6 21 3 6 11 7 23 8 6 21 4 4 22
-19 13 8 5 19 7 5 23 1 4 19 11 23 11 21 14 1 3 21 ^
-43 0 22 14 11 7 18 16 17 24 12 12 3 13 19 16 22 4 16 4 6 23 8 18 11 2 3 20 22 9
-21 8 23 1 23 20 7 16 13 23 4 13 3 7 22 ^
-47 1 23 6 13 19 2 3 7 2 9 9 15 6 13 4 22 6 19 20 1 9 7 14 1 15 3 23 24 22 18 12
-12 17 19 10 8 11 22 12 10 2 20 15 18 17 18 7 19 ^
-47 1 12 21 6 12 4 7 18 17 3 2 14 24 14 1 23 1 11 15 10 6 18 20 7 1 8 1 16 6 20
-23 23 21 10 10 12 24 10 11 23 2 12 23 9 3 24 24 10 ^
-52 0 14 10 18 15 14 5 16 11 22 2 15 24 8 22 1 4 24 9 10 15 3 9 5 4 17 15 9 12
-19 19 1 3 10 6 8 3 17 8 18 24 19 3 4 15 4 9 2 24 5 20 13 13 ^
-42 0 20 17 19 22 13 8 10 19 15 11 1 14 17 20 22 10 7 11 16 9 21 22 17 23 12 15
-4 24 7 21 18 2 21 16 1 19 18 20 11 3 15 17 ^
-50 0 18 1 6 14 5 5 5 19 13 10 24 19 16 24 15 13 2 19 15 24 21 17 4 13 17 1 1 9
-1 10 2 18 1 21 19 5 18 12 2 22 16 23 15 19 6 18 9 1 23 5 ^
-51 0 21 13 14 11 18 12 13 3 19 9 20 22 20 2 11 12 6 1 12 16 18 2 9 8 4 3 11 17
-11 5 4 19 16 11 23 13 18 1 20 8 2 16 16 21 4 19 5 5 20 24 16 ^
-53 1 20 25 17 11 8 4 19 25 17 7 16 21 6 4 8 2 15 9 2 9 19 3 6 3 3 10 25 13 15 7
-8 20 21 12 10 12 5 24 11 20 3 13 13 16 9 13 10 3 9 16 3 7 25 ^
-49 1 9 9 14 2 13 17 25 2 18 5 19 23 9 25 9 10 23 12 12 7 13 8 15 7 1 6 21 2 8 7
-6 16 14 14 12 15 13 24 10 15 11 10 8 14 15 21 25 21 25 ^
-47 0 9 18 20 22 21 20 11 14 23 22 10 13 14 8 19 12 2 11 20 23 13 4 10 6 5 7 23
-11 3 16 8 21 4 8 18 5 12 14 8 6 20 19 24 8 23 17 23 ^
-48 1 7 19 1 18 1 14 22 13 14 5 8 22 18 14 25 17 11 12 22 2 12 12 16 12 13 18 17
-12 17 14 18 8 25 9 23 5 3 8 14 24 17 7 3 3 23 17 22 19 ^
-51 1 19 17 16 22 24 14 16 20 23 20 9 19 16 7 12 16 5 8 9 7 10 21 24 10 11 19 1
-21 14 14 19 3 22 8 12 20 1 18 5 6 5 12 14 1 1 11 9 22 3 24 4 ^
-52 1 6 1 11 16 1 12 8 11 11 17 10 22 7 3 10 2 6 4 24 16 24 19 4 5 18 11 12 9 20
-21 25 2 21 18 10 20 25 21 3 17 17 5 8 22 25 19 8 10 19 7 11 18 ^
-44 0 26 14 21 25 25 4 9 13 5 8 9 21 8 12 26 24 9 24 15 1 23 22 16 14 8 22 15 19
-24 20 7 8 15 24 12 4 4 23 21 13 19 15 21 12 ^
-59 1 15 7 3 21 20 8 22 14 23 26 19 2 10 18 3 5 3 1 9 15 15 3 7 13 23 9 7 1 13
-17 14 25 9 16 2 2 6 13 7 19 25 17 1 5 21 2 7 22 5 6 25 3 12 19 6 2 4 24 17 ^
-60 0 9 18 20 19 4 11 14 1 6 8 26 6 9 22 4 10 2 7 21 9 8 24 25 14 22 12 22 3 23
-3 3 20 6 11 23 6 1 7 5 18 5 15 25 26 1 1 10 11 11 4 12 11 20 3 14 2 3 2 23 15 ^
-49 0 12 17 24 11 8 6 24 16 15 22 21 14 6 12 20 19 5 5 12 11 6 23 2 16 23 7 24 6
-21 2 17 17 5 25 11 25 20 25 24 18 6 12 19 25 7 6 5 2 25 ^
-54 1 12 16 1 15 7 1 26 19 19 13 20 11 17 6 20 5 24 24 1 21 11 9 20 21 15 10 19
-26 3 2 6 7 12 9 10 8 14 10 15 5 17 8 21 1 20 25 6 19 8 3 22 16 16 20 ^
-63 0 17 13 11 10 17 15 12 6 13 14 17 4 12 10 24 5 13 24 3 5 2 5 11 14 8 5 10 17
-16 8 4 14 21 15 3 6 17 25 8 2 3 3 19 10 13 22 22 8 2 13 25 17 2 1 19 1 14 20 2
-5 4 15 24 ^
-49 0 14 20 7 25 20 26 20 16 7 17 17 22 1 13 6 5 1 18 14 15 23 15 10 5 19 18 18
-26 12 13 3 25 12 21 16 24 4 16 3 6 26 26 10 20 13 1 20 24 15 ^
-56 0 3 8 14 5 5 7 11 13 11 26 11 4 26 17 20 19 11 10 3 10 14 9 6 9 7 16 10 4 4
-19 19 2 26 13 19 17 15 24 15 4 21 22 13 13 12 22 2 14 20 5 18 7 17 24 20 20 ^
-58 1 6 17 9 20 2 10 19 3 22 4 1 11 3 5 3 21 11 15 12 23 26 5 2 27 6 5 16 6 3 2
-23 5 3 20 20 4 24 2 18 21 7 14 10 27 23 6 24 6 19 23 3 9 22 16 21 17 19 23 ^
-58 1 17 7 21 19 6 16 15 15 20 14 2 25 19 14 18 19 7 9 1 14 11 10 16 3 23 14 26
-10 11 1 18 1 12 24 19 19 1 7 2 3 24 7 12 9 2 8 16 20 24 5 26 26 4 9 2 7 25 17 ^
-54 1 8 12 18 14 26 7 17 18 4 20 1 16 14 21 26 4 6 8 24 11 25 15 24 16 23 4 10
-23 21 24 15 10 9 26 7 14 24 21 6 20 5 17 16 17 1 3 12 1 4 13 3 9 21 26 ^
-56 1 7 18 11 1 19 20 23 12 12 27 13 13 15 16 13 1 16 15 12 26 3 16 16 8 17 13
-21 4 6 5 19 14 16 4 16 11 14 18 18 27 9 13 21 3 26 22 3 7 6 4 26 3 15 8 25 21 ^
-50 1 20 13 9 11 20 6 11 21 27 25 20 7 4 18 26 16 27 5 12 19 7 23 6 25 25 2 11
-13 25 21 18 17 6 12 14 13 24 11 14 19 26 27 25 6 1 15 4 7 27 15 ^
-51 0 15 16 26 27 23 14 12 28 22 15 8 19 2 20 13 1 24 2 25 1 6 19 19 8 11 24 24
-21 13 27 5 11 28 17 7 25 6 23 24 14 25 12 5 13 26 2 5 8 10 16 17 ^
-58 1 5 26 18 19 21 3 12 11 13 4 14 22 22 14 16 13 3 22 16 23 5 19 6 13 10 26 17
-27 26 4 3 25 6 14 2 3 5 7 23 11 22 8 25 2 9 25 18 17 8 2 14 4 19 1 5 27 13 24 ^
-53 0 2 27 28 2 17 23 10 27 18 26 7 22 16 3 27 1 26 21 28 10 3 6 2 2 10 17 13 16
-6 17 21 23 13 20 22 5 6 11 12 12 8 23 13 17 9 23 20 3 28 27 12 17 22 ^
-59 0 28 19 5 21 4 27 8 1 19 14 20 6 7 9 1 6 22 3 19 26 14 8 6 7 19 15 23 1 17
-16 6 26 14 5 22 25 4 7 10 16 21 10 18 19 24 16 23 8 3 17 28 18 10 2 5 3 21 21
-15 ^
-58 0 6 24 1 4 24 18 10 22 1 21 12 5 4 4 20 25 24 26 8 25 11 2 7 27 22 19 4 18
-27 10 28 4 12 24 8 16 12 11 16 17 25 8 12 16 1 9 9 10 5 24 23 18 5 14 18 8 4 28
-^
-61 0 5 17 8 28 1 22 4 11 3 2 17 3 14 9 27 13 18 24 9 8 7 28 25 14 21 27 24 6 18
-16 2 12 15 9 14 10 1 8 17 4 6 15 26 11 15 2 28 20 26 16 3 7 5 8 9 26 10 12 25
-11 22 ^
-53 0 9 13 24 15 20 2 4 8 2 22 20 19 4 15 14 28 13 25 10 10 12 28 24 22 26 28 15
-9 11 26 19 22 27 2 21 8 20 23 26 12 10 21 9 15 13 25 7 26 1 13 5 9 20 ^
-58 0 3 9 21 22 7 1 23 28 1 2 8 22 12 18 28 5 18 14 7 11 17 20 20 7 21 13 8 28
-21 22 2 16 20 15 28 9 3 22 13 10 23 4 16 11 14 1 10 8 14 14 15 18 13 12 21 18
-25 28 ^
-60 1 29 20 2 29 22 8 16 20 4 12 9 6 12 16 16 7 9 20 29 11 9 4 1 15 25 16 29 10
-22 7 2 8 5 18 14 23 24 4 6 26 3 11 6 12 1 7 14 24 14 6 10 21 16 23 29 25 6 14
-17 24 ^
-64 0 12 10 5 10 15 25 8 15 3 7 13 25 16 14 1 29 22 26 15 27 9 1 8 8 28 6 13 5
-13 3 15 5 23 8 23 2 5 5 4 17 13 14 7 17 12 27 3 18 5 7 5 26 18 15 22 28 16 13 7
-2 23 19 25 15 ^
-56 1 17 7 16 25 23 11 11 15 2 13 9 26 2 24 26 7 28 11 2 29 7 22 23 5 28 19 1 27
-29 1 24 11 18 20 3 13 11 7 3 15 17 24 1 18 13 6 3 25 27 16 28 18 24 8 23 22 ^
-51 1 29 28 6 28 14 12 28 27 22 4 14 25 1 3 9 7 11 14 15 16 10 19 12 19 11 20 13
-28 4 27 28 7 27 12 4 28 21 17 22 20 17 15 15 23 22 13 12 21 22 21 29 ^
-64 1 12 14 12 18 27 8 7 4 9 14 16 15 8 11 21 20 10 10 21 23 20 2 11 23 1 11 1 5
-3 23 16 15 27 14 5 16 3 22 2 3 24 3 19 29 4 4 10 8 20 14 15 1 26 12 27 25 4 28
-22 11 19 19 24 9 ^
-60 1 20 8 9 5 25 19 17 19 15 7 24 24 21 3 20 16 8 3 17 28 18 29 9 23 9 10 29 4
-12 24 15 5 8 22 17 29 12 3 8 29 15 21 21 4 7 20 7 10 7 26 10 16 24 6 7 12 8 12
-15 17 ^
-60 0 9 17 11 28 12 26 26 6 29 13 10 20 6 23 10 4 3 26 26 14 20 20 25 14 13 15
-24 14 11 4 23 27 24 20 9 16 17 24 13 12 6 1 14 26 25 7 8 21 1 19 3 2 2 17 21 13
-5 9 21 11 ^
-54 0 25 1 27 24 6 23 16 5 1 20 29 22 25 9 25 10 3 28 28 25 19 18 16 24 14 15 5
-28 12 28 26 29 2 15 15 9 5 18 19 22 12 15 4 6 15 24 16 9 4 26 25 18 27 12 ^
-61 1 20 4 26 12 3 22 1 22 30 3 28 10 9 24 14 29 6 30 3 10 20 14 6 3 19 21 21 28
-16 18 11 30 11 20 30 1 9 8 11 5 19 10 24 4 22 4 2 26 5 15 20 8 3 13 30 18 8 1
-25 28 19 ^
-56 1 20 15 21 18 18 12 16 13 24 9 21 2 28 6 1 23 9 18 27 27 4 9 13 10 8 14 16
-15 12 11 14 21 14 10 11 25 17 17 30 21 13 27 26 26 22 14 13 17 21 19 9 9 20 23
-13 28 ^
-59 1 10 28 24 10 22 27 23 27 8 17 14 6 4 21 26 15 1 8 29 27 6 28 15 3 27 25 25
-14 19 13 29 8 24 2 8 2 4 12 19 11 10 6 26 14 22 24 30 10 11 12 2 12 17 23 8 8
-12 28 12 ^
-56 0 14 28 2 17 4 8 3 26 9 23 21 30 30 20 4 13 28 29 9 3 17 7 19 30 28 1 2 20 9
-12 24 15 30 20 27 3 23 11 6 29 25 23 26 17 20 10 22 15 23 6 25 5 4 30 2 29 ^
-63 1 23 15 27 14 26 1 1 7 19 12 7 6 20 18 14 4 15 17 28 7 11 7 8 9 22 17 12 5
-23 18 25 18 6 12 26 30 12 30 14 3 1 18 10 20 27 21 8 6 24 26 20 11 24 7 2 4 18
-15 14 30 16 19 14 ^
-52 0 27 15 4 19 25 29 29 7 14 18 9 11 9 27 11 15 29 9 28 20 2 30 26 21 17 8 28
-17 22 29 24 8 11 18 29 15 6 7 27 27 17 24 18 23 11 19 8 30 5 24 22 24 ^
-66 1 25 15 28 23 5 10 21 5 8 7 3 10 19 17 6 9 15 29 10 7 4 1 16 21 16 29 13 18
-5 3 8 15 8 21 29 20 5 27 2 13 27 7 7 30 2 18 26 10 2 5 29 21 15 25 26 24 8 12
-20 3 9 10 30 7 12 29 ^
-53 1 30 26 20 11 22 19 27 2 16 10 6 4 24 17 20 25 20 15 8 23 23 20 30 18 16 3
-30 15 26 23 28 7 21 8 7 31 31 14 26 18 3 1 26 28 15 25 11 31 3 25 9 21 30 ^
-67 0 2 6 14 4 9 5 28 8 17 22 1 4 8 7 10 14 19 10 14 8 27 9 24 26 4 30 11 8 19 5
-21 7 2 27 20 16 20 20 22 14 13 16 26 14 10 3 25 22 25 23 21 10 15 15 29 8 13 4
-2 13 22 20 7 4 20 31 23 ^
-65 0 2 2 28 13 19 14 12 23 27 6 2 14 2 22 6 25 30 29 31 13 14 16 31 12 16 30 5
-14 31 11 4 1 1 25 21 13 26 22 21 5 22 14 29 1 21 3 14 30 4 2 29 12 15 23 3 15 5
-1 6 23 22 13 1 14 23 ^
-59 1 25 5 15 6 13 3 22 11 23 31 24 6 5 20 4 14 3 29 8 29 19 7 29 23 25 28 19 11
-15 27 21 14 1 19 20 26 12 7 12 1 18 13 29 28 23 29 14 23 7 1 9 29 24 5 30 18 5
-25 30 ^
-55 1 31 25 13 7 24 25 24 1 12 19 9 7 6 28 20 14 28 21 19 31 20 20 6 24 18 27 24
-4 18 21 1 31 15 1 15 2 27 4 26 25 4 23 19 2 31 22 30 21 22 5 27 12 30 28 31 ^
-62 0 27 15 18 14 25 15 17 7 28 11 28 29 30 1 17 12 10 2 18 20 21 2 11 12 5 4 12
-25 14 5 5 24 22 18 31 15 22 29 11 3 21 31 21 27 3 28 7 10 25 2 15 30 9 30 7 22
-15 9 3 20 24 14 ^
-60 0 28 14 18 9 27 14 22 27 31 10 8 14 7 15 7 20 5 26 1 29 7 17 17 8 3 13 27 18
-8 31 27 28 22 22 17 19 18 18 11 19 13 25 10 19 6 28 4 31 23 10 18 26 31 5 10 13
-12 8 15 27 ^
-60 1 24 22 4 29 22 31 28 20 4 16 21 3 1 15 5 15 6 30 3 29 29 7 27 20 2 20 31 22
-26 9 29 16 4 26 32 17 20 14 28 17 19 6 24 11 26 28 5 18 15 8 16 20 21 4 9 12 4
-8 17 29 ^
-<D
-
-H>SHS Type 2 Strings<H
-D>
-69 1 5 3 11 15 12 24 31 23 1 6 28 2 8 31 6 7 30 5 19 23 12 6 9 31 19 17 24 25
-22 6 12 16 3 7 9 9 11 29 4 11 2 5 13 29 10 12 30 32 18 28 18 27 3 30 4 4 26 6
-13 31 13 2 11 7 24 4 17 29 12 ^
-95 0 21 19 21 23 11 42 36 2 13 4 1 33 22 16 27 9 4 33 16 3 30 15 11 32 13 17 38
-32 9 38 4 36 15 32 27 19 42 18 6 36 22 10 29 12 25 40 15 29 23 28 30 4 8 11 24
-9 10 31 28 43 23 16 29 33 5 40 26 3 19 12 36 43 5 35 37 5 14 11 45 35 16 10 8
-32 4 15 35 26 2 39 22 37 22 30 29 ^
-106 1 18 14 51 2 6 32 51 9 32 50 44 46 51 8 11 53 45 55 16 10 3 52 8 20 20 46
-46 13 32 2 46 50 43 25 54 9 31 29 2 47 15 29 24 45 44 18 37 14 28 39 36 44 47
-16 50 10 44 24 53 35 22 40 20 15 51 22 18 22 42 6 54 49 38 21 7 13 30 16 7 52
-16 22 13 38 7 11 44 33 9 25 13 37 42 14 45 53 30 38 5 25 5 35 38 22 28 53 ^
-127 0 58 35 43 28 5 28 63 8 12 25 9 47 53 29 62 7 37 2 3 48 5 12 55 56 28 35 12
-63 6 58 27 27 48 44 35 14 17 22 56 10 8 1 16 15 42 63 14 51 57 19 41 7 8 56 47
-34 52 22 48 60 43 9 1 52 4 21 49 61 18 50 23 13 46 62 23 45 62 9 56 18 23 31 8
-30 27 36 13 38 4 58 53 47 24 18 41 58 19 12 18 52 42 29 44 45 26 63 34 32 41 64
-15 26 55 19 2 49 6 30 53 13 54 12 53 37 12 37 43 ^
-148 0 60 4 51 47 58 38 17 63 33 23 28 43 12 69 70 33 17 12 50 18 18 36 45 2 67
-4 45 20 4 33 38 29 45 8 22 58 39 71 38 32 53 35 19 53 31 29 51 35 4 63 18 33 26
-47 70 9 64 62 63 30 15 1 35 28 16 40 20 14 50 33 19 38 30 27 55 10 16 46 47 7
-55 12 53 26 56 33 29 55 25 17 48 43 21 43 18 24 63 27 68 46 38 33 35 10 18 11
-27 5 9 58 35 70 36 36 39 47 2 10 66 47 5 18 21 44 71 51 57 3 22 7 56 55 28 25
-14 40 16 24 48 37 66 50 24 45 18 39 53 55 ^
-165 1 15 62 35 29 15 40 19 76 67 4 5 71 46 61 26 8 77 48 1 23 12 60 40 24 44 33
-29 42 73 66 49 61 20 30 1 54 52 42 39 64 23 65 37 24 20 11 26 66 22 77 22 57 7
-38 57 33 61 73 7 64 1 49 35 76 14 27 21 45 68 38 58 73 13 72 47 73 33 8 66 23
-38 4 56 77 47 10 71 13 20 31 41 6 51 3 18 17 61 47 14 48 76 46 28 34 43 1 56 4
-25 7 65 41 1 34 37 23 59 59 27 26 13 15 14 75 60 14 1 28 59 26 65 61 16 23 17
-28 6 19 2 35 49 30 29 48 2 63 73 59 1 3 76 41 11 19 18 43 54 63 67 51 4 9 78 60
-66 ^
-181 0 18 19 84 17 12 10 57 18 77 51 52 16 39 74 49 52 63 38 72 2 15 64 83 62 49
-56 11 26 68 58 83 33 23 50 63 71 53 27 84 22 39 41 52 58 11 64 7 60 45 70 22 5
-73 38 30 30 48 21 75 80 40 21 8 53 9 26 30 34 81 71 71 51 23 75 33 41 23 32 5 8
-66 40 72 40 16 66 45 14 48 34 21 41 27 3 55 27 37 23 41 65 4 57 51 74 22 19 75
-42 16 19 46 16 10 48 20 19 37 41 14 57 9 17 55 38 5 60 7 46 20 43 36 39 52 20
-10 62 45 23 46 7 35 75 29 70 35 36 34 25 12 15 84 26 10 6 71 29 79 33 32 25 59
-76 82 64 58 7 8 19 41 74 2 53 65 24 1 55 51 36 21 79 7 ^
-184 1 60 66 66 6 3 9 73 12 7 40 70 18 71 70 65 51 14 14 27 50 9 87 81 50 22 19
-40 37 16 79 12 34 37 76 82 10 61 7 81 49 67 26 45 82 50 81 63 45 69 31 31 76 51
-9 59 34 51 54 34 83 10 33 51 86 81 82 69 18 8 22 64 19 86 62 58 33 37 17 34 5
-29 83 42 76 50 54 66 39 9 1 36 43 17 65 6 35 56 72 71 83 88 10 1 8 87 22 6 21
-78 25 89 43 62 40 55 85 31 89 74 63 46 28 24 26 31 17 7 8 27 19 12 85 17 20 27
-77 10 2 54 80 17 52 74 76 69 78 11 20 80 4 29 24 85 75 18 39 23 70 83 29 57 67
-72 70 33 4 15 46 42 2 69 13 53 33 69 64 33 64 14 40 69 59 78 54 ^
-193 1 68 43 95 53 38 58 55 28 20 16 67 48 17 86 32 44 68 67 28 16 14 79 25 15
-72 67 50 80 18 30 10 75 1 60 45 87 78 28 95 49 63 70 59 26 6 51 73 60 65 18 26
-8 87 5 58 31 25 57 40 46 78 57 34 78 61 36 66 57 38 80 22 32 68 71 30 74 37 81
-66 77 66 55 2 51 24 93 61 40 68 45 61 12 63 24 89 59 52 72 43 20 20 69 36 40 88
-46 9 62 55 77 84 20 18 6 77 15 52 39 75 3 26 4 85 17 62 29 11 92 46 58 29 59 28
-42 80 71 96 2 49 85 37 63 4 61 14 2 53 87 25 86 6 75 76 93 41 39 93 92 42 56 41
-63 26 28 18 77 11 50 78 79 1 12 12 91 29 13 58 5 56 92 66 59 4 39 47 95 5 5 62
-33 13 80 27 ^
-203 1 35 28 11 7 20 7 17 3 3 30 89 13 65 56 66 63 22 82 16 31 55 56 77 91 91 71
-101 13 10 85 101 95 17 99 98 91 33 14 20 48 32 7 64 29 38 35 25 4 95 23 34 1 85
-81 23 31 96 71 84 50 15 79 47 25 51 45 35 66 19 61 60 9 31 93 64 70 30 42 86 53
-1 71 46 42 22 38 96 10 99 34 76 26 55 73 63 63 97 23 92 81 64 46 1 30 31 35 86
-91 88 64 87 16 37 69 84 94 60 100 3 47 52 8 71 87 57 29 76 43 18 45 46 15 65 12
-44 42 66 60 15 68 19 58 39 62 76 9 92 101 57 32 4 34 15 41 62 32 89 71 43 35 31
-41 21 17 82 33 96 27 62 29 82 57 46 62 15 24 99 37 83 40 52 46 56 80 98 3 91 74
-6 27 7 58 94 10 41 79 97 84 77 74 26 99 35 ^
-212 1 26 101 17 91 45 97 80 59 102 30 68 4 85 9 4 39 16 18 85 70 11 87 62 72 78
-38 3 41 53 82 82 35 18 13 94 64 52 39 77 59 26 9 65 46 64 98 32 29 86 79 16 63
-54 76 56 98 16 98 78 22 72 33 103 104 52 84 12 65 15 85 101 97 84 31 51 26 100
-100 38 80 13 2 78 7 24 44 84 103 27 7 28 16 33 99 25 103 54 14 42 62 87 92 27
-22 42 5 52 100 84 73 72 63 24 48 56 52 23 5 17 76 31 1 95 58 43 60 50 62 30 23
-35 79 20 35 3 72 32 45 51 87 41 84 27 79 77 70 102 15 54 15 100 8 52 69 105 3
-30 84 42 93 66 89 69 74 24 33 42 97 4 38 99 106 13 93 6 106 74 100 54 45 21 59
-56 37 9 50 32 75 79 31 77 9 61 1 8 68 6 60 81 7 100 99 14 61 48 25 73 26 70 72
-94 34 ^
-233 0 11 98 110 88 35 110 35 64 49 88 93 28 85 6 78 65 90 52 24 97 51 39 51 59
-23 1 3 49 33 11 78 27 35 55 64 5 102 4 70 25 56 58 38 66 11 31 96 66 104 59 41
-86 58 29 79 41 40 72 51 12 92 34 52 44 69 104 21 97 89 96 48 21 4 61 40 28 67
-34 23 85 44 22 62 52 33 84 23 30 73 74 4 79 12 81 47 80 53 47 89 40 19 80 62 34
-61 29 41 95 43 1 70 63 55 53 18 19 13 48 10 19 89 49 4 52 53 56 76 10 8 104 77
-15 28 38 75 109 3 85 90 8 40 8 93 90 43 39 14 60 17 36 78 56 105 80 35 75 36 58
-82 50 100 98 45 74 13 66 95 72 71 95 34 14 98 72 33 38 37 52 6 14 107 59 3 29
-61 67 98 92 5 93 17 98 36 87 41 75 71 57 88 17 25 91 84 3 58 20 92 69 51 50 36
-31 14 25 18 30 18 1 41 104 30 82 59 87 70 34 96 28 47 62 81 103 48 ^
-234 1 63 90 108 108 102 64 82 88 4 111 76 97 22 1 108 41 34 91 33 20 25 24 26 8
-83 11 31 7 85 109 106 4 105 85 68 28 33 99 53 8 16 12 11 74 17 83 66 70 16 30 9
-67 68 34 24 81 47 92 72 47 37 33 38 92 17 8 28 88 22 62 69 32 89 75 3 72 96 85
-13 105 24 38 37 94 115 83 72 108 114 24 93 76 103 60 99 102 9 43 10 59 95 46 33
-93 15 26 69 44 2 86 107 55 45 61 65 92 66 9 55 39 70 83 29 98 67 13 111 15 20
-31 62 8 2 51 20 19 33 44 14 115 71 112 97 10 41 28 53 51 26 57 15 38 98 55 106
-22 56 31 50 95 107 110 84 70 10 108 96 73 100 25 36 55 88 71 63 96 30 90 96 79
-22 7 30 23 28 59 89 8 51 99 47 86 34 18 43 65 98 104 107 49 7 79 71 8 57 21 29
-80 2 74 78 44 57 9 61 22 13 68 52 91 74 98 43 30 58 68 95 101 72 102 76 42 99
-61 ^
-249 0 27 117 45 119 80 2 59 52 8 76 20 94 102 69 96 42 46 106 67 9 110 89 71 69
-34 31 15 85 16 29 100 82 37 62 68 95 108 44 23 114 34 36 56 93 11 30 96 12 31
-67 14 114 14 66 70 30 81 46 53 119 85 6 104 47 92 72 70 5 70 15 115 68 105 33
-97 13 85 106 14 61 29 22 86 45 57 69 91 38 38 28 66 13 60 95 103 3 15 5 113 38
-23 62 5 65 94 107 73 104 37 47 102 117 3 78 35 7 95 56 78 45 52 28 46 43 37 32
-53 19 55 29 47 97 76 115 83 71 11 45 62 73 99 116 2 24 116 7 28 41 2 29 37 52
-23 5 118 79 31 57 89 61 24 101 78 50 93 73 41 7 33 45 47 24 1 48 73 36 3 25 87
-46 28 108 54 68 53 67 119 28 36 118 104 42 88 27 112 4 74 85 1 63 39 97 71 74
-75 76 10 49 12 79 11 50 103 118 94 117 118 37 27 12 94 60 28 51 47 82 110 17 15
-105 23 52 43 12 21 22 81 41 12 74 90 42 108 117 98 67 4 69 85 ^
-243 0 76 81 26 101 13 68 62 106 87 19 98 32 81 63 79 93 31 121 123 75 52 11 66
-41 54 87 38 5 104 62 51 38 55 29 31 120 44 16 48 94 46 105 91 66 78 27 43 6 64
-2 55 79 75 84 113 22 4 113 109 31 33 17 96 11 29 63 98 103 107 116 34 14 9 95
-38 18 51 75 33 109 118 55 66 4 76 7 75 70 82 74 23 1 26 69 40 112 99 47 65 31
-70 119 52 103 88 85 86 28 16 12 76 25 22 78 64 21 86 27 61 77 72 108 2 18 106
-119 121 54 16 85 72 2 73 26 88 66 60 80 35 24 117 63 24 44 67 52 122 119 33 72
-16 99 98 69 54 19 42 28 53 114 32 117 81 100 57 49 123 56 21 68 80 53 95 1 45
-95 107 98 87 1 27 24 99 116 16 67 1 113 91 84 25 40 25 72 3 28 90 87 112 80 16
-117 45 77 36 90 105 59 88 122 64 108 108 71 98 18 50 115 93 105 77 35 6 46 55
-47 102 4 26 87 111 120 81 113 4 57 105 3 84 94 115 61 73 ^
-255 1 91 47 51 9 57 9 55 94 61 61 68 46 107 6 35 81 114 78 96 74 14 89 73 67 67
-69 113 107 11 98 113 109 20 92 17 67 70 88 57 10 124 9 60 122 93 91 45 7 15 24
-51 5 98 115 24 49 90 104 117 66 128 94 64 80 12 43 91 46 111 59 58 77 30 14 88
-60 123 68 41 44 68 40 104 118 41 43 93 90 105 92 16 127 26 54 125 114 79 71 24
-48 21 25 118 40 103 49 91 44 67 65 25 119 109 18 48 23 69 112 38 61 64 87 84
-104 119 110 122 92 22 1 8 83 34 100 32 62 41 46 112 34 102 76 56 39 4 127 30 13
-19 110 124 7 16 128 95 4 124 11 104 116 126 49 95 3 55 96 70 90 101 4 122 96 75
-118 39 128 99 92 18 42 20 87 83 35 75 111 61 67 71 28 101 9 56 34 105 95 71 23
-73 71 26 57 15 23 76 55 99 89 128 98 117 68 43 88 62 38 62 39 2 83 36 15 26 60
-128 96 73 74 10 1 12 42 22 2 77 33 33 32 57 13 14 82 57 12 39 3 58 80 14 87 85
-44 69 109 119 ^
-283 0 102 55 53 41 60 88 25 67 58 76 44 22 68 118 108 40 95 96 81 90 85 28 77
-18 11 37 72 93 60 110 124 119 95 131 91 37 109 126 8 73 69 72 80 17 83 5 76 20
-32 15 10 1 103 18 22 116 98 9 51 104 102 44 33 15 12 24 31 89 1 6 28 101 8 64
-72 106 30 5 52 89 111 39 108 64 85 17 57 124 22 105 78 115 3 40 108 66 108 77
-128 103 44 35 38 13 95 10 111 63 98 117 61 51 126 69 96 70 70 59 39 13 97 33
-112 2 77 7 123 70 83 29 66 67 49 79 19 104 115 14 60 2 55 40 71 33 28 114 51 91
-17 46 45 128 57 87 62 25 115 38 50 55 90 74 8 51 102 79 43 94 36 122 94 12 41
-36 25 104 91 24 7 99 80 30 126 32 63 122 107 114 27 28 79 41 12 35 51 115 122
-70 22 79 65 2 88 27 17 59 15 23 44 57 5 65 6 26 78 80 125 93 84 100 45 22 129
-68 36 111 74 118 11 50 42 120 47 21 8 86 112 26 67 60 99 45 93 47 8 38 59 52 56
-124 20 82 18 117 24 18 46 106 19 117 26 41 47 45 130 7 15 1 4 5 100 10 85 50 44
-11 48 92 119 108 42 118 125 ^
-272 0 8 61 99 70 96 20 87 123 134 82 22 2 110 118 33 86 5 7 5 94 56 15 60 96 54
-13 22 55 99 4 25 105 17 37 69 10 38 117 117 30 70 13 9 109 115 62 94 52 66 117
-100 135 7 75 23 5 81 110 31 118 29 1 62 11 41 88 109 119 102 37 3 30 123 47 31
-56 134 29 124 116 118 99 21 56 77 91 23 37 135 81 44 51 67 95 51 133 30 57 67
-116 122 48 100 7 132 97 106 69 93 4 95 125 102 103 119 81 57 133 96 37 118 50
-117 113 81 127 17 45 103 32 121 129 60 43 65 127 30 36 132 110 52 53 35 71 12
-76 22 72 130 112 99 76 26 21 73 63 63 97 23 58 115 132 114 1 132 31 35 18 23 54
-30 53 118 37 35 84 94 60 100 3 47 18 110 105 87 57 63 76 43 52 45 46 49 65 12
-10 42 66 60 117 34 19 92 5 28 76 9 126 101 125 32 38 34 15 7 62 32 21 3 43 69
-31 109 123 51 116 135 130 129 130 63 14 57 80 62 15 126 31 105 83 108 120 80
-124 46 98 105 91 6 6 27 7 58 128 78 7 79 63 84 77 74 128 65 61 95 121 17 24 123
-117 51 122 ^
-284 0 44 71 43 20 126 58 53 47 98 18 19 119 93 29 70 39 94 112 44 115 135 98 82
-10 67 29 102 113 68 80 19 75 1 91 114 87 80 7 40 37 86 120 16 104 136 117 82
-138 32 65 114 119 137 121 8 12 46 126 26 119 73 130 60 76 113 100 14 133 26 116
-34 120 80 95 84 53 15 24 44 51 4 10 23 77 24 99 66 37 54 63 42 136 21 34 76 5
-17 128 101 1 59 40 113 112 32 97 31 93 105 79 91 18 39 1 103 132 51 68 124 111
-13 97 43 128 69 84 85 72 15 12 26 87 16 16 92 101 13 77 4 118 89 103 56 42 16
-60 44 39 126 46 18 83 93 41 105 3 82 106 115 91 6 4 54 115 15 120 109 113 48 41
-9 95 20 62 67 105 111 25 132 7 116 46 138 44 83 61 124 131 35 107 6 109 81 114
-67 41 137 77 56 74 73 34 12 14 69 52 11 98 47 54 83 81 6 1 15 88 35 139 80 83
-49 89 27 47 130 92 133 87 51 112 76 49 109 49 57 93 73 22 117 50 64 58 97 139
-36 131 111 133 58 33 8 88 55 38 90 46 30 118 57 29 82 74 41 117 38 46 94 92 5
-105 15 117 70 103 68 60 120 48 21 110 85 40 81 66 ^
-291 0 46 113 52 134 79 74 64 57 18 23 9 52 8 16 103 57 138 59 59 65 92 2 7 130
-92 8 34 40 86 131 140 100 112 4 42 1 110 108 43 37 15 67 19 35 94 61 130 98 35
-88 34 65 104 56 126 118 50 87 10 81 109 90 86 118 32 6 114 88 39 38 39 62 3 12
-134 72 137 35 75 81 115 106 140 112 11 123 41 103 45 95 84 71 107 13 26 110 96
-62 16 109 84 59 53 38 27 8 28 13 32 137 17 138 41 122 36 99 65 99 83 36 112 29
-49 70 96 126 136 131 116 3 18 17 126 142 14 37 141 141 123 42 13 20 83 42 139
-83 54 49 58 42 7 137 29 48 16 121 127 34 52 140 106 128 58 36 124 83 24 69 54
-61 112 17 6 95 97 24 57 86 124 59 71 119 67 1 109 54 68 49 57 132 32 5 71 113
-40 80 104 75 106 133 31 126 130 104 62 9 39 44 66 116 141 135 96 132 19 41 121
-126 124 77 8 4 60 82 6 101 124 89 51 123 48 40 85 77 21 112 10 69 66 115 87 16
-108 30 84 65 80 103 32 131 134 73 47 10 63 39 50 93 37 135 114 69 48 34 58 23
-27 133 37 9 40 98 41 115 99 70 83 29 42 67 133 55 79 80 91 122 12 2 115 112 47 ^
-293 1 33 13 99 138 1 42 89 118 87 113 99 12 134 142 100 38 5 55 75 14 110 108
-42 64 130 79 138 62 64 69 57 11 123 25 59 16 111 94 24 65 30 51 119 48 107 92
-84 69 28 136 143 54 20 6 70 47 142 64 4 65 59 73 99 134 146 102 125 116 57 137
-137 72 48 128 78 5 80 63 54 85 30 22 129 68 21 21 74 28 128 107 27 60 2 93 95
-71 37 11 37 15 39 102 3 104 65 80 59 52 113 34 20 67 60 27 81 135 46 106 106
-102 68 128 17 15 100 124 15 43 136 122 100 67 142 35 14 53 120 2 89 93 99 73 9
-122 39 77 15 96 90 43 79 134 60 92 105 55 96 31 119 77 97 72 23 140 38 30 43 83
-136 88 107 117 72 109 118 58 91 119 73 95 100 59 138 123 54 49 143 50 133 66
-106 45 80 88 42 93 5 59 77 101 74 110 104 40 92 19 77 76 86 102 129 3 144 101
-139 134 56 90 18 91 94 85 55 10 137 11 58 1 107 113 70 22 7 56 29 143 111 8 46
-45 116 122 129 89 7 121 53 95 14 49 118 62 125 91 37 97 15 35 100 63 140 63 50
-51 58 26 127 6 45 59 102 121 114 85 141 135 10 72 19 106 66 66 41 53 13 38 1 21
-103 50 108 46 119 ^
-297 1 46 31 132 112 28 63 124 97 129 43 40 72 99 107 132 137 96 139 99 145 121
-144 118 37 81 39 94 60 55 109 47 109 110 75 42 12 139 137 43 128 106 107 19 126
-12 101 148 127 15 117 125 125 62 96 13 76 70 96 101 110 138 8 95 76 143 17 32
-97 79 149 39 31 94 123 21 41 135 55 84 70 33 135 118 50 62 121 81 1 45 144 93
-60 5 64 137 8 105 91 82 67 27 113 119 53 18 98 79 48 84 32 135 128 5 1 20 76 17
-85 108 72 36 141 140 49 150 105 104 3 149 14 54 18 148 64 49 125 37 28 28 101
-22 104 91 32 82 117 12 114 69 58 2 58 115 9 108 47 59 65 14 92 7 4 86 98 16 82
-92 95 38 94 10 10 48 97 104 66 115 97 142 115 122 119 40 97 16 32 47 34 88 89
-26 50 12 76 80 51 40 9 133 24 44 40 122 84 108 22 142 140 99 44 15 54 8 42 125
-150 130 21 79 124 62 46 119 15 29 91 57 150 42 138 71 61 68 80 114 6 1 70 121
-18 35 113 56 87 86 10 73 14 29 41 72 89 1 133 87 101 123 59 90 142 77 133 52 78
-48 34 138 134 27 17 60 131 147 61 93 148 39 132 49 62 71 36 91 4 139 49 100 120
-43 113 144 30 94 73 127 40 125 ^
-313 1 35 97 95 76 105 88 32 138 30 69 61 40 47 21 107 6 39 81 114 53 125 53 147
-14 4 73 146 96 98 13 136 11 98 117 138 153 67 146 71 99 88 7 139 24 13 35 47 97
-145 74 36 119 3 51 84 48 119 53 49 15 79 17 120 103 148 64 30 41 97 120 75 111
-63 58 131 134 18 13 10 48 18 16 48 43 15 54 18 41 47 122 144 80 92 145 77 1 33
-89 54 46 78 48 21 54 43 40 53 24 16 73 42 94 29 44 34 151 152 23 123 12 142 140
-43 37 88 29 19 35 72 96 151 130 62 112 34 36 91 120 50 112 138 2 105 60 68 137
-131 5 17 19 139 74 11 120 78 149 58 128 15 104 16 126 78 20 57 134 71 49 90 76
-108 126 100 54 68 39 132 153 42 147 146 124 62 87 35 75 61 65 46 100 82 105 113
-31 63 5 95 54 71 77 127 150 80 36 144 2 130 59 74 39 3 152 121 122 18 117 12
-117 141 118 135 62 36 69 5 39 53 150 52 153 143 30 66 96 126 131 56 137 8 7 86
-142 14 7 111 141 93 136 137 134 43 12 89 23 44 9 152 146 121 97 19 38 110 91 67
-14 32 110 66 68 8 130 84 73 118 59 24 41 72 121 150 55 37 138 27 104 66 124 9
-51 109 47 125 109 148 8 29 47 72 146 149 61 93 10 20 54 15 76 133 125 106 110
-67 ^
-330 0 23 9 26 136 27 51 115 122 44 106 6 146 108 113 85 51 8 96 47 56 137 62 59
-89 143 71 140 14 85 156 139 99 154 30 53 115 35 147 108 148 58 52 28 103 19 92
-95 152 152 10 11 13 155 67 11 83 101 69 153 152 45 141 14 120 129 140 119 59 2
-89 73 70 83 29 16 67 81 29 1 54 65 96 117 2 37 47 128 33 3 89 108 98 139 49 78
-27 103 39 119 94 132 90 38 132 55 65 131 90 58 2 54 100 69 118 22 44 19 7 148
-93 25 29 123 81 64 131 55 30 1 89 38 97 82 64 9 28 86 123 151 10 133 40 154 102
-4 111 65 9 63 59 124 116 72 105 76 57 137 97 32 145 108 78 112 50 43 34 75 20
-22 129 68 11 118 74 125 118 57 17 20 129 53 65 61 144 1 17 142 156 52 100 54 15
-20 59 52 63 131 20 57 124 31 125 46 106 76 92 8 98 154 152 80 114 15 140 136
-112 100 17 92 25 151 150 80 99 69 83 49 43 156 102 19 57 122 96 30 3 39 134 40
-32 75 5 76 127 138 99 17 57 52 150 130 18 127 33 23 116 107 78 77 77 42 69 68
-48 41 69 33 75 40 49 128 103 4 146 93 10 83 66 96 152 30 38 12 33 5 39 47 41 34
-60 74 20 42 156 67 46 56 102 89 3 124 81 99 104 56 50 8 61 74 55 15 87 108 28
-138 47 93 60 2 124 46 126 103 91 145 36 25 116 122 51 ^
-322 0 75 7 107 158 81 105 154 90 20 125 77 114 69 92 7 58 21 98 154 50 128 149
-117 127 153 45 3 18 121 86 29 71 79 101 2 5 22 143 10 27 53 146 157 148 112 33
-22 80 123 24 147 1 112 82 159 63 74 97 109 33 151 32 89 87 132 117 46 129 59
-115 91 114 118 37 21 9 94 60 25 89 47 79 110 55 12 143 99 87 43 88 56 57 160 76
-12 71 128 77 146 117 95 105 42 66 3 76 20 76 101 100 118 149 45 26 143 148 32
-57 39 129 19 31 84 123 1 152 135 5 54 30 13 125 68 30 62 101 51 142 5 94 83 20
-116 24 107 109 105 91 42 17 27 93 69 3 139 68 79 38 84 2 85 128 126 122 131 46
-17 35 98 42 26 111 100 29 120 55 84 114 109 145 14 18 138 14 9 85 7 18 129 91 2
-94 51 133 82 87 123 64 39 8 103 38 75 110 78 7 9 45 115 42 138 135 86 78 16 62
-52 75 159 54 151 121 149 77 74 16 85 47 102 105 82 119 10 67 137 153 148 135 28
-49 26 151 153 36 80 11 130 113 24 44 30 102 24 58 133 122 140 99 24 156 54 119
-42 115 140 90 132 19 94 2 157 99 136 19 71 7 130 153 108 51 21 58 70 74 137 1
-40 111 149 5 103 6 27 76 141 23 125 140 1 72 29 152 103 87 51 93 29 80 132 77
-123 153 68 159 14 98 114 158 121 158 81 131 ^
-322 0 35 93 109 125 119 10 10 19 135 26 4 74 135 35 120 129 113 92 17 29 47 88
-14 159 149 87 45 36 75 68 22 138 20 59 61 144 151 11 107 6 153 81 114 43 85 157
-97 148 118 73 126 56 58 137 96 11 98 67 98 103 57 146 21 59 88 151 139 148 127
-25 17 47 115 34 160 109 107 51 64 28 69 13 49 149 69 141 90 93 118 64 10 1 67
-80 35 111 13 58 101 124 132 147 154 18 162 6 162 33 5 34 142 41 161 82 114 70
-92 145 57 155 137 114 79 44 36 48 48 21 14 13 40 33 14 150 33 32 54 143 14 4
-101 142 23 93 136 132 120 147 17 38 163 143 5 52 46 151 130 32 72 34 124 150 51
-100 112 128 126 65 10 28 87 81 159 131 19 99 54 125 110 58 119 28 78 129 104
-140 126 38 154 27 114 61 153 90 66 98 76 50 158 48 39 82 123 22 147 136 114 52
-37 35 75 41 15 150 60 52 55 103 21 23 129 95 24 71 47 97 130 50 140 144 106 100
-9 64 19 117 122 71 92 8 77 156 97 121 98 85 2 36 39 109 143 23 120 156 133 93
-154 36 66 116 131 160 127 162 161 46 142 14 141 81 141 63 86 117 104 3 146 39
-127 34 133 102 106 91 57 9 28 60 61 7 158 12 80 26 8 122 80 44 63 68 49 158 21
-32 81 150 15 141 108 161 64 46 124 123 31 99 27 105 109 98 112 144 ^
-336 1 34 161 107 149 48 67 138 109 156 104 37 133 60 80 84 81 160 9 16 96 164 1
-95 112 4 86 163 116 98 103 55 31 8 56 37 36 127 32 9 89 103 31 100 161 85 106
-119 89 154 43 115 162 137 108 128 38 42 155 103 9 62 65 102 122 10 138 160 125
-47 158 43 91 69 123 132 35 121 4 110 89 130 69 29 139 69 53 70 83 29 163 67 41
-9 108 34 45 76 87 2 144 164 98 33 160 79 78 48 89 9 38 134 93 146 79 54 122 80
-38 112 55 55 101 70 8 129 44 70 59 98 149 24 136 124 138 63 25 166 83 51 34 91
-45 30 118 59 28 87 72 44 116 28 36 103 101 113 10 114 62 111 71 65 126 53 19
-114 86 42 85 36 57 137 57 159 95 88 78 72 20 23 14 65 10 22 129 68 1 68 74 75
-108 7 7 147 109 13 35 51 104 158 164 122 126 2 50 4 132 127 59 52 13 81 20 47
-107 74 148 115 46 106 46 82 115 68 144 142 60 104 15 90 136 102 100 134 42 15
-141 100 40 49 49 73 166 13 156 82 166 37 82 96 137 130 166 134 20 139 45 122 56
-107 98 79 124 17 32 130 120 165 77 23 130 96 67 68 47 37 12 29 18 38 158 19 160
-55 147 39 118 83 121 96 43 137 33 66 86 112 147 155 149 140 5 19 17 148 161 10
-44 159 146 57 16 26 102 49 3 104 61 59 74 56 10 165 31 54 25 142 157 37 58 165
-128 154 73 50 149 94 137 ^
-330 1 61 51 65 132 23 169 116 122 14 66 7 98 131 72 69 127 72 163 125 68 69 51
-47 159 31 164 71 118 50 83 113 81 127 153 45 137 134 121 68 163 26 43 65 127
-166 138 98 144 18 53 137 139 148 76 158 4 62 78 167 102 144 94 55 141 63 29 97
-91 24 115 166 80 69 132 99 1 120 23 88 64 87 118 37 137 152 94 60 168 71 47 52
-110 37 155 125 63 42 43 52 11 12 151 31 12 44 110 32 128 117 68 87 24 39 164 76
-145 58 101 91 100 140 151 143 130 32 21 3 111 1 31 75 123 153 116 135 130 27
-164 165 116 23 12 62 83 24 133 139 49 74 154 80 158 80 64 105 91 6 142 27 75 24
-128 112 41 79 29 84 145 40 128 99 95 95 19 17 160 89 15 17 84 64 11 93 10 66 78
-73 127 148 18 129 139 143 49 150 9 84 82 154 85 15 88 82 60 87 19 12 133 58 20
-39 65 51 141 134 27 70 167 120 117 86 60 16 44 16 57 132 18 142 85 104 59 47
-141 58 2 66 96 46 119 153 40 110 126 103 90 144 13 26 106 144 80 145 134 103 95
-24 44 21 84 140 13 97 104 140 99 6 147 54 83 42 106 131 54 96 135 67 118 121 81
-109 10 53 132 112 117 81 33 155 49 61 38 119 1 13 102 131 148 94 131 143 67 123
-148 89 104 135 72 145 152 76 87 6 66 2 71 123 77 114 108 59 123 166 62 96 140
-94 149 116 169 ^
-349 0 125 17 93 82 80 110 156 147 156 99 154 4 29 90 163 120 84 113 56 8 157 29
-61 169 141 113 78 48 50 13 138 11 50 61 99 106 2 107 6 117 81 114 34 49 112 52
-130 82 73 108 20 22 110 60 11 98 22 62 58 48 146 149 23 88 142 139 121 91 16
-163 2 88 171 133 100 62 51 46 10 24 150 49 131 60 114 63 84 91 64 165 138 40 44
-172 111 141 58 74 115 96 129 145 164 153 170 126 24 169 16 115 41 125 46 87 61
-92 145 39 155 92 78 70 35 27 21 48 21 151 159 40 15 5 132 170 23 18 107 160 150
-56 133 23 66 109 123 102 102 172 166 145 116 151 34 1 151 130 5 36 34 97 114 15
-82 128 112 119 99 29 138 165 42 36 159 95 19 63 36 89 101 40 92 1 33 93 104 113
-126 2 136 96 52 108 90 57 89 31 5 113 30 39 37 96 4 147 127 105 43 165 35 75 23
-143 105 24 25 10 94 12 160 102 95 170 71 20 70 112 23 95 144 61 73 137 55 1 81
-95 26 65 172 41 147 79 103 80 40 121 36 12 64 98 169 93 111 115 48 127 9 39 107
-131 115 118 162 161 10 142 14 123 54 141 36 41 99 77 140 128 167 82 25 106 57
-70 64 21 19 15 34 126 149 167 53 163 127 86 35 8 54 23 40 140 3 169 45 150 152
-96 81 143 28 28 124 87 13 90 9 87 109 53 67 164 28 131 89 149 42 55 126 79 132
-74 19 133 30 68 72 75 148 9 10 72 152 144 83 106 153 74 163 98 152 ^
-375 1 94 28 13 8 20 28 18 118 5 140 89 67 171 64 152 85 61 101 80 154 149 34
-115 135 128 108 110 20 33 128 103 35 38 57 95 10 111 151 98 29 149 7 82 69 96
-114 26 103 171 101 53 121 24 2 121 51 35 70 83 29 154 67 5 167 63 16 27 58 60 2
-99 128 71 33 160 70 51 3 44 149 2 89 84 101 43 18 113 71 38 94 55 46 74 52 139
-102 35 43 50 80 122 6 100 88 129 36 25 148 47 24 7 55 36 30 82 32 19 78 63 26
-71 28 167 85 56 167 95 159 78 26 66 35 65 90 44 159 105 59 15 67 57 137 21 132
-50 70 78 36 169 5 172 56 1 22 129 68 168 23 74 30 99 138 174 120 91 153 8 42 68
-158 155 104 99 133 5 135 96 82 59 52 144 36 20 38 62 29 112 106 46 106 19 73 70
-41 135 133 42 95 15 45 136 93 100 98 173 6 132 55 4 4 31 64 130 162 156 64 157
-19 46 96 92 103 139 134 2 94 18 86 38 89 62 61 79 157 14 112 111 156 32 14 85
-78 31 59 20 1 161 169 149 29 122 150 133 37 102 30 109 65 85 51 174 110 164 66
-77 76 111 119 131 95 5 1 166 103 134 141 17 158 123 137 48 165 175 102 13 3 86
-43 23 47 56 150 165 4 36 174 115 157 168 13 147 119 109 55 41 140 67 27 31 27
-53 126 17 163 116 122 160 60 7 92 113 66 45 109 60 151 125 62 39 39 17 153 13
-152 53 94 50 53 89 57 127 153 45 119 104 121 56 145 172 19 41 103 166 108 68
-126 12 53 131 127 148 52 134 168 50 48 155 72 132 82 37 129 63 175 160 ^
-366 1 73 15 79 139 71 51 132 81 135 111 166 61 37 60 118 37 92 134 94 60 150 53
-47 25 110 19 137 107 27 176 43 16 145 146 142 165 12 17 92 166 110 117 41 69 6
-12 164 76 109 40 101 82 82 131 134 115 143 112 32 164 146 93 162 31 66 123 144
-80 135 94 137 156 107 157 173 62 65 176 124 112 4 65 127 44 131 53 19 105 91
-149 106 27 57 158 92 85 14 79 20 84 127 174 128 72 68 59 171 17 124 80 167 8 57
-28 172 66 144 48 42 37 109 121 18 120 103 116 13 132 39 73 145 76 158 43 82 33
-51 153 164 97 13 2 3 20 24 114 98 9 25 131 102 99 86 42 16 26 159 39 105 161
-133 49 59 41 20 105 31 136 30 87 10 119 135 13 83 99 58 45 99 156 26 61 135 143
-80 118 107 76 77 24 44 12 66 95 147 61 86 140 99 167 138 54 47 42 97 122 18 60
-90 40 73 85 63 82 1 35 96 94 81 54 15 128 40 52 2 101 1 165 93 113 130 85 95 98
-58 105 112 53 68 108 72 100 152 49 87 140 39 154 62 114 77 105 63 50 87 157 26
-78 122 67 140 71 170 119 5 93 64 50 104 144 129 138 75 130 4 178 60 139 120 54
-113 32 2 133 17 43 163 129 89 72 149 155 30 38 7 138 5 44 61 69 76 175 107 6 93
-81 114 28 25 82 22 118 58 73 96 175 177 92 36 11 98 171 38 28 42 146 125 178 88
-136 139 103 67 10 151 151 70 153 115 94 32 51 34 177 173 132 49 119 54 96 45 78
-73 64 159 120 22 20 154 111 117 58 56 109 72 143 ^
-372 1 136 146 144 170 90 15 169 180 88 41 89 10 60 52 92 145 21 155 47 42 61 26
-18 176 48 21 124 141 40 179 178 114 143 14 164 71 142 132 11 124 23 39 82 114
-84 57 163 130 127 89 133 16 138 151 130 160 34 70 78 161 64 92 112 110 72 175
-102 138 179 173 159 59 19 27 18 53 92 22 65 156 170 57 104 86 126 148 118 155
-78 43 63 90 48 80 168 142 68 12 39 174 69 168 147 118 96 34 129 35 75 5 107 60
-170 180 147 85 3 133 75 95 152 71 175 43 94 178 50 144 16 46 101 46 165 45 68
-163 38 172 5 138 61 85 62 177 76 36 167 19 53 151 66 66 97 3 100 164 12 98 131
-70 109 162 161 156 142 14 105 27 141 9 178 81 50 113 110 131 37 16 79 12 34 37
-167 173 10 152 7 81 140 158 26 136 82 50 172 154 45 160 31 122 167 142 9 150
-125 51 54 125 174 10 124 51 177 81 173 69 109 8 22 155 19 86 62 149 33 37 108
-34 96 29 174 133 167 50 54 66 130 9 1 36 134 108 65 97 126 56 163 71 83 88 10 1
-8 178 22 6 112 169 116 89 43 153 40 146 85 31 89 74 154 137 28 115 117 122 108
-98 8 27 110 103 176 17 20 27 77 10 93 145 80 17 143 165 76 69 78 102 20 91 171
-95 29 115 176 166 109 39 23 70 83 29 148 67 163 161 33 4 15 46 42 2 69 104 53
-33 160 64 33 155 14 131 160 59 78 71 19 176 107 65 38 82 55 40 56 40 115 84 29
-25 44 68 104 176 76 64 123 18 25 136 23 6 171 31 30 30 58 14 13 72 57 14 41 177
-^
-363 0 135 69 16 167 79 143 46 178 26 3 65 58 36 135 97 35 175 51 152 57 137 173
-108 10 54 78 4 153 173 164 48 177 22 129 68 168 167 74 174 91 106 174 96 75 129
-168 34 36 158 147 88 75 101 149 103 64 42 59 52 112 180 20 30 22 173 80 98 46
-106 179 65 30 17 127 125 26 87 15 5 136 85 100 66 141 182 124 15 156 148 15 56
-98 146 156 48 149 3 14 96 52 79 115 134 170 54 178 54 22 73 30 45 39 133 182 96
-103 148 176 6 45 62 183 51 180 153 145 145 117 21 90 118 109 21 62 22 101 49 53
-11 142 86 132 66 69 44 79 87 115 55 5 169 150 63 110 109 177 150 91 129 40 149
-159 102 165 3 70 27 175 23 56 126 165 164 20 158 91 157 136 157 131 111 69 39
-33 132 43 19 175 179 37 118 9 155 116 122 128 52 7 84 89 58 13 85 44 135 125 54
-183 23 161 145 173 136 29 62 50 13 57 25 127 153 45 95 64 121 40 121 140 171 9
-71 166 68 28 102 4 53 123 111 148 20 102 160 34 8 139 32 116 66 13 113 63 143
-97 63 10 59 124 66 41 132 71 115 106 151 46 22 45 118 37 67 124 94 60 140 43 47
-10 110 9 127 97 7 156 43 180 125 126 137 145 12 2 82 146 100 117 26 59 180 181
-164 76 89 30 101 77 72 126 114 95 143 102 32 149 131 83 157 31 61 123 139 60
-135 74 169 122 151 102 137 168 62 55 166 119 97 163 60 112 24 116 38 178 105 91
-134 86 27 47 138 72 70 183 79 15 84 117 154 128 57 53 39 161 88 ^
-393 1 92 72 151 33 183 164 42 112 32 10 5 93 97 18 112 71 92 168 116 179 186 65
-137 68 134 3 82 9 19 121 148 65 160 173 158 167 90 66 180 172 99 86 83 86 26 16
-10 135 23 81 137 125 17 19 25 183 73 7 104 185 79 165 119 119 176 59 75 18 5 59
-132 26 21 127 119 80 94 83 52 61 24 44 4 50 55 115 29 70 140 99 159 130 54 15
-42 89 114 173 28 50 16 33 53 47 58 180 19 64 78 49 30 186 104 32 44 157 85 1
-149 85 97 114 77 63 58 50 89 80 21 36 84 72 60 152 25 87 108 15 138 54 106 77
-97 23 42 55 149 181 62 106 43 132 31 138 111 176 93 40 10 96 128 105 114 43 98
-4 146 20 107 120 14 113 181 101 1 19 155 113 57 64 117 131 6 22 186 138 184 36
-61 29 36 175 107 6 61 81 114 20 180 42 169 102 26 73 80 151 153 68 4 11 98 139
-6 175 34 146 93 154 88 128 139 79 35 2 135 119 46 129 91 86 179 51 18 169 141
-108 49 103 46 72 21 70 49 64 151 96 185 175 130 111 85 58 32 101 40 101 131 136
-139 170 70 10 169 175 73 41 69 177 45 47 92 145 11 155 22 22 56 21 13 166 48 21
-109 131 40 174 178 104 128 9 149 51 132 122 173 119 23 24 67 109 74 32 158 110
-117 74 123 6 118 151 130 150 167 34 55 58 146 54 72 112 105 57 160 82 123 159
-153 159 39 19 7 8 33 87 12 50 146 150 37 104 71 126 133 108 145 68 38 38 90 43
-75 148 122 43 2 39 154 54 163 147 113 91 29 109 35 75 182 87 35 155 170 127 80
-185 118 60 95 142 71 165 28 84 168 25 144 178 31 81 41 160 25 53 143 ^
-381 1 14 172 163 130 45 69 46 145 36 36 151 169 13 135 42 26 81 153 76 148 178
-90 131 30 101 162 161 132 142 14 89 3 141 175 146 65 26 89 94 99 187 8 55 162 2
-13 143 173 2 120 173 41 132 150 2 112 42 18 140 130 37 128 23 106 159 118 167
-150 101 11 30 109 150 184 124 19 169 73 165 53 109 158 172 147 11 46 38 149 25
-21 92 184 64 179 158 133 135 34 38 58 114 9 183 4 118 76 49 89 102 40 163 47 75
-80 176 175 8 154 14 180 104 153 84 89 11 129 8 138 85 181 73 66 154 121 20 115
-93 114 108 82 182 19 86 103 176 183 186 177 53 10 69 137 56 1 135 141 68 69 54
-86 12 75 171 87 187 107 144 150 93 23 7 70 83 29 140 67 139 153 183 178 189 30
-18 2 29 72 29 33 160 56 9 123 164 107 136 19 70 31 177 152 99 57 38 66 55 32 32
-24 83 60 21 1 36 52 80 168 44 32 115 184 25 120 181 172 155 189 22 30 26 180 5
-64 49 188 1 28 111 57 176 167 67 131 22 160 186 169 65 34 30 117 91 17 163 39
-134 57 137 155 90 170 42 78 170 141 167 158 42 177 22 129 68 168 143 74 150 85
-82 174 78 63 111 156 28 12 158 141 76 57 77 125 79 40 12 59 52 88 156 20 24 182
-149 56 92 46 106 167 59 189 121 119 14 81 15 165 136 79 100 42 117 182 118 175
-138 124 3 50 74 134 156 36 143 181 180 96 22 61 97 134 164 24 166 30 10 61 6 33
-9 115 176 84 97 142 152 15 50 165 45 168 135 133 127 93 15 66 94 91 9 32 16 95
-37 29 171 118 68 108 66 63 20 55 186 ^
-396 1 97 10 5 160 132 18 83 73 159 141 55 120 31 131 141 102 138 3 52 9 148 189
-56 99 165 146 2 140 64 157 100 121 113 102 24 21 24 123 16 10 139 152 19 109
-146 116 122 92 43 7 75 62 49 170 58 26 117 125 45 147 5 125 136 155 118 2 26 50
-161 21 182 127 153 45 68 19 121 22 94 104 144 166 35 166 23 176 75 188 53 114
-93 148 177 66 151 16 156 121 180 98 48 179 95 63 107 97 45 1 23 97 57 23 132 53
-79 97 124 19 188 18 118 37 22 106 94 60 122 25 47 176 110 184 109 79 164 120 43
-153 89 90 128 109 12 168 64 110 82 117 192 41 171 163 164 76 53 12 101 68 54
-117 78 59 143 84 32 122 104 65 148 31 52 123 130 24 135 38 151 95 142 93 101
-159 62 37 148 110 70 127 51 85 181 89 11 142 105 91 107 50 27 29 102 36 43 165
-79 6 84 99 118 128 30 26 3 143 17 68 66 139 187 15 165 158 24 88 20 179 174 81
-79 18 106 47 74 150 104 179 162 59 131 62 116 166 82 184 188 97 136 41 136 167
-140 143 175 72 42 174 148 75 74 71 86 14 16 191 117 11 63 119 119 186 182 13
-171 49 182 80 167 73 147 119 107 164 41 57 181 168 29 114 26 184 121 101 80 76
-65 34 49 24 44 191 38 25 91 5 58 140 99 153 124 54 184 42 83 108 155 4 20 191 3
-29 35 40 180 7 40 66 25 12 180 86 26 38 139 73 1 137 79 85 102 71 39 28 44 77
-56 190 12 66 72 30 152 7 87 84 190 126 48 100 77 91 186 36 31 143 163 50 94 25
-126 1 114 105 170 93 22 173 90 116 87 96 19 74 4 122 183 83 120 177 113 169 181
-77 182 1 149 186 ^
-384 1 25 56 85 107 177 6 186 138 184 28 61 184 191 175 107 6 29 81 114 12 156 2
-137 86 189 73 64 127 129 44 167 11 98 107 169 143 26 146 61 130 88 120 139 55 3
-189 119 87 22 105 67 78 147 51 2 161 109 84 49 87 38 48 192 62 25 64 143 72 169
-151 106 111 53 58 8 93 8 85 123 120 131 170 38 2 169 167 49 41 37 153 21 39 92
-145 190 155 177 185 48 13 5 150 48 21 85 115 40 166 178 88 104 1 125 19 116 106
-141 111 23 43 101 58 187 150 78 101 50 107 185 86 151 130 134 143 34 31 26 122
-38 40 112 97 33 136 50 99 127 121 159 7 19 170 187 1 79 191 26 130 118 5 104 47
-126 109 92 129 52 30 193 90 35 67 116 90 3 181 39 122 30 155 147 105 83 21 77
-35 75 174 55 190 131 154 95 72 185 94 36 95 126 71 149 4 68 152 180 144 146 7
-49 33 152 188 29 111 194 172 148 125 35 59 36 125 11 36 141 149 183 125 27 1 71
-133 61 138 168 85 131 5 96 162 161 117 142 14 79 183 141 165 126 55 11 74 84 79
-167 3 40 142 177 193 128 173 192 100 163 16 127 145 182 97 17 193 120 115 32
-108 18 96 154 103 152 150 86 181 15 99 135 179 124 194 164 68 160 43 109 138
-152 142 6 21 23 149 20 11 82 164 44 159 148 133 115 24 28 53 104 9 183 179 108
-56 39 84 87 30 163 32 70 75 166 170 8 139 9 175 99 143 64 89 186 114 183 133 85
-161 63 61 154 111 15 115 78 109 108 72 177 14 71 103 176 173 176 157 38 10 54
-132 41 186 130 126 63 69 39 76 7 65 171 82 172 102 124 140 83 113 ^
-396 1 189 70 83 29 132 67 115 145 151 170 181 14 192 2 187 40 5 33 160 48 183
-91 132 83 112 177 62 189 153 128 91 49 38 50 55 24 8 8 51 36 13 175 28 36 56
-160 12 107 168 25 104 157 156 139 165 14 30 192 164 195 56 41 180 159 28 79 41
-144 167 51 115 188 136 154 145 65 2 22 93 83 191 147 23 110 57 137 131 66 138
-26 78 146 125 159 150 34 177 22 129 68 168 111 74 118 77 50 174 54 47 87 140 20
-178 158 133 60 33 45 93 47 8 170 59 52 56 124 20 16 150 117 24 84 46 106 151 51
-158 173 113 111 196 73 15 133 136 71 100 10 85 182 110 143 114 92 185 42 42 118
-156 20 135 173 156 96 180 37 73 134 156 182 150 196 192 45 172 17 167 91 168 68
-89 134 120 190 173 34 141 37 152 111 117 103 61 7 34 62 67 191 190 8 87 21 195
-139 86 44 76 66 55 186 23 31 87 183 5 155 122 191 68 53 149 136 35 115 26 121
-131 102 123 3 42 197 133 179 56 84 165 136 190 130 49 157 80 101 103 97 197 11
-19 118 1 5 119 137 9 104 193 141 116 122 72 38 7 70 47 44 155 43 16 107 125 40
-127 193 105 131 145 108 185 6 50 141 1 167 127 153 45 53 192 121 12 79 84 129
-151 15 166 196 156 60 188 53 109 83 148 162 46 146 6 136 111 160 88 38 169 85
-63 87 97 35 194 3 82 52 13 132 43 59 92 109 4 178 3 118 37 195 96 94 60 112 15
-47 166 110 179 99 69 149 100 43 138 69 70 123 89 12 158 54 90 72 117 182 31 166
-153 164 76 33 2 101 63 44 112 58 39 143 74 32 107 89 55 143 31 47 123 125 4 135
-18 141 80 137 88 81 154 187 ^
-406 0 23 134 103 49 99 44 64 160 68 190 114 105 91 86 22 27 15 74 8 22 151 79
-199 84 85 90 128 9 5 175 129 17 40 59 125 187 194 144 151 3 60 6 158 153 67 58
-18 99 19 53 129 90 179 134 52 124 55 95 138 82 170 167 69 122 13 108 160 119
-115 161 51 14 167 120 47 60 57 86 16 184 96 197 42 98 112 165 154 199 157 21
-168 52 146 66 126 119 93 150 20 36 153 140 194 93 26 156 114 80 80 55 44 13 35
-24 44 191 24 190 63 177 44 140 99 146 117 54 163 42 76 101 134 176 185 177 168
-1 21 19 180 193 12 52 197 191 173 65 19 31 118 59 1 123 72 71 88 64 11 193 37
-63 28 169 184 45 72 195 152 186 87 56 176 112 41 93 77 84 158 29 3 136 142 36
-80 4 119 166 86 98 163 93 1 145 83 102 66 75 191 46 4 94 155 55 120 149 113 148
-181 49 175 180 142 87 5 51 65 92 167 196 186 138 184 23 61 164 171 175 107 6 9
-81 114 7 141 177 117 76 174 73 54 112 114 29 152 11 98 87 154 123 21 146 41 115
-88 115 139 40 183 189 109 67 7 90 52 73 127 51 192 156 89 69 49 77 33 33 182 57
-10 64 138 57 159 136 91 111 33 58 193 88 188 75 118 110 126 170 18 197 169 162
-34 41 17 138 6 34 92 145 185 155 157 170 43 8 140 48 21 70 105 40 161 178 78 89
-196 110 199 106 96 121 106 23 185 28 96 48 167 145 58 91 35 97 180 66 151 130
-124 128 34 16 6 107 28 20 112 92 18 121 30 84 107 101 159 187 19 155 182 181 74
-186 11 120 98 185 104 32 126 94 82 119 42 25 173 90 30 62 96 70 178 176 39 102
-15 150 147 100 78 16 57 35 75 169 35 170 116 144 75 146 ^
-409 1 185 70 12 95 110 71 133 183 52 136 148 144 114 186 17 25 144 164 5 79 178
-172 124 117 19 43 20 93 174 36 125 117 151 109 3 164 55 101 37 122 152 77 131
-168 88 162 161 93 142 14 63 167 141 149 94 39 190 50 68 47 135 198 16 110 153
-177 104 173 192 68 147 179 119 137 166 73 180 169 88 91 24 76 10 80 146 79 128
-150 62 149 194 83 111 171 124 170 156 60 152 27 109 106 120 134 201 184 202 149
-12 198 66 132 12 127 132 133 83 8 12 45 88 9 183 155 92 24 23 76 63 14 163 8 62
-67 150 162 8 115 1 167 91 127 32 89 162 90 159 125 85 129 47 53 154 95 7 115 54
-101 108 56 169 6 47 103 176 157 160 125 14 10 30 124 17 178 122 102 55 69 15 60
-202 49 171 74 148 94 92 124 67 200 184 70 83 29 127 67 100 140 131 165 176 4
-182 2 167 20 193 33 160 43 173 71 112 68 97 157 57 169 138 113 86 44 38 40 55
-19 196 201 31 21 8 165 23 26 41 155 195 183 102 158 25 94 142 146 129 150 9 30
-177 154 195 51 36 175 139 28 59 31 124 167 41 105 173 121 134 130 65 185 17 78
-78 181 137 13 95 57 137 116 51 118 16 78 131 115 154 145 29 177 22 129 68 168
-91 74 98 72 30 174 39 37 72 130 15 163 158 128 50 18 25 73 27 191 150 59 52 36
-104 20 11 130 97 4 79 46 106 141 46 138 163 108 106 191 68 15 113 136 66 100
-193 65 182 105 123 99 72 180 37 22 108 156 10 130 168 141 96 160 22 58 134 151
-162 140 181 187 35 157 7 147 76 163 58 84 129 100 190 153 24 126 32 142 96 107
-88 41 2 14 42 52 186 170 3 82 11 180 119 66 29 56 66 50 171 3 11 77 163 5 150
-112 128 ^
-413 1 47 25 135 129 7 108 19 107 117 102 102 3 28 190 112 165 56 63 165 122 183
-116 28 157 52 73 89 90 169 202 12 111 185 203 91 116 200 97 193 134 116 122 44
-31 7 63 26 37 134 22 2 93 125 33 99 186 77 124 131 94 171 183 50 113 178 146
-127 153 45 32 164 121 203 58 56 108 130 192 166 168 128 39 188 53 102 69 148
-141 18 139 197 108 97 132 74 24 155 71 63 59 97 21 194 180 61 45 204 132 29 31
-85 88 188 164 187 118 37 167 82 94 60 98 1 47 152 110 172 85 55 128 72 43 117
-41 42 116 61 12 144 40 62 58 117 168 17 159 139 164 76 5 193 101 56 30 105 30
-11 143 60 32 86 68 41 136 31 40 123 118 181 135 195 127 59 130 81 53 147 62 13
-124 98 34 79 39 49 145 53 180 94 105 91 71 2 27 5 54 193 7 141 79 199 84 75 70
-128 199 195 160 119 17 20 54 115 187 184 129 146 193 40 201 143 138 57 43 18 94
-204 38 114 80 179 114 47 119 50 80 118 82 160 152 49 112 198 88 155 104 95 151
-36 199 162 100 27 50 47 86 195 16 179 81 192 27 83 107 150 134 194 147 1 158 32
-131 61 111 119 83 140 5 21 133 120 174 78 26 136 109 65 80 40 29 203 25 24 44
-191 14 170 43 162 34 140 99 141 112 54 148 42 71 96 119 161 165 167 148 186 11
-4 180 188 197 42 182 181 168 50 14 26 103 49 1 113 67 61 78 59 196 173 32 53 8
-154 169 30 72 175 152 176 87 36 166 102 36 88 77 79 138 24 188 131 127 26 70
-194 114 146 66 93 158 93 191 125 78 92 51 60 176 26 4 74 135 35 120 129 113 133
-181 29 170 170 137 77 190 46 45 77 157 191 186 138 184 18 61 144 151 175 107 6
-194 81 114 2 126 110 ^
-427 1 85 60 150 73 38 88 90 5 128 11 98 55 130 91 13 146 9 91 88 107 139 16 159
-189 93 35 191 66 28 65 95 51 184 148 57 45 49 61 25 9 166 49 194 64 130 33 143
-112 67 111 1 58 177 80 164 59 110 94 118 170 194 197 169 154 10 41 193 114 190
-26 92 145 177 155 125 146 35 200 124 48 21 46 89 40 153 178 62 65 196 86 175 90
-80 89 98 23 169 4 88 32 135 137 26 75 11 81 172 34 151 130 108 104 34 200 182
-83 12 196 112 84 202 97 206 60 75 69 159 163 19 131 174 157 66 178 195 104 66
-161 104 8 126 70 66 103 26 17 141 90 22 54 64 38 146 168 39 70 199 142 147 92
-70 8 25 35 75 161 3 138 92 128 43 59 185 55 205 95 100 71 123 173 42 126 128
-144 94 176 205 20 139 149 198 59 168 172 109 112 9 33 10 73 154 36 115 97 131
-99 196 144 45 81 22 112 142 72 131 148 83 162 161 78 142 14 53 157 141 139 74
-29 180 35 58 27 115 198 1 90 138 167 89 173 192 48 137 159 114 132 156 58 160
-154 68 76 19 56 5 70 141 64 113 150 47 129 184 73 96 166 124 155 151 55 147 17
-109 86 100 129 201 164 192 149 7 193 56 112 200 107 122 133 63 206 2 40 78 9
-183 140 82 4 13 71 48 4 163 201 57 62 140 157 8 100 204 162 86 117 12 89 147 75
-144 120 85 109 37 48 154 85 2 115 39 96 108 46 164 1 32 103 176 147 150 105 207
-10 15 119 2 173 117 87 50 69 50 202 39 171 69 133 89 72 114 57 195 179 70 83 29
-122 67 85 135 111 160 171 202 172 2 147 183 33 160 38 163 51 92 53 82 137 52
-149 123 98 81 39 38 30 55 14 186 196 11 6 3 155 18 16 26 150 180 168 97 148 25
-84 127 136 119 135 4 30 162 144 195 46 31 170 119 28 190 ^
-443 1 17 96 167 27 91 152 100 106 109 65 164 10 57 71 167 123 209 74 57 137 95
-30 90 2 78 110 101 147 138 22 177 22 129 68 168 63 74 70 65 2 174 18 23 51 116
-8 142 158 121 36 207 207 45 209 170 122 59 52 8 76 20 4 102 69 186 72 46 106
-127 39 110 149 101 99 184 61 15 85 136 59 100 172 37 182 98 95 78 44 173 30 204
-94 156 206 123 161 120 96 132 1 37 134 144 134 126 160 180 21 136 203 119 55
-156 44 77 122 72 190 125 10 105 25 128 75 93 67 13 205 196 14 31 179 142 206 75
-207 159 91 38 8 28 66 43 150 185 193 63 135 5 143 98 143 32 5 125 124 197 103
-14 97 107 102 87 3 18 185 97 155 56 48 165 112 178 106 13 157 32 53 79 85 149
-197 7 106 175 203 71 101 195 92 193 129 116 122 24 26 7 58 11 32 119 7 202 83
-125 28 79 181 57 119 121 84 161 168 50 93 163 131 127 153 45 17 144 121 198 43
-36 93 115 177 166 148 108 24 188 53 97 59 148 126 208 134 192 88 87 112 64 14
-145 61 63 39 97 11 194 165 46 40 199 132 19 11 80 73 178 154 177 118 37 147 72
-94 60 88 201 47 142 110 167 75 45 113 52 43 102 21 22 111 41 12 134 30 42 48
-117 158 7 154 129 164 76 195 188 101 51 20 100 10 201 143 50 32 71 53 31 131 31
-35 123 113 166 135 180 117 44 125 76 33 142 62 3 114 93 19 59 34 34 130 38 170
-74 105 91 56 192 27 205 34 178 202 131 79 199 84 65 50 128 189 185 145 109 17
-49 105 187 174 114 141 183 20 196 128 123 47 28 18 89 189 23 99 70 179 94 42
-114 45 65 98 82 150 137 29 102 183 68 150 89 75 141 21 184 157 80 7 40 37 86
-190 16 174 66 187 12 68 102 135 114 189 137 191 148 12 116 56 96 119 73 130 200
-6 113 100 154 63 26 116 104 50 80 25 14 193 83 ^
-436 1 24 44 191 211 138 11 138 18 140 99 133 104 54 124 42 63 88 95 137 133 151
-116 162 208 193 180 180 173 26 158 165 160 26 6 18 79 33 1 97 59 45 62 51 172
-141 24 37 189 130 145 6 72 143 152 160 87 4 150 86 28 80 77 71 106 16 164 123
-103 10 54 178 106 114 34 85 150 93 175 93 70 76 27 36 152 207 4 42 103 3 120 97
-113 109 181 210 162 154 129 61 166 38 13 53 141 183 186 138 184 10 61 112 119
-175 107 6 170 81 114 207 102 125 65 50 135 73 28 73 75 203 113 11 98 35 115 71
-8 146 202 76 88 102 139 1 144 189 83 15 181 51 13 60 75 51 179 143 37 30 49 51
-20 207 156 44 184 64 125 18 133 97 52 111 194 58 167 75 149 49 105 84 113 170
-179 197 169 149 208 41 178 99 180 21 92 145 172 155 105 131 30 208 200 114 48
-21 31 79 40 148 178 52 50 196 71 160 80 70 69 93 23 159 202 83 22 115 132 6 65
-209 71 167 14 151 130 98 89 34 190 167 68 2 181 112 79 192 82 191 45 55 49 159
-148 19 116 169 142 61 173 185 94 46 146 104 206 126 55 56 93 16 12 121 90 17 49
-44 18 126 163 39 50 189 137 147 87 65 3 5 35 75 156 196 118 77 118 23 54 185 40
-195 95 90 71 113 163 32 116 108 144 74 166 190 15 134 134 188 39 158 172 94 107
-212 23 53 134 36 105 77 111 89 186 124 35 61 7 102 132 67 131 128 78 162 161 63
-142 14 43 147 141 129 54 19 170 20 48 7 95 198 199 70 123 157 74 173 192 28 127
-139 109 127 146 43 140 139 48 61 14 36 60 136 49 98 150 32 109 174 63 81 161
-124 140 146 50 142 7 109 66 80 124 201 144 182 149 2 188 46 92 185 87 112 133
-43 201 205 35 68 9 183 125 72 197 3 66 33 207 163 191 52 57 130 152 8 85 204
-157 81 107 205 187 ^
-462 1 126 54 123 113 85 81 23 41 154 71 210 115 18 89 108 32 157 209 11 103 176
-133 136 77 193 10 209 112 196 166 110 66 43 69 194 36 202 25 171 62 112 82 44
-100 43 188 172 70 83 29 115 67 64 128 83 153 164 195 158 2 119 187 169 33 160
-31 149 23 64 32 61 109 45 121 102 77 74 32 38 16 55 7 172 189 198 200 211 141
-11 2 5 143 159 147 90 134 25 70 106 122 105 114 212 30 141 130 195 39 24 163 91
-28 11 7 76 167 17 81 137 85 86 94 65 149 5 42 66 157 113 204 59 57 137 80 15 70
-207 78 95 91 142 133 17 177 22 129 68 168 43 74 50 60 197 174 3 13 36 106 3 127
-158 116 26 197 192 25 194 155 102 59 52 203 56 20 214 82 49 171 67 46 106 117
-34 90 139 96 94 179 56 15 65 136 54 100 157 17 182 93 75 63 24 168 25 189 84
-156 201 118 156 105 96 112 201 22 134 139 114 116 145 175 11 121 198 99 40 151
-34 72 117 52 190 105 90 20 118 60 83 52 208 205 181 209 16 174 122 206 70 202
-144 71 18 208 8 66 38 135 170 178 53 115 5 138 88 123 17 200 115 119 182 98 9
-87 97 102 72 3 8 180 82 145 56 33 165 102 173 96 213 157 12 33 69 80 129 192 2
-101 165 203 51 86 190 87 193 124 116 122 4 21 7 53 211 27 104 207 197 73 125 23
-59 176 37 114 111 74 151 153 50 73 148 116 127 153 45 2 124 121 193 28 16 78
-100 162 166 128 88 9 188 53 92 49 148 111 193 129 187 68 77 92 54 4 135 51 63
-19 97 1 194 150 31 35 194 132 9 206 75 58 168 144 167 118 37 127 62 94 60 78
-196 47 132 110 162 65 35 98 32 43 87 1 2 106 21 12 124 20 22 38 117 148 212 149
-119 164 76 180 183 101 46 10 95 205 186 143 40 32 56 38 21 126 31 30 123 108
-151 135 165 107 29 120 71 13 137 62 208 104 88 4 39 29 19 115 23 160 54 105 91
-41 177 27 200 14 163 124 ^
-453 0 115 79 199 84 49 18 128 173 169 121 93 17 186 41 89 187 158 90 133 167
-206 188 104 99 31 4 18 81 165 217 75 54 179 62 34 106 37 41 66 82 134 113 215
-86 159 36 142 65 43 125 215 160 149 48 193 24 21 86 182 16 166 42 179 206 44 94
-111 82 181 121 167 132 198 92 48 72 119 57 114 184 200 81 68 122 39 26 84 96 26
-80 1 208 177 217 24 44 191 206 118 209 123 8 140 99 128 99 54 109 42 58 83 80
-122 113 141 96 147 203 183 180 175 158 16 143 155 155 11 1 13 64 23 1 87 54 35
-52 46 157 121 19 27 174 115 130 209 72 123 152 150 87 202 140 76 23 75 77 66 86
-11 149 118 88 44 168 101 94 14 80 145 93 165 73 65 66 12 21 137 192 4 22 83 201
-120 77 113 94 181 195 157 144 124 51 151 33 211 38 131 178 186 138 184 5 61 92
-99 175 107 6 155 81 114 207 87 105 45 40 120 73 18 58 60 193 98 11 98 15 100 51
-3 146 187 61 88 97 139 204 129 189 73 213 171 36 216 55 55 51 174 138 17 15 49
-41 15 197 146 39 174 64 120 3 123 82 37 111 179 58 157 70 134 39 100 74 108 170
-164 197 169 144 198 41 163 84 170 16 92 145 167 155 85 116 25 208 200 104 48 21
-16 69 40 143 178 42 35 196 56 145 70 60 49 88 23 149 192 78 12 95 127 204 55
-199 61 162 212 151 130 88 74 34 180 152 53 210 166 112 74 182 67 176 30 35 29
-159 133 19 101 164 127 56 168 175 84 26 131 104 196 126 40 46 83 6 7 101 90 12
-44 24 216 106 158 39 30 179 132 147 82 60 216 203 35 75 151 181 98 62 108 3 49
-185 25 185 95 80 71 103 153 22 106 88 144 54 156 175 10 129 119 178 19 148 172
-79 102 207 13 208 33 114 36 95 57 91 79 176 104 25 41 210 92 122 62 131 108 73
-162 161 48 142 14 33 137 141 119 34 9 160 5 38 205 75 198 189 50 108 112 ^
-454 1 53 173 192 113 111 102 120 132 22 112 118 20 40 7 8 213 46 129 28 77 150
-11 81 160 49 60 154 124 119 139 43 135 213 109 38 52 117 201 116 168 149 215
-181 32 64 164 59 98 133 15 194 198 28 54 9 183 104 58 176 209 59 12 200 163 177
-45 50 116 145 8 64 204 150 74 93 184 89 111 39 108 108 85 61 13 36 154 61 210
-115 3 84 108 22 152 209 216 103 176 123 126 57 183 10 199 107 186 161 105 51 38
-69 184 26 202 15 171 57 97 77 24 90 33 183 167 70 83 29 110 67 49 123 63 148
-159 190 148 2 99 172 159 33 160 26 139 3 44 17 46 89 40 101 87 62 69 27 38 6 55
-2 162 184 183 190 211 131 6 212 210 138 144 132 85 124 25 60 91 112 95 99 212
-30 126 120 195 34 19 158 71 28 211 217 56 167 7 71 122 70 66 79 65 134 27 61
-147 103 199 44 57 137 65 50 202 78 80 81 137 128 12 177 22 129 68 168 23 74 30
-55 182 174 208 3 21 96 218 112 158 111 16 187 177 5 179 140 82 59 52 188 36 20
-214 62 29 156 62 46 106 107 29 70 129 91 89 174 51 15 45 136 49 100 142 217 182
-88 55 48 4 163 20 174 74 156 196 113 151 90 96 92 191 7 134 134 94 106 130 170
-1 106 193 79 25 146 24 67 112 32 190 85 210 75 15 108 45 73 37 193 205 166 194
-1 169 102 206 65 197 129 51 218 198 208 66 33 120 155 163 43 95 5 133 78 103 2
-185 105 114 167 93 4 77 87 102 57 3 218 175 67 135 56 18 165 92 168 86 203 157
-212 13 59 75 109 187 217 96 155 203 31 71 185 82 193 119 116 122 204 16 7 48
-201 22 89 197 192 63 125 18 39 171 17 109 101 64 141 138 50 53 133 101 127 153
-45 207 104 121 188 13 216 63 85 147 166 108 68 214 188 53 87 39 148 96 178 124
-182 48 67 72 44 214 125 41 63 219 97 211 194 135 16 30 189 132 219 191 70 43
-158 181 ^
-475 0 153 118 37 99 48 94 60 64 189 47 118 110 155 51 21 77 4 43 66 195 196 99
-215 12 110 6 216 24 117 134 205 142 105 164 76 159 176 101 39 218 88 184 165
-143 26 32 35 17 7 119 31 23 123 101 130 135 144 93 8 113 64 207 130 62 201 90
-81 205 11 22 220 94 2 146 26 105 91 20 156 27 193 208 142 178 107 79 199 84 41
-2 128 165 161 109 85 17 174 37 81 187 150 78 129 159 194 184 92 87 23 214 18 77
-153 209 63 46 179 46 30 102 33 29 50 82 126 101 203 78 147 20 138 53 27 117 207
-148 145 32 181 16 13 86 178 16 162 30 175 198 32 90 99 66 177 113 155 124 186
-80 44 60 119 49 106 176 192 65 52 106 27 26 68 92 14 80 211 200 169 213 24 44
-191 202 102 197 111 140 99 124 95 54 97 42 54 79 68 110 97 133 80 135 199 175
-180 171 146 8 131 147 151 221 219 9 52 15 1 79 50 27 44 42 145 105 15 19 162
-103 118 201 72 107 152 142 87 190 132 68 19 71 77 62 70 7 137 114 76 214 36 160
-97 78 220 76 141 93 157 57 61 58 9 125 180 4 6 67 189 120 61 113 82 181 183 153
-136 120 43 139 29 199 26 123 174 186 138 184 1 61 76 83 175 107 6 143 81 114
-207 75 89 29 32 108 73 10 46 48 185 86 11 98 221 88 35 221 146 175 49 88 93 139
-196 117 189 65 201 163 24 208 51 39 51 170 134 1 3 49 33 11 189 138 35 166 64
-116 213 115 70 25 111 167 58 149 66 122 31 96 66 104 170 152 197 169 140 190 41
-151 72 162 12 92 145 163 155 69 104 21 208 200 96 48 21 4 61 40 139 178 34 23
-196 44 133 62 52 33 84 23 141 184 74 4 79 123 192 47 191 53 158 200 151 130 80
-62 34 172 140 41 206 154 112 70 174 55 164 18 19 13 159 121 19 89 160 115 52
-164 167 76 10 119 104 188 126 28 38 75 220 3 85 90 8 40 8 204 90 154 39 14 171
-128 147 78 56 216 191 35 75 147 169 82 50 100 209 45 185 13 177 95 150 ^
-471 0 71 89 139 8 92 60 144 26 142 154 3 122 98 164 216 134 172 58 95 200 224
-201 5 86 36 81 29 63 65 162 76 11 13 196 78 108 55 131 80 66 162 161 27 142 14
-19 123 141 105 6 220 146 209 24 184 47 198 175 22 87 133 38 173 192 205 103 91
-97 115 122 7 92 103 25 2 213 213 36 124 13 62 150 221 61 150 39 45 149 124 104
-134 38 130 208 109 18 32 112 201 96 158 149 215 176 22 44 149 39 88 133 220 189
-193 23 44 9 183 89 48 161 204 54 222 195 163 167 40 45 106 140 8 49 204 145 69
-83 169 89 96 24 93 103 85 41 3 31 154 51 210 115 213 79 108 12 147 209 206 103
-176 113 116 37 173 10 189 102 176 156 100 36 33 69 174 16 202 5 171 52 82 72 4
-80 23 178 162 70 83 29 105 67 34 118 43 143 154 185 138 2 79 157 149 33 160 21
-129 208 24 2 31 69 35 81 72 47 64 22 38 221 55 222 152 179 168 180 211 121 1
-207 200 133 129 117 80 114 25 50 76 102 85 84 212 30 111 110 195 29 14 153 51
-28 196 212 36 167 222 61 107 55 46 64 65 119 220 12 56 137 93 194 29 57 137 50
-210 30 197 78 65 71 132 123 7 177 22 129 68 168 3 74 10 50 167 174 198 218 6 86
-218 97 158 106 6 177 162 210 164 125 62 59 52 173 16 20 214 42 9 141 57 46 106
-97 24 50 119 86 84 169 46 15 25 136 44 100 127 202 182 83 35 33 209 158 15 159
-64 156 191 108 146 75 96 72 181 217 134 129 74 96 115 165 216 91 188 59 10 141
-14 62 107 12 190 65 205 60 10 98 30 63 22 178 205 151 179 211 164 82 206 60 192
-114 31 203 188 193 66 28 105 140 148 33 75 5 128 68 83 212 170 95 109 152 88
-224 67 77 102 42 3 213 170 52 125 56 3 165 82 163 76 193 157 197 218 49 70 89
-182 217 91 145 203 11 56 180 77 193 114 116 122 189 11 7 43 191 17 74 187 187
-53 125 13 19 166 222 104 91 54 131 123 50 33 118 86 127 167 ^
-480 1 45 193 76 121 181 219 195 42 64 126 166 80 40 200 188 53 80 25 148 75 157
-117 175 20 53 44 30 207 111 27 63 198 97 204 194 114 222 23 182 132 212 170 63
-22 144 120 143 118 37 79 38 94 60 54 184 47 108 110 150 41 11 62 211 43 51 180
-181 94 200 12 100 223 201 14 117 124 200 137 95 164 76 144 171 101 34 213 83
-169 150 143 16 32 20 2 224 114 31 18 123 96 115 135 129 83 220 108 59 192 125
-62 196 80 76 195 218 17 210 79 214 136 6 105 91 5 141 27 188 193 127 168 97 79
-199 84 31 209 128 155 151 94 75 17 159 32 71 187 140 63 124 149 179 179 77 72
-13 204 18 72 138 199 48 36 179 26 25 97 28 14 30 82 116 86 188 68 132 133 38 7
-107 197 133 140 12 166 6 3 86 173 16 157 15 170 188 17 85 84 46 172 103 140 114
-171 65 39 45 119 39 96 166 182 45 32 86 12 26 48 87 226 80 201 190 159 208 24
-44 191 197 82 182 96 217 140 99 119 90 54 82 42 49 74 53 95 77 123 60 120 194
-165 180 166 131 225 116 137 146 211 219 4 37 5 1 69 45 17 34 37 130 85 10 9 147
-88 103 191 72 87 152 132 87 175 122 58 14 66 77 57 50 2 122 109 61 209 26 150
-92 58 205 71 136 93 147 37 56 48 212 221 110 165 4 213 47 174 120 41 113 67 181
-168 148 126 115 33 124 24 184 11 113 169 186 138 184 223 61 56 63 175 107 6 128
-81 114 207 60 69 9 22 93 73 31 33 175 71 11 98 206 73 15 221 146 160 34 88 88
-139 186 102 189 55 186 153 9 198 46 19 51 165 129 208 215 49 23 6 179 128 30
-156 64 111 203 105 55 10 111 152 58 139 61 107 21 91 56 99 170 137 197 169 135
-180 41 136 57 152 7 92 145 158 155 49 89 16 208 200 86 48 21 216 51 40 134 178
-24 8 196 29 118 52 42 13 79 23 131 174 69 221 59 118 177 37 181 43 153 185 151
-130 70 47 34 162 125 26 201 139 112 65 164 40 149 3 226 220 159 106 19 74 155
-100 47 159 157 193 ^
-471 0 211 98 104 174 126 7 24 61 213 225 57 90 1 33 209 183 62 147 39 215 157
-121 147 71 49 216 170 35 75 140 148 54 29 86 188 38 185 221 163 95 58 71 81 131
-84 44 144 10 134 142 228 118 86 156 204 126 172 46 91 196 220 197 218 70 36 73
-13 47 57 154 60 3 226 188 70 100 51 131 64 62 162 161 15 142 14 11 115 141 97
-219 216 138 201 16 172 31 198 167 6 75 125 26 173 192 193 95 75 93 111 114 224
-76 91 213 13 227 201 213 28 120 1 50 150 213 45 142 31 33 145 124 92 130 34 126
-204 109 2 16 108 201 80 150 149 215 172 14 28 137 23 80 133 208 185 189 19 36 9
-183 77 40 149 200 50 214 191 163 159 36 41 98 136 8 37 204 141 65 75 157 89 84
-12 81 99 85 25 224 27 154 43 210 115 205 75 108 4 143 209 198 103 176 105 108
-21 165 10 181 98 168 152 96 24 29 69 166 8 202 226 171 48 70 68 217 72 15 174
-158 70 83 29 101 67 22 114 27 139 150 181 130 2 63 145 141 33 160 17 121 196 8
-219 19 53 31 65 60 35 60 18 38 217 55 222 144 175 156 172 211 113 226 203 192
-129 117 105 76 106 25 42 64 94 77 72 212 30 99 102 195 25 10 149 35 28 184 208
-20 167 218 53 95 43 30 52 65 107 220 52 129 85 190 17 57 137 38 202 14 193 78
-53 63 128 119 3 177 22 129 68 168 216 74 223 46 155 174 190 214 223 78 218 85
-158 102 227 169 150 198 152 113 46 59 52 161 20 214 26 222 129 53 46 106 89 20
-34 111 82 80 165 42 15 9 136 40 100 115 190 182 79 19 21 197 154 11 147 56 156
-187 104 142 63 96 56 173 209 134 125 58 88 103 161 212 79 184 43 227 137 6 58
-103 225 190 49 201 48 6 90 18 55 10 166 205 139 167 203 160 66 206 56 188 102
-15 191 180 181 66 24 93 128 136 25 59 5 124 60 67 204 158 87 105 140 84 224 59
-69 102 30 3 209 166 40 117 56 220 165 74 159 68 185 157 185 206 41 66 167 ^
-490 1 176 217 85 133 203 218 38 174 71 193 108 116 122 171 5 7 37 179 11 56 175
-181 41 125 7 226 160 204 98 79 42 119 105 50 9 100 68 127 153 45 185 60 121 177
-211 183 30 52 114 166 64 24 192 188 53 76 17 148 63 145 113 171 4 45 28 22 203
-103 19 63 186 97 200 194 102 214 19 178 132 208 158 59 10 136 112 135 118 37 63
-30 94 60 46 180 47 100 110 146 33 3 50 199 43 39 168 169 90 188 12 92 219 189 6
-117 116 196 133 87 164 76 132 167 101 30 209 79 157 138 143 8 32 8 221 220 110
-31 14 123 92 103 135 117 75 212 104 55 180 121 62 192 72 72 187 206 13 202 67
-206 128 221 105 91 224 129 27 184 181 115 160 89 79 199 84 23 197 128 147 143
-82 67 17 147 28 63 187 132 51 120 141 167 175 65 60 5 196 18 68 126 191 36 28
-179 10 21 93 24 2 14 82 108 74 176 60 120 215 129 26 222 99 189 121 136 227 154
-229 226 86 169 16 153 3 166 180 5 81 72 30 168 95 128 106 159 53 35 33 119 31
-88 158 174 29 16 70 26 32 83 218 80 193 182 151 204 24 44 191 193 66 170 84 213
-140 99 115 86 54 70 42 45 70 41 83 61 115 44 108 190 157 180 162 119 221 104
-129 142 203 219 25 228 1 61 41 9 26 33 118 69 6 1 135 76 91 183 72 71 152 124
-87 163 114 50 10 62 77 53 34 229 110 105 49 205 18 142 88 42 193 67 132 93 139
-21 52 40 204 213 98 153 4 201 31 162 120 25 113 55 181 156 144 118 111 25 112
-20 172 230 105 165 186 138 184 223 61 40 47 175 107 6 116 81 114 207 48 53 224
-14 81 73 223 19 21 167 59 11 98 194 61 230 221 146 148 22 88 84 139 178 90 189
-47 174 145 228 190 42 3 51 161 125 196 207 49 15 2 171 120 26 148 64 107 195 97
-43 229 111 140 58 131 57 95 13 87 48 95 170 125 197 169 131 172 41 124 45 144 3
-92 145 154 155 33 77 12 208 200 78 48 21 208 43 40 130 178 16 227 196 17 106 44
-34 228 75 23 123 166 65 217 43 114 165 29 173 35 200 ^
-479 0 167 151 130 58 29 34 150 107 8 195 121 112 59 152 22 131 218 208 202 159
-88 19 56 149 82 41 153 145 54 199 86 104 166 126 228 16 53 209 225 41 90 230 29
-197 171 46 143 39 203 149 117 147 67 45 216 158 35 75 136 136 38 17 78 176 34
-185 213 155 95 50 71 73 123 225 76 28 144 227 126 130 228 114 74 148 192 118
-172 34 87 192 216 193 206 54 36 65 230 31 49 146 44 228 214 180 62 92 47 131 48
-58 162 161 3 142 14 3 107 141 89 207 212 130 193 8 160 15 198 159 223 63 117 14
-173 192 181 87 59 89 107 106 216 60 79 201 1 227 189 213 20 116 222 38 150 205
-29 134 23 21 141 124 80 126 30 122 200 109 219 104 201 64 142 149 215 168 6 12
-125 7 72 133 196 181 185 15 28 9 183 65 32 137 196 46 206 187 163 151 32 37 90
-132 8 25 204 137 61 67 145 89 72 69 95 85 9 220 23 154 35 210 115 197 71 108
-229 139 209 190 103 176 97 100 5 157 10 173 94 160 148 92 12 25 69 158 202 222
-171 44 58 64 205 64 7 170 154 70 83 29 97 67 10 110 11 135 146 177 122 2 47 133
-133 33 160 13 113 184 225 211 7 37 27 49 48 23 56 14 38 213 55 222 136 171 144
-164 211 105 226 199 184 125 105 93 72 98 25 34 52 86 69 60 212 30 87 94 195 21
-6 145 19 28 172 204 4 167 214 45 83 31 14 40 65 95 220 221 48 121 77 186 5 57
-137 26 194 231 189 78 41 55 124 115 232 177 22 129 68 168 204 74 211 42 143 174
-182 210 215 70 218 73 158 98 223 161 138 186 140 101 30 59 52 149 217 20 214 10
-210 117 49 46 106 81 16 18 103 78 76 161 38 15 226 136 36 100 103 178 182 75 3
-9 185 150 7 135 48 156 183 100 138 51 96 40 165 201 134 121 42 80 91 157 208 67
-180 27 219 133 231 54 99 213 190 33 197 36 2 82 6 47 231 154 205 127 155 195
-156 50 206 52 184 90 232 179 172 169 66 20 81 116 124 17 43 5 120 52 51 196 146
-79 101 128 80 224 65 ^
-503 1 55 102 9 3 202 159 19 103 56 206 165 60 152 54 171 157 164 185 27 59 45
-171 217 80 123 203 203 23 169 66 193 103 116 122 156 7 32 169 6 41 165 176 31
-125 2 211 155 189 93 69 32 109 90 50 225 85 53 127 153 45 175 40 121 172 201
-168 15 37 99 166 44 4 182 188 53 71 7 148 48 130 108 166 220 35 8 12 198 93 9
-63 171 97 195 194 87 204 14 173 132 203 143 54 231 126 102 125 118 37 43 20 94
-60 36 175 47 90 110 141 23 229 35 184 43 24 153 154 85 173 12 82 214 174 232
-117 106 191 128 77 164 76 117 162 101 25 204 74 142 123 143 234 32 229 211 215
-105 31 9 123 87 88 135 102 65 202 99 50 165 116 62 187 62 67 177 191 8 192 52
-196 118 206 105 91 214 114 27 179 166 100 150 79 79 199 84 13 182 128 137 133
-67 57 17 132 23 53 187 122 36 115 131 152 170 50 45 231 186 18 63 111 181 21 18
-179 226 16 88 19 223 230 82 98 59 161 50 105 200 124 11 207 89 179 106 131 212
-139 224 221 86 164 16 148 224 161 170 226 76 57 10 163 85 113 96 144 38 30 18
-119 21 78 148 164 9 232 50 221 26 12 78 208 80 183 172 141 199 24 44 191 188 46
-155 69 208 140 99 110 81 54 55 42 40 65 26 68 41 105 24 93 185 147 180 157 104
-216 89 119 137 193 219 231 10 223 1 51 36 235 16 28 103 49 1 227 120 61 76 173
-72 51 152 114 87 148 104 40 5 57 77 48 14 229 95 100 34 200 8 132 83 22 178 62
-127 93 129 1 47 30 194 203 83 138 4 186 11 147 120 5 113 40 181 141 139 108 106
-15 97 15 157 220 95 160 186 138 184 223 61 20 27 175 107 6 101 81 114 207 33 33
-209 4 66 73 218 4 6 157 44 11 98 179 46 215 221 146 133 7 88 79 139 168 75 189
-37 159 135 218 180 37 219 51 156 120 181 197 49 5 233 161 110 21 138 64 102 185
-87 28 219 111 125 58 121 52 80 3 82 38 90 170 110 197 169 126 162 41 109 30 134
-234 92 145 149 155 13 62 7 208 200 68 48 21 198 33 40 125 178 6 217 196 2 91 34
-24 213 70 23 113 161 ^
-470 0 58 210 15 107 144 15 159 21 142 152 151 130 48 14 34 140 92 231 190 106
-112 54 142 7 116 208 193 187 159 73 19 41 144 67 36 148 135 44 184 71 104 156
-126 218 6 43 204 225 21 90 230 24 182 156 26 138 39 188 139 112 147 62 40 216
-143 35 75 131 121 18 2 68 161 29 185 203 145 95 40 71 63 113 220 66 8 144 212
-116 115 228 109 59 138 177 108 172 19 82 187 211 188 191 34 36 55 215 11 39 136
-24 223 199 170 52 82 42 131 28 53 162 161 226 142 14 231 97 141 79 192 207 120
-183 236 145 233 198 149 208 48 107 237 173 192 166 77 39 84 102 96 206 40 64
-186 224 227 174 213 10 111 212 23 150 195 9 124 13 6 136 124 65 121 25 117 195
-109 204 218 99 201 44 132 149 215 163 234 230 110 225 62 133 181 176 180 10 18
-9 183 50 22 122 191 41 196 182 163 141 27 32 80 127 8 10 204 132 56 57 130 89
-57 223 54 90 85 227 215 18 154 25 210 115 187 66 108 224 134 209 180 103 176 87
-90 223 147 10 163 89 150 143 87 235 20 69 148 228 202 217 171 39 43 59 190 54
-235 165 149 70 83 29 92 67 233 105 229 130 141 172 112 2 27 118 123 33 160 8
-103 169 210 201 230 17 22 29 33 8 51 9 38 208 55 222 126 166 129 154 211 95 226
-194 174 120 90 78 67 88 25 24 37 76 59 45 212 30 72 84 195 16 1 140 237 28 157
-199 222 167 209 35 68 16 232 25 65 80 220 211 43 111 67 181 228 57 137 11 184
-216 184 78 26 45 119 110 232 177 22 129 68 168 189 74 196 37 128 174 172 205
-205 60 218 58 158 93 218 151 123 171 125 86 10 59 52 134 202 20 214 228 195 102
-44 46 106 71 11 236 93 73 71 156 33 15 211 136 31 100 88 163 182 70 221 232 170
-145 2 120 38 156 178 95 133 36 96 20 155 191 134 116 22 70 76 152 203 52 175 7
-209 128 226 49 94 198 190 13 192 21 235 72 229 37 221 139 205 112 140 185 151
-30 206 47 179 75 217 101 ^
-502 0 158 148 66 13 60 95 103 3 15 5 113 38 23 182 125 65 94 107 73 224 37 47
-102 237 3 198 155 7 95 56 198 165 52 148 46 163 157 152 173 19 55 29 167 217 76
-115 203 191 11 165 62 193 99 116 122 144 236 7 28 161 2 29 157 172 23 125 238
-199 151 177 89 61 24 101 78 50 213 73 41 127 153 45 167 24 121 168 193 156 3 25
-87 166 28 228 174 188 53 67 239 148 36 118 104 162 208 27 232 4 194 85 1 63 159
-97 191 194 75 196 10 169 132 199 131 50 223 118 94 117 118 37 27 12 94 60 28
-171 47 82 110 137 15 225 23 172 43 12 141 142 81 161 12 74 210 162 228 117 98
-187 124 69 164 76 105 158 101 21 200 70 130 111 143 230 32 221 203 211 101 31 5
-123 83 76 135 90 57 194 95 46 153 112 62 183 54 63 169 179 4 184 40 188 110 194
-105 91 206 102 27 175 154 88 142 71 79 199 84 5 170 128 129 125 55 49 17 120 19
-45 187 114 24 111 123 140 166 38 33 227 178 18 59 99 173 9 10 179 214 12 84 15
-215 218 82 90 47 149 42 93 188 120 239 195 81 171 94 127 200 127 220 217 86 160
-16 144 216 157 162 218 72 45 234 159 77 101 88 132 26 26 6 119 13 70 140 156
-233 220 34 213 26 236 74 200 80 175 164 133 195 24 44 191 184 30 143 57 204 140
-99 106 77 54 43 42 36 61 14 56 25 97 8 81 181 139 180 153 92 212 77 111 133 185
-219 231 238 219 1 43 32 231 8 24 91 33 237 223 108 49 64 165 72 35 152 106 87
-136 96 32 1 53 77 44 238 229 83 96 22 196 124 79 6 166 58 123 93 121 225 43 22
-186 195 71 126 4 174 235 135 120 229 113 28 181 129 135 100 102 7 85 11 145 212
-87 156 186 138 184 223 61 4 11 175 107 6 89 81 114 207 21 17 197 236 54 73 214
-232 234 149 32 11 98 167 34 203 221 146 121 235 88 75 139 160 63 189 29 147 127
-210 172 33 207 51 152 116 169 189 49 237 233 153 102 17 130 64 98 177 79 16 211
-111 113 58 113 48 68 235 78 30 86 170 98 197 169 122 154 41 97 18 126 234 92
-145 145 155 237 50 209 ^
-481 1 208 200 56 48 21 186 21 40 119 178 236 205 196 226 73 22 12 195 64 23 101
-144 54 206 241 103 132 7 151 13 138 140 151 130 40 2 34 132 80 223 186 94 112
-50 134 237 104 200 181 175 159 61 19 29 140 55 32 144 127 36 172 59 104 148 126
-210 240 35 200 225 5 90 230 20 170 144 10 134 39 176 131 108 147 58 36 216 131
-35 75 127 109 2 232 60 149 25 185 195 137 95 32 71 55 105 216 58 234 144 200
-108 103 228 105 47 130 165 100 172 7 78 183 207 184 179 18 36 47 203 237 31 128
-8 219 187 162 44 74 38 131 12 49 162 161 218 142 14 227 89 141 71 180 203 112
-175 232 133 221 198 141 196 36 99 229 173 192 154 69 23 80 98 88 198 24 52 174
-216 227 162 213 2 107 204 11 150 187 235 116 5 236 132 124 53 117 21 113 191
-109 192 206 95 201 28 124 149 215 159 230 218 98 213 54 133 169 172 176 6 10 9
-183 38 14 110 187 37 188 178 163 133 23 28 72 123 8 240 204 128 52 49 118 89 45
-215 42 86 85 215 211 14 154 17 210 115 179 62 108 220 130 209 172 103 176 79 82
-211 139 10 155 85 142 139 83 227 16 69 140 224 202 213 171 35 31 55 178 46 231
-161 145 70 83 29 88 67 225 101 217 126 137 168 104 2 11 106 115 33 160 4 95 157
-198 193 222 1 18 13 21 238 47 5 38 204 55 222 118 162 117 146 211 87 226 190
-166 116 78 66 63 80 25 16 25 68 51 33 212 30 60 76 195 12 239 136 225 28 145
-195 210 167 205 27 56 4 220 13 65 68 220 203 39 103 59 177 220 57 137 241 176
-204 180 78 14 37 115 106 232 177 22 129 68 168 177 74 184 33 116 174 164 201
-197 52 218 46 158 89 214 143 111 159 113 74 236 59 52 122 190 20 214 216 183 90
-40 46 106 63 7 224 85 69 67 152 29 15 199 136 27 100 76 151 182 66 209 224 158
-141 240 108 30 156 174 91 129 24 96 4 147 183 134 112 6 62 64 148 199 40 171
-233 201 124 222 45 90 186 190 239 188 9 235 64 221 29 213 127 178 ^
-508 1 94 122 173 145 6 206 41 173 57 199 146 150 136 66 9 48 83 91 239 243 5
-109 30 7 174 113 57 90 95 69 224 29 39 102 229 3 194 151 239 87 56 190 165 44
-144 38 155 157 140 161 11 51 13 163 217 72 107 203 179 243 161 58 193 95 116
-122 132 236 7 24 153 242 17 149 168 15 125 238 187 147 165 85 53 16 93 66 50
-201 61 29 127 153 45 159 8 121 164 185 144 235 13 75 166 12 216 166 188 53 63
-235 148 24 106 100 158 196 19 220 240 190 77 237 63 147 97 187 194 63 188 6 165
-132 195 119 46 215 110 86 109 118 37 11 4 94 60 20 167 47 74 110 133 7 221 11
-160 43 129 130 77 149 12 66 206 150 224 117 90 183 120 61 164 76 93 154 101 17
-196 66 118 99 143 226 32 213 195 207 97 31 1 123 79 64 135 78 49 186 91 42 141
-108 62 179 46 59 161 167 176 28 180 102 182 105 91 198 90 27 171 142 76 134 63
-79 199 84 241 158 128 121 117 43 41 17 108 15 37 187 106 12 107 115 128 162 26
-21 223 170 18 55 87 165 241 2 179 202 8 80 11 207 206 82 82 35 137 34 81 176
-116 231 183 73 163 82 123 188 115 216 213 86 156 16 140 208 153 154 210 68 33
-222 155 69 89 80 120 14 22 238 119 5 62 132 148 221 208 18 205 26 224 70 192 80
-167 156 125 191 24 44 191 180 14 131 45 200 140 99 102 73 54 31 42 32 57 2 44 9
-89 236 69 177 131 180 149 80 208 65 103 129 177 219 231 230 215 1 35 28 227 20
-79 17 237 219 96 37 52 157 72 19 152 98 87 124 88 24 241 49 77 40 226 229 71 92
-10 192 236 116 75 234 154 54 119 93 113 213 39 14 178 187 59 114 4 162 223 123
-120 217 113 16 181 117 131 92 98 243 73 7 133 204 79 152 186 138 184 223 61 232
-239 175 107 6 77 81 114 207 9 1 185 232 42 73 210 224 226 141 20 11 98 155 22
-191 221 146 109 227 88 71 139 152 51 189 21 135 119 202 164 29 195 51 148 112
-157 181 49 233 233 145 94 13 122 64 94 169 71 4 203 111 101 58 105 44 56 231 74
-22 82 170 86 197 169 118 146 41 85 6 118 234 92 145 141 149 ^
-484 1 219 32 243 208 200 48 48 21 178 13 40 115 178 232 197 196 218 61 14 4 183
-60 23 93 136 50 202 229 99 120 245 143 5 134 128 151 130 32 236 34 124 68 215
-182 82 112 46 126 229 92 192 169 163 159 49 19 17 136 43 28 140 119 28 160 47
-104 140 126 202 236 27 196 225 235 90 230 16 158 132 240 130 39 164 123 104 147
-54 32 216 119 35 75 123 97 232 224 52 137 21 185 187 129 95 24 71 47 97 212 50
-222 144 188 100 91 228 101 35 122 153 92 172 241 74 179 203 180 167 2 36 39 191
-225 23 120 238 215 175 154 36 66 34 131 242 45 162 161 210 142 14 223 81 141 63
-168 199 104 167 228 121 209 198 133 184 24 91 221 173 192 142 61 7 76 94 80 190
-8 40 162 208 227 150 213 240 103 196 245 150 179 223 108 243 228 128 124 41 113
-17 109 187 109 180 194 91 201 12 116 149 215 155 226 206 86 201 46 133 157 168
-172 2 2 9 183 26 6 98 183 33 180 174 163 125 19 24 64 119 8 232 204 124 48 41
-106 89 33 207 30 82 85 203 207 10 154 9 210 115 171 58 108 216 126 209 164 103
-176 71 74 199 131 10 147 81 134 135 79 219 12 69 132 220 202 209 171 31 19 51
-166 38 227 157 141 70 83 29 84 67 217 97 205 122 133 164 96 2 241 94 107 33 160
-87 145 186 185 214 231 14 243 9 230 43 1 38 200 55 222 110 158 105 138 211 79
-226 186 158 112 66 54 59 72 25 8 13 60 43 21 212 30 48 68 195 8 239 132 213 28
-133 191 198 167 201 19 44 238 208 1 65 56 220 195 35 95 51 173 212 57 137 233
-168 192 176 78 2 29 111 102 232 177 22 129 68 168 165 74 172 29 104 174 156 197
-189 44 218 34 158 85 210 135 99 147 101 62 224 59 52 110 178 20 214 204 171 78
-36 46 106 55 3 212 77 65 63 148 25 15 187 136 23 100 64 139 182 62 197 216 146
-137 240 96 22 156 170 87 125 12 96 234 139 175 134 108 236 54 52 144 195 28 167
-221 193 120 218 41 86 174 190 227 184 243 235 56 213 21 205 115 205 71 ^
-506 0 110 165 141 238 206 37 169 45 187 134 142 124 66 5 36 71 79 235 231 5 105
-22 239 166 101 49 86 83 65 224 21 31 102 221 3 190 147 231 79 56 182 165 36 140
-30 147 157 128 149 3 47 245 159 217 68 99 203 167 235 157 54 193 91 116 122 120
-236 7 20 145 242 5 141 164 7 125 238 175 143 153 81 45 8 85 54 50 189 49 17 127
-153 45 151 240 121 160 177 132 227 1 63 166 244 204 158 188 53 59 231 148 12 94
-96 154 184 11 208 236 186 69 233 63 135 97 183 194 51 180 2 161 132 191 107 42
-207 102 78 101 118 37 243 244 94 60 12 163 47 66 110 129 247 217 247 148 43 236
-117 118 73 137 12 58 202 138 220 117 82 179 116 53 164 76 81 150 101 13 192 62
-106 87 143 222 32 205 187 203 93 31 245 123 75 52 135 66 41 178 87 38 129 104
-62 175 38 55 153 155 244 168 16 172 94 170 105 91 190 78 27 167 130 64 126 55
-79 199 84 237 146 128 113 109 31 33 17 96 11 29 187 98 103 107 116 158 14 9 219
-162 18 51 75 157 233 242 179 190 4 76 7 199 194 82 74 23 125 26 69 164 112 223
-171 65 155 70 119 176 103 212 209 86 152 16 136 200 149 146 202 64 21 210 151
-61 77 72 108 2 18 230 119 245 54 124 140 209 196 2 197 26 212 66 184 80 159 148
-117 187 24 44 191 176 246 119 33 196 140 99 98 69 54 19 42 28 53 238 32 241 81
-224 57 173 123 180 145 68 204 53 95 125 169 219 231 222 211 1 27 24 223 240 16
-67 1 237 215 84 25 40 149 72 3 152 90 87 112 80 16 241 45 77 36 214 229 59 88
-246 188 232 108 71 222 142 50 115 93 105 201 35 6 170 179 47 102 4 150 211 111
-120 205 113 4 181 105 127 84 94 239 61 3 121 196 71 148 186 138 184 223 61 220
-227 175 107 6 65 81 114 207 245 233 173 228 30 73 206 216 218 133 8 11 98 143
-10 179 221 146 97 219 88 67 139 144 39 189 13 123 111 194 156 25 183 51 144 108
-145 173 49 229 233 137 86 9 114 64 90 161 63 240 195 111 89 58 97 40 44 227 70
-14 78 170 74 197 169 114 138 41 73 242 110 234 177 ^
-491 0 145 135 155 207 20 243 208 200 40 48 21 170 5 40 111 178 228 189 196 210
-49 6 246 171 56 23 85 128 46 198 217 95 108 241 135 247 130 116 151 130 24 228
-34 116 56 207 178 70 112 42 118 221 80 184 157 151 159 37 19 5 132 31 24 136
-111 20 148 35 104 132 126 194 232 19 192 225 223 90 230 12 146 120 228 126 39
-152 115 100 147 50 28 216 107 35 75 119 85 220 216 44 125 17 185 179 121 95 16
-71 39 89 208 42 210 144 176 92 79 228 97 23 114 141 84 172 233 70 175 199 176
-155 236 36 31 179 213 15 112 226 211 163 146 28 58 30 131 230 41 162 161 202
-142 14 219 73 141 55 156 195 96 159 224 109 197 198 125 172 12 83 213 173 192
-130 53 241 72 90 72 182 242 28 150 200 227 138 213 236 99 188 237 150 171 211
-100 239 220 124 124 29 109 13 105 183 109 168 182 87 201 246 108 149 215 151
-222 194 74 189 38 133 145 164 168 248 244 9 183 14 248 86 179 29 172 170 163
-117 15 20 56 115 8 224 204 120 44 33 94 89 21 199 18 78 85 191 203 6 154 1 210
-115 163 54 108 212 122 209 156 103 176 63 66 187 123 10 139 77 126 131 75 211 8
-69 124 216 202 205 171 27 7 47 154 30 223 153 137 70 83 29 80 67 209 93 193 118
-129 160 88 2 229 82 99 33 160 246 79 133 174 177 206 219 10 231 247 222 39 247
-38 196 55 222 102 154 93 130 211 71 226 182 150 108 54 42 55 64 25 1 52 35 9
-212 30 36 60 195 4 239 128 201 28 121 187 186 167 197 11 32 230 196 239 65 44
-220 187 31 87 43 169 204 57 137 225 160 180 172 78 240 21 107 98 232 177 22 129
-68 168 153 74 160 25 92 174 148 193 181 36 218 22 158 81 206 127 87 135 89 50
-212 59 52 98 166 20 214 192 159 66 32 46 106 47 249 200 69 61 59 144 21 15 175
-136 19 100 52 127 182 58 185 208 134 133 240 84 14 156 166 83 121 96 222 131
-167 134 104 224 46 40 140 191 16 163 209 185 116 214 37 82 162 190 215 180 235
-235 48 205 13 197 103 205 76 104 161 139 232 146 ^
-516 0 33 165 33 175 122 134 112 66 1 24 59 67 231 219 5 101 14 227 158 89 41 82
-71 61 224 13 23 102 213 3 186 143 223 71 56 174 165 28 136 22 139 157 116 137
-247 43 233 155 217 64 91 203 155 227 153 50 193 87 116 122 108 236 7 16 137 242
-245 133 160 251 125 238 163 139 141 77 37 77 42 50 177 37 5 127 153 45 143 228
-121 156 169 120 219 241 51 166 232 192 150 188 53 55 227 148 82 92 150 172 3
-196 232 182 61 229 63 123 97 179 194 39 172 250 157 132 187 95 38 199 94 70 93
-118 37 231 240 94 60 4 159 47 58 110 125 243 213 239 136 43 228 105 106 69 125
-12 50 198 126 216 117 74 175 112 45 164 76 69 146 101 9 188 58 94 75 143 218 32
-197 179 199 89 31 245 123 71 40 135 54 33 170 83 34 117 100 62 171 30 51 145
-143 244 160 4 164 86 158 105 91 182 66 27 163 118 52 118 47 79 199 84 233 134
-128 105 101 19 25 17 84 7 21 187 90 240 99 99 104 154 2 249 215 154 18 47 63
-149 225 238 179 178 72 3 191 182 82 66 11 113 18 57 152 108 215 159 57 147 58
-115 164 91 208 205 86 148 16 132 192 145 138 194 60 9 198 147 53 65 64 96 242
-14 222 119 241 46 116 132 197 184 238 189 26 200 62 176 80 151 140 109 183 24
-44 191 172 234 107 21 192 140 99 94 65 54 7 42 24 49 230 20 229 73 212 45 169
-115 180 141 56 200 41 87 121 161 219 231 214 207 1 19 20 219 236 12 55 237 237
-211 72 13 28 141 72 239 152 82 87 100 72 8 241 41 77 32 202 229 47 84 238 184
-228 100 67 210 130 46 111 93 97 189 31 250 162 171 35 90 4 138 199 99 120 193
-113 244 181 93 123 76 90 235 49 251 109 188 63 144 186 138 184 223 61 208 215
-175 107 6 53 81 114 207 237 221 161 224 18 73 202 208 210 125 248 11 98 131 250
-167 221 146 85 211 88 63 139 136 27 189 5 111 103 186 148 21 171 51 140 104 133
-165 49 225 233 129 78 5 106 64 86 153 55 232 187 111 77 58 89 36 32 223 66 6 74
-170 62 197 169 110 130 41 61 234 102 234 92 145 133 155 201 14 243 208 200 36
-48 21 166 1 40 109 178 147 ^
-522 0 179 196 200 34 251 241 156 51 23 75 118 41 193 202 90 93 236 125 242 125
-101 151 130 14 218 34 106 41 197 173 55 112 37 108 211 65 174 142 136 159 22 19
-245 127 16 19 131 101 10 133 20 104 122 126 184 227 9 187 225 208 90 230 7 131
-105 213 121 39 137 105 95 147 45 23 216 92 35 75 114 70 205 206 34 110 12 185
-169 111 95 6 71 29 79 203 32 195 144 161 82 64 228 92 8 104 126 74 172 223 65
-170 194 171 140 221 36 21 164 198 5 102 211 206 148 136 18 48 25 131 215 36 162
-161 192 142 14 214 63 141 45 141 190 86 149 219 94 182 198 115 157 252 73 203
-173 192 115 43 226 67 85 62 172 227 13 135 190 227 123 213 231 94 178 227 150
-161 196 90 234 210 119 124 14 104 8 100 178 109 153 167 82 201 231 98 149 215
-146 217 179 59 174 28 133 130 159 163 248 239 9 183 254 243 71 174 24 162 165
-163 107 10 15 46 110 8 214 204 115 39 23 79 89 6 189 3 73 85 176 198 1 154 246
-210 115 153 49 108 207 117 209 146 103 176 53 56 172 113 10 129 72 116 126 70
-201 3 69 114 211 202 200 171 22 247 42 139 20 218 148 132 70 83 29 75 67 199 88
-178 113 124 155 78 2 214 67 89 33 160 246 69 118 159 167 196 204 5 216 237 212
-34 247 38 191 55 222 92 149 78 120 211 61 226 177 140 103 39 27 50 54 25 245
-241 42 25 249 212 30 21 50 195 254 239 123 186 28 106 182 171 167 192 1 17 220
-181 229 65 29 220 177 26 77 33 164 194 57 137 215 150 165 167 78 230 11 102 93
-232 177 22 129 68 168 138 74 145 20 77 174 138 188 171 26 218 7 158 76 201 117
-72 120 74 35 197 59 52 83 151 20 214 177 144 51 27 46 106 37 249 185 59 56 54
-139 16 15 160 136 14 100 37 112 182 53 170 198 119 128 240 69 4 156 161 78 116
-240 96 207 121 157 134 99 209 36 25 135 186 1 158 194 175 111 209 32 77 147 190
-200 175 225 235 38 195 3 187 88 205 61 89 151 134 217 206 30 162 24 166 113 128
-103 66 253 15 50 58 228 210 5 98 8 218 152 80 35 79 62 58 224 7 17 102 207 3
-183 140 217 65 56 168 165 22 133 16 133 157 107 128 244 12 ^
-517 1 218 150 217 59 81 203 140 217 148 45 193 82 116 122 93 236 7 11 127 242
-235 123 155 246 125 238 148 134 126 72 27 247 67 27 50 162 22 247 127 153 45
-133 213 121 151 159 105 209 231 36 166 217 177 140 188 53 50 222 148 242 67 87
-145 157 250 181 227 177 51 224 63 108 97 174 194 24 162 250 152 132 182 80 33
-189 84 60 83 118 37 216 235 94 60 251 154 47 48 110 120 238 208 229 121 43 218
-90 91 64 110 12 40 193 111 211 117 64 170 107 35 164 76 54 141 101 4 183 53 79
-60 143 213 32 187 169 194 84 31 245 123 66 25 135 39 23 160 78 29 102 95 62 166
-20 46 135 128 244 150 246 154 76 143 105 91 172 51 27 158 103 37 108 37 79 199
-84 228 119 128 95 91 4 15 17 69 2 11 187 80 230 94 89 89 149 244 239 210 144 18
-42 48 139 215 233 179 163 252 67 255 181 167 82 56 253 98 8 42 137 103 205 144
-47 137 43 110 149 76 203 200 86 143 16 127 182 140 128 184 55 251 183 142 43 50
-54 81 232 9 212 119 236 36 106 122 182 169 223 179 26 185 57 166 80 141 130 99
-178 24 44 191 167 219 92 6 187 140 99 89 60 54 249 42 19 44 220 5 214 63 197 30
-164 105 180 136 41 195 26 77 116 151 219 231 204 202 1 9 15 214 231 7 40 222
-237 206 57 255 13 131 72 224 152 72 87 85 62 255 241 36 77 27 187 229 32 79 228
-179 223 90 62 195 115 41 106 93 87 174 26 245 152 161 20 75 4 123 184 84 120
-178 113 234 181 78 118 66 85 230 34 251 94 178 53 139 186 138 184 223 61 193
-200 175 107 6 38 81 114 207 227 206 146 219 3 73 197 198 200 115 238 11 98 116
-240 152 221 146 70 201 88 58 139 126 12 189 252 96 93 176 138 16 156 51 135 99
-118 155 49 220 233 119 68 96 64 81 143 45 222 177 111 62 58 79 31 17 218 61 253
-69 170 47 197 169 105 120 41 46 224 92 234 92 145 128 155 186 256 243 208 200
-26 48 21 156 248 40 104 178 221 175 196 196 28 249 239 150 49 23 71 114 39 191
-196 88 87 234 121 240 123 95 151 130 10 214 34 102 35 193 171 49 112 35 104 207
-59 170 136 130 159 16 19 241 125 213 ^
-529 1 15 127 93 2 121 8 104 114 126 176 223 1 183 225 196 90 230 3 119 93 201
-117 39 125 97 91 147 41 19 216 80 35 75 110 58 193 198 26 98 8 185 161 103 95
-257 71 21 71 199 24 183 144 149 74 52 228 88 255 96 114 66 172 215 61 166 190
-167 128 209 36 13 152 186 256 94 199 202 136 128 10 40 21 131 203 32 162 161
-184 142 14 210 55 141 37 129 186 78 141 215 82 170 198 107 145 244 65 195 173
-192 103 35 214 63 81 54 164 215 1 123 182 227 111 213 227 90 170 219 150 153
-184 82 230 202 115 124 2 100 4 96 174 109 141 155 78 201 219 90 149 215 142 213
-167 47 162 20 133 118 155 159 248 235 9 183 246 239 59 170 20 154 161 163 99 6
-11 38 106 8 206 204 111 35 15 67 89 253 181 250 69 85 164 194 256 154 242 210
-115 145 45 108 203 113 209 138 103 176 45 48 160 105 10 121 68 108 122 66 193
-258 69 106 207 202 196 171 18 239 38 127 12 214 144 128 70 83 29 71 67 191 84
-166 109 120 151 70 2 202 55 81 33 160 246 61 106 147 159 188 192 1 204 229 204
-30 247 38 187 55 222 84 145 66 112 211 53 226 173 132 99 27 15 46 46 25 241 233
-34 17 241 212 30 9 42 195 254 239 119 174 28 94 178 159 167 188 252 5 212 169
-221 65 17 220 169 22 69 25 160 186 57 137 207 142 153 163 78 222 3 98 89 232
-177 22 129 68 168 126 74 133 16 65 174 130 184 163 18 218 254 158 72 197 109 60
-108 62 23 185 59 52 71 139 20 214 165 132 39 23 46 106 29 249 173 51 52 50 135
-12 15 148 136 10 100 25 100 182 49 158 190 107 124 240 57 255 156 157 74 112
-232 96 195 113 149 134 95 197 28 13 131 182 248 154 182 167 107 205 28 73 135
-190 188 171 217 235 30 187 254 179 76 205 49 77 143 130 205 206 26 158 12 154
-101 120 91 66 253 3 38 46 224 198 5 94 206 144 68 27 75 50 54 224 258 9 102 199
-3 179 136 209 57 56 160 165 14 129 8 125 157 95 116 240 36 212 148 217 57 77
-203 134 213 146 43 193 80 116 122 87 236 7 9 123 242 231 119 153 244 125 238
-142 132 120 70 23 245 63 21 50 156 16 243 127 153 45 129 207 121 149 155 99 205
-227 30 166 211 57 ^
-548 0 134 188 53 47 219 148 236 58 84 142 148 247 172 224 174 45 221 63 99 97
-171 194 15 156 250 149 132 179 71 30 183 78 54 77 118 37 207 232 94 60 248 151
-47 42 110 117 235 205 223 112 43 212 81 82 61 101 12 34 190 102 208 117 58 167
-104 29 164 76 45 138 101 1 180 50 70 51 143 210 32 181 163 191 81 31 245 123 63
-16 135 30 17 154 75 26 93 92 62 163 14 43 129 119 244 144 240 148 70 134 105 91
-166 42 27 155 94 28 102 31 79 199 84 225 110 128 89 85 255 9 17 60 259 5 187 74
-224 91 83 80 146 238 233 207 138 18 39 39 133 209 230 179 154 252 64 255 175
-158 82 50 247 89 2 33 128 100 199 135 41 131 34 107 140 67 200 197 86 140 16
-124 176 137 122 178 52 245 174 139 37 41 48 72 226 6 206 119 233 30 100 116 173
-160 214 173 26 176 54 160 80 135 124 93 175 24 44 191 164 210 83 257 184 140 99
-86 57 54 243 42 16 41 214 256 205 57 188 21 161 99 180 133 32 192 17 71 113 145
-219 231 198 199 1 3 12 211 228 4 31 213 237 203 48 249 4 125 72 215 152 66 87
-76 56 252 241 33 77 24 178 229 23 76 222 176 220 84 59 186 106 38 103 93 81 165
-23 242 146 155 11 66 4 114 175 75 120 169 113 228 181 69 115 60 82 227 25 251
-85 172 47 136 186 138 184 223 61 184 191 175 107 6 29 81 114 207 221 197 137
-216 254 73 194 192 194 109 232 11 98 107 234 143 221 146 61 195 88 55 139 120 3
-189 249 87 87 170 132 13 147 51 132 96 109 149 49 217 233 113 62 257 90 64 78
-137 39 216 171 111 53 58 73 28 8 215 58 250 66 170 38 197 169 102 114 41 37 218
-86 234 92 145 125 155 177 250 243 208 200 20 48 21 150 245 40 101 178 218 169
-196 190 19 246 236 141 46 23 65 108 36 188 187 85 78 231 115 237 120 86 151 130
-4 208 34 96 26 187 168 40 112 32 98 201 50 164 127 121 159 7 19 235 122 1 14
-126 91 118 5 104 112 126 174 222 259 182 225 193 90 230 2 116 90 198 116 39 122
-95 90 147 40 18 216 77 35 75 109 55 190 196 24 95 7 185 159 101 95 256 71 19 69
-198 22 180 144 146 72 49 228 87 253 94 111 64 172 213 60 165 189 166 125 206 36
-11 149 183 255 92 196 201 133 126 8 38 20 131 213 ^
-547 0 29 162 161 178 142 14 207 49 141 31 120 183 72 135 212 73 161 198 101 136
-238 59 189 173 192 94 29 205 60 78 48 158 206 254 114 176 227 102 213 224 87
-164 213 150 147 175 76 227 196 112 124 255 97 1 93 171 109 132 146 75 201 210
-84 149 215 139 210 158 38 153 14 133 109 152 156 248 232 9 183 240 236 50 167
-17 148 158 163 93 3 8 32 103 8 200 204 108 32 9 58 89 247 175 244 66 85 155 191
-256 154 239 210 115 139 42 108 200 110 209 132 103 176 39 42 151 99 10 115 65
-102 119 63 187 258 69 100 204 202 193 171 15 233 35 118 6 211 141 125 70 83 29
-68 67 185 81 157 106 117 148 64 2 193 46 75 33 160 246 55 97 138 153 182 183
-260 195 223 198 27 247 38 184 55 222 78 142 57 106 211 47 226 170 126 96 18 6
-43 40 25 238 227 28 11 235 212 30 36 195 254 239 116 165 28 85 175 150 167 185
-249 258 206 160 215 65 8 220 163 19 63 19 157 180 57 137 201 136 144 160 78 216
-259 95 86 232 177 22 129 68 168 117 74 124 13 56 174 124 181 157 12 218 248 158
-69 194 103 51 99 53 14 176 59 52 62 130 20 214 156 123 30 20 46 106 23 249 164
-45 49 47 132 9 15 139 136 7 100 16 91 182 46 149 184 98 121 240 48 252 156 154
-71 109 226 96 186 107 143 134 92 188 22 4 128 179 242 151 173 161 104 202 25 70
-126 190 179 168 211 235 24 181 251 173 67 205 40 68 137 127 196 206 23 155 3
-145 92 114 82 66 253 256 29 37 221 189 5 91 256 197 138 59 21 72 41 51 224 255
-3 102 193 3 176 133 203 51 56 154 165 8 126 2 119 157 86 107 237 33 203 145 217
-54 71 203 125 207 143 40 193 77 116 122 78 236 7 6 117 242 225 113 150 241 125
-238 133 129 111 67 17 242 57 12 50 147 7 237 127 153 45 123 198 121 146 149 90
-199 221 21 166 202 162 130 188 53 45 217 148 232 52 82 140 142 245 166 222 172
-41 219 63 93 97 169 194 9 152 250 147 132 177 65 28 179 74 50 73 118 37 201 230
-94 60 246 149 47 38 110 115 233 203 219 106 43 208 75 76 59 95 12 30 188 96 206
-117 54 165 102 25 164 76 39 136 101 261 178 48 64 45 143 208 32 177 159 189 79
-31 245 123 61 10 135 24 13 150 73 24 87 90 62 161 10 41 125 209 ^
-542 1 244 136 232 140 62 122 105 91 158 30 27 151 82 16 94 23 79 199 84 221 98
-128 81 77 247 1 17 48 259 261 187 66 216 87 75 68 142 230 225 203 130 18 35 27
-125 201 226 179 142 252 60 255 167 146 82 42 239 77 258 21 116 96 191 123 33
-123 22 103 128 55 196 193 86 136 16 120 168 133 114 170 48 237 162 135 29 29 40
-60 218 2 198 119 229 22 92 108 161 148 202 165 26 164 50 152 80 127 116 85 171
-24 44 191 160 198 71 249 180 140 99 82 53 54 235 42 12 37 206 248 193 49 176 9
-157 91 180 129 20 188 5 63 109 137 219 231 190 195 1 259 8 207 224 19 201 237
-199 36 241 256 117 72 203 152 58 87 64 48 248 241 29 77 20 166 229 11 72 214
-172 216 76 55 174 94 34 99 93 73 153 19 238 138 147 263 54 4 102 163 63 120 157
-113 220 181 57 111 52 78 223 13 251 73 164 39 132 186 138 184 223 61 172 179
-175 107 6 17 81 114 207 213 185 125 212 246 73 190 184 186 101 224 11 98 95 226
-131 221 146 49 187 88 51 139 112 255 189 245 75 79 162 124 9 135 51 128 92 97
-141 49 213 233 105 54 257 82 64 74 129 31 208 163 111 41 58 65 24 260 211 54
-246 62 170 26 197 169 98 106 41 25 210 78 234 92 145 121 155 165 242 243 208
-200 12 48 21 142 241 40 97 178 214 161 196 182 7 242 232 129 42 23 57 100 32
-184 175 81 66 227 107 233 116 74 151 130 260 200 34 88 14 179 164 28 112 28 90
-193 38 156 115 109 159 259 19 227 118 253 10 122 83 256 106 257 104 104 126 166
-218 255 178 225 181 90 230 262 104 78 186 112 39 110 87 86 147 36 14 216 65 35
-75 105 43 178 188 16 83 3 185 151 93 95 252 71 11 61 194 14 168 144 134 64 37
-228 83 245 86 99 56 172 205 56 161 185 162 113 194 36 3 137 171 251 84 184 197
-121 118 30 16 131 188 27 162 161 174 142 14 205 45 141 27 114 181 68 131 210 67
-155 198 97 130 234 55 185 173 192 88 25 199 58 76 44 154 200 250 108 172 227 96
-213 222 85 160 209 150 143 169 72 225 192 110 124 251 95 263 91 169 109 126 140
-73 201 204 80 149 215 137 208 152 32 147 10 133 103 150 154 248 230 9 183 236
-234 44 165 15 144 156 163 89 1 6 28 101 8 196 204 106 164 ^
-567 0 1 46 89 239 167 236 62 85 143 187 256 154 235 210 115 131 38 108 196 106
-209 124 103 176 31 34 139 91 10 107 61 94 115 59 179 258 69 92 200 202 189 171
-11 225 31 106 264 207 137 121 70 83 29 64 67 177 77 145 102 113 144 56 2 181 34
-67 33 160 246 47 85 126 145 174 171 260 183 215 190 23 247 38 180 55 222 70 138
-45 98 211 39 226 166 118 92 6 260 39 32 25 234 219 20 3 227 212 30 254 28 195
-254 239 112 153 28 73 171 138 167 181 245 250 198 148 207 65 262 220 155 15 55
-11 153 172 57 137 193 128 132 156 78 208 255 91 82 232 177 22 129 68 168 105 74
-112 9 44 174 116 177 149 4 218 240 158 65 190 95 39 87 41 2 164 59 52 50 118 20
-214 144 111 18 16 46 106 15 249 152 37 45 43 128 5 15 127 136 3 100 4 79 182 42
-137 176 86 117 240 36 248 156 150 67 105 218 96 174 99 135 134 88 176 14 258
-124 175 234 147 161 153 100 198 21 66 114 190 167 164 203 235 16 173 247 165 55
-205 28 56 129 123 184 206 19 151 257 133 80 106 70 66 253 248 17 25 217 177 5
-87 252 185 130 47 13 68 29 47 224 251 261 102 185 3 172 129 195 43 56 146 165
-122 260 111 157 74 95 233 29 191 141 217 50 63 203 113 199 139 36 193 73 116
-122 66 236 7 2 109 242 217 105 146 237 125 238 121 125 99 63 9 238 49 50 135
-261 229 127 153 45 115 186 121 142 141 78 191 213 9 166 190 150 122 188 53 41
-213 148 224 40 78 136 130 241 154 218 168 33 215 63 81 97 165 194 263 144 250
-143 132 173 53 24 171 66 42 65 118 37 189 226 94 60 242 145 47 30 110 111 229
-199 211 94 43 200 63 64 55 83 12 22 184 84 202 117 46 161 98 17 164 76 27 132
-101 261 174 44 52 33 143 204 32 169 151 185 75 31 245 123 57 264 135 12 5 142
-69 20 75 86 62 157 2 37 117 101 244 132 228 136 58 116 105 91 154 24 27 149 76
-10 90 19 79 199 84 219 92 128 77 73 243 263 17 42 259 259 187 62 212 85 71 62
-140 226 221 201 126 18 33 21 121 197 224 179 136 252 58 255 163 140 82 38 235
-71 256 15 110 94 187 117 29 119 16 101 122 49 194 191 86 134 16 118 164 131 110
-166 46 233 156 133 25 23 36 54 214 194 119 227 18 88 104 155 142 196 161 26 158
-48 148 80 123 112 81 169 24 44 191 158 192 65 245 178 140 223 ^
-551 1 78 49 54 227 42 8 33 198 240 181 41 164 265 153 83 180 125 8 184 261 55
-105 129 219 231 182 191 1 255 4 203 220 264 7 189 237 195 24 233 248 109 72 191
-152 50 87 52 40 244 241 25 77 16 154 229 267 68 206 168 212 68 51 162 82 30 95
-93 65 141 15 234 130 139 255 42 4 90 151 51 120 145 113 212 181 45 107 44 74
-219 1 251 61 156 31 128 186 138 184 223 61 160 167 175 107 6 5 81 114 207 205
-173 113 208 238 73 186 176 178 93 216 11 98 83 218 119 221 146 37 179 88 47 139
-104 247 189 241 63 71 154 116 5 123 51 124 88 85 133 49 209 233 97 46 257 74 64
-70 121 23 200 155 111 29 58 57 20 252 207 50 242 58 170 14 197 169 94 98 41 13
-202 70 234 92 145 117 155 153 234 243 208 200 4 48 21 134 237 40 93 178 210 153
-196 174 263 238 228 117 38 23 49 92 28 180 163 77 54 223 99 229 112 62 151 130
-256 192 34 80 2 171 160 16 112 24 82 185 26 148 103 97 159 251 19 219 114 245 6
-118 75 252 94 249 104 96 126 158 214 251 174 225 169 90 230 262 92 66 174 108
-39 98 79 82 147 32 10 216 53 35 75 101 31 166 180 8 71 267 185 143 85 95 248 71
-3 53 190 6 156 144 122 56 25 228 79 237 78 87 48 172 197 52 157 181 158 101 182
-36 263 125 159 247 76 172 193 109 110 260 22 12 131 176 23 162 161 166 142 14
-201 37 141 19 102 177 60 123 206 55 143 198 89 118 226 47 177 173 192 76 17 187
-54 72 36 146 188 242 96 164 227 84 213 218 81 152 201 150 135 157 64 221 184
-106 124 243 91 263 87 165 109 114 128 69 201 192 72 149 215 133 204 140 20 135
-2 133 91 146 150 248 226 9 183 228 230 32 161 11 136 152 163 81 265 2 20 97 8
-188 204 102 26 265 40 89 235 163 232 60 85 137 185 256 154 233 210 115 127 36
-108 194 104 209 120 103 176 27 30 133 87 10 103 59 90 113 57 175 258 69 88 198
-202 187 171 9 221 29 100 262 205 135 119 70 83 29 62 67 173 75 139 100 111 142
-52 2 175 28 63 33 160 246 43 79 120 141 170 165 260 177 211 186 21 247 38 178
-55 222 66 136 39 94 211 35 226 164 114 90 256 37 28 25 232 215 16 267 223 212
-30 250 24 195 254 239 110 147 28 67 169 132 167 179 243 246 194 142 203 65 263 ^
-578 0 220 147 11 47 3 149 164 57 137 185 120 120 152 78 200 251 87 78 232 177
-22 129 68 168 93 74 100 5 32 174 108 173 141 266 218 232 158 61 186 87 27 75 29
-260 152 59 52 38 106 20 214 132 99 6 12 46 106 7 249 140 29 41 39 124 1 15 115
-136 269 100 262 67 182 38 125 168 74 113 240 24 244 156 146 63 101 210 96 162
-91 127 134 84 164 6 250 120 171 226 143 149 145 96 194 17 62 102 190 155 160
-195 235 8 165 243 157 43 205 16 44 121 119 172 206 15 147 249 121 68 98 58 66
-253 240 5 13 213 165 5 83 248 173 122 35 5 64 17 43 224 247 257 102 177 3 168
-125 187 35 56 138 165 262 118 256 103 157 62 83 229 25 179 137 217 46 55 203
-101 191 135 32 193 69 116 122 54 236 7 268 101 242 209 97 142 233 125 238 109
-121 87 59 1 234 41 258 50 123 253 221 127 153 45 107 174 121 138 133 66 183 205
-267 166 178 138 114 188 53 37 209 148 216 28 74 132 118 237 142 214 164 25 211
-63 69 97 161 194 255 136 250 139 132 169 41 20 163 58 34 57 118 37 177 222 94
-60 238 141 47 22 110 107 225 195 203 82 43 192 51 52 51 71 12 14 180 72 198 117
-38 157 94 9 164 76 15 128 101 261 170 40 40 21 143 200 32 161 143 181 71 31 245
-123 53 256 135 267 134 65 16 63 82 62 153 264 33 109 89 244 124 220 128 50 104
-105 91 146 12 27 145 64 268 82 11 79 199 84 215 80 128 69 65 235 259 17 30 259
-255 187 54 204 81 63 50 136 218 213 197 118 18 29 9 113 189 220 179 124 252 54
-255 155 128 82 30 227 59 252 3 98 90 179 105 21 111 4 97 110 37 190 187 86 130
-16 114 156 127 102 158 42 225 144 129 17 11 28 42 206 266 186 119 223 10 80 96
-143 130 184 153 26 146 44 140 80 115 104 73 165 24 44 191 154 180 53 237 174
-140 99 76 47 54 223 42 6 31 194 236 175 37 158 261 151 79 180 123 2 182 257 51
-103 125 219 231 178 189 1 253 2 201 218 264 1 183 237 193 18 229 244 105 72 185
-152 46 87 46 36 242 241 23 77 14 148 229 263 66 202 166 210 64 49 156 76 28 93
-93 61 135 13 232 126 135 251 36 4 84 145 45 120 139 113 208 181 39 105 40 72
-217 265 251 55 152 27 126 186 138 184 223 61 154 161 175 107 6 269 81 114 207
-201 167 107 206 234 73 184 172 174 89 212 11 98 77 214 113 221 146 31 175 88 45
-139 100 243 189 213 ^
-578 1 51 63 146 108 1 111 51 120 84 73 125 49 205 233 89 38 257 66 64 66 113 15
-192 147 111 17 58 49 16 244 203 46 238 54 170 2 197 169 90 90 41 1 194 62 234
-92 145 113 155 141 226 243 208 200 268 48 21 126 233 40 89 178 206 145 196 166
-255 234 224 105 34 23 41 84 24 176 151 73 42 219 91 225 108 50 151 130 252 184
-34 72 262 163 156 4 112 20 74 177 14 140 91 85 159 243 19 211 110 237 2 114 67
-248 82 241 104 88 126 150 210 247 170 225 157 90 230 262 80 54 162 104 39 86 71
-78 147 28 6 216 41 35 75 97 19 154 172 59 267 185 135 77 95 244 71 267 45 186
-270 144 144 110 48 13 228 75 229 70 75 40 172 189 48 153 177 154 89 170 36 259
-113 147 243 68 160 189 97 102 256 14 8 131 164 19 162 161 158 142 14 197 29 141
-11 90 173 52 115 202 43 131 198 81 106 218 39 169 173 192 64 9 175 50 68 28 138
-176 234 84 156 227 72 213 214 77 144 193 150 127 145 56 217 176 102 124 235 87
-263 83 161 109 102 116 65 201 180 64 149 215 129 200 128 8 123 266 133 79 142
-146 248 222 9 183 220 226 20 157 7 128 148 163 73 265 270 12 93 8 180 204 98 22
-261 28 89 227 155 224 56 85 125 181 256 154 229 210 115 119 32 108 190 100 209
-112 103 176 19 22 121 79 10 95 55 82 109 53 167 258 69 80 194 202 183 171 5 213
-25 88 258 201 131 115 70 83 29 58 67 165 71 127 96 107 138 44 2 163 16 55 33
-160 246 35 67 108 133 162 153 260 165 203 178 17 247 38 174 55 222 58 132 27 86
-211 27 226 160 106 86 260 248 33 20 25 228 207 8 263 215 212 30 242 16 195 254
-239 106 135 28 55 165 120 167 175 239 238 186 130 195 65 250 220 143 9 43 271
-147 160 57 137 181 116 114 150 78 196 249 85 76 232 177 22 129 68 168 87 74 94
-3 26 174 104 171 137 264 218 228 158 59 184 83 21 69 23 256 146 59 52 32 100 20
-214 126 93 10 46 106 3 249 134 25 39 37 122 271 15 109 136 269 100 258 61 182
-36 119 164 68 111 240 18 242 156 144 61 99 206 96 156 87 123 134 82 158 2 246
-118 169 222 141 143 141 94 192 15 60 96 190 149 158 191 235 4 161 241 153 37
-205 10 38 117 117 166 206 13 145 245 115 62 94 52 66 253 236 271 7 211 159 5 81
-246 167 118 29 1 62 11 41 224 245 255 102 173 3 166 123 183 31 56 134 165 260
-116 254 81 ^
-583 1 157 50 71 225 21 167 133 217 42 47 203 89 183 131 28 193 65 116 122 42
-236 7 268 93 242 201 89 138 229 125 238 97 117 75 55 267 230 33 250 50 111 245
-213 127 153 45 99 162 121 134 125 54 175 197 259 166 166 126 106 188 53 33 205
-148 208 16 70 128 106 233 130 210 160 17 207 63 57 97 157 194 247 128 250 135
-132 165 29 16 155 50 26 49 118 37 165 218 94 60 234 137 47 14 110 103 221 191
-195 70 43 184 39 40 47 59 12 6 176 60 194 117 30 153 90 1 164 76 3 124 101 261
-166 36 28 9 143 196 32 153 135 177 67 31 245 123 49 248 135 262 263 126 61 12
-51 78 62 149 260 29 101 77 244 116 212 120 42 92 105 91 138 27 141 52 260 74 3
-79 199 84 211 68 128 61 57 227 255 17 18 259 251 187 46 196 77 55 38 132 210
-205 193 110 18 25 271 105 181 216 179 112 252 50 255 147 116 82 22 219 47 248
-265 86 86 171 93 13 103 266 93 98 25 186 183 86 126 16 110 148 123 94 150 38
-217 132 125 9 273 20 30 198 266 178 119 219 2 72 88 131 118 172 145 26 134 40
-132 80 107 96 65 161 24 44 191 150 168 41 229 170 140 99 72 43 54 215 42 2 27
-186 228 163 29 146 253 147 71 180 119 264 178 249 43 99 117 219 231 170 185 1
-249 272 197 214 264 263 171 237 189 6 221 236 97 72 173 152 38 87 34 28 238 241
-19 77 10 136 229 255 62 194 162 206 56 45 144 64 24 89 93 53 123 9 228 118 127
-243 24 4 72 133 33 120 127 113 200 181 27 101 32 68 213 257 251 43 144 19 122
-186 138 184 223 61 142 149 175 107 6 261 81 114 207 193 155 95 202 226 73 180
-164 166 81 204 11 98 65 206 101 221 146 19 167 88 41 139 92 235 189 235 45 59
-142 104 273 105 51 118 82 67 121 49 203 233 85 34 257 62 64 64 109 11 188 143
-111 11 58 45 14 240 201 44 236 52 170 270 197 169 88 86 41 269 190 58 234 92
-145 111 155 135 222 243 208 200 266 48 21 122 231 40 87 178 204 141 196 162 251
-232 222 99 32 23 37 80 22 174 145 71 36 217 87 223 106 44 151 130 250 180 34 68
-258 159 154 272 112 18 70 173 8 136 85 79 159 239 19 207 108 233 112 63 246 76
-237 104 84 126 146 208 245 168 225 151 90 230 262 74 48 156 102 39 80 67 76 147
-26 4 216 35 35 75 95 13 148 168 270 53 267 185 131 73 95 242 71 265 41 184 268
-138 144 104 44 7 228 73 225 66 69 36 272 ^
-588 0 181 44 149 173 150 77 158 36 255 101 135 239 60 148 185 85 94 252 6 4 131
-152 15 162 161 150 142 14 193 21 141 3 78 169 44 107 198 31 119 198 73 94 210
-31 161 173 192 52 1 163 46 64 20 130 164 226 72 148 227 60 213 210 73 136 185
-150 119 133 48 213 168 98 124 227 83 263 79 157 109 90 104 61 201 168 56 149
-215 125 196 116 272 111 262 133 67 138 142 248 218 9 183 212 222 8 153 3 120
-144 163 65 265 270 4 89 8 172 204 94 18 257 16 89 219 147 216 52 85 113 177 256
-154 225 210 115 111 28 108 186 96 209 104 103 176 11 14 109 71 10 87 51 74 105
-49 159 258 69 72 190 202 179 171 1 205 21 76 254 197 127 111 70 83 29 54 67 157
-67 115 92 103 134 36 2 151 4 47 33 160 246 27 55 96 125 154 141 260 153 195 170
-13 247 38 170 55 222 50 128 15 78 211 19 226 156 98 82 252 240 29 12 25 224 199
-259 207 212 30 234 8 195 254 239 102 123 28 43 161 108 167 171 235 230 178 118
-187 65 242 220 135 5 35 267 143 152 57 137 173 108 102 146 78 188 245 81 72 232
-177 22 129 68 168 75 74 82 275 14 174 96 167 129 260 218 220 158 55 180 75 9 57
-11 248 134 59 52 20 88 20 214 114 81 264 6 46 106 271 249 122 17 35 33 118 271
-15 97 136 269 100 250 49 182 32 107 156 56 107 240 6 238 156 140 57 95 198 96
-144 79 115 134 78 146 270 238 114 165 214 137 131 133 90 188 11 56 84 190 137
-154 183 235 272 153 237 145 25 205 274 26 109 113 154 206 9 141 237 103 50 86
-40 66 253 228 263 271 207 147 5 77 242 155 110 17 269 58 275 37 224 241 251 102
-165 3 162 119 175 23 56 126 165 256 112 250 91 157 44 65 223 19 161 131 217 40
-43 203 83 179 129 26 193 63 116 122 36 236 7 268 89 242 197 85 136 227 125 238
-91 115 69 53 265 228 29 246 50 105 241 209 127 153 45 95 156 121 132 121 48 171
-193 255 166 160 120 102 188 53 31 203 148 204 10 68 126 100 231 124 208 158 13
-205 63 51 97 155 194 243 124 250 133 132 163 23 14 151 46 22 45 118 37 159 216
-94 60 232 135 47 10 110 101 219 189 191 64 43 180 33 34 45 53 12 2 174 54 192
-117 26 151 88 273 164 76 273 122 101 261 164 34 22 3 143 194 32 149 131 175 65
-31 245 123 47 244 135 258 261 122 59 10 45 76 62 147 258 27 97 71 244 112 208
-116 38 86 105 91 134 270 27 139 46 256 70 275 79 199 160 ^
-594 0 207 56 128 53 49 219 251 17 6 259 247 187 38 188 73 47 26 128 202 197 189
-102 18 21 263 97 173 212 179 100 252 46 255 139 104 82 14 211 35 244 257 74 82
-163 81 5 95 258 89 86 13 182 179 86 122 16 106 140 119 86 142 34 209 120 121 1
-265 12 18 190 266 170 119 215 272 64 80 119 106 160 137 26 122 36 124 80 99 88
-57 157 24 44 191 146 156 29 221 166 140 99 68 39 54 207 42 276 23 178 220 151
-21 134 245 143 63 180 115 256 174 241 35 95 109 219 231 162 181 1 245 272 193
-210 264 255 159 237 185 272 213 228 89 72 161 152 30 87 22 20 234 241 15 77 6
-124 229 247 58 186 158 202 48 41 132 52 20 85 93 45 111 5 224 110 119 235 12 4
-60 121 21 120 115 113 192 181 15 97 24 64 209 249 251 31 136 11 118 186 138 184
-223 61 130 137 175 107 6 253 81 114 207 185 143 83 198 218 73 176 156 158 73
-196 11 98 53 198 89 221 146 7 159 88 37 139 84 227 189 231 33 51 134 96 273 93
-51 114 78 55 113 49 199 233 77 26 257 54 64 60 101 3 180 135 111 277 58 37 10
-232 197 40 232 48 170 262 197 169 84 78 41 261 182 50 234 92 145 107 155 123
-214 243 208 200 262 48 21 114 227 40 83 178 200 133 196 154 243 228 218 87 28
-23 29 72 18 170 133 67 24 213 79 219 102 32 151 130 246 172 34 60 250 151 150
-264 112 14 62 165 274 128 73 67 159 231 19 199 104 225 274 108 55 242 64 229
-104 76 126 138 204 241 164 225 139 90 230 262 62 36 144 98 39 68 59 72 147 22
-216 23 35 75 91 1 136 160 266 41 267 185 123 65 95 238 71 261 33 180 264 126
-144 92 36 273 228 69 217 58 57 28 172 177 42 147 171 148 71 152 36 253 95 129
-237 56 142 183 79 90 250 2 2 131 146 13 162 161 146 142 14 191 17 141 277 72
-167 40 103 196 25 113 198 69 88 206 27 157 173 192 46 275 157 44 62 16 126 158
-222 66 144 227 54 213 208 71 132 181 150 115 127 44 211 164 96 124 223 81 263
-77 155 109 84 98 59 201 162 52 149 215 123 194 110 268 105 260 133 61 136 140
-248 216 9 183 208 220 2 151 1 116 142 163 61 265 270 87 8 168 204 92 16 255 10
-89 215 143 212 50 85 107 175 256 154 223 210 115 107 26 108 184 94 209 100 103
-176 7 10 103 67 10 83 49 70 103 47 155 258 69 68 188 202 177 171 277 201 19 70
-252 195 125 109 70 83 29 52 67 153 65 109 90 101 132 32 2 145 276 43 33 160 246
-23 259 ^
-600 1 87 119 148 132 260 144 189 164 10 247 38 167 55 222 44 125 6 72 211 13
-226 153 92 79 246 234 26 6 25 221 193 273 256 201 212 30 228 2 195 254 239 99
-114 28 34 158 99 167 168 232 224 172 109 181 65 236 220 129 2 29 264 140 146 57
-137 167 102 93 143 78 182 242 78 69 232 177 22 129 68 168 66 74 73 275 5 174 90
-164 123 257 218 214 158 52 177 69 48 2 242 125 59 52 11 79 20 214 105 72 258 3
-46 106 268 249 113 11 32 30 115 271 15 88 136 269 100 244 40 182 29 98 150 47
-104 240 276 235 156 137 54 92 192 96 135 73 109 134 75 137 267 232 111 162 208
-134 122 127 87 185 8 53 75 190 128 151 177 235 269 147 234 139 16 205 268 17
-103 110 145 206 6 138 231 94 41 80 31 66 253 222 257 265 204 138 5 74 239 146
-104 8 266 55 269 34 224 238 248 102 159 3 159 116 169 17 56 120 165 253 109 247
-85 157 35 56 220 16 152 128 217 37 37 203 74 173 126 23 193 60 116 122 27 236 7
-268 83 242 191 79 133 224 125 238 82 112 60 50 262 225 23 240 50 96 235 203 127
-153 45 89 147 121 129 115 39 165 187 249 166 151 111 96 188 53 28 200 148 198 1
-65 123 91 228 115 205 155 7 202 63 42 97 152 194 237 118 250 130 132 160 14 11
-145 40 16 39 118 37 150 213 94 60 229 132 47 4 110 98 216 186 185 55 43 174 24
-25 42 44 12 275 171 45 189 117 20 148 85 270 164 76 267 119 101 261 161 31 13
-273 143 191 32 143 125 172 62 31 245 123 44 238 135 252 258 116 56 7 36 73 62
-144 255 24 91 62 244 106 202 110 32 77 105 91 128 264 27 136 37 250 64 272 79
-199 84 206 53 128 51 47 217 250 17 3 259 246 187 36 186 72 45 23 127 200 195
-188 100 18 20 261 95 171 211 179 97 252 45 255 137 101 82 12 209 32 243 255 71
-81 161 78 3 93 256 88 83 10 181 178 86 121 16 105 138 118 84 140 33 207 117 120
-278 263 10 15 188 266 168 119 214 271 62 78 116 103 157 135 26 119 35 122 80 97
-86 55 156 24 44 191 145 153 26 219 165 140 99 67 38 54 205 42 276 22 176 218
-148 19 131 243 142 61 180 114 254 173 239 33 94 107 219 231 160 180 1 244 272
-192 209 264 253 156 237 184 270 211 226 87 72 158 152 28 87 19 18 233 241 14 77
-5 121 229 245 57 184 157 201 46 40 129 49 19 84 93 43 108 4 223 108 117 233 9 4
-57 118 18 120 112 113 190 181 12 96 22 63 208 247 251 28 134 9 117 186 138 184
-223 61 127 216 ^
-590 1 175 107 6 247 81 114 207 179 134 74 195 212 73 173 150 152 67 190 11 98
-44 192 80 221 146 279 153 88 34 139 78 221 189 228 24 45 128 90 273 84 51 111
-75 46 107 49 196 233 71 20 257 48 64 57 95 278 174 129 111 271 58 31 7 226 194
-37 229 45 170 256 197 169 81 72 41 255 176 44 234 92 145 104 155 114 208 243
-208 200 259 48 21 108 224 40 80 178 197 127 196 148 237 225 215 78 25 23 23 66
-15 167 124 64 15 210 73 216 99 23 151 130 243 166 34 54 244 145 147 258 112 11
-56 159 268 122 64 58 159 225 19 193 101 219 274 105 49 239 55 223 104 70 126
-132 201 238 161 225 130 90 230 262 53 27 135 95 39 59 53 69 147 19 278 216 14
-35 75 88 273 127 154 263 32 267 185 117 59 95 235 71 258 27 177 261 117 144 83
-30 267 228 66 211 52 48 22 172 171 39 144 168 145 62 143 36 250 86 120 234 50
-133 180 70 84 247 277 280 131 137 10 162 161 140 142 14 188 11 141 274 63 164
-34 97 193 16 104 198 63 79 200 21 151 173 192 37 272 148 41 59 10 120 149 216
-57 138 227 45 213 205 68 126 175 150 109 118 38 208 158 93 124 217 78 263 74
-152 109 75 89 56 201 153 46 149 215 120 191 101 262 96 257 133 52 133 137 248
-213 9 183 202 217 274 148 279 110 139 163 55 265 270 275 84 8 162 204 89 13 252
-1 89 209 137 206 47 85 98 172 256 154 220 210 115 101 23 108 181 91 209 94 103
-176 1 4 94 61 10 77 46 64 100 44 149 258 69 62 185 202 174 171 277 195 16 61
-249 192 122 106 70 83 29 49 67 147 62 100 87 98 129 26 2 136 270 37 33 160 246
-17 40 81 115 144 126 260 138 185 160 8 247 38 165 55 222 40 123 68 211 9 226
-151 88 77 242 230 24 2 25 219 189 271 254 197 212 30 224 279 195 254 239 97 108
-28 28 156 93 167 166 230 220 168 103 177 65 232 220 125 25 262 138 142 57 137
-163 98 87 141 78 178 240 76 67 232 177 22 129 68 168 60 74 67 275 280 174 86
-162 119 255 218 210 158 50 175 65 275 42 277 238 119 59 52 5 73 20 214 99 66
-254 1 46 106 266 249 107 7 30 28 113 271 15 82 136 269 100 240 34 182 27 92 146
-41 102 240 272 233 156 135 52 90 188 96 129 69 105 134 73 131 265 228 109 160
-204 132 116 123 85 183 6 51 69 190 122 149 173 235 267 143 232 135 10 205 264
-11 99 108 139 206 4 136 227 88 35 76 25 66 253 218 253 261 202 132 5 72 237 140
-203 ^
-620 0 279 262 51 261 30 224 234 244 102 151 3 155 112 161 9 56 112 165 249 105
-243 77 157 23 44 216 12 140 124 217 33 29 203 62 165 122 19 193 56 116 122 15
-236 7 268 75 242 183 71 129 220 125 238 70 108 48 46 258 221 15 232 50 84 227
-195 127 153 45 81 135 121 125 107 27 157 179 241 166 139 99 88 188 53 24 196
-148 190 272 61 119 79 224 103 201 151 282 198 63 30 97 148 194 229 110 250 126
-132 156 2 7 137 32 8 31 118 37 138 209 94 60 225 128 47 279 110 94 212 182 177
-43 43 166 12 13 38 32 12 271 167 33 185 117 12 144 81 266 164 76 259 115 101
-261 157 27 1 265 143 187 32 135 117 168 58 31 245 123 40 230 135 244 254 108 52
-3 24 69 62 140 251 20 83 50 244 98 194 102 24 65 105 91 120 256 27 132 25 242
-56 268 79 199 84 202 41 128 43 39 209 246 17 274 259 242 187 28 178 68 37 11
-123 192 187 184 92 18 16 253 87 163 207 179 85 252 41 255 129 89 82 4 201 20
-239 247 59 77 153 66 278 85 248 84 71 281 177 174 86 117 16 101 130 114 76 132
-29 199 105 116 274 255 2 3 180 266 160 119 210 267 54 70 104 91 145 127 26 107
-31 114 80 89 78 47 152 24 44 191 141 141 14 211 161 140 99 63 34 54 197 42 276
-18 168 210 136 11 119 235 138 53 180 110 246 169 231 25 90 99 219 231 152 176 1
-240 272 188 205 264 245 144 237 180 262 203 218 79 72 146 152 20 87 7 10 229
-241 10 77 1 109 229 237 53 176 153 197 38 36 117 37 15 80 93 35 96 219 100 109
-225 280 4 45 106 6 120 100 113 182 181 92 14 59 204 239 251 16 126 1 113 186
-138 184 223 61 115 122 175 107 6 243 81 114 207 175 128 68 193 208 73 171 146
-148 63 186 11 98 38 188 74 221 146 275 149 88 32 139 74 217 189 226 18 41 124
-86 273 78 51 109 73 40 103 49 194 233 67 16 257 44 64 55 91 276 170 125 111 267
-58 27 5 222 192 35 227 43 170 252 197 169 79 68 41 251 172 40 234 92 145 102
-155 108 204 243 208 200 257 48 21 104 222 40 78 178 195 123 196 144 233 223 213
-72 23 23 19 62 13 165 118 62 9 208 69 214 97 17 151 130 241 162 34 50 240 141
-145 254 112 9 52 155 264 118 58 52 159 221 19 189 99 215 274 103 45 237 49 219
-104 66 126 128 199 236 159 225 124 90 230 262 47 21 129 93 39 53 49 67 147 17
-278 216 8 35 75 86 269 121 150 261 26 267 185 113 55 95 233 71 256 23 175 259
-111 144 77 26 263 228 64 207 48 42 18 172 167 37 142 166 143 56 137 36 248 80
-114 232 46 127 257 ^
-605 1 58 76 243 273 280 131 125 6 162 161 132 142 14 184 3 141 270 51 160 26 89
-189 4 92 198 55 67 192 13 143 173 192 25 268 136 37 55 2 112 137 208 45 130 227
-33 213 201 64 118 167 150 101 106 30 204 150 89 124 209 74 263 70 148 109 63 77
-52 201 141 38 149 215 116 187 89 254 84 253 133 40 129 133 248 209 9 183 194
-213 266 144 279 102 135 163 47 265 270 271 80 8 154 204 85 9 248 274 89 201 129
-198 43 85 86 168 256 154 216 210 115 93 19 108 177 87 209 86 103 176 278 281 82
-53 10 69 42 56 96 40 141 258 69 54 181 202 170 171 277 187 12 49 245 188 118
-102 70 83 29 45 67 139 58 88 83 94 125 18 2 124 262 29 33 160 246 9 28 69 107
-136 114 260 126 177 152 4 247 38 161 55 222 32 119 273 60 211 1 226 147 80 73
-234 222 20 279 25 215 181 267 250 189 212 30 216 275 195 254 239 93 96 28 16
-152 81 167 162 226 212 160 91 169 65 224 220 117 281 17 258 134 134 57 137 155
-90 75 137 78 170 236 72 63 232 177 22 129 68 168 48 74 55 275 272 174 78 158
-111 251 218 202 158 46 171 57 267 30 269 230 107 59 52 278 61 20 214 87 54 246
-282 46 106 262 249 95 284 26 24 109 271 15 70 136 269 100 232 22 182 23 80 138
-29 98 240 264 229 156 131 48 86 180 96 117 61 97 134 69 119 261 220 105 156 196
-128 104 115 81 179 2 47 57 190 110 145 165 235 263 135 228 127 283 205 256 284
-91 104 127 206 132 219 76 23 68 13 66 253 210 245 253 198 120 5 68 233 128 92
-275 260 49 257 28 224 232 242 102 147 3 153 110 157 5 56 108 165 247 103 241 73
-157 17 38 214 10 134 122 217 31 25 203 56 161 120 17 193 54 116 122 9 236 7 268
-71 242 179 67 127 218 125 238 64 106 42 44 256 219 11 228 50 78 223 191 127 153
-45 77 129 121 123 103 21 153 175 237 166 133 93 84 188 53 22 194 148 186 268 59
-117 73 222 97 199 149 280 196 63 24 97 146 194 225 106 250 124 132 154 281 5
-133 28 4 27 118 37 132 207 94 60 223 126 47 277 110 92 210 180 173 37 43 162 6
-7 36 26 12 269 165 27 183 117 8 142 79 264 164 76 255 113 101 261 155 25 280
-261 143 185 32 131 113 166 56 31 245 123 38 226 135 240 252 104 50 1 18 67 62
-138 249 18 79 44 244 94 190 98 20 59 105 91 116 252 27 130 19 238 52 266 79 199
-84 200 35 128 39 35 205 244 17 270 259 240 187 24 174 66 33 5 121 188 183 182
-88 18 14 249 83 159 205 179 79 252 186 ^
-615 0 255 121 77 82 283 193 8 235 239 47 73 145 54 274 77 240 80 59 273 173 170
-86 113 16 97 122 110 68 124 25 191 93 112 270 247 281 278 172 266 152 119 206
-263 46 62 92 79 133 119 26 95 27 106 80 81 70 39 148 24 44 191 137 129 2 203
-157 140 99 59 30 54 189 42 276 14 160 202 124 3 107 227 134 45 180 106 238 165
-223 17 86 91 219 231 144 172 1 236 272 184 201 264 237 132 237 176 254 195 210
-71 72 134 152 12 87 282 2 225 241 6 77 284 97 229 229 49 168 149 193 30 32 105
-25 11 76 93 27 84 283 215 92 101 217 272 4 33 94 281 120 88 113 174 181 275 88
-6 55 200 231 251 4 118 280 109 186 138 184 223 61 103 110 175 107 6 235 81 114
-207 167 116 56 189 200 73 167 138 140 55 178 11 98 26 180 62 221 146 267 141 88
-28 139 66 209 189 222 6 33 116 78 273 66 51 105 69 28 95 49 190 233 59 8 257 36
-64 51 83 272 162 117 111 259 58 19 1 214 188 31 223 39 170 244 197 169 75 60 41
-243 164 32 234 92 145 98 155 96 196 243 208 200 253 48 21 96 218 40 74 178 191
-115 196 136 225 219 209 60 19 23 11 54 9 161 106 58 284 204 61 210 93 5 151 130
-237 154 34 42 232 133 141 246 112 5 44 147 256 110 46 40 159 213 19 181 95 207
-274 99 37 233 37 211 104 58 126 120 195 232 155 225 112 90 230 262 35 9 117 89
-39 41 41 63 147 13 278 216 283 35 75 82 261 109 142 257 14 267 185 105 47 95
-229 71 252 15 171 255 99 144 65 18 255 228 60 199 40 30 10 172 159 33 138 162
-139 44 125 36 244 68 102 228 38 115 174 52 72 241 271 280 131 119 4 162 161 128
-142 14 182 286 141 268 45 158 22 85 187 285 86 198 51 61 188 9 139 173 192 19
-266 130 35 53 285 108 131 204 39 126 227 27 213 199 62 114 163 150 97 100 26
-202 146 87 124 205 72 263 68 146 109 57 71 50 201 135 34 149 215 114 185 83 250
-78 251 133 34 127 131 248 207 9 183 190 211 262 142 279 98 133 163 43 265 270
-269 78 8 150 204 83 7 246 270 89 197 125 194 41 85 80 166 256 154 214 210 115
-89 17 108 175 85 209 82 103 176 276 279 76 49 10 65 40 52 94 38 137 258 69 50
-179 202 168 171 277 183 10 43 243 186 116 100 70 83 29 43 67 135 56 82 81 92
-123 14 2 118 258 25 33 160 246 5 22 63 103 132 108 260 120 173 148 2 247 38 159
-55 222 28 117 269 56 211 284 226 145 76 71 230 218 18 277 25 213 177 265 248
-185 212 30 212 273 195 254 239 91 90 28 10 150 75 167 160 224 175 ^
-613 0 152 79 161 65 216 220 109 281 9 254 130 126 57 137 147 82 63 133 78 162
-232 68 59 232 177 22 129 68 168 36 74 43 275 264 174 70 154 103 247 218 194 158
-42 167 49 259 18 261 222 95 59 52 270 49 20 214 75 42 238 282 46 106 258 249 83
-280 22 20 105 271 15 58 136 269 100 224 10 182 19 68 130 17 94 240 256 225 156
-127 44 82 172 96 105 53 89 134 65 107 257 212 101 152 188 124 92 107 77 175 287
-43 45 190 98 141 157 235 259 127 224 119 275 205 248 276 83 100 115 206 285 128
-211 64 11 60 1 66 253 202 237 245 194 108 5 64 229 116 84 267 256 45 249 24 224
-228 238 102 139 3 149 106 149 286 56 100 165 243 99 237 65 157 5 26 210 6 122
-118 217 27 17 203 44 153 116 13 193 50 116 122 286 236 7 268 63 242 171 59 123
-214 125 238 52 102 30 40 252 215 3 220 50 66 215 183 127 153 45 69 117 121 119
-95 9 145 167 229 166 121 81 76 188 53 18 190 148 178 260 55 113 61 218 85 195
-145 276 192 63 12 97 142 194 217 98 250 120 132 150 273 1 125 20 285 19 118 37
-120 203 94 60 219 122 47 273 110 88 206 176 165 25 43 154 283 284 32 14 12 265
-161 15 179 117 138 75 260 164 76 247 109 101 261 151 21 272 253 143 181 32 123
-105 162 52 31 245 123 34 218 135 232 248 96 46 286 6 63 62 134 245 14 71 32 244
-86 182 90 12 47 105 91 108 244 27 126 7 230 44 262 79 199 84 196 23 128 31 27
-197 240 17 262 259 236 187 16 166 62 25 282 117 180 175 178 80 18 10 241 75 151
-201 179 67 252 35 255 117 71 82 281 189 2 233 235 41 71 141 48 272 73 236 78 53
-269 171 168 86 111 16 95 118 108 64 120 23 187 87 110 268 243 279 274 168 266
-148 119 204 261 42 58 86 73 127 115 26 89 25 102 80 77 66 35 146 24 44 191 135
-123 285 199 155 140 99 57 28 54 185 42 276 12 156 198 118 288 101 223 132 41
-180 104 234 163 219 13 84 87 219 231 140 170 1 234 272 182 199 264 233 126 237
-174 250 191 206 67 72 128 152 8 87 278 287 223 241 4 77 284 91 229 225 47 164
-147 191 26 30 99 19 9 74 93 23 78 283 213 88 97 213 268 4 27 88 277 120 82 113
-170 181 271 86 2 53 198 227 251 287 114 278 107 186 138 184 223 61 97 104 175
-107 6 231 81 114 207 163 110 50 187 196 73 165 134 136 51 174 11 98 20 176 56
-221 146 263 137 88 26 139 62 205 189 220 29 112 74 273 60 51 103 67 22 91 49
-188 233 55 4 257 32 64 49 79 270 158 113 111 255 58 15 288 210 213 ^
-624 1 28 220 36 170 238 197 169 72 54 41 237 158 26 234 92 145 95 155 87 190
-243 208 200 250 48 21 90 215 40 71 178 188 109 196 130 219 216 206 51 16 23 5
-48 6 158 97 55 278 201 55 207 90 286 151 130 234 148 34 36 226 127 138 240 112
-2 38 141 250 104 37 31 159 207 19 175 92 201 274 96 31 230 28 205 104 52 126
-114 192 229 152 225 103 90 230 262 26 108 86 39 32 35 60 147 10 278 216 277 35
-75 79 255 100 136 254 5 267 185 99 41 95 226 71 249 9 168 252 90 144 56 12 249
-228 57 193 34 21 4 172 153 30 135 159 136 35 116 36 241 59 93 225 32 106 171 43
-66 238 268 280 131 110 1 162 161 122 142 14 179 283 141 265 36 155 16 79 184
-279 77 198 45 52 182 3 133 173 192 10 263 121 32 50 282 102 122 198 30 120 227
-18 213 196 59 108 157 150 91 91 20 199 140 84 124 199 69 263 65 143 109 48 62
-47 201 126 28 149 215 111 182 74 244 69 248 133 25 124 128 248 204 9 183 184
-208 256 139 279 92 130 163 37 265 270 266 75 8 144 204 80 4 243 264 89 191 119
-188 38 85 71 163 256 154 211 210 115 83 14 108 172 82 209 76 103 176 273 276 67
-43 10 59 37 46 91 35 131 258 69 44 176 202 165 171 277 177 7 34 240 183 113 97
-70 83 29 40 67 129 53 73 78 89 120 8 2 109 252 19 33 160 246 289 13 54 97 126
-99 260 111 167 142 289 247 38 156 55 222 22 114 263 50 211 281 226 142 70 68
-224 212 15 274 25 210 171 262 245 179 212 30 206 270 195 254 239 88 81 28 1 147
-66 167 157 221 202 150 76 159 65 214 220 107 281 7 253 129 124 57 137 145 80 60
-132 78 160 231 67 58 232 177 22 129 68 168 33 74 40 275 262 174 68 153 101 246
-218 192 158 41 166 47 257 15 259 220 92 59 52 268 46 20 214 72 39 236 282 46
-106 257 249 80 279 21 19 104 271 15 55 136 269 100 222 7 182 18 65 128 14 93
-240 254 224 156 126 43 81 170 96 102 51 87 134 64 104 256 210 100 151 186 123
-89 105 76 174 287 42 42 190 95 140 155 235 258 125 223 117 273 205 246 274 81
-99 112 206 285 127 209 61 8 58 288 66 253 200 235 243 193 105 5 63 228 113 82
-265 255 44 247 23 224 227 237 102 137 3 148 105 147 285 56 98 165 242 98 236 63
-157 2 23 209 5 119 117 217 26 15 203 41 151 115 12 193 49 116 122 284 236 7 268
-61 242 169 57 122 213 125 238 49 101 27 39 251 214 1 218 50 63 213 181 127 153
-45 67 114 121 118 93 6 143 165 227 166 118 78 74 188 53 17 189 148 176 258 54
-112 58 217 82 194 144 275 191 141 ^
-628 1 3 97 139 194 211 92 250 117 132 147 267 290 119 14 282 13 118 37 111 200
-94 60 216 119 47 270 110 85 203 173 159 16 43 148 277 278 29 5 12 262 158 6 176
-117 286 135 72 257 164 76 241 106 101 261 148 18 266 247 143 178 32 117 99 159
-49 31 245 123 31 212 135 226 245 90 43 286 289 60 62 131 242 11 65 23 244 80
-176 84 6 38 105 91 102 238 27 123 290 224 38 259 79 199 84 193 14 128 25 21 191
-237 17 256 259 233 187 10 160 59 19 276 114 174 169 175 74 18 7 235 69 145 198
-179 58 252 32 255 111 62 82 278 183 285 230 229 32 68 135 39 269 67 230 75 44
-263 168 165 86 108 16 92 112 105 58 114 20 181 78 107 265 237 276 268 162 266
-142 119 201 258 36 52 77 64 118 109 26 80 22 96 80 71 60 29 143 24 44 191 132
-114 279 193 152 140 99 54 25 54 179 42 276 9 150 192 109 285 92 217 129 35 180
-101 228 160 213 7 81 81 219 231 134 167 1 231 272 179 196 264 227 117 237 171
-244 185 200 61 72 119 152 2 87 272 284 220 241 1 77 284 82 229 219 44 158 144
-188 20 27 90 10 6 71 93 17 69 283 210 82 91 207 262 4 18 79 271 120 73 113 164
-181 265 83 288 50 195 221 251 281 108 275 104 186 138 184 223 61 88 95 175 107
-6 225 81 114 207 157 101 41 184 190 73 162 128 130 45 168 11 98 11 170 47 221
-146 257 131 88 23 139 56 199 189 217 283 23 106 68 273 51 51 100 64 13 85 49
-185 233 49 290 257 26 64 46 73 267 152 107 111 249 58 9 288 204 183 26 218 34
-170 234 197 169 70 50 41 233 154 22 234 92 145 93 155 81 186 243 208 200 248 48
-21 86 213 40 69 178 186 105 196 126 215 214 204 45 14 23 1 44 4 156 91 53 274
-199 51 205 88 282 151 130 232 144 34 32 222 123 136 236 112 34 137 246 100 31
-25 159 203 19 171 90 197 274 94 27 228 22 201 104 48 126 110 190 227 150 225 97
-90 230 262 20 286 102 84 39 26 31 58 147 8 278 216 273 35 75 77 251 94 132 252
-291 267 185 95 37 95 224 71 247 5 166 250 84 144 50 8 245 228 55 189 30 15 172
-149 28 133 157 134 29 110 36 239 53 87 223 28 100 169 37 62 236 266 280 131 104
-291 162 161 118 142 14 177 281 141 263 30 153 12 75 182 275 71 198 41 46 178
-291 129 173 192 4 261 115 30 48 280 98 116 194 24 116 227 12 213 194 57 104 153
-150 87 85 16 197 136 82 124 195 67 263 63 141 109 42 56 45 201 120 24 149 215
-109 180 68 240 63 246 133 19 122 126 248 202 9 183 180 206 252 137 279 88 128
-163 33 265 270 264 73 8 140 204 78 2 241 76 ^
-622 0 89 183 111 180 34 85 59 159 256 154 207 210 115 75 10 108 168 78 209 68
-103 176 269 272 55 35 10 51 33 38 87 31 123 258 69 36 172 202 161 171 277 169 3
-22 236 179 109 93 70 83 29 36 67 121 49 61 74 85 116 2 97 244 11 33 160 246 285
-1 42 89 118 87 260 99 159 134 289 247 38 152 55 222 14 110 255 42 211 277 226
-138 62 64 216 204 11 270 25 206 163 258 241 171 212 30 198 266 195 254 239 84
-69 28 283 143 54 167 153 217 194 142 64 151 65 206 220 99 281 293 249 125 116
-57 137 137 72 48 128 78 152 227 63 54 232 177 22 129 68 168 21 74 28 275 254
-174 60 149 93 242 218 184 158 37 162 39 249 3 251 212 80 59 52 260 34 20 214 60
-27 228 282 46 106 253 249 68 275 17 15 100 271 15 43 136 269 100 214 289 182 14
-53 120 2 89 240 246 220 156 122 39 77 162 96 90 43 79 134 60 92 252 202 96 147
-178 119 77 97 72 170 287 38 30 190 83 136 147 235 254 117 219 109 265 205 238
-266 73 95 100 206 285 123 201 49 290 50 280 66 253 192 227 235 189 93 5 59 224
-101 74 257 251 40 239 19 224 223 233 102 129 3 144 101 139 281 56 90 165 238 94
-232 55 157 284 11 205 1 107 113 217 22 7 203 29 143 111 8 193 45 116 122 276
-236 7 268 53 242 161 49 118 209 125 238 37 97 15 35 247 210 287 210 50 51 205
-173 127 153 45 59 102 121 114 85 288 135 157 219 166 106 66 66 188 53 13 185
-148 168 250 50 108 46 213 70 190 140 271 187 63 291 97 137 194 207 88 250 115
-132 145 263 290 115 10 280 9 118 37 105 198 94 60 214 117 47 268 110 83 201 171
-155 10 43 144 273 274 27 293 12 260 156 174 117 284 133 70 255 164 76 237 104
-101 261 146 16 262 243 143 176 32 113 95 157 47 31 245 123 29 208 135 222 243
-86 41 286 285 58 62 129 240 9 61 17 244 76 172 80 2 32 105 91 98 234 27 121 286
-220 34 257 79 199 84 191 8 128 21 17 187 235 17 252 259 231 187 6 156 57 15 272
-112 170 165 173 70 18 5 231 65 141 196 179 52 252 30 255 107 56 82 276 179 281
-228 225 26 66 131 33 267 63 226 73 38 259 166 163 86 106 16 90 108 103 54 110
-18 177 72 105 263 233 274 264 158 266 138 119 199 256 32 48 71 58 112 105 26 74
-20 92 80 67 56 25 141 24 44 191 130 108 275 189 150 140 99 52 23 54 175 42 276
-7 146 188 103 283 86 213 127 31 180 99 224 158 209 3 79 77 219 231 130 165 1
-229 272 177 194 264 223 111 237 169 240 181 196 57 72 113 152 292 87 268 282
-218 241 293 77 284 76 229 80 ^
-635 1 40 150 140 184 12 23 78 294 2 67 93 9 57 283 206 74 83 199 254 4 6 67 263
-120 61 113 156 181 257 79 284 46 191 213 251 273 100 271 100 186 138 184 223 61
-76 83 175 107 6 217 81 114 207 149 89 29 180 182 73 158 120 122 37 160 11 98
-295 162 35 221 146 249 123 88 19 139 48 191 189 213 275 15 98 60 273 39 51 96
-60 1 77 49 181 233 41 286 257 18 64 42 65 263 144 99 111 241 58 1 288 196 179
-22 214 30 170 226 197 169 66 42 41 225 146 14 234 92 145 89 155 69 178 243 208
-200 244 48 21 78 209 40 65 178 182 97 196 118 207 210 200 33 10 23 289 36 152
-79 49 266 195 43 201 84 274 151 130 228 136 34 24 214 115 132 228 112 292 26
-129 238 92 19 13 159 195 19 163 86 189 274 90 19 224 10 193 104 40 126 102 186
-223 146 225 85 90 230 262 8 278 90 80 39 14 23 54 147 4 278 216 265 35 75 73
-243 82 124 248 283 267 185 87 29 95 220 71 243 293 162 246 72 144 38 237 228 51
-181 22 3 288 172 141 24 129 153 130 17 98 36 235 41 75 219 20 88 165 25 54 232
-262 280 131 92 291 162 161 110 142 14 173 277 141 259 18 149 4 67 178 267 59
-198 33 34 170 287 121 173 192 288 257 103 26 44 276 90 104 186 12 108 227 213
-190 53 96 145 150 79 73 8 193 128 78 124 187 63 263 59 137 109 30 44 41 201 108
-16 149 215 105 176 56 232 51 242 133 7 118 122 248 198 9 183 172 202 244 133
-279 80 124 163 25 265 270 260 69 8 132 204 74 294 237 252 89 179 107 176 32 85
-53 157 256 154 205 210 115 71 8 108 166 76 209 64 103 176 267 270 49 31 10 47
-31 34 85 29 119 258 69 32 170 202 159 171 277 165 1 16 234 177 107 91 70 83 29
-34 67 117 47 55 72 83 114 292 2 91 240 7 33 160 246 283 291 36 85 114 81 260 93
-155 130 289 247 38 150 55 222 10 108 251 38 211 275 226 136 58 62 212 200 9 268
-25 204 159 256 239 167 212 30 194 264 195 254 239 82 63 28 279 141 48 167 151
-215 190 138 58 147 65 202 220 95 281 291 247 123 112 57 137 133 68 42 126 78
-148 225 61 52 232 177 22 129 68 168 15 74 22 275 250 174 56 147 89 240 218 180
-158 35 160 35 245 293 247 208 74 59 52 256 28 20 214 54 21 224 282 46 106 251
-249 62 273 15 13 98 271 15 37 136 269 100 210 285 182 12 47 116 292 87 240 242
-218 156 120 37 75 158 96 84 39 75 134 58 86 250 198 94 145 174 117 71 93 70 168
-287 36 24 190 77 134 143 235 252 113 217 105 261 205 234 262 69 93 94 206 285
-121 197 43 286 46 276 66 253 188 223 231 187 87 5 57 222 95 285 ^
-636 0 251 248 37 233 16 224 220 230 102 123 3 141 98 133 278 56 84 165 235 91
-229 49 157 278 2 202 295 98 110 217 19 1 203 20 137 108 5 193 42 116 122 270
-236 7 268 47 242 155 43 115 206 125 238 28 94 6 32 244 207 284 204 50 42 199
-167 127 153 45 53 93 121 111 79 282 129 151 213 166 97 57 60 188 53 10 182 148
-162 244 47 105 37 210 61 187 137 268 184 63 285 97 134 194 201 82 250 112 132
-142 257 290 109 4 277 3 118 37 96 195 94 60 211 114 47 265 110 80 198 168 149 1
-43 138 267 268 24 287 12 257 153 288 171 117 281 130 67 252 164 76 231 101 101
-261 143 13 256 237 143 173 32 107 89 154 44 31 245 123 26 202 135 216 240 80 38
-286 279 55 62 126 237 6 55 8 244 70 166 74 293 23 105 91 92 228 27 118 280 214
-28 254 79 199 84 188 296 128 15 11 181 232 17 246 259 228 187 150 54 9 266 109
-164 159 170 64 18 2 225 59 135 193 179 43 252 27 255 101 47 82 273 173 275 225
-219 17 63 125 24 264 57 220 70 29 253 163 160 86 103 16 87 102 100 48 104 15
-171 63 102 260 227 271 258 152 266 132 119 196 253 26 42 62 49 103 99 26 65 17
-86 80 61 50 19 138 24 44 191 127 99 269 183 147 140 99 49 20 54 169 42 276 4
-140 182 94 280 77 207 124 25 180 96 218 155 203 294 76 71 219 231 124 162 1 226
-272 174 191 264 217 102 237 166 234 175 190 51 72 104 152 289 87 262 279 215
-241 293 77 284 67 229 209 39 148 139 183 10 22 75 292 1 66 93 7 54 283 205 72
-81 197 252 4 3 64 261 120 58 113 154 181 255 78 283 45 190 211 251 271 98 270
-99 186 138 184 223 61 73 80 175 107 6 215 81 114 207 147 86 26 179 180 73 157
-118 120 35 158 11 98 293 160 32 221 146 247 121 88 18 139 46 189 189 212 273 13
-96 58 273 36 51 95 59 295 75 49 180 233 39 285 257 16 64 41 63 262 142 97 111
-239 58 296 288 194 178 21 213 29 170 224 197 169 65 40 41 223 144 12 234 92 145
-88 155 66 176 243 208 200 243 48 21 76 208 40 64 178 181 95 196 116 205 209 199
-30 9 23 288 34 296 151 76 48 264 194 41 200 83 272 151 130 227 134 34 22 212
-113 131 226 112 292 24 127 236 90 16 10 159 193 19 161 85 187 274 89 17 223 7
-191 104 38 126 100 185 222 145 225 82 90 230 262 5 276 87 79 39 11 21 53 147 3
-278 216 263 35 75 72 241 79 122 247 281 267 185 85 27 95 219 71 242 292 161 245
-69 144 35 295 235 228 50 179 20 287 172 139 23 128 152 129 14 95 36 234 38 72
-218 18 85 164 22 52 231 261 280 131 89 291 162 161 108 142 14 172 276 91 ^
-635 1 256 9 146 297 61 175 261 50 198 27 25 164 284 115 173 192 282 254 94 23
-41 273 84 95 180 3 102 227 290 213 187 50 90 139 150 73 64 2 190 122 75 124 181
-60 263 56 134 109 21 35 38 201 99 10 149 215 102 173 47 226 42 239 133 297 115
-119 248 195 9 183 166 199 238 130 279 74 121 163 19 265 270 257 66 8 126 204 71
-294 234 246 89 173 101 170 29 85 44 154 256 154 202 210 115 65 5 108 163 73 209
-58 103 176 264 267 40 25 10 41 28 28 82 26 113 258 69 26 167 202 156 171 277
-159 297 7 231 174 104 88 70 83 29 31 67 111 44 46 69 80 111 289 2 82 234 1 33
-160 246 280 285 27 79 108 72 260 84 149 124 289 247 38 147 55 222 4 105 245 32
-211 272 226 133 52 59 206 194 6 265 25 201 153 253 236 161 212 30 188 261 195
-254 239 79 54 28 273 138 39 167 148 212 184 132 49 141 65 196 220 89 281 288
-244 120 106 57 137 127 62 33 123 78 142 222 58 49 232 177 22 129 68 168 6 74 13
-275 244 174 50 144 83 237 218 174 158 32 157 29 239 287 241 202 65 59 52 250 19
-20 214 45 12 218 282 46 106 248 249 53 270 12 10 95 271 15 28 136 269 100 204
-279 182 9 38 110 286 84 240 236 215 156 117 34 72 152 96 75 33 69 134 55 77 247
-192 91 142 168 114 62 87 67 165 287 33 15 190 68 131 137 235 249 107 214 99 255
-205 228 256 63 90 85 206 285 118 191 34 280 40 270 66 253 182 217 225 184 78 5
-54 219 86 64 247 246 35 229 14 224 218 228 102 119 3 139 96 129 276 56 80 165
-233 89 227 45 157 274 295 200 295 92 108 217 17 296 203 14 133 106 3 193 40 116
-122 266 236 7 268 43 242 151 39 113 204 125 238 22 92 30 242 205 282 200 50 36
-195 163 127 153 45 49 87 121 109 75 278 125 147 209 166 91 51 56 188 53 8 180
-148 158 240 45 103 31 208 55 185 135 266 182 63 281 97 132 194 197 78 250 110
-132 140 253 290 105 275 298 118 37 90 193 94 60 209 112 47 263 110 78 196 166
-145 294 43 134 263 264 22 283 12 255 151 284 169 117 279 128 65 250 164 76 227
-99 101 261 141 11 252 233 143 171 32 103 85 152 42 31 245 123 24 198 135 212
-238 76 36 286 275 53 62 124 235 4 51 2 244 66 162 70 291 17 105 91 88 224 27
-116 276 210 24 252 79 199 84 186 292 128 11 7 177 230 17 242 259 226 187 295
-146 52 5 262 107 160 155 168 60 18 221 55 131 191 179 37 252 25 255 97 41 82
-271 169 271 223 215 11 61 121 18 262 53 216 68 23 249 161 158 86 101 16 85 98
-98 44 100 13 167 57 100 258 223 269 254 148 266 128 119 194 251 22 38 56 43 275
-^
-642 0 91 26 53 13 78 80 53 42 11 134 24 44 191 123 87 261 175 143 140 99 45 16
-54 161 42 276 132 174 82 276 65 199 120 17 180 92 210 151 195 290 72 63 219 231
-116 158 1 222 272 170 187 264 209 90 237 162 226 167 182 43 72 92 152 285 87
-254 275 211 241 293 77 284 55 229 201 35 140 135 179 2 18 63 284 298 62 93 300
-42 283 201 64 73 189 244 4 292 52 253 120 46 113 146 181 247 74 279 41 186 203
-251 263 90 266 95 186 138 184 223 61 61 68 175 107 6 207 81 114 207 139 74 14
-175 172 73 153 110 112 27 150 11 98 285 152 20 221 146 239 113 88 14 139 38 181
-189 208 265 5 88 50 273 24 51 91 55 287 67 49 176 233 31 281 257 8 64 37 55 258
-134 89 111 231 58 292 288 186 174 17 209 25 170 216 197 169 61 32 41 215 136 4
-234 92 145 84 155 54 168 243 208 200 239 48 21 68 204 40 60 178 177 87 196 108
-197 205 195 18 5 23 284 26 296 147 64 44 256 190 33 196 79 264 151 130 223 126
-34 14 204 105 127 218 112 292 16 119 228 82 4 299 159 185 19 153 81 179 274 85
-9 219 296 183 104 30 126 92 181 218 141 225 70 90 230 262 294 268 75 75 39 300
-13 49 147 300 278 216 255 35 75 68 233 67 114 243 273 267 185 77 19 95 215 71
-238 288 157 241 57 144 23 291 227 228 46 171 12 289 283 172 131 19 124 148 125
-2 83 36 230 26 60 214 10 73 160 10 44 227 257 280 131 77 291 162 161 100 142 14
-168 272 141 254 3 144 295 57 173 257 44 198 23 19 160 282 111 173 192 278 252
-88 21 39 271 80 89 176 298 98 227 286 213 185 48 86 135 150 69 58 299 188 118
-73 124 177 58 263 54 132 109 15 29 36 201 93 6 149 215 100 171 41 222 36 237
-133 293 113 117 248 193 9 183 162 197 234 128 279 70 119 163 15 265 270 255 64
-8 122 204 69 294 232 242 89 169 97 166 27 85 38 152 256 154 200 210 115 61 3
-108 161 71 209 54 103 176 262 265 34 21 10 37 26 24 80 24 109 258 69 22 165 202
-154 171 277 155 297 1 229 172 102 86 70 83 29 29 67 107 42 40 67 78 109 287 2
-76 230 298 33 160 246 278 281 21 75 104 66 260 78 145 120 289 247 38 145 55 222
-103 241 28 211 270 226 131 48 57 202 190 4 263 25 199 149 251 234 157 212 30
-184 259 195 254 239 77 48 28 269 136 33 167 146 210 180 128 43 137 65 192 220
-85 281 286 242 118 102 57 137 123 58 27 121 78 138 220 56 47 232 177 22 129 68
-168 74 7 275 240 174 46 142 79 235 218 170 158 30 155 25 235 283 237 198 59 59
-52 246 13 20 214 39 6 214 282 46 106 246 249 47 268 10 8 93 271 15 22 136 269
-100 200 275 42 ^
-644 0 6 29 104 280 81 240 230 212 156 114 31 69 146 96 66 27 63 134 52 68 244
-186 88 139 162 111 53 81 64 162 287 30 6 190 59 128 131 235 246 101 211 93 249
-205 222 250 57 87 76 206 285 115 185 25 274 34 264 66 253 176 211 219 181 69 5
-51 216 77 58 241 243 32 223 11 224 215 225 102 113 3 136 93 123 273 56 74 165
-230 86 224 39 157 268 289 197 295 83 105 217 14 293 203 5 127 103 193 37 116
-122 260 236 7 268 37 242 145 33 110 201 125 238 13 89 293 27 239 202 279 194 50
-27 189 157 127 153 45 43 78 121 106 69 272 119 141 203 166 82 42 50 188 53 5
-177 148 152 234 42 100 22 205 46 182 132 263 179 63 275 97 129 194 191 72 250
-107 132 137 247 290 99 296 272 295 118 37 81 190 94 60 206 109 47 260 110 75
-193 163 139 288 43 128 257 258 19 277 12 252 148 278 166 117 276 125 62 247 164
-76 221 96 101 261 138 8 246 227 143 168 32 97 79 149 39 31 245 123 21 192 135
-206 235 70 33 286 269 50 62 121 232 1 45 295 244 60 156 64 288 8 105 91 82 218
-27 113 270 204 18 249 79 199 84 183 286 128 5 1 171 227 17 236 259 223 187 292
-140 49 301 256 104 154 149 165 54 18 299 215 49 125 188 179 28 252 22 255 91 32
-82 268 163 265 220 209 2 58 115 9 259 47 210 65 14 243 158 155 86 98 16 82 92
-95 38 94 10 161 48 97 255 217 266 248 142 266 122 119 191 248 16 32 47 34 88 89
-26 50 12 76 80 51 40 9 133 24 44 191 122 84 259 173 142 140 99 44 15 54 159 42
-276 301 130 172 79 275 62 197 119 15 180 91 208 150 193 289 71 61 219 231 114
-157 1 221 272 169 186 264 207 87 237 161 224 165 180 41 72 89 152 284 87 252
-274 210 241 293 77 284 52 229 199 34 138 134 178 17 60 282 298 61 93 299 39 283
-200 62 71 187 242 4 290 49 251 120 43 113 144 181 245 73 278 40 185 201 251 261
-88 265 94 186 138 184 223 61 58 65 175 107 6 205 81 114 207 137 71 11 174 170
-73 152 108 110 25 148 11 98 283 150 17 221 146 237 111 88 13 139 36 179 189 207
-263 3 86 48 273 21 51 90 54 285 65 49 175 233 29 280 257 6 64 36 53 257 132 87
-111 229 58 291 288 184 173 16 208 24 170 214 197 169 60 30 41 213 134 2 234 92
-145 83 155 51 166 243 208 200 238 48 21 66 203 40 59 178 176 85 196 106 195 204
-194 15 4 23 283 24 296 146 61 43 254 189 31 195 78 262 151 130 222 124 34 12
-202 103 126 216 112 292 14 117 226 80 1 297 159 183 19 151 80 177 274 84 7 218
-294 181 104 28 126 90 180 217 140 225 67 90 230 262 292 266 72 74 39 298 11 48
-147 300 278 216 253 265 ^
-638 1 75 65 227 58 108 240 267 267 185 71 13 95 212 71 235 285 154 238 48 144
-14 288 221 228 43 165 6 283 280 172 125 16 121 145 122 297 74 36 227 17 51 211
-4 64 157 1 38 224 254 280 131 68 291 162 161 94 142 14 165 269 141 251 298 141
-292 51 170 251 35 198 17 10 154 279 105 173 192 272 249 79 18 36 268 74 80 170
-292 92 227 280 213 182 45 80 129 150 63 49 296 185 112 70 124 171 55 263 51 129
-109 6 20 33 201 84 149 215 97 168 32 216 27 234 133 287 110 114 248 190 9 183
-156 194 228 125 279 64 116 163 9 265 270 252 61 8 116 204 66 294 229 236 89 163
-91 160 24 85 29 149 256 154 197 210 115 55 108 158 68 209 48 103 176 259 262 25
-15 10 31 23 18 77 21 103 258 69 16 162 202 151 171 277 149 297 296 226 169 99
-83 70 83 29 26 67 101 39 31 64 75 106 284 2 67 224 295 33 160 246 275 275 12 69
-98 57 260 69 139 114 289 247 38 142 55 222 298 100 235 22 211 267 226 128 42 54
-196 184 1 260 25 196 143 248 231 151 212 30 178 256 195 254 239 74 39 28 263
-133 24 167 143 207 174 122 34 131 65 186 220 79 281 283 239 115 96 57 137 117
-52 18 118 78 132 217 53 44 232 177 22 129 68 168 295 74 302 275 234 174 40 139
-73 232 218 164 158 27 152 19 229 277 231 192 50 59 52 240 4 20 214 30 301 208
-282 46 106 243 249 38 265 7 5 90 271 15 13 136 269 100 194 269 182 4 23 100 276
-79 240 226 210 156 112 29 67 142 96 60 23 59 134 50 62 242 182 86 137 158 109
-47 77 62 160 287 28 190 53 126 127 235 244 97 209 89 245 205 218 246 53 85 70
-206 285 113 181 19 270 30 260 66 253 172 207 215 179 63 5 49 214 71 54 237 241
-30 219 9 224 213 223 102 109 3 134 91 119 271 56 70 165 228 84 222 35 157 264
-285 195 295 77 103 217 12 291 203 303 123 101 302 193 35 116 122 256 236 7 268
-33 242 141 29 108 199 125 238 7 87 289 25 237 200 277 190 50 21 185 153 127 153
-45 39 72 121 104 65 268 115 137 199 166 76 36 46 188 53 3 175 148 148 230 40 98
-16 203 40 180 130 261 177 63 271 97 127 194 187 68 250 105 132 135 243 290 95
-294 270 293 118 37 75 188 94 60 204 107 47 258 110 73 191 161 135 284 43 124
-253 254 17 273 12 250 146 274 164 117 274 123 60 245 164 76 217 94 101 261 136
-6 242 223 143 166 32 93 75 147 37 31 245 123 19 188 135 202 233 66 31 286 265
-48 62 119 230 303 41 291 244 56 152 60 286 2 105 91 78 214 27 111 266 200 14
-247 79 199 84 181 282 128 1 301 167 225 17 232 259 221 187 290 136 47 299 252
-102 150 145 163 157 ^
-653 0 18 299 207 41 117 184 179 16 252 18 255 83 20 82 264 155 257 216 201 296
-54 107 303 255 39 202 61 2 235 154 151 86 94 16 78 84 91 30 86 6 153 36 93 251
-209 262 240 134 266 114 119 187 244 8 24 35 22 76 81 26 38 8 68 80 43 32 1 129
-24 44 191 118 72 251 165 138 140 99 40 11 54 151 42 276 301 122 164 67 271 50
-189 115 7 180 87 200 146 185 285 67 53 219 231 106 153 1 217 272 165 182 264
-199 75 237 157 216 157 172 33 72 77 152 280 87 244 270 206 241 293 77 284 40
-229 191 30 130 130 174 298 13 48 274 298 57 93 295 27 283 196 54 63 179 234 4
-282 37 243 120 31 113 136 181 237 69 274 36 181 193 251 253 80 261 90 186 138
-184 223 61 46 53 175 107 6 197 81 114 207 129 59 305 170 162 73 148 100 102 17
-140 11 98 275 142 5 221 146 229 103 88 9 139 28 171 189 203 255 301 78 40 273 9
-51 86 50 277 57 49 171 233 21 276 257 304 64 32 45 253 124 79 111 221 58 287
-288 176 169 12 204 20 170 206 197 169 56 22 41 205 126 300 234 92 145 79 155 39
-158 243 208 200 234 48 21 58 199 40 55 178 172 77 196 98 187 200 190 3 23 279
-16 296 142 49 39 246 185 23 191 74 254 151 130 218 116 34 4 194 95 122 208 112
-292 6 109 218 72 295 289 159 175 19 143 76 169 274 80 305 214 286 173 104 20
-126 82 176 213 136 225 55 90 230 262 284 258 60 70 39 290 3 44 147 300 278 216
-245 35 75 63 223 52 104 238 263 267 185 67 9 95 210 71 233 283 152 236 42 144 8
-286 217 228 41 161 2 279 278 172 121 14 119 143 120 293 68 36 225 11 45 209 58
-155 301 34 222 252 280 131 62 291 162 161 90 142 14 163 267 141 249 294 139 290
-47 168 247 29 198 13 4 150 277 101 173 192 268 247 73 16 34 266 70 74 166 288
-88 227 276 213 180 43 76 125 150 59 43 294 183 108 68 124 167 53 263 49 127 109
-14 31 201 78 302 149 215 95 166 26 212 21 232 133 283 108 112 248 188 9 183 152
-192 224 123 279 60 114 163 5 265 270 250 59 8 112 204 64 294 227 232 89 159 87
-156 22 85 23 147 256 154 195 210 115 51 304 108 156 66 209 44 103 176 257 260
-19 11 10 27 21 14 75 19 99 258 69 12 160 202 149 171 277 145 297 292 224 167 97
-81 70 83 29 24 67 97 37 25 62 73 104 282 2 61 220 293 33 160 246 273 271 6 65
-94 51 260 63 135 110 289 247 38 140 55 222 296 98 231 18 211 265 226 126 38 52
-192 180 305 258 25 194 139 246 229 147 212 30 174 254 195 254 239 72 33 28 259
-131 18 167 141 205 170 118 28 127 65 182 220 75 281 281 237 113 92 57 137 113
-48 12 116 78 128 215 51 42 232 177 22 129 68 168 291 161 ^
-653 0 296 275 228 174 34 136 67 229 218 158 158 24 149 13 223 271 225 186 41 59
-52 234 302 20 214 21 295 202 282 46 106 240 249 29 262 4 2 87 271 15 4 136 269
-100 188 263 182 1 14 94 270 76 240 220 207 156 109 26 64 136 96 51 17 53 134 47
-53 239 176 83 134 152 106 38 71 59 157 287 25 298 190 44 123 121 235 241 91 206
-83 239 205 212 240 47 82 61 206 285 110 175 10 264 24 254 66 253 166 201 209
-176 54 5 46 211 62 48 231 238 27 213 6 224 210 220 102 103 3 131 88 113 268 56
-64 165 225 81 219 29 157 258 279 192 295 68 100 217 9 288 203 297 117 98 302
-193 32 116 122 250 236 7 268 27 242 135 23 105 196 125 238 305 84 283 22 234
-197 274 184 50 12 179 147 127 153 45 33 63 121 101 59 262 109 131 193 166 67 27
-40 188 53 172 148 142 224 37 95 7 200 31 177 127 258 174 63 265 97 124 194 181
-62 250 102 132 132 237 290 89 291 267 290 118 37 66 185 94 60 201 104 47 255
-110 70 188 158 129 278 43 118 247 248 14 267 12 247 143 268 161 117 271 120 57
-242 164 76 211 91 101 261 133 3 236 217 143 163 32 87 69 144 34 31 245 123 16
-182 135 196 230 60 28 286 259 45 62 116 227 303 35 285 244 50 146 54 283 300
-105 91 72 208 27 108 260 194 8 244 79 199 84 178 276 128 302 298 161 222 17 226
-259 218 187 287 130 44 296 246 99 144 139 160 44 18 299 205 39 115 183 179 13
-252 17 255 81 17 82 263 153 255 215 199 294 53 105 301 254 37 200 60 306 233
-153 150 86 93 16 77 82 90 28 84 5 151 33 92 250 207 261 238 132 266 112 119 186
-243 6 22 32 19 73 79 26 35 7 66 80 41 30 306 128 24 44 191 117 69 249 163 137
-140 99 39 10 54 149 42 276 301 120 162 64 270 47 187 114 5 180 86 198 145 183
-284 66 51 219 231 104 152 1 216 272 164 181 264 197 72 237 156 214 155 170 31
-72 74 152 279 87 242 269 205 241 293 77 284 37 229 189 29 128 129 173 297 12 45
-272 298 56 93 294 24 283 195 52 61 177 232 4 280 34 241 120 28 113 134 181 235
-68 273 35 180 191 251 251 78 260 89 186 138 184 223 61 43 50 175 107 6 195 81
-114 207 127 56 303 169 160 73 147 98 100 15 138 11 98 273 140 2 221 146 227 101
-88 8 139 26 169 189 202 253 300 76 38 273 6 51 85 49 275 55 49 170 233 19 275
-257 303 64 31 43 252 122 77 111 219 58 286 288 174 168 11 203 19 170 204 197
-169 55 20 41 203 124 299 234 92 145 78 155 36 156 243 208 200 233 48 21 56 198
-40 54 178 171 75 196 96 185 199 189 306 23 278 14 296 141 46 38 244 184 21 190
-73 252 151 130 217 114 34 2 192 93 121 206 112 292 4 107 216 70 293 112 ^
-646 1 159 169 19 137 73 163 274 77 302 211 280 167 104 14 126 76 173 210 133
-225 46 90 230 262 278 252 51 67 39 284 306 41 147 300 278 216 239 35 75 60 217
-43 98 235 257 267 185 61 3 95 207 71 230 280 149 233 33 144 308 283 211 228 38
-155 305 273 275 172 115 11 116 140 117 287 59 36 222 2 36 206 303 49 152 295 28
-219 249 280 131 53 291 162 161 84 142 14 160 264 141 246 288 136 287 41 165 241
-20 198 7 304 144 274 95 173 192 262 244 64 13 31 263 64 65 160 282 82 227 270
-213 177 40 70 119 150 53 34 291 180 102 65 124 161 50 263 46 124 109 300 5 28
-201 69 299 149 215 92 163 17 206 12 229 133 277 105 109 248 185 9 183 146 189
-218 120 279 54 111 163 308 265 270 247 56 8 106 204 61 294 224 226 89 153 81
-150 19 85 14 144 256 154 192 210 115 45 304 108 153 63 209 38 103 176 254 257
-10 5 10 21 18 8 72 16 93 258 69 6 157 202 146 171 277 139 297 286 221 164 94 78
-70 83 29 21 67 91 34 16 59 70 101 279 2 52 214 290 33 160 246 270 265 306 59 88
-42 260 54 129 104 289 247 38 137 55 222 293 95 225 12 211 262 226 123 32 49 186
-174 305 255 25 191 133 243 226 141 212 30 168 251 195 254 239 69 24 28 253 128
-9 167 138 202 164 112 19 121 65 176 220 69 281 278 234 110 86 57 137 107 42 3
-113 78 122 212 48 39 232 177 22 129 68 168 285 74 292 275 224 174 30 134 63 227
-218 154 158 22 147 9 219 267 221 182 35 59 52 230 298 20 214 15 291 198 282 46
-106 238 249 23 260 2 85 271 15 307 136 269 100 184 259 182 308 8 90 266 74 240
-216 205 156 107 24 62 132 96 45 13 49 134 45 47 237 172 81 132 148 104 32 67 57
-155 287 23 294 190 38 121 117 235 239 87 204 79 235 205 208 236 43 80 55 206
-285 108 171 4 260 20 250 66 253 162 197 205 174 48 5 44 209 56 44 227 236 25
-209 4 224 208 218 102 99 3 129 86 109 266 56 60 165 223 79 217 25 157 254 275
-190 295 62 98 217 7 286 203 293 113 96 302 193 30 116 122 246 236 7 268 23 242
-131 19 103 194 125 238 301 82 279 20 232 195 272 180 50 6 175 143 127 153 45 29
-57 121 99 55 258 105 127 189 166 61 21 36 188 53 307 170 148 138 220 35 93 1
-198 25 175 125 256 172 63 261 97 122 194 177 58 250 100 132 130 233 290 85 289
-265 288 118 37 60 183 94 60 199 102 47 253 110 68 186 156 125 274 43 114 243
-244 12 263 12 245 141 264 159 117 269 118 55 240 164 76 207 89 101 261 131 1
-232 213 143 161 32 83 65 142 32 31 245 123 14 178 135 192 228 56 26 286 255 43
-62 114 225 303 31 281 244 46 142 50 281 296 105 91 238 ^
-647 0 200 27 104 252 186 240 79 199 84 174 268 128 298 294 153 218 17 218 259
-214 187 283 122 40 292 238 95 136 131 156 36 18 299 197 31 107 179 179 1 252 13
-255 73 5 82 259 145 247 211 191 286 49 97 293 250 29 192 56 298 225 149 146 86
-89 16 73 74 86 20 76 1 143 21 88 246 199 257 230 124 266 104 119 182 239 309 14
-20 7 61 71 26 23 3 58 80 33 22 302 124 24 44 191 113 57 241 155 133 140 99 35 6
-54 141 42 276 301 112 154 52 266 35 179 110 308 180 82 190 141 175 280 62 43
-219 231 96 148 1 212 272 160 177 264 189 60 237 152 206 147 162 23 72 62 152
-275 87 234 265 201 241 293 77 284 25 229 181 25 120 125 169 293 8 33 264 298 52
-93 290 12 283 191 44 53 169 224 4 272 22 233 120 16 113 126 181 227 64 269 31
-176 183 251 243 70 256 85 186 138 184 223 61 31 38 175 107 6 187 81 114 207 119
-44 295 165 152 73 143 90 92 7 130 11 98 265 132 301 221 146 219 93 88 4 139 18
-161 189 198 245 296 68 30 273 305 51 81 45 267 47 49 166 233 11 271 257 299 64
-27 35 248 114 69 111 211 58 282 288 166 164 7 199 15 170 196 197 169 51 12 41
-195 116 295 234 92 145 74 155 24 148 243 208 200 229 48 21 48 194 40 50 178 167
-67 196 88 177 195 185 299 306 23 274 6 296 137 34 34 236 180 13 186 69 244 151
-130 213 106 34 305 184 85 117 198 112 292 307 99 208 62 285 279 159 165 19 133
-71 159 274 75 300 209 276 163 104 10 126 72 171 208 131 225 40 90 230 262 274
-248 45 65 39 280 304 39 147 300 278 216 235 35 75 58 213 37 94 233 253 267 185
-57 310 95 205 71 228 278 147 231 27 144 304 281 207 228 36 151 303 269 273 172
-111 9 114 138 115 283 53 36 220 307 30 204 301 43 150 291 24 217 247 280 131 47
-291 162 161 80 142 14 158 262 141 244 284 134 285 37 163 237 14 198 3 300 140
-272 91 173 192 258 242 58 11 29 261 60 59 156 278 78 227 266 213 175 38 66 115
-150 49 28 289 178 98 63 124 157 48 263 44 122 109 296 310 26 201 63 297 149 215
-90 161 11 202 6 227 133 273 103 107 248 183 9 183 142 187 214 118 279 50 109
-163 306 265 270 245 54 8 102 204 59 294 222 222 89 149 77 146 17 85 8 142 256
-154 190 210 115 41 304 108 151 61 209 34 103 176 252 255 4 1 10 17 16 4 70 14
-89 258 69 2 155 202 144 171 277 135 297 282 219 162 92 76 70 83 29 19 67 87 32
-10 57 68 99 277 2 46 210 288 33 160 246 268 261 302 55 84 36 260 48 125 100 289
-247 38 135 55 222 291 93 221 8 211 260 226 121 28 47 182 170 305 253 25 189 129
-241 224 137 212 30 164 249 195 254 239 86 ^
-665 0 15 28 247 125 167 135 199 158 106 10 115 65 170 220 63 281 275 231 107 80
-57 137 101 36 306 110 78 116 209 45 36 232 177 22 129 68 168 279 74 286 275 218
-174 24 131 57 224 218 148 158 19 144 3 213 261 215 176 26 59 52 224 292 20 214
-6 285 192 282 46 106 235 249 14 257 311 309 82 271 15 301 136 269 100 178 253
-182 308 311 84 260 71 240 210 202 156 104 21 59 126 96 36 7 43 134 42 38 234
-166 78 129 142 101 23 61 54 152 287 20 288 190 29 118 111 235 236 81 201 73 229
-205 202 230 37 77 46 206 285 105 165 307 254 14 244 66 253 156 191 199 171 39 5
-41 206 47 38 221 233 22 203 1 224 205 215 102 93 3 126 83 103 263 56 54 165 220
-76 214 19 157 248 269 187 295 53 95 217 4 283 203 287 107 93 302 193 27 116 122
-240 236 7 268 17 242 125 13 100 191 125 238 295 79 273 17 229 192 269 174 50
-309 169 137 127 153 45 23 48 121 96 49 252 99 121 183 166 52 12 30 188 53 307
-167 148 132 214 32 90 304 195 16 172 122 253 169 63 255 97 119 194 171 52 250
-97 132 127 227 290 79 286 262 285 118 37 51 180 94 60 196 99 47 250 110 65 183
-153 119 268 43 108 237 238 9 257 12 242 138 258 156 117 266 115 52 237 164 76
-201 86 101 261 128 310 226 207 143 158 32 77 59 139 29 31 245 123 11 172 135
-186 225 50 23 286 249 40 62 111 222 303 25 275 244 40 136 44 278 290 105 91 62
-198 27 103 250 184 310 239 79 199 84 173 266 128 297 293 151 217 17 216 259 213
-187 282 120 39 291 236 94 134 129 155 34 18 299 195 29 105 178 179 310 252 12
-255 71 2 82 258 143 245 210 189 284 48 95 291 249 27 190 55 296 223 148 145 86
-88 16 72 72 85 18 74 141 18 87 245 197 256 228 122 266 102 119 181 238 308 12
-17 4 58 69 26 20 2 56 80 31 20 301 123 24 44 191 112 54 239 153 132 140 99 34 5
-54 139 42 276 301 110 152 49 265 32 177 109 307 180 81 188 140 173 279 61 41
-219 231 94 147 1 211 272 159 176 264 187 57 237 151 204 145 160 21 72 59 152
-274 87 232 264 200 241 293 77 284 22 229 179 24 118 124 168 292 7 30 262 298 51
-93 289 9 283 190 42 51 167 222 4 270 19 231 120 13 113 124 181 225 63 268 30
-175 181 251 241 68 255 84 186 138 184 223 61 28 35 175 107 6 185 81 114 207 117
-41 293 164 150 73 142 88 90 5 128 11 98 263 130 299 221 146 217 91 88 3 139 16
-159 189 197 243 295 66 28 273 303 51 80 44 265 45 49 165 233 9 270 257 298 64
-26 33 247 112 67 111 209 58 281 288 164 163 6 198 14 170 194 197 169 50 10 41
-193 114 294 234 92 145 73 155 21 146 243 208 200 228 48 21 46 193 40 49 178 166
-65 196 86 175 194 184 297 306 23 273 206 ^
-641 0 296 134 25 31 230 177 7 183 66 238 151 130 210 100 34 302 178 79 114 192
-112 292 304 93 202 56 279 273 159 159 19 127 68 153 274 72 297 206 270 157 104
-4 126 66 168 205 128 225 31 90 230 262 268 242 36 62 39 274 301 36 147 300 278
-216 229 35 75 55 207 28 88 230 247 267 185 51 307 95 202 71 225 275 144 228 18
-144 298 278 201 228 33 145 300 263 270 172 105 6 111 135 112 277 44 36 217 301
-21 201 298 34 147 285 18 214 244 280 131 38 291 162 161 74 142 14 155 259 141
-241 278 131 282 31 160 231 5 198 311 294 134 269 85 173 192 252 239 49 8 26 258
-54 50 150 272 72 227 260 213 172 35 60 109 150 43 19 286 175 92 60 124 151 45
-263 41 119 109 290 304 23 201 54 294 149 215 87 158 2 196 311 224 133 267 100
-104 248 180 9 183 136 184 208 115 279 44 106 163 303 265 270 242 51 8 96 204 56
-294 219 216 89 143 71 140 14 85 313 139 256 154 187 210 115 35 304 108 148 58
-209 28 103 176 249 252 309 309 10 11 13 312 67 11 83 258 69 310 152 202 141 171
-277 129 297 276 216 159 89 73 70 83 29 16 67 81 29 1 54 65 96 274 2 37 204 285
-33 160 246 265 255 296 49 78 27 260 39 119 94 289 247 38 132 55 222 288 90 215
-2 211 257 226 118 22 44 176 164 305 250 25 186 123 238 221 131 212 30 158 246
-195 254 239 64 9 28 243 123 308 167 133 197 154 102 4 111 65 166 220 59 281 273
-229 105 76 57 137 97 32 302 108 78 112 207 43 34 232 177 22 129 68 168 275 74
-282 275 214 174 20 129 53 222 218 144 158 17 142 313 209 257 211 172 20 59 52
-220 288 20 214 281 188 282 46 106 233 249 8 255 311 309 80 271 15 297 136 269
-100 174 249 182 308 307 80 256 69 240 206 200 156 102 19 57 122 96 30 3 39 134
-40 32 232 162 76 127 138 99 17 57 52 150 287 18 284 190 23 116 107 235 234 77
-199 69 225 205 198 226 33 75 40 206 285 103 161 303 250 10 240 66 253 152 187
-195 169 33 5 39 204 41 34 217 231 20 199 313 224 203 213 102 89 3 124 81 99 261
-56 50 165 218 74 212 15 157 244 265 185 295 47 93 217 2 281 203 283 103 91 302
-193 25 116 122 236 236 7 268 13 242 121 9 98 189 125 238 291 77 269 15 227 190
-267 170 50 305 165 133 127 153 45 19 42 121 94 45 248 95 117 179 166 46 6 26
-188 53 307 165 148 128 210 30 88 300 193 10 170 120 251 167 63 251 97 117 194
-167 48 250 95 132 125 223 290 75 284 260 283 118 37 45 178 94 60 194 97 47 248
-110 63 181 151 115 264 43 104 233 234 7 253 12 240 136 254 154 117 264 113 50
-235 164 76 197 84 101 261 126 310 222 203 143 276 ^
-656 0 32 69 51 135 25 31 245 123 7 164 135 178 221 42 19 286 241 36 62 107 218
-303 17 267 244 32 128 36 274 282 105 91 54 190 27 99 242 176 306 235 79 199 84
-169 258 128 293 289 143 213 17 208 259 209 187 278 112 35 287 228 90 126 121
-151 26 18 299 187 21 97 174 179 302 252 8 255 63 306 82 254 135 237 206 181 276
-44 87 283 245 19 182 51 288 215 144 141 86 84 16 68 64 81 10 66 312 133 6 83
-241 189 252 220 114 266 94 119 177 234 304 4 5 308 46 61 26 8 314 48 80 23 12
-297 119 24 44 191 108 42 231 145 128 140 99 30 1 54 131 42 276 301 102 144 37
-261 20 169 105 303 180 77 180 136 165 275 57 33 219 231 86 143 1 207 272 155
-172 264 179 45 237 147 196 137 152 13 72 47 152 270 87 224 260 196 241 293 77
-284 10 229 171 20 110 120 164 288 3 18 254 298 47 93 285 313 283 186 34 43 159
-214 4 262 7 223 120 1 113 116 181 217 59 264 26 171 173 251 233 60 251 80 186
-138 184 223 61 16 23 175 107 6 177 81 114 207 109 29 285 160 142 73 138 80 82
-313 120 11 98 255 122 291 221 146 209 83 88 315 139 8 151 189 193 235 291 58 20
-273 295 51 76 40 257 37 49 161 233 1 266 257 294 64 22 25 243 104 59 111 201 58
-277 288 156 159 2 194 10 170 186 197 169 46 2 41 185 106 290 234 92 145 69 155
-9 138 243 208 200 224 48 21 38 189 40 45 178 162 57 196 78 167 190 180 289 306
-23 269 312 296 132 19 29 226 175 3 181 64 234 151 130 208 96 34 300 174 75 112
-188 112 292 302 89 198 52 275 269 159 155 19 123 66 149 274 70 295 204 266 153
-104 126 62 166 203 126 225 25 90 230 262 264 238 30 60 39 270 299 34 147 300
-278 216 225 35 75 53 203 22 84 228 243 267 185 47 305 95 200 71 223 273 142 226
-12 144 294 276 197 228 31 141 298 259 268 172 101 4 109 133 110 273 38 36 215
-297 15 199 296 28 145 281 14 212 242 280 131 32 291 162 161 70 142 14 153 257
-141 239 274 129 280 27 158 227 315 198 309 290 130 267 81 173 192 248 237 43 6
-24 256 50 44 146 268 68 227 256 213 170 33 56 105 150 39 13 284 173 88 58 124
-147 43 263 39 117 109 286 300 21 201 48 292 149 215 85 156 312 192 307 222 133
-263 98 102 248 178 9 183 132 182 204 113 279 40 104 163 301 265 270 240 49 8 92
-204 54 294 217 212 89 139 67 136 12 85 309 137 256 154 185 210 115 31 304 108
-146 56 209 24 103 176 247 250 305 307 10 7 11 310 65 9 79 258 69 308 150 202
-139 171 277 125 297 272 214 157 87 71 70 83 29 14 67 77 27 311 52 63 94 272 2
-31 200 283 33 160 246 263 251 292 45 74 21 260 33 115 90 289 247 38 130 55 222
-286 88 211 227 ^
-668 0 211 254 226 115 16 41 170 158 305 247 25 183 117 235 218 125 212 30 152
-243 195 254 239 61 28 237 120 302 167 130 194 148 96 312 105 65 160 220 53 281
-270 226 102 70 57 137 91 26 296 105 78 106 204 40 31 232 177 22 129 68 168 269
-74 276 275 208 174 14 126 47 219 218 138 158 14 139 310 203 251 205 166 11 59
-52 214 282 20 214 308 275 182 282 46 106 230 249 316 252 311 309 77 271 15 291
-136 269 100 168 243 182 308 301 74 250 66 240 200 197 156 99 16 54 116 96 21
-314 33 134 37 23 229 156 73 124 132 96 8 51 49 147 287 15 278 190 14 113 101
-235 231 71 196 63 219 205 192 220 27 72 31 206 285 100 155 297 244 4 234 66 253
-146 181 189 166 24 5 36 201 32 28 211 228 17 193 313 224 200 210 102 83 3 121
-78 93 258 56 44 165 215 71 209 9 157 238 259 182 295 38 90 217 316 278 203 277
-97 88 302 193 22 116 122 230 236 7 268 7 242 115 3 95 186 125 238 285 74 263 12
-224 187 264 164 50 299 159 127 127 153 45 13 33 121 91 39 242 89 111 173 166 37
-314 20 188 53 307 162 148 122 204 27 85 294 190 1 167 117 248 164 63 245 97 114
-194 161 42 250 92 132 122 217 290 69 281 257 280 118 37 36 175 94 60 191 94 47
-245 110 60 178 148 109 258 43 98 227 228 4 247 12 237 133 248 151 117 261 110
-47 232 164 76 191 81 101 261 123 310 216 197 143 153 32 67 49 134 24 31 245 123
-6 162 135 176 220 40 18 286 239 35 62 106 217 303 15 265 244 30 126 34 273 280
-105 91 52 188 27 98 240 174 305 234 79 199 84 168 256 128 292 288 141 212 17
-206 259 208 187 277 110 34 286 226 89 124 119 150 24 18 299 185 19 95 173 179
-300 252 7 255 61 304 82 253 133 235 205 179 274 43 85 281 244 17 180 50 286 213
-143 140 86 83 16 67 62 80 8 64 312 131 3 82 240 187 251 218 112 266 92 119 176
-233 303 2 2 306 43 59 26 5 314 46 80 21 10 296 118 24 44 191 107 39 229 143 127
-140 99 29 54 129 42 276 301 100 142 34 260 17 167 104 302 180 76 178 135 163
-274 56 31 219 231 84 142 1 206 272 154 171 264 177 42 237 146 194 135 150 11 72
-44 152 269 87 222 259 195 241 293 77 284 7 229 169 19 108 119 163 287 2 15 252
-298 46 93 284 311 283 185 32 41 157 212 4 260 4 221 120 315 113 114 181 215 58
-263 25 170 171 251 231 58 250 79 186 138 184 223 61 13 20 175 107 6 175 81 114
-207 107 26 283 159 140 73 137 78 80 312 118 11 98 253 120 289 221 146 207 81 88
-315 139 6 149 189 192 233 290 56 18 273 293 51 75 39 255 35 49 160 233 316 265
-257 293 64 21 23 242 102 57 111 199 58 276 288 154 158 1 193 9 170 184 197 169
-45 41 183 104 289 234 92 145 68 155 6 136 243 208 203 ^
-656 0 221 48 21 32 186 40 42 178 159 51 196 72 161 187 177 283 306 23 266 309
-296 129 10 26 220 172 316 178 61 228 151 130 205 90 34 297 168 69 109 182 112
-292 299 83 192 46 269 263 159 149 19 117 63 143 274 67 292 201 260 147 104 313
-126 56 163 200 123 225 16 90 230 262 258 232 21 57 39 264 296 31 147 300 278
-216 219 35 75 50 197 13 78 225 237 267 185 41 302 95 197 71 220 270 139 223 3
-144 288 273 191 228 28 135 295 253 265 172 95 1 106 130 107 267 29 36 212 291 6
-196 293 19 142 275 8 209 239 280 131 23 291 162 161 64 142 14 150 254 141 236
-268 126 277 21 155 221 309 198 306 284 124 264 75 173 192 242 234 34 3 21 253
-44 35 140 262 62 227 250 213 167 30 50 99 150 33 4 281 170 82 55 124 141 40 263
-36 114 109 280 294 18 201 39 289 149 215 82 153 306 186 301 219 133 257 95 99
-248 175 9 183 126 179 198 110 279 34 101 163 298 265 270 237 46 8 86 204 51 294
-214 206 89 133 61 130 9 85 303 134 256 154 182 210 115 25 304 108 143 53 209 18
-103 176 244 247 299 304 10 1 8 307 62 6 73 258 69 305 147 202 136 171 277 119
-297 266 211 154 84 68 70 83 29 11 67 71 24 305 49 60 91 269 2 22 194 280 33 160
-246 260 245 286 39 68 12 260 24 109 84 289 247 38 127 55 222 283 85 205 311 211
-252 226 113 12 39 166 154 305 245 25 181 113 233 216 121 212 30 148 241 195 254
-239 59 313 28 233 118 298 167 128 192 144 92 308 101 65 156 220 49 281 268 224
-100 66 57 137 87 22 292 103 78 102 202 38 29 232 177 22 129 68 168 265 74 272
-275 204 174 10 124 43 217 218 134 158 12 137 308 199 247 201 162 5 59 52 210
-278 20 214 304 271 178 282 46 106 228 249 312 250 311 309 75 271 15 287 136 269
-100 164 239 182 308 297 70 246 64 240 196 195 156 97 14 52 112 96 15 312 29 134
-35 17 227 152 71 122 128 94 2 47 47 145 287 13 274 190 8 111 97 235 229 67 194
-59 215 205 188 216 23 70 25 206 285 98 151 293 240 230 66 253 142 177 185 164
-18 5 34 199 26 24 207 226 15 189 313 224 198 208 102 79 3 119 76 89 256 56 40
-165 213 69 207 5 157 234 255 180 295 32 88 217 316 276 203 273 93 86 302 193 20
-116 122 226 236 7 268 3 242 111 318 93 184 125 238 281 72 259 10 222 185 262
-160 50 295 155 123 127 153 45 9 27 121 89 35 238 85 107 169 166 31 310 16 188
-53 307 160 148 118 200 25 83 290 188 314 165 115 246 162 63 241 97 112 194 157
-38 250 90 132 120 213 290 65 279 255 278 118 37 30 173 94 60 189 92 47 243 110
-58 176 146 105 254 43 94 223 224 2 243 12 235 131 244 149 117 259 108 45 230
-164 76 187 79 101 261 109 ^
-656 0 310 208 189 143 149 32 59 41 130 20 31 245 123 2 154 135 168 216 32 14
-286 231 31 62 102 213 303 7 257 244 22 118 26 269 272 105 91 44 180 27 94 232
-166 301 230 79 199 84 164 248 128 288 284 133 208 17 198 259 204 187 273 102 30
-282 218 85 116 111 146 16 18 299 177 11 87 169 179 292 252 3 255 53 296 82 249
-125 227 201 171 266 39 77 273 240 9 172 46 278 205 139 136 86 79 16 63 54 76 56
-312 123 312 78 236 179 247 210 104 266 84 119 172 229 299 315 311 298 31 51 26
-314 314 38 80 13 2 292 114 24 44 191 103 27 221 135 123 140 99 25 317 54 121 42
-276 301 92 134 22 256 5 159 100 298 180 72 170 131 155 270 52 23 219 231 76 138
-1 202 272 150 167 264 169 30 237 142 186 127 142 3 72 32 152 265 87 214 255 191
-241 293 77 284 316 229 161 15 100 115 159 283 319 3 244 298 42 93 280 303 283
-181 24 33 149 204 4 252 313 213 120 307 113 106 181 207 54 259 21 166 163 251
-223 50 246 75 186 138 184 223 61 1 8 175 107 6 167 81 114 207 99 14 275 155 132
-73 133 70 72 308 110 11 98 245 112 281 221 146 199 73 88 315 139 319 141 189
-188 225 286 48 10 273 285 51 71 35 247 27 49 156 233 312 261 257 289 64 17 15
-238 94 49 111 191 58 272 288 146 154 318 189 5 170 176 197 169 41 313 41 175 96
-285 234 92 145 64 155 315 128 243 208 200 219 48 21 28 184 40 40 178 157 47 196
-68 157 185 175 279 306 23 264 307 296 127 4 24 216 170 314 176 59 224 151 130
-203 86 34 295 164 65 107 178 112 292 297 79 188 42 265 259 159 145 19 113 61
-139 274 65 290 199 256 143 104 311 126 52 161 198 121 225 10 90 230 262 254 228
-15 55 39 260 294 29 147 300 278 216 215 35 75 48 193 7 74 223 233 267 185 37
-300 95 195 71 218 268 137 221 318 144 284 271 187 228 26 131 293 249 263 172 91
-320 104 128 105 263 23 36 210 287 194 291 13 140 271 4 207 237 280 131 17 291
-162 161 60 142 14 148 252 141 234 264 124 275 17 153 217 305 198 304 280 120
-262 71 173 192 238 232 28 1 19 251 40 29 136 258 58 227 246 213 165 28 46 95
-150 29 319 279 168 78 53 124 137 38 263 34 112 109 276 290 16 201 33 287 149
-215 80 151 302 182 297 217 133 253 93 97 248 173 9 183 122 177 194 108 279 30
-99 163 296 265 270 235 44 8 82 204 49 294 212 202 89 129 57 126 7 85 299 132
-256 154 180 210 115 21 304 108 141 51 209 14 103 176 242 245 295 302 10 318 6
-305 60 4 69 258 69 303 145 202 134 171 277 115 297 262 209 152 82 66 70 83 29 9
-67 67 22 301 47 58 89 267 2 16 190 278 33 160 246 258 241 282 35 64 6 260 18
-105 80 289 247 38 125 55 292 ^
-<D
-
-H>SHS Type 3 Strings<H
-D>
-45 0 14 5 3 1 4 16 12 20 1 6 15 11 18 4 17 16 6 10 3 2 9 9 14 6 2 8 6 7 10 17
-12 20 6 7 5 16 1 4 2 17 10 15 8 20 1 ^
-<D
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-fail.conf.in b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-fail.conf.in
deleted file mode 100644
index bab178f6ed..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-fail.conf.in
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>@TEST_LISTEN@</listen>
- <type>system</type>
- <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@DBUS_TEST_DATA@/invalid-service-files-system</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-pass.conf.in b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-pass.conf.in
deleted file mode 100644
index 38366730ec..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files-system/debug-allow-all-pass.conf.in
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>@TEST_LISTEN@</listen>
- <type>system</type>
- <servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@DBUS_TEST_DATA@/valid-service-files-system</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.conf b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.conf
deleted file mode 100644
index 5297097dbc..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- </policy>
-
- <limit name="max_incoming_bytes">5000</limit>
- <limit name="max_outgoing_bytes">5000</limit>
- <limit name="max_message_size">300</limit>
- <limit name="service_start_timeout">5000</limit>
- <limit name="auth_timeout">6000</limit>
- <limit name="max_completed_connections">50</limit>
- <limit name="max_incomplete_connections">80</limit>
- <limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_service_starts">64</limit>
- <limit name="max_names_per_connection">256</limit>
-
- <selinux>
- <associate own="org.freedesktop.FrobationaryMeasures"
- context="my_selinux_context_t"/>
- <associate own="org.freedesktop.BlahBlahBlah"
- context="foo_t"/>
- </selinux>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.d/basic.conf b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.d/basic.conf
deleted file mode 100644
index d109d71dc9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/basic.d/basic.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all-sha1.conf.in b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all-sha1.conf.in
deleted file mode 100644
index 8baee7dbde..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all-sha1.conf.in
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- Bus that listens on a debug pipe and requires SHA1 auth, used to test SHA1 -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>@TEST_LISTEN@</listen>
- <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
- <auth>DBUS_COOKIE_SHA1</auth>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all.conf.in b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all.conf.in
deleted file mode 100644
index 00df20d5db..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/debug-allow-all.conf.in
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>@TEST_LISTEN@</listen>
- <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/entities.conf b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/entities.conf
deleted file mode 100644
index 3d3cea79a7..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/entities.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-<!-- This config file contains XML entities -->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/&lt;bar&gt;</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.&#100;</includedir>
- <servicedir>/usr/&amp;share/foo</servicedir>
- <include ignore_missing="ye&#115;">nonexistent.conf&#110;</include>
- <policy context="&#100;efault">
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/incoming-limit.conf.in b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/incoming-limit.conf.in
deleted file mode 100644
index 40ff22447c..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/incoming-limit.conf.in
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
- <listen>@TEST_LISTEN@</listen>
-
- <policy context="default">
- <!-- Allow everything to be sent -->
- <allow send_destination="*" eavesdrop="true"/>
- <!-- Allow everything to be received -->
- <allow eavesdrop="true"/>
- <!-- Allow anyone to own anything -->
- <allow own="*"/>
- </policy>
-
- <limit name="max_incoming_bytes">1</limit>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/many-rules.conf b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/many-rules.conf
deleted file mode 100644
index 2393162651..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/many-rules.conf
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <standard_session_servicedirs />
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- <deny send_interface="org.freedesktop.System" send_member="Reboot"/>
- <deny receive_interface="org.freedesktop.System" receive_member="Reboot"/>
- <deny send_path="/foo/bar/SystemObjectThing" send_member="Reboot"/>
- <deny own="org.freedesktop.System"/>
- <deny own_prefix="org.freedesktop.ManySystems"/>
- <deny send_destination="org.freedesktop.System"/>
- <deny receive_sender="org.freedesktop.System"/>
- <deny user="root"/>
- <deny group="bin"/>
- <allow send_type="error"/>
- <allow send_type="method_call"/>
- <allow send_type="method_return"/>
- <allow send_type="signal"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo" send_type="method_call"/>
- </policy>
-
- <policy context="mandatory">
- <allow user="*"/>
- <deny send_interface="org.freedesktop.System" send_member="Reboot"/>
- <deny receive_interface="org.freedesktop.System" receive_member="Reboot"/>
- <deny send_path="/foo/bar/SystemObjectThing" send_member="Reboot"/>
- <deny own="org.freedesktop.System"/>
- <deny own_prefix="org.freedesktop.ManySystems"/>
- <deny send_destination="org.freedesktop.System"/>
- <deny receive_sender="org.freedesktop.System"/>
- <deny user="root"/>
- <deny group="bin"/>
- <allow send_type="error"/>
- <allow send_type="method_call"/>
- <allow send_type="method_return"/>
- <allow send_type="signal"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo" send_type="method_call"/>
- </policy>
-
- <limit name="max_incoming_bytes">5000</limit>
- <limit name="max_outgoing_bytes">5000</limit>
- <limit name="max_message_size">300</limit>
- <limit name="service_start_timeout">5000</limit>
- <limit name="auth_timeout">6000</limit>
- <limit name="max_completed_connections">50</limit>
- <limit name="max_incomplete_connections">80</limit>
- <limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_service_starts">64</limit>
- <limit name="max_names_per_connection">256</limit>
- <limit name="max_match_rules_per_connection">512</limit>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/system.d/test.conf b/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/system.d/test.conf
deleted file mode 100644
index 5b60a1fc59..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-config-files/system.d/test.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- The following demonstrates how to punch holes in a default deny-all
- policy so that a particular user can own a service, and other
- connections can get messages from it -->
-
- <!-- Only root can own the FooService service, and
- this user can only send the one kind of message -->
- <policy user="root">
- <allow own="org.foo.FooService"/>
- <allow send_interface="org.foo.FooBroadcastInterface"/>
- </policy>
-
- <!-- Allow any connection to receive the message, but
- only if the message is sent by the owner of FooService -->
- <policy context="default">
- <allow receive_interface="org.foo.FooBroadcastInterface" receive_sender="org.foo.FooService"/>
- </policy>
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/array-of-array-of-uint32.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/array-of-array-of-uint32.message
deleted file mode 100644
index e12186b101..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/array-of-array-of-uint32.message
+++ /dev/null
@@ -1,33 +0,0 @@
-# Message with an array of array of uint32
-
-VALID_HEADER method_call
-REQUIRED_FIELDS
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-
-TYPE ARRAY
-TYPE ARRAY
-TYPE UINT32
-
-LENGTH Array
-START_LENGTH Array
-
-## array of uint32
-LENGTH SubArray1
-START_LENGTH SubArray1
-UINT32 1
-UINT32 2
-UINT32 3
-END_LENGTH SubArray1
-
-## array of uint32
-LENGTH SubArray2
-START_LENGTH SubArray2
-UINT32 4
-UINT32 5
-END_LENGTH SubArray2
-
-END_LENGTH Array
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict-simple.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict-simple.message
deleted file mode 100644
index fa6927df63..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict-simple.message
+++ /dev/null
@@ -1,15 +0,0 @@
-# A simple dict
-
-VALID_HEADER method_call
-REQUIRED_FIELDS
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE DICT
-LENGTH Dict
-START_LENGTH Dict
-STRING 'int32'
-TYPE INT32
-INT32 0x12345678
-END_LENGTH Dict
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict.message
deleted file mode 100644
index 0f997b1f45..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/dict.message
+++ /dev/null
@@ -1,47 +0,0 @@
-# Dict with different values
-
-VALID_HEADER method_call
-REQUIRED_FIELDS
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE DICT
-LENGTH Dict
-START_LENGTH Dict
-STRING 'boolean'
-TYPE BOOLEAN
-BYTE 1
-STRING 'int32'
-TYPE INT32
-INT32 0x12345678
-STRING 'uint32'
-TYPE UINT32
-UINT32 0x8765432
-STRING 'double'
-TYPE DOUBLE
-DOUBLE 3.141592653589
-STRING 'string'
-TYPE STRING
-STRING 'This is a string'
-STRING 'boolean_array'
-TYPE ARRAY
-TYPE BOOLEAN
-BOOLEAN_ARRAY { true, false, false, true, false }
-STRING 'int32_array'
-TYPE ARRAY
-TYPE INT32
-INT32_ARRAY { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10 }
-STRING 'uint32_array'
-TYPE ARRAY
-TYPE UINT32
-UINT32_ARRAY { 11, 12, 314, 1911, 57692, 1237, 2834 }
-STRING 'double_array'
-TYPE ARRAY
-TYPE DOUBLE
-DOUBLE_ARRAY { 0.1, 0.2, 3.1415926, 2.7183, 10.0, 9.99 }
-STRING 'string_array'
-TYPE ARRAY
-TYPE STRING
-STRING_ARRAY { 'Hello', 'This', 'Is', 'A', 'String', 'Array!' }
-END_LENGTH Dict
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/emptiness.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/emptiness.message
deleted file mode 100644
index 32042c0160..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/emptiness.message
+++ /dev/null
@@ -1,63 +0,0 @@
-# Empty arrays and strings
-
-VALID_HEADER method_call
-REQUIRED_FIELDS
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE STRING
-INT32 0
-BYTE 0 # Strings need to be NULL-terminated
-TYPE ARRAY
-TYPE BOOLEAN
-INT32 0
-TYPE ARRAY
-TYPE INT32
-INT32 0
-TYPE ARRAY
-TYPE UINT32
-INT32 0
-TYPE ARRAY
-TYPE DOUBLE
-INT32 0
-TYPE ARRAY
-TYPE BYTE
-INT32 0
-TYPE ARRAY
-TYPE STRING
-INT32 0
-TYPE DICT
-INT32 0
-
-# A dict with empty arrays
-TYPE DICT
-LENGTH Dict
-START_LENGTH Dict
-STRING 'boolean_array'
-TYPE ARRAY
-TYPE BOOLEAN
-INT32 0
-STRING 'int32_array'
-TYPE ARRAY
-TYPE INT32
-INT32 0
-STRING 'uint32_array'
-TYPE ARRAY
-TYPE UINT32
-INT32 0
-STRING 'double_array'
-TYPE ARRAY
-TYPE DOUBLE
-INT32 0
-STRING 'byte_array'
-TYPE ARRAY
-TYPE BYTE
-INT32 0
-STRING 'string_array' }
-TYPE ARRAY
-TYPE STRING
-INT32 0
-END_LENGTH Dict
-
-END_LENGTH Body
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/lots-of-arguments.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/lots-of-arguments.message
deleted file mode 100644
index bdaae0f895..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/lots-of-arguments.message
+++ /dev/null
@@ -1,65 +0,0 @@
-# Message with lots of different argument types
-
-VALID_HEADER method_call
-REQUIRED_FIELDS
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE NIL
-TYPE BYTE
-BYTE 42
-TYPE INT32
-INT32 0x12345678
-TYPE UINT32
-UINT32 0x8765432
-TYPE DOUBLE
-DOUBLE 3.141592653589
-TYPE STRING
-STRING 'This is a string'
-TYPE ARRAY
-TYPE BOOLEAN
-BOOLEAN_ARRAY { true, false, false, true, false }
-TYPE ARRAY
-TYPE INT32
-INT32_ARRAY { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10 }
-TYPE ARRAY
-TYPE UINT32
-UINT32_ARRAY { 11, 12, 314, 1911, 57692, 1237, 2834 }
-TYPE ARRAY
-TYPE DOUBLE
-DOUBLE_ARRAY { 0.1, 0.2, 3.1415926, 2.7183, 10.0, 9.99 }
-TYPE ARRAY
-TYPE STRING
-STRING_ARRAY { 'Hello', 'This', 'Is', 'A', 'String', 'Array!' }
-TYPE CUSTOM
-STRING 'named type'
-BYTE_ARRAY { 'b', 'i', 'n', 'a', 'r', 'y', 'd', 'a', 't', 'a' }
-
-TYPE ARRAY
-TYPE DICT
-LENGTH Array
-START_LENGTH Array
-
-LENGTH Dict1
-START_LENGTH Dict1
-STRING 'key1'
-TYPE INT32
-INT32 0x12345678
-STRING 'key2'
-TYPE UINT32
-UINT32 0x8765432
-END_LENGTH Dict1
-
-LENGTH Dict2
-START_LENGTH Dict2
-STRING 'key1'
-TYPE INT32
-INT32 0x12345678
-STRING 'key2'
-TYPE UINT32
-UINT32 0x8765432
-END_LENGTH Dict2
-
-END_LENGTH Array
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/no-padding.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/no-padding.message
deleted file mode 100644
index 94df4d45bf..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/no-padding.message
+++ /dev/null
@@ -1,22 +0,0 @@
-## Message with no header padding
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-REQUIRED_FIELDS
-
-## this byte array is filled with zeros to the natural length
-## of the header
-HEADER_FIELD UNKNOWN
-TYPE ARRAY
-TYPE BYTE
-ALIGN 4
-LENGTH ThisByteArray
-START_LENGTH ThisByteArray
-BYTE 1
-ALIGN 8 1
-END_LENGTH ThisByteArray
-
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/opposite-endian.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/opposite-endian.message
deleted file mode 100644
index 90949dd2b2..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/opposite-endian.message
+++ /dev/null
@@ -1,30 +0,0 @@
-## Message of opposite endianness, with lots of random fields in it
-
-OPPOSITE_ENDIAN
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-REQUIRED_FIELDS
-
-HEADER_FIELD UNKNOWN
-TYPE INT32
-INT32 0xfeeb
-
-ALIGN 8
-END_LENGTH Header
-
-START_LENGTH Body
-
-TYPE INT32
-INT32 89765432
-TYPE UINT32
-UINT32 0xfffffff
-TYPE STRING
-STRING 'Hello this is a string'
-TYPE DOUBLE
-DOUBLE 3.14159
-
-TYPE NIL
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/recursive-types.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/recursive-types.message
deleted file mode 100644
index e306fd1f7c..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/recursive-types.message
+++ /dev/null
@@ -1,99 +0,0 @@
-## Message with recursive types
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-
-REQUIRED_FIELDS
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-
-# Everything is inside a dict
-TYPE DICT
-LENGTH Dict1
-START_LENGTH Dict1
-
-# first dict entry is an array of array of uint32
-STRING 'mega-uint-array'
-TYPE ARRAY
-TYPE ARRAY
-TYPE ARRAY
-TYPE UINT32
-LENGTH Array1
-START_LENGTH Array1
-
-LENGTH Array1_1
-START_LENGTH Array1_1
-UINT32_ARRAY { 1, 2, 3, 4, 5}
-UINT32_ARRAY { 2, 3, 4, 5, 1}
-UINT32_ARRAY { 3, 4, 5, 1, 2}
-END_LENGTH Array1_1
-
-LENGTH Array1_2
-START_LENGTH Array1_2
-UINT32_ARRAY { 4, 5, 6, 7, 8}
-UINT32_ARRAY { 5, 6, 7, 8, 4}
-END_LENGTH Array1_2
-
-END_LENGTH Array1
-
-# second dict entry is an array of strings
-STRING 'string-array'
-TYPE ARRAY
-TYPE STRING
-STRING_ARRAY { 'a', 'string', 'array'}
-
-# third dict entry is another dict
-STRING 'nested-dict'
-TYPE DICT
-LENGTH Dict2
-START_LENGTH Dict2
-
-STRING 'string'
-TYPE STRING
-STRING 'a deeply nested string'
-
-STRING 'super-nested-dict'
-TYPE DICT
-LENGTH Dict3
-START_LENGTH Dict3
-
-STRING 'double-array'
-TYPE ARRAY
-TYPE DOUBLE
-DOUBLE_ARRAY {1.0, 2.0, 3.0}
-
-STRING 'dict-array'
-TYPE ARRAY
-TYPE DICT
-LENGTH Array2
-START_LENGTH Array2
-
-LENGTH Dict4
-START_LENGTH Dict4
-STRING 'key4'
-TYPE BYTE
-BYTE '4'
-END_LENGTH Dict4
-
-LENGTH Dict5
-START_LENGTH Dict5
-STRING 'key5'
-TYPE BYTE
-BYTE '5'
-END_LENGTH Dict5
-
-END_LENGTH Array2
-
-STRING 'boolean'
-TYPE BOOLEAN
-BOOLEAN false
-
-END_LENGTH Dict3
-
-END_LENGTH Dict2
-
-END_LENGTH Dict1
-
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest-manual.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest-manual.message
deleted file mode 100644
index d6a960d6b1..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest-manual.message
+++ /dev/null
@@ -1,30 +0,0 @@
-## like simplest.message, but doesn't use VALID_HEADER
-## convenience command. mostly to test the test framework.
-
-LITTLE_ENDIAN
-BYTE 'l'
-BYTE 1
-BYTE 0
-BYTE 0
-LENGTH Header
-LENGTH Body
-## client serial
-INT32 7
-
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/foo'
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.Foo'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Bar'
-HEADER_FIELD SIGNATURE
-TYPE STRING
-STRING ''
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest.message
deleted file mode 100644
index b9ddaf6b65..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/simplest.message
+++ /dev/null
@@ -1,10 +0,0 @@
-## simplest possible valid message
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-REQUIRED_FIELDS
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-acquire-service.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-acquire-service.message
deleted file mode 100644
index 459f3bb43f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-acquire-service.message
+++ /dev/null
@@ -1,26 +0,0 @@
-# Standard org.freedesktop.DBus.AcquireService message
-
-VALID_HEADER method_call
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/org/freedesktop/DBus'
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'AcquireService'
-HEADER_FIELD DESTINATION
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD SIGNATURE
-TYPE STRING
-STRING 'su'
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE STRING
-STRING 'org.freedesktop.DBus.Sample'
-TYPE UINT32
-UINT32 0
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-hello.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-hello.message
deleted file mode 100644
index a08835e0ad..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-hello.message
+++ /dev/null
@@ -1,22 +0,0 @@
-# Standard org.freedesktop.DBus.Hello message
-
-VALID_HEADER method_call
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/org/freedesktop/DBus'
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'Hello'
-HEADER_FIELD DESTINATION
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD SIGNATURE
-TYPE STRING
-STRING ''
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-list-services.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-list-services.message
deleted file mode 100644
index 3e10aebedb..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-list-services.message
+++ /dev/null
@@ -1,22 +0,0 @@
-# Standard org.freedesktop.DBus.ListServices message
-
-VALID_HEADER method_call
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/org/freedesktop/DBus'
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'ListServices'
-HEADER_FIELD DESTINATION
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD SIGNATURE
-TYPE STRING
-STRING ''
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-service-exists.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-service-exists.message
deleted file mode 100644
index 6b57eb50dd..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/standard-service-exists.message
+++ /dev/null
@@ -1,24 +0,0 @@
-# Standard org.freedesktop.DBus.ServiceExists message
-
-VALID_HEADER method_call
-HEADER_FIELD PATH
-TYPE OBJECT_PATH
-OBJECT_PATH '/org/freedesktop/DBus'
-HEADER_FIELD INTERFACE
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD MEMBER
-TYPE STRING
-STRING 'ServiceExists'
-HEADER_FIELD DESTINATION
-TYPE STRING
-STRING 'org.freedesktop.DBus'
-HEADER_FIELD SIGNATURE
-TYPE STRING
-STRING 's'
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-TYPE STRING
-STRING 'org.freedesktop.DBus.Sample'
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/unknown-header-field.message b/src/3rd_party/dbus-1.7.8/test/data/valid-messages/unknown-header-field.message
deleted file mode 100644
index ac7d624ced..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-messages/unknown-header-field.message
+++ /dev/null
@@ -1,19 +0,0 @@
-## message with a 'name' header field and unknown 'unkn' field
-
-## VALID_HEADER includes a LENGTH Header and LENGTH Body
-VALID_HEADER method_call
-REQUIRED_FIELDS
-
-HEADER_FIELD UNKNOWN
-TYPE DICT
-LENGTH Dict
-START_LENGTH Dict
-STRING 'int32'
-TYPE INT32
-INT32 0x12345678
-END_LENGTH Dict
-
-ALIGN 8
-END_LENGTH Header
-START_LENGTH Body
-END_LENGTH Body
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in
deleted file mode 100644
index 3076f3bf57..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteEchoService
-Exec=@DBUS_TEST_EXEC@/test-service@EXEEXT@
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
deleted file mode 100644
index 705d71488a..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteSegfaultService
-Exec=@DBUS_TEST_EXEC@/test-segfault@EXEEXT@
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
deleted file mode 100644
index 870835ea09..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceFail
-Exec=@DBUS_TEST_EXEC@/test-shell-service@EXEEXT@ "this should 'fail' because of an unterminated quote
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
deleted file mode 100644
index 664726141f..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess
-Exec=@DBUS_TEST_EXEC@/test-shell-service@EXEEXT@ -test "that" 'we get' back --what "we put in"
-User=anyrandomuser
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in
deleted file mode 100644
index 0fdfeade03..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuite.PrivServer
-Exec=@DBUS_TEST_EXEC@/name-test/test-privserver@EXEEXT@
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in
deleted file mode 100644
index a22a77d197..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteEchoService
-Exec=@DBUS_TEST_EXEC@/test-service@EXEEXT@
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in
deleted file mode 100644
index 633862c7a9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteForkingEchoService
-Exec=@DBUS_TEST_EXEC@/test-service@EXEEXT@ org.freedesktop.DBus.TestSuiteForkingEchoService fork
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
deleted file mode 100644
index 76254275a0..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteSegfaultService
-Exec=@DBUS_TEST_EXEC@/test-segfault@EXEEXT@
-
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
deleted file mode 100644
index 8f5964a2a3..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceFail
-Exec=@DBUS_TEST_EXEC@/test-shell-service@EXEEXT@ "this should 'fail' because of an unterminated quote
diff --git a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in b/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
deleted file mode 100644
index a52887e579..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess
-Exec=@DBUS_TEST_EXEC@/test-shell-service@EXEEXT@ -test "that" 'we get' back --what "we put in"
-
diff --git a/src/3rd_party/dbus-1.7.8/test/dbus-daemon-eavesdrop.c b/src/3rd_party/dbus-1.7.8/test/dbus-daemon-eavesdrop.c
deleted file mode 100644
index 2c45f54e11..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/dbus-daemon-eavesdrop.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/* Integration tests for the eavesdrop=true|false keyword in DBusMatchRule
- *
- * Author: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
- * Based on: tests/dbus-daemon.c by Simon McVittie
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-#include <string.h>
-
-#ifdef DBUS_WIN
-# include <io.h>
-# include <windows.h>
-#else
-# include <signal.h>
-# include <unistd.h>
-#endif
-
-#include "test-utils.h"
-
-#define SENDER_NAME "test.eavesdrop.sender"
-#define SENDER_PATH "/test/eavesdrop/sender"
-#define SENDER_IFACE SENDER_NAME
-#define SENDER_SIGNAL_NAME "Signal"
-#define SENDER_STOPPER_NAME "Stopper"
-
-/* This rule is equivalent to the one added to a proxy connecting to
- * SENDER_NAME+SENDER_IFACE, plus restricting on signal name.
- * Being more restrictive, if the connection receives what we need, for sure
- * the original proxy rule will match it */
-#define RECEIVER_RULE "sender='" SENDER_NAME "'," \
- "interface='" SENDER_IFACE "'," \
- "type='signal'," \
- "member='" SENDER_SIGNAL_NAME "'"
-#define POLITELISTENER_RULE RECEIVER_RULE
-#define EAVESDROPPER_RULE RECEIVER_RULE ",eavesdrop=true"
-
-#define STOPPER_RULE "sender='" SENDER_NAME \
- "',interface='" SENDER_IFACE "',type='signal',member='" SENDER_STOPPER_NAME "'"
-
-/* a connection received a signal to whom? */
-typedef enum {
- NONE_YET = 0,
- TO_ME,
- TO_OTHER,
- BROADCAST,
-} SignalDst;
-
-typedef struct {
- TestMainContext *ctx;
- DBusError e;
- GError *ge;
-
- GPid daemon_pid;
-
- /* eavedrop keyword tests */
- DBusConnection *sender;
- DBusConnection *receiver;
- SignalDst receiver_dst;
- dbus_bool_t receiver_got_stopper;
- DBusConnection *eavesdropper;
- SignalDst eavesdropper_dst;
- dbus_bool_t eavesdropper_got_stopper;
- DBusConnection *politelistener;
- SignalDst politelistener_dst;
- dbus_bool_t politelistener_got_stopper;
-} Fixture;
-
-#define assert_no_error(e) _assert_no_error (e, __FILE__, __LINE__)
-static void
-_assert_no_error (const DBusError *e,
- const char *file,
- int line)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("%s:%d: expected success but got error: %s: %s",
- file, line, e->name, e->message);
-}
-
-static gchar *
-spawn_dbus_daemon (gchar *binary,
- gchar *configuration,
- GPid *daemon_pid)
-{
- GError *error = NULL;
- GString *address;
- gint address_fd;
- gchar *argv[] = {
- binary,
- configuration,
- "--nofork",
- "--print-address=1", /* stdout */
- NULL
- };
-
- g_spawn_async_with_pipes (NULL, /* working directory */
- argv,
- NULL, /* envp */
- G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
- NULL, /* child_setup */
- NULL, /* user data */
- daemon_pid,
- NULL, /* child's stdin = /dev/null */
- &address_fd,
- NULL, /* child's stderr = our stderr */
- &error);
- g_assert_no_error (error);
-
- address = g_string_new (NULL);
-
- /* polling until the dbus-daemon writes out its address is a bit stupid,
- * but at least it's simple, unlike dbus-launch... in principle we could
- * use select() here, but life's too short */
- while (1)
- {
- gssize bytes;
- gchar buf[4096];
- gchar *newline;
-
- bytes = read (address_fd, buf, sizeof (buf));
-
- if (bytes > 0)
- g_string_append_len (address, buf, bytes);
-
- newline = strchr (address->str, '\n');
-
- if (newline != NULL)
- {
- g_string_truncate (address, newline - address->str);
- break;
- }
-
- g_usleep (G_USEC_PER_SEC / 10);
- }
-
- return g_string_free (address, FALSE);
-}
-
-static DBusConnection *
-connect_to_bus (Fixture *f,
- const gchar *address)
-{
- DBusConnection *conn;
- DBusError error = DBUS_ERROR_INIT;
- dbus_bool_t ok;
-
- conn = dbus_connection_open_private (address, &error);
- assert_no_error (&error);
- g_assert (conn != NULL);
-
- ok = dbus_bus_register (conn, &error);
- assert_no_error (&error);
- g_assert (ok);
- g_assert (dbus_bus_get_unique_name (conn) != NULL);
-
- test_connection_setup (f->ctx, conn);
- return conn;
-}
-
-/* send a unicast signal to <self> to ensure that no other connection
- * listening is the actual recipient for the signal */
-static DBusHandlerResult
-sender_send_unicast_to_sender (Fixture *f)
-{
- DBusMessage *signal;
-
- signal = dbus_message_new_signal (SENDER_PATH, SENDER_IFACE,
- SENDER_SIGNAL_NAME);
- dbus_message_set_destination (signal, dbus_bus_get_unique_name (f->sender));
-
- if (signal == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send (f->sender, signal, NULL))
- g_error ("OOM");
-
- dbus_message_unref (signal);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-/* send a unicast signal to <receiver>, making <politelistener> and
- * <eavesdropper> not a actual recipient for it */
-static DBusHandlerResult
-sender_send_unicast_to_receiver (Fixture *f)
-{
- DBusMessage *signal;
-
- signal = dbus_message_new_signal (SENDER_PATH, SENDER_IFACE, SENDER_SIGNAL_NAME);
- dbus_message_set_destination (signal, dbus_bus_get_unique_name (f->receiver));
-
- if (signal == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send (f->sender, signal, NULL))
- g_error ("OOM");
-
- dbus_message_unref (signal);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static DBusHandlerResult
-sender_send_broadcast (Fixture *f)
-{
- DBusMessage *signal;
-
- signal = dbus_message_new_signal (SENDER_PATH, SENDER_IFACE, SENDER_SIGNAL_NAME);
- dbus_message_set_destination (signal, NULL);
-
- if (signal == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send (f->sender, signal, NULL))
- g_error ("OOM");
-
- dbus_message_unref (signal);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-/* Send special broadcast signal to indicate that the connections can "stop"
- * listening and check their results.
- * DBus does not re-order messages, so when the three connections have received
- * this signal, we are sure that any message sent before it has also been
- * dispatched. */
-static DBusHandlerResult
-sender_send_stopper (Fixture *f)
-{
- DBusMessage *signal;
-
- signal = dbus_message_new_signal (SENDER_PATH, SENDER_IFACE, SENDER_STOPPER_NAME);
- dbus_message_set_destination (signal, NULL);
-
- if (signal == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send (f->sender, signal, NULL))
- g_error ("OOM");
-
- dbus_message_unref (signal);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-/* Ignore NameAcquired, then depending on the signal received:
- * - updates f-><conn>_dst based on the destination of the message
- * - asserts that <conn> received the stop signal
- */
-static DBusHandlerResult
-signal_filter (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- Fixture *f = user_data;
- SignalDst *dst = NULL;
- DBusConnection **conn;
- dbus_bool_t *got_stopper;
-
- if (0 == strcmp (dbus_message_get_member (message), "NameAcquired"))
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- if (connection == f->receiver)
- {
- dst = &(f->receiver_dst);
- conn = &(f->receiver);
- got_stopper = &(f->receiver_got_stopper);
- }
- else if (connection == f->eavesdropper)
- {
- dst = &(f->eavesdropper_dst);
- conn = &(f->eavesdropper);
- got_stopper = &(f->eavesdropper_got_stopper);
- }
- else if (connection == f->politelistener)
- {
- dst = &(f->politelistener_dst);
- conn = &(f->politelistener);
- got_stopper = &(f->politelistener_got_stopper);
- }
- else
- {
- g_error ("connection not matching");
- }
-
- if (0 == strcmp (dbus_message_get_member (message), SENDER_SIGNAL_NAME))
- {
- if (dbus_message_get_destination (message) == NULL)
- *dst = BROADCAST;
- else if (0 == strcmp (dbus_message_get_destination (message), dbus_bus_get_unique_name (*conn)))
- *dst = TO_ME;
- else /* if (dbus_message_get_destination (message) != NULL) */
- *dst = TO_OTHER;
- }
- else if (0 == strcmp (dbus_message_get_member (message), SENDER_STOPPER_NAME))
- {
- *got_stopper = TRUE;
- }
- else
- {
- g_error ("got unknown member from message: %s",
- dbus_message_get_member (message));
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static void
-add_receiver_filter (Fixture *f)
-{
- DBusError e = DBUS_ERROR_INIT;
-
- dbus_bus_add_match (f->receiver, RECEIVER_RULE, &e);
- assert_no_error (&e);
- dbus_bus_add_match (f->receiver, STOPPER_RULE, &e);
- assert_no_error (&e);
-
- if (!dbus_connection_add_filter (f->receiver,
- signal_filter, f, NULL))
- g_error ("OOM");
-}
-
-static void
-add_eavesdropper_filter (Fixture *f)
-{
- DBusError e = DBUS_ERROR_INIT;
-
- dbus_bus_add_match (f->eavesdropper, EAVESDROPPER_RULE, &e);
- assert_no_error (&e);
- dbus_bus_add_match (f->eavesdropper, STOPPER_RULE, &e);
- assert_no_error (&e);
-
- if (!dbus_connection_add_filter (f->eavesdropper,
- signal_filter, f, NULL))
- g_error ("OOM");
-}
-
-static void
-add_politelistener_filter (Fixture *f)
-{
- DBusError e = DBUS_ERROR_INIT;
-
- dbus_bus_add_match (f->politelistener, POLITELISTENER_RULE, &e);
- assert_no_error (&e);
- dbus_bus_add_match (f->politelistener, STOPPER_RULE, &e);
- assert_no_error (&e);
-
- if (!dbus_connection_add_filter (f->politelistener,
- signal_filter, f, NULL))
- g_error ("OOM");
-}
-
-static void
-setup (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- gchar *dbus_daemon;
- gchar *config;
- gchar *address;
-
- f->ctx = test_main_context_get ();
-
- f->ge = NULL;
- dbus_error_init (&f->e);
-
- dbus_daemon = g_strdup (g_getenv ("DBUS_TEST_DAEMON"));
-
- if (dbus_daemon == NULL)
- dbus_daemon = g_strdup ("dbus-daemon");
-
- if (g_getenv ("DBUS_TEST_SYSCONFDIR") != NULL)
- {
- config = g_strdup_printf ("--config-file=%s/dbus-1/session.conf",
- g_getenv ("DBUS_TEST_SYSCONFDIR"));
- }
- else if (g_getenv ("DBUS_TEST_DATA") != NULL)
- {
- config = g_strdup_printf (
- "--config-file=%s/valid-config-files/session.conf",
- g_getenv ("DBUS_TEST_DATA"));
- }
- else
- {
- config = g_strdup ("--session");
- }
-
- address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
-
- g_free (dbus_daemon);
- g_free (config);
-
- f->sender = connect_to_bus (f, address);
- dbus_bus_request_name (f->sender, SENDER_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE,
- &(f->e));
- f->receiver = connect_to_bus (f, address);
- f->eavesdropper = connect_to_bus (f, address);
- f->politelistener = connect_to_bus (f, address);
- add_receiver_filter (f);
- add_politelistener_filter (f);
- add_eavesdropper_filter (f);
-
- g_free (address);
-}
-
-static void
-test_eavesdrop_broadcast (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- sender_send_broadcast (f);
- sender_send_stopper (f);
-
- while (!f->receiver_got_stopper ||
- !f->politelistener_got_stopper ||
- !f->eavesdropper_got_stopper)
- test_main_context_iterate (f->ctx, TRUE);
-
- /* all the three connection can receive a broadcast */
- g_assert_cmpint (f->receiver_dst, ==, BROADCAST);
- g_assert_cmpint (f->politelistener_dst, ==, BROADCAST);
- g_assert_cmpint (f->eavesdropper_dst, ==, BROADCAST);
-}
-
-/* a way to say that none of the listening connection are destination of the
- * signal */
-static void
-test_eavesdrop_unicast_to_sender (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- sender_send_unicast_to_sender (f);
- sender_send_stopper (f);
-
- while (!f->receiver_got_stopper ||
- !f->politelistener_got_stopper ||
- !f->eavesdropper_got_stopper)
- test_main_context_iterate (f->ctx, TRUE);
-
- /* not directed to it and not broadcasted, they cannot receive it */
- g_assert_cmpint (f->receiver_dst, ==, NONE_YET);
- g_assert_cmpint (f->politelistener_dst, ==, NONE_YET);
- /* eavesdrop=true, it will receive the signal even though it's not directed
- * to it */
- g_assert_cmpint (f->eavesdropper_dst, ==, TO_OTHER);
-}
-
-static void
-test_eavesdrop_unicast_to_receiver (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- sender_send_unicast_to_receiver (f);
- sender_send_stopper (f);
-
- while (!f->receiver_got_stopper ||
- !f->politelistener_got_stopper ||
- !f->eavesdropper_got_stopper)
- test_main_context_iterate (f->ctx, TRUE);
-
- /* direct to him */
- g_assert_cmpint (f->receiver_dst, ==, TO_ME);
- /* not directed to it and not broadcasted, it cannot receive it */
- g_assert_cmpint (f->politelistener_dst, ==, NONE_YET);
- /* eavesdrop=true, it will receive the signal even though it's not directed
- * to it */
- g_assert_cmpint (f->eavesdropper_dst, ==, TO_OTHER);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- dbus_error_free (&f->e);
- g_clear_error (&f->ge);
-
- if (f->sender != NULL)
- {
- dbus_connection_close (f->sender);
- dbus_connection_unref (f->sender);
- f->sender = NULL;
- }
-
- if (f->receiver != NULL)
- {
- dbus_connection_remove_filter (f->receiver,
- signal_filter, f);
-
- dbus_connection_close (f->receiver);
- dbus_connection_unref (f->receiver);
- f->receiver = NULL;
- }
-
- if (f->politelistener != NULL)
- {
- dbus_connection_remove_filter (f->politelistener,
- signal_filter, f);
-
- dbus_connection_close (f->politelistener);
- dbus_connection_unref (f->politelistener);
- f->politelistener = NULL;
- }
-
- if (f->eavesdropper != NULL)
- {
- dbus_connection_remove_filter (f->eavesdropper,
- signal_filter, f);
-
- dbus_connection_close (f->eavesdropper);
- dbus_connection_unref (f->eavesdropper);
- f->eavesdropper = NULL;
- }
-
-#ifdef DBUS_WIN
- TerminateProcess (f->daemon_pid, 1);
-#else
- kill (f->daemon_pid, SIGTERM);
-#endif
-
- g_spawn_close_pid (f->daemon_pid);
-
- test_main_context_unref (f->ctx);
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/eavedrop/match_keyword/broadcast", Fixture, NULL,
- setup, test_eavesdrop_broadcast, teardown);
- g_test_add ("/eavedrop/match_keyword/unicast_to_receiver", Fixture, NULL,
- setup, test_eavesdrop_unicast_to_receiver,
- teardown);
- g_test_add ("/eavedrop/match_keyword/unicast_to_sender", Fixture, NULL,
- setup, test_eavesdrop_unicast_to_sender, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/dbus-daemon.c b/src/3rd_party/dbus-1.7.8/test/dbus-daemon.c
deleted file mode 100644
index 22ea23e3e3..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/dbus-daemon.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/* Integration tests for the dbus-daemon
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-#include <string.h>
-
-#ifdef DBUS_WIN
-# include <io.h>
-# include <windows.h>
-#else
-# include <signal.h>
-# include <unistd.h>
-# include <sys/types.h>
-#endif
-
-#include "test-utils.h"
-
-typedef struct {
- gboolean skip;
-
- TestMainContext *ctx;
-
- DBusError e;
- GError *ge;
-
- GPid daemon_pid;
-
- DBusConnection *left_conn;
-
- DBusConnection *right_conn;
- gboolean right_conn_echo;
-} Fixture;
-
-#define assert_no_error(e) _assert_no_error (e, __FILE__, __LINE__)
-static void
-_assert_no_error (const DBusError *e,
- const char *file,
- int line)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("%s:%d: expected success but got error: %s: %s",
- file, line, e->name, e->message);
-}
-
-static gchar *
-spawn_dbus_daemon (gchar *binary,
- gchar *configuration,
- GPid *daemon_pid)
-{
- GError *error = NULL;
- GString *address;
- gint address_fd;
- gchar *argv[] = {
- binary,
- configuration,
- "--nofork",
- "--print-address=1", /* stdout */
- NULL
- };
-
- g_spawn_async_with_pipes (NULL, /* working directory */
- argv,
- NULL, /* envp */
- G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
- NULL, /* child_setup */
- NULL, /* user data */
- daemon_pid,
- NULL, /* child's stdin = /dev/null */
- &address_fd,
- NULL, /* child's stderr = our stderr */
- &error);
- g_assert_no_error (error);
-
- address = g_string_new (NULL);
-
- /* polling until the dbus-daemon writes out its address is a bit stupid,
- * but at least it's simple, unlike dbus-launch... in principle we could
- * use select() here, but life's too short */
- while (1)
- {
- gssize bytes;
- gchar buf[4096];
- gchar *newline;
-
- bytes = read (address_fd, buf, sizeof (buf));
-
- if (bytes > 0)
- g_string_append_len (address, buf, bytes);
-
- newline = strchr (address->str, '\n');
-
- if (newline != NULL)
- {
- g_string_truncate (address, newline - address->str);
- break;
- }
-
- g_usleep (G_USEC_PER_SEC / 10);
- }
-
- return g_string_free (address, FALSE);
-}
-
-static DBusConnection *
-connect_to_bus (Fixture *f,
- const gchar *address)
-{
- DBusConnection *conn;
- DBusError error = DBUS_ERROR_INIT;
- dbus_bool_t ok;
-
- conn = dbus_connection_open_private (address, &error);
- assert_no_error (&error);
- g_assert (conn != NULL);
-
- ok = dbus_bus_register (conn, &error);
- assert_no_error (&error);
- g_assert (ok);
- g_assert (dbus_bus_get_unique_name (conn) != NULL);
-
- test_connection_setup (f->ctx, conn);
- return conn;
-}
-
-static DBusHandlerResult
-echo_filter (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- DBusMessage *reply;
-
- if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- reply = dbus_message_new_method_return (message);
-
- if (reply == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send (connection, reply, NULL))
- g_error ("OOM");
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-typedef struct {
- const char *bug_ref;
- guint min_messages;
- const char *config_file;
-} Config;
-
-static void
-setup (Fixture *f,
- gconstpointer context)
-{
- const Config *config = context;
- gchar *dbus_daemon;
- gchar *arg;
- gchar *address;
-
- f->ctx = test_main_context_get ();
- f->ge = NULL;
- dbus_error_init (&f->e);
-
- if (config != NULL && config->config_file != NULL)
- {
- if (g_getenv ("DBUS_TEST_DATA") == NULL)
- {
- g_message ("SKIP: set DBUS_TEST_DATA to a directory containing %s",
- config->config_file);
- f->skip = TRUE;
- return;
- }
-
- arg = g_strdup_printf (
- "--config-file=%s/%s",
- g_getenv ("DBUS_TEST_DATA"), config->config_file);
- }
- else if (g_getenv ("DBUS_TEST_SYSCONFDIR") != NULL)
- {
- arg = g_strdup_printf ("--config-file=%s/dbus-1/session.conf",
- g_getenv ("DBUS_TEST_SYSCONFDIR"));
- }
- else if (g_getenv ("DBUS_TEST_DATA") != NULL)
- {
- arg = g_strdup_printf (
- "--config-file=%s/valid-config-files/session.conf",
- g_getenv ("DBUS_TEST_DATA"));
- }
- else
- {
- arg = g_strdup ("--session");
- }
-
- dbus_daemon = g_strdup (g_getenv ("DBUS_TEST_DAEMON"));
-
- if (dbus_daemon == NULL)
- dbus_daemon = g_strdup ("dbus-daemon");
-
- address = spawn_dbus_daemon (dbus_daemon, arg, &f->daemon_pid);
-
- g_free (dbus_daemon);
- g_free (arg);
-
- f->left_conn = connect_to_bus (f, address);
- f->right_conn = connect_to_bus (f, address);
- g_free (address);
-}
-
-static void
-add_echo_filter (Fixture *f)
-{
- if (!dbus_connection_add_filter (f->right_conn, echo_filter, NULL, NULL))
- g_error ("OOM");
-
- f->right_conn_echo = TRUE;
-}
-
-static void
-pc_count (DBusPendingCall *pc,
- void *data)
-{
- guint *received_p = data;
-
- (*received_p)++;
-}
-
-static void
-test_echo (Fixture *f,
- gconstpointer context)
-{
- const Config *config = context;
- guint count = 2000;
- guint sent;
- guint received = 0;
- double elapsed;
-
- if (f->skip)
- return;
-
- if (config != NULL && config->bug_ref != NULL)
- g_test_bug (config->bug_ref);
-
- if (g_test_perf ())
- count = 100000;
-
- if (config != NULL)
- count = MAX (config->min_messages, count);
-
- add_echo_filter (f);
-
- g_test_timer_start ();
-
- for (sent = 0; sent < count; sent++)
- {
- DBusMessage *m = dbus_message_new_method_call (
- dbus_bus_get_unique_name (f->right_conn), "/",
- "com.example", "Spam");
- DBusPendingCall *pc;
-
- if (m == NULL)
- g_error ("OOM");
-
- if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
- DBUS_TIMEOUT_INFINITE) ||
- pc == NULL)
- g_error ("OOM");
-
- if (dbus_pending_call_get_completed (pc))
- pc_count (pc, &received);
- else if (!dbus_pending_call_set_notify (pc, pc_count, &received,
- NULL))
- g_error ("OOM");
-
- dbus_pending_call_unref (pc);
- dbus_message_unref (m);
- }
-
- while (received < count)
- test_main_context_iterate (f->ctx, TRUE);
-
- elapsed = g_test_timer_elapsed ();
-
- g_test_maximized_result (count / elapsed, "%u messages / %f seconds",
- count, elapsed);
-}
-
-static void
-pending_call_store_reply (DBusPendingCall *pc,
- void *data)
-{
- DBusMessage **message_p = data;
-
- *message_p = dbus_pending_call_steal_reply (pc);
- g_assert (*message_p != NULL);
-}
-
-static void
-test_creds (Fixture *f,
- gconstpointer context)
-{
- const char *unique = dbus_bus_get_unique_name (f->left_conn);
- DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetConnectionCredentials");
- DBusPendingCall *pc;
- DBusMessageIter args_iter;
- DBusMessageIter arr_iter;
- DBusMessageIter pair_iter;
- DBusMessageIter var_iter;
- enum {
- SEEN_UNIX_USER = 1,
- SEEN_PID = 2,
- SEEN_WINDOWS_SID = 4
- } seen = 0;
-
- if (m == NULL)
- g_error ("OOM");
-
- if (!dbus_message_append_args (m,
- DBUS_TYPE_STRING, &unique,
- DBUS_TYPE_INVALID))
- g_error ("OOM");
-
- if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
- DBUS_TIMEOUT_USE_DEFAULT) ||
- pc == NULL)
- g_error ("OOM");
-
- dbus_message_unref (m);
- m = NULL;
-
- if (dbus_pending_call_get_completed (pc))
- pending_call_store_reply (pc, &m);
- else if (!dbus_pending_call_set_notify (pc, pending_call_store_reply,
- &m, NULL))
- g_error ("OOM");
-
- while (m == NULL)
- test_main_context_iterate (f->ctx, TRUE);
-
- g_assert_cmpstr (dbus_message_get_signature (m), ==, "a{sv}");
-
- dbus_message_iter_init (m, &args_iter);
- g_assert_cmpuint (dbus_message_iter_get_arg_type (&args_iter), ==,
- DBUS_TYPE_ARRAY);
- g_assert_cmpuint (dbus_message_iter_get_element_type (&args_iter), ==,
- DBUS_TYPE_DICT_ENTRY);
- dbus_message_iter_recurse (&args_iter, &arr_iter);
-
- while (dbus_message_iter_get_arg_type (&arr_iter) != DBUS_TYPE_INVALID)
- {
- const char *name;
-
- dbus_message_iter_recurse (&arr_iter, &pair_iter);
- g_assert_cmpuint (dbus_message_iter_get_arg_type (&pair_iter), ==,
- DBUS_TYPE_STRING);
- dbus_message_iter_get_basic (&pair_iter, &name);
- dbus_message_iter_next (&pair_iter);
- g_assert_cmpuint (dbus_message_iter_get_arg_type (&pair_iter), ==,
- DBUS_TYPE_VARIANT);
- dbus_message_iter_recurse (&pair_iter, &var_iter);
-
- if (g_strcmp0 (name, "UnixUserID") == 0)
- {
-#ifdef G_OS_UNIX
- guint32 u32;
-
- g_assert (!(seen & SEEN_UNIX_USER));
- g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
- DBUS_TYPE_UINT32);
- dbus_message_iter_get_basic (&var_iter, &u32);
- g_message ("%s of this process is %u", name, u32);
- g_assert_cmpuint (u32, ==, geteuid ());
- seen |= SEEN_UNIX_USER;
-#else
- g_assert_not_reached ();
-#endif
- }
- else if (g_strcmp0 (name, "ProcessID") == 0)
- {
- guint32 u32;
-
- g_assert (!(seen & SEEN_PID));
- g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
- DBUS_TYPE_UINT32);
- dbus_message_iter_get_basic (&var_iter, &u32);
- g_message ("%s of this process is %u", name, u32);
-#ifdef G_OS_UNIX
- g_assert_cmpuint (u32, ==, getpid ());
-#elif defined(G_OS_WIN32)
- g_assert_cmpuint (u32, ==, GetCurrentProcessId ());
-#else
- g_assert_not_reached ();
-#endif
- seen |= SEEN_PID;
- }
-
- dbus_message_iter_next (&arr_iter);
- }
-
-#ifdef G_OS_UNIX
- g_assert (seen & SEEN_UNIX_USER);
- g_assert (seen & SEEN_PID);
-#endif
-
-#ifdef G_OS_WIN32
- /* FIXME: when implemented:
- g_assert (seen & SEEN_WINDOWS_SID);
- */
-#endif
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer context G_GNUC_UNUSED)
-{
- dbus_error_free (&f->e);
- g_clear_error (&f->ge);
-
- if (f->left_conn != NULL)
- {
- dbus_connection_close (f->left_conn);
- dbus_connection_unref (f->left_conn);
- f->left_conn = NULL;
- }
-
- if (f->right_conn != NULL)
- {
- if (f->right_conn_echo)
- {
- dbus_connection_remove_filter (f->right_conn, echo_filter, NULL);
- f->right_conn_echo = FALSE;
- }
-
- dbus_connection_close (f->right_conn);
- dbus_connection_unref (f->right_conn);
- f->right_conn = NULL;
- }
-
- if (f->daemon_pid != 0)
- {
-#ifdef DBUS_WIN
- TerminateProcess (f->daemon_pid, 1);
-#else
- kill (f->daemon_pid, SIGTERM);
-#endif
-
- g_spawn_close_pid (f->daemon_pid);
- f->daemon_pid = 0;
- }
-
- test_main_context_unref (f->ctx);
-}
-
-static Config limited_config = {
- "34393", 10000, "valid-config-files/incoming-limit.conf"
-};
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/echo/session", Fixture, NULL, setup, test_echo, teardown);
- g_test_add ("/echo/limited", Fixture, &limited_config,
- setup, test_echo, teardown);
- g_test_add ("/creds", Fixture, NULL, setup, test_creds, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/dbus-test-runner b/src/3rd_party/dbus-1.7.8/test/dbus-test-runner
deleted file mode 100755
index a3dc39602e..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/dbus-test-runner
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-set -e
-
-dir="$1"
-shift
-
-if ! test -d "$dir"; then
- echo "Usage: dbus-test-runner directory [executable...]"
- exit 0
-fi
-
-passed=0
-failed=0
-skipped=0
-
-for prog in "$@"; do
- e=0
- "$dir/$prog" || e=$?
- case $e in
- (0)
- echo "PASS: $prog"
- passed=`expr $passed + 1`
- ;;
- (77)
- echo "SKIP: $prog"
- skipped=`expr $skipped + 1`
- ;;
- (*)
- echo "FAIL: $prog"
- failed=`expr $failed + 1`
- ;;
- esac
-done
-
-if test $failed = 0; then
- # avoid saying "FAIL", to make it easy to grep results!
- echo "PASSED $passed / SKIPPED $skipped"
- exit 0
-else
- echo "PASSED $passed / FAILED $failed / SKIPPED $skipped"
- exit 1
-fi
diff --git a/src/3rd_party/dbus-1.7.8/test/internals/printf.c b/src/3rd_party/dbus-1.7.8/test/internals/printf.c
deleted file mode 100644
index db1515184d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/internals/printf.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Regression test for _dbus_printf_string_upper_bound
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2013 Intel Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-string.h>
-#include "test-utils.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-static void
-do_test (int minimum,
- const char *format,
- ...)
-{
- va_list ap;
- int result;
-
- va_start (ap, format);
- result = _dbus_printf_string_upper_bound (format, ap);
- va_end (ap);
-
- if (result < minimum)
- {
- fprintf (stderr, "expected at least %d, got %d\n", minimum, result);
- abort ();
- }
-}
-
-#define X_TIMES_8 "XXXXXXXX"
-#define X_TIMES_16 X_TIMES_8 X_TIMES_8
-#define X_TIMES_32 X_TIMES_16 X_TIMES_16
-#define X_TIMES_64 X_TIMES_32 X_TIMES_32
-#define X_TIMES_128 X_TIMES_64 X_TIMES_64
-#define X_TIMES_256 X_TIMES_128 X_TIMES_128
-#define X_TIMES_512 X_TIMES_256 X_TIMES_256
-#define X_TIMES_1024 X_TIMES_512 X_TIMES_512
-
-int
-main (int argc,
- char **argv)
-{
- char buf[] = X_TIMES_1024 X_TIMES_1024 X_TIMES_1024 X_TIMES_1024;
- int i;
-
- do_test (1, "%d", 0);
- do_test (7, "%d", 1234567);
- do_test (3, "%f", 3.5);
-
- do_test (0, "%s", "");
- do_test (1024, "%s", X_TIMES_1024);
- do_test (1025, "%s", X_TIMES_1024 "Y");
-
- for (i = 4096; i > 0; i--)
- {
- buf[i] = '\0';
- do_test (i, "%s", buf);
- do_test (i + 3, "%s:%d", buf, 42);
- }
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/internals/refs.c b/src/3rd_party/dbus-1.7.8/test/internals/refs.c
deleted file mode 100644
index 202dc04320..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/internals/refs.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/* Regression test for thread-safe reference-counting
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-connection-internal.h>
-#include <dbus/dbus-mainloop.h>
-#include <dbus/dbus-message-internal.h>
-#include <dbus/dbus-pending-call-internal.h>
-#include <dbus/dbus-server-protected.h>
-#include "test-utils.h"
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-#define N_THREADS 200
-#define N_REFS 10000
-G_STATIC_ASSERT (((unsigned) N_THREADS * (unsigned) N_REFS) < G_MAXINT32);
-
-static dbus_int32_t connection_slot = -1;
-static dbus_int32_t server_slot = -1;
-static dbus_int32_t message_slot = -1;
-static dbus_int32_t pending_call_slot = -1;
-
-typedef struct {
- DBusError e;
- DBusLoop *loop;
- DBusServer *server;
- DBusConnection *connection;
- DBusConnection *server_connection;
- DBusMessage *message;
- GThread *threads[N_THREADS];
- gboolean last_unref;
-} Fixture;
-
-typedef void *(*RefFunc) (void *);
-typedef void (*VoidFunc) (void *);
-
-typedef struct {
- void *thing;
- RefFunc ref;
- VoidFunc ref_void;
- VoidFunc unref;
- void *mutex;
- VoidFunc lock;
- VoidFunc unlock;
-} Thread;
-
-/* provide backwards compatibility shim when building with a glib <= 2.30.x */
-#if !GLIB_CHECK_VERSION(2,31,0)
-#define g_thread_new(name,func,data) g_thread_create(func,data,TRUE,NULL)
-#endif
-
-static gpointer
-ref_thread (gpointer data)
-{
- Thread *thread = data;
- int i;
-
- for (i = 0; i < N_REFS; i++)
- {
- if (thread->lock != NULL)
- (thread->lock) (thread->mutex);
-
- if (thread->ref != NULL)
- {
- gpointer ret = (thread->ref) (thread->thing);
-
- g_assert (ret == thread->thing);
- }
- else
- {
- (thread->ref_void) (thread->thing);
- }
-
- if (thread->unlock != NULL)
- (thread->unlock) (thread->mutex);
- }
-
- return NULL;
-}
-
-static gpointer
-cycle_thread (gpointer data)
-{
- Thread *thread = data;
- int i;
-
- for (i = 0; i < N_REFS; i++)
- {
- if (thread->lock != NULL)
- (thread->lock) (thread->mutex);
-
- if (thread->ref != NULL)
- {
- gpointer ret = (thread->ref) (thread->thing);
-
- g_assert (ret == thread->thing);
- }
- else
- {
- (thread->ref_void) (thread->thing);
- }
-
- (thread->unref) (thread->thing);
-
- if (thread->unlock != NULL)
- (thread->unlock) (thread->mutex);
- }
-
- return NULL;
-}
-
-static gpointer
-unref_thread (gpointer data)
-{
- Thread *thread = data;
- int i;
-
- for (i = 0; i < N_REFS; i++)
- {
- if (thread->lock != NULL)
- (thread->lock) (thread->mutex);
-
- (thread->unref) (thread->thing);
-
- if (thread->unlock != NULL)
- (thread->unlock) (thread->mutex);
- }
-
- return NULL;
-}
-
-static void
-last_unref (void *data)
-{
- Fixture *f = data;
-
- g_assert (!f->last_unref);
- f->last_unref = TRUE;
-}
-
-static void
-wait_for_all_threads (Fixture *f)
-{
- int i;
-
- for (i = 0; i < N_THREADS; i++)
- g_thread_join (f->threads[i]);
-}
-
-static void
-new_conn_cb (DBusServer *server,
- DBusConnection *server_connection,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (f->server_connection == NULL);
- f->server_connection = dbus_connection_ref (server_connection);
-
- test_connection_setup (f->loop, f->server_connection);
-}
-
-static void
-setup (Fixture *f,
- gconstpointer data)
-{
- if (!dbus_threads_init_default ())
- g_error ("OOM");
-
- f->loop = _dbus_loop_new ();
- g_assert (f->loop != NULL);
-
- dbus_error_init (&f->e);
-
- f->server = dbus_server_listen ("tcp:host=127.0.0.1", &f->e);
- assert_no_error (&f->e);
- g_assert (f->server != NULL);
-
- if (!dbus_connection_allocate_data_slot (&connection_slot))
- g_error ("OOM");
-
- if (!dbus_server_allocate_data_slot (&server_slot))
- g_error ("OOM");
-
- if (!dbus_message_allocate_data_slot (&message_slot))
- g_error ("OOM");
-
- if (!dbus_pending_call_allocate_data_slot (&pending_call_slot))
- g_error ("OOM");
-}
-
-static void
-setup_connection (Fixture *f,
- gconstpointer data)
-{
- char *address;
-
- setup (f, data);
-
- dbus_server_set_new_connection_function (f->server,
- new_conn_cb, f, NULL);
-
- if (!test_server_setup (f->loop, f->server))
- g_error ("failed to set up server");
-
- address = dbus_server_get_address (f->server);
- g_assert (address != NULL);
- f->connection = dbus_connection_open_private (address, &f->e);
- assert_no_error (&f->e);
- g_assert (f->connection != NULL);
- dbus_free (address);
-
- if (!test_connection_setup (f->loop, f->connection))
- g_error ("failed to set up connection");
-
- while (f->server_connection == NULL)
- _dbus_loop_iterate (f->loop, TRUE);
-
- test_connection_shutdown (f->loop, f->connection);
- test_server_shutdown (f->loop, f->server);
-}
-
-static void
-test_connection (Fixture *f,
- gconstpointer data)
-{
- Thread public_api = { f->connection,
- (RefFunc) dbus_connection_ref,
- NULL,
- (VoidFunc) dbus_connection_unref,
- NULL,
- NULL,
- NULL };
- Thread internal_api = { f->connection,
- (RefFunc) _dbus_connection_ref_unlocked,
- NULL,
- (VoidFunc) _dbus_connection_unref_unlocked,
- f->connection,
- (VoidFunc) _dbus_connection_lock,
- (VoidFunc) _dbus_connection_unlock };
- int i;
-
- /* Use a slot as a pseudo-weakref */
- if (!dbus_connection_set_data (f->connection, connection_slot, f,
- last_unref))
- g_error ("OOM");
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, ref_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, ref_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, cycle_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, cycle_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, unref_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, unref_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- /* Destroy the connection. This should be the last-unref. */
- g_assert (!f->last_unref);
- dbus_connection_close (f->connection);
- dbus_connection_unref (f->connection);
- f->connection = NULL;
- g_assert (f->last_unref);
-}
-
-static void
-server_lock (void *server)
-{
- SERVER_LOCK (((DBusServer *) server));
-}
-
-static void
-server_unlock (void *server)
-{
- SERVER_UNLOCK (((DBusServer *) server));
-}
-
-static void
-test_server (Fixture *f,
- gconstpointer data)
-{
- Thread public_api = { f->server,
- (RefFunc) dbus_server_ref,
- NULL,
- (VoidFunc) dbus_server_unref,
- NULL,
- NULL,
- NULL };
- Thread internal_api = { f->server,
- NULL,
- (VoidFunc) _dbus_server_ref_unlocked,
- (VoidFunc) _dbus_server_unref_unlocked,
- f->server,
- server_lock,
- server_unlock };
- int i;
-
- if (!dbus_server_set_data (f->server, server_slot, f, last_unref))
- g_error ("OOM");
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, ref_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, ref_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, cycle_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, cycle_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, unref_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, unref_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- /* Destroy the server. This should be the last-unref. */
- g_assert (!f->last_unref);
- dbus_server_disconnect (f->server);
- dbus_server_unref (f->server);
- f->server = NULL;
- g_assert (f->last_unref);
-}
-
-static void
-test_message (Fixture *f,
- gconstpointer data)
-{
- DBusMessage *message = dbus_message_new_signal ("/foo", "foo.bar.baz",
- "Foo");
- Thread public_api = { message,
- (RefFunc) dbus_message_ref,
- NULL,
- (VoidFunc) dbus_message_unref,
- NULL,
- NULL,
- NULL };
- int i;
-
- if (!dbus_message_set_data (message, message_slot, f, last_unref))
- g_error ("OOM");
-
- for (i = 0; i < N_THREADS; i++)
- {
- f->threads[i] = g_thread_new (NULL, ref_thread, &public_api);
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- f->threads[i] = g_thread_new (NULL, cycle_thread, &public_api);
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- f->threads[i] = g_thread_new (NULL, unref_thread, &public_api);
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- /* Destroy the server. This should be the last-unref. */
- g_assert (!f->last_unref);
- dbus_message_unref (message);
- g_assert (f->last_unref);
-}
-
-static void
-test_pending_call (Fixture *f,
- gconstpointer data)
-{
- Thread public_api = { NULL,
- (RefFunc) dbus_pending_call_ref,
- NULL,
- (VoidFunc) dbus_pending_call_unref,
- NULL,
- NULL,
- NULL };
- Thread internal_api = { NULL,
- (RefFunc) _dbus_pending_call_ref_unlocked,
- NULL,
- (VoidFunc) dbus_pending_call_unref,
- f->connection,
- (VoidFunc) _dbus_connection_lock,
- (VoidFunc) _dbus_connection_unlock };
- /* This one can't be used to ref, only to cycle or unref. */
- Thread unref_and_unlock_api = { NULL,
- (RefFunc) _dbus_pending_call_ref_unlocked,
- NULL,
- (VoidFunc) _dbus_pending_call_unref_and_unlock,
- f->connection,
- (VoidFunc) _dbus_connection_lock,
- NULL };
- int i;
- DBusPendingCall *pending_call;
-
- _dbus_connection_lock (f->connection);
- pending_call = _dbus_pending_call_new_unlocked (f->connection,
- DBUS_TIMEOUT_INFINITE, NULL);
- g_assert (pending_call != NULL);
- _dbus_connection_unlock (f->connection);
-
- public_api.thing = pending_call;
- internal_api.thing = pending_call;
- unref_and_unlock_api.thing = pending_call;
-
- if (!dbus_pending_call_set_data (pending_call, pending_call_slot, f,
- last_unref))
- g_error ("OOM");
-
- for (i = 0; i < N_THREADS; i++)
- {
- if ((i % 2) == 0)
- f->threads[i] = g_thread_new (NULL, ref_thread, &public_api);
- else
- f->threads[i] = g_thread_new (NULL, ref_thread, &internal_api);
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- switch (i % 3)
- {
- case 0:
- f->threads[i] = g_thread_new (NULL, cycle_thread, &public_api);
- break;
- case 1:
- f->threads[i] = g_thread_new (NULL, cycle_thread, &internal_api);
- break;
- default:
- f->threads[i] = g_thread_new (NULL, cycle_thread,
- &unref_and_unlock_api);
- }
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- for (i = 0; i < N_THREADS; i++)
- {
- switch (i % 3)
- {
- case 0:
- f->threads[i] = g_thread_new (NULL, unref_thread, &public_api);
- break;
- case 1:
- f->threads[i] = g_thread_new (NULL, unref_thread, &internal_api);
- break;
- default:
- f->threads[i] = g_thread_new (NULL, unref_thread,
- &unref_and_unlock_api);
- }
-
- g_assert (f->threads[i] != NULL);
- }
-
- wait_for_all_threads (f);
-
- /* Destroy the pending call. This should be the last-unref. */
- g_assert (!f->last_unref);
- dbus_pending_call_unref (pending_call);
- g_assert (f->last_unref);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer data)
-{
- if (f->server_connection != NULL)
- {
- dbus_connection_close (f->server_connection);
- dbus_connection_unref (f->server_connection);
- }
-
- if (f->connection != NULL)
- {
- dbus_connection_close (f->connection);
- dbus_connection_unref (f->connection);
- }
-
- if (f->server != NULL)
- {
- dbus_server_disconnect (f->server);
- dbus_server_unref (f->server);
- }
-
- dbus_connection_free_data_slot (&connection_slot);
- dbus_server_free_data_slot (&server_slot);
- dbus_message_free_data_slot (&message_slot);
- dbus_pending_call_free_data_slot (&pending_call_slot);
-
- _dbus_loop_unref (f->loop);
- dbus_error_free (&f->e);
-}
-
-int
-main (int argc,
- char **argv)
-{
- /* In GLib >= 2.24, < 2.31 this acts like g_thread_init() but avoids
- * the deprecation of that function. In GLib >= 2.32 this is not
- * necessary at all.
- */
- g_type_init ();
-
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/refs/connection", Fixture, NULL, setup_connection,
- test_connection, teardown);
- g_test_add ("/refs/message", Fixture, NULL, setup,
- test_message, teardown);
- g_test_add ("/refs/pending-call", Fixture, NULL, setup_connection,
- test_pending_call, teardown);
- g_test_add ("/refs/server", Fixture, NULL, setup,
- test_server, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/internals/syslog.c b/src/3rd_party/dbus-1.7.8/test/internals/syslog.c
deleted file mode 100644
index 2811b75742..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/internals/syslog.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Manual regression test for syslog support
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-sysdeps.h>
-
-typedef struct {
- int dummy;
-} Fixture;
-
-static void
-setup (Fixture *f,
- gconstpointer data)
-{
-}
-
-/* hopefully clear enough that people don't think these messages in syslog
- * are a bug */
-#define MESSAGE "regression test for _dbus_system_log(): "
-
-static void
-test_syslog (Fixture *f,
- gconstpointer data)
-{
- if (g_test_trap_fork (0, 0))
- {
- _dbus_init_system_log (FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_FATAL, MESSAGE "%d", 23);
- /* should not be reached: exit 0 so the assertion in the main process
- * will fail */
- exit (0);
- }
-
- g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*" MESSAGE "23\n*");
-
- if (g_test_trap_fork (0, 0))
- {
- _dbus_init_system_log (FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
- _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
- exit (0);
- }
-
- g_test_trap_assert_passed ();
- g_test_trap_assert_stderr ("*" MESSAGE "42\n*" MESSAGE "666\n*");
-
- /* manual test (this is the best we can do on Windows) */
- _dbus_init_system_log (FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
- _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer data)
-{
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/syslog", Fixture, NULL, setup, test_syslog, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/loopback.c b/src/3rd_party/dbus-1.7.8/test/loopback.c
deleted file mode 100644
index 7526d8d251..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/loopback.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/* Simple sanity-check for loopback through TCP and Unix sockets.
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2012 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-#include <string.h>
-
-#include "test-utils.h"
-
-typedef struct {
- TestMainContext *ctx;
- DBusError e;
-
- DBusServer *server;
- DBusConnection *server_conn;
- /* queue of DBusMessage */
- GQueue server_messages;
-
- DBusConnection *client_conn;
-} Fixture;
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-static DBusHandlerResult
-server_message_cb (DBusConnection *server_conn,
- DBusMessage *message,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (server_conn == f->server_conn);
- g_queue_push_tail (&f->server_messages, dbus_message_ref (message));
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void
-new_conn_cb (DBusServer *server,
- DBusConnection *server_conn,
- void *data)
-{
- Fixture *f = data;
- dbus_bool_t have_mem;
-
- g_assert (f->server_conn == NULL);
- f->server_conn = dbus_connection_ref (server_conn);
- test_connection_setup (f->ctx, server_conn);
-
- have_mem = dbus_connection_add_filter (server_conn,
- server_message_cb, f, NULL);
- g_assert (have_mem);
-}
-
-static void
-setup (Fixture *f,
- gconstpointer addr)
-{
- f->ctx = test_main_context_get ();
- dbus_error_init (&f->e);
- g_queue_init (&f->server_messages);
-
- f->server = dbus_server_listen (addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->server != NULL);
-
- dbus_server_set_new_connection_function (f->server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->server);
-}
-
-static void
-test_connect (Fixture *f,
- gconstpointer addr G_GNUC_UNUSED)
-{
- g_assert (f->server_conn == NULL);
-
- f->client_conn = dbus_connection_open_private (
- dbus_server_get_address (f->server), &f->e);
- assert_no_error (&f->e);
- g_assert (f->client_conn != NULL);
- test_connection_setup (f->ctx, f->client_conn);
-
- while (f->server_conn == NULL)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-}
-
-static void
-test_bad_guid (Fixture *f,
- gconstpointer addr G_GNUC_UNUSED)
-{
- DBusMessage *incoming;
- gchar *address = g_strdup (dbus_server_get_address (f->server));
- gchar *guid;
-
- g_test_bug ("39720");
-
- g_assert (f->server_conn == NULL);
-
- g_assert (strstr (address, "guid=") != NULL);
- guid = strstr (address, "guid=");
- g_assert_cmpuint (strlen (guid), >=, 5 + 32);
-
- /* Change the first char of the guid to something different */
- if (guid[5] == '0')
- guid[5] = 'f';
- else
- guid[5] = '0';
-
- f->client_conn = dbus_connection_open_private (address, &f->e);
- assert_no_error (&f->e);
- g_assert (f->client_conn != NULL);
- test_connection_setup (f->ctx, f->client_conn);
-
- while (f->server_conn == NULL)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- /* We get disconnected */
-
- while (g_queue_is_empty (&f->server_messages))
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- g_assert_cmpuint (g_queue_get_length (&f->server_messages), ==, 1);
-
- incoming = g_queue_pop_head (&f->server_messages);
-
- g_assert (!dbus_message_contains_unix_fds (incoming));
- g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
- DBUS_INTERFACE_LOCAL);
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Disconnected");
- g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
- g_assert_cmpstr (dbus_message_get_path (incoming), ==, DBUS_PATH_LOCAL);
-
- dbus_message_unref (incoming);
-
- g_free (address);
-}
-
-static void
-test_message (Fixture *f,
- gconstpointer addr)
-{
- dbus_bool_t have_mem;
- dbus_uint32_t serial;
- DBusMessage *outgoing, *incoming;
-
- test_connect (f, addr);
-
- outgoing = dbus_message_new_signal ("/com/example/Hello",
- "com.example.Hello", "Greeting");
- g_assert (outgoing != NULL);
-
- have_mem = dbus_connection_send (f->client_conn, outgoing, &serial);
- g_assert (have_mem);
- g_assert (serial != 0);
-
- while (g_queue_is_empty (&f->server_messages))
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- g_assert_cmpuint (g_queue_get_length (&f->server_messages), ==, 1);
-
- incoming = g_queue_pop_head (&f->server_messages);
-
- g_assert (!dbus_message_contains_unix_fds (incoming));
- g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
- "com.example.Hello");
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Greeting");
- g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
- g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
- g_assert_cmpstr (dbus_message_get_path (incoming), ==, "/com/example/Hello");
- g_assert_cmpuint (dbus_message_get_serial (incoming), ==, serial);
-
- dbus_message_unref (incoming);
-
- dbus_message_unref (outgoing);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer addr G_GNUC_UNUSED)
-{
- if (f->client_conn != NULL)
- {
- dbus_connection_close (f->client_conn);
- dbus_connection_unref (f->client_conn);
- f->client_conn = NULL;
- }
-
- if (f->server_conn != NULL)
- {
- dbus_connection_close (f->server_conn);
- dbus_connection_unref (f->server_conn);
- f->server_conn = NULL;
- }
-
- if (f->server != NULL)
- {
- dbus_server_disconnect (f->server);
- dbus_server_unref (f->server);
- f->server = NULL;
- }
-
- test_main_context_unref (f->ctx);
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/connect/tcp", Fixture, "tcp:host=127.0.0.1", setup,
- test_connect, teardown);
- g_test_add ("/message/tcp", Fixture, "tcp:host=127.0.0.1", setup,
- test_message, teardown);
-
- g_test_add ("/connect/nonce-tcp", Fixture, "nonce-tcp:host=127.0.0.1", setup,
- test_connect, teardown);
- g_test_add ("/message/nonce-tcp", Fixture, "nonce-tcp:host=127.0.0.1", setup,
- test_message, teardown);
-
-#ifdef DBUS_UNIX
- g_test_add ("/connect/unix", Fixture, "unix:tmpdir=/tmp", setup,
- test_connect, teardown);
- g_test_add ("/message/unix", Fixture, "unix:tmpdir=/tmp", setup,
- test_message, teardown);
-#endif
-
- g_test_add ("/message/bad-guid", Fixture, "tcp:host=127.0.0.1", setup,
- test_bad_guid, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/manual-authz.c b/src/3rd_party/dbus-1.7.8/test/manual-authz.c
deleted file mode 100644
index f9e3688e12..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/manual-authz.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/* Simple sanity-check for authentication and authorization.
- *
- * Copyright © 2010-2011 Nokia Corporation
- * Copyright © 2012 Collabora Ltd.
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-#ifdef G_OS_UNIX
-#include <unistd.h>
-#include <sys/types.h>
-#endif
-
-#include "test-utils.h"
-
-typedef struct {
- DBusError e;
- TestMainContext *ctx;
-
- DBusServer *normal_server;
- DBusServer *anon_allowed_server;
- DBusServer *anon_only_server;
- DBusServer *anon_mech_only_server;
- DBusServer *anon_disallowed_server;
- DBusServer *permissive_server;
- DBusServer *unhappy_server;
- DBusServer *same_uid_server;
- DBusServer *same_uid_or_anon_server;
-} Fixture;
-
-static void oom (void) G_GNUC_NORETURN;
-static void
-oom (void)
-{
- g_error ("out of memory");
-}
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-static DBusHandlerResult
-server_message_cb (DBusConnection *conn,
- DBusMessage *message,
- void *data)
-{
- if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected"))
- {
- dbus_connection_unref (conn);
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
- {
- DBusMessage *reply = dbus_message_new_method_return (message);
- const char *hello = "Hello, world!";
- unsigned long uid;
- char *sid;
-
- if (dbus_connection_get_unix_user (conn, &uid))
- {
- g_message ("message from uid %lu", uid);
- }
- else if (dbus_connection_get_windows_user (conn, &sid))
- {
- if (sid == NULL)
- oom ();
-
- g_message ("message from sid \"%s\"", sid);
- dbus_free (sid);
- }
- else if (dbus_connection_get_is_anonymous (conn))
- {
- g_message ("message from Anonymous");
- }
- else
- {
- g_message ("message from ... someone?");
- }
-
- if (reply == NULL)
- oom ();
-
- if (!dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &hello,
- DBUS_TYPE_INVALID))
- oom ();
-
- if (!dbus_connection_send (conn, reply, NULL))
- oom ();
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static dbus_bool_t
-permissive_unix_func (DBusConnection *conn,
- unsigned long uid,
- void *data)
-{
- g_message ("accepting Unix user %lu", uid);
- return TRUE;
-}
-
-static dbus_bool_t
-permissive_win_func (DBusConnection *conn,
- const char *sid,
- void *data)
-{
- g_message ("accepting Windows user \"%s\"", sid);
- return TRUE;
-}
-
-static dbus_bool_t
-broken_unix_func (DBusConnection *conn,
- unsigned long uid,
- void *data)
-{
- g_error ("libdbus called the Unix user function for an ANONYMOUS-only "
- "connection");
- return FALSE;
-}
-
-static dbus_bool_t
-broken_win_func (DBusConnection *conn,
- const char *sid,
- void *data)
-{
- g_error ("libdbus called the Windows user function for an ANONYMOUS-only "
- "connection");
- return FALSE;
-}
-
-static dbus_bool_t
-unhappy_unix_func (DBusConnection *conn,
- unsigned long uid,
- void *data)
-{
- g_message ("rejecting Unix user %lu", uid);
- return FALSE;
-}
-
-static dbus_bool_t
-unhappy_win_func (DBusConnection *conn,
- const char *sid,
- void *data)
-{
- g_message ("rejecting Windows user \"%s\"", sid);
- return FALSE;
-}
-
-static dbus_bool_t
-same_uid_unix_func (DBusConnection *conn,
- unsigned long uid,
- void *data)
-{
- g_message ("checking whether Unix user %lu owns this process", uid);
- /* I'd use _dbus_unix_user_is_process_owner(), but it's private... */
-#ifdef G_OS_UNIX
- return (geteuid () == uid);
-#else
- return FALSE;
-#endif
-}
-
-static dbus_bool_t
-same_uid_win_func (DBusConnection *conn,
- const char *sid,
- void *data)
-{
- g_message ("checking whether Windows user \"%s\" owns this process", sid);
- g_message ("Stub implementation consistent with dbus-sysdeps-util-win: "
- "assume they do");
- return TRUE;
-}
-
-static void
-new_conn_cb (DBusServer *server,
- DBusConnection *conn,
- void *data)
-{
- Fixture *f = data;
-
- dbus_connection_ref (conn);
- test_connection_setup (f->ctx, conn);
-
- if (!dbus_connection_add_filter (conn, server_message_cb, f, NULL))
- oom ();
-
- if (server == f->normal_server)
- {
- }
- else if (server == f->anon_allowed_server)
- {
- dbus_connection_set_allow_anonymous (conn, TRUE);
- }
- else if (server == f->anon_only_server)
- {
- dbus_connection_set_allow_anonymous (conn, TRUE);
-
- dbus_connection_set_unix_user_function (conn, unhappy_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, unhappy_win_func,
- f, NULL);
- }
- else if (server == f->anon_mech_only_server)
- {
- dbus_connection_set_allow_anonymous (conn, TRUE);
-
- /* should never get called */
- dbus_connection_set_unix_user_function (conn, broken_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, broken_win_func,
- f, NULL);
- }
- else if (server == f->anon_disallowed_server)
- {
- dbus_connection_set_allow_anonymous (conn, FALSE);
-
- /* should never get called */
- dbus_connection_set_unix_user_function (conn, broken_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, broken_win_func,
- f, NULL);
- }
- else if (server == f->permissive_server)
- {
- dbus_connection_set_unix_user_function (conn, permissive_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, permissive_win_func,
- f, NULL);
- }
- else if (server == f->unhappy_server)
- {
- dbus_connection_set_unix_user_function (conn, unhappy_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, unhappy_win_func,
- f, NULL);
- }
- else if (server == f->same_uid_server)
- {
- dbus_connection_set_unix_user_function (conn, same_uid_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, same_uid_win_func,
- f, NULL);
- }
- else if (server == f->same_uid_or_anon_server)
- {
- dbus_connection_set_allow_anonymous (conn, TRUE);
-
- dbus_connection_set_unix_user_function (conn, same_uid_unix_func,
- f, NULL);
- dbus_connection_set_windows_user_function (conn, same_uid_win_func,
- f, NULL);
- }
- else
- {
- g_assert_not_reached ();
- }
-}
-
-static void
-setup (Fixture *f,
- const gchar *listen_addr)
-{
- const char *only_anon[] = { "ANONYMOUS", NULL };
- char *connect_addr;
-
- f->normal_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->normal_server != NULL);
- dbus_server_set_new_connection_function (f->normal_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->normal_server);
- connect_addr = dbus_server_get_address (f->normal_server);
- g_message ("Normal server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->anon_allowed_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->anon_allowed_server != NULL);
- dbus_server_set_new_connection_function (f->anon_allowed_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->anon_allowed_server);
- connect_addr = dbus_server_get_address (f->anon_allowed_server);
- g_message ("Anonymous-allowed server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->anon_only_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->anon_only_server != NULL);
- dbus_server_set_new_connection_function (f->anon_only_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->anon_only_server);
- connect_addr = dbus_server_get_address (f->anon_only_server);
- g_message ("Anonymous-only server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->anon_mech_only_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->anon_mech_only_server != NULL);
- dbus_server_set_auth_mechanisms (f->anon_mech_only_server, only_anon);
- dbus_server_set_new_connection_function (f->anon_mech_only_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->anon_mech_only_server);
- connect_addr = dbus_server_get_address (f->anon_mech_only_server);
- g_message ("Anon mech only server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->anon_disallowed_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->anon_disallowed_server != NULL);
- dbus_server_set_auth_mechanisms (f->anon_disallowed_server, only_anon);
- dbus_server_set_new_connection_function (f->anon_disallowed_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->anon_disallowed_server);
- connect_addr = dbus_server_get_address (f->anon_disallowed_server);
- g_message ("Anonymous-disallowed server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->permissive_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->permissive_server != NULL);
- dbus_server_set_new_connection_function (f->permissive_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->permissive_server);
- connect_addr = dbus_server_get_address (f->permissive_server);
- g_message ("Permissive server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->unhappy_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->unhappy_server != NULL);
- dbus_server_set_new_connection_function (f->unhappy_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->unhappy_server);
- connect_addr = dbus_server_get_address (f->unhappy_server);
- g_message ("Unhappy server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->same_uid_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->same_uid_server != NULL);
- dbus_server_set_new_connection_function (f->same_uid_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->same_uid_server);
- connect_addr = dbus_server_get_address (f->same_uid_server);
- g_message ("Same-UID server:\n%s", connect_addr);
- dbus_free (connect_addr);
-
- f->same_uid_or_anon_server = dbus_server_listen (listen_addr, &f->e);
- assert_no_error (&f->e);
- g_assert (f->same_uid_or_anon_server != NULL);
- dbus_server_set_new_connection_function (f->same_uid_or_anon_server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->same_uid_or_anon_server);
- connect_addr = dbus_server_get_address (f->same_uid_or_anon_server);
- g_message ("Same-UID-or-anon server:\n%s", connect_addr);
- dbus_free (connect_addr);
-}
-
-int
-main (int argc,
- char **argv)
-{
- Fixture f = { DBUS_ERROR_INIT, test_main_context_get () };
-
- if (argc >= 2)
- setup (&f, argv[1]);
- else
- setup (&f, "tcp:host=127.0.0.1");
-
- for (;;)
- test_main_context_iterate (f.ctx, TRUE);
-
- /* never returns */
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/marshal.c b/src/3rd_party/dbus-1.7.8/test/marshal.c
deleted file mode 100644
index d74e7671e9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/marshal.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* Simple sanity-check for D-Bus message serialization.
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <string.h>
-
-#include <dbus/dbus.h>
-
-typedef struct {
- DBusError e;
-} Fixture;
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-static void
-setup (Fixture *f,
- gconstpointer arg G_GNUC_UNUSED)
-{
- dbus_error_init (&f->e);
-}
-
-/* this is meant to be obviously correct, not efficient! */
-static guint32
-get_uint32 (const gchar *blob,
- gsize offset,
- char endian)
-{
- if (endian == 'l')
- {
- return
- blob[offset] |
- (blob[offset + 1] << 8) |
- (blob[offset + 2] << 16) |
- (blob[offset + 3] << 24);
- }
- else if (endian == 'B')
- {
- return
- (blob[offset] << 24) |
- (blob[offset + 1] << 16) |
- (blob[offset + 2] << 8) |
- blob[offset + 3];
- }
- else
- {
- g_assert_not_reached ();
- }
-}
-
-#define BLOB_LENGTH (sizeof (le_blob) - 1)
-#define OFFSET_BODY_LENGTH (4)
-#define OFFSET_SERIAL (8)
-
-const gchar le_blob[] =
- /* byte 0 */
- /* yyyyuu fixed headers */
- "l" /* little-endian */
- "\2" /* reply (which is the simplest message) */
- "\2" /* no auto-starting */
- "\1" /* D-Bus version = 1 */
- /* byte 4 */
- "\4\0\0\0" /* bytes in body = 4 */
- /* byte 8 */
- "\x78\x56\x34\x12" /* serial number = 0x12345678 */
- /* byte 12 */
- /* a(uv) variable headers start here */
- "\x0f\0\0\0" /* bytes in array of variable headers = 15 */
- /* pad to 8-byte boundary = nothing */
- /* byte 16 */
- "\5" /* in reply to: */
- "\1u\0" /* variant signature = u */
- /* pad to 4-byte boundary = nothing */
- "\x12\xef\xcd\xab" /* 0xabcdef12 */
- /* pad to 8-byte boundary = nothing */
- /* byte 24 */
- "\x08" /* signature: */
- "\1g\0" /* variant signature = g */
- "\1u\0" /* 1 byte, u, NUL (no alignment needed) */
- "\0" /* pad to 8-byte boundary for body */
- /* body; byte 32 */
- "\xef\xbe\xad\xde" /* 0xdeadbeef */
- ;
-
-const gchar be_blob[] =
- /* byte 0 */
- /* yyyyuu fixed headers */
- "B" /* big-endian */
- "\2" /* reply (which is the simplest message) */
- "\2" /* no auto-starting */
- "\1" /* D-Bus version = 1 */
- /* byte 4 */
- "\0\0\0\4" /* bytes in body = 4 */
- /* byte 8 */
- "\x12\x34\x56\x78" /* serial number = 0x12345678 */
- /* byte 12 */
- /* a(uv) variable headers start here */
- "\0\0\0\x0f" /* bytes in array of variable headers = 15 */
- /* pad to 8-byte boundary = nothing */
- /* byte 16 */
- "\5" /* in reply to: */
- "\1u\0" /* variant signature = u */
- /* pad to 4-byte boundary = nothing */
- "\xab\xcd\xef\x12" /* 0xabcdef12 */
- /* pad to 8-byte boundary = nothing */
- /* byte 24 */
- "\x08" /* signature: */
- "\1g\0" /* variant signature = g */
- "\1u\0" /* 1 byte, u, NUL (no alignment needed) */
- "\0" /* pad to 8-byte boundary for body */
- /* body; byte 32 */
- "\xde\xad\xbe\xef" /* 0xdeadbeef */
- ;
-
-static void
-test_endian (Fixture *f,
- gconstpointer arg)
-{
- const gchar *blob = arg;
- char *output;
- DBusMessage *m;
- int len;
- dbus_uint32_t u;
- dbus_bool_t ok;
-
- g_assert_cmpuint ((guint) sizeof (le_blob), ==, (guint) sizeof (be_blob));
-
- g_assert_cmpuint (get_uint32 (blob, OFFSET_BODY_LENGTH, blob[0]), ==, 4);
- g_assert_cmpuint (get_uint32 (blob, OFFSET_SERIAL, blob[0]), ==,
- 0x12345678u);
-
- len = dbus_message_demarshal_bytes_needed (blob, sizeof (le_blob));
- /* everything in the string except the implicit "\0" at the end is part of
- * the message */
- g_assert_cmpint (len, ==, BLOB_LENGTH);
-
- m = dbus_message_demarshal (blob, sizeof (le_blob), &f->e);
- assert_no_error (&f->e);
- g_assert (m != NULL);
-
- g_assert_cmpuint (dbus_message_get_serial (m), ==, 0x12345678u);
- g_assert_cmpuint (dbus_message_get_reply_serial (m), ==, 0xabcdef12u);
- g_assert_cmpstr (dbus_message_get_signature (m), ==, "u");
-
- /* Implementation detail: appending to the message results in it being
- * byteswapped into compiler byte order, which exposed a bug in libdbus,
- * fd.o #38120. (If that changes, this test might not exercise that
- * particular bug but will still be valid.) */
- u = 0xdecafbadu;
- ok = dbus_message_append_args (m,
- DBUS_TYPE_UINT32, &u,
- DBUS_TYPE_INVALID);
- g_assert (ok);
-
- dbus_message_marshal (m, &output, &len);
-
- g_assert (output[0] == 'l' || output[0] == 'B');
- /* the single-byte fields are unaffected, even if the endianness was
- * swapped */
- g_assert_cmpint (output[1], ==, blob[1]);
- g_assert_cmpint (output[2], ==, blob[2]);
- g_assert_cmpint (output[3], ==, blob[3]);
- /* the length and serial are in the new endianness, the length has expanded
- * to 8, and the serial is correct */
- g_assert_cmpuint (get_uint32 (output, OFFSET_BODY_LENGTH, output[0]), ==, 8);
- g_assert_cmpuint (get_uint32 (output, OFFSET_SERIAL, output[0]), ==,
- 0x12345678u);
- /* the second "u" in the signature replaced a padding byte, so only
- * the length of the body changed */
- g_assert_cmpint (len, ==, BLOB_LENGTH + 4);
-}
-
-static void
-test_needed (Fixture *f,
- gconstpointer arg)
-{
- const gchar *blob = arg;
-
- /* We need at least 16 bytes to know how long the message is - that's just
- * a fact of the D-Bus protocol. */
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 0), ==, 0);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 15), ==, 0);
- /* This is enough that we should be able to tell how much we need. */
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 16), ==, BLOB_LENGTH);
- /* The header is 32 bytes long (here), so that's another interesting
- * boundary. */
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 31), ==, BLOB_LENGTH);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 32), ==, BLOB_LENGTH);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, 33), ==, BLOB_LENGTH);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, BLOB_LENGTH - 1), ==,
- BLOB_LENGTH);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, BLOB_LENGTH), ==,
- BLOB_LENGTH);
- g_assert_cmpint (
- dbus_message_demarshal_bytes_needed (blob, sizeof (be_blob)), ==,
- BLOB_LENGTH);
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer arg G_GNUC_UNUSED)
-{
- dbus_error_free (&f->e);
-}
-
-int
-main (int argc,
- char **argv)
-{
- int ret;
- char *aligned_le_blob;
- char *aligned_be_blob;
-
- g_test_init (&argc, &argv, NULL);
-
- /* We have to pass in a buffer that's at least "default aligned",
- * i.e. on GNU systems to 8 or 16. The linker may have only given
- * us byte-alignment for the char[] static variables.
- */
- aligned_le_blob = g_malloc (sizeof (le_blob));
- memcpy (aligned_le_blob, le_blob, sizeof (le_blob));
- aligned_be_blob = g_malloc (sizeof (be_blob));
- memcpy (aligned_be_blob, be_blob, sizeof (be_blob));
-
- g_test_add ("/demarshal/le", Fixture, aligned_le_blob, setup, test_endian, teardown);
- g_test_add ("/demarshal/be", Fixture, aligned_be_blob, setup, test_endian, teardown);
- g_test_add ("/demarshal/needed/le", Fixture, aligned_le_blob, setup, test_needed,
- teardown);
- g_test_add ("/demarshal/needed/be", Fixture, aligned_be_blob, setup, test_needed,
- teardown);
-
- ret = g_test_run ();
- g_free (aligned_le_blob);
- g_free (aligned_be_blob);
- return ret;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.am b/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.am
deleted file mode 100644
index da41e58b50..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-# Everything in this directory is statically-linked to libdbus-internal
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -DDBUS_COMPILATION \
- -DDBUS_STATIC_BUILD \
- -DDBUS_TEST_USE_INTERNAL \
- $(NULL)
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-## note that TESTS has special meaning (stuff to use in make check)
-## so if adding tests not to be run in make check, don't add them to
-## TESTS
-if DBUS_ENABLE_EMBEDDED_TESTS
-TESTS_ENVIRONMENT = \
- DBUS_TOP_BUILDDIR=@abs_top_builddir@ \
- DBUS_TOP_SRCDIR=@abs_top_srcdir@ \
- PYTHON=@PYTHON@ \
- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
- $(NULL)
-TESTS=run-test.sh run-test-systemserver.sh
-else
-TESTS=
-endif
-
-EXTRA_DIST=run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
-
-if DBUS_ENABLE_EMBEDDED_TESTS
-
-## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
-## build even when not doing "make check"
-noinst_PROGRAMS=test-pending-call-dispatch test-pending-call-timeout test-threads-init test-ids test-shutdown test-privserver test-privserver-client test-autolaunch
-
-test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-internal.la
-test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-internal.la
-test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-internal.la
-test_ids_LDADD=$(top_builddir)/dbus/libdbus-internal.la
-
-test_shutdown_LDADD=../libdbus-testutils-internal.la
-test_privserver_LDADD=../libdbus-testutils-internal.la
-test_privserver_client_LDADD=../libdbus-testutils-internal.la
-test_autolaunch_LDADD=../libdbus-testutils-internal.la
-
-endif
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in b/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in
deleted file mode 100644
index 089c7adbc5..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/Makefile.in
+++ /dev/null
@@ -1,797 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS = run-test.sh \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ run-test-systemserver.sh
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@noinst_PROGRAMS = test-pending-call-dispatch$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-pending-call-timeout$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-threads-init$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-ids$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shutdown$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-privserver$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-privserver-client$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-autolaunch$(EXEEXT)
-subdir = test/name-test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-PROGRAMS = $(noinst_PROGRAMS)
-test_autolaunch_SOURCES = test-autolaunch.c
-test_autolaunch_OBJECTS = test-autolaunch.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_autolaunch_DEPENDENCIES = ../libdbus-testutils-internal.la
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-test_ids_SOURCES = test-ids.c
-test_ids_OBJECTS = test-ids.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_ids_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-test_pending_call_dispatch_SOURCES = test-pending-call-dispatch.c
-test_pending_call_dispatch_OBJECTS = \
- test-pending-call-dispatch.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_dispatch_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-test_pending_call_timeout_SOURCES = test-pending-call-timeout.c
-test_pending_call_timeout_OBJECTS = \
- test-pending-call-timeout.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_timeout_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-test_privserver_SOURCES = test-privserver.c
-test_privserver_OBJECTS = test-privserver.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_DEPENDENCIES = ../libdbus-testutils-internal.la
-test_privserver_client_SOURCES = test-privserver-client.c
-test_privserver_client_OBJECTS = test-privserver-client.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_client_DEPENDENCIES = ../libdbus-testutils-internal.la
-test_shutdown_SOURCES = test-shutdown.c
-test_shutdown_OBJECTS = test-shutdown.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_shutdown_DEPENDENCIES = ../libdbus-testutils-internal.la
-test_threads_init_SOURCES = test-threads-init.c
-test_threads_init_OBJECTS = test-threads-init.$(OBJEXT)
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_threads_init_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = test-autolaunch.c test-ids.c test-pending-call-dispatch.c \
- test-pending-call-timeout.c test-privserver.c \
- test-privserver-client.c test-shutdown.c test-threads-init.c
-DIST_SOURCES = test-autolaunch.c test-ids.c \
- test-pending-call-dispatch.c test-pending-call-timeout.c \
- test-privserver.c test-privserver-client.c test-shutdown.c \
- test-threads-init.c
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# Everything in this directory is statically-linked to libdbus-internal
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -DDBUS_COMPILATION \
- -DDBUS_STATIC_BUILD \
- -DDBUS_TEST_USE_INTERNAL \
- $(NULL)
-
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS_ENVIRONMENT = \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TOP_BUILDDIR=@abs_top_builddir@ \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TOP_SRCDIR=@abs_top_srcdir@ \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ PYTHON=@PYTHON@ \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TEST_DATA=@abs_top_builddir@/test/data \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(NULL)
-
-EXTRA_DIST = run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_dispatch_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_timeout_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_threads_init_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_ids_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_shutdown_LDADD = ../libdbus-testutils-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_LDADD = ../libdbus-testutils-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_client_LDADD = ../libdbus-testutils-internal.la
-@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_autolaunch_LDADD = ../libdbus-testutils-internal.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/name-test/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu test/name-test/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-test-autolaunch$(EXEEXT): $(test_autolaunch_OBJECTS) $(test_autolaunch_DEPENDENCIES) $(EXTRA_test_autolaunch_DEPENDENCIES)
- @rm -f test-autolaunch$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_autolaunch_OBJECTS) $(test_autolaunch_LDADD) $(LIBS)
-test-ids$(EXEEXT): $(test_ids_OBJECTS) $(test_ids_DEPENDENCIES) $(EXTRA_test_ids_DEPENDENCIES)
- @rm -f test-ids$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_ids_OBJECTS) $(test_ids_LDADD) $(LIBS)
-test-pending-call-dispatch$(EXEEXT): $(test_pending_call_dispatch_OBJECTS) $(test_pending_call_dispatch_DEPENDENCIES) $(EXTRA_test_pending_call_dispatch_DEPENDENCIES)
- @rm -f test-pending-call-dispatch$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_pending_call_dispatch_OBJECTS) $(test_pending_call_dispatch_LDADD) $(LIBS)
-test-pending-call-timeout$(EXEEXT): $(test_pending_call_timeout_OBJECTS) $(test_pending_call_timeout_DEPENDENCIES) $(EXTRA_test_pending_call_timeout_DEPENDENCIES)
- @rm -f test-pending-call-timeout$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_pending_call_timeout_OBJECTS) $(test_pending_call_timeout_LDADD) $(LIBS)
-test-privserver$(EXEEXT): $(test_privserver_OBJECTS) $(test_privserver_DEPENDENCIES) $(EXTRA_test_privserver_DEPENDENCIES)
- @rm -f test-privserver$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_privserver_OBJECTS) $(test_privserver_LDADD) $(LIBS)
-test-privserver-client$(EXEEXT): $(test_privserver_client_OBJECTS) $(test_privserver_client_DEPENDENCIES) $(EXTRA_test_privserver_client_DEPENDENCIES)
- @rm -f test-privserver-client$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_privserver_client_OBJECTS) $(test_privserver_client_LDADD) $(LIBS)
-test-shutdown$(EXEEXT): $(test_shutdown_OBJECTS) $(test_shutdown_DEPENDENCIES) $(EXTRA_test_shutdown_DEPENDENCIES)
- @rm -f test-shutdown$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_shutdown_OBJECTS) $(test_shutdown_LDADD) $(LIBS)
-test-threads-init$(EXEEXT): $(test_threads_init_OBJECTS) $(test_threads_init_DEPENDENCIES) $(EXTRA_test_threads_init_DEPENDENCIES)
- @rm -f test-threads-init$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(test_threads_init_OBJECTS) $(test_threads_init_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-autolaunch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ids.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pending-call-dispatch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pending-call-timeout.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-privserver-client.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-privserver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-shutdown.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-threads-init.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- $(am__tty_colors); \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- col=$$red; res=XPASS; \
- ;; \
- *) \
- col=$$grn; res=PASS; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- col=$$lgn; res=XFAIL; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- col=$$red; res=FAIL; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- col=$$blu; res=SKIP; \
- fi; \
- echo "$${col}$$res$${std}: $$tst"; \
- done; \
- if test "$$all" -eq 1; then \
- tests="test"; \
- All=""; \
- else \
- tests="tests"; \
- All="All "; \
- fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="$$All$$all $$tests passed"; \
- else \
- if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
- banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all $$tests failed"; \
- else \
- if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
- banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- if test "$$skip" -eq 1; then \
- skipped="($$skip test was not run)"; \
- else \
- skipped="($$skip tests were not run)"; \
- fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- if test "$$failed" -eq 0; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- fi; \
- echo "$${col}$$dashes$${std}"; \
- echo "$${col}$$banner$${std}"; \
- test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
- test -z "$$report" || echo "$${col}$$report$${std}"; \
- echo "$${col}$$dashes$${std}"; \
- test "$$failed" -eq 0; \
- else :; fi
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: check-am install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
- clean-generic clean-libtool clean-noinstPROGRAMS ctags \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/run-test-systemserver.sh b/src/3rd_party/dbus-1.7.8/test/name-test/run-test-systemserver.sh
deleted file mode 100755
index afd1f045d9..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/run-test-systemserver.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-die()
-{
- if ! test -z "$DBUS_SESSION_BUS_PID" ; then
- echo "killing message bus "$DBUS_SESSION_BUS_PID >&2
- kill -9 $DBUS_SESSION_BUS_PID
- fi
- echo $SCRIPTNAME: $* >&2
-
- exit 1
-}
-
-SCRIPTNAME=$0
-MODE=$1
-
-## so the tests can complain if you fail to use the script to launch them
-DBUS_TEST_NAME_RUN_TEST_SCRIPT=1
-export DBUS_TEST_NAME_RUN_TEST_SCRIPT
-
-SOURCE_CONFIG_FILE=$DBUS_TOP_SRCDIR/test/name-test/tmp-session-like-system.conf
-export SOURCE_CONFIG_FILE
-# Rerun ourselves with tmp session bus if we're not already
-if test -z "$DBUS_TEST_NAME_IN_SYS_RUN_TEST"; then
- DBUS_TEST_NAME_IN_SYS_RUN_TEST=1
- export DBUS_TEST_NAME_IN_SYS_RUN_TEST
- exec $DBUS_TOP_SRCDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE
-fi
-
-if test -n "$DBUS_TEST_MONITOR"; then
- dbus-monitor --session &
-fi
-
-echo "running test-expected-echo-fail"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/tools/dbus-send --print-reply --dest=org.freedesktop.DBus.TestSuiteEchoService /org/freedesktop/TestSuite org.freedesktop.TestSuite.Echo string:hi >echo-error-output.tmp 2>&1
-if ! grep -q 'DBus.Error' echo-error-output.tmp; then
- echo "Didn't get expected failure; output was:"
- echo "====="
- cat echo-error-output.tmp
- echo "====="
- exit 1
-fi
-
-echo "running test echo signal"
-if test "x$PYTHON" = "x:"; then
- echo "Skipped test-echo-signal: Python interpreter not found"
-elif ! $PYTHON $DBUS_TOP_SRCDIR/test/name-test/test-wait-for-echo.py; then
- echo "Failed test-wait-for-echo"
- exit 1
-fi
-
-exit 0
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/run-test.sh b/src/3rd_party/dbus-1.7.8/test/name-test/run-test.sh
deleted file mode 100755
index cad5937ea2..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/run-test.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/sh
-
-die()
-{
- if ! test -z "$DBUS_SESSION_BUS_PID" ; then
- echo "killing message bus "$DBUS_SESSION_BUS_PID >&2
- kill -9 $DBUS_SESSION_BUS_PID
- fi
- echo $SCRIPTNAME: $* >&2
-
- exit 1
-}
-
-
-SCRIPTNAME=$0
-MODE=$1
-
-## so the tests can complain if you fail to use the script to launch them
-DBUS_TEST_NAME_RUN_TEST_SCRIPT=1
-export DBUS_TEST_NAME_RUN_TEST_SCRIPT
-
-# Rerun ourselves with tmp session bus if we're not already
-if test -z "$DBUS_TEST_NAME_IN_RUN_TEST"; then
- DBUS_TEST_NAME_IN_RUN_TEST=1
- export DBUS_TEST_NAME_IN_RUN_TEST
- exec $DBUS_TOP_SRCDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE
-fi
-
-if test -n "$DBUS_TEST_MONITOR"; then
- dbus-monitor --session &
-fi
-
-echo "running test-ids"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-ids || die "test-ids failed"
-
-echo "running test-pending-call-dispatch"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-pending-call-dispatch || die "test-pending-call-dispatch failed"
-
-echo "running test-pending-call-timeout"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-pending-call-timeout || die "test-pending-call-timeout failed"
-
-echo "running test-threads-init"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-threads-init || die "test-threads-init failed"
-
-echo "running test-privserver-client"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-privserver-client || die "test-privserver-client failed"
-
-echo "running test-shutdown"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-shutdown || die "test-shutdown failed"
-
-echo "running test activation forking"
-if test "x$PYTHON" = "x:"; then
- echo "Skipped test-activation-forking: Python interpreter not found"
-elif ! $PYTHON $DBUS_TOP_SRCDIR/test/name-test/test-activation-forking.py; then
- echo "Failed test-activation-forking"
- exit 1
-fi
-
-echo "running test-autolaunch"
-${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-autolaunch || die "test-autolaunch failed"
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-activation-forking.py b/src/3rd_party/dbus-1.7.8/test/name-test/test-activation-forking.py
deleted file mode 100644
index 0d820754cf..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-activation-forking.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-
-import os,sys
-
-try:
- import gobject
- import dbus
- import dbus.mainloop.glib
-except:
- print "Failed import, aborting test"
- sys.exit(0)
-
-dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-loop = gobject.MainLoop()
-
-exitcode = 0
-
-bus = dbus.SessionBus()
-bus_iface = dbus.Interface(bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus')
-
-o = bus.get_object('org.freedesktop.DBus.TestSuiteForkingEchoService', '/org/freedesktop/TestSuite')
-i = dbus.Interface(o, 'org.freedesktop.TestSuite')
-
-# Start it up
-reply = i.Echo("hello world")
-print "TestSuiteForkingEchoService initial reply OK"
-
-def ignore(*args, **kwargs):
- pass
-
-# Now monitor for exits, when that happens, start it up again.
-# The goal here is to try to hit any race conditions in activation.
-counter = 0
-def on_forking_echo_owner_changed(name, old, new):
- global counter
- global o
- global i
- if counter > 10:
- print "Activated 10 times OK, TestSuiteForkingEchoService pass"
- loop.quit()
- return
- counter += 1
- if new == '':
- o = bus.get_object('org.freedesktop.DBus.TestSuiteForkingEchoService', '/org/freedesktop/TestSuite')
- i = dbus.Interface(o, 'org.freedesktop.TestSuite')
- i.Echo("counter %r" % counter)
- i.Exit(reply_handler=ignore, error_handler=ignore)
-
-bus_iface.connect_to_signal('NameOwnerChanged', on_forking_echo_owner_changed, arg0='org.freedesktop.DBus.TestSuiteForkingEchoService')
-
-i.Exit(reply_handler=ignore, error_handler=ignore)
-
-def check_counter():
- if counter == 0:
- print "Failed to get NameOwnerChanged for TestSuiteForkingEchoService"
- sys.exit(1)
-gobject.timeout_add(15000, check_counter)
-
-loop.run()
-sys.exit(0)
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-autolaunch.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-autolaunch.c
deleted file mode 100644
index 8b5206a684..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-autolaunch.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <dbus/dbus.h>
-#include "dbus/dbus-sysdeps.h"
-
-int
-main (int argc, char *argv[])
-{
- DBusConnection *conn = NULL;
- DBusError error;
-
- dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", NULL);
-
- dbus_error_init (&error);
-
- conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
-
-#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
- /* If X11 autolaunch was enabled, we expect dbus-launch to have worked. */
- if (_dbus_getenv ("DISPLAY") != NULL && dbus_error_is_set (&error))
- {
- fprintf (stderr, "*** Failed to autolaunch session bus: %s\n",
- error.message);
- dbus_error_free (&error);
- return 1;
- }
-#endif
-
- /* We don't necessarily expect it to *work* without X (although it might -
- * for instance on Mac OS it might have used launchd). Just check that the
- * results are consistent. */
-
- if (dbus_error_is_set (&error) && conn != NULL)
- {
- fprintf (stderr, "*** Autolaunched session bus, but an error was set!\n");
- return 1;
- }
-
- if (!dbus_error_is_set (&error) && conn == NULL)
- {
- fprintf (stderr, "*** Failed to autolaunch session bus but no error was set\n");
- return 1;
- }
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-ids.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-ids.c
deleted file mode 100644
index 8f63d04420..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-ids.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-connection-internal.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** test-ids: %s", message);
- exit (1);
-}
-
-int
-main (int argc,
- char **argv)
-{
- DBusError error;
- DBusConnection *connection;
- char *id;
- char *server_id;
-
- dbus_error_init (&error);
- connection = dbus_bus_get (DBUS_BUS_SESSION, &error);
- if (connection == NULL)
- {
- fprintf (stderr, "*** Failed to open connection to system bus: %s\n",
- error.message);
- dbus_error_free (&error);
- return 1;
- }
-
- server_id = dbus_connection_get_server_id (connection);
- if (server_id == NULL)
- die ("No bus server ID retrieved\n");
- /* printf("'%s'\n", server_id); */
- if (strlen (server_id) != 32)
- die ("Bus server id should have length 32\n");
- dbus_free (server_id);
-
- id = dbus_bus_get_id (connection, NULL);
- if (id == NULL)
- die ("No bus ID retrieved\n");
- /* printf("'%s'\n", id); */
- if (strlen (id) != 32)
- die ("Bus ID should have length 32\n");
- dbus_free (id);
-
- _dbus_verbose ("*** Test IDs exiting\n");
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-dispatch.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-dispatch.c
deleted file mode 100644
index c8b5a46783..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-dispatch.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
-* Test to make sure we don't get stuck polling a dbus connection
-* which has no data on the socket. This was an issue where
-* one pending call would read all the data off the bus
-* and the second pending call would not check to see
-* if its data had already been read before polling the connection
-* and blocking.
-**/
-
-#include <config.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-sysdeps.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static void
-_run_iteration (DBusConnection *conn)
-{
- DBusPendingCall *echo_pending;
- DBusPendingCall *dbus_pending;
- DBusMessage *method;
- DBusMessage *reply;
- char *echo = "echo";
-
- /* send the first message */
- method = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- dbus_message_append_args (method, DBUS_TYPE_STRING, &echo, NULL);
- dbus_connection_send_with_reply (conn, method, &echo_pending, -1);
- dbus_message_unref (method);
-
- /* send the second message */
- method = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- "org.freedesktop.Introspectable",
- "Introspect");
-
- dbus_connection_send_with_reply (conn, method, &dbus_pending, -1);
- dbus_message_unref (method);
-
- /* block on the second message (should return immediately) */
- dbus_pending_call_block (dbus_pending);
-
- /* block on the first message */
- /* if it does not return immediately chances
- are we hit the block in poll bug */
- dbus_pending_call_block (echo_pending);
-
- /* check the reply only to make sure we
- are not getting errors unrelated
- to the block in poll bug */
- reply = dbus_pending_call_steal_reply (echo_pending);
-
- if (reply == NULL)
- {
- printf ("Failed: Reply is NULL ***\n");
- exit (1);
- }
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
- {
- printf ("Failed: Reply is error: %s ***\n", dbus_message_get_error_name (reply));
- exit (1);
- }
-
- dbus_message_unref (reply);
- dbus_pending_call_unref (dbus_pending);
- dbus_pending_call_unref (echo_pending);
-
-}
-
-int
-main (int argc, char *argv[])
-{
- long start_tv_sec, start_tv_usec;
- long end_tv_sec, end_tv_usec;
- int i;
- DBusMessage *method;
- DBusConnection *conn;
- DBusError error;
-
- /* Time each iteration and make sure it doesn't take more than 5 seconds
- to complete. Outside influences may cause connections to take longer
- but if it does and we are stuck in a poll call then we know the
- stuck in poll bug has come back to haunt us */
-
- printf ("*** Testing stuck in poll\n");
-
- dbus_error_init (&error);
-
- conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
-
- /* run 100 times to make sure */
- for (i = 0; i < 100; i++)
- {
- long delta;
-
- _dbus_get_monotonic_time (&start_tv_sec, &start_tv_usec);
- _run_iteration (conn);
- _dbus_get_monotonic_time (&end_tv_sec, &end_tv_usec);
-
- /* we just care about seconds */
- delta = end_tv_sec - start_tv_sec;
- printf ("Iter %i: %lis\n", i, delta);
- if (delta >= 5)
- {
- printf ("Failed: looks like we might have been be stuck in poll ***\n");
- exit (1);
- }
- }
-
- method = dbus_message_new_method_call ("org.freedesktop.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Exit");
- dbus_connection_send (conn, method, NULL);
- dbus_message_unref (method);
-
- printf ("Success ***\n");
- exit (0);
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-timeout.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-timeout.c
deleted file mode 100644
index d051faba95..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-pending-call-timeout.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
-* Test to make sure that pending calls succeed when given a default,
-* specific and infinite timeout.
-**/
-
-#include <config.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-sysdeps.h>
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-
-static void
-_method_call (DBusConnection *conn,
- int timeout_milliseconds)
-{
- DBusPendingCall *pending;
- DBusMessage *method;
- DBusMessage *reply;
- char *echo = "echo";
-
- /* send the message */
- method = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "DelayEcho");
-
- dbus_message_append_args (method, DBUS_TYPE_STRING, &echo, NULL);
- dbus_connection_send_with_reply (conn, method, &pending, timeout_milliseconds);
- dbus_message_unref (method);
-
- /* block on the message */
- dbus_pending_call_block (pending);
-
- /* check the reply only to make sure we
- are not getting errors unrelated
- to the block in poll bug */
- reply = dbus_pending_call_steal_reply (pending);
-
- if (reply == NULL)
- {
- printf ("Failed: Reply is NULL ***\n");
- exit (1);
- }
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
- {
- printf ("Failed: Reply is error: %s ***\n", dbus_message_get_error_name (reply));
- exit (1);
- }
-
- dbus_message_unref (reply);
- dbus_pending_call_unref (pending);
-}
-
-static void
-_run_iteration (DBusConnection *conn)
-{
- _method_call (conn, -1);
- _method_call (conn, 10000);
- _method_call (conn, INT_MAX);
-}
-
-int
-main (int argc, char *argv[])
-{
- long start_tv_sec, start_tv_usec;
- long end_tv_sec, end_tv_usec;
- int i;
- DBusMessage *method;
- DBusConnection *conn;
- DBusError error;
-
- printf ("*** Testing pending call timeouts\n");
-
- dbus_error_init (&error);
-
- conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
-
- /* run 100 times to make sure */
- for (i = 0; i < 100; i++)
- {
- long delta;
-
- _dbus_get_monotonic_time (&start_tv_sec, &start_tv_usec);
- _run_iteration (conn);
- _dbus_get_monotonic_time (&end_tv_sec, &end_tv_usec);
-
- /* we just care about seconds */
- delta = end_tv_sec - start_tv_sec;
- printf ("Iter %i: %lis\n", i, delta);
- }
-
- method = dbus_message_new_method_call ("org.freedesktop.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Exit");
- dbus_connection_send (conn, method, NULL);
- dbus_message_unref (method);
-
- printf ("Success ***\n");
- exit (0);
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver-client.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver-client.c
deleted file mode 100644
index e7f48960a8..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver-client.c
+++ /dev/null
@@ -1,168 +0,0 @@
-#include <config.h>
-#include "../test-utils.h"
-
-static void
-die (const char *message, ...)
-{
- va_list args;
- va_start (args, message);
- vfprintf (stderr, message, args);
- va_end (args);
- exit (1);
-}
-
-#define PRIVSERVER_SERVICE "org.freedesktop.DBus.TestSuite.PrivServer"
-#define PRIVSERVER_INTERFACE PRIVSERVER_SERVICE
-#define PRIVSERVER_DIED_RULE \
- "type='signal',sender='" DBUS_SERVICE_DBUS "'," \
- "interface='" DBUS_INTERFACE_DBUS "',member='NameOwnerChanged'," \
- "arg0='" PRIVSERVER_SERVICE "',arg2=''"
-
-static DBusHandlerResult
-filter_session_message (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- dbus_bool_t *service_died_p = user_data;
- const char *name, *old_owner, *new_owner;
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_DBUS,
- "NameOwnerChanged") &&
- dbus_message_has_sender (message, DBUS_SERVICE_DBUS) &&
- dbus_message_get_args (message, NULL,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &new_owner,
- DBUS_TYPE_INVALID) &&
- strcmp (name, PRIVSERVER_SERVICE) == 0 &&
- old_owner[0] != '\0' &&
- new_owner[0] == '\0')
- {
- *service_died_p = TRUE;
- }
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static DBusHandlerResult
-filter_private_message (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- dbus_bool_t *private_conn_lost_p = user_data;
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- {
- *private_conn_lost_p = TRUE;
- }
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static void
-open_shutdown_private_connection (dbus_bool_t use_guid)
-{
- DBusError error;
- DBusLoop *loop;
- DBusConnection *session;
- DBusMessage *msg;
- DBusMessage *reply;
- DBusConnection *privconn;
- char *addr;
- dbus_bool_t service_died;
- dbus_bool_t private_conn_lost;
-
- dbus_error_init (&error);
- service_died = FALSE;
- private_conn_lost = FALSE;
-
- loop = _dbus_loop_new ();
-
- session = dbus_bus_get (DBUS_BUS_SESSION, &error);
- if (!session)
- die ("couldn't access session bus\n");
- dbus_connection_set_exit_on_disconnect (session, FALSE);
- test_connection_setup (loop, session);
-
- dbus_bus_add_match (session, PRIVSERVER_DIED_RULE, &error);
- if (dbus_error_is_set (&error))
- die ("couldn't add match rule \"%s\": %s: %s", PRIVSERVER_DIED_RULE,
- error.name, error.message);
-
- if (!dbus_connection_add_filter (session, filter_session_message,
- &service_died, NULL))
- die ("couldn't add filter to session bus\n");
-
- msg = dbus_message_new_method_call (PRIVSERVER_SERVICE, "/",
- PRIVSERVER_INTERFACE, "GetPrivateAddress");
- if (!(reply = dbus_connection_send_with_reply_and_block (session, msg, -1, &error)))
- die ("couldn't send message: %s\n", error.message);
- dbus_message_unref (msg);
- if (!dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &addr, DBUS_TYPE_INVALID))
- die ("couldn't parse message replym\n");
- printf ("got private temp address %s\n", addr);
- addr = strdup (addr);
- if (!use_guid)
- {
- char *comma = strrchr (addr, ',');
- if (comma)
- *comma = '\0';
- }
- privconn = dbus_connection_open (addr, &error);
- free (addr);
- if (!privconn)
- die ("couldn't connect to server direct connection: %s\n", error.message);
- dbus_message_unref (reply);
-
- dbus_connection_set_exit_on_disconnect (privconn, FALSE);
- if (!dbus_connection_add_filter (privconn, filter_private_message,
- &private_conn_lost, NULL))
- die ("couldn't add filter to private connection\n");
- test_connection_setup (loop, privconn);
-
- msg = dbus_message_new_method_call (PRIVSERVER_SERVICE, "/",
- PRIVSERVER_INTERFACE, "Quit");
- if (!dbus_connection_send (session, msg, NULL))
- die ("couldn't send Quit message\n");
- dbus_message_unref (msg);
-
- while (!service_died || !private_conn_lost)
- _dbus_loop_iterate (loop, TRUE);
-
- dbus_connection_remove_filter (session, filter_session_message,
- &service_died);
- dbus_bus_remove_match (session, PRIVSERVER_DIED_RULE, NULL);
- test_connection_shutdown (loop, session);
- dbus_connection_unref (session);
-
- test_connection_shutdown (loop, privconn);
- dbus_connection_remove_filter (privconn, filter_private_message,
- &private_conn_lost);
- dbus_connection_unref (privconn);
-
- _dbus_loop_unref (loop);
-}
-
-int
-main (int argc, char *argv[])
-{
- open_shutdown_private_connection (TRUE);
-
- dbus_shutdown ();
-
- open_shutdown_private_connection (TRUE);
-
- dbus_shutdown ();
-
- open_shutdown_private_connection (FALSE);
-
- dbus_shutdown ();
-
- open_shutdown_private_connection (FALSE);
-
- dbus_shutdown ();
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver.c
deleted file mode 100644
index 39a98b7f0d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-privserver.c
+++ /dev/null
@@ -1,123 +0,0 @@
-#include <config.h>
-#include "../test-utils.h"
-
-static void
-die (const char *message, ...)
-{
- va_list args;
- va_start (args, message);
- vfprintf (stderr, message, args);
- va_end (args);
- exit (1);
-}
-
-typedef struct TestServiceData TestServiceData;
-
-struct TestServiceData
-{
- DBusLoop *loop;
- char *private_addr;
-};
-
-static void
-new_connection_callback (DBusServer *server,
- DBusConnection *new_connection,
- void *data)
-{
- TestServiceData *testdata = data;
-
- if (!test_connection_setup (testdata->loop, new_connection))
- dbus_connection_close (new_connection);
-}
-
-static DBusHandlerResult
-filter_session_message (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- TestServiceData *testdata = user_data;
-
- if (dbus_message_is_method_call (message,
- "org.freedesktop.DBus.TestSuite.PrivServer",
- "GetPrivateAddress"))
- {
- DBusMessage *reply;
- reply = dbus_message_new_method_return (message);
- dbus_message_append_args (reply, DBUS_TYPE_STRING,
- &(testdata->private_addr), DBUS_TYPE_INVALID);
- dbus_connection_send (connection, reply, NULL);
- dbus_message_unref (reply);
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.DBus.TestSuite.PrivServer",
- "Quit"))
- {
- fprintf (stderr, "server exiting loop\n");
- _dbus_loop_quit (testdata->loop);
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-int
-main (int argc, char *argv[])
-{
- DBusServer *server;
- DBusError error;
- DBusLoop *loop;
- DBusConnection *session;
- TestServiceData *testdata;
-
- dbus_error_init (&error);
-
- loop = _dbus_loop_new ();
-
- testdata = dbus_new (TestServiceData, 1);
- testdata->loop = loop;
-
- session = dbus_bus_get (DBUS_BUS_SESSION, &error);
- if (!session)
- die ("couldn't access session bus");
-
- test_connection_setup (loop, session);
-
- dbus_bus_request_name (session, "org.freedesktop.DBus.TestSuite.PrivServer", 0, &error);
- if (dbus_error_is_set (&error))
- die ("couldn't request name: %s", error.message);
-
- if (!dbus_connection_add_filter (session, filter_session_message, testdata, NULL))
- die ("couldn't add filter");
-
-#ifdef DBUS_CMAKE
- server = dbus_server_listen (TEST_LISTEN, &error);
-#else
- server = dbus_server_listen ("unix:tmpdir=/tmp", &error);
-#endif
- if (!server)
- die (error.message);
- testdata->private_addr = dbus_server_get_address (server);
- printf ("test server listening on %s\n", testdata->private_addr);
-
- dbus_server_set_new_connection_function (server, new_connection_callback,
- testdata, NULL);
-
- if (!test_server_setup (loop, server))
- die ("server setup failed");
-
- fprintf (stderr, "server running mainloop\n");
- _dbus_loop_run (loop);
- fprintf (stderr, "server mainloop quit\n");
-
- test_server_shutdown (loop, server);
-
- test_connection_shutdown (loop, session);
-
- dbus_connection_unref (session);
-
- _dbus_loop_unref (loop);
-
- dbus_free (testdata);
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-shutdown.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-shutdown.c
deleted file mode 100644
index 526c1cbc52..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-shutdown.c
+++ /dev/null
@@ -1,68 +0,0 @@
-
-#include <config.h>
-#include "../test-utils.h"
-
-static DBusLoop *loop;
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** test-shutdown: %s", message);
- exit (1);
-}
-
-static void
-open_destroy_shared_session_bus_connection (void)
-{
- DBusError error;
- DBusConnection *connection;
- char *session_addr_no_guid;
- char *comma;
-
- dbus_error_init (&error);
-
- session_addr_no_guid = strdup (getenv ("DBUS_SESSION_BUS_ADDRESS"));
- comma = strchr (session_addr_no_guid, ',');
- if (comma == NULL)
- die ("Couldn't find GUID in session bus address");
- *comma = '\0';
-
- connection = dbus_connection_open (session_addr_no_guid, &error);
- free (session_addr_no_guid);
- if (connection == NULL)
- die ("Failed to open connection to temp session bus\n");
-
- loop = _dbus_loop_new ();
- if (loop == NULL)
- die ("No memory\n");
-
- if (!test_connection_setup (loop, connection))
- die ("No memory\n");
-
- test_connection_shutdown (loop, connection);
-
- _dbus_loop_unref (loop);
-
- dbus_connection_unref (connection);
-}
-
-int
-main (int argc,
- char **argv)
-{
- open_destroy_shared_session_bus_connection ();
-
- dbus_shutdown ();
-
- open_destroy_shared_session_bus_connection ();
-
- dbus_shutdown ();
-
- open_destroy_shared_session_bus_connection ();
-
- dbus_shutdown ();
-
- _dbus_verbose ("*** Test shutdown exiting\n");
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-threads-init.c b/src/3rd_party/dbus-1.7.8/test/name-test/test-threads-init.c
deleted file mode 100644
index 580ffe1444..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-threads-init.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Test to make sure late thread initialization works
- */
-
-#include <config.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-sysdeps.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-connection-internal.h>
-
-static void
-_run_iteration (DBusConnection *conn)
-{
- DBusPendingCall *echo_pending;
- DBusPendingCall *dbus_pending;
- DBusMessage *method;
- DBusMessage *reply;
- char *echo = "echo";
-
- /* send the first message */
- method = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Echo");
-
- dbus_message_append_args (method, DBUS_TYPE_STRING, &echo, NULL);
- dbus_connection_send_with_reply (conn, method, &echo_pending, -1);
- dbus_message_unref (method);
-
- /* send the second message */
- method = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- "org.freedesktop.Introspectable",
- "Introspect");
-
- dbus_connection_send_with_reply (conn, method, &dbus_pending, -1);
- dbus_message_unref (method);
-
- /* block on the second message (should return immediately) */
- dbus_pending_call_block (dbus_pending);
-
- /* block on the first message */
- /* if it does not return immediately chances
- are we hit the block in poll bug */
- dbus_pending_call_block (echo_pending);
-
- /* check the reply only to make sure we
- are not getting errors unrelated
- to the block in poll bug */
- reply = dbus_pending_call_steal_reply (echo_pending);
-
- if (reply == NULL)
- {
- printf ("Failed: Reply is NULL ***\n");
- exit (1);
- }
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
- {
- printf ("Failed: Reply is error: %s ***\n", dbus_message_get_error_name (reply));
- exit (1);
- }
-
- dbus_message_unref (reply);
- dbus_pending_call_unref (dbus_pending);
- dbus_pending_call_unref (echo_pending);
-
-}
-static void
-check_mutex_lock (DBusMutex *mutex1,
- DBusMutex *mutex2,
- dbus_bool_t is_same)
-{
- _dbus_assert (mutex1 != NULL);
- _dbus_assert (mutex2 != NULL);
-
- if (is_same)
- {
- _dbus_assert (mutex1 == mutex2);
- }
- else
- {
- _dbus_assert (mutex1 != mutex2);
- }
-}
-
-static void
-check_condvar_lock (DBusCondVar *condvar1,
- DBusCondVar *condvar2,
- dbus_bool_t is_same)
-{
- _dbus_assert (condvar1 != NULL);
- _dbus_assert (condvar2 != NULL);
-
- if (is_same)
- {
- _dbus_assert (condvar1 == condvar2);
- }
- else
- {
- _dbus_assert (condvar1 != condvar2);
- }
-}
-
-
-int
-main (int argc, char *argv[])
-{
- DBusMessage *method;
- DBusConnection *conn;
- DBusError error;
- DBusMutex *mutex1, *dispatch_mutex1, *io_path_mutex1;
- DBusCondVar *dispatch_cond1, *io_path_cond1;
- DBusMutex *mutex2, *dispatch_mutex2, *io_path_mutex2;
- DBusCondVar *dispatch_cond2, *io_path_cond2;
-
- printf ("*** Testing late thread init\n");
-
- dbus_error_init (&error);
-
- conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
-
- _dbus_connection_test_get_locks (conn, &mutex1,
- &dispatch_mutex1,
- &io_path_mutex1,
- &dispatch_cond1,
- &io_path_cond1);
- _run_iteration (conn);
- _dbus_connection_test_get_locks (conn, &mutex2,
- &dispatch_mutex2,
- &io_path_mutex2,
- &dispatch_cond2,
- &io_path_cond2);
-
- check_mutex_lock (mutex1, mutex2, TRUE);
- check_mutex_lock (dispatch_mutex1, dispatch_mutex2, TRUE);
- check_mutex_lock (io_path_mutex1, io_path_mutex2, TRUE);
- check_condvar_lock (dispatch_cond1, dispatch_cond2, TRUE);
- check_condvar_lock (io_path_cond1, io_path_cond2, TRUE);
-
- dbus_threads_init_default ();
-
- _dbus_connection_test_get_locks (conn, &mutex1,
- &dispatch_mutex1,
- &io_path_mutex1,
- &dispatch_cond1,
- &io_path_cond1);
-
- /* Since 1.7 it is no longer the case that mutex1 != mutex2, because
- * initializing global locks automatically initializes locks
- * in general. However, it is true that the mutex is not the dummy
- * implementation, which is what we really wanted to check here. */
- _dbus_assert (mutex1 != (DBusMutex *) 0xABCDEF);
- _dbus_assert (dispatch_mutex1 != (DBusMutex *) 0xABCDEF);
- _dbus_assert (dispatch_cond1 != (DBusCondVar *) 0xABCDEF2);
- _dbus_assert (io_path_mutex1 != (DBusMutex *) 0xABCDEF);
- _dbus_assert (io_path_cond1 != (DBusCondVar *) 0xABCDEF2);
-
- _run_iteration (conn);
- _dbus_connection_test_get_locks (conn, &mutex2,
- &dispatch_mutex2,
- &io_path_mutex2,
- &dispatch_cond2,
- &io_path_cond2);
-
- check_mutex_lock (mutex1, mutex2, TRUE);
- check_mutex_lock (dispatch_mutex1, dispatch_mutex2, TRUE);
- check_mutex_lock (io_path_mutex1, io_path_mutex2, TRUE);
- check_condvar_lock (dispatch_cond1, dispatch_cond2, TRUE);
- check_condvar_lock (io_path_cond1, io_path_cond2, TRUE);
-
- method = dbus_message_new_method_call ("org.freedesktop.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Exit");
- dbus_connection_send (conn, method, NULL);
- dbus_message_unref (method);
-
- printf ("Success ***\n");
- exit (0);
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/test-wait-for-echo.py b/src/3rd_party/dbus-1.7.8/test/name-test/test-wait-for-echo.py
deleted file mode 100755
index bd09e4596d..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/test-wait-for-echo.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-
-import os,sys
-
-try:
- import gobject
- import dbus
- import dbus.mainloop.glib
-except:
- print "Failed import, aborting test"
- sys.exit(0)
-
-dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-loop = gobject.MainLoop()
-
-exitcode = 0
-
-def handle_noreceipt():
- print "Failed to get signal"
- global exitcode
- exitcode = 1
- loop.quit()
-
-gobject.timeout_add(7000, handle_noreceipt)
-
-bus = dbus.SessionBus()
-
-def sighandler(*args, **kwargs):
- print "got signal"
- loop.quit()
-
-bus.add_signal_receiver(sighandler, dbus_interface='org.freedesktop.TestSuite', signal_name='Foo')
-
-o = bus.get_object('org.freedesktop.DBus.TestSuiteEchoService', '/org/freedesktop/TestSuite')
-i = dbus.Interface(o, 'org.freedesktop.TestSuite')
-def nullhandler(*args, **kwargs):
- pass
-i.EmitFoo(reply_handler=nullhandler, error_handler=nullhandler)
-
-loop.run()
-sys.exit(exitcode)
diff --git a/src/3rd_party/dbus-1.7.8/test/name-test/tmp-session-like-system.conf b/src/3rd_party/dbus-1.7.8/test/name-test/tmp-session-like-system.conf
deleted file mode 100644
index 29ab115faa..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/name-test/tmp-session-like-system.conf
+++ /dev/null
@@ -1,91 +0,0 @@
-<!-- This configuration file controls the per-user-login-session message bus.
- Add a session-local.conf and edit that rather than changing this
- file directly. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
-
- <!-- If we fork, keep the user's original umask to avoid affecting
- the behavior of child processes. -->
- <keep_umask/>
-
- <syslog/>
-
- <listen>unix:tmpdir=/tmp</listen>
-
- <standard_session_servicedirs />
-
- <!-- intended to match system bus -->
- <policy context="default">
- <!-- All users can connect to system bus -->
- <allow user="*"/>
-
- <!-- Holes must be punched in service configuration files for
- name ownership and sending method calls -->
- <deny own="*"/>
- <deny send_type="method_call"/>
-
- <!-- Signals and reply messages (method returns, errors) are allowed
- by default -->
- <allow send_type="signal"/>
- <allow send_requested_reply="true" send_type="method_return"/>
- <allow send_requested_reply="true" send_type="error"/>
-
- <!-- All messages may be received by default -->
- <allow receive_type="method_call"/>
- <allow receive_type="method_return"/>
- <allow receive_type="error"/>
- <allow receive_type="signal"/>
-
- <!-- Allow anyone to talk to the message bus -->
- <allow send_destination="org.freedesktop.DBus"/>
- <!-- But disallow some specific bus services -->
- <deny send_destination="org.freedesktop.DBus"
- send_interface="org.freedesktop.DBus"
- send_member="UpdateActivationEnvironment"/>
-
- <!-- Specific to the test suite -->
- <allow own="org.freedesktop.DBus.TestSuiteEchoService"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.DBus.Introspectable"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.TestSuite"
- send_member="EmitFoo"/>
- </policy>
-
- <policy context="default">
- <allow own="org.freedesktop.DBus.TestSuiteEchoService"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.DBus.Introspectable"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.TestSuite"
- send_member="EmitFoo"/>
- </policy>
-
- <!-- For the session bus, override the default relatively-low limits
- with essentially infinite limits, since the bus is just running
- as the user anyway, using up bus resources is not something we need
- to worry about. In some cases, we do set the limits lower than
- "all available memory" if exceeding the limit is almost certainly a bug,
- having the bus enforce a limit is nicer than a huge memory leak. But the
- intent is that these limits should never be hit. -->
-
- <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
- <limit name="max_incoming_bytes">1000000000</limit>
- <limit name="max_outgoing_bytes">1000000000</limit>
- <limit name="max_message_size">1000000000</limit>
- <limit name="service_start_timeout">120000</limit>
- <limit name="auth_timeout">240000</limit>
- <limit name="max_completed_connections">100000</limit>
- <limit name="max_incomplete_connections">10000</limit>
- <limit name="max_connections_per_user">100000</limit>
- <limit name="max_pending_service_starts">10000</limit>
- <limit name="max_names_per_connection">50000</limit>
- <limit name="max_match_rules_per_connection">50000</limit>
- <limit name="max_replies_per_connection">50000</limit>
- <limit name="reply_timeout">300000</limit>
-
-</busconfig>
diff --git a/src/3rd_party/dbus-1.7.8/test/relay.c b/src/3rd_party/dbus-1.7.8/test/relay.c
deleted file mode 100644
index ecfe4c8258..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/relay.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/* Regression test for passing unmodified messages between connections
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-#include "test-utils.h"
-
-/* This is basically a miniature dbus-daemon. We relay messages from the client
- * on the left to the client on the right.
- *
- * left socket left dispatch right socket right
- * client ===========> server --------------> server ===========> client
- * conn conn conn conn
- *
- * In the real dbus-daemon, the client connections would be out-of-process,
- * but here we're cheating and doing everything in-process.
- */
-
-typedef struct {
- TestMainContext *ctx;
- DBusError e;
-
- DBusServer *server;
-
- DBusConnection *left_client_conn;
- DBusConnection *left_server_conn;
-
- DBusConnection *right_server_conn;
- DBusConnection *right_client_conn;
- /* queue of DBusMessage received by right_client_conn */
- GQueue messages;
-} Fixture;
-
-static void
-assert_no_error (const DBusError *e)
-{
- if (G_UNLIKELY (dbus_error_is_set (e)))
- g_error ("expected success but got error: %s: %s", e->name, e->message);
-}
-
-static DBusHandlerResult
-server_message_cb (DBusConnection *server_conn,
- DBusMessage *message,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (server_conn == f->left_server_conn);
- g_assert (f->right_server_conn != NULL);
-
- dbus_connection_send (f->right_server_conn, message, NULL);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static DBusHandlerResult
-right_client_message_cb (DBusConnection *client_conn,
- DBusMessage *message,
- void *data)
-{
- Fixture *f = data;
-
- g_assert (client_conn == f->right_client_conn);
- g_queue_push_tail (&f->messages, dbus_message_ref (message));
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void
-new_conn_cb (DBusServer *server,
- DBusConnection *server_conn,
- void *data)
-{
- Fixture *f = data;
- dbus_bool_t have_mem;
-
- if (f->left_server_conn == NULL)
- {
- f->left_server_conn = dbus_connection_ref (server_conn);
-
- have_mem = dbus_connection_add_filter (server_conn,
- server_message_cb, f, NULL);
- g_assert (have_mem);
- }
- else
- {
- g_assert (f->right_server_conn == NULL);
- f->right_server_conn = dbus_connection_ref (server_conn);
- }
-
- test_connection_setup (f->ctx, server_conn);
-}
-
-static void
-setup (Fixture *f,
- gconstpointer data G_GNUC_UNUSED)
-{
- f->ctx = test_main_context_get ();
- dbus_error_init (&f->e);
- g_queue_init (&f->messages);
-
- f->server = dbus_server_listen ("tcp:host=127.0.0.1", &f->e);
- assert_no_error (&f->e);
- g_assert (f->server != NULL);
-
- dbus_server_set_new_connection_function (f->server,
- new_conn_cb, f, NULL);
- test_server_setup (f->ctx, f->server);
-}
-
-static void
-test_connect (Fixture *f,
- gconstpointer data G_GNUC_UNUSED)
-{
- dbus_bool_t have_mem;
- char *address;
-
- g_assert (f->left_server_conn == NULL);
- g_assert (f->right_server_conn == NULL);
-
- address = dbus_server_get_address (f->server);
- g_assert (address != NULL);
-
- f->left_client_conn = dbus_connection_open_private (address, &f->e);
- assert_no_error (&f->e);
- g_assert (f->left_client_conn != NULL);
- test_connection_setup (f->ctx, f->left_client_conn);
-
- while (f->left_server_conn == NULL)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- f->right_client_conn = dbus_connection_open_private (address, &f->e);
- assert_no_error (&f->e);
- g_assert (f->right_client_conn != NULL);
- test_connection_setup (f->ctx, f->right_client_conn);
-
- dbus_free (address);
-
- while (f->right_server_conn == NULL)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- have_mem = dbus_connection_add_filter (f->right_client_conn,
- right_client_message_cb, f, NULL);
- g_assert (have_mem);
-}
-
-static dbus_uint32_t
-send_one (Fixture *f,
- const char *member)
-{
- dbus_bool_t have_mem;
- dbus_uint32_t serial;
- DBusMessage *outgoing;
-
- outgoing = dbus_message_new_signal ("/com/example/Hello",
- "com.example.Hello", member);
- g_assert (outgoing != NULL);
-
- have_mem = dbus_connection_send (f->left_client_conn, outgoing, &serial);
- g_assert (have_mem);
- g_assert (serial != 0);
-
- dbus_message_unref (outgoing);
- return serial;
-}
-
-static void
-test_relay (Fixture *f,
- gconstpointer data)
-{
- DBusMessage *incoming;
-
- test_connect (f, data);
-
- send_one (f, "First");
- send_one (f, "Second");
-
- while (g_queue_get_length (&f->messages) < 2)
- {
- g_print (".");
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- g_assert_cmpuint (g_queue_get_length (&f->messages), ==, 2);
-
- incoming = g_queue_pop_head (&f->messages);
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "First");
- dbus_message_unref (incoming);
-
- incoming = g_queue_pop_head (&f->messages);
- g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Second");
- dbus_message_unref (incoming);
-}
-
-/* An arbitrary number of messages */
-#define MANY 8192
-
-static void
-test_limit (Fixture *f,
- gconstpointer data)
-{
- DBusMessage *incoming;
- guint i;
-
- test_connect (f, data);
-
- /* This was an attempt to reproduce fd.o #34393. It didn't work. */
- g_test_bug ("34393");
- dbus_connection_set_max_received_size (f->left_server_conn, 1);
- test_main_context_iterate (f->ctx, TRUE);
-
- for (i = 0; i < MANY; i++)
- {
- gchar *buf = g_strdup_printf ("Message%u", i);
-
- send_one (f, buf);
- g_free (buf);
- }
-
- i = 0;
-
- while (i < MANY)
- {
- while (g_queue_is_empty (&f->messages))
- {
- test_main_context_iterate (f->ctx, TRUE);
- }
-
- while ((incoming = g_queue_pop_head (&f->messages)) != NULL)
- {
- i++;
- dbus_message_unref (incoming);
- }
- }
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer data G_GNUC_UNUSED)
-{
- if (f->left_client_conn != NULL)
- {
- dbus_connection_close (f->left_client_conn);
- dbus_connection_unref (f->left_client_conn);
- f->left_client_conn = NULL;
- }
-
- if (f->right_client_conn != NULL)
- {
- dbus_connection_close (f->right_client_conn);
- dbus_connection_unref (f->right_client_conn);
- f->right_client_conn = NULL;
- }
-
- if (f->left_server_conn != NULL)
- {
- dbus_connection_close (f->left_server_conn);
- dbus_connection_unref (f->left_server_conn);
- f->left_server_conn = NULL;
- }
-
- if (f->right_server_conn != NULL)
- {
- dbus_connection_close (f->right_server_conn);
- dbus_connection_unref (f->right_server_conn);
- f->right_server_conn = NULL;
- }
-
- if (f->server != NULL)
- {
- dbus_server_disconnect (f->server);
- dbus_server_unref (f->server);
- f->server = NULL;
- }
-
- test_main_context_unref (f->ctx);
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
- g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add ("/connect", Fixture, NULL, setup,
- test_connect, teardown);
- g_test_add ("/relay", Fixture, NULL, setup,
- test_relay, teardown);
- g_test_add ("/limit", Fixture, NULL, setup,
- test_limit, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/shell-test.c b/src/3rd_party/dbus-1.7.8/test/shell-test.c
deleted file mode 100644
index d1dc5b5b65..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/shell-test.c
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <dbus/dbus-internals.h>
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-memory.h>
-#include <dbus/dbus-shell.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-
-static dbus_bool_t
-test_command_line (const char *arg1, ...)
-{
- int i, original_argc, shell_argc;
- char **shell_argv;
- char **original_argv;
- char *command_line, *tmp;
- DBusString str;
- DBusList *list = NULL, *node;
- va_list var_args;
- DBusError error;
-
- va_start (var_args, arg1);
- _dbus_list_append (&list, (char *)arg1);
- do
- {
- tmp = va_arg (var_args, char *);
- if (!tmp)
- break;
- _dbus_list_append (&list, tmp);
- } while (tmp);
- va_end (var_args);
-
- original_argc = _dbus_list_get_length (&list);
- original_argv = dbus_new (char *, original_argc);
- _dbus_string_init (&str);
- for (i = 0, node = _dbus_list_get_first_link (&list); i < original_argc && node;
- i++, node = _dbus_list_get_next_link (&list, node))
- {
- original_argv[i] = node->data;
- if (i > 0)
- _dbus_string_append_byte (&str, ' ');
- _dbus_string_append (&str, original_argv[i]);
- }
-
- _dbus_list_clear (&list);
- command_line = _dbus_string_get_data (&str);
- printf ("\n\nTesting command line '%s'\n", command_line);
-
- dbus_error_init (&error);
- if (!_dbus_shell_parse_argv (command_line, &shell_argc, &shell_argv, &error))
- {
- fprintf (stderr, "Error parsing command line: %s\n", error.message ? error.message : "");
- return FALSE;
- }
- else
- {
- if (shell_argc != original_argc)
- {
- printf ("Number of arguments returned (%d) don't match original (%d)\n",
- shell_argc, original_argc);
- return FALSE;
- }
- printf ("Number of arguments: %d\n", shell_argc);
- for (i = 0; i < shell_argc; i++)
- {
- char *unquoted;
-
- unquoted = _dbus_shell_unquote (original_argv[i]);
- if (strcmp (unquoted ? unquoted : "",
- shell_argv[i] ? shell_argv[i] : ""))
- {
- printf ("Position %d, returned argument (%s) does not match original (%s)\n",
- i, shell_argv[i], unquoted);
- dbus_free (unquoted);
- return FALSE;
- }
- dbus_free (unquoted);
- if (shell_argv[i])
- printf ("Argument %d = %s\n", i, shell_argv[i]);
- }
-
- dbus_free_string_array (shell_argv);
- }
-
- _dbus_string_free (&str);
-
- return TRUE;
-}
-
-int
-main (int argc, char **argv)
-{
- if (!test_command_line ("command", "-s", "--force-shutdown", "\"a string\"", "123", NULL)
- || !test_command_line ("command", "-s", NULL)
- || !test_command_line ("/opt/gnome/bin/service-start", NULL)
- || !test_command_line ("grep", "-l", "-r", "-i", "'whatever'", "files*.c", NULL)
- || !test_command_line ("/home/boston/johnp/devel-local/dbus/test/test-segfault", NULL)
- || !test_command_line ("ls", "-l", "-a", "--colors", _dbus_get_tmpdir(), NULL)
- || !test_command_line ("rsync-to-server", NULL)
- || !test_command_line ("test-segfault", "--no-segfault", NULL)
- || !test_command_line ("evolution", "mailto:pepe@cuco.com", NULL)
- || !test_command_line ("run", "\"a \n multiline\"", NULL)
- || test_command_line ("ls", "\"a wrong string'", NULL) /* invalid command line */ )
- return -1;
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/spawn-test.c b/src/3rd_party/dbus-1.7.8/test/spawn-test.c
deleted file mode 100644
index 723a4889af..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/spawn-test.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <config.h>
-#include <dbus/dbus.h>
-
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-spawn.h>
-#include <stdio.h>
-
-static void
-setup_func (void *data)
-{
- printf ("entering setup func.\n");
-}
-
-int
-main (int argc, char **argv)
-{
- char **argv_copy;
- int i;
- DBusError error;
-
- if (argc < 2)
- {
- fprintf (stderr, "You need to specify a program to launch.\n");
-
- return -1;
- }
-
- argv_copy = dbus_new (char *, argc);
- for (i = 0; i < argc - 1; i++)
- argv_copy [i] = argv[i + 1];
- argv_copy[argc - 1] = NULL;
-
- if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy[0], argv_copy, NULL, setup_func, NULL, &error))
- {
- fprintf (stderr, "Could not launch application: \"%s\"\n",
- error.message);
- }
-
- dbus_free(argv_copy);
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/syntax.c b/src/3rd_party/dbus-1.7.8/test/syntax.c
deleted file mode 100644
index e26b364344..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/syntax.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/* Simple sanity-check for D-Bus syntax validation.
- *
- * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
- *
- * 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.
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include <dbus/dbus.h>
-
-typedef struct {
- DBusError e;
-} Fixture;
-
-typedef struct {
- dbus_bool_t (*function) (const char *, DBusError *);
- const char * const * valid;
- const char * const * invalid;
-} Test;
-
-Test paths, interfaces, members, errors, bus_names, signatures,
- single_signatures, strings;
-
-const char * const valid_paths[] = {
- "/",
- "/a",
- "/_",
- "/a/b/c",
- "/com/example/123",
- "/org/freedesktop/DBus",
- "/org/freedesktop/Telepathy/AccountManager",
- NULL
-};
-
-const char * const invalid_paths[] = {
- "",
- ".",
- "//",
- "/a/",
- "/-",
- "/com//example/MyApp",
- "/$",
- "/\xa9", /* © in latin-1 */
- "/\xc2\xa9", /* © in UTF-8 */
- NULL
-};
-
-const char * const valid_interfaces[] = {
- "com.example",
- "com.example.a0",
- "org.freedesktop.DBus",
- NULL
-};
-
-const char * const invalid_interfaces[] = {
- "",
- "com",
- "com.example.",
- "com.example..a0",
- "com.example.0a",
- "com.example.a$",
- "com.example.a\xa9",
- "com.example.a\xc2\xa9",
- NULL
-};
-
-const char * const valid_members[] = {
- "_",
- "a",
- "a0",
- "GetAll",
- "BadgerMushroomSnake",
- NULL
-};
-
-const char * const invalid_members[] = {
- "",
- "-",
- "a-",
- "0",
- "0_",
- "Badger.Mushroom",
- "a$",
- "a\xa9",
- "a\xc2\xa9",
- NULL
-};
-
-const char * const valid_errors[] = {
- "com.example",
- "com.example.a0",
- "org.freedesktop.DBus.NameHasNoOwner",
- NULL
-};
-
-const char * const invalid_errors[] = {
- "",
- "com",
- "com.example.",
- "com.example..a0",
- "com.example.0a",
- "com.example.a$",
- "com.example.a\xa9",
- "com.example.a\xc2\xa9",
- NULL
-};
-
-const char * const valid_bus_names[] = {
- "com.example",
- "com.example.a0",
- "com.example._",
- ":1.42",
- ":1.2.3.4.5",
- ":com.example",
- "org.freedesktop.DBus",
- NULL
-};
-
-const char * const invalid_bus_names[] = {
- "",
- "com",
- "com.example.",
- "com.example..a0",
- "com.example.0a",
- "com.example.a:b",
- "com.example.a\xa9",
- "com.example.a\xc2\xa9",
- NULL
-};
-
-const char * const valid_signatures[] = {
- "",
- "a{sv}",
- NULL
-};
-
-const char * const invalid_signatures[] = {
- "a",
- "a{s_}",
- NULL
-};
-
-const char * const valid_single_signatures[] = {
- "s",
- "a{sv}",
- NULL
-};
-
-const char * const invalid_single_signatures[] = {
- "",
- "a",
- "sv",
- "a{sv}as",
- NULL
-};
-
-const char * const valid_strings[] = {
- "",
- "\xc2\xa9", /* UTF-8 (c) symbol */
- "\xef\xbf\xbe", /* U+FFFE is reserved but Corrigendum 9 says it's OK */
- NULL
-};
-
-const char * const invalid_strings[] = {
- "\xa9", /* Latin-1 (c) symbol */
- "\xed\xa0\x80", /* UTF-16 surrogates are not valid in UTF-8 */
- NULL
-};
-
-static void
-setup (Fixture *f,
- gconstpointer arg G_GNUC_UNUSED)
-{
- dbus_error_init (&f->e);
-
-#define FILL_TEST(name, func) \
- do { \
- (name).function = (func); \
- (name).valid = valid_ ## name; \
- (name).invalid = invalid_ ## name; \
- } while (0)
-
- FILL_TEST (paths, dbus_validate_path);
- FILL_TEST (interfaces, dbus_validate_interface);
- FILL_TEST (members, dbus_validate_member);
- FILL_TEST (errors, dbus_validate_error_name);
- FILL_TEST (bus_names, dbus_validate_bus_name);
- FILL_TEST (signatures, dbus_signature_validate);
- FILL_TEST (single_signatures, dbus_signature_validate_single);
- FILL_TEST (strings, dbus_validate_utf8);
-}
-
-static void
-test_syntax (Fixture *f,
- gconstpointer arg)
-{
- const Test *test = arg;
- int i;
-
- g_assert (test != NULL);
- g_assert (test->function != NULL);
- g_assert (test->valid != NULL);
- g_assert (test->invalid != NULL);
-
- for (i = 0; test->valid[i] != NULL; i++)
- {
- dbus_bool_t ok = test->function (test->valid[i], &f->e);
-
- if (dbus_error_is_set (&f->e))
- g_error ("%s was considered invalid: %s: %s", test->valid[i],
- f->e.name, f->e.message);
-
- if (!ok)
- g_error ("%s was considered invalid without an error", test->valid[i]);
- }
-
- for (i = 0; test->invalid[i] != NULL; i++)
- {
- dbus_bool_t ok = test->function (test->invalid[i], &f->e);
-
- if (ok)
- g_error ("%s should have been considered invalid", test->invalid[i]);
-
- if (!dbus_error_is_set (&f->e))
- g_error ("%s should have an error set", test->invalid[i]);
-
- if (!dbus_validate_error_name (f->e.name, NULL))
- g_error ("%s produced an invalid error name: %s",
- test->invalid[i], f->e.name);
-
- if (!dbus_validate_utf8 (f->e.message, NULL))
- g_error ("%s produced an invalid error message: %s",
- test->invalid[i], f->e.message);
-
- dbus_error_free (&f->e);
- }
-}
-
-static void
-teardown (Fixture *f,
- gconstpointer arg G_GNUC_UNUSED)
-{
- dbus_error_free (&f->e);
-}
-
-int
-main (int argc,
- char **argv)
-{
- g_test_init (&argc, &argv, NULL);
-
- g_test_add ("/syntax/path", Fixture, &paths, setup, test_syntax, teardown);
- g_test_add ("/syntax/interface", Fixture, &interfaces,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/error", Fixture, &errors,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/member", Fixture, &members,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/bus-name", Fixture, &bus_names,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/signature", Fixture, &signatures,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/single-signature", Fixture, &single_signatures,
- setup, test_syntax, teardown);
- g_test_add ("/syntax/utf8", Fixture, &strings,
- setup, test_syntax, teardown);
-
- return g_test_run ();
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-exit.c b/src/3rd_party/dbus-1.7.8/test/test-exit.c
deleted file mode 100644
index b4f967ae46..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-exit.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "config.h"
-
-/* This is a process that just exits with a failure code */
-int
-main (int argc, char **argv)
-{
-
- return 1;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-names.c b/src/3rd_party/dbus-1.7.8/test/test-names.c
deleted file mode 100644
index 2736635085..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-names.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <config.h>
-#include "test-utils.h"
-
-static DBusLoop *loop;
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** test-names: %s", message);
- exit (1);
-}
-
-static void
-TestName(DBusConnection *connection, const char *name, int expectedSuccess)
-{
- DBusError error;
- dbus_error_init (&error);
-
- (void) dbus_bus_request_name (connection, name, 0, &error);
- if (dbus_error_is_set (&error))
- {
- if (expectedSuccess)
- fprintf (stderr, "Error acquiring name '%s': %s\n", name, error.message);
- else
- fprintf (stdout, "Expected Error acquiring name '%s': %s\n", name, error.message);
- _dbus_verbose ("*** Failed to acquire name '%s': %s\n", name,
- error.message);
- dbus_error_free (&error);
- if (expectedSuccess)
- exit (1);
- }
- else
- {
- if (!expectedSuccess)
- fprintf (stderr, "Unexpected Success acquiring name '%s'\n", name);
- else
- fprintf (stdout, "Successfully acquired name '%s'\n", name);
- _dbus_verbose ("*** Managed to acquire name '%s'\n", name);
- if (!expectedSuccess)
- exit (1);
- }
-}
-
-int
-main (int argc,
- char **argv)
-{
- DBusError error;
- DBusConnection *connection;
-
- dbus_error_init (&error);
- connection = dbus_bus_get (DBUS_BUS_SESSION, &error);
- if (connection == NULL)
- {
- fprintf (stderr, "*** Failed to open connection to system bus: %s\n",
- error.message);
- dbus_error_free (&error);
- return 1;
- }
-
- loop = _dbus_loop_new ();
- if (loop == NULL)
- die ("No memory\n");
-
- if (!test_connection_setup (loop, connection))
- die ("No memory\n");
-
- TestName(connection, "org.freedesktop.DBus.Test", TRUE);
- TestName(connection, "org.freedesktop.DBus.Test-2", TRUE);
- TestName(connection, "org.freedesktop.DBus.Test_2", TRUE);
-#if 0
- TestName(connection, "Test_2", TRUE);
-#endif
-
- _dbus_verbose ("*** Test service name exiting\n");
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-segfault.c b/src/3rd_party/dbus-1.7.8/test/test-segfault.c
deleted file mode 100644
index 329a21fd08..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-segfault.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This is simply a process that segfaults */
-#include <config.h>
-#include <stdlib.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_SETRLIMIT
-#include <sys/resource.h>
-#endif
-
-int
-main (int argc, char **argv)
-{
- char *p;
-
-#if HAVE_SETRLIMIT
- struct rlimit r = { 0, };
-
- getrlimit (RLIMIT_CORE, &r);
- r.rlim_cur = 0;
- setrlimit (RLIMIT_CORE, &r);
-
- raise (SIGSEGV);
-#endif
- p = NULL;
- *p = 'a';
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-service.c b/src/3rd_party/dbus-1.7.8/test/test-service.c
deleted file mode 100644
index 7181fa38c4..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-service.c
+++ /dev/null
@@ -1,505 +0,0 @@
-#include <config.h>
-
-#include "test-utils.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-static DBusLoop *loop;
-static dbus_bool_t already_quit = FALSE;
-static dbus_bool_t hello_from_self_reply_received = FALSE;
-
-static void
-quit (void)
-{
- if (!already_quit)
- {
- _dbus_loop_quit (loop);
- already_quit = TRUE;
- }
-}
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** test-service: %s", message);
- exit (1);
-}
-
-static void
-check_hello_from_self_reply (DBusPendingCall *pcall,
- void *user_data)
-{
- DBusMessage *reply;
- DBusMessage *echo_message, *echo_reply = NULL;
- DBusError error;
- DBusConnection *connection;
-
- int type;
-
- dbus_error_init (&error);
-
- connection = dbus_bus_get (DBUS_BUS_STARTER, &error);
- if (connection == NULL)
- {
- fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n",
- error.message);
- dbus_error_free (&error);
- die("no memory");
- }
-
-
- echo_message = (DBusMessage *)user_data;
-
- reply = dbus_pending_call_steal_reply (pcall);
-
- type = dbus_message_get_type (reply);
-
- if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- const char *s;
- printf ("Reply from HelloFromSelf received\n");
-
- if (!dbus_message_get_args (echo_message,
- &error,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- {
- echo_reply = dbus_message_new_error (echo_message,
- error.name,
- error.message);
-
- if (echo_reply == NULL)
- die ("No memory\n");
-
- }
- else
- {
- echo_reply = dbus_message_new_method_return (echo_message);
- if (echo_reply == NULL)
- die ("No memory\n");
-
- if (!dbus_message_append_args (echo_reply,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- die ("No memory");
- }
-
- if (!dbus_connection_send (connection, echo_reply, NULL))
- die ("No memory\n");
-
- dbus_message_unref (echo_reply);
- }
- else if (type == DBUS_MESSAGE_TYPE_ERROR)
- {
- dbus_set_error_from_message (&error, reply);
- printf ("Error type in reply: %s\n", error.message);
-
- if (strcmp (error.name, DBUS_ERROR_NO_MEMORY) != 0)
- {
- echo_reply = dbus_message_new_error (echo_reply,
- error.name,
- error.message);
-
- if (echo_reply == NULL)
- die ("No memory\n");
-
- if (!dbus_connection_send (connection, echo_reply, NULL))
- die ("No memory\n");
-
- dbus_message_unref (echo_reply);
- }
- dbus_error_free (&error);
- }
- else
- _dbus_assert_not_reached ("Unexpected message received\n");
-
- hello_from_self_reply_received = TRUE;
-
- dbus_message_unref (reply);
- dbus_message_unref (echo_message);
- dbus_pending_call_unref (pcall);
- dbus_connection_unref (connection);
-}
-
-static DBusHandlerResult
-handle_run_hello_from_self (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusError error;
- DBusMessage *reply, *self_message;
- DBusPendingCall *pcall;
- char *s;
-
- _dbus_verbose ("sending reply to Echo method\n");
-
- dbus_error_init (&error);
-
- if (!dbus_message_get_args (message,
- &error,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- {
- reply = dbus_message_new_error (message,
- error.name,
- error.message);
-
- if (reply == NULL)
- die ("No memory\n");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
- printf ("Sending HelloFromSelf\n");
-
- _dbus_verbose ("*** Sending message to self\n");
- self_message = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuiteEchoService",
- "/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "HelloFromSelf");
-
- if (self_message == NULL)
- die ("No memory");
-
- if (!dbus_connection_send_with_reply (connection, self_message, &pcall, -1))
- die("No memory");
-
- dbus_message_ref (message);
- if (!dbus_pending_call_set_notify (pcall, check_hello_from_self_reply, (void *)message, NULL))
- die("No memory");
-
- printf ("Sent HelloFromSelf\n");
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static DBusHandlerResult
-handle_echo (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusError error;
- DBusMessage *reply;
- char *s;
-
- _dbus_verbose ("sending reply to Echo method\n");
-
- dbus_error_init (&error);
-
- if (!dbus_message_get_args (message,
- &error,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- {
- reply = dbus_message_new_error (message,
- error.name,
- error.message);
-
- if (reply == NULL)
- die ("No memory\n");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- die ("No memory\n");
-
- if (!dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- die ("No memory");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- fprintf (stderr, "Echo service echoed string: \"%s\"\n", s);
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static DBusHandlerResult
-handle_delay_echo (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusError error;
- DBusMessage *reply;
- char *s;
-
- _dbus_verbose ("sleeping for a short time\n");
-
- _dbus_sleep_milliseconds (50);
-
- _dbus_verbose ("sending reply to DelayEcho method\n");
-
- dbus_error_init (&error);
-
- if (!dbus_message_get_args (message,
- &error,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- {
- reply = dbus_message_new_error (message,
- error.name,
- error.message);
-
- if (reply == NULL)
- die ("No memory\n");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- die ("No memory\n");
-
- if (!dbus_message_append_args (reply,
- DBUS_TYPE_STRING, &s,
- DBUS_TYPE_INVALID))
- die ("No memory");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- fprintf (stderr, "DelayEcho service echoed string: \"%s\"\n", s);
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-
-static void
-path_unregistered_func (DBusConnection *connection,
- void *user_data)
-{
- /* connection was finalized */
-}
-
-static DBusHandlerResult
-path_message_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "Echo"))
- return handle_echo (connection, message);
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "DelayEcho"))
- return handle_delay_echo (connection, message);
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "Exit"))
- {
- quit ();
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "EmitFoo"))
- {
- /* Emit the Foo signal */
- DBusMessage *signal;
- double v_DOUBLE;
-
- _dbus_verbose ("emitting signal Foo\n");
-
- signal = dbus_message_new_signal ("/org/freedesktop/TestSuite",
- "org.freedesktop.TestSuite",
- "Foo");
- if (signal == NULL)
- die ("No memory\n");
-
- v_DOUBLE = 42.6;
- if (!dbus_message_append_args (signal,
- DBUS_TYPE_DOUBLE, &v_DOUBLE,
- DBUS_TYPE_INVALID))
- die ("No memory");
-
- if (!dbus_connection_send (connection, signal, NULL))
- die ("No memory\n");
-
- return DBUS_HANDLER_RESULT_HANDLED;
- }
-
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "RunHelloFromSelf"))
- {
- return handle_run_hello_from_self (connection, message);
- }
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "HelloFromSelf"))
- {
- DBusMessage *reply;
- printf ("Received the HelloFromSelf message\n");
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- die ("No memory");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory");
-
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static DBusObjectPathVTable
-echo_vtable = {
- path_unregistered_func,
- path_message_func,
- NULL,
-};
-
-
-static const char* echo_path = "/org/freedesktop/TestSuite" ;
-
-static DBusHandlerResult
-filter_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- {
- quit ();
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else
- {
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-}
-
-int
-main (int argc,
- char **argv)
-{
- DBusError error;
- int result;
- DBusConnection *connection;
- const char *name;
- dbus_bool_t do_fork;
-
- if (argc != 3)
- {
- name = "org.freedesktop.DBus.TestSuiteEchoService";
- do_fork = FALSE;
- }
- else
- {
- name = argv[1];
-#ifndef DBUS_WIN
- do_fork = strcmp (argv[2], "fork") == 0;
-#else
- do_fork = FALSE;
-#endif
- }
-
- /* The bare minimum for simulating a program "daemonizing"; the intent
- * is to test services which move from being legacy init scripts to
- * activated services.
- * https://bugzilla.redhat.com/show_bug.cgi?id=545267
- */
-#ifndef DBUS_WIN
- if (do_fork)
- {
- pid_t pid = fork ();
- if (pid != 0)
- exit (0);
- sleep (1);
- }
-#endif
-
- dbus_error_init (&error);
- connection = dbus_bus_get (DBUS_BUS_STARTER, &error);
- if (connection == NULL)
- {
- fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n",
- error.message);
- dbus_error_free (&error);
- return 1;
- }
-
- loop = _dbus_loop_new ();
- if (loop == NULL)
- die ("No memory\n");
-
- if (!test_connection_setup (loop, connection))
- die ("No memory\n");
-
- if (!dbus_connection_add_filter (connection,
- filter_func, NULL, NULL))
- die ("No memory");
-
- if (!dbus_connection_register_object_path (connection,
- echo_path,
- &echo_vtable,
- (void*) 0xdeadbeef))
- die ("No memory");
-
- {
- void *d;
- if (!dbus_connection_get_object_path_data (connection, echo_path, &d))
- die ("No memory");
- if (d != (void*) 0xdeadbeef)
- die ("dbus_connection_get_object_path_data() doesn't seem to work right\n");
- }
-
- result = dbus_bus_request_name (connection, name,
- 0, &error);
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "Error %s\n", error.message);
- _dbus_verbose ("*** Failed to acquire service: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
- {
- fprintf (stderr, "Unable to acquire service: code %d\n", result);
- _dbus_verbose ("*** Failed to acquire service: %d\n", result);
- exit (1);
- }
-
- _dbus_verbose ("*** Test service entering main loop\n");
- _dbus_loop_run (loop);
-
- test_connection_shutdown (loop, connection);
-
- dbus_connection_remove_filter (connection, filter_func, NULL);
-
- dbus_connection_unref (connection);
-
- _dbus_loop_unref (loop);
- loop = NULL;
-
- dbus_shutdown ();
-
- _dbus_verbose ("*** Test service exiting\n");
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-shell-service.c b/src/3rd_party/dbus-1.7.8/test/test-shell-service.c
deleted file mode 100644
index 32a883296e..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-shell-service.c
+++ /dev/null
@@ -1,203 +0,0 @@
-#include <config.h>
-
-#include "test-utils.h"
-
-static DBusLoop *loop;
-static dbus_bool_t already_quit = FALSE;
-static const char* echo_path = "/org/freedesktop/TestSuite";
-
-typedef struct
-{
- int argc;
- char **argv;
-} EchoData;
-
-static void
-quit (void)
-{
- if (!already_quit)
- {
- _dbus_loop_quit (loop);
- already_quit = TRUE;
- }
-}
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** test-service: %s", message);
- exit (1);
-}
-
-static DBusHandlerResult
-handle_echo (DBusConnection *connection,
- DBusMessage *message)
-{
- DBusError error;
- DBusMessage *reply;
- DBusMessageIter iter;
- int i;
- EchoData *d;
-
- _dbus_verbose ("sending reply to Echo method\n");
-
- if (!dbus_connection_get_object_path_data (connection, echo_path, (void **)&d))
- die ("No memory");
-
-
- dbus_error_init (&error);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- die ("No memory\n");
-
- dbus_message_iter_init_append (reply, &iter);
- for (i = 0; i < d->argc; ++i)
- if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &(d->argv[i])))
- die ("No memory\n");
-
- if (!dbus_connection_send (connection, reply, NULL))
- die ("No memory\n");
-
- fprintf (stderr, "Shell echo service echoed the command line\n");
-
- dbus_message_unref (reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void
-path_unregistered_func (DBusConnection *connection,
- void *user_data)
-{
- /* connection was finalized */
-}
-
-static DBusHandlerResult
-path_message_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "Echo"))
- return handle_echo (connection, message);
- else if (dbus_message_is_method_call (message,
- "org.freedesktop.TestSuite",
- "Exit"))
- {
- quit ();
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static DBusObjectPathVTable
-echo_vtable = {
- path_unregistered_func,
- path_message_func,
- NULL,
-};
-
-static DBusHandlerResult
-filter_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- {
- quit ();
- return DBUS_HANDLER_RESULT_HANDLED;
- }
- else
- {
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-}
-
-int
-main (int argc,
- char **argv)
-{
- DBusConnection *connection;
- DBusError error;
- EchoData echo_data;
- int result;
-
- echo_data.argc = argc;
- echo_data.argv = argv;
-
- dbus_error_init (&error);
- connection = dbus_bus_get (DBUS_BUS_STARTER, &error);
- if (connection == NULL)
- {
- fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n",
- error.message);
- dbus_error_free (&error);
- return 1;
- }
-
- loop = _dbus_loop_new ();
- if (loop == NULL)
- die ("No memory\n");
-
- if (!test_connection_setup (loop, connection))
- die ("No memory\n");
-
- if (!dbus_connection_add_filter (connection,
- filter_func, NULL, NULL))
- die ("No memory");
-
- if (!dbus_connection_register_object_path (connection,
- echo_path,
- &echo_vtable,
- (void*) &echo_data))
- die ("No memory");
-
- {
- void *d;
- if (!dbus_connection_get_object_path_data (connection, echo_path, &d))
- die ("No memory");
- if (d != (void*) &echo_data)
- die ("dbus_connection_get_object_path_data() doesn't seem to work right\n");
- }
-
- result = dbus_bus_request_name (connection, "org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess",
- 0, &error);
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "Error %s\n", error.message);
- _dbus_verbose ("*** Failed to acquire service: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
- {
- fprintf (stderr, "Unable to acquire service: code %d\n", result);
- _dbus_verbose ("*** Failed to acquire service: %d\n", result);
- exit (1);
- }
-
- _dbus_verbose ("*** Test service entering main loop\n");
- _dbus_loop_run (loop);
-
- test_connection_shutdown (loop, connection);
-
- dbus_connection_remove_filter (connection, filter_func, NULL);
-
- dbus_connection_unref (connection);
-
- _dbus_loop_unref (loop);
- loop = NULL;
-
- dbus_shutdown ();
-
- _dbus_verbose ("*** Test service exiting\n");
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-sleep-forever.c b/src/3rd_party/dbus-1.7.8/test/test-sleep-forever.c
deleted file mode 100644
index d54769abca..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-sleep-forever.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This is a process that just sleeps infinitely. */
-
-#include <config.h>
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef DBUS_WIN
-# include <windows.h>
-# define sleep Sleep
-#endif
-
-
-int
-main (int argc, char **argv)
-{
- while (1)
- sleep (10000000);
-
- return 1;
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-utils.c b/src/3rd_party/dbus-1.7.8/test/test-utils.c
deleted file mode 100644
index 9a4f358458..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-utils.c
+++ /dev/null
@@ -1,392 +0,0 @@
-#include <config.h>
-#include "test-utils.h"
-
-#ifndef DBUS_TEST_USE_INTERNAL
-# include <dbus/dbus.h>
-# include <dbus/dbus-glib-lowlevel.h>
-#endif
-
-#ifdef DBUS_TEST_USE_INTERNAL
-
-typedef struct
-{
- DBusLoop *loop;
- DBusConnection *connection;
-
-} CData;
-
-static dbus_bool_t
-add_watch (DBusWatch *watch,
- void *data)
-{
- CData *cd = data;
-
- return _dbus_loop_add_watch (cd->loop, watch);
-}
-
-static void
-remove_watch (DBusWatch *watch,
- void *data)
-{
- CData *cd = data;
-
- _dbus_loop_remove_watch (cd->loop, watch);
-}
-
-static void
-toggle_watch (DBusWatch *watch,
- void *data)
-{
- CData *cd = data;
-
- _dbus_loop_toggle_watch (cd->loop, watch);
-}
-
-static dbus_bool_t
-add_timeout (DBusTimeout *timeout,
- void *data)
-{
- CData *cd = data;
-
- return _dbus_loop_add_timeout (cd->loop, timeout);
-}
-
-static void
-remove_timeout (DBusTimeout *timeout,
- void *data)
-{
- CData *cd = data;
-
- _dbus_loop_remove_timeout (cd->loop, timeout);
-}
-
-static void
-dispatch_status_function (DBusConnection *connection,
- DBusDispatchStatus new_status,
- void *data)
-{
- DBusLoop *loop = data;
-
- if (new_status != DBUS_DISPATCH_COMPLETE)
- {
- while (!_dbus_loop_queue_dispatch (loop, connection))
- _dbus_wait_for_memory ();
- }
-}
-
-static void
-cdata_free (void *data)
-{
- CData *cd = data;
-
- dbus_connection_unref (cd->connection);
- _dbus_loop_unref (cd->loop);
-
- dbus_free (cd);
-}
-
-static CData*
-cdata_new (DBusLoop *loop,
- DBusConnection *connection)
-{
- CData *cd;
-
- cd = dbus_new0 (CData, 1);
- if (cd == NULL)
- return NULL;
-
- cd->loop = loop;
- cd->connection = connection;
-
- dbus_connection_ref (cd->connection);
- _dbus_loop_ref (cd->loop);
-
- return cd;
-}
-
-#endif /* DBUS_TEST_USE_INTERNAL */
-
-dbus_bool_t
-test_connection_setup (TestMainContext *ctx,
- DBusConnection *connection)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- DBusLoop *loop = ctx;
- CData *cd;
-
- cd = NULL;
-
- dbus_connection_set_dispatch_status_function (connection, dispatch_status_function,
- loop, NULL);
-
- cd = cdata_new (loop, connection);
- if (cd == NULL)
- goto nomem;
-
- if (!dbus_connection_set_watch_functions (connection,
- add_watch,
- remove_watch,
- toggle_watch,
- cd, cdata_free))
- goto nomem;
-
-
- cd = cdata_new (loop, connection);
- if (cd == NULL)
- goto nomem;
-
- if (!dbus_connection_set_timeout_functions (connection,
- add_timeout,
- remove_timeout,
- NULL,
- cd, cdata_free))
- goto nomem;
-
- if (dbus_connection_get_dispatch_status (connection) != DBUS_DISPATCH_COMPLETE)
- {
- if (!_dbus_loop_queue_dispatch (loop, connection))
- goto nomem;
- }
-
- return TRUE;
-
- nomem:
- if (cd)
- cdata_free (cd);
-
- dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL);
- dbus_connection_set_watch_functions (connection, NULL, NULL, NULL, NULL, NULL);
- dbus_connection_set_timeout_functions (connection, NULL, NULL, NULL, NULL, NULL);
-
- return FALSE;
-#else /* !DBUS_TEST_USE_INTERNAL */
-
- dbus_connection_setup_with_g_main (connection, ctx);
- return TRUE;
-
-#endif /* !DBUS_TEST_USE_INTERNAL */
-}
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "*** %s", message);
- exit (1);
-}
-
-void
-test_connection_shutdown (TestMainContext *ctx,
- DBusConnection *connection)
-{
- if (!dbus_connection_set_watch_functions (connection,
- NULL,
- NULL,
- NULL,
- NULL, NULL))
- die ("setting watch functions to NULL failed");
-
- if (!dbus_connection_set_timeout_functions (connection,
- NULL,
- NULL,
- NULL,
- NULL, NULL))
- die ("setting timeout functions to NULL failed");
-
- dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL);
-}
-
-#ifdef DBUS_TEST_USE_INTERNAL
-
-typedef struct
-{
- DBusLoop *loop;
- DBusServer *server;
-} ServerData;
-
-static void
-serverdata_free (void *data)
-{
- ServerData *sd = data;
-
- dbus_server_unref (sd->server);
- _dbus_loop_unref (sd->loop);
-
- dbus_free (sd);
-}
-
-static ServerData*
-serverdata_new (DBusLoop *loop,
- DBusServer *server)
-{
- ServerData *sd;
-
- sd = dbus_new0 (ServerData, 1);
- if (sd == NULL)
- return NULL;
-
- sd->loop = loop;
- sd->server = server;
-
- dbus_server_ref (sd->server);
- _dbus_loop_ref (sd->loop);
-
- return sd;
-}
-
-static dbus_bool_t
-add_server_watch (DBusWatch *watch,
- void *data)
-{
- ServerData *context = data;
-
- return _dbus_loop_add_watch (context->loop, watch);
-}
-
-static void
-toggle_server_watch (DBusWatch *watch,
- void *data)
-{
- ServerData *context = data;
-
- _dbus_loop_toggle_watch (context->loop, watch);
-}
-
-static void
-remove_server_watch (DBusWatch *watch,
- void *data)
-{
- ServerData *context = data;
-
- _dbus_loop_remove_watch (context->loop, watch);
-}
-
-static dbus_bool_t
-add_server_timeout (DBusTimeout *timeout,
- void *data)
-{
- ServerData *context = data;
-
- return _dbus_loop_add_timeout (context->loop, timeout);
-}
-
-static void
-remove_server_timeout (DBusTimeout *timeout,
- void *data)
-{
- ServerData *context = data;
-
- _dbus_loop_remove_timeout (context->loop, timeout);
-}
-
-#endif /* DBUS_TEST_USE_INTERNAL */
-
-dbus_bool_t
-test_server_setup (TestMainContext *ctx,
- DBusServer *server)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- DBusLoop *loop = ctx;
- ServerData *sd;
-
- sd = serverdata_new (loop, server);
- if (sd == NULL)
- goto nomem;
-
- if (!dbus_server_set_watch_functions (server,
- add_server_watch,
- remove_server_watch,
- toggle_server_watch,
- sd,
- serverdata_free))
- {
- goto nomem;
- }
-
- sd = serverdata_new (loop, server);
- if (sd == NULL)
- goto nomem;
-
- if (!dbus_server_set_timeout_functions (server,
- add_server_timeout,
- remove_server_timeout,
- NULL,
- sd, serverdata_free))
- {
- goto nomem;
- }
- return TRUE;
-
- nomem:
- if (sd)
- serverdata_free (sd);
-
- test_server_shutdown (loop, server);
-
- return FALSE;
-
-#else /* !DBUS_TEST_USE_INTERNAL */
-
- dbus_server_setup_with_g_main (server, ctx);
- return TRUE;
-
-#endif /* !DBUS_TEST_USE_INTERNAL */
-}
-
-void
-test_server_shutdown (TestMainContext *ctx,
- DBusServer *server)
-{
- dbus_server_disconnect (server);
-
- if (!dbus_server_set_watch_functions (server,
- NULL, NULL, NULL,
- NULL,
- NULL))
- die ("setting watch functions to NULL failed");
-
- if (!dbus_server_set_timeout_functions (server,
- NULL, NULL, NULL,
- NULL,
- NULL))
- die ("setting timeout functions to NULL failed");
-}
-
-TestMainContext *
-test_main_context_get (void)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- return _dbus_loop_new ();
-#else
- /* I suspect dbus-glib relies the default main context in some places */
- return g_main_context_ref (g_main_context_default ());
-#endif
-}
-
-TestMainContext *
-test_main_context_ref (TestMainContext *ctx)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- return _dbus_loop_ref (ctx);
-#else
- return g_main_context_ref (ctx);
-#endif
-}
-
-void test_main_context_unref (TestMainContext *ctx)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- _dbus_loop_unref (ctx);
-#else
- g_main_context_unref (ctx);
-#endif
-}
-
-void test_main_context_iterate (TestMainContext *ctx,
- dbus_bool_t may_block)
-{
-#ifdef DBUS_TEST_USE_INTERNAL
- _dbus_loop_iterate (ctx, may_block);
-#else
- g_main_context_iteration (ctx, may_block);
-#endif
-}
diff --git a/src/3rd_party/dbus-1.7.8/test/test-utils.h b/src/3rd_party/dbus-1.7.8/test/test-utils.h
deleted file mode 100644
index 0d3f369042..0000000000
--- a/src/3rd_party/dbus-1.7.8/test/test-utils.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef TEST_UTILS_H
-#define TEST_UTILS_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <dbus/dbus.h>
-
-#ifdef DBUS_TEST_USE_INTERNAL
-
-# include <dbus/dbus-mainloop.h>
-# include <dbus/dbus-internals.h>
- typedef DBusLoop TestMainContext;
-
-#else /* !DBUS_TEST_USE_INTERNAL */
-
-# include <glib.h>
- typedef GMainContext TestMainContext;
-
-#endif /* !DBUS_TEST_USE_INTERNAL */
-
-TestMainContext *test_main_context_get (void);
-TestMainContext *test_main_context_ref (TestMainContext *ctx);
-void test_main_context_unref (TestMainContext *ctx);
-void test_main_context_iterate (TestMainContext *ctx,
- dbus_bool_t may_block);
-
-dbus_bool_t test_connection_setup (TestMainContext *ctx,
- DBusConnection *connection);
-void test_connection_shutdown (TestMainContext *ctx,
- DBusConnection *connection);
-
-dbus_bool_t test_server_setup (TestMainContext *ctx,
- DBusServer *server);
-void test_server_shutdown (TestMainContext *ctx,
- DBusServer *server);
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/tools/Makefile.am b/src/3rd_party/dbus-1.7.8/tools/Makefile.am
deleted file mode 100644
index 73d95fcfce..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/Makefile.am
+++ /dev/null
@@ -1,88 +0,0 @@
-configdir=$(sysconfdir)/dbus-1
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(DBUS_STATIC_BUILD_CPPFLAGS) \
- $(DBUS_X_CFLAGS) \
- -DDBUS_COMPILATION \
- -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
- $(NULL)
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-
-bin_PROGRAMS = \
- dbus-launch \
- dbus-monitor \
- dbus-send \
- $(NULL)
-
-if DBUS_UNIX
-bin_PROGRAMS += \
- dbus-cleanup-sockets \
- dbus-run-session \
- dbus-uuidgen \
- $(NULL)
-endif
-
-dbus_send_SOURCES= \
- dbus-print-message.c \
- dbus-print-message.h \
- dbus-send.c
-
-dbus_monitor_SOURCES= \
- dbus-monitor.c \
- dbus-print-message.c \
- dbus-print-message.h
-
-if DBUS_WIN
-dbus_launch_SOURCES= \
- dbus-launch-win.c \
- dbus-launch.h
-else
-dbus_launch_SOURCES= \
- dbus-launch.c \
- dbus-launch-x11.c \
- dbus-launch.h
-
-dbus_run_session_SOURCES = \
- dbus-run-session.c
-
-dbus_run_session_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NULL)
-endif
-
-dbus_cleanup_sockets_SOURCES= \
- dbus-cleanup-sockets.c
-
-dbus_uuidgen_SOURCES= \
- dbus-uuidgen.c
-
-dbus_send_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NULL)
-
-dbus_monitor_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NETWORK_libs) \
- $(NULL)
-
-dbus_uuidgen_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NULL)
-
-dbus_launch_LDADD = \
- $(DBUS_X_LIBS) \
- $(NULL)
-
-EXTRA_DIST = run-with-tmp-session-bus.sh strtoll.c strtoull.c
-CLEANFILES = \
- run-with-tmp-session-bus.conf
-
-# create the /var/lib/dbus directory for dbus-uuidgen
-install-data-local:
- $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/dbus
-
-installcheck-local:
- test -d $(DESTDIR)$(localstatedir)/lib/dbus
diff --git a/src/3rd_party/dbus-1.7.8/tools/Makefile.in b/src/3rd_party/dbus-1.7.8/tools/Makefile.in
deleted file mode 100644
index db619be6fb..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/Makefile.in
+++ /dev/null
@@ -1,785 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = dbus-launch$(EXEEXT) dbus-monitor$(EXEEXT) \
- dbus-send$(EXEEXT) $(am__EXEEXT_1)
-@DBUS_UNIX_TRUE@am__append_1 = \
-@DBUS_UNIX_TRUE@ dbus-cleanup-sockets \
-@DBUS_UNIX_TRUE@ dbus-run-session \
-@DBUS_UNIX_TRUE@ dbus-uuidgen \
-@DBUS_UNIX_TRUE@ $(NULL)
-
-subdir = tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
- $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
- $(top_srcdir)/m4/tp-compiler-warnings.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-@DBUS_UNIX_TRUE@am__EXEEXT_1 = dbus-cleanup-sockets$(EXEEXT) \
-@DBUS_UNIX_TRUE@ dbus-run-session$(EXEEXT) \
-@DBUS_UNIX_TRUE@ dbus-uuidgen$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_dbus_cleanup_sockets_OBJECTS = dbus-cleanup-sockets.$(OBJEXT)
-dbus_cleanup_sockets_OBJECTS = $(am_dbus_cleanup_sockets_OBJECTS)
-dbus_cleanup_sockets_LDADD = $(LDADD)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__dbus_launch_SOURCES_DIST = dbus-launch.c dbus-launch-x11.c \
- dbus-launch.h dbus-launch-win.c
-@DBUS_WIN_FALSE@am_dbus_launch_OBJECTS = dbus-launch.$(OBJEXT) \
-@DBUS_WIN_FALSE@ dbus-launch-x11.$(OBJEXT)
-@DBUS_WIN_TRUE@am_dbus_launch_OBJECTS = dbus-launch-win.$(OBJEXT)
-dbus_launch_OBJECTS = $(am_dbus_launch_OBJECTS)
-am__DEPENDENCIES_1 =
-dbus_launch_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_dbus_monitor_OBJECTS = dbus-monitor.$(OBJEXT) \
- dbus-print-message.$(OBJEXT)
-dbus_monitor_OBJECTS = $(am_dbus_monitor_OBJECTS)
-dbus_monitor_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
- $(am__DEPENDENCIES_1)
-am__dbus_run_session_SOURCES_DIST = dbus-run-session.c
-@DBUS_WIN_FALSE@am_dbus_run_session_OBJECTS = \
-@DBUS_WIN_FALSE@ dbus-run-session.$(OBJEXT)
-dbus_run_session_OBJECTS = $(am_dbus_run_session_OBJECTS)
-@DBUS_WIN_FALSE@dbus_run_session_DEPENDENCIES = \
-@DBUS_WIN_FALSE@ $(top_builddir)/dbus/libdbus-1.la
-am_dbus_send_OBJECTS = dbus-print-message.$(OBJEXT) \
- dbus-send.$(OBJEXT)
-dbus_send_OBJECTS = $(am_dbus_send_OBJECTS)
-dbus_send_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la
-am_dbus_uuidgen_OBJECTS = dbus-uuidgen.$(OBJEXT)
-dbus_uuidgen_OBJECTS = $(am_dbus_uuidgen_OBJECTS)
-dbus_uuidgen_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(dbus_cleanup_sockets_SOURCES) $(dbus_launch_SOURCES) \
- $(dbus_monitor_SOURCES) $(dbus_run_session_SOURCES) \
- $(dbus_send_SOURCES) $(dbus_uuidgen_SOURCES)
-DIST_SOURCES = $(dbus_cleanup_sockets_SOURCES) \
- $(am__dbus_launch_SOURCES_DIST) $(dbus_monitor_SOURCES) \
- $(am__dbus_run_session_SOURCES_DIST) $(dbus_send_SOURCES) \
- $(dbus_uuidgen_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ADT_LIBS = @ADT_LIBS@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_FILEVERSION = @BUILD_FILEVERSION@
-BUILD_TIMESTAMP = @BUILD_TIMESTAMP@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBUS_BINDIR = @DBUS_BINDIR@
-DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
-DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
-DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
-DBUS_DATADIR = @DBUS_DATADIR@
-DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
-DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
-DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
-DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
-DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
-DBUS_INT64_TYPE = @DBUS_INT64_TYPE@
-DBUS_LIBEXECDIR = @DBUS_LIBEXECDIR@
-DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION@
-DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
-DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
-DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
-DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
-DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
-DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
-DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-DBUS_SYSTEM_SOCKET = @DBUS_SYSTEM_SOCKET@
-DBUS_TEST_DATA = @DBUS_TEST_DATA@
-DBUS_TEST_EXEC = @DBUS_TEST_EXEC@
-DBUS_UINT64_CONSTANT = @DBUS_UINT64_CONSTANT@
-DBUS_USER = @DBUS_USER@
-DBUS_VERSION = @DBUS_VERSION@
-DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
-DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DOXYGEN = @DOXYGEN@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXPANDED_BINDIR = @EXPANDED_BINDIR@
-EXPANDED_DATADIR = @EXPANDED_DATADIR@
-EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
-EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
-EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
-EXPANDED_PREFIX = @EXPANDED_PREFIX@
-EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
-FGREP = @FGREP@
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LAUNCHCTL = @LAUNCHCTL@
-LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBDBUS_LIBS = @LIBDBUS_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NETWORK_libs = @NETWORK_libs@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-RC = @RC@
-R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SED = @SED@
-SELINUX_LIBS = @SELINUX_LIBS@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
-TEST_LISTEN = @TEST_LISTEN@
-TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
-THREAD_LIBS = @THREAD_LIBS@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-XMLTO = @XMLTO@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLTPROC = @XSLTPROC@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-systemdsystemunitdir = @systemdsystemunitdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-configdir = $(sysconfdir)/dbus-1
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(DBUS_STATIC_BUILD_CPPFLAGS) \
- $(DBUS_X_CFLAGS) \
- -DDBUS_COMPILATION \
- -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
- $(NULL)
-
-
-# if assertions are enabled, improve backtraces
-AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-dbus_send_SOURCES = \
- dbus-print-message.c \
- dbus-print-message.h \
- dbus-send.c
-
-dbus_monitor_SOURCES = \
- dbus-monitor.c \
- dbus-print-message.c \
- dbus-print-message.h
-
-@DBUS_WIN_FALSE@dbus_launch_SOURCES = \
-@DBUS_WIN_FALSE@ dbus-launch.c \
-@DBUS_WIN_FALSE@ dbus-launch-x11.c \
-@DBUS_WIN_FALSE@ dbus-launch.h
-
-@DBUS_WIN_TRUE@dbus_launch_SOURCES = \
-@DBUS_WIN_TRUE@ dbus-launch-win.c \
-@DBUS_WIN_TRUE@ dbus-launch.h
-
-@DBUS_WIN_FALSE@dbus_run_session_SOURCES = \
-@DBUS_WIN_FALSE@ dbus-run-session.c
-
-@DBUS_WIN_FALSE@dbus_run_session_LDADD = \
-@DBUS_WIN_FALSE@ $(top_builddir)/dbus/libdbus-1.la \
-@DBUS_WIN_FALSE@ $(NULL)
-
-dbus_cleanup_sockets_SOURCES = \
- dbus-cleanup-sockets.c
-
-dbus_uuidgen_SOURCES = \
- dbus-uuidgen.c
-
-dbus_send_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NULL)
-
-dbus_monitor_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NETWORK_libs) \
- $(NULL)
-
-dbus_uuidgen_LDADD = \
- $(top_builddir)/dbus/libdbus-1.la \
- $(NULL)
-
-dbus_launch_LDADD = \
- $(DBUS_X_LIBS) \
- $(NULL)
-
-EXTRA_DIST = run-with-tmp-session-bus.sh strtoll.c strtoull.c
-CLEANFILES = \
- run-with-tmp-session-bus.conf
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu tools/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-dbus-cleanup-sockets$(EXEEXT): $(dbus_cleanup_sockets_OBJECTS) $(dbus_cleanup_sockets_DEPENDENCIES) $(EXTRA_dbus_cleanup_sockets_DEPENDENCIES)
- @rm -f dbus-cleanup-sockets$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_cleanup_sockets_OBJECTS) $(dbus_cleanup_sockets_LDADD) $(LIBS)
-dbus-launch$(EXEEXT): $(dbus_launch_OBJECTS) $(dbus_launch_DEPENDENCIES) $(EXTRA_dbus_launch_DEPENDENCIES)
- @rm -f dbus-launch$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_launch_OBJECTS) $(dbus_launch_LDADD) $(LIBS)
-dbus-monitor$(EXEEXT): $(dbus_monitor_OBJECTS) $(dbus_monitor_DEPENDENCIES) $(EXTRA_dbus_monitor_DEPENDENCIES)
- @rm -f dbus-monitor$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_monitor_OBJECTS) $(dbus_monitor_LDADD) $(LIBS)
-dbus-run-session$(EXEEXT): $(dbus_run_session_OBJECTS) $(dbus_run_session_DEPENDENCIES) $(EXTRA_dbus_run_session_DEPENDENCIES)
- @rm -f dbus-run-session$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_run_session_OBJECTS) $(dbus_run_session_LDADD) $(LIBS)
-dbus-send$(EXEEXT): $(dbus_send_OBJECTS) $(dbus_send_DEPENDENCIES) $(EXTRA_dbus_send_DEPENDENCIES)
- @rm -f dbus-send$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_send_OBJECTS) $(dbus_send_LDADD) $(LIBS)
-dbus-uuidgen$(EXEEXT): $(dbus_uuidgen_OBJECTS) $(dbus_uuidgen_DEPENDENCIES) $(EXTRA_dbus_uuidgen_DEPENDENCIES)
- @rm -f dbus-uuidgen$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_uuidgen_OBJECTS) $(dbus_uuidgen_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-cleanup-sockets.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-launch-win.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-launch-x11.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-launch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-monitor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-print-message.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-run-session.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-send.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-uuidgen.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-data-local
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am: installcheck-local
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic clean-libtool ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am \
- install-data-local install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installcheck-local installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-binPROGRAMS
-
-
-# create the /var/lib/dbus directory for dbus-uuidgen
-install-data-local:
- $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/dbus
-
-installcheck-local:
- test -d $(DESTDIR)$(localstatedir)/lib/dbus
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-cleanup-sockets.c b/src/3rd_party/dbus-1.7.8/tools/dbus-cleanup-sockets.c
deleted file mode 100644
index 1b6709af54..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-cleanup-sockets.c
+++ /dev/null
@@ -1,448 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-cleanup-sockets.c dbus-cleanup-sockets utility
- *
- * Copyright (C) 2003 Red Hat, Inc.
- * Copyright (C) 2002 Michael Meeks
- *
- * Note that this file is NOT licensed under the Academic Free License,
- * as it is based on linc-cleanup-sockets which is LGPL.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef NULL
-#define NULL ((void*) 0)
-#endif
-
-static void*
-xmalloc (size_t bytes)
-{
- void *mem;
-
- if (bytes == 0)
- return NULL;
-
- mem = malloc (bytes);
-
- if (mem == NULL)
- {
- fprintf (stderr, "Allocation of %d bytes failed\n",
- (int) bytes);
- exit (1);
- }
-
- return mem;
-}
-
-static void*
-xrealloc (void *old, size_t bytes)
-{
- void *mem;
-
- if (bytes == 0)
- {
- free (old);
- return NULL;
- }
-
- mem = realloc (old, bytes);
-
- if (mem == NULL)
- {
- fprintf (stderr, "Reallocation of %d bytes failed\n",
- (int) bytes);
- exit (1);
- }
-
- return mem;
-}
-
-#ifdef AF_UNIX
-
-typedef enum
- {
- SOCKET_UNKNOWN,
- SOCKET_FAILED_TO_HANDLE,
- SOCKET_DEAD,
- SOCKET_ALIVE,
- SOCKET_UNLINKED
- } SocketStatus;
-
-static int alive_count = 0;
-static int cleaned_count = 0;
-static int unhandled_count = 0;
-
-typedef struct
-{
- char *name;
- int fd;
- SocketStatus status;
- int n_retries;
-} SocketEntry;
-
-static SocketEntry*
-socket_entry_new (const char *dir,
- const char *fname)
-{
- SocketEntry *se;
- int len;
-
- se = xmalloc (sizeof (SocketEntry));
-
- len = strlen (dir) + strlen (fname) + 2; /* 2 = nul and '/' */
- se->name = xmalloc (len);
-
- strcpy (se->name, dir);
- strcat (se->name, "/");
- strcat (se->name, fname);
-
- se->fd = -1;
-
- se->status = SOCKET_UNKNOWN;
-
- se->n_retries = 0;
-
- return se;
-}
-
-static void
-free_socket_entry (SocketEntry *se)
-{
- if (se)
- {
- free (se->name);
- if (se->fd >= 0)
- close (se->fd);
- free (se);
- }
-}
-
-static void
-free_socket_entries (SocketEntry** entries,
- int n_entries)
-{
- int i;
-
- if (entries)
- {
- for (i = 0; i < n_entries; ++i)
- free_socket_entry (entries[i]);
- free (entries);
- }
-}
-
-static void
-read_sockets (const char *dir,
- SocketEntry ***entries_p,
- int *n_entries_p)
-{
- DIR *dirh;
- struct dirent *dent;
- SocketEntry **entries;
- int n_entries;
- int allocated;
-
- n_entries = 0;
- allocated = 2;
- entries = xmalloc (sizeof (SocketEntry*) * allocated);
-
- dirh = opendir (dir);
- if (dirh == NULL)
- {
- fprintf (stderr, "Failed to open directory %s: %s\n",
- dir, strerror (errno));
- exit (1);
- }
-
- while ((dent = readdir (dirh)))
- {
- SocketEntry *se;
-
- if (strncmp (dent->d_name, "dbus-", 5) != 0)
- continue;
-
- se = socket_entry_new (dir, dent->d_name);
-
- if (n_entries == allocated)
- {
- allocated *= 2;
- entries = xrealloc (entries, sizeof (SocketEntry*) * allocated);
- }
-
- entries[n_entries] = se;
- n_entries += 1;
- }
-
- closedir (dirh);
-
- *entries_p = entries;
- *n_entries_p = n_entries;
-}
-
-static SocketStatus
-open_socket (SocketEntry *se)
-{
- int ret;
- struct sockaddr_un saddr;
-
- if (se->n_retries > 5)
- {
- fprintf (stderr, "Warning: giving up on socket %s after several retries; unable to determine socket's status\n",
- se->name);
- return SOCKET_FAILED_TO_HANDLE;
- }
-
- se->n_retries += 1;
-
- se->fd = socket (AF_UNIX, SOCK_STREAM, 0);
- if (se->fd < 0)
- {
- fprintf (stderr, "Warning: failed to open a socket to use for connecting: %s\n",
- strerror (errno));
- return SOCKET_UNKNOWN;
- }
-
- if (fcntl (se->fd, F_SETFL, O_NONBLOCK) < 0)
- {
- fprintf (stderr, "Warning: failed set socket %s nonblocking: %s\n",
- se->name, strerror (errno));
- return SOCKET_UNKNOWN;
- }
-
-
- memset (&saddr, '\0', sizeof (saddr)); /* nul-terminates the sun_path */
-
- saddr.sun_family = AF_UNIX;
- strncpy (saddr.sun_path, se->name, sizeof (saddr.sun_path) - 1);
-
- do
- {
- ret = connect (se->fd, (struct sockaddr*) &saddr, sizeof (saddr));
- }
- while (ret < 0 && errno == EINTR);
-
- if (ret >= 0)
- return SOCKET_ALIVE;
- else
- {
- switch (errno)
- {
- case EINPROGRESS:
- case EAGAIN:
- return SOCKET_UNKNOWN;
- case ECONNREFUSED:
- return SOCKET_DEAD;
- default:
- fprintf (stderr, "Warning: unexpected error connecting to socket %s: %s\n",
- se->name, strerror (errno));
- return SOCKET_FAILED_TO_HANDLE;
- }
- }
-}
-
-static int
-handle_sockets (SocketEntry **entries,
- int n_entries)
-{
- int i;
- int n_unknown;
-
- n_unknown = 0;
-
- i = 0;
- while (i < n_entries)
- {
- SocketEntry *se;
- SocketStatus status;
-
- se = entries[i];
- ++i;
-
- if (se->fd >= 0)
- {
- fprintf (stderr, "Internal error, socket has fd kept open while status = %d\n",
- se->status);
- exit (1);
- }
-
- if (se->status != SOCKET_UNKNOWN)
- continue;
-
- status = open_socket (se);
-
- switch (status)
- {
- case SOCKET_DEAD:
- cleaned_count += 1;
- if (unlink (se->name) < 0)
- {
- fprintf (stderr, "Warning: Failed to delete %s: %s\n",
- se->name, strerror (errno));
-
- se->status = SOCKET_FAILED_TO_HANDLE;
- }
- else
- se->status = SOCKET_UNLINKED;
- break;
-
- case SOCKET_ALIVE:
- alive_count += 1;
- /* FALL THRU */
-
- case SOCKET_FAILED_TO_HANDLE:
- case SOCKET_UNKNOWN:
- se->status = status;
- break;
-
- case SOCKET_UNLINKED:
- fprintf (stderr, "Bad status from open_socket(), should not happen\n");
- exit (1);
- break;
- }
-
- if (se->fd >= 0)
- {
- close (se->fd);
- se->fd = -1;
- }
-
- if (se->status == SOCKET_UNKNOWN)
- n_unknown += 1;
- }
-
- return n_unknown == 0;
-}
-
-static void
-clean_dir (const char *dir)
-{
- SocketEntry **entries;
- int n_entries;
-
- read_sockets (dir, &entries, &n_entries);
-
- /* open_socket() will fail conclusively after
- * several retries, so this loop is guaranteed
- * to terminate eventually
- */
- while (!handle_sockets (entries, n_entries))
- {
- fprintf (stderr, "Unable to determine state of some sockets, retrying in 2 seconds\n");
- sleep (2);
- }
-
- unhandled_count += (n_entries - alive_count - cleaned_count);
-
- free_socket_entries (entries, n_entries);
-}
-
-#endif /* AF_UNIX */
-
-static void
-usage (int ecode)
-{
- fprintf (stderr, "dbus-cleanup-sockets [--version] [--help] <socketdir>\n");
- exit (ecode);
-}
-
-static void
-version (void)
-{
- printf ("D-Bus Socket Cleanup Utility %s\n"
- "Copyright (C) 2003 Red Hat, Inc.\n"
- "Copyright (C) 2002 Michael Meeks\n"
- "This is free software; see the source for copying conditions.\n"
- "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
- VERSION);
- exit (0);
-}
-
-int
-main (int argc, char **argv)
-{
- int i;
- int saw_doubledash;
- const char *dirname;
-
- saw_doubledash = FALSE;
- dirname = NULL;
- i = 1;
- while (i < argc)
- {
- const char *arg = argv[i];
-
- if (strcmp (arg, "--help") == 0 ||
- strcmp (arg, "-h") == 0 ||
- strcmp (arg, "-?") == 0)
- usage (0);
- else if (strcmp (arg, "--version") == 0)
- version ();
- else if (!saw_doubledash)
- {
- if (strcmp (arg, "--") == 0)
- saw_doubledash = TRUE;
- else if (*arg == '-')
- usage (1);
- }
- else
- {
- if (dirname != NULL)
- {
- fprintf (stderr, "dbus-cleanup-sockets only supports a single directory name\n");
- exit (1);
- }
-
- dirname = arg;
- }
-
- ++i;
- }
-
- /* Default to session socket dir, usually /tmp */
- if (dirname == NULL)
- dirname = DBUS_SESSION_SOCKET_DIR;
-
-#ifdef AF_UNIX
- clean_dir (dirname);
-
- printf ("Cleaned up %d sockets in %s; %d sockets are still in use; %d in unknown state\n",
- cleaned_count, dirname, alive_count, unhandled_count);
-#else
- printf ("This system does not support UNIX domain sockets, so dbus-cleanup-sockets does nothing\n");
-#endif
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-launch-win.c b/src/3rd_party/dbus-1.7.8/tools/dbus-launch-win.c
deleted file mode 100644
index d899010a55..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-launch-win.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-launch-win.c dbus-launch utility
- *
- * Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#ifndef UNICODE
-#define UNICODE 1
-#endif
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-/* Save string functions. Instead of figuring out the exact _MSC_VER
- that work, override for everybody. */
-
-#define errno_t int
-#define wcscat_s my_wcscat_s
-#define wcscpy_s my_wcscpy_s
-
-static errno_t
-wcscat_s (wchar_t *dest, size_t size, wchar_t *src)
-{
- assert (sizeof (wchar_t) * (wcslen (dest) + wcslen (src) + 1) <= size);
- wcscat (dest, src);
- return 0;
-}
-
-
-static errno_t
-wcscpy_s (wchar_t *dest, size_t size, wchar_t *src)
-{
- assert (sizeof (wchar_t) * (wcslen (src) + 1) <= size);
- wcscpy (dest, src);
- return 0;
-}
-
-/* TODO (tl): This Windows version of dbus-launch is curretly rather
- * pointless as it doesn't take the same command-line options as the
- * UNIX dbus-launch does. A main point of the dbus-launch command is
- * to pass it for instance a --config-file option to make the started
- * dbus-daemon use that config file.
- *
- * This version also doesn't print out any information, which is a
- * main point of the UNIX one. It should at least support the
- * --sh-syntax option, and maybe also a --cmd-syntax to print out the
- * variable settings in cmd.exe syntax?
- *
- * NOTE (rh): The main task of dbus-launch is (from the man page) to start
- * a session bus and this is archieved by the current implemention.
- *
- * Additional on windows the session bus starting in not integrated
- * into the logon process, so there is no need for any --syntax option.
- * In fact (at least for kde on windows) the session bus is autostarted
- * with the first application requesting a session bus.
- *
- */
-
-#define AUTO_ACTIVATE_CONSOLE_WHEN_VERBOSE_MODE 1
-
-#define DIM(x) (sizeof(x) / sizeof(x[0]))
-#define WCSTRINGIFY_(x) L ## x
-#define WCSTRINGIFY(x) WCSTRINGIFY_(x)
-
-int
-main (int argc, char **argv)
-{
- wchar_t dbusDaemonPath[MAX_PATH * 2 + 1];
- wchar_t command[MAX_PATH * 2 + 1];
- wchar_t *p;
- wchar_t *daemon_name;
- int result;
- int showConsole = 0;
-#ifdef DBUS_WINCE
- char *s = NULL;
-#else
- char *s = getenv("DBUS_VERBOSE");
-#endif
- int verbose = s && *s != '\0' ? 1 : 0;
-
- PROCESS_INFORMATION pi;
- STARTUPINFOW si;
- BOOL inherit = TRUE;
- DWORD flags = 0;
-
-#ifdef AUTO_ACTIVATE_CONSOLE_WHEN_VERBOSE_MODE
- if (verbose)
- showConsole = 1;
-#endif
- GetModuleFileNameW (NULL, dbusDaemonPath, DIM (dbusDaemonPath));
-
- daemon_name = WCSTRINGIFY(DBUS_DAEMON_NAME) L".exe";
-
- if ((p = wcsrchr (dbusDaemonPath, L'\\')))
- {
- p[1] = L'\0';
- wcscat_s (dbusDaemonPath, sizeof (dbusDaemonPath), daemon_name);
- }
- else
- {
- if (verbose)
- fprintf (stderr, "error: could not extract path from current "
- "applications module filename\n");
- return 1;
- }
-
-#ifdef DBUS_WINCE
- /* Windows CE has a different interpretation of cmdline: Start with argv[1]. */
- wcscpy_s (command, sizeof (command), L"--session");
- if (verbose)
- fprintf (stderr, "%ls %ls\n", dbusDaemonPath, command);
-#else
- command[0] = L'\0';
- /* Windows cmdline starts with path, which can contain spaces. */
- wcscpy_s (command, sizeof (command), L"\"");
- wcscat_s (command, sizeof (command), dbusDaemonPath);
- wcscat_s (command, sizeof (command), L"\" --session");
- if (verbose)
- fprintf (stderr, "%ls\n", command);
-#endif
-
- memset (&si, 0, sizeof (si));
- memset (&pi, 0, sizeof (pi));
- si.cb = sizeof (si);
-
- if (verbose)
- flags |= CREATE_NEW_CONSOLE;
-
-#ifdef DBUS_WINCE
- inherit = FALSE;
-#else
- flags |= NORMAL_PRIORITY_CLASS;
- if (!verbose)
- flags |= DETACHED_PROCESS;
-#endif
-
- result = CreateProcessW (dbusDaemonPath, command, 0, 0,
- inherit, flags, 0, 0, &si, &pi);
-
- if (result == 0)
- {
- if (verbose)
- fprintf (stderr, "Could not start " DBUS_DAEMON_NAME ". error=%u\n",
- (unsigned)GetLastError ());
- return 4;
- }
-
- CloseHandle (pi.hProcess);
- CloseHandle (pi.hThread);
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-launch-x11.c b/src/3rd_party/dbus-1.7.8/tools/dbus-launch-x11.c
deleted file mode 100644
index c7e33309ba..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-launch-x11.c
+++ /dev/null
@@ -1,468 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-launch.h dbus-launch utility
- *
- * Copyright (C) 2006 Thiago Macieira <thiago@kde.org>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-launch.h"
-
-#ifdef DBUS_BUILD_X11
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <pwd.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-Display *xdisplay = NULL;
-static Atom selection_atom;
-static Atom address_atom;
-static Atom pid_atom;
-
-static int
-x_io_error_handler (Display *xdisplay)
-{
- verbose ("X IO error\n");
- kill_bus_and_exit (0);
- return 0;
-}
-
-static void
-remove_prefix (char *s,
- char *prefix)
-{
- int plen;
-
- plen = strlen (prefix);
-
- if (strncmp (s, prefix, plen) == 0)
- {
- memmove (s, s + plen, strlen (s) - plen + 1);
- }
-}
-
-static const char*
-get_homedir (void)
-{
- const char *home;
-
- home = getenv ("HOME");
- if (home == NULL)
- {
- /* try from the user database */
- struct passwd *user = getpwuid (getuid());
- if (user != NULL)
- home = user->pw_dir;
- }
-
- if (home == NULL)
- {
- fprintf (stderr, "Can't get user home directory\n");
- exit (1);
- }
-
- return home;
-}
-
-#define DBUS_DIR ".dbus"
-#define DBUS_SESSION_BUS_DIR "session-bus"
-
-static char *
-get_session_file (void)
-{
- static const char prefix[] = "/" DBUS_DIR "/" DBUS_SESSION_BUS_DIR "/";
- const char *machine;
- const char *home;
- char *display;
- char *result;
- char *p;
-
- machine = get_machine_uuid ();
- if (machine == NULL)
- return NULL;
-
- display = xstrdup (getenv ("DISPLAY"));
- if (display == NULL)
- {
- verbose ("X11 integration disabled because X11 is not running\n");
- return NULL;
- }
-
- /* remove the screen part of the display name */
- p = strrchr (display, ':');
- if (p != NULL)
- {
- for ( ; *p; ++p)
- {
- if (*p == '.')
- {
- *p = '\0';
- break;
- }
- }
- }
-
- /* Note that we leave the hostname in the display most of the
- * time. The idea is that we want to be per-(machine,display,user)
- * triplet to be extra-sure we get a bus we can connect to. Ideally
- * we'd recognize when the hostname matches the machine we're on in
- * all cases; we do try to drop localhost and localhost.localdomain
- * as a special common case so that alternate spellings of DISPLAY
- * don't result in extra bus instances.
- *
- * We also kill the ":" if there's nothing in front of it. This
- * avoids an ugly double underscore in the filename.
- */
- remove_prefix (display, "localhost.localdomain:");
- remove_prefix (display, "localhost:");
- remove_prefix (display, ":");
-
- /* replace the : in the display with _ if the : is still there.
- * use _ instead of - since it can't be in hostnames.
- */
- for (p = display; *p; ++p)
- {
- if (*p == ':')
- *p = '_';
- }
-
- home = get_homedir ();
-
- result = malloc (strlen (home) + strlen (prefix) + strlen (machine) +
- strlen (display) + 2);
- if (result == NULL)
- {
- /* out of memory */
- free (display);
- return NULL;
- }
-
- strcpy (result, home);
- strcat (result, prefix);
- strcat (result, machine);
- strcat (result, "-");
- strcat (result, display);
- free (display);
-
- verbose ("session file: %s\n", result);
- return result;
-}
-
-static void
-ensure_session_directory (void)
-{
- const char *home;
- char *dir;
-
- home = get_homedir ();
-
- /* be sure we have space for / and nul */
- dir = malloc (strlen (home) + strlen (DBUS_DIR) + strlen (DBUS_SESSION_BUS_DIR) + 3);
- if (dir == NULL)
- {
- fprintf (stderr, "no memory\n");
- exit (1);
- }
-
- strcpy (dir, home);
- strcat (dir, "/");
- strcat (dir, DBUS_DIR);
-
- if (mkdir (dir, 0700) < 0)
- {
- /* only print a warning here, writing the session file itself will fail later */
- if (errno != EEXIST)
- fprintf (stderr, "Unable to create %s\n", dir);
- }
-
- strcat (dir, "/");
- strcat (dir, DBUS_SESSION_BUS_DIR);
-
- if (mkdir (dir, 0700) < 0)
- {
- /* only print a warning here, writing the session file itself will fail later */
- if (errno != EEXIST)
- fprintf (stderr, "Unable to create %s\n", dir);
- }
-
- free (dir);
-}
-
-static Display *
-open_x11 (void)
-{
- if (xdisplay != NULL)
- return xdisplay;
-
- xdisplay = XOpenDisplay (NULL);
- if (xdisplay != NULL)
- {
- verbose ("Connected to X11 display '%s'\n", DisplayString (xdisplay));
- XSetIOErrorHandler (x_io_error_handler);
- }
- return xdisplay;
-}
-
-static int
-init_x_atoms (Display *display)
-{
- static const char selection_prefix[] = "_DBUS_SESSION_BUS_SELECTION_";
- static const char address_prefix[] = "_DBUS_SESSION_BUS_ADDRESS";
- static const char pid_prefix[] = "_DBUS_SESSION_BUS_PID";
- static int init = FALSE;
- char *atom_name;
- const char *machine;
- char *user_name;
- struct passwd *user;
-
- if (init)
- return TRUE;
-
- machine = get_machine_uuid ();
- if (machine == NULL)
- return FALSE;
-
- user = getpwuid (getuid ());
- if (user == NULL)
- {
- verbose ("Could not determine user information; aborting X11 integration.\n");
- return FALSE;
- }
- user_name = xstrdup(user->pw_name);
-
- atom_name = malloc (strlen (machine) + strlen (user_name) + 2 +
- MAX (strlen (selection_prefix),
- MAX (strlen (address_prefix),
- strlen (pid_prefix))));
- if (atom_name == NULL)
- {
- verbose ("Could not create X11 atoms; aborting X11 integration.\n");
- free (user_name);
- return FALSE;
- }
-
- /* create the selection atom */
- strcpy (atom_name, selection_prefix);
- strcat (atom_name, user_name);
- strcat (atom_name, "_");
- strcat (atom_name, machine);
- selection_atom = XInternAtom (display, atom_name, FALSE);
-
- /* create the address property atom */
- strcpy (atom_name, address_prefix);
- address_atom = XInternAtom (display, atom_name, FALSE);
-
- /* create the PID property atom */
- strcpy (atom_name, pid_prefix);
- pid_atom = XInternAtom (display, atom_name, FALSE);
-
- free (atom_name);
- free (user_name);
- init = TRUE;
- return TRUE;
-}
-
-/*
- * Gets the daemon address from the X11 display.
- * Returns FALSE if there was an error. Returning
- * TRUE does not mean the address exists.
- */
-int
-x11_get_address (char **paddress, pid_t *pid, long *wid)
-{
- int result;
- Atom type;
- Window owner;
- int format;
- unsigned long items;
- unsigned long after;
- char *data;
-
- *paddress = NULL;
-
- /* locate the selection owner */
- owner = XGetSelectionOwner (xdisplay, selection_atom);
- if (owner == None)
- return TRUE; /* no owner */
- if (wid != NULL)
- *wid = (long) owner;
-
- /* get the bus address */
- result = XGetWindowProperty (xdisplay, owner, address_atom, 0, 1024, False,
- XA_STRING, &type, &format, &items, &after,
- (unsigned char **) &data);
- if (result != Success || type == None || after != 0 || data == NULL || format != 8)
- return FALSE; /* error */
-
- *paddress = xstrdup (data);
- XFree (data);
-
- /* get the PID */
- if (pid != NULL)
- {
- *pid = 0;
- result = XGetWindowProperty (xdisplay, owner, pid_atom, 0, sizeof pid, False,
- XA_CARDINAL, &type, &format, &items, &after,
- (unsigned char **) &data);
- if (result == Success && type != None && after == 0 && data != NULL && format == 32)
- *pid = (pid_t) *(long*) data;
- XFree (data);
- }
-
- return TRUE; /* success */
-}
-
-/*
- * Saves the address in the X11 display. Returns 0 on success.
- * If an error occurs, returns -1. If the selection already exists,
- * returns 1. (i.e. another daemon is already running)
- */
-static Window
-set_address_in_x11(char *address, pid_t pid)
-{
- char *current_address;
- Window wid = None;
- unsigned long pid32; /* Xlib property functions want _long_ not 32-bit for format "32" */
-
- /* lock the X11 display to make sure we're doing this atomically */
- XGrabServer (xdisplay);
-
- if (!x11_get_address (&current_address, NULL, NULL))
- {
- /* error! */
- goto out;
- }
-
- if (current_address != NULL)
- {
- /* someone saved the address in the meantime */
- free (current_address);
- goto out;
- }
-
- /* Create our window */
- wid = XCreateWindow (xdisplay, RootWindow (xdisplay, 0), -20, -20, 10, 10,
- 0, CopyFromParent, InputOnly, CopyFromParent,
- 0, NULL);
- verbose ("Created window %d\n", wid);
-
- /* Save the property in the window */
- XChangeProperty (xdisplay, wid, address_atom, XA_STRING, 8, PropModeReplace,
- (unsigned char *)address, strlen (address));
- pid32 = pid;
- XChangeProperty (xdisplay, wid, pid_atom, XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *)&pid32, 1);
-
- /* Now grab the selection */
- XSetSelectionOwner (xdisplay, selection_atom, wid, CurrentTime);
-
- out:
- /* Ungrab the server to let other people use it too */
- XUngrabServer (xdisplay);
-
- /* And make sure that the ungrab gets sent to X11 */
- XFlush (xdisplay);
-
- return wid;
-}
-
-/*
- * Saves the session address in session file. Returns TRUE on
- * success, FALSE if an error occurs.
- */
-static int
-set_address_in_file (char *address, pid_t pid, Window wid)
-{
- char *session_file;
- FILE *f;
-
- ensure_session_directory ();
- session_file = get_session_file();
- if (session_file == NULL)
- return FALSE;
-
- f = fopen (session_file, "w");
- free (session_file);
- if (f == NULL)
- return FALSE; /* some kind of error */
- fprintf (f,
- "# This file allows processes on the machine with id %s using \n"
- "# display %s to find the D-Bus session bus with the below address.\n"
- "# If the DBUS_SESSION_BUS_ADDRESS environment variable is set, it will\n"
- "# be used rather than this file.\n"
- "# See \"man dbus-launch\" for more details.\n"
- "DBUS_SESSION_BUS_ADDRESS=%s\n"
- "DBUS_SESSION_BUS_PID=%ld\n"
- "DBUS_SESSION_BUS_WINDOWID=%ld\n",
- get_machine_uuid (),
- getenv ("DISPLAY"),
- address, (long)pid, (long)wid);
-
- fclose (f);
-
- return TRUE;
-}
-
-int
-x11_save_address (char *address, pid_t pid, long *wid)
-{
- Window id = set_address_in_x11 (address, pid);
- if (id != None)
- {
- if (!set_address_in_file (address, pid, id))
- return FALSE;
-
- if (wid != NULL)
- *wid = (long) id;
- return TRUE;
- }
- return FALSE;
-}
-
-int
-x11_init (void)
-{
- return open_x11 () != NULL && init_x_atoms (xdisplay);
-}
-
-void
-x11_handle_event (void)
-{
- if (xdisplay != NULL)
- {
- while (XPending (xdisplay))
- {
- XEvent ignored;
- XNextEvent (xdisplay, &ignored);
- }
- }
-}
-
-#else
-void dummy_dbus_launch_x11 (void);
-
-void dummy_dbus_launch_x11 (void) { }
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-launch.c b/src/3rd_party/dbus-1.7.8/tools/dbus-launch.c
deleted file mode 100644
index 7ecee63e4d..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-launch.c
+++ /dev/null
@@ -1,1325 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-launch.c dbus-launch utility
- *
- * Copyright (C) 2003, 2006 Red Hat, Inc.
- * Copyright (C) 2006 Thiago Macieira <thiago@kde.org>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-launch.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <sys/select.h>
-#include <time.h>
-
-#ifdef DBUS_BUILD_X11
-#include <X11/Xlib.h>
-extern Display *xdisplay;
-#endif
-
-/* PROCESSES
- *
- * If you are in a shell and run "dbus-launch myapp", here is what happens:
- *
- * shell [*]
- * \- main() --exec--> myapp[*]
- * \- "intermediate parent"
- * \- bus-runner --exec--> dbus-daemon --fork
- * \- babysitter[*] \- final dbus-daemon[*]
- *
- * Processes marked [*] survive the initial flurry of activity.
- *
- * If you run "dbus-launch --sh-syntax" then the diagram is the same, except
- * that main() prints variables and exits 0 instead of exec'ing myapp.
- *
- * PIPES
- *
- * dbus-daemon --print-pid -> bus_pid_to_launcher_pipe -> main
- * dbus-daemon --print-address -> bus_address_to_launcher_pipe -> main
- * main -> bus_pid_to_babysitter_pipe -> babysitter
- *
- * The intermediate parent looks pretty useless at first glance. Its purpose
- * is to avoid the bus-runner becoming a zombie: when the intermediate parent
- * terminates, the bus-runner and babysitter are reparented to init, which
- * reaps them if they have finished. We can't rely on main() to reap arbitrary
- * children because it might exec myapp, after which it can't be relied on to
- * reap its children. We *can* rely on main() to reap the intermediate parent,
- * because that happens before it execs myapp.
- *
- * It's unclear why dbus-daemon needs to fork, but we explicitly tell it to
- * for some reason, then wait for it. If we left it undefined, a forking
- * dbus-daemon would get the parent process reparented to init and reaped
- * when the intermediate parent terminated, and a non-forking dbus-daemon
- * would get reparented to init and carry on there.
- *
- * myapp is exec'd by the process that initially ran main() so that it's
- * the shell's child, so the shell knows how to do job control and stuff.
- * This is desirable for the "dbus-launch an application" use-case, less so
- * for the "dbus-launch a test suite in an isolated session" use-case.
- */
-
-static char* machine_uuid = NULL;
-
-const char*
-get_machine_uuid (void)
-{
- return machine_uuid;
-}
-
-static void
-save_machine_uuid (const char *uuid_arg)
-{
- if (strlen (uuid_arg) != 32)
- {
- fprintf (stderr, "machine ID '%s' looks like it's the wrong length, should be 32 hex digits",
- uuid_arg);
- exit (1);
- }
-
- machine_uuid = xstrdup (uuid_arg);
-}
-
-#ifdef DBUS_BUILD_X11
-#define UUID_MAXLEN 40
-/* Read the machine uuid from file if needed. Returns TRUE if machine_uuid is
- * set after this function */
-static int
-read_machine_uuid_if_needed (void)
-{
- FILE *f;
- char uuid[UUID_MAXLEN];
- size_t len;
- int ret = FALSE;
-
- if (machine_uuid != NULL)
- return TRUE;
-
- f = fopen (DBUS_MACHINE_UUID_FILE, "r");
- if (f == NULL)
- return FALSE;
-
- if (fgets (uuid, UUID_MAXLEN, f) == NULL)
- goto out;
-
- len = strlen (uuid);
- if (len < 32)
- goto out;
-
- /* rstrip the read uuid */
- while (len > 31 && isspace((int) uuid[len - 1]))
- len--;
-
- if (len != 32)
- goto out;
-
- uuid[len] = '\0';
- machine_uuid = xstrdup (uuid);
- verbose ("UID: %s\n", machine_uuid);
- ret = TRUE;
-
-out:
- fclose(f);
- return ret;
-}
-#endif /* DBUS_BUILD_X11 */
-
-void
-verbose (const char *format,
- ...)
-{
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- va_list args;
- static int verbose = TRUE;
- static int verbose_initted = FALSE;
-
- /* things are written a bit oddly here so that
- * in the non-verbose case we just have the one
- * conditional and return immediately.
- */
- if (!verbose)
- return;
-
- if (!verbose_initted)
- {
- verbose = getenv ("DBUS_VERBOSE") != NULL;
- verbose_initted = TRUE;
- if (!verbose)
- return;
- }
-
- fprintf (stderr, "%lu: ", (unsigned long) getpid ());
-
- va_start (args, format);
- vfprintf (stderr, format, args);
- va_end (args);
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-}
-
-static void
-usage (int ecode)
-{
- fprintf (stderr, "dbus-launch [--version] [--help] [--sh-syntax]"
- " [--csh-syntax] [--auto-syntax] [--binary-syntax] [--close-stderr]"
- " [--exit-with-session] [--autolaunch=MACHINEID]"
- " [--config-file=FILENAME] [PROGRAM] [ARGS...]\n");
- exit (ecode);
-}
-
-static void
-version (void)
-{
- printf ("D-Bus Message Bus Launcher %s\n"
- "Copyright (C) 2003 Red Hat, Inc.\n"
- "This is free software; see the source for copying conditions.\n"
- "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
- VERSION);
- exit (0);
-}
-
-char *
-xstrdup (const char *str)
-{
- int len;
- char *copy;
-
- if (str == NULL)
- return NULL;
-
- len = strlen (str);
-
- copy = malloc (len + 1);
- if (copy == NULL)
- return NULL;
-
- memcpy (copy, str, len + 1);
-
- return copy;
-}
-
-static char *
-concat2 (const char *a,
- const char *b)
-{
- size_t la, lb;
- char *ret;
-
- la = strlen (a);
- lb = strlen (b);
-
- ret = malloc (la + lb + 1);
-
- if (ret == NULL)
- return NULL;
-
- memcpy (ret, a, la);
- memcpy (ret + la, b, lb + 1);
- return ret;
-}
-
-typedef enum
-{
- READ_STATUS_OK, /**< Read succeeded */
- READ_STATUS_ERROR, /**< Some kind of error */
- READ_STATUS_EOF /**< EOF returned */
-} ReadStatus;
-
-static ReadStatus
-read_line (int fd,
- char *buf,
- size_t maxlen)
-{
- size_t bytes = 0;
- ReadStatus retval;
-
- memset (buf, '\0', maxlen);
- maxlen -= 1; /* ensure nul term */
-
- retval = READ_STATUS_OK;
-
- while (TRUE)
- {
- ssize_t chunk;
- size_t to_read;
-
- again:
- to_read = maxlen - bytes;
-
- if (to_read == 0)
- break;
-
- chunk = read (fd,
- buf + bytes,
- to_read);
- if (chunk < 0 && errno == EINTR)
- goto again;
-
- if (chunk < 0)
- {
- retval = READ_STATUS_ERROR;
- break;
- }
- else if (chunk == 0)
- {
- retval = READ_STATUS_EOF;
- break; /* EOF */
- }
- else /* chunk > 0 */
- bytes += chunk;
- }
-
- if (retval == READ_STATUS_EOF &&
- bytes > 0)
- retval = READ_STATUS_OK;
-
- /* whack newline */
- if (retval != READ_STATUS_ERROR &&
- bytes > 0 &&
- buf[bytes-1] == '\n')
- buf[bytes-1] = '\0';
-
- return retval;
-}
-
-static ReadStatus
-read_pid (int fd,
- pid_t *buf)
-{
- size_t bytes = 0;
- ReadStatus retval;
-
- retval = READ_STATUS_OK;
-
- while (TRUE)
- {
- ssize_t chunk;
- size_t to_read;
-
- again:
- to_read = sizeof (pid_t) - bytes;
-
- if (to_read == 0)
- break;
-
- chunk = read (fd,
- ((char*)buf) + bytes,
- to_read);
- if (chunk < 0 && errno == EINTR)
- goto again;
-
- if (chunk < 0)
- {
- retval = READ_STATUS_ERROR;
- break;
- }
- else if (chunk == 0)
- {
- retval = READ_STATUS_EOF;
- break; /* EOF */
- }
- else /* chunk > 0 */
- bytes += chunk;
- }
-
- return retval;
-}
-
-static void
-do_write (int fd, const void *buf, size_t count)
-{
- size_t bytes_written;
- int ret;
-
- bytes_written = 0;
-
- again:
-
- ret = write (fd, ((const char*)buf) + bytes_written, count - bytes_written);
-
- if (ret < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- fprintf (stderr, "Failed to write data to pipe! %s\n",
- strerror (errno));
- exit (1); /* give up, we suck */
- }
- }
- else
- bytes_written += ret;
-
- if (bytes_written < count)
- goto again;
-}
-
-static void
-write_pid (int fd,
- pid_t pid)
-{
- do_write (fd, &pid, sizeof (pid));
-}
-
-static int
-do_waitpid (pid_t pid)
-{
- int ret;
-
- again:
- ret = waitpid (pid, NULL, 0);
-
- if (ret < 0 &&
- errno == EINTR)
- goto again;
-
- return ret;
-}
-
-static pid_t bus_pid_to_kill = -1;
-
-static void
-kill_bus(void)
-{
- verbose ("Killing message bus and exiting babysitter\n");
- kill (bus_pid_to_kill, SIGTERM);
- sleep (3);
- kill (bus_pid_to_kill, SIGKILL);
-}
-
-void
-kill_bus_and_exit (int exitcode)
-{
- /* in case these point to any NFS mounts, get rid of them immediately */
- close (0);
- close (1);
- close (2);
-
- kill_bus();
-
- exit (exitcode);
-}
-
-static void
-print_variables (const char *bus_address, pid_t bus_pid, long bus_wid,
- int c_shell_syntax, int bourne_shell_syntax,
- int binary_syntax)
-{
- if (binary_syntax)
- {
- do_write (1, bus_address, strlen (bus_address) + 1);
- do_write (1, &bus_pid, sizeof bus_pid);
- do_write (1, &bus_wid, sizeof bus_wid);
- return;
- }
- else if (c_shell_syntax)
- {
- printf ("setenv DBUS_SESSION_BUS_ADDRESS '%s';\n", bus_address);
- printf ("set DBUS_SESSION_BUS_PID=%ld;\n", (long) bus_pid);
- if (bus_wid)
- printf ("set DBUS_SESSION_BUS_WINDOWID=%ld;\n", (long) bus_wid);
- fflush (stdout);
- }
- else if (bourne_shell_syntax)
- {
- printf ("DBUS_SESSION_BUS_ADDRESS='%s';\n", bus_address);
- printf ("export DBUS_SESSION_BUS_ADDRESS;\n");
- printf ("DBUS_SESSION_BUS_PID=%ld;\n", (long) bus_pid);
- if (bus_wid)
- printf ("DBUS_SESSION_BUS_WINDOWID=%ld;\n", (long) bus_wid);
- fflush (stdout);
- }
- else
- {
- printf ("DBUS_SESSION_BUS_ADDRESS=%s\n", bus_address);
- printf ("DBUS_SESSION_BUS_PID=%ld\n", (long) bus_pid);
- if (bus_wid)
- printf ("DBUS_SESSION_BUS_WINDOWID=%ld\n", (long) bus_wid);
- fflush (stdout);
- }
-}
-
-static int got_sighup = FALSE;
-
-static void
-signal_handler (int sig)
-{
- switch (sig)
- {
- case SIGHUP:
- case SIGINT:
- case SIGTERM:
- got_sighup = TRUE;
- break;
- }
-}
-
-static void
-kill_bus_when_session_ends (void)
-{
- int tty_fd;
- int x_fd;
- fd_set read_set;
- fd_set err_set;
- struct sigaction act;
- sigset_t empty_mask;
-
- /* install SIGHUP handler */
- got_sighup = FALSE;
- sigemptyset (&empty_mask);
- act.sa_handler = signal_handler;
- act.sa_mask = empty_mask;
- act.sa_flags = 0;
- sigaction (SIGHUP, &act, NULL);
- sigaction (SIGTERM, &act, NULL);
- sigaction (SIGINT, &act, NULL);
-
-#ifdef DBUS_BUILD_X11
- x11_init();
- if (xdisplay != NULL)
- {
- x_fd = ConnectionNumber (xdisplay);
- }
- else
- x_fd = -1;
-#else
- x_fd = -1;
-#endif
-
- if (isatty (0))
- tty_fd = 0;
- else
- tty_fd = -1;
-
- if (x_fd >= 0)
- {
- verbose ("session lifetime is defined by X, not monitoring stdin\n");
- tty_fd = -1;
- }
- else if (tty_fd >= 0)
- {
- verbose ("stdin isatty(), monitoring it\n");
- }
- else
- {
- verbose ("stdin was not a TTY, not monitoring it\n");
- }
-
- if (tty_fd < 0 && x_fd < 0)
- {
- fprintf (stderr, "No terminal on standard input and no X display; cannot attach message bus to session lifetime\n");
- exit (1);
- }
-
- while (TRUE)
- {
-#ifdef DBUS_BUILD_X11
- /* Dump events on the floor, and let
- * IO error handler run if we lose
- * the X connection. It's important to
- * run this before going into select() since
- * we might have queued outgoing messages or
- * events.
- */
- x11_handle_event ();
-#endif
-
- FD_ZERO (&read_set);
- FD_ZERO (&err_set);
-
- if (tty_fd >= 0)
- {
- FD_SET (tty_fd, &read_set);
- FD_SET (tty_fd, &err_set);
- }
-
- if (x_fd >= 0)
- {
- FD_SET (x_fd, &read_set);
- FD_SET (x_fd, &err_set);
- }
-
- select (MAX (tty_fd, x_fd) + 1,
- &read_set, NULL, &err_set, NULL);
-
- if (got_sighup)
- {
- verbose ("Got SIGHUP, exiting\n");
- kill_bus_and_exit (0);
- }
-
-#ifdef DBUS_BUILD_X11
- /* Events will be processed before we select again
- */
- if (x_fd >= 0)
- verbose ("X fd condition reading = %d error = %d\n",
- FD_ISSET (x_fd, &read_set),
- FD_ISSET (x_fd, &err_set));
-#endif
-
- if (tty_fd >= 0)
- {
- if (FD_ISSET (tty_fd, &read_set))
- {
- int bytes_read;
- char discard[512];
-
- verbose ("TTY ready for reading\n");
-
- bytes_read = read (tty_fd, discard, sizeof (discard));
-
- verbose ("Read %d bytes from TTY errno = %d\n",
- bytes_read, errno);
-
- if (bytes_read == 0)
- kill_bus_and_exit (0); /* EOF */
- else if (bytes_read < 0 && errno != EINTR)
- {
- /* This shouldn't happen I don't think; to avoid
- * spinning on the fd forever we exit.
- */
- fprintf (stderr, "dbus-launch: error reading from stdin: %s\n",
- strerror (errno));
- kill_bus_and_exit (0);
- }
- }
- else if (FD_ISSET (tty_fd, &err_set))
- {
- verbose ("TTY has error condition\n");
-
- kill_bus_and_exit (0);
- }
- }
- }
-}
-
-static void
-babysit (int exit_with_session,
- pid_t child_pid,
- int read_bus_pid_fd) /* read pid from here */
-{
- int ret;
- int dev_null_fd;
- const char *s;
-
- verbose ("babysitting, exit_with_session = %d, child_pid = %ld, read_bus_pid_fd = %d\n",
- exit_with_session, (long) child_pid, read_bus_pid_fd);
-
- /* We chdir ("/") since we are persistent and daemon-like, and fork
- * again so dbus-launch can reap the parent. However, we don't
- * setsid() or close fd 0 because the idea is to remain attached
- * to the tty and the X server in order to kill the message bus
- * when the session ends.
- */
-
- if (chdir ("/") < 0)
- {
- fprintf (stderr, "Could not change to root directory: %s\n",
- strerror (errno));
- exit (1);
- }
-
- /* Close stdout/stderr so we don't block an "eval" or otherwise
- * lock up. stdout is still chaining through to dbus-launch
- * and in turn to the parent shell.
- */
- dev_null_fd = open ("/dev/null", O_RDWR);
- if (dev_null_fd >= 0)
- {
- if (!exit_with_session)
- dup2 (dev_null_fd, 0);
- dup2 (dev_null_fd, 1);
- s = getenv ("DBUS_DEBUG_OUTPUT");
- if (s == NULL || *s == '\0')
- dup2 (dev_null_fd, 2);
- close (dev_null_fd);
- }
- else
- {
- fprintf (stderr, "Failed to open /dev/null: %s\n",
- strerror (errno));
- /* continue, why not */
- }
-
- ret = fork ();
-
- if (ret < 0)
- {
- fprintf (stderr, "fork() failed in babysitter: %s\n",
- strerror (errno));
- exit (1);
- }
-
- if (ret > 0)
- {
- /* Parent reaps pre-fork part of bus daemon, then exits and is
- * reaped so the babysitter isn't a zombie
- */
-
- verbose ("=== Babysitter's intermediate parent continues again\n");
-
- if (do_waitpid (child_pid) < 0)
- {
- /* shouldn't happen */
- fprintf (stderr, "Failed waitpid() waiting for bus daemon's parent\n");
- exit (1);
- }
-
- verbose ("Babysitter's intermediate parent exiting\n");
-
- exit (0);
- }
-
- /* Child continues */
- verbose ("=== Babysitter process created\n");
-
- verbose ("Reading PID from bus\n");
-
- switch (read_pid (read_bus_pid_fd, &bus_pid_to_kill))
- {
- case READ_STATUS_OK:
- break;
- case READ_STATUS_EOF:
- fprintf (stderr, "EOF in dbus-launch reading PID from bus daemon\n");
- exit (1);
- break;
- case READ_STATUS_ERROR:
- fprintf (stderr, "Error in dbus-launch reading PID from bus daemon: %s\n",
- strerror (errno));
- exit (1);
- break;
- }
-
- verbose ("Got PID %ld from daemon\n",
- (long) bus_pid_to_kill);
-
- if (exit_with_session)
- {
- /* Bus is now started and launcher has needed info;
- * we connect to X display and tty and wait to
- * kill bus if requested.
- */
-
- kill_bus_when_session_ends ();
- }
-
- verbose ("Babysitter exiting\n");
-
- exit (0);
-}
-
-static void
-do_close_stderr (void)
-{
- int fd;
-
- fflush (stderr);
-
- /* dbus-launch is a Unix-only program, so we can rely on /dev/null being there.
- * We're including unistd.h and we're dealing with sh/csh launch sequences...
- */
- fd = open ("/dev/null", O_RDWR);
- if (fd == -1)
- {
- fprintf (stderr, "Internal error: cannot open /dev/null: %s", strerror (errno));
- exit (1);
- }
-
- close (2);
- if (dup2 (fd, 2) == -1)
- {
- /* error; we can't report an error anymore... */
- exit (1);
- }
- close (fd);
-}
-
-static void
-pass_info (const char *runprog, const char *bus_address, pid_t bus_pid,
- long bus_wid, int c_shell_syntax, int bourne_shell_syntax,
- int binary_syntax,
- int argc, char **argv, int remaining_args)
-{
- char *envvar = NULL;
- char **args = NULL;
-
- if (runprog)
- {
- int i;
-
- envvar = malloc (strlen ("DBUS_SESSION_BUS_ADDRESS=") +
- strlen (bus_address) + 1);
- args = malloc (sizeof (char *) * ((argc-remaining_args)+2));
-
- if (envvar == NULL || args == NULL)
- goto oom;
-
- args[0] = xstrdup (runprog);
- if (!args[0])
- goto oom;
- for (i = 1; i <= (argc-remaining_args); i++)
- {
- size_t len = strlen (argv[remaining_args+i-1])+1;
- args[i] = malloc (len);
- if (!args[i])
- {
- while (i > 1)
- free (args[--i]);
- goto oom;
- }
- strncpy (args[i], argv[remaining_args+i-1], len);
- }
- args[i] = NULL;
-
- strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS=");
- strcat (envvar, bus_address);
- putenv (envvar);
-
- execvp (runprog, args);
- fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno));
- exit (1);
- }
- else
- {
- print_variables (bus_address, bus_pid, bus_wid, c_shell_syntax,
- bourne_shell_syntax, binary_syntax);
- }
- verbose ("dbus-launch exiting\n");
-
- fflush (stdout);
- fflush (stderr);
- close (1);
- close (2);
- exit (0);
-oom:
- if (envvar)
- free (envvar);
-
- if (args)
- free (args);
-
- fprintf (stderr, "Out of memory!");
- exit (1);
-}
-
-#define READ_END 0
-#define WRITE_END 1
-
-int
-main (int argc, char **argv)
-{
- const char *prev_arg;
- const char *shname;
- const char *runprog = NULL;
- int remaining_args = 0;
- int exit_with_session;
- int binary_syntax = FALSE;
- int c_shell_syntax = FALSE;
- int bourne_shell_syntax = FALSE;
- int auto_shell_syntax = FALSE;
- int autolaunch = FALSE;
- int requires_arg = FALSE;
- int close_stderr = FALSE;
- int i;
- int ret;
- int bus_pid_to_launcher_pipe[2];
- int bus_pid_to_babysitter_pipe[2];
- int bus_address_to_launcher_pipe[2];
- char *config_file;
-
- exit_with_session = FALSE;
- config_file = NULL;
-
- prev_arg = NULL;
- i = 1;
- while (i < argc)
- {
- const char *arg = argv[i];
-
- if (strcmp (arg, "--help") == 0 ||
- strcmp (arg, "-h") == 0 ||
- strcmp (arg, "-?") == 0)
- usage (0);
- else if (strcmp (arg, "--auto-syntax") == 0)
- auto_shell_syntax = TRUE;
- else if (strcmp (arg, "-c") == 0 ||
- strcmp (arg, "--csh-syntax") == 0)
- c_shell_syntax = TRUE;
- else if (strcmp (arg, "-s") == 0 ||
- strcmp (arg, "--sh-syntax") == 0)
- bourne_shell_syntax = TRUE;
- else if (strcmp (arg, "--binary-syntax") == 0)
- binary_syntax = TRUE;
- else if (strcmp (arg, "--version") == 0)
- version ();
- else if (strcmp (arg, "--exit-with-session") == 0)
- exit_with_session = TRUE;
- else if (strcmp (arg, "--close-stderr") == 0)
- close_stderr = TRUE;
- else if (strstr (arg, "--autolaunch=") == arg)
- {
- const char *s;
-
- if (autolaunch)
- {
- fprintf (stderr, "--autolaunch given twice\n");
- exit (1);
- }
-
- autolaunch = TRUE;
-
- s = strchr (arg, '=');
- ++s;
-
- save_machine_uuid (s);
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--autolaunch") == 0)
- {
- if (autolaunch)
- {
- fprintf (stderr, "--autolaunch given twice\n");
- exit (1);
- }
-
- autolaunch = TRUE;
-
- save_machine_uuid (arg);
- requires_arg = FALSE;
- }
- else if (strcmp (arg, "--autolaunch") == 0)
- requires_arg = TRUE;
- else if (strstr (arg, "--config-file=") == arg)
- {
- const char *file;
-
- if (config_file != NULL)
- {
- fprintf (stderr, "--config-file given twice\n");
- exit (1);
- }
-
- file = strchr (arg, '=');
- ++file;
-
- config_file = xstrdup (file);
- }
- else if (prev_arg &&
- strcmp (prev_arg, "--config-file") == 0)
- {
- if (config_file != NULL)
- {
- fprintf (stderr, "--config-file given twice\n");
- exit (1);
- }
-
- config_file = xstrdup (arg);
- requires_arg = FALSE;
- }
- else if (strcmp (arg, "--config-file") == 0)
- requires_arg = TRUE;
- else if (arg[0] == '-')
- {
- if (strcmp (arg, "--") != 0)
- {
- fprintf (stderr, "Option `%s' is unknown.\n", arg);
- exit (1);
- }
- else
- {
- runprog = argv[i+1];
- remaining_args = i+2;
- break;
- }
- }
- else
- {
- runprog = arg;
- remaining_args = i+1;
- break;
- }
-
- prev_arg = arg;
-
- ++i;
- }
- if (requires_arg)
- {
- fprintf (stderr, "Option `%s' requires an argument.\n", prev_arg);
- exit (1);
- }
-
- if (auto_shell_syntax)
- {
- if ((shname = getenv ("SHELL")) != NULL)
- {
- if (!strncmp (shname + strlen (shname) - 3, "csh", 3))
- c_shell_syntax = TRUE;
- else
- bourne_shell_syntax = TRUE;
- }
- else
- bourne_shell_syntax = TRUE;
- }
-
- if (exit_with_session)
- verbose ("--exit-with-session enabled\n");
-
- if (autolaunch)
- {
-#ifndef DBUS_BUILD_X11
- fprintf (stderr, "Autolaunch requested, but X11 support not compiled in.\n"
- "Cannot continue.\n");
- exit (1);
-#else /* DBUS_BUILD_X11 */
-#ifndef DBUS_ENABLE_X11_AUTOLAUNCH
- fprintf (stderr, "X11 autolaunch support disabled at compile time.\n");
- exit (1);
-#else /* DBUS_ENABLE_X11_AUTOLAUNCH */
- char *address;
- pid_t pid;
- long wid;
-
- if (get_machine_uuid () == NULL)
- {
- fprintf (stderr, "Machine UUID not provided as arg to --autolaunch\n");
- exit (1);
- }
-
- verbose ("Autolaunch enabled (using X11).\n");
- if (!exit_with_session)
- {
- verbose ("--exit-with-session automatically enabled\n");
- exit_with_session = TRUE;
- }
-
- if (!x11_init ())
- {
- fprintf (stderr, "Autolaunch error: X11 initialization failed.\n");
- exit (1);
- }
-
- if (!x11_get_address (&address, &pid, &wid))
- {
- fprintf (stderr, "Autolaunch error: X11 communication error.\n");
- exit (1);
- }
-
- if (address != NULL)
- {
- verbose ("dbus-daemon is already running. Returning existing parameters.\n");
- pass_info (runprog, address, pid, wid, c_shell_syntax,
- bourne_shell_syntax, binary_syntax, argc, argv, remaining_args);
- exit (0);
- }
-#endif /* DBUS_ENABLE_X11_AUTOLAUNCH */
- }
- else if (read_machine_uuid_if_needed())
- {
- x11_init();
-#endif /* DBUS_BUILD_X11 */
- }
-
-
- if (pipe (bus_pid_to_launcher_pipe) < 0 ||
- pipe (bus_address_to_launcher_pipe) < 0 ||
- pipe (bus_pid_to_babysitter_pipe) < 0)
- {
- fprintf (stderr,
- "Failed to create pipe: %s\n",
- strerror (errno));
- exit (1);
- }
-
- ret = fork ();
- if (ret < 0)
- {
- fprintf (stderr, "Failed to fork: %s\n",
- strerror (errno));
- exit (1);
- }
-
- if (ret == 0)
- {
- /* Child */
-#define MAX_FD_LEN 64
- char write_pid_fd_as_string[MAX_FD_LEN];
- char write_address_fd_as_string[MAX_FD_LEN];
-
-#ifdef DBUS_BUILD_X11
- xdisplay = NULL;
-#endif
-
- if (close_stderr)
- do_close_stderr ();
-
- verbose ("=== Babysitter's intermediate parent created\n");
-
- /* Fork once more to create babysitter */
-
- ret = fork ();
- if (ret < 0)
- {
- fprintf (stderr, "Failed to fork: %s\n",
- strerror (errno));
- exit (1);
- }
-
- if (ret > 0)
- {
- /* In babysitter */
- verbose ("=== Babysitter's intermediate parent continues\n");
-
- close (bus_pid_to_launcher_pipe[READ_END]);
- close (bus_pid_to_launcher_pipe[WRITE_END]);
- close (bus_address_to_launcher_pipe[READ_END]);
- close (bus_address_to_launcher_pipe[WRITE_END]);
- close (bus_pid_to_babysitter_pipe[WRITE_END]);
-
- /* babysit() will fork *again*
- * and will also reap the pre-forked bus
- * daemon
- */
- babysit (exit_with_session, ret,
- bus_pid_to_babysitter_pipe[READ_END]);
- exit (0);
- }
-
- verbose ("=== Bus exec process created\n");
-
- /* Now we are the bus process (well, almost;
- * dbus-daemon itself forks again)
- */
- close (bus_pid_to_launcher_pipe[READ_END]);
- close (bus_address_to_launcher_pipe[READ_END]);
- close (bus_pid_to_babysitter_pipe[READ_END]);
- close (bus_pid_to_babysitter_pipe[WRITE_END]);
-
- sprintf (write_pid_fd_as_string,
- "%d", bus_pid_to_launcher_pipe[WRITE_END]);
-
- sprintf (write_address_fd_as_string,
- "%d", bus_address_to_launcher_pipe[WRITE_END]);
-
- verbose ("Calling exec()\n");
-
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
- {
- const char *test_daemon;
- /* exec from testdir */
- if (getenv ("DBUS_USE_TEST_BINARY") != NULL &&
- (test_daemon = getenv ("DBUS_TEST_DAEMON")) != NULL)
- {
- if (config_file == NULL && getenv ("DBUS_TEST_DATA") != NULL)
- {
- config_file = concat2 (getenv ("DBUS_TEST_DATA"),
- "/valid-config-files/session.conf");
-
- if (config_file == NULL)
- {
- fprintf (stderr, "Out of memory\n");
- exit (1);
- }
- }
-
- execl (test_daemon,
- test_daemon,
- "--fork",
- "--print-pid", write_pid_fd_as_string,
- "--print-address", write_address_fd_as_string,
- config_file ? "--config-file" : "--session",
- config_file, /* has to be last in this varargs list */
- NULL);
-
- fprintf (stderr,
- "Failed to execute test message bus daemon %s: %s.\n",
- test_daemon, strerror (errno));
- exit (1);
- }
- }
- #endif /* DBUS_ENABLE_EMBEDDED_TESTS */
-
- execl (DBUS_DAEMONDIR"/dbus-daemon",
- DBUS_DAEMONDIR"/dbus-daemon",
- "--fork",
- "--print-pid", write_pid_fd_as_string,
- "--print-address", write_address_fd_as_string,
- config_file ? "--config-file" : "--session",
- config_file, /* has to be last in this varargs list */
- NULL);
-
- fprintf (stderr,
- "Failed to execute message bus daemon %s: %s. Will try again without full path.\n",
- DBUS_DAEMONDIR"/dbus-daemon", strerror (errno));
-
- /*
- * If it failed, try running without full PATH. Note this is needed
- * because the build process builds the run-with-tmp-session-bus.conf
- * file and the dbus-daemon will not be in the install location during
- * build time.
- */
- execlp ("dbus-daemon",
- "dbus-daemon",
- "--fork",
- "--print-pid", write_pid_fd_as_string,
- "--print-address", write_address_fd_as_string,
- config_file ? "--config-file" : "--session",
- config_file, /* has to be last in this varargs list */
- NULL);
-
- fprintf (stderr,
- "Failed to execute message bus daemon: %s\n",
- strerror (errno));
- exit (1);
- }
- else
- {
- /* Parent */
-#define MAX_PID_LEN 64
- pid_t bus_pid;
- char bus_address[MAX_ADDR_LEN];
- char buf[MAX_PID_LEN];
- char *end;
- long wid = 0;
- long val;
-
- verbose ("=== Parent dbus-launch continues\n");
-
- close (bus_pid_to_launcher_pipe[WRITE_END]);
- close (bus_address_to_launcher_pipe[WRITE_END]);
- close (bus_pid_to_babysitter_pipe[READ_END]);
-
- verbose ("Waiting for babysitter's intermediate parent\n");
-
- /* Immediately reap parent of babysitter
- * (which was created just for us to reap)
- */
- if (do_waitpid (ret) < 0)
- {
- fprintf (stderr, "Failed to waitpid() for babysitter intermediate process: %s\n",
- strerror (errno));
- exit (1);
- }
-
- verbose ("Reading address from bus\n");
-
- /* Read the pipe data, print, and exit */
- switch (read_line (bus_address_to_launcher_pipe[READ_END],
- bus_address, MAX_ADDR_LEN))
- {
- case READ_STATUS_OK:
- break;
- case READ_STATUS_EOF:
- fprintf (stderr, "EOF in dbus-launch reading address from bus daemon\n");
- exit (1);
- break;
- case READ_STATUS_ERROR:
- fprintf (stderr, "Error in dbus-launch reading address from bus daemon: %s\n",
- strerror (errno));
- exit (1);
- break;
- }
-
- close (bus_address_to_launcher_pipe[READ_END]);
-
- verbose ("Reading PID from daemon\n");
- /* Now read data */
- switch (read_line (bus_pid_to_launcher_pipe[READ_END], buf, MAX_PID_LEN))
- {
- case READ_STATUS_OK:
- break;
- case READ_STATUS_EOF:
- fprintf (stderr, "EOF reading PID from bus daemon\n");
- exit (1);
- break;
- case READ_STATUS_ERROR:
- fprintf (stderr, "Error reading PID from bus daemon: %s\n",
- strerror (errno));
- exit (1);
- break;
- }
-
- end = NULL;
- val = strtol (buf, &end, 0);
- if (buf == end || end == NULL)
- {
- fprintf (stderr, "Failed to parse bus PID \"%s\": %s\n",
- buf, strerror (errno));
- exit (1);
- }
-
- bus_pid = val;
-
- close (bus_pid_to_launcher_pipe[READ_END]);
-
-#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
- if (xdisplay != NULL)
- {
- int ret2;
-
- verbose("Saving x11 address\n");
- ret2 = x11_save_address (bus_address, bus_pid, &wid);
- /* Only get an existing dbus session when autolaunching */
- if (autolaunch)
- {
- if (ret2 == 0)
- {
- char *address = NULL;
- /* another window got added. Return its address */
- bus_pid_to_kill = bus_pid;
- if (x11_get_address (&address, &bus_pid, &wid)
- && address != NULL)
- {
- verbose ("dbus-daemon is already running. Returning existing parameters.\n");
- /* Kill the old bus */
- kill_bus();
- pass_info (runprog, address, bus_pid, wid,
- c_shell_syntax, bourne_shell_syntax, binary_syntax,
- argc, argv, remaining_args);
- }
- }
- if (ret2 < 0)
- {
- fprintf (stderr, "Error saving bus information.\n");
- bus_pid_to_kill = bus_pid;
- kill_bus_and_exit (1);
- }
- }
- }
-#endif
-
- /* Forward the pid to the babysitter */
- write_pid (bus_pid_to_babysitter_pipe[WRITE_END], bus_pid);
- close (bus_pid_to_babysitter_pipe[WRITE_END]);
-
- pass_info (runprog, bus_address, bus_pid, wid, c_shell_syntax,
- bourne_shell_syntax, binary_syntax, argc, argv, remaining_args);
- }
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-launch.h b/src/3rd_party/dbus-1.7.8/tools/dbus-launch.h
deleted file mode 100644
index 8220bb8e82..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-launch.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-launch.h dbus-launch utility
- *
- * Copyright (C) 2006 Thiago Macieira <thiago@kde.org>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef DBUS_LAUNCH_H
-#define DBUS_LAUNCH_H
-
-#include <sys/types.h>
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#undef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-#define MAX_ADDR_LEN 512
-
-/* defined in dbus-launch.c */
-void verbose (const char *format, ...);
-char *xstrdup (const char *str);
-void kill_bus_and_exit (int exitcode);
-
-const char* get_machine_uuid (void);
-
-#ifdef DBUS_BUILD_X11
-/* defined in dbus-launch-x11.c */
-int x11_init (void);
-int x11_get_address (char **paddress, pid_t *pid, long *wid);
-int x11_save_address (char *address, pid_t pid, long *wid);
-void x11_handle_event (void);
-#endif
-
-#endif
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-monitor.c b/src/3rd_party/dbus-1.7.8/tools/dbus-monitor.c
deleted file mode 100644
index ff8390d7ea..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-monitor.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-monitor.c Utility program to monitor messages on the bus
- *
- * Copyright (C) 2003 Philip Blundell <philb@gnu.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef DBUS_WIN
-#include <winsock2.h>
-#undef interface
-#else
-#include <sys/time.h>
-#endif
-
-#include <time.h>
-
-#include "dbus-print-message.h"
-
-#define EAVESDROPPING_RULE "eavesdrop=true"
-
-#ifdef DBUS_WIN
-
-/* gettimeofday is not defined on windows */
-#define DBUS_SECONDS_SINCE_1601 11644473600LL
-#define DBUS_USEC_IN_SEC 1000000LL
-
-#ifdef DBUS_WINCE
-
-#ifndef _IOLBF
-#define _IOLBF 0x40
-#endif
-#ifndef _IONBF
-#define _IONBF 0x04
-#endif
-
-void
-GetSystemTimeAsFileTime (LPFILETIME ftp)
-{
- SYSTEMTIME st;
- GetSystemTime (&st);
- SystemTimeToFileTime (&st, ftp);
-}
-#endif
-
-static int
-gettimeofday (struct timeval *__p,
- void *__t)
-{
- union {
- unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */
- FILETIME ft;
- } now;
-
- GetSystemTimeAsFileTime (&now.ft);
- __p->tv_usec = (long) ((now.ns100 / 10LL) % DBUS_USEC_IN_SEC);
- __p->tv_sec = (long)(((now.ns100 / 10LL) / DBUS_SECONDS_SINCE_1601) - DBUS_SECONDS_SINCE_1601);
-
- return 0;
-}
-#endif
-
-inline static void
-oom (const char *doing)
-{
- fprintf (stderr, "OOM while %s\n", doing);
- exit (1);
-}
-
-static DBusHandlerResult
-monitor_filter_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- print_message (message, FALSE);
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- exit (0);
-
- /* Conceptually we want this to be
- * DBUS_HANDLER_RESULT_NOT_YET_HANDLED, but this raises
- * some problems. See bug 1719.
- */
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-#ifdef __APPLE__
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%d"
-#elif defined(__NetBSD__)
-#include <inttypes.h>
-#define PROFILE_TIMED_FORMAT "%s\t%" PRId64 "\t%d"
-#else
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%lu"
-#endif
-#define TRAP_NULL_STRING(str) ((str) ? (str) : "<none>")
-
-typedef enum
-{
- PROFILE_ATTRIBUTE_FLAG_SERIAL = 1,
- PROFILE_ATTRIBUTE_FLAG_REPLY_SERIAL = 2,
- PROFILE_ATTRIBUTE_FLAG_SENDER = 4,
- PROFILE_ATTRIBUTE_FLAG_DESTINATION = 8,
- PROFILE_ATTRIBUTE_FLAG_PATH = 16,
- PROFILE_ATTRIBUTE_FLAG_INTERFACE = 32,
- PROFILE_ATTRIBUTE_FLAG_MEMBER = 64,
- PROFILE_ATTRIBUTE_FLAG_ERROR_NAME = 128
-} ProfileAttributeFlags;
-
-static void
-profile_print_with_attrs (const char *type, DBusMessage *message,
- struct timeval *t, ProfileAttributeFlags attrs)
-{
- printf (PROFILE_TIMED_FORMAT, type, t->tv_sec, t->tv_usec);
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_SERIAL)
- printf ("\t%u", dbus_message_get_serial (message));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_REPLY_SERIAL)
- printf ("\t%u", dbus_message_get_reply_serial (message));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_SENDER)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_sender (message)));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_DESTINATION)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_destination (message)));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_PATH)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_path (message)));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_INTERFACE)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_interface (message)));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_MEMBER)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_member (message)));
-
- if (attrs & PROFILE_ATTRIBUTE_FLAG_ERROR_NAME)
- printf ("\t%s", TRAP_NULL_STRING (dbus_message_get_error_name (message)));
-
- printf ("\n");
-}
-
-static void
-print_message_profile (DBusMessage *message)
-{
- struct timeval t;
-
- if (gettimeofday (&t, NULL) < 0)
- {
- printf ("un\n");
- return;
- }
-
- switch (dbus_message_get_type (message))
- {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- profile_print_with_attrs ("mc", message, &t,
- PROFILE_ATTRIBUTE_FLAG_SERIAL |
- PROFILE_ATTRIBUTE_FLAG_SENDER |
- PROFILE_ATTRIBUTE_FLAG_PATH |
- PROFILE_ATTRIBUTE_FLAG_INTERFACE |
- PROFILE_ATTRIBUTE_FLAG_MEMBER);
- break;
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- profile_print_with_attrs ("mr", message, &t,
- PROFILE_ATTRIBUTE_FLAG_SERIAL |
- PROFILE_ATTRIBUTE_FLAG_DESTINATION |
- PROFILE_ATTRIBUTE_FLAG_REPLY_SERIAL);
- break;
- case DBUS_MESSAGE_TYPE_ERROR:
- profile_print_with_attrs ("err", message, &t,
- PROFILE_ATTRIBUTE_FLAG_SERIAL |
- PROFILE_ATTRIBUTE_FLAG_DESTINATION |
- PROFILE_ATTRIBUTE_FLAG_REPLY_SERIAL);
- break;
- case DBUS_MESSAGE_TYPE_SIGNAL:
- profile_print_with_attrs ("sig", message, &t,
- PROFILE_ATTRIBUTE_FLAG_SERIAL |
- PROFILE_ATTRIBUTE_FLAG_PATH |
- PROFILE_ATTRIBUTE_FLAG_INTERFACE |
- PROFILE_ATTRIBUTE_FLAG_MEMBER);
- break;
- default:
- printf (PROFILE_TIMED_FORMAT "\n", "tun", t.tv_sec, t.tv_usec);
- break;
- }
-}
-
-static DBusHandlerResult
-profile_filter_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- print_message_profile (message);
-
- if (dbus_message_is_signal (message,
- DBUS_INTERFACE_LOCAL,
- "Disconnected"))
- exit (0);
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void
-usage (char *name, int ecode)
-{
- fprintf (stderr, "Usage: %s [--system | --session | --address ADDRESS] [--monitor | --profile ] [watch expressions]\n", name);
- exit (ecode);
-}
-
-static void
-only_one_type (dbus_bool_t *seen_bus_type,
- char *name)
-{
- if (*seen_bus_type)
- {
- fprintf (stderr, "I only support monitoring one bus at a time!\n");
- usage (name, 1);
- }
- else
- {
- *seen_bus_type = TRUE;
- }
-}
-
-int
-main (int argc, char *argv[])
-{
- DBusConnection *connection;
- DBusError error;
- DBusBusType type = DBUS_BUS_SESSION;
- DBusHandleMessageFunction filter_func = monitor_filter_func;
- char *address = NULL;
- dbus_bool_t seen_bus_type = FALSE;
-
- int i = 0, j = 0, numFilters = 0;
- char **filters = NULL;
-
- /* Set stdout to be unbuffered; this is basically so that if people
- * do dbus-monitor > file, then send SIGINT via Control-C, they
- * don't lose the last chunk of messages.
- */
-
-#ifdef DBUS_WIN
- setvbuf (stdout, NULL, _IONBF, 0);
-#else
- setvbuf (stdout, NULL, _IOLBF, 0);
-#endif
-
- for (i = 1; i < argc; i++)
- {
- char *arg = argv[i];
-
- if (!strcmp (arg, "--system"))
- {
- only_one_type (&seen_bus_type, argv[0]);
- type = DBUS_BUS_SYSTEM;
- }
- else if (!strcmp (arg, "--session"))
- {
- only_one_type (&seen_bus_type, argv[0]);
- type = DBUS_BUS_SESSION;
- }
- else if (!strcmp (arg, "--address"))
- {
- only_one_type (&seen_bus_type, argv[0]);
-
- if (i+1 < argc)
- {
- address = argv[i+1];
- i++;
- }
- else
- usage (argv[0], 1);
- }
- else if (!strcmp (arg, "--help"))
- usage (argv[0], 0);
- else if (!strcmp (arg, "--monitor"))
- filter_func = monitor_filter_func;
- else if (!strcmp (arg, "--profile"))
- filter_func = profile_filter_func;
- else if (!strcmp (arg, "--"))
- continue;
- else if (arg[0] == '-')
- usage (argv[0], 1);
- else {
- unsigned int filter_len;
- numFilters++;
- /* Prepend a rule (and a comma) to enable the monitor to eavesdrop.
- * Prepending allows the user to add eavesdrop=false at command line
- * in order to disable eavesdropping when needed */
- filter_len = strlen (EAVESDROPPING_RULE) + 1 + strlen (arg) + 1;
-
- filters = (char **) realloc (filters, numFilters * sizeof (char *));
- if (filters == NULL)
- oom ("adding a new filter slot");
- filters[j] = (char *) malloc (filter_len);
- if (filters[j] == NULL)
- oom ("adding a new filter");
- snprintf (filters[j], filter_len, "%s,%s", EAVESDROPPING_RULE, arg);
- j++;
- }
- }
-
- dbus_error_init (&error);
-
- if (address != NULL)
- {
- connection = dbus_connection_open (address, &error);
- if (connection)
- {
- if (!dbus_bus_register (connection, &error))
- {
- fprintf (stderr, "Failed to register connection to bus at %s: %s\n",
- address, error.message);
- dbus_error_free (&error);
- exit (1);
- }
- }
- }
- else
- connection = dbus_bus_get (type, &error);
- if (connection == NULL)
- {
- const char *where;
- if (address != NULL)
- where = address;
- else
- {
- switch (type)
- {
- case DBUS_BUS_SYSTEM:
- where = "system bus";
- break;
- case DBUS_BUS_SESSION:
- where = "session bus";
- break;
- default:
- where = "";
- }
- }
- fprintf (stderr, "Failed to open connection to %s: %s\n",
- where,
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- if (numFilters)
- {
- size_t offset = 0;
- for (i = 0; i < j; i++)
- {
- dbus_bus_add_match (connection, filters[i] + offset, &error);
- if (dbus_error_is_set (&error) && i == 0 && offset == 0)
- {
- /* We might be talking to a pre-1.5.6 dbus-daemon
- * which wouldn't understand eavesdrop=true.
- * If this works, carry on with offset > 0
- * on the remaining iterations. */
- offset = strlen (EAVESDROPPING_RULE) + 1;
- dbus_error_free (&error);
- dbus_bus_add_match (connection, filters[i] + offset, &error);
- }
-
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "Failed to setup match \"%s\": %s\n",
- filters[i], error.message);
- dbus_error_free (&error);
- exit (1);
- }
- free(filters[i]);
- }
- }
- else
- {
- dbus_bus_add_match (connection,
- EAVESDROPPING_RULE,
- &error);
- if (dbus_error_is_set (&error))
- {
- dbus_error_free (&error);
- dbus_bus_add_match (connection,
- "",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- }
- }
-
- if (!dbus_connection_add_filter (connection, filter_func, NULL, NULL)) {
- fprintf (stderr, "Couldn't add filter!\n");
- exit (1);
- }
-
- while (dbus_connection_read_write_dispatch(connection, -1))
- ;
- exit (0);
- lose:
- fprintf (stderr, "Error: %s\n", error.message);
- exit (1);
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.c b/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.c
deleted file mode 100644
index 75d00acab2..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-print-message.h Utility function to print out a message
- *
- * Copyright (C) 2003 Philip Blundell <philb@gnu.org>
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "dbus-print-message.h"
-
-#include <stdlib.h>
-#include "config.h"
-
-static const char*
-type_to_name (int message_type)
-{
- switch (message_type)
- {
- case DBUS_MESSAGE_TYPE_SIGNAL:
- return "signal";
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- return "method call";
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- return "method return";
- case DBUS_MESSAGE_TYPE_ERROR:
- return "error";
- default:
- return "(unknown message type)";
- }
-}
-
-#define INDENT 3
-
-static void
-indent (int depth)
-{
- while (depth-- > 0)
- printf (" "); /* INDENT spaces. */
-}
-
-static void
-print_hex (unsigned char *bytes, unsigned int len, int depth)
-{
- unsigned int i, columns;
-
- printf ("array of bytes [\n");
-
- indent (depth + 1);
-
- /* Each byte takes 3 cells (two hexits, and a space), except the last one. */
- columns = (80 - ((depth + 1) * INDENT)) / 3;
-
- if (columns < 8)
- columns = 8;
-
- i = 0;
-
- while (i < len)
- {
- printf ("%02x", bytes[i]);
- i++;
-
- if (i != len)
- {
- if (i % columns == 0)
- {
- printf ("\n");
- indent (depth + 1);
- }
- else
- {
- printf (" ");
- }
- }
- }
-
- printf ("\n");
- indent (depth);
- printf ("]\n");
-}
-
-#define DEFAULT_SIZE 100
-
-static void
-print_ay (DBusMessageIter *iter, int depth)
-{
- /* Not using DBusString because it's not public API. It's 2009, and I'm
- * manually growing a string chunk by chunk.
- */
- unsigned char *bytes = malloc (DEFAULT_SIZE + 1);
- unsigned int len = 0;
- unsigned int max = DEFAULT_SIZE;
- dbus_bool_t all_ascii = TRUE;
- int current_type;
-
- while ((current_type = dbus_message_iter_get_arg_type (iter))
- != DBUS_TYPE_INVALID)
- {
- unsigned char val;
-
- dbus_message_iter_get_basic (iter, &val);
- bytes[len] = val;
- len++;
-
- if (val < 32 || val > 126)
- all_ascii = FALSE;
-
- if (len == max)
- {
- max *= 2;
- bytes = realloc (bytes, max + 1);
- }
-
- dbus_message_iter_next (iter);
- }
-
- if (all_ascii)
- {
- bytes[len] = '\0';
- printf ("array of bytes \"%s\"\n", bytes);
- }
- else
- {
- print_hex (bytes, len, depth);
- }
-
- free (bytes);
-}
-
-static void
-print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
-{
- do
- {
- int type = dbus_message_iter_get_arg_type (iter);
-
- if (type == DBUS_TYPE_INVALID)
- break;
-
- indent(depth);
-
- switch (type)
- {
- case DBUS_TYPE_STRING:
- {
- char *val;
- dbus_message_iter_get_basic (iter, &val);
- if (!literal)
- printf ("string \"");
- printf ("%s", val);
- if (!literal)
- printf ("\"\n");
- break;
- }
-
- case DBUS_TYPE_SIGNATURE:
- {
- char *val;
- dbus_message_iter_get_basic (iter, &val);
- if (!literal)
- printf ("signature \"");
- printf ("%s", val);
- if (!literal)
- printf ("\"\n");
- break;
- }
-
- case DBUS_TYPE_OBJECT_PATH:
- {
- char *val;
- dbus_message_iter_get_basic (iter, &val);
- if (!literal)
- printf ("object path \"");
- printf ("%s", val);
- if (!literal)
- printf ("\"\n");
- break;
- }
-
- case DBUS_TYPE_INT16:
- {
- dbus_int16_t val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("int16 %d\n", val);
- break;
- }
-
- case DBUS_TYPE_UINT16:
- {
- dbus_uint16_t val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("uint16 %u\n", val);
- break;
- }
-
- case DBUS_TYPE_INT32:
- {
- dbus_int32_t val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("int32 %d\n", val);
- break;
- }
-
- case DBUS_TYPE_UINT32:
- {
- dbus_uint32_t val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("uint32 %u\n", val);
- break;
- }
-
- case DBUS_TYPE_INT64:
- {
- dbus_int64_t val;
- dbus_message_iter_get_basic (iter, &val);
-#ifdef DBUS_INT64_PRINTF_MODIFIER
- printf ("int64 %" DBUS_INT64_PRINTF_MODIFIER "d\n", val);
-#else
- printf ("int64 (omitted)\n");
-#endif
- break;
- }
-
- case DBUS_TYPE_UINT64:
- {
- dbus_uint64_t val;
- dbus_message_iter_get_basic (iter, &val);
-#ifdef DBUS_INT64_PRINTF_MODIFIER
- printf ("uint64 %" DBUS_INT64_PRINTF_MODIFIER "u\n", val);
-#else
- printf ("uint64 (omitted)\n");
-#endif
- break;
- }
-
- case DBUS_TYPE_DOUBLE:
- {
- double val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("double %g\n", val);
- break;
- }
-
- case DBUS_TYPE_BYTE:
- {
- unsigned char val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("byte %d\n", val);
- break;
- }
-
- case DBUS_TYPE_BOOLEAN:
- {
- dbus_bool_t val;
- dbus_message_iter_get_basic (iter, &val);
- printf ("boolean %s\n", val ? "true" : "false");
- break;
- }
-
- case DBUS_TYPE_VARIANT:
- {
- DBusMessageIter subiter;
-
- dbus_message_iter_recurse (iter, &subiter);
-
- printf ("variant ");
- print_iter (&subiter, literal, depth+1);
- break;
- }
- case DBUS_TYPE_ARRAY:
- {
- int current_type;
- DBusMessageIter subiter;
-
- dbus_message_iter_recurse (iter, &subiter);
-
- current_type = dbus_message_iter_get_arg_type (&subiter);
-
- if (current_type == DBUS_TYPE_BYTE)
- {
- print_ay (&subiter, depth);
- break;
- }
-
- printf("array [\n");
- while (current_type != DBUS_TYPE_INVALID)
- {
- print_iter (&subiter, literal, depth+1);
-
- dbus_message_iter_next (&subiter);
- current_type = dbus_message_iter_get_arg_type (&subiter);
-
- if (current_type != DBUS_TYPE_INVALID)
- printf (",");
- }
- indent(depth);
- printf("]\n");
- break;
- }
- case DBUS_TYPE_DICT_ENTRY:
- {
- DBusMessageIter subiter;
-
- dbus_message_iter_recurse (iter, &subiter);
-
- printf("dict entry(\n");
- print_iter (&subiter, literal, depth+1);
- dbus_message_iter_next (&subiter);
- print_iter (&subiter, literal, depth+1);
- indent(depth);
- printf(")\n");
- break;
- }
-
- case DBUS_TYPE_STRUCT:
- {
- int current_type;
- DBusMessageIter subiter;
-
- dbus_message_iter_recurse (iter, &subiter);
-
- printf("struct {\n");
- while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID)
- {
- print_iter (&subiter, literal, depth+1);
- dbus_message_iter_next (&subiter);
- if (dbus_message_iter_get_arg_type (&subiter) != DBUS_TYPE_INVALID)
- printf (",");
- }
- indent(depth);
- printf("}\n");
- break;
- }
-
- default:
- printf (" (dbus-monitor too dumb to decipher arg type '%c')\n", type);
- break;
- }
- } while (dbus_message_iter_next (iter));
-}
-
-void
-print_message (DBusMessage *message, dbus_bool_t literal)
-{
- DBusMessageIter iter;
- const char *sender;
- const char *destination;
- int message_type;
-
- message_type = dbus_message_get_type (message);
- sender = dbus_message_get_sender (message);
- destination = dbus_message_get_destination (message);
-
- if (!literal)
- {
- printf ("%s sender=%s -> dest=%s",
- type_to_name (message_type),
- sender ? sender : "(null sender)",
- destination ? destination : "(null destination)");
-
- switch (message_type)
- {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- case DBUS_MESSAGE_TYPE_SIGNAL:
- printf (" serial=%u path=%s; interface=%s; member=%s\n",
- dbus_message_get_serial (message),
- dbus_message_get_path (message),
- dbus_message_get_interface (message),
- dbus_message_get_member (message));
- break;
-
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- printf (" reply_serial=%u\n",
- dbus_message_get_reply_serial (message));
- break;
-
- case DBUS_MESSAGE_TYPE_ERROR:
- printf (" error_name=%s reply_serial=%u\n",
- dbus_message_get_error_name (message),
- dbus_message_get_reply_serial (message));
- break;
-
- default:
- printf ("\n");
- break;
- }
- }
-
- dbus_message_iter_init (message, &iter);
- print_iter (&iter, literal, 1);
- fflush (stdout);
-
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.h b/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.h
deleted file mode 100644
index 26700d8431..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-print-message.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-print-message.h Utility function to print out a message
- *
- * Copyright (C) 2003 Philip Blundell <philb@gnu.org>
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-#ifndef DBUS_PRINT_MESSAGE_H
-#define DBUS_PRINT_MESSAGE_H
-
-#include <stdio.h>
-#include <string.h>
-#include <dbus/dbus.h>
-
-void print_message (DBusMessage *message, dbus_bool_t literal);
-
-#endif /* DBUS_PRINT_MESSAGE_H */
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-run-session.c b/src/3rd_party/dbus-1.7.8/tools/dbus-run-session.c
deleted file mode 100644
index 105ab3b4fe..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-run-session.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-run-session.c - run a child process in its own session
- *
- * Copyright © 2003-2006 Red Hat, Inc.
- * Copyright © 2006 Thiago Macieira <thiago@kde.org>
- * Copyright © 2011-2012 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-
-#include "dbus/dbus.h"
-
-#define MAX_ADDR_LEN 512
-#define PIPE_READ_END 0
-#define PIPE_WRITE_END 1
-
-/* PROCESSES
- *
- * If you are in a shell and run "dbus-run-session myapp", here is what
- * happens (compare and contrast with dbus-launch):
- *
- * shell
- * \- dbus-run-session myapp
- * \- dbus-daemon --nofork --print-address --session
- * \- myapp
- *
- * All processes are long-running.
- *
- * When myapp exits, dbus-run-session kills dbus-daemon and terminates.
- *
- * If dbus-daemon exits, dbus-run-session warns and continues to run.
- *
- * PIPES
- *
- * dbus-daemon --print-address -> bus_address_pipe -> d-r-s
- */
-
-static const char me[] = "dbus-run-session";
-
-static void
-usage (int ecode)
-{
- fprintf (stderr,
- "%s [OPTIONS] [--] PROGRAM [ARGUMENTS]\n"
- "%s --version\n"
- "%s --help\n"
- "\n"
- "Options:\n"
- "--dbus-daemon=BINARY run BINARY instead of dbus-daemon\n"
- "--config-file=FILENAME pass to dbus-daemon instead of --session\n"
- "\n",
- me, me, me);
- exit (ecode);
-}
-
-static void
-version (void)
-{
- printf ("%s %s\n"
- "Copyright (C) 2003-2006 Red Hat, Inc.\n"
- "Copyright (C) 2006 Thiago Macieira\n"
- "Copyright © 2011-2012 Nokia Corporation\n"
- "\n"
- "This is free software; see the source for copying conditions.\n"
- "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
- me, VERSION);
- exit (0);
-}
-
-static void
-oom (void)
-{
- fprintf (stderr, "%s: out of memory\n", me);
- exit (1);
-}
-
-typedef enum
-{
- READ_STATUS_OK, /**< Read succeeded */
- READ_STATUS_ERROR, /**< Some kind of error */
- READ_STATUS_EOF /**< EOF returned */
-} ReadStatus;
-
-static ReadStatus
-read_line (int fd,
- char *buf,
- size_t maxlen)
-{
- size_t bytes = 0;
- ReadStatus retval;
-
- memset (buf, '\0', maxlen);
- maxlen -= 1; /* ensure nul term */
-
- retval = READ_STATUS_OK;
-
- while (1)
- {
- ssize_t chunk;
- size_t to_read;
-
- again:
- to_read = maxlen - bytes;
-
- if (to_read == 0)
- break;
-
- chunk = read (fd,
- buf + bytes,
- to_read);
- if (chunk < 0 && errno == EINTR)
- goto again;
-
- if (chunk < 0)
- {
- retval = READ_STATUS_ERROR;
- break;
- }
- else if (chunk == 0)
- {
- retval = READ_STATUS_EOF;
- break; /* EOF */
- }
- else /* chunk > 0 */
- bytes += chunk;
- }
-
- if (retval == READ_STATUS_EOF &&
- bytes > 0)
- retval = READ_STATUS_OK;
-
- /* whack newline */
- if (retval != READ_STATUS_ERROR &&
- bytes > 0 &&
- buf[bytes-1] == '\n')
- buf[bytes-1] = '\0';
-
- return retval;
-}
-
-static void
-exec_dbus_daemon (const char *dbus_daemon,
- int bus_address_pipe[2],
- const char *config_file)
-{
- /* Child process, which execs dbus-daemon or dies trying */
-#define MAX_FD_LEN 64
- char write_address_fd_as_string[MAX_FD_LEN];
-
- close (bus_address_pipe[PIPE_READ_END]);
-
- sprintf (write_address_fd_as_string, "%d", bus_address_pipe[PIPE_WRITE_END]);
-
- execlp (dbus_daemon,
- dbus_daemon,
- "--nofork",
- "--print-address", write_address_fd_as_string,
- config_file ? "--config-file" : "--session",
- config_file, /* has to be last in this varargs list */
- NULL);
-
- fprintf (stderr, "%s: failed to execute message bus daemon '%s': %s\n",
- me, dbus_daemon, strerror (errno));
-}
-
-static void
-exec_app (int prog_arg, char **argv)
-{
- execvp (argv[prog_arg], argv + prog_arg);
-
- fprintf (stderr, "%s: failed to exec '%s': %s\n", me, argv[prog_arg],
- strerror (errno));
- exit (1);
-}
-
-int
-main (int argc, char **argv)
-{
- int prog_arg = 0;
- int bus_address_pipe[2] = { 0, 0 };
- const char *config_file = NULL;
- const char *dbus_daemon = NULL;
- char bus_address[MAX_ADDR_LEN] = { 0 };
- const char *prev_arg = NULL;
- int i = 1;
- int requires_arg = 0;
- pid_t bus_pid;
- pid_t app_pid;
-
- while (i < argc)
- {
- const char *arg = argv[i];
-
- if (requires_arg)
- {
- const char **arg_dest;
-
- assert (prev_arg != NULL);
-
- if (strcmp (prev_arg, "--config-file") == 0)
- {
- arg_dest = &config_file;
- }
- else if (strcmp (prev_arg, "--dbus-daemon") == 0)
- {
- arg_dest = &dbus_daemon;
- }
- else
- {
- /* shouldn't happen */
- fprintf (stderr, "%s: internal error: %s not fully implemented\n",
- me, prev_arg);
- return 127;
- }
-
- if (*arg_dest != NULL)
- {
- fprintf (stderr, "%s: %s given twice\n", me, prev_arg);
- return 127;
- }
-
- *arg_dest = arg;
- requires_arg = 0;
- prev_arg = arg;
- ++i;
- continue;
- }
-
- if (strcmp (arg, "--help") == 0 ||
- strcmp (arg, "-h") == 0 ||
- strcmp (arg, "-?") == 0)
- {
- usage (0);
- }
- else if (strcmp (arg, "--version") == 0)
- {
- version ();
- }
- else if (strstr (arg, "--config-file=") == arg)
- {
- const char *file;
-
- if (config_file != NULL)
- {
- fprintf (stderr, "%s: --config-file given twice\n", me);
- return 127;
- }
-
- file = strchr (arg, '=');
- ++file;
-
- config_file = file;
- }
- else if (strstr (arg, "--dbus-daemon=") == arg)
- {
- const char *file;
-
- if (dbus_daemon != NULL)
- {
- fprintf (stderr, "%s: --dbus-daemon given twice\n", me);
- return 127;
- }
-
- file = strchr (arg, '=');
- ++file;
-
- dbus_daemon = file;
- }
- else if (strcmp (arg, "--config-file") == 0 ||
- strcmp (arg, "--dbus-daemon") == 0)
- {
- requires_arg = 1;
- }
- else if (arg[0] == '-')
- {
- if (strcmp (arg, "--") != 0)
- {
- fprintf (stderr, "%s: option '%s' is unknown\n", me, arg);
- return 127;
- }
- else
- {
- prog_arg = i + 1;
- break;
- }
- }
- else
- {
- prog_arg = i;
- break;
- }
-
- prev_arg = arg;
- ++i;
- }
-
- /* "dbus-run-session" and "dbus-run-session ... --" are not allowed:
- * there must be something to run */
- if (prog_arg < 1 || prog_arg >= argc)
- {
- fprintf (stderr, "%s: a non-option argument is required\n", me);
- return 127;
- }
-
- if (requires_arg)
- {
- fprintf (stderr, "%s: option '%s' requires an argument\n", me, prev_arg);
- return 127;
- }
-
- if (dbus_daemon == NULL)
- dbus_daemon = "dbus-daemon";
-
- if (pipe (bus_address_pipe) < 0)
- {
- fprintf (stderr, "%s: failed to create pipe: %s\n", me, strerror (errno));
- return 127;
- }
-
- bus_pid = fork ();
-
- if (bus_pid < 0)
- {
- fprintf (stderr, "%s: failed to fork: %s\n", me, strerror (errno));
- return 127;
- }
-
- if (bus_pid == 0)
- {
- /* child */
- exec_dbus_daemon (dbus_daemon, bus_address_pipe, config_file);
- /* not reached */
- return 127;
- }
-
- close (bus_address_pipe[PIPE_WRITE_END]);
-
- switch (read_line (bus_address_pipe[PIPE_READ_END], bus_address, MAX_ADDR_LEN))
- {
- case READ_STATUS_OK:
- break;
-
- case READ_STATUS_EOF:
- fprintf (stderr, "%s: EOF reading address from bus daemon\n", me);
- return 127;
- break;
-
- case READ_STATUS_ERROR:
- fprintf (stderr, "%s: error reading address from bus daemon: %s\n",
- me, strerror (errno));
- return 127;
- break;
- }
-
- close (bus_address_pipe[PIPE_READ_END]);
-
- if (!dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", bus_address) ||
- !dbus_setenv ("DBUS_SESSION_BUS_PID", NULL) ||
- !dbus_setenv ("DBUS_SESSION_BUS_WINDOWID", NULL) ||
- !dbus_setenv ("DBUS_STARTER_ADDRESS", NULL) ||
- !dbus_setenv ("DBUS_STARTER_BUS_TYPE", NULL))
- oom ();
-
- app_pid = fork ();
-
- if (app_pid < 0)
- {
- fprintf (stderr, "%s: failed to fork: %s\n", me, strerror (errno));
- return 127;
- }
-
- if (app_pid == 0)
- {
- /* child */
- exec_app (prog_arg, argv);
- /* not reached */
- return 127;
- }
-
- while (1)
- {
- int child_status;
- pid_t child_pid = waitpid (-1, &child_status, 0);
-
- if (child_pid == (pid_t) -1)
- {
- int errsv = errno;
-
- if (errsv == EINTR)
- continue;
-
- /* shouldn't happen: the only other documented errors are ECHILD,
- * which shouldn't happen because we terminate when all our children
- * have died, and EINVAL, which would indicate programming error */
- fprintf (stderr, "%s: waitpid() failed: %s\n", me, strerror (errsv));
- return 127;
- }
- else if (child_pid == bus_pid)
- {
- /* no need to kill it, now */
- bus_pid = 0;
-
- if (WIFEXITED (child_status))
- fprintf (stderr, "%s: dbus-daemon exited with code %d\n",
- me, WEXITSTATUS (child_status));
- else if (WIFSIGNALED (child_status))
- fprintf (stderr, "%s: dbus-daemon terminated by signal %d\n",
- me, WTERMSIG (child_status));
- else
- fprintf (stderr, "%s: dbus-daemon died or something\n", me);
- }
- else if (child_pid == app_pid)
- {
- if (bus_pid != 0)
- kill (bus_pid, SIGTERM);
-
- if (WIFEXITED (child_status))
- return WEXITSTATUS (child_status);
-
- /* if it died from a signal, behave like sh(1) */
- if (WIFSIGNALED (child_status))
- return 128 + WTERMSIG (child_status);
-
- /* I give up (this should never be reached) */
- fprintf (stderr, "%s: child process died or something\n", me);
- return 127;
- }
- else
- {
- fprintf (stderr, "%s: ignoring unknown child process %ld\n", me,
- (long) child_pid);
- }
- }
-
- return 0;
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-send.c b/src/3rd_party/dbus-1.7.8/tools/dbus-send.c
deleted file mode 100644
index d3ff258989..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-send.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-send.c Utility program to send messages from the command line
- *
- * Copyright (C) 2003 Philip Blundell <philb@gnu.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <dbus/dbus.h>
-
-#ifndef HAVE_STRTOLL
-#undef strtoll
-#define strtoll mystrtoll
-#include "strtoll.c"
-#endif
-
-#ifndef HAVE_STRTOULL
-#undef strtoull
-#define strtoull mystrtoull
-#include "strtoull.c"
-#endif
-
-#ifdef DBUS_WINCE
-#ifndef strdup
-#define strdup _strdup
-#endif
-#endif
-
-#include "dbus-print-message.h"
-
-static const char *appname;
-
-static void
-usage (int ecode)
-{
- fprintf (stderr, "Usage: %s [--help] [--system | --session | --bus=ADDRESS | --peer=ADDRESS] [--dest=NAME] [--type=TYPE] [--print-reply[=literal]] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]\n", appname);
- exit (ecode);
-}
-
-static void
-append_arg (DBusMessageIter *iter, int type, const char *value)
-{
- dbus_uint16_t uint16;
- dbus_int16_t int16;
- dbus_uint32_t uint32;
- dbus_int32_t int32;
- dbus_uint64_t uint64;
- dbus_int64_t int64;
- double d;
- unsigned char byte;
- dbus_bool_t v_BOOLEAN;
-
- /* FIXME - we are ignoring OOM returns on all these functions */
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- byte = strtoul (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_BYTE, &byte);
- break;
-
- case DBUS_TYPE_DOUBLE:
- d = strtod (value, NULL);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &d);
- break;
-
- case DBUS_TYPE_INT16:
- int16 = strtol (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_INT16, &int16);
- break;
-
- case DBUS_TYPE_UINT16:
- uint16 = strtoul (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT16, &uint16);
- break;
-
- case DBUS_TYPE_INT32:
- int32 = strtol (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &int32);
- break;
-
- case DBUS_TYPE_UINT32:
- uint32 = strtoul (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT32, &uint32);
- break;
-
- case DBUS_TYPE_INT64:
- int64 = strtoll (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_INT64, &int64);
- break;
-
- case DBUS_TYPE_UINT64:
- uint64 = strtoull (value, NULL, 0);
- dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT64, &uint64);
- break;
-
- case DBUS_TYPE_STRING:
- dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &value);
- break;
-
- case DBUS_TYPE_OBJECT_PATH:
- dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &value);
- break;
-
- case DBUS_TYPE_BOOLEAN:
- if (strcmp (value, "true") == 0)
- {
- v_BOOLEAN = TRUE;
- dbus_message_iter_append_basic (iter, DBUS_TYPE_BOOLEAN, &v_BOOLEAN);
- }
- else if (strcmp (value, "false") == 0)
- {
- v_BOOLEAN = FALSE;
- dbus_message_iter_append_basic (iter, DBUS_TYPE_BOOLEAN, &v_BOOLEAN);
- }
- else
- {
- fprintf (stderr, "%s: Expected \"true\" or \"false\" instead of \"%s\"\n", appname, value);
- exit (1);
- }
- break;
-
- default:
- fprintf (stderr, "%s: Unsupported data type %c\n", appname, (char) type);
- exit (1);
- }
-}
-
-static void
-append_array (DBusMessageIter *iter, int type, const char *value)
-{
- const char *val;
- char *dupval = strdup (value);
-
- val = strtok (dupval, ",");
- while (val != NULL)
- {
- append_arg (iter, type, val);
- val = strtok (NULL, ",");
- }
- free (dupval);
-}
-
-static void
-append_dict (DBusMessageIter *iter, int keytype, int valtype, const char *value)
-{
- const char *val;
- char *dupval = strdup (value);
-
- val = strtok (dupval, ",");
- while (val != NULL)
- {
- DBusMessageIter subiter;
-
- dbus_message_iter_open_container (iter,
- DBUS_TYPE_DICT_ENTRY,
- NULL,
- &subiter);
-
- append_arg (&subiter, keytype, val);
- val = strtok (NULL, ",");
- if (val == NULL)
- {
- fprintf (stderr, "%s: Malformed dictionary\n", appname);
- exit (1);
- }
- append_arg (&subiter, valtype, val);
-
- dbus_message_iter_close_container (iter, &subiter);
- val = strtok (NULL, ",");
- }
- free (dupval);
-}
-
-static int
-type_from_name (const char *arg)
-{
- int type;
- if (!strcmp (arg, "string"))
- type = DBUS_TYPE_STRING;
- else if (!strcmp (arg, "int16"))
- type = DBUS_TYPE_INT16;
- else if (!strcmp (arg, "uint16"))
- type = DBUS_TYPE_UINT16;
- else if (!strcmp (arg, "int32"))
- type = DBUS_TYPE_INT32;
- else if (!strcmp (arg, "uint32"))
- type = DBUS_TYPE_UINT32;
- else if (!strcmp (arg, "int64"))
- type = DBUS_TYPE_INT64;
- else if (!strcmp (arg, "uint64"))
- type = DBUS_TYPE_UINT64;
- else if (!strcmp (arg, "double"))
- type = DBUS_TYPE_DOUBLE;
- else if (!strcmp (arg, "byte"))
- type = DBUS_TYPE_BYTE;
- else if (!strcmp (arg, "boolean"))
- type = DBUS_TYPE_BOOLEAN;
- else if (!strcmp (arg, "objpath"))
- type = DBUS_TYPE_OBJECT_PATH;
- else
- {
- fprintf (stderr, "%s: Unknown type \"%s\"\n", appname, arg);
- exit (1);
- }
- return type;
-}
-
-int
-main (int argc, char *argv[])
-{
- DBusConnection *connection;
- DBusError error;
- DBusMessage *message;
- int print_reply;
- int print_reply_literal;
- int reply_timeout;
- DBusMessageIter iter;
- int i;
- DBusBusType type = DBUS_BUS_SESSION;
- const char *dest = NULL;
- const char *name = NULL;
- const char *path = NULL;
- int message_type = DBUS_MESSAGE_TYPE_SIGNAL;
- const char *type_str = NULL;
- const char *address = NULL;
- int is_bus = FALSE;
- int session_or_system = FALSE;
-
- appname = argv[0];
-
- if (argc < 3)
- usage (1);
-
- print_reply = FALSE;
- print_reply_literal = FALSE;
- reply_timeout = -1;
-
- for (i = 1; i < argc && name == NULL; i++)
- {
- char *arg = argv[i];
-
- if (strcmp (arg, "--system") == 0)
- {
- type = DBUS_BUS_SYSTEM;
- session_or_system = TRUE;
- }
- else if (strcmp (arg, "--session") == 0)
- {
- type = DBUS_BUS_SESSION;
- session_or_system = TRUE;
- }
- else if ((strstr (arg, "--bus=") == arg) || (strstr (arg, "--peer=") == arg) || (strstr (arg, "--address=") == arg))
- {
- if (arg[2] == 'b') /* bus */
- {
- is_bus = TRUE;
- }
- else if (arg[2] == 'p') /* peer */
- {
- is_bus = FALSE;
- }
- else /* address; keeping backwards compatibility */
- {
- is_bus = FALSE;
- }
-
- address = strchr (arg, '=') + 1;
-
- if (address[0] == '\0')
- {
- fprintf (stderr, "\"--peer=\" and \"--bus=\" require an ADDRESS\n");
- usage (1);
- }
- }
- else if (strncmp (arg, "--print-reply", 13) == 0)
- {
- print_reply = TRUE;
- message_type = DBUS_MESSAGE_TYPE_METHOD_CALL;
- if (strcmp (arg + 13, "=literal") == 0)
- print_reply_literal = TRUE;
- else if (*(arg + 13) != '\0')
- {
- fprintf (stderr, "invalid value (%s) of \"--print-reply\"\n", arg + 13);
- usage (1);
- }
- }
- else if (strstr (arg, "--reply-timeout=") == arg)
- {
- if (*(strchr (arg, '=') + 1) == '\0')
- {
- fprintf (stderr, "\"--reply-timeout=\" requires an MSEC\n");
- usage (1);
- }
- reply_timeout = strtol (strchr (arg, '=') + 1,
- NULL, 10);
- if (reply_timeout <= 0)
- {
- fprintf (stderr, "invalid value (%s) of \"--reply-timeout\"\n",
- strchr (arg, '=') + 1);
- usage (1);
- }
- }
- else if (strstr (arg, "--dest=") == arg)
- {
- if (*(strchr (arg, '=') + 1) == '\0')
- {
- fprintf (stderr, "\"--dest=\" requires an NAME\n");
- usage (1);
- }
- dest = strchr (arg, '=') + 1;
- }
- else if (strstr (arg, "--type=") == arg)
- type_str = strchr (arg, '=') + 1;
- else if (!strcmp(arg, "--help"))
- usage (0);
- else if (arg[0] == '-')
- usage (1);
- else if (path == NULL)
- path = arg;
- else /* name == NULL guaranteed by the 'while' loop */
- name = arg;
- }
-
- if (name == NULL)
- usage (1);
-
- if (session_or_system &&
- (address != NULL))
- {
- fprintf (stderr, "\"--peer\" and \"--bus\" may not be used with \"--system\" or \"--session\"\n");
- usage (1);
- }
-
- if (type_str != NULL)
- {
- message_type = dbus_message_type_from_string (type_str);
- if (!(message_type == DBUS_MESSAGE_TYPE_METHOD_CALL ||
- message_type == DBUS_MESSAGE_TYPE_SIGNAL))
- {
- fprintf (stderr, "Message type \"%s\" is not supported\n",
- type_str);
- exit (1);
- }
- }
-
- dbus_error_init (&error);
-
- if (dest && !dbus_validate_bus_name (dest, &error))
- {
- fprintf (stderr, "invalid value (%s) of \"--dest\"\n", dest);
- usage (1);
- }
-
- if (address != NULL)
- {
- connection = dbus_connection_open (address, &error);
- }
- else
- {
- connection = dbus_bus_get (type, &error);
- }
-
- if (connection == NULL)
- {
- fprintf (stderr, "Failed to open connection to \"%s\" message bus: %s\n",
- (address != NULL) ? address :
- ((type == DBUS_BUS_SYSTEM) ? "system" : "session"),
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
- else if ((address != NULL) && is_bus)
- {
- if (!dbus_bus_register (connection, &error))
- {
- fprintf (stderr, "Failed to register on connection to \"%s\" message bus: %s\n",
- address, error.message);
- dbus_error_free (&error);
- exit (1);
- }
- }
-
- if (message_type == DBUS_MESSAGE_TYPE_METHOD_CALL)
- {
- char *last_dot;
-
- last_dot = strrchr (name, '.');
- if (last_dot == NULL)
- {
- fprintf (stderr, "Must use org.mydomain.Interface.Method notation, no dot in \"%s\"\n",
- name);
- exit (1);
- }
- *last_dot = '\0';
-
- message = dbus_message_new_method_call (NULL,
- path,
- name,
- last_dot + 1);
- dbus_message_set_auto_start (message, TRUE);
- }
- else if (message_type == DBUS_MESSAGE_TYPE_SIGNAL)
- {
- char *last_dot;
-
- last_dot = strrchr (name, '.');
- if (last_dot == NULL)
- {
- fprintf (stderr, "Must use org.mydomain.Interface.Signal notation, no dot in \"%s\"\n",
- name);
- exit (1);
- }
- *last_dot = '\0';
-
- message = dbus_message_new_signal (path, name, last_dot + 1);
- }
- else
- {
- fprintf (stderr, "Internal error, unknown message type\n");
- exit (1);
- }
-
- if (message == NULL)
- {
- fprintf (stderr, "Couldn't allocate D-Bus message\n");
- exit (1);
- }
-
- if (dest && !dbus_message_set_destination (message, dest))
- {
- fprintf (stderr, "Not enough memory\n");
- exit (1);
- }
-
- dbus_message_iter_init_append (message, &iter);
-
- while (i < argc)
- {
- char *arg;
- char *c;
- int type;
- int secondary_type;
- int container_type;
- DBusMessageIter *target_iter;
- DBusMessageIter container_iter;
-
- type = DBUS_TYPE_INVALID;
- arg = argv[i++];
- c = strchr (arg, ':');
-
- if (c == NULL)
- {
- fprintf (stderr, "%s: Data item \"%s\" is badly formed\n", argv[0], arg);
- exit (1);
- }
-
- *(c++) = 0;
-
- container_type = DBUS_TYPE_INVALID;
-
- if (strcmp (arg, "variant") == 0)
- container_type = DBUS_TYPE_VARIANT;
- else if (strcmp (arg, "array") == 0)
- container_type = DBUS_TYPE_ARRAY;
- else if (strcmp (arg, "dict") == 0)
- container_type = DBUS_TYPE_DICT_ENTRY;
-
- if (container_type != DBUS_TYPE_INVALID)
- {
- arg = c;
- c = strchr (arg, ':');
- if (c == NULL)
- {
- fprintf (stderr, "%s: Data item \"%s\" is badly formed\n", argv[0], arg);
- exit (1);
- }
- *(c++) = 0;
- }
-
- if (arg[0] == 0)
- type = DBUS_TYPE_STRING;
- else
- type = type_from_name (arg);
-
- if (container_type == DBUS_TYPE_DICT_ENTRY)
- {
- char sig[5];
- arg = c;
- c = strchr (c, ':');
- if (c == NULL)
- {
- fprintf (stderr, "%s: Data item \"%s\" is badly formed\n", argv[0], arg);
- exit (1);
- }
- *(c++) = 0;
- secondary_type = type_from_name (arg);
- sig[0] = DBUS_DICT_ENTRY_BEGIN_CHAR;
- sig[1] = type;
- sig[2] = secondary_type;
- sig[3] = DBUS_DICT_ENTRY_END_CHAR;
- sig[4] = '\0';
- dbus_message_iter_open_container (&iter,
- DBUS_TYPE_ARRAY,
- sig,
- &container_iter);
- target_iter = &container_iter;
- }
- else if (container_type != DBUS_TYPE_INVALID)
- {
- char sig[2];
- sig[0] = type;
- sig[1] = '\0';
- dbus_message_iter_open_container (&iter,
- container_type,
- sig,
- &container_iter);
- target_iter = &container_iter;
- }
- else
- target_iter = &iter;
-
- if (container_type == DBUS_TYPE_ARRAY)
- {
- append_array (target_iter, type, c);
- }
- else if (container_type == DBUS_TYPE_DICT_ENTRY)
- {
- append_dict (target_iter, type, secondary_type, c);
- }
- else
- append_arg (target_iter, type, c);
-
- if (container_type != DBUS_TYPE_INVALID)
- {
- dbus_message_iter_close_container (&iter,
- &container_iter);
- }
- }
-
- if (print_reply)
- {
- DBusMessage *reply;
-
- dbus_error_init (&error);
- reply = dbus_connection_send_with_reply_and_block (connection,
- message, reply_timeout,
- &error);
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "Error %s: %s\n",
- error.name,
- error.message);
- exit (1);
- }
-
- if (reply)
- {
- print_message (reply, print_reply_literal);
- dbus_message_unref (reply);
- }
- }
- else
- {
- dbus_connection_send (connection, message, NULL);
- dbus_connection_flush (connection);
- }
-
- dbus_message_unref (message);
-
- dbus_connection_unref (connection);
-
- exit (0);
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/dbus-uuidgen.c b/src/3rd_party/dbus-1.7.8/tools/dbus-uuidgen.c
deleted file mode 100644
index c8ba1cf7a2..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/dbus-uuidgen.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-uuidgen.c Utility program to create UUIDs
- *
- * Copyright (C) 2006 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <dbus/dbus-uuidgen.h>
-#include <dbus/dbus.h>
-
-static void
-usage (char *name, int ecode)
-{
- if (name == NULL)
- name = "dbus-uuidgen";
-
- fprintf (stderr, "Usage: %s [--ensure[=FILENAME]] [--get[=FILENAME]]\n", name);
- exit (ecode);
-}
-
-static void
-version (void)
-{
- printf ("D-Bus UUID Generator %s\n"
- "Copyright (C) 2006 Red Hat, Inc.\n"
- "This is free software; see the source for copying conditions.\n"
- "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
- VERSION);
- exit (0);
-}
-
-static dbus_bool_t
-get_arg (const char *arg,
- const char *option,
- const char **value_p)
-{
- const char *fn;
-
- if (strlen(arg) < strlen(option))
- return FALSE;
-
- fn = arg + strlen(option);
-
- if (!(*fn == '=' || *fn == ' ' || *fn == '\0'))
- {
- usage (NULL, 1);
- }
-
- if (*fn == '=')
- ++fn;
-
- while (*fn == ' ' && *fn != '\0')
- ++fn;
-
- if (*fn != '\0')
- {
- *value_p = fn;
- return TRUE;
- }
-
- return FALSE;
-}
-
-int
-main (int argc, char *argv[])
-{
- int i;
- const char *filename;
- dbus_bool_t ensure_uuid;
- dbus_bool_t get_uuid;
- DBusError error;
-
- ensure_uuid = FALSE;
- get_uuid = FALSE;
-
- filename = NULL;
-
- for (i = 1; i < argc; i++)
- {
- char *arg = argv[i];
-
- if (strncmp (arg, "--ensure", strlen("--ensure")) == 0)
- {
- get_arg (arg, "--ensure", &filename);
- ensure_uuid = TRUE;
- }
- else if (strncmp (arg, "--get", strlen("--get")) == 0)
- {
- get_arg (arg, "--get", &filename);
- get_uuid = TRUE;
- }
- else if (strcmp (arg, "--help") == 0)
- usage (argv[0], 0);
- else if (strcmp (arg, "--version") == 0)
- version ();
- else
- usage (argv[0], 1);
- }
-
- if (get_uuid && ensure_uuid)
- {
- fprintf (stderr, "Can't specify both --get and --ensure\n");
- exit (1);
- }
-
- dbus_error_init (&error);
-
- if (get_uuid || ensure_uuid)
- {
- char *uuid;
- if (dbus_internal_do_not_use_get_uuid (filename, &uuid, ensure_uuid, &error))
- {
- if (get_uuid) /* print nothing on --ensure */
- printf ("%s\n", uuid);
- dbus_free (uuid);
- }
- }
- else
- {
- char *uuid;
- if (dbus_internal_do_not_use_create_uuid (&uuid))
- {
- printf ("%s\n", uuid);
- dbus_free (uuid);
- }
- else
- {
- dbus_set_error (&error, DBUS_ERROR_NO_MEMORY, "No memory");
- }
- }
-
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "%s\n", error.message);
- dbus_error_free (&error);
- exit (1);
- }
- else
- {
- exit (0);
- }
-}
diff --git a/src/3rd_party/dbus-1.7.8/tools/lcov.am b/src/3rd_party/dbus-1.7.8/tools/lcov.am
deleted file mode 100644
index 7ba4991247..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/lcov.am
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright © 2008-2011 Collabora Ltd.
-# Copyright © 2008-2011 Nokia Corporation
-#
-# 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.
-
-lcov-reset:
- lcov --directory @abs_top_srcdir@ --zerocounters
-
-lcov-report:
- lcov --directory @abs_top_srcdir@ --capture \
- --output-file @abs_top_builddir@/lcov.info
- $(mkdir_p) @abs_top_builddir@/lcov.html
- git_commit=`GIT_DIR=@abs_top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
- genhtml --title "@PACKAGE_STRING@ $$git_commit" \
- --output-directory @abs_top_builddir@/lcov.html lcov.info
- @echo
- @echo 'lcov report can be found in:'
- @echo 'file://@abs_top_builddir@/lcov.html/index.html'
- @echo
-
-lcov-check:
- $(MAKE) lcov-reset
- $(MAKE) check $(LCOV_CHECK_ARGS)
- $(MAKE) lcov-report
-
-## vim:set ft=automake:
diff --git a/src/3rd_party/dbus-1.7.8/tools/run-with-tmp-session-bus.sh b/src/3rd_party/dbus-1.7.8/tools/run-with-tmp-session-bus.sh
deleted file mode 100755
index 94ae8fc8fd..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/run-with-tmp-session-bus.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /bin/sh
-
-SCRIPTNAME="$0"
-WRAPPED_SCRIPT="$1"
-shift
-
-CONFIG_FILE=./tmp-session-bus.$$.conf
-
-die ()
-{
- echo "$SCRIPTNAME: $*" >&2
- rm -f "$CONFIG_FILE"
- exit 1
-}
-
-if test -z "$DBUS_TOP_BUILDDIR" ; then
- die "Must set DBUS_TOP_BUILDDIR"
-fi
-
-SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files"
-ESCAPED_SERVICE_DIR=`echo $SERVICE_DIR | sed -e 's/\//\\\\\\//g'`
-echo "escaped service dir is: $ESCAPED_SERVICE_DIR" >&2
-
-if test -z "$SOURCE_CONFIG_FILE"; then
- SOURCE_CONFIG_FILE="$DBUS_TOP_BUILDDIR/bus/session.conf";
-fi
-## create a configuration file based on the standard session.conf
-cat $SOURCE_CONFIG_FILE | \
- sed -e 's/<standard_session_servicedirs.*$/<servicedir>'$ESCAPED_SERVICE_DIR'<\/servicedir>/g' | \
- sed -e 's/<include.*$//g' \
- > $CONFIG_FILE
-
-echo "Created configuration file $CONFIG_FILE" >&2
-
-if ! test -e "$DBUS_TOP_BUILDDIR"/bus/dbus-daemon ; then
- die "$DBUS_TOP_BUILDDIR/bus/dbus-daemon does not exist"
-fi
-
-PATH="$DBUS_TOP_BUILDDIR"/bus:$PATH
-export PATH
-
-## the libtool script found by the path search should already do this, but
-LD_LIBRARY_PATH=$DBUS_TOP_BUILDDIR/dbus/.libs:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH
-unset DBUS_SESSION_BUS_ADDRESS
-unset DBUS_SESSION_BUS_PID
-
-# this does not actually affect dbus-run-session any more, but could be
-# significant for dbus-launch as used by the autolaunch test
-DBUS_USE_TEST_BINARY=1
-export DBUS_USE_TEST_BINARY
-
-$DBUS_TOP_BUILDDIR/tools/dbus-run-session \
- --config-file="$CONFIG_FILE" \
- --dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \
- -- \
- "$WRAPPED_SCRIPT" "$@"
-error=$?
-
-# clean up
-rm -f "$CONFIG_FILE"
-exit $error
diff --git a/src/3rd_party/dbus-1.7.8/tools/strtoll.c b/src/3rd_party/dbus-1.7.8/tools/strtoll.c
deleted file mode 100644
index 7360c63025..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/strtoll.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <limits.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#include <stdlib.h>
-#ifdef DBUS_WINCE
-#include <windows.h>
-#endif
-
-#ifndef isspace
-#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
-#endif
-
-/* Minimum and maximum values a `signed long long int' can hold. */
-#ifndef LLONG_MAX
-# define LLONG_MAX 9223372036854775807LL
-#endif
-
-#ifndef LLONG_MIN
-# define LLONG_MIN (-LLONG_MAX - 1LL)
-#endif
-/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
-#ifndef ULLONG_MAX
-# define ULLONG_MAX 18446744073709551615ULL
-#endif
-/*
- * Convert a string to a long long integer.
- *
- * Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-long long strtoll (const char*, char **, int);
-
-long long
-strtoll(const char * nptr, char ** endptr, int base)
-{
- const char *s;
- unsigned long long acc;
- char c;
- unsigned long long cutoff;
- int neg, any, cutlim;
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace((unsigned char)c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'A' && s[1] <= 'F') ||
- (s[1] >= 'a' && s[1] <= 'f'))) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- acc = any = 0;
- if (base < 2 || base > 36)
- goto noconv;
-
- /*
- * Compute the cutoff value between legal numbers and illegal
- * numbers. That is the largest legal value, divided by the
- * base. An input number that is greater than this value, if
- * followed by a legal input character, is too big. One that
- * is equal to this value may be valid or not; the limit
- * between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for quads is
- * [-9223372036854775808..9223372036854775807] and the input base
- * is 10, cutoff will be set to 922337203685477580 and cutlim to
- * either 7 (neg==0) or 8 (neg==1), meaning that if we have
- * accumulated a value > 922337203685477580, or equal but the
- * next digit is > 7 (or 8), the number is too big, and we will
- * return a range error.
- *
- * Set 'any' if any `digits' consumed; make it negative to indicate
- * overflow.
- */
- cutoff = neg ? (unsigned long long)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX
- : LLONG_MAX;
- cutlim = cutoff % base;
- cutoff /= base;
- for ( ; ; c = *s++) {
- if (c >= '0' && c <= '9')
- c -= '0';
- else if (c >= 'A' && c <= 'Z')
- c -= 'A' - 10;
- else if (c >= 'a' && c <= 'z')
- c -= 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = neg ? LLONG_MIN : LLONG_MAX;
-#ifdef DBUS_WINCE
- SetLastError (ERROR_ARITHMETIC_OVERFLOW);
-#else
- errno = ERANGE;
-#endif
- } else if (!any) {
-noconv:
-#ifdef DBUS_WINCE
- SetLastError (ERROR_INVALID_PARAMETER);
-#else
- errno = EINVAL;
-#endif
- } else if (neg)
- acc = -acc;
- if (endptr != NULL)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
-
diff --git a/src/3rd_party/dbus-1.7.8/tools/strtoull.c b/src/3rd_party/dbus-1.7.8/tools/strtoull.c
deleted file mode 100644
index 35595542b4..0000000000
--- a/src/3rd_party/dbus-1.7.8/tools/strtoull.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <limits.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#include <stdlib.h>
-#ifdef DBUS_WINCE
-#include <windows.h>
-#endif
-
-#ifndef isspace
-#define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
-#endif
-
-/* Minimum and maximum values a `signed long long int' can hold. */
-#ifndef LLONG_MAX
-# define LLONG_MAX 9223372036854775807LL
-#endif
-
-#ifndef LLONG_MIN
-# define LLONG_MIN (-LLONG_MAX - 1LL)
-#endif
-/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
-#ifndef ULLONG_MAX
-# define ULLONG_MAX 18446744073709551615ULL
-#endif
-
-/*
- * Convert a string to an unsigned long long integer.
- *
- * Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long long strtoull (const char *, char **, int);
-
-unsigned long long
-strtoull(const char * nptr, char ** endptr, int base)
-{
- const char *s;
- unsigned long long acc;
- char c;
- unsigned long long cutoff;
- int neg, any, cutlim;
-
- /*
- * See strtoq for comments as to the logic used.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace((unsigned char)c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'A' && s[1] <= 'F') ||
- (s[1] >= 'a' && s[1] <= 'f'))) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- acc = any = 0;
- if (base < 2 || base > 36)
- goto noconv;
-
- cutoff = ULLONG_MAX / base;
- cutlim = ULLONG_MAX % base;
- for ( ; ; c = *s++) {
- if (c >= '0' && c <= '9')
- c -= '0';
- else if (c >= 'A' && c <= 'Z')
- c -= 'A' - 10;
- else if (c >= 'a' && c <= 'z')
- c -= 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = ULLONG_MAX;
-#ifdef DBUS_WINCE
- SetLastError (ERROR_ARITHMETIC_OVERFLOW);
-#else
- errno = ERANGE;
-#endif
- } else if (!any) {
-noconv:
-#ifdef DBUS_WINCE
- SetLastError (ERROR_INVALID_PARAMETER);
-#else
- errno = EINVAL;
-#endif
- } else if (neg)
- acc = -acc;
- if (endptr != NULL)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
diff --git a/src/3rd_party/dbus-cmake/CMakeLists.txt b/src/3rd_party/dbus-cmake/CMakeLists.txt
deleted file mode 100644
index 141335414c..0000000000
--- a/src/3rd_party/dbus-cmake/CMakeLists.txt
+++ /dev/null
@@ -1,98 +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.
-
-set(DBUS_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../dbus-1.7.8)
-set(DBUS_BUILD_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../dbus-build)
-
-set(DBUS_BUILD_DIRECTORY ${DBUS_BUILD_DIRECTORY} PARENT_SCOPE)
-
-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)
-
-
-file(MAKE_DIRECTORY
- ${DBUS_BUILD_DIRECTORY}
-)
-
-set(COMMON_CONFIGURE_FLAGS
- "--enable-tests=no"
- "CFLAGS=-I${EXPAT_INCLUDE_DIRECTORY}"
- "LDFLAGS=-L${EXPAT_LIBS_DIRECTORY}"
-)
-
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- set(CONFIGURE_FLAGS "--host=${CMAKE_SYSTEM_PROCESSOR}-nto-qnx" ${COMMON_CONFIGURE_FLAGS})
-else ()
- set(CONFIGURE_FLAGS ${COMMON_CONFIGURE_FLAGS})
-endif ()
-
-add_custom_command(OUTPUT ${DBUS_BUILD_DIRECTORY}/Makefile
- COMMAND CC=${CMAKE_C_COMPILER} ${DBUS_SOURCE_DIRECTORY}/configure ${CONFIGURE_FLAGS}
- DEPENDS expat
- WORKING_DIRECTORY ${DBUS_BUILD_DIRECTORY}
-)
-
-add_custom_target(dbus ALL make
- COMMAND /bin/bash -c \"
- cd ${CMAKE_CURRENT_SOURCE_DIR}\;
- git log . 1>/dev/null 2>&1\;
- if [ \\$$? == 0 ]; then
- grep \\".commit_hash\\" ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\;
- if [ ! \\\$$? == 0 ]\; then
- cd ${CMAKE_CURRENT_SOURCE_DIR} &&
- git log --pretty=\\"format:%H\\" -1 ${DBUS_SOURCE_DIRECTORY} > /tmp/commit_hash 2>/dev/null &&
- echo \\"Adding .commit_hash section\\" &&
- ${objcopy} --add-section .commit_hash=/tmp/commit_hash ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so ${DBUS_BUILD_DIRECTORY}/dbus/.libs/libdbus-1.so 1>/dev/null 2>&1\;
- fi;
- fi\"
- DEPENDS ${DBUS_BUILD_DIRECTORY}/Makefile
- WORKING_DIRECTORY ${DBUS_BUILD_DIRECTORY}
-)
-
-install(
- FILES ${DBUS_BUILD_DIRECTORY}/dbus/dbus-arch-deps.h
- DESTINATION ${DBUS_INCLUDE_DIR_ARCH}/dbus
-)
-
-install(
- DIRECTORY ${DBUS_SOURCE_DIRECTORY}/dbus/
- DESTINATION ${DBUS_INCLUDE_DIR}/dbus
- FILES_MATCHING PATTERN *.h
-)
-
-install(
- DIRECTORY ${DBUS_BUILD_DIRECTORY}/dbus/.libs/
- DESTINATION ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib
- USE_SOURCE_PERMISSIONS
- FILES_MATCHING PATTERN libdbus-1.so*
-)
diff --git a/src/3rd_party/iap.armv7-qnx.runtime.tar.bz2 b/src/3rd_party/iap.armv7-qnx.runtime.tar.bz2
deleted file mode 100644
index 3d6028c6ec..0000000000
--- a/src/3rd_party/iap.armv7-qnx.runtime.tar.bz2
+++ /dev/null
Binary files differ
diff --git a/src/3rd_party/iap.build.tar.bz2 b/src/3rd_party/iap.build.tar.bz2
deleted file mode 100644
index 19aa8b7ae5..0000000000
--- a/src/3rd_party/iap.build.tar.bz2
+++ /dev/null
Binary files differ
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index 0b76be34b5..fe9a6af3f7 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -32,6 +32,15 @@ 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
@@ -43,46 +52,44 @@ include_directories(
${COMPONENTS_DIR}/utils/include
${COMPONENTS_DIR}/connection_handler/include
${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/hmi_message_handler/src
${COMPONENTS_DIR}/request_watchdog/include
${COMPONENTS_DIR}/smart_objects/include
${COMPONENTS_DIR}/media_manager/include
${COMPONENTS_DIR}/telemetry_monitor/include
- ${POLICY_PATH}/include/
+ ${COMPONENTS_DIR}/functional_module/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}
+ ${BSON_INCLUDE_DIRECTORY}
${OPENSSL_INCLUDE_DIRECTORY}
+ ${default_media_inc}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
+ ${BOOST_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/src
)
-collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+# Create object library
+add_library("LowVoltageHandlerObjLibrary" OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/low_voltage_signals_handler.cc
+)
-if (HMIADAPTER STREQUAL "messagebroker")
- set (BROKER_LIBRARIES
- message_broker_client
- message_broker_server
- )
-endif()
+set (SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/life_cycle_impl.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/signal_handlers.cc
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+)
cmake_policy(PUSH)
# make link_directories() treat paths relative to the source dir
# info: cmake --help-policy CMP0015
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}
- ${GSTREAMER_gstconfig_INCLUDE_DIR}
- )
-else(EXTENDED_MEDIA_MODE)
- set(default_media_inc)
-endif()
-
if (TELEMETRY_MONITOR)
set(TELEMETRY_MONITOR_LIB
TelemetryMonitor
@@ -105,12 +112,12 @@ set(LIBRARIES
TransportManager
${SecurityManagerLibrary}
HMIMessageHandler
- message_broker
${BROKER_LIBRARIES}
Utils
jsoncpp
ConfigProfile
Resumption
+ SystemTimeLibrary
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -126,7 +133,7 @@ endif()
if (BUILD_USB_SUPPORT)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- list(APPEND LIBRARIES Libusb-1.0.16)
+ list(APPEND LIBRARIES libusb-1.0.so)
endif()
endif()
@@ -137,17 +144,30 @@ if(ENABLE_LOG)
list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
endif()
+list(APPEND LIBRARIES bson -L${BSON_LIBS_DIRECTORY})
+list(APPEND LIBRARIES emhashmap -L${EMHASHMAP_LIBS_DIRECTORY})
+
add_executable(${PROJECT} ${SOURCES})
+
+if (HMIADAPTER STREQUAL "messagebroker")
+ add_dependencies(${PROJECT} Boost)
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
+endif()
+
target_link_libraries(${PROJECT} ${LIBRARIES})
add_dependencies(${PROJECT} Policy)
-
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/build_config.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
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 ()
@@ -196,12 +216,17 @@ endif ()
# Install rules
install(TARGETS ${PROJECT} DESTINATION bin)
install(
- FILES log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
- hmi_capabilities.json sdl_preloaded_pt.json
+ FILES build_config.txt log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
+ hmi_capabilities.json sdl_preloaded_pt.json sample_policy_manager.py
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
DESTINATION bin
)
+install(
+ FILES sdl_preloaded_pt.json
+ DESTINATION bin
+)
+
if (${QT_HMI})
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
install(FILES start-qml.sh DESTINATION bin
@@ -217,3 +242,17 @@ 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()
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/appMain/audio.8bit.wav b/src/appMain/audio.8bit.wav
index cebf6cc0e2..7a3f970a21 100644
--- a/src/appMain/audio.8bit.wav
+++ b/src/appMain/audio.8bit.wav
Binary files differ
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 2369543e32..93292d1023 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -1,466 +1,933 @@
{
- "UI":
- {
- "language":"EN-US",
- "languages":[
- "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW",
-"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO"
- ],
- "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
- }
- ],
- "imageFields":
- [
- {
- "name":"softButtonImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceSecondaryImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"menuIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"cmdIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"appIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"graphic",
- "imageTypeSupported":
- [
-
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"locationImage",
- "imageTypeSupported":
- [
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- }
-
+ "UI": {
+ "language": "EN-US",
+ "languages": [
+ "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW",
+ "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO"
+ ],
+ "displayCapabilities": {
+ "displayType": "GEN2_8_DMA",
+ "displayName": "GENERIC_DISPLAY",
+ "textFields": [{
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
+ ],
+ "imageFields": [{
+ "name": "softButtonImage",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceImage",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceSecondaryImage",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "menuIcon",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "cmdIcon",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "appIcon",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "graphic",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "secondaryGraphic",
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "locationImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ }
+
+ ],
+ "mediaClockFormats": [
+ "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
+ ],
+ "graphicSupported": true,
+ "templatesAvailable": [
+ "DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD",
+ "GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY",
+ "GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
+ "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", "GRAPHIC_WITH_TEXTBUTTONS",
+ "TEXTBUTTONS_WITH_GRAPHIC", "LARGE_GRAPHIC_WITH_SOFTBUTTONS",
+ "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", "LARGE_GRAPHIC_ONLY"
+ ],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": false,
+ "doublePressAvailable": false
+ }
+ },
+ "numCustomPresetsAvailable": 8,
+ "imageCapabilities": [
+ "DYNAMIC",
+ "STATIC"
+ ]
+ },
+ "audioPassThruCapabilities": {
+ "samplingRate": "44KHZ",
+ "bitsPerSample": "RATE_8_BIT",
+ "audioType": "PCM"
+ },
+ "pcmStreamCapabilities": {
+ "samplingRate": "16KHZ",
+ "bitsPerSample": "RATE_16_BIT",
+ "audioType": "PCM"
+ },
+ "hmiZoneCapabilities": "FRONT",
+ "softButtonCapabilities": [{
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }],
+ "systemCapabilities": {
+ "navigationCapability": {
+ "sendLocationEnabled": true,
+ "getWayPointsEnabled": true
+ },
+ "phoneCapability": {
+ "dialNumberEnabled": true
+ },
+ "videoStreamingCapability": {
+ "preferredResolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "maxBitrate": 10000,
+ "supportedFormats": [{
+ "protocol": "RAW",
+ "codec": "H264"
+ }],
+ "hapticSpatialDataSupported": false
+ },
+ "remoteControlCapability": {
+ "buttonCapabilities": [
+ {
+ "longPressAvailable": true,
+ "name": "AC_MAX",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "AC",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "RECIRCULATE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "FAN_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "FAN_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "TEMP_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "TEMP_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST_MAX",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST_REAR",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "UPPER_VENT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "LOWER_VENT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "VOLUME_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "VOLUME_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "EJECT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "SOURCE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "SHUFFLE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "REPEAT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ }
+ ],
+ "climateControlCapabilities": [
+ {
+ "acEnableAvailable": true,
+ "acMaxEnableAvailable": true,
+ "autoModeEnableAvailable": true,
+ "circulateAirEnableAvailable": true,
+ "currentTemperatureAvailable": true,
+ "defrostZone": [
+ "FRONT",
+ "REAR",
+ "ALL",
+ "NONE"
],
- "mediaClockFormats":
- [
- "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4"
- ],
- "graphicSupported":true,
- "templatesAvailable":
- [
-
- "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD",
- "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY",
- "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
- "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS",
- "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS",
- "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY"
+ "defrostZoneAvailable": true,
+ "desiredTemperatureAvailable": true,
+ "dualModeEnableAvailable": true,
+ "heatedMirrorsAvailable":true,
+ "heatedRearWindowAvailable":true,
+ "heatedSteeringWheelAvailable":true,
+ "heatedWindshieldAvailable":true,
+ "fanSpeedAvailable": true,
+ "moduleName": "primary_climate",
+ "ventilationMode": [
+ "UPPER",
+ "LOWER",
+ "BOTH",
+ "NONE"
],
- "screenParams":
- {
- "resolution":
- {
- "resolutionWidth":800,
- "resolutionHeight":350
- },
- "touchEventAvailable":
- {
- "pressAvailable":true,
- "multiTouchAvailable":false,
- "doublePressAvailable":false
- }
- },
- "numCustomPresetsAvailable":8,
- "imageCapabilities":
- [
- "DYNAMIC",
- "STATIC"
- ]
- },
- "audioPassThruCapabilities":
- {
- "samplingRate" : "44KHZ",
- "bitsPerSample" : "RATE_8_BIT",
- "audioType" : "PCM"
- },
- "pcmStreamCapabilities":
- {
- "samplingRate" : "16KHZ",
- "bitsPerSample" : "RATE_16_BIT",
- "audioType" : "PCM"
- },
- "hmiZoneCapabilities":"FRONT",
- "softButtonCapabilities":
- [
- {
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true,
- "imageSupported" :true
- }
+ "ventilationModeAvailable": true
+ }
+ ],
+ "radioControlCapabilities": [
+ {
+ "availableHDsAvailable": true,
+ "hdChannelAvailable": true,
+ "moduleName": "radio",
+ "radioBandAvailable": true,
+ "radioEnableAvailable": true,
+ "radioFrequencyAvailable": true,
+ "rdsDataAvailable": true,
+ "signalChangeThresholdAvailable": true,
+ "signalStrengthAvailable": true,
+ "hdRadioEnableAvailable" : true,
+ "siriusxmRadioAvailable" : true,
+ "sisDataAvailable":true,
+ "stateAvailable": true
+ }
+ ],
+ "audioControlCapabilities": [
+ {
+ "moduleName": "audio",
+ "sourceAvailable": true,
+ "volumeAvailable": true,
+ "equalizerAvailable": true,
+ "keepContextAvailable" : true,
+ "equalizerMaxChannelId": 10
+ }
+ ],
+ "seatControlCapabilities": [
+ {
+ "moduleName": "driver_seat",
+ "heatingEnabledAvailable" : true,
+ "coolingEnabledAvailable": true,
+ "heatingLevelAvailable": true,
+ "coolingLevelAvailable": true,
+ "horizontalPositionAvailable": true,
+ "verticalPositionAvailable" : true,
+ "frontVerticalPositionAvailable": true,
+ "backVerticalPositionAvailable": true,
+ "backTiltAngleAvailable": true,
+ "headSupportHorizontalPositionAvailable": true,
+ "headSupportVerticalPositionAvailable" : true,
+ "massageEnabledAvailable": true,
+ "massageModeAvailable": true,
+ "massageCushionFirmnessAvailable": true,
+ "memoryAvailable": true
+ }
+ ],
+ "lightControlCapabilities": {
+ "moduleName": "light",
+ "supportedLights":[
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REGISTRATION_PLATE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HIGH_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LOW_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FOG_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RUNNING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"PARKING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"BRAKE_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REVERSING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"SIDE_MARKER_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LEFT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RIGHT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HAZARD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"AMBIENT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"OVERHEAD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"READING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"TRUNK_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_FRONT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_REAR_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_LEFT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_RIGHT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_CARGO_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRUCK_BED_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRAILER_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":false,
+ "name":"EXTERIOR_ALL_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ }
+ ]
+ },
+ "hmiSettingsControlCapabilities": {
+ "moduleName": "hmiSettings",
+ "distanceUnitAvailable": true,
+ "temperatureUnitAvailable": true,
+ "displayModeUnitAvailable": true
+ }
+ }
+ }
+ },
+ "VR": {
+ "capabilities": ["TEXT"],
+ "language": "EN-US",
+ "languages": [
+ "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW",
+ "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO"
+ ]
+ },
+ "TTS": {
+ "capabilities": ["TEXT"],
+ "language": "EN-US",
+ "languages": [
+ "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW",
+ "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO"
]
},
- "VR":
- {
- "capabilities":["TEXT"],
- "language":"EN-US",
- "languages":
- [
- "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW",
-"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO"
- ]
-},
- "TTS":
- {
- "capabilities":["TEXT"],
- "language":"EN-US",
- "languages":
- [
- "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW",
-"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO"
- ]
+ "Buttons": {
+ "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":"PLAY_PAUSE",
+ "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
+ }
},
- "Buttons":
- {
- "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
- }
+ "VehicleInfo": {
+ "make": "Ford",
+ "model": "Fiesta",
+ "modelYear": "2013",
+ "trim": "SE"
},
- "VehicleInfo":
- {
- "make" :"Ford",
- "model" :"Fiesta",
- "modelYear" :"2013",
- "trim" :"SE"
- },
- "SyncMessageVersion":
- {
- "majorVersion": 3,
- "minorVersion": 0
- }
+ "SyncMessageVersion": {
+ "majorVersion": 3,
+ "minorVersion": 0
+ }
}
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
deleted file mode 100644
index 9b4910585f..0000000000
--- a/src/appMain/life_cycle.cc
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
-* Copyright (c) 2017, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "life_cycle.h"
-#include "utils/signals.h"
-#include "utils/make_shared.h"
-#include "config_profile/profile.h"
-#include "resumption/last_state_impl.h"
-
-#ifdef ENABLE_SECURITY
-#include "security_manager/security_manager_impl.h"
-#include "security_manager/crypto_manager_impl.h"
-#include "security_manager/crypto_manager_settings_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#endif // ENABLE_SECURITY
-
-#ifdef ENABLE_LOG
-#include "utils/log_message_loop_thread.h"
-#endif // ENABLE_LOG
-
-using threads::Thread;
-
-namespace main_namespace {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
-
-namespace {
-void NameMessageBrokerThread(const System::Thread& thread,
- const std::string& name) {
- Thread::SetNameForId(thread.GetId(), name);
-}
-
-void StopThread(System::Thread* thread) {
- if (thread) {
- thread->Stop();
- thread->Join();
- delete thread;
- }
-}
-} // namespace
-
-LifeCycle::LifeCycle(const profile::Profile& profile)
- : transport_manager_(NULL)
- , protocol_handler_(NULL)
- , connection_handler_(NULL)
- , app_manager_(NULL)
-#ifdef ENABLE_SECURITY
- , crypto_manager_(NULL)
- , security_manager_(NULL)
-#endif // ENABLE_SECURITY
- , hmi_handler_(NULL)
- , hmi_message_adapter_(NULL)
- , media_manager_(NULL)
- , last_state_(NULL)
-#ifdef TELEMETRY_MONITOR
- , telemetry_monitor_(NULL)
-#endif // TELEMETRY_MONITOR
-#ifdef DBUS_HMIADAPTER
- , dbus_adapter_(NULL)
- , dbus_adapter_thread_(NULL)
-#endif // DBUS_HMIADAPTER
-#ifdef MESSAGEBROKER_HMIADAPTER
- , mb_adapter_(NULL)
- , message_broker_(NULL)
- , message_broker_server_(NULL)
- , mb_thread_(NULL)
- , mb_server_thread_(NULL)
- , mb_adapter_thread_(NULL)
-#endif // MESSAGEBROKER_HMIADAPTER
- , profile_(profile) {
-}
-
-bool LifeCycle::StartComponents() {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(!last_state_);
- last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
- profile_.app_info_storage());
-
- DCHECK(!transport_manager_);
- transport_manager_ = new transport_manager::TransportManagerDefault(profile_);
-
- DCHECK(!connection_handler_);
- connection_handler_ = new connection_handler::ConnectionHandlerImpl(
- profile_, *transport_manager_);
-
- DCHECK(!protocol_handler_);
- protocol_handler_ =
- new protocol_handler::ProtocolHandlerImpl(profile_,
- *connection_handler_,
- *connection_handler_,
- *transport_manager_);
- DCHECK(protocol_handler_);
-
- DCHECK(!app_manager_);
- app_manager_ =
- new application_manager::ApplicationManagerImpl(profile_, profile_);
-
- DCHECK(!hmi_handler_);
- hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
-
- media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
- app_manager_->set_connection_handler(connection_handler_);
- if (!app_manager_->Init(*last_state_, media_manager_)) {
- LOG4CXX_ERROR(logger_, "Application manager init failed.");
- return false;
- }
-
-#ifdef ENABLE_SECURITY
- security_manager_ = new security_manager::SecurityManagerImpl();
- crypto_manager_ = new security_manager::CryptoManagerImpl(
- utils::MakeShared<security_manager::CryptoManagerSettingsImpl>(
- profile_, app_manager_->GetPolicyHandler().RetrieveCertificate()));
- protocol_handler_->AddProtocolObserver(security_manager_);
- protocol_handler_->set_security_manager(security_manager_);
-
- security_manager_->set_session_observer(connection_handler_);
- security_manager_->set_protocol_handler(protocol_handler_);
- security_manager_->set_crypto_manager(crypto_manager_);
- security_manager_->AddListener(app_manager_);
-
- app_manager_->AddPolicyObserver(crypto_manager_);
- if (!crypto_manager_->Init()) {
- LOG4CXX_ERROR(logger_, "CryptoManager initialization fail.");
- return false;
- }
-#endif // ENABLE_SECURITY
-
- transport_manager_->AddEventListener(protocol_handler_);
- transport_manager_->AddEventListener(connection_handler_);
-
- hmi_handler_->set_message_observer(app_manager_);
-
- protocol_handler_->AddProtocolObserver(media_manager_);
- protocol_handler_->AddProtocolObserver(app_manager_);
-
- media_manager_->SetProtocolHandler(protocol_handler_);
-
- connection_handler_->set_protocol_handler(protocol_handler_);
- connection_handler_->set_connection_handler_observer(app_manager_);
-
-// it is important to initialise TelemetryMonitor before TM to listen TM
-// Adapters
-#ifdef TELEMETRY_MONITOR
- telemetry_monitor_ = new telemetry_monitor::TelemetryMonitor(
- profile_.server_address(), profile_.time_testing_port());
- telemetry_monitor_->Start();
- telemetry_monitor_->Init(protocol_handler_, app_manager_, transport_manager_);
-#endif // TELEMETRY_MONITOR
- // It's important to initialise TM after setting up listener chain
- // [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
- app_manager_->set_protocol_handler(protocol_handler_);
- app_manager_->set_hmi_message_handler(hmi_handler_);
-
- transport_manager_->Init(*last_state_);
- // start transport manager
- transport_manager_->Visibility(true);
-
- return true;
-}
-
-#ifdef MESSAGEBROKER_HMIADAPTER
-bool LifeCycle::InitMessageSystem() {
- DCHECK(!message_broker_)
- message_broker_ = NsMessageBroker::CMessageBroker::getInstance();
- if (!message_broker_) {
- LOG4CXX_FATAL(logger_, " Wrong pMessageBroker pointer!");
- return false;
- }
-
- message_broker_server_ = new NsMessageBroker::TcpServer(
- profile_.server_address(), profile_.server_port(), message_broker_);
- if (!message_broker_server_) {
- LOG4CXX_FATAL(logger_, " Wrong pJSONRPC20Server pointer!");
- return false;
- }
- message_broker_->startMessageBroker(message_broker_server_);
- if (!networking::init()) {
- LOG4CXX_FATAL(logger_, " Networking initialization failed!");
- return false;
- }
-
- if (!message_broker_server_->Bind()) {
- LOG4CXX_FATAL(logger_, "Message broker server bind failed!");
- return false;
- } else {
- LOG4CXX_INFO(logger_, "Message broker server bind successful!");
- }
-
- if (!message_broker_server_->Listen()) {
- LOG4CXX_FATAL(logger_, "Message broker server listen failed!");
- return false;
- } else {
- LOG4CXX_INFO(logger_, " Message broker server listen successful!");
- }
-
- mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
- hmi_handler_, profile_.server_address(), profile_.server_port());
-
- hmi_handler_->AddHMIMessageAdapter(mb_adapter_);
- if (!mb_adapter_->Connect()) {
- LOG4CXX_FATAL(logger_, "Cannot connect to remote peer!");
- return false;
- }
-
- LOG4CXX_INFO(logger_, "Start CMessageBroker thread!");
- mb_thread_ = new System::Thread(
- new System::ThreadArgImpl<NsMessageBroker::CMessageBroker>(
- *message_broker_,
- &NsMessageBroker::CMessageBroker::MethodForThread,
- NULL));
- mb_thread_->Start(false);
- // Thread can be named only when started because before that point
- // thread doesn't have valid Id to associate name with
- NameMessageBrokerThread(*mb_thread_, "MessageBroker");
-
- LOG4CXX_INFO(logger_, "Start MessageBroker TCP server thread!");
- mb_server_thread_ =
- new System::Thread(new System::ThreadArgImpl<NsMessageBroker::TcpServer>(
- *message_broker_server_,
- &NsMessageBroker::TcpServer::MethodForThread,
- NULL));
- mb_server_thread_->Start(false);
- NameMessageBrokerThread(*mb_server_thread_, "MB TCPServer");
-
- LOG4CXX_INFO(logger_, "StartAppMgr JSONRPC 2.0 controller receiver thread!");
- mb_adapter_thread_ = new System::Thread(
- new System::ThreadArgImpl<hmi_message_handler::MessageBrokerAdapter>(
- *mb_adapter_,
- &hmi_message_handler::MessageBrokerAdapter::
- SubscribeAndBeginReceiverThread,
- NULL));
- mb_adapter_thread_->Start(false);
- NameMessageBrokerThread(*mb_adapter_thread_, "MB Adapter");
- return true;
-}
-#endif // MESSAGEBROKER_HMIADAPTER
-
-#ifdef DBUS_HMIADAPTER
-/**
- * Initialize DBus component
- * @return true if success otherwise false.
- */
-bool LifeCycle::InitMessageSystem() {
- dbus_adapter_ = new hmi_message_handler::DBusMessageAdapter(hmi_handler_);
-
- hmi_handler_.AddHMIMessageAdapter(dbus_adapter_);
- if (!dbus_adapter_->Init()) {
- LOG4CXX_FATAL(logger_, "Cannot init DBus service!");
- return false;
- }
-
- dbus_adapter_->SubscribeTo();
-
- LOG4CXX_INFO(logger_, "Start DBusMessageAdapter thread!");
- dbus_adapter_thread_ = new System::Thread(
- new System::ThreadArgImpl<hmi_message_handler::DBusMessageAdapter>(
- *dbus_adapter_,
- &hmi_message_handler::DBusMessageAdapter::MethodForReceiverThread,
- NULL));
- dbus_adapter_thread_->Start(false);
-
- return true;
-}
-#endif // DBUS_HMIADAPTER
-
-namespace {
-void sig_handler(int sig) {
- switch (sig) {
- case SIGINT:
- LOG4CXX_DEBUG(logger_, "SIGINT signal has been caught");
- break;
- case SIGTERM:
- LOG4CXX_DEBUG(logger_, "SIGTERM signal has been caught");
- break;
- case SIGSEGV:
- LOG4CXX_DEBUG(logger_, "SIGSEGV signal has been caught");
- FLUSH_LOGGER();
- // exit need to prevent endless sending SIGSEGV
- // http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv
- abort();
- default:
- LOG4CXX_DEBUG(logger_, "Unexpected signal has been caught");
- exit(EXIT_FAILURE);
- }
-}
-} // namespace
-
-void LifeCycle::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // Register signal handlers and wait sys signals
- // from OS
- if (!utils::WaitTerminationSignals(&sig_handler)) {
- LOG4CXX_FATAL(logger_, "Fail to catch system signal!");
- }
-}
-
-void LifeCycle::StopComponents() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->set_message_observer(NULL);
-
- DCHECK_OR_RETURN_VOID(connection_handler_);
- connection_handler_->set_connection_handler_observer(NULL);
-
- DCHECK_OR_RETURN_VOID(protocol_handler_);
- protocol_handler_->RemoveProtocolObserver(app_manager_);
-
- DCHECK_OR_RETURN_VOID(app_manager_);
- app_manager_->Stop();
-
- LOG4CXX_INFO(logger_, "Stopping Protocol Handler");
- DCHECK_OR_RETURN_VOID(protocol_handler_);
- protocol_handler_->RemoveProtocolObserver(media_manager_);
-
-#ifdef ENABLE_SECURITY
- protocol_handler_->RemoveProtocolObserver(security_manager_);
- if (security_manager_) {
- security_manager_->RemoveListener(app_manager_);
- LOG4CXX_INFO(logger_, "Destroying Crypto Manager");
- delete crypto_manager_;
- crypto_manager_ = NULL;
- LOG4CXX_INFO(logger_, "Destroying Security Manager");
- delete security_manager_;
- security_manager_ = NULL;
- }
-#endif // ENABLE_SECURITY
- protocol_handler_->Stop();
-
- LOG4CXX_INFO(logger_, "Destroying Media Manager");
- DCHECK_OR_RETURN_VOID(media_manager_);
- media_manager_->SetProtocolHandler(NULL);
- delete media_manager_;
- media_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Transport Manager.");
- DCHECK_OR_RETURN_VOID(transport_manager_);
- transport_manager_->Visibility(false);
- transport_manager_->Stop();
- delete transport_manager_;
- transport_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Stopping Connection Handler.");
- DCHECK_OR_RETURN_VOID(connection_handler_);
- connection_handler_->Stop();
-
- LOG4CXX_INFO(logger_, "Destroying Protocol Handler");
- DCHECK(protocol_handler_);
- delete protocol_handler_;
- protocol_handler_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Connection Handler.");
- delete connection_handler_;
- connection_handler_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Last State");
- DCHECK(last_state_);
- delete last_state_;
- last_state_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Application Manager.");
- DCHECK(app_manager_);
- delete app_manager_;
- app_manager_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
-
-#ifdef DBUS_HMIADAPTER
- if (dbus_adapter_) {
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->RemoveHMIMessageAdapter(dbus_adapter_);
- dbus_adapter_->exitReceivingThread();
- StopThread(dbus_adapter_thread_);
- delete dbus_adapter_;
- dbus_adapter_ = NULL;
- }
-#endif // DBUS_HMIADAPTER
-
-#ifdef MESSAGEBROKER_HMIADAPTER
- if (mb_adapter_) {
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->RemoveHMIMessageAdapter(mb_adapter_);
- mb_adapter_->unregisterController();
- mb_adapter_->exitReceivingThread();
- StopThread(mb_adapter_thread_);
- delete mb_adapter_;
- mb_adapter_ = NULL;
- }
-
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- delete hmi_handler_;
- hmi_handler_ = NULL;
-
- LOG4CXX_INFO(logger_, "Destroying Message Broker");
- StopThread(mb_server_thread_);
- StopThread(mb_thread_);
-
- if (message_broker_server_) {
- message_broker_server_->Close();
- delete message_broker_server_;
- message_broker_server_ = NULL;
- }
-
- if (message_broker_) {
- message_broker_->stopMessageBroker();
- }
-
- networking::cleanup();
-#endif // MESSAGEBROKER_HMIADAPTER
-
-#ifdef TELEMETRY_MONITOR
- // It's important to delete tester Obcervers after TM adapters destruction
- if (telemetry_monitor_) {
- telemetry_monitor_->Stop();
- delete telemetry_monitor_;
- telemetry_monitor_ = NULL;
- }
-#endif // TELEMETRY_MONITOR
-}
-
-} // namespace main_namespace
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index f1b3800254..ff8fa2cc40 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, Ford Motor Company
+* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,91 +32,60 @@
#ifndef SRC_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
-#include "utils/macro.h"
-#include "unistd.h"
-#include "config_profile/profile.h"
-#include "hmi_message_handler/hmi_message_handler_impl.h"
-#ifdef DBUS_HMIADAPTER
-#include "hmi_message_handler/dbus_message_adapter.h"
-#endif // DBUS_HMIADAPTER
-#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
-#include "hmi_message_handler/messagebroker_adapter.h"
-#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
-#include "application_manager/application_manager_impl.h"
-#include "connection_handler/connection_handler_impl.h"
-#include "protocol_handler/protocol_handler_impl.h"
-#include "transport_manager/transport_manager.h"
-#include "transport_manager/transport_manager_default.h"
-#include "media_manager/media_manager_impl.h"
-#ifdef TELEMETRY_MONITOR
-#include "telemetry_monitor/telemetry_monitor.h"
-#endif
-
-//#if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
-#ifdef MESSAGEBROKER_HMIADAPTER
-#include "CMessageBroker.hpp"
-#include "mb_tcpserver.hpp"
-#include "networking.h" // cpplint: Include the directory when naming .h files
-#endif // MESSAGEBROKER_HMIADAPTER
-#include "system.h" // cpplint: Include the directory when naming .h files
+namespace main_namespace {
-#ifdef ENABLE_SECURITY
-namespace security_manager {
-class CryptoManager;
-class SecurityManagerImpl;
-} // namespace security_manager
-#endif // ENABLE_SECURITY
+/**
+ * Class responsible for all system components creation,
+ * start, stop, suspend and restore
+ */
-namespace main_namespace {
class LifeCycle {
public:
- LifeCycle(const profile::Profile& profile);
- bool StartComponents();
+ virtual ~LifeCycle() {}
/**
- * Initialize MessageBroker component
- * @return true if success otherwise false.
- */
- bool InitMessageSystem();
+ * Creates and starts all system components
+ * @return true if all components started successfully
+ * otherwise false.
+ */
+ virtual bool StartComponents() = 0;
+
/**
- * \brief Main loop
+ * Initializes MessageBroker component
+ * @return true if success otherwise false.
*/
- void Run();
- void StopComponents();
+ virtual bool InitMessageSystem() = 0;
- private:
- transport_manager::TransportManagerImpl* transport_manager_;
- protocol_handler::ProtocolHandlerImpl* protocol_handler_;
- connection_handler::ConnectionHandlerImpl* connection_handler_;
- application_manager::ApplicationManagerImpl* app_manager_;
-#ifdef ENABLE_SECURITY
- security_manager::CryptoManager* crypto_manager_;
- security_manager::SecurityManager* security_manager_;
-#endif // ENABLE_SECURITY
- hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
- hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
- media_manager::MediaManagerImpl* media_manager_;
- resumption::LastState* last_state_;
-#ifdef TELEMETRY_MONITOR
- telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
-#endif // TELEMETRY_MONITOR
-#ifdef DBUS_HMIADAPTER
- hmi_message_handler::DBusMessageAdapter* dbus_adapter_;
- System::Thread* dbus_adapter_thread_;
-#endif // DBUS_HMIADAPTER
+ /**
+ * @brief Main loop
+ */
+ virtual void Run() = 0;
-#ifdef MESSAGEBROKER_HMIADAPTER
- hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
- NsMessageBroker::CMessageBroker* message_broker_;
- NsMessageBroker::TcpServer* message_broker_server_;
- System::Thread* mb_thread_;
- System::Thread* mb_server_thread_;
- System::Thread* mb_adapter_thread_;
-#endif // MESSAGEBROKER_HMIADAPTER
+ /**
+ * Stops all system components
+ */
+ virtual void StopComponents() = 0;
- const profile::Profile& profile_;
- DISALLOW_COPY_AND_ASSIGN(LifeCycle);
+ /**
+ * Makes appropriate actions when Low Voltage signal received:
+ * Stops all SDL activities except of waiting of UNIX signals
+ * from HMI
+ */
+ virtual void LowVoltage() = 0;
+
+ /**
+ * Makes appropriate actions when Wake Up signal received:
+ * Restores all SDL activities stopped due to LOW VOLTAGE
+ * from HMI
+ */
+ virtual void WakeUp() = 0;
+
+ /**
+ * Makes appropriate actions when Ignition Off signal received:
+ * Triggers all SDL components stop and deletion
+ */
+ virtual void IgnitionOff() = 0;
};
} // namespace main_namespace
diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc
new file mode 100644
index 0000000000..b87191d937
--- /dev/null
+++ b/src/appMain/life_cycle_impl.cc
@@ -0,0 +1,352 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "appMain/life_cycle_impl.h"
+#include "utils/signals.h"
+#include "config_profile/profile.h"
+#include "application_manager/system_time/system_time_handler_impl.h"
+#include "resumption/last_state_impl.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/security_manager_impl.h"
+#include "security_manager/crypto_manager_impl.h"
+#include "security_manager/crypto_manager_settings_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#endif // ENABLE_SECURITY
+
+#ifdef ENABLE_LOG
+#include "utils/log_message_loop_thread.h"
+#endif // ENABLE_LOG
+
+#include "appMain/low_voltage_signals_handler.h"
+
+using threads::Thread;
+
+namespace main_namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
+
+LifeCycleImpl::LifeCycleImpl(const profile::Profile& profile)
+ : transport_manager_(NULL)
+ , protocol_handler_(NULL)
+ , connection_handler_(NULL)
+ , app_manager_(NULL)
+#ifdef ENABLE_SECURITY
+ , crypto_manager_(NULL)
+ , security_manager_(NULL)
+#endif // ENABLE_SECURITY
+ , hmi_handler_(NULL)
+ , hmi_message_adapter_(NULL)
+ , media_manager_(NULL)
+ , last_state_(NULL)
+#ifdef TELEMETRY_MONITOR
+ , telemetry_monitor_(NULL)
+#endif // TELEMETRY_MONITOR
+#ifdef MESSAGEBROKER_HMIADAPTER
+ , mb_adapter_(NULL)
+ , mb_adapter_thread_(NULL)
+#endif // MESSAGEBROKER_HMIADAPTER
+ , profile_(profile) {
+}
+
+bool LifeCycleImpl::StartComponents() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(!last_state_);
+ last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
+ profile_.app_info_storage());
+
+ DCHECK(!transport_manager_);
+ transport_manager_ = new transport_manager::TransportManagerDefault(profile_);
+
+ DCHECK(!connection_handler_);
+ connection_handler_ = new connection_handler::ConnectionHandlerImpl(
+ profile_, *transport_manager_);
+
+ DCHECK(!protocol_handler_);
+ protocol_handler_ =
+ new protocol_handler::ProtocolHandlerImpl(profile_,
+ *connection_handler_,
+ *connection_handler_,
+ *transport_manager_);
+ DCHECK(protocol_handler_);
+
+ DCHECK(!app_manager_);
+ app_manager_ =
+ new application_manager::ApplicationManagerImpl(profile_, profile_);
+
+ DCHECK(!hmi_handler_);
+ hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
+
+ hmi_handler_->set_message_observer(&(app_manager_->GetRPCHandler()));
+ app_manager_->set_hmi_message_handler(hmi_handler_);
+
+ media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
+ app_manager_->set_connection_handler(connection_handler_);
+ if (!app_manager_->Init(*last_state_, media_manager_)) {
+ LOG4CXX_ERROR(logger_, "Application manager init failed.");
+ return false;
+ }
+
+#ifdef ENABLE_SECURITY
+ auto system_time_handler =
+ std::unique_ptr<application_manager::SystemTimeHandlerImpl>(
+ new application_manager::SystemTimeHandlerImpl(*app_manager_));
+ security_manager_ =
+ new security_manager::SecurityManagerImpl(std::move(system_time_handler));
+ crypto_manager_ = new security_manager::CryptoManagerImpl(
+ std::make_shared<security_manager::CryptoManagerSettingsImpl>(
+ profile_, app_manager_->GetPolicyHandler().RetrieveCertificate()));
+ protocol_handler_->AddProtocolObserver(security_manager_);
+ protocol_handler_->set_security_manager(security_manager_);
+
+ security_manager_->set_session_observer(connection_handler_);
+ security_manager_->set_protocol_handler(protocol_handler_);
+ security_manager_->set_crypto_manager(crypto_manager_);
+ security_manager_->AddListener(app_manager_);
+
+ app_manager_->AddPolicyObserver(security_manager_);
+ app_manager_->AddPolicyObserver(protocol_handler_);
+ if (!crypto_manager_->Init()) {
+ LOG4CXX_ERROR(logger_, "CryptoManager initialization fail.");
+ return false;
+ }
+#endif // ENABLE_SECURITY
+
+ transport_manager_->AddEventListener(protocol_handler_);
+ transport_manager_->AddEventListener(connection_handler_);
+
+ protocol_handler_->AddProtocolObserver(media_manager_);
+ protocol_handler_->AddProtocolObserver(&(app_manager_->GetRPCHandler()));
+
+ media_manager_->SetProtocolHandler(protocol_handler_);
+
+ connection_handler_->set_protocol_handler(protocol_handler_);
+ connection_handler_->set_connection_handler_observer(app_manager_);
+
+// it is important to initialise TelemetryMonitor before TM to listen TM
+// Adapters
+#ifdef TELEMETRY_MONITOR
+ telemetry_monitor_ = new telemetry_monitor::TelemetryMonitor(
+ profile_.server_address(), profile_.time_testing_port());
+ telemetry_monitor_->Start();
+ telemetry_monitor_->Init(protocol_handler_, app_manager_, transport_manager_);
+#endif // TELEMETRY_MONITOR
+ // It's important to initialise TM after setting up listener chain
+ // [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
+ app_manager_->set_protocol_handler(protocol_handler_);
+ if (transport_manager::E_SUCCESS != transport_manager_->Init(*last_state_)) {
+ LOG4CXX_ERROR(logger_, "Transport manager init failed.");
+ return false;
+ }
+ // start transport manager
+ transport_manager_->Visibility(true);
+
+ LowVoltageSignalsOffset signals_offset{profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_.reset(
+ new LowVoltageSignalsHandler(*this, signals_offset));
+
+ return true;
+}
+
+void LifeCycleImpl::LowVoltage() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ transport_manager_->Visibility(false);
+ app_manager_->OnLowVoltage();
+}
+
+void LifeCycleImpl::IgnitionOff() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ kill(getpid(), SIGINT);
+}
+
+void LifeCycleImpl::WakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_manager_->OnWakeUp();
+ transport_manager_->Reinit();
+ transport_manager_->Visibility(true);
+}
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+bool LifeCycleImpl::InitMessageSystem() {
+ mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
+ hmi_handler_, profile_.server_address(), profile_.server_port());
+
+ if (!mb_adapter_->StartListener()) {
+ return false;
+ }
+
+ hmi_handler_->AddHMIMessageAdapter(mb_adapter_);
+ mb_adapter_thread_ = new std::thread(
+ &hmi_message_handler::MessageBrokerAdapter::Run, mb_adapter_);
+ return true;
+}
+#endif // MESSAGEBROKER_HMIADAPTER
+
+namespace {
+void sig_handler(int sig) {
+ switch (sig) {
+ case SIGINT:
+ LOG4CXX_DEBUG(logger_, "SIGINT signal has been caught");
+ break;
+ case SIGTERM:
+ LOG4CXX_DEBUG(logger_, "SIGTERM signal has been caught");
+ break;
+ case SIGSEGV:
+ LOG4CXX_DEBUG(logger_, "SIGSEGV signal has been caught");
+ FLUSH_LOGGER();
+ // exit need to prevent endless sending SIGSEGV
+ // http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv
+ abort();
+ default:
+ LOG4CXX_DEBUG(logger_, "Unexpected signal has been caught");
+ exit(EXIT_FAILURE);
+ }
+}
+} // namespace
+
+void LifeCycleImpl::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // Register signal handlers and wait sys signals
+ // from OS
+ if (!utils::Signals::WaitTerminationSignals(&sig_handler)) {
+ LOG4CXX_FATAL(logger_, "Fail to catch system signal!");
+ }
+}
+
+void LifeCycleImpl::StopComponents() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ hmi_handler_->set_message_observer(NULL);
+
+ DCHECK_OR_RETURN_VOID(connection_handler_);
+ connection_handler_->set_connection_handler_observer(NULL);
+
+ DCHECK_OR_RETURN_VOID(protocol_handler_);
+ protocol_handler_->RemoveProtocolObserver(&(app_manager_->GetRPCHandler()));
+
+ DCHECK_OR_RETURN_VOID(app_manager_);
+ app_manager_->Stop();
+
+ LOG4CXX_INFO(logger_, "Stopping Protocol Handler");
+ DCHECK_OR_RETURN_VOID(protocol_handler_);
+ protocol_handler_->RemoveProtocolObserver(media_manager_);
+
+#ifdef ENABLE_SECURITY
+ protocol_handler_->RemoveProtocolObserver(security_manager_);
+ if (security_manager_) {
+ security_manager_->RemoveListener(app_manager_);
+ LOG4CXX_INFO(logger_, "Destroying Crypto Manager");
+ delete crypto_manager_;
+ crypto_manager_ = NULL;
+ LOG4CXX_INFO(logger_, "Destroying Security Manager");
+ delete security_manager_;
+ security_manager_ = NULL;
+ }
+#endif // ENABLE_SECURITY
+ protocol_handler_->Stop();
+
+ LOG4CXX_INFO(logger_, "Destroying Media Manager");
+ DCHECK_OR_RETURN_VOID(media_manager_);
+ media_manager_->SetProtocolHandler(NULL);
+ delete media_manager_;
+ media_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Transport Manager.");
+ DCHECK_OR_RETURN_VOID(transport_manager_);
+ transport_manager_->Visibility(false);
+ transport_manager_->Stop();
+ delete transport_manager_;
+ transport_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Stopping Connection Handler.");
+ DCHECK_OR_RETURN_VOID(connection_handler_);
+ connection_handler_->Stop();
+
+ LOG4CXX_INFO(logger_, "Destroying Protocol Handler");
+ DCHECK(protocol_handler_);
+ delete protocol_handler_;
+ protocol_handler_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Connection Handler.");
+ delete connection_handler_;
+ connection_handler_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Last State");
+ DCHECK(last_state_);
+ delete last_state_;
+ last_state_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Application Manager.");
+ DCHECK(app_manager_);
+ delete app_manager_;
+ app_manager_ = NULL;
+
+ LOG4CXX_INFO(logger_, "Destroying Low Voltage Signals Handler.");
+ low_voltage_signals_handler_.reset();
+
+ LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+ if (mb_adapter_) {
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ hmi_handler_->RemoveHMIMessageAdapter(mb_adapter_);
+ mb_adapter_->unregisterController();
+ mb_adapter_->exitReceivingThread();
+ if (mb_adapter_thread_ != NULL) {
+ mb_adapter_thread_->join();
+ }
+ delete mb_adapter_;
+ mb_adapter_ = NULL;
+ delete mb_adapter_thread_;
+ mb_adapter_thread_ = NULL;
+ }
+ LOG4CXX_INFO(logger_, "Destroying Message Broker");
+#endif // MESSAGEBROKER_HMIADAPTER
+ DCHECK_OR_RETURN_VOID(hmi_handler_);
+ delete hmi_handler_;
+ hmi_handler_ = NULL;
+
+#ifdef TELEMETRY_MONITOR
+ // It's important to delete tester Obcervers after TM adapters destruction
+ if (telemetry_monitor_) {
+ telemetry_monitor_->Stop();
+ delete telemetry_monitor_;
+ telemetry_monitor_ = NULL;
+ }
+#endif // TELEMETRY_MONITOR
+}
+
+} // namespace main_namespace
diff --git a/src/appMain/life_cycle_impl.h b/src/appMain/life_cycle_impl.h
new file mode 100644
index 0000000000..5dfc4641ab
--- /dev/null
+++ b/src/appMain/life_cycle_impl.h
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+#define SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+
+#include "appMain/life_cycle.h"
+
+#include <unistd.h>
+#include <thread>
+#include <memory>
+#include "utils/macro.h"
+
+#include "config_profile/profile.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
+#include "hmi_message_handler/messagebroker_adapter.h"
+#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
+#include "application_manager/application_manager_impl.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+#include "media_manager/media_manager_impl.h"
+#ifdef TELEMETRY_MONITOR
+#include "telemetry_monitor/telemetry_monitor.h"
+#endif
+
+#ifdef ENABLE_SECURITY
+namespace security_manager {
+class CryptoManager;
+class SecurityManagerImpl;
+} // namespace security_manager
+#endif // ENABLE_SECURITY
+
+namespace utils {
+class SystemTimeHandler;
+} // namespace utils
+
+namespace main_namespace {
+
+class LowVoltageSignalsHandler;
+
+class LifeCycleImpl : public LifeCycle {
+ public:
+ explicit LifeCycleImpl(const profile::Profile& profile);
+
+ bool StartComponents() OVERRIDE;
+ bool InitMessageSystem() OVERRIDE;
+ void Run() OVERRIDE;
+ void StopComponents() OVERRIDE;
+ void LowVoltage() OVERRIDE;
+ void WakeUp() OVERRIDE;
+ void IgnitionOff() OVERRIDE;
+
+ private:
+ transport_manager::TransportManagerImpl* transport_manager_;
+ protocol_handler::ProtocolHandlerImpl* protocol_handler_;
+ connection_handler::ConnectionHandlerImpl* connection_handler_;
+ application_manager::ApplicationManagerImpl* app_manager_;
+ std::unique_ptr<LowVoltageSignalsHandler> low_voltage_signals_handler_;
+#ifdef ENABLE_SECURITY
+ security_manager::CryptoManager* crypto_manager_;
+ security_manager::SecurityManager* security_manager_;
+#endif // ENABLE_SECURITY
+ hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
+ hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
+ media_manager::MediaManagerImpl* media_manager_;
+ resumption::LastState* last_state_;
+#ifdef TELEMETRY_MONITOR
+ telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
+#endif // TELEMETRY_MONITOR
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+ hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
+ std::thread* mb_adapter_thread_;
+#endif // MESSAGEBROKER_HMIADAPTER
+
+ const profile::Profile& profile_;
+ DISALLOW_COPY_AND_ASSIGN(LifeCycleImpl);
+};
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
diff --git a/src/appMain/low_voltage_signals_handler.cc b/src/appMain/low_voltage_signals_handler.cc
new file mode 100644
index 0000000000..936d91ba18
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.cc
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <iostream>
+#include "appMain/life_cycle.h"
+#include "utils/signals.h"
+#include "utils/logger.h"
+#include "utils/typed_enum_print.h"
+#include "config_profile/profile.h"
+
+namespace main_namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "LowVoltageSignalsHandler")
+
+LowVoltageSignalsHandler::LowVoltageSignalsHandler(
+ LifeCycle& life_cycle, const LowVoltageSignalsOffset& offset_data)
+ : notifications_delegate_(new NotificationThreadDelegate(*this))
+ , signals_handler_thread_(threads::CreateThread(
+ "LV_SIGNALS_HANDLER_THREAD", notifications_delegate_.get()))
+ , life_cycle_(life_cycle)
+ , SIGLOWVOLTAGE_(offset_data.low_voltage_signal_offset + SIGRTMIN)
+ , SIGWAKEUP_(offset_data.wake_up_signal_offset + SIGRTMIN)
+ , SIGIGNOFF_(offset_data.ignition_off_signal_offset + SIGRTMIN)
+ , cpid_(-1) {
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGLOWVOLTAGE_);
+ signals_handler_thread_->start();
+}
+
+sigset_t LowVoltageSignalsHandler::LowVoltageSignalsMask() const {
+ return lv_mask_;
+}
+
+int LowVoltageSignalsHandler::low_voltage_signo() const {
+ return SIGLOWVOLTAGE_;
+}
+
+int LowVoltageSignalsHandler::wake_up_signo() const {
+ return SIGWAKEUP_;
+}
+
+int LowVoltageSignalsHandler::ignition_off_signo() const {
+ return SIGIGNOFF_;
+}
+
+void LowVoltageSignalsHandler::Destroy() {
+ if (signals_handler_thread_) {
+ signals_handler_thread_->join();
+ }
+ notifications_delegate_.reset();
+ threads::DeleteThread(signals_handler_thread_);
+}
+
+LowVoltageSignalsHandler::~LowVoltageSignalsHandler() {
+ Destroy();
+}
+
+void LowVoltageSignalsHandler::HandleSignal(const int signo) {
+ if (SIGLOWVOLTAGE_ == signo) {
+ LOG4CXX_DEBUG(logger_, "Received LOW_VOLTAGE signal");
+
+ life_cycle_.LowVoltage();
+ cpid_ = utils::Signals::Fork();
+
+ if (0 > cpid_) {
+ LOG4CXX_FATAL(logger_,
+ "Error due fork() call. Error: " << strerror(errno));
+ utils::Signals::ExitProcess(EXIT_FAILURE);
+ }
+
+ if (0 != cpid_) {
+ // In Parent process
+ LOG4CXX_DEBUG(logger_, "Child PID: " << cpid_);
+ utils::Signals::WaitPid(cpid_, nullptr, 0);
+ LOG4CXX_DEBUG(logger_, "Child process: " << cpid_ << " is stopped");
+ life_cycle_.WakeUp();
+ } else {
+ // In Child process
+ sigset_t signal_set;
+ sigfillset(&signal_set);
+ pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGWAKEUP_);
+ sigaddset(&lv_mask_, SIGIGNOFF_);
+ std::cout << "Stopping parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGSTOP, getppid());
+ std::cout << "SIGSTOP signal sent to " << getppid() << std::endl;
+ }
+ return;
+ }
+
+ if (SIGWAKEUP_ == signo) {
+ std::cout << "Received WAKE UP signal" << std::endl;
+ std::cout << "Waking Up parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGCONT, getppid());
+ std::cout << "Stopping child process: " << getpid() << std::endl;
+ utils::Signals::ExitProcess(0);
+ }
+
+ if (SIGIGNOFF_ == signo) {
+ std::cout << "Received IGNITION_OFF signal" << std::endl;
+ std::cout << "Stopping all SDL processes..." << std::endl;
+ utils::Signals::SendSignal(SIGKILL, getppid());
+ utils::Signals::ExitProcess(0);
+ }
+}
+
+void NotificationThreadDelegate::threadMain() {
+ while (true) {
+ int signo = 0;
+ const sigset_t lv_mask =
+ low_voltage_signals_handler_.LowVoltageSignalsMask();
+ const int err = sigwait(&lv_mask, &signo);
+ if (0 != err) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Sigwait() error! Signals set contains an invalid signal number!");
+ continue;
+ }
+ low_voltage_signals_handler_.HandleSignal(signo);
+ }
+}
+
+void NotificationThreadDelegate::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ThreadDelegate::exitThreadMain();
+}
+
+} // namespace main_namespace
diff --git a/src/appMain/low_voltage_signals_handler.h b/src/appMain/low_voltage_signals_handler.h
new file mode 100644
index 0000000000..8c139c6836
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+#define SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+
+#include <unistd.h>
+#include <memory>
+#include "utils/threads/thread_delegate.h"
+#include "utils/threads/thread.h"
+
+namespace main_namespace {
+
+typedef struct LowVoltageSignalsOffset {
+ int low_voltage_signal_offset;
+ int wake_up_signal_offset;
+ int ignition_off_signal_offset;
+} LowVoltageSignalsOffset;
+
+class LifeCycle;
+class NotificationThreadDelegate;
+
+/**
+ * @brief Class which handles real-time POSIX signals
+ * dedicated for LOW VOLTAGE functionality
+ */
+class LowVoltageSignalsHandler {
+ public:
+ /**
+ * @brief Constructor
+ * @param life_cycle - life_cycle object to interact with other system
+ * components
+ * @param offset_data offset data needed to calculate correct SIGNAL numbers
+ * used for LOW VOLTAGE functionality (as offset from SIGRTMIN)
+ */
+ LowVoltageSignalsHandler(LifeCycle& life_cycle,
+ const LowVoltageSignalsOffset& offset_data);
+ /**
+ * @brief Handles RT signals related to Low Voltage functionality
+ * @param signal number to handle
+ */
+ void HandleSignal(const int signo);
+
+ /**
+ * @brief Returns signals mask required for handling
+ * LOW VOLTAGE functionality
+ */
+ sigset_t LowVoltageSignalsMask() const;
+
+ /**
+ * @brief Returns LOW VOLTAGE signal number
+ */
+ int low_voltage_signo() const;
+
+ /**
+ * @brief Returns WAKE UP signal number
+ */
+ int wake_up_signo() const;
+
+ /**
+ * @brief Returns IGNITION OFF signal number
+ */
+ int ignition_off_signo() const;
+
+ /**
+ * @brief Destructor
+ */
+ ~LowVoltageSignalsHandler();
+
+ private:
+ /**
+ * @brief Destroys all parts of Low Voltage signals handler
+ * Invoked from destructor
+ */
+ void Destroy();
+ std::unique_ptr<NotificationThreadDelegate> notifications_delegate_;
+ threads::Thread* signals_handler_thread_;
+ LifeCycle& life_cycle_;
+ int SIGLOWVOLTAGE_;
+ int SIGWAKEUP_;
+ int SIGIGNOFF_;
+ pid_t cpid_;
+ sigset_t lv_mask_;
+};
+
+class NotificationThreadDelegate : public threads::ThreadDelegate {
+ public:
+ NotificationThreadDelegate(
+ LowVoltageSignalsHandler& low_voltage_signals_handler)
+ : low_voltage_signals_handler_(low_voltage_signals_handler) {}
+
+ ~NotificationThreadDelegate() {}
+
+ void threadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ LowVoltageSignalsHandler& low_voltage_signals_handler_;
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index 58ab02b123..752cfb7bb9 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -35,6 +35,7 @@
#include <signal.h>
#include <cstdio>
#include <cstdlib>
+#include <memory>
#include <vector>
#include <string>
#include <iostream> // cpplint: Streams are highly discouraged.
@@ -45,7 +46,7 @@
#include "utils/log_message_loop_thread.h"
#include "utils/logger.h"
-#include "./life_cycle.h"
+#include "appMain/life_cycle_impl.h"
#include "signal_handlers.h"
#include "utils/signals.h"
@@ -58,11 +59,6 @@
#endif
#include "media_manager/media_manager_impl.h"
-// ----------------------------------------------------------------------------
-// Third-Party includes
-#include "networking.h" // cpplint: Include the directory when naming .h files
-
-// ----------------------------------------------------------------------------
CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
@@ -90,23 +86,6 @@ bool InitHmi(std::string hmi_link) {
.Execute();
}
#endif // WEB_HMI
-
-#ifdef QT_HMI
-/**
- * Initialize HTML based HMI.
- * @return true if success otherwise false.
- */
-bool InitHmi() {
- std::string kStartHmi = "./start_hmi.sh";
- struct stat sb;
- if (stat(kStartHmi.c_str(), &sb) == -1) {
- LOG4CXX_FATAL(logger_, "HMI start script doesn't exist!");
- return false;
- }
-
- return utils::System(kStartHmi).Execute();
-}
-#endif // QT_HMI
}
/**
@@ -116,8 +95,8 @@ bool InitHmi() {
* \return EXIT_SUCCESS or EXIT_FAILURE
*/
int32_t main(int32_t argc, char** argv) {
- // Unsibscribe once for all threads
- if (!utils::UnsibscribeFromTermination()) {
+ // Unsubscribe once for all threads
+ if (!utils::Signals::UnsubscribeFromTermination()) {
// Can't use internal logger here
exit(EXIT_FAILURE);
}
@@ -125,13 +104,31 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
profile::Profile profile_instance;
- main_namespace::LifeCycle life_cycle(profile_instance);
+ std::unique_ptr<main_namespace::LifeCycle> life_cycle(
+ new main_namespace::LifeCycleImpl(profile_instance));
+
if ((argc > 1) && (0 != argv)) {
profile_instance.set_config_file_name(argv[1]);
} else {
profile_instance.set_config_file_name("smartDeviceLink.ini");
}
+ // Reading profile offsets for real-time signals dedicated
+ // for Low Voltage functionality handling
+ main_namespace::LowVoltageSignalsOffset signals_offset{
+ profile_instance.low_voltage_signal_offset(),
+ profile_instance.wake_up_signal_offset(),
+ profile_instance.ignition_off_signal_offset()};
+
+ // Unsubscribe once for all threads
+ // except specific thread dedicated for
+ // Low Voltage signals handling
+ // Thread will be created later
+ if (!utils::Signals::UnsubscribeFromLowVoltageSignals(signals_offset)) {
+ // Can't use internal logger here
+ exit(EXIT_FAILURE);
+ }
+
// --------------------------------------------------------------------------
// Logger initialization
INIT_LOGGER("log4cxx.properties", profile_instance.logs_enabled());
@@ -148,8 +145,7 @@ int32_t main(int32_t argc, char** argv) {
// 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);
+ LOG4CXX_FATAL(logger_, profile_instance.ErrorDescription());
FLUSH_LOGGER();
DEINIT_LOGGER();
exit(EXIT_FAILURE);
@@ -157,43 +153,43 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
- if (!life_cycle.StartComponents()) {
+ if (!life_cycle->StartComponents()) {
LOG4CXX_FATAL(logger_, "Failed to start components");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
exit(EXIT_FAILURE);
}
+ LOG4CXX_INFO(logger_, "Components Started");
// --------------------------------------------------------------------------
// Third-Party components initialization.
- if (!life_cycle.InitMessageSystem()) {
+ if (!life_cycle->InitMessageSystem()) {
LOG4CXX_FATAL(logger_, "Failed to init message system");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
_exit(EXIT_FAILURE);
}
LOG4CXX_INFO(logger_, "InitMessageBroker successful");
-
if (profile_instance.launch_hmi()) {
if (profile_instance.server_address() == kLocalHostAddress) {
LOG4CXX_INFO(logger_, "Start HMI on localhost");
-#ifndef NO_HMI
+#ifdef WEB_HMI
if (!InitHmi(profile_instance.link_to_web_hmi())) {
LOG4CXX_INFO(logger_, "InitHmi successful");
} else {
LOG4CXX_WARN(logger_, "Failed to init HMI");
}
-#endif // #ifndef NO_HMI
+#endif
}
}
// --------------------------------------------------------------------------
- life_cycle.Run();
+ life_cycle->Run();
LOG4CXX_INFO(logger_, "Stop SDL due to caught signal");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
LOG4CXX_INFO(logger_, "Application has been stopped successfuly");
DEINIT_LOGGER();
diff --git a/src/appMain/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 10f1303ec7..d503ae34e5 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -13,21 +13,22 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies/proprietary"]
},
"0x04": {
- "default": ["http://ivsu.software.ford.com/api/getsoftwareupdates"]
+ "default": ["http://x.x.x.x:3000/api/1/softwareUpdate"]
},
"queryAppsUrl": {
"default": ["http://sdl.shaid.server"]
},
"lock_screen_icon_url": {
- "default": ["http://i.imgur.com/QwZ9uKG.png"]
+ "default": ["http://i.imgur.com/TgkvOIZ.png"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"VOICECOM": 20,
"COMMUNICATION": 6,
"NORMAL": 4,
@@ -99,6 +100,12 @@
"FULL",
"LIMITED"]
},
+ "GetSystemCapability": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
"ListFiles": {
"hmi_levels": ["BACKGROUND",
"FULL",
@@ -134,7 +141,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -301,6 +309,34 @@
}
}
},
+ "Notifications-RC": {
+ "rpcs": {
+ "OnHMIStatus": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnPermissionsChange": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnSystemRequest": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ }
+ }
+ },
"DrivingCharacteristics-3": {
"user_consent_prompt": "DrivingCharacteristics",
"rpcs": {
@@ -310,6 +346,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -322,6 +359,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -334,6 +372,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -346,6 +385,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -363,12 +403,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -380,12 +423,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -397,12 +443,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -413,12 +462,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -477,6 +529,42 @@
}
}
},
+ "RemoteControl": {
+ "rpcs": {
+ "ButtonPress": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SetInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "OnInteriorVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "SystemRequest": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ },
+ "OnRCStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
+ }
+ }
+ },
"Emergency-1": {
"rpcs": {
"GetVehicleData": {
@@ -632,7 +720,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -938,6 +1027,16 @@
"hmi_levels": ["BACKGROUND"]
}
}
+ },
+ "HapticGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": ["FULL"]
+ },
+ "SendHapticData": {
+ "hmi_levels": ["FULL"]
+ }
+ }
}
},
"consumer_friendly_messages": {
@@ -2270,7 +2369,9 @@
"steal_focus": false,
"priority": "NONE",
"default_hmi": "NONE",
- "groups": ["Base-4"]
+ "groups": ["Base-4"],
+ "RequestType": [],
+ "RequestSubType": []
},
"device": {
"keep_context": false,
@@ -2289,4 +2390,3 @@
}
}
}
-
diff --git a/src/appMain/signal_handlers.cc b/src/appMain/signal_handlers.cc
index c695467ae2..649f162ec6 100644
--- a/src/appMain/signal_handlers.cc
+++ b/src/appMain/signal_handlers.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "signal_handlers.h"
-#include "life_cycle.h"
+#include "appMain/signal_handlers.h"
+#include "appMain/life_cycle.h"
#include "utils/logger.h"
namespace main_namespace {
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index c5cd4dab8e..b0513c076f 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -27,7 +27,7 @@ VideoStreamingPort = 5050
AudioStreamingPort = 5080
[MAIN]
-; SDL source version
+; SDL source version
; represents as a git commit hash value
SDLVersion = {GIT_COMMIT}
; All logging event could be dropped by setting $LogsEnabled to false
@@ -69,7 +69,6 @@ AppTimeScaleMaxRequests = 1000
AppRequestsTimeScale = 10
; Allowed pending requests amount. If value is 0 check will be skipped
PendingRequestsAmount = 5000
-PendingRequestsAmount = 0
; Heart beat timeout used for protocol v3.
; Timeout must be specified in milliseconds. If timeout is 0 heart beat will be disabled.
HeartBeatTimeout = 7000
@@ -87,6 +86,21 @@ TimeTestingPort = 8090
ReadDIDRequest = 5, 1
; Limitation for a number of GetVehicleData requests (the 1st value) per (the 2nd value) seconds
GetVehicleDataRequest = 5, 1
+; Limitation for a number of GetInteriorVehicleDataRequest requests (the 1st value) per (the 2nd value) seconds
+GetInteriorVehicleDataRequest = 5, 1
+PluginFolder = ./
+
+; The time used during switch transport procedure
+AppTransportChangeTimer = 500
+
+; The time used as addition for AppTransportChangeTimer
+AppTransportChangeTimerAddition = 0
+
+; Signal offsets used by SDL for setting up real time signals
+; used by LOW VOLTAGE functionality
+LowVoltageSignal = 1 ; Offset from SIGRTMIN
+WakeUpSignal = 2 ; Offset from SIGRTMIN
+IgnitionOffSignal = 3 ; Offset from SIGRTMIN
[MEDIA MANAGER]
; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency
@@ -138,7 +152,7 @@ DeleteFileRequest = 5
ListFilesRequest = 5
[VR COMMANDS]
-; TODO(EZamakhov): delete with APPLINK-15220
+; TODO(EZamakhov): delete with APPLINK-15220
HelpCommand = Help
[AppInfo]
@@ -146,7 +160,8 @@ HelpCommand = Help
AppInfoStorage = app_info.dat
[Security Manager]
-Protocol = TLSv1.2
+;Protocol = TLSv1.2
+Protocol = DTLSv1.0
; Certificate and key path to pem file
CertificatePath = mycert.pem
KeyPath = mykey.pem
@@ -162,7 +177,7 @@ CACertificatePath = .
; Services which can not be started unprotected (could be id's from 0x01 to 0xFF)
;ForceProtectedService = 0x0A, 0x0B
ForceProtectedService = Non
-; Services which can not be started protected or delayed protected
+; Services which can not be started protected or delayed protected
;ForceUnprotectedService = 0x07
ForceUnprotectedService = Non
; The PTU will be triggered in case expiration date of certificate
@@ -177,12 +192,19 @@ PathToSnapshot = sdl_snapshot.json
AttemptsToOpenPolicyDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMs = 500
+; Whether to use the fullAppID over the short-form appID in policy lookups
+UseFullAppID = true
[TransportManager]
; Listening port form incoming TCP mobile connection
TCPAdapterPort = 12345
+; Name of the network interface that Core will listen on for incoming TCP connection, e.g. eth0.
+; If the name is omitted, Core will listen on all network interfaces by binding to INADDR_ANY.
+TCPAdapterNetworkInterface =
[ProtocolHandler]
+; SDL supported protocol version
+MaxSupportedProtocolVersion = 5
; Packet with payload bigger than next value will be marked as a malformed
; for protocol v3 or higher
; For v2 protocol MaximumPayloadSize is 1488
@@ -213,8 +235,7 @@ ThreadPoolSize = 1
HashStringSize = 32
[SDL4]
-; Enables SDL 4.0 support
-EnableProtocol4 = true
+; Section for features added in protocol version 4
; Path where apps icons must be stored
AppIconsFolder = storage
; Max size of the folder in bytes
@@ -222,6 +243,21 @@ AppIconsFolderMaxSize = 104857600
; Amount of oldest icons to remove in case of max folder size was reached
AppIconsAmountToRemove = 1
+[SDL5]
+; Section for features added in protocol version 5
+; Control service packet with payload bigger than this value will be marked as a malformed,
+; if not specified, this value will default to MaxPayloadSize
+;MaximumControlPayloadSize = 131072
+; RPC service packet with payload bigger than this value will be marked as a malformed,
+; if not specified, this value will default to MaxPayloadSize
+;MaximumRpcPayloadSize = 131072
+; Audio service packet with payload bigger than this value will be marked as a malformed,
+; if not specified, this value will default to MaxPayloadSize
+;MaximumAudioPayloadSize = 131072
+; Video service packet with payloadbigger than this value will be marked as a malformed,
+; if not specified, this value will default to MaxPayloadSize
+;MaximumVideoPayloadSize = 131072
+
[Resumption]
; Timeout in milliseconds for resumption Application HMILevel
; and resolving conflicts in case if multiple applications initiate resumption
@@ -239,6 +275,57 @@ AttemptsToOpenResumptionDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMsResumptionDB = 500
+[TransportRequiredForResumption]
+; This section specifies transport types that are required to trigger resumption for each
+; AppHMIType. App has to be connected through at least one of the transports listed (either as
+; the primary transport or secondary transport) to trigger resumption. If the app is not
+; connected with any of the transports listed, its HMIlevel will be kept in NONE and the state
+; stays in NOT_AUDIBLE.
+; In case an app has multiple AppHMIType, requirements of all of the AppHMITypes are applied.
+;
+; Possible AppHMITypes: Default, Communication, Media, Messaging, Navigation, Information,
+; Social, BackgroundProcess, Testing, System, Projection, RemoteControl,
+; EmptyApp
+; Possible transport types: TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE,
+; IAP_USB, AOA_USB, IAP_BLUETOOTH, SPP_BLUETOOTH
+;
+; The default behavior is to always enable resumption. If an AppHMIType is not listed in this
+; section, resumption is enabled for an app with the AppHMIType.
+; On the other hand, if you want to disable resumption and always keep an app in NONE and
+; NOT_AUDIBLE state after registration, specify an empty value for the AppHMIType.
+;
+; NAVIGATION apps, PROJECTION apps and apps that declare themselves as media apps have a
+; special exception. When these apps do not have any of the transports listed here, they will
+; be still resumed into particular HMIlevel defined in LowBandwidthTransportResumptionLevel
+; section.
+
+;DefaultTransportRequiredForResumption =
+;CommunicationTransportRequiredForResumption =
+;MediaTransportRequiredForResumption =
+;MessagingTransportRequiredForResumption =
+;NavigationTransportRequiredForResumption =
+;InformationTransportRequiredForResumption =
+;SocialTransportRequiredForResumption =
+;BackgroundProcessTransportRequiredForResumption =
+;TestingTransportRequiredForResumption =
+;SystemTransportRequiredForResumption =
+;ProjectionTransportRequiredForResumption =
+;RemoteControlTransportRequiredForResumption =
+; "EmptyAppTransportRequiredForResumption" applies to apps that don't specify any AppHMIType
+;EmptyAppTransportRequiredForResumption =
+
+[LowBandwidthTransportResumptionLevel]
+; The HMI Level that an app will resume to if no high bandwidth connection is active.
+; High bandwidth connections for each app type are defined under TransportRequiredForResumption
+; section.
+; Possible values: NONE, BACKGROUND, LIMITED and FULL
+; this is for NAVIGATION apps
+;NavigationLowBandwidthResumptionLevel =
+; this is for PROJECTION apps
+;ProjectionLowBandwidthResumptionLevel =
+; this is for apps who declare themselves as media apps. (Don't be confused with AppHMIType=MEDIA.)
+;MediaLowBandwidthResumptionLevel =
+
[AppLaunch]
; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
AppLaunchWaitTime = 5000
@@ -252,6 +339,27 @@ RemoveBundleIDattempts = 3
MaxNumberOfiOSDevice = 10
; time in milliseconds started after request to launch the first app. after either expires or the first app registers SDL requests to launch the second app.
WaitTimeBetweenApps = 4000
-; App Launch on iOS devices SDL feature enabler/disabler
+; App Launch on iOS devices SDL feature enabler/disabler
EnableAppLaunchIOS = true
+[MultipleTransports]
+; Whether multiple-transports feature is enabled
+;MultipleTransportsEnabled = true
+
+; Comma-separated list of transports that can be used as Secondary Transport for each Primary Transport.
+; Possible values are: WiFi, USB and Bluetooth.
+; Core will not suggest Secondary Transport if the value is empty.
+;SecondaryTransportForBluetooth = WiFi
+;SecondaryTransportForUSB =
+;SecondaryTransportForWiFi =
+
+[ServicesMap]
+; A matrix to specify which service is allowed on which transports. The transports are listed
+; in preferred order. If a transport is not listed, then the service is not allowed
+; to run on the transport.
+; Only video and audio services are configurable.
+; If the entry of a service is completely omitted, the service will be allowed on all transports.
+; Possible values are: IAP_BLUETOOTH, IAP_USB, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_CARPLAY, SPP_BLUETOOTH, AOA_USB and TCP_WIFI.
+; Note: this configuration is applied even if multiple-transports feature is not enabled.
+;AudioServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
+;VideoServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
diff --git a/src/appMain/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/appMain/test/CMakeLists.txt b/src/appMain/test/CMakeLists.txt
new file mode 100644
index 0000000000..057e1e9869
--- /dev/null
+++ b/src/appMain/test/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/utils/test/include
+)
+
+set(testSources
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+ ${CMAKE_SOURCE_DIR}/src/appMain/test/low_voltage_signals_handler_test.cc
+ ${COMPONENTS_DIR}/utils/test/mock_signals_posix.cc
+)
+
+set(LIBRARIES
+ gmock
+)
+
+create_test(low_voltage_signals_handler_test "${testSources}" "${LIBRARIES}")
diff --git a/src/appMain/test/low_voltage_signals_handler_test.cc b/src/appMain/test/low_voltage_signals_handler_test.cc
new file mode 100644
index 0000000000..14210df71d
--- /dev/null
+++ b/src/appMain/test/low_voltage_signals_handler_test.cc
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <memory>
+#include "gtest/gtest.h"
+#include "appMain/test/mock_life_cycle.h"
+#include "utils/mock_signals_posix.h"
+#include "config_profile/profile.h"
+#include "utils/macro.h"
+
+namespace test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+class LowVoltageSignalsHandlerTest : public ::testing::Test {
+ protected:
+ LowVoltageSignalsHandlerTest()
+ : mock_life_cycle_(std::make_shared<main_namespace::MockLifeCycle>())
+ , mock_signals_posix_(*utils::MockSignalsPosix::signals_posix_mock()) {}
+
+ void SetUp() OVERRIDE {
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ signals_offset_ = {profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_ =
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>(
+ new main_namespace::LowVoltageSignalsHandler(
+ *mock_life_cycle_.get(), signals_offset_));
+ }
+
+ profile::Profile profile_;
+ main_namespace::LowVoltageSignalsOffset signals_offset_;
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>
+ low_voltage_signals_handler_;
+ std::shared_ptr<main_namespace::MockLifeCycle> mock_life_cycle_;
+ utils::MockSignalsPosix& mock_signals_posix_;
+};
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckParentProcessBehavior_ExpectChildCreationAndtLowVoltageCall) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 111;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect parent process sleep
+ EXPECT_CALL(mock_signals_posix_, WaitPid(_, nullptr, 0));
+ // Expect parent process wakes up
+ EXPECT_CALL(*mock_life_cycle_, WakeUp());
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckChildProcessBehavior_ExpectChildSendsStopToParentProcess) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 0;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGSTOP, _));
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ WakeUpSignalReceived_ExpectParentProcessWakeUpAndChildProcessExit) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGCONT, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int wake_up_signo = low_voltage_signals_handler_->wake_up_signo();
+ // Emulate WAKE UP signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(wake_up_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ IgnitionOffSignalReceived_ExpectAllProcessesStopped) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGKILL signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGKILL, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int ign_off_signo = low_voltage_signals_handler_->ignition_off_signo();
+ // Emulate IGN OFF signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(ign_off_signo);
+}
+
+} // namespace test
diff --git a/src/appMain/test/mock_life_cycle.h b/src/appMain/test/mock_life_cycle.h
new file mode 100644
index 0000000000..fc24b26080
--- /dev/null
+++ b/src/appMain/test/mock_life_cycle.h
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+#define SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+
+#include "appMain/life_cycle.h"
+#include "gmock/gmock.h"
+
+namespace main_namespace {
+
+class MockLifeCycle : public LifeCycle {
+ public:
+ MOCK_METHOD0(StartComponents, bool());
+ MOCK_METHOD0(InitMessageSystem, bool());
+ MOCK_METHOD0(Run, void());
+ MOCK_METHOD0(StopComponents, void());
+ MOCK_METHOD0(LowVoltage, void());
+ MOCK_METHOD0(WakeUp, void());
+ MOCK_METHOD0(IgnitionOff, void());
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index 0304ce986f..f262f201c2 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -86,12 +86,8 @@ add_subdirectory(./config_profile)
# --- Media Manager
add_subdirectory(./media_manager)
+
# --- Telemetry Monitor
if(TELEMETRY_MONITOR)
add_subdirectory(./telemetry_monitor)
endif()
-
-# --- DBus
-if(HMI_DBUS_API)
- add_subdirectory(./dbus)
-endif()
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index 0cfb80ed64..67a7136a62 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -1,6 +1,9 @@
# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
+# Copyright (c) 2017 Xevo Inc.
+# All rights reserved.
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -12,7 +15,7 @@
# disclaimer in the documentation and/or other materials provided with the
# distribution.
#
-# Neither the name of the Ford Motor Company nor the names of its contributors
+# Neither the name of the copyright holders nor the names of their contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@@ -48,6 +51,7 @@ include_directories (
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/request_watchdog/include
${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/system_time/
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/interfaces
${POLICY_PATH}/include/
@@ -57,6 +61,7 @@ include_directories (
${ENCRYPTION_INCLUDE_DIRECTORY}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BSON_INCLUDE_DIRECTORY}
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -80,6 +85,9 @@ set (MESSAGE_HELPER_PATHS
)
collect_sources(MESSAGE_HELPER_SOURCES "${MESSAGE_HELPER_PATHS}")
+set (SYSTEM_TIME_SOURCES
+ ${AM_SOURCE_DIR}/src/system_time/system_time_handler_impl.cc
+)
set (POLICIES_SOURCE_DIR
${AM_SOURCE_DIR}/src/policies
@@ -107,274 +115,10 @@ set (EVENT_ENGINE_PATHS
)
collect_sources(EVENT_ENGINE_SOURCES "${EVENT_ENGINE_PATHS}")
-set (COMMANDS_SOURCE_DIR
- ${AM_SOURCE_DIR}/src/commands
-)
-collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
-
-set(MOBILE_COMMANDS_EXCLUDE_PATHS
- ${COMMANDS_SOURCE_DIR}/hmi
-)
-
-set (MOBILE_COMMANDS_PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands
- ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands/mobile
- ${COMMANDS_SOURCE_DIR}
- ${COMMANDS_SOURCE_DIR}/mobile
-)
-collect_sources(MOBILE_COMMANDS_SOURCES "${MOBILE_COMMANDS_PATHS}" "${MOBILE_COMMANDS_EXCLUDE_PATHS}")
-
-set (HMI_COMMANDS_SOURCES
- ${COMMANDS_SOURCE_DIR}/hmi/request_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/response_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/request_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/response_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/notification_to_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/notification_from_hmi.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_all_apps_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/allow_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_sdl_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/activate_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/activate_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/get_system_info_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_list_of_permissions_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_user_friendly_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_get_status_update_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_status_update_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/sdl_activate_app_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/mixing_audio_supported_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_app_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_update_device_list.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/update_device_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_audio_data_streaming_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_video_data_streaming_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_consent_needed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_sdl_persistence_complete_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_exit_all_applications_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_exit_application_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_navi_way_point_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_start_device_discovery.cc
- ${COMMANDS_SOURCE_DIR}/hmi/close_popup_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/close_popup_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_activated_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/button_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_add_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_delete_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_stop_speaking_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_speak_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_set_global_properties_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/tts_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vr_perform_interaction_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_command_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_add_submenu_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_delete_submenu_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_supported_languages_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_language_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_get_capabilities_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_change_registration_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_alert_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_scrollable_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_global_properties_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_slider_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_audio_pass_thru_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_end_audio_pass_thru_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_perform_interaction_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_app_icon_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_set_media_clock_timer_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/ui_show_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_read_did_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_dtcs_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_diagnostic_message_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_type_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_is_ready_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_alert_maneuver_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_update_turn_list_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_show_constant_tbt_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_send_location_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_subscribe_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_unsubscribe_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ready_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_context_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_device_chosen_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_allow_sdl_functionality_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_consent_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_registered_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_permission_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_unregistered_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_driver_distraction_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ignition_cycle_over_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_system_info_changed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_file_removed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_started_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_stopped_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_started_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_stopped_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_command_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_command_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_navi_tbt_client_state_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_app_deactivated_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_tts_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vr_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_language_change_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_event_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_press_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_button_subscription_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_find_applications.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_keyboard_input_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_touch_event_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_ui_reset_timeout_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_start_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_stop_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_start_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_request.cc
- ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_response.cc
- ${COMMANDS_SOURCE_DIR}/hmi/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
- ${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
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_rpm_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_state_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_instant_fuel_consumption_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_external_temperature_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vin_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_prndl_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_tire_pressure_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_odometer_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_belt_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_body_information_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_device_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_driver_braking_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_wiper_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_head_lamp_status_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_engine_torque_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_acc_pedal_position_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_steering_wheel_angle_notification.cc
- ${COMMANDS_SOURCE_DIR}/hmi/on_vi_my_key_notification.cc
-)
-if (${HMI_JSON_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
-endif (${HMI_JSON_API})
-
-set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
+collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
set(EXCLUDE_PATHS
- ${COMMANDS_SOURCE_DIR}
${EVENT_ENGINE_SOURCE_DIR}
${MESSAGE_HELPER_SOURCE_DIR}
${POLICIES_SOURCE_DIR}
@@ -397,8 +141,11 @@ set(LIBRARIES
formatters
dbms
Utils
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
+
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES sqlite3)
endif ()
@@ -413,22 +160,17 @@ target_link_libraries("AMEventEngine" ${LIBRARIES})
add_library("AMPolicyLibrary" ${POLICIES_MANAGER_SOURCES} )
target_link_libraries("AMPolicyLibrary" ${LIBRARIES} AMEventEngine)
-add_library("AMHMICommandsLibrary" ${HMI_COMMANDS_SOURCES})
-target_link_libraries("AMHMICommandsLibrary" ${LIBRARIES} AMEventEngine)
+add_library("SystemTimeLibrary" ${SYSTEM_TIME_SOURCES})
+target_link_libraries("SystemTimeLibrary" ${LIBRARIES} AMEventEngine)
add_library("MessageHelper" ${MESSAGE_HELPER_SOURCES})
target_link_libraries("MessageHelper" ${LIBRARIES})
-add_library("AMMobileCommandsLibrary" ${MOBILE_COMMANDS_SOURCES} )
-target_link_libraries("AMMobileCommandsLibrary" ${LIBRARIES} AMEventEngine)
-
add_library("ApplicationManager" ${SOURCES})
list(APPEND LIBRARIES
AMEventEngine
AMPolicyLibrary
- AMHMICommandsLibrary
- AMMobileCommandsLibrary
)
if(ENABLE_LOG)
@@ -440,3 +182,5 @@ target_link_libraries("ApplicationManager" ${LIBRARIES})
if(BUILD_TESTS)
add_subdirectory(test)
endif()
+
+add_subdirectory(rpc_plugins)
diff --git a/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox b/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox
new file mode 100644
index 0000000000..447da51c55
--- /dev/null
+++ b/src/components/application_manager/doc/SDL.SDD.ApplicationManager.dox
@@ -0,0 +1,76 @@
+/**
+\page application_manager Application Manager Detailed Design
+## Table of contents
+- \subpage application_manager_intoduction
+- \subpage application_manager_detail_design
+ + \ref application_manager_state_controller "2.1 State Controller"
+*/
+//-----------------------------------------------------------
+/**
+\page application_manager_intoduction 1 Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+*/
+//-----------------------------------------------------------
+/**
+\page application_manager_detail_design 2 Component Detail Design
+\anchor application_manager_state_controller
+### 2.1 State Controller
+While application activating by HMI service new HMI level assigned to its state.
+The only one application can exist in the same time with HMI level 'FULL'.
+Therefore states of other application with their HMI level should be changed respectively.
+State Controller handles properly states of other applications while one of them changing it state.
+
+The main logic of application HMI Level conflict resolver
+If applied HMI state is FULL:
+ - all NOT audio/video applications becomes BACKGROUND
+ - all audio/video applications with other application type (navi, vc, media, projection) in FULL becomes LIMMITED
+ - all applications with same application type becomes BACKGROUND
+
+If applied HMI state is LIMITED:
+ - all NOT audio/video applications saves their's HMI states
+ - all applications with other application types saves their's HMI states
+ - all applications with same application type becomes BACKGROUND
+
+If applied HMI state is BACKGROUND:
+ - all applications will save their's HMI states
+
+Resolve tables to figure out audio/video streaming state for FULL/LIMITED HMI level.
+For example if applied is 'NAVIGATION' and resolve application is 'PROJECTION' then to resolve becomes 'NOT_STREAMABLE'.
+According to video resolve table the only one application may be 'STREAMABLE' in the same time.
+
+Video app resolve table(S --> STREAMABLE, NS --> NOT_STREAMABLE)
+
+| resolve/applied | NAVIGATION | PROJECTION | Other |
+|-----------------|------------|------------|-------|
+|NAVIGATION | NS | NS | S |
+|PROJECTION | NS | NS | S |
+|Other | NS | NS | NS |
+
+Audio application resolve table(A --> AUDIBLE, NS --> NOT_AUDIBLE)
+
+| resolve/applied | NAVIGATION | COMMUNICATION | IsMediaApp | Other |
+|-----------------|------------|---------------|------------|-------|
+|NAVIGATION | NA | A | A | A |
+|COMMUNICATION | A | NA | A | A |
+|IsMediaApp | A | A | NA | A |
+|Other | NA | NA | NA | NA |
+
+\note
+For instance if applied application is 'PROJECTION' & isMedia=true with applied HMI level 'FULL' (STREAMABLE & AUDIBLE)
+and application to resolve is 'NAVIGATION' with HMI level 'FULL' or 'LIMITED' STREAMABLE & AUDIBLE)
+then to resolve becomes 'LIMITED' (NOT_STREAMABLE & AUDIBLE).
+So, the only one application may stream video in the same time. But audio application such types as 'NAVIGATION', 'COMMUNICATION'
+may stream audio/video in 'LIMITED' level with application of other types.
+
+\note
+If applied application is 'NAVIGATION' (STREAMABLE & AUDIBLE) and application to resolve is same type
+'NAVIGATION' (STREAMABLE & AUDIBLE) then to resolve application becomes BACKGROUND (NOT_STREAMABLE & NOT_AUDIBLE).
+
+\note
+When a 'NAVIGATION' application does not start audio streaming service, media application is AUDIBLE,
+When the 'NAVIGATION' application starts streaming service, media application is ATTENUATED if system supports mixing,
+otherwise media application is NOT_AUDIBLE
+*/ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h
new file mode 100644
index 0000000000..e3231de347
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_extension.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+typedef int AppExtensionUID;
+
+class AppExtension {
+ public:
+ explicit AppExtension(AppExtensionUID uid) : kUid_(uid) {}
+ virtual ~AppExtension() {}
+ AppExtensionUID uid() const {
+ return kUid_;
+ }
+
+ /**
+ * @brief SaveResumptionData method called by SDL when it saves resumption
+ * data.
+ * @param resumption_data data reference to data, that will be appended by
+ * plugin
+ */
+ virtual void SaveResumptionData(
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) = 0;
+
+ /**
+ * @brief ProcessResumption Method called by SDL during resumption.
+ * @param resumption_data list of resumption data
+ */
+ virtual void ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) = 0;
+
+ private:
+ const AppExtensionUID kUid_;
+};
+
+typedef std::shared_ptr<AppExtension> AppExtensionPtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
index 9fc85db38c..a10963ad82 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace application_manager {
class Application;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
} // namespace application_manager
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
index 1f508eebe5..61f3480f77 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
@@ -49,7 +49,7 @@ class ResumeCtrl;
namespace app_launch {
// TODO(AK) Use unique pointer
-typedef utils::SharedPtr<timer::Timer> TimerPtr;
+typedef std::shared_ptr<timer::Timer> TimerPtr;
class MultipleAppsLauncherFactoryImpl;
class AppLaunchCtrlImpl : public AppLaunchCtrl {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
index 0d52384018..73e9623b62 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
@@ -36,7 +36,7 @@
#include <stdint.h>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace app_launch {
@@ -59,7 +59,7 @@ struct ApplicationData {
bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_;
}
};
-typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr;
+typedef std::shared_ptr<ApplicationData> ApplicationDataPtr;
/**
* @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
index 92d6bbd9ef..ccbf4c7c01 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -153,7 +153,7 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
/**
* @brief returns pointer to data base
*/
- std::auto_ptr<utils::dbms::SQLDatabase> db_;
+ std::unique_ptr<utils::dbms::SQLDatabase> db_;
/**
* @brief indicate initializing status of DB
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
index 111ff25ab2..a2b8630bcc 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
@@ -35,6 +35,8 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch_settings.h"
+#include "utils/macro.h"
+#include <memory>
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
index 61117e552b..a292b84fc0 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
@@ -38,6 +38,7 @@
#include "resumption/last_state.h"
#include "utils/lock.h"
#include "utils/macro.h"
+#include <memory>
namespace app_launch {
@@ -141,7 +142,7 @@ class AppLaunchDataJson : public AppLaunchDataImpl {
/**
* @brief lock to protected common data
*/
- mutable sync_primitives::Lock app_launch_json_lock_;
+ mutable sync_primitives::RecursiveLock app_launch_json_lock_;
/**
* @brief ponter to Last State object
diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
index 751e04bada..6285514be9 100644
--- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
@@ -3,6 +3,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "connection_handler/connection_handler.h"
#include "utils/timer.h"
+#include <memory>
namespace app_launch {
class AppLaunchCtrlImpl;
@@ -69,7 +70,7 @@ class AppsLauncher {
connection_handler::ConnectionHandler& connection_handler_;
AppsLauncher& parent_;
};
- typedef utils::SharedPtr<Launcher> LauncherPtr;
+ typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> AppLaunchers;
private:
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..f156654215 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -10,9 +10,39 @@
namespace app_launch {
class AppLaunchCtrlImpl;
-class DeviceAppsLauncherImpl;
+class DeviceAppsLauncher;
class AppsLauncher;
class AppLaunchSettings;
+class Launcher;
+class LauncherGenerator;
+
+// impl class must be defined for unique_ptr in DeviceAppsLauncher
+class DeviceAppsLauncherImpl {
+ public:
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher);
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch);
+
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const std::shared_ptr<Launcher>& launcher) const;
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ std::vector<std::shared_ptr<Launcher> > free_launchers_;
+ std::vector<std::shared_ptr<Launcher> > works_launchers_;
+ DeviceAppsLauncher& interface_;
+};
+
/**
* @brief The MultipleAppsLauncher struct
* should manage launching applications and gaps between launching application
@@ -36,7 +66,7 @@ class DeviceAppsLauncher {
private:
application_manager::ApplicationManager& app_mngr_;
const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ std::unique_ptr<DeviceAppsLauncherImpl> impl_;
friend class DeviceAppsLauncherImpl;
DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
};
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 08581b43c1..ad7570955e 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -37,15 +37,21 @@
#include <map>
#include <set>
#include <list>
-#include "utils/shared_ptr.h"
+#include <vector>
+#include <memory>
+
#include "utils/data_accessor.h"
#include "interfaces/MOBILE_API.h"
#include "connection_handler/device.h"
+#include "application_manager/app_extension.h"
#include "application_manager/message.h"
#include "application_manager/hmi_state.h"
#include "application_manager/application_state.h"
+#include "application_manager/help_prompt_manager.h"
#include "protocol_handler/protocol_handler.h"
#include "smart_objects/smart_object.h"
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
namespace application_manager {
@@ -78,7 +84,10 @@ struct Version {
struct AppFile {
// need to use in std::map;
- AppFile() {}
+ AppFile()
+ : is_persistent(false)
+ , is_download_complete(false)
+ , file_type(mobile_apis::FileType::INVALID_ENUM) {}
AppFile(const std::string& name,
bool persistent,
bool download_complete,
@@ -107,6 +116,7 @@ class InitialApplicationData {
virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
virtual const mobile_api::Language::eType& language() const = 0;
virtual const mobile_api::Language::eType& ui_language() const = 0;
+ virtual const utils::SemanticVersion& msg_version() const = 0;
virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
virtual void set_vr_synonyms(
const smart_objects::SmartObject& vr_synonyms) = 0;
@@ -117,6 +127,7 @@ class InitialApplicationData {
virtual void set_language(const mobile_api::Language::eType& language) = 0;
virtual void set_ui_language(
const mobile_api::Language::eType& ui_language) = 0;
+ virtual void set_msg_version(const utils::SemanticVersion& version) = 0;
};
/*
@@ -154,14 +165,14 @@ typedef std::map<uint32_t, PerformChoice> PerformChoiceSetMap;
typedef std::set<uint32_t> SoftButtonID;
/**
- * @brief Defines set of vehicle info types
+ * @brief Defines set of buttons subscription
*/
-typedef std::set<uint32_t> VehicleInfoSubscriptions;
+typedef std::set<mobile_apis::ButtonName::eType> ButtonSubscriptions;
/**
- * @brief Defines set of buttons subscription
+ * @breif Collection for the mobile command smart object.
*/
-typedef std::set<mobile_apis::ButtonName::eType> ButtonSubscriptions;
+typedef std::vector<smart_objects::SmartObjectSPtr> MobileMessageQueue;
class DynamicApplicationData {
public:
@@ -174,10 +185,12 @@ class DynamicApplicationData {
virtual const smart_objects::SmartObject* show_command() const = 0;
virtual const smart_objects::SmartObject* tbt_show_command() const = 0;
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const = 0;
- virtual DataAccessor<VehicleInfoSubscriptions> SubscribedIVI() const = 0;
virtual const smart_objects::SmartObject* keyboard_props() const = 0;
virtual const smart_objects::SmartObject* menu_title() const = 0;
virtual const smart_objects::SmartObject* menu_icon() const = 0;
+ virtual const smart_objects::SmartObject* day_color_scheme() const = 0;
+ virtual const smart_objects::SmartObject* night_color_scheme() const = 0;
+ virtual const std::string& display_layout() const = 0;
virtual void load_global_properties(const smart_objects::SmartObject& so) = 0;
virtual void set_help_prompt(
@@ -209,6 +222,12 @@ class DynamicApplicationData {
virtual void set_video_stream_retry_number(
const uint32_t& video_stream_retry_number) = 0;
+ virtual void set_day_color_scheme(
+ const smart_objects::SmartObject& color_scheme) = 0;
+ virtual void set_night_color_scheme(
+ const smart_objects::SmartObject& color_scheme) = 0;
+
+ virtual void set_display_layout(const std::string& layout) = 0;
/**
* @brief Checks if application is media, voice communication or navigation
* @return true if application is media, voice communication or navigation,
@@ -380,7 +399,6 @@ class Application : public virtual InitialApplicationData,
public:
enum ApplicationRegisterState { kRegistered = 0, kWaitingForRegistration };
- public:
Application() : is_greyed_out_(false) {}
virtual ~Application() {}
@@ -405,6 +423,20 @@ class Application : public virtual InitialApplicationData,
virtual void UpdateHash() = 0;
/**
+ * @brief checks is hashID was changed during suspended state
+ * @return Returns TRUE if hashID was changed during suspended state
+ * otherwise returns FALSE.
+ */
+ virtual bool IsHashChangedDuringSuspend() const = 0;
+
+ /**
+ * @brief changes state of the flag which tracks is hashID was changed during
+ * suspended state or not
+ * @param state new state of the flag
+ */
+ virtual void SetHashChangedDuringSuspend(const bool state) = 0;
+
+ /**
* @brief method is called when SDL is saving application data for resumption
* @return TRUE if data of application need to save for resumption, otherwise
* return FALSE
@@ -424,6 +456,23 @@ class Application : public virtual InitialApplicationData,
virtual bool is_navi() const = 0;
virtual void set_is_navi(bool allow) = 0;
+ /**
+ * @brief Returns is_remote_control_supported_
+ * @return true if app supports remote control, else false
+ */
+ virtual bool is_remote_control_supported() const = 0;
+
+ /**
+ * @brief Sets remote control supported,
+ * which is used to determine app with remote control
+ * @param allow, if true - remote control is supported,
+ * else remote control is disable
+ */
+ virtual void set_remote_control_supported(const bool allow) = 0;
+
+ virtual void set_mobile_projection_enabled(bool option) = 0;
+ virtual bool mobile_projection_enabled() const = 0;
+
virtual bool video_streaming_approved() const = 0;
virtual void set_video_streaming_approved(bool state) = 0;
virtual bool audio_streaming_approved() const = 0;
@@ -435,6 +484,15 @@ class Application : public virtual InitialApplicationData,
virtual void set_audio_streaming_allowed(bool state) = 0;
/**
+ * @brief Sends SetVideoConfig request to HMI to configure streaming
+ * @param service_type Type of streaming service, should be kMobileNav
+ * @param params parameters of video streaming in key-value format
+ * @return true if SetVideoConfig is sent, false otherwise
+ */
+ virtual bool SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params) = 0;
+
+ /**
* @brief Starts streaming service for application
* @param service_type Type of streaming service
*/
@@ -494,8 +552,16 @@ class Application : public virtual InitialApplicationData,
virtual const mobile_api::SystemContext::eType system_context() const = 0;
virtual const mobile_api::AudioStreamingState::eType audio_streaming_state()
const = 0;
+ virtual const mobile_api::VideoStreamingState::eType video_streaming_state()
+ const = 0;
virtual const std::string& app_icon_path() const = 0;
virtual connection_handler::DeviceHandle device() const = 0;
+ /**
+ * @brief Returns handle of the device on which secondary transport of this
+ * app is running
+ * @return handle of the device on which secondary transport is running
+ */
+ virtual connection_handler::DeviceHandle secondary_device() const = 0;
/**
* @brief sets true if application has sent TTS GlobalProperties
@@ -523,6 +589,18 @@ class Application : public virtual InitialApplicationData,
* @return flag tts_properties_in_full
*/
virtual bool tts_properties_in_full() = 0;
+ /**
+ * @brief sets true if application should keep it's HMI Level after an audio
+ * source change
+ * @param value of keep context
+ */
+ virtual void set_keep_context(bool keep_context) = 0;
+ /**
+ * @brief returns true if application should keep keep it's HMI Level after
+ * an audio source change, otherwise return false
+ * @return value of keep_context flag
+ */
+ virtual bool keep_context() = 0;
virtual void set_version(const Version& version) = 0;
virtual void set_name(const custom_str::CustomString& name) = 0;
virtual void set_is_media_application(bool is_media) = 0;
@@ -531,17 +609,41 @@ class Application : public virtual InitialApplicationData,
virtual void increment_list_files_in_none_count() = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
virtual void set_app_allowed(const bool allowed) = 0;
- virtual void set_device(connection_handler::DeviceHandle device) = 0;
+ /**
+ * @brief Sets the handle of the device on which secondary transport of this
+ * app is running
+ * @param handle of the device on which secondary transport is running
+ */
+ virtual void set_secondary_device(
+ connection_handler::DeviceHandle secondary_device) = 0;
virtual uint32_t get_grammar_id() const = 0;
virtual void set_grammar_id(uint32_t value) = 0;
virtual void set_protocol_version(
- const ProtocolVersion& protocol_version) = 0;
- virtual ProtocolVersion protocol_version() const = 0;
+ const protocol_handler::MajorProtocolVersion& protocol_version) = 0;
+ virtual protocol_handler::MajorProtocolVersion protocol_version() const = 0;
virtual void set_is_resuming(bool is_resuming) = 0;
virtual bool is_resuming() const = 0;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ virtual void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) = 0;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ virtual mobile_api::HMILevel::eType deferred_resumption_hmi_level() const = 0;
+
virtual bool AddFile(const AppFile& file) = 0;
virtual const AppFilesMap& getAppFiles() const = 0;
@@ -563,10 +665,6 @@ class Application : public virtual InitialApplicationData,
virtual bool UnsubscribeFromButton(
mobile_apis::ButtonName::eType btn_name) = 0;
- virtual bool SubscribeToIVI(uint32_t vehicle_info_type) = 0;
- virtual bool IsSubscribedToIVI(uint32_t vehicle_info_type) const = 0;
- virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type) = 0;
-
/**
* @brief ResetDataInNone reset data counters in NONE
*/
@@ -588,6 +686,19 @@ class Application : public virtual InitialApplicationData,
virtual UsageStatistics& usage_report() = 0;
/**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ virtual HelpPromptManager& help_prompt_manager() = 0;
+
+ /**
+ * @brief SetInitialState sets initial HMI state for application on
+ * registration
+ * @param state Hmi state value
+ */
+ virtual void SetInitialState(HmiStatePtr state) = 0;
+
+ /**
* @brief SetRegularState set permanent state of application
*
* @param state state to setup
@@ -637,6 +748,12 @@ class Application : public virtual InitialApplicationData,
virtual const HmiStatePtr RegularHmiState() const = 0;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const = 0;
+
+ /**
* @brief PostponedHmiState returns postponed hmi state of application
* if it's present
*
@@ -677,6 +794,13 @@ class Application : public virtual InitialApplicationData,
virtual bool IsAudioApplication() const = 0;
/**
+ * @brief Check's if it is projection or navigation application
+ *
+ * @return true if application is projection or navigation
+ */
+ virtual bool IsVideoApplication() const = 0;
+
+ /**
* @brief IsRegistered allows to distinguish if this
* application has been registered.
*
@@ -734,16 +858,6 @@ class Application : public virtual InitialApplicationData,
}
/**
- * @brief GetDeviceId allows to obtain device id which posseses
- * by this application.
- *
- * @return device the device id.
- */
- std::string GetDeviceId() const {
- return device_id_;
- }
-
- /**
* @brief Returns is application should be greyed out on HMI
*/
bool is_greyed_out() const {
@@ -770,6 +884,68 @@ class Application : public virtual InitialApplicationData,
*/
virtual uint32_t GetAvailableDiskSpace() = 0;
+ /**
+ * @brief Allows to save mobile's command smart object in order to perform
+ * this command later.
+ * @param mobile_message the message smart_object.
+ */
+ virtual void PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) = 0;
+
+ /**
+ * @brief Allows to obtain the whole list of pending commands in order to
+ * process them.
+ * @param mobile_message the messages array which is filled by the method.
+ */
+ virtual void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) = 0;
+
+ /**
+ * @brief set_system_context Set system context for application
+ * @param system_context Current context
+ */
+ virtual void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) = 0;
+
+ /**
+ * @brief set_audio_streaming_state Set audio streaming state for application
+ * @param state Current audio streaming state
+ */
+ virtual void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) = 0;
+
+ /**
+ * @brief set_hmi_level Set HMI level for application
+ * @param hmi_level Current HMI level
+ */
+ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
+
+ /**
+ * @brief Return pointer to extension by uid
+ * @param uid uid of extension
+ * @return Pointer to extension, if extension was initialized, otherwise NULL
+ */
+ virtual AppExtensionPtr QueryInterface(AppExtensionUID uid) = 0;
+
+ /**
+ * @brief Add extension to application
+ * @param extension pointer to extension
+ * @return true if success, false if extension already initialized
+ */
+ virtual bool AddExtension(AppExtensionPtr extention) = 0;
+
+ /**
+ * @brief Remove extension from application
+ * @param uid uid of extension
+ * @return true if success, false if extension is not present
+ */
+ virtual bool RemoveExtension(AppExtensionUID uid) = 0;
+
+ /**
+ * @brief Get list of available application extensions
+ * @return application extensions
+ */
+ virtual const std::list<AppExtensionPtr>& Extensions() const = 0;
+
protected:
mutable sync_primitives::Lock hmi_states_lock_;
@@ -782,8 +958,9 @@ class Application : public virtual InitialApplicationData,
bool is_greyed_out_;
};
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
+typedef uint32_t ApplicationId;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 64b5f8780b..8f24f124f9 100644
--- a/src/components/application_manager/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -35,6 +35,7 @@
#include <string>
#include "utils/lock.h"
+#include "utils/semantic_version.h"
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "interfaces/MOBILE_API.h"
@@ -55,6 +56,8 @@ class InitialApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* ngn_media_screen_name() const;
const mobile_api::Language::eType& language() const;
const mobile_api::Language::eType& ui_language() const;
+ const utils::SemanticVersion& msg_version() const;
+
void set_app_types(const smart_objects::SmartObject& app_types);
void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms);
void set_mobile_app_id(const std::string& policy_app_id);
@@ -62,6 +65,7 @@ class InitialApplicationDataImpl : public virtual Application {
void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
void set_language(const mobile_api::Language::eType& language);
void set_ui_language(const mobile_api::Language::eType& ui_language);
+ void set_msg_version(const utils::SemanticVersion& version);
void set_perform_interaction_layout(
mobile_api::LayoutMode::eType layout) OVERRIDE;
@@ -76,6 +80,7 @@ class InitialApplicationDataImpl : public virtual Application {
mobile_api::Language::eType language_;
mobile_api::Language::eType ui_language_;
mobile_apis::LayoutMode::eType perform_interaction_layout_;
+ utils::SemanticVersion msg_version_;
private:
DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
@@ -95,6 +100,9 @@ class DynamicApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* keyboard_props() const;
const smart_objects::SmartObject* menu_title() const;
const smart_objects::SmartObject* menu_icon() const;
+ const smart_objects::SmartObject* day_color_scheme() const;
+ const smart_objects::SmartObject* night_color_scheme() const;
+ const std::string& display_layout() const;
void load_global_properties(const smart_objects::SmartObject& properties_so);
void set_help_prompt(const smart_objects::SmartObject& help_prompt);
@@ -109,6 +117,9 @@ class DynamicApplicationDataImpl : public virtual Application {
void set_keyboard_props(const smart_objects::SmartObject& keyboard_props);
void set_menu_title(const smart_objects::SmartObject& menu_title);
void set_menu_icon(const smart_objects::SmartObject& menu_icon);
+ void set_day_color_scheme(const smart_objects::SmartObject& color_scheme);
+ void set_night_color_scheme(const smart_objects::SmartObject& color_scheme);
+ void set_display_layout(const std::string& layout);
/*
* @brief Adds a command to the in application menu
*/
@@ -263,15 +274,19 @@ class DynamicApplicationDataImpl : public virtual Application {
smart_objects::SmartObject* menu_title_;
smart_objects::SmartObject* menu_icon_;
smart_objects::SmartObject* tbt_show_command_;
+ smart_objects::SmartObject* day_color_scheme_;
+ smart_objects::SmartObject* night_color_scheme_;
+ std::string display_layout_;
CommandsMap commands_;
- mutable sync_primitives::Lock commands_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock> commands_lock_ptr_;
SubMenuMap sub_menu_;
- mutable sync_primitives::Lock sub_menu_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> sub_menu_lock_ptr_;
ChoiceSetMap choice_set_map_;
- mutable sync_primitives::Lock choice_set_map_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> choice_set_map_lock_ptr_;
PerformChoiceSetMap performinteraction_choice_set_map_;
- mutable sync_primitives::Lock performinteraction_choice_set_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ performinteraction_choice_set_lock_ptr_;
uint32_t is_perform_interaction_active_;
bool is_reset_global_properties_active_;
int32_t perform_interaction_mode_;
@@ -280,26 +295,27 @@ class DynamicApplicationDataImpl : public virtual Application {
void SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&));
+ const ns_smart_device_link::ns_smart_objects::SmartObject&));
DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
};
DataAccessor<CommandsMap> DynamicApplicationDataImpl::commands_map() const {
- return DataAccessor<CommandsMap>(commands_, commands_lock_);
+ return DataAccessor<CommandsMap>(commands_, commands_lock_ptr_);
}
DataAccessor<SubMenuMap> DynamicApplicationDataImpl::sub_menu_map() const {
- return DataAccessor<SubMenuMap>(sub_menu_, sub_menu_lock_);
+ return DataAccessor<SubMenuMap>(sub_menu_, sub_menu_lock_ptr_);
}
DataAccessor<ChoiceSetMap> DynamicApplicationDataImpl::choice_set_map() const {
- return DataAccessor<ChoiceSetMap>(choice_set_map_, choice_set_map_lock_);
+ return DataAccessor<ChoiceSetMap>(choice_set_map_, choice_set_map_lock_ptr_);
}
DataAccessor<PerformChoiceSetMap>
DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
- return DataAccessor<PerformChoiceSetMap>(performinteraction_choice_set_map_,
- performinteraction_choice_set_lock_);
+ return DataAccessor<PerformChoiceSetMap>(
+ performinteraction_choice_set_map_,
+ performinteraction_choice_set_lock_ptr_);
}
uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index 1c9089ca50..8dc3b2da20 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -38,19 +38,23 @@
#include <vector>
#include <utility>
#include <list>
+#include <forward_list>
#include <stdint.h>
-#include "utils/date_time.h"
+#include "application_manager/application.h"
#include "application_manager/application_data_impl.h"
#include "application_manager/usage_statistics.h"
+#include "application_manager/help_prompt_manager_impl.h"
#include "application_manager/hmi_state.h"
#include "protocol_handler/protocol_handler.h"
#include "connection_handler/device.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/custom_string.h"
#include "utils/timer.h"
+#include "utils/macro.h"
+#include "utils/date_time.h"
namespace usage_statistics {
@@ -64,15 +68,30 @@ using namespace timer;
namespace mobile_api = mobile_apis;
namespace custom_str = custom_string;
-class ApplicationImpl : public virtual InitialApplicationDataImpl,
+/**
+ * @brief SwitchApplicationParameters updates application internal parameters
+ * on transport switch. Must be used only for switching flow.
+ * @param app Pointer to switched application
+ * @param app_id New application id (connection key)
+ * @param device_id New device id
+ * @param mac_address New device MAC address
+ */
+void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
+class ApplicationImpl : public virtual Application,
+ public virtual InitialApplicationDataImpl,
public virtual DynamicApplicationDataImpl {
public:
ApplicationImpl(
uint32_t application_id,
const std::string& policy_app_id,
const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
~ApplicationImpl();
@@ -96,6 +115,14 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
}
void set_is_navi(bool allow);
+ virtual bool is_remote_control_supported() const;
+
+ void set_remote_control_supported(const bool allow);
+
+ void set_mobile_projection_enabled(bool option);
+
+ bool mobile_projection_enabled() const;
+
bool video_streaming_approved() const;
void set_video_streaming_approved(bool state);
bool audio_streaming_approved() const;
@@ -106,6 +133,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool audio_streaming_allowed() const;
void set_audio_streaming_allowed(bool state);
+ bool SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params);
void StartStreaming(protocol_handler::ServiceType service_type);
void StopStreamingForce(protocol_handler::ServiceType service_type);
void StopStreaming(protocol_handler::ServiceType service_type);
@@ -136,8 +165,11 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
const mobile_api::SystemContext::eType system_context() const;
inline const mobile_apis::AudioStreamingState::eType audio_streaming_state()
const;
+ inline const mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const;
const std::string& app_icon_path() const;
connection_handler::DeviceHandle device() const;
+ connection_handler::DeviceHandle secondary_device() const;
const std::string& mac_address() const OVERRIDE;
const std::string& bundle_id() const OVERRIDE;
void set_bundle_id(const std::string& bundle_id) OVERRIDE;
@@ -145,6 +177,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool tts_properties_in_none();
void set_tts_properties_in_full(bool active);
bool tts_properties_in_full();
+ void set_keep_context(bool keep_context);
+ bool keep_context();
void set_version(const Version& ver);
void set_name(const custom_str::CustomString& name);
void set_is_media_application(bool is_media);
@@ -154,16 +188,36 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool set_app_icon_path(const std::string& path);
void set_app_allowed(const bool allowed);
void set_device(connection_handler::DeviceHandle device);
+ void set_secondary_device(connection_handler::DeviceHandle secondary_device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
- bool is_audio() const FINAL OVERRIDE;
+ bool is_audio() const OVERRIDE;
- virtual void set_protocol_version(const ProtocolVersion& protocol_version);
- virtual ProtocolVersion protocol_version() const;
+ virtual void set_protocol_version(
+ const protocol_handler::MajorProtocolVersion& protocol_version);
+ virtual protocol_handler::MajorProtocolVersion protocol_version() const;
virtual void set_is_resuming(bool is_resuming);
virtual bool is_resuming() const;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) OVERRIDE;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level() const OVERRIDE;
+
bool AddFile(const AppFile& file);
bool UpdateFile(const AppFile& file);
bool DeleteFile(const std::string& file_name);
@@ -175,33 +229,46 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
- bool SubscribeToIVI(uint32_t vehicle_info_type) OVERRIDE;
- bool IsSubscribedToIVI(uint32_t vehicle_info_type) const OVERRIDE;
- bool UnsubscribeFromIVI(uint32_t vehicle_info_type) OVERRIDE;
- DataAccessor<VehicleInfoSubscriptions> SubscribedIVI() const OVERRIDE;
inline bool IsRegistered() const OVERRIDE;
/**
* @brief ResetDataInNone reset data counters in NONE
*/
- virtual void ResetDataInNone();
+ virtual void ResetDataInNone() OVERRIDE;
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const OVERRIDE;
virtual const std::string& curHash() const;
-#ifdef CUSTOMER_PASA
- virtual bool flag_sending_hash_change_after_awake() const;
- virtual void set_flag_sending_hash_change_after_awake(bool flag);
-#endif // CUSTOMER_PASA
- /**
- * @brief Change Hash for current application
- * and send notification to mobile
- * @return updated_hash
- */
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
virtual void UpdateHash();
+ /**
+ * @brief checks is hashID was changed during suspended state
+ * @return Returns TRUE if hashID was changed during suspended state
+ * otherwise returns FALSE.
+ */
+ bool IsHashChangedDuringSuspend() const OVERRIDE;
+
+ /**
+ * @brief changes state of the flag which tracks is hashID was changed during
+ * suspended state or not
+ * @param state new state of the flag
+ */
+ void SetHashChangedDuringSuspend(const bool state) OVERRIDE;
+
UsageStatistics& usage_report();
+ /**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ HelpPromptManager& help_prompt_manager() OVERRIDE;
+
bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
TLimitSource source);
virtual void SubscribeToSoftButtons(int32_t cmd_id,
@@ -220,7 +287,21 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*
* @return true if application is media, voice communication or navigation
*/
- virtual bool IsAudioApplication() const;
+ bool IsAudioApplication() const OVERRIDE;
+
+ /**
+ * @brief Checks whether the application is navigation or projection
+ *
+ * @return true if application is navigation or projection
+ */
+ bool IsVideoApplication() const OVERRIDE;
+
+ /**
+ * @brief SetInitialState sets initial HMI state for application on
+ * registration
+ * @param state Hmi state value
+ */
+ void SetInitialState(HmiStatePtr state) FINAL;
/**
* @brief SetRegularState set permanent state of application
@@ -266,6 +347,12 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
virtual const HmiStatePtr CurrentHmiState() const;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const;
+
+ /**
* @brief RegularHmiState of application without active events VR, TTS etc ...
* @return HmiState of application
*/
@@ -299,6 +386,29 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*/
uint32_t GetAvailableDiskSpace() OVERRIDE;
+ /**
+ * @brief Sets current system context
+ * @param system_context new system context
+ */
+ void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) OVERRIDE;
+ /**
+ * @brief Sets current audio streaming state
+ * @param state new audio streaming state
+ */
+ void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) OVERRIDE;
+ /**
+ * @brief Sets current HMI level
+ * @param hmi_level new HMI level
+ */
+ void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) OVERRIDE;
+
+ void PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) OVERRIDE;
+
+ void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) OVERRIDE;
+
protected:
/**
* @brief Clean up application folder. Persistent files will stay
@@ -328,6 +438,24 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*/
void OnAudioStreamSuspend();
+ AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE;
+
+ /**
+ * @brief Add extension to application
+ * @param extension pointer to extension
+ * @return true if success, false if extension already initialized
+ */
+ bool AddExtension(AppExtensionPtr extention) OVERRIDE;
+
+ /**
+ * @brief Remove extension from application
+ * @param uid uid of extension
+ * @return true if success, false if extension is not present
+ */
+ bool RemoveExtension(AppExtensionUID uid) OVERRIDE;
+
+ const std::list<AppExtensionPtr>& Extensions() const OVERRIDE;
+
std::string hash_val_;
uint32_t grammar_id_;
@@ -338,6 +466,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
smart_objects::SmartObject* active_message_;
bool is_media_;
bool is_navi_;
+ bool is_remote_control_supported_;
+ bool mobile_projection_enabled_;
bool video_streaming_approved_;
bool audio_streaming_approved_;
@@ -347,27 +477,32 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool audio_streaming_suspended_;
sync_primitives::Lock video_streaming_suspended_lock_;
sync_primitives::Lock audio_streaming_suspended_lock_;
+ sync_primitives::Lock streaming_stop_lock_;
bool is_app_allowed_;
bool has_been_activated_;
bool tts_properties_in_none_;
bool tts_properties_in_full_;
+ bool keep_context_;
bool is_foreground_;
bool is_application_data_changed_;
uint32_t put_file_in_none_count_;
uint32_t delete_file_in_none_count_;
uint32_t list_files_in_none_count_;
std::string app_icon_path_;
- connection_handler::DeviceHandle device_;
- const std::string mac_address_;
+ std::string mac_address_;
+ connection_handler::DeviceHandle device_id_;
+ connection_handler::DeviceHandle secondary_device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
- VehicleInfoSubscriptions subscribed_vehicle_info_;
UsageStatistics usage_report_;
- ProtocolVersion protocol_version_;
+ HelpPromptManagerImpl help_prompt_manager_impl_;
+ protocol_handler::MajorProtocolVersion protocol_version_;
bool is_voice_communication_application_;
- sync_primitives::atomic_bool is_resuming_;
+ std::atomic_bool is_resuming_;
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level_;
+ bool is_hash_changed_during_suspend_;
uint32_t video_stream_retry_number_;
uint32_t audio_stream_retry_number_;
@@ -376,10 +511,12 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
Timer video_stream_suspend_timer_;
Timer audio_stream_suspend_timer_;
+ std::list<AppExtensionPtr> extensions_;
+
/**
* @brief Defines number per time in seconds limits
*/
- typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
+ typedef std::pair<date_time::TimeDuration, uint32_t> TimeToNumberLimit;
/**
* @brief Defines specific command number per time in seconds limits
@@ -395,10 +532,19 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
CommandSoftButtonID cmd_softbuttonid_;
// Lock for command soft button id
sync_primitives::Lock cmd_softbuttonid_lock_;
- mutable sync_primitives::Lock vi_lock_;
- sync_primitives::Lock button_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> vi_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::Lock> button_lock_ptr_;
std::string folder_name_;
ApplicationManager& application_manager_;
+
+ sync_primitives::Lock mobile_message_lock_;
+ MobileMessageQueue mobile_message_queue_;
+
+ friend void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};
@@ -418,6 +564,14 @@ ApplicationImpl::audio_streaming_state() const {
: AudioStreamingState::INVALID_ENUM;
}
+const mobile_api::VideoStreamingState::eType
+ApplicationImpl::video_streaming_state() const {
+ using namespace mobile_apis;
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ return hmi_state ? hmi_state->video_streaming_state()
+ : VideoStreamingState::INVALID_ENUM;
+}
+
bool ApplicationImpl::app_allowed() const {
return is_app_allowed_;
}
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index 0c576fa9ce..6c111dbbb3 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -41,24 +41,27 @@
#include <algorithm>
#include <memory>
-#include "application_manager/hmi_command_factory.h"
#include "application_manager/application_manager.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/message.h"
#include "application_manager/message_helper.h"
#include "application_manager/request_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/state_controller_impl.h"
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
#include "application_manager/hmi_interfaces_impl.h"
+#include "application_manager/command_holder.h"
+#include "application_manager/command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/rpc_handler.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_sender.h"
+#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_handler_observer.h"
#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
@@ -83,7 +86,7 @@
#endif // TELEMETRY_MONITOR
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "utils/message_queue.h"
#include "utils/prioritized_queue.h"
#include "utils/threads/thread.h"
@@ -93,6 +96,8 @@
#include "utils/timer.h"
#include "smart_objects/smart_object.h"
+struct BsonObject;
+
namespace threads {
class Thread;
}
@@ -112,97 +117,17 @@ struct CommandParametersPermissions;
typedef std::map<std::string, hmi_apis::Common_TransportType::eType>
DeviceTypes;
-namespace impl {
-using namespace threads;
-
-/*
- * These dummy classes are here to locally impose strong typing on different
- * kinds of messages
- * Currently there is no type difference between incoming and outgoing messages
- * And due to ApplicationManagerImpl works as message router it has to
- * distinguish
- * messages passed from it's different connection points
- * TODO(ik): replace these with globally defined message types
- * when we have them.
- */
-struct MessageFromMobile : public utils::SharedPtr<Message> {
- MessageFromMobile() {}
- explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToMobile : public utils::SharedPtr<Message> {
- MessageToMobile() : is_final(false) {}
- explicit MessageToMobile(const utils::SharedPtr<Message>& message,
- bool final_message)
- : utils::SharedPtr<Message>(message), is_final(final_message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
- // Signals if connection to mobile must be closed after sending this message
- bool is_final;
-};
-
-struct MessageFromHmi : public utils::SharedPtr<Message> {
- MessageFromHmi() {}
- explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-struct MessageToHmi : public utils::SharedPtr<Message> {
- MessageToHmi() {}
- explicit MessageToHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
- // PrioritizedQueue requres this method to decide which priority to assign
- size_t PriorityOrder() const {
- return (*this)->Priority().OrderingValue();
- }
-};
-
-// Short type names for prioritized message queues
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
- FromMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> >
- ToMobileQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
- FromHmiQueue;
-typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
- ToHmiQueue;
-
-// AudioPassThru
-typedef struct {
- std::vector<uint8_t> binary_data;
- int32_t session_key;
-} AudioData;
-typedef std::queue<AudioData> RawAudioDataQueue;
-typedef threads::MessageLoopThread<RawAudioDataQueue> AudioPassThruQueue;
-}
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
class ApplicationManagerImpl
: public ApplicationManager,
- public hmi_message_handler::HMIMessageObserver,
- public protocol_handler::ProtocolObserver,
public connection_handler::ConnectionHandlerObserver,
- public policy::PolicyHandlerObserver,
+ public policy::PolicyHandlerObserver
#ifdef ENABLE_SECURITY
- public security_manager::SecurityManagerListener,
+ ,
+ public security_manager::SecurityManagerListener
#endif // ENABLE_SECURITY
- public impl::FromMobileQueue::Handler,
- public impl::ToMobileQueue::Handler,
- public impl::FromHmiQueue::Handler,
- public impl::ToHmiQueue::Handler,
- public impl::AudioPassThruQueue::Handler
#ifdef TELEMETRY_MONITOR
,
public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
@@ -243,21 +168,54 @@ class ApplicationManagerImpl
std::vector<ApplicationSharedPtr> applications_by_button(
uint32_t button) OVERRIDE;
std::vector<ApplicationSharedPtr> applications_with_navi() OVERRIDE;
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection()
+ OVERRIDE;
ApplicationSharedPtr get_limited_media_application() const OVERRIDE;
ApplicationSharedPtr get_limited_navi_application() const OVERRIDE;
ApplicationSharedPtr get_limited_voice_application() const OVERRIDE;
+ ApplicationSharedPtr get_limited_mobile_projection_application()
+ const OVERRIDE;
uint32_t application_id(const int32_t correlation_id) OVERRIDE;
void set_application_id(const int32_t correlation_id,
const uint32_t app_id) OVERRIDE;
+ uint32_t get_current_audio_source() const OVERRIDE;
+
+ void set_current_audio_source(const uint32_t source) OVERRIDE;
+
void OnHMILevelChanged(uint32_t app_id,
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) OVERRIDE;
void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) OVERRIDE;
+ const std::shared_ptr<Application> app) OVERRIDE;
+
+ void SendDriverDistractionState(ApplicationSharedPtr application);
+
+ ApplicationSharedPtr application(
+ const std::string& device_id,
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief ChangeAppsHMILevel the function that will change application's
+ * hmi level.
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param level new hmi level for certain application.
+ */
+ void ChangeAppsHMILevel(uint32_t app_id, mobile_apis::HMILevel::eType level);
+
+ virtual plugin_manager::RPCPluginManager& GetPluginManager() OVERRIDE {
+ DCHECK(plugin_manager_);
+ return *plugin_manager_;
+ }
+
+ std::vector<std::string> devices(
+ const std::string& policy_app_id) const OVERRIDE;
+
/**
* @brief Checks if application with the same HMI type
* (media, voice communication or navi) exists
@@ -271,23 +229,23 @@ class ApplicationManagerImpl
/**
* @brief Checks if Application is subscribed for way points
- * @param Application AppID
+ * @param Application pointer
* @return true if Application is subscribed for way points
* otherwise false
*/
- bool IsAppSubscribedForWayPoints(const uint32_t app_id) const OVERRIDE;
+ bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const OVERRIDE;
/**
* @brief Subscribe Application for way points
- * @param Application AppID
+ * @param Application pointer
*/
- void SubscribeAppForWayPoints(const uint32_t app_id) OVERRIDE;
+ void SubscribeAppForWayPoints(ApplicationSharedPtr app) OVERRIDE;
/**
* @brief Unsubscribe Application for way points
- * @param Application AppID
+ * @param Application pointer
*/
- void UnsubscribeAppFromWayPoints(const uint32_t app_id) OVERRIDE;
+ void UnsubscribeAppFromWayPoints(ApplicationSharedPtr app) OVERRIDE;
/**
* @brief Is Any Application is subscribed for way points
@@ -299,7 +257,7 @@ class ApplicationManagerImpl
* @brief Get subscribed for way points
* @return reference to set of subscribed apps for way points
*/
- const std::set<int32_t> GetAppsSubscribedForWayPoints() const OVERRIDE;
+ const std::set<uint32_t> GetAppsSubscribedForWayPoints() const OVERRIDE;
/**
* @brief Notifies all components interested in Vehicle Data update
@@ -308,11 +266,18 @@ class ApplicationManagerImpl
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- std::vector<ApplicationSharedPtr> IviInfoUpdated(VehicleDataType vehicle_info,
- int value) OVERRIDE;
+ void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value) OVERRIDE;
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
+ /**
+ * @brief OnApplicationSwitched starts processing of commands collected
+ * during device switching process
+ * @param app Application
+ */
+ void OnApplicationSwitched(ApplicationSharedPtr app) OVERRIDE;
+
HMICapabilities& hmi_capabilities() OVERRIDE;
const HMICapabilities& hmi_capabilities() const OVERRIDE;
@@ -337,7 +302,7 @@ class ApplicationManagerImpl
void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
#endif // TELEMETRY_MONITOR
- ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) OVERRIDE;
/*
* @brief Closes application by id
@@ -381,9 +346,6 @@ class ApplicationManagerImpl
* @brief Closes all registered applications
*/
void UnregisterAllApplications();
-
- bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
- bool LoadAppDataToHMI(ApplicationSharedPtr app);
bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE;
/**
@@ -405,46 +367,36 @@ class ApplicationManagerImpl
*/
uint32_t GetNextHMICorrelationID() OVERRIDE;
- /* @brief Starts audio passthru process
- *
- * @return true on success, false if passthru is already in process
+ /**
+ * @brief Starts AudioPassThru process by given application
+ * @param app_id ID of the application which starts the process
+ * @return true if AudioPassThru can be started, false otherwise
*/
- bool BeginAudioPassThrough() OVERRIDE;
+ bool BeginAudioPassThru(uint32_t app_id) OVERRIDE;
- /*
- * @brief Finishes already started audio passthru process
- *
- * @return true on success, false if passthru is not active
+ /**
+ * @brief Finishes already started AudioPassThru process by given application
+ * @param app_id ID of the application which started the process
+ * @return true if AudioPassThru process has been started with given
+ * application and thus it can be stopped, false otherwise
*/
- bool EndAudioPassThrough() OVERRIDE;
+ bool EndAudioPassThru(uint32_t app_id) OVERRIDE;
/*
* @brief Retrieves driver distraction state
*
* @return Current state of the distraction state
*/
- inline bool driver_distraction() const;
+ hmi_apis::Common_DriverDistractionState::eType driver_distraction_state()
+ const;
/*
* @brief Sets state for driver distraction
*
* @param state New state to be set
*/
- void set_driver_distraction(const bool is_distracting) OVERRIDE;
-
- /*
- * @brief Retrieves if VR session has started
- *
- * @return Current VR session state (started, stopped)
- */
- inline bool vr_session_started() const;
-
- /*
- * @brief Sets VR session state
- *
- * @param state Current HMI VR session state
- */
- void set_vr_session_started(const bool state);
+ void set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) OVERRIDE;
/*
* @brief Retrieves SDL access to all mobile apps
@@ -462,161 +414,79 @@ class ApplicationManagerImpl
/**
* @brief CreateRegularState create regular HMI state for application
- * @param app_id
+ * @param app Application
* @param hmi_level of returned state
* @param audio_state of returned state
* @param system_context of returned state
* @return new regular HMI state
*/
HmiStatePtr CreateRegularState(
- uint32_t app_id,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const OVERRIDE;
/**
- * @brief SetState set regular audio state
- * @param app_id applicatio id
- * @param audio_state aaudio streaming state
+ * @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
*/
- void SetState(uint32_t app_id,
- mobile_apis::AudioStreamingState::eType audio_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, audio_state);
- }
+ mobile_apis::Result::eType CheckPolicyPermissions(
+ const ApplicationSharedPtr app,
+ const std::string& function_id,
+ const RPCParams& rpc_params,
+ CommandParametersPermissions* params_permissions = NULL) OVERRIDE;
/**
- * @brief SetState setup regular hmi state, that will appear if no
- * specific events are active
- * @param app appication to setup regular State
- * @param state state of new regular state
+ * @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.
*/
- template <bool SendActivateApp>
- void SetState(uint32_t app_id, HmiStatePtr new_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, new_state, SendActivateApp);
- }
+ bool IsApplicationForbidden(uint32_t connection_key,
+ const std::string& mobile_app_id);
- /**
- * @brief SetState Change regular audio state
- * @param app appication to setup regular State
- * @param audio_state of new regular state
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
+ struct ApplicationsAppIdSorter {
+ bool operator()(const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) {
+ return lhs->app_id() < rhs->app_id();
}
- state_ctrl_.SetRegularState(app, hmi_level, SendActivateApp);
- }
+ };
- /**
- * @brief SetState Change regular hmi level and audio state
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
+ 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();
}
- state_ctrl_.SetRegularState(app, hmi_level, audio_state, SendActivateApp);
- }
+ };
- /**
- * @brief SetState Change regular hmi level and audio state
- * @param app appication to setup regular State
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI
- */
- template <bool SendActivateApp>
- void SetState(uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(
- app, hmi_level, audio_state, system_context, SendActivateApp);
- }
+ // typedef for Applications list
+ typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplictionSet;
- /**
- * @brief SetState Change regular system context
- * @param app appication to setup regular State
- * @param system_context of new regular state
- */
- void SetState(uint32_t app_id,
- mobile_apis::SystemContext::eType system_context) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, system_context);
- }
+ typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
+ AppsWaitRegistrationSet;
- /**
- * @brief SetState Change regular hmi level
- * @param app appication to setup regular State
- * @param hmi_level hmi level of new regular state
- */
- void SetHmiState(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, hmi_level);
- }
+ // typedef for Applications list iterator
+ typedef ApplictionSet::iterator ApplictionSetIt;
- /**
- * @brief SetState Change regular hmi state
- * @param app appication to setup regular State
- * @param state new regular hmi state
- */
- void SetState(uint32_t app_id, HmiStatePtr state) {
- ApplicationSharedPtr app = application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Application with appID=" << app_id << " does not exist");
- return;
- }
- state_ctrl_.SetRegularState(app, state);
- }
+ // typedef for Applications list const iterator
+ typedef ApplictionSet::const_iterator ApplictionSetConstIt;
- /**
- * @brief Checks, if particular state is active
- * @param state_id State
- * @return True, if state is active, otherwise - false
- */
- bool IsStateActive(HmiState::StateID state_id) const;
+ DataAccessor<AppsWaitRegistrationSet> apps_waiting_for_registration() const;
+ ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const;
/**
* @brief Notification from PolicyHandler about PTU.
@@ -633,6 +503,12 @@ class ApplicationManagerImpl
void OnUpdateHMIAppType(
std::map<std::string, std::vector<std::string> > app_hmi_types) OVERRIDE;
+ /**
+ * @brief OnPTUFinished is called on policy table update coming
+ * @param ptu_result True if PTU is succeeded, otherwise - false
+ */
+ void OnPTUFinished(const bool ptu_result) FINAL;
+
/*
* @brief Starts audio pass thru thread
*
@@ -657,18 +533,6 @@ class ApplicationManagerImpl
*/
void StopAudioPassThru(int32_t application_key) OVERRIDE;
- /*
- * @brief Creates AudioPassThru data chunk and inserts it
- * to audio_pass_thru_messages_
- *
- * @param session_key Id of application for which
- * audio pass thru should be sent
- *
- * @param binary_data AudioPassThru data chunk
- */
- void SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) OVERRIDE;
-
std::string GetDeviceName(connection_handler::DeviceHandle handle);
/*
@@ -688,17 +552,9 @@ class ApplicationManagerImpl
void StartDevicesDiscovery();
- // Put message to the queue to be sent to mobile.
- // if |final_message| parameter is set connection to mobile will be closed
- // after processing this message
- void SendMessageToMobile(const commands::MessageSharedPtr message,
- bool final_message = false) OVERRIDE;
-
- void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
-
- bool ManageMobileCommand(const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) OVERRIDE;
- bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
+ void RemoveHMIFakeParameters(
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) OVERRIDE;
/**
* @brief TerminateRequest forces termination of request
@@ -709,17 +565,6 @@ class ApplicationManagerImpl
void TerminateRequest(const uint32_t connection_key,
const uint32_t corr_id,
const int32_t function_id) OVERRIDE;
- // Overriden ProtocolObserver method
- void OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message) OVERRIDE;
- void OnMobileMessageSent(
- const ::protocol_handler::RawMessagePtr message) OVERRIDE;
-
- // Overriden HMIMessageObserver method
- void OnMessageReceived(
- hmi_message_handler::MessageSharedPointer message) OVERRIDE;
- void OnErrorSending(
- hmi_message_handler::MessageSharedPointer message) OVERRIDE;
// Overriden ConnectionHandlerObserver method
void OnDeviceListUpdated(
@@ -727,25 +572,84 @@ class ApplicationManagerImpl
void OnFindNewApplicationsRequest() OVERRIDE;
void RemoveDevice(
const connection_handler::DeviceHandle& device_handle) OVERRIDE;
- bool OnServiceStartedCallback(
+
+ /**
+ * @brief OnDeviceSwitchingStart is invoked on device transport switching
+ * start (e.g. from Bluetooth to USB) and creates waiting list of applications
+ * expected to be re-registered after switching is complete
+ * @param device_from device params being switched to the new transport
+ * @param device_to device params on the new transport
+ */
+ void OnDeviceSwitchingStart(
+ const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) FINAL;
+
+ /**
+ * @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
+ * i.e. timeout for switching is expired, unregisters applications from
+ * waiting list which haven't been re-registered and clears the waiting list
+ * @param device_uid UID of device being switched
+ */
+ void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL;
+
+ void OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
- const protocol_handler::ServiceType& type) OVERRIDE;
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) OVERRIDE;
void OnServiceEndedCallback(
const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
+ void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) OVERRIDE;
+ void OnSecondaryTransportEndedCallback(const int32_t session_key) OVERRIDE;
+
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ bool CheckAppIsNavi(const uint32_t app_id) const OVERRIDE;
#ifdef ENABLE_SECURITY
- // Overriden SecurityManagerListener method
+ /**
+ * @brief Notification about protection result
+ * @param connection_key Unique key of session which triggers handshake
+ * @param result result of connection protection
+ * @return true on success notification handling or false otherwise
+ */
bool OnHandshakeDone(
uint32_t connection_key,
- security_manager::SSLContext::HandshakeResult result) OVERRIDE FINAL;
+ security_manager::SSLContext::HandshakeResult result) OVERRIDE;
+
+ /**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeFailed() OVERRIDE;
- void OnCertificateUpdateRequired() OVERRIDE FINAL;
+ /**
+ * @brief Notification that certificate update is required.
+ */
+ void OnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ bool GetPolicyCertificateData(std::string& data) const OVERRIDE;
+ /**
+ * @brief Get unique handshake context by application id
+ * @param key id of application
+ * @return generated handshake context or empty context if application with
+ * provided id does not exist
+ */
security_manager::SSLContext::HandshakeContext GetHandshakeContext(
- uint32_t key) const OVERRIDE FINAL;
+ uint32_t key) const OVERRIDE;
#endif // ENABLE_SECURITY
/**
@@ -821,6 +725,20 @@ class ApplicationManagerImpl
void ForbidStreaming(uint32_t app_id) OVERRIDE;
/**
+ * @brief Called when application completes streaming configuration
+ * @param app_id Streaming application id
+ * @param service_type Streaming service type
+ * @param result true if configuration is successful, false otherwise
+ * @param rejected_params list of rejected parameters' name. Valid
+ * only when result is false.
+ */
+ void OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) OVERRIDE;
+
+ /**
* @brief Callback calls when application starts/stops data streaming
* @param app_id Streaming application id
* @param service_type Streaming service type
@@ -834,6 +752,18 @@ class ApplicationManagerImpl
ApplicationConstSharedPtr application) const;
/**
+ * @brief Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const;
+
+ /**
* Getter for resume_controller
* @return Resume Controller
*/
@@ -859,20 +789,6 @@ class ApplicationManagerImpl
*/
uint32_t GenerateNewHMIAppID() OVERRIDE;
- /**
- * @brief Parse smartObject and replace mobile app Id by HMI app ID
- *
- * @param message Smartobject to be parsed
- */
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
-
- /**
- * @brief Parse smartObject and replace HMI app ID by mobile app Id
- *
- * @param message Smartobject to be parsed
- */
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
-
/*
* @brief Save binary data to specified directory
*
@@ -888,7 +804,7 @@ class ApplicationManagerImpl
mobile_apis::Result::eType SaveBinary(const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) OVERRIDE;
+ const uint64_t offset) OVERRIDE;
/**
* @brief Get available app space
@@ -924,43 +840,33 @@ class ApplicationManagerImpl
*/
void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE;
- /**
- * @brief method adds application in FULL and LIMITED state
- * to on_phone_call_app_list_.
- * Also OnHMIStateNotification with BACKGROUND state sent for these apps
- */
- void CreatePhoneCallAppList();
-
- /**
- * @brief method removes application from on_phone_call_app_list_.
- *
- * Also OnHMIStateNotification with previous HMI state sent for these apps
- */
- void ResetPhoneCallAppList();
-
// TODO(AOleynik): Temporary added, to fix build. Should be reworked.
connection_handler::ConnectionHandler& connection_handler() const OVERRIDE;
protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE;
- virtual policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE {
- return policy_handler_;
+ policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE {
+ 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;
+
+ const policy::PolicyHandlerInterface& GetPolicyHandler() const OVERRIDE {
+ return *policy_handler_;
+ }
+
+ rpc_service::RPCService& GetRPCService() const OVERRIDE {
+ return *rpc_service_;
+ }
+
+ rpc_handler::RPCHandler& GetRPCHandler() const OVERRIDE {
+ return *rpc_handler_;
+ }
+
+ void SetRPCService(std::unique_ptr<rpc_service::RPCService>& rpc_service) {
+ rpc_service_ = std::move(rpc_service);
+ }
+
+ bool is_stopping() const OVERRIDE;
+
+ bool is_audio_pass_thru_active() const OVERRIDE;
/*
* @brief Function Should be called when Low Voltage is occured
*/
@@ -987,13 +893,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;
@@ -1038,7 +937,10 @@ class ApplicationManagerImpl
bool operator()(const ApplicationSharedPtr app) const {
return app
? handle_ == app->device() &&
- ProtocolVersion::kV4 == app->protocol_version()
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::
+ PROTOCOL_VERSION_4,
+ app->protocol_version())
: false;
}
};
@@ -1052,15 +954,6 @@ class ApplicationManagerImpl
}
};
- struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
- };
-
struct GrammarIdPredicate {
uint32_t grammar_id_;
GrammarIdPredicate(uint32_t grammar_id) : grammar_id_(grammar_id) {}
@@ -1097,16 +990,53 @@ class ApplicationManagerImpl
bool IsAppsQueriedFrom(
const connection_handler::DeviceHandle handle) const OVERRIDE;
+ /**
+ * @brief IsAppInReconnectMode check if application belongs to session
+ * affected by transport switching at the moment by checking internal
+ * waiting list prepared on switching start
+ * @param policy_app_id Application id
+ * @return True if application is in the waiting list, otherwise - false
+ */
+ bool IsAppInReconnectMode(const std::string& policy_app_id) const FINAL;
+
bool IsStopping() const OVERRIDE {
return is_stopping_;
}
+ /**
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of
+ * switched
+ * application
+ */
+ void ProcessReconnection(ApplicationSharedPtr application,
+ const uint32_t connection_key) FINAL;
+
+ /**
+ * @brief Clears all applications' persistent data
+ */
+ void ClearAppsPersistentData();
+
StateController& state_controller() OVERRIDE;
const ApplicationManagerSettings& get_settings() const OVERRIDE;
+ std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const OVERRIDE;
virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE;
app_launch::AppLaunchCtrl& app_launch_ctrl() OVERRIDE;
+ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities);
+
+ /**
+ * @brief Function returns supported SDL Protocol Version
+ * @return protocol version depends on parameters from smartDeviceLink.ini.
+ */
+ protocol_handler::MajorProtocolVersion SupportedSDLVersion() const OVERRIDE;
+
private:
/**
* @brief PullLanguagesInfo allows to pull information about languages.
@@ -1128,6 +1058,14 @@ class ApplicationManagerImpl
mobile_apis::AppHMIType::eType StringToAppHMIType(std::string str);
/**
+ * @brief Returns a string representation of AppHMIType
+ * @param type an enum value of AppHMIType
+ * @return string representation of the enum value
+ */
+ const std::string AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const;
+
+ /**
* @brief Method compares arrays of app HMI type
* @param from_policy contains app HMI type from policy
* @param from_application contains app HMI type from application
@@ -1139,35 +1077,8 @@ class ApplicationManagerImpl
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
- bool ConvertMessageToSO(const Message& message,
- smart_objects::SmartObject& output);
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
Message& output);
- utils::SharedPtr<Message> ConvertRawMsgToMessage(
- const ::protocol_handler::RawMessagePtr message);
-
- void ProcessMessageFromMobile(const utils::SharedPtr<Message> message);
- void ProcessMessageFromHMI(const utils::SharedPtr<Message> message);
-
- // threads::MessageLoopThread<*>::Handler implementations
- /*
- * @brief Handles for threads pumping different types
- * of messages. Beware, each is called on different thread!
- */
- // CALLED ON messages_from_mobile_ thread!
- void Handle(const impl::MessageFromMobile message) OVERRIDE;
-
- // CALLED ON messages_to_mobile_ thread!
- void Handle(const impl::MessageToMobile message) OVERRIDE;
-
- // CALLED ON messages_from_hmi_ thread!
- void Handle(const impl::MessageFromHmi message) OVERRIDE;
-
- // CALLED ON messages_to_hmi_ thread!
- void Handle(const impl::MessageToHmi message) OVERRIDE;
-
- // CALLED ON audio_pass_thru_messages_ thread!
- void Handle(const impl::AudioData message) OVERRIDE;
template <typename ApplicationList>
void PrepareApplicationListSO(ApplicationList app_list,
@@ -1179,7 +1090,7 @@ class ApplicationManagerImpl
uint32_t app_count = NULL == app_array ? 0 : app_array->size();
typename ApplicationList::const_iterator it;
for (it = app_list.begin(); it != app_list.end(); ++it) {
- if (!it->valid()) {
+ if (it->use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application not found ");
continue;
}
@@ -1223,10 +1134,36 @@ class ApplicationManagerImpl
*/
void SendOnSDLClose();
- /*
+ /**
* @brief returns true if low voltage state is active
*/
- bool IsLowVoltage();
+ bool IsLowVoltage() const OVERRIDE;
+
+ /**
+ * @brief Allows to process postponed commands for application
+ * when its HMI level has been changed.
+ * @param app_id the application id for processing.
+ * @param from the old HMILevel.
+ * @param to the new HMILevel for the certain app.
+ */
+ void ProcessPostponedMessages(const uint32_t app_id);
+
+ /**
+ * @brief Allows to process applications after HMILevel has been changed.
+ * @param app_id the application id for processing.
+ * @param from the old HMILevel.
+ * @param to the new HMILevel for the certain app.
+ */
+ void ProcessApp(const uint32_t app_id,
+ const mobile_apis::HMILevel::eType from,
+ const mobile_apis::HMILevel::eType to);
+
+ /**
+ * @brief Allows to send appropriate message to mobile device.
+ * @param message The smart object which contains all neccesary info to send
+ * notification.
+ */
+ void SendMobileMessage(smart_objects::SmartObjectSPtr message);
private:
/*
@@ -1274,10 +1211,13 @@ class ApplicationManagerImpl
* @brief Starts specified navi service for application
* @param app_id Application to proceed
* @param service_type Type of service to start
- * @return True on success, false on fail
+ * @param params configuration parameters specified by mobile
+ * @return True if service is immediately started or configuration
+ * parameters are sent to HMI, false on other cases
*/
bool StartNaviService(uint32_t app_id,
- protocol_handler::ServiceType service_type);
+ protocol_handler::ServiceType service_type,
+ const BsonObject* params);
/**
* @brief Stops specified navi service for application
@@ -1302,12 +1242,6 @@ class ApplicationManagerImpl
void DisallowStreaming(uint32_t app_id);
/**
- * @brief Function returns supported SDL Protocol Version
- * @return protocol version depends on parameters from smartDeviceLink.ini.
- */
- ProtocolVersion SupportedSDLVersion() const;
-
- /**
* @brief Types of directories used by Application Manager
*/
enum DirectoryType { TYPE_STORAGE, TYPE_SYSTEM, TYPE_ICONS };
@@ -1348,6 +1282,55 @@ class ApplicationManagerImpl
void ClearTTSGlobalPropertiesList();
+ /**
+ * @brief EraseAppFromReconnectionList drops application from reconnection
+ * list on transport switch success
+ * @param app Pointer to application
+ */
+ void EraseAppFromReconnectionList(const ApplicationSharedPtr& app);
+
+ /**
+ * @brief SwitchApplication updates parameters of switched application and
+ * internal applications list
+ * @param app Pointer to switched application, must be validated before
+ * passing in
+ * @param connection_key Connection key of switched application from its
+ * registration request
+ * @param device_id Device id of switched application
+ * @param mac_address New device mac address
+ */
+ void SwitchApplication(ApplicationSharedPtr app,
+ const uint32_t connection_key,
+ const size_t device_id,
+ const std::string& mac_address);
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const;
+
+ /**
+ * @brief Converts BSON object containing video parameters to
+ * smart object's map object
+ * @param output the smart object to add video parameters
+ * @param input BSON object to read parameters from
+ */
+ static void ConvertVideoParamsToSO(smart_objects::SmartObject& output,
+ const BsonObject* input);
+
+ /**
+ * @brief Converts rejected parameters' names acquired from HMI to
+ * SDL protocol's parameter names
+ * @param list of rejected parameters' names
+ * @return converted parameters' names
+ */
+ static std::vector<std::string> ConvertRejectedParamList(
+ const std::vector<std::string>& input);
+
private:
const ApplicationManagerSettings& settings_;
/**
@@ -1358,8 +1341,10 @@ class ApplicationManagerImpl
ForbiddenApps forbidden_applications;
// Lock for applications list
- mutable sync_primitives::Lock applications_list_lock_;
- mutable sync_primitives::Lock apps_to_register_list_lock_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ applications_list_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::Lock>
+ apps_to_register_list_lock_ptr_;
mutable sync_primitives::Lock subscribed_way_points_apps_lock_;
/**
@@ -1370,30 +1355,51 @@ class ApplicationManagerImpl
/**
* @brief Set AppIDs of subscribed apps for way points
*/
- std::set<int32_t> subscribed_way_points_apps_list_;
+ std::set<uint32_t> subscribed_way_points_apps_list_;
/**
* @brief Map contains applications which
* will send TTS global properties to HMI after timeout
*/
- std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
+ std::map<uint32_t, date_time::TimeDuration> tts_global_properties_app_list_;
bool audio_pass_thru_active_;
+ uint32_t audio_pass_thru_app_id_;
sync_primitives::Lock audio_pass_thru_lock_;
sync_primitives::Lock tts_global_properties_app_list_lock_;
- bool is_distracting_driver_;
+ hmi_apis::Common_DriverDistractionState::eType driver_distraction_state_;
bool is_vr_session_strated_;
bool hmi_cooperating_;
bool is_all_apps_allowed_;
+ uint32_t current_audio_source_;
event_engine::EventDispatcherImpl event_dispatcher_;
media_manager::MediaManager* media_manager_;
hmi_message_handler::HMIMessageHandler* hmi_handler_;
connection_handler::ConnectionHandler* connection_handler_;
- policy::PolicyHandler policy_handler_;
+ std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
+ std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
+
+ /**
+ * @brief Map contains apps with HMI state before incoming call
+ * After incoming call ends previous HMI state must restore
+ *
+ */
+ struct AppState {
+ AppState(const mobile_apis::HMILevel::eType& level,
+ const mobile_apis::AudioStreamingState::eType& streaming_state,
+ const mobile_apis::SystemContext::eType& context)
+ : hmi_level(level)
+ , audio_streaming_state(streaming_state)
+ , system_context(context) {}
+
+ mobile_apis::HMILevel::eType hmi_level;
+ mobile_apis::AudioStreamingState::eType audio_streaming_state;
+ mobile_apis::SystemContext::eType system_context;
+ };
hmi_apis::HMI_API* hmi_so_factory_;
mobile_apis::MOBILE_API* mobile_so_factory_;
@@ -1401,20 +1407,7 @@ class ApplicationManagerImpl
static uint32_t corelation_id_;
static const uint32_t max_corelation_id_;
- // Construct message threads when everything is already created
-
- // Thread that pumps messages coming from mobile side.
- impl::FromMobileQueue messages_from_mobile_;
- // Thread that pumps messages being passed to mobile side.
- impl::ToMobileQueue messages_to_mobile_;
- // Thread that pumps messages coming from HMI.
- impl::FromHmiQueue messages_from_hmi_;
- // Thread that pumps messages being passed to HMI.
- impl::ToHmiQueue messages_to_hmi_;
- // Thread that pumps messages audio pass thru to mobile.
- impl::AudioPassThruQueue audio_pass_thru_messages_;
-
- std::auto_ptr<HMICapabilities> hmi_capabilities_;
+ std::unique_ptr<HMICapabilities> hmi_capabilities_;
// The reason of HU shutdown
mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
@@ -1423,11 +1416,12 @@ class ApplicationManagerImpl
* about persistent application data on disk, and save session ID for resuming
* application in case INGITION_OFF or MASTER_RESSET
*/
- std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+ std::unique_ptr<resumption::ResumeCtrl> resume_ctrl_;
HmiInterfacesImpl hmi_interfaces_;
NaviServiceStatusMap navi_service_status_;
+ sync_primitives::Lock navi_service_status_lock_;
std::deque<uint32_t> navi_app_to_stop_;
std::deque<uint32_t> navi_app_to_end_stream_;
uint32_t navi_close_app_timeout_;
@@ -1435,10 +1429,25 @@ class ApplicationManagerImpl
std::vector<TimerSPtr> timer_pool_;
sync_primitives::Lock timer_pool_lock_;
- sync_primitives::Lock stopping_application_mng_lock_;
+ mutable sync_primitives::RecursiveLock stopping_application_mng_lock_;
StateControllerImpl state_ctrl_;
- std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
- std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchData> app_launch_dto_;
+ std::unique_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+
+ /**
+ * @brief ReregisterWaitList is list of applications expected to be
+ * re-registered after transport switching is complete
+ */
+ typedef std::vector<ApplicationSharedPtr> ReregisterWaitList;
+ ReregisterWaitList reregister_wait_list_;
+
+ mutable sync_primitives::Lock reregister_wait_list_lock_;
+
+ // This is a cache to remember DeviceHandle of secondary transports. Only used
+ // during RegisterApplication().
+ typedef std::map<int32_t, connection_handler::DeviceHandle> DeviceMap;
+
+ DeviceMap secondary_transport_devices_cache_;
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
@@ -1450,18 +1459,42 @@ class ApplicationManagerImpl
bool is_low_voltage_;
+ uint32_t apps_size_;
+
volatile bool is_stopping_;
- DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
-};
+ std::unique_ptr<CommandHolder> commands_holder_;
-bool ApplicationManagerImpl::vr_session_started() const {
- return is_vr_session_strated_;
-}
+ std::unique_ptr<rpc_service::RPCService> rpc_service_;
+ std::unique_ptr<rpc_handler::RPCHandler> rpc_handler_;
-bool ApplicationManagerImpl::driver_distraction() const {
- return is_distracting_driver_;
-}
+#ifdef BUILD_TESTS
+ public:
+ /**
+ * @brief register a mock application without going through the formal
+ * registration process. Only for unit testing.
+ * @param mock_app the mock app to be registered
+ */
+ void AddMockApplication(ApplicationSharedPtr mock_app);
+
+ /**
+ * @brief set a mock media manager without running Init(). Only for unit
+ * testing.
+ * @param mock_app the mock app to be registered
+ */
+ void SetMockMediaManager(media_manager::MediaManager* mock_media_manager);
+
+ virtual void SetPluginManager(
+ std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager)
+ OVERRIDE {
+ plugin_manager_.reset(plugin_manager.release());
+ }
+
+ private:
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
+};
inline bool ApplicationManagerImpl::all_apps_allowed() const {
return is_all_apps_allowed_;
diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h
new file mode 100644
index 0000000000..7dc8a0cfc1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_factory.h
@@ -0,0 +1,216 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
+
+#include "application_manager/commands/command.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+using policy::PolicyHandlerInterface;
+typedef std::shared_ptr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class CommandFactory {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~CommandFactory() {}
+
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ virtual CommandSharedPtr CreateCommand(
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandSource source) = 0;
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource source)
+ const = 0;
+};
+
+/**
+ * @brief Command creator interface for create commands
+ **/
+class CommandCreator {
+ public:
+ /**
+ * @brief ~CommandCreator destructor
+ **/
+ virtual ~CommandCreator() {}
+ /**
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool CanBeCreated() const = 0;
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ virtual CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const = 0;
+};
+
+/**
+ * @brief DefaultCommandCreator concrete command creator
+ **/
+template <typename CommandType>
+class DefaultCommandCreator : public CommandCreator {
+ public:
+ /**
+ * @brief DefaultCommandCreator constructor
+ * @param application_manager ApplicationManager.
+ * @param rpc_service RPCService.
+ * @param hmi_capabilities HMICapabilities.
+ * @param policy_handler PolicyHandlerInterface.
+ */
+ DefaultCommandCreator(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+ private:
+ /**
+ * @return return true
+ **/
+ bool CanBeCreated() const override {
+ return true;
+ }
+
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ CommandSharedPtr command(new CommandType(message,
+ application_manager_,
+ rpc_service_,
+ hmi_capabilities_,
+ policy_handler_));
+ return command;
+ }
+
+ ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ PolicyHandlerInterface& policy_handler_;
+};
+
+struct InvalidCommand {};
+
+/**
+ * @brief DefaultCommandCreator<InvalidCommand> creator for invalid commands
+ **/
+template <>
+class DefaultCommandCreator<InvalidCommand> : public CommandCreator {
+ public:
+ /**
+ * @brief DefaultCommandCreator constructor
+ * @param application_manager ApplicationManager.
+ * @param rpc_service RPCService.
+ * @param hmi_capabilities HMICapabilities.
+ * @param policy_handler PolicyHandlerInterface.
+ */
+ DefaultCommandCreator(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler) {
+ UNUSED(application_manager);
+ UNUSED(rpc_service);
+ UNUSED(hmi_capabilities);
+ UNUSED(policy_handler);
+ }
+
+ private:
+ /**
+ * @return return false
+ **/
+ bool CanBeCreated() const override {
+ return false;
+ }
+ /**
+ * @brief Create command object and return pointer to it
+ * @param message SmartObject shared pointer.
+ * @return Pointer to created empty command object.
+ **/
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ UNUSED(message);
+ return CommandSharedPtr();
+ }
+};
+
+struct CommandCreatorFactory {
+ CommandCreatorFactory(ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+ template <typename CommandType>
+ CommandCreator& GetCreator() {
+ static DefaultCommandCreator<CommandType> res(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+ return res;
+ }
+ ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ PolicyHandlerInterface& policy_handler_;
+};
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/include/application_manager/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h
new file mode 100644
index 0000000000..8cfe5f0889
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_holder.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
+
+#include <string>
+#include "application_manager/application.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+/**
+ * @brief The CommandHolder class should hold commands for particular
+ * application until certain event happens
+ */
+class CommandHolder {
+ public:
+ /**
+ * @brief The CommandType enum defines type of command to suspend or resume
+ */
+ enum class CommandType { kHmiCommand, kMobileCommand };
+
+ /**
+ * @brief ~CommandsHolder destructor
+ */
+ virtual ~CommandHolder() {}
+
+ /**
+ * @brief Suspend collects command for specific application policy id
+ * internally
+ * @param application Application pointer
+ * @param type Command type
+ * @param command Command
+ */
+ virtual void Suspend(ApplicationSharedPtr application,
+ CommandType type,
+ smart_objects::SmartObjectSPtr command) = 0;
+
+ /**
+ * @brief Resume send all collected commands for further processing and
+ * removes them afterward
+ * @param application Application pointer
+ * @param type Command type
+ */
+ virtual void Resume(ApplicationSharedPtr application, CommandType type) = 0;
+
+ /**
+ * @brief Clear removes all collected commands w/o processing
+ * @param application Application pointer
+ */
+ virtual void Clear(ApplicationSharedPtr application) = 0;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h
new file mode 100644
index 0000000000..18a1de7526
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_holder_impl.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
+
+#include "application_manager/command_holder.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include "application_manager/application.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
+
+#include "utils/macro.h"
+
+namespace application_manager {
+class ApplicationManager;
+/**
+ * @brief The CommandHolderImpl class should hold commands for particular
+ * application during application transport switching process and sends for
+ * processing after switching is completed successfully or drops otherwise
+ */
+class CommandHolderImpl : public CommandHolder {
+ public:
+ /**
+ * @brief CommandHolderImpl constructor
+ */
+
+ explicit CommandHolderImpl(ApplicationManager& app_manager);
+
+ /**
+ * @brief Suspend collects command for specific application id internally
+ * @param application Application pointer
+ * @param type Command type
+ * @param command Command
+ */
+ void Suspend(ApplicationSharedPtr application,
+ CommandType type,
+ smart_objects::SmartObjectSPtr command) FINAL;
+
+ /**
+ * @brief Resume sends all collected HMI commands to ApplicationManager
+ * for further processing
+ * @param application Application pointer
+ * @param type Command type
+ */
+ void Resume(ApplicationSharedPtr application, CommandType type) FINAL;
+
+ /**
+ * @brief Clear removes all commands collected for specific application id
+ * @param application Application pointer
+ */
+ void Clear(ApplicationSharedPtr application) FINAL;
+
+ private:
+ /**
+ * @brief ResumeHmiCommand sends suspended HMI commands for processing
+ * @param application Application which commands to process
+ */
+ void ResumeHmiCommand(ApplicationSharedPtr app);
+
+ /**
+ * @brief ResumeMobileCommand sends suspended mobile commands for processing
+ * @param application Application which commands to process
+ */
+ void ResumeMobileCommand(ApplicationSharedPtr application);
+
+ using AppCommands =
+ std::map<ApplicationSharedPtr,
+ std::vector<std::shared_ptr<smart_objects::SmartObject> > >;
+
+ ApplicationManager& app_manager_;
+ sync_primitives::Lock commands_lock_;
+ AppCommands app_mobile_commands_;
+ AppCommands app_hmi_commands_;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
index cc090defa0..f8ea7db24d 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -34,7 +34,6 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
#include <stdint.h>
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace application_manager {
@@ -113,7 +112,7 @@ class Command {
*/
virtual void SetAllowedToTerminate(const bool allowed) = 0;
- enum CommandOrigin { ORIGIN_SDL, ORIGIN_MOBILE };
+ enum CommandSource { SOURCE_SDL, SOURCE_MOBILE, SOURCE_HMI };
};
typedef smart_objects::SmartObjectSPtr MessageSharedPtr;
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
index 66456dfdb1..4859f73a55 100644
--- a/src/components/application_manager/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -63,7 +63,10 @@ class CommandImpl : public Command {
* @param message Incoming SmartObject message
**/
CommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
/**
* @brief CommandImpl class destructor
@@ -142,23 +145,26 @@ class CommandImpl : public Command {
protected:
/**
- * @brief Parse smartObject and replace mobile app Id by HMI app ID
- *
- * @param message Smartobject to be parsed
+ * @brief Parses mobile message and replaces mobile app id with HMI app id
+ * @param message Message to replace its ids
+ * @return True if replacement succeeded, otherwise - false
*/
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
+ bool ReplaceMobileWithHMIAppId(smart_objects::SmartObject& message);
/**
- * @brief Parse smartObject and replace HMI app ID by mobile app Id
- *
- * @param message Smartobject to be parsed
+ * @brief Parses message from HMI and replaces HMI app id with mobile app id
+ * @param message Message to replace its ids
+ * @return True if replacement succeeded, otherwise - false
*/
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
+ bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message);
MessageSharedPtr message_;
uint32_t default_timeout_;
bool allowed_to_terminate_;
ApplicationManager& application_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
index e8a0399c9d..8741dae540 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
@@ -42,8 +42,12 @@ namespace commands {
class CommandNotificationFromMobileImpl : public CommandImpl {
public:
- CommandNotificationFromMobileImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ CommandNotificationFromMobileImpl(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandNotificationFromMobileImpl();
virtual bool Init();
virtual bool CleanUp();
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
index dabbe4fe31..2274bc5f3b 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
@@ -43,7 +43,10 @@ namespace commands {
class CommandNotificationImpl : public CommandImpl {
public:
CommandNotificationImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandNotificationImpl();
virtual bool Init();
virtual bool CleanUp();
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
index f585410e97..27aa93d1d8 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -43,30 +43,19 @@ 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) {}
+ ResponseInfo();
+ ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager);
hmi_apis::Common_Result::eType result_code;
HmiInterfaces::InterfaceID interface;
HmiInterfaces::InterfaceState interface_state;
bool is_ok;
bool is_unsupported_resource;
- bool is_invalid_enum;
+ bool is_not_used;
};
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
/**
* @brief MergeInfos merge 2 infos in one string
@@ -112,13 +101,39 @@ class CommandRequestImpl : public CommandImpl,
public:
enum RequestState { kAwaitingHMIResponse = 0, kTimedOut, kCompleted };
+ /**
+ * @brief The HashUpdateMode enum defines whether request has to update
+ * hash after its execution is finished
+ */
+ enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate };
+
CommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~CommandRequestImpl();
- virtual bool CheckPermissions();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ ~CommandRequestImpl();
+
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ bool CheckPermissions() OVERRIDE;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Cleanup all resources used by command
+ **/
+ bool CleanUp() OVERRIDE;
+
+ /**
+ * @brief Execute corresponding command by calling the action on reciever
+ **/
+ void Run() OVERRIDE;
/*
* @brief Function is called by RequestController when request execution time
@@ -174,7 +189,7 @@ class CommandRequestImpl : public CommandImpl,
* @param msg_params HMI request msg params
*/
void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const;
+ const ns_smart::SmartObject& msg_params) const;
/**
* @brief Converts HMI result code to Mobile result code
@@ -193,6 +208,14 @@ class CommandRequestImpl : public CommandImpl,
bool CheckAllowedParameters();
/**
+ * @brief Checks HMI capabilities for specified button support
+ * @param button Button to check
+ * @return true if button is present in HMI capabilities
+ * otherwise returns false
+ */
+ bool CheckHMICapabilities(const mobile_apis::ButtonName::eType button) const;
+
+ /**
* @brief Remove from current message parameters disallowed by policy table
*/
void RemoveDisallowedParameters();
@@ -259,6 +282,19 @@ class CommandRequestImpl : public CommandImpl,
mobile_apis::Result::eType PrepareResultCodeForResponse(
const ResponseInfo& first, const ResponseInfo& second);
+ /**
+ * @brief Resolves if the return code must be
+ * UNSUPPORTED_RESOURCE
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response.
+ * @return True, if the communication return code must be
+ * UNSUPPORTED_RESOURCE, otherwise false.
+ */
+ bool IsResultCodeUnsupported(const ResponseInfo& first,
+ const ResponseInfo& second) const;
+
protected:
/**
* @brief Returns policy parameters permissions
@@ -266,11 +302,46 @@ class CommandRequestImpl : public CommandImpl,
*/
const CommandParametersPermissions& parameters_permissions() const;
+ /**
+ * @brief Adds interface to be awaited for by sdl request command
+ @param interface_id interface which SDL expects to response in given time
+ */
+ void StartAwaitForInterface(const HmiInterfaces::InterfaceID interface_id);
+
+ /**
+ * @brief Gets interface await state.
+ * @param interface_id interface which SDL awaits for response in given time
+ * @return true if SDL awaits for response from given interface in
+ * interface_id
+ */
+ bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const;
+
+ /**
+ * @brief Sets given HMI interface await status to false
+ * @param interface_id interface which SDL no longer awaits for response in
+ * given time
+ */
+ void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
+
+ /**
+ * @brief This set stores all the interfaces which are awaited by SDL to
+ * return a response on some request
+ */
+ std::set<HmiInterfaces::InterfaceID> awaiting_response_interfaces_;
+
+ mutable sync_primitives::Lock awaiting_response_interfaces_lock_;
+
RequestState current_state_;
sync_primitives::Lock state_lock_;
CommandParametersPermissions parameters_permissions_;
CommandParametersPermissions removed_parameters_permissions_;
+ /**
+ * @brief hash_update_mode_ Defines whether request must update hash value of
+ * application or not
+ */
+ HashUpdateMode hash_update_mode_;
+
private:
DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
@@ -292,6 +363,26 @@ class CommandRequestImpl : public CommandImpl,
bool ProcessHMIInterfacesAvailability(
const uint32_t hmi_correlation_id,
const hmi_apis::FunctionID::eType& function_id);
+
+ /**
+ * @brief UpdateHash updates hash field for application and sends
+ * OnHashChanged notification to mobile side in case of approriate hash mode
+ * is set
+ */
+ void UpdateHash();
+
+ /**
+ * @brief is_success_result_ Defines whether request succeded, at the moment
+ * it is value of 'success' field of appropriate response sent to mobile
+ */
+ bool is_success_result_;
+
+ /**
+ * @brief Add information for the component of response in case of timeout
+ * @param response Response message, which info should be extended
+ */
+ void AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const;
};
} // namespace commands
diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
index 44c58a8102..06e73db191 100644
--- a/src/components/application_manager/include/application_manager/commands/command_response_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
@@ -44,7 +44,10 @@ namespace commands {
class CommandResponseImpl : public CommandImpl {
public:
CommandResponseImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
virtual ~CommandResponseImpl();
virtual bool Init();
virtual bool CleanUp();
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
deleted file mode 100644
index fd4cc12468..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ActivateAppRequest command class
- **/
-class ActivateAppRequest : public RequestToHMI {
- public:
- /**
- * @brief ActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ActivateAppRequest class destructor
- **/
- virtual ~ActivateAppRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
deleted file mode 100644
index 1470bf8651..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ActivateAppResponse command class
- **/
-class ActivateAppResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ActivateAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ActivateAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ActivateAppResponse class destructor
- **/
- virtual ~ActivateAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
deleted file mode 100644
index 3e0f81f167..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddStatisticsInfoNotification command class
- **/
-class AddStatisticsInfoNotification : public NotificationFromHMI {
- public:
- /**
- * @brief AddStatisticsInfoNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddStatisticsInfoNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddStatisticsInfoNotification class destructor
- **/
- virtual ~AddStatisticsInfoNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
deleted file mode 100644
index c1c5b36e5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAllAppsRequest command class
- **/
-class AllowAllAppsRequest : public RequestToHMI {
- public:
- /**
- * @brief AllowAllAppsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAllAppsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAllAppsRequest class destructor
- **/
- virtual ~AllowAllAppsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
deleted file mode 100644
index 711825cfab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAllAppsResponse command class
- **/
-class AllowAllAppsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AllowAllAppsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAllAppsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAllAppsResponse class destructor
- **/
- virtual ~AllowAllAppsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
deleted file mode 100644
index 10424a2661..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAppRequest command class
- **/
-class AllowAppRequest : public RequestToHMI {
- public:
- /**
- * @brief AllowAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAppRequest class destructor
- **/
- virtual ~AllowAppRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
deleted file mode 100644
index 4f2642f550..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AllowAppResponse command class
- **/
-class AllowAppResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AllowAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AllowAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AllowAppResponse class destructor
- **/
- virtual ~AllowAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
deleted file mode 100644
index f789a14780..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
deleted file mode 100644
index bdfdfffd66..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief BasicCommunicationSystemRequest command class
- **/
-class BasicCommunicationSystemRequest : public RequestToHMI {
- public:
- /**
- * @brief BasicCommunicationSystemRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- BasicCommunicationSystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief BasicCommunicationSystemRequest class destructor
- **/
- virtual ~BasicCommunicationSystemRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
deleted file mode 100644
index de433568b1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief BasicCommunicationSystemResponse command class
- **/
-class BasicCommunicationSystemResponse : public ResponseFromHMI {
- public:
- /**
- * @brief BasicCommunicationSystemResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- BasicCommunicationSystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief BasicCommunicationSystemResponse class destructor
- **/
- virtual ~BasicCommunicationSystemResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
deleted file mode 100644
index 45dc690c6c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesRequest command class
- **/
-class ButtonGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief ButtonGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ButtonGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ButtonGetCapabilitiesRequest class destructor
- **/
- virtual ~ButtonGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
deleted file mode 100644
index 4efa576079..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesResponse command class
- **/
-class ButtonGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ButtonGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ButtonGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ButtonGetCapabilitiesResponse class destructor
- **/
- virtual ~ButtonGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
deleted file mode 100644
index d7d4d18d97..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ClosePopupRequest command class
- **/
-class ClosePopupRequest : public RequestToHMI {
- public:
- /**
- * @brief ClosePopupRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ClosePopupRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ClosePopupRequest class destructor
- **/
- virtual ~ClosePopupRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
deleted file mode 100644
index fdba83d3b6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ClosePopupResponse command class
- **/
-class ClosePopupResponse : public ResponseFromHMI {
- public:
- /**
- * @brief ClosePopupResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ClosePopupResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ClosePopupResponse class destructor
- **/
- virtual ~ClosePopupResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
deleted file mode 100644
index 8688698883..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DecryptCertificateRequest command class
- **/
-class DecryptCertificateRequest : public RequestToHMI {
- public:
- /**
- * @brief DecryptCertificateRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DecryptCertificateRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DecryptCertificateRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
deleted file mode 100644
index 45c2258489..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DecryptCertificateResponse command class
- **/
-class DecryptCertificateResponse : public ResponseFromHMI {
- public:
- /**
- * @brief DecryptCertificateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DecryptCertificateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DecryptCertificateResponse class destructor
- **/
- virtual ~DecryptCertificateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DecryptCertificateResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h
deleted file mode 100644
index 2b002c31dd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-/**
- * @brief DialNumberRequest command class
- **/
-class DialNumberRequest : public RequestToHMI {
- public:
- /**
- * @brief DialNumberRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberRequest class destructor
- **/
- virtual ~DialNumberRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h
deleted file mode 100644
index 1fbef15307..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief DialNumberResponse command class
- **/
-class DialNumberResponse : public ResponseFromHMI {
- public:
- /**
- * @brief DialNumberResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberResponse class destructor
- **/
- virtual ~DialNumberResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
deleted file mode 100644
index 0e0c271eef..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetSystemInfoRequest command class
- **/
-class GetSystemInfoRequest : public RequestToHMI {
- public:
- /**
- * @brief GetSystemInfoRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetSystemInfoRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetSystemInfoRequest class destructor
- **/
- virtual ~GetSystemInfoRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
deleted file mode 100644
index 10e28a839e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-struct SystemInfo {
- std::string ccpu_version;
- std::string wers_country_code;
- std::string language;
-};
-
-/**
- * @brief GetSystemInfoResponse command class
- **/
-class GetSystemInfoResponse : public ResponseFromHMI {
- public:
- /**
- * @brief GetSystemInfoResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetSystemInfoResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetSystemInfoResponse class destructor
- **/
- virtual ~GetSystemInfoResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- const SystemInfo GetSystemInfo(
- const hmi_apis::Common_Result::eType code) const;
-
- DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
deleted file mode 100644
index 1fcc1e626a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "policy/policy_types.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief GetUrls command class
- **/
-class GetUrls : public RequestFromHMI {
- public:
- /**
- * @brief GetUrls class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetUrls(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetUrls class destructor
- **/
- virtual ~GetUrls();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
-#ifdef PROPRIETARY_MODE
- /**
- * @brief Processes URLs collecting for policy service
- * @param endpoints Endpoints section of policy table
- */
- void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
-#endif // PROPRIETARY_MODE
-
- /**
- * @brief Process URLs collecting for service
- * @param endpoints Endpoints section of policy table
- */
- void ProcessServiceURLs(const policy::EndpointUrls& endpoints);
-
- /**
- * @brief Sends response to HMI
- * @param result Result code
- */
- void SendResponseToHMI(hmi_apis::Common_Result::eType result);
-
- DISALLOW_COPY_AND_ASSIGN(GetUrls);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
deleted file mode 100644
index ba058a0ec9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-class GetUrlsResponse : public ResponseToHMI {
- public:
- /**
- * @brief GetUrlsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetUrlsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetUrlsResponse class destructor
- **/
- virtual ~GetUrlsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
deleted file mode 100644
index 4989208f7a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief MixingAudioSupportedRequest command class
- **/
-class MixingAudioSupportedRequest : public RequestToHMI {
- public:
- /**
- * @brief MixingAudioSupportedRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- MixingAudioSupportedRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief MixingAudioSupportedRequest class destructor
- **/
- virtual ~MixingAudioSupportedRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
deleted file mode 100644
index a0cf89f558..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief MixingAudioSupportedResponse command class
- **/
-class MixingAudioSupportedResponse : public ResponseFromHMI {
- public:
- /**
- * @brief MixingAudioSupportedResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- MixingAudioSupportedResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief MixingAudioSupportedResponse class destructor
- **/
- virtual ~MixingAudioSupportedResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
deleted file mode 100644
index 123c0ab0d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviAlertManeuverRequest command class
- **/
-class NaviAlertManeuverRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviAlertManeuverRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviAlertManeuverRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviAlertManeuverRequest class destructor
- **/
- virtual ~NaviAlertManeuverRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
deleted file mode 100644
index d4a57e9e2f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviAlertManeuverResponse command class
- **/
-class NaviAlertManeuverResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviAlertManeuverResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviAlertManeuverResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviAlertManeuverResponse class destructor
- **/
- virtual ~NaviAlertManeuverResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
deleted file mode 100644
index d6f4fd36e2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStartStreamRequest command class
- **/
-class AudioStartStreamRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief AudioStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStartStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~AudioStartStreamRequest();
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief On event callback
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set audio_stream_retry_number counter to 0
- */
- void RetryStartSession();
-
- private:
- uint32_t retry_number_;
- DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
deleted file mode 100644
index 485b510bf2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStartStreamResponse command class
- **/
-class AudioStartStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AudioStartStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStartStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AudioStartStreamResponse class destructor
- **/
- virtual ~AudioStartStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
deleted file mode 100644
index 3a21e3e827..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AudioStopStreamRequest command class
- **/
-class AudioStopStreamRequest : public RequestToHMI {
- public:
- /**
- * @brief AudioStopStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStopStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStopStreamRequest class destructor
- **/
- virtual ~AudioStopStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
deleted file mode 100644
index ce32d5b627..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamResponse command class
- **/
-class AudioStopStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief AudioStopStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AudioStopStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStopStreamResponse class destructor
- **/
- virtual ~AudioStopStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h
deleted file mode 100644
index 33c5dfe2db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviGetWayPointsRequest command class
- **/
-class NaviGetWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviGetWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviGetWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- /**
- * @brief NaviGetWayPointsRequest class destructor
- **/
- virtual ~NaviGetWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h
deleted file mode 100644
index 633d927715..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviGetWaypoints command class
- **/
-class NaviGetWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviGetWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviGetWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviGetWaypoints class destructor
- **/
- virtual ~NaviGetWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
deleted file mode 100644
index 08826743cc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviIsReadyRequest command class
- **/
-class NaviIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief NaviIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviIsReadyRequest class destructor
- **/
- virtual ~NaviIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
deleted file mode 100644
index 72c001b863..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviIsReadyResponse command class
- **/
-class NaviIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviIsReadyResponse class destructor
- **/
- virtual ~NaviIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
deleted file mode 100644
index 56a9594c0b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSendLocationRequest command class
- */
-class NaviSendLocationRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviSendLocationRequest class constructor
- *
- * @param message Incoming SmartObject message
- */
- NaviSendLocationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSendLocationRequest class destructor
- */
- virtual ~NaviSendLocationRequest();
-
- /**
- * @brief Execute command
- */
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
deleted file mode 100644
index ec3392642a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSendLocationResponse command class
- */
-class NaviSendLocationResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviSendLocationResponse class constructor
- *
- * @param message Incoming SmartObject message
- */
- NaviSendLocationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSendLocationResponse class destructor
- */
- virtual ~NaviSendLocationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
deleted file mode 100644
index 4cb8ddd7f7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviShowConstantTBTRequest command class
- **/
-class NaviShowConstantTBTRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviShowConstantTBTRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviShowConstantTBTRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviShowConstantTBTRequest class destructor
- **/
- virtual ~NaviShowConstantTBTRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
deleted file mode 100644
index d9e7b1d234..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviShowConstantTBTResponse command class
- **/
-class NaviShowConstantTBTResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviShowConstantTBTResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviShowConstantTBTResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviShowConstantTBTResponse class destructor
- **/
- virtual ~NaviShowConstantTBTResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
deleted file mode 100644
index 6fcb3f3267..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStartStreamRequest command class
- **/
-class NaviStartStreamRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief NaviStartStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStartStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStartStreamRequest class destructor
- **/
- virtual ~NaviStartStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief On event callback
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut();
-
- /**
- * @brief RetryStartSession resend HMI startSession request if needed.
- * If limit expired, set video_stream_retry_number counter to 0
- */
- void RetryStartSession();
-
- private:
- uint32_t retry_number_;
- DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
deleted file mode 100644
index 3e18767194..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStartStreamResponse command class
- **/
-class NaviStartStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviStartStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStartStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStartStreamResponse class destructor
- **/
- virtual ~NaviStartStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
deleted file mode 100644
index d6952d0305..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamRequest command class
- **/
-class NaviStopStreamRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviStopStreamRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStopStreamRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviStopStreamRequest class destructor
- **/
- virtual ~NaviStopStreamRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
deleted file mode 100644
index b3107b5e61..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviStopStreamResponse command class
- **/
-class NaviStopStreamResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviStopStreamResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviStopStreamResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviStopStreamResponse class destructor
- **/
- virtual ~NaviStopStreamResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h
deleted file mode 100644
index 33a2077918..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWayPointsRequest command class
- **/
-class NaviSubscribeWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviSubscribeWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviSubscribeWayPointsRequest(const MessageSharedPtr& messag,
- ApplicationManager& application_manager);
- /**
- * @brief NaviSubscribeWayPointsRequest class destructor
- **/
- virtual ~NaviSubscribeWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h
deleted file mode 100644
index eff2b281f2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWaypoints command class
- **/
-class NaviSubscribeWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviSubscribeWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviSubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviSubscribeWaypoints class destructor
- **/
- virtual ~NaviSubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h
deleted file mode 100644
index 607bb1ef26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviSubscribeWayPointsRequest command class
- **/
-class NaviUnSubscribeWayPointsRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviUnSubscribeWayPointsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUnSubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- /**
- * @brief NaviUnSubscribeWayPointsRequest class destructor
- **/
- virtual ~NaviUnSubscribeWayPointsRequest();
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h
deleted file mode 100644
index 936814f2fe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUnSubscribeWaypoints command class
- **/
-class NaviUnsubscribeWayPointsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviUnSubscribeWaypoints class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUnsubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUnSubscribeWaypoints class destructor
- **/
- virtual ~NaviUnsubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
deleted file mode 100644
index 830e9358ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUpdateTurnListRequest command class
- **/
-class NaviUpdateTurnListRequest : public RequestToHMI {
- public:
- /**
- * @brief NaviUpdateTurnListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUpdateTurnListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUpdateTurnListRequest class destructor
- **/
- virtual ~NaviUpdateTurnListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
deleted file mode 100644
index 93c714b4f4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief NaviUpdateTurnListResponse command class
- **/
-class NaviUpdateTurnListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief NaviUpdateTurnListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- NaviUpdateTurnListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief NaviUpdateTurnListResponse class destructor
- **/
- virtual ~NaviUpdateTurnListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
deleted file mode 100644
index ccf3e6d7f3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class NotificationFromHMI : public CommandImpl {
- public:
- NotificationFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~NotificationFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendNotificationToMobile(const MessageSharedPtr& message);
- void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
deleted file mode 100644
index dd2db8804a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class NotificationToHMI : public CommandImpl {
- public:
- NotificationToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~NotificationToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendNotification();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
deleted file mode 100644
index 8d8d2d8eb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAllowSDLFunctionalityNotification command class
- **/
-class OnAllowSDLFunctionalityNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAllowSDLFunctionalityNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAllowSDLFunctionalityNotification class destructor
- **/
- virtual ~OnAllowSDLFunctionalityNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
deleted file mode 100644
index 6772d49781..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppActivatedNotification command class
- **/
-class OnAppActivatedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppActivatedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppActivatedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppActivatedNotification class destructor
- **/
- virtual ~OnAppActivatedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
deleted file mode 100644
index 687d492a01..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppDeactivatedNotification command class
- **/
-class OnAppDeactivatedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppDeactivatedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppDeactivatedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppDeactivatedNotification class destructor
- **/
- virtual ~OnAppDeactivatedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
deleted file mode 100644
index 236e1b5071..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppPermissionChangedNotification command class
- **/
-class OnAppPermissionChangedNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppPermissionChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppPermissionChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppPermissionChangedNotification class destructor
- **/
- virtual ~OnAppPermissionChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
deleted file mode 100644
index 21f96fc055..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppPermissionConsentNotification command class
- **/
-class OnAppPermissionConsentNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnAppPermissionConsentNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppPermissionConsentNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppPermissionConsentNotification class destructor
- **/
- virtual ~OnAppPermissionConsentNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
deleted file mode 100644
index 58e92a977a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppRegisteredNotification command class
- **/
-class OnAppRegisteredNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppRegisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppRegisteredNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppRegisteredNotification class destructor
- **/
- virtual ~OnAppRegisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
deleted file mode 100644
index 980e558d6f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppUnregisteredNotification command class
- **/
-class OnAppUnregisteredNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAppUnregisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppUnregisteredNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAppUnregisteredNotification class destructor
- **/
- virtual ~OnAppUnregisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h
deleted file mode 100644
index 13fa41ac22..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAudioDataStreamingNotification command class
- **/
-class OnAudioDataStreamingNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnAudioDataStreamingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAudioDataStreamingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAudioDataStreamingNotification class destructor
- **/
- virtual ~OnAudioDataStreamingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
deleted file mode 100644
index f294bce2c8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonEventNotification command class
- **/
-class OnButtonEventNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnButtonEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
deleted file mode 100644
index 8936ed8a0f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonPressNotification command class
- **/
-class OnButtonPressNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnButtonPressNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonPressNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h
deleted file mode 100644
index d98ba3a90b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnButtonSubscriptionNotification command class
- **/
-class OnButtonSubscriptionNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnButtonSubscriptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonSubscriptionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonSubscriptionNotification class destructor
- **/
- virtual ~OnButtonSubscriptionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnButtonSubscriptionNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
deleted file mode 100644
index 5345135583..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnDeviceChosenNotification command class
- **/
-class OnDeviceChosenNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDeviceChosenNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDeviceChosenNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDeviceChosenNotification class destructor
- **/
- virtual ~OnDeviceChosenNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
deleted file mode 100644
index 62a87f4599..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnDeviceStateChangedNotification command class
- **/
-class OnDeviceStateChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDeviceStateChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDeviceStateChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDeviceStateChangedNotification class destructor
- **/
- virtual ~OnDeviceStateChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
deleted file mode 100644
index 69d1707bf7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnDriverDistractionNotification command class
- **/
-class OnDriverDistractionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnDriverDistractionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDriverDistractionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDriverDistractionNotification class destructor
- **/
- virtual ~OnDriverDistractionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
deleted file mode 100644
index cbe301179d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnEventChangedNotification command class
- **/
-class OnEventChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnEventChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnEventChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnEventChangedNotification class destructor
- **/
- virtual ~OnEventChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
deleted file mode 100644
index a752e00801..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnExitAllApplicationsNotification command class
- **/
-class OnExitAllApplicationsNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnExitAllApplicationsNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnExitAllApplicationsNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnExitAllApplicationsNotification class destructor
- **/
- virtual ~OnExitAllApplicationsNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /**
- * @brief Notify's HMI that SDL stored all data required for resumption
- **/
- void SendOnSDLPersistenceComplete();
-
- DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
deleted file mode 100644
index bb96a4f14e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnExitApplicationNotification command class
- **/
-class OnExitApplicationNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnExitApplicationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnExitApplicationNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnExitApplicationNotification class destructor
- **/
- virtual ~OnExitApplicationNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
deleted file mode 100644
index 3f1ac17fc4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnFileRemovedNotification command class
- **/
-class OnFileRemovedNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnFileRemovedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnFileRemovedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnFileRemovedNotification class destructor
- **/
- virtual ~OnFileRemovedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
deleted file mode 100644
index 70347cc44f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnFindApplications command class
- **/
-class OnFindApplications : public NotificationFromHMI {
- public:
- /**
- * @brief OnFindApplications class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnFindApplications(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnFindApplications class destructor
- **/
- virtual ~OnFindApplications();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
deleted file mode 100644
index acb1ff31ac..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnIgnitionCycleOverNotification command class
- **/
-class OnIgnitionCycleOverNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnIgnitionCycleOverNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnIgnitionCycleOverNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnIgnitionCycleOverNotification class destructor
- **/
- virtual ~OnIgnitionCycleOverNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
deleted file mode 100644
index 0150853546..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnNaviTBTClientStateNotification command class
- **/
-class OnNaviTBTClientStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnNaviTBTClientStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnNaviTBTClientStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnNaviTBTClientStateNotification class destructor
- **/
- virtual ~OnNaviTBTClientStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h
deleted file mode 100644
index d304685008..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnNaviWayPointChangeNotification command class
- **/
-class OnNaviWayPointChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnNaviWayPointChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnNaviWayPointChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& app_man);
-
- /**
- * @brief OnNaviWayPointChangeNotification class destructor
- **/
- virtual ~OnNaviWayPointChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnNaviWayPointChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
deleted file mode 100644
index 5569131c2b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-class OnPolicyUpdate : public NotificationFromHMI {
- public:
- /**
- * @brief OnPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPolicyUpdate class destructor
- **/
- virtual ~OnPolicyUpdate();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
-};
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
deleted file mode 100644
index 809623fda0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnPutFileNotification command class
- **/
-class OnPutFileNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnPutFileNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPutFileNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPutFileNotification class destructor
- **/
- virtual ~OnPutFileNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
deleted file mode 100644
index 7df1bf5ac0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnReadyNotification command class
- **/
-class OnReadyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnReadyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnReadyNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnReadyNotification class destructor
- **/
- virtual ~OnReadyNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
deleted file mode 100644
index cec707b44f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class OnReceivedPolicyUpdate : public NotificationFromHMI {
- public:
- /**
- * @brief OnReceivedPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnReceivedPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnReceivedPolicyUpdate class destructor
- **/
- ~OnReceivedPolicyUpdate() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
deleted file mode 100644
index fbb8a0522a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnRecordStartdNotification command class
- **/
-class OnRecordStartdNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnRecordStartdNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnRecordStartdNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnRecordStartdNotification class destructor
- **/
- virtual ~OnRecordStartdNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
deleted file mode 100644
index 764ee6d180..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnResumeAudioSourceNotification command class
- **/
-class OnResumeAudioSourceNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnResumeAudioSourceNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnResumeAudioSourceNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnResumeAudioSourceNotification class destructor
- **/
- virtual ~OnResumeAudioSourceNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
deleted file mode 100644
index ef1d289ca7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLCloseNotification command class
- **/
-class OnSDLCloseNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLCloseNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLCloseNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSdlCloseNotification class destructor
- **/
- virtual ~OnSDLCloseNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
deleted file mode 100644
index 5b0f4a1667..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLConsentNeededNotification command class
- **/
-class OnSDLConsentNeededNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLConsentNeededNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLConsentNeededNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSDLConsentNeededNotification class destructor
- **/
- virtual ~OnSDLConsentNeededNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
deleted file mode 100644
index 1d91faece6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSDLPersistenceCompleteNotification command class
- **/
-class OnSDLPersistenceCompleteNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnSDLPersistenceCompleteNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSDLPersistenceCompleteNotification class destructor
- **/
- virtual ~OnSDLPersistenceCompleteNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
deleted file mode 100644
index 2e523924db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnStartDeviceDiscovery command class
- **/
-class OnStartDeviceDiscovery : public NotificationFromHMI {
- public:
- /**
- * @brief OnStartDeviceDiscovery class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnStartDeviceDiscovery(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnStartDeviceDiscovery class destructor
- **/
- virtual ~OnStartDeviceDiscovery();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
deleted file mode 100644
index 05cb5a4931..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnGetStatusUpdateNotification command class
- **/
-class OnStatusUpdateNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnGetStatusUpdateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnStatusUpdateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnGetStatusUpdateNotification class destructor
- **/
- virtual ~OnStatusUpdateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
deleted file mode 100644
index 9008a20cc9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile_api = mobile_apis;
-/**
- * @brief OnSystemContextNotification command class
- **/
-class OnSystemContextNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemContextNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemContextNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemContextNotification class destructor
- **/
- virtual ~OnSystemContextNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
deleted file mode 100644
index 1e65b15c20..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemErrorNotification command class
- **/
-class OnSystemErrorNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemErrorNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemErrorNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemErrorNotification class destructor
- **/
- virtual ~OnSystemErrorNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
deleted file mode 100644
index 1c2bf0266f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemInfoChangedNotification command class
- **/
-class OnSystemInfoChangedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemInfoChangedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemInfoChangedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemInfoChangedNotification class destructor
- **/
- virtual ~OnSystemInfoChangedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
deleted file mode 100644
index 8e4db24822..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnSystemRequestNotification command class
- **/
-class OnSystemRequestNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnSystemRequestNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemRequestNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemRequestNotification class destructor
- **/
- virtual ~OnSystemRequestNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
deleted file mode 100644
index 245dc32386..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSLanguageChangeNotification command class
- **/
-class OnTTSLanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSLanguageChangeNotification class destructor
- **/
- virtual ~OnTTSLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
deleted file mode 100644
index be84a93215..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnTTSResetTimeoutNotification command class
- **/
-class OnTTSResetTimeoutNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSResetTimeoutNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSResetTimeoutNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSResetTimeoutNotification class destructor
- **/
- virtual ~OnTTSResetTimeoutNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
deleted file mode 100644
index 234d8036eb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSStartedNotification command class
- **/
-class OnTTSStartedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSStartedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTTSStartedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSStartedNotification class destructor
- **/
- virtual ~OnTTSStartedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
deleted file mode 100644
index 4e058fde64..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTTSStoppedNotification command class
- **/
-class OnTTSStoppedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnTTSStoppedNotification class constructor
- *
- * @param message Incoming SmartObject OnTTSStartedNotificationmessage
- **/
- OnTTSStoppedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTTSStoppedNotification class destructor
- **/
- virtual ~OnTTSStoppedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
deleted file mode 100644
index 618bc13017..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUICommandNotification command class
- **/
-class OnUICommandNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUICommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUICommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUICommandNotification class destructor
- **/
- virtual ~OnUICommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
deleted file mode 100644
index 6e881dc94a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUIKeyBoardInputNotification command class
- **/
-class OnUIKeyBoardInputNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUIKeyBoardInputNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUIKeyBoardInputNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUIKeyBoardInputNotification class destructor
- **/
- virtual ~OnUIKeyBoardInputNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
deleted file mode 100644
index cc8cd1eb0e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUILanguageChangeNotification command class
- **/
-class OnUILanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUILanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUILanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUILanguageChangeNotification class destructor
- **/
- virtual ~OnUILanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
deleted file mode 100644
index f5dd173998..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUIResetTimeoutNotification command class
- **/
-class OnUIResetTimeoutNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUIResetTimeoutNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUIResetTimeoutNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUIResetTimeoutNotification class destructor
- **/
- virtual ~OnUIResetTimeoutNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
deleted file mode 100644
index 9e9384fffe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-/**
- * @brief OnUITouchEventNotification command class
- **/
-class OnUITouchEventNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnUITouchEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUITouchEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUITouchEventNotification class destructor
- **/
- virtual ~OnUITouchEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
-};
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
deleted file mode 100644
index ee53445606..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnUpdateDeviceList command class
- **/
-class OnUpdateDeviceList : public NotificationFromHMI {
- public:
- /**
- * @brief OnUpdateDeviceList class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnUpdateDeviceList(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnUpdateDeviceList class destructor
- **/
- virtual ~OnUpdateDeviceList();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
deleted file mode 100644
index 9c5a8cd955..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIAccPedalPositionNotification command class
- **/
-class OnVIAccPedalPositionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIAccPedalPositionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIAccPedalPositionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIAccPedalPositionNotification class destructor
- **/
- virtual ~OnVIAccPedalPositionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
deleted file mode 100644
index c4f92269bb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBeltStatusNotification command class
- **/
-class OnVIBeltStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBeltStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBeltStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIBeltStatusNotification class destructor
- **/
- virtual ~OnVIBeltStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
deleted file mode 100644
index 9d9854c50b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIBodyInformationNotification command class
- **/
-class OnVIBodyInformationNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIBodyInformationNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIBodyInformationNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIBodyInformationNotification class destructor
- **/
- virtual ~OnVIBodyInformationNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
deleted file mode 100644
index c31ee1f209..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDeviceStatusNotification command class
- **/
-class OnVIDeviceStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDeviceStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDeviceStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIDeviceStatusNotification class destructor
- **/
- virtual ~OnVIDeviceStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
deleted file mode 100644
index 108f02b5a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIDriverBrakingNotification command class
- **/
-class OnVIDriverBrakingNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIDriverBrakingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIDriverBrakingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIDriverBrakingNotification class destructor
- **/
- virtual ~OnVIDriverBrakingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
deleted file mode 100644
index bbd13963aa..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIEngineTorqueNotification command class
- **/
-class OnVIEngineTorqueNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIEngineTorqueNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIEngineTorqueNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIEngineTorqueNotification class destructor
- **/
- virtual ~OnVIEngineTorqueNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
deleted file mode 100644
index b996febacf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIExternalTemperatureNotification command class
- **/
-class OnVIExternalTemperatureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIExternalTemperatureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIExternalTemperatureNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIExternalTemperatureNotification class destructor
- **/
- virtual ~OnVIExternalTemperatureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
deleted file mode 100644
index 9c30b6c32c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelNotification command class
- **/
-class OnVIFuelLevelNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIFuelLevelNotification class destructor
- **/
- virtual ~OnVIFuelLevelNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
deleted file mode 100644
index 53b6ea209f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIFuelLevelStateNotification command class
- **/
-class OnVIFuelLevelStateNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIFuelLevelStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIFuelLevelStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIFuelLevelStateNotification class destructor
- **/
- virtual ~OnVIFuelLevelStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
deleted file mode 100644
index 579344b538..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIGpsDataNotification command class
- **/
-class OnVIGpsDataNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIGpsDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIGpsDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIGpsDataNotification class destructor
- **/
- virtual ~OnVIGpsDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
deleted file mode 100644
index 5fd3be85a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIHeadLampStatusNotification command class
- **/
-class OnVIHeadLampStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIHeadLampStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIHeadLampStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIHeadLampStatusNotification class destructor
- **/
- virtual ~OnVIHeadLampStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
deleted file mode 100644
index ee82b1397f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIInstantFuelConsumptionNotification command class
- **/
-class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIInstantFuelConsumptionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIInstantFuelConsumptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager);
-
- /**
- * @brief OnVIInstantFuelConsumptionNotification class destructor
- **/
- virtual ~OnVIInstantFuelConsumptionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
deleted file mode 100644
index 364e42081c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIMyKeyNotification command class
- **/
-class OnVIMyKeyNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIMyKeyNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIMyKeyNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIMyKeyNotification class destructor
- **/
- virtual ~OnVIMyKeyNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
deleted file mode 100644
index 7d93530f04..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIOdometerNotification command class
- **/
-class OnVIOdometerNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIOdometerNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIOdometerNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIOdometerNotification class destructor
- **/
- virtual ~OnVIOdometerNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
deleted file mode 100644
index c09220d2a6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIPrndlNotification command class
- **/
-class OnVIPrndlNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIPrndlNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIPrndlNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIPrndlNotification class destructor
- **/
- virtual ~OnVIPrndlNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
deleted file mode 100644
index d05e1221df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIRpmNotification command class
- **/
-class OnVIRpmNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIRpmNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIRpmNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIRpmNotification class destructor
- **/
- virtual ~OnVIRpmNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
deleted file mode 100644
index b1908cde28..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISpeedNotification command class
- **/
-class OnVISpeedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISpeedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISpeedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVISpeedNotification class destructor
- **/
- virtual ~OnVISpeedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
deleted file mode 100644
index 28f78ac4d5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVISteeringWheelAngleNotification command class
- **/
-class OnVISteeringWheelAngleNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVISteeringWheelAngleNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVISteeringWheelAngleNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVISteeringWheelAngleNotification class destructor
- **/
- virtual ~OnVISteeringWheelAngleNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
deleted file mode 100644
index eef4f0e4a4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVITirePressureNotification command class
- **/
-class OnVITirePressureNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVITirePressureNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVITirePressureNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVITirePressureNotification class destructor
- **/
- virtual ~OnVITirePressureNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
deleted file mode 100644
index 2422c47813..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIVehicleDataNotification command class
- * Sent by HMI for the periodic and non periodic vehicle data
- **/
-class OnVIVehicleDataNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIVehicleDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIVehicleDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIVehicleDataNotification class destructor
- **/
- virtual ~OnVIVehicleDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
deleted file mode 100644
index 4ea04fbb0d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIVinNotification command class
- **/
-class OnVIVinNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIVinNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIVinNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIVinNotification class destructor
- **/
- virtual ~OnVIVinNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
deleted file mode 100644
index 2b57ef1dd3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVIWiperStatusNotification command class
- **/
-class OnVIWiperStatusNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVIWiperStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVIWiperStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVIWiperStatusNotification class destructor
- **/
- virtual ~OnVIWiperStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
deleted file mode 100644
index 81493a0a33..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVideoDataStreamingNotification command class
- **/
-class OnVideoDataStreamingNotification : public NotificationToHMI {
- public:
- /**
- * @brief OnVideoDataStreamingNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVideoDataStreamingNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVideoDataStreamingNotification class destructor
- **/
- virtual ~OnVideoDataStreamingNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
deleted file mode 100644
index fa85ba8468..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRCommandNotification command class
- **/
-class OnVRCommandNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRCommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRCommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRCommandNotification class destructor
- **/
- virtual ~OnVRCommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
deleted file mode 100644
index d0f86e5f83..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRLanguageChangeNotification command class
- **/
-class OnVRLanguageChangeNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRLanguageChangeNotification class destructor
- **/
- virtual ~OnVRLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
deleted file mode 100644
index f142fcc25c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRStartedNotification command class
- **/
-class OnVRStartedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRStartedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRStartedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRStartedNotification class destructor
- **/
- virtual ~OnVRStartedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
deleted file mode 100644
index d1dbcc91cd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVRStoppedNotification command class
- **/
-class OnVRStoppedNotification : public NotificationFromHMI {
- public:
- /**
- * @brief OnVRStoppedNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVRStoppedNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVRStoppedNotification class destructor
- **/
- virtual ~OnVRStoppedNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
deleted file mode 100644
index 628d3257d9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
- public:
- RequestFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~RequestFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- virtual void on_event(const event_engine::Event& event);
- /**
- * @brief SendResponse allows to send response to hmi
- * @param correlation_id the correlation id for the rfesponse.
- * @param function_id the function id for which response will be sent
- * @param result_code the result code.
- */
- void SendResponse(const bool success,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code);
-
- /**
- * @brief SendResponse allows to send error response to hmi
- * @param correlation_id the correlation id for the response.
- * @param function_id the function id for which response will be sent
- * @param result_code the result code.
- * @param error_message info message for error.
- */
- void SendErrorResponse(const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code,
- const std::string error_message);
-
- private:
- /**
- * @brief Fills common parameters for SO
- * @param message Contains SO for filling
- * @param correlation_id the correlation id for the response.
- * @param function_id the function id for which response will be sent
- */
- void FillCommonParametersOfSO(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
deleted file mode 100644
index b30044fd26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Check if HMI's interface is available.
- * @param application_manager contains application manager component
- * @param interface contains name of HMI's interface
- * @return true if interface is available otherwise return fasle.
- */
-bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
- HmiInterfaces::InterfaceID interface);
-
-/**
- * @brief Change interface state
- * @param application_manager contains ApplicationManager instance
- * @param response_from_hmi contains response from HMI
- * @param interface contanins InterfaceID whose state is changed.
- * @return true if field available exist and contains true in response params
- * otherwise return false.
- */
-bool ChangeInterfaceState(ApplicationManager& application_manager,
- const smart_objects::SmartObject& response_from_hmi,
- HmiInterfaces::InterfaceID interface);
-
-class RequestToHMI : public CommandImpl {
- public:
- RequestToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~RequestToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendRequest();
-
- /*
- * @brief Retrieves application ID
- */
- inline uint32_t application_id() const {
- return (*message_)[strings::msg_params][strings::app_id].asUInt();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RequestToHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
deleted file mode 100644
index 05fd23adf0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class ResponseFromHMI : public CommandImpl {
- public:
- ResponseFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~ResponseFromHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
- void SendResponseToMobile(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /*
- * @brief Creates HMI request
- *
- * @param function_id HMI request ID
- * @param msg_params HMI request msg params
- */
- void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
deleted file mode 100644
index 1dd0657815..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
+++ /dev/null
@@ -1,63 +0,0 @@
-
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
-
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/HMI_API.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
-
-class ResponseToHMI : public CommandImpl {
- public:
- ResponseToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
- virtual ~ResponseToHMI();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
deleted file mode 100644
index 9ce15a0970..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLActivateAppRequest command class
- **/
-class SDLActivateAppRequest : public RequestFromHMI {
- public:
- /**
- * @brief Applications registered over protocol v4
- */
- typedef std::vector<application_manager::ApplicationSharedPtr> V4ProtoApps;
-
- /**
- * @brief SDLActivateAppRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLActivateAppRequest class destructor
- **/
- ~SDLActivateAppRequest() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief onTimeOut allows to process case when timeout has appeared
- * during request execution.
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief on_event allows to handle events
- *
- * @param event event type that current request subscribed on.
- */
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- private:
- uint32_t app_id() const;
- uint32_t hmi_app_id(const smart_objects::SmartObject& so) const;
-
- /**
- * @brief Retrieves all v4 protocol applications for particular device
- * @param handle Device handle
- * @return List of applications registered over v4 protocol
- */
- V4ProtoApps get_v4_proto_apps(
- const connection_handler::DeviceHandle handle) const;
-
- /**
- * @brief Get v4 protocol application reported as forgrounded on device
- * @param handle Device
- * @return Pointer to application or empty pointer
- */
- ApplicationSharedPtr get_foreground_app(
- const connection_handler::DeviceHandle handle) const;
-
- DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
deleted file mode 100644
index 50bc319569..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLActivateAppResponse command class
- **/
-class SDLActivateAppResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLActivateAppResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLActivateAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLActivateAppResponse class destructor
- **/
- virtual ~SDLActivateAppResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
deleted file mode 100644
index 69e4ec227c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetListOfPermissionsRequest command class
- **/
-class SDLGetListOfPermissionsRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetListOfPermissionsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetListOfPermissionsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetListOfPermissionsRequest class destructor
- **/
- virtual ~SDLGetListOfPermissionsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
deleted file mode 100644
index b82f16e113..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetListOfPermissionsResponse command class
- **/
-class SDLGetListOfPermissionsResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetListOfPermissionsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetListOfPermissionsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetListOfPermissionsResponse class destructor
- **/
- virtual ~SDLGetListOfPermissionsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
deleted file mode 100644
index 4f5ce887bd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetStatusUpdateRequest command class
- **/
-class SDLGetStatusUpdateRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetStatusUpdateRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetStatusUpdateRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetStatusUpdateRequest class destructor
- **/
- virtual ~SDLGetStatusUpdateRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
deleted file mode 100644
index f8aeb6135f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetStatusUpdateResponse command class
- **/
-class SDLGetStatusUpdateResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetStatusUpdateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetStatusUpdateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetStatusUpdateResponse class destructor
- **/
- virtual ~SDLGetStatusUpdateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
deleted file mode 100644
index 9837e6af09..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetUserFriendlyMessageRequest command class
- **/
-class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
- public:
- /**
- * @brief SDLGetUserFriendlyMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetUserFriendlyMessageRequest class destructor
- **/
- virtual ~SDLGetUserFriendlyMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
deleted file mode 100644
index bb2fba8433..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SDLGetUserFriendlyMessageResponse command class
- **/
-class SDLGetUserFriendlyMessageResponse : public ResponseToHMI {
- public:
- /**
- * @brief SDLGetUserFriendlyMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLGetUserFriendlyMessageResponse class destructor
- **/
- virtual ~SDLGetUserFriendlyMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
deleted file mode 100644
index 99b627431c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class SDLPolicyUpdate : public RequestToHMI {
- public:
- /**
- * @brief SDLPolicyUpdate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- ~SDLPolicyUpdate() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
deleted file mode 100644
index 12850f4b8a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class SDLPolicyUpdateResponse : public ResponseFromHMI {
- public:
- /**
- * @brief SDLPolicyUpdateResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SDLPolicyUpdateResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SDLPolicyUpdateResponse class destructor
- **/
- virtual ~SDLPolicyUpdateResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
deleted file mode 100644
index 0f36e82b44..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSChangeRegistrationRequest command class
- **/
-class TTSChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSChangeRegistrationRequest class destructor
- **/
- virtual ~TTSChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
deleted file mode 100644
index ca9c114156..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSChangeRegistratioResponse command class
- **/
-class TTSChangeRegistratioResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSChangeRegistratioResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSChangeRegistratioResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSChangeRegistratioResponse class destructor
- **/
- virtual ~TTSChangeRegistratioResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
deleted file mode 100644
index bea41b7371..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetCapabilitiesRequest command class
- **/
-class TTSGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetCapabilitiesRequest class destructor
- **/
- virtual ~TTSGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
deleted file mode 100644
index a70ee2b33b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetCapabilitiesResponse command class
- **/
-class TTSGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetCapabilitiesResponse class destructor
- **/
- virtual ~TTSGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
deleted file mode 100644
index 627cf3da06..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetLanguageRequest command class
- **/
-class TTSGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetLanguageRequest class destructor
- **/
- virtual ~TTSGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
deleted file mode 100644
index f44492a6ed..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetLanguageResponse command class
- **/
-class TTSGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetLanguageResponse class destructor
- **/
- virtual ~TTSGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
deleted file mode 100644
index 9500d54eea..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetSupportedLanguagesRequest command class
- **/
-class TTSGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetSupportedLanguagesRequest class destructor
- **/
- virtual ~TTSGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
deleted file mode 100644
index 1bc569ebb8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSGetSupportedLanguagesResponse command class
- **/
-class TTSGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSGetSupportedLanguagesResponse class destructor
- **/
- virtual ~TTSGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
deleted file mode 100644
index 340a00d294..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSIsReadyRequest command class
- **/
-class TTSIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief TTSIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSIsReadyRequest class destructor
- **/
- virtual ~TTSIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
deleted file mode 100644
index 833d3d0a82..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSIsReadyResponse command class
- **/
-class TTSIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSIsReadyResponse class destructor
- **/
- virtual ~TTSIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
deleted file mode 100644
index b18e372b3e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSetGlobalPropertiesRequest command class
- **/
-class TTSSetGlobalPropertiesRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSSetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSetGlobalPropertiesRequest class destructor
- **/
- virtual ~TTSSetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
deleted file mode 100644
index aa7c85eece..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSetGlobalPropertiesResponse command class
- **/
-class TTSSetGlobalPropertiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSSetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSetGlobalPropertiesResponse class destructor
- **/
- virtual ~TTSSetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
deleted file mode 100644
index 87384beedf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSpeakRequest command class
- **/
-class TTSSpeakRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSSpeakRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSpeakRequest class destructor
- **/
- virtual ~TTSSpeakRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
deleted file mode 100644
index 9f15afb33b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSSpeakResponse command class
- **/
-class TTSSpeakResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSSpeakResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSSpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSSpeakResponse class destructor
- **/
- virtual ~TTSSpeakResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
deleted file mode 100644
index c51daee84d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSStopSpeakingRequest command class
- **/
-class TTSStopSpeakingRequest : public RequestToHMI {
- public:
- /**
- * @brief TTSStopSpeakingRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSStopSpeakingRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSStopSpeakingRequest class destructor
- **/
- virtual ~TTSStopSpeakingRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
deleted file mode 100644
index a23889a733..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSStopSpeakingResponse command class
- **/
-class TTSStopSpeakingResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSStopSpeakingResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- TTSStopSpeakingResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSStopSpeakingResponse class destructor
- **/
- virtual ~TTSStopSpeakingResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
deleted file mode 100644
index 294fd11912..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddCommandRequest command class
- **/
-class UIAddCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddCommandRequest class destructor
- **/
- virtual ~UIAddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
deleted file mode 100644
index ed48e13322..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddCommandResponse command class
- **/
-class UIAddCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddCommandResponse class destructor
- **/
- virtual ~UIAddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
deleted file mode 100644
index 96fa0557ae..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuRequest command class
- **/
-class UIAddSubmenuRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAddSubmenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddSubmenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddSubmenuRequest class destructor
- **/
- virtual ~UIAddSubmenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
deleted file mode 100644
index 62abf10b60..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuResponse command class
- **/
-class UIAddSubmenuResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAddSubmenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAddSubmenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAddSubmenuResponse class destructor
- **/
- virtual ~UIAddSubmenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
deleted file mode 100644
index 123246e596..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAlertRequest command class
- **/
-class UIAlertRequest : public RequestToHMI {
- public:
- /**
- * @brief UIAlertRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAlertRequest class destructor
- **/
- virtual ~UIAlertRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
deleted file mode 100644
index db48699a23..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAlertResponse command class
- **/
-class UIAlertResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIAlertResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIAlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIAlertResponse class destructor
- **/
- virtual ~UIAlertResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
deleted file mode 100644
index 744ed82cad..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIChangeRegistrationRequest command class
- **/
-class UIChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief UIChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIChangeRegistrationRequest class destructor
- **/
- virtual ~UIChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
deleted file mode 100644
index 57814b9acf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIChangeRegistratioResponse command class
- **/
-class UIChangeRegistratioResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIChangeRegistratioResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIChangeRegistratioResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIChangeRegistratioResponse class destructor
- **/
- virtual ~UIChangeRegistratioResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
deleted file mode 100644
index 21a4c6dd42..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteCommandRequest command class
- **/
-class UIDeleteCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief UIDeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteCommandRequest class destructor
- **/
- virtual ~UIDeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
deleted file mode 100644
index c9baba728f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteCommandResponse command class
- **/
-class UIDeleteCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIDeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteCommandResponse class destructor
- **/
- virtual ~UIDeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
deleted file mode 100644
index d238e39a10..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIAddSubmenuRequest command class
- **/
-class UIDeleteSubmenuRequest : public RequestToHMI {
- public:
- /**
- * @brief UIDeleteSubmenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteSubmenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteSubmenuRequest class destructor
- **/
- virtual ~UIDeleteSubmenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
deleted file mode 100644
index 36d7bee528..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIDeleteSubmenuResponse command class
- **/
-class UIDeleteSubmenuResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIDeleteSubmenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIDeleteSubmenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIDeleteSubmenuResponse class destructor
- **/
- virtual ~UIDeleteSubmenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
deleted file mode 100644
index d8bd10a9ca..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIEndAudioPassThruRequest command class
- * When this request is invoked, the audio capture stops
- **/
-class UIEndAudioPassThruRequest : public RequestToHMI {
- public:
- /**
- * @brief UIEndAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIEndAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIEndAudioPassThruRequest class destructor
- **/
- virtual ~UIEndAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
deleted file mode 100644
index c2a373d8c0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIEndAudioPassThruResponse command class
- **/
-class UIEndAudioPassThruResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIEndAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIEndAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIEndAudioPassThruResponse class destructor
- **/
- virtual ~UIEndAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
deleted file mode 100644
index cffba5ca42..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetCapabilitiesRequest command class
- **/
-class UIGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetCapabilitiesRequest class destructor
- **/
- virtual ~UIGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
deleted file mode 100644
index 525dd7ad9d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetCapabilitiesResponse command class
- **/
-class UIGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetCapabilitiesResponse class destructor
- **/
- virtual ~UIGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
deleted file mode 100644
index 4bf8e11d7e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetLanguageRequest command class
- **/
-class UIGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetLanguageRequest class destructor
- **/
- virtual ~UIGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
deleted file mode 100644
index 29bbba85ff..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetLanguageResponse command class
- **/
-class UIGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetLanguageResponse class destructor
- **/
- virtual ~UIGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
deleted file mode 100644
index 94c197b7bc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetSupportedLanguagesRequest command class
- **/
-class UIGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief UIGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetSupportedLanguagesRequest class destructor
- **/
- virtual ~UIGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
deleted file mode 100644
index 8962b77833..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIGetSupportedLanguagesResponse command class
- **/
-class UIGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIGetSupportedLanguagesResponse class destructor
- **/
- virtual ~UIGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
deleted file mode 100644
index 49942d81a7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIIsReadyRequest command class
- **/
-class UIIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief UIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIIsReadyRequest class destructor
- **/
- virtual ~UIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- virtual void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
deleted file mode 100644
index 93b2d9a569..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIIsReadyResponse command class
- **/
-class UIIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIIsReadyResponse class destructor
- **/
- virtual ~UIIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
deleted file mode 100644
index 4cec5a5600..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformAudioPassThruRequest command class
- **/
-class UIPerformAudioPassThruRequest : public RequestToHMI {
- public:
- /**
- * @brief UIPerformAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformAudioPassThruRequest class destructor
- **/
- virtual ~UIPerformAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
deleted file mode 100644
index 9fb502233f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformAudioPassThruResponse command class
- **/
-class UIPerformAudioPassThruResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIPerformAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformAudioPassThruResponse class destructor
- **/
- virtual ~UIPerformAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
deleted file mode 100644
index 8232043395..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformInteractionRequest command class
- **/
-class UIPerformInteractionRequest : public RequestToHMI {
- public:
- /**
- * @brief UIPerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformInteractionRequest class destructor
- **/
- virtual ~UIPerformInteractionRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
deleted file mode 100644
index 4db471bbae..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIPerformInteractionResponse command class
- **/
-class UIPerformInteractionResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIPerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIPerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIPerformInteractionResponse class destructor
- **/
- virtual ~UIPerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
deleted file mode 100644
index 8ba828a25e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIScrollableMessageRequest command class
- **/
-class UIScrollableMessageRequest : public RequestToHMI {
- public:
- /**
- * @brief UIScrollableMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIScrollableMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIScrollableMessageRequest class destructor
- **/
- virtual ~UIScrollableMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
deleted file mode 100644
index 4ae432d658..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIScrollableMessageResponse command class
- **/
-class UIScrollableMessageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIScrollableMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIScrollableMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIScrollableMessageResponse class destructor
- **/
- virtual ~UIScrollableMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
deleted file mode 100644
index b1025035d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconRequest command class
- **/
-class UISetAppIconRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconRequest class destructor
- **/
- virtual ~UISetAppIconRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetAppIconRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
deleted file mode 100644
index 6ad80bc9fe..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconResponse command class
- **/
-class UISetAppIconResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconResponse class destructor
- **/
- virtual ~UISetAppIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetAppIconResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
deleted file mode 100644
index 573e9351b1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UiSetDisplayLayoutRequest command class
- **/
-class UiSetDisplayLayoutRequest : public RequestToHMI {
- public:
- /**
- * @brief UiSetDisplayLayoutRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UiSetDisplayLayoutRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UiSetDisplayLayoutRequest class destructor
- **/
- virtual ~UiSetDisplayLayoutRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
deleted file mode 100644
index 595ee93c30..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UiSetDisplayLayoutResponse command class
- **/
-class UiSetDisplayLayoutResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UiSetDisplayLayoutResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UiSetDisplayLayoutResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UiSetDisplayLayoutResponse class destructor
- **/
- virtual ~UiSetDisplayLayoutResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
deleted file mode 100644
index 83bf11e2e1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetGlobalPropertiesRequest command class
- **/
-class UISetGlobalPropertiesRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowRequest class destructor
- **/
- virtual ~UISetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
deleted file mode 100644
index 91de5e6df7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetGlobalPropertiesResponse command class
- **/
-class UISetGlobalPropertiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetGlobalPropertiesResponse class destructor
- **/
- virtual ~UISetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
deleted file mode 100644
index b7d759916e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconRequest command class
- **/
-class UISetIconRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetIconRequest class destructor
- **/
- virtual ~UISetIconRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
deleted file mode 100644
index a9739bc802..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetIconResponse command class
- **/
-class UISetIconResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconResponse(const MessageSharedPtr& message);
-
- /**
- * @brief UISetIconResponse class destructor
- **/
- virtual ~UISetIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
deleted file mode 100644
index 92565e6f02..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetMediaClockTimerRequest command class
- **/
-class UISetMediaClockTimerRequest : public RequestToHMI {
- public:
- /**
- * @brief UISetMediaClockTimerRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetMediaClockTimerRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetMediaClockTimerRequest class destructor
- **/
- virtual ~UISetMediaClockTimerRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
deleted file mode 100644
index 0d71ff00f0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISetMediaClockTimerResponse command class
- **/
-class UISetMediaClockTimerResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISetMediaClockTimerResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetMediaClockTimerResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISetMediaClockTimerResponse class destructor
- **/
- virtual ~UISetMediaClockTimerResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
deleted file mode 100644
index 80348de63b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIShowRequest command class
- **/
-class UIShowRequest : public RequestToHMI {
- public:
- /**
- * @brief UIShowRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowRequest class destructor
- **/
- virtual ~UIShowRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
deleted file mode 100644
index d696d2b9f8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UIShowResponse command class
- **/
-class UIShowResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UIShowResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UIShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UIShowResponse class destructor
- **/
- virtual ~UIShowResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
deleted file mode 100644
index 583f52084d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ButtonGetCapabilitiesRequest command class
- **/
-class UISliderRequest : public RequestToHMI {
- public:
- /**
- * @brief UISliderRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISliderRequest class destructor
- **/
- virtual ~UISliderRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
deleted file mode 100644
index cabb54f6cb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UISliderResponse command class
- **/
-class UISliderResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UISliderResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UISliderResponse class destructor
- **/
- virtual ~UISliderResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
deleted file mode 100644
index 61be04d04f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateAppListRequest command class
- **/
-class UpdateAppListRequest : public RequestToHMI {
- public:
- /**
- * @brief UpdateAppListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateAppListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateAppListRequest class destructor
- **/
- virtual ~UpdateAppListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
deleted file mode 100644
index 5ff8948393..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateAppListResponse command class
- **/
-class UpdateAppListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateAppListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateAppListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateAppListResponse class destructor
- **/
- virtual ~UpdateAppListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
deleted file mode 100644
index f304f404a1..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "utils/lock.h"
-#include "utils/conditional_variable.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateDeviceListRequest command class
- **/
-class UpdateDeviceListRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief UpdateDeviceListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateDeviceListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateDeviceListRequest class destructor
- **/
- ~UpdateDeviceListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
- * when HMI will be ready
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Need to stop execution StopMethod if HMI did not started
- */
- virtual bool CleanUp();
-
- private:
- sync_primitives::Lock wait_hmi_lock;
- sync_primitives::ConditionalVariable termination_condition_;
-
- DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
deleted file mode 100644
index 9320de1387..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateDeviceListResponse command class
- **/
-class UpdateDeviceListResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateDeviceListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateDeviceListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateDeviceListResponse class destructor
- **/
- virtual ~UpdateDeviceListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
deleted file mode 100644
index d8be10da2e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateSDLRequest command class
- **/
-class UpdateSDLRequest : public RequestToHMI {
- public:
- /**
- * @brief UpdateSDLRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateSDLRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateSDLRequest class destructor
- **/
- virtual ~UpdateSDLRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
deleted file mode 100644
index bc0375d5fa..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateSDLResponse command class
- **/
-class UpdateSDLResponse : public ResponseFromHMI {
- public:
- /**
- * @brief UpdateSDLResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateSDLResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateSDLResponse class destructor
- **/
- virtual ~UpdateSDLResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
deleted file mode 100644
index 099f27b734..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIDiagnosticMessageRequest command class
- **/
-class VIDiagnosticMessageRequest : public RequestToHMI {
- public:
- /**
- * @brief VIDiagnosticMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIDiagnosticMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIDiagnosticMessageRequest class destructor
- **/
- virtual ~VIDiagnosticMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
deleted file mode 100644
index f0ae76ccb7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIDiagnosticMessageResponse command class
- **/
-class VIDiagnosticMessageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIDiagnosticMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIDiagnosticMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIDiagnosticMessageResponse class destructor
- **/
- virtual ~VIDiagnosticMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
deleted file mode 100644
index 3b7e502a57..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetDTCsRequest command class
- **/
-class VIGetDTCsRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetDTCsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetDTCsRequest class destructor
- **/
- virtual ~VIGetDTCsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
deleted file mode 100644
index 7b7dab567b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetDTCsResponse command class
- **/
-class VIGetDTCsResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetDTCsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetDTCsResponse class destructor
- **/
- virtual ~VIGetDTCsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
deleted file mode 100644
index 006f18e864..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataRequest command class
- **/
-class VIGetVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleDataRequest class destructor
- **/
- virtual ~VIGetVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
deleted file mode 100644
index 6e90656600..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
deleted file mode 100644
index ef19072bb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponse command class
- **/
-class VIGetVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleDataResponse class destructor
- **/
- virtual ~VIGetVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
deleted file mode 100644
index 557c33df13..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
deleted file mode 100644
index cd70c3349b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleTypeRequest command class
- **/
-class VIGetVehicleTypeRequest : public RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleTypeRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleTypeRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleTypeRequest class destructor
- **/
- virtual ~VIGetVehicleTypeRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
deleted file mode 100644
index 0ef35dd7fc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIGetVehicleTypeResponse command class
- **/
-class VIGetVehicleTypeResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleTypeResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleTypeResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIGetVehicleTypeResponse class destructor
- **/
- virtual ~VIGetVehicleTypeResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
deleted file mode 100644
index 07ab9df605..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIIsReadyRequest command class
- **/
-class VIIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief VIIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIIsReadyRequest class destructor
- **/
- virtual ~VIIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
deleted file mode 100644
index a7866a1e73..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIIsReadyResponse command class
- **/
-class VIIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIIsReadyResponse class destructor
- **/
- virtual ~VIIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
deleted file mode 100644
index cdbdb45a8b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIReadDIDRequest command class
- **/
-class VIReadDIDRequest : public RequestToHMI {
- public:
- /**
- * @brief VIReadDIDRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIReadDIDRequest class destructor
- **/
- virtual ~VIReadDIDRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
deleted file mode 100644
index acb8760c5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIReadDIDResponse command class
- **/
-class VIReadDIDResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIReadDIDResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIReadDIDResponse class destructor
- **/
- virtual ~VIReadDIDResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
deleted file mode 100644
index 58d4984f8d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VISubscribeVehicleDataRequest command class
- **/
-class VISubscribeVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VISubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VISubscribeVehicleDataRequest class destructor
- **/
- virtual ~VISubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
deleted file mode 100644
index 76245af0f9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VISubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataRequestTemplate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
deleted file mode 100644
index 8f038bf941..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VISubscribeVehicleDataResponse command class
- **/
-class VISubscribeVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VISubscribeVehicleDataResponse class destructor
- **/
- virtual ~VISubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
deleted file mode 100644
index e8272971e2..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief VISubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
deleted file mode 100644
index b99eee47e7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIUnsubscribeVehicleDataRequest command class
- **/
-class VIUnsubscribeVehicleDataRequest : public RequestToHMI {
- public:
- /**
- * @brief VIUnsubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIUnsubscribeVehicleDataRequest class destructor
- **/
- virtual ~VIUnsubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
deleted file mode 100644
index 2014896f11..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 unsubscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI {
- public:
- /**
- * @brief VIUnsubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataRequestTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
deleted file mode 100644
index 3f930b5a5b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VIUnsubscribeVehicleDataResponse command class
- **/
-class VIUnsubscribeVehicleDataResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VIUnsubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VIUnsubscribeVehicleDataResponse class destructor
- **/
- virtual ~VIUnsubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
deleted file mode 100644
index 0817ca90af..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataResponseTemplate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
deleted file mode 100644
index 1ef4125c89..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRAddCommandRequest command class
- **/
-class VRAddCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief VRAddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRAddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRAddCommandRequest class destructor
- **/
- virtual ~VRAddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
deleted file mode 100644
index 1b419ed6ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRAddCommandResponse command class
- **/
-class VRAddCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRAddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRAddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRAddCommandResponse class destructor
- **/
- virtual ~VRAddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
deleted file mode 100644
index 642319e8d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRChangeRegistrationRequest command class
- **/
-class VRChangeRegistrationRequest : public RequestToHMI {
- public:
- /**
- * @brief VRChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRChangeRegistrationRequest class destructor
- **/
- virtual ~VRChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
deleted file mode 100644
index 8dc5e96729..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRChangeRegistrationResponse command class
- **/
-class VRChangeRegistrationResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRChangeRegistrationResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRChangeRegistrationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRChangeRegistrationResponse class destructor
- **/
- virtual ~VRChangeRegistrationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
deleted file mode 100644
index bc5c24a350..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRDeleteCommandRequest command class
- **/
-class VRDeleteCommandRequest : public RequestToHMI {
- public:
- /**
- * @brief VRDeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRDeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRDeleteCommandRequest class destructor
- **/
- virtual ~VRDeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
deleted file mode 100644
index 526c296321..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRDeleteCommandResponse command class
- **/
-class VRDeleteCommandResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRDeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRDeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRDeleteCommandResponse class destructor
- **/
- virtual ~VRDeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
deleted file mode 100644
index 8dcc240e9b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetCapabilitiesRequest command class
- **/
-class VRGetCapabilitiesRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetCapabilitiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetCapabilitiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetCapabilitiesRequest class destructor
- **/
- virtual ~VRGetCapabilitiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
deleted file mode 100644
index b6c8e081f5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetCapabilitiesResponse command class
- **/
-class VRGetCapabilitiesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetCapabilitiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetCapabilitiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetCapabilitiesResponse class destructor
- **/
- virtual ~VRGetCapabilitiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
deleted file mode 100644
index 05373784f3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetLanguageRequest command class
- **/
-class VRGetLanguageRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetLanguageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetLanguageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetLanguageRequest class destructor
- **/
- virtual ~VRGetLanguageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
deleted file mode 100644
index fad2f219df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetLanguageResponse command class
- **/
-class VRGetLanguageResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetLanguageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetLanguageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetLanguageResponse class destructor
- **/
- virtual ~VRGetLanguageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
deleted file mode 100644
index 6ed56ebd32..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetSupportedLanguagesRequest command class
- **/
-class VRGetSupportedLanguagesRequest : public RequestToHMI {
- public:
- /**
- * @brief VRGetSupportedLanguagesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetSupportedLanguagesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetSupportedLanguagesRequest class destructor
- **/
- virtual ~VRGetSupportedLanguagesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
deleted file mode 100644
index c4e742ecd0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRGetSupportedLanguagesResponse command class
- **/
-class VRGetSupportedLanguagesResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRGetSupportedLanguagesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRGetSupportedLanguagesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRGetSupportedLanguagesResponse class destructor
- **/
- virtual ~VRGetSupportedLanguagesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
deleted file mode 100644
index 55a2101e1a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRIsReadyRequest command class
- **/
-class VRIsReadyRequest : public RequestToHMI,
- public event_engine::EventObserver {
- public:
- /**
- * @brief VRIsReadyRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRIsReadyRequest class destructor
- **/
- virtual ~VRIsReadyRequest();
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief On event callback
- **/
- void on_event(const event_engine::Event& event) OVERRIDE;
-
- /**
- * @brief onTimeOut from requrst Controller
- */
- void onTimeOut() OVERRIDE;
-
- /**
- * @brief Send request to HMI for fetching of cappabilities
- */
- void SendMessageToHMI();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
deleted file mode 100644
index 474b3373a3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRIsReadyResponse command class
- **/
-class VRIsReadyResponse : public ResponseFromHMI {
- public:
- /**
- * @brief VRIsReadyResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRIsReadyResponse class destructor
- **/
- virtual ~VRIsReadyResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
deleted file mode 100644
index 1f54d29beb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief VRPerformInteractionRequest command class
- **/
-class VRPerformInteractionRequest : public RequestToHMI {
- public:
- /**
- * @brief VRPerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRPerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief VRPerformInteractionRequest class destructor
- **/
- virtual ~VRPerformInteractionRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
deleted file mode 100644
index 7c445416ce..0000000000
--- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief TTSPerformInteractionResponse command class
- **/
-class VRPerformInteractionResponse : public ResponseFromHMI {
- public:
- /**
- * @brief TTSPerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VRPerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief TTSPerformInteractionResponse class destructor
- **/
- virtual ~VRPerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
deleted file mode 100644
index 854ea7f21f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddCommandRequest command class
- **/
-class AddCommandRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AddCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddCommandRequest class destructor
- **/
- virtual ~AddCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @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
- * Please see SDLAQ-CRS-407 for more information
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandName(ApplicationConstSharedPtr app);
-
- /*
- * @brief Check if command VR synonyms doesn't exist in application commands
- * Please see SDLAQ-CRS-407 for more information
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandVRSynonym(ApplicationConstSharedPtr app);
-
- /*
- * @brief Check if command parent ID exists in submenu map
- *
- * @param app Mobile application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckCommandParentId(ApplicationConstSharedPtr app);
-
- /**
- * @brief Removes command from list when HMI sends negative response or
- * HMI does not answer on addCommand request.
- */
- void RemoveCommand();
-
- DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks add command param
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if add command contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- inline bool BothSend() const;
-
- /**
- * @brief GenerateMobileResponseInfo generated info for mobile response
- * depends from UI and VR responses
- * @return info for mobile response
- */
- const std::string GenerateMobileResponseInfo();
- bool send_ui_;
- bool send_vr_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
- std::string ui_info_;
- std::string vr_info_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
deleted file mode 100644
index b385b3bc5c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddCommandResponse command class
- **/
-class AddCommandResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AddCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddCommandResponse class destructor
- **/
- virtual ~AddCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
deleted file mode 100644
index 10e2628035..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddSubMenuRequest command class
- **/
-class AddSubMenuRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AddSubMenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddSubMenuRequest class destructor
- **/
- virtual ~AddSubMenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Check if submenu name is valid
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckSubMenuName();
-
- DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
deleted file mode 100644
index b09254369f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AddSubMenuResponse command class
- **/
-class AddSubMenuResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AddSubMenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AddSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AddSubMenuResponse class destructor
- **/
- virtual ~AddSubMenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
deleted file mode 100644
index 17ad75b7a6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/pending.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertManeuverRequest command class
- **/
-class AlertManeuverRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AlertManeuverRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertManeuverRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertManeuverRequest class destructor
- **/
- virtual ~AlertManeuverRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Prepare parameters for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param return_info contains resulting info for sending to mobile
- * application
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& return_info);
- /**
- * @brief Checks alert maneuver params(ttsChunks, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if alert maneuver contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- hmi_apis::Common_Result::eType tts_speak_result_code_;
- hmi_apis::Common_Result::eType navi_alert_maneuver_result_code_;
- std::string info_navi_;
- std::string info_tts_;
- Pending pending_requests_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
deleted file mode 100644
index 2d45435a8b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertManeuverResponse command class
- **/
-class AlertManeuverResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AlertManeuverResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertManeuverResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertManeuverResponse class destructor
- **/
- virtual ~AlertManeuverResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
deleted file mode 100644
index 77f1813e46..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertRequest command class
- **/
-class AlertRequest : public CommandRequestImpl {
- public:
- /**
- * @brief AlertRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertRequest class destructor
- **/
- virtual ~AlertRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /*
- * @brief Will caled by request controller, when default will be expired.
- * If Alert request has soft buttons, timeout response should not be sent to
- * mobile
- */
- virtual void onTimeOut();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- protected:
- private:
- /*
- * @brief Checks if request parameters are valid
- * @param app_id Id of application requested this RPC
- * @returns true if request is valid and should be processed
- */
- bool Validate(uint32_t app_id);
- /*
- * @brief Sends UI Alert request
- *
- * @param app_id Id of application requested this RPC
- */
- void SendAlertRequest(int32_t app_id);
-
- /*
- * @brief Sends TTS Speak request
- *
- * @param app_id Id of application requested this RPC
- *
- * @param tts_chunks_exists if tts chunks exists in
- * message contains true, otherwise contains false
- *
- * @param length_tts_chunks contains length of array
- * tts chunks.
- */
- void SendSpeakRequest(int32_t app_id,
- bool tts_chunks_exists,
- size_t length_tts_chunks);
-
- /*
- * @brief Tells if there are sent requests without responses
- */
- bool HasHmiResponsesToWait();
-
- /*
- * @brief Check if all strings have valid syntax in request
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckStringsOfAlertRequest();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for mobile app.
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool awaiting_ui_alert_response_;
- bool awaiting_tts_speak_response_;
- bool awaiting_tts_stop_speaking_response_;
- bool is_alert_succeeded_;
- bool is_ui_alert_sent_;
- hmi_apis::Common_Result::eType alert_result_;
- smart_objects::SmartObject alert_response_params_;
- hmi_apis::Common_Result::eType tts_speak_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(AlertRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
deleted file mode 100644
index e03dad7564..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief AlertResponse command class
- **/
-class AlertResponse : public CommandResponseImpl {
- public:
- /**
- * @brief AlertResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- AlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief AlertResponse class destructor
- **/
- virtual ~AlertResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AlertResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
deleted file mode 100644
index f783af12b3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
-
-#include <strings.h>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/pending.h"
-#include "utils/macro.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-/**
- * @brief ChangeRegistrationRequest command class
- **/
-class ChangeRegistrationRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ChangeRegistrationRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ChangeRegistrationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ChangeRegistrationRequest class destructor
- **/
- virtual ~ChangeRegistrationRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Search for requested language in HMI UI supported languages
- *
- * @return true if language supported by UI, otherwise false
- */
- bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
-
- /*
- * @brief Search for requested language in HMI VR supported languages
- *
- * @return true if language supported by VR, otherwise false
- */
- bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
-
- /*
- * @brief Search for requested language in HMI TTS supported languages
- *
- * @return true if language supported by TTS, otherwise false
- */
- bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks change_registration params(ttsName, appname,
- * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
- *
- * @return true if command contains \t\n \\t \\n of whitespace otherwise
- * returns false.
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Check parameters (name, vr) for
- * coincidence with already known parameters of registered applications
- *
- * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
- * otherwise appropriate error code returns
- */
- mobile_apis::Result::eType CheckCoincidence();
-
- /**
- * @brief Checks if requested name is allowed by policy
- * @param app_name Application name
- * @return true, if allowed, otherwise - false
- */
- bool IsNicknameAllowed(const custom_str::CustomString& app_name) const;
-
- /**
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param response_info contains info for sending to mobile application
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& ResponseInfo);
-
- /**
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * @return TRUE if there is coincidence of VR, otherwise FALSE
- */
- struct CoincidencePredicateVR {
- CoincidencePredicateVR(const custom_str::CustomString& newItem)
- : newItem_(newItem){};
-
- bool operator()(const smart_objects::SmartObject& obj) const {
- const custom_str::CustomString& vr_synonym = obj.asCustomString();
- return newItem_.CompareIgnoreCase(vr_synonym);
- };
-
- const custom_str::CustomString& newItem_;
- };
-
- Pending pending_requests_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string vr_response_info_;
- std::string tts_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
deleted file mode 100644
index 995764a15f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ChangeRegistrationResponse command class
- **/
-class ChangeRegistrationResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ChangeRegistrationResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ChangeRegistrationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ChangeRegistrationResponse class destructor
- **/
- virtual ~ChangeRegistrationResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
deleted file mode 100644
index fffbab567f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
-#include <map>
-#include <string>
-
-#include "application_manager/application.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/event_engine/event_observer.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief CreateInteractionChoiceSetRequest command class
- **/
-class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
- public:
- /**
- * @brief CreateInteractionChoiceSetRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- CreateInteractionChoiceSetRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief CreateInteractionChoiceSetRequest class destructor
- **/
- virtual ~CreateInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- */
- virtual void onTimeOut();
- /**
- * @brief DeleteChoices allows to walk through the sent commands collection
- * in order to sent appropriate DeleteCommand request.
- */
-
- private:
- void DeleteChoices();
-
- /**
- * @brief Calls after all responses from HMI were received.
- * Terminates request and sends successful response to mobile
- * if all responses were SUCCESS or calls DeleteChoices in other case.
- */
- void OnAllHMIResponsesReceived();
-
- /**
- * @brief The VRCommand struct
- * Collect minimum information about sent VR commands, for correctly
- * processing deleting sent commands if error from HMI received
- */
- struct VRCommandInfo {
- VRCommandInfo() {}
- VRCommandInfo(uint32_t cmd_id)
- : cmd_id_(cmd_id), succesful_response_received_(false) {}
- uint32_t cmd_id_;
- bool succesful_response_received_;
- };
-
- typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap;
- SentCommandsMap sent_commands_map_;
-
- int32_t choice_set_id_;
- size_t expected_chs_count_;
- size_t received_chs_count_;
-
- /**
- * @brief Flag for stop sending VR commands to HMI, in case one of responses
- * failed
- */
- volatile bool error_from_hmi_;
- sync_primitives::Lock error_from_hmi_lock_;
-
- /**
- * @brief Flag shows if request already was expired by timeout
- */
- volatile bool is_timed_out_;
- sync_primitives::Lock is_timed_out_lock_;
-
- sync_primitives::Lock vr_commands_lock_;
- /*
- * @brief Sends VR AddCommand request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendVRAddCommandRequests(ApplicationSharedPtr const app);
-
- /*
- * @brief Checks incoming choiseSet params.
- * @param app Registred mobile application
- *
- * @return Mobile result code
- */
- mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app);
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare choice ID
- *param
- *
- * return TRUE if there is coincidence of choice ID, otherwise FALSE
- */
- struct CoincidencePredicateChoiceID {
- CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {}
-
- bool operator()(smart_objects::SmartObject obj) {
- return obj[strings::choice_id].asUInt() == newItem_;
- }
-
- const uint32_t newItem_;
- };
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare menu name
- *param
- *
- * return TRUE if there is coincidence of menu name, otherwise FALSE
- */
- struct CoincidencePredicateMenuName {
- CoincidencePredicateMenuName(const std::string& newItem)
- : newItem_(newItem){};
-
- bool operator()(smart_objects::SmartObject obj) {
- return obj[strings::menu_name].asString() == newItem_;
- }
-
- const std::string& newItem_;
- };
-
- /*
- * @brief Predicate for using with CheckChoiceSet method to compare VR commands
- *param
- *
- * return TRUE if there is coincidence of VR commands, otherwise FALSE
- */
- struct CoincidencePredicateVRCommands {
- CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
- : newItem_(newItem) {}
-
- bool operator()(smart_objects::SmartObject obj) {
- return compareStr(obj, newItem_);
- }
-
- const smart_objects::SmartObject& newItem_;
- };
-
- /*
- * @brief Checks if incoming choice set doesn't has similar VR synonyms.
- *
- * @param choice1 Choice to compare
- * @param choice2 Choice to compare
- *
- * return Return TRUE if there are similar VR synonyms in choice set,
- * otherwise FALSE
- */
- bool compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2);
-
- /*
- * @brief Checks VR synonyms ignoring differences in case.
- *
- * @param str1 VR synonym to compare
- * @param str2 VR synonym to compare
- *
- * return Return TRUE if there are similar VR synonyms in choice set,
- * otherwise FALSE
- */
- static bool compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2);
-
- /**
- * @brief Checks choice set params(menuName, tertiaryText, ...)
- * When type is String there is a check on the contents \t\n \\t \\n
- * @param choice_set which must check
- * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
-
- /**
- * @brief ProcessHmiError process received error from HMI.
- * This function id not thread safe. It should be protected with
- * vr_commands_lock_
- * @param vr_result ERROR type
- */
- void ProcessHmiError(const hmi_apis::Common_Result::eType vr_result);
-
- /**
- * @brief ProcessSuccesfulHMIResponse process succesful response from HMI\
- * This function id not thread safe. It should be protected with
- * vr_commands_lock_
- * @param corr_id correlation id of received response
- * @return true if resuest with corr_itd was sent on HMI, false otherwise
- */
- bool ProcessSuccesfulHMIResponse(const uint32_t corr_id);
-
- /**
- * @brief CountReceivedVRResponses counts received HMI responses. Updated
- * request timeout if not all responses received
- * Send response to mobile if all responses received.
- */
- void CountReceivedVRResponses();
-
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
deleted file mode 100644
index bb2083e0b5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief CreateInteractionChoiceSetResponse command class
- **/
-class CreateInteractionChoiceSetResponse : public CommandResponseImpl {
- public:
- /**
- * @brief CreateInteractionChoiceSetResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- CreateInteractionChoiceSetResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief CreateInteractionChoiceSetResponse class destructor
- **/
- virtual ~CreateInteractionChoiceSetResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
deleted file mode 100644
index 3483aea1d6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteCommandRequest command class
- **/
-class DeleteCommandRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteCommandRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteCommandRequest class destructor
- **/
- virtual ~DeleteCommandRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for mobile app.
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool is_ui_send_;
- bool is_vr_send_;
-
- bool is_ui_received_;
- bool is_vr_received_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType vr_result_;
- std::string ui_info_;
- std::string vr_info_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
deleted file mode 100644
index a6a25f9cd5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteCommandResponse command class
- **/
-class DeleteCommandResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteCommandResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteCommandResponse class destructor
- **/
- virtual ~DeleteCommandResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
deleted file mode 100644
index beb8ae73cd..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-struct AppFile;
-
-namespace commands {
-
-/**
- * @brief DeleteFileRequest command class
- **/
-class DeleteFileRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteFileRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteFileRequest class destructor
- **/
- virtual ~DeleteFileRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
-
- void SendFileRemovedNotification(const AppFile* file) const;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
deleted file mode 100644
index 08f734ec13..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteFileResponse command class
- **/
-class DeleteFileResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteFileResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteFileResponse class destructor
- **/
- virtual ~DeleteFileResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
deleted file mode 100644
index 12c80138b4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteInteractionChoiceSetRequest command class
- **/
-class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteInteractionChoiceSetRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteInteractionChoiceSetRequest class destructor
- **/
- virtual ~DeleteInteractionChoiceSetRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Check if requested choice set ID in use by perform interaction
- *
- * @param app mobile application
- */
- bool ChoiceSetInUse(ApplicationConstSharedPtr app);
-
- void SendVrDeleteCommand(ApplicationSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
deleted file mode 100644
index 7a926399ee..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteInteractionChoiceSetResponse command class
- **/
-class DeleteInteractionChoiceSetResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteInteractionChoiceSetResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteInteractionChoiceSetResponse class destructor
- **/
- virtual ~DeleteInteractionChoiceSetResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
deleted file mode 100644
index b9c27ba294..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DeleteSubMenuRequest command class
- **/
-class DeleteSubMenuRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DeleteSubMenuRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteSubMenuRequest class destructor
- **/
- virtual ~DeleteSubMenuRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Deletes VR commands from SDL for corresponding submenu ID
- *
- * @param app_id Application ID
- *
- * @return TRUE on success, otherwise FALSE
- */
- void DeleteSubMenuVRCommands(ApplicationConstSharedPtr app);
-
- /*
- * @brief Deletes UI commands from SDL for corresponding submenu ID
- *
- * @param app_id Application ID
- *
- * @return TRUE on success, otherwise FALSE
- */
- void DeleteSubMenuUICommands(ApplicationSharedPtr const app);
-
- DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
deleted file mode 100644
index 4319d88ea0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesResponse command class
- **/
-class DeleteSubMenuResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DeleteSubMenuResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DeleteSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DeleteSubMenuResponse class destructor
- **/
- virtual ~DeleteSubMenuResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
deleted file mode 100644
index d55bce6613..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DiagnosticMessageRequest command class
- **/
-class DiagnosticMessageRequest : public CommandRequestImpl {
- public:
- /**
- * @brief DiagnosticMessageRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DiagnosticMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DiagnosticMessageRequest class destructor
- **/
- virtual ~DiagnosticMessageRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
deleted file mode 100644
index 7ac810eabf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DiagnosticMessageResponse command class
- **/
-class DiagnosticMessageResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DiagnosticMessageResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DiagnosticMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DiagnosticMessageResponse class destructor
- **/
- virtual ~DiagnosticMessageResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
deleted file mode 100644
index c8ae2b2cd9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DialNumber request command class
- **/
-class DialNumberRequest : public CommandRequestImpl {
- public:
- /**
- * \brief DialNumberRequest class constructor
- **/
- DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief DialNumberRequest class destructor
- **/
- ~DialNumberRequest() OVERRIDE;
-
- /**
- * @brief Initialize request params
- **/
- bool Init() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Removes from number param all characters
- * except the + character and digits.
- *
- */
- void StripNumberParam(std::string& number);
-
- DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
deleted file mode 100644
index 688c9a7207..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief DialNumberResponse command class
- **/
-class DialNumberResponse : public CommandResponseImpl {
- public:
- /**
- * @brief DialNumberResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief DialNumberResponse class destructor
- **/
- virtual ~DialNumberResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
deleted file mode 100644
index 04f4fa53ab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief EndAudioPassThruRequest command class
- **/
-class EndAudioPassThruRequest : public CommandRequestImpl {
- public:
- /**
- * @brief EndAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- EndAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief EndAudioPassThruRequest class destructor
- **/
- virtual ~EndAudioPassThruRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
deleted file mode 100644
index ca756cf5d7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief EndAudioPassThruResponse command class
- **/
-class EndAudioPassThruResponse : public CommandResponseImpl {
- public:
- /**
- * @brief EndAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- EndAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief EndAudioPassThruResponse class destructor
- **/
- virtual ~EndAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
deleted file mode 100644
index 6cfc6e5891..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class GenericResponse : public CommandResponseImpl {
- public:
- /**
- * \brief GenericResponse class constructor
- **/
- GenericResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
- /**
- * \brief GenericResponse class destructor
- **/
- virtual ~GenericResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GenericResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
deleted file mode 100644
index b70c04bcca..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetDTCsRequest command class
- **/
-class GetDTCsRequest : public CommandRequestImpl {
- public:
- /**
- * @brief GetDTCsRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetDTCsRequest class destructor
- **/
- virtual ~GetDTCsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
deleted file mode 100644
index 10d0d0f86d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetDTCsResponse command class
- **/
-class GetDTCsResponse : public CommandResponseImpl {
- public:
- /**
- * @brief GetDTCsResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetDTCsResponse class destructor
- **/
- virtual ~GetDTCsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
deleted file mode 100644
index 030a3afedc..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class SmartObject;
-
-namespace commands {
-
-/**
- * @brief GetVehicleDataRequest command class
- **/
-class GetVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief GetVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetVehicleDataRequest class destructor
- **/
- virtual ~GetVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- protected:
- virtual void on_event(const event_engine::Event& event);
-
-#ifdef HMI_DBUS_API
- private:
- void SendRequestsToHmi(const int32_t app_id);
-
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
deleted file mode 100644
index 11691d1f84..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetVehicleDataResponse command class
- **/
-class GetVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief GetVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- GetVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief GetVehicleDataResponse class destructor
- **/
- virtual ~GetVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h
deleted file mode 100644
index bf23121177..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetWayPointsRequest command class
- **/
-class GetWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief GetWayPointsRequest class constructor
- **/
- GetWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief GetWayPointsRequest class destructor
- **/
- virtual ~GetWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h
deleted file mode 100644
index cb4f840763..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief GetWayPointsResponse command class
- **/
-class GetWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief GetWayPointsResponse class constructor
- **/
- GetWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief GetWayPointsResponse class destructor
- **/
- virtual ~GetWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
deleted file mode 100644
index f1e9204eea..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ListFilesRequest command class
- **/
-class ListFilesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ListFilesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ListFilesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ListFilesRequest class destructor
- **/
- virtual ~ListFilesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
deleted file mode 100644
index 81165c9bc4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ListFilesResponse command class
- **/
-class ListFilesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ListFilesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ListFilesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ListFilesResponse class destructor
- **/
- virtual ~ListFilesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
deleted file mode 100644
index 758fdaf760..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAppInterfaceUnregisteredNotification class
- **/
-class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnAppInterfaceUnregisteredNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAppInterfaceUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager);
-
- /**
- * @brief OnAppInterfaceUnregisteredNotification class destructor
- **/
- virtual ~OnAppInterfaceUnregisteredNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
deleted file mode 100644
index 68e1d4f548..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnAudioPassThruNotification class used to send notification with
- *binary data written from
- * microphone to mobile device while PerformAudioPassThru is active.
- **/
-class OnAudioPassThruNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnAudioPassThruNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnAudioPassThruNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnAudioPassThruNotification class destructor
- **/
- virtual ~OnAudioPassThruNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
deleted file mode 100644
index d6a15caf4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnButtonEventNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnButtonEventNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnButtonEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonEventNotification class destructor
- **/
- virtual ~OnButtonEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends button event notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendButtonEvent(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
-};
-
-} // namespace mobile
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
deleted file mode 100644
index 9acd31f8da..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnButtonPressNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnButtonPressNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnButtonPressNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnButtonPressNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnButtonEventCommand class destructor
- **/
- virtual ~OnButtonPressNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends button press notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendButtonPress(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
deleted file mode 100644
index e2faf9b05c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief OnCommandNotification class is used to send notification
- * to mobile device.
- **/
-class OnCommandNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnCommandNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnCommandNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnCommandNotification class destructor
- **/
- virtual ~OnCommandNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
deleted file mode 100644
index 1f9ee4ed8c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnDriverDistractionNotification class
- **/
-class OnDriverDistractionNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnDriverDistractionNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnDriverDistractionNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnDriverDistractionNotification class destructor
- **/
- virtual ~OnDriverDistractionNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
-};
-
-} // namespace mobile
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
deleted file mode 100644
index 07544c573f..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-namespace mobile {
-
-/**
- * @brief OnHashChangeNotification class
- **/
-class OnHashChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnHashChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHashChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHashChangeNotification class destructor
- **/
- virtual ~OnHashChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
deleted file mode 100644
index 58659cbc4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnHMIStatusNotification class
- **/
-class OnHMIStatusNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnHMIStatusNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHMIStatusNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHMIStatusNotification class destructor
- **/
- virtual ~OnHMIStatusNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
deleted file mode 100644
index b2802e9fe9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
-
-#include "application_manager/commands/command_notification_from_mobile_impl.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnHMIStatusNotificationFromMobile class
- **/
-class OnHMIStatusNotificationFromMobile
- : public CommandNotificationFromMobileImpl {
- public:
- /**
- * @brief OnHMIStatusNotificationFromMobile class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnHMIStatusNotificationFromMobile class destructor
- **/
- virtual ~OnHMIStatusNotificationFromMobile();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
deleted file mode 100644
index 911ca70cdf..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnKeyBoardInputNotification class
- **/
-class OnKeyBoardInputNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnKeyBoardInputNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnKeyBoardInputNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnKeyBoardInputNotification class destructor
- **/
- virtual ~OnKeyBoardInputNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
deleted file mode 100644
index bbd7679a6b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnLanguageChangeNotification class
- **/
-class OnLanguageChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnLanguageChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnLanguageChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnLanguageChangeNotification class destructor
- **/
- virtual ~OnLanguageChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
deleted file mode 100644
index 9fd2832218..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnPermissionsChangeNotification class
- **/
-class OnPermissionsChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnPermissionsChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnPermissionsChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnPermissionsChangeNotification class destructor
- **/
- virtual ~OnPermissionsChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
deleted file mode 100644
index d42e42649a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include <vector>
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnSystemRequestNotification class
- **/
-class OnSystemRequestNotification : public CommandNotificationImpl {
- public:
- typedef std::vector<uint8_t> BinaryMessage;
- /**
- * @brief OnSystemRequestNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnSystemRequestNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnSystemRequestNotification class destructor
- **/
- ~OnSystemRequestNotification() OVERRIDE;
-
- /**
- * @brief Execute command
- **/
- void Run() OVERRIDE;
-
- private:
-#ifdef PROPRIETARY_MODE
- /**
- * @brief Adds HTTP header to message
- * @param message Message
- */
- void AddHeader(BinaryMessage& message) const;
- size_t ParsePTString(std::string& pt_string) const;
-#endif // PROPRIETARY_MODE
-
- DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
deleted file mode 100644
index 42a81043f9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnTBTClientStateNotification class
- **/
-class OnTBTClientStateNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnTBTClientStateNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTBTClientStateNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTBTClientStateNotification class destructor
- **/
- virtual ~OnTBTClientStateNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
deleted file mode 100644
index abbf6787db..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-/**
- * @brief OnTouchEventNotification class
- **/
-class OnTouchEventNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnTouchEventNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnTouchEventNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnTouchEventNotification class destructor
- **/
- virtual ~OnTouchEventNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
-};
-
-} // namespace mobile
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
deleted file mode 100644
index efe2ce8c55..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief OnVehicleDataNotification class is used to send notification
- * to mobile device that some button was pressed on HMI.
- **/
-class OnVehicleDataNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnVehicleDataNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnVehicleDataNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnVehicleDataNotification class destructor
- **/
- virtual ~OnVehicleDataNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /*
- * @brief Sends vehicle data notification to mobile device
- *
- * @param app Application to receive notification
- */
- void SendVehicleData(ApplicationConstSharedPtr app);
-
- DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
deleted file mode 100644
index e33de74fd8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
-
-#include "application_manager/commands/command_notification_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class OnWayPointChangeNotification : public CommandNotificationImpl {
- public:
- /**
- * @brief OnWayPointChangeNotification class constructor
- *
- * @param message Incoming SmartObject message
- **/
- OnWayPointChangeNotification(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief OnWayPointChangeNotification class destructor
- **/
- virtual ~OnWayPointChangeNotification();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
deleted file mode 100644
index 99f86ea1d5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformAudioPassThruRequest command class
- **/
-class PerformAudioPassThruRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PerformAudioPassThruRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformAudioPassThruRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformAudioPassThruRequest class destructor
- **/
- virtual ~PerformAudioPassThruRequest();
-
- /**
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- /**
- * @brief Init required by command resources
- **/
- bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Prepare result code, result and info for sending to mobile
- * 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();
-
- /**
- * @brief Checks perform audio pass thru params(initialPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
- * TTS_StopSpeaking to HMI
- */
- void FinishTTSSpeak();
-
- /*
- * @brief Tells if there are sent requests without responses
- */
- bool IsWaitingHMIResponse();
-
- /* 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);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
deleted file mode 100644
index 29005d7b01..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformAudioPassThruResponse command class
- **/
-class PerformAudioPassThruResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PerformAudioPassThruResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformAudioPassThruResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformAudioPassThruResponse class destructor
- **/
- virtual ~PerformAudioPassThruResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
deleted file mode 100644
index c482e2d548..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
-
-#include <string>
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-/**
- * @brief PerformInteractionRequest command class
- **/
-class PerformInteractionRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PerformInteractionRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformInteractionRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformInteractionRequest class destructor
- **/
- virtual ~PerformInteractionRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- /*
- * @brief Function is called by RequestController when request execution time
- * has exceed it's limit
- *
- */
- virtual void onTimeOut();
-
- private:
- /**
- * @brief Function will be called when VR_OnCommand event
- * comes
- * @param message which should send to mobile side
- * @return true if send response to mobile application otherwise
- * return false.
- */
- bool ProcessVRResponse(const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params);
-
- /**
- * @brief Sends PerformInteraction response to mobile side
- * @param message which should send to mobile side
- */
- void ProcessUIResponse(const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params);
-
- /*
- * @brief Sends UI PerformInteraction request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendUIPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sends TTS PerformInteraction request to HMI
- *
- * @param app_id Application ID
- *
- */
- void SendVRPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sends UI Show VR help request to HMI
- *
- * @param app_id Application ID
- */
- void SendUIShowVRHelpRequest(ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if incoming choice set doesn't has similar menu names.
- *
- * @param app_id Application ID
- *
- * return Return TRUE if there are no similar menu names in choice set,
- * otherwise FALSE
- */
- bool CheckChoiceSetMenuNames(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if incoming choice set doesn't has similar VR synonyms.
- *
- * @param app_id Application ID
- *
- * return Return TRUE if there are no similar VR synonyms in choice set,
- * otherwise FALSE
- */
- bool CheckChoiceSetVRSynonyms(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Checks if request with non-sequential positions of vrHelpItems
- * SDLAQ-CRS-466
- *
- * @param app_id Application ID
- *
- * @return TRUE if vrHelpItems positions are sequential,
- * otherwise FALSE
- */
- bool CheckVrHelpItemPositions(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Disable PerformInteraction state in application and
- * delete VR commands from HMI
- */
- void DisablePerformInteraction();
-
- /**
- * @brief Checks perform interaction params(initialText, initialPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if perform interaction contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Send HMI close PopUp and call DisablePerformInteraction
- */
- void TerminatePerformInteraction();
-
- /**
- * @brief Checks parameter ChoiceID from response.
- * @param app contains pointer to application
- * @param choice_id contains ChoiceID from response.
- * @return if ChoiceID from response is correct method returns TRUE
- * otherwise returns FALSE.
- */
- bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id);
-
- /**
- * @brief Checks for a match of choice ID, in
- * choice sets.
- * @param app contains pointer to application.
- * @param choice_set_id_list_length contains amount
- * of choice set ids.
- * @param choice_set_id_list array of choice set ids
- * @return If request contains several choice sets with
- * same choice id returns false, otherwise returns
- * true.
- */
- bool CheckChoiceIDFromRequest(
- ApplicationSharedPtr app,
- const size_t choice_set_id_list_length,
- const smart_objects::SmartObject& choice_set_id_list) const;
-
- /**
- * @brief Tells if there are sent requests without responses
- * @return If there is request without response method returns TRUE
- * otherwise returns FALSE
- */
- const bool HasHMIResponsesToWait() const;
-
- /**
- * @brief Check UI & VR result codes, send response to mobile
- * @param msg_param Message params to send
- */
- void SendBothModeResponse(const smart_objects::SmartObject& msg_param);
-
- mobile_apis::InteractionMode::eType interaction_mode_;
- bool ui_response_received_;
- bool vr_response_received_;
- bool app_pi_was_active_before_;
- static uint32_t pi_requests_count_;
- hmi_apis::Common_Result::eType vr_result_code_;
- hmi_apis::Common_Result::eType ui_result_code_;
- std::string ui_info_;
- std::string vr_info_;
-
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
deleted file mode 100644
index 209b469d0d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PerformInteractionResponse command class
- **/
-class PerformInteractionResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PerformInteractionResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PerformInteractionResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PerformInteractionResponse class destructor
- **/
- virtual ~PerformInteractionResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
deleted file mode 100644
index ad13f0ee52..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PutFileRequest command class
- **/
-class PutFileRequest : public CommandRequestImpl {
- public:
- /**
- * @brief PutFileRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PutFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PutFileRequest class destructor
- **/
- virtual ~PutFileRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- int64_t offset_;
- std::string sync_file_name_;
- int64_t length_;
- mobile_apis::FileType::eType file_type_;
- bool is_persistent_file_;
-
- void SendOnPutFileNotification();
- DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
deleted file mode 100644
index aa407c8d83..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief PutFileResponse command class
- **/
-class PutFileResponse : public CommandResponseImpl {
- public:
- /**
- * @brief PutFileResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- PutFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief PutFileResponse class destructor
- **/
- virtual ~PutFileResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
deleted file mode 100644
index c88f16dab0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ReadDIDRequest command class
- **/
-class ReadDIDRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ReadDIDRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ReadDIDRequest class destructor
- **/
- virtual ~ReadDIDRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
deleted file mode 100644
index 2e493fa0ec..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ReadDIDResponse command class
- **/
-class ReadDIDResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ReadDIDResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ReadDIDResponse class destructor
- **/
- virtual ~ReadDIDResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
deleted file mode 100644
index cc3d5b685c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "utils/macro.h"
-#include "utils/custom_string.h"
-
-namespace policy {
-struct DeviceInfo;
-}
-
-namespace application_manager {
-
-class Application;
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-/**
- * @brief Register app interface request command class
- **/
-class RegisterAppInterfaceRequest : public CommandRequestImpl {
- public:
- /**
- * \brief RegisterAppInterfaceRequest class constructor
- **/
- RegisterAppInterfaceRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief RegisterAppInterfaceRequest class destructor
- **/
- virtual ~RegisterAppInterfaceRequest();
-
- /**
- * @brief Init required by command resources
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Sends RegisterAppInterface response to mobile
- *
- *@param application_impl application
- *
- **/
- void SendRegisterAppInterfaceResponseToMobile();
-
- private:
- smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
- const uint32_t connection_key, ApplicationSharedPtr app);
-
- /**
- * @brief SendChangeRegistration send ChangeRegistration on HMI
- * @param function_id interface specific ChangeRegistration
- * @param language language of registration
- * @param app_id application to change registration
- */
- void SendChangeRegistration(const hmi_apis::FunctionID::eType function_id,
- const int32_t language,
- const uint32_t app_id);
-
- /**
- * @brief SendChangeRegistrationOnHMI send required SendChangeRegistration
- * HMI
- * @param app application to change registration
- */
- void SendChangeRegistrationOnHMI(ApplicationConstSharedPtr app);
-
- /**
- * @brief Sends OnAppRegistered notification to HMI
- *
- *@param application_impl application with changed HMI status
- *
- **/
- void SendOnAppRegisteredNotificationToHMI(const Application& application_impl,
- bool resumption = false,
- bool need_restore_vr = false);
- /*
- * @brief Check new ID along with known mobile application ID
- *
- * return TRUE if ID is known already, otherwise - FALSE
- */
- bool IsApplicationWithSameAppIdRegistered();
-
- /*
- * @brief Check new application parameters (name, tts, vr) for
- * coincidence with already known parameters of registered applications
- *
- * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
- * otherwise appropriate error code returns
- */
- mobile_apis::Result::eType CheckCoincidence();
-
- /*
- * @brief Predicate for using with CheckCoincidence method to compare with VR
- * synonym SO
- *
- * return TRUE if there is coincidence of VR, otherwise FALSE
- */
- struct CoincidencePredicateVR {
- CoincidencePredicateVR(const custom_str::CustomString& newItem)
- : newItem_(newItem) {}
-
- bool operator()(const smart_objects::SmartObject& obj) {
- const custom_str::CustomString& vr_synonym = obj.asCustomString();
- return newItem_.CompareIgnoreCase(vr_synonym);
- }
- const custom_str::CustomString& newItem_;
- };
-
- /**
- * @brief Check request parameters against policy table data
- * @return SUCCESS if check ok, otherwise return appropriate error code
- */
- mobile_apis::Result::eType CheckWithPolicyData();
-
- /**
- * @brief Fill DeviceInfo struct with data from request, if any
- * @param device_info Struct for device params from request
- */
- void FillDeviceInfo(policy::DeviceInfo* device_info);
-
- /**
- * @brief Checks register app interface params(ttsName, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if register app interface contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /**
- * @brief Checks vehicle type params (model, year etc.) and in case of absense
- * replaces with policy table backup values
- * @param vehicle_type VehicleType struct
- * @param param Vehicle param
- * @param backup_value Backup value
- */
- void CheckResponseVehicleTypeParam(smart_objects::SmartObject& vehicle_type,
- const std::string& param,
- const std::string& backup_value);
- /**
- * @brief Sends ButtonSubscription notification at start up
- * to notify HMI that app subscribed on the custom button by default.
- */
- void SendSubscribeCustomButtonNotification();
-
- private:
- std::string response_info_;
- mobile_apis::Result::eType result_checking_app_hmi_type_;
-
- policy::PolicyHandlerInterface& GetPolicyHandler();
- DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
deleted file mode 100644
index b125cc7c55..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief Register app interface request command class
- **/
-class RegisterAppInterfaceResponse : public CommandResponseImpl {
- public:
- /**
- * \brief RegisterAppInterfaceResponse class constructor
- **/
- RegisterAppInterfaceResponse(const MessageSharedPtr& response,
- ApplicationManager& application_manager)
- : CommandResponseImpl(response, application_manager) {}
-
- /**
- * \brief RegisterAppInterfaceResponse class destructor
- **/
- virtual ~RegisterAppInterfaceResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- void SetHeartBeatTimeout(uint32_t connection_key,
- const std::string& mobile_app_id);
-
- DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
deleted file mode 100644
index 49e5fe34ff..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesRequest command class
- **/
-class ResetGlobalPropertiesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ResetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ResetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ResetGlobalPropertiesRequest class destructor
- **/
- virtual ~ResetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Sets default value of the HELPPROMT global property
- * to the first vrCommand of each Command Menu registered in application
- *
- * @param app Registered application
- * @param is_timeout_promp Flag indicating that timeout prompt
- * should be reset
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetHelpPromt(ApplicationSharedPtr app);
-
- /*
- * @brief Sets default value of the TIMEOUTPROMT global property
- * to the first vrCommand of each Command Menu registered in application
- *
- * @param app Registered application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Sets default value of the VRHELPTITLE global property
- * to the application name and value of the VRHELPITEMS global property
- * to value equal to registered command -1(default command “Help / Cancel”.)
- *
- * @param app Registered application
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool ResetVrHelpTitleItems(
- application_manager::ApplicationSharedPtr const app);
-
- /*
- * @brief Prepare result for sending to mobile application
- * @param out_result_code contains result code for sending to mobile
- * application
- * @param out_response_info contains info for sending to mobile applicaion
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
- std::string& out_response_info);
-
- /*
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
-
- bool is_ui_send_;
- bool is_tts_send_;
-
- bool is_ui_received_;
- bool is_tts_received_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
deleted file mode 100644
index 39e28486d4..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ResetGlobalPropertiesResponse command class
- **/
-class ResetGlobalPropertiesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ResetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ResetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ResetGlobalPropertiesResponse class destructor
- **/
- virtual ~ResetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
deleted file mode 100644
index b3058c9a26..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief scrollable message request command class
- **/
-class ScrollableMessageRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ScrollableMessageRequest class constructor
- **/
- ScrollableMessageRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SliderCommand class destructor
- **/
- virtual ~ScrollableMessageRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
deleted file mode 100644
index aa0ac01e9d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class ScrollableMessageResponse : public CommandResponseImpl {
- public:
- /**
- * \brief ScrollableMessageResponse class constructor
- **/
- ScrollableMessageResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponseCommand class destructor
- **/
- virtual ~ScrollableMessageResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
deleted file mode 100644
index 570e70d007..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
-
-#include <list>
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief send location request command class
- */
-class SendLocationRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SendLocationRquest class constructor
- */
- SendLocationRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendLocationRquest class destructor
- */
- virtual ~SendLocationRequest();
-
- /**
- * @brief Execute command
- */
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief CheckFieldsCompatibility checks if fields are compatible with each
- * other.
- * @return true if compatible, otherwise return false
- */
- bool CheckFieldsCompatibility();
-
- /**
- * @brief Checks sendlocation params(locationName, locationDescription, ...).
- * Checks string if it contains \t\n \\t \\n or whitespace
- * @return true if string contains invalid characters, otherwise returns false
- */
- bool IsWhiteSpaceExist();
-
- bool CheckHMICapabilities(
- std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names);
- DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
deleted file mode 100644
index 0be0be8ca3..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-
-namespace application_manager {
-namespace commands {
-
-class SendLocationResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SendLocationResponse class constructor
- */
- SendLocationResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SendLocationResponse class destructor
- */
- virtual ~SendLocationResponse();
-
- /**
- * @brief Execute command
- */
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
deleted file mode 100644
index 4735d89fb0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconRequest command class
- **/
-class SetAppIconRequest : public CommandRequestImpl {
- public:
- /**
- * @brief Contains information about the type of image
- */
- typedef enum { STATIC = 0, DYNAMIC } ImageType;
-
- /**
- * @brief SetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconRequest class destructor
- **/
- virtual ~SetAppIconRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /**
- * @brief Copies file to icon storage
- * @param path_to_file Path to icon
- */
- void CopyToIconStorage(const std::string& path_to_file) const;
-
- /**
- * @brief Remove oldest icons
- * @param storage Path to icons storage
- * @param icons_amount Amount of icons to be deleted
- */
- void RemoveOldestIcons(const std::string& storage,
- const uint32_t icons_amount) const;
-
- /**
- * @brief Checks, if there enough space in storage for icon copy
- * @param file_size File size
- * @return true, if enough, otherwise - false
- */
- bool IsEnoughSpaceForIcon(const uint64_t icon_size) const;
- DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest);
-
- private:
- /**
- * @brief Checks, if icons saving to configured folder is enabled
- */
- bool is_icons_saving_enabled_;
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
deleted file mode 100644
index 742332742b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconResponse command class
- **/
-class SetAppIconResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconResponse class destructor
- **/
- virtual ~SetAppIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetAppIconResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
deleted file mode 100644
index 06e8d70f79..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetDisplayLayoutRequest command class
- **/
-class SetDisplayLayoutRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SetDisplayLayoutRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetDisplayLayoutRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetDisplayLayoutRequest class destructor
- **/
- virtual ~SetDisplayLayoutRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- **/
- virtual void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
deleted file mode 100644
index a2040307b0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetDisplayLayoutResponse command class
- **/
-class SetDisplayLayoutResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetDisplayLayoutResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetDisplayLayoutResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetDisplayLayoutResponse class destructor
- **/
- virtual ~SetDisplayLayoutResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
deleted file mode 100644
index 0300245af8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
-#include <string>
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-#include "application_manager/application.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Register app interface request command class
- **/
-class SetGlobalPropertiesRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SetGlobalPropertiesRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetGlobalPropertiesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetGlobalPropertiesRequest class destructor
- **/
- virtual ~SetGlobalPropertiesRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- // Verify correctness VrHelptitle value
- static bool ValidateVRHelpTitle(
- const smart_objects::SmartObject* const vr_help_so_ptr);
-
- // prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject
- static void PrepareUIRequestVRHelpData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params);
-
- static bool PrepareUIRequestDefaultVRHelpData(
- const ApplicationSharedPtr app, smart_objects::SmartObject& out_params);
-
- static void PrepareUIRequestMenuAndKeyboardData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params);
-
- // Send TTS request to HMI
- void SendTTSRequest(const smart_objects::SmartObject& params,
- bool use_events);
-
- // Send UI request to HMI
- void SendUIRequest(const smart_objects::SmartObject& params, bool use_events);
-
- // VRHelp shall contain sequential positions and start from 1
- static bool CheckVrHelpItemsOrder(const smart_objects::SmartObject& vr_help);
-
- /**
- * @brief Check if there some not delivered hmi responses exist
- *
- * @return true if all responses received
- */
- bool IsPendingResponseExist();
-
- /**
- * @brief Checks if request has at least one parameter
- *
- * @param params request parameters
- *
- * @returns true if at least one parameter is present in object
- */
- static bool ValidateConditionalMandatoryParameters(
- const smart_objects::SmartObject& params);
-
- /**
- * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if set global properties contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- /*
- * @brief Prepare result code and result for sending to mobile application
- * @param result_code contains result code for sending to mobile application
- * @param info contains info for sending to mobile applicaion
- * @return result for sending to mobile application.
- */
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
-
- bool is_ui_send_;
- bool is_tts_send_;
-
- bool is_ui_received_;
- bool is_tts_received_;
-
- hmi_apis::Common_Result::eType ui_result_;
- hmi_apis::Common_Result::eType tts_result_;
- std::string ui_response_info_;
- std::string tts_response_info_;
-
- DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
deleted file mode 100644
index c5beda084d..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Register app interface request command class
- **/
-class SetGlobalPropertiesResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetGlobalPropertiesResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetGlobalPropertiesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetGlobalPropertiesResponse class destructor
- **/
- virtual ~SetGlobalPropertiesResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
deleted file mode 100644
index 96d4ac6f1e..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconRequest command class
- **/
-class SetIconRequest : public CommandRequestImpl {
- public:
- /**
- * @brief Contains information about the type of image
- */
- typedef enum { STATIC = 0, DYNAMIC } ImageType;
-
- /**
- * @brief SetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SetIconRequest class destructor
- **/
- virtual ~SetIconRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
deleted file mode 100644
index 83be0d4a4b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetIconResponse command class
- **/
-class SetIconResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconResponse(const MessageSharedPtr& message, ApplicationManager& app_man);
-
- /**
- * @brief SetIconResponse class destructor
- **/
- virtual ~SetIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
deleted file mode 100644
index 283dd41622..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SetMediaClockRequest request command class
- **/
-class SetMediaClockRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SetMediaClockRequest class constructor
- **/
- SetMediaClockRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowCommand class destructor
- **/
- virtual ~SetMediaClockRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const event_engine::Event& event);
-
- private:
- bool isDataValid();
-
- DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
deleted file mode 100644
index 3f41ae2dab..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SetMediaClockTimerResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SetMediaClockTimerResponse class constructor
- **/
- SetMediaClockTimerResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SetMediaClockTimerResponse class destructor
- **/
- virtual ~SetMediaClockTimerResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
deleted file mode 100644
index f015d740df..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ShowConstantTBTRequest command class
- **/
-class ShowConstantTBTRequest : public CommandRequestImpl {
- public:
- /**
- * @brief ShowConstantTBTRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ShowConstantTBTRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ShowConstantTBTRequest class destructor
- **/
- virtual ~ShowConstantTBTRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Checks show constant TBT params(turnIcon, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if show constant TBT contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
deleted file mode 100644
index 73aad5de89..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief ShowConstantTBTResponse command class
- **/
-class ShowConstantTBTResponse : public CommandResponseImpl {
- public:
- /**
- * @brief ShowConstantTBTResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- ShowConstantTBTResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief ShowConstantTBTResponse class destructor
- **/
- virtual ~ShowConstantTBTResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
deleted file mode 100644
index cbe2ca396a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief show request command class
- **/
-class ShowRequest : public CommandRequestImpl {
- public:
- /**
- * \brief ShowRequest class constructor
- **/
- ShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowRequest class destructor
- **/
- virtual ~ShowRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Check if all strings have valid syntax in request
- *
- * @return TRUE on success, otherwise FALSE
- */
- bool CheckStringsOfShowRequest();
-
- DISALLOW_COPY_AND_ASSIGN(ShowRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
deleted file mode 100644
index 0a54fb9cde..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class ShowResponse : public CommandResponseImpl {
- public:
- /**
- * \brief ShowResponse class constructor
- **/
- ShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief ShowResponse class destructor
- **/
- virtual ~ShowResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShowResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
deleted file mode 100644
index 2446c9ff20..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief slider request command class
- **/
-class SliderRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SliderRequest class constructor
- **/
- SliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SliderRequest class destructor
- **/
- virtual ~SliderRequest();
-
- /**
- * @brief Initialize request params
- **/
- virtual bool Init();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Checks slider params(sliderHeader, sliderFooter, ...).
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(SliderRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
deleted file mode 100644
index bc0efaadd0..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SliderResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SliderResponse class constructor
- **/
- SliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponseCommand class destructor
- **/
- virtual ~SliderResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SliderResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
deleted file mode 100644
index dc22652b27..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief speak request command class
- **/
-class SpeakRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SpeakRequest class constructor
- **/
- SpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakRequest class destructor
- **/
- virtual ~SpeakRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /*
- * @brief Sends Speak response to mobile side
- *
- * @param message which should send to mobile side
- *
- */
- void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
-
- /**
- * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
- * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
deleted file mode 100644
index 2808526603..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/message.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-
-class SpeakResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SpeakResponse class constructor
- **/
- SpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SpeakResponse class destructor
- **/
- virtual ~SpeakResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
deleted file mode 100644
index b5a22d40a9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeButtonRequest command class
- **/
-class SubscribeButtonRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SubscribeButtonRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeButtonRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonRequest class destructor
- **/
- virtual ~SubscribeButtonRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /**
- * @brief Checks if button subscription allowed. In case non-media
- * application trying to subscribe on buttons(tune, seek) negative result will
- * be returned
- *
- * @param app Application requested subscription
- * @param btn_id Button to be subscribe
- *
- * @return TRUE on success, otherwise false
- **/
- bool IsSubscriptionAllowed(ApplicationSharedPtr app,
- const mobile_apis::ButtonName::eType btn_id);
-
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app subscribed on the button.
- */
- void SendSubscribeButtonNotification();
-
- /**
- * @brief Checks HMI capabilities for specified button support
- * @param button Button to check
- */
- bool CheckHMICapabilities(mobile_apis::ButtonName::eType button);
-
- DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
deleted file mode 100644
index 38e0dd2dc6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeButtonResponse command class
- **/
-class SubscribeButtonResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SubscribeButtonResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeButtonResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonResponse class destructor
- **/
- virtual ~SubscribeButtonResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
deleted file mode 100644
index fb21823b3a..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeVehicleDataRequest command class
- **/
-class SubscribeVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SubscribeButtonCommandRequest class destructor
- **/
- virtual ~SubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- private:
- /**
- * @brief Checks, if any app is subscribed for particular VI parameter
- * @param param_id VI parameter id
- * @return true, if there are registered apps subscribed for VI parameter,
- * otherwise - false
- */
- bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
-
- /**
- * @brief Adds VI parameters being subscribed by another or the same app to
- * response with appropriate results
- * @param msg_params 'message_params' response section reference
- */
- void AddAlreadySubscribedVI(smart_objects::SmartObject& msg_params) const;
-
- /**
- * @brief Removes subscription for VI parameters which subsription attempt
- * returned an error
- * @param app Pointer to application sent subscribe request
- * @param msg_params 'message_parameters' response section reference
- */
- void UnsubscribeFailedSubscriptions(
- ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params) const;
-
- /**
- * @brief Checks if current application and other applications
- * were subscribed to VI, prepare data that need to send to mobile app
- * or HMI.
- * @param app contains application
- * @param out_info contains resulting info for sending to mobile app
- * @param out_result_code contains result code for sending to mobile app
- * @param out_response_params contains parameters that SDL sends to
- * mobile application
- * @param out_request_params contains parameters that SDL sends to
- * HMI
- * @param result contains result that SDL sends to mobile app.
- */
- void CheckVISubscribtions(ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result);
-
- /**
- * @brief VI parameters which had been already subscribed by another apps
- * befor particular app subscribed for these parameters
- */
- VehicleInfoSubscriptions vi_already_subscribed_by_another_apps_;
-
- /**
- * @brief VI parameters which had been subscribed already by particular app
- */
- VehicleInfoSubscriptions vi_already_subscribed_by_this_app_;
-
- DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
deleted file mode 100644
index 7e3cffc387..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeVehicleDataResponse command class
- **/
-class SubscribeVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataCommandRequest class destructor
- **/
- virtual ~SubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
deleted file mode 100644
index 50b3a6f2cb..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubsribeWayPointsRequest command class
- **/
-class SubscribeWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief SubscribeWayPointsRequest class constructor
- **/
- SubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SubscribeWayPointsRequest class destructor
- **/
- virtual ~SubscribeWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h
deleted file mode 100644
index cfdc0eede7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SubscribeWayPointsResponse command class
- **/
-class SubscribeWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief SubscribeWayPointsResponse class constructor
- **/
- SubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief SubscribeWayPointsResponse class destructor
- **/
- virtual ~SubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
deleted file mode 100644
index 1d163b6cd8..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
-
-#include <string>
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SystemRequest command class
- **/
-class SystemRequest : public CommandRequestImpl {
- public:
- /**
- * @brief SystemRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SystemRequest class destructor
- **/
- virtual ~SystemRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief Validates data coming within QueryApps response
- * @param data Data
- * @return true, if data is valid, otherwise - false
- */
- bool ValidateQueryAppData(smart_objects::SmartObject& data) const;
-
- private:
- static uint32_t index;
- std::string processing_file_;
- DISALLOW_COPY_AND_ASSIGN(SystemRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
deleted file mode 100644
index efee210b7b..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief SystemResponse command class
- **/
-class SystemResponse : public CommandResponseImpl {
- public:
- /**
- * @brief SystemResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief SystemResponse class destructor
- **/
- virtual ~SystemResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SystemResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
deleted file mode 100644
index acc7374e18..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief Unregister app interface request command class
- **/
-class UnregisterAppInterfaceRequest : public CommandRequestImpl {
- public:
- /**
- * \brief UnregisterAppInterfaceRequest class constructor
- **/
- UnregisterAppInterfaceRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
- /**
- * \brief UnregisterAppInterfaceRequest class destructor
- **/
- virtual ~UnregisterAppInterfaceRequest() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
- // virtual void cleanUp() = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
deleted file mode 100644
index 1a459e109c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-namespace commands {
-/**
- * @brief Unregister app interface request command class
- **/
-class UnregisterAppInterfaceResponse : public CommandResponseImpl {
- public:
- /**
- * \brief UnregisterAppInterfaceResponse class constructor
- **/
- UnregisterAppInterfaceResponse(const MessageSharedPtr& response,
- ApplicationManager& application_manager)
- : CommandResponseImpl(response, application_manager) {}
-
- /**
- * \brief UnregisterAppInterfaceResponse class destructor
- **/
- virtual ~UnregisterAppInterfaceResponse() {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
deleted file mode 100644
index 62600d51d7..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeButtonRequest command class
- **/
-class UnsubscribeButtonRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UnsubscribeButtonRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeButtonRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeButtonRequest class destructor
- **/
- virtual ~UnsubscribeButtonRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- /**
- * @brief Sends ButtonSubscription notification
- * to notify HMI that app unsubscribed from the button.
- */
- void SendUnsubscribeButtonNotification();
-
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
deleted file mode 100644
index 06dbe84578..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeButtonResponse command class
- **/
-class UnsubscribeButtonResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UnsubscribeButtonResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeButtonResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeButtonResponse class destructor
- **/
- virtual ~UnsubscribeButtonResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
deleted file mode 100644
index a6bade2fd6..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeVehicleDataRequest command class
- **/
-class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UnsubscribeVehicleDataRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeVehicleDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataRequest class destructor
- **/
- virtual ~UnsubscribeVehicleDataRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
- private:
- /**
- * @brief Checks, if any app is subscribed for particular VI parameter
- * @param param_id VI parameter id
- * @return true, if there are registered apps subscribed for VI parameter,
- * otherwise - false
- */
- bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
-
- /**
- * @brief Adds VI parameters being unsubscribed by another or the same app to
- * response with appropriate results
- * @param msg_params 'message_params' response section reference
- */
- void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const;
-
- /**
- * @brief Allows to update hash after sending response to mobile.
- */
- void UpdateHash() const;
-
- /**
- * @brief VI parameters which still being subscribed by another apps after
- * particular app had been unsubscribed from these parameters
- */
- VehicleInfoSubscriptions vi_still_subscribed_by_another_apps_;
-
- /**
- * @brief VI parameters which had been unsubscribed already by particular app
- */
- VehicleInfoSubscriptions vi_already_unsubscribed_by_this_app_;
-
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
deleted file mode 100644
index a34a36688c..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeVehicleDataResponse command class
- **/
-class UnsubscribeVehicleDataResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UnsubscribeVehicleDataResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UnsubscribeVehicleDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UnsubscribeVehicleDataResponse class destructor
- **/
- virtual ~UnsubscribeVehicleDataResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
deleted file mode 100644
index 2831551667..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-class UnSubscribeWayPointsRequest : public CommandRequestImpl {
- public:
- /**
- * \brief UnSubscribeWayPointsRequest class constructor
- **/
- UnSubscribeWayPointsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief UnSubscribeWayPointsRequest class destructor
- **/
- virtual ~UnSubscribeWayPointsRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h
deleted file mode 100644
index 70211330a9..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UnsubscribeWayPointsResponse command class
- **/
-class UnsubscribeWayPointsResponse : public CommandResponseImpl {
- public:
- /**
- * \brief UnsubscribeWayPointsResponse class constructor
- **/
- UnsubscribeWayPointsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * \brief UnsubscribeWayPointsResponse class destructor
- **/
- virtual ~UnsubscribeWayPointsResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse);
-};
-
-} // commands
-
-} // application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
deleted file mode 100644
index e15e81caf5..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateTurnListRequest command class
- **/
-class UpdateTurnListRequest : public CommandRequestImpl {
- public:
- /**
- * @brief UpdateTurnListRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateTurnListRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateTurnListRequest class destructor
- **/
- virtual ~UpdateTurnListRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- virtual void on_event(const event_engine::Event& event);
-
- private:
- /**
- * @brief check correct parameter turnList
- *
- * @return TRUE if turnList is correct,
- * otherwise FALSE
- */
- bool CheckTurnListArray();
-
- /**
- * @brief Checks update turn list param
- * When type is String there is a check on the contents \t\n \\t \\n
- * @return if update turn list contains \t\n \\t \\n return TRUE,
- * FALSE otherwise
- */
- bool IsWhiteSpaceExist();
-
- DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
deleted file mode 100644
index 481ad9f219..0000000000
--- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-namespace commands {
-
-/**
- * @brief UpdateTurnListResponse command class
- **/
-class UpdateTurnListResponse : public CommandResponseImpl {
- public:
- /**
- * @brief UpdateTurnListResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UpdateTurnListResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- /**
- * @brief UpdateTurnListResponse class destructor
- **/
- virtual ~UpdateTurnListResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
new file mode 100644
index 0000000000..8bbbd0e3de
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationFromHMI : public CommandImpl {
+ public:
+ NotificationFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~NotificationFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotificationToMobile(const MessageSharedPtr& message);
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h
new file mode 100644
index 0000000000..96a8cdf1aa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/notification_to_hmi.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationToHMI : public CommandImpl {
+ public:
+ NotificationToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~NotificationToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
new file mode 100644
index 0000000000..927a45c6a6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
@@ -0,0 +1,100 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
+
+class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
+ public:
+ RequestFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~RequestFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ virtual void on_event(const event_engine::Event& event);
+ /**
+ * @brief SendResponse allows to send response to hmi
+ * @param correlation_id the correlation id for the rfesponse.
+ * @param function_id the function id for which response will be sent
+ * @param result_code the result code.
+ */
+ void SendResponse(const bool success,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code);
+
+ /**
+ * @brief SendResponse allows to send error response to hmi
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ * @param result_code the result code.
+ * @param error_message info message for error.
+ */
+ void SendErrorResponse(const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message);
+
+ private:
+ /**
+ * @brief Fills common parameters for SO
+ * @param message Contains SO for filling
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ */
+ void FillCommonParametersOfSO(
+ ns_smart_device_link::ns_smart_objects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
new file mode 100644
index 0000000000..91586a74ce
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Check if HMI's interface is available.
+ * @param application_manager contains application manager component
+ * @param interface contains name of HMI's interface
+ * @return true if interface is available otherwise return fasle.
+ */
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface);
+
+/**
+ * @brief Change interface state
+ * @param application_manager contains ApplicationManager instance
+ * @param response_from_hmi contains response from HMI
+ * @param interface contanins InterfaceID whose state is changed.
+ * @return true if field available exist and contains true in response params
+ * otherwise return false.
+ */
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface);
+
+class RequestToHMI : public CommandImpl {
+ public:
+ RequestToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~RequestToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendRequest();
+
+ /*
+ * @brief Retrieves application ID
+ */
+ inline uint32_t application_id() const {
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
new file mode 100644
index 0000000000..605d04067e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+namespace commands {
+
+class ResponseFromHMI : public CommandImpl {
+ public:
+ ResponseFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~ResponseFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponseToMobile(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
new file mode 100644
index 0000000000..aa43d2e6d1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
@@ -0,0 +1,66 @@
+
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
+
+class ResponseToHMI : public CommandImpl {
+ public:
+ ResponseToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ virtual ~ResponseToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
index 4cdbb902de..ed923369ac 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
@@ -118,7 +118,7 @@ class EventDispatcherImpl : public EventDispatcher {
private:
// Members section
sync_primitives::Lock state_lock_;
- sync_primitives::Lock observer_lock_;
+ sync_primitives::RecursiveLock observer_lock_;
EventObserverMap observers_event_;
ObserverVector observers_;
};
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager.h b/src/components/application_manager/include/application_manager/help_prompt_manager.h
new file mode 100644
index 0000000000..a0c34e77d7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
+
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+/**
+ * @brief The HelpPromptManager is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManager {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~HelpPromptManager() {}
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ virtual void OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) = 0;
+
+ /**
+ * @brief Requests sending type behavior
+ */
+ enum class SendingType { kNoneSend, kSendHelpPrompt, kSendVRHelp, kSendBoth };
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ virtual SendingType GetSendingType() const = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
new file mode 100644
index 0000000000..81754a60b0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
+
+#include "application_manager/help_prompt_manager.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "utils/lock.h"
+#include "utils/timer.h"
+
+namespace application_manager {
+
+class Application;
+class ApplicationManager;
+
+/**
+ * @brief The HelpPromptManagerImpl class implemented interface
+ * HelpPromptManager
+ * is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManagerImpl : public HelpPromptManager {
+ public:
+ /**
+ * @brief Container for buffering VR help commands
+ */
+ typedef std::pair<uint32_t, smart_objects::SmartObjectSPtr> VRCommandPair;
+ typedef std::vector<VRCommandPair> VRCommandPairs;
+
+ /**
+ * @brief Class constructor
+ * @param app owner for this class
+ */
+ HelpPromptManagerImpl(Application& app, ApplicationManager& app_manager);
+
+ /**
+ * @brief Class destructor
+ */
+ ~HelpPromptManagerImpl();
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg,
+ const bool is_response) OVERRIDE;
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ SendingType GetSendingType() const OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HelpPromptManagerImpl);
+
+ /**
+ * @brief Add new smart object with VR command to the map
+ * @param cmd_id ID of VR command
+ * @param command smart object containing VR command structure
+ * @return true if first kLimitCommand commands was changed after adding
+ * of the current command otherwise returns false
+ */
+ bool AddCommand(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command);
+ /**
+ * @brief Delete VR command from map by its cmd_id
+ * @param cmd_id ID of VR command
+ * @return true if first kLimitCommand commands was changed after deleting
+ * of the current command otherwise returns false
+ */
+ bool DeleteCommand(const uint32_t cmd_id);
+
+ /**
+ * @brief Send TTS request to HMI
+ */
+ void SendTTSRequest();
+
+ /**
+ * @brief Send UI request to HMI
+ */
+ void SendUIRequest();
+
+ /**
+ * @brief Send TTS and UI requests to HMI
+ */
+ void SendBothRequests();
+
+ /**
+ * @brief Send TTS or UI or both Requests
+ */
+ void SendRequests();
+
+ /**
+ * @brief Construct the helpPrompt parameter
+ */
+ void CreatePromptMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Construct the vrHelp parameter
+ */
+ void CreateVRMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Setting request type to send HMI
+ * @param msg containing request or response for the
+ * SetGlobalPropertiesRequest
+ */
+ void SetSendingType(const smart_objects::SmartObject& msg);
+
+ /**
+ * @brief Get the total count of commands in VRCommand pairs
+ * @param end_element pointer to VRCommandPairs element to which commands
+ * should be counted
+ * @return total count of commands
+ */
+ size_t GetCommandsCount(VRCommandPairs::const_iterator end_element) const;
+
+ /**
+ * @brief Generate help prompt/vr help items array and write it into provided
+ * smart object
+ * @param out_msg_params output smart object
+ * @param vr_key name of vr item in response
+ */
+ void GenerateVrItems(smart_objects::SmartObject& out_msg_params,
+ const char* vr_key) const;
+
+ Application& app_;
+ ApplicationManager& app_manager_;
+ VRCommandPairs vr_commands_;
+ sync_primitives::Lock vr_commands_lock_;
+ SendingType sending_type_;
+ bool is_tts_send_;
+ bool is_ui_send_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/helpers/application_helper.h b/src/components/application_manager/include/application_manager/helpers/application_helper.h
new file mode 100644
index 0000000000..145bef659e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/helpers/application_helper.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+
+/*
+ * This file is for code w/o direct usage of ApplicationManagerImpl internals
+ */
+namespace application_manager {
+
+/**
+ * Helper function for lookup through applications list and returning first
+ * application satisfying predicate logic
+ */
+template <class UnaryPredicate>
+ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor,
+ UnaryPredicate finder) {
+ ApplicationSet::iterator it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ if (accessor.GetData().end() == it) {
+ return ApplicationSharedPtr();
+ }
+ ApplicationSharedPtr app = *it;
+ return app;
+}
+
+/**
+ * Helper function for lookup through applications list and returning all
+ * applications satisfying predicate logic
+ */
+template <class UnaryPredicate>
+std::vector<ApplicationSharedPtr> FindAllApps(
+ DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) {
+ std::vector<ApplicationSharedPtr> result;
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ while (it != accessor.GetData().end()) {
+ result.push_back(*it);
+ it = std::find_if(++it, accessor.GetData().end(), finder);
+ }
+ return result;
+}
+
+/**
+ * @brief RecallApplicationData cleans up data within application instance to
+ * its initial state and notifies HMI to delete same data on its side
+ * @param app Application to clean its data
+ * @param app_manager Application manager
+ */
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager);
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
index 7a85c49027..9380fb41ac 100644
--- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
@@ -91,6 +91,9 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ivi_cooperating() const OVERRIDE;
void set_is_ivi_cooperating(const bool value) OVERRIDE;
+ bool is_rc_cooperating() const OVERRIDE;
+ void set_is_rc_cooperating(const bool value) OVERRIDE;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -407,6 +410,89 @@ class HMICapabilitiesImpl : public HMICapabilities {
*/
bool phone_call_supported() const OVERRIDE;
+ /*
+ * @brief Interface to store whether HMI supports video streaming
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ void set_video_streaming_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves whether HMI supports video streaming
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool video_streaming_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface to store whether HMI supports remote control
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ void set_rc_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves whether HMI supports remote control
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool rc_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the navigation "System Capability"
+ *
+ * @param navigation_capability contains information related
+ * to the navigation system capability.
+ */
+ void set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves information regarding the navigation system capability
+ *
+ * @return NAVIGATION system capability
+ */
+ const smart_objects::SmartObject* navigation_capability() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the phone "System Capability"
+ *
+ * @param phone_capability contains information related
+ * to the phone system capability.
+ */
+ void set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves information regarding the phone call system capability
+ *
+ * @return PHONE_CALL system capability
+ */
+
+ const smart_objects::SmartObject* phone_capability() const OVERRIDE;
+
+ /*
+ * @brief Sets HMI's video streaming related capability information
+ *
+ * @param video_streaming_capability the video streaming related capabilities
+ */
+ void set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves HMI's video streaming related capabilities
+ *
+ * @return HMI's video streaming related capability information
+ */
+ const smart_objects::SmartObject* video_streaming_capability() const OVERRIDE;
+
+ void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) OVERRIDE;
+
+ const smart_objects::SmartObject* rc_capability() const OVERRIDE;
+
void Init(resumption::LastState* last_state) OVERRIDE;
/*
@@ -462,6 +548,7 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ui_cooperating_;
bool is_navi_cooperating_;
bool is_ivi_cooperating_;
+ bool is_rc_cooperating_;
bool attenuated_supported_;
hmi_apis::Common_Language::eType ui_language_;
@@ -483,7 +570,13 @@ class HMICapabilitiesImpl : public HMICapabilities {
smart_objects::SmartObject* prerecorded_speech_;
bool is_navigation_supported_;
bool is_phone_call_supported_;
+ bool is_video_streaming_supported_;
+ bool is_rc_supported_;
std::string ccpu_version_;
+ smart_objects::SmartObject* navigation_capability_;
+ smart_objects::SmartObject* phone_capability_;
+ smart_objects::SmartObject* video_streaming_capability_;
+ smart_objects::SmartObject* rc_capability_;
ApplicationManager& app_mngr_;
HMILanguageHandler hmi_language_handler_;
diff --git a/src/components/application_manager/include/application_manager/hmi_command_factory.h b/src/components/application_manager/include/application_manager/hmi_command_factory.h
deleted file mode 100644
index 6603563c6d..0000000000
--- a/src/components/application_manager/include/application_manager/hmi_command_factory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
-
-#include "application_manager/commands/command.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
-class ApplicationManager;
-/**
- * @brief Factory class for command creation
- **/
-class HMICommandFactory {
- public:
- /**
- * @brief Create command object and return pointer to it
- *
- * @param smartObject SmartObject shared pointer.
- * @return Pointer to created command object.
- **/
- static CommandSharedPtr CreateCommand(
- const commands::MessageSharedPtr& message,
- ApplicationManager& application_manager);
-
- private:
- HMICommandFactory();
- DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h
index df1e2a9067..59ec32694a 100644
--- a/src/components/application_manager/include/application_manager/hmi_interfaces.h
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -59,7 +59,8 @@ class HmiInterfaces {
HMI_INTERFACE_UI,
HMI_INTERFACE_Navigation,
HMI_INTERFACE_VehicleInfo,
- HMI_INTERFACE_SDL
+ HMI_INTERFACE_SDL,
+ HMI_INTERFACE_RC
};
/**
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index 799fdff67d..07d9c8dc23 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -33,16 +33,19 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
+#include <iosfwd>
#include <list>
+#include <memory>
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
+#include "utils/macro.h"
namespace application_manager {
class HmiState;
class ApplicationManager;
+class Application;
-typedef utils::SharedPtr<HmiState> HmiStatePtr;
+typedef std::shared_ptr<HmiState> HmiStatePtr;
/**
* @brief The HmiState class
@@ -51,10 +54,12 @@ typedef utils::SharedPtr<HmiState> HmiStatePtr;
*
*/
class HmiState {
+ friend std::ostream& operator<<(std::ostream& os, const HmiState& src);
+
public:
/**
* @brief The StateID enum describes state of application
- * If no events occured STATE_ID_DEFAULT shuld be presented
+ * If no events occurred STATE_ID_DEFAULT should be presented
*/
enum StateID {
STATE_ID_CURRENT,
@@ -64,14 +69,28 @@ class HmiState {
STATE_ID_SAFETY_MODE,
STATE_ID_VR_SESSION,
STATE_ID_TTS_SESSION,
+ STATE_ID_VIDEO_STREAMING,
STATE_ID_NAVI_STREAMING,
STATE_ID_DEACTIVATE_HMI,
STATE_ID_AUDIO_SOURCE,
STATE_ID_EMBEDDED_NAVI
};
- HmiState(uint32_t app_id, const ApplicationManager& app_mngr);
- HmiState(uint32_t app_id,
+ /**
+ * @brief HmiState constructor
+ * @param app Application pointer
+ * @param app_mngr Application manager
+ */
+ HmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ /**
+ * @brief HmiState constructor
+ * @param app Application pointer
+ * @param app_mngr Application manager
+ * @param state_id HMI state to assign
+ */
+ HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id);
@@ -120,6 +139,28 @@ class HmiState {
}
return audio_streaming_state_;
}
+
+ /**
+ * @brief video_streaming_state
+ * @return return video streaming state member
+ */
+ virtual mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const {
+ if (parent_) {
+ return parent_->video_streaming_state();
+ }
+ return video_streaming_state_;
+ }
+
+ /**
+ * @brief set_video_streaming_state set set_video_streaming_state member
+ * @param video_state video_state to setup
+ */
+ virtual void set_video_streaming_state(
+ mobile_apis::VideoStreamingState::eType video_state) {
+ video_streaming_state_ = video_state;
+ }
+
/**
* @brief set_audio_streaming_state set audio_streaming_state member
* @param audio_state audio_state to setup
@@ -161,40 +202,45 @@ class HmiState {
* @brief set_state_id sets state id
* @param state_id state id to setup
*/
- virtual void set_state_id(StateID state_id) {
+ void set_state_id(StateID state_id) {
state_id_ = state_id;
}
protected:
- uint32_t app_id_;
+ std::shared_ptr<Application> app_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::VideoStreamingState::eType video_streaming_state_;
mobile_apis::SystemContext::eType system_context_;
protected:
/**
* @brief is_navi_app check if app is navi
- * @param app_id application id
* @return true if app is navi, otherwise return false
*/
- bool is_navi_app(const uint32_t app_id) const;
+ bool is_navi_app() const;
/**
* @brief is_media_app check if app is media
- * @param app_id application id
* @return true if media_app, otherwise return false
*/
- bool is_media_app(const uint32_t app_id) const;
+ bool is_media_app() const;
/**
* @brief is_voice_communicationn_app check if app is voice comunication
- * @param app_id application id
* @return true if voice_communicationn_app, otherwise return false
*/
- bool is_voice_communication_app(const uint32_t app_id) const;
+ bool is_voice_communication_app() const;
+
+ /**
+ * @brief is_mobile_projection_app checks if application of 'projection'
+ * HMI type
+ * @return True if application is of 'projection' HMI type, otherwise - false
+ */
+ bool is_mobile_projection_app() const;
private:
void operator=(const HmiState&);
@@ -207,7 +253,8 @@ class VRHmiState : public HmiState {
public:
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
- VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ VRHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
};
/**
@@ -215,18 +262,35 @@ class VRHmiState : public HmiState {
*/
class TTSHmiState : public HmiState {
public:
- TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ TTSHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
/**
- * @brief The NaviStreamingState class implements logic of NaviStreaming
+ * @brief The VideoStreamingState class implements logic of video streaming
* temporary state
*/
-class NaviStreamingHmiState : public HmiState {
+class VideoStreamingHmiState : public HmiState {
public:
- NaviStreamingHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ VideoStreamingHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE;
+};
+
+/**
+ * @brief The NaviStreamingHmiState class implements logic of navigation
+ * streaming temporary state that is more specific than VideoStreamingHmiState
+ */
+class NaviStreamingHmiState : public VideoStreamingHmiState {
+ public:
+ NaviStreamingHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
@@ -237,7 +301,9 @@ class NaviStreamingHmiState : public HmiState {
*/
class PhoneCallHmiState : public HmiState {
public:
- PhoneCallHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ PhoneCallHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -251,11 +317,17 @@ class PhoneCallHmiState : public HmiState {
*/
class SafetyModeHmiState : public HmiState {
public:
- SafetyModeHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ SafetyModeHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
/**
@@ -264,12 +336,18 @@ class SafetyModeHmiState : public HmiState {
*/
class DeactivateHMI : public HmiState {
public:
- DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr);
+ DeactivateHMI(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
/**
@@ -278,12 +356,21 @@ class DeactivateHMI : public HmiState {
*/
class AudioSource : public HmiState {
public:
- AudioSource(uint32_t app_id, const ApplicationManager& app_mngr);
+ AudioSource(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
+
+ private:
+ bool keep_context_;
};
/**
@@ -293,12 +380,36 @@ class AudioSource : public HmiState {
*/
class EmbeddedNavi : public HmiState {
public:
- EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr);
+ EmbeddedNavi(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
}
+ mobile_apis::VideoStreamingState::eType video_streaming_state()
+ const OVERRIDE {
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ }
};
-}
+
+/**
+ * @brief Outputs StateID to ostream in human readable format
+ * @param os output stream to insert data to
+ * @param src StateID value to output
+ * @return os
+ */
+std::ostream& operator<<(std::ostream& os, const HmiState::StateID src);
+
+/**
+ * @brief Outputs HmiState to ostream in human readable format
+ * @param os output stream to insert data to
+ * @param src HmiState value to output
+ * @return os
+ */
+std::ostream& operator<<(std::ostream& os, const HmiState& src);
+
+} // namespace application_manager
+
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index fe903393fb..1c319cf204 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,9 +36,9 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "protocol/message_priority.h"
#include "protocol/rpc_type.h"
+#include "protocol/common.h"
#include "smart_objects/smart_object.h"
namespace application_manager {
@@ -57,30 +57,22 @@ enum MessageType {
// Map PrcType to corresponding MessageType
MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type);
-enum ProtocolVersion {
- kUnknownProtocol = -1,
- kHMI = 0,
- kV1 = 1,
- kV2 = 2,
- kV3 = 3,
- kV4 = 4
-};
-
class Message {
public:
- Message(protocol_handler::MessagePriority priority);
+ explicit Message(protocol_handler::MessagePriority priority);
Message(const Message& message);
Message& operator=(const Message& message);
- bool operator==(const Message& message);
+ bool operator==(const Message& message) const;
~Message();
//! --------------------------------------------------------------------------
int32_t function_id() const;
+ std::string function_name() const;
int32_t correlation_id() const;
int32_t connection_key() const;
MessageType type() const;
- ProtocolVersion protocol_version() const;
+ protocol_handler::MajorProtocolVersion protocol_version() const;
const std::string& json_message() const;
const BinaryData* binary_data() const;
@@ -89,18 +81,24 @@ class Message {
size_t payload_size() const;
const smart_objects::SmartObject& smart_object() const;
- //! --------------------------------------------------------------------------
+ //!
+ //--------------------------------------------------------------------------.
void set_function_id(int32_t id);
+ void set_function_name(const std::string& name);
void set_correlation_id(int32_t id);
void set_connection_key(int32_t key);
void set_message_type(MessageType type);
- void set_binary_data(BinaryData* data);
+ void set_binary_data(const BinaryData* data);
void set_json_message(const std::string& json_message);
- void set_protocol_version(ProtocolVersion version);
+ void set_protocol_version(protocol_handler::MajorProtocolVersion version);
void set_smart_object(const smart_objects::SmartObject& object);
void set_data_size(size_t data_size);
void set_payload_size(size_t payload_size);
+ static bool is_sufficient_version(
+ protocol_handler::MajorProtocolVersion minVersion,
+ protocol_handler::MajorProtocolVersion version);
+
protocol_handler::MessagePriority Priority() const {
return priority_;
}
@@ -109,6 +107,7 @@ class Message {
int32_t function_id_; // @remark protocol V2.
int32_t correlation_id_; // @remark protocol V2.
MessageType type_; // @remark protocol V2.
+ std::string function_name_;
// Pre-calculated message priority, higher priority messages are
// Processed first
@@ -122,8 +121,11 @@ class Message {
BinaryData* binary_data_;
size_t data_size_;
size_t payload_size_;
- ProtocolVersion version_;
+ protocol_handler::MajorProtocolVersion version_;
};
+
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MessagePtr;
} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 0ea4fc8ca5..609b240301 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -2,6 +2,9 @@
Copyright (c) 2015, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -42,11 +45,12 @@
#include "utils/macro.h"
#include "connection_handler/device.h"
#include "application_manager/application.h"
-#include "application_manager/vehicle_info_data.h"
#include "policy/policy_types.h"
#include "protocol_handler/session_observer.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "smart_objects/smart_object.h"
+#include "transport_manager/common.h"
+#include <application_manager/smart_object_keys.h>
namespace policy {
class PolicyHandlerInterface;
@@ -61,7 +65,7 @@ namespace mobile_api = mobile_apis;
* @param const char* Name of the parameter in mobile request
* @param VehicleDataType Enum for vehicle data
*/
-typedef std::map<std::string, VehicleDataType> VehicleData;
+typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
/**
* @brief MessageHelper class
@@ -69,7 +73,23 @@ typedef std::map<std::string, VehicleDataType> VehicleData;
class MessageHelper {
public:
/**
- * @brief Creates request for different interfaces(JSON, DBUS)
+ * @brief CreateNotification creates basic mobile notification smart object
+ * @param function_id Notification function ID
+ * @param app_id application to send notification
+ * @return basic mobile notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id);
+ /**
+ * @brief CreateHMINotification creates basic hmi notification smart object
+ * @param function_id Notification function ID
+ * @return basic hmi notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id);
+
+ /**
+ * @brief Creates request for different interfaces(JSON)
* @param correlation_id unique ID
* @param params Vector of arguments that we need in GetVehicleData request
* (e.g. gps, odometer, fuel_level)
@@ -104,6 +124,15 @@ class MessageHelper {
static void SendDecryptCertificateToHMI(const std::string& file_name,
ApplicationManager& app_mngr);
+ /**
+ * @brief SendGetSystemTimeRequest sends mentioned request to HMI.
+ * @param correlation_id the message correlation id, required for proper
+ * response processing.
+ * @param app_mngr
+ */
+ static void SendGetSystemTimeRequest(const uint32_t correlation_id,
+ ApplicationManager& app_mngr);
+
/*
* @brief Retrieve vehicle data map for param name in mobile request
* to VehicleDataType
@@ -137,6 +166,9 @@ class MessageHelper {
static std::string MobileResultToString(
mobile_apis::Result::eType mobile_result);
+ static std::string GetDeviceMacAddressForHandle(
+ const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr);
/**
* @brief Converts string to mobile Result enum value
* @param mobile_result stringified value
@@ -212,18 +244,6 @@ class MessageHelper {
const std::string& path_to_icon, uint32_t app_id);
/**
- * @brief Sends IVI subscription requests
- */
- static bool SendIVISubscribtions(const uint32_t app_id,
- ApplicationManager& app_mngr);
-
- /**
- * @brief Returns IVI subscription requests
- */
- static smart_objects::SmartObjectList GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr);
-
- /**
* @brief Sends button subscription notification
*/
static void SendOnButtonSubscriptionNotification(
@@ -283,6 +303,24 @@ class MessageHelper {
ApplicationManager& app_mngr);
/*
+ * @brief Create Common.DeviceInfo struct from device handle
+ * @param device_handle device handle of the app
+ * @param session_observer instance of SessionObserver to retrieve device
+ * information
+ * @param policy_handler instance of PolicyHandlerInterface to get the value
+ * of 'isSDLAllowed'
+ * @param app_mngr instance of ApplicationManager
+ * @param output smart object to store created Common.DeviceInfo struct
+ * @return true on success, false otherwise
+ */
+ static bool CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output);
+
+ /*
* @brief Create Common.HMIApplication struct application instance
* @param app : applicaton instace
* @param output smart object to store Common.HMIApplication struct
@@ -310,7 +348,7 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -359,15 +397,36 @@ class MessageHelper {
uint32_t correlation_id,
ApplicationManager& app_mngr);
- /**
- * @brief Send GetListOfPermissions response to HMI
- * @param permissions Array of groups permissions
- * @param correlation_id Correlation id of request
- */
+/**
+ * @brief Send GetListOfPermissions response to HMI
+ * @param permissions Array of groups permissions
+ * @param external_consent_status External user consent status
+ * @param correlation_id Correlation id of request
+ */
+#ifdef EXTERNAL_PROPRIETARY_MODE
static void SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
- uint32_t correlation_id,
+ const policy::ExternalConsentStatus& external_consent_status,
+ const uint32_t correlation_id,
ApplicationManager& app_mngr);
+#else
+ static void SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ const uint32_t correlation_id,
+ ApplicationManager& app_mngr);
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+ /*
+ * @brief Sends SetVideoConfig request to HMI to negotiate video parameters
+ *
+ * @param app_id the application which will start video streaming
+ * @param app_mngr reference of application manager
+ * @param video_params parameters of video streaming, notified by mobile
+ */
+ static void SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params);
/*
* @brief Sends notification to HMI to start video streaming
@@ -401,7 +460,7 @@ class MessageHelper {
static void SendSystemRequestNotification(
uint32_t connection_key,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& content,
+ ns_smart_device_link::ns_smart_objects::SmartObject& content,
ApplicationManager& app_mngr);
/**
@@ -509,7 +568,7 @@ class MessageHelper {
/**
* @brief Sends UnsubscribeWayPoints request
- * @return true if UnSubscribedWayPoints is send otherwise false
+ * @return true if UnsubscribedWayPoints is send otherwise false
*/
static bool SendUnsubscribedWayPoints(ApplicationManager& app_mngr);
@@ -519,6 +578,48 @@ class MessageHelper {
const uint32_t correlation_id,
int32_t result_code);
+ /**
+ * @brief Get the full file path of an app file
+ *
+ * @param file_name The relative path of an application file
+ * @param app Current application
+ * @param app_mngr Application manager
+ *
+ * @return The full file path of the application file if valid,
+ * empty string otherwise
+ */
+ static std::string GetAppFilePath(std::string file_name,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief Verify that all ttsChunks with FILE type
+ * in an array include an existing file and set full path
+ *
+ * @param tts_chunks SmartObject with an array of TTSChunks
+ * @param app Current application
+ * @param app_mngr Application manager
+ *
+ * @return FILE_NOT_FOUND if one of the TTSChunks
+ * included a file which wasn't present on disk,
+ * SUCCESS otherwise
+ */
+ static mobile_apis::Result::eType VerifyTtsFiles(
+ smart_objects::SmartObject& tts_chunks,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief Verify image and add image file full path
+ * and add path, although the image doesn't exist
+ * @param SmartObject with image
+ * @param app current application
+ * @return verification result
+ */
+ static void ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
/*
* @brief Verify image and add image file full path
*
@@ -534,6 +635,21 @@ class MessageHelper {
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr);
+ /**
+ * @brief Stores whether each choice in a set has the vrCommands parameter
+ * MIXED means some choices have vrCommands and others don't
+ * ALL means all do, NONE means none do
+ */
+ enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE };
+
+ /**
+ * @brief Check whether each choice in the set has the vrCommands parameter
+ * @param choice set to check
+ * @return a ChoiceSetVRCommandsStatus with the state of the choice set
+ */
+ static ChoiceSetVRCommandsStatus CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set);
+
/*
* @brief Finds "Image" structure in request and verify image file presence
* in Core.
@@ -562,7 +678,7 @@ class MessageHelper {
* @return returns FALSE if string contains incorrect character or
* string is empty otherwise returns TRUE
*/
- static bool VerifySoftButtonString(const std::string& str);
+ static bool VerifyString(const std::string& str);
static mobile_apis::Result::eType ProcessSoftButtons(
smart_objects::SmartObject& message_params,
@@ -584,6 +700,14 @@ class MessageHelper {
ApplicationSharedPtr app,
int32_t function_id);
+ /**
+ * @brief Prints SmartObject contents to log file
+ * @param object - SmartObject to print
+ * @return always True as this function is used for internal debug purposes
+ * only
+ * @note Function prints SmartObject only in DEBUG build mode. There will not
+ * be any print in RELEASE build mode
+ */
static bool PrintSmartObject(const smart_objects::SmartObject& object);
template <typename From, typename To>
@@ -667,15 +791,95 @@ class MessageHelper {
int32_t connection_key,
mobile_api::AppInterfaceUnregisteredReason::eType reason);
- private:
/**
- * @brief Creates new request object and fill its header
- * @return New request object
+ * @brief SendDeleteCommandRequest sends requests to HMI to remove UI/VR
+ * command data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning the command data
+ * @param app_mngr Application manager
+ */
+ static void SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendDeleteSubmenuRequest sends UI/VR requests to HMI to remove
+ * submenues-related data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning the commmand data
+ * @param app_mngr Application manager
*/
- static smart_objects::SmartObjectSPtr CreateRequestObject(
- const uint32_t correlation_id);
+ static void SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
/**
+ * @brief SendDeleteChoiceSetRequest sends requests to HMI to remove
+ * choice sets - related data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning command data
+ * @param app_mngr Application manager
+ */
+ static void SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendResetPropertiesRequest sends requests to HMI to remove/reset
+ * global properties for application
+ * @param application Application to remove/reset global properties for
+ * @param app_mngr Application manager
+ */
+ static void SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendUnsubscribeButtonNotification sends notification to HMI to
+ * remove button subscription for application
+ * @param button Button type
+ * @param application Application to unsubscribe
+ * @param app_mngr Application manager
+ */
+ static void SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief Sends HMI status notification to mobile
+ * @param application_impl application with changed HMI status
+ **/
+ static void SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief SendActivateAppToHMI Sends BasicCommunication.ActivateApp request to
+ * HMI
+ * @param app_id Application id
+ * @param application_manager Application manager
+ * @param level Application HMI level
+ * @param send_policy_priority Defines whether to send "priority" field with
+ * request
+ */
+ static void SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL,
+ bool send_policy_priority = true);
+
+ /**
+ * @brief CreateMessageForHMI Creates HMI message with prepared header
+ * acccoring to message type
+ * @param message_type Message type
+ * @param correlation_id Correlation id
+ * @return HMI message object with filled header
+ */
+ static smart_objects::SmartObjectSPtr CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id);
+
+ private:
+ /**
* @brief Allows to fill SO according to the current permissions.
* @param permissions application permissions.
* @param message which should be filled.
diff --git a/src/components/application_manager/include/application_manager/mobile_command_factory.h b/src/components/application_manager/include/application_manager/mobile_command_factory.h
deleted file mode 100644
index 1f270b28db..0000000000
--- a/src/components/application_manager/include/application_manager/mobile_command_factory.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
-
-#include "application_manager/commands/command.h"
-#include "utils/macro.h"
-
-namespace application_manager {
-
-typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
-class ApplicationManager;
-
-/**
- * @brief Factory class for command creation
- **/
-class MobileCommandFactory {
- public:
- /**
- * @brief Create command object and return pointer to it
- *
- * @param smartObject SmartObject shared pointer.
- * @return Pointer to created command object.
- **/
- static CommandSharedPtr CreateCommand(
- const commands::MessageSharedPtr& message,
- commands::Command::CommandOrigin origin,
- ApplicationManager& application_manager);
-
- private:
- MobileCommandFactory();
- DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
index ad660d0b66..b2ad963f46 100644
--- a/src/components/application_manager/include/application_manager/mobile_message_handler.h
+++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h
@@ -38,7 +38,7 @@
#include "application_manager/message.h"
namespace application_manager {
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
class MobileMessageHandler {
public:
static application_manager::Message* HandleIncomingMessageProtocol(
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
new file mode 100644
index 0000000000..09a412b2ac
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h
@@ -0,0 +1,125 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
+#include <memory>
+#include "utils/macro.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/application.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace application_manager {
+class CommandFactory;
+
+namespace plugin_manager {
+
+/**
+ * @brief The PolicyEvent enum defines events related to policy
+ */
+enum PolicyEvent { kApplicationPolicyUpdated = 0, kApplicationsDisabled };
+
+/**
+ * @brief The ApplicationEvent enum defines events related to single application
+ */
+enum ApplicationEvent {
+ kApplicationExit = 0,
+ kApplicationRegistered,
+ kApplicationUnregistered,
+ kDeleteApplicationData
+};
+
+class RPCPlugin {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~RPCPlugin() {}
+
+ /**
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
+ virtual bool Init(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) = 0;
+ /**
+ * @brief IsAbleToProcess check if plugin is able to process function
+ * @param function_id RPC identifier
+ * @param message_source source of message to process (from HMI from mobile
+ * ...)
+ * @return true if plugin is able to process this RPC, false if not
+ */
+ virtual bool IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) = 0;
+
+ /**
+ * @brief PluginName plugin name
+ * @return plugin name
+ */
+ virtual std::string PluginName() = 0;
+
+ /**
+ * @brief GetCommandFactory get that is able to generate command
+ * from message
+ * @return plugins command factory
+ */
+ virtual CommandFactory& GetCommandFactory() = 0;
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(PolicyEvent event) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+};
+typedef std::unique_ptr<RPCPlugin> RPCPluginPtr;
+
+} // namespace plugin_manager
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
new file mode 100644
index 0000000000..692d296607
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h
@@ -0,0 +1,83 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
+#include <cstdint>
+#include <string>
+#include <memory>
+#include <vector>
+#include <functional>
+
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "utils/optional.h"
+namespace application_manager {
+namespace plugin_manager {
+
+class RPCPluginManager {
+ public:
+ virtual ~RPCPluginManager() {}
+ /**
+ * @brief LoadPlugins load plugins from plugin folder.
+ * Already loaded plugins should continue be loaded.
+ *
+ * @param plugin_folder folder to search for plugins
+ * @return amount of loaded plugins
+ */
+ virtual uint32_t LoadPlugins(const std::string& plugins_path) = 0;
+
+ /**
+ * @brief GetPlugins get list of plugins
+ * @return list of loaded plugins
+ */
+ virtual std::vector<RPCPluginPtr>& GetPlugins() = 0;
+
+ /**
+ * @brief FindPluginToProcess find plugin to process message
+ * @param function_id RPC identifier to process
+ * @param message_source message_source source of message to process
+ * @return plugin that is able to process the message
+ */
+ virtual utils::Optional<RPCPlugin> FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) = 0;
+
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ virtual void ForEachPlugin(std::function<void(RPCPlugin&)> functor) = 0;
+};
+} // namespace plugin_manager
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H
diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
new file mode 100644
index 0000000000..5f85d45b6e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/optional.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+class RPCPluginManagerImpl : public RPCPluginManager {
+ // RPCPluginManager interface
+ public:
+ /**
+ * @brief RPCPluginManagerImpl class constructor
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ **/
+ RPCPluginManagerImpl(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ uint32_t LoadPlugins(const std::string& plugins_path) OVERRIDE;
+ std::vector<RPCPluginPtr>& GetPlugins() OVERRIDE;
+ utils::Optional<RPCPlugin> FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) OVERRIDE;
+
+ private:
+ std::vector<RPCPluginPtr> loaded_plugins_;
+ ApplicationManager& app_manager_;
+ rpc_service::RPCService& rpc_service_;
+ HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ // RPCPluginManager interface
+ public:
+ void ForEachPlugin(std::function<void(RPCPlugin&)> functor) OVERRIDE;
+};
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H
diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
index 544628117a..f501598e0f 100644
--- 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
@@ -58,6 +58,7 @@ class AppPermissionDelegate : public threads::ThreadDelegate {
*/
AppPermissionDelegate(const uint32_t connection_key,
const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status,
policy::PolicyHandlerInterface& policy_handler);
/**
@@ -75,6 +76,7 @@ class AppPermissionDelegate : public threads::ThreadDelegate {
private:
uint32_t connection_key_;
PermissionConsent permissions_;
+ ExternalConsentStatus external_consent_status_;
policy::PolicyHandlerInterface& policy_handler_;
};
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 c4f45cc1ee..c8f3bcf888 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -65,8 +65,9 @@ class ApplicationManager;
}
namespace policy {
+
typedef std::vector<uint32_t> AppIds;
-typedef std::vector<uint32_t> DeviceHandles;
+typedef std::vector<transport_manager::DeviceHandle> DeviceHandles;
namespace custom_str = utils::custom_string;
class PolicyHandler : public PolicyHandlerInterface,
@@ -102,15 +103,80 @@ class PolicyHandler : public PolicyHandlerInterface,
#endif // EXTERNAL_PROPRIETARY_MODE
virtual bool GetPriority(const std::string& policy_app_id,
std::string* priority) const OVERRIDE;
- void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) OVERRIDE;
+ virtual void CheckPermissions(
+ const application_manager::ApplicationSharedPtr app,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
virtual DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Sets HMI default type for specified application
+ * @param application_id ID application
+ * @param app_types list of HMI types
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const smart_objects::SmartObject* app_types) OVERRIDE;
+
+ /**
+ * Checks if application has HMI type
+ * @param application_id ID application
+ * @param hmi HMI type to check
+ * @param app_types additional list of HMI type to search in it
+ * @return true if hmi is contained in policy or app_types
+ */
+ bool CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) OVERRIDE;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) OVERRIDE;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Notifies Remote apps about change in HMI status
+ * @param device_id Device on which app is running
+ * @param policy_app_id ID of application
+ * @param hmi_level new HMI level for this application
+ */
+ void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) OVERRIDE;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+
bool GetDefaultHmi(const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
bool GetInitialAppData(const std::string& application_id,
@@ -122,15 +188,25 @@ class PolicyHandler : public PolicyHandlerInterface,
EndpointUrls& out_end_points) OVERRIDE;
virtual std::string GetLockScreenIconUrl() const OVERRIDE;
uint32_t NextRetryTimeout() OVERRIDE;
- uint32_t TimeoutExchangeSec() OVERRIDE;
- uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeSec() const OVERRIDE;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in miliseconds
+ */
+ uint32_t TimeoutExchangeMSec() const OVERRIDE;
void OnExceededTimeout() OVERRIDE;
void OnSystemReady() OVERRIDE;
void PTUpdatedAt(Counters counter, int value) OVERRIDE;
void add_listener(PolicyHandlerObserver* listener) OVERRIDE;
void remove_listener(PolicyHandlerObserver* listener) OVERRIDE;
- utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager()
+ std::shared_ptr<usage_statistics::StatisticsManager> GetStatisticManager()
const OVERRIDE;
/**
@@ -193,14 +269,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
@@ -329,9 +423,12 @@ 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
+ * @param hmi_types list of hmi types
+ * @return function that will notify update manager about new application
*/
- StatusNotifier 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
@@ -366,7 +463,7 @@ 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
@@ -388,6 +485,32 @@ class PolicyHandler : public PolicyHandlerInterface,
mobile_apis::RequestType::eType type) const OVERRIDE;
/**
+ * @brief Checks if certain request subtype is allowed for application
+ * @param policy_app_id Unique applicaion id
+ * @param request_subtype Request subtype
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const OVERRIDE;
+
+ /**
+ * @brief Gets application request types state
+ * @param policy_app_id Unique application id
+ * @return request types state
+ */
+ RequestType::State GetAppRequestTypeState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Gets application request subtypes state
+ * @param policy_app_id Unique application id
+ * @return request subtypes state
+ */
+ RequestSubType::State GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets application request types
* @param policy_app_id Unique application id
* @return request types
@@ -396,6 +519,14 @@ class PolicyHandler : public PolicyHandlerInterface,
const std::string& policy_app_id) const OVERRIDE;
/**
+ * @brief Gets application request subtypes
+ * @param policy_app_id Unique application id
+ * @return app request subtypes
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Gets vehicle information
* @return Structure with vehicle information
*/
@@ -421,7 +552,7 @@ class PolicyHandler : public PolicyHandlerInterface,
int32_t timespan_seconds) OVERRIDE;
#ifdef BUILD_TESTS
- void SetPolicyManager(utils::SharedPtr<PolicyManager> pm) {
+ void SetPolicyManager(std::shared_ptr<PolicyManager> pm) {
policy_manager_ = pm;
}
#endif // BUILD_TESTS
@@ -432,6 +563,17 @@ class PolicyHandler : public PolicyHandlerInterface,
const PolicySettings& get_settings() const OVERRIDE;
+ virtual void OnPTUFinished(const bool ptu_result) OVERRIDE;
+
+ /**
+ * @brief OnDeviceSwitching Notifies policy manager on device switch event so
+ * policy permissions should be processed accordingly
+ * @param device_id_from Id of device being switched
+ * @param device_id_to Id of device on the new transport
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) FINAL;
+
protected:
/**
* Starts next retry exchange policy table
@@ -459,15 +601,39 @@ 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 Updates HMI level for specified application and send notification
+ * @param app application where HMI level was changed
+ * @param level new HMI level
+ */
+ void UpdateHMILevel(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level);
+ std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) OVERRIDE;
/**
* @brief Sets days after epoch on successful policy update
@@ -536,12 +702,39 @@ class PolicyHandler : public PolicyHandlerInterface,
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_;
+ std::shared_ptr<PolicyManager> policy_manager_;
void* dl_handle_;
- AppIds last_used_app_ids_;
- utils::SharedPtr<PolicyEventObserver> event_observer_;
+ std::shared_ptr<PolicyEventObserver> event_observer_;
uint32_t last_activated_app_id_;
/**
@@ -556,15 +749,16 @@ class PolicyHandler : public PolicyHandlerInterface,
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_;
// Lock for app to device list
- sync_primitives::Lock app_to_device_link_lock_;
+ sync_primitives::RecursiveLock app_to_device_link_lock_;
- utils::SharedPtr<StatisticManagerImpl> statistic_manager_impl_;
+ std::shared_ptr<StatisticManagerImpl> statistic_manager_impl_;
const PolicySettings& settings_;
application_manager::ApplicationManager& application_manager_;
friend class AppPermissionDelegate;
@@ -579,7 +773,6 @@ class PolicyHandler : public PolicyHandlerInterface,
* otherwise FALSE
*/
bool IsUrlAppIdValid(const uint32_t app_idx, const EndpointUrls& urls) const;
-
DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
};
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
index 794da0cdfb..07d234f036 100644
--- 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
@@ -43,9 +43,13 @@ 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
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
index d3a5a0b821..ea8d95a92a 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -38,7 +38,7 @@
#include <list>
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/threads/thread.h"
#include "utils/conditional_variable.h"
#include "utils/threads/thread_delegate.h"
@@ -289,6 +289,13 @@ class RequestController {
*/
std::list<RequestPtr> notification_list_;
+ /**
+ * @brief Map keeping track of how many duplicate messages were sent for a
+ * given correlation id, to prevent early termination of a request
+ */
+ std::map<uint32_t, uint32_t> duplicate_message_count_;
+ sync_primitives::Lock duplicate_message_count_lock_;
+
/*
* timer for checking requests timeout
*/
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index 09e9b02180..be28bad63c 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -40,7 +40,7 @@
#include <set>
#include "application_manager/commands/command_request_impl.h"
-#include "commands/hmi/request_to_hmi.h"
+#include "commands/request_to_hmi.h"
#include "utils/date_time.h"
@@ -52,26 +52,36 @@ namespace request_controller {
* @brief Typedef for active mobile request
*
*/
-typedef utils::SharedPtr<commands::Command> RequestPtr;
+typedef std::shared_ptr<commands::Command> RequestPtr;
struct RequestInfo {
- enum RequestType { MobileRequest, HMIRequest };
-
- RequestInfo() {}
+ enum RequestType { RequestNone, MobileRequest, HMIRequest };
+
+ RequestInfo()
+ : timeout_msec_(0)
+ , app_id_(0)
+ , request_type_(RequestNone)
+ , correlation_id_(0) {
+ start_time_ = date_time::getCurrentTime();
+ updateEndTime();
+ }
virtual ~RequestInfo() {}
RequestInfo(RequestPtr request,
- const RequestType requst_type,
+ const RequestType request_type,
const uint64_t timeout_msec)
- : request_(request), timeout_msec_(timeout_msec) {
- start_time_ = date_time::DateTime::getCurrentTime();
+ : request_(request)
+ , timeout_msec_(timeout_msec)
+ , app_id_(0)
+ , correlation_id_(0) {
+ start_time_ = date_time::getCurrentTime();
updateEndTime();
- requst_type_ = requst_type;
+ request_type_ = request_type;
}
RequestInfo(RequestPtr request,
- const RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
void updateEndTime();
@@ -80,11 +90,11 @@ struct RequestInfo {
bool isExpired();
- TimevalStruct start_time() {
+ date_time::TimeDuration start_time() {
return start_time_;
}
- void update_start_time(TimevalStruct start_time) {
+ void update_start_time(date_time::TimeDuration start_time) {
start_time_ = start_time;
}
@@ -96,7 +106,7 @@ struct RequestInfo {
timeout_msec_ = timeout;
}
- TimevalStruct end_time() {
+ date_time::TimeDuration end_time() {
return end_time_;
}
@@ -104,8 +114,8 @@ struct RequestInfo {
return app_id_;
}
- RequestType requst_type() const {
- return requst_type_;
+ RequestType request_type() const {
+ return request_type_;
}
uint32_t requestId() {
@@ -121,27 +131,27 @@ struct RequestInfo {
protected:
RequestPtr request_;
- TimevalStruct start_time_;
+ date_time::TimeDuration start_time_;
uint64_t timeout_msec_;
- TimevalStruct end_time_;
+ date_time::TimeDuration end_time_;
uint32_t app_id_;
- RequestType requst_type_;
+ RequestType request_type_;
uint32_t correlation_id_;
};
-typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
+typedef std::shared_ptr<RequestInfo> RequestInfoPtr;
struct MobileRequestInfo : public RequestInfo {
MobileRequestInfo(RequestPtr request, const uint64_t timeout_msec);
MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
struct HMIRequestInfo : public RequestInfo {
HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec);
HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
@@ -262,13 +272,13 @@ class RequestInfoSet {
* during time scale
*/
struct TimeScale {
- TimeScale(const TimevalStruct& start,
- const TimevalStruct& end,
+ TimeScale(const date_time::TimeDuration& start,
+ const date_time::TimeDuration& end,
const uint32_t& app_id)
: start_(start), end_(end), app_id_(app_id) {}
bool operator()(RequestInfoPtr setEntry) {
- if (!setEntry.valid()) {
+ if (setEntry.use_count() == 0) {
return false;
}
@@ -284,8 +294,8 @@ struct TimeScale {
}
private:
- TimevalStruct start_;
- TimevalStruct end_;
+ date_time::TimeDuration start_;
+ date_time::TimeDuration end_;
uint32_t app_id_;
};
diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h
index 36ab3eaefb..b351e716a7 100644
--- a/src/components/application_manager/include/application_manager/request_tracker.h
+++ b/src/components/application_manager/include/application_manager/request_tracker.h
@@ -85,7 +85,7 @@ class RequestTracker {
const mobile_apis::HMILevel::eType level);
private:
- typedef std::vector<TimevalStruct> RequestAddedAt;
+ typedef std::vector<date_time::TimeDuration> RequestAddedAt;
typedef std::map<ApplicationID, RequestAddedAt> ApplicationsRequestsTracker;
/**
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 26b1739a38..f9a60c862b 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -34,14 +34,14 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
#include <stdint.h>
-#include "utils/shared_ptr.h"
+#include <time.h>
#include "application_manager/resumption/resumption_data.h"
namespace application_manager {
class ApplicationManager;
class Application;
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
}
namespace app_mngr = application_manager;
@@ -115,18 +115,48 @@ class ResumeCtrl {
virtual void OnSuspend() = 0;
/**
+ * @brief Processes resumption data after receiving signal "Ignition Off"
+ */
+ virtual void OnIgnitionOff() = 0;
+
+ /**
* @brief Processes resumption data after receiving signal "Awake"
*/
virtual void OnAwake() = 0;
/**
- * @brief Method stops timer "RsmCtrlPercist" when SDL
+ * @brief Saves Low Voltage signal timestamp
+ */
+ virtual void SaveLowVoltageTime() = 0;
+
+ /**
+ * @brief Saves Wake Up signal timestamp
+ */
+ virtual void SaveWakeUpTime() = 0;
+
+ /**
+ * @brief Checks if SDL has already received OnExitAllApplication notification
+ * with "SUSPEND" reason
+ *
+ * @return Returns TRUE if SDL has received OnExitAllApplication notification
+ * with reason "SUSPEND" otherwise returns FALSE
+ */
+ virtual bool is_suspended() const = 0;
+
+ /**
+ * @brief Method stops timer "RsmCtrlPersist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
*/
virtual void StopSavePersistentDataTimer() = 0;
/**
+ * @brief Method starts timer "RsmCtrlPersist" when
+ * SDL receives onAwakeSDL notification
+ */
+ virtual void StartSavePersistentDataTimer() = 0;
+
+ /**
* @brief Start timer for resumption applications
* Restore D1-D5 data
* @param application that is need to be restored
@@ -144,6 +174,13 @@ class ResumeCtrl {
app_mngr::ApplicationSharedPtr application) = 0;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ virtual void RetryResumption(const uint32_t app_id) = 0;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -249,7 +286,9 @@ class ResumeCtrl {
#ifdef BUILD_TESTS
virtual void set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) = 0;
+ std::shared_ptr<ResumptionData> mock_storage) = 0;
+
+ virtual bool get_resumption_active() const = 0;
#endif // BUILD_TESTS
};
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
index bb886cd5f6..e749118140 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -33,6 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
+#include "application_manager/resumption/resume_ctrl.h"
+
#include <stdint.h>
#include <vector>
#include <map>
@@ -46,7 +48,6 @@
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/resumption/resumption_data.h"
-#include "application_manager/resumption/resume_ctrl.h"
#include "utils/timer.h"
namespace resumption {
@@ -129,10 +130,28 @@ class ResumeCtrlImpl : public ResumeCtrl,
void OnSuspend() OVERRIDE;
/**
+ * @brief Processes resumption data after receiving signal "Ignition Off"
+ */
+ void OnIgnitionOff() OVERRIDE;
+
+ /**
* @brief Processes resumption data after receiving signal "Awake"
*/
void OnAwake() OVERRIDE;
+ void SaveLowVoltageTime() OVERRIDE;
+
+ void SaveWakeUpTime() OVERRIDE;
+
+ /**
+ * @brief Checks if SDL has already received OnExitAllApplication notification
+ * with "SUSPEND" reason
+ *
+ * @return Returns TRUE if SDL has received OnExitAllApplication notification
+ * with reason "SUSPEND" otherwise returns FALSE
+ */
+ bool is_suspended() const OVERRIDE;
+
/**
* @brief Method stops timer "RsmCtrlPercist" when SDL
* receives OnExitAllApplication notification
@@ -141,6 +160,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
void StopSavePersistentDataTimer() OVERRIDE;
/**
+ * @brief Check if all IGNITION OFF and IGNITION ON records
+ * saved in resumption data base
+ * @return True if all records saved, otherwise False
+ */
+ bool CheckIgnCyclesData() const;
+
+ /**
* @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend()
*/
void StopRestoreHmiLevelTimer();
@@ -164,6 +190,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
app_mngr::ApplicationSharedPtr application) OVERRIDE;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ void RetryResumption(const uint32_t app_id) OVERRIDE;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -279,14 +312,30 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Method starts timer "RsmCtrlPercist" when
* SDL receives onAwakeSDL notification
*/
- void StartSavePersistentDataTimer();
+ void StartSavePersistentDataTimer() OVERRIDE;
#ifdef BUILD_TESTS
void set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) OVERRIDE;
+ std::shared_ptr<ResumptionData> mock_storage) OVERRIDE;
+
+ bool get_resumption_active() const OVERRIDE;
#endif // BUILD_TESTS
private:
/**
+ * @brief Returns Low Voltage signal timestamp
+ * @return Low Voltage event timestamp if event LOW VOLTAGE event occures
+ * otherwise 0
+ */
+ time_t LowVoltageTime() const;
+
+ /**
+ * @brief Returns Wake Up signal timestamp
+ * @return Wake Up timestamp if Wake Up signal occures
+ * otherwise 0
+ */
+ time_t WakeUpTime() const;
+
+ /**
* @brief restores saved data of application
* @param application contains application for which restores data
* @return true if success, otherwise return false
@@ -301,6 +350,12 @@ class ResumeCtrlImpl : public ResumeCtrl,
void SaveDataOnTimer();
/**
+ * @brief FinalPersistData persists ResumptionData last time and stops
+ * persistent data timer to avoid further persisting
+ */
+ void FinalPersistData();
+
+ /**
* @brief AddFiles allows to add files for the application
* which should be resumed
* @param application application which will be resumed
@@ -361,11 +416,27 @@ class ResumeCtrlImpl : public ResumeCtrl,
void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Ignition Cycle restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
- bool DisconnectedJustBeforeIgnOff(
- const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Low Voltage restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
+ bool CheckLowVoltageRestrictions(const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is applicable for resumption
+ * @param saved_app application specific section from backup file
+ * @return True fs allowed , otherwise - False
+ */
bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app);
@@ -380,10 +451,38 @@ class ResumeCtrlImpl : public ResumeCtrl,
/**
* @brief CheckDelayAfterIgnOn should check if SDL was started less
- * then N seconds ago. N will be readed from profile.
+ * than N seconds ago. N will be read from profile.
* @return true if SDL started N seconds ago, otherwise return false
*/
- bool CheckDelayAfterIgnOn();
+ bool CheckDelayAfterIgnOn() const;
+
+ /**
+ * @brief CheckDelayBeforeIgnOff checks if app was unregistered less
+ * than N seconds before Ignition OFF. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Ignition Off,
+ * otherwise return false
+ */
+ bool CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const;
+
+ /**
+ * @brief CheckDelayAfterWakeUp should check if app was registered
+ * during the first N seconds after WakeUp signal. N will be read from
+ * profile.
+ * @return true if app registered within N seconds after WakeUp, otherwise
+ * return false
+ */
+ bool CheckDelayAfterWakeUp() const;
+
+ /**
+ * @brief CheckDelayBeforeLowVoltage checks if app was unregistered within
+ * N seconds before Low Voltage signal. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Low Voltage , otherwise return false
+ */
+ bool CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const;
typedef std::pair<uint32_t, uint32_t> application_timestamp;
@@ -418,7 +517,7 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
- time_t GetIgnOffTime();
+ time_t GetIgnOffTime() const;
/**
* @brief Setup IgnOff time to LastState
@@ -480,6 +579,19 @@ class ResumeCtrlImpl : public ResumeCtrl,
const application_manager::ApplicationSharedPtr application) const;
/**
+ * @brief Retrieve the HMI level of the app when high-bandwidth transport
+ *isn't available
+ *
+ * The value is configured through smartDeviceLink.ini file
+ *
+ * @param application an instance of the app
+ * @return HMI level that the app is allowed when high-bandwidth transport
+ *isn't available
+ */
+ mobile_apis::HMILevel::eType GetHmiLevelOnLowBandwidthTransport(
+ app_mngr::ApplicationConstSharedPtr application) const;
+
+ /**
*@brief Mapping applications to time_stamps
* wait for timer to resume HMI Level
*
@@ -491,8 +603,11 @@ class ResumeCtrlImpl : public ResumeCtrl,
WaitingForTimerList waiting_for_timer_;
bool is_resumption_active_;
bool is_data_saved_;
+ bool is_suspended_;
time_t launch_time_;
- utils::SharedPtr<ResumptionData> resumption_storage_;
+ time_t low_voltage_time_;
+ time_t wake_up_time_;
+ std::shared_ptr<ResumptionData> resumption_storage_;
application_manager::ApplicationManager& application_manager_;
};
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index aeb65b32b9..c2634173a5 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -36,6 +36,7 @@
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
+#include "utils/macro.h"
namespace application_manager {
class ApplicationManagerSettings;
@@ -91,7 +92,29 @@ class ResumptionData {
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend() = 0;
+ virtual void IncrementIgnOffCount() = 0;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ virtual void DecrementIgnOffCount() = 0;
+
+ /**
+ * @brief Increments global ignition on counter
+ * by 1
+ */
+ virtual void IncrementGlobalIgnOnCounter() = 0;
+
+ /**
+ * @brief Get the global ignition on counter
+ * @return the global ignition on counter
+ */
+ virtual uint32_t GetGlobalIgnOnCounter() const = 0;
+
+ /**
+ * @brief Resets global ignition on counter
+ */
+ virtual void ResetGlobalIgnOnCount() = 0;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -108,12 +131,6 @@ class ResumptionData {
std::string& hash_id) const = 0;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- virtual void OnAwake() = 0;
-
- /**
* @brief Retrieves data of saved application for the given mobile app ID
* and device ID
* @param policy_app_id - mobile application id
@@ -265,7 +282,7 @@ class ResumptionData {
++first;
}
}
- mutable sync_primitives::Lock resumption_lock_;
+ mutable sync_primitives::RecursiveLock resumption_lock_;
const application_manager::ApplicationManager& application_manager_;
};
} // namespace resumption
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
index 862816bf87..2b5a1fdcc9 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
@@ -55,6 +55,7 @@ struct ApplicationParams {
mobile_apis::HMILevel::eType m_hmi_level;
bool m_is_media_application;
bool m_is_valid;
+ app_mngr::ApplicationSharedPtr app_ptr;
};
/**
@@ -109,11 +110,22 @@ class ResumptionDataDB : public ResumptionData {
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
+
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
+
/**
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend();
+ void IncrementIgnOffCount() FINAL;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ void DecrementIgnOffCount() FINAL;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -130,12 +142,6 @@ class ResumptionDataDB : public ResumptionData {
std::string& hash_id) const;
/**
- * @brief Decrements ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- virtual void OnAwake();
-
- /**
* @brief Retrieves data of saved application for the given mobile app ID
* and device ID
* @param policy_app_id - mobile application id
@@ -672,7 +678,7 @@ class ResumptionDataDB : public ResumptionData {
smart_objects::SmartObject& saved_app) const;
/**
- * @brief Selects data from applicationSubscribtionsArray table
+ * @brief Selects data from applicationSubscriptionsArray table
* @param policy_app_id contains mobile application id of application
* @param device_id contains id of device on which is running application
* @param saved_app will contain subscriptions
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
index 0be6d64db2..e2418fd033 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
@@ -80,18 +80,16 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
-
/**
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend();
+ void IncrementIgnOffCount() FINAL;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
+ * @brief Decrements ignition counter for all registered applications
*/
- virtual void OnAwake();
+ void DecrementIgnOffCount() FINAL;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -135,6 +133,12 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetIgnOffTime() const;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
+
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
+
/**
* @brief Checks if saved data have application
* @param policy_app_id - mobile application id
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
index d61baff7d2..eee7650697 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
@@ -57,12 +57,15 @@ extern const std::string kUpdateIgnOffCount;
extern const std::string kCountApplicationsIgnOff;
extern const std::string kSelectApplicationsIgnOffCount;
extern const std::string kUpdateSuspendData;
-extern const std::string KUpdateLastIgnOffTime;
+extern const std::string kUpdateLastIgnOffTime;
+extern const std::string kUpdateGlobalIgnOnCount;
+extern const std::string kResetGlobalIgnOnCount;
+extern const std::string kSelectGlobalIgnOnCounter;
extern const std::string kDeleteFile;
extern const std::string kDeleteApplicationFilesArray;
extern const std::string kDeleteSubMenu;
extern const std::string kDeleteApplicationSubMenuArray;
-extern const std::string kDeleteApplicationSubscribtionsArray;
+extern const std::string kDeleteApplicationSubscriptionsArray;
extern const std::string kDeleteImageFromCommands;
extern const std::string kDeleteVrCommands;
extern const std::string kDeleteCommands;
diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
new file mode 100644
index 0000000000..cc93e4213c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
+
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_handler.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/policies/policy_handler_observer.h"
+
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
+
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+#ifdef TELEMETRY_MONITOR
+#include "telemetry_observer.h"
+#endif // TELEMETRY_MONITOR
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+
+#include "utils/threads/message_loop_thread.h"
+#include "utils/semantic_version.h"
+
+namespace application_manager {
+namespace rpc_handler {
+
+namespace impl {
+struct MessageFromMobile : public std::shared_ptr<Message> {
+ MessageFromMobile() {}
+ explicit MessageFromMobile(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+struct MessageFromHmi : public std::shared_ptr<Message> {
+ MessageFromHmi() {}
+ explicit MessageFromHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+// Short type names for prioritized message queues
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> >
+ FromMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> >
+ FromHmiQueue;
+}
+
+class RPCHandlerImpl : public RPCHandler,
+ public impl::FromMobileQueue::Handler,
+ public impl::FromHmiQueue::Handler {
+ public:
+ RPCHandlerImpl(ApplicationManager& app_manager);
+ ~RPCHandlerImpl();
+
+ // CALLED ON messages_from_mobile_ thread!
+ void Handle(const impl::MessageFromMobile message) OVERRIDE;
+ // CALLED ON messages_from_hmi_ thread!
+ void Handle(const impl::MessageFromHmi message) OVERRIDE;
+
+ // Overriden HMIMessageObserver method
+ /**
+ * @brief OnMessageReceived overriden HMIMessageObserver method,
+ * process message from HMI
+ * @param message pointer to received message
+ */
+ void OnMessageReceived(
+ hmi_message_handler::MessageSharedPointer message) OVERRIDE;
+
+ /**
+ * @brief OnErrorSending overriden HMIMessageObserver method
+ * @param message pointer to received message
+ */
+ void OnErrorSending(
+ hmi_message_handler::MessageSharedPointer message) OVERRIDE;
+
+ // Overriden ProtocolObserver method
+ /**
+ * @brief OnMessageReceived overriden ProtocolObserver method,
+ * process message from mobile
+ * @param message pointer to received message
+ */
+ void OnMessageReceived(
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
+
+ /**
+ * @brief OnMobileMessageSent overriden ProtocolObserver method,
+ * post message to mobile
+ * @param message pointer to received message
+ */
+ void OnMobileMessageSent(
+ const ::protocol_handler::RawMessagePtr message) OVERRIDE;
+
+#ifdef TELEMETRY_MONITOR
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
+#endif // TELEMETRY_MONITOR
+
+ /**
+ * @brief Extracts and validates the syncMsgVersion included in
+ * a RegisterAppInterfaceRequest
+ *
+ * @param output - SmartObject Message received from mobile
+ * @param messageVersion - message version to be updated
+ */
+ void GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version);
+
+ private:
+ void ProcessMessageFromMobile(const std::shared_ptr<Message> message);
+ void ProcessMessageFromHMI(const std::shared_ptr<Message> message);
+ bool ConvertMessageToSO(const Message& message,
+ smart_objects::SmartObject& output);
+ std::shared_ptr<Message> ConvertRawMsgToMessage(
+ const ::protocol_handler::RawMessagePtr message);
+ hmi_apis::HMI_API& hmi_so_factory();
+ mobile_apis::MOBILE_API& mobile_so_factory();
+
+ ApplicationManager& app_manager_;
+ // Thread that pumps messages coming from mobile side.
+ impl::FromMobileQueue messages_from_mobile_;
+ // Thread that pumps messages coming from HMI.
+ impl::FromHmiQueue messages_from_hmi_;
+
+ hmi_apis::HMI_API hmi_so_factory_;
+ mobile_apis::MOBILE_API mobile_so_factory_;
+#ifdef TELEMETRY_MONITOR
+ AMTelemetryObserver* metric_observer_;
+#endif // TELEMETRY_MONITOR
+};
+
+} // namespace rpc_handler
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_IMPL_H
diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h
new file mode 100644
index 0000000000..1eaeb46255
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/usage_statistics.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/command_holder_impl.h"
+
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+
+#include "utils/threads/message_loop_thread.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+namespace impl {
+
+struct MessageToMobile : public std::shared_ptr<Message> {
+ MessageToMobile() : is_final(false) {}
+ explicit MessageToMobile(const std::shared_ptr<Message>& message,
+ bool final_message)
+ : std::shared_ptr<Message>(message), is_final(final_message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+ // Signals if connection to mobile must be closed after sending this message
+ bool is_final;
+};
+
+struct MessageToHmi : public std::shared_ptr<Message> {
+ MessageToHmi() {}
+ explicit MessageToHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> >
+ ToMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> >
+ ToHmiQueue;
+}
+
+class RPCServiceImpl : public RPCService,
+ public impl::ToMobileQueue::Handler,
+ public impl::ToHmiQueue::Handler {
+ public:
+ /**
+ * @brief RPCServiceImpl class constructor
+ * @param app_manager ApplicationManager
+ * @param request_ctrl RequestController
+ * @param protocol_handler ProtocolHandler
+ * @param hmi_handler HMIMessageHandler
+ * @param commands_holder CommandHolder
+ **/
+ RPCServiceImpl(ApplicationManager& app_manager,
+ request_controller::RequestController& request_ctrl,
+ protocol_handler::ProtocolHandler* protocol_handler,
+ hmi_message_handler::HMIMessageHandler* hmi_handler,
+ CommandHolder& commands_holder);
+ ~RPCServiceImpl();
+
+ bool ManageMobileCommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) OVERRIDE;
+ bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
+
+ // CALLED ON messages_to_hmi_ thread!
+ void Handle(const impl::MessageToHmi message) OVERRIDE;
+ // CALLED ON messages_to_mobile_ thread!
+ void Handle(const impl::MessageToMobile message) OVERRIDE;
+
+ void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false) OVERRIDE;
+ void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
+
+ void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) OVERRIDE;
+ void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) OVERRIDE;
+
+ private:
+ bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
+ Message& output);
+ hmi_apis::HMI_API& hmi_so_factory();
+ mobile_apis::MOBILE_API& mobile_so_factory();
+
+ ApplicationManager& app_manager_;
+ request_controller::RequestController& request_ctrl_;
+ protocol_handler::ProtocolHandler* protocol_handler_;
+ hmi_message_handler::HMIMessageHandler* hmi_handler_;
+ CommandHolder& commands_holder_;
+ // Thread that pumps messages being passed to mobile side.
+ impl::ToMobileQueue messages_to_mobile_;
+ // Thread that pumps messages being passed to HMI.
+ impl::ToHmiQueue messages_to_hmi_;
+
+ hmi_apis::HMI_API hmi_so_factory_;
+ mobile_apis::MOBILE_API mobile_so_factory_;
+};
+} // namespace rpc_service
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index e751f164d3..6e32853a3d 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -51,6 +51,7 @@ extern const char* msg_params;
extern const char* method_name;
extern const char* info;
extern const char* app_id;
+extern const char* full_app_id;
extern const char* bundle_id;
extern const char* app_info;
extern const char* app_launch;
@@ -90,6 +91,7 @@ extern const char* main_field_1;
extern const char* main_field_2;
extern const char* main_field_3;
extern const char* main_field_4;
+extern const char* metadata_tags;
extern const char* eta;
extern const char* time_to_destination;
extern const char* total_distance;
@@ -156,10 +158,12 @@ extern const char* hours;
extern const char* minutes;
extern const char* seconds;
extern const char* update_mode;
+extern const char* audioStreamingIndicator;
extern const char* trigger_source;
extern const char* hmi_level;
extern const char* activate_app_hmi_level;
extern const char* audio_streaming_state;
+extern const char* video_streaming_state;
extern const char* system_context;
extern const char* speech_capabilities;
extern const char* vr_capabilities;
@@ -167,17 +171,37 @@ extern const char* audio_pass_thru_capabilities;
extern const char* pcm_stream_capabilities;
extern const char* audio_pass_thru_icon;
extern const char* way_points;
+extern const char* system_capability;
+extern const char* system_capability_type;
+extern const char* system_capabilities;
+extern const char* navigation_capability;
+extern const char* phone_capability;
+extern const char* video_streaming_capability;
+extern const char* rc_capability;
+extern const char* day_color_scheme;
+extern const char* night_color_scheme;
+extern const char* primary_color;
+extern const char* secondary_color;
+extern const char* background_color;
+extern const char* red;
+extern const char* green;
+extern const char* blue;
+extern const char* display_layout;
+extern const char* icon_resumed;
// PutFile
extern const char* sync_file_name;
extern const char* file_name;
extern const char* file_type;
extern const char* file_size;
+extern const char* crc32_check_sum;
extern const char* request_type;
+extern const char* request_subtype;
extern const char* persistent_file;
extern const char* file_data;
extern const char* space_available;
extern const char* image_type;
+extern const char* is_template;
extern const char* image;
extern const char* type;
extern const char* system_file;
@@ -193,6 +217,7 @@ extern const char* did_location;
extern const char* app_list;
extern const char* device_list;
extern const char* device_info;
+extern const char* secondary_device_info;
extern const char* name;
extern const char* id;
extern const char* isSDLAllowed;
@@ -227,12 +252,15 @@ extern const char* rpm;
extern const char* fuel_level;
extern const char* fuel_level_state;
extern const char* instant_fuel_consumption;
+extern const char* fuel_range;
extern const char* external_temp;
+extern const char* turn_signal;
extern const char* vin;
extern const char* prndl;
extern const char* tire_pressure;
extern const char* odometer;
extern const char* belt_status;
+extern const char* electronic_park_brake_status;
extern const char* body_information;
extern const char* device_status;
extern const char* driver_braking;
@@ -258,9 +286,12 @@ extern const char* supported_diag_modes;
extern const char* hmi_capabilities;
extern const char* navigation;
extern const char* phone_call;
+extern const char* video_streaming;
+extern const char* remote_control;
extern const char* sdl_version;
extern const char* system_software_version;
extern const char* priority;
+extern const char* engine_oil_life;
// resuming
extern const char* application_commands;
@@ -269,7 +300,7 @@ extern const char* application_choice_sets;
extern const char* application_global_properties;
extern const char* application_vehicle_info;
extern const char* application_buttons;
-extern const char* application_subscribtions;
+extern const char* application_subscriptions;
extern const char* application_files;
extern const char* application_show;
extern const char* resumption;
@@ -280,6 +311,8 @@ extern const char* resume_vr_grammars;
extern const char* ign_off_count;
+extern const char* global_ign_on_counter;
+
extern const char* connection_info;
extern const char* is_download_complete;
@@ -310,6 +343,44 @@ extern const char* is_suscribed;
extern const char* message_data;
extern const char* delivery_mode;
+
+extern const char* audio_streaming_indicator;
+
+// keys for default parameters loaded from hmi_capabilities.json:
+extern const char* const keyboard_properties_default;
+extern const char* const language_default;
+extern const char* const keyboard_layout_default;
+extern const char* const keypress_mode_default;
+
+// keys for supported parameters loaded from hmi_capabilities.json:
+extern const char* const keyboard_properties_supported;
+extern const char* const language_supported;
+extern const char* const keyboard_layout_supported;
+extern const char* const keypress_mode_supported;
+extern const char* const limited_characters_list_supported;
+extern const char* const auto_complete_text_supported;
+extern const char* const entity_type;
+extern const char* const entity_id;
+extern const char* const status;
+extern const char* const external_consent_status;
+extern const char* const consented_functions;
+extern const char* const source;
+extern const char* const config;
+extern const char* const protocol;
+extern const char* const codec;
+extern const char* const width;
+extern const char* const height;
+extern const char* const rejected_params;
+extern const char* const preferred_resolution;
+extern const char* const resolution_width;
+extern const char* const resolution_height;
+extern const char* const max_bitrate;
+extern const char* const supported_formats;
+extern const char* const haptic_spatial_data_supported;
+extern const char* const haptic_rect_data;
+extern const char* const rect;
+extern const char* const x;
+extern const char* const y;
} // namespace strings
namespace json {
@@ -355,12 +426,25 @@ extern const char* kFull;
extern const char* kLimited;
extern const char* kBackground;
extern const char* kNone;
-}
+} // namespace hmi_levels
+
+namespace time_keys {
+extern const char* millisecond;
+extern const char* second;
+extern const char* minute;
+extern const char* hour;
+extern const char* day;
+extern const char* month;
+extern const char* year;
+extern const char* tz_hour;
+extern const char* tz_minute;
+} // namespace time_keys
namespace hmi_request {
extern const char* parent_id;
extern const char* field_name;
extern const char* field_text;
+extern const char* field_types;
extern const char* alert_strings;
extern const char* duration;
extern const char* soft_buttons;
@@ -416,6 +500,7 @@ extern const char* dtc;
extern const char* ecu_header;
extern const char* image_capabilities;
extern const char* display_type;
+extern const char* display_name;
extern const char* text_fields;
extern const char* media_clock_formats;
extern const char* graphic_supported;
@@ -426,7 +511,7 @@ extern const char* num_custom_presets_available;
extern const char* urls;
extern const char* policy_app_id;
extern const char* enabled;
-
+extern const char* system_time;
} // namespace hmi_response
namespace hmi_notification {
diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h
index f2f9fb39a4..99113d6d00 100644
--- a/src/components/application_manager/include/application_manager/state_controller_impl.h
+++ b/src/components/application_manager/include/application_manager/state_controller_impl.h
@@ -32,8 +32,9 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_
-#include <list>
+#include <list>
+#include <map>
#include "application_manager/hmi_state.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
@@ -67,12 +68,14 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param app appication to setup regular State
* @param hmi_level of new regular state
* @param audio_state of new regular state
+ * @paran video_state of new regular state
* @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp);
/**
@@ -91,6 +94,7 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param app appication to setup regular State
* @param hmi_level of new regular state
* @param audio_state of new regular state
+ * @param video_state of new regular state
* @param system_context of new regular state
* @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */
@@ -98,6 +102,7 @@ class StateControllerImpl : public event_engine::EventObserver,
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp);
@@ -114,10 +119,12 @@ class StateControllerImpl : public event_engine::EventObserver,
* @brief SetRegularState Change regular audio state
* @param app appication to setup regular State
* @param audio_state of new regular state
+ * @param video_state of new regular state
*/
virtual void SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state);
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state);
/**
* @brief SetRegularState Change regular system context
@@ -149,17 +156,19 @@ class StateControllerImpl : public event_engine::EventObserver,
const mobile_apis::HMILevel::eType default_level);
/**
- * @brief OnNaviStreamingStarted process Navi streaming started
+ * @brief OnVideoStreamingStarted process video streaming started
+ * @param app projection or navigation application starting streaming
*/
- virtual void OnNaviStreamingStarted();
+ virtual void OnVideoStreamingStarted(ApplicationConstSharedPtr app);
/**
- * @brief OnNaviStreamingStopped process Navi streaming stopped
+ * @brief OnVideoStreamingStopped process video streaming stopped
+ * @param app projection or navigation application stopping streaming
*/
- virtual void OnNaviStreamingStopped();
+ virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app);
/**
- * @brief OnStateChanged send HMIStatusNotification if neded
+ * @brief OnStateChanged send HMIStatusNotification if needed
* @param app application
* @param old_state state before change
* @param new_state state after change
@@ -184,11 +193,11 @@ class StateControllerImpl : public event_engine::EventObserver,
* Move other application to HmiStates if applied moved to FULL or LIMITED
*/
struct HmiLevelConflictResolver {
- ApplicationSharedPtr applied_;
- HmiStatePtr state_;
+ const ApplicationSharedPtr applied_;
+ const HmiStatePtr state_;
StateControllerImpl* state_ctrl_;
- HmiLevelConflictResolver(ApplicationSharedPtr app,
- HmiStatePtr state,
+ HmiLevelConflictResolver(const ApplicationSharedPtr app,
+ const HmiStatePtr state,
StateControllerImpl* state_ctrl)
: applied_(app), state_(state), state_ctrl_(state_ctrl) {}
void operator()(ApplicationSharedPtr to_resolve);
@@ -289,7 +298,7 @@ class StateControllerImpl : public event_engine::EventObserver,
void HMIStateStarted(ApplicationSharedPtr app) {
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr old_hmi_state = app->CurrentHmiState();
- HmiStatePtr new_hmi_state = CreateHmiState(app->app_id(), ID);
+ HmiStatePtr new_hmi_state = CreateHmiState(app, ID);
DCHECK_OR_RETURN_VOID(new_hmi_state);
DCHECK_OR_RETURN_VOID(new_hmi_state->state_id() !=
HmiState::STATE_ID_REGULAR);
@@ -326,10 +335,11 @@ class StateControllerImpl : public event_engine::EventObserver,
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr cur = app->CurrentHmiState();
HmiStatePtr old_hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(old_hmi_state);
old_hmi_state->set_hmi_level(cur->hmi_level());
old_hmi_state->set_audio_streaming_state(cur->audio_streaming_state());
+ old_hmi_state->set_video_streaming_state(cur->video_streaming_state());
old_hmi_state->set_system_context(cur->system_context());
app->RemoveHMIState(ID);
HmiStatePtr new_hmi_state = app->CurrentHmiState();
@@ -353,39 +363,18 @@ class StateControllerImpl : public event_engine::EventObserver,
void SetupRegularHmiState(ApplicationSharedPtr app, HmiStatePtr state);
/**
- * @brief IsSameAppType checks if apps has same types
- * @param app1
- * @param app2
- * @return true if aps have same types, otherwise return false
- */
- bool IsSameAppType(ApplicationConstSharedPtr app1,
- ApplicationConstSharedPtr app2);
-
- /**
* @brief SetupRegularHmiState set regular HMI State without
* resolving conflicts and ActivateApp request
* @param app application
* @param hmi_level of new regular state
* @param audio_state of new regular state
- * @param system_context of new regular state
+ * @param video_state of new regular state
*/
void SetupRegularHmiState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
- const mobile_apis::SystemContext::eType system_context);
-
- /**
- * @brief SetupRegularHmiState set regular HMI State without
- * resolving conflicts and ActivateApp request
- * @param app application
- * @param hmi_level of new regular state
- * @param audio_state of new regular state
- */
- void SetupRegularHmiState(
- ApplicationSharedPtr app,
- const mobile_apis::HMILevel::eType hmi_level,
- const mobile_apis::AudioStreamingState::eType audio_state);
+ const mobile_apis::VideoStreamingState::eType video_state);
/**
* @brief OnActivateAppResponse calback for activate app response
@@ -431,16 +420,35 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param state_id state id
* @return
*/
- HmiStatePtr CreateHmiState(uint32_t app_id, HmiState::StateID state_id) const;
+ HmiStatePtr CreateHmiState(std::shared_ptr<Application> app,
+ HmiState::StateID state_id) const;
+ /**
+ * @brief Determines AudioStreamingState value
+ * for application with HMI level specified.
+ * @param app an application to calculate for
+ * @param hmi_level HMI level
+ * @return AudioStreamingState value
+ */
mobile_apis::AudioStreamingState::eType CalcAudioState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level) const;
+ /**
+ * @brief Determines VideoStreamingState value
+ * for application with HMI level specified.
+ * @param app an application to calculate for
+ * @param hmi_level HMI level
+ * @return VideoStreamingState value
+ */
+ mobile_apis::VideoStreamingState::eType CalcVideoState(
+ ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level) const;
+
typedef std::list<HmiState::StateID> StateIDList;
StateIDList active_states_;
mutable sync_primitives::Lock active_states_lock_;
- std::map<uint32_t, HmiStatePtr> waiting_for_activate;
+ std::map<uint32_t, HmiStatePtr> waiting_for_activate_;
ApplicationManager& app_mngr_;
};
}
diff --git a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
new file mode 100644
index 0000000000..add440ad80
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
+
+#include <time.h>
+#include <vector>
+
+#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/system_time_handler.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+
+namespace application_manager {
+
+/**
+ * @brief The SystemTimeHandlerImpl class.
+ * Responsible for the system time notification. It keeps the list
+ * of system time listeners, sends appropriate request to the system
+ * and notifies the listeners with new time right after response has appeared.
+ */
+class SystemTimeHandlerImpl : public utils::SystemTimeHandler,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief SystemTimeHandlerImpl creates the instance of the class.
+ */
+ explicit SystemTimeHandlerImpl(ApplicationManager& application_manager);
+
+ /**
+ * @brief ~SystemTimeHandlerImpl
+ */
+ ~SystemTimeHandlerImpl();
+
+ private:
+ /**
+ * @brief on_event allows to process certain events from the system.
+ * Event which are handles within this methods are: OnSystemTimeReady
+ * in order to send system time query and GetSystemTimeResponse in order
+ * to retrieve utc time and notify all the listeners with new time value.
+ */
+ void on_event(const application_manager::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief DoSystemTimeQuery sends the appropriate request to the system
+ * and subscribes the class to the response. This is asynchronous request
+ * thus it won't block until the system respond and returns immediately.
+ */
+ void DoSystemTimeQuery() FINAL;
+
+ /**
+ * @brief DoSubscribe allows to subscribe certain listener for
+ * SystemTime. This certain implementation does not maintain
+ * listeners collection instead it save the pointer to listener.
+ * @note the class is not reponsible for the pointer's lifecycle.
+ * So consider to explicitly unsibsscribe from event when listener
+ * is going to be destroyed.
+ * @param listener the listener which will be notified
+ * in case of SystemTime appeared.
+ */
+ void DoSubscribe(utils::SystemTimeListener* listener) FINAL;
+
+ /**
+ * @brief DoUnsubscribe assigns the pointer to listener to NULL.
+ * This certain implementation ignores passed parameter.
+ * @param listener pointer to the object which should be
+ * unsubscribed from events.
+ */
+ void DoUnsubscribe(utils::SystemTimeListener* listener) FINAL;
+
+ /**
+ * @brief FetchSystemTime this method allows to obtain
+ * recently received utc time.
+ * @note it is up to user to check whether the returned
+ * argument is valid
+ * @return the time value returned by system.
+ */
+ time_t FetchSystemTime() FINAL;
+
+ /**
+ * @brief SendTimeRequest sends the request to the system
+ * and subscribes for response.
+ */
+ void SendTimeRequest();
+
+ /**
+ * @brief ProcessSystemTimeResponse allows to process GetSystemTimeResponse
+ * @param event contains response parameters aka "systemTime".
+ */
+ void ProcessSystemTimeResponse(
+ const application_manager::event_engine::Event& event);
+
+ /**
+ * @brief ProcessSystemTimeReadyNotification allows to process
+ * OnSystemTimeready notification
+ * from HMI. It unsubscribes from the mentioned notification and sends
+ * GetSystemTimeRequest to HMI in order to obtain system time
+ */
+ void ProcessSystemTimeReadyNotification();
+
+ /**
+ * @brief Checks if UTC time is ready to provided by HMI
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ bool utc_time_can_be_received() const FINAL;
+
+ mutable sync_primitives::Lock state_lock_;
+ // Variable means HMI readiness to provide system time by request
+ volatile bool utc_time_can_be_received_;
+
+ /**
+ * @brief Flag used to control that only GetSystemTime request at time could
+ * be sent to HMI
+ */
+ volatile bool awaiting_get_system_time_;
+
+ // Varible used to store result for GetSystemTime request
+ time_t last_time_;
+
+ sync_primitives::Lock system_time_listener_lock_;
+ utils::SystemTimeListener* system_time_listener_;
+ ApplicationManager& app_manager_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SYSTEM_TIME_SYSTEM_TIME_HANDLER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h
index 20b3aaca5a..49f15165db 100644
--- a/src/components/application_manager/include/application_manager/telemetry_observer.h
+++ b/src/components/application_manager/include/application_manager/telemetry_observer.h
@@ -36,7 +36,7 @@
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "json/json.h"
-#include "utils/shared_ptr.h"
+
#include "utils/date_time.h"
namespace application_manager {
@@ -44,11 +44,11 @@ namespace application_manager {
class AMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
- utils::SharedPtr<smart_objects::SmartObject> message;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
+ std::shared_ptr<smart_objects::SmartObject> message;
};
- typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
+ typedef std::shared_ptr<MessageMetric> MessageMetricSharedPtr;
virtual void OnMessage(MessageMetricSharedPtr) = 0;
virtual ~AMTelemetryObserver() {}
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index 886389b05c..6d0b5cd6bd 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -38,7 +38,7 @@
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/app_stopwatch.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "interfaces/MOBILE_API.h"
namespace application_manager {
@@ -47,10 +47,10 @@ class UsageStatistics {
public:
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager);
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
usage_statistics::AppStopwatch* time_in_hmi_state_ptr);
void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
void RecordAppRegistrationGuiLanguage(
@@ -66,7 +66,7 @@ class UsageStatistics {
void RecordTLSError();
private:
- std::auto_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
+ std::unique_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
usage_statistics::AppInfo app_registration_language_gui_;
usage_statistics::AppInfo app_registration_language_vui_;
usage_statistics::AppCounter count_of_rejected_rpc_calls_;
diff --git a/src/components/application_manager/rpc_plugins/CMakeLists.txt b/src/components/application_manager/rpc_plugins/CMakeLists.txt
new file mode 100644
index 0000000000..c9ef282c12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# --- Utils
+add_subdirectory(vehicle_info_plugin)
+add_subdirectory(sdl_rpc_plugin)
+add_subdirectory(rc_rpc_plugin)
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
new file mode 100644
index 0000000000..00de927b6e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/CMakeLists.txt
@@ -0,0 +1,80 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/hmi
+)
+
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("rc_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES})
+target_link_libraries("rc_rpc_plugin" ${LIBRARIES})
+
+add_library("RCRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS})
+target_link_libraries("RCRpcPluginStaticLib" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS rc_rpc_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
new file mode 100644
index 0000000000..3bc34be8d1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCButtonPressRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCButtonPressRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCButtonPressRequest(const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ */
+ void Run() OVERRIDE;
+ ~RCButtonPressRequest();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
new file mode 100644
index 0000000000..939d5fa468
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCButtonPressResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCButtonPressResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCButtonPressResponse(const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCButtonPressResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
new file mode 100644
index 0000000000..97df5e8390
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataConsentRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ RCGetInteriorVehicleDataConsentRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+ ~RCGetInteriorVehicleDataConsentRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
new file mode 100644
index 0000000000..46232987a5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataConsentResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetInteriorVehicleDataConsentResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCGetInteriorVehicleDataConsentResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCGetInteriorVehicleDataConsentResponse();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..a88a39aa7a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ RCGetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+ ~RCGetInteriorVehicleDataRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..c9e5d39d1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCGetInteriorVehicleDataResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ RCGetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCGetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
new file mode 100644
index 0000000000..aeb0a06d22
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h
@@ -0,0 +1,72 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCOnInteriorVehicleDataNotification
+ : public application_manager::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief RCOnInteriorVehicleDataNotification class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCOnInteriorVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ ~RCOnInteriorVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
new file mode 100644
index 0000000000..7aa1aa3dba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+class InteriorDataManager;
+
+namespace commands {
+class RCOnRemoteControlSettingsNotification
+ : public application_manager::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief RCOnRemoteControlSettingsNotification class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCOnRemoteControlSettingsNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ ~RCOnRemoteControlSettingsNotification();
+
+ private:
+ ResourceAllocationManager& resource_allocation_manager_;
+ InteriorDataManager& interior_data_manager_;
+ /**
+ * @brief Disalows RC functionality for all RC apps
+ * All registered apps will be unsubsribed from OnInteriorVehicleData
+ * notifications
+ */
+ void DisallowRCFunctionality();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..69b48bfecf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCSetInteriorVehicleDataRequest
+ : public application_manager::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCSetInteriorVehicleDataRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCSetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ void Run() OVERRIDE;
+ ~RCSetInteriorVehicleDataRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..8a63503220
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class RCSetInteriorVehicleDataResponse
+ : public application_manager::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCSetInteriorVehicleDataResponse class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCSetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~RCSetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h
new file mode 100644
index 0000000000..d6ecfd0128
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class ButtonPressRequest : public RCCommandRequest {
+ public:
+ ButtonPressRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ /**
+ * @brief Execute command
+ * send HMI request if message contains appropriate
+ * button name and module type
+ * otherwise sends negative sesponse to mobile
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource Tries to acquire specific resource
+ * @param message Incoming message containg the resource name
+ * @return Acquire result
+ */
+ AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ std::string ModuleType() FINAL;
+
+ /**
+ * @brief ButtonPressRequest class destructor
+ */
+ ~ButtonPressRequest();
+};
+
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
new file mode 100644
index 0000000000..0f3964494e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class ButtonPressResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ ButtonPressResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ void Run() OVERRIDE;
+ /**
+ * @brief ButtonPressResponse class destructor
+ */
+ ~ButtonPressResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..4624d79b56
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h
@@ -0,0 +1,101 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include <string>
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class GetInteriorVehicleDataRequest : public RCCommandRequest {
+ public:
+ GetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief GetInteriorVehicleDataRequest class destructor
+ */
+ ~GetInteriorVehicleDataRequest();
+
+ private:
+ std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(const std::string& module_type);
+
+ /**
+ * @brief Check if app wants to proceed with already setup subscription
+ * @param request_params request parameters to check
+ * @return true if app already subscribed(unsubsribed) for module type but
+ * wants to subscribe(unsubscribe) for the same module again
+ * otherwise - false
+ */
+ bool HasRequestExcessiveSubscription();
+
+ /**
+ * @brief Handle subscription to vehicle data
+ * @param hmi_response json message with response from HMI
+ */
+ void ProccessSubscription(const smart_objects::SmartObject& hmi_response);
+
+ /**
+ * @brief Cuts off subscribe parameter
+ * @param request_params request parameters to handle
+ */
+ void RemoveExcessiveSubscription();
+
+ std::string ModuleType() FINAL;
+ bool excessive_subscription_occured_;
+ bool ProcessCapabilities();
+ void ProcessResponseToMobileFromCache(app_mngr::ApplicationSharedPtr app);
+ bool CheckRateLimits();
+ bool AppShouldBeUnsubscribed();
+ bool TheLastAppShouldBeUnsubscribed(app_mngr::ApplicationSharedPtr app);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..bf8208edc2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class GetInteriorVehicleDataResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ GetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~GetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
new file mode 100644
index 0000000000..931e79366c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+
+#include <string>
+#include "application_manager/commands/command_notification_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class OnInteriorVehicleDataNotification
+ : public application_manager::commands::CommandNotificationImpl {
+ public:
+ OnInteriorVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ std::string ModuleType();
+
+ ~OnInteriorVehicleDataNotification();
+
+ private:
+ InteriorDataCache& interior_data_cache_;
+ void AddDataToCache(const std::string& module_type);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..128c668ee9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+enum capabilitiesStatus { success, missedLightName, missedParam, readOnly };
+
+typedef std::pair<std::string, capabilitiesStatus> ModuleCapability;
+
+class SetInteriorVehicleDataRequest : public RCCommandRequest {
+ public:
+ SetInteriorVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource proxy AcquireResource to Resource allocation manager
+ * @param message message of requires contatin module types
+ * @return result of acauiring resources
+ */
+ AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Method that check if READ_ONLY parameters present
+ * @param request_params params from received message,
+ * @param module_data_capabilities info for notification to mobile
+ * @return true if present , false - otherwise
+ */
+ bool AreReadOnlyParamsPresent(const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities);
+
+ /**
+ * @brief Method that check if all request parameters are READ_ONLY
+ * @param request_params params from received message
+ * @return true if all are read only , false - otherwise
+ */
+ bool AreAllParamsReadOnly(const smart_objects::SmartObject& module_data);
+
+ /**
+ * @brief Method that cuts-off READ_ONLY parameters
+ * @param module_data params to handle
+ */
+ void CutOffReadOnlyParams(smart_objects::SmartObject& module_data);
+
+ std::string ModuleType() FINAL;
+
+ /**
+ * @brief SetInteriorVehicleDataRequest class destructor
+ */
+ ~SetInteriorVehicleDataRequest();
+
+ private:
+ /**
+ * @brief ControlData
+ * @param module_data received params
+ * @return value of module data depending on module type
+ */
+ const smart_objects::SmartObject& ControlData(
+ const smart_objects::SmartObject& module_data);
+
+ /**
+ * @brief CheckAudioSource check that if app wants to change
+ * the audio source from MOBILE_APP to other types of audio
+ * source without keepContext parameter or with keepContext=false
+ * then this app will go to HMI level 'BACKGROUND'
+ * @param module_data received params
+ */
+ void CheckAudioSource(const smart_objects::SmartObject& audio_data);
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
new file mode 100644
index 0000000000..1ab5ccc6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+class SetInteriorVehicleDataResponse
+ : public application_manager::commands::CommandResponseImpl {
+ public:
+ SetInteriorVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ void Run() OVERRIDE;
+
+ ~SetInteriorVehicleDataResponse();
+};
+} // namespace commands
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
new file mode 100644
index 0000000000..8e7ed9c667
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+class HMICapabilities;
+}
+
+namespace policy {
+class PolicyHandlerInterface;
+}
+
+namespace rc_rpc_plugin {
+
+class ResourceAllocationManager;
+class InteriorDataCache;
+class InteriorDataManager;
+
+struct RCCommandParams {
+ application_manager::ApplicationManager& application_manager_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+ application_manager::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager_;
+ rc_rpc_plugin::InteriorDataCache& interior_data_cache_;
+ rc_rpc_plugin::InteriorDataManager& interior_data_manager_;
+};
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
new file mode 100644
index 0000000000..ce95617b6c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h
@@ -0,0 +1,172 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
+
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+
+enum TypeAccess { kDisallowed, kAllowed };
+
+namespace commands {
+
+class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief RCCommandRequest class constructor
+ * @param message MessageSharedPtr
+ * @param application_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handle PolicyHandlerInterface
+ * @param resource_allocation_manager ResourceAllocationManager
+ **/
+ RCCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
+
+ virtual ~RCCommandRequest();
+
+ void onTimeOut() OVERRIDE;
+
+ void Run() OVERRIDE;
+
+ virtual void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ protected:
+ bool is_subscribed;
+ bool auto_allowed_;
+
+ ResourceAllocationManager& resource_allocation_manager_;
+ InteriorDataCache& interior_data_cache_;
+ InteriorDataManager& interior_data_manager_;
+ /**
+ * @brief AcquireResource try to allocate resource for application
+ * In case if allocation of resource is not required, return ALLOWED by
+ * default.
+ * This method should be overrided in RPCs that requires resource allocation
+ * @return result of resource allocation, in case if allocation os not
+ * required, return ALLOWED
+ */
+ virtual AcquireResult::eType AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ return AcquireResult::ALLOWED;
+ }
+
+ /**
+ * @brief IsResourceFree check resource state
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const {
+ UNUSED(module_type);
+ return true;
+ }
+ /**
+ * @brief SetResourceState changes state of resource
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param module_type Resource name
+ * @param State to set for resource
+ */
+ virtual void SetResourceState(const std::string& module_type,
+ const ResourceState::eType) {}
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type Resource name
+ * @return kAllowed if module is present, otherwise - kDisallowed
+ */
+ TypeAccess CheckModule(const std::string& module_type,
+ application_manager::ApplicationSharedPtr app);
+
+ bool auto_allowed() const {
+ return auto_allowed_;
+ }
+
+ void set_auto_allowed(const bool value) {
+ auto_allowed_ = value;
+ }
+
+ /**
+ * @brief executes specific logic of children classes
+ */
+ void virtual Execute() = 0;
+
+ void set_disallowed_info(const std::string& info) {
+ disallowed_info_ = info;
+ }
+
+ virtual std::string ModuleType() = 0;
+
+ private:
+ /**
+ * @brief CheckDriverConsent checks driver consent defined in policy table
+ * @return True if no consent is required, otherwise - false
+ */
+ bool CheckDriverConsent();
+
+ /**
+ * @brief AcquireResources checks whether resource status is busy or not and
+ * then tries to acquire this resource. In case driver consent is required -
+ * sends consent request to HMI.
+ * @return True in case of resource is free and successfully acquired,
+ * otherwise false
+ */
+ bool AcquireResources();
+ void SendDisallowed(TypeAccess access);
+
+ /**
+ * @brief SendGetUserConsent sends consent request to HMI
+ * @param module_type Resource name
+ */
+ void SendGetUserConsent(const std::string& module_type);
+ void ProcessAccessResponse(const app_mngr::event_engine::Event& event);
+ bool IsInterfaceAvailable(
+ const app_mngr::HmiInterfaces::InterfaceID interface) const;
+
+ std::string disallowed_info_;
+};
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
new file mode 100644
index 0000000000..bb45247fae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#include <string>
+#include "smart_objects/smart_object.h"
+
+namespace rc_rpc_plugin {
+
+/**
+ * @brief The InteriorDataCache interface for caching data class
+ * Provide ability to cache module data by module type name and clear cache
+ */
+class InteriorDataCache {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~InteriorDataCache() {}
+
+ /**
+ * @brief Add module data to cache
+ * @param module_type module type name
+ * @param module_data data to be cached
+ */
+ virtual void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) = 0;
+
+ /**
+ * @brief Retrieve Get cached data
+ * @param module_type data type to get from cache
+ * @return smart object with cached data, or nulll smart object
+ */
+ virtual smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const = 0;
+
+ /**
+ * @brief Contains check if data exists in cache
+ * @param module_type module type name to check in cache
+ * @return true if cached, false otherwize
+ */
+ virtual bool Contains(const std::string& module_type) const = 0;
+
+ /**
+ * @brief Remove cached data
+ * @param module_type data type to remove from cache
+ */
+ virtual void Remove(const std::string& module_type) = 0;
+
+ /**
+ * @brief Clear clear all cached data
+ */
+ virtual void Clear() = 0;
+};
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
new file mode 100644
index 0000000000..f2971e3d72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+
+#include <map>
+
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin {
+class InteriorDataCacheImpl : public InteriorDataCache {
+ public:
+ InteriorDataCacheImpl();
+
+ ~InteriorDataCacheImpl();
+
+ void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) OVERRIDE;
+ smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const OVERRIDE;
+ bool Contains(const std::string& module_type) const OVERRIDE;
+ void Remove(const std::string& module_type) OVERRIDE;
+ void Clear() OVERRIDE;
+
+ private:
+ std::map<std::string, smart_objects::SmartObject> cached_data_;
+ mutable sync_primitives::Lock cached_data_lock_;
+};
+
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
new file mode 100644
index 0000000000..f28c388055
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+
+namespace rc_rpc_plugin {
+
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class InteriorDataManager {
+ public:
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) = 0;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnDisablingRC process disable RC event. Unsubscribe from all modules
+ * and clear cache
+ */
+ virtual void OnDisablingRC() = 0;
+
+ /**
+ * @brief StoreRequestToHMITime save information and time stamp of
+ * current interior data subscriptions
+ */
+ virtual void StoreRequestToHMITime(const std::string& module_type) = 0;
+
+ /**
+ * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed of
+ * bounce during current time frame.
+ * calculate amount of requests per module type in time frame and checks if it
+ * bigger then allowed by ini file
+ * @param module_type moduletype to calculate frequency on
+ * @return true if amount of requests was not exceeded, otherwise return false.
+ */
+ virtual bool CheckRequestsToHMIFrequency(const std::string& module_type) = 0;
+};
+
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
new file mode 100644
index 0000000000..9b16a2c4da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#include "rc_rpc_plugin/interior_data_manager.h"
+#include "utils/date_time.h"
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+}
+namespace rc_rpc_plugin {
+
+class InteriorDataCache;
+class RCRPCPlugin;
+
+class InteriorDataManagerImpl : public InteriorDataManager {
+ public:
+ InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service);
+
+ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
+
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ void OnDisablingRC() OVERRIDE;
+
+ void StoreRequestToHMITime(const std::string& module_type) OVERRIDE;
+
+ bool CheckRequestsToHMIFrequency(const std::string& module_type) OVERRIDE;
+
+ private:
+ /**
+ * @brief UpdateHMISubscriptionsOnPolicyUpdated process policy update event.
+ * If some modules was disabeled by policies and there are no applications
+ * that subscribed to them - send RC.GetInteriorVehicleData(subscribe=false)
+ * and clear cache
+ */
+ void UpdateHMISubscriptionsOnPolicyUpdated();
+
+ /**
+ * @brief UpdateHMISubscriptionsOnAppUnregistered process AppUnregistered
+ * event and unsubscribed from not actual module types
+ * @param app application that was unregistered
+ */
+ void UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData remove module_type from cache and
+ * send RC.GetInteriorVehicleData(subscribe=false) to HMI
+ * @param module_type module type that need to be unsubscribed
+ */
+ void UnsubscribeFromInteriorVehicleData(const std::string& module_type);
+
+ void ClearOldRequestsToHMIHistory();
+ /**
+ * @brief AppsModules mapping from applications to list of modules
+ */
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+
+ /**
+ * @brief AppsSubscribedModules get mapping of application to list of
+ * subscribed modules
+ * @return map of applications to list of subscribed modules
+ */
+ AppsModules AppsSubscribedModules();
+
+ /**
+ * @brief RequestsToHMIHistory mapping from module type to vector of time
+ * stamps
+ */
+ typedef std::map<std::string, std::deque<date_time::TimeDuration> >
+ RequestsToHMIHistory;
+ RequestsToHMIHistory requests_to_hmi_history_;
+ mutable sync_primitives::Lock requests_to_hmi_history_lock_;
+
+ RCRPCPlugin& rc_plugin_;
+ InteriorDataCache& cache_;
+ application_manager::ApplicationManager& app_mngr_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+};
+
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
new file mode 100644
index 0000000000..e36968fc4b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
+
+#include <string>
+#include <set>
+#include <memory>
+#include "utils/macro.h"
+#include "application_manager/app_extension.h"
+
+namespace rc_rpc_plugin {
+class RCAppExtension : public application_manager::AppExtension {
+ public:
+ explicit RCAppExtension(application_manager::AppExtensionUID uid);
+ ~RCAppExtension();
+
+ /**
+ * @brief Subscribe to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void SubscribeToInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief Unsubscribe from OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void UnsubscribeFromInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData removes all subscriptions for
+ * interior data
+ */
+ void UnsubscribeFromInteriorVehicleData();
+
+ /**
+ * @brief Check if application subscribed to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ bool IsSubscibedToInteriorVehicleData(const std::string& module_type);
+
+ /**
+ * @brief get list of subscriptions of application
+ * @return list of subscriptions of application
+ */
+ std::set<std::string> InteriorVehicleDataSubscriptions() const;
+
+ private:
+ std::set<std::string> subscribed_interior_vehicle_data_;
+
+ // AppExtension interface
+ public:
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+ void ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+};
+
+typedef std::shared_ptr<RCAppExtension> RCAppExtensionPtr;
+
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
new file mode 100644
index 0000000000..56be342b56
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
+
+#include <memory>
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace app_mngr = application_manager;
+using policy::PolicyHandlerInterface;
+class RCCommandFactory : public application_manager::CommandFactory {
+ public:
+ /**
+ * @brief RCCommandFactory class constructor
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @param allocation_manager ResourceAllocationManager
+ **/
+ RCCommandFactory(const RCCommandParams& params);
+ application_manager::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ virtual bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_mobile_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type) const;
+
+ app_mngr::CommandCreator& get_hmi_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type) const;
+
+ RCCommandParams params_;
+};
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
new file mode 100644
index 0000000000..cf3c6cd5e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+
+#include <map>
+#include <string>
+#include "application_manager/application.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+class RCRPCPlugin;
+
+/**
+ * @brief The RCHelpers class contains frequently used static data
+ * structures related strictly to RC
+ * Converters, mapping, factory functions
+ */
+class RCHelpers {
+ public:
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module data filed name
+ * @return module mapping from enum naming to filed name
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToDataMapping();
+
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module capabilities key
+ * @return module mapping from enum naming to capabilities key
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToCapabilitiesMapping();
+
+ /**
+ * @brief GetModulesList get list of all known modules
+ * @return vector contains all known modules
+ */
+ static const std::vector<std::string> GetModulesList();
+
+ /**
+ * @brief GetRCExtension extract RC extension from application
+ * @param app application to extract extension
+ * @return rc extension of app is rc applicaiton, otherwise return emty shared
+ * pointer.
+ */
+ static RCAppExtensionPtr GetRCExtension(
+ application_manager::Application& app);
+
+ static smart_objects::SmartObjectSPtr CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id);
+
+ static std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type);
+
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+ static AppsModules GetApplicationsAllowedModules(
+ application_manager::ApplicationManager& app_mngr);
+};
+
+} // rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
new file mode 100644
index 0000000000..1951af1a24
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
@@ -0,0 +1,278 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
+
+namespace rc_rpc_plugin {
+
+namespace strings {
+// RemoteControlCapabilities constants
+const char kclimateControlCapabilities[] = "climateControlCapabilities";
+const char kradioControlCapabilities[] = "radioControlCapabilities";
+const char kbuttonCapabilities[] = "buttonCapabilities";
+const char kaudioControlCapabilities[] = "audioControlCapabilities";
+const char klightControlCapabilities[] = "lightControlCapabilities";
+const char khmiSettingsControlCapabilities[] = "hmiSettingsControlCapabilities";
+const char kseatControlCapabilities[] = "seatControlCapabilities";
+// RemoteControlCapabilities constants
+
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+const char kSupportedLights[] = "supportedLights";
+
+// LightControlCapabilities
+const char kName[] = "name";
+const char kStatusAvailable[] = "statusAvailable";
+const char kDensityAvailable[] = "densityAvailable";
+const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable";
+
+// RadioControlCapabilities
+const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable";
+} // strings
+
+namespace result_codes {
+const char kSuccess[] = "SUCCESS";
+const char kUnsupportedRequest[] = "UNSUPPORTED_REQUEST";
+const char kUnsupportedResource[] = "UNSUPPORTED_RESOURCE";
+const char kDisallowed[] = "DISALLOWED";
+const char kRejected[] = "REJECTED";
+const char kAborted[] = "ABORTED";
+const char kIgnored[] = "IGNORED";
+const char kRetry[] = "RETRY";
+const char kInUse[] = "IN_USE";
+const char kVehicleDataNotAvailable[] = "VEHICLE_DATA_NOT_AVAILABLE";
+const char kTimedOut[] = "TIMED_OUT";
+const char kInvalidData[] = "INVALID_DATA";
+const char kCharLimitExceeded[] = "CHAR_LIMIT_EXCEEDED";
+const char kInvalidId[] = "INVALID_ID";
+const char kDuplicateName[] = "DUPLICATE_NAME";
+const char kApplicationNotRegistered[] = "APPLICATION_NOT_REGISTERED";
+const char kOutOfMemory[] = "OUT_OF_MEMORY";
+const char kTooManyPendingRequests[] = "TOO_MANY_PENDING_REQUESTS";
+const char kWarnings[] = "WARNINGS";
+const char kWrongLanguage[] = "WRONG_LANGUAGE";
+const char kGenericError[] = "GENERIC_ERROR";
+const char kUserDisallowed[] = "USER_DISALLOWED";
+const char kReadOnly[] = "READ_ONLY";
+} // result_codes
+
+namespace json_keys {
+const char kParams[] = "params";
+const char kSuccess[] = "success";
+const char kResultCode[] = "resultCode";
+const char kResult[] = "result";
+const char kInfo[] = "info";
+const char kId[] = "id";
+const char kJsonrpc[] = "jsonrpc";
+const char kMethod[] = "method";
+const char kError[] = "error";
+const char kMessage[] = "message";
+const char kData[] = "data";
+const char kAppId[] = "appID";
+const char kCode[] = "code";
+} // json_keys
+
+namespace message_params {
+const char kName[] = "name";
+const char kId[] = "id";
+
+// SetInteriorVehicleData request
+const char kModuleData[] = "moduleData";
+// SetInteriorVehicleData request
+
+// GetInteriorVehicleData request
+const char kSubscribe[] = "subscribe";
+// GetInteriorVehicleData request
+
+// GetInteriorVehicleData response
+const char kIsSubscribed[] = "isSubscribed";
+// GetInteriorVehicleData response
+
+// OnRemoteControlSettings notification
+const char kAccessMode[] = "accessMode";
+const char kAllowed[] = "allowed";
+// OnRemoteControlSettings notification
+
+// ButtonPress request
+const char kModuleType[] = "moduleType";
+const char kButtonName[] = "buttonName";
+const char kButtonPressMode[] = "buttonPressMode";
+// ButtonPress request
+
+// OnRCStatusNotification
+const char kAllocatedModules[] = "allocatedModules";
+const char kFreeModules[] = "freeModules";
+// OnRCStatusNotification
+
+// RdsData struct
+const char kPS[] = "PS";
+const char kRT[] = "RT";
+const char kCT[] = "CT";
+const char kPI[] = "PI";
+const char kPTY[] = "PTY";
+const char kTA[] = "TA";
+const char kTP[] = "TP";
+const char kREG[] = "REG";
+// RdsData struct
+
+// RadioControlData struct
+const char kFrequencyInteger[] = "frequencyInteger";
+const char kFrequencyFraction[] = "frequencyFraction";
+const char kBand[] = "band";
+const char kRdsData[] = "rdsData";
+const char kAvailableHDs[] = "availableHDs";
+const char kHdChannel[] = "hdChannel";
+const char kSignalStrength[] = "signalStrength";
+const char kSignalChangeThreshold[] = "signalChangeThreshold";
+const char kRadioEnable[] = "radioEnable";
+const char kState[] = "state";
+const char kSisData[] = "sisData";
+// RadioControlData struct
+
+// ClimateControlData struct
+const char kFanSpeed[] = "fanSpeed";
+const char kCurrentTemperature[] = "currentTemperature";
+const char kDesiredTemperature[] = "desiredTemperature";
+const char kTemperatureUnit[] = "temperatureUnit";
+const char kACEnable[] = "acEnable";
+const char kCirculateAirEnable[] = "circulateAirEnable";
+const char kAutoModeEnable[] = "autoModeEnable";
+const char kDefrostZone[] = "defrostZone";
+const char kDualModeEnable[] = "dualModeEnable";
+const char kACMaxEnable[] = "acMaxEnable";
+const char kVentilationMode[] = "ventilationMode";
+const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable";
+const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable";
+const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable";
+const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable";
+// ClimateControlData struct
+
+// LightControlData
+const char kLightState[] = "lightState";
+const char kLightStatus[] = "status";
+const char kLightDensity[] = "density";
+const char kLightColor[] = "color";
+
+// AudioControlData
+const char kSource[] = "source";
+const char kKeepContext[] = "keepContext";
+const char kEqualizerSettings[] = "equalizerSettings";
+const char kChannelName[] = "channelName";
+
+// ModuleData struct
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+const char kAudioControlData[] = "audioControlData";
+const char kLightControlData[] = "lightControlData";
+const char kHmiSettingsControlData[] = "hmiSettingsControlData";
+const char kSeatControlData[] = "seatControlData";
+// ModuleData struct
+
+const char kHMIAppID[] = "appID";
+const char kHmiLevel[] = "hmiLevel";
+const char kSysContext[] = "systemContext";
+const char kAudioState[] = "audioStreamingState";
+} // namespace message_params
+
+namespace enums_value {
+
+// ModuleType enum
+const char kClimate[] = "CLIMATE";
+const char kRadio[] = "RADIO";
+const char kSeat[] = "SEAT";
+const char kAudio[] = "AUDIO";
+const char kLight[] = "LIGHT";
+const char kHmiSettings[] = "HMI_SETTINGS";
+// ModuleType enum
+
+// RadioBand enum
+const char kAM[] = "AM";
+const char kFM[] = "FM";
+const char kXM[] = "XM";
+// RadioBand enum
+
+// RadioState enum
+const char kAcquiring[] = "ACQUIRING";
+const char kAcquired[] = "ACQUIRED";
+const char kMulticast[] = "MULTICAST";
+const char kNotFound[] = "NOT_FOUND";
+// RadioState enum
+
+// DefrostZone enum
+const char kFront[] = "FRONT";
+const char kRear[] = "REAR";
+const char kAll[] = "ALL";
+// DefrostZone enum
+
+// TemperatureUnit enum
+const char kFahrenheit[] = "FAHRENHEIT";
+const char kCelsius[] = "CELSIUS";
+// TemperatureUnit enum
+
+// ButtonName enum
+const char kACMax[] = "AC_MAX";
+const char kAC[] = "AC";
+const char kRecirculate[] = "RECIRCULATE";
+const char kFanUp[] = "FAN_UP";
+const char kFanDown[] = "FAN_DOWN";
+const char kTempUp[] = "TEMP_UP";
+const char kTempDown[] = "TEMP_DOWN";
+const char kDefrostMax[] = "DEFROST_MAX";
+const char kDefrost[] = "DEFROST";
+const char kDefrostRear[] = "DEFROST_REAR";
+const char kUpperVent[] = "UPPER_VENT";
+const char kLowerVent[] = "LOWER_VENT";
+const char kVolumeUp[] = "VOLUME_UP";
+const char kVolumeDown[] = "VOLUME_DOWN";
+const char kEject[] = "EJECT";
+const char kSource[] = "SOURCE";
+const char kShuffle[] = "SHUFFLE";
+const char kRepeat[] = "REPEAT";
+// ButtonName enum
+
+// ButtonPressMode enum
+const char kLong[] = "LONG";
+const char kShort[] = "SHORT";
+// ButtonPressMode enum
+
+// Access mode enum
+const char kAutoAllow[] = "AUTO_ALLOW";
+const char kAutoDeny[] = "AUTO_DENY";
+const char kAskDriver[] = "ASK_DRIVER";
+// Access mode enum
+
+} // namespace enums_value
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
new file mode 100644
index 0000000000..ae88ed9cc0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
@@ -0,0 +1,113 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+
+#include <memory>
+
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "application_manager/command_factory.h"
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+
+namespace rc_rpc_plugin {
+namespace plugins = application_manager::plugin_manager;
+namespace app_mngr = application_manager;
+
+class RCRPCPlugin : public plugins::RPCPlugin {
+ public:
+ /**
+ * @brief Command initialization function
+ * @param app_manager ApplicationManager
+ * @param rpc_service RPCService
+ * @param hmi_capabilities HMICapabilities
+ * @param policy_handler PolicyHandlerInterface
+ * @return true in case initialization was succesful, false otherwise.
+ **/
+ bool Init(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+ /**
+ * @param int32_t command id
+ * @param CommandSource source
+ * @return return true if command can be create, else return false
+ **/
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource message_source) OVERRIDE;
+ /**
+ * @brief PluginName plugin name
+ * @return plugin name
+ */
+ std::string PluginName() OVERRIDE;
+ /**
+ * @brief GetCommandFactory get that is able to generate command
+ * from message
+ * @return plugins command factory
+ */
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ static const uint32_t kRCPluginID = 153;
+
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+ static Apps GetRCApplications(
+ application_manager::ApplicationManager& app_mngr);
+
+ private:
+ application_manager::rpc_service::RPCService* rpc_service_;
+ application_manager::ApplicationManager* app_mngr_;
+ std::unique_ptr<application_manager::CommandFactory> command_factory_;
+ std::unique_ptr<ResourceAllocationManager> resource_allocation_manager_;
+ std::unique_ptr<InteriorDataCache> interior_data_cache_;
+ std::unique_ptr<InteriorDataManager> interior_data_manager_;
+};
+} // namespace rc_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
new file mode 100644
index 0000000000..67598b667b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
@@ -0,0 +1,178 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
+#include <string>
+#include "utils/macro.h"
+
+#include "interfaces/HMI_API.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+
+/**
+ * Enum for list of results of allocation resources
+ */
+namespace AcquireResult {
+enum eType { ALLOWED = 0, IN_USE, ASK_DRIVER, REJECTED };
+}
+
+/**
+ * Defines states of acquired resource
+ */
+namespace ResourceState {
+enum eType { FREE = 0, BUSY };
+}
+
+/**
+ * Defines triggers for OnRCStatus notification sending
+ */
+namespace NotificationTrigger {
+/**
+ * @brief The eType
+ * APP_REGISTRATION RC app registation event
+ * RC_STATE_CHANGING enabling/disabling RC on HMI event
+ * MODULE_ALLOCATION module allocation/deallocation event
+ */
+enum eType { APP_REGISTRATION = 0, MODULE_ALLOCATION, RC_STATE_CHANGING };
+}
+
+/**
+ * @brief Resources defines list of resources
+ */
+typedef std::vector<std::string> Resources;
+
+class ResourceAllocationManager {
+ public:
+ /**
+ * @brief AcquireResource acquires resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ * @return ALLOWED if resource acquired \
+ * IN_USE if resource already acquired
+ * ASK_DRIVER if driver confirmation is required
+ */
+ virtual AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
+ virtual void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) = 0;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const = 0;
+
+ /**
+ * @brief AcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ */
+ virtual void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnDriverDisallowed callback for rejecting acquiring resource
+ * @param module_type resource type
+ * @param app_id application id
+ */
+ virtual void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) = 0;
+
+ /**
+ * @brief Set current access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) = 0;
+
+ /**
+ * @brief Get last set access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual hmi_apis::Common_RCAccessMode::eType GetAccessMode() const = 0;
+
+ /**
+ * @brief Remove all information about all allocations
+ */
+ virtual void ResetAllAllocations() = 0;
+
+ /**
+ * @brief Create and send OnRCStatusNotification to mobile and HMI
+ * @param event trigger for notification sending
+ * @param application - app that should receive notification
+ * in case of registration; in cases of RC enabling/disabling
+ * or module allocation - application is just empty shared ptr,
+ * because in these cases all registered RC apps should
+ * receive a notification
+ */
+ virtual void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ virtual bool is_rc_enabled() const = 0;
+
+ virtual void set_rc_enabled(const bool value) = 0;
+
+ virtual ~ResourceAllocationManager() {}
+};
+
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
new file mode 100644
index 0000000000..b359ee4d29
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
@@ -0,0 +1,224 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "application_manager/application_impl.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+
+namespace rc_rpc_plugin {
+
+typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+class ResourceAllocationManagerImpl : public ResourceAllocationManager {
+ public:
+ ResourceAllocationManagerImpl(
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service);
+
+ ~ResourceAllocationManagerImpl();
+
+ /**
+ * @brief AcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resourc
+ * @return result of acauiring resources
+ */
+ AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) OVERRIDE FINAL;
+ /**
+ * @brief ForceAcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ */
+ void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
+ void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL;
+
+ hmi_apis::Common_RCAccessMode::eType GetAccessMode() const FINAL;
+
+ void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) FINAL;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) FINAL;
+
+ void ResetAllAllocations() FINAL;
+
+ void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) FINAL;
+
+ bool is_rc_enabled() const FINAL;
+
+ void set_rc_enabled(const bool value) FINAL;
+
+ private:
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+ /**
+ * @brief Create OnRCStatusNotification creates OnRCStatus notification smart
+ * object for mobile application
+ * @param app_id application to send OnRCStatusNotification
+ * @return smart object with mobile OnRCStatusNotification
+ */
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app);
+
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app);
+
+ /**
+ * @brief IsModuleTypeRejected check if current resource was rejected by
+ * driver for current application
+ * @param module_type resource to check
+ * @param app_id application id
+ * @return true if current resource was rejected by driver for current
+ * application, otherwise - false
+ */
+ bool IsModuleTypeRejected(const std::string& module_type,
+ const uint32_t app_id);
+
+ /**
+ * @brief ReleaseResource Releases resource acquired by application
+ * @param module_type Module name
+ * @param application_id Application id
+ */
+ void ReleaseResource(const std::string& module_type,
+ const uint32_t application_id);
+
+ /**
+ * @brief GetAcquiredResources Provides resources acquired by particular
+ * application currently
+ * @param application_id Application id
+ * @return List of acquired resources by specific application
+ */
+ Resources GetAcquiredResources(const uint32_t application_id) const;
+
+ /**
+ * @brief ProcessApplicationPolicyUpdate Checks if allowed modules list is
+ * changed for registered RC applications and releases in case some modules
+ * now out of the list
+ */
+ void ProcessApplicationPolicyUpdate();
+
+ /**
+ * @brief RemoveAppsSubscriptions Removes subscriptions for interior data for
+ * applications in the list
+ * @param apps Application list
+ */
+ void RemoveAppsSubscriptions(const Apps& apps);
+
+ /**
+ * @brief SetResourceAquired mark resourse as aquired and process logic of
+ * changing state of aquired resources
+ * @param module_type resource name
+ * @param app applicastion that aquire resource
+ */
+ void SetResourceAquired(const std::string& module_type,
+ const uint32_t app_id);
+ /**
+ * @brief SetResourceFree mark resourse as free and process logic of
+ * changing state of aquired resources
+ * @param module_type resource name
+ * @param app applicastion that aquire resource
+ */
+ void SetResourceFree(const std::string& module_type, const uint32_t app_id);
+
+ /**
+ * @brief AllocatedResources contains link between resource and application
+ * owning that resource
+ */
+ typedef std::map<std::string, uint32_t> AllocatedResources;
+ AllocatedResources allocated_resources_;
+ mutable sync_primitives::Lock allocated_resources_lock_;
+
+ /**
+ * @brief ResourcesState contains states of ALLOCATED resources
+ */
+ typedef std::map<std::string, ResourceState::eType> ResourcesState;
+ ResourcesState resources_state_;
+ mutable sync_primitives::Lock resources_state_lock_;
+
+ /**
+ * @brief RejectedResources type for connecting list of resources rejected by
+ * driver for application
+ * application_id : [vector of rejected resources]
+ */
+ typedef std::map<uint32_t, std::vector<std::string> > RejectedResources;
+ RejectedResources rejected_resources_for_application_;
+ mutable sync_primitives::Lock rejected_resources_for_application_lock_;
+
+ hmi_apis::Common_RCAccessMode::eType current_access_mode_;
+ application_manager::ApplicationManager& app_mngr_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+ bool is_rc_enabled_;
+};
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc
new file mode 100644
index 0000000000..75faf5db8c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCButtonPressRequest::RCButtonPressRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : app_mngr::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCButtonPressRequest::~RCButtonPressRequest() {}
+
+void RCButtonPressRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc
new file mode 100644
index 0000000000..5c1691ed7b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCButtonPressResponse::RCButtonPressResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCButtonPressResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCButtonPressResponse::~RCButtonPressResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
new file mode 100644
index 0000000000..774ee04677
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataConsentRequest::RCGetInteriorVehicleDataConsentRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCGetInteriorVehicleDataConsentRequest::
+ ~RCGetInteriorVehicleDataConsentRequest() {}
+
+void RCGetInteriorVehicleDataConsentRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
new file mode 100644
index 0000000000..3244857656
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataConsentResponse::
+ RCGetInteriorVehicleDataConsentResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCGetInteriorVehicleDataConsentResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent);
+
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCGetInteriorVehicleDataConsentResponse::
+ ~RCGetInteriorVehicleDataConsentResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..c7baf75e27
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest() {}
+
+void RCGetInteriorVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..e56f9088bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/event_engine/event.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCGetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCGetInteriorVehicleDataResponse::~RCGetInteriorVehicleDataResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
new file mode 100644
index 0000000000..0117003f11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+RCOnInteriorVehicleDataNotification::~RCOnInteriorVehicleDataNotification() {}
+
+void RCOnInteriorVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[app_mngr::strings::params][app_mngr::strings::function_id] =
+ static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(rc_rpc_plugin::message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
new file mode 100644
index 0000000000..91cb6cb7ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc
@@ -0,0 +1,138 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+namespace {
+std::map<std::string, hmi_apis::Common_RCAccessMode::eType> access_modes{
+ {enums_value::kAutoAllow, hmi_apis::Common_RCAccessMode::AUTO_ALLOW},
+ {enums_value::kAutoDeny, hmi_apis::Common_RCAccessMode::AUTO_DENY},
+ {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}};
+}
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_manager_(params.interior_data_manager_) {}
+
+RCOnRemoteControlSettingsNotification::
+ ~RCOnRemoteControlSettingsNotification() {}
+
+hmi_apis::Common_RCAccessMode::eType AccessModeFromString(
+ const std::string& access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ mode = access_modes.find(access_mode);
+ return access_modes.end() != mode
+ ? mode->second
+ : hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+}
+
+std::string AccessModeToString(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ it = access_modes.begin();
+ for (; access_modes.end() != it; ++it) {
+ if (access_mode == it->second) {
+ return it->first;
+ }
+ }
+ const std::string error = "UNKNOW_ACCESS_MODE";
+ DCHECK_OR_RETURN(false, error);
+ return error;
+}
+
+void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ interior_data_manager_.OnDisablingRC();
+}
+
+void RCOnRemoteControlSettingsNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!(*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kAllowed)) {
+ LOG4CXX_DEBUG(logger_,
+ "Notification is ignored due to \"allow\" parameter absense");
+ LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged");
+ return;
+ }
+
+ const bool is_allowed =
+ (*message_)[app_mngr::strings::msg_params][message_params::kAllowed]
+ .asBool();
+ if (is_allowed) {
+ hmi_apis::Common_RCAccessMode::eType access_mode =
+ hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+ LOG4CXX_DEBUG(logger_, "Allowing RC Functionality");
+ resource_allocation_manager_.set_rc_enabled(true);
+ if ((*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kAccessMode)) {
+ access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kAccessMode].asUInt());
+ LOG4CXX_DEBUG(
+ logger_,
+ "Setting up access mode : " << AccessModeToString(access_mode));
+ } else {
+ access_mode = resource_allocation_manager_.GetAccessMode();
+ LOG4CXX_DEBUG(logger_,
+ "No access mode received. Using last known: "
+ << AccessModeToString(access_mode));
+ }
+ resource_allocation_manager_.SetAccessMode(access_mode);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality");
+ DisallowRCFunctionality();
+ resource_allocation_manager_.ResetAllAllocations();
+ resource_allocation_manager_.set_rc_enabled(false);
+ }
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..f0d5ecc177
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc
@@ -0,0 +1,55 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+RCSetInteriorVehicleDataRequest::~RCSetInteriorVehicleDataRequest() {}
+
+void RCSetInteriorVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..56d924debe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+
+void RCSetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::event_engine::Event event(
+ hmi_apis::FunctionID::RC_SetInteriorVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+RCSetInteriorVehicleDataResponse::~RCSetInteriorVehicleDataResponse() {}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
new file mode 100644
index 0000000000..5ce047071c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
+
+ButtonPressRequest::ButtonPressRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
+
+ButtonPressRequest::~ButtonPressRequest() {}
+
+const std::vector<std::string> buttons_climate() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kACMax);
+ data.push_back(enums_value::kAC);
+ data.push_back(enums_value::kRecirculate);
+ data.push_back(enums_value::kFanUp);
+ data.push_back(enums_value::kFanDown);
+ data.push_back(enums_value::kTempUp);
+ data.push_back(enums_value::kTempDown);
+ data.push_back(enums_value::kDefrostMax);
+ data.push_back(enums_value::kDefrost);
+ data.push_back(enums_value::kDefrostRear);
+ data.push_back(enums_value::kUpperVent);
+ data.push_back(enums_value::kLowerVent);
+ return data;
+}
+
+const std::vector<std::string> buttons_radio() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kVolumeUp);
+ data.push_back(enums_value::kVolumeDown);
+ data.push_back(enums_value::kEject);
+ data.push_back(enums_value::kSource);
+ data.push_back(enums_value::kShuffle);
+ data.push_back(enums_value::kRepeat);
+ return data;
+}
+
+const ButtonsMap buttons_map() {
+ using namespace mobile_apis;
+
+ ButtonsMap buttons_map;
+ buttons_map[enums_value::kACMax] = ButtonName::AC_MAX;
+ buttons_map[enums_value::kAC] = ButtonName::AC;
+ buttons_map[enums_value::kRecirculate] = ButtonName::RECIRCULATE;
+ buttons_map[enums_value::kFanUp] = ButtonName::FAN_UP;
+ buttons_map[enums_value::kFanDown] = ButtonName::FAN_DOWN;
+ buttons_map[enums_value::kTempUp] = ButtonName::TEMP_UP;
+ buttons_map[enums_value::kTempDown] = ButtonName::TEMP_DOWN;
+ buttons_map[enums_value::kDefrostMax] = ButtonName::DEFROST_MAX;
+ buttons_map[enums_value::kDefrost] = ButtonName::DEFROST;
+ buttons_map[enums_value::kDefrostRear] = ButtonName::DEFROST_REAR;
+ buttons_map[enums_value::kUpperVent] = ButtonName::UPPER_VENT;
+ buttons_map[enums_value::kLowerVent] = ButtonName::LOWER_VENT;
+ buttons_map[enums_value::kVolumeUp] = ButtonName::VOLUME_UP;
+ buttons_map[enums_value::kVolumeDown] = ButtonName::VOLUME_DOWN;
+ buttons_map[enums_value::kEject] = ButtonName::EJECT;
+ buttons_map[enums_value::kSource] = ButtonName::SOURCE;
+ buttons_map[enums_value::kShuffle] = ButtonName::SHUFFLE;
+ buttons_map[enums_value::kRepeat] = ButtonName::REPEAT;
+
+ return buttons_map;
+}
+
+bool CheckIfButtonExistInRCCaps(
+ const smart_objects::SmartObject& rc_capabilities,
+ const mobile_apis::ButtonName::eType button) {
+ if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ rc_capabilities[strings::kbuttonCapabilities];
+ auto it = button_caps.asArray()->begin();
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[message_params::kName].asInt();
+ if (-1 == current_id) {
+ // capabilities received from HMI contains enum values
+ // capabilities loaded from file contains string values
+ // TODO : unificate capabilities storing
+ const std::string& bt_name = so[message_params::kName].asString();
+ static ButtonsMap btn_map = buttons_map();
+ current_id = btn_map[bt_name];
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == button) {
+ LOG4CXX_TRACE(logger_,
+ "Button id " << current_button
+ << " exist in capabilities");
+ return true;
+ }
+ }
+ }
+ LOG4CXX_TRACE(logger_,
+ "Button id " << button << " do not exist in capabilities");
+ return false;
+}
+
+bool CheckButtonName(const std::string& module_type,
+ const std::string& button_name,
+ const smart_objects::SmartObject* rc_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (rc_capabilities == NULL) {
+ LOG4CXX_ERROR(logger_, "No remote controll capabilities available");
+ return false;
+ }
+
+ if (enums_value::kRadio == module_type) {
+ if (!helpers::in_range(buttons_radio(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess climate button with module type radio");
+ return false;
+ }
+ }
+
+ if (enums_value::kClimate == module_type) {
+ if (!helpers::in_range(buttons_climate(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess radio button with module type climate");
+ return false;
+ }
+ }
+ return true;
+}
+
+void ButtonPressRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const char* button_name;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::ButtonName::eType>::EnumToCString(
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kButtonName].asUInt()),
+ &button_name);
+
+ const std::string module_type = ModuleType();
+ static ButtonsMap btn_map = buttons_map();
+ mobile_apis::ButtonName::eType button_id =
+ mobile_apis::ButtonName::INVALID_ENUM;
+ if (btn_map.end() != btn_map.find(button_name)) {
+ button_id = btn_map[button_name];
+ }
+
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+ const bool button_name_matches_module_type =
+ CheckButtonName(module_type, button_name, rc_capabilities);
+ const bool button_id_exist_in_caps =
+ rc_capabilities &&
+ CheckIfButtonExistInRCCaps(*rc_capabilities, button_id);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ (*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
+ app->app_id();
+
+ if (button_name_matches_module_type && button_id_exist_in_caps) {
+ SendHMIRequest(hmi_apis::FunctionID::Buttons_ButtonPress,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ } else if (!button_name_matches_module_type) {
+ LOG4CXX_WARN(logger_, "Request module type and button name mismatch!");
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Request module type and button name mismatch!");
+ } else {
+ LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!");
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Requested button is not exists in capabilities!");
+ }
+}
+
+AcquireResult::eType ButtonPressRequest::AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ return resource_allocation_manager_.AcquireResource(module_type,
+ app->app_id());
+}
+
+bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return resource_allocation_manager_.IsResourceFree(module_type);
+}
+
+void ButtonPressRequest::SetResourceState(const std::string& module_type,
+ const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ resource_allocation_manager_.SetResourceState(
+ module_type, app->app_id(), state);
+}
+
+void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::Buttons_ButtonPress != event.id()) {
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ if (mobile_apis::Result::READ_ONLY == result_code) {
+ result = false;
+ result_code = mobile_apis::Result::GENERIC_ERROR;
+ }
+ std::string response_info;
+ GetInfo(message, response_info);
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(result, result_code, response_info.c_str());
+}
+
+std::string ButtonPressRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type = static_cast<
+ mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc
new file mode 100644
index 0000000000..491b0363c9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/button_press_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+ButtonPressResponse::ButtonPressResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+ButtonPressResponse::~ButtonPressResponse() {}
+
+void ButtonPressResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..93e37b95a7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc
@@ -0,0 +1,379 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params)
+
+ , excessive_subscription_occured_(false) {}
+
+bool CheckIfModuleTypeExistInCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& mapping = RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ const auto& module_list = RCHelpers::GetModulesList();
+ bool is_module_type_valid = false;
+ for (const auto& module : module_list) {
+ if (module == module_type) {
+ if (rc_capabilities.keyExists(mapping(module))) {
+ is_module_type_valid = true;
+ break;
+ }
+ }
+ }
+ return is_module_type_valid;
+}
+
+bool GetInteriorVehicleDataRequest::ProcessCapabilities() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+
+ const std::string module_type = ModuleType();
+ if (rc_capabilities &&
+ !CheckIfModuleTypeExistInCapabilities(*rc_capabilities, module_type)) {
+ LOG4CXX_WARN(logger_, "Accessing not supported module data");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Accessing not supported module data");
+ return false;
+ }
+ return true;
+}
+
+void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ auto data = interior_data_cache_.Retrieve(ModuleType());
+ auto response_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_msg_params[message_params::kModuleData][data_mapping(ModuleType())] =
+ data;
+ response_msg_params[message_params::kModuleData]
+ [message_params::kModuleType] = ModuleType();
+
+ const auto& request_msg_params = (*message_)[app_mngr::strings::msg_params];
+ LOG4CXX_DEBUG(logger_,
+ "kSubscribe exist" << request_msg_params.keyExists(
+ message_params::kSubscribe));
+ if (request_msg_params.keyExists(message_params::kSubscribe)) {
+ response_msg_params[message_params::kIsSubscribed] =
+ request_msg_params[message_params::kSubscribe].asBool();
+ if (request_msg_params[message_params::kSubscribe].asBool()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->SubscribeToInteriorVehicleData(ModuleType());
+ }
+ }
+ SendResponse(
+ true, mobile_apis::Result::SUCCESS, nullptr, &response_msg_params);
+ if (AppShouldBeUnsubscribed()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->UnsubscribeFromInteriorVehicleData(ModuleType());
+ }
+}
+
+bool GetInteriorVehicleDataRequest::CheckRateLimits() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return interior_data_manager_.CheckRequestsToHMIFrequency(ModuleType());
+}
+
+bool GetInteriorVehicleDataRequest::AppShouldBeUnsubscribed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& msg_params = (*message_)[app_mngr::strings::msg_params];
+ if (msg_params.keyExists(message_params::kSubscribe)) {
+ return !(msg_params[message_params::kSubscribe].asBool());
+ }
+ return false;
+}
+
+bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (AppShouldBeUnsubscribed()) {
+ const auto subscribed_to_module_type =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_,
+ ModuleType());
+ if (subscribed_to_module_type.size() == 1 &&
+ subscribed_to_module_type.front() == app) {
+ LOG4CXX_DEBUG(logger_,
+ "The last application unsubscribes from " << ModuleType());
+ return true;
+ }
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!ProcessCapabilities()) {
+ return;
+ }
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (TheLastAppShouldBeUnsubscribed(app) ||
+ !interior_data_cache_.Contains(ModuleType())) {
+ if (HasRequestExcessiveSubscription()) {
+ excessive_subscription_occured_ = true;
+ is_subscribed =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ RemoveExcessiveSubscription();
+ }
+ if (!CheckRateLimits()) {
+ LOG4CXX_WARN(logger_, "GetInteriorVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ interior_data_manager_.StoreRequestToHMITime(ModuleType());
+ SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleData,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ return;
+ }
+ ProcessResponseToMobileFromCache(app);
+}
+
+void GetInteriorVehicleDataRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::RC_GetInteriorVehicleData != event.id()) {
+ return;
+ }
+
+ smart_objects::SmartObject& hmi_response =
+ const_cast<smart_objects::SmartObject&>(event.smart_object());
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ if (mobile_apis::Result::READ_ONLY == result_code) {
+ result = false;
+ result_code = mobile_apis::Result::GENERIC_ERROR;
+ }
+
+ if (result) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ DCHECK_OR_RETURN_VOID(app);
+ if (TheLastAppShouldBeUnsubscribed(app)) {
+ interior_data_cache_.Remove(ModuleType());
+ }
+ ProccessSubscription(hmi_response);
+ if (is_subscribed) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ hmi_response[app_mngr::strings::msg_params]
+ [message_params::kModuleData][data_mapping(ModuleType())];
+ interior_data_cache_.Add(ModuleType(), module_data);
+ }
+ } else {
+ hmi_response[app_mngr::strings::msg_params].erase(
+ message_params::kIsSubscribed);
+ }
+ std::string response_info;
+ GetInfo(hmi_response, response_info);
+ SetResourceState(ModuleType(), ResourceState::FREE);
+
+ SendResponse(result,
+ result_code,
+ response_info.c_str(),
+ &hmi_response[app_mngr::strings::msg_params]);
+}
+
+GetInteriorVehicleDataRequest::~GetInteriorVehicleDataRequest() {}
+
+void GetInteriorVehicleDataRequest::ProccessSubscription(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& hmi_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const bool is_subscribe_present_in_request =
+ (*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kSubscribe) ||
+ excessive_subscription_occured_;
+
+ const bool isSubscribed_present_in_response =
+ hmi_response[app_mngr::strings::msg_params].keyExists(
+ message_params::kIsSubscribed);
+
+ smart_objects::SmartObject& temp_hmi_response =
+ const_cast<smart_objects::SmartObject&>(hmi_response);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const auto extension = RCHelpers::GetRCExtension(*app);
+ const char* module_type;
+ ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::ModuleType::eType>::EnumToCString(
+ static_cast<mobile_apis::ModuleType::eType>(
+ hmi_response[app_mngr::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kModuleType].asUInt()),
+ &module_type);
+ if (excessive_subscription_occured_) {
+ is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type);
+ temp_hmi_response[app_mngr::strings::msg_params]
+ [message_params::kIsSubscribed] = is_subscribed;
+ return;
+ }
+ if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ return;
+ }
+
+ if (is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "conditional mandatory parameter "
+ << message_params::kIsSubscribed
+ << " missed in hmi response");
+
+ is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type);
+ temp_hmi_response[app_mngr::strings::msg_params]
+ [message_params::kIsSubscribed] = is_subscribed;
+ return;
+ }
+
+ if (!is_subscribe_present_in_request && isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "Parameter " << message_params::kIsSubscribed
+ << " is ignored due to absence '"
+ << message_params::kSubscribe
+ << "' parameter in request");
+ smart_objects::SmartObject& temp_hmi_response =
+ const_cast<smart_objects::SmartObject&>(hmi_response);
+ temp_hmi_response[app_mngr::strings::msg_params].erase(
+ message_params::kIsSubscribed);
+ return;
+ }
+
+ const bool request_subscribe =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ const bool response_subscribe =
+ hmi_response[app_mngr::strings::msg_params][message_params::kIsSubscribed]
+ .asBool();
+ is_subscribed = response_subscribe;
+
+ LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe);
+ LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe);
+ if (request_subscribe == response_subscribe) {
+ const std::string module_type = ModuleType();
+ if (response_subscribe) {
+ LOG4CXX_DEBUG(logger_,
+ "SubscribeToInteriorVehicleData " << app->app_id() << " "
+ << module_type);
+ extension->SubscribeToInteriorVehicleData(module_type);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "UnsubscribeFromInteriorVehicleData "
+ << app->app_id() << " " << module_type);
+ extension->UnsubscribeFromInteriorVehicleData(module_type);
+ }
+ }
+}
+
+bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool is_subscribe_present_in_request =
+ (*message_)[app_mngr::strings::msg_params].keyExists(
+ message_params::kSubscribe);
+
+ if (is_subscribe_present_in_request) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const auto extension = RCHelpers::GetRCExtension(*app);
+
+ const bool is_app_already_subscribed =
+ extension->IsSubscibedToInteriorVehicleData(ModuleType());
+ const bool app_wants_to_subscribe =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ if (!app_wants_to_subscribe && !is_app_already_subscribed) {
+ return true;
+ }
+ return app_wants_to_subscribe && is_app_already_subscribed;
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[app_mngr::strings::msg_params].erase(message_params::kSubscribe);
+}
+
+std::string GetInteriorVehicleDataRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type = static_cast<
+ mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..a7572f1d62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {}
+
+void GetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
new file mode 100644
index 0000000000..37890b7979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc
@@ -0,0 +1,108 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : app_mngr::commands::CommandNotificationImpl(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , interior_data_cache_(params.interior_data_cache_) {}
+
+OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {}
+
+void OnInteriorVehicleDataNotification::AddDataToCache(
+ const std::string& module_type) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [data_mapping(module_type)];
+ interior_data_cache_.Add(module_type, module_data);
+}
+
+void OnInteriorVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::string module_type = ModuleType();
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_, module_type);
+ if (!apps_subscribed.empty()) {
+ AddDataToCache(module_type);
+ }
+ typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
+ AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_);
+
+ for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
+ DCHECK(*it);
+ application_manager::Application& app = **it;
+
+ const auto extension = RCHelpers::GetRCExtension(app);
+ DCHECK(extension);
+ LOG4CXX_TRACE(logger_,
+ "Check subscription for "
+ << app.app_id() << "and module type " << module_type);
+ if (extension->IsSubscibedToInteriorVehicleData(module_type)) {
+ (*message_)[app_mngr::strings::params]
+ [app_mngr::strings::connection_key] = app.app_id();
+ SendNotification();
+ }
+ }
+}
+
+std::string OnInteriorVehicleDataNotification::ModuleType() {
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleData][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..0473dd1791
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc
@@ -0,0 +1,778 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/macro.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+namespace {
+std::vector<std::string> GetModuleReadOnlyParams(
+ const std::string& module_type) {
+ std::vector<std::string> module_ro_params;
+ if (enums_value::kClimate == module_type) {
+ module_ro_params.push_back(kCurrentTemperature);
+ } else if (enums_value::kRadio == module_type) {
+ module_ro_params.push_back(kRdsData);
+ module_ro_params.push_back(kAvailableHDs);
+ module_ro_params.push_back(kSignalStrength);
+ module_ro_params.push_back(kSignalChangeThreshold);
+ module_ro_params.push_back(kState);
+ module_ro_params.push_back(kSisData);
+ } else if (enums_value::kLight == module_type) {
+ module_ro_params.push_back(kLightStatus);
+ }
+
+ return module_ro_params;
+}
+
+const std::map<std::string, std::string> GetLightCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping = {
+ {message_params::kId, strings::kName},
+ {message_params::kLightStatus, strings::kStatusAvailable},
+ {message_params::kLightDensity, strings::kDensityAvailable},
+ {message_params::kLightColor, strings::kRGBColorSpaceAvailable}};
+ return mapping;
+}
+
+const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping;
+ // climate
+ mapping["fanSpeed"] = "fanSpeedAvailable";
+ mapping["currentTemperature"] = "currentTemperatureAvailable";
+ mapping["desiredTemperature"] = "desiredTemperatureAvailable";
+ mapping["acEnable"] = "acEnableAvailable";
+ mapping["circulateAirEnable"] = "circulateAirEnableAvailable";
+ mapping["autoModeEnable"] = "autoModeEnableAvailable";
+ mapping["defrostZone"] = "defrostZoneAvailable";
+ mapping["dualModeEnable"] = "dualModeEnableAvailable";
+ mapping["acMaxEnable"] = "acMaxEnableAvailable";
+ mapping["ventilationMode"] = "ventilationModeAvailable";
+ mapping["heatedSteeringWheelEnable"] = "heatedSteeringWheelAvailable";
+ mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable";
+ mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable";
+ mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable";
+
+ // radio
+ mapping["band"] = "radioBandAvailable";
+ mapping["frequencyInteger"] = "radioFrequencyAvailable";
+ mapping["frequencyFraction"] = "radioFrequencyAvailable";
+ mapping["rdsData"] = "rdsDataAvailable";
+ mapping["availableHDs"] = "availableHDsAvailable";
+ mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["hdRadioEnable"] = "hdRadioEnableAvailable";
+ mapping["signalStrength"] = "signalStrengthAvailable";
+ mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
+ mapping["radioEnable"] = "radioEnableAvailable";
+ mapping["state"] = "stateAvailable";
+ mapping["sisData"] = "sisDataAvailable";
+
+ // seat
+ mapping["heatingEnabled"] = "heatingEnabledAvailable";
+ mapping["coolingEnabled"] = "coolingEnabledAvailable";
+ mapping["heatingLevel"] = "heatingLevelAvailable";
+ mapping["coolingLevel"] = "coolingLevelAvailable";
+ mapping["horizontalPosition"] = "horizontalPositionAvailable";
+ mapping["verticalPosition"] = "verticalPositionAvailable";
+ mapping["frontVerticalPosition"] = "frontVerticalPositionAvailable";
+ mapping["backVerticalPosition"] = "backVerticalPositionAvailable";
+ mapping["backTiltAngle"] = "backTiltAngleAvailable";
+ mapping["headSupportHorizontalPosition"] =
+ "headSupportHorizontalPositionAvailable";
+ mapping["headSupportVerticalPosition"] =
+ "headSupportVerticalPositionAvailable";
+ mapping["massageEnabled"] = "massageEnabledAvailable";
+ mapping["massageMode"] = "massageModeAvailable";
+ mapping["massageCushionFirmness"] = "massageCushionFirmnessAvailable";
+ mapping["memory"] = "memoryAvailable";
+
+ // audio
+ mapping["source"] = "sourceAvailable";
+ mapping["keepContext"] = "keepContextAvailable";
+ mapping["volume"] = "volumeAvailable";
+ mapping["equalizerSettings"] = "equalizerAvailable";
+
+ // hmi settings
+ mapping["distanceUnit"] = "distanceUnitAvailable";
+ mapping["temperatureUnit"] = "temperatureUnitAvailable";
+ mapping["displayMode"] = "displayModeUnitAvailable";
+
+ return mapping;
+}
+} // namespace
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
+
+SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
+
+const std::string LightName(const smart_objects::SmartObject& light_name) {
+ const char* name;
+ const bool ok = ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::LightName::eType>::EnumToCString(
+ static_cast<mobile_apis::LightName::eType>(light_name.asUInt()),
+ &name);
+ return ok ? name : "unknown";
+}
+
+/**
+ * @brief Check whether the parameter exist in capabilities
+ * @param smart object of capabilities
+ * @param mapping - map of module data and capabilities
+ * @param request_parameter - string
+ * @param switched_off_result - ref of mobile_apis::Result
+ * @return success if parameter exist in capabilities missedParam otherwise
+ */
+capabilitiesStatus GetItemCapability(
+ const smart_objects::SmartObject& capabilities,
+ const std::map<std::string, std::string>& mapping,
+ const std::string& request_parameter,
+ const mobile_apis::Result::eType& switched_off_result) {
+ const auto it = mapping.find(request_parameter);
+
+ if (it == mapping.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Parameter " << request_parameter
+ << " doesn't exist in capabilities.");
+ return capabilitiesStatus::missedParam;
+ }
+
+ const std::string& caps_key = it->second;
+
+ LOG4CXX_DEBUG(logger_,
+ "Checking request parameter "
+ << request_parameter
+ << " with capabilities. Appropriate key is " << caps_key);
+
+ if (!capabilities.keyExists(caps_key)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability " << caps_key
+ << " is missed in RemoteControl capabilities");
+ return capabilitiesStatus::missedParam;
+ }
+
+ if (!capabilities[caps_key].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is switched off in RemoteControl capabilities");
+ capabilitiesStatus status = capabilitiesStatus::missedParam;
+ if (mobile_apis::Result::READ_ONLY == switched_off_result) {
+ status = capabilitiesStatus::readOnly;
+ }
+ return status;
+ }
+
+ return capabilitiesStatus::success;
+}
+
+/**
+ * @brief Check whether the cpabilities for light allowed
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping = GetLightCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const std::string& request_parameter = it->first;
+
+ if (message_params::kId == request_parameter) {
+ continue;
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ request_parameter,
+ mobile_apis::Result::READ_ONLY);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair(message_params::kLightState,
+ status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether the light name exists in capabilities
+ * @param smart object of capabilities_status
+ * @param smart object of light_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightNameCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& light_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto it = capabilities_status.asArray()->begin();
+ for (; it != capabilities_status.asArray()->end(); ++it) {
+ const smart_objects::SmartObject& so = *it;
+ const int64_t current_id = so[message_params::kName].asInt();
+ if (current_id == light_data[message_params::kId].asInt()) {
+ return GetLightDataCapabilities(so, light_data);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "There is no such light name in capabilities");
+ return std::make_pair(message_params::kLightState,
+ capabilitiesStatus::missedLightName);
+}
+
+ModuleCapability GetRadioBandByCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& request_parameter) {
+ mobile_apis::RadioBand::eType radio_band =
+ static_cast<mobile_apis::RadioBand::eType>(request_parameter.asUInt());
+ if (mobile_apis::RadioBand::XM == radio_band) {
+ if (!capabilities_status.keyExists(strings::kSiriusxmRadioAvailable)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is missed in RemoteControl capabilities");
+ return std::make_pair(strings::kSiriusxmRadioAvailable,
+ capabilitiesStatus::missedParam);
+ }
+ if (!capabilities_status[strings::kSiriusxmRadioAvailable].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is switched off in RemoteControl capabilities");
+ return std::make_pair(strings::kSiriusxmRadioAvailable,
+ capabilitiesStatus::missedParam);
+ }
+ }
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether the exists light data related to correspondent
+ * capabilities
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetControlDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping =
+ GetModuleDataToCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const std::string& request_parameter = it->first;
+ if (message_params::kId == request_parameter) {
+ continue;
+ }
+ if (message_params::kLightState == request_parameter) {
+ auto light_data = control_data[request_parameter].asArray()->begin();
+ ModuleCapability light_capability =
+ std::make_pair("", capabilitiesStatus::success);
+
+ for (; light_data != control_data[request_parameter].asArray()->end();
+ ++light_data) {
+ light_capability = GetLightNameCapabilities(
+ capabilities[strings::kSupportedLights], *light_data);
+
+ if (capabilitiesStatus::success != light_capability.second) {
+ return light_capability;
+ }
+ }
+
+ return light_capability;
+ }
+ if (message_params::kBand == request_parameter) {
+ ModuleCapability radio_capability = GetRadioBandByCapabilities(
+ capabilities, control_data[request_parameter]);
+ if (capabilitiesStatus::success != radio_capability.second) {
+ return radio_capability;
+ }
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ request_parameter,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair("", status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether rc module data capabilities are presented
+ * @param smart object of rc_capabilities
+ * @param smart object of module_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetModuleDataCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& get_module_data_key = RCHelpers::GetModuleTypeToDataMapping();
+ const auto& get_capabilities_key =
+ RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ ModuleCapability module_data_capabilities =
+ std::make_pair("", capabilitiesStatus::missedParam);
+
+ for (const auto& module_type : all_module_types) {
+ const auto module_data_key = get_module_data_key(module_type);
+ const auto capabilities_key = get_capabilities_key(module_type);
+ if (module_data.keyExists(module_data_key)) {
+ if (!rc_capabilities.keyExists(capabilities_key)) {
+ LOG4CXX_DEBUG(logger_, module_data_key << " capabilities not present");
+ return module_data_capabilities;
+ }
+ const smart_objects::SmartObject& caps =
+ rc_capabilities[capabilities_key];
+
+ if (message_params::kHmiSettingsControlData == module_data_key ||
+ message_params::kLightControlData == module_data_key) {
+ module_data_capabilities =
+ GetControlDataCapabilities(caps, module_data[module_data_key]);
+ } else {
+ module_data_capabilities =
+ GetControlDataCapabilities(caps[0], module_data[module_data_key]);
+ }
+ }
+ }
+
+ return module_data_capabilities;
+}
+
+bool isModuleTypeAndDataMatch(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ bool module_type_and_data_match = false;
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ module_type_and_data_match = module_data.keyExists(data_mapping(type));
+ break;
+ }
+ }
+ return module_type_and_data_match;
+}
+
+mobile_apis::Result::eType PrepareResultCodeAndInfo(
+ const ModuleCapability module_data_capabilities, std::string& info) {
+ mobile_apis::Result::eType result_code =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ if (message_params::kLightState == module_data_capabilities.first) {
+ switch (module_data_capabilities.second) {
+ case capabilitiesStatus::missedLightName:
+ info = "The requested LightName is not supported by the vehicle.";
+ break;
+ case capabilitiesStatus::missedParam:
+ info =
+ "The requested parameter of the given LightName is not supported "
+ "by the vehicle.";
+ break;
+ case capabilitiesStatus::readOnly:
+ info = "The requested parameter is read-only.";
+ result_code = mobile_apis::Result::READ_ONLY;
+ break;
+ default:
+ break;
+ }
+
+ } else {
+ info = "Accessing not supported module data.";
+ }
+ return result_code;
+ LOG4CXX_WARN(logger_, info);
+}
+
+void SetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& module_data =
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleData];
+ const std::string module_type = ModuleType();
+
+ if (isModuleTypeAndDataMatch(module_type, module_data)) {
+ const smart_objects::SmartObject* rc_capabilities =
+ hmi_capabilities_.rc_capability();
+ ModuleCapability module_data_capabilities;
+
+ if (rc_capabilities) {
+ module_data_capabilities =
+ GetModuleDataCapabilities(*rc_capabilities, module_data);
+
+ if (capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ std::string info;
+ mobile_apis::Result::eType result =
+ PrepareResultCodeAndInfo(module_data_capabilities, info);
+ SendResponse(false, result, info.c_str());
+ return;
+ }
+ }
+
+ if (AreAllParamsReadOnly(module_data)) {
+ LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::READ_ONLY,
+ "All request params in module type are READ ONLY!");
+ return;
+ }
+
+ module_data_capabilities = std::make_pair("", capabilitiesStatus::success);
+
+ if (AreReadOnlyParamsPresent(module_data, module_data_capabilities)) {
+ LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters");
+
+ if (enums_value::kLight == module_data_capabilities.first &&
+ capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(
+ false,
+ mobile_apis::Result::READ_ONLY,
+ "The LightStatus enum passed is READ ONLY and cannot be written.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... ");
+
+ CutOffReadOnlyParams(module_data);
+ }
+
+ application_manager_.RemoveHMIFakeParameters(
+ message_, hmi_apis::FunctionID::RC_SetInteriorVehicleData);
+
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ (*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
+ app->app_id();
+
+ const bool app_wants_to_set_audio_src =
+ module_data.keyExists(message_params::kAudioControlData) &&
+ module_data[message_params::kAudioControlData].keyExists(
+ message_params::kSource);
+
+ if (app_wants_to_set_audio_src) {
+ if (!app->IsAllowedToChangeAudioSource()) {
+ LOG4CXX_WARN(logger_, "App is not allowed to change audio source");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "App is not allowed to change audio source");
+ return;
+ } else if (module_data[message_params::kAudioControlData].keyExists(
+ message_params::kKeepContext)) {
+ app->set_keep_context(
+ module_data[message_params::kAudioControlData]
+ [message_params::kKeepContext].asBool());
+ }
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::RC_SetInteriorVehicleData,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ } else {
+ LOG4CXX_WARN(logger_, "Request module type & data mismatch!");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Request module type & data mismatch!");
+ }
+}
+
+void SetInteriorVehicleDataRequest::on_event(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCCommandRequest::on_event(event);
+
+ if (hmi_apis::FunctionID::RC_SetInteriorVehicleData != event.id()) {
+ return;
+ }
+
+ const smart_objects::SmartObject& hmi_response = event.smart_object();
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ smart_objects::SmartObject response_params;
+ if (result) {
+ response_params = hmi_response[app_mngr::strings::msg_params];
+ if (enums_value::kAudio == ModuleType()) {
+ CheckAudioSource((
+ *message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [message_params::kAudioControlData]);
+ }
+ } else {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ app->set_keep_context(false);
+ }
+ std::string info;
+ GetInfo(hmi_response, info);
+ SendResponse(
+ result, result_code, info.c_str(), result ? &response_params : nullptr);
+}
+
+const smart_objects::SmartObject& SetInteriorVehicleDataRequest::ControlData(
+ const smart_objects::SmartObject& module_data) {
+ const std::string module_type = ModuleType();
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ return module_data[data_mapping(type)];
+ }
+ }
+ NOTREACHED();
+ return module_data[0];
+}
+
+void SetInteriorVehicleDataRequest::CheckAudioSource(
+ const smart_objects::SmartObject& audio_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (audio_data.keyExists(message_params::kSource)) {
+ application_manager_.set_current_audio_source(
+ audio_data[message_params::kSource].asUInt());
+ }
+}
+
+bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ auto it = module_type_params.map_begin();
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(ModuleType());
+ for (; it != module_type_params.map_end(); ++it) {
+ if (!helpers::in_range(ro_params, it->first)) {
+ return false;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "All params are ReadOnly");
+ return true;
+}
+
+bool CheckReadOnlyParamsForAudio(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kEqualizerSettings)) {
+ const auto& equalizer_settings =
+ module_type_params[message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ LOG4CXX_DEBUG(logger_,
+ "READ ONLY parameter. ChannelName = "
+ << (*it)[message_params::kChannelName].asString());
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool CheckReadOnlyParamsForLight(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kLightState)) {
+ const auto& light_state = module_type_params[message_params::kLightState];
+ auto it = light_state.asArray()->begin();
+
+ for (; it != light_state.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kLightStatus)) {
+ const mobile_apis::LightStatus::eType light_status =
+ static_cast<mobile_apis::LightStatus::eType>(
+ (*it)[message_params::kLightStatus].asUInt());
+
+ if (helpers::Compare<mobile_apis::LightStatus::eType,
+ helpers::EQ,
+ helpers::ONE>(light_status,
+ mobile_apis::LightStatus::RAMP_UP,
+ mobile_apis::LightStatus::RAMP_DOWN,
+ mobile_apis::LightStatus::UNKNOWN,
+ mobile_apis::LightStatus::INVALID)) {
+ LOG4CXX_DEBUG(logger_,
+ "READ ONLY parameter. Status = "
+ << (*it)[message_params::kLightStatus].asInt());
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
+ const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ const std::string module_type = ModuleType();
+
+ if (enums_value::kAudio == module_type) {
+ return CheckReadOnlyParamsForAudio(module_type_params);
+ }
+
+ if (enums_value::kLight == module_type) {
+ const bool result = CheckReadOnlyParamsForLight(module_type_params);
+
+ if (result) {
+ module_data_capabilities =
+ std::make_pair(module_type, capabilitiesStatus::readOnly);
+ }
+
+ return result;
+ }
+
+ const std::vector<std::string> ro_params =
+ GetModuleReadOnlyParams(module_type);
+ auto it = module_type_params.map_begin();
+
+ for (; it != module_type_params.map_end(); ++it) {
+ if (helpers::in_range(ro_params, it->first)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
+ smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& module_type_params =
+ ControlData(module_data);
+ const std::string module_type = ModuleType();
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+
+ for (auto& it : ro_params) {
+ if (module_type_params.keyExists(it)) {
+ if (enums_value::kClimate == module_type) {
+ module_data[message_params::kClimateControlData].erase(it);
+ } else if (enums_value::kRadio == module_type) {
+ module_data[message_params::kRadioControlData].erase(it);
+ } else {
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
+ }
+ }
+
+ if (enums_value::kAudio == module_type) {
+ auto& equalizer_settings = module_data[message_params::kAudioControlData]
+ [message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ it->erase(message_params::kChannelName);
+ LOG4CXX_DEBUG(logger_,
+ "Cutting-off READ ONLY parameter: "
+ << message_params::kChannelName);
+ }
+ }
+ }
+}
+
+std::string SetInteriorVehicleDataRequest::ModuleType() {
+ mobile_apis::ModuleType::eType module_type =
+ static_cast<mobile_apis::ModuleType::eType>(
+ (*message_)[app_mngr::strings::msg_params]
+ [message_params::kModuleData][message_params::kModuleType]
+ .asUInt());
+ const char* str;
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
+ mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
+ return ok ? str : "unknown";
+}
+
+AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource(
+ const app_mngr::commands::MessageSharedPtr& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ return resource_allocation_manager_.AcquireResource(module_type,
+ app->app_id());
+}
+
+bool SetInteriorVehicleDataRequest::IsResourceFree(
+ const std::string& module_type) const {
+ return resource_allocation_manager_.IsResourceFree(module_type);
+}
+
+void SetInteriorVehicleDataRequest::SetResourceState(
+ const std::string& module_type, const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ resource_allocation_manager_.SetResourceState(
+ module_type, app->app_id(), state);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc
new file mode 100644
index 0000000000..4dedd4b5a2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc
@@ -0,0 +1,25 @@
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "utils/macro.h"
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
+SetInteriorVehicleDataResponse::~SetInteriorVehicleDataResponse() {}
+
+void SetInteriorVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.GetRPCService().SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
new file mode 100644
index 0000000000..c24529d720
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
@@ -0,0 +1,268 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/hmi_interfaces.h"
+#include "smart_objects/enum_schema_item.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+namespace rc_rpc_plugin {
+namespace commands {
+
+RCCommandRequest::RCCommandRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::CommandRequestImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , is_subscribed(false)
+ , auto_allowed_(false)
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_cache_(params.interior_data_cache_)
+ , interior_data_manager_(params.interior_data_manager_) {}
+
+RCCommandRequest::~RCCommandRequest() {}
+
+bool RCCommandRequest::IsInterfaceAvailable(
+ const app_mngr::HmiInterfaces::InterfaceID interface) const {
+ app_mngr::HmiInterfaces& hmi_interfaces =
+ application_manager_.hmi_interfaces();
+ const app_mngr::HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ return app_mngr::HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
+void RCCommandRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+ SetResourceState(module_type, ResourceState::FREE);
+ SendResponse(
+ false, mobile_apis::Result::GENERIC_ERROR, "Request timeout expired");
+}
+
+bool RCCommandRequest::CheckDriverConsent() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ const std::string module_type = ModuleType();
+ rc_rpc_plugin::TypeAccess access = CheckModule(module_type, app);
+
+ if (rc_rpc_plugin::kAllowed == access) {
+ set_auto_allowed(true);
+ return true;
+ }
+ SendDisallowed(access);
+ return false;
+}
+
+rc_rpc_plugin::TypeAccess RCCommandRequest::CheckModule(
+ const std::string& module_type,
+ application_manager::ApplicationSharedPtr app) {
+ return policy_handler_.CheckModule(app->policy_app_id(), module_type)
+ ? rc_rpc_plugin::TypeAccess::kAllowed
+ : rc_rpc_plugin::TypeAccess::kDisallowed;
+}
+
+void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string info;
+ if (rc_rpc_plugin::kDisallowed == access) {
+ info = disallowed_info_.empty()
+ ? "The RPC is disallowed by vehicle settings"
+ : disallowed_info_;
+ } else {
+ return;
+ }
+ LOG4CXX_ERROR(logger_, info);
+ SendResponse(false, mobile_apis::Result::DISALLOWED, info.c_str());
+}
+
+void RCCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!IsInterfaceAvailable(app_mngr::HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_WARN(logger_, "HMI interface RC is not available");
+ SendResponse(false,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ "Remote control is not supported by system");
+ return;
+ }
+ LOG4CXX_TRACE(logger_, "RC interface is available!");
+ if (!policy_handler_.CheckHMIType(
+ app->policy_app_id(),
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ app->app_types())) {
+ LOG4CXX_WARN(logger_, "Application has no remote control functions");
+ SendResponse(false, mobile_apis::Result::DISALLOWED, "");
+ return;
+ }
+ if (!resource_allocation_manager_.is_rc_enabled()) {
+ LOG4CXX_WARN(logger_, "Remote control is disabled by user");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::USER_DISALLOWED,
+ "Remote control is disabled by user");
+ return;
+ }
+
+ if (CheckDriverConsent()) {
+ if (AcquireResources()) {
+ Execute(); // run child's logic
+ }
+ // If resource is not aqcuired, AcquireResources method will either
+ // send response to mobile or
+ // send additional request to HMI to ask driver consent
+ }
+}
+
+bool RCCommandRequest::AcquireResources() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string module_type = ModuleType();
+
+ if (!IsResourceFree(module_type)) {
+ LOG4CXX_WARN(logger_, "Resource is busy.");
+ SendResponse(false, mobile_apis::Result::IN_USE, "");
+ return false;
+ }
+
+ AcquireResult::eType acquire_result = AcquireResource(message_);
+ switch (acquire_result) {
+ case AcquireResult::ALLOWED: {
+ SetResourceState(module_type, ResourceState::BUSY);
+ return true;
+ }
+ case AcquireResult::IN_USE: {
+ SendResponse(false, mobile_apis::Result::IN_USE, "");
+ return false;
+ }
+ case AcquireResult::ASK_DRIVER: {
+ SendGetUserConsent(module_type);
+ return false;
+ }
+ case AcquireResult::REJECTED: {
+ SendResponse(false, mobile_apis::Result::REJECTED, "");
+ return false;
+ }
+ }
+ return false;
+}
+
+void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (event.id() == hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent) {
+ ProcessAccessResponse(event);
+ } else {
+ const std::string module_type = ModuleType();
+ SetResourceState(module_type, ResourceState::FREE);
+ }
+}
+
+void RCCommandRequest::ProcessAccessResponse(
+ const app_mngr::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ const std::string module_type = ModuleType();
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED, "");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[app_mngr::strings::params][app_mngr::hmi_response::code]
+ .asUInt()));
+
+ const bool result =
+ helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>(
+ result_code,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS);
+
+ bool is_allowed = false;
+ if (result) {
+ if (message[app_mngr::strings::msg_params].keyExists(
+ message_params::kAllowed)) {
+ is_allowed =
+ message[app_mngr::strings::msg_params][message_params::kAllowed]
+ .asBool();
+ }
+ if (is_allowed) {
+ resource_allocation_manager_.ForceAcquireResource(module_type,
+ app->app_id());
+ SetResourceState(module_type, ResourceState::BUSY);
+ Execute(); // run child's logic
+ } else {
+ resource_allocation_manager_.OnDriverDisallowed(module_type,
+ app->app_id());
+ SendResponse(
+ false,
+ mobile_apis::Result::REJECTED,
+ "The resource is in use and the driver disallows this remote "
+ "control RPC");
+ }
+ } else {
+ std::string response_info;
+ GetInfo(message, response_info);
+ SendResponse(false, result_code, response_info.c_str());
+ }
+}
+
+void RCCommandRequest::SendGetUserConsent(const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+ DCHECK(app);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[app_mngr::strings::app_id] = app->app_id();
+ msg_params[message_params::kModuleType] = module_type;
+ SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
+ &msg_params,
+ true);
+}
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
new file mode 100644
index 0000000000..0eb175aa25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <thread>
+#include <chrono>
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "utils/date_time.h"
+#include "utils/logger.h"
+
+namespace rc_rpc_plugin {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataCacheImpl::InteriorDataCacheImpl() {}
+
+InteriorDataCacheImpl::~InteriorDataCacheImpl() {}
+
+/**
+ * @brief MergeModuleData key all keys and values from first parameter and
+ * update and append keys and values from the second
+ * @param data1 - initial data
+ * @param data2 - updated data
+ * @return updated data1 with data2 keys and values
+ */
+smart_objects::SmartObject MergeModuleData(
+ const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2) {
+ smart_objects::SmartObject result = data1;
+ auto it = data2.map_begin();
+ for (; it != data2.map_end(); ++it) {
+ const std::string& key = it->first;
+ const smart_objects::SmartObject& value = it->second;
+ result[key] = value;
+ }
+ return result;
+}
+
+void InteriorDataCacheImpl::Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ cached_data_[module_type] = module_data;
+ return;
+ }
+ cached_data_[module_type] = MergeModuleData(it->second, module_data);
+}
+
+smart_objects::SmartObject InteriorDataCacheImpl::Retrieve(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (it == cached_data_.end()) {
+ LOG4CXX_WARN(logger_,
+ "Module type " << module_type << " was not found in cache");
+ return smart_objects::SmartObject(smart_objects::SmartType_Null);
+ }
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ return it->second;
+}
+
+bool InteriorDataCacheImpl::Contains(const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ const bool contains = it != cached_data_.end();
+ LOG4CXX_TRACE(logger_,
+ "module_type : " << module_type << " "
+ << (contains ? "true" : "false"));
+ return contains;
+}
+
+void InteriorDataCacheImpl::Remove(const std::string& module_type) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ LOG4CXX_TRACE(logger_, "Not existing module_type : " << module_type);
+ return;
+ }
+ cached_data_.erase(it);
+}
+
+void InteriorDataCacheImpl::Clear() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ cached_data_.clear();
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
new file mode 100644
index 0000000000..0c42f6e3de
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
@@ -0,0 +1,158 @@
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataManagerImpl::InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service)
+ : rc_plugin_(rc_plugin)
+ , cache_(cache)
+ , app_mngr_(app_mngr)
+ , rpc_service_(rpc_service) {}
+
+void InteriorDataManagerImpl::OnPolicyEvent(plugins::PolicyEvent event) {
+ UpdateHMISubscriptionsOnPolicyUpdated();
+}
+
+void InteriorDataManagerImpl::OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationUnregistered == event ||
+ plugins::ApplicationEvent::kApplicationExit == event) {
+ UpdateHMISubscriptionsOnAppUnregistered(*application);
+ }
+}
+
+void InteriorDataManagerImpl::OnDisablingRC() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto existing_subscription = AppsSubscribedModules();
+ std::set<std::string> subscribed_modules;
+ for (auto& pair : existing_subscription) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ subscribed_modules.insert(module);
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ for (auto& module : subscribed_modules) {
+ LOG4CXX_TRACE(logger_, "unsubscribe " << module);
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+}
+
+void InteriorDataManagerImpl::StoreRequestToHMITime(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ requests_to_hmi_history_[module_type].push_back(date_time::getCurrentTime());
+}
+
+bool InteriorDataManagerImpl::CheckRequestsToHMIFrequency(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ ClearOldRequestsToHMIHistory();
+ const auto& history = requests_to_hmi_history_[module_type];
+ const auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().first;
+ return history.size() < limit;
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnPolicyUpdated() {
+ auto apps_allowed_modules =
+ RCHelpers::GetApplicationsAllowedModules(app_mngr_);
+ auto apps_subscribed_modules = AppsSubscribedModules();
+ InteriorDataManagerImpl::AppsModules apps_disallowed_modules;
+ for (auto& pair : apps_subscribed_modules) {
+ auto& allowed = apps_allowed_modules[pair.first];
+ auto& subscribed = pair.second;
+ std::vector<std::string> disallowed_modules;
+ std::set_difference(subscribed.begin(),
+ subscribed.end(),
+ allowed.begin(),
+ allowed.end(),
+ std::back_inserter(disallowed_modules));
+ apps_disallowed_modules[pair.first] = disallowed_modules;
+ }
+
+ for (auto& pair : apps_disallowed_modules) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, module);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto rc_extension = RCHelpers::GetRCExtension(app);
+ auto subscribed_data = rc_extension->InteriorVehicleDataSubscriptions();
+ rc_extension->UnsubscribeFromInteriorVehicleData();
+ for (auto& data : subscribed_data) {
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, data);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ if (apps_subscribed.size() == 1 &&
+ apps_subscribed.front()->hmi_app_id() == app.hmi_app_id()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UnsubscribeFromInteriorVehicleData(
+ const std::string& module_type) {
+ cache_.Remove(module_type);
+ auto unsubscribe_request = RCHelpers::CreateUnsubscribeRequestToHMI(
+ module_type, app_mngr_.GetNextHMICorrelationID());
+ LOG4CXX_DEBUG(logger_, "Send Unsubscribe from " << module_type);
+ rpc_service_.ManageHMICommand(unsubscribe_request);
+}
+
+void InteriorDataManagerImpl::ClearOldRequestsToHMIHistory() {
+ auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().second;
+ uint32_t time_frame = limit * date_time::MILLISECONDS_IN_SECOND;
+ auto lest_that_time_frame_ago = [time_frame](date_time::TimeDuration time) {
+ auto span = date_time::calculateTimeSpan(time);
+ return span < time_frame;
+ };
+ for (auto& it : requests_to_hmi_history_) {
+ auto& history = it.second;
+ auto first_actual =
+ std::find_if(history.begin(), history.end(), lest_that_time_frame_ago);
+ history.erase(history.begin(), first_actual);
+ }
+}
+
+InteriorDataManagerImpl::AppsModules
+InteriorDataManagerImpl::AppsSubscribedModules() {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr_);
+ InteriorDataManagerImpl::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ const auto rc_extension = RCHelpers::GetRCExtension(*app_ptr);
+ auto app_subscriptions = rc_extension->InteriorVehicleDataSubscriptions();
+ result[app_ptr] = std::vector<std::string>(app_subscriptions.size());
+ std::copy(app_subscriptions.begin(),
+ app_subscriptions.end(),
+ result[app_ptr].begin());
+ }
+ return result;
+}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
new file mode 100644
index 0000000000..5282da8d83
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid)
+ : AppExtension(uid) {}
+
+void RCAppExtension::SubscribeToInteriorVehicleData(
+ const std::string& module_type) {
+ subscribed_interior_vehicle_data_.insert(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData(
+ const std::string& module_type) {
+ subscribed_interior_vehicle_data_.erase(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData() {
+ subscribed_interior_vehicle_data_.clear();
+}
+
+bool RCAppExtension::IsSubscibedToInteriorVehicleData(
+ const std::string& module_type) {
+ std::set<std::string>::iterator it =
+ subscribed_interior_vehicle_data_.find(module_type);
+
+ return (it != subscribed_interior_vehicle_data_.end());
+}
+
+void RCAppExtension::SaveResumptionData(
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) {}
+
+void RCAppExtension::ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) {}
+
+std::set<std::string> RCAppExtension::InteriorVehicleDataSubscriptions() const {
+ return subscribed_interior_vehicle_data_;
+}
+
+RCAppExtension::~RCAppExtension() {}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
new file mode 100644
index 0000000000..ecfc1dcda4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc
@@ -0,0 +1,250 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <iostream>
+
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_response.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+namespace application_manager {
+using rc_rpc_plugin::ResourceAllocationManager;
+using rc_rpc_plugin::InteriorDataCache;
+using rc_rpc_plugin::RCCommandParams;
+
+template <typename RCCommandType>
+class RCCommandCreator : public CommandCreator {
+ public:
+ RCCommandCreator(const RCCommandParams& params) : params_(params) {}
+
+ private:
+ bool CanBeCreated() const override {
+ return true;
+ }
+
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ CommandSharedPtr command(new RCCommandType(message, params_));
+ return command;
+ }
+
+ RCCommandParams params_;
+};
+
+struct RCInvalidCommand {};
+
+template <>
+class RCCommandCreator<RCInvalidCommand> : public CommandCreator {
+ public:
+ RCCommandCreator(const RCCommandParams& params) {
+ UNUSED(params);
+ }
+
+ private:
+ bool CanBeCreated() const override {
+ return false;
+ }
+
+ CommandSharedPtr create(
+ const commands::MessageSharedPtr& message) const override {
+ UNUSED(message);
+ return CommandSharedPtr();
+ }
+};
+
+struct RCCommandCreatorFactory {
+ RCCommandCreatorFactory(const RCCommandParams& params) : params_(params) {}
+
+ template <typename RCCommandType>
+ CommandCreator& GetCreator() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ static RCCommandCreator<RCCommandType> res(params_);
+ return res;
+ }
+ const RCCommandParams params_;
+};
+}
+
+namespace rc_rpc_plugin {
+using namespace application_manager;
+
+RCCommandFactory::RCCommandFactory(const RCCommandParams& params)
+ : params_(params) {}
+
+CommandSharedPtr RCCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ return get_hmi_creator_factory(function_id, message_type).create(message);
+ } else {
+ mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ return get_mobile_creator_factory(function_id, message_type)
+ .create(message);
+ }
+}
+
+bool RCCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ if (Command::SOURCE_HMI == message_source) {
+ return get_hmi_creator_factory(
+ static_cast<hmi_apis::FunctionID::eType>(function_id),
+ hmi_apis::messageType::INVALID_ENUM).CanBeCreated();
+ } else {
+ return get_mobile_creator_factory(
+ static_cast<mobile_api::FunctionID::eType>(function_id),
+ mobile_api::messageType::INVALID_ENUM).CanBeCreated();
+ }
+}
+
+CommandCreator& RCCommandFactory::get_mobile_creator_factory(
+ mobile_api::FunctionID::eType id,
+ mobile_api::messageType::eType message_type) const {
+ LOG4CXX_DEBUG(logger_,
+ "CreateMobileCommand function_id: " << id << " message_type: "
+ << message_type);
+ RCCommandCreatorFactory rc_factory(params_);
+
+ switch (id) {
+ case mobile_apis::FunctionID::ButtonPressID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory.GetCreator<commands::ButtonPressRequest>()
+ : rc_factory.GetCreator<commands::ButtonPressResponse>();
+ }
+ case mobile_apis::FunctionID::GetInteriorVehicleDataID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::GetInteriorVehicleDataRequest>()
+ : rc_factory
+ .GetCreator<commands::GetInteriorVehicleDataResponse>();
+ }
+ case mobile_apis::FunctionID::SetInteriorVehicleDataID: {
+ return mobile_api::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::SetInteriorVehicleDataRequest>()
+ : rc_factory
+ .GetCreator<commands::SetInteriorVehicleDataResponse>();
+ }
+ case mobile_apis::FunctionID::OnInteriorVehicleDataID: {
+ return rc_factory
+ .GetCreator<commands::OnInteriorVehicleDataNotification>();
+ }
+ default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ }
+}
+
+CommandCreator& RCCommandFactory::get_hmi_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type) const {
+ LOG4CXX_DEBUG(logger_,
+ "CreateHMICommand function_id: " << id << " message_type: "
+ << message_type);
+
+ RCCommandCreatorFactory rc_factory(params_);
+
+ switch (id) {
+ case hmi_apis::FunctionID::Buttons_ButtonPress: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory.GetCreator<commands::RCButtonPressRequest>()
+ : rc_factory.GetCreator<commands::RCButtonPressResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetInteriorVehicleData: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::RCGetInteriorVehicleDataRequest>()
+ : rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataConsentRequest>()
+ : rc_factory.GetCreator<
+ commands::RCGetInteriorVehicleDataConsentResponse>();
+ }
+ case hmi_apis::FunctionID::RC_SetInteriorVehicleData: {
+ return hmi_apis::messageType::request == message_type
+ ? rc_factory
+ .GetCreator<commands::RCSetInteriorVehicleDataRequest>()
+ : rc_factory.GetCreator<
+ commands::RCSetInteriorVehicleDataResponse>();
+ }
+ case hmi_apis::FunctionID::RC_OnInteriorVehicleData: {
+ return rc_factory
+ .GetCreator<commands::RCOnInteriorVehicleDataNotification>();
+ }
+ case hmi_apis::FunctionID::RC_OnRemoteControlSettings: {
+ return rc_factory
+ .GetCreator<commands::RCOnRemoteControlSettingsNotification>();
+ }
+ default: { return rc_factory.GetCreator<RCInvalidCommand>(); }
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
new file mode 100644
index 0000000000..0bdec55733
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
@@ -0,0 +1,118 @@
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToDataMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, message_params::kClimateControlData},
+ {enums_value::kRadio, message_params::kRadioControlData},
+ {enums_value::kSeat, message_params::kSeatControlData},
+ {enums_value::kAudio, message_params::kAudioControlData},
+ {enums_value::kLight, message_params::kLightControlData},
+ {enums_value::kHmiSettings, message_params::kHmiSettingsControlData}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToCapabilitiesMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, strings::kclimateControlCapabilities},
+ {enums_value::kRadio, strings::kradioControlCapabilities},
+ {enums_value::kSeat, strings::kseatControlCapabilities},
+ {enums_value::kAudio, strings::kaudioControlCapabilities},
+ {enums_value::kLight, strings::klightControlCapabilities},
+ {enums_value::kHmiSettings, strings::khmiSettingsControlCapabilities}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::vector<std::string> RCHelpers::GetModulesList() {
+ using namespace enums_value;
+ return {kClimate, kRadio, kSeat, kAudio, kLight, kHmiSettings};
+}
+
+RCAppExtensionPtr RCHelpers::GetRCExtension(
+ application_manager::Application& app) {
+ auto extension_interface = app.QueryInterface(RCRPCPlugin::kRCPluginID);
+ auto extension =
+ std::static_pointer_cast<RCAppExtension>(extension_interface);
+ return extension;
+}
+
+smart_objects::SmartObjectSPtr RCHelpers::CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id) {
+ using namespace smart_objects;
+ namespace commands = application_manager::commands;
+ namespace am_strings = application_manager::strings;
+
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& params = (*message)[am_strings::params];
+ SmartObject& msg_params = (*message)[am_strings::msg_params];
+
+ params[am_strings::message_type] =
+ static_cast<int>(application_manager::kRequest);
+ params[am_strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ params[am_strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_;
+ params[am_strings::correlation_id] = correlation_id;
+ params[am_strings::function_id] =
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData;
+ msg_params[message_params::kSubscribe] = false;
+ msg_params[message_params::kModuleType] = module_type;
+ return message;
+}
+
+std::vector<application_manager::ApplicationSharedPtr>
+RCHelpers::AppsSubscribedToModuleType(
+ application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type) {
+ std::vector<application_manager::ApplicationSharedPtr> result;
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr);
+ for (auto& app : rc_apps) {
+ auto rc_ext = RCHelpers::GetRCExtension(*app);
+ DCHECK_OR_RETURN(rc_ext, result);
+ if (rc_ext->IsSubscibedToInteriorVehicleData(module_type)) {
+ result.push_back(app);
+ }
+ }
+ return result;
+}
+
+RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules(
+ app_mngr::ApplicationManager& app_mngr) {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr);
+ RCHelpers::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ std::vector<std::string> allowed_modules;
+ app_mngr.GetPolicyHandler().GetModuleTypes(app_ptr->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+ result[app_ptr] = allowed_modules;
+ }
+ return result;
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
new file mode 100644
index 0000000000..fd6b4e86ac
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc
@@ -0,0 +1,141 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "utils/helpers.h"
+#include <memory>
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+namespace plugins = application_manager::plugin_manager;
+
+bool RCRPCPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ interior_data_cache_.reset(new InteriorDataCacheImpl());
+ interior_data_manager_.reset(new InteriorDataManagerImpl(
+ *this, *interior_data_cache_, app_manager, rpc_service));
+
+ resource_allocation_manager_.reset(
+ new ResourceAllocationManagerImpl(app_manager, rpc_service));
+ RCCommandParams params{app_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler,
+ *(resource_allocation_manager_.get()),
+ *(interior_data_cache_.get()),
+ *(interior_data_manager_.get())};
+ command_factory_.reset(new rc_rpc_plugin::RCCommandFactory(params));
+ rpc_service_ = &rpc_service;
+ app_mngr_ = &app_manager;
+ return true;
+}
+
+bool RCRPCPlugin::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource
+ message_source) {
+ return command_factory_->IsAbleToProcess(function_id, message_source);
+}
+
+std::string RCRPCPlugin::PluginName() {
+ return "RC RPC Plugin";
+}
+
+application_manager::CommandFactory& RCRPCPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void RCRPCPlugin::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {
+ resource_allocation_manager_->OnPolicyEvent(event);
+ interior_data_manager_->OnPolicyEvent(event);
+}
+
+void RCRPCPlugin::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ if (!application->is_remote_control_supported()) {
+ return;
+ }
+ switch (event) {
+ case plugins::kApplicationRegistered: {
+ application->AddExtension(
+ std::shared_ptr<RCAppExtension>(new RCAppExtension(kRCPluginID)));
+ resource_allocation_manager_->SendOnRCStatusNotifications(
+ NotificationTrigger::APP_REGISTRATION, application);
+ break;
+ }
+ case plugins::kApplicationExit: {
+ resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
+ break;
+ }
+ case plugins::kApplicationUnregistered: {
+ resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications(
+ application_manager::ApplicationManager& app_mngr) {
+ using application_manager::ApplicationSharedPtr;
+ using application_manager::ApplicationSet;
+ ApplicationSet accessor = app_mngr.applications().GetData();
+
+ std::vector<ApplicationSharedPtr> result;
+ for (const auto& it : accessor) {
+ if (it->is_remote_control_supported()) {
+ result.push_back(it);
+ }
+ }
+ return result;
+}
+
+} // namespace rc_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new rc_rpc_plugin::RCRPCPlugin();
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
new file mode 100644
index 0000000000..ecd263b77a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
@@ -0,0 +1,507 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+#include "application_manager/message_helper.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+
+namespace rc_rpc_plugin {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service)
+ : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
+ , app_mngr_(app_mngr)
+ , rpc_service_(rpc_service)
+ , is_rc_enabled_(true) {}
+
+ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {}
+
+AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const application_manager::ApplicationSharedPtr acquiring_app =
+ app_mngr_.application(app_id);
+ if (!acquiring_app) {
+ LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!");
+ return AcquireResult::IN_USE;
+ }
+
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocated_it) {
+ SetResourceAquired(module_type, app_id);
+ LOG4CXX_DEBUG(logger_,
+ "Resource is not acquired yet. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (app_id == allocated_resources_[module_type]) {
+ LOG4CXX_DEBUG(logger_,
+ "App: " << app_id << " is already acquired resource "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (IsModuleTypeRejected(module_type, app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Driver disallowed app: " << app_id << " to acquire "
+ << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ const mobile_apis::HMILevel::eType acquiring_app_hmi_level =
+ acquiring_app->hmi_level();
+
+ if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) {
+ LOG4CXX_DEBUG(logger_,
+ "Aquiring resources is not allowed in HMI level: "
+ << acquiring_app_hmi_level << ". App: " << app_id
+ << " is disallowed to acquire " << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ switch (current_access_mode_) {
+ case hmi_apis::Common_RCAccessMode::AUTO_DENY: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_DENY. "
+ << "App: " << app_id << " is disallowed to acquire "
+ << module_type);
+ return AcquireResult::IN_USE;
+ }
+ case hmi_apis::Common_RCAccessMode::ASK_DRIVER: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is ASK_DRIVER. "
+ "Driver confirmation is required for app: "
+ << app_id << " to acquire " << module_type);
+ return AcquireResult::ASK_DRIVER;
+ }
+ case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_ALLOW. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+
+ SetResourceAquired(module_type, app_id);
+ return AcquireResult::ALLOWED;
+ }
+ default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); }
+ }
+}
+
+void ResourceAllocationManagerImpl::ReleaseResource(
+ const std::string& module_type, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Release " << module_type << " by " << application_id);
+ SetResourceFree(module_type, application_id);
+}
+
+void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Apps app_list = RCRPCPlugin::GetRCApplications(app_mngr_);
+
+ Apps::const_iterator app = app_list.begin();
+ for (; app_list.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ const uint32_t application_id = app_ptr->app_id();
+ Resources acquired_modules = GetAcquiredResources(application_id);
+ std::sort(acquired_modules.begin(), acquired_modules.end());
+
+ Resources allowed_modules;
+ app_mngr_.GetPolicyHandler().GetModuleTypes((*app)->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Acquired modules: " << acquired_modules.size()
+ << " , allowed modules: "
+ << allowed_modules.size());
+
+ Resources disallowed_modules;
+ std::set_difference(acquired_modules.begin(),
+ acquired_modules.end(),
+ allowed_modules.begin(),
+ allowed_modules.end(),
+ std::back_inserter(disallowed_modules));
+
+ auto rc_extention = RCHelpers::GetRCExtension(**app);
+ Resources::const_iterator module = disallowed_modules.begin();
+ for (; disallowed_modules.end() != module; ++module) {
+ ReleaseResource(*module, application_id);
+ }
+ if (!disallowed_modules.empty()) {
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+ }
+ }
+}
+
+template <typename EnumType>
+EnumType StringToEnum(const std::string& str) {
+ using smart_objects::EnumConversionHelper;
+ EnumType val;
+ EnumConversionHelper<EnumType>::StringToEnum(str, &val);
+ return val;
+}
+
+void ConstructOnRCStatusNotificationParams(
+ smart_objects::SmartObject& msg_params,
+ const std::map<std::string, uint32_t>& allocated_resources,
+ const std::vector<std::string>& supported_resources,
+ const uint32_t app_id) {
+ namespace strings = application_manager::strings;
+ namespace message_params = rc_rpc_plugin::message_params;
+ using smart_objects::SmartObject;
+ using smart_objects::SmartType_Map;
+ using smart_objects::SmartType_Array;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ auto modules_inserter = [](SmartObject& result_modules) {
+ return [&result_modules](const std::string& module_name) {
+ smart_objects::SmartObject module_data =
+ SmartObject(smart_objects::SmartType_Map);
+ auto module_type =
+ StringToEnum<mobile_apis::ModuleType::eType>(module_name);
+ module_data[message_params::kModuleType] = module_type;
+ result_modules.asArray()->push_back(module_data);
+ };
+ };
+ SmartObject allocated_modules = SmartObject(SmartType_Array);
+ for (const auto& module : allocated_resources) {
+ if (module.second == app_id) {
+ modules_inserter(allocated_modules)(module.first);
+ }
+ }
+ SmartObject free_modules = SmartObject(SmartType_Array);
+ for (auto& module : supported_resources) {
+ if (allocated_resources.find(module) == allocated_resources.end()) {
+ modules_inserter(free_modules)(module);
+ }
+ }
+
+ msg_params[message_params::kAllocatedModules] = allocated_modules;
+ msg_params[message_params::kFreeModules] = free_modules;
+}
+
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::MessageHelper;
+ auto msg_to_mobile = MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::OnRCStatusID, app->app_id());
+ auto& msg_params = (*msg_to_mobile)[application_manager::strings::msg_params];
+ if (is_rc_enabled()) {
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ } else {
+ msg_params[message_params::kAllocatedModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[message_params::kFreeModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ return msg_to_mobile;
+}
+
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::MessageHelper;
+ auto msg_to_hmi =
+ MessageHelper::CreateHMINotification(hmi_apis::FunctionID::RC_OnRCStatus);
+ auto& msg_params = (*msg_to_hmi)[application_manager::strings::msg_params];
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ msg_params[application_manager::strings::app_id] = app->hmi_app_id();
+ return msg_to_hmi;
+}
+
+void ResourceAllocationManagerImpl::SetResourceAquired(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ allocated_resources_[module_type] = app_id;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+}
+
+void ResourceAllocationManagerImpl::SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr msg_to_mobile;
+ smart_objects::SmartObjectSPtr msg_to_hmi;
+ if (NotificationTrigger::APP_REGISTRATION == event) {
+ DCHECK(application);
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(application);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ } else {
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr_);
+ for (const auto& rc_app : rc_apps) {
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(rc_app);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ msg_to_hmi = CreateOnRCStatusNotificationToHmi(rc_app);
+ rpc_service_.SendMessageToHMI(msg_to_hmi);
+ }
+ }
+}
+
+bool ResourceAllocationManagerImpl::is_rc_enabled() const {
+ return is_rc_enabled_;
+}
+
+void ResourceAllocationManagerImpl::set_rc_enabled(const bool value) {
+ is_rc_enabled_ = value;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::RC_STATE_CHANGING,
+ std::shared_ptr<application_manager::Application>());
+}
+
+void ResourceAllocationManagerImpl::SetResourceFree(
+ const std::string& module_type, const uint32_t app_id) {
+ AllocatedResources::const_iterator allocation =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocation) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated.");
+ return;
+ }
+ if (app_id != allocation->second) {
+ LOG4CXX_ERROR(logger_,
+ "Resource " << module_type
+ << " is allocated by different application "
+ << allocation->second);
+ }
+ allocated_resources_.erase(allocation);
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
+}
+
+std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
+ const uint32_t application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Resources allocated_resources;
+ AllocatedResources::const_iterator allocation = allocated_resources_.begin();
+ for (; allocated_resources_.end() != allocation; ++allocation) {
+ if (application_id == allocation->second) {
+ allocated_resources.push_back(allocation->first);
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application_id << " acquired "
+ << allocated_resources.size()
+ << " resource(s).");
+
+ return allocated_resources;
+}
+
+void ResourceAllocationManagerImpl::SetResourceState(
+ const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Setting state for " << module_type << " by app_id " << app_id
+ << " to state " << state);
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+
+ const bool acquired = allocated_resources_.end() != allocated_it;
+ if (acquired) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is already acquired."
+ << " Owner application id is "
+ << allocated_it->second
+ << " Changing application id is " << app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is not acquired yet");
+ }
+ }
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_[module_type] = state;
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state);
+}
+
+bool ResourceAllocationManagerImpl::IsResourceFree(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ const ResourcesState::const_iterator resource =
+ resources_state_.find(module_type);
+
+ if (resources_state_.end() == resource) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free.");
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " state is " << resource->second);
+
+ return ResourceState::FREE == resource->second;
+}
+
+void ResourceAllocationManagerImpl::SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+ current_access_mode_ = access_mode;
+}
+
+hmi_apis::Common_RCAccessMode::eType
+ResourceAllocationManagerImpl::GetAccessMode() const {
+ return current_access_mode_;
+}
+
+void ResourceAllocationManagerImpl::ForceAcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type);
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ SetResourceAquired(module_type, app_id);
+}
+
+bool ResourceAllocationManagerImpl::IsModuleTypeRejected(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ RejectedResources::iterator it =
+ rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ return false;
+ }
+
+ const std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+
+ return helpers::in_range(list_of_rejected_resources, module_type);
+}
+
+void ResourceAllocationManagerImpl::OnDriverDisallowed(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ auto it = rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ rejected_resources_for_application_[app_id] = std::vector<std::string>();
+ }
+ std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+ list_of_rejected_resources.push_back(module_type);
+}
+
+void ResourceAllocationManagerImpl::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ using application_manager::plugin_manager::ApplicationEvent;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Event " << event << " came for " << application->app_id());
+
+ if (ApplicationEvent::kApplicationExit == event ||
+ ApplicationEvent::kApplicationUnregistered == event) {
+ Resources acquired_modules = GetAcquiredResources(application->app_id());
+ Resources::const_iterator module = acquired_modules.begin();
+ for (; acquired_modules.end() != module; ++module) {
+ ReleaseResource(*module, application->app_id());
+ }
+ if (!acquired_modules.empty()) {
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+ }
+ }
+}
+
+void ResourceAllocationManagerImpl::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {
+ using application_manager::plugin_manager::PolicyEvent;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Event " << event);
+
+ if (PolicyEvent::kApplicationPolicyUpdated == event) {
+ ProcessApplicationPolicyUpdate();
+ return;
+ }
+
+ if (PolicyEvent::kApplicationsDisabled == event) {
+ ResetAllAllocations();
+ return;
+ }
+}
+
+void ResourceAllocationManagerImpl::ResetAllAllocations() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+}
+
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..c1c59d7e78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,77 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${COMPONENTS_DIR}/application_manager/test/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/rc_rpc_plugin/test/include/
+ ${COMPONENTS_DIR}/include/test/application_manager/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/test/include
+ )
+
+set (RC_TEST_SOURCES
+${CMAKE_CURRENT_SOURCE_DIR}/resource_allocation_manager_impl_test.cc
+${CMAKE_CURRENT_SOURCE_DIR}/interior_data_cache_test.cc
+)
+
+set(RC_COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${RC_COMMANDS_TEST_DIR}/*
+)
+
+set(LIBRARIES
+ RCRpcPluginStaticLib
+ ApplicationManager
+ connectionHandler
+ SmartObjects
+ ProtocolHandler
+ MessageHelper
+ connectionHandler
+ Utils
+ jsoncpp
+ gmock_main
+ dl
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
+endif()
+
+create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
+create_test("rc_plugin_test" "${RC_TEST_SOURCES}" "${LIBRARIES}")
+
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt
new file mode 100644
index 0000000000..9ea47dca38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/rc_rpc_plugin/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/include/rc_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/rc_rpc_plugin/test/include
+)
+
+set(RC_COMMANDS_TEST_DIR ${RC_TEST_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${RC_COMMANDS_TEST_DIR}/*
+)
+
+set(LIBRARIES
+ gmock
+ RemoteControlModule
+ Utils
+ SmartObjects
+ jsoncpp
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ connectionHandler
+)
+
+create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
new file mode 100644
index 0000000000..59d038a790
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+using test::components::application_manager_test::MockApplication;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
+using test::components::commands_test::MobileResultCodeIs;
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using application_manager::commands::MessageSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const int kModuleId = 153u;
+const uint32_t kConnectionKey = 1u;
+const uint32_t kAppId = 0u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+
+class ButtonPressRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ButtonPressRequestTest()
+ : rc_capabilities_(smart_objects::SmartType_Map)
+ , mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {}
+
+ smart_objects::SmartObject ButtonCapability(
+ const mobile_apis::ButtonName::eType button_name) {
+ smart_objects::SmartObject button(smart_objects::SmartType_Map);
+ button["name"] = button_name;
+ return button;
+ }
+
+ void SetUp() OVERRIDE {
+ using namespace mobile_apis;
+
+ std::vector<ButtonName::eType> button_names = {ButtonName::AC_MAX,
+ ButtonName::AC,
+ ButtonName::RECIRCULATE,
+ ButtonName::FAN_UP,
+ ButtonName::FAN_DOWN,
+ ButtonName::TEMP_UP,
+ ButtonName::TEMP_DOWN,
+ ButtonName::DEFROST_MAX,
+ ButtonName::DEFROST,
+ ButtonName::DEFROST_REAR,
+ ButtonName::UPPER_VENT,
+ ButtonName::LOWER_VENT,
+ ButtonName::VOLUME_UP,
+ ButtonName::VOLUME_DOWN,
+ ButtonName::EJECT,
+ ButtonName::SOURCE,
+ ButtonName::SHUFFLE,
+ ButtonName::REPEAT};
+
+ smart_objects::SmartObject button_caps(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < button_names.size(); i++) {
+ button_caps[i] = ButtonCapability(button_names[i]);
+ }
+ rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(kPolicyAppId,
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::ButtonPressID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ smart_objects::SmartObject rc_capabilities_;
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<rc_rpc_plugin::RCAppExtension> rc_app_extention_;
+ test::components::policy_test::MockPolicyHandlerInterface
+ mock_policy_handler_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+};
+
+TEST_F(ButtonPressRequestTest,
+ Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ // Expectations
+ const std::string resource = "CLIMATE";
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ALLOWED));
+ EXPECT_CALL(
+ mock_allocation_manager_,
+ SetResourceState(resource, kAppId, rc_rpc_plugin::ResourceState::BUSY));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress)))
+ .WillOnce(Return(true));
+
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(
+ ButtonPressRequestTest,
+ Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+ // Expectations
+
+ const std::string resource = "RADIO";
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ALLOWED));
+ EXPECT_CALL(mock_allocation_manager_, SetResourceState(resource, kAppId, _))
+ .Times(2);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_ButtonPress))).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_message)[application_manager::strings::msg_params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_,
+ SetResourceState(_, kAppId, rc_rpc_plugin::ResourceState::FREE))
+ .Times(2);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*hmi_message);
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ command->on_event(event);
+}
+
+TEST_F(ButtonPressRequestTest,
+ OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
+ msg_params[message_params::kButtonPressMode] =
+ mobile_apis::ButtonPressMode::SHORT;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_message)[application_manager::strings::params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_,
+ SetResourceState(_, kAppId, rc_rpc_plugin::ResourceState::FREE))
+ .Times(2);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(false));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::Buttons_ButtonPress);
+ event.set_smart_object(*hmi_message);
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ mobile_message);
+ command->on_event(event);
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..25dad2dc04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -0,0 +1,593 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
+#include "gtest/gtest.h"
+#include "application_manager/mock_application.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/message_helper.h"
+#include "rc_rpc_plugin/rc_command_factory.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/commands/command_request_test.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+
+#include <thread>
+#include <chrono>
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::MockApplicationManager;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::HMIResultCodeIs;
+using test::components::commands_test::MobileResultCodeIs;
+
+namespace {
+const int32_t kConnectionKey = 5u;
+const uint32_t kAppId = 0u;
+const uint32_t kAppId2 = 1u;
+const int kModuleId = 153u;
+const auto module_type = mobile_apis::ModuleType::RADIO;
+const int32_t time_frame_of_allowed_requests = 1;
+const uint32_t max_request_in_time_frame = 5u;
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+class GetInteriorVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetInteriorVehicleDataRequestTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , mock_app2_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , rc_app_extention2_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app2_, app_id()).WillByDefault(Return(kAppId2));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app2_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(*mock_app2_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention2_));
+ }
+
+ /**
+ * @brief CreateBasicMessage creates message for
+ * GetInteriorVehicleData request for app1
+ * @return message shared ptr
+ */
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::GetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ void SetUp() OVERRIDE {
+ std::pair<uint32_t, int32_t> frequency;
+ frequency.first = max_request_in_time_frame;
+ frequency.second = time_frame_of_allowed_requests;
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, get_interior_vehicle_data_frequency())
+ .WillByDefault(ReturnRef(frequency));
+
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, application(kAppId2)).WillByDefault(Return(mock_app2_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(nullptr));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(
+ _, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, nullptr))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, CheckModule(_, _))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app2_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<RCAppExtension> rc_app_extention2_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_NoSubscriptionNoCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_SupscribeAppNoCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = true;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ // Act
+ command->Run();
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_ExpectMessageNotSentToHMI_SuccessSentToMobile_AppSubscribed_DataFromCache) {
+ // Arrange
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
+ .WillOnce(Return(radio_data));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ command->Run();
+
+ // Assert
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_LastAppSubscribedUnsubscibe_ClearCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ MessageSharedPtr hmi_response = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_response)[application_manager::strings::msg_params];
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ hmi_msg_params[application_manager::hmi_response::code] = response_code;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_interior_data_cache_, Remove(enums_value::kRadio));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectMessageNotSentToHMI_TwoApps_OneUnsubscribed) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ apps_.insert(mock_app_);
+ apps_.insert(mock_app2_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ rc_app_extention2_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
+ .WillOnce(Return(radio_data));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ command->Run();
+
+ // Assert
+ EXPECT_FALSE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_CapabilitiesValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ smart_objects::SmartObject rc_capabilities;
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE),
+ _)).WillOnce((Return(true)));
+ // Act
+ command->Run();
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_PolicyValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(false));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DISALLOWED), _))
+ .WillOnce((Return(true)));
+
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile_NoCache) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params = (*mobile_message)[strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kConnectionKey;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response_message);
+ command->Run();
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ MessageSharedPtr hmi_message = CreateBasicMessage();
+ auto& hmi_msg_params = (*hmi_message)[strings::params];
+ hmi_msg_params[hmi_response::code] = hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[strings::connection_key] = kConnectionKey;
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(true));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_message);
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ command->Run();
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_DontUnsubscibeLastApp_NoClearCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ MessageSharedPtr hmi_response = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*hmi_response)[application_manager::strings::params];
+ hmi_msg_params[application_manager::hmi_response::code] =
+ hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_interior_data_cache_, Clear()).Times(0);
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+
+ // Assert
+ EXPECT_TRUE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectRejectDuToRequestLimitation_NoCahce) {
+ // Arrange
+ rc_app_extention_->UnsubscribeFromInteriorVehicleData(enums_value::kRadio);
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ size_t i = 0;
+ for (; i <= max_request_in_time_frame; ++i) {
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_manager_,
+ StoreRequestToHMITime(enums_value::kRadio));
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillRepeatedly(Return(true));
+ // Act
+ command->Run();
+ }
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), _))
+ .WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ // Act
+ command->Run();
+}
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..b344471254
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/commands_test.h"
+#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandsTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+const int kModuleId = 153u;
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+using application_manager::ApplicationSet;
+
+class OnInteriorVehicleDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnInteriorVehicleDataNotificationTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::OnInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::app_id] = kAppId;
+ smart_objects::SmartObject& msg_param =
+ (*message)[application_manager::strings::msg_params];
+ msg_param[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return ::std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
+ params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+TEST_F(OnInteriorVehicleDataNotificationTest,
+ Run_SendMessageToMobile_Notification) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kClimate);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Add(enums_value::kClimate, _));
+ MessageSharedPtr message;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message));
+ // Act
+ std::shared_ptr<rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>
+ command = CreateRCCommand<
+ rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>(
+ mobile_message);
+ command->Run();
+
+ // Assertions
+ ASSERT_TRUE(message.get());
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
new file mode 100644
index 0000000000..b95725e0b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/commands_test.h"
+#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandsTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+using application_manager::ApplicationSet;
+
+class RCOnRemoteControlSettingsNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCOnRemoteControlSettingsNotificationTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {}
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::SetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ smart_objects::SmartObject& msg_param =
+ (*message)[application_manager::strings::msg_params];
+ msg_param[message_params::kModuleType] = enums_value::kClimate;
+
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+};
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_Allowed_SetAccessMode) { // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = true;
+
+ // Expectations
+
+ ON_CALL(mock_allocation_manager_, GetAccessMode())
+ .WillByDefault(Return(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+
+ EXPECT_CALL(mock_allocation_manager_,
+ SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
+ CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+
+ command->Run();
+}
+
+TEST_F(RCOnRemoteControlSettingsNotificationTest,
+ Run_NotAllowed_ResetAllAllocations) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = false;
+
+ EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations());
+ EXPECT_CALL(mock_interior_data_manager_, OnDisablingRC());
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
+ CreateRCCommand<
+ rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
+ mobile_message);
+
+ command->Run();
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
new file mode 100644
index 0000000000..567d4b1e20
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
@@ -0,0 +1,248 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/rpc_service_impl.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "application_manager/include/application_manager/command_holder_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "application_manager/mock_command_factory.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/message.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
+#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
+#include "hmi_message_handler/mock_hmi_message_handler.h"
+#include "interfaces/MOBILE_API.h"
+#include "include/test/protocol_handler/mock_protocol_handler.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::Mock;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+using am::ApplicationSet;
+using am::commands::MessageSharedPtr;
+using am::commands::CommandImpl;
+using am::plugin_manager::RPCPlugin;
+using ::smart_objects::SmartObject;
+using rc_rpc_plugin::commands::ButtonPressRequest;
+using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse;
+using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentRequest;
+using rc_rpc_plugin::RCRPCPlugin;
+using test::components::commands_test::CommandsTestMocks;
+using test::components::commands_test::CommandRequestTest;
+using am::plugin_manager::MockRPCPluginManager;
+using am::plugin_manager::MockRPCPlugin;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockRequestControlerSettings;
+using test::components::protocol_handler_test::MockProtocolHandler;
+using test::components::hmi_message_handler_test::MockHMIMessageHandler;
+using test::components::application_manager_test::MockHMICapabilities;
+using test::components::application_manager_test::MockCommandFactory;
+using test::components::policy_test::MockPolicyHandlerInterface;
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kAppId = 5u;
+const std::string kResource = "CLIMATE";
+const uint32_t kPluginID = RCRPCPlugin::kRCPluginID;
+} // namespace
+
+class RCGetInteriorVehicleDataConsentTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCGetInteriorVehicleDataConsentTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , command_holder(app_mngr_)
+ , request_controller(mock_request_controler)
+ , rpc_service_(app_mngr_,
+ request_controller,
+ &mock_protocol_handler,
+ &mock_hmi_handler,
+ command_holder)
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kPluginID))
+ , mock_rpc_plugin_manager(
+ std::make_shared<NiceMock<MockRPCPluginManager> >())
+ , rpc_plugin(mock_rpc_plugin)
+ , optional_mock_rpc_plugin(mock_rpc_plugin) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(mock_hmi_capabilities_));
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(
+ _, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, nullptr))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, CheckModule(_, _))
+ .WillByDefault(Return(true));
+ ON_CALL(app_mngr_, GetPluginManager())
+ .WillByDefault(ReturnRef(*mock_rpc_plugin_manager));
+ ON_CALL(*mock_rpc_plugin_manager, FindPluginToProcess(_, _))
+ .WillByDefault(Return(rpc_plugin));
+ ON_CALL(mock_allocation_manager_, IsResourceFree(kResource))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::ButtonPressID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ protected:
+ std::shared_ptr<MockApplication> mock_app_;
+ MockRequestControlerSettings mock_request_controler;
+ MockProtocolHandler mock_protocol_handler;
+ MockHMIMessageHandler mock_hmi_handler;
+ am::CommandHolderImpl command_holder;
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ smart_objects::SmartObject rc_capabilities_;
+ MockRPCPlugin mock_rpc_plugin;
+ MockCommandFactory mock_command_factory;
+ am::request_controller::RequestController request_controller;
+ am::rpc_service::RPCServiceImpl rpc_service_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<am::plugin_manager::MockRPCPluginManager>
+ mock_rpc_plugin_manager;
+ utils::Optional<RPCPlugin> rpc_plugin;
+ utils::Optional<MockRPCPlugin> optional_mock_rpc_plugin;
+};
+
+TEST_F(RCGetInteriorVehicleDataConsentTest,
+ Run_MobileSendButtonPressMessage_HMISendASKDRIVERModeToMobile) {
+ // Arrange
+ auto mobile_message = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::ASK_DRIVER));
+ EXPECT_CALL(*optional_mock_rpc_plugin, GetCommandFactory())
+ .WillOnce(ReturnRef(mock_command_factory));
+ auto rc_consent_request =
+ CreateRCCommand<commands::RCGetInteriorVehicleDataConsentRequest>(
+ mobile_message);
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(rc_consent_request));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_RC));
+
+ // Act
+ auto command = CreateRCCommand<commands::ButtonPressRequest>(mobile_message);
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(RCGetInteriorVehicleDataConsentTest,
+ Run_MobileSendButtonPressMessage_HMISendINUSEModeToMobile) {
+ // Arrange
+ auto mobile_message = CreateBasicMessage();
+
+ // Expectations
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(rc_rpc_plugin::AcquireResult::IN_USE));
+
+ EXPECT_CALL(*optional_mock_rpc_plugin, GetCommandFactory())
+ .WillOnce(ReturnRef(mock_command_factory));
+ auto rc_consent_response =
+ CreateRCCommand<commands::RCGetInteriorVehicleDataConsentResponse>(
+ mobile_message);
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(rc_consent_response));
+ auto command = CreateRCCommand<commands::ButtonPressRequest>(mobile_message);
+
+ // Act
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..b1cb8271f5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+#include "gtest/gtest.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+using application_manager::ApplicationSet;
+using application_manager::commands::MessageSharedPtr;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::commands_test::CommandRequestTest;
+using test::components::commands_test::CommandsTestMocks;
+
+namespace {
+const uint32_t kAppId = 0u;
+const int kModuleId = 153u;
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "Test";
+}
+
+namespace rc_rpc_plugin_test {
+using namespace rc_rpc_plugin;
+
+class SetInteriorVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetInteriorVehicleDataRequestTest()
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId)) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillByDefault(Return(application_manager::HmiInterfaces::
+ InterfaceState::STATE_AVAILABLE));
+ ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(rc_app_extention_));
+
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ ON_CALL(mock_allocation_manager_, IsResourceFree(_))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillByDefault(Return(AcquireResult::ALLOWED));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(mock_policy_handler_,
+ CheckHMIType(kPolicyAppId,
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
+ }
+
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::SetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ template <class Command>
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
+ InitCommand(kDefaultTimeout_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
+ }
+
+ protected:
+ testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+};
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::READ_ONLY),
+ application_manager::commands::Command::SOURCE_SDL));
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableAndReadOnlyParams_ExpectCutReadOnlyAndResendToHMI) {
+ // Arrange
+
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+ smart_objects::SmartObject radio_control_data(smart_objects::SmartType_Map);
+ radio_control_data[message_params::kState] = true;
+ radio_control_data[message_params::kRadioEnable] = true;
+ msg_params[message_params::kModuleData][message_params::kRadioControlData] =
+ radio_control_data;
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillOnce(Return(nullptr));
+
+ EXPECT_CALL(app_mngr_, RemoveHMIFakeParameters(_, _));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::OUT_OF_MEMORY),
+ application_manager::commands::Command::SOURCE_SDL));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::RADIO;
+
+ msg_params[message_params::kModuleData][message_params::kClimateControlData] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ // Expectations
+ EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _))
+ .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(test::components::commands_test::MobileResultCodeIs(
+ mobile_apis::Result::INVALID_DATA),
+ application_manager::commands::Command::SOURCE_SDL));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
+}
+
+} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
new file mode 100644
index 0000000000..45465f96b0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataCache : public rc_rpc_plugin::InteriorDataCache {
+ public:
+ MOCK_METHOD2(Add,
+ void(const std::string&, const smart_objects::SmartObject&));
+ MOCK_CONST_METHOD1(Retrieve, smart_objects::SmartObject(const std::string&));
+ MOCK_CONST_METHOD1(Contains, bool(const std::string&));
+ MOCK_METHOD1(Remove, void(const std::string&));
+ MOCK_METHOD0(Clear, void());
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
new file mode 100644
index 0000000000..fc19c6a889
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataManager : public rc_rpc_plugin::InteriorDataManager {
+ public:
+ MOCK_METHOD1(OnPolicyEvent,
+ void(application_manager::plugin_manager::PolicyEvent));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(application_manager::plugin_manager::ApplicationEvent,
+ application_manager::ApplicationSharedPtr));
+ MOCK_METHOD0(OnDisablingRC, void());
+ MOCK_METHOD1(StoreRequestToHMITime, void(const std::string&));
+ MOCK_METHOD1(CheckRequestsToHMIFrequency, bool(const std::string&));
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
new file mode 100644
index 0000000000..72ace1432a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h"
+
+namespace rc_rpc_plugin_test {
+
+class MockResourceAllocationManager
+ : public rc_rpc_plugin::ResourceAllocationManager {
+ public:
+ MOCK_METHOD2(AcquireResource,
+ rc_rpc_plugin::AcquireResult::eType(
+ const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(ForceAcquireResource,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnDriverDisallowed,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(OnPolicyEvent,
+ void(application_manager::plugin_manager::PolicyEvent event));
+ MOCK_METHOD1(SetAccessMode,
+ void(const hmi_apis::Common_RCAccessMode::eType access_mode));
+ MOCK_CONST_METHOD0(GetAccessMode, hmi_apis::Common_RCAccessMode::eType());
+ MOCK_METHOD3(SetResourceState,
+ void(const std::string& module_type,
+ const uint32_t app_id,
+ const rc_rpc_plugin::ResourceState::eType state));
+ MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
+ MOCK_METHOD0(ResetAllAllocations, void());
+ MOCK_METHOD2(SendOnRCStatusNotifications,
+ void(rc_rpc_plugin::NotificationTrigger::eType,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_CONST_METHOD0(is_rc_enabled, bool());
+ MOCK_METHOD1(set_rc_enabled, void(const bool value));
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
new file mode 100644
index 0000000000..e6922a4c83
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. */
+
+#include "gtest/gtest.h"
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+
+namespace rc_rpc_plugin_test {
+
+class InteriorDataCacheTest : public ::testing::Test {};
+
+namespace {
+const uint32_t time_frame_alowed_requests = 1;
+} // namespace
+
+TEST_F(InteriorDataCacheTest,
+ InteriorDataCacheDoesNotContainRandomDataInitialy) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ std::string module_type_key = "random_module_type";
+ EXPECT_FALSE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data.getType());
+}
+
+TEST_F(InteriorDataCacheTest, CheckThatCacheContansDataAfterAdding) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, DataDoesNotExistAfterClear) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto Retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(Retrieved_data, data);
+ cache.Clear();
+ auto Retrieved_data_after_clear = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null,
+ Retrieved_data_after_clear.getType());
+}
+
+TEST_F(InteriorDataCacheTest, MultipleDataCached) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+ EXPECT_TRUE(cache.Contains(module_type_key1));
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(data1, retrieved_data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(retrieved_data2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+ EXPECT_TRUE(data2 != retrieved_data1);
+ EXPECT_TRUE(data1 != retrieved_data2);
+}
+
+TEST_F(InteriorDataCacheTest, RemoveFromChacheSuccessful) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value1";
+ cache.Add(module_type, data);
+ EXPECT_TRUE(cache.Contains(module_type));
+ auto retrieved_data1 = cache.Retrieve(module_type);
+ EXPECT_EQ(data, retrieved_data1);
+
+ cache.Remove(module_type);
+ EXPECT_FALSE(cache.Contains(module_type));
+ auto retreived = cache.Retrieve(module_type);
+ EXPECT_EQ(smart_objects::SmartType_Null, retreived.getType());
+}
+
+TEST_F(InteriorDataCacheTest, RemoveNotExistingNoSideEffects) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ cache.Remove("some other module_type");
+
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, Exist2ModuleTypesRemoveOneAnotherOneLeft) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+
+ cache.Remove(module_type_key1);
+ EXPECT_FALSE(cache.Contains(module_type_key1));
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data1.getType());
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(data2, retrieved_data2);
+}
+
+} // rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
new file mode 100644
index 0000000000..86c58b9d46
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
@@ -0,0 +1,668 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. */
+
+#include <algorithm>
+#include "gtest/gtest.h"
+
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::MockApplicationManager;
+using test::components::application_manager_test::MockRPCService;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::testing::Eq;
+using ::testing::DoAll;
+using ::testing::SetArgPointee;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const bool kDeviceHandle = 1u;
+const std::string kModuleType1 = "CLIMATE";
+const std::string kModuleType2 = "RADIO";
+const int32_t kConnectionKey = 5;
+const int32_t kCorrelationId = 5;
+const uint32_t kAppId1 = 11u;
+const uint32_t kHMIAppId1 = 1u;
+const uint32_t kAppId2 = 22u;
+const std::string policy_app_id_1_ = "policy_id_1";
+const uint32_t kSizeOfModules = 6u;
+}
+
+namespace rc_rpc_plugin_test {
+
+using namespace rc_rpc_plugin;
+
+class RAManagerTest : public ::testing::Test {
+ public:
+ RAManagerTest()
+ : message_(std::make_shared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc)))
+ , mock_app_1_(std::make_shared<NiceMock<MockApplication> >())
+ , mock_app_2_(std::make_shared<NiceMock<MockApplication> >())
+ , apps_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_ptr_) {
+ ON_CALL(mock_app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ auto plugin_id = rc_rpc_plugin::RCRPCPlugin::kRCPluginID;
+ app_ext_ptr_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(plugin_id);
+ ON_CALL(*mock_app_1_, app_id()).WillByDefault(Return(kAppId1));
+
+ OnRCStatusNotificationExpectations();
+ }
+
+ void CheckResultWithHMILevelAndAccessMode(
+ ResourceAllocationManagerImpl& ra_manager,
+ mobile_apis::HMILevel::eType app_level,
+ const rc_rpc_plugin::AcquireResult::eType expected_result,
+ const hmi_apis::Common_RCAccessMode::eType access_mode);
+
+ void OnRCStatusNotificationExpectations();
+
+ protected:
+ NiceMock<MockApplicationManager> mock_app_mngr_;
+ NiceMock<MockRPCService> mock_rpc_service_;
+ test::components::policy_test::MockPolicyHandlerInterface
+ mock_policy_handler_;
+ application_manager::MessagePtr message_;
+
+ application_manager::AppExtensionPtr app_ext_ptr_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_1_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_2_;
+ application_manager::ApplicationSet apps_;
+ std::shared_ptr<sync_primitives::Lock> apps_lock_ptr_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
+};
+
+void RAManagerTest::CheckResultWithHMILevelAndAccessMode(
+ ResourceAllocationManagerImpl& ra_manager,
+ mobile_apis::HMILevel::eType app_level,
+ const AcquireResult::eType expected_result,
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ // Arrange
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ra_manager.SetAccessMode(access_mode);
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level));
+ // Second app tries to get already acquired resource by 1st app
+ EXPECT_EQ(expected_result, ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+void RAManagerTest::OnRCStatusNotificationExpectations() {
+ ON_CALL(mock_app_mngr_, application(kAppId1))
+ .WillByDefault(Return(mock_app_1_));
+ ON_CALL(*mock_app_1_, QueryInterface(rc_rpc_plugin::RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(app_ext_ptr_));
+ apps_.insert(mock_app_1_);
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(apps_da_));
+}
+
+TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
+ // Arrange
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ // Act & Assert
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ // Act & Assert
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_AppInAnyHmiLevelWantsToAcquireSameResourceTwice_Expect_Allowed) {
+ // Arrange
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ // Same app tries to get already acquired resource
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_NotInFULLWantsToGetAcquiredResource_Expect_Rejected) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_BACKGROUND;
+ const AcquireResult::eType expected_result = AcquireResult::REJECTED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_DENY_Expect_InUse) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::IN_USE;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_DENY;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_ALLOW_Expect_Allowed) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ALLOWED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_ASK_DRIVER_Expect_AskDriver) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace rc_rpc_plugin;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ASK_DRIVER;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::ASK_DRIVER;
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AcquiredModuleIsRejectedForApp2_ExpectApp2Rejected) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+ EXPECT_EQ(AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnDriverDisallowed(kModuleType1, kAppId2);
+
+ // Assert
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_EQ(AcquireResult::REJECTED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppExit_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationExit, mock_app_1_);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationExit, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+
+ ra_manager.OnApplicationEvent(
+ application_manager::plugin_manager::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_1_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ DataAccessor<application_manager::ApplicationSet> apps_da(apps, apps_lock);
+
+ EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillRepeatedly(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent::kApplicationsDisabled);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+}
+
+TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr =
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(
+ application_manager::AppExtensionUID(
+ rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
+ .WillRepeatedly(Return(rc_extention_ptr));
+
+ ON_CALL(*mock_app_1_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ EXPECT_CALL(*mock_app_1_, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_1_));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ application_manager::ApplicationSet apps;
+ apps.insert(mock_app_1_);
+ std::shared_ptr<sync_primitives::Lock> apps_lock =
+ std::make_shared<sync_primitives::Lock>();
+ DataAccessor<application_manager::ApplicationSet> apps_da(apps, apps_lock);
+
+ EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
+
+ Resources allowed_modules;
+ allowed_modules.push_back(kModuleType1);
+
+ EXPECT_CALL(mock_policy_handler_, GetModuleTypes(policy_app_id_1_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(allowed_modules), Return(true)));
+
+ // Act
+ ra_manager.OnPolicyEvent(application_manager::plugin_manager::PolicyEvent::
+ kApplicationPolicyUpdated);
+
+ EXPECT_CALL(mock_app_mngr_, application(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+}
+
+TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) {
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_DENY);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_DENY,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::ASK_DRIVER,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_ALLOW);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_ALLOW,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::INVALID_ENUM);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::INVALID_ENUM,
+ ra_manager.GetAccessMode());
+}
+
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_allowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_disallowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.set_rc_enabled(false);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_disabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(false);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_enabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(true);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
new file mode 100644
index 0000000000..11dd35d061
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt
@@ -0,0 +1,77 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${COMMANDS_SOURCE_DIR}/hmi
+)
+
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(RPC_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+ Policy
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES})
+target_link_libraries("sdl_rpc_plugin" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS sdl_rpc_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
new file mode 100644
index 0000000000..7b0911fef9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ActivateAppRequest command class
+ **/
+class ActivateAppRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ActivateAppRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ActivateAppRequest class destructor
+ **/
+ virtual ~ActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
new file mode 100644
index 0000000000..f937b4f63b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ActivateAppResponse command class
+ **/
+class ActivateAppResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ActivateAppResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ActivateAppResponse class destructor
+ **/
+ virtual ~ActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
new file mode 100644
index 0000000000..4e9e4d54d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddStatisticsInfoNotification command class
+ **/
+class AddStatisticsInfoNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief AddStatisticsInfoNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddStatisticsInfoNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AddStatisticsInfoNotification class destructor
+ **/
+ virtual ~AddStatisticsInfoNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
new file mode 100644
index 0000000000..45acb3a424
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsRequest command class
+ **/
+class AllowAllAppsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AllowAllAppsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAllAppsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AllowAllAppsRequest class destructor
+ **/
+ virtual ~AllowAllAppsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
new file mode 100644
index 0000000000..41d1c9e752
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsResponse command class
+ **/
+class AllowAllAppsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAllAppsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAllAppsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AllowAllAppsResponse class destructor
+ **/
+ virtual ~AllowAllAppsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
new file mode 100644
index 0000000000..b3a2d88d7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAppRequest command class
+ **/
+class AllowAppRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AllowAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAppRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AllowAppRequest class destructor
+ **/
+ virtual ~AllowAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
new file mode 100644
index 0000000000..55637e1756
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AllowAppResponse command class
+ **/
+class AllowAppResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AllowAppResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AllowAppResponse class destructor
+ **/
+ virtual ~AllowAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
new file mode 100644
index 0000000000..2208671e0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief The BasicCommunicationGetSystemTimeRequest class sends the request
+ * to the HMI in order to receive current system time.
+ */
+class BasicCommunicationGetSystemTimeRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationGetSystemTimeRequest does nothing except of
+ * initializing base class with the passed parameters.
+ * @param message the message to send to HMI
+ * @param application_manager application manager. Location service which
+ * is provides neccessary api to send the request.
+ */
+ BasicCommunicationGetSystemTimeRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief onTimeOut allows to handle case when
+ * system does not respond for certain request in
+ * appropriate time window.
+ */
+ void onTimeOut() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
new file mode 100644
index 0000000000..90160d9953
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+#include "utils/macro.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief The BasicCommunicationGetSystemTimeResponse class represents the
+ * HMI response which is contains data obtained from HMI.
+ */
+class BasicCommunicationGetSystemTimeResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationGetSystemTimeResponse does nothing except of
+ * initializing base class with the passed parameters.
+ * @param message the message to send to HMI
+ * @param application_manager Location service which which is provides
+ * neccessary api to send the request.
+ */
+ BasicCommunicationGetSystemTimeResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief Run takes the message obtained from the HMI and
+ * sends this data to the subscribed on certain event class
+ */
+ void Run() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_GET_SYSTEM_TIME_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
new file mode 100644
index 0000000000..2ac1be2580
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAwakeSDLNotification command class
+ **/
+class OnAwakeSDLNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAwakeSDLNotification class constructor
+ * @param message Incoming SmartObject message
+ * @param application_manager reference to ApplicationManager instance
+ **/
+ OnAwakeSDLNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAwakeSDLNotification class destructor
+ **/
+ virtual ~OnAwakeSDLNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAwakeSDLNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
new file mode 100644
index 0000000000..a7eb820146
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemRequest command class
+ **/
+class BasicCommunicationSystemRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationSystemRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationSystemRequest class destructor
+ **/
+ virtual ~BasicCommunicationSystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
new file mode 100644
index 0000000000..20483a45e3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemResponse command class
+ **/
+class BasicCommunicationSystemResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ BasicCommunicationSystemResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief BasicCommunicationSystemResponse class destructor
+ **/
+ virtual ~BasicCommunicationSystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
new file mode 100644
index 0000000000..5c650fb8e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class ButtonGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ButtonGetCapabilitiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ButtonGetCapabilitiesRequest class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
new file mode 100644
index 0000000000..bf2f15c18a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesResponse command class
+ **/
+class ButtonGetCapabilitiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ButtonGetCapabilitiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ButtonGetCapabilitiesResponse class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
new file mode 100644
index 0000000000..635b0579f4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ClosePopupRequest command class
+ **/
+class ClosePopupRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief ClosePopupRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ClosePopupRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ClosePopupRequest class destructor
+ **/
+ virtual ~ClosePopupRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
new file mode 100644
index 0000000000..199b40f070
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ClosePopupResponse command class
+ **/
+class ClosePopupResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief ClosePopupResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ClosePopupResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief ClosePopupResponse class destructor
+ **/
+ virtual ~ClosePopupResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
new file mode 100644
index 0000000000..a70bff2553
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateRequest command class
+ **/
+class DecryptCertificateRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief DecryptCertificateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
new file mode 100644
index 0000000000..88b216eeea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateResponse command class
+ **/
+class DecryptCertificateResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief DecryptCertificateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief DecryptCertificateResponse class destructor
+ **/
+ virtual ~DecryptCertificateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
new file mode 100644
index 0000000000..fa0efb90e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+/**
+ * @brief DialNumberRequest command class
+ **/
+class DialNumberRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief DialNumberRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief DialNumberRequest class destructor
+ **/
+ virtual ~DialNumberRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
new file mode 100644
index 0000000000..33d4788eca
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief DialNumberResponse command class
+ **/
+class DialNumberResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief DialNumberResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief DialNumberResponse class destructor
+ **/
+ virtual ~DialNumberResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
new file mode 100644
index 0000000000..d771167798
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoRequest command class
+ **/
+class GetSystemInfoRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief GetSystemInfoRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetSystemInfoRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief GetSystemInfoRequest class destructor
+ **/
+ virtual ~GetSystemInfoRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
new file mode 100644
index 0000000000..5bf5f41b73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+struct SystemInfo {
+ std::string ccpu_version;
+ std::string wers_country_code;
+ std::string language;
+};
+
+/**
+ * @brief GetSystemInfoResponse command class
+ **/
+class GetSystemInfoResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief GetSystemInfoResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetSystemInfoResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief GetSystemInfoResponse class destructor
+ **/
+ virtual ~GetSystemInfoResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ const SystemInfo GetSystemInfo(
+ const hmi_apis::Common_Result::eType code) const;
+
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
new file mode 100644
index 0000000000..93b414c8c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief GetUrls command class
+ **/
+class GetUrls : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief GetUrls class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetUrls(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief GetUrls class destructor
+ **/
+ virtual ~GetUrls();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+#ifdef PROPRIETARY_MODE
+ /**
+ * @brief Processes URLs collecting for policy service
+ * @param endpoints Endpoints section of policy table
+ */
+ void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
+#endif // PROPRIETARY_MODE
+
+ /**
+ * @brief Process URLs collecting for service
+ * @param endpoints Endpoints section of policy table
+ */
+ void ProcessServiceURLs(const policy::EndpointUrls& endpoints);
+
+ /**
+ * @brief Sends response to HMI
+ * @param result Result code
+ */
+ void SendResponseToHMI(hmi_apis::Common_Result::eType result);
+
+ DISALLOW_COPY_AND_ASSIGN(GetUrls);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
new file mode 100644
index 0000000000..1ff38194b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class GetUrlsResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief GetUrlsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetUrlsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief GetUrlsResponse class destructor
+ **/
+ virtual ~GetUrlsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
new file mode 100644
index 0000000000..34c10cedf1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedRequest command class
+ **/
+class MixingAudioSupportedRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ MixingAudioSupportedRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief MixingAudioSupportedRequest class destructor
+ **/
+ virtual ~MixingAudioSupportedRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
new file mode 100644
index 0000000000..5c67666225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedResponse command class
+ **/
+class MixingAudioSupportedResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ MixingAudioSupportedResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief MixingAudioSupportedResponse class destructor
+ **/
+ virtual ~MixingAudioSupportedResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
new file mode 100644
index 0000000000..3f63ef883d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverRequest command class
+ **/
+class NaviAlertManeuverRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviAlertManeuverRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviAlertManeuverRequest class destructor
+ **/
+ virtual ~NaviAlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
new file mode 100644
index 0000000000..7d7c4de85e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverResponse command class
+ **/
+class NaviAlertManeuverResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviAlertManeuverResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviAlertManeuverResponse class destructor
+ **/
+ virtual ~NaviAlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
new file mode 100644
index 0000000000..80e948ad25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamRequest command class
+ **/
+class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief AudioStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStartStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~AudioStartStreamRequest();
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief On event callback
+ **/
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set audio_stream_retry_number counter to 0
+ */
+ void RetryStartSession();
+
+ private:
+ uint32_t retry_number_;
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
new file mode 100644
index 0000000000..926cfc36ed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamResponse command class
+ **/
+class AudioStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStartStreamResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief AudioStartStreamResponse class destructor
+ **/
+ virtual ~AudioStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
new file mode 100644
index 0000000000..7c5fbbdd3d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AudioStopStreamRequest command class
+ **/
+class AudioStopStreamRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief AudioStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStopStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~AudioStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
new file mode 100644
index 0000000000..8eb091dd92
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class AudioStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AudioStopStreamResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~AudioStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
new file mode 100644
index 0000000000..dab5fc1022
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviGetWayPointsRequest command class
+ **/
+class NaviGetWayPointsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviGetWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviGetWayPointsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ /**
+ * @brief NaviGetWayPointsRequest class destructor
+ **/
+ virtual ~NaviGetWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
new file mode 100644
index 0000000000..fb93c2c64a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviGetWaypoints command class
+ **/
+class NaviGetWayPointsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviGetWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviGetWayPointsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviGetWaypoints class destructor
+ **/
+ virtual ~NaviGetWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
new file mode 100644
index 0000000000..404ddc9f00
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyRequest command class
+ **/
+class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviIsReadyRequest class destructor
+ **/
+ virtual ~NaviIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
new file mode 100644
index 0000000000..7f94312d04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyResponse command class
+ **/
+class NaviIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviIsReadyResponse class destructor
+ **/
+ virtual ~NaviIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
new file mode 100644
index 0000000000..7bdf0e4787
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationRequest command class
+ */
+class NaviSendLocationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviSendLocationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ NaviSendLocationRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviSendLocationRequest class destructor
+ */
+ virtual ~NaviSendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
new file mode 100644
index 0000000000..6a65eb00a1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationResponse command class
+ */
+class NaviSendLocationResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSendLocationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ NaviSendLocationResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviSendLocationResponse class destructor
+ */
+ virtual ~NaviSendLocationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
new file mode 100644
index 0000000000..a981b8ff81
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigRequest command class
+ **/
+class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviSetVideoConfigRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviSetVideoConfigRequest class destructor
+ **/
+ virtual ~NaviSetVideoConfigRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut callback
+ */
+ void onTimeOut() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
new file mode 100644
index 0000000000..f5f9e7a5ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigResponse command class
+ **/
+class NaviSetVideoConfigResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSetVideoConfigResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviSetVideoConfigResponse class destructor
+ **/
+ virtual ~NaviSetVideoConfigResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
new file mode 100644
index 0000000000..f64bdf6ce0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTRequest command class
+ **/
+class NaviShowConstantTBTRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviShowConstantTBTRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief NaviShowConstantTBTRequest class destructor
+ **/
+ virtual ~NaviShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
new file mode 100644
index 0000000000..fd4da08cf0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTResponse command class
+ **/
+class NaviShowConstantTBTResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviShowConstantTBTResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviShowConstantTBTResponse class destructor
+ **/
+ virtual ~NaviShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
new file mode 100644
index 0000000000..d5aae67661
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamRequest command class
+ **/
+class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStartStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~NaviStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief On event callback
+ **/
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief RetryStartSession resend HMI startSession request if needed.
+ * If limit expired, set video_stream_retry_number counter to 0
+ */
+ void RetryStartSession();
+
+ private:
+ uint32_t retry_number_;
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
new file mode 100644
index 0000000000..b4770e82fe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamResponse command class
+ **/
+class NaviStartStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStartStreamResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviStartStreamResponse class destructor
+ **/
+ virtual ~NaviStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
new file mode 100644
index 0000000000..400c61ba07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamRequest command class
+ **/
+class NaviStopStreamRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStopStreamRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~NaviStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
new file mode 100644
index 0000000000..39512ac2bb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class NaviStopStreamResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviStopStreamResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~NaviStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
new file mode 100644
index 0000000000..052c3c7151
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWayPointsRequest command class
+ **/
+class NaviSubscribeWayPointsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviSubscribeWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviSubscribeWayPointsRequest(
+ const app_mngr::commands::MessageSharedPtr& messag,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ /**
+ * @brief NaviSubscribeWayPointsRequest class destructor
+ **/
+ virtual ~NaviSubscribeWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
new file mode 100644
index 0000000000..73aab4633f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWaypoints command class
+ **/
+class NaviSubscribeWayPointsResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSubscribeWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviSubscribeWayPointsResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviSubscribeWaypoints class destructor
+ **/
+ virtual ~NaviSubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
new file mode 100644
index 0000000000..f20386a246
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviSubscribeWayPointsRequest command class
+ **/
+class NaviUnsubscribeWayPointsRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviUnsubscribeWayPointsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUnsubscribeWayPointsRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+ /**
+ * @brief NaviUnsubscribeWayPointsRequest class destructor
+ **/
+ virtual ~NaviUnsubscribeWayPointsRequest();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
new file mode 100644
index 0000000000..ec4f4eb963
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUnsubscribeWaypoints command class
+ **/
+class NaviUnsubscribeWayPointsResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUnsubscribeWaypoints class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUnsubscribeWayPointsResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviUnsubscribeWaypoints class destructor
+ **/
+ virtual ~NaviUnsubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
new file mode 100644
index 0000000000..db269a65d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListRequest command class
+ **/
+class NaviUpdateTurnListRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUpdateTurnListRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviUpdateTurnListRequest class destructor
+ **/
+ virtual ~NaviUpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
new file mode 100644
index 0000000000..20295485a3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListResponse command class
+ **/
+class NaviUpdateTurnListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ NaviUpdateTurnListResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief NaviUpdateTurnListResponse class destructor
+ **/
+ virtual ~NaviUpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
new file mode 100644
index 0000000000..42bf877f2d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAllowSDLFunctionalityNotification command class
+ **/
+class OnAllowSDLFunctionalityNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAllowSDLFunctionalityNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class destructor
+ **/
+ virtual ~OnAllowSDLFunctionalityNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
new file mode 100644
index 0000000000..cc21d699fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppActivatedNotification command class
+ **/
+class OnAppActivatedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppActivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppActivatedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppActivatedNotification class destructor
+ **/
+ virtual ~OnAppActivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
new file mode 100644
index 0000000000..9b4a6ba5a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppDeactivatedNotification command class
+ **/
+class OnAppDeactivatedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppDeactivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppDeactivatedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppDeactivatedNotification class destructor
+ **/
+ virtual ~OnAppDeactivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
new file mode 100644
index 0000000000..6008a8ce51
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionChangedNotification command class
+ **/
+class OnAppPermissionChangedNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppPermissionChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppPermissionChangedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppPermissionChangedNotification class destructor
+ **/
+ virtual ~OnAppPermissionChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
new file mode 100644
index 0000000000..a751b25d85
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionConsentNotification command class
+ **/
+class OnAppPermissionConsentNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppPermissionConsentNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppPermissionConsentNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppPermissionConsentNotification class destructor
+ **/
+ virtual ~OnAppPermissionConsentNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
new file mode 100644
index 0000000000..3548786d1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppRegisteredNotification command class
+ **/
+class OnAppRegisteredNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppRegisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppRegisteredNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppRegisteredNotification class destructor
+ **/
+ virtual ~OnAppRegisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
new file mode 100644
index 0000000000..097eb1eb28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppUnregisteredNotification command class
+ **/
+class OnAppUnregisteredNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppUnregisteredNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAppUnregisteredNotification class destructor
+ **/
+ ~OnAppUnregisteredNotification() FINAL;
+
+ /**
+ * @brief Init overrides and skips replacement of app id with hmi id since
+ * 1) at the moment this notification is being sent there is no application
+ * registered in application manager
+ * 2) hmi id is already used whenever this message is being constructed, so
+ * its already there
+ * @return True in any case
+ */
+ bool Init() FINAL;
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
new file mode 100644
index 0000000000..cac306f760
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAudioDataStreamingNotification command class
+ **/
+class OnAudioDataStreamingNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnAudioDataStreamingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAudioDataStreamingNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnAudioDataStreamingNotification class destructor
+ **/
+ virtual ~OnAudioDataStreamingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
new file mode 100644
index 0000000000..b83fe1bfe0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonEventNotification command class
+ **/
+class OnButtonEventNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonEventNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
new file mode 100644
index 0000000000..e996c9952c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonPressNotification command class
+ **/
+class OnButtonPressNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonPressNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h
new file mode 100644
index 0000000000..4ed60f9a07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonSubscriptionNotification command class
+ **/
+class OnButtonSubscriptionNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnButtonSubscriptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonSubscriptionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnButtonSubscriptionNotification class destructor
+ **/
+ virtual ~OnButtonSubscriptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonSubscriptionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
new file mode 100644
index 0000000000..99c165c12f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnDeviceChosenNotification command class
+ **/
+class OnDeviceChosenNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceChosenNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDeviceChosenNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnDeviceChosenNotification class destructor
+ **/
+ virtual ~OnDeviceChosenNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
new file mode 100644
index 0000000000..7701e2a601
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnDeviceStateChangedNotification command class
+ **/
+class OnDeviceStateChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceStateChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDeviceStateChangedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnDeviceStateChangedNotification class destructor
+ **/
+ virtual ~OnDeviceStateChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..51fb49c6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnDriverDistractionNotification command class
+ **/
+class OnDriverDistractionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDriverDistractionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
new file mode 100644
index 0000000000..cff0a0e617
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnEventChangedNotification command class
+ **/
+class OnEventChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnEventChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnEventChangedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnEventChangedNotification class destructor
+ **/
+ virtual ~OnEventChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
new file mode 100644
index 0000000000..116932d87a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnExitAllApplicationsNotification command class
+ **/
+class OnExitAllApplicationsNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitAllApplicationsNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnExitAllApplicationsNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnExitAllApplicationsNotification class destructor
+ **/
+ virtual ~OnExitAllApplicationsNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ private:
+ /**
+ * @brief Notify's HMI that SDL stored all data required for resumption
+ **/
+ void SendOnSDLPersistenceComplete();
+
+ DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
new file mode 100644
index 0000000000..11c397bfe7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnExitApplicationNotification command class
+ **/
+class OnExitApplicationNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitApplicationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnExitApplicationNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnExitApplicationNotification class destructor
+ **/
+ virtual ~OnExitApplicationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
new file mode 100644
index 0000000000..38c5dcf535
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnFileRemovedNotification command class
+ **/
+class OnFileRemovedNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnFileRemovedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnFileRemovedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnFileRemovedNotification class destructor
+ **/
+ virtual ~OnFileRemovedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
new file mode 100644
index 0000000000..672ded9dcf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnFindApplications command class
+ **/
+class OnFindApplications : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnFindApplications class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnFindApplications(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnFindApplications class destructor
+ **/
+ virtual ~OnFindApplications();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
new file mode 100644
index 0000000000..85b7ed356e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnIgnitionCycleOverNotification command class
+ **/
+class OnIgnitionCycleOverNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnIgnitionCycleOverNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnIgnitionCycleOverNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnIgnitionCycleOverNotification class destructor
+ **/
+ virtual ~OnIgnitionCycleOverNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
new file mode 100644
index 0000000000..075dc2cb5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnNaviTBTClientStateNotification command class
+ **/
+class OnNaviTBTClientStateNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnNaviTBTClientStateNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviTBTClientStateNotification class destructor
+ **/
+ virtual ~OnNaviTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
new file mode 100644
index 0000000000..3efde9c8c1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnNaviWayPointChangeNotification command class
+ **/
+class OnNaviWayPointChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviWayPointChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnNaviWayPointChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& app_man,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnNaviWayPointChangeNotification class destructor
+ **/
+ virtual ~OnNaviWayPointChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviWayPointChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
new file mode 100644
index 0000000000..331e352795
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class OnPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnPolicyUpdate class destructor
+ **/
+ virtual ~OnPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
+};
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
new file mode 100644
index 0000000000..503013ff58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnPutFileNotification command class
+ **/
+class OnPutFileNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnPutFileNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPutFileNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnPutFileNotification class destructor
+ **/
+ virtual ~OnPutFileNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
new file mode 100644
index 0000000000..c4adc20090
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnReadyNotification command class
+ **/
+class OnReadyNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReadyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnReadyNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnReadyNotification class destructor
+ **/
+ virtual ~OnReadyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
new file mode 100644
index 0000000000..c1e1b01a18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReceivedPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnReceivedPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnReceivedPolicyUpdate class destructor
+ **/
+ ~OnReceivedPolicyUpdate() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
new file mode 100644
index 0000000000..c5755a364c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnRecordStartdNotification command class
+ **/
+class OnRecordStartdNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnRecordStartdNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnRecordStartdNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnRecordStartdNotification class destructor
+ **/
+ virtual ~OnRecordStartdNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
new file mode 100644
index 0000000000..ef2b5a34eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnResumeAudioSourceNotification command class
+ **/
+class OnResumeAudioSourceNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnResumeAudioSourceNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnResumeAudioSourceNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnResumeAudioSourceNotification class destructor
+ **/
+ virtual ~OnResumeAudioSourceNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
new file mode 100644
index 0000000000..34fe41de81
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLCloseNotification command class
+ **/
+class OnSDLCloseNotification : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLCloseNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLCloseNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSdlCloseNotification class destructor
+ **/
+ virtual ~OnSDLCloseNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
new file mode 100644
index 0000000000..9fe736a595
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLConsentNeededNotification command class
+ **/
+class OnSDLConsentNeededNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLConsentNeededNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLConsentNeededNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSDLConsentNeededNotification class destructor
+ **/
+ virtual ~OnSDLConsentNeededNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
new file mode 100644
index 0000000000..96f63845e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSDLPersistenceCompleteNotification command class
+ **/
+class OnSDLPersistenceCompleteNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSDLPersistenceCompleteNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class destructor
+ **/
+ virtual ~OnSDLPersistenceCompleteNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
new file mode 100644
index 0000000000..da049b1dc4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnStartDeviceDiscovery command class
+ **/
+class OnStartDeviceDiscovery : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnStartDeviceDiscovery class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnStartDeviceDiscovery(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnStartDeviceDiscovery class destructor
+ **/
+ virtual ~OnStartDeviceDiscovery();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
new file mode 100644
index 0000000000..7c61fac041
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnGetStatusUpdateNotification command class
+ **/
+class OnStatusUpdateNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnGetStatusUpdateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnStatusUpdateNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnGetStatusUpdateNotification class destructor
+ **/
+ virtual ~OnStatusUpdateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
new file mode 100644
index 0000000000..d4c940bac7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile_api = mobile_apis;
+/**
+ * @brief OnSystemContextNotification command class
+ **/
+class OnSystemContextNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemContextNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemContextNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSystemContextNotification class destructor
+ **/
+ virtual ~OnSystemContextNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
new file mode 100644
index 0000000000..76325b078f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemErrorNotification command class
+ **/
+class OnSystemErrorNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemErrorNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemErrorNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSystemErrorNotification class destructor
+ **/
+ virtual ~OnSystemErrorNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
new file mode 100644
index 0000000000..1e4046b83b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemInfoChangedNotification command class
+ **/
+class OnSystemInfoChangedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemInfoChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemInfoChangedNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSystemInfoChangedNotification class destructor
+ **/
+ virtual ~OnSystemInfoChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
new file mode 100644
index 0000000000..1e1e1818b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnSystemRequestNotification command class
+ **/
+class OnSystemRequestNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemRequestNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
new file mode 100644
index 0000000000..0beba8dc6b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+/**
+ * @brief OnSystemTimeReadyNotification command class.
+ * Notifies SDL whenever system time module is ready.
+ * It could be GPS or any other module which is allows
+ * to obtain system time. Once SDL receive this notification
+ * it is allowed to use GetSystemTimeRequest to rerieve system time.
+ */
+class OnSystemTimeReadyNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemTimeReadyNotification create the command.
+ * @param message content of the command. Passed directy to base class.
+ */
+ OnSystemTimeReadyNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ~OnSystemTimeReadyNotification destroys the command object.
+ */
+ ~OnSystemTimeReadyNotification();
+
+ /**
+ * @brief Run creates SystemTimeReady event
+ * and notifies all the subscribers.
+ */
+ void Run() FINAL;
+};
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
new file mode 100644
index 0000000000..33c7d98b6f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSLanguageChangeNotification command class
+ **/
+class OnTTSLanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSLanguageChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnTTSLanguageChangeNotification class destructor
+ **/
+ virtual ~OnTTSLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h
new file mode 100644
index 0000000000..70050a667e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnTTSResetTimeoutNotification command class
+ **/
+class OnTTSResetTimeoutNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSResetTimeoutNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnTTSResetTimeoutNotification class destructor
+ **/
+ virtual ~OnTTSResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
new file mode 100644
index 0000000000..93dac3f292
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSStartedNotification command class
+ **/
+class OnTTSStartedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTTSStartedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnTTSStartedNotification class destructor
+ **/
+ virtual ~OnTTSStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
new file mode 100644
index 0000000000..362e96f4be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTTSStoppedNotification command class
+ **/
+class OnTTSStoppedNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject OnTTSStartedNotificationmessage
+ **/
+ OnTTSStoppedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnTTSStoppedNotification class destructor
+ **/
+ virtual ~OnTTSStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
new file mode 100644
index 0000000000..0cc4e9e772
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUICommandNotification command class
+ **/
+class OnUICommandNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUICommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUICommandNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUICommandNotification class destructor
+ **/
+ virtual ~OnUICommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
new file mode 100644
index 0000000000..c487894770
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIKeyBoardInputNotification command class
+ **/
+class OnUIKeyBoardInputNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUIKeyBoardInputNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUIKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnUIKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
new file mode 100644
index 0000000000..f30b8573aa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUILanguageChangeNotification command class
+ **/
+class OnUILanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUILanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUILanguageChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUILanguageChangeNotification class destructor
+ **/
+ virtual ~OnUILanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h
new file mode 100644
index 0000000000..bbdf4d04ef
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIResetTimeoutNotification command class
+ **/
+class OnUIResetTimeoutNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUIResetTimeoutNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUIResetTimeoutNotification class destructor
+ **/
+ virtual ~OnUIResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
new file mode 100644
index 0000000000..5c7dd0128b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUITouchEventNotification command class
+ **/
+class OnUITouchEventNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUITouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUITouchEventNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUITouchEventNotification class destructor
+ **/
+ virtual ~OnUITouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
new file mode 100644
index 0000000000..2942c36053
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnUpdateDeviceList command class
+ **/
+class OnUpdateDeviceList : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUpdateDeviceList class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnUpdateDeviceList(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnUpdateDeviceList class destructor
+ **/
+ virtual ~OnUpdateDeviceList();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
new file mode 100644
index 0000000000..ed0b1572ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIAccPedalPositionNotification command class
+ **/
+class OnVIAccPedalPositionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIAccPedalPositionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIAccPedalPositionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIAccPedalPositionNotification class destructor
+ **/
+ virtual ~OnVIAccPedalPositionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
new file mode 100644
index 0000000000..cc81160ccb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIBeltStatusNotification command class
+ **/
+class OnVIBeltStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBeltStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIBeltStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIBeltStatusNotification class destructor
+ **/
+ virtual ~OnVIBeltStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
new file mode 100644
index 0000000000..2b46b69f55
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIBodyInformationNotification command class
+ **/
+class OnVIBodyInformationNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBodyInformationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIBodyInformationNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIBodyInformationNotification class destructor
+ **/
+ virtual ~OnVIBodyInformationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
new file mode 100644
index 0000000000..05da9a775d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIDeviceStatusNotification command class
+ **/
+class OnVIDeviceStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDeviceStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIDeviceStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIDeviceStatusNotification class destructor
+ **/
+ virtual ~OnVIDeviceStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
new file mode 100644
index 0000000000..6640d7953a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIDriverBrakingNotification command class
+ **/
+class OnVIDriverBrakingNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDriverBrakingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIDriverBrakingNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIDriverBrakingNotification class destructor
+ **/
+ virtual ~OnVIDriverBrakingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
new file mode 100644
index 0000000000..f8c0526f8c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIEngineTorqueNotification command class
+ **/
+class OnVIEngineTorqueNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIEngineTorqueNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIEngineTorqueNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIEngineTorqueNotification class destructor
+ **/
+ virtual ~OnVIEngineTorqueNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
new file mode 100644
index 0000000000..900aecd845
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIExternalTemperatureNotification command class
+ **/
+class OnVIExternalTemperatureNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIExternalTemperatureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIExternalTemperatureNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIExternalTemperatureNotification class destructor
+ **/
+ virtual ~OnVIExternalTemperatureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
new file mode 100644
index 0000000000..7374de9ad9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelNotification command class
+ **/
+class OnVIFuelLevelNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIFuelLevelNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIFuelLevelNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
new file mode 100644
index 0000000000..a705fcbd04
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelStateNotification command class
+ **/
+class OnVIFuelLevelStateNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIFuelLevelStateNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIFuelLevelStateNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
new file mode 100644
index 0000000000..984e1e4c0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIGpsDataNotification command class
+ **/
+class OnVIGpsDataNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIGpsDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIGpsDataNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIGpsDataNotification class destructor
+ **/
+ virtual ~OnVIGpsDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
new file mode 100644
index 0000000000..1dfda8a9e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIHeadLampStatusNotification command class
+ **/
+class OnVIHeadLampStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIHeadLampStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIHeadLampStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIHeadLampStatusNotification class destructor
+ **/
+ virtual ~OnVIHeadLampStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
new file mode 100644
index 0000000000..fd8743907c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIInstantFuelConsumptionNotification command class
+ **/
+class OnVIInstantFuelConsumptionNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIInstantFuelConsumptionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class destructor
+ **/
+ virtual ~OnVIInstantFuelConsumptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
new file mode 100644
index 0000000000..25ace2821d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIMyKeyNotification command class
+ **/
+class OnVIMyKeyNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIMyKeyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIMyKeyNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIMyKeyNotification class destructor
+ **/
+ virtual ~OnVIMyKeyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
new file mode 100644
index 0000000000..ad141e733c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIOdometerNotification command class
+ **/
+class OnVIOdometerNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIOdometerNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIOdometerNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIOdometerNotification class destructor
+ **/
+ virtual ~OnVIOdometerNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
new file mode 100644
index 0000000000..95fb873957
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIPrndlNotification command class
+ **/
+class OnVIPrndlNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIPrndlNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIPrndlNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIPrndlNotification class destructor
+ **/
+ virtual ~OnVIPrndlNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
new file mode 100644
index 0000000000..d4b121a96f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIRpmNotification command class
+ **/
+class OnVIRpmNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIRpmNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIRpmNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIRpmNotification class destructor
+ **/
+ virtual ~OnVIRpmNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
new file mode 100644
index 0000000000..4afaafc9ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVISpeedNotification command class
+ **/
+class OnVISpeedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISpeedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVISpeedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVISpeedNotification class destructor
+ **/
+ virtual ~OnVISpeedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
new file mode 100644
index 0000000000..0d0aeadad8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVISteeringWheelAngleNotification command class
+ **/
+class OnVISteeringWheelAngleNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISteeringWheelAngleNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVISteeringWheelAngleNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVISteeringWheelAngleNotification class destructor
+ **/
+ virtual ~OnVISteeringWheelAngleNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
new file mode 100644
index 0000000000..c358ed37e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVITirePressureNotification command class
+ **/
+class OnVITirePressureNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVITirePressureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVITirePressureNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVITirePressureNotification class destructor
+ **/
+ virtual ~OnVITirePressureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
new file mode 100644
index 0000000000..75062a51e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIVinNotification command class
+ **/
+class OnVIVinNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVinNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIVinNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIVinNotification class destructor
+ **/
+ virtual ~OnVIVinNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
new file mode 100644
index 0000000000..de7a5dfc9e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIWiperStatusNotification command class
+ **/
+class OnVIWiperStatusNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIWiperStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIWiperStatusNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIWiperStatusNotification class destructor
+ **/
+ virtual ~OnVIWiperStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
new file mode 100644
index 0000000000..7a7cf3cd96
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVideoDataStreamingNotification command class
+ **/
+class OnVideoDataStreamingNotification
+ : public app_mngr::commands::NotificationToHMI {
+ public:
+ /**
+ * @brief OnVideoDataStreamingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVideoDataStreamingNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVideoDataStreamingNotification class destructor
+ **/
+ virtual ~OnVideoDataStreamingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
new file mode 100644
index 0000000000..3ef21fc568
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRCommandNotification command class
+ **/
+class OnVRCommandNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRCommandNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVRCommandNotification class destructor
+ **/
+ virtual ~OnVRCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
new file mode 100644
index 0000000000..e6bd39d46e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRLanguageChangeNotification command class
+ **/
+class OnVRLanguageChangeNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRLanguageChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVRLanguageChangeNotification class destructor
+ **/
+ virtual ~OnVRLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
new file mode 100644
index 0000000000..abca9db91d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRStartedNotification command class
+ **/
+class OnVRStartedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRStartedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVRStartedNotification class destructor
+ **/
+ virtual ~OnVRStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
new file mode 100644
index 0000000000..9b53214f8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVRStoppedNotification command class
+ **/
+class OnVRStoppedNotification : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVRStoppedNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVRStoppedNotification class destructor
+ **/
+ virtual ~OnVRStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
new file mode 100644
index 0000000000..8f94d4876a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesRequest command class
+ **/
+class RCGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief RCGetCapabilitiesRequest class destructor
+ **/
+ virtual ~RCGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
new file mode 100644
index 0000000000..dec31c9ea1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesResponse command class
+ **/
+class RCGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief RCGetCapabilitiesResponse class destructor
+ **/
+ virtual ~RCGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
new file mode 100644
index 0000000000..3ba614f823
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyRequest command class
+ **/
+class RCIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief RCIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief RCIsReadyRequest class destructor
+ **/
+ virtual ~RCIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
new file mode 100644
index 0000000000..93f30e795c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyResponse command class
+ **/
+class RCIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief RCIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief RCIsReadyResponse class destructor
+ **/
+ virtual ~RCIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
new file mode 100644
index 0000000000..e97312b881
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppRequest command class
+ **/
+class SDLActivateAppRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief Applications registered over protocol v4
+ */
+ typedef std::vector<application_manager::ApplicationSharedPtr> V4ProtoApps;
+
+ /**
+ * @brief SDLActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLActivateAppRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLActivateAppRequest class destructor
+ **/
+ ~SDLActivateAppRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief onTimeOut allows to process case when timeout has appeared
+ * during request execution.
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief on_event allows to handle events
+ *
+ * @param event event type that current request subscribed on.
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ uint32_t app_id() const;
+ uint32_t hmi_app_id(const smart_objects::SmartObject& so) const;
+
+ /**
+ * @brief Retrieves all v4 protocol applications for particular device
+ * @param handle Device handle
+ * @return List of applications registered over v4 protocol
+ */
+ V4ProtoApps get_v4_proto_apps(
+ const connection_handler::DeviceHandle handle) const;
+
+ /**
+ * @brief Get v4 protocol application reported as forgrounded on device
+ * @param handle Device
+ * @return Pointer to application or empty pointer
+ */
+ app_mngr::ApplicationSharedPtr get_foreground_app(
+ const connection_handler::DeviceHandle handle) const;
+
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
new file mode 100644
index 0000000000..7a3f5157da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppResponse command class
+ **/
+class SDLActivateAppResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLActivateAppResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLActivateAppResponse class destructor
+ **/
+ virtual ~SDLActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
new file mode 100644
index 0000000000..61426e0af3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsRequest command class
+ **/
+class SDLGetListOfPermissionsRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetListOfPermissionsRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetListOfPermissionsRequest class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
new file mode 100644
index 0000000000..e2556bac3d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsResponse command class
+ **/
+class SDLGetListOfPermissionsResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetListOfPermissionsResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetListOfPermissionsResponse class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
new file mode 100644
index 0000000000..b6376bacc6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateRequest command class
+ **/
+class SDLGetStatusUpdateRequest : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetStatusUpdateRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetStatusUpdateRequest class destructor
+ **/
+ virtual ~SDLGetStatusUpdateRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
new file mode 100644
index 0000000000..4e6da22370
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateResponse command class
+ **/
+class SDLGetStatusUpdateResponse : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetStatusUpdateResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetStatusUpdateResponse class destructor
+ **/
+ virtual ~SDLGetStatusUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
new file mode 100644
index 0000000000..75902e2733
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageRequest command class
+ **/
+class SDLGetUserFriendlyMessageRequest
+ : public app_mngr::commands::RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetUserFriendlyMessageRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
new file mode 100644
index 0000000000..a02d6894e3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageResponse command class
+ **/
+class SDLGetUserFriendlyMessageResponse
+ : public app_mngr::commands::ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLGetUserFriendlyMessageResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
new file mode 100644
index 0000000000..f164aed775
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ ~SDLPolicyUpdate() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
new file mode 100644
index 0000000000..63f33477b6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class SDLPolicyUpdateResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SDLPolicyUpdateResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief SDLPolicyUpdateResponse class destructor
+ **/
+ virtual ~SDLPolicyUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
new file mode 100644
index 0000000000..229ed92947
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistrationRequest command class
+ **/
+class TTSChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSChangeRegistrationRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSChangeRegistrationRequest class destructor
+ **/
+ virtual ~TTSChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
new file mode 100644
index 0000000000..8462178283
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistratioResponse command class
+ **/
+class TTSChangeRegistratioResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSChangeRegistratioResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSChangeRegistratioResponse class destructor
+ **/
+ virtual ~TTSChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
new file mode 100644
index 0000000000..df6cf3b4a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesRequest command class
+ **/
+class TTSGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetCapabilitiesRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetCapabilitiesRequest class destructor
+ **/
+ virtual ~TTSGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
new file mode 100644
index 0000000000..7919f213a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesResponse command class
+ **/
+class TTSGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetCapabilitiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetCapabilitiesResponse class destructor
+ **/
+ virtual ~TTSGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
new file mode 100644
index 0000000000..09345c02d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageRequest command class
+ **/
+class TTSGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetLanguageRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetLanguageRequest class destructor
+ **/
+ virtual ~TTSGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
new file mode 100644
index 0000000000..e52dbf1ada
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageResponse command class
+ **/
+class TTSGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetLanguageResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetLanguageResponse class destructor
+ **/
+ virtual ~TTSGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
new file mode 100644
index 0000000000..c42d0257d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesRequest command class
+ **/
+class TTSGetSupportedLanguagesRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetSupportedLanguagesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
new file mode 100644
index 0000000000..cc24db22b9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesResponse command class
+ **/
+class TTSGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSGetSupportedLanguagesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
new file mode 100644
index 0000000000..b7dffd5bde
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyRequest command class
+ **/
+class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief TTSIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief TTSIsReadyRequest class destructor
+ **/
+ virtual ~TTSIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
new file mode 100644
index 0000000000..268edd0eeb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyResponse command class
+ **/
+class TTSIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSIsReadyResponse class destructor
+ **/
+ virtual ~TTSIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
new file mode 100644
index 0000000000..f416b3a787
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesRequest command class
+ **/
+class TTSSetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSetGlobalPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
new file mode 100644
index 0000000000..ff5622296c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesResponse command class
+ **/
+class TTSSetGlobalPropertiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSetGlobalPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
new file mode 100644
index 0000000000..9e8915a440
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakRequest command class
+ **/
+class TTSSpeakRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSSpeakRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSpeakRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSSpeakRequest class destructor
+ **/
+ virtual ~TTSSpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
new file mode 100644
index 0000000000..e4b2c8adbd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakResponse command class
+ **/
+class TTSSpeakResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSpeakResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSSpeakResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSSpeakResponse class destructor
+ **/
+ virtual ~TTSSpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
new file mode 100644
index 0000000000..8eb6a66c95
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingRequest command class
+ **/
+class TTSStopSpeakingRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSStopSpeakingRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSStopSpeakingRequest class destructor
+ **/
+ virtual ~TTSStopSpeakingRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
new file mode 100644
index 0000000000..d433fe2280
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingResponse command class
+ **/
+class TTSStopSpeakingResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ TTSStopSpeakingResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSStopSpeakingResponse class destructor
+ **/
+ virtual ~TTSStopSpeakingResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
new file mode 100644
index 0000000000..e5d2483576
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandRequest command class
+ **/
+class UIAddCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAddCommandRequest class destructor
+ **/
+ virtual ~UIAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
new file mode 100644
index 0000000000..90a9666561
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandResponse command class
+ **/
+class UIAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAddCommandResponse class destructor
+ **/
+ virtual ~UIAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
new file mode 100644
index 0000000000..5de5e41cd6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIAddSubmenuRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddSubmenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAddSubmenuRequest class destructor
+ **/
+ virtual ~UIAddSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
new file mode 100644
index 0000000000..20f830be27
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuResponse command class
+ **/
+class UIAddSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAddSubmenuResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAddSubmenuResponse class destructor
+ **/
+ virtual ~UIAddSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
new file mode 100644
index 0000000000..6235a51c7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAlertRequest command class
+ **/
+class UIAlertRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIAlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAlertRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAlertRequest class destructor
+ **/
+ virtual ~UIAlertRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
new file mode 100644
index 0000000000..b43185af78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAlertResponse command class
+ **/
+class UIAlertResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIAlertResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIAlertResponse class destructor
+ **/
+ virtual ~UIAlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
new file mode 100644
index 0000000000..c504c55727
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistrationRequest command class
+ **/
+class UIChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIChangeRegistrationRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handlel);
+
+ /**
+ * @brief UIChangeRegistrationRequest class destructor
+ **/
+ virtual ~UIChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
new file mode 100644
index 0000000000..d7fca83d3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistratioResponse command class
+ **/
+class UIChangeRegistratioResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIChangeRegistratioResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIChangeRegistratioResponse class destructor
+ **/
+ virtual ~UIChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
new file mode 100644
index 0000000000..ecc0b44495
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandRequest command class
+ **/
+class UIDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIDeleteCommandRequest class destructor
+ **/
+ virtual ~UIDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
new file mode 100644
index 0000000000..f9601b7491
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandResponse command class
+ **/
+class UIDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIDeleteCommandResponse class destructor
+ **/
+ virtual ~UIDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
new file mode 100644
index 0000000000..3161c84b7c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIDeleteSubmenuRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteSubmenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIDeleteSubmenuRequest class destructor
+ **/
+ virtual ~UIDeleteSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
new file mode 100644
index 0000000000..7c73a53c3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIDeleteSubmenuResponse command class
+ **/
+class UIDeleteSubmenuResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIDeleteSubmenuResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIDeleteSubmenuResponse class destructor
+ **/
+ virtual ~UIDeleteSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..8d34e1852b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruRequest command class
+ * When this request is invoked, the audio capture stops
+ **/
+class UIEndAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIEndAudioPassThruRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIEndAudioPassThruRequest class destructor
+ **/
+ virtual ~UIEndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..b1c3bfd87a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruResponse command class
+ **/
+class UIEndAudioPassThruResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIEndAudioPassThruResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIEndAudioPassThruResponse class destructor
+ **/
+ virtual ~UIEndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
new file mode 100644
index 0000000000..47782cc7a9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesRequest command class
+ **/
+class UIGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetCapabilitiesRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetCapabilitiesRequest class destructor
+ **/
+ virtual ~UIGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
new file mode 100644
index 0000000000..421844560d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesResponse command class
+ **/
+class UIGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetCapabilitiesResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetCapabilitiesResponse class destructor
+ **/
+ virtual ~UIGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
new file mode 100644
index 0000000000..7c82584178
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageRequest command class
+ **/
+class UIGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetLanguageRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetLanguageRequest class destructor
+ **/
+ virtual ~UIGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
new file mode 100644
index 0000000000..7354e87ee4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageResponse command class
+ **/
+class UIGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetLanguageResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetLanguageResponse class destructor
+ **/
+ virtual ~UIGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
new file mode 100644
index 0000000000..7fd456b92b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesRequest command class
+ **/
+class UIGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetSupportedLanguagesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
new file mode 100644
index 0000000000..26d8e98892
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesResponse command class
+ **/
+class UIGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIGetSupportedLanguagesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
new file mode 100644
index 0000000000..2e7806cd2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyRequest command class
+ **/
+class UIIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief UIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIIsReadyRequest class destructor
+ **/
+ virtual ~UIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ virtual void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
new file mode 100644
index 0000000000..f2b4f201f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyResponse command class
+ **/
+class UIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIIsReadyResponse class destructor
+ **/
+ virtual ~UIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..6d4e870228
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruRequest command class
+ **/
+class UIPerformAudioPassThruRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformAudioPassThruRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIPerformAudioPassThruRequest class destructor
+ **/
+ virtual ~UIPerformAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..e36a292573
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruResponse command class
+ **/
+class UIPerformAudioPassThruResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformAudioPassThruResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIPerformAudioPassThruResponse class destructor
+ **/
+ virtual ~UIPerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
new file mode 100644
index 0000000000..ff4540de23
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionRequest command class
+ **/
+class UIPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformInteractionRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIPerformInteractionRequest class destructor
+ **/
+ virtual ~UIPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
new file mode 100644
index 0000000000..caf5716e18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionResponse command class
+ **/
+class UIPerformInteractionResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIPerformInteractionResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIPerformInteractionResponse class destructor
+ **/
+ virtual ~UIPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
new file mode 100644
index 0000000000..f5acf41c8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageRequest command class
+ **/
+class UIScrollableMessageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIScrollableMessageRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIScrollableMessageRequest class destructor
+ **/
+ virtual ~UIScrollableMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
new file mode 100644
index 0000000000..e46265c0e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageResponse command class
+ **/
+class UIScrollableMessageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIScrollableMessageResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIScrollableMessageResponse class destructor
+ **/
+ virtual ~UIScrollableMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
new file mode 100644
index 0000000000..4e260a99ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataRequest command class
+ **/
+class UISendHapticDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISendHapticDataRequest class destructor
+ **/
+ ~UISendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
new file mode 100644
index 0000000000..1bf38939be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataResponse command class
+ **/
+class UISendHapticDataResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISendHapticDataResponse class destructor
+ **/
+ ~UISendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
new file mode 100644
index 0000000000..ea526df135
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetIconRequest command class
+ **/
+class UISetAppIconRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetAppIconRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISetIconRequest class destructor
+ **/
+ virtual ~UISetAppIconRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetAppIconRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
new file mode 100644
index 0000000000..af2c4fafea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetIconResponse command class
+ **/
+class UISetAppIconResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetAppIconResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISetIconResponse class destructor
+ **/
+ virtual ~UISetAppIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetAppIconResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
new file mode 100644
index 0000000000..f60f7325fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutRequest command class
+ **/
+class UiSetDisplayLayoutRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UiSetDisplayLayoutRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UiSetDisplayLayoutRequest class destructor
+ **/
+ virtual ~UiSetDisplayLayoutRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
new file mode 100644
index 0000000000..ce404a4049
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutResponse command class
+ **/
+class UiSetDisplayLayoutResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UiSetDisplayLayoutResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UiSetDisplayLayoutResponse class destructor
+ **/
+ virtual ~UiSetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
new file mode 100644
index 0000000000..44e8bba450
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesRequest command class
+ **/
+class UISetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetGlobalPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UISetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
new file mode 100644
index 0000000000..a9c27a423b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesResponse command class
+ **/
+class UISetGlobalPropertiesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetGlobalPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~UISetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
new file mode 100644
index 0000000000..24f4d76d89
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerRequest command class
+ **/
+class UISetMediaClockTimerRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetMediaClockTimerRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISetMediaClockTimerRequest class destructor
+ **/
+ virtual ~UISetMediaClockTimerRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
new file mode 100644
index 0000000000..c664bd04f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerResponse command class
+ **/
+class UISetMediaClockTimerResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISetMediaClockTimerResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISetMediaClockTimerResponse class destructor
+ **/
+ virtual ~UISetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
new file mode 100644
index 0000000000..7ba950d530
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowRequest command class
+ **/
+class UIShowRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UIShowRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIShowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UIShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
new file mode 100644
index 0000000000..f9f7a61056
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UIShowResponse command class
+ **/
+class UIShowResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UIShowResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UIShowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UIShowResponse class destructor
+ **/
+ virtual ~UIShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
new file mode 100644
index 0000000000..3de1b4e775
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class UISliderRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UISliderRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISliderRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISliderRequest class destructor
+ **/
+ virtual ~UISliderRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
new file mode 100644
index 0000000000..17d1f8a8ed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UISliderResponse command class
+ **/
+class UISliderResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UISliderResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UISliderResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UISliderResponse class destructor
+ **/
+ virtual ~UISliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
new file mode 100644
index 0000000000..dc0166e33f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListRequest command class
+ **/
+class UpdateAppListRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UpdateAppListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateAppListRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateAppListRequest class destructor
+ **/
+ virtual ~UpdateAppListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
new file mode 100644
index 0000000000..2e3bb79233
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListResponse command class
+ **/
+class UpdateAppListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateAppListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateAppListResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateAppListResponse class destructor
+ **/
+ virtual ~UpdateAppListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
new file mode 100644
index 0000000000..c4c9f11e06
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListRequest command class
+ **/
+class UpdateDeviceListRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief UpdateDeviceListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateDeviceListRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateDeviceListRequest class destructor
+ **/
+ ~UpdateDeviceListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
+ * when HMI will be ready
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Need to stop execution StopMethod if HMI did not started
+ */
+ virtual bool CleanUp();
+
+ private:
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::ConditionalVariable termination_condition_;
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
new file mode 100644
index 0000000000..c33518a545
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListResponse command class
+ **/
+class UpdateDeviceListResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateDeviceListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateDeviceListResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateDeviceListResponse class destructor
+ **/
+ virtual ~UpdateDeviceListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
new file mode 100644
index 0000000000..e30b045fcb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLRequest command class
+ **/
+class UpdateSDLRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief UpdateSDLRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateSDLRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateSDLRequest class destructor
+ **/
+ virtual ~UpdateSDLRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
new file mode 100644
index 0000000000..f71921ea3a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLResponse command class
+ **/
+class UpdateSDLResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateSDLResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateSDLResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief UpdateSDLResponse class destructor
+ **/
+ virtual ~UpdateSDLResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
new file mode 100644
index 0000000000..0abb37adbc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandRequest command class
+ **/
+class VRAddCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRAddCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRAddCommandRequest class destructor
+ **/
+ virtual ~VRAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
new file mode 100644
index 0000000000..5f9c99a483
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandResponse command class
+ **/
+class VRAddCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRAddCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRAddCommandResponse class destructor
+ **/
+ virtual ~VRAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
new file mode 100644
index 0000000000..4af28cb542
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationRequest command class
+ **/
+class VRChangeRegistrationRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRChangeRegistrationRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRChangeRegistrationRequest class destructor
+ **/
+ virtual ~VRChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
new file mode 100644
index 0000000000..a80df0968b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationResponse command class
+ **/
+class VRChangeRegistrationResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRChangeRegistrationResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRChangeRegistrationResponse class destructor
+ **/
+ virtual ~VRChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
new file mode 100644
index 0000000000..0ed9521ec5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandRequest command class
+ **/
+class VRDeleteCommandRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRDeleteCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRDeleteCommandRequest class destructor
+ **/
+ virtual ~VRDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
new file mode 100644
index 0000000000..63efcab355
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandResponse command class
+ **/
+class VRDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRDeleteCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRDeleteCommandResponse class destructor
+ **/
+ virtual ~VRDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
new file mode 100644
index 0000000000..f8ac83af58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesRequest command class
+ **/
+class VRGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetCapabilitiesRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetCapabilitiesRequest class destructor
+ **/
+ virtual ~VRGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
new file mode 100644
index 0000000000..9c9bb55b1b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesResponse command class
+ **/
+class VRGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetCapabilitiesResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetCapabilitiesResponse class destructor
+ **/
+ virtual ~VRGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
new file mode 100644
index 0000000000..e764cbef91
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageRequest command class
+ **/
+class VRGetLanguageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetLanguageRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetLanguageRequest class destructor
+ **/
+ virtual ~VRGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
new file mode 100644
index 0000000000..470fe3ebdc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageResponse command class
+ **/
+class VRGetLanguageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetLanguageResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetLanguageResponse class destructor
+ **/
+ virtual ~VRGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
new file mode 100644
index 0000000000..8d9e9e2a61
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesRequest command class
+ **/
+class VRGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetSupportedLanguagesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
new file mode 100644
index 0000000000..735844cd99
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesResponse command class
+ **/
+class VRGetSupportedLanguagesResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRGetSupportedLanguagesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
new file mode 100644
index 0000000000..0b580f6c1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyRequest command class
+ **/
+class VRIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief VRIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRIsReadyRequest class destructor
+ **/
+ virtual ~VRIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
new file mode 100644
index 0000000000..42c47f5077
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyResponse command class
+ **/
+class VRIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VRIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRIsReadyResponse class destructor
+ **/
+ virtual ~VRIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
new file mode 100644
index 0000000000..6f206c010f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VRPerformInteractionRequest command class
+ **/
+class VRPerformInteractionRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VRPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRPerformInteractionRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VRPerformInteractionRequest class destructor
+ **/
+ virtual ~VRPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
new file mode 100644
index 0000000000..9e8599419f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief TTSPerformInteractionResponse command class
+ **/
+class VRPerformInteractionResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VRPerformInteractionResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief TTSPerformInteractionResponse class destructor
+ **/
+ virtual ~VRPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
new file mode 100644
index 0000000000..745fb3ec18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h
@@ -0,0 +1,169 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddCommandRequest command class
+ **/
+class AddCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AddCommandRequest class destructor
+ **/
+ ~AddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ void onTimeOut() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if command name doesn't exist in application
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandName(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command VR synonyms doesn't exist in application commands
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandVRSynonym(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command parent ID exists in submenu map
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandParentId(app_mngr::ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Removes command from list when HMI sends negative response or
+ * HMI does not answer on addCommand request.
+ */
+ void RemoveCommand();
+
+ DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks add command param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if add command contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ inline bool BothSend() const;
+
+ /**
+ * @brief GenerateMobileResponseInfo generated info for mobile response
+ * depends from UI and VR responses
+ * @return info for mobile response
+ */
+ const std::string GenerateMobileResponseInfo();
+ bool send_ui_;
+ bool send_vr_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ std::string ui_info_;
+ std::string vr_info_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
new file mode 100644
index 0000000000..fb3f172b0b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddCommandResponse command class
+ **/
+class AddCommandResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AddCommandResponse class destructor
+ **/
+ virtual ~AddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
new file mode 100644
index 0000000000..37ba9a5990
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuRequest command class
+ **/
+class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AddSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddSubMenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AddSubMenuRequest class destructor
+ **/
+ ~AddSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if submenu name is valid
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckSubMenuName();
+
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
new file mode 100644
index 0000000000..253556f899
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuResponse command class
+ **/
+class AddSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AddSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AddSubMenuResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AddSubMenuResponse class destructor
+ **/
+ virtual ~AddSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
new file mode 100644
index 0000000000..93f716cb65
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h
@@ -0,0 +1,110 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverRequest command class
+ **/
+class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertManeuverRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AlertManeuverRequest class destructor
+ **/
+ virtual ~AlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Prepare parameters for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param return_info contains resulting info for sending to mobile
+ * application
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& return_info);
+ /**
+ * @brief Checks alert maneuver params(ttsChunks, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if alert maneuver contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ hmi_apis::Common_Result::eType tts_speak_result_code_;
+ hmi_apis::Common_Result::eType navi_alert_maneuver_result_code_;
+ std::string info_navi_;
+ std::string info_tts_;
+ app_mngr::commands::Pending pending_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
new file mode 100644
index 0000000000..8b21aa64eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverResponse command class
+ **/
+class AlertManeuverResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertManeuverResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AlertManeuverResponse class destructor
+ **/
+ virtual ~AlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
new file mode 100644
index 0000000000..e34653daf4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h
@@ -0,0 +1,154 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertRequest command class
+ **/
+class AlertRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AlertRequest class destructor
+ **/
+ virtual ~AlertRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ protected:
+ private:
+ /*
+ * @brief Checks if request parameters are valid
+ * @param app_id Id of application requested this RPC
+ * @returns true if request is valid and should be processed
+ */
+ bool Validate(uint32_t app_id);
+ /*
+ * @brief Sends UI Alert request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendAlertRequest(int32_t app_id);
+
+ /*
+ * @brief Sends TTS Speak request
+ *
+ * @param app_id Id of application requested this RPC
+ *
+ * @param tts_chunks_exists if tts chunks exists in
+ * message contains true, otherwise contains false
+ *
+ * @param length_tts_chunks contains length of array
+ * tts chunks.
+ */
+ void SendSpeakRequest(int32_t app_id,
+ bool tts_chunks_exists,
+ size_t length_tts_chunks);
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool HasHmiResponsesToWait();
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfAlertRequest();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool awaiting_ui_alert_response_;
+ bool awaiting_tts_speak_response_;
+ bool awaiting_tts_stop_speaking_response_;
+ bool is_alert_succeeded_;
+ bool is_ui_alert_sent_;
+ hmi_apis::Common_Result::eType alert_result_;
+ smart_objects::SmartObject alert_response_params_;
+ hmi_apis::Common_Result::eType tts_speak_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
new file mode 100644
index 0000000000..4ae95fb979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief AlertResponse command class
+ **/
+class AlertResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ AlertResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief AlertResponse class destructor
+ **/
+ virtual ~AlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
new file mode 100644
index 0000000000..bd5c34ebd1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h
@@ -0,0 +1,191 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+
+#include <strings.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "utils/macro.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+/**
+ * @brief ChangeRegistrationRequest command class
+ **/
+class ChangeRegistrationRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ChangeRegistrationRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ChangeRegistrationRequest class destructor
+ **/
+ virtual ~ChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Search for requested language in HMI UI supported languages
+ *
+ * @return true if language supported by UI, otherwise false
+ */
+ bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI VR supported languages
+ *
+ * @return true if language supported by VR, otherwise false
+ */
+ bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI TTS supported languages
+ *
+ * @return true if language supported by TTS, otherwise false
+ */
+ bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks change_registration params(ttsName, appname,
+ * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
+ *
+ * @return true if command contains \t\n \\t \\n of whitespace otherwise
+ * returns false.
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Check parameters (name, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /**
+ * @brief Checks if requested name is allowed by policy
+ * @param app_name Application name
+ * @return true, if allowed, otherwise - false
+ */
+ bool IsNicknameAllowed(const custom_str::CustomString& app_name) const;
+
+ /**
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param response_info contains info for sending to mobile application
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& ResponseInfo);
+
+ /**
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ CoincidencePredicateVR(const custom_str::CustomString& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(const smart_objects::SmartObject& obj) const {
+ const custom_str::CustomString& vr_synonym = obj.asCustomString();
+ return newItem_.CompareIgnoreCase(vr_synonym);
+ };
+
+ const custom_str::CustomString& newItem_;
+ };
+
+ app_mngr::commands::Pending pending_requests_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string vr_response_info_;
+ std::string tts_response_info_;
+
+ void SendVRRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendTTSRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendUIRequest(app_mngr::ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language);
+
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
new file mode 100644
index 0000000000..4cb8c394c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationResponse command class
+ **/
+class ChangeRegistrationResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ChangeRegistrationResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ChangeRegistrationResponse class destructor
+ **/
+ virtual ~ChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
new file mode 100644
index 0000000000..1ad1c07b2a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
@@ -0,0 +1,278 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#include <map>
+#include <string>
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetRequest command class
+ **/
+class CreateInteractionChoiceSetRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CreateInteractionChoiceSetRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief CreateInteractionChoiceSetRequest class destructor
+ **/
+ ~CreateInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ void onTimeOut() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief DeleteChoices allows to walk through the sent commands collection
+ * in order to sent appropriate DeleteCommand request.
+ */
+ void DeleteChoices();
+
+ /**
+ * @brief Calls after all responses from HMI were received.
+ * Terminates request and sends successful response to mobile
+ * if all responses were SUCCESS or calls DeleteChoices in other case.
+ */
+ void OnAllHMIResponsesReceived();
+
+ /**
+ * @brief The VRCommand struct
+ * Collect minimum information about sent VR commands, for correctly
+ * processing deleting sent commands if error from HMI received
+ */
+ struct VRCommandInfo {
+ VRCommandInfo() : cmd_id_(0), succesful_response_received_(false) {}
+ VRCommandInfo(uint32_t cmd_id)
+ : cmd_id_(cmd_id), succesful_response_received_(false) {}
+ uint32_t cmd_id_;
+ bool succesful_response_received_;
+ };
+
+ typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap;
+ SentCommandsMap sent_commands_map_;
+
+ int32_t choice_set_id_;
+ size_t expected_chs_count_;
+ size_t received_chs_count_;
+ bool should_send_warnings_;
+
+ /**
+ * @brief Flag for stop sending VR commands to HMI, in case one of responses
+ * failed
+ */
+ volatile bool error_from_hmi_;
+ sync_primitives::Lock error_from_hmi_lock_;
+
+ /**
+ * @brief Flag shows if request already was expired by timeout
+ */
+ volatile bool is_timed_out_;
+ sync_primitives::Lock is_timed_out_lock_;
+
+ sync_primitives::RecursiveLock vr_commands_lock_;
+ /*
+ * @brief Sends VR AddCommand request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRAddCommandRequests(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks incoming choiseSet params.
+ * @param app Registred mobile application
+ *
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType CheckChoiceSet(
+ app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare choice ID
+ *param
+ *
+ * return TRUE if there is coincidence of choice ID, otherwise FALSE
+ */
+ struct CoincidencePredicateChoiceID {
+ CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[app_mngr::strings::choice_id].asUInt() == newItem_;
+ }
+
+ const uint32_t newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare menu name
+ *param
+ *
+ * return TRUE if there is coincidence of menu name, otherwise FALSE
+ */
+ struct CoincidencePredicateMenuName {
+ CoincidencePredicateMenuName(const std::string& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[app_mngr::strings::menu_name].asString() == newItem_;
+ }
+
+ const std::string& newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare VR commands
+ *param
+ *
+ * return TRUE if there is coincidence of VR commands, otherwise FALSE
+ */
+ struct CoincidencePredicateVRCommands {
+ CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return compareStr(obj, newItem_);
+ }
+
+ const smart_objects::SmartObject& newItem_;
+ };
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param choice1 Choice to compare
+ * @param choice2 Choice to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool compareSynonyms(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice2);
+
+ /*
+ * @brief Checks VR synonyms ignoring differences in case.
+ *
+ * @param str1 VR synonym to compare
+ * @param str2 VR synonym to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ static bool compareStr(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2);
+
+ /**
+ * @brief Checks choice set params(menuName, tertiaryText, ...)
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @param choice_set which must check
+ * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
+
+ /**
+ * @brief ProcessHmiError process received error from HMI.
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param vr_result ERROR type
+ */
+ void ProcessHmiError(const hmi_apis::Common_Result::eType vr_result);
+
+ /**
+ * @brief ProcessSuccesfulHMIResponse process succesful response from HMI\
+ * This function id not thread safe. It should be protected with
+ * vr_commands_lock_
+ * @param corr_id correlation id of received response
+ * @return true if resuest with corr_itd was sent on HMI, false otherwise
+ */
+ bool ProcessSuccesfulHMIResponse(const uint32_t corr_id);
+
+ /**
+ * @brief CountReceivedVRResponses counts received HMI responses. Updated
+ * request timeout if not all responses received
+ * Send response to mobile if all responses received.
+ */
+ void CountReceivedVRResponses();
+
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
new file mode 100644
index 0000000000..76718bc2c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetResponse command class
+ **/
+class CreateInteractionChoiceSetResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ CreateInteractionChoiceSetResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief CreateInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
new file mode 100644
index 0000000000..a21b1928d0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h
@@ -0,0 +1,119 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandRequest command class
+ **/
+class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteCommandRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteCommandRequest class destructor
+ **/
+ ~DeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for mobile app.
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool is_ui_send_;
+ bool is_vr_send_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ std::string ui_info_;
+ std::string vr_info_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
new file mode 100644
index 0000000000..f81f119792
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandResponse command class
+ **/
+class DeleteCommandResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteCommandResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteCommandResponse class destructor
+ **/
+ virtual ~DeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
new file mode 100644
index 0000000000..02cd0086b6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h
@@ -0,0 +1,83 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+struct AppFile;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileRequest command class
+ **/
+class DeleteFileRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteFileRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteFileRequest class destructor
+ **/
+ virtual ~DeleteFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
+
+ void SendFileRemovedNotification(
+ const application_manager::AppFile* file) const;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
new file mode 100644
index 0000000000..fbdc70c9bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileResponse command class
+ **/
+class DeleteFileResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteFileResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteFileResponse class destructor
+ **/
+ virtual ~DeleteFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
new file mode 100644
index 0000000000..4dec11a67b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h
@@ -0,0 +1,95 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetRequest command class
+ **/
+class DeleteInteractionChoiceSetRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteInteractionChoiceSetRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class destructor
+ **/
+ ~DeleteInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Check if requested choice set ID in use by perform interaction
+ *
+ * @param app mobile application
+ */
+ bool ChoiceSetInUse(app_mngr::ApplicationConstSharedPtr app);
+
+ void SendVrDeleteCommand(app_mngr::ApplicationSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
new file mode 100644
index 0000000000..0fce16ea9f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetResponse command class
+ **/
+class DeleteInteractionChoiceSetResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteInteractionChoiceSetResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
new file mode 100644
index 0000000000..c947fda78a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h
@@ -0,0 +1,109 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DeleteSubMenuRequest command class
+ **/
+class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteSubMenuRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteSubMenuRequest class destructor
+ **/
+ ~DeleteSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Deletes VR commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuVRCommands(app_mngr::ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Deletes UI commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuUICommands(app_mngr::ApplicationSharedPtr const app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
new file mode 100644
index 0000000000..e5b0c58a34
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class DeleteSubMenuResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DeleteSubMenuResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DeleteSubMenuResponse class destructor
+ **/
+ virtual ~DeleteSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
new file mode 100644
index 0000000000..3e313602c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h
@@ -0,0 +1,95 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DialNumber request command class
+ **/
+class DialNumberRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief DialNumberRequest class constructor
+ **/
+ DialNumberRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief DialNumberRequest class destructor
+ **/
+ ~DialNumberRequest() OVERRIDE;
+
+ /**
+ * @brief Initialize request params
+ **/
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Removes from number param all characters
+ * except the + character and digits.
+ *
+ */
+ void StripNumberParam(std::string& number);
+
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
new file mode 100644
index 0000000000..6181231458
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DialNumberResponse command class
+ **/
+class DialNumberResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DialNumberResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DialNumberResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DialNumberResponse class destructor
+ **/
+ virtual ~DialNumberResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..319a20958e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruRequest command class
+ **/
+class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ EndAudioPassThruRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief EndAudioPassThruRequest class destructor
+ **/
+ virtual ~EndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..e2a667f272
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruResponse command class
+ **/
+class EndAudioPassThruResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ EndAudioPassThruResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief EndAudioPassThruResponse class destructor
+ **/
+ virtual ~EndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
new file mode 100644
index 0000000000..b780daaf03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class GenericResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief GenericResponse class constructor
+ **/
+ GenericResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manage,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manage,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief GenericResponse class destructor
+ **/
+ virtual ~GenericResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GenericResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
new file mode 100644
index 0000000000..b8da061870
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h
@@ -0,0 +1,67 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetSystemCapabilityRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ GetSystemCapabilityRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ virtual ~GetSystemCapabilityRequest();
+
+ virtual void Run() OVERRIDE;
+
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
+
+}; // GetSystemCapabilityRequest
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
new file mode 100644
index 0000000000..9fa954c89f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class GetSystemCapabilityResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ GetSystemCapabilityResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ virtual ~GetSystemCapabilityResponse();
+
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse);
+
+}; // GetSystemCapabilityResponse
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
new file mode 100644
index 0000000000..7197874475
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetWayPointsRequest command class
+ **/
+class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief GetWayPointsRequest class constructor
+ **/
+ GetWayPointsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief GetWayPointsRequest class destructor
+ **/
+ virtual ~GetWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
new file mode 100644
index 0000000000..bb480a7ac0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetWayPointsResponse command class
+ **/
+class GetWayPointsResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief GetWayPointsResponse class constructor
+ **/
+ GetWayPointsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief GetWayPointsResponse class destructor
+ **/
+ virtual ~GetWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
new file mode 100644
index 0000000000..53d75819f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ListFilesRequest command class
+ **/
+class ListFilesRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ListFilesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ListFilesRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ListFilesRequest class destructor
+ **/
+ virtual ~ListFilesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
new file mode 100644
index 0000000000..1b3cdf1b02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ListFilesResponse command class
+ **/
+class ListFilesResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ListFilesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ListFilesResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ListFilesResponse class destructor
+ **/
+ virtual ~ListFilesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
new file mode 100644
index 0000000000..ba01d4bb28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAppInterfaceUnregisteredNotification class
+ **/
+class OnAppInterfaceUnregisteredNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAppInterfaceUnregisteredNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppInterfaceUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
new file mode 100644
index 0000000000..e3410bd873
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnAudioPassThruNotification class used to send notification with
+ *binary data written from
+ * microphone to mobile device while PerformAudioPassThru is active.
+ **/
+class OnAudioPassThruNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAudioPassThruNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnAudioPassThruNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnAudioPassThruNotification class destructor
+ **/
+ virtual ~OnAudioPassThruNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
new file mode 100644
index 0000000000..6afdc0e1cf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h
@@ -0,0 +1,92 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonEventNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonEventNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonEventNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnButtonEventNotification class destructor
+ **/
+ virtual ~OnButtonEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button event notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonEvent(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
new file mode 100644
index 0000000000..fe9bc449be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h
@@ -0,0 +1,91 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonPressNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonPressNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnButtonPressNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnButtonEventCommand class destructor
+ **/
+ virtual ~OnButtonPressNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button press notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonPress(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
new file mode 100644
index 0000000000..367b280e73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief OnCommandNotification class is used to send notification
+ * to mobile device.
+ **/
+class OnCommandNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnCommandNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnCommandNotification class destructor
+ **/
+ virtual ~OnCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..82e6097d84
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h
@@ -0,0 +1,84 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnDriverDistractionNotification class
+ **/
+class OnDriverDistractionNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnDriverDistractionNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
new file mode 100644
index 0000000000..76c9cf34c5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+namespace mobile {
+
+/**
+ * @brief OnHashChangeNotification class
+ **/
+class OnHashChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHashChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHashChangeNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnHashChangeNotification class destructor
+ **/
+ virtual ~OnHashChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
new file mode 100644
index 0000000000..0e1919676b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotification class
+ **/
+class OnHMIStatusNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHMIStatusNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnHMIStatusNotification class destructor
+ **/
+ virtual ~OnHMIStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
new file mode 100644
index 0000000000..12e3b54be9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+
+#include "application_manager/commands/command_notification_from_mobile_impl.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotificationFromMobile class
+ **/
+class OnHMIStatusNotificationFromMobile
+ : public app_mngr::commands::CommandNotificationFromMobileImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotificationFromMobile class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnHMIStatusNotificationFromMobile(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnHMIStatusNotificationFromMobile class destructor
+ **/
+ virtual ~OnHMIStatusNotificationFromMobile();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
new file mode 100644
index 0000000000..d34815ff2f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h
@@ -0,0 +1,83 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnKeyBoardInputNotification class
+ **/
+class OnKeyBoardInputNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnKeyBoardInputNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
new file mode 100644
index 0000000000..b234b93796
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnLanguageChangeNotification class
+ **/
+class OnLanguageChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnLanguageChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnLanguageChangeNotification class destructor
+ **/
+ virtual ~OnLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
new file mode 100644
index 0000000000..f586a0d36c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnPermissionsChangeNotification class
+ **/
+class OnPermissionsChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnPermissionsChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnPermissionsChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnPermissionsChangeNotification class destructor
+ **/
+ virtual ~OnPermissionsChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
new file mode 100644
index 0000000000..b369ad38f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h
@@ -0,0 +1,93 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "policy/policy_table/enums.h"
+#include <vector>
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnSystemRequestNotification class
+ **/
+class OnSystemRequestNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ typedef std::vector<uint8_t> BinaryMessage;
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnSystemRequestNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ ~OnSystemRequestNotification() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+#ifdef PROPRIETARY_MODE
+ /**
+ * @brief Adds HTTP header to message
+ * @param message Message
+ */
+ void AddHeader(BinaryMessage& message) const;
+ size_t ParsePTString(std::string& pt_string) const;
+#endif // PROPRIETARY_MODE
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
new file mode 100644
index 0000000000..39b12fea15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnTBTClientStateNotification class
+ **/
+class OnTBTClientStateNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTBTClientStateNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnTBTClientStateNotification class destructor
+ **/
+ virtual ~OnTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
new file mode 100644
index 0000000000..858759b793
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnTouchEventNotification class
+ **/
+class OnTouchEventNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnTouchEventNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnTouchEventNotification class destructor
+ **/
+ virtual ~OnTouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
new file mode 100644
index 0000000000..c379fceb02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class OnWayPointChangeNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnWayPointChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnWayPointChangeNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnWayPointChangeNotification class destructor
+ **/
+ virtual ~OnWayPointChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..1a4c248a02
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
@@ -0,0 +1,189 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruRequest command class
+ **/
+class PerformAudioPassThruRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAudioPassThruRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PerformAudioPassThruRequest class destructor
+ **/
+ virtual ~PerformAudioPassThruRequest();
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Prepare result code, result and info for sending to mobile
+ * @brief Response params
+ * success for sending to mobile application
+ * result code for sending to mobile application
+ * info for sending to mobile application
+ */
+ struct ResponseParams {
+ bool success;
+ mobile_apis::Result::eType result_code;
+ std::string info;
+ ResponseParams()
+ : success(false), result_code(mobile_apis::Result::INVALID_ENUM) {}
+ };
+
+ ResponseParams response_params_;
+
+ /**
+ * @brief Prepare result code, 'success' result and info for sending
+ * to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @return result for sending to mobile application.
+ */
+ const ResponseParams& PrepareResponseParameters();
+
+ /**
+ * @brief Sends TTS Speak request
+ */
+ void SendSpeakRequest();
+
+ /**
+ * @brief Sends UI PerformAudioPassThru request
+ */
+ void SendPerformAudioPassThruRequest();
+
+ /**
+ * @brief Sends UI RecordStart notification after TTS Speak response received.
+ * Indicates that capturing mic data should be started
+ */
+ void SendRecordStartNotification();
+
+ /**
+ * @brief Starts microphone recording
+ */
+ void StartMicrophoneRecording();
+
+ /**
+ * @brief Checks perform audio pass thru params(initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
+ * TTS_StopSpeaking to HMI
+ */
+ void FinishTTSSpeak();
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool IsWaitingHMIResponse();
+
+ /**
+ * @brief Pair of result_code and success for mobile app
+ */
+ typedef std::pair<mobile_apis::Result::eType, bool> AudioPassThruResults;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app in
+ * audioPassThru communication.
+ * @param ui_response contains result_code from UI
+ * @param tts_response contains result_code from TTS
+ * @return pair of result code (UI error code has precedence than TTS's,
+ * error_code from TTS is turned to WARNINGS) and
+ * result for mobile app
+ */
+ AudioPassThruResults PrepareAudioPassThruResultCodeForResponse(
+ const app_mngr::commands::ResponseInfo& ui_response,
+ const app_mngr::commands::ResponseInfo& tts_response);
+
+ hmi_apis::Common_Result::eType result_tts_speak_;
+ hmi_apis::Common_Result::eType result_ui_;
+ std::string ui_info_;
+ std::string tts_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..6654762067
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruResponse command class
+ **/
+class PerformAudioPassThruResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformAudioPassThruResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PerformAudioPassThruResponse class destructor
+ **/
+ virtual ~PerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
new file mode 100644
index 0000000000..2d4cbc9afc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
@@ -0,0 +1,251 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
+
+#include <string>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionRequest command class
+ **/
+class PerformInteractionRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformInteractionRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PerformInteractionRequest class destructor
+ **/
+ virtual ~PerformInteractionRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ private:
+ /**
+ * @brief Function will be called when VR_OnCommand event
+ * comes
+ * @param message which should send to mobile side
+ * @return true if send response to mobile application otherwise
+ * return false.
+ */
+ bool ProcessVRResponse(const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params);
+
+ /**
+ * @brief Sends PerformInteraction response to mobile side
+ * @param message which should send to mobile side
+ */
+ void ProcessUIResponse(const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params);
+
+ /*
+ * @brief Sends UI PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendUIPerformInteractionRequest(
+ app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends TTS PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRPerformInteractionRequest(
+ app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends UI Show VR help request to HMI
+ *
+ * @param app_id Application ID
+ */
+ void SendUIShowVRHelpRequest(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar menu names.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar menu names in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetMenuNames(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetVRSynonyms(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if request with non-sequential positions of vrHelpItems
+ * SDLAQ-CRS-466
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE if vrHelpItems positions are sequential,
+ * otherwise FALSE
+ */
+ bool CheckVrHelpItemPositions(app_mngr::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Disable PerformInteraction state in application and
+ * delete VR commands from HMI
+ */
+ void DisablePerformInteraction();
+
+ /**
+ * @brief Checks perform interaction params(initialText, initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform interaction contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Send HMI close PopUp and call DisablePerformInteraction
+ */
+ void TerminatePerformInteraction();
+
+ /**
+ * @brief Checks parameter ChoiceID from response.
+ * @param app contains pointer to application
+ * @param choice_id contains ChoiceID from response.
+ * @return if ChoiceID from response is correct method returns TRUE
+ * otherwise returns FALSE.
+ */
+ bool CheckChoiceIDFromResponse(app_mngr::ApplicationSharedPtr app,
+ int32_t choice_id);
+
+ /**
+ * @brief Checks for a match of choice ID, in
+ * choice sets.
+ * @param app contains pointer to application.
+ * @param choice_set_id_list_length contains amount
+ * of choice set ids.
+ * @param choice_set_id_list array of choice set ids
+ * @return If request contains several choice sets with
+ * same choice id returns false, otherwise returns
+ * true.
+ */
+ bool CheckChoiceIDFromRequest(
+ app_mngr::ApplicationSharedPtr app,
+ const size_t choice_set_id_list_length,
+ const smart_objects::SmartObject& choice_set_id_list) const;
+
+ /**
+ * @brief Checks each choice in each set for having a VRcommands parameter
+ * @param app contains pointer to application.
+ * @return returns false if request has choice sets with no vrCommands
+ */
+ bool CheckChoiceSetListVRCommands(app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief Tells if there are sent requests without responses
+ * @return If there is request without response method returns TRUE
+ * otherwise returns FALSE
+ */
+ const bool HasHMIResponsesToWait() const;
+
+ /**
+ * @brief Check UI & VR result codes, send response to mobile
+ * @param msg_param Message params to send
+ */
+ void SendBothModeResponse(const smart_objects::SmartObject& msg_param);
+
+ mobile_apis::InteractionMode::eType interaction_mode_;
+ bool ui_response_received_;
+ bool vr_response_received_;
+ bool app_pi_was_active_before_;
+ static uint32_t pi_requests_count_;
+ hmi_apis::Common_Result::eType vr_result_code_;
+ hmi_apis::Common_Result::eType ui_result_code_;
+ std::string ui_info_;
+ std::string vr_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
new file mode 100644
index 0000000000..6bb9135dcc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionResponse command class
+ **/
+class PerformInteractionResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PerformInteractionResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PerformInteractionResponse class destructor
+ **/
+ virtual ~PerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
new file mode 100644
index 0000000000..2783280f87
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h
@@ -0,0 +1,86 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PutFileRequest command class
+ **/
+class PutFileRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief PutFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PutFileRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PutFileRequest class destructor
+ **/
+ virtual ~PutFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ uint64_t offset_;
+ std::string sync_file_name_;
+ int64_t length_;
+ mobile_apis::FileType::eType file_type_;
+ bool is_persistent_file_;
+
+ void SendOnPutFileNotification();
+ DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
new file mode 100644
index 0000000000..22dbf1b5d5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief PutFileResponse command class
+ **/
+class PutFileResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief PutFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ PutFileResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief PutFileResponse class destructor
+ **/
+ virtual ~PutFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
new file mode 100644
index 0000000000..542fdac5f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
@@ -0,0 +1,224 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "utils/macro.h"
+#include "utils/custom_string.h"
+
+namespace policy {
+struct DeviceInfo;
+}
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class Application;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceRequest class constructor
+ **/
+ RegisterAppInterfaceRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief RegisterAppInterfaceRequest class destructor
+ **/
+ virtual ~RegisterAppInterfaceRequest();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /**
+ * @brief The AppicationType enum defines whether application is newly
+ * registered or existing and being switched over another transport
+ */
+ enum class ApplicationType {
+ kNewApplication,
+ kSwitchedApplicationHashOk,
+ kSwitchedApplicationWrongHashId
+ };
+
+ /**
+ * @brief Prepares and sends RegisterAppInterface response to mobile
+ * considering application type
+ * @param app_type Type of application
+ **/
+ void SendRegisterAppInterfaceResponseToMobile(ApplicationType app_type);
+
+ smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
+ const uint32_t connection_key, app_mngr::ApplicationSharedPtr app);
+
+ /**
+ * @brief SendChangeRegistration send ChangeRegistration on HMI
+ * @param function_id interface specific ChangeRegistration
+ * @param language language of registration
+ * @param app_id application to change registration
+ */
+ void SendChangeRegistration(const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id);
+
+ /**
+ * @brief SendChangeRegistrationOnHMI send required SendChangeRegistration
+ * HMI
+ * @param app application to change registration
+ */
+ void SendChangeRegistrationOnHMI(app_mngr::ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Sends OnAppRegistered notification to HMI
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ void SendOnAppRegisteredNotificationToHMI(
+ const app_mngr::Application& application_impl,
+ bool resumption = false,
+ bool need_restore_vr = false);
+ /*
+ * @brief Check new ID along with known mobile application ID
+ *
+ * return TRUE if ID is known already, otherwise - FALSE
+ */
+ bool IsApplicationWithSameAppIdRegistered();
+
+ /*
+ * @brief Check new application parameters (name, tts, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /*
+ * @brief Predicate for using with CheckCoincidence method to compare with VR
+ * synonym SO
+ *
+ * return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ CoincidencePredicateVR(const custom_str::CustomString& newItem)
+ : newItem_(newItem) {}
+
+ bool operator()(const smart_objects::SmartObject& obj) {
+ const custom_str::CustomString& vr_synonym = obj.asCustomString();
+ return newItem_.CompareIgnoreCase(vr_synonym);
+ }
+ const custom_str::CustomString& newItem_;
+ };
+
+ /**
+ * @brief Check request parameters against policy table data
+ * @return SUCCESS if check ok, otherwise return appropriate error code
+ */
+ mobile_apis::Result::eType CheckWithPolicyData();
+
+ /**
+ * @brief Fill DeviceInfo struct with data from request, if any
+ * @param device_info Struct for device params from request
+ */
+ void FillDeviceInfo(policy::DeviceInfo* device_info);
+
+ /**
+ * @brief Checks register app interface params(ttsName, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if register app interface contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Checks vehicle type params (model, year etc.) and in case of absense
+ * replaces with policy table backup values
+ * @param vehicle_type VehicleType struct
+ * @param param Vehicle param
+ * @param backup_value Backup value
+ */
+ void CheckResponseVehicleTypeParam(smart_objects::SmartObject& vehicle_type,
+ const std::string& param,
+ const std::string& backup_value);
+ /**
+ * @brief Sends ButtonSubscription notification at start up
+ * to notify HMI that app subscribed on the custom button by default.
+ */
+ void SendSubscribeCustomButtonNotification();
+
+ /**
+ * @brief IsApplicationSwitched checks whether application is switched from
+ * another transport. If application id is found, but not in reconnection
+ * list, returns 'already registered' code. Otherwise - proceed with
+ * switching.
+ * @return True if application is detected as switched, otherwise false.
+ */
+ bool IsApplicationSwitched();
+
+ private:
+ std::string response_info_;
+ mobile_apis::Result::eType result_code_;
+
+ policy::PolicyHandlerInterface& GetPolicyHandler();
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
new file mode 100644
index 0000000000..d591d67794
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h
@@ -0,0 +1,84 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceResponse class constructor
+ **/
+ RegisterAppInterfaceResponse(
+ const app_mngr::commands::MessageSharedPtr& response,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(response,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief RegisterAppInterfaceResponse class destructor
+ **/
+ virtual ~RegisterAppInterfaceResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SetHeartBeatTimeout(uint32_t connection_key,
+ const std::string& mobile_app_id);
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
new file mode 100644
index 0000000000..6f7e330bf5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h
@@ -0,0 +1,149 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesRequest command class
+ **/
+class ResetGlobalPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ResetGlobalPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ResetGlobalPropertiesRequest class destructor
+ **/
+ ~ResetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /*
+ * @brief Sets default value of the HELPPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ * @param is_timeout_promp Flag indicating that timeout prompt
+ * should be reset
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetHelpPromt(app_mngr::ApplicationSharedPtr app);
+
+ /*
+ * @brief Sets default value of the TIMEOUTPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sets default value of the VRHELPTITLE global property
+ * to the application name and value of the VRHELPITEMS global property
+ * to value equal to registered command -1(default command “Help / Cancel”.)
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetVrHelpTitleItems(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Prepare result for sending to mobile application
+ * @param out_result_code contains result code for sending to mobile
+ * application
+ * @param out_response_info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
new file mode 100644
index 0000000000..b33ef41426
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class ResetGlobalPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ResetGlobalPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ResetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~ResetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
new file mode 100644
index 0000000000..a641fa0cd4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h
@@ -0,0 +1,90 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief scrollable message request command class
+ **/
+class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ScrollableMessageRequest class constructor
+ **/
+ ScrollableMessageRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SliderCommand class destructor
+ **/
+ virtual ~ScrollableMessageRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
new file mode 100644
index 0000000000..8bc8a36363
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class ScrollableMessageResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief ScrollableMessageResponse class constructor
+ **/
+ ScrollableMessageResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~ScrollableMessageResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
new file mode 100644
index 0000000000..e3ed6ef28b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataRequest command class
+ **/
+class SendHapticDataRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SendHapticDataRequest class destructor
+ **/
+ ~SendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
new file mode 100644
index 0000000000..53e8766241
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataResponse command class
+ **/
+class SendHapticDataResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SendHapticDataResponse class destructor
+ **/
+ ~SendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
new file mode 100644
index 0000000000..6626da4c9d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h
@@ -0,0 +1,100 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+
+#include <list>
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief send location request command class
+ */
+class SendLocationRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SendLocationRquest class constructor
+ */
+ SendLocationRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SendLocationRquest class destructor
+ */
+ virtual ~SendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief CheckFieldsCompatibility checks if fields are compatible with each
+ * other.
+ * @return true if compatible, otherwise return false
+ */
+ bool CheckFieldsCompatibility();
+
+ /**
+ * @brief Checks sendlocation params(locationName, locationDescription, ...).
+ * Checks string if it contains \t\n \\t \\n or whitespace
+ * @return true if string contains invalid characters, otherwise returns false
+ */
+ bool IsWhiteSpaceExist();
+
+ bool CheckHMICapabilities(
+ std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names);
+ DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
new file mode 100644
index 0000000000..cb461f9a60
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SendLocationResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SendLocationResponse class constructor
+ */
+ SendLocationResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SendLocationResponse class destructor
+ */
+ virtual ~SendLocationResponse();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
new file mode 100644
index 0000000000..1075999af9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h
@@ -0,0 +1,116 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetIconRequest command class
+ **/
+class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief Contains information about the type of image
+ */
+ typedef enum { STATIC = 0, DYNAMIC } ImageType;
+
+ /**
+ * @brief SetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetAppIconRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetIconRequest class destructor
+ **/
+ virtual ~SetAppIconRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /**
+ * @brief Copies file to icon storage
+ * @param path_to_file Path to icon
+ */
+ void CopyToIconStorage(const std::string& path_to_file) const;
+
+ /**
+ * @brief Remove oldest icons
+ * @param storage Path to icons storage
+ * @param icons_amount Amount of icons to be deleted
+ */
+ void RemoveOldestIcons(const std::string& storage,
+ const uint32_t icons_amount) const;
+
+ /**
+ * @brief Checks, if there enough space in storage for icon copy
+ * @param file_size File size
+ * @return true, if enough, otherwise - false
+ */
+ bool IsEnoughSpaceForIcon(const uint64_t icon_size) const;
+ DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest);
+
+ private:
+ /**
+ * @brief Checks, if icons saving to configured folder is enabled
+ */
+ bool is_icons_saving_enabled_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
new file mode 100644
index 0000000000..e4ce0725dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetIconResponse command class
+ **/
+class SetAppIconResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetAppIconResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetIconResponse class destructor
+ **/
+ virtual ~SetAppIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetAppIconResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
new file mode 100644
index 0000000000..4bd800988c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutRequest command class
+ **/
+class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetDisplayLayoutRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetDisplayLayoutRequest class destructor
+ **/
+ virtual ~SetDisplayLayoutRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ **/
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
new file mode 100644
index 0000000000..73f57fc187
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutResponse command class
+ **/
+class SetDisplayLayoutResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetDisplayLayoutResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetDisplayLayoutResponse class destructor
+ **/
+ virtual ~SetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
new file mode 100644
index 0000000000..674de4731a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
@@ -0,0 +1,158 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetGlobalPropertiesRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetGlobalPropertiesRequest class destructor
+ **/
+ ~SetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ // prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject
+ static void PrepareUIRequestVRHelpData(
+ const app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params);
+
+ static void PrepareUIRequestMenuAndKeyboardData(
+ const app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params);
+
+ // Send TTS request to HMI
+ void SendTTSRequest(const smart_objects::SmartObject& params,
+ bool use_events);
+
+ // Send UI request to HMI
+ void SendUIRequest(const smart_objects::SmartObject& params, bool use_events);
+
+ // VRHelp shall contain sequential positions and start from 1
+ static bool CheckVrHelpItemsOrder(const smart_objects::SmartObject& vr_help);
+
+ /**
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks if request has at least one parameter
+ *
+ * @param params request parameters
+ *
+ * @returns true if at least one parameter is present in object
+ */
+ static bool ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params);
+
+ /**
+ * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if set global properties contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /*
+ * @brief Prepare result code and result for sending to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @param info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
+ std::string& info);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
new file mode 100644
index 0000000000..778dc9b7d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SetGlobalPropertiesResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~SetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
new file mode 100644
index 0000000000..ef674f1c38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h
@@ -0,0 +1,86 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SetMediaClockRequest request command class
+ **/
+class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SetMediaClockRequest class constructor
+ **/
+ SetMediaClockRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief ShowCommand class destructor
+ **/
+ virtual ~SetMediaClockRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ bool isDataValid();
+
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
new file mode 100644
index 0000000000..2fb3f25839
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SetMediaClockTimerResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SetMediaClockTimerResponse class constructor
+ **/
+ SetMediaClockTimerResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SetMediaClockTimerResponse class destructor
+ **/
+ virtual ~SetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
new file mode 100644
index 0000000000..cadc87cef6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTRequest command class
+ **/
+class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ShowConstantTBTRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ShowConstantTBTRequest class destructor
+ **/
+ virtual ~ShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks show constant TBT params(turnIcon, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if show constant TBT contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
new file mode 100644
index 0000000000..4129a7640e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTResponse command class
+ **/
+class ShowConstantTBTResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ShowConstantTBTResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ShowConstantTBTResponse class destructor
+ **/
+ virtual ~ShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
new file mode 100644
index 0000000000..2277a38f11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h
@@ -0,0 +1,103 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief show request command class
+ **/
+class ShowRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief ShowRequest class constructor
+ **/
+ ShowRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief ShowRequest class destructor
+ **/
+ virtual ~ShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfShowRequest();
+
+ /**
+ * @brief Handle the conversion of metadata information from the incoming
+ * mobile json message format to the outgoing hmi json message format
+ */
+ void HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params);
+
+ mobile_apis::Result::eType core_result_code_;
+ std::string core_response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
new file mode 100644
index 0000000000..c78820a26e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class ShowResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief ShowResponse class constructor
+ **/
+ ShowResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief ShowResponse class destructor
+ **/
+ virtual ~ShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
new file mode 100644
index 0000000000..f1e06e8d8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief slider request command class
+ **/
+class SliderRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SliderRequest class constructor
+ **/
+ SliderRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SliderRequest class destructor
+ **/
+ virtual ~SliderRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks slider params(sliderHeader, sliderFooter, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
new file mode 100644
index 0000000000..2a93103632
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SliderResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SliderResponse class constructor
+ **/
+ SliderResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~SliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SliderResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
new file mode 100644
index 0000000000..d6d47bb869
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h
@@ -0,0 +1,98 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief speak request command class
+ **/
+class SpeakRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SpeakRequest class constructor
+ **/
+ SpeakRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SpeakRequest class destructor
+ **/
+ virtual ~SpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sends Speak response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
+
+ /**
+ * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
+ * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
new file mode 100644
index 0000000000..30eda07810
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+
+class SpeakResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SpeakResponse class constructor
+ **/
+ SpeakResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SpeakResponse class destructor
+ **/
+ virtual ~SpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
new file mode 100644
index 0000000000..011c0aa359
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h
@@ -0,0 +1,103 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonRequest command class
+ **/
+class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeButtonRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SubscribeButtonRequest class destructor
+ **/
+ ~SubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks if button subscription allowed. In case non-media
+ * application trying to subscribe on buttons(tune, seek) negative result will
+ * be returned
+ *
+ * @param app Application requested subscription
+ * @param btn_id Button to be subscribe
+ *
+ * @return TRUE on success, otherwise false
+ **/
+ bool IsSubscriptionAllowed(app_mngr::ApplicationSharedPtr app,
+ const mobile_apis::ButtonName::eType btn_id);
+
+ /**
+ * @brief Sends ButtonSubscription notification
+ * to notify HMI that app subscribed on the button.
+ */
+ void SendSubscribeButtonNotification();
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
new file mode 100644
index 0000000000..28e942ec17
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonResponse command class
+ **/
+class SubscribeButtonResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeButtonResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handlers);
+
+ /**
+ * @brief SubscribeButtonResponse class destructor
+ **/
+ virtual ~SubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
new file mode 100644
index 0000000000..6105f08750
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubsribeWayPointsRequest command class
+ **/
+class SubscribeWayPointsRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief SubscribeWayPointsRequest class constructor
+ **/
+ SubscribeWayPointsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SubscribeWayPointsRequest class destructor
+ **/
+ ~SubscribeWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
new file mode 100644
index 0000000000..cd27e96d25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeWayPointsResponse command class
+ **/
+class SubscribeWayPointsResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief SubscribeWayPointsResponse class constructor
+ **/
+ SubscribeWayPointsResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief SubscribeWayPointsResponse class destructor
+ **/
+ virtual ~SubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
new file mode 100644
index 0000000000..c34db34506
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h
@@ -0,0 +1,98 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
+
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SystemRequest command class
+ **/
+class SystemRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SystemRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SystemRequest class destructor
+ **/
+ virtual ~SystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Validates data coming within QueryApps response
+ * @param data Data
+ * @return true, if data is valid, otherwise - false
+ */
+ bool ValidateQueryAppData(smart_objects::SmartObject& data) const;
+
+ private:
+ static uint32_t index;
+ std::string processing_file_;
+ DISALLOW_COPY_AND_ASSIGN(SystemRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
new file mode 100644
index 0000000000..afbd557d12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SystemResponse command class
+ **/
+class SystemResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SystemResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SystemResponse class destructor
+ **/
+ virtual ~SystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
new file mode 100644
index 0000000000..172f934a15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceRequest class constructor
+ **/
+ UnregisterAppInterfaceRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief UnregisterAppInterfaceRequest class destructor
+ **/
+ virtual ~UnregisterAppInterfaceRequest() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
new file mode 100644
index 0000000000..13d8b549e8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+namespace commands {
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceResponse class constructor
+ **/
+ UnregisterAppInterfaceResponse(
+ const app_mngr::commands::MessageSharedPtr& response,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(response,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ /**
+ * \brief UnregisterAppInterfaceResponse class destructor
+ **/
+ virtual ~UnregisterAppInterfaceResponse() {}
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
new file mode 100644
index 0000000000..8cbaafbfe1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h
@@ -0,0 +1,89 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonRequest command class
+ **/
+class UnsubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeButtonRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeButtonRequest class destructor
+ **/
+ ~UnsubscribeButtonRequest() FINAL;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Sends ButtonSubscription notification
+ * to notify HMI that app unsubscribed from the button.
+ */
+ void SendUnsubscribeButtonNotification();
+
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
new file mode 100644
index 0000000000..1db067acce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonResponse command class
+ **/
+class UnsubscribeButtonResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeButtonResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeButtonResponse class destructor
+ **/
+ virtual ~UnsubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
new file mode 100644
index 0000000000..fe14f5c7eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+class UnsubscribeWayPointsRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * \brief UnsubscribeWayPointsRequest class constructor
+ **/
+ UnsubscribeWayPointsRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief UnsubscribeWayPointsRequest class destructor
+ **/
+ ~UnsubscribeWayPointsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
new file mode 100644
index 0000000000..c578bf9f99
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeWayPointsResponse command class
+ **/
+class UnsubscribeWayPointsResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * \brief UnsubscribeWayPointsResponse class constructor
+ **/
+ UnsubscribeWayPointsResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * \brief UnsubscribeWayPointsResponse class destructor
+ **/
+ virtual ~UnsubscribeWayPointsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse);
+};
+
+} // commands
+
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
new file mode 100644
index 0000000000..8766339f96
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h
@@ -0,0 +1,102 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListRequest command class
+ **/
+class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateTurnListRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UpdateTurnListRequest class destructor
+ **/
+ virtual ~UpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ /**
+ * @brief check correct parameter turnList
+ *
+ * @return TRUE if turnList is correct,
+ * otherwise FALSE
+ */
+ bool CheckTurnListArray();
+
+ /**
+ * @brief Checks update turn list param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if update turn list contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
new file mode 100644
index 0000000000..59d3bf0b2c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListResponse command class
+ **/
+class UpdateTurnListResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UpdateTurnListResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UpdateTurnListResponse class destructor
+ **/
+ virtual ~UpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
new file mode 100644
index 0000000000..eee454fb00
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
+
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+/**
+ * @brief Factory class for HMI command creation
+ **/
+class HMICommandFactory : public app_mngr::CommandFactory {
+ public:
+ HMICommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const;
+
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
new file mode 100644
index 0000000000..f0840dde41
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
+
+#include "application_manager/command_factory.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+/**
+ * @brief Factory class for mobile command creation
+ **/
+class MobileCommandFactory : public app_mngr::CommandFactory {
+ public:
+ MobileCommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::CommandCreator& get_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const;
+
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
new file mode 100644
index 0000000000..5b5f0ae49f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
+
+#include <memory>
+#include "application_manager/application_manager.h"
+#include "application_manager/command_factory.h"
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+class SDLCommandFactory : public app_mngr::CommandFactory {
+ public:
+ SDLCommandFactory(app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t,
+ const application_manager::commands::Command::CommandSource)
+ const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& app_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ std::unique_ptr<HMICommandFactory> hmi_command_factory_;
+ std::unique_ptr<MobileCommandFactory> mobile_command_factory_;
+};
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
new file mode 100644
index 0000000000..6ae3a0b6bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
+#include "application_manager/plugin_manager/rpc_plugin.h"
+#include "application_manager/command_factory.h"
+
+namespace sdl_rpc_plugin {
+namespace plugins = application_manager::plugin_manager;
+class SDLRPCPlugin : public plugins::RPCPlugin {
+ // RPCPlugin interface
+ public:
+ bool Init(application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource
+ message_source) OVERRIDE;
+ std::string PluginName() OVERRIDE;
+
+ application_manager::CommandFactory& GetCommandFactory() OVERRIDE;
+ void OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) OVERRIDE;
+ void OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) OVERRIDE;
+
+ private:
+ std::unique_ptr<application_manager::CommandFactory> command_factory_;
+};
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
new file mode 100644
index 0000000000..19d01b594f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
+
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ActivateAppRequest::ActivateAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ActivateAppRequest::~ActivateAppRequest() {
+ LOG4CXX_TRACE(logger_, "~ActivateAppRequest");
+}
+
+void ActivateAppRequest::Run() {
+ LOG4CXX_TRACE(logger_, "enter " << correlation_id());
+ uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id(), app_id);
+#ifdef ENABLE_LOG
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::activate_app_hmi_level)) {
+ mobile_apis::HMILevel::eType requested_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::activate_app_hmi_level]
+ .asInt());
+ LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
+ }
+#endif
+ SendRequest();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
new file mode 100644
index 0000000000..d7e38c5d5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
+
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ActivateAppResponse::ActivateAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ActivateAppResponse::~ActivateAppResponse() {}
+
+void ActivateAppResponse::Run() {
+ LOG4CXX_TRACE(logger_, "enter");
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
new file mode 100644
index 0000000000..3e46bd353a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddStatisticsInfoNotification::AddStatisticsInfoNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {}
+
+void AddStatisticsInfoNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
+ .asInt();
+
+ policy_handler_.AddStatisticsInfo(type);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
new file mode 100644
index 0000000000..b227dd79dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAllAppsRequest::AllowAllAppsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAllAppsRequest::~AllowAllAppsRequest() {}
+
+void AllowAllAppsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
new file mode 100644
index 0000000000..2fdf29a7dd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAllAppsResponse::AllowAllAppsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAllAppsResponse::~AllowAllAppsResponse() {}
+
+void AllowAllAppsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.SetAllAppsAllowed(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
new file mode 100644
index 0000000000..0c6e5145c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAppRequest::AllowAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAppRequest::~AllowAppRequest() {}
+
+void AllowAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
new file mode 100644
index 0000000000..4853c3764a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/allow_app_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AllowAppResponse::AllowAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AllowAppResponse::~AllowAppResponse() {}
+
+void AllowAppResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t connection_key =
+ (*message_)[strings::params][strings::connection_key].asInt();
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ app->set_app_allowed(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
new file mode 100644
index 0000000000..fb87612e19
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribut wiion.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationGetSystemTimeRequest::BasicCommunicationGetSystemTimeRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+void BasicCommunicationGetSystemTimeRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.protocol_handler().NotifyOnFailedHandshake();
+}
+
+} // namespace commands
+} // namespace sdl_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
new file mode 100644
index 0000000000..c067debf36
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Commands")
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+BasicCommunicationGetSystemTimeResponse::
+ BasicCommunicationGetSystemTimeResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+void BasicCommunicationGetSystemTimeResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_GetSystemTime);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
new file mode 100644
index 0000000000..0c39389116
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAwakeSDLNotification::OnAwakeSDLNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAwakeSDLNotification::~OnAwakeSDLNotification() {}
+
+void OnAwakeSDLNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.resume_controller().is_suspended()) {
+ return;
+ }
+
+ {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt itBegin = accessor.GetData().begin();
+ ApplicationSetIt itEnd = accessor.GetData().end();
+ for (; itBegin != itEnd; ++itBegin) {
+ const ApplicationSharedPtr app = *itBegin;
+ if (app && app->IsHashChangedDuringSuspend()) {
+ MessageHelper::SendHashUpdateNotification(app->app_id(),
+ application_manager_);
+ app->SetHashChangedDuringSuspend(false);
+ }
+ }
+ }
+
+ application_manager_.resume_controller().OnAwake();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
new file mode 100644
index 0000000000..04e44a6979
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationSystemRequest::BasicCommunicationSystemRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {}
+
+void BasicCommunicationSystemRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
new file mode 100644
index 0000000000..5f8221fdbe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+BasicCommunicationSystemResponse::BasicCommunicationSystemResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {}
+
+void BasicCommunicationSystemResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
new file mode 100644
index 0000000000..cf2fbd9761
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {}
+
+void ButtonGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
new file mode 100644
index 0000000000..863e179040
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {}
+
+void ButtonGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated.");
+ return;
+ }
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_button_capabilities(
+ (*message_)[strings::msg_params][hmi_response::capabilities]);
+
+ hmi_capabilities.set_preset_bank_capabilities(
+ (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
new file mode 100644
index 0000000000..84a47b9deb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ClosePopupRequest::ClosePopupRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ClosePopupRequest::~ClosePopupRequest() {}
+
+void ClosePopupRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
new file mode 100644
index 0000000000..25396af337
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ClosePopupResponse::ClosePopupResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ClosePopupResponse::~ClosePopupResponse() {}
+
+void ClosePopupResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(VS): Process response from HMI
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
new file mode 100644
index 0000000000..0e09c14650
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DecryptCertificateRequest::DecryptCertificateRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void DecryptCertificateRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t correlation_id = RequestToHMI::correlation_id();
+ const uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
new file mode 100644
index 0000000000..694298ed91
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
+
+#include "application_manager/policies/policy_handler.h"
+#ifdef EXTERNAL_PROPRIETARY_MODE
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DecryptCertificateResponse::DecryptCertificateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DecryptCertificateResponse::~DecryptCertificateResponse() {}
+
+void DecryptCertificateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ const bool is_succeeded = hmi_apis::Common_Result::SUCCESS == code;
+
+ policy_handler_.OnCertificateDecrypted(is_succeeded);
+}
+
+} // namespace commands
+} // namespace application_manager
+#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
new file mode 100644
index 0000000000..63f5c2e815
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+DialNumberRequest::DialNumberRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DialNumberRequest::~DialNumberRequest() {}
+
+void DialNumberRequest::Run() {
+ SendRequest();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
new file mode 100644
index 0000000000..6d37ece2bf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+DialNumberResponse::DialNumberResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+DialNumberResponse::~DialNumberResponse() {}
+
+void DialNumberResponse::Run() {
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
new file mode 100644
index 0000000000..c06c90973d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemInfoRequest::GetSystemInfoRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetSystemInfoRequest::~GetSystemInfoRequest() {}
+
+void GetSystemInfoRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t correlation_id = RequestToHMI::correlation_id();
+ uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
new file mode 100644
index 0000000000..aef428b39f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetSystemInfoResponse::GetSystemInfoResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetSystemInfoResponse::~GetSystemInfoResponse() {}
+
+void GetSystemInfoResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ const SystemInfo& info = GetSystemInfo(code);
+
+ // We have to set preloaded flag as false in policy table on any response
+ // of GetSystemInfo (SDLAQ-CRS-2365)
+ policy_handler_.OnGetSystemInfo(
+ info.ccpu_version, info.wers_country_code, info.language);
+}
+
+const SystemInfo GetSystemInfoResponse::GetSystemInfo(
+ const hmi_apis::Common_Result::eType code) const {
+ SystemInfo info;
+
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
+ return info;
+ }
+ info.ccpu_version =
+ (*message_)[strings::msg_params]["ccpu_version"].asString();
+
+ info.wers_country_code =
+ (*message_)[strings::msg_params]["wersCountryCode"].asString();
+
+ const uint32_t lang_code =
+ (*message_)[strings::msg_params]["language"].asUInt();
+ info.language = application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ hmi_capabilities_.set_ccpu_version(info.ccpu_version);
+
+ return info;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
new file mode 100644
index 0000000000..ae375e4087
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
+#include "application_manager/message.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/policies/policy_handler.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetUrls::GetUrls(const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetUrls::~GetUrls() {}
+
+void GetUrls::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ namespace Common_Result = hmi_apis::Common_Result;
+ using policy::EndpointUrls;
+
+ if (!policy_handler_.PolicyEnabled()) {
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+ const uint32_t service_to_check =
+ (*message_)[strings::msg_params][hmi_request::service].asUInt();
+
+ EndpointUrls endpoints;
+ policy_handler_.GetUpdateUrls(service_to_check, endpoints);
+
+ if (endpoints.empty()) {
+ LOG4CXX_ERROR(logger_, "No URLs for service " << service_to_check);
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+#ifdef PROPRIETARY_MODE
+ const uint32_t policy_service = 7u;
+
+ if (policy_service == service_to_check) {
+ ProcessPolicyServiceURLs(endpoints);
+ return;
+ }
+#endif // PROPRIETARY_MODE
+
+ ProcessServiceURLs(endpoints);
+}
+
+void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
+ namespace Common_Result = hmi_apis::Common_Result;
+ using smart_objects::SmartObject;
+
+ (*message_)[strings::msg_params].erase(hmi_request::service);
+ SmartObject& urls = (*message_)[strings::msg_params][hmi_response::urls];
+
+ size_t index = 0;
+ for (size_t e = 0; e < endpoints.size(); ++e) {
+ ApplicationSharedPtr app =
+ application_manager_.application_by_policy_id(endpoints[e].app_id);
+
+#ifndef PROPRIETARY_MODE
+ bool registered_not_default = false;
+ if (policy::kDefaultId != endpoints[e].app_id) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find application with policy id "
+ << endpoints[e].app_id
+ << " URLs adding for this application is skipped.");
+ continue;
+ }
+ registered_not_default = true;
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE || HTTP
+ for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
+ const std::string& app_url = endpoints[e].url[u];
+ SmartObject& service_info = urls[index];
+
+ service_info[strings::url] = app_url;
+#ifndef PROPRIETARY_MODE
+ if (registered_not_default) {
+ service_info[strings::app_id] = app->hmi_app_id();
+ }
+#else // EXTERNAL_PROPRIETARY_MODE || HTTP
+ service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
+#endif
+ }
+ }
+ SendResponseToHMI(Common_Result::SUCCESS);
+}
+
+void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::params][hmi_response::code] = result;
+ rpc_service_.ManageHMICommand(message_);
+}
+
+#ifdef PROPRIETARY_MODE
+struct PolicyAppIdComparator {
+ PolicyAppIdComparator(const std::string& policy_app_id)
+ : policy_app_id_(policy_app_id) {}
+
+ bool operator()(const policy::EndpointData& data) {
+ return data.app_id == policy_app_id_;
+ }
+ std::string policy_app_id_;
+};
+
+void FillSODefaultUrls(smart_objects::SmartObject& urls,
+ const policy::EndpointUrls& endpoints) {
+ using smart_objects::SmartObject;
+ PolicyAppIdComparator comparator(policy::kDefaultId);
+ policy::EndpointUrls::const_iterator it =
+ std::find_if(endpoints.begin(), endpoints.end(), comparator);
+ if (it == endpoints.end()) {
+ return;
+ }
+ SmartObject service_info = SmartObject(smart_objects::SmartType_Map);
+ for (size_t i = 0; i < (*it).url.size(); ++i) {
+ service_info[strings::url] = (*it).url[i];
+ urls[i] = service_info;
+ }
+}
+
+void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+ using namespace application_manager;
+ using namespace strings;
+ using namespace hmi_apis;
+
+ const uint32_t app_id_to_send_to = policy_handler_.GetAppIdForSending();
+
+ if (!app_id_to_send_to) {
+ LOG4CXX_ERROR(logger_,
+ "There are no available applications for processing.");
+ SmartObject urls(SmartType_Array);
+ FillSODefaultUrls(urls, endpoints);
+ if (!urls.empty()) {
+ (*message_)[msg_params][hmi_response::urls] = urls;
+ }
+ (*message_).erase(hmi_request::service);
+ SendResponseToHMI(Common_Result::SUCCESS);
+ return;
+ }
+
+ ApplicationSharedPtr app =
+ application_manager_.application(app_id_to_send_to);
+
+ if (app.use_count() == 0) {
+ LOG4CXX_WARN(logger_,
+ "There is no registered application with "
+ "connection key '"
+ << app_id_to_send_to << "'");
+ SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+
+ SmartObject& object = *message_;
+ object[msg_params].erase(hmi_request::service);
+ object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
+ SmartObject& urls = object[msg_params][hmi_response::urls];
+ const std::string mobile_app_id = app->policy_app_id();
+
+ size_t index = 0;
+ for (size_t i = 0; i < endpoints.size(); ++i) {
+ using namespace helpers;
+
+ const bool to_add = Compare<std::string, EQ, ONE>(
+ endpoints[i].app_id, mobile_app_id, policy::kDefaultId);
+ const bool is_default = policy::kDefaultId == endpoints[i].app_id;
+
+ if (to_add) {
+ for (size_t k = 0; k < endpoints[i].url.size(); ++k) {
+ if (!is_default) {
+ urls[index][strings::app_id] = app_id_to_send_to;
+ }
+ urls[index][strings::url] = endpoints[i].url[k];
+ ++index;
+ }
+ }
+ }
+ SendResponseToHMI(Common_Result::SUCCESS);
+ return;
+}
+#endif // PROPRIETARY_MODE
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
new file mode 100644
index 0000000000..57c925e08f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+GetUrlsResponse::GetUrlsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+GetUrlsResponse::~GetUrlsResponse() {}
+
+void GetUrlsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
new file mode 100644
index 0000000000..39f7e61c06
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+MixingAudioSupportedRequest::MixingAudioSupportedRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {}
+
+void MixingAudioSupportedRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
new file mode 100644
index 0000000000..26fa967844
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+MixingAudioSupportedResponse::MixingAudioSupportedResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {}
+
+void MixingAudioSupportedResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ hmi_capabilities_.set_attenuated_supported(
+ (*message_)[strings::msg_params][hmi_response::attenuated_supported]
+ .asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
new file mode 100644
index 0000000000..ae3695b68e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviAlertManeuverRequest::NaviAlertManeuverRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {}
+
+void NaviAlertManeuverRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
new file mode 100644
index 0000000000..6a6307038a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviAlertManeuverResponse::NaviAlertManeuverResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {}
+
+void NaviAlertManeuverResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
new file mode 100644
index 0000000000..a9698d36ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
+
+#include "application_manager/message_helper.h"
+#include "protocol_handler/protocol_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStartStreamRequest::AudioStartStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher())
+ , retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ application_manager_.get_settings().start_stream_retry_amount();
+ default_timeout_ = stream_retry.second;
+ retry_number_ = stream_retry.first;
+ LOG4CXX_DEBUG(logger_,
+ "default_timeout_ = " << default_timeout_
+ << "; retry_number_ = " << retry_number_);
+}
+
+AudioStartStreamRequest::~AudioStartStreamRequest() {
+ // see comment in NaviStartStreamRequest
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+}
+
+void AudioStartStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Applcation with hmi_app_id " << application_id()
+ << " does not exist");
+ return;
+ }
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
+ correlation_id());
+ app->set_audio_streaming_allowed(true);
+ SendRequest();
+}
+
+void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "StartAudioStreamRequest aborted. Application not found");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_StartAudioStream: {
+ LOG4CXX_DEBUG(logger_, "Received StartStream event");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS");
+ if (application_manager_.HMILevelAllowsStreaming(app->app_id(),
+ ServiceType::kAudio)) {
+ app->set_audio_streaming_approved(true);
+ } else {
+ LOG4CXX_WARN(
+ logger_,
+ "StartAudioStreamRequest aborted. Application can not stream");
+ }
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ break;
+ }
+ if (hmi_apis::Common_Result::REJECTED == code) {
+ LOG4CXX_INFO(logger_, "StartAudioStream response REJECTED");
+ RetryStartSession();
+ break;
+ }
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void AudioStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RetryStartSession();
+}
+
+void AudioStartStreamRequest::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "StartAudioStreamRequest aborted. Application not found");
+ return;
+ }
+
+ if (!app->audio_streaming_allowed()) {
+ LOG4CXX_WARN(logger_, "Audio streaming not allowed");
+ return;
+ }
+
+ if (app->audio_streaming_approved()) {
+ LOG4CXX_INFO(logger_,
+ "AudioStartStream retry sequence stopped. "
+ << "SUCCESS received");
+ app->set_audio_stream_retry_number(0);
+ return;
+ }
+
+ uint32_t curr_retry_number = app->audio_stream_retry_number();
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry");
+ MessageHelper::SendAudioStartStream(app->app_id(), application_manager_);
+ app->set_audio_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Audio start stream retry sequence stopped. "
+ << "Attempts expired.");
+
+ application_manager_.EndNaviServices(app->app_id());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
new file mode 100644
index 0000000000..362a46cc19
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStartStreamResponse::AudioStartStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStartStreamResponse::~AudioStartStreamResponse() {}
+
+void AudioStartStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
new file mode 100644
index 0000000000..ba2b8c8157
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStopStreamRequest::AudioStopStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStopStreamRequest::~AudioStopStreamRequest() {}
+
+void AudioStopStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
new file mode 100644
index 0000000000..87ddc81696
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AudioStopStreamResponse::AudioStopStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+AudioStopStreamResponse::~AudioStopStreamResponse() {}
+
+void AudioStopStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
new file mode 100644
index 0000000000..77ef3e3369
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviGetWayPointsRequest::NaviGetWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviGetWayPointsRequest::~NaviGetWayPointsRequest() {}
+
+void NaviGetWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
new file mode 100644
index 0000000000..0aad5e5724
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviGetWayPointsResponse::NaviGetWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {}
+
+void NaviGetWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
new file mode 100644
index 0000000000..781b8d3045
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviIsReadyRequest::NaviIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+NaviIsReadyRequest::~NaviIsReadyRequest() {}
+
+void NaviIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady,
+ correlation_id());
+ SendRequest();
+}
+
+void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_Navigation);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_navi_cooperating(is_available);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
new file mode 100644
index 0000000000..b4e64e2a3e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviIsReadyResponse::NaviIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviIsReadyResponse::~NaviIsReadyResponse() {}
+
+void NaviIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
new file mode 100644
index 0000000000..a10f61310d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSendLocationRequest::NaviSendLocationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSendLocationRequest::~NaviSendLocationRequest() {}
+
+void NaviSendLocationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
new file mode 100644
index 0000000000..f93e2e17c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSendLocationResponse::NaviSendLocationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSendLocationResponse::~NaviSendLocationResponse() {}
+
+void NaviSendLocationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
new file mode 100644
index 0000000000..5e4426bd20
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+#include <string>
+#include <vector>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSetVideoConfigRequest::NaviSetVideoConfigRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {}
+
+void NaviSetVideoConfigRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported");
+ return;
+ }
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with hmi_app_id " << application_id()
+ << "does not exist");
+ return;
+ }
+
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ correlation_id());
+ SendRequest();
+}
+
+void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application is not found, abort NaviSetVideoConfigRequest");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = false;
+ std::vector<std::string> rejected_params;
+
+ if (code == hmi_apis::Common_Result::SUCCESS) {
+ LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response");
+ result = true;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Received SetVideoConfig failure response (" << event.id()
+ << ")");
+ result = false;
+ if (message[strings::msg_params].keyExists(strings::rejected_params)) {
+ const smart_objects::SmartArray* list =
+ message[strings::msg_params][strings::rejected_params].asArray();
+ if (list != NULL) {
+ for (unsigned int i = 0; i < list->size(); i++) {
+ const std::string& param = (*list)[i].asString();
+ // Make sure that we actually sent the parameter in the request
+ if ((*message_)[strings::msg_params].keyExists(strings::config) &&
+ (*message_)[strings::msg_params][strings::config].keyExists(
+ param)) {
+ rejected_params.push_back(param);
+ }
+ }
+ }
+ }
+ }
+ application_manager_.OnStreamingConfigured(
+ app->app_id(),
+ protocol_handler::ServiceType::kMobileNav,
+ result,
+ rejected_params);
+ break;
+ }
+ default:
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+}
+
+void NaviSetVideoConfigRequest::onTimeOut() {
+ LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response");
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not found");
+ return;
+ }
+
+ std::vector<std::string> empty;
+ application_manager_.OnStreamingConfigured(
+ app->app_id(), protocol_handler::ServiceType::kMobileNav, false, empty);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
new file mode 100644
index 0000000000..c5f1c5307f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSetVideoConfigResponse::NaviSetVideoConfigResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {}
+
+void NaviSetVideoConfigResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
new file mode 100644
index 0000000000..22d604ab0d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviShowConstantTBTRequest::NaviShowConstantTBTRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {}
+
+void NaviShowConstantTBTRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
new file mode 100644
index 0000000000..d2ff26b645
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviShowConstantTBTResponse::NaviShowConstantTBTResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {}
+
+void NaviShowConstantTBTResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
new file mode 100644
index 0000000000..f3d971acba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
+
+#include "application_manager/message_helper.h"
+#include "protocol_handler/protocol_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStartStreamRequest::NaviStartStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher())
+ , retry_number_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::pair<uint32_t, int32_t> stream_retry =
+ application_manager_.get_settings().start_stream_retry_amount();
+ default_timeout_ = stream_retry.second;
+ retry_number_ = stream_retry.first;
+ LOG4CXX_DEBUG(logger_,
+ "default_timeout_ = " << default_timeout_
+ << "; retry_number_ = " << retry_number_);
+}
+
+NaviStartStreamRequest::~NaviStartStreamRequest() {
+ // unsubscribe_from_all_events() in EventObserver's destructor isn't enough;
+ // we must unsubscribe before this NaviStartStreamRequest instance is removed
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartStream);
+}
+
+void NaviStartStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Applcation with hmi_app_id " << application_id()
+ << "does not exist");
+ return;
+ }
+ SetAllowedToTerminate(false);
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
+ correlation_id());
+ app->set_video_streaming_allowed(true);
+ SendRequest();
+}
+
+void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "NaviStartStreamRequest aborted. Application not found");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_StartStream: {
+ LOG4CXX_DEBUG(logger_, "Received StartStream event");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS");
+ if (application_manager_.HMILevelAllowsStreaming(
+ app->app_id(), ServiceType::kMobileNav)) {
+ app->set_video_streaming_approved(true);
+ } else {
+ LOG4CXX_DEBUG(
+ logger_,
+ "NaviStartStreamRequest aborted. Application can not stream");
+ }
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ break;
+ }
+ if (hmi_apis::Common_Result::REJECTED == code) {
+ LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
+ RetryStartSession();
+ break;
+ }
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void NaviStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RetryStartSession();
+}
+
+void NaviStartStreamRequest::RetryStartSession() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "NaviStartStreamRequest aborted. Application not found");
+ return;
+ }
+
+ if (!app->video_streaming_allowed()) {
+ LOG4CXX_WARN(logger_, "Video streaming not allowed");
+ return;
+ }
+
+ if (app->video_streaming_approved()) {
+ LOG4CXX_INFO(logger_,
+ "NaviStartStream retry sequence stopped. "
+ << "SUCCESS received");
+ app->set_video_stream_retry_number(0);
+ return;
+ }
+
+ uint32_t curr_retry_number = app->video_stream_retry_number();
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry");
+ MessageHelper::SendNaviStartStream(app->app_id(), application_manager_);
+ app->set_video_stream_retry_number(++curr_retry_number);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "NaviStartStream retry sequence stopped. "
+ << "Attempts expired");
+
+ application_manager_.EndNaviServices(app->app_id());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
new file mode 100644
index 0000000000..f09a334f51
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStartStreamResponse::NaviStartStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStartStreamResponse::~NaviStartStreamResponse() {}
+
+void NaviStartStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
new file mode 100644
index 0000000000..3e27692d62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStopStreamRequest::NaviStopStreamRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStopStreamRequest::~NaviStopStreamRequest() {}
+
+void NaviStopStreamRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
+ return;
+ }
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
new file mode 100644
index 0000000000..61b8d5a1e2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviStopStreamResponse::NaviStopStreamResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviStopStreamResponse::~NaviStopStreamResponse() {}
+
+void NaviStopStreamResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
new file mode 100644
index 0000000000..a4445ebce8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSubscribeWayPointsRequest::~NaviSubscribeWayPointsRequest() {}
+
+void NaviSubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
new file mode 100644
index 0000000000..ae5f236f6f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {}
+
+void NaviSubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
new file mode 100644
index 0000000000..ec22c93d8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUnsubscribeWayPointsRequest::NaviUnsubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUnsubscribeWayPointsRequest::~NaviUnsubscribeWayPointsRequest() {}
+
+void NaviUnsubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
new file mode 100644
index 0000000000..c084bd52d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {}
+
+void NaviUnsubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
new file mode 100644
index 0000000000..9c507c3637
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUpdateTurnListRequest::NaviUpdateTurnListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {}
+
+void NaviUpdateTurnListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
new file mode 100644
index 0000000000..eb232e6d01
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+NaviUpdateTurnListResponse::NaviUpdateTurnListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {}
+
+void NaviUpdateTurnListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
new file mode 100644
index 0000000000..398c2dac30
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {}
+
+void OnAllowSDLFunctionalityNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string device_id;
+ if ((*message_)[strings::msg_params].keyExists("device")) {
+ device_id = (*message_)[strings::msg_params]["device"]["id"].asString();
+ }
+ policy_handler_.OnAllowSDLFunctionalityNotification(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool(),
+ device_id);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
new file mode 100644
index 0000000000..189596c58a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppActivatedNotification::OnAppActivatedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppActivatedNotification::~OnAppActivatedNotification() {}
+
+void OnAppActivatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
new file mode 100644
index 0000000000..ee45f9bf1e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppDeactivatedNotification::OnAppDeactivatedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {}
+
+void OnAppDeactivatedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
new file mode 100644
index 0000000000..e13299ece7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppPermissionChangedNotification::OnAppPermissionChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {}
+
+void OnAppPermissionChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
new file mode 100644
index 0000000000..cf83c48a5a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
@@ -0,0 +1,182 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include <algorithm>
+#include <functional>
+#include <string>
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+
+namespace {
+
+/**
+ * @brief Converts SmartObject data to group permission status and appends to
+ * collection
+ */
+struct PermissionsAppender
+ : public std::unary_function<void,
+ const smart_objects::SmartArray::value_type&> {
+ PermissionsAppender(policy::PermissionConsent& consents)
+ : allowed_key_(application_manager::hmi_response::allowed)
+ , consents_(consents) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace application_manager;
+
+ FunctionalGroupPermission permissions;
+
+ permissions.group_id = static_cast<int32_t>(item[strings::id].asInt());
+ permissions.group_alias = item[strings::name].asString();
+
+ if (item.keyExists(allowed_key_)) {
+ permissions.state =
+ item[allowed_key_].asBool() ? kGroupAllowed : kGroupDisallowed;
+ }
+
+ consents_.group_permissions.push_back(permissions);
+ }
+
+ private:
+ const std::string allowed_key_;
+ policy::PermissionConsent& consents_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+/**
+ * @brief Converts SmartObject data to customer connectivity status item and
+ * appends to collection
+ */
+struct ExternalConsentStatusAppender
+ : std::unary_function<void, const smart_objects::SmartArray::value_type&> {
+ ExternalConsentStatusAppender(
+ policy::ExternalConsentStatus& external_consent_status)
+ : external_consent_status_(external_consent_status) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace hmi_apis;
+ using namespace application_manager;
+
+ ExternalConsentStatusItem status_item(
+ static_cast<uint32_t>(item[strings::entity_type].asUInt()),
+ static_cast<uint32_t>(item[strings::entity_id].asUInt()),
+ static_cast<Common_EntityStatus::eType>(
+ item[strings::status].asUInt()) == Common_EntityStatus::ON
+ ? policy::kStatusOn
+ : policy::kStatusOff);
+
+ external_consent_status_.insert(status_item);
+ }
+
+ private:
+ policy::ExternalConsentStatus& external_consent_status_;
+};
+#endif
+} // namespace
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {}
+
+void OnAppPermissionConsentNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ uint32_t connection_key = 0;
+
+ policy::PermissionConsent permission_consent;
+
+ // If user defined group permissions for specific app
+ if (msg_params.keyExists(strings::app_id)) {
+ connection_key = msg_params[strings::app_id].asUInt();
+ }
+
+ if (msg_params.keyExists(strings::consented_functions)) {
+ const smart_objects::SmartArray* user_consent =
+ msg_params[strings::consented_functions].asArray();
+
+ smart_objects::SmartArray::const_iterator it = user_consent->begin();
+ smart_objects::SmartArray::const_iterator it_end = user_consent->end();
+ for (; it != it_end; ++it) {
+ policy::FunctionalGroupPermission permissions;
+ permissions.group_id = (*it)["id"].asInt();
+ permissions.group_alias = (*it)["name"].asString();
+ if ((*it).keyExists("allowed")) {
+ permissions.state = (*it)["allowed"].asBool()
+ ? policy::kGroupAllowed
+ : policy::kGroupDisallowed;
+ } else {
+ permissions.state = policy::kGroupUndefined;
+ }
+
+ permission_consent.group_permissions.push_back(permissions);
+ }
+
+ permission_consent.consent_source = msg_params[strings::source].asString();
+ }
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status;
+ if (msg_params.keyExists(strings::external_consent_status)) {
+ const smart_objects::SmartArray* system_external_consent_status =
+ msg_params[strings::external_consent_status].asArray();
+ ExternalConsentStatusAppender status_appender(external_consent_status);
+ std::for_each(system_external_consent_status->begin(),
+ system_external_consent_status->end(),
+ status_appender);
+ }
+ policy_handler_.OnAppPermissionConsent(
+ connection_key, permission_consent, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(connection_key, permission_consent);
+#endif
+}
+} // commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
new file mode 100644
index 0000000000..24c5a94272
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppRegisteredNotification::OnAppRegisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppRegisteredNotification::~OnAppRegisteredNotification() {}
+
+void OnAppRegisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // SDL must notify system about app registration before any dependent actions
+ // will be started
+ SendNotification();
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
new file mode 100644
index 0000000000..001b9fa5e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAppUnregisteredNotification::OnAppUnregisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {}
+
+bool OnAppUnregisteredNotification::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Replacement of hmi id is skipped.");
+ return true;
+}
+
+void OnAppUnregisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // sending event for delete VRCommand on PerformInteraction
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
new file mode 100644
index 0000000000..e2cd6d2cbf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnAudioDataStreamingNotification::OnAudioDataStreamingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {}
+
+void OnAudioDataStreamingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
new file mode 100644
index 0000000000..1f052b865b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
new file mode 100644
index 0000000000..6c5d8f5a43
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
new file mode 100644
index 0000000000..70ff1c3fad
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonSubscriptionNotification::OnButtonSubscriptionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {}
+
+void OnButtonSubscriptionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
new file mode 100644
index 0000000000..2c4f9a1ccc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnDeviceChosenNotification::OnDeviceChosenNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDeviceChosenNotification::~OnDeviceChosenNotification() {}
+
+void OnDeviceChosenNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+ application_manager_.ConnectToDevice(
+ (*message_)[strings::msg_params][strings::device_info][strings::id]
+ .asString());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
new file mode 100644
index 0000000000..307dccd09b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "encryption/hashing.h"
+
+namespace {
+// TODO(AOleynik) : replace this !!!
+void check_zero(const char& a, const char& b, std::string& bt_mac) {
+ if ('0' != a && '0' == b) {
+ bt_mac.push_back(a);
+ bt_mac.push_back(b);
+ } else if ('0' == a) {
+ bt_mac.push_back(b);
+ } else {
+ bt_mac.push_back(a);
+ bt_mac.push_back(b);
+ }
+}
+
+std::string convert_to_bt_mac(std::string& deviceInternalId) {
+ std::transform(deviceInternalId.begin(),
+ deviceInternalId.end(),
+ deviceInternalId.begin(),
+ ::tolower);
+
+ std::string bt_mac;
+ check_zero(deviceInternalId[10], deviceInternalId[11], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[8], deviceInternalId[9], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[6], deviceInternalId[7], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[4], deviceInternalId[5], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[2], deviceInternalId[3], bt_mac);
+ bt_mac.push_back(':');
+ check_zero(deviceInternalId[0], deviceInternalId[1], bt_mac);
+
+ return bt_mac;
+}
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnDeviceStateChangedNotification::OnDeviceStateChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {}
+
+void OnDeviceStateChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((*message_)[strings::msg_params]["deviceState"] ==
+ hmi_apis::Common_DeviceState::UNPAIRED) {
+ // It is expected, that "deviceInternalId" is the device MAC address in
+ // form XXXXXXXXXX
+ std::string device_id =
+ (*message_)[strings::msg_params]["deviceInternalId"].asString();
+ if (device_id.empty()) {
+ if ((*message_)[strings::msg_params].keyExists("deviceId")) {
+ device_id =
+ (*message_)[strings::msg_params]["deviceId"]["id"].asString();
+ }
+ } else {
+ // Policy uses hashed MAC address as device_id
+ LOG4CXX_DEBUG(logger_, "Device_id from HMI: " << device_id);
+ std::string bt_mac = convert_to_bt_mac(device_id);
+ LOG4CXX_DEBUG(logger_, "Device_id as BT MAC: " << bt_mac);
+ device_id = encryption::MakeHash(bt_mac);
+ LOG4CXX_DEBUG(logger_, "Device_id hashed as BT MAC : " << device_id);
+ }
+ policy_handler_.RemoveDevice(device_id);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..a5fb9b206e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <set>
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+namespace {
+struct OnDriverDistractionProcessor {
+ OnDriverDistractionProcessor(
+ OnDriverDistractionNotification& command,
+ smart_objects::SmartObjectSPtr on_driver_distraction_so,
+ ApplicationManager& application_manager)
+ : command_(command)
+ , on_driver_distraction_so_(on_driver_distraction_so)
+ , application_manager_(application_manager)
+ , stringified_function_id_(MessageHelper::StringifiedFunctionID(
+ mobile_api::FunctionID::OnDriverDistractionID)) {}
+
+ void operator()(ApplicationSharedPtr application) {
+ if (application) {
+ (*on_driver_distraction_so_)[strings::params][strings::connection_key] =
+ application->app_id();
+ const RPCParams params;
+ policy::CheckPermissionResult result;
+ application_manager_.GetPolicyHandler().CheckPermissions(
+ application, stringified_function_id_, params, result);
+ if (result.hmi_level_permitted != policy::kRpcAllowed) {
+ MobileMessageQueue messages;
+ application->SwapMobileMessageQueue(messages);
+ messages.erase(
+ std::remove_if(
+ messages.begin(),
+ messages.end(),
+ [this](smart_objects::SmartObjectSPtr message) {
+ return (*message)[strings::params][strings::function_id]
+ .asString() == stringified_function_id_;
+ }),
+ messages.end());
+ application->PushMobileMessage(on_driver_distraction_so_);
+ return;
+ }
+ command_.SendNotificationToMobile(on_driver_distraction_so_);
+ }
+ }
+
+ private:
+ OnDriverDistractionNotification& command_;
+ smart_objects::SmartObjectSPtr on_driver_distraction_so_;
+ ApplicationManager& application_manager_;
+ std::string stringified_function_id_;
+};
+}
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*message_)[strings::msg_params][hmi_notification::state].asInt());
+ application_manager_.set_driver_distraction_state(state);
+
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_driver_distraction) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+ (*on_driver_distraction)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ state;
+
+ const ApplicationSet applications =
+ application_manager_.applications().GetData();
+
+ OnDriverDistractionProcessor processor(
+ *this, on_driver_distraction, application_manager_);
+ std::for_each(applications.begin(), applications.end(), processor);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
new file mode 100644
index 0000000000..cd3f2c23e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnEventChangedNotification::OnEventChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnEventChangedNotification::~OnEventChangedNotification() {}
+
+void OnEventChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
new file mode 100644
index 0000000000..9d250d288e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {}
+
+void OnExitAllApplicationsNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_ApplicationsCloseReason::eType reason =
+ static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>(
+ (*message_)[strings::msg_params][hmi_request::reason].asInt());
+ LOG4CXX_DEBUG(logger_, "Reason " << reason);
+
+ mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
+
+ switch (reason) {
+ case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
+ application_manager_.resume_controller().OnSuspend();
+ SendOnSDLPersistenceComplete();
+ return;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
+ return;
+ }
+ }
+
+ application_manager_.SetUnregisterAllApplicationsReason(mob_reason);
+
+ if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
+ mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS ==
+ mob_reason) {
+ application_manager_.HeadUnitReset(mob_reason);
+ }
+ kill(getpid(), SIGINT);
+}
+
+void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+ (*message)[strings::params][strings::correlation_id] =
+ application_manager_.GetNextHMICorrelationID();
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
new file mode 100644
index 0000000000..681390fbf4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnExitApplicationNotification::OnExitApplicationNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnExitApplicationNotification::~OnExitApplicationNotification() {}
+
+void OnExitApplicationNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+
+ uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ ApplicationSharedPtr app_impl = application_manager_.application(app_id);
+
+ if (app_impl.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ return;
+ }
+
+ auto on_app_exit = [app_impl](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationExit, app_impl);
+ };
+
+ application_manager_.GetPluginManager().ForEachPlugin(on_app_exit);
+
+ Common_ApplicationExitReason::eType reason;
+ reason = static_cast<Common_ApplicationExitReason::eType>(
+ (*message_)[strings::msg_params][strings::reason].asInt());
+
+ switch (reason) {
+ case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: {
+ break;
+ }
+ case Common_ApplicationExitReason::USER_EXIT: {
+ break;
+ }
+ case Common_ApplicationExitReason::UNAUTHORIZED_TRANSPORT_REGISTRATION: {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
+ SOURCE_SDL);
+ // HMI rejects registration for navi application
+ application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
+ return;
+ }
+ case Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE: {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
+ return;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "Unhandled reason");
+ return;
+ }
+ }
+
+ application_manager_.state_controller().SetRegularState(
+ app_impl,
+ HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ false);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
new file mode 100644
index 0000000000..ec680c667d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnFileRemovedNotification::OnFileRemovedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnFileRemovedNotification::~OnFileRemovedNotification() {}
+
+void OnFileRemovedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
new file mode 100644
index 0000000000..c74dd70c84
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnFindApplications::OnFindApplications(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnFindApplications::~OnFindApplications() {}
+
+void OnFindApplications::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add UpdateAppsOnDevice to ApplicationManager
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
new file mode 100644
index 0000000000..9ff1851e3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {}
+
+void OnIgnitionCycleOverNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnIgnitionCycleOver();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..20f20ece08
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {}
+
+void OnNaviTBTClientStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
new file mode 100644
index 0000000000..fa8819ca5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& app_man,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(
+ message, app_man, rpc_service, hmi_capabilities, policy_handle) {}
+
+OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {}
+
+void OnNaviWayPointChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
new file mode 100644
index 0000000000..e069bea740
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnPolicyUpdate::OnPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnPolicyUpdate::~OnPolicyUpdate() {}
+
+void OnPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnPTExchangeNeeded();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
new file mode 100644
index 0000000000..1524aa9ea2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnPutFileNotification::OnPutFileNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnPutFileNotification::~OnPutFileNotification() {}
+
+void OnPutFileNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
new file mode 100644
index 0000000000..76c9115662
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnReadyNotification::OnReadyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnReadyNotification::~OnReadyNotification() {}
+
+void OnReadyNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.OnHMIStartedCooperation();
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
new file mode 100644
index 0000000000..1eaef0b5e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "application_manager/application_manager.h"
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
+
+void OnReceivedPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ const std::string& file_path =
+ (*message_)[strings::msg_params][hmi_notification::policyfile].asString();
+ policy::BinaryMessage file_content;
+ if (!file_system::ReadBinaryFile(file_path, file_content)) {
+ LOG4CXX_ERROR(logger_, "Failed to read Update file.");
+ return;
+ }
+ policy_handler_.ReceiveMessageFromSDK(file_path, file_content);
+#else
+ LOG4CXX_WARN(logger_,
+ "This RPC is part of extended policy flow."
+ "Please re-build with extended policy mode enabled.");
+#endif
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
new file mode 100644
index 0000000000..60699e5b9c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnRecordStartdNotification::OnRecordStartdNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnRecordStartdNotification::~OnRecordStartdNotification() {}
+
+void OnRecordStartdNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
new file mode 100644
index 0000000000..9f8a713ffe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnResumeAudioSourceNotification::OnResumeAudioSourceNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {}
+
+void OnResumeAudioSourceNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
new file mode 100644
index 0000000000..65879edce6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLCloseNotification::OnSDLCloseNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLCloseNotification::~OnSDLCloseNotification() {}
+
+void OnSDLCloseNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
new file mode 100644
index 0000000000..cf8feb4ca1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc
@@ -0,0 +1,62 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLConsentNeededNotification::OnSDLConsentNeededNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {}
+
+void OnSDLConsentNeededNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
new file mode 100644
index 0000000000..0ac4afd4d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {}
+
+void OnSDLPersistenceCompleteNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
new file mode 100644
index 0000000000..2cee7926bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnStartDeviceDiscovery::OnStartDeviceDiscovery(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {}
+
+void OnStartDeviceDiscovery::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.StartDevicesDiscovery();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
new file mode 100644
index 0000000000..4cb01e7e90
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnStatusUpdateNotification::OnStatusUpdateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnStatusUpdateNotification::~OnStatusUpdateNotification() {}
+
+void OnStatusUpdateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
new file mode 100644
index 0000000000..242fb1d8cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnSystemContextNotification::OnSystemContextNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemContextNotification::~OnSystemContextNotification() {}
+
+void OnSystemContextNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ mobile_api::SystemContext::eType system_context =
+ static_cast<mobile_api::SystemContext::eType>(
+ (*message_)[strings::msg_params][hmi_notification::system_context]
+ .asInt());
+
+ ApplicationSharedPtr app;
+ if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
+ app = application_manager_.active_application();
+ } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+ }
+ }
+
+ if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) {
+ application_manager_.state_controller().SetRegularState(app,
+ system_context);
+ } else {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
new file mode 100644
index 0000000000..5591d59355
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "application_manager/application_manager.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemErrorNotification::OnSystemErrorNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemErrorNotification::~OnSystemErrorNotification() {}
+
+void OnSystemErrorNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const int code =
+ (*message_)[strings::msg_params][hmi_notification::error].asInt();
+
+ policy_handler_.OnSystemError(code);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
new file mode 100644
index 0000000000..11b2471294
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemInfoChangedNotification::OnSystemInfoChangedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {}
+
+void OnSystemInfoChangedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t lang_code =
+ (*message_)[strings::msg_params][strings::language].asUInt();
+ const std::string language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ policy_handler_.OnSystemInfoChanged(language);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
new file mode 100644
index 0000000000..d795896764
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+using policy::PolicyHandlerInterface;
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& params = (*message_)[strings::params];
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ params[strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
+
+ // According to HMI API, this should be HMI unique id, but during processing
+ // messages from HMI this param is replaced by connection key, so below it
+ // will be treated as connection key
+ ApplicationSharedPtr app;
+ if (msg_params.keyExists(strings::app_id)) {
+ const uint32_t app_id = msg_params[strings::app_id].asUInt();
+ LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for appID " << app_id);
+ LOG4CXX_DEBUG(logger_, "Searching app to send OnSystemRequest by appID.");
+ app = application_manager_.application(app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Received OnSystemRequest without appID."
+ " One of registered apps will be used.");
+ LOG4CXX_DEBUG(logger_, "Searching registered app to send OnSystemRequest.");
+ const PolicyHandlerInterface& policy_handler = policy_handler_;
+ const uint32_t selected_app_id = policy_handler.GetAppIdForSending();
+ if (0 == selected_app_id) {
+ LOG4CXX_WARN(logger_,
+ "Can't select application to forward OnSystemRequest.");
+ return;
+ }
+ app = application_manager_.application(selected_app_id);
+ }
+
+ if (app.use_count() == 0) {
+ LOG4CXX_WARN(logger_,
+ "No valid application found to forward OnSystemRequest.");
+ return;
+ }
+
+ std::string device_mac;
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
+
+ if (policy::kDeviceAllowed !=
+ policy_handler_.GetUserConsentForDevice(device_mac)) {
+ LOG4CXX_WARN(logger_,
+ "Application "
+ << app->policy_app_id()
+ << " is registered from non-consented device."
+ "Can't forward notification to application.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Sending request with application id " << app->policy_app_id());
+
+ params[strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
new file mode 100644
index 0000000000..b5fd1a007e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnSystemTimeReadyNotification::OnSystemTimeReadyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& app_man,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : NotificationFromHMI(
+ message, app_man, rpc_service, hmi_capabilities, policy_handler) {}
+
+OnSystemTimeReadyNotification::~OnSystemTimeReadyNotification() {}
+
+void OnSystemTimeReadyNotification::Run() {
+ event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
new file mode 100644
index 0000000000..5b5cfeefb1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {}
+
+void OnTTSLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_tts_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ /* need to clarify, because unchanged VR
+ cause WRONG_LANGUAGE on Register */
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+ ApplicationSetIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (static_cast<int>(app->language()) !=
+ (*message_)[strings::msg_params][strings::language].asInt()) {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc
new file mode 100644
index 0000000000..701dbe0538
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {}
+
+void OnTTSResetTimeoutNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
new file mode 100644
index 0000000000..34ba82df1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSStartedNotification::OnTTSStartedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSStartedNotification::~OnTTSStartedNotification() {}
+
+void OnTTSStartedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Started);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
new file mode 100644
index 0000000000..0935a36848
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTTSStoppedNotification::OnTTSStoppedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnTTSStoppedNotification::~OnTTSStoppedNotification() {}
+
+void OnTTSStoppedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
new file mode 100644
index 0000000000..21cf0d9628
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUICommandNotification::OnUICommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUICommandNotification::~OnUICommandNotification() {}
+
+void OnUICommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
new file mode 100644
index 0000000000..fbdd4fce2b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {}
+
+void OnUIKeyBoardInputNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnKeyboardInputID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
new file mode 100644
index 0000000000..3bf5a5aed4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUILanguageChangeNotification::OnUILanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {}
+
+void OnUILanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_ui_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ (*message_)[strings::msg_params][strings::language];
+
+ (*message_)[strings::msg_params][strings::language] =
+ hmi_capabilities.active_vr_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (app->ui_language() !=
+ (*message_)[strings::msg_params][strings::hmi_display_language]
+ .asInt()) {
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc
new file mode 100644
index 0000000000..953932cdb6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {}
+
+void OnUIResetTimeoutNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
new file mode 100644
index 0000000000..e5b321e1ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace hmi {
+
+OnUITouchEventNotification::OnUITouchEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUITouchEventNotification::~OnUITouchEventNotification() {}
+
+void OnUITouchEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnTouchEventID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
new file mode 100644
index 0000000000..2a5e6ba797
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnUpdateDeviceList::OnUpdateDeviceList(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnUpdateDeviceList::~OnUpdateDeviceList() {}
+
+void OnUpdateDeviceList::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
new file mode 100644
index 0000000000..c8ecba458a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {}
+
+void OnVIAccPedalPositionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
new file mode 100644
index 0000000000..ee909d19dc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIBeltStatusNotification::OnVIBeltStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {}
+
+void OnVIBeltStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
new file mode 100644
index 0000000000..f0386646ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIBodyInformationNotification::OnVIBodyInformationNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {}
+
+void OnVIBodyInformationNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc
new file mode 100644
index 0000000000..549c73065a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {}
+
+void OnVIDeviceStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
new file mode 100644
index 0000000000..23f0d37068
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {}
+
+void OnVIDriverBrakingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
new file mode 100644
index 0000000000..735a225225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {}
+
+void OnVIEngineTorqueNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
new file mode 100644
index 0000000000..0b4bfa893f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {}
+
+void OnVIExternalTemperatureNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
new file mode 100644
index 0000000000..a5e84f1108
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIFuelLevelNotification::OnVIFuelLevelNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {}
+
+void OnVIFuelLevelNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
new file mode 100644
index 0000000000..950b5a36f1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {}
+
+void OnVIFuelLevelStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
new file mode 100644
index 0000000000..0d94194f76
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIGpsDataNotification::OnVIGpsDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIGpsDataNotification::~OnVIGpsDataNotification() {}
+
+void OnVIGpsDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
new file mode 100644
index 0000000000..80edb88e38
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {}
+
+void OnVIHeadLampStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
new file mode 100644
index 0000000000..a2b0b1a8fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIInstantFuelConsumptionNotification::
+ ~OnVIInstantFuelConsumptionNotification() {}
+
+void OnVIInstantFuelConsumptionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
new file mode 100644
index 0000000000..5e3555bbc4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIMyKeyNotification::OnVIMyKeyNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIMyKeyNotification::~OnVIMyKeyNotification() {}
+
+void OnVIMyKeyNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
new file mode 100644
index 0000000000..1dbef77fa3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIOdometerNotification::OnVIOdometerNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIOdometerNotification::~OnVIOdometerNotification() {}
+
+void OnVIOdometerNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
new file mode 100644
index 0000000000..d4ae93b324
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIPrndlNotification::OnVIPrndlNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIPrndlNotification::~OnVIPrndlNotification() {}
+
+void OnVIPrndlNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
new file mode 100644
index 0000000000..77f694c92e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIRpmNotification::OnVIRpmNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIRpmNotification::~OnVIRpmNotification() {}
+
+void OnVIRpmNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
new file mode 100644
index 0000000000..e5860c9eec
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVISpeedNotification::OnVISpeedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVISpeedNotification::~OnVISpeedNotification() {}
+
+void OnVISpeedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
new file mode 100644
index 0000000000..db591d9da3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {}
+
+void OnVISteeringWheelAngleNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
new file mode 100644
index 0000000000..b5c7e18803
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVITirePressureNotification::OnVITirePressureNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVITirePressureNotification::~OnVITirePressureNotification() {}
+
+void OnVITirePressureNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
new file mode 100644
index 0000000000..323fe5b885
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIVinNotification::OnVIVinNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIVinNotification::~OnVIVinNotification() {}
+
+void OnVIVinNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
new file mode 100644
index 0000000000..6a3b863e7c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIWiperStatusNotification::OnVIWiperStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {}
+
+void OnVIWiperStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
new file mode 100644
index 0000000000..701dee5385
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc
@@ -0,0 +1,62 @@
+
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVideoDataStreamingNotification::OnVideoDataStreamingNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {}
+
+void OnVideoDataStreamingNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
new file mode 100644
index 0000000000..386ef1d1c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/state_controller.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRCommandNotification::OnVRCommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRCommandNotification::~OnVRCommandNotification() {}
+
+void OnVRCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id();
+
+ // Check if this is one of standart VR commands (i.e. "Help")
+ if (cmd_id > max_cmd_id + 1) {
+ LOG4CXX_INFO(logger_, "Switched App");
+ const uint32_t app_id = cmd_id - max_cmd_id;
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (app) {
+ application_manager_.state_controller().SetRegularState(
+ app, mobile_apis::HMILevel::HMI_FULL, true);
+ } else {
+ LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
+ }
+ return;
+ }
+
+ // Check if this is "Help"
+ if (cmd_id == max_cmd_id + 1) {
+ return;
+ }
+ const uint32_t app_id =
+ (*message_)[strings::msg_params][strings::app_id].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ /* check if perform interaction is active
+ * if it is active we should sent to HMI DeleteCommand request
+ * and PerformInterActionResponse to mobile
+ */
+ if (0 != app->is_perform_interaction_active()) {
+ event_engine::Event event(hmi_apis::FunctionID::VR_OnCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+ } else {
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
+ SendNotificationToMobile(message_);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
new file mode 100644
index 0000000000..6a58ab9ffa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRLanguageChangeNotification::OnVRLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {}
+
+void OnVRLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it;) {
+ ApplicationSharedPtr app = *it++;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+ if (static_cast<int32_t>(app->language()) !=
+ (*message_)[strings::msg_params][strings::language].asInt()) {
+ application_manager_.state_controller().SetRegularState(
+ app, mobile_api::HMILevel::HMI_NONE, false);
+
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
+ SOURCE_SDL);
+ application_manager_.UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
new file mode 100644
index 0000000000..04eb9a9ed0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRStartedNotification::OnVRStartedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRStartedNotification::~OnVRStartedNotification() {}
+
+void OnVRStartedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_Started);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
new file mode 100644
index 0000000000..8fea5ddd1c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVRStoppedNotification::OnVRStoppedNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVRStoppedNotification::~OnVRStoppedNotification() {}
+
+void OnVRStoppedNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_Stopped);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
new file mode 100644
index 0000000000..5947454517
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCGetCapabilitiesRequest::RCGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {}
+
+void RCGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
new file mode 100644
index 0000000000..b14c28426c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCGetCapabilitiesResponse::RCGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {}
+
+void RCGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ bool capability_exists =
+ (*message_)[strings::msg_params].keyExists(strings::rc_capability);
+
+ if (capability_exists) {
+ hmi_capabilities.set_rc_capability(
+ (*message_)[strings::msg_params][strings::rc_capability]);
+ }
+ hmi_capabilities.set_rc_supported(capability_exists);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
new file mode 100644
index 0000000000..d538878dc8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCIsReadyRequest::RCIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+RCIsReadyRequest::~RCIsReadyRequest() {}
+
+void RCIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id());
+ SendRequest();
+}
+
+void RCIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::RC_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received RC_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_rc_cooperating(is_available);
+ if (!is_available) {
+ hmi_capabilities.set_rc_supported(false);
+ }
+
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_RC isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void RCIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void RCIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
new file mode 100644
index 0000000000..7534567204
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RCIsReadyResponse::RCIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+RCIsReadyResponse::~RCIsReadyResponse() {}
+
+void RCIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::RC_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
new file mode 100644
index 0000000000..f89ae1f697
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace {
+struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
+ connection_handler::DeviceHandle handle_;
+ ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle)
+ : handle_(handle) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ return app
+ ? handle_ == app->device() &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::
+ PROTOCOL_VERSION_4,
+ app->protocol_version())
+ : false;
+ }
+};
+
+struct ForegroundApp
+ : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
+ bool> {
+ bool operator()(
+ const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
+ return ptr ? ptr->is_foreground() : false;
+ }
+};
+
+struct SendLaunchApp
+ : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
+ void> {
+ ApplicationConstSharedPtr app_to_launch_;
+ ApplicationManager& application_manager_;
+ SendLaunchApp(ApplicationConstSharedPtr app_to_launch, ApplicationManager& am)
+ : app_to_launch_(app_to_launch), application_manager_(am) {}
+ void operator()(
+ const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
+ MessageHelper::SendLaunchApp((*ptr).app_id(),
+ app_to_launch_->SchemaUrl(),
+ app_to_launch_->PackageName(),
+ application_manager_);
+ return;
+ }
+};
+}
+
+SDLActivateAppRequest::SDLActivateAppRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLActivateAppRequest::~SDLActivateAppRequest() {}
+
+uint32_t SDLActivateAppRequest::app_id() const {
+ using namespace strings;
+ if (!(*message_).keyExists(msg_params)) {
+ LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
+ return 0;
+ }
+ if (!(*message_)[msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ strings::app_id << " section is absent in the message.");
+ return 0;
+ }
+ return (*message_)[msg_params][strings::app_id].asUInt();
+}
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_DEBUG(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ } else {
+ const uint32_t application_id = app_id();
+ policy_handler_.OnActivateApp(application_id, correlation_id());
+ }
+}
+
+#else // EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+
+ const uint32_t application_id = app_id();
+
+ ApplicationConstSharedPtr app_to_activate =
+ application_manager_.application(application_id);
+
+ if (!app_to_activate) {
+ LOG4CXX_WARN(
+ logger_,
+ "Can't find application within regular apps: " << application_id);
+
+ // Here is the hack - in fact SDL gets hmi_app_id in appID field and
+ // replaces it with connection_key only for normally registered apps, but
+ // for apps_to_be_registered (waiting) it keeps original value (hmi_app_id)
+ // so method does lookup for hmi_app_id
+ app_to_activate =
+ application_manager_.WaitingApplicationByID(application_id);
+
+ if (!app_to_activate) {
+ LOG4CXX_WARN(
+ logger_,
+ "Can't find application within waiting apps: " << application_id);
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Found application to activate. Application id is "
+ << app_to_activate->app_id());
+
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_WARN(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ return;
+ }
+
+ if (app_to_activate->IsRegistered()) {
+ LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
+ policy_handler_.OnActivateApp(application_id, correlation_id());
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app_to_activate->device();
+ ApplicationSharedPtr foreground_v4_app = get_foreground_app(device_handle);
+ V4ProtoApps v4_proto_apps = get_v4_proto_apps(device_handle);
+
+ if (!foreground_v4_app && v4_proto_apps.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find regular foreground app with the same "
+ "connection id:"
+ << device_handle);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, "");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application is not registered yet. "
+ "Sending launch request.");
+
+ if (foreground_v4_app) {
+ LOG4CXX_DEBUG(logger_, "Sending request to foreground application.");
+ MessageHelper::SendLaunchApp(foreground_v4_app->app_id(),
+ app_to_activate->SchemaUrl(),
+ app_to_activate->PackageName(),
+ application_manager_);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "No preffered (foreground) application is found. "
+ "Sending request to all v4 applications.");
+ std::for_each(v4_proto_apps.begin(),
+ v4_proto_apps.end(),
+ SendLaunchApp(app_to_activate, application_manager_));
+ }
+
+ subscribe_on_event(BasicCommunication_OnAppRegistered);
+}
+
+#endif // EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::onTimeOut() {
+ using namespace hmi_apis::FunctionID;
+ using namespace hmi_apis::Common_Result;
+ using namespace application_manager;
+ unsubscribe_from_event(BasicCommunication_OnAppRegistered);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
+}
+
+void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
+ using namespace hmi_apis::FunctionID;
+ if (event.id() != BasicCommunication_OnAppRegistered) {
+ return;
+ }
+ unsubscribe_from_event(BasicCommunication_OnAppRegistered);
+
+ // Have to use HMI app id from event, since HMI app id from original request
+ // message will be changed after app, initially requested for launch via
+ // SDL.ActivateApp, will be registered
+ const uint32_t hmi_application_id = hmi_app_id(event.smart_object());
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(hmi_application_id);
+ if (!app) {
+ LOG4CXX_ERROR(
+ logger_, "Application not found by HMI app id: " << hmi_application_id);
+ return;
+ }
+ policy_handler_.OnActivateApp(app->app_id(), correlation_id());
+}
+
+uint32_t SDLActivateAppRequest::hmi_app_id(
+ const smart_objects::SmartObject& so) const {
+ using namespace strings;
+ if (!so.keyExists(params)) {
+ LOG4CXX_DEBUG(logger_, params << " section is absent in the message.");
+ return 0;
+ }
+ if (!so[msg_params].keyExists(application)) {
+ LOG4CXX_DEBUG(logger_, application << " section is absent in the message.");
+ return 0;
+ }
+ if (so[msg_params][application].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ strings::app_id << " section is absent in the message.");
+ return 0;
+ }
+ return so[msg_params][application][strings::app_id].asUInt();
+}
+
+SDLActivateAppRequest::V4ProtoApps SDLActivateAppRequest::get_v4_proto_apps(
+ const connection_handler::DeviceHandle handle) const {
+ const ApplicationSet app_list = application_manager_.applications().GetData();
+ V4ProtoApps v4_proto_apps;
+ std::copy_if(app_list.begin(),
+ app_list.end(),
+ std::back_inserter(v4_proto_apps),
+ ProtoV4AppsOnDevice(handle));
+ return v4_proto_apps;
+}
+
+ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app(
+ const connection_handler::DeviceHandle handle) const {
+ V4ProtoApps v4_proto_apps = get_v4_proto_apps(handle);
+ V4ProtoApps::iterator foreground_app =
+ std::find_if(v4_proto_apps.begin(), v4_proto_apps.end(), ForegroundApp());
+ return foreground_app != v4_proto_apps.end() ? *foreground_app
+ : ApplicationSharedPtr();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
new file mode 100644
index 0000000000..3262b12759
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLActivateAppResponse::SDLActivateAppResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLActivateAppResponse::~SDLActivateAppResponse() {}
+
+void SDLActivateAppResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
new file mode 100644
index 0000000000..6b983d566a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {}
+
+void SDLGetListOfPermissionsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t connection_key = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+ policy_handler_.OnGetListOfPermissions(
+ connection_key,
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
new file mode 100644
index 0000000000..784b4922d4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {}
+
+void SDLGetListOfPermissionsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
new file mode 100644
index 0000000000..9a6c0fd520
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {}
+
+void SDLGetStatusUpdateRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_handler_.OnGetStatusUpdate(
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
new file mode 100644
index 0000000000..8fc85da481
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {}
+
+void SDLGetStatusUpdateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
new file mode 100644
index 0000000000..ab8ec4e3d9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {}
+
+void SDLGetUserFriendlyMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string messageCodes = "messageCodes";
+ if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
+ LOG4CXX_WARN(logger_,
+ "Mandatory parameter '" + messageCodes + "'' is missing");
+ return;
+ }
+ smart_objects::SmartArray* msg =
+ (*message_)[strings::msg_params][messageCodes].asArray();
+
+ std::vector<std::string> msg_codes;
+
+ smart_objects::SmartArray::const_iterator it = msg->begin();
+ smart_objects::SmartArray::const_iterator it_end = msg->end();
+ for (; it != it_end; ++it) {
+ msg_codes.push_back((*it).asString());
+ }
+
+ std::string required_language;
+ if ((*message_)[strings::msg_params].keyExists(strings::language)) {
+ uint32_t lang_code =
+ (*message_)[strings::msg_params][strings::language].asUInt();
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+ } else {
+ hmi_apis::Common_Language::eType ui_language =
+ hmi_capabilities_.active_ui_language();
+
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(ui_language);
+ }
+
+ policy_handler_.OnGetUserFriendlyMessage(
+ msg_codes,
+ required_language,
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
new file mode 100644
index 0000000000..c5b3450723
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {}
+
+void SDLGetUserFriendlyMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
new file mode 100644
index 0000000000..aef2e286d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SDLPolicyUpdate::SDLPolicyUpdate(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLPolicyUpdate::~SDLPolicyUpdate() {}
+
+void SDLPolicyUpdate::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ SendRequest();
+#else
+ LOG4CXX_WARN(logger_,
+ "This RPC is part of extended policy flow."
+ "Please re-build with extended policy mode enabled.");
+#endif
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
new file mode 100644
index 0000000000..d16fc578ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+SDLPolicyUpdateResponse::SDLPolicyUpdateResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {}
+
+void SDLPolicyUpdateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(PV): add some logic here
+}
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
new file mode 100644
index 0000000000..163d749426
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSChangeRegistrationRequest::TTSChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {}
+
+void TTSChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
new file mode 100644
index 0000000000..2c28d615d3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSChangeRegistratioResponse::TTSChangeRegistratioResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {}
+
+void TTSChangeRegistratioResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
new file mode 100644
index 0000000000..49623e01d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {}
+
+void TTSGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
new file mode 100644
index 0000000000..1cef3daf15
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {}
+
+void TTSGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::speech_capabilities)) {
+ hmi_capabilities.set_speech_capabilities(
+ (*message_)[strings::msg_params][hmi_response::speech_capabilities]);
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::prerecorded_speech_capabilities)) {
+ hmi_capabilities.set_prerecorded_speech(
+ (*message_)[strings::msg_params]
+ [hmi_response::prerecorded_speech_capabilities]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
new file mode 100644
index 0000000000..5533537b33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetLanguageRequest::TTSGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetLanguageRequest::~TTSGetLanguageRequest() {}
+
+void TTSGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
new file mode 100644
index 0000000000..ac423a2bf3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetLanguageResponse::TTSGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetLanguageResponse::~TTSGetLanguageResponse() {}
+
+void TTSGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_tts_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::TTS_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
new file mode 100644
index 0000000000..8b87b9c6ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {}
+
+void TTSGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
new file mode 100644
index 0000000000..a4e97d9d70
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {}
+
+void TTSGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_tts_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
new file mode 100644
index 0000000000..c7e2c0c4cb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSIsReadyRequest::TTSIsReadyRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+TTSIsReadyRequest::~TTSIsReadyRequest() {}
+
+void TTSIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id());
+ SendRequest();
+}
+
+void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS);
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_tts_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_TTS)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_TTS isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void TTSIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void TTSIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
new file mode 100644
index 0000000000..c7d634bee2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSIsReadyResponse::TTSIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSIsReadyResponse::~TTSIsReadyResponse() {}
+
+void TTSIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
new file mode 100644
index 0000000000..8c7443d465
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {}
+
+void TTSSetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
new file mode 100644
index 0000000000..dae06d75f9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {}
+
+void TTSSetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
new file mode 100644
index 0000000000..96b93b724f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSpeakRequest::TTSSpeakRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSpeakRequest::~TTSSpeakRequest() {}
+
+void TTSSpeakRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
new file mode 100644
index 0000000000..cb2346083b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSSpeakResponse::TTSSpeakResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSSpeakResponse::~TTSSpeakResponse() {}
+
+void TTSSpeakResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
new file mode 100644
index 0000000000..25a05f085b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSStopSpeakingRequest::TTSStopSpeakingRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {}
+
+void TTSStopSpeakingRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
new file mode 100644
index 0000000000..a2620c1340
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+TTSStopSpeakingResponse::TTSStopSpeakingResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {}
+
+void TTSStopSpeakingResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
new file mode 100644
index 0000000000..749b3ad56b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddCommandRequest::UIAddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddCommandRequest::~UIAddCommandRequest() {}
+
+void UIAddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
new file mode 100644
index 0000000000..266dffd225
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddCommandResponse::UIAddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddCommandResponse::~UIAddCommandResponse() {}
+
+void UIAddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
new file mode 100644
index 0000000000..de338d4670
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddSubmenuRequest::UIAddSubmenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddSubmenuRequest::~UIAddSubmenuRequest() {}
+
+void UIAddSubmenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
new file mode 100644
index 0000000000..85e600c87d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAddSubmenuResponse::UIAddSubmenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAddSubmenuResponse::~UIAddSubmenuResponse() {}
+
+void UIAddSubmenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
new file mode 100644
index 0000000000..ae5f861ba6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAlertRequest::UIAlertRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAlertRequest::~UIAlertRequest() {}
+
+void UIAlertRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
new file mode 100644
index 0000000000..3076eabc4c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIAlertResponse::UIAlertResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIAlertResponse::~UIAlertResponse() {}
+
+void UIAlertResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
new file mode 100644
index 0000000000..d109987009
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIChangeRegistrationRequest::UIChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {}
+
+void UIChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
new file mode 100644
index 0000000000..6557269e49
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIChangeRegistratioResponse::UIChangeRegistratioResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {}
+
+void UIChangeRegistratioResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
new file mode 100644
index 0000000000..9e52f5fc18
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteCommandRequest::UIDeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteCommandRequest::~UIDeleteCommandRequest() {}
+
+void UIDeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
new file mode 100644
index 0000000000..a8f5b59d39
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteCommandResponse::UIDeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteCommandResponse::~UIDeleteCommandResponse() {}
+
+void UIDeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
new file mode 100644
index 0000000000..1b84df8bed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {}
+
+void UIDeleteSubmenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
new file mode 100644
index 0000000000..ec4025bea1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIDeleteSubmenuResponse::UIDeleteSubmenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {}
+
+void UIDeleteSubmenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..fe11185c62
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIEndAudioPassThruRequest::UIEndAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {}
+
+void UIEndAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..3a6d4efbe4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIEndAudioPassThruResponse::UIEndAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {}
+
+void UIEndAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
new file mode 100644
index 0000000000..3bd56a0682
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetCapabilitiesRequest::UIGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {}
+
+void UIGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
new file mode 100644
index 0000000000..cd5f3c9a42
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetCapabilitiesResponse::UIGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {}
+
+void UIGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(hmi_response::display_capabilities)) {
+ hmi_capabilities.set_display_capabilities(
+ msg_params[hmi_response::display_capabilities]);
+ }
+
+ if (msg_params.keyExists(hmi_response::hmi_zone_capabilities)) {
+ hmi_capabilities.set_hmi_zone_capabilities(
+ msg_params[hmi_response::hmi_zone_capabilities]);
+ }
+
+ if (msg_params.keyExists(hmi_response::soft_button_capabilities)) {
+ hmi_capabilities.set_soft_button_capabilities(
+ msg_params[hmi_response::soft_button_capabilities]);
+ }
+
+ if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
+ hmi_capabilities.set_audio_pass_thru_capabilities(
+ msg_params[strings::audio_pass_thru_capabilities]);
+ }
+
+ if (msg_params.keyExists(strings::hmi_capabilities)) {
+ if (msg_params[strings::hmi_capabilities].keyExists(strings::navigation)) {
+ hmi_capabilities.set_navigation_supported(
+ msg_params[strings::hmi_capabilities][strings::navigation].asBool());
+ }
+ if (msg_params[strings::hmi_capabilities].keyExists(strings::phone_call)) {
+ hmi_capabilities.set_phone_call_supported(
+ msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
+ }
+ if (msg_params[strings::hmi_capabilities].keyExists(
+ strings::video_streaming)) {
+ hmi_capabilities.set_video_streaming_supported(
+ msg_params[strings::hmi_capabilities][strings::video_streaming]
+ .asBool());
+ }
+ }
+
+ if (msg_params.keyExists(strings::system_capabilities)) {
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::navigation_capability)) {
+ hmi_capabilities.set_navigation_capability(
+ msg_params[strings::system_capabilities]
+ [strings::navigation_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::phone_capability)) {
+ hmi_capabilities.set_phone_capability(
+ msg_params[strings::system_capabilities][strings::phone_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::video_streaming_capability)) {
+ hmi_capabilities.set_video_streaming_capability(
+ msg_params[strings::system_capabilities]
+ [strings::video_streaming_capability]);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
new file mode 100644
index 0000000000..8acba42493
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetLanguageRequest::UIGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetLanguageRequest::~UIGetLanguageRequest() {}
+
+void UIGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
new file mode 100644
index 0000000000..27e46e52b4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetLanguageResponse::UIGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetLanguageResponse::~UIGetLanguageResponse() {}
+
+void UIGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_ui_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::UI_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
new file mode 100644
index 0000000000..2f8ef12a25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {}
+
+void UIGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
new file mode 100644
index 0000000000..d20dd8545f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {}
+
+void UIGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_ui_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
new file mode 100644
index 0000000000..2eab211690
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIIsReadyRequest::UIIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+UIIsReadyRequest::~UIIsReadyRequest() {}
+
+void UIIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id());
+ SendRequest();
+}
+
+void UIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received UI_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI);
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_ui_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_UI)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_UI isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void UIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void UIIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
new file mode 100644
index 0000000000..e25e8ee8ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIIsReadyResponse::UIIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIIsReadyResponse::~UIIsReadyResponse() {}
+
+void UIIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..cca89e3073
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {}
+
+void UIPerformAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..057448ab33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {}
+
+void UIPerformAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
new file mode 100644
index 0000000000..d5696a39e7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformInteractionRequest::UIPerformInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformInteractionRequest::~UIPerformInteractionRequest() {}
+
+void UIPerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
new file mode 100644
index 0000000000..7629faa131
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIPerformInteractionResponse::UIPerformInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIPerformInteractionResponse::~UIPerformInteractionResponse() {}
+
+void UIPerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
new file mode 100644
index 0000000000..dbe0ceb529
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIScrollableMessageRequest::UIScrollableMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIScrollableMessageRequest::~UIScrollableMessageRequest() {}
+
+void UIScrollableMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
new file mode 100644
index 0000000000..a96b9fa3ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIScrollableMessageResponse::UIScrollableMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIScrollableMessageResponse::~UIScrollableMessageResponse() {}
+
+void UIScrollableMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
new file mode 100644
index 0000000000..f5f8f7bafd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISendHapticDataRequest::UISendHapticDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISendHapticDataRequest::~UISendHapticDataRequest() {}
+
+void UISendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
new file mode 100644
index 0000000000..4555d81a0a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISendHapticDataResponse::UISendHapticDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISendHapticDataResponse::~UISendHapticDataResponse() {}
+
+void UISendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
new file mode 100644
index 0000000000..d25bbd1cd9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetAppIconRequest::UISetAppIconRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetAppIconRequest::~UISetAppIconRequest() {}
+
+void UISetAppIconRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
new file mode 100644
index 0000000000..711b5767f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetAppIconResponse::UISetAppIconResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetAppIconResponse::~UISetAppIconResponse() {}
+
+void UISetAppIconResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
new file mode 100644
index 0000000000..73b813d0eb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {}
+
+void UiSetDisplayLayoutRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
new file mode 100644
index 0000000000..d5d2e02e33
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {}
+
+void UiSetDisplayLayoutResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
new file mode 100644
index 0000000000..0664404361
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {}
+
+void UISetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
new file mode 100644
index 0000000000..2e5fecf2af
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {}
+
+void UISetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..4e87b9ccc3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetMediaClockTimerRequest::UISetMediaClockTimerRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {}
+
+void UISetMediaClockTimerRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..39e7e1c232
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISetMediaClockTimerResponse::UISetMediaClockTimerResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {}
+
+void UISetMediaClockTimerResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
new file mode 100644
index 0000000000..5b7568abfe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIShowRequest::UIShowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowRequest::~UIShowRequest() {}
+
+void UIShowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
new file mode 100644
index 0000000000..3e3c0b79d8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UIShowResponse::UIShowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UIShowResponse::~UIShowResponse() {}
+
+void UIShowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
new file mode 100644
index 0000000000..4df3adbe14
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISliderRequest::UISliderRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISliderRequest::~UISliderRequest() {}
+
+void UISliderRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
new file mode 100644
index 0000000000..2431c65ddf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UISliderResponse::UISliderResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UISliderResponse::~UISliderResponse() {}
+
+void UISliderResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
new file mode 100644
index 0000000000..05b08cb723
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateAppListRequest::UpdateAppListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateAppListRequest::~UpdateAppListRequest() {}
+
+void UpdateAppListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
new file mode 100644
index 0000000000..3dd03993ef
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateAppListResponse::UpdateAppListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateAppListResponse::~UpdateAppListResponse() {}
+
+void UpdateAppListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add check
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
new file mode 100644
index 0000000000..7736f2b1e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
+
+#include "interfaces/HMI_API.h"
+
+#include <unistd.h>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateDeviceListRequest::UpdateDeviceListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager_.event_dispatcher()) {}
+
+UpdateDeviceListRequest::~UpdateDeviceListRequest() {}
+
+void UpdateDeviceListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation for specific customer is used in order to
+ // exclude
+ // hit code to RTC
+ if (true == application_manager_.get_settings().launch_hmi()) {
+ if (!application_manager_.IsHMICooperating()) {
+ LOG4CXX_INFO(logger_, "Wait for HMI Cooperation");
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Wait(auto_lock);
+ LOG4CXX_DEBUG(logger_, "HMI Cooperation OK");
+ }
+ }
+
+ SendRequest();
+}
+
+void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ LOG4CXX_INFO(logger_, "received OnReady");
+ unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Broadcast();
+ break;
+ };
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown event ");
+ break;
+ };
+ }
+}
+
+bool UpdateDeviceListRequest::CleanUp() {
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ termination_condition_.Broadcast();
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
new file mode 100644
index 0000000000..25dc9be5bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateDeviceListResponse::UpdateDeviceListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateDeviceListResponse::~UpdateDeviceListResponse() {}
+
+void UpdateDeviceListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // TODO(PV): add check for correctness.
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
new file mode 100644
index 0000000000..cafacea28f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc
@@ -0,0 +1,64 @@
+
+/**
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateSDLRequest::UpdateSDLRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateSDLRequest::~UpdateSDLRequest() {}
+
+void UpdateSDLRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ policy_handler_.PTExchangeAtUserRequest(
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
new file mode 100644
index 0000000000..a35571ec26
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateSDLResponse::UpdateSDLResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+UpdateSDLResponse::~UpdateSDLResponse() {}
+
+void UpdateSDLResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
new file mode 100644
index 0000000000..72ce387f77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRAddCommandRequest::VRAddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRAddCommandRequest::~VRAddCommandRequest() {}
+
+void VRAddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
new file mode 100644
index 0000000000..19d43616ff
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRAddCommandResponse::VRAddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRAddCommandResponse::~VRAddCommandResponse() {}
+
+void VRAddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
new file mode 100644
index 0000000000..9ba5fa3571
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRChangeRegistrationRequest::VRChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {}
+
+void VRChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
new file mode 100644
index 0000000000..42c5b6d65b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRChangeRegistrationResponse::VRChangeRegistrationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {}
+
+void VRChangeRegistrationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
new file mode 100644
index 0000000000..efc09dc157
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRDeleteCommandRequest::VRDeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRDeleteCommandRequest::~VRDeleteCommandRequest() {}
+
+void VRDeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
new file mode 100644
index 0000000000..f8f7535e68
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRDeleteCommandResponse::VRDeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRDeleteCommandResponse::~VRDeleteCommandResponse() {}
+
+void VRDeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
new file mode 100644
index 0000000000..7e9c846857
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {}
+
+void VRGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
new file mode 100644
index 0000000000..47ffb3a675
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {}
+
+void VRGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_vr_capabilities(
+ (*message_)[strings::msg_params][strings::vr_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
new file mode 100644
index 0000000000..d57faa08fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetLanguageRequest::VRGetLanguageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetLanguageRequest::~VRGetLanguageRequest() {}
+
+void VRGetLanguageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
new file mode 100644
index 0000000000..469452d108
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetLanguageResponse::VRGetLanguageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetLanguageResponse::~VRGetLanguageResponse() {}
+
+void VRGetLanguageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+
+ Common_Language::eType language = Common_Language::INVALID_ENUM;
+
+ if ((*message_).keyExists(strings::msg_params) &&
+ (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
+ language = static_cast<Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt());
+ }
+
+ hmi_capabilities_.set_active_vr_language(language);
+
+ LOG4CXX_DEBUG(logger_,
+ "Raising event for function_id " << function_id()
+ << " and correlation_id "
+ << correlation_id());
+ event_engine::Event event(FunctionID::VR_GetLanguage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
new file mode 100644
index 0000000000..bb27168a77
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {}
+
+void VRGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
new file mode 100644
index 0000000000..722040388d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {}
+
+void VRGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_vr_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
new file mode 100644
index 0000000000..22afb03945
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRIsReadyRequest::VRIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+VRIsReadyRequest::~VRIsReadyRequest() {}
+
+void VRIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id());
+ SendRequest();
+}
+
+void VRIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VR_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received VR_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_vr_cooperating(is_available);
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_VR)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_VR isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VRIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VRIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
+ application_manager_));
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_handle_response_for(*get_language);
+ rpc_service_.ManageHMICommand(get_language);
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_all_languages);
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
+ rpc_service_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
new file mode 100644
index 0000000000..48d9c3e075
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRIsReadyResponse::VRIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRIsReadyResponse::~VRIsReadyResponse() {}
+
+void VRIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VR_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
new file mode 100644
index 0000000000..26e308a0bc
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRPerformInteractionRequest::VRPerformInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRPerformInteractionRequest::~VRPerformInteractionRequest() {}
+
+void VRPerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
new file mode 100644
index 0000000000..dec371e889
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VRPerformInteractionResponse::VRPerformInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VRPerformInteractionResponse::~VRPerformInteractionResponse() {}
+
+void VRPerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
new file mode 100644
index 0000000000..155f819761
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
@@ -0,0 +1,627 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+AddCommandRequest::AddCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , send_ui_(false)
+ , send_vr_(false)
+ , is_ui_received_(false)
+ , is_vr_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+AddCommandRequest::~AddCommandRequest() {}
+
+void AddCommandRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RemoveCommand();
+ CommandRequestImpl::onTimeOut();
+}
+
+bool AddCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void AddCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::cmd_icon],
+ app,
+ application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (app->FindCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt())) {
+ LOG4CXX_ERROR(logger_, "INVALID_ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ bool data_exist = false;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ if (!CheckCommandName(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+ if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
+ hmi_request::parent_id)) &&
+ (0 !=
+ (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asUInt())) {
+ if (!CheckCommandParentId(app)) {
+ SendResponse(
+ false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist");
+ return;
+ }
+ }
+ data_exist = true;
+ }
+
+ if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) &&
+ ((*message_)[strings::msg_params][strings::vr_commands].length() > 0)) {
+ if (!CheckCommandVRSynonym(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ data_exist = true;
+ }
+
+ if (!data_exist) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ app->AddCommand((*message_)[strings::msg_params][strings::cmd_id].asUInt(),
+ (*message_)[strings::msg_params]);
+
+ smart_objects::SmartObject ui_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ ui_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ ui_msg_params[strings::menu_params] =
+ (*message_)[strings::msg_params][strings::menu_params];
+
+ ui_msg_params[strings::app_id] = app->app_id();
+
+ if (((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) &&
+ ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(
+ strings::value)) &&
+ (0 < (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
+ .length())) {
+ ui_msg_params[strings::cmd_icon] =
+ (*message_)[strings::msg_params][strings::cmd_icon];
+ }
+
+ send_ui_ = true;
+ }
+
+ smart_objects::SmartObject vr_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ vr_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ vr_msg_params[strings::vr_commands] =
+ (*message_)[strings::msg_params][strings::vr_commands];
+ vr_msg_params[strings::app_id] = app->app_id();
+
+ vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ vr_msg_params[strings::grammar_id] = app->get_grammar_id();
+
+ send_vr_ = true;
+ }
+
+ if (send_ui_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
+ }
+
+ if (send_vr_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
+ }
+}
+
+bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator i = commands.begin();
+ uint32_t saved_parent_id = 0;
+ uint32_t parent_id = 0;
+ if ((*message_)[strings::msg_params][strings::menu_params].keyExists(
+ hmi_request::parent_id)) {
+ parent_id = (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asUInt();
+ }
+
+ for (; commands.end() != i; ++i) {
+ if (!(*i->second).keyExists(strings::menu_params)) {
+ continue;
+ }
+
+ saved_parent_id = 0;
+ if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) {
+ saved_parent_id =
+ (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt();
+ }
+ if (((*i->second)[strings::menu_params][strings::menu_name].asString() ==
+ (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asString()) &&
+ (saved_parent_id == parent_id)) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandName received"
+ " command name already exist in same level menu");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) {
+ for (size_t j = 0;
+ j < (*message_)[strings::msg_params][strings::vr_commands].length();
+ ++j) {
+ const custom_str::CustomString& vr_cmd_i =
+ (*it->second)[strings::vr_commands][i].asCustomString();
+ const custom_str::CustomString& vr_cmd_j =
+ (*message_)[strings::msg_params][strings::vr_commands][j]
+ .asCustomString();
+
+ if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandVRSynonym"
+ " received command vr synonym already exist");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const int32_t parent_id =
+ (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asInt();
+ smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
+
+ if (!parent) {
+ LOG4CXX_INFO(logger_,
+ "AddCommandRequest::CheckCommandParentId received"
+ " submenu doesn't exist");
+ return false;
+ }
+ return true;
+}
+
+// TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest
+void AddCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
+ msg_param[strings::cmd_id] = cmd_id;
+ msg_param[strings::app_id] = application->app_id();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_info_);
+ if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
+ (*message_)[strings::msg_params].erase(strings::menu_params);
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, vr_info_);
+ if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
+ (*message_)[strings::msg_params].erase(strings::vr_commands);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ return;
+ }
+
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ const bool is_vr_invalid_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::INVALID_ENUM,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_ui_invalid_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::INVALID_ENUM,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+ const bool is_vr_unsupported =
+ vr_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const bool is_ui_unsupported =
+ ui_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+
+ const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ bool result = (is_no_ui_error && is_no_vr_error) ||
+ (is_no_ui_error && is_vr_invalid_unsupported) ||
+ (is_no_vr_error && is_ui_invalid_unsupported);
+
+ LOG4CXX_DEBUG(logger_,
+ "calculated result " << ui_result_ << " " << is_no_ui_error
+ << " " << is_no_vr_error);
+ const bool is_vr_or_ui_warning =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+
+ const bool is_vr_or_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
+ const bool is_vr_and_ui_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ ui_result_,
+ vr_result_);
+
+ if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
+ result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ } else if (result && is_vr_or_ui_unsupported) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ } else if (is_vr_or_ui_warning) {
+ result_code = mobile_apis::Result::WARNINGS;
+ } else {
+ result_code =
+ MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_) {
+ result_code = MessageHelper::HMIToMobileResult(vr_result_);
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) {
+ result_code = MessageHelper::HMIToMobileResult(ui_result_);
+ }
+ LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code);
+ }
+
+ if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
+ const bool is_ui_not_ok = Compare<hmi_apis::Common_Result::eType, NEQ, ALL>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (is_ui_not_ok) {
+ result_code = ui_result_ == hmi_apis::Common_Result::REJECTED
+ ? mobile_apis::Result::REJECTED
+ : mobile_apis::Result::GENERIC_ERROR;
+
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ application->RemoveCommand(cmd_id);
+ result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
+ }
+ }
+
+ if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ !is_no_vr_error &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
+ result_code = vr_result_ == hmi_apis::Common_Result::REJECTED
+ ? mobile_apis::Result::REJECTED
+ : mobile_apis::Result::GENERIC_ERROR;
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+
+ application->RemoveCommand(cmd_id);
+ result = false;
+ LOG4CXX_DEBUG(logger_, "Result " << result);
+ }
+
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ HmiInterfaces::InterfaceState vr_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR);
+
+ if (!BothSend() &&
+ ((is_vr_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) ||
+ (is_ui_unsupported &&
+ HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) {
+ LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported");
+ result = false;
+ }
+
+ if (is_vr_and_ui_unsupported) {
+ LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported");
+ result = false;
+ }
+
+ if (result) {
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, (*message_)[strings::msg_params], false);
+ } else {
+ RemoveCommand();
+ }
+
+ const std::string info = GenerateMobileResponseInfo();
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool AddCommandRequest::IsPendingResponseExist() {
+ return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
+}
+
+bool AddCommandRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ str = (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ const size_t len =
+ (*message_)[strings::msg_params][strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = (*message_)[strings::msg_params][strings::vr_commands][i]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AddCommandRequest::BothSend() const {
+ return send_vr_ && send_ui_;
+}
+
+const std::string AddCommandRequest::GenerateMobileResponseInfo() {
+ // In case if vr_result_ is UNSUPPORTED_RESOURCE vr_info should be on the
+ // first place
+ // In case if ui_result_ is UNSUPPORTED_RESOURCE ui_info should be on the
+ // first place
+ // Other way order is doesn't matter
+
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ HmiInterfaces::InterfaceState ui_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_UI);
+
+ HmiInterfaces::InterfaceState vr_interface_state =
+ hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_VR);
+
+ if ((ui_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (vr_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !vr_info_.empty()) {
+ return vr_info_;
+ }
+
+ if ((vr_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ (ui_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
+ !ui_info_.empty()) {
+ return ui_info_;
+ }
+
+ return app_mngr::commands::MergeInfos(ui_info_, vr_info_);
+}
+
+void AddCommandRequest::RemoveCommand() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = cmd_id;
+ msg_params[strings::app_id] = app->app_id();
+
+ app->RemoveCommand(cmd_id);
+
+ if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
+ // in case we have send bth UI and VR and no one respond
+ // we have nothing to remove from HMI so no DeleteCommand expected
+ return;
+ }
+
+ if (BothSend() && !is_vr_received_) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+ }
+
+ if (BothSend() && !is_ui_received_) {
+ msg_params[strings::grammar_id] = app->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
new file mode 100644
index 0000000000..ccb84cecbb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_command_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddCommandResponse::AddCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddCommandResponse::~AddCommandResponse() {}
+
+void AddCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
new file mode 100644
index 0000000000..183b445326
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -0,0 +1,186 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddSubMenuRequest::AddSubMenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddSubMenuRequest::~AddSubMenuRequest() {}
+
+void AddSubMenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject received_msg_params =
+ (*message_)[strings::msg_params];
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::INVALID_ENUM;
+
+ if (received_msg_params.keyExists(strings::menu_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ received_msg_params[strings::menu_icon], app, application_manager_);
+
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ const int32_t menu_id = received_msg_params[strings::menu_id].asInt();
+ if (app->FindSubMenu(menu_id)) {
+ LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ const std::string& menu_name =
+ received_msg_params[strings::menu_name].asString();
+
+ if (app->IsSubMenuNameAlreadyExist(menu_name)) {
+ LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated.");
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ if (!CheckSubMenuName()) {
+ LOG4CXX_ERROR(logger_, "Sub-menu name is not valid.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] = received_msg_params[strings::menu_id];
+ if (received_msg_params.keyExists(strings::position)) {
+ msg_params[strings::menu_params][strings::position] =
+ received_msg_params[strings::position];
+ }
+ msg_params[strings::menu_params][strings::menu_name] =
+ received_msg_params[strings::menu_name];
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
+}
+
+void AddSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ application->AddSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt(),
+ (*message_)[strings::msg_params]);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool AddSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool AddSubMenuRequest::CheckSubMenuName() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_INFO(logger_, "Invalid subMenu name.");
+ return false;
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
new file mode 100644
index 0000000000..d0ec635dd0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AddSubMenuResponse::AddSubMenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AddSubMenuResponse::~AddSubMenuResponse() {}
+
+void AddSubMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
new file mode 100644
index 0000000000..5dda34b743
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc
@@ -0,0 +1,291 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstring>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertManeuverRequest::AlertManeuverRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertManeuverRequest::~AlertManeuverRequest() {}
+
+void AlertManeuverRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
+ LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (NULL == app.get()) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n"
+ "text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ // Checking parameters and how many HMI requests should be sent
+ bool tts_is_ok = false;
+
+ // check TTSChunk parameter
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return;
+ }
+
+ if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
+ pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak);
+ tts_is_ok = true;
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+
+ pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true);
+
+ if (tts_is_ok) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ msg_params[hmi_request::speak_type] =
+ hmi_apis::Common_MethodName::ALERT_MANEUVER;
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ }
+}
+
+void AlertManeuverRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ hmi_apis::FunctionID::eType event_id = event.id();
+ switch (event_id) {
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ pending_requests_.Remove(event_id);
+ navi_alert_maneuver_result_code_ =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, info_navi_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ pending_requests_.Remove(event_id);
+ tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, info_tts_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ SendResponse(
+ false, mobile_apis::Result::INVALID_ENUM, "Received unknown event");
+ return;
+ }
+ }
+
+ if (!pending_requests_.IsFinal(event_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are some pending responses from HMI."
+ "AlertManeuverRequest still waiting.");
+ return;
+ }
+ std::string return_info;
+ mobile_apis::Result::eType result_code;
+ const bool result = PrepareResponseParameters(result_code, return_info);
+ bool must_be_empty_info = false;
+ if (return_info.find("\n") != std::string::npos ||
+ return_info.find("\t") != std::string::npos) {
+ must_be_empty_info = true;
+ }
+ SendResponse(result,
+ result_code,
+ (must_be_empty_info) ? NULL : return_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool AlertManeuverRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& return_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ app_mngr::commands::ResponseInfo navigation_alert_info(
+ navi_alert_maneuver_result_code_,
+ HmiInterfaces::HMI_INTERFACE_Navigation,
+ application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_alert_info(
+ tts_speak_result_code_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(navigation_alert_info, tts_alert_info);
+
+ if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ tts_speak_result_code_ &&
+ (HmiInterfaces::STATE_AVAILABLE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)))) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info = std::string("Unsupported phoneme type sent in a prompt");
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(navigation_alert_info, tts_alert_info);
+ return_info = app_mngr::commands::MergeInfos(
+ navigation_alert_info, info_navi_, tts_alert_info, info_tts_);
+ return result;
+}
+
+bool AlertManeuverRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using smart_objects::SmartArray;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const SmartArray* tts_chunks_arr =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ SmartArray::const_iterator it_tts_chunk = tts_chunks_arr->begin();
+
+ for (; it_tts_chunk != tts_chunks_arr->end(); ++it_tts_chunk) {
+ const char* tts_chunk_text = (*it_tts_chunk)[strings::text].asCharArray();
+ if (strlen(tts_chunk_text) && !CheckSyntax(tts_chunk_text)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ DCHECK_OR_RETURN(
+ (*message_)[strings::msg_params][strings::soft_buttons].getType() ==
+ smart_objects::SmartType_Array,
+ true);
+ const smart_objects::SmartArray* soft_button_array =
+ (*message_)[strings::msg_params][strings::soft_buttons].asArray();
+
+ SmartArray::const_iterator it_soft_button = soft_button_array->begin();
+
+ for (; it_soft_button != soft_button_array->end(); ++it_soft_button) {
+ const char* soft_button_text =
+ (*it_soft_button)[strings::text].asCharArray();
+ if (!CheckSyntax(soft_button_text)) {
+ LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
new file mode 100644
index 0000000000..d3e527f6ae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertManeuverResponse::AlertManeuverResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AlertManeuverResponse::~AlertManeuverResponse() {}
+
+void AlertManeuverResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
new file mode 100644
index 0000000000..2806ac1d93
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc
@@ -0,0 +1,453 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
+
+#include <string.h>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertRequest::AlertRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , awaiting_ui_alert_response_(false)
+ , awaiting_tts_speak_response_(false)
+ , awaiting_tts_stop_speaking_response_(false)
+ , is_alert_succeeded_(false)
+ , is_ui_alert_sent_(false)
+ , alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertRequest::~AlertRequest() {}
+
+bool AlertRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::duration)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::duration].asUInt();
+ } else {
+ const int32_t def_value = 5000;
+ default_timeout_ = def_value;
+ }
+
+ // If soft buttons are present, SDL will not use initiate timeout tracking for
+ // response.
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ LOG4CXX_INFO(logger_,
+ "Request contains soft buttons - request timeout "
+ "will be set to 0.");
+ default_timeout_ = 0;
+ }
+
+ return true;
+}
+
+void AlertRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asInt();
+
+ if (!Validate(app_id)) {
+ // Invalid command, abort execution
+ return;
+ }
+ bool tts_chunks_exists =
+ (*message_)[strings::msg_params].keyExists(strings::tts_chunks);
+ size_t length_tts_chunks = 0;
+
+ if (tts_chunks_exists) {
+ length_tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks].length();
+ }
+
+ if ((tts_chunks_exists && length_tts_chunks) ||
+ ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
+ (*message_)[strings::msg_params][strings::play_tone].asBool())) {
+ awaiting_tts_speak_response_ = true;
+ }
+
+ SendAlertRequest(app_id);
+ if (awaiting_tts_speak_response_) {
+ SendSpeakRequest(app_id, tts_chunks_exists, length_tts_chunks);
+ }
+}
+
+void AlertRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_OnResetTimeout:
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_,
+ "Received UI_OnResetTimeout event "
+ " or TTS_OnResetTimeout event"
+ << awaiting_tts_speak_response_ << " "
+ << awaiting_tts_stop_speaking_response_ << " "
+ << awaiting_ui_alert_response_);
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ LOG4CXX_INFO(logger_, "Received UI_Alert event");
+ // Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
+ awaiting_ui_alert_response_ = false;
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+
+ if (awaiting_tts_speak_response_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
+ awaiting_tts_stop_speaking_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
+ }
+ alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ // Mobile Alert request is successful when UI_Alert is successful
+ alert_response_params_ = message[strings::msg_params];
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ // Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
+ awaiting_tts_speak_response_ = false;
+ tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ // Unsubscribe from event to avoid unwanted messages
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ awaiting_tts_stop_speaking_response_ = false;
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (HasHmiResponsesToWait()) {
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ &alert_response_params_);
+}
+
+bool AlertRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ app_mngr::commands::ResponseInfo ui_alert_info(
+ alert_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_alert_info(
+ tts_speak_result_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+
+ bool result = PrepareResultForMobileResponse(ui_alert_info, tts_alert_info);
+
+ /* result=false if UI interface is ok and TTS interface = UNSUPPORTED_RESOURCE
+ * and sdl receive TTS.IsReady=true or SDL doesn't receive responce for
+ * TTS.IsReady.
+ */
+ if (result && ui_alert_info.is_ok && tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != tts_alert_info.interface_state) {
+ result = false;
+ }
+ result_code = mobile_apis::Result::WARNINGS;
+ if ((ui_alert_info.is_ok || ui_alert_info.is_not_used) &&
+ tts_alert_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_AVAILABLE == tts_alert_info.interface_state) {
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = app_mngr::commands::MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_alert_info, tts_alert_info);
+ info = app_mngr::commands::MergeInfos(
+ ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ // Mobile Alert request is successful when UI_Alert is successful
+ if (is_ui_alert_sent_ && !ui_alert_info.is_ok) {
+ return false;
+ }
+ return result;
+}
+
+bool AlertRequest::Validate(uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
+ app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::POLICY_TABLE)) {
+ LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return false;
+ }
+
+ if (!CheckStringsOfAlertRequest()) {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return false;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return false;
+ }
+
+ // check if mandatory params(alertText1 and TTSChunk) specified
+ if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) &&
+ (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) {
+ LOG4CXX_ERROR(logger_, "Mandatory parameters are missing");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Mandatory parameters are missing");
+ return false;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void AlertRequest::SendAlertRequest(int32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::alert_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText1;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text1];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText2;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text2];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText3;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text3];
+ }
+
+ // softButtons
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ // app_id
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::duration] = default_timeout_;
+
+ // NAVI platform progressIndicator
+ if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) {
+ msg_params[strings::progress_indicator] =
+ (*message_)[strings::msg_params][strings::progress_indicator];
+ }
+
+ // PASA Alert type
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::UI;
+ if (awaiting_tts_speak_response_) {
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::BOTH;
+ }
+
+ // check out if there are alert strings or soft buttons
+ if (msg_params[hmi_request::alert_strings].length() > 0 ||
+ msg_params.keyExists(hmi_request::soft_buttons)) {
+ awaiting_ui_alert_response_ = true;
+ is_ui_alert_sent_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
+ }
+}
+
+void AlertRequest::SendSpeakRequest(int32_t app_id,
+ bool tts_chunks_exists,
+ size_t length_tts_chunks) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ // crate HMI speak request
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
+ if (tts_chunks_exists && length_tts_chunks) {
+ msg_params[hmi_request::tts_chunks] =
+ smart_objects::SmartObject(SmartType_Array);
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
+ (*message_)[strings::msg_params][strings::play_tone].asBool()) {
+ msg_params[strings::play_tone] = true;
+ }
+ msg_params[strings::app_id] = app_id;
+ msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
+}
+
+bool AlertRequest::CheckStringsOfAlertRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks_array =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ for (size_t i = 0; i < tts_chunks_array.length(); ++i) {
+ str = tts_chunks_array[i][strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool AlertRequest::HasHmiResponsesToWait() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ ||
+ awaiting_tts_stop_speaking_response_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
new file mode 100644
index 0000000000..bab5e5a5d8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc
@@ -0,0 +1,67 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+AlertResponse::AlertResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+AlertResponse::~AlertResponse() {}
+
+void AlertResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
new file mode 100644
index 0000000000..6af930ea53
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc
@@ -0,0 +1,684 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace {
+namespace custom_str = utils::custom_string;
+struct IsSameNickname {
+ IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
+ bool operator()(const policy::StringArray::value_type& nickname) const {
+ return app_id_.CompareIgnoreCase(nickname.c_str());
+ }
+
+ private:
+ const custom_str::CustomString& app_id_;
+};
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ChangeRegistrationRequest::ChangeRegistrationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+ChangeRegistrationRequest::~ChangeRegistrationRequest() {}
+
+void ChangeRegistrationRequest::SendVRRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::VR_ChangeRegistration;
+ pending_requests_.Add(function);
+ smart_objects::SmartObject vr_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ vr_params[strings::language] = msg_params[strings::language];
+
+ vr_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
+ app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &vr_params, true);
+}
+
+void ChangeRegistrationRequest::SendTTSRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::TTS_ChangeRegistration;
+ pending_requests_.Add(function);
+
+ smart_objects::SmartObject tts_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ tts_params[strings::language] = msg_params[strings::language];
+
+ tts_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::tts_name)) {
+ tts_params[strings::tts_name] = msg_params[strings::tts_name];
+ app->set_tts_name(msg_params[strings::tts_name]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &tts_params, true);
+}
+
+void ChangeRegistrationRequest::SendUIRequest(
+ ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::UI_ChangeRegistration;
+ pending_requests_.Add(function);
+ // UI processing
+ smart_objects::SmartObject ui_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ ui_params[strings::language] = hmi_language;
+ ui_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::app_name)) {
+ ui_params[strings::app_name] = msg_params[strings::app_name];
+ app->set_name(msg_params[strings::app_name].asCustomString());
+ }
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ ui_params[strings::ngn_media_screen_app_name] =
+ msg_params[strings::ngn_media_screen_app_name];
+ app->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &ui_params, true);
+}
+
+void ChangeRegistrationRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ const int32_t hmi_language =
+ msg_params[strings::hmi_display_language].asInt();
+
+ const int32_t language = msg_params[strings::language].asInt();
+
+ if (false == (IsLanguageSupportedByUI(hmi_language) &&
+ IsLanguageSupportedByVR(language) &&
+ IsLanguageSupportedByTTS(language))) {
+ LOG4CXX_ERROR(logger_, "Language is not supported");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::app_name) &&
+ !IsNicknameAllowed(msg_params[strings::app_name].asCustomString())) {
+ LOG4CXX_ERROR(logger_, "Nickname is not allowed.");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ smart_objects::SmartObject& tts_name =
+ (*message_)[strings::msg_params][strings::tts_name];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_name, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_name are not present");
+ return;
+ }
+ }
+
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ALL;
+
+ if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>(
+ HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE,
+ vr_state,
+ tts_state,
+ ui_state)) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != vr_state) {
+ // VR processing
+ SendVRRequest(app, msg_params);
+ }
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != tts_state) {
+ // TTS processing
+ SendTTSRequest(app, msg_params);
+ }
+
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != ui_state) {
+ SendUIRequest(app, msg_params, hmi_language);
+ }
+}
+
+void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ hmi_apis::FunctionID::eType event_id = event.id();
+
+ switch (event_id) {
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ pending_requests_.Remove(event_id);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ pending_requests_.Remove(event_id);
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, vr_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ pending_requests_.Remove(event_id);
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event_id);
+ return;
+ }
+ }
+
+ if (pending_requests_.IsFinal(event_id)) {
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
+ application->set_ui_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::hmi_display_language]
+ .asInt()));
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
+ hmi_apis::Common_Result::SUCCESS == tts_result_) {
+ application->set_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::eType::ChangeRegistrationID;
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ } else {
+ LOG4CXX_INFO(logger_,
+ "There are some pending responses from HMI."
+ "ChangeRegistrationRequest still waiting.");
+ }
+}
+
+namespace {
+void CheckInfo(std::string& str) {
+ if (std::string::npos != str.find("is not supported by system")) {
+ str.clear();
+ }
+}
+} // namespace
+
+bool ChangeRegistrationRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ const bool is_tts_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ tts_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_ui_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_vr_succeeded_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ vr_result_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ const bool is_tts_ui_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+
+ app_mngr::commands::ResponseInfo vr_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+
+ bool result = ((!is_tts_ui_vr_unsupported) && is_tts_succeeded_unsupported &&
+ is_ui_succeeded_unsupported && is_vr_succeeded_unsupported);
+
+ const bool is_tts_or_ui_or_vr_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ tts_result_,
+ ui_result_,
+ vr_result_);
+
+ if ((result && is_tts_or_ui_or_vr_unsupported)) {
+ result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ result =
+ PrepareResultForMobileResponse(ui_properties_info,
+ tts_properties_info) &&
+ PrepareResultForMobileResponse(tts_properties_info, vr_properties_info);
+ } else {
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType ui_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType vr_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType tts_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != ui_result_) {
+ ui_result = ui_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
+ vr_result = vr_result_;
+ }
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != tts_result_) {
+ tts_result = tts_result_;
+ }
+ result_code = MessageHelper::HMIToMobileResult(
+ std::max(std::max(ui_result, vr_result), tts_result));
+ if (mobile_api::Result::INVALID_ENUM == result_code) {
+ result_code = mobile_api::Result::UNSUPPORTED_RESOURCE;
+ }
+ }
+
+ const bool is_tts_state_available =
+ tts_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_vr_state_available = vr_state == HmiInterfaces::STATE_AVAILABLE;
+ const bool is_ui_state_available = ui_state == HmiInterfaces::STATE_AVAILABLE;
+
+ const bool is_tts_hmi_info =
+ is_tts_state_available && !tts_response_info_.empty();
+ const bool is_vr_hmi_info =
+ is_vr_state_available && !vr_response_info_.empty();
+ const bool is_ui_hmi_info =
+ is_ui_state_available && !ui_response_info_.empty();
+
+ if (is_tts_hmi_info || is_vr_hmi_info || is_ui_hmi_info) {
+ if (!is_tts_hmi_info)
+ CheckInfo(tts_response_info_);
+ if (!is_vr_hmi_info)
+ CheckInfo(ui_response_info_);
+ if (!is_ui_hmi_info)
+ CheckInfo(vr_response_info_);
+ }
+
+ response_info = app_mngr::commands::MergeInfos(
+ ui_response_info_, vr_response_info_, tts_response_info_);
+ return result;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByUI(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* ui_languages =
+ hmi_capabilities.ui_supported_languages();
+
+ if (!ui_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < ui_languages->length(); ++i) {
+ if (hmi_display_lang == ui_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by UI");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByVR(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* vr_languages =
+ hmi_capabilities.vr_supported_languages();
+
+ if (!vr_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < vr_languages->length(); ++i) {
+ if (hmi_display_lang == vr_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by VR");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByTTS(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ const smart_objects::SmartObject* tts_languages =
+ hmi_capabilities.tts_supported_languages();
+
+ if (!tts_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < tts_languages->length(); ++i) {
+ if (hmi_display_lang == tts_languages->getElement(i).asInt()) {
+ return true;
+ break;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by TTS");
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSet accessor = application_manager_.applications().GetData();
+ custom_str::CustomString app_name;
+ uint32_t app_id = connection_key();
+ if (msg_params.keyExists(strings::app_name)) {
+ app_name = msg_params[strings::app_name].asCustomString();
+ }
+
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
+ if (app_id == (*it)->app_id()) {
+ continue;
+ }
+
+ const custom_str::CustomString& cur_name = (*it)->name();
+ if (msg_params.keyExists(strings::app_name)) {
+ if (app_name.CompareIgnoreCase(cur_name)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+ } // application for end
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool ChangeRegistrationRequest::IsNicknameAllowed(
+ const custom_str::CustomString& app_name) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find appication with connection key "
+ << connection_key());
+ return false;
+ }
+
+ const std::string policy_app_id = app->policy_app_id();
+
+ policy::StringArray app_nicknames;
+ policy::StringArray app_hmi_types;
+
+ bool init_result = policy_handler_.GetInitialAppData(
+ policy_app_id, &app_nicknames, &app_hmi_types);
+
+ if (!init_result) {
+ LOG4CXX_ERROR(logger_,
+ "Error during getting of nickname list for application "
+ << policy_app_id);
+ return false;
+ }
+
+ if (!app_nicknames.empty()) {
+ IsSameNickname compare(app_name);
+ policy::StringArray::const_iterator it =
+ std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
+ if (app_nicknames.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Application name was not found in nicknames list.");
+
+ usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
+ policy_handler_.GetStatisticManager(),
+ policy_app_id,
+ usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
+ ++count_of_rejections_nickname_mismatch;
+
+ return false;
+ }
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
new file mode 100644
index 0000000000..2dae92cd9b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ChangeRegistrationResponse::ChangeRegistrationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ChangeRegistrationResponse::~ChangeRegistrationResponse() {}
+
+void ChangeRegistrationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..416f4f2085
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
@@ -0,0 +1,483 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <cstring>
+#include <algorithm>
+#include <vector>
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/gen_hash.h"
+#include "utils/helpers.h"
+
+const char* kInvalidImageWarningInfo = "Requested image(s) not found.";
+
+namespace sdl_rpc_plugin {
+namespace commands {
+
+using namespace application_manager;
+
+CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , choice_set_id_(0)
+ , expected_chs_count_(0)
+ , received_chs_count_(0)
+ , should_send_warnings_(false)
+ , error_from_hmi_(false)
+ , is_timed_out_(false) {}
+
+CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void CreateInteractionChoiceSetRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ for (uint32_t i = 0;
+ i < (*message_)[strings::msg_params][strings::choice_set].length();
+ ++i) {
+ Result::eType verification_result_image = Result::SUCCESS;
+ Result::eType verification_result_secondary_image = Result::SUCCESS;
+ if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
+ strings::image)) {
+ verification_result_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set][i]
+ [strings::image],
+ app,
+ application_manager_);
+ }
+ if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
+ strings::secondary_image)) {
+ verification_result_secondary_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set][i]
+ [strings::secondary_image],
+ app,
+ application_manager_);
+ }
+ if (verification_result_image == Result::INVALID_DATA ||
+ verification_result_secondary_image == Result::INVALID_DATA) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, Result::INVALID_DATA);
+ return;
+ } else if (verification_result_image == Result::WARNINGS ||
+ verification_result_secondary_image == Result::WARNINGS) {
+ should_send_warnings_ = true;
+ break;
+ }
+ }
+
+ choice_set_id_ =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asInt();
+
+ if (app->FindChoiceSet(choice_set_id_)) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id_ << " is not found.");
+ SendResponse(false, Result::INVALID_ID);
+ return;
+ }
+
+ Result::eType result = CheckChoiceSet(app);
+ if (Result::SUCCESS != result) {
+ SendResponse(false, result);
+ return;
+ }
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(
+ (*message_)[strings::msg_params][strings::choice_set]);
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::MIXED) {
+ // this is an error
+ SendResponse(false,
+ Result::INVALID_DATA,
+ "Some choices don't contain VR commands. Either all or none "
+ "must have voice commands.");
+ return; // exit now, this is a bad set
+ } else if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // everyone had a vr command, setup the grammar
+ uint32_t grammar_id = application_manager_.GenerateGrammarID();
+ (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
+ }
+ // continue on as usual
+ app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
+
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // we have VR commands
+ SendVRAddCommandRequests(app);
+ } else {
+ // we have none, just return with success
+ SendResponse(true, Result::SUCCESS);
+ }
+}
+
+mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
+ ApplicationConstSharedPtr app) {
+ using namespace smart_objects;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::set<uint32_t> choice_id_set;
+
+ const SmartArray* choice_set =
+ (*message_)[strings::msg_params][strings::choice_set].asArray();
+
+ SmartArray::const_iterator current_choice_set_it = choice_set->begin();
+ SmartArray::const_iterator next_choice_set_it;
+
+ for (; choice_set->end() != current_choice_set_it; ++current_choice_set_it) {
+ std::pair<std::set<uint32_t>::iterator, bool> ins_res =
+ choice_id_set.insert(
+ (*current_choice_set_it)[strings::choice_id].asInt());
+ if (!ins_res.second) {
+ LOG4CXX_ERROR(logger_,
+ "Choice with ID "
+ << (*current_choice_set_it)[strings::choice_id].asInt()
+ << " already exists");
+ return mobile_apis::Result::INVALID_ID;
+ }
+
+ if (IsWhiteSpaceExist(*current_choice_set_it)) {
+ LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ for (next_choice_set_it = current_choice_set_it + 1;
+ choice_set->end() != next_choice_set_it;
+ ++next_choice_set_it) {
+ if (compareSynonyms(*current_choice_set_it, *next_choice_set_it)) {
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+ }
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool CreateInteractionChoiceSetRequest::compareSynonyms(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice2) {
+ // only compare if they both have vr commands
+ if (!(choice1.keyExists(strings::vr_commands) &&
+ choice2.keyExists(strings::vr_commands))) {
+ return false; // clearly there isn't a duplicate if one of them is null
+ }
+ smart_objects::SmartArray* vr_cmds_1 =
+ choice1[strings::vr_commands].asArray();
+ smart_objects::SmartArray* vr_cmds_2 =
+ choice2[strings::vr_commands].asArray();
+
+ smart_objects::SmartArray::iterator it;
+ it = std::find_first_of(vr_cmds_1->begin(),
+ vr_cmds_1->end(),
+ vr_cmds_2->begin(),
+ vr_cmds_2->end(),
+ CreateInteractionChoiceSetRequest::compareStr);
+
+ if (it != vr_cmds_1->end()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming choice set has duplicated VR synonyms "
+ << it->asString());
+ return true;
+ }
+
+ return false;
+}
+
+bool CreateInteractionChoiceSetRequest::compareStr(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2) {
+ return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
+}
+
+bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
+ const smart_objects::SmartObject& choice_set) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = choice_set[strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed");
+ return true;
+ }
+
+ if (choice_set.keyExists(strings::secondary_text)) {
+ str = choice_set[strings::secondary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::tertiary_text)) {
+ str = choice_set[strings::tertiary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::vr_commands)) {
+ const size_t len = choice_set[strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = choice_set[strings::vr_commands][i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (choice_set.keyExists(strings::image)) {
+ str = choice_set[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::secondary_image)) {
+ str = choice_set[strings::secondary_image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid secondary_image value. "
+ "Syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params];
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::grammar_id] = choice_set[strings::grammar_id];
+ const uint32_t choice_count = choice_set[strings::choice_set].length();
+ SetAllowedToTerminate(false);
+
+ expected_chs_count_ = choice_count;
+ size_t chs_num = 0;
+ for (; chs_num < choice_count; ++chs_num) {
+ {
+ sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
+ if (error_from_hmi_) {
+ LOG4CXX_WARN(logger_,
+ "Error from HMI received. Stop sending VRCommands");
+ break;
+ }
+ }
+
+ msg_params[strings::cmd_id] =
+ choice_set[strings::choice_set][chs_num][strings::choice_id];
+ msg_params[strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands] =
+ choice_set[strings::choice_set][chs_num][strings::vr_commands];
+
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ const uint32_t vr_corr_id =
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true);
+
+ VRCommandInfo vr_command(vr_cmd_id);
+ sent_commands_map_[vr_corr_id] = vr_command;
+ LOG4CXX_DEBUG(logger_,
+ "VR_command sent corr_id " << vr_corr_id << " cmd_id "
+ << vr_corr_id);
+ }
+ expected_chs_count_ = chs_num;
+ LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
+}
+
+void CreateInteractionChoiceSetRequest::ProcessHmiError(
+ const hmi_apis::Common_Result::eType vr_result) {
+ LOG4CXX_DEBUG(logger_,
+ "Hmi response is not Success: "
+ << vr_result << ". Stop sending VRAddCommand requests");
+ if (!error_from_hmi_) {
+ error_from_hmi_ = true;
+ std::string info =
+ vr_result == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE
+ ? "VR is not supported by system"
+ : "";
+ SendResponse(false, GetMobileResultCode(vr_result), info.c_str());
+ }
+}
+
+bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
+ const uint32_t corr_id) {
+ SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
+ if (sent_commands_map_.end() == it) {
+ LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
+ return false;
+ }
+ VRCommandInfo& vr_command = it->second;
+ vr_command.succesful_response_received_ = true;
+ return true;
+}
+
+void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
+ received_chs_count_++;
+ LOG4CXX_DEBUG(logger_,
+ "Got VR.AddCommand response, there are "
+ << expected_chs_count_ - received_chs_count_
+ << " more to wait.");
+ if (received_chs_count_ < expected_chs_count_) {
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
+ } else {
+ OnAllHMIResponsesReceived();
+ }
+}
+
+void CreateInteractionChoiceSetRequest::on_event(
+ const event_engine::Event& event) {
+ using namespace hmi_apis;
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ const Common_Result::eType result = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool is_no_error = Compare<Common_Result::eType, EQ, ONE>(
+ result, Common_Result::SUCCESS, Common_Result::WARNINGS);
+ uint32_t corr_id = static_cast<uint32_t>(
+ message[strings::params][strings::correlation_id].asUInt());
+ if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ {
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ if (is_no_error) {
+ if (!ProcessSuccesfulHMIResponse(corr_id)) {
+ return;
+ }
+ } else {
+ ProcessHmiError(result);
+ }
+ }
+ CountReceivedVRResponses();
+ }
+}
+
+void CreateInteractionChoiceSetRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!error_from_hmi_) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ }
+ CommandRequestImpl::onTimeOut();
+ DeleteChoices();
+
+ // We have to keep request alive until receive all responses from HMI
+ // according to SDLAQ-CRS-2976
+ sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
+ is_timed_out_ = true;
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+bool CreateInteractionChoiceSetRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void CreateInteractionChoiceSetRequest::DeleteChoices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ application->RemoveChoiceSet(choice_set_id_);
+
+ smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
+ msg_param[strings::app_id] = application->app_id();
+
+ sync_primitives::AutoLock commands_lock(vr_commands_lock_);
+ SentCommandsMap::const_iterator it = sent_commands_map_.begin();
+ for (; it != sent_commands_map_.end(); ++it) {
+ const VRCommandInfo& vr_command_info = it->second;
+ if (vr_command_info.succesful_response_received_) {
+ msg_param[strings::cmd_id] = vr_command_info.cmd_id_;
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "succesful response has not been received for cmd_id = "
+ << vr_command_info.cmd_id_);
+ }
+ }
+ sent_commands_map_.clear();
+}
+
+void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!error_from_hmi_ && should_send_warnings_) {
+ SendResponse(true, mobile_apis::Result::WARNINGS, kInvalidImageWarningInfo);
+ } else if (!error_from_hmi_) {
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ } else {
+ DeleteChoices();
+ }
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..807770ed12
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {}
+
+void CreateInteractionChoiceSetResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
new file mode 100644
index 0000000000..38069c341e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
@@ -0,0 +1,235 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteCommandRequest::DeleteCommandRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , is_ui_send_(false)
+ , is_vr_send_(false)
+ , is_ui_received_(false)
+ , is_vr_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+DeleteCommandRequest::~DeleteCommandRequest() {}
+
+void DeleteCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const int32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asInt();
+
+ smart_objects::SmartObject* command = application->FindCommand(cmd_id);
+
+ if (!command) {
+ LOG4CXX_ERROR(logger_, "Command with id " << cmd_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ // we should specify amount of required responses in the 1st request
+ uint32_t chaining_counter = 0;
+ if ((*command).keyExists(strings::menu_params)) {
+ ++chaining_counter;
+ }
+
+ if ((*command).keyExists(strings::vr_commands)) {
+ ++chaining_counter;
+ }
+ /* Need to set all flags before sending request to HMI
+ * for correct processing this flags in method on_event */
+ if ((*command).keyExists(strings::menu_params)) {
+ is_ui_send_ = true;
+ }
+ // check vr params
+ if ((*command).keyExists(strings::vr_commands)) {
+ is_vr_send_ = true;
+ }
+ if (is_ui_send_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
+ }
+ if (is_vr_send_) {
+ // VR params
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
+ }
+}
+
+bool DeleteCommandRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ using namespace helpers;
+ app_mngr::commands::ResponseInfo ui_delete_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo vr_delete_info(
+ vr_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_delete_info, vr_delete_info);
+
+ const bool is_vr_or_ui_warning =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
+ info = app_mngr::commands::MergeInfos(
+ ui_delete_info, ui_info_, vr_delete_info, vr_info_);
+ if (is_vr_or_ui_warning && !ui_delete_info.is_unsupported_resource &&
+ !vr_delete_info.is_unsupported_resource) {
+ LOG4CXX_DEBUG(logger_, "VR or UI result is warning");
+ result_code = mobile_apis::Result::WARNINGS;
+ return result;
+ }
+ result_code = PrepareResultCodeForResponse(ui_delete_info, vr_delete_info);
+ LOG4CXX_DEBUG(logger_, "Result is " << (result ? "true" : "false"));
+ return result;
+}
+
+void DeleteCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_,
+ "Received UI_DeleteCommand event with result "
+ << MessageHelper::HMIResultToString(ui_result_));
+ GetInfo(message, ui_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_,
+ "Received VR_DeleteCommand event with result "
+ << MessageHelper::HMIResultToString(vr_result_));
+ GetInfo(message, vr_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Still awaiting for other responses.");
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ const uint32_t cmd_id = msg_params[strings::cmd_id].asUInt();
+
+ smart_objects::SmartObject* command = application->FindCommand(cmd_id);
+
+ if (!command) {
+ LOG4CXX_ERROR(logger_,
+ "Command id " << cmd_id << " not found for "
+ "application with connection key "
+ << connection_key());
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string info;
+ const bool result = PrepareResponseParameters(result_code, info);
+ if (result) {
+ application->RemoveCommand(cmd_id);
+ application->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
+ }
+ SendResponse(
+ result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
+}
+
+bool DeleteCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool DeleteCommandRequest::IsPendingResponseExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
new file mode 100644
index 0000000000..8f85d50e28
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteCommandResponse::DeleteCommandResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteCommandResponse::~DeleteCommandResponse() {}
+
+void DeleteCommandResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
new file mode 100644
index 0000000000..cf8a6d259f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc
@@ -0,0 +1,132 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteFileRequest::DeleteFileRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteFileRequest::~DeleteFileRequest() {}
+
+void DeleteFileRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (application_manager_.get_settings().delete_file_in_none() <=
+ application->delete_file_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ std::string full_file_path =
+ application_manager_.get_settings().app_storage_folder() + "/";
+ full_file_path += application->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (file_system::FileExists(full_file_path)) {
+ if (file_system::DeleteFile(full_file_path)) {
+ const application_manager::AppFile* file =
+ application->GetFile(full_file_path);
+ if (file) {
+ SendFileRemovedNotification(file);
+ }
+
+ application->DeleteFile(full_file_path);
+ application->increment_delete_file_in_none_count();
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ } else {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ }
+ } else {
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ }
+}
+
+void DeleteFileRequest::SendFileRemovedNotification(
+ const application_manager::AppFile* file) const {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::file_name] = file->file_name;
+ msg_params[strings::file_type] = file->file_type;
+
+ CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
+ msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
new file mode 100644
index 0000000000..66c61c9e4a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_file_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteFileResponse::DeleteFileResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteFileResponse::~DeleteFileResponse() {}
+
+void DeleteFileResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<uint32_t>(app->GetAvailableDiskSpace());
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..a9db3975db
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc
@@ -0,0 +1,168 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {}
+
+void DeleteInteractionChoiceSetRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "No application associated with connection key "
+ << connection_key());
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const int32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asInt();
+
+ if (!app->FindChoiceSet(choice_set_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (ChoiceSetInUse(app)) {
+ LOG4CXX_ERROR(logger_, "Choice set currently in use.");
+ SendResponse(false, mobile_apis::Result::IN_USE);
+ return;
+ }
+ SendVrDeleteCommand(app);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::interaction_choice_set_id] = choice_set_id;
+ msg_params[strings::app_id] = app->app_id();
+
+ app->RemoveChoiceSet(choice_set_id);
+
+ // Checking of HMI responses will be implemented with APPLINK-14600
+ const bool result = true;
+ SendResponse(result, mobile_apis::Result::SUCCESS);
+}
+
+bool DeleteInteractionChoiceSetRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app->is_perform_interaction_active()) {
+ return false;
+ }
+ const DataAccessor<PerformChoiceSetMap> accessor =
+ app->performinteraction_choice_set_map();
+ const PerformChoiceSetMap& choice_set_map = accessor.GetData();
+
+ const uint32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asUInt();
+
+ PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
+ for (; choice_set_map.end() != it; ++it) {
+ const PerformChoice& choice = it->second;
+ PerformChoice::const_iterator choice_it = choice.begin();
+ for (; choice.end() != choice_it; ++choice_it) {
+ if (choice_it->first == choice_set_id) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is in use.");
+ return true;
+ }
+ }
+ }
+ return true;
+}
+
+void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
+ application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t choice_set_id =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id]
+ .asUInt();
+
+ smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id);
+
+ if (!choice_set) {
+ LOG4CXX_ERROR(logger_,
+ "Choice set with id " << choice_set_id << " is not found.");
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
+ choice_set = &((*choice_set)[strings::choice_set]);
+ for (uint32_t i = 0; i < (*choice_set).length(); ++i) {
+ msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id];
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..18ca60f255
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc
@@ -0,0 +1,84 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {}
+
+void DeleteInteractionChoiceSetResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ const int32_t code =
+ (*message_)[strings::msg_params][strings::result_code].asInt();
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ SendResponse(true);
+ } else {
+ // TODO(DK): Some logic
+ SendResponse(false);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
new file mode 100644
index 0000000000..9a01163702
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
@@ -0,0 +1,203 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteSubMenuRequest::DeleteSubMenuRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteSubMenuRequest::~DeleteSubMenuRequest() {}
+
+void DeleteSubMenuRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ const int32_t menu_id =
+ (*message_)[strings::msg_params][strings::menu_id].asInt();
+
+ if (!app->FindSubMenu(menu_id)) {
+ LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] =
+ (*message_)[strings::msg_params][strings::menu_id];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::grammar_id] = app->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+ }
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuUICommands(
+ ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const DataAccessor<CommandsMap> accessor(app->commands_map());
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ while (commands.end() != it) {
+ if (!(*it->second).keyExists(strings::menu_params)) {
+ LOG4CXX_ERROR(logger_, "menu_params not exist");
+ ++it;
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt();
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::cmd_id] = cmd_id;
+ app->RemoveCommand(cmd_id);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
+ it = commands.begin(); // Can not relay on
+ // iterators after erase was called
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+ } else {
+ ++it;
+ }
+ }
+}
+
+void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ // delete sub menu items from SDL and HMI
+ DeleteSubMenuVRCommands(application);
+ DeleteSubMenuUICommands(application);
+ application->RemoveSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt());
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool DeleteSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
new file mode 100644
index 0000000000..6831a66e1e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DeleteSubMenuResponse::DeleteSubMenuResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DeleteSubMenuResponse::~DeleteSubMenuResponse() {}
+
+void DeleteSubMenuResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
new file mode 100644
index 0000000000..ee0297ded6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc
@@ -0,0 +1,156 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DialNumberRequest::DialNumberRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DialNumberRequest::~DialNumberRequest() {}
+
+bool DialNumberRequest::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ default_timeout_ = 0;
+
+ return true;
+}
+
+void DialNumberRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ std::string number =
+ (*message_)[strings::msg_params][strings::number].asString();
+ if (!CheckSyntax(number)) {
+ LOG4CXX_ERROR(logger_, "Invalid incoming data");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ StripNumberParam(number);
+ if (number.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "After strip number param is empty. Invalid incoming data");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::number] =
+ (*message_)[strings::msg_params][strings::number].asString();
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ SendHMIRequest(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true);
+}
+
+void DialNumberRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
+ LOG4CXX_INFO(logger_, "Received DialNumber event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ result_code = CommandRequestImpl::GetMobileResultCode(
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt()));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ const bool is_success = mobile_apis::Result::SUCCESS == result_code;
+ const bool is_info_valid =
+ message[strings::msg_params].keyExists(strings::info);
+
+ if (is_info_valid) {
+ const char* info_char_array =
+ message[strings::msg_params][strings::info].asCharArray();
+ SendResponse(is_success, result_code, info_char_array);
+ return;
+ }
+
+ SendResponse(is_success, result_code);
+}
+
+void DialNumberRequest::StripNumberParam(std::string& number) {
+ std::size_t found = 0;
+ while (std::string::npos !=
+ (found = number.find_first_not_of("0123456789*#,;+"))) {
+ number.erase(number.begin() + found);
+ }
+ (*message_)[strings::msg_params][strings::number] = number;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
new file mode 100644
index 0000000000..a264f96e0d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DialNumberResponse::DialNumberResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DialNumberResponse::~DialNumberResponse() {}
+
+void DialNumberResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..3650a8226c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc
@@ -0,0 +1,100 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+EndAudioPassThruRequest::EndAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
+
+void EndAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
+}
+
+void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ if (result) {
+ uint32_t app_id = connection_key();
+ bool ended_successfully = application_manager_.EndAudioPassThru(app_id);
+ if (ended_successfully) {
+ application_manager_.StopAudioPassThru(app_id);
+ }
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..f9f9f89d11
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+EndAudioPassThruResponse::EndAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+EndAudioPassThruResponse::~EndAudioPassThruResponse() {}
+
+void EndAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
new file mode 100644
index 0000000000..b0715225e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/generic_response.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void GenericResponse::Run() {
+ /*ns_smart_device_link::ns_smart_objects::SmartObject response;
+
+ response[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ response[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ response[strings::params][strings::connection_key] =
+ (*message_)[strings::params][strings::connection_key];
+
+ response[strings::msg_params][strings::success] = false;
+ */
+
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::msg_params][strings::success] = false;
+ (*message_)[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::INVALID_DATA;
+
+ SendResponse(false);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
new file mode 100644
index 0000000000..a6c627aad2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc
@@ -0,0 +1,143 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemCapabilityRequest::GetSystemCapabilityRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {}
+
+void GetSystemCapabilityRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ mobile_apis::SystemCapabilityType::eType response_type =
+ static_cast<mobile_apis::SystemCapabilityType::eType>(
+ (*message_)[strings::msg_params][strings::system_capability_type]
+ .asInt());
+ response_params[strings::system_capability][strings::system_capability_type] =
+ response_type;
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ switch (response_type) {
+ case mobile_apis::SystemCapabilityType::NAVIGATION: {
+ if (hmi_capabilities.navigation_capability()) {
+ response_params[strings::system_capability]
+ [strings::navigation_capability] =
+ *hmi_capabilities.navigation_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities.phone_capability()) {
+ response_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities.phone_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
+ if (!app->is_remote_control_supported()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ if (!hmi_capabilities.is_rc_cooperating()) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ if (hmi_capabilities.rc_capability()) {
+ response_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities.rc_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
+ if (hmi_capabilities.video_streaming_capability()) {
+ response_params[strings::system_capability]
+ [strings::video_streaming_capability] =
+ *hmi_capabilities.video_streaming_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ default: // Return unsupported resource
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+}
+
+void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event");
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
new file mode 100644
index 0000000000..dd5461081c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetSystemCapabilityResponse::GetSystemCapabilityResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {}
+
+void GetSystemCapabilityResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
new file mode 100644
index 0000000000..7dc9eb9ad9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc
@@ -0,0 +1,116 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetWayPointsRequest::GetWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+GetWayPointsRequest::~GetWayPointsRequest() {}
+
+void GetWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints,
+ msg_params.empty() ? NULL : &msg_params,
+ true);
+}
+
+void GetWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_GetWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
new file mode 100644
index 0000000000..7581990273
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetWayPointsResponse::GetWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetWayPointsResponse::~GetWayPointsResponse() {}
+
+void GetWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
new file mode 100644
index 0000000000..e671dab463
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc
@@ -0,0 +1,115 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/list_files_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "utils/file_system.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ListFilesRequest::ListFilesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ListFilesRequest::~ListFilesRequest() {}
+
+void ListFilesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (application_manager_.get_settings().list_files_in_none() <=
+ application->list_files_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ application->increment_list_files_in_none_count();
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<int32_t>(application->GetAvailableDiskSpace());
+ // Enumarating through File system
+ uint32_t i = 0;
+ std::string directory_name =
+ application_manager_.get_settings().app_storage_folder();
+ directory_name += "/" + application->folder_name();
+ std::vector<std::string> persistent_files =
+ file_system::ListFiles(directory_name);
+ std::vector<std::string>::const_iterator it = persistent_files.begin();
+ for (; it != persistent_files.end(); ++it) {
+ if (i < application_manager_.get_settings().list_files_response_size()) {
+ LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response");
+ (*message_)[strings::msg_params][strings::filenames][i++] = *it;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "File " + *it + " not added to ListFiles response");
+ }
+ }
+ (*message_)[strings::params][strings::message_type] =
+ application_manager::MessageType::kResponse;
+ SendResponse(true,
+ mobile_apis::Result::SUCCESS,
+ NULL,
+ &(*message_)[strings::msg_params]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
new file mode 100644
index 0000000000..d025f05358
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/list_files_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ListFilesResponse::ListFilesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ListFilesResponse::~ListFilesResponse() {}
+
+void ListFilesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
new file mode 100644
index 0000000000..128ce1e3bf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAppInterfaceUnregisteredNotification::
+ ~OnAppInterfaceUnregisteredNotification() {}
+
+void OnAppInterfaceUnregisteredNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
new file mode 100644
index 0000000000..ff88ae96bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc
@@ -0,0 +1,60 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnAudioPassThruNotification::OnAudioPassThruNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnAudioPassThruNotification::~OnAudioPassThruNotification() {}
+
+void OnAudioPassThruNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
new file mode 100644
index 0000000000..aeb53a115e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
@@ -0,0 +1,191 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnButtonEventNotification::~OnButtonEventNotification() {}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ const bool is_app_id_exists =
+ (*message_)[strings::msg_params].keyExists(strings::app_id);
+ ApplicationSharedPtr app;
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (!is_app_id_exists) {
+ LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id.");
+ return;
+ }
+
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false ==
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR(logger_,
+ "CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id =
+ (*message_)[strings::msg_params][hmi_response::custom_button_id]
+ .asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonEvent notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
+ SendButtonEvent(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribed_apps =
+ application_manager_.applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it =
+ subscribed_apps.begin();
+ for (; subscribed_apps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "OnButtonEvent notification is allowed only"
+ << "in FULL or LIMITED hmi level");
+ continue;
+ }
+ // if "app_id" absent send notification only in HMI_FULL mode
+ if (is_app_id_exists || subscribed_app->IsFullscreen()) {
+ SendButtonEvent(subscribed_app);
+ }
+ }
+}
+
+void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr on_btn_event =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_btn_event) {
+ LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_event)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() <= utils::version_4_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_event)[strings::msg_params][strings::button_name] = btn_id;
+ (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_ = on_btn_event;
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
new file mode 100644
index 0000000000..56a87da305
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
@@ -0,0 +1,199 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnButtonPressNotification::~OnButtonPressNotification() {}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const uint32_t btn_id = static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ const bool is_app_id_exists =
+ (*message_)[strings::msg_params].keyExists(strings::app_id);
+ ApplicationSharedPtr app;
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (!is_app_id_exists) {
+ LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id.");
+ return;
+ }
+
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false ==
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR(logger_,
+ "CUSTOM_BUTTON OnButtonPress without custom_button_id.");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id =
+ (*message_)[strings::msg_params][hmi_response::custom_button_id]
+ .asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonPress notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
+ SendButtonPress(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribed_apps =
+ application_manager_.applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it =
+ subscribed_apps.begin();
+ for (; subscribed_apps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "OnButtonPress notification is allowed only"
+ << "in FULL or LIMITED hmi level");
+ continue;
+ }
+ // if "appID" is present, send it to named app only if its FULL or
+ // LIMITED
+ if (app.use_count() != 0) {
+ if (app->app_id() == subscribed_app->app_id()) {
+ SendButtonPress(subscribed_app);
+ }
+ } else if (subscribed_app->IsFullscreen()) {
+ // if No "appID" - send it FULL apps only.
+ SendButtonPress(subscribed_app);
+ }
+ }
+}
+
+void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ smart_objects::SmartObjectSPtr on_btn_press =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_btn_press) {
+ LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_press)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() <= utils::version_4_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_press)[strings::msg_params][strings::button_name] = btn_id;
+ (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_ = on_btn_press;
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
new file mode 100644
index 0000000000..dff3aa6808
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc
@@ -0,0 +1,87 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnCommandNotification::OnCommandNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnCommandNotification::~OnCommandNotification() {}
+
+void OnCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ return;
+ }
+
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
+
+ if (!app->FindCommand(cmd_id)) {
+ LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id);
+ return;
+ }
+
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ // remove app_id from notification
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ (*message_)[strings::msg_params].erase(strings::app_id);
+ }
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..ca5d4bfed4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc
@@ -0,0 +1,70 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
new file mode 100644
index 0000000000..e252b031e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc
@@ -0,0 +1,84 @@
+
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include <string>
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnHashChangeNotification::OnHashChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHashChangeNotification::~OnHashChangeNotification() {}
+
+void OnHashChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ int32_t app_id;
+ app_id = (*message_)[strings::params][strings::connection_key].asInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (app) {
+ (*message_)[strings::msg_params][strings::hash_id] = app->curHash();
+ SendNotification();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Application with app_id " << app_id << " does not exist");
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
new file mode 100644
index 0000000000..6b5838e40a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
@@ -0,0 +1,95 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnHMIStatusNotification::OnHMIStatusNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHMIStatusNotification::~OnHMIStatusNotification() {}
+
+void OnHMIStatusNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
+ return;
+ }
+
+ // If the response has no hmi level, return and don't send the notification
+ if (!(*message_)[strings::msg_params].keyExists(strings::hmi_level)) {
+ // our notification clearly isn't well-formed
+ LOG4CXX_ERROR(logger_, "OnHMIStatusNotification has no hmiLevel field");
+ return;
+ }
+
+ // NOTE c++ maps default-construct on the [] operator, so if there is no
+ // hmiLevel field this will create one that is invalid
+ mobile_apis::HMILevel::eType hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::hmi_level].asInt());
+ if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
+ (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
+ if (!(app->tts_properties_in_full())) {
+ app->set_tts_properties_in_full(true);
+ LOG4CXX_INFO(logger_,
+ "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
+ application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id());
+ }
+ }
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
new file mode 100644
index 0000000000..c4ee22afed
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
@@ -0,0 +1,135 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {}
+
+void OnHMIStatusNotificationFromMobile::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(
+ logger_, "OnHMIStatusNotificationFromMobile application doesn't exist");
+ return;
+ }
+
+ mobile_apis::HMILevel::eType current_hmi_state =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::hmi_level].asUInt());
+
+ bool is_current_state_foreground =
+ mobile_apis::HMILevel::HMI_FULL == current_hmi_state;
+
+ app->set_foreground(is_current_state_foreground);
+
+ connection_handler::DeviceHandle handle = app->device();
+ bool is_apps_requested_before =
+ application_manager_.IsAppsQueriedFrom(handle);
+
+ LOG4CXX_DEBUG(logger_,
+ "Mobile HMI state notication came for connection key:"
+ << connection_key() << " and handle: " << handle);
+
+ if (!is_apps_requested_before &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version()) &&
+ app->is_foreground()) {
+ // In case this notification will be received from mobile side with
+ // foreground level for app on mobile, this should trigger remote
+ // apps list query for SDL 4.0+ app
+ MessageHelper::SendQueryApps(connection_key(), application_manager_);
+ return;
+ }
+
+ if (is_apps_requested_before) {
+ LOG4CXX_DEBUG(logger_,
+ "Remote apps list had been requested already "
+ " for handle: "
+ << handle);
+
+ if (Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version())) {
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+
+ bool is_another_foreground_sdl4_app = false;
+ ApplicationSetConstIt it = accessor.begin();
+ for (; accessor.end() != it; ++it) {
+ if (connection_key() != (*it)->app_id() &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ (*it)->protocol_version()) &&
+ (*it)->is_foreground()) {
+ is_another_foreground_sdl4_app = true;
+ break;
+ }
+ }
+
+ if (!is_another_foreground_sdl4_app) {
+ application_manager_.MarkAppsGreyOut(handle,
+ !is_current_state_foreground);
+ application_manager_.SendUpdateAppList();
+ }
+ }
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
new file mode 100644
index 0000000000..04b52f29e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnKeyBoardInputNotification::OnKeyBoardInputNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {}
+
+void OnKeyBoardInputNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app_to_notify;
+
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt it = accessor.GetData().begin();
+ for (; accessor.GetData().end() != it; ++it) {
+ // if there is app with active perform interaction use it for notification
+ ApplicationSharedPtr app = *it;
+ if (app->is_perform_interaction_active() &&
+ (*it)->perform_interaction_layout() ==
+ mobile_apis::LayoutMode::KEYBOARD) {
+ LOG4CXX_INFO(logger_,
+ "There is application with active PerformInteraction");
+ app_to_notify = app;
+ break;
+ }
+
+ if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level()) {
+ LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
+ app_to_notify = app;
+ }
+ }
+
+ if (app_to_notify.use_count() != 0) {
+ (*message_)[strings::params][strings::connection_key] =
+ app_to_notify->app_id();
+ SendNotification();
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
new file mode 100644
index 0000000000..fdbdd910a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnLanguageChangeNotification::OnLanguageChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnLanguageChangeNotification::~OnLanguageChangeNotification() {}
+
+void OnLanguageChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
new file mode 100644
index 0000000000..32d940aca2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnPermissionsChangeNotification::OnPermissionsChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {}
+
+void OnPermissionsChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
new file mode 100644
index 0000000000..b78e541f17
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -0,0 +1,229 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstring>
+#include <cstdio>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "policy/policy_table/enums.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+ using namespace mobile_apis;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (app.use_count() == 0) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key " << connection_key()
+ << " is not registered.");
+ return;
+ }
+
+ const mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message_)[strings::msg_params][strings::request_type].asInt());
+ const policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+ const std::string stringified_request_type =
+ rpc::policy_table_interface_base::EnumToJsonString(
+ static_cast<rpc::policy_table_interface_base::RequestType>(
+ request_type));
+
+ if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(),
+ request_type)) {
+ LOG4CXX_WARN(logger_,
+ "Request type " << stringified_request_type
+ << " is not allowed by policies");
+ return;
+ }
+
+ const bool request_subtype_present =
+ (*message_)[strings::msg_params].keyExists(strings::request_subtype);
+ if (request_subtype_present) {
+ const std::string request_subtype =
+ (*message_)[strings::msg_params][strings::request_subtype].asString();
+ if (!policy_handler.IsRequestSubTypeAllowed(app->policy_app_id(),
+ request_subtype)) {
+ LOG4CXX_ERROR(logger_,
+ "Request subtype: " << request_subtype
+ << " is DISALLOWED by policies");
+ return;
+ }
+ }
+
+ if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+ /* According to requirements:
+ "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
+ If the requestType = HTTP, add to mobile API fileType = BINARY"
+ Also in Genivi SDL we don't save the PT to file - we put it directly in
+ binary_data */
+
+ const std::string filename =
+ (*message_)[strings::msg_params][strings::file_name].asString();
+ BinaryMessage binary_data;
+ file_system::ReadBinaryFile(filename, binary_data);
+#if defined(PROPRIETARY_MODE)
+ AddHeader(binary_data);
+#endif // PROPRIETARY_MODE
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+#endif // PROPRIETARY_MODE
+
+ (*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
+ } else if (mobile_apis::RequestType::HTTP == request_type) {
+ (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
+ if ((*message_)[strings::msg_params].keyExists(strings::url)) {
+ (*message_)[strings::msg_params][strings::timeout] =
+ policy_handler.TimeoutExchangeSec();
+ }
+ }
+
+ SendNotification();
+}
+
+#ifdef PROPRIETARY_MODE
+void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t timeout = policy_handler_.TimeoutExchangeSec();
+
+ size_t content_length;
+ char size_str[24];
+
+ if (0 > sprintf(size_str, "%zu", static_cast<size_t>(message.size()))) {
+ memset(size_str, 0, sizeof(size_str));
+ }
+
+ char timeout_str[24];
+ if (0 > sprintf(timeout_str, "%d", timeout)) {
+ memset(timeout_str, 0, sizeof(timeout_str));
+ }
+
+ std::string policy_table_string = std::string(message.begin(), message.end());
+
+ /* The Content-Length to be sent in the HTTP Request header should be
+ calculated before additional escape characters are added to the
+ policy table string. The mobile proxy will remove the escape
+ characters after receiving this request. */
+
+ content_length = ParsePTString(policy_table_string);
+
+ if (0 > sprintf(size_str, "%zu", content_length)) {
+ memset(size_str, 0, sizeof(size_str));
+ }
+
+ const std::string header =
+
+ "{"
+ " \"HTTPRequest\": {"
+ "\"headers\": {"
+ "\"ContentType\": \"application/json\","
+ "\"ConnectTimeout\": " +
+ std::string(timeout_str) +
+ ","
+ "\"DoOutput\": true,"
+ "\"DoInput\": true,"
+ "\"UseCaches\": false,"
+ "\"RequestMethod\": \"POST\","
+ "\"ReadTimeout\":" +
+ std::string(timeout_str) +
+ ","
+ "\"InstanceFollowRedirects\": false,"
+ "\"charset\": \"utf-8\","
+ "\"Content-Length\": " +
+ std::string(size_str) +
+ "},"
+ "\"body\": \"" +
+ policy_table_string +
+ "\""
+ "}"
+ "}";
+
+ message.clear();
+ message.assign(header.begin(), header.end());
+
+ LOG4CXX_DEBUG(
+ logger_, "Header added: " << std::string(message.begin(), message.end()));
+}
+
+size_t OnSystemRequestNotification::ParsePTString(
+ std::string& pt_string) const {
+ std::string result;
+ size_t length = pt_string.length();
+ size_t result_length = length;
+ result.reserve(length * 2);
+ for (size_t i = 0; i < length; ++i) {
+ if (pt_string[i] == '\"' || pt_string[i] == '\\') {
+ result += '\\';
+ } else if (pt_string[i] == '\n') {
+ result_length--; // contentLength is adjusted when this character is
+ // not copied to result.
+ continue;
+ }
+ result += pt_string[i];
+ }
+ pt_string = result;
+ return result_length;
+}
+#endif // PROPRIETARY_MODE
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..503f1b04d5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnTBTClientStateNotification::OnTBTClientStateNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnTBTClientStateNotification::~OnTBTClientStateNotification() {}
+
+void OnTBTClientStateNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ application_manager_.applications_with_navi();
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
new file mode 100644
index 0000000000..502f0ae57d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
+
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace mobile {
+
+OnTouchEventNotification::OnTouchEventNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnTouchEventNotification::~OnTouchEventNotification() {}
+
+void OnTouchEventNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::vector<ApplicationSharedPtr>& applications_with_navi =
+ application_manager_.applications_with_navi();
+
+ const std::vector<ApplicationSharedPtr>& projection_applications =
+ application_manager_.applications_with_mobile_projection();
+
+ std::vector<ApplicationSharedPtr>::const_iterator nav_it =
+ applications_with_navi.begin();
+
+ for (; applications_with_navi.end() != nav_it; ++nav_it) {
+ ApplicationSharedPtr app = *nav_it;
+ if (app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+
+ std::vector<ApplicationSharedPtr>::const_iterator projection_it =
+ projection_applications.begin();
+
+ for (; projection_applications.end() != projection_it; ++projection_it) {
+ ApplicationSharedPtr projection_app = *projection_it;
+ if (projection_app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] =
+ projection_app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
new file mode 100644
index 0000000000..2f666ffc03
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc
@@ -0,0 +1,70 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h"
+#include "application_manager/application_manager.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+namespace commands {
+
+OnWayPointChangeNotification::OnWayPointChangeNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnWayPointChangeNotification::~OnWayPointChangeNotification() {}
+
+void OnWayPointChangeNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::set<uint32_t> subscribed_for_way_points =
+ application_manager_.GetAppsSubscribedForWayPoints();
+
+ for (std::set<uint32_t>::const_iterator app_id =
+ subscribed_for_way_points.begin();
+ app_id != subscribed_for_way_points.end();
+ ++app_id) {
+ (*message_)[strings::params][strings::connection_key] = *app_id;
+ SendNotification();
+ }
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..c90038a8b7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -0,0 +1,453 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstring>
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+PerformAudioPassThruRequest::PerformAudioPassThruRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
+ , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {}
+
+void PerformAudioPassThruRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ FinishTTSSpeak();
+ CommandRequestImpl::onTimeOut();
+}
+
+bool PerformAudioPassThruRequest::Init() {
+ default_timeout_ +=
+ (((*message_)[str::msg_params][str::max_duration].asUInt()));
+ return true;
+}
+
+void PerformAudioPassThruRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "application isn't activated");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform audio pass thru has contains "
+ "\\t\\n \\\\t \\\\n"
+ " text contains only whitespace in initialPrompt");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ // According with new implementation processing of UNSUPPORTE_RESOURCE
+ // need set flag before sending to hmi
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ if ((*message_)[str::msg_params].keyExists(str::initial_prompt)) {
+ smart_objects::SmartObject& initial_prompt =
+ (*message_)[strings::msg_params][strings::initial_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ initial_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(
+ false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for initial_prompt are not present");
+ return;
+ }
+
+ // In case TTS Speak, subscribe on notification
+ SendSpeakRequest();
+ SendPerformAudioPassThruRequest();
+ } else {
+ SendPerformAudioPassThruRequest();
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+ }
+}
+
+void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+ LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
+
+ // in case perform audio is started by other request skip stopping
+ if (hmi_apis::Common_Result::REJECTED == result_ui_) {
+ LOG4CXX_ERROR(logger_, "Request was rejected");
+ SendResponse(false,
+ MessageHelper::HMIToMobileResult(result_ui_),
+ NULL,
+ &(message[strings::msg_params]));
+ return;
+ }
+ FinishTTSSpeak();
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, tts_info_);
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool is_tts_speak_success_unsuported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_tts_speak_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (is_tts_speak_success_unsuported) {
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+
+ // update request timeout to get time for perform audio recording
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+ if (IsWaitingHMIResponse()) {
+ return;
+ }
+
+ const ResponseParams response_params = PrepareResponseParameters();
+
+ SendResponse(
+ response_params.success,
+ response_params.result_code,
+ response_params.info.empty() ? NULL : response_params.info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+const PerformAudioPassThruRequest::ResponseParams&
+PerformAudioPassThruRequest::PrepareResponseParameters() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ app_mngr::commands::ResponseInfo ui_perform_info(
+ result_ui_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_perform_info(
+ result_tts_speak_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+
+ // Note(dtrunov): According to requirment "WARNINGS, success:true on getting
+ // UNSUPPORTED_RESOURCE for "ttsChunks"
+ if (ui_perform_info.is_ok && tts_perform_info.is_unsupported_resource &&
+ HmiInterfaces::STATE_AVAILABLE == tts_perform_info.interface_state) {
+ response_params_.result_code = mobile_apis::Result::WARNINGS;
+ tts_info_ = "Unsupported phoneme type sent in a prompt";
+ response_params_.info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ response_params_.success = true;
+ return response_params_;
+ }
+
+ response_params_.success =
+ PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
+ if (IsResultCodeUnsupported(ui_perform_info, tts_perform_info)) {
+ response_params_.result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ } else {
+ AudioPassThruResults results = PrepareAudioPassThruResultCodeForResponse(
+ ui_perform_info, tts_perform_info);
+ response_params_.success = results.second;
+ response_params_.result_code = results.first;
+ }
+ response_params_.info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+
+ return response_params_;
+}
+
+void PerformAudioPassThruRequest::SendSpeakRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace hmi_apis;
+ using namespace smart_objects;
+
+ SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
+ for (uint32_t i = 0;
+ i < (*message_)[str::msg_params][str::initial_prompt].length();
+ ++i) {
+ msg_params[hmi_request::tts_chunks][i][str::text] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::text];
+ msg_params[hmi_request::tts_chunks][i][str::type] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::type];
+ }
+ // app_id
+ msg_params[strings::app_id] = connection_key();
+ msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
+}
+
+void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[str::app_id] = connection_key();
+
+ msg_params[hmi_request::max_duration] =
+ (*message_)[str::msg_params][str::max_duration];
+
+ msg_params[hmi_request::audio_pass_display_texts] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) {
+ msg_params[hmi_request::audio_pass_display_texts][0]
+ [hmi_request::field_name] = static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
+ msg_params[hmi_request::audio_pass_display_texts][0]
+ [hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text1];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) {
+ msg_params[hmi_request::audio_pass_display_texts][1]
+ [hmi_request::field_name] = static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
+ msg_params[hmi_request::audio_pass_display_texts][1]
+ [hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text2];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
+ msg_params[str::mute_audio] =
+ (*message_)[str::msg_params][str::mute_audio].asBool();
+ } else {
+ // If omitted, the value is set to true
+ msg_params[str::mute_audio] = true;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
+}
+
+void PerformAudioPassThruRequest::SendRecordStartNotification() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+
+ CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params);
+}
+
+void PerformAudioPassThruRequest::StartMicrophoneRecording() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id = connection_key();
+ application_manager_.BeginAudioPassThru(app_id);
+
+ application_manager_.StartAudioPassThruThread(
+ connection_key(),
+ correlation_id(),
+ (*message_)[str::msg_params][str::max_duration].asInt(),
+ (*message_)[str::msg_params][str::sampling_rate].asInt(),
+ (*message_)[str::msg_params][str::bits_per_sample].asInt(),
+ (*message_)[str::msg_params][str::audio_type].asInt());
+}
+
+bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (std::strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::audio_pass_display_text1)) {
+ str = (*message_)[strings::msg_params][strings::audio_pass_display_text1]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid audio_pass_display_text1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::audio_pass_display_text2)) {
+ str = (*message_)[strings::msg_params][strings::audio_pass_display_text2]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid audio_pass_display_text2 value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void PerformAudioPassThruRequest::FinishTTSSpeak() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id = connection_key();
+ if (application_manager_.EndAudioPassThru(app_id)) {
+ LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
+ application_manager_.StopAudioPassThru(app_id);
+ }
+ if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
+ LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
+ return;
+ }
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
+}
+
+PerformAudioPassThruRequest::AudioPassThruResults
+PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse(
+ const app_mngr::commands::ResponseInfo& ui_response,
+ const app_mngr::commands::ResponseInfo& tts_response) {
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ hmi_apis::Common_Result::eType common_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ const hmi_apis::Common_Result::eType ui_result = ui_response.result_code;
+ const hmi_apis::Common_Result::eType tts_result = tts_response.result_code;
+ bool result = false;
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::SUCCESS)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::INVALID_ENUM)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::INVALID_ENUM)) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_response.is_ok &&
+ tts_result == hmi_apis::Common_Result::WARNINGS) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_result == hmi_apis::Common_Result::INVALID_ENUM) {
+ common_result = tts_result;
+ } else {
+ common_result = ui_result;
+ }
+ result_code = MessageHelper::HMIToMobileResult(common_result);
+ return std::make_pair(result_code, result);
+}
+
+bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..a5eb98f2ba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PerformAudioPassThruResponse::PerformAudioPassThruResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {}
+
+void PerformAudioPassThruResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
new file mode 100644
index 0000000000..42489fd8bd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
@@ -0,0 +1,1068 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <numeric>
+#include <string.h>
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+#include "utils/gen_hash.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+uint32_t PerformInteractionRequest::pi_requests_count_ = 0;
+
+PerformInteractionRequest::PerformInteractionRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
+ , ui_response_received_(false)
+ , vr_response_received_(false)
+ , app_pi_was_active_before_(false)
+ , vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
+ , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
+ subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+}
+
+PerformInteractionRequest::~PerformInteractionRequest() {}
+
+bool PerformInteractionRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+
+ interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ default_timeout_ *= 2;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_perform_interaction_active()) {
+ LOG4CXX_DEBUG(logger_, "Application has active PerformInteraction");
+ app_pi_was_active_before_ = true;
+ }
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ mobile_apis::LayoutMode::eType interaction_layout =
+ mobile_apis::LayoutMode::INVALID_ENUM;
+
+ if (msg_params.keyExists(hmi_request::interaction_layout)) {
+ interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
+ msg_params[hmi_request::interaction_layout].asInt());
+ }
+
+ if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) &&
+ (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction contains InteractionMode"
+ "=VR_ONLY and interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ const size_t choice_set_id_list_length =
+ msg_params[strings::interaction_choice_set_id_list].length();
+
+ if (0 == choice_set_id_list_length) {
+ if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) {
+ if (mobile_apis::InteractionMode::BOTH == interaction_mode_) {
+ LOG4CXX_ERROR(logger_,
+ "interactionChoiceSetIDList is empty,"
+ " InteractionMode=BOTH and"
+ " interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "interactionChoiceSetIDList is empty"
+ " and interactionLayout!=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (!CheckChoiceIDFromRequest(
+ app,
+ choice_set_id_list_length,
+ msg_params[strings::interaction_choice_set_id_list])) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction has choice sets with "
+ "duplicated IDs or application does not have choice sets");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImageVrHelpItems(
+ msg_params[strings::vr_help], app, application_manager_)) {
+ LOG4CXX_ERROR(logger_,
+ "Verification of " << strings::vr_help << " failed.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform interaction has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
+ !CheckVrHelpItemPositions(app)) {
+ return;
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
+ return;
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown interaction mode");
+ return;
+ }
+ }
+
+ app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
+ app->set_perform_interaction_active(true);
+ app->set_perform_interaction_layout(interaction_layout);
+ // increment amount of active requests
+ ++pi_requests_count_;
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
+}
+
+void PerformInteractionRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ smart_objects::SmartObject msg_param =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ ui_response_received_ = true;
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, ui_info_);
+ ProcessUIResponse(event.smart_object(), msg_param);
+ break;
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ vr_response_received_ = true;
+ unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
+ vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt());
+ GetInfo(message, vr_info_);
+ if (ProcessVRResponse(event.smart_object(), msg_param)) {
+ return;
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+
+ if (!HasHMIResponsesToWait()) {
+ LOG4CXX_DEBUG(logger_, "Send response in BOTH iteraction mode");
+ SendBothModeResponse(msg_param);
+ }
+}
+
+void PerformInteractionRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
+ if (true == vr_response_received_) {
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ } else {
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY");
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "INVALID ENUM");
+ return;
+ }
+ };
+}
+
+bool PerformInteractionRequest::ProcessVRResponse(
+ const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ using namespace mobile_apis;
+ using namespace smart_objects;
+ using namespace helpers;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ msg_params[strings::trigger_source] =
+ static_cast<int32_t>(TriggerSource::TS_VR);
+
+ const bool is_vr_aborted_timeout = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT);
+
+ if (is_vr_aborted_timeout) {
+ LOG4CXX_DEBUG(logger_, "VR response aborted");
+ if (InteractionMode::VR_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup");
+ TerminatePerformInteraction();
+ SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
+ return true;
+ }
+ LOG4CXX_DEBUG(logger_, "Update timeout for UI");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ return false;
+ }
+
+ const SmartObject& hmi_msg_params = message[strings::msg_params];
+ if (hmi_msg_params.keyExists(strings::choice_id)) {
+ const int choice_id = hmi_msg_params[strings::choice_id].asInt();
+ if (!CheckChoiceIDFromResponse(app, choice_id)) {
+ LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
+ TerminatePerformInteraction();
+ SendResponse(
+ false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
+ return true;
+ }
+ msg_params[strings::choice_id] = choice_id;
+ }
+
+ const bool is_vr_result_success = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::SUCCESS, Common_Result::WARNINGS);
+
+ if (is_vr_result_success &&
+ InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_,
+ "VR response is successfull in MANUAL_ONLY mode "
+ << "Wait for UI response");
+ // in case MANUAL_ONLY mode VR.PI SUCCESS just return
+ return false;
+ }
+
+ return false;
+}
+
+void PerformInteractionRequest::ProcessUIResponse(
+ const smart_objects::SmartObject& message,
+ smart_objects::SmartObject& msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ using namespace smart_objects;
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ HmiInterfaces::InterfaceState ui_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI);
+ bool result = false;
+ result = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS);
+
+ result = result ||
+ (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_code_ &&
+ HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state);
+
+ const bool is_pi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::WARNINGS);
+
+ const bool is_pi_unsupported =
+ Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
+
+ if (result) {
+ if (is_pi_unsupported) {
+ ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ } else {
+ if (message.keyExists(strings::msg_params)) {
+ msg_params = message[strings::msg_params];
+ }
+ if (is_pi_warning) {
+ ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ }
+ }
+
+ // result code must be GENERIC_ERROR in case wrong choice_id
+ if (msg_params.keyExists(strings::choice_id)) {
+ if (!CheckChoiceIDFromResponse(app,
+ msg_params[strings::choice_id].asInt())) {
+ ui_result_code_ = hmi_apis::Common_Result::GENERIC_ERROR;
+ ui_info_ = "Wrong choiceID was received from HMI";
+ } else {
+ msg_params[strings::trigger_source] =
+ mobile_apis::TriggerSource::TS_MENU;
+ }
+ } else if (msg_params.keyExists(strings::manual_text_entry)) {
+ msg_params[strings::trigger_source] =
+ mobile_apis::TriggerSource::TS_KEYBOARD;
+ if (msg_params[strings::manual_text_entry].empty()) {
+ msg_params.erase(strings::manual_text_entry);
+ }
+ }
+ }
+}
+
+void PerformInteractionRequest::SendUIPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::initial_text][hmi_request::field_name] =
+ static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::initialInteractionText);
+ msg_params[hmi_request::initial_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][hmi_request::initial_text];
+ }
+ bool is_vr_help_item = false;
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != mode) {
+ msg_params[strings::vr_help_title] =
+ (*message_)[strings::msg_params][strings::initial_text].asString();
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ is_vr_help_item = true;
+ msg_params[strings::vr_help] =
+ (*message_)[strings::msg_params][strings::vr_help];
+ }
+ }
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_ / 2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+ msg_params[strings::app_id] = app->app_id();
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[strings::choice_set] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ int32_t index_array_of_vr_help = 0;
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_set_id_list[i].asInt());
+ if (choice_set) {
+ // save perform interaction choice set
+ app->AddPerformInteractionChoiceSet(
+ correlation_id(), choice_set_id_list[i].asInt(), *choice_set);
+ for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ size_t index = msg_params[strings::choice_set].length();
+ msg_params[strings::choice_set][index] =
+ (*choice_set)[strings::choice_set][j];
+ // vrCommands should be added via VR.AddCommand only
+ msg_params[strings::choice_set][index].erase(strings::vr_commands);
+ }
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != mode &&
+ !is_vr_help_item) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = vr_commands[0].asString();
+ item[strings::position] = index_array_of_vr_help + 1;
+ msg_params[strings::vr_help][index_array_of_vr_help++] = item;
+ }
+ }
+ }
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_request::interaction_layout) &&
+ mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::interaction_layout] =
+ (*message_)[strings::msg_params][hmi_request::interaction_layout]
+ .asInt();
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true);
+}
+
+void PerformInteractionRequest::SendVRPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) {
+ msg_params[strings::grammar_id] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t grammar_id_index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+ if (!choice_set) {
+ LOG4CXX_WARN(logger_, "Couldn't found choiceset");
+ continue;
+ }
+ msg_params[strings::grammar_id][grammar_id_index++] =
+ (*choice_set)[strings::grammar_id].asUInt();
+ }
+ }
+
+ std::vector<std::string> invalid_params;
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+ smart_objects::SmartObject& help_prompt =
+ (*message_)[strings::msg_params][strings::help_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("help_prompt");
+ } else {
+ msg_params[strings::help_prompt] = help_prompt;
+ }
+ } else {
+ if (choice_list.length() != 0) {
+ msg_params[strings::help_prompt] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ int32_t index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ if (choice_set) {
+ for (uint32_t j = 0; j < (*choice_set)[strings::choice_set].length();
+ ++j) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ // Since there is no custom data from application side, SDL should
+ // construct prompt and append delimiter to each item
+ item[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ item[strings::text] =
+ vr_commands[0].asString() +
+ application_manager_.get_settings().tts_delimiter();
+ msg_params[strings::help_prompt][index++] = item;
+ }
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Can't found choiceSet!");
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ smart_objects::SmartObject& timeout_prompt =
+ (*message_)[strings::msg_params][strings::timeout_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ timeout_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("timeout_prompt");
+ } else {
+ msg_params[strings::timeout_prompt] = timeout_prompt;
+ }
+ } else {
+ if (msg_params.keyExists(strings::help_prompt)) {
+ msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt];
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ smart_objects::SmartObject& initial_prompt =
+ (*message_)[strings::msg_params][strings::initial_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ initial_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("initial_prompt");
+ } else {
+ msg_params[strings::initial_prompt] = initial_prompt;
+ }
+ }
+
+ if (!invalid_params.empty()) {
+ const std::string params_list =
+ std::accumulate(std::begin(invalid_params),
+ std::end(invalid_params),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ const std::string info =
+ "One or more files needed for " + params_list + " are not present";
+ SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, info.c_str());
+ return;
+ }
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_ / 2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
+ SendHMIRequest(
+ hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true);
+}
+
+bool PerformInteractionRequest::CheckChoiceSetMenuNames(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set =
+ app->FindChoiceSet(choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if (!i_choice_set || !j_choice_set) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ const std::string& ii_menu_name =
+ (*i_choice_set)[strings::choice_set][ii][strings::menu_name]
+ .asString();
+ const std::string& jj_menu_name =
+ (*j_choice_set)[strings::choice_set][jj][strings::menu_name]
+ .asString();
+
+ if (ii_menu_name == jj_menu_name) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name");
+ SendResponse(false,
+ mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated menu name");
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set =
+ app->FindChoiceSet(choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if ((!i_choice_set) || (!j_choice_set)) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ if (!((*i_choice_set)[strings::choice_set][ii].keyExists(
+ strings::vr_commands) &&
+ (*j_choice_set)[strings::choice_set][jj].keyExists(
+ strings::vr_commands))) {
+ LOG4CXX_DEBUG(logger_,
+ "One or both sets has missing vr commands, skipping "
+ "synonym check");
+ return true;
+ }
+ // choice_set pointer contains SmartObject msg_params
+ smart_objects::SmartObject& ii_vr_commands =
+ (*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
+
+ smart_objects::SmartObject& jj_vr_commands =
+ (*j_choice_set)[strings::choice_set][jj][strings::vr_commands];
+
+ for (size_t iii = 0; iii < ii_vr_commands.length(); ++iii) {
+ for (size_t jjj = 0; jjj < jj_vr_commands.length(); ++jjj) {
+ const custom_str::CustomString& vr_cmd_i =
+ ii_vr_commands[iii].asCustomString();
+ const custom_str::CustomString& vr_cmd_j =
+ jj_vr_commands[jjj].asCustomString();
+ if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym");
+ SendResponse(false,
+ mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated VR synonym");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool PerformInteractionRequest::CheckVrHelpItemPositions(
+ application_manager::ApplicationSharedPtr const app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ LOG4CXX_DEBUG(logger_, strings::vr_help << " is omitted.");
+ return true;
+ }
+
+ smart_objects::SmartObject& vr_help =
+ (*message_)[strings::msg_params][strings::vr_help];
+
+ int32_t position = 1;
+ for (size_t i = 0; i < vr_help.length(); ++i) {
+ if (position != vr_help[i][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Non-sequential vrHelp item position");
+ return false;
+ }
+ ++position;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::DisablePerformInteraction() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (app->is_perform_interaction_active()) {
+ // decrease amount of active requests
+ --pi_requests_count_;
+ if (!pi_requests_count_) {
+ app->set_perform_interaction_active(false);
+ app->set_perform_interaction_mode(-1);
+ }
+ }
+ app->DeletePerformInteractionChoiceSet(correlation_id());
+}
+
+bool PerformInteractionRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ (*message_)[strings::msg_params][strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ (*message_)[strings::msg_params][strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ (*message_)[strings::msg_params][strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+void PerformInteractionRequest::TerminatePerformInteraction() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[hmi_request::method_name] = "UI.PerformInteraction";
+ SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params);
+ DisablePerformInteraction();
+}
+
+bool PerformInteractionRequest::CheckChoiceIDFromResponse(
+ ApplicationSharedPtr app, int32_t choice_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const DataAccessor<PerformChoiceSetMap> accessor =
+ app->performinteraction_choice_set_map();
+ const PerformChoiceSetMap& choice_set_map = accessor.GetData();
+
+ PerformChoiceSetMap::const_iterator choice_set_map_it =
+ choice_set_map.find(correlation_id());
+ if (choice_set_map.end() != choice_set_map_it) {
+ const PerformChoice& choice = choice_set_map_it->second;
+ PerformChoice::const_iterator it = choice.begin();
+ for (; choice.end() != it; ++it) {
+ const smart_objects::SmartObject& choice_set =
+ (*it->second).getElement(strings::choice_set);
+ for (size_t j = 0; j < choice_set.length(); ++j) {
+ if (choice_id ==
+ choice_set.getElement(j).getElement(strings::choice_id).asInt()) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+bool PerformInteractionRequest::CheckChoiceSetListVRCommands(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject* choice_set = nullptr;
+
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
+
+ // this should never ever happen since this was already checked
+ if (choice_set == nullptr) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ const smart_objects::SmartObject& choices_list =
+ (*choice_set)[strings::choice_set];
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(choices_list);
+
+ // if not all choices have vr commands
+ if (vr_status != MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction has choice sets with "
+ "missing vrCommands, not in MANUAL_ONLY mode");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Some choices don't contain VR commands.");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool PerformInteractionRequest::CheckChoiceIDFromRequest(
+ ApplicationSharedPtr app,
+ const size_t choice_set_id_list_length,
+ const smart_objects::SmartObject& choice_set_id_list) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ size_t choice_list_length = 0;
+ std::set<uint32_t> choice_id_set;
+ smart_objects::SmartObject* choice_set = 0;
+ std::pair<std::set<uint32_t>::iterator, bool> ins_res;
+
+ for (size_t i = 0; i < choice_set_id_list_length; ++i) {
+ choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
+ if (!choice_set) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
+ return false;
+ }
+
+ choice_list_length = (*choice_set)[strings::choice_set].length();
+ const smart_objects::SmartObject& choices_list =
+ (*choice_set)[strings::choice_set];
+ for (size_t k = 0; k < choice_list_length; ++k) {
+ ins_res =
+ choice_id_set.insert(choices_list[k][strings::choice_id].asInt());
+ if (!ins_res.second) {
+ LOG4CXX_ERROR(logger_,
+ "choice with ID "
+ << choices_list[k][strings::choice_id].asInt()
+ << " already exists");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return !ui_response_received_ || !vr_response_received_;
+}
+
+void PerformInteractionRequest::SendBothModeResponse(
+ const smart_objects::SmartObject& msg_param) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_apis::Result::eType perform_interaction_result_code =
+ mobile_apis::Result::INVALID_ENUM;
+ app_mngr::commands::ResponseInfo ui_perform_info(
+ ui_result_code_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo vr_perform_info(
+ vr_result_code_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_perform_info, vr_perform_info);
+ perform_interaction_result_code =
+ PrepareResultCodeForResponse(ui_perform_info, vr_perform_info);
+ const smart_objects::SmartObject* response_params =
+ msg_param.empty() ? NULL : &msg_param;
+ std::string info = app_mngr::commands::MergeInfos(
+ ui_perform_info, ui_info_, vr_perform_info, vr_info_);
+ DisablePerformInteraction();
+ SendResponse(result,
+ perform_interaction_result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
new file mode 100644
index 0000000000..85bef9b2ad
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PerformInteractionResponse::PerformInteractionResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PerformInteractionResponse::~PerformInteractionResponse() {}
+
+void PerformInteractionResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
new file mode 100644
index 0000000000..b418f52fa3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
@@ -0,0 +1,324 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/put_file_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+#include "utils/file_system.h"
+#include <boost/crc.hpp>
+
+namespace {
+/**
+* Calculates CRC32 checksum
+* @param binary_data - input data for which CRC32 should be calculated
+* @return calculated CRC32 checksum
+*/
+uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
+ const std::size_t file_size = binary_data.size();
+ boost::crc_32_type result;
+ result.process_bytes(&binary_data[0], file_size);
+ return result.checksum();
+}
+
+} // namespace
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PutFileRequest::PutFileRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , offset_(0)
+ , sync_file_name_()
+ , length_(0)
+ , file_type_(mobile_apis::FileType::INVALID_ENUM)
+ , is_persistent_file_(false) {}
+
+PutFileRequest::~PutFileRequest() {}
+
+void PutFileRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
+ application_manager_.get_settings().put_file_in_none() <=
+ application->put_file_in_none_count()) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // PutFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Too many requests from the app with HMILevel HMI_NONE",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::params].keyExists(strings::binary_data)) {
+ LOG4CXX_ERROR(logger_, "Binary data empty");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Binary data empty",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) {
+ LOG4CXX_ERROR(logger_, "No file name");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "No file name",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) {
+ LOG4CXX_ERROR(logger_, "No file type");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "No file type",
+ &response_params);
+ return;
+ }
+ sync_file_name_ =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name_)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ err_msg.c_str(),
+ &response_params);
+ return;
+ }
+
+ file_type_ = static_cast<mobile_apis::FileType::eType>(
+ (*message_)[strings::msg_params][strings::file_type].asInt());
+ const std::vector<uint8_t> binary_data =
+ (*message_)[strings::params][strings::binary_data].asBinary();
+
+ // Policy table update in json format is currently to be received via PutFile
+ // TODO(PV): after latest discussion has to be changed
+ if (mobile_apis::FileType::JSON == file_type_) {
+ policy_handler_.ReceiveMessageFromSDK(sync_file_name_, binary_data);
+ }
+
+ offset_ = 0;
+ is_persistent_file_ = false;
+ bool is_system_file = false;
+ length_ = binary_data.size();
+ bool is_download_complete = true;
+ bool offset_exist =
+ (*message_)[strings::msg_params].keyExists(strings::offset);
+
+ if (offset_exist) {
+ offset_ = (*message_)[strings::msg_params][strings::offset].asInt();
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::persistent_file)) {
+ is_persistent_file_ =
+ (*message_)[strings::msg_params][strings::persistent_file].asBool();
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::system_file)) {
+ is_system_file =
+ (*message_)[strings::msg_params][strings::system_file].asBool();
+ }
+
+ std::string file_path;
+
+ if (is_system_file) {
+ response_params[strings::space_available] = 0;
+ file_path = application_manager_.get_settings().system_files_path();
+ } else {
+ file_path = application_manager_.get_settings().app_storage_folder();
+ file_path += "/" + application->folder_name();
+
+ uint32_t space_available = application->GetAvailableDiskSpace();
+
+ if (binary_data.size() > space_available) {
+ response_params[strings::space_available] =
+ static_cast<uint32_t>(space_available);
+
+ LOG4CXX_ERROR(logger_, "Out of memory");
+ SendResponse(false,
+ mobile_apis::Result::OUT_OF_MEMORY,
+ "Out of memory",
+ &response_params);
+ return;
+ }
+ }
+
+ if (!file_system::CreateDirectoryRecursively(file_path)) {
+ LOG4CXX_ERROR(logger_, "Can't create folder");
+ SendResponse(false,
+ mobile_apis::Result::GENERIC_ERROR,
+ "Can't create folder.",
+ &response_params);
+ return;
+ }
+ const std::string full_path = file_path + "/" + sync_file_name_;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) {
+ LOG4CXX_TRACE(logger_, "Binary Data Size: " << binary_data.size());
+ const uint32_t crc_received =
+ (*message_)[strings::msg_params][strings::crc32_check_sum].asUInt();
+ LOG4CXX_TRACE(logger_, "CRC32 SUM Received: " << crc_received);
+ const uint32_t crc_calculated = GetCrc32CheckSum(binary_data);
+ LOG4CXX_TRACE(logger_, "CRC32 SUM Calculated: " << crc_calculated);
+ if (crc_calculated != crc_received) {
+ SendResponse(false,
+ mobile_apis::Result::CORRUPTED_DATA,
+ "CRC Check on file failed. File upload has been cancelled, "
+ "please retry.",
+ &response_params);
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Writing " << binary_data.size() << " bytes to " << full_path
+ << " (current size is"
+ << file_system::FileSize(full_path) << ")");
+
+ mobile_apis::Result::eType save_result = application_manager_.SaveBinary(
+ binary_data, file_path, sync_file_name_, offset_);
+
+ LOG4CXX_DEBUG(logger_,
+ "New size of " << full_path << " is "
+ << file_system::FileSize(full_path) << " bytes");
+ if (!is_system_file) {
+ response_params[strings::space_available] =
+ static_cast<uint32_t>(application->GetAvailableDiskSpace());
+ }
+
+ sync_file_name_ = file_path + "/" + sync_file_name_;
+ switch (save_result) {
+ case mobile_apis::Result::SUCCESS: {
+ LOG4CXX_INFO(logger_, "PutFile is successful");
+ if (!is_system_file) {
+ AppFile file(sync_file_name_,
+ is_persistent_file_,
+ is_download_complete,
+ file_type_);
+
+ if (0 == offset_) {
+ LOG4CXX_INFO(logger_, "New file downloading");
+ if (!application->AddFile(file)) {
+ LOG4CXX_INFO(logger_,
+ "Couldn't add file to application (File already Exist"
+ << " in application and was rewritten on FS)");
+ /* It can be first part of new big file, so we need to update
+ information about it's downloading status and persistence */
+ if (!application->UpdateFile(file)) {
+ LOG4CXX_ERROR(logger_, "Couldn't update file");
+ /* If it is impossible to update file, application doesn't
+ know about existing this file */
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Couldn't update file",
+ &response_params);
+ return;
+ }
+ } else {
+ /* if file added - increment it's count
+ ( may be application->AddFile have to incapsulate it? )
+ Any way now this method evals not only in "none"*/
+ application->increment_put_file_in_none_count();
+ }
+ }
+ }
+
+ SendResponse(true, save_result, "File was downloaded", &response_params);
+ if (is_system_file) {
+ SendOnPutFileNotification();
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_,
+ "PutFile is unsuccessful. Result = " << save_result);
+ SendResponse(false, save_result, "Can't save file", &response_params);
+ break;
+ }
+}
+
+void PutFileRequest::SendOnPutFileNotification() {
+ LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& message = *notification;
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile;
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ message[strings::msg_params][strings::app_id] = connection_key();
+ message[strings::msg_params][strings::sync_file_name] = sync_file_name_;
+ message[strings::msg_params][strings::offset] = offset_;
+ if (0 == offset_ &&
+ !(*message_)[strings::msg_params].keyExists(strings::length)) {
+ message[strings::msg_params][strings::file_size] = length_;
+ }
+ message[strings::msg_params][strings::length] = length_;
+ message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
+ message[strings::msg_params][strings::file_type] = file_type_;
+ rpc_service_.ManageHMICommand(notification);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
new file mode 100644
index 0000000000..8c54970a5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/put_file_response.h"
+#include "utils/file_system.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+PutFileResponse::PutFileResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+PutFileResponse::~PutFileResponse() {}
+
+void PutFileResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
new file mode 100644
index 0000000000..9cfd4f33b5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -0,0 +1,1429 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h"
+
+#include <unistd.h>
+#include <algorithm>
+#include <map>
+#include <string.h>
+
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/rpc_service.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/generated_msg_version.h"
+#include "utils/file_system.h"
+
+namespace {
+namespace custom_str = utils::custom_string;
+
+mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
+ if ("DEFAULT" == str) {
+ return mobile_apis::AppHMIType::DEFAULT;
+ } else if ("COMMUNICATION" == str) {
+ return mobile_apis::AppHMIType::COMMUNICATION;
+ } else if ("MEDIA" == str) {
+ return mobile_apis::AppHMIType::MEDIA;
+ } else if ("MESSAGING" == str) {
+ return mobile_apis::AppHMIType::MESSAGING;
+ } else if ("NAVIGATION" == str) {
+ return mobile_apis::AppHMIType::NAVIGATION;
+ } else if ("INFORMATION" == str) {
+ return mobile_apis::AppHMIType::INFORMATION;
+ } else if ("SOCIAL" == str) {
+ return mobile_apis::AppHMIType::SOCIAL;
+ } else if ("BACKGROUND_PROCESS" == str) {
+ return mobile_apis::AppHMIType::BACKGROUND_PROCESS;
+ } else if ("TESTING" == str) {
+ return mobile_apis::AppHMIType::TESTING;
+ } else if ("SYSTEM" == str) {
+ return mobile_apis::AppHMIType::SYSTEM;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
+ } else if ("REMOTE_CONTROL" == str) {
+ return mobile_apis::AppHMIType::REMOTE_CONTROL;
+ } else {
+ return mobile_apis::AppHMIType::INVALID_ENUM;
+ }
+}
+
+std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
+ const std::map<mobile_apis::AppHMIType::eType, std::string> app_hmi_type_map =
+ {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"},
+ {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"},
+ {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"},
+ {mobile_apis::AppHMIType::MEDIA, "MEDIA"},
+ {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"},
+ {mobile_apis::AppHMIType::NAVIGATION, "NAVIGATION"},
+ {mobile_apis::AppHMIType::INFORMATION, "INFORMATION"},
+ {mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
+ {mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
+ {mobile_apis::AppHMIType::TESTING, "TESTING"},
+ {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"},
+ {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}};
+
+ std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
+ app_hmi_type_map.find(type);
+
+ return app_hmi_type_map.end() != iter ? iter->second : std::string("");
+}
+
+struct AppHMITypeInserter {
+ AppHMITypeInserter(smart_objects::SmartObject& so_array)
+ : index_(0), so_array_(so_array) {}
+
+ bool operator()(const std::string& app_hmi_type) {
+ so_array_[index_] = StringToAppHMIType(app_hmi_type);
+ ++index_;
+ return true;
+ }
+
+ private:
+ uint32_t index_;
+ smart_objects::SmartObject& so_array_;
+};
+
+struct CheckMissedTypes {
+ CheckMissedTypes(const policy::StringArray& policy_app_types,
+ std::string& log)
+ : policy_app_types_(policy_app_types), log_(log) {}
+
+ bool operator()(const smart_objects::SmartArray::value_type& value) {
+ std::string app_type_str = AppHMITypeToString(
+ static_cast<mobile_apis::AppHMIType::eType>(value.asInt()));
+ if (!app_type_str.empty()) {
+ policy::StringArray::const_iterator it = policy_app_types_.begin();
+ policy::StringArray::const_iterator it_end = policy_app_types_.end();
+ for (; it != it_end; ++it) {
+ if (app_type_str == *it) {
+ return true;
+ }
+ }
+ }
+
+ log_ += app_type_str;
+ log_ += ",";
+
+ return true;
+ }
+
+ private:
+ const policy::StringArray& policy_app_types_;
+ std::string& log_;
+};
+
+class SmartArrayValueExtractor {
+ public:
+ AppHmiType operator()(const smart_objects::SmartObject& so) const {
+ return static_cast<AppHmiType>(so.asInt());
+ }
+};
+
+struct IsSameNickname {
+ IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
+ bool operator()(const policy::StringArray::value_type& nickname) const {
+ return app_id_.CompareIgnoreCase(nickname.c_str());
+ }
+
+ private:
+ const custom_str::CustomString& app_id_;
+};
+}
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , result_code_(mobile_apis::Result::INVALID_ENUM) {}
+
+RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
+
+bool RegisterAppInterfaceRequest::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+void RegisterAppInterfaceRequest::Run() {
+ using namespace helpers;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Connection key is " << connection_key());
+
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation specific to customer is used in order to
+ // exclude hit code
+ // to RTC
+ // FIXME(EZamakhov): on shutdown - get freez
+
+ // wait till HMI started
+ while (!application_manager_.IsStopping() &&
+ !application_manager_.IsHMICooperating()) {
+ LOG4CXX_DEBUG(logger_,
+ "Waiting for the HMI... conn_key="
+ << connection_key()
+ << ", correlation_id=" << correlation_id()
+ << ", default_timeout=" << default_timeout()
+ << ", thread=" << pthread_self());
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ sleep(1);
+ // TODO(DK): timer_->StartWait(1);
+ }
+
+ if (application_manager_.IsStopping()) {
+ LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
+ return;
+ }
+
+ if (IsApplicationSwitched()) {
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return;
+ }
+ // cache the original app ID (for legacy behavior)
+ const std::string policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ // transform app IDs to lowercase for usage in policy checks later
+ const std::string app_id_short = msg_params[strings::app_id].asString();
+ std::string new_app_id_short = app_id_short;
+ std::transform(app_id_short.begin(),
+ app_id_short.end(),
+ new_app_id_short.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::app_id] = new_app_id_short;
+ // If full ID is present, shift that to lowercase too
+ if (msg_params.keyExists(strings::full_app_id)) {
+ const std::string app_id_full = msg_params[strings::full_app_id].asString();
+ std::string new_app_id_full = app_id_full;
+ std::transform(app_id_full.begin(),
+ app_id_full.end(),
+ new_app_id_full.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::full_app_id] = new_app_id_full;
+ }
+ if (application_manager_.IsApplicationForbidden(connection_key(),
+ policy_app_id)) {
+ SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS);
+ return;
+ }
+
+ if (IsApplicationWithSameAppIdRegistered()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ mobile_apis::Result::eType policy_result = CheckWithPolicyData();
+
+ if (Compare<mobile_apis::Result::eType, NEQ, ALL>(
+ policy_result,
+ mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WARNINGS)) {
+ SendResponse(false, policy_result);
+ return;
+ }
+
+ mobile_apis::Result::eType coincidence_result = CheckCoincidence();
+
+ if (mobile_apis::Result::SUCCESS != coincidence_result) {
+ LOG4CXX_ERROR(logger_, "Coincidence check failed.");
+ if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
+ usage_statistics::AppCounter count_of_rejections_duplicate_name(
+ GetPolicyHandler().GetStatisticManager(),
+ policy_app_id,
+ usage_statistics::REJECTIONS_DUPLICATE_NAME);
+ ++count_of_rejections_duplicate_name;
+ }
+ SendResponse(false, coincidence_result);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming register app interface has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ uint16_t major =
+ msg_params[strings::sync_msg_version][strings::major_version].asUInt();
+ uint16_t minor =
+ msg_params[strings::sync_msg_version][strings::minor_version].asUInt();
+ uint16_t patch = 0;
+ // Check if patch exists since it is not mandatory.
+ if (msg_params[strings::sync_msg_version].keyExists(strings::patch_version)) {
+ patch =
+ msg_params[strings::sync_msg_version][strings::patch_version].asUInt();
+ }
+
+ utils::SemanticVersion mobile_version(major, minor, patch);
+ utils::SemanticVersion min_module_version(
+ minimum_major_version, minimum_minor_version, minimum_patch_version);
+
+ if (mobile_version < min_module_version) {
+ LOG4CXX_WARN(logger_,
+ "Application RPC Version does not meet minimum requirement");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ }
+
+ application = application_manager_.RegisterApplication(message_);
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application hasn't been registered!");
+ return;
+ }
+
+ // Version negotiation
+ utils::SemanticVersion ver_4_5(4, 5, 0);
+ utils::SemanticVersion module_version(
+ major_version, minor_version, patch_version);
+ if (mobile_version <= ver_4_5) {
+ // Mobile versioning did not exist for
+ // versions 4.5 and prior.
+ application->set_msg_version(ver_4_5);
+ } else if (mobile_version < module_version) {
+ // Use mobile RPC version as negotiated version
+ application->set_msg_version(mobile_version);
+ } else {
+ // Use module version as negotiated version
+ application->set_msg_version(module_version);
+ }
+
+ // For resuming application need to restore hmi_app_id from resumeCtrl
+ resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+ const std::string& device_mac = application->mac_address();
+
+ // there is side affect with 2 mobile app with the same mobile app_id
+ if (resumer.IsApplicationSaved(policy_app_id, device_mac)) {
+ application->set_hmi_application_id(
+ resumer.GetHMIApplicationID(policy_app_id, device_mac));
+ } else {
+ application->set_hmi_application_id(
+ application_manager_.GenerateNewHMIAppID());
+ }
+
+ application->set_is_media_application(
+ msg_params[strings::is_media_application].asBool());
+
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ application->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ application->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ if (msg_params.keyExists(strings::tts_name)) {
+ smart_objects::SmartObject& tts_name =
+ (*message_)[strings::msg_params][strings::tts_name];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ tts_name, application, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_WARN(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ response_info_ = "One or more files needed for tts_name are not present";
+ result_code_ = mobile_apis::Result::WARNINGS;
+ }
+ application->set_tts_name(tts_name);
+ }
+
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ application->set_app_types(msg_params[strings::app_hmi_type]);
+
+ // check app type
+ const smart_objects::SmartObject& app_type =
+ msg_params.getElement(strings::app_hmi_type);
+
+ for (size_t i = 0; i < app_type.length(); ++i) {
+ mobile_apis::AppHMIType::eType current_app_type =
+ static_cast<mobile_apis::AppHMIType::eType>(
+ app_type.getElement(i).asUInt());
+
+ switch (current_app_type) {
+ case mobile_apis::AppHMIType::NAVIGATION: {
+ application->set_is_navi(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::COMMUNICATION: {
+ application->set_voice_communication_supported(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::PROJECTION: {
+ application->set_mobile_projection_enabled(true);
+ break;
+ }
+ case mobile_apis::AppHMIType::REMOTE_CONTROL: {
+ application->set_remote_control_supported(true);
+ break;
+ }
+ default: {}
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::day_color_scheme)) {
+ application->set_day_color_scheme(msg_params[strings::day_color_scheme]);
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme)) {
+ application->set_night_color_scheme(
+ msg_params[strings::night_color_scheme]);
+ }
+
+ // Add device to policy table and set device info, if any
+ policy::DeviceParams dev_params;
+ if (-1 ==
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(application->device(),
+ &dev_params.device_name,
+ NULL,
+ &dev_params.device_mac_address,
+ &dev_params.device_connection_type)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to extract information for device "
+ << application->device());
+ }
+ policy::DeviceInfo device_info;
+ device_info.AdoptDeviceType(dev_params.device_connection_type);
+ if (msg_params.keyExists(strings::device_info)) {
+ FillDeviceInfo(&device_info);
+ }
+
+ GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
+
+ SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
+ smart_objects::SmartObjectSPtr so =
+ GetLockScreenIconUrlNotification(connection_key(), application);
+ rpc_service_.ManageMobileCommand(so, SOURCE_SDL);
+ application_manager_.SendDriverDistractionState(application);
+}
+
+smart_objects::SmartObjectSPtr
+RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
+ const uint32_t connection_key, ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr());
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemRequestID;
+ (*message)[strings::params][strings::connection_key] = connection_key;
+ (*message)[strings::params][strings::message_type] =
+ mobile_apis::messageType::notification;
+ (*message)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message)[strings::params][strings::protocol_version] = protocol_version_;
+ (*message)[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::LOCK_SCREEN_ICON_URL;
+ (*message)[strings::msg_params][strings::url] =
+ GetPolicyHandler().GetLockScreenIconUrl();
+ return message;
+}
+
+void FillVRRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_vr_language();
+ if (hmi_capabilities.vr_capabilities()) {
+ response_params[strings::vr_capabilities] =
+ *hmi_capabilities.vr_capabilities();
+ }
+}
+
+void FillVIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ if (hmi_capabilities.vehicle_type()) {
+ response_params[hmi_response::vehicle_type] =
+ *hmi_capabilities.vehicle_type();
+ }
+}
+
+void FillTTSRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::language] = hmi_capabilities.active_tts_language();
+ if (hmi_capabilities.speech_capabilities()) {
+ response_params[strings::speech_capabilities] =
+ *hmi_capabilities.speech_capabilities();
+ }
+ if (hmi_capabilities.prerecorded_speech()) {
+ response_params[strings::prerecorded_speech] =
+ *(hmi_capabilities.prerecorded_speech());
+ }
+}
+
+void FillUIRelatedFields(smart_objects::SmartObject& response_params,
+ const HMICapabilities& hmi_capabilities) {
+ response_params[strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+ if (hmi_capabilities.display_capabilities()) {
+ response_params[hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& display_caps =
+ response_params[hmi_response::display_capabilities];
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::display_type)) {
+ display_caps[hmi_response::display_type] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::display_type);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::display_name)) {
+ display_caps[hmi_response::display_name] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::display_name);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::text_fields)) {
+ display_caps[hmi_response::text_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::text_fields);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::image_fields)) {
+ display_caps[hmi_response::image_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::image_fields);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::media_clock_formats)) {
+ display_caps[hmi_response::media_clock_formats] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::media_clock_formats);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::templates_available)) {
+ display_caps[hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::screen_params)) {
+ display_caps[hmi_response::screen_params] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::screen_params);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::num_custom_presets_available)) {
+ display_caps[hmi_response::num_custom_presets_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::num_custom_presets_available);
+ }
+
+ if (hmi_capabilities.display_capabilities()->keyExists(
+ hmi_response::image_capabilities)) {
+ display_caps[hmi_response::graphic_supported] =
+ (hmi_capabilities.display_capabilities()
+ ->getElement(hmi_response::image_capabilities)
+ .length() > 0);
+ }
+ }
+
+ if (hmi_capabilities.audio_pass_thru_capabilities()) {
+ if (smart_objects::SmartType_Array ==
+ hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
+ // hmi_capabilities json contains array and HMI response object
+ response_params[strings::audio_pass_thru_capabilities] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ } else {
+ response_params[strings::audio_pass_thru_capabilities][0] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ }
+ }
+ response_params[strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_params[strings::hmi_capabilities][strings::navigation] =
+ hmi_capabilities.navigation_supported();
+ response_params[strings::hmi_capabilities][strings::phone_call] =
+ hmi_capabilities.phone_call_supported();
+ response_params[strings::hmi_capabilities][strings::video_streaming] =
+ hmi_capabilities.video_streaming_supported();
+ response_params[strings::hmi_capabilities][strings::remote_control] =
+ hmi_capabilities.rc_supported();
+}
+
+void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
+ ApplicationType app_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ const uint32_t key = connection_key();
+ ApplicationSharedPtr application = application_manager_.application(key);
+
+ resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "There is no application for such connection key" << key);
+ LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer");
+ resumer.OnAppRegistrationEnd();
+ return;
+ }
+
+ utils::SemanticVersion negotiated_version = application->msg_version();
+
+ response_params[strings::sync_msg_version][strings::major_version] =
+ negotiated_version.major_version_;
+ response_params[strings::sync_msg_version][strings::minor_version] =
+ negotiated_version.minor_version_;
+ response_params[strings::sync_msg_version][strings::patch_version] =
+ negotiated_version.patch_version_;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params[strings::language_desired].asInt() !=
+ hmi_capabilities.active_vr_language() ||
+ msg_params[strings::hmi_display_language_desired].asInt() !=
+ hmi_capabilities.active_ui_language()) {
+ LOG4CXX_WARN(logger_,
+ "Wrong language on registering application "
+ << application->name().c_str());
+
+ LOG4CXX_ERROR(
+ logger_,
+ "VR language desired code is "
+ << msg_params[strings::language_desired].asInt()
+ << " , active VR language code is "
+ << hmi_capabilities.active_vr_language() << ", UI language code is "
+ << msg_params[strings::hmi_display_language_desired].asInt()
+ << " , active UI language code is "
+ << hmi_capabilities.active_ui_language());
+
+ result_code = mobile_apis::Result::WRONG_LANGUAGE;
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS)) {
+ FillTTSRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VR)) {
+ FillVRRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_UI)) {
+ FillUIRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ FillVIRelatedFields(response_params, hmi_capabilities);
+ }
+
+ if (hmi_capabilities.button_capabilities()) {
+ response_params[hmi_response::button_capabilities] =
+ *hmi_capabilities.button_capabilities();
+ }
+
+ if (hmi_capabilities.soft_button_capabilities()) {
+ response_params[hmi_response::soft_button_capabilities] =
+ *hmi_capabilities.soft_button_capabilities();
+ }
+
+ if (hmi_capabilities.preset_bank_capabilities()) {
+ response_params[hmi_response::preset_bank_capabilities] =
+ *hmi_capabilities.preset_bank_capabilities();
+ }
+
+ if (hmi_capabilities.hmi_zone_capabilities()) {
+ if (smart_objects::SmartType_Array ==
+ hmi_capabilities.hmi_zone_capabilities()->getType()) {
+ // hmi_capabilities json contains array and HMI response object
+ response_params[hmi_response::hmi_zone_capabilities] =
+ *hmi_capabilities.hmi_zone_capabilities();
+ } else {
+ response_params[hmi_response::hmi_zone_capabilities][0] =
+ *hmi_capabilities.hmi_zone_capabilities();
+ }
+ }
+
+ if (hmi_capabilities.pcm_stream_capabilities()) {
+ response_params[strings::pcm_stream_capabilities] =
+ *hmi_capabilities.pcm_stream_capabilities();
+ }
+
+ const std::vector<uint32_t>& diag_modes =
+ application_manager_.get_settings().supported_diag_modes();
+ if (!diag_modes.empty()) {
+ std::vector<uint32_t>::const_iterator it = diag_modes.begin();
+ uint32_t index = 0;
+ for (; it != diag_modes.end(); ++it) {
+ response_params[strings::supported_diag_modes][index] = *it;
+ ++index;
+ }
+ }
+
+ response_params[strings::sdl_version] =
+ application_manager_.get_settings().sdl_version();
+ const std::string ccpu_version = hmi_capabilities_.ccpu_version();
+ if (!ccpu_version.empty()) {
+ response_params[strings::system_software_version] = ccpu_version;
+ }
+
+ if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport, "
+ "but doesn't have correct hashID.");
+
+ application_manager::DeleteApplicationData(application,
+ application_manager_);
+
+ SendResponse(
+ true, mobile_apis::Result::RESUME_FAILED, NULL, &response_params);
+ return;
+ }
+
+ if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport "
+ "and has correct hashID.");
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ return;
+ }
+
+ bool resumption =
+ (*message_)[strings::msg_params].keyExists(strings::hash_id);
+
+ bool need_restore_vr = resumption;
+
+ std::string hash_id;
+ std::string add_info;
+ if (resumption) {
+ hash_id = (*message_)[strings::msg_params][strings::hash_id].asString();
+ if (!resumer.CheckApplicationHash(application, hash_id)) {
+ LOG4CXX_WARN(logger_,
+ "Hash from RAI does not match to saved resume data.");
+ result_code = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Hash from RAI does not match to saved resume data.";
+ need_restore_vr = false;
+ } else if (!resumer.CheckPersistenceFilesForResumption(application)) {
+ LOG4CXX_WARN(logger_, "Persistent data is missing.");
+ result_code = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Persistent data is missing.";
+ need_restore_vr = false;
+ } else {
+ add_info = "Resume succeeded.";
+ }
+ }
+ if ((mobile_apis::Result::SUCCESS == result_code) &&
+ (mobile_apis::Result::INVALID_ENUM != result_code_)) {
+ add_info += response_info_;
+ result_code = result_code_;
+ }
+
+ // in case application exist in resumption we need to send resumeVrgrammars
+ if (false == resumption) {
+ resumption = resumer.IsApplicationSaved(application->policy_app_id(),
+ application->mac_address());
+ }
+
+ AppHmiTypes hmi_types;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ smart_objects::SmartArray* hmi_types_ptr =
+ (*message_)[strings::msg_params][strings::app_hmi_type].asArray();
+ DCHECK_OR_RETURN_VOID(hmi_types_ptr);
+ SmartArrayValueExtractor extractor;
+ if (hmi_types_ptr && 0 < hmi_types_ptr->size()) {
+ std::transform(hmi_types_ptr->begin(),
+ hmi_types_ptr->end(),
+ std::back_inserter(hmi_types),
+ extractor);
+ }
+ }
+ policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication(
+ application->policy_app_id(), hmi_types);
+
+ response_params[strings::icon_resumed] =
+ file_system::FileExists(application->app_icon_path());
+
+ SendResponse(true, result_code, add_info.c_str(), &response_params);
+ SendOnAppRegisteredNotificationToHMI(
+ *(application.get()), resumption, need_restore_vr);
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
+ &(msg_params[strings::app_hmi_type]));
+ }
+
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ application_manager_.OnApplicationRegistered(application);
+ (*notify_upd_manager)();
+
+ // Start PTU after successfull registration
+ // Sends OnPermissionChange notification to mobile right after RAI response
+ // and HMI level set-up
+ GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
+
+ if (result_code != mobile_apis::Result::RESUME_FAILED) {
+ resumer.StartResumption(application, hash_id);
+ } else {
+ resumer.StartResumptionOnlyHMILevel(application);
+ }
+
+ // By default app subscribed to CUSTOM_BUTTON
+ SendSubscribeCustomButtonNotification();
+ SendChangeRegistrationOnHMI(application);
+}
+
+void RegisterAppInterfaceRequest::SendChangeRegistration(
+ const hmi_apis::FunctionID::eType function_id,
+ const int32_t language,
+ const uint32_t app_id) {
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ONE;
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceID interface =
+ hmi_interfaces.GetInterfaceFromFunction(function_id);
+ if (hmi_interfaces.GetInterfaceState(interface) !=
+ HmiInterfaces::STATE_NOT_AVAILABLE) {
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::language] = language;
+ msg_params[strings::app_id] = app_id;
+ SendHMIRequest(function_id, &msg_params);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable");
+ }
+}
+
+void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
+ ApplicationConstSharedPtr app) {
+ using namespace hmi_apis::FunctionID;
+ DCHECK_OR_RETURN_VOID(app);
+ DCHECK_OR_RETURN_VOID(mobile_apis::Language::INVALID_ENUM != app->language());
+ SendChangeRegistration(VR_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(
+ TTS_ChangeRegistration, app->language(), app->app_id());
+ SendChangeRegistration(UI_ChangeRegistration, app->language(), app->app_id());
+}
+
+void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
+ const app_mngr::Application& application_impl,
+ bool resumption,
+ bool need_restore_vr) {
+ using namespace smart_objects;
+ SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map);
+ if (!notification) {
+ LOG4CXX_ERROR(logger_, "Failed to create smart object");
+ return;
+ }
+
+ (*notification)[strings::params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& params = (*notification)[strings::params];
+ params[strings::function_id] = static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ params[strings::message_type] = static_cast<int32_t>(kNotification);
+ params[strings::protocol_version] = protocol_version_;
+ params[strings::protocol_type] = hmi_protocol_type_;
+
+ (*notification)[strings::msg_params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& msg_params = (*notification)[strings::msg_params];
+ // Due to current requirements in case when we're in resumption mode
+ // we have to always send resumeVRGrammar field.
+ if (resumption) {
+ msg_params[strings::resume_vr_grammars] = need_restore_vr;
+ }
+
+ if (application_impl.vr_synonyms()) {
+ msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
+ }
+
+ if (application_impl.tts_name()) {
+ msg_params[strings::tts_name] = *(application_impl.tts_name());
+ }
+
+ const std::string policy_app_id = application_impl.policy_app_id();
+ std::string priority;
+ GetPolicyHandler().GetPriority(policy_app_id, &priority);
+
+ if (!priority.empty()) {
+ msg_params[strings::priority] = MessageHelper::GetPriorityCode(priority);
+ }
+
+ msg_params[strings::msg_params] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& application = msg_params[strings::application];
+ application[strings::app_name] = application_impl.name();
+ application[strings::app_id] = application_impl.app_id();
+ application[hmi_response::policy_app_id] = policy_app_id;
+ if (file_system::FileExists(application_impl.app_icon_path())) {
+ application[strings::icon] = application_impl.app_icon_path();
+ }
+
+ const smart_objects::SmartObject* ngn_media_screen_name =
+ application_impl.ngn_media_screen_name();
+ if (ngn_media_screen_name) {
+ application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name;
+ }
+
+ application[strings::hmi_display_language_desired] =
+ static_cast<int32_t>(application_impl.ui_language());
+
+ application[strings::is_media_application] =
+ application_impl.is_media_application();
+
+ const smart_objects::SmartObject* app_type = application_impl.app_types();
+ if (app_type) {
+ application[strings::app_type] = *app_type;
+ }
+
+ const policy::RequestType::State app_request_types_state =
+ GetPolicyHandler().GetAppRequestTypeState(policy_app_id);
+ if (policy::RequestType::State::AVAILABLE == app_request_types_state) {
+ const auto request_types =
+ GetPolicyHandler().GetAppRequestTypes(policy_app_id);
+ application[strings::request_type] = SmartObject(SmartType_Array);
+ smart_objects::SmartObject& request_types_array =
+ application[strings::request_type];
+
+ size_t index = 0;
+ for (auto it : request_types) {
+ request_types_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestType::State::EMPTY == app_request_types_state) {
+ application[strings::request_type] = SmartObject(SmartType_Array);
+ }
+
+ const policy::RequestSubType::State app_request_subtypes_state =
+ GetPolicyHandler().GetAppRequestSubTypeState(policy_app_id);
+ if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) {
+ const auto request_subtypes =
+ GetPolicyHandler().GetAppRequestSubTypes(policy_app_id);
+ application[strings::request_subtype] = SmartObject(SmartType_Array);
+ smart_objects::SmartObject& request_subtypes_array =
+ application[strings::request_subtype];
+
+ size_t index = 0;
+ for (auto it : request_subtypes) {
+ request_subtypes_array[index] = it;
+ ++index;
+ }
+ } else if (policy::RequestSubType::State::EMPTY ==
+ app_request_subtypes_state) {
+ application[strings::request_subtype] = SmartObject(SmartType_Array);
+ }
+
+ const protocol_handler::SessionObserver& session_observer =
+ application_manager_.connection_handler().get_session_observer();
+
+ application[strings::device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& device_info = application[strings::device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &device_info);
+
+ if (application_impl.secondary_device() != 0) {
+ application[strings::secondary_device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ application[strings::secondary_device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.secondary_device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &secondary_device_info);
+ }
+
+ const smart_objects::SmartObject* day_color_scheme =
+ application_impl.day_color_scheme();
+ if (day_color_scheme) {
+ application[strings::day_color_scheme] = *day_color_scheme;
+ }
+
+ const smart_objects::SmartObject* night_color_scheme =
+ application_impl.night_color_scheme();
+ if (night_color_scheme) {
+ application[strings::night_color_scheme] = *night_color_scheme;
+ }
+
+ DCHECK(rpc_service_.ManageHMICommand(notification));
+}
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSet accessor = application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = accessor.begin();
+ const custom_str::CustomString& app_name =
+ msg_params[strings::app_name].asCustomString();
+
+ for (; accessor.end() != it; ++it) {
+ // name check
+ const custom_str::CustomString& cur_name = (*it)->name();
+ if (app_name.CompareIgnoreCase(cur_name)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+
+ } // application for end
+
+ return mobile_apis::Result::SUCCESS;
+} // method end
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(AOleynik): Check is necessary to allow register application in case
+ // of disabled policy
+ // Remove this check, when HMI will support policy
+ if (!GetPolicyHandler().PolicyEnabled()) {
+ return mobile_apis::Result::WARNINGS;
+ }
+
+ smart_objects::SmartObject& message = *message_;
+ policy::StringArray app_nicknames;
+ policy::StringArray app_hmi_types;
+
+ const std::string mobile_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+ const bool init_result = GetPolicyHandler().GetInitialAppData(
+ mobile_app_id, &app_nicknames, &app_hmi_types);
+
+ if (!init_result) {
+ LOG4CXX_ERROR(logger_, "Error during initial application data check.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if (!app_nicknames.empty()) {
+ IsSameNickname compare(
+ message[strings::msg_params][strings::app_name].asCustomString());
+ policy::StringArray::const_iterator it =
+ std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
+ if (app_nicknames.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Application name was not found in nicknames list.");
+ // App should be unregistered, if its name is not present in nicknames
+ // list
+ usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
+ GetPolicyHandler().GetStatisticManager(),
+ mobile_app_id,
+ usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
+ ++count_of_rejections_nickname_mismatch;
+ return mobile_apis::Result::DISALLOWED;
+ }
+ }
+
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
+
+ // If AppHMIType is not included in policy - allow any type
+ if (!app_hmi_types.empty()) {
+ if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ // If AppHmiTypes are partially same, the system should allow those listed
+ // in the policy table and send warning info on missed values
+ smart_objects::SmartArray app_types =
+ *(message[strings::msg_params][strings::app_hmi_type].asArray());
+
+ std::string log;
+ CheckMissedTypes checker(app_hmi_types, log);
+ std::for_each(app_types.begin(), app_types.end(), checker);
+ if (!log.empty()) {
+ response_info_ =
+ "Following AppHmiTypes are not present in policy "
+ "table:" +
+ log;
+ result_code_ = mobile_apis::Result::WARNINGS;
+ }
+ }
+ // Replace AppHmiTypes in request with values allowed by policy table
+ message[strings::msg_params][strings::app_hmi_type] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& app_hmi_type =
+ message[strings::msg_params][strings::app_hmi_type];
+
+ AppHMITypeInserter inserter(app_hmi_type);
+ std::for_each(app_hmi_types.begin(), app_hmi_types.end(), inserter);
+ }
+
+ return result;
+}
+
+void RegisterAppInterfaceRequest::FillDeviceInfo(
+ policy::DeviceInfo* device_info) {
+ const std::string hardware = "hardware";
+ const std::string firmware_rev = "firmwareRev";
+ const std::string os = "os";
+ const std::string os_ver = "osVersion";
+ const std::string carrier = "carrier";
+ const std::string max_number_rfcom_ports = "maxNumberRFCOMMPorts";
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ const smart_objects::SmartObject& device_info_so =
+ msg_params[strings::device_info];
+
+ if (device_info_so.keyExists(hardware)) {
+ device_info->hardware =
+ msg_params[strings::device_info][hardware].asString();
+ }
+ if (device_info_so.keyExists(firmware_rev)) {
+ device_info->firmware_rev =
+ msg_params[strings::device_info][firmware_rev].asString();
+ }
+ if (device_info_so.keyExists(os)) {
+ device_info->os = device_info_so[os].asString();
+ }
+ if (device_info_so.keyExists(os_ver)) {
+ device_info->os_ver = device_info_so[os_ver].asString();
+ }
+ if (device_info_so.keyExists(carrier)) {
+ device_info->carrier = device_info_so[carrier].asString();
+ }
+ if (device_info_so.keyExists(max_number_rfcom_ports)) {
+ device_info->max_number_rfcom_ports =
+ device_info_so[max_number_rfcom_ports].asInt();
+ }
+}
+
+bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const custom_string::CustomString mobile_app_id(
+ application_manager_.GetCorrectMobileIDFromMessage(message_));
+
+ const ApplicationSet& applications =
+ application_manager_.applications().GetData();
+
+ ApplicationSetConstIt it = applications.begin();
+ ApplicationSetConstIt it_end = applications.end();
+
+ for (; it != it_end; ++it) {
+ if (mobile_app_id.CompareIgnoreCase((*it)->policy_app_id().c_str())) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ str = (*message_)[strings::msg_params][strings::hash_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::hardware)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::hardware].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info hardware syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::firmware_rev)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::firmware_rev].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info firmware_rev syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::os)) {
+ str = (*message_)[strings::msg_params][strings::device_info][strings::os]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid device_info os syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::os_version)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::os_version].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info os_version syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].keyExists(
+ strings::carrier)) {
+ str = (*message_)[strings::msg_params][strings::device_info]
+ [strings::carrier].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info carrier syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ str = (*message_)[strings::msg_params][strings::app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+
+ if (application_manager_.get_settings().use_full_app_id()) {
+ if ((*message_)[strings::msg_params].keyExists(strings::full_app_id)) {
+ str =
+ (*message_)[strings::msg_params][strings::full_app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
+ smart_objects::SmartObject& vehicle_type,
+ const std::string& param,
+ const std::string& backup_value) {
+ using namespace hmi_response;
+ if (!vehicle_type.keyExists(param) || vehicle_type[param].empty()) {
+ if (!backup_value.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ param << " is missing."
+ "Will be replaced with policy table value.");
+ vehicle_type[param] = backup_value;
+ } else {
+ vehicle_type.erase(param);
+ }
+ }
+}
+
+void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = Common_ButtonName::CUSTOM_BUTTON;
+ msg_params[strings::is_suscribed] = true;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
+ const std::string& policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
+
+ LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
+
+ auto app = application_manager_.application_by_policy_id(policy_app_id);
+
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id
+ << " is not found.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id << " is found.");
+ if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Policy id " << policy_app_id
+ << " is not found in reconnection list.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Application is found in reconnection list.");
+
+ auto app_type = ApplicationType::kSwitchedApplicationWrongHashId;
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ const auto hash_id =
+ (*message_)[strings::msg_params][strings::hash_id].asString();
+
+ auto& resume_ctrl = application_manager_.resume_controller();
+ if (resume_ctrl.CheckApplicationHash(app, hash_id)) {
+ app_type = ApplicationType::kSwitchedApplicationHashOk;
+ }
+ }
+
+ application_manager_.ProcessReconnection(app, connection_key());
+ SendRegisterAppInterfaceResponseToMobile(app_type);
+
+ application_manager_.SendHMIStatusNotification(app);
+
+ application_manager_.OnApplicationSwitched(app);
+
+ return true;
+}
+
+policy::PolicyHandlerInterface&
+RegisterAppInterfaceRequest::GetPolicyHandler() {
+ return policy_handler_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
new file mode 100644
index 0000000000..31eb738357
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
@@ -0,0 +1,131 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "connection_handler/connection_handler.h"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void RegisterAppInterfaceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
+ bool success = (*message_)[strings::msg_params][strings::success].asBool();
+ bool last_message = !success;
+ // Do not close connection in case of APPLICATION_NOT_REGISTERED despite it is
+ // an error
+ if (!success &&
+ (*message_)[strings::msg_params].keyExists(strings::result_code)) {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ if (result_code == mobile_apis::Result::APPLICATION_REGISTERED_ALREADY) {
+ last_message = false;
+ }
+ }
+
+ application_manager::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (app && app->msg_version() <= utils::version_4_5 &&
+ app->is_media_application() &&
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::button_capabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ (*message_)[strings::msg_params][hmi_response::button_capabilities];
+ auto it = button_caps.asArray()->begin();
+ auto ok_btn_it = it;
+ bool ok_btn_exists = false;
+ bool play_pause_btn_exists = false;
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[strings::name].asInt();
+ if (current_id == -1) {
+ continue;
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == mobile_apis::ButtonName::PLAY_PAUSE) {
+ play_pause_btn_exists = true;
+ so[strings::name] = mobile_apis::ButtonName::OK;
+ } else if (current_button == mobile_apis::ButtonName::OK) {
+ ok_btn_exists = true;
+ ok_btn_it = it;
+ }
+ }
+ if (ok_btn_exists && play_pause_btn_exists) {
+ button_caps.asArray()->erase(ok_btn_it);
+ }
+ }
+
+ SendResponse(success, result_code, last_message);
+
+ if (mobile_apis::Result::SUCCESS != result_code) {
+ return;
+ }
+
+ // Add registered application to the policy db right after response sent to
+ // mobile to be able to check all other API according to app permissions
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key " << connection_key()
+ << " is not registered.");
+ return;
+ }
+
+ SetHeartBeatTimeout(connection_key(), app->policy_app_id());
+}
+
+void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
+ uint32_t connection_key, const std::string& mobile_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+ if (policy_handler.PolicyEnabled()) {
+ const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id);
+ if (timeout > 0) {
+ application_manager_.connection_handler().SetHeartBeatTimeout(
+ connection_key, timeout);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Policy is turn off");
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
new file mode 100644
index 0000000000..ab6e1cc143
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc
@@ -0,0 +1,336 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {}
+
+void ResetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ size_t obj_length =
+ (*message_)[strings::msg_params][strings::properties].length();
+ // if application waits for sending ttsGlobalProperties need to remove this
+ // application from tts_global_properties_app_list_
+ LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
+ application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id);
+
+ bool helpt_promt = false;
+ bool timeout_prompt = false;
+ bool vr_help_title_items = false;
+ bool menu_name = false;
+ bool menu_icon = false;
+ bool is_key_board_properties = false;
+ int number_of_reset_vr = 0;
+ mobile_apis::GlobalProperty::eType global_property =
+ mobile_apis::GlobalProperty::INVALID_ENUM;
+
+ for (size_t i = 0; i < obj_length; ++i) {
+ global_property = static_cast<mobile_apis::GlobalProperty::eType>(
+ (*message_)[strings::msg_params][strings::properties][i].asInt());
+
+ if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
+ helpt_promt = ResetHelpPromt(app);
+ } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
+ timeout_prompt = ResetTimeoutPromt(app);
+ } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
+ (mobile_apis::GlobalProperty::VRHELPITEMS ==
+ global_property)) &&
+ (0 == number_of_reset_vr)) {
+ ++number_of_reset_vr;
+ vr_help_title_items = ResetVrHelpTitleItems(app);
+ } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) {
+ menu_name = true;
+ } else if (mobile_apis::GlobalProperty::MENUICON == global_property) {
+ menu_icon = true;
+ } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES ==
+ global_property) {
+ is_key_board_properties = true;
+ }
+ }
+
+ if (vr_help_title_items || menu_name || menu_icon ||
+ is_key_board_properties) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ }
+
+ app->set_reset_global_properties_active(true);
+
+ if (vr_help_title_items || menu_name || menu_icon ||
+ is_key_board_properties) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (vr_help_title_items) {
+ smart_objects::SmartObjectSPtr vr_help =
+ MessageHelper::CreateAppVrHelp(app);
+ if (!vr_help) {
+ return;
+ }
+ msg_params = *vr_help;
+ }
+ if (menu_name) {
+ msg_params[hmi_request::menu_title] = "";
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ // TODO(DT): clarify the sending parameter menuIcon
+ // if (menu_icon) {
+ //}
+ if (is_key_board_properties) {
+ smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ key_board_properties[strings::language] =
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
+ key_board_properties[hmi_request::keyboard_layout] =
+ static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
+
+ // Look for APPLINK-4432 for details.
+ /*smart_objects::SmartObject limited_character_list =
+ smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ limited_character_list[0] = "";
+ key_board_properties[hmi_request::limited_character_list] =
+ limited_character_list;*/
+
+ key_board_properties[hmi_request::auto_complete_text] = "";
+ msg_params[hmi_request::keyboard_properties] = key_board_properties;
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true);
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ // create ui request
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (helpt_promt) {
+ msg_params[strings::help_prompt] = (*app->help_prompt());
+ }
+
+ if (timeout_prompt) {
+ msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties, &msg_params, true);
+ }
+}
+
+bool ResetGlobalPropertiesRequest::ResetHelpPromt(
+ application_manager::ApplicationSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ smart_objects::SmartObject so_help_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ app->set_help_prompt(so_help_prompt);
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ const std::vector<std::string>& time_out_promt =
+ application_manager_.get_settings().time_out_promt();
+
+ smart_objects::SmartObject so_time_out_promt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
+ smart_objects::SmartObject timeoutPrompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeoutPrompt[strings::text] = time_out_promt[i];
+ timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ so_time_out_promt[i] = timeoutPrompt;
+ }
+
+ app->set_timeout_prompt(so_time_out_promt);
+
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ app->reset_vr_help_title();
+ app->reset_vr_help();
+
+ return true;
+}
+
+void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Waiting for remaining responses");
+ return;
+ }
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ SendResponse(result,
+ static_cast<mobile_apis::Result::eType>(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool ResetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ bool result = false;
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+
+ HmiInterfaces::InterfaceState tts_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ &&
+ HmiInterfaces::STATE_AVAILABLE == tts_interface_state) {
+ result = true;
+ out_result_code = mobile_apis::Result::WARNINGS;
+ out_response_info = "Unsupported phoneme type sent in a prompt";
+ } else {
+ result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ out_result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ out_response_info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ }
+
+ return result;
+}
+
+bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
new file mode 100644
index 0000000000..f5542ab26b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {}
+
+void ResetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
new file mode 100644
index 0000000000..0b28e09210
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc
@@ -0,0 +1,163 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ScrollableMessageRequest::ScrollableMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+ScrollableMessageRequest::~ScrollableMessageRequest() {}
+
+bool ScrollableMessageRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ } else {
+ const int32_t def_value = 30000;
+ default_timeout_ = def_value;
+ }
+
+ return true;
+}
+
+void ScrollableMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::message_text][hmi_request::field_name] =
+ static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::scrollableMessageBody);
+ msg_params[hmi_request::message_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::scroll_message_body];
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::timeout] = default_timeout_;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
+}
+
+void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
new file mode 100644
index 0000000000..4eee819497
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ScrollableMessageResponse::ScrollableMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+void ScrollableMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ ApplicationSharedPtr application = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asInt());
+ if ((mobile_apis::Result::REJECTED != result_code) && application) {
+ application->UnsubscribeFromSoftButtons(
+ (*message_)[strings::params][strings::function_id].asInt());
+ }
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
new file mode 100644
index 0000000000..a09434ebb6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+SendHapticDataRequest::SendHapticDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SendHapticDataRequest::~SendHapticDataRequest() {}
+
+void SendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
+ } else {
+ SendResponse(false,
+ mobile_apis::Result::DISALLOWED,
+ "Application is not of type Navigation or Mobile Projection");
+ }
+}
+
+void SendHapticDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_api::Result::SUCCESS,
+ mobile_api::Result::WARNINGS);
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
new file mode 100644
index 0000000000..f4515472a4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendHapticDataResponse::SendHapticDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SendHapticDataResponse::~SendHapticDataResponse() {}
+
+void SendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
new file mode 100644
index 0000000000..2719d0674d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
@@ -0,0 +1,284 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include "application_manager/message_helper.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendLocationRequest::SendLocationRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SendLocationRequest::~SendLocationRequest() {}
+
+void SendLocationRequest::Run() {
+ using namespace hmi_apis;
+ using smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+ if (msg_params.keyExists(strings::delivery_mode)) {
+ const RPCParams& allowed_params = parameters_permissions().allowed_params;
+
+ if (helpers::in_range(allowed_params, strings::delivery_mode)) {
+ msg_params.erase(strings::delivery_mode);
+ }
+ }
+
+ std::vector<Common_TextFieldName::eType> fields_to_check;
+ if (msg_params.keyExists(strings::location_name)) {
+ fields_to_check.push_back(Common_TextFieldName::locationName);
+ }
+ if (msg_params.keyExists(strings::location_description)) {
+ fields_to_check.push_back(Common_TextFieldName::locationDescription);
+ }
+ if (msg_params.keyExists(strings::address_lines)) {
+ fields_to_check.push_back(Common_TextFieldName::addressLines);
+ }
+ if (msg_params.keyExists(strings::phone_number)) {
+ fields_to_check.push_back(Common_TextFieldName::phoneNumber);
+ }
+
+ if (!CheckHMICapabilities(fields_to_check)) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Strings contain invalid characters");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::address)) {
+ const utils::custom_string::CustomString& address =
+ msg_params[strings::address].asCustomString();
+ if (address.empty()) {
+ msg_params.erase(strings::address);
+ }
+ }
+
+ if (!CheckFieldsCompatibility()) {
+ LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::location_image)) {
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::SUCCESS;
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map);
+ request_msg_params = msg_params;
+ request_msg_params[strings::app_id] = app->hmi_app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true);
+}
+
+void SendLocationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ const smart_objects::SmartObject& message = event.smart_object();
+ if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
+ LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const Common_Result::eType result_code = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::params]));
+ return;
+ }
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+}
+
+bool SendLocationRequest::CheckFieldsCompatibility() {
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ MessageHelper::PrintSmartObject(msg_params);
+ const bool longitude_degrees_exist =
+ msg_params.keyExists(strings::longitude_degrees);
+ const bool latitude_degrees_exist =
+ msg_params.keyExists(strings::latitude_degrees);
+ const bool address_exist = msg_params.keyExists(strings::address);
+
+ if (latitude_degrees_exist ^ longitude_degrees_exist) {
+ LOG4CXX_DEBUG(logger_,
+ "latitude and longitude should be provided only in pair");
+ return false;
+ }
+
+ if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) {
+ LOG4CXX_DEBUG(logger_,
+ "address or latitude/longtitude should should be provided");
+ return false;
+ }
+ return true;
+}
+void insert_if_contains(
+ const smart_objects::SmartObject& msg_params,
+ const std::string& param_key,
+ std::vector<utils::custom_string::CustomString>& output_vector) {
+ if (msg_params.keyExists(param_key)) {
+ output_vector.push_back(msg_params[param_key].asCustomString());
+ }
+}
+
+bool SendLocationRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<utils::custom_string::CustomString> fields_to_check;
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ insert_if_contains(msg_params, strings::location_name, fields_to_check);
+ insert_if_contains(
+ msg_params, strings::location_description, fields_to_check);
+ insert_if_contains(msg_params, strings::phone_number, fields_to_check);
+
+ if (msg_params.keyExists(strings::address_lines)) {
+ const smart_objects::SmartArray* al_array =
+ msg_params[strings::address_lines].asArray();
+ smart_objects::SmartArray::const_iterator it_al = al_array->begin();
+ smart_objects::SmartArray::const_iterator it_al_end = al_array->end();
+ for (; it_al != it_al_end; ++it_al) {
+ const utils::custom_string::CustomString& val = (*it_al).asCustomString();
+ fields_to_check.push_back(val);
+ }
+ }
+
+ if (msg_params.keyExists(strings::address)) {
+ const smart_objects::SmartObject& address_so = msg_params[strings::address];
+ insert_if_contains(address_so, strings::country_name, fields_to_check);
+ insert_if_contains(address_so, strings::country_code, fields_to_check);
+ insert_if_contains(address_so, strings::postal_code, fields_to_check);
+ insert_if_contains(
+ address_so, strings::administrative_area, fields_to_check);
+ insert_if_contains(address_so, strings::locality, fields_to_check);
+ insert_if_contains(address_so, strings::sub_locality, fields_to_check);
+ insert_if_contains(address_so, strings::thoroughfare, fields_to_check);
+ insert_if_contains(address_so, strings::sub_thoroughfare, fields_to_check);
+ }
+
+ std::vector<utils::custom_string::CustomString>::iterator it =
+ fields_to_check.begin();
+ for (; it != fields_to_check.end(); ++it) {
+ const std::string& str = it->AsMBString();
+ if (!CheckSyntax(str, false)) {
+ LOG4CXX_ERROR(logger_,
+ "string '" << str << "'' contains invalid characters");
+ return true;
+ }
+ }
+ return false;
+}
+
+bool SendLocationRequest::CheckHMICapabilities(
+ std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+ if (fields_names.empty()) {
+ return true;
+ }
+
+ const HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ if (!hmi_capabilities.is_ui_cooperating()) {
+ LOG4CXX_ERROR(logger_, "UI is not supported.");
+ return false;
+ }
+
+ if (hmi_capabilities.display_capabilities()) {
+ const SmartObject disp_cap = (*hmi_capabilities.display_capabilities());
+ const SmartObject& text_fields =
+ disp_cap.getElement(hmi_response::text_fields);
+ const size_t len = text_fields.length();
+ for (size_t i = 0; i < len; ++i) {
+ const SmartObject& text_field = text_fields[i];
+ const Common_TextFieldName::eType filed_name =
+ static_cast<Common_TextFieldName::eType>(
+ text_field.getElement(strings::name).asInt());
+ const std::vector<Common_TextFieldName::eType>::iterator it =
+ std::find(fields_names.begin(), fields_names.end(), filed_name);
+ if (it != fields_names.end()) {
+ fields_names.erase(it);
+ }
+ }
+ }
+
+ if (!fields_names.empty()) {
+ LOG4CXX_ERROR(logger_, "Some fields are not supported by capabilities");
+ return false;
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
new file mode 100644
index 0000000000..59dab4a9a7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SendLocationResponse::SendLocationResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SendLocationResponse::~SendLocationResponse() {}
+
+void SendLocationResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
new file mode 100644
index 0000000000..e79fb315ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
@@ -0,0 +1,301 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
+#include <algorithm>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetAppIconRequest::SetAppIconRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , is_icons_saving_enabled_(false) {
+ const std::string path =
+ application_manager_.get_settings().app_icons_folder();
+ is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) &&
+ file_system::IsReadingAllowed(path);
+}
+
+SetAppIconRequest::~SetAppIconRequest() {}
+
+void SetAppIconRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ std::string full_file_path =
+ application_manager_.get_settings().app_storage_folder() + "/";
+ full_file_path += app->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (!file_system::FileExists(full_file_path)) {
+ LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::sync_file_name] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ // Panasonic requres unchanged path value without encoded special characters
+ const std::string full_file_path_for_hmi =
+ file_system::ConvertPathForURL(full_file_path);
+
+ msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
+
+ // TODO(VS): research why is image_type hardcoded
+ msg_params[strings::sync_file_name][strings::image_type] =
+ static_cast<int32_t>(SetAppIconRequest::ImageType::DYNAMIC);
+
+ // for further use in on_event function
+ (*message_)[strings::msg_params][strings::sync_file_name] =
+ msg_params[strings::sync_file_name];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
+}
+
+void SetAppIconRequest::CopyToIconStorage(
+ const std::string& path_to_file) const {
+ if (!(application_manager_.protocol_handler()
+ .get_settings()
+ .max_supported_protocol_version() >=
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) {
+ LOG4CXX_WARN(logger_,
+ "Icon copying skipped, since protocol ver. 4 is not enabled.");
+ return;
+ }
+
+ std::vector<uint8_t> file_content;
+ if (!file_system::ReadBinaryFile(path_to_file, file_content)) {
+ LOG4CXX_ERROR(logger_, "Can't read icon file: " << path_to_file);
+ return;
+ }
+
+ const std::string icon_storage =
+ application_manager_.get_settings().app_icons_folder();
+ const uint64_t storage_max_size = static_cast<uint64_t>(
+ application_manager_.get_settings().app_icons_folder_max_size());
+ const uint64_t file_size = file_system::FileSize(path_to_file);
+
+ if (storage_max_size < file_size) {
+ LOG4CXX_ERROR(logger_,
+ "Icon size (" << file_size << ") is bigger, than "
+ " icons storage maximum size ("
+ << storage_max_size << ")."
+ "Copying skipped.");
+ return;
+ }
+
+ const uint64_t storage_size =
+ static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
+ if (storage_max_size < (file_size + storage_size)) {
+ const uint32_t icons_amount =
+ application_manager_.get_settings().app_icons_amount_to_remove();
+
+ if (!icons_amount) {
+ LOG4CXX_DEBUG(logger_,
+ "No icons will be deleted, since amount icons to remove "
+ "is zero. Icon saving skipped.");
+ return;
+ }
+
+ while (!IsEnoughSpaceForIcon(file_size)) {
+ RemoveOldestIcons(icon_storage, icons_amount);
+ }
+ }
+ ApplicationConstSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Can't get application for connection key: " << connection_key());
+ return;
+ }
+
+ const std::string icon_path = icon_storage + "/" + app->policy_app_id();
+ if (!file_system::CreateFile(icon_path)) {
+ LOG4CXX_ERROR(logger_, "Can't create icon: " << icon_path);
+ return;
+ }
+
+ if (!file_system::Write(icon_path, file_content)) {
+ LOG4CXX_ERROR(logger_, "Can't write icon: " << icon_path);
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Icon was successfully copied from :" << path_to_file << " to "
+ << icon_path);
+
+ return;
+}
+
+void SetAppIconRequest::RemoveOldestIcons(const std::string& storage,
+ const uint32_t icons_amount) const {
+ const std::vector<std::string> icons_list = file_system::ListFiles(storage);
+ auto compareTime = [](const time_t t1, const time_t t2)
+ -> bool { return difftime(t1, t2) > 0; };
+ std::map<time_t,
+ std::string,
+ std::function<bool(const time_t, const time_t)> >
+ icon_modification_time(compareTime);
+ std::vector<std::string>::const_iterator it = icons_list.begin();
+ for (; it != icons_list.end(); ++it) {
+ const std::string file_name = *it;
+ const std::string file_path = storage + "/" + file_name;
+ if (!file_system::FileExists(file_path)) {
+ continue;
+ }
+ const time_t time = file_system::GetFileModificationTime(file_path);
+ icon_modification_time[time] = file_name;
+ }
+
+ for (size_t counter = 0; counter < icons_amount; ++counter) {
+ if (!icon_modification_time.size()) {
+ LOG4CXX_ERROR(logger_, "No more icons left for deletion.");
+ return;
+ }
+ const std::string file_name = icon_modification_time.begin()->second;
+ const std::string file_path = storage + "/" + file_name;
+ if (!file_system::DeleteFile(file_path)) {
+ LOG4CXX_DEBUG(logger_, "Error while deleting icon " << file_path);
+ }
+ icon_modification_time.erase(icon_modification_time.begin());
+ LOG4CXX_DEBUG(logger_,
+ "Old icon " << file_path << " was deleted successfully.");
+ }
+}
+
+bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const {
+ const std::string icon_storage =
+ application_manager_.get_settings().app_icons_folder();
+ const uint64_t storage_max_size = static_cast<uint64_t>(
+ application_manager_.get_settings().app_icons_folder_max_size());
+ const uint64_t storage_size =
+ static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
+ return storage_max_size >= (icon_size + storage_size);
+}
+
+void SetAppIconRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
+ if (result) {
+ ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if ((message_.use_count() == 0) || (app.use_count() == 0)) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ const std::string& path =
+ (*message_)[strings::msg_params][strings::sync_file_name]
+ [strings::value].asString();
+
+ if (is_icons_saving_enabled_) {
+ CopyToIconStorage(path);
+ }
+
+ app->set_app_icon_path(path);
+
+ LOG4CXX_INFO(logger_,
+ "Icon path was set to '" << app->app_icon_path() << "'");
+ }
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
new file mode 100644
index 0000000000..aa8731f062
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetAppIconResponse::SetAppIconResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetAppIconResponse::~SetAppIconResponse() {}
+
+void SetAppIconResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
new file mode 100644
index 0000000000..32164b8f0e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc
@@ -0,0 +1,173 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetDisplayLayoutRequest::SetDisplayLayoutRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {}
+
+void SetDisplayLayoutRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ std::string old_layout = app->display_layout();
+ std::string new_layout = "";
+
+ if (msg_params.keyExists(strings::display_layout)) {
+ new_layout = msg_params[strings::display_layout].asString();
+ }
+
+ if (new_layout != old_layout &&
+ !new_layout.empty()) { // Template switched, allow any color change
+ LOG4CXX_DEBUG(logger_,
+ "SetDisplayLayoutRequest New Layout: " << new_layout);
+ app->set_display_layout(new_layout);
+ } else {
+ LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change");
+ // Template layout is the same as previous layout
+ // Reject message if colors are set
+ if (msg_params.keyExists(strings::day_color_scheme) &&
+ app->day_color_scheme() != NULL &&
+ !(msg_params[strings::day_color_scheme] ==
+ *(app->day_color_scheme()))) {
+ // Color scheme param exists and has been previously set, do not allow
+ // color change
+ LOG4CXX_DEBUG(logger_, "Reject Day Color Scheme Change");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme) &&
+ app->night_color_scheme() != NULL &&
+ !(msg_params[strings::night_color_scheme] ==
+ *(app->night_color_scheme()))) {
+ // Color scheme param exists and has been previously set, do not allow
+ // color change
+ LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ }
+
+ if (msg_params.keyExists(strings::day_color_scheme)) {
+ LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change");
+ app->set_day_color_scheme(msg_params[strings::day_color_scheme]);
+ }
+
+ if (msg_params.keyExists(strings::night_color_scheme)) {
+ LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change");
+ app->set_night_color_scheme(msg_params[strings::night_color_scheme]);
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
+ &((*message_)[strings::msg_params]),
+ true);
+}
+
+void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool response_success = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string info;
+ GetInfo(message, info);
+ smart_objects::SmartObject msg_params = message[strings::msg_params];
+ if (response_success) {
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ // in case templates_available is empty copy from hmi capabilities
+ if (msg_params.keyExists(hmi_response::display_capabilities)) {
+ if (0 ==
+ msg_params[hmi_response::display_capabilities]
+ [hmi_response::templates_available].length()) {
+ msg_params[hmi_response::display_capabilities]
+ [hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+ }
+ }
+ }
+ SendResponse(response_success,
+ MessageHelper::HMIToMobileResult(result_code),
+ info.empty() ? NULL : info.c_str(),
+ &msg_params);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
new file mode 100644
index 0000000000..4bab4a3e5b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetDisplayLayoutResponse::SetDisplayLayoutResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {}
+
+void SetDisplayLayoutResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
new file mode 100644
index 0000000000..0c217b6b4f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
@@ -0,0 +1,568 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <numeric>
+#include <algorithm>
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , is_ui_send_(false)
+ , is_tts_send_(false)
+ , is_ui_received_(false)
+ , is_tts_received_(false)
+ , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
+ , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
+
+SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
+
+void SetGlobalPropertiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "No application associated with connection key "
+ << connection_key());
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!ValidateConditionalMandatoryParameters(msg_params)) {
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "There are no parameters present in request.");
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::menu_icon],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(
+ logger_, "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+ // Check for image file(s) in vrHelpItem
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImageVrHelpItems(
+ (*message_)[strings::msg_params][strings::vr_help],
+ app,
+ application_manager_)) {
+ LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "White spaces found");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // if application waits for sending ttsGlobalProperties need to remove this
+ // application from tts_global_properties_app_list_
+ application_manager_.RemoveAppFromTTSGlobalPropertiesList(connection_key());
+ bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt);
+ bool is_timeout_prompt_present =
+ msg_params.keyExists(strings::timeout_prompt);
+ bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title);
+ bool is_vr_help_present = msg_params.keyExists(strings::vr_help);
+
+ // check VR params
+ if (is_vr_help_title_present ^ is_vr_help_present) {
+ LOG4CXX_ERROR(logger_,
+ "Reject because of vr_help or vr_help_title only provided");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ /* Need to set flags before sending request to HMI
+ * for correct processing this flags in method on_event */
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ is_tts_send_ = true;
+ }
+ if (is_vr_help_title_present && is_vr_help_present) {
+ LOG4CXX_DEBUG(logger_, "VRHelp params presents");
+
+ if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) {
+ LOG4CXX_ERROR(logger_,
+ "VR Help Items contains nonsequential positions"
+ << " (e.g. [1,2,4]) or not started from 1");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ PrepareUIRequestVRHelpData(app, msg_params, params);
+ PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
+
+ params[strings::app_id] = app->app_id();
+ SendUIRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
+ } else {
+ LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
+ DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
+
+ // Preparing data
+ if (params.empty()) {
+ LOG4CXX_DEBUG(logger_, "No UI info provided");
+ } else {
+ params[strings::app_id] = app->app_id();
+ SendUIRequest(params, true);
+ }
+ }
+
+ // check TTS params
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ LOG4CXX_DEBUG(logger_, "TTS params presents");
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ std::vector<std::string> invalid_params;
+ if (is_help_prompt_present) {
+ smart_objects::SmartObject& help_prompt =
+ (*message_)[strings::msg_params][strings::help_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("help_prompt");
+ } else {
+ app->set_help_prompt(help_prompt);
+ params[strings::help_prompt] = (*app->help_prompt());
+ }
+ }
+
+ if (is_timeout_prompt_present) {
+ smart_objects::SmartObject& timeout_prompt =
+ (*message_)[strings::msg_params][strings::timeout_prompt];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(
+ timeout_prompt, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ invalid_params.push_back("timeout_prompt");
+ } else {
+ app->set_timeout_prompt(timeout_prompt);
+ params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+ }
+
+ if (!invalid_params.empty()) {
+ std::string params_list = std::accumulate(
+ std::begin(invalid_params),
+ std::end(invalid_params),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ const std::string info =
+ "One or more files needed for " + params_list + " are not present";
+ SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, info.c_str());
+ return;
+ }
+
+ params[strings::app_id] = app->app_id();
+ SendTTSRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
+ }
+}
+
+bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder(
+ const smart_objects::SmartObject& vr_help) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(vr_help.getType() == smart_objects::SmartType_Array, false);
+ const size_t vr_help_length = vr_help.length();
+ DCHECK_OR_RETURN(vr_help_length > 0, false);
+
+ for (size_t j = 0; j < vr_help_length; ++j) {
+ const size_t position =
+ vr_help.getElement(j).getElement(strings::position).asUInt();
+ // Elements shall start from 1 and increment one by one
+ if (position != (j + 1)) {
+ LOG4CXX_ERROR(logger_,
+ "VR help items order is wrong"
+ << " at " << j << ", position value:" << position);
+ return false;
+ }
+ }
+ return true;
+}
+
+void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ is_tts_received_ = true;
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Continue waiting for response");
+ return;
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
+
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool SetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool SetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ app_mngr::commands::ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+
+ app_mngr::commands::ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+ const bool result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ if (result &&
+ (HmiInterfaces::STATE_AVAILABLE == tts_properties_info.interface_state) &&
+ (tts_properties_info.is_unsupported_resource)) {
+ result_code = mobile_apis::Result::WARNINGS;
+ tts_response_info_ = "Unsupported phoneme type sent in a prompt";
+ info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+ }
+ result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ info = app_mngr::commands::MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
+ return result;
+}
+
+void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+
+ app->set_vr_help_title(msg_params.getElement(strings::vr_help_title));
+ app->set_vr_help(msg_params.getElement(strings::vr_help));
+
+ out_params[strings::vr_help_title] = (*app->vr_help_title());
+ out_params[strings::vr_help] = (*app->vr_help());
+}
+
+void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
+ const ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params,
+ smart_objects::SmartObject& out_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+
+ const bool is_menu_title_present =
+ msg_params.keyExists(hmi_request::menu_title);
+ const bool is_menu_icon_present =
+ msg_params.keyExists(hmi_request::menu_icon);
+ const bool is_keyboard_props_present =
+ msg_params.keyExists(hmi_request::keyboard_properties);
+
+ if (is_menu_title_present) {
+ out_params[hmi_request::menu_title] =
+ msg_params[hmi_request::menu_title].asString();
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ if (is_menu_icon_present) {
+ out_params[hmi_request::menu_icon] = msg_params[hmi_request::menu_icon];
+ app->set_menu_icon(msg_params[hmi_request::menu_icon]);
+ }
+ if (is_keyboard_props_present) {
+ out_params[hmi_request::keyboard_properties] =
+ msg_params[hmi_request::keyboard_properties];
+ app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
+ }
+}
+
+void SetGlobalPropertiesRequest::SendTTSRequest(
+ const smart_objects::SmartObject& params, bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_tts_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
+}
+
+void SetGlobalPropertiesRequest::SendUIRequest(
+ const smart_objects::SmartObject& params, bool use_events) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_ui_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
+}
+
+bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
+ return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
+}
+
+bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return params.keyExists(strings::help_prompt) ||
+ params.keyExists(strings::timeout_prompt) ||
+ params.keyExists(strings::vr_help_title) ||
+ params.keyExists(strings::vr_help) ||
+ params.keyExists(strings::menu_title) ||
+ params.keyExists(strings::menu_icon) ||
+ params.keyExists(strings::keyboard_properties);
+}
+
+bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ msg_params[strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ msg_params[strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ msg_params[strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ } // if image exists
+ } // for - vh_array iteration
+ }
+
+ if (msg_params.keyExists(strings::menu_icon)) {
+ str = msg_params[strings::menu_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help_title)) {
+ str = msg_params[strings::vr_help_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::menu_title)) {
+ str = msg_params[strings::menu_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::keyboard_properties)) {
+ if (msg_params[strings::keyboard_properties].keyExists(
+ strings::limited_character_list)) {
+ const smart_objects::SmartArray* lcl_array =
+ msg_params[strings::keyboard_properties]
+ [strings::limited_character_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
+ smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
+
+ for (; it_lcl != it_lcl_end; ++it_lcl) {
+ str = (*it_lcl).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "limited_character_list syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params[strings::keyboard_properties].keyExists(
+ strings::auto_complete_text)) {
+ str =
+ msg_params[strings::keyboard_properties][strings::auto_complete_text]
+ .asCharArray();
+
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid keyboard_properties "
+ "auto_complete_text syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
new file mode 100644
index 0000000000..567a1a088b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {}
+
+void SetGlobalPropertiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..55bd164368
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc
@@ -0,0 +1,166 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetMediaClockRequest::SetMediaClockRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetMediaClockRequest::~SetMediaClockRequest() {}
+
+void SetMediaClockRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (!app->is_media_application()) {
+ LOG4CXX_ERROR(logger_, "Application is not media application");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (isDataValid()) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ // copy entirely msg
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendHMIRequest(
+ hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void SetMediaClockRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool SetMediaClockRequest::isDataValid() {
+ smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
+ mobile_apis::UpdateMode::eType update_mode =
+ static_cast<mobile_apis::UpdateMode::eType>(
+ msg_params[strings::update_mode].asUInt());
+
+ if (update_mode == mobile_apis::UpdateMode::COUNTUP ||
+ update_mode == mobile_apis::UpdateMode::COUNTDOWN) {
+ if (!msg_params.keyExists(strings::start_time)) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+
+ if (msg_params.keyExists(strings::end_time)) {
+ unsigned int start_time_in_seconds = 0;
+ start_time_in_seconds =
+ (msg_params[strings::start_time][strings::hours].asUInt()) * 3600;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::minutes].asUInt()) * 60;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::seconds].asUInt());
+
+ unsigned int end_time_in_seconds = 0;
+ end_time_in_seconds =
+ (msg_params[strings::end_time][strings::hours].asUInt()) * 3600;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::minutes].asUInt()) * 60;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::seconds].asUInt());
+
+ if (((end_time_in_seconds > start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) ||
+ ((end_time_in_seconds < start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTUP))) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "Data is valid");
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..e777533ce4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SetMediaClockTimerResponse::SetMediaClockTimerResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {}
+
+void SetMediaClockTimerResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
new file mode 100644
index 0000000000..3b2936e6cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
@@ -0,0 +1,292 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstring>
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowConstantTBTRequest::ShowConstantTBTRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ShowConstantTBTRequest::~ShowConstantTBTRequest() {}
+
+void ShowConstantTBTRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+ // SDLAQ-CRS-664, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming show constant TBT has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons(
+ msg_params, app, policy_handler_, application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+ if (msg_params.keyExists(strings::turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::turn_icon], app, application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (msg_params.keyExists(strings::next_turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::next_turn_icon], app, application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::navi_texts] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if (msg_params.keyExists(strings::navigation_text_1)) {
+ // erase useless parametr
+ msg_params.erase(strings::navigation_text_1);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_1];
+ }
+
+ if (msg_params.keyExists(strings::navigation_text_2)) {
+ // erase useless param
+ msg_params.erase(strings::navigation_text_2);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_2];
+ }
+
+ if (msg_params.keyExists(strings::eta)) {
+ // erase useless param
+ msg_params.erase(strings::eta);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::eta];
+ }
+
+ if (msg_params.keyExists(strings::total_distance)) {
+ // erase useless param
+ msg_params.erase(strings::total_distance);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::total_distance];
+ }
+
+ if (msg_params.keyExists(strings::time_to_destination)) {
+ // erase useless param
+ msg_params.erase(strings::time_to_destination);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::time_to_destination];
+ }
+
+ if (msg_params.keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ msg_params, app, function_id());
+ }
+
+ app->set_tbt_show_command(msg_params);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true);
+}
+
+void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis;
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const Common_Result::eType result_code =
+ static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
+ str = (*message_)[strings::msg_params][strings::turn_icon][strings::value]
+ .asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
+ str = (*message_)[strings::msg_params][strings::next_turn_icon]
+ [strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid next_turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) {
+ str = (*message_)[strings::msg_params][strings::navigation_text_1]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) {
+ str = (*message_)[strings::msg_params][strings::navigation_text_2]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_2 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::eta)) {
+ str = (*message_)[strings::msg_params][strings::eta].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) {
+ str =
+ (*message_)[strings::msg_params][strings::total_distance].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid total_distance value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::time_to_destination)) {
+ str = (*message_)[strings::msg_params][strings::time_to_destination]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid time_to_destination value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
new file mode 100644
index 0000000000..239040a3b3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowConstantTBTResponse::ShowConstantTBTResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ShowConstantTBTResponse::~ShowConstantTBTResponse() {}
+
+void ShowConstantTBTResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
new file mode 100644
index 0000000000..e0c3e1da9a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
@@ -0,0 +1,413 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <string.h>
+#include "sdl_rpc_plugin/commands/mobile/show_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowRequest::ShowRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , core_result_code_(mobile_apis::Result::INVALID_ENUM) {}
+
+ShowRequest::~ShowRequest() {}
+
+void ShowRequest::HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params) {
+ smart_objects::SmartObject& metadata_tags =
+ (*message_)[strings::msg_params][strings::metadata_tags];
+
+ if (metadata_tags.keyExists(field_id)) {
+ if (field_index != -1) {
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ const size_t num_tags = metadata_tags[field_id].length();
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = metadata_tags[field_id][i].asInt();
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types][i] = current_tag;
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "metadata tag provided with no item for "
+ << field_id << ", ignoring with warning");
+ // tag provided with no item, ignore with warning
+ if (mobile_apis::Result::INVALID_ENUM == core_result_code_) {
+ core_result_code_ = mobile_apis::Result::WARNINGS;
+ core_response_info_ =
+ "Metadata tag was provided for a field with no data.";
+ }
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "No metadata tagging provided for field: " << field_id);
+ }
+}
+
+void ShowRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ // SDLAQ-CRS-494, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!CheckStringsOfShowRequest()) {
+ LOG4CXX_ERROR(logger_, "Incorrect characters in string");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS;
+ if (((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) {
+ processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+ }
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Processing of soft buttons failed.");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+ if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
+ ((*message_)[strings::msg_params][strings::graphic][strings::value]
+ .asString()).length()) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::graphic],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::secondary_graphic],
+ app,
+ application_manager_);
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
+ LOG4CXX_ERROR(logger_, "Image verification failed.");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ int32_t main_field_1_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_1];
+ main_field_1_index = index;
+ ++index;
+ }
+
+ int32_t main_field_2_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_2];
+ main_field_2_index = index;
+ ++index;
+ }
+
+ int32_t main_field_3_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_3];
+ main_field_3_index = index;
+ ++index;
+ }
+
+ int32_t main_field_4_index = -1;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_4];
+ main_field_4_index = index;
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::metadata_tags)) {
+ HandleMetadata(strings::main_field_1, main_field_1_index, msg_params);
+ HandleMetadata(strings::main_field_2, main_field_2_index, msg_params);
+ HandleMetadata(strings::main_field_3, main_field_3_index, msg_params);
+ HandleMetadata(strings::main_field_4, main_field_4_index, msg_params);
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_clock];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaTrack);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_track];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::statusBar);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::status_bar];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alignment)) {
+ msg_params[strings::alignment] =
+ (*message_)[strings::msg_params][strings::alignment];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ msg_params[strings::graphic] =
+ (*message_)[strings::msg_params][strings::graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ msg_params[strings::secondary_graphic] =
+ (*message_)[strings::msg_params][strings::secondary_graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ if ((*message_)[strings::msg_params][strings::soft_buttons].length() == 0) {
+ app->UnsubscribeFromSoftButtons(function_id());
+ } else {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ msg_params[strings::custom_presets] =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
+
+ app_mngr::commands::MessageSharedPtr persistentData =
+ std::make_shared<smart_objects::SmartObject>(msg_params);
+ app->set_show_command(*persistentData);
+}
+
+void ShowRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_Show: {
+ LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ std::string response_info;
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_UI);
+ GetInfo(message, response_info);
+ if (hmi_apis::Common_Result::WARNINGS == result_code &&
+ message[strings::params].keyExists(hmi_response::message)) {
+ response_info =
+ message[strings::params][hmi_response::message].asString();
+ }
+ mobile_apis::Result::eType converted_result_code =
+ MessageHelper::HMIToMobileResult(result_code);
+ if (mobile_apis::Result::SUCCESS == converted_result_code &&
+ mobile_apis::Result::INVALID_ENUM != core_result_code_) {
+ converted_result_code = core_result_code_;
+ response_info = core_response_info_;
+ }
+ SendResponse(result,
+ converted_result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event " << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowRequest::CheckStringsOfShowRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ str = (*message_)[strings::msg_params][strings::media_clock].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ str = (*message_)[strings::msg_params][strings::media_track].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ smart_objects::SmartObject& custom_presets_array =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ for (size_t i = 0; i < custom_presets_array.length(); ++i) {
+ str = custom_presets_array[i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed");
+ return false;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ str = (*message_)[strings::msg_params][strings::graphic][strings::value]
+ .asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ str = (*message_)[strings::msg_params][strings::secondary_graphic]
+ [strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid secondary_graphic value syntax check failed");
+ return false;
+ }
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
new file mode 100644
index 0000000000..4e167e7531
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/show_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ShowResponse::ShowResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ShowResponse::~ShowResponse() {}
+
+void ShowResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
new file mode 100644
index 0000000000..08b4775d3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc
@@ -0,0 +1,207 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/slider_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+#include "config_profile/profile.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SliderRequest::SliderRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+SliderRequest::~SliderRequest() {}
+
+bool SliderRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ application_manager_.get_settings().default_timeout() +
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+
+ return true;
+}
+
+void SliderRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::num_ticks].asInt() <
+ (*message_)[strings::msg_params][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) {
+ if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() !=
+ (*message_)[strings::msg_params][strings::slider_footer].length()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = application->app_id();
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
+}
+
+void SliderRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ const SmartObject& message = event.smart_object();
+
+ const event_engine::Event::EventID event_id = event.id();
+ if (event_id == FunctionID::UI_OnResetTimeout) {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ return;
+ }
+
+ if (event_id != FunctionID::UI_Slider) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
+ const Common_Result::eType response_code = static_cast<Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ SmartObject response_msg_params = message[strings::msg_params];
+
+ const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>(
+ response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED);
+
+ if (is_timeout_aborted) {
+ if (message[strings::params][strings::data].keyExists(
+ strings::slider_position)) {
+ // Copy slider_position info to msg_params section
+ response_msg_params[strings::slider_position] =
+ message[strings::params][strings::data][strings::slider_position];
+ } else {
+ LOG4CXX_ERROR(logger_,
+ strings::slider_position << " field is absent"
+ " in response.");
+ response_msg_params[strings::slider_position] = 0;
+ }
+ }
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool is_response_success = PrepareResultForMobileResponse(
+ response_code, HmiInterfaces::HMI_INTERFACE_UI);
+
+ SendResponse(is_response_success,
+ MessageHelper::HMIToMobileResult(response_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &response_msg_params);
+}
+
+bool SliderRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::slider_header].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ const smart_objects::SmartArray* sf_array =
+ (*message_)[strings::msg_params][strings::slider_footer].asArray();
+
+ smart_objects::SmartArray::const_iterator it_sf = sf_array->begin();
+ smart_objects::SmartArray::const_iterator it_sf_end = sf_array->end();
+
+ for (; it_sf != it_sf_end; ++it_sf) {
+ str = (*it_sf).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
new file mode 100644
index 0000000000..4d6e714e88
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/slider_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SliderResponse::SliderResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SliderResponse::~SliderResponse() {}
+
+void SliderResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
new file mode 100644
index 0000000000..e14321c488
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc
@@ -0,0 +1,184 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "sdl_rpc_plugin/commands/mobile/speak_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SpeakRequest::SpeakRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+SpeakRequest::~SpeakRequest() {}
+
+void SpeakRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming speak has contains \\t\\n \\\\t \\\\n "
+ " text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject& tts_chunks =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_);
+
+ if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyTtsFiles return "
+ << verification_result);
+ SendResponse(false,
+ mobile_apis::Result::FILE_NOT_FOUND,
+ "One or more files needed for tts_chunks are not present");
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ (*message_)[strings::msg_params][hmi_request::speak_type] =
+ hmi_apis::Common_MethodName::SPEAK;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
+ &message_->getElement(strings::msg_params),
+ true);
+}
+
+void SpeakRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
+ ProcessTTSSpeakResponse(event.smart_object());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+void SpeakRequest::ProcessTTSSpeakResponse(
+ const smart_objects::SmartObject& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result_code);
+
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result_code, HmiInterfaces::HMI_INTERFACE_TTS);
+
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::SpeakID;
+
+ const char* return_info = NULL;
+
+ SendResponse(
+ result, result_code, return_info, &(message[strings::msg_params]));
+}
+
+bool SpeakRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const smart_objects::SmartArray* tc_array =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
+ smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
+
+ for (; it_tc != it_tc_end; ++it_tc) {
+ str = (*it_tc)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
new file mode 100644
index 0000000000..f57bd91cd5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/speak_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SpeakResponse::SpeakResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SpeakResponse::~SpeakResponse() {}
+
+void SpeakResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
new file mode 100644
index 0000000000..85cb26321b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
@@ -0,0 +1,147 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+SubscribeButtonRequest::SubscribeButtonRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeButtonRequest::~SubscribeButtonRequest() {}
+
+void SubscribeButtonRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+
+ if (!IsSubscriptionAllowed(app, btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Subscribe on button " << btn_id << " isn't allowed");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (app->msg_version() <= utils::version_4_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Subscribe on button "
+ << btn_id << " isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (app->IsSubscribedToButton(btn_id)) {
+ LOG4CXX_ERROR(logger_, "Already subscribed to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
+ SendSubscribeButtonNotification();
+
+ const bool is_succedeed = true;
+ SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
+}
+
+bool SubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool SubscribeButtonRequest::IsSubscriptionAllowed(
+ ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
+ if (!app->is_media_application() &&
+ ((mobile_apis::ButtonName::PLAY_PAUSE == btn_id) ||
+ (mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
+ (mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
+ (mobile_apis::ButtonName::TUNEUP == btn_id) ||
+ (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
+ return false;
+ }
+ return true;
+}
+
+void SubscribeButtonRequest::SendSubscribeButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ // send OnButtonSubscription notification
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
+ (*message_)[strings::msg_params][strings::button_name].asUInt());
+ msg_params[strings::is_suscribed] = true;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
new file mode 100644
index 0000000000..1350cfb66e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeButtonResponse::SubscribeButtonResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeButtonResponse::~SubscribeButtonResponse() {}
+
+void SubscribeButtonResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
new file mode 100644
index 0000000000..eb4ca42568
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeWayPointsRequest::SubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {}
+
+void SubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (application_manager_.IsAppSubscribedForWayPoints(app)) {
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ if (application_manager_.IsAnyAppSubscribedForWayPoints()) {
+ application_manager_.SubscribeAppForWayPoints(app);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true);
+}
+
+void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ if (result) {
+ application_manager_.SubscribeAppForWayPoints(app);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool SubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
new file mode 100644
index 0000000000..7d051df7e9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SubscribeWayPointsResponse::SubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {}
+
+void SubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
new file mode 100644
index 0000000000..cea00a9d5e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
@@ -0,0 +1,700 @@
+/*
+
+Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/system_request.h"
+
+#include <vector>
+#include <string>
+#include <stdio.h>
+#include <algorithm>
+#include <sstream>
+#include "application_manager/policies/policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "policy/policy_table/enums.h"
+#include "formatters/CFormatterJsonBase.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+CREATE_LOGGERPTR_LOCAL(logger_, "ApplicationManager")
+namespace {
+
+#ifdef ENABLE_LOG
+const char* kQueryAppsValidationFailedPrefix =
+ ":QUERY_APPS_VALIDATION_FAILED: ";
+#endif
+
+const unsigned int kVrSynonymLengthMax = 40U;
+const unsigned int kVrSynonymLengthMin = 1U;
+const unsigned int kTtsNameLengthMax = 500U;
+const unsigned int kVrArraySizeMax = 100U;
+const unsigned int kVrArraySizeMin = 1U;
+const unsigned int kUrlSchemaLengthMax = 255U;
+const unsigned int kPackageNameLengthMax = 255U;
+const unsigned int kAppIdLengthMax = 40U;
+const unsigned int kAppNameLengthMax = 100U;
+const unsigned int kLanguageArraySizeMax = 100U;
+
+class QueryAppsDataValidator {
+ public:
+ typedef std::set<std::string> SynonymsSet;
+ typedef std::map<std::string, SynonymsSet> SynonymsMap;
+
+ QueryAppsDataValidator(smart_objects::SmartObject& object,
+ const ApplicationManager& manager)
+ : data_(object), manager_(manager) {}
+
+ bool Validate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!data_.isValid()) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not valid.");
+ return false;
+ }
+ if (!HasResponseKey()) {
+ return false;
+ }
+ return ValidateAppDataAndOsAndLanguagesData();
+ }
+
+ private:
+ bool HasResponseKey() const {
+ if (!data_.keyExists(json::response)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response does not contain '"
+ << json::response << "' parameter.");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateAppDataAndOsAndLanguagesData() {
+ smart_objects::SmartArray* objects_array = data_[json::response].asArray();
+
+ if (!objects_array) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not array.");
+ return false;
+ }
+
+ SynonymsMap synonyms_map;
+ bool has_response_valid_application = false;
+
+ smart_objects::SmartArray::iterator applications_iterator =
+ objects_array->begin();
+
+ for (; applications_iterator != objects_array->end();) {
+ const smart_objects::SmartObject& app_data = *applications_iterator;
+
+ if (!app_data.isValid()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Wrong application data in json file.");
+ return false;
+ }
+
+ if (!CheckMandatoryParametersPresent(app_data)) {
+ LOG4CXX_WARN(logger_,
+ "Application hasn`t some of mandatory parameters. "
+ "Application will be skipped.");
+
+ applications_iterator = objects_array->erase(applications_iterator);
+ continue;
+ }
+
+ if (!ValidateAppIdAndAppName(app_data)) {
+ return false;
+ }
+
+ // If we dont have any of android/ios field
+ // we skip this json in CheckMandatoryParametersPresent
+ const std::string os_type =
+ (app_data.keyExists(json::android)) ? json::android : json::ios;
+
+ // Verify os and dependent languages data
+ if (json::ios == os_type) {
+ if (app_data[json::ios][json::urlScheme].asString().length() >
+ kUrlSchemaLengthMax) {
+ LOG4CXX_WARN(
+ logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An urlscheme length exceeds maximum allowed ["
+ << app_data[json::ios][json::urlScheme].asString().length()
+ << "]>[" << kUrlSchemaLengthMax << "]");
+ return false;
+ }
+ }
+
+ if (json::android == os_type) {
+ if (app_data[json::android][json::packageName].asString().length() >
+ kPackageNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Package name length ["
+ << app_data[json::android][json::packageName]
+ .asString()
+ .length() << "] exceeds max length ["
+ << kPackageNameLengthMax << "]in json file.");
+ return false;
+ }
+ }
+
+ // Languages verification
+ if (!app_data[os_type].keyExists(json::languages)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages' doesn't exist");
+ return false;
+ }
+ if (!ValidateLanguages(app_data[os_type][json::languages],
+ synonyms_map)) {
+ return false;
+ }
+ has_response_valid_application = true;
+ ++applications_iterator;
+ }
+ return has_response_valid_application;
+ }
+
+ bool ValidateAppIdAndAppName(const smart_objects::SmartObject& app_data) {
+ // Verify appid length
+ const std::string app_id(app_data[json::appId].asString());
+ if (app_id.length() > kAppIdLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An Object ID length exceeds maximum allowed ["
+ << app_id.length() << "]>[" << kAppIdLengthMax << "]");
+ return false;
+ }
+
+ // Verify that appid is unique
+ if (applications_id_set_.find(app_id) != applications_id_set_.end()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "An Object ID is not unigue [" << app_id << "]");
+ return false;
+ }
+ applications_id_set_.insert(app_id);
+
+ // Verify that app is not registered yet
+ ApplicationSharedPtr registered_app =
+ manager_.application_by_policy_id(app_id);
+ if (registered_app) {
+ LOG4CXX_INFO(logger_,
+ "Application with the id: " << app_id
+ << " is already registered.");
+ }
+ // And app name length
+ const std::string appName(app_data[json::name].asString());
+ if (appName.length() > kAppNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "Name of application exceeds maximum allowed ["
+ << appName.length() << "]>[" << kAppNameLengthMax
+ << "].");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateLanguages(const smart_objects::SmartObject& languages,
+ SynonymsMap& synonyms_map) const {
+ bool default_language_found = false;
+ const size_t languages_array_size = languages.length();
+ if (languages_array_size > kLanguageArraySizeMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages' array exceeds max size ["
+ << languages_array_size << "]>[" << kLanguageArraySizeMax
+ << "]");
+ return false;
+ }
+ // Every language has ttsname string and vrsynonyms array
+ for (size_t idx = 0; idx < languages_array_size; ++idx) {
+ const smart_objects::SmartObject& language = languages.getElement(idx);
+ if (smart_objects::SmartType_Map != language.getType()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language is not a map.");
+ return false;
+ }
+ if (language.length() != 1) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language map size is not equal 1.");
+ return false;
+ }
+ const std::string language_name = (*language.map_begin()).first;
+ if (!language_name.length()) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "language name is empty");
+ return false;
+ }
+ // Verify default language defined
+ if (!(language_name).compare(json::default_)) {
+ default_language_found = true;
+ }
+ // Add set for synonyms' duplicates validation
+ if (synonyms_map.find(language_name) == synonyms_map.end()) {
+ synonyms_map[language_name] = SynonymsSet();
+ }
+ // ttsName verification
+ if (!language[language_name].keyExists(json::ttsName)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages.ttsName' doesn't exist");
+ return false;
+ }
+ const smart_objects::SmartObject& ttsNameObject =
+ language[language_name][json::ttsName];
+ // ttsName is string
+ if (smart_objects::SmartType_String == ttsNameObject.getType()) {
+ const std::string ttsName =
+ language[language_name][json::ttsName].asString();
+ if (ttsName.length() > kTtsNameLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "ttsName string exceeds max length ["
+ << ttsName.length() << "]>[" << kTtsNameLengthMax
+ << "]");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "ttsName is not the string type.");
+ return false;
+ }
+
+ if (!ValidateSynonymsAtLanguage(language, language_name, synonyms_map)) {
+ return false;
+ }
+ }
+ if (!default_language_found) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << " 'languages'.default' doesn't exist");
+ return false;
+ }
+ return true;
+ }
+
+ bool ValidateSynonymsAtLanguage(const smart_objects::SmartObject& language,
+ const std::string& language_name,
+ SynonymsMap& synonyms_map) const {
+ if (!language[language_name].keyExists(json::vrSynonyms)) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "'languages.vrSynonyms' doesn't exist");
+ return false;
+ }
+ const smart_objects::SmartArray* synonyms_array =
+ language[language_name][json::vrSynonyms].asArray();
+ if (!synonyms_array) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynonyms is not array.");
+ return false;
+ }
+ const size_t synonyms_array_size = synonyms_array->size();
+ if (synonyms_array_size < kVrArraySizeMin) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynomyms array has [" << synonyms_array_size
+ << "] size < allowed min size [" << kVrArraySizeMin
+ << "]");
+ return false;
+ }
+ if (synonyms_array_size > kVrArraySizeMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSynomyms array size [" << synonyms_array_size
+ << "] exceeds maximum allowed size [" << kVrArraySizeMax
+ << "]");
+ return false;
+ }
+
+ for (std::size_t idx = 0; idx < synonyms_array_size; ++idx) {
+ const smart_objects::SmartObject& synonym = (*synonyms_array)[idx];
+ const std::string vrSynonym = synonym.asString();
+ if (vrSynonym.length() > kVrSynonymLengthMax) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item [" << idx
+ << "] exceeds max length [" << vrSynonym.length()
+ << "]>[" << kVrSynonymLengthMax << "]");
+ return false;
+ }
+ if (vrSynonym.length() < kVrSynonymLengthMin) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item [" << idx << "] length ["
+ << vrSynonym.length() << "] is less then min length ["
+ << kVrSynonymLengthMin << "] allowed.");
+ return false;
+ }
+ // Verify duplicates
+ SynonymsMap::iterator synonyms_map_iter =
+ synonyms_map.find(language_name);
+ if (synonyms_map_iter != synonyms_map.end()) {
+ if (!(*synonyms_map_iter).second.insert(vrSynonym).second) {
+ LOG4CXX_WARN(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "vrSYnomym item already defined ["
+ << vrSynonym.c_str() << "] for language ["
+ << language_name << "]");
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ bool CheckMandatoryParametersPresent(
+ const smart_objects::SmartObject& app_data) const {
+ if (!app_data.keyExists(json::android) && !app_data.keyExists(json::ios)) {
+ return false;
+ }
+
+ if (app_data.keyExists(json::android) &&
+ !app_data[json::android].keyExists(json::packageName)) {
+ return false;
+ }
+
+ if (app_data.keyExists(json::ios) &&
+ !app_data[json::ios].keyExists(json::urlScheme)) {
+ return false;
+ }
+
+ if (!app_data.keyExists(json::appId)) {
+ return false;
+ }
+
+ if (!app_data.keyExists(json::name)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ smart_objects::SmartObject& data_;
+ std::set<std::string> applications_id_set_;
+ const ApplicationManager& manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator);
+};
+}
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+uint32_t SystemRequest::index = 0;
+
+const std::string kSYNC = "SYNC";
+const std::string kIVSU = "IVSU";
+
+SystemRequest::SystemRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SystemRequest::~SystemRequest() {}
+
+void SystemRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message_)[strings::msg_params][strings::request_type].asInt());
+
+ const policy::PolicyHandlerInterface& policy_handler = policy_handler_;
+
+ const std::string stringified_request_type =
+ rpc::policy_table_interface_base::EnumToJsonString(
+ static_cast<rpc::policy_table_interface_base::RequestType>(
+ request_type));
+
+ if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
+ request_type)) {
+ LOG4CXX_ERROR(logger_,
+ "RequestType " << stringified_request_type
+ << " is DISALLOWED by policies");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ LOG4CXX_TRACE(logger_,
+ "RequestType " << stringified_request_type << " is ALLOWED");
+
+ const bool request_subtype_present =
+ (*message_)[strings::msg_params].keyExists(strings::request_subtype);
+ if (request_subtype_present) {
+ const std::string request_subtype =
+ (*message_)[strings::msg_params][strings::request_subtype].asString();
+ if (!policy_handler.IsRequestSubTypeAllowed(application->policy_app_id(),
+ request_subtype)) {
+ LOG4CXX_ERROR(logger_,
+ "Request subtype: " << request_subtype
+ << " is DISALLOWED by policies");
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+ LOG4CXX_TRACE(logger_,
+ "Request subtype: " << request_subtype << " is ALLOWED");
+ }
+
+ std::string file_name = kSYNC;
+ if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
+ file_name = (*message_)[strings::msg_params][strings::file_name].asString();
+ } else {
+ file_name = kSYNC;
+ }
+
+ if (!CheckSyntax(file_name)) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!file_system::IsFileNameValid(file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
+ const bool is_system_file = std::string::npos != file_name.find(kSYNC) ||
+ std::string::npos != file_name.find(kIVSU);
+
+ // to avoid override existing file
+ if (is_system_file) {
+ const uint8_t max_size = 255;
+ char buf[max_size] = {'\0'};
+ snprintf(buf, max_size - 1, "%d%s", index++, file_name.c_str());
+ file_name = buf;
+ }
+
+ std::vector<uint8_t> binary_data;
+ std::string binary_data_folder;
+ if ((*message_)[strings::params].keyExists(strings::binary_data)) {
+ binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
+ binary_data_folder =
+ application_manager_.get_settings().system_files_path();
+ } else {
+ binary_data_folder =
+ application_manager_.get_settings().app_storage_folder();
+ binary_data_folder += "/";
+ binary_data_folder += application->folder_name();
+ binary_data_folder += "/";
+ }
+
+ std::string file_dst_path =
+ application_manager_.get_settings().system_files_path();
+ file_dst_path += "/";
+ file_dst_path += file_name;
+
+ if ((*message_)[strings::params].keyExists(strings::binary_data)) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Binary data is present. Trying to save it to: " << binary_data_folder);
+ if (mobile_apis::Result::SUCCESS !=
+ (application_manager_.SaveBinary(
+ binary_data, binary_data_folder, file_name, 0))) {
+ LOG4CXX_DEBUG(logger_, "Binary data can't be saved.");
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+ } else {
+ std::string app_full_file_path = binary_data_folder;
+ app_full_file_path += file_name;
+
+ LOG4CXX_DEBUG(logger_,
+ "Binary data is not present. Trying to find file "
+ << file_name << " within previously saved app file in "
+ << binary_data_folder);
+
+ const application_manager::AppFile* file =
+ application->GetFile(app_full_file_path);
+ if (!file || !file->is_download_complete ||
+ !file_system::MoveFile(app_full_file_path, file_dst_path)) {
+ LOG4CXX_DEBUG(logger_, "Binary data not found.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ processing_file_ = file_dst_path;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Binary data ok.");
+
+ if (mobile_apis::RequestType::HTTP == request_type &&
+ (*message_)[strings::msg_params].keyExists(strings::file_name)) {
+ const std::string& file =
+ (*message_)[strings::msg_params][strings::file_name].asString();
+ policy_handler_.ReceiveMessageFromSDK(file, binary_data);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ } else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
+ using namespace ns_smart_device_link::ns_json_handler::formatters;
+
+ smart_objects::SmartObject sm_object;
+ Json::Reader reader;
+ std::string json(binary_data.begin(), binary_data.end());
+ Json::Value root;
+ if (!reader.parse(json.c_str(), root)) {
+ LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file.");
+ return;
+ }
+
+ CFormatterJsonBase::jsonValueToObj(root, sm_object);
+ if (!ValidateQueryAppData(sm_object)) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+
+ application_manager_.ProcessQueryApp(sm_object, connection_key());
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (std::string::npos != file_name.find(kIVSU)) {
+ msg_params[strings::file_name] = file_name;
+ } else {
+ msg_params[strings::file_name] = file_dst_path;
+ }
+
+ // expected int, mandatory=true, all Policies flow (HTTP,Proprietary,External)
+ msg_params[strings::app_id] = application->hmi_app_id();
+
+ msg_params[strings::request_type] =
+ (*message_)[strings::msg_params][strings::request_type];
+ if (request_subtype_present) {
+ msg_params[strings::request_subtype] =
+ (*message_)[strings::msg_params][strings::request_subtype];
+ }
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
+ &msg_params,
+ true);
+}
+
+void SystemRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_api::Result::SUCCESS,
+ mobile_api::Result::WARNINGS);
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
+ if (application.use_count() == 0) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (!processing_file_.empty()) {
+ file_system::DeleteFile(processing_file_);
+ processing_file_.clear();
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool SystemRequest::ValidateQueryAppData(
+ smart_objects::SmartObject& data) const {
+ if (!data.isValid()) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response is not valid.");
+ return false;
+ }
+ if (!data.keyExists(json::response)) {
+ LOG4CXX_ERROR(logger_,
+ kQueryAppsValidationFailedPrefix
+ << "QueryApps response does not contain '"
+ << json::response << "' parameter.");
+ return false;
+ }
+
+ QueryAppsDataValidator validator(data, application_manager_);
+ return validator.Validate();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
new file mode 100644
index 0000000000..dc2e3ea3f5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/system_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+SystemResponse::SystemResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SystemResponse::~SystemResponse() {}
+
+void SystemResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
new file mode 100644
index 0000000000..9119fb48da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void UnregisterAppInterfaceRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.application(connection_key())) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ rpc_service_.ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key(),
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
+ SOURCE_SDL);
+ application_manager_.EndNaviServices(connection_key());
+ application_manager_.UnregisterApplication(connection_key(),
+ mobile_apis::Result::SUCCESS);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
new file mode 100644
index 0000000000..4e7c879b58
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc
@@ -0,0 +1,48 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+void UnregisterAppInterfaceResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
new file mode 100644
index 0000000000..ccfaef54cb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
@@ -0,0 +1,126 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
+
+#include "application_manager/application_impl.h"
+#include "utils/semantic_version.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+UnsubscribeButtonRequest::UnsubscribeButtonRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
+
+void UnsubscribeButtonRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+
+ if (app->msg_version() <= utils::version_4_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Button " << btn_id << " isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+
+ if (!app->UnsubscribeFromButton(
+ static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
+ LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ SendUnsubscribeButtonNotification();
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+bool UnsubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ // send OnButtonSubscription notification
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
+ (*message_)[strings::msg_params][strings::button_name].asInt());
+ msg_params[strings::is_suscribed] = false;
+ CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
new file mode 100644
index 0000000000..592b91851e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeButtonResponse::UnsubscribeButtonResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
+
+void UnsubscribeButtonResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
new file mode 100644
index 0000000000..40bb1ddfc9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
@@ -0,0 +1,117 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "application_manager/message_helper.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeWayPointsRequest::~UnsubscribeWayPointsRequest() {}
+
+void UnsubscribeWayPointsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "An application with connection key "
+ << connection_key() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!application_manager_.IsAppSubscribedForWayPoints(app)) {
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
+}
+
+void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
+ LOG4CXX_INFO(logger_, "Received Navigation_UnsubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ if (result) {
+ application_manager_.UnsubscribeAppFromWayPoints(app);
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool UnsubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
new file mode 100644
index 0000000000..67e3466a44
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {}
+
+void UnsubscribeWayPointsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
new file mode 100644
index 0000000000..c04ad34f5f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
@@ -0,0 +1,243 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/custom_string.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+UpdateTurnListRequest::UpdateTurnListRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UpdateTurnListRequest::~UpdateTurnListRequest() {}
+
+void UpdateTurnListRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming update turn list has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ // ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
+ app,
+ policy_handler_,
+ application_manager_);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ smart_objects::SmartObject& turn_list_array =
+ ((*message_)[strings::msg_params][strings::turn_list]);
+ for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
+ if ((turn_list_array[i].keyExists(strings::turn_icon)) &&
+ (mobile_apis::Result::INVALID_DATA ==
+ MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon],
+ app,
+ application_manager_))) {
+ LOG4CXX_ERROR(logger_,
+ "MessageHelper::VerifyImage return INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ if (!CheckTurnListArray()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ for (uint32_t i = 0; i < msg_params[strings::turn_list].length(); ++i) {
+ if (msg_params[strings::turn_list][i].keyExists(hmi_request::navi_text)) {
+ const custom_str::CustomString& navigation_text =
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ .asCustomString();
+ msg_params[strings::turn_list][i].erase(hmi_request::navi_text);
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ [hmi_request::field_name] = static_cast<int>(
+ hmi_apis::Common_TextFieldName::turnText);
+ msg_params[strings::turn_list][i][hmi_request::navi_text]
+ [hmi_request::field_text] = navigation_text;
+ }
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
+ (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendHMIRequest(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true);
+ } else {
+ // conditional mandatory
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
+ const hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool UpdateTurnListRequest::CheckTurnListArray() {
+ int32_t length =
+ (*message_)[strings::msg_params][strings::turn_list].length();
+ if (0 == length) {
+ return false;
+ }
+
+ for (int32_t i = 0; i < length; ++i) {
+ if (!((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
+ hmi_request::navi_text)) &&
+ !((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
+ strings::turn_icon))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool UpdateTurnListRequest::IsWhiteSpaceExist() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ const smart_objects::SmartArray* tl_array =
+ (*message_)[strings::msg_params][strings::turn_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tl = tl_array->begin();
+ smart_objects::SmartArray::const_iterator it_tl_end = tl_array->end();
+
+ for (; it_tl != it_tl_end; ++it_tl) {
+ if ((*it_tl).keyExists(strings::navigation_text)) {
+ str = (*it_tl)[strings::navigation_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid turn_list navigation_text text syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*it_tl).keyExists(strings::turn_icon)) {
+ str = (*it_tl)[strings::turn_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(
+ logger_, "Invalid turn_list turn_icon value syntax check failed");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
new file mode 100644
index 0000000000..5ddf355f88
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+UpdateTurnListResponse::UpdateTurnListResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UpdateTurnListResponse::~UpdateTurnListResponse() {}
+
+void UpdateTurnListResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
new file mode 100644
index 0000000000..7065c7cf7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -0,0 +1,847 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h"
+#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h"
+#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h"
+#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls.h"
+#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h"
+
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h"
+
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+HMICommandFactory::HMICommandFactory(
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+CommandSharedPtr HMICommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+ LOG4CXX_DEBUG(
+ logger_, "HMICommandFactory::CreateCommand function_id: " << function_id);
+
+ const hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ if (hmi_apis::messageType::response == message_type) {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response");
+ } else if ((*message)[strings::params][strings::message_type] ==
+ hmi_apis::messageType::error_response) {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response");
+ } else {
+ LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand request");
+ }
+
+ return get_creator_factory(function_id, message_type, source).create(message);
+}
+
+bool HMICommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ return get_creator_factory(
+ static_cast<hmi_apis::FunctionID::eType>(function_id),
+ hmi_apis::messageType::INVALID_ENUM,
+ message_source).CanBeCreated();
+}
+
+CommandCreator& HMICommandFactory::get_creator_factory(
+ hmi_apis::FunctionID::eType id,
+ hmi_apis::messageType::eType message_type,
+ application_manager::commands::Command::CommandSource source) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (static_cast<int32_t>(id)) {
+ case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: {
+ return factory.GetCreator<commands::OnStartDeviceDiscovery>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateDeviceListRequest>()
+ : factory.GetCreator<commands::UpdateDeviceListResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_ActivateApp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ActivateAppRequest>()
+ : factory.GetCreator<commands::ActivateAppResponse>();
+ }
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::DecryptCertificateRequest>()
+ : factory.GetCreator<commands::DecryptCertificateResponse>();
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetSystemInfoRequest>()
+ : factory.GetCreator<commands::GetSystemInfoResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_ActivateApp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLActivateAppRequest>()
+ : factory.GetCreator<commands::SDLActivateAppResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLPolicyUpdate>()
+ : factory.GetCreator<commands::SDLPolicyUpdateResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetURLS: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetUrls>()
+ : factory.GetCreator<commands::GetUrlsResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: {
+ return factory.GetCreator<commands::OnAppPermissionChangedNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_GetListOfPermissions: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::SDLGetListOfPermissionsRequest>()
+ : factory
+ .GetCreator<commands::SDLGetListOfPermissionsResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::SDLGetUserFriendlyMessageRequest>()
+ : factory.GetCreator<
+ commands::SDLGetUserFriendlyMessageResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_GetStatusUpdate: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SDLGetStatusUpdateRequest>()
+ : factory.GetCreator<commands::SDLGetStatusUpdateResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnStatusUpdate: {
+ return factory.GetCreator<commands::OnStatusUpdateNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: {
+ return factory.GetCreator<commands::OnAppPermissionConsentNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::MixingAudioSupportedRequest>()
+ : factory.GetCreator<commands::MixingAudioSupportedResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: {
+ return factory.GetCreator<commands::OnExitAllApplicationsNotification>();
+ }
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAddCommandRequest>()
+ : factory.GetCreator<commands::UIAddCommandResponse>();
+ }
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIDeleteCommandRequest>()
+ : factory.GetCreator<commands::UIDeleteCommandResponse>();
+ }
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAddSubmenuRequest>()
+ : factory.GetCreator<commands::UIAddSubmenuResponse>();
+ }
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIDeleteSubmenuRequest>()
+ : factory.GetCreator<commands::UIDeleteSubmenuResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetMediaClockTimerRequest>()
+ : factory.GetCreator<commands::UISetMediaClockTimerResponse>();
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIPerformInteractionRequest>()
+ : factory.GetCreator<commands::UIPerformInteractionResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::UISetGlobalPropertiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIScrollableMessageRequest>()
+ : factory.GetCreator<commands::UIScrollableMessageResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISetAppIconRequest>()
+ : factory.GetCreator<commands::UISetAppIconResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::UIGetSupportedLanguagesRequest>()
+ : factory
+ .GetCreator<commands::UIGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIGetLanguageRequest>()
+ : factory.GetCreator<commands::UIGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::UI_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::UIGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIChangeRegistrationRequest>()
+ : factory.GetCreator<commands::UIChangeRegistratioResponse>();
+ }
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIPerformAudioPassThruRequest>()
+ : factory
+ .GetCreator<commands::UIPerformAudioPassThruResponse>();
+ }
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIEndAudioPassThruRequest>()
+ : factory.GetCreator<commands::UIEndAudioPassThruResponse>();
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIAlertRequest>()
+ : factory.GetCreator<commands::UIAlertResponse>();
+ }
+ case hmi_apis::FunctionID::VR_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRIsReadyRequest>()
+ : factory.GetCreator<commands::VRIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRAddCommandRequest>()
+ : factory.GetCreator<commands::VRAddCommandResponse>();
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRDeleteCommandRequest>()
+ : factory.GetCreator<commands::VRDeleteCommandResponse>();
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRChangeRegistrationRequest>()
+ : factory.GetCreator<commands::VRChangeRegistrationResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::VRGetSupportedLanguagesRequest>()
+ : factory
+ .GetCreator<commands::VRGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRGetLanguageRequest>()
+ : factory.GetCreator<commands::VRGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::VR_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::VRGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSIsReadyRequest>()
+ : factory.GetCreator<commands::TTSIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSChangeRegistrationRequest>()
+ : factory.GetCreator<commands::TTSChangeRegistratioResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetSupportedLanguages: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::TTSGetSupportedLanguagesRequest>()
+ : factory.GetCreator<
+ commands::TTSGetSupportedLanguagesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSStopSpeakingRequest>()
+ : factory.GetCreator<commands::TTSStopSpeakingResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetLanguage: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSGetLanguageRequest>()
+ : factory.GetCreator<commands::TTSGetLanguageResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSSpeakRequest>()
+ : factory.GetCreator<commands::TTSSpeakResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSSetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::TTSSetGlobalPropertiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::TTSGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::TTSGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::TTS_Started: {
+ return factory.GetCreator<commands::OnTTSStartedNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_Stopped: {
+ return factory.GetCreator<commands::OnTTSStoppedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: {
+ return factory.GetCreator<commands::OnAppActivatedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL: {
+ return factory.GetCreator<commands::OnAwakeSDLNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
+ return factory.GetCreator<commands::OnExitApplicationNotification>();
+ }
+ case hmi_apis::FunctionID::UI_Show: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIShowRequest>()
+ : factory.GetCreator<commands::UIShowResponse>();
+ }
+ case hmi_apis::FunctionID::UI_Slider: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISliderRequest>()
+ : factory.GetCreator<commands::UISliderResponse>();
+ }
+ case hmi_apis::FunctionID::UI_ClosePopUp: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ClosePopupRequest>()
+ : factory.GetCreator<commands::ClosePopupResponse>();
+ }
+ case hmi_apis::FunctionID::UI_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UIIsReadyRequest>()
+ : factory.GetCreator<commands::UIIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviIsReadyRequest>()
+ : factory.GetCreator<commands::NaviIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviAlertManeuverRequest>()
+ : factory.GetCreator<commands::NaviAlertManeuverResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_GetWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviGetWayPointsRequest>()
+ : factory.GetCreator<commands::NaviGetWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviUpdateTurnListRequest>()
+ : factory.GetCreator<commands::NaviUpdateTurnListResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviShowConstantTBTRequest>()
+ : factory.GetCreator<commands::NaviShowConstantTBTResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSubscribeWayPointsRequest>()
+ : factory
+ .GetCreator<commands::NaviSubscribeWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::NaviUnsubscribeWayPointsRequest>()
+ : factory.GetCreator<
+ commands::NaviUnsubscribeWayPointsResponse>();
+ }
+ case hmi_apis::FunctionID::Buttons_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ButtonGetCapabilitiesRequest>()
+ : factory
+ .GetCreator<commands::ButtonGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
+ return factory
+ .GetCreator<commands::OnAllowSDLFunctionalityNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: {
+ return factory.GetCreator<commands::OnSDLConsentNeededNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_UpdateSDL: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateSDLRequest>()
+ : factory.GetCreator<commands::UpdateSDLResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
+ return factory.GetCreator<commands::OnIgnitionCycleOverNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: {
+ return factory.GetCreator<commands::OnSystemInfoChangedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ return factory.GetCreator<commands::OnReadyNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady: {
+ return factory.GetCreator<commands::OnSystemTimeReadyNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: {
+ return factory.GetCreator<commands::OnDeviceChosenNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnSystemContext: {
+ return factory.GetCreator<commands::OnSystemContextNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnDriverDistraction: {
+ return factory
+ .GetCreator<commands::hmi::OnDriverDistractionNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
+ return factory.GetCreator<commands::OnUpdateDeviceList>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: {
+ return factory.GetCreator<commands::OnAppRegisteredNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: {
+ return factory.GetCreator<commands::OnAppUnregisteredNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: {
+ return factory.GetCreator<commands::OnFindApplications>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateAppListRequest>()
+ : factory.GetCreator<commands::UpdateAppListResponse>();
+ }
+ case hmi_apis::FunctionID::VR_Started: {
+ return factory.GetCreator<commands::OnVRStartedNotification>();
+ }
+ case hmi_apis::FunctionID::VR_Stopped: {
+ return factory.GetCreator<commands::OnVRStoppedNotification>();
+ }
+ case hmi_apis::FunctionID::VR_OnCommand: {
+ return factory.GetCreator<commands::OnVRCommandNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnCommand: {
+ return factory.GetCreator<commands::OnUICommandNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: {
+ return factory.GetCreator<commands::OnAppDeactivatedNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnLanguageChange: {
+ return factory.GetCreator<commands::OnUILanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::VR_OnLanguageChange: {
+ return factory.GetCreator<commands::OnVRLanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_OnLanguageChange: {
+ return factory.GetCreator<commands::OnTTSLanguageChangeNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonEvent: {
+ return factory.GetCreator<commands::hmi::OnButtonEventNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonPress: {
+ return factory.GetCreator<commands::hmi::OnButtonPressNotification>();
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
+ return factory
+ .GetCreator<commands::hmi::OnButtonSubscriptionNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
+ return factory.GetCreator<commands::OnNaviTBTClientStateNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnKeyboardInput: {
+ return factory.GetCreator<commands::hmi::OnUIKeyBoardInputNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnTouchEvent: {
+ return factory.GetCreator<commands::hmi::OnUITouchEventNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ return factory.GetCreator<commands::hmi::OnUIResetTimeoutNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSetVideoConfigRequest>()
+ : factory.GetCreator<commands::NaviSetVideoConfigResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StartStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviStartStreamRequest>()
+ : factory.GetCreator<commands::NaviStartStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StopStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviStopStreamRequest>()
+ : factory.GetCreator<commands::NaviStopStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StartAudioStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::AudioStartStreamRequest>()
+ : factory.GetCreator<commands::AudioStartStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_StopAudioStream: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::AudioStopStreamRequest>()
+ : factory.GetCreator<commands::AudioStopStreamResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: {
+ return factory.GetCreator<commands::OnAudioDataStreamingNotification>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: {
+ return factory.GetCreator<commands::OnVideoDataStreamingNotification>();
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VRPerformInteractionRequest>()
+ : factory.GetCreator<commands::VRPerformInteractionResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: {
+ return factory.GetCreator<commands::OnSystemRequestNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnPutFile: {
+ return factory.GetCreator<commands::OnPutFileNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: {
+ return factory.GetCreator<commands::OnResumeAudioSourceNotification>();
+ }
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UiSetDisplayLayoutRequest>()
+ : factory.GetCreator<commands::UiSetDisplayLayoutResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: {
+ return factory.GetCreator<commands::OnSDLCloseNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: {
+ return factory
+ .GetCreator<commands::OnSDLPersistenceCompleteNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: {
+ return factory.GetCreator<commands::OnFileRemovedNotification>();
+ }
+ case hmi_apis::FunctionID::UI_OnRecordStart: {
+ return factory.GetCreator<commands::OnRecordStartdNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::BasicCommunicationSystemRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationSystemResponse>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemTime: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::BasicCommunicationGetSystemTimeRequest>()
+ : factory.GetCreator<
+ commands::BasicCommunicationGetSystemTimeResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_SendLocation: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::NaviSendLocationRequest>()
+ : factory.GetCreator<commands::NaviSendLocationResponse>();
+ }
+ case hmi_apis::FunctionID::SDL_AddStatisticsInfo: {
+ return factory.GetCreator<commands::AddStatisticsInfoNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnSystemError: {
+ return factory.GetCreator<commands::OnSystemErrorNotification>();
+ }
+ case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: {
+ return factory.GetCreator<commands::OnReceivedPolicyUpdate>();
+ }
+ case hmi_apis::FunctionID::SDL_OnPolicyUpdate: {
+ return factory.GetCreator<commands::OnPolicyUpdate>();
+ }
+ case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
+ return factory.GetCreator<commands::OnDeviceStateChangedNotification>();
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ return factory.GetCreator<commands::hmi::OnTTSResetTimeoutNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: {
+ return factory.GetCreator<commands::OnEventChangedNotification>();
+ }
+ case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::hmi::DialNumberRequest>()
+ : factory.GetCreator<commands::hmi::DialNumberResponse>();
+ }
+ case hmi_apis::FunctionID::Navigation_OnWayPointChange: {
+ return factory.GetCreator<commands::OnNaviWayPointChangeNotification>();
+ }
+ case hmi_apis::FunctionID::RC_IsReady: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::RCIsReadyRequest>()
+ : factory.GetCreator<commands::RCIsReadyResponse>();
+ }
+ case hmi_apis::FunctionID::RC_GetCapabilities: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::RCGetCapabilitiesRequest>()
+ : factory.GetCreator<commands::RCGetCapabilitiesResponse>();
+ }
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UISendHapticDataRequest>()
+ : factory.GetCreator<commands::UISendHapticDataResponse>();
+ }
+ default: { return factory.GetCreator<InvalidCommand>(); }
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
new file mode 100644
index 0000000000..5207c7e432
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
@@ -0,0 +1,442 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+#include "sdl_rpc_plugin/commands/mobile/add_command_request.h"
+#include "sdl_rpc_plugin/commands/mobile/add_command_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h"
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h"
+#include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_request.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_response.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h"
+#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h"
+#include "sdl_rpc_plugin/commands/mobile/change_registration_response.h"
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h"
+#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_file_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_file_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h"
+#include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h"
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/mobile/generic_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/list_files_request.h"
+#include "sdl_rpc_plugin/commands/mobile/list_files_response.h"
+#include "sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h"
+#include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h"
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/mobile/perform_interaction_response.h"
+#include "sdl_rpc_plugin/commands/mobile/put_file_request.h"
+#include "sdl_rpc_plugin/commands/mobile/put_file_response.h"
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h"
+#include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h"
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h"
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h"
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h"
+#include "sdl_rpc_plugin/commands/mobile/show_request.h"
+#include "sdl_rpc_plugin/commands/mobile/show_response.h"
+#include "sdl_rpc_plugin/commands/mobile/slider_request.h"
+#include "sdl_rpc_plugin/commands/mobile/slider_response.h"
+#include "sdl_rpc_plugin/commands/mobile/speak_request.h"
+#include "sdl_rpc_plugin/commands/mobile/speak_response.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
+#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h"
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h"
+#include "sdl_rpc_plugin/commands/mobile/system_request.h"
+#include "sdl_rpc_plugin/commands/mobile/system_response.h"
+#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_location_response.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
+#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
+#include "interfaces/MOBILE_API.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+namespace sdl_rpc_plugin {
+using namespace application_manager;
+
+CommandCreator& MobileCommandFactory::get_creator_factory(
+ mobile_apis::FunctionID::eType id,
+ mobile_apis::messageType::eType message_type,
+ app_mngr::commands::Command::CommandSource source) const {
+ CommandCreatorFactory factory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (id) {
+ case mobile_apis::FunctionID::RegisterAppInterfaceID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::RegisterAppInterfaceRequest>()
+ : factory.GetCreator<commands::RegisterAppInterfaceResponse>();
+ }
+ case mobile_apis::FunctionID::UnregisterAppInterfaceID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnregisterAppInterfaceRequest>()
+ : factory
+ .GetCreator<commands::UnregisterAppInterfaceResponse>();
+ }
+ case mobile_apis::FunctionID::SetGlobalPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetGlobalPropertiesRequest>()
+ : factory.GetCreator<commands::SetGlobalPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::ResetGlobalPropertiesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ResetGlobalPropertiesRequest>()
+ : factory
+ .GetCreator<commands::ResetGlobalPropertiesResponse>();
+ }
+ case mobile_apis::FunctionID::AddCommandID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AddCommandRequest>()
+ : factory.GetCreator<commands::AddCommandResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteCommandID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteCommandRequest>()
+ : factory.GetCreator<commands::DeleteCommandResponse>();
+ }
+ case mobile_apis::FunctionID::AddSubMenuID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AddSubMenuRequest>()
+ : factory.GetCreator<commands::AddSubMenuResponse>();
+ }
+
+ case mobile_apis::FunctionID::DeleteSubMenuID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteSubMenuRequest>()
+ : factory.GetCreator<commands::DeleteSubMenuResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::DeleteInteractionChoiceSetRequest>()
+ : factory.GetCreator<
+ commands::DeleteInteractionChoiceSetResponse>();
+ }
+ case mobile_apis::FunctionID::AlertID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AlertRequest>()
+ : factory.GetCreator<commands::AlertResponse>();
+ }
+ case mobile_apis::FunctionID::SpeakID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SpeakRequest>()
+ : factory.GetCreator<commands::SpeakResponse>();
+ }
+ case mobile_apis::FunctionID::SliderID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SliderRequest>()
+ : factory.GetCreator<commands::SliderResponse>();
+ }
+ case mobile_apis::FunctionID::PerformAudioPassThruID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PerformAudioPassThruRequest>()
+ : factory.GetCreator<commands::PerformAudioPassThruResponse>();
+ }
+
+ case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<
+ commands::CreateInteractionChoiceSetRequest>()
+ : factory.GetCreator<
+ commands::CreateInteractionChoiceSetResponse>();
+ }
+ case mobile_apis::FunctionID::PerformInteractionID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PerformInteractionRequest>()
+ : factory.GetCreator<commands::PerformInteractionResponse>();
+ }
+ case mobile_apis::FunctionID::EndAudioPassThruID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::EndAudioPassThruRequest>()
+ : factory.GetCreator<commands::EndAudioPassThruResponse>();
+ }
+ case mobile_apis::FunctionID::PutFileID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::PutFileRequest>()
+ : factory.GetCreator<commands::PutFileResponse>();
+ }
+ case mobile_apis::FunctionID::DeleteFileID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DeleteFileRequest>()
+ : factory.GetCreator<commands::DeleteFileResponse>();
+ }
+ case mobile_apis::FunctionID::ListFilesID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ListFilesRequest>()
+ : factory.GetCreator<commands::ListFilesResponse>();
+ }
+ case mobile_apis::FunctionID::SubscribeButtonID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeButtonRequest>()
+ : factory.GetCreator<commands::SubscribeButtonResponse>();
+ }
+ case mobile_apis::FunctionID::UnsubscribeButtonID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeButtonRequest>()
+ : factory.GetCreator<commands::UnsubscribeButtonResponse>();
+ }
+ case mobile_apis::FunctionID::ShowConstantTBTID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ShowConstantTBTRequest>()
+ : factory.GetCreator<commands::ShowConstantTBTResponse>();
+ }
+ case mobile_apis::FunctionID::ShowID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ShowRequest>()
+ : factory.GetCreator<commands::ShowResponse>();
+ }
+ case mobile_apis::FunctionID::GetWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetWayPointsRequest>()
+ : factory.GetCreator<commands::GetWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::SubscribeWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::SubscribeWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::UnsubscribeWayPointsResponse>();
+ }
+ case mobile_apis::FunctionID::GetSystemCapabilityID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::GetSystemCapabilityRequest>()
+ : factory.GetCreator<commands::GetSystemCapabilityResponse>();
+ }
+ case mobile_apis::FunctionID::ScrollableMessageID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ScrollableMessageRequest>()
+ : factory.GetCreator<commands::ScrollableMessageResponse>();
+ }
+
+ case mobile_apis::FunctionID::AlertManeuverID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::AlertManeuverRequest>()
+ : factory.GetCreator<commands::AlertManeuverResponse>();
+ }
+ case mobile_apis::FunctionID::SetAppIconID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetAppIconRequest>()
+ : factory.GetCreator<commands::SetAppIconResponse>();
+ }
+ case mobile_apis::FunctionID::SetDisplayLayoutID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetDisplayLayoutRequest>()
+ : factory.GetCreator<commands::SetDisplayLayoutResponse>();
+ }
+ case mobile_apis::FunctionID::UpdateTurnListID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::UpdateTurnListRequest>()
+ : factory.GetCreator<commands::UpdateTurnListResponse>();
+ }
+ case mobile_apis::FunctionID::ChangeRegistrationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::ChangeRegistrationRequest>()
+ : factory.GetCreator<commands::ChangeRegistrationResponse>();
+ }
+ case mobile_apis::FunctionID::SetMediaClockTimerID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SetMediaClockRequest>()
+ : factory.GetCreator<commands::SetMediaClockTimerResponse>();
+ }
+ case mobile_apis::FunctionID::SystemRequestID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SystemRequest>()
+ : factory.GetCreator<commands::SystemResponse>();
+ }
+ case mobile_apis::FunctionID::SendLocationID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SendLocationRequest>()
+ : factory.GetCreator<commands::SendLocationResponse>();
+ }
+ case mobile_apis::FunctionID::DialNumberID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::DialNumberRequest>()
+ : factory.GetCreator<commands::DialNumberResponse>();
+ }
+ case mobile_apis::FunctionID::SendHapticDataID: {
+ return mobile_api::messageType::request == message_type
+ ? factory.GetCreator<commands::SendHapticDataRequest>()
+ : factory.GetCreator<commands::SendHapticDataResponse>();
+ }
+ case mobile_apis::FunctionID::OnButtonEventID: {
+ return factory.GetCreator<commands::mobile::OnButtonEventNotification>();
+ }
+ case mobile_apis::FunctionID::OnButtonPressID: {
+ return factory.GetCreator<commands::mobile::OnButtonPressNotification>();
+ }
+ case mobile_apis::FunctionID::OnAudioPassThruID: {
+ return factory.GetCreator<commands::OnAudioPassThruNotification>();
+ }
+ case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: {
+ return factory
+ .GetCreator<commands::OnAppInterfaceUnregisteredNotification>();
+ }
+ case mobile_apis::FunctionID::OnCommandID: {
+ return factory.GetCreator<commands::OnCommandNotification>();
+ }
+ case mobile_apis::FunctionID::OnTBTClientStateID: {
+ return factory.GetCreator<commands::OnTBTClientStateNotification>();
+ }
+ case mobile_apis::FunctionID::OnDriverDistractionID: {
+ return factory
+ .GetCreator<commands::mobile::OnDriverDistractionNotification>();
+ }
+ case mobile_apis::FunctionID::OnLanguageChangeID: {
+ return factory.GetCreator<commands::OnLanguageChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnPermissionsChangeID: {
+ return factory.GetCreator<commands::OnPermissionsChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnHMIStatusID: {
+ using app_mngr::commands::Command;
+ return Command::CommandSource::SOURCE_MOBILE == source
+ ? factory.GetCreator<
+ commands::OnHMIStatusNotificationFromMobile>()
+ : factory.GetCreator<commands::OnHMIStatusNotification>();
+ }
+ case mobile_apis::FunctionID::OnKeyboardInputID: {
+ return factory
+ .GetCreator<commands::mobile::OnKeyBoardInputNotification>();
+ }
+ case mobile_apis::FunctionID::OnTouchEventID: {
+ return factory.GetCreator<commands::mobile::OnTouchEventNotification>();
+ }
+ case mobile_apis::FunctionID::OnSystemRequestID: {
+ return factory
+ .GetCreator<commands::mobile::OnSystemRequestNotification>();
+ }
+ case mobile_apis::FunctionID::OnHashChangeID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::mobile::OnHashChangeNotification>();
+ }
+ case mobile_apis::FunctionID::OnWayPointChangeID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::OnWayPointChangeNotification>();
+ }
+ case mobile_apis::FunctionID::GenericResponseID: {
+ using app_mngr::commands::Command;
+ return factory.GetCreator<commands::GenericResponse>();
+ }
+ default: { return factory.GetCreator<InvalidCommand>(); }
+ }
+}
+
+MobileCommandFactory::MobileCommandFactory(
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+bool MobileCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource message_source)
+ const {
+ using app_mngr::commands::Command;
+ return get_creator_factory(
+ static_cast<mobile_apis::FunctionID::eType>(function_id),
+ mobile_apis::messageType::INVALID_ENUM,
+ message_source).CanBeCreated();
+}
+
+CommandSharedPtr MobileCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "MobileCommandFactory::CreateCommand function_id: " << function_id);
+
+ return get_creator_factory(function_id, message_type, source).create(message);
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
new file mode 100644
index 0000000000..efdcde7526
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/sdl_command_factory.h"
+#include "sdl_rpc_plugin/hmi_command_factory.h"
+#include "sdl_rpc_plugin/mobile_command_factory.h"
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+
+SDLCommandFactory::SDLCommandFactory(
+ app_mngr::ApplicationManager& app_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : app_manager_(app_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ hmi_command_factory_.reset(new HMICommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ mobile_command_factory_.reset(new MobileCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+}
+
+app_mngr::CommandSharedPtr SDLCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ return hmi_command_factory_->CreateCommand(message, source);
+ } else {
+ return mobile_command_factory_->CreateCommand(message, source);
+ }
+}
+
+bool SDLCommandFactory::IsAbleToProcess(
+ const int32_t FunctionID,
+ const application_manager::commands::Command::CommandSource source) const {
+ bool is_hmi_command_factory_able_to_process =
+ hmi_command_factory_->IsAbleToProcess(FunctionID, source);
+ bool is_mobile_command_factory_able_to_process =
+ mobile_command_factory_->IsAbleToProcess(FunctionID, source);
+
+ return app_mngr::commands::Command::SOURCE_HMI == source
+ ? is_hmi_command_factory_able_to_process
+ : is_mobile_command_factory_able_to_process;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
new file mode 100644
index 0000000000..22b818f5e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the copyright holders nor the names of their contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "sdl_rpc_plugin/sdl_rpc_plugin.h"
+#include "sdl_rpc_plugin/sdl_command_factory.h"
+
+namespace sdl_rpc_plugin {
+namespace plugins = application_manager::plugin_manager;
+
+bool SDLRPCPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ return true;
+}
+
+bool SDLRPCPlugin::IsAbleToProcess(
+ const int32_t function_id,
+ const application_manager::commands::Command::CommandSource
+ message_source) {
+ return command_factory_->IsAbleToProcess(function_id, message_source);
+}
+
+std::string SDLRPCPlugin::PluginName() {
+ return "SDL RPC Plugin";
+}
+
+application_manager::CommandFactory& SDLRPCPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void SDLRPCPlugin::OnPolicyEvent(
+ application_manager::plugin_manager::PolicyEvent event) {}
+
+void SDLRPCPlugin::OnApplicationEvent(
+ application_manager::plugin_manager::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {}
+
+} // namespace sdl_rpc_plugin
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new sdl_rpc_plugin::SDLRPCPlugin();
+}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..1a206c2cce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
@@ -0,0 +1,37 @@
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ sdl_rpc_plugin
+ jsoncpp
+ Policy
+)
+
+create_cotired_test("sdl_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
new file mode 100644
index 0000000000..50b7aae42a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/activate_app_request.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace activate_app_request {
+
+using ::testing::_;
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::ActivateAppRequest;
+using am::commands::CommandImpl;
+
+using ::test::components::application_manager_test::MockApplication;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<ActivateAppRequest> ActivateAppRequestPtr;
+
+MATCHER_P(CheckMessage, level, "") {
+ return level ==
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*arg)[strings::msg_params][strings::activate_app_hmi_level]
+ .asInt());
+}
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCorrelationId = 2u;
+} // namespace
+
+class ActivateAppRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = kAppId;
+ msg_params[strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::msg_params] = msg_params;
+ (*msg)[strings::params][strings::app_id] = kAppId;
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::app_id] = kAppId;
+ return msg;
+ }
+};
+
+TEST_F(ActivateAppRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId));
+
+// TODO(OKozlov) Investigate and fix issue with using log
+#ifdef ENABLE_LOG
+ (*msg)[strings::msg_params][strings::activate_app_hmi_level] =
+ mobile_apis::HMILevel::HMI_FULL;
+#endif
+ ActivateAppRequestPtr command(CreateCommand<ActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+#ifdef ENABLE_LOG
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToHMI(CheckMessage(mobile_apis::HMILevel::HMI_FULL)));
+#else
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg));
+#endif
+ command->Run();
+
+#ifndef ENABLE_LOG
+ EXPECT_EQ(CommandImpl::hmi_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ EXPECT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+#endif
+}
+
+} // namespace activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
new file mode 100644
index 0000000000..a5707488dd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/add_statistics_info_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace add_statistics_info_notification {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_notification = ::application_manager::hmi_notification;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AddStatisticsInfoNotification;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<AddStatisticsInfoNotification> NotificationPtr;
+
+namespace {
+const uint32_t kStatisticType = 1u;
+} // namespace
+
+class AddStatisticsInfoNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] =
+ kStatisticType;
+ NotificationPtr command(CreateCommand<AddStatisticsInfoNotification>(msg));
+
+ EXPECT_CALL(mock_policy_handler_, AddStatisticsInfo(kStatisticType));
+
+ command->Run();
+}
+
+} // namespace add_statistics_info_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
new file mode 100644
index 0000000000..a2fcf8f605
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/allow_all_apps_response.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_all_apps_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AllowAllAppsResponse;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<AllowAllAppsResponse> ResponsePtr;
+
+namespace {
+const bool kResponseIsAllowed = true;
+} //
+
+class AllowAllAppsResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAllAppsResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, SetAllAppsAllowed(kResponseIsAllowed));
+
+ command->Run();
+}
+
+} // namespace allow_all_apps_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
new file mode 100644
index 0000000000..2ce400542a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/allow_app_response.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_app_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AllowAppResponse;
+using ::testing::_;
+using ::testing::Return;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const bool kIsResponseAllowed = true;
+}
+
+typedef std::shared_ptr<AllowAppResponse> ResponsePtr;
+
+class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_app_allowed(kIsResponseAllowed));
+
+ command->Run();
+}
+
+TEST_F(AllowAppResponseTest, Run_AppNotCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ command->Run();
+}
+
+} // namespace allow_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
new file mode 100644
index 0000000000..a3f0ab6933
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018 Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi/basic_communication_get_system_time_request.h"
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "protocol_handler/mock_protocol_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace basic_communication_get_system_time_request {
+
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::BasicCommunicationGetSystemTimeRequest;
+using namespace ::protocol_handler;
+
+class BasicCommunicationGetSystemTimeRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(BasicCommunicationGetSystemTimeRequestTest, OnTimeout) {
+ MessageSharedPtr msg = CreateMessage();
+ protocol_handler_test::MockProtocolHandler mock_protocol_handler;
+
+ auto command = CreateCommand<BasicCommunicationGetSystemTimeRequest>(msg);
+
+ ON_CALL(app_mngr_, protocol_handler())
+ .WillByDefault(ReturnRef(mock_protocol_handler));
+ EXPECT_CALL(mock_protocol_handler, NotifyOnFailedHandshake());
+
+ command->onTimeOut();
+}
+
+} // namespace basic_communication_get_system_time_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
new file mode 100644
index 0000000000..8f56c6462c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018 Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/basic_communication_get_system_time_response.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace basic_communication_get_system_time_response {
+
+using sdl_rpc_plugin::commands::BasicCommunicationGetSystemTimeResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::ReturnRef;
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+
+class BasicCommunicationGetSystemTimeResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(BasicCommunicationGetSystemTimeResponseTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ MockEventDispatcher mock_event_dispatcher;
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+
+ auto command(CreateCommand<BasicCommunicationGetSystemTimeResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_GetSystemTime, event_id);
+}
+
+} // namespace basic_communication_get_system_time_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..6ed15bebeb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/button_get_capabilities_response.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace button_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::ButtonGetCapabilitiesResponse;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<ButtonGetCapabilitiesResponse> ResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class ButtonGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ capabilities_[strings::name] = hmi_apis::Common_ButtonName::OK;
+ preset_bank_capabilities_ = true;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::capabilities] = (capabilities_);
+ (*msg)[strings::msg_params][hmi_response::preset_bank_capabilities] =
+ (preset_bank_capabilities_);
+
+ return msg;
+ }
+
+ SmartObject capabilities_;
+ SmartObject preset_bank_capabilities_;
+};
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_));
+
+ command->Run();
+}
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
+ .Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
+
+ command->Run();
+}
+
+} // namespace button_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
new file mode 100644
index 0000000000..6914a4ca7e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/close_popup_response.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace close_popup_response {
+
+namespace am = ::application_manager;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::ClosePopupResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(ClosePopupResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg));
+
+ command->Run();
+}
+
+} // namespace close_popup_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..a6497ca6e1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,540 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "hmi/allow_all_apps_request.h"
+#include "hmi/allow_all_apps_response.h"
+#include "hmi/allow_app_request.h"
+#include "hmi/allow_app_response.h"
+#include "hmi/navi_audio_start_stream_request.h"
+#include "hmi/navi_audio_start_stream_response.h"
+#include "hmi/navi_audio_stop_stream_request.h"
+#include "hmi/navi_audio_stop_stream_response.h"
+#include "hmi/update_device_list_request.h"
+#include "hmi/update_device_list_response.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/on_start_device_discovery.h"
+#include "hmi/update_app_list_request.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "hmi/sdl_get_list_of_permissions_response.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "hmi/sdl_get_user_friendly_message_response.h"
+#include "hmi/sdl_get_status_update_request.h"
+#include "hmi/sdl_get_status_update_response.h"
+#include "hmi/on_status_update_notification.h"
+#include "hmi/update_sdl_request.h"
+#include "hmi/update_sdl_response.h"
+#include "hmi/activate_app_request.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/mixing_audio_supported_request.h"
+#include "hmi/mixing_audio_supported_response.h"
+#include "hmi/on_allow_sdl_functionality_notification.h"
+#include "hmi/on_app_permission_changed_notification.h"
+#include "hmi/on_app_permission_consent_notification.h"
+#include "hmi/on_app_activated_notification.h"
+#include "hmi/on_audio_data_streaming_notification.h"
+#include "hmi/on_video_data_streaming_notification.h"
+#include "hmi/on_sdl_consent_needed_notification.h"
+#include "hmi/on_exit_all_applications_notification.h"
+#include "hmi/on_exit_application_notification.h"
+#include "hmi/on_put_file_notification.h"
+#include "hmi/on_resume_audio_source_notification.h"
+#include "hmi/on_ignition_cycle_over_notification.h"
+#include "hmi/on_system_info_changed_notification.h"
+#include "hmi/get_system_info_request.h"
+#include "hmi/get_system_info_response.h"
+#include "hmi/close_popup_request.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/button_get_capabilities_request.h"
+#include "hmi/button_get_capabilities_response.h"
+#include "hmi/ui_add_command_request.h"
+#include "hmi/ui_add_command_response.h"
+#include "hmi/ui_delete_command_request.h"
+#include "hmi/ui_delete_command_response.h"
+#include "hmi/ui_add_submenu_request.h"
+#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_delete_submenu_request.h"
+#include "hmi/ui_delete_submenu_response.h"
+#include "hmi/ui_get_supported_languages_request.h"
+#include "hmi/ui_get_supported_languages_response.h"
+#include "hmi/ui_get_language_request.h"
+#include "hmi/ui_get_language_response.h"
+#include "hmi/ui_get_capabilities_request.h"
+#include "hmi/ui_get_capabilities_response.h"
+#include "hmi/ui_change_registration_request.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_show_request.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_alert_request.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_is_ready_request.h"
+#include "hmi/ui_is_ready_response.h"
+#include "hmi/ui_slider_request.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/ui_set_media_clock_timer_request.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_set_global_properties_request.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_scrollable_message_request.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "hmi/ui_set_app_icon_request.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_audio_pass_thru_request.h"
+#include "hmi/ui_end_audio_pass_thru_request.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_request.h"
+#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/vr_is_ready_request.h"
+#include "hmi/vr_is_ready_response.h"
+#include "hmi/vr_add_command_request.h"
+#include "hmi/vr_add_command_response.h"
+#include "hmi/vr_delete_command_request.h"
+#include "hmi/vr_delete_command_response.h"
+#include "hmi/vr_change_registration_request.h"
+#include "hmi/vr_change_registration_response.h"
+#include "hmi/vr_get_supported_languages_request.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "hmi/vr_get_language_request.h"
+#include "hmi/vr_get_language_response.h"
+#include "hmi/vr_get_capabilities_request.h"
+#include "hmi/vr_get_capabilities_response.h"
+#include "hmi/tts_is_ready_request.h"
+#include "hmi/tts_is_ready_response.h"
+#include "hmi/tts_change_registration_request.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/tts_get_supported_languages_request.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "hmi/tts_get_language_request.h"
+#include "hmi/tts_get_language_response.h"
+#include "hmi/tts_stop_speaking_request.h"
+#include "hmi/tts_stop_speaking_response.h"
+#include "hmi/tts_speak_request.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_set_global_properties_request.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_get_capabilities_request.h"
+#include "hmi/tts_get_capabilities_response.h"
+#include "hmi/vr_perform_interaction_request.h"
+#include "hmi/vr_perform_interaction_response.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "hmi/sdl_activate_app_response.h"
+#include "hmi/on_app_permission_changed_notification.h"
+#include "hmi/on_event_changed_notification.h"
+#include "hmi/navi_is_ready_request.h"
+#include "hmi/navi_show_constant_tbt_request.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_is_ready_response.h"
+#include "hmi/navi_alert_maneuver_request.h"
+#include "hmi/navi_alert_maneuver_response.h"
+#include "hmi/navi_update_turn_list_request.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/navi_subscribe_way_points_request.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_request.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_get_way_points_request.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/on_ready_notification.h"
+#include "hmi/on_device_chosen_notification.h"
+#include "hmi/on_file_removed_notification.h"
+#include "hmi/on_system_context_notification.h"
+#include "hmi/on_app_registered_notification.h"
+#include "hmi/on_app_unregistered_notification.h"
+#include "hmi/on_driver_distraction_notification.h"
+#include "hmi/on_tts_started_notification.h"
+#include "hmi/on_tts_stopped_notification.h"
+#include "hmi/on_vr_started_notification.h"
+#include "hmi/on_vr_stopped_notification.h"
+#include "hmi/on_vr_command_notification.h"
+#include "hmi/on_ui_command_notification.h"
+#include "hmi/on_app_deactivated_notification.h"
+#include "hmi/on_ui_language_change_notification.h"
+#include "hmi/on_vr_language_change_notification.h"
+#include "hmi/on_tts_language_change_notification.h"
+#include "hmi/on_navi_tbt_client_state_notification.h"
+#include "hmi/on_navi_way_point_change_notification.h"
+#include "hmi/on_button_event_notification.h"
+#include "hmi/on_button_press_notification.h"
+#include "hmi/on_button_subscription_notification.h"
+#include "hmi/on_ui_keyboard_input_notification.h"
+#include "hmi/on_ui_touch_event_notification.h"
+#include "hmi/on_ui_reset_timeout_notification.h"
+#include "hmi/navi_start_stream_request.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_request.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/on_system_request_notification.h"
+#include "hmi/ui_set_display_layout_request.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/on_sdl_close_notification.h"
+#include "hmi/on_sdl_persistence_complete_notification.h"
+#include "hmi/on_record_start_notification.h"
+#include "hmi/add_statistics_info_notification.h"
+#include "hmi/on_system_error_notification.h"
+#include "hmi/basic_communication_system_request.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/sdl_policy_update.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/on_received_policy_update.h"
+#include "hmi/on_policy_update.h"
+#include "hmi/get_urls.h"
+#include "hmi/get_urls_response.h"
+#include "hmi/on_device_state_changed_notification.h"
+#include "hmi/navi_send_location_request.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/on_tts_reset_timeout_notification.h"
+#include "hmi/dial_number_request.h"
+#include "hmi/dial_number_response.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using application_manager::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ stream_retry_.first = 0;
+ stream_retry_.second = 0;
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(stream_retry_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestSecond : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestThird : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFourth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFifth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::OnStartDeviceDiscovery,
+ commands::UpdateDeviceListResponse,
+ commands::UpdateDeviceListRequest,
+ commands::ActivateAppResponse,
+ commands::ActivateAppRequest,
+ commands::GetSystemInfoResponse,
+ commands::GetSystemInfoRequest,
+ commands::SDLActivateAppResponse,
+ commands::SDLActivateAppRequest,
+ commands::SDLPolicyUpdateResponse,
+ commands::SDLPolicyUpdate,
+ commands::GetUrlsResponse,
+ commands::GetUrls,
+ commands::OnAppPermissionChangedNotification,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetListOfPermissionsRequest,
+ commands::SDLGetUserFriendlyMessageResponse,
+ commands::SDLGetUserFriendlyMessageRequest,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetStatusUpdateRequest,
+ commands::OnStatusUpdateNotification,
+ commands::OnAppPermissionConsentNotification,
+ commands::MixingAudioSupportedResponse,
+ commands::MixingAudioSupportedRequest,
+ commands::OnExitAllApplicationsNotification,
+ commands::UIAddCommandResponse,
+ commands::UIAddCommandRequest,
+ commands::UIDeleteCommandResponse,
+ commands::UIDeleteCommandRequest,
+ commands::UIAddSubmenuResponse,
+ commands::UIAddSubmenuRequest,
+ commands::UIDeleteSubmenuResponse,
+ commands::UIDeleteSubmenuRequest,
+ commands::UISetMediaClockTimerResponse,
+ commands::UISetMediaClockTimerRequest,
+ commands::UIPerformInteractionResponse,
+ commands::UIPerformInteractionRequest,
+ commands::UISetGlobalPropertiesResponse,
+ commands::UISetGlobalPropertiesRequest,
+ commands::UIScrollableMessageResponse,
+ commands::UIScrollableMessageRequest,
+ commands::UISetAppIconResponse,
+ commands::UISetAppIconRequest,
+ commands::UIGetSupportedLanguagesResponse,
+ commands::UIGetSupportedLanguagesRequest,
+ commands::UIGetLanguageResponse,
+ commands::UIGetLanguageRequest,
+ commands::UIGetCapabilitiesResponse,
+ commands::UIGetCapabilitiesRequest,
+ commands::UIChangeRegistratioResponse> HMICommandsListFirst;
+
+typedef Types<commands::UIChangeRegistrationRequest,
+ commands::UIPerformAudioPassThruResponse,
+ commands::UIPerformAudioPassThruRequest,
+ commands::UIEndAudioPassThruResponse,
+ commands::UIEndAudioPassThruRequest,
+ commands::UIAlertResponse,
+ commands::UIAlertRequest,
+ commands::VRIsReadyResponse,
+ commands::VRIsReadyRequest,
+ commands::VRAddCommandResponse,
+ commands::VRAddCommandRequest,
+ commands::VRDeleteCommandResponse,
+ commands::VRDeleteCommandRequest,
+ commands::VRChangeRegistrationResponse,
+ commands::VRChangeRegistrationRequest,
+ commands::VRGetSupportedLanguagesResponse,
+ commands::VRGetSupportedLanguagesRequest,
+ commands::VRGetLanguageResponse,
+ commands::VRGetLanguageRequest,
+ commands::VRGetCapabilitiesResponse,
+ commands::VRGetCapabilitiesRequest,
+ commands::TTSIsReadyResponse,
+ commands::TTSIsReadyRequest,
+ commands::TTSChangeRegistratioResponse,
+ commands::TTSChangeRegistrationRequest,
+ commands::TTSGetSupportedLanguagesResponse,
+ commands::TTSGetSupportedLanguagesRequest,
+ commands::TTSStopSpeakingResponse,
+ commands::TTSStopSpeakingRequest,
+ commands::TTSGetLanguageResponse,
+ commands::TTSGetLanguageRequest,
+ commands::TTSSpeakResponse,
+ commands::TTSSpeakRequest,
+ commands::TTSSetGlobalPropertiesResponse,
+ commands::TTSSetGlobalPropertiesRequest,
+ commands::TTSGetCapabilitiesResponse,
+ commands::TTSGetCapabilitiesRequest,
+ commands::OnTTSStartedNotification,
+ commands::OnTTSStoppedNotification,
+ commands::OnAppActivatedNotification,
+ commands::OnExitApplicationNotification,
+ commands::UIShowResponse,
+ commands::UIShowRequest,
+ commands::UISliderResponse,
+ commands::UISliderRequest,
+ commands::ClosePopupResponse,
+ commands::ClosePopupRequest,
+ commands::UIIsReadyResponse,
+ commands::UIIsReadyRequest> HMICommandsListSecond;
+
+typedef Types<commands::NaviIsReadyResponse,
+ commands::NaviIsReadyRequest,
+ commands::NaviAlertManeuverResponse,
+ commands::NaviAlertManeuverRequest,
+ commands::NaviGetWayPointsResponse,
+ commands::NaviGetWayPointsRequest,
+ commands::NaviUpdateTurnListResponse,
+ commands::NaviUpdateTurnListRequest,
+ commands::NaviShowConstantTBTResponse,
+ commands::NaviShowConstantTBTRequest,
+ commands::NaviSubscribeWayPointsResponse,
+ commands::NaviSubscribeWayPointsRequest,
+ commands::NaviUnsubscribeWayPointsResponse,
+ commands::NaviUnsubscribeWayPointsRequest,
+ commands::ButtonGetCapabilitiesResponse,
+ commands::ButtonGetCapabilitiesRequest,
+ commands::OnAllowSDLFunctionalityNotification,
+ commands::OnSDLConsentNeededNotification,
+ commands::UpdateSDLResponse,
+ commands::UpdateSDLRequest,
+ commands::OnIgnitionCycleOverNotification,
+ commands::OnSystemInfoChangedNotification,
+ commands::OnReadyNotification,
+ commands::OnDeviceChosenNotification,
+ commands::OnSystemContextNotification,
+ sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification,
+ commands::OnUpdateDeviceList,
+ commands::OnAppRegisteredNotification,
+ commands::OnAppUnregisteredNotification,
+ commands::OnFindApplications,
+ commands::UpdateAppListResponse,
+ commands::UpdateAppListRequest,
+ commands::OnVRStartedNotification,
+ commands::OnVRStoppedNotification,
+ commands::OnVRCommandNotification,
+ commands::OnUICommandNotification,
+ commands::OnAppDeactivatedNotification> HMICommandsListThird;
+
+typedef Types<commands::hmi::OnButtonEventNotification,
+ commands::hmi::OnButtonPressNotification,
+ commands::hmi::OnButtonSubscriptionNotification,
+ commands::OnNaviTBTClientStateNotification,
+ commands::hmi::OnUIKeyBoardInputNotification,
+ commands::hmi::OnUITouchEventNotification,
+ commands::hmi::OnUIResetTimeoutNotification,
+ commands::NaviStartStreamResponse,
+ commands::NaviStartStreamRequest,
+ commands::NaviStopStreamResponse,
+ commands::NaviStopStreamRequest,
+ commands::AudioStartStreamResponse,
+ commands::AudioStartStreamRequest,
+ commands::AudioStopStreamResponse,
+ commands::AudioStopStreamRequest,
+ commands::OnAudioDataStreamingNotification,
+ commands::OnVideoDataStreamingNotification,
+ commands::VRPerformInteractionResponse,
+ commands::VRPerformInteractionRequest,
+ commands::OnSystemRequestNotification,
+ commands::OnPutFileNotification,
+ commands::OnResumeAudioSourceNotification,
+ commands::UiSetDisplayLayoutResponse,
+ commands::UiSetDisplayLayoutRequest,
+ commands::OnSDLCloseNotification,
+ commands::OnSDLPersistenceCompleteNotification,
+ commands::OnFileRemovedNotification,
+ commands::OnRecordStartdNotification,
+ commands::BasicCommunicationSystemResponse,
+ commands::BasicCommunicationSystemRequest,
+ commands::NaviSendLocationResponse,
+ commands::NaviSendLocationRequest,
+ commands::AddStatisticsInfoNotification,
+ commands::OnSystemErrorNotification,
+ commands::OnReceivedPolicyUpdate,
+ commands::OnPolicyUpdate,
+ commands::OnDeviceStateChangedNotification,
+ commands::hmi::OnTTSResetTimeoutNotification,
+ commands::hmi::DialNumberResponse,
+ commands::hmi::DialNumberRequest,
+ commands::OnEventChangedNotification,
+ commands::OnNaviWayPointChangeNotification,
+ commands::OnUILanguageChangeNotification,
+ commands::OnVRLanguageChangeNotification,
+ commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
+
+typedef Types<commands::AllowAllAppsRequest,
+ commands::AllowAllAppsResponse,
+ commands::AllowAppRequest,
+ commands::AllowAppResponse> HMICommandsListFifth;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
+TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird);
+TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
+TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
new file mode 100644
index 0000000000..4cbe7305ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "hmi/get_system_info_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_request {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using sdl_rpc_plugin::commands::GetSystemInfoRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+} // namespace
+
+class GetSystemInfoRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
+
+ const uint32_t kAppId = command->application_id();
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::msg_params][strings::app_id].asUInt(),
+ kAppId);
+ EXPECT_EQ((*command_msg)[strings::params][strings::correlation_id].asUInt(),
+ kCorrelationId);
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_system_info_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
new file mode 100644
index 0000000000..6908e21053
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/get_system_info_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/commands_test.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::GetSystemInfoResponse;
+using sdl_rpc_plugin::commands::SystemInfo;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string ccpu_version("4.1.3.B_EB355B");
+const std::string wers_country_code("WAEGB");
+const uint32_t lang_code = 0u;
+const std::string kLanguage = "";
+} // namespace
+
+class GetSystemInfoResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::msg_params]["ccpu_version"] = ccpu_version;
+ (*command_msg)[strings::msg_params]["wersCountryCode"] = wers_country_code;
+ (*command_msg)[strings::msg_params]["language"] = lang_code;
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+
+ std::string language;
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .WillOnce(Return(language));
+ EXPECT_EQ(kLanguage, language);
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetSystemInfo(ccpu_version, wers_country_code, kLanguage));
+
+ command->Run();
+}
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_UNSUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .Times(0);
+
+ EXPECT_CALL(mock_policy_handler_, OnGetSystemInfo("", "", ""));
+
+ command->Run();
+}
+
+} // namespace get_system_info_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
new file mode 100644
index 0000000000..339a749909
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_to_hmi.h"
+#include "hmi/get_urls_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls_response {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::GetUrlsResponse;
+using am::commands::ResponseToHMI;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseToHMI> ResponseToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetUrlResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetUrlResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ ResponseToHMIPtr command(CreateCommand<GetUrlsResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_urls_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
new file mode 100644
index 0000000000..2191900750
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/message.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "hmi/get_urls.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/request_from_hmi.h"
+#include "policy/mock_policy_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls {
+
+using namespace hmi_apis;
+using namespace policy;
+using ::testing::NiceMock;
+using ::testing::_;
+using ::testing::SetArgReferee;
+using ::test::components::application_manager_test::MockApplication;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestFromHMI;
+using sdl_rpc_plugin::commands::GetUrls;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef std::shared_ptr<RequestFromHMI> RequestFromHMIPtr;
+
+namespace {
+const uint32_t kInvalidAppId_ = 0u;
+const uint32_t kAppIdForSending = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kServiceType = 0u;
+const std::string kInitialService = "0x0";
+const std::string kPolicyService = "7";
+const std::string kDefaultUrl = "URL is not found";
+const std::string kDefaultId = "default";
+const std::string kPolicyAppId = "policy_app_id";
+} // namespace
+
+class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr command_msg_;
+ RequestFromHMIPtr request_command_;
+
+ GetUrlsTest() {
+ command_msg_ =
+ CreateMessage(ns_smart_device_link::ns_smart_objects::SmartType_Map);
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kInitialService;
+
+ request_command_ = CreateCommand<GetUrls>(command_msg_);
+ }
+};
+
+TEST_F(GetUrlsTest, RUN_SUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ // EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(_, _));
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
+ EndpointUrls endpoints_;
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+#ifdef EXTENDED_POLICY
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+
+ EXPECT_EQ(kAppIdForSending,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::app_id].asInt());
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::url].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kInvalidAppId_));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr invalid_mock_app;
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(invalid_mock_app));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = kPolicyAppId;
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_))
+ .WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+#endif
+
+TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = "1";
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = "1";
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::strings::url].asString());
+ EXPECT_EQ(endpoints_[0].app_id,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = kDefaultId;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(_))
+ .WillOnce(Return(mock_app));
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_TRUE(
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ .keyExists(am::hmi_response::policy_app_id));
+}
+
+} // namespace get_urls
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
new file mode 100644
index 0000000000..fe82b16f3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
@@ -0,0 +1,1856 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h"
+#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h"
+#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h"
+
+#include "utils/lock.h"
+#include "utils/data_accessor.h"
+#include "utils/signals.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/hmi_capabilities_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "application_manager/mock_resume_ctrl.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace hmi_notifications_test {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Types;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::InSequence;
+using ::smart_objects::SmartObject;
+using ::application_manager::commands::MessageSharedPtr;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::application_manager::MockMessageHelper;
+using namespace sdl_rpc_plugin::commands;
+using namespace am::commands;
+
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+#define MEDIA true
+#define NOT_MEDIA false
+#define VC true
+#define NOT_VC false
+#define NAVI true
+#define NOT_NAVI false
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+ACTION_P(GetArg, arg) {
+ *arg = arg0;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+ACTION_P2(GetConnectIdPermissionConsent, connect_id, consent) {
+ *connect_id = arg0;
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ arg1.group_permissions.begin();
+ for (; it != arg1.group_permissions.end(); ++it) {
+ consent->group_permissions.push_back(*it);
+ }
+ consent->consent_source = arg1.consent_source;
+}
+ACTION_P2(GetBoolValueAndString, value, str) {
+ *value = arg0;
+ *str = arg1;
+}
+ACTION_P(GetMessage, message) {
+ (*message)[am::strings::params][am::strings::function_id] =
+ (*arg0)[am::strings::params][am::strings::function_id].asInt();
+ (*message)[am::strings::params][am::strings::message_type] =
+ (*arg0)[am::strings::params][am::strings::message_type].asInt();
+ (*message)[am::strings::params][am::strings::correlation_id] =
+ (*arg0)[am::strings::params][am::strings::correlation_id].asInt();
+ (*message)[am::strings::params][am::strings::connection_key] =
+ (*arg0)[am::strings::params][am::strings::connection_key].asInt();
+ return (*message)[am::strings::params][am::strings::correlation_id].asInt();
+}
+
+namespace {
+const uint32_t kCountCommandsManageMobile_ = 22u;
+const uint32_t kCountCommandsToHmi_ = 12u;
+const int32_t kHmiProtocolType_ = 1;
+const int32_t kMobileProtocolType_ = 0;
+const int32_t kProtocolVersion_ = 3;
+const uint32_t kCorrelationId_ = 1939u;
+const uint32_t kAppId_ = 2014u;
+} // namespace
+
+class HMICommandsNotificationsTest
+ : public components::commands_test::CommandsTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ HMICommandsNotificationsTest()
+ : applications_lock_(std::make_shared<sync_primitives::Lock>())
+ , applications_(application_set_, applications_lock_)
+ , app_ptr_(NULL) {}
+
+ ~HMICommandsNotificationsTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+ typedef Command CommandType;
+
+ protected:
+ am::ApplicationSet application_set_;
+ std::shared_ptr<sync_primitives::Lock> applications_lock_;
+ DataAccessor<am::ApplicationSet> applications_;
+
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+
+ application_manager_test::MockStateController mock_state_controller_;
+
+ am::ApplicationSharedPtr app_;
+ NiceMock<MockApplication>* app_ptr_;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ MockConnectionHandler mock_connection_handler_;
+ MockSessionObserver mock_session_observer_;
+
+ void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(default_timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
+ }
+
+ am::ApplicationSharedPtr ConfigureApp(NiceMock<MockApplication>** app_mock,
+ uint32_t app_id,
+ bool media,
+ bool navi,
+ bool vc) {
+ *app_mock = new NiceMock<MockApplication>;
+
+ Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug
+ am::ApplicationSharedPtr app(*app_mock);
+
+ ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
+ ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
+ ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
+ ON_CALL(**app_mock, is_voice_communication_supported())
+ .WillByDefault(Return(vc));
+ ON_CALL(**app_mock, IsAudioApplication())
+ .WillByDefault(Return(media || navi || vc));
+ return app;
+ }
+#if defined(OS_POSIX)
+ void SubscribeForSignal() {
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ sigaddset(&signal_set, SIGINT);
+ sigaddset(&signal_set, SIGTERM);
+ pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
+ }
+#endif
+};
+
+namespace {
+void sig_handler(int sig) {
+ switch (sig) {
+ case SIGINT:
+ break;
+ case SIGTERM:
+ break;
+ case SIGSEGV:
+ abort();
+ default:
+ exit(EXIT_FAILURE);
+ }
+}
+} // namespace
+
+template <class Command>
+class HMIOnNotificationsListToHMI
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class CommandT, hmi_apis::FunctionID::eType kCommandId>
+struct CommandPair {
+ typedef CommandT CommandType;
+ enum { kHMICommandId = kCommandId };
+};
+
+template <class Command>
+class HMIOnNotificationsEventDispatcher
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+typedef Types<OnAppPermissionChangedNotification,
+ OnAudioDataStreamingNotification,
+ hmi::OnButtonSubscriptionNotification,
+ OnFileRemovedNotification,
+ OnPutFileNotification,
+ OnResumeAudioSourceNotification,
+ OnSDLCloseNotification,
+ OnSDLConsentNeededNotification,
+ OnSDLPersistenceCompleteNotification,
+ OnStatusUpdateNotification,
+ OnVideoDataStreamingNotification,
+ OnRecordStartdNotification> HMIOnNotificationsListToHMITypes;
+
+typedef Types<
+ CommandPair<OnAppActivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated>,
+ CommandPair<OnAppDeactivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>,
+ CommandPair<OnEventChangedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged>,
+ CommandPair<hmi::OnTTSResetTimeoutNotification,
+ hmi_apis::FunctionID::TTS_OnResetTimeout>,
+ CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>,
+ CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>,
+ CommandPair<hmi::OnUIResetTimeoutNotification,
+ hmi_apis::FunctionID::UI_OnResetTimeout>,
+ CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>,
+ CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> >
+ HMIOnNotificationsEventDispatcherTypes;
+
+TYPED_TEST_CASE(HMIOnNotificationsListToHMI, HMIOnNotificationsListToHMITypes);
+TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher,
+ HMIOnNotificationsEventDispatcherTypes);
+
+TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) {
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::mock_rpc_service_,
+ SendMessageToHMI(_));
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(kHmiProtocolType_),
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kProtocolVersion_),
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TYPED_TEST(HMIOnNotificationsEventDispatcher,
+ CommandsNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ std::shared_ptr<typename TestFixture::CommandType::CommandType> command =
+ this->template CreateCommand<
+ typename TestFixture::CommandType::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
+ event_dispatcher())
+ .WillOnce(ReturnRef(this->mock_event_dispatcher_));
+ EXPECT_CALL(this->mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(TestFixture::CommandType::kHMICommandId, event_id);
+}
+
+// notifications(SendNotificationToMobile)
+TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnButtonEventNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnNaviTBTClientStateNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnNaviWayPointChangeSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnNaviWayPointChangeNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUICommandNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUIKeyBoardInputSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnUIKeyBoardInputNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnKeyboardInputID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnUITouchEventNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTouchEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppRegisteredNotificationSendNotificationToHmi) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppRegisteredNotification>(message);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppUnregisteredNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppUnregisteredNotification>(message);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnButtonPressNotification>(message);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::FunctionID::Buttons_OnButtonPress),
+ event_id);
+ EXPECT_EQ(static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReadyNotification>(message);
+
+ EXPECT_CALL(app_mngr_, OnHMIStartedCooperation());
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnReady, event_id);
+}
+
+// policy handler
+TEST_F(HMICommandsNotificationsTest,
+ OnIgnitionCycleOverNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnIgnitionCycleOverNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, OnIgnitionCycleOver());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command = CreateCommand<OnPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, OnPTExchangeNeeded());
+ command->Run();
+}
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_SUCCESS) {
+ const std::string kFile = "./test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(kFile));
+ uint8_t tmp[] = {1u, 2u, 3u, 4u};
+ std::vector<uint8_t> data(tmp, tmp + 4);
+ EXPECT_TRUE(file_system::WriteBinaryFile(kFile, data));
+
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ (*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(kFile, data));
+ command->Run();
+ EXPECT_TRUE(file_system::DeleteFile(kFile));
+}
+#endif
+
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ std::shared_ptr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerNoAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ SmartObject& applications =
+ (*message)[am::strings::msg_params]["consentedFunctions"];
+
+ smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map);
+ applications[0] = hmi_application_temp;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(GetArg(&connection_id));
+ command->Run();
+ EXPECT_EQ(0, connection_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerWithAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(policy::kGroupUndefined, (*it).state);
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowTrue) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = true;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupAllowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowFalse) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ std::make_shared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = false;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(mock_policy_handler_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupDisallowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemErrorNotificationOnSystemErrorCode) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::error] =
+ hmi_apis::Common_SystemError::SYNC_REBOOTED;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemErrorNotification>(message);
+
+ int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM;
+ EXPECT_CALL(mock_policy_handler_, OnSystemError(_)).WillOnce(GetArg(&code));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::Common_SystemError::SYNC_REBOOTED),
+ code);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemInfoChangedNotificationCheckLanguage) {
+ const uint32_t kLangCode = 5u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLangCode;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemInfoChangedNotification>(message);
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_));
+ EXPECT_CALL(mock_policy_handler_, OnSystemInfoChanged(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyNotExist) {
+ const std::string kDeviceId = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value = false;
+ std::string str;
+ EXPECT_CALL(mock_policy_handler_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyExist) {
+ const std::string kDeviceId = "device_id";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ (*message)[am::strings::msg_params]["device"]["id"] = kDeviceId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value;
+ std::string str;
+ EXPECT_CALL(mock_policy_handler_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateNotUnpaired) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::INVALID_ENUM;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateUnpaired) {
+ // Random MAC adress for test. It must contain 12 symbols.
+ const std::string device_id = "AA15F2204D6B";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = device_id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateEmptyDeviceId) {
+ const std::string empty_device_id = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_))
+ .WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(empty_device_id, device_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateDeviceIdFromId) {
+ const std::string empty_device_id = "";
+ const std::string id = "id_string";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+ (*message)[am::strings::msg_params]["deviceId"]["id"] = id;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(mock_policy_handler_, RemoveDevice(_))
+ .WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(id, device_id);
+}
+
+//~policy_handler
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonIgnitionOff) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_))
+ .WillOnce(GetArg(&mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
+
+ SubscribeForSignal();
+ command->Run();
+ utils::Signals::WaitTerminationSignals(sig_handler);
+
+ EXPECT_EQ(am::mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF,
+ mob_reason);
+#endif
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonMasterResetAndFactoryDefaults) {
+ MessageSharedPtr message = CreateMessage();
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mob_reason_list;
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::MASTER_RESET);
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS);
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType>::iterator
+ it_reason = reason_list.begin();
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mob_reason = mob_reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) {
+ (*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ *it_mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(mob_reason));
+
+ SubscribeForSignal();
+ command->Run();
+ utils::Signals::WaitTerminationSignals(sig_handler);
+#endif
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonSuspend) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::SUSPEND;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ MessageSharedPtr ethalon_message =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*ethalon_message)[am::strings::params][am::strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*ethalon_message)[am::strings::params][am::strings::message_type] =
+ am::MessageType::kNotification;
+ (*ethalon_message)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId_;
+ MessageSharedPtr temp_message = CreateMessage();
+
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(app_mngr_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, OnSuspend());
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(GetMessage(temp_message));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<uint32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete),
+ (*temp_message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<uint32_t>(am::MessageType::kNotification),
+ (*temp_message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(static_cast<uint32_t>(kCorrelationId_),
+ (*temp_message)[am::strings::params][am::strings::correlation_id]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonInvalidEnum) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0);
+ EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationManageMobileCommand) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(
+ mobile_apis::FunctionID::OnAppInterfaceUnregisteredID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationExitReason::
+ UNAUTHORIZED_TRANSPORT_REGISTRATION);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mobile_reason_list;
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mobile_reason = mobile_reason_list.begin();
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType>::iterator
+ it_reason = reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) {
+ (*message)[am::strings::msg_params][am::strings::reason] = *it_reason;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(*it_mobile_reason);
+
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(mock_rpc_plugin_manager_));
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_, *it_mobile_reason)).WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationUnhandledReason) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::INVALID_ENUM;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillOnce(ReturnRef(mock_rpc_plugin_manager_));
+ EXPECT_CALL(mock_rpc_plugin_manager_, ForEachPlugin(_)).Times(1);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ DISABLED_OnExitApplicationNotificationDriverDistractionValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationrUserExitValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::USER_EXIT;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+ am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillOnce(ReturnRef(mock_rpc_plugin_manager_));
+ EXPECT_CALL(mock_rpc_plugin_manager_, ForEachPlugin(_)).Times(1);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndValidApp) {
+ const uint32_t cmd_id = 12u;
+ const uint32_t max_cmd_id = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, mobile_apis::HMILevel::HMI_FULL, true));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(max_cmd_id));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndInvalidApp) {
+ const uint32_t kCmdId = 12u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdEqualToMaxCmdId) {
+ const uint32_t kCmdId = 11u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdLessMaxCmdIsInvalidApp) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 1u;
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::VR_OnCommand, event_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationNotActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 0u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message)[am::strings::msg_params][am::strings::function_id] =
+ mobile_apis::FunctionID::eType::OnCommandID;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_, mobile_apis::HMILevel::HMI_NONE, false));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnStartDeviceDiscovery>(message);
+ EXPECT_CALL(app_mngr_, StartDevicesDiscovery());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id] = "2014";
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_,
+ ConnectToDevice(
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id].asString()));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoNotExists) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MENU);
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidSystemContext) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::INVALID_ENUM;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_ALERT);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MAIN);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationAppIdDoesntExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_ALERT;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppId_));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) {
+ const uint32_t kNullApppId = 0u;
+ MessageSharedPtr message = CreateMessage();
+ std::shared_ptr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kNullApppId));
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, ui_language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kLang),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ std::shared_ptr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(notification, Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::Language::EN_US),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDriverDistractionNotificationInvalidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ ApplicationSharedPtr invalid_app;
+ application_set_.insert(invalid_app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::mobile_notification::state] = state;
+ std::shared_ptr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+ EXPECT_CALL(mock_policy_handler_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL))
+ .WillOnce(GetMessage(message));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(am::mobile_api::FunctionID::OnDriverDistractionID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+} // namespace hmi_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
new file mode 100644
index 0000000000..8164f957cb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "hmi/mixing_audio_supported_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using sdl_rpc_plugin::commands::MixingAudioSupportedRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ RequestToHMIPtr command(
+ CreateCommand<MixingAudioSupportedRequest>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace mixing_audio_supported_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
new file mode 100644
index 0000000000..aa651c2dca
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_response {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::MixingAudioSupportedResponse;
+using application_manager::commands::ResponseFromHMI;
+using am::commands::CommandImpl;
+using am::HMICapabilities;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<MixingAudioSupportedResponse>(command_msg));
+
+ const bool hmiResponse =
+ (*command_msg)[strings::msg_params][hmi_response::attenuated_supported]
+ .asBool();
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_attenuated_supported(hmiResponse));
+
+ command->Run();
+}
+
+} // namespace mixing_audio_supported_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
new file mode 100644
index 0000000000..d8454bb98e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <utility>
+
+#include "hmi/navi_audio_start_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_audio_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::AudioStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class AudioStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AudioStartStreamRequestTest() {
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<AudioStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<AudioStartStreamRequest> command_;
+};
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_audio_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_audio_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
new file mode 100644
index 0000000000..1a03ecf523
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/navi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviIsReadyRequest;
+using am::event_engine::Event;
+
+namespace {
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_IsReady;
+} // namespace
+
+typedef std::shared_ptr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
+
+class NaviIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {}
+
+ NaviIsReadyRequestPtr command_;
+};
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsAvailable_NaviCooperatingIsAvailable) {
+ const bool is_hmi_interface_available = true;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_HmiInterfaceIsNotAvailable_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::msg_params][am::strings::available] =
+ is_hmi_interface_available;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+TEST_F(NaviIsReadyRequestTest,
+ OnEvent_AvailabilityFieldMissing_NaviCooperatingIsNotAvailable) {
+ const bool is_hmi_interface_available = false;
+
+ MessageSharedPtr event_msg = CreateMessage();
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_navi_cooperating(is_hmi_interface_available));
+
+ command_->on_event(event);
+}
+
+} // namespace navi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
new file mode 100644
index 0000000000..23f01fac3f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/navi_is_ready_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_responce {
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::ReturnRef;
+
+using application_manager::commands::ResponseFromHMI;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class NaviIsReadyResponseTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+ command->Run();
+}
+
+} // namespace navi_is_ready_responce
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
new file mode 100644
index 0000000000..3110a11fd8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+
+#include "hmi/navi_set_video_config_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kHmiAppId = 13u;
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_SetVideoConfig;
+} // namespace
+
+typedef std::shared_ptr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
+
+class NaviSetVideoConfigRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviSetVideoConfigRequestTest() {
+ mock_app_ptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+ }
+
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+ MockAppPtr mock_app_ptr_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, true, empty))
+ .Times(1);
+
+ command->on_event(event);
+}
+
+static bool ValidateList(std::vector<std::string>& expected,
+ std::vector<std::string>& actual) {
+ std::sort(expected.begin(), expected.end());
+ std::sort(actual.begin(), actual.end());
+ return std::equal(expected.begin(), expected.end(), actual.begin());
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*request_msg)[am::strings::msg_params][am::strings::config] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H265;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::height] = 640;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::width] = 480;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][0] =
+ "codec";
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][1] =
+ "protocol";
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, _))
+ .WillOnce(SaveArg<3>(&rejected_params));
+
+ command->on_event(event);
+
+ ASSERT_EQ(2u, rejected_params.size());
+ std::vector<std::string> expected_list;
+ expected_list.push_back(std::string("protocol"));
+ expected_list.push_back(std::string("codec"));
+ ASSERT_TRUE(ValidateList(expected_list, rejected_params));
+}
+
+TEST_F(NaviSetVideoConfigRequestTest,
+ OnEventWithRejectedResponseWithoutParams) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ command->on_event(event);
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1);
+
+ command->onTimeOut();
+}
+
+} // namespace navi_set_video_config_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
new file mode 100644
index 0000000000..06fa61db29
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/navi_set_video_config_response.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_response {
+
+using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class NaviSetVideoConfigResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<NaviSetVideoConfigResponse> command(
+ CreateCommand<NaviSetVideoConfigResponse>(msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace navi_set_video_config_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
new file mode 100644
index 0000000000..a7f50504fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <utility>
+
+#include "hmi/navi_start_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_start_stream_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::NaviStartStreamRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kHmiAppId = 13u;
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+class NaviStartStreamRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStartStreamRequestTest() {
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(start_stream_retry_amount_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<NaviStartStreamRequest>(msg_);
+ }
+
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<NaviStartStreamRequest> command_;
+};
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest,
+ Run_HmiInterfaceAvailableButNoApp_NoRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kHmiAppId;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kHmiAppId))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_video_streaming_allowed(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(msg_));
+
+ command_->Run();
+}
+
+} // namespace navi_start_stream_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
new file mode 100644
index 0000000000..e4a79997fd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/navi_stop_stream_request.h"
+#include "hmi/navi_audio_stop_stream_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_stop_stream_requests {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+namespace {
+const am::HmiInterfaces::InterfaceID kHmiInterface =
+ am::HmiInterfaces::HMI_INTERFACE_Navigation;
+} // namespace
+
+template <typename Command>
+class NaviStopStreamRequestsTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviStopStreamRequestsTest() {
+ ON_CALL(this->app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ msg_ = CreateMessage();
+ command_ = CreateCommand<Command>(msg_);
+ }
+
+ MessageSharedPtr msg_;
+ std::shared_ptr<Command> command_;
+};
+
+typedef testing::Types<commands::AudioStopStreamRequest,
+ commands::NaviStopStreamRequest> RequestCommandsList;
+TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList);
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(TestFixture::mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ TestFixture::command_->Run();
+}
+
+TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceAvailable_SentRequest) {
+ EXPECT_CALL(TestFixture::mock_hmi_interfaces_,
+ GetInterfaceState(kHmiInterface))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(TestFixture::mock_rpc_service_,
+ SendMessageToHMI(TestFixture::msg_));
+
+ TestFixture::command_->Run();
+}
+
+} // namespace navi_stop_stream_requests
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
new file mode 100644
index 0000000000..fc3899e861
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/lock.h"
+#include "utils/data_accessor.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/on_driver_distraction_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_driver_distraction_notification {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::Eq;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification;
+using namespace am::commands;
+
+typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr;
+
+class HMIOnDriverDistractionNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ HMIOnDriverDistractionNotificationTest()
+ : app_set_lock_(std::make_shared<sync_primitives::Lock>()) {}
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+MATCHER_P2(CheckNotificationParams, function_id, state, "") {
+ bool is_function_id_matched =
+ function_id ==
+ static_cast<am::mobile_api::FunctionID::eType>(
+ (*arg)[am::strings::params][am::strings::function_id].asInt());
+ bool is_state_matched =
+ state ==
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*arg)[am::strings::msg_params][am::mobile_notification::state]
+ .asInt());
+ return is_function_id_matched && is_state_matched;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest, Run_PushMobileMessage_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+
+ EXPECT_CALL(*mock_app,
+ PushMobileMessage(CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state)));
+
+ command->Run();
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state),
+ Command::CommandSource::SOURCE_SDL));
+
+ command->Run();
+}
+
+} // on_driver_distraction_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
new file mode 100644
index 0000000000..2d50ec2b72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018 Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "hmi/on_system_time_ready_notification.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_system_time_ready_notification {
+
+using sdl_rpc_plugin::commands::OnSystemTimeReadyNotification;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::ReturnRef;
+
+class OnSystemTimeReadyNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+
+TEST_F(OnSystemTimeReadyNotificationTest, Run_SUCCESS) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr msg = CreateMessage();
+ MockEventDispatcher mock_event_dispatcher;
+
+ auto command(CreateCommand<OnSystemTimeReadyNotification>(msg));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady,
+ event_id);
+}
+
+} // namespace on_system_time_ready_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..8e62c1a409
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/rc_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class RCGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][strings::rc_capability] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& remote_control_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability];
+
+ remote_control_capability["climateControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["climateControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& climate_control_capability =
+ remote_control_capability["climateControlCapabilities"][0];
+
+ climate_control_capability["moduleName"] = "Climate";
+ climate_control_capability["fanSpeedAvailable"] = true;
+ climate_control_capability["desiredTemperatureAvailable"] = true;
+ climate_control_capability["acEnableAvailable"] = true;
+ climate_control_capability["acMaxEnableAvailable"] = true;
+ climate_control_capability["circulateAirEnableAvailable"] = true;
+ climate_control_capability["autoModeEnableAvailable"] = true;
+ climate_control_capability["dualModeEnableAvailable"] = true;
+
+ climate_control_capability["defrostZoneAvailable"] = true;
+ climate_control_capability["defrostZone"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["defrostZone"][0] = "ALL";
+
+ climate_control_capability["ventilationModeAvailable"] = true;
+ climate_control_capability["ventilationMode"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["ventilationMode"][0] = "BOTH";
+
+ remote_control_capability["radioControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["radioControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& radio_control_capability =
+ remote_control_capability["radioControlCapabilities"][0];
+
+ radio_control_capability["moduleName"] = "Radio";
+ radio_control_capability["radioEnableAvailable"] = true;
+ radio_control_capability["radioBandAvailable"] = true;
+ radio_control_capability["radioFrequencyAvailable"] = true;
+ radio_control_capability["hdChannelAvailable"] = true;
+ radio_control_capability["rdsDataAvailable"] = true;
+ radio_control_capability["availableHDsAvailable"] = true;
+ radio_control_capability["stateAvailable"] = true;
+ radio_control_capability["signalStrengthAvailable"] = true;
+ radio_control_capability["signalChangeThresholdAvailable"] = true;
+
+ remote_control_capability[hmi_response::button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability[hmi_response::button_capabilities][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& button_capability =
+ remote_control_capability[hmi_response::button_capabilities][0];
+
+ button_capability[strings::button_name] = "OK";
+ button_capability["shortPressAvailable"] = true;
+ button_capability["longPressAvailable"] = true;
+ button_capability["upDownAvailable"] = true;
+
+ RCGetCapabilitiesResponsePtr command(
+ CreateCommand<RCGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject rc_capability_so =
+ (*command_msg)[strings::msg_params][strings::rc_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so));
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(true));
+
+ command->Run();
+}
+
+} // namespace rc_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
new file mode 100644
index 0000000000..030db2f424
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/rc_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::RCIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr;
+
+class RCIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_rc_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_rc_cooperating(is_rc_cooperating_available));
+ if (!is_rc_cooperating_available) {
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false));
+ }
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr capabilities(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_rc_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_rc_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ RCIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+};
+
+TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_rc_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace rc_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
new file mode 100644
index 0000000000..a1a8c1c87e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/rc_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_response {
+
+using ::testing::Return;
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::RCIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<RCIsReadyResponse> RCIsReadyResponsePtr;
+
+class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) {
+ RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace rc_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
new file mode 100644
index 0000000000..0b1f2df491
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/response_from_hmi.h"
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace response_from_hmi {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::DoAll;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+using application_manager::commands::ResponseFromHMI;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseFromHMITest, SendResponseToMobile_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(msg, _));
+
+ command->SendResponseToMobile(msg, app_mngr_);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*msg)[am::strings::params][am::strings::message_type].asInt());
+
+ EXPECT_EQ(application_manager::MessageType::kResponse, received_message_tipe);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+
+ ASSERT_TRUE((bool)result_msg);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*result_msg)[am::strings::params][am::strings::message_type]
+ .asInt());
+
+ EXPECT_EQ(am::MessageType::kRequest, received_message_tipe);
+
+ const hmi_apis::FunctionID::eType received_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ EXPECT_EQ(posted_function_id, received_function_id);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+}
+
+} // namespace response_from_hmi
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
new file mode 100644
index 0000000000..38cbc7b069
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -0,0 +1,500 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/lock.h"
+#include "utils/helpers.h"
+#include "hmi/sdl_activate_app_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_state_controller.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_request {
+
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLActivateAppRequest;
+using am::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::Mock;
+using ::testing::NiceMock;
+using policy_test::MockPolicyHandlerInterface;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kAppIDFirst = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+MATCHER_P2(CheckMsgParams, result, corr_id, "") {
+ const bool is_func_id_valid =
+ hmi_apis::FunctionID::SDL_ActivateApp ==
+ static_cast<int32_t>(
+ (*arg)[strings::params][strings::function_id].asInt());
+
+ const bool is_result_code_valid =
+ hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED ==
+ static_cast<int32_t>(
+ (*arg)[strings::msg_params][strings::result_code].asInt());
+
+ const bool is_result_valid =
+ result == (*arg)[strings::msg_params][strings::success].asBool();
+
+ const bool is_corr_id_valid =
+ corr_id == ((*arg)[strings::params][strings::correlation_id].asUInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ is_func_id_valid,
+ is_result_code_valid,
+ is_result_valid,
+ is_corr_id_valid);
+}
+
+class SDLActivateAppRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SDLActivateAppRequestTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+
+ protected:
+ ~SDLActivateAppRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ MockAppPtr mock_app = CreateMockApp();
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID));
+ ON_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillByDefault(Return(mock_app));
+ }
+ void SetCorrelationAndAppID(MessageSharedPtr msg) {
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+ }
+
+ ApplicationSet app_list_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+ policy_test::MockPolicyHandlerInterface policy_handler_;
+ application_manager_test::MockStateController mock_state_controller_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+
+TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+ (*msg)[strings::msg_params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_ActivateApp;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+#else
+
+TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppID)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ const std::string url = "url";
+ ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url));
+ const std::string package = "package";
+ ON_CALL(*mock_app_first, PackageName()).WillByDefault(Return(package));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ app_list_ = accessor.GetData();
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppIDFirst))
+ .WillByDefault(Return(mock_app_first));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+
+ const std::string schema("schema");
+ mock_app->SetShemaUrl(schema);
+ const std::string package_name("package_name");
+ mock_app->SetPackageName(package_name);
+
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, schema, package_name, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+#endif
+
+TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+ ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->onTimeOut();
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*event_msg);
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillOnce(Return(invalid_mock_app));
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ std::shared_ptr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppID));
+
+ EXPECT_CALL(mock_policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->on_event(event);
+}
+
+} // namespace sdl_activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
new file mode 100644
index 0000000000..bca316bcfa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "hmi/sdl_activate_app_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_response {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::SDLActivateAppResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class SDLActivateAppResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ SDLActivateAppResponsePtr command(
+ CreateCommand<SDLActivateAppResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace sdl_activate_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
new file mode 100644
index 0000000000..262ac5fc7d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_list_of_permissions_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetListOfPermissionsRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using smart_objects::SmartObject;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kConnectionKey = 0u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetListOfPermissionsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ }
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetListOfPermissions(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetListOfPermissions(kConnectionKey, kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_list_of_permissions_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
new file mode 100644
index 0000000000..fca8ed840f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_status_update_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_status_update_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetStatusUpdateRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetStatusUpdateRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ std::shared_ptr<SDLGetStatusUpdateRequest> command(
+ CreateCommand<SDLGetStatusUpdateRequest>(msg));
+
+ EXPECT_CALL(mock_policy_handler_, OnGetStatusUpdate(kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_status_update_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
new file mode 100644
index 0000000000..b040f8ea40
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_user_friendly_message_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SDLGetUserFriendlyMessageRequest;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using test::components::application_manager_test::MockHMICapabilities;
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const std::string kLanguageDe = "de-de";
+const std::string kLanguageEn = "en-gb";
+const std::string kMessageCodes = "messageCodes";
+const hmi_apis::Common_Language::eType kLanguage =
+ hmi_apis::Common_Language::EN_GB;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+
+class SDLGetUserFriendlyMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+ }
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ (*msg)[strings::msg_params][strings::language] = kLanguage;
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(kLanguage));
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0);
+ EXPECT_CALL(mock_policy_handler_, OnGetUserFriendlyMessage(_, _, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace sdl_get_user_friendly_message_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
new file mode 100644
index 0000000000..581913d3a5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_notifications_test {
+
+using namespace application_manager;
+
+using ::testing::Types;
+using commands::NotificationToHMI;
+template <typename Command>
+class SimpleNotificationsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::CommandNotificationImpl, NotificationToHMI>
+ CommandsList;
+
+TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
+
+TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+} // namespace simple_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
new file mode 100644
index 0000000000..5c42d265c7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/request_from_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+using ::testing::NiceMock;
+namespace commands = ::application_manager::commands;
+using commands::MessageSharedPtr;
+using ::application_manager::event_engine::EventObserver;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ }
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_NO_THROW(command->on_event(event));
+}
+
+TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
+ std::shared_ptr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+
+ const bool success = false;
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull()));
+
+ command->SendResponse(success,
+ correlation_id,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
new file mode 100644
index 0000000000..599c7e50f2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/command.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
+#include "application_manager/commands/request_to_hmi.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h"
+#include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h"
+#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h"
+#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h"
+#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
+#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
+#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
+#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
+
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+namespace am_commands = application_manager::commands;
+using am_commands::MessageSharedPtr;
+using event_engine_test::MockEventDispatcher;
+
+class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
+ std::shared_ptr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->SendRequest();
+}
+
+template <typename Command>
+class RequestToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <typename Command>
+class RequestToHMICommandsTest2 : public RequestToHMICommandsTest<Command> {};
+
+template <typename Command>
+class RequestToHMICommandsTest3
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<sdl_rpc_plugin::commands::hmi::DialNumberRequest,
+ sdl_rpc_plugin::commands::ClosePopupRequest,
+ sdl_rpc_plugin::commands::TTSSetGlobalPropertiesRequest,
+ sdl_rpc_plugin::commands::TTSSpeakRequest,
+ sdl_rpc_plugin::commands::TTSStopSpeakingRequest,
+ sdl_rpc_plugin::commands::TTSGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::UIAddCommandRequest,
+ sdl_rpc_plugin::commands::UIAddSubmenuRequest,
+ sdl_rpc_plugin::commands::UIAlertRequest,
+ sdl_rpc_plugin::commands::UIChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::UIDeleteCommandRequest,
+ sdl_rpc_plugin::commands::UIDeleteSubmenuRequest,
+ sdl_rpc_plugin::commands::UIEndAudioPassThruRequest,
+ sdl_rpc_plugin::commands::UIGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::UIGetLanguageRequest,
+ sdl_rpc_plugin::commands::UIGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::UIPerformAudioPassThruRequest,
+ sdl_rpc_plugin::commands::UIPerformInteractionRequest,
+ sdl_rpc_plugin::commands::UISetMediaClockTimerRequest,
+ sdl_rpc_plugin::commands::UIShowRequest,
+ sdl_rpc_plugin::commands::VRAddCommandRequest,
+ sdl_rpc_plugin::commands::VRChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::VRDeleteCommandRequest,
+ sdl_rpc_plugin::commands::UISliderRequest,
+ sdl_rpc_plugin::commands::TTSChangeRegistrationRequest,
+ sdl_rpc_plugin::commands::TTSGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::TTSGetLanguageRequest,
+ sdl_rpc_plugin::commands::AllowAllAppsRequest,
+ sdl_rpc_plugin::commands::BasicCommunicationSystemRequest,
+ sdl_rpc_plugin::commands::ButtonGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::NaviSendLocationRequest,
+ sdl_rpc_plugin::commands::NaviUnsubscribeWayPointsRequest,
+ sdl_rpc_plugin::commands::NaviUpdateTurnListRequest,
+ sdl_rpc_plugin::commands::NaviShowConstantTBTRequest,
+ sdl_rpc_plugin::commands::NaviStopStreamRequest,
+ sdl_rpc_plugin::commands::NaviSubscribeWayPointsRequest,
+ sdl_rpc_plugin::commands::NaviAlertManeuverRequest,
+ sdl_rpc_plugin::commands::AudioStopStreamRequest,
+ sdl_rpc_plugin::commands::NaviGetWayPointsRequest,
+ sdl_rpc_plugin::commands::UISetGlobalPropertiesRequest,
+ sdl_rpc_plugin::commands::UISendHapticDataRequest>
+ RequestCommandsList;
+
+typedef Types<sdl_rpc_plugin::commands::UIScrollableMessageRequest,
+ sdl_rpc_plugin::commands::VRGetCapabilitiesRequest,
+ sdl_rpc_plugin::commands::UISetAppIconRequest,
+ sdl_rpc_plugin::commands::UiSetDisplayLayoutRequest,
+ sdl_rpc_plugin::commands::VRGetSupportedLanguagesRequest,
+ sdl_rpc_plugin::commands::VRGetLanguageRequest,
+ sdl_rpc_plugin::commands::VRPerformInteractionRequest,
+ sdl_rpc_plugin::commands::AllowAppRequest,
+// TODO (OKozlov). Need to clarify why UT fails
+// for UISetIconRequest
+// am_commands::UISetIconRequest,
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ sdl_rpc_plugin::commands::SDLPolicyUpdate,
+#endif
+ sdl_rpc_plugin::commands::hmi::DialNumberRequest>
+ RequestCommandsList2;
+
+typedef Types<sdl_rpc_plugin::commands::TTSIsReadyRequest,
+ sdl_rpc_plugin::commands::UIIsReadyRequest,
+ sdl_rpc_plugin::commands::NaviIsReadyRequest,
+ sdl_rpc_plugin::commands::VRIsReadyRequest> RequestCommandsList3;
+
+TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList);
+TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2);
+TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
+
+TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
new file mode 100644
index 0000000000..4a86fa9458
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_alert_maneuver_response.h"
+#include "hmi/navi_audio_start_stream_response.h"
+#include "hmi/navi_audio_stop_stream_response.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/dial_number_response.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_stop_speaking_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_add_command_response.h"
+#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_delete_command_response.h"
+#include "hmi/ui_delete_submenu_response.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/vr_add_command_response.h"
+#include "hmi/vr_change_registration_response.h"
+#include "hmi/vr_delete_command_response.h"
+#include "hmi/vr_perform_interaction_response.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/update_device_list_response.h"
+#include "application_manager/commands/notification_from_hmi.h"
+#include "hmi/ui_send_haptic_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Types;
+using ::testing::Eq;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+using am::commands::MessageSharedPtr;
+template <class CommandD>
+class ResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef CommandD CommandData;
+ MockEventDispatcher event_dispatcher_;
+
+ ResponseFromHMICommandsTest() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+};
+
+template <class Command>
+class EmptyResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class Command, hmi_apis::FunctionID::eType kExpectedEventId>
+struct CommandData {
+ typedef Command CommandType;
+ enum { kEventId = kExpectedEventId };
+};
+
+typedef Types<
+ CommandData<sdl_rpc_plugin::commands::TTSSpeakResponse,
+ hmi_apis::FunctionID::TTS_Speak>,
+ CommandData<sdl_rpc_plugin::commands::hmi::DialNumberResponse,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::TTSSetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::TTS_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::TTSStopSpeakingResponse,
+ hmi_apis::FunctionID::TTS_StopSpeaking>,
+ CommandData<sdl_rpc_plugin::commands::UIAddCommandResponse,
+ hmi_apis::FunctionID::UI_AddCommand>,
+ CommandData<sdl_rpc_plugin::commands::UIAddSubmenuResponse,
+ hmi_apis::FunctionID::UI_AddSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIAlertResponse,
+ hmi_apis::FunctionID::UI_Alert>,
+ CommandData<sdl_rpc_plugin::commands::UIChangeRegistratioResponse,
+ hmi_apis::FunctionID::UI_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteCommandResponse,
+ hmi_apis::FunctionID::UI_DeleteCommand>,
+ CommandData<sdl_rpc_plugin::commands::UIPerformAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_PerformAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::UIPerformInteractionResponse,
+ hmi_apis::FunctionID::UI_PerformInteraction>,
+ CommandData<sdl_rpc_plugin::commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<sdl_rpc_plugin::commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<sdl_rpc_plugin::commands::UISetMediaClockTimerResponse,
+ hmi_apis::FunctionID::UI_SetMediaClockTimer>,
+ CommandData<sdl_rpc_plugin::commands::UIShowResponse,
+ hmi_apis::FunctionID::UI_Show>,
+ CommandData<sdl_rpc_plugin::commands::VRAddCommandResponse,
+ hmi_apis::FunctionID::VR_AddCommand>,
+ CommandData<sdl_rpc_plugin::commands::VRChangeRegistrationResponse,
+ hmi_apis::FunctionID::VR_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::VRDeleteCommandResponse,
+ hmi_apis::FunctionID::VR_DeleteCommand>,
+ CommandData<sdl_rpc_plugin::commands::UISliderResponse,
+ hmi_apis::FunctionID::UI_Slider>,
+ CommandData<sdl_rpc_plugin::commands::TTSChangeRegistratioResponse,
+ hmi_apis::FunctionID::TTS_ChangeRegistration>,
+ CommandData<sdl_rpc_plugin::commands::ActivateAppResponse,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp>,
+ CommandData<sdl_rpc_plugin::commands::BasicCommunicationSystemResponse,
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest>,
+ CommandData<sdl_rpc_plugin::commands::NaviAlertManeuverResponse,
+ hmi_apis::FunctionID::Navigation_AlertManeuver>,
+ CommandData<sdl_rpc_plugin::commands::AudioStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartAudioStream>,
+ CommandData<sdl_rpc_plugin::commands::NaviGetWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_GetWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviSendLocationResponse,
+ hmi_apis::FunctionID::Navigation_SendLocation>,
+ CommandData<sdl_rpc_plugin::commands::NaviShowConstantTBTResponse,
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT>,
+ CommandData<sdl_rpc_plugin::commands::NaviStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartStream>,
+ CommandData<sdl_rpc_plugin::commands::NaviSubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviUnsubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints>,
+ CommandData<sdl_rpc_plugin::commands::NaviUpdateTurnListResponse,
+ hmi_apis::FunctionID::Navigation_UpdateTurnList>,
+ CommandData<sdl_rpc_plugin::commands::UISetAppIconResponse,
+ hmi_apis::FunctionID::UI_SetAppIcon>,
+ CommandData<sdl_rpc_plugin::commands::UiSetDisplayLayoutResponse,
+ hmi_apis::FunctionID::UI_SetDisplayLayout>,
+ CommandData<sdl_rpc_plugin::commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<sdl_rpc_plugin::commands::VRPerformInteractionResponse,
+ hmi_apis::FunctionID::VR_PerformInteraction>,
+ CommandData<sdl_rpc_plugin::commands::UIScrollableMessageResponse,
+ hmi_apis::FunctionID::UI_ScrollableMessage>,
+ CommandData<sdl_rpc_plugin::commands::UISendHapticDataResponse,
+ hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
+
+typedef Types<sdl_rpc_plugin::commands::AudioStopStreamResponse,
+ sdl_rpc_plugin::commands::NaviStopStreamResponse,
+ sdl_rpc_plugin::commands::OnFindApplications,
+ sdl_rpc_plugin::commands::OnUpdateDeviceList,
+ sdl_rpc_plugin::commands::SDLPolicyUpdateResponse,
+ sdl_rpc_plugin::commands::UpdateAppListResponse,
+ sdl_rpc_plugin::commands::UpdateDeviceListResponse>
+ EmptyResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseFromHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST_CASE(EmptyResponseFromHMICommandsTest, EmptyResponseCommandsList);
+
+MATCHER_P(EventIdIsEqualTo, function_id, "") {
+ return static_cast<hmi_apis::FunctionID::eType>(function_id) == arg.id();
+}
+
+TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandData CommandData;
+ typedef typename CommandData::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->event_dispatcher_,
+ raise_event(EventIdIsEqualTo(CommandData::kEventId)));
+
+ command->Run();
+}
+
+TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+
+ command->Run();
+}
+
+class OtherResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(VehicleTypeIsEqualTo, vehicle_type, "") {
+ return (*vehicle_type) == arg.asString();
+}
+
+MATCHER_P(CheckMsgType, msg_type, "") {
+ return msg_type ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+}
+
+class NotificationFromHMITest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>());
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+}
+
+TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>());
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMsgType(am::MessageType::kNotification),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command->SendNotificationToMobile(command_msg);
+}
+
+TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params] = 0;
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
+ CreateCommand<application_manager::commands::NotificationFromHMI>(
+ command_msg));
+
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(CheckMsgType(am::MessageType::kRequest)))
+ .WillOnce(Return(false));
+
+ command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM,
+ (*command_msg)[am::strings::msg_params]);
+}
+
+} // namespace simple_response_from_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
new file mode 100644
index 0000000000..643e21d818
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/commands_test.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h"
+#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/commands/response_to_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+namespace commands = sdl_rpc_plugin::commands;
+using application_manager::commands::MessageSharedPtr;
+
+template <class Command>
+class ResponseToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::SDLActivateAppResponse,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
+ CreateCommand<application_manager::commands::ResponseToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseToHMITest, Run_SUCCESS) {
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
+ CreateCommand<application_manager::commands::ResponseToHMI>());
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_response_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..bc9d262e6d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "hmi/tts_get_capabilities_response.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::TTSGetCapabilitiesResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+
+using testing::_;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const std::string kText = "TEXT";
+}
+
+class TTSGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+} // namespace tts_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
new file mode 100644
index 0000000000..0d22500f48
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/tts_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_language_response {
+
+using sdl_rpc_plugin::commands::TTSGetLanguageResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+namespace {
+const Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class TTSGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_tts_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..417b8e1898
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/tts_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_supported_languages_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class TTSGetSupportedLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages((
+ *command_msg)[strings::msg_params][hmi_response::languages]));
+
+ command->Run();
+}
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace tts_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
new file mode 100644
index 0000000000..2fae8a6819
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/response_from_hmi.h"
+#include "hmi/tts_is_ready_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_is_ready_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::TTSIsReadyResponse;
+using am::commands::CommandImpl;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..31e4860d4a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/ui_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using application_manager::commands::ResponseFromHMI;
+using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UIGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetCapabilitiesResponseTest, RUN_SetDisplay_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
+ [hmi_response::display_type] = "GEN2_8_DMA";
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
+ [hmi_response::display_name] = "GENERIC_DISPLAY";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject display_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_display_capabilities(display_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities]
+ [hmi_response::image_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject soft_button_capabilities_so = (*command_msg)
+ [strings::msg_params][hmi_response::soft_button_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_soft_button_capabilities(soft_button_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetHmiZone_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities][0] =
+ "FRONT";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_zone_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_hmi_zone_capabilities(hmi_zone_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg)
+ [strings::msg_params][strings::audio_pass_thru_capabilities];
+ EXPECT_CALL(
+ mock_hmi_capabilities_,
+ set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigation_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::navigation] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_supported(
+ hmi_capabilities_so[strings::navigation].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::phone_call] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_call_supported(
+ hmi_capabilities_so[strings::phone_call].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::video_streaming] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_supported(
+ hmi_capabilities_so[strings::video_streaming].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["sendLocationEnabled"] = true;
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["getWayPointsEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject navigation_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_capability(navigation_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability]["dialNumberEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject phone_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_capability(phone_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& video_streaming_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability];
+
+ video_streaming_capability[strings::preferred_resolution] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_width] = 800;
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_height] = 350;
+
+ video_streaming_capability[strings::max_bitrate] = 10000;
+
+ video_streaming_capability[strings::supported_formats] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ video_streaming_capability[strings::supported_formats][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ video_streaming_capability[strings::supported_formats][0][strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RAW;
+
+ video_streaming_capability[strings::supported_formats][0][strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H264;
+
+ video_streaming_capability[strings::haptic_spatial_data_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_capability(video_streaming_capability));
+
+ command->Run();
+}
+
+} // namespace ui_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
new file mode 100644
index 0000000000..de69c5de5c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/ui_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_language_response {
+
+using sdl_rpc_plugin::commands::UIGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class UIGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_ui_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..5626e2b0ee
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "hmi/ui_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_supported_languages_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::UIGetSupportedLanguagesResponse;
+
+typedef std::shared_ptr<UIGetSupportedLanguagesResponse>
+ UIGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class UIGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace ui_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
new file mode 100644
index 0000000000..fe0d8a8470
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/ui_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_request {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::UIIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr;
+
+class UIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UIIsReadyRequestTest() : command_(CreateCommand<UIIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_ui_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ui_cooperating(is_ui_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr get_language(CreateMessage());
+ (*get_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _))
+ .WillOnce(Return(get_language));
+
+ smart_objects::SmartObjectSPtr get_all_language(CreateMessage());
+ (*get_all_language)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_all_language)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _))
+ .WillOnce(Return(get_all_language));
+
+ smart_objects::SmartObjectSPtr get_capabilities(CreateMessage());
+ (*get_capabilities)[am::strings::params][am::strings::message_type] =
+ static_cast<int>(am::MessageType::kRequest);
+ (*get_capabilities)[am::strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _))
+ .WillOnce(Return(get_capabilities));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*get_language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_all_language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_ui_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_ui_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ UIIsReadyRequestPtr command_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest,
+ OnEvent_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_ui_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnEvent_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_ui_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::UI_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_ui_cooperating_available);
+ SetUpExpectations(is_ui_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace ui_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
new file mode 100644
index 0000000000..cccdbdc44d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/ui_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::UIIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<UIIsReadyResponse> UIIsReadyResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) {
+ UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
new file mode 100644
index 0000000000..c566702998
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/request_controller_settings.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "hmi/update_device_list_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_device_list_request {
+
+using testing::_;
+using testing::ReturnRef;
+using testing::Return;
+using test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::event_engine::Event;
+using sdl_rpc_plugin::commands::UpdateDeviceListRequest;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UpdateDeviceListRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ return command_msg;
+ }
+
+ MockApplicationManagerSettings settings_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::BasicCommunication_OnReady);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+} // namespace update_device_list_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
new file mode 100644
index 0000000000..af3b9bebf6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/update_sdl_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_request {
+
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::UpdateSDLRequest;
+
+typedef std::shared_ptr<UpdateSDLRequest> UpdateSDLRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
+
+ EXPECT_CALL(mock_policy_handler_, PTExchangeAtUserRequest(kCorrelationId));
+
+ command->Run();
+
+ EXPECT_EQ(kCorrelationId,
+ (*command_msg)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace update_sdl_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
new file mode 100644
index 0000000000..93c49724ce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "hmi/update_sdl_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_response {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using sdl_rpc_plugin::commands::UpdateSDLResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<UpdateSDLResponse> UpdateSDLResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ UpdateSDLResponsePtr command(CreateCommand<UpdateSDLResponse>(command_msg));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace update_sdl_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..15d38d4ef3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "hmi/vr_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_capabilities_response {
+
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef std::shared_ptr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class VRGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::vr_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][strings::vr_capabilities][0] =
+ "vrCapabilities";
+
+ VRGetCapabilitiesResponsePtr command(
+ CreateCommand<VRGetCapabilitiesResponse>(command_msg));
+
+ smart_objects::SmartObject vr_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::vr_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_vr_capabilities(vr_capabilities_so));
+
+ command->Run();
+}
+
+} // namespace vr_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
new file mode 100644
index 0000000000..05ed186963
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "hmi/vr_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_language_response {
+
+using sdl_rpc_plugin::commands::VRGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class VRGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ std::shared_ptr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_active_vr_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..56b11ad440
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "hmi/vr_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_supported_languages_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRGetSupportedLanguagesResponse;
+
+typedef std::shared_ptr<VRGetSupportedLanguagesResponse>
+ VRGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class VRGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace vr_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
new file mode 100644
index 0000000000..5aa00e0264
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/vr_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::VRIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr;
+
+class VRIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VRIsReadyRequestTest() : command_(CreateCommand<VRIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vr_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ const bool is_send_message_by_timeout = false;
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_vr_cooperating(is_vr_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI(bool is_send_message_by_timeout) {
+ smart_objects::SmartObjectSPtr language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
+ .WillOnce(Return(language));
+ EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language));
+
+ smart_objects::SmartObjectSPtr support_language(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _))
+ .WillOnce(Return(support_language));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language));
+
+ smart_objects::SmartObjectSPtr capabilities(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vr_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vr_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VRIsReadyRequestPtr command_;
+};
+
+TEST_F(VRIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vr_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vr_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VR_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vr_cooperating_available);
+ SetUpExpectations(is_vr_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VRIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ const bool is_send_message_by_timeout = true;
+ ExpectSendMessagesToHMI(is_send_message_by_timeout);
+ command_->onTimeOut();
+}
+
+} // namespace vr_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
new file mode 100644
index 0000000000..0e56f5b483
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "hmi/vr_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_response {
+
+using ::testing::Return;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using sdl_rpc_plugin::commands::VRIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<VRIsReadyResponse> VRIsReadyResponsePtr;
+
+class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) {
+ VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
new file mode 100644
index 0000000000..7c99b5f2b8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
@@ -0,0 +1,1154 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/add_command_request.h"
+
+#include "gtest/gtest.h"
+
+#include "utils/helpers.h"
+
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_command_request {
+
+namespace am = application_manager;
+namespace am_test = application_manager_test;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+using sdl_rpc_plugin::commands::AddCommandRequest;
+using ns_smart_device_link::ns_smart_objects::SmartObjectSPtr;
+using ::test::components::application_manager_test::MockApplication;
+using am::event_engine::EventObserver;
+using namespace smart_objects;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace hmi_request = ::application_manager::hmi_request;
+using namespace strings;
+
+namespace {
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const std::string kMenuName = "LG";
+const uint32_t kFirstParentId = 10u;
+const uint32_t kSecondParentId = 1u;
+const std::string kErroredVRCommand = "l\namer";
+const std::string kFirstVrCommand = "lamer";
+const std::string kSecondVrCommand = "hacker";
+const uint32_t kFirstCommandId = 10u;
+const uint32_t kSecondCommandId = 11u;
+const int32_t kType = 34;
+const int32_t kGrammarId = 12;
+const int32_t kPosition = 10;
+} // namespace
+
+class AddCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AddCommandRequestTest()
+ : msg_(CreateMessage())
+ , default_app_name_("test_default_app_name_")
+ , lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , mock_app_(CreateMockApp()) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ InitGetters();
+ InitBasicMessage();
+ }
+
+ protected:
+ void InitBasicMessage() {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[msg_params][app_id] = kAppId;
+ (*msg_)[msg_params][app_name] = default_app_name_;
+ }
+
+ void InitGetters() {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillByDefault(Return(so_ptr_.get()));
+ }
+
+ void CreateBasicParamsUIRequest() {
+ SmartObject menu_params = SmartObject(SmartType_Map);
+ menu_params[position] = kPosition;
+ menu_params[menu_name] = kMenuName;
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[strings::menu_params] = menu_params;
+ msg_params[cmd_icon] = 1;
+ msg_params[cmd_icon][value] = "10";
+ msg_params[info] = "UI info";
+ }
+
+ void CreateBasicParamsVRRequest() {
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[vr_commands] = SmartObject(SmartType_Array);
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ msg_params[type] = kPosition;
+ msg_params[grammar_id] = kGrammarId;
+ msg_params[info] = "VR info";
+ }
+
+ const am::CommandsMap CreateCommandsMap(SmartObject& first_command,
+ SmartObject& second_command) {
+ second_command[menu_params] = SmartObject(SmartType_Map);
+ second_command[menu_params][hmi_request::parent_id] = kFirstParentId;
+ second_command[menu_params][menu_name] = kMenuName;
+ second_command[vr_commands] = SmartObject(SmartType_Array);
+ second_command[vr_commands][0] = kSecondVrCommand;
+ am::CommandsMap commands_map;
+ commands_map.insert(std::make_pair(kFirstCommandId, &first_command));
+ commands_map.insert(std::make_pair(kSecondCommandId, &second_command));
+ return commands_map;
+ }
+
+ void CheckOnTimeOutCommandDeletion(
+ const hmi_apis::FunctionID::eType incoming_cmd,
+ const hmi_apis::FunctionID::eType cmd_to_delete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event(incoming_cmd);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
+
+ .WillOnce(Return(true));
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(response,
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
+ }
+
+ MessageSharedPtr msg_;
+ SmartObjectSPtr so_ptr_;
+ const utils::custom_string::CustomString default_app_name_;
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_WARNINGS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ const std::string errored_menu_name = "L\nG";
+ msg_params[menu_params][menu_name] = errored_menu_name;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ SmartObject parent = SmartObject(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kFirstParentId))
+ .WillOnce(Return(&parent));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_VRCommandsHaveSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[vr_commands][0] = kErroredVRCommand;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ (*msg)[params][connection_key] = kConnectionKey;
+ msg_params[cmd_id] = kCmdId;
+ msg_params[cmd_icon] = 1;
+ const std::string errored_cmd_icon_value = "1\n0";
+ msg_params[cmd_icon][value] = errored_cmd_icon_value;
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CommandNameAlreadyExists_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgParentIDsAreDifferentSubmenuNotExisted_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgVrSynonymsAreTheSame_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ msg_params[vr_commands][0] = kSecondVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[params][connection_key] = kConnectionKey;
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[app_id] = kAppId;
+ msg_params[cmd_id] = kCmdId;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsg_UI_and_Vr_AreCorrect_EXPECT_VR_AND_UI_SENT) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_ptr_)));
+
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
+ CreateBasicParamsVRRequest();
+ MessageSharedPtr msg = CreateMessage(SmartType_Map);
+ (*msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_VR_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::VR_AddCommand,
+ hmi_apis::FunctionID::VR_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::UI_AddCommand,
+ hmi_apis::FunctionID::UI_DeleteCommand);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
+ MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
+ (*command_msg)[params][connection_key] = kConnectionKey;
+ MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
+ (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[msg_params][cmd_id] = kCmdId;
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(command_msg);
+ request_ptr->Run();
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsRejected_ExpectUICommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::REJECTED;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::REJECTED), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsWarnings_ExpectCommandUpdated) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, _, false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsGenericError_VR_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsGenericError_UI_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_vr);
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ event_ui.set_smart_object(*msg_ui);
+ request_ptr->on_event(event_ui);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_UI_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_VR_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_EventWithNotSuccesResponseCode_ExpectVRCommandDelete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_ui);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_VR_Events_VRErrorPresent_ExpectRemoveCommand) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnTimeOut_AppNotExisted_NoAppRemoveCommandCalled) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(
+ CreateCommand<AddCommandRequest>(msg_));
+ base_class_request->onTimeOut();
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandSource::SOURCE_SDL));
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
+}
+
+} // namespace add_command_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
new file mode 100644
index 0000000000..ecaa436529
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "mobile/add_sub_menu_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace add_sub_menu_request {
+
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::AddSubMenuRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using ::testing::_;
+using ::testing::Return;
+
+typedef std::shared_ptr<AddSubMenuRequest> AddSubMenuPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kAppId = 1u;
+} // namespace
+
+class AddSubMenuRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AddSubMenuRequestTest() : mock_app(CreateMockApp()) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ }
+
+ MockAppPtr mock_app;
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+};
+
+TEST_F(AddSubMenuRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ const uint32_t menu_id = 10u;
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject& msg_params = (*msg)[am::strings::msg_params];
+
+ msg_params[am::strings::menu_icon] = 1;
+ msg_params[am::strings::menu_icon][am::strings::value] = "10";
+ msg_params[am::strings::menu_id] = menu_id;
+ msg_params[am::strings::menu_name] = "test";
+ SmartObject& image = msg_params[am::strings::menu_icon];
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ std::shared_ptr<AddSubMenuRequest> request_ptr =
+ CreateCommand<AddSubMenuRequest>(msg);
+
+ request_ptr->Run();
+}
+
+TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const uint32_t menu_id = 10u;
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id;
+
+ std::shared_ptr<AddSubMenuRequest> command =
+ CreateCommand<AddSubMenuRequest>(msg);
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, AddSubMenu(menu_id, _));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ command->Init();
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace add_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
new file mode 100644
index 0000000000..7d2dd0b2c2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/alert_maneuver_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_maneuver_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::AlertManeuverRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<AlertManeuverRequest> CommandPtr;
+
+class AlertManeuverRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] = hmi_response;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*response);
+
+ std::shared_ptr<AlertManeuverRequest> command =
+ CreateCommand<AlertManeuverRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->on_event(event);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ success);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+};
+
+TEST_F(AlertManeuverRequestTest, Run_RequiredFieldsDoesNotExist_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] = 0;
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ const mobile_apis::Result::eType kProcessingResult =
+ mobile_apis::Result::ABORTED;
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
+ .WillOnce(Return(kProcessingResult));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(kProcessingResult,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks] =
+ SmartObject(smart_objects::SmartType_Array);
+
+ SmartObject tts_chunk(smart_objects::SmartType_Map);
+ tts_chunk[am::strings::text] = "wrong chunk syntax\t\n";
+
+ (*msg)[am::strings::msg_params][am::strings::tts_chunks].asArray()->push_back(
+ tts_chunk);
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
+
+ CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ CommandPtr command(CreateCommand<AlertManeuverRequest>());
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_ENUM,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_SUCCESS) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_WARNINGS) {
+ CheckExpectations(hmi_apis::Common_Result::WARNINGS,
+ mobile_apis::Result::WARNINGS,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(AlertManeuverRequestTest, OnEvent_GENERIC_ERROR) {
+ CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR,
+ mobile_apis::Result::GENERIC_ERROR,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+} // namespace alert_maneuver_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
new file mode 100644
index 0000000000..e32cc2b335
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
@@ -0,0 +1,809 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/alert_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace alert_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::AlertRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::event_engine::Event;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<AlertRequest> CommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::AlertID;
+} // namespace
+
+class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ AlertRequestTest() : mock_app_(CreateMockApp()), msg_(CreateMessage()) {}
+
+ protected:
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
+ }
+
+ void Expectations() {
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ }
+
+ void AddAlertTextsToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::alert_text1] = "alert_text1";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] = "alert_text2";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] = "alert_text3";
+ }
+ void AddTTSChunkToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "tts_chunk_text";
+ }
+
+ void ExpectCallHmiLevel(const mobile_apis::HMILevel::eType level) {
+ EXPECT_CALL(*mock_app_, hmi_level()).WillRepeatedly(Return(level));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ void ExpectManageHmiCommandTTSAndUI() {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+ }
+ sync_primitives::Lock lock_;
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+};
+
+TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<AlertRequest> command = CreateCommand<AlertRequest>();
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(command_msg));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ PreConditions();
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*command_msg)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ std::shared_ptr<AlertRequest> command =
+ CreateCommand<AlertRequest>(command_msg);
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ MessageSharedPtr msg_tts = CreateMessage();
+ (*msg_tts)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::TTS_Speak);
+ event_vr.set_smart_object(*msg_tts);
+
+ command->on_event(event_vr);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
+ Expectations();
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, Init_DurationNotExists_SUCCESS) {
+ Expectations();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, OnTimeOut_SUCCESS) {
+ Expectations();
+ MessageSharedPtr result_msg(CreateMessage(smart_objects::SmartType_Null));
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(result_msg));
+
+ CommandPtr command(CreateCommand<AlertRequest>());
+ MessageSharedPtr received_result_msg(
+ CatchMobileCommandResult(CallOnTimeOut(*command)));
+ EXPECT_EQ(result_msg, received_result_msg);
+}
+
+TEST_F(AlertRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ Expectations();
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_AlertFrequencyIsTooHigh_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_FailToProcessSoftButtons_UNSUCCESS) {
+ Expectations();
+ const mobile_apis::Result::eType result_code =
+ mobile_apis::Result::INVALID_ENUM;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(result_code));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(result_code,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreMissed_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreInvalid_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid\t\nParam";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+ (*msg_)[am::strings::msg_params][am::strings::progress_indicator] =
+ "progress_indicator";
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageHmiCommandTTSAndUI();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddAlertTextsToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM);
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ command->Run();
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)));
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ PreConditions();
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest,
+ DISABLED_OnEvent_TTSUnsupportedResourceUiAlertSent_SUCCESS) {
+ PreConditions();
+
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert2_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert3_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidTTSChunk_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+} // namespace alert_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
new file mode 100644
index 0000000000..58755c8b36
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
@@ -0,0 +1,559 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/change_registration_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace change_registration_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgPointee;
+using sdl_rpc_plugin::commands::ChangeRegistrationRequest;
+using policy_test::MockPolicyHandlerInterface;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class ChangeRegistrationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ChangeRegistrationRequestTest()
+ : app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_app_(CreateMockApp())
+ , supported_languages_(CreateMessage(smart_objects::SmartType_Array)) {}
+
+ MessageSharedPtr CreateMsgFromMobile() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::hmi_display_language] = mobile_apis::Language::EN_US;
+ msg_params[strings::language] = mobile_apis::Language::EN_US;
+ (*msg)[strings::msg_params] = msg_params;
+ return msg;
+ }
+ void PrepareExpectationBeforeRun() {
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success,
+ const hmi_apis::Common_Result::eType ui_hmi_response =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ const hmi_apis::Common_Result::eType vr_hmi_response =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set,
+ app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+ PrepareExpectationBeforeRun();
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response, ui_hmi_response, "ui_info");
+ CreateResponseFromHMI(vr_response, vr_hmi_response, "unsupported_resource");
+
+ (*tts_response)[strings::params][hmi_response::code] = hmi_response;
+ (*tts_response)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(
+ hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ void CreateResponseFromHMI(MessageSharedPtr msg,
+ hmi_apis::Common_Result::eType result,
+ const std::string& info) {
+ (*msg)[strings::params][hmi_response::code] = static_cast<int32_t>(result);
+ (*msg)[strings::msg_params][strings::info] = info;
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ExpectationsHmiCapabilities(
+ smart_objects::SmartObjectSPtr supported_languages) {
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages.get()));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ MockHMICapabilities hmi_capabilities_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr supported_languages_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(
+ ui_response, hmi_apis::Common_Result::WARNINGS, "ui_info");
+ CreateResponseFromHMI(vr_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "VR is not supported by system");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(response_to_mobile,
+ "ui_info, VR is not supported by system, tts_info");
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+ application_set.insert(app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(mock_hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(mock_hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->Run();
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_RESOURCE));
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+ mobile_apis::Result::SUCCESS,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_WRONG_LANGUAGE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::WRONG_LANGUAGE,
+ mobile_apis::Result::WRONG_LANGUAGE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_TTS_INVALID_DATA_STATE_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::INVALID_DATA,
+ mobile_apis::Result::INVALID_DATA,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+TEST_F(ChangeRegistrationRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+
+ std::shared_ptr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_ptr_);
+
+ application_set.insert(app);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ smart_objects::SmartObjectSPtr supported_languages(
+ CreateMessage(smart_objects::SmartType_Array));
+ (*supported_languages)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+
+ ExpectationsHmiCapabilities(supported_languages);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ command->Run();
+
+ MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr vr_response = CreateMessage(smart_objects::SmartType_Map);
+ MessageSharedPtr tts_response = CreateMessage(smart_objects::SmartType_Map);
+ CreateResponseFromHMI(ui_response,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ "unsupported_resource");
+ CreateResponseFromHMI(
+ vr_response, hmi_apis::Common_Result::WARNINGS, "vr_info");
+ CreateResponseFromHMI(
+ tts_response, hmi_apis::Common_Result::SUCCESS, "tts_info");
+ (*ui_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*vr_response)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*tts_response)[am::strings::msg_params][am::strings::app_id] =
+ kConnectionKey;
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event_ui.set_smart_object(*ui_response);
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event_vr.set_smart_object(*vr_response);
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event_tts.set_smart_object(*tts_response);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "unsupported_resource, vr_info, tts_info");
+}
+
+} // namespace change_registration_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
new file mode 100644
index 0000000000..c42be48e57
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -0,0 +1,923 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/create_interaction_choice_set_request.h"
+#include "mobile/create_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace create_interaction_choice_set_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+using sdl_rpc_plugin::commands::CreateInteractionChoiceSetRequest;
+using sdl_rpc_plugin::commands::CreateInteractionChoiceSetResponse;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace custom_str = utils::custom_string;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef std::shared_ptr<CreateInteractionChoiceSetRequest>
+ CreateInteractionChoiceSetRequestPtr;
+typedef std::shared_ptr<CreateInteractionChoiceSetResponse>
+ CreateInteractionChoiceSetResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kGrammarId = 10u;
+const int32_t kMenuId = 5;
+const uint32_t kChoiceSetId = 1u;
+const uint32_t kChoiceId1 = 2u;
+const uint32_t kChoiceId2 = 3u;
+const std::string kImage = "image";
+const std::string kSecondImage = "second_image";
+const std::string kVrCommands1 = "vr_commands_1";
+const std::string kVrCommands2 = "vr_commands_2";
+const std::string kMenuName = "menu_name";
+
+} // namespace
+
+class CreateInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ CreateInteractionChoiceSetRequestTest()
+ : message_(CreateMessage())
+ , command_(CreateCommand<CreateInteractionChoiceSetRequest>(message_))
+ , mock_app_(CreateMockApp())
+ , lock_(std::make_shared<sync_primitives::Lock>()) {}
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = "lamer";
+ msg_params[strings::type] = 34;
+ msg_params[strings::grammar_id] = 12;
+ msg_params[strings::app_id] = kAppId;
+ (*msg)[strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void FillMessageFieldsItem1(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ }
+ void FillMessageFieldsItem2(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+ (*message)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id] = kChoiceSetId;
+ }
+
+ MessageSharedPtr message_;
+ CreateInteractionChoiceSetRequestPtr command_;
+ MockAppPtr mock_app_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+class CreateInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
+ MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_vr)[strings::msg_params][strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_vr)[strings::msg_params][strings::success] = false;
+
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>();
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, RemoveCommand(_)).WillByDefault(Return());
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->onTimeOut();
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsVRSO();
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::choice_id] =
+ 10;
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] =
+ "menu_name";
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::vr_commands]
+ [0] = kVrCommands1;
+ (*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11;
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
+ CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ smart_objects::SmartObject* null_obj = NULL;
+ ON_CALL(*mock_app_, FindChoiceSet(_)).WillByDefault(Return(null_obj));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[strings::msg_params][strings::info] = "VR is not supported by system";
+ (*msg)[strings::msg_params][strings::cmd_id] = kCommandId;
+
+ am::event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg);
+
+ smart_objects::SmartObject* ptr = NULL;
+ ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
+ EXPECT_EQ(NULL, ptr);
+
+ am::CommandsMap commands_map;
+ ON_CALL(*mock_app_, commands_map())
+ .WillByDefault(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+ req_vr->Run();
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[strings::msg_params].keyExists(strings::info)) {
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::info].asString(),
+ (*msg)[strings::msg_params][strings::info].asString());
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* invalid_choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_CheckChoiceSet_InvalidChoiceId_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ FillMessageFieldsItem2(message_);
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][1] = " kVrCommands2\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_IsWhiteSpaceVRCommandsExist_InvalidMenuName_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = "menu_name\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = "image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] =
+ "second_image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands_1\t";
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::menu_name)) {
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::tertiary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::vr_commands)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_ValidAmountVrCommands_SUCCESS) {
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .Times(AtLeast(2))
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_EmptyAmountVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_WithoutVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::NONE));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ // No VR commands
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_WithMixedVrCommands_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::MIXED));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidVrCommand_UNSUCCESS) {
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InValidVrNoError_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_DATA;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_ValidVrNoErrorAndExpectedChoiceLessThanReceiveChoice_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::SOURCE_SDL));
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_ValidErrorFromHMI_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(kChoiceSetId));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2);
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0);
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_SuccessfulResponseReceived_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_));
+
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = false;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::INVALID_ENUM;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessTrue_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID())
+ .WillRepeatedly(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2);
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+ command_->Run();
+}
+
+} // namespace create_interaction_choice_set_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
new file mode 100644
index 0000000000..a87d172923
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "mobile/delete_command_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_command_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace am_test = application_manager_test;
+using sdl_rpc_plugin::commands::DeleteCommandRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+
+typedef std::shared_ptr<DeleteCommandRequest> DeleteCommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DeleteCommandRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteCommandRequestTest()
+ : mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , mock_app_(CreateMockApp()) {}
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateFullParamsVRSO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::vr_commands] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[am::strings::vr_commands][0] = "lamer";
+ msg_params[am::strings::type] = 34;
+ msg_params[am::strings::grammar_id] = 12;
+ msg_params[am::strings::app_id] = kAppId;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ }
+
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_VrHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsVRSO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(*mock_app_, FindCommand(kCommandId))
+ .WillByDefault(Return(test_msg.get()));
+ ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*msg);
+ command->Init();
+ command->Run();
+ command->on_event(event_ui);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
+ command->on_event(event_vr);
+
+ ResultCommandExpectations(vr_command_result, "VR is not supported by system");
+}
+
+TEST_F(DeleteCommandRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr command_msg = CreateFullParamsUISO();
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DeleteCommandPtr command(CreateCommand<DeleteCommandRequest>(command_msg));
+
+ MockAppPtr app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ MessageSharedPtr test_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*test_msg)[am::strings::vr_commands] = 0;
+ (*test_msg)[am::strings::menu_params] = 0;
+
+ ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get()));
+ ON_CALL(*app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
+ event_vr.set_smart_object(*msg);
+
+ command->Init();
+ command->Run();
+ command->on_event(event_vr);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
+ event_ui.set_smart_object(*event_msg);
+
+ EXPECT_CALL(*app, RemoveCommand(kCommandId));
+
+ EXPECT_CALL(*app, UpdateHash());
+
+ EXPECT_CALL(*app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event_ui)));
+
+ ASSERT_TRUE((bool)result_msg);
+
+ ResultCommandExpectations(result_msg, "UI is not supported by system");
+}
+
+} // namespace delete_command_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
new file mode 100644
index 0000000000..0ed7a92fa4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+#include <string>
+#include <map>
+
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+
+#include "gtest/gtest.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_application_manager_settings.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_file {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
+using ::testing::AtLeast;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::DeleteFileRequest;
+using sdl_rpc_plugin::commands::DeleteFileResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr;
+typedef std::shared_ptr<DeleteFileResponse> DeleteFileResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+ACTION_TEMPLATE(SetArgPointer,
+ HAS_1_TEMPLATE_PARAMS(int, k),
+ AND_1_VALUE_PARAMS(vec)) {
+ *std::tr1::get<k>(args) = *vec;
+}
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationId = 10u;
+const int32_t kMenuId = 5;
+} // namespace
+
+class DeleteFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteFileRequest>(message_);
+ mock_app_ = CreateMockApp();
+ }
+ DeleteFileRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr mock_app_;
+};
+
+class DeleteFileResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(app_mngr_, get_settings()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const uint32_t num = 0;
+ EXPECT_CALL(app_mngr_settings_, delete_file_in_none())
+ .WillOnce(ReturnRef(num));
+ EXPECT_CALL(*mock_app_, delete_file_in_none_count()).WillOnce(Return(1));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
+ const std::string file_name = "test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(file_name));
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+
+ am::AppFile file;
+ file.file_name = file_name;
+ file.file_type = mobile_apis::FileType::BINARY;
+
+ EXPECT_CALL(*mock_app_, GetFile(_)).WillOnce(Return(&file));
+ EXPECT_CALL(*mock_app_, DeleteFile(_));
+ EXPECT_CALL(*mock_app_, increment_delete_file_in_none_count());
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::SUCCESS),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) {
+ const std::string file_name = "test_file.txt";
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ command_->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ false));
+
+ command->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_ValidApp_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+ const uint32_t kAvailableDiskSpace = 10u;
+ EXPECT_CALL(*app, GetAvailableDiskSpace())
+ .WillOnce(Return(kAvailableDiskSpace));
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(
+ CheckMessageResultCode(mobile_apis::Result::SUCCESS), _));
+
+ command->Run();
+}
+
+} // namespace delete_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
new file mode 100644
index 0000000000..43c30809e5
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -0,0 +1,296 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <map>
+
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_interaction_choice_set {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest;
+using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<DeleteInteractionChoiceSetRequest>
+ DeleteInteractionChoiceSetRequestPtr;
+typedef std::shared_ptr<DeleteInteractionChoiceSetResponse>
+ DeleteInteractionChoiceSetResponsePtr;
+
+MATCHER_P(CheckMessageSuccess, success, "") {
+ return success ==
+ (*arg)[am::strings::msg_params][am::strings::success].asBool();
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kChoiceSetId = 11u;
+const uint32_t kChoiceId = 110u;
+const uint32_t kGrammarId = 101u;
+} // namespace
+
+class DeleteInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteInteractionChoiceSetRequestTest()
+ : performinteraction_choice_set_lock_(
+ std::make_shared<sync_primitives::Lock>())
+ , accessor_(choice_set_map_, performinteraction_choice_set_lock_) {}
+
+ ~DeleteInteractionChoiceSetRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ am::PerformChoiceSetMap choice_set_map_;
+ mutable std::shared_ptr<sync_primitives::Lock>
+ performinteraction_choice_set_lock_;
+ DataAccessor<am::PerformChoiceSetMap> accessor_;
+
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+ app_ = CreateMockApp();
+ }
+
+ DeleteInteractionChoiceSetRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+class DeleteInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetResponse>(message_);
+ app_ = CreateMockApp();
+ }
+ DeleteInteractionChoiceSetResponsePtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, FindChoiceSet(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_ChoiceSetInUse_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+
+ choice_set_map_[0].insert(
+ std::make_pair(kChoiceSetId,
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id])));
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(true));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map())
+ .WillOnce(Return(accessor_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest,
+ Run_SendVrDeleteCommand_PerformInteractionFalse_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ smart_objects::SmartObject* invalid_choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ {
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+ }
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ {
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*app_, app_id())
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::success] = false;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_ValidResultCode_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(true), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest,
+ Run_InvalidResultCode_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+} // namespace delete_interaction_choice_set
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
new file mode 100644
index 0000000000..f1c44f86ac
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "mobile/delete_sub_menu_request.h"
+#include "mobile/delete_sub_menu_response.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_sub_menu_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+namespace am_test = application_manager_test;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockHmiInterfaces;
+using am::MockMessageHelper;
+
+using sdl_rpc_plugin::commands::DeleteSubMenuRequest;
+using sdl_rpc_plugin::commands::DeleteSubMenuResponse;
+
+typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
+typedef std::shared_ptr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+MATCHER_P(CheckMessageConnectionKey, connection_key, "") {
+ return (*arg)[am::strings::msg_params][am::strings::connection_key].asInt() ==
+ connection_key;
+}
+
+ACTION_P(DeleteCommand, commands_map) {
+ am::CommandsMap::iterator it = (*commands_map).begin();
+ if ((*commands_map).end() != it) {
+ (*commands_map).erase(it);
+ }
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kMenuId = 100u;
+const uint32_t kGrammarId = 101u;
+const int32_t kCmdId = 102;
+} // namespace
+
+class DeleteSubMenuRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteSubMenuRequestTest()
+ : commands_lock_(std::make_shared<sync_primitives::Lock>())
+ , accessor_(commands_map_, commands_lock_)
+ , message_(CreateMessage())
+ , command_(CreateCommand<DeleteSubMenuRequest>(message_))
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , app_(CreateMockApp()) {}
+
+ am::CommandsMap commands_map_;
+ mutable std::shared_ptr<sync_primitives::Lock> commands_lock_;
+ DataAccessor<am::CommandsMap> accessor_;
+
+ MessageSharedPtr message_;
+ DeleteSubMenuRequestPtr command_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
+ MockAppPtr app_;
+};
+
+class DeleteSubMenuResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
+
+ std::shared_ptr<DeleteSubMenuRequest> command =
+ CreateCommand<DeleteSubMenuRequest>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ EXPECT_CALL(*mock_app, RemoveSubMenu(_));
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*ev_msg);
+
+ MockHmiInterfaces hmi_interfaces;
+ ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
+ EXPECT_CALL(hmi_interfaces,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ am::CommandsMap commands_map;
+ smart_objects::SmartObject commands_msg(smart_objects::SmartType_Map);
+ commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &commands_msg));
+ DataAccessor<am::CommandsMap> accessor(
+ commands_map, std::make_shared<sync_primitives::Lock>());
+ EXPECT_CALL(*mock_app, commands_map())
+ .WillOnce(Return(accessor))
+ .WillOnce(Return(accessor));
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, FindSubMenu(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* invalid_sub_menu = NULL;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(invalid_sub_menu));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ CheckMessageResultCode(mobile_apis::Result::INVALID_ID),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ EXPECT_CALL(*app_, app_id()).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* sub_menu =
+ &((*message_)[am::strings::msg_params][am::strings::menu_id]);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu)))
+ .WillOnce(Return(true));
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ event.set_smart_object(*message_);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::vr_commands] =
+ "vr_commands";
+ (*message_)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId;
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::params][am::hmi_response::code] = result_code;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+
+ InSequence seq;
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
+ EXPECT_CALL(*app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(kCmdId, false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*app_, RemoveSubMenu(_));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ EXPECT_CALL(*app_, UpdateHash());
+
+ DeleteSubMenuRequestPtr command =
+ CreateCommand<DeleteSubMenuRequest>(message_);
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::connection_key] =
+ kConnectionKey;
+ DeleteSubMenuResponsePtr command(
+ CreateCommand<DeleteSubMenuResponse>(message));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
+ command->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_CommandhaventVrCommadsAndMenuParams_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_NotAChildOfMenupartam_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId + 1;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+ command_->on_event(event);
+}
+
+} // namespace delete_sub_menu_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
new file mode 100644
index 0000000000..5d6c6dc89e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/dial_number_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dial_number_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::DialNumberRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<DialNumberRequest> DialNumberRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class DialNumberRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_InvalidNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "\t\n";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_EmptyNumber_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "NotANumber";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_DialNumber)));
+
+ command->Run();
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::strings::info] = "test_info";
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+ ON_CALL(app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+ command->on_event(event);
+}
+
+} // namespace dial_number_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
new file mode 100644
index 0000000000..8589cbb6be
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/add_command_request.h"
+#include "mobile/add_command_response.h"
+#include "mobile/add_sub_menu_request.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/alert_maneuver_request.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_request.h"
+#include "mobile/alert_response.h"
+#include "mobile/change_registration_request.h"
+#include "mobile/change_registration_response.h"
+#include "mobile/create_interaction_choice_set_request.h"
+#include "mobile/create_interaction_choice_set_response.h"
+#include "mobile/delete_command_request.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+#include "mobile/delete_sub_menu_request.h"
+#include "mobile/delete_sub_menu_response.h"
+#include "mobile/dial_number_request.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_request.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/get_way_points_request.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/list_files_request.h"
+#include "mobile/list_files_response.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_button_event_notification.h"
+#include "mobile/on_button_press_notification.h"
+#include "mobile/on_command_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_hash_change_notification.h"
+#include "mobile/on_hmi_status_notification.h"
+#include "mobile/on_hmi_status_notification_from_mobile.h"
+#include "mobile/on_keyboard_input_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_request_notification.h"
+#include "mobile/on_tbt_client_state_notification.h"
+#include "mobile/on_touch_event_notification.h"
+#include "mobile/on_way_point_change_notification.h"
+#include "mobile/perform_audio_pass_thru_request.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/perform_interaction_request.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/put_file_request.h"
+#include "mobile/put_file_response.h"
+#include "mobile/register_app_interface_request.h"
+#include "mobile/register_app_interface_response.h"
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+#include "mobile/scrollable_message_request.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/send_location_request.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_request.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_request.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/set_global_properties_request.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_request.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_request.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_request.h"
+#include "mobile/show_response.h"
+#include "mobile/slider_request.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_request.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_button_request.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/unregister_app_interface_request.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_request.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_request.h"
+#include "mobile/update_turn_list_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using am::commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestSecond : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestThird : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::AddCommandRequest,
+ commands::AddCommandResponse,
+ commands::AddSubMenuRequest,
+ commands::AddSubMenuResponse,
+ commands::AlertManeuverRequest,
+ commands::AlertManeuverResponse,
+ commands::AlertRequest,
+ commands::AlertResponse,
+ commands::ChangeRegistrationRequest,
+ commands::ChangeRegistrationResponse,
+ commands::CreateInteractionChoiceSetRequest,
+ commands::CreateInteractionChoiceSetResponse,
+ commands::DeleteCommandRequest,
+ commands::DeleteCommandResponse,
+ commands::DeleteFileRequest,
+ commands::DeleteFileResponse,
+ commands::DeleteInteractionChoiceSetRequest,
+ commands::DeleteInteractionChoiceSetResponse,
+ commands::DeleteSubMenuRequest,
+ commands::DeleteSubMenuResponse,
+ commands::DialNumberRequest,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruRequest,
+ commands::EndAudioPassThruResponse,
+ commands::GenericResponse,
+ commands::GetWayPointsRequest,
+ commands::GetWayPointsResponse,
+ commands::ListFilesRequest,
+ commands::ListFilesResponse,
+ commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::mobile::OnButtonEventNotification,
+ commands::mobile::OnButtonPressNotification,
+ commands::OnCommandNotification,
+ commands::mobile::OnDriverDistractionNotification,
+ commands::mobile::OnHashChangeNotification,
+ commands::OnHMIStatusNotification,
+ commands::OnHMIStatusNotificationFromMobile,
+ commands::mobile::OnKeyBoardInputNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification>
+ MobileCommandsListFirst;
+
+typedef Types<commands::OnWayPointChangeNotification,
+ commands::PerformAudioPassThruRequest,
+ commands::PerformAudioPassThruResponse,
+ commands::PerformInteractionRequest,
+ commands::PerformInteractionResponse,
+ commands::PutFileRequest,
+ commands::PutFileResponse,
+ commands::RegisterAppInterfaceRequest,
+ commands::RegisterAppInterfaceResponse,
+ commands::ResetGlobalPropertiesRequest,
+ commands::ResetGlobalPropertiesResponse,
+ commands::ScrollableMessageRequest,
+ commands::ScrollableMessageResponse,
+ commands::SendLocationRequest,
+ commands::SendLocationResponse,
+ commands::SetAppIconRequest,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutRequest,
+ commands::SetDisplayLayoutResponse,
+ commands::SetGlobalPropertiesRequest,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockRequest,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTRequest,
+ commands::ShowConstantTBTResponse,
+ commands::ShowRequest,
+ commands::ShowResponse,
+ commands::SliderRequest,
+ commands::SliderResponse,
+ commands::SpeakRequest,
+ commands::SpeakResponse,
+ commands::SubscribeButtonRequest,
+ commands::SubscribeButtonResponse,
+ commands::SubscribeWayPointsRequest,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::UnregisterAppInterfaceRequest,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
+
+typedef Types<commands::UnsubscribeWayPointsRequest,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListRequest,
+ commands::UpdateTurnListResponse> MobileCommandsListThird;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
+TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
new file mode 100644
index 0000000000..304cf13ffd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "mobile/end_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace end_audio_pass_thru_request {
+
+namespace am = ::application_manager;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::EndAudioPassThruRequest;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
+
+class EndAudioPassThruRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
+ const uint32_t kConnectionKey = 2u;
+ const uint32_t app_id = kConnectionKey;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EndAudioPassThruRequestPtr command(
+ CreateCommand<EndAudioPassThruRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+
+ Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace end_audio_pass_thru_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
new file mode 100644
index 0000000000..09a3336a10
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "mobile/get_way_points_request.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_way_points_request {
+
+using namespace mobile_apis::Result;
+using ::testing::Return;
+using ::testing::_;
+using sdl_rpc_plugin::commands::GetWayPointsRequest;
+using application_manager::MockMessageHelper;
+using application_manager::MockHmiInterfaces;
+
+typedef std::shared_ptr<GetWayPointsRequest> CommandPtr;
+typedef mobile_apis::Result::eType MobileResult;
+typedef hmi_apis::Common_Result::eType HmiResult;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 3u;
+const uint32_t kConnectionKey = kAppId;
+const std::string kMethodName = "Navigation.GetWayPoints";
+}
+
+class GetWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ message_ = std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message_)[am::strings::msg_params] =
+ ::smart_objects::SmartObject(::smart_objects::SmartType_Map);
+
+ command_sptr_ = CreateCommand<GetWayPointsRequest>(message_);
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ }
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ std::shared_ptr<GetWayPointsRequest> command_sptr_;
+};
+
+class GetWayPointsRequestOnEventTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestOnEventTest() : app_(CreateMockApp()) {}
+
+ void CheckOnEventResponse(const std::string& wayPointsParam,
+ const HmiResult ResultCode,
+ const bool success) {
+ Event event(Event::EventID::Navigation_GetWayPoints);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = ResultCode;
+ if ("0" == wayPointsParam) {
+ (*event_msg)[am::strings::msg_params] = 0;
+ } else {
+ (*event_msg)[am::strings::msg_params][am::strings::way_points][0]["123"] =
+ wayPointsParam;
+ }
+
+ event.set_smart_object(*event_msg);
+
+ const MobileResult mobile_result = static_cast<MobileResult>(ResultCode);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(
+ mobile_result,
+ static_cast<MobileResult>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+ EXPECT_EQ(
+ success,
+ (*result_msg)[am::strings::msg_params][am::strings::success].asBool());
+ }
+
+ protected:
+ MockAppPtr app_;
+ MockHmiInterfaces hmi_interfaces_;
+};
+
+TEST_F(GetWayPointsRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(GetWayPointsRequestTest, Run_ApplicationRegistered_Success) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ MockAppPtr application_sptr = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(*application_sptr, app_id()).WillOnce(Return(1));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchHMICommandResult(caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_message)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_GetWayPoints, result_function_id);
+ EXPECT_EQ(kCorrelationId,
+ (*result_message)[am::strings::params][am::strings::correlation_id]
+ .asUInt());
+}
+
+TEST_F(GetWayPointsRequestTest,
+ OnEvent_NavigationGetWayPointsEvent_SendResponse) {
+ am::event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case1) {
+ CheckOnEventResponse("0", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case2) {
+ CheckOnEventResponse("", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) {
+ CheckOnEventResponse("test", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse(" ", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\n", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t\n", HmiResult::GENERIC_ERROR, false);
+}
+
+} // namespace get_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
new file mode 100644
index 0000000000..3fcc4225f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "mobile/list_files_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace list_files_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::ListFilesRequest;
+using am::commands::MessageSharedPtr;
+
+class ListFilesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ListFilesRequestTest() : kStoragePath_("storage"), kResponseSize_(1) {}
+ const std::string kStoragePath_;
+ const uint32_t kResponseSize_;
+};
+
+TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t kListFilesInNoneAllowed = 1u;
+ const uint32_t kListFilesInNoneCount = 2u;
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, list_files_in_none())
+ .WillByDefault(ReturnRef(kListFilesInNoneAllowed));
+ ON_CALL(*app, list_files_in_none_count())
+ .WillByDefault(Return(kListFilesInNoneCount));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ListFilesRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillRepeatedly(ReturnRef(app_mngr_settings_));
+
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStoragePath_));
+
+ ON_CALL(app_mngr_settings_, list_files_response_size())
+ .WillByDefault(ReturnRef(kResponseSize_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*app, increment_list_files_in_none_count()).WillByDefault(Return());
+
+ ON_CALL(*app, GetAvailableDiskSpace()).WillByDefault(Return(0));
+
+ am::AppFilesMap files_map;
+ ON_CALL(*app, getAppFiles()).WillByDefault(ReturnRef(files_map));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+} // namespace list_files_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
new file mode 100644
index 0000000000..a0e41cf728
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "mobile/on_button_event_notification.h"
+#include "mobile/on_button_press_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_button_notification {
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using sdl_rpc_plugin::commands::mobile::OnButtonEventNotification;
+using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification;
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kAppId = 5u;
+const uint32_t kCustomButtonId = 3u;
+const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
+} // namespace
+
+template <class NotificationT,
+ mobile_apis::FunctionID::eType kExpectedFunctionId>
+struct NotificationData {
+ typedef NotificationT Notification;
+ enum { kFunctionId = kExpectedFunctionId };
+};
+
+template <class NotificationDataT>
+class OnButtonNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kNotNice>,
+ public NotificationDataT {};
+
+typedef Types<NotificationData<OnButtonEventNotification,
+ mobile_apis::FunctionID::OnButtonEventID>,
+ NotificationData<OnButtonPressNotification,
+ mobile_apis::FunctionID::OnButtonPressID> >
+ OnButtonNotificationCommandsList;
+
+MATCHER_P(CheckNotificationMessage, function_id, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsFunctionIdCorrect =
+ (*arg)[am::strings::params][am::strings::function_id].asInt() ==
+ function_id;
+
+ bool is_custom_button_id_correct = true;
+ if ((*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::custom_button_id)) {
+ is_custom_button_id_correct =
+ (*arg)[am::strings::msg_params][am::strings::custom_button_id] ==
+ kCustomButtonId;
+ }
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect && kIsFunctionIdCorrect &&
+ is_custom_button_id_correct;
+}
+
+TYPED_TEST_CASE(OnButtonNotificationCommandsTest,
+ OnButtonNotificationCommandsList);
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoAppId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_NoCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotRegistered_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ EXPECT_CALL(this->app_mngr_, application(kAppId))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_CustomButton_AppNotSubscribedToCustomButtonId_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(false));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::CUSTOM_BUTTON;
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params]
+ [am::hmi_response::custom_button_id] = kCustomButtonId;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ ON_CALL(*mock_app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
+ .WillOnce(Return(true));
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(empty_subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest,
+ Run_ButtonOkOnlyForHmiLevelFull_UNSUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+
+ command->Run();
+}
+
+TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::Notification Notification;
+
+ MessageSharedPtr notification_msg(
+ this->CreateMessage(smart_objects::SmartType_Map));
+
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
+ kButtonName;
+
+ std::shared_ptr<Notification> command(
+ this->template CreateCommand<Notification>(notification_msg));
+
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ std::vector<ApplicationSharedPtr> subscribed_apps_list;
+ subscribed_apps_list.push_back(mock_app);
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
+
+ EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
+ .WillOnce(Return(subscribed_apps_list));
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckNotificationMessage(TestFixture::kFunctionId), _));
+
+ command->Run();
+}
+
+} // namespace on_button_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
new file mode 100644
index 0000000000..2fd6f6137d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "mobile/on_command_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_command_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnCommandNotification;
+
+typedef std::shared_ptr<OnCommandNotification> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCommandId = 5u;
+} // namespace
+
+class OnCommandNotificationTest
+ : public CommandsTest<CommandsTestMocks::kNotNice> {};
+
+TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<OnCommandNotification>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnCommandNotificationTest, Run_NoAppsForTheCommand_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(static_cast<SmartObject*>(NULL)));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->Run();
+}
+
+MATCHER(CheckNotificationMessage, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
+ kIsNotificationCorrect;
+}
+
+TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(*mock_app, FindCommand(kCommandId))
+ .WillOnce(Return(dummy_msg.get()));
+ EXPECT_CALL(mock_rpc_service_,
+ SendMessageToMobile(CheckNotificationMessage(), _));
+
+ command->Run();
+}
+
+} // namespace on_command_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
new file mode 100644
index 0000000000..1d6711e36f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/on_hash_change_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hash_change_notification {
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+class OnHashChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string = "1234";
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, curHash()).WillOnce(ReturnRef(return_string));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ ASSERT_EQ(return_string,
+ (*msg)[strings::msg_params][strings::hash_id].asString());
+}
+
+TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
+ const uint32_t kConnectionKey = 1u;
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<OnHashChangeNotification> command =
+ CreateCommand<OnHashChangeNotification>(msg);
+
+ std::string return_string;
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, curHash()).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hash_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
new file mode 100644
index 0000000000..333c204d57
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "mobile/on_hmi_status_notification_from_mobile.h"
+#include "application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification_from_mobile {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile;
+using protocol_handler::MajorProtocolVersion;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnHMIStatusNotificationFromMobileTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnHMIStatusNotificationFromMobileTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+ MessageSharedPtr CreateMsgParams(
+ const mobile_apis::HMILevel::eType kHMIState) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ return msg;
+ }
+ ApplicationSet app_set_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, set_foreground(true)).Times(0);
+
+ EXPECT_CALL(*mock_app, device()).Times(0);
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).Times(0);
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version()).Times(0);
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_CurrentStateNotForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_ProtocolVersionKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(false));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBeforeAndKV3_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ EXPECT_CALL(*mock_app, is_foreground()).Times(0);
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AppNotRequestedBefore_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ EXPECT_CALL(app_mngr_, applications()).Times(0);
+
+ EXPECT_CALL(*mock_app, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendQueryApps(kConnectionKey, _));
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+TEST_F(OnHMIStatusNotificationFromMobileTest,
+ Run_AnotherForegroundSDLApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
+ CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_foreground(true));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(true));
+
+ DataAccessor<ApplicationSet> accessor(app_set_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ EXPECT_CALL(*mock_app, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false));
+ EXPECT_CALL(app_mngr_, SendUpdateAppList());
+
+ command->Run();
+
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+}
+
+} // namespace on_hmi_status_notification_from_mobile
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
new file mode 100644
index 0000000000..ba3b1e8f1d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "mobile/on_hmi_status_notification.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_hmi_status_notification {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+namespace strings = application_manager::strings;
+using sdl_rpc_plugin::commands::OnHMIStatusNotification;
+using protocol_handler::MajorProtocolVersion;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnHMIStatusNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams(
+ const mobile_apis::HMILevel::eType kHMIState) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::hmi_level] = kHMIState;
+ return msg;
+ }
+
+ void SetSendNotificationExpectations(MessageSharedPtr& msg) {
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+ }
+
+ void VerifySendNotificationData(MessageSharedPtr& msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+};
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).Times(0);
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(_)).Times(0);
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey))
+ .Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, set_tts_properties_in_full(true));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, AddAppToTTSGlobalPropertiesList(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
+
+ std::shared_ptr<OnHMIStatusNotification> command =
+ CreateCommand<OnHMIStatusNotification>(msg);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, tts_properties_in_full()).WillOnce(Return(true));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ VerifySendNotificationData(msg);
+}
+
+} // namespace on_hmi_status_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
new file mode 100644
index 0000000000..04f88e2b13
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "mobile/on_keyboard_input_notification.h"
+#include "application_manager/commands/commands_test.h"
+#include <application_manager/smart_object_keys.h>
+#include "application_manager/message.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_keyboard_input_notification {
+
+namespace strings = application_manager::strings;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+} // namespace
+
+using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification;
+using application_manager::MockMessageHelper;
+using application_manager::commands::CommandImpl;
+using application_manager::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::_;
+
+class OnKeyBoardInputNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnKeyBoardInputNotificationTest()
+ : lock_(std::make_shared<sync_primitives::Lock>()) {}
+ void SetSendNotificationExpectations(MessageSharedPtr msg) {
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+ }
+
+ void SetSendNotificationVariables(MessageSharedPtr msg) {
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+ }
+
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
+ MockAppPtr app(CreateMockApp());
+ app_set->insert(app);
+ EXPECT_CALL(app_mngr_, applications())
+ .WillOnce(Return(DataAccessor<ApplicationSet>(*app_set, lock_)));
+ return app;
+ }
+
+ std::shared_ptr<ApplicationSet> app_set_;
+ std::shared_ptr<sync_primitives::Lock> lock_;
+};
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
+ EXPECT_CALL(*mock_app, perform_interaction_layout())
+ .WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
+ EXPECT_CALL(*mock_app, hmi_level()).Times(0);
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
+
+ SetSendNotificationExpectations(msg);
+
+ command->Run();
+
+ SetSendNotificationVariables(msg);
+
+ ASSERT_EQ(kConnectionKey,
+ (*msg)[strings::params][strings::connection_key].asInt());
+}
+
+TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<OnKeyBoardInputNotification> command =
+ CreateCommand<OnKeyBoardInputNotification>(msg);
+
+ MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
+ EXPECT_CALL(*mock_app, is_perform_interaction_active())
+ .WillRepeatedly(Return(0));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace on_keyboard_input_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
new file mode 100644
index 0000000000..4981301e07
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/on_system_request_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_system_request_notification {
+
+namespace strings = application_manager::strings;
+
+using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification;
+using application_manager::commands::CommandImpl;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using namespace mobile_apis;
+using testing::SaveArg;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::_;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kPolicyAppId = "fake-app-id";
+} // namespace
+
+class OnSystemRequestNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnSystemRequestNotificationTest() : mock_app_(CreateMockApp()) {}
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
+ }
+
+ protected:
+ MockAppPtr mock_app_;
+};
+
+TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::PROPRIETARY;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillRepeatedly(Return(true));
+
+#ifdef PROPRIETARY_MODE
+ EXPECT_CALL(mock_policy_handler_, TimeoutExchangeSec()).WillOnce(Return(5u));
+#endif // PROPRIETARY_MODE
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::JSON,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _));
+
+ command->Run();
+
+ ASSERT_EQ(FileType::BINARY,
+ (*msg)[strings::msg_params][strings::file_type].asInt());
+ ASSERT_EQ(application_manager::MessageType::kNotification,
+ (*msg)[strings::params][strings::message_type].asInt());
+ ASSERT_EQ(CommandImpl::mobile_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ ASSERT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app_, policy_app_id()).Times(0);
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _)).Times(0);
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
+ const mobile_apis::RequestType::eType request_type =
+ mobile_apis::RequestType::HTTP;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+
+ std::shared_ptr<OnSystemRequestNotification> command =
+ CreateCommand<OnSystemRequestNotification>(msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId));
+ EXPECT_CALL(mock_policy_handler_, IsRequestTypeAllowed(_, _))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, _)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(
+ OnSystemRequestNotificationTest,
+ Run_RequestTypeAllowedAndRequestSubTypeDisallowed_MessageNotSentToMobile) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ const auto request_type = mobile_apis::RequestType::HTTP;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ auto command = CreateCommand<OnSystemRequestNotification>(msg);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(OnSystemRequestNotificationTest,
+ Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendMessageToMobile) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ const auto request_type = mobile_apis::RequestType::OEM_SPECIFIC;
+ (*msg)[strings::msg_params][strings::request_type] = request_type;
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kPolicyAppId, request_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kPolicyAppId, request_subtype))
+ .WillOnce(Return(true));
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _))
+ .WillOnce((SaveArg<0>(&result)));
+
+ auto command = CreateCommand<OnSystemRequestNotification>(msg);
+
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(application_manager::MessageType::kNotification,
+ (*result)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(request_type,
+ (*result)[strings::msg_params][strings::request_type].asInt());
+ EXPECT_EQ(
+ request_subtype,
+ (*result)[strings::msg_params][strings::request_subtype].asString());
+}
+
+} // namespace on_system_request_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
new file mode 100644
index 0000000000..3d989db478
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/on_tbt_client_state_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_tbt_client_state_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnTBTClientStateNotification;
+
+typedef std::shared_ptr<OnTBTClientStateNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTBTClientStateNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTBTClientStateNotificationTest()
+ : command_(CreateCommand<OnTBTClientStateNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTBTClientStateNotificationTest,
+ Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(*mock_app, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_tbt_client_state_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
new file mode 100644
index 0000000000..f69dd5da2e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/on_touch_event_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_touch_event_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::mobile::OnTouchEventNotification;
+
+typedef std::shared_ptr<OnTouchEventNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnTouchEventNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnTouchEventNotificationTest()
+ : command_(CreateCommand<OnTouchEventNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*mock_app, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0);
+
+ command_->Run();
+}
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ std::vector<ApplicationSharedPtr> applications_with_navi;
+ applications_with_navi.push_back(mock_app);
+
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
+ EXPECT_CALL(app_mngr_, applications_with_navi())
+ .WillOnce(Return(applications_with_navi));
+
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _))
+ .Times(2);
+
+ command_->Run();
+}
+
+} // namespace on_touch_event_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
new file mode 100644
index 0000000000..ed0a9b07d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <set>
+
+#include "gtest/gtest.h"
+#include "mobile/on_way_point_change_notification.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_way_point_change_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::OnWayPointChangeNotification;
+
+typedef std::shared_ptr<OnWayPointChangeNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnWayPointChangeNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnWayPointChangeNotificationTest()
+ : command_(CreateCommand<OnWayPointChangeNotification>()) {}
+
+ NotificationPtr command_;
+};
+
+MATCHER(CheckMessageData, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect);
+}
+
+TEST_F(OnWayPointChangeNotificationTest,
+ Run_NotEmptyListOfAppsSubscribedForWayPoints_SUCCESS) {
+ std::set<uint32_t> apps_subscribed_for_way_points;
+ apps_subscribed_for_way_points.insert(kAppId);
+
+ EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
+ .WillOnce(Return(apps_subscribed_for_way_points));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(CheckMessageData(), _));
+
+ command_->Run();
+}
+
+} // namespace on_way_point_change_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
new file mode 100644
index 0000000000..f51f1aa655
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -0,0 +1,834 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/perform_audio_pass_thru_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_audio_pass_thru_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::PerformAudioPassThruRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::InSequence;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const std::string kCorrectPrompt = "CorrectPrompt";
+const std::string kCorrectType = "CorrectType";
+const std::string kCorrectDisplayText1 = "CorrectDisplayText1";
+const std::string kCorrectDisplayText2 = "CorrectDisplayText2";
+const std::string kFunctionId = "FunctionId";
+const uint32_t kTimeoutForTTSSpeak = 1u;
+} // namespace
+
+class PerformAudioPassThruRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PerformAudioPassThruRequestTest()
+ : mock_app_(CreateMockApp())
+ , message_(std::make_shared<SmartObject>(::smart_objects::SmartType_Map))
+ , msg_params_((*message_)[am::strings::msg_params]) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void TestWrongSyntaxInField(const std::string& field) {
+ if (field == am::strings::initial_prompt) {
+ msg_params_[field][0][am::strings::text] = "prompt\\n";
+ } else {
+ msg_params_[field] = "prompt\\n";
+ }
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::INVALID_DATA, result);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ command_sptr_ = CreateCommand<PerformAudioPassThruRequest>(message_);
+
+ application_sptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(application_sptr_));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ ::smart_objects::SmartObject& msg_params_;
+ std::shared_ptr<PerformAudioPassThruRequest> command_sptr_;
+ MockAppPtr application_sptr_;
+};
+
+TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
+ MessageSharedPtr msg_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*msg_ui)[am::strings::msg_params][am::strings::result_code] =
+ am::mobile_api::Result::GENERIC_ERROR;
+ (*msg_ui)[am::strings::msg_params][am::strings::success] = false;
+
+ MessageSharedPtr message =
+ std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>(message);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg_ui));
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->onTimeOut();
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr mobile_request = CreateFullParamsUISO();
+ (*mobile_request)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject initial_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ initial_prompt[0] = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ initial_prompt[0][am::strings::text] = "tts chunk text";
+ initial_prompt[0][am::strings::type] = 0;
+ (*mobile_request)[am::strings::msg_params][am::strings::initial_prompt] =
+ initial_prompt;
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+ std::shared_ptr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>(mobile_request);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_msg_tts =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_tts)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_msg_tts)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_msg_tts);
+
+ MessageSharedPtr response_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*response_ui)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_ui)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*response_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event_ui.set_smart_object(*response_ui);
+
+ MessageSharedPtr response_to_mobile;
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles((*mobile_request)[am::strings::msg_params]
+ [am::strings::initial_prompt],
+ _,
+ _)).WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ command->Run();
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::info]
+ .asString(),
+ "UI is not supported by system");
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Run_HmiLevelNone_Rejected) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInInitialPrompt_InvalidData) {
+ TestWrongSyntaxInField(am::strings::initial_prompt);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText1_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text1);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText2_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text2);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_TTSSpeakIsAbsent) {
+ // First we need to call SendSpeakRequest()
+ // to enable the "is_active_tts_speak" key
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ // Send speak request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun run_caller(*command_sptr_);
+ run_caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+
+ // Now we recieve on_event()
+
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ event.set_smart_object(*message_);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ CallOnEvent on_event_caller(*command_sptr_, event);
+ MessageSharedPtr command_result = CatchHMICommandResult(on_event_caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*command_result)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::TTS_StopSpeaking, result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteTrue) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+ msg_params_[am::strings::audio_pass_display_text1] = kCorrectDisplayText1;
+ msg_params_[am::strings::audio_pass_display_text2] = kCorrectDisplayText2;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+ const ::smart_objects::SmartObject& perform_msg_params =
+ (*perform_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+ const std::string result_display_text_1 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][0]
+ [am::hmi_request::field_text].asString();
+ const std::string result_display_text_2 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][1]
+ [am::hmi_request::field_text].asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+ EXPECT_EQ(kCorrectDisplayText1, result_display_text_1);
+ EXPECT_EQ(kCorrectDisplayText2, result_display_text_2);
+
+ EXPECT_EQ(true, perform_msg_params[am::strings::mute_audio].asBool());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteFalse) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ const bool muted = false;
+
+ msg_params_[am::strings::mute_audio] = muted;
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ EXPECT_EQ(
+ muted,
+ (*perform_result_msg)[am::strings::msg_params][am::strings::mute_audio]
+ .asBool());
+}
+
+TEST_F(
+ PerformAudioPassThruRequestTest,
+ Run_InitPromptEmpty_PerformAndRecordStartNotificationsAndStartRecording) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ MessageSharedPtr start_record_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Perform audio path thru request sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Start recording notification sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true)));
+ }
+
+ // Start microphone recording cals
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const hmi_apis::FunctionID::eType start_record_result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*start_record_result_msg)[am::strings::params]
+ [am::strings::function_id].asInt());
+ EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart,
+ start_record_result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_UIPAPT_Rejected) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result_code =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result_code);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_TTSSpeakSuccess_UpdateRequestTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ // Start recording notification sending
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ // Start microphone recording cals
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id));
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_PAPTunsupportedResource_CorrectInfo) {
+ const std::string return_info = "Unsupported phoneme type sent in a prompt";
+
+ am::event_engine::Event event_speak(hmi_apis::FunctionID::TTS_Speak);
+ am::event_engine::Event event_perform(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ event_speak.set_smart_object(*message_);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event_perform.set_smart_object(*message_);
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ CallOnEvent caller_speak(*command_sptr_, event_speak);
+ caller_speak();
+
+ // Second call for test correct behavior of UI_PerformAudioPassThru event
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0);
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller_perform(*command_sptr_, event_perform);
+
+ MessageSharedPtr perform_event_result =
+ CatchMobileCommandResult(caller_perform);
+
+ EXPECT_EQ(return_info,
+ (*perform_event_result)[am::strings::msg_params][am::strings::info]
+ .asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSSpeak_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+ msg_params_[am::strings::correlation_id] = kCorrelationId;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) {
+ const uint32_t kDefaultTimeout = command_sptr_->default_timeout();
+ const uint32_t kMaxDuration = 10000u;
+
+ msg_params_[am::strings::max_duration] = kMaxDuration;
+
+ command_sptr_->Init();
+
+ EXPECT_EQ(kDefaultTimeout + kMaxDuration, command_sptr_->default_timeout());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) {
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ // For setting current_state_ -> kCompleted
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ command_sptr_->onTimeOut();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) {
+ uint32_t app_id = kConnectionKey;
+ EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ EXPECT_CALL(mock_message_helper_,
+ VerifyTtsFiles(msg_params_[am::strings::initial_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg));
+
+ // For setting is_active_tts_speak -> true
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .Times(2)
+ .WillRepeatedly(Return(false));
+ CallRun caller(*command_sptr_);
+ caller();
+
+ // For setting current_state_ -> kCompleted
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL));
+ command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(false));
+
+ command_sptr_->onTimeOut();
+}
+
+} // namespace perform_audio_pass_thru_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
new file mode 100644
index 0000000000..3b68d3ea72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/perform_interaction_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace perform_interaction_request {
+
+namespace am = application_manager;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using sdl_rpc_plugin::commands::PerformInteractionRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class PerformInteractionRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PerformInteractionRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+};
+
+TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ static_cast<uint64_t>(hmi_apis::Common_Result::SUCCESS);
+ (*response_msg_vr)[strings::msg_params][strings::info] = "info";
+ MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*request_msg)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::BOTH;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(request_msg);
+ MockAppPtr mock_app;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*response_msg_vr);
+
+ command->Init();
+ command->on_event(event);
+ MessageSharedPtr response_to_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_to_mobile)[strings::msg_params][strings::result_code] =
+ static_cast<uint64_t>(am::mobile_api::Result::GENERIC_ERROR);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(response_to_mobile));
+
+ MessageSharedPtr vr_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+ command->onTimeOut();
+
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*vr_command_result)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+ command->Init();
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_vr)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_vr)[am::strings::msg_params][am::strings::info] =
+ "VR is not supported by system";
+
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "VR is not supported by system");
+}
+
+TEST_F(PerformInteractionRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_from_mobile =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
+ mobile_apis::InteractionMode::VR_ONLY;
+ std::shared_ptr<PerformInteractionRequest> command =
+ CreateCommand<PerformInteractionRequest>(msg_from_mobile);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ MessageSharedPtr response_msg_vr =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ am::event_engine::Event event_vr(hmi_apis::FunctionID::VR_PerformInteraction);
+ event_vr.set_smart_object(*response_msg_vr);
+
+ MessageSharedPtr response_msg_ui =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*response_msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_msg_ui)[strings::msg_params][strings::cmd_id] = kCommandId;
+ (*response_msg_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
+ event_ui.set_smart_object(*response_msg_ui);
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_vr);
+
+ EXPECT_CALL(*mock_app_, is_perform_interaction_active())
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, DeletePerformInteractionChoiceSet(_));
+
+ command->on_event(event_ui);
+
+ ResultCommandExpectations(response_to_mobile,
+ "UI is not supported by system");
+}
+
+} // namespace perform_interaction_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
new file mode 100644
index 0000000000..df4f69f0d0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+
+#include "mobile/put_file_response.h"
+#include "mobile/put_file_request.h"
+
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace put_file {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::PutFileRequest;
+using sdl_rpc_plugin::commands::PutFileResponse;
+using am::commands::MessageSharedPtr;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr;
+typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kFileName = "sync_file_name.txt";
+const int64_t kOffset = 10u;
+const int64_t kZeroOffset = 0u;
+const std::string kStorageFolder = "./storage";
+const std::string kFolder = "folder";
+const std::string kAppFolder = "app_folder";
+}
+
+class PutFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ binary_data_.push_back(1u);
+
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::sync_file_name] = kFileName;
+ (*msg_)[am::strings::msg_params][am::strings::persistent_file] = true;
+ (*msg_)[am::strings::msg_params][am::strings::file_type] =
+ mobile_apis::FileType::JSON;
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ }
+
+ void ExpectReceiveMessageFromSDK() {
+ EXPECT_CALL(mock_policy_handler_,
+ ReceiveMessageFromSDK(kFileName, binary_data_))
+ .WillOnce(Return(false));
+ }
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ std::vector<uint8_t> binary_data_;
+};
+
+class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileResponceTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<PutFileResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ std::shared_ptr<PutFileResponse> command_sptr_;
+};
+
+TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(
+ MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ message_ref[am::strings::msg_params][am::strings::success] = true;
+
+ std::shared_ptr<am::Application> application_sptr =
+ std::make_shared<MockApplication>();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t settings_put_file_in_none = 1u;
+ const uint32_t app_put_file_in_none_count = 2u;
+ EXPECT_CALL(app_mngr_settings_, put_file_in_none())
+ .WillOnce(ReturnRef(settings_put_file_in_none));
+ EXPECT_CALL(*mock_app_, put_file_in_none_count())
+ .WillOnce(Return(app_put_file_in_none_count));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::params].erase(am::strings::binary_data);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SyncFileNameDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::sync_file_name);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_FileTypeDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::file_type);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataGreaterThanAvaliableSpace_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 0u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::OUT_OF_MEMORY);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidCreationDirectory_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+
+ const std::string storage_folder = "/storage";
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(storage_folder));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::GENERIC_ERROR);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidUpdateFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, UpdateFile(_)).WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_AddFile_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(true));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile)))
+ .WillOnce(Return(true));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_CrcSumEqual_SendSuccessResponse) {
+ binary_data_ = {1u};
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+ const uint32_t correct_crc_sum =
+ 2768625435u; // calculated using the GetCrc32CheckSum method
+ (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] =
+ correct_crc_sum;
+
+ ExpectReceiveMessageFromSDK();
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStorageFolder));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder));
+ const size_t available_space = binary_data_.size() + 1;
+ ON_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillByDefault(Return(available_space));
+ ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true));
+
+ const std::string file_path = kStorageFolder + "/" + kFolder;
+ EXPECT_CALL(app_mngr_, SaveBinary(binary_data_, file_path, kFileName, 0u))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, increment_put_file_in_none_count());
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // The folder was created in the "Run" method
+ EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(PutFileRequestTest, Run_CrcSumUnequal_SendCorruptedDataResponse) {
+ binary_data_ = {1u};
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+ const uint32_t incorrect_crc_sum = 0u;
+ (*msg_)[am::strings::msg_params][am::strings::crc32_check_sum] =
+ incorrect_crc_sum;
+
+ ExpectReceiveMessageFromSDK();
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStorageFolder));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kFolder));
+ const size_t available_space = binary_data_.size() + 1;
+ ON_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillByDefault(Return(available_space));
+ ON_CALL(*mock_app_, AddFile(_)).WillByDefault(Return(true));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::CORRUPTED_DATA);
+ EXPECT_CALL(app_mngr_, SaveBinary(_, _, _, _)).Times(0);
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+ // The folder was created in the "Run" method
+ EXPECT_TRUE(file_system::RemoveDirectory(kStorageFolder, true));
+}
+
+} // namespace put_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
new file mode 100644
index 0000000000..7dab16fe35
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
@@ -0,0 +1,536 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "mobile/register_app_interface_request.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "utils/data_accessor.h"
+#include "utils/custom_string.h"
+#include "utils/lock.h"
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace register_app_interface_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+
+namespace am = ::application_manager;
+
+using am::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const hmi_apis::Common_Language::eType kHmiLanguage =
+ hmi_apis::Common_Language::EN_US;
+const mobile_apis::Language::eType kMobileLanguage =
+ mobile_apis::Language::EN_US;
+const std::string kMacAddress = "test_mac_address";
+const std::string kAppId = "test_app_id";
+const std::string kFullAppId = "test_app_id_long";
+const std::string kDummyString = "test_string";
+const std::vector<uint32_t> kDummyDiagModes;
+const utils::SemanticVersion mock_semantic_version(1, 0, 0);
+} // namespace
+
+class RegisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RegisterAppInterfaceRequestTest()
+ : msg_(CreateMessage())
+ , command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
+ , app_name_("test_app_name_")
+ , lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_application_helper_(
+ application_manager_test::MockApplicationHelper::
+ application_helper_mock()) {
+ InitGetters();
+ InitLanguage();
+ }
+
+ void SetUp() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
+ void InitBasicMessage() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::full_app_id] = kFullAppId;
+ (*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
+ (*msg_)[am::strings::msg_params][am::strings::language_desired] =
+ kHmiLanguage;
+ (*msg_)[am::strings::msg_params]
+ [am::strings::hmi_display_language_desired] = kHmiLanguage;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::major_version] = 4;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::minor_version] = 0;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::patch_version] = 0;
+ }
+
+ MockAppPtr CreateBasicMockedApp() {
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(*mock_app, name()).WillByDefault(ReturnRef(app_name_));
+ ON_CALL(*mock_app, mac_address()).WillByDefault(ReturnRef(kMacAddress));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+ return mock_app;
+ }
+
+ void InitLanguage(
+ hmi_apis::Common_Language::eType ui_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType vr_language = kHmiLanguage,
+ hmi_apis::Common_Language::eType tts_language = kHmiLanguage) {
+ ON_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillByDefault(Return(vr_language));
+ ON_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillByDefault(Return(ui_language));
+ ON_CALL(mock_hmi_capabilities_, active_tts_language())
+ .WillByDefault(Return(tts_language));
+ }
+
+ void InitGetters() {
+ ON_CALL(app_mngr_, GetCorrectMobileIDFromMessage(msg_))
+ .WillByDefault(Return(kAppId));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
+ ON_CALL(app_mngr_, resume_controller())
+ .WillByDefault(ReturnRef(mock_resume_crt_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ ON_CALL(app_mngr_settings_, sdl_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(mock_hmi_capabilities_, ccpu_version())
+ .WillByDefault(ReturnRef(kDummyString));
+ ON_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillByDefault(ReturnRef(kDummyDiagModes));
+ ON_CALL(mock_policy_handler_, GetAppRequestTypes(_))
+ .WillByDefault(Return(std::vector<std::string>()));
+ ON_CALL(mock_policy_handler_, GetAppRequestTypeState(_))
+ .WillByDefault(Return(policy::RequestType::State::EMPTY));
+ ON_CALL(mock_policy_handler_, GetAppRequestSubTypes(_))
+ .WillByDefault(Return(std::vector<std::string>()));
+ ON_CALL(mock_policy_handler_, GetAppRequestSubTypeState(_))
+ .WillByDefault(Return(policy::RequestSubType::State::EMPTY));
+ ON_CALL(mock_policy_handler_, GetUserConsentForDevice(_))
+ .WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
+ ON_CALL(app_mngr_, GetDeviceTransportType(_))
+ .WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
+ ON_CALL(app_mngr_, IsAppInReconnectMode(_)).WillByDefault(Return(false));
+ ON_CALL(app_mngr_, application_by_policy_id(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ }
+
+ void SetCommonExpectionsOnSwitchedApplication(
+ MockAppPtr mock_app, mobile_apis::Result::eType response_result_code) {
+ EXPECT_CALL(mock_policy_handler_, AddApplication(_, _)).Times(0);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(response_result_code), _));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ OnApplicationSwitched(
+ std::static_pointer_cast<application_manager::Application>(
+ mock_app)));
+ }
+
+ MessageSharedPtr msg_;
+ std::shared_ptr<RegisterAppInterfaceRequest> command_;
+
+ const utils::custom_string::CustomString app_name_;
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ am::ApplicationSet app_set_;
+
+ typedef IsNiceMock<policy_test::MockPolicyHandlerInterface,
+ kMocksAreNice>::Result MockPolicyHandlerInterface;
+
+ typedef IsNiceMock<resumprion_test::MockResumeCtrl, kMocksAreNice>::Result
+ MockResumeCtrl;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ typedef IsNiceMock<application_manager_test::MockHMICapabilities,
+ kMocksAreNice>::Result MockHMICapabilities;
+
+ MockResumeCtrl mock_resume_crt_;
+ MockConnectionHandler mock_connection_handler_;
+ MockSessionObserver mock_session_observer_;
+ application_manager_test::MockApplicationHelper& mock_application_helper_;
+};
+
+TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
+ EXPECT_TRUE(command_->Init());
+}
+
+TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
+ InitBasicMessage();
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ std::make_shared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+ command_->Run();
+}
+
+MATCHER_P(CheckHMIInterfacesRealtedData, expected_data, "") {
+ const bool is_result_id_correct =
+ mobile_apis::Result::SUCCESS ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ const bool are_ui_related_data_exist =
+ (*arg)[am::strings::msg_params].keyExists(
+ am::hmi_response::display_capabilities);
+
+ const bool are_vi_related_data_exist =
+ (*arg)[am::strings::msg_params][am::hmi_response::vehicle_type] ==
+ (*expected_data)[am::hmi_response::vehicle_type];
+
+ const bool are_vr_related_data_exist =
+ (*arg)[am::strings::msg_params][am::strings::vr_capabilities] ==
+ (*expected_data)[am::strings::vr_capabilities];
+
+ return is_result_id_correct && are_ui_related_data_exist &&
+ are_vi_related_data_exist && are_vr_related_data_exist;
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ Run_HmiInterfacesStateAvailable_SUCCESS) {
+ InitBasicMessage();
+
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr expected_message =
+ CreateMessage(smart_objects::SmartType_Map);
+
+ (*expected_message)[am::hmi_response::vehicle_type] = "test_vehicle_type";
+ (*expected_message)[am::strings::vr_capabilities] = "test_vr_capabilities";
+ (*expected_message)[am::hmi_response::display_capabilities] = 0;
+ SmartObject& display_capabilities =
+ (*expected_message)[am::hmi_response::display_capabilities];
+ display_capabilities[am::hmi_response::display_type] = "test_display_type";
+ display_capabilities[am::hmi_response::display_name] = "GENERIC_DISPLAY";
+ display_capabilities[am::hmi_response::text_fields] = "test_text_fields";
+ display_capabilities[am::hmi_response::image_fields] = "test_image_fields";
+ display_capabilities[am::hmi_response::media_clock_formats] =
+ "test_media_clock_ptr_formats";
+ display_capabilities[am::hmi_response::num_custom_presets_available] =
+ "test_num_custom_presets_available";
+ display_capabilities[am::hmi_response::graphic_supported] =
+ "test_graphic_supported";
+ display_capabilities[am::hmi_response::templates_available] =
+ "test_templates_available";
+ display_capabilities[am::hmi_response::screen_params] = "test_screen_params";
+
+ ON_CALL(mock_hmi_capabilities_, vehicle_type())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::vehicle_type]));
+ ON_CALL(mock_hmi_capabilities_, vr_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::strings::vr_capabilities]));
+ ON_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillByDefault(
+ Return(&(*expected_message)[am::hmi_response::display_capabilities]));
+
+ ON_CALL(app_mngr_, applications())
+ .WillByDefault(
+ Return(DataAccessor<am::ApplicationSet>(app_set_, lock_ptr_)));
+ ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
+ .WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ std::make_shared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_CorrectHash_ExpectNoCleanupSuccess) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(
+ mock_resume_crt_,
+ CheckApplicationHash(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ request_hash_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
+
+ EXPECT_CALL(mock_application_helper_, RecallApplicationData(_, _)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::SUCCESS);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_WrongHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(
+ mock_resume_crt_,
+ CheckApplicationHash(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ request_hash_id)).WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_NoHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ std::static_pointer_cast<application_manager::Application>(mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
+
+ command_->Run();
+}
+
+} // namespace register_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
new file mode 100644
index 0000000000..0e3cd685fa
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
@@ -0,0 +1,575 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace reset_global_properties {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest;
+using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef std::shared_ptr<ResetGlobalPropertiesRequest>
+ ResetGlobalPropertiesRequestPtr;
+typedef std::shared_ptr<ResetGlobalPropertiesResponse>
+ ResetGlobalPropertiesResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+} // namespace
+
+class ResetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ ResetGlobalPropertiesRequestTest()
+ : msg_(CreateMessage()), mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ command_ = CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ ResetGlobalPropertiesRequestPtr command_;
+};
+
+class ResetGlobalPropertiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ command_->Run();
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help; // = NULL;
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::hmi_request::menu_title] = "";
+
+ EXPECT_CALL(*mock_app_,
+ set_menu_title(msg_params[am::hmi_request::menu_title]));
+
+ const smart_objects::SmartObjectSPtr so_help_prompt =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get()));
+ EXPECT_CALL(*mock_app_, timeout_prompt())
+ .WillOnce(Return(so_help_prompt.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_UI_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg_)[am::strings::params][am::hmi_response::code] = result_code;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_TTS_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ ui_event.set_smart_object(*ui_msg);
+
+ command_->Run();
+ command_->on_event(ui_event);
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS),
+ am::commands::Command::SOURCE_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ ResetGlobalPropertiesResponsePtr command(
+ CreateCommand<ResetGlobalPropertiesResponse>(message));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _));
+ command->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ smart_objects::SmartObjectSPtr vr_help =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitTTS_Timeout_GENERIC_ERROR_TTSNotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+
+ // Received response only from UI
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*ui_msg)[am::strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ ui_event.set_smart_object(*ui_msg);
+ command->on_event(ui_event);
+
+ // TTS doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+ const std::string info = "TTS component does not respond";
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUI_Timeout_GENERIC_ERROR_UINotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ // Received response only from TTS
+ MessageSharedPtr tts_msg = CreateMessage();
+ (*tts_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*tts_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ Event tts_event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ tts_event.set_smart_object(*tts_msg);
+ command_->on_event(tts_event);
+
+ // UI doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+
+ const std::string info = "UI component does not respond";
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command_->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUIAndTTS_Timeout_GENERIC_ERROR_TTSAndUINotRespond) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ std::make_shared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+ // TTS and UI don't respond, so timeout should send generic error
+ std::string info = "TTS, UI component does not respond";
+ smart_objects::SmartObjectSPtr response =
+ std::make_shared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::SOURCE_SDL));
+ command_->onTimeOut();
+}
+
+} // namespace reset_global_properties
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
new file mode 100644
index 0000000000..cf25a82972
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/scrollable_message_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace scrollable_message_request {
+
+namespace am = application_manager;
+namespace hmi_response = am::hmi_response;
+namespace mobile_result = mobile_apis::Result;
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::ScrollableMessageRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Eq;
+using ::testing::Ref;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using namespace am::strings;
+using test::components::policy_test::MockPolicyHandlerInterface;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kTimeOut = 30000u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kFunctionID = 3u;
+} // namespace
+
+class ScrollableMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ command_ = CreateCommand<ScrollableMessageRequest>(msg_);
+ }
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ std::shared_ptr<ScrollableMessageRequest> command_;
+};
+
+typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<ScrollableMessageRequest> command =
+ CreateCommand<ScrollableMessageRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) {
+ (*msg_)[msg_params][timeout] = kTimeOut;
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) {
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ command_->Run();
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ Run_SoftButtonProcessingResultWrogParameters_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ const mobile_apis::Result::eType processing_result =
+ mobile_apis::Result::ABORTED;
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(processing_result));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command_)));
+ EXPECT_EQ(processing_result,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][result_code].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_SoftButtonProcessingResult_SUCCESS) {
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionID;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::soft_button_id] = 0;
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ EXPECT_EQ(hmi_apis::FunctionID::UI_ScrollableMessage,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[params][function_id].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[params][correlation_id] = kCorrelationId;
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_));
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) {
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_UnsupportedRCAndUICoop_SUCCESS) {
+ (*msg_)[params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+} // namespace scrollable_message_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
new file mode 100644
index 0000000000..6c7127e48c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+
+#include "mobile/send_haptic_data_request.h"
+#include "mobile/send_haptic_data_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_haptic_data {
+
+using ::testing::_;
+using ::testing::Return;
+
+namespace am = ::application_manager;
+
+using sdl_rpc_plugin::commands::SendHapticDataRequest;
+using sdl_rpc_plugin::commands::SendHapticDataResponse;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr;
+typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+}
+
+class SendHapticDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+};
+
+class SendHapticDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataResponseTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<SendHapticDataResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ std::shared_ptr<SendHapticDataResponse> command_sptr_;
+};
+
+TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
+ .WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, Run_DISALLOWED) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::SOURCE_SDL));
+
+ (*msg_)[am::strings::msg_params] = 0;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*msg_);
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(SendHapticDataResponseTest, Run_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+ message_ref[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Init();
+ command_sptr_->Run();
+}
+
+} // namespace send_haptic_data
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
new file mode 100644
index 0000000000..4f44293fc9
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/send_location_request.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+
+#include "application_manager/commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_location_request {
+
+using application_manager::commands::MessageSharedPtr;
+using sdl_rpc_plugin::commands::SendLocationRequest;
+using application_manager::MockMessageHelper;
+using test::components::application_manager_test::MockHMICapabilities;
+using smart_objects::SmartObject;
+
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+namespace Common_TextFieldName = hmi_apis::Common_TextFieldName;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kFunctionID = 2u;
+const uint32_t kAppID = 3u;
+const double kLongitudeDegrees = 13.4;
+const std::string kLocationDescription = "Location_Description";
+const std::string kNewLine = "\\n";
+const std::string kAddressLine = "Address_Line";
+const std::string kPhoneNumber = "Phone_number";
+const std::string kCorrectAddress = "Correct address";
+const std::string kEmptyAddress = "";
+const std::string kAddressWithWrongSyntax = "Wrong Syntax\\n";
+} // namespace
+
+class SendLocationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ class UnwrappedSendLocationRequest : public SendLocationRequest {
+ public:
+ UnwrappedSendLocationRequest(
+ const MessageSharedPtr& message,
+ application_manager::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : SendLocationRequest(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+ ::application_manager::CommandParametersPermissions&
+ get_parameters_permissions() {
+ return parameters_permissions_;
+ }
+ };
+
+ typedef std::shared_ptr<UnwrappedSendLocationRequest> CommandSPrt;
+
+ SendLocationRequestTest() {
+ mock_app_ = CreateMockApp();
+ disp_cap_ = std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ message_ = CreateMessage();
+ command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
+ }
+
+ void InitialSetup(MessageSharedPtr message_) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ AllowMandatoryFields();
+ }
+
+ void HMICapabilitiesSetupHelper() {
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+ }
+
+ void HMICapabilitiesSetupWithArguments(
+ Common_TextFieldName::eType field_name) {
+ HMICapabilitiesSetupHelper();
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] = field_name;
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .Times(2)
+ .WillRepeatedly(Return(disp_cap_.get()));
+ }
+
+ void FinishSetup() {
+ EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_SendLocation)));
+ }
+
+ void FinishSetupCancelled(mobile_apis::Result::eType result) {
+ EXPECT_CALL(*mock_app_, hmi_app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(result), _));
+ }
+
+ void AllowMandatoryFields() {
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ permissions.allowed_params.insert(strings::latitude_degrees);
+ }
+
+ MockAppPtr mock_app_;
+ std::shared_ptr<SmartObject> disp_cap_;
+ MessageSharedPtr message_;
+ CommandSPrt command_;
+};
+
+TEST_F(SendLocationRequestTest, Run_InvalidApp_Success) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ FinishSetupCancelled(mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_DeliveryMode_Success) {
+ InitialSetup(message_);
+ SmartObject msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::delivery_mode] = SmartObject();
+ (*message_)[strings::msg_params] = msg_params;
+ msg_params.erase(strings::delivery_mode);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name\\n";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] =
+ kAddressLine + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] =
+ kPhoneNumber + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressesContainWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address]["Address 1"] =
+ kCorrectAddress;
+ (*message_)[strings::msg_params][strings::address]["Address 2"] =
+ kAddressWithWrongSyntax;
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Warnings) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "notavailable";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_HMIUINotCoop_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] =
+ Common_TextFieldName::phoneNumber;
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(false));
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Success) {
+ mobile_apis::Result::eType response_code = mobile_apis::Result::SUCCESS;
+ (*message_)[strings::params][hmi_response::code] = response_code;
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(false));
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Cancelled) {
+ (*message_)[strings::params][hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_OnWayPointChange);
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, Run_MandatoryParamsDisallowed_InvalidData) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ (*message_)[strings::msg_params][strings::longitude_degrees] =
+ kLongitudeDegrees;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ // 1st one allowed
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ // 2nd one disallowed
+ permissions.disallowed_params.insert(strings::latitude_degrees);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ command_->Run();
+}
+
+} // namespace send_location_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
new file mode 100644
index 0000000000..d8d1faca47
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/set_app_icon_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol_handler/mock_protocol_handler_settings.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_app_icon_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SetAppIconRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::MockHmiInterfaces;
+using test::components::protocol_handler_test::MockProtocolHandler;
+using test::components::protocol_handler_test::MockProtocolHandlerSettings;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class SetAppIconRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+ NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ protocol_handler_test::MockProtocolHandler mock_protocol_handler_;
+ protocol_handler_test::MockProtocolHandlerSettings
+ mock_protocol_handler_settings_;
+};
+
+TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ const std::string file_path = "file_path";
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_vr)[am::strings::msg_params][am::strings::sync_file_name]
+ [am::strings::value] = file_path;
+
+ const std::string dir_path = "./";
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(dir_path));
+
+ std::shared_ptr<SetAppIconRequest> req_vr =
+ CreateCommand<SetAppIconRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(hmi_interfaces_));
+ ON_CALL(hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(app_mngr_, protocol_handler())
+ .WillByDefault(ReturnRef(mock_protocol_handler_));
+ ON_CALL(mock_protocol_handler_, get_settings())
+ .WillByDefault(ReturnRef(mock_protocol_handler_settings_));
+
+ ON_CALL(mock_protocol_handler_settings_, max_supported_protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true));
+ ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info1";
+
+ Event event(hmi_apis::FunctionID::UI_SetAppIcon);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ req_vr->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+} // namespace set_app_icon_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
new file mode 100644
index 0000000000..cd6af1512d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/set_display_layout_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_display_layout_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+using sdl_rpc_plugin::commands::SetDisplayLayoutRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<SetDisplayLayoutRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationKey = 2u;
+const std::string kLayout = "media";
+} // namespace
+
+MATCHER_P(CheckMshCorrId, corr_id, "") {
+ return (*arg)[am::strings::params][am::strings::correlation_id].asUInt() ==
+ corr_id;
+}
+
+class SetDisplayLayoutRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetDisplayLayoutRequestTest() : mock_app_(CreateMockApp()) {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ sync_primitives::Lock lock_;
+ MockAppPtr mock_app_;
+};
+
+typedef SetDisplayLayoutRequestTest::MockHMICapabilities MockHMICapabilities;
+
+TEST_F(SetDisplayLayoutRequestTest,
+ OnEvent_UIHmiUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SetDisplayLayoutRequest> command =
+ CreateCommand<SetDisplayLayoutRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*msg);
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_mock_app));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, display_layout()).WillOnce(ReturnRef(kLayout));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationKey));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetDisplayLayout))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(CheckMshCorrId(kCorrelationKey)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ SmartObject msg(smart_objects::SmartType_Map);
+
+ event.set_smart_object(msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ MessageSharedPtr msg = CreateMessage();
+
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0;
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr dispaly_capabilities_msg = CreateMessage();
+ (*dispaly_capabilities_msg)[am::hmi_response::templates_available] =
+ "templates_available";
+
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .WillOnce(Return(dispaly_capabilities_msg.get()));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ command->on_event(event);
+}
+
+} // namespace set_display_layout_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
new file mode 100644
index 0000000000..03aa5d85a1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
@@ -0,0 +1,1375 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/set_global_properties_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_global_properties_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using am::CommandsMap;
+using utils::custom_string::CustomString;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 1u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+} // namespace
+
+class SetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetGlobalPropertiesRequestTest()
+ : lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_app_(CreateMockApp()) {
+ mock_help_prompt_manager_ =
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>(
+ new application_manager_test::MockHelpPromptManager());
+ }
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ msg_params[am::strings::vr_help_title] = "vr_help_title";
+ msg_params[am::strings::vr_help][0][am::strings::text] = "vr_help";
+ msg_params[am::strings::vr_help][0][am::strings::position] = 1u;
+ msg_params[am::strings::help_prompt][0][am::strings::text] = "help_promt";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ }
+
+ void OnEventUISetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ EXPECT_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ command->Run();
+ }
+
+ void OnEventTTSSetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] =
+ timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ command->Run();
+ }
+
+ void EmptyExpectationsSetupHelper() {
+ EXPECT_CALL(*mock_app_, set_vr_help_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_vr_help(_)).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help_title()).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help()).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ }
+
+ void ExpectInvalidData() {
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
+ am::commands::Command::SOURCE_SDL));
+ }
+
+ void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageVrHelpUnsuccess() {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ void ExpectationsHmiInterface_Run() {
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ }
+ std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ MockAppPtr mock_app_;
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>
+ mock_help_prompt_manager_;
+};
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
+ "vr_command";
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(msg_vr);
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ const smart_objects::SmartObject* vr_help_title =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help_title]);
+ const smart_objects::SmartObject* vr_help =
+ &((*msg_vr)[am::strings::msg_params][am::strings::vr_help]);
+ const smart_objects::SmartObject* vr_help_prompt =
+ &((*msg_vr)[am::strings::msg_params][am::strings::help_prompt]);
+ ON_CALL(*mock_app_, vr_help_title()).WillByDefault(Return(vr_help_title));
+ ON_CALL(*mock_app_, vr_help()).WillByDefault(Return(vr_help));
+ ON_CALL(*mock_app_, help_prompt()).WillByDefault(Return(vr_help_prompt));
+
+ ExpectationsHmiInterface_Run();
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ ON_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(
+ (*msg_vr)[am::strings::msg_params][am::strings::vr_help], _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false)).Times(2);
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*msg_vr)[am::strings::msg_params][am::strings::help_prompt], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ (*msg_vr)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event_vr(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event_vr.set_smart_object(*msg_vr);
+
+ command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+ command->on_event(event_vr);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::msg_params][am::strings::info] = "test";
+
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*response);
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_Expect_false) {
+ MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
+ (*response)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*response)[am::strings::msg_params][am::strings::info] = "qwe";
+
+ am::event_engine::Event event_tts(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event_tts.set_smart_object(*response);
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
+ CreateCommand<SetGlobalPropertiesRequest>(response);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true)).Times(2);
+ command->on_event(event_ui);
+ command->on_event(event_tts);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::INVALID_DATA));
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ OnEventUISetupHelper(msg, command);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_VRWithMenuAndKeyboard_Menu_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_VR_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = " 1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EmptyExpectationsSetupHelper();
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EmptyExpectationsSetupHelper();
+
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ SmartObject vr_help_title("wrong syntax string\\n");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ vr_help_array[1] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[1][am::strings::text] = "two";
+ vr_help_array[1][am::strings::position] = 3u;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_));
+ EXPECT_CALL(*mock_app_, app_id());
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ SmartObject vr_synonyms(smart_objects::SmartType_Array);
+ vr_synonyms[0] = vr_help_array;
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, timeout_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_help_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, help_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One\\n";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] =
+ "invalid help prompt text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] =
+ "invalid vr_help text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] = "vr_help";
+ vr_help[0][am::strings::image][am::strings::value] =
+ "invalid value text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_icon(smart_objects::SmartType_Array);
+ menu_icon[am::strings::value] =
+ "invalid menu icon text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_icon] = menu_icon;
+
+ ExpectVerifyImageSuccess(menu_icon);
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_title(smart_objects::SmartType_Array);
+ menu_title = "invalid menu title text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_title] = menu_title;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidLimitedCharacterList_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject limited_character_list(smart_objects::SmartType_Array);
+ limited_character_list[0] =
+ "invalid limited character list text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::limited_character_list] = limited_character_list;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidAutoCompleteText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject auto_complete_text(smart_objects::SmartType_Array);
+ auto_complete_text =
+ "invalid auto completetext with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::auto_complete_text] = auto_complete_text;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+
+ EmptyExpectationsSetupHelper();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ OnEventUISetupHelper(msg, command);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ OnEventUISetupHelper(msg, command);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventUISetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndWarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ const hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::WARNINGS));
+}
+
+} // namespace set_global_properties_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
new file mode 100644
index 0000000000..a69d3d741b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "mobile/set_media_clock_timer_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace set_media_clock_timer_request {
+
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SetMediaClockRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace UpdateMode = mobile_apis::UpdateMode;
+namespace AudioStreamingIndicator = mobile_apis::AudioStreamingIndicator;
+
+typedef std::shared_ptr<SetMediaClockRequest> SetMediaClockRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppID = 2u;
+const uint32_t kHours = 2u;
+const uint32_t kMinutes = 26u;
+const uint32_t kSeconds = 1u;
+} // namespace
+
+class SetMediaClockRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SetMediaClockRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ResultCommandExpectations(MessageSharedPtr msg,
+ const std::string& info) {
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
+ info);
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ return msg;
+ }
+
+ void ExpectationsSetupHelper(bool is_media) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(is_media));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SetMediaClockRequestTest,
+ OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SetMediaClockRequest> command =
+ CreateCommand<SetMediaClockRequest>(msg);
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*ev_msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(false);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app_, is_media_application()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*msg);
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+ command->on_event(event);
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace set_media_clock_timer_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
new file mode 100644
index 0000000000..4725af4671
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
@@ -0,0 +1,974 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory>
+#include <string>
+#include <set>
+
+#include "mobile/show_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace show_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::ShowRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kFunctionID = 3u;
+} // namespace
+
+class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ShowRequestTest() {
+ mock_app_ = CreateMockApp();
+ }
+ sync_primitives::Lock lock_;
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ void TestSetupHelper(MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params.erase(field);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] =
+ text_field_;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ void TestSetupHelperWrongSyntax(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ }
+
+ void TestSetupHelperWithMetadata(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field,
+ size_t num_tags,
+ int32_t* field_tags,
+ bool set_field_text = true) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ if (set_field_text) {
+ msg_params[field] = text_field_;
+ }
+ msg_params[am::strings::metadata_tags][field] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::strings::metadata_tags][field][i] = current_tag;
+ }
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_EQ((*msg)[am::strings::msg_params], msg_params);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params.erase(field);
+ msg_params.erase(am::strings::metadata_tags);
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ if (set_field_text) {
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_text] = text_field_;
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types][i] = current_tag;
+ }
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ MockAppPtr mock_app_;
+ std::string text_field_;
+};
+
+TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_vr = CreateFullParamsUISO();
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = 10u;
+ (*msg_vr)[am::strings::msg_params][am::strings::menu_params]
+ [am::strings::menu_name] = "menu_name";
+
+ std::shared_ptr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr vr_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*vr_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*vr_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*vr_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*vr_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+ SmartObject creation_msg_params(msg_params);
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "";
+ (*msg)[am::strings::msg_params] = msg_params;
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
+ .Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "\\n";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 5;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaTitle,
+ hmi_apis::Common_MetadataType::mediaArtist,
+ hmi_apis::Common_MetadataType::rating,
+ hmi_apis::Common_MetadataType::humidity,
+ hmi_apis::Common_MetadataType::currentTemperature};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags,
+ false);
+ command->Run();
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "";
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*ev_msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::WARNINGS));
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar";
+ TestSetupHelper(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar\\n";
+ TestSetupHelperWrongSyntax(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::alignment] = "Alignment";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets\\t";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::message] = "Response Info";
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace show_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
new file mode 100644
index 0000000000..d96a9d7643
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/commands_test.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_notification_commands_test {
+
+namespace am = ::application_manager;
+namespace commands = sdl_rpc_plugin::commands;
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::Return;
+
+template <class Command>
+class MobileNotificationCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnDriverDistractionNotification>
+ NotificationCommandsList;
+
+MATCHER(CheckNotificationMessage, "") {
+ return (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_ &&
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_ &&
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ application_manager::MessageType::kNotification;
+}
+
+TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList);
+
+TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_,
+ SendMessageToMobile(CheckNotificationMessage(), _));
+ command->Run();
+}
+
+} // namespace simple_notification_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
new file mode 100644
index 0000000000..bbd39874e0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/helpers.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_response.h"
+#include "mobile/list_files_response.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_response.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_response.h"
+#include "mobile/add_command_response.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/change_registration_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace simple_response_commands_test {
+
+namespace commands = sdl_rpc_plugin::commands;
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using am::commands::MessageSharedPtr;
+
+template <class Command>
+class MobileResponseCommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::ListFilesResponse,
+ commands::DeleteCommandResponse,
+ commands::AlertManeuverResponse,
+ commands::AlertResponse,
+ commands::SubscribeButtonResponse,
+ commands::AddSubMenuResponse,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruResponse,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListResponse,
+ commands::UnsubscribeButtonResponse,
+ commands::SliderResponse,
+ commands::SpeakResponse,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::GetWayPointsResponse,
+ commands::PerformInteractionResponse,
+ commands::PerformAudioPassThruResponse,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTResponse,
+ commands::ShowResponse,
+ commands::SystemResponse,
+ commands::AddCommandResponse,
+ commands::SendLocationResponse,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutResponse,
+ commands::ChangeRegistrationResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
+
+TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
+ std::shared_ptr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ EXPECT_CALL(this->mock_rpc_service_, SendMessageToMobile(NotNull(), _));
+ command->Run();
+}
+
+class GenericResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P2(CheckMessageParams, success, result, "") {
+ const bool is_msg_type_correct =
+ (am::MessageType::kResponse) ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+ const bool is_success_correct =
+ success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
+ const bool is_result_code_correct =
+ result ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(
+ true, is_msg_type_correct, is_success_correct, is_result_code_correct);
+}
+
+TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+
+ std::shared_ptr<commands::GenericResponse> command(
+ CreateCommand<commands::GenericResponse>(command_msg));
+
+ EXPECT_CALL(
+ this->mock_rpc_service_,
+ SendMessageToMobile(
+ CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
+
+ command->Run();
+}
+
+class ScrollableMessageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ MockAppPtr app(CreateMockApp());
+
+ std::shared_ptr<commands::ScrollableMessageResponse> command(
+ CreateCommand<commands::ScrollableMessageResponse>(message));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
+ EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
+ command->Run();
+}
+
+} // namespace simple_response_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
new file mode 100644
index 0000000000..be14aebc8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "mobile/slider_request.h"
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace slider_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SliderRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef std::shared_ptr<SliderRequest> CommandPtr;
+
+namespace {
+const int32_t kCommandId = 1;
+const uint32_t kAppId = 1u;
+const uint32_t kCmdId = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kFunctionId = 3u;
+const uint32_t kNumTicks = 2u;
+const uint32_t kPositionGreaterTicks = 3u;
+const uint32_t kPositionLessTicks = 1u;
+} // namespace
+
+class SliderRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SliderRequestTest()
+ : mock_app_(CreateMockApp())
+ , msg_(CreateMessage(smart_objects::SmartType_Map)) {}
+
+ MessageSharedPtr CreateFullParamsUISO() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ smart_objects::SmartObject menu_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ menu_params[am::strings::position] = 10;
+ menu_params[am::strings::menu_name] = "LG";
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::strings::cmd_id] = kCmdId;
+ msg_params[am::strings::menu_params] = menu_params;
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::strings::cmd_icon] = 1;
+ msg_params[am::strings::cmd_icon][am::strings::value] = "10";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ return msg;
+ }
+
+ void PreConditions() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::num_ticks] = kNumTicks;
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionLessTicks;
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "slider_footer1";
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][1] =
+ "slider_footer2";
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "slider_header";
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ sync_primitives::Lock lock_;
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+ MessageSharedPtr msg_ui = CreateFullParamsUISO();
+ (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ std::shared_ptr<SliderRequest> command = CreateCommand<SliderRequest>(msg_ui);
+
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app));
+
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg)[am::strings::msg_params][am::strings::info] = "info";
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ MessageSharedPtr ui_command_result;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ if ((*ui_command_result)[am::strings::msg_params].keyExists(
+ am::strings::info)) {
+ EXPECT_FALSE(
+ (*ui_command_result)[am::strings::msg_params][am::strings::info]
+ .asString()
+ .empty());
+ }
+}
+
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(SliderRequestTest, Init_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(SliderRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ PreConditions();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_PositionGreaterTicks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionGreaterTicks;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SliderFooterNotEqToNumticks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][2] =
+ "slider_footer3";
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderHeader_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderFooter_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SUCCESS) {
+ PreConditions();
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider)));
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, _));
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) {
+ PreConditions();
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderPositionExists_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::TIMED_OUT;
+ (*msg_)[am::strings::params][am::strings::data]
+ [am::strings::slider_position] = "position";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::TIMED_OUT);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+} // namespace slider_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace tests
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
new file mode 100644
index 0000000000..9eb23eeee3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
@@ -0,0 +1,406 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "gtest/gtest.h"
+#include "mobile/speak_request.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "utils/helpers.h"
+
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/application.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace speak_request {
+
+namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
+namespace hmi_response = ::application_manager::hmi_response;
+namespace strings = ::application_manager::strings;
+using am::commands::CommandImpl;
+using am::ApplicationManager;
+using am::commands::MessageSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
+using ::testing::_;
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using sdl_rpc_plugin::commands::SpeakRequest;
+using ::test::components::application_manager_test::MockApplication;
+
+typedef std::shared_ptr<SpeakRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 10u;
+const uint32_t kConnectionKey = 5u;
+}
+
+class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SpeakRequestTest()
+ : request_(CreateMessage(smart_objects::SmartType_Map))
+ , response_(CreateMessage(smart_objects::SmartType_Map))
+ , app_(CreateMockApp()) {}
+
+ void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
+ const mobile_apis::Result::eType mobile_response,
+ const am::HmiInterfaces::InterfaceState state,
+ const bool success) {
+ std::shared_ptr<SpeakRequest> command =
+ CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] = hmi_response;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ _, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ success);
+ EXPECT_EQ((*response_to_mobile)[strings::msg_params][strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_response));
+ }
+
+ MessageSharedPtr request_;
+ MessageSharedPtr response_;
+ MockAppPtr app_;
+};
+
+TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
+ std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(request_);
+
+ (*response_)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*response_)[strings::msg_params] = 0;
+
+ am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
+ event_tts.set_smart_object(*response_);
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ MessageSharedPtr response_to_mobile;
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->on_event(event_tts);
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ true);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::SUCCESS));
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_AVAILABLE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_AVAILABLE,
+ true);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE,
+ false);
+}
+
+TEST_F(SpeakRequestTest,
+ OnEvent_UNSUPPORTED_RESOURCE_STATE_NOT_RESPONSE_Expect_true) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ am::HmiInterfaces::STATE_NOT_RESPONSE,
+ true);
+}
+
+TEST_F(SpeakRequestTest, Run_ApplicationIsNotRegistered) {
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithWhiteSpace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = " ";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar1_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\t";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar2_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar3_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\tdf";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar4_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\n rer";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectCharInfirstPlace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyTtsFiles(
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "1234";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::WARNINGS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) {
+ Event event(Event::EventID::TTS_OnResetTimeout);
+ (*request_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*request_)[am::strings::params][am::strings::correlation_id] = kAppId;
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _));
+
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "text";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->on_event(event);
+}
+
+} // namespace speak_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace component
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
new file mode 100644
index 0000000000..0196b59b79
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/subscribe_button_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_button_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr;
+
+class SubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_semantic_version_4_5(4, 5, 0);
+
+TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::SEEKLEFT;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::IGNORED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::SEEKLEFT;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Version_4_5) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::OK;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version_4_5));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(hmi_apis::Common_ButtonName::PLAY_PAUSE,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::name]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+} // namespace subscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..d08c13b3f3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace subscribe_way_points_request {
+
+using ::testing::_;
+using ::testing::A;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::InSequence;
+namespace am = ::application_manager;
+using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr;
+
+class SubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(A<am::ApplicationSharedPtr>()))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
+ .WillByDefault(Return(true));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->Init();
+ MessageSharedPtr mobile_result_msg(
+ CatchMobileCommandResult(CallRun(*command)));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
+ CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
+ MockAppPtr app(CreateMockApp());
+ Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(result_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*app, UpdateHash());
+ }
+
+ command->Init();
+ command->on_event(event);
+}
+
+} // namespace subscribe_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
new file mode 100644
index 0000000000..9e6bc8f505
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "gtest/gtest.h"
+
+#include "mobile/system_request.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace system_request {
+
+namespace am = application_manager;
+using sdl_rpc_plugin::commands::SystemRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockHmiInterfaces;
+using am::event_engine::Event;
+using am::MessageType;
+using policy_test::MockPolicyHandlerInterface;
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kAppPolicyId = "fake-app-id";
+const uint32_t kDefaultTimeout = 1000u;
+const std::string kAppFolderName = "fake-app-name";
+const std::string kAppStorageFolder = "fake-storage";
+const std::string kSystemFilesPath = "/fake/system/files";
+const std::string kFileName = "Filename";
+const uint32_t kHmiAppId = 3u;
+} // namespace
+
+class SystemRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SystemRequestTest() : mock_app_(CreateMockApp()) {}
+
+ protected:
+ MessageSharedPtr CreateIVSUMessage() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::HTTP;
+ (*msg)[am::strings::msg_params][am::strings::file_name] = kFileName;
+ return msg;
+ }
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kAppPolicyId));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kAppFolderName));
+ ON_CALL(*mock_app_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+
+ ON_CALL(app_mngr_settings_, system_files_path())
+ .WillByDefault(ReturnRef(kSystemFilesPath));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+
+ ON_CALL(mock_policy_handler_, IsRequestTypeAllowed(kAppPolicyId, _))
+ .WillByDefault(Return(true));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandSource::SOURCE_SDL));
+ }
+
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) {
+ PreConditions();
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ command->Run();
+}
+
+TEST_F(SystemRequestTest,
+ Run_RequestTypeAllowedAndRequestSubTypeAllowed_SendHMIRequest) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ const std::string request_subtype = "fakeSubType";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ const std::vector<uint8_t> binary_data = {1u, 2u};
+ (*msg)[am::strings::params][am::strings::binary_data] = binary_data;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kAppPolicyId, request_subtype))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data, kSystemFilesPath, kFileName, 0u))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(MessageType::kRequest,
+ (*result)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ mobile_apis::RequestType::OEM_SPECIFIC,
+ (*result)[am::strings::msg_params][am::strings::request_type].asInt());
+ EXPECT_EQ(
+ request_subtype,
+ (*msg)[am::strings::msg_params][am::strings::request_subtype].asString());
+}
+
+TEST_F(
+ SystemRequestTest,
+ Run_RequestTypeAllowedAndRequestSubTypeDisallowed_SendDisallowedResponse) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ const std::string request_subtype = "fakeSubType2";
+ (*msg)[am::strings::msg_params][am::strings::request_subtype] =
+ request_subtype;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestSubTypeAllowed(kAppPolicyId, request_subtype))
+ .WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) {
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::OEM_SPECIFIC;
+
+ PreConditions();
+
+ EXPECT_CALL(mock_policy_handler_,
+ IsRequestTypeAllowed(kAppPolicyId,
+ mobile_apis::RequestType::OEM_SPECIFIC))
+ .WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+}
+
+} // namespace system_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
new file mode 100644
index 0000000000..771374348b
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/unregister_app_interface_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unregister_app_interface_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr;
+
+class UnregisterAppInterfaceRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 1u;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ const mobile_apis::AppInterfaceUnregisteredReason::eType kUnregisterReason =
+ mobile_apis::AppInterfaceUnregisteredReason::INVALID_ENUM;
+
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kConnectionKey, kUnregisterReason))
+ .WillOnce(Return(dummy_msg));
+ {
+ ::testing::InSequence sequence;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(dummy_msg, _));
+
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kConnectionKey, mobile_apis::Result::SUCCESS, _, _));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ }
+
+ command->Run();
+}
+
+} // namespace unregister_app_interface_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
new file mode 100644
index 0000000000..d6bef42794
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -0,0 +1,201 @@
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "mobile/unsubscribe_button_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_button_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using sdl_rpc_plugin::commands::UnsubscribeButtonRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnsubscribeButtonRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_semantic_version_4_5(4, 5, 0);
+} // namespace
+
+class UnsubscribeButtonRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
+
+TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotSubscribedButton_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotAllowedByHmiCapabilities_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
+
+ EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+ command->Init();
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Version_4_5) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::OK;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillRepeatedly(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::OK;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillRepeatedly(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version_4_5));
+ ON_CALL(*mock_app, is_media_application()).WillByDefault(Return(true));
+
+ EXPECT_CALL(*mock_app,
+ UnsubscribeFromButton(mobile_apis::ButtonName::PLAY_PAUSE))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+ command->Init();
+ command->Run();
+}
+
+} // namespace unsubscribe_button_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..f345d719c6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_way_points_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+
+using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UnsubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UnsubscribeWayPointsRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UnsubscribeWayPointsRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ }
+
+ MessageSharedPtr command_msg_;
+ std::shared_ptr<UnsubscribeWayPointsRequest> command_;
+};
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
+
+ command_->Run();
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ command_->on_event(event);
+}
+
+TEST_F(UnsubscribeWayPointsRequestTest,
+ OnEvent_ReceivedNavigationUnsubscribeWayPointsEvent_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(app_mngr_,
+ UnsubscribeAppFromWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command_->on_event(event);
+}
+
+} // namespace unsubscribe_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
new file mode 100644
index 0000000000..78fca8681a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/update_turn_list_request.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace update_turn_list_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Ref;
+using ::testing::Eq;
+
+using sdl_rpc_plugin::commands::UpdateTurnListRequest;
+using am::commands::MessageSharedPtr;
+using application_manager_test::MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const hmi_apis::FunctionID::eType kFunctionId =
+ hmi_apis::FunctionID::Buttons_OnButtonEvent;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UpdateTurnListRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UpdateTurnListRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UpdateTurnListRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::params][am::strings::function_id] =
+ kFunctionId;
+ }
+
+ MessageSharedPtr command_msg_;
+ std::shared_ptr<UpdateTurnListRequest> command_;
+};
+
+TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidNavigationText_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "invalid_navigation_text\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_InvalidTurnIcon_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "invalid_turn_icon\t\n";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ Run_ProcessSoftButtonsNotSucceeded_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = "valid_navigation_text";
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ const mobile_result::eType kExpectedResult = mobile_result::INVALID_ENUM;
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(kExpectedResult));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(kExpectedResult), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_NoTurnList_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command_->Run();
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE((bool)result_msg);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::WARNINGS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE(result_msg != nullptr);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+TEST_F(UpdateTurnListRequestTest,
+ OnEvent_ReceivedNavigationUpdateTurnListEvent_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_result::eType mobile_response_code = mobile_result::SUCCESS;
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command_->on_event(event);
+}
+
+} // namespace update_turn_list_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
new file mode 100644
index 0000000000..0e556a6993
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/CMakeLists.txt
@@ -0,0 +1,72 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories(include)
+
+set (HMI_COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands/hmi
+)
+
+set (MOBILE_COMMANDS_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/commands/mobile
+)
+
+collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}")
+collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}")
+collect_sources(VEHICLE_INFO_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ Utils
+)
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_library("vehicle_info_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${VEHICLE_INFO_PLUGIN_SOURCES})
+target_link_libraries("vehicle_info_plugin" ${LIBRARIES})
+
+set(INSTALL_DESTINATION bin)
+
+install(TARGETS vehicle_info_plugin
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
new file mode 100644
index 0000000000..1fb9c0a008
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVIVehicleDataNotification command class
+ * Sent by HMI for the periodic and non periodic vehicle data
+ **/
+class OnVIVehicleDataNotification
+ : public app_mngr::commands::NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVIVehicleDataNotification(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief OnVIVehicleDataNotification class destructor
+ **/
+ virtual ~OnVIVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
new file mode 100644
index 0000000000..0b0a9ef99e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageRequest command class
+ **/
+class VIDiagnosticMessageRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIDiagnosticMessageRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIDiagnosticMessageRequest class destructor
+ **/
+ virtual ~VIDiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
new file mode 100644
index 0000000000..31fc73897e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageResponse command class
+ **/
+class VIDiagnosticMessageResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIDiagnosticMessageResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIDiagnosticMessageResponse class destructor
+ **/
+ virtual ~VIDiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
new file mode 100644
index 0000000000..67308a3898
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsRequest command class
+ **/
+class VIGetDTCsRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetDTCsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetDTCsRequest class destructor
+ **/
+ virtual ~VIGetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
new file mode 100644
index 0000000000..0ddf225c93
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsResponse command class
+ **/
+class VIGetDTCsResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetDTCsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetDTCsResponse class destructor
+ **/
+ virtual ~VIGetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
new file mode 100644
index 0000000000..1b4669cf24
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequest command class
+ **/
+class VIGetVehicleDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleDataRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetVehicleDataRequest class destructor
+ **/
+ virtual ~VIGetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
new file mode 100644
index 0000000000..df5e630aea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponse command class
+ **/
+class VIGetVehicleDataResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleDataResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetVehicleDataResponse class destructor
+ **/
+ virtual ~VIGetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
new file mode 100644
index 0000000000..79a5270f8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeRequest command class
+ **/
+class VIGetVehicleTypeRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleTypeRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetVehicleTypeRequest class destructor
+ **/
+ virtual ~VIGetVehicleTypeRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
new file mode 100644
index 0000000000..baa4a936ae
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeResponse command class
+ **/
+class VIGetVehicleTypeResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIGetVehicleTypeResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIGetVehicleTypeResponse class destructor
+ **/
+ virtual ~VIGetVehicleTypeResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
new file mode 100644
index 0000000000..3f12a30c8d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyRequest command class
+ **/
+class VIIsReadyRequest : public app_mngr::commands::RequestToHMI,
+ public app_mngr::event_engine::EventObserver {
+ public:
+ /**
+ * @brief VIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIIsReadyRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIIsReadyRequest class destructor
+ **/
+ virtual ~VIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const app_mngr::event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
new file mode 100644
index 0000000000..3531aa03c4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyResponse command class
+ **/
+class VIIsReadyResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIIsReadyResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIIsReadyResponse class destructor
+ **/
+ virtual ~VIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
new file mode 100644
index 0000000000..2d10bbf11d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDRequest command class
+ **/
+class VIReadDIDRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIReadDIDRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIReadDIDRequest class destructor
+ **/
+ virtual ~VIReadDIDRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
new file mode 100644
index 0000000000..5ac655b499
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDResponse command class
+ **/
+class VIReadDIDResponse : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIReadDIDResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIReadDIDResponse class destructor
+ **/
+ virtual ~VIReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..bd22a313e7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataRequest command class
+ **/
+class VISubscribeVehicleDataRequest : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VISubscribeVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VISubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VISubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..1148a8b41a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataResponse command class
+ **/
+class VISubscribeVehicleDataResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VISubscribeVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VISubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VISubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..3b39835fbf
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/request_to_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataRequest command class
+ **/
+class VIUnsubscribeVehicleDataRequest
+ : public app_mngr::commands::RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIUnsubscribeVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..ada6896520
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/response_from_hmi.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataResponse command class
+ **/
+class VIUnsubscribeVehicleDataResponse
+ : public app_mngr::commands::ResponseFromHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ VIUnsubscribeVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
new file mode 100644
index 0000000000..e2bc7c4dfd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageRequest command class
+ **/
+class DiagnosticMessageRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DiagnosticMessageRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DiagnosticMessageRequest class destructor
+ **/
+ virtual ~DiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
new file mode 100644
index 0000000000..d69a6a0155
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageResponse command class
+ **/
+class DiagnosticMessageResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DiagnosticMessageResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief DiagnosticMessageResponse class destructor
+ **/
+ virtual ~DiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
new file mode 100644
index 0000000000..01f007697d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetDTCsRequest command class
+ **/
+class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetDTCsRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief GetDTCsRequest class destructor
+ **/
+ virtual ~GetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
new file mode 100644
index 0000000000..87024b1860
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetDTCsResponse command class
+ **/
+class GetDTCsResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetDTCsResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief GetDTCsResponse class destructor
+ **/
+ virtual ~GetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
new file mode 100644
index 0000000000..04a131da8f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+class SmartObject;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataRequest command class
+ **/
+class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief GetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetVehicleDataRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief GetVehicleDataRequest class destructor
+ **/
+ virtual ~GetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ protected:
+ virtual void on_event(const app_mngr::event_engine::Event& event);
+
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
new file mode 100644
index 0000000000..22ec1a5a78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataResponse command class
+ **/
+class GetVehicleDataResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief GetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ GetVehicleDataResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief GetVehicleDataResponse class destructor
+ **/
+ virtual ~GetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
new file mode 100644
index 0000000000..57c30164e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief OnVehicleDataNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnVehicleDataNotification
+ : public app_mngr::commands::CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ OnVehicleDataNotification(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief OnVehicleDataNotification class destructor
+ **/
+ virtual ~OnVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends vehicle data notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendVehicleData(app_mngr::ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
new file mode 100644
index 0000000000..9a8fbbd62e
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ReadDIDRequest command class
+ **/
+class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief ReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ReadDIDRequest(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ReadDIDRequest class destructor
+ **/
+ virtual ~ReadDIDRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
new file mode 100644
index 0000000000..2b7ab04768
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h
@@ -0,0 +1,78 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief ReadDIDResponse command class
+ **/
+class ReadDIDResponse : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief ReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ ReadDIDResponse(const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief ReadDIDResponse class destructor
+ **/
+ virtual ~ReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..7c6e1754da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
@@ -0,0 +1,158 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Copyright (c) 2018, Livio, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataRequest command class
+ **/
+class SubscribeVehicleDataRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief SubscribeButtonCommandRequest class destructor
+ **/
+ ~SubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks, if any app is subscribed for particular VI parameter
+ * @param param_id VI parameter id
+ * @return true, if there are registered apps subscribed for VI parameter,
+ * otherwise - false
+ */
+ bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
+
+ /**
+ * @brief Adds VI parameters being subscribed by another or the same app to
+ * response with appropriate results
+ * @param msg_params 'message_params' response section reference
+ */
+ void AddAlreadySubscribedVI(smart_objects::SmartObject& msg_params) const;
+
+ /**
+ * @brief Removes subscription for VI parameters which subsription attempt
+ * returned an error
+ * @param app Pointer to application sent subscribe request
+ * @param msg_params 'message_parameters' response section reference
+ */
+ void UnsubscribeFailedSubscriptions(
+ app_mngr::ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params) const;
+
+ /**
+ * @brief Checks if current application and other applications
+ * were subscribed to VI, prepare data that need to send to mobile app
+ * or HMI.
+ * @param app contains application
+ * @param out_info contains resulting info for sending to mobile app
+ * @param out_result_code contains result code for sending to mobile app
+ * @param out_response_params contains parameters that SDL sends to
+ * mobile application
+ * @param out_request_params contains parameters that SDL sends to
+ * HMI
+ * @param result contains result that SDL sends to mobile app.
+ */
+ void CheckVISubscriptions(app_mngr::ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result);
+
+ /**
+ * @brief VI parameters which had been already subscribed by another apps
+ * befor particular app subscribed for these parameters
+ */
+ VehicleInfoSubscriptions vi_already_subscribed_by_another_apps_;
+
+ /**
+ * @brief VI parameters which had been subscribed already by particular app
+ */
+ VehicleInfoSubscriptions vi_already_subscribed_by_this_app_;
+
+ /**
+ * @brief VI parameters which wait for subscribe after HMI respond
+ */
+ VehicleInfoSubscriptions vi_waiting_for_subscribe_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..60670afee1
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataResponse command class
+ **/
+class SubscribeVehicleDataResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ SubscribeVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeVehicleDataCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..e04d1fb97a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -0,0 +1,120 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataRequest command class
+ **/
+class UnsubscribeVehicleDataRequest
+ : public app_mngr::commands::CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeVehicleDataRequest(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeVehicleDataRequest class destructor
+ **/
+ ~UnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const app_mngr::event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
+
+ private:
+ /**
+ * @brief Checks, if any app is subscribed for particular VI parameter
+ * @param param_id VI parameter id
+ * @return true, if there are registered apps subscribed for VI parameter,
+ * otherwise - false
+ */
+ bool IsSomeoneSubscribedFor(const uint32_t param_id) const;
+
+ /**
+ * @brief Adds VI parameters being unsubscribed by another or the same app to
+ * response with appropriate results
+ * @param msg_params 'message_params' response section reference
+ */
+ void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const;
+
+ /**
+ * @brief VI parameters which still being subscribed by another apps after
+ * particular app had been unsubscribed from these parameters
+ */
+ VehicleInfoSubscriptions vi_still_subscribed_by_another_apps_;
+
+ /**
+ * @brief VI parameters which had been unsubscribed already by particular app
+ */
+ VehicleInfoSubscriptions vi_already_unsubscribed_by_this_app_;
+
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..397ae3cbce
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataResponse command class
+ **/
+class UnsubscribeVehicleDataResponse
+ : public app_mngr::commands::CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ UnsubscribeVehicleDataResponse(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @brief UnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
new file mode 100644
index 0000000000..ead6af841f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
@@ -0,0 +1,135 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
+
+#include <application_manager/application_manager.h>
+
+#include <set>
+#include <string>
+
+namespace vehicle_info_plugin {
+class VehicleInfoPlugin;
+
+namespace app_mngr = application_manager;
+
+typedef mobile_apis::VehicleDataType::eType VehicleDataType;
+/**
+ * @brief Defines set of vehicle info types
+ */
+typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
+
+class VehicleInfoAppExtension : public app_mngr::AppExtension {
+ public:
+ /**
+ * @brief VehicleInfoAppExtension constructor
+ * @param plugin vehicle info plugin
+ * @param app application that contains this plugin
+ */
+ VehicleInfoAppExtension(VehicleInfoPlugin& plugin,
+ app_mngr::Application& app);
+ virtual ~VehicleInfoAppExtension();
+
+ /**
+ * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of
+ * application extension
+ * @param vehicle_data data to subscribe
+ * @return true in case if subscription is successful
+ */
+ bool subscribeToVehicleInfo(const VehicleDataType vehicle_data);
+
+ /**
+ * @brief unsubscribeFromVehicleInfo remove vehicle_data from list of
+ * subscriptions of application extension
+ * @param vehicle_data data to unsubscribe
+ * @return true in case if unsubscription is successful
+ */
+ bool unsubscribeFromVehicleInfo(const VehicleDataType vehicle_data);
+ /**
+ * @brief unsubscribeFromVehicleInfo unsubscribe from all vehicle info data
+ */
+ void unsubscribeFromVehicleInfo();
+
+ /**
+ * @brief isSubscribedToVehicleInfo checks if extension is subscribed to
+ * vehicle data
+ * @param vehicle_data_type data type to check subscription
+ * @return true if extension is subscribed this vehicle_data_type, otherwise
+ * return false
+ */
+ bool isSubscribedToVehicleInfo(const VehicleDataType vehicle_data_type) const;
+
+ /**
+ * @brief Subscriptions get list of subscriptions for application extension
+ * @return list of subscriptions for application extension
+ */
+ VehicleInfoSubscriptions Subscriptions();
+
+ /**
+ * @brief SaveResumptionData saves vehicle info data
+ * @param resumption_data plase to store resumption data
+ */
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+
+ /**
+ * @brief ProcessResumption load resumtion data back to plugin during
+ * resumption
+ * @param resumption_data resumption data
+ */
+ void ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) OVERRIDE;
+
+ /**
+ * @brief VehicleInfoAppExtensionUID unique identifier of VehicleInfo
+ * aplication extension
+ */
+ static unsigned VehicleInfoAppExtensionUID;
+
+ /**
+ * @brief ExtractVIExtension utility function to extract application extension
+ * from application
+ * @param app : applicaiton that contains vehicle info app_extension
+ * @return application extension extracted from application
+ */
+ static VehicleInfoAppExtension& ExtractVIExtension(
+ application_manager::Application& app);
+
+ private:
+ VehicleInfoSubscriptions subscribed_data_;
+ VehicleInfoPlugin& plugin_;
+ app_mngr::Application& app_;
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
new file mode 100644
index 0000000000..e36611dfa6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h
@@ -0,0 +1,70 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+#include "vehicle_info_plugin/vehicle_info_hmi_command_factory.h"
+#include "vehicle_info_plugin/vehicle_info_mobile_command_factory.h"
+
+namespace vehicle_info_plugin {
+
+namespace app_mngr = application_manager;
+namespace commands = application_manager::commands;
+
+/**
+ * @brief The Vehicle Info command factory.
+ */
+class VehicleInfoCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoCommandFactory(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+ virtual ~VehicleInfoCommandFactory();
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const commands::MessageSharedPtr& message,
+ commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ std::unique_ptr<app_mngr::CommandFactory> hmi_command_factory_;
+ std::unique_ptr<app_mngr::CommandFactory> mob_command_factory_;
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
new file mode 100644
index 0000000000..412949eedb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info hmi command factory.
+ */
+class VehicleInfoHmiCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoHmiCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const;
+
+ DISALLOW_COPY_AND_ASSIGN(VehicleInfoHmiCommandFactory);
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
new file mode 100644
index 0000000000..6cfc77a41c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
+
+#include "application_manager/application_manager.h"
+
+namespace vehicle_info_plugin {
+namespace app_mngr = application_manager;
+
+/**
+ * @brief The vehicle info mobile command factory.
+ */
+class VehicleInfoMobileCommandFactory : public app_mngr::CommandFactory {
+ public:
+ VehicleInfoMobileCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ app_mngr::CommandSharedPtr CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const OVERRIDE;
+
+ private:
+ app_mngr::ApplicationManager& application_manager_;
+ app_mngr::rpc_service::RPCService& rpc_service_;
+ app_mngr::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+
+ app_mngr::CommandCreator& buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const;
+
+ DISALLOW_COPY_AND_ASSIGN(VehicleInfoMobileCommandFactory);
+};
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
new file mode 100644
index 0000000000..b15b7006e6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
+
+#include "application_manager/command_factory.h"
+
+namespace vehicle_info_plugin {
+class VehicleInfoAppExtension;
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class VehicleInfoPlugin : public plugins::RPCPlugin {
+ public:
+ VehicleInfoPlugin();
+
+ bool Init(app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) OVERRIDE;
+
+ bool IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) OVERRIDE;
+
+ std::string PluginName() OVERRIDE;
+ app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
+ void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE;
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief ProcessResumptionSubscription send Subscribe vehicle data requests
+ * to HMI
+ * @param app application for subscription
+ * @param ext application extension
+ */
+ void ProcessResumptionSubscription(app_mngr::Application& app,
+ VehicleInfoAppExtension& ext);
+
+ private:
+ void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app);
+
+ std::unique_ptr<app_mngr::CommandFactory> command_factory_;
+ app_mngr::ApplicationManager* application_manager_;
+};
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create();
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
new file mode 100644
index 0000000000..6125c4ee45
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVIVehicleDataNotification::OnVIVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : NotificationFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {}
+
+void OnVIVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ if (msg_params.keyExists(strings::odometer)) {
+ application_manager_.IviInfoUpdated(
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER,
+ msg_params[strings::odometer].asInt());
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
new file mode 100644
index 0000000000..8d3b9f13fb
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {}
+
+void VIDiagnosticMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
new file mode 100644
index 0000000000..e22ba7ddb2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {}
+
+void VIDiagnosticMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
new file mode 100644
index 0000000000..71ce6331ab
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetDTCsRequest::VIGetDTCsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetDTCsRequest::~VIGetDTCsRequest() {}
+
+void VIGetDTCsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
new file mode 100644
index 0000000000..9d39c60796
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetDTCsResponse::VIGetDTCsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetDTCsResponse::~VIGetDTCsResponse() {}
+
+void VIGetDTCsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
new file mode 100644
index 0000000000..9fc48c8820
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleDataRequest::VIGetVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {}
+
+void VIGetVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
new file mode 100644
index 0000000000..73ba1a94fe
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VIGetVehicleDataResponse::VIGetVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {}
+
+void VIGetVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+
+ if ((*message_)[strings::params][strings::message_type] ==
+ static_cast<int32_t>(hmi_apis::messageType::error_response)) {
+ smart_objects::SmartObject result(smart_objects::SmartType_Map);
+
+ if ((*message_)[strings::params].keyExists(strings::data)) {
+ result[strings::msg_params] = (*message_)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*message_)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*message_)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*message_)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*message_)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ }
+
+ event.set_smart_object(result);
+ } else {
+ event.set_smart_object(*message_);
+ policy_handler_.OnVehicleDataUpdated(*message_);
+ }
+
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
new file mode 100644
index 0000000000..a1a221220a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleTypeRequest::VIGetVehicleTypeRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {}
+
+void VIGetVehicleTypeRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
new file mode 100644
index 0000000000..9f14b4e7ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIGetVehicleTypeResponse::VIGetVehicleTypeResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {}
+
+void VIGetVehicleTypeResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+
+ hmi_capabilities.set_vehicle_type(
+ (*message_)[strings::msg_params][hmi_response::vehicle_type]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
new file mode 100644
index 0000000000..04bcc435ba
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIIsReadyRequest::VIIsReadyRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+VIIsReadyRequest::~VIIsReadyRequest() {}
+
+void VIIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady,
+ correlation_id());
+ SendRequest();
+}
+
+void VIIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_IsReady: {
+ LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ const bool is_available = app_mngr::commands::ChangeInterfaceState(
+ application_manager_,
+ message,
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ HMICapabilities& hmi_capabilities = hmi_capabilities_;
+ hmi_capabilities.set_is_ivi_cooperating(is_available);
+ policy_handler_.OnVIIsReady();
+ if (!app_mngr::commands::CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ LOG4CXX_INFO(
+ logger_,
+ "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available");
+ return;
+ }
+ SendMessageToHMI();
+
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void VIIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void VIIsReadyRequest::SendMessageToHMI() {
+ std::shared_ptr<smart_objects::SmartObject> get_type(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
+ application_manager_));
+ rpc_service_.ManageHMICommand(get_type);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
new file mode 100644
index 0000000000..35907e11d2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIIsReadyResponse::VIIsReadyResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIIsReadyResponse::~VIIsReadyResponse() {}
+
+void VIIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
new file mode 100644
index 0000000000..b55c9e32a0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIReadDIDRequest::VIReadDIDRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIReadDIDRequest::~VIReadDIDRequest() {}
+
+void VIReadDIDRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
new file mode 100644
index 0000000000..9d56b2aa78
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIReadDIDResponse::VIReadDIDResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIReadDIDResponse::~VIReadDIDResponse() {}
+
+void VIReadDIDResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..60e9dc88c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {}
+
+void VISubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..f004d6f3cd
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {}
+
+void VISubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..9056538514
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : RequestToHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {}
+
+void VIUnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..348bc1b269
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : ResponseFromHMI(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {}
+
+void VIUnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
new file mode 100644
index 0000000000..4eba894025
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc
@@ -0,0 +1,130 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+
+#include "application_manager/application_impl.h"
+
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DiagnosticMessageRequest::DiagnosticMessageRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DiagnosticMessageRequest::~DiagnosticMessageRequest() {}
+
+void DiagnosticMessageRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const std::vector<uint32_t>& supported_diag_modes =
+ application_manager_.get_settings().supported_diag_modes();
+
+ smart_objects::SmartObject& msg_data =
+ (*message_)[strings::msg_params][strings::message_data];
+
+ const uint8_t mode_position = 0;
+ const uint32_t msg_diagnostic_mode = msg_data[mode_position].asUInt();
+ if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(),
+ supported_diag_modes.end(),
+ msg_diagnostic_mode)) {
+ LOG4CXX_ERROR(logger_,
+ "Received diagnostic mode " << msg_diagnostic_mode
+ << " is not supported.");
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "Received diagnostic mode is not supported.");
+ return;
+ }
+
+ // Add app_id for HMI request
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
+ &(*message_)[strings::msg_params],
+ true);
+}
+
+void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
new file mode 100644
index 0000000000..54d8382f5d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+DiagnosticMessageResponse::DiagnosticMessageResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+DiagnosticMessageResponse::~DiagnosticMessageResponse() {}
+
+void DiagnosticMessageResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
new file mode 100644
index 0000000000..6c04e874e8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc
@@ -0,0 +1,119 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetDTCsRequest::GetDTCsRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetDTCsRequest::~GetDTCsRequest() {}
+
+void GetDTCsRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::dtc_mask)) {
+ msg_params[strings::dtc_mask] =
+ (*message_)[strings::msg_params][strings::dtc_mask];
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
+}
+
+void GetDTCsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
new file mode 100644
index 0000000000..3686094b73
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetDTCsResponse::GetDTCsResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetDTCsResponse::~GetDTCsResponse() {}
+
+void GetDTCsResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
new file mode 100644
index 0000000000..87a9ace377
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
@@ -0,0 +1,147 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+namespace str = strings;
+
+GetVehicleDataRequest::GetVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetVehicleDataRequest::~GetVehicleDataRequest() {}
+
+void GetVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ int32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ const uint32_t min_length_msg_params = 1;
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[str::msg_params].keyExists(it->first) &&
+ true == (*message_)[str::msg_params][it->first].asBool()) {
+ msg_params[it->first] = (*message_)[strings::msg_params][it->first];
+ }
+ }
+ if (msg_params.length() > min_length_msg_params) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true);
+ return;
+ } else if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+ result = result ||
+ ((hmi_apis::Common_Result::DATA_NOT_AVAILABLE == result_code) &&
+ (message[strings::msg_params].length() > 1));
+
+ if (true ==
+ message[strings::msg_params].keyExists(hmi_response::method)) {
+ message[strings::msg_params].erase(hmi_response::method);
+ }
+ if (true == message[strings::params].keyExists(strings::error_msg)) {
+ response_info = message[strings::params][strings::error_msg].asString();
+ }
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
new file mode 100644
index 0000000000..3a7d663756
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h"
+#include "application_manager/rpc_service.h"
+#include "interfaces/HMI_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+GetVehicleDataResponse::GetVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+GetVehicleDataResponse::~GetVehicleDataResponse() {}
+
+void GetVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
new file mode 100644
index 0000000000..f8553c84f8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc
@@ -0,0 +1,136 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "application_manager/helpers/application_helper.h"
+#include "utils/macro.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+OnVehicleDataNotification::OnVehicleDataNotification(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandNotificationImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+OnVehicleDataNotification::~OnVehicleDataNotification() {}
+
+void OnVehicleDataNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<ApplicationSharedPtr> appNotification;
+ std::vector<ApplicationSharedPtr>::iterator appNotification_it =
+ appNotification.begin();
+ std::vector<smart_objects::SmartObject> appSO;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
+ LOG4CXX_ERROR(logger_, "vehicle_data nanme" << it->first);
+ auto vehicle_data_value =
+ (*message_)[strings::msg_params][it->first].asInt();
+
+ application_manager_.IviInfoUpdated(it->second, vehicle_data_value);
+
+ auto subscribed_to_ivi_predicate = [&it](const ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(it->second);
+ };
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ application_manager::FindAllApps(application_manager_.applications(),
+ subscribed_to_ivi_predicate);
+
+ std::vector<ApplicationSharedPtr>::const_iterator app_it =
+ applications.begin();
+
+ for (; applications.end() != app_it; ++app_it) {
+ const ApplicationSharedPtr app = *app_it;
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ continue;
+ }
+
+ appNotification_it =
+ find(appNotification.begin(), appNotification.end(), app);
+ if (appNotification_it == appNotification.end()) {
+ appNotification.push_back(app);
+ smart_objects::SmartObject msg_param =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_param[it->first] = (*message_)[strings::msg_params][it->first];
+ appSO.push_back(msg_param);
+ } else {
+ size_t idx =
+ std::distance(appNotification.begin(), appNotification_it);
+ appSO[idx][it->first] = (*message_)[strings::msg_params][it->first];
+ }
+ }
+ }
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Number of Notifications to be send: " << appNotification.size());
+
+ for (size_t idx = 0; idx < appNotification.size(); idx++) {
+ LOG4CXX_INFO(logger_,
+ "Send OnVehicleData PRNDL notification to "
+ << appNotification[idx]->name().c_str()
+ << " application id " << appNotification[idx]->app_id());
+ (*message_)[strings::params][strings::connection_key] =
+ appNotification[idx]->app_id();
+ (*message_)[strings::msg_params] = appSO[idx];
+ SendNotification();
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
new file mode 100644
index 0000000000..010cce4c63
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc
@@ -0,0 +1,134 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ReadDIDRequest::ReadDIDRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ReadDIDRequest::~ReadDIDRequest() {}
+
+void ReadDIDRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ LOG4CXX_INFO(
+ logger_,
+ "Correlation_id :"
+ << (*message_)[strings::params][strings::correlation_id].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "An application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->AreCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::did_location].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+ msg_params[strings::did_location] =
+ (*message_)[strings::msg_params][strings::did_location];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
+}
+
+void ReadDIDRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ hmi_apis::Common_Result::eType result_code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ const bool result = PrepareResultForMobileResponse(
+ result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ std::string response_info;
+ GetInfo(message, response_info);
+
+ SendResponse(result,
+ MessageHelper::HMIToMobileResult(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
new file mode 100644
index 0000000000..82d49574f0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/read_did_response.h"
+#include "application_manager/rpc_service.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+
+namespace commands {
+
+ReadDIDResponse::ReadDIDResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ReadDIDResponse::~ReadDIDResponse() {}
+
+void ReadDIDResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..65f4fde0b2
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -0,0 +1,360 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+ Copyright (c) 2018, Livio, Inc.
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
+
+void SubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ std::string info;
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ bool result = false;
+ CheckVISubscriptions(
+ app, info, result_code, response_params, msg_params, result);
+
+ if (mobile_apis::Result::INVALID_ENUM != result_code) {
+ SendResponse(result,
+ result_code,
+ info.empty() ? NULL : info.c_str(),
+ response_params.empty() ? NULL : &response_params);
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ &msg_params,
+ true);
+}
+
+void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ bool is_succeeded = result || !vi_already_subscribed_by_another_apps_.empty();
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ if (is_succeeded) {
+ if (!vi_already_subscribed_by_this_app_.empty()) {
+ result_code = mobile_apis::Result::IGNORED;
+ response_info = "Already subscribed on some provided VehicleData.";
+ }
+
+ if (!vi_waiting_for_subscribe_.empty()) {
+ LOG4CXX_DEBUG(logger_, "Subscribing to all pending VehicleData");
+ VehicleInfoSubscriptions::const_iterator key =
+ vi_waiting_for_subscribe_.begin();
+ for (; key != vi_waiting_for_subscribe_.end(); ++key) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ ext.subscribeToVehicleInfo(*key);
+ }
+ }
+ }
+
+ UnsubscribeFailedSubscriptions(app, message[strings::msg_params]);
+
+ if (!vi_already_subscribed_by_another_apps_.empty() ||
+ !vi_already_subscribed_by_this_app_.empty()) {
+ AddAlreadySubscribedVI(
+ const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
+ }
+
+ SendResponse(is_succeeded,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
+
+bool SubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+void SubscribeVehicleDataRequest::AddAlreadySubscribedVI(
+ smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ auto vi_to_string =
+ [](const mobile_apis::VehicleDataType::eType vehicle_data) {
+ for (auto& vi_str_to_int_pair : MessageHelper::vehicle_data()) {
+ if (vehicle_data == vi_str_to_int_pair.second) {
+ return vi_str_to_int_pair.first;
+ }
+ }
+ return std::string();
+ };
+
+ VehicleInfoSubscriptions::const_iterator it_same_app =
+ vi_already_subscribed_by_this_app_.begin();
+ for (; vi_already_subscribed_by_this_app_.end() != it_same_app;
+ ++it_same_app) {
+ msg_params[vi_to_string(*it_same_app)][strings::result_code] =
+ VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ msg_params[vi_to_string(*it_same_app)][strings::data_type] = *it_same_app;
+ }
+
+ VehicleInfoSubscriptions::const_iterator it_another_app =
+ vi_already_subscribed_by_another_apps_.begin();
+ for (; vi_already_subscribed_by_another_apps_.end() != it_another_app;
+ ++it_another_app) {
+ msg_params[vi_to_string(*it_another_app)][strings::result_code] =
+ VehicleDataResultCode::VDRC_SUCCESS;
+ msg_params[vi_to_string(*it_another_app)][strings::data_type] =
+ *it_another_app;
+ }
+}
+
+void SubscribeVehicleDataRequest::UnsubscribeFailedSubscriptions(
+ ApplicationSharedPtr app,
+ const smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (msg_params.keyExists(it->first)) {
+ if (msg_params[it->first][strings::result_code].asInt() !=
+ hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) {
+ LOG4CXX_DEBUG(logger_,
+ "Subscription for VehicleDataType "
+ << it->first
+ << " is unsuccessfull. "
+ "Unsubscribing app with connection key "
+ << connection_key() << " from it.");
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .unsubscribeFromVehicleInfo(it->second);
+ }
+ }
+ }
+}
+
+struct SubscribedToIVIPredicate {
+ int32_t vehicle_info_;
+ SubscribedToIVIPredicate(int32_t vehicle_info)
+ : vehicle_info_(vehicle_info) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
+ }
+};
+
+bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
+ const uint32_t param_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SubscribedToIVIPredicate finder(param_id);
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ return it != accessor.GetData().end();
+}
+
+void SubscribeVehicleDataRequest::CheckVISubscriptions(
+ ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result) {
+ // counter for items to subscribe
+ VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
+ // counter for subscribed items by application
+ uint32_t subscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ HmiInterfaces::InterfaceState interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ const bool is_interface_not_available =
+ interface_state == HmiInterfaces::STATE_NOT_AVAILABLE;
+
+ for (; vehicle_data.end() != it; ++it) {
+ const std::string& key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ const bool is_key_enabled =
+ (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_subscribe;
+ }
+ if (!is_interface_not_available && is_key_enabled) {
+ mobile_apis::VehicleDataType::eType key_type = it->second;
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (is_subscribed) {
+ LOG4CXX_DEBUG(logger_,
+ "App with connection key "
+ << connection_key()
+ << " is subscribed already for VehicleDataType: "
+ << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_this_app_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ continue;
+ }
+
+ if (IsSomeoneSubscribedFor(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are apps subscribed already for "
+ "VehicleDataType: "
+ << key_type);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+
+ if (!ext.subscribeToVehicleInfo(key_type)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Unable to subscribe for VehicleDataType: " << key_type);
+ continue;
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " have been subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ vi_already_subscribed_by_another_apps_.insert(key_type);
+ out_response_params[key_name][strings::data_type] = key_type;
+ out_response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
+ continue;
+ }
+
+ out_request_params[key_name] = is_key_enabled;
+
+ if (is_key_enabled) {
+ vi_waiting_for_subscribe_.insert(key_type);
+ LOG4CXX_DEBUG(
+ logger_,
+ "App with connection key "
+ << connection_key()
+ << " will be subscribed for VehicleDataType: " << key_type);
+ ++subscribed_items;
+ }
+ }
+ }
+ }
+
+ const bool is_everything_already_subscribed =
+ items_to_subscribe ==
+ vi_already_subscribed_by_another_apps_.size() +
+ vi_already_subscribed_by_this_app_.size();
+
+ if (0 == items_to_subscribe) {
+ if (HasDisallowedParams()) {
+ out_result_code = mobile_apis::Result::DISALLOWED;
+ } else {
+ out_result_code = mobile_apis::Result::INVALID_DATA;
+ out_info = "No data in the request";
+ }
+ out_result = false;
+ }
+
+ if (0 == subscribed_items && !is_interface_not_available) {
+ out_result_code = mobile_apis::Result::IGNORED;
+ out_info = "Already subscribed on provided VehicleData.";
+ out_result = false;
+ }
+
+ if (is_everything_already_subscribed) {
+ out_result_code = vi_already_subscribed_by_this_app_.size()
+ ? mobile_apis::Result::IGNORED
+ : mobile_apis::Result::SUCCESS;
+ if (!(vi_already_subscribed_by_this_app_.empty())) {
+ out_info = "Already subscribed on some provided VehicleData.";
+ }
+ out_result = true;
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..2bea839320
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+SubscribeVehicleDataResponse::SubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {}
+
+void SubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ rpc_service_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..d0152ea0c3
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,287 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/command_impl.h"
+
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/helpers.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
+
+void UnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ int32_t items_to_unsubscribe = 0;
+ int32_t unsubscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject response_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ for (; vehicle_data.end() != it; ++it) {
+ const std::string& key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_unsubscribe;
+
+ mobile_apis::VehicleDataType::eType key_type = it->second;
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (!is_subscribed) {
+ ++unsubscribed_items;
+ vi_already_unsubscribed_by_this_app_.insert(key_type);
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
+ continue;
+ }
+
+ if (!VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .unsubscribeFromVehicleInfo(it->second)) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to unsubscribe from "
+ "VehicleDataType: "
+ << key_type);
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Unsubscribed app with connection key "
+ << connection_key()
+ << " from VehicleDataType: " << key_type);
+
+ ++unsubscribed_items;
+
+ if (IsSomeoneSubscribedFor(key_type)) {
+ LOG4CXX_DEBUG(logger_,
+ "There are another apps still subscribed for "
+ "VehicleDataType: "
+ << key_type);
+
+ vi_still_subscribed_by_another_apps_.insert(key_type);
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
+ continue;
+ }
+
+ msg_params[key_name] = is_key_enabled;
+ }
+ }
+ }
+
+ bool is_everything_already_unsubscribed =
+ static_cast<uint32_t>(items_to_unsubscribe) ==
+ vi_still_subscribed_by_another_apps_.size() +
+ vi_already_unsubscribed_by_this_app_.size();
+
+ if (0 == items_to_unsubscribe) {
+ if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(
+ false, mobile_apis::Result::INVALID_DATA, "No data in the request.");
+ }
+ return;
+ }
+
+ if (0 == unsubscribed_items) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Was not subscribed on any VehicleData.",
+ &response_params);
+ return;
+ }
+
+ if (is_everything_already_unsubscribed) {
+ if (!vi_already_unsubscribed_by_this_app_.empty()) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Some provided VehicleData was not subscribed.",
+ &response_params);
+ } else {
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ }
+ return;
+ }
+
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
+ &msg_params,
+ true);
+}
+
+void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ if (hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData != event.id()) {
+ LOG4CXX_ERROR(logger_, "Received unknown event.");
+ return;
+ }
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
+
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ std::string response_info;
+ GetInfo(message, response_info);
+ const bool result = PrepareResultForMobileResponse(
+ hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ mobile_apis::Result::eType result_code =
+ MessageHelper::HMIToMobileResult(hmi_result);
+
+ if (result) {
+ if (vi_already_unsubscribed_by_this_app_.size()) {
+ result_code = mobile_apis::Result::IGNORED;
+ response_info = "Some provided VehicleData was not subscribed.";
+ }
+ }
+
+ if (!vi_still_subscribed_by_another_apps_.empty() ||
+ !vi_already_unsubscribed_by_this_app_.empty()) {
+ AddAlreadyUnsubscribedVI(
+ const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
+ }
+
+ if (result) {
+ SetAllowedToTerminate(false);
+ }
+ SendResponse(result,
+ result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ if (result) {
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+ }
+}
+
+bool UnsubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+struct SubscribedToIVIPredicate {
+ int32_t vehicle_info_;
+ SubscribedToIVIPredicate(int32_t vehicle_info)
+ : vehicle_info_(vehicle_info) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ DCHECK_OR_RETURN(app, false);
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ return ext.isSubscribedToVehicleInfo(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
+ }
+};
+
+bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
+ const uint32_t param_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SubscribedToIVIPredicate finder(param_id);
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ return it != accessor.GetData().end();
+}
+
+void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
+ smart_objects::SmartObject& response) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace mobile_apis;
+ VehicleInfoSubscriptions::const_iterator it_same_app =
+ vi_already_unsubscribed_by_this_app_.begin();
+ for (; vi_already_unsubscribed_by_this_app_.end() != it_same_app;
+ ++it_same_app) {
+ response[*it_same_app][strings::result_code] =
+ VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
+ }
+
+ VehicleInfoSubscriptions::const_iterator it_another_app =
+ vi_still_subscribed_by_another_apps_.begin();
+ for (; vi_still_subscribed_by_another_apps_.end() != it_another_app;
+ ++it_another_app) {
+ response[*it_another_app][strings::result_code] =
+ VehicleDataResultCode::VDRC_SUCCESS;
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..5f79785784
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,70 @@
+/*
+
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
+
+namespace vehicle_info_plugin {
+using namespace application_manager;
+namespace commands {
+
+UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandResponseImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {}
+
+void UnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+ SendResponse(true);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
new file mode 100644
index 0000000000..3b1d411841
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
@@ -0,0 +1,125 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+
+unsigned VehicleInfoAppExtension::VehicleInfoAppExtensionUID = 146;
+
+VehicleInfoAppExtension::VehicleInfoAppExtension(
+ VehicleInfoPlugin& plugin, application_manager::Application& app)
+ : app_mngr::AppExtension(
+ VehicleInfoAppExtension::VehicleInfoAppExtensionUID)
+ , plugin_(plugin)
+ , app_(app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+VehicleInfoAppExtension::~VehicleInfoAppExtension() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool VehicleInfoAppExtension::subscribeToVehicleInfo(
+ const VehicleDataType vehicle_data) {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ return subscribed_data_.insert(vehicle_data).second;
+}
+
+bool VehicleInfoAppExtension::unsubscribeFromVehicleInfo(
+ const VehicleDataType vehicle_data) {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ auto it = subscribed_data_.find(vehicle_data);
+ if (it != subscribed_data_.end()) {
+ subscribed_data_.erase(it);
+ return true;
+ }
+ return false;
+}
+
+void VehicleInfoAppExtension::unsubscribeFromVehicleInfo() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribed_data_.clear();
+}
+
+bool VehicleInfoAppExtension::isSubscribedToVehicleInfo(
+ const VehicleDataType vehicle_data) const {
+ LOG4CXX_DEBUG(logger_, vehicle_data);
+ return subscribed_data_.find(vehicle_data) != subscribed_data_.end();
+}
+
+VehicleInfoSubscriptions VehicleInfoAppExtension::Subscriptions() {
+ return subscribed_data_;
+}
+
+void VehicleInfoAppExtension::SaveResumptionData(
+ smart_objects::SmartObject& resumption_data) {
+ const char* application_vehicle_info = "vehicleInfo";
+ resumption_data[application_vehicle_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int i = 0;
+ for (const auto& subscription : subscribed_data_) {
+ resumption_data[application_vehicle_info][i] = subscription;
+ }
+}
+
+void VehicleInfoAppExtension::ProcessResumption(
+ const smart_objects::SmartObject& resumption_data) {
+ const char* application_vehicle_info = "vehicleInfo";
+ if (resumption_data.keyExists(application_vehicle_info)) {
+ const smart_objects::SmartObject& subscriptions_ivi =
+ resumption_data[application_vehicle_info];
+ for (size_t i = 0; i < subscriptions_ivi.length(); ++i) {
+ mobile_apis::VehicleDataType::eType ivi =
+ static_cast<mobile_apis::VehicleDataType::eType>(
+ (resumption_data[i]).asInt());
+ subscribeToVehicleInfo(ivi);
+ }
+ plugin_.ProcessResumptionSubscription(app_, *this);
+ }
+}
+
+VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension(
+ application_manager::Application& app) {
+ auto ext_ptr =
+ app.QueryInterface(VehicleInfoAppExtension::VehicleInfoAppExtensionUID);
+ DCHECK(ext_ptr);
+ DCHECK(dynamic_cast<VehicleInfoAppExtension*>(ext_ptr.get()));
+ auto vi_app_extension =
+ std::static_pointer_cast<VehicleInfoAppExtension>(ext_ptr);
+ DCHECK(vi_app_extension);
+ return *vi_app_extension;
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
new file mode 100644
index 0000000000..32959174da
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc
@@ -0,0 +1,70 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/vehicle_info_command_factory.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+
+VehicleInfoCommandFactory::VehicleInfoCommandFactory(
+ app_mngr::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : hmi_command_factory_(new VehicleInfoHmiCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler))
+ , mob_command_factory_(new VehicleInfoMobileCommandFactory(
+ application_manager, rpc_service, hmi_capabilities, policy_handler)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+VehicleInfoCommandFactory::~VehicleInfoCommandFactory() {}
+
+app_mngr::CommandSharedPtr VehicleInfoCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ if (app_mngr::commands::Command::SOURCE_HMI == source) {
+ return hmi_command_factory_->CreateCommand(message, source);
+ } else {
+ return mob_command_factory_->CreateCommand(message, source);
+ }
+}
+
+bool VehicleInfoCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource source) const {
+ return commands::Command::SOURCE_HMI == source
+ ? hmi_command_factory_->IsAbleToProcess(function_id, source)
+ : mob_command_factory_->IsAbleToProcess(function_id, source);
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
new file mode 100644
index 0000000000..9311cea6d7
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
@@ -0,0 +1,156 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/vehicle_info_hmi_command_factory.h"
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_read_did_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+namespace strings = app_mngr::strings;
+
+VehicleInfoHmiCommandFactory::VehicleInfoHmiCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr VehicleInfoHmiCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const hmi_apis::messageType::eType message_type =
+ static_cast<hmi_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (hmi_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (hmi_apis::messageType::error_response == message_type) {
+ message_type_str = "error response";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type).create(message);
+}
+
+bool VehicleInfoHmiCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ UNUSED(source);
+ return buildCommandCreator(function_id, hmi_apis::messageType::INVALID_ENUM)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (function_id) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleType:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetVehicleTypeRequest>()
+ : factory.GetCreator<commands::VIGetVehicleTypeResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_IsReady:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIIsReadyRequest>()
+ : factory.GetCreator<commands::VIIsReadyResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VISubscribeVehicleDataRequest>()
+ : factory
+ .GetCreator<commands::VISubscribeVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory
+ .GetCreator<commands::VIUnsubscribeVehicleDataRequest>()
+ : factory.GetCreator<
+ commands::VIUnsubscribeVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetVehicleDataRequest>()
+ : factory.GetCreator<commands::VIGetVehicleDataResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_OnVehicleData:
+ return factory.GetCreator<commands::OnVIVehicleDataNotification>();
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIReadDIDRequest>()
+ : factory.GetCreator<commands::VIReadDIDResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetDTCsRequest>()
+ : factory.GetCreator<commands::VIGetDTCsResponse>();
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIDiagnosticMessageRequest>()
+ : factory.GetCreator<commands::VIDiagnosticMessageResponse>();
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
new file mode 100644
index 0000000000..7600afa091
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
@@ -0,0 +1,144 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/vehicle_info_mobile_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_response.h"
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_request.h"
+#include "vehicle_info_plugin/commands/mobile/get_dtcs_response.h"
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_response.h"
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace vehicle_info_plugin {
+namespace strings = app_mngr::strings;
+
+VehicleInfoMobileCommandFactory::VehicleInfoMobileCommandFactory(
+ application_manager::ApplicationManager& application_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::commands::Command::CommandSource source) {
+ UNUSED(source);
+
+ const mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ const mobile_apis::messageType::eType message_type =
+ static_cast<mobile_apis::messageType::eType>(
+ (*message)[strings::params][strings::message_type].asInt());
+
+ auto message_type_str = "request";
+ if (mobile_apis::messageType::response == message_type) {
+ message_type_str = "response";
+ } else if (mobile_apis::messageType::notification == message_type) {
+ message_type_str = "notification";
+ }
+
+ UNUSED(message_type_str);
+ LOG4CXX_DEBUG(logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << function_id << ", message type: " << message_type_str);
+
+ return buildCommandCreator(function_id, message_type).create(message);
+}
+
+bool VehicleInfoMobileCommandFactory::IsAbleToProcess(
+ const int32_t function_id,
+ const app_mngr::commands::Command::CommandSource source) const {
+ UNUSED(source);
+ return buildCommandCreator(function_id,
+ mobile_apis::messageType::INVALID_ENUM)
+ .CanBeCreated();
+}
+
+app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::buildCommandCreator(
+ const int32_t function_id, const int32_t message_type) const {
+ auto factory = app_mngr::CommandCreatorFactory(
+ application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
+
+ switch (function_id) {
+ case mobile_apis::FunctionID::GetVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetVehicleDataRequest>()
+ : factory.GetCreator<commands::GetVehicleDataResponse>();
+ case mobile_apis::FunctionID::SubscribeVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::SubscribeVehicleDataRequest>()
+ : factory.GetCreator<commands::SubscribeVehicleDataResponse>();
+ case mobile_apis::FunctionID::UnsubscribeVehicleDataID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::UnsubscribeVehicleDataRequest>()
+ : factory
+ .GetCreator<commands::UnsubscribeVehicleDataResponse>();
+ case mobile_apis::FunctionID::OnVehicleDataID:
+ return factory.GetCreator<commands::OnVehicleDataNotification>();
+ case mobile_apis::FunctionID::ReadDIDID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::ReadDIDRequest>()
+ : factory.GetCreator<commands::ReadDIDResponse>();
+ case mobile_apis::FunctionID::GetDTCsID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::GetDTCsRequest>()
+ : factory.GetCreator<commands::GetDTCsResponse>();
+ case mobile_apis::FunctionID::DiagnosticMessageID:
+ return mobile_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::DiagnosticMessageRequest>()
+ : factory.GetCreator<commands::DiagnosticMessageResponse>();
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id);
+ return factory.GetCreator<app_mngr::InvalidCommand>();
+ }
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
new file mode 100644
index 0000000000..d0bcc36ab4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
@@ -0,0 +1,167 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+#include "vehicle_info_plugin/vehicle_info_command_factory.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message_helper.h"
+
+namespace vehicle_info_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
+
+namespace strings = application_manager::strings;
+
+VehicleInfoPlugin::VehicleInfoPlugin() : application_manager_(nullptr) {}
+
+bool VehicleInfoPlugin::Init(
+ application_manager::ApplicationManager& app_manager,
+ application_manager::rpc_service::RPCService& rpc_service,
+ application_manager::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler) {
+ application_manager_ = &app_manager;
+ command_factory_.reset(new vehicle_info_plugin::VehicleInfoCommandFactory(
+ app_manager, rpc_service, hmi_capabilities, policy_handler));
+ return true;
+}
+
+bool VehicleInfoPlugin::IsAbleToProcess(
+ const int32_t function_id, const commands::Command::CommandSource source) {
+ return command_factory_->IsAbleToProcess(function_id, source);
+}
+
+std::string VehicleInfoPlugin::PluginName() {
+ return "Vehicle Info Plugin";
+}
+
+app_mngr::CommandFactory& VehicleInfoPlugin::GetCommandFactory() {
+ return *command_factory_;
+}
+
+void VehicleInfoPlugin::OnPolicyEvent(plugins::PolicyEvent event) {}
+
+void VehicleInfoPlugin::OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationRegistered == event) {
+ application->AddExtension(
+ std::make_shared<VehicleInfoAppExtension>(*this, *application));
+ } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) {
+ DeleteSubscriptions(application);
+ }
+}
+
+void VehicleInfoPlugin::ProcessResumptionSubscription(
+ application_manager::Application& app, VehicleInfoAppExtension& ext) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app.app_id();
+ const auto& subscriptions = ext.Subscriptions();
+ for (auto& ivi_data : application_manager::MessageHelper::vehicle_data()) {
+ mobile_apis::VehicleDataType::eType type_id = ivi_data.second;
+ if (subscriptions.end() != subscriptions.find(type_id)) {
+ std::string key_name = ivi_data.first;
+ msg_params[key_name] = true;
+ }
+ }
+ smart_objects::SmartObjectSPtr request =
+ application_manager::MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ *application_manager_);
+ (*request)[strings::msg_params] = msg_params;
+ application_manager_->GetRPCService().ManageHMICommand(request);
+}
+
+application_manager::ApplicationSharedPtr FindAppSubscribedToIVI(
+ mobile_apis::VehicleDataType::eType ivi_data,
+ application_manager::ApplicationManager& app_mngr) {
+ auto applications = app_mngr.applications();
+
+ for (auto& app : applications.GetData()) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ if (ext.isSubscribedToVehicleInfo(ivi_data)) {
+ return app;
+ }
+ }
+ return application_manager::ApplicationSharedPtr();
+}
+
+smart_objects::SmartObjectSPtr GetUnsubscribeIVIRequest(
+ int32_t ivi_id, application_manager::ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+
+ auto find_ivi_name = [ivi_id]() {
+ for (auto item : application_manager::MessageHelper::vehicle_data()) {
+ if (ivi_id == item.second) {
+ return item.first;
+ }
+ }
+ return std::string();
+ };
+ std::string key_name = find_ivi_name();
+ DCHECK_OR_RETURN(!key_name.empty(), smart_objects::SmartObjectSPtr());
+ auto msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[key_name] = true;
+
+ auto message = application_manager::MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData;
+
+ object[strings::msg_params] = msg_params;
+ return message;
+}
+
+void VehicleInfoPlugin::DeleteSubscriptions(
+ application_manager::ApplicationSharedPtr app) {
+ auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
+ auto subscriptions = ext.Subscriptions();
+ for (auto& ivi : subscriptions) {
+ ext.unsubscribeFromVehicleInfo(ivi);
+ auto still_subscribed_app =
+ FindAppSubscribedToIVI(ivi, *application_manager_);
+ if (!still_subscribed_app) {
+ auto message = GetUnsubscribeIVIRequest(ivi, *application_manager_);
+ application_manager_->GetRPCService().ManageHMICommand(message);
+ }
+ }
+}
+}
+
+extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
+ return new vehicle_info_plugin::VehicleInfoPlugin();
+}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
new file mode 100644
index 0000000000..3ea4a50a8a
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/CMakeLists.txt
@@ -0,0 +1,64 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the copyright holders nor the names of their contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/vehicle_info_plugin/include
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+)
+
+
+set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/mobile/*
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMPONENTS_DIR}/application_manager/src/event_engine/*
+)
+
+set(LIBRARIES
+ gmock
+ Utils
+ SmartObjects
+ HMI_API
+ MOBILE_API
+ connectionHandler
+ vehicle_info_plugin
+ jsoncpp
+)
+
+create_cotired_test("vi_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
new file mode 100644
index 0000000000..0508f0cdd6
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/vi_get_vehicle_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_get_vehicle_data_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::VIGetVehicleDataResponse;
+using am::event_engine::Event;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef std::shared_ptr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class VIGetVehicleDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::response;
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*command_msg);
+
+ EXPECT_CALL(mock_policy_handler_, OnVehicleDataUpdated(*command_msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VIGetVehicleDataResponseTest, ErrorResponse_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::error_response;
+ (*command_msg)[strings::params][strings::data][strings::slider_position] = 1;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*command_msg)[am::strings::params][am::strings::protocol_type] =
+ am::commands::CommandImpl::hmi_protocol_type_;
+ (*command_msg)[strings::params][strings::protocol_version] =
+ am::commands::CommandImpl::protocol_version_;
+
+ smart_objects::SmartObject result(smart_objects::SmartType_Map);
+ result[strings::msg_params] = (*command_msg)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*command_msg)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*command_msg)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*command_msg)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*command_msg)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*command_msg)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*command_msg)[strings::params][strings::protocol_version];
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(result);
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vi_get_vehicle_data_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
new file mode 100644
index 0000000000..d4477d5d5f
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi/vi_is_ready_request.h"
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::VIIsReadyRequest;
+using am::event_engine::Event;
+
+typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr;
+
+class VIIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ VIIsReadyRequestTest() : command_(CreateCommand<VIIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_vi_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_ivi_cooperating(is_vi_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ SetInterfaceState(
+ am::HmiInterfaces::HMI_INTERFACE_VehicleInfo, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_policy_handler_, OnVIIsReady());
+
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VehicleInfo))
+ .WillOnce(Return(state));
+
+ if (is_send_message_to_hmi) {
+ ExpectSendMessagesToHMI();
+ }
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr ivi_type;
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
+ .WillOnce(Return(ivi_type));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_vi_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_vi_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ VIIsReadyRequestPtr command_;
+};
+
+TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_vi_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_vi_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_vi_cooperating_available);
+ SetUpExpectations(is_vi_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace vi_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
new file mode 100644
index 0000000000..9cdf60b1ea
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace diagnostic_message_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::DiagnosticMessageRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kDiagnosticMode = 5u;
+} // namespace
+
+class DiagnosticMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DiagnosticMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_NotSupportedDiagnosticMode_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ const std::vector<uint32_t> empty_supported_diag_modes;
+ EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillOnce(ReturnRef(empty_supported_diag_modes));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::message_data][0] =
+ kDiagnosticMode;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ std::vector<uint32_t> supported_diag_modes;
+ supported_diag_modes.push_back(kDiagnosticMode);
+
+ EXPECT_CALL(app_mngr_settings_, supported_diag_modes())
+ .WillOnce(ReturnRef(supported_diag_modes));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage)));
+
+ command->Run();
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+
+ MessageSharedPtr event_message(CreateMessage(smart_objects::SmartType_Map));
+ (*event_message)[am::strings::msg_params] = 0;
+ (*event_message)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ event.set_smart_object(*event_message);
+
+ DiagnosticMessageRequestPtr command(
+ CreateCommand<DiagnosticMessageRequest>());
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->on_event(event);
+}
+
+} // namespace diagnostic_message_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
new file mode 100644
index 0000000000..4473a36c63
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/get_dtcs_request.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_dtcs_request {
+
+using ::testing::_;
+using ::testing::Return;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetDTCsRequest;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+using testing::Mock;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr;
+
+class GetDTCsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetDTCsRequestTest() : CommandRequestTest<CommandsTestMocks::kIsNice>() {}
+};
+
+TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, Run_SUCCESS) {
+ const uint32_t kConnectionKey = 2u;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::dtc_mask] = 0;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs)));
+
+ command->Run();
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
+ command->on_event(event);
+}
+
+} // namespace get_dtcs_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..a88d362968
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "mobile/get_vehicle_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_vehicle_data_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::GetVehicleDataRequest;
+using am::event_engine::Event;
+namespace mobile_result = mobile_apis::Result;
+
+typedef std::shared_ptr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetVehicleDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
+ public:
+ UnwrappedGetVehicleDataRequest(const MessageSharedPtr& message,
+ am::ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : GetVehicleDataRequest(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+ policy::RPCParams& get_disallowed_params() {
+ return removed_parameters_permissions_.disallowed_params;
+ }
+
+ using GetVehicleDataRequest::on_event;
+};
+
+TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>());
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_TooHighFrequency_UNSUCCESS) {
+ const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::GetVehicleDataID;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ *app,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::CONFIG_FILE))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::REJECTED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_EmptyMsgParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(kEmptyVehicleData));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest,
+ Run_EmptyMsgParamsAndHasDisallowedParams_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ const am::VehicleData kEmptyVehicleData;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillRepeatedly(ReturnRef(kEmptyVehicleData));
+
+ policy::RPCParams& disallowed_params = command->get_disallowed_params();
+ disallowed_params.insert("test_param");
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::DISALLOWED), _));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
+ const std::string kMsgParamKey("test_key");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ GetVehicleDataRequestPtr command(
+ CreateCommand<GetVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMsgParamKey, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData)));
+
+ command->Run();
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::DATA_NOT_AVAILABLE;
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
+ CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*event_msg)[am::strings::msg_params][am::hmi_response::method] = 0;
+
+ Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ command->on_event(event);
+}
+
+} // namespace get_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..1e8a289637
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+
+#include "gtest/gtest.h"
+#include "mobile/on_vehicle_data_notification.h"
+
+#include "utils/custom_string.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "utils/helpers.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace on_vehicle_data_notification {
+
+namespace am = ::application_manager;
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using am::commands::MessageSharedPtr;
+using vehicle_info_plugin::commands::OnVehicleDataNotification;
+
+typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr;
+
+namespace {
+const uint32_t kAppId = 1u;
+} // namespace
+
+class OnVehicleDataNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ OnVehicleDataNotificationTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
+
+ MessageSharedPtr command_msg_;
+ NotificationPtr command_;
+};
+
+MATCHER_P2(CheckMessageData, key, value, "") {
+ const bool kIsMobileProtocolTypeCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
+ am::commands::CommandImpl::mobile_protocol_type_;
+
+ const bool kIsProtocolVersionCorrect =
+ (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
+ am::commands::CommandImpl::protocol_version_;
+
+ const bool kIsNotificationCorrect =
+ (*arg)[am::strings::params][am::strings::message_type].asInt() ==
+ am::MessageType::kNotification;
+
+ const bool kIsConnectionKeyCorrect =
+ (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
+ kAppId;
+
+ const bool kAreMsgParamsCorrect =
+ (*arg)[am::strings::msg_params][key].asInt() == value;
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ kIsMobileProtocolTypeCorrect,
+ kIsProtocolVersionCorrect,
+ kIsNotificationCorrect,
+ kIsConnectionKeyCorrect,
+ kAreMsgParamsCorrect);
+}
+
+} // namespace on_vehicle_data_notification
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
new file mode 100644
index 0000000000..c0a07fb57c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+#include "vehicle_info_plugin/commands/mobile/read_did_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace read_did_request {
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::Return;
+using ::testing::SaveArg;
+namespace am = ::application_manager;
+using vehicle_info_plugin::commands::ReadDIDRequest;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+class ReadDIDRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::VehicleInfo_ReadDID);
+
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_apis::Result::eType mobile_response_code =
+ mobile_apis::Result::SUCCESS;
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
+ (*event_msg)[am::strings::msg_params] = 0;
+
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ command->on_event(event);
+}
+
+TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(true));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
+ MockAppPtr app(CreateMockApp());
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0;
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
+ ON_CALL(*app, AreCommandLimitsExceeded(_, _)).WillByDefault(Return(false));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
+ EXPECT_EQ(hmi_apis::FunctionID::VehicleInfo_ReadDID,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+}
+
+} // namespace read_did_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
new file mode 100644
index 0000000000..323334de2d
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -0,0 +1,301 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "mobile/unsubscribe_vehicle_data_request.h"
+#include "vehicle_info_plugin/vehicle_info_plugin.h"
+#include "vehicle_info_plugin/vehicle_info_app_extension.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest;
+using am::commands::MessageSharedPtr;
+
+typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kMsgParamKey = "test_key";
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED;
+} // namespace
+
+class UnsubscribeVehicleRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UnsubscribeVehicleRequestTest()
+ : mock_app_(CreateMockApp())
+ , vi_app_extension_ptr_(
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ vi_plugin_, *mock_app_))
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+
+ protected:
+ void UnsubscribeSuccessfully();
+ void SetUp() OVERRIDE {
+ vi_plugin_.Init(app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
+ ON_CALL(*mock_app_, AddExtension(vi_app_extension_ptr_));
+ vi_plugin_.OnApplicationEvent(application_manager::plugin_manager::
+ ApplicationEvent::kApplicationRegistered,
+ mock_app_);
+ ON_CALL(*mock_app_,
+ QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension::
+ VehicleInfoAppExtensionUID))
+ .WillByDefault(Return(vi_app_extension_ptr_));
+ }
+
+ MockAppPtr mock_app_;
+ application_manager::AppExtensionPtr vi_app_extension_ptr_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
+ vehicle_info_plugin::VehicleInfoPlugin vi_plugin_;
+};
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) {
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>());
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_DataToUnsubscribeIsNotExisted_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ kVehicleType;
+
+ am::VehicleData data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data()).WillOnce(ReturnRef(data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeFromSubscribedBeforeData_RequestSuccessfullySentToHmi) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData)))
+ .WillOnce(Return(true));
+ vehicle_info_plugin::VehicleInfoAppExtension* vi_app_extension =
+ dynamic_cast<vehicle_info_plugin::VehicleInfoAppExtension*>(
+ vi_app_extension_ptr_.get());
+ ASSERT_TRUE(vi_app_extension->subscribeToVehicleInfo(kVehicleType));
+ application_manager::ApplicationSet app_set = {mock_app_};
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_ptr_);
+ // Expectations
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_EmptyVehicleData_INVALID_DATA_SentToMobile) {
+ am::VehicleData vehicle_data;
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = false;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest,
+ Run_UnsubscribeFromNotSubscribedBeforeData_UNSUCCESS) {
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeDataDisabled_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ am::VehicleData vehicle_data;
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ am::VehicleData vehicle_data;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
+ .WillOnce(ReturnRef(vehicle_data));
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ command->Init();
+ command->Run();
+
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kMsgParamKey] = true;
+ test_event.set_smart_object(message);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ command->on_event(test_event);
+}
+
+TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ am::event_engine::Event test_event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
+ SmartObject message(smart_objects::SmartType_Map);
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+ message[am::strings::params][am::hmi_response::code] = hmi_result;
+ message[am::strings::msg_params][kMsgParamKey] = true;
+ test_event.set_smart_object(message);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command->on_event(test_event);
+}
+
+} // namespace unsubscribe_vehicle_data_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
new file mode 100644
index 0000000000..a0d4699de8
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "mobile/unsubscribe_vehicle_data_response.h"
+#include <stdint.h>
+#include <string>
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_response {
+
+namespace commands = ::application_manager::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+
+using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse;
+using commands::MessageSharedPtr;
+namespace am = ::application_manager;
+
+class UnsubscribeVehicleResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(ResultCodeIs, result_code, "") {
+ return result_code ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendFalseResponseToMobile_SendInvalidEnum) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = false;
+
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::INVALID_ENUM), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendSuccessfulResponseToMobile_SUCCESS) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ SendMessageToMobile(ResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command->Run();
+}
+
+TEST_F(UnsubscribeVehicleResponseTest,
+ Run_SendResponseToMobile_SendCodeToMobile) {
+ MessageSharedPtr command_msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*command_msg)[am::strings::msg_params][am::strings::success] = true;
+
+ mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
+ (*command_msg)[am::strings::msg_params][am::strings::result_code] =
+ result_type;
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
+ CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
+
+ command->Run();
+}
+
+} // namespace unsubscribe_vehicle_data_response
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
index 481635d8e6..8df3d436bd 100644
--- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
@@ -38,7 +38,6 @@
#include "connection_handler/connection_handler.h"
#include "application_manager/application.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -60,7 +59,7 @@ void AppLaunchCtrlImpl::OnAppRegistered(
const application_manager::Application& app) {
LOG4CXX_AUTO_TRACE(logger_);
// TODO (AKutsan) : get device mac
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
app.policy_app_id(), app.bundle_id(), app.mac_address());
apps_launcher_.OnLaunched(app_data);
app_launch_data_.AddApplicationData(*app_data);
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
index f3adfc749b..393b01c952 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
@@ -37,7 +37,6 @@
#include "application_manager/app_launch/app_launch_sql_queries.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/message_helper.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -276,7 +275,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataDB::GetAppDataByDevMac(
const std::string device_mac = query.GetString(device_mac_index);
const std::string mobile_app_id = query.GetString(application_id_index);
const std::string bundle_id = query.GetString(bundle_id_index);
- dev_apps.push_back(utils::MakeShared<ApplicationData>(
+ dev_apps.push_back(std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac));
} while (query.Next());
LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded");
@@ -384,7 +383,7 @@ bool AppLaunchDataDB::WriteDb() {
utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
#ifdef __QNX__
- std::auto_ptr<utils::dbms::SQLDatabase> db_qnx(
+ std::unique_ptr<utils::dbms::SQLDatabase> db_qnx(
new utils::dbms::SQLDatabase(kDatabaseName));
db_qnx.get()->Open();
return db_qnx.get();
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
index 7599dcccb3..d3e3b7d445 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -33,7 +33,7 @@
#include "application_manager/app_launch/app_launch_data_json.h"
#include "application_manager/smart_object_keys.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "utils/date_time.h"
#include "json/json.h"
@@ -43,9 +43,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
AppLaunchDataJson::AppLaunchDataJson(const AppLaunchSettings& settings,
resumption::LastState& last_state)
- : AppLaunchDataImpl(settings)
- , app_launch_json_lock_(true)
- , last_state_(last_state) {}
+ : AppLaunchDataImpl(settings), last_state_(last_state) {}
AppLaunchDataJson::~AppLaunchDataJson() {}
@@ -133,7 +131,7 @@ bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) {
if (index != NotFound) {
if (json_data_list.empty() == false) {
json_data_list[index][strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
retVal = true;
}
}
@@ -152,7 +150,7 @@ bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) {
json_app_data[strings::app_id] = app_data.mobile_app_id_;
json_app_data[strings::bundle_id] = app_data.bundle_id_;
json_app_data[strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
LOG4CXX_DEBUG(logger_,
"New application data saved. Detatils device_id: "
@@ -185,7 +183,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac(
if (deviceMac == dev_mac) {
dev_apps.push_back(
- utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac));
+ std::make_shared<ApplicationData>(appID, bundleID, deviceMac));
}
}
}
diff --git a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
index 950bcd44fa..cc4765e6c9 100644
--- a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
@@ -36,7 +36,7 @@ namespace app_launch {
const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `app_launch`( "
" `deviceMac` TEXT, "
- " `appID` TEXT,"
+ " `appID` TEXT collate nocase,"
" `bundleID` TEXT,"
" `last_session` DATETIME, "
" PRIMARY KEY(`deviceMac`, `appID`, `bundleID`)"
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
index 41465ae985..f3851482c1 100644
--- a/src/components/application_manager/src/app_launch/apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -1,6 +1,6 @@
#include <algorithm>
#include "application_manager/app_launch/apps_launcher.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -15,7 +15,7 @@ struct LauncherGenerator {
, app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
, app_launch_retry_wait_time_(app_launch_retry_wait_time) {}
AppsLauncher::LauncherPtr operator()() {
- return utils::MakeShared<AppsLauncher::Launcher>(
+ return std::make_shared<AppsLauncher::Launcher>(
apps_laucnher_,
connection_handler_,
app_launch_max_retry_attempt_,
@@ -95,7 +95,8 @@ AppsLauncher::Launcher::Launcher(
connection_handler::ConnectionHandler& connection_handler,
const uint16_t app_launch_max_retry_attempt,
const uint16_t app_launch_retry_wait_time)
- : retry_timer_(
+ : retry_index_(0)
+ , retry_timer_(
"AppsLauncherTimer",
new timer::TimerTaskImpl<Launcher>(this, &Launcher::LaunchNow))
, app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
index 0eb9245cf8..a4468d87bc 100644
--- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -6,8 +6,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch/apps_launcher.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -16,7 +15,7 @@ namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice;
-typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr;
+typedef std::shared_ptr<AppsOnDevice> AppsOnDevicePtr;
class Launcher {
public:
@@ -61,7 +60,7 @@ class Launcher {
} else {
LOG4CXX_DEBUG(logger_,
"All Apps on " << apps_on_device_->first
- << " posponed launched");
+ << " postponed launched");
device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
}
}
@@ -95,7 +94,7 @@ class Launcher {
AppsOnDevicePtr apps_on_device_;
};
-typedef utils::SharedPtr<Launcher> LauncherPtr;
+typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> Launchers;
struct LauncherGenerator {
@@ -107,8 +106,7 @@ struct LauncherGenerator {
, apps_launcher_(apps_launcher) {}
LauncherPtr operator()() const {
- return utils::MakeShared<Launcher>(
- resume_ctrl_, interface_, apps_launcher_);
+ return std::make_shared<Launcher>(resume_ctrl_, interface_, apps_launcher_);
}
resumption::ResumeCtrl& resume_ctrl_;
@@ -116,71 +114,59 @@ struct LauncherGenerator {
AppsLauncher& apps_launcher_;
};
-class DeviceAppsLauncherImpl {
- public:
- DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
- AppsLauncher& apps_launcher)
- : interface_(interface) {
- sync_primitives::AutoLock lock(launchers_lock_);
- LauncherGenerator generate(
- interface.app_mngr_.resume_controller(), interface, apps_launcher);
- free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
- std::generate_n(std::back_inserter(free_launchers_),
- interface.settings_.max_number_of_ios_device(),
- generate);
- }
-
- bool LaunchAppsOnDevice(
- const std::string& device_mac,
- const std::vector<ApplicationDataPtr>& applications_to_launch) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "On Device " << device_mac << " will be launched "
- << applications_to_launch.size() << " apps");
- AppsOnDevicePtr apps_on_device =
- utils::MakeShared<AppsOnDevice>(device_mac, applications_to_launch);
- sync_primitives::AutoLock lock(launchers_lock_);
- DCHECK_OR_RETURN(!free_launchers_.empty(), false)
- const Launchers::iterator it = free_launchers_.begin();
- LauncherPtr launcher = *it;
- works_launchers_.push_back(launcher);
- free_launchers_.erase(it);
- launcher->Start(apps_on_device);
- return true;
- }
+// DeviceAppsLauncherImpl member function definitions
+DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : interface_(interface) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ LauncherGenerator generate(
+ interface.app_mngr_.resume_controller(), interface, apps_launcher);
+ free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
+ std::generate_n(std::back_inserter(free_launchers_),
+ interface.settings_.max_number_of_ios_device(),
+ generate);
+}
- struct LauncherFinder {
- LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+bool DeviceAppsLauncherImpl::LauncherFinder::operator()(
+ const std::shared_ptr<Launcher>& launcher) const {
+ return device_mac_ == launcher->apps_on_device_->first;
+}
- bool operator()(const LauncherPtr& launcher) const {
- return device_mac_ == launcher->apps_on_device_->first;
- }
+bool DeviceAppsLauncherImpl::LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "On Device " << device_mac << " will be launched "
+ << applications_to_launch.size() << " apps");
+ AppsOnDevicePtr apps_on_device =
+ std::make_shared<AppsOnDevice>(device_mac, applications_to_launch);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ DCHECK_OR_RETURN(!free_launchers_.empty(), false)
+ const Launchers::iterator it = free_launchers_.begin();
+ LauncherPtr launcher = *it;
+ works_launchers_.push_back(launcher);
+ free_launchers_.erase(it);
+ launcher->Start(apps_on_device);
+ return true;
+}
- std::string device_mac_;
- };
-
- bool StopLaunchingAppsOnDevice(const std::string& device_mac) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(launchers_lock_);
- const Launchers::iterator it = std::find_if(works_launchers_.begin(),
- works_launchers_.end(),
- LauncherFinder(device_mac));
- if (it == works_launchers_.end()) {
- return false;
- }
- LauncherPtr launcher = *it;
- launcher->Clear();
- free_launchers_.push_back(launcher);
- works_launchers_.erase(it);
- return true;
+bool DeviceAppsLauncherImpl::StopLaunchingAppsOnDevice(
+ const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const Launchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ LauncherFinder(device_mac));
+ if (it == works_launchers_.end()) {
+ return false;
}
-
- private:
- sync_primitives::Lock launchers_lock_;
- Launchers free_launchers_;
- Launchers works_launchers_;
- DeviceAppsLauncher& interface_;
-};
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ return true;
+}
bool DeviceAppsLauncher::LaunchAppsOnDevice(
const std::string& device_mac,
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index a81540708c..0636748977 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -44,6 +44,7 @@ InitialApplicationDataImpl::InitialApplicationDataImpl()
, vr_synonyms_(NULL)
, tts_name_(NULL)
, ngn_media_screen_name_(NULL)
+
, language_(mobile_api::Language::INVALID_ENUM)
, ui_language_(mobile_api::Language::INVALID_ENUM) {}
@@ -102,6 +103,10 @@ const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language()
return ui_language_;
}
+const utils::SemanticVersion& InitialApplicationDataImpl::msg_version() const {
+ return msg_version_;
+}
+
void InitialApplicationDataImpl::set_app_types(
const smart_objects::SmartObject& app_types) {
if (app_types_) {
@@ -152,6 +157,11 @@ void InitialApplicationDataImpl::set_ui_language(
ui_language_ = ui_language;
}
+void InitialApplicationDataImpl::set_msg_version(
+ const utils::SemanticVersion& version) {
+ msg_version_ = version;
+}
+
void InitialApplicationDataImpl::set_perform_interaction_layout(
mobile_apis::LayoutMode::eType layout) {
perform_interaction_layout_ = layout;
@@ -173,12 +183,18 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, menu_title_(NULL)
, menu_icon_(NULL)
, tbt_show_command_(NULL)
+ , day_color_scheme_(NULL)
+ , night_color_scheme_(NULL)
+ , display_layout_("")
, commands_()
- , commands_lock_(true)
+ , commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, sub_menu_()
+ , sub_menu_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, choice_set_map_()
+ , choice_set_map_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, performinteraction_choice_set_map_()
- , performinteraction_choice_set_lock_(true)
+ , performinteraction_choice_set_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, is_perform_interaction_active_(false)
, is_reset_global_properties_active_(false)
, perform_interaction_mode_(-1) {}
@@ -214,6 +230,16 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
tbt_show_command_ = NULL;
}
+ if (day_color_scheme_) {
+ delete day_color_scheme_;
+ day_color_scheme_ = NULL;
+ }
+
+ if (night_color_scheme_) {
+ delete night_color_scheme_;
+ night_color_scheme_ = NULL;
+ }
+
for (CommandsMap::iterator command_it = commands_.begin();
commands_.end() != command_it;
++command_it) {
@@ -290,6 +316,20 @@ const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon()
return menu_icon_;
}
+const smart_objects::SmartObject* DynamicApplicationDataImpl::day_color_scheme()
+ const {
+ return day_color_scheme_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::night_color_scheme() const {
+ return night_color_scheme_;
+}
+
+const std::string& DynamicApplicationDataImpl::display_layout() const {
+ return display_layout_;
+}
+
void DynamicApplicationDataImpl::load_global_properties(
const smart_objects::SmartObject& properties_so) {
SetGlobalProperties(properties_so.getElement(strings::vr_help_title),
@@ -405,10 +445,32 @@ void DynamicApplicationDataImpl::set_menu_icon(
menu_icon_ = new smart_objects::SmartObject(menu_icon);
}
+void DynamicApplicationDataImpl::set_day_color_scheme(
+ const smart_objects::SmartObject& color_scheme) {
+ if (day_color_scheme_) {
+ delete day_color_scheme_;
+ }
+
+ day_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+}
+
+void DynamicApplicationDataImpl::set_night_color_scheme(
+ const smart_objects::SmartObject& color_scheme) {
+ if (night_color_scheme_) {
+ delete night_color_scheme_;
+ }
+
+ night_color_scheme_ = new smart_objects::SmartObject(color_scheme);
+}
+
+void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) {
+ display_layout_ = layout;
+}
+
void DynamicApplicationDataImpl::SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject&)) {
smart_objects::SmartType so_type = param.getType();
if (so_type != smart_objects::SmartType::SmartType_Invalid &&
so_type != smart_objects::SmartType::SmartType_Null) {
@@ -422,7 +484,7 @@ void DynamicApplicationDataImpl::SetGlobalProperties(
void DynamicApplicationDataImpl::AddCommand(
uint32_t cmd_id, const smart_objects::SmartObject& command) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (commands_.end() == it) {
commands_[cmd_id] = new smart_objects::SmartObject(command);
@@ -430,7 +492,7 @@ void DynamicApplicationDataImpl::AddCommand(
}
void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::iterator it = commands_.find(cmd_id);
if (commands_.end() != it) {
delete it->second;
@@ -440,7 +502,7 @@ void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
uint32_t cmd_id) {
- sync_primitives::AutoLock lock(commands_lock_);
+ sync_primitives::AutoLock lock(commands_lock_ptr_);
CommandsMap::const_iterator it = commands_.find(cmd_id);
if (it != commands_.end()) {
return it->second;
@@ -452,7 +514,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
// TODO(VS): Create common functions for processing collections
void DynamicApplicationDataImpl::AddSubMenu(
uint32_t menu_id, const smart_objects::SmartObject& menu) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() == it) {
sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
@@ -460,7 +522,7 @@ void DynamicApplicationDataImpl::AddSubMenu(
}
void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::iterator it = sub_menu_.find(menu_id);
if (sub_menu_.end() != it) {
@@ -471,7 +533,7 @@ void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
uint32_t menu_id) const {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
if (it != sub_menu_.end()) {
return it->second;
@@ -482,7 +544,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
const std::string& name) {
- sync_primitives::AutoLock lock(sub_menu_lock_);
+ sync_primitives::AutoLock lock(sub_menu_lock_ptr_);
for (SubMenuMap::iterator it = sub_menu_.begin(); sub_menu_.end() != it;
++it) {
smart_objects::SmartObject* menu = it->second;
@@ -495,7 +557,7 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
void DynamicApplicationDataImpl::AddChoiceSet(
uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() == it) {
choice_set_map_[choice_set_id] = new smart_objects::SmartObject(choice_set);
@@ -503,7 +565,7 @@ void DynamicApplicationDataImpl::AddChoiceSet(
}
void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::iterator it = choice_set_map_.find(choice_set_id);
if (choice_set_map_.end() != it) {
@@ -514,7 +576,7 @@ void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
uint32_t choice_set_id) {
- sync_primitives::AutoLock lock(choice_set_map_lock_);
+ sync_primitives::AutoLock lock(choice_set_map_lock_ptr_);
ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
if (it != choice_set_map_.end()) {
return it->second;
@@ -527,14 +589,14 @@ void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet(
uint32_t correlation_id,
uint32_t choice_set_id,
const smart_objects::SmartObject& vr_commands) {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
+ sync_primitives::AutoLock lock(performinteraction_choice_set_lock_ptr_);
performinteraction_choice_set_map_[correlation_id].insert(std::make_pair(
choice_set_id, new smart_objects::SmartObject(vr_commands)));
}
void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSet(
uint32_t correlation_id) {
- sync_primitives::AutoLock lock(performinteraction_choice_set_lock_);
+ sync_primitives::AutoLock lock(performinteraction_choice_set_lock_ptr_);
PerformChoice::iterator it =
performinteraction_choice_set_map_[correlation_id].begin();
for (; performinteraction_choice_set_map_[correlation_id].end() != it; ++it) {
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 5f9c4386f5..8a611195c7 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,11 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/gen_hash.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/resumption/resume_ctrl.h"
+#include "transport_manager/common.h"
namespace {
@@ -69,18 +71,32 @@ mobile_apis::FileType::eType StringToFileType(const char* str) {
return mobile_apis::FileType::BINARY;
}
}
-}
+} // namespace
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace application_manager {
+void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::shared_ptr<ApplicationImpl> application =
+ std::dynamic_pointer_cast<ApplicationImpl>(app);
+ DCHECK_OR_RETURN_VOID(application);
+ application->app_id_ = app_id;
+ application->device_id_ = device_id;
+ application->mac_address_ = mac_address;
+}
+
ApplicationImpl::ApplicationImpl(
uint32_t application_id,
const std::string& mobile_app_id,
const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager)
: grammar_id_(0)
, hmi_app_id_(0)
@@ -88,6 +104,8 @@ ApplicationImpl::ApplicationImpl(
, active_message_(NULL)
, is_media_(false)
, is_navi_(false)
+ , is_remote_control_supported_(false)
+ , mobile_projection_enabled_(false)
, video_streaming_approved_(false)
, audio_streaming_approved_(false)
, video_streaming_allowed_(false)
@@ -98,17 +116,23 @@ ApplicationImpl::ApplicationImpl(
, has_been_activated_(false)
, tts_properties_in_none_(false)
, tts_properties_in_full_(false)
+ , keep_context_(false)
, is_foreground_(false)
, is_application_data_changed_(false)
, put_file_in_none_count_(0)
, delete_file_in_none_count_(0)
, list_files_in_none_count_(0)
- , device_(0)
, mac_address_(mac_address)
+ , device_id_(device_id)
+ , secondary_device_id_(0)
, usage_report_(mobile_app_id, statistics_manager)
- , protocol_version_(ProtocolVersion::kV3)
+ , help_prompt_manager_impl_(*this, application_manager)
+ , protocol_version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)
, is_voice_communication_application_(false)
, is_resuming_(false)
+ , deferred_resumption_hmi_level_(mobile_api::HMILevel::eType::INVALID_ENUM)
+ , is_hash_changed_during_suspend_(false)
, video_stream_retry_number_(0)
, audio_stream_retry_number_(0)
, video_stream_suspend_timer_(
@@ -119,11 +143,13 @@ ApplicationImpl::ApplicationImpl(
"AudioStreamSuspend",
new ::timer::TimerTaskImpl<ApplicationImpl>(
this, &ApplicationImpl::OnAudioStreamSuspend))
+ , vi_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , button_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, application_manager_(application_manager) {
cmd_number_to_time_limits_[mobile_apis::FunctionID::ReadDIDID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
set_mobile_app_id(mobile_app_id);
set_name(app_name);
@@ -133,12 +159,6 @@ ApplicationImpl::ApplicationImpl(
SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
// load persistent files
LoadPersistentFiles();
- HmiStatePtr initial_state = application_manager_.CreateRegularState(
- app_id(),
- mobile_apis::HMILevel::INVALID_ENUM,
- mobile_apis::AudioStreamingState::INVALID_ENUM,
- mobile_api::SystemContext::SYSCTXT_MAIN);
- state_.InitState(initial_state);
video_stream_suspend_timeout_ =
application_manager_.get_settings().video_data_stopped_timeout();
@@ -154,7 +174,6 @@ ApplicationImpl::~ApplicationImpl() {
}
subscribed_buttons_.clear();
- subscribed_vehicle_info_.clear();
if (is_perform_interaction_active()) {
set_perform_interaction_active(0);
set_perform_interaction_mode(-1);
@@ -179,6 +198,7 @@ bool ApplicationImpl::is_audio() const {
void ApplicationImpl::ChangeSupportingAppHMIType() {
is_navi_ = false;
is_voice_communication_application_ = false;
+ mobile_projection_enabled_ = false;
const smart_objects::SmartObject& array_app_types = *app_types_;
uint32_t lenght_app_types = array_app_types.length();
@@ -193,6 +213,11 @@ void ApplicationImpl::ChangeSupportingAppHMIType() {
array_app_types[i].asUInt())) {
is_voice_communication_application_ = true;
}
+ if (mobile_apis::AppHMIType::PROJECTION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ array_app_types[i].asUInt())) {
+ mobile_projection_enabled_ = true;
+ }
}
}
@@ -200,6 +225,14 @@ void ApplicationImpl::set_is_navi(bool allow) {
is_navi_ = allow;
}
+bool ApplicationImpl::is_remote_control_supported() const {
+ return is_remote_control_supported_;
+}
+
+void ApplicationImpl::set_remote_control_supported(const bool allow) {
+ is_remote_control_supported_ = allow;
+}
+
bool ApplicationImpl::is_voice_communication_supported() const {
return is_voice_communication_application_;
}
@@ -210,7 +243,26 @@ void ApplicationImpl::set_voice_communication_supported(
}
bool ApplicationImpl::IsAudioApplication() const {
- return is_media_ || is_voice_communication_application_ || is_navi_;
+ const bool is_audio_app =
+ is_media_application() || is_voice_communication_supported() || is_navi();
+ LOG4CXX_DEBUG(logger_,
+ std::boolalpha << "is audio app --> ((is_media_app: "
+ << is_media_application() << ")"
+ << " || (is_voice_communication_app: "
+ << is_voice_communication_supported() << ")"
+ << " || (is_navi: " << is_navi() << ")) --> "
+ << is_audio_app);
+ return is_audio_app;
+}
+
+bool ApplicationImpl::IsVideoApplication() const {
+ const bool is_video_app = is_navi() || mobile_projection_enabled();
+ LOG4CXX_DEBUG(logger_,
+ std::boolalpha
+ << "is video app --> ((is_navi: " << is_navi() << ")"
+ << " || (mobile_projection: " << mobile_projection_enabled()
+ << ")) --> " << is_video_app);
+ return is_video_app;
}
void ApplicationImpl::SetRegularState(HmiStatePtr state) {
@@ -228,6 +280,15 @@ void ApplicationImpl::SetPostponedState(HmiStatePtr state) {
state_.AddState(state);
}
+void ApplicationImpl::set_mobile_projection_enabled(bool option) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_projection_enabled_ = option;
+}
+
+bool ApplicationImpl::mobile_projection_enabled() const {
+ return mobile_projection_enabled_;
+}
+
struct StateIDComparator {
HmiState::StateID state_id_;
StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {}
@@ -254,6 +315,13 @@ const HmiStatePtr ApplicationImpl::RegularHmiState() const {
return state_.GetState(HmiState::STATE_ID_REGULAR);
}
+bool ApplicationImpl::IsAllowedToChangeAudioSource() const {
+ if (is_remote_control_supported() && is_media_application()) {
+ return true;
+ }
+ return false;
+}
+
const HmiStatePtr ApplicationImpl::PostponedHmiState() const {
return state_.GetState(HmiState::STATE_ID_POSTPONED);
}
@@ -328,7 +396,11 @@ const std::string& ApplicationImpl::bundle_id() const {
}
connection_handler::DeviceHandle ApplicationImpl::device() const {
- return device_;
+ return device_id_;
+}
+
+connection_handler::DeviceHandle ApplicationImpl::secondary_device() const {
+ return secondary_device_id_;
}
const std::string& ApplicationImpl::mac_address() const {
@@ -367,6 +439,14 @@ bool ApplicationImpl::tts_properties_in_full() {
return tts_properties_in_full_;
}
+void ApplicationImpl::set_keep_context(bool keep_context) {
+ keep_context_ = keep_context;
+}
+
+bool ApplicationImpl::keep_context() {
+ return keep_context_;
+}
+
void ApplicationImpl::set_video_streaming_approved(bool state) {
video_streaming_approved_ = state;
}
@@ -399,6 +479,24 @@ bool ApplicationImpl::audio_streaming_allowed() const {
return audio_streaming_allowed_;
}
+bool ApplicationImpl::SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ServiceType::kMobileNav == service_type) {
+ // See StartStreaming(). We issue SetVideoConfig and StartStream
+ // only when streaming is not approved yet
+ if (!video_streaming_approved()) {
+ LOG4CXX_TRACE(logger_, "Video streaming not approved");
+ MessageHelper::SendNaviSetVideoConfig(
+ app_id(), application_manager_, params);
+ return true;
+ }
+ }
+ return false;
+}
+
void ApplicationImpl::StartStreaming(
protocol_handler::ServiceType service_type) {
using namespace protocol_handler;
@@ -426,6 +524,9 @@ void ApplicationImpl::StopStreamingForce(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // see the comment in StopStreaming()
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav) {
@@ -440,6 +541,12 @@ void ApplicationImpl::StopStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // since WakeUpStreaming() is called from another thread, it is possible that
+ // the stream will be restarted after we call SuspendStreaming() and before
+ // we call StopXxxStreaming(). To avoid such timing issue, make sure that
+ // we run SuspendStreaming() and StopXxxStreaming() atomically.
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav && video_streaming_approved()) {
@@ -490,6 +597,10 @@ void ApplicationImpl::WakeUpStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // See the comment in StopStreaming(). Also, please make sure that we acquire
+ // streaming_stop_lock_ then xxx_streaming_suspended_lock_ in this order!
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
if (ServiceType::kMobileNav == service_type) {
sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
if (video_streaming_suspended_) {
@@ -569,8 +680,9 @@ void ApplicationImpl::set_app_allowed(const bool allowed) {
is_app_allowed_ = allowed;
}
-void ApplicationImpl::set_device(connection_handler::DeviceHandle device) {
- device_ = device;
+void ApplicationImpl::set_secondary_device(
+ connection_handler::DeviceHandle secondary_device) {
+ secondary_device_id_ = secondary_device;
}
uint32_t ApplicationImpl::get_grammar_id() const {
@@ -601,11 +713,12 @@ bool ApplicationImpl::set_activated(bool is_active) {
}
void ApplicationImpl::set_protocol_version(
- const ProtocolVersion& protocol_version) {
+ const protocol_handler::MajorProtocolVersion& protocol_version) {
protocol_version_ = protocol_version;
}
-ProtocolVersion ApplicationImpl::protocol_version() const {
+protocol_handler::MajorProtocolVersion ApplicationImpl::protocol_version()
+ const {
return protocol_version_;
}
@@ -617,6 +730,16 @@ bool ApplicationImpl::is_resuming() const {
return is_resuming_;
}
+void ApplicationImpl::set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) {
+ deferred_resumption_hmi_level_ = level;
+}
+
+mobile_api::HMILevel::eType ApplicationImpl::deferred_resumption_hmi_level()
+ const {
+ return deferred_resumption_hmi_level_;
+}
+
bool ApplicationImpl::AddFile(const AppFile& file) {
if (app_files_.count(file.file_name) == 0) {
LOG4CXX_INFO(logger_,
@@ -664,13 +787,13 @@ const AppFile* ApplicationImpl::GetFile(const std::string& file_name) {
bool ApplicationImpl::SubscribeToButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
return subscribed_buttons_.insert(btn_name).second;
}
bool ApplicationImpl::IsSubscribedToButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
std::set<mobile_apis::ButtonName::eType>::iterator it =
subscribed_buttons_.find(btn_name);
return (subscribed_buttons_.end() != it);
@@ -678,34 +801,21 @@ bool ApplicationImpl::IsSubscribedToButton(
bool ApplicationImpl::UnsubscribeFromButton(
mobile_apis::ButtonName::eType btn_name) {
- sync_primitives::AutoLock lock(button_lock_);
+ sync_primitives::AutoLock lock(button_lock_ptr_);
return subscribed_buttons_.erase(btn_name);
}
-bool ApplicationImpl::SubscribeToIVI(uint32_t vehicle_info_type) {
- sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.insert(vehicle_info_type).second;
-}
-
-bool ApplicationImpl::IsSubscribedToIVI(uint32_t vehicle_info_type) const {
- sync_primitives::AutoLock lock(vi_lock_);
- VehicleInfoSubscriptions::const_iterator it =
- subscribed_vehicle_info_.find(vehicle_info_type);
- return (subscribed_vehicle_info_.end() != it);
-}
-
-bool ApplicationImpl::UnsubscribeFromIVI(uint32_t vehicle_info_type) {
- sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.erase(vehicle_info_type);
-}
-
UsageStatistics& ApplicationImpl::usage_report() {
return usage_report_;
}
+HelpPromptManager& ApplicationImpl::help_prompt_manager() {
+ return help_prompt_manager_impl_;
+}
+
bool ApplicationImpl::AreCommandLimitsExceeded(
mobile_apis::FunctionID::eType cmd_id, TLimitSource source) {
- TimevalStruct current = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current = date_time::getCurrentTime();
switch (source) {
// In case of config file values there is COMMON limitations for number of
// commands per certain time in seconds, i.e. 5 requests per 10 seconds with
@@ -737,13 +847,14 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
LOG4CXX_INFO(logger_,
"Time Info: "
- << "\n Current: " << current.tv_sec << "\n Limit: ("
- << limit.first.tv_sec << "," << limit.second
- << ")"
- "\n frequency_restrictions: ("
+ << "\n Current: " << date_time::getSecs(current)
+ << "\n Limit: (" << date_time::getSecs(limit.first)
+ << "," << limit.second << ")"
+ "\n frequency_restrictions: ("
<< frequency_restrictions.first << ","
<< frequency_restrictions.second << ")");
- if (current.tv_sec < limit.first.tv_sec + frequency_restrictions.second) {
+ if (date_time::getSecs(current) <
+ date_time::getSecs(limit.first) + frequency_restrictions.second) {
if (limit.second < frequency_restrictions.first) {
++limit.second;
return false;
@@ -785,7 +896,8 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
TimeToNumberLimit& limit = it->second;
// Checking even limitation for command
- if (static_cast<uint32_t>(current.tv_sec - limit.first.tv_sec) <
+ if (static_cast<uint32_t>(date_time::getSecs(current) -
+ date_time::getSecs(limit.first)) <
minute / cmd_limit) {
return true;
}
@@ -805,12 +917,8 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
}
DataAccessor<ButtonSubscriptions> ApplicationImpl::SubscribedButtons() const {
- return DataAccessor<ButtonSubscriptions>(subscribed_buttons_, button_lock_);
-}
-
-DataAccessor<VehicleInfoSubscriptions> ApplicationImpl::SubscribedIVI() const {
- return DataAccessor<VehicleInfoSubscriptions>(subscribed_vehicle_info_,
- vi_lock_);
+ return DataAccessor<ButtonSubscriptions>(subscribed_buttons_,
+ button_lock_ptr_);
}
const std::string& ApplicationImpl::curHash() const {
@@ -821,6 +929,10 @@ bool ApplicationImpl::is_application_data_changed() const {
return is_application_data_changed_;
}
+void ApplicationImpl::SetInitialState(HmiStatePtr state) {
+ state_.InitState(state);
+}
+
void ApplicationImpl::set_is_application_data_changed(
bool state_application_data) {
is_application_data_changed_ = state_application_data;
@@ -832,7 +944,19 @@ void ApplicationImpl::UpdateHash() {
utils::gen_hash(application_manager_.get_settings().hash_string_size());
set_is_application_data_changed(true);
- MessageHelper::SendHashUpdateNotification(app_id(), application_manager_);
+ if (!application_manager_.resume_controller().is_suspended()) {
+ MessageHelper::SendHashUpdateNotification(app_id(), application_manager_);
+ } else {
+ is_hash_changed_during_suspend_ = true;
+ }
+}
+
+bool ApplicationImpl::IsHashChangedDuringSuspend() const {
+ return is_hash_changed_during_suspend_;
+}
+
+void ApplicationImpl::SetHashChangedDuringSuspend(const bool state) {
+ is_hash_changed_during_suspend_ = state;
}
void ApplicationImpl::CleanupFiles() {
@@ -972,4 +1096,83 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
}
}
+void ApplicationImpl::set_system_context(
+ const mobile_api::SystemContext::eType& system_context) {
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ hmi_state->set_system_context(system_context);
+}
+
+void ApplicationImpl::set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) {
+ if (!(is_media_application() || is_navi()) &&
+ state != mobile_api::AudioStreamingState::NOT_AUDIBLE) {
+ LOG4CXX_WARN(logger_,
+ "Trying to set audio streaming state"
+ " for non-media application to different from NOT_AUDIBLE");
+ return;
+ }
+ CurrentHmiState()->set_audio_streaming_state(state);
+}
+
+void ApplicationImpl::set_hmi_level(
+ const mobile_api::HMILevel::eType& new_hmi_level) {
+ using namespace mobile_apis;
+ const HMILevel::eType current_hmi_level = hmi_level();
+ if (HMILevel::HMI_NONE != current_hmi_level &&
+ HMILevel::HMI_NONE == new_hmi_level) {
+ put_file_in_none_count_ = 0;
+ delete_file_in_none_count_ = 0;
+ list_files_in_none_count_ = 0;
+ }
+ ApplicationSharedPtr app = application_manager_.application(app_id());
+ DCHECK_OR_RETURN_VOID(app)
+ application_manager_.state_controller().SetRegularState(app, new_hmi_level);
+ LOG4CXX_INFO(logger_, "hmi_level = " << new_hmi_level);
+ usage_report_.RecordHmiStateChanged(new_hmi_level);
+}
+
+AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) {
+ std::list<AppExtensionPtr>::const_iterator it = extensions_.begin();
+ for (; it != extensions_.end(); ++it) {
+ if ((*it)->uid() == uid) {
+ return (*it);
+ }
+ }
+
+ return AppExtensionPtr();
+}
+
+bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
+ if (!QueryInterface(extension->uid())) {
+ extensions_.push_back(extension);
+ return true;
+ }
+ return false;
+}
+
+bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) {
+ auto it = std::find_if(
+ extensions_.begin(),
+ extensions_.end(),
+ [uid](AppExtensionPtr extension) { return extension->uid() == uid; });
+
+ return it != extensions_.end();
+}
+
+const std::list<AppExtensionPtr>& ApplicationImpl::Extensions() const {
+ return extensions_;
+}
+
+void ApplicationImpl::PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) {
+ sync_primitives::AutoLock lock(mobile_message_lock_);
+ mobile_message_queue_.push_back(mobile_message);
+}
+
+void ApplicationImpl::SwapMobileMessageQueue(
+ MobileMessageQueue& mobile_messages) {
+ sync_primitives::AutoLock lock(mobile_message_lock_);
+ mobile_messages.swap(mobile_message_queue_);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 28c8a5677c..24f27af2e2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -36,12 +36,14 @@
#include <string>
#include <fstream>
#include <utility>
+#include <bson_object.h>
#include "application_manager/application_manager_impl.h"
-#include "application_manager/mobile_command_factory.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service_impl.h"
+#include "application_manager/rpc_handler_impl.h"
#include "application_manager/mobile_message_handler.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/hmi_capabilities_impl.h"
@@ -49,17 +51,20 @@
#include "application_manager/app_launch/app_launch_ctrl_impl.h"
#include "application_manager/app_launch/app_launch_data_db.h"
#include "application_manager/app_launch/app_launch_data_json.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
+#include "application_manager/command_holder_impl.h"
#include "connection_handler/connection_handler_impl.h"
#include "formatters/formatter_json_rpc.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "protocol/bson_object_keys.h"
#include "utils/threads/thread.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "utils/timer_task_impl.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API_schema.h"
@@ -73,7 +78,7 @@ namespace {
int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) {
return std::rand() % to + from;
}
-}
+} // namespace
namespace application_manager {
@@ -85,51 +90,82 @@ DeviceTypes devicesType = {
hmi_apis::Common_TransportType::USB_IOS),
std::make_pair(std::string("BLUETOOTH"),
hmi_apis::Common_TransportType::BLUETOOTH),
- std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI)};
+ std::make_pair(std::string("BLUETOOTH_IOS"),
+ hmi_apis::Common_TransportType::BLUETOOTH),
+ std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI),
+ std::make_pair(std::string("USB_IOS_HOST_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("USB_IOS_DEVICE_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("CARPLAY_WIRELESS_IOS"),
+ hmi_apis::Common_TransportType::WIFI)};
+}
+
+/**
+ * @brief device_id_comparator is predicate to compare application device id
+ * @param device_id Device id to compare with
+ * @param app Application pointer
+ * @return True if device id of application matches to device id passed
+ */
+bool device_id_comparator(const std::string& device_id,
+ ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ LOG4CXX_DEBUG(logger_,
+ "Data to compare: device_id : " << device_id << " app mac: "
+ << app->mac_address());
+
+ return device_id == app->mac_address();
+}
+
+/**
+ * @brief policy_app_id_comparator is predicate to compare policy application
+ * ids
+ * @param policy_app_id Policy id of application
+ * @param app Application pointer
+ * @return True if policy id of application matches to policy id passed
+ */
+bool policy_app_id_comparator(const std::string& policy_app_id,
+ ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ return app->policy_app_id() == policy_app_id;
}
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
ApplicationManagerImpl::ApplicationManagerImpl(
const ApplicationManagerSettings& am_settings,
const policy::PolicySettings& policy_settings)
: settings_(am_settings)
- , applications_list_lock_(true)
+ , applications_list_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
+ , apps_to_register_list_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, audio_pass_thru_active_(false)
- , is_distracting_driver_(false)
+ , audio_pass_thru_app_id_(0)
+ , driver_distraction_state_(hmi_apis::Common_DriverDistractionState::DD_OFF)
, is_vr_session_strated_(false)
, hmi_cooperating_(false)
, is_all_apps_allowed_(true)
, media_manager_(NULL)
, hmi_handler_(NULL)
, connection_handler_(NULL)
- , policy_handler_(policy_settings, *this)
+ , policy_handler_(new policy::PolicyHandler(policy_settings, *this))
, protocol_handler_(NULL)
, request_ctrl_(am_settings)
, hmi_so_factory_(NULL)
, mobile_so_factory_(NULL)
- , messages_from_mobile_("AM FromMobile", this)
- , messages_to_mobile_("AM ToMobile", this)
- , messages_from_hmi_("AM FromHMI", this)
- , messages_to_hmi_("AM ToHMI", this)
- , audio_pass_thru_messages_("AudioPassThru", this)
, hmi_capabilities_(new HMICapabilitiesImpl(*this))
, unregister_reason_(
mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM)
, resume_ctrl_(new resumption::ResumeCtrlImpl(*this))
, navi_close_app_timeout_(am_settings.stop_streaming_timeout())
, navi_end_stream_timeout_(am_settings.stop_streaming_timeout())
- , stopping_application_mng_lock_(true)
, state_ctrl_(*this)
-#ifdef TELEMETRY_MONITOR
- , metric_observer_(NULL)
-#endif // TELEMETRY_MONITOR
, application_list_update_timer_(
"AM ListUpdater",
new TimerTaskImpl<ApplicationManagerImpl>(
@@ -139,8 +175,9 @@ ApplicationManagerImpl::ApplicationManagerImpl(
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::OnTimerSendTTSGlobalProperties))
, is_low_voltage_(false)
+ , apps_size_(0)
, is_stopping_(false) {
- std::srand(std::time(0));
+ std::srand(std::time(nullptr));
AddPolicyObserver(this);
dir_type_to_string_map_ = {{TYPE_STORAGE, "Storage"},
@@ -148,13 +185,20 @@ ApplicationManagerImpl::ApplicationManagerImpl(
{TYPE_ICONS, "Icons"}};
sync_primitives::AutoLock lock(timer_pool_lock_);
- TimerSPtr clearing_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr clearing_timer(std::make_shared<timer::Timer>(
"ClearTimerPoolTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::ClearTimerPool)));
const uint32_t timeout_ms = 10000u;
clearing_timer->Start(timeout_ms, timer::kSingleShot);
timer_pool_.push_back(clearing_timer);
+ rpc_handler_.reset(new rpc_handler::RPCHandlerImpl(*this));
+ commands_holder_.reset(new CommandHolderImpl(*this));
+ rpc_service_.reset(new rpc_service::RPCServiceImpl(*this,
+ request_ctrl_,
+ protocol_handler_,
+ hmi_handler_,
+ *commands_holder_));
}
ApplicationManagerImpl::~ApplicationManagerImpl() {
@@ -182,37 +226,13 @@ ApplicationManagerImpl::~ApplicationManagerImpl() {
navi_app_to_stop_.clear();
navi_app_to_end_stream_.clear();
-}
-template <class UnaryPredicate>
-ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor,
- UnaryPredicate finder) {
- ApplicationSet::iterator it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- if (accessor.GetData().end() == it) {
- LOG4CXX_DEBUG(logger_, "Unable to find application");
- return ApplicationSharedPtr();
- }
- ApplicationSharedPtr app = *it;
- LOG4CXX_DEBUG(logger_, " Found Application app_id = " << app->app_id());
- return app;
-}
-
-template <class UnaryPredicate>
-std::vector<ApplicationSharedPtr> FindAllApps(
- DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) {
- std::vector<ApplicationSharedPtr> result;
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- while (it != accessor.GetData().end()) {
- result.push_back(*it);
- it = std::find_if(++it, accessor.GetData().end(), finder);
- }
- return result;
+ secondary_transport_devices_cache_.clear();
}
DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const {
- DataAccessor<ApplicationSet> accessor(applications_, applications_list_lock_);
+ DataAccessor<ApplicationSet> accessor(applications_,
+ applications_list_lock_ptr_);
return accessor;
}
@@ -290,6 +310,29 @@ ApplicationManagerImpl::applications_with_navi() {
DataAccessor<ApplicationSet> accessor = applications();
return FindAllApps(accessor, NaviAppPredicate);
}
+
+bool LimitedMobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? (app->mobile_projection_enabled() &&
+ app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)
+ : false;
+}
+
+ApplicationSharedPtr
+ApplicationManagerImpl::get_limited_mobile_projection_application() const {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindApp(accessor, LimitedMobileProjectionPredicate);
+}
+
+bool MobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? app->mobile_projection_enabled() : false;
+}
+
+std::vector<ApplicationSharedPtr>
+ApplicationManagerImpl::applications_with_mobile_projection() {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindAllApps(accessor, MobileProjectionPredicate);
+}
+
std::vector<ApplicationSharedPtr>
ApplicationManagerImpl::applications_by_button(uint32_t button) {
SubscribedToButtonPredicate finder(
@@ -298,39 +341,45 @@ ApplicationManagerImpl::applications_by_button(uint32_t button) {
return FindAllApps(accessor, finder);
}
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
+struct IsApplication {
+ IsApplication(connection_handler::DeviceHandle device_handle,
+ const std::string& policy_app_id)
+ : device_handle_(device_handle), policy_app_id_(policy_app_id) {}
bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
+ return app && app->device() == device_handle_ &&
+ app->policy_app_id() == policy_app_id_;
}
-};
-std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
- VehicleDataType vehicle_info, int value) {
+ private:
+ connection_handler::DeviceHandle device_handle_;
+ const std::string& policy_app_id_;
+};
+void ApplicationManagerImpl::IviInfoUpdated(
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) {
// Notify Policy Manager if available about info it's interested in,
// i.e. odometer etc
switch (vehicle_info) {
- case ODOMETER:
+ case mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER:
GetPolicyHandler().KmsChanged(value);
break;
default:
break;
}
-
- SubscribedToIVIPredicate finder(static_cast<int32_t>(vehicle_info));
- DataAccessor<ApplicationSet> accessor = applications();
- return FindAllApps(accessor, finder);
}
void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- sync_primitives::AutoLock lock(applications_list_lock_);
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
const mobile_apis::HMILevel::eType default_level = GetDefaultHmiLevel(app);
state_ctrl_.OnApplicationRegistered(app, default_level);
+ std::function<void(plugin_manager::RPCPlugin&)> on_app_registered =
+ [app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationRegistered, app);
+ };
+ plugin_manager_->ForEachPlugin(on_app_registered);
+
// TODO(AOleynik): Is neccessary to be able to know that registration process
// has been completed and default HMI level is set, otherwise policy will
// block all the requests/notifications to mobile
@@ -347,14 +396,22 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
event.raise(event_dispatcher());
}
+void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ commands_holder_->Resume(app, CommandHolder::CommandType::kMobileCommand);
+ commands_holder_->Resume(app, CommandHolder::CommandType::kHmiCommand);
+}
+
bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
ApplicationConstSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
bool navi_state = app->is_navi();
+ bool mobile_projection_state = app->mobile_projection_enabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
- if (active_app.valid()) {
+ if (active_app.use_count() != 0) {
// If checking app hmi level FULL, we return false
// because we couldn't have two applications with same HMIType in FULL and
// LIMITED HMI level
@@ -373,35 +430,47 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
if (navi_state && active_app->is_navi()) {
return true;
}
+
+ if (mobile_projection_state && active_app->mobile_projection_enabled()) {
+ return true;
+ }
}
// Check LIMITED apps
if (voice_state) {
- if (get_limited_voice_application().valid() &&
+ if ((get_limited_voice_application().use_count() != 0) &&
(get_limited_voice_application()->app_id() != app->app_id())) {
return true;
}
}
if (media_state) {
- if (get_limited_media_application().valid() &&
+ if ((get_limited_media_application().use_count() != 0) &&
(get_limited_media_application()->app_id() != app->app_id())) {
return true;
}
}
if (navi_state) {
- if (get_limited_navi_application().valid() &&
+ if ((get_limited_navi_application().use_count() != 0) &&
(get_limited_navi_application()->app_id() != app->app_id())) {
return true;
}
}
+ if (mobile_projection_state) {
+ if ((get_limited_mobile_projection_application().use_count() != 0) &&
+ (get_limited_mobile_projection_application()->app_id() !=
+ app->app_id())) {
+ return true;
+ }
+ }
+
return false;
}
ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
- const utils::SharedPtr<smart_objects::SmartObject>&
+ const std::shared_ptr<smart_objects::SmartObject>&
request_for_registration) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -413,22 +482,37 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
// original app_id can be received via ApplicationImpl::mobile_app_id()
uint32_t app_id = 0;
std::list<int32_t> sessions_list;
- uint32_t device_id = 0;
+ connection_handler::DeviceHandle device_id = 0;
DCHECK_OR_RETURN(connection_handler_, ApplicationSharedPtr());
- if (connection_handler().GetDataOnSessionKey(
+ if (connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, &app_id, &sessions_list, &device_id) == -1) {
LOG4CXX_ERROR(logger_, "Failed to create application: no connection info.");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::GENERIC_ERROR));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
+ smart_objects::SmartObject& params = message[strings::msg_params];
+ const std::string& policy_app_id =
+ GetCorrectMobileIDFromMessage(request_for_registration);
+ const custom_str::CustomString& app_name =
+ message[strings::msg_params][strings::app_name].asCustomString();
+ std::string device_mac;
+ std::string connection_type;
+ if (connection_handler().get_session_observer().GetDataOnDeviceID(
+ device_id, NULL, NULL, &device_mac, &connection_type) == -1) {
+ LOG4CXX_DEBUG(logger_, "Failed to extract device mac for id " << device_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Device mac for id" << device_id << " is " << device_mac);
+ }
+
LOG4CXX_DEBUG(logger_, "Restarting application list update timer");
GetPolicyHandler().OnAppsSearchStarted();
uint32_t timeout = get_settings().application_list_update_timeout();
@@ -437,52 +521,49 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (!is_all_apps_allowed_) {
LOG4CXX_WARN(logger_,
"RegisterApplication: access to app's disabled by user");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::DISALLOWED));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
- smart_objects::SmartObject& params = message[strings::msg_params];
- const std::string& policy_app_id = params[strings::app_id].asString();
- const custom_str::CustomString& app_name =
- message[strings::msg_params][strings::app_name].asCustomString();
- std::string device_mac = "";
- if (connection_handler().get_session_observer().GetDataOnDeviceID(
- device_id, NULL, NULL, &device_mac, NULL) == -1) {
- LOG4CXX_ERROR(logger_, "Failed to extract device mac for id " << device_id);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Device mac for id" << device_id << " is " << device_mac);
- }
ApplicationSharedPtr application(
new ApplicationImpl(app_id,
policy_app_id,
device_mac,
+ device_id,
app_name,
GetPolicyHandler().GetStatisticManager(),
*this));
if (!application) {
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
message[strings::params][strings::correlation_id].asUInt(),
mobile_apis::Result::OUT_OF_MEMORY));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL);
return ApplicationSharedPtr();
}
+ HmiStatePtr initial_state =
+ CreateRegularState(std::shared_ptr<Application>(application),
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_apis::VideoStreamingState::INVALID_ENUM,
+ mobile_api::SystemContext::SYSCTXT_MAIN);
+
+ application->SetInitialState(initial_state);
+
application->set_folder_name(policy_app_id + "_" +
application->mac_address());
// To load persistent files, app folder name must be known first, which is now
// depends on device_id and mobile_app_id
application->LoadPersistentFiles();
- application->set_device(device_id);
application->set_grammar_id(GenerateGrammarID());
mobile_api::Language::eType launguage_desired =
@@ -509,27 +590,30 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
version.max_supported_api_version = static_cast<APIVersion>(max_version);
application->set_version(version);
- ProtocolVersion protocol_version = static_cast<ProtocolVersion>(
- message[strings::params][strings::protocol_version].asInt());
+ protocol_handler::MajorProtocolVersion protocol_version =
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ message[strings::params][strings::protocol_version].asInt());
application->set_protocol_version(protocol_version);
- if (ProtocolVersion::kUnknownProtocol != protocol_version) {
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN !=
+ protocol_version) {
connection_handler().BindProtocolVersionWithSession(
connection_key, static_cast<uint8_t>(protocol_version));
}
- if ((protocol_version == ProtocolVersion::kV3) &&
+ if ((protocol_version ==
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3) &&
(get_settings().heart_beat_timeout() != 0)) {
connection_handler().StartSessionHeartBeat(connection_key);
}
// Keep HMI add id in case app is present in "waiting for registration" list
- apps_to_register_list_lock_.Acquire();
+ apps_to_register_list_lock_ptr_->Acquire();
AppsWaitRegistrationSet::iterator it = apps_to_register_.find(application);
if (apps_to_register_.end() != it) {
application->set_hmi_application_id((*it)->hmi_app_id());
apps_to_register_.erase(application);
}
- apps_to_register_list_lock_.Release();
+ apps_to_register_list_lock_ptr_->Release();
if (!application->hmi_app_id()) {
const bool is_saved =
@@ -545,6 +629,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
const std::string& bundle_id = app_info[strings::bundle_id].asString();
application->set_bundle_id(bundle_id);
}
+
+ const std::string app_icon_dir(settings_.app_icons_folder());
+ const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
+ if (file_system::FileExists(full_icon_path)) {
+ application->set_app_icon_path(full_icon_path);
+ }
+
// Stops timer of saving data to resumption in order to
// doesn't erase data from resumption storage.
// Timer will be started after hmi level resumption.
@@ -553,20 +644,25 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
// Add application to registered app list and set appropriate mark.
// Lock has to be released before adding app to policy DB to avoid possible
// deadlock with simultaneous PTU processing
- applications_list_lock_.Acquire();
+ applications_list_lock_ptr_->Acquire();
application->MarkRegistered();
applications_.insert(application);
- applications_list_lock_.Release();
-
- return application;
-}
+ apps_size_ = applications_.size();
+ applications_list_lock_ptr_->Release();
-bool ApplicationManagerImpl::RemoveAppDataFromHMI(ApplicationSharedPtr app) {
- return true;
-}
+ // It is possible that secondary transport of this app has been already
+ // established. Make sure that the information is reflected to application
+ // instance.
+ // Also, make sure that this is done *after* we updated applications_ list to
+ // avoid timing issues.
+ DeviceMap::iterator itr =
+ secondary_transport_devices_cache_.find(connection_key);
+ if (secondary_transport_devices_cache_.end() != itr) {
+ connection_handler::DeviceHandle secondary_device_handle = itr->second;
+ application->set_secondary_device(secondary_device_handle);
+ }
-bool ApplicationManagerImpl::LoadAppDataToHMI(ApplicationSharedPtr app) {
- return true;
+ return application;
}
bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
@@ -574,13 +670,18 @@ bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(app, false);
+ LOG4CXX_DEBUG(logger_, "Activating application with id:" << app->app_id());
+
// remove from resumption if app was activated by user
resume_controller().OnAppActivated(app);
- HMILevel::eType hmi_level = HMILevel::HMI_FULL;
- AudioStreamingState::eType audio_state;
- app->IsAudioApplication() ? audio_state = AudioStreamingState::AUDIBLE
- : audio_state = AudioStreamingState::NOT_AUDIBLE;
- state_ctrl_.SetRegularState(app, hmi_level, audio_state, false);
+ const HMILevel::eType hmi_level = HMILevel::HMI_FULL;
+ const AudioStreamingState::eType audio_state =
+ app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+ const VideoStreamingState::eType video_state =
+ app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
+ : VideoStreamingState::NOT_STREAMABLE;
+ state_ctrl_.SetRegularState(app, hmi_level, audio_state, video_state, false);
return true;
}
@@ -592,10 +693,10 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed(
NOTREACHED();
return mobile_api::HMILevel::INVALID_ENUM;
}
- bool is_audio_app = app->IsAudioApplication();
- bool does_audio_app_with_same_type_exist =
+ const bool is_audio_app = app->IsAudioApplication();
+ const bool does_audio_app_with_same_type_exist =
IsAppTypeExistsInFullOrLimited(app);
- bool is_active_app_exist = active_application().valid();
+ const bool is_active_app_exist = (active_application().use_count() != 0);
mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
if (is_audio_app && does_audio_app_with_same_type_exist) {
@@ -637,41 +738,46 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_cooperating_ = true;
MessageHelper::SendGetSystemInfoRequest(*this);
- utils::SharedPtr<smart_objects::SmartObject> is_vr_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_vr_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady,
*this));
- ManageHMICommand(is_vr_ready);
+ rpc_service_->ManageHMICommand(is_vr_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_tts_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_tts_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady,
*this));
- ManageHMICommand(is_tts_ready);
+ rpc_service_->ManageHMICommand(is_tts_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ui_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ui_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady,
*this));
- ManageHMICommand(is_ui_ready);
+ rpc_service_->ManageHMICommand(is_ui_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_navi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_navi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Navigation_IsReady, *this));
- ManageHMICommand(is_navi_ready);
+ rpc_service_->ManageHMICommand(is_navi_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ivi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VehicleInfo_IsReady, *this));
- ManageHMICommand(is_ivi_ready);
+ rpc_service_->ManageHMICommand(is_ivi_ready);
- utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> is_rc_ready(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady,
+ *this));
+ rpc_service_->ManageHMICommand(is_rc_ready);
+
+ std::shared_ptr<smart_objects::SmartObject> button_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Buttons_GetCapabilities, *this));
- ManageHMICommand(button_capabilities);
+ rpc_service_->ManageHMICommand(button_capabilities);
- utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request(
+ std::shared_ptr<smart_objects::SmartObject> mixing_audio_supported_request(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
*this));
- ManageHMICommand(mixing_audio_supported_request);
+ rpc_service_->ManageHMICommand(mixing_audio_supported_request);
resume_controller().ResetLaunchTime();
}
@@ -685,32 +791,36 @@ uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
return corelation_id_;
}
-bool ApplicationManagerImpl::BeginAudioPassThrough() {
+bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (audio_pass_thru_active_) {
return false;
} else {
audio_pass_thru_active_ = true;
+ audio_pass_thru_app_id_ = app_id;
return true;
}
}
-bool ApplicationManagerImpl::EndAudioPassThrough() {
+bool ApplicationManagerImpl::EndAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
- if (audio_pass_thru_active_) {
+ if (audio_pass_thru_active_ && audio_pass_thru_app_id_ == app_id) {
audio_pass_thru_active_ = false;
+ audio_pass_thru_app_id_ = 0;
return true;
} else {
return false;
}
}
-void ApplicationManagerImpl::set_driver_distraction(const bool is_distracting) {
- is_distracting_driver_ = is_distracting;
+hmi_apis::Common_DriverDistractionState::eType
+ApplicationManagerImpl::driver_distraction_state() const {
+ return driver_distraction_state_;
}
-void ApplicationManagerImpl::set_vr_session_started(const bool state) {
- is_vr_session_strated_ = state;
+void ApplicationManagerImpl::set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) {
+ driver_distraction_state_ = state;
}
void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
@@ -718,23 +828,19 @@ void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
}
HmiStatePtr ApplicationManagerImpl::CreateRegularState(
- uint32_t app_id,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const {
- HmiStatePtr state(new HmiState(app_id, *this));
+ HmiStatePtr state(new HmiState(app, *this));
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(audio_state);
+ state->set_video_streaming_state(video_state);
state->set_system_context(system_context);
return state;
}
-bool ApplicationManagerImpl::IsStateActive(HmiState::StateID state_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Checking for active state id " << state_id);
- return state_ctrl_.IsStateActive(state_id);
-}
-
void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
int32_t correlation_id,
int32_t max_duration,
@@ -748,23 +854,6 @@ void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
session_key, get_settings().recording_file_name(), max_duration);
}
-void ApplicationManagerImpl::SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!audio_pass_thru_active_) {
- LOG4CXX_ERROR(logger_,
- "Trying to send PassThroughNotification"
- " when PassThrough is not active");
- return;
- }
-
- impl::AudioData data;
- data.session_key = session_key;
- data.binary_data = binary_data;
- audio_pass_thru_messages_.PostMessage(data);
-}
-
void ApplicationManagerImpl::StopAudioPassThru(int32_t application_key) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
@@ -802,43 +891,6 @@ ApplicationManagerImpl::GetDeviceTransportType(
return result;
}
-void ApplicationManagerImpl::OnMessageReceived(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message);
-
- if (outgoing_message) {
- LOG4CXX_DEBUG(logger_, "Posting new Message");
- messages_from_mobile_.PostMessage(
- impl::MessageFromMobile(outgoing_message));
- }
-}
-
-void ApplicationManagerImpl::OnMobileMessageSent(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-void ApplicationManagerImpl::OnMessageReceived(
- hmi_message_handler::MessageSharedPointer message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
-}
-
ApplicationConstSharedPtr ApplicationManagerImpl::WaitingApplicationByID(
const uint32_t hmi_id) const {
AppsWaitRegistrationSet app_list = AppsWaitingForRegistration().GetData();
@@ -857,12 +909,12 @@ ApplicationConstSharedPtr ApplicationManagerImpl::WaitingApplicationByID(
DataAccessor<AppsWaitRegistrationSet>
ApplicationManagerImpl::AppsWaitingForRegistration() const {
return DataAccessor<AppsWaitRegistrationSet>(apps_to_register_,
- apps_to_register_list_lock_);
+ apps_to_register_list_lock_ptr_);
}
bool ApplicationManagerImpl::IsAppsQueriedFrom(
const connection_handler::DeviceHandle handle) const {
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
for (; it != it_end; ++it) {
@@ -881,9 +933,25 @@ const ApplicationManagerSettings& ApplicationManagerImpl::get_settings() const {
return settings_;
}
+// Extract the app ID to use for policy based on the UseFullAppID .ini setting
+std::string ApplicationManagerImpl::GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const {
+ // If core is expecting a fullAppID
+ if (get_settings().use_full_app_id()) {
+ // fullAppID is present and core is configured to use it
+ if ((*message)[strings::msg_params].keyExists(strings::full_app_id)) {
+ return (*message)[strings::msg_params][strings::full_app_id].asString();
+ } else {
+ LOG4CXX_DEBUG(logger_, "UseFullAppID is on but only short ID given!");
+ }
+ }
+ // If core isn't using full or no full given, use regular appID
+ return (*message)[strings::msg_params][strings::app_id].asString();
+}
+
void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
const connection_handler::DeviceHandle handle, bool is_greyed_out) {
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
AppsWaitRegistrationSet::iterator it = apps_to_register_.begin();
AppsWaitRegistrationSet::const_iterator it_end = apps_to_register_.end();
for (; it != it_end; ++it) {
@@ -892,10 +960,6 @@ void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
}
}
}
-void ApplicationManagerImpl::OnErrorSending(
- hmi_message_handler::MessageSharedPointer message) {
- return;
-}
void ApplicationManagerImpl::OnDeviceListUpdated(
const connection_handler::DeviceMap& device_list) {
@@ -927,7 +991,8 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
return;
}
- smart_objects::SmartObjectSPtr update_list = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr update_list =
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& so_to_send = *update_list;
so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
@@ -937,7 +1002,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
- ManageHMICommand(update_list);
+ rpc_service_->ManageHMICommand(update_list);
}
void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
@@ -966,7 +1031,7 @@ void ApplicationManagerImpl::SendUpdateAppList() {
PrepareApplicationListSO(applications_, applications, *this);
PrepareApplicationListSO(apps_to_register_, applications, *this);
- ManageHMICommand(request);
+ rpc_service_->ManageHMICommand(request);
}
void ApplicationManagerImpl::RemoveDevice(
@@ -974,16 +1039,122 @@ void ApplicationManagerImpl::RemoveDevice(
LOG4CXX_DEBUG(logger_, "device_handle " << device_handle);
}
+void ApplicationManagerImpl::OnDeviceSwitchingStart(
+ const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ auto apps_data_accessor = applications();
+
+ std::copy_if(apps_data_accessor.GetData().begin(),
+ apps_data_accessor.GetData().end(),
+ std::back_inserter(reregister_wait_list_),
+ std::bind1st(std::ptr_fun(&device_id_comparator),
+ device_from.mac_address()));
+ }
+
+ {
+ // During sending of UpdateDeviceList this lock is acquired also so making
+ // it scoped
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ for (auto i = reregister_wait_list_.begin();
+ reregister_wait_list_.end() != i;
+ ++i) {
+ auto app = *i;
+ request_ctrl_.terminateAppRequests(app->app_id());
+ resume_ctrl_->SaveApplication(app);
+ }
+ }
+
+ policy_handler_->OnDeviceSwitching(device_from.mac_address(),
+ device_to.mac_address());
+
+ connection_handler::DeviceMap device_list;
+ device_list.insert(std::make_pair(device_to.device_handle(), device_to));
+
+ smart_objects::SmartObjectSPtr msg_params =
+ MessageHelper::CreateDeviceListSO(device_list, GetPolicyHandler(), *this);
+ if (!msg_params) {
+ LOG4CXX_ERROR(logger_, "Can't create UpdateDeviceList notification");
+ return;
+ }
+
+ auto update_list = std::make_shared<smart_objects::SmartObject>();
+ smart_objects::SmartObject& so_to_send = *update_list;
+ so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
+ hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
+ so_to_send[jhs::S_PARAMS][jhs::S_MESSAGE_TYPE] =
+ hmi_apis::messageType::request;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_VERSION] = 2;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
+ so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
+ so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
+ rpc_service_->ManageHMICommand(update_list);
+}
+
+void ApplicationManagerImpl::OnDeviceSwitchingFinish(
+ const std::string& device_uid) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_uid);
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+
+ const bool unexpected_disonnect = true;
+ const bool is_resuming = true;
+ for (auto app_it = reregister_wait_list_.begin();
+ app_it != reregister_wait_list_.end();
+ ++app_it) {
+ auto app = *app_it;
+ UnregisterApplication(app->app_id(),
+ mobile_apis::Result::INVALID_ENUM,
+ is_resuming,
+ unexpected_disonnect);
+ }
+ reregister_wait_list_.clear();
+}
+
+void ApplicationManagerImpl::SwitchApplication(ApplicationSharedPtr app,
+ const uint32_t connection_key,
+ const size_t device_id,
+ const std::string& mac_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
+ DCHECK_OR_RETURN_VOID(1 == applications_.erase(app));
+
+ LOG4CXX_DEBUG(logger_,
+ "Changing app id to " << connection_key
+ << ". Changing device id to "
+ << device_id);
+
+ bool is_subscribed_to_way_points = IsAppSubscribedForWayPoints(app);
+ if (is_subscribed_to_way_points) {
+ UnsubscribeAppFromWayPoints(app);
+ }
+ SwitchApplicationParameters(app, connection_key, device_id, mac_address);
+ if (is_subscribed_to_way_points) {
+ SubscribeAppForWayPoints(app);
+ }
+
+ // Normally this is done during registration, however since switched apps are
+ // not being registered again need to set protocol version on session.
+ connection_handler().BindProtocolVersionWithSession(
+ connection_key, static_cast<uint8_t>(app->protocol_version()));
+
+ // Application need to be re-inserted in order to keep sorting in applications
+ // container. Otherwise data loss on erasing is possible.
+ applications_.insert(app);
+}
+
mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
ApplicationConstSharedPtr application) const {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
HMILevel::eType default_hmi = HMILevel::HMI_NONE;
- if (policy_handler_.PolicyEnabled()) {
+ if (GetPolicyHandler().PolicyEnabled()) {
const std::string policy_app_id = application->policy_app_id();
std::string default_hmi_string = "";
- if (policy_handler_.GetDefaultHmi(policy_app_id, &default_hmi_string)) {
+ if (GetPolicyHandler().GetDefaultHmi(policy_app_id, &default_hmi_string)) {
if ("BACKGROUND" == default_hmi_string) {
default_hmi = HMILevel::HMI_BACKGROUND;
} else if ("FULL" == default_hmi_string) {
@@ -1005,6 +1176,79 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
return default_hmi;
}
+bool ApplicationManagerImpl::CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::map<std::string, std::vector<std::string> >& transport_map =
+ get_settings().transport_required_for_resumption_map();
+
+ // retrieve transport type string used in .ini file
+ const std::string transport_type =
+ GetTransportTypeProfileString(application->device());
+ const std::string secondary_transport_type =
+ GetTransportTypeProfileString(application->secondary_device());
+
+ const smart_objects::SmartObject* app_types_array = application->app_types();
+ if (app_types_array == NULL || app_types_array->length() == 0) {
+ // This app does not have any AppHMIType. In this case, check "EMPTY_APP"
+ // entry
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(std::string("EMPTY_APP"));
+ if (it == transport_map.end()) {
+ // if "EMPTY_APP" is not specified, resumption is always enabled
+ return true;
+ }
+ const std::vector<std::string>& required_transport_list = it->second;
+
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ // check all AppHMITypes that the app has
+ for (size_t i = 0; i < app_types_array->length(); i++) {
+ const std::string app_type_string =
+ AppHMITypeToString(static_cast<mobile_apis::AppHMIType::eType>(
+ app_types_array->getElement(i).asUInt()));
+ bool transport_is_found = false;
+
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(app_type_string);
+ if (it == transport_map.end()) {
+ // this AppHMIType is not listed in .ini file, so resumption is always
+ // enabled
+ continue;
+ }
+
+ const std::vector<std::string>& required_transport_list = it->second;
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ transport_is_found = true;
+ break;
+ }
+ }
+
+ // if neither primary or secondary transport type is included in the list,
+ // then resumption will be disabled
+ if (!transport_is_found) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
+
uint32_t ApplicationManagerImpl::GenerateGrammarID() {
return rand();
}
@@ -1023,109 +1267,111 @@ uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
return hmi_app_id;
}
-void ApplicationManagerImpl::ReplaceMobileByHMIAppId(
- smart_objects::SmartObject& message) {
- MessageHelper::PrintSmartObject(message);
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application_ptr =
- application(message[strings::app_id].asUInt());
- if (application_ptr.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceMobileByHMIAppId from "
- << message[strings::app_id].asInt() << " to "
- << application_ptr->hmi_app_id());
- message[strings::app_id] = application_ptr->hmi_app_id();
- }
- } else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceMobileByHMIAppId(*it);
- }
- break;
- }
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- std::string k = *key;
- ReplaceMobileByHMIAppId(message[*key]);
+bool ApplicationManagerImpl::StartNaviService(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ const BsonObject* params) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (HMILevelAllowsStreaming(app_id, service_type)) {
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ std::pair<NaviServiceStatusMap::iterator, bool> res =
+ navi_service_status_.insert(
+ std::pair<uint32_t, std::pair<bool, bool> >(
+ app_id, std::make_pair(false, false)));
+ if (!res.second) {
+ LOG4CXX_WARN(logger_, "Navi service refused");
+ return false;
}
- break;
+ it = res.first;
}
- default: { break; }
}
- }
-}
-void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
- smart_objects::SmartObject& message) {
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application =
- application_by_hmi_app(message[strings::app_id].asUInt());
-
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
- }
- } else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceHMIByMobileAppId(*it);
- }
- break;
+ if (service_type == ServiceType::kMobileNav) {
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ ConvertVideoParamsToSO(converted_params, params);
+ std::vector<std::string> rejected_params;
+ if (converted_params.keyExists(strings::codec) &&
+ converted_params[strings::codec] ==
+ hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) {
+ rejected_params.push_back(strings::codec);
+ }
+ if (converted_params.keyExists(strings::protocol) &&
+ converted_params[strings::protocol] ==
+ hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) {
+ rejected_params.push_back(strings::protocol);
}
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- ReplaceHMIByMobileAppId(message[*key]);
+
+ if (!rejected_params.empty()) {
+ OnStreamingConfigured(app_id, service_type, false, rejected_params);
+ return false;
+ } else if (!converted_params.empty()) {
+ LOG4CXX_INFO(logger_, "Sending video configuration params");
+ MessageHelper::PrintSmartObject(converted_params);
+ bool request_sent =
+ application(app_id)->SetVideoConfig(service_type, converted_params);
+ if (request_sent) {
+ return true;
}
- break;
}
- default: { break; }
}
+ // no configuration is needed, or SetVideoConfig is not sent
+ std::vector<std::string> empty;
+ OnStreamingConfigured(app_id, service_type, true, empty);
+ return true;
+
+ } else {
+ LOG4CXX_WARN(logger_, "Refused navi service by HMI level");
}
+ std::vector<std::string> empty;
+ OnStreamingConfigured(app_id, service_type, false, empty);
+ return false;
}
-bool ApplicationManagerImpl::StartNaviService(
- uint32_t app_id, protocol_handler::ServiceType service_type) {
+void ApplicationManagerImpl::OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) {
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
- if (HMILevelAllowsStreaming(app_id, service_type)) {
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- std::pair<NaviServiceStatusMap::iterator, bool> res =
- navi_service_status_.insert(
- std::pair<uint32_t, std::pair<bool, bool> >(
- app_id, std::make_pair(false, false)));
- if (!res.second) {
- LOG4CXX_WARN(logger_, "Navi service refused");
- return false;
+ LOG4CXX_INFO(logger_,
+ "OnStreamingConfigured called for service "
+ << service_type << ", result=" << result);
+
+ if (result) {
+ std::vector<std::string> empty;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_WARN(logger_, "Application not found in navi status map");
+ connection_handler().NotifyServiceStartedResult(app_id, false, empty);
+ return;
}
- it = res.first;
+
+ // Fill NaviServices map. Set true to first value of pair if
+ // we've started video service or to second value if we've
+ // started audio service
+ service_type == ServiceType::kMobileNav ? it->second.first = true
+ : it->second.second = true;
}
- // Fill NaviServices map. Set true to first value of pair if
- // we've started video service or to second value if we've
- // started audio service
- service_type == ServiceType::kMobileNav ? it->second.first = true
- : it->second.second = true;
application(app_id)->StartStreaming(service_type);
- return true;
+ connection_handler().NotifyServiceStartedResult(app_id, true, empty);
} else {
- LOG4CXX_WARN(logger_, "Refused navi service by HMI level");
+ std::vector<std::string> converted_params =
+ ConvertRejectedParamList(rejected_params);
+ connection_handler().NotifyServiceStartedResult(
+ app_id, false, converted_params);
}
- return false;
}
void ApplicationManagerImpl::StopNaviService(
@@ -1133,15 +1379,20 @@ void ApplicationManagerImpl::StopNaviService(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- LOG4CXX_WARN(logger_, "No Information about navi service " << service_type);
- } else {
- // Fill NaviServices map. Set false to first value of pair if
- // we've stopped video service or to second value if we've
- // stopped audio service
- service_type == ServiceType::kMobileNav ? it->second.first = false
- : it->second.second = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "No Information about navi service " << service_type);
+ } else {
+ // Fill NaviServices map. Set false to first value of pair if
+ // we've stopped video service or to second value if we've
+ // stopped audio service
+ service_type == ServiceType::kMobileNav ? it->second.first = false
+ : it->second.second = false;
+ }
}
ApplicationSharedPtr app = application(app_id);
@@ -1153,40 +1404,47 @@ void ApplicationManagerImpl::StopNaviService(
app->StopStreaming(service_type);
}
-bool ApplicationManagerImpl::OnServiceStartedCallback(
+void ApplicationManagerImpl::OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
- const protocol_handler::ServiceType& type) {
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) {
using namespace helpers;
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"ServiceType = " << type << ". Session = " << std::hex
<< session_key);
+ std::vector<std::string> empty;
if (type == kRpc) {
LOG4CXX_DEBUG(logger_, "RPC service is about to be started.");
- return true;
+ connection_handler().NotifyServiceStartedResult(session_key, true, empty);
+ return;
}
ApplicationSharedPtr app = application(session_key);
if (!app) {
LOG4CXX_WARN(logger_,
"The application with id:" << session_key
<< " doesn't exists.");
- return false;
+ connection_handler().NotifyServiceStartedResult(session_key, false, empty);
+ return;
}
if (Compare<ServiceType, EQ, ONE>(
type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- if (app->is_navi()) {
- return StartNaviService(session_key, type);
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ if (!StartNaviService(session_key, type, params)) {
+ LOG4CXX_WARN(logger_, "Starting Navigation service failed");
+ }
+ return;
} else {
- LOG4CXX_WARN(logger_, "Refuse not navi application");
+ LOG4CXX_WARN(logger_, "Refuse not navi/projection application");
}
} else {
LOG4CXX_WARN(logger_, "Refuse unknown service");
}
- return false;
+ connection_handler().NotifyServiceStartedResult(session_key, false, empty);
}
void ApplicationManagerImpl::OnServiceEndedCallback(
@@ -1203,6 +1461,17 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
<< type << " with reason " << close_reason
<< " in session 0x" << std::hex << session_key);
+ auto app = application(static_cast<uint32_t>(session_key));
+ if (!app) {
+ return;
+ }
+
+ if (IsAppInReconnectMode(app->policy_app_id())) {
+ LOG4CXX_DEBUG(logger_,
+ "Application is in reconnection list and won't be closed.");
+ return;
+ }
+
if (type == kRpc) {
LOG4CXX_INFO(logger_, "Remove application.");
/* In case it was unexpected disconnect or some special case
@@ -1221,10 +1490,10 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
is_resuming = true;
is_unexpected_disconnect = false;
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
break;
}
case CloseSessionReason::kMalformed: {
@@ -1257,6 +1526,88 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
}
}
+void ApplicationManagerImpl::OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Invalid device handle passed for secondary transport of app "
+ << session_key);
+ return;
+ }
+
+ secondary_transport_devices_cache_[session_key] = device_handle;
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ // It is possible that secondary transport is established prior to
+ // RegisterAppInterface request being processed. In this case, we will
+ // update the app's information during RegisterApplication().
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+ app->set_secondary_device(device_handle);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+
+ // if resumption has not been enabled, run it now
+ resume_controller().RetryResumption(session_key);
+}
+
+void ApplicationManagerImpl::OnSecondaryTransportEndedCallback(
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DeviceMap::iterator it = secondary_transport_devices_cache_.find(session_key);
+ if (it == secondary_transport_devices_cache_.end()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Unknown session_key specified while removing secondary transport: "
+ << session_key);
+ } else {
+ secondary_transport_devices_cache_.erase(it);
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app->secondary_device();
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Secondary transport of app " << session_key
+ << " is not found");
+ return;
+ }
+
+ app->set_secondary_device(0);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+}
+
+bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application(app_id);
+ if (app) {
+ return app->is_navi();
+ }
+ return false;
+}
+
#ifdef ENABLE_SECURITY
bool ApplicationManagerImpl::OnHandshakeDone(
uint32_t connection_key,
@@ -1280,11 +1631,22 @@ bool ApplicationManagerImpl::OnHandshakeDone(
return false;
}
+bool ApplicationManagerImpl::OnHandshakeFailed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return false;
+}
+
void ApplicationManagerImpl::OnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
GetPolicyHandler().OnPTExchangeNeeded();
}
+bool ApplicationManagerImpl::GetPolicyCertificateData(std::string& data) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ data = GetPolicyHandler().RetrieveCertificate();
+ return true;
+}
+
security_manager::SSLContext::HandshakeContext
ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1301,6 +1663,7 @@ ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
void ApplicationManagerImpl::set_hmi_message_handler(
hmi_message_handler::HMIMessageHandler* handler) {
hmi_handler_ = handler;
+ rpc_service_->set_hmi_message_handler(handler);
}
void ApplicationManagerImpl::set_connection_handler(
@@ -1321,396 +1684,46 @@ protocol_handler::ProtocolHandler& ApplicationManagerImpl::protocol_handler()
void ApplicationManagerImpl::set_protocol_handler(
protocol_handler::ProtocolHandler* handler) {
protocol_handler_ = handler;
+ rpc_service_->set_protocol_handler(handler);
}
void ApplicationManagerImpl::StartDevicesDiscovery() {
connection_handler().get_device_discovery_starter().StartDevicesDiscovery();
}
-void ApplicationManagerImpl::SendMessageToMobile(
- const commands::MessageSharedPtr message, bool final_message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- if (!protocol_handler_) {
- LOG4CXX_WARN(logger_, "No Protocol Handler set");
- return;
- }
-
- ApplicationSharedPtr app = application(
- (*message)[strings::params][strings::connection_key].asUInt());
-
- const bool is_result_code_exists =
- (*message)[strings::msg_params].keyExists(strings::result_code);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with connection key");
- if (is_result_code_exists &&
- ((*message)[strings::msg_params][strings::result_code] ==
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) {
- (*message)[strings::params][strings::protocol_version] =
- ProtocolVersion::kV1;
- } else {
- (*message)[strings::params][strings::protocol_version] =
- SupportedSDLVersion();
- }
- } else {
- (*message)[strings::params][strings::protocol_version] =
- app->protocol_version();
- }
-
- if (app && is_result_code_exists &&
- (*message)[strings::msg_params][strings::result_code] ==
- mobile_apis::Result::OUT_OF_MEMORY) {
- app->usage_report().RecordRejectionsSyncOutOfMemory();
- }
-
- mobile_so_factory().attachSchema(*message, false);
- LOG4CXX_DEBUG(
- logger_,
- "Attached schema to message, result if valid: " << message->isValid());
-
- // Messages to mobile are not yet prioritized so use default priority value
- utils::SharedPtr<Message> message_to_send(
- new Message(protocol_handler::MessagePriority::kDefault));
- if (!ConvertSOtoMessage((*message), (*message_to_send))) {
- LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
- return;
- }
-
- smart_objects::SmartObject& msg_to_mobile = *message;
- // If correlation_id is not present, it is from-HMI message which should be
- // checked against policy permissions
- if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
- request_ctrl_.OnMobileResponse(
- msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
- msg_to_mobile[strings::params][strings::connection_key].asUInt(),
- msg_to_mobile[strings::params][strings::function_id].asInt());
- } else if (app) {
- mobile_apis::FunctionID::eType function_id =
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asUInt());
- RPCParams params;
-
- const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
- if (smart_objects::SmartType_Map == s_map.getType()) {
- smart_objects::SmartMap::iterator iter = s_map.map_begin();
- smart_objects::SmartMap::iterator iter_end = s_map.map_end();
-
- for (; iter != iter_end; ++iter) {
- if (true == iter->second.asBool()) {
- LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
- params.insert(iter->first);
- }
- }
- }
- const mobile_apis::Result::eType check_result = CheckPolicyPermissions(
- app->policy_app_id(), app->hmi_level(), function_id, params);
- if (mobile_apis::Result::SUCCESS != check_result) {
- const std::string string_functionID =
- MessageHelper::StringifiedFunctionID(function_id);
- LOG4CXX_WARN(logger_,
- "Function \"" << string_functionID << "\" (#" << function_id
- << ") not allowed by policy");
- return;
- }
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
- if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
- mobile_apis::RequestType::eType request_type =
- static_cast<mobile_apis::RequestType::eType>(
- (*message)[strings::msg_params][strings::request_type].asUInt());
- if (mobile_apis::RequestType::PROPRIETARY == request_type ||
- mobile_apis::RequestType::HTTP == request_type) {
- GetPolicyHandler().OnUpdateRequestSentToMobile();
- }
- }
-#endif // EXTERNAL_PROPRIETARY_MODE
- }
-
- if (message_to_send->binary_data()) {
- LOG4CXX_DEBUG(
- logger_,
- "Binary data size: " << message_to_send->binary_data()->size());
- }
- messages_to_mobile_.PostMessage(
- impl::MessageToMobile(message_to_send, final_message));
-}
-
void ApplicationManagerImpl::TerminateRequest(const uint32_t connection_key,
const uint32_t corr_id,
const int32_t function_id) {
request_ctrl_.TerminateRequest(corr_id, connection_key, function_id, true);
}
-bool ApplicationManagerImpl::ManageMobileCommand(
- const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- return false;
- }
-
- if (IsLowVoltage()) {
- LOG4CXX_WARN(logger_, "Low Voltage is active");
- return false;
- }
-#ifdef DEBUG
- MessageHelper::PrintSmartObject(*message);
-#endif
-
- LOG4CXX_DEBUG(logger_, "Trying to create message in mobile factory.");
- utils::SharedPtr<commands::Command> command(
- MobileCommandFactory::CreateCommand(message, origin, *this));
-
- if (!command) {
- LOG4CXX_WARN(logger_,
- "RET Failed to create mobile command from smart object");
- return false;
- }
-
- mobile_apis::FunctionID::eType function_id =
- static_cast<mobile_apis::FunctionID::eType>(
- (*message)[strings::params][strings::function_id].asInt());
-
- // Notifications from HMI have no such parameter
- uint32_t correlation_id =
- (*message)[strings::params].keyExists(strings::correlation_id)
- ? (*message)[strings::params][strings::correlation_id].asUInt()
- : 0;
-
- uint32_t connection_key =
- (*message)[strings::params][strings::connection_key].asUInt();
-
- int32_t protocol_type =
- (*message)[strings::params][strings::protocol_type].asUInt();
-
- ApplicationSharedPtr app;
- int32_t message_type =
- (*message)[strings::params][strings::message_type].asInt();
-
- if (((mobile_apis::FunctionID::RegisterAppInterfaceID != function_id) &&
- (protocol_type == commands::CommandImpl::mobile_protocol_type_)) &&
- (mobile_apis::FunctionID::UnregisterAppInterfaceID != function_id)) {
- app = application(connection_key);
- if (!app) {
- LOG4CXX_ERROR(logger_, "RET APPLICATION_NOT_REGISTERED");
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED));
-
- SendMessageToMobile(response);
- return false;
- }
-
- // Message for "CheckPermission" must be with attached schema
- mobile_so_factory().attachSchema(*message, false);
- }
-
- if (message_type == mobile_apis::messageType::response) {
- if (command->Init()) {
- command->Run();
- command->CleanUp();
- }
- return true;
- }
- if (message_type == mobile_apis::messageType::notification) {
- request_ctrl_.addNotification(command);
- if (command->Init()) {
- command->Run();
- if (command->CleanUp()) {
- request_ctrl_.removeNotification(command.get());
- }
- // If CleanUp returned false notification should remove it self.
- }
- return true;
- }
-
- if (message_type == mobile_apis::messageType::request) {
- // commands will be launched from requesr_ctrl
- mobile_apis::HMILevel::eType app_hmi_level =
- mobile_apis::HMILevel::INVALID_ENUM;
- if (app) {
- app_hmi_level = app->hmi_level();
- }
-
- // commands will be launched from request_ctrl
-
- const request_controller::RequestController::TResult result =
- request_ctrl_.addMobileRequest(command, app_hmi_level);
-
- if (result == request_controller::RequestController::SUCCESS) {
- LOG4CXX_DEBUG(logger_, "Perform request");
- } else if (result == request_controller::RequestController::
- TOO_MANY_PENDING_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable top perform request: "
- << "TOO_MANY_PENDING_REQUESTS");
-
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateNegativeResponse(
- connection_key,
- static_cast<int32_t>(function_id),
- correlation_id,
- static_cast<int32_t>(
- mobile_apis::Result::TOO_MANY_PENDING_REQUESTS));
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
-
- SendMessageToMobile(response);
- return false;
- } else if (result ==
- request_controller::RequestController::TOO_MANY_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable to perform request: "
- << "TOO_MANY_REQUESTS");
-
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key,
- mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
- commands::Command::ORIGIN_SDL);
-
- UnregisterApplication(connection_key,
- mobile_apis::Result::TOO_MANY_PENDING_REQUESTS,
- false);
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
- return false;
- } else if (result == request_controller::RequestController::
- NONE_HMI_LEVEL_MANY_REQUESTS) {
- LOG4CXX_ERROR(logger_,
- "RET Unable to perform request: "
- << "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
-
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key,
- mobile_api::AppInterfaceUnregisteredReason::
- REQUEST_WHILE_IN_NONE_HMI_LEVEL),
- commands::Command::ORIGIN_SDL);
-
- ApplicationSharedPtr app_ptr = application(connection_key);
- if (app_ptr) {
- app_ptr->usage_report().RecordRemovalsForBadBehavior();
- }
- UnregisterApplication(
- connection_key, mobile_apis::Result::INVALID_ENUM, false);
- return false;
- } else {
- LOG4CXX_ERROR(logger_, "RET Unable to perform request: Unknown case");
- return false;
- }
- return true;
- }
-
- LOG4CXX_ERROR(logger_, "RET UNKNOWN MESSAGE TYPE " << message_type);
- return false;
-}
-
-void ApplicationManagerImpl::SendMessageToHMI(
- const commands::MessageSharedPtr message) {
+void ApplicationManagerImpl::RemoveHMIFakeParameters(
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) {
LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- NOTREACHED();
- return;
- }
-
- if (!hmi_handler_) {
- LOG4CXX_WARN(logger_, "No HMI Handler set");
- return;
- }
-
- // SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
- new Message(protocol_handler::MessagePriority::kDefault));
- if (!message_to_send) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
- hmi_so_factory().attachSchema(*message, false);
- LOG4CXX_INFO(
- logger_,
- "Attached schema to message, result if valid: " << message->isValid());
-
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*message);
-#else
- if (!ConvertSOtoMessage(*message, *message_to_send)) {
- LOG4CXX_WARN(logger_,
- "Cannot send message to HMI: failed to create string");
+ hmi_apis::HMI_API factory;
+ if (!(*message)[jhs::S_PARAMS].keyExists(jhs::S_FUNCTION_ID)) {
+ LOG4CXX_ERROR(logger_,
+ "RemoveHMIFakeParameters message missing function id");
return;
}
-#endif // HMI_DBUS_API
-
- messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
-}
-
-bool ApplicationManagerImpl::ManageHMICommand(
- const commands::MessageSharedPtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_WARN(logger_, "Null-pointer message received.");
- return false;
- }
-
- if (IsLowVoltage()) {
- LOG4CXX_WARN(logger_, "Low Voltage is active");
- return false;
- }
-
- MessageHelper::PrintSmartObject(*message);
-
- CommandSharedPtr command = HMICommandFactory::CreateCommand(message, *this);
- if (!command) {
- LOG4CXX_WARN(logger_, "Failed to create command from smart object");
- return false;
- }
-
- int32_t message_type =
- (*(message.get()))[strings::params][strings::message_type].asInt();
-
- if (kRequest == message_type) {
- LOG4CXX_DEBUG(logger_, "ManageHMICommand");
- request_ctrl_.addHMIRequest(command);
- }
-
- if (command->Init()) {
- command->Run();
- if (kResponse == message_type) {
- const uint32_t correlation_id =
- (*(message.get()))[strings::params][strings::correlation_id].asUInt();
- const int32_t function_id =
- (*(message.get()))[strings::params][strings::function_id].asInt();
- request_ctrl_.OnHMIResponse(correlation_id, function_id);
- }
- return true;
- }
- return false;
+ mobile_apis::FunctionID::eType mobile_function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = function_id;
+ factory.attachSchema(*message, true);
+ (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = mobile_function_id;
}
bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
media_manager::MediaManager* media_manager) {
LOG4CXX_TRACE(logger_, "Init application manager");
+ plugin_manager_.reset(new plugin_manager::RPCPluginManagerImpl(
+ *this, *rpc_service_, *hmi_capabilities_, *policy_handler_));
+ if (!plugin_manager_->LoadPlugins(get_settings().plugins_folder())) {
+ LOG4CXX_ERROR(logger_, "Plugins are not loaded");
+ return false;
+ }
const std::string app_storage_folder = get_settings().app_storage_folder();
if (!InitDirectory(app_storage_folder, TYPE_STORAGE) ||
!IsReadWriteAllowed(app_storage_folder, TYPE_STORAGE)) {
@@ -1766,7 +1779,6 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
}
app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
*app_launch_dto_.get(), *this, settings_));
-
return true;
}
@@ -1777,6 +1789,8 @@ bool ApplicationManagerImpl::Stop() {
stopping_application_mng_lock_.Release();
application_list_update_timer_.Stop();
try {
+ SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF);
UnregisterAllApplications();
} catch (...) {
LOG4CXX_ERROR(logger_,
@@ -1791,157 +1805,6 @@ bool ApplicationManagerImpl::Stop() {
return true;
}
-bool ApplicationManagerImpl::ConvertMessageToSO(
- const Message& message, smart_objects::SmartObject& output) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "\t\t\tMessage to convert: protocol "
- << message.protocol_version() << "; json "
- << message.json_message());
-
- switch (message.protocol_version()) {
- case ProtocolVersion::kV4:
- case ProtocolVersion::kV3:
- case ProtocolVersion::kV2: {
- const bool conversion_result =
- formatters::CFormatterJsonSDLRPCv2::fromString(
- message.json_message(),
- output,
- message.function_id(),
- message.type(),
- message.correlation_id());
- if (!conversion_result ||
- !mobile_so_factory().attachSchema(output, true) ||
- ((output.validate() != smart_objects::Errors::OK))) {
- LOG4CXX_WARN(logger_,
- "Failed to parse string to smart object :"
- << message.json_message());
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- message.connection_key(),
- message.function_id(),
- message.correlation_id(),
- mobile_apis::Result::INVALID_DATA));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
- return false;
- }
- LOG4CXX_DEBUG(logger_,
- "Convertion result for sdl object is true function_id "
- << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
-
- output[strings::params][strings::connection_key] =
- message.connection_key();
- output[strings::params][strings::protocol_version] =
- message.protocol_version();
- if (message.binary_data()) {
- if (message.payload_size() < message.data_size()) {
- LOG4CXX_ERROR(logger_,
- "Incomplete binary"
- << " binary size should be " << message.data_size()
- << " payload data size is "
- << message.payload_size());
- utils::SharedPtr<smart_objects::SmartObject> response(
- MessageHelper::CreateNegativeResponse(
- message.connection_key(),
- message.function_id(),
- message.correlation_id(),
- mobile_apis::Result::INVALID_DATA));
- ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
- return false;
- }
- output[strings::params][strings::binary_data] =
- *(message.binary_data());
- }
- break;
- }
- case ProtocolVersion::kHMI: {
-#ifdef ENABLE_LOG
- int32_t result =
-#endif
- formatters::FormatterJsonRpc::FromString<
- hmi_apis::FunctionID::eType,
- hmi_apis::messageType::eType>(message.json_message(), output);
- LOG4CXX_DEBUG(logger_,
- "Convertion result: "
- << result << " function id "
- << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
- if (!hmi_so_factory().attachSchema(output, false)) {
- LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
- return false;
- }
- if (output.validate() != smart_objects::Errors::OK) {
- LOG4CXX_ERROR(logger_, "Incorrect parameter from HMI");
-
- if (application_manager::MessageType::kNotification ==
- output[strings::params][strings::message_type].asInt()) {
- LOG4CXX_ERROR(logger_, "Ignore wrong HMI notification");
- return false;
- }
-
- if (application_manager::MessageType::kRequest ==
- output[strings::params][strings::message_type].asInt()) {
- LOG4CXX_ERROR(logger_, "Ignore wrong HMI request");
- return false;
- }
-
- output.erase(strings::msg_params);
- output[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::INVALID_DATA;
- output[strings::msg_params][strings::info] =
- std::string("Received invalid data on HMI response");
- }
- break;
- }
- case ProtocolVersion::kV1: {
- static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema;
-
- if (message.function_id() == 0 || message.type() == kUnknownType) {
- LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
-
- int32_t conversation_result =
- formatters::CFormatterJsonSDLRPCv1::fromString<
- NsSmartDeviceLinkRPC::V1::FunctionID::eType,
- NsSmartDeviceLinkRPC::V1::messageType::eType>(
- message.json_message(), output);
-
- if (formatters::CFormatterJsonSDLRPCv1::kSuccess ==
- conversation_result) {
- smart_objects::SmartObject params = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
-
- output[strings::params][strings::message_type] =
- NsSmartDeviceLinkRPC::V1::messageType::response;
- output[strings::params][strings::connection_key] =
- message.connection_key();
-
- output[strings::msg_params] = smart_objects::SmartObject(
- smart_objects::SmartType::SmartType_Map);
- output[strings::msg_params][strings::success] = false;
- output[strings::msg_params][strings::result_code] =
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION;
-
- smart_objects::SmartObjectSPtr msg_to_send =
- new smart_objects::SmartObject(output);
- v1_shema.attachSchema(*msg_to_send, false);
- SendMessageToMobile(msg_to_send);
- return false;
- }
- }
- break;
- }
- default:
- // TODO(PV):
- // removed NOTREACHED() because some app can still have vesion 1.
- LOG4CXX_WARN(logger_,
- "Application used unsupported protocol :"
- << message.protocol_version() << ".");
- return false;
- }
-
- LOG4CXX_DEBUG(logger_, "Successfully parsed message into smart object");
- return true;
-}
-
bool ApplicationManagerImpl::ConvertSOtoMessage(
const smart_objects::SmartObject& message, Message& output) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1973,7 +1836,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
- output.set_protocol_version(application_manager::kV1);
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
} else {
if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
output_string)) {
@@ -1981,7 +1845,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
return false;
}
output.set_protocol_version(
- static_cast<ProtocolVersion>(protocol_version));
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ protocol_version));
}
break;
@@ -1991,7 +1856,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
- output.set_protocol_version(application_manager::kHMI);
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
break;
}
default:
@@ -2026,109 +1892,18 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
}
if (message.getElement(jhs::S_PARAMS).keyExists(strings::binary_data)) {
- application_manager::BinaryData* binaryData =
- new application_manager::BinaryData(
- message.getElement(jhs::S_PARAMS)
- .getElement(strings::binary_data)
- .asBinary());
-
- if (NULL == binaryData) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return false;
- }
- output.set_binary_data(binaryData);
+ const application_manager::BinaryData binaryData(
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::binary_data)
+ .asBinary());
+
+ output.set_binary_data(&binaryData);
}
LOG4CXX_DEBUG(logger_, "Successfully parsed smart object into message");
return true;
}
-utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
- const ::protocol_handler::RawMessagePtr message) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(message);
- utils::SharedPtr<Message> outgoing_message;
-
- LOG4CXX_DEBUG(logger_, "Service type." << message->service_type());
- if (message->service_type() != protocol_handler::kRpc &&
- message->service_type() != protocol_handler::kBulk) {
- // skip this message, not under handling of ApplicationManager
- LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
- return outgoing_message;
- }
-
- Message* convertion_result =
- MobileMessageHandler::HandleIncomingMessageProtocol(message);
-
- if (convertion_result) {
- outgoing_message = convertion_result;
- } else {
- LOG4CXX_ERROR(logger_, "Received invalid message");
- }
- return outgoing_message;
-}
-
-void ApplicationManagerImpl::ProcessMessageFromMobile(
- const utils::SharedPtr<Message> message) {
- LOG4CXX_AUTO_TRACE(logger_);
-#ifdef TELEMETRY_MONITOR
- AMTelemetryObserver::MessageMetricSharedPtr metric(
- new AMTelemetryObserver::MessageMetric());
- metric->begin = date_time::DateTime::getCurrentTime();
-#endif // TELEMETRY_MONITOR
- smart_objects::SmartObjectSPtr so_from_mobile =
- utils::MakeShared<smart_objects::SmartObject>();
-
- DCHECK_OR_RETURN_VOID(so_from_mobile);
- if (!so_from_mobile) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
- if (!ConvertMessageToSO(*message, *so_from_mobile)) {
- LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
- return;
- }
-#ifdef TELEMETRY_MONITOR
- metric->message = so_from_mobile;
-#endif // TELEMETRY_MONITOR
-
- if (!ManageMobileCommand(so_from_mobile, commands::Command::ORIGIN_MOBILE)) {
- LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
- }
-#ifdef TELEMETRY_MONITOR
- metric->end = date_time::DateTime::getCurrentTime();
- if (metric_observer_) {
- metric_observer_->OnMessage(metric);
- }
-#endif // TELEMETRY_MONITOR
-}
-
-void ApplicationManagerImpl::ProcessMessageFromHMI(
- const utils::SharedPtr<Message> message) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject);
-
- if (!smart_object) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return;
- }
-
-#ifdef HMI_DBUS_API
- *smart_object = message->smart_object();
-#else
- if (!ConvertMessageToSO(*message, *smart_object)) {
- LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
- return;
- }
-#endif // HMI_DBUS_API
-
- LOG4CXX_DEBUG(logger_, "Converted message, trying to create hmi command");
- if (!ManageHMICommand(smart_object)) {
- LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
- }
-}
-
hmi_apis::HMI_API& ApplicationManagerImpl::hmi_so_factory() {
if (!hmi_so_factory_) {
hmi_so_factory_ = new hmi_apis::HMI_API;
@@ -2272,10 +2047,10 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
const std::string app_icon_dir(settings_.app_icons_folder());
const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
- uint32_t device_id = 0;
+ connection_handler::DeviceHandle device_id = 0;
if (-1 ==
- connection_handler().GetDataOnSessionKey(
+ connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, NULL, NULL, &device_id)) {
LOG4CXX_ERROR(logger_,
"Failed to create application: no connection info.");
@@ -2297,6 +2072,7 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
new ApplicationImpl(0,
policy_app_id,
device_mac,
+ device_id,
appName,
GetPolicyHandler().GetStatisticManager(),
*this));
@@ -2305,12 +2081,11 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
app->SetPackageName(package_name);
app->set_app_icon_path(full_icon_path);
app->set_hmi_application_id(hmi_app_id);
- app->set_device(device_id);
app->set_vr_synonyms(vrSynonym);
app->set_tts_name(ttsName);
- sync_primitives::AutoLock lock(apps_to_register_list_lock_);
+ sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
LOG4CXX_DEBUG(
logger_, "apps_to_register_ size before: " << apps_to_register_.size());
apps_to_register_.insert(app);
@@ -2354,7 +2129,7 @@ bool ApplicationManagerImpl::is_attenuated_supported() const {
#ifdef TELEMETRY_MONITOR
void ApplicationManagerImpl::SetTelemetryObserver(
AMTelemetryObserver* observer) {
- metric_observer_ = observer;
+ rpc_handler_->SetTelemetryObserver(observer);
}
#endif // TELEMETRY_MONITOR
@@ -2395,6 +2170,14 @@ void ApplicationManagerImpl::set_application_id(const int32_t correlation_id,
std::pair<const int32_t, const uint32_t>(correlation_id, app_id));
}
+uint32_t ApplicationManagerImpl::get_current_audio_source() const {
+ return current_audio_source_;
+}
+
+void ApplicationManagerImpl::set_current_audio_source(const uint32_t source) {
+ current_audio_source_ = source;
+}
+
void ApplicationManagerImpl::AddPolicyObserver(
policy::PolicyHandlerObserver* listener) {
GetPolicyHandler().add_listener(listener);
@@ -2407,32 +2190,38 @@ void ApplicationManagerImpl::RemovePolicyObserver(
void ApplicationManagerImpl::SetUnregisterAllApplicationsReason(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_TRACE(logger_, "reason = " << reason);
unregister_reason_ = reason;
}
void ApplicationManagerImpl::HeadUnitReset(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
stopping_application_mng_lock_.Acquire();
is_stopping_ = true;
stopping_application_mng_lock_.Release();
switch (reason) {
case mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET: {
+ LOG4CXX_TRACE(logger_, "Performing MASTER_RESET");
UnregisterAllApplications();
GetPolicyHandler().ResetPolicyTable();
GetPolicyHandler().UnloadPolicyLibrary();
resume_controller().StopSavePersistentDataTimer();
- file_system::remove_directory_content(
- get_settings().app_storage_folder());
+
+ const std::string storage_folder = get_settings().app_storage_folder();
+ file_system::RemoveDirectory(storage_folder, true);
+ ClearAppsPersistentData();
break;
}
case mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS: {
+ LOG4CXX_TRACE(logger_, "Performing FACTORY_DEFAULTS");
GetPolicyHandler().ClearUserConsent();
resume_controller().StopSavePersistentDataTimer();
- file_system::remove_directory_content(
- get_settings().app_storage_folder());
+
+ ClearAppsPersistentData();
break;
}
default: {
@@ -2442,12 +2231,53 @@ void ApplicationManagerImpl::HeadUnitReset(
}
}
-void ApplicationManagerImpl::SendOnSDLClose() {
+void ApplicationManagerImpl::ClearAppsPersistentData() {
LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<std::string> FilesList;
+ const std::string apps_info_storage_file = get_settings().app_info_storage();
+ file_system::DeleteFile(apps_info_storage_file);
+
+ const std::string storage_folder = get_settings().app_storage_folder();
+
+ FilesList files = file_system::ListFiles(storage_folder);
+ FilesList::iterator element_to_skip =
+ std::find(files.begin(), files.end(), "policy.sqlite");
+ if (element_to_skip != files.end()) {
+ files.erase(element_to_skip);
+ }
+ FilesList::iterator it = files.begin();
+ for (; it != files.end(); ++it) {
+ const std::string path_to_item = storage_folder + "/";
+ const std::string item_to_remove = path_to_item + (*it);
+ LOG4CXX_TRACE(logger_, "Removing : " << item_to_remove);
+ if (file_system::IsDirectory(item_to_remove)) {
+ LOG4CXX_TRACE(logger_,
+ "Removal result : " << file_system::RemoveDirectory(
+ item_to_remove, true));
+ } else {
+ LOG4CXX_TRACE(
+ logger_,
+ "Removal result : " << file_system::DeleteFile(item_to_remove));
+ }
+ }
+
+ const std::string apps_icons_folder = get_settings().app_icons_folder();
+ if (storage_folder != apps_icons_folder) {
+ file_system::RemoveDirectory(apps_icons_folder, true);
+ }
+}
+
+void ApplicationManagerImpl::SendOnSDLClose() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (IsLowVoltage()) {
+ LOG4CXX_TRACE(logger_, "SDL is in Low Voltage State");
+ return;
+ }
// must be sent to PASA HMI on shutdown synchronously
smart_objects::SmartObjectSPtr msg =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*msg)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLClose;
@@ -2464,7 +2294,7 @@ void ApplicationManagerImpl::SendOnSDLClose() {
}
// SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
+ std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
hmi_so_factory().attachSchema(*msg, false);
@@ -2472,15 +2302,11 @@ void ApplicationManagerImpl::SendOnSDLClose() {
logger_,
"Attached schema to message, result if valid: " << msg->isValid());
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*msg);
-#else
if (!ConvertSOtoMessage(*msg, *message_to_send)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
}
-#endif // HMI_DBUS_API
if (!hmi_handler_) {
LOG4CXX_WARN(logger_, "No HMI Handler set");
@@ -2511,10 +2337,10 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
ApplicationSetConstIt it = accessor.GetData().begin();
while (it != accessor.GetData().end()) {
ApplicationSharedPtr app_to_remove = *it;
- ManageMobileCommand(
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_to_remove->app_id(), unregister_reason_),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
UnregisterApplication(app_to_remove->app_id(),
mobile_apis::Result::INVALID_ENUM,
is_ignition_off,
@@ -2525,7 +2351,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
}
}
if (is_ignition_off) {
- resume_controller().OnSuspend();
+ resume_controller().OnIgnitionOff();
}
request_ctrl_.terminateAllHMIRequests();
}
@@ -2533,7 +2359,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
const connection_handler::DeviceHandle handle) {
DevicePredicate device_finder(handle);
- apps_to_register_list_lock_.Acquire();
+ apps_to_register_list_lock_ptr_->Acquire();
AppsWaitRegistrationSet::iterator it_app = std::find_if(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
@@ -2546,7 +2372,7 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration(
apps_to_register_.begin(), apps_to_register_.end(), device_finder);
}
- apps_to_register_list_lock_.Release();
+ apps_to_register_list_lock_ptr_->Release();
}
void ApplicationManagerImpl::UnregisterApplication(
@@ -2572,9 +2398,13 @@ void ApplicationManagerImpl::UnregisterApplication(
MessageHelper::SendUnsubscribedWayPoints(*this);
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- navi_service_status_.erase(it);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ navi_service_status_.erase(it);
+ }
}
// remove appID from tts_global_properties_app_list_
@@ -2613,13 +2443,14 @@ void ApplicationManagerImpl::UnregisterApplication(
ApplicationSharedPtr app_to_remove;
connection_handler::DeviceHandle handle = 0;
{
- DataAccessor<ApplicationSet> accessor(applications());
- ApplicationSetConstIt it = accessor.GetData().begin();
- for (; it != accessor.GetData().end(); ++it) {
- if ((*it)->app_id() == app_id) {
- app_to_remove = *it;
- handle = app_to_remove->device();
- break;
+ sync_primitives::AutoLock lock(applications_list_lock_ptr_);
+ auto it_app = applications_.begin();
+ while (applications_.end() != it_app) {
+ if (app_id == (*it_app)->app_id()) {
+ app_to_remove = *it_app;
+ applications_.erase(it_app++);
+ } else {
+ ++it_app;
}
}
if (!app_to_remove) {
@@ -2632,16 +2463,17 @@ void ApplicationManagerImpl::UnregisterApplication(
return;
}
+
if (is_resuming) {
resume_controller().SaveApplication(app_to_remove);
} else {
resume_controller().RemoveApplicationFromSaved(app_to_remove);
}
- applications_.erase(app_to_remove);
+
(hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
AppV4DevicePredicate finder(handle);
- ApplicationSharedPtr app = FindApp(accessor, finder);
+ ApplicationSharedPtr app = FindApp(applications(), finder);
if (!app) {
LOG4CXX_DEBUG(
logger_, "There is no more SDL4 apps with device handle: " << handle);
@@ -2650,12 +2482,20 @@ void ApplicationManagerImpl::UnregisterApplication(
SendUpdateAppList();
}
}
- if (audio_pass_thru_active_) {
+
+ commands_holder_->Clear(app_to_remove);
+
+ if (EndAudioPassThru(app_id)) {
// May be better to put this code in MessageHelper?
- EndAudioPassThrough();
StopAudioPassThru(app_id);
MessageHelper::SendStopAudioPathThru(*this);
}
+ auto on_app_unregistered =
+ [app_to_remove](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(plugin_manager::kApplicationUnregistered,
+ app_to_remove);
+ };
+ plugin_manager_->ForEachPlugin(on_app_unregistered);
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);
@@ -2668,120 +2508,9 @@ void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) {
connection_handler::kUnauthorizedApp);
}
-void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- return;
- }
- sync_primitives::AutoLock lock(stopping_application_mng_lock_);
- if (is_stopping_) {
- LOG4CXX_INFO(logger_, "Application manager is stopping");
- return;
- }
- ProcessMessageFromMobile(message);
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageToMobile message) {
- if (!protocol_handler_) {
- LOG4CXX_WARN(logger_,
- "Protocol Handler is not set; cannot send message to mobile.");
- return;
- }
-
- utils::SharedPtr<protocol_handler::RawMessage> rawMessage =
- MobileMessageHandler::HandleOutgoingMessageProtocol(message);
-
- if (!rawMessage) {
- LOG4CXX_ERROR(logger_, "Failed to create raw message.");
- return;
- }
-
- bool is_final = message.is_final;
- bool close_session = false;
- if (is_final) {
- if (1 < connection_handler().GetConnectionSessionsCount(
- message->connection_key())) {
- is_final = false;
- close_session = true;
- }
- }
-
- protocol_handler_->SendMessageToMobileApp(rawMessage, is_final);
- LOG4CXX_INFO(logger_, "Message for mobile given away");
-
- if (close_session) {
- connection_handler().CloseSession(message->connection_key(),
- connection_handler::kCommon);
- }
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!message) {
- LOG4CXX_ERROR(logger_, "Null-pointer message received.");
- return;
- }
-
- ProcessMessageFromHMI(message);
-}
-
-void ApplicationManagerImpl::Handle(const impl::MessageToHmi message) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!hmi_handler_) {
- LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
- return;
- }
-
- hmi_handler_->SendMessageToHMI(message);
- LOG4CXX_INFO(logger_, "Message for HMI given away");
-}
-
-void ApplicationManagerImpl::Handle(const impl::AudioData message) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr on_audio_pass =
- new smart_objects::SmartObject();
-
- if (!on_audio_pass) {
- LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer");
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "Fill smart object");
-
- (*on_audio_pass)[strings::params][strings::message_type] =
- application_manager::MessageType::kNotification;
-
- (*on_audio_pass)[strings::params][strings::connection_key] =
- static_cast<int32_t>(message.session_key);
- (*on_audio_pass)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnAudioPassThruID;
-
- LOG4CXX_DEBUG(logger_, "Fill binary data");
- // binary data
- (*on_audio_pass)[strings::params][strings::binary_data] =
- smart_objects::SmartObject(message.binary_data);
-
- LOG4CXX_DEBUG(logger_, "After fill binary data");
- LOG4CXX_DEBUG(logger_, "Send data");
- CommandSharedPtr command(MobileCommandFactory::CreateCommand(
- on_audio_pass, commands::Command::ORIGIN_SDL, *this));
- if (!command) {
- LOG4CXX_WARN(logger_, "Failed to create mobile command from smart object");
- return;
- }
-
- command->Init();
- command->Run();
- command->CleanUp();
-}
-
mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
- const std::string& policy_app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::FunctionID::eType function_id,
+ const ApplicationSharedPtr app,
+ const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2791,20 +2520,9 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
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;
@@ -2812,30 +2530,22 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
params_permissions->undefined_params = result.list_of_undefined_params;
}
- if (hmi_level == mobile_apis::HMILevel::HMI_NONE &&
- function_id != mobile_apis::FunctionID::UnregisterAppInterfaceID) {
- ApplicationSharedPtr app = application_by_policy_id(policy_app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application for policy id " << policy_app_id);
- return mobile_apis::Result::GENERIC_ERROR;
- }
+ if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE &&
+ function_id != MessageHelper::StringifiedFunctionID(
+ mobile_apis::FunctionID::UnregisterAppInterfaceID)) {
if (result.hmi_level_permitted != policy::kRpcAllowed) {
app->usage_report().RecordRpcSentInHMINone();
}
}
- const std::string log_msg = "Application: " + policy_app_id + ", RPC: " +
- stringified_functionID + ", HMI status: " +
- stringified_hmi_level;
-
+#ifdef ENABLE_LOG
+ const std::string log_msg =
+ "Application: " + app->policy_app_id() + ", RPC: " + function_id +
+ ", HMI status: " + MessageHelper::StringifiedHMILevel(app->hmi_level());
+#endif // ENABLE_LOG
if (result.hmi_level_permitted != policy::kRpcAllowed) {
LOG4CXX_WARN(logger_, "Request is blocked by policies. " << log_msg);
- ApplicationSharedPtr app = application_by_policy_id(policy_app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application for policy id " << policy_app_id);
- return mobile_apis::Result::GENERIC_ERROR;
- }
app->usage_report().RecordPolicyRejectedRpcCall();
switch (result.hmi_level_permitted) {
@@ -2851,21 +2561,41 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
return mobile_api::Result::SUCCESS;
}
+bool ApplicationManagerImpl::is_stopping() const {
+ sync_primitives::AutoLock lock(stopping_application_mng_lock_);
+ return is_stopping_;
+}
+
+bool ApplicationManagerImpl::is_audio_pass_thru_active() const {
+ return audio_pass_thru_active_;
+}
+
void ApplicationManagerImpl::OnLowVoltage() {
LOG4CXX_AUTO_TRACE(logger_);
is_low_voltage_ = true;
+ resume_ctrl_->SaveLowVoltageTime();
+ resume_ctrl_->StopSavePersistentDataTimer();
request_ctrl_.OnLowVoltage();
}
-bool ApplicationManagerImpl::IsLowVoltage() {
- LOG4CXX_TRACE(logger_, "result: " << is_low_voltage_);
+bool ApplicationManagerImpl::IsLowVoltage() const {
+ LOG4CXX_TRACE(logger_, "Result: " << is_low_voltage_);
return is_low_voltage_;
}
+void ApplicationManagerImpl::OnWakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = false;
+ resume_ctrl_->SaveWakeUpTime();
+ resume_ctrl_->StartSavePersistentDataTimer();
+ request_ctrl_.OnWakeUp();
+}
+
std::string ApplicationManagerImpl::GetHashedAppID(
uint32_t connection_key, const std::string& mobile_app_id) const {
- uint32_t device_id = 0;
- connection_handler().GetDataOnSessionKey(connection_key, 0, NULL, &device_id);
+ connection_handler::DeviceHandle device_id = 0;
+ connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, 0, NULL, &device_id);
std::string device_name;
connection_handler().get_session_observer().GetDataOnDeviceID(
device_id, &device_name, NULL, NULL, NULL);
@@ -2917,8 +2647,10 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
@@ -2932,13 +2664,21 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it ||
- (!it->second.first && !it->second.second)) {
- ManageMobileCommand(
+ bool unregister = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it ||
+ (!it->second.first && !it->second.second)) {
+ unregister = true;
+ }
+ }
+ if (unregister) {
+ rpc_service_->ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_id, PROTOCOL_VIOLATION),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
UnregisterApplication(app_id, ABORTED);
return;
}
@@ -2947,22 +2687,23 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
void ApplicationManagerImpl::OnAppStreaming(
uint32_t app_id, protocol_handler::ServiceType service_type, bool state) {
- using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ " There is no navi or projection application with id: " << app_id);
return;
}
DCHECK_OR_RETURN_VOID(media_manager_);
if (state) {
- state_ctrl_.OnNaviStreamingStarted();
+ state_ctrl_.OnVideoStreamingStarted(app);
media_manager_->StartStreaming(app_id, service_type);
} else {
media_manager_->StopStreaming(app_id, service_type);
- state_ctrl_.OnNaviStreamingStopped();
+ state_ctrl_.OnVideoStreamingStopped(app);
}
}
@@ -2971,24 +2712,34 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- LOG4CXX_ERROR(logger_, "No info about navi servicies for app");
- return;
+ bool end_video = false;
+ bool end_audio = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_ERROR(logger_, "No info about navi servicies for app");
+ return;
+ }
+ end_video = it->second.first;
+ end_audio = it->second.second;
}
if (connection_handler_) {
- if (it->second.first) {
+ if (end_video) {
LOG4CXX_DEBUG(logger_, "Going to end video service");
connection_handler().SendEndService(app_id, ServiceType::kMobileNav);
app->StopStreamingForce(ServiceType::kMobileNav);
}
- if (it->second.second) {
+ if (end_audio) {
LOG4CXX_DEBUG(logger_, "Going to end audio service");
connection_handler().SendEndService(app_id, ServiceType::kAudio);
app->StopStreamingForce(ServiceType::kAudio);
@@ -2997,7 +2748,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
navi_app_to_stop_.push_back(app_id);
- TimerSPtr close_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr close_timer(std::make_shared<timer::Timer>(
"CloseNaviAppTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::CloseNaviApp)));
@@ -3013,6 +2764,40 @@ void ApplicationManagerImpl::OnHMILevelChanged(
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) {
LOG4CXX_AUTO_TRACE(logger_);
+ ProcessPostponedMessages(app_id);
+ ProcessApp(app_id, from, to);
+}
+
+void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "The app with id: " << app_id << " does not exist");
+ return;
+ }
+ MobileMessageQueue messages;
+ app->SwapMobileMessageQueue(messages);
+ auto push_allowed_messages = [this, &app](
+ smart_objects::SmartObjectSPtr message) {
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(app, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ rpc_service_->ManageMobileCommand(message, commands::Command::SOURCE_SDL);
+ } else {
+ app->PushMobileMessage(message);
+ }
+ };
+ std::for_each(messages.begin(), messages.end(), push_allowed_messages);
+}
+
+void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
+ const mobile_apis::HMILevel::eType from,
+ const mobile_apis::HMILevel::eType to) {
using namespace mobile_apis::HMILevel;
using namespace helpers;
@@ -3022,8 +2807,8 @@ void ApplicationManagerImpl::OnHMILevelChanged(
}
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
@@ -3038,7 +2823,7 @@ void ApplicationManagerImpl::OnHMILevelChanged(
if (from == HMI_FULL || from == HMI_LIMITED) {
LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED");
navi_app_to_end_stream_.push_back(app_id);
- TimerSPtr end_stream_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr end_stream_timer(std::make_shared<timer::Timer>(
"AppShouldFinishStreaming",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::EndNaviStreaming)));
@@ -3056,11 +2841,11 @@ void ApplicationManagerImpl::OnHMILevelChanged(
}
void ApplicationManagerImpl::SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) {
+ const std::shared_ptr<Application> app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -3078,10 +2863,14 @@ void ApplicationManagerImpl::SendHMIStatusNotification(
message[strings::msg_params][strings::audio_streaming_state] =
static_cast<int32_t>(app->audio_streaming_state());
+ message[strings::msg_params][strings::video_streaming_state] =
+ static_cast<int32_t>(app->video_streaming_state());
+
message[strings::msg_params][strings::system_context] =
static_cast<int32_t>(app->system_context());
- ManageMobileCommand(notification, commands::Command::ORIGIN_SDL);
+ rpc_service_->ManageMobileCommand(notification,
+ commands::Command::SOURCE_SDL);
}
void ApplicationManagerImpl::ClearTimerPool() {
@@ -3110,18 +2899,26 @@ void ApplicationManagerImpl::CloseNaviApp() {
uint32_t app_id = navi_app_to_stop_.front();
navi_app_to_stop_.pop_front();
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- if (it->second.first || it->second.second) {
- LOG4CXX_INFO(logger_,
- "App haven't answered for EndService. Unregister it.");
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, PROTOCOL_VIOLATION),
- commands::Command::ORIGIN_SDL);
- UnregisterApplication(app_id, ABORTED);
+ bool unregister = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first || it->second.second) {
+ unregister = true;
+ }
}
}
+ if (unregister) {
+ LOG4CXX_INFO(logger_,
+ "App haven't answered for EndService. Unregister it.");
+ rpc_service_->ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, PROTOCOL_VIOLATION),
+ commands::Command::SOURCE_SDL);
+ UnregisterApplication(app_id, ABORTED);
+ }
}
void ApplicationManagerImpl::EndNaviStreaming() {
@@ -3145,18 +2942,22 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- if (it->second.first) {
- app->set_video_streaming_allowed(false);
- }
- if (it->second.second) {
- app->set_audio_streaming_allowed(false);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first) {
+ app->set_video_streaming_allowed(false);
+ }
+ if (it->second.second) {
+ app->set_audio_streaming_allowed(false);
+ }
}
}
}
@@ -3166,18 +2967,22 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- if (it->second.first) {
- app->set_video_streaming_allowed(true);
- }
- if (it->second.second) {
- app->set_audio_streaming_allowed(true);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first) {
+ app->set_video_streaming_allowed(true);
+ }
+ if (it->second.second) {
+ app->set_audio_streaming_allowed(true);
+ }
}
}
}
@@ -3188,22 +2993,27 @@ bool ApplicationManagerImpl::IsApplicationForbidden(
return forbidden_applications.find(name) != forbidden_applications.end();
}
-policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
- const std::string& device_id) const {
- return policy_handler_.GetUserConsentForDevice(device_id);
+bool ApplicationManagerImpl::IsAppInReconnectMode(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ return reregister_wait_list_.end() !=
+ std::find_if(reregister_wait_list_.begin(),
+ reregister_wait_list_.end(),
+ std::bind1st(std::ptr_fun(&policy_app_id_comparator),
+ policy_app_id));
}
-void ApplicationManagerImpl::OnWakeUp() {
- LOG4CXX_AUTO_TRACE(logger_);
- is_low_voltage_ = false;
- request_ctrl_.OnWakeUp();
+policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
+ const std::string& device_id) const {
+ return GetPolicyHandler().GetUserConsentForDevice(device_id);
}
mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) {
+ const uint64_t offset) {
LOG4CXX_DEBUG(logger_,
"SaveBinaryWithOffset binary_size = "
<< binary_data.size() << " offset = " << offset);
@@ -3214,7 +3024,7 @@ mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
}
const std::string full_file_path = file_path + "/" + file_name;
- const int64_t file_size = file_system::FileSize(full_file_path);
+ const uint64_t file_size = file_system::FileSize(full_file_path);
std::ofstream* file_stream;
if (offset != 0) {
if (file_size != offset) {
@@ -3281,22 +3091,26 @@ bool ApplicationManagerImpl::IsHMICooperating() const {
void ApplicationManagerImpl::OnApplicationListUpdateTimer() {
LOG4CXX_DEBUG(logger_, "Application list update timer finished");
+
+ apps_to_register_list_lock_ptr_->Acquire();
+ const bool trigger_ptu = apps_size_ != applications_.size();
+ apps_to_register_list_lock_ptr_->Release();
SendUpdateAppList();
- GetPolicyHandler().OnAppsSearchCompleted();
+ GetPolicyHandler().OnAppsSearchCompleted(trigger_ptu);
}
void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
std::vector<uint32_t> app_list;
{
sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.begin();
- std::map<uint32_t, TimevalStruct>::iterator it_end =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it_end =
tts_global_properties_app_list_.end();
date_time::TimeCompare time_comp;
for (; it != it_end; ++it) {
- time_comp = date_time::DateTime::compareTime(
- date_time::DateTime::getCurrentTime(), it->second);
+ time_comp =
+ date_time::compareTime(date_time::getCurrentTime(), it->second);
if (date_time::GREATER == time_comp || date_time::EQUAL == time_comp) {
app_list.push_back(it->first);
}
@@ -3317,8 +3131,8 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
uint16_t timeout = get_settings().tts_global_properties_timeout();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- current_time.tv_sec += timeout;
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
+ current_time += date_time::seconds(timeout);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
if (tts_global_properties_app_list_.end() ==
@@ -3341,7 +3155,7 @@ void ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList(
LOG4CXX_AUTO_TRACE(logger_);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.find(app_id);
if (tts_global_properties_app_list_.end() != it) {
tts_global_properties_app_list_.erase(it);
@@ -3369,6 +3183,8 @@ mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(
return mobile_apis::AppHMIType::MESSAGING;
} else if ("NAVIGATION" == str) {
return mobile_apis::AppHMIType::NAVIGATION;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
} else if ("INFORMATION" == str) {
return mobile_apis::AppHMIType::INFORMATION;
} else if ("SOCIAL" == str) {
@@ -3384,6 +3200,39 @@ mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(
}
}
+const std::string ApplicationManagerImpl::AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (type) {
+ case mobile_apis::AppHMIType::DEFAULT:
+ return "DEFAULT";
+ case mobile_apis::AppHMIType::COMMUNICATION:
+ return "COMMUNICATION";
+ case mobile_apis::AppHMIType::MEDIA:
+ return "MEDIA";
+ case mobile_apis::AppHMIType::MESSAGING:
+ return "MESSAGING";
+ case mobile_apis::AppHMIType::NAVIGATION:
+ return "NAVIGATION";
+ case mobile_apis::AppHMIType::INFORMATION:
+ return "INFORMATION";
+ case mobile_apis::AppHMIType::SOCIAL:
+ return "SOCIAL";
+ case mobile_apis::AppHMIType::BACKGROUND_PROCESS:
+ return "BACKGROUND_PROCESS";
+ case mobile_apis::AppHMIType::TESTING:
+ return "TESTING";
+ case mobile_apis::AppHMIType::SYSTEM:
+ return "SYSTEM";
+ case mobile_apis::AppHMIType::PROJECTION:
+ return "PROJECTION";
+ case mobile_apis::AppHMIType::REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
+ default:
+ return "INVALID_ENUM";
+ }
+}
+
bool ApplicationManagerImpl::CompareAppHMIType(
const smart_objects::SmartObject& from_policy,
const smart_objects::SmartObject& from_application) {
@@ -3467,24 +3316,100 @@ void ApplicationManagerImpl::OnUpdateHMIAppType(
}
}
-ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const {
+void ApplicationManagerImpl::EraseAppFromReconnectionList(
+ const ApplicationSharedPtr& app) {
LOG4CXX_AUTO_TRACE(logger_);
- bool heart_beat_support = get_settings().heart_beat_timeout();
- bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4();
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Application is not valid.");
+ return;
+ }
- if (sdl4_support) {
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV4);
- return ProtocolVersion::kV4;
+ const auto policy_app_id = app->policy_app_id();
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ auto app_it = std::find_if(
+ reregister_wait_list_.begin(),
+ reregister_wait_list_.end(),
+ std::bind1st(std::ptr_fun(&policy_app_id_comparator), policy_app_id));
+ if (reregister_wait_list_.end() != app_it) {
+ reregister_wait_list_.erase(app_it);
}
- if (heart_beat_support) {
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV3);
- return ProtocolVersion::kV3;
+}
+
+void ApplicationManagerImpl::ProcessReconnection(
+ ApplicationSharedPtr application, const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+
+ connection_handler::DeviceHandle new_device_id = 0;
+ connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, NULL, NULL, &new_device_id);
+ DCHECK_OR_RETURN_VOID(new_device_id);
+
+ std::string device_mac;
+ std::string connection_type;
+ connection_handler().get_session_observer().GetDataOnDeviceID(
+ new_device_id, NULL, NULL, &device_mac, &connection_type);
+
+ EraseAppFromReconnectionList(application);
+
+ SwitchApplication(application, connection_key, new_device_id, device_mac);
+
+ // Update connection type for existed device.
+ GetPolicyHandler().AddDevice(device_mac, connection_type);
+}
+
+void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!ptu_result) {
+ return;
}
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV2);
- return ProtocolVersion::kV2;
+ auto on_app_policy_updated = [](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnPolicyEvent(plugin_manager::kApplicationPolicyUpdated);
+ };
+
+ plugin_manager_->ForEachPlugin(on_app_policy_updated);
+}
+
+void ApplicationManagerImpl::SendDriverDistractionState(
+ ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (hmi_apis::Common_DriverDistractionState::INVALID_ENUM ==
+ driver_distraction_state()) {
+ LOG4CXX_WARN(logger_, "DriverDistractionState is INVALID_ENUM");
+ return;
+ }
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ std::make_shared<smart_objects::SmartObject>();
+
+ (*on_driver_distraction)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ driver_distraction_state();
+ (*on_driver_distraction)[strings::params][strings::connection_key] =
+ application->app_id();
+
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*on_driver_distraction)[strings::params][strings::function_id]
+ .asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(application, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ rpc_service_->ManageMobileCommand(on_driver_distraction,
+ commands::Command::SOURCE_SDL);
+ } else {
+ application->PushMobileMessage(on_driver_distraction);
+ }
+}
+
+protocol_handler::MajorProtocolVersion
+ApplicationManagerImpl::SupportedSDLVersion() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return static_cast<protocol_handler::MajorProtocolVersion>(
+ get_settings().max_supported_protocol_version());
}
event_engine::EventDispatcher& ApplicationManagerImpl::event_dispatcher() {
@@ -3547,40 +3472,248 @@ void ApplicationManagerImpl::ClearTTSGlobalPropertiesList() {
}
bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
- const uint32_t app_id) const {
+ ApplicationSharedPtr app) const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- if (subscribed_way_points_apps_list_.find(app_id) ==
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
+ if (subscribed_way_points_apps_list_.find(app->app_id()) ==
subscribed_way_points_apps_list_.end()) {
return false;
}
return true;
}
-void ApplicationManagerImpl::SubscribeAppForWayPoints(const uint32_t app_id) {
+void ApplicationManagerImpl::SubscribeAppForWayPoints(
+ ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.insert(app_id);
+ LOG4CXX_DEBUG(logger_, "Subscribing " << app->app_id());
+ subscribed_way_points_apps_list_.insert(app->app_id());
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
}
void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
- const uint32_t app_id) {
+ ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.erase(app_id);
+ LOG4CXX_DEBUG(logger_, "Unsubscribing " << app->app_id());
+ subscribed_way_points_apps_list_.erase(app->app_id());
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
}
bool ApplicationManagerImpl::IsAnyAppSubscribedForWayPoints() const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
return !subscribed_way_points_apps_list_.empty();
}
-const std::set<int32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
+const std::set<uint32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
return subscribed_way_points_apps_list_;
}
+// retrieve transport type string used in .ini file, e.g. "TCP_WIFI"
+const std::string ApplicationManagerImpl::GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ return connection_handler()
+ .get_session_observer()
+ .TransportTypeProfileStringFromDeviceHandle(device_handle);
+}
+
+static hmi_apis::Common_VideoStreamingProtocol::eType ConvertVideoProtocol(
+ const char* str) {
+ if (strcmp(str, "RAW") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RAW;
+ } else if (strcmp(str, "RTP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTP;
+ } else if (strcmp(str, "RTSP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTSP;
+ } else if (strcmp(str, "RTMP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTMP;
+ } else if (strcmp(str, "WEBM") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::WEBM;
+ }
+ return hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM;
+}
+
+static hmi_apis::Common_VideoStreamingCodec::eType ConvertVideoCodec(
+ const char* str) {
+ if (strcmp(str, "H264") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::H264;
+ } else if (strcmp(str, "H265") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::H265;
+ } else if (strcmp(str, "Theora") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::Theora;
+ } else if (strcmp(str, "VP8") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::VP8;
+ } else if (strcmp(str, "VP9") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::VP9;
+ }
+ return hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM;
+}
+
+// static
+void ApplicationManagerImpl::ConvertVideoParamsToSO(
+ smart_objects::SmartObject& output, const BsonObject* input) {
+ if (input == NULL) {
+ return;
+ }
+ BsonObject* obj = const_cast<BsonObject*>(input);
+
+ const char* protocol =
+ bson_object_get_string(obj, protocol_handler::strings::video_protocol);
+ if (protocol != NULL) {
+ output[strings::protocol] = ConvertVideoProtocol(protocol);
+ }
+ const char* codec =
+ bson_object_get_string(obj, protocol_handler::strings::video_codec);
+ if (codec != NULL) {
+ output[strings::codec] = ConvertVideoCodec(codec);
+ }
+ BsonElement* element =
+ bson_object_get(obj, protocol_handler::strings::height);
+ if (element != NULL && element->type == TYPE_INT32) {
+ output[strings::height] =
+ bson_object_get_int32(obj, protocol_handler::strings::height);
+ }
+ element = bson_object_get(obj, protocol_handler::strings::width);
+ if (element != NULL && element->type == TYPE_INT32) {
+ output[strings::width] =
+ bson_object_get_int32(obj, protocol_handler::strings::width);
+ }
+}
+
+// static
+std::vector<std::string> ApplicationManagerImpl::ConvertRejectedParamList(
+ const std::vector<std::string>& input) {
+ std::vector<std::string> output;
+ for (std::vector<std::string>::const_iterator it = input.begin();
+ it != input.end();
+ ++it) {
+ if (*it == strings::protocol) {
+ output.push_back(protocol_handler::strings::video_protocol);
+ } else if (*it == strings::codec) {
+ output.push_back(protocol_handler::strings::video_codec);
+ } else if (*it == strings::height) {
+ output.push_back(protocol_handler::strings::height);
+ } else if (*it == strings::width) {
+ output.push_back(protocol_handler::strings::width);
+ }
+ // ignore unknown parameters
+ }
+ return output;
+}
+
+bool ApplicationManagerImpl::IsSOStructValid(
+ const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities) {
+ smart_objects::SmartObject display_capabilities_so = display_capabilities;
+ if (hmi_so_factory().AttachSchema(struct_id, display_capabilities_so)) {
+ if (display_capabilities_so.isValid()) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Could not find struct id: " << struct_id);
+ return false;
+ }
+ return true;
+}
+
+#ifdef BUILD_TESTS
+void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) {
+ applications_list_lock_ptr_->Acquire();
+ applications_.insert(mock_app);
+ apps_size_ = applications_.size();
+ applications_list_lock_ptr_->Release();
+}
+
+void ApplicationManagerImpl::SetMockMediaManager(
+ media_manager::MediaManager* mock_media_manager) {
+ media_manager_ = mock_media_manager;
+}
+#endif // BUILD_TESTS
+struct MobileAppIdPredicate {
+ std::string policy_app_id_;
+ MobileAppIdPredicate(const std::string& policy_app_id)
+ : policy_app_id_(policy_app_id) {}
+ bool operator()(const ApplicationSharedPtr app) const {
+ return app ? policy_app_id_ == app->policy_app_id() : false;
+ }
+};
+
+struct TakeDeviceHandle {
+ public:
+ TakeDeviceHandle(const ApplicationManager& app_mngr) : app_mngr_(app_mngr) {}
+ std::string operator()(ApplicationSharedPtr& app) {
+ DCHECK_OR_RETURN(app, "");
+ return MessageHelper::GetDeviceMacAddressForHandle(app->device(),
+ app_mngr_);
+ }
+
+ private:
+ const ApplicationManager& app_mngr_;
+};
+
+ApplicationSharedPtr ApplicationManagerImpl::application(
+ const std::string& device_id, const std::string& policy_app_id) const {
+ connection_handler::DeviceHandle device_handle;
+ if (!connection_handler().GetDeviceID(device_id, &device_handle)) {
+ LOG4CXX_DEBUG(logger_, "No such device : " << device_id);
+ return ApplicationSharedPtr();
+ }
+
+ DataAccessor<ApplicationSet> accessor = applications();
+ ApplicationSharedPtr app =
+ FindApp(accessor, IsApplication(device_handle, policy_app_id));
+
+ LOG4CXX_DEBUG(logger_,
+ " policy_app_id << " << policy_app_id << "Found = " << app);
+ return app;
+}
+
+std::vector<std::string> ApplicationManagerImpl::devices(
+ const std::string& policy_app_id) const {
+ MobileAppIdPredicate matcher(policy_app_id);
+ AppSharedPtrs apps = FindAllApps(applications(), matcher);
+ std::vector<std::string> devices;
+ std::transform(apps.begin(),
+ apps.end(),
+ std::back_inserter(devices),
+ TakeDeviceHandle(*this));
+ return devices;
+}
+
+void ApplicationManagerImpl::ChangeAppsHMILevel(
+ uint32_t app_id, mobile_apis::HMILevel::eType level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "AppID to change: " << app_id << " -> " << level);
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id);
+ return;
+ }
+ const mobile_apis::HMILevel::eType old_level = app->hmi_level();
+ if (old_level != level) {
+ app->set_hmi_level(level);
+ OnHMILevelChanged(app_id, old_level, level);
+ } else {
+ LOG4CXX_WARN(logger_, "Redundant changing HMI level: " << level);
+ }
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc
index 101a565a8e..3f775ee4e2 100644
--- a/src/components/application_manager/src/application_state.cc
+++ b/src/components/application_manager/src/application_state.cc
@@ -101,7 +101,6 @@ void ApplicationState::RemoveState(HmiState::StateID state) {
}
HmiStatePtr ApplicationState::GetState(HmiState::StateID state_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
switch (state_id) {
case HmiState::StateID::STATE_ID_REGULAR:
LOG4CXX_DEBUG(logger_, "Getting regular state.");
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
new file mode 100644
index 0000000000..ea74e78f4e
--- /dev/null
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/command_holder_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command.h"
+
+namespace application_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager)
+ : app_manager_(app_manager) {}
+
+void CommandHolderImpl::Suspend(
+ ApplicationSharedPtr application,
+ CommandType type,
+ std::shared_ptr<smart_objects::SmartObject> command) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(logger_,
+ "Suspending command(s) for application: "
+ << application->policy_app_id());
+ sync_primitives::AutoLock lock(commands_lock_);
+
+ if (CommandType::kHmiCommand == type) {
+ app_hmi_commands_[application].push_back(command);
+ LOG4CXX_DEBUG(logger_,
+ "Suspended HMI command(s): " << app_hmi_commands_.size());
+ } else {
+ app_mobile_commands_[application].push_back(command);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Suspended mobile command(s): " << app_mobile_commands_.size());
+ }
+}
+
+void CommandHolderImpl::Resume(ApplicationSharedPtr application,
+ CommandType type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Resuming command(s) for application: " << application->policy_app_id());
+ if (CommandType::kHmiCommand == type) {
+ ResumeHmiCommand(application);
+ } else {
+ ResumeMobileCommand(application);
+ }
+}
+
+void CommandHolderImpl::Clear(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing command(s) for application: " << application->policy_app_id());
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_hmi_commands = app_hmi_commands_.find(application);
+ if (app_hmi_commands_.end() != app_hmi_commands) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing HMI command(s): " << app_hmi_commands->second.size());
+ app_hmi_commands_.erase(app_hmi_commands);
+ }
+
+ auto app_mobile_commands = app_mobile_commands_.find(application);
+ if (app_mobile_commands_.end() != app_mobile_commands) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing mobile command(s): " << app_mobile_commands->second.size());
+ app_mobile_commands_.erase(app_mobile_commands);
+ }
+}
+
+void CommandHolderImpl::ResumeHmiCommand(ApplicationSharedPtr application) {
+ DCHECK_OR_RETURN_VOID(application);
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_commands = app_hmi_commands_.find(application);
+ if (app_hmi_commands_.end() == app_commands) {
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resuming HMI command(s): " << app_hmi_commands_.size());
+
+ for (auto cmd : app_commands->second) {
+ (*cmd)[strings::msg_params][strings::app_id] = application->hmi_app_id();
+ app_manager_.GetRPCService().ManageHMICommand(cmd);
+ }
+
+ app_hmi_commands_.erase(app_commands);
+}
+
+void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
+ DCHECK_OR_RETURN_VOID(application);
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_commands = app_mobile_commands_.find(application);
+ if (app_mobile_commands_.end() == app_commands) {
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resuming mobile command(s): " << app_mobile_commands_.size());
+
+ for (auto cmd : app_commands->second) {
+ (*cmd)[strings::params][strings::connection_key] = application->app_id();
+ app_manager_.GetRPCService().ManageMobileCommand(
+ cmd, commands::Command::CommandSource::SOURCE_MOBILE);
+ }
+
+ app_mobile_commands_.erase(app_commands);
+}
+} // application_manager
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 0a3e65a790..04fabfb2ec 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -35,6 +35,16 @@
#include "application_manager/application_manager.h"
namespace application_manager {
+
+namespace {
+struct AppExtensionPredicate {
+ AppExtensionUID uid;
+ bool operator()(const ApplicationSharedPtr app) {
+ return app ? (app->QueryInterface(uid).use_count() != 0) : false;
+ }
+};
+}
+
namespace commands {
CREATE_LOGGERPTR_LOCAL(CommandImpl::logger_, "Commands")
@@ -44,11 +54,17 @@ const int32_t CommandImpl::mobile_protocol_type_ = 0;
const int32_t CommandImpl::protocol_version_ = 3;
CommandImpl::CommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
: message_(message)
, default_timeout_(application_manager.get_settings().default_timeout())
, allowed_to_terminate_(true)
- , application_manager_(application_manager) {}
+ , application_manager_(application_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
CommandImpl::~CommandImpl() {
CleanUp();
@@ -94,25 +110,30 @@ void CommandImpl::SetAllowedToTerminate(const bool allowed) {
allowed_to_terminate_ = allowed;
}
-void CommandImpl::ReplaceMobileByHMIAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+bool CommandImpl::ReplaceMobileWithHMIAppId(
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application(message[strings::app_id].asUInt());
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceMobileByHMIAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->hmi_app_id());
- message[strings::app_id] = application->hmi_app_id();
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Substitution mobile --> HMI id is failed.");
+ return false;
}
+ LOG4CXX_DEBUG(logger_,
+ "ReplaceMobileWithHMIAppId from "
+ << message[strings::app_id].asInt() << " to "
+ << application->hmi_app_id());
+ message[strings::app_id] = application->hmi_app_id();
} else {
switch (message.getType()) {
case smart_objects::SmartType::SmartType_Array: {
smart_objects::SmartArray* message_array = message.asArray();
smart_objects::SmartArray::iterator it = message_array->begin();
for (; it != message_array->end(); ++it) {
- ReplaceMobileByHMIAppId(*it);
+ if (!ReplaceMobileWithHMIAppId(*it)) {
+ break;
+ }
}
break;
}
@@ -121,36 +142,44 @@ void CommandImpl::ReplaceMobileByHMIAppId(
std::set<std::string>::const_iterator key = keys.begin();
for (; key != keys.end(); ++key) {
std::string k = *key;
- ReplaceMobileByHMIAppId(message[*key]);
+ if (!ReplaceMobileWithHMIAppId(message[*key])) {
+ break;
+ }
}
break;
}
default: { break; }
}
}
+
+ return true;
}
-void CommandImpl::ReplaceHMIByMobileAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+bool CommandImpl::ReplaceHMIWithMobileAppId(
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application_by_hmi_app(
message[strings::app_id].asUInt());
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Substitution HMI --> mobile id is failed.");
+ return false;
}
+ LOG4CXX_DEBUG(logger_,
+ "ReplaceHMIWithMobileAppId from "
+ << message[strings::app_id].asInt() << " to "
+ << application->app_id());
+ message[strings::app_id] = application->app_id();
} else {
switch (message.getType()) {
case smart_objects::SmartType::SmartType_Array: {
smart_objects::SmartArray* message_array = message.asArray();
smart_objects::SmartArray::iterator it = message_array->begin();
for (; it != message_array->end(); ++it) {
- ReplaceHMIByMobileAppId(*it);
+ if (!ReplaceHMIWithMobileAppId(*it)) {
+ break;
+ }
}
break;
}
@@ -158,13 +187,17 @@ void CommandImpl::ReplaceHMIByMobileAppId(
std::set<std::string> keys = message.enumerate();
std::set<std::string>::const_iterator key = keys.begin();
for (; key != keys.end(); ++key) {
- ReplaceHMIByMobileAppId(message[*key]);
+ if (!ReplaceHMIWithMobileAppId(message[*key])) {
+ break;
+ }
}
break;
}
default: { break; }
}
}
+
+ return true;
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
index 5b44abeec9..4e9a2556de 100644
--- a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc
@@ -32,6 +32,7 @@
#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
namespace application_manager {
@@ -39,8 +40,16 @@ namespace application_manager {
namespace commands {
CommandNotificationFromMobileImpl::CommandNotificationFromMobileImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CommandNotificationFromMobileImpl::~CommandNotificationFromMobileImpl() {}
@@ -63,7 +72,7 @@ void CommandNotificationFromMobileImpl::SendNotification() {
LOG4CXX_INFO(logger_, "SendNotification");
MessageHelper::PrintSmartObject(*message_);
- application_manager_.SendMessageToMobile(message_);
+ rpc_service_.SendMessageToMobile(message_);
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc
index b6b0e7d500..70df95986b 100644
--- a/src/components/application_manager/src/commands/command_notification_impl.cc
+++ b/src/components/application_manager/src/commands/command_notification_impl.cc
@@ -32,6 +32,7 @@
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
namespace application_manager {
@@ -39,8 +40,16 @@ namespace application_manager {
namespace commands {
CommandNotificationImpl::CommandNotificationImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CommandNotificationImpl::~CommandNotificationImpl() {}
@@ -63,7 +72,7 @@ void CommandNotificationImpl::SendNotification() {
LOG4CXX_INFO(logger_, "SendNotification");
MessageHelper::PrintSmartObject(*message_);
- application_manager_.SendMessageToMobile(message_);
+ rpc_service_.SendMessageToMobile(message_);
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index bafad52563..68e8cfe6b4 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -31,12 +31,16 @@
*/
#include <algorithm>
+#include <numeric>
#include <string>
#include "utils/macro.h"
+
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/message_helper.h"
#include "smart_objects/smart_object.h"
+
namespace application_manager {
namespace commands {
@@ -89,6 +93,9 @@ const std::string CreateInfoForUnsupportedResult(
case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
return "VehicleInfo is not supported by system";
}
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): {
+ return "Remote control is not supported by system";
+ }
default:
#ifdef ENABLE_LOG
CREATE_LOGGERPTR_LOCAL(logger, "Commands");
@@ -102,20 +109,29 @@ const std::string CreateInfoForUnsupportedResult(
}
bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) {
- if (first.is_ok && second.is_unsupported_resource &&
- second.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) {
+ if (first.is_ok && second.is_unsupported_resource) {
+ return true;
+ }
+ if (first.is_ok && second.is_not_used) {
+ return true;
+ }
+ if (first.is_ok && second.is_ok) {
return true;
}
return false;
}
-bool IsResultCodeUnsupported(const ResponseInfo& first,
- const ResponseInfo& second) {
- return ((first.is_ok || first.is_invalid_enum) &&
- second.is_unsupported_resource) ||
- ((second.is_ok || second.is_invalid_enum) &&
- first.is_unsupported_resource) ||
- (first.is_unsupported_resource && second.is_unsupported_resource);
+bool IsResultCodeWarning(const ResponseInfo& first,
+ const ResponseInfo& second) {
+ const bool first_is_ok_second_is_warn =
+ (first.is_ok || first.is_not_used) &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ const bool both_warnings =
+ hmi_apis::Common_Result::WARNINGS == first.result_code &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ return first_is_ok_second_is_warn || both_warnings;
}
struct DisallowedParamsInserter {
@@ -129,7 +145,8 @@ struct DisallowedParamsInserter {
VehicleData::const_iterator it = vehicle_data.find(param);
if (vehicle_data.end() != it) {
smart_objects::SmartObjectSPtr disallowed_param =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*disallowed_param)[strings::data_type] = (*it).second;
(*disallowed_param)[strings::result_code] = code_;
response_[strings::msg_params][param.c_str()] = *disallowed_param;
@@ -143,13 +160,61 @@ struct DisallowedParamsInserter {
mobile_apis::VehicleDataResultCode::eType code_;
};
-CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager)
+ResponseInfo::ResponseInfo()
+ : result_code(hmi_apis::Common_Result::INVALID_ENUM)
+ , interface(HmiInterfaces::HMI_INTERFACE_INVALID_ENUM)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {}
+
+ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager)
+ : result_code(result)
+ , interface(hmi_interface)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {
+ using namespace helpers;
+
+ interface_state =
+ application_manager.hmi_interfaces().GetInterfaceState(hmi_interface);
+
+ is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_code,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED);
+
+ is_not_used = hmi_apis::Common_Result::INVALID_ENUM == result_code;
+
+ is_unsupported_resource =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
+}
+
+CommandRequestImpl::CommandRequestImpl(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, EventObserver(application_manager.event_dispatcher())
- , current_state_(kAwaitingHMIResponse) {}
+ , current_state_(kAwaitingHMIResponse)
+ , hash_update_mode_(kSkipHashUpdate)
+ , is_success_result_(false) {}
-CommandRequestImpl::~CommandRequestImpl() {}
+CommandRequestImpl::~CommandRequestImpl() {
+ UpdateHash();
+}
bool CommandRequestImpl::Init() {
return true;
@@ -186,8 +251,8 @@ void CommandRequestImpl::onTimeOut() {
function_id(),
correlation_id(),
mobile_api::Result::GENERIC_ERROR);
-
- application_manager_.ManageMobileCommand(response, ORIGIN_SDL);
+ AddTimeOutComponentInfoToMessage(*response);
+ rpc_service_.ManageMobileCommand(response, SOURCE_SDL);
}
void CommandRequestImpl::on_event(const event_engine::Event& event) {}
@@ -197,6 +262,7 @@ void CommandRequestImpl::SendResponse(
const mobile_apis::Result::eType& result_code,
const char* info,
const smart_objects::SmartObject* response_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
{
sync_primitives::AutoLock auto_lock(state_lock_);
if (kTimedOut == current_state_) {
@@ -207,11 +273,9 @@ void CommandRequestImpl::SendResponse(
current_state_ = kCompleted;
}
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
smart_objects::SmartObject& response = *result;
response[strings::params][strings::message_type] = MessageType::kResponse;
@@ -249,7 +313,9 @@ void CommandRequestImpl::SendResponse(
response[strings::msg_params][strings::success] = success;
response[strings::msg_params][strings::result_code] = result_code;
- application_manager_.ManageMobileCommand(result, ORIGIN_SDL);
+ is_success_result_ = success;
+
+ rpc_service_.ManageMobileCommand(result, SOURCE_SDL);
}
bool CommandRequestImpl::CheckSyntax(const std::string& str,
@@ -308,11 +374,52 @@ bool CommandRequestImpl::ProcessHMIInterfacesAvailability(
return true;
}
+void CommandRequestImpl::UpdateHash() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (hash_update_mode_ == kSkipHashUpdate) {
+ LOG4CXX_DEBUG(logger_, "Hash update is disabled for " << function_id());
+ return;
+ }
+
+ if (HmiInterfaces::InterfaceState::STATE_NOT_RESPONSE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI)) {
+ LOG4CXX_ERROR(logger_,
+ "UI interface has not responded. Hash won't be updated.");
+ return;
+ }
+
+ if (!is_success_result_) {
+ LOG4CXX_WARN(logger_, "Command is not succeeded. Hash won't be updated.");
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key "
+ << connection_key()
+ << " not found. Not able to update hash.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Updating hash for application with connection key "
+ << connection_key() << " while processing function id "
+ << MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())));
+
+ application->UpdateHash();
+}
+
uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
bool use_events) {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
const uint32_t hmi_correlation_id =
application_manager_.GetNextHMICorrelationID();
@@ -337,7 +444,7 @@ uint32_t CommandRequestImpl::SendHMIRequest(
subscribe_on_event(function_id, hmi_correlation_id);
}
if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) {
- if (!application_manager_.ManageHMICommand(result)) {
+ if (!rpc_service_.ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
}
@@ -349,8 +456,9 @@ uint32_t CommandRequestImpl::SendHMIRequest(
void CommandRequestImpl::CreateHMINotification(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ const ns_smart::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -366,7 +474,7 @@ void CommandRequestImpl::CreateHMINotification(
notify[strings::params][strings::function_id] = function_id;
notify[strings::msg_params] = msg_params;
- if (!application_manager_.ManageHMICommand(result)) {
+ if (!rpc_service_.ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
}
}
@@ -475,6 +583,10 @@ mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode(
mobile_result = mobile_apis::Result::SAVED;
break;
}
+ case hmi_apis::Common_Result::READ_ONLY: {
+ mobile_result = mobile_apis::Result::READ_ONLY;
+ break;
+ }
default: {
LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code);
break;
@@ -493,7 +605,7 @@ bool CommandRequestImpl::CheckAllowedParameters() {
return true;
}
- const ApplicationConstSharedPtr app =
+ const ApplicationSharedPtr app =
application_manager_.application(connection_key());
if (!app) {
LOG4CXX_ERROR(logger_,
@@ -510,17 +622,15 @@ bool CommandRequestImpl::CheckAllowedParameters() {
smart_objects::SmartMap::const_iterator iter_end = s_map.map_end();
for (; iter != iter_end; ++iter) {
- if (iter->second.asBool()) {
- LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
- params.insert(iter->first);
- }
+ LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
}
mobile_apis::Result::eType check_result =
application_manager_.CheckPolicyPermissions(
- app->policy_app_id(),
- app->hmi_level(),
- static_cast<mobile_api::FunctionID::eType>(function_id()),
+ app,
+ MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())),
params,
&parameters_permissions_);
@@ -533,7 +643,7 @@ bool CommandRequestImpl::CheckAllowedParameters() {
correlation_id(),
app->app_id());
- application_manager_.SendMessageToMobile(response);
+ rpc_service_.SendMessageToMobile(response);
return false;
}
@@ -550,6 +660,42 @@ bool CommandRequestImpl::CheckAllowedParameters() {
return true;
}
+bool CommandRequestImpl::CheckHMICapabilities(
+ const mobile_apis::ButtonName::eType button) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace smart_objects;
+ using namespace mobile_apis;
+
+ if (!hmi_capabilities_.is_ui_cooperating()) {
+ LOG4CXX_ERROR(logger_, "UI is not supported by HMI");
+ return false;
+ }
+
+ const SmartObject* button_capabilities_so =
+ hmi_capabilities_.button_capabilities();
+ if (!button_capabilities_so) {
+ LOG4CXX_ERROR(logger_, "Invalid button capabilities object");
+ return false;
+ }
+
+ const SmartObject& button_capabilities = *button_capabilities_so;
+ for (size_t i = 0; i < button_capabilities.length(); ++i) {
+ const SmartObject& capabilities = button_capabilities[i];
+ const ButtonName::eType current_button = static_cast<ButtonName::eType>(
+ capabilities.getElement(hmi_response::button_name).asInt());
+ if (current_button == button) {
+ LOG4CXX_DEBUG(logger_,
+ "Button capabilities for " << button << " was found");
+ return true;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Button capabilities for " << button << " was not found");
+ return false;
+}
+
void CommandRequestImpl::RemoveDisallowedParameters() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -668,6 +814,7 @@ bool CommandRequestImpl::HasDisallowedParams() const {
bool CommandRequestImpl::PrepareResultForMobileResponse(
hmi_apis::Common_Result::eType result_code,
HmiInterfaces::InterfaceID interface) const {
+ LOG4CXX_AUTO_TRACE(logger_);
using namespace helpers;
if (Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
result_code,
@@ -690,48 +837,9 @@ bool CommandRequestImpl::PrepareResultForMobileResponse(
bool CommandRequestImpl::PrepareResultForMobileResponse(
ResponseInfo& out_first, ResponseInfo& out_second) const {
- using namespace helpers;
-
- out_first.is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- out_first.result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED);
-
- out_second.is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- out_second.result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED);
-
- out_first.is_invalid_enum =
- hmi_apis::Common_Result::INVALID_ENUM == out_first.result_code;
-
- out_second.is_invalid_enum =
- hmi_apis::Common_Result::INVALID_ENUM == out_second.result_code;
-
- out_first.is_unsupported_resource =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == out_first.result_code;
-
- out_second.is_unsupported_resource =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == out_second.result_code;
-
- out_first.interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- out_first.interface);
- out_second.interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- out_second.interface);
-
- bool result = (out_first.is_ok && out_second.is_ok) ||
- (out_second.is_invalid_enum && out_first.is_ok) ||
- (out_first.is_invalid_enum && out_second.is_ok);
- result = result || CheckResultCode(out_first, out_second);
- result = result || CheckResultCode(out_second, out_first);
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool result = CheckResultCode(out_first, out_second) ||
+ CheckResultCode(out_second, out_first);
return result;
}
@@ -748,25 +856,30 @@ void CommandRequestImpl::GetInfo(
mobile_apis::Result::eType CommandRequestImpl::PrepareResultCodeForResponse(
const ResponseInfo& first, const ResponseInfo& second) {
+ LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- if (IsResultCodeUnsupported(first, second)) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else {
- // If response contains erroneous result code SDL need return erroneus
- // result code.
- hmi_apis::Common_Result::eType first_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- hmi_apis::Common_Result::eType second_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- if (!first.is_unsupported_resource) {
- first_result = first.result_code;
- }
- if (!second.is_unsupported_resource) {
- second_result = second.result_code;
- }
- result_code =
- MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
- }
+ if (IsResultCodeUnsupported(first, second) ||
+ IsResultCodeUnsupported(second, first)) {
+ return mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ }
+ if (IsResultCodeWarning(first, second) ||
+ IsResultCodeWarning(second, first)) {
+ return mobile_apis::Result::WARNINGS;
+ }
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType first_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType second_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (!first.is_unsupported_resource) {
+ first_result = first.result_code;
+ }
+ if (!second.is_unsupported_resource) {
+ second_result = second.result_code;
+ }
+ result_code =
+ MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
return result_code;
}
@@ -775,6 +888,100 @@ const CommandParametersPermissions& CommandRequestImpl::parameters_permissions()
return parameters_permissions_;
}
+void CommandRequestImpl::StartAwaitForInterface(
+ const HmiInterfaces::InterfaceID interface_id) {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ awaiting_response_interfaces_.insert(interface_id);
+}
+
+bool CommandRequestImpl::IsInterfaceAwaited(
+ const HmiInterfaces::InterfaceID& interface_id) const {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ std::set<HmiInterfaces::InterfaceID>::const_iterator it =
+ awaiting_response_interfaces_.find(interface_id);
+ return (it != awaiting_response_interfaces_.end());
+}
+
+void CommandRequestImpl::EndAwaitForInterface(
+ const HmiInterfaces::InterfaceID& interface_id) {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ std::set<HmiInterfaces::InterfaceID>::const_iterator it =
+ awaiting_response_interfaces_.find(interface_id);
+ if (it != awaiting_response_interfaces_.end()) {
+ awaiting_response_interfaces_.erase(it);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "EndAwaitForInterface called on interface \
+ which was not put into await state: "
+ << interface_id);
+ }
+}
+
+bool CommandRequestImpl::IsResultCodeUnsupported(
+ const ResponseInfo& first, const ResponseInfo& second) const {
+ const bool first_ok_second_unsupported =
+ (first.is_ok || first.is_not_used) && second.is_unsupported_resource;
+ const bool both_unsupported =
+ first.is_unsupported_resource && second.is_unsupported_resource;
+ return first_ok_second_unsupported || both_unsupported;
+}
+
+std::string GetComponentNameFromInterface(
+ const HmiInterfaces::InterfaceID& interface) {
+ switch (interface) {
+ case HmiInterfaces::HMI_INTERFACE_Buttons:
+ return "Buttons";
+ case HmiInterfaces::HMI_INTERFACE_BasicCommunication:
+ return "BasicCommunication";
+ case HmiInterfaces::HMI_INTERFACE_VR:
+ return "VR";
+ case HmiInterfaces::HMI_INTERFACE_TTS:
+ return "TTS";
+ case HmiInterfaces::HMI_INTERFACE_UI:
+ return "UI";
+ case HmiInterfaces::HMI_INTERFACE_Navigation:
+ return "Navigation";
+ case HmiInterfaces::HMI_INTERFACE_VehicleInfo:
+ return "VehicleInfo";
+ case HmiInterfaces::HMI_INTERFACE_SDL:
+ return "SDL";
+ default:
+ return "Unknown type";
+ }
+}
+
+const std::string InfoInterfaceSeparator(
+ const std::string& sum, const HmiInterfaces::InterfaceID container_value) {
+ return sum.empty()
+ ? GetComponentNameFromInterface(container_value)
+ : sum + ", " + GetComponentNameFromInterface(container_value);
+}
+
+void CommandRequestImpl::AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const {
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ if (awaiting_response_interfaces_.empty()) {
+ LOG4CXX_ERROR(logger_, "No interfaces awaiting, info param is empty");
+ return;
+ }
+
+ const std::string not_responding_interfaces_string =
+ std::accumulate(awaiting_response_interfaces_.begin(),
+ awaiting_response_interfaces_.end(),
+ std::string(""),
+ InfoInterfaceSeparator);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Not responding interfaces string: " << not_responding_interfaces_string);
+ if (!not_responding_interfaces_string.empty()) {
+ const std::string component_info =
+ not_responding_interfaces_string + " component does not respond";
+ response[strings::msg_params][strings::info] = component_info;
+ }
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_response_impl.cc b/src/components/application_manager/src/commands/command_response_impl.cc
index c3265230a8..b956a4c7a5 100644
--- a/src/components/application_manager/src/commands/command_response_impl.cc
+++ b/src/components/application_manager/src/commands/command_response_impl.cc
@@ -32,14 +32,23 @@
#include "application_manager/commands/command_response_impl.h"
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
namespace application_manager {
namespace commands {
CommandResponseImpl::CommandResponseImpl(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
CommandResponseImpl::~CommandResponseImpl() {}
@@ -80,7 +89,7 @@ void CommandResponseImpl::SendResponse(
}
}
- application_manager_.SendMessageToMobile(message_, final_message);
+ rpc_service_.SendMessageToMobile(message_, final_message);
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
deleted file mode 100644
index ea36cd2b0a..0000000000
--- a/src/components/application_manager/src/commands/hmi/activate_app_request.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/activate_app_request.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ActivateAppRequest::ActivateAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ActivateAppRequest::~ActivateAppRequest() {
- LOG4CXX_TRACE(logger_, "~ActivateAppRequest");
-}
-
-void ActivateAppRequest::Run() {
- LOG4CXX_TRACE(logger_, "enter " << correlation_id());
- uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id(), app_id);
-#ifdef ENABLE_LOG
- if ((*message_)[strings::msg_params].keyExists(
- strings::activate_app_hmi_level)) {
- mobile_apis::HMILevel::eType requested_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::activate_app_hmi_level]
- .asInt());
- LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
- }
-#endif
- SendRequest();
- LOG4CXX_TRACE(logger_, "exit");
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/src/commands/hmi/activate_app_response.cc
deleted file mode 100644
index 55e704b6c4..0000000000
--- a/src/components/application_manager/src/commands/hmi/activate_app_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/activate_app_response.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ActivateAppResponse::ActivateAppResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ActivateAppResponse::~ActivateAppResponse() {}
-
-void ActivateAppResponse::Run() {
- LOG4CXX_TRACE(logger_, "enter");
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_ActivateApp);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- LOG4CXX_TRACE(logger_, "exit");
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
deleted file mode 100644
index ef75eba1e2..0000000000
--- a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/policies/policy_handler.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddStatisticsInfoNotification::AddStatisticsInfoNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {}
-
-void AddStatisticsInfoNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
- .asInt();
-
- application_manager_.GetPolicyHandler().AddStatisticsInfo(type);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
deleted file mode 100644
index 4e096a2cda..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAllAppsRequest::AllowAllAppsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AllowAllAppsRequest::~AllowAllAppsRequest() {}
-
-void AllowAllAppsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
deleted file mode 100644
index ed05c3ba83..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAllAppsResponse::AllowAllAppsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AllowAllAppsResponse::~AllowAllAppsResponse() {}
-
-void AllowAllAppsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SetAllAppsAllowed(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/src/commands/hmi/allow_app_request.cc
deleted file mode 100644
index 5176b3b4fe..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_app_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/allow_app_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAppRequest::AllowAppRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AllowAppRequest::~AllowAppRequest() {}
-
-void AllowAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/src/commands/hmi/allow_app_response.cc
deleted file mode 100644
index 5fd9c702b4..0000000000
--- a/src/components/application_manager/src/commands/hmi/allow_app_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/allow_app_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AllowAppResponse::AllowAppResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AllowAppResponse::~AllowAppResponse() {}
-
-void AllowAppResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t connection_key =
- (*message_)[strings::params][strings::connection_key].asInt();
-
- ApplicationSharedPtr app = application_manager_.application(connection_key);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- app->set_app_allowed(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
deleted file mode 100644
index 80b1edb5bb..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
+++ /dev/null
@@ -1,31 +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.
- */
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
deleted file mode 100644
index 2499c21680..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-BasicCommunicationSystemRequest::BasicCommunicationSystemRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {}
-
-void BasicCommunicationSystemRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
deleted file mode 100644
index 16afce92e0..0000000000
--- a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-BasicCommunicationSystemResponse::BasicCommunicationSystemResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {}
-
-void BasicCommunicationSystemResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_SystemRequest);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
deleted file mode 100644
index e6b73879e5..0000000000
--- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {}
-
-void ButtonGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
deleted file mode 100644
index a947fb7ba9..0000000000
--- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {}
-
-void ButtonGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS != code) {
- LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated.");
- return;
- }
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_button_capabilities(
- (*message_)[strings::msg_params][hmi_response::capabilities]);
-
- hmi_capabilities.set_preset_bank_capabilities(
- (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
deleted file mode 100644
index d628475438..0000000000
--- a/src/components/application_manager/src/commands/hmi/close_popup_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/close_popup_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ClosePopupRequest::ClosePopupRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-ClosePopupRequest::~ClosePopupRequest() {}
-
-void ClosePopupRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/src/commands/hmi/close_popup_response.cc
deleted file mode 100644
index 15adb2ee32..0000000000
--- a/src/components/application_manager/src/commands/hmi/close_popup_response.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/close_popup_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ClosePopupResponse::ClosePopupResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-ClosePopupResponse::~ClosePopupResponse() {}
-
-void ClosePopupResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(VS): Process response from HMI
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
deleted file mode 100644
index a09fe71bf2..0000000000
--- a/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/decrypt_certificate_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DecryptCertificateRequest::DecryptCertificateRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-void DecryptCertificateRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t correlation_id = RequestToHMI::correlation_id();
- const uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id, app_id);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
deleted file mode 100644
index cea9290f7d..0000000000
--- a/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/decrypt_certificate_response.h"
-
-#include "application_manager/policies/policy_handler.h"
-#ifdef EXTERNAL_PROPRIETARY_MODE
-namespace application_manager {
-
-namespace commands {
-
-DecryptCertificateResponse::DecryptCertificateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-DecryptCertificateResponse::~DecryptCertificateResponse() {}
-
-void DecryptCertificateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- const bool is_succeeded = hmi_apis::Common_Result::SUCCESS == code;
-
- application_manager_.GetPolicyHandler().OnCertificateDecrypted(is_succeeded);
-}
-
-} // namespace commands
-} // namespace application_manager
-#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/src/commands/hmi/dial_number_request.cc
deleted file mode 100644
index b26541cb01..0000000000
--- a/src/components/application_manager/src/commands/hmi/dial_number_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/dial_number_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-DialNumberRequest::~DialNumberRequest() {}
-
-void DialNumberRequest::Run() {
- SendRequest();
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/src/commands/hmi/dial_number_response.cc
deleted file mode 100644
index 5511fa98f8..0000000000
--- a/src/components/application_manager/src/commands/hmi/dial_number_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/dial_number_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-DialNumberResponse::~DialNumberResponse() {}
-
-void DialNumberResponse::Run() {
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_DialNumber);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
deleted file mode 100644
index 379027c43a..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_system_info_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetSystemInfoRequest::GetSystemInfoRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-GetSystemInfoRequest::~GetSystemInfoRequest() {}
-
-void GetSystemInfoRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t correlation_id = RequestToHMI::correlation_id();
- uint32_t app_id = RequestToHMI::application_id();
- application_manager_.set_application_id(correlation_id, app_id);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
deleted file mode 100644
index be6dabb292..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-namespace commands {
-
-GetSystemInfoResponse::GetSystemInfoResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-GetSystemInfoResponse::~GetSystemInfoResponse() {}
-
-void GetSystemInfoResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- const SystemInfo& info = GetSystemInfo(code);
-
- // We have to set preloaded flag as false in policy table on any response
- // of GetSystemInfo (SDLAQ-CRS-2365)
- application_manager_.GetPolicyHandler().OnGetSystemInfo(
- info.ccpu_version, info.wers_country_code, info.language);
-}
-
-const SystemInfo GetSystemInfoResponse::GetSystemInfo(
- const hmi_apis::Common_Result::eType code) const {
- SystemInfo info;
-
- if (hmi_apis::Common_Result::SUCCESS != code) {
- LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
- return info;
- }
- info.ccpu_version =
- (*message_)[strings::msg_params]["ccpu_version"].asString();
-
- info.wers_country_code =
- (*message_)[strings::msg_params]["wersCountryCode"].asString();
-
- const uint32_t lang_code =
- (*message_)[strings::msg_params]["language"].asUInt();
- info.language = application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
-
- application_manager_.hmi_capabilities().set_ccpu_version(info.ccpu_version);
-
- return info;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
deleted file mode 100644
index a2e1878fac..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/message.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace application_manager {
-namespace commands {
-
-GetUrls::GetUrls(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-GetUrls::~GetUrls() {}
-
-void GetUrls::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- namespace Common_Result = hmi_apis::Common_Result;
- using policy::EndpointUrls;
-
- if (!application_manager_.GetPolicyHandler().PolicyEnabled()) {
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
- const uint32_t service_to_check =
- (*message_)[strings::msg_params][hmi_request::service].asUInt();
-
- EndpointUrls endpoints;
- application_manager_.GetPolicyHandler().GetUpdateUrls(service_to_check,
- endpoints);
-
- if (endpoints.empty()) {
- LOG4CXX_ERROR(logger_, "No URLs for service " << service_to_check);
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
-#ifdef PROPRIETARY_MODE
- const uint32_t policy_service = 7u;
-
- if (policy_service == service_to_check) {
- ProcessPolicyServiceURLs(endpoints);
- return;
- }
-#endif // PROPRIETARY_MODE
-
- ProcessServiceURLs(endpoints);
-}
-
-void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
- namespace Common_Result = hmi_apis::Common_Result;
- using smart_objects::SmartObject;
-
- (*message_)[strings::msg_params].erase(hmi_request::service);
- SmartObject& urls = (*message_)[strings::msg_params][hmi_response::urls];
-
- size_t index = 0;
- for (size_t e = 0; e < endpoints.size(); ++e) {
- ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(endpoints[e].app_id);
-
-#ifndef PROPRIETARY_MODE
- bool registered_not_default = false;
- if (policy::kDefaultId != endpoints[e].app_id) {
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Can't find application with policy id "
- << endpoints[e].app_id
- << " URLs adding for this application is skipped.");
- continue;
- }
- registered_not_default = true;
- }
-#endif // EXTERNAL_PROPRIETARY_MODE || HTTP
- for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
- const std::string& app_url = endpoints[e].url[u];
- SmartObject& service_info = urls[index];
-
- service_info[strings::url] = app_url;
-#ifndef PROPRIETARY_MODE
- if (registered_not_default) {
- service_info[strings::app_id] = app->hmi_app_id();
- }
-#else // EXTERNAL_PROPRIETARY_MODE || HTTP
- service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
-#endif
- }
- }
- SendResponseToHMI(Common_Result::SUCCESS);
-}
-
-void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
- (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message_)[strings::params][hmi_response::code] = result;
- application_manager_.ManageHMICommand(message_);
-}
-
-#ifdef PROPRIETARY_MODE
-struct PolicyAppIdComparator {
- PolicyAppIdComparator(const std::string& policy_app_id)
- : policy_app_id_(policy_app_id) {}
-
- bool operator()(const policy::EndpointData& data) {
- return data.app_id == policy_app_id_;
- }
- std::string policy_app_id_;
-};
-
-void FillSODefaultUrls(smart_objects::SmartObject& urls,
- const policy::EndpointUrls& endpoints) {
- using smart_objects::SmartObject;
- PolicyAppIdComparator comparator(policy::kDefaultId);
- policy::EndpointUrls::const_iterator it =
- std::find_if(endpoints.begin(), endpoints.end(), comparator);
- if (it == endpoints.end()) {
- return;
- }
- SmartObject service_info = SmartObject(smart_objects::SmartType_Map);
- for (size_t i = 0; i < (*it).url.size(); ++i) {
- service_info[strings::url] = (*it).url[i];
- urls[i] = service_info;
- }
-}
-
-void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace smart_objects;
- using namespace application_manager;
- using namespace strings;
- using namespace hmi_apis;
-
- const uint32_t app_id_to_send_to =
- application_manager_.GetPolicyHandler().GetAppIdForSending();
-
- if (!app_id_to_send_to) {
- LOG4CXX_ERROR(logger_,
- "There are no available applications for processing.");
- SmartObject urls(SmartType_Array);
- FillSODefaultUrls(urls, endpoints);
- if (!urls.empty()) {
- (*message_)[msg_params][hmi_response::urls] = urls;
- }
- (*message_).erase(hmi_request::service);
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
- }
-
- ApplicationSharedPtr app =
- application_manager_.application(app_id_to_send_to);
-
- if (!app.valid()) {
- LOG4CXX_WARN(logger_,
- "There is no registered application with "
- "connection key '"
- << app_id_to_send_to << "'");
- SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
- return;
- }
-
- SmartObject& object = *message_;
- object[msg_params].erase(hmi_request::service);
- object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
- SmartObject& urls = object[msg_params][hmi_response::urls];
- const std::string mobile_app_id = app->policy_app_id();
- std::string default_url = "URL is not found";
-
- // Will use only one URL for particular application if it will be found
- // Otherwise URL from default section will used
- SmartObject service_info = SmartObject(SmartType_Map);
-
- for (size_t e = 0; e < endpoints.size(); ++e) {
- if (mobile_app_id == endpoints[e].app_id) {
- if (endpoints[e].url.size()) {
- service_info[url] = endpoints[e].url[0];
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
- }
- }
- if (policy::kDefaultId == endpoints[e].app_id) {
- if (endpoints[e].url.size()) {
- default_url = endpoints[e].url[0];
- }
- }
- }
-
- service_info[strings::app_id] = app->app_id();
- service_info[strings::url] = default_url;
- urls[0] = service_info;
- // TODO(AOleynik): Issue with absent policy_app_id. Need to fix later on.
- // Possibly related to smart schema
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
-}
-#endif // PROPRIETARY_MODE
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/src/commands/hmi/get_urls_response.cc
deleted file mode 100644
index dd9686fbce..0000000000
--- a/src/components/application_manager/src/commands/hmi/get_urls_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/get_urls_response.h"
-
-namespace application_manager {
-namespace commands {
-
-GetUrlsResponse::GetUrlsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-GetUrlsResponse::~GetUrlsResponse() {}
-
-void GetUrlsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
deleted file mode 100644
index e38d1fc088..0000000000
--- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-MixingAudioSupportedRequest::MixingAudioSupportedRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {}
-
-void MixingAudioSupportedRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
deleted file mode 100644
index f8b58e6f35..0000000000
--- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-MixingAudioSupportedResponse::MixingAudioSupportedResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {}
-
-void MixingAudioSupportedResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_attenuated_supported(
- (*message_)[strings::msg_params][hmi_response::attenuated_supported]
- .asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
deleted file mode 100644
index 582caaa8f3..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviAlertManeuverRequest::NaviAlertManeuverRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {}
-
-void NaviAlertManeuverRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
deleted file mode 100644
index 5f0422bf6a..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviAlertManeuverResponse::NaviAlertManeuverResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {}
-
-void NaviAlertManeuverResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
deleted file mode 100644
index 0bcb26df8a..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-
-#include "application_manager/message_helper.h"
-#include "protocol_handler/protocol_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStartStreamRequest::AudioStartStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher())
- , retry_number_(0) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::pair<uint32_t, int32_t> stream_retry =
- application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
- retry_number_ = stream_retry.first;
- LOG4CXX_DEBUG(logger_,
- "default_timeout_ = " << default_timeout_
- << "; retry_number_ = " << retry_number_);
-}
-
-AudioStartStreamRequest::~AudioStartStreamRequest() {}
-
-void AudioStartStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << " does not exist");
- return;
- }
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream,
- correlation_id());
- app->set_audio_streaming_allowed(true);
- SendRequest();
-}
-
-void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "StartAudioStreamRequest aborted. Application not found");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_StartAudioStream: {
- LOG4CXX_DEBUG(logger_, "Received StartStream event");
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS");
- if (application_manager_.HMILevelAllowsStreaming(app->app_id(),
- ServiceType::kAudio)) {
- app->set_audio_streaming_approved(true);
- } else {
- LOG4CXX_WARN(
- logger_,
- "StartAudioStreamRequest aborted. Application can not stream");
- }
- break;
- }
- if (hmi_apis::Common_Result::REJECTED == code) {
- LOG4CXX_INFO(logger_, "StartAudioStream response REJECTED");
- RetryStartSession();
- break;
- }
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void AudioStartStreamRequest::onTimeOut() {
- RetryStartSession();
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-void AudioStartStreamRequest::RetryStartSession() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "StartAudioStreamRequest aborted. Application not found");
- return;
- }
-
- if (!app->audio_streaming_allowed()) {
- LOG4CXX_WARN(logger_, "Audio streaming not allowed");
- return;
- }
-
- if (app->audio_streaming_approved()) {
- LOG4CXX_INFO(logger_,
- "AudioStartStream retry sequence stopped. "
- << "SUCCESS received");
- app->set_audio_stream_retry_number(0);
- return;
- }
-
- uint32_t curr_retry_number = app->audio_stream_retry_number();
- if (curr_retry_number < retry_number_) {
- LOG4CXX_DEBUG(
- logger_,
- "Send AudioStartStream retry. retry_number = " << curr_retry_number);
- MessageHelper::SendAudioStartStream(app->app_id(), application_manager_);
- app->set_audio_stream_retry_number(++curr_retry_number);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Audio start stream retry sequence stopped. "
- << "Attempts expired.");
-
- application_manager_.EndNaviServices(app->app_id());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
deleted file mode 100644
index c7fc7365e7..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStartStreamResponse::AudioStartStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AudioStartStreamResponse::~AudioStartStreamResponse() {}
-
-void AudioStartStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
deleted file mode 100644
index f86ee8302a..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStopStreamRequest::AudioStopStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-AudioStopStreamRequest::~AudioStopStreamRequest() {}
-
-void AudioStopStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
deleted file mode 100644
index c669d399f9..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AudioStopStreamResponse::AudioStopStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-AudioStopStreamResponse::~AudioStopStreamResponse() {}
-
-void AudioStopStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc
deleted file mode 100644
index 51f862c957..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_get_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviGetWayPointsRequest::NaviGetWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviGetWayPointsRequest::~NaviGetWayPointsRequest() {}
-
-void NaviGetWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc
deleted file mode 100644
index f295845b24..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviGetWayPointsResponse::NaviGetWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {}
-
-void NaviGetWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
deleted file mode 100644
index 4392258a31..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-NaviIsReadyRequest::~NaviIsReadyRequest() {}
-
-void NaviIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady,
- correlation_id());
- SendRequest();
-}
-
-void NaviIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady);
- const bool is_available =
- ChangeInterfaceState(application_manager_,
- message,
- HmiInterfaces::HMI_INTERFACE_Navigation);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_navi_cooperating(is_available);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
deleted file mode 100644
index 7daba4258b..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviIsReadyResponse::NaviIsReadyResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviIsReadyResponse::~NaviIsReadyResponse() {}
-
-void NaviIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
deleted file mode 100644
index ad878033ca..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSendLocationRequest::NaviSendLocationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviSendLocationRequest::~NaviSendLocationRequest() {}
-
-void NaviSendLocationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
deleted file mode 100644
index a3d9f4c9e5..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_send_location_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSendLocationResponse::NaviSendLocationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviSendLocationResponse::~NaviSendLocationResponse() {}
-
-void NaviSendLocationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
deleted file mode 100644
index a92ef07d12..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviShowConstantTBTRequest::NaviShowConstantTBTRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {}
-
-void NaviShowConstantTBTRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
deleted file mode 100644
index ede3272e8e..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviShowConstantTBTResponse::NaviShowConstantTBTResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {}
-
-void NaviShowConstantTBTResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
deleted file mode 100644
index b06c69e703..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-
-#include "application_manager/message_helper.h"
-#include "protocol_handler/protocol_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStartStreamRequest::NaviStartStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher())
- , retry_number_(0) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::pair<uint32_t, int32_t> stream_retry =
- application_manager_.get_settings().start_stream_retry_amount();
- default_timeout_ = stream_retry.second;
- retry_number_ = stream_retry.first;
- LOG4CXX_DEBUG(logger_,
- "default_timeout_ = " << default_timeout_
- << "; retry_number_ = " << retry_number_);
-}
-
-NaviStartStreamRequest::~NaviStartStreamRequest() {}
-
-void NaviStartStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Applcation with hmi_app_id " << application_id()
- << "does not exist");
- return;
- }
- SetAllowedToTerminate(false);
- subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream,
- correlation_id());
- app->set_video_streaming_allowed(true);
- SendRequest();
-}
-
-void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "NaviStartStreamRequest aborted. Application not found");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_StartStream: {
- LOG4CXX_DEBUG(logger_, "Received StartStream event");
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS");
- if (application_manager_.HMILevelAllowsStreaming(
- app->app_id(), ServiceType::kMobileNav)) {
- app->set_video_streaming_approved(true);
- } else {
- LOG4CXX_DEBUG(
- logger_,
- "NaviStartStreamRequest aborted. Application can not stream");
- }
- break;
- }
- if (hmi_apis::Common_Result::REJECTED == code) {
- LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
- RetryStartSession();
- break;
- }
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void NaviStartStreamRequest::onTimeOut() {
- RetryStartSession();
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-void NaviStartStreamRequest::RetryStartSession() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(application_id());
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "NaviStartStreamRequest aborted. Application not found");
- return;
- }
-
- if (!app->video_streaming_allowed()) {
- LOG4CXX_WARN(logger_, "Video streaming not allowed");
- return;
- }
-
- if (app->video_streaming_approved()) {
- LOG4CXX_INFO(logger_,
- "NaviStartStream retry sequence stopped. "
- << "SUCCESS received");
- app->set_video_stream_retry_number(0);
- return;
- }
-
- uint32_t curr_retry_number = app->video_stream_retry_number();
- if (curr_retry_number < retry_number_) {
- LOG4CXX_DEBUG(
- logger_,
- "Send NaviStartStream retry. retry_number = " << curr_retry_number);
- MessageHelper::SendNaviStartStream(app->app_id(), application_manager_);
- app->set_video_stream_retry_number(++curr_retry_number);
- } else {
- LOG4CXX_DEBUG(logger_,
- "NaviStartStream retry sequence stopped. "
- << "Attempts expired");
-
- application_manager_.EndNaviServices(app->app_id());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
deleted file mode 100644
index b0b9e672c3..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStartStreamResponse::NaviStartStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviStartStreamResponse::~NaviStartStreamResponse() {}
-
-void NaviStartStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
deleted file mode 100644
index a40ee13b68..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStopStreamRequest::NaviStopStreamRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviStopStreamRequest::~NaviStopStreamRequest() {}
-
-void NaviStopStreamRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
- LOG4CXX_INFO(logger_, "Interface Navi is not supported by system");
- return;
- }
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
deleted file mode 100644
index 3a7fc75260..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviStopStreamResponse::NaviStopStreamResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviStopStreamResponse::~NaviStopStreamResponse() {}
-
-void NaviStopStreamResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc
deleted file mode 100644
index f2106c8724..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviSubscribeWayPointsRequest::~NaviSubscribeWayPointsRequest() {}
-
-void NaviSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc
deleted file mode 100644
index f641051560..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {}
-
-void NaviSubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc
deleted file mode 100644
index e66069feef..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUnSubscribeWayPointsRequest::NaviUnSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviUnSubscribeWayPointsRequest::~NaviUnSubscribeWayPointsRequest() {}
-
-void NaviUnSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc
deleted file mode 100644
index 61216321e8..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {}
-
-void NaviUnsubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
deleted file mode 100644
index c37c3d12f9..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUpdateTurnListRequest::NaviUpdateTurnListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {}
-
-void NaviUpdateTurnListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
deleted file mode 100644
index faf5719d05..0000000000
--- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NaviUpdateTurnListResponse::NaviUpdateTurnListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {}
-
-void NaviUpdateTurnListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
deleted file mode 100644
index 64eb63fde8..0000000000
--- a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/notification_from_hmi.h"
-#include "application_manager/application_manager.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NotificationFromHMI::NotificationFromHMI(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*message);
-}
-
-NotificationFromHMI::~NotificationFromHMI() {}
-
-bool NotificationFromHMI::Init() {
- return true;
-}
-
-bool NotificationFromHMI::CleanUp() {
- return true;
-}
-
-void NotificationFromHMI::Run() {}
-
-void NotificationFromHMI::SendNotificationToMobile(
- const MessageSharedPtr& message) {
- (*message)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- application_manager_.ManageMobileCommand(message, ORIGIN_SDL);
-}
-
-void NotificationFromHMI::CreateHMIRequest(
- const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
-
- // get hmi correlation id for chaining further request from this object
- const uint32_t hmi_correlation_id_ =
- application_manager_.GetNextHMICorrelationID();
-
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
- request[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kRequest);
- request[strings::params][strings::function_id] =
- static_cast<int32_t>(function_id);
- request[strings::params][strings::correlation_id] = hmi_correlation_id_;
- request[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- request[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
-
- request[strings::msg_params] = msg_params;
-
- if (!application_manager_.ManageHMICommand(result)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
deleted file mode 100644
index f1e933b7ef..0000000000
--- a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/notification_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-NotificationToHMI::NotificationToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
-
-NotificationToHMI::~NotificationToHMI() {}
-
-bool NotificationToHMI::Init() {
- return true;
-}
-
-bool NotificationToHMI::CleanUp() {
- return true;
-}
-
-void NotificationToHMI::Run() {}
-
-void NotificationToHMI::SendNotification() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
deleted file mode 100644
index 70e5e7cefd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {}
-
-void OnAllowSDLFunctionalityNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- std::string device_id;
- if ((*message_)[strings::msg_params].keyExists("device")) {
- device_id = (*message_)[strings::msg_params]["device"]["id"].asString();
- }
- application_manager_.GetPolicyHandler().OnAllowSDLFunctionalityNotification(
- (*message_)[strings::msg_params][hmi_response::allowed].asBool(),
- device_id);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
deleted file mode 100644
index 76252a50fd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-
-#include "application_manager/message_helper.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppActivatedNotification::OnAppActivatedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppActivatedNotification::~OnAppActivatedNotification() {}
-
-void OnAppActivatedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppActivated);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
deleted file mode 100644
index 86ce6a830c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppDeactivatedNotification::OnAppDeactivatedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {}
-
-void OnAppDeactivatedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
deleted file mode 100644
index fa7293513a..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppPermissionChangedNotification::OnAppPermissionChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {}
-
-void OnAppPermissionChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
deleted file mode 100644
index 0efc1aee8a..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {}
-
-void OnAppPermissionConsentNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- uint32_t connection_key = 0;
-
- policy::PermissionConsent permission_consent;
-
- // If user defined group permissions for specific app
- if (msg_params.keyExists(strings::app_id)) {
- connection_key = msg_params[strings::app_id].asUInt();
- }
-
- if (msg_params.keyExists("consentedFunctions")) {
- smart_objects::SmartArray* user_consent =
- msg_params["consentedFunctions"].asArray();
-
- smart_objects::SmartArray::const_iterator it = user_consent->begin();
- smart_objects::SmartArray::const_iterator it_end = user_consent->end();
- for (; it != it_end; ++it) {
- policy::FunctionalGroupPermission permissions;
- permissions.group_id = (*it)["id"].asInt();
- permissions.group_alias = (*it)["name"].asString();
- if ((*it).keyExists("allowed")) {
- permissions.state = (*it)["allowed"].asBool()
- ? policy::kGroupAllowed
- : policy::kGroupDisallowed;
- } else {
- permissions.state = policy::kGroupUndefined;
- }
-
- permission_consent.group_permissions.push_back(permissions);
- }
-
- permission_consent.consent_source = msg_params["source"].asString();
-
- application_manager_.GetPolicyHandler().OnAppPermissionConsent(
- connection_key, permission_consent);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
deleted file mode 100644
index a97e19b556..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppRegisteredNotification::OnAppRegisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppRegisteredNotification::~OnAppRegisteredNotification() {}
-
-void OnAppRegisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // SDL must notify system about app registration before any dependent actions
- // will be started
- SendNotification();
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
deleted file mode 100644
index 10ea1ea303..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAppUnregisteredNotification::OnAppUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {}
-
-void OnAppUnregisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // sending event for delete VRCommand on PerformInteraction
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc
deleted file mode 100644
index c3e81bdc30..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnAudioDataStreamingNotification::OnAudioDataStreamingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {}
-
-void OnAudioDataStreamingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
deleted file mode 100644
index fc8d5989a1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "utils/logger.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonEventNotification::OnButtonEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-void OnButtonEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
deleted file mode 100644
index abff87c962..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "utils/logger.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonPressNotification::OnButtonPressNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-void OnButtonPressNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- (*message_)[strings::params][strings::function_id] =
- static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID);
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc
deleted file mode 100644
index aae994ea34..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnButtonSubscriptionNotification::OnButtonSubscriptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {}
-
-void OnButtonSubscriptionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
deleted file mode 100644
index 83ec785a9d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnDeviceChosenNotification::OnDeviceChosenNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDeviceChosenNotification::~OnDeviceChosenNotification() {}
-
-void OnDeviceChosenNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
- application_manager_.ConnectToDevice(
- (*message_)[strings::msg_params][strings::device_info][strings::id]
- .asString());
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
deleted file mode 100644
index 346c05032b..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/HMI_API.h"
-#include "encryption/hashing.h"
-
-namespace {
-// TODO(AOleynik) : replace this !!!
-void check_zero(const char& a, const char& b, std::string& bt_mac) {
- if ('0' != a && '0' == b) {
- bt_mac.push_back(a);
- bt_mac.push_back(b);
- } else if ('0' == a) {
- bt_mac.push_back(b);
- } else {
- bt_mac.push_back(a);
- bt_mac.push_back(b);
- }
-}
-
-std::string convert_to_bt_mac(std::string& deviceInternalId) {
- std::transform(deviceInternalId.begin(),
- deviceInternalId.end(),
- deviceInternalId.begin(),
- ::tolower);
-
- std::string bt_mac;
- check_zero(deviceInternalId[10], deviceInternalId[11], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[8], deviceInternalId[9], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[6], deviceInternalId[7], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[4], deviceInternalId[5], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[2], deviceInternalId[3], bt_mac);
- bt_mac.push_back(':');
- check_zero(deviceInternalId[0], deviceInternalId[1], bt_mac);
-
- return bt_mac;
-}
-}
-
-namespace application_manager {
-
-namespace commands {
-
-OnDeviceStateChangedNotification::OnDeviceStateChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {}
-
-void OnDeviceStateChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((*message_)[strings::msg_params]["deviceState"] ==
- hmi_apis::Common_DeviceState::UNPAIRED) {
- // It is expected, that "deviceInternalId" is the device MAC address in
- // form XXXXXXXXXX
- std::string device_id =
- (*message_)[strings::msg_params]["deviceInternalId"].asString();
- if (device_id.empty()) {
- if ((*message_)[strings::msg_params].keyExists("deviceId")) {
- device_id =
- (*message_)[strings::msg_params]["deviceId"]["id"].asString();
- }
- } else {
- // Policy uses hashed MAC address as device_id
- LOG4CXX_DEBUG(logger_, "Device_id from HMI: " << device_id);
- std::string bt_mac = convert_to_bt_mac(device_id);
- LOG4CXX_DEBUG(logger_, "Device_id as BT MAC: " << bt_mac);
- device_id = encryption::MakeHash(bt_mac);
- LOG4CXX_DEBUG(logger_, "Device_id hashed as BT MAC : " << device_id);
- }
- application_manager_.GetPolicyHandler().RemoveDevice(device_id);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
deleted file mode 100644
index 4c322c456f..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <set>
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnDriverDistractionNotification::OnDriverDistractionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
-
-void OnDriverDistractionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_DriverDistractionState::eType state =
- static_cast<hmi_apis::Common_DriverDistractionState::eType>(
- (*message_)[strings::msg_params][hmi_notification::state].asInt());
- application_manager_.set_driver_distraction(state);
-
- smart_objects::SmartObjectSPtr on_driver_distraction =
- new smart_objects::SmartObject();
-
- if (!on_driver_distraction) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- (*on_driver_distraction)[strings::params][strings::function_id] =
- mobile_api::FunctionID::OnDriverDistractionID;
-
- (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
- state;
-
- const ApplicationSet applications =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = applications.begin();
- for (; applications.end() != it; ++it) {
- const ApplicationSharedPtr app = *it;
- if (app) {
- (*on_driver_distraction)[strings::params][strings::connection_key] =
- app->app_id();
- SendNotificationToMobile(on_driver_distraction);
- }
- }
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc
deleted file mode 100644
index c211ffde50..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnEventChangedNotification::OnEventChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnEventChangedNotification::~OnEventChangedNotification() {}
-
-void OnEventChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnEventChanged);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
deleted file mode 100644
index 682093cef9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-
-#include "application_manager/application_manager.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {}
-
-void OnExitAllApplicationsNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_ApplicationsCloseReason::eType reason =
- static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>(
- (*message_)[strings::msg_params][hmi_request::reason].asInt());
- LOG4CXX_DEBUG(logger_, "Reason " << reason);
-
- mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
- mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
-
- switch (reason) {
- case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS: {
- mob_reason = mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS;
- break;
- }
- case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
- SendOnSDLPersistenceComplete();
- return;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
- return;
- }
- }
-
- application_manager_.SetUnregisterAllApplicationsReason(mob_reason);
-
- if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
- mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS ==
- mob_reason) {
- application_manager_.HeadUnitReset(mob_reason);
- }
- kill(getpid(), SIGINT);
-}
-
-void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
- (*message)[strings::params][strings::function_id] =
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
- (*message)[strings::params][strings::message_type] =
- MessageType::kNotification;
- (*message)[strings::params][strings::correlation_id] =
- application_manager_.GetNextHMICorrelationID();
-
- application_manager_.ManageHMICommand(message);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
deleted file mode 100644
index 0553fbba94..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2017, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnExitApplicationNotification::OnExitApplicationNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnExitApplicationNotification::~OnExitApplicationNotification() {}
-
-void OnExitApplicationNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- using namespace mobile_apis;
- using namespace hmi_apis;
-
- uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
- ApplicationSharedPtr app_impl = application_manager_.application(app_id);
-
- if (!(app_impl.valid())) {
- LOG4CXX_ERROR(logger_, "Application does not exist");
- return;
- }
-
- Common_ApplicationExitReason::eType reason;
- reason = static_cast<Common_ApplicationExitReason::eType>(
- (*message_)[strings::msg_params][strings::reason].asInt());
-
- switch (reason) {
- case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: {
- break;
- }
- case Common_ApplicationExitReason::USER_EXIT: {
- break;
- }
- case Common_ApplicationExitReason::UNAUTHORIZED_TRANSPORT_REGISTRATION: {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
- commands::Command::ORIGIN_SDL);
- // HMI rejects registration for navi application
- application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
- return;
- }
- case Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE: {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(app_id, Result::SUCCESS);
- return;
- }
- default: {
- LOG4CXX_WARN(logger_, "Unhandled reason");
- return;
- }
- }
-
- application_manager_.state_controller().SetRegularState(
- app_impl, HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE, false);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
deleted file mode 100644
index e69d111d2c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnFileRemovedNotification::OnFileRemovedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnFileRemovedNotification::~OnFileRemovedNotification() {}
-
-void OnFileRemovedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/src/commands/hmi/on_find_applications.cc
deleted file mode 100644
index 9d3633ba6d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_find_applications.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_find_applications.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnFindApplications::OnFindApplications(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnFindApplications::~OnFindApplications() {}
-
-void OnFindApplications::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add UpdateAppsOnDevice to ApplicationManager
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
deleted file mode 100644
index 8c772d6dcd..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {}
-
-void OnIgnitionCycleOverNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnIgnitionCycleOver();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
deleted file mode 100644
index e25de1f3a9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {}
-
-void OnNaviTBTClientStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc
deleted file mode 100644
index 17d1b420be..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& app_man)
- : NotificationFromHMI(message, app_man) {}
-
-OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {}
-
-void OnNaviWayPointChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_policy_update.cc
deleted file mode 100644
index 39b179f967..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_policy_update.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-OnPolicyUpdate::OnPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnPolicyUpdate::~OnPolicyUpdate() {}
-
-void OnPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnPTExchangeNeeded();
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
deleted file mode 100644
index 596b7d4549..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnPutFileNotification::OnPutFileNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnPutFileNotification::~OnPutFileNotification() {}
-
-void OnPutFileNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
deleted file mode 100644
index 3a45e0f934..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ready_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnReadyNotification::OnReadyNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnReadyNotification::~OnReadyNotification() {}
-
-void OnReadyNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.OnHMIStartedCooperation();
- event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
deleted file mode 100644
index 8724a072ed..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/application_manager.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
-
-void OnReceivedPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- const std::string& file_path =
- (*message_)[strings::msg_params][hmi_notification::policyfile].asString();
- policy::BinaryMessage file_content;
- if (!file_system::ReadBinaryFile(file_path, file_content)) {
- LOG4CXX_ERROR(logger_, "Failed to read Update file.");
- return;
- }
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file_path,
- file_content);
-#else
- LOG4CXX_WARN(logger_,
- "This RPC is part of extended policy flow."
- "Please re-build with extended policy mode enabled.");
-#endif
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
deleted file mode 100644
index 4d126ac67d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnRecordStartdNotification::OnRecordStartdNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnRecordStartdNotification::~OnRecordStartdNotification() {}
-
-void OnRecordStartdNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
deleted file mode 100644
index ce3c371cf8..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnResumeAudioSourceNotification::OnResumeAudioSourceNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {}
-
-void OnResumeAudioSourceNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
deleted file mode 100644
index 0517ea8d24..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLCloseNotification::OnSDLCloseNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLCloseNotification::~OnSDLCloseNotification() {}
-
-void OnSDLCloseNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
deleted file mode 100644
index a9c36813f6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLConsentNeededNotification::OnSDLConsentNeededNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {}
-
-void OnSDLConsentNeededNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
deleted file mode 100644
index e30a0fb902..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {}
-
-void OnSDLPersistenceCompleteNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
deleted file mode 100644
index 8e94b2b004..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnStartDeviceDiscovery::OnStartDeviceDiscovery(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {}
-
-void OnStartDeviceDiscovery::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.StartDevicesDiscovery();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
deleted file mode 100644
index 78a6b68324..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnStatusUpdateNotification::OnStatusUpdateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnStatusUpdateNotification::~OnStatusUpdateNotification() {}
-
-void OnStatusUpdateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
deleted file mode 100644
index 887aacf5b9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-namespace commands {
-
-OnSystemContextNotification::OnSystemContextNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemContextNotification::~OnSystemContextNotification() {}
-
-void OnSystemContextNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- mobile_api::SystemContext::eType system_context =
- static_cast<mobile_api::SystemContext::eType>(
- (*message_)[strings::msg_params][hmi_notification::system_context]
- .asInt());
-
- ApplicationSharedPtr app;
- if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
- app = application_manager_.active_application();
- } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
- (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
- }
- }
-
- if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) {
- application_manager_.state_controller().SetRegularState(app,
- system_context);
- } else {
- LOG4CXX_ERROR(logger_, "Application does not exist");
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
deleted file mode 100644
index 4885420f1c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/application_manager.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemErrorNotification::OnSystemErrorNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemErrorNotification::~OnSystemErrorNotification() {}
-
-void OnSystemErrorNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const int code =
- (*message_)[strings::msg_params][hmi_notification::error].asInt();
-
- application_manager_.GetPolicyHandler().OnSystemError(code);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
deleted file mode 100644
index 00b3649284..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemInfoChangedNotification::OnSystemInfoChangedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {}
-
-void OnSystemInfoChangedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t lang_code =
- (*message_)[strings::msg_params][strings::language].asUInt();
- const std::string language =
- application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
-
- application_manager_.GetPolicyHandler().OnSystemInfoChanged(language);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
deleted file mode 100644
index ea91dca5f1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/application_impl.h"
-
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/macro.h"
-
-using policy::PolicyHandlerInterface;
-
-namespace application_manager {
-
-namespace commands {
-
-OnSystemRequestNotification::OnSystemRequestNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnSystemRequestNotification::~OnSystemRequestNotification() {}
-
-void OnSystemRequestNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& params = (*message_)[strings::params];
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- params[strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
-
- // According to HMI API, this should be HMI unique id, but during processing
- // messages from HMI this param is replaced by connection key, so below it
- // will be treated as connection key
- ApplicationSharedPtr app;
- if (msg_params.keyExists(strings::app_id)) {
- const uint32_t app_id = msg_params[strings::app_id].asUInt();
- LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for appID " << app_id);
- LOG4CXX_DEBUG(logger_, "Searching app to send OnSystemRequest by appID.");
- app = application_manager_.application(app_id);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Received OnSystemRequest without appID."
- " One of registered apps will be used.");
- LOG4CXX_DEBUG(logger_, "Searching registered app to send OnSystemRequest.");
- const PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- const uint32_t selected_app_id = policy_handler.GetAppIdForSending();
- if (0 == selected_app_id) {
- LOG4CXX_WARN(logger_,
- "Can't select application to forward OnSystemRequest.");
- return;
- }
- app = application_manager_.application(selected_app_id);
- }
-
- if (!app.valid()) {
- LOG4CXX_WARN(logger_,
- "No valid application found to forward OnSystemRequest.");
- return;
- }
-
- std::string device_mac;
- application_manager_.connection_handler()
- .get_session_observer()
- .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
-
- if (policy::kDeviceAllowed !=
- application_manager_.GetPolicyHandler().GetUserConsentForDevice(
- device_mac)) {
- LOG4CXX_WARN(logger_,
- "Application "
- << app->policy_app_id()
- << " is registered from non-consented device."
- "Can't forward notification to application.");
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Sending request with application id " << app->policy_app_id());
-
- params[strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
deleted file mode 100644
index bd152c2af0..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {}
-
-void OnTTSLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_tts_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- /* need to clarify, because unchanged VR
- cause WRONG_LANGUAGE on Register */
- hmi_capabilities.set_active_vr_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
- ApplicationSetIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-
- if (static_cast<int>(app->language()) !=
- (*message_)[strings::msg_params][strings::language].asInt()) {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
deleted file mode 100644
index 283e2056ba..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {}
-
-void OnTTSResetTimeoutNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
deleted file mode 100644
index 317465f354..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSStartedNotification::OnTTSStartedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSStartedNotification::~OnTTSStartedNotification() {}
-
-void OnTTSStartedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::TTS_Started);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
deleted file mode 100644
index 7f763d8598..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTTSStoppedNotification::OnTTSStoppedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnTTSStoppedNotification::~OnTTSStoppedNotification() {}
-
-void OnTTSStoppedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
deleted file mode 100644
index 9f91d99a85..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUICommandNotification::OnUICommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUICommandNotification::~OnUICommandNotification() {}
-
-void OnUICommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
-
- (*message_)[strings::msg_params][strings::trigger_source] =
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU);
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
deleted file mode 100644
index 117fec5741..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {}
-
-void OnUIKeyBoardInputNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnKeyboardInputID;
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
deleted file mode 100644
index 6e8e38f757..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUILanguageChangeNotification::OnUILanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {}
-
-void OnUILanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_ui_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- (*message_)[strings::msg_params][strings::language];
-
- (*message_)[strings::msg_params][strings::language] =
- hmi_capabilities.active_vr_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
-
- if (app->ui_language() !=
- (*message_)[strings::msg_params][strings::hmi_display_language]
- .asInt()) {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
deleted file mode 100644
index a5fea7bf8d..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {}
-
-void OnUIResetTimeoutNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
deleted file mode 100644
index 7709af8720..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace hmi {
-
-OnUITouchEventNotification::OnUITouchEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUITouchEventNotification::~OnUITouchEventNotification() {}
-
-void OnUITouchEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnTouchEventID;
- SendNotificationToMobile(message_);
-}
-
-} // namespace hmi
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
deleted file mode 100644
index b245ea21aa..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/on_update_device_list.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnUpdateDeviceList::OnUpdateDeviceList(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnUpdateDeviceList::~OnUpdateDeviceList() {}
-
-void OnUpdateDeviceList::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
deleted file mode 100644
index 9b10055e2c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {}
-
-void OnVIAccPedalPositionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
deleted file mode 100644
index 58f9add514..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIBeltStatusNotification::OnVIBeltStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {}
-
-void OnVIBeltStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
deleted file mode 100644
index 33f2944c38..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIBodyInformationNotification::OnVIBodyInformationNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {}
-
-void OnVIBodyInformationNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
deleted file mode 100644
index 9cbf612be1..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {}
-
-void OnVIDeviceStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
deleted file mode 100644
index e521ac3a37..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {}
-
-void OnVIDriverBrakingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
deleted file mode 100644
index ebed955270..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {}
-
-void OnVIEngineTorqueNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
deleted file mode 100644
index 9f0696fdc6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {}
-
-void OnVIExternalTemperatureNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
deleted file mode 100644
index ef650a9f99..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIFuelLevelNotification::OnVIFuelLevelNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {}
-
-void OnVIFuelLevelNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
deleted file mode 100644
index a5267d8dac..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {}
-
-void OnVIFuelLevelStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
deleted file mode 100644
index 63b95bf6dc..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIGpsDataNotification::OnVIGpsDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIGpsDataNotification::~OnVIGpsDataNotification() {}
-
-void OnVIGpsDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
deleted file mode 100644
index 7d494f02d3..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {}
-
-void OnVIHeadLampStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
deleted file mode 100644
index a62f4cacea..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIInstantFuelConsumptionNotification::
- ~OnVIInstantFuelConsumptionNotification() {}
-
-void OnVIInstantFuelConsumptionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
deleted file mode 100644
index 229d50667b..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIMyKeyNotification::OnVIMyKeyNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIMyKeyNotification::~OnVIMyKeyNotification() {}
-
-void OnVIMyKeyNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
deleted file mode 100644
index 10f236539c..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIOdometerNotification::OnVIOdometerNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIOdometerNotification::~OnVIOdometerNotification() {}
-
-void OnVIOdometerNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
deleted file mode 100644
index 81585eabca..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIPrndlNotification::OnVIPrndlNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIPrndlNotification::~OnVIPrndlNotification() {}
-
-void OnVIPrndlNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
deleted file mode 100644
index b5c0703917..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIRpmNotification::OnVIRpmNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIRpmNotification::~OnVIRpmNotification() {}
-
-void OnVIRpmNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
deleted file mode 100644
index aacafb71c9..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVISpeedNotification::OnVISpeedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVISpeedNotification::~OnVISpeedNotification() {}
-
-void OnVISpeedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
deleted file mode 100644
index af102ea926..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {}
-
-void OnVISteeringWheelAngleNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
deleted file mode 100644
index 99506e6171..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVITirePressureNotification::OnVITirePressureNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVITirePressureNotification::~OnVITirePressureNotification() {}
-
-void OnVITirePressureNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
deleted file mode 100644
index 5383876714..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIVehicleDataNotification::OnVIVehicleDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {}
-
-void OnVIVehicleDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- if (msg_params.keyExists(strings::odometer)) {
- application_manager_.IviInfoUpdated(ODOMETER,
- msg_params[strings::odometer].asInt());
- }
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
deleted file mode 100644
index c360e41dff..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIVinNotification::OnVIVinNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIVinNotification::~OnVIVinNotification() {}
-
-void OnVIVinNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
deleted file mode 100644
index 08fb3f31d4..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVIWiperStatusNotification::OnVIWiperStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {}
-
-void OnVIWiperStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // prepare SmartObject for mobile factory
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
-
- SendNotificationToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc
deleted file mode 100644
index ee0a91f5ef..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVideoDataStreamingNotification::OnVideoDataStreamingNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationToHMI(message, application_manager) {}
-
-OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {}
-
-void OnVideoDataStreamingNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
deleted file mode 100644
index c609e2dc0a..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/state_controller.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRCommandNotification::OnVRCommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRCommandNotification::~OnVRCommandNotification() {}
-
-void OnVRCommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asUInt();
- uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id();
-
- // Check if this is one of standart VR commands (i.e. "Help")
- if (cmd_id > max_cmd_id + 1) {
- LOG4CXX_INFO(logger_, "Switched App");
- const uint32_t app_id = cmd_id - max_cmd_id;
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (app) {
- application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, true);
- } else {
- LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
- }
- return;
- }
-
- // Check if this is "Help"
- if (cmd_id == max_cmd_id + 1) {
- return;
- }
- const uint32_t app_id =
- (*message_)[strings::msg_params][strings::app_id].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- /* check if perform interaction is active
- * if it is active we should sent to HMI DeleteCommand request
- * and PerformInterActionResponse to mobile
- */
- if (0 != app->is_perform_interaction_active()) {
- event_engine::Event event(hmi_apis::FunctionID::VR_OnCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- } else {
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
-
- (*message_)[strings::msg_params][strings::trigger_source] =
- static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
- SendNotificationToMobile(message_);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
deleted file mode 100644
index bbdb55cde6..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRLanguageChangeNotification::OnVRLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {}
-
-void OnVRLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_active_vr_language(
- static_cast<hmi_apis::Common_Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
-
- (*message_)[strings::msg_params][strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
-
- (*message_)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
-
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it;) {
- ApplicationSharedPtr app = *it++;
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotificationToMobile(message_);
- if (static_cast<int32_t>(app->language()) !=
- (*message_)[strings::msg_params][strings::language].asInt()) {
- application_manager_.state_controller().SetRegularState(
- app, mobile_api::HMILevel::HMI_NONE, false);
-
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app->app_id(),
- mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(
- app->app_id(), mobile_apis::Result::SUCCESS, false);
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
deleted file mode 100644
index 68942fcf01..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRStartedNotification::OnVRStartedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRStartedNotification::~OnVRStartedNotification() {}
-
-void OnVRStartedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_Started);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
deleted file mode 100644
index e8f9fab847..0000000000
--- a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVRStoppedNotification::OnVRStoppedNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : NotificationFromHMI(message, application_manager) {}
-
-OnVRStoppedNotification::~OnVRStoppedNotification() {}
-
-void OnVRStoppedNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_Stopped);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
deleted file mode 100644
index 1119e7c4fd..0000000000
--- a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/request_from_hmi.h"
-#include "application_manager/application_manager.h"
-#include "utils/make_shared.h"
-
-namespace application_manager {
-
-namespace commands {
-
-RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {
- // Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*(message.get()));
-}
-
-RequestFromHMI::~RequestFromHMI() {}
-
-bool RequestFromHMI::Init() {
- return true;
-}
-
-bool RequestFromHMI::CleanUp() {
- return true;
-}
-
-void RequestFromHMI::Run() {}
-
-void RequestFromHMI::on_event(const event_engine::Event& event) {}
-
-void RequestFromHMI::SendResponse(
- const bool success,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code) {
- smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- FillCommonParametersOfSO(*message, correlation_id, function_id);
- (*message)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message)[strings::params][hmi_response::code] = 0;
- (*message)[strings::msg_params][strings::success] = success;
- (*message)[strings::msg_params][strings::result_code] = result_code;
-
- application_manager_.ManageHMICommand(message);
-}
-
-void RequestFromHMI::SendErrorResponse(
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id,
- const hmi_apis::Common_Result::eType result_code,
- const std::string error_message) {
- smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- FillCommonParametersOfSO(*message, correlation_id, function_id);
- (*message)[strings::params][strings::message_type] =
- MessageType::kErrorResponse;
- (*message)[strings::params][hmi_response::code] = result_code;
- (*message)[strings::params][strings::error_msg] = error_message;
-
- application_manager_.ManageHMICommand(message);
-}
-
-void RequestFromHMI::FillCommonParametersOfSO(
- smart_objects::SmartObject& message,
- const uint32_t correlation_id,
- const hmi_apis::FunctionID::eType function_id) {
- (message)[strings::params][strings::function_id] = function_id;
- (message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (message)[strings::params][strings::protocol_version] = protocol_version_;
- (message)[strings::params][strings::correlation_id] = correlation_id;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
deleted file mode 100644
index 39d549ac72..0000000000
--- a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace commands {
-
-bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
- HmiInterfaces::InterfaceID interface) {
- const HmiInterfaces::InterfaceState state =
- application_manager.hmi_interfaces().GetInterfaceState(interface);
- return HmiInterfaces::STATE_NOT_AVAILABLE != state;
-}
-
-bool ChangeInterfaceState(ApplicationManager& application_manager,
- const smart_objects::SmartObject& response_from_hmi,
- HmiInterfaces::InterfaceID interface) {
- if (response_from_hmi[strings::msg_params].keyExists(strings::available)) {
- const bool is_available =
- response_from_hmi[strings::msg_params][strings::available].asBool();
- const HmiInterfaces::InterfaceState interface_state =
- is_available ? HmiInterfaces::STATE_AVAILABLE
- : HmiInterfaces::STATE_NOT_AVAILABLE;
- application_manager.hmi_interfaces().SetInterfaceState(interface,
- interface_state);
- return is_available;
- }
- return false;
-}
-
-RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
-
-RequestToHMI::~RequestToHMI() {}
-
-bool RequestToHMI::Init() {
- return true;
-}
-
-bool RequestToHMI::CleanUp() {
- return true;
-}
-
-void RequestToHMI::Run() {}
-
-void RequestToHMI::SendRequest() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
deleted file mode 100644
index 23d8e6e229..0000000000
--- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/response_from_hmi.h"
-
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // If it is error response, shift info
- if ((*message)[strings::params].keyExists(hmi_response::message)) {
- (*message)[strings::msg_params][strings::info] =
- (*message)[strings::params][hmi_response::message];
- }
-
- // Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*(message.get()));
-}
-
-ResponseFromHMI::~ResponseFromHMI() {}
-
-bool ResponseFromHMI::Init() {
- return true;
-}
-
-bool ResponseFromHMI::CleanUp() {
- return true;
-}
-
-void ResponseFromHMI::Run() {}
-
-void ResponseFromHMI::SendResponseToMobile(
- const MessageSharedPtr& message, ApplicationManager& application_manager) {
- (*message)[strings::params][strings::message_type] = MessageType::kResponse;
-
- application_manager_.ManageMobileCommand(message, ORIGIN_SDL);
-}
-
-void ResponseFromHMI::CreateHMIRequest(
- const hmi_apis::FunctionID::eType& function_id,
- const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
-
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
-
- // get hmi correlation id for chaining further request from this object
- const uint32_t hmi_correlation_id_ =
- application_manager_.GetNextHMICorrelationID();
-
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
- request[strings::params][strings::message_type] = MessageType::kRequest;
- request[strings::params][strings::function_id] = function_id;
- request[strings::params][strings::correlation_id] = hmi_correlation_id_;
- request[strings::params][strings::protocol_version] =
- CommandImpl::protocol_version_;
- request[strings::params][strings::protocol_type] =
- CommandImpl::hmi_protocol_type_;
-
- request[strings::msg_params] = msg_params;
-
- if (!application_manager_.ManageHMICommand(result)) {
- LOG4CXX_ERROR(logger_, "Unable to send request");
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
deleted file mode 100644
index e6f64047ba..0000000000
--- a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/response_to_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
-
-ResponseToHMI::~ResponseToHMI() {}
-
-bool ResponseToHMI::Init() {
- return true;
-}
-
-bool ResponseToHMI::CleanUp() {
- return true;
-}
-
-void ResponseToHMI::Run() {
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
deleted file mode 100644
index 3a5a8d25f9..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace {
-struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
- connection_handler::DeviceHandle handle_;
- ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle)
- : handle_(handle) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app
- ? handle_ == app->device() &&
- ProtocolVersion::kV4 == app->protocol_version()
- : false;
- }
-};
-
-struct ForegroundApp
- : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
- bool> {
- bool operator()(
- const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
- return ptr ? ptr->is_foreground() : false;
- }
-};
-
-struct SendLaunchApp
- : std::unary_function<SDLActivateAppRequest::V4ProtoApps::value_type,
- void> {
- ApplicationConstSharedPtr app_to_launch_;
- ApplicationManager& application_manager_;
- SendLaunchApp(ApplicationConstSharedPtr app_to_launch, ApplicationManager& am)
- : app_to_launch_(app_to_launch), application_manager_(am) {}
- void operator()(
- const SDLActivateAppRequest::V4ProtoApps::value_type ptr) const {
- MessageHelper::SendLaunchApp((*ptr).app_id(),
- app_to_launch_->SchemaUrl(),
- app_to_launch_->PackageName(),
- application_manager_);
- return;
- }
-};
-}
-
-SDLActivateAppRequest::SDLActivateAppRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLActivateAppRequest::~SDLActivateAppRequest() {}
-
-uint32_t SDLActivateAppRequest::app_id() const {
- using namespace strings;
- if (!(*message_).keyExists(msg_params)) {
- LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
- return 0;
- }
- if (!(*message_)[msg_params].keyExists(strings::app_id)) {
- LOG4CXX_DEBUG(logger_,
- strings::app_id << " section is absent in the message.");
- return 0;
- }
- return (*message_)[msg_params][strings::app_id].asUInt();
-}
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis::FunctionID;
-
- if (application_manager_.state_controller().IsStateActive(
- HmiState::STATE_ID_DEACTIVATE_HMI)) {
- LOG4CXX_DEBUG(logger_,
- "DeactivateHmi state is active. "
- "Sends response with result code REJECTED");
- SendErrorResponse(correlation_id(),
- static_cast<eType>(function_id()),
- hmi_apis::Common_Result::REJECTED,
- "HMIDeactivate is active");
- } else {
- const uint32_t application_id = app_id();
- application_manager_.GetPolicyHandler().OnActivateApp(application_id,
- correlation_id());
- }
-}
-
-#else // EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis::FunctionID;
- using namespace hmi_apis::Common_Result;
-
- const uint32_t application_id = app_id();
-
- ApplicationConstSharedPtr app_to_activate =
- application_manager_.application(application_id);
-
- if (!app_to_activate) {
- LOG4CXX_WARN(
- logger_,
- "Can't find application within regular apps: " << application_id);
-
- // Here is the hack - in fact SDL gets hmi_app_id in appID field and
- // replaces it with connection_key only for normally registered apps, but
- // for apps_to_be_registered (waiting) it keeps original value (hmi_app_id)
- // so method does lookup for hmi_app_id
- app_to_activate =
- application_manager_.WaitingApplicationByID(application_id);
-
- if (!app_to_activate) {
- LOG4CXX_WARN(
- logger_,
- "Can't find application within waiting apps: " << application_id);
- return;
- }
- }
-
- LOG4CXX_DEBUG(logger_,
- "Found application to activate. Application id is "
- << app_to_activate->app_id());
-
- if (application_manager_.state_controller().IsStateActive(
- HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) {
- LOG4CXX_WARN(logger_,
- "DeactivateHmi state is active. "
- "Sends response with result code REJECTED");
- SendErrorResponse(correlation_id(),
- static_cast<hmi_apis::FunctionID::eType>(function_id()),
- hmi_apis::Common_Result::REJECTED,
- "HMIDeactivate is active");
- return;
- }
-
- if (app_to_activate->IsRegistered()) {
- LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
- application_manager_.GetPolicyHandler().OnActivateApp(application_id,
- correlation_id());
- return;
- }
-
- connection_handler::DeviceHandle device_handle = app_to_activate->device();
- ApplicationSharedPtr foreground_v4_app = get_foreground_app(device_handle);
- V4ProtoApps v4_proto_apps = get_v4_proto_apps(device_handle);
-
- if (!foreground_v4_app && v4_proto_apps.empty()) {
- LOG4CXX_ERROR(logger_,
- "Can't find regular foreground app with the same "
- "connection id:"
- << device_handle);
- SendErrorResponse(
- correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, "");
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Application is not registered yet. "
- "Sending launch request.");
-
- if (foreground_v4_app) {
- LOG4CXX_DEBUG(logger_, "Sending request to foreground application.");
- MessageHelper::SendLaunchApp(foreground_v4_app->app_id(),
- app_to_activate->SchemaUrl(),
- app_to_activate->PackageName(),
- application_manager_);
- } else {
- LOG4CXX_DEBUG(logger_,
- "No preffered (foreground) application is found. "
- "Sending request to all v4 applications.");
- std::for_each(v4_proto_apps.begin(),
- v4_proto_apps.end(),
- SendLaunchApp(app_to_activate, application_manager_));
- }
-
- subscribe_on_event(BasicCommunication_OnAppRegistered);
-}
-
-#endif // EXTERNAL_PROPRIETARY_MODE
-void SDLActivateAppRequest::onTimeOut() {
- using namespace hmi_apis::FunctionID;
- using namespace hmi_apis::Common_Result;
- using namespace application_manager;
- unsubscribe_from_event(BasicCommunication_OnAppRegistered);
- SendErrorResponse(
- correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
-}
-
-void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
- using namespace hmi_apis::FunctionID;
- if (event.id() != BasicCommunication_OnAppRegistered) {
- return;
- }
- unsubscribe_from_event(BasicCommunication_OnAppRegistered);
-
- // Have to use HMI app id from event, since HMI app id from original request
- // message will be changed after app, initially requested for launch via
- // SDL.ActivateApp, will be registered
- const uint32_t hmi_application_id = hmi_app_id(event.smart_object());
-
- ApplicationSharedPtr app =
- application_manager_.application_by_hmi_app(hmi_application_id);
- if (!app) {
- LOG4CXX_ERROR(
- logger_, "Application not found by HMI app id: " << hmi_application_id);
- return;
- }
- application_manager_.GetPolicyHandler().OnActivateApp(app->app_id(),
- correlation_id());
-}
-
-uint32_t SDLActivateAppRequest::hmi_app_id(
- const smart_objects::SmartObject& so) const {
- using namespace strings;
- if (!so.keyExists(params)) {
- LOG4CXX_DEBUG(logger_, params << " section is absent in the message.");
- return 0;
- }
- if (!so[msg_params].keyExists(application)) {
- LOG4CXX_DEBUG(logger_, application << " section is absent in the message.");
- return 0;
- }
- if (so[msg_params][application].keyExists(strings::app_id)) {
- LOG4CXX_DEBUG(logger_,
- strings::app_id << " section is absent in the message.");
- return 0;
- }
- return so[msg_params][application][strings::app_id].asUInt();
-}
-
-SDLActivateAppRequest::V4ProtoApps SDLActivateAppRequest::get_v4_proto_apps(
- const connection_handler::DeviceHandle handle) const {
- const ApplicationSet app_list = application_manager_.applications().GetData();
- V4ProtoApps v4_proto_apps;
- std::copy_if(app_list.begin(),
- app_list.end(),
- std::back_inserter(v4_proto_apps),
- ProtoV4AppsOnDevice(handle));
- return v4_proto_apps;
-}
-
-ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app(
- const connection_handler::DeviceHandle handle) const {
- V4ProtoApps v4_proto_apps = get_v4_proto_apps(handle);
- V4ProtoApps::iterator foreground_app =
- std::find_if(v4_proto_apps.begin(), v4_proto_apps.end(), ForegroundApp());
- return foreground_app != v4_proto_apps.end() ? *foreground_app
- : ApplicationSharedPtr();
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
deleted file mode 100644
index 75a8c0b241..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLActivateAppResponse::SDLActivateAppResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLActivateAppResponse::~SDLActivateAppResponse() {}
-
-void SDLActivateAppResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
deleted file mode 100644
index 4b150cda60..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {}
-
-void SDLGetListOfPermissionsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t connection_key = 0;
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt();
- }
- application_manager_.GetPolicyHandler().OnGetListOfPermissions(
- connection_key,
- (*message_)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
deleted file mode 100644
index 521b59a0ec..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {}
-
-void SDLGetListOfPermissionsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
deleted file mode 100644
index afa7569746..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {}
-
-void SDLGetStatusUpdateRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.GetPolicyHandler().OnGetStatusUpdate(
- (*message_)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
deleted file mode 100644
index 0af7e0217a..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {}
-
-void SDLGetStatusUpdateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
deleted file mode 100644
index ea959389ef..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestFromHMI(message, application_manager) {}
-
-SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {}
-
-void SDLGetUserFriendlyMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string messageCodes = "messageCodes";
- if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
- LOG4CXX_WARN(logger_,
- "Mandatory parameter '" + messageCodes + "'' is missing");
- return;
- }
- smart_objects::SmartArray* msg =
- (*message_)[strings::msg_params][messageCodes].asArray();
-
- std::vector<std::string> msg_codes;
-
- smart_objects::SmartArray::const_iterator it = msg->begin();
- smart_objects::SmartArray::const_iterator it_end = msg->end();
- for (; it != it_end; ++it) {
- msg_codes.push_back((*it).asString());
- }
-
- std::string required_language;
- if ((*message_)[strings::msg_params].keyExists(strings::language)) {
- uint32_t lang_code =
- (*message_)[strings::msg_params][strings::language].asUInt();
- required_language =
- application_manager::MessageHelper::CommonLanguageToString(
- static_cast<hmi_apis::Common_Language::eType>(lang_code));
- } else {
- hmi_apis::Common_Language::eType ui_language =
- application_manager_.hmi_capabilities().active_ui_language();
-
- required_language =
- application_manager::MessageHelper::CommonLanguageToString(ui_language);
- }
-
- application_manager_.GetPolicyHandler().OnGetUserFriendlyMessage(
- msg_codes,
- required_language,
- (*message_)[strings::params][strings::correlation_id].asInt());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
deleted file mode 100644
index c693625dbb..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseToHMI(message, application_manager) {}
-
-SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {}
-
-void SDLGetUserFriendlyMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
deleted file mode 100644
index f1fb9ccead..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SDLPolicyUpdate::SDLPolicyUpdate(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-SDLPolicyUpdate::~SDLPolicyUpdate() {}
-
-void SDLPolicyUpdate::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
- SendRequest();
-#else
- LOG4CXX_WARN(logger_,
- "This RPC is part of extended policy flow."
- "Please re-build with extended policy mode enabled.");
-#endif
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
deleted file mode 100644
index 38b57a5b9f..0000000000
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/sdl_policy_update_response.h"
-
-namespace application_manager {
-
-namespace commands {
-SDLPolicyUpdateResponse::SDLPolicyUpdateResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {}
-
-void SDLPolicyUpdateResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO(PV): add some logic here
-}
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
deleted file mode 100644
index bb1f29d889..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSChangeRegistrationRequest::TTSChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {}
-
-void TTSChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
deleted file mode 100644
index e63ee5f74d..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSChangeRegistratioResponse::TTSChangeRegistratioResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {}
-
-void TTSChangeRegistratioResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
deleted file mode 100644
index 4dbf5e8ee7..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {}
-
-void TTSGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
deleted file mode 100644
index ce629b36d7..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {}
-
-void TTSGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::speech_capabilities)) {
- hmi_capabilities.set_speech_capabilities(
- (*message_)[strings::msg_params][hmi_response::speech_capabilities]);
- }
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::prerecorded_speech_capabilities)) {
- hmi_capabilities.set_prerecorded_speech(
- (*message_)[strings::msg_params]
- [hmi_response::prerecorded_speech_capabilities]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
deleted file mode 100644
index c44667a223..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetLanguageRequest::TTSGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetLanguageRequest::~TTSGetLanguageRequest() {}
-
-void TTSGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
deleted file mode 100644
index 37aed2c6cb..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetLanguageResponse::TTSGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetLanguageResponse::~TTSGetLanguageResponse() {}
-
-void TTSGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_tts_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::TTS_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
deleted file mode 100644
index 941adca01d..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {}
-
-void TTSGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
deleted file mode 100644
index 79af1d3cc2..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {}
-
-void TTSGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_tts_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
deleted file mode 100644
index 71e89dd9b9..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-TTSIsReadyRequest::~TTSIsReadyRequest() {}
-
-void TTSIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id());
- SendRequest();
-}
-
-void TTSIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS);
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_tts_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_TTS)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_TTS isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void TTSIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void TTSIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
deleted file mode 100644
index 30e2f4816b..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSIsReadyResponse::TTSIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSIsReadyResponse::~TTSIsReadyResponse() {}
-
-void TTSIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
deleted file mode 100644
index bf035ffe23..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {}
-
-void TTSSetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
deleted file mode 100644
index f494fb1a8e..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {}
-
-void TTSSetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
deleted file mode 100644
index 2e386449d0..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_speak_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSpeakRequest::TTSSpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSSpeakRequest::~TTSSpeakRequest() {}
-
-void TTSSpeakRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
deleted file mode 100644
index 5cffdccf34..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSSpeakResponse::TTSSpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSSpeakResponse::~TTSSpeakResponse() {}
-
-void TTSSpeakResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
deleted file mode 100644
index c2275dda72..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSStopSpeakingRequest::TTSStopSpeakingRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {}
-
-void TTSStopSpeakingRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
deleted file mode 100644
index 67d747f464..0000000000
--- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-TTSStopSpeakingResponse::TTSStopSpeakingResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {}
-
-void TTSStopSpeakingResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
deleted file mode 100644
index c0edad3f80..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddCommandRequest::UIAddCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAddCommandRequest::~UIAddCommandRequest() {}
-
-void UIAddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
deleted file mode 100644
index a7eaabc91e..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddCommandResponse::UIAddCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAddCommandResponse::~UIAddCommandResponse() {}
-
-void UIAddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
deleted file mode 100644
index f0a233853c..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddSubmenuRequest::UIAddSubmenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAddSubmenuRequest::~UIAddSubmenuRequest() {}
-
-void UIAddSubmenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
deleted file mode 100644
index 6c6c18cbad..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAddSubmenuResponse::UIAddSubmenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAddSubmenuResponse::~UIAddSubmenuResponse() {}
-
-void UIAddSubmenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
deleted file mode 100644
index 44673d4981..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_alert_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAlertRequest::UIAlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIAlertRequest::~UIAlertRequest() {}
-
-void UIAlertRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
deleted file mode 100644
index 6d552a1eb7..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIAlertResponse::UIAlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIAlertResponse::~UIAlertResponse() {}
-
-void UIAlertResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
deleted file mode 100644
index dcc88125fc..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIChangeRegistrationRequest::UIChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {}
-
-void UIChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
deleted file mode 100644
index 52805a93c8..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIChangeRegistratioResponse::UIChangeRegistratioResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {}
-
-void UIChangeRegistratioResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
deleted file mode 100644
index 7bd529e8dc..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteCommandRequest::UIDeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIDeleteCommandRequest::~UIDeleteCommandRequest() {}
-
-void UIDeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
deleted file mode 100644
index 74a1bd64c2..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteCommandResponse::UIDeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIDeleteCommandResponse::~UIDeleteCommandResponse() {}
-
-void UIDeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
deleted file mode 100644
index 335d97eee4..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {}
-
-void UIDeleteSubmenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
deleted file mode 100644
index 302343da5e..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIDeleteSubmenuResponse::UIDeleteSubmenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {}
-
-void UIDeleteSubmenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
deleted file mode 100644
index e1cd11f922..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIEndAudioPassThruRequest::UIEndAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {}
-
-void UIEndAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
deleted file mode 100644
index e9eb596b85..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIEndAudioPassThruResponse::UIEndAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {}
-
-void UIEndAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
deleted file mode 100644
index 0ae4258d6b..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetCapabilitiesRequest::UIGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {}
-
-void UIGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
deleted file mode 100644
index de0a2f2157..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetCapabilitiesResponse::UIGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {}
-
-void UIGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params.keyExists(hmi_response::display_capabilities)) {
- hmi_capabilities.set_display_capabilities(
- msg_params[hmi_response::display_capabilities]);
- }
-
- if (msg_params.keyExists(hmi_response::hmi_zone_capabilities)) {
- hmi_capabilities.set_hmi_zone_capabilities(
- msg_params[hmi_response::hmi_zone_capabilities]);
- }
-
- if (msg_params.keyExists(hmi_response::soft_button_capabilities)) {
- hmi_capabilities.set_soft_button_capabilities(
- msg_params[hmi_response::soft_button_capabilities]);
- }
-
- if (msg_params.keyExists(strings::audio_pass_thru_capabilities)) {
- hmi_capabilities.set_audio_pass_thru_capabilities(
- msg_params[strings::audio_pass_thru_capabilities]);
- }
-
- if (msg_params.keyExists(strings::hmi_capabilities)) {
- if (msg_params[strings::hmi_capabilities].keyExists(strings::navigation)) {
- hmi_capabilities.set_navigation_supported(
- msg_params[strings::hmi_capabilities][strings::navigation].asBool());
- }
- if (msg_params[strings::hmi_capabilities].keyExists(strings::phone_call)) {
- hmi_capabilities.set_phone_call_supported(
- msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
deleted file mode 100644
index 59d9eef6e3..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetLanguageRequest::UIGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetLanguageRequest::~UIGetLanguageRequest() {}
-
-void UIGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
deleted file mode 100644
index dfbdb89804..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetLanguageResponse::UIGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetLanguageResponse::~UIGetLanguageResponse() {}
-
-void UIGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_ui_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::UI_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
deleted file mode 100644
index 598ff39f79..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {}
-
-void UIGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
deleted file mode 100644
index e5849f5f63..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {}
-
-void UIGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_ui_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
deleted file mode 100644
index 9e27e23d34..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-UIIsReadyRequest::~UIIsReadyRequest() {}
-
-void UIIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id());
- SendRequest();
-}
-
-void UIIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received UI_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI);
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_ui_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_UI)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_UI isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void UIIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void UIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
deleted file mode 100644
index 088baeb8b2..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIIsReadyResponse::UIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIIsReadyResponse::~UIIsReadyResponse() {}
-
-void UIIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
deleted file mode 100644
index a88719d303..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {}
-
-void UIPerformAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
deleted file mode 100644
index 0736cca526..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {}
-
-void UIPerformAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
deleted file mode 100644
index 82a900f1ae..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformInteractionRequest::UIPerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIPerformInteractionRequest::~UIPerformInteractionRequest() {}
-
-void UIPerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
deleted file mode 100644
index ea78c0cd66..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIPerformInteractionResponse::UIPerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIPerformInteractionResponse::~UIPerformInteractionResponse() {}
-
-void UIPerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
deleted file mode 100644
index 006944d404..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIScrollableMessageRequest::UIScrollableMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIScrollableMessageRequest::~UIScrollableMessageRequest() {}
-
-void UIScrollableMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
deleted file mode 100644
index c39a99fc61..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIScrollableMessageResponse::UIScrollableMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIScrollableMessageResponse::~UIScrollableMessageResponse() {}
-
-void UIScrollableMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc
deleted file mode 100644
index 2666eedfc8..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetAppIconRequest::UISetAppIconRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetAppIconRequest::~UISetAppIconRequest() {}
-
-void UISetAppIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc
deleted file mode 100644
index 18fc5a5761..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetAppIconResponse::UISetAppIconResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetAppIconResponse::~UISetAppIconResponse() {}
-
-void UISetAppIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
deleted file mode 100644
index cd69c9c8e6..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {}
-
-void UiSetDisplayLayoutRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
deleted file mode 100644
index c5a439636f..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {}
-
-void UiSetDisplayLayoutResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
deleted file mode 100644
index 8658a043b0..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {}
-
-void UISetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
deleted file mode 100644
index d10c206a7c..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {}
-
-void UISetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
deleted file mode 100644
index 1653ec0744..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_icon_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetIconRequest::UISetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetIconRequest::~UISetIconRequest() {}
-
-void UISetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
deleted file mode 100644
index 955cb1d57b..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetMediaClockTimerRequest::UISetMediaClockTimerRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {}
-
-void UISetMediaClockTimerRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
deleted file mode 100644
index 32acef4994..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISetMediaClockTimerResponse::UISetMediaClockTimerResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {}
-
-void UISetMediaClockTimerResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/src/commands/hmi/ui_show_request.cc
deleted file mode 100644
index 9c0e90feff..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_show_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_show_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIShowRequest::UIShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UIShowRequest::~UIShowRequest() {}
-
-void UIShowRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/src/commands/hmi/ui_show_response.cc
deleted file mode 100644
index 333d9e96c5..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_show_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UIShowResponse::UIShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UIShowResponse::~UIShowResponse() {}
-
-void UIShowResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Show);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
deleted file mode 100644
index 26e6ed76b0..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_slider_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISliderRequest::UISliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UISliderRequest::~UISliderRequest() {}
-
-void UISliderRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
deleted file mode 100644
index 091eb50e0d..0000000000
--- a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UISliderResponse::UISliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UISliderResponse::~UISliderResponse() {}
-
-void UISliderResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
deleted file mode 100644
index 286d269727..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_app_list_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateAppListRequest::UpdateAppListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UpdateAppListRequest::~UpdateAppListRequest() {}
-
-void UpdateAppListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
deleted file mode 100644
index 6546d03805..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_app_list_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateAppListResponse::UpdateAppListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateAppListResponse::~UpdateAppListResponse() {}
-
-void UpdateAppListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add check
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
deleted file mode 100644
index 74d104b36d..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_device_list_request.h"
-
-#include "interfaces/HMI_API.h"
-
-#include <unistd.h>
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateDeviceListRequest::UpdateDeviceListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager_.event_dispatcher()) {}
-
-UpdateDeviceListRequest::~UpdateDeviceListRequest() {}
-
-void UpdateDeviceListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
- // Flag conditional compilation for specific customer is used in order to
- // exclude
- // hit code to RTC
- if (true == application_manager_.get_settings().launch_hmi()) {
- if (!application_manager_.IsHMICooperating()) {
- LOG4CXX_INFO(logger_, "Wait for HMI Cooperation");
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- termination_condition_.Wait(auto_lock);
- LOG4CXX_DEBUG(logger_, "HMI Cooperation OK");
- }
- }
-
- SendRequest();
-}
-
-void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- LOG4CXX_INFO(logger_, "received OnReady");
- unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- termination_condition_.Broadcast();
- break;
- };
- default: {
- LOG4CXX_ERROR(logger_, "Unknown event ");
- break;
- };
- }
-}
-
-bool UpdateDeviceListRequest::CleanUp() {
- sync_primitives::AutoLock auto_lock(wait_hmi_lock);
- termination_condition_.Broadcast();
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
deleted file mode 100644
index 6d9dec92f8..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/update_device_list_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateDeviceListResponse::UpdateDeviceListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateDeviceListResponse::~UpdateDeviceListResponse() {}
-
-void UpdateDeviceListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // TODO(PV): add check for correctness.
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
deleted file mode 100644
index 44f7547964..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/update_sdl_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateSDLRequest::UpdateSDLRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-UpdateSDLRequest::~UpdateSDLRequest() {}
-
-void UpdateSDLRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.GetPolicyHandler().PTExchangeAtUserRequest(
- (*message_)[strings::params][strings::correlation_id].asInt());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
deleted file mode 100644
index 0e8978fe89..0000000000
--- a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/update_sdl_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateSDLResponse::UpdateSDLResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-UpdateSDLResponse::~UpdateSDLResponse() {}
-
-void UpdateSDLResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message_)[strings::params][strings::protocol_version] = protocol_version_;
-
- application_manager_.SendMessageToHMI(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
deleted file mode 100644
index 5fe81fcbd8..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {}
-
-void VIDiagnosticMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
deleted file mode 100644
index e19af75b54..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {}
-
-void VIDiagnosticMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
deleted file mode 100644
index b373471c43..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetDTCsRequest::VIGetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetDTCsRequest::~VIGetDTCsRequest() {}
-
-void VIGetDTCsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
deleted file mode 100644
index 3e720f9dbc..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetDTCsResponse::VIGetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetDTCsResponse::~VIGetDTCsResponse() {}
-
-void VIGetDTCsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
deleted file mode 100644
index 05424c4967..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleDataRequest::VIGetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {}
-
-void VIGetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
deleted file mode 100644
index 2794f6eddd..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VIGetVehicleDataResponse::VIGetVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {}
-
-void VIGetVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
-
- if ((*message_)[strings::params][strings::message_type] ==
- static_cast<int32_t>(hmi_apis::messageType::error_response)) {
- smart_objects::SmartObject result(smart_objects::SmartType_Map);
-
- if ((*message_)[strings::params].keyExists(strings::data)) {
- result[strings::msg_params] = (*message_)[strings::params][strings::data];
- result[strings::params][hmi_response::code] =
- (*message_)[strings::params][hmi_response::code];
- result[strings::params][strings::correlation_id] =
- (*message_)[strings::params][strings::correlation_id];
- result[strings::params][strings::error_msg] =
- (*message_)[strings::params][strings::error_msg];
- result[strings::params][strings::message_type] =
- (*message_)[strings::params][strings::message_type];
- result[strings::params][strings::protocol_type] =
- (*message_)[strings::params][strings::protocol_type];
- result[strings::params][strings::protocol_version] =
- (*message_)[strings::params][strings::protocol_version];
- }
-
- event.set_smart_object(result);
- } else {
- event.set_smart_object(*message_);
- application_manager_.GetPolicyHandler().OnVehicleDataUpdated(*message_);
- }
-
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
deleted file mode 100644
index 64a3831e1c..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleTypeRequest::VIGetVehicleTypeRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {}
-
-void VIGetVehicleTypeRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
deleted file mode 100644
index 2369eb7eee..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIGetVehicleTypeResponse::VIGetVehicleTypeResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {}
-
-void VIGetVehicleTypeResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_vehicle_type(
- (*message_)[strings::msg_params][hmi_response::vehicle_type]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
deleted file mode 100644
index ddd08695a0..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-VIIsReadyRequest::~VIIsReadyRequest() {}
-
-void VIIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady,
- correlation_id());
- SendRequest();
-}
-
-void VIIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_IsReady: {
- LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- const bool is_available =
- ChangeInterfaceState(application_manager_,
- message,
- HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_ivi_cooperating(is_available);
- application_manager_.GetPolicyHandler().OnVIIsReady();
- if (!CheckAvailabilityHMIInterfaces(
- application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
- LOG4CXX_INFO(
- logger_,
- "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available");
- return;
- }
- SendMessageToHMI();
-
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void VIIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void VIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_type(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- application_manager_));
- application_manager_.ManageHMICommand(get_type);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
deleted file mode 100644
index 2f84190494..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIIsReadyResponse::VIIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIIsReadyResponse::~VIIsReadyResponse() {}
-
-void VIIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
deleted file mode 100644
index d72fcb8157..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIReadDIDRequest::VIReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIReadDIDRequest::~VIReadDIDRequest() {}
-
-void VIReadDIDRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
deleted file mode 100644
index 568a573f88..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIReadDIDResponse::VIReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIReadDIDResponse::~VIReadDIDResponse() {}
-
-void VIReadDIDResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
deleted file mode 100644
index 5c953334bb..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {}
-
-void VISubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
deleted file mode 100644
index 4df2d9190a..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {}
-
-void VISubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
deleted file mode 100644
index 2211cde19c..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {}
-
-void VIUnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
deleted file mode 100644
index 5044f0ef43..0000000000
--- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {}
-
-void VIUnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
deleted file mode 100644
index 04af05d4e7..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRAddCommandRequest::VRAddCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRAddCommandRequest::~VRAddCommandRequest() {}
-
-void VRAddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
deleted file mode 100644
index 496bd47605..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/event_engine/event.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRAddCommandResponse::VRAddCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRAddCommandResponse::~VRAddCommandResponse() {}
-
-void VRAddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
deleted file mode 100644
index e64e7cc388..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRChangeRegistrationRequest::VRChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {}
-
-void VRChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
deleted file mode 100644
index 8084688c15..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRChangeRegistrationResponse::VRChangeRegistrationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {}
-
-void VRChangeRegistrationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
deleted file mode 100644
index 1db85529da..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRDeleteCommandRequest::VRDeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRDeleteCommandRequest::~VRDeleteCommandRequest() {}
-
-void VRDeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
deleted file mode 100644
index 08711be2c8..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRDeleteCommandResponse::VRDeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRDeleteCommandResponse::~VRDeleteCommandResponse() {}
-
-void VRDeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
deleted file mode 100644
index 3159380c17..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {}
-
-void VRGetCapabilitiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
deleted file mode 100644
index 9aa0fc6668..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {}
-
-void VRGetCapabilitiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
-
- hmi_capabilities.set_vr_capabilities(
- (*message_)[strings::msg_params][strings::vr_capabilities]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
deleted file mode 100644
index baf34c8017..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetLanguageRequest::VRGetLanguageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetLanguageRequest::~VRGetLanguageRequest() {}
-
-void VRGetLanguageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
deleted file mode 100644
index a55dca44a3..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-
-#include "application_manager/event_engine/event.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetLanguageResponse::VRGetLanguageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetLanguageResponse::~VRGetLanguageResponse() {}
-
-void VRGetLanguageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
-
- Common_Language::eType language = Common_Language::INVALID_ENUM;
-
- if ((*message_).keyExists(strings::msg_params) &&
- (*message_)[strings::msg_params].keyExists(hmi_response::language)) {
- language = static_cast<Common_Language::eType>(
- (*message_)[strings::msg_params][hmi_response::language].asInt());
- }
-
- application_manager_.hmi_capabilities().set_active_vr_language(language);
-
- LOG4CXX_DEBUG(logger_,
- "Raising event for function_id " << function_id()
- << " and correlation_id "
- << correlation_id());
- event_engine::Event event(FunctionID::VR_GetLanguage);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
deleted file mode 100644
index def4a64699..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {}
-
-void VRGetSupportedLanguagesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
deleted file mode 100644
index e5a6ed0b86..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {}
-
-void VRGetSupportedLanguagesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const hmi_apis::Common_Result::eType code =
- static_cast<hmi_apis::Common_Result::eType>(
- (*message_)[strings::params][hmi_response::code].asInt());
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_vr_supported_languages(
- (*message_)[strings::msg_params][hmi_response::languages]);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
deleted file mode 100644
index 086b5d4490..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager)
- , EventObserver(application_manager.event_dispatcher()) {}
-
-VRIsReadyRequest::~VRIsReadyRequest() {}
-
-void VRIsReadyRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id());
- SendRequest();
-}
-
-void VRIsReadyRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::VR_IsReady: {
- LOG4CXX_DEBUG(logger_, "Received VR_IsReady event");
- unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady);
- const bool is_available = ChangeInterfaceState(
- application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR);
-
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- hmi_capabilities.set_is_vr_cooperating(is_available);
- if (!CheckAvailabilityHMIInterfaces(application_manager_,
- HmiInterfaces::HMI_INTERFACE_VR)) {
- LOG4CXX_INFO(logger_,
- "HmiInterfaces::HMI_INTERFACE_VR isn't available");
- return;
- }
- SendMessageToHMI();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-void VRIsReadyRequest::onTimeOut() {
- // Note(dtrunov): According to new requirment APPLINK-27956
- SendMessageToHMI();
-}
-
-void VRIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
- MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
- application_manager_));
- HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
- hmi_capabilities.set_handle_response_for(*get_language);
- application_manager_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- application_manager_));
- application_manager_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
- MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
- application_manager_.ManageHMICommand(get_capabilities);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
deleted file mode 100644
index 78e2dae23b..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRIsReadyResponse::VRIsReadyResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRIsReadyResponse::~VRIsReadyResponse() {}
-
-void VRIsReadyResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VR_IsReady);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
deleted file mode 100644
index c4646e59f4..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRPerformInteractionRequest::VRPerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : RequestToHMI(message, application_manager) {}
-
-VRPerformInteractionRequest::~VRPerformInteractionRequest() {}
-
-void VRPerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
deleted file mode 100644
index bb5ceb3755..0000000000
--- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/event_engine/event.h"
-
-namespace application_manager {
-
-namespace commands {
-
-VRPerformInteractionResponse::VRPerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : ResponseFromHMI(message, application_manager) {}
-
-VRPerformInteractionResponse::~VRPerformInteractionResponse() {}
-
-void VRPerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc
deleted file mode 100644
index a76f537a24..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_command_request.cc
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/add_command_request.h"
-
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-AddCommandRequest::AddCommandRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , send_ui_(false)
- , send_vr_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-AddCommandRequest::~AddCommandRequest() {}
-
-void AddCommandRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- RemoveCommand();
- CommandRequestImpl::onTimeOut();
-}
-
-void AddCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
- mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::cmd_icon],
- app,
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(
- logger_, "MessageHelper::VerifyImage return " << verification_result);
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (app->FindCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt())) {
- LOG4CXX_ERROR(logger_, "INVALID_ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- bool data_exist = false;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- if (!CheckCommandName(app)) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
- if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
- hmi_request::parent_id)) &&
- (0 !=
- (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt())) {
- if (!CheckCommandParentId(app)) {
- SendResponse(
- false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist");
- return;
- }
- }
- data_exist = true;
- }
-
- if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) &&
- ((*message_)[strings::msg_params][strings::vr_commands].length() > 0)) {
- if (!CheckCommandVRSynonym(app)) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- data_exist = true;
- }
-
- if (!data_exist) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- app->AddCommand((*message_)[strings::msg_params][strings::cmd_id].asUInt(),
- (*message_)[strings::msg_params]);
-
- smart_objects::SmartObject ui_msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- ui_msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- ui_msg_params[strings::menu_params] =
- (*message_)[strings::msg_params][strings::menu_params];
-
- ui_msg_params[strings::app_id] = app->app_id();
-
- if (((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) &&
- ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(
- strings::value)) &&
- (0 < (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
- .length())) {
- ui_msg_params[strings::cmd_icon] =
- (*message_)[strings::msg_params][strings::cmd_icon];
- }
-
- send_ui_ = true;
- }
-
- smart_objects::SmartObject vr_msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
- vr_msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- vr_msg_params[strings::vr_commands] =
- (*message_)[strings::msg_params][strings::vr_commands];
- vr_msg_params[strings::app_id] = app->app_id();
-
- vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- vr_msg_params[strings::grammar_id] = app->get_grammar_id();
-
- send_vr_ = true;
- }
-
- if (send_ui_) {
- SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
- }
-
- if (send_vr_) {
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
- }
-}
-
-bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator i = commands.begin();
- uint32_t saved_parent_id = 0;
- uint32_t parent_id = 0;
- if ((*message_)[strings::msg_params][strings::menu_params].keyExists(
- hmi_request::parent_id)) {
- parent_id = (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asUInt();
- }
-
- for (; commands.end() != i; ++i) {
- if (!(*i->second).keyExists(strings::menu_params)) {
- continue;
- }
-
- saved_parent_id = 0;
- if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) {
- saved_parent_id =
- (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt();
- }
- if (((*i->second)[strings::menu_params][strings::menu_name].asString() ==
- (*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asString()) &&
- (saved_parent_id == parent_id)) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandName received"
- " command name already exist in same level menu");
- return false;
- }
- }
- return true;
-}
-
-bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- for (; commands.end() != it; ++it) {
- if (!(*it->second).keyExists(strings::vr_commands)) {
- continue;
- }
-
- for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) {
- for (size_t j = 0;
- j < (*message_)[strings::msg_params][strings::vr_commands].length();
- ++j) {
- const custom_str::CustomString& vr_cmd_i =
- (*it->second)[strings::vr_commands][i].asCustomString();
- const custom_str::CustomString& vr_cmd_j =
- (*message_)[strings::msg_params][strings::vr_commands][j]
- .asCustomString();
-
- if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandVRSynonym"
- " received command vr synonym already exist");
- return false;
- }
- }
- }
- }
- return true;
-}
-
-bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
- if (!app) {
- return false;
- }
-
- const int32_t parent_id =
- (*message_)[strings::msg_params][strings::menu_params]
- [hmi_request::parent_id].asInt();
- smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
-
- if (!parent) {
- LOG4CXX_INFO(logger_,
- "AddCommandRequest::CheckCommandParentId received"
- " submenu doesn't exist");
- return false;
- }
- return true;
-}
-
-// TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest
-void AddCommandRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
- msg_param[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_param[strings::app_id] = application->app_id();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_AddCommand: {
- LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_info_);
- if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
- (*message_)[strings::msg_params].erase(strings::menu_params);
- }
- break;
- }
- case hmi_apis::FunctionID::VR_AddCommand: {
- LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
- is_vr_received_ = true;
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, vr_info_);
- if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
- (*message_)[strings::msg_params].erase(strings::vr_commands);
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- return;
- }
-
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = application->app_id();
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
-
- const bool is_vr_invalid_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::INVALID_ENUM,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_ui_invalid_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::INVALID_ENUM,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
- const bool is_vr_unsupported =
- vr_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- const bool is_ui_unsupported =
- ui_result_ == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
-
- const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- bool result = (is_no_ui_error && is_no_vr_error) ||
- (is_no_ui_error && is_vr_invalid_unsupported) ||
- (is_no_vr_error && is_ui_invalid_unsupported);
-
- LOG4CXX_DEBUG(logger_,
- "calculated result " << ui_result_ << " " << is_no_ui_error
- << " " << is_no_vr_error);
- const bool is_vr_or_ui_warning =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_);
-
- const bool is_vr_or_ui_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- ui_result_,
- vr_result_);
-
- const bool is_vr_and_ui_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- ui_result_,
- vr_result_);
-
- if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) {
- result_code = MessageHelper::HMIToMobileResult(ui_result_);
- } else if (result && is_vr_or_ui_unsupported) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else if (is_vr_or_ui_warning) {
- result_code = mobile_apis::Result::WARNINGS;
- } else {
- result_code =
- MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_));
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_) {
- result_code = MessageHelper::HMIToMobileResult(vr_result_);
- }
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) {
- result_code = MessageHelper::HMIToMobileResult(ui_result_);
- }
- LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code);
- }
-
- if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) {
- const bool is_ui_not_ok = Compare<hmi_apis::Common_Result::eType, NEQ, ALL>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- if (is_ui_not_ok) {
- result_code = ui_result_ == hmi_apis::Common_Result::REJECTED
- ? mobile_apis::Result::REJECTED
- : mobile_apis::Result::GENERIC_ERROR;
-
- msg_params[strings::grammar_id] = application->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
-
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
- result = false;
- LOG4CXX_DEBUG(logger_, "Result " << result);
- }
- }
-
- if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ &&
- !is_no_vr_error &&
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE != vr_result_) {
- result_code = vr_result_ == hmi_apis::Common_Result::REJECTED
- ? mobile_apis::Result::REJECTED
- : mobile_apis::Result::GENERIC_ERROR;
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
-
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
- result = false;
- LOG4CXX_DEBUG(logger_, "Result " << result);
- }
-
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
- HmiInterfaces::InterfaceState vr_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VR);
-
- if (!BothSend() &&
- ((is_vr_unsupported &&
- HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) ||
- (is_ui_unsupported &&
- HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) {
- LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported");
- result = false;
- }
-
- if (is_vr_and_ui_unsupported) {
- LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported");
- result = false;
- }
-
- if (!result) {
- RemoveCommand();
- }
-
- const std::string info = GenerateMobileResponseInfo();
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- &(message[strings::msg_params]));
-
- if (result) {
- application->UpdateHash();
- }
-}
-
-bool AddCommandRequest::IsPendingResponseExist() {
- return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
-}
-
-bool AddCommandRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
- str = (*message_)[strings::msg_params][strings::menu_params]
- [strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
- const size_t len =
- (*message_)[strings::msg_params][strings::vr_commands].length();
-
- for (size_t i = 0; i < len; ++i) {
- str = (*message_)[strings::msg_params][strings::vr_commands][i]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
- str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-bool AddCommandRequest::BothSend() const {
- return send_vr_ && send_ui_;
-}
-
-const std::string AddCommandRequest::GenerateMobileResponseInfo() {
- // In case if vr_result_ is UNSUPPORTED_RESOURCE vr_info should be on the
- // first place
- // In case if ui_result_ is UNSUPPORTED_RESOURCE ui_info should be on the
- // first place
- // Other way order is doesn't matter
-
- HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- HmiInterfaces::InterfaceState ui_interface_state =
- hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_UI);
-
- HmiInterfaces::InterfaceState vr_interface_state =
- hmi_interfaces.GetInterfaceState(HmiInterfaces::HMI_INTERFACE_VR);
-
- if ((ui_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (vr_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !vr_info_.empty()) {
- return vr_info_;
- }
-
- if ((vr_interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) &&
- (ui_interface_state != HmiInterfaces::STATE_NOT_AVAILABLE) &&
- !ui_info_.empty()) {
- return ui_info_;
- }
-
- return MergeInfos(ui_info_, vr_info_);
-}
-
-void AddCommandRequest::RemoveCommand() {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- return;
- }
-
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = app->app_id();
-
- app->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
-
- if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
- // in case we have send bth UI and VR and no one respond
- // we have nothing to remove from HMI so no DeleteCommand expected
- return;
- }
-
- if (BothSend() && !is_vr_received_) {
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- }
-
- if (BothSend() && !is_ui_received_) {
- msg_params[strings::grammar_id] = app->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_response.cc b/src/components/application_manager/src/commands/mobile/add_command_response.cc
deleted file mode 100644
index fc468f9c57..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_command_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_command_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddCommandResponse::AddCommandResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AddCommandResponse::~AddCommandResponse() {}
-
-void AddCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
deleted file mode 100644
index 6838d1af7d..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_sub_menu_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddSubMenuRequest::AddSubMenuRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-AddSubMenuRequest::~AddSubMenuRequest() {}
-
-void AddSubMenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t menu_id =
- (*message_)[strings::msg_params][strings::menu_id].asInt();
- if (app->FindSubMenu(menu_id)) {
- LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- const std::string& menu_name =
- (*message_)[strings::msg_params][strings::menu_name].asString();
-
- if (app->IsSubMenuNameAlreadyExist(menu_name)) {
- LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated.");
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- if (!CheckSubMenuName()) {
- LOG4CXX_ERROR(logger_, "Sub-menu name is not valid.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::menu_id] =
- (*message_)[strings::msg_params][strings::menu_id];
- if ((*message_)[strings::msg_params].keyExists(strings::position)) {
- msg_params[strings::menu_params][strings::position] =
- (*message_)[strings::msg_params][strings::position];
- }
- msg_params[strings::menu_params][strings::menu_name] =
- (*message_)[strings::msg_params][strings::menu_name];
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
-}
-
-void AddSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_AddSubMenu: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (result) {
- application->AddSubMenu(
- (*message_)[strings::msg_params][strings::menu_id].asInt(),
- (*message_)[strings::msg_params]);
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- application->UpdateHash();
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool AddSubMenuRequest::CheckSubMenuName() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_INFO(logger_, "Invalid subMenu name.");
- return false;
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
deleted file mode 100644
index 1fbdb4e66c..0000000000
--- a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/add_sub_menu_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AddSubMenuResponse::AddSubMenuResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AddSubMenuResponse::~AddSubMenuResponse() {}
-
-void AddSubMenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
deleted file mode 100644
index b151990289..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include <string>
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertManeuverRequest::AlertManeuverRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
- , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-AlertManeuverRequest::~AlertManeuverRequest() {}
-
-void AlertManeuverRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
- LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (NULL == app.get()) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n"
- "text contains only whitespace in ttsChunks");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
- SendResponse(false, processing_result);
- return;
- }
-
- // Checking parameters and how many HMI requests should be sent
- bool tts_is_ok = false;
-
- // check TTSChunk parameter
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
- pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak);
- tts_is_ok = true;
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[hmi_request::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
-
- pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true);
-
- if (tts_is_ok) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::tts_chunks] =
- (*message_)[strings::msg_params][strings::tts_chunks];
- msg_params[hmi_request::speak_type] =
- hmi_apis::Common_MethodName::ALERT_MANEUVER;
-
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
- }
-}
-
-void AlertManeuverRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- hmi_apis::FunctionID::eType event_id = event.id();
- switch (event_id) {
- case hmi_apis::FunctionID::Navigation_AlertManeuver: {
- LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
- pending_requests_.Remove(event_id);
- navi_alert_maneuver_result_code_ =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, info_navi_);
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- pending_requests_.Remove(event_id);
- tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, info_tts_);
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- SendResponse(
- false, mobile_apis::Result::INVALID_ENUM, "Received unknown event");
- return;
- }
- }
-
- if (!pending_requests_.IsFinal(event_id)) {
- LOG4CXX_DEBUG(logger_,
- "There are some pending responses from HMI."
- "AlertManeuverRequest still waiting.");
- return;
- }
- std::string return_info;
- mobile_apis::Result::eType result_code;
- const bool result = PrepareResponseParameters(result_code, return_info);
- bool must_be_empty_info = false;
- if (return_info.find("\n") != std::string::npos ||
- return_info.find("\t") != std::string::npos) {
- must_be_empty_info = true;
- }
- SendResponse(result,
- result_code,
- (must_be_empty_info) ? NULL : return_info.c_str(),
- &(message[strings::msg_params]));
-}
-
-bool AlertManeuverRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& return_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- application_manager::commands::ResponseInfo navigation_alert_info(
- navi_alert_maneuver_result_code_,
- HmiInterfaces::HMI_INTERFACE_Navigation);
-
- application_manager::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;
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- const smart_objects::SmartArray* tc_array =
- (*message_)[strings::msg_params][strings::tts_chunks].asArray();
-
- smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
- smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
-
- for (; it_tc != it_tc_end; ++it_tc) {
- str = (*it_tc)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
deleted file mode 100644
index 2f441594c2..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_maneuver_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertManeuverResponse::AlertManeuverResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AlertManeuverResponse::~AlertManeuverResponse() {}
-
-void AlertManeuverResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc
deleted file mode 100644
index 3288870b92..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_request.cc
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_request.h"
-
-#include <string.h>
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "utils/helpers.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertRequest::AlertRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , awaiting_ui_alert_response_(false)
- , awaiting_tts_speak_response_(false)
- , awaiting_tts_stop_speaking_response_(false)
- , is_alert_succeeded_(false)
- , is_ui_alert_sent_(false)
- , alert_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-AlertRequest::~AlertRequest() {}
-
-bool AlertRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::duration)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::duration].asUInt();
- } else {
- const int32_t def_value = 5000;
- default_timeout_ = def_value;
- }
-
- // If soft buttons are present, SDL will not use initiate timeout tracking for
- // response.
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- LOG4CXX_INFO(logger_,
- "Request contains soft buttons - request timeout "
- "will be set to 0.");
- default_timeout_ = 0;
- }
-
- return true;
-}
-
-void AlertRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asInt();
-
- if (!Validate(app_id)) {
- // Invalid command, abort execution
- return;
- }
- bool tts_chunks_exists =
- (*message_)[strings::msg_params].keyExists(strings::tts_chunks);
- size_t length_tts_chunks = 0;
-
- if (tts_chunks_exists) {
- length_tts_chunks =
- (*message_)[strings::msg_params][strings::tts_chunks].length();
- }
-
- if ((tts_chunks_exists && length_tts_chunks) ||
- ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
- (*message_)[strings::msg_params][strings::play_tone].asBool())) {
- awaiting_tts_speak_response_ = true;
- }
-
- SendAlertRequest(app_id);
- if (awaiting_tts_speak_response_) {
- SendSpeakRequest(app_id, tts_chunks_exists, length_tts_chunks);
- }
-}
-
-void AlertRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (false ==
- (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- CommandRequestImpl::onTimeOut();
- return;
- }
- LOG4CXX_INFO(logger_,
- "Default timeout ignored. "
- "AlertRequest with soft buttons wait timeout on HMI side");
-}
-
-void AlertRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_OnResetTimeout:
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_INFO(logger_,
- "Received UI_OnResetTimeout event "
- " or TTS_OnResetTimeout event"
- << awaiting_tts_speak_response_ << " "
- << awaiting_tts_stop_speaking_response_ << " "
- << awaiting_ui_alert_response_);
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_Alert: {
- LOG4CXX_INFO(logger_, "Received UI_Alert event");
- // Unsubscribe from event to avoid unwanted messages
- unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
- awaiting_ui_alert_response_ = false;
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
-
- if (awaiting_tts_speak_response_ &&
- HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
- awaiting_tts_stop_speaking_response_ = true;
- SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
- }
- alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- // Mobile Alert request is successful when UI_Alert is successful
- alert_response_params_ = message[strings::msg_params];
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- // Unsubscribe from event to avoid unwanted messages
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
- awaiting_tts_speak_response_ = false;
- tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_StopSpeaking: {
- LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
- // Unsubscribe from event to avoid unwanted messages
- unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
- awaiting_tts_stop_speaking_response_ = false;
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (HasHmiResponsesToWait()) {
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string info;
- const bool result = PrepareResponseParameters(result_code, info);
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- &alert_response_params_);
-}
-
-bool AlertRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- ResponseInfo ui_alert_info(alert_result_, HmiInterfaces::HMI_INTERFACE_UI);
- 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;
- }
- 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;
- }
- 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) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
-
- if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
- app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::POLICY_TABLE)) {
- LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return false;
- }
-
- if (!CheckStringsOfAlertRequest()) {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return false;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return false;
- }
-
- // check if mandatory params(alertText1 and TTSChunk) specified
- if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) &&
- (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) &&
- (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) {
- LOG4CXX_ERROR(logger_, "Mandatory parameters are missing");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Mandatory parameters are missing");
- return false;
- }
-
- return true;
-}
-
-void AlertRequest::SendAlertRequest(int32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::alert_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText1;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text1];
- index++;
- }
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText2;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text2];
- index++;
- }
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
- msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
- hmi_apis::Common_TextFieldName::alertText3;
- msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::alert_text3];
- }
-
- // softButtons
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[hmi_request::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
- // app_id
- msg_params[strings::app_id] = app_id;
- msg_params[strings::duration] = default_timeout_;
-
- // NAVI platform progressIndicator
- if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) {
- msg_params[strings::progress_indicator] =
- (*message_)[strings::msg_params][strings::progress_indicator];
- }
-
- // PASA Alert type
- msg_params[strings::alert_type] = hmi_apis::Common_AlertType::UI;
- if (awaiting_tts_speak_response_) {
- msg_params[strings::alert_type] = hmi_apis::Common_AlertType::BOTH;
- }
-
- // check out if there are alert strings or soft buttons
- if (msg_params[hmi_request::alert_strings].length() > 0 ||
- msg_params.keyExists(hmi_request::soft_buttons)) {
- awaiting_ui_alert_response_ = true;
- is_ui_alert_sent_ = true;
- SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
- }
-}
-
-void AlertRequest::SendSpeakRequest(int32_t app_id,
- bool tts_chunks_exists,
- size_t length_tts_chunks) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- using namespace smart_objects;
- // crate HMI speak request
- SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
- if (tts_chunks_exists && length_tts_chunks) {
- msg_params[hmi_request::tts_chunks] =
- smart_objects::SmartObject(SmartType_Array);
- msg_params[hmi_request::tts_chunks] =
- (*message_)[strings::msg_params][strings::tts_chunks];
- }
- if ((*message_)[strings::msg_params].keyExists(strings::play_tone) &&
- (*message_)[strings::msg_params][strings::play_tone].asBool()) {
- msg_params[strings::play_tone] = true;
- }
- msg_params[strings::app_id] = app_id;
- msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
- SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
-}
-
-bool AlertRequest::CheckStringsOfAlertRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
- str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
- str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
- str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- smart_objects::SmartObject& tts_chunks_array =
- (*message_)[strings::msg_params][strings::tts_chunks];
- for (size_t i = 0; i < tts_chunks_array.length(); ++i) {
- str = tts_chunks_array[i][strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed");
- return false;
- }
- }
- }
- return true;
-}
-
-bool AlertRequest::HasHmiResponsesToWait() {
- LOG4CXX_AUTO_TRACE(logger_);
- return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ ||
- awaiting_tts_stop_speaking_response_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_response.cc b/src/components/application_manager/src/commands/mobile/alert_response.cc
deleted file mode 100644
index f8ca487eae..0000000000
--- a/src/components/application_manager/src/commands/mobile/alert_response.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/alert_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-AlertResponse::AlertResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-AlertResponse::~AlertResponse() {}
-
-void AlertResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/src/commands/mobile/change_registration_request.cc
deleted file mode 100644
index f1f3b93e24..0000000000
--- a/src/components/application_manager/src/commands/mobile/change_registration_request.cc
+++ /dev/null
@@ -1,597 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <algorithm>
-#include "application_manager/commands/mobile/change_registration_request.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace {
-namespace custom_str = utils::custom_string;
-struct IsSameNickname {
- IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
- bool operator()(const policy::StringArray::value_type& nickname) const {
- return app_id_.CompareIgnoreCase(nickname.c_str());
- }
-
- private:
- const custom_str::CustomString& app_id_;
-};
-}
-
-namespace application_manager {
-
-namespace commands {
-
-ChangeRegistrationRequest::ChangeRegistrationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-ChangeRegistrationRequest::~ChangeRegistrationRequest() {}
-
-void ChangeRegistrationRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace smart_objects;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_INFO(logger_,
- "Incoming request contains \t\n \\t \\n or whitespace");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
- SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
- return;
- }
-
- SmartObject& msg_params = (*message_)[strings::msg_params];
-
- const int32_t hmi_language =
- msg_params[strings::hmi_display_language].asInt();
-
- const int32_t language = msg_params[strings::language].asInt();
-
- if (false == (IsLanguageSupportedByUI(hmi_language) &&
- IsLanguageSupportedByVR(language) &&
- IsLanguageSupportedByTTS(language))) {
- LOG4CXX_ERROR(logger_, "Language is not supported");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (msg_params.keyExists(strings::app_name) &&
- !IsNicknameAllowed(msg_params[strings::app_name].asCustomString())) {
- LOG4CXX_ERROR(logger_, "Nickname is not allowed.");
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- pending_requests_.Add(hmi_apis::FunctionID::UI_ChangeRegistration);
- pending_requests_.Add(hmi_apis::FunctionID::VR_ChangeRegistration);
- pending_requests_.Add(hmi_apis::FunctionID::TTS_ChangeRegistration);
-
- // UI processing
- SmartObject ui_params = SmartObject(SmartType_Map);
-
- ui_params[strings::language] = hmi_language;
- ui_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::app_name)) {
- ui_params[strings::app_name] = msg_params[strings::app_name];
- app->set_name(msg_params[strings::app_name].asCustomString());
- }
- if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
- ui_params[strings::ngn_media_screen_app_name] =
- msg_params[strings::ngn_media_screen_app_name];
- app->set_ngn_media_screen_name(
- msg_params[strings::ngn_media_screen_app_name]);
- }
-
- SendHMIRequest(hmi_apis::FunctionID::UI_ChangeRegistration, &ui_params, true);
-
- // VR processing
- SmartObject vr_params = SmartObject(SmartType_Map);
-
- vr_params[strings::language] = msg_params[strings::language];
-
- vr_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::vr_synonyms)) {
- vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
- app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
- }
- SendHMIRequest(hmi_apis::FunctionID::VR_ChangeRegistration, &vr_params, true);
-
- // TTS processing
- SmartObject tts_params = SmartObject(SmartType_Map);
-
- tts_params[strings::language] = msg_params[strings::language];
-
- tts_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::tts_name)) {
- tts_params[strings::tts_name] = msg_params[strings::tts_name];
- app->set_tts_name(msg_params[strings::tts_name]);
- }
-
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_ChangeRegistration, &tts_params, true);
-}
-
-void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- hmi_apis::FunctionID::eType event_id = event.id();
-
- switch (event_id) {
- case hmi_apis::FunctionID::UI_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
- pending_requests_.Remove(event_id);
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::VR_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
- pending_requests_.Remove(event_id);
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, vr_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_ChangeRegistration: {
- LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
- pending_requests_.Remove(event_id);
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event_id);
- return;
- }
- }
-
- if (pending_requests_.IsFinal(event_id)) {
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
- application->set_ui_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::hmi_display_language]
- .asInt()));
- }
-
- if (hmi_apis::Common_Result::SUCCESS == vr_result_ ||
- hmi_apis::Common_Result::SUCCESS == tts_result_) {
- application->set_language(static_cast<mobile_api::Language::eType>(
- (*message_)[strings::msg_params][strings::language].asInt()));
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::eType::ChangeRegistrationID;
-
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- } else {
- LOG4CXX_INFO(logger_,
- "There are some pending responses from HMI."
- "ChangeRegistrationRequest still waiting.");
- }
-}
-
-namespace {
-void CheckInfo(std::string& str) {
- if (std::string::npos != str.find("is not supported by system")) {
- str.clear();
- }
-}
-} // namespace
-
-bool ChangeRegistrationRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& response_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- const bool is_tts_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- tts_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_ui_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_vr_succeeded_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- vr_result_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED,
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- const bool is_tts_ui_vr_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ALL>(
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
- tts_result_,
- ui_result_,
- vr_result_);
-
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- const HmiInterfaces::InterfaceState tts_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
- const HmiInterfaces::InterfaceState vr_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
- const HmiInterfaces::InterfaceState ui_state =
- hmi_interfaces.GetInterfaceState(
- HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
-
- ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
-
- 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 =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* ui_languages =
- hmi_capabilities.ui_supported_languages();
-
- if (!ui_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < ui_languages->length(); ++i) {
- if (hmi_display_lang == ui_languages->getElement(i).asInt()) {
- return true;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by UI");
-
- return false;
-}
-
-bool ChangeRegistrationRequest::IsLanguageSupportedByVR(
- const int32_t& hmi_display_lang) {
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* vr_languages =
- hmi_capabilities.vr_supported_languages();
-
- if (!vr_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < vr_languages->length(); ++i) {
- if (hmi_display_lang == vr_languages->getElement(i).asInt()) {
- return true;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by VR");
-
- return false;
-}
-
-bool ChangeRegistrationRequest::IsLanguageSupportedByTTS(
- const int32_t& hmi_display_lang) {
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- const smart_objects::SmartObject* tts_languages =
- hmi_capabilities.tts_supported_languages();
-
- if (!tts_languages) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- for (size_t i = 0; i < tts_languages->length(); ++i) {
- if (hmi_display_lang == tts_languages->getElement(i).asInt()) {
- return true;
- break;
- }
- }
-
- LOG4CXX_ERROR(logger_, "Language isn't supported by TTS");
- return false;
-}
-
-bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
- str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
- const smart_objects::SmartArray* tn_array =
- (*message_)[strings::msg_params][strings::tts_name].asArray();
-
- smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
- smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
-
- for (; it_tn != it_tn_end; ++it_tn) {
- str = (*it_tn)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::ngn_media_screen_app_name)) {
- str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid ngn_media_screen_app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
- const smart_objects::SmartArray* vs_array =
- (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
-
- smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
- smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
-
- for (; it_vs != it_vs_end; ++it_vs) {
- str = (*it_vs).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSet accessor = application_manager_.applications().GetData();
- custom_str::CustomString app_name;
- uint32_t app_id = connection_key();
- if (msg_params.keyExists(strings::app_name)) {
- app_name = msg_params[strings::app_name].asCustomString();
- }
-
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it; ++it) {
- if (app_id == (*it)->app_id()) {
- continue;
- }
-
- const custom_str::CustomString& cur_name = (*it)->name();
- if (msg_params.keyExists(strings::app_name)) {
- if (app_name.CompareIgnoreCase(cur_name)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
- CoincidencePredicateVR v(app_name);
-
- if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
- }
-
- // vr check
- if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
-
- CoincidencePredicateVR v(cur_name);
- if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- } // end vr check
- } // application for end
- return mobile_apis::Result::SUCCESS;
-}
-
-bool ChangeRegistrationRequest::IsNicknameAllowed(
- const custom_str::CustomString& app_name) const {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "Can't find appication with connection key "
- << connection_key());
- return false;
- }
-
- const std::string policy_app_id = app->policy_app_id();
-
- policy::StringArray app_nicknames;
- policy::StringArray app_hmi_types;
-
- bool init_result = application_manager_.GetPolicyHandler().GetInitialAppData(
- policy_app_id, &app_nicknames, &app_hmi_types);
-
- if (!init_result) {
- LOG4CXX_ERROR(logger_,
- "Error during getting of nickname list for application "
- << policy_app_id);
- return false;
- }
-
- if (!app_nicknames.empty()) {
- IsSameNickname compare(app_name);
- policy::StringArray::const_iterator it =
- std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
- if (app_nicknames.end() == it) {
- LOG4CXX_WARN(logger_,
- "Application name was not found in nicknames list.");
-
- usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
- application_manager_.GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
- ++count_of_rejections_nickname_mismatch;
-
- return false;
- }
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/src/commands/mobile/change_registration_response.cc
deleted file mode 100644
index 210cae64c5..0000000000
--- a/src/components/application_manager/src/commands/mobile/change_registration_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/change_registration_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ChangeRegistrationResponse::ChangeRegistrationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ChangeRegistrationResponse::~ChangeRegistrationResponse() {}
-
-void ChangeRegistrationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
deleted file mode 100644
index 8876ffa2e8..0000000000
--- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include <cstring>
-#include <algorithm>
-#include <vector>
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/gen_hash.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , expected_chs_count_(0)
- , received_chs_count_(0)
- , error_from_hmi_(false)
- , vr_commands_lock_(true) {}
-
-CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-void CreateInteractionChoiceSetRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- for (uint32_t i = 0;
- i < (*message_)[strings::msg_params][strings::choice_set].length();
- ++i) {
- Result::eType verification_result_image = Result::SUCCESS;
- Result::eType verification_result_secondary_image = Result::SUCCESS;
- if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
- strings::image)) {
- verification_result_image = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::choice_set][i]
- [strings::image],
- app,
- application_manager_);
- }
- if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists(
- strings::secondary_image)) {
- verification_result_secondary_image = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::choice_set][i]
- [strings::secondary_image],
- app,
- application_manager_);
- }
- if (verification_result_image == Result::INVALID_DATA ||
- verification_result_secondary_image == Result::INVALID_DATA) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, Result::INVALID_DATA);
- return;
- }
- }
-
- choice_set_id_ =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asInt();
-
- if (app->FindChoiceSet(choice_set_id_)) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id_ << " is not found.");
- SendResponse(false, Result::INVALID_ID);
- return;
- }
-
- Result::eType result = CheckChoiceSet(app);
- if (Result::SUCCESS != result) {
- SendResponse(false, result);
- return;
- }
- uint32_t grammar_id = application_manager_.GenerateGrammarID();
- (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
- app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
- SendVRAddCommandRequests(app);
-}
-
-mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
- ApplicationConstSharedPtr app) {
- using namespace smart_objects;
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::set<uint32_t> choice_id_set;
-
- const SmartArray* choice_set =
- (*message_)[strings::msg_params][strings::choice_set].asArray();
-
- SmartArray::const_iterator current_choice_set_it = choice_set->begin();
- SmartArray::const_iterator next_choice_set_it;
-
- for (; choice_set->end() != current_choice_set_it; ++current_choice_set_it) {
- std::pair<std::set<uint32_t>::iterator, bool> ins_res =
- choice_id_set.insert(
- (*current_choice_set_it)[strings::choice_id].asInt());
- if (!ins_res.second) {
- LOG4CXX_ERROR(logger_,
- "Choise with ID "
- << (*current_choice_set_it)[strings::choice_id].asInt()
- << " already exists");
- return mobile_apis::Result::INVALID_ID;
- }
-
- if (IsWhiteSpaceExist(*current_choice_set_it)) {
- LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n");
- return mobile_apis::Result::INVALID_DATA;
- }
- for (next_choice_set_it = current_choice_set_it + 1;
- choice_set->end() != next_choice_set_it;
- ++next_choice_set_it) {
- if (compareSynonyms(*current_choice_set_it, *next_choice_set_it)) {
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
- }
- return mobile_apis::Result::SUCCESS;
-}
-
-bool CreateInteractionChoiceSetRequest::compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
- smart_objects::SmartArray* vr_cmds_1 =
- choice1[strings::vr_commands].asArray();
- DCHECK(vr_cmds_1 != NULL);
- smart_objects::SmartArray* vr_cmds_2 =
- choice2[strings::vr_commands].asArray();
- DCHECK(vr_cmds_2 != NULL);
-
- smart_objects::SmartArray::iterator it;
- it = std::find_first_of(vr_cmds_1->begin(),
- vr_cmds_1->end(),
- vr_cmds_2->begin(),
- vr_cmds_2->end(),
- CreateInteractionChoiceSetRequest::compareStr);
-
- if (it != vr_cmds_1->end()) {
- LOG4CXX_INFO(logger_,
- "Incoming choice set has duplicated VR synonyms "
- << it->asString());
- return true;
- }
-
- return false;
-}
-
-bool CreateInteractionChoiceSetRequest::compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) {
- return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
-}
-
-bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
- const smart_objects::SmartObject& choice_set) {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = choice_set[strings::menu_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed");
- return true;
- }
-
- if (choice_set.keyExists(strings::secondary_text)) {
- str = choice_set[strings::secondary_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::tertiary_text)) {
- str = choice_set[strings::tertiary_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::vr_commands)) {
- const size_t len = choice_set[strings::vr_commands].length();
-
- for (size_t i = 0; i < len; ++i) {
- str = choice_set[strings::vr_commands][i].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
- return true;
- }
- }
- }
-
- if (choice_set.keyExists(strings::image)) {
- str = choice_set[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed");
- return true;
- }
- }
-
- if (choice_set.keyExists(strings::secondary_image)) {
- str = choice_set[strings::secondary_image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid secondary_image value. "
- "Syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params];
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::grammar_id] = choice_set[strings::grammar_id];
- const uint32_t choice_count = choice_set[strings::choice_set].length();
- SetAllowedToTerminate(false);
-
- expected_chs_count_ = choice_count;
- size_t chs_num = 0;
- for (; chs_num < choice_count; ++chs_num) {
- {
- sync_primitives::AutoLock error_lock(error_from_hmi_lock_);
- if (error_from_hmi_) {
- LOG4CXX_WARN(logger_,
- "Error from HMI received. Stop sending VRCommands");
- break;
- }
- }
-
- msg_params[strings::cmd_id] =
- choice_set[strings::choice_set][chs_num][strings::choice_id];
- msg_params[strings::vr_commands] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params[strings::vr_commands] =
- choice_set[strings::choice_set][chs_num][strings::vr_commands];
-
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt();
- const uint32_t vr_corr_id =
- SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true);
-
- VRCommandInfo vr_command(vr_cmd_id);
- sent_commands_map_[vr_corr_id] = vr_command;
- LOG4CXX_DEBUG(logger_,
- "VR_command sent corr_id " << vr_corr_id << " cmd_id "
- << vr_corr_id);
- }
- expected_chs_count_ = chs_num;
- LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_);
-}
-
-void CreateInteractionChoiceSetRequest::ProcessHmiError(
- const hmi_apis::Common_Result::eType vr_result) {
- LOG4CXX_DEBUG(logger_,
- "Hmi response is not Success: "
- << vr_result << ". Stop sending VRAddCommand requests");
- if (!error_from_hmi_) {
- error_from_hmi_ = true;
- std::string info =
- vr_result == hmi_apis::Common_Result::UNSUPPORTED_RESOURCE
- ? "VR is not supported by system"
- : "";
- SendResponse(false, GetMobileResultCode(vr_result), info.c_str());
- }
-}
-
-bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse(
- const uint32_t corr_id) {
- SentCommandsMap::iterator it = sent_commands_map_.find(corr_id);
- if (sent_commands_map_.end() == it) {
- LOG4CXX_WARN(logger_, "HMI response for unknown VR command received");
- return false;
- }
- VRCommandInfo& vr_command = it->second;
- vr_command.succesful_response_received_ = true;
- return true;
-}
-
-void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() {
- received_chs_count_++;
- LOG4CXX_DEBUG(logger_,
- "Got VR.AddCommand response, there are "
- << expected_chs_count_ - received_chs_count_
- << " more to wait.");
- if (received_chs_count_ < expected_chs_count_) {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- LOG4CXX_DEBUG(logger_, "Timeout for request was updated");
- } else {
- OnAllHMIResponsesReceived();
- }
-}
-
-void CreateInteractionChoiceSetRequest::on_event(
- const event_engine::Event& event) {
- using namespace hmi_apis;
- using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- const Common_Result::eType result = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool is_no_error = Compare<Common_Result::eType, EQ, ONE>(
- result, Common_Result::SUCCESS, Common_Result::WARNINGS);
- uint32_t corr_id = static_cast<uint32_t>(
- message[strings::params][strings::correlation_id].asUInt());
- if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
- {
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- if (is_no_error) {
- if (!ProcessSuccesfulHMIResponse(corr_id)) {
- return;
- }
- } else {
- ProcessHmiError(result);
- }
- }
- CountReceivedVRResponses();
- }
-}
-
-void CreateInteractionChoiceSetRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!error_from_hmi_) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- }
- DeleteChoices();
-
- // We have to keep request alive until receive all responses from HMI
- // according to SDLAQ-CRS-2976
- sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_);
- is_timed_out_ = true;
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-void CreateInteractionChoiceSetRequest::DeleteChoices() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- application->RemoveChoiceSet(choice_set_id_);
-
- smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
- msg_param[strings::app_id] = application->app_id();
-
- sync_primitives::AutoLock commands_lock(vr_commands_lock_);
- SentCommandsMap::const_iterator it = sent_commands_map_.begin();
- for (; it != sent_commands_map_.end(); ++it) {
- const VRCommandInfo& vr_command_info = it->second;
- if (vr_command_info.succesful_response_received_) {
- msg_param[strings::cmd_id] = vr_command_info.cmd_id_;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param);
- } else {
- LOG4CXX_WARN(logger_,
- "succesful response has not been received for cmd_id = "
- << vr_command_info.cmd_id_);
- }
- }
- sent_commands_map_.clear();
-}
-
-void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!error_from_hmi_) {
- SendResponse(true, mobile_apis::Result::SUCCESS);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- application->UpdateHash();
- } else {
- DeleteChoices();
- }
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
deleted file mode 100644
index 0cc137d6a0..0000000000
--- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {}
-
-void CreateInteractionChoiceSetResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc
deleted file mode 100644
index 103e87fa00..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_command_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteCommandRequest::DeleteCommandRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_vr_send_(false)
- , is_ui_received_(false)
- , is_vr_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-DeleteCommandRequest::~DeleteCommandRequest() {}
-
-void DeleteCommandRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asInt();
-
- smart_objects::SmartObject* command = application->FindCommand(cmd_id);
-
- if (!command) {
- LOG4CXX_ERROR(logger_, "Command with id " << cmd_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
- msg_params[strings::app_id] = application->app_id();
-
- // we should specify amount of required responses in the 1st request
- uint32_t chaining_counter = 0;
- if ((*command).keyExists(strings::menu_params)) {
- ++chaining_counter;
- }
-
- if ((*command).keyExists(strings::vr_commands)) {
- ++chaining_counter;
- }
- /* Need to set all flags before sending request to HMI
- * for correct processing this flags in method on_event */
- if ((*command).keyExists(strings::menu_params)) {
- is_ui_send_ = true;
- }
- // check vr params
- if ((*command).keyExists(strings::vr_commands)) {
- is_vr_send_ = true;
- }
- if (is_ui_send_) {
- 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;
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
- }
-}
-
-bool DeleteCommandRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- using namespace helpers;
- ResponseInfo ui_delete_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
- 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_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_DeleteCommand: {
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- LOG4CXX_DEBUG(logger_,
- "Received UI_DeleteCommand event with result "
- << MessageHelper::HMIResultToString(ui_result_));
- GetInfo(message, ui_info_);
- break;
- }
- case hmi_apis::FunctionID::VR_DeleteCommand: {
- is_vr_received_ = true;
- vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- LOG4CXX_DEBUG(logger_,
- "Received VR_DeleteCommand event with result "
- << MessageHelper::HMIResultToString(vr_result_));
- GetInfo(message, vr_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Still awaiting for other responses.");
- return;
- }
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
-
- const int32_t cmd_id = msg_params[strings::cmd_id].asInt();
-
- smart_objects::SmartObject* command = application->FindCommand(cmd_id);
-
- if (!command) {
- LOG4CXX_ERROR(logger_,
- "Command id " << cmd_id << " not found for "
- "application with connection key "
- << connection_key());
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string info;
- const bool result = PrepareResponseParameters(result_code, info);
- if (result) {
- application->RemoveCommand(msg_params[strings::cmd_id].asInt());
- }
- SendResponse(
- result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
- if (result) {
- application->UpdateHash();
- }
-}
-
-bool DeleteCommandRequest::IsPendingResponseExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/src/commands/mobile/delete_command_response.cc
deleted file mode 100644
index 7abc1c11d4..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_command_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_command_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteCommandResponse::DeleteCommandResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteCommandResponse::~DeleteCommandResponse() {}
-
-void DeleteCommandResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/src/commands/mobile/delete_file_request.cc
deleted file mode 100644
index 31ca29cb51..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_file_request.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_file_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteFileRequest::DeleteFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteFileRequest::~DeleteFileRequest() {}
-
-void DeleteFileRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
- (application_manager_.get_settings().delete_file_in_none() <=
- application->delete_file_in_none_count())) {
- // If application is in the HMI_NONE level the quantity of allowed
- // DeleteFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += application->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (file_system::FileExists(full_file_path)) {
- if (file_system::DeleteFile(full_file_path)) {
- const AppFile* file = application->GetFile(full_file_path);
- if (file) {
- SendFileRemovedNotification(file);
- }
-
- application->DeleteFile(full_file_path);
- application->increment_delete_file_in_none_count();
- SendResponse(true, mobile_apis::Result::SUCCESS);
- } else {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- }
- } else {
- SendResponse(false, mobile_apis::Result::REJECTED);
- }
-}
-
-void DeleteFileRequest::SendFileRemovedNotification(const AppFile* file) const {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::file_name] = file->file_name;
- msg_params[strings::file_type] = file->file_type;
-
- CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
- msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
deleted file mode 100644
index 8ed6f7ba2e..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_file_response.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_file_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteFileResponse::~DeleteFileResponse() {}
-
-void DeleteFileResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- (*message_)[strings::msg_params][strings::space_available] =
- static_cast<uint32_t>(app->GetAvailableDiskSpace());
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
deleted file mode 100644
index 6ef8e5d9da..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {}
-
-void DeleteInteractionChoiceSetRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const int32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asInt();
-
- if (!app->FindChoiceSet(choice_set_id)) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- if (ChoiceSetInUse(app)) {
- LOG4CXX_ERROR(logger_, "Choice set currently in use.");
- SendResponse(false, mobile_apis::Result::IN_USE);
- return;
- }
- SendVrDeleteCommand(app);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::interaction_choice_set_id] = choice_set_id;
- msg_params[strings::app_id] = app->app_id();
-
- app->RemoveChoiceSet(choice_set_id);
-
- // Checking of HMI responses will be implemented with APPLINK-14600
- const bool result = true;
- SendResponse(result, mobile_apis::Result::SUCCESS);
- if (result) {
- app->UpdateHash();
- }
-}
-
-bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
- ApplicationConstSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!app->is_perform_interaction_active()) {
- return false;
- }
- const DataAccessor<PerformChoiceSetMap> accessor =
- app->performinteraction_choice_set_map();
- const PerformChoiceSetMap& choice_set_map = accessor.GetData();
-
- const uint32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asUInt();
-
- PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
- for (; choice_set_map.end() != it; ++it) {
- const PerformChoice& choice = it->second;
- PerformChoice::const_iterator choice_it = choice.begin();
- for (; choice.end() != choice_it; ++choice_it) {
- if (choice_it->first == choice_set_id) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is in use.");
- return true;
- }
- }
- }
- return true;
-}
-
-void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
- application_manager::ApplicationSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t choice_set_id =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id]
- .asUInt();
-
- smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id);
-
- if (!choice_set) {
- LOG4CXX_ERROR(logger_,
- "Choice set with id " << choice_set_id << " is not found.");
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
- msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
- choice_set = &((*choice_set)[strings::choice_set]);
- for (uint32_t i = 0; i < (*choice_set).length(); ++i) {
- msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id];
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
deleted file mode 100644
index 97e07529af..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {}
-
-void DeleteInteractionChoiceSetResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- const int32_t code =
- (*message_)[strings::msg_params][strings::result_code].asInt();
-
- if (hmi_apis::Common_Result::SUCCESS == code) {
- SendResponse(true);
- } else {
- // TODO(DK): Some logic
- SendResponse(false);
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
deleted file mode 100644
index 57748e6feb..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteSubMenuRequest::DeleteSubMenuRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DeleteSubMenuRequest::~DeleteSubMenuRequest() {}
-
-void DeleteSubMenuRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- const int32_t menu_id =
- (*message_)[strings::msg_params][strings::menu_id].asInt();
-
- if (!app->FindSubMenu(menu_id)) {
- LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found.");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::menu_id] =
- (*message_)[strings::msg_params][strings::menu_id];
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
-}
-
-void DeleteSubMenuRequest::DeleteSubMenuVRCommands(
- ApplicationConstSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- for (; commands.end() != it; ++it) {
- if (!(*it->second).keyExists(strings::vr_commands)) {
- continue;
- }
-
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
- (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::grammar_id] = app->get_grammar_id();
- msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
-
- SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- }
- }
-}
-
-void DeleteSubMenuRequest::DeleteSubMenuUICommands(
- ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const DataAccessor<CommandsMap> accessor(app->commands_map());
- const CommandsMap& commands = accessor.GetData();
- CommandsMap::const_iterator it = commands.begin();
-
- while (commands.end() != it) {
- if (!(*it->second).keyExists(strings::menu_params)) {
- LOG4CXX_ERROR(logger_, "menu_params not exist");
- ++it;
- continue;
- }
-
- if ((*message_)[strings::msg_params][strings::menu_id].asInt() ==
- (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
- app->RemoveCommand((*it->second)[strings::cmd_id].asInt());
- it = commands.begin(); // Can not relay on
- // iterators after erase was called
-
- SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- } else {
- ++it;
- }
- }
-}
-
-void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_DeleteSubMenu: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (result) {
- // delete sub menu items from SDL and HMI
- DeleteSubMenuVRCommands(application);
- DeleteSubMenuUICommands(application);
- application->RemoveSubMenu(
- (*message_)[strings::msg_params][strings::menu_id].asInt());
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- application->UpdateHash();
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
deleted file mode 100644
index ad9d2ad858..0000000000
--- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DeleteSubMenuResponse::DeleteSubMenuResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DeleteSubMenuResponse::~DeleteSubMenuResponse() {}
-
-void DeleteSubMenuResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
deleted file mode 100644
index 5c5d250026..0000000000
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/diagnostic_message_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DiagnosticMessageRequest::DiagnosticMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DiagnosticMessageRequest::~DiagnosticMessageRequest() {}
-
-void DiagnosticMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::vector<uint32_t>& supported_diag_modes =
- application_manager_.get_settings().supported_diag_modes();
-
- smart_objects::SmartObject& msg_data =
- (*message_)[strings::msg_params][strings::message_data];
-
- const uint8_t mode_position = 0;
- const uint32_t msg_diagnostic_mode = msg_data[mode_position].asUInt();
- if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(),
- supported_diag_modes.end(),
- msg_diagnostic_mode)) {
- LOG4CXX_ERROR(logger_,
- "Received diagnostic mode " << msg_diagnostic_mode
- << " is not supported.");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Received diagnostic mode is not supported.");
- return;
- }
-
- // Add app_id for HMI request
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
-
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- &(*message_)[strings::msg_params],
- true);
-}
-
-void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
deleted file mode 100644
index 8c59a97a8b..0000000000
--- a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/diagnostic_message_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DiagnosticMessageResponse::DiagnosticMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DiagnosticMessageResponse::~DiagnosticMessageResponse() {}
-
-void DiagnosticMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/src/commands/mobile/dial_number_request.cc
deleted file mode 100644
index 64685afe2e..0000000000
--- a/src/components/application_manager/src/commands/mobile/dial_number_request.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include <string>
-#include "application_manager/commands/mobile/dial_number_request.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-DialNumberRequest::~DialNumberRequest() {}
-
-bool DialNumberRequest::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- default_timeout_ = 0;
-
- return true;
-}
-
-void DialNumberRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- std::string number =
- (*message_)[strings::msg_params][strings::number].asString();
- if (!CheckSyntax(number)) {
- LOG4CXX_ERROR(logger_, "Invalid incoming data");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- StripNumberParam(number);
- if (number.empty()) {
- LOG4CXX_ERROR(logger_,
- "After strip number param is empty. Invalid incoming data");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::number] =
- (*message_)[strings::msg_params][strings::number].asString();
- msg_params[strings::app_id] = application->hmi_app_id();
-
- SendHMIRequest(
- hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true);
-}
-
-void DialNumberRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- const smart_objects::SmartObject& message = event.smart_object();
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
- LOG4CXX_INFO(logger_, "Received DialNumber event");
- result_code = CommandRequestImpl::GetMobileResultCode(
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt()));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- const bool is_success = mobile_apis::Result::SUCCESS == result_code;
- const bool is_info_valid =
- message[strings::msg_params].keyExists(strings::info);
-
- if (is_info_valid) {
- const char* info_char_array =
- message[strings::msg_params][strings::info].asCharArray();
- SendResponse(is_success, result_code, info_char_array);
- return;
- }
-
- SendResponse(is_success, result_code);
-}
-
-void DialNumberRequest::StripNumberParam(std::string& number) {
- std::size_t found = 0;
- while (std::string::npos !=
- (found = number.find_first_not_of("0123456789*#,;+"))) {
- number.erase(number.begin() + found);
- }
- (*message_)[strings::msg_params][strings::number] = number;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/src/commands/mobile/dial_number_response.cc
deleted file mode 100644
index 750dcf25c4..0000000000
--- a/src/components/application_manager/src/commands/mobile/dial_number_response.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/dial_number_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-DialNumberResponse::~DialNumberResponse() {}
-
-void DialNumberResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc
deleted file mode 100644
index f67d1f2434..0000000000
--- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.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/commands/mobile/end_audio_pass_thru_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-EndAudioPassThruRequest::EndAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
-
-void EndAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
-}
-
-void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_EndAudioPassThru: {
- 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) {
- application_manager_.StopAudioPassThru(connection_key());
- }
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
deleted file mode 100644
index bb477f5083..0000000000
--- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-EndAudioPassThruResponse::EndAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-EndAudioPassThruResponse::~EndAudioPassThruResponse() {}
-
-void EndAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/generic_response.cc b/src/components/application_manager/src/commands/mobile/generic_response.cc
deleted file mode 100644
index 20f6931bb9..0000000000
--- a/src/components/application_manager/src/commands/mobile/generic_response.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/generic_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void GenericResponse::Run() {
- /*NsSmartDeviceLink::NsSmartObjects::SmartObject response;
-
- response[strings::params][strings::correlation_id] =
- (*message_)[strings::params][strings::correlation_id];
- response[strings::params][strings::protocol_version] =
- (*message_)[strings::params][strings::protocol_version];
- response[strings::params][strings::connection_key] =
- (*message_)[strings::params][strings::connection_key];
-
- response[strings::msg_params][strings::success] = false;
- */
-
- (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message_)[strings::msg_params][strings::success] = false;
- (*message_)[strings::msg_params][strings::result_code] =
- mobile_apis::Result::INVALID_DATA;
-
- SendResponse(false);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
deleted file mode 100644
index d98207c772..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_dtcs_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetDTCsRequest::GetDTCsRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetDTCsRequest::~GetDTCsRequest() {}
-
-void GetDTCsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::ecu_name] =
- (*message_)[strings::msg_params][strings::ecu_name];
-
- if ((*message_)[strings::msg_params].keyExists(strings::dtc_mask)) {
- msg_params[strings::dtc_mask] =
- (*message_)[strings::msg_params][strings::dtc_mask];
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
-}
-
-void GetDTCsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
deleted file mode 100644
index ecaf5c3d8f..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_dtcs_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetDTCsResponse::GetDTCsResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetDTCsResponse::~GetDTCsResponse() {}
-
-void GetDTCsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
deleted file mode 100644
index 25e2da3eb6..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-#ifdef HMI_DBUS_API
-GetVehicleDataRequest::GetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetVehicleDataRequest::~GetVehicleDataRequest() {}
-
-void GetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = appplication_manager.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[str::msg_params].keyExists(it->first) &&
- true == (*message_)[str::msg_params][it->first].asBool()) {
- SendRequestsToHmi(app->app_id());
- return;
- }
- }
-
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
-}
-
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps},
- {hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed},
- {hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- str::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- str::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- str::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin},
- {hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl},
- {hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer},
- {hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- str::body_information},
- {hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status},
- {hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- str::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- str::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- str::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key},
-};
-}
-
-void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) {
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app_id;
-
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[str::msg_params].keyExists(sr.str) &&
- true == (*message_)[str::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
-
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- SendHMIRequest(it->func_id, &msg_params, true);
- }
-}
-
-void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event " << event.id());
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[str::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
-
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- const char* info = NULL;
- std::string error_message;
- if (true == message[strings::params].keyExists(strings::error_msg)) {
- error_message = message[strings::params][strings::error_msg].asString();
- info = error_message.c_str();
- }
- SendResponse(any_arg_success, status, info, &response_params);
- }
-}
-#else
-GetVehicleDataRequest::GetVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetVehicleDataRequest::~GetVehicleDataRequest() {}
-
-void GetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::CONFIG_FILE)) {
- LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- const uint32_t min_length_msg_params = 1;
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[str::msg_params].keyExists(it->first) &&
- true == (*message_)[str::msg_params][it->first].asBool()) {
- msg_params[it->first] = (*message_)[strings::msg_params][it->first];
- }
- }
- if (msg_params.length() > min_length_msg_params) {
- SendHMIRequest(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true);
- return;
- } else if (HasDisallowedParams()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- } else {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
- result = result ||
- ((hmi_apis::Common_Result::DATA_NOT_AVAILABLE == result_code) &&
- (message[strings::msg_params].length() > 1));
-
- if (true ==
- message[strings::msg_params].keyExists(hmi_response::method)) {
- message[strings::msg_params].erase(hmi_response::method);
- }
- if (true == message[strings::params].keyExists(strings::error_msg)) {
- response_info = message[strings::params][strings::error_msg].asString();
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-#endif // #ifdef HMI_DBUS_API
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
deleted file mode 100644
index 1e64746262..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/get_vehicle_data_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetVehicleDataResponse::GetVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetVehicleDataResponse::~GetVehicleDataResponse() {}
-
-void GetVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
deleted file mode 100644
index 198964a333..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/get_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetWayPointsRequest::GetWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-GetWayPointsRequest::~GetWayPointsRequest() {}
-
-void GetWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = app->app_id();
- SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints,
- msg_params.empty() ? NULL : &msg_params,
- true);
-}
-
-void GetWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_GetWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/src/commands/mobile/get_way_points_response.cc
deleted file mode 100644
index 7956b34cae..0000000000
--- a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/get_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-GetWayPointsResponse::GetWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-GetWayPointsResponse::~GetWayPointsResponse() {}
-
-void GetWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc
deleted file mode 100644
index 425f1ddb46..0000000000
--- a/src/components/application_manager/src/commands/mobile/list_files_request.cc
+++ /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.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/list_files_request.h"
-
-#include "application_manager/application_impl.h"
-
-#include "application_manager/mobile_command_factory.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ListFilesRequest::~ListFilesRequest() {}
-
-void ListFilesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
- (application_manager_.get_settings().list_files_in_none() <=
- application->list_files_in_none_count())) {
- // If application is in the HMI_NONE level the quantity of allowed
- // DeleteFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- application->increment_list_files_in_none_count();
-
- (*message_)[strings::msg_params][strings::space_available] =
- static_cast<int32_t>(application->GetAvailableDiskSpace());
- uint32_t i = 0;
- const AppFilesMap& app_files = application->getAppFiles();
- for (AppFilesMap::const_iterator it = app_files.begin();
- it != app_files.end();
- ++it) {
- std::string filename = it->first.substr(it->first.find_last_of('/') + 1);
- // In AppFile to application stored full path to file. In message required
- // to write only name file.
- // Plus one required for move to next letter after '/'.
- if (i < application_manager_.get_settings().list_files_response_size()) {
- LOG4CXX_DEBUG(logger_,
- "File " + filename + " added to ListFiles response");
- (*message_)[strings::msg_params][strings::filenames][i++] = filename;
- } else {
- LOG4CXX_DEBUG(logger_,
- "File " + filename + " not added to ListFiles response");
- }
- }
- (*message_)[strings::params][strings::message_type] =
- application_manager::MessageType::kResponse;
- SendResponse(true,
- mobile_apis::Result::SUCCESS,
- NULL,
- &(*message_)[strings::msg_params]);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_response.cc b/src/components/application_manager/src/commands/mobile/list_files_response.cc
deleted file mode 100644
index fde15a94ef..0000000000
--- a/src/components/application_manager/src/commands/mobile/list_files_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/list_files_response.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ListFilesResponse::ListFilesResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ListFilesResponse::~ListFilesResponse() {}
-
-void ListFilesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
deleted file mode 100644
index 6064374dab..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnAppInterfaceUnregisteredNotification::
- ~OnAppInterfaceUnregisteredNotification() {}
-
-void OnAppInterfaceUnregisteredNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
deleted file mode 100644
index d0fa3597bc..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
-
-namespace application_manager {
-namespace commands {
-
-OnAudioPassThruNotification::OnAudioPassThruNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnAudioPassThruNotification::~OnAudioPassThruNotification() {}
-
-void OnAudioPassThruNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
deleted file mode 100644
index 7c631d6d4b..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnButtonEventNotification::OnButtonEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnButtonEventNotification::~OnButtonEventNotification() {}
-
-void OnButtonEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id.");
- return;
- }
-
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false ==
- (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- LOG4CXX_ERROR(logger_,
- "CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
- return;
- }
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "CUSTOM_BUTTON OnButtonEvent notification is allowed only "
- << "in FULL or LIMITED hmi level");
- return;
- }
-
- SendButtonEvent(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "OnButtonEvent notification is allowed only"
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if "app_id" absent send notification only in HMI_FULL mode
- if (is_app_id_exists || subscribed_app->IsFullscreen()) {
- SendButtonEvent(subscribed_app);
- }
- }
-}
-
-void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_event =
- new smart_objects::SmartObject();
-
- if (!on_btn_event) {
- LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
- return;
- }
-
- (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_event)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
-
- (*on_btn_event)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
- (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
-
- message_ = on_btn_event;
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
deleted file mode 100644
index ae6658b93a..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnButtonPressNotification::OnButtonPressNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnButtonPressNotification::~OnButtonPressNotification() {}
-
-void OnButtonPressNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const uint32_t btn_id = static_cast<uint32_t>(
- (*message_)[strings::msg_params][hmi_response::button_name].asInt());
-
- const bool is_app_id_exists =
- (*message_)[strings::msg_params].keyExists(strings::app_id);
- ApplicationSharedPtr app;
-
- // CUSTOM_BUTTON notification
- if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
- // app_id is mandatory for CUSTOM_BUTTON notification
- if (!is_app_id_exists) {
- LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id.");
- return;
- }
-
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
- // custom_button_id is mandatory for CUSTOM_BUTTON notification
- if (false ==
- (*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- LOG4CXX_ERROR(logger_,
- "CUSTOM_BUTTON OnButtonPress without custom_button_id.");
- return;
- }
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application doesn't exist.");
- return;
- }
-
- uint32_t custom_btn_id = 0;
- custom_btn_id =
- (*message_)[strings::msg_params][hmi_response::custom_button_id]
- .asUInt();
-
- if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Application doesn't subscribed to this custom_button_id.");
- return;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "CUSTOM_BUTTON OnButtonPress notification is allowed only "
- << "in FULL or LIMITED hmi level");
- return;
- }
-
- SendButtonPress(app);
- return;
- }
-
- const std::vector<ApplicationSharedPtr>& subscribed_apps =
- application_manager_.applications_by_button(btn_id);
-
- std::vector<ApplicationSharedPtr>::const_iterator it =
- subscribed_apps.begin();
- for (; subscribed_apps.end() != it; ++it) {
- ApplicationSharedPtr subscribed_app = *it;
- if (!subscribed_app) {
- LOG4CXX_WARN(logger_, "Null pointer to subscribed app.");
- continue;
- }
-
- // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
- if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
- (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
- LOG4CXX_WARN(logger_,
- "OnButtonPress notification is allowed only"
- << "in FULL or LIMITED hmi level");
- continue;
- }
- // if "appID" is present, send it to named app only if its FULL or
- // LIMITED
- if (app.valid()) {
- if (app->app_id() == subscribed_app->app_id()) {
- SendButtonPress(subscribed_app);
- }
- } else if (subscribed_app->IsFullscreen()) {
- // if No "appID" - send it FULL apps only.
- SendButtonPress(subscribed_app);
- }
- }
-}
-
-void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
- return;
- }
-
- smart_objects::SmartObjectSPtr on_btn_press =
- new smart_objects::SmartObject();
-
- if (!on_btn_press) {
- LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
- return;
- }
-
- (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
-
- (*on_btn_press)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
-
- (*on_btn_press)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
- (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
- (*message_)[strings::msg_params][hmi_response::button_mode];
-
- if ((*message_)[strings::msg_params].keyExists(
- hmi_response::custom_button_id)) {
- (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
- (*message_)[strings::msg_params][strings::custom_button_id];
- }
-
- message_ = on_btn_press;
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/src/commands/mobile/on_command_notification.cc
deleted file mode 100644
index ae8aeff771..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_command_notification.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_command_notification.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnCommandNotification::OnCommandNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnCommandNotification::~OnCommandNotification() {}
-
-void OnCommandNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- return;
- }
-
- const uint32_t cmd_id =
- (*message_)[strings::msg_params][strings::cmd_id].asUInt();
-
- if (!app->FindCommand(cmd_id)) {
- LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id);
- return;
- }
-
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- // remove app_id from notification
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- (*message_)[strings::msg_params].erase(strings::app_id);
- }
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
deleted file mode 100644
index 44ed2cf3b7..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnDriverDistractionNotification::OnDriverDistractionNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
-
-void OnDriverDistractionNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
deleted file mode 100644
index 19b93f2cbf..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hash_change_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include <string>
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnHashChangeNotification::OnHashChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnHashChangeNotification::~OnHashChangeNotification() {}
-
-void OnHashChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
- int32_t app_id;
- app_id = (*message_)[strings::params][strings::connection_key].asInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (app) {
- (*message_)[strings::msg_params][strings::hash_id] = app->curHash();
- SendNotification();
- } else {
- LOG4CXX_WARN(logger_,
- "Application with app_id " << app_id << " does not exist");
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
deleted file mode 100644
index 5225002652..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-OnHMIStatusNotification::OnHMIStatusNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnHMIStatusNotification::~OnHMIStatusNotification() {}
-
-void OnHMIStatusNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
- return;
- }
-
- mobile_apis::HMILevel::eType hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::hmi_level].asInt());
- if ((mobile_apis::HMILevel::HMI_BACKGROUND == hmi_level) ||
- (mobile_apis::HMILevel::HMI_NONE == hmi_level)) {
- if (!(app->tts_properties_in_none())) {
- app->set_tts_properties_in_none(true);
- LOG4CXX_INFO(logger_,
- "OnHMIStatusNotification::Send TTS GlobalProperties"
- " with empty array to HMI");
- MessageHelper::SendTTSGlobalProperties(app, false, application_manager_);
- }
- } else if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
- (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
- if (!(app->tts_properties_in_full())) {
- app->set_tts_properties_in_full(true);
- LOG4CXX_INFO(logger_,
- "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
- application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id());
- }
- }
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
deleted file mode 100644
index 9b16bd3572..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/message.h"
-
-namespace application_manager {
-namespace commands {
-
-OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationFromMobileImpl(message, application_manager) {}
-
-OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {}
-
-void OnHMIStatusNotificationFromMobile::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app.valid()) {
- LOG4CXX_ERROR(
- logger_, "OnHMIStatusNotificationFromMobile application doesn't exist");
- return;
- }
-
- mobile_apis::HMILevel::eType current_hmi_state =
- static_cast<mobile_apis::HMILevel::eType>(
- (*message_)[strings::msg_params][strings::hmi_level].asUInt());
-
- bool is_current_state_foreground =
- mobile_apis::HMILevel::HMI_FULL == current_hmi_state;
-
- app->set_foreground(is_current_state_foreground);
-
- connection_handler::DeviceHandle handle = app->device();
- bool is_apps_requested_before =
- application_manager_.IsAppsQueriedFrom(handle);
-
- LOG4CXX_DEBUG(logger_,
- "Mobile HMI state notication came for connection key:"
- << connection_key() << " and handle: " << handle);
-
- if (!is_apps_requested_before &&
- ProtocolVersion::kV4 == app->protocol_version() && app->is_foreground()) {
- // In case this notification will be received from mobile side with
- // foreground level for app on mobile, this should trigger remote
- // apps list query for SDL 4.0 app
- MessageHelper::SendQueryApps(connection_key(), application_manager_);
- return;
- }
-
- if (is_apps_requested_before) {
- LOG4CXX_DEBUG(logger_,
- "Remote apps list had been requested already "
- " for handle: "
- << handle);
-
- if (ProtocolVersion::kV4 == app->protocol_version()) {
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
-
- bool is_another_foreground_sdl4_app = false;
- ApplicationSetConstIt it = accessor.begin();
- for (; accessor.end() != it; ++it) {
- if (connection_key() != (*it)->app_id() &&
- ProtocolVersion::kV4 == (*it)->protocol_version() &&
- (*it)->is_foreground()) {
- is_another_foreground_sdl4_app = true;
- break;
- }
- }
-
- if (!is_another_foreground_sdl4_app) {
- application_manager_.MarkAppsGreyOut(handle,
- !is_current_state_foreground);
- application_manager_.SendUpdateAppList();
- }
- }
- return;
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
deleted file mode 100644
index 427f52c12b..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnKeyBoardInputNotification::OnKeyBoardInputNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {}
-
-void OnKeyBoardInputNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app_to_notify;
-
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetIt it = accessor.GetData().begin();
- for (; accessor.GetData().end() != it; ++it) {
- // if there is app with active perform interaction use it for notification
- ApplicationSharedPtr app = *it;
- if (app->is_perform_interaction_active() &&
- (*it)->perform_interaction_layout() ==
- mobile_apis::LayoutMode::KEYBOARD) {
- LOG4CXX_INFO(logger_,
- "There is application with active PerformInteraction");
- app_to_notify = app;
- break;
- }
-
- if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level()) {
- LOG4CXX_INFO(logger_, "There is application in HMI_FULL level");
- app_to_notify = app;
- }
- }
-
- if (app_to_notify.valid()) {
- (*message_)[strings::params][strings::connection_key] =
- app_to_notify->app_id();
- SendNotification();
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
deleted file mode 100644
index 76420b85b6..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_language_change_notification.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnLanguageChangeNotification::OnLanguageChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnLanguageChangeNotification::~OnLanguageChangeNotification() {}
-
-void OnLanguageChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
deleted file mode 100644
index 09c407b8b5..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_permissions_change_notification.h"
-#include "application_manager/message.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnPermissionsChangeNotification::OnPermissionsChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {}
-
-void OnPermissionsChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendNotification();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
deleted file mode 100644
index b56523e1e5..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_system_request_notification.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 <cstring>
-#include <cstdio>
-#include <string>
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnSystemRequestNotification::OnSystemRequestNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnSystemRequestNotification::~OnSystemRequestNotification() {}
-
-void OnSystemRequestNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace application_manager;
- using namespace mobile_apis;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_,
- "Application with connection key " << connection_key()
- << " is not registered.");
- return;
- }
-
- RequestType::eType request_type = static_cast<RequestType::eType>(
- (*message_)[strings::msg_params][strings::request_type].asInt());
- const policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(),
- request_type)) {
- LOG4CXX_WARN(logger_,
- "Request type " << request_type
- << " is not allowed by policies");
- return;
- }
-
- if (RequestType::PROPRIETARY == request_type) {
-/* According to requirements:
- "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
- If the requestType = HTTP, add to mobile API fileType = BINARY"
- Also in Genivi SDL we don't save the PT to file - we put it directly in
- binary_data */
-
-#ifdef PROPRIETARY_MODE
- const std::string filename =
- (*message_)[strings::msg_params][strings::file_name].asString();
-
- BinaryMessage binary_data;
- file_system::ReadBinaryFile(filename, binary_data);
- AddHeader(binary_data);
- (*message_)[strings::params][strings::binary_data] = binary_data;
-#endif // PROPRIETARY_MODE
- (*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- } else if (RequestType::HTTP == request_type) {
- (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
- }
-
- SendNotification();
-}
-
-#ifdef PROPRIETARY_MODE
-void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
- LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t timeout =
- application_manager_.GetPolicyHandler().TimeoutExchangeSec();
-
- size_t content_length;
- char size_str[24];
-
- if (0 > sprintf(size_str, "%zu", static_cast<size_t>(message.size()))) {
- memset(size_str, 0, sizeof(size_str));
- }
-
- char timeout_str[24];
- if (0 > sprintf(timeout_str, "%d", timeout)) {
- memset(timeout_str, 0, sizeof(timeout_str));
- }
-
- std::string policy_table_string = std::string(message.begin(), message.end());
-
- /* The Content-Length to be sent in the HTTP Request header should be
- calculated before additional escape characters are added to the
- policy table string. The mobile proxy will remove the escape
- characters after receiving this request. */
-
- content_length = ParsePTString(policy_table_string);
-
- if (0 > sprintf(size_str, "%zu", content_length)) {
- memset(size_str, 0, sizeof(size_str));
- }
-
- const std::string header =
-
- "{"
- " \"HTTPRequest\": {"
- "\"headers\": {"
- "\"ContentType\": \"application/json\","
- "\"ConnectTimeout\": " +
- std::string(timeout_str) +
- ","
- "\"DoOutput\": true,"
- "\"DoInput\": true,"
- "\"UseCaches\": false,"
- "\"RequestMethod\": \"POST\","
- "\"ReadTimeout\":" +
- std::string(timeout_str) +
- ","
- "\"InstanceFollowRedirects\": false,"
- "\"charset\": \"utf-8\","
- "\"Content-Length\": " +
- std::string(size_str) +
- "},"
- "\"body\": \"" +
- policy_table_string +
- "\""
- "}"
- "}";
-
- message.clear();
- message.assign(header.begin(), header.end());
-
- LOG4CXX_DEBUG(
- logger_, "Header added: " << std::string(message.begin(), message.end()));
-}
-
-size_t OnSystemRequestNotification::ParsePTString(
- std::string& pt_string) const {
- std::string result;
- size_t length = pt_string.length();
- size_t result_length = length;
- result.reserve(length * 2);
- for (size_t i = 0; i < length; ++i) {
- if (pt_string[i] == '\"' || pt_string[i] == '\\') {
- result += '\\';
- } else if (pt_string[i] == '\n') {
- result_length--; // contentLength is adjusted when this character is not
- // copied to result.
- continue;
- }
- result += pt_string[i];
- }
- pt_string = result;
- return result_length;
-}
-#endif // PROPRIETARY_MODE
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
deleted file mode 100644
index 894469ac34..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnTBTClientStateNotification::OnTBTClientStateNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnTBTClientStateNotification::~OnTBTClientStateNotification() {}
-
-void OnTBTClientStateNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- (*message_)[strings::params][strings::message_type] =
- static_cast<int32_t>(application_manager::MessageType::kNotification);
-
- const std::vector<ApplicationSharedPtr>& applications =
- application_manager_.applications_with_navi();
-
- std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
- if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotification();
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
deleted file mode 100644
index c769194c95..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_touch_event_notification.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace mobile {
-
-OnTouchEventNotification::OnTouchEventNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnTouchEventNotification::~OnTouchEventNotification() {}
-
-void OnTouchEventNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const std::vector<ApplicationSharedPtr>& applications =
- application_manager_.applications_with_navi();
-
- std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
- if (app->IsFullscreen()) {
- (*message_)[strings::params][strings::connection_key] = app->app_id();
- SendNotification();
- }
- }
-}
-
-} // namespace mobile
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
deleted file mode 100644
index 37abbab351..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-OnVehicleDataNotification::OnVehicleDataNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnVehicleDataNotification::~OnVehicleDataNotification() {}
-
-void OnVehicleDataNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::vector<ApplicationSharedPtr> appNotification;
- std::vector<ApplicationSharedPtr>::iterator appNotification_it =
- appNotification.begin();
- std::vector<smart_objects::SmartObject> appSO;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
- const std::vector<ApplicationSharedPtr>& applications =
- application_manager_.IviInfoUpdated(
- it->second, (*message_)[strings::msg_params][it->first].asInt());
-
- std::vector<ApplicationSharedPtr>::const_iterator app_it =
- applications.begin();
-
- for (; applications.end() != app_it; ++app_it) {
- const ApplicationSharedPtr app = *app_it;
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- continue;
- }
-
- appNotification_it =
- find(appNotification.begin(), appNotification.end(), app);
- if (appNotification_it == appNotification.end()) {
- appNotification.push_back(app);
- smart_objects::SmartObject msg_param =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_param[it->first] = (*message_)[strings::msg_params][it->first];
- appSO.push_back(msg_param);
- } else {
- size_t idx =
- std::distance(appNotification.begin(), appNotification_it);
- appSO[idx][it->first] = (*message_)[strings::msg_params][it->first];
- }
- }
- }
- }
-
- LOG4CXX_DEBUG(
- logger_,
- "Number of Notifications to be send: " << appNotification.size());
-
- for (size_t idx = 0; idx < appNotification.size(); idx++) {
- LOG4CXX_INFO(logger_,
- "Send OnVehicleData PRNDL notification to "
- << appNotification[idx]->name().c_str()
- << " application id " << appNotification[idx]->app_id());
- (*message_)[strings::params][strings::connection_key] =
- appNotification[idx]->app_id();
- (*message_)[strings::msg_params] = appSO[idx];
- SendNotification();
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc
deleted file mode 100644
index 0b24228810..0000000000
--- a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-namespace commands {
-
-OnWayPointChangeNotification::OnWayPointChangeNotification(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandNotificationImpl(message, application_manager) {}
-
-OnWayPointChangeNotification::~OnWayPointChangeNotification() {}
-
-void OnWayPointChangeNotification::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- std::set<int32_t> subscribed_for_way_points =
- application_manager_.GetAppsSubscribedForWayPoints();
-
- for (std::set<int32_t>::const_iterator app_id =
- subscribed_for_way_points.begin();
- app_id != subscribed_for_way_points.end();
- ++app_id) {
- (*message_)[strings::params][strings::connection_key] = *app_id;
- SendNotification();
- }
-}
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
deleted file mode 100644
index 9f5fd937f9..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-PerformAudioPassThruRequest::PerformAudioPassThruRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , 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);
-}
-
-PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {}
-
-void PerformAudioPassThruRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- FinishTTSSpeak();
- CommandRequestImpl::onTimeOut();
-}
-
-bool PerformAudioPassThruRequest::Init() {
- default_timeout_ +=
- (((*message_)[str::msg_params][str::max_duration].asUInt()));
- return true;
-}
-
-void PerformAudioPassThruRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
- LOG4CXX_ERROR(logger_, "application isn't activated");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming perform audio pass thru has contains "
- "\\t\\n \\\\t \\\\n"
- " text contains only whitespace in initialPrompt");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- // According with new implementation processing of UNSUPPORTE_RESOURCE
- // need set flag before sending to hmi
-
- 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
- SendSpeakRequest();
- SendPerformAudioPassThruRequest();
- } else {
- SendPerformAudioPassThruRequest();
- SendRecordStartNotification();
- StartMicrophoneRecording();
- }
-}
-
-void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
- LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
- awaiting_ui_response_ = false;
-
- result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, ui_info_);
-
- // in case perform audio is started by other request skip stopping
- if (hmi_apis::Common_Result::REJECTED == result_ui_) {
- LOG4CXX_ERROR(logger_, "Request was rejected");
- SendResponse(false,
- MessageHelper::HMIToMobileResult(result_ui_),
- NULL,
- &(message[strings::msg_params]));
- return;
- }
- FinishTTSSpeak();
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
- result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, tts_info_);
- 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();
-
- // update request timeout to get time for perform audio recording
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
- if (IsWaitingHMIResponse()) {
- return;
- }
-
- 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() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- using namespace hmi_apis;
- using namespace smart_objects;
-
- SmartObject msg_params = smart_objects::SmartObject(SmartType_Map);
- for (uint32_t i = 0;
- i < (*message_)[str::msg_params][str::initial_prompt].length();
- ++i) {
- msg_params[hmi_request::tts_chunks][i][str::text] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::text];
- msg_params[hmi_request::tts_chunks][i][str::type] =
- (*message_)[str::msg_params][str::initial_prompt][i][str::type];
- }
- // app_id
- msg_params[strings::app_id] = connection_key();
- msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
- awaiting_tts_speak_response_ = true;
- SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
-}
-
-void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[str::app_id] = connection_key();
-
- msg_params[hmi_request::max_duration] =
- (*message_)[str::msg_params][str::max_duration];
-
- msg_params[hmi_request::audio_pass_display_texts] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) {
- msg_params[hmi_request::audio_pass_display_texts][0]
- [hmi_request::field_name] = static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
- msg_params[hmi_request::audio_pass_display_texts][0]
- [hmi_request::field_text] =
- (*message_)[str::msg_params][str::audio_pass_display_text1];
- }
-
- if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) {
- msg_params[hmi_request::audio_pass_display_texts][1]
- [hmi_request::field_name] = static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
- msg_params[hmi_request::audio_pass_display_texts][1]
- [hmi_request::field_text] =
- (*message_)[str::msg_params][str::audio_pass_display_text2];
- }
-
- if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
- msg_params[str::mute_audio] =
- (*message_)[str::msg_params][str::mute_audio].asBool();
- } else {
- // If omitted, the value is set to true
- msg_params[str::mute_audio] = true;
- }
-
- SendHMIRequest(
- hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
-}
-
-void PerformAudioPassThruRequest::SendRecordStartNotification() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = connection_key();
-
- CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params);
-}
-
-void PerformAudioPassThruRequest::StartMicrophoneRecording() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.BeginAudioPassThrough();
-
- application_manager_.StartAudioPassThruThread(
- connection_key(),
- correlation_id(),
- (*message_)[str::msg_params][str::max_duration].asInt(),
- (*message_)[str::msg_params][str::sampling_rate].asInt(),
- (*message_)[str::msg_params][str::bits_per_sample].asInt(),
- (*message_)[str::msg_params][str::audio_type].asInt());
-}
-
-bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- const smart_objects::SmartArray* ip_array =
- (*message_)[strings::msg_params][strings::initial_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
- smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
-
- for (; it_ip != it_ip_end; ++it_ip) {
- str = (*it_ip)[strings::text].asCharArray();
- if (std::strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::audio_pass_display_text1)) {
- str = (*message_)[strings::msg_params][strings::audio_pass_display_text1]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid audio_pass_display_text1 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::audio_pass_display_text2)) {
- str = (*message_)[strings::msg_params][strings::audio_pass_display_text2]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid audio_pass_display_text2 value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-void PerformAudioPassThruRequest::FinishTTSSpeak() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (application_manager_.EndAudioPassThrough()) {
- LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
- application_manager_.StopAudioPassThru(connection_key());
- }
- if (!awaiting_tts_speak_response_) {
- LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
- return;
- }
- SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
-}
-
-bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
- LOG4CXX_AUTO_TRACE(logger_);
- return awaiting_tts_speak_response_ || awaiting_ui_response_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
deleted file mode 100644
index e8a638c076..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PerformAudioPassThruResponse::PerformAudioPassThruResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {}
-
-void PerformAudioPassThruResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
deleted file mode 100644
index 007440e8e6..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.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 <string.h>
-#include <string>
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-#include "utils/gen_hash.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-uint32_t PerformInteractionRequest::pi_requests_count_ = 0;
-
-PerformInteractionRequest::PerformInteractionRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM)
- , ui_response_received_(false)
- , vr_response_received_(false)
- , app_pi_was_active_before_(false)
- , vr_result_code_(hmi_apis::Common_Result::INVALID_ENUM)
- , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
- subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
- subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
-}
-
-PerformInteractionRequest::~PerformInteractionRequest() {}
-
-bool PerformInteractionRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- }
-
- interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_ ||
- mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) {
- default_timeout_ *= 2;
- }
- return true;
-}
-
-void PerformInteractionRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->is_perform_interaction_active()) {
- LOG4CXX_DEBUG(logger_, "Application has active PerformInteraction");
- app_pi_was_active_before_ = true;
- }
-
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- mobile_apis::LayoutMode::eType interaction_layout =
- mobile_apis::LayoutMode::INVALID_ENUM;
-
- if (msg_params.keyExists(hmi_request::interaction_layout)) {
- interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
- msg_params[hmi_request::interaction_layout].asInt());
- }
-
- if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) &&
- (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
- LOG4CXX_ERROR(logger_,
- "PerformInteraction contains InteractionMode"
- "=VR_ONLY and interactionLayout=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- const size_t choice_set_id_list_length =
- msg_params[strings::interaction_choice_set_id_list].length();
-
- if (0 == choice_set_id_list_length) {
- if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) {
- if (mobile_apis::InteractionMode::BOTH == interaction_mode_) {
- LOG4CXX_ERROR(logger_,
- "interactionChoiceSetIDList is empty,"
- " InteractionMode=BOTH and"
- " interactionLayout=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- } else {
- LOG4CXX_ERROR(logger_,
- "interactionChoiceSetIDList is empty"
- " and interactionLayout!=KEYBOARD");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (choice_set_id_list_length &&
- (!CheckChoiceIDFromRequest(
- app,
- choice_set_id_list_length,
- msg_params[strings::interaction_choice_set_id_list]))) {
- LOG4CXX_ERROR(logger_,
- "PerformInteraction has choice sets with "
- "duplicated IDs or application does not have choice sets");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return;
- }
-
- if (msg_params.keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImageVrHelpItems(
- msg_params[strings::vr_help], app, application_manager_)) {
- LOG4CXX_ERROR(logger_,
- "Verification of " << strings::vr_help << " failed.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming perform interaction has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- switch (interaction_mode_) {
- case mobile_apis::InteractionMode::BOTH: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
- !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- case mobile_apis::InteractionMode::MANUAL_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
- !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- case mobile_apis::InteractionMode::VR_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app)) {
- return;
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Unknown interaction mode");
- return;
- }
- }
-
- app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
- app->set_perform_interaction_active(true);
- app->set_perform_interaction_layout(interaction_layout);
- // increment amount of active requests
- ++pi_requests_count_;
- SendVRPerformInteractionRequest(app);
- SendUIPerformInteractionRequest(app);
-}
-
-void PerformInteractionRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
- smart_objects::SmartObject msg_param =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_PerformInteraction: {
- LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
- ui_response_received_ = true;
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, ui_info_);
- ProcessUIResponse(event.smart_object(), msg_param);
- break;
- }
- case hmi_apis::FunctionID::VR_PerformInteraction: {
- LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
- vr_response_received_ = true;
- unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
- vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt());
- GetInfo(message, vr_info_);
- if (ProcessVRResponse(event.smart_object(), msg_param)) {
- return;
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-
- if (!HasHMIResponsesToWait()) {
- LOG4CXX_DEBUG(logger_, "Send response in BOTH iteraction mode");
- SendBothModeResponse(msg_param);
- }
-}
-
-void PerformInteractionRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- switch (interaction_mode_) {
- case mobile_apis::InteractionMode::BOTH: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
- if (true == vr_response_received_) {
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- } else {
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- }
- break;
- }
- case mobile_apis::InteractionMode::VR_ONLY: {
- LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- break;
- }
- case mobile_apis::InteractionMode::MANUAL_ONLY: {
- LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY");
- unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
- DisablePerformInteraction();
- CommandRequestImpl::onTimeOut();
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "INVALID ENUM");
- return;
- }
- };
-}
-
-bool PerformInteractionRequest::ProcessVRResponse(
- const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- using namespace mobile_apis;
- using namespace smart_objects;
- using namespace helpers;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return false;
- }
-
- msg_params[strings::trigger_source] =
- static_cast<int32_t>(TriggerSource::TS_VR);
-
- const bool is_vr_aborted_timeout = Compare<Common_Result::eType, EQ, ONE>(
- vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT);
-
- if (is_vr_aborted_timeout) {
- LOG4CXX_DEBUG(logger_, "VR response aborted");
- if (InteractionMode::VR_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup");
- TerminatePerformInteraction();
- SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_));
- return true;
- }
- LOG4CXX_DEBUG(logger_, "Update timeout for UI");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- return false;
- }
-
- if (Common_Result::SUCCESS == vr_result_code_ &&
- InteractionMode::MANUAL_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_,
- "VR response SUCCESS in MANUAL_ONLY mode "
- << "Wait for UI response");
- // in case MANUAL_ONLY mode VR.PI SUCCESS just return
- return false;
- }
-
- const SmartObject& hmi_msg_params = message[strings::msg_params];
- if (hmi_msg_params.keyExists(strings::choice_id)) {
- const int choise_id = hmi_msg_params[strings::choice_id].asInt();
- if (!CheckChoiceIDFromResponse(app, choise_id)) {
- LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
- TerminatePerformInteraction();
- SendResponse(
- false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
- return true;
- }
- msg_params[strings::choice_id] = choise_id;
- }
- return false;
-}
-
-void PerformInteractionRequest::ProcessUIResponse(
- const smart_objects::SmartObject& message,
- smart_objects::SmartObject& msg_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- using namespace smart_objects;
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- HmiInterfaces::InterfaceState ui_interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_UI);
- bool result = false;
- result = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS);
-
- result = result ||
- (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_code_ &&
- HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state);
-
- const bool is_pi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_, hmi_apis::Common_Result::WARNINGS);
-
- const bool is_pi_unsupported =
- Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
-
- if (result) {
- if (is_pi_warning) {
- ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
- ui_info_ = "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_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];
- }
- // result code must be GENERIC_ERROR in case wrong choice_id
- if (msg_params.keyExists(strings::choice_id)) {
- if (!CheckChoiceIDFromResponse(app,
- msg_params[strings::choice_id].asInt())) {
- ui_result_code_ = hmi_apis::Common_Result::GENERIC_ERROR;
- ui_info_ = "Wrong choiceID was received from HMI";
- } else {
- msg_params[strings::trigger_source] =
- mobile_apis::TriggerSource::TS_MENU;
- }
- } else if (msg_params.keyExists(strings::manual_text_entry)) {
- msg_params[strings::trigger_source] =
- mobile_apis::TriggerSource::TS_KEYBOARD;
- if (msg_params[strings::manual_text_entry].empty()) {
- msg_params.erase(strings::manual_text_entry);
- }
- }
- }
-}
-
-void PerformInteractionRequest::SendUIPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject& choice_set_id_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- mobile_apis::InteractionMode::eType mode =
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[hmi_request::initial_text][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::initialInteractionText);
- msg_params[hmi_request::initial_text][hmi_request::field_text] =
- (*message_)[strings::msg_params][hmi_request::initial_text];
- }
- bool is_vr_help_item = false;
- if (mobile_apis::InteractionMode::MANUAL_ONLY != mode) {
- msg_params[strings::vr_help_title] =
- (*message_)[strings::msg_params][strings::initial_text].asString();
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- is_vr_help_item = true;
- msg_params[strings::vr_help] =
- (*message_)[strings::msg_params][strings::vr_help];
- }
- }
-
- if (mobile_apis::InteractionMode::BOTH == mode ||
- mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
- msg_params[strings::timeout] = default_timeout_ / 2;
- } else {
- msg_params[strings::timeout] = default_timeout_;
- }
- msg_params[strings::app_id] = app->app_id();
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[strings::choice_set] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- }
- int32_t index_array_of_vr_help = 0;
- for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_set_id_list[i].asInt());
- if (choice_set) {
- // save perform interaction choice set
- app->AddPerformInteractionChoiceSet(
- correlation_id(), choice_set_id_list[i].asInt(), *choice_set);
- for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
- if (mobile_apis::InteractionMode::VR_ONLY != mode) {
- size_t index = msg_params[strings::choice_set].length();
- msg_params[strings::choice_set][index] =
- (*choice_set)[strings::choice_set][j];
- // vrCommands should be added via VR.AddCommand only
- msg_params[strings::choice_set][index].erase(strings::vr_commands);
- }
- if (mobile_apis::InteractionMode::MANUAL_ONLY != mode &&
- !is_vr_help_item) {
- smart_objects::SmartObject& vr_commands =
- (*choice_set)[strings::choice_set][j][strings::vr_commands];
- if (0 < vr_commands.length()) {
- // copy only first synonym
- smart_objects::SmartObject item(smart_objects::SmartType_Map);
- item[strings::text] = vr_commands[0].asString();
- item[strings::position] = index_array_of_vr_help + 1;
- msg_params[strings::vr_help][index_array_of_vr_help++] = item;
- }
- }
- }
- }
- }
- if ((*message_)[strings::msg_params].keyExists(
- hmi_request::interaction_layout) &&
- mobile_apis::InteractionMode::VR_ONLY != mode) {
- msg_params[hmi_request::interaction_layout] =
- (*message_)[strings::msg_params][hmi_request::interaction_layout]
- .asInt();
- }
- SendHMIRequest(
- hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true);
-}
-
-void PerformInteractionRequest::SendVRPerformInteractionRequest(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) {
- msg_params[strings::grammar_id] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t grammar_id_index = 0;
- for (uint32_t i = 0; i < choice_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
- if (!choice_set) {
- LOG4CXX_WARN(logger_, "Couldn't found choiset");
- continue;
- }
- msg_params[strings::grammar_id][grammar_id_index++] =
- (*choice_set)[strings::grammar_id].asUInt();
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
- msg_params[strings::help_prompt] =
- (*message_)[strings::msg_params][strings::help_prompt];
- } else {
- if (choice_list.length() != 0) {
- msg_params[strings::help_prompt] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- }
- int32_t index = 0;
- for (uint32_t i = 0; i < choice_list.length(); ++i) {
- smart_objects::SmartObject* choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- if (choice_set) {
- for (uint32_t j = 0; j < (*choice_set)[strings::choice_set].length();
- ++j) {
- smart_objects::SmartObject& vr_commands =
- (*choice_set)[strings::choice_set][j][strings::vr_commands];
- if (0 < vr_commands.length()) {
- // copy only first synonym
- smart_objects::SmartObject item(smart_objects::SmartType_Map);
- // Since there is no custom data from application side, SDL should
- // construct prompt and append delimiter to each item
- item[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
- item[strings::text] =
- vr_commands[0].asString() +
- application_manager_.get_settings().tts_delimiter();
- msg_params[strings::help_prompt][index++] = item;
- }
- }
- } else {
- LOG4CXX_ERROR(logger_, "Can't found choiceSet!");
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
- msg_params[strings::timeout_prompt] =
- (*message_)[strings::msg_params][strings::timeout_prompt];
- } else {
- if (msg_params.keyExists(strings::help_prompt)) {
- msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt];
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- msg_params[strings::initial_prompt] =
- (*message_)[strings::msg_params][strings::initial_prompt];
- }
-
- mobile_apis::InteractionMode::eType mode =
- static_cast<mobile_apis::InteractionMode::eType>(
- (*message_)[strings::msg_params][strings::interaction_mode].asInt());
-
- if (mobile_apis::InteractionMode::BOTH == mode ||
- mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
- msg_params[strings::timeout] = default_timeout_ / 2;
- } else {
- msg_params[strings::timeout] = default_timeout_;
- }
- msg_params[strings::app_id] = app->app_id();
- SendHMIRequest(
- hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true);
-}
-
-bool PerformInteractionRequest::CheckChoiceSetMenuNames(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- for (size_t i = 0; i < choice_list.length(); ++i) {
- // choice_set contains SmartObject msg_params
- smart_objects::SmartObject* i_choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- for (size_t j = 0; j < choice_list.length(); ++j) {
- smart_objects::SmartObject* j_choice_set =
- app->FindChoiceSet(choice_list[j].asInt());
-
- if (i == j) {
- // skip check the same element
- continue;
- }
-
- if (!i_choice_set || !j_choice_set) {
- LOG4CXX_ERROR(logger_, "Invalid ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return false;
- }
-
- size_t ii = 0;
- size_t jj = 0;
- for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
- for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
- const std::string& ii_menu_name =
- (*i_choice_set)[strings::choice_set][ii][strings::menu_name]
- .asString();
- const std::string& jj_menu_name =
- (*j_choice_set)[strings::choice_set][jj][strings::menu_name]
- .asString();
-
- if (ii_menu_name == jj_menu_name) {
- LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name");
- SendResponse(false,
- mobile_apis::Result::DUPLICATE_NAME,
- "Choice set has duplicated menu name");
- return false;
- }
- }
- }
- }
- }
-
- return true;
-}
-
-bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject& choice_list =
- (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
-
- for (size_t i = 0; i < choice_list.length(); ++i) {
- // choice_set contains SmartObject msg_params
- smart_objects::SmartObject* i_choice_set =
- app->FindChoiceSet(choice_list[i].asInt());
-
- for (size_t j = 0; j < choice_list.length(); ++j) {
- smart_objects::SmartObject* j_choice_set =
- app->FindChoiceSet(choice_list[j].asInt());
-
- if (i == j) {
- // skip check the same element
- continue;
- }
-
- if ((!i_choice_set) || (!j_choice_set)) {
- LOG4CXX_ERROR(logger_, "Invalid ID");
- SendResponse(false, mobile_apis::Result::INVALID_ID);
- return false;
- }
-
- size_t ii = 0;
- size_t jj = 0;
- for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
- for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
- // choice_set pointer contains SmartObject msg_params
- smart_objects::SmartObject& ii_vr_commands =
- (*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
-
- smart_objects::SmartObject& jj_vr_commands =
- (*j_choice_set)[strings::choice_set][jj][strings::vr_commands];
-
- for (size_t iii = 0; iii < ii_vr_commands.length(); ++iii) {
- for (size_t jjj = 0; jjj < jj_vr_commands.length(); ++jjj) {
- const custom_str::CustomString& vr_cmd_i =
- ii_vr_commands[iii].asCustomString();
- const custom_str::CustomString& vr_cmd_j =
- jj_vr_commands[jjj].asCustomString();
- if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) {
- LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym");
- SendResponse(false,
- mobile_apis::Result::DUPLICATE_NAME,
- "Choice set has duplicated VR synonym");
- return false;
- }
- }
- }
- }
- }
- }
- }
- return true;
-}
-
-bool PerformInteractionRequest::CheckVrHelpItemPositions(
- application_manager::ApplicationSharedPtr const app) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- LOG4CXX_DEBUG(logger_, strings::vr_help << " is omitted.");
- return true;
- }
-
- smart_objects::SmartObject& vr_help =
- (*message_)[strings::msg_params][strings::vr_help];
-
- int32_t position = 1;
- for (size_t i = 0; i < vr_help.length(); ++i) {
- if (position != vr_help[i][strings::position].asInt()) {
- LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Non-sequential vrHelp item position");
- return false;
- }
- ++position;
- }
- return true;
-}
-
-void PerformInteractionRequest::DisablePerformInteraction() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (app->is_perform_interaction_active()) {
- // decrease amount of active requests
- --pi_requests_count_;
- if (!pi_requests_count_) {
- app->set_perform_interaction_active(false);
- app->set_perform_interaction_mode(-1);
- }
- }
- app->DeletePerformInteractionChoiceSet(correlation_id());
-}
-
-bool PerformInteractionRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
- const smart_objects::SmartArray* ip_array =
- (*message_)[strings::msg_params][strings::initial_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
- smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
-
- for (; it_ip != it_ip_end; ++it_ip) {
- str = (*it_ip)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
- const smart_objects::SmartArray* hp_array =
- (*message_)[strings::msg_params][strings::help_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
- smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
-
- for (; it_hp != it_hp_end; ++it_hp) {
- str = (*it_hp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
- const smart_objects::SmartArray* tp_array =
- (*message_)[strings::msg_params][strings::timeout_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
- smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
-
- for (; it_tp != it_tp_end; ++it_tp) {
- str = (*it_tp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- const smart_objects::SmartArray* vh_array =
- (*message_)[strings::msg_params][strings::vr_help].asArray();
-
- smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
- smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
-
- for (; it_vh != it_vh_end; ++it_vh) {
- str = (*it_vh)[strings::text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed");
- return true;
- }
-
- if ((*it_vh).keyExists(strings::image)) {
- str = (*it_vh)[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid vr_help image value syntax check failed");
- return true;
- }
- }
- }
- }
- return false;
-}
-
-void PerformInteractionRequest::TerminatePerformInteraction() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[hmi_request::method_name] = "UI.PerformInteraction";
- SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params);
- DisablePerformInteraction();
-}
-
-bool PerformInteractionRequest::CheckChoiceIDFromResponse(
- ApplicationSharedPtr app, int32_t choice_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- const DataAccessor<PerformChoiceSetMap> accessor =
- app->performinteraction_choice_set_map();
- const PerformChoiceSetMap& choice_set_map = accessor.GetData();
-
- PerformChoiceSetMap::const_iterator choice_set_map_it =
- choice_set_map.find(correlation_id());
- if (choice_set_map.end() != choice_set_map_it) {
- const PerformChoice& choice = choice_set_map_it->second;
- PerformChoice::const_iterator it = choice.begin();
- for (; choice.end() != it; ++it) {
- const smart_objects::SmartObject& choice_set =
- (*it->second).getElement(strings::choice_set);
- for (size_t j = 0; j < choice_set.length(); ++j) {
- if (choice_id ==
- choice_set.getElement(j).getElement(strings::choice_id).asInt()) {
- return true;
- }
- }
- }
- }
- return false;
-}
-
-bool PerformInteractionRequest::CheckChoiceIDFromRequest(
- ApplicationSharedPtr app,
- const size_t choice_set_id_list_length,
- const smart_objects::SmartObject& choice_set_id_list) const {
- LOG4CXX_AUTO_TRACE(logger_);
-
- size_t choice_list_length = 0;
- std::set<uint32_t> choice_id_set;
- smart_objects::SmartObject* choice_set = 0;
- std::pair<std::set<uint32_t>::iterator, bool> ins_res;
-
- for (size_t i = 0; i < choice_set_id_list_length; ++i) {
- choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
- if (!choice_set) {
- LOG4CXX_ERROR(
- logger_,
- "Couldn't find choiset_id = " << choice_set_id_list[i].asInt());
- return false;
- }
- choice_list_length = (*choice_set)[strings::choice_set].length();
- const smart_objects::SmartObject& choices_list =
- (*choice_set)[strings::choice_set];
- for (size_t k = 0; k < choice_list_length; ++k) {
- ins_res =
- choice_id_set.insert(choices_list[k][strings::choice_id].asInt());
- if (!ins_res.second) {
- LOG4CXX_ERROR(logger_,
- "Choise with ID "
- << choices_list[k][strings::choice_id].asInt()
- << " already exists");
- return false;
- }
- }
- }
- return true;
-}
-
-const bool PerformInteractionRequest::HasHMIResponsesToWait() const {
- LOG4CXX_AUTO_TRACE(logger_);
- return !ui_response_received_ || !vr_response_received_;
-}
-
-void PerformInteractionRequest::SendBothModeResponse(
- const smart_objects::SmartObject& msg_param) {
- LOG4CXX_AUTO_TRACE(logger_);
- mobile_apis::Result::eType perform_interaction_result_code =
- mobile_apis::Result::INVALID_ENUM;
- ResponseInfo ui_perform_info(ui_result_code_,
- HmiInterfaces::HMI_INTERFACE_UI);
- 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;
- std::string info =
- MergeInfos(ui_perform_info, ui_info_, vr_perform_info, vr_info_);
- DisablePerformInteraction();
- SendResponse(result,
- perform_interaction_result_code,
- info.empty() ? NULL : info.c_str(),
- response_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
deleted file mode 100644
index 6003751669..0000000000
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/perform_interaction_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PerformInteractionResponse::PerformInteractionResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PerformInteractionResponse::~PerformInteractionResponse() {}
-
-void PerformInteractionResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc
deleted file mode 100644
index 68e7ad60d1..0000000000
--- a/src/components/application_manager/src/commands/mobile/put_file_request.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/put_file_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PutFileRequest::PutFileRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , offset_(0)
- , sync_file_name_()
- , length_(0)
- , file_type_(mobile_apis::FileType::INVALID_ENUM)
- , is_persistent_file_(false) {}
-
-PutFileRequest::~PutFileRequest() {}
-
-void PutFileRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
- application_manager_.get_settings().put_file_in_none() <=
- application->put_file_in_none_count()) {
- // If application is in the HMI_NONE level the quantity of allowed
- // PutFile request is limited by the configuration profile
- LOG4CXX_ERROR(logger_,
- "Too many requests from the app with HMILevel HMI_NONE ");
- SendResponse(false,
- mobile_apis::Result::REJECTED,
- "Too many requests from the app with HMILevel HMI_NONE",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::params].keyExists(strings::binary_data)) {
- LOG4CXX_ERROR(logger_, "Binary data empty");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Binary data empty",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) {
- LOG4CXX_ERROR(logger_, "No file name");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "No file name",
- &response_params);
- return;
- }
-
- if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) {
- LOG4CXX_ERROR(logger_, "No file type");
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "No file type",
- &response_params);
- return;
- }
- sync_file_name_ =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
- file_type_ = static_cast<mobile_apis::FileType::eType>(
- (*message_)[strings::msg_params][strings::file_type].asInt());
- const std::vector<uint8_t> binary_data =
- (*message_)[strings::params][strings::binary_data].asBinary();
-
- // Policy table update in json format is currently to be received via PutFile
- // TODO(PV): after latest discussion has to be changed
- if (mobile_apis::FileType::JSON == file_type_) {
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(
- sync_file_name_, binary_data);
- }
-
- offset_ = 0;
- is_persistent_file_ = false;
- bool is_system_file = false;
- length_ = binary_data.size();
- bool is_download_compleate = true;
- bool offset_exist =
- (*message_)[strings::msg_params].keyExists(strings::offset);
-
- if (offset_exist) {
- offset_ = (*message_)[strings::msg_params][strings::offset].asInt();
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::persistent_file)) {
- is_persistent_file_ =
- (*message_)[strings::msg_params][strings::persistent_file].asBool();
- }
- if ((*message_)[strings::msg_params].keyExists(strings::system_file)) {
- is_system_file =
- (*message_)[strings::msg_params][strings::system_file].asBool();
- }
-
- std::string file_path;
-
- if (is_system_file) {
- response_params[strings::space_available] = 0;
- file_path = application_manager_.get_settings().system_files_path();
- } else {
- file_path = application_manager_.get_settings().app_storage_folder();
- file_path += "/" + application->folder_name();
-
- uint32_t space_available = application->GetAvailableDiskSpace();
-
- if (binary_data.size() > space_available) {
- response_params[strings::space_available] =
- static_cast<uint32_t>(space_available);
-
- LOG4CXX_ERROR(logger_, "Out of memory");
- SendResponse(false,
- mobile_apis::Result::OUT_OF_MEMORY,
- "Out of memory",
- &response_params);
- return;
- }
- }
-
- if (!file_system::CreateDirectoryRecursively(file_path)) {
- LOG4CXX_ERROR(logger_, "Can't create folder");
- SendResponse(false,
- mobile_apis::Result::GENERIC_ERROR,
- "Can't create folder.",
- &response_params);
- return;
- }
- const std::string full_path = file_path + "/" + sync_file_name_;
- UNUSED(full_path);
- LOG4CXX_DEBUG(logger_,
- "Wrtiting " << binary_data.size() << "bytes to " << full_path
- << " (current size is"
- << file_system::FileSize(full_path) << ")");
-
- mobile_apis::Result::eType save_result = application_manager_.SaveBinary(
- binary_data, file_path, sync_file_name_, offset_);
-
- LOG4CXX_DEBUG(logger_,
- "New size of " << full_path << " is "
- << file_system::FileSize(full_path) << " bytes");
- if (!is_system_file) {
- response_params[strings::space_available] =
- static_cast<uint32_t>(application->GetAvailableDiskSpace());
- }
-
- sync_file_name_ = file_path + "/" + sync_file_name_;
- switch (save_result) {
- case mobile_apis::Result::SUCCESS: {
- LOG4CXX_INFO(logger_, "PutFile is successful");
- if (!is_system_file) {
- AppFile file(sync_file_name_,
- is_persistent_file_,
- is_download_compleate,
- file_type_);
-
- if (0 == offset_) {
- LOG4CXX_INFO(logger_, "New file downloading");
- if (!application->AddFile(file)) {
- LOG4CXX_INFO(logger_,
- "Couldn't add file to application (File already Exist"
- << " in application and was rewritten on FS)");
- /* It can be first part of new big file, so we need to update
- information about it's downloading status and persistence */
- if (!application->UpdateFile(file)) {
- LOG4CXX_ERROR(logger_, "Couldn't update file");
- /* If it is impossible to update file, application doesn't
- know about existing this file */
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "Couldn't update file",
- &response_params);
- return;
- }
- } else {
- /* if file added - increment it's count
- ( may be application->AddFile have to incapsulate it? )
- Any way now this method evals not only in "none"*/
- application->increment_put_file_in_none_count();
- }
- }
- }
-
- SendResponse(true, save_result, "File was downloaded", &response_params);
- if (is_system_file) {
- SendOnPutFileNotification();
- }
- break;
- }
- default:
- LOG4CXX_WARN(logger_,
- "PutFile is unsuccessful. Result = " << save_result);
- SendResponse(false, save_result, "Can't save file", &response_params);
- break;
- }
-}
-
-void PutFileRequest::SendOnPutFileNotification() {
- LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
- smart_objects::SmartObjectSPtr notification =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& message = *notification;
- message[strings::params][strings::function_id] =
- hmi_apis::FunctionID::BasicCommunication_OnPutFile;
-
- message[strings::params][strings::message_type] = MessageType::kNotification;
- message[strings::msg_params][strings::app_id] = connection_key();
- message[strings::msg_params][strings::sync_file_name] = sync_file_name_;
- message[strings::msg_params][strings::offset] = offset_;
- if (0 == offset_) {
- message[strings::msg_params][strings::file_size] =
- (*message_)[strings::msg_params][strings::length];
- }
- message[strings::msg_params][strings::length] = length_;
- message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
- message[strings::msg_params][strings::file_type] = file_type_;
- application_manager_.ManageHMICommand(notification);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_response.cc b/src/components/application_manager/src/commands/mobile/put_file_response.cc
deleted file mode 100644
index 50c62aef7f..0000000000
--- a/src/components/application_manager/src/commands/mobile/put_file_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/put_file_response.h"
-#include "utils/file_system.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-PutFileResponse::PutFileResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-PutFileResponse::~PutFileResponse() {}
-
-void PutFileResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc
deleted file mode 100644
index 0bf747bde3..0000000000
--- a/src/components/application_manager/src/commands/mobile/read_did_request.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/read_did_request.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ReadDIDRequest::ReadDIDRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ReadDIDRequest::~ReadDIDRequest() {}
-
-void ReadDIDRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
-
- ApplicationSharedPtr app = application_manager_.application(app_id);
- LOG4CXX_INFO(
- logger_,
- "Correlation_id :"
- << (*message_)[strings::params][strings::correlation_id].asUInt());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "An application is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (app->AreCommandLimitsExceeded(
- static_cast<mobile_apis::FunctionID::eType>(function_id()),
- application_manager::TLimitSource::CONFIG_FILE)) {
- LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if ((*message_)[strings::msg_params][strings::did_location].empty()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::ecu_name] =
- (*message_)[strings::msg_params][strings::ecu_name];
- msg_params[strings::did_location] =
- (*message_)[strings::msg_params][strings::did_location];
-
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
-}
-
-void ReadDIDRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_response.cc b/src/components/application_manager/src/commands/mobile/read_did_response.cc
deleted file mode 100644
index e54c4ba005..0000000000
--- a/src/components/application_manager/src/commands/mobile/read_did_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/read_did_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ReadDIDResponse::ReadDIDResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ReadDIDResponse::~ReadDIDResponse() {}
-
-void ReadDIDResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
deleted file mode 100644
index 035a1666f6..0000000000
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
+++ /dev/null
@@ -1,1154 +0,0 @@
-/*
-
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/register_app_interface_request.h"
-
-#include <unistd.h>
-#include <algorithm>
-#include <map>
-#include <string.h>
-
-#include <utils/make_shared.h>
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/app_launch/app_launch_ctrl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/resumption/resume_ctrl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/generated_msg_version.h"
-
-namespace {
-namespace custom_str = utils::custom_string;
-
-mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
- if ("DEFAULT" == str) {
- return mobile_apis::AppHMIType::DEFAULT;
- } else if ("COMMUNICATION" == str) {
- return mobile_apis::AppHMIType::COMMUNICATION;
- } else if ("MEDIA" == str) {
- return mobile_apis::AppHMIType::MEDIA;
- } else if ("MESSAGING" == str) {
- return mobile_apis::AppHMIType::MESSAGING;
- } else if ("NAVIGATION" == str) {
- return mobile_apis::AppHMIType::NAVIGATION;
- } else if ("INFORMATION" == str) {
- return mobile_apis::AppHMIType::INFORMATION;
- } else if ("SOCIAL" == str) {
- return mobile_apis::AppHMIType::SOCIAL;
- } else if ("BACKGROUND_PROCESS" == str) {
- return mobile_apis::AppHMIType::BACKGROUND_PROCESS;
- } else if ("TESTING" == str) {
- return mobile_apis::AppHMIType::TESTING;
- } else if ("SYSTEM" == str) {
- return mobile_apis::AppHMIType::SYSTEM;
- } else {
- return mobile_apis::AppHMIType::INVALID_ENUM;
- }
-}
-
-std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
- const std::map<mobile_apis::AppHMIType::eType, std::string> app_hmi_type_map =
- {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"},
- {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"},
- {mobile_apis::AppHMIType::MEDIA, "MEDIA"},
- {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"},
- {mobile_apis::AppHMIType::NAVIGATION, "NAVIGATION"},
- {mobile_apis::AppHMIType::INFORMATION, "INFORMATION"},
- {mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
- {mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
- {mobile_apis::AppHMIType::TESTING, "TESTING"},
- {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"}};
-
- std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
- app_hmi_type_map.find(type);
-
- return app_hmi_type_map.end() != iter ? iter->second : std::string("");
-}
-
-struct AppHMITypeInserter {
- AppHMITypeInserter(smart_objects::SmartObject& so_array)
- : index_(0), so_array_(so_array) {}
-
- bool operator()(const std::string& app_hmi_type) {
- so_array_[index_] = StringToAppHMIType(app_hmi_type);
- ++index_;
- return true;
- }
-
- private:
- uint32_t index_;
- smart_objects::SmartObject& so_array_;
-};
-
-struct CheckMissedTypes {
- CheckMissedTypes(const policy::StringArray& policy_app_types,
- std::string& log)
- : policy_app_types_(policy_app_types), log_(log) {}
-
- bool operator()(const smart_objects::SmartArray::value_type& value) {
- std::string app_type_str = AppHMITypeToString(
- static_cast<mobile_apis::AppHMIType::eType>(value.asInt()));
- if (!app_type_str.empty()) {
- policy::StringArray::const_iterator it = policy_app_types_.begin();
- policy::StringArray::const_iterator it_end = policy_app_types_.end();
- for (; it != it_end; ++it) {
- if (app_type_str == *it) {
- return true;
- }
- }
- }
-
- log_ += app_type_str;
- log_ += ",";
-
- return true;
- }
-
- private:
- const policy::StringArray& policy_app_types_;
- std::string& log_;
-};
-
-struct IsSameNickname {
- IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
- bool operator()(const policy::StringArray::value_type& nickname) const {
- return app_id_.CompareIgnoreCase(nickname.c_str());
- }
-
- private:
- const custom_str::CustomString& app_id_;
-};
-}
-
-namespace application_manager {
-
-namespace commands {
-
-RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , result_checking_app_hmi_type_(mobile_apis::Result::INVALID_ENUM) {}
-
-RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
-
-bool RegisterAppInterfaceRequest::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
- return true;
-}
-
-void RegisterAppInterfaceRequest::Run() {
- using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Connection key is " << connection_key());
-
- // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
- // Flag conditional compilation specific to customer is used in order to
- // exclude hit code
- // to RTC
- // FIXME(EZamakhov): on shutdown - get freez
-
- // wait till HMI started
- while (!application_manager_.IsStopping() &&
- !application_manager_.IsHMICooperating()) {
- LOG4CXX_DEBUG(logger_,
- "Waiting for the HMI... conn_key="
- << connection_key()
- << ", correlation_id=" << correlation_id()
- << ", default_timeout=" << default_timeout()
- << ", thread=" << pthread_self());
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- sleep(1);
- // TODO(DK): timer_->StartWait(1);
- }
-
- if (application_manager_.IsStopping()) {
- LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!");
- return;
- }
-
- const std::string mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asString();
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (application) {
- SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
- return;
- }
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const std::string& policy_app_id = msg_params[strings::app_id].asString();
-
- if (application_manager_.IsApplicationForbidden(connection_key(),
- policy_app_id)) {
- SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS);
- return;
- }
-
- if (IsApplicationWithSameAppIdRegistered()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- mobile_apis::Result::eType policy_result = CheckWithPolicyData();
-
- if (Compare<mobile_apis::Result::eType, NEQ, ALL>(
- policy_result,
- mobile_apis::Result::SUCCESS,
- mobile_apis::Result::WARNINGS)) {
- SendResponse(false, policy_result);
- return;
- }
-
- mobile_apis::Result::eType coincidence_result = CheckCoincidence();
-
- if (mobile_apis::Result::SUCCESS != coincidence_result) {
- LOG4CXX_ERROR(logger_, "Coincidence check failed.");
- if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
- usage_statistics::AppCounter count_of_rejections_duplicate_name(
- GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_DUPLICATE_NAME);
- ++count_of_rejections_duplicate_name;
- }
- SendResponse(false, coincidence_result);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_INFO(logger_,
- "Incoming register app interface has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- application = application_manager_.RegisterApplication(message_);
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application hasn't been registered!");
- return;
- }
- // For resuming application need to restore hmi_app_id from resumeCtrl
- resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
- const std::string& device_mac = application->mac_address();
-
- // there is side affect with 2 mobile app with the same mobile app_id
- if (resumer.IsApplicationSaved(policy_app_id, device_mac)) {
- application->set_hmi_application_id(
- resumer.GetHMIApplicationID(policy_app_id, device_mac));
- } else {
- application->set_hmi_application_id(
- application_manager_.GenerateNewHMIAppID());
- }
-
- application->set_is_media_application(
- msg_params[strings::is_media_application].asBool());
-
- if (msg_params.keyExists(strings::vr_synonyms)) {
- application->set_vr_synonyms(msg_params[strings::vr_synonyms]);
- }
-
- if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
- application->set_ngn_media_screen_name(
- msg_params[strings::ngn_media_screen_app_name]);
- }
-
- if (msg_params.keyExists(strings::tts_name)) {
- application->set_tts_name(msg_params[strings::tts_name]);
- }
-
- if (msg_params.keyExists(strings::app_hmi_type)) {
- application->set_app_types(msg_params[strings::app_hmi_type]);
-
- // check app type
- const smart_objects::SmartObject& app_type =
- msg_params.getElement(strings::app_hmi_type);
-
- for (size_t i = 0; i < app_type.length(); ++i) {
- if (mobile_apis::AppHMIType::NAVIGATION ==
- static_cast<mobile_apis::AppHMIType::eType>(
- app_type.getElement(i).asUInt())) {
- application->set_is_navi(true);
- }
- if (mobile_apis::AppHMIType::COMMUNICATION ==
- static_cast<mobile_apis::AppHMIType::eType>(
- app_type.getElement(i).asUInt())) {
- application->set_voice_communication_supported(true);
- }
- }
- }
-
- // Add device to policy table and set device info, if any
- policy::DeviceParams dev_params;
- if (-1 ==
- application_manager_.connection_handler()
- .get_session_observer()
- .GetDataOnDeviceID(application->device(),
- &dev_params.device_name,
- NULL,
- &dev_params.device_mac_address,
- &dev_params.device_connection_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device "
- << application->device());
- }
- policy::DeviceInfo device_info;
- device_info.AdoptDeviceType(dev_params.device_connection_type);
- if (msg_params.keyExists(strings::device_info)) {
- FillDeviceInfo(&device_info);
- }
-
- GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
-
- SendRegisterAppInterfaceResponseToMobile();
- smart_objects::SmartObjectSPtr so =
- GetLockScreenIconUrlNotification(connection_key(), application);
- application_manager_.ManageMobileCommand(so, commands::Command::ORIGIN_SDL);
-}
-
-smart_objects::SmartObjectSPtr
-RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
- const uint32_t connection_key, ApplicationSharedPtr app) {
- DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr());
- smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
- (*message)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::OnSystemRequestID;
- (*message)[strings::params][strings::connection_key] = connection_key;
- (*message)[strings::params][strings::message_type] =
- mobile_apis::messageType::notification;
- (*message)[strings::params][strings::protocol_type] =
- commands::CommandImpl::mobile_protocol_type_;
- (*message)[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- (*message)[strings::msg_params][strings::request_type] =
- mobile_apis::RequestType::LOCK_SCREEN_ICON_URL;
- (*message)[strings::msg_params][strings::url] =
- GetPolicyHandler().GetLockScreenIconUrl();
- return message;
-}
-
-void FillVRRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::language] = hmi_capabilities.active_vr_language();
- if (hmi_capabilities.vr_capabilities()) {
- response_params[strings::vr_capabilities] =
- *hmi_capabilities.vr_capabilities();
- }
-}
-
-void FillVIRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- if (hmi_capabilities.vehicle_type()) {
- response_params[hmi_response::vehicle_type] =
- *hmi_capabilities.vehicle_type();
- }
-}
-
-void FillTTSRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::language] = hmi_capabilities.active_tts_language();
- if (hmi_capabilities.speech_capabilities()) {
- response_params[strings::speech_capabilities] =
- *hmi_capabilities.speech_capabilities();
- }
- if (hmi_capabilities.prerecorded_speech()) {
- response_params[strings::prerecorded_speech] =
- *(hmi_capabilities.prerecorded_speech());
- }
-}
-
-void FillUIRelatedFields(smart_objects::SmartObject& response_params,
- const HMICapabilities& hmi_capabilities) {
- response_params[strings::hmi_display_language] =
- hmi_capabilities.active_ui_language();
- if (hmi_capabilities.display_capabilities()) {
- response_params[hmi_response::display_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject& display_caps =
- response_params[hmi_response::display_capabilities];
-
- display_caps[hmi_response::display_type] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::display_type);
-
- display_caps[hmi_response::text_fields] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::text_fields);
-
- display_caps[hmi_response::image_fields] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::image_fields);
-
- display_caps[hmi_response::media_clock_formats] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::media_clock_formats);
-
- display_caps[hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
-
- display_caps[hmi_response::screen_params] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::screen_params);
-
- display_caps[hmi_response::num_custom_presets_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::num_custom_presets_available);
-
- display_caps[hmi_response::graphic_supported] =
- (hmi_capabilities.display_capabilities()
- ->getElement(hmi_response::image_capabilities)
- .length() > 0);
-
- display_caps[hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
-
- display_caps[hmi_response::screen_params] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::screen_params);
-
- display_caps[hmi_response::num_custom_presets_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::num_custom_presets_available);
- }
-
- if (hmi_capabilities.audio_pass_thru_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.audio_pass_thru_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[strings::audio_pass_thru_capabilities] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- } else {
- response_params[strings::audio_pass_thru_capabilities][0] =
- *hmi_capabilities.audio_pass_thru_capabilities();
- }
- }
- response_params[strings::hmi_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- response_params[strings::hmi_capabilities][strings::navigation] =
- hmi_capabilities.navigation_supported();
- response_params[strings::hmi_capabilities][strings::phone_call] =
- hmi_capabilities.phone_call_supported();
-}
-
-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();
- }
- if (hmi_capabilities.soft_button_capabilities()) {
- response_params[hmi_response::soft_button_capabilities] =
- *hmi_capabilities.soft_button_capabilities();
- }
- if (hmi_capabilities.preset_bank_capabilities()) {
- response_params[hmi_response::preset_bank_capabilities] =
- *hmi_capabilities.preset_bank_capabilities();
- }
- if (hmi_capabilities.hmi_zone_capabilities()) {
- if (smart_objects::SmartType_Array ==
- hmi_capabilities.hmi_zone_capabilities()->getType()) {
- // hmi_capabilities json contains array and HMI response object
- response_params[hmi_response::hmi_zone_capabilities] =
- *hmi_capabilities.hmi_zone_capabilities();
- } else {
- response_params[hmi_response::hmi_zone_capabilities][0] =
- *hmi_capabilities.hmi_zone_capabilities();
- }
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_TTS)) {
- FillTTSRelatedFields(response_params, hmi_capabilities);
- }
-
- if (hmi_capabilities.pcm_stream_capabilities()) {
- response_params[strings::pcm_stream_capabilities] =
- *hmi_capabilities.pcm_stream_capabilities();
- }
-
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
- FillVIRelatedFields(response_params, hmi_capabilities);
- }
-
- const std::vector<uint32_t>& diag_modes =
- application_manager_.get_settings().supported_diag_modes();
- if (!diag_modes.empty()) {
- std::vector<uint32_t>::const_iterator it = diag_modes.begin();
- uint32_t index = 0;
- for (; it != diag_modes.end(); ++it) {
- response_params[strings::supported_diag_modes][index] = *it;
- ++index;
- }
- }
- response_params[strings::sdl_version] =
- application_manager_.get_settings().sdl_version();
- const std::string ccpu_version =
- application_manager_.hmi_capabilities().ccpu_version();
- if (!ccpu_version.empty()) {
- response_params[strings::system_software_version] = ccpu_version;
- }
-
- bool resumption =
- (*message_)[strings::msg_params].keyExists(strings::hash_id);
-
- bool need_restore_vr = resumption;
-
- std::string hash_id;
- std::string add_info;
- if (resumption) {
- hash_id = (*message_)[strings::msg_params][strings::hash_id].asString();
- if (!resumer.CheckApplicationHash(application, hash_id)) {
- LOG4CXX_WARN(logger_,
- "Hash from RAI does not match to saved resume data.");
- result_code = mobile_apis::Result::RESUME_FAILED;
- add_info = "Hash from RAI does not match to saved resume data.";
- need_restore_vr = false;
- } else if (!resumer.CheckPersistenceFilesForResumption(application)) {
- LOG4CXX_WARN(logger_, "Persistent data is missing.");
- result_code = mobile_apis::Result::RESUME_FAILED;
- add_info = "Persistent data is missing.";
- need_restore_vr = false;
- } else {
- add_info = "Resume succeeded.";
- }
- }
- if ((mobile_apis::Result::SUCCESS == result_code) &&
- (mobile_apis::Result::INVALID_ENUM != result_checking_app_hmi_type_)) {
- add_info += response_info_;
- result_code = result_checking_app_hmi_type_;
- }
-
- // in case application exist in resumption we need to send resumeVrgrammars
- if (false == resumption) {
- resumption = resumer.IsApplicationSaved(application->policy_app_id(),
- application->mac_address());
- }
-
- policy::StatusNotifier notify_upd_manager =
- GetPolicyHandler().AddApplication(application->policy_app_id());
- SendResponse(true, result_code, add_info.c_str(), &response_params);
- SendOnAppRegisteredNotificationToHMI(
- *(application.get()), resumption, need_restore_vr);
-
- // Default HMI level should be set before any permissions validation, since it
- // relies on HMI level.
- application_manager_.OnApplicationRegistered(application);
- (*notify_upd_manager)();
-
- // Start PTU after successfull registration
- // Sends OnPermissionChange notification to mobile right after RAI response
- // and HMI level set-up
- GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
-
- if (result_code != mobile_apis::Result::RESUME_FAILED) {
- resumer.StartResumption(application, hash_id);
- } else {
- resumer.StartResumptionOnlyHMILevel(application);
- }
-
- // By default app subscribed to CUSTOM_BUTTON
- SendSubscribeCustomButtonNotification();
- SendChangeRegistrationOnHMI(application);
-}
-
-void RegisterAppInterfaceRequest::SendChangeRegistration(
- const hmi_apis::FunctionID::eType function_id,
- const int32_t language,
- const uint32_t app_id) {
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ONE;
- const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- const HmiInterfaces::InterfaceID interface =
- hmi_interfaces.GetInterfaceFromFunction(function_id);
- if (hmi_interfaces.GetInterfaceState(interface) !=
- HmiInterfaces::STATE_NOT_AVAILABLE) {
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::language] = language;
- msg_params[strings::app_id] = app_id;
- SendHMIRequest(function_id, &msg_params);
- } else {
- LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable");
- }
-}
-
-void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI(
- ApplicationConstSharedPtr app) {
- using namespace hmi_apis::FunctionID;
- DCHECK_OR_RETURN_VOID(app);
- DCHECK_OR_RETURN_VOID(mobile_apis::Language::INVALID_ENUM != app->language());
- SendChangeRegistration(VR_ChangeRegistration, app->language(), app->app_id());
- SendChangeRegistration(
- TTS_ChangeRegistration, app->language(), app->app_id());
- SendChangeRegistration(UI_ChangeRegistration, app->language(), app->app_id());
-}
-
-void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
- const Application& application_impl,
- bool resumption,
- bool need_restore_vr) {
- using namespace smart_objects;
- SmartObjectSPtr notification = utils::MakeShared<SmartObject>(SmartType_Map);
- if (!notification) {
- LOG4CXX_ERROR(logger_, "Failed to create smart object");
- return;
- }
-
- (*notification)[strings::params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& params = (*notification)[strings::params];
- params[strings::function_id] = static_cast<int32_t>(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
- params[strings::message_type] = static_cast<int32_t>(kNotification);
- params[strings::protocol_version] = commands::CommandImpl::protocol_version_;
- params[strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_;
-
- (*notification)[strings::msg_params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& msg_params = (*notification)[strings::msg_params];
- // Due to current requirements in case when we're in resumption mode
- // we have to always send resumeVRGrammar field.
- if (resumption) {
- msg_params[strings::resume_vr_grammars] = need_restore_vr;
- }
-
- if (application_impl.vr_synonyms()) {
- msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms());
- }
-
- if (application_impl.tts_name()) {
- msg_params[strings::tts_name] = *(application_impl.tts_name());
- }
-
- std::string priority;
- GetPolicyHandler().GetPriority(application_impl.policy_app_id(), &priority);
-
- if (!priority.empty()) {
- msg_params[strings::priority] = MessageHelper::GetPriorityCode(priority);
- }
-
- msg_params[strings::msg_params] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& application = msg_params[strings::application];
- application[strings::app_name] = application_impl.name();
- application[strings::app_id] = application_impl.app_id();
- application[hmi_response::policy_app_id] = application_impl.policy_app_id();
- application[strings::icon] = application_impl.app_icon_path();
-
- const smart_objects::SmartObject* ngn_media_screen_name =
- application_impl.ngn_media_screen_name();
- if (ngn_media_screen_name) {
- application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name;
- }
-
- application[strings::hmi_display_language_desired] =
- static_cast<int32_t>(application_impl.ui_language());
-
- application[strings::is_media_application] =
- application_impl.is_media_application();
-
- const smart_objects::SmartObject* app_type = application_impl.app_types();
- if (app_type) {
- application[strings::app_type] = *app_type;
- }
-
- std::vector<std::string> request_types =
- GetPolicyHandler().GetAppRequestTypes(application_impl.policy_app_id());
-
- application[strings::request_type] = SmartObject(SmartType_Array);
- smart_objects::SmartObject& request_array =
- application[strings::request_type];
-
- uint32_t index = 0;
- std::vector<std::string>::const_iterator it = request_types.begin();
- for (; request_types.end() != it; ++it) {
- request_array[index] = *it;
- ++index;
- }
-
- application[strings::device_info] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& device_info = application[strings::device_info];
- const protocol_handler::SessionObserver& session_observer =
- application_manager_.connection_handler().get_session_observer();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- const connection_handler::DeviceHandle handle = application_impl.device();
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- handle, &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << handle);
- }
-
- device_info[strings::name] = device_name;
- device_info[strings::id] = mac_address;
-
- const policy::DeviceConsent device_consent =
- GetPolicyHandler().GetUserConsentForDevice(mac_address);
- device_info[strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
-
- device_info[strings::transport_type] =
- application_manager_.GetDeviceTransportType(transport_type);
-
- DCHECK(application_manager_.ManageHMICommand(notification));
-}
-
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSet accessor = application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = accessor.begin();
- const custom_str::CustomString& app_name =
- msg_params[strings::app_name].asCustomString();
-
- for (; accessor.end() != it; ++it) {
- // name check
- const custom_str::CustomString& cur_name = (*it)->name();
- if (app_name.CompareIgnoreCase(cur_name)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
-
- const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
- const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
- if (NULL != vr) {
- curr_vr = vr->asArray();
- CoincidencePredicateVR v(app_name);
-
- if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "Application name is known already.");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- }
-
- // vr check
- if (msg_params.keyExists(strings::vr_synonyms)) {
- const std::vector<smart_objects::SmartObject>* new_vr =
- msg_params[strings::vr_synonyms].asArray();
-
- CoincidencePredicateVR v(cur_name);
- if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
- LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
- return mobile_apis::Result::DUPLICATE_NAME;
- }
- } // end vr check
-
- } // application for end
-
- return mobile_apis::Result::SUCCESS;
-} // method end
-
-mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
- LOG4CXX_AUTO_TRACE(logger_);
- // TODO(AOleynik): Check is necessary to allow register application in case
- // of disabled policy
- // Remove this check, when HMI will support policy
- if (!GetPolicyHandler().PolicyEnabled()) {
- return mobile_apis::Result::WARNINGS;
- }
-
- smart_objects::SmartObject& message = *message_;
- policy::StringArray app_nicknames;
- policy::StringArray app_hmi_types;
-
- const std::string mobile_app_id =
- message[strings::msg_params][strings::app_id].asString();
- const bool init_result = GetPolicyHandler().GetInitialAppData(
- mobile_app_id, &app_nicknames, &app_hmi_types);
-
- if (!init_result) {
- LOG4CXX_ERROR(logger_, "Error during initial application data check.");
- return mobile_apis::Result::INVALID_DATA;
- }
-
- if (!app_nicknames.empty()) {
- IsSameNickname compare(
- message[strings::msg_params][strings::app_name].asCustomString());
- policy::StringArray::const_iterator it =
- std::find_if(app_nicknames.begin(), app_nicknames.end(), compare);
- if (app_nicknames.end() == it) {
- LOG4CXX_WARN(logger_,
- "Application name was not found in nicknames list.");
- // App should be unregistered, if its name is not present in nicknames
- // list
- usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
- GetPolicyHandler().GetStatisticManager(),
- mobile_app_id,
- usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
- ++count_of_rejections_nickname_mismatch;
- return mobile_apis::Result::DISALLOWED;
- }
- }
-
- mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
-
- // If AppHMIType is not included in policy - allow any type
- if (!app_hmi_types.empty()) {
- if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
- // If AppHMITypes are partially same, the system should allow those listed
- // in the policy table and send warning info on missed values
- smart_objects::SmartArray app_types =
- *(message[strings::msg_params][strings::app_hmi_type].asArray());
-
- std::string log;
- CheckMissedTypes checker(app_hmi_types, log);
- std::for_each(app_types.begin(), app_types.end(), checker);
- if (!log.empty()) {
- response_info_ =
- "Following AppHMITypes are not present in policy "
- "table:" +
- log;
- result_checking_app_hmi_type_ = mobile_apis::Result::WARNINGS;
- }
- }
- // Replace AppHMITypes in request with values allowed by policy table
- message[strings::msg_params][strings::app_hmi_type] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- smart_objects::SmartObject& app_hmi_type =
- message[strings::msg_params][strings::app_hmi_type];
-
- AppHMITypeInserter inserter(app_hmi_type);
- std::for_each(app_hmi_types.begin(), app_hmi_types.end(), inserter);
- }
-
- return result;
-}
-
-void RegisterAppInterfaceRequest::FillDeviceInfo(
- policy::DeviceInfo* device_info) {
- const std::string hardware = "hardware";
- const std::string firmware_rev = "firmwareRev";
- const std::string os = "os";
- const std::string os_ver = "osVersion";
- const std::string carrier = "carrier";
- const std::string max_number_rfcom_ports = "maxNumberRFCOMMPorts";
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const smart_objects::SmartObject& device_info_so =
- msg_params[strings::device_info];
-
- if (device_info_so.keyExists(hardware)) {
- device_info->hardware =
- msg_params[strings::device_info][hardware].asString();
- }
- if (device_info_so.keyExists(firmware_rev)) {
- device_info->firmware_rev =
- msg_params[strings::device_info][firmware_rev].asString();
- }
- if (device_info_so.keyExists(os)) {
- device_info->os = device_info_so[os].asString();
- }
- if (device_info_so.keyExists(os_ver)) {
- device_info->os_ver = device_info_so[os_ver].asString();
- }
- if (device_info_so.keyExists(carrier)) {
- device_info->carrier = device_info_so[carrier].asString();
- }
- if (device_info_so.keyExists(max_number_rfcom_ports)) {
- device_info->max_number_rfcom_ports =
- device_info_so[max_number_rfcom_ports].asInt();
- }
-}
-
-bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const custom_string::CustomString mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asCustomString();
-
- const ApplicationSet& applications =
- application_manager_.applications().GetData();
-
- ApplicationSetConstIt it = applications.begin();
- ApplicationSetConstIt it_end = applications.end();
-
- for (; it != it_end; ++it) {
- if (mobile_app_id.CompareIgnoreCase((*it)->policy_app_id().c_str())) {
- return true;
- }
- }
-
- return false;
-}
-
-bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
- const smart_objects::SmartArray* tn_array =
- (*message_)[strings::msg_params][strings::tts_name].asArray();
-
- smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
- smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
-
- for (; it_tn != it_tn_end; ++it_tn) {
- str = (*it_tn)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::ngn_media_screen_app_name)) {
- str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid ngn_media_screen_app_name syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
- const smart_objects::SmartArray* vs_array =
- (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
-
- smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
- smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
-
- for (; it_vs != it_vs_end; ++it_vs) {
- str = (*it_vs).asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
- str = (*message_)[strings::msg_params][strings::hash_id].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::hardware)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::hardware].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info hardware syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::firmware_rev)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::firmware_rev].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info firmware_rev syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::os)) {
- str = (*message_)[strings::msg_params][strings::device_info][strings::os]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid device_info os syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::os_version)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::os_version].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info os_version syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params][strings::device_info].keyExists(
- strings::carrier)) {
- str = (*message_)[strings::msg_params][strings::device_info]
- [strings::carrier].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid device_info carrier syntax check failed");
- return true;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
- str = (*message_)[strings::msg_params][strings::app_id].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
- return true;
- }
- }
-
- return false;
-}
-
-void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
- smart_objects::SmartObject& vehicle_type,
- const std::string& param,
- const std::string& backup_value) {
- using namespace hmi_response;
- if (!vehicle_type.keyExists(param) || vehicle_type[param].empty()) {
- if (!backup_value.empty()) {
- LOG4CXX_DEBUG(logger_,
- param << " is missing."
- "Will be replaced with policy table value.");
- vehicle_type[param] = backup_value;
- } else {
- vehicle_type.erase(param);
- }
- }
-}
-
-void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = Common_ButtonName::CUSTOM_BUTTON;
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-policy::PolicyHandlerInterface&
-RegisterAppInterfaceRequest::GetPolicyHandler() {
- return application_manager_.GetPolicyHandler();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
deleted file mode 100644
index 3e94e652d4..0000000000
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/register_app_interface_response.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "connection_handler/connection_handler.h"
-#include "application_manager/policies/policy_handler_interface.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void RegisterAppInterfaceResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS;
- bool success = (*message_)[strings::msg_params][strings::success].asBool();
- bool last_message = !success;
- // Do not close connection in case of APPLICATION_NOT_REGISTERED despite it is
- // an error
- if (!success &&
- (*message_)[strings::msg_params].keyExists(strings::result_code)) {
- result_code = static_cast<mobile_apis::Result::eType>(
- (*message_)[strings::msg_params][strings::result_code].asInt());
- if (result_code == mobile_apis::Result::APPLICATION_REGISTERED_ALREADY) {
- last_message = false;
- }
- }
-
- SendResponse(success, result_code, last_message);
-
- if (mobile_apis::Result::SUCCESS != result_code) {
- return;
- }
-
- // Add registered application to the policy db right after response sent to
- // mobile to be able to check all other API according to app permissions
- application_manager::ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_,
- "Application with connection key " << connection_key()
- << " is not registered.");
- return;
- }
-
- SetHeartBeatTimeout(connection_key(), application->policy_app_id());
-}
-
-void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
- uint32_t connection_key, const std::string& mobile_app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (policy_handler.PolicyEnabled()) {
- const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id);
- if (timeout > 0) {
- application_manager_.connection_handler().SetHeartBeatTimeout(
- connection_key, timeout);
- }
- } else {
- LOG4CXX_INFO(logger_, "Policy is turn off");
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
deleted file mode 100644
index ebc0e43838..0000000000
--- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/reset_global_properties_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_tts_send_(false)
- , is_ui_received_(false)
- , is_tts_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {}
-
-void ResetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- uint32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "No application associated with session key");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- size_t obj_length =
- (*message_)[strings::msg_params][strings::properties].length();
- // if application waits for sending ttsGlobalProperties need to remove this
- // application from tts_global_properties_app_list_
- LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
- application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id);
-
- bool helpt_promt = false;
- bool timeout_prompt = false;
- bool vr_help_title_items = false;
- bool menu_name = false;
- bool menu_icon = false;
- bool is_key_board_properties = false;
- int number_of_reset_vr = 0;
- mobile_apis::GlobalProperty::eType global_property =
- mobile_apis::GlobalProperty::INVALID_ENUM;
-
- for (size_t i = 0; i < obj_length; ++i) {
- global_property = static_cast<mobile_apis::GlobalProperty::eType>(
- (*message_)[strings::msg_params][strings::properties][i].asInt());
-
- if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
- helpt_promt = ResetHelpPromt(app);
- } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
- timeout_prompt = ResetTimeoutPromt(app);
- } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
- (mobile_apis::GlobalProperty::VRHELPITEMS ==
- global_property)) &&
- (0 == number_of_reset_vr)) {
- ++number_of_reset_vr;
- vr_help_title_items = ResetVrHelpTitleItems(app);
- } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) {
- menu_name = true;
- } else if (mobile_apis::GlobalProperty::MENUICON == global_property) {
- menu_icon = true;
- } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES ==
- global_property) {
- is_key_board_properties = true;
- }
- }
-
- if (vr_help_title_items || menu_name || menu_icon ||
- is_key_board_properties) {
- is_ui_send_ = true;
- }
-
- if (timeout_prompt || helpt_promt) {
- is_tts_send_ = true;
- }
-
- app->set_reset_global_properties_active(true);
-
- if (vr_help_title_items || menu_name || menu_icon ||
- is_key_board_properties) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (vr_help_title_items) {
- smart_objects::SmartObjectSPtr vr_help =
- MessageHelper::CreateAppVrHelp(app);
- if (!vr_help) {
- return;
- }
- msg_params = *vr_help;
- }
- if (menu_name) {
- msg_params[hmi_request::menu_title] = "";
- app->set_menu_title(msg_params[hmi_request::menu_title]);
- }
- // TODO(DT): clarify the sending parameter menuIcon
- // if (menu_icon) {
- //}
- if (is_key_board_properties) {
- smart_objects::SmartObject key_board_properties =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- key_board_properties[strings::language] =
- static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
- key_board_properties[hmi_request::keyboard_layout] =
- static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
-
- // Look for APPLINK-4432 for details.
- /*smart_objects::SmartObject limited_character_list =
- smart_objects::SmartObject(
- smart_objects::SmartType_Array);
- limited_character_list[0] = "";
- key_board_properties[hmi_request::limited_character_list] =
- limited_character_list;*/
-
- key_board_properties[hmi_request::auto_complete_text] = "";
- msg_params[hmi_request::keyboard_properties] = key_board_properties;
- }
-
- msg_params[strings::app_id] = app->app_id();
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true);
- }
-
- if (timeout_prompt || helpt_promt) {
- // create ui request
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (helpt_promt) {
- msg_params[strings::help_prompt] = (*app->help_prompt());
- }
-
- if (timeout_prompt) {
- msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_SetGlobalProperties, &msg_params, true);
- }
-}
-
-bool ResetGlobalPropertiesRequest::ResetHelpPromt(
- application_manager::ApplicationSharedPtr app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
- smart_objects::SmartObject so_help_prompt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- app->set_help_prompt(so_help_prompt);
- return true;
-}
-
-bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
- application_manager::ApplicationSharedPtr const app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
-
- const std::vector<std::string>& time_out_promt =
- application_manager_.get_settings().time_out_promt();
-
- smart_objects::SmartObject so_time_out_promt =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
- smart_objects::SmartObject timeoutPrompt =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- timeoutPrompt[strings::text] = time_out_promt[i];
- timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
- so_time_out_promt[i] = timeoutPrompt;
- }
-
- app->set_timeout_prompt(so_time_out_promt);
-
- return true;
-}
-
-bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
- application_manager::ApplicationSharedPtr const app) {
- if (!app) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return false;
- }
- app->reset_vr_help_title();
- app->reset_vr_help();
-
- return true;
-}
-
-void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- is_tts_received_ = true;
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Waiting for remaining responses");
- return;
- }
-
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- SendResponse(result,
- static_cast<mobile_apis::Result::eType>(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-
- 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 =
- std::string("Unsupported phoneme type sent in a prompt").c_str();
- } else {
- result =
- PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
- out_result_code =
- PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
- out_response_info = MergeInfos(tts_properties_info,
- tts_response_info_,
- ui_properties_info,
- ui_response_info_);
- }
-
- return result;
-}
-
-bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
- return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
deleted file mode 100644
index c621977868..0000000000
--- a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/reset_global_properties_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {}
-
-void ResetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
deleted file mode 100644
index 0c770953fe..0000000000
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ScrollableMessageRequest::ScrollableMessageRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
-
-ScrollableMessageRequest::~ScrollableMessageRequest() {}
-
-bool ScrollableMessageRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- } else {
- const int32_t def_value = 30000;
- default_timeout_ = def_value;
- }
-
- return true;
-}
-
-void ScrollableMessageRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
- SendResponse(false, processing_result);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[hmi_request::message_text][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::scrollableMessageBody);
- msg_params[hmi_request::message_text][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::scroll_message_body];
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::timeout] = default_timeout_;
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[strings::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
-
- SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
-}
-
-void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- case hmi_apis::FunctionID::UI_ScrollableMessage: {
- LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
-
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
-
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
deleted file mode 100644
index a5b16bdb70..0000000000
--- a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/scrollable_message_response.h"
-
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ScrollableMessageResponse::ScrollableMessageResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-void ScrollableMessageResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- (*message_)[strings::msg_params][strings::result_code].asInt());
- ApplicationSharedPtr application = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asInt());
- if ((mobile_apis::Result::REJECTED != result_code) && application) {
- application->UnsubscribeFromSoftButtons(
- (*message_)[strings::params][strings::function_id].asInt());
- }
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc
deleted file mode 100644
index 9ec4ca3fcc..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_location_request.cc
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <algorithm>
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/message_helper.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SendLocationRequest::SendLocationRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SendLocationRequest::~SendLocationRequest() {}
-
-void SendLocationRequest::Run() {
- using namespace hmi_apis;
- using smart_objects::SmartObject;
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- if (msg_params.keyExists(strings::delivery_mode)) {
- const RPCParams& allowed_params = parameters_permissions().allowed_params;
-
- if (helpers::in_range(allowed_params, strings::delivery_mode)) {
- msg_params.erase(strings::delivery_mode);
- }
- }
-
- std::vector<Common_TextFieldName::eType> fields_to_check;
- if (msg_params.keyExists(strings::location_name)) {
- fields_to_check.push_back(Common_TextFieldName::locationName);
- }
- if (msg_params.keyExists(strings::location_description)) {
- fields_to_check.push_back(Common_TextFieldName::locationDescription);
- }
- if (msg_params.keyExists(strings::address_lines)) {
- fields_to_check.push_back(Common_TextFieldName::addressLines);
- }
- if (msg_params.keyExists(strings::phone_number)) {
- fields_to_check.push_back(Common_TextFieldName::phoneNumber);
- }
-
- if (!CheckHMICapabilities(fields_to_check)) {
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Strings contain invalid characters");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (msg_params.keyExists(strings::address)) {
- const utils::custom_string::CustomString& address =
- msg_params[strings::address].asCustomString();
- if (address.empty()) {
- msg_params.erase(strings::address);
- }
- }
-
- if (!CheckFieldsCompatibility()) {
- LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (msg_params.keyExists(strings::location_image)) {
- mobile_apis::Result::eType verification_result =
- mobile_apis::Result::SUCCESS;
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::location_image],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map);
- request_msg_params = msg_params;
- request_msg_params[strings::app_id] = app->hmi_app_id();
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true);
-}
-
-void SendLocationRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- const smart_objects::SmartObject& message = event.smart_object();
- if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
- LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
- const Common_Result::eType result_code = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::params]));
- return;
- }
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
-}
-
-bool SendLocationRequest::CheckFieldsCompatibility() {
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- MessageHelper::PrintSmartObject(msg_params);
- const bool longitude_degrees_exist =
- msg_params.keyExists(strings::longitude_degrees);
- const bool latitude_degrees_exist =
- msg_params.keyExists(strings::latitude_degrees);
- const bool address_exist = msg_params.keyExists(strings::address);
-
- if (latitude_degrees_exist ^ longitude_degrees_exist) {
- LOG4CXX_DEBUG(logger_,
- "latitude and longitude should be provided only in pair");
- return false;
- }
-
- if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) {
- LOG4CXX_DEBUG(logger_,
- "address or latitude/longtitude should should be provided");
- return false;
- }
- return true;
-}
-void insert_if_contains(
- const smart_objects::SmartObject& msg_params,
- const std::string& param_key,
- std::vector<utils::custom_string::CustomString>& output_vector) {
- if (msg_params.keyExists(param_key)) {
- output_vector.push_back(msg_params[param_key].asCustomString());
- }
-}
-
-bool SendLocationRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<utils::custom_string::CustomString> fields_to_check;
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
- insert_if_contains(msg_params, strings::location_name, fields_to_check);
- insert_if_contains(
- msg_params, strings::location_description, fields_to_check);
- insert_if_contains(msg_params, strings::phone_number, fields_to_check);
-
- if (msg_params.keyExists(strings::address_lines)) {
- const smart_objects::SmartArray* al_array =
- msg_params[strings::address_lines].asArray();
- smart_objects::SmartArray::const_iterator it_al = al_array->begin();
- smart_objects::SmartArray::const_iterator it_al_end = al_array->end();
- for (; it_al != it_al_end; ++it_al) {
- const utils::custom_string::CustomString& val = (*it_al).asCustomString();
- fields_to_check.push_back(val);
- }
- }
-
- if (msg_params.keyExists(strings::address)) {
- const smart_objects::SmartObject& address_so = msg_params[strings::address];
- insert_if_contains(address_so, strings::country_name, fields_to_check);
- insert_if_contains(address_so, strings::country_code, fields_to_check);
- insert_if_contains(address_so, strings::postal_code, fields_to_check);
- insert_if_contains(
- address_so, strings::administrative_area, fields_to_check);
- insert_if_contains(address_so, strings::locality, fields_to_check);
- insert_if_contains(address_so, strings::sub_locality, fields_to_check);
- insert_if_contains(address_so, strings::thoroughfare, fields_to_check);
- insert_if_contains(address_so, strings::sub_thoroughfare, fields_to_check);
- }
-
- std::vector<utils::custom_string::CustomString>::iterator it =
- fields_to_check.begin();
- for (; it != fields_to_check.end(); ++it) {
- const std::string& str = it->AsMBString();
- if (!CheckSyntax(str, false)) {
- LOG4CXX_ERROR(logger_,
- "string '" << str << "'' contains invalid characters");
- return true;
- }
- }
- return false;
-}
-
-bool SendLocationRequest::CheckHMICapabilities(
- std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names) {
- using namespace smart_objects;
- using namespace hmi_apis;
- if (fields_names.empty()) {
- return true;
- }
-
- const HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
- if (!hmi_capabilities.is_ui_cooperating()) {
- LOG4CXX_ERROR(logger_, "UI is not supported.");
- return false;
- }
-
- if (hmi_capabilities.display_capabilities()) {
- const SmartObject disp_cap = (*hmi_capabilities.display_capabilities());
- const SmartObject& text_fields =
- disp_cap.getElement(hmi_response::text_fields);
- const size_t len = text_fields.length();
- for (size_t i = 0; i < len; ++i) {
- const SmartObject& text_field = text_fields[i];
- const Common_TextFieldName::eType filed_name =
- static_cast<Common_TextFieldName::eType>(
- text_field.getElement(strings::name).asInt());
- const std::vector<Common_TextFieldName::eType>::iterator it =
- std::find(fields_names.begin(), fields_names.end(), filed_name);
- if (it != fields_names.end()) {
- fields_names.erase(it);
- }
- }
- }
-
- if (!fields_names.empty()) {
- LOG4CXX_ERROR(logger_, "Some fields are not supported by capabilities");
- return false;
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_response.cc b/src/components/application_manager/src/commands/mobile/send_location_response.cc
deleted file mode 100644
index 167642e390..0000000000
--- a/src/components/application_manager/src/commands/mobile/send_location_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/send_location_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SendLocationResponse::SendLocationResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SendLocationResponse::~SendLocationResponse() {}
-
-void SendLocationResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
deleted file mode 100644
index 5d70a2fb5b..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetAppIconRequest::SetAppIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_icons_saving_enabled_(false) {
- const std::string path =
- application_manager_.get_settings().app_icons_folder();
- is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) &&
- file_system::IsReadingAllowed(path);
-}
-
-SetAppIconRequest::~SetAppIconRequest() {}
-
-void SetAppIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (is_icons_saving_enabled_) {
- CopyToIconStorage(full_file_path);
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- // Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi =
- file_system::ConvertPathForURL(full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t>(SetAppIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
-
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetAppIconRequest::CopyToIconStorage(
- const std::string& path_to_file) const {
- if (!application_manager_.protocol_handler()
- .get_settings()
- .enable_protocol_4()) {
- LOG4CXX_WARN(logger_,
- "Icon copying skipped, since protocol ver. 4 is not enabled.");
- return;
- }
-
- std::vector<uint8_t> file_content;
- if (!file_system::ReadBinaryFile(path_to_file, file_content)) {
- LOG4CXX_ERROR(logger_, "Can't read icon file: " << path_to_file);
- return;
- }
-
- const std::string icon_storage =
- application_manager_.get_settings().app_icons_folder();
- const uint64_t storage_max_size = static_cast<uint64_t>(
- application_manager_.get_settings().app_icons_folder_max_size());
- const uint64_t file_size = file_system::FileSize(path_to_file);
-
- if (storage_max_size < file_size) {
- LOG4CXX_ERROR(logger_,
- "Icon size (" << file_size << ") is bigger, than "
- " icons storage maximum size ("
- << storage_max_size << ")."
- "Copying skipped.");
- return;
- }
-
- const uint64_t storage_size =
- static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
- if (storage_max_size < (file_size + storage_size)) {
- const uint32_t icons_amount =
- application_manager_.get_settings().app_icons_amount_to_remove();
-
- if (!icons_amount) {
- LOG4CXX_DEBUG(logger_,
- "No icons will be deleted, since amount icons to remove "
- "is zero. Icon saving skipped.");
- return;
- }
-
- while (!IsEnoughSpaceForIcon(file_size)) {
- RemoveOldestIcons(icon_storage, icons_amount);
- }
- }
- ApplicationConstSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(
- logger_,
- "Can't get application for connection key: " << connection_key());
- return;
- }
-
- const std::string icon_path = icon_storage + "/" + app->policy_app_id();
- if (!file_system::CreateFile(icon_path)) {
- LOG4CXX_ERROR(logger_, "Can't create icon: " << icon_path);
- return;
- }
-
- if (!file_system::Write(icon_path, file_content)) {
- LOG4CXX_ERROR(logger_, "Can't write icon: " << icon_path);
- return;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Icon was successfully copied from :" << path_to_file << " to "
- << icon_path);
-
- return;
-}
-
-void SetAppIconRequest::RemoveOldestIcons(const std::string& storage,
- const uint32_t icons_amount) const {
- const std::vector<std::string> icons_list = file_system::ListFiles(storage);
- std::map<uint64_t, std::string> icon_modification_time;
- std::vector<std::string>::const_iterator it = icons_list.begin();
- for (; it != icons_list.end(); ++it) {
- const std::string file_name = *it;
- const std::string file_path = storage + "/" + file_name;
- if (!file_system::FileExists(file_path)) {
- continue;
- }
- const uint64_t time = file_system::GetFileModificationTime(file_path);
- icon_modification_time[time] = file_name;
- }
-
- for (size_t counter = 0; counter < icons_amount; ++counter) {
- if (!icon_modification_time.size()) {
- LOG4CXX_ERROR(logger_, "No more icons left for deletion.");
- return;
- }
- const std::string file_name = icon_modification_time.begin()->second;
- const std::string file_path = storage + "/" + file_name;
- if (!file_system::DeleteFile(file_path)) {
- LOG4CXX_DEBUG(logger_, "Error while deleting icon " << file_path);
- }
- icon_modification_time.erase(icon_modification_time.begin());
- LOG4CXX_DEBUG(logger_,
- "Old icon " << file_path << " was deleted successfully.");
- }
-}
-
-bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const {
- const std::string icon_storage =
- application_manager_.get_settings().app_icons_folder();
- const uint64_t storage_max_size = static_cast<uint64_t>(
- application_manager_.get_settings().app_icons_folder_max_size());
- const uint64_t storage_size =
- static_cast<uint64_t>(file_system::DirectorySize(icon_storage));
- return storage_max_size >= (icon_size + storage_size);
-}
-
-void SetAppIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string response_info;
- GetInfo(message, response_info);
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!message_.valid() || !app.valid()) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
- }
-
- const std::string& path =
- (*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc
deleted file mode 100644
index 29f3950ffc..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_app_icon_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetAppIconResponse::SetAppIconResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetAppIconResponse::~SetAppIconResponse() {}
-
-void SetAppIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
deleted file mode 100644
index 984690384a..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetDisplayLayoutRequest::SetDisplayLayoutRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {}
-
-void SetDisplayLayoutRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationConstSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
- SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
- &((*message_)[strings::msg_params]),
- true);
-}
-
-void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetDisplayLayout: {
- LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool response_success = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string info;
- GetInfo(message, info);
- smart_objects::SmartObject msg_params = message[strings::msg_params];
- if (response_success) {
- HMICapabilities& hmi_capabilities =
- application_manager_.hmi_capabilities();
-
- // in case templates_available is empty copy from hmi capabilities
- if (msg_params.keyExists(hmi_response::display_capabilities)) {
- if (0 ==
- msg_params[hmi_response::display_capabilities]
- [hmi_response::templates_available].length()) {
- msg_params[hmi_response::display_capabilities]
- [hmi_response::templates_available] =
- hmi_capabilities.display_capabilities()->getElement(
- hmi_response::templates_available);
- }
- }
- }
- SendResponse(response_success,
- MessageHelper::HMIToMobileResult(result_code),
- info.empty() ? NULL : info.c_str(),
- &msg_params);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
deleted file mode 100644
index b5e53803c8..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_display_layout_response.h"
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetDisplayLayoutResponse::SetDisplayLayoutResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {}
-
-void SetDisplayLayoutResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
deleted file mode 100644
index fcfea5e744..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- Copyright (c) 2015, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <algorithm>
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_tts_send_(false)
- , is_ui_received_(false)
- , is_tts_received_(false)
- , ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
- , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
-
-SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {}
-
-void SetGlobalPropertiesRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "No application associated with connection key "
- << connection_key());
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (!ValidateConditionalMandatoryParameters(msg_params)) {
- SendResponse(false,
- mobile_apis::Result::INVALID_DATA,
- "There are no parameters present in request.");
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
-
- if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::menu_icon],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(
- logger_, "MessageHelper::VerifyImage return " << verification_result);
- SendResponse(false, verification_result);
- return;
- }
- }
- // Check for image file(s) in vrHelpItem
- if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImageVrHelpItems(
- (*message_)[strings::msg_params][strings::vr_help],
- app,
- application_manager_)) {
- LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "White spaces found");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // if application waits for sending ttsGlobalProperties need to remove this
- // application from tts_global_properties_app_list_
- application_manager_.RemoveAppFromTTSGlobalPropertiesList(connection_key());
- bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt);
- bool is_timeout_prompt_present =
- msg_params.keyExists(strings::timeout_prompt);
- bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title);
- bool is_vr_help_present = msg_params.keyExists(strings::vr_help);
-
- // check VR params
- if (is_vr_help_title_present ^ is_vr_help_present) {
- LOG4CXX_ERROR(logger_,
- "Reject because of vr_help or vr_help_title only provided");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- /* Need to set flags before sending request to HMI
- * for correct processing this flags in method on_event */
- if (is_help_prompt_present || is_timeout_prompt_present) {
- is_tts_send_ = true;
- }
- if (is_vr_help_title_present && is_vr_help_present) {
- LOG4CXX_DEBUG(logger_, "VRHelp params presents");
-
- if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) {
- LOG4CXX_ERROR(logger_,
- "VR Help Items contains nonsequential positions"
- << " (e.g. [1,2,4]) or not started from 1");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- PrepareUIRequestVRHelpData(app, msg_params, params);
- PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
-
- params[strings::app_id] = app->app_id();
- SendUIRequest(params, true);
- } else {
- LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
- DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
-
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (ValidateVRHelpTitle(app->vr_help_title())) {
- LOG4CXX_DEBUG(logger_, "App already contains VRHelp data");
- } else {
- if (!PrepareUIRequestDefaultVRHelpData(app, params)) {
- LOG4CXX_ERROR(logger_, "default VRHElp data could not be generated");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
-
- // Preparing data
- if (params.empty()) {
- LOG4CXX_DEBUG(logger_, "No UI info provided");
- } else {
- params[strings::app_id] = app->app_id();
- SendUIRequest(params, true);
- }
- }
-
- // check TTS params
- if (is_help_prompt_present || is_timeout_prompt_present) {
- LOG4CXX_DEBUG(logger_, "TTS params presents");
- smart_objects::SmartObject params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- if (is_help_prompt_present) {
- app->set_help_prompt(msg_params.getElement(strings::help_prompt));
- params[strings::help_prompt] = (*app->help_prompt());
- }
-
- if (is_timeout_prompt_present) {
- app->set_timeout_prompt(msg_params.getElement(strings::timeout_prompt));
- params[strings::timeout_prompt] = (*app->timeout_prompt());
- }
-
- params[strings::app_id] = app->app_id();
- SendTTSRequest(params, true);
- }
-}
-
-bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder(
- const smart_objects::SmartObject& vr_help) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(vr_help.getType() == smart_objects::SmartType_Array, false);
- const size_t vr_help_length = vr_help.length();
- DCHECK_OR_RETURN(vr_help_length > 0, false);
-
- for (size_t j = 0; j < vr_help_length; ++j) {
- const size_t position =
- vr_help.getElement(j).getElement(strings::position).asUInt();
- // Elements shall start from 1 and increment one by one
- if (position != (j + 1)) {
- LOG4CXX_ERROR(logger_,
- "VR help items order is wrong"
- << " at " << j << ", position value:" << position);
- return false;
- }
- }
- return true;
-}
-
-void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- is_ui_received_ = true;
- ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, ui_response_info_);
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- is_tts_received_ = true;
- tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- GetInfo(message, tts_response_info_);
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-
- if (IsPendingResponseExist()) {
- LOG4CXX_DEBUG(logger_, "Continue waiting for response");
- return;
- }
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- std::string response_info;
- const bool result = PrepareResponseParameters(result_code, response_info);
-
- // TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-
- if (!application) {
- LOG4CXX_DEBUG(logger_, "NULL pointer.");
- return;
- }
-
- if (result) {
- application->UpdateHash();
- }
-}
-
-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_);
- if (vr_help_so_ptr) {
- const std::string& vr_help = vr_help_so_ptr->asString();
- LOG4CXX_TRACE(logger_, "App contains vr_help_title: \"" << vr_help << '"');
- return !vr_help.empty();
- }
- return false;
-}
-
-void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(app);
-
- app->set_vr_help_title(msg_params.getElement(strings::vr_help_title));
- app->set_vr_help(msg_params.getElement(strings::vr_help));
-
- out_params[strings::vr_help_title] = (*app->vr_help_title());
- out_params[strings::vr_help] = (*app->vr_help());
-}
-
-bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData(
- const ApplicationSharedPtr app, smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(app, false);
-
- LOG4CXX_DEBUG(logger_, "Generate default VRHelp data");
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& cmdMap = accessor.GetData();
-
- int32_t index = 0;
- smart_objects::SmartObject vr_help_items;
- for (CommandsMap::const_iterator command_it = cmdMap.begin();
- cmdMap.end() != command_it;
- ++command_it) {
- const smart_objects::SmartObject& command = *command_it->second;
- if (!command.keyExists(strings::vr_commands)) {
- LOG4CXX_ERROR(logger_, "VR synonyms are empty");
- return false;
- }
- // use only first
- vr_help_items[index][strings::position] = (index + 1);
- vr_help_items[index++][strings::text] =
- (*command_it->second)[strings::vr_commands][0];
- }
-
- app->set_vr_help_title(smart_objects::SmartObject(app->name()));
-
- out_params[strings::vr_help_title] = (*app->vr_help_title());
- if (vr_help_items.length() > 0) {
- app->set_vr_help(vr_help_items);
- out_params[strings::vr_help] = (*app->vr_help());
- }
- return true;
-}
-
-void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
- const ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params,
- smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN_VOID(app);
-
- const bool is_menu_title_present =
- msg_params.keyExists(hmi_request::menu_title);
- const bool is_menu_icon_present =
- msg_params.keyExists(hmi_request::menu_icon);
- const bool is_keyboard_props_present =
- msg_params.keyExists(hmi_request::keyboard_properties);
-
- if (is_menu_title_present) {
- out_params[hmi_request::menu_title] =
- msg_params[hmi_request::menu_title].asString();
- app->set_menu_title(msg_params[hmi_request::menu_title]);
- }
- if (is_menu_icon_present) {
- out_params[hmi_request::menu_icon] = msg_params[hmi_request::menu_icon];
- app->set_menu_icon(msg_params[hmi_request::menu_icon]);
- }
- if (is_keyboard_props_present) {
- out_params[hmi_request::keyboard_properties] =
- msg_params[hmi_request::keyboard_properties];
- app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
- }
-}
-
-void SetGlobalPropertiesRequest::SendTTSRequest(
- const smart_objects::SmartObject& params, bool use_events) {
- LOG4CXX_AUTO_TRACE(logger_);
- is_tts_send_ = true;
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
-}
-
-void SetGlobalPropertiesRequest::SendUIRequest(
- const smart_objects::SmartObject& params, bool use_events) {
- LOG4CXX_AUTO_TRACE(logger_);
- is_ui_send_ = true;
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
-}
-
-bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
- return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
-}
-
-bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
- const smart_objects::SmartObject& params) {
- LOG4CXX_AUTO_TRACE(logger_);
- return params.keyExists(strings::help_prompt) ||
- params.keyExists(strings::timeout_prompt) ||
- params.keyExists(strings::vr_help_title) ||
- params.keyExists(strings::vr_help) ||
- params.keyExists(strings::menu_title) ||
- params.keyExists(strings::menu_icon) ||
- params.keyExists(strings::keyboard_properties);
-}
-
-bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str;
-
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- if (msg_params.keyExists(strings::help_prompt)) {
- const smart_objects::SmartArray* hp_array =
- msg_params[strings::help_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
- smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
-
- for (; it_hp != it_hp_end; ++it_hp) {
- str = (*it_hp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params.keyExists(strings::timeout_prompt)) {
- const smart_objects::SmartArray* tp_array =
- msg_params[strings::timeout_prompt].asArray();
-
- smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
- smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
-
- for (; it_tp != it_tp_end; ++it_tp) {
- str = (*it_tp)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params.keyExists(strings::vr_help)) {
- const smart_objects::SmartArray* vh_array =
- msg_params[strings::vr_help].asArray();
-
- smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
- smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
-
- for (; it_vh != it_vh_end; ++it_vh) {
- str = (*it_vh)[strings::text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed");
- return true;
- }
-
- if ((*it_vh).keyExists(strings::image)) {
- str = (*it_vh)[strings::image][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid vr_help image value syntax check failed");
- return true;
- }
- } // if image exists
- } // for - vh_array iteration
- }
-
- if (msg_params.keyExists(strings::menu_icon)) {
- str = msg_params[strings::menu_icon][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::vr_help_title)) {
- str = msg_params[strings::vr_help_title].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::menu_title)) {
- str = msg_params[strings::menu_title].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
- return true;
- }
- }
-
- if (msg_params.keyExists(strings::keyboard_properties)) {
- if (msg_params[strings::keyboard_properties].keyExists(
- strings::limited_character_list)) {
- const smart_objects::SmartArray* lcl_array =
- msg_params[strings::keyboard_properties]
- [strings::limited_character_list].asArray();
-
- smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
- smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
-
- for (; it_lcl != it_lcl_end; ++it_lcl) {
- str = (*it_lcl).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "limited_character_list syntax check failed");
- return true;
- }
- }
- }
-
- if (msg_params[strings::keyboard_properties].keyExists(
- strings::auto_complete_text)) {
- str =
- msg_params[strings::keyboard_properties][strings::auto_complete_text]
- .asCharArray();
-
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid keyboard_properties "
- "auto_complete_text syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
deleted file mode 100644
index 5cfbcb2d58..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_global_properties_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {}
-
-void SetGlobalPropertiesResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
deleted file mode 100644
index 85f34aead9..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_icon_request.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_impl.h"
-#include "config_profile/profile.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconRequest::SetIconRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetIconRequest::~SetIconRequest() {}
-
-void SetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- // Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi =
- file_system::ConvertPathForURL(full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t>(SetIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
-
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- const std::string path =
- (*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_icon_response.cc
deleted file mode 100644
index c140d04f51..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_response.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_icon_response.h"
-#include "application_manager/application_manager.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconResponse::SetIconResponse(const MessageSharedPtr& message,
- ApplicationManager& app_man)
- : CommandResponseImpl(message, app_man) {}
-
-SetIconResponse::~SetIconResponse() {}
-
-void SetIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
deleted file mode 100644
index 1e0a00318d..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
+++ /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.
- */
-
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-
-#include "application_manager/message_helper.h"
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetMediaClockRequest::SetMediaClockRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SetMediaClockRequest::~SetMediaClockRequest() {}
-
-void SetMediaClockRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if (!app->is_media_application()) {
- LOG4CXX_ERROR(logger_, "Application is not media application");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (isDataValid()) {
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- // copy entirely msg
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = app->app_id();
-
- SendHMIRequest(
- hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true);
- } else {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void SetMediaClockRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- std::string response_info;
- GetInfo(message, response_info);
-
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool SetMediaClockRequest::isDataValid() {
- smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
- mobile_apis::UpdateMode::eType update_mode =
- static_cast<mobile_apis::UpdateMode::eType>(
- msg_params[strings::update_mode].asUInt());
-
- if (update_mode == mobile_apis::UpdateMode::COUNTUP ||
- update_mode == mobile_apis::UpdateMode::COUNTDOWN) {
- if (!msg_params.keyExists(strings::start_time)) {
- LOG4CXX_INFO(logger_, "Invalid data");
- return false;
- }
-
- if (msg_params.keyExists(strings::end_time)) {
- unsigned int start_time_in_seconds = 0;
- start_time_in_seconds =
- (msg_params[strings::start_time][strings::hours].asUInt()) * 3600;
- start_time_in_seconds +=
- (msg_params[strings::start_time][strings::minutes].asUInt()) * 60;
- start_time_in_seconds +=
- (msg_params[strings::start_time][strings::seconds].asUInt());
-
- unsigned int end_time_in_seconds = 0;
- end_time_in_seconds =
- (msg_params[strings::end_time][strings::hours].asUInt()) * 3600;
- end_time_in_seconds +=
- (msg_params[strings::end_time][strings::minutes].asUInt()) * 60;
- end_time_in_seconds +=
- (msg_params[strings::end_time][strings::seconds].asUInt());
-
- if (((end_time_in_seconds > start_time_in_seconds) &&
- (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) ||
- ((end_time_in_seconds < start_time_in_seconds) &&
- (update_mode == mobile_apis::UpdateMode::COUNTUP))) {
- LOG4CXX_INFO(logger_, "Invalid data");
- return false;
- }
- }
- }
-
- LOG4CXX_INFO(logger_, "Data is valid");
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
deleted file mode 100644
index 30e802a1db..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetMediaClockTimerResponse::SetMediaClockTimerResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {}
-
-void SetMediaClockTimerResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
deleted file mode 100644
index b1cc40009d..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cstring>
-#include "application_manager/commands/mobile/show_constant_tbt_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowConstantTBTRequest::ShowConstantTBTRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ShowConstantTBTRequest::~ShowConstantTBTRequest() {}
-
-void ShowConstantTBTRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
- // SDLAQ-CRS-664, VC3.1
- if ((*message_)[strings::msg_params].empty()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming show constant TBT has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons(msg_params,
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if (msg_params.keyExists(strings::turn_icon)) {
- verification_result = MessageHelper::VerifyImage(
- msg_params[strings::turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if (msg_params.keyExists(strings::next_turn_icon)) {
- verification_result = MessageHelper::VerifyImage(
- msg_params[strings::next_turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- msg_params[hmi_request::navi_texts] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- if (msg_params.keyExists(strings::navigation_text_1)) {
- // erase useless parametr
- msg_params.erase(strings::navigation_text_1);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::navigation_text_1];
- }
-
- if (msg_params.keyExists(strings::navigation_text_2)) {
- // erase useless param
- msg_params.erase(strings::navigation_text_2);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::navigation_text_2];
- }
-
- if (msg_params.keyExists(strings::eta)) {
- // erase useless param
- msg_params.erase(strings::eta);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::eta];
- }
-
- if (msg_params.keyExists(strings::total_distance)) {
- // erase useless param
- msg_params.erase(strings::total_distance);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::total_distance];
- }
-
- if (msg_params.keyExists(strings::time_to_destination)) {
- // erase useless param
- msg_params.erase(strings::time_to_destination);
- msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
- msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::time_to_destination];
- }
-
- if (msg_params.keyExists(strings::soft_buttons)) {
- MessageHelper::SubscribeApplicationToSoftButton(
- msg_params, app, function_id());
- }
-
- app->set_tbt_show_command(msg_params);
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true);
-}
-
-void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace hmi_apis;
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
- LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
- const Common_Result::eType result_code =
- static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
- str = (*message_)[strings::msg_params][strings::turn_icon][strings::value]
- .asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
- str = (*message_)[strings::msg_params][strings::next_turn_icon]
- [strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid next_turn_icon value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) {
- str = (*message_)[strings::msg_params][strings::navigation_text_1]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid navigation_text_1 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) {
- str = (*message_)[strings::msg_params][strings::navigation_text_2]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid navigation_text_2 value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::eta)) {
- str = (*message_)[strings::msg_params][strings::eta].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) {
- str =
- (*message_)[strings::msg_params][strings::total_distance].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid total_distance value syntax check failed");
- return true;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(
- strings::time_to_destination)) {
- str = (*message_)[strings::msg_params][strings::time_to_destination]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid time_to_destination value syntax check failed");
- return true;
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
deleted file mode 100644
index 80a36129cf..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/show_constant_tbt_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowConstantTBTResponse::ShowConstantTBTResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
-
- : CommandResponseImpl(message, application_manager) {}
-
-ShowConstantTBTResponse::~ShowConstantTBTResponse() {}
-
-void ShowConstantTBTResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc
deleted file mode 100644
index cf2509cdb9..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_request.cc
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <string.h>
-#include "application_manager/commands/mobile/show_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "utils/file_system.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowRequest::ShowRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-ShowRequest::~ShowRequest() {}
-
-void ShowRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- // SDLAQ-CRS-494, VC3.1
- if ((*message_)[strings::msg_params].empty()) {
- LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if (!CheckStringsOfShowRequest()) {
- LOG4CXX_ERROR(logger_, "Incorrect characters in string");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS;
- if (((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
- ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) {
- processing_result = MessageHelper::ProcessSoftButtons(
- (*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
- }
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "Processing of soft buttons failed.");
- SendResponse(false, processing_result);
- return;
- }
-
- mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
- if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
- ((*message_)[strings::msg_params][strings::graphic][strings::value]
- .asString()).length()) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::graphic],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- verification_result = MessageHelper::VerifyImage(
- (*message_)[strings::msg_params][strings::secondary_graphic],
- app,
- application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
- LOG4CXX_ERROR(logger_, "Image verification failed.");
- SendResponse(false, verification_result);
- return;
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
-
- msg_params[hmi_request::show_strings] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
-
- int32_t index = 0;
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_1];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_2];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_3];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::main_field_4];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::media_clock];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaTrack);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::media_track];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
- msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
- static_cast<int32_t>(hmi_apis::Common_TextFieldName::statusBar);
- msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
- (*message_)[strings::msg_params][strings::status_bar];
- ++index;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::alignment)) {
- msg_params[strings::alignment] =
- (*message_)[strings::msg_params][strings::alignment];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
- msg_params[strings::graphic] =
- (*message_)[strings::msg_params][strings::graphic];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- msg_params[strings::secondary_graphic] =
- (*message_)[strings::msg_params][strings::secondary_graphic];
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- msg_params[strings::soft_buttons] =
- (*message_)[strings::msg_params][strings::soft_buttons];
- if ((*message_)[strings::msg_params][strings::soft_buttons].length() == 0) {
- app->UnsubscribeFromSoftButtons(function_id());
- } else {
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
- msg_params[strings::custom_presets] =
- (*message_)[strings::msg_params][strings::custom_presets];
- }
-
- SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
-
- MessageSharedPtr persistentData = new smart_objects::SmartObject(msg_params);
- app->set_show_command(*persistentData);
-}
-
-void ShowRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_Show: {
- LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
- std::string response_info;
- hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_UI);
- GetInfo(message, response_info);
- if (hmi_apis::Common_Result::WARNINGS == result_code &&
- message[strings::params].keyExists(hmi_response::message)) {
- response_info =
- message[strings::params][hmi_response::message].asString();
- }
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event " << event.id());
- break;
- }
- }
-}
-
-bool ShowRequest::CheckStringsOfShowRequest() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str;
-
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
- str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
- str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
- str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
- str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
- str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
- str = (*message_)[strings::msg_params][strings::media_clock].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
- str = (*message_)[strings::msg_params][strings::media_track].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed");
- return false;
- }
- }
- if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
- smart_objects::SmartObject& custom_presets_array =
- (*message_)[strings::msg_params][strings::custom_presets];
- for (size_t i = 0; i < custom_presets_array.length(); ++i) {
- str = custom_presets_array[i].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed");
- return false;
- }
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
- str = (*message_)[strings::msg_params][strings::graphic][strings::value]
- .asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed");
- return false;
- }
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
- str = (*message_)[strings::msg_params][strings::secondary_graphic]
- [strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_,
- "Invalid secondary_graphic value syntax check failed");
- return false;
- }
- }
- return true;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_response.cc b/src/components/application_manager/src/commands/mobile/show_response.cc
deleted file mode 100644
index 8027c908f1..0000000000
--- a/src/components/application_manager/src/commands/mobile/show_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/show_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-ShowResponse::ShowResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-ShowResponse::~ShowResponse() {}
-
-void ShowResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc
deleted file mode 100644
index 054d0ec16d..0000000000
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/slider_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-#include "config_profile/profile.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SliderRequest::SliderRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
-}
-
-SliderRequest::~SliderRequest() {}
-
-bool SliderRequest::Init() {
- /* Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.*/
- if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
- default_timeout_ =
- application_manager_.get_settings().default_timeout() +
- (*message_)[strings::msg_params][strings::timeout].asUInt();
- }
-
- return true;
-}
-
-void SliderRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if ((*message_)[strings::msg_params][strings::num_ticks].asInt() <
- (*message_)[strings::msg_params][strings::position].asInt()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
- if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) {
- if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() !=
- (*message_)[strings::msg_params][strings::slider_footer].length()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
- msg_params[strings::app_id] = application->app_id();
-
- if (!(*message_)[strings::msg_params].keyExists(strings::timeout)) {
- msg_params[strings::timeout] = default_timeout_;
- }
-
- SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
-}
-
-void SliderRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
- using namespace smart_objects;
- using namespace hmi_apis;
-
- const SmartObject& message = event.smart_object();
-
- const event_engine::Event::EventID event_id = event.id();
- if (event_id == FunctionID::UI_OnResetTimeout) {
- LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- return;
- }
-
- if (event_id != FunctionID::UI_Slider) {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
-
- LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
-
- const Common_Result::eType response_code = static_cast<Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- SmartObject response_msg_params = message[strings::msg_params];
-
- const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>(
- response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED);
-
- if (is_timeout_aborted) {
- if (message[strings::params][strings::data].keyExists(
- strings::slider_position)) {
- // Copy slider_position info to msg_params section
- response_msg_params[strings::slider_position] =
- message[strings::params][strings::data][strings::slider_position];
- } else {
- LOG4CXX_ERROR(logger_,
- strings::slider_position << " field is absent"
- " in response.");
- response_msg_params[strings::slider_position] = 0;
- }
- }
- std::string response_info;
- GetInfo(message, response_info);
- const bool is_response_success = PrepareResultForMobileResponse(
- response_code, HmiInterfaces::HMI_INTERFACE_UI);
-
- SendResponse(is_response_success,
- MessageHelper::HMIToMobileResult(response_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &response_msg_params);
-}
-
-bool SliderRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- str = (*message_)[strings::msg_params][strings::slider_header].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed");
- return true;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
- const smart_objects::SmartArray* sf_array =
- (*message_)[strings::msg_params][strings::slider_footer].asArray();
-
- smart_objects::SmartArray::const_iterator it_sf = sf_array->begin();
- smart_objects::SmartArray::const_iterator it_sf_end = sf_array->end();
-
- for (; it_sf != it_sf_end; ++it_sf) {
- str = (*it_sf).asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/slider_response.cc b/src/components/application_manager/src/commands/mobile/slider_response.cc
deleted file mode 100644
index 2cfcaf48fd..0000000000
--- a/src/components/application_manager/src/commands/mobile/slider_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/slider_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SliderResponse::SliderResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SliderResponse::~SliderResponse() {}
-
-void SliderResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc
deleted file mode 100644
index 6cbb762102..0000000000
--- a/src/components/application_manager/src/commands/mobile/speak_request.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include "application_manager/commands/mobile/speak_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SpeakRequest::SpeakRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
- subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
-}
-
-SpeakRequest::~SpeakRequest() {}
-
-void SpeakRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming speak has contains \\t\\n \\\\t \\\\n "
- " text contains only whitespace in ttsChunks");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- (*message_)[strings::msg_params][strings::app_id] = app->app_id();
- (*message_)[strings::msg_params][hmi_request::speak_type] =
- hmi_apis::Common_MethodName::SPEAK;
- SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
- &message_->getElement(strings::msg_params),
- true);
-}
-
-void SpeakRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- switch (event.id()) {
- case hmi_apis::FunctionID::TTS_Speak: {
- LOG4CXX_INFO(logger_, "Received TTS_Speak event");
-
- ProcessTTSSpeakResponse(event.smart_object());
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
-
- application_manager_.updateRequestTimeout(
- connection_key(), correlation_id(), default_timeout());
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-void SpeakRequest::ProcessTTSSpeakResponse(
- const smart_objects::SmartObject& message) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- hmi_apis::Common_Result::eType hmi_result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result_code);
-
- const bool result = PrepareResultForMobileResponse(
- hmi_result_code, HmiInterfaces::HMI_INTERFACE_TTS);
-
- (*message_)[strings::params][strings::function_id] =
- mobile_apis::FunctionID::SpeakID;
-
- const char* return_info = NULL;
-
- SendResponse(
- result, result_code, return_info, &(message[strings::msg_params]));
-}
-
-bool SpeakRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- const smart_objects::SmartArray* tc_array =
- (*message_)[strings::msg_params][strings::tts_chunks].asArray();
-
- smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
- smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
-
- for (; it_tc != it_tc_end; ++it_tc) {
- str = (*it_tc)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
- LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
- return true;
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_response.cc b/src/components/application_manager/src/commands/mobile/speak_response.cc
deleted file mode 100644
index 612d32c913..0000000000
--- a/src/components/application_manager/src/commands/mobile/speak_response.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/speak_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SpeakResponse::SpeakResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SpeakResponse::~SpeakResponse() {}
-
-void SpeakResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
deleted file mode 100644
index eb6bbf545e..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_button_request.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-SubscribeButtonRequest::SubscribeButtonRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeButtonRequest::~SubscribeButtonRequest() {}
-
-void SubscribeButtonRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const mobile_apis::ButtonName::eType btn_id =
- static_cast<mobile_apis::ButtonName::eType>(
- (*message_)[str::msg_params][str::button_name].asInt());
-
- if (!IsSubscriptionAllowed(app, btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Subscribe on button " << btn_id << " isn't allowed");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
-
- if (!CheckHMICapabilities(btn_id)) {
- LOG4CXX_ERROR(logger_,
- "Subscribe on button "
- << btn_id << " isn't allowed by HMI capabilities");
- SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
- return;
- }
-
- if (app->IsSubscribedToButton(btn_id)) {
- LOG4CXX_ERROR(logger_, "Already subscribed to button " << btn_id);
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
- SendSubscribeButtonNotification();
-
- const bool is_succedeed = true;
- SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
-
- if (is_succedeed) {
- app->UpdateHash();
- }
-}
-
-bool SubscribeButtonRequest::IsSubscriptionAllowed(
- ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
- if (!app->is_media_application() &&
- ((mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
- (mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
- (mobile_apis::ButtonName::TUNEUP == btn_id) ||
- (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
- return false;
- }
- return true;
-}
-
-bool SubscribeButtonRequest::CheckHMICapabilities(
- mobile_apis::ButtonName::eType button) {
- using namespace smart_objects;
- using namespace mobile_apis;
- LOG4CXX_AUTO_TRACE(logger_);
-
- const HMICapabilities& hmi_caps = application_manager_.hmi_capabilities();
- if (!hmi_caps.is_ui_cooperating()) {
- LOG4CXX_ERROR(logger_, "UI is not supported by HMI.");
- return false;
- }
-
- const SmartObject* button_caps_ptr = hmi_caps.button_capabilities();
- if (button_caps_ptr) {
- const SmartObject& button_caps = *button_caps_ptr;
- const size_t length = button_caps.length();
- for (size_t i = 0; i < length; ++i) {
- const SmartObject& caps = button_caps[i];
- const ButtonName::eType name = static_cast<ButtonName::eType>(
- caps.getElement(hmi_response::button_name).asInt());
- if (name == button) {
- return true;
- }
- }
- }
- return false;
-}
-
-void SubscribeButtonRequest::SendSubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asUInt());
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
deleted file mode 100644
index a92e58b19a..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_button_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeButtonResponse::SubscribeButtonResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeButtonResponse::~SubscribeButtonResponse() {}
-
-void SubscribeButtonResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
deleted file mode 100644
index 56027bacaf..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-namespace commands {
-
-SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
-
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
-void SubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
- std::string info;
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- bool result = false;
- CheckVISubscribtions(
- app, info, result_code, response_params, msg_params, result);
-
- if (mobile_apis::Result::INVALID_ENUM != result_code) {
- SendResponse(result,
- result_code,
- info.empty() ? NULL : info.c_str(),
- response_params.empty() ? NULL : &response_params);
- return;
- }
-
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_DEBUG(
- logger_, hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- &msg_params,
- true);
-#endif // #ifdef HMI_DBUS_API
-}
-
-void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- if (hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData != event.id()) {
- LOG4CXX_ERROR(logger_, "Received unknown event.");
- return;
- }
-
- ApplicationSharedPtr app =
- application_manager_.application(CommandRequestImpl::connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
- }
-
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_DEBUG(logger_, "All HMI requests are complete");
- const bool result = any_arg_success;
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (result) {
- app->UpdateHash();
- }
- }
-#else
-
- hmi_apis::Common_Result::eType hmi_result =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- bool is_succeeded = result || !vi_already_subscribed_by_another_apps_.empty();
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result);
-
- if (is_succeeded) {
- if (!vi_already_subscribed_by_this_app_.empty()) {
- result_code = mobile_apis::Result::IGNORED;
- response_info = "Already subscribed on some provided VehicleData.";
- }
- }
-
- UnsubscribeFailedSubscriptions(app, message[strings::msg_params]);
-
- if (!vi_already_subscribed_by_another_apps_.empty() ||
- !vi_already_subscribed_by_this_app_.empty()) {
- AddAlreadySubscribedVI(
- const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
- }
-
- SendResponse(is_succeeded,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
-
- if (is_succeeded) {
- app->UpdateHash();
- }
-#endif // #ifdef HMI_DBUS_API
-}
-
-void SubscribeVehicleDataRequest::AddAlreadySubscribedVI(
- smart_objects::SmartObject& msg_params) const {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- VehicleInfoSubscriptions::const_iterator it_same_app =
- vi_already_subscribed_by_this_app_.begin();
- for (; vi_already_subscribed_by_this_app_.end() != it_same_app;
- ++it_same_app) {
- msg_params[*it_same_app][strings::result_code] =
- VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
- }
-
- VehicleInfoSubscriptions::const_iterator it_another_app =
- vi_already_subscribed_by_another_apps_.begin();
- for (; vi_already_subscribed_by_another_apps_.end() != it_another_app;
- ++it_another_app) {
- msg_params[*it_another_app][strings::result_code] =
- VehicleDataResultCode::VDRC_SUCCESS;
- }
-}
-
-void SubscribeVehicleDataRequest::UnsubscribeFailedSubscriptions(
- ApplicationSharedPtr app,
- const smart_objects::SmartObject& msg_params) const {
- LOG4CXX_AUTO_TRACE(logger_);
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (msg_params.keyExists(it->first)) {
- if (msg_params[it->first][strings::result_code].asInt() !=
- hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) {
- LOG4CXX_DEBUG(logger_,
- "Subscription for VehicleDataType "
- << it->first
- << " is unsuccessfull. "
- "Unsubscribing app with connection key "
- << connection_key() << " from it.");
- app->UnsubscribeFromIVI(it->second);
- }
- }
- }
-}
-
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
-};
-
-bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
- const uint32_t param_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- SubscribedToIVIPredicate finder(param_id);
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- return it != accessor.GetData().end();
-}
-
-void SubscribeVehicleDataRequest::CheckVISubscribtions(
- ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result) {
- // counter for items to subscribe
- VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
- // counter for subscribed items by application
- uint32_t subscribed_items = 0;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- HmiInterfaces::InterfaceState interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- const bool is_interface_not_available =
- interface_state == HmiInterfaces::STATE_NOT_AVAILABLE;
-
- for (; vehicle_data.end() != it; ++it) {
- const std::string& key_name = it->first;
- if ((*message_)[strings::msg_params].keyExists(key_name)) {
- const bool is_key_enabled =
- (*message_)[strings::msg_params][key_name].asBool();
- if (is_key_enabled) {
- ++items_to_subscribe;
- }
- if (!is_interface_not_available && is_key_enabled) {
- 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_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
deleted file mode 100644
index 7ed16407a5..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
-
-#include "application_manager/application_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace application_manager {
-namespace commands {
-
-SubscribeVehicleDataResponse::SubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {}
-
-void SubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
deleted file mode 100644
index 29cc8e6541..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeWayPointsRequest::SubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {}
-
-void SubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (application_manager_.IsAppSubscribedForWayPoints(app->app_id())) {
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- if (application_manager_.IsAnyAppSubscribedForWayPoints()) {
- application_manager_.SubscribeAppForWayPoints(app->app_id());
- SendResponse(true, mobile_apis::Result::SUCCESS);
- app->UpdateHash();
- return;
- }
-
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true);
-}
-
-void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event");
- 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,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- app->UpdateHash();
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc
deleted file mode 100644
index c2e642619a..0000000000
--- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/subscribe_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SubscribeWayPointsResponse::SubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {}
-
-void SubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc
deleted file mode 100644
index 74d25508e0..0000000000
--- a/src/components/application_manager/src/commands/mobile/system_request.cc
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
-
-Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/system_request.h"
-
-#include <vector>
-#include <string>
-#include <stdio.h>
-#include <algorithm>
-#include <sstream>
-#include "application_manager/policies/policy_handler_interface.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/file_system.h"
-#include "formatters/CFormatterJsonBase.h"
-#include "json/json.h"
-#include "utils/helpers.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-CREATE_LOGGERPTR_LOCAL(logger_, "ApplicationManager")
-namespace {
-
-#ifdef ENABLE_LOG
-const char* kQueryAppsValidationFailedPrefix =
- ":QUERY_APPS_VALIDATION_FAILED: ";
-#endif
-
-const unsigned int kVrSynonymLengthMax = 40U;
-const unsigned int kVrSynonymLengthMin = 1U;
-const unsigned int kTtsNameLengthMax = 500U;
-const unsigned int kVrArraySizeMax = 100U;
-const unsigned int kVrArraySizeMin = 1U;
-const unsigned int kUrlSchemaLengthMax = 255U;
-const unsigned int kPackageNameLengthMax = 255U;
-const unsigned int kAppIdLengthMax = 40U;
-const unsigned int kAppNameLengthMax = 100U;
-const unsigned int kLanguageArraySizeMax = 100U;
-
-class QueryAppsDataValidator {
- public:
- typedef std::set<std::string> SynonymsSet;
- typedef std::map<std::string, SynonymsSet> SynonymsMap;
-
- QueryAppsDataValidator(smart_objects::SmartObject& object,
- const ApplicationManager& manager)
- : data_(object), manager_(manager) {}
-
- bool Validate() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!data_.isValid()) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not valid.");
- return false;
- }
- if (!HasResponseKey()) {
- return false;
- }
- return ValidateAppDataAndOsAndLanguagesData();
- }
-
- private:
- bool HasResponseKey() const {
- if (!data_.keyExists(json::response)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response does not contain '"
- << json::response << "' parameter.");
- return false;
- }
- return true;
- }
-
- bool ValidateAppDataAndOsAndLanguagesData() {
- smart_objects::SmartArray* objects_array = data_[json::response].asArray();
-
- if (!objects_array) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not array.");
- return false;
- }
-
- SynonymsMap synonyms_map;
- bool has_response_valid_application = false;
-
- smart_objects::SmartArray::iterator applications_iterator =
- objects_array->begin();
-
- for (; applications_iterator != objects_array->end();
- ++applications_iterator) {
- const smart_objects::SmartObject& app_data = *applications_iterator;
-
- if (!app_data.isValid()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Wrong application data in json file.");
- return false;
- }
-
- if (!CheckMandatoryParametersPresent(app_data)) {
- LOG4CXX_WARN(logger_,
- "Application hasn`t some of mandatory parameters. "
- "Application will be skipped.");
- objects_array->erase(applications_iterator);
- continue;
- }
-
- if (!ValidateAppIdAndAppName(app_data)) {
- return false;
- }
-
- // If we dont have any of android/ios field
- // we skip this json in CheckMandatoryParametersPresent
- const std::string os_type =
- (app_data.keyExists(json::android)) ? json::android : json::ios;
-
- // Verify os and dependent languages data
- if (json::ios == os_type) {
- if (app_data[json::ios][json::urlScheme].asString().length() >
- kUrlSchemaLengthMax) {
- LOG4CXX_WARN(
- logger_,
- kQueryAppsValidationFailedPrefix
- << "An urlscheme length exceeds maximum allowed ["
- << app_data[json::ios][json::urlScheme].asString().length()
- << "]>[" << kUrlSchemaLengthMax << "]");
- return false;
- }
- }
-
- if (json::android == os_type) {
- if (app_data[json::android][json::packageName].asString().length() >
- kPackageNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Package name length ["
- << app_data[json::android][json::packageName]
- .asString()
- .length() << "] exceeds max length ["
- << kPackageNameLengthMax << "]in json file.");
- return false;
- }
- }
-
- // Languages verification
- if (!app_data[os_type].keyExists(json::languages)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages' doesn't exist");
- return false;
- }
- if (!ValidateLanguages(app_data[os_type][json::languages],
- synonyms_map)) {
- return false;
- }
- has_response_valid_application = true;
- }
- return has_response_valid_application;
- }
-
- bool ValidateAppIdAndAppName(const smart_objects::SmartObject& app_data) {
- // Verify appid length
- const std::string app_id(app_data[json::appId].asString());
- if (app_id.length() > kAppIdLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "An Object ID length exceeds maximum allowed ["
- << app_id.length() << "]>[" << kAppIdLengthMax << "]");
- return false;
- }
-
- // Verify that appid is unique
- if (applications_id_set_.find(app_id) != applications_id_set_.end()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "An Object ID is not unigue [" << app_id << "]");
- return false;
- }
- applications_id_set_.insert(app_id);
-
- // Verify that app is not registered yet
- ApplicationSharedPtr registered_app =
- manager_.application_by_policy_id(app_id);
- if (registered_app) {
- LOG4CXX_INFO(logger_,
- "Application with the id: " << app_id
- << " is already registered.");
- }
- // And app name length
- const std::string appName(app_data[json::name].asString());
- if (appName.length() > kAppNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "Name of application exceeds maximum allowed ["
- << appName.length() << "]>[" << kAppNameLengthMax
- << "].");
- return false;
- }
- return true;
- }
-
- bool ValidateLanguages(const smart_objects::SmartObject& languages,
- SynonymsMap& synonyms_map) const {
- bool default_language_found = false;
- const size_t languages_array_size = languages.length();
- if (languages_array_size > kLanguageArraySizeMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages' array exceeds max size ["
- << languages_array_size << "]>[" << kLanguageArraySizeMax
- << "]");
- return false;
- }
- // Every language has ttsname string and vrsynonyms array
- for (size_t idx = 0; idx < languages_array_size; ++idx) {
- const smart_objects::SmartObject& language = languages.getElement(idx);
- if (smart_objects::SmartType_Map != language.getType()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language is not a map.");
- return false;
- }
- if (language.length() != 1) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language map size is not equal 1.");
- return false;
- }
- const std::string language_name = (*language.map_begin()).first;
- if (!language_name.length()) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "language name is empty");
- return false;
- }
- // Verify default language defined
- if (!(language_name).compare(json::default_)) {
- default_language_found = true;
- }
- // Add set for synonyms' duplicates validation
- if (synonyms_map.find(language_name) == synonyms_map.end()) {
- synonyms_map[language_name] = SynonymsSet();
- }
- // ttsName verification
- if (!language[language_name].keyExists(json::ttsName)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages.ttsName' doesn't exist");
- return false;
- }
- const smart_objects::SmartObject& ttsNameObject =
- language[language_name][json::ttsName];
- // ttsName is string
- if (smart_objects::SmartType_String == ttsNameObject.getType()) {
- const std::string ttsName =
- language[language_name][json::ttsName].asString();
- if (ttsName.length() > kTtsNameLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "ttsName string exceeds max length ["
- << ttsName.length() << "]>[" << kTtsNameLengthMax
- << "]");
- return false;
- }
- } else {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "ttsName is not the string type.");
- return false;
- }
-
- if (!ValidateSynonymsAtLanguage(language, language_name, synonyms_map)) {
- return false;
- }
- }
- if (!default_language_found) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << " 'languages'.default' doesn't exist");
- return false;
- }
- return true;
- }
-
- bool ValidateSynonymsAtLanguage(const smart_objects::SmartObject& language,
- const std::string& language_name,
- SynonymsMap& synonyms_map) const {
- if (!language[language_name].keyExists(json::vrSynonyms)) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "'languages.vrSynonyms' doesn't exist");
- return false;
- }
- const smart_objects::SmartArray* synonyms_array =
- language[language_name][json::vrSynonyms].asArray();
- if (!synonyms_array) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynonyms is not array.");
- return false;
- }
- const size_t synonyms_array_size = synonyms_array->size();
- if (synonyms_array_size < kVrArraySizeMin) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynomyms array has [" << synonyms_array_size
- << "] size < allowed min size [" << kVrArraySizeMin
- << "]");
- return false;
- }
- if (synonyms_array_size > kVrArraySizeMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSynomyms array size [" << synonyms_array_size
- << "] exceeds maximum allowed size [" << kVrArraySizeMax
- << "]");
- return false;
- }
-
- for (std::size_t idx = 0; idx < synonyms_array_size; ++idx) {
- const smart_objects::SmartObject& synonym = (*synonyms_array)[idx];
- const std::string vrSynonym = synonym.asString();
- if (vrSynonym.length() > kVrSynonymLengthMax) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item [" << idx
- << "] exceeds max length [" << vrSynonym.length()
- << "]>[" << kVrSynonymLengthMax << "]");
- return false;
- }
- if (vrSynonym.length() < kVrSynonymLengthMin) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item [" << idx << "] length ["
- << vrSynonym.length() << "] is less then min length ["
- << kVrSynonymLengthMin << "] allowed.");
- return false;
- }
- // Verify duplicates
- SynonymsMap::iterator synonyms_map_iter =
- synonyms_map.find(language_name);
- if (synonyms_map_iter != synonyms_map.end()) {
- if (!(*synonyms_map_iter).second.insert(vrSynonym).second) {
- LOG4CXX_WARN(logger_,
- kQueryAppsValidationFailedPrefix
- << "vrSYnomym item already defined ["
- << vrSynonym.c_str() << "] for language ["
- << language_name << "]");
- return false;
- }
- }
- }
- return true;
- }
-
- bool CheckMandatoryParametersPresent(
- const smart_objects::SmartObject& app_data) const {
- if (!app_data.keyExists(json::android) && !app_data.keyExists(json::ios)) {
- return false;
- }
-
- if (app_data.keyExists(json::android) &&
- !app_data[json::android].keyExists(json::packageName)) {
- return false;
- }
-
- if (app_data.keyExists(json::ios) &&
- !app_data[json::ios].keyExists(json::urlScheme)) {
- return false;
- }
-
- if (!app_data.keyExists(json::appId)) {
- return false;
- }
-
- if (!app_data.keyExists(json::name)) {
- return false;
- }
-
- return true;
- }
-
- smart_objects::SmartObject& data_;
- std::set<std::string> applications_id_set_;
- const ApplicationManager& manager_;
-
- DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator);
-};
-}
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-uint32_t SystemRequest::index = 0;
-
-const std::string kSYNC = "SYNC";
-const std::string kIVSU = "IVSU";
-
-SystemRequest::SystemRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-SystemRequest::~SystemRequest() {}
-
-void SystemRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!(application.valid())) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const mobile_apis::RequestType::eType request_type =
- static_cast<mobile_apis::RequestType::eType>(
- (*message_)[strings::msg_params][strings::request_type].asInt());
-
- const policy::PolicyHandlerInterface& policy_handler =
- application_manager_.GetPolicyHandler();
- if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(),
- request_type)) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- return;
- }
-
- std::string file_name;
- if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
- file_name = (*message_)[strings::msg_params][strings::file_name].asString();
- } else {
- file_name = kSYNC;
- }
-
- bool is_system_file = std::string::npos != file_name.find(kSYNC) ||
- std::string::npos != file_name.find(kIVSU);
-
- // to avoid override existing file
- if (is_system_file) {
- const uint8_t max_size = 255;
- char buf[max_size] = {'\0'};
- snprintf(buf, max_size - 1, "%d%s", index++, file_name.c_str());
- file_name = buf;
- }
-
- std::vector<uint8_t> binary_data;
- std::string binary_data_folder;
- if ((*message_)[strings::params].keyExists(strings::binary_data)) {
- binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
- binary_data_folder =
- application_manager_.get_settings().system_files_path();
- } else {
- binary_data_folder =
- application_manager_.get_settings().app_storage_folder();
- binary_data_folder += "/";
- binary_data_folder += application->folder_name();
- binary_data_folder += "/";
- }
-
- std::string file_dst_path =
- application_manager_.get_settings().system_files_path();
- file_dst_path += "/";
- file_dst_path += file_name;
-
- if ((*message_)[strings::params].keyExists(strings::binary_data)) {
- LOG4CXX_DEBUG(
- logger_,
- "Binary data is present. Trying to save it to: " << binary_data_folder);
- if (mobile_apis::Result::SUCCESS !=
- (application_manager_.SaveBinary(
- binary_data, binary_data_folder, file_name, 0))) {
- LOG4CXX_DEBUG(logger_, "Binary data can't be saved.");
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- return;
- }
- } else {
- std::string app_full_file_path = binary_data_folder;
- app_full_file_path += file_name;
-
- LOG4CXX_DEBUG(logger_,
- "Binary data is not present. Trying to find file "
- << file_name << " within previously saved app file in "
- << binary_data_folder);
-
- const AppFile* file = application->GetFile(app_full_file_path);
- if (!file || !file->is_download_complete ||
- !file_system::MoveFile(app_full_file_path, file_dst_path)) {
- LOG4CXX_DEBUG(logger_, "Binary data not found.");
-
- std::string origin_file_name;
- if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
- origin_file_name =
- (*message_)[strings::msg_params][strings::file_name].asString();
- }
- if (!(mobile_apis::RequestType::HTTP == request_type &&
- 0 == origin_file_name.compare(kIVSU))) {
- LOG4CXX_DEBUG(logger_, "Binary data required. Invalid data");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- LOG4CXX_DEBUG(logger_, "IVSU does not require binary data. Continue");
- }
- processing_file_ = file_dst_path;
- }
-
- LOG4CXX_DEBUG(logger_, "Binary data ok.");
-
- if (mobile_apis::RequestType::HTTP == request_type &&
- (*message_)[strings::msg_params].keyExists(strings::file_name)) {
- const std::string& file =
- (*message_)[strings::msg_params][strings::file_name].asString();
- application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file,
- binary_data);
- SendResponse(true, mobile_apis::Result::SUCCESS);
- return;
- } else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
- using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-
- smart_objects::SmartObject sm_object;
- Json::Reader reader;
- std::string json(binary_data.begin(), binary_data.end());
- Json::Value root;
- if (!reader.parse(json.c_str(), root)) {
- LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file.");
- return;
- }
-
- CFormatterJsonBase::jsonValueToObj(root, sm_object);
- if (!ValidateQueryAppData(sm_object)) {
- SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
- return;
- }
-
- application_manager_.ProcessQueryApp(sm_object, connection_key());
- SendResponse(true, mobile_apis::Result::SUCCESS);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- if (std::string::npos != file_name.find(kIVSU)) {
- msg_params[strings::file_name] = file_name;
- } else {
- msg_params[strings::file_name] = file_dst_path;
- }
-
- // expected int, mandatory=true, all Policies flow (HTTP,Proprietary,External)
- msg_params[strings::app_id] = application->hmi_app_id();
-
- msg_params[strings::request_type] =
- (*message_)[strings::msg_params][strings::request_type];
- SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- &msg_params,
- true);
-}
-
-void SystemRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
- mobile_apis::Result::eType result_code =
- GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asUInt()));
-
- const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
- result_code,
- mobile_api::Result::SUCCESS,
- mobile_api::Result::WARNINGS);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
- if (!(application.valid())) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
-
- if (!processing_file_.empty()) {
- file_system::DeleteFile(processing_file_);
- processing_file_.clear();
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-bool SystemRequest::ValidateQueryAppData(
- smart_objects::SmartObject& data) const {
- if (!data.isValid()) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response is not valid.");
- return false;
- }
- if (!data.keyExists(json::response)) {
- LOG4CXX_ERROR(logger_,
- kQueryAppsValidationFailedPrefix
- << "QueryApps response does not contain '"
- << json::response << "' parameter.");
- return false;
- }
-
- QueryAppsDataValidator validator(data, application_manager_);
- return validator.Validate();
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_response.cc b/src/components/application_manager/src/commands/mobile/system_response.cc
deleted file mode 100644
index f5bc03f4a5..0000000000
--- a/src/components/application_manager/src/commands/mobile/system_response.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/system_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SystemResponse::SystemResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-SystemResponse::~SystemResponse() {}
-
-void SystemResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
deleted file mode 100644
index d7056a624e..0000000000
--- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void UnregisterAppInterfaceRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!application_manager_.application(connection_key())) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- connection_key(),
- mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
- commands::Command::ORIGIN_SDL);
- application_manager_.UnregisterApplication(connection_key(),
- mobile_apis::Result::SUCCESS);
- SendResponse(true, mobile_apis::Result::SUCCESS);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
deleted file mode 100644
index 49d9276d35..0000000000
--- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unregister_app_interface_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-void UnregisterAppInterfaceResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendResponse((*message_)[strings::msg_params][strings::success].asBool());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
deleted file mode 100644
index e1bdba61a0..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_button_request.h"
-
-#include "application_manager/application_impl.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace str = strings;
-
-UnsubscribeButtonRequest::UnsubscribeButtonRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {}
-
-void UnsubscribeButtonRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const uint32_t btn_id =
- (*message_)[str::msg_params][str::button_name].asUInt();
-
- if (!app->UnsubscribeFromButton(
- static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
- LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id);
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- SendUnsubscribeButtonNotification();
- SendResponse(true, mobile_apis::Result::SUCCESS);
- app->UpdateHash();
-}
-
-void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
- using namespace smart_objects;
- using namespace hmi_apis;
-
- // send OnButtonSubscription notification
- SmartObject msg_params = SmartObject(SmartType_Map);
- msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = static_cast<Common_ButtonName::eType>(
- (*message_)[strings::msg_params][strings::button_name].asUInt());
- msg_params[strings::is_suscribed] = false;
- CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
deleted file mode 100644
index 9ac98a27f7..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_button_response.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnsubscribeButtonResponse::UnsubscribeButtonResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
-
-void UnsubscribeButtonResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
deleted file mode 100644
index 9b0c0a673f..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-
- Copyright (c) 2017, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/command_impl.h"
-
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "utils/helpers.h"
-
-namespace application_manager {
-namespace commands {
-
-UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
-
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
-void UnsubscribeVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- int32_t items_to_unsubscribe = 0;
- int32_t unsubscribed_items = 0;
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- smart_objects::SmartObject response_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- for (; vehicle_data.end() != it; ++it) {
- const std::string& key_name = it->first;
- if ((*message_)[strings::msg_params].keyExists(key_name)) {
- bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
- if (is_key_enabled) {
- ++items_to_unsubscribe;
-
- VehicleDataType key_type = it->second;
- if (!app->IsSubscribedToIVI(key_type)) {
- ++unsubscribed_items;
- vi_already_unsubscribed_by_this_app_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
- continue;
- }
-
- if (!app->UnsubscribeFromIVI(static_cast<uint32_t>(key_type))) {
- LOG4CXX_ERROR(logger_,
- "Unable to unsubscribe from "
- "VehicleDataType: "
- << key_type);
- continue;
- }
-
- LOG4CXX_DEBUG(logger_,
- "Unsubscribed app with connection key "
- << connection_key()
- << " from VehicleDataType: " << key_type);
-
- ++unsubscribed_items;
-
- if (IsSomeoneSubscribedFor(key_type)) {
- LOG4CXX_DEBUG(logger_,
- "There are another apps still subscribed for "
- "VehicleDataType: "
- << key_type);
-
- vi_still_subscribed_by_another_apps_.insert(key_type);
- response_params[key_name][strings::data_type] = key_type;
- response_params[key_name][strings::result_code] =
- mobile_apis::VehicleDataResultCode::VDRC_SUCCESS;
- continue;
- }
-
- msg_params[key_name] = is_key_enabled;
- }
- }
- }
-
- bool is_everything_already_unsubscribed =
- static_cast<uint32_t>(items_to_unsubscribe) ==
- vi_still_subscribed_by_another_apps_.size() +
- vi_already_unsubscribed_by_this_app_.size();
-
- if (0 == items_to_unsubscribe) {
- if (HasDisallowedParams()) {
- SendResponse(false, mobile_apis::Result::DISALLOWED);
- } else {
- SendResponse(
- false, mobile_apis::Result::INVALID_DATA, "No data in the request.");
- }
- return;
- }
-
- if (0 == unsubscribed_items) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Was not subscribed on any VehicleData.",
- &response_params);
- return;
- }
-
- if (is_everything_already_unsubscribed) {
- if (!vi_already_unsubscribed_by_this_app_.empty()) {
- SendResponse(false,
- mobile_apis::Result::IGNORED,
- "Some provided VehicleData was not subscribed.",
- &response_params);
- } else {
- SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
- }
- return;
- }
-
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
- SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- &msg_params,
- true);
-#endif // #ifdef HMI_DBUS_API
-}
-
-void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- if (hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData != event.id()) {
- LOG4CXX_ERROR(logger_, "Received unknown event.");
- return;
- }
-
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
-
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- if (true == any_arg_success) {
- SetAllowedToTerminate(false);
- }
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (true == any_arg_success) {
- UpdateHash();
- }
- }
-#else
- hmi_apis::Common_Result::eType hmi_result =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- hmi_result, HmiInterfaces::HMI_INTERFACE_VehicleInfo);
-
- mobile_apis::Result::eType result_code =
- MessageHelper::HMIToMobileResult(hmi_result);
-
- if (result) {
- if (vi_already_unsubscribed_by_this_app_.size()) {
- result_code = mobile_apis::Result::IGNORED;
- response_info = "Some provided VehicleData was not subscribed.";
- }
- }
-
- if (!vi_still_subscribed_by_another_apps_.empty() ||
- !vi_already_unsubscribed_by_this_app_.empty()) {
- AddAlreadyUnsubscribedVI(
- const_cast<smart_objects::SmartObject&>(message[strings::msg_params]));
- }
-
- if (result) {
- SetAllowedToTerminate(false);
- }
- SendResponse(result,
- result_code,
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- UpdateHash();
- }
-#endif // #ifdef HMI_DBUS_API
-}
-
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
- bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
- }
-};
-
-bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
- const uint32_t param_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- SubscribedToIVIPredicate finder(param_id);
- DataAccessor<ApplicationSet> accessor = application_manager_.applications();
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- return it != accessor.GetData().end();
-}
-
-void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
- smart_objects::SmartObject& response) const {
- LOG4CXX_AUTO_TRACE(logger_);
- using namespace mobile_apis;
- VehicleInfoSubscriptions::const_iterator it_same_app =
- vi_already_unsubscribed_by_this_app_.begin();
- for (; vi_already_unsubscribed_by_this_app_.end() != it_same_app;
- ++it_same_app) {
- response[*it_same_app][strings::result_code] =
- VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
- }
-
- VehicleInfoSubscriptions::const_iterator it_another_app =
- vi_still_subscribed_by_another_apps_.begin();
- for (; vi_still_subscribed_by_another_apps_.end() != it_another_app;
- ++it_another_app) {
- response[*it_another_app][strings::result_code] =
- VehicleDataResultCode::VDRC_SUCCESS;
- }
-}
-
-void UnsubscribeVehicleDataRequest::UpdateHash() const {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (application) {
- application->UpdateHash();
- } else {
- LOG4CXX_ERROR(logger_,
- "Application with connection_key = " << connection_key()
- << " doesn't exist.");
- }
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
deleted file mode 100644
index 986256d377..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include "smart_objects/smart_object.h"
-
-namespace application_manager {
-namespace commands {
-
-UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {}
-
-void UnsubscribeVehicleDataResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- // check if response false
- if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
- if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
- LOG4CXX_ERROR(logger_, "Success = false");
- SendResponse(false);
- return;
- }
- }
-
- // TODO(DK): Some logic
- SendResponse(true);
-}
-
-} // namespace commands
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
deleted file mode 100644
index 728209fcf2..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_request.h"
-#include "application_manager/message_helper.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnSubscribeWayPointsRequest::UnSubscribeWayPointsRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UnSubscribeWayPointsRequest::~UnSubscribeWayPointsRequest() {}
-
-void UnSubscribeWayPointsRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_,
- "An application with connection key "
- << connection_key() << " is not registered.");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- if (!application_manager_.IsAppSubscribedForWayPoints(app->app_id())) {
- SendResponse(false, mobile_apis::Result::IGNORED);
- return;
- }
-
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
-}
-
-void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application_manager_.application(connection_key());
- const smart_objects::SmartObject& message = event.smart_object();
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event");
- 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,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- if (result) {
- app->UpdateHash();
- }
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc
deleted file mode 100644
index f6430d1f0d..0000000000
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "application_manager/application_manager.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {}
-
-void UnsubscribeWayPointsResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
deleted file mode 100644
index becab175e9..0000000000
--- a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/application_impl.h"
-#include "application_manager/message_helper.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/custom_string.h"
-
-namespace application_manager {
-
-namespace commands {
-
-namespace custom_str = utils::custom_string;
-
-UpdateTurnListRequest::UpdateTurnListRequest(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
-
-UpdateTurnListRequest::~UpdateTurnListRequest() {}
-
-void UpdateTurnListRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::params][strings::connection_key].asUInt());
-
- if (!app) {
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- LOG4CXX_ERROR(logger_, "Application is not registered");
- return;
- }
-
- if (IsWhiteSpaceExist()) {
- LOG4CXX_ERROR(logger_,
- "Incoming update turn list has contains \t\n \\t \\n");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- // ProcessSoftButtons checks strings on the contents incorrect character
-
- mobile_apis::Result::eType processing_result =
- MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params],
- app,
- application_manager_.GetPolicyHandler(),
- application_manager_);
-
- if (mobile_apis::Result::SUCCESS != processing_result) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, processing_result);
- return;
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- smart_objects::SmartObject& turn_list_array =
- ((*message_)[strings::msg_params][strings::turn_list]);
- for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
- if ((turn_list_array[i].keyExists(strings::turn_icon)) &&
- (mobile_apis::Result::SUCCESS !=
- MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon],
- app,
- application_manager_))) {
- LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifyImage return INVALID_DATA");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params = (*message_)[strings::msg_params];
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- if (!CheckTurnListArray()) {
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- for (uint32_t i = 0; i < msg_params[strings::turn_list].length(); ++i) {
- if (msg_params[strings::turn_list][i].keyExists(hmi_request::navi_text)) {
- const custom_str::CustomString& navigation_text =
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- .asCustomString();
- msg_params[strings::turn_list][i].erase(hmi_request::navi_text);
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- [hmi_request::field_name] = static_cast<int>(
- hmi_apis::Common_TextFieldName::turnText);
- msg_params[strings::turn_list][i][hmi_request::navi_text]
- [hmi_request::field_text] = navigation_text;
- }
- }
- }
-
- msg_params[strings::app_id] = app->app_id();
-
- if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- MessageHelper::SubscribeApplicationToSoftButton(
- (*message_)[strings::msg_params], app, function_id());
- }
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
- (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- SendHMIRequest(
- hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true);
- } else {
- // conditional mandatory
- LOG4CXX_ERROR(logger_, "INVALID_DATA!");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- }
-}
-
-void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
- LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
-
- const hmi_apis::Common_Result::eType result_code =
- static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- std::string response_info;
- GetInfo(message, response_info);
- const bool result = PrepareResultForMobileResponse(
- result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
- SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
- response_info.empty() ? NULL : response_info.c_str(),
- &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- break;
- }
- }
-}
-
-bool UpdateTurnListRequest::CheckTurnListArray() {
- int32_t length =
- (*message_)[strings::msg_params][strings::turn_list].length();
- if (0 == length) {
- return false;
- }
-
- for (int32_t i = 0; i < length; ++i) {
- if (!((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
- hmi_request::navi_text)) &&
- !((*message_)[strings::msg_params][strings::turn_list][i].keyExists(
- strings::turn_icon))) {
- return false;
- }
- }
- return true;
-}
-
-bool UpdateTurnListRequest::IsWhiteSpaceExist() {
- LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
-
- if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
- const smart_objects::SmartArray* tl_array =
- (*message_)[strings::msg_params][strings::turn_list].asArray();
-
- smart_objects::SmartArray::const_iterator it_tl = tl_array->begin();
- smart_objects::SmartArray::const_iterator it_tl_end = tl_array->end();
-
- for (; it_tl != it_tl_end; ++it_tl) {
- if ((*it_tl).keyExists(strings::navigation_text)) {
- str = (*it_tl)[strings::navigation_text].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_,
- "Invalid turn_list navigation_text text syntax check failed");
- return true;
- }
- }
-
- if ((*it_tl).keyExists(strings::turn_icon)) {
- str = (*it_tl)[strings::turn_icon][strings::value].asCharArray();
- if (!CheckSyntax(str)) {
- LOG4CXX_ERROR(
- logger_, "Invalid turn_list turn_icon value syntax check failed");
- return true;
- }
- }
- }
- }
- return false;
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
deleted file mode 100644
index d40a4546fc..0000000000
--- a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/update_turn_list_response.h"
-
-#include "interfaces/HMI_API.h"
-
-namespace application_manager {
-
-namespace commands {
-
-UpdateTurnListResponse::UpdateTurnListResponse(
- const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandResponseImpl(message, application_manager) {}
-
-UpdateTurnListResponse::~UpdateTurnListResponse() {}
-
-void UpdateTurnListResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc
new file mode 100644
index 0000000000..75e49b180e
--- /dev/null
+++ b/src/components/application_manager/src/commands/notification_from_hmi.cc
@@ -0,0 +1,111 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/notification_from_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationFromHMI::NotificationFromHMI(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+NotificationFromHMI::~NotificationFromHMI() {}
+
+bool NotificationFromHMI::Init() {
+ return true;
+}
+
+bool NotificationFromHMI::CleanUp() {
+ return true;
+}
+
+void NotificationFromHMI::Run() {}
+
+void NotificationFromHMI::SendNotificationToMobile(
+ const MessageSharedPtr& message) {
+ (*message)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
+}
+
+void NotificationFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ =
+ application_manager_.GetNextHMICorrelationID();
+
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kRequest);
+ request[strings::params][strings::function_id] =
+ static_cast<int32_t>(function_id);
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!rpc_service_.ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/notification_to_hmi.cc b/src/components/application_manager/src/commands/notification_to_hmi.cc
new file mode 100644
index 0000000000..2e5f54e950
--- /dev/null
+++ b/src/components/application_manager/src/commands/notification_to_hmi.cc
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/notification_to_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationToHMI::NotificationToHMI(
+ const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+NotificationToHMI::~NotificationToHMI() {}
+
+bool NotificationToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool NotificationToHMI::CleanUp() {
+ return true;
+}
+
+void NotificationToHMI::Run() {}
+
+void NotificationToHMI::SendNotification() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc
new file mode 100644
index 0000000000..ff760c2d2a
--- /dev/null
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -0,0 +1,115 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/request_from_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
+ , EventObserver(application_manager.event_dispatcher()) {
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+RequestFromHMI::~RequestFromHMI() {}
+
+bool RequestFromHMI::Init() {
+ return true;
+}
+
+bool RequestFromHMI::CleanUp() {
+ return true;
+}
+
+void RequestFromHMI::Run() {}
+
+void RequestFromHMI::on_event(const event_engine::Event& event) {}
+
+void RequestFromHMI::SendResponse(
+ const bool success,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code) {
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message)[strings::params][hmi_response::code] = 0;
+ (*message)[strings::msg_params][strings::success] = success;
+ (*message)[strings::msg_params][strings::result_code] = result_code;
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+void RequestFromHMI::SendErrorResponse(
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message) {
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kErrorResponse;
+ (*message)[strings::params][hmi_response::code] = result_code;
+ (*message)[strings::params][strings::error_msg] = error_message;
+
+ rpc_service_.ManageHMICommand(message);
+}
+
+void RequestFromHMI::FillCommonParametersOfSO(
+ smart_objects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id) {
+ (message)[strings::params][strings::function_id] = function_id;
+ (message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (message)[strings::params][strings::protocol_version] = protocol_version_;
+ (message)[strings::params][strings::correlation_id] = correlation_id;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/request_to_hmi.cc b/src/components/application_manager/src/commands/request_to_hmi.cc
new file mode 100644
index 0000000000..1acbc9ace7
--- /dev/null
+++ b/src/components/application_manager/src/commands/request_to_hmi.cc
@@ -0,0 +1,97 @@
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/request_to_hmi.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+bool CheckAvailabilityHMIInterfaces(ApplicationManager& application_manager,
+ HmiInterfaces::InterfaceID interface) {
+ const HmiInterfaces::InterfaceState state =
+ application_manager.hmi_interfaces().GetInterfaceState(interface);
+ return HmiInterfaces::STATE_NOT_AVAILABLE != state;
+}
+
+bool ChangeInterfaceState(ApplicationManager& application_manager,
+ const smart_objects::SmartObject& response_from_hmi,
+ HmiInterfaces::InterfaceID interface) {
+ if (response_from_hmi[strings::msg_params].keyExists(strings::available)) {
+ const bool is_available =
+ response_from_hmi[strings::msg_params][strings::available].asBool();
+ const HmiInterfaces::InterfaceState interface_state =
+ is_available ? HmiInterfaces::STATE_AVAILABLE
+ : HmiInterfaces::STATE_NOT_AVAILABLE;
+ application_manager.hmi_interfaces().SetInterfaceState(interface,
+ interface_state);
+ return is_available;
+ }
+ return false;
+}
+
+RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
+
+RequestToHMI::~RequestToHMI() {}
+
+bool RequestToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool RequestToHMI::CleanUp() {
+ return true;
+}
+
+void RequestToHMI::Run() {
+ SendRequest();
+}
+
+void RequestToHMI::SendRequest() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc
new file mode 100644
index 0000000000..c88b14bf9c
--- /dev/null
+++ b/src/components/application_manager/src/commands/response_from_hmi.cc
@@ -0,0 +1,114 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/response_from_hmi.h"
+#include "application_manager/rpc_service.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {
+ // If it is error response, shift info
+ if ((*message)[strings::params].keyExists(hmi_response::message)) {
+ (*message)[strings::msg_params][strings::info] =
+ (*message)[strings::params][hmi_response::message];
+ }
+
+ // Replace HMI app id with Mobile connection id
+ ReplaceHMIWithMobileAppId(*message);
+}
+
+ResponseFromHMI::~ResponseFromHMI() {}
+
+bool ResponseFromHMI::Init() {
+ return true;
+}
+
+bool ResponseFromHMI::CleanUp() {
+ return true;
+}
+
+void ResponseFromHMI::Run() {}
+
+void ResponseFromHMI::SendResponseToMobile(
+ const MessageSharedPtr& message, ApplicationManager& application_manager) {
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+
+ rpc_service_.ManageMobileCommand(message, SOURCE_SDL);
+}
+
+void ResponseFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ =
+ application_manager_.GetNextHMICorrelationID();
+
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!rpc_service_.ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/response_to_hmi.cc b/src/components/application_manager/src/commands/response_to_hmi.cc
new file mode 100644
index 0000000000..01a2ec789e
--- /dev/null
+++ b/src/components/application_manager/src/commands/response_to_hmi.cc
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/response_to_hmi.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handle)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handle) {}
+
+ResponseToHMI::~ResponseToHMI() {}
+
+bool ResponseToHMI::Init() {
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
+}
+
+bool ResponseToHMI::CleanUp() {
+ return true;
+}
+
+void ResponseToHMI::Run() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ rpc_service_.SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
index f8b8bc791d..f1e5bf9735 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
@@ -39,14 +39,15 @@ namespace application_manager {
namespace event_engine {
using namespace sync_primitives;
-EventDispatcherImpl::EventDispatcherImpl()
- : state_lock_(false), observer_lock_(true), observers_event_() {}
+EventDispatcherImpl::EventDispatcherImpl() : observers_event_() {}
EventDispatcherImpl::~EventDispatcherImpl() {}
void EventDispatcherImpl::raise_event(const Event& event) {
+ AutoLock observer_lock(observer_lock_);
{
- AutoLock auto_lock(state_lock_);
+ AutoLock state_lock(state_lock_);
+
// check if event is notification
if (hmi_apis::messageType::notification == event.smart_object_type()) {
const uint32_t notification_correlation_id = 0;
@@ -61,11 +62,10 @@ void EventDispatcherImpl::raise_event(const Event& event) {
}
// Call observers
- EventObserver* temp;
while (!observers_.empty()) {
- AutoLock auto_lock(observer_lock_);
- temp = *observers_.begin();
+ EventObserver* temp = *observers_.begin();
observers_.erase(observers_.begin());
+ AutoUnlock unlock_observer(observer_lock);
temp->on_event(event);
}
}
diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc
new file mode 100644
index 0000000000..016e09635b
--- /dev/null
+++ b/src/components/application_manager/src/help_prompt_manager_impl.cc
@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "application_manager/help_prompt_manager_impl.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl")
+
+namespace {
+const size_t kLimitCommand = 30;
+}
+
+namespace application_manager {
+
+HelpPromptManagerImpl::HelpPromptManagerImpl(Application& app,
+ ApplicationManager& app_manager)
+ : app_(app)
+ , app_manager_(app_manager)
+ , sending_type_(SendingType::kSendBoth)
+ , is_tts_send_(false)
+ , is_ui_send_(false) {}
+
+HelpPromptManagerImpl::~HelpPromptManagerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool HelpPromptManagerImpl::AddCommand(
+ const uint32_t cmd_id, const smart_objects::SmartObject& command) {
+ if (!command.keyExists(strings::vr_commands)) {
+ LOG4CXX_DEBUG(logger_, "vr_commands does`t present");
+ return false;
+ }
+
+ const smart_objects::SmartObject& commands = command[strings::vr_commands];
+ if (commands.empty()) {
+ LOG4CXX_DEBUG(logger_, "vr_commands array is empty");
+ return false;
+ }
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() != it) {
+ LOG4CXX_DEBUG(logger_, "Command with id:" << cmd_id << " already exists");
+ return false;
+ }
+
+ const bool limit_exceeded =
+ kLimitCommand <= GetCommandsCount(vr_commands_.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Will be added first command from array "
+ << strings::vr_commands);
+
+ smart_objects::SmartObjectSPtr vr_item =
+ std::make_shared<smart_objects::SmartObject>(commands.asArray()->front());
+ vr_commands_.push_back(std::make_pair(cmd_id, vr_item));
+
+ LOG4CXX_DEBUG(logger_,
+ "VR command with id: " << cmd_id << " added for appID: "
+ << app_.app_id() << ". Total "
+ << vr_commands_.size() << " in cache");
+
+ return !limit_exceeded;
+}
+
+bool HelpPromptManagerImpl::DeleteCommand(const uint32_t cmd_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() == it) {
+ LOG4CXX_WARN(logger_, "VR command with id: " << cmd_id << " not found");
+ return false;
+ }
+
+ const size_t commands_before_current = GetCommandsCount(it);
+ vr_commands_.erase(it);
+ LOG4CXX_DEBUG(logger_,
+ "VR command with id: "
+ << cmd_id << " found after " << commands_before_current
+ << " commands was deleted for appID: " << app_.app_id()
+ << " Cache size after deleting: " << vr_commands_.size());
+
+ return commands_before_current < kLimitCommand;
+}
+
+void HelpPromptManagerImpl::OnVrCommandAdded(
+ const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be added");
+ return;
+ }
+ if (AddCommand(cmd_id, command) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be deleted");
+ return;
+ }
+ if (DeleteCommand(cmd_id) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ " do not track SetGlobalProperties");
+ return;
+ }
+
+ if (!is_response) {
+ if (msg.keyExists(strings::help_prompt)) {
+ is_tts_send_ = true;
+ }
+ if (msg.keyExists(strings::vr_help)) {
+ is_ui_send_ = true;
+ }
+
+ LOG4CXX_DEBUG(logger_, "is_tts_send_:" << is_tts_send_);
+ LOG4CXX_DEBUG(logger_, "is_ui_send_:" << is_ui_send_);
+ return;
+ }
+
+ SetSendingType(msg);
+}
+
+HelpPromptManagerImpl::SendingType HelpPromptManagerImpl::GetSendingType()
+ const {
+ return sending_type_;
+}
+
+size_t HelpPromptManagerImpl::GetCommandsCount(
+ VRCommandPairs::const_iterator end_element) const {
+ return std::distance(vr_commands_.begin(), end_element);
+}
+
+void HelpPromptManagerImpl::GenerateVrItems(
+ smart_objects::SmartObject& out_msg_params, const char* vr_key) const {
+ out_msg_params[vr_key] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ const size_t count_to_add = std::min(vr_commands_.size(), kLimitCommand);
+ for (size_t i = 0; i < count_to_add; ++i) {
+ const VRCommandPair& pair = vr_commands_[i];
+
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = pair.second->asString();
+ if (strings::help_prompt == vr_key) {
+ item[strings::type] = mobile_apis::SpeechCapabilities::SC_TEXT;
+ } else {
+ item[strings::position] = i + 1;
+ }
+
+ out_msg_params[vr_key][i] = item;
+ }
+}
+
+void HelpPromptManagerImpl::SendTTSRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "TTS request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr tts_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (tts_global_properties) {
+ smart_objects::SmartObject& ref = *tts_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *tts_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::TTS_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreatePromptMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(tts_global_properties);
+ }
+ is_tts_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendUIRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "UI request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr ui_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (ui_global_properties) {
+ smart_objects::SmartObject& ref = *ui_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *ui_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreateVRMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(ui_global_properties);
+ }
+ is_ui_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendBothRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendTTSRequest();
+ SendUIRequest();
+}
+
+void HelpPromptManagerImpl::SendRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ switch (sending_type_) {
+ case SendingType::kSendHelpPrompt:
+ SendTTSRequest();
+ return;
+ case SendingType::kSendVRHelp:
+ SendUIRequest();
+ return;
+ case SendingType::kSendBoth:
+ SendBothRequests();
+ return;
+ case SendingType::kNoneSend:
+ break;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "SendingType:" << static_cast<uint32_t>(sending_type_)
+ << " request not sending");
+}
+
+void HelpPromptManagerImpl::CreatePromptMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GenerateVrItems(out_msg_params, strings::help_prompt);
+ app_.set_help_prompt(out_msg_params[strings::help_prompt]);
+}
+
+void HelpPromptManagerImpl::CreateVRMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (false == out_msg_params.keyExists(strings::vr_help_title)) {
+ if (app_.vr_help_title()) {
+ out_msg_params[strings::vr_help_title] = (*app_.vr_help_title());
+ } else {
+ out_msg_params[strings::vr_help_title] = app_.name();
+ }
+ }
+
+ GenerateVrItems(out_msg_params, strings::vr_help);
+
+ if (out_msg_params[strings::vr_help].empty()) {
+ out_msg_params.erase(strings::vr_help);
+ app_.reset_vr_help();
+ } else {
+ app_.set_vr_help(out_msg_params[strings::vr_help]);
+ }
+}
+
+void HelpPromptManagerImpl::SetSendingType(
+ const smart_objects::SmartObject& msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ hmi_apis::Common_Result::eType result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ msg[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_, "HMI response result:" << result);
+ if (hmi_apis::Common_Result::eType::SUCCESS == result) {
+ hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ msg[strings::params][strings::function_id].asUInt());
+ LOG4CXX_DEBUG(logger_, "Function id:" << function_id);
+ switch (function_id) {
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ if (is_tts_send_) {
+ is_tts_send_ = false;
+ sending_type_ = SendingType::kSendHelpPrompt == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendVRHelp;
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ if (is_ui_send_) {
+ is_ui_send_ = false;
+ sending_type_ = SendingType::kSendVRHelp == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendHelpPrompt;
+ }
+ break;
+ }
+ default: { break; }
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "Sending type set to:" << static_cast<uint32_t>(sending_type_));
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
new file mode 100644
index 0000000000..59f1c6caf2
--- /dev/null
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -0,0 +1,129 @@
+#include <vector>
+#include <string>
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/message_helper.h"
+#include "utils/logger.h"
+#include "utils/file_system.h"
+
+namespace {
+using namespace application_manager;
+void DeleteWayPoints(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ app_manager.UnsubscribeAppFromWayPoints(app);
+ if (!app_manager.IsAnyAppSubscribedForWayPoints()) {
+ MessageHelper::SendUnsubscribedWayPoints(app_manager);
+ }
+}
+
+void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
+ CommandsMap cmap = app->commands_map().GetData();
+
+ for (auto cmd : cmap) {
+ MessageHelper::SendDeleteCommandRequest(cmd.second, app, app_manager);
+ app->RemoveCommand(cmd.first);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd.first, true);
+ }
+}
+
+void DeleteSubmenus(ApplicationSharedPtr app, ApplicationManager& app_manager) {
+ SubMenuMap smap = app->sub_menu_map().GetData();
+
+ for (auto smenu : smap) {
+ MessageHelper::SendDeleteSubmenuRequest(smenu.second, app, app_manager);
+ app->RemoveSubMenu(smenu.first);
+ }
+}
+
+void DeleteChoiceSets(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ ChoiceSetMap csmap = app->choice_set_map().GetData();
+
+ for (auto choice : csmap) {
+ MessageHelper::SendDeleteChoiceSetRequest(choice.second, app, app_manager);
+ app->RemoveChoiceSet(choice.first);
+ }
+}
+
+void DeleteGlobalProperties(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ using namespace smart_objects;
+
+ const std::vector<std::string>& timeout_prompt =
+ app_manager.get_settings().time_out_promt();
+
+ SmartObject so_default_timeout_prompt = SmartObject(SmartType_Array);
+
+ int32_t index = 0;
+ for (auto prompt : timeout_prompt) {
+ SmartObject timeoutPrompt = SmartObject(SmartType_Map);
+ timeoutPrompt[strings::text] = timeout_prompt[static_cast<size_t>(index)];
+ timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ so_default_timeout_prompt[index] = timeoutPrompt;
+ ++index;
+ }
+
+ app->set_timeout_prompt(so_default_timeout_prompt);
+
+ SmartObject empty_so = SmartObject(SmartType_Array);
+ app->set_help_prompt(empty_so);
+ app->reset_vr_help_title();
+ app->reset_vr_help();
+ app->set_keyboard_props(empty_so);
+ app->set_menu_icon(empty_so);
+ app->set_menu_title(empty_so);
+
+ MessageHelper::SendResetPropertiesRequest(app, app_manager);
+}
+
+void DeleteButtonSubscriptions(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ ButtonSubscriptions buttons = app->SubscribedButtons().GetData();
+
+ for (auto button : buttons) {
+ if (mobile_apis::ButtonName::CUSTOM_BUTTON == button) {
+ continue;
+ }
+ MessageHelper::SendUnsubscribeButtonNotification(button, app, app_manager);
+ app->UnsubscribeFromButton(button);
+ }
+}
+
+void CleanupAppFiles(ApplicationSharedPtr app) {
+ const auto icon_file = app->app_icon_path();
+
+ auto files = app->getAppFiles();
+ for (auto file : files) {
+ auto file_name = file.first;
+ if (icon_file == file_name) {
+ continue;
+ }
+ app->DeleteFile(file_name);
+ file_system::DeleteFile(file_name);
+ }
+}
+} // namespace
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "ApplicationManager")
+
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ LOG4CXX_AUTO_TRACE(logger);
+ DCHECK_OR_RETURN_VOID(app);
+
+ DeleteWayPoints(app, app_manager);
+ DeleteCommands(app, app_manager);
+ DeleteSubmenus(app, app_manager);
+ DeleteChoiceSets(app, app_manager);
+ DeleteGlobalProperties(app, app_manager);
+ DeleteButtonSubscriptions(app, app_manager);
+ CleanupAppFiles(app);
+ app_manager.GetPluginManager().ForEachPlugin(
+ [&app](plugin_manager::RPCPlugin& plugin) {
+ plugin.OnApplicationEvent(
+ plugin_manager::ApplicationEvent::kDeleteApplicationData, app);
+ });
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index 9d52cc98db..f67590543d 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -44,7 +44,7 @@
#include "utils/file_system.h"
namespace application_manager {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
namespace {
std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
@@ -68,6 +68,10 @@ std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
std::map<std::string, hmi_apis::Common_FileType::eType> file_type_enum;
std::map<std::string, hmi_apis::Common_DisplayType::eType> display_type_enum;
std::map<std::string, hmi_apis::Common_CharacterSet::eType> character_set_enum;
+std::map<std::string, hmi_apis::Common_VideoStreamingProtocol::eType>
+ video_streaming_protocol_enum;
+std::map<std::string, hmi_apis::Common_VideoStreamingCodec::eType>
+ video_streaming_codec_enum;
void InitCapabilities() {
vr_enum_capabilities.insert(std::make_pair(
@@ -89,10 +93,14 @@ void InitCapabilities() {
hmi_apis::Common_SpeechCapabilities::PRE_RECORDED));
tts_enum_capabilities.insert(std::make_pair(
std::string("SILENCE"), hmi_apis::Common_SpeechCapabilities::SILENCE));
+ tts_enum_capabilities.insert(std::make_pair(
+ std::string("FILE"), hmi_apis::Common_SpeechCapabilities::FILE));
button_enum_name.insert(
std::make_pair(std::string("OK"), hmi_apis::Common_ButtonName::OK));
button_enum_name.insert(std::make_pair(
+ std::string("PLAY_PAUSE"), hmi_apis::Common_ButtonName::PLAY_PAUSE));
+ button_enum_name.insert(std::make_pair(
std::string("SEEKLEFT"), hmi_apis::Common_ButtonName::SEEKLEFT));
button_enum_name.insert(std::make_pair(
std::string("SEEKRIGHT"), hmi_apis::Common_ButtonName::SEEKRIGHT));
@@ -278,6 +286,9 @@ void InitCapabilities() {
image_field_name_enum.insert(std::make_pair(
std::string("graphic"), hmi_apis::Common_ImageFieldName::graphic));
image_field_name_enum.insert(
+ std::make_pair(std::string("secondaryGraphic"),
+ hmi_apis::Common_ImageFieldName::secondaryGraphic));
+ image_field_name_enum.insert(
std::make_pair(std::string("showConstantTBTIcon"),
hmi_apis::Common_ImageFieldName::showConstantTBTIcon));
image_field_name_enum.insert(std::make_pair(
@@ -333,6 +344,28 @@ void InitCapabilities() {
std::string("CID1SET"), hmi_apis::Common_CharacterSet::CID1SET));
character_set_enum.insert(std::make_pair(
std::string("CID2SET"), hmi_apis::Common_CharacterSet::CID2SET));
+
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RAW"), hmi_apis::Common_VideoStreamingProtocol::RAW));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTP"), hmi_apis::Common_VideoStreamingProtocol::RTP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTSP"), hmi_apis::Common_VideoStreamingProtocol::RTSP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTMP"), hmi_apis::Common_VideoStreamingProtocol::RTMP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("WEBM"), hmi_apis::Common_VideoStreamingProtocol::WEBM));
+
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("H264"), hmi_apis::Common_VideoStreamingCodec::H264));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("H265"), hmi_apis::Common_VideoStreamingCodec::H265));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("Theora"), hmi_apis::Common_VideoStreamingCodec::Theora));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("VP8"), hmi_apis::Common_VideoStreamingCodec::VP8));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("VP9"), hmi_apis::Common_VideoStreamingCodec::VP9));
}
} // namespace
@@ -343,6 +376,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, is_ui_cooperating_(false)
, is_navi_cooperating_(false)
, is_ivi_cooperating_(false)
+ , is_rc_cooperating_(false)
, attenuated_supported_(false)
, ui_language_(hmi_apis::Common_Language::INVALID_ENUM)
, vr_language_(hmi_apis::Common_Language::INVALID_ENUM)
@@ -363,6 +397,12 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, prerecorded_speech_(NULL)
, is_navigation_supported_(false)
, is_phone_call_supported_(false)
+ , is_video_streaming_supported_(false)
+ , is_rc_supported_(false)
+ , navigation_capability_(NULL)
+ , phone_capability_(NULL)
+ , video_streaming_capability_(NULL)
+ , rc_capability_(NULL)
, app_mngr_(app_mngr)
, hmi_language_handler_(app_mngr) {
InitCapabilities();
@@ -372,6 +412,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
is_ui_cooperating_ = true;
is_navi_cooperating_ = true;
is_ivi_cooperating_ = true;
+ is_rc_cooperating_ = true;
}
}
@@ -390,6 +431,10 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() {
delete audio_pass_thru_capabilities_;
delete pcm_stream_capabilities_;
delete prerecorded_speech_;
+ delete navigation_capability_;
+ delete phone_capability_;
+ delete video_streaming_capability_;
+ delete rc_capability_;
}
bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const {
@@ -430,6 +475,10 @@ void HMICapabilitiesImpl::set_is_ivi_cooperating(const bool value) {
is_ivi_cooperating_ = value;
}
+void HMICapabilitiesImpl::set_is_rc_cooperating(const bool value) {
+ is_rc_cooperating_ = value;
+}
+
void HMICapabilitiesImpl::set_attenuated_supported(const bool state) {
attenuated_supported_ = state;
}
@@ -506,10 +555,15 @@ void HMICapabilitiesImpl::set_vr_supported_languages(
void HMICapabilitiesImpl::set_display_capabilities(
const smart_objects::SmartObject& display_capabilities) {
- if (display_capabilities_) {
- delete display_capabilities_;
+ if (app_mngr_.IsSOStructValid(
+ hmi_apis::StructIdentifiers::Common_DisplayCapabilities,
+ display_capabilities)) {
+ if (display_capabilities_) {
+ delete display_capabilities_;
+ }
+ display_capabilities_ =
+ new smart_objects::SmartObject(display_capabilities);
}
- display_capabilities_ = new smart_objects::SmartObject(display_capabilities);
}
void HMICapabilitiesImpl::set_hmi_zone_capabilities(
@@ -605,6 +659,48 @@ void HMICapabilitiesImpl::set_phone_call_supported(const bool supported) {
is_phone_call_supported_ = supported;
}
+void HMICapabilitiesImpl::set_video_streaming_supported(const bool supported) {
+ is_video_streaming_supported_ = supported;
+}
+
+void HMICapabilitiesImpl::set_rc_supported(const bool supported) {
+ is_rc_supported_ = supported;
+}
+
+void HMICapabilitiesImpl::set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) {
+ if (navigation_capability_) {
+ delete navigation_capability_;
+ }
+ navigation_capability_ =
+ new smart_objects::SmartObject(navigation_capability);
+}
+
+void HMICapabilitiesImpl::set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) {
+ if (phone_capability_) {
+ delete phone_capability_;
+ }
+ phone_capability_ = new smart_objects::SmartObject(phone_capability);
+}
+
+void HMICapabilitiesImpl::set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) {
+ if (video_streaming_capability_) {
+ delete video_streaming_capability_;
+ }
+ video_streaming_capability_ =
+ new smart_objects::SmartObject(video_streaming_capability);
+}
+
+void HMICapabilitiesImpl::set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) {
+ if (rc_capability_) {
+ delete rc_capability_;
+ }
+ rc_capability_ = new smart_objects::SmartObject(rc_capability);
+}
+
void HMICapabilitiesImpl::Init(resumption::LastState* last_state) {
hmi_language_handler_.Init(last_state);
if (false == load_capabilities_from_file()) {
@@ -636,6 +732,10 @@ bool HMICapabilitiesImpl::is_ivi_cooperating() const {
return is_ivi_cooperating_;
}
+bool HMICapabilitiesImpl::is_rc_cooperating() const {
+ return is_rc_cooperating_;
+}
+
const smart_objects::SmartObject* HMICapabilitiesImpl::ui_supported_languages()
const {
return ui_supported_languages_;
@@ -716,6 +816,33 @@ bool HMICapabilitiesImpl::phone_call_supported() const {
return is_phone_call_supported_;
}
+bool HMICapabilitiesImpl::video_streaming_supported() const {
+ return is_video_streaming_supported_;
+}
+
+bool HMICapabilitiesImpl::rc_supported() const {
+ return is_rc_supported_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability()
+ const {
+ return navigation_capability_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability()
+ const {
+ return phone_capability_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilitiesImpl::video_streaming_capability() const {
+ return video_streaming_capability_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const {
+ return rc_capability_;
+}
+
bool HMICapabilitiesImpl::load_capabilities_from_file() {
std::string json_string;
std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name();
@@ -759,7 +886,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(ui, "displayCapabilities")) {
smart_objects::SmartObject display_capabilities_so;
Json::Value display_capabilities = ui.get("displayCapabilities", "");
- Formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
display_capabilities_so);
if (display_capabilities_so.keyExists(hmi_response::display_type)) {
@@ -956,10 +1083,99 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value soft_button_capabilities =
ui.get("softButtonCapabilities", "");
smart_objects::SmartObject soft_button_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
+ formatters::CFormatterJsonBase::jsonValueToObj(
soft_button_capabilities, soft_button_capabilities_so);
set_soft_button_capabilities(soft_button_capabilities_so);
}
+ if (check_existing_json_member(ui, "systemCapabilities")) {
+ Json::Value system_capabilities = ui.get("systemCapabilities", "");
+ if (check_existing_json_member(system_capabilities,
+ "navigationCapability")) {
+ Json::Value navigation_capability =
+ system_capabilities.get("navigationCapability", "");
+ smart_objects::SmartObject navigation_capability_so;
+ formatters::CFormatterJsonBase::jsonValueToObj(
+ navigation_capability, navigation_capability_so);
+ set_navigation_capability(navigation_capability_so);
+ if (!navigation_capability_so.empty()) {
+ set_navigation_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "phoneCapability")) {
+ Json::Value phone_capability =
+ system_capabilities.get("phoneCapability", "");
+ smart_objects::SmartObject phone_capability_so;
+ formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
+ phone_capability_so);
+ set_phone_capability(phone_capability_so);
+ if (!phone_capability_so.empty()) {
+ set_phone_call_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "videoStreamingCapability")) {
+ Json::Value vs_capability =
+ system_capabilities.get("videoStreamingCapability", "");
+ smart_objects::SmartObject vs_capability_so;
+ formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
+ vs_capability_so);
+
+ if (vs_capability_so.keyExists("supportedFormats")) {
+ smart_objects::SmartObject& supported_format_array =
+ vs_capability_so["supportedFormats"];
+ smart_objects::SmartObject converted_array(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < supported_format_array.length();
+ i++) {
+ if (!supported_format_array[i].keyExists("protocol") ||
+ !supported_format_array[i].keyExists("codec")) {
+ continue;
+ }
+
+ std::map<std::string,
+ hmi_apis::Common_VideoStreamingProtocol::eType>::
+ const_iterator it_protocol =
+ video_streaming_protocol_enum.find(
+ supported_format_array[i]["protocol"].asString());
+
+ std::map<std::string,
+ hmi_apis::Common_VideoStreamingCodec::eType>::
+ const_iterator it_codec = video_streaming_codec_enum.find(
+ supported_format_array[i]["codec"].asString());
+
+ // format is valid only if both protocol and codec are converted
+ // to enum values successfully
+ if (it_protocol != video_streaming_protocol_enum.end() &&
+ it_codec != video_streaming_codec_enum.end()) {
+ smart_objects::SmartObject format_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ format_so["protocol"] = it_protocol->second;
+ format_so["codec"] = it_codec->second;
+ converted_array[j++] = format_so;
+ }
+ }
+ vs_capability_so.erase("supportedFormats");
+ vs_capability_so["supportedFormats"] = converted_array;
+ }
+ set_video_streaming_capability(vs_capability_so);
+ if (!vs_capability_so.empty()) {
+ set_video_streaming_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "remoteControlCapability")) {
+ Json::Value rc_capability =
+ system_capabilities.get("remoteControlCapability", "");
+ smart_objects::SmartObject rc_capability_so;
+ formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
+ rc_capability_so);
+ set_rc_capability(rc_capability_so);
+ if (!rc_capability_so.empty()) {
+ set_rc_supported(true);
+ }
+ }
+ }
} // UI end
// VR
@@ -1031,7 +1247,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "capabilities")) {
Json::Value bt_capabilities = buttons.get("capabilities", "");
smart_objects::SmartObject buttons_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
buttons_capabilities_so);
for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
@@ -1051,7 +1267,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "presetBankCapabilities")) {
Json::Value presetBank = buttons.get("presetBankCapabilities", "");
smart_objects::SmartObject preset_bank_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
+ formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
preset_bank_so);
set_preset_bank_capabilities(preset_bank_so);
}
@@ -1061,11 +1277,10 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(root_json, "VehicleInfo")) {
Json::Value vehicle_info = root_json.get("VehicleInfo", "");
smart_objects::SmartObject vehicle_type_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
+ formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
vehicle_type_so);
set_vehicle_type(vehicle_type_so);
} // VehicleType end
-
} catch (...) {
return false;
}
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
deleted file mode 100644
index 3f8a60a4a5..0000000000
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ /dev/null
@@ -1,2259 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/hmi_command_factory.h"
-
-#include "application_manager/message.h"
-#include "interfaces/HMI_API.h"
-
-#include "application_manager/commands/hmi/update_device_list_request.h"
-#include "application_manager/commands/hmi/update_device_list_response.h"
-#include "application_manager/commands/hmi/on_update_device_list.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/update_app_list_request.h"
-#include "application_manager/commands/hmi/update_app_list_response.h"
-#include "application_manager/commands/hmi/on_find_applications.h"
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-#include "application_manager/commands/hmi/update_sdl_response.h"
-#include "application_manager/commands/hmi/activate_app_request.h"
-#include "application_manager/commands/hmi/activate_app_response.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/commands/hmi/close_popup_request.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/commands/hmi/ui_show_request.h"
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/commands/hmi/ui_alert_request.h"
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/commands/hmi/ui_slider_request.h"
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-#include "application_manager/commands/hmi/tts_speak_request.h"
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-
-#ifdef EXTERNAL_PROPRIETARY_MODE
-#include "application_manager/commands/hmi/decrypt_certificate_request.h"
-#include "application_manager/commands/hmi/decrypt_certificate_response.h"
-#endif // EXTERNAL_PROPRIETARY_MODE
-
-#ifdef HMI_DBUS_API
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#else
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#endif // #ifdef HMI_DBUS_API
-
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/commands/hmi/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"
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-namespace application_manager {
-
-CommandSharedPtr HMICommandFactory::CreateCommand(
- const commands::MessageSharedPtr& message,
- ApplicationManager& application_manager) {
- const int function_id =
- (*message)[strings::params][strings::function_id].asInt();
- LOG4CXX_DEBUG(
- logger_, "HMICommandFactory::CreateCommand function_id: " << function_id);
-
- CommandSharedPtr command(new application_manager::commands::CommandImpl(
- message, application_manager));
-
- bool is_response = false;
- const int msg_type =
- (*message)[strings::params][strings::message_type].asInt();
- if (msg_type ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- is_response = true;
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response");
- } else if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(
- application_manager::MessageType::kErrorResponse)) {
- is_response = true;
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response");
- } else {
- LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand request");
- }
-
- switch (function_id) {
- case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: {
- command.reset(
- new commands::OnStartDeviceDiscovery(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: {
- if (is_response) {
- command.reset(new commands::UpdateDeviceListResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UpdateDeviceListRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_ActivateApp: {
- if (is_response) {
- command.reset(
- new commands::ActivateAppResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ActivateAppRequest(message, application_manager));
- }
- break;
- }
-#ifdef EXTERNAL_PROPRIETARY_MODE
- case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
- if (is_response) {
- command.reset(new commands::DecryptCertificateResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DecryptCertificateRequest(
- message, application_manager));
- }
- break;
- }
-#endif // EXTERNAL_PROPRIETARY_MODE
- case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
- if (is_response) {
- command.reset(
- new commands::GetSystemInfoResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetSystemInfoRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_ActivateApp: {
- if (is_response) {
- command.reset(
- new commands::SDLActivateAppResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SDLActivateAppRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: {
- if (is_response) {
- command.reset(new commands::SDLPolicyUpdateResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SDLPolicyUpdate(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetURLS: {
- if (is_response) {
- command.reset(
- new commands::GetUrlsResponse(message, application_manager));
- } else {
- command.reset(new commands::GetUrls(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: {
- command.reset(new commands::OnAppPermissionChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_GetListOfPermissions: {
- if (is_response) {
- command.reset(new commands::SDLGetListOfPermissionsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetListOfPermissionsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: {
- if (is_response) {
- command.reset(new commands::SDLGetUserFriendlyMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetUserFriendlyMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_GetStatusUpdate: {
- if (is_response) {
- command.reset(new commands::SDLGetStatusUpdateResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SDLGetStatusUpdateRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnStatusUpdate: {
- command.reset(new commands::OnStatusUpdateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: {
- command.reset(new commands::OnAppPermissionConsentNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: {
- if (is_response) {
- command.reset(new commands::MixingAudioSupportedResponse(
- message, application_manager));
- } else {
- command.reset(new commands::MixingAudioSupportedRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: {
- command.reset(new commands::OnExitAllApplicationsNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_AddCommand: {
- if (is_response) {
- command.reset(
- new commands::UIAddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAddCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_DeleteCommand: {
- if (is_response) {
- command.reset(new commands::UIDeleteCommandResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::UIDeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_AddSubMenu: {
- if (is_response) {
- command.reset(
- new commands::UIAddSubmenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAddSubmenuRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_DeleteSubMenu: {
- if (is_response) {
- command.reset(new commands::UIDeleteSubmenuResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::UIDeleteSubmenuRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
- if (is_response) {
- command.reset(new commands::UISetMediaClockTimerResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UISetMediaClockTimerRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_PerformInteraction: {
- if (is_response) {
- command.reset(new commands::UIPerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIPerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetGlobalProperties: {
- if (is_response) {
- command.reset(new commands::UISetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UISetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ScrollableMessage: {
- if (is_response) {
- command.reset(new commands::UIScrollableMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIScrollableMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- if (is_response) {
- command.reset(
- new commands::UISetAppIconResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UISetAppIconRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::UIGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::UIGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::UIGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::UIChangeRegistratioResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
- if (is_response) {
- command.reset(new commands::UIPerformAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIPerformAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_EndAudioPassThru: {
- if (is_response) {
- command.reset(new commands::UIEndAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UIEndAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_Alert: {
- if (is_response) {
- command.reset(
- new commands::UIAlertResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIAlertRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_IsReady: {
- if (is_response) {
- command.reset(
- new commands::VRIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_AddCommand: {
- if (is_response) {
- command.reset(
- new commands::VRAddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRAddCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_DeleteCommand: {
- if (is_response) {
- command.reset(new commands::VRDeleteCommandResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::VRDeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::VRChangeRegistrationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::VRGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::VRGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VRGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::VRGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_IsReady: {
- if (is_response) {
- command.reset(
- new commands::TTSIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_ChangeRegistration: {
- if (is_response) {
- command.reset(new commands::TTSChangeRegistratioResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetSupportedLanguages: {
- if (is_response) {
- command.reset(new commands::TTSGetSupportedLanguagesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSGetSupportedLanguagesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_StopSpeaking: {
- if (is_response) {
- command.reset(new commands::TTSStopSpeakingResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::TTSStopSpeakingRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetLanguage: {
- if (is_response) {
- command.reset(
- new commands::TTSGetLanguageResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSGetLanguageRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_Speak: {
- if (is_response) {
- command.reset(
- new commands::TTSSpeakResponse(message, application_manager));
- } else {
- command.reset(
- new commands::TTSSpeakRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
- if (is_response) {
- command.reset(new commands::TTSSetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSSetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::TTSGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::TTSGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::TTS_Started: {
- command.reset(
- new commands::OnTTSStartedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_Stopped: {
- command.reset(
- new commands::OnTTSStoppedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: {
- command.reset(new commands::OnAppActivatedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
- command.reset(new commands::OnExitApplicationNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_Show: {
- if (is_response) {
- command.reset(
- new commands::UIShowResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIShowRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_Slider: {
- if (is_response) {
- command.reset(
- new commands::UISliderResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UISliderRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_ClosePopUp: {
- if (is_response) {
- command.reset(
- new commands::ClosePopupResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ClosePopupRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::UI_IsReady: {
- if (is_response) {
- command.reset(
- new commands::UIIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UIIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_IsReady: {
- if (is_response) {
- command.reset(
- new commands::VIIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
- if (is_response) {
- command.reset(
- new commands::VIReadDIDResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIReadDIDRequest(message, application_manager));
- }
- break;
- }
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetGpsData: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message,
- application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSpeed: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetRpm: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetRpm>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetRpm>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetPrndl: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetVin: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin>(message,
- application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetMyKey: {
- if (is_response)
- command.reset(new commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message,
- application_manager));
- else
- command.reset(new commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message,
- application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
- if (is_response) {
- command.reset(new commands::VIGetVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIGetVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
- if (is_response) {
- command.reset(
- new commands::VIGetDTCsResponse(message, application_manager));
- } else {
- command.reset(
- new commands::VIGetDTCsRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
- if (is_response) {
- command.reset(new commands::VIDiagnosticMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIDiagnosticMessageRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: {
- if (is_response) {
- command.reset(new commands::VIGetVehicleTypeResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIGetVehicleTypeRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_IsReady: {
- if (is_response) {
- command.reset(
- new commands::NaviIsReadyResponse(message, application_manager));
- } else {
- command.reset(
- new commands::NaviIsReadyRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_AlertManeuver: {
- if (is_response) {
- command.reset(new commands::NaviAlertManeuverResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviAlertManeuverRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_GetWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviGetWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviGetWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
- if (is_response) {
- command.reset(new commands::NaviUpdateTurnListResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviUpdateTurnListRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
- if (is_response) {
- command.reset(new commands::NaviShowConstantTBTResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviShowConstantTBTRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviSubscribeWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviSubscribeWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
- if (is_response) {
- command.reset(new commands::NaviUnsubscribeWayPointsResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviUnSubscribeWayPointsRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Buttons_GetCapabilities: {
- if (is_response) {
- command.reset(new commands::ButtonGetCapabilitiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ButtonGetCapabilitiesRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
- command.reset(new commands::OnAllowSDLFunctionalityNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: {
- command.reset(new commands::OnSDLConsentNeededNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_UpdateSDL: {
- if (is_response) {
- command.reset(
- new commands::UpdateSDLResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateSDLRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
- command.reset(new commands::OnIgnitionCycleOverNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: {
- command.reset(new commands::OnSystemInfoChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- command.reset(
- new commands::OnReadyNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: {
- command.reset(new commands::OnDeviceChosenNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnSystemContext: {
- command.reset(new commands::OnSystemContextNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnDriverDistraction: {
- command.reset(new commands::hmi::OnDriverDistractionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
- command.reset(
- new commands::OnUpdateDeviceList(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: {
- command.reset(new commands::OnAppRegisteredNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: {
- command.reset(new commands::OnAppUnregisteredNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: {
- command.reset(
- new commands::OnFindApplications(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: {
- if (is_response) {
- command.reset(
- new commands::UpdateAppListResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateAppListRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::VR_Started: {
- command.reset(
- new commands::OnVRStartedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_Stopped: {
- command.reset(
- new commands::OnVRStoppedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_OnCommand: {
- command.reset(
- new commands::OnVRCommandNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnCommand: {
- command.reset(
- new commands::OnUICommandNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: {
- command.reset(new commands::OnAppDeactivatedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnLanguageChange: {
- command.reset(new commands::OnUILanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_OnLanguageChange: {
- command.reset(new commands::OnVRLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_OnLanguageChange: {
- command.reset(new commands::OnTTSLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonEvent: {
- command.reset(new commands::hmi::OnButtonEventNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonPress: {
- command.reset(new commands::hmi::OnButtonPressNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Buttons_OnButtonSubscription: {
- command.reset(new commands::hmi::OnButtonSubscriptionNotification(
- message, application_manager));
- break;
- }
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: {
- if (is_response)
- command.reset(new commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>(
- message, application_manager));
- else
- command.reset(new commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>(
- message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: {
- if (is_response) {
- command.reset(new commands::VISubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VISubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: {
- if (is_response)
- command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>(
- message, application_manager));
- else
- command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>(
- message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: {
- if (is_response) {
- command.reset(new commands::VIUnsubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VIUnsubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
-#endif // #ifdef HMI_DBUS_API
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_OnGpsData: {
- command.reset(
- new commands::OnVIGpsDataNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSpeed: {
- command.reset(
- new commands::OnVISpeedNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnRpm: {
- command.reset(
- new commands::OnVIRpmNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: {
- command.reset(new commands::OnVIFuelLevelNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: {
- command.reset(new commands::OnVIFuelLevelStateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: {
- command.reset(new commands::OnVIInstantFuelConsumptionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: {
- command.reset(new commands::OnVIExternalTemperatureNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnVin: {
- command.reset(
- new commands::OnVIVinNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnPrndl: {
- command.reset(
- new commands::OnVIPrndlNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: {
- command.reset(new commands::OnVITirePressureNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnOdometer: {
- command.reset(
- new commands::OnVIOdometerNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: {
- command.reset(new commands::OnVIBeltStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: {
- command.reset(new commands::OnVIBodyInformationNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: {
- command.reset(new commands::OnVIDeviceStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: {
- command.reset(new commands::OnVIDriverBrakingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: {
- command.reset(new commands::OnVIWiperStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: {
- command.reset(new commands::OnVIHeadLampStatusNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: {
- command.reset(new commands::OnVIEngineTorqueNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: {
- command.reset(new commands::OnVIAccPedalPositionNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: {
- command.reset(new commands::OnVISteeringWheelAngleNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VehicleInfo_OnMyKey: {
- command.reset(
- new commands::OnVIMyKeyNotification(message, application_manager));
- break;
- }
-#else
- case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: {
- command.reset(new commands::OnVIVehicleDataNotification(
- message, application_manager));
- break;
- }
-#endif // #ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
- command.reset(new commands::OnNaviTBTClientStateNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnKeyboardInput: {
- command.reset(new commands::hmi::OnUIKeyBoardInputNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnTouchEvent: {
- command.reset(new commands::hmi::OnUITouchEventNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnResetTimeout: {
- command.reset(new commands::hmi::OnUIResetTimeoutNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Navigation_StartStream: {
- if (is_response) {
- command.reset(new commands::NaviStartStreamResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::NaviStartStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StopStream: {
- if (is_response) {
- command.reset(
- new commands::NaviStopStreamResponse(message, application_manager));
- } else {
- command.reset(
- new commands::NaviStopStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StartAudioStream: {
- if (is_response) {
- command.reset(new commands::AudioStartStreamResponse(
- message, application_manager));
- } else {
- command.reset(new commands::AudioStartStreamRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_StopAudioStream: {
- if (is_response) {
- command.reset(new commands::AudioStopStreamResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::AudioStopStreamRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: {
- command.reset(new commands::OnAudioDataStreamingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: {
- command.reset(new commands::OnVideoDataStreamingNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::VR_PerformInteraction: {
- if (is_response) {
- command.reset(new commands::VRPerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::VRPerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: {
- command.reset(new commands::OnSystemRequestNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnPutFile: {
- command.reset(
- new commands::OnPutFileNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: {
- command.reset(new commands::OnResumeAudioSourceNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_SetDisplayLayout: {
- if (is_response) {
- command.reset(new commands::UiSetDisplayLayoutResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UiSetDisplayLayoutRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: {
- command.reset(
- new commands::OnSDLCloseNotification(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: {
- command.reset(new commands::OnSDLPersistenceCompleteNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: {
- command.reset(new commands::OnFileRemovedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::UI_OnRecordStart: {
- command.reset(new commands::OnRecordStartdNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
- if (is_response) {
- command.reset(new commands::BasicCommunicationSystemResponse(
- message, application_manager));
- } else {
- command.reset(new commands::BasicCommunicationSystemRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_SendLocation: {
- if (is_response) {
- command.reset(new commands::NaviSendLocationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::NaviSendLocationRequest(
- message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::SDL_AddStatisticsInfo: {
- command.reset(new commands::AddStatisticsInfoNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnSystemError: {
- command.reset(new commands::OnSystemErrorNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: {
- command.reset(
- new commands::OnReceivedPolicyUpdate(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnPolicyUpdate: {
- command.reset(new commands::OnPolicyUpdate(message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
- command.reset(new commands::OnDeviceStateChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::TTS_OnResetTimeout: {
- command.reset(new commands::hmi::OnTTSResetTimeoutNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: {
- command.reset(new commands::OnEventChangedNotification(
- message, application_manager));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
- if (is_response) {
- command.reset(new commands::hmi::DialNumberResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::hmi::DialNumberRequest(message, application_manager));
- }
- break;
- }
- case hmi_apis::FunctionID::Navigation_OnWayPointChange: {
- command.reset(new commands::OnNaviWayPointChangeNotification(
- message, application_manager));
- break;
- }
- }
- return command;
-}
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 8a9944bec4..452b5ab79d 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -2,6 +2,9 @@
* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@@ -13,7 +16,7 @@
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
- * Neither the name of the Ford Motor Company nor the names of its contributors
+ * Neither the name of the copyright holders nor the names of their contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -58,8 +61,6 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFileRemoved] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_AllowDeviceToConnect] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnDeviceChosen] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFindApplications] =
@@ -155,6 +156,7 @@ generate_function_to_interface_convert_map() {
convert_map[UI_IsReady] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_ClosePopUp] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SendHapticData] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[Navigation_IsReady] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_SendLocation] =
HmiInterfaces::HMI_INTERFACE_Navigation;
@@ -166,6 +168,8 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_OnTBTClientState] =
HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_SetVideoConfig] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StartStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StopStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StartAudioStream] =
@@ -214,6 +218,15 @@ generate_function_to_interface_convert_map() {
convert_map[SDL_OnSystemError] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_AddStatisticsInfo] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[RC_IsReady] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[Buttons_ButtonPress] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_SetInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetInteriorVehicleDataConsent] =
+ HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_OnInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_OnRemoteControlSettings] = HmiInterfaces::HMI_INTERFACE_RC;
return convert_map;
}
@@ -235,6 +248,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() {
HmiInterfaces::STATE_NOT_RESPONSE;
interfaces_states_[HmiInterfaces::HMI_INTERFACE_VR] =
HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
}
HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState(
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index 4e5390a1b4..6e89b2419c 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -33,6 +33,7 @@
#include "application_manager/hmi_language_handler.h"
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
+#include "application_manager/rpc_service.h"
#include "application_manager/hmi_capabilities.h"
#include "utils/helpers.h"
#include "resumption/last_state.h"
@@ -222,7 +223,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile(
const uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
DCHECK_OR_RETURN_VOID(notification);
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -236,8 +238,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile(
hmi_capabilities.active_ui_language();
message[strings::msg_params][strings::language] =
hmi_capabilities.active_vr_language();
- if (application_manager_.ManageMobileCommand(notification,
- commands::Command::ORIGIN_SDL)) {
+ if (application_manager_.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::SOURCE_SDL)) {
LOG4CXX_INFO(logger_, "Mobile command sent");
} else {
LOG4CXX_WARN(logger_, "Cannot send mobile command");
@@ -306,11 +308,11 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) {
}
}
SendOnLanguageChangeToMobile(app.first);
- application_manager_.ManageMobileCommand(
+ application_manager_.GetRPCService().ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app.first,
mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
application_manager_.UnregisterApplication(
app.first, mobile_apis::Result::SUCCESS, false);
LOG4CXX_INFO(logger_,
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 1f05232476..7be9668543 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 2015, Ford Motor Company
* All rights reserved.
@@ -31,47 +32,60 @@
*/
#include "application_manager/hmi_state.h"
+#include <ostream>
+#include <boost/assign.hpp>
+#include <boost/bimap.hpp>
#include "application_manager/application_manager.h"
#include "utils/helpers.h"
namespace application_manager {
-HmiState::HmiState(uint32_t app_id,
+CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState")
+
+HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
- : app_id_(app_id)
+ : app_(app)
, state_id_(state_id)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
+ , video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
+ , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+ LOG4CXX_DEBUG(logger_, *this);
+}
-HmiState::HmiState(uint32_t app_id, const ApplicationManager& app_mngr)
- : app_id_(app_id)
+HmiState::HmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : app_(app)
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
+ , video_streaming_state_(mobile_apis::VideoStreamingState::INVALID_ENUM)
+ , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+ LOG4CXX_DEBUG(logger_, *this);
+}
void HmiState::set_parent(HmiStatePtr parent) {
DCHECK_OR_RETURN_VOID(parent);
parent_ = parent;
}
-bool HmiState::is_navi_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_navi() : false;
+bool HmiState::is_navi_app() const {
+ return app_->is_navi();
}
-bool HmiState::is_media_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_media_application() : false;
+bool HmiState::is_media_app() const {
+ return app_->is_media_application();
}
-bool HmiState::is_voice_communication_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_voice_communication_supported() : false;
+bool HmiState::is_voice_communication_app() const {
+ return app_->is_voice_communication_supported();
+}
+
+bool HmiState::is_mobile_projection_app() const {
+ return app_->mobile_projection_enabled();
}
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
@@ -80,11 +94,13 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
return AudioStreamingState::NOT_AUDIBLE;
}
-VRHmiState::VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {}
+VRHmiState::VRHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_VR_SESSION) {}
-TTSHmiState::TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_TTS_SESSION) {}
+TTSHmiState::TTSHmiState(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {}
mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
const {
@@ -101,9 +117,24 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
return expected_state;
}
-NaviStreamingHmiState::NaviStreamingHmiState(uint32_t app_id,
+VideoStreamingHmiState::VideoStreamingHmiState(
+ std::shared_ptr<Application> app, const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_VIDEO_STREAMING) {}
+
+mobile_apis::VideoStreamingState::eType
+VideoStreamingHmiState::video_streaming_state() const {
+ if (app_->IsVideoApplication()) {
+ return parent()->video_streaming_state();
+ }
+
+ return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+}
+
+NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_NAVI_STREAMING) {}
+ : VideoStreamingHmiState(app, app_mngr) {
+ set_state_id(STATE_ID_NAVI_STREAMING);
+}
mobile_apis::AudioStreamingState::eType
NaviStreamingHmiState::audio_streaming_state() const {
@@ -111,19 +142,23 @@ NaviStreamingHmiState::audio_streaming_state() const {
using namespace mobile_apis;
AudioStreamingState::eType expected_state = parent()->audio_streaming_state();
- if (!is_navi_app(app_id_) && AudioStreamingState::AUDIBLE == expected_state) {
+ if (!is_navi_app() && Compare<AudioStreamingState::eType, EQ, ONE>(
+ expected_state,
+ AudioStreamingState::AUDIBLE,
+ AudioStreamingState::ATTENUATED)) {
if (app_mngr_.is_attenuated_supported()) {
expected_state = AudioStreamingState::ATTENUATED;
} else {
expected_state = AudioStreamingState::NOT_AUDIBLE;
}
}
+
return expected_state;
}
-PhoneCallHmiState::PhoneCallHmiState(uint32_t app_id,
+PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_PHONE_CALL) {}
+ : HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {}
mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
using namespace helpers;
@@ -133,22 +168,22 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_navi_app(app_id_)) {
+ if (is_navi_app() || is_mobile_projection_app()) {
return HMILevel::HMI_LIMITED;
}
- if (!is_media_app(app_id_)) {
+ if (!is_media_app()) {
return parent()->hmi_level();
}
return HMILevel::HMI_BACKGROUND;
}
-SafetyModeHmiState::SafetyModeHmiState(uint32_t app_id,
+SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {}
+ : HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {}
-DeactivateHMI::DeactivateHMI(uint32_t app_id,
+DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
+ : HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
using namespace helpers;
@@ -158,31 +193,31 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
+
return HMILevel::HMI_BACKGROUND;
}
-AudioSource::AudioSource(uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {}
+AudioSource::AudioSource(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE)
+ , keep_context_(app->keep_context()) {
+ app_->set_keep_context(false);
+}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
- using namespace mobile_apis;
- using namespace helpers;
- // TODO(AOleynik): That NONE check is necessary to avoid issue during
+ // Checking for NONE is necessary to avoid issue during
// calculation of HMI level during setting default HMI level
- // Should be investigated (used in multiple places here), since looks weird
- if (Compare<HMILevel::eType, EQ, ONE>(parent()->hmi_level(),
- HMILevel::HMI_BACKGROUND,
- HMILevel::HMI_NONE)) {
+ if (keep_context_ ||
+ mobile_apis::HMILevel::HMI_NONE == parent()->hmi_level()) {
return parent()->hmi_level();
}
- if (is_navi_app(app_id_) || is_voice_communication_app(app_id_)) {
- return HMILevel::HMI_LIMITED;
- }
- return HMILevel::HMI_BACKGROUND;
+
+ return mobile_apis::HMILevel::HMI_BACKGROUND;
}
-EmbeddedNavi::EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
+EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
using namespace mobile_apis;
@@ -192,9 +227,46 @@ mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_media_app(app_id_)) {
- return HMILevel::HMI_LIMITED;
- }
return HMILevel::HMI_BACKGROUND;
}
+
+namespace {
+typedef boost::bimap<HmiState::StateID, std::string> StateID2StrMap;
+const StateID2StrMap kStateID2StrMap =
+ boost::assign::list_of<StateID2StrMap::relation>(
+ HmiState::StateID::STATE_ID_CURRENT, "CURRENT")(
+ HmiState::StateID::STATE_ID_REGULAR, "REGULAR")(
+ HmiState::StateID::STATE_ID_POSTPONED, "POSTPONED")(
+ HmiState::StateID::STATE_ID_PHONE_CALL, "PHONE_CALL")(
+ HmiState::StateID::STATE_ID_SAFETY_MODE, "SAFETY_MODE")(
+ HmiState::StateID::STATE_ID_VR_SESSION, "VR_SESSION")(
+ HmiState::StateID::STATE_ID_TTS_SESSION, "TTS_SESSION")(
+ HmiState::StateID::STATE_ID_VIDEO_STREAMING, "VIDEO_STREAMING")(
+ HmiState::StateID::STATE_ID_NAVI_STREAMING, "NAVI_STREAMING")(
+ HmiState::StateID::STATE_ID_DEACTIVATE_HMI, "DEACTIVATE_HMI")(
+ HmiState::StateID::STATE_ID_AUDIO_SOURCE, "AUDIO_SOURCE")(
+ HmiState::StateID::STATE_ID_EMBEDDED_NAVI, "EMBEDDED_NAVI");
+} // anonymous namespace
+
+std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) {
+ try {
+ os << kStateID2StrMap.left.at(src);
+ } catch (const std::exception&) {
+ // specified element have NOT been found
+ os << "UNRECOGNIZED(" << static_cast<int>(src) << ")";
+ }
+
+ return os;
}
+
+std::ostream& operator<<(std::ostream& os, const HmiState& src) {
+ os << "HMIState(app id:" << src.app_->app_id() << ", state:" << src.state_id()
+ << ", hmi_level:" << src.hmi_level()
+ << ", audio:" << src.audio_streaming_state()
+ << ", video:" << src.video_streaming_state()
+ << ", context:" << src.system_context() << ')';
+
+ return os;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index a7c887d348..332d68adbf 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,9 +64,20 @@ Message::Message(protocol_handler::MessagePriority priority)
, binary_data_(NULL)
, data_size_(0)
, payload_size_(0)
- , version_(kUnknownProtocol) {}
+ , version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {}
-Message::Message(const Message& message) : priority_(message.priority_) {
+Message::Message(const Message& message)
+ : function_id_(0)
+ , correlation_id_(0)
+ , type_(kUnknownType)
+ , priority_(message.priority_)
+ , connection_key_(0)
+ , binary_data_(NULL)
+ , data_size_(0)
+ , payload_size_(0)
+ , version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {
*this = message;
}
@@ -78,7 +89,7 @@ Message& Message::operator=(const Message& message) {
set_data_size(message.data_size_);
set_payload_size(message.payload_size_);
if (message.binary_data_) {
- set_binary_data(message.binary_data_);
+ set_binary_data(static_cast<const BinaryData*>(message.binary_data_));
}
set_json_message(message.json_message_);
set_protocol_version(message.protocol_version());
@@ -87,7 +98,7 @@ Message& Message::operator=(const Message& message) {
return *this;
}
-bool Message::operator==(const Message& message) {
+bool Message::operator==(const Message& message) const {
bool function_id = function_id_ == message.function_id_;
bool correlation_id = correlation_id_ == message.correlation_id_;
bool connection_key = connection_key_ == message.connection_key_;
@@ -96,14 +107,17 @@ bool Message::operator==(const Message& message) {
bool version = version_ == message.version_;
bool data_size = data_size_ == message.data_size_;
bool payload_size = payload_size_ == message.payload_size_;
-
- bool binary_data = std::equal(binary_data_->begin(),
- binary_data_->end(),
- message.binary_data_->begin(),
- BinaryDataPredicate);
+ bool binary_data_available = true;
+ if (binary_data_) {
+ binary_data_available = std::equal(binary_data_->begin(),
+ binary_data_->end(),
+ message.binary_data_->begin(),
+ BinaryDataPredicate);
+ }
return function_id && correlation_id && connection_key && type &&
- binary_data && json_message && version && data_size && payload_size;
+ binary_data_available && json_message && version && data_size &&
+ payload_size;
}
Message::~Message() {
@@ -116,6 +130,10 @@ int32_t Message::function_id() const {
return function_id_;
}
+std::string Message::function_name() const {
+ return function_name_;
+}
+
int32_t Message::correlation_id() const {
return correlation_id_;
}
@@ -128,7 +146,7 @@ MessageType Message::type() const {
return type_;
}
-ProtocolVersion Message::protocol_version() const {
+protocol_handler::MajorProtocolVersion Message::protocol_version() const {
return version_;
}
@@ -156,6 +174,10 @@ void Message::set_function_id(int32_t id) {
function_id_ = id;
}
+void Message::set_function_name(const std::string& name) {
+ function_name_ = name;
+}
+
void Message::set_correlation_id(int32_t id) {
correlation_id_ = id;
}
@@ -168,7 +190,7 @@ void Message::set_message_type(MessageType type) {
type_ = type;
}
-void Message::set_binary_data(BinaryData* data) {
+void Message::set_binary_data(const BinaryData* data) {
if (NULL == data) {
NOTREACHED();
return;
@@ -178,14 +200,15 @@ void Message::set_binary_data(BinaryData* data) {
delete binary_data_;
}
- binary_data_ = data;
+ binary_data_ = new BinaryData(*data);
}
void Message::set_json_message(const std::string& json_message) {
json_message_ = json_message;
}
-void Message::set_protocol_version(ProtocolVersion version) {
+void Message::set_protocol_version(
+ protocol_handler::MajorProtocolVersion version) {
version_ = version;
}
@@ -204,4 +227,11 @@ void Message::set_data_size(size_t data_size) {
void Message::set_payload_size(size_t payload_size) {
payload_size_ = payload_size;
}
+
+bool Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion minVersion,
+ protocol_handler::MajorProtocolVersion version) {
+ return version >= minVersion &&
+ version <= protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5;
+}
} // namespace application_manager
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index c0567b75f0..e99db3bece 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -38,9 +41,11 @@
#include <set>
#include <string>
+#include <strings.h>
#include <algorithm>
#include <utility>
#include <map>
+#include <functional>
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
@@ -48,17 +53,20 @@
#include "application_manager/message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/rpc_service.h"
#include "connection_handler/connection_handler_impl.h"
+#include "transport_manager/common.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/file_system.h"
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#include "formatters/formatter_json_rpc.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "json/json.h"
+#include "formatters/CFormatterJsonBase.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -69,6 +77,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},
@@ -86,109 +96,178 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
// Check if image parameter is valid
if (button.keyExists(strings::image)) {
SmartObject& buttonImage = button[strings::image];
-
- // Image name must not be empty and must not contain incorrect
- // character
- if (false == MessageHelper::VerifySoftButtonString(
- buttonImage[strings::value].asString())) {
+ if (false ==
+ MessageHelper::VerifyString(buttonImage[strings::value].asString())) {
return false;
}
}
}
return true;
-} // namespace
}
-std::pair<std::string, VehicleDataType> kVehicleDataInitializer[] = {
- std::make_pair(strings::gps, VehicleDataType::GPS),
- std::make_pair(strings::speed, VehicleDataType::SPEED),
- std::make_pair(strings::rpm, VehicleDataType::RPM),
- std::make_pair(strings::fuel_level, VehicleDataType::FUELLEVEL),
- std::make_pair(strings::fuel_level_state, VehicleDataType::FUELLEVEL_STATE),
+
+struct GroupsAppender
+ : std::unary_function<void, const PermissionsList::value_type&> {
+ GroupsAppender(smart_objects::SmartObject& groups)
+ : groups_(groups), index_(0) {}
+
+ void operator()(const PermissionsList::value_type& item) {
+ using namespace smart_objects;
+ using namespace policy;
+ groups_[index_] = SmartObject(SmartType_Map);
+
+ SmartObject& group = groups_[index_];
+ group[strings::name] = item.group_alias;
+ group[strings::id] = item.group_id;
+ GroupConsent permission_state = item.state;
+ // If state undefined, 'allowed' parameter should be absent
+ if (kGroupUndefined != permission_state) {
+ group["allowed"] = kGroupAllowed == permission_state;
+ }
+ ++index_;
+ }
+
+ private:
+ smart_objects::SmartObject& groups_;
+ int32_t index_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+struct ExternalConsentStatusAppender
+ : std::unary_function<void,
+ const policy::ExternalConsentStatus::value_type&> {
+ ExternalConsentStatusAppender(smart_objects::SmartObject& status)
+ : status_(status), index_(0) {}
+
+ void operator()(const policy::ExternalConsentStatus::value_type& item) {
+ using namespace smart_objects;
+ using namespace policy;
+ using namespace hmi_apis;
+ status_[index_] = SmartObject(SmartType_Map);
+
+ SmartObject& external_consent_status = status_[index_];
+ external_consent_status[strings::entity_type] = item.entity_type_;
+ external_consent_status[strings::entity_id] = item.entity_id_;
+ external_consent_status[strings::status] =
+ policy::kStatusOn == item.status_
+ ? static_cast<int32_t>(Common_EntityStatus::ON)
+ : static_cast<int32_t>(Common_EntityStatus::OFF);
+ ++index_;
+ }
+
+ private:
+ smart_objects::SmartObject& status_;
+ int32_t index_;
+};
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+} // namespace
+
+std::pair<std::string,
+ mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = {
+ std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
+ std::make_pair(strings::speed,
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
+ std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
+ std::make_pair(strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
+ std::make_pair(strings::fuel_level_state,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
std::make_pair(strings::instant_fuel_consumption,
- VehicleDataType::FUELCONSUMPTION),
- std::make_pair(strings::external_temp, VehicleDataType::EXTERNTEMP),
- std::make_pair(strings::vin, VehicleDataType::VIN),
- std::make_pair(strings::prndl, VehicleDataType::PRNDL),
- std::make_pair(strings::tire_pressure, VehicleDataType::TIREPRESSURE),
- std::make_pair(strings::odometer, VehicleDataType::ODOMETER),
- std::make_pair(strings::belt_status, VehicleDataType::BELTSTATUS),
- std::make_pair(strings::body_information, VehicleDataType::BODYINFO),
- std::make_pair(strings::device_status, VehicleDataType::DEVICESTATUS),
- std::make_pair(strings::driver_braking, VehicleDataType::BRAKING),
- std::make_pair(strings::wiper_status, VehicleDataType::WIPERSTATUS),
- std::make_pair(strings::head_lamp_status, VehicleDataType::HEADLAMPSTATUS),
- std::make_pair(strings::e_call_info, VehicleDataType::ECALLINFO),
- std::make_pair(strings::airbag_status, VehicleDataType::AIRBAGSTATUS),
- std::make_pair(strings::emergency_event, VehicleDataType::EMERGENCYEVENT),
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
+ std::make_pair(strings::fuel_range,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE),
+ std::make_pair(strings::external_temp,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
+ std::make_pair(strings::turn_signal,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL),
+ std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
+ std::make_pair(strings::prndl,
+ mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
+ std::make_pair(strings::tire_pressure,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
+ std::make_pair(strings::odometer,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
+ std::make_pair(strings::belt_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(
+ strings::electronic_park_brake_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ELECTRONICPARKBRAKESTATUS),
+ std::make_pair(strings::body_information,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
+ std::make_pair(strings::device_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
+ std::make_pair(strings::driver_braking,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
+ std::make_pair(strings::wiper_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
+ std::make_pair(strings::head_lamp_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
+ std::make_pair(strings::airbag_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
+ std::make_pair(strings::emergency_event,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
std::make_pair(strings::cluster_mode_status,
- VehicleDataType::CLUSTERMODESTATUS),
- std::make_pair(strings::my_key, VehicleDataType::MYKEY),
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
+ std::make_pair(strings::my_key,
+ mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
/*
NOT DEFINED in mobile API
- std::make_pair(strings::gps, VehicleDataType::BATTVOLTAGE),
+ std::make_pair(strings::gps,
+ BATTVOLTAGE),
*/
- std::make_pair(strings::engine_torque, VehicleDataType::ENGINETORQUE),
- std::make_pair(strings::acc_pedal_pos, VehicleDataType::ACCPEDAL),
+ std::make_pair(strings::engine_torque,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
std::make_pair(strings::steering_wheel_angle,
- VehicleDataType::STEERINGWHEEL),
-};
+ mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
+ std::make_pair(strings::engine_oil_life,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)};
const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
kVehicleDataInitializer + ARRAYSIZE(kVehicleDataInitializer));
-#ifdef HMI_DBUS_API
-namespace {
-struct VehicleInfo_Requests {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-static VehicleInfo_Requests ivi_subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ using smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr object(
+ new SmartObject(smart_objects::SmartType_Map));
+ (*object)[strings::params][strings::message_type] =
+ static_cast<int>(kNotification);
+ (*object)[strings::params][strings::function_id] = function_id;
+ (*object)[strings::params][strings::connection_key] = app_id;
+ (*object)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*object)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ (*object)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ return object;
+}
+
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
+MessageHelper::CreateHMINotification(hmi_apis::FunctionID::eType function_id) {
+ using smart_objects::SmartObject;
+ using smart_objects::SmartObjectSPtr;
+ using smart_objects::SmartType_Map;
+ LOG4CXX_AUTO_TRACE(logger_);
+ SmartObjectSPtr notification_ptr =
+ std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& notification = *notification_ptr;
+ notification[strings::params][strings::message_type] =
+ static_cast<int32_t>(kNotification);
+ notification[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ notification[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ notification[strings::params][strings::function_id] = function_id;
+
+ return notification_ptr;
}
-#endif // #ifdef HMI_DBUS_API
const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
CommonAppPriorityMap::const_iterator it = app_priority_values.find(priority);
@@ -198,20 +277,9 @@ 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;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Language::eType value;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::StringToEnum(
language, &value)) {
@@ -220,28 +288,48 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
return hmi_apis::Common_Language::INVALID_ENUM;
}
-smart_objects::SmartObjectSPtr MessageHelper::CreateRequestObject(
- const uint32_t correlation_id) {
+std::string MessageHelper::GetDeviceMacAddressForHandle(
+ const transport_manager::DeviceHandle 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 ns_smart_device_link::ns_smart_objects;
+ const char* str = 0;
+ if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
+ language, &str)) {
+ return str ? str : "";
+ }
+ return std::string();
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
- SmartObjectSPtr request = utils::MakeShared<SmartObject>(SmartType_Map);
- SmartObject& ref = *request;
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& ref = *message;
- ref[strings::params][strings::message_type] =
- static_cast<int>(hmi_apis::messageType::request);
+ ref[strings::params][strings::message_type] = static_cast<int>(message_type);
ref[strings::params][strings::protocol_version] =
commands::CommandImpl::protocol_version_;
ref[strings::params][strings::protocol_type] =
commands::CommandImpl::hmi_protocol_type_;
ref[strings::params][strings::correlation_id] = correlation_id;
- return request;
+ return message;
}
smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
mobile_apis::FunctionID::OnHashChangeID;
@@ -254,8 +342,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name,
ApplicationManager& app_mngr) {
using namespace smart_objects;
- SmartObjectSPtr message =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
DCHECK(message);
SmartObject& object = *message;
@@ -267,7 +355,21 @@ void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name,
msg_params[hmi_request::file_name] = file_name;
object[strings::msg_params] = msg_params;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
+}
+
+void MessageHelper::SendGetSystemTimeRequest(const uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ SmartObjectSPtr message =
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
+
+ DCHECK(message);
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_GetSystemTime;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendHashUpdateNotification(const uint32_t app_id,
@@ -280,7 +382,8 @@ void MessageHelper::SendHashUpdateNotification(const uint32_t app_id,
}
smart_objects::SmartObjectSPtr so = CreateHashUpdateNotification(app_id);
PrintSmartObject(*so);
- if (!app_mngr.ManageMobileCommand(so, commands::Command::ORIGIN_SDL)) {
+ if (!app_mngr.GetRPCService().ManageMobileCommand(
+ so, commands::Command::SOURCE_SDL)) {
LOG4CXX_ERROR(logger_, "Failed to send HashUpdate notification.");
return;
}
@@ -294,7 +397,7 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] = static_cast<int32_t>(
@@ -310,13 +413,226 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
return notification;
}
+void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::cmd_id] = (*cmd)[strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ if ((*cmd).keyExists(strings::menu_params)) {
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+
+ if ((*cmd).keyExists(strings::vr_commands)) {
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] = (*cmd)[strings::menu_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_DeleteSubMenu;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+
+ const DataAccessor<CommandsMap> accessor = application->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ if ((*cmd)[strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+ }
+}
+
+void MessageHelper::SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+
+ // Same is deleted with SendDeleteCommandRequest?
+
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*cmd)[strings::grammar_id];
+ cmd = &((*cmd)[strings::choice_set]);
+ for (uint32_t i = 0; i < (*cmd).length(); ++i) {
+ msg_params[strings::cmd_id] = (*cmd)[i][strings::choice_id];
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+
+ {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params = *MessageHelper::CreateAppVrHelp(application);
+ msg_params[hmi_request::menu_title] = "";
+
+ smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ key_board_properties[strings::language] =
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
+ key_board_properties[hmi_request::keyboard_layout] =
+ static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
+
+ key_board_properties[hmi_request::auto_complete_text] = "";
+ msg_params[hmi_request::keyboard_properties] = key_board_properties;
+
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_SetGlobalProperties;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+
+ {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::help_prompt] = application->help_prompt();
+ msg_params[strings::timeout_prompt] = application->timeout_prompt();
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::TTS_SetGlobalProperties;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::name] = button;
+ msg_params[strings::is_suscribed] = false;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::notification, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(message);
+}
+
const VehicleData& MessageHelper::vehicle_data() {
return vehicle_data_;
}
std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::EnumToCString(
hmi_result, &str)) {
@@ -327,7 +643,7 @@ std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
const std::string& hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Result::eType value;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::StringToEnum(
hmi_result, &value)) {
@@ -338,7 +654,7 @@ hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::Result::eType>::EnumToCString(
mobile_result, &str)) {
@@ -349,7 +665,7 @@ std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType MessageHelper::MobileResultFromString(
const std::string& mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::Result::eType value;
if (EnumConversionHelper<mobile_apis::Result::eType>::StringToEnum(
mobile_result, &value)) {
@@ -376,9 +692,98 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
return HMIResultFromString(result);
}
+void MessageHelper::SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
+ if (!notification) {
+ LOG4CXX_ERROR(logger_, "Failed to create smart object");
+ return;
+ }
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_api::FunctionID::OnHMIStatusID);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ message[strings::params][strings::connection_key] =
+ static_cast<int32_t>(application_impl.app_id());
+
+ message[strings::msg_params][strings::hmi_level] =
+ static_cast<int32_t>(application_impl.hmi_level());
+
+ message[strings::msg_params][strings::audio_streaming_state] =
+ static_cast<int32_t>(application_impl.audio_streaming_state());
+
+ message[strings::msg_params][strings::system_context] =
+ static_cast<int32_t>(application_impl.system_context());
+
+ application_manager.GetRPCService().ManageMobileCommand(
+ notification, commands::Command::SOURCE_SDL);
+}
+
+void MessageHelper::SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ application_manager::ApplicationConstSharedPtr app =
+ application_manager.application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id);
+ return;
+ }
+
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] =
+ application_manager.GetNextHMICorrelationID();
+ (*message)[strings::msg_params][strings::app_id] = app_id;
+
+ if (send_policy_priority) {
+ std::string priority;
+ application_manager.GetPolicyHandler().GetPriority(app->policy_app_id(),
+ &priority);
+ // According SDLAQ-CRS-2794
+ // SDL have to send ActivateApp without "proirity" parameter to HMI.
+ // in case of unconsented device
+ std::string mac_adress;
+ connection_handler::DeviceHandle device_handle = app->device();
+ application_manager.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL);
+
+ policy::DeviceConsent consent =
+ application_manager.GetPolicyHandler().GetUserConsentForDevice(
+ mac_adress);
+ if (!priority.empty() &&
+ (policy::DeviceConsent::kDeviceAllowed == consent)) {
+ (*message)[strings::msg_params][strings::priority] =
+ GetPriorityCode(priority);
+ }
+ }
+
+ // We haven't send HMI level to HMI in case it FULL.
+ if (hmi_apis::Common_HMILevel::INVALID_ENUM != level &&
+ hmi_apis::Common_HMILevel::FULL != level) {
+ (*message)[strings::msg_params][strings::activate_app_hmi_level] = level;
+ }
+
+ application_manager.GetRPCService().ManageHMICommand(message);
+}
+
mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
const std::string& hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::HMILevel::eType value;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::StringToEnum(
hmi_level, &value)) {
@@ -389,7 +794,7 @@ mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
std::string MessageHelper::StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
hmi_level, &str)) {
@@ -401,7 +806,7 @@ std::string MessageHelper::StringifiedHMILevel(
std::string MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::FunctionID::eType>::EnumToCString(
function_id, &str)) {
@@ -414,103 +819,13 @@ std::string MessageHelper::StringifiedFunctionID(
return std::string();
}
-#ifdef HMI_DBUS_API
-namespace {
-const std::map<std::string, uint16_t> create_get_vehicle_data_args() {
- std::map<std::string, uint16_t> rc;
- rc.insert(std::make_pair(strings::gps,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData));
- rc.insert(std::make_pair(strings::speed,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed));
- rc.insert(
- std::make_pair(strings::rpm, hmi_apis::FunctionID::VehicleInfo_GetRpm));
- rc.insert(std::make_pair(strings::fuel_level,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel));
- rc.insert(
- std::make_pair(strings::fuel_level_state,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState));
- rc.insert(std::make_pair(
- strings::instant_fuel_consumption,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption));
- rc.insert(
- std::make_pair(strings::external_temp,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature));
- rc.insert(
- std::make_pair(strings::vin, hmi_apis::FunctionID::VehicleInfo_GetVin));
- rc.insert(std::make_pair(strings::prndl,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl));
- rc.insert(std::make_pair(strings::tire_pressure,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure));
- rc.insert(std::make_pair(strings::odometer,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer));
- rc.insert(std::make_pair(strings::belt_status,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus));
- rc.insert(
- std::make_pair(strings::body_information,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation));
- rc.insert(std::make_pair(strings::device_status,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus));
- rc.insert(std::make_pair(strings::driver_braking,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking));
- rc.insert(std::make_pair(strings::wiper_status,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus));
- rc.insert(
- std::make_pair(strings::head_lamp_status,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus));
- rc.insert(std::make_pair(strings::engine_torque,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque));
- rc.insert(
- std::make_pair(strings::acc_pedal_pos,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition));
- rc.insert(
- std::make_pair(strings::steering_wheel_angle,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle));
- rc.insert(std::make_pair(strings::e_call_info,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo));
- rc.insert(std::make_pair(strings::airbag_status,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus));
- rc.insert(
- std::make_pair(strings::emergency_event,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent));
- rc.insert(
- std::make_pair(strings::cluster_mode_status,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus));
- rc.insert(std::make_pair(strings::my_key,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey));
- return rc;
-}
-static std::map<std::string, uint16_t> vehicle_data_args =
- create_get_vehicle_data_args();
-}
-#endif
-
void MessageHelper::CreateGetVehicleDataRequest(
const uint32_t correlation_id,
const std::vector<std::string>& params,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
-#ifdef HMI_DBUS_API
- for (std::vector<std::string>::const_iterator it = params.begin();
- it != params.end();
- it++) {
- smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
-
- (*request)[strings::params][strings::message_type] =
- static_cast<int>(kRequest);
- (*request)[strings::params][strings::correlation_id] = correlation_id;
- (*request)[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- (*request)[strings::params][strings::protocol_type] =
- commands::CommandImpl::hmi_protocol_type_;
- (*request)[strings::params][strings::function_id] =
- static_cast<int>(vehicle_data_args[*it]);
- app_mngr.ManageHMICommand(request);
- }
-#else
-
smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*request)[strings::params][strings::message_type] =
static_cast<int>(kRequest);
@@ -528,8 +843,7 @@ void MessageHelper::CreateGetVehicleDataRequest(
it++) {
(*request)[strings::msg_params][*it] = true;
}
- app_mngr.ManageHMICommand(request);
-#endif
+ app_mngr.GetRPCService().ManageHMICommand(request);
}
smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
@@ -539,7 +853,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[strings::params][strings::function_id] =
static_cast<int>(function_id);
@@ -552,8 +866,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
(*response)[strings::params][strings::connection_key] = connection_key;
(*response)[strings::params][strings::protocol_type] =
commands::CommandImpl::mobile_protocol_type_;
- (*response)[strings::params][strings::protocol_version] =
- static_cast<int>(kV2);
+ (*response)[strings::params][strings::protocol_version] = static_cast<int>(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2);
return response;
}
@@ -563,16 +877,19 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr device_list_so =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*device_list_so)[strings::device_list] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
smart_objects::SmartObject& list_so = (*device_list_so)[strings::device_list];
- int32_t index = 0;
+ uint32_t index = 0;
+ // According to requirements, SDL should send info about 100 devices at
+ // maximum, even if SDL has more devices connected.
+ const uint32_t max_device_count = 100;
for (connection_handler::DeviceMap::const_iterator it = devices.begin();
- devices.end() != it;
+ devices.end() != it && index < max_device_count;
++it) {
const connection_handler::Device& d =
static_cast<connection_handler::Device>(it->second);
@@ -594,7 +911,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
uint32_t function_id, ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr module_info =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& object = *module_info;
object[strings::params][strings::message_type] = static_cast<int>(kRequest);
@@ -610,7 +927,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
const std::string& path_to_icon, uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr set_icon =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!set_icon) {
@@ -627,79 +944,6 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
return set_icon;
}
-bool MessageHelper::SendIVISubscribtions(const uint32_t app_id,
- ApplicationManager& app_mngr) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- bool result = true;
- ApplicationSharedPtr app = app_mngr.application(app_id);
-
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid application " << app_id);
- return result;
- }
-
- smart_objects::SmartObjectList requests =
- GetIVISubscriptionRequests(app, app_mngr);
- for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
- it != requests.end();
- ++it) {
- if (!app_mngr.ManageHMICommand(*it)) {
- result = false;
- }
- }
- return result;
-}
-
-smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- smart_objects::SmartObjectList hmi_requests;
- if (!app.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer ");
- return hmi_requests;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app->app_id();
- const VehicleData& vehicle_data = MessageHelper::vehicle_data_;
- VehicleData::const_iterator ivi_it = vehicle_data.begin();
- DataAccessor<VehicleInfoSubscriptions> vi_accessor = app->SubscribedIVI();
- const VehicleInfoSubscriptions& subscriptions = vi_accessor.GetData();
-
- for (; vehicle_data.end() != ivi_it; ++ivi_it) {
- uint32_t type_id = static_cast<int>(ivi_it->second);
- if (subscriptions.end() != subscriptions.find(type_id)) {
- std::string key_name = ivi_it->first;
- msg_params[key_name] = true;
- }
- }
-
-#ifdef HMI_JSON_API
- smart_objects::SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO(
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, app_mngr);
- (*request)[strings::msg_params] = msg_params;
- hmi_requests.push_back(request);
-#endif // #ifdef HMI_JSON_API
-#ifdef HMI_DBUS_API
- // Generate list of ivi_subrequests
- for (size_t i = 0; i < sizeof(ivi_subrequests) / sizeof(ivi_subrequests[0]);
- ++i) {
- const VehicleInfo_Requests& sr = ivi_subrequests[i];
- if (true == msg_params.keyExists(sr.str) &&
- true == msg_params[sr.str].asBool()) {
- smart_objects::SmartObjectSPtr request =
- MessageHelper::CreateModuleInfoSO(sr.func_id);
- (*request)[strings::msg_params] = msg_params;
- hmi_requests.push_back(request);
- }
- }
-#endif // #ifdef HMI_DBUS_API
- return hmi_requests;
-}
-
void MessageHelper::SendOnButtonSubscriptionNotification(
uint32_t app_id,
hmi_apis::Common_ButtonName::eType button,
@@ -710,7 +954,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification(
LOG4CXX_AUTO_TRACE(logger_);
SmartObjectSPtr notification_ptr =
- utils::MakeShared<SmartObject>(SmartType_Map);
+ std::make_shared<SmartObject>(SmartType_Map);
if (!notification_ptr) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -732,7 +976,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification(
hmi_apis::FunctionID::Buttons_OnButtonSubscription;
notification[strings::msg_params] = msg_params;
- if (!app_mngr.ManageHMICommand(notification_ptr)) {
+ if (!app_mngr.GetRPCService().ManageHMICommand(notification_ptr)) {
LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
}
}
@@ -744,7 +988,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application pointer ");
return;
}
@@ -768,7 +1012,9 @@ void MessageHelper::SendSetAppIcon(
using namespace smart_objects;
SmartObjectSPtr set_app_icon =
- CreateRequestObject(application_manager.GetNextHMICorrelationID());
+ CreateMessageForHMI(hmi_apis::messageType::request,
+ application_manager.GetNextHMICorrelationID());
+
if (set_app_icon) {
SmartObject& so_to_send = *set_app_icon;
so_to_send[strings::params][strings::function_id] =
@@ -782,7 +1028,7 @@ void MessageHelper::SendSetAppIcon(
if (msg_params) {
so_to_send[strings::msg_params] = *msg_params;
}
- application_manager.ManageHMICommand(set_app_icon);
+ application_manager.GetRPCService().ManageHMICommand(set_app_icon);
}
}
@@ -790,7 +1036,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_man) {
LOG4CXX_AUTO_TRACE(logger_);
if (app) {
- SendSetAppIcon(app, app->app_icon_path(), app_man);
+ SendSetAppIcon(app->app_id(), app->app_icon_path(), app_man);
SendGlobalPropertiesToHMI(app, app_man);
SendShowRequestToHMI(app, app_man);
}
@@ -798,7 +1044,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app,
void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -808,7 +1054,7 @@ void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::const_iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -818,16 +1064,26 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectList requests;
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return requests;
}
+ auto& help_prompt_manager =
+ const_cast<Application*>(app.get())->help_prompt_manager();
+
+ const bool can_send_ui = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendVRHelp,
+ HelpPromptManager::SendingType::kSendBoth);
+
// UI global properties
- if (app->vr_help_title() || app->vr_help()) {
+ if (can_send_ui && (app->vr_help_title() || app->vr_help())) {
smart_objects::SmartObjectSPtr ui_global_properties =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_global_properties) {
return requests;
}
@@ -859,10 +1115,17 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
requests.push_back(ui_global_properties);
}
+ const bool can_send_vr = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendHelpPrompt,
+ HelpPromptManager::SendingType::kSendBoth);
+
// TTS global properties
- if (app->help_prompt() || app->timeout_prompt()) {
+ if (can_send_vr && (app->help_prompt() || app->timeout_prompt())) {
smart_objects::SmartObjectSPtr tts_global_properties =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!tts_global_properties) {
return requests;
}
@@ -894,8 +1157,9 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
if (!app) {
return;
}
- smart_objects::SmartObjectSPtr tts_global_properties =
- CreateRequestObject(app_man.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr tts_global_properties = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_man.GetNextHMICorrelationID());
+
if (tts_global_properties) {
smart_objects::SmartObject& so_to_send = *tts_global_properties;
so_to_send[strings::params][strings::function_id] =
@@ -926,14 +1190,14 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
app->set_help_prompt(msg_params[strings::help_prompt]);
msg_params[strings::app_id] = app->app_id();
so_to_send[strings::msg_params] = msg_params;
- app_man.ManageHMICommand(tts_global_properties);
+ app_man.GetRPCService().ManageHMICommand(tts_global_properties);
}
}
smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp(
ApplicationConstSharedPtr app) {
smart_objects::SmartObjectSPtr result =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!result) {
return NULL;
@@ -973,7 +1237,7 @@ smart_objects::SmartObjectList MessageHelper::CreateShowRequestToHMI(
if (app->show_command()) {
smart_objects::SmartObjectSPtr ui_show =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
(*ui_show)[strings::params][strings::function_id] =
static_cast<int>(hmi_apis::FunctionID::UI_Show);
@@ -994,7 +1258,7 @@ void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::const_iterator it = shows.begin();
it != shows.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1005,8 +1269,8 @@ void MessageHelper::SendShowConstantTBTRequestToHMI(
}
if (app->tbt_show_command()) {
- smart_objects::SmartObjectSPtr navi_show_tbt =
- CreateRequestObject(app_man.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr navi_show_tbt = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_man.GetNextHMICorrelationID());
if (!navi_show_tbt) {
return;
}
@@ -1014,7 +1278,7 @@ void MessageHelper::SendShowConstantTBTRequestToHMI(
static_cast<int>(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
(*navi_show_tbt)[strings::msg_params] = (*app->tbt_show_command());
- DCHECK(app_man.ManageHMICommand(navi_show_tbt));
+ DCHECK(app_man.GetRPCService().ManageHMICommand(navi_show_tbt));
}
}
@@ -1028,7 +1292,7 @@ void MessageHelper::SendAddCommandRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_man.ManageHMICommand(*it));
+ DCHECK(app_man.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1046,8 +1310,8 @@ smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
for (; commands.end() != i; ++i) {
// UI Interface
if ((*i->second).keyExists(strings::menu_params)) {
- smart_objects::SmartObjectSPtr ui_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr ui_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!ui_command) {
return requests;
}
@@ -1099,8 +1363,8 @@ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
(*(it->second))[strings::grammar_id].asUInt();
const size_t size = (*(it->second))[strings::choice_set].length();
for (size_t j = 0; j < size; ++j) {
- smart_objects::SmartObjectSPtr vr_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr vr_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!vr_command) {
return requests;
}
@@ -1133,8 +1397,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
const uint32_t app_id,
const smart_objects::SmartObject* app_types,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!command) {
return NULL;
}
@@ -1156,7 +1420,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
void MessageHelper::SendUIChangeRegistrationRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application is not valid");
return;
}
@@ -1170,7 +1434,7 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
app_mngr);
if (ui_command) {
- app_mngr.ManageHMICommand(ui_command);
+ app_mngr.GetRPCService().ManageHMICommand(ui_command);
}
}
}
@@ -1182,7 +1446,7 @@ void MessageHelper::SendAddVRCommandToHMI(
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr request =
CreateAddVRCommandToHMI(cmd_id, vr_commands, app_id, app_mngr);
- DCHECK(app_mngr.ManageHMICommand(request));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(request));
}
smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
@@ -1190,8 +1454,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
const smart_objects::SmartObject& vr_commands,
uint32_t app_id,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr vr_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr vr_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!vr_command) {
return NULL;
}
@@ -1217,13 +1481,47 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
return vr_command;
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ DCHECK_OR_RETURN(output, false);
+
+ std::string device_name;
+ std::string mac_address;
+ std::string transport_type;
+ if (-1 ==
+ session_observer.GetDataOnDeviceID(
+ device_handle, &device_name, NULL, &mac_address, &transport_type)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to extract information for device " << device_handle);
+ }
+
+ smart_objects::SmartObject& device_info_map = *output;
+ device_info_map = smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ device_info_map[strings::name] = device_name;
+ device_info_map[strings::id] = mac_address;
+ device_info_map[strings::transport_type] =
+ app_mngr.GetDeviceTransportType(transport_type);
+
+ const policy::DeviceConsent device_consent =
+ policy_handler.GetUserConsentForDevice(mac_address);
+ device_info_map[strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+
+ return true;
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
- NsSmartDeviceLink::NsSmartObjects::SmartObject* output,
+ ns_smart_device_link::ns_smart_objects::SmartObject* output,
ApplicationManager& app_mngr) {
- using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
DCHECK_OR_RETURN(output, false);
SmartObject& message = *output;
@@ -1235,15 +1533,9 @@ bool MessageHelper::CreateHMIApplicationStruct(
const smart_objects::SmartObject* app_types = app->app_types();
const smart_objects::SmartObject* ngn_media_screen_name =
app->ngn_media_screen_name();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- app->device(), &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << app->device());
- }
+ const smart_objects::SmartObject* day_color_scheme = app->day_color_scheme();
+ const smart_objects::SmartObject* night_color_scheme =
+ app->night_color_scheme();
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
message[strings::app_name] = app->name();
@@ -1272,23 +1564,38 @@ bool MessageHelper::CreateHMIApplicationStruct(
message[strings::app_type] = *app_types;
}
+ if (day_color_scheme) {
+ message[strings::day_color_scheme] = *day_color_scheme;
+ }
+
+ if (night_color_scheme) {
+ message[strings::night_color_scheme] = *night_color_scheme;
+ }
+
message[strings::device_info] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- message[strings::device_info][strings::name] = device_name;
- message[strings::device_info][strings::id] = mac_address;
- const policy::DeviceConsent device_consent =
- policy_handler.GetUserConsentForDevice(mac_address);
- message[strings::device_info][strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
+ smart_objects::SmartObject& device_info = message[strings::device_info];
+ CreateDeviceInfo(
+ app->device(), session_observer, policy_handler, app_mngr, &device_info);
+
+ if (app->secondary_device() != 0) {
+ message[strings::secondary_device_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ message[strings::secondary_device_info];
+ CreateDeviceInfo(app->secondary_device(),
+ session_observer,
+ policy_handler,
+ app_mngr,
+ &secondary_device_info);
+ }
- message[strings::device_info][strings::transport_type] =
- app_mngr.GetDeviceTransportType(transport_type);
return true;
}
void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -1298,7 +1605,7 @@ void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app,
for (smart_objects::SmartObjectList::iterator it = requests.begin();
it != requests.end();
++it) {
- DCHECK(app_mngr.ManageHMICommand(*it));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(*it));
}
}
@@ -1310,7 +1617,7 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
SubMenuMap::const_iterator i = sub_menu.begin();
for (; sub_menu.end() != i; ++i) {
smart_objects::SmartObjectSPtr ui_sub_menu =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_sub_menu) {
return requsets;
}
@@ -1328,6 +1635,12 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
(*i->second)[strings::menu_name];
msg_params[strings::app_id] = app->app_id();
(*ui_sub_menu)[strings::msg_params] = msg_params;
+ if (((*i->second).keyExists(strings::menu_icon)) &&
+ (0 < (*i->second)[strings::menu_icon][strings::value].length())) {
+ msg_params[strings::menu_icon] = (*i->second)[strings::menu_icon];
+ msg_params[strings::menu_icon][strings::value] =
+ (*i->second)[strings::menu_icon][strings::value].asString();
+ }
requsets.push_back(ui_sub_menu);
}
return requsets;
@@ -1338,7 +1651,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
bool is_unexpected_disconnect,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& message = *notification;
@@ -1349,12 +1662,12 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
message[strings::params][strings::message_type] = MessageType::kNotification;
// we put hmi_app_id because applicaton list does not contain application on
// this momment
- // and ReplaceHMIByMobileAppId function will be unable to replace app_id to
+ // and ReplaceHMIWithMobileAppId function will be unable to replace app_id to
// hmi_app_id
message[strings::msg_params][strings::app_id] = app->hmi_app_id();
message[strings::msg_params][strings::unexpected_disconnect] =
is_unexpected_disconnect;
- app_mngr.ManageHMICommand(notification);
+ app_mngr.GetRPCService().ManageHMICommand(notification);
}
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
@@ -1368,7 +1681,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
@@ -1378,8 +1691,6 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
if (send_policy_priority) {
std::string priority;
- // TODO(KKolodiy): need remove method policy_manager
-
policy_handler.GetPriority(app->policy_app_id(), &priority);
// According SDLAQ-CRS-2794
// SDL have to send ActivateApp without "proirity" parameter to HMI.
@@ -1413,8 +1724,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
return;
}
- utils::SharedPtr<smart_objects::SmartObject> message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1425,7 +1736,7 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
app_mngr.GetNextHMICorrelationID();
(*message)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendSDLActivateAppResponse(
@@ -1433,7 +1744,7 @@ void MessageHelper::SendSDLActivateAppResponse(
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1476,13 +1787,13 @@ void MessageHelper::SendSDLActivateAppResponse(
hmi_apis::Common_Result::REJECTED;
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendOnSDLConsentNeeded(
const policy::DeviceParams& device_info, ApplicationManager& app_man) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1494,15 +1805,15 @@ void MessageHelper::SendOnSDLConsentNeeded(
device_info.device_mac_address;
(*message)[strings::msg_params]["device"]["name"] = device_info.device_name;
- app_man.ManageHMICommand(message);
+ app_man.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendPolicyUpdate(const std::string& file_path,
const uint32_t timeout,
const std::vector<int>& retries,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr message =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
smart_objects::SmartObject& object = *message;
object[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_PolicyUpdate;
@@ -1514,7 +1825,7 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path,
for (size_t i = 0; i < retries.size(); ++i) {
object[strings::msg_params][hmi_request::retry][i] = retries[i];
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendGetUserFriendlyMessageResponse(
const std::vector<policy::UserFriendlyMessage>& msg,
@@ -1522,7 +1833,8 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1535,7 +1847,7 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
// If no any messages found - skip sending of "messages" param
if (msg.empty()) {
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
return;
}
@@ -1580,49 +1892,82 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
#endif // EXTERNAL_PROPRIETARY_MODE
}
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().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 = std::make_shared<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);
+
+ 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.GetRPCService().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 = std::make_shared<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];
- app_mngr.ManageHMICommand(
- utils::MakeShared<smart_objects::SmartObject>(message));
+ GroupsAppender groups_appender(allowed_functions_array);
+ std::for_each(permissions.begin(), permissions.end(), groups_appender);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
+#endif // EXTERNAL_PROPRIETARY_MODE
smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
uint32_t connection_key,
@@ -1642,14 +1987,34 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
response_data[strings::msg_params][strings::success] = false;
response_data[strings::params][strings::connection_key] = connection_key;
- return utils::MakeShared<smart_objects::SmartObject>(response_data);
+ return std::make_shared<smart_objects::SmartObject>(response_data);
+}
+
+void MessageHelper::SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr request = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ if (!request) {
+ return;
+ }
+
+ (*request)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_SetVideoConfig;
+
+ (*request)[strings::msg_params][strings::app_id] = app_id;
+ (*request)[strings::msg_params][strings::config] = video_params;
+
+ app_mngr.GetRPCService().ManageHMICommand(request);
}
void MessageHelper::SendNaviStartStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr start_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr start_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!start_stream) {
return;
}
@@ -1681,14 +2046,14 @@ void MessageHelper::SendNaviStartStream(const int32_t app_id,
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
(*start_stream)[strings::msg_params][strings::url] = url;
- app_mngr.ManageHMICommand(start_stream);
+ app_mngr.GetRPCService().ManageHMICommand(start_stream);
}
void MessageHelper::SendNaviStopStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr stop_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr stop_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!stop_stream) {
return;
}
@@ -1698,14 +2063,14 @@ void MessageHelper::SendNaviStopStream(const int32_t app_id,
(*stop_stream)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(stop_stream);
+ app_mngr.GetRPCService().ManageHMICommand(stop_stream);
}
void MessageHelper::SendAudioStartStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr start_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr start_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!start_stream) {
return;
@@ -1738,14 +2103,14 @@ void MessageHelper::SendAudioStartStream(const int32_t app_id,
(*start_stream)[strings::msg_params][strings::app_id] = app_id;
(*start_stream)[strings::msg_params][strings::url] = url;
- DCHECK(app_mngr.ManageHMICommand(start_stream));
+ DCHECK(app_mngr.GetRPCService().ManageHMICommand(start_stream));
}
void MessageHelper::SendAudioStopStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr stop_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr stop_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!stop_stream) {
return;
@@ -1756,7 +2121,7 @@ void MessageHelper::SendAudioStopStream(const int32_t app_id,
(*stop_stream)[strings::msg_params][strings::app_id] = app_id;
- app_mngr.ManageHMICommand(stop_stream);
+ app_mngr.GetRPCService().ManageHMICommand(stop_stream);
}
void MessageHelper::SendOnDataStreaming(
@@ -1772,7 +2137,7 @@ void MessageHelper::SendOnDataStreaming(
}
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*notification)[strings::params][strings::function_id] =
@@ -1788,31 +2153,31 @@ void MessageHelper::SendOnDataStreaming(
(*notification)[strings::msg_params]["available"] = available;
- app_mngr.ManageHMICommand(notification);
+ app_mngr.GetRPCService().ManageHMICommand(notification);
}
bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
LOG4CXX_INFO(logger_, "MessageHelper::SendAudioStopAudioPathThru");
- smart_objects::SmartObjectSPtr result =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr result = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::UI_EndAudioPassThru;
- return app_mngr.ManageHMICommand(result);
+ return app_mngr.GetRPCService().ManageHMICommand(result);
}
bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
LOG4CXX_INFO(logger_, "MessageHelper::SendUnsubscribedWayPoints");
- smart_objects::SmartObjectSPtr result =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr result = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints;
- return app_mngr.ManageHMICommand(result);
+ return app_mngr.GetRPCService().ManageHMICommand(result);
}
void MessageHelper::SendPolicySnapshotNotification(
@@ -1856,14 +2221,10 @@ void MessageHelper::SendSystemRequestNotification(
commands::CommandImpl::protocol_version_;
content[strings::params][strings::connection_key] = connection_key;
-
-#ifdef DEBUG
PrintSmartObject(content);
-#endif
-
- DCHECK(app_mngr.ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
- commands::Command::ORIGIN_SDL));
+ DCHECK(app_mngr.GetRPCService().ManageMobileCommand(
+ std::make_shared<smart_objects::SmartObject>(content),
+ commands::Command::SOURCE_SDL));
}
void MessageHelper::SendLaunchApp(const uint32_t connection_key,
@@ -1924,6 +2285,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
uint32_t connection_key,
const policy::Permissions& permissions,
ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject content(smart_objects::SmartType_Map);
content[strings::params][strings::function_id] =
@@ -2028,9 +2390,9 @@ void MessageHelper::SendOnPermissionsChangeNotification(
}
}
- app_mngr.ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
- commands::Command::ORIGIN_SDL);
+ app_mngr.GetRPCService().ManageMobileCommand(
+ std::make_shared<smart_objects::SmartObject>(content),
+ commands::Command::SOURCE_SDL);
}
void MessageHelper::FillAppRevokedPermissions(
@@ -2095,22 +2457,33 @@ void MessageHelper::SendOnAppPermissionsChangedNotification(
if (permissions.requestTypeChanged) {
smart_objects::SmartObject request_types_array(
smart_objects::SmartType_Array);
- ;
+
for (uint16_t index = 0; index < permissions.requestType.size(); ++index) {
request_types_array[index] = permissions.requestType[index];
}
message[strings::msg_params][strings::request_type] = request_types_array;
}
+ if (permissions.requestSubTypeChanged) {
+ smart_objects::SmartObject request_subtypes_array(
+ smart_objects::SmartType_Array);
+
+ for (uint16_t index = 0; index < permissions.requestSubType.size();
+ ++index) {
+ request_subtypes_array[index] = permissions.requestSubType[index];
+ }
+ message[strings::msg_params][strings::request_subtype] =
+ request_subtypes_array;
+ }
- app_mngr.ManageHMICommand(
- utils::MakeShared<smart_objects::SmartObject>(message));
+ app_mngr.GetRPCService().ManageHMICommand(
+ std::make_shared<smart_objects::SmartObject>(message));
}
void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2124,14 +2497,14 @@ void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
(*message)[strings::msg_params]["status"] = status;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
DCHECK(message);
@@ -2143,13 +2516,14 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result,
(*message)[strings::msg_params]["result"] = result;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendOnStatusUpdate(const std::string& status,
ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2160,14 +2534,15 @@ void MessageHelper::SendOnStatusUpdate(const std::string& status,
(*message)[strings::params][strings::message_type] =
MessageType::kNotification;
+ LOG4CXX_DEBUG(logger_, "Sending new status:" << status);
(*message)[strings::msg_params]["status"] = status;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr message =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!message) {
return;
}
@@ -2175,14 +2550,15 @@ void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_GetSystemInfo;
- app_mngr.ManageHMICommand(message);
+ app_mngr.GetRPCService().ManageHMICommand(message);
}
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ message.getType()) {
for (uint32_t i = 0; i < message.length(); ++i) {
mobile_apis::Result::eType res =
VerifyImageFiles(message[i], app, app_mngr);
@@ -2191,7 +2567,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return res;
}
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
message.getType()) {
if (message.keyExists(strings::image_type)) {
mobile_apis::Result::eType verification_result =
@@ -2223,25 +2599,25 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return mobile_apis::Result::SUCCESS;
}
-mobile_apis::Result::eType MessageHelper::VerifyImage(
- smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr) {
- // Checking image type first: if STATIC - skip existence check, since it is
- // HMI related file and it should know it location
- const uint32_t image_type = image[strings::image_type].asUInt();
- mobile_apis::ImageType::eType type =
- static_cast<mobile_apis::ImageType::eType>(image_type);
- if (mobile_apis::ImageType::STATIC == type) {
- return mobile_apis::Result::SUCCESS;
- }
-
+void MessageHelper::ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
const std::string& file_name = image[strings::value].asString();
+ const std::string& full_file_path = GetAppFilePath(file_name, app, app_mngr);
+ image[strings::value] = full_file_path;
+
+ return;
+}
+
+std::string MessageHelper::GetAppFilePath(std::string file_name,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
std::string str = file_name;
+ // Verify that file name is not only space characters
str.erase(remove(str.begin(), str.end(), ' '), str.end());
if (0 == str.size()) {
- return mobile_apis::Result::INVALID_DATA;
+ return "";
}
std::string full_file_path;
@@ -2267,13 +2643,86 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
full_file_path += file_name;
}
- if (!file_system::FileExists(full_file_path)) {
+ return full_file_path;
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyTtsFiles(
+ smart_objects::SmartObject& tts_chunks,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
+ for (auto& tts_chunk : *(tts_chunks.asArray())) {
+ if (tts_chunk[strings::type] == mobile_apis::SpeechCapabilities::FILE) {
+ const std::string full_file_path =
+ GetAppFilePath(tts_chunk[strings::text].asString(), app, app_mngr);
+ tts_chunk[strings::text] = full_file_path;
+ if (!file_system::FileExists(full_file_path)) {
+ result = mobile_apis::Result::FILE_NOT_FOUND;
+ }
+ }
+ }
+ return result;
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImage(
+ smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ const uint32_t image_type = image[strings::image_type].asUInt();
+ mobile_apis::ImageType::eType type =
+ static_cast<mobile_apis::ImageType::eType>(image_type);
+ const std::string& file_name = image[strings::value].asString();
+
+ if (!VerifyString(file_name)) {
return mobile_apis::Result::INVALID_DATA;
}
- image[strings::value] = full_file_path;
+ if (mobile_apis::ImageType::STATIC == type) {
+ return mobile_apis::Result::SUCCESS;
+ }
- return mobile_apis::Result::SUCCESS;
+ ApplyImagePath(image, app, app_mngr);
+
+ const std::string& imagePath = image[strings::value].asString();
+
+ if (file_system::FileExists(imagePath)) {
+ return mobile_apis::Result::SUCCESS;
+ }
+ return mobile_apis::Result::WARNINGS;
+}
+
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ // if this is false, someone doesn't have vrCommands
+ bool all_have = true;
+ // if this is false, someone has vrCommands
+ bool none_have = true;
+ smart_objects::SmartArray::const_iterator current_choice_set_it =
+ choice_set.asArray()->begin();
+ // Iterate through choices
+ for (; choice_set.asArray()->end() != current_choice_set_it;
+ ++current_choice_set_it) {
+ // if the vrCommands is present
+ if (current_choice_set_it->keyExists(
+ application_manager::strings::vr_commands)) {
+ // this one has the parameter
+ none_have = false;
+ } else {
+ // this one doesn't
+ all_have = false;
+ }
+ }
+ // everyone has it
+ if (all_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::ALL;
+ }
+ // No one has it
+ if (none_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::NONE;
+ }
+ // mix-and-match
+ return MessageHelper::ChoiceSetVRCommandsStatus::MIXED;
}
mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
@@ -2286,21 +2735,21 @@ mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
if (message[i].keyExists(strings::image)) {
verification_result_image =
VerifyImage(message[i][strings::image], app, app_mngr);
- if (mobile_apis::Result::SUCCESS != verification_result_image) {
- return verification_result_image;
+ if (mobile_apis::Result::INVALID_DATA == verification_result_image) {
+ break;
}
}
}
- return mobile_apis::Result::SUCCESS;
+ return verification_result_image;
}
-bool MessageHelper::VerifySoftButtonString(const std::string& str) {
+bool MessageHelper::VerifyString(const std::string& str) {
if ((std::string::npos != str.find_first_of("\t\n")) ||
(std::string::npos != str.find("\\n")) ||
(std::string::npos != str.find("\\t")) ||
(std::string::npos == str.find_first_not_of(' '))) {
LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifySoftButtonString"
+ "MessageHelper::VerifyString"
"string contains incorrect character");
return false;
}
@@ -2359,7 +2808,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2371,7 +2820,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
request_soft_buttons[i].erase(strings::image);
}
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString()))) {
return Result::INVALID_DATA;
}
@@ -2380,13 +2829,13 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
case SoftButtonType::SBT_BOTH: {
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
((request_soft_buttons[i][strings::text].length()) &&
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString())))) {
return Result::INVALID_DATA;
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2424,76 +2873,12 @@ void MessageHelper::SubscribeApplicationToSoftButton(
app->SubscribeToSoftButtons(function_id, softbuttons_id);
}
-// TODO(AK): change printf to logger
bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
- return true;
-#ifdef ENABLE_LOG
- static uint32_t tab = 0;
- std::string tab_buffer;
-
- if (tab == 0) {
- printf("\n-------------------------------------------------------------");
- }
-
- for (uint32_t i = 0; i < tab; ++i) {
- tab_buffer += "\t";
- }
-
- switch (object.getType()) {
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Array: {
- for (size_t i = 0; i < object.length(); i++) {
- ++tab;
-
- printf("\n%s%zu: ", tab_buffer.c_str(), i);
- if (!PrintSmartObject(object.getElement(i))) {
- printf("\n");
- return false;
- }
- }
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Map: {
- std::set<std::string> keys = object.enumerate();
-
- for (std::set<std::string>::const_iterator key = keys.begin();
- key != keys.end();
- key++) {
- ++tab;
-
- printf("\n%s%s: ", tab_buffer.c_str(), (*key).c_str());
- if (!PrintSmartObject(object[(*key).c_str()])) {
- printf("\n");
- return false;
- }
- }
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean:
- object.asBool() ? printf("true\n") : printf("false\n");
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Double: {
- printf("%f", object.asDouble());
- break;
- }
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Integer:
- printf("%lld", static_cast<long long int>(object.asInt()));
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_String:
- printf("%s", object.asString().c_str());
- break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Character:
- printf("%c", object.asChar());
- break;
- default:
- printf("PrintSmartObject - default case\n");
- break;
- }
-
- if (0 != tab) {
- --tab;
- } else {
- printf("\n-------------------------------------------------------------\n");
- }
+#ifdef DEBUG
+ Json::Value tmp;
+ namespace Formatters = ns_smart_device_link::ns_json_handler::formatters;
+ Formatters::CFormatterJsonBase::objToJsonValue(object, tmp);
+ LOG4CXX_DEBUG(logger_, "SMART OBJECT: " << tmp.toStyledString());
#endif
return true;
}
diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc
deleted file mode 100644
index 688bacf1ac..0000000000
--- a/src/components/application_manager/src/mobile_command_factory.cc
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/mobile_command_factory.h"
-#include "application_manager/commands/mobile/add_command_request.h"
-#include "application_manager/commands/mobile/add_command_response.h"
-#include "application_manager/commands/mobile/delete_command_request.h"
-#include "application_manager/commands/mobile/delete_command_response.h"
-#include "application_manager/commands/mobile/add_sub_menu_request.h"
-#include "application_manager/commands/mobile/add_sub_menu_response.h"
-#include "application_manager/commands/mobile/alert_request.h"
-#include "application_manager/commands/mobile/alert_response.h"
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "application_manager/commands/mobile/alert_maneuver_response.h"
-#include "application_manager/commands/mobile/change_registration_request.h"
-#include "application_manager/commands/mobile/change_registration_response.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-#include "application_manager/commands/mobile/delete_file_request.h"
-#include "application_manager/commands/mobile/delete_file_response.h"
-#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
-#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
-#include "application_manager/commands/mobile/generic_response.h"
-#include "application_manager/commands/mobile/get_dtcs_request.h"
-#include "application_manager/commands/mobile/get_dtcs_response.h"
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-#include "application_manager/commands/mobile/get_vehicle_data_response.h"
-#include "application_manager/commands/mobile/get_way_points_request.h"
-#include "application_manager/commands/mobile/get_way_points_response.h"
-#include "application_manager/commands/mobile/list_files_request.h"
-#include "application_manager/commands/mobile/list_files_response.h"
-#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
-#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/commands/mobile/on_language_change_notification.h"
-#include "application_manager/commands/mobile/on_command_notification.h"
-#include "application_manager/commands/mobile/on_permissions_change_notification.h"
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-#include "application_manager/commands/mobile/on_hash_change_notification.h"
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-#include "application_manager/commands/mobile/perform_interaction_response.h"
-#include "application_manager/commands/mobile/put_file_request.h"
-#include "application_manager/commands/mobile/put_file_response.h"
-#include "application_manager/commands/mobile/read_did_request.h"
-#include "application_manager/commands/mobile/read_did_response.h"
-#include "application_manager/commands/mobile/register_app_interface_request.h"
-#include "application_manager/commands/mobile/register_app_interface_response.h"
-#include "application_manager/commands/mobile/reset_global_properties_request.h"
-#include "application_manager/commands/mobile/reset_global_properties_response.h"
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-#include "application_manager/commands/mobile/scrollable_message_response.h"
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-#include "application_manager/commands/mobile/set_display_layout_response.h"
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-#include "application_manager/commands/mobile/set_global_properties_response.h"
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-#include "application_manager/commands/mobile/set_app_icon_response.h"
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
-#include "application_manager/commands/mobile/show_constant_tbt_request.h"
-#include "application_manager/commands/mobile/show_constant_tbt_response.h"
-#include "application_manager/commands/mobile/show_request.h"
-#include "application_manager/commands/mobile/show_response.h"
-#include "application_manager/commands/mobile/slider_request.h"
-#include "application_manager/commands/mobile/slider_response.h"
-#include "application_manager/commands/mobile/speak_request.h"
-#include "application_manager/commands/mobile/speak_response.h"
-#include "application_manager/commands/mobile/subscribe_button_request.h"
-#include "application_manager/commands/mobile/subscribe_button_response.h"
-#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
-#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
-#include "application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "application_manager/commands/mobile/subscribe_way_points_response.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_request.h"
-#include "application_manager/commands/mobile/unsubscribe_way_points_response.h"
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-#include "application_manager/commands/mobile/unregister_app_interface_response.h"
-#include "application_manager/commands/mobile/unsubscribe_button_request.h"
-#include "application_manager/commands/mobile/unsubscribe_button_response.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-#include "application_manager/commands/mobile/update_turn_list_response.h"
-#include "application_manager/commands/mobile/system_request.h"
-#include "application_manager/commands/mobile/system_response.h"
-#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
-#include "application_manager/commands/mobile/on_touch_event_notification.h"
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "application_manager/commands/mobile/diagnostic_message_request.h"
-#include "application_manager/commands/mobile/diagnostic_message_response.h"
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/commands/mobile/send_location_response.h"
-#include "application_manager/commands/mobile/dial_number_request.h"
-#include "application_manager/commands/mobile/dial_number_response.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/make_shared.h"
-
-namespace application_manager {
-
-CommandSharedPtr MobileCommandFactory::CreateCommand(
- const commands::MessageSharedPtr& message,
- commands::Command::CommandOrigin origin,
- ApplicationManager& application_manager) {
- CommandSharedPtr command;
-
- switch ((*message)[strings::params][strings::function_id].asInt()) {
- case mobile_apis::FunctionID::RegisterAppInterfaceID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kRequest)) {
- command.reset(new commands::RegisterAppInterfaceRequest(
- message, application_manager));
-
- } else {
- command.reset(new commands::RegisterAppInterfaceResponse(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnregisterAppInterfaceID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kRequest)) {
- command.reset(new commands::UnregisterAppInterfaceRequest(
- message, application_manager));
- } else {
- command.reset(new commands::UnregisterAppInterfaceResponse(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetGlobalPropertiesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ResetGlobalPropertiesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ResetGlobalPropertiesResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ResetGlobalPropertiesRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AddCommandID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AddCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AddCommandRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteCommandID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteCommandResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteCommandRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AddSubMenuID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AddSubMenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AddSubMenuRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteSubMenuID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteSubMenuResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteSubMenuRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::DeleteInteractionChoiceSetResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DeleteInteractionChoiceSetRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AlertID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AlertResponse(message, application_manager));
- } else {
- command.reset(new commands::AlertRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SpeakID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SpeakResponse(message, application_manager));
- } else {
- command.reset(new commands::SpeakRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SliderID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SliderResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SliderRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PerformAudioPassThruID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::PerformAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::PerformAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::CreateInteractionChoiceSetResponse(
- message, application_manager));
- } else {
- command.reset(new commands::CreateInteractionChoiceSetRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PerformInteractionID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::PerformInteractionResponse(
- message, application_manager));
- } else {
- command.reset(new commands::PerformInteractionRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::EndAudioPassThruID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::EndAudioPassThruResponse(
- message, application_manager));
- } else {
- command.reset(new commands::EndAudioPassThruRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::PutFileID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::PutFileResponse(message, application_manager));
- } else {
- command.reset(
- new commands::PutFileRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DeleteFileID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DeleteFileResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DeleteFileRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ListFilesID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::ListFilesResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ListFilesRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeButtonID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SubscribeButtonResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SubscribeButtonRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeButtonID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::UnsubscribeButtonResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UnsubscribeButtonRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ShowConstantTBTID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ShowConstantTBTResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::ShowConstantTBTRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ShowID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ShowResponse(message, application_manager));
- } else {
- command.reset(new commands::ShowRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::GetWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::GetWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::UnsubscribeVehicleDataResponse(
- message, application_manager));
- } else {
- command.reset(new commands::UnsubscribeVehicleDataRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SubscribeWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::SubscribeWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::SubscribeWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command = utils::MakeShared<commands::UnsubscribeWayPointsResponse>(
- message, application_manager);
- } else {
- command = utils::MakeShared<commands::UnSubscribeWayPointsRequest>(
- message, application_manager);
- }
- break;
- }
- case mobile_apis::FunctionID::ReadDIDID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::ReadDIDResponse(message, application_manager));
- } else {
- command.reset(
- new commands::ReadDIDRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetVehicleDataID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::GetVehicleDataResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetVehicleDataRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ScrollableMessageID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ScrollableMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ScrollableMessageRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::AlertManeuverID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::AlertManeuverResponse(message, application_manager));
- } else {
- command.reset(
- new commands::AlertManeuverRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetAppIconID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SetAppIconResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SetAppIconRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetDisplayLayoutID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetDisplayLayoutResponse(
- message, application_manager));
- } else {
- command.reset(new commands::SetDisplayLayoutRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::UpdateTurnListID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::UpdateTurnListResponse(message, application_manager));
- } else {
- command.reset(
- new commands::UpdateTurnListRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::ChangeRegistrationID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::ChangeRegistrationResponse(
- message, application_manager));
- } else {
- command.reset(new commands::ChangeRegistrationRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::GetDTCsID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::GetDTCsResponse(message, application_manager));
- } else {
- command.reset(
- new commands::GetDTCsRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DiagnosticMessageID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::DiagnosticMessageResponse(
- message, application_manager));
- } else {
- command.reset(new commands::DiagnosticMessageRequest(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SetMediaClockTimerID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(new commands::SetMediaClockTimerResponse(
- message, application_manager));
- } else {
- command.reset(
- new commands::SetMediaClockRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SystemRequestID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SystemResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SystemRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::SendLocationID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::SendLocationResponse(message, application_manager));
- } else {
- command.reset(
- new commands::SendLocationRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::DialNumberID: {
- if ((*message)[strings::params][strings::message_type] ==
- static_cast<int>(application_manager::MessageType::kResponse)) {
- command.reset(
- new commands::DialNumberResponse(message, application_manager));
- } else {
- command.reset(
- new commands::DialNumberRequest(message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::OnButtonEventID: {
- command.reset(new commands::mobile::OnButtonEventNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnButtonPressID: {
- command.reset(new commands::mobile::OnButtonPressNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnAudioPassThruID: {
- command.reset(new commands::OnAudioPassThruNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnVehicleDataID: {
- command.reset(new commands::OnVehicleDataNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: {
- command.reset(new commands::OnAppInterfaceUnregisteredNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnCommandID: {
- command.reset(
- new commands::OnCommandNotification(message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnTBTClientStateID: {
- command.reset(new commands::OnTBTClientStateNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnDriverDistractionID: {
- command.reset(new commands::mobile::OnDriverDistractionNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnLanguageChangeID: {
- command.reset(new commands::OnLanguageChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnPermissionsChangeID: {
- command.reset(new commands::OnPermissionsChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnHMIStatusID: {
- if (commands::Command::ORIGIN_SDL == origin) {
- command.reset(new commands::OnHMIStatusNotification(
- message, application_manager));
- } else {
- command.reset(new commands::OnHMIStatusNotificationFromMobile(
- message, application_manager));
- }
- break;
- }
- case mobile_apis::FunctionID::OnKeyboardInputID: {
- command.reset(new commands::mobile::OnKeyBoardInputNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnTouchEventID: {
- command.reset(new commands::mobile::OnTouchEventNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnSystemRequestID: {
- command.reset(new commands::mobile::OnSystemRequestNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnHashChangeID: {
- command.reset(new commands::mobile::OnHashChangeNotification(
- message, application_manager));
- break;
- }
- case mobile_apis::FunctionID::OnWayPointChangeID: {
- command = utils::MakeShared<commands::OnWayPointChangeNotification>(
- message, application_manager);
- break;
- }
- default: {
- (*message)[strings::params][strings::function_id] =
- static_cast<int32_t>(mobile_apis::FunctionID::GenericResponseID);
- command.reset(
- new commands::GenericResponse(message, application_manager));
- }
- }
- return command;
-}
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index b635cb1f84..1ee368a212 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -67,26 +67,31 @@ MobileMessageHandler::HandleIncomingMessageProtocol(
DCHECK_OR_RETURN(message, NULL);
application_manager::Message* out_message = NULL;
switch (message->protocol_version()) {
- case ProtocolVersion::kV1:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1:
LOG4CXX_DEBUG(logger_, "Protocol version - V1");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV1(message);
break;
- case ProtocolVersion::kV2:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2:
LOG4CXX_DEBUG(logger_, "Protocol version - V2");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
- case ProtocolVersion::kV3:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
LOG4CXX_DEBUG(logger_, "Protocol version - V3");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
- case ProtocolVersion::kV4:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
LOG4CXX_DEBUG(logger_, "Protocol version - V4");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
+ LOG4CXX_DEBUG(logger_, "Protocol version - V5");
+ out_message =
+ MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
+ break;
default:
LOG4CXX_WARN(logger_, "Can't recognise protocol version");
out_message = NULL;
@@ -116,12 +121,13 @@ MobileMessageHandler::HandleOutgoingMessageProtocol(
<< message->correlation_id() << ", "
<< message->json_message());
- if (message->protocol_version() == application_manager::kV1) {
+ if (message->protocol_version() ==
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1) {
return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message);
}
- if ((message->protocol_version() == application_manager::kV2) ||
- (message->protocol_version() == application_manager::kV3) ||
- (message->protocol_version() == application_manager::kV4)) {
+ if (Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ message->protocol_version())) {
return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message);
}
return NULL;
@@ -137,12 +143,13 @@ MobileMessageHandler::HandleIncomingMessageProtocolV1(
message->service_type()));
if (!message) {
NOTREACHED();
+ delete outgoing_message;
return NULL;
}
outgoing_message->set_connection_key(message->connection_key());
outgoing_message->set_protocol_version(
- static_cast<application_manager::ProtocolVersion>(
+ static_cast<protocol_handler::MajorProtocolVersion>(
message->protocol_version()));
outgoing_message->set_json_message(std::string(
reinterpret_cast<const char*>(message->data()), message->data_size()));
@@ -172,7 +179,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
return NULL;
}
- std::auto_ptr<application_manager::Message> outgoing_message(
+ std::unique_ptr<application_manager::Message> outgoing_message(
new application_manager::Message(
protocol_handler::MessagePriority::FromServiceType(
message->service_type())));
@@ -184,14 +191,14 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
outgoing_message->set_correlation_id(int32_t(payload.header.correlation_id));
outgoing_message->set_connection_key(message->connection_key());
outgoing_message->set_protocol_version(
- static_cast<application_manager::ProtocolVersion>(
+ static_cast<protocol_handler::MajorProtocolVersion>(
message->protocol_version()));
outgoing_message->set_data_size(message->data_size());
outgoing_message->set_payload_size(message->payload_size());
if (!payload.data.empty()) {
- outgoing_message->set_binary_data(
- new application_manager::BinaryData(payload.data));
+ const BinaryData binary_payload_data(payload.data);
+ outgoing_message->set_binary_data(&binary_payload_data);
}
return outgoing_message.release();
}
diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
new file mode 100644
index 0000000000..712b91afe7
--- /dev/null
+++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc
@@ -0,0 +1,111 @@
+#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h"
+#include <dlfcn.h>
+
+#include "utils/file_system.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager")
+
+RPCPluginManagerImpl::RPCPluginManagerImpl(
+ ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : app_manager_(app_manager)
+ , rpc_service_(rpc_service)
+ , hmi_capabilities_(hmi_capabilities)
+ , policy_handler_(policy_handler) {}
+
+bool IsLibraryFile(const std::string& file_path) {
+ size_t pos = file_path.find_last_of(".");
+ if (std::string::npos == pos) {
+ return false;
+ }
+ if (file_path.substr(pos + 1).compare("so") != 0) {
+ return false;
+ }
+ return true;
+}
+
+RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) {
+ if (!IsLibraryFile(full_plugin_path)) {
+ LOG4CXX_DEBUG(logger_, "Skip loading " << full_plugin_path);
+ return RPCPluginPtr();
+ }
+
+ void* plugin_dll = dlopen(full_plugin_path.c_str(), RTLD_LAZY);
+ if (nullptr == plugin_dll) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open dll " << full_plugin_path << " : "
+ << dlerror());
+ return RPCPluginPtr();
+ }
+
+ typedef RPCPlugin* (*Create)();
+ Create create_plugin = reinterpret_cast<Create>(dlsym(plugin_dll, "Create"));
+ char* error_string = dlerror();
+ if (nullptr != error_string) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to export dll's " << full_plugin_path
+ << " symbols : " << error_string);
+ dlclose(plugin_dll);
+ return RPCPluginPtr();
+ }
+ RPCPlugin* plugin = create_plugin();
+ dlclose(plugin_dll);
+ return RPCPluginPtr(plugin);
+}
+
+uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) {
+ LOG4CXX_INFO(logger_, "Loading plugins from " << plugins_path);
+ std::vector<std::string> plugin_files = file_system::ListFiles(plugins_path);
+ for (auto& plugin_file : plugin_files) {
+ std::string full_name = plugins_path + '/' + plugin_file;
+ auto plugin = LoadPlugin(full_name);
+ if (!plugin) {
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Loaded " << plugin->PluginName() << " plugin from "
+ << full_name);
+ if (plugin->Init(
+ app_manager_, rpc_service_, hmi_capabilities_, policy_handler_)) {
+ loaded_plugins_.push_back(std::move(plugin));
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "Initialisation of " << plugin->PluginName()
+ << " plugin from " << full_name
+ << " failed");
+ }
+ }
+ return loaded_plugins_.size();
+}
+
+std::vector<RPCPluginPtr>& RPCPluginManagerImpl::GetPlugins() {
+ return loaded_plugins_;
+}
+
+utils::Optional<RPCPlugin> RPCPluginManagerImpl::FindPluginToProcess(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source) {
+ typedef utils::Optional<RPCPlugin> PluginOptional;
+ for (auto& plugin : loaded_plugins_) {
+ if (plugin->IsAbleToProcess(function_id, message_source)) {
+ return PluginOptional(*plugin);
+ }
+ }
+ return PluginOptional(PluginOptional::EMPTY,
+ std::string("Plugin for processing RPC not found"));
+}
+
+void RPCPluginManagerImpl::ForEachPlugin(
+ std::function<void(RPCPlugin&)> functor) {
+ for (auto& plugin : loaded_plugins_) {
+ functor(*plugin);
+ }
+}
+
+} // namespace plugin_manager
+} // namespace application_manager
diff --git a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
index 7b5954a3c3..871e96442a 100644
--- a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
+++ b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
@@ -36,17 +36,35 @@
namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+#ifdef EXTERNAL_PROPRIETARY_MODE
AppPermissionDelegate::AppPermissionDelegate(
const uint32_t connection_key,
const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status,
policy::PolicyHandlerInterface& policy_handler)
: connection_key_(connection_key)
, permissions_(permissions)
+ , external_consent_status_(external_consent_status)
, policy_handler_(policy_handler) {}
+#else
+AppPermissionDelegate::AppPermissionDelegate(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ policy::PolicyHandlerInterface& policy_handler)
+ : connection_key_(connection_key)
+ , permissions_(permissions)
+ , policy_handler_(policy_handler) {}
+#endif
void AppPermissionDelegate::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_handler_.OnAppPermissionConsentInternal(
+ connection_key_, external_consent_status_, permissions_);
+#else
policy_handler_.OnAppPermissionConsentInternal(connection_key_, permissions_);
+#endif
}
void AppPermissionDelegate::exitThreadMain() {
diff --git a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
index 11c1dc9a91..e668be4ed1 100644
--- a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
+++ b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
@@ -39,6 +39,9 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::GlobalCounterId type)
: type_(INCREMENT_GLOBAL)
, global_counter_(type)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_("")
, value_("")
, timespan_seconds_(0)
@@ -48,7 +51,10 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
const std::string& app_id,
usage_statistics::AppCounterId type)
: type_(INCREMENT_APP)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
, app_counter_(type)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_(app_id)
, value_("")
, timespan_seconds_(0)
@@ -59,7 +65,10 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::AppInfoId type,
const std::string& value)
: type_(SET)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
, app_info_(type)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_(app_id)
, value_(value)
, timespan_seconds_(0)
@@ -70,6 +79,9 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::AppStopwatchId type,
int32_t timespan_seconds)
: type_(ADD)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
, stop_watch_(type)
, app_id_(app_id)
, value_("")
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
index 828f2d923a..f397814005 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -63,14 +63,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- ProcessOdometerEvent(message);
- break;
- }
- default: { break; }
- unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer);
-#else
case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
ProcessOdometerEvent(message);
unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
@@ -82,7 +74,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
break;
}
default: { break; }
-#endif
}
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 1a720d9bc0..1b64c5d7b4 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -35,13 +35,14 @@
#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"
+#include "application_manager/rpc_service.h"
#include "policy/policy_manager_impl.h"
#include "connection_handler/connection_handler.h"
#include "utils/macro.h"
@@ -53,7 +54,9 @@
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
#include "utils/scope_guard.h"
-#include "utils/make_shared.h"
+
+#include "utils/helpers.h"
+#include "policy/policy_manager.h"
namespace policy {
@@ -63,31 +66,33 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
namespace {
using namespace mobile_apis;
-typedef std::map<RequestType::eType, std::string> RequestTypeMap;
+typedef std::map<mobile_apis::RequestType::eType, std::string> RequestTypeMap;
RequestTypeMap TypeToString = {
- {RequestType::INVALID_ENUM, "INVALID_ENUM"},
- {RequestType::HTTP, "HTTP"},
- {RequestType::FILE_RESUME, "FILE_RESUME"},
- {RequestType::AUTH_REQUEST, "AUTH_REQUEST"},
- {RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"},
- {RequestType::AUTH_ACK, "AUTH_ACK"},
- {RequestType::PROPRIETARY, "PROPRIETARY"},
- {RequestType::QUERY_APPS, "QUERY_APPS"},
- {RequestType::LAUNCH_APP, "LAUNCH_APP"},
- {RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"},
- {RequestType::TRAFFIC_MESSAGE_CHANNEL, "TRAFFIC_MESSAGE_CHANNEL"},
- {RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"},
- {RequestType::VOICE_SEARCH, "VOICE_SEARCH"},
- {RequestType::NAVIGATION, "NAVIGATION"},
- {RequestType::PHONE, "PHONE"},
- {RequestType::CLIMATE, "CLIMATE"},
- {RequestType::SETTINGS, "SETTINGS"},
- {RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"},
- {RequestType::EMERGENCY, "EMERGENCY"},
- {RequestType::MEDIA, "MEDIA"},
- {RequestType::FOTA, "FOTA"}};
-
-const std::string RequestTypeToString(RequestType::eType type) {
+ {mobile_apis::RequestType::INVALID_ENUM, "INVALID_ENUM"},
+ {mobile_apis::RequestType::HTTP, "HTTP"},
+ {mobile_apis::RequestType::FILE_RESUME, "FILE_RESUME"},
+ {mobile_apis::RequestType::AUTH_REQUEST, "AUTH_REQUEST"},
+ {mobile_apis::RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"},
+ {mobile_apis::RequestType::AUTH_ACK, "AUTH_ACK"},
+ {mobile_apis::RequestType::PROPRIETARY, "PROPRIETARY"},
+ {mobile_apis::RequestType::QUERY_APPS, "QUERY_APPS"},
+ {mobile_apis::RequestType::LAUNCH_APP, "LAUNCH_APP"},
+ {mobile_apis::RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"},
+ {mobile_apis::RequestType::TRAFFIC_MESSAGE_CHANNEL,
+ "TRAFFIC_MESSAGE_CHANNEL"},
+ {mobile_apis::RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"},
+ {mobile_apis::RequestType::VOICE_SEARCH, "VOICE_SEARCH"},
+ {mobile_apis::RequestType::NAVIGATION, "NAVIGATION"},
+ {mobile_apis::RequestType::PHONE, "PHONE"},
+ {mobile_apis::RequestType::CLIMATE, "CLIMATE"},
+ {mobile_apis::RequestType::SETTINGS, "SETTINGS"},
+ {mobile_apis::RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"},
+ {mobile_apis::RequestType::EMERGENCY, "EMERGENCY"},
+ {mobile_apis::RequestType::MEDIA, "MEDIA"},
+ {mobile_apis::RequestType::FOTA, "FOTA"},
+ {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"}};
+
+const std::string RequestTypeToString(mobile_apis::RequestType::eType type) {
RequestTypeMap::const_iterator it = TypeToString.find(type);
if (TypeToString.end() != it) {
return (*it).second;
@@ -98,7 +103,7 @@ const std::string RequestTypeToString(RequestType::eType type) {
const policy::DeviceParams GetDeviceParams(
connection_handler::DeviceHandle device_handle,
const protocol_handler::SessionObserver& session_observer) {
- CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler")
+ CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler");
policy::DeviceParams device_params;
if (-1 ==
session_observer.GetDataOnDeviceID(
@@ -157,10 +162,12 @@ struct DeactivateApplication {
void operator()(const ApplicationSharedPtr& app) {
if (device_id_ == app->device()) {
- state_ctrl_.SetRegularState(app,
- mobile_apis::HMILevel::HMI_NONE,
- mobile_apis::AudioStreamingState::NOT_AUDIBLE,
- true);
+ state_ctrl_.SetRegularState(
+ app,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ true);
}
}
@@ -180,7 +187,7 @@ struct SDLAllowedNotification {
void operator()(const ApplicationSharedPtr& app) {
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) {
@@ -204,6 +211,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.use_count() == 0) {
+ 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,
@@ -214,7 +258,7 @@ struct LinkAppToDevice {
}
void operator()(const ApplicationSharedPtr& app) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Skip current application.");
@@ -283,8 +327,7 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings,
: AsyncRunner("PolicyHandler async runner thread")
, dl_handle_(0)
, last_activated_app_id_(0)
- , app_to_device_link_lock_(true)
- , statistic_manager_impl_(utils::MakeShared<StatisticManagerImpl>(this))
+ , statistic_manager_impl_(std::make_shared<StatisticManagerImpl>(this))
, settings_(settings)
, application_manager_(application_manager) {}
@@ -311,14 +354,14 @@ bool PolicyHandler::LoadPolicyLibrary() {
if (CreateManager()) {
policy_manager_->set_listener(this);
event_observer_ =
- utils::SharedPtr<PolicyEventObserver>(new PolicyEventObserver(
+ std::shared_ptr<PolicyEventObserver>(new PolicyEventObserver(
this, application_manager_.event_dispatcher()));
}
} else {
LOG4CXX_ERROR(logger_, error);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
bool PolicyHandler::CreateManager() {
@@ -331,11 +374,11 @@ bool PolicyHandler::CreateManager() {
char* error_string = dlerror();
if (NULL == error_string) {
policy_manager_ =
- utils::SharedPtr<PolicyManager>(create_manager(), delete_manager);
+ std::shared_ptr<PolicyManager>(create_manager(), delete_manager);
} else {
LOG4CXX_WARN(logger_, error_string);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
const PolicySettings& PolicyHandler::get_settings() const {
@@ -411,18 +454,34 @@ uint32_t PolicyHandler::GetAppIdForSending() const {
return ChooseRandomAppForPolicyUpdate(apps_with_none_level);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void PolicyHandler::OnAppPermissionConsent(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AsyncRun(new AppPermissionDelegate(
+ connection_key, permissions, external_consent_status, *this));
+}
+#else
void PolicyHandler::OnAppPermissionConsent(
const uint32_t connection_key, const PermissionConsent& permissions) {
LOG4CXX_AUTO_TRACE(logger_);
AsyncRun(new AppPermissionDelegate(connection_key, permissions, *this));
}
+#endif
+
void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
const bool is_allowed) {
POLICY_LIB_CHECK_VOID();
connection_handler::DeviceHandle device_handle;
- application_manager_.connection_handler().GetDeviceID(device_id,
- &device_handle);
+ if (!application_manager_.connection_handler().GetDeviceID(device_id,
+ &device_handle)) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to get device handle for device_id: " << device_id);
+ return;
+ }
// In case of changed consent for device, related applications will be
// limited to pre_DataConsent permissions, if device disallowed, or switch
// back to their own permissions, if device allowed again, and must be
@@ -436,8 +495,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;
@@ -458,7 +519,7 @@ void PolicyHandler::SendOnAppPermissionsChanged(
<< policy_app_id);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id);
return;
}
@@ -467,9 +528,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) {
@@ -491,9 +552,10 @@ struct SmartObjectToInt {
};
StatusNotifier PolicyHandler::AddApplication(
- const std::string& application_id) {
- POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>());
- return policy_manager_->AddApplication(application_id);
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
+ POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>());
+ return policy_manager_->AddApplication(application_id, hmi_types);
}
void PolicyHandler::AddDevice(const std::string& device_id,
@@ -510,77 +572,95 @@ 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();
+ if (app.use_count() != 0) {
+ 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.use_count() == 0) {
+ 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());
- LinkAppsToDevice();
+ if (device_params.device_mac_address != it->first) {
+ LOG4CXX_WARN(logger_,
+ "Device_id of application is changed."
+ "Permissions setting skipped.");
+ continue;
+ }
- if (!app_to_device_link_.size()) {
+ 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() {
POLICY_LIB_CHECK_VOID();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
PTUpdatedAt(Counters::DAYS_AFTER_EPOCH, days_after_epoch);
}
@@ -614,61 +694,98 @@ void PolicyHandler::OnGetUserFriendlyMessage(
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) {
- LinkAppsToDevice();
- 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.use_count() == 0) {
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() {
@@ -692,17 +809,17 @@ 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.");
+ "Application " << value->app_id()
+ << " is not marked as registered.");
return false;
}
LOG4CXX_DEBUG(logger_,
- "Application " << app_id << " marked as registered."
- "Checking its parameters.");
+ "Application " << value->app_id()
+ << " marked as registered."
+ "Checking its parameters.");
DeviceParams device_params = GetDeviceParams(
value->device(),
@@ -715,12 +832,7 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate(
LOG4CXX_DEBUG(logger_,
"Is device " << device_params.device_mac_address << " allowed "
<< std::boolalpha << is_device_allowed);
-
- if (!is_device_allowed) {
- return false;
- }
-
- return true;
+ return is_device_allowed;
}
uint32_t PolicyHandler::ChooseRandomAppForPolicyUpdate(
@@ -741,6 +853,13 @@ uint32_t PolicyHandler::ChooseRandomAppForPolicyUpdate(
return 0;
}
+void PolicyHandler::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
@@ -763,7 +882,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Application with id '"
<< policy_app_id
@@ -832,13 +951,14 @@ void PolicyHandler::OnVehicleDataUpdated(
void PolicyHandler::OnPendingPermissionChange(
const std::string& policy_app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"PolicyHandler::OnPendingPermissionChange for "
<< policy_app_id);
POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"No app found for " << policy_app_id << " policy app id.");
return;
@@ -856,6 +976,7 @@ void PolicyHandler::OnPendingPermissionChange(
app,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
true);
policy_manager_->RemovePendingPermissionChanges(policy_app_id);
return;
@@ -869,8 +990,6 @@ void PolicyHandler::OnPendingPermissionChange(
if (permissions.appPermissionsConsentNeeded) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
// "Break" statement has to be here to continue processing in case of
// there is another "true" flag in permissions struct
break;
@@ -880,8 +999,6 @@ void PolicyHandler::OnPendingPermissionChange(
if (permissions.isAppPermissionsRevoked) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
break;
}
@@ -895,22 +1012,21 @@ void PolicyHandler::OnPendingPermissionChange(
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
}
- application_manager_.ManageMobileCommand(
+ application_manager_.GetRPCService().ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app->app_id(),
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED),
- commands::Command::ORIGIN_SDL);
+ commands::Command::SOURCE_SDL);
application_manager_.OnAppUnauthorized(app->app_id());
-
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
- if (permissions.requestTypeChanged) {
+ if (permissions.requestTypeChanged || permissions.requestSubTypeChanged) {
MessageHelper::SendOnAppPermissionsChangedNotification(
app->app_id(), permissions, application_manager_);
- policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
+
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
@@ -918,11 +1034,10 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
- uint32_t app_id = GetAppIdForSending();
-
+ const uint32_t app_id = GetAppIdForSending();
ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app.valid()) {
+ if (!app) {
LOG4CXX_WARN(logger_,
"There is no registered application with "
"connection key '"
@@ -963,20 +1078,15 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
SetDaysAfterEpoch();
event_observer_->subscribe_on_event(
-#ifdef HMI_DBUS_API
- hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id
-#else
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id
-#endif
- );
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id);
std::vector<std::string> vehicle_data_args;
vehicle_data_args.push_back(strings::odometer);
MessageHelper::CreateGetVehicleDataRequest(
correlation_id, vehicle_data_args, application_manager_);
} else {
- LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
- policy_manager_->ForcePTExchange();
+ LOG4CXX_WARN(logger_, "Exchange wasn't successful");
}
+ OnPTUFinished(ret);
return ret;
}
@@ -1059,7 +1169,7 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
continue;
}
policy_manager_->SetUserConsentForDevice(device_id, is_allowed);
- uint32_t device_handle = 0;
+ connection_handler::DeviceHandle device_handle = 0;
if (!connection_handler.GetDeviceID(device_id, &device_handle)) {
LOG4CXX_WARN(logger_,
"Device handle with mac " << device_id
@@ -1084,13 +1194,12 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
policy_manager_.get(),
application_manager_.state_controller()));
}
-
#endif // EXTERNAL_PROPRIETARY_MODE
}
}
// Case, when specific device was changed
- uint32_t device_handle = 0u;
+ connection_handler::DeviceHandle device_handle = 0u;
if (device_specific) {
policy_manager_->SetUserConsentForDevice(device_mac, is_allowed);
if (!connection_handler.GetDeviceID(device_mac, &device_handle)) {
@@ -1102,6 +1211,7 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
device_handle);
// If consent done from HMI menu
if (it == pending_device_handles_.end()) {
+ LOG4CXX_WARN(logger_, "No pendining application activation");
return;
}
@@ -1124,12 +1234,15 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
if (is_allowed) {
// Send HMI status notification to mobile
// Put application in full
- AudioStreamingState::eType state = app->is_audio()
- ? AudioStreamingState::AUDIBLE
- : AudioStreamingState::NOT_AUDIBLE;
+ AudioStreamingState::eType audio_state =
+ app->IsAudioApplication() ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+ VideoStreamingState::eType video_state =
+ app->IsVideoApplication() ? VideoStreamingState::STREAMABLE
+ : VideoStreamingState::NOT_STREAMABLE;
application_manager_.state_controller().SetRegularState(
- app, mobile_apis::HMILevel::HMI_FULL, state, true);
+ app, mobile_apis::HMILevel::HMI_FULL, audio_state, video_state, true);
last_activated_app_id_ = 0;
} else {
DeactivateApplication deactivate_notification(
@@ -1149,9 +1262,8 @@ void PolicyHandler::OnIgnitionCycleOver() {
void PolicyHandler::OnActivateApp(uint32_t connection_key,
uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
- POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app = application_manager_.application(connection_key);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "Activated App failed: no app found.");
return;
}
@@ -1245,7 +1357,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1298,7 +1410,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1341,7 +1453,7 @@ void PolicyHandler::OnSnapshotCreated(
std::string policy_snapshot_full_path;
if (SaveSnapshot(pt_string, policy_snapshot_full_path)) {
const uint32_t timeout_exchange_s =
- timeout_exchange_ms / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ timeout_exchange_ms / date_time::MILLISECONDS_IN_SECOND;
MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
timeout_exchange_s,
retry_delay_seconds,
@@ -1390,13 +1502,34 @@ 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());
+ if (hmi_level.empty()) {
+ LOG4CXX_WARN(logger_,
+ "HMI level for " << app->policy_app_id() << " is invalid, rpc "
+ << rpc << " is not allowed.");
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ return;
+ }
+ const std::string device_id = MessageHelper::GetDeviceMacAddressForHandle(
+ app->device(), application_manager_);
+ LOG4CXX_INFO(logger_,
+ "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(
@@ -1444,14 +1577,15 @@ std::string PolicyHandler::GetLockScreenIconUrl() const {
uint32_t PolicyHandler::NextRetryTimeout() {
POLICY_LIB_CHECK(0);
+ LOG4CXX_AUTO_TRACE(logger_);
return policy_manager_->NextRetryTimeout();
}
-uint32_t PolicyHandler::TimeoutExchangeSec() {
- return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+uint32_t PolicyHandler::TimeoutExchangeSec() const {
+ return TimeoutExchangeMSec() / date_time::MILLISECONDS_IN_SECOND;
}
-uint32_t PolicyHandler::TimeoutExchangeMSec() {
+uint32_t PolicyHandler::TimeoutExchangeMSec() const {
POLICY_LIB_CHECK(0);
return policy_manager_->TimeoutExchangeMSec();
}
@@ -1487,7 +1621,7 @@ void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) {
listeners_.remove(listener);
}
-utils::SharedPtr<usage_statistics::StatisticsManager>
+std::shared_ptr<usage_statistics::StatisticsManager>
PolicyHandler::GetStatisticManager() const {
return statistic_manager_impl_;
}
@@ -1529,7 +1663,7 @@ custom_str::CustomString PolicyHandler::GetAppName(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1636,6 +1770,17 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
}
#endif // EXTERNAL_PROPRIETARY_MODE
+void PolicyHandler::OnPTUFinished(const bool ptu_result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(listeners_lock_);
+
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(std::mem_fun(&PolicyHandlerObserver::OnPTUFinished),
+ ptu_result));
+}
+
bool PolicyHandler::CanUpdate() {
return 0 != GetAppIdForSending();
}
@@ -1722,9 +1867,9 @@ void PolicyHandler::OnAppsSearchStarted() {
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) {
@@ -1732,6 +1877,18 @@ void PolicyHandler::OnAppRegisteredOnMobile(const std::string& application_id) {
policy_manager_->OnAppRegisteredOnMobile(application_id);
}
+RequestType::State PolicyHandler::GetAppRequestTypeState(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(RequestType::State::UNAVAILABLE);
+ return policy_manager_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyHandler::GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(RequestSubType::State::UNAVAILABLE);
+ return policy_manager_->GetAppRequestSubTypesState(policy_app_id);
+}
+
bool PolicyHandler::IsRequestTypeAllowed(
const std::string& policy_app_id,
mobile_apis::RequestType::eType type) const {
@@ -1744,17 +1901,66 @@ bool PolicyHandler::IsRequestTypeAllowed(
return false;
}
- std::vector<std::string> request_types =
- policy_manager_->GetAppRequestTypes(policy_app_id);
+ const RequestType::State request_type_state =
+ policy_manager_->GetAppRequestTypesState(policy_app_id);
+
+ switch (request_type_state) {
+ case RequestType::State::EMPTY: {
+ // If empty array of request types is assigned to app - any is allowed
+ LOG4CXX_TRACE(logger_, "Any Request Type is allowed by policies.");
+ return true;
+ }
+ case RequestType::State::OMITTED: {
+ // If RequestType parameter omitted for app - any is disallowed
+ LOG4CXX_TRACE(logger_, "All Request Types are disallowed by policies.");
+ return false;
+ }
+ case RequestType::State::AVAILABLE: {
+ // If any of request types is available for current application - get them
+ const auto request_types =
+ policy_manager_->GetAppRequestTypes(policy_app_id);
+ return helpers::in_range(request_types, stringified_type);
+ }
+ default:
+ return false;
+ }
+}
+
+bool PolicyHandler::IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const {
+ POLICY_LIB_CHECK(false);
+ using namespace mobile_apis;
- // If no request types are assigned to app - any is allowed
- if (request_types.empty()) {
- return true;
+ if (request_subtype.empty()) {
+ LOG4CXX_ERROR(logger_, "Request subtype to check is empty.");
+ return false;
}
- std::vector<std::string>::const_iterator it =
- std::find(request_types.begin(), request_types.end(), stringified_type);
- return request_types.end() != it;
+ const RequestSubType::State request_subtype_state =
+ policy_manager_->GetAppRequestSubTypesState(policy_app_id);
+ switch (request_subtype_state) {
+ case RequestSubType::State::EMPTY: {
+ // If empty array of request subtypes is assigned to app - any is allowed
+ LOG4CXX_TRACE(logger_, "Any Request SubType is allowed by policies.");
+ return true;
+ }
+ case RequestSubType::State::OMITTED: {
+ // If RequestSubType parameter omitted for app - any is disallowed
+ LOG4CXX_TRACE(logger_,
+ "All Request SubTypes are disallowed by policies.");
+ return false;
+ }
+ case RequestSubType::State::AVAILABLE: {
+ // If any of request subtypes is available for current application
+ // get them all
+ const auto request_subtypes =
+ policy_manager_->GetAppRequestSubTypes(policy_app_id);
+ return helpers::in_range(request_subtypes, request_subtype);
+ }
+ default:
+ return false;
+ }
}
const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
@@ -1763,6 +1969,12 @@ const std::vector<std::string> PolicyHandler::GetAppRequestTypes(
return policy_manager_->GetAppRequestTypes(policy_app_id);
}
+const std::vector<std::string> PolicyHandler::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ POLICY_LIB_CHECK(std::vector<std::string>());
+ return policy_manager_->GetAppRequestSubTypes(policy_app_id);
+}
+
const VehicleInfo policy::PolicyHandler::GetVehicleInfo() const {
POLICY_LIB_CHECK(VehicleInfo());
return policy_manager_->GetVehicleInfo();
@@ -1813,4 +2025,138 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx,
return ((is_registered && !is_empty_urls) || is_default);
}
+
+std::vector<std::string> PolicyHandler::GetDevicesIds(
+ const std::string& policy_app_id) {
+ return application_manager_.devices(policy_app_id);
+}
+
+void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ // If default is FULL, send request to HMI. Notification to mobile will be
+ // sent on response receiving.
+ if (mobile_apis::HMILevel::HMI_FULL == level) {
+ MessageHelper::SendActivateAppToHMI(app->app_id(), application_manager_);
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Changing hmi level of application "
+ << app->app_id() << " to default hmi level " << level);
+ // Set application hmi level
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+ // If hmi Level is full, it will be seted after ActivateApp response
+ MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+ }
+ }
+}
+
+bool PolicyHandler::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->CheckModule(app_id, module);
+}
+
+void PolicyHandler::OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SendAppPermissionsChanged(device_id, application_id);
+}
+
+void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ application_manager_.application(device_id, policy_app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Could not find application: " << device_id << " - "
+ << policy_app_id);
+ return;
+ }
+ mobile_apis::HMILevel::eType level =
+ MessageHelper::StringToHMILevel(hmi_level);
+ if (mobile_apis::HMILevel::INVALID_ENUM == level) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't convert default hmi level " << hmi_level
+ << " to enum.");
+ return;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Changing hmi level of application "
+ << app->app_id() << " to default hmi level " << level);
+ // Set application hmi level
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+ MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+}
+
+bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetModuleTypes(policy_app_id, modules);
+}
+
+void PolicyHandler::SetDefaultHmiTypes(
+ const std::string& application_id,
+ const smart_objects::SmartObject* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+ std::vector<int> hmi_types;
+ if (app_types && app_types->asArray()) {
+ smart_objects::SmartArray* hmi_list = app_types->asArray();
+ std::transform(hmi_list->begin(),
+ hmi_list->end(),
+ std::back_inserter(hmi_types),
+ SmartObjectToInt());
+ }
+ policy_manager_->SetDefaultHmiTypes(application_id, hmi_types);
+}
+
+bool PolicyHandler::CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK(false);
+ std::vector<int> policy_hmi_types;
+ bool ret = policy_manager_->GetHMITypes(application_id, &policy_hmi_types);
+
+ std::vector<int> additional_hmi_types;
+ if (app_types && app_types->asArray()) {
+ smart_objects::SmartArray* hmi_list = app_types->asArray();
+ std::transform(hmi_list->begin(),
+ hmi_list->end(),
+ std::back_inserter(additional_hmi_types),
+ SmartObjectToInt());
+ }
+ const std::vector<int>& hmi_types =
+ ret ? policy_hmi_types : additional_hmi_types;
+ return std::find(hmi_types.begin(), hmi_types.end(), hmi) != hmi_types.end();
+}
+
+void PolicyHandler::OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ application_manager_.application(device_id, policy_app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Could not find application: " << device_id << " - "
+ << policy_app_id);
+ return;
+ }
+ mobile_apis::HMILevel::eType level =
+ MessageHelper::StringToHMILevel(hmi_level);
+ if (mobile_apis::HMILevel::INVALID_ENUM == level) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't convert default hmi level " << hmi_level
+ << " to enum.");
+ return;
+ }
+ UpdateHMILevel(app, level);
+}
} // 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 2558e5f68d..7d24d0b35c 100644
--- a/src/components/application_manager/src/policies/policy_retry_sequence.cc
+++ b/src/components/application_manager/src/policies/policy_retry_sequence.cc
@@ -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/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 77a1853a39..315cf6fdf8 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -34,8 +34,8 @@
#include "application_manager/request_controller.h"
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "utils/make_shared.h"
+#include "application_manager/commands/request_to_hmi.h"
+
#include "utils/timer_task_impl.h"
namespace application_manager {
@@ -50,6 +50,7 @@ RequestController::RequestController(const RequestControlerSettings& settings)
: pool_state_(UNDEFINED)
, pool_size_(settings.thread_pool_size())
, request_tracker_(settings)
+ , duplicate_message_count_()
, timer_("AM RequestCtrlTimer",
new timer::TimerTaskImpl<RequestController>(
this, &RequestController::TimeoutThread))
@@ -63,8 +64,11 @@ RequestController::RequestController(const RequestControlerSettings& settings)
RequestController::~RequestController() {
LOG4CXX_AUTO_TRACE(logger_);
- timer_stop_flag_ = true;
- timer_condition_.Broadcast();
+ {
+ sync_primitives::AutoLock auto_lock(timer_lock);
+ timer_stop_flag_ = true;
+ timer_condition_.Broadcast();
+ }
timer_.Stop();
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
@@ -172,7 +176,7 @@ RequestController::TResult RequestController::addHMIRequest(
const RequestPtr request) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!request.valid()) {
+ if (request.use_count() == 0) {
LOG4CXX_ERROR(logger_, "HMI request pointer is invalid");
return RequestController::INVALID_DATA;
}
@@ -181,7 +185,7 @@ RequestController::TResult RequestController::addHMIRequest(
const uint64_t timeout_in_mseconds =
static_cast<uint64_t>(request->default_timeout());
RequestInfoPtr request_info_ptr =
- utils::MakeShared<HMIRequestInfo>(request, timeout_in_mseconds);
+ std::make_shared<HMIRequestInfo>(request, timeout_in_mseconds);
if (0 == timeout_in_mseconds) {
LOG4CXX_DEBUG(logger_,
@@ -227,6 +231,21 @@ void RequestController::TerminateRequest(const uint32_t correlation_id,
<< correlation_id << " connection_key = " << connection_key
<< " function_id = " << function_id
<< " force_terminate = " << force_terminate);
+ {
+ AutoLock auto_lock(duplicate_message_count_lock_);
+ auto dup_it = duplicate_message_count_.find(correlation_id);
+ if (duplicate_message_count_.end() != dup_it) {
+ duplicate_message_count_[correlation_id]--;
+ if (0 == duplicate_message_count_[correlation_id]) {
+ duplicate_message_count_.erase(dup_it);
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Ignoring termination request due to duplicate correlation "
+ "ID being sent");
+ return;
+ }
+ }
+
RequestInfoPtr request =
waiting_for_response_.Find(connection_key, correlation_id);
if (!request) {
@@ -268,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests(
std::list<RequestPtr>::iterator request_it = mobile_request_list_.begin();
while (mobile_request_list_.end() != request_it) {
RequestPtr request = (*request_it);
- if ((request.valid()) && (request->connection_key() == app_id)) {
+ if ((request.use_count() != 0) && (request->connection_key() == app_id)) {
mobile_request_list_.erase(request_it++);
} else {
++request_it;
@@ -370,11 +389,11 @@ void RequestController::TimeoutThread() {
LOG4CXX_DEBUG(
logger_,
"ENTER Waiting fore response count: " << waiting_for_response_.Size());
+ sync_primitives::AutoLock auto_lock(timer_lock);
while (!timer_stop_flag_) {
RequestInfoPtr probably_expired =
waiting_for_response_.FrontWithNotNullTimeout();
if (!probably_expired) {
- sync_primitives::AutoLock auto_lock(timer_lock);
timer_condition_.Wait(auto_lock);
continue;
}
@@ -382,18 +401,17 @@ void RequestController::TimeoutThread() {
LOG4CXX_DEBUG(logger_,
"Timeout for "
<< (RequestInfo::HMIRequest ==
- probably_expired->requst_type()
+ probably_expired->request_type()
? "HMI"
: "Mobile")
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " NOT expired");
- sync_primitives::AutoLock auto_lock(timer_lock);
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const TimevalStruct end_time = probably_expired->end_time();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
+ const date_time::TimeDuration end_time = probably_expired->end_time();
if (current_time < end_time) {
- const uint32_t msecs = static_cast<uint32_t>(
- date_time::DateTime::getmSecs(end_time - current_time));
+ const uint32_t msecs =
+ static_cast<uint32_t>(date_time::getmSecs(end_time - current_time));
LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs");
timer_condition_.WaitFor(auto_lock, msecs);
}
@@ -402,7 +420,7 @@ void RequestController::TimeoutThread() {
LOG4CXX_INFO(logger_,
"Timeout for "
<< (RequestInfo::HMIRequest ==
- probably_expired->requst_type()
+ probably_expired->request_type()
? "HMI"
: "Mobile")
<< " request id: " << probably_expired->requestId()
@@ -470,9 +488,26 @@ void RequestController::Worker::threadMain() {
const uint32_t timeout_in_mseconds = request_ptr->default_timeout();
RequestInfoPtr request_info_ptr =
- utils::MakeShared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
-
- request_controller_->waiting_for_response_.Add(request_info_ptr);
+ std::make_shared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
+
+ if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) {
+ commands::CommandRequestImpl* cmd_request =
+ dynamic_cast<commands::CommandRequestImpl*>(request_ptr.get());
+ if (cmd_request != NULL) {
+ uint32_t corr_id = cmd_request->correlation_id();
+ request_controller_->duplicate_message_count_lock_.Acquire();
+ auto dup_it =
+ request_controller_->duplicate_message_count_.find(corr_id);
+ if (request_controller_->duplicate_message_count_.end() == dup_it) {
+ request_controller_->duplicate_message_count_[corr_id] = 0;
+ }
+ request_controller_->duplicate_message_count_[corr_id]++;
+ request_controller_->duplicate_message_count_lock_.Release();
+ cmd_request->SendResponse(
+ false, mobile_apis::Result::INVALID_ID, "Duplicate correlation_id");
+ }
+ continue;
+ }
LOG4CXX_DEBUG(logger_, "timeout_in_mseconds " << timeout_in_mseconds);
if (0 != timeout_in_mseconds) {
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index a485a89b01..bbcda06b43 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -51,7 +51,7 @@ HMIRequestInfo::HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec)
}
HMIRequestInfo::HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, HMIRequest, start_time, timeout_msec) {
correlation_id_ = request_->correlation_id();
@@ -66,7 +66,7 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
}
MobileRequestInfo::MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, MobileRequest, start_time, timeout_msec) {
correlation_id_ = request_.get()->correlation_id();
@@ -74,19 +74,19 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
}
RequestInfo::RequestInfo(RequestPtr request,
- const RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestInfo::RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: request_(request), start_time_(start_time), timeout_msec_(timeout_msec) {
updateEndTime();
- requst_type_ = requst_type;
+ request_type_ = request_type;
correlation_id_ = request_->correlation_id();
app_id_ = request_->connection_key();
}
void application_manager::request_controller::RequestInfo::updateEndTime() {
- end_time_ = date_time::DateTime::getCurrentTime();
- date_time::DateTime::AddMilliseconds(end_time_, timeout_msec_);
+ end_time_ = date_time::getCurrentTime();
+ date_time::AddMilliseconds(end_time_, timeout_msec_);
}
void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
@@ -95,9 +95,8 @@ void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
}
bool RequestInfo::isExpired() {
- TimevalStruct curr_time = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::getmSecs(end_time_) <=
- date_time::DateTime::getmSecs(curr_time);
+ date_time::TimeDuration curr_time = date_time::getCurrentTime();
+ return date_time::getmSecs(end_time_) <= date_time::getmSecs(curr_time);
}
uint64_t RequestInfo::hash() {
@@ -151,7 +150,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
RequestInfoPtr result;
// Request info for searching in request info set by log_n time
- utils::SharedPtr<FakeRequestInfo> request_info_for_search(
+ std::shared_ptr<FakeRequestInfo> request_info_for_search(
new FakeRequestInfo(connection_key, correlation_id));
sync_primitives::AutoLock lock(pending_requests_lock_);
@@ -284,7 +283,7 @@ bool RequestInfoSet::AppIdCompararator::operator()(
bool RequestInfoTimeComparator::operator()(const RequestInfoPtr lhs,
const RequestInfoPtr rhs) const {
date_time::TimeCompare compare_result =
- date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
+ date_time::compareTime(lhs->end_time(), rhs->end_time());
if (compare_result == date_time::LESS) {
return true;
} else if (compare_result == date_time::GREATER) {
diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc
index 13b3d4d873..c047c82579 100644
--- a/src/components/application_manager/src/request_tracker.cc
+++ b/src/components/application_manager/src/request_tracker.cc
@@ -77,7 +77,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
const uint32_t max_requests,
ApplicationsRequestsTracker& tracker) {
LOG4CXX_AUTO_TRACE(logger_);
- using date_time::DateTime;
+ using namespace date_time;
if (!time_scale || !max_requests) {
LOG4CXX_INFO(logger_, "Time scale request tracking is disabled.");
@@ -93,7 +93,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (tracker.end() == it_app) {
LOG4CXX_DEBUG(logger_, "Adding new application into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
@@ -102,25 +102,24 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (it_app->second.size() < max_requests) {
LOG4CXX_DEBUG(logger_, "Adding new request into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
LOG4CXX_DEBUG(logger_,
"Oldest request is added at: "
- << DateTime::getmSecs(it_app->second.front())
- << ". Current time is: "
- << DateTime::getmSecs(DateTime::getCurrentTime())
+ << getmSecs(it_app->second.front())
+ << ". Current time is: " << getmSecs(getCurrentTime())
<< ". Time scale is: " << time_scale);
- if (DateTime::calculateTimeSpan(it_app->second.front()) > time_scale) {
+ if (calculateTimeSpan(it_app->second.front()) > time_scale) {
LOG4CXX_DEBUG(logger_, "Dropping oldest request, adding new one.");
ApplicationsRequestsTracker::mapped_type& times = tracker[app_id];
DCHECK_OR_RETURN(!times.empty(), false);
times.erase(times.begin());
- times.push_back(DateTime::getCurrentTime());
+ times.push_back(getCurrentTime());
return true;
}
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index ad50bbf104..3e77078ee5 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -35,6 +35,7 @@
#include <algorithm>
#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
#include "utils/file_system.h"
#include "connection_handler/connection_handler_impl.h"
@@ -47,17 +48,22 @@
#include "utils/helpers.h"
#include "application_manager/resumption/resumption_data_db.h"
#include "application_manager/resumption/resumption_data_json.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace resumption {
using namespace application_manager;
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType ConvertHmiLevelString(const std::string str);
+
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
: event_engine::EventObserver(application_manager.event_dispatcher())
- , queue_lock_(false)
, restore_hmi_level_timer_(
"RsmCtrlRstore",
new timer::TimerTaskImpl<ResumeCtrlImpl>(
@@ -67,13 +73,21 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
this, &ResumeCtrlImpl::SaveDataOnTimer))
, is_resumption_active_(false)
, is_data_saved_(false)
- , launch_time_(time(NULL))
+ , is_suspended_(false)
+ , launch_time_(time(nullptr))
+ , low_voltage_time_(0)
+ , wake_up_time_(0)
, application_manager_(application_manager) {}
#ifdef BUILD_TESTS
void ResumeCtrlImpl::set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) {
+ std::shared_ptr<ResumptionData> mock_storage) {
resumption_storage_ = mock_storage;
}
+
+bool ResumeCtrlImpl::get_resumption_active() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return is_resumption_active_;
+}
#endif // BUILD_TESTS
bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
@@ -116,6 +130,8 @@ bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
application_manager_.get_settings()
.app_resumption_save_persistent_data_timeout(),
timer::kPeriodic);
+
+ resumption_storage_->IncrementGlobalIgnOnCounter();
return true;
}
@@ -132,9 +148,13 @@ void ResumeCtrlImpl::SaveAllApplications() {
void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
- LOG4CXX_INFO(logger_,
- "application with appID " << application->app_id()
- << " will be saved");
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "application with appID " << application->app_id()
+ << " will be saved");
resumption_storage_->SaveApplication(application);
}
@@ -156,10 +176,38 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
if (result) {
DCHECK_OR_RETURN(application, false);
if (saved_app.keyExists(strings::hmi_level)) {
- const HMILevel::eType saved_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- saved_app[strings::hmi_level].asInt());
- LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ HMILevel::eType saved_hmi_level;
+ if (HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ saved_hmi_level = application->deferred_resumption_hmi_level();
+ LOG4CXX_INFO(logger_,
+ "Retry resuming into HMI level : " << saved_hmi_level);
+ application->set_deferred_resumption_hmi_level(
+ HMILevel::eType::INVALID_ENUM);
+ } else {
+ saved_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ }
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+
+ application->set_deferred_resumption_hmi_level(saved_hmi_level);
+
+ saved_hmi_level =
+ PickLowerHmiLevel(saved_hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, app will resume into : "
+ << saved_hmi_level);
+ }
+
return SetAppHMIState(application, saved_hmi_level, true);
} else {
result = false;
@@ -174,9 +222,23 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
bool ResumeCtrlImpl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(application, false);
- mobile_apis::HMILevel::eType default_hmi =
+ mobile_apis::HMILevel::eType hmi_level =
application_manager_.GetDefaultHmiLevel(application);
- return SetAppHMIState(application, default_hmi, false);
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+ hmi_level = PickLowerHmiLevel(hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, default HMI level is set to : "
+ << hmi_level);
+ }
+ return SetAppHMIState(application, hmi_level, false);
}
void ResumeCtrlImpl::ApplicationResumptiOnTimer() {
@@ -256,6 +318,10 @@ uint32_t ResumeCtrlImpl::GetHMIApplicationID(
bool ResumeCtrlImpl::RemoveApplicationFromSaved(
ApplicationConstSharedPtr application) {
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return false;
+ }
const std::string& device_mac = application->mac_address();
return resumption_storage_->RemoveApplicationFromSaved(
application->policy_app_id(), device_mac);
@@ -263,16 +329,47 @@ bool ResumeCtrlImpl::RemoveApplicationFromSaved(
void ResumeCtrlImpl::OnSuspend() {
LOG4CXX_AUTO_TRACE(logger_);
- StopSavePersistentDataTimer();
- SaveAllApplications();
- resumption_storage_->OnSuspend();
- resumption_storage_->Persist();
+ is_suspended_ = true;
+ FinalPersistData();
+}
+
+void ResumeCtrlImpl::OnIgnitionOff() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!application_manager_.IsLowVoltage()) {
+ resumption_storage_->IncrementIgnOffCount();
+ resumption_storage_->ResetGlobalIgnOnCount();
+ FinalPersistData();
+ }
}
void ResumeCtrlImpl::OnAwake() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_suspended_ = false;
ResetLaunchTime();
StartSavePersistentDataTimer();
- return resumption_storage_->OnAwake();
+}
+
+void ResumeCtrlImpl::SaveLowVoltageTime() {
+ low_voltage_time_ = time(nullptr);
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage timestamp : " << low_voltage_time_ << " saved");
+}
+
+void ResumeCtrlImpl::SaveWakeUpTime() {
+ wake_up_time_ = std::time(nullptr);
+ LOG4CXX_DEBUG(logger_, "Wake Up timestamp : " << wake_up_time_ << " saved");
+}
+
+time_t ResumeCtrlImpl::LowVoltageTime() const {
+ return low_voltage_time_;
+}
+
+time_t ResumeCtrlImpl::WakeUpTime() const {
+ return wake_up_time_;
+}
+
+bool ResumeCtrlImpl::is_suspended() const {
+ return is_suspended_;
}
void ResumeCtrlImpl::StartSavePersistentDataTimer() {
@@ -342,6 +439,28 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
return result;
}
+void ResumeCtrlImpl::RetryResumption(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Invalid app_id = " << app_id);
+ return;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ // check and update resumption deferred flag in queue_lock_
+ if (mobile_api::HMILevel::eType::INVALID_ENUM ==
+ app->deferred_resumption_hmi_level()) {
+ LOG4CXX_DEBUG(logger_, "No need to retry resumption for app: " << app_id);
+ return;
+ }
+ }
+
+ AddToResumptionTimerQueue(app_id);
+}
+
void ResumeCtrlImpl::StartAppHmiStateResumption(
ApplicationSharedPtr application) {
using namespace date_time;
@@ -355,15 +474,33 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
LOG4CXX_ERROR(logger_, "Application was not saved");
return;
}
- const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt();
- bool restore_data_allowed = false;
- restore_data_allowed =
- CheckAppRestrictions(application, saved_app) &&
- ((0 == ign_off_count) || CheckIgnCycleRestrictions(saved_app));
- if (restore_data_allowed) {
+
+ const bool is_hmi_level_applicable_to_resume =
+ CheckAppRestrictions(application, saved_app);
+
+ if (!is_hmi_level_applicable_to_resume) {
+ LOG4CXX_DEBUG(logger_, "No applicable HMI level found for resuming");
+ return;
+ }
+
+ const bool is_resume_allowed_by_low_voltage =
+ CheckLowVoltageRestrictions(saved_app);
+
+ const bool is_hmi_level_allowed_by_ign_cycle =
+ CheckIgnCycleRestrictions(saved_app);
+
+ const bool restore_hmi_level_allowed =
+ is_resume_allowed_by_low_voltage && is_hmi_level_allowed_by_ign_cycle;
+
+ if (restore_hmi_level_allowed) {
LOG4CXX_INFO(logger_,
"Resume application " << application->policy_app_id());
RestoreAppHMIState(application);
+ if (mobile_apis::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ // the application has not been fully resumed
+ return;
+ }
RemoveApplicationFromSaved(application);
} else {
LOG4CXX_INFO(logger_,
@@ -433,6 +570,13 @@ void ResumeCtrlImpl::SaveDataOnTimer() {
}
}
+void ResumeCtrlImpl::FinalPersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopSavePersistentDataTimer();
+ SaveAllApplications();
+ resumption_storage_->Persist();
+}
+
bool ResumeCtrlImpl::IsDeviceMacAddressEqual(
ApplicationSharedPtr application, const std::string& saved_device_mac) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -527,8 +671,12 @@ void ResumeCtrlImpl::AddCommands(ApplicationSharedPtr application,
saved_app[strings::application_commands];
for (size_t i = 0; i < app_commands.length(); ++i) {
const smart_objects::SmartObject& command = app_commands[i];
+ const uint32_t cmd_id = command[strings::cmd_id].asUInt();
+ const bool is_resumption = true;
- application->AddCommand(command[strings::cmd_id].asUInt(), command);
+ application->AddCommand(cmd_id, command);
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, command, is_resumption);
}
ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(
application, application_manager_));
@@ -580,7 +728,7 @@ void ResumeCtrlImpl::AddWayPointsSubscription(
const smart_objects::SmartObject& subscribed_for_way_points_so =
saved_app[strings::subscribed_for_way_points];
if (true == subscribed_for_way_points_so.asBool()) {
- application_manager_.SubscribeAppForWayPoints(application->app_id());
+ application_manager_.SubscribeAppForWayPoints(application);
}
}
}
@@ -589,33 +737,25 @@ void ResumeCtrlImpl::AddSubscriptions(
ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- if (saved_app.keyExists(strings::application_subscribtions)) {
- const smart_objects::SmartObject& subscribtions =
- saved_app[strings::application_subscribtions];
+ if (saved_app.keyExists(strings::application_subscriptions)) {
+ const smart_objects::SmartObject& subscriptions =
+ saved_app[strings::application_subscriptions];
- if (subscribtions.keyExists(strings::application_buttons)) {
- const smart_objects::SmartObject& subscribtions_buttons =
- subscribtions[strings::application_buttons];
+ if (subscriptions.keyExists(strings::application_buttons)) {
+ const smart_objects::SmartObject& subscriptions_buttons =
+ subscriptions[strings::application_buttons];
mobile_apis::ButtonName::eType btn;
- for (size_t i = 0; i < subscribtions_buttons.length(); ++i) {
+ for (size_t i = 0; i < subscriptions_buttons.length(); ++i) {
btn = static_cast<mobile_apis::ButtonName::eType>(
- (subscribtions_buttons[i]).asInt());
+ (subscriptions_buttons[i]).asInt());
application->SubscribeToButton(btn);
}
}
MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
application, application_manager_);
- if (subscribtions.keyExists(strings::application_vehicle_info)) {
- const smart_objects::SmartObject& subscribtions_ivi =
- subscribtions[strings::application_vehicle_info];
- 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_));
+ for (auto& extension : application->Extensions()) {
+ extension->ProcessResumption(subscriptions);
}
}
}
@@ -623,30 +763,62 @@ void ResumeCtrlImpl::AddSubscriptions(
bool ResumeCtrlImpl::CheckIgnCycleRestrictions(
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- bool result = true;
if (!CheckDelayAfterIgnOn()) {
- LOG4CXX_INFO(logger_, "Application was connected long after ign on");
- result = false;
+ LOG4CXX_DEBUG(logger_, "Application was connected long after ign on");
+ return false;
}
- if (!DisconnectedJustBeforeIgnOff(saved_app)) {
- LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
- result = false;
+ if (!CheckDelayBeforeIgnOff(saved_app)) {
+ LOG4CXX_DEBUG(logger_, "Application was disconnected long before ign off");
+ return false;
}
- return result;
+ return true;
}
-bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
+bool ResumeCtrlImpl::CheckLowVoltageRestrictions(
const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!CheckDelayBeforeLowVoltage(saved_app)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application was disconnected long before low voltage");
+ return false;
+ }
+
+ if (!CheckDelayAfterWakeUp()) {
+ LOG4CXX_DEBUG(logger_, "Application was connected long after wake up");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "HMI Level resuming in not restricted by Low Voltage");
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
const time_t time_stamp =
- static_cast<time_t>(saved_app[strings::time_stamp].asUInt());
- time_t ign_off_time =
+ static_cast<time_t>(saved_app[strings::time_stamp].asInt());
+ const time_t ign_off_time =
static_cast<time_t>(resumption_storage_->GetIgnOffTime());
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(
+ logger_, "No IGNITION OFF records found: This is first Ignition cycle");
+ return true;
+ }
+
+ // This means that ignition off timestamp was not saved
+ // Possible reasons: Low Voltage event, core crash etc.
+ if (ign_off_time < time_stamp) {
+ LOG4CXX_DEBUG(logger_, "Last IGNITION OFF record missed");
+ return true;
+ }
+
const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp);
LOG4CXX_DEBUG(
logger_,
@@ -659,6 +831,71 @@ bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
application_manager_.get_settings().resumption_delay_before_ign();
}
+bool ResumeCtrlImpl::CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
+
+ if (0 == LowVoltageTime()) {
+ LOG4CXX_DEBUG(logger_, "No Low Voltage signal timestamp saved");
+ return true;
+ }
+
+ const time_t unregistration_time_stamp =
+ static_cast<time_t>(saved_app[strings::time_stamp].asInt());
+ const time_t low_voltage_timestamp = static_cast<time_t>(LowVoltageTime());
+ const int32_t sec_spent_before_low_voltage =
+ (low_voltage_timestamp - unregistration_time_stamp);
+ if (0 > sec_spent_before_low_voltage) {
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << sec_spent_before_low_voltage);
+ return true;
+ }
+
+ const uint32_t secs_between_app_disconnect_and_low_voltage =
+ static_cast<uint32_t>(sec_spent_before_low_voltage);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_before_ign();
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << secs_between_app_disconnect_and_low_voltage
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return secs_between_app_disconnect_and_low_voltage <= wait_time;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterWakeUp() const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (0 == WakeUpTime()) {
+ LOG4CXX_DEBUG(logger_, "No WakeUp signal timestamp saved");
+ return true;
+ }
+
+ const time_t current_time = time(nullptr);
+ const time_t wake_up_timestamp = static_cast<time_t>(WakeUpTime());
+
+ const uint32_t seconds_from_wake_up_signal =
+ labs(current_time - wake_up_timestamp);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_after_ign();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Current time: " << current_time << "; WakeUp Signal time: "
+ << wake_up_timestamp << "; Seconds passed from wake up: "
+ << seconds_from_wake_up_signal
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return seconds_from_wake_up_signal <= wait_time;
+}
+
bool ResumeCtrlImpl::CheckAppRestrictions(
ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app) {
@@ -667,16 +904,23 @@ bool ResumeCtrlImpl::CheckAppRestrictions(
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::hmi_level), false);
- const HMILevel::eType hmi_level =
- static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ HMILevel::eType hmi_level;
+ if (mobile_api::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ hmi_level = application->deferred_resumption_hmi_level();
+ } else {
+ hmi_level =
+ static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ }
const bool result = Compare<HMILevel::eType, EQ, ONE>(
hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)
? true
: false;
LOG4CXX_DEBUG(logger_,
- "is_media_app " << application->is_media_application()
- << "; hmi_level " << hmi_level << " result "
- << result);
+ "is_media_app: " << application->is_media_application()
+ << "; hmi_level: " << hmi_level << "; result: "
+ << (result ? "Applicable for resume"
+ : "Non-applicable for resume"));
return result;
}
@@ -689,11 +933,36 @@ bool ResumeCtrlImpl::CheckIcons(ApplicationSharedPtr application,
return mobile_apis::Result::INVALID_DATA != verify_images;
}
-bool ResumeCtrlImpl::CheckDelayAfterIgnOn() {
+bool ResumeCtrlImpl::CheckIgnCyclesData() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t global_ign_on_count =
+ resumption_storage_->GetGlobalIgnOnCounter();
+ const uint32_t the_first_ignition = 1;
+ const bool is_emergency_ign_off_occurred =
+ global_ign_on_count > the_first_ignition;
+ // global_ign_on_count is reseting to 0 at ignition off
+ // global_ign_on_count is incrementing at ignition on
+ // global_ign_on_count > 1 means that correct ignition off was not present.
+ if (is_emergency_ign_off_occurred) {
+ LOG4CXX_WARN(logger_,
+ "Emergency IGN OFF occurred. Possibly after Low Voltage");
+ return false;
+ }
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterIgnOn() const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
- const time_t curr_time = time(NULL);
+ const time_t ign_off_time = GetIgnOffTime();
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(logger_, "This is first Ignition cycle");
+ return true;
+ }
+ const time_t curr_time = time(nullptr);
const time_t sdl_launch_time = LaunchTime();
+
const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
const uint32_t wait_time =
application_manager_.get_settings().resumption_delay_after_ign();
@@ -709,7 +978,7 @@ time_t ResumeCtrlImpl::LaunchTime() const {
return launch_time_;
}
-time_t ResumeCtrlImpl::GetIgnOffTime() {
+time_t ResumeCtrlImpl::GetIgnOffTime() const {
return resumption_storage_->GetIgnOffTime();
}
@@ -725,7 +994,7 @@ bool ResumeCtrlImpl::ProcessHMIRequest(smart_objects::SmartObjectSPtr request,
(*request)[strings::correlation_id].asInt();
subscribe_on_event(function_id, hmi_correlation_id);
}
- if (!application_manager_.ManageHMICommand(request)) {
+ if (!application_manager_.GetRPCService().ManageHMICommand(request)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
return false;
}
@@ -744,14 +1013,21 @@ void ResumeCtrlImpl::ProcessHMIRequests(
void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
+ bool run_resumption = false;
queue_lock_.Acquire();
waiting_for_timer_.push_back(app_id);
+
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ run_resumption = true;
+ }
queue_lock_.Release();
LOG4CXX_DEBUG(logger_,
"Application ID " << app_id << " have been added"
" to resumption queue.");
- if (!is_resumption_active_) {
- is_resumption_active_ = true;
+ if (run_resumption) {
+ LOG4CXX_DEBUG(logger_,
+ "Application ID " << app_id << " will be restored by timer");
restore_hmi_level_timer_.Start(
application_manager_.get_settings().app_resuming_timeout(),
timer::kSingleShot);
@@ -773,7 +1049,7 @@ void ResumeCtrlImpl::LoadResumeData() {
"Resumption data for application "
<< app_id << " and device id " << device_id
<< " will be dropped.");
- resumption_storage_->DropAppDataResumption(device_id, app_id);
+ resumption_storage_->RemoveApplicationFromSaved(app_id, device_id);
continue;
}
}
@@ -798,9 +1074,13 @@ void ResumeCtrlImpl::OnAppRegistrationEnd() {
int32_t ResumeCtrlImpl::GetSavedAppHmiLevel(
const std::string& app_id, const std::string& device_id) const {
+ using namespace mobile_apis;
smart_objects::SmartObject saved_app;
if (resumption_storage_->GetSavedApplication(app_id, device_id, saved_app)) {
- const int32_t saved_hmi_level = saved_app[strings::hmi_level].asInt();
+ const HMILevel::eType saved_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+
return saved_hmi_level;
}
return static_cast<int32_t>(mobile_apis::HMILevel::INVALID_ENUM);
@@ -812,4 +1092,97 @@ bool ResumeCtrlImpl::IsAppDataResumptionExpired(
return max_ign_off_count <= application[strings::ign_off_count].asInt();
}
+mobile_apis::HMILevel::eType ResumeCtrlImpl::GetHmiLevelOnLowBandwidthTransport(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const ApplicationManagerSettings& settings =
+ application_manager_.get_settings();
+ const std::string& level_for_navi_app =
+ settings.navigation_lowbandwidth_resumption_level();
+ const std::string& level_for_projection_app =
+ settings.projection_lowbandwidth_resumption_level();
+ const std::string& level_for_media_app =
+ settings.media_lowbandwidth_resumption_level();
+
+ HMILevel::eType result_level = HMILevel::HMI_NONE;
+ HMILevel::eType level;
+
+ // NAVIGATION, PROJECTION and media apps have special exceptions. Their HMI
+ // level can be configured through .ini file. when the app has multiple
+ // AppHMIType, then the highest level will be applied.
+ if (application->is_navi()) {
+ level = ConvertHmiLevelString(level_for_navi_app);
+ LOG4CXX_DEBUG(logger_,
+ "NAVIGATION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->mobile_projection_enabled()) {
+ level = ConvertHmiLevelString(level_for_projection_app);
+ LOG4CXX_DEBUG(logger_,
+ "PROJECTION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->is_media_application()) {
+ level = ConvertHmiLevelString(level_for_media_app);
+ LOG4CXX_DEBUG(logger_,
+ "media apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+
+ return result_level;
+}
+
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // smaller enum value has higher level
+ return val1 < val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // bigger enum value has lower level
+ return val1 > val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType ConvertHmiLevelString(
+ const std::string str) {
+ using namespace mobile_apis;
+
+ if ("BACKGROUND" == str) {
+ return HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == str) {
+ return HMILevel::HMI_FULL;
+ } else if ("LIMITED" == str) {
+ return HMILevel::HMI_LIMITED;
+ } else if ("NONE" == str) {
+ return HMILevel::HMI_NONE;
+ } else {
+ return HMILevel::HMI_NONE;
+ }
+}
+
} // namespce resumption
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 273cd5413e..856fb03750 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -33,7 +33,6 @@
#include "application_manager/resumption/resumption_data.h"
#include "utils/logger.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/application_manager_settings.h"
namespace resumption {
@@ -42,7 +41,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumptionData::ResumptionData(
const application_manager::ApplicationManager& application_manager)
- : resumption_lock_(true), application_manager_(application_manager) {}
+ : application_manager_(application_manager) {}
smart_objects::SmartObject ResumptionData::GetApplicationCommands(
app_mngr::ApplicationConstSharedPtr application) const {
@@ -160,16 +159,9 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions(
strings::application_buttons,
subscriptions);
- DataAccessor<VehicleInfoSubscriptions> vi_accessor =
- application->SubscribedIVI();
-
- const VehicleInfoSubscriptions& vi_subscription = vi_accessor.GetData();
-
- LOG4CXX_DEBUG(logger_, "SubscribedIVI:" << vi_subscription.size());
- Append(vi_subscription.begin(),
- vi_subscription.end(),
- strings::application_vehicle_info,
- subscriptions);
+ for (auto extension : application->Extensions()) {
+ extension->SaveResumptionData(subscriptions);
+ }
return subscriptions;
}
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 08de6d8190..1591ce566a 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -163,11 +163,10 @@ void ResumptionDataDB::SaveApplication(
}
if (application->is_application_data_changed()) {
- if (application_exist) {
- if (!DeleteSavedApplication(policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
- return;
- }
+ if (application_exist &&
+ !DeleteSavedApplication(policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
+ return;
}
if (!SaveApplicationToDB(application, policy_app_id, device_mac)) {
@@ -176,23 +175,15 @@ void ResumptionDataDB::SaveApplication(
}
LOG4CXX_INFO(logger_, "All data from application were saved successfully");
application->set_is_application_data_changed(false);
- } else {
- if (application_exist) {
- if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Updating application data is failed");
- return;
- }
- LOG4CXX_INFO(logger_, "Application data were updated successfully");
- } else {
- if (Compare<HMILevel::eType, EQ, ONE>(application->hmi_level(),
- HMILevel::HMI_FULL,
- HMILevel::HMI_LIMITED)) {
- if (!InsertApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Saving data of application is failed");
- return;
- }
- }
+ } else if (application_exist) {
+ if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Updating application data is failed");
+ return;
}
+ LOG4CXX_INFO(logger_, "Application data were updated successfully");
+ } else if (!InsertApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Saving data of application is failed");
+ return;
}
WriteDb();
}
@@ -212,7 +203,7 @@ uint32_t ResumptionDataDB::GetHMIApplicationID(
return hmi_app_id;
}
-void ResumptionDataDB::OnSuspend() {
+void ResumptionDataDB::IncrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
utils::dbms::SQLQuery query_update_suspend_data(db());
@@ -238,7 +229,7 @@ void ResumptionDataDB::OnSuspend() {
}
}
- if (query_update_last_ign_off_time.Prepare(KUpdateLastIgnOffTime)) {
+ if (query_update_last_ign_off_time.Prepare(kUpdateLastIgnOffTime)) {
query_update_last_ign_off_time.Bind(0, static_cast<int64_t>(time(NULL)));
if (query_update_last_ign_off_time.Exec()) {
LOG4CXX_INFO(logger_, "Data last_ign_off_time was updated");
@@ -291,7 +282,7 @@ bool ResumptionDataDB::GetHashId(const std::string& policy_app_id,
return SelectHashId(policy_app_id, device_id, hash_id);
}
-void ResumptionDataDB::OnAwake() {
+void ResumptionDataDB::DecrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
UpdateDataOnAwake();
@@ -372,10 +363,61 @@ bool ResumptionDataDB::RemoveApplicationFromSaved(
uint32_t ResumptionDataDB::GetIgnOffTime() const {
LOG4CXX_AUTO_TRACE(logger_);
-
return SelectIgnOffTime();
}
+uint32_t ResumptionDataDB::GetGlobalIgnOnCounter() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(kSelectGlobalIgnOnCounter)) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with prepare query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with exec query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ const auto global_ign_on_counter = query.GetUInteger(0);
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+}
+
+void ResumptionDataDB::IncrementGlobalIgnOnCounter() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ db_->BeginTransaction();
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kUpdateGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_,
+ "Data query_update_global_ign_on_count was updated");
+ }
+ }
+ db_->CommitTransaction();
+ WriteDb();
+}
+
+void ResumptionDataDB::ResetGlobalIgnOnCount() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kResetGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_, "Data was updated");
+ }
+ }
+}
+
ssize_t ResumptionDataDB::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -553,7 +595,6 @@ void ResumptionDataDB::SelectDataForLoadResumeData(
using namespace app_mngr;
using namespace smart_objects;
LOG4CXX_AUTO_TRACE(logger_);
-
utils::dbms::SQLQuery select_data(db());
utils::dbms::SQLQuery count_application(db());
if (!select_data.Prepare(kSelectDataForLoadResumeData) ||
@@ -949,7 +990,7 @@ bool ResumptionDataDB::SelectSubscriptionsData(
return false;
}
- saved_app[strings::application_subscribtions] = SmartObject(SmartType_Map);
+ saved_app[strings::application_subscriptions] = SmartObject(SmartType_Map);
if (0 == count_item) {
LOG4CXX_INFO(logger_, "Application does not contain subscriptions data");
@@ -968,8 +1009,8 @@ bool ResumptionDataDB::SelectSubscriptionsData(
size_t buttons_idx = 0;
size_t vi_idx = 0;
/* Position of data in "select_subscriptions" :
- field "vehicleValue" from table "applicationSubscribtionsArray" = 0
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 1*/
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 0
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 1*/
while (select_subscriptions.Next()) {
if (!select_subscriptions.IsNull(0)) {
application_vehicle_info[vi_idx++] = select_subscriptions.GetInteger(0);
@@ -979,12 +1020,12 @@ bool ResumptionDataDB::SelectSubscriptionsData(
}
}
if (!application_buttons.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_buttons] = application_buttons;
}
if (!application_vehicle_info.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_vehicle_info] = application_vehicle_info;
}
LOG4CXX_INFO(logger_, "Subscriptions were restored from DB successfully");
@@ -1500,9 +1541,9 @@ bool ResumptionDataDB::DeleteSavedSubscriptions(
LOG4CXX_AUTO_TRACE(logger_);
if (!ExecQueryToDeleteData(
- policy_app_id, device_id, kDeleteApplicationSubscribtionsArray)) {
+ policy_app_id, device_id, kDeleteApplicationSubscriptionsArray)) {
LOG4CXX_WARN(logger_,
- "Incorrect delete from applicationSubscribtionsArray.");
+ "Incorrect delete from applicationSubscriptionsArray.");
return false;
}
return true;
@@ -1895,7 +1936,7 @@ bool ResumptionDataDB::SaveApplicationToDB(
}
if (!InsertSubscriptionsData(GetApplicationSubscriptions(application),
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -1952,9 +1993,9 @@ bool ResumptionDataDB::SaveApplicationToDB(
db_->RollbackTransaction();
return false;
}
- if (!InsertSubscriptionsData(application["subscribtions"],
+ if (!InsertSubscriptionsData(application["subscriptions"],
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -2160,9 +2201,9 @@ bool ResumptionDataDB::InsertSubscriptionsData(
return false;
}
/* Positions of binding data for "insert_subscriptions":
- field "idApplication" from table "applicationSubscribtionsArray" = 0
- field "vehicleValue" from table "applicationSubscribtionsArray" = 1
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 2*/
+ field "idApplication" from table "applicationSubscriptionsArray" = 0
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 1
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 2*/
for (size_t i = 0; i < max_length; ++i) {
insert_subscriptions.Bind(0, application_primary_key);
if (i < vi_sub_length) {
@@ -2578,7 +2619,7 @@ bool ResumptionDataDB::InsertApplicationData(
const mobile_apis::HMILevel::eType hmi_level = application.m_hmi_level;
bool is_media_application = application.m_is_media_application;
bool is_subscribed_for_way_points =
- application_manager_.IsAppSubscribedForWayPoints(connection_key);
+ application_manager_.IsAppSubscribedForWayPoints(application.app_ptr);
if (!query.Prepare(kInsertApplication)) {
LOG4CXX_WARN(logger_,
@@ -2804,6 +2845,7 @@ ApplicationParams::ApplicationParams(app_mngr::ApplicationSharedPtr application)
m_hmi_app_id = application->hmi_app_id();
m_hmi_level = application->hmi_level();
m_is_media_application = application->IsAudioApplication();
+ app_ptr = application;
}
}
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index 7866fc4de1..c8e9032dfa 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -41,7 +41,7 @@
namespace resumption {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
@@ -66,7 +66,7 @@ void ResumptionDataJson::SaveApplication(
const std::string device_mac = application->mac_address();
const mobile_apis::HMILevel::eType hmi_level = application->hmi_level();
const bool is_subscribed_for_way_points =
- application_manager_.IsAppSubscribedForWayPoints(application->app_id());
+ application_manager_.IsAppSubscribedForWayPoints(application);
sync_primitives::AutoLock autolock(resumption_lock_);
Json::Value tmp;
@@ -81,22 +81,22 @@ void ResumptionDataJson::SaveApplication(
json_app[strings::hmi_level] = static_cast<int32_t>(hmi_level);
json_app[strings::ign_off_count] = 0;
json_app[strings::hash_id] = hash;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationCommands(application), tmp);
json_app[strings::application_commands] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubMenus(application), tmp);
json_app[strings::application_submenus] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationInteractionChoiseSets(application), tmp);
json_app[strings::application_choice_sets] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationGlobalProperties(application), tmp);
json_app[strings::application_global_properties] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubscriptions(application), tmp);
- json_app[strings::application_subscribtions] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ json_app[strings::application_subscriptions] = tmp;
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationFiles(application), tmp);
json_app[strings::application_files] = tmp;
json_app[strings::time_stamp] = time_stamp;
@@ -143,11 +143,11 @@ uint32_t ResumptionDataJson::GetHMIApplicationID(
return hmi_app_id;
}
-void ResumptionDataJson::OnSuspend() {
+void ResumptionDataJson::IncrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(resumption_lock_);
- Json::Value to_save;
+ Json::Value to_save = Json::arrayValue;
for (Json::Value::iterator it = GetSavedApplications().begin();
it != GetSavedApplications().end();
++it) {
@@ -167,7 +167,7 @@ void ResumptionDataJson::OnSuspend() {
LOG4CXX_DEBUG(logger_, GetResumptionData().toStyledString());
}
-void ResumptionDataJson::OnAwake() {
+void ResumptionDataJson::DecrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(resumption_lock_);
@@ -225,7 +225,7 @@ bool ResumptionDataJson::GetSavedApplication(
return false;
}
const Json::Value& json_saved_app = GetSavedApplications()[idx];
- Formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
+ formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
return true;
}
@@ -279,6 +279,51 @@ uint32_t ResumptionDataJson::GetIgnOffTime() const {
return resumption[strings::last_ign_off_time].asUInt();
}
+uint32_t ResumptionDataJson::GetGlobalIgnOnCounter() const {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+ }
+ return 1;
+}
+
+void ResumptionDataJson::IncrementGlobalIgnOnCounter() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Global IGN ON counter in resumption data: " << global_ign_on_counter);
+ resumption[strings::global_ign_on_counter] = global_ign_on_counter + 1;
+ LOG4CXX_DEBUG(logger_,
+ "Global IGN ON counter new value: "
+ << resumption[strings::global_ign_on_counter].asUInt());
+ } else {
+ resumption[strings::global_ign_on_counter] = 1;
+ }
+ last_state().SaveStateToFileSystem();
+}
+
+void ResumptionDataJson::ResetGlobalIgnOnCount() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+
+ resumption[strings::global_ign_on_counter] = 0;
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+}
+
ssize_t ResumptionDataJson::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -469,7 +514,7 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
application[strings::application_submenus].clear();
application[strings::application_choice_sets].clear();
application[strings::application_global_properties].clear();
- application[strings::application_subscribtions].clear();
+ application[strings::application_subscriptions].clear();
application[strings::application_files].clear();
application.removeMember(strings::grammar_id);
LOG4CXX_DEBUG(logger_,
@@ -480,6 +525,9 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
}
void ResumptionDataJson::Persist() {
+ // We lock the resumption data because SaveStateToFileSystem accesses
+ // the same dictionary that we use here in ResumptionDataJson
+ sync_primitives::AutoLock autolock(resumption_lock_);
last_state().SaveStateToFileSystem();
}
diff --git a/src/components/application_manager/src/resumption/resumption_sql_queries.cc b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
index 5f318e6955..4770bafef4 100644
--- a/src/components/application_manager/src/resumption/resumption_sql_queries.cc
+++ b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
@@ -37,6 +37,7 @@ const std::string kCreateSchema =
"BEGIN ; "
"CREATE TABLE IF NOT EXISTS `resumption`( "
" `idresumption` INTEGER PRIMARY KEY, "
+ " `global_ign_on_count` INTEGER, "
" `last_ign_off_time` INTEGER "
" ); "
"CREATE TABLE IF NOT EXISTS `subscribedForWayPoints`( "
@@ -212,7 +213,7 @@ const std::string kCreateSchema =
"`vrHelpItemArray`(`idglobalProperties`); "
"CREATE TABLE IF NOT EXISTS `application`( "
" `idApplication` INTEGER PRIMARY KEY NOT NULL, "
- " `appID` TEXT, "
+ " `appID` TEXT COLLATE NOCASE, "
" `connection_key` INTEGER, "
" `grammarID` INTEGER, "
" `hashID` TEXT, "
@@ -298,8 +299,8 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS "
"`applicationSubMenuArray.fk_Application_idx` "
" ON `applicationSubMenuArray`(`idApplication`); "
- "CREATE TABLE IF NOT EXISTS `applicationSubscribtionsArray`( "
- " `idapplicationSubscribtionsArray` INTEGER PRIMARY KEY NOT NULL, "
+ "CREATE TABLE IF NOT EXISTS `applicationSubscriptionsArray`( "
+ " `idapplicationSubscriptionsArray` INTEGER PRIMARY KEY NOT NULL, "
" `vehicleValue` INTEGER, "
" `ButtonNameValue` INTEGER, "
" `idApplication` INTEGER, "
@@ -308,8 +309,8 @@ const std::string kCreateSchema =
" REFERENCES `application`(`idApplication`) "
" ); "
"CREATE INDEX IF NOT EXISTS "
- "`applicationSubscribtionsArray.fk_Application_idx` "
- " ON `applicationSubscribtionsArray`(`idApplication`); "
+ "`applicationSubscriptionsArray.fk_Application_idx` "
+ " ON `applicationSubscriptionsArray`(`idApplication`); "
"CREATE TABLE IF NOT EXISTS `_internal_data`( "
" `db_version_hash` INTEGER "
" ); "
@@ -365,14 +366,16 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `applicationSubMenuArray`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_subMenu_idx`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_Application_idx`; "
- "DROP TABLE IF EXISTS `applicationSubscribtionsArray`; "
- "DROP INDEX IF EXISTS `applicationSubscribtionsArray.fk_Application_idx`; "
+ "DROP TABLE IF EXISTS `applicationSubscriptionsArray`; "
+ "DROP INDEX IF EXISTS `applicationSubscriptionsArray.fk_Application_idx`; "
"DROP TABLE IF EXISTS `_internal_data`; "
"COMMIT; "
"VACUUM;";
const std::string kInsertInitData =
- "INSERT OR IGNORE INTO `resumption` (`last_ign_off_time`) VALUES (0); "
+ "INSERT OR IGNORE INTO `resumption` "
+ "(`last_ign_off_time`, `global_ign_on_count`) "
+ "VALUES (0, 0); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); ";
const std::string kChecksResumptionData =
@@ -410,6 +413,17 @@ const std::string kSelectHashId =
const std::string kSelectIgnOffTime =
"SELECT `last_ign_off_time` FROM `resumption`";
+const std::string kSelectGlobalIgnOnCounter =
+ "SELECT `global_ign_on_count` FROM `resumption`";
+
+const std::string kResetGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = 0";
+
+const std::string kUpdateGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = `global_ign_on_count` + 1 ";
+
const std::string kCheckApplication =
"SELECT COUNT (`deviceID`) FROM `application` "
"WHERE `deviceID` = ? AND `appID` = ?";
@@ -445,7 +459,7 @@ const std::string kUpdateSuspendData =
"UPDATE `application` "
"SET `ign_off_count` = `ign_off_count` + 1";
-const std::string KUpdateLastIgnOffTime =
+const std::string kUpdateLastIgnOffTime =
"UPDATE `resumption` "
"SET `last_ign_off_time` = ?";
@@ -477,8 +491,8 @@ const std::string kDeleteApplicationSubMenuArray =
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
-const std::string kDeleteApplicationSubscribtionsArray =
- "DELETE FROM `applicationSubscribtionsArray` "
+const std::string kDeleteApplicationSubscriptionsArray =
+ "DELETE FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
@@ -713,7 +727,7 @@ const std::string kInsertVrCommand =
"(?, ?, ?);";
const std::string kInsertSubscriptions =
- "INSERT INTO `applicationSubscribtionsArray` "
+ "INSERT INTO `applicationSubscriptionsArray` "
"(`idApplication`, `vehicleValue`, `ButtonNameValue`) "
"VALUES "
"(?, ?, ?);";
@@ -851,14 +865,14 @@ const std::string kSelectCommands =
const std::string kSelectCountSubscriptions =
"SELECT COUNT (`idApplication`) "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
const std::string kSelectSubscriptions =
"SELECT `vehicleValue`, `ButtonNameValue` "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
new file mode 100644
index 0000000000..0ccdf8b758
--- /dev/null
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -0,0 +1,426 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/rpc_handler_impl.h"
+
+namespace application_manager {
+namespace rpc_handler {
+
+CREATE_LOGGERPTR_LOCAL(logger_, "RPCHandlerImpl")
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+
+RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager)
+ : app_manager_(app_manager)
+ , messages_from_mobile_("AM FromMobile", this)
+ , messages_from_hmi_("AM FromHMI", this)
+ , hmi_so_factory_(hmi_apis::HMI_API())
+ , mobile_so_factory_(mobile_apis::MOBILE_API())
+#ifdef TELEMETRY_MONITOR
+ , metric_observer_(NULL)
+#endif // TELEMETRY_MONITOR
+{
+}
+
+RPCHandlerImpl::~RPCHandlerImpl() {}
+
+void RPCHandlerImpl::ProcessMessageFromMobile(
+ const std::shared_ptr<Message> message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+#ifdef TELEMETRY_MONITOR
+ AMTelemetryObserver::MessageMetricSharedPtr metric(
+ new AMTelemetryObserver::MessageMetric());
+ metric->begin = date_time::getCurrentTime();
+#endif // TELEMETRY_MONITOR
+ smart_objects::SmartObjectSPtr so_from_mobile =
+ std::make_shared<smart_objects::SmartObject>();
+
+ DCHECK_OR_RETURN_VOID(so_from_mobile);
+ if (!so_from_mobile) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+#ifdef TELEMETRY_MONITOR
+ metric->message = so_from_mobile;
+#endif // TELEMETRY_MONITOR
+
+ if (!app_manager_.GetRPCService().ManageMobileCommand(
+ so_from_mobile, commands::Command::SOURCE_MOBILE)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+#ifdef TELEMETRY_MONITOR
+ metric->end = date_time::getCurrentTime();
+ if (metric_observer_) {
+ metric_observer_->OnMessage(metric);
+ }
+#endif // TELEMETRY_MONITOR
+}
+
+void RPCHandlerImpl::ProcessMessageFromHMI(
+ const std::shared_ptr<Message> message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr smart_object =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!smart_object) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ if (!ConvertMessageToSO(*message, *smart_object)) {
+ if (application_manager::MessageType::kResponse ==
+ (*smart_object)[strings::params][strings::message_type].asInt()) {
+ (*smart_object).erase(strings::msg_params);
+ (*smart_object)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ (*smart_object)[strings::msg_params][strings::info] =
+ std::string("Invalid message received from vehicle");
+ } else {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "Converted message, trying to create hmi command");
+ if (!app_manager_.GetRPCService().ManageHMICommand(smart_object)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+}
+void RPCHandlerImpl::Handle(const impl::MessageFromMobile message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+ if (app_manager_.is_stopping()) {
+ LOG4CXX_INFO(logger_, "Application manager is stopping");
+ return;
+ }
+
+ ProcessMessageFromMobile(message);
+}
+
+void RPCHandlerImpl::Handle(const impl::MessageFromHmi message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+ ProcessMessageFromHMI(message);
+}
+
+void RPCHandlerImpl::OnMessageReceived(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ std::shared_ptr<Message> outgoing_message = ConvertRawMsgToMessage(message);
+
+ if (outgoing_message) {
+ LOG4CXX_DEBUG(logger_, "Posting new Message");
+ messages_from_mobile_.PostMessage(
+ impl::MessageFromMobile(outgoing_message));
+ }
+}
+
+void RPCHandlerImpl::OnMobileMessageSent(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void RPCHandlerImpl::OnMessageReceived(
+ hmi_message_handler::MessageSharedPointer message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
+}
+
+void RPCHandlerImpl::OnErrorSending(
+ hmi_message_handler::MessageSharedPointer message) {
+ return;
+}
+
+#ifdef TELEMETRY_MONITOR
+void RPCHandlerImpl::SetTelemetryObserver(AMTelemetryObserver* observer) {
+ metric_observer_ = observer;
+}
+
+#endif // TELEMETRY_MONITOR
+
+void RPCHandlerImpl::GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version) {
+ if (output.keyExists(
+ ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS) &&
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ .keyExists(strings::sync_msg_version)) {
+ // SyncMsgVersion exists, check if it is valid.
+ auto sync_msg_version =
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ [strings::sync_msg_version];
+ uint16_t major = 0;
+ uint16_t minor = 0;
+ uint16_t patch = 0;
+ if (sync_msg_version.keyExists(strings::major_version)) {
+ major = sync_msg_version[strings::major_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::minor_version)) {
+ minor = sync_msg_version[strings::minor_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::patch_version)) {
+ patch = sync_msg_version[strings::patch_version].asUInt();
+ }
+ utils::SemanticVersion temp_version(major, minor, patch);
+ if (temp_version.isValid()) {
+ utils::SemanticVersion ver_4_5(4, 5, 0);
+ message_version = (temp_version > ver_4_5) ? temp_version : ver_4_5;
+ }
+ }
+}
+
+bool RPCHandlerImpl::ConvertMessageToSO(
+ const Message& message,
+ ns_smart_device_link::ns_smart_objects::SmartObject& output) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "\t\t\tMessage to convert: protocol "
+ << message.protocol_version() << "; json "
+ << message.json_message());
+
+ switch (message.protocol_version()) {
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: {
+ const bool conversion_result =
+ formatters::CFormatterJsonSDLRPCv2::fromString(
+ message.json_message(),
+ output,
+ message.function_id(),
+ message.type(),
+ message.correlation_id());
+
+ rpc::ValidationReport report("RPC");
+
+ // Attach RPC version to SmartObject if it does not exist yet.
+ auto app_ptr = app_manager_.application(message.connection_key());
+ utils::SemanticVersion msg_version(0, 0, 0);
+ if (app_ptr) {
+ msg_version = app_ptr->msg_version();
+ } else if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
+ static_cast<mobile_apis::FunctionID::eType>(
+ output[strings::params][strings::function_id].asInt())) {
+ GetMessageVersion(output, msg_version);
+ }
+
+ if (!conversion_result ||
+ !mobile_so_factory().attachSchema(output, true, msg_version) ||
+ ((output.validate(&report, msg_version) !=
+ smart_objects::errors::OK))) {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse string to smart object with API version "
+ << msg_version.toString() << " : "
+ << message.json_message());
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(),
+ message.function_id(),
+ message.correlation_id(),
+ mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] =
+ rpc::PrettyFormat(report);
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Convertion result for sdl object is true function_id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+
+ output[strings::params][strings::connection_key] =
+ message.connection_key();
+ output[strings::params][strings::protocol_version] =
+ message.protocol_version();
+ if (message.binary_data()) {
+ if (message.payload_size() < message.data_size()) {
+ LOG4CXX_ERROR(logger_,
+ "Incomplete binary"
+ << " binary size should be " << message.data_size()
+ << " payload data size is "
+ << message.payload_size());
+ std::shared_ptr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(),
+ message.function_id(),
+ message.correlation_id(),
+ mobile_apis::Result::INVALID_DATA));
+ app_manager_.GetRPCService().ManageMobileCommand(
+ response, commands::Command::SOURCE_SDL);
+ return false;
+ }
+ output[strings::params][strings::binary_data] =
+ *(message.binary_data());
+ }
+ break;
+ }
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
+#ifdef ENABLE_LOG
+ int32_t result =
+#endif
+ formatters::FormatterJsonRpc::FromString<
+ hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(message.json_message(), output);
+ LOG4CXX_DEBUG(logger_,
+ "Convertion result: "
+ << result << " function id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ if (!hmi_so_factory().attachSchema(output, false)) {
+ LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
+ return false;
+ }
+
+ rpc::ValidationReport report("RPC");
+
+ if (output.validate(&report) != smart_objects::errors::OK) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect parameter from HMI"
+ << rpc::PrettyFormat(report));
+
+ output.erase(strings::msg_params);
+ output[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
+ return false;
+ }
+ break;
+ }
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: {
+ static ns_smart_device_link_rpc::V1::v4_protocol_v1_2_no_extra v1_shema;
+
+ if (message.function_id() == 0 || message.type() == kUnknownType) {
+ LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
+
+ int32_t conversation_result =
+ formatters::CFormatterJsonSDLRPCv1::fromString<
+ ns_smart_device_link_rpc::V1::FunctionID::eType,
+ ns_smart_device_link_rpc::V1::messageType::eType>(
+ message.json_message(), output);
+
+ if (formatters::CFormatterJsonSDLRPCv1::kSuccess ==
+ conversation_result) {
+ smart_objects::SmartObject params = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+
+ output[strings::params][strings::message_type] =
+ ns_smart_device_link_rpc::V1::messageType::response;
+ output[strings::params][strings::connection_key] =
+ message.connection_key();
+
+ output[strings::msg_params] = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ output[strings::msg_params][strings::success] = false;
+ output[strings::msg_params][strings::result_code] =
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION;
+
+ smart_objects::SmartObjectSPtr msg_to_send =
+ std::make_shared<smart_objects::SmartObject>(output);
+ v1_shema.attachSchema(*msg_to_send, false);
+ app_manager_.GetRPCService().SendMessageToMobile(msg_to_send);
+ return false;
+ }
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_,
+ "Application used unsupported protocol :"
+ << message.protocol_version() << ".");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Successfully parsed message into smart object");
+ return true;
+}
+
+std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
+ const protocol_handler::RawMessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(message);
+ std::shared_ptr<Message> outgoing_message;
+
+ LOG4CXX_DEBUG(logger_, "Service type." << message->service_type());
+ if (message->service_type() != protocol_handler::kRpc &&
+ message->service_type() != protocol_handler::kBulk) {
+ // skip this message, not under handling of ApplicationManager
+ LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
+ return outgoing_message;
+ }
+
+ Message* convertion_result =
+ MobileMessageHandler::HandleIncomingMessageProtocol(message);
+
+ if (convertion_result) {
+ outgoing_message = std::shared_ptr<Message>(convertion_result);
+ } else {
+ LOG4CXX_ERROR(logger_, "Received invalid message");
+ }
+ return outgoing_message;
+}
+
+hmi_apis::HMI_API& RPCHandlerImpl::hmi_so_factory() {
+ return hmi_so_factory_;
+}
+
+mobile_apis::MOBILE_API& RPCHandlerImpl::mobile_so_factory() {
+ return mobile_so_factory_;
+}
+}
+}
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
new file mode 100644
index 0000000000..7a68ae5779
--- /dev/null
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -0,0 +1,629 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/rpc_service_impl.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+CREATE_LOGGERPTR_LOCAL(logger_, "RPCServiceImpl")
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
+
+RPCServiceImpl::RPCServiceImpl(
+ ApplicationManager& app_manager,
+ request_controller::RequestController& request_ctrl,
+ protocol_handler::ProtocolHandler* protocol_handler,
+ hmi_message_handler::HMIMessageHandler* hmi_handler,
+ CommandHolder& commands_holder)
+ : app_manager_(app_manager)
+ , request_ctrl_(request_ctrl)
+ , protocol_handler_(protocol_handler)
+ , hmi_handler_(hmi_handler)
+ , commands_holder_(commands_holder)
+ , messages_to_mobile_("AM ToMobile", this)
+ , messages_to_hmi_("AM ToHMI", this)
+ , hmi_so_factory_(hmi_apis::HMI_API())
+ , mobile_so_factory_(mobile_apis::MOBILE_API()) {}
+
+RPCServiceImpl::~RPCServiceImpl() {}
+
+bool RPCServiceImpl::ManageMobileCommand(
+ const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ return false;
+ }
+
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
+
+ MessageHelper::PrintSmartObject(*message);
+
+ const uint32_t connection_key = static_cast<uint32_t>(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ auto app_ptr = app_manager_.application(connection_key);
+ if (app_ptr && app_manager_.IsAppInReconnectMode(app_ptr->policy_app_id())) {
+ commands_holder_.Suspend(
+ app_ptr, CommandHolder::CommandType::kMobileCommand, message);
+ return true;
+ }
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ // Notifications from HMI have no such parameter
+ uint32_t correlation_id =
+ (*message)[strings::params].keyExists(strings::correlation_id)
+ ? (*message)[strings::params][strings::correlation_id].asUInt()
+ : 0;
+
+ int32_t protocol_type =
+ (*message)[strings::params][strings::protocol_type].asInt();
+
+ ApplicationSharedPtr app;
+ if (((mobile_apis::FunctionID::RegisterAppInterfaceID != function_id) &&
+ (protocol_type == commands::CommandImpl::mobile_protocol_type_)) &&
+ (mobile_apis::FunctionID::UnregisterAppInterfaceID != function_id)) {
+ app = app_manager_.application(connection_key);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "RET APPLICATION_NOT_REGISTERED");
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+
+ SendMessageToMobile(response);
+ return false;
+ }
+
+ // Message for "CheckPermission" must be with attached schema
+ mobile_so_factory().attachSchema(*message, false);
+ }
+
+ auto plugin =
+ app_manager_.GetPluginManager().FindPluginToProcess(function_id, source);
+ if (!plugin) {
+ LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error());
+ return false;
+ }
+ application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();
+ auto command = factory.CreateCommand(message, source);
+
+ if (!command) {
+ LOG4CXX_WARN(logger_, "Failed to create mobile command from smart object");
+ return false;
+ }
+
+ int32_t message_type =
+ (*message)[strings::params][strings::message_type].asInt();
+ if (message_type == mobile_apis::messageType::response) {
+ if (command->Init()) {
+ command->Run();
+ command->CleanUp();
+ }
+ return true;
+ }
+ if (message_type == mobile_apis::messageType::notification) {
+ request_ctrl_.addNotification(command);
+ if (command->Init()) {
+ command->Run();
+ if (command->CleanUp()) {
+ request_ctrl_.removeNotification(command.get());
+ }
+ // If CleanUp returned false notification should remove it self.
+ }
+ return true;
+ }
+
+ if (message_type == mobile_apis::messageType::request) {
+ // commands will be launched from requesr_ctrl
+ mobile_apis::HMILevel::eType app_hmi_level =
+ mobile_apis::HMILevel::INVALID_ENUM;
+ if (app) {
+ app_hmi_level = app->hmi_level();
+ }
+
+ // commands will be launched from request_ctrl
+
+ const request_controller::RequestController::TResult result =
+ request_ctrl_.addMobileRequest(command, app_hmi_level);
+
+ if (result == request_controller::RequestController::SUCCESS) {
+ LOG4CXX_DEBUG(logger_, "Perform request");
+ } else if (result == request_controller::RequestController::
+ TOO_MANY_PENDING_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable top perform request: "
+ << "TOO_MANY_PENDING_REQUESTS");
+
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(
+ mobile_apis::Result::TOO_MANY_PENDING_REQUESTS));
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+
+ SendMessageToMobile(response);
+ return false;
+ } else if (result ==
+ request_controller::RequestController::TOO_MANY_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable to perform request: "
+ << "TOO_MANY_REQUESTS");
+
+ ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS),
+ commands::Command::SOURCE_SDL);
+
+ app_manager_.UnregisterApplication(
+ connection_key,
+ mobile_apis::Result::TOO_MANY_PENDING_REQUESTS,
+ false);
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+ return false;
+ } else if (result == request_controller::RequestController::
+ NONE_HMI_LEVEL_MANY_REQUESTS) {
+ LOG4CXX_ERROR(logger_,
+ "RET Unable to perform request: "
+ << "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
+
+ ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL),
+ commands::Command::SOURCE_SDL);
+
+ ApplicationSharedPtr app_ptr = app_manager_.application(connection_key);
+ if (app_ptr) {
+ app_ptr->usage_report().RecordRemovalsForBadBehavior();
+ }
+ app_manager_.UnregisterApplication(
+ connection_key, mobile_apis::Result::INVALID_ENUM, false);
+ return false;
+ } else {
+ LOG4CXX_ERROR(logger_, "RET Unable to perform request: Unknown case");
+ return false;
+ }
+ return true;
+ }
+
+ LOG4CXX_ERROR(logger_, "RET UNKNOWN MESSAGE TYPE " << message_type);
+ return false;
+}
+
+bool RPCServiceImpl::ManageHMICommand(
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ return false;
+ }
+
+ if (app_manager_.IsLowVoltage()) {
+ LOG4CXX_WARN(logger_, "Low Voltage is active");
+ return false;
+ }
+
+ MessageHelper::PrintSmartObject(*message);
+ const int32_t function_id =
+ (*(message.get()))[strings::params][strings::function_id].asInt();
+ auto plugin = app_manager_.GetPluginManager().FindPluginToProcess(
+ function_id, commands::Command::SOURCE_HMI);
+ if (!plugin) {
+ LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error());
+ return false;
+ }
+
+ application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();
+ auto command = factory.CreateCommand(message, commands::Command::SOURCE_HMI);
+
+ if (!command) {
+ LOG4CXX_WARN(logger_, "Failed to create command from smart object");
+ return false;
+ }
+
+ if ((*message).keyExists(strings::msg_params) &&
+ (*message)[strings::msg_params].keyExists(strings::app_id)) {
+ const auto connection_key =
+ (*message)[strings::msg_params][strings::app_id].asUInt();
+
+ auto app = app_manager_.application(static_cast<uint32_t>(connection_key));
+ if (app && app_manager_.IsAppInReconnectMode(app->policy_app_id())) {
+ commands_holder_.Suspend(
+ app, CommandHolder::CommandType::kHmiCommand, message);
+ return true;
+ }
+ }
+
+ int32_t message_type =
+ (*(message.get()))[strings::params][strings::message_type].asInt();
+
+ if (kRequest == message_type) {
+ LOG4CXX_DEBUG(logger_, "ManageHMICommand");
+ request_ctrl_.addHMIRequest(command);
+ }
+
+ if (command->Init()) {
+ command->Run();
+ if (kResponse == message_type) {
+ const uint32_t correlation_id =
+ (*(message.get()))[strings::params][strings::correlation_id].asUInt();
+ const int32_t function_id =
+ (*(message.get()))[strings::params][strings::function_id].asInt();
+ request_ctrl_.OnHMIResponse(correlation_id, function_id);
+ }
+ return true;
+ }
+ return false;
+}
+
+void RPCServiceImpl::Handle(const impl::MessageToHmi message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!hmi_handler_) {
+ LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
+ return;
+ }
+
+ hmi_handler_->SendMessageToHMI(message);
+ LOG4CXX_INFO(logger_, "Message for HMI given away");
+}
+
+void RPCServiceImpl::Handle(const impl::MessageToMobile message) {
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_,
+ "Protocol Handler is not set; cannot send message to mobile.");
+ return;
+ }
+
+ std::shared_ptr<protocol_handler::RawMessage> rawMessage(
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message));
+
+ if (!rawMessage) {
+ LOG4CXX_ERROR(logger_, "Failed to create raw message.");
+ return;
+ }
+
+ bool is_final = message.is_final;
+ bool close_session = false;
+ if (is_final) {
+ if (1 < app_manager_.connection_handler().GetConnectionSessionsCount(
+ message->connection_key())) {
+ is_final = false;
+ close_session = true;
+ }
+ }
+
+ protocol_handler_->SendMessageToMobileApp(rawMessage, is_final);
+ LOG4CXX_INFO(logger_, "Message for mobile given away");
+
+ if (close_session) {
+ app_manager_.connection_handler().CloseSession(message->connection_key(),
+ connection_handler::kCommon);
+ }
+}
+
+void RPCServiceImpl::SendMessageToMobile(
+ const application_manager::commands::MessageSharedPtr message,
+ bool final_message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_, "No Protocol Handler set");
+ return;
+ }
+
+ ApplicationSharedPtr app = app_manager_.application(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ const bool is_result_code_exists =
+ (*message)[strings::msg_params].keyExists(strings::result_code);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application associated with connection key");
+ if (is_result_code_exists &&
+ ((*message)[strings::msg_params][strings::result_code] ==
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION)) {
+ (*message)[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1;
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ app_manager_.SupportedSDLVersion();
+ }
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ app->protocol_version();
+ }
+
+ if (app && is_result_code_exists &&
+ (*message)[strings::msg_params][strings::result_code] ==
+ mobile_apis::Result::OUT_OF_MEMORY) {
+ app->usage_report().RecordRejectionsSyncOutOfMemory();
+ }
+
+ mobile_so_factory().attachSchema(*message, false);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+ // Messages to mobile are not yet prioritized so use default priority value
+ std::shared_ptr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+ if (!ConvertSOtoMessage((*message), (*message_to_send))) {
+ LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
+ return;
+ }
+
+ smart_objects::SmartObject& msg_to_mobile = *message;
+ // If correlation_id is not present, it is from-HMI message which should be
+ // checked against policy permissions
+ if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
+ request_ctrl_.OnMobileResponse(
+ msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
+ msg_to_mobile[strings::params][strings::connection_key].asUInt(),
+ msg_to_mobile[strings::params][strings::function_id].asInt());
+ } else if (app) {
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt());
+ RPCParams params;
+
+ const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ smart_objects::SmartMap::iterator iter = s_map.map_begin();
+ smart_objects::SmartMap::iterator iter_end = s_map.map_end();
+
+ for (; iter != iter_end; ++iter) {
+ if (true == iter->second.asBool()) {
+ LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
+ }
+ }
+ }
+ const std::string string_functionID =
+ MessageHelper::StringifiedFunctionID(function_id);
+ const mobile_apis::Result::eType check_result =
+ app_manager_.CheckPolicyPermissions(app, string_functionID, params);
+ if (mobile_apis::Result::SUCCESS != check_result) {
+ LOG4CXX_WARN(logger_,
+ "Function \"" << string_functionID << "\" (#" << function_id
+ << ") not allowed by policy");
+ return;
+ }
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
+ mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message)[strings::msg_params][strings::request_type].asUInt());
+ if (mobile_apis::RequestType::PROPRIETARY == request_type ||
+ mobile_apis::RequestType::HTTP == request_type) {
+ app_manager_.GetPolicyHandler().OnUpdateRequestSentToMobile();
+ }
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
+ }
+
+ if (message_to_send->binary_data()) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Binary data size: " << message_to_send->binary_data()->size());
+ }
+ messages_to_mobile_.PostMessage(
+ impl::MessageToMobile(message_to_send, final_message));
+}
+
+void RPCServiceImpl::SendMessageToHMI(
+ const commands::MessageSharedPtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!hmi_handler_) {
+ LOG4CXX_WARN(logger_, "No HMI Handler set");
+ return;
+ }
+
+ // SmartObject |message| has no way to declare priority for now
+ std::shared_ptr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+ if (!message_to_send) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ hmi_so_factory().attachSchema(*message, false);
+ LOG4CXX_INFO(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+ if (!ConvertSOtoMessage(*message, *message_to_send)) {
+ LOG4CXX_WARN(logger_,
+ "Cannot send message to HMI: failed to create string");
+ return;
+ }
+
+ messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
+}
+
+void RPCServiceImpl::set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) {
+ protocol_handler_ = handler;
+}
+
+void RPCServiceImpl::set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) {
+ hmi_handler_ = handler;
+}
+
+bool RPCServiceImpl::ConvertSOtoMessage(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& message,
+ Message& output) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (smart_objects::SmartType_Null == message.getType() ||
+ smart_objects::SmartType_Invalid == message.getType()) {
+ LOG4CXX_WARN(logger_, "Invalid smart object received.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Message with protocol: " << message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt());
+
+ std::string output_string;
+ const int64_t protocol_type = message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt();
+ const int64_t protocol_version = message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_PROTOCOL_VERSION)
+ .asInt();
+ switch (protocol_type) {
+ case 0: {
+ if (protocol_version == 1) {
+ if (!formatters::CFormatterJsonSDLRPCv1::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
+ } else {
+ if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ protocol_version));
+ }
+
+ break;
+ }
+ case 1: {
+ if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ break;
+ }
+ default:
+ NOTREACHED();
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Convertion result: " << output_string);
+
+ output.set_connection_key(message.getElement(jhs::S_PARAMS)
+ .getElement(strings::connection_key)
+ .asInt());
+
+ output.set_function_id(
+ message.getElement(jhs::S_PARAMS).getElement(jhs::S_FUNCTION_ID).asInt());
+
+ output.set_correlation_id(message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_CORRELATION_ID)
+ .asInt());
+ output.set_message_type(
+ static_cast<MessageType>(message.getElement(jhs::S_PARAMS)
+ .getElement(jhs::S_MESSAGE_TYPE)
+ .asInt()));
+
+ // Currently formatter creates JSON = 3 bytes for empty SmartObject.
+ // workaround for notification. JSON must be empty
+ if (mobile_apis::FunctionID::OnAudioPassThruID !=
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::function_id)
+ .asInt()) {
+ output.set_json_message(output_string);
+ }
+
+ if (message.getElement(jhs::S_PARAMS).keyExists(strings::binary_data)) {
+ const application_manager::BinaryData binaryData(
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::binary_data)
+ .asBinary());
+
+ output.set_binary_data(&binaryData);
+ }
+
+ LOG4CXX_DEBUG(logger_, "Successfully parsed smart object into message");
+ return true;
+}
+
+hmi_apis::HMI_API& RPCServiceImpl::hmi_so_factory() {
+ return hmi_so_factory_;
+}
+
+mobile_apis::MOBILE_API& RPCServiceImpl::mobile_so_factory() {
+ return mobile_so_factory_;
+}
+
+} // namespace rpc_service
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index a470bba4dc..ff9ebb6208 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -18,6 +18,7 @@ const char* msg_params = "msg_params";
const char* method_name = "methodName";
const char* info = "info";
const char* app_id = "appID";
+const char* full_app_id = "fullAppID";
const char* bundle_id = "appBundleID";
const char* app_info = "appInfo";
const char* app_launch = "app_launch";
@@ -57,6 +58,7 @@ const char* main_field_1 = "mainField1";
const char* main_field_2 = "mainField2";
const char* main_field_3 = "mainField3";
const char* main_field_4 = "mainField4";
+const char* metadata_tags = "metadataTags";
const char* eta = "eta";
const char* time_to_destination = "timeToDestination";
const char* total_distance = "totalDistance";
@@ -123,10 +125,12 @@ const char* hours = "hours";
const char* minutes = "minutes";
const char* seconds = "seconds";
const char* update_mode = "updateMode";
+const char* audioStreamingIndicator = "audioStreamingIndicator";
const char* trigger_source = "triggerSource";
const char* hmi_level = "hmiLevel";
const char* activate_app_hmi_level = "level";
const char* audio_streaming_state = "audioStreamingState";
+const char* video_streaming_state = "videoStreamingState";
const char* system_context = "systemContext";
const char* speech_capabilities = "speechCapabilities";
const char* vr_capabilities = "vrCapabilities";
@@ -134,17 +138,37 @@ const char* audio_pass_thru_capabilities = "audioPassThruCapabilities";
const char* pcm_stream_capabilities = "pcmStreamCapabilities";
const char* audio_pass_thru_icon = "audioPassThruIcon";
const char* way_points = "wayPoints";
+const char* system_capability = "systemCapability";
+const char* system_capability_type = "systemCapabilityType";
+const char* system_capabilities = "systemCapabilities";
+const char* navigation_capability = "navigationCapability";
+const char* phone_capability = "phoneCapability";
+const char* video_streaming_capability = "videoStreamingCapability";
+const char* rc_capability = "remoteControlCapability";
+const char* day_color_scheme = "dayColorScheme";
+const char* night_color_scheme = "nightColorScheme";
+const char* primary_color = "primaryColor";
+const char* secondary_color = "secondaryColor";
+const char* background_color = "backgroundColor";
+const char* red = "red";
+const char* green = "green";
+const char* blue = "blue";
+const char* display_layout = "displayLayout";
+const char* icon_resumed = "iconResumed";
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
const char* file_type = "fileType";
const char* file_size = "fileSize";
+const char* crc32_check_sum = "crc";
const char* request_type = "requestType";
+const char* request_subtype = "requestSubType";
const char* persistent_file = "persistentFile";
const char* file_data = "fileData";
const char* space_available = "spaceAvailable";
const char* image_type = "imageType";
+const char* is_template = "isTemplate";
const char* image = "image";
const char* type = "type";
const char* system_file = "systemFile";
@@ -160,6 +184,7 @@ const char* did_location = "didLocation";
const char* app_list = "appList";
const char* device_list = "deviceList";
const char* device_info = "deviceInfo";
+const char* secondary_device_info = "secondaryDeviceInfo";
const char* name = "name";
const char* id = "id";
const char* isSDLAllowed = "isSDLAllowed";
@@ -194,12 +219,15 @@ const char* rpm = "rpm";
const char* fuel_level = "fuelLevel";
const char* fuel_level_state = "fuelLevel_State";
const char* instant_fuel_consumption = "instantFuelConsumption";
+const char* fuel_range = "fuelRange";
const char* external_temp = "externalTemperature";
+const char* turn_signal = "turnSignal";
const char* vin = "vin";
const char* prndl = "prndl";
const char* tire_pressure = "tirePressure";
const char* odometer = "odometer";
const char* belt_status = "beltStatus";
+const char* electronic_park_brake_status = "electronicParkBrakeStatus";
const char* body_information = "bodyInformation";
const char* device_status = "deviceStatus";
const char* driver_braking = "driverBraking";
@@ -225,9 +253,12 @@ const char* supported_diag_modes = "supportedDiagModes";
const char* hmi_capabilities = "hmiCapabilities";
const char* navigation = "navigation";
const char* phone_call = "phoneCall";
+const char* video_streaming = "videoStreaming";
+const char* remote_control = "remoteControl";
const char* sdl_version = "sdlVersion";
const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
+const char* engine_oil_life = "engineOilLife";
// resuming
const char* application_commands = "applicationCommands";
@@ -236,7 +267,7 @@ const char* application_choice_sets = "applicationChoiceSets";
const char* application_global_properties = "globalProperties";
const char* application_vehicle_info = "vehicleInfo";
const char* application_buttons = "buttons";
-const char* application_subscribtions = "subscribtions";
+const char* application_subscriptions = "subscriptions";
const char* application_files = "applicationFiles";
const char* application_show = "applicationShow";
const char* resumption = "resumption";
@@ -246,6 +277,7 @@ const char* last_ign_off_time = "last_ign_off_time";
const char* resume_vr_grammars = "resumeVrGrammars";
const char* ign_off_count = "ign_off_count";
+const char* global_ign_on_counter = "global_ign_on_counter";
const char* suspend_count = "suspend_count";
const char* connection_info = "connection_info";
@@ -277,6 +309,38 @@ const char* is_suscribed = "isSubscribed";
const char* message_data = "messageData";
const char* delivery_mode = "deliveryMode";
+
+const char* audio_streaming_indicator = "audioStreamingIndicator";
+
+const char* const keyboard_properties_supported = "keyboardPropertiesSupported";
+const char* const language_supported = "languageSupported";
+const char* const keyboard_layout_supported = "keyboardLayoutSupported";
+const char* const keypress_mode_supported = "keypressModeSupported";
+const char* const limited_characters_list_supported =
+ "limitedCharactersListSupported";
+const char* const auto_complete_text_supported = "autoCompleteTextSupported";
+const char* const entity_type = "entityType";
+const char* const entity_id = "entityID";
+const char* const status = "status";
+const char* const external_consent_status = "externalConsentStatus";
+const char* const consented_functions = "consentedFunctions";
+const char* const source = "source";
+const char* const config = "config";
+const char* const protocol = "protocol";
+const char* const codec = "codec";
+const char* const width = "width";
+const char* const height = "height";
+const char* const rejected_params = "rejectedParams";
+const char* const preferred_resolution = "preferredResolution";
+const char* const resolution_width = "resolutionWidth";
+const char* const resolution_height = "resolutionHeight";
+const char* const max_bitrate = "maxBitrate";
+const char* const supported_formats = "supportedFormats";
+const char* const haptic_spatial_data_supported = "hapticSpatialDataSupported";
+const char* const haptic_rect_data = "hapticRectData";
+const char* const rect = "rect";
+const char* const x = "x";
+const char* const y = "y";
} // namespace strings
namespace json {
@@ -309,7 +373,7 @@ const char* instance_follow_redirect = "InstanceFollowRedirect";
const char* charset = "charset";
const char* content_lenght = "Content_Lenght";
const char* GET = "GET";
-} // http_request
+} // namespace http_request
namespace mobile_notification {
const char* state = "state";
@@ -322,12 +386,23 @@ const char* kFull = "FULL";
const char* kLimited = "LIMITED";
const char* kBackground = "BACKGROUND";
const char* kNone = "NONE";
-}
+} // namespace hmi_levels
+
+namespace time_keys {
+const char* millisecond = "millisecond";
+const char* second = "second";
+const char* minute = "minute";
+const char* hour = "hour";
+const char* day = "day";
+const char* month = "month";
+const char* year = "year";
+} // namespace time_keys
namespace hmi_request {
const char* parent_id = "parentID";
const char* field_name = "fieldName";
const char* field_text = "fieldText";
+const char* field_types = "fieldTypes";
const char* alert_strings = "alertStrings";
const char* duration = "duration";
const char* soft_buttons = "softButtons";
@@ -383,6 +458,7 @@ const char* dtc = "dtc";
const char* ecu_header = "ecuHeader";
const char* image_capabilities = "imageCapabilities";
const char* display_type = "displayType";
+const char* display_name = "displayName";
const char* text_fields = "textFields";
const char* media_clock_formats = "mediaClockFormats";
const char* graphic_supported = "graphicSupported";
@@ -393,7 +469,7 @@ const char* num_custom_presets_available = "numCustomPresetsAvailable";
const char* urls = "urls";
const char* policy_app_id = "policyAppID";
const char* enabled = "enabled";
-
+const char* system_time = "systemTime";
} // namespace hmi_response
namespace hmi_notification {
@@ -408,7 +484,6 @@ const char* policyfile = "policyfile";
const char* is_active = "isActive";
const char* is_deactivated = "isDeactivated";
const char* event_name = "eventName";
-
} // namespace hmi_notification
} // namespace application_manager
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 06a7e508e5..3d44709657 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -31,24 +31,29 @@
*/
#include "application_manager/state_controller_impl.h"
+#include <tuple>
#include "application_manager/usage_statistics.h"
+#include "application_manager/rpc_service.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
+
#include "connection_handler/connection_handler.h"
namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "StateControllerImpl")
-bool IsStatusChanged(HmiStatePtr old_state, HmiStatePtr new_state) {
- if (old_state->hmi_level() != new_state->hmi_level() ||
- old_state->audio_streaming_state() !=
- new_state->audio_streaming_state() ||
- old_state->system_context() != new_state->system_context()) {
- return true;
- }
- return false;
+namespace {
+bool IsStateChanged(const HmiState& old_state, const HmiState& new_state) {
+ return std::make_tuple(old_state.hmi_level(),
+ old_state.audio_streaming_state(),
+ old_state.video_streaming_state(),
+ old_state.system_context()) !=
+ std::make_tuple(new_state.hmi_level(),
+ new_state.audio_streaming_state(),
+ new_state.video_streaming_state(),
+ new_state.system_context());
}
+} // unnamed namespace
StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
: EventObserver(app_mngr.event_dispatcher()), app_mngr_(app_mngr) {
@@ -64,20 +69,20 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
- DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+ DCHECK_OR_RETURN_VOID(HmiState::STATE_ID_REGULAR == state->state_id());
+
+ LOG4CXX_DEBUG(logger_, "Set regular state " << *state);
if (state->hmi_level() == mobile_apis::HMILevel::INVALID_ENUM ||
state->audio_streaming_state() ==
mobile_apis::AudioStreamingState::INVALID_ENUM ||
+ state->video_streaming_state() ==
+ mobile_apis::VideoStreamingState::INVALID_ENUM ||
state->system_context() == mobile_apis::SystemContext::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "Get invalid state");
+ LOG4CXX_ERROR(logger_, "Got invalid state");
return;
}
@@ -91,7 +96,8 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
app->SetPostponedState(state);
return;
}
- hmi_apis::Common_HMILevel::eType hmi_level =
+ LOG4CXX_DEBUG(logger_, "Resolved state: " << *resolved_state);
+ const hmi_apis::Common_HMILevel::eType hmi_level =
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
@@ -100,7 +106,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
if (-1 != corr_id) {
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
corr_id);
- waiting_for_activate[app->app_id()] = resolved_state;
+ waiting_for_activate_[app->app_id()] = resolved_state;
return;
}
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp");
@@ -113,20 +119,18 @@ void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_regular->system_context());
SetRegularState(app, hmi_state, send_activate_app);
}
@@ -136,19 +140,15 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::HMILevel::eType hmi_level,
const bool send_activate_app) {
using namespace mobile_apis;
- using namespace helpers;
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
const HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
+ hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
SetRegularState(app, hmi_state, send_activate_app);
}
@@ -157,37 +157,32 @@ void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool send_activate_app) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(system_context);
SetRegularState(app, hmi_state, send_activate_app);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
+ hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(prev_state
? prev_state->system_context()
: mobile_apis::SystemContext::SYSCTXT_MAIN);
@@ -197,52 +192,44 @@ void StateControllerImpl::SetRegularState(
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::SystemContext::eType system_context) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(prev_regular->hmi_level());
hmi_state->set_audio_streaming_state(
CalcAudioState(app, prev_regular->hmi_level()));
+ hmi_state->set_video_streaming_state(
+ CalcVideoState(app, prev_regular->hmi_level()));
hmi_state->set_system_context(system_context);
SetRegularState(app, hmi_state, false);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(prev_state->hmi_level());
hmi_state->set_audio_streaming_state(audio_state);
+ hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_state->system_context());
SetRegularState(app, hmi_state, false);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state) {
- CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
- if (!app) {
- LOG4CXX_ERROR(logger_, "Invalid application pointer");
- return;
- }
+ DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
if (mobile_apis::HMILevel::HMI_FULL == state->hmi_level()) {
SetRegularState(app, state, true);
@@ -251,84 +238,178 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
}
}
-void StateControllerImpl::HmiLevelConflictResolver::operator()(
- ApplicationSharedPtr to_resolve) {
- using namespace mobile_apis;
+namespace {
+
+/**
+ * @brief IsStreamableHMILevel checks whether the HMI level
+ * supports audio/video streaming.
+ * @param val HMI level
+ * @return true if streamable, false otherwise
+ */
+bool IsStreamableHMILevel(mobile_apis::HMILevel::eType val) {
using namespace helpers;
+ return Compare<mobile_apis::HMILevel::eType, EQ, ONE>(
+ val, mobile_apis::HMILevel::HMI_FULL, mobile_apis::HMILevel::HMI_LIMITED);
+}
+
+/**
+ * @brief IsSameAudioAppType checks whether the both applications:
+ * 1) belongs to exact HMI type that may stream audio without
+ * 'isMediaApplication' parameter set to true ('NAVIGATION', 'COMMUNICATION')
+ * 2) belongs to other HMI types with parameter 'isMediaApplication'
+ * is set to true.
+ * 3) are not media.
+ * @param app1 1st application
+ * @param app2 2nd application
+ * @return true if audio applications have same application HMI type
+ */
+bool IsSameAudioAppType(const Application& app1, const Application& app2) {
+ const auto is_only_media_app_type = [](const Application& app) {
+ return app.is_media_application() && !app.is_navi() &&
+ !app.is_voice_communication_supported();
+ };
+
+ const bool both_navi = app1.is_navi() && app2.is_navi();
+ const bool both_vc = app1.is_voice_communication_supported() &&
+ app2.is_voice_communication_supported();
+ const bool both_media =
+ is_only_media_app_type(app1) && is_only_media_app_type(app2);
+ const bool both_other =
+ !app1.IsAudioApplication() && !app2.IsAudioApplication();
+ const bool same_app_audio_type =
+ both_navi || both_vc || both_media || both_other;
+
+ return same_app_audio_type;
+}
+} // unnamed namespace
+
+void StateControllerImpl::HmiLevelConflictResolver::operator()(
+ ApplicationSharedPtr app_to_resolve) {
+ DCHECK_OR_RETURN_VOID(app_to_resolve);
DCHECK_OR_RETURN_VOID(state_ctrl_);
- if (to_resolve == applied_)
+ DCHECK_OR_RETURN_VOID(applied_);
+ DCHECK_OR_RETURN_VOID(state_);
+
+ if (applied_ == app_to_resolve) {
+ // Same app. Nothing to resolve
return;
- HmiStatePtr cur_state = to_resolve->RegularHmiState();
-
- const bool applied_grabs_audio =
- Compare<HMILevel::eType, EQ, ONE>(
- state_->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED) &&
- applied_->IsAudioApplication();
- const bool applied_grabs_full = state_->hmi_level() == HMILevel::HMI_FULL;
- const bool to_resolve_handles_full =
- cur_state->hmi_level() == HMILevel::HMI_FULL;
- const bool to_resolve_handles_audio =
- Compare<HMILevel::eType, EQ, ONE>(
- cur_state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED) &&
- to_resolve->IsAudioApplication();
- const bool same_app_type = state_ctrl_->IsSameAppType(applied_, to_resolve);
-
- // If applied Hmi state is FULL:
- // all not audio applications will get BACKGROUND
- // all applications with same HMI type will get BACKGROUND
- // all audio applications with other HMI type(navi, vc, media) in FULL will
- // get LIMMITED HMI level
-
- // If applied Hmi state is LIMITED:
- // all applications with other HMI types will save HMI states
- // all not audio applications will save HMI states
- // all applications with same HMI type will get BACKGROUND
-
- // If applied Hmi state is BACKGROUND:
- // all applications will save HMI states
-
- HMILevel::eType result_hmi_level = cur_state->hmi_level();
- if (applied_grabs_full && to_resolve_handles_audio && !same_app_type)
- result_hmi_level = HMILevel::HMI_LIMITED;
-
- if ((applied_grabs_full && to_resolve_handles_full &&
- !to_resolve->IsAudioApplication()) ||
- (applied_grabs_audio && to_resolve_handles_audio && same_app_type))
- result_hmi_level = HMILevel::HMI_BACKGROUND;
-
- if (cur_state->hmi_level() != result_hmi_level) {
+ }
+
+ const HmiStatePtr state_to_resolve = app_to_resolve->RegularHmiState();
+ DCHECK_OR_RETURN_VOID(state_to_resolve);
+
+ // If applied HMI state is FULL:
+ // - all NOT audio/video applications becomes BACKGROUND
+ // - all audio/video applications with other app type
+ // (navi, vc, media, projection) in FULL becomes LIMMITED
+ // - all audio/video applications with same app type becomes BACKGROUND
+ //
+ // If applied HMI state is LIMITED:
+ // - all NOT audio/video applications saves their's HMI states
+ // - all applications with other app types saves their's HMI states
+ // - all audio/video applications with same app type becomes BACKGROUND
+
+ if (!IsStreamableHMILevel(state_->hmi_level())) {
+ LOG4CXX_DEBUG(logger_,
+ "Applied for app " << applied_->app_id() << " HMI level "
+ << state_->hmi_level()
+ << " is NOT streamable. Exit.");
+ return;
+ }
+
+ if (!IsStreamableHMILevel(state_to_resolve->hmi_level())) {
+ LOG4CXX_DEBUG(logger_,
+ "To resolve app " << app_to_resolve->app_id() << " HMI level "
+ << state_to_resolve->hmi_level()
+ << " is NOT streamable. Exit.");
+ return;
+ }
+
+ // Applied app constants
+ const auto applied_hmi_level = state_->hmi_level();
+
+ const bool applied_grabs_video =
+ IsStreamableHMILevel(applied_hmi_level) && applied_->IsVideoApplication();
+
+ // App to resolve constants
+ const auto to_resolve_hmi_level = state_to_resolve->hmi_level();
+
+ const bool to_resolve_grabs_audio =
+ IsStreamableHMILevel(to_resolve_hmi_level) &&
+ app_to_resolve->IsAudioApplication();
+
+ const bool to_resolve_grabs_video =
+ IsStreamableHMILevel(to_resolve_hmi_level) &&
+ app_to_resolve->IsVideoApplication();
+
+ // Compatibility constants
+ const bool same_app_audio_type =
+ IsSameAudioAppType(*applied_, *app_to_resolve);
+
+ // Result variables
+ mobile_apis::VideoStreamingState::eType result_video_state =
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ mobile_apis::AudioStreamingState::eType result_audio_state =
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+
+ if (to_resolve_grabs_audio && !same_app_audio_type) {
+ result_audio_state = mobile_apis::AudioStreamingState::AUDIBLE;
+ }
+
+ if (to_resolve_grabs_video && !applied_grabs_video) {
+ result_video_state = mobile_apis::VideoStreamingState::STREAMABLE;
+ }
+
+ mobile_apis::HMILevel::eType result_hmi_level = state_to_resolve->hmi_level();
+
+ using namespace helpers;
+ if (mobile_apis::VideoStreamingState::STREAMABLE == result_video_state ||
+ Compare<mobile_apis::AudioStreamingState::eType, EQ, ONE>(
+ result_audio_state,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::AudioStreamingState::ATTENUATED)) {
+ result_hmi_level = mobile_apis::HMILevel::HMI_LIMITED;
+ } else {
+ result_hmi_level = mobile_apis::HMILevel::HMI_BACKGROUND;
+ }
+
+ if (std::make_tuple(to_resolve_hmi_level,
+ state_to_resolve->audio_streaming_state(),
+ state_to_resolve->video_streaming_state()) !=
+ std::make_tuple(
+ result_hmi_level, result_audio_state, result_video_state)) {
LOG4CXX_DEBUG(logger_,
- "Application " << to_resolve->app_id()
- << " will change HMI level to "
- << result_hmi_level);
- state_ctrl_->SetupRegularHmiState(to_resolve,
+ "Application "
+ << app_to_resolve->app_id() << " will change state to: "
+ << "HMI level " << to_resolve_hmi_level << " --> "
+ << result_hmi_level << ", audio "
+ << state_to_resolve->audio_streaming_state() << " --> "
+ << result_audio_state << ", video "
+ << state_to_resolve->video_streaming_state() << " --> "
+ << result_video_state);
+ state_ctrl_->SetupRegularHmiState(app_to_resolve,
result_hmi_level,
- result_hmi_level == HMILevel::HMI_LIMITED
- ? AudioStreamingState::AUDIBLE
- : AudioStreamingState::NOT_AUDIBLE);
+ result_audio_state,
+ result_video_state);
} else {
LOG4CXX_DEBUG(logger_,
- "Application " << to_resolve->app_id()
- << " will not change HMI level");
+ "Application " << app_to_resolve->app_id()
+ << " will NOT change HMI level");
}
}
HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
HmiStatePtr state) const {
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "State to resolve: hmi_level "
- << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state() << ", system_context "
- << state->system_context());
+ LOG4CXX_DEBUG(logger_, "State to resolve: " << *state);
HmiStatePtr available_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN(available_state, HmiStatePtr());
available_state->set_hmi_level(state->hmi_level());
available_state->set_audio_streaming_state(state->audio_streaming_state());
+ available_state->set_video_streaming_state(state->video_streaming_state());
available_state->set_system_context(state->system_context());
if (app->is_resuming()) {
@@ -337,6 +418,8 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
available_state->set_hmi_level(available_level);
available_state->set_audio_streaming_state(
CalcAudioState(app, available_level));
+ available_state->set_video_streaming_state(
+ CalcVideoState(app, available_level));
}
return IsStateAvailable(app, available_state) ? available_state
: HmiStatePtr();
@@ -345,11 +428,8 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
HmiStatePtr state) const {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace helpers;
using namespace mobile_apis;
- if (!app->is_resuming() ||
- !Compare<HMILevel::eType, EQ, ONE>(
- state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ if (!app->is_resuming() || !IsStreamableHMILevel(state->hmi_level())) {
LOG4CXX_DEBUG(logger_, "Application is not in resuming mode.");
return true;
}
@@ -363,9 +443,9 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
}
if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) &&
- app->is_navi()) {
+ (app->is_navi() || app->mobile_projection_enabled())) {
LOG4CXX_DEBUG(logger_,
- "Resumption for navi app is not allowed. "
+ "Resumption for navi or projection app is not allowed. "
<< "EMBEDDED_NAVI event is active");
return false;
}
@@ -375,27 +455,27 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
ApplicationSharedPtr app, mobile_apis::HMILevel::eType hmi_level) const {
- using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::HMILevel::eType result = hmi_level;
- if (!Compare<HMILevel::eType, EQ, ONE>(
- hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ LOG4CXX_DEBUG(logger_, "HMI Level: " << hmi_level);
+
+ if (!IsStreamableHMILevel(hmi_level)) {
return result;
}
const bool is_audio_app = app->IsAudioApplication();
const bool does_audio_app_with_same_type_exist =
app_mngr_.IsAppTypeExistsInFullOrLimited(app);
- if (HMILevel::HMI_LIMITED == hmi_level) {
+
+ if (mobile_apis::HMILevel::HMI_LIMITED == hmi_level) {
if (!is_audio_app || does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
}
return result;
}
- const bool is_active_app_exist = app_mngr_.active_application();
+ const bool is_active_app_exist = (bool)app_mngr_.active_application();
if (is_audio_app) {
if (does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
@@ -424,13 +504,8 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
bool StateControllerImpl::IsStateAvailable(ApplicationSharedPtr app,
HmiStatePtr state) const {
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "Checking state: hmi_level "
- << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state() << ", system_context "
- << state->system_context());
+ LOG4CXX_DEBUG(logger_, "Checking state: " << *state);
if (app->is_resuming()) {
return IsStateAvailableForResumption(app, state);
@@ -454,11 +529,8 @@ bool StateControllerImpl::IsStateAvailableForResumption(
ApplicationSharedPtr app, HmiStatePtr state) const {
LOG4CXX_AUTO_TRACE(logger_);
using namespace mobile_apis;
- using namespace helpers;
- if (!app->is_resuming() ||
- !Compare<HMILevel::eType, EQ, ONE>(
- state->hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
+ if (!app->is_resuming() || !IsStreamableHMILevel(state->hmi_level())) {
LOG4CXX_DEBUG(logger_,
"Application is not in resuming mode."
<< " Requested state is available");
@@ -492,20 +564,17 @@ bool StateControllerImpl::IsStateAvailableForResumption(
void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
HmiStatePtr state) {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(state);
- LOG4CXX_DEBUG(logger_,
- "hmi_level " << state->hmi_level() << ", audio_state "
- << state->audio_streaming_state()
- << ", system_context " << state->system_context());
+ LOG4CXX_DEBUG(logger_, "Setup regular state: " << *state);
HmiStatePtr curr_state = app->CurrentHmiState();
HmiStatePtr old_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(old_state);
old_state->set_hmi_level(curr_state->hmi_level());
old_state->set_audio_streaming_state(curr_state->audio_streaming_state());
+ old_state->set_video_streaming_state(curr_state->video_streaming_state());
old_state->set_system_context(curr_state->system_context());
app->SetRegularState(state);
@@ -524,19 +593,18 @@ void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
void StateControllerImpl::SetupRegularHmiState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const mobile_apis::AudioStreamingState::eType audio_state) {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- using helpers::Compare;
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr new_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(new_state);
new_state->set_hmi_level(hmi_level);
new_state->set_audio_streaming_state(audio_state);
+ new_state->set_video_streaming_state(video_state);
new_state->set_system_context(prev_state->system_context());
SetupRegularHmiState(app, new_state);
}
@@ -547,21 +615,12 @@ void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app,
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR);
+ LOG4CXX_DEBUG(logger_,
+ "Applying to app " << app->app_id() << " state " << *state);
SetupRegularHmiState(app, state);
- ForEachApplication<HmiLevelConflictResolver>(
- HmiLevelConflictResolver(app, state, this));
-}
-
-bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1,
- ApplicationConstSharedPtr app2) {
- const bool both_media =
- app1->is_media_application() && app2->is_media_application();
- const bool both_navi = app1->is_navi() && app2->is_navi();
- const bool both_vc = app1->is_voice_communication_supported() &&
- app2->is_voice_communication_supported();
- const bool both_simple =
- !app1->IsAudioApplication() && !app2->IsAudioApplication();
- return both_simple || both_media || both_navi || both_vc;
+ LOG4CXX_DEBUG(logger_,
+ "Resolving HMI level conflicts for app " << app->app_id());
+ ForEachApplication(HmiLevelConflictResolver(app, state, this));
}
void StateControllerImpl::on_event(const event_engine::Event& event) {
@@ -608,7 +667,7 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
const uint32_t id =
message[strings::msg_params][hmi_notification::event_name].asUInt();
// TODO(AOleynik): Add verification/conversion check here
- Common_EventTypes::eType state_id =
+ const Common_EventTypes::eType state_id =
static_cast<Common_EventTypes::eType>(id);
if (is_active) {
if (Common_EventTypes::AUDIO_SOURCE == state_id) {
@@ -653,6 +712,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
break;
}
}
+
+ LOG4CXX_WARN(logger_,
+ "Couldn't recognize state id (val='" << state_id << "')");
break;
}
default:
@@ -667,17 +729,9 @@ void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app,
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(old_state);
DCHECK_OR_RETURN_VOID(new_state);
- LOG4CXX_DEBUG(logger_,
- "old: hmi_level " << old_state->hmi_level() << ", audio_state "
- << old_state->audio_streaming_state()
- << ", system_context "
- << old_state->system_context());
- LOG4CXX_DEBUG(logger_,
- "new: hmi_level " << new_state->hmi_level() << ", audio_state "
- << new_state->audio_streaming_state()
- << ", system_context "
- << new_state->system_context());
- if (IsStatusChanged(old_state, new_state)) {
+ LOG4CXX_DEBUG(logger_, "Old state: " << *old_state);
+ LOG4CXX_DEBUG(logger_, "New state: " << *new_state);
+ if (IsStateChanged(*old_state, *new_state)) {
app_mngr_.SendHMIStatusNotification(app);
if (new_state->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
app->ResetDataInNone();
@@ -686,15 +740,13 @@ void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app,
app->app_id(), old_state->hmi_level(), new_state->hmi_level());
app->usage_report().RecordHmiStateChanged(new_state->hmi_level());
} else {
- LOG4CXX_ERROR(logger_, "Status not changed");
+ LOG4CXX_ERROR(logger_, "State has NOT been changed.");
}
}
-bool StateControllerImpl::IsTempStateActive(HmiState::StateID ID) const {
+bool StateControllerImpl::IsTempStateActive(HmiState::StateID id) const {
sync_primitives::AutoLock autolock(active_states_lock_);
- StateIDList::const_iterator itr =
- std::find(active_states_.begin(), active_states_.end(), ID);
- return active_states_.end() != itr;
+ return helpers::in_range(active_states_, id);
}
void StateControllerImpl::OnApplicationRegistered(
@@ -706,23 +758,25 @@ void StateControllerImpl::OnApplicationRegistered(
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- active_states_lock_.Acquire();
- StateIDList::iterator it = active_states_.begin();
- for (; it != active_states_.end(); ++it) {
- HmiStatePtr new_state = CreateHmiState(app->app_id(), *it);
- DCHECK_OR_RETURN_VOID(new_state);
- DCHECK_OR_RETURN_VOID(new_state->state_id() != HmiState::STATE_ID_REGULAR);
- HmiStatePtr old_hmi_state = app->CurrentHmiState();
- new_state->set_parent(old_hmi_state);
- app->AddHMIState(new_state);
+ {
+ sync_primitives::AutoLock lck(active_states_lock_);
+ for (const auto state_id : active_states_) {
+ HmiStatePtr new_state = CreateHmiState(app, state_id);
+ DCHECK_OR_RETURN_VOID(new_state);
+ DCHECK_OR_RETURN_VOID(new_state->state_id() !=
+ HmiState::STATE_ID_REGULAR);
+ HmiStatePtr old_hmi_state = app->CurrentHmiState();
+ new_state->set_parent(old_hmi_state);
+ app->AddHMIState(new_state);
+ }
}
- active_states_lock_.Release();
HmiStatePtr default_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(default_state);
default_state->set_hmi_level(default_level);
default_state->set_audio_streaming_state(CalcAudioState(app, default_level));
+ default_state->set_video_streaming_state(CalcVideoState(app, default_level));
default_state->set_system_context(SystemContext::SYSCTXT_MAIN);
HmiStatePtr initial_state = app->RegularHmiState();
@@ -751,7 +805,7 @@ int64_t StateControllerImpl::SendBCActivateApp(
LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest");
return -1;
}
- if (!app_mngr_.ManageHMICommand(bc_activate_app_request)) {
+ if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) {
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest");
return -1;
}
@@ -771,16 +825,18 @@ void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) {
}
}
-void StateControllerImpl::TempStateStarted(HmiState::StateID ID) {
+void StateControllerImpl::TempStateStarted(HmiState::StateID id) {
LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock autolock(active_states_lock_);
- StateIDList::iterator it =
- std::find(active_states_.begin(), active_states_.end(), ID);
- if (it == active_states_.end()) {
- active_states_.push_back(ID);
- } else {
- LOG4CXX_ERROR(logger_, "StateID " << ID << " is already active");
+
+ {
+ sync_primitives::AutoLock autolock(active_states_lock_);
+ if (!helpers::in_range(active_states_, id)) {
+ active_states_.push_back(id);
+ return;
+ }
}
+
+ LOG4CXX_ERROR(logger_, "StateID '" << id << "' is already active");
}
void StateControllerImpl::TempStateStopped(HmiState::StateID ID) {
@@ -798,16 +854,34 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
- HmiStatePtr regular = app->RegularHmiState();
+ const HmiStatePtr regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(regular);
- HmiStatePtr new_regular = utils::MakeShared<HmiState>(*regular);
+ HmiStatePtr new_regular = std::make_shared<HmiState>(*regular);
- if (app->IsAudioApplication()) {
+ LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'");
+ const bool is_audio_app = app->IsAudioApplication();
+ const bool is_video_app = app->IsVideoApplication();
+
+ if (is_audio_app || is_video_app) {
+ // audio or video app move to HMI level limited
new_regular->set_hmi_level(HMILevel::HMI_LIMITED);
- new_regular->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
+
+ if (is_audio_app) {
+ new_regular->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
+ } else {
+ new_regular->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ }
+
+ if (is_video_app) {
+ new_regular->set_video_streaming_state(VideoStreamingState::STREAMABLE);
+ } else {
+ new_regular->set_video_streaming_state(
+ VideoStreamingState::NOT_STREAMABLE);
+ }
} else {
new_regular->set_hmi_level(HMILevel::HMI_BACKGROUND);
new_regular->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ new_regular->set_video_streaming_state(VideoStreamingState::NOT_STREAMABLE);
}
SetRegularState(app, new_regular, false);
@@ -824,7 +898,7 @@ void StateControllerImpl::OnActivateAppResponse(
ApplicationSharedPtr application =
app_mngr_.application_by_hmi_app(hmi_app_id);
if (application && hmi_apis::Common_Result::SUCCESS == code) {
- HmiStatePtr pending_state = waiting_for_activate[application->app_id()];
+ HmiStatePtr pending_state = waiting_for_activate_[application->app_id()];
DCHECK_OR_RETURN_VOID(pending_state);
ApplyRegularState(application, pending_state);
}
@@ -847,9 +921,7 @@ void StateControllerImpl::OnAppActivated(
void StateControllerImpl::OnAppDeactivated(
const smart_objects::SmartObject& message) {
- using namespace hmi_apis;
using namespace mobile_apis;
- using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
uint32_t app_id = message[strings::msg_params][strings::app_id].asUInt();
@@ -868,12 +940,22 @@ void StateControllerImpl::OnAppDeactivated(
DeactivateApp(app);
}
-void StateControllerImpl::OnNaviStreamingStarted() {
- ApplyTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+void StateControllerImpl::OnVideoStreamingStarted(
+ ApplicationConstSharedPtr app) {
+ if (app->is_navi()) {
+ ApplyTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+ } else {
+ ApplyTempState<HmiState::STATE_ID_VIDEO_STREAMING>();
+ }
}
-void StateControllerImpl::OnNaviStreamingStopped() {
- CancelTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+void StateControllerImpl::OnVideoStreamingStopped(
+ ApplicationConstSharedPtr app) {
+ if (app->is_navi()) {
+ CancelTempState<HmiState::STATE_ID_NAVI_STREAMING>();
+ } else {
+ CancelTempState<HmiState::STATE_ID_VIDEO_STREAMING>();
+ }
}
bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
@@ -889,49 +971,53 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
}
HmiStatePtr StateControllerImpl::CreateHmiState(
- uint32_t app_id, HmiState::StateID state_id) const {
+ std::shared_ptr<Application> app, HmiState::StateID state_id) const {
using namespace utils;
LOG4CXX_AUTO_TRACE(logger_);
HmiStatePtr new_state;
switch (state_id) {
case HmiState::STATE_ID_PHONE_CALL: {
- new_state = MakeShared<PhoneCallHmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<PhoneCallHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_SAFETY_MODE: {
- new_state = MakeShared<SafetyModeHmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<SafetyModeHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_VR_SESSION: {
- new_state = MakeShared<VRHmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<VRHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_TTS_SESSION: {
- new_state = MakeShared<TTSHmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<TTSHmiState>(app, app_mngr_);
+ break;
+ }
+ case HmiState::STATE_ID_VIDEO_STREAMING: {
+ new_state = std::make_shared<VideoStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_NAVI_STREAMING: {
- new_state = MakeShared<NaviStreamingHmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<NaviStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_REGULAR: {
- new_state = MakeShared<HmiState>(app_id, app_mngr_);
+ new_state = std::make_shared<HmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_POSTPONED: {
- new_state = MakeShared<HmiState>(app_id, app_mngr_, state_id);
+ new_state = std::make_shared<HmiState>(app, app_mngr_, state_id);
break;
}
case HmiState::STATE_ID_DEACTIVATE_HMI: {
- new_state = MakeShared<DeactivateHMI>(app_id, app_mngr_);
+ new_state = std::make_shared<DeactivateHMI>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_AUDIO_SOURCE: {
- new_state = MakeShared<AudioSource>(app_id, app_mngr_);
+ new_state = std::make_shared<AudioSource>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_EMBEDDED_NAVI: {
- new_state = MakeShared<EmbeddedNavi>(app_id, app_mngr_);
+ new_state = std::make_shared<EmbeddedNavi>(app, app_mngr_);
break;
}
default:
@@ -945,20 +1031,31 @@ HmiStatePtr StateControllerImpl::CreateHmiState(
mobile_apis::AudioStreamingState::eType StateControllerImpl::CalcAudioState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level) const {
- namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
- using helpers::Compare;
- using helpers::EQ;
- using helpers::ONE;
-
- AudioStreamingState::eType audio_state = AudioStreamingState::NOT_AUDIBLE;
- if (Compare<HMILevel::eType, EQ, ONE>(
- hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) {
- if (app->IsAudioApplication()) {
- audio_state = AudioStreamingState::AUDIBLE;
- }
+ auto state = mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ if (IsStreamableHMILevel(hmi_level) && app->IsAudioApplication()) {
+ state = mobile_apis::AudioStreamingState::AUDIBLE;
}
- return audio_state;
+
+ LOG4CXX_DEBUG(logger_,
+ "Calculated audio state of app "
+ << app->app_id() << " for " << hmi_level << " HMI level is "
+ << state);
+ return state;
+}
+
+mobile_apis::VideoStreamingState::eType StateControllerImpl::CalcVideoState(
+ ApplicationSharedPtr app,
+ const mobile_apis::HMILevel::eType hmi_level) const {
+ auto state = mobile_apis::VideoStreamingState::NOT_STREAMABLE;
+ if (IsStreamableHMILevel(hmi_level) && app->IsVideoApplication()) {
+ state = mobile_apis::VideoStreamingState::STREAMABLE;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Calculated video state of app "
+ << app->app_id() << " for " << hmi_level << " HMI level is "
+ << state);
+ return state;
}
} // namespace application_manager
diff --git a/src/components/application_manager/src/system_time/system_time_handler_impl.cc b/src/components/application_manager/src/system_time/system_time_handler_impl.cc
new file mode 100644
index 0000000000..27f0972c01
--- /dev/null
+++ b/src/components/application_manager/src/system_time/system_time_handler_impl.cc
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/system_time/system_time_handler_impl.h"
+
+#include <algorithm>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/HMI_API.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+SystemTimeHandlerImpl::SystemTimeHandlerImpl(
+ ApplicationManager& application_manager)
+ : event_engine::EventObserver(application_manager.event_dispatcher())
+ , utc_time_can_be_received_(false)
+ , awaiting_get_system_time_(false)
+ , last_time_(0)
+ , system_time_listener_(NULL)
+ , app_manager_(application_manager) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+}
+
+SystemTimeHandlerImpl::~SystemTimeHandlerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ unsubscribe_from_all_events();
+}
+
+void SystemTimeHandlerImpl::DoSystemTimeQuery() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+
+ sync_primitives::AutoLock lock(state_lock_);
+ if (!utc_time_can_be_received_) {
+ LOG4CXX_INFO(logger_,
+ "Navi module is not yet ready."
+ << "Will process request once it became ready.");
+ return;
+ }
+ SendTimeRequest();
+}
+
+void SystemTimeHandlerImpl::DoSubscribe(utils::SystemTimeListener* listener) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(listener);
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ system_time_listener_ = listener;
+}
+
+void SystemTimeHandlerImpl::DoUnsubscribe(utils::SystemTimeListener* listener) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ system_time_listener_ = NULL;
+}
+
+time_t SystemTimeHandlerImpl::FetchSystemTime() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return last_time_;
+}
+
+bool SystemTimeHandlerImpl::utc_time_can_be_received() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(state_lock_);
+ return utc_time_can_be_received_;
+}
+
+void SystemTimeHandlerImpl::SendTimeRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (awaiting_get_system_time_) {
+ LOG4CXX_WARN(logger_, "Another GetSystemTime request in progress. Skipped");
+ return;
+ }
+
+ using namespace application_manager;
+ uint32_t correlation_id = app_manager_.GetNextHMICorrelationID();
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_GetSystemTime,
+ correlation_id);
+ MessageHelper::SendGetSystemTimeRequest(correlation_id, app_manager_);
+ awaiting_get_system_time_ = true;
+}
+
+void SystemTimeHandlerImpl::on_event(
+ const application_manager::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace application_manager;
+ using namespace hmi_apis::FunctionID;
+ switch (event.id()) {
+ case BasicCommunication_OnSystemTimeReady:
+ ProcessSystemTimeReadyNotification();
+ break;
+ case BasicCommunication_GetSystemTime:
+ ProcessSystemTimeResponse(event);
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "Unknown Event received");
+ break;
+ }
+}
+
+void SystemTimeHandlerImpl::ProcessSystemTimeReadyNotification() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(state_lock_);
+ utc_time_can_be_received_ = true;
+ unsubscribe_from_event(
+ hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady);
+}
+
+void SystemTimeHandlerImpl::ProcessSystemTimeResponse(
+ const application_manager::event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ const smart_objects::SmartObject& system_time_so =
+ message[strings::msg_params][hmi_response::system_time];
+
+ struct tm system_time;
+ memset(&system_time, 0, sizeof(struct tm));
+
+ system_time.tm_sec = system_time_so[time_keys::second].asInt();
+ system_time.tm_min = system_time_so[time_keys::minute].asInt();
+ // According to tm specification of tm type hour should be decreased by 1
+ system_time.tm_hour = system_time_so[time_keys::hour].asInt() - 1;
+ system_time.tm_mday = system_time_so[time_keys::day].asInt();
+ // According to tm specification of tm type mon should be decreased by 1
+ system_time.tm_mon = system_time_so[time_keys::month].asInt() - 1;
+ // According to tm specification of tm type
+ // tm_year - number of years since 1900
+ system_time.tm_year = system_time_so[time_keys::year].asInt() - 1900;
+
+ // Normalize and convert time from 'tm' format to 'time_t'
+ last_time_ = mktime(&system_time);
+
+ sync_primitives::AutoLock lock(system_time_listener_lock_);
+ if (system_time_listener_) {
+ system_time_listener_->OnSystemTimeArrived(last_time_);
+ }
+ sync_primitives::AutoLock state_lock(state_lock_);
+ awaiting_get_system_time_ = false;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 80755b6509..1cfccd816e 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -35,10 +35,9 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
using namespace mobile_apis;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
using namespace usage_statistics;
namespace application_manager {
@@ -56,7 +55,7 @@ std::string LanguageIdToString(Language::eType lang_id) {
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager)
+ std::shared_ptr<StatisticsManager> statistics_manager)
: time_in_hmi_state_sptr_(
new usage_statistics::AppStopwatchImpl(statistics_manager, app_id))
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
@@ -78,7 +77,7 @@ UsageStatistics::UsageStatistics(
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
AppStopwatch* time_in_hmi_state_ptr)
: time_in_hmi_state_sptr_(time_in_hmi_state_ptr)
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index dba8d99a62..02cf58485a 100644..100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -31,12 +31,6 @@
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.
-
-# 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/
@@ -45,12 +39,14 @@ include_directories(
${COMPONENTS_DIR}/resumption/include/
${COMPONENTS_DIR}/utils/include/
${POLICY_PATH}/include/
+ ${COMPONENTS_DIR}/policy/policy_regular/test/include
${POLICY_PATH}/policy/test/include/
${POLICY_MOCK_INCLUDE_PATH}/
${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/security_manager/include/
- ${COMPONENTS_DIR}/policy/test/include/
${COMPONENTS_DIR}/application_manager/test/include/
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/
+ ${BSON_INCLUDE_DIRECTORY}
)
set(testSources
@@ -67,11 +63,20 @@ set(testSources
${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
+ ${AM_TEST_DIR}/application_manager_impl_test.cc
+ ${AM_TEST_DIR}/application_helper_test.cc
+ ${AM_TEST_DIR}/command_holder_test.cc
+)
+set(testSourcesMockHmi
+ ${AM_SOURCE_DIR}/src/message_helper/message_helper.cc
+ ${AM_TEST_DIR}/application_manager_impl_mock_hmi_test.cc
)
+set(testSourcesHelpPromptManager
+ ${AM_TEST_DIR}/help_prompt_manager_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+)
set (RequestController_SOURCES
${AM_TEST_DIR}/request_controller/request_controller_test.cc
${AM_TEST_DIR}/mock_message_helper.cc
@@ -80,6 +85,7 @@ set (RequestController_SOURCES
set(LIBRARIES
Utils
ApplicationManager
+ sdl_rpc_plugin
jsoncpp
Policy
connectionHandler
@@ -96,9 +102,14 @@ set(LIBRARIES
MediaManager
Resumption
ProtocolHandler
- SecurityManager
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
+if (ENABLE_SECURITY)
+ list(APPEND LIBRARIES SecurityManager)
+endif()
+
if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM LIBRARIES dl)
endif()
@@ -123,9 +134,12 @@ set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}"
)
create_test("application_manager_test" "${testSources}" "${LIBRARIES}")
+create_test("application_manager_mock_hmi_test" "${testSourcesMockHmi}" "${LIBRARIES}")
+
+create_test("help_prompt_manager_test" "${testSourcesHelpPromptManager}" "${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
@@ -135,6 +149,8 @@ set(ResumptionData_SOURCES
)
file(COPY hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY hmi_capabilities_sc1.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY hmi_capabilities_sc2.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 1b90f29647..3293a8908d 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -40,7 +40,7 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "connection_handler/mock_connection_handler.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -60,12 +60,12 @@ namespace ch_test = test::components::connection_handler_test;
namespace am_test = test::components::application_manager_test;
const uint32_t MAX_TEST_DURATION = 1000; // 1 second
-typedef utils::SharedPtr<am_test::MockApplication> MockAppPtr;
+typedef std::shared_ptr<am_test::MockApplication> MockAppPtr;
class AppLaunchCtrlTest : public ::testing::Test {
public:
MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) {
- utils::SharedPtr<NiceMock<am_test::MockApplication> > app =
- utils::MakeShared<NiceMock<am_test::MockApplication> >();
+ std::shared_ptr<NiceMock<am_test::MockApplication> > app =
+ std::make_shared<NiceMock<am_test::MockApplication> >();
ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_));
ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_));
@@ -77,7 +77,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
app_launch::ApplicationDataPtr AppDataFromApp(
const am_test::MockApplication& app) {
app_launch::ApplicationDataPtr app_data =
- utils::MakeShared<NiceMock<app_launch::ApplicationData> >(
+ std::make_shared<NiceMock<app_launch::ApplicationData> >(
app.policy_app_id(), app.bundle_id(), app.mac_address());
return app_data;
}
@@ -137,7 +137,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
using app_launch::ApplicationData;
AppAndAppData app;
app.second =
- utils::MakeShared<ApplicationData>(app_id, bundle_id, device_mac);
+ std::make_shared<ApplicationData>(app_id, bundle_id, device_mac);
app.first = AppFromAppData(*app.second);
return app;
}
@@ -164,7 +164,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
NiceMock<ch_test::MockConnectionHandler> connection_handler_mock_;
NiceMock<resumprion_test::MockResumeCtrl> resume_ctrl_mock_;
NiceMock<app_launch_test::MockAppLaunchSettings> settings_;
- std::auto_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
};
app_launch::ApplicationData AppDataFromApp(
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
index e095f0682e..dc96fcf176 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -38,7 +38,7 @@
#include "utils/macro.h"
#include "sql_database.h"
#include "sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/mock_app_launch_settings.h"
#include "application_manager/app_launch/app_launch_data_db.h"
@@ -113,7 +113,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
return test_db_;
}
- static std::auto_ptr<AppLaunchDataDB> res_db_;
+ static std::unique_ptr<AppLaunchDataDB> res_db_;
AppLaunchDataDB* res_db() {
return res_db_.get();
@@ -145,7 +145,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
};
utils::dbms::SQLDatabase* AppLaunchDataDBTest::test_db_ = NULL;
-std::auto_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
+std::unique_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
void AppLaunchDataDBTest::AddApplicationDataWithIncreaseTable(
const ApplicationData& data) {
@@ -284,7 +284,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id", i);
const std::string bundle_id = AddCounter("d1_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -294,7 +294,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id", i);
const std::string bundle_id = AddCounter("d2_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index cc7d3f5814..4541970c70 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -36,7 +36,6 @@
#include "json/json.h"
#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
#include "resumption/last_state_impl.h"
@@ -67,7 +66,7 @@ class AppLaunchDataJsonTest : public ::testing::Test {
private:
virtual void SetUp() {
::file_system::DeleteFile(kAppStorageFile);
- test_last_state_ = std::auto_ptr<resumption::LastState>(
+ test_last_state_ = std::unique_ptr<resumption::LastState>(
new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
@@ -97,14 +96,15 @@ class AppLaunchDataJsonTest : public ::testing::Test {
void AddApplicationDataWithIncreaseTable(const ApplicationData& data);
void AddApplicationDataWithoutIncreaseTable(const ApplicationData& data);
- TimevalStruct GetApplicationData_EXPECT_TRUE(const ApplicationData& in_data,
- ApplicationData& out_data);
+ date_time::TimeDuration GetApplicationData_EXPECT_TRUE(
+ const ApplicationData& in_data, ApplicationData& out_data);
void GetApplicationData_EXPECT_FALSE(const ApplicationData& in_data);
std::string AddCounter(const std::string& inp, int32_t val);
- std::auto_ptr<resumption::LastState> test_last_state_;
- std::auto_ptr<AppLaunchDataJson> res_json_;
- void SetTimestamp(const ApplicationData& in_data, TimevalStruct& timestamp);
+ std::unique_ptr<resumption::LastState> test_last_state_;
+ std::unique_ptr<AppLaunchDataJson> res_json_;
+ void SetTimestamp(const ApplicationData& in_data,
+ date_time::TimeDuration& timestamp);
};
void AppLaunchDataJsonTest::AddApplicationDataWithIncreaseTable(
@@ -129,7 +129,7 @@ void AppLaunchDataJsonTest::AddApplicationDataWithoutIncreaseTable(
EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
}
-TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
+date_time::TimeDuration AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
const ApplicationData& in_data, ApplicationData& out_data) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
@@ -148,9 +148,9 @@ TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
out_data.bundle_id_ =
json_data_list[index][am::strings::bundle_id].asString();
// time stamp
- TimevalStruct tmVal = {0};
- tmVal.tv_sec =
- json_data_list[index][am::strings::app_launch_last_session].asUInt64();
+ date_time::TimeDuration tmVal = date_time::seconds(
+ json_data_list[index][am::strings::app_launch_last_session].asUInt64());
+
return tmVal;
}
@@ -168,7 +168,7 @@ void AppLaunchDataJsonTest::GetApplicationData_EXPECT_FALSE(
}
void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
- TimevalStruct& timestamp) {
+ date_time::TimeDuration& timestamp) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
int32_t index = NotFound;
@@ -183,7 +183,7 @@ void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
// time stamp
json_data_list[index][am::strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(timestamp.tv_sec);
+ static_cast<Json::Value::UInt64>(date_time::getSecs(timestamp));
}
std::string AppLaunchDataJsonTest::AddCounter(const std::string& inp,
@@ -225,18 +225,18 @@ TEST_F(AppLaunchDataJsonTest, RefreshTimestamp) {
ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
AddApplicationDataWithIncreaseTable(data);
ApplicationData recoveredData("", "", "");
- TimevalStruct timestamp1 =
+ date_time::TimeDuration timestamp1 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(data, tm);
- TimevalStruct timestamp2 =
+ date_time::TimeDuration timestamp2 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- EXPECT_NE(timestamp1.tv_sec, timestamp2.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp1), date_time::getSecs(timestamp2));
AddApplicationDataWithoutIncreaseTable(data); // again insert the same
- TimevalStruct timestamp3 =
+ date_time::TimeDuration timestamp3 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
EXPECT_TRUE(data == recoveredData);
- EXPECT_NE(timestamp2.tv_sec, timestamp3.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp2), date_time::getSecs(timestamp3));
}
TEST_F(AppLaunchDataJsonTest, MaxCount) {
@@ -250,7 +250,7 @@ TEST_F(AppLaunchDataJsonTest, MaxCount) {
// insert new time stamp
ApplicationData changedRecord("mobile_app_id_0", "bundle_id_0", "device_mac");
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(changedRecord, tm);
uint32_t size_max = res_json()->GetCurentNumberOfAppData();
@@ -301,7 +301,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d1_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -311,7 +311,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d2_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
new file mode 100644
index 0000000000..3203839fc2
--- /dev/null
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+#include <string>
+#include <vector>
+
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_message_helper.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "policy/mock_policy_settings.h"
+
+#include "application_manager/application.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/usage_statistics.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "connection_handler/device.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "utils/macro.h"
+
+#include "test/resumption/mock_last_state.h"
+#include "media_manager/mock_media_manager.h"
+
+namespace {
+const uint8_t expected_tread_pool_size = 2u;
+const uint8_t stop_streaming_timeout = 1u;
+const std::string kDirectoryName = "./test_storage";
+const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+}
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using resumption_test::MockLastState;
+using test::components::media_manager_test::MockMediaManager;
+
+using namespace application_manager;
+using namespace policy_handler_test;
+
+class ApplicationHelperTest : public testing::Test {
+ public:
+ ApplicationHelperTest()
+ : mock_message_helper_(
+ application_manager::MockMessageHelper::message_helper_mock())
+ , app_manager_impl_(mock_application_manager_settings_,
+ mock_policy_settings_) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(mock_application_manager_settings_, thread_pool_size())
+ .WillByDefault(Return(expected_tread_pool_size));
+ ON_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillByDefault(Return(true));
+ ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
+ .WillByDefault(Return(stop_streaming_timeout));
+ ON_CALL(mock_application_manager_settings_, time_out_promt())
+ .WillByDefault(ReturnRef(kTimeoutPrompt));
+
+ CreateApplication();
+ app_manager_impl_.AddMockApplication(app_impl_);
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void CreateApplication() {
+ const uint32_t application_id = 1;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ const std::string path_to_plagin = "";
+ EXPECT_CALL(mock_application_manager_settings_, plugins_folder())
+ .WillOnce(ReturnRef(path_to_plagin));
+ app_manager_impl_.Init(mock_last_state_, &mock_media_manager_);
+
+ app_impl_ = std::make_shared<ApplicationImpl>(
+ application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ std::make_shared<usage_statistics_test::MockStatisticsManager>(),
+ app_manager_impl_);
+ }
+
+ MockMessageHelper* mock_message_helper_;
+ NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ NiceMock<MockPolicySettings> mock_policy_settings_;
+
+ ApplicationManagerImpl app_manager_impl_;
+ MockMediaManager mock_media_manager_;
+ MockLastState mock_last_state_;
+ ApplicationSharedPtr app_impl_;
+};
+
+TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
+ const uint32_t cmd_id = 1;
+ const uint32_t menu_id = 2;
+ const uint32_t choice_set_id = 3;
+ const mobile_apis::ButtonName::eType button = mobile_apis::ButtonName::AC;
+
+ smart_objects::SmartObject cmd;
+ cmd[strings::msg_params][strings::cmd_id] = cmd_id;
+ cmd[strings::msg_params][strings::vr_commands][0] = "vrCmd";
+ cmd[strings::msg_params][strings::menu_id] = menu_id;
+ cmd[strings::msg_params][strings::interaction_choice_set_id] = choice_set_id;
+
+ app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
+ app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
+ app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
+
+ EXPECT_TRUE(app_impl_->SubscribeToButton(button));
+
+ const std::string some_string = "some_string";
+ smart_objects::SmartObject dummy_data =
+ smart_objects::SmartObject(smart_objects::SmartType_String);
+ dummy_data = some_string;
+ app_impl_->set_help_prompt(dummy_data);
+ app_impl_->set_timeout_prompt(dummy_data);
+ app_impl_->set_vr_help(dummy_data);
+ app_impl_->set_vr_help_title(dummy_data);
+ app_impl_->set_keyboard_props(dummy_data);
+ app_impl_->set_menu_title(dummy_data);
+ app_impl_->set_menu_icon(dummy_data);
+
+ const bool persistent = false;
+ const bool downloaded = true;
+ const std::string filename = "filename";
+ AppFile file(filename, persistent, downloaded, mobile_apis::FileType::BINARY);
+
+ app_impl_->AddFile(file);
+
+ EXPECT_TRUE(NULL != app_impl_->FindCommand(cmd_id));
+ EXPECT_TRUE(NULL != app_impl_->FindSubMenu(menu_id));
+ EXPECT_TRUE(NULL != app_impl_->FindChoiceSet(choice_set_id));
+ EXPECT_TRUE(app_impl_->IsSubscribedToButton(button));
+ auto help_prompt = app_impl_->help_prompt();
+ EXPECT_TRUE(help_prompt->asString() == some_string);
+ auto timeout_prompt = app_impl_->timeout_prompt();
+ EXPECT_TRUE(timeout_prompt->asString() == some_string);
+ auto vr_help = app_impl_->vr_help();
+ EXPECT_TRUE(vr_help->asString() == some_string);
+ auto vr_help_title = app_impl_->vr_help_title();
+ EXPECT_TRUE(vr_help_title->asString() == some_string);
+ auto kb_properties = app_impl_->keyboard_props();
+ EXPECT_TRUE(kb_properties->asString() == some_string);
+ auto menu_title = app_impl_->menu_title();
+ EXPECT_TRUE(menu_title->asString() == some_string);
+ auto menu_icon = app_impl_->menu_icon();
+ EXPECT_TRUE(menu_icon->asString() == some_string);
+ auto file_ptr = app_impl_->GetFile(filename);
+ EXPECT_TRUE(NULL != file_ptr);
+ EXPECT_TRUE(file_ptr->file_name == filename);
+
+ // Act
+ application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
+ EXPECT_FALSE(NULL != app_impl_->FindCommand(cmd_id));
+ EXPECT_FALSE(NULL != app_impl_->FindSubMenu(menu_id));
+ EXPECT_FALSE(NULL != app_impl_->FindChoiceSet(choice_set_id));
+ EXPECT_FALSE(app_impl_->IsSubscribedToButton(button));
+ help_prompt = app_impl_->help_prompt();
+ EXPECT_FALSE(help_prompt->asString() == some_string);
+ timeout_prompt = app_impl_->timeout_prompt();
+ EXPECT_FALSE(timeout_prompt->asString() == some_string);
+ vr_help = app_impl_->vr_help();
+ EXPECT_TRUE(vr_help == NULL);
+ vr_help_title = app_impl_->vr_help_title();
+ EXPECT_TRUE(vr_help_title == NULL);
+ kb_properties = app_impl_->keyboard_props();
+ EXPECT_FALSE(kb_properties->asString() == some_string);
+ menu_title = app_impl_->menu_title();
+ EXPECT_FALSE(menu_title->asString() == some_string);
+ menu_icon = app_impl_->menu_icon();
+ EXPECT_FALSE(menu_icon->asString() == some_string);
+ file_ptr = app_impl_->GetFile(filename);
+ EXPECT_TRUE(NULL == file_ptr);
+}
+
+TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
+ const uint32_t cmd_id = 1;
+ const uint32_t menu_id = 2;
+ const uint32_t choice_set_id = 3;
+ smart_objects::SmartObject cmd;
+ cmd[strings::msg_params][strings::cmd_id] = cmd_id;
+ cmd[strings::msg_params][strings::vr_commands][0] = "vrCmd";
+ cmd[strings::msg_params][strings::menu_id] = menu_id;
+ cmd[strings::msg_params][strings::interaction_choice_set_id] = choice_set_id;
+
+ app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
+ app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
+ app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
+ app_impl_->SubscribeToButton(mobile_apis::ButtonName::AC);
+
+ EXPECT_CALL(*mock_message_helper_, SendUnsubscribedWayPoints(_));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteCommandRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteSubmenuRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteChoiceSetRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendResetPropertiesRequest(_, _));
+
+ EXPECT_CALL(*mock_message_helper_,
+ SendUnsubscribeButtonNotification(_, _, _));
+
+ // Act
+ application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
+}
+
+} // application_manager_test
+} // components
+} // test
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 54414a93de..301ed227b8 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -39,7 +39,6 @@
#include "application_manager/hmi_state.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
#include "application_manager/mock_message_helper.h"
#include "utils/custom_string.h"
#include "application_manager/mock_application_manager.h"
@@ -50,6 +49,7 @@
#include "resumption/last_state.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_resume_ctrl.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "smart_objects/smart_object.h"
@@ -63,6 +63,7 @@ using namespace mobile_apis;
namespace custom_str = utils::custom_string;
using ::testing::_;
+using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::AtLeast;
@@ -77,14 +78,12 @@ class ApplicationImplTest : public ::testing::Test {
policy_app_id = "policy_app_id";
app_name = "app_name";
mac_address = "mac_address";
+ device_handle = 0;
test_lvl = HMILevel::INVALID_ENUM;
state_id = HmiState::STATE_ID_REGULAR;
audiostate = AudioStreamingState::NOT_AUDIBLE;
syst_context = SystemContext::SYSCTXT_MAIN;
- testHmiState = CreateTestHmiState();
- EXPECT_CALL(mock_application_manager_, CreateRegularState(app_id, _, _, _))
- .WillOnce(Return(testHmiState));
EXPECT_CALL(mock_application_manager_, get_settings())
.WillRepeatedly(ReturnRef(mock_application_manager_settings_));
EXPECT_CALL(mock_application_manager_settings_, app_icons_folder())
@@ -95,16 +94,23 @@ class ApplicationImplTest : public ::testing::Test {
audio_data_stopped_timeout()).WillOnce(Return(0));
EXPECT_CALL(mock_application_manager_settings_,
video_data_stopped_timeout()).WillOnce(Return(0));
- app_impl = new ApplicationImpl(app_id,
- policy_app_id,
- mac_address,
- app_name,
- utils::MakeShared<MockStatisticsManager>(),
- mock_application_manager_);
+ app_impl.reset(
+ new ApplicationImpl(app_id,
+ policy_app_id,
+ mac_address,
+ device_handle,
+ app_name,
+ std::make_shared<MockStatisticsManager>(),
+ mock_application_manager_));
+
+ HmiStatePtr initial_state = CreateTestHmiState();
+ app_impl->SetInitialState(initial_state);
}
- void TearDown() OVERRIDE {
- delete app_impl;
+
+ virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(MockMessageHelper::message_helper_mock());
}
+
HmiStatePtr CreateTestHmiState();
HmiStatePtr TestAddHmiState(HMILevel::eType hmi_lvl,
@@ -114,10 +120,11 @@ class ApplicationImplTest : public ::testing::Test {
void CheckCurrentHMIState();
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
- ApplicationImpl* app_impl;
+ std::shared_ptr<ApplicationImpl> app_impl;
uint32_t app_id;
std::string policy_app_id;
std::string mac_address;
+ connection_handler::DeviceHandle device_handle;
custom_str::CustomString app_name;
const std::string directory_name = "./test_storage";
HmiState::StateID state_id;
@@ -128,8 +135,10 @@ class ApplicationImplTest : public ::testing::Test {
};
HmiStatePtr ApplicationImplTest::CreateTestHmiState() {
- HmiStatePtr testState =
- utils::MakeShared<HmiState>(app_id, mock_application_manager_, state_id);
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl),
+ mock_application_manager_,
+ state_id);
testState->set_hmi_level(test_lvl);
testState->set_audio_streaming_state(audiostate);
testState->set_system_context(syst_context);
@@ -142,7 +151,7 @@ HmiStatePtr ApplicationImplTest::TestAddHmiState(HMILevel::eType hmi_lvl,
test_lvl = hmi_lvl;
state_id = id_state;
HmiStatePtr state = CreateTestHmiState();
- (app_impl->*hmi_action)(state);
+ ((app_impl.get())->*hmi_action)(state);
return state;
}
@@ -175,7 +184,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetCurrentState) {
HmiState::STATE_ID_REGULAR,
&ApplicationImpl::SetRegularState);
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
CheckCurrentHMIState();
@@ -187,7 +196,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetRegularState) {
HmiState::STATE_ID_REGULAR,
&ApplicationImpl::SetRegularState);
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr current_state = app_impl->RegularHmiState();
@@ -202,7 +211,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
HmiState::STATE_ID_PHONE_CALL,
&ApplicationImpl::AddHMIState);
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -215,7 +224,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveLastState) {
HmiStatePtr current_state = app_impl->CurrentHmiState();
EXPECT_EQ(state2, current_state);
EXPECT_EQ(HMILevel::HMI_NONE, current_state->hmi_level());
- EXPECT_EQ(HmiState::STATE_ID_NAVI_STREAMING, current_state->state_id());
+ EXPECT_EQ(HmiState::STATE_ID_VIDEO_STREAMING, current_state->state_id());
}
TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
@@ -223,7 +232,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveNotLastNotFirstState) {
HmiState::STATE_ID_PHONE_CALL,
&ApplicationImpl::AddHMIState);
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -247,7 +256,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
&ApplicationImpl::AddHMIState);
// Second state
TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
HmiStatePtr state3 = TestAddHmiState(HMILevel::HMI_LIMITED,
HmiState::STATE_ID_TTS_SESSION,
@@ -261,12 +270,12 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
// Last state does not have a parent
EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level());
EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
- EXPECT_EQ(NULL, current_state->parent());
+ EXPECT_EQ(nullptr, current_state->parent());
}
TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) {
HmiStatePtr state1 = TestAddHmiState(HMILevel::HMI_NONE,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
// Set regular state
HmiStatePtr state2 = TestAddHmiState(HMILevel::HMI_FULL,
@@ -300,7 +309,7 @@ TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) {
// Check that state was correctly removed
app_impl->RemovePostponedState();
state2 = app_impl->PostponedHmiState();
- EXPECT_EQ(NULL, state2);
+ EXPECT_EQ(nullptr, state2);
}
TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
@@ -317,7 +326,7 @@ TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
audiostate = AudioStreamingState::AUDIBLE;
syst_context = SystemContext::SYSCTXT_MENU;
TestAddHmiState(HMILevel::HMI_LIMITED,
- HmiState::STATE_ID_NAVI_STREAMING,
+ HmiState::STATE_ID_VIDEO_STREAMING,
&ApplicationImpl::AddHMIState);
EXPECT_EQ(test_lvl, app_impl->hmi_level());
@@ -396,7 +405,7 @@ TEST_F(ApplicationImplTest, GetFile) {
test_file.file_type = FileType::GRAPHIC_JPEG;
test_file.file_name = "test_file 1";
- EXPECT_EQ(NULL, app_impl->GetFile(test_file.file_name));
+ EXPECT_EQ(nullptr, app_impl->GetFile(test_file.file_name));
EXPECT_TRUE(app_impl->AddFile(test_file));
const AppFile* app_file = app_impl->GetFile(test_file.file_name);
EXPECT_EQ(test_file.is_persistent, app_file->is_persistent);
@@ -565,70 +574,139 @@ TEST_F(ApplicationImplTest, SubscribeToSoftButton_UnsubscribeFromSoftButton) {
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) {
smart_objects::SmartObject type_media;
- type_media[0] = AppHMIType::MEDIA;
+ type_media[0] = mobile_apis::AppHMIType::MEDIA;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_media);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) {
smart_objects::SmartObject type_comm;
- type_comm[0] = AppHMIType::COMMUNICATION;
+ type_comm[0] = mobile_apis::AppHMIType::COMMUNICATION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_comm);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) {
smart_objects::SmartObject type_navi;
- type_navi[0] = AppHMIType::NAVIGATION;
+ type_navi[0] = mobile_apis::AppHMIType::NAVIGATION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_navi);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
smart_objects::SmartObject app_types;
- app_types[0] = AppHMIType::NAVIGATION;
- app_types[1] = AppHMIType::COMMUNICATION;
- app_types[2] = AppHMIType::MEDIA;
+ app_types[0] = mobile_apis::AppHMIType::NAVIGATION;
+ app_types[1] = mobile_apis::AppHMIType::COMMUNICATION;
+ app_types[2] = mobile_apis::AppHMIType::MEDIA;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
+
+ app_impl->set_app_types(app_types);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_TRUE(app_impl->is_navi());
+ EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
+}
+
+TEST_F(ApplicationImplTest,
+ ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) {
+ smart_objects::SmartObject app_types;
+ app_types[0] = mobile_apis::AppHMIType::NAVIGATION;
+ app_types[1] = mobile_apis::AppHMIType::COMMUNICATION;
+ app_types[2] = mobile_apis::AppHMIType::MEDIA;
+ app_types[3] = mobile_apis::AppHMIType::PROJECTION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(app_types);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_TRUE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
SendHashUpdateNotification(app_id, _)).Times(1);
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(mock_application_manager_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, is_suspended()).WillOnce(Return(false));
+ app_impl->UpdateHash();
+
+ EXPECT_TRUE(app_impl->is_application_data_changed());
+}
+
+TEST_F(ApplicationImplTest, UpdateHash_AppMngrSuspended) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendHashUpdateNotification(app_id, _)).Times(0);
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(mock_application_manager_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, is_suspended()).WillOnce(Return(true));
app_impl->UpdateHash();
EXPECT_TRUE(app_impl->is_application_data_changed());
}
+TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingNotApproved) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _));
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params);
+}
+
+TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) {
+ app_impl->set_video_streaming_approved(true);
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params);
+}
+
+TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params);
+}
+
TEST_F(ApplicationImplTest, StartStreaming_MobileNavi_StreamingNotApproved) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
SendNaviStartStream(app_id, _));
@@ -731,6 +809,52 @@ TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) {
EXPECT_FALSE(app_impl->audio_streaming_approved());
}
+TEST_F(ApplicationImplTest, PushPopMobileMessage) {
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ std::make_shared<smart_objects::SmartObject>();
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ state;
+
+ app_impl->PushMobileMessage(on_driver_distraction);
+ app_impl->PushMobileMessage(on_driver_distraction);
+
+ MobileMessageQueue messages;
+ app_impl->SwapMobileMessageQueue(messages);
+
+ EXPECT_EQ(2u, messages.size());
+
+ app_impl->SwapMobileMessageQueue(messages);
+ EXPECT_TRUE(messages.empty());
+}
+
+TEST_F(ApplicationImplTest, SetSecondaryDeviceTest) {
+ connection_handler::DeviceHandle initial_device =
+ app_impl->secondary_device();
+ EXPECT_EQ(0u, initial_device);
+
+ connection_handler::DeviceHandle device = 123;
+ app_impl->set_secondary_device(device);
+
+ EXPECT_EQ(device, app_impl->secondary_device());
+}
+
+TEST_F(ApplicationImplTest, SetDeferredResumptionHMILevelTest) {
+ using namespace mobile_api::HMILevel;
+ HMILevel::eType initial_deferred_level =
+ app_impl->deferred_resumption_hmi_level();
+ EXPECT_EQ(HMILevel::eType::INVALID_ENUM, initial_deferred_level);
+
+ HMILevel::eType deferred_level = HMILevel::eType::HMI_FULL;
+ app_impl->set_deferred_resumption_hmi_level(deferred_level);
+
+ EXPECT_EQ(deferred_level, app_impl->deferred_resumption_hmi_level());
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
new file mode 100644
index 0000000000..8ab852779a
--- /dev/null
+++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <memory>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/application.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "utils/custom_string.h"
+
+#include "encryption/hashing.h"
+
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_resumption_data.h"
+#include "application_manager/mock_command_factory.h"
+#include "application_manager/mock_request.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
+#include "application_manager/mock_rpc_plugin.h"
+#include "utils/optional.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace am = application_manager;
+
+using testing::_;
+using ::testing::DoAll;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SetArgPointee;
+
+using namespace application_manager;
+
+namespace {
+const uint32_t kApplicationId = 0u;
+const std::string kDirectoryName = "./test_storage";
+const uint32_t kTimeout = 10000u;
+} // namespace
+
+/**
+ * @brief The ApplicationManagerImplMockHmiTest class uses mocked HMI factory
+ * which calls its static method and real (non-mocked) MessageHelper.
+ * Class is separated from ApplicationManagerImplTest since it requires real
+ * HMI factory and mocked MessageHelper. So it is not possible to combine
+ * this code together.
+ */
+class ApplicationManagerImplMockHmiTest : public ::testing::Test {
+ public:
+ ApplicationManagerImplMockHmiTest()
+ : mock_storage_(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_)) {}
+
+ protected:
+ void SetUp() OVERRIDE {
+ const uint8_t expected_tread_pool_size = 2u;
+ const uint8_t stop_streaming_timeout = 1u;
+
+ ON_CALL(mock_application_manager_settings_, thread_pool_size())
+ .WillByDefault(Return(expected_tread_pool_size));
+ ON_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillByDefault(Return(true));
+ ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
+ .WillByDefault(Return(stop_streaming_timeout));
+ ON_CALL(mock_application_manager_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+
+ app_manager_impl_.reset(new am::ApplicationManagerImpl(
+ mock_application_manager_settings_, mock_policy_settings_));
+
+ app_manager_impl_->set_connection_handler(&mock_connection_handler_);
+ app_manager_impl_->resume_controller().set_resumption_storage(
+ mock_storage_);
+ app_manager_impl_->set_protocol_handler(&mock_protocol_handler_);
+ }
+
+ void SetCommonExpectationOnAppReconnection(
+ const connection_handler::DeviceHandle new_device_id,
+ const uint32_t new_application_id,
+ const std::string& mac_address) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(new_application_id,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(new_device_id), Return(0)));
+
+ const std::string connection_type = "MyConnectionType";
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ ::testing::Matcher<connection_handler::DeviceHandle>(new_device_id),
+ _,
+ _,
+ _,
+ _))
+ .WillOnce(DoAll(SetArgPointee<3u>(mac_address),
+ SetArgPointee<4u>(connection_type),
+ Return(0)));
+ }
+
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+ application_manager_test::MockApplicationManager mock_app_mngr_;
+ NiceMock<policy_handler_test::MockPolicySettings> mock_policy_settings_;
+ NiceMock<connection_handler_test::MockConnectionHandler>
+ mock_connection_handler_;
+ NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
+ NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+};
+
+TEST_F(ApplicationManagerImplMockHmiTest,
+ PostponeCommandsDuringSwitching_ExpectSendingOnSwitchingEnd) {
+ const uint32_t application_id = 1u;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1u;
+ const custom_str::CustomString app_name("");
+ plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
+ new plugin_manager::MockRPCPluginManager;
+
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
+ application_id,
+ policy_app_id,
+ encryption::MakeHash(mac_address),
+ device_id,
+ app_name,
+ std::shared_ptr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager()),
+ *app_manager_impl_);
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ mock_rpc_plugin_manager);
+
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
+
+ app_manager_impl_->AddMockApplication(app_impl);
+
+ const connection_handler::Device bt(
+ device_id, "BT_device", mac_address, "BLUETOOTH");
+
+ const connection_handler::Device usb(
+ device_id + 1, "USB_device", "USB_serial", "USB_IOS");
+
+ MockCommandFactory mock_command_factory;
+
+ // // Skip sending notification on device switching as it is not the goal
+ // here
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(std::shared_ptr<commands::Command>()));
+
+ plugin_manager::MockRPCPlugin mock_rpc_plugin;
+ utils::Optional<plugin_manager::RPCPlugin> mock_rpc_plugin_opt =
+ mock_rpc_plugin;
+
+ EXPECT_CALL(*mock_rpc_plugin_manager, FindPluginToProcess(_, _))
+ .WillRepeatedly(Return(mock_rpc_plugin_opt));
+ ON_CALL(mock_rpc_plugin, GetCommandFactory())
+ .WillByDefault(ReturnRef(mock_command_factory));
+
+ app_manager_impl_->OnDeviceSwitchingStart(bt, usb);
+
+ const uint32_t connection_key = 1u;
+ const uint32_t correlation_id_1 = 1u;
+ const uint32_t correlation_id_2 = 2u;
+ const uint32_t correlation_id_3 = 3u;
+ std::shared_ptr<NiceMock<MockRequest> > cmd_1 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_1);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_2 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_2);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_3 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_3);
+
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(cmd_1))
+ .WillOnce(Return(cmd_2))
+ .WillOnce(Return(cmd_3));
+
+ commands::MessageSharedPtr hmi_msg_1 =
+ std::make_shared<smart_objects::SmartObject>();
+ commands::MessageSharedPtr hmi_msg_2 =
+ std::make_shared<smart_objects::SmartObject>();
+ commands::MessageSharedPtr hmi_msg_3 =
+ std::make_shared<smart_objects::SmartObject>();
+
+ (*hmi_msg_1)[strings::msg_params][strings::app_id] =
+ (*hmi_msg_2)[strings::msg_params][strings::app_id] =
+ (*hmi_msg_3)[strings::msg_params][strings::app_id] = application_id;
+
+ EXPECT_CALL(*cmd_1, Init()).Times(0);
+ EXPECT_CALL(*cmd_2, Init()).Times(0);
+ EXPECT_CALL(*cmd_3, Init()).Times(0);
+
+ // Act
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_1);
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_2);
+ app_manager_impl_->GetRPCService().ManageHMICommand(hmi_msg_3);
+
+ EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
+ .WillOnce(Return(cmd_1))
+ .WillOnce(Return(cmd_2))
+ .WillOnce(Return(cmd_3));
+
+ EXPECT_CALL(*cmd_1, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_1, Run());
+ EXPECT_CALL(*cmd_2, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_2, Run());
+ EXPECT_CALL(*cmd_3, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_3, Run());
+
+ const connection_handler::DeviceHandle new_device_id = 2;
+ const uint32_t new_application_id = 2;
+ SetCommonExpectationOnAppReconnection(
+ new_device_id, new_application_id, mac_address);
+
+ app_manager_impl_->ProcessReconnection(app_impl, new_application_id);
+ app_manager_impl_->OnApplicationSwitched(app_impl);
+
+ Mock::VerifyAndClearExpectations(&mock_command_factory);
+}
+
+} // application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index 5b232e1dfc..7e57b51329 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -32,25 +32,35 @@
#include <stdint.h>
#include <memory>
#include <set>
+#include <string>
+#include <vector>
+#include <bson_object.h>
#include "gtest/gtest.h"
#include "application_manager/application.h"
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_resumption_data.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/mock_rpc_plugin_manager.h"
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/test/include/application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler.h"
#include "hmi_message_handler/mock_hmi_message_handler.h"
+#include "media_manager/mock_media_manager.h"
#include "policy/mock_policy_settings.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol/bson_object_keys.h"
#include "protocol_handler/mock_session_observer.h"
+#include "protocol_handler/mock_protocol_handler.h"
#include "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/lock.h"
-#include "utils/make_shared.h"
+
#include "utils/push_log.h"
+#include "encryption/hashing.h"
namespace test {
namespace components {
@@ -61,46 +71,62 @@ namespace policy_test = test::components::policy_handler_test;
namespace con_test = connection_handler_test;
using testing::_;
+using ::testing::An;
+using ::testing::Matcher;
+using ::testing::ByRef;
+using ::testing::DoAll;
using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
+using ::testing::SaveArg;
using ::testing::SetArgPointee;
using namespace application_manager;
+// custom action to call a member function with 4 arguments
+ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) {
+ (ptr->*memberFunc)(a, b, c, d);
+}
+
namespace {
const std::string kDirectoryName = "./test_storage";
const uint32_t kTimeout = 10000u;
-sync_primitives::Lock state_lock_;
-sync_primitives::ConditionalVariable state_condition_;
+connection_handler::DeviceHandle kDeviceId = 12345u;
+const std::string kAppId = "someID";
+const uint32_t kConnectionKey = 1232u;
+const std::string kAppName = "appName";
} // namespace
class ApplicationManagerImplTest : public ::testing::Test {
public:
ApplicationManagerImplTest()
- : mock_storage_(
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
- app_mngr_))
+ : app_id_(0u)
+ , mock_storage_(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_))
+ , mock_rpc_service_(new MockRPCService)
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock())
- , app_id_(0u) {
+
+ {
+#ifdef ENABLE_LOG
logger::create_log_message_loop_thread();
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+#endif
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
~ApplicationManagerImplTest() {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
protected:
void SetUp() OVERRIDE {
CreateAppManager();
-
- ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, _))
+ ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, &kDeviceId))
.WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0)));
ON_CALL(mock_connection_handler_, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer_));
-
+ app_manager_impl_->SetRPCService(mock_rpc_service_);
app_manager_impl_->resume_controller().set_resumption_storage(
mock_storage_);
app_manager_impl_->set_connection_handler(&mock_connection_handler_);
@@ -117,42 +143,86 @@ class ApplicationManagerImplTest : public ::testing::Test {
ON_CALL(mock_application_manager_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kDirectoryName));
ON_CALL(mock_application_manager_settings_, launch_hmi())
- .WillByDefault(Return(true));
+ .WillByDefault(Return(false));
ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
.WillByDefault(Return(stop_streaming_timeout));
ON_CALL(mock_application_manager_settings_, default_timeout())
.WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(mock_application_manager_settings_,
+ application_list_update_timeout()).WillByDefault(Return(kTimeout));
+
app_manager_impl_.reset(new am::ApplicationManagerImpl(
mock_application_manager_settings_, mock_policy_settings_));
-
+ mock_app_ptr_ = std::shared_ptr<MockApplication>(new MockApplication());
+ app_manager_impl_->set_protocol_handler(&mock_protocol_handler_);
ASSERT_TRUE(app_manager_impl_.get());
+ ASSERT_TRUE(mock_app_ptr_.get());
+ }
+
+ void AddMockApplication() {
+ app_manager_impl_->AddMockApplication(mock_app_ptr_);
}
+ void SetCommonExpectationOnAppReconnection(
+ const connection_handler::DeviceHandle new_device_id,
+ const uint32_t new_application_id,
+ const std::string& mac_address) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(new_application_id,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(new_device_id), Return(0)));
+
+ const std::string connection_type = "MyConnectionType";
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ ::testing::Matcher<connection_handler::DeviceHandle>(new_device_id),
+ _,
+ _,
+ _,
+ _))
+ .WillOnce(DoAll(SetArgPointee<3u>(mac_address),
+ SetArgPointee<4u>(connection_type),
+ Return(0)));
+ }
+
+ bool CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string);
+
+ uint32_t app_id_;
NiceMock<policy_test::MockPolicySettings> mock_policy_settings_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+
+ std::unique_ptr<rpc_service::RPCService> mock_rpc_service_;
NiceMock<con_test::MockConnectionHandler> mock_connection_handler_;
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
- application_manager_test::MockApplicationManager app_mngr_;
- std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ application_manager_test::MockApplicationManager mock_app_mngr_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
application_manager::MockMessageHelper* mock_message_helper_;
- uint32_t app_id_;
- application_manager::MessageHelper* message_helper_;
+
+ std::shared_ptr<MockApplication> mock_app_ptr_;
+ NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
};
TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject app_data;
const uint32_t connection_key = 65537u;
-
app_data[am::json::name] = "application_manager_test";
app_data[am::json::appId] = app_id_;
app_data[am::json::android] = "bucket";
app_data[am::json::android][am::json::packageName] = "com.android.test";
smart_objects::SmartObject sm_object(SmartType_Map);
sm_object[am::json::response][0] = app_data;
- SmartObjectSPtr sptr = MakeShared<SmartObject>(sm_object);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(sm_object);
ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _))
.WillByDefault(Return(sptr));
@@ -163,17 +233,19 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
TEST_F(ApplicationManagerImplTest,
SubscribeAppForWayPoints_ExpectSubscriptionApp) {
- app_manager_impl_->SubscribeAppForWayPoints(app_id_);
- EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_id_));
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
}
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 =
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
+ app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr);
+ EXPECT_FALSE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
+ const std::set<uint32_t> result =
app_manager_impl_->GetAppsSubscribedForWayPoints();
EXPECT_TRUE(result.empty());
}
@@ -182,17 +254,1163 @@ TEST_F(
ApplicationManagerImplTest,
IsAnyAppSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
EXPECT_FALSE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
- app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
}
TEST_F(
ApplicationManagerImplTest,
GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
- app_manager_impl_->SubscribeAppForWayPoints(app_id_);
- std::set<int32_t> result = app_manager_impl_->GetAppsSubscribedForWayPoints();
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ std::set<uint32_t> result =
+ app_manager_impl_->GetAppsSubscribedForWayPoints();
EXPECT_EQ(1u, result.size());
- EXPECT_TRUE(result.find(app_id_) != result.end());
+ EXPECT_TRUE(result.find(app_ptr->app_id()) != result.end());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kRpc;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownApp) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kInvalidServiceType;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(456));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownService) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kInvalidServiceType;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceNotStart1) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ // is_navi() is false
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() and StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceNotStart2) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ // HMI level is not FULL nor LIMITED
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() and StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoSetConfig_SUCCESS) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ converted_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9;
+ converted_params[strings::height] = 640;
+ converted_params[strings::width] = 480;
+
+ std::vector<std::string> empty;
+
+ // check: SetVideoConfig() and StartStreaming() are called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params))
+ .WillOnce(DoAll(InvokeMemberFuncWithArg4(
+ app_manager_impl_.get(),
+ &ApplicationManagerImpl::OnStreamingConfigured,
+ session_key,
+ service_type,
+ true,
+ ByRef(empty)),
+ Return(true)));
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+static bool ValidateList(std::vector<std::string>& expected,
+ std::vector<std::string>& actual) {
+ if (expected.size() != actual.size()) {
+ return false;
+ }
+ for (unsigned int i = 0; i < expected.size(); i++) {
+ std::string& param = expected[i];
+ unsigned int j;
+ for (j = 0; j < actual.size(); j++) {
+ if (param == actual[j]) {
+ break;
+ }
+ }
+ if (j == actual.size()) {
+ // not found
+ return false;
+ }
+ }
+ return true;
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoSetConfig_FAILURE) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ converted_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9;
+ converted_params[strings::height] = 640;
+ converted_params[strings::width] = 480;
+
+ std::vector<std::string> rejected_list;
+ rejected_list.push_back(std::string("protocol"));
+ rejected_list.push_back(std::string("codec"));
+
+ // simulate HMI returning negative response
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params))
+ .WillOnce(DoAll(InvokeMemberFuncWithArg4(
+ app_manager_impl_.get(),
+ &ApplicationManagerImpl::OnStreamingConfigured,
+ session_key,
+ service_type,
+ false,
+ ByRef(rejected_list)),
+ Return(true)));
+
+ // check: StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is false
+ EXPECT_FALSE(result);
+
+ // check: rejected param list contains "videoProtocol" and "videoCodec"
+ ASSERT_EQ(2u, rejected_params.size());
+ std::vector<std::string> expected_list;
+ expected_list.push_back(
+ std::string(protocol_handler::strings::video_protocol));
+ expected_list.push_back(std::string(protocol_handler::strings::video_codec));
+ ASSERT_TRUE(ValidateList(expected_list, rejected_params));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceWithoutVideoParams) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params, "protocolVersion", protocol_version);
+ bson_object_put_int64(&input_params, "mtu", 100);
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kAudio;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_AudioServiceWithParams) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kAudio;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_BeforeAppRegistration) {
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = 123;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(device_handle)).Times(1);
+ // called by ResumeCtrlImpl::RetryResumption()
+ EXPECT_CALL(*mock_app_ptr_, deferred_resumption_hmi_level())
+ .WillOnce(Return(mobile_api::HMILevel::eType::INVALID_ENUM));
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(device_handle));
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(0)).Times(1);
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_BeforeAppRegistration) {
+ const int32_t session_key = app_id_;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnDeviceSwitchingStart_ExpectPutAppsInWaitList) {
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
+
+ const std::string switching_device_id = "switching";
+ const std::string switching_device_id_hash =
+ encryption::MakeHash(switching_device_id);
+ app_manager_impl_->AddMockApplication(switching_app_ptr);
+ EXPECT_CALL(*switching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(switching_device_id_hash));
+
+ const std::string policy_app_id_switch = "abc";
+ EXPECT_CALL(*switching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_switch));
+
+ const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
+ EXPECT_CALL(*switching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_switching_app));
+
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
+
+ const std::string nonswitching_device_id = "nonswitching";
+ const std::string nonswitching_device_id_hash =
+ encryption::MakeHash(nonswitching_device_id);
+ app_manager_impl_->AddMockApplication(nonswitching_app_ptr);
+ EXPECT_CALL(*nonswitching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(nonswitching_device_id_hash));
+
+ const std::string policy_app_id_nonswitch = "efg";
+ EXPECT_CALL(*nonswitching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_nonswitch));
+
+ const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_nonswitching_app));
+
+ // Act
+ const connection_handler::DeviceHandle switching_handle = 1;
+ const connection_handler::Device switching_device(
+ switching_handle, "switching_device", switching_device_id, "BLUETOOTH");
+
+ const connection_handler::DeviceHandle non_switching_handle = 2;
+ const connection_handler::Device non_switching_device(non_switching_handle,
+ "non_switching_device",
+ nonswitching_device_id,
+ "USB");
+
+ EXPECT_CALL(*mock_message_helper_, CreateDeviceListSO(_, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+ app_manager_impl_->OnDeviceSwitchingStart(switching_device,
+ non_switching_device);
+ EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
+ EXPECT_FALSE(
+ app_manager_impl_->IsAppInReconnectMode(policy_app_id_nonswitch));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) {
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
+
+ plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
+ new plugin_manager::MockRPCPluginManager;
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ mock_rpc_plugin_manager);
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
+
+ const std::string switching_device_id = "switching";
+ const std::string switching_device_id_hash =
+ encryption::MakeHash(switching_device_id);
+ app_manager_impl_->AddMockApplication(switching_app_ptr);
+ EXPECT_CALL(*switching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(switching_device_id_hash));
+
+ const std::string policy_app_id_switch = "abc";
+ EXPECT_CALL(*switching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_switch));
+
+ const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
+ EXPECT_CALL(*switching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_switching_app));
+
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
+
+ const std::string nonswitching_device_id = "nonswitching";
+ const std::string nonswitching_device_id_hash =
+ encryption::MakeHash(nonswitching_device_id);
+ app_manager_impl_->AddMockApplication(nonswitching_app_ptr);
+ EXPECT_CALL(*nonswitching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(nonswitching_device_id_hash));
+
+ const std::string policy_app_id_nonswitch = "efg";
+ EXPECT_CALL(*nonswitching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_nonswitch));
+
+ const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_nonswitching_app));
+
+ // Act
+ const connection_handler::DeviceHandle switching_handle = 1;
+ const connection_handler::Device switching_device(
+ switching_handle, "switching_device", switching_device_id, "BLUETOOTH");
+
+ const connection_handler::DeviceHandle non_switching_handle = 2;
+ const connection_handler::Device non_switching_device(non_switching_handle,
+ "non_switching_device",
+ nonswitching_device_id,
+ "USB");
+
+ EXPECT_CALL(*mock_message_helper_, CreateDeviceListSO(_, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+ app_manager_impl_->OnDeviceSwitchingStart(switching_device,
+ non_switching_device);
+
+ EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
+
+ app_manager_impl_->OnDeviceSwitchingFinish(switching_device_id);
+ EXPECT_FALSE(
+ app_manager_impl_->application_by_policy_id(policy_app_id_switch));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ ProcessReconnection_ExpectChangeAppIdDeviceId) {
+ const uint32_t application_id = 1;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
+ application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ std::shared_ptr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager()),
+ *app_manager_impl_);
+
+ app_manager_impl_->AddMockApplication(app_impl);
+
+ const connection_handler::DeviceHandle new_device_id = 2;
+ const uint32_t new_application_id = 2;
+ SetCommonExpectationOnAppReconnection(
+ new_device_id, new_application_id, mac_address);
+
+ // Act
+ app_manager_impl_->ProcessReconnection(app_impl, new_application_id);
+ EXPECT_EQ(new_device_id, app_impl->device());
+ EXPECT_EQ(new_application_id, app_impl->app_id());
+}
+
+TEST_F(ApplicationManagerImplTest, StartStopAudioPassThru) {
+ std::string dummy_file_name;
+ ON_CALL(mock_application_manager_settings_, recording_file_name())
+ .WillByDefault(ReturnRef(dummy_file_name));
+
+ NiceMock<test::components::media_manager_test::MockMediaManager>
+ mock_media_manager;
+ app_manager_impl_->SetMockMediaManager(&mock_media_manager);
+
+ const uint32_t app_id = 65537;
+ const int32_t max_duration = 1000;
+ // below are not used
+ const int32_t correlation_id = 0;
+ const int32_t sampling_rate = 0;
+ const int32_t bits_per_sample = 0;
+ const int32_t audio_type = 0;
+
+ EXPECT_CALL(mock_media_manager,
+ StartMicrophoneRecording(app_id, _, max_duration))
+ .WillOnce(Return());
+ EXPECT_CALL(mock_media_manager, StopMicrophoneRecording(app_id))
+ .WillOnce(Return());
+
+ bool result = app_manager_impl_->BeginAudioPassThru(app_id);
+ EXPECT_TRUE(result);
+ if (result) {
+ app_manager_impl_->StartAudioPassThruThread(app_id,
+ correlation_id,
+ max_duration,
+ sampling_rate,
+ bits_per_sample,
+ audio_type);
+ }
+
+ result = app_manager_impl_->EndAudioPassThru(app_id);
+ EXPECT_TRUE(result);
+ if (result) {
+ app_manager_impl_->StopAudioPassThru(app_id);
+ }
+}
+
+TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
+ std::string dummy_file_name;
+ ON_CALL(mock_application_manager_settings_, recording_file_name())
+ .WillByDefault(ReturnRef(dummy_file_name));
+
+ std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
+ new plugin_manager::MockRPCPluginManager);
+ app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr);
+
+ const uint32_t app_id_1 = 65537;
+ const uint32_t app_id_2 = 65538;
+
+ std::string dummy_mac_address;
+ std::shared_ptr<MockApplication> mock_app_1 =
+ std::shared_ptr<MockApplication>(new MockApplication());
+ EXPECT_CALL(*mock_app_1, app_id()).WillRepeatedly(Return(app_id_1));
+ EXPECT_CALL(*mock_app_1, device()).WillRepeatedly(Return(0));
+ EXPECT_CALL(*mock_app_1, mac_address())
+ .WillRepeatedly(ReturnRef(dummy_mac_address));
+ EXPECT_CALL(*mock_app_1, policy_app_id()).WillRepeatedly(Return(""));
+ EXPECT_CALL(*mock_app_1, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+
+ std::shared_ptr<MockApplication> mock_app_2 =
+ std::shared_ptr<MockApplication>(new MockApplication());
+ EXPECT_CALL(*mock_app_2, app_id()).WillRepeatedly(Return(app_id_2));
+ EXPECT_CALL(*mock_app_2, device()).WillRepeatedly(Return(0));
+ EXPECT_CALL(*mock_app_2, mac_address())
+ .WillRepeatedly(ReturnRef(dummy_mac_address));
+ EXPECT_CALL(*mock_app_2, policy_app_id()).WillRepeatedly(Return(""));
+ EXPECT_CALL(*mock_app_2, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+
+ NiceMock<test::components::media_manager_test::MockMediaManager>
+ mock_media_manager;
+ app_manager_impl_->SetMockMediaManager(&mock_media_manager);
+
+ app_manager_impl_->AddMockApplication(mock_app_1);
+ app_manager_impl_->AddMockApplication(mock_app_2);
+
+ const int32_t max_duration = 1000;
+ // below are not used
+ const int32_t correlation_id = 0;
+ const int32_t sampling_rate = 0;
+ const int32_t bits_per_sample = 0;
+ const int32_t audio_type = 0;
+
+ EXPECT_CALL(mock_media_manager,
+ StartMicrophoneRecording(app_id_2, _, max_duration))
+ .WillOnce(Return());
+ EXPECT_CALL(mock_media_manager, StopMicrophoneRecording(app_id_2))
+ .WillOnce(Return());
+
+ // app 2 starts Audio Pass Thru
+ bool result = app_manager_impl_->BeginAudioPassThru(app_id_2);
+ EXPECT_TRUE(result);
+ if (result) {
+ app_manager_impl_->StartAudioPassThruThread(app_id_2,
+ correlation_id,
+ max_duration,
+ sampling_rate,
+ bits_per_sample,
+ audio_type);
+ }
+
+ // while running APT, app 1 is unregistered
+ app_manager_impl_->UnregisterApplication(
+ app_id_1, mobile_apis::Result::SUCCESS, false, true);
+
+ // confirm that APT is still running
+ result = app_manager_impl_->EndAudioPassThru(app_id_2);
+ EXPECT_TRUE(result);
+ if (result) {
+ app_manager_impl_->StopAudioPassThru(app_id_2);
+ }
+}
+
+static std::map<std::string, std::vector<std::string> > CreateTransportMap() {
+ /*
+ * DefaultTransportRequiredForResumption = TCP_WIFI, IAP_USB, SPP_BLUETOOTH
+ * MediaTransportRequiredForResumption = TCP_WIFI, AOA_USB
+ * NavigationTransportRequiredForResumption = AOA_USB, SPP_BLUETOOTH
+ * TestingTransportRequiredForResumption =
+ * EmptyAppTransportRequiredForResumption = TCP_WIFI
+ */
+ std::string TCP_WIFI("TCP_WIFI");
+ std::string IAP_USB("IAP_USB");
+ std::string SPP_BLUETOOTH("SPP_BLUETOOTH");
+ std::string AOA_USB("AOA_USB");
+
+ std::vector<std::string> default_transports;
+ default_transports.push_back(TCP_WIFI);
+ default_transports.push_back(IAP_USB);
+ default_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> media_transports;
+ media_transports.push_back(TCP_WIFI);
+ media_transports.push_back(AOA_USB);
+ std::vector<std::string> navi_transports;
+ navi_transports.push_back(AOA_USB);
+ navi_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> testing_transports;
+ std::vector<std::string> empty_transports;
+ empty_transports.push_back(TCP_WIFI);
+
+ std::map<std::string, std::vector<std::string> > transport_map;
+ transport_map[std::string("DEFAULT")] = default_transports;
+ transport_map[std::string("MEDIA")] = media_transports;
+ transport_map[std::string("NAVIGATION")] = navi_transports;
+ transport_map[std::string("TESTING")] = testing_transports;
+ transport_map[std::string("EMPTY_APP")] = empty_transports;
+
+ return transport_map;
+}
+
+bool ApplicationManagerImplTest::CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string) {
+ EXPECT_CALL(*mock_app_ptr_, app_types())
+ .WillRepeatedly(Return(app_types_array));
+
+ std::map<std::string, std::vector<std::string> > transport_map =
+ CreateTransportMap();
+
+ EXPECT_CALL(mock_application_manager_settings_,
+ transport_required_for_resumption_map())
+ .WillRepeatedly(ReturnRef(transport_map));
+
+ EXPECT_CALL(*mock_app_ptr_, device())
+ .WillRepeatedly(Return(primary_device_handle));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(secondary_device_handle));
+
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(primary_device_handle))
+ .WillOnce(Return(primary_transport_device_string));
+
+ if (secondary_device_handle != 0) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(secondary_device_handle))
+ .WillOnce(Return(secondary_transport_device_string));
+ } else {
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(
+ secondary_device_handle)).WillOnce(Return(std::string("")));
+ }
+
+ return app_manager_impl_->CheckResumptionRequiredTransportAvailable(
+ mock_app_ptr_);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::DEFAULT;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is DEFAULT.
+ // - A DEFAULT app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI, IAP_USB or SPP_BLUETOOTH.
+ // - We have SPP_BLUETOOTH for primary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NotListed) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::SOCIAL;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is SOCIAL.
+ // - We do not have an entry in .ini file for SOCIAL apps.
+ // -> In this case, resumption is always enabled for backward compatibility.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Disabled) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::TESTING;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is TESTING.
+ // - We do not have any transports allowed for TESTING apps.
+ // -> In this case, resumption is always disabled.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ // we don't specify any app type
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes2) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ NULL,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - We have TCP_WIFI for secondary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI for secondary transport.
+ // -> Conclusion: the app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA and NAVIGATION.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Empty) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::SYSTEM;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION and SYSTEM.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - .ini file does not have an entry for SYSTEM apps. So any transport is
+ // allowed.
+ // - We have SPP_BLUETOOTH for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ RegisterApplication_PathToTheIconExists_IconWasSet) {
+ file_system::CreateDirectory(kDirectoryName);
+ const std::string full_icon_path = kDirectoryName + "/" + kAppId;
+ ASSERT_TRUE(file_system::CreateFile(full_icon_path));
+
+ smart_objects::SmartObject request_for_registration(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& params =
+ request_for_registration[strings::msg_params];
+ params[strings::app_id] = kAppId;
+ params[strings::language_desired] = mobile_api::Language::EN_US;
+ params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US;
+
+ request_for_registration[strings::params][strings::connection_key] =
+ kConnectionKey;
+ request_for_registration[strings::msg_params][strings::app_name] = kAppName;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::minor_version] = APIVersion::kAPIV2;
+ request_for_registration[strings::msg_params][strings::sync_msg_version]
+ [strings::major_version] = APIVersion::kAPIV3;
+
+ request_for_registration[strings::params][strings::protocol_version] =
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2;
+
+ smart_objects::SmartObjectSPtr request_for_registration_ptr =
+ std::make_shared<smart_objects::SmartObject>(request_for_registration);
+
+ ApplicationSharedPtr application =
+ app_manager_impl_->RegisterApplication(request_for_registration_ptr);
+ EXPECT_STREQ(kAppName.c_str(), application->name().c_str());
+ EXPECT_STREQ(full_icon_path.c_str(), application->app_icon_path().c_str());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ application->protocol_version());
+ EXPECT_EQ(APIVersion::kAPIV2,
+ application->version().min_supported_api_version);
+ EXPECT_EQ(APIVersion::kAPIV3,
+ application->version().max_supported_api_version);
+
+ EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true));
}
} // application_manager_test
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index 7bc34966b4..a0bfa2890f 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -34,14 +34,13 @@
#include "gtest/gtest.h"
#include "application_manager/hmi_state.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "resumption/last_state.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace application_manager_test {
@@ -57,19 +56,24 @@ std::vector<StateID> GenerateCurrentStates() {
states.push_back(StateID::STATE_ID_SAFETY_MODE);
states.push_back(StateID::STATE_ID_VR_SESSION);
states.push_back(StateID::STATE_ID_TTS_SESSION);
- states.push_back(StateID::STATE_ID_NAVI_STREAMING);
+ states.push_back(StateID::STATE_ID_VIDEO_STREAMING);
states.push_back(StateID::STATE_ID_DEACTIVATE_HMI);
return states;
}
}
class ApplicationStateTest : public ::testing::Test {
+ public:
+ void SetUp() OVERRIDE {
+ mock_app_.reset(new MockApplication);
+ }
+
protected:
static std::vector<StateID> added_states_;
ApplicationState app_state;
const StateID current_id = StateID::STATE_ID_CURRENT;
const StateID postponed_id = StateID::STATE_ID_POSTPONED;
- const uint32_t app_id = 10;
+ std::shared_ptr<MockApplication> mock_app_;
MockApplicationManager app_mngr_;
};
@@ -79,8 +83,10 @@ std::vector<StateID> ApplicationStateTest::added_states_ =
TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
EXPECT_EQ(state, app_state.GetState(current_id));
}
@@ -89,8 +95,10 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
HmiStatePtr curr_state = app_state.GetState(current_id);
@@ -110,16 +118,20 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
// Added some states
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
}
// Postponed state wasn't added
HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_id);
+ EXPECT_EQ(nullptr, get_postponed_id);
// Add posponed state
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Postponed state exists
get_postponed_id = app_state.GetState(postponed_id);
@@ -129,14 +141,19 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
// Add state
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
state->set_hmi_level(HMILevel::HMI_FULL);
app_state.AddState(state);
++new_state;
// Add some other
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
state->set_hmi_level(HMILevel::HMI_LIMITED);
}
@@ -150,13 +167,18 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
++new_state;
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Make sure that the state was added
@@ -164,7 +186,10 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
ASSERT_EQ(state, post_state);
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
}
@@ -184,22 +209,32 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
// Add some state
StateID first_state = StateID::STATE_ID_PHONE_CALL;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, first_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ first_state);
app_state.AddState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Add new postponed state
- const uint32_t app_id2 = 10;
- state = utils::MakeShared<HmiState>(app_id2, app_mngr_, postponed_id);
+ std::shared_ptr<MockApplication> mock_app_2(new MockApplication);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Add regular state
- state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, StateID::STATE_ID_REGULAR);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ StateID::STATE_ID_REGULAR);
app_state.AddState(state);
// Postponed state is the first
@@ -213,8 +248,10 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
TEST_F(ApplicationStateTest, InitState_GetRegularState) {
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ init_state);
app_state.InitState(state);
@@ -228,14 +265,19 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) {
TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
// Precondition
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ init_state);
state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
app_state.InitState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Make sure that state was added
@@ -246,13 +288,16 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
app_state.RemoveState(postponed_id);
get_postponed_state = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_state);
+ EXPECT_EQ(nullptr, get_postponed_state);
}
TEST_F(ApplicationStateTest,
AddRegularState_RemoveRegularState_RegularStateNotDeleted) {
StateID reg_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(app_id, app_mngr_, reg_state);
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ reg_state);
app_state.InitState(state);
// Try deleting regular state
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
new file mode 100644
index 0000000000..56e24b8d29
--- /dev/null
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+
+#include "application_manager/command_holder_impl.h"
+#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
+
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_rpc_service.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using testing::_;
+using testing::Return;
+using ::testing::ReturnRef;
+
+namespace am = application_manager;
+
+class CommandHolderImplTest : public testing::Test {
+ public:
+ CommandHolderImplTest()
+ : kPolicyAppId_("p_app_id")
+ , kHmiApplicationId_(123)
+ , kConnectionKey_(56789)
+ , cmd_ptr_(new smart_objects::SmartObject)
+ , mock_app_ptr_(new MockApplication) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kConnectionKey_));
+ ON_CALL(*mock_app_ptr_, hmi_app_id())
+ .WillByDefault(Return(kHmiApplicationId_));
+ ON_CALL(*mock_app_ptr_, policy_app_id())
+ .WillByDefault(Return(kPolicyAppId_));
+ ON_CALL(mock_app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ }
+
+ MockApplicationManager mock_app_manager_;
+ const std::string kPolicyAppId_;
+ const uint32_t kHmiApplicationId_;
+ const uint32_t kConnectionKey_;
+ std::shared_ptr<smart_objects::SmartObject> cmd_ptr_;
+ std::shared_ptr<MockApplication> mock_app_ptr_;
+ application_manager_test::MockRPCService mock_rpc_service_;
+};
+
+TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, HoldMany_ExpectReleaseSame) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ int32_t iterations = 0;
+ do {
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ ++iterations;
+ } while (iterations < 5);
+
+ // Act
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_Drop_ExpectNoReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ cmd_holder.Clear(mock_app_ptr_);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
+ cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ int32_t iterations = 0;
+ do {
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ ++iterations;
+ } while (iterations < 3);
+
+ // Act
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
+ cmd_holder.Clear(another_app);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand, cmd_ptr_);
+
+ // Act
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_));
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(cmd_ptr_,
+ am::commands::Command::CommandSource::SOURCE_MOBILE));
+ cmd_holder.Resume(mock_app_ptr_,
+ am::CommandHolder::CommandType::kMobileCommand);
+}
+
+} // application_manager_test
+} // components
+} // test
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index e22d1434a7..33258e60db 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -35,33 +35,30 @@ include_directories(
${COMPONENTS_DIR}/application_manager/include/
${COMPONENTS_DIR}/application_manager/include/application_manager/
${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/hmi/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/mobile/
- ${COMPONENTS_DIR}/application_manager/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/application_manager/
+ ${CMAKE_SOURCE_DIR}/src
)
set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
file(GLOB SOURCES
+ ${COMMANDS_TEST_DIR}/*
${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/*
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_imp_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_request_impl_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/commands/command_response_impl_test.cc
)
set(LIBRARIES
gmock
Utils
SmartObjects
- jsoncpp
HMI_API
MOBILE_API
- ApplicationManager
- AMHMICommandsLibrary
- AMMobileCommandsLibrary
connectionHandler
+ ApplicationManager
+ jsoncpp
+ Policy
)
-create_cotired_test("commands_test" "${SOURCES}" "${LIBRARIES}" )
+create_test("commands_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc
index fd660af210..222f16ef46 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -37,7 +37,7 @@
#include <set>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -55,7 +55,6 @@ using ::testing::Return;
using ::testing::AtLeast;
using ::testing::_;
-using ::utils::SharedPtr;
namespace strings = ::application_manager::strings;
using ::application_manager::commands::CommandImpl;
using ::application_manager::ApplicationManager;
@@ -63,7 +62,7 @@ using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::ApplicationSharedPtr;
using ::test::components::application_manager_test::MockApplication;
-typedef SharedPtr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<MockApplication> MockAppPtr;
namespace {
const uint32_t kDefaultMsgCount = 5u;
@@ -83,12 +82,19 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
public:
class UnwrappedCommandImpl : CommandImpl {
public:
- using CommandImpl::ReplaceMobileByHMIAppId;
- using CommandImpl::ReplaceHMIByMobileAppId;
+ using CommandImpl::ReplaceMobileWithHMIAppId;
+ using CommandImpl::ReplaceHMIWithMobileAppId;
UnwrappedCommandImpl(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {}
+ ApplicationManager& application_manager,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler) {}
};
// Create `SmartObject` which handle array of `SmartObjects`
@@ -118,11 +124,11 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl;
-typedef SharedPtr<UCommandImpl> UCommandImplPtr;
+typedef std::shared_ptr<UCommandImpl> UCommandImplPtr;
TEST_F(CommandImplTest, GetMethods_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandImpl> command =
+ std::shared_ptr<CommandImpl> command =
CreateCommand<CommandImpl>(kDefaultTimeout_, msg);
// Current implementation always return `true`
@@ -151,16 +157,16 @@ TEST_F(CommandImplTest, GetMethods_SUCCESS) {
EXPECT_NO_THROW(command->onTimeOut());
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_NoAppIdInMessage_UNSUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_NoAppIdInMessage_UNSUCCESS) {
MessageSharedPtr msg;
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
EXPECT_CALL(app_mngr_, application(_)).Times(0);
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::app_id] = kAppId1;
@@ -171,12 +177,12 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kAppId1)).WillOnce(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Array_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_Array_SUCCESS) {
MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -187,14 +193,14 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Array_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
EXPECT_TRUE(msg->asArray());
std::for_each(
msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_Map_SUCCESS) {
MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -205,7 +211,7 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
std::set<std::string> keys(msg->enumerate());
std::for_each(keys.begin(),
@@ -213,16 +219,17 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
std::bind2nd(std::ptr_fun(&ExpectEqualKeyAppId), msg));
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_NoHMIAppIdInMessage_UNSUCCESS) {
+TEST_F(CommandImplTest,
+ ReplaceHMIWithMobileAppId_NoHMIAppIdInMessage_UNSUCCESS) {
MessageSharedPtr msg;
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::app_id] = kAppId1;
@@ -233,12 +240,12 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_SUCCESS) {
EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppId1)).WillOnce(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Array_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_Array_SUCCESS) {
MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -249,14 +256,14 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Array_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
EXPECT_TRUE(msg->asArray());
std::for_each(
msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_Map_SUCCESS) {
MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -267,7 +274,7 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
std::set<std::string> keys = msg->enumerate();
std::for_each(keys.begin(),
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index 2471ec1165..c70dd14852 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -40,7 +40,7 @@
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/data_accessor.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -65,7 +65,6 @@ using ::testing::Return;
using ::testing::SaveArg;
using ::testing::DoAll;
-using ::utils::SharedPtr;
using am::commands::MessageSharedPtr;
using am::CommandParametersPermissions;
using am::event_engine::EventObserver;
@@ -96,6 +95,9 @@ const std::string kMissedParam = "missed_param";
class CommandRequestImplTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
+ CommandRequestImplTest()
+ : app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+
class UnwrappedCommandRequestImpl : public CommandRequestImpl {
public:
using CommandRequestImpl::CheckAllowedParameters;
@@ -104,8 +106,12 @@ class CommandRequestImplTest
using CommandRequestImpl::HasDisallowedParams;
UnwrappedCommandRequestImpl(const MessageSharedPtr& message,
- ApplicationManager& am)
- : CommandRequestImpl(message, am) {}
+ ApplicationManager& am,
+ app_mngr::rpc_service::RPCService& rpc_service,
+ app_mngr::HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler)
+ : CommandRequestImpl(
+ message, am, rpc_service, hmi_capabilities, policy_handler) {}
const RequestState current_state() const {
return current_state_;
@@ -121,31 +127,27 @@ class CommandRequestImplTest
CommandParametersPermissions& removed_parameters_permissions() {
return removed_parameters_permissions_;
}
- };
- CommandRequestImplTest() {
- mock_message_helper_ = am::MockMessageHelper::message_helper_mock();
- }
- ~CommandRequestImplTest() {
- mock_message_helper_ = NULL;
- }
+ void SetHashUpdateMode(HashUpdateMode mode) {
+ hash_update_mode_ = mode;
+ }
+ };
- MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
- app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
MockAppPtr app(CreateMockApp());
app_set->insert(app);
EXPECT_CALL(app_mngr_, applications())
.WillOnce(
- Return(DataAccessor<ApplicationSet>(*app_set, app_set_lock_)));
+ Return(DataAccessor<ApplicationSet>(*app_set, app_set_lock_ptr_)));
return app;
}
- sync_primitives::Lock app_set_lock_;
- am::MockMessageHelper* mock_message_helper_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
};
typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
-typedef SharedPtr<UCommandRequestImpl> CommandPtr;
+typedef std::shared_ptr<UCommandRequestImpl> CommandPtr;
TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>();
@@ -154,7 +156,8 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
// First -- on `onTimeOut` method call
// Second -- on destruction;
EXPECT_CALL(event_dispatcher_, remove_observer(_)).Times(2);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
// If `command` already done, then state should change to `kCompleted`.
command->set_current_state(RequestState::kCompleted);
@@ -173,11 +176,12 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(*mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
.WillOnce(Return(dummy_msg));
+
EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(dummy_msg, Command::CommandOrigin::ORIGIN_SDL));
+ mock_rpc_service_,
+ ManageMobileCommand(dummy_msg, Command::CommandSource::SOURCE_SDL));
command->onTimeOut();
@@ -254,7 +258,7 @@ TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) {
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
command->CreateHMINotification(kInvalidFunctionId, *msg_params);
@@ -269,14 +273,14 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
EXPECT_EQ(kCorrelationId,
command->SendHMIRequest(kInvalidFunctionId, NULL, false));
@@ -287,15 +291,14 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
EXPECT_CALL(event_dispatcher_, add_observer(_, _, _));
EXPECT_EQ(kCorrelationId,
@@ -304,10 +307,10 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(
- am::VehicleData::value_type(kMissedParam, am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMissedParam, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg = CreateMessage();
@@ -348,33 +351,24 @@ TEST_F(CommandRequestImplTest,
}
TEST_F(CommandRequestImplTest,
- CheckAllowedParameters_NoAppWithSameConnectionKey_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
-
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(6u));
- EXPECT_TRUE(command->CheckPermissions());
+ CheckAllowedParameters_NoAppWithSameConnectionKey_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ EXPECT_FALSE(command->CheckPermissions());
}
TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params] = 0u;
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ MessageSharedPtr message = CreateMessage();
+ (*message)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(*app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
.WillOnce(Return(kMobResultSuccess));
EXPECT_TRUE(command->CheckPermissions());
@@ -382,32 +376,31 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
TEST_F(CommandRequestImplTest,
CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params] = 0u;
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ MessageSharedPtr message = CreateMessage();
+ (*message)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
- 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));
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(*mock_app, app_id())
+ .Times(1)
+ .WillRepeatedly(Return(kConnectionKey));
+
+ 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_CALL(mock_message_helper_, CreateBlockedByPoliciesResponse(_, _, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _));
EXPECT_FALSE(command->CheckPermissions());
}
ACTION_P(GetArg3, output) {
- *output = arg3;
+ *output = arg2;
}
TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
@@ -417,15 +410,11 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(*app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ MockAppPtr app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
RPCParams params;
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
.WillOnce(DoAll(GetArg3(&params), Return(kMobResultSuccess)));
EXPECT_TRUE(command->CheckPermissions());
@@ -435,10 +424,10 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg;
@@ -458,7 +447,7 @@ TEST_F(CommandRequestImplTest, SendResponse_TimedOut_UNSUCCESS) {
command->set_current_state(RequestState::kTimedOut);
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
// Args do not affect on anything in this case;
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
@@ -473,7 +462,8 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
EXPECT_TRUE(smart_objects::SmartType_Null == (*msg).getType());
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
// Args do not affect on anything in this case;
@@ -487,10 +477,10 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
TEST_F(CommandRequestImplTest,
SendResponse_AddDisallowedParametersToInfo_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg = CreateMessage();
@@ -503,7 +493,8 @@ TEST_F(CommandRequestImplTest,
kDisallowedParam1);
MessageSharedPtr result;
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
command->SendResponse(true, kMobResultSuccess, NULL, NULL);
@@ -515,6 +506,85 @@ TEST_F(CommandRequestImplTest,
(*result)[strings::msg_params][strings::info].asString().empty());
}
+TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(
+ CommandRequestImpl::HashUpdateMode::kSkipHashUpdate);
+
+ MessageSharedPtr result;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = false;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
} // namespace command_request_impl
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc
index f95b9a49b2..41cc654a24 100644
--- a/src/components/application_manager/test/commands/command_response_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -49,7 +49,7 @@ namespace command_response_impl {
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-using ::utils::SharedPtr;
+
using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::commands::CommandResponseImpl;
@@ -57,7 +57,8 @@ class CommandResponseImplTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>();
+ std::shared_ptr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>();
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
EXPECT_TRUE(command->CleanUp());
@@ -66,7 +67,7 @@ TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
// Do not have a weight in this case
const bool kSuccess = true;
@@ -78,7 +79,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
// then send message to mobile.
(*msg)[strings::msg_params][strings::result_code] = kResultCode;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
}
@@ -86,7 +87,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageValidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -94,7 +95,7 @@ TEST_F(CommandResponseImplTest,
mobile_apis::Result::eType::SUCCESS;
const bool kFinalResponse = true;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
// If `msg_params->result_code` does not exist in message
// and arg `result_code` not equals `INVALID_ENUM`,
@@ -108,7 +109,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -122,7 +123,7 @@ TEST_F(CommandResponseImplTest,
// then set it to `msg_params->result_code` and send message to mobile.
(*msg)[strings::params][hmi_response::code] = mobile_apis::Result::SUCCESS;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
@@ -133,7 +134,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
@@ -147,7 +148,7 @@ TEST_F(CommandResponseImplTest,
// then `msg_params->result_code` will be `SUCCESS`
const bool kSuccess = true;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
@@ -158,7 +159,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
@@ -172,7 +173,7 @@ TEST_F(CommandResponseImplTest,
// then `msg_params->result_code` will be `INVALID_ENUM`
const bool kSuccess = false;
- EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, kFinalResponse));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(msg, kFinalResponse));
command->SendResponse(kSuccess, kResultCode, kFinalResponse);
diff --git a/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
deleted file mode 100644
index 771d13924c..0000000000
--- a/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "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
deleted file mode 100644
index 88efc61816..0000000000
--- a/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace add_statistics_info_notification {
-
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_notification = ::application_manager::hmi_notification;
-using am::commands::MessageSharedPtr;
-using am::commands::AddStatisticsInfoNotification;
-using am::commands::CommandImpl;
-using policy::PolicyHandler;
-using policy_test::MockPolicyHandlerInterface;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-typedef ::utils::SharedPtr<AddStatisticsInfoNotification> NotificationPtr;
-
-namespace {
-const uint32_t kStatisticType = 1u;
-} // namespace
-
-class AddStatisticsInfoNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- protected:
- MockPolicyHandlerInterface policy_handler_;
-};
-
-TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] =
- kStatisticType;
- NotificationPtr command(CreateCommand<AddStatisticsInfoNotification>(msg));
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler_));
- EXPECT_CALL(policy_handler_, AddStatisticsInfo(kStatisticType));
-
- command->Run();
-}
-
-} // namespace add_statistics_info_notification
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
deleted file mode 100644
index 60eced4830..0000000000
--- a/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/commands/command_impl.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace allow_all_apps_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::AllowAllAppsResponse;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef ::utils::SharedPtr<AllowAllAppsResponse> ResponsePtr;
-
-namespace {
-const bool kResponseIsAllowed = true;
-} //
-
-class AllowAllAppsResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed;
-
- ResponsePtr command(CreateCommand<AllowAllAppsResponse>(msg));
-
- EXPECT_CALL(app_mngr_, SetAllAppsAllowed(kResponseIsAllowed));
-
- command->Run();
-}
-
-} // namespace allow_all_apps_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
deleted file mode 100644
index 69b4abe39d..0000000000
--- a/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/mock_application.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace allow_app_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::AllowAppResponse;
-using ::testing::_;
-using ::testing::Return;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const bool kIsResponseAllowed = true;
-}
-
-typedef ::utils::SharedPtr<AllowAppResponse> ResponsePtr;
-
-class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
-
- ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, set_app_allowed(kIsResponseAllowed));
-
- command->Run();
-}
-
-TEST_F(AllowAppResponseTest, Run_AppNotCreated_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
-
- ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
-
- MockAppPtr mock_app;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(MockAppPtr()));
-
- command->Run();
-}
-
-} // namespace allow_app_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
deleted file mode 100644
index b2a8f0858a..0000000000
--- a/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace button_get_capabilities_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::ButtonGetCapabilitiesResponse;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef ::utils::SharedPtr<ButtonGetCapabilitiesResponse> ResponsePtr;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-class ButtonGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateMsgParams() {
- capabilities_[strings::name] = hmi_apis::Common_ButtonName::OK;
- preset_bank_capabilities_ = true;
-
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::capabilities] = (capabilities_);
- (*msg)[strings::msg_params][hmi_response::preset_bank_capabilities] =
- (preset_bank_capabilities_);
-
- return msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
- SmartObject preset_bank_capabilities_;
-};
-
-TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_preset_bank_capabilities(preset_bank_capabilities_));
-
- command->Run();
-}
-
-TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams();
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::ABORTED;
-
- ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
- .Times(0);
- EXPECT_CALL(mock_hmi_capabilities_,
- set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
-
- command->Run();
-}
-
-} // namespace button_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
deleted file mode 100644
index b4a6ea272a..0000000000
--- a/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace close_popup_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-using am::commands::ResponseFromHMI;
-using am::commands::ClosePopupResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(ClosePopupResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg));
-
- command->Run();
-}
-
-} // namespace close_popup_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
deleted file mode 100644
index 7c95a4ca2f..0000000000
--- a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/command_request_test.h"
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-
-#include "application_manager/commands/hmi/allow_all_apps_request.h"
-#include "application_manager/commands/hmi/allow_all_apps_response.h"
-#include "application_manager/commands/hmi/allow_app_request.h"
-#include "application_manager/commands/hmi/allow_app_response.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
-#include "application_manager/commands/hmi/update_device_list_request.h"
-#include "application_manager/commands/hmi/update_device_list_response.h"
-#include "application_manager/commands/hmi/on_update_device_list.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/update_app_list_request.h"
-#include "application_manager/commands/hmi/update_app_list_response.h"
-#include "application_manager/commands/hmi/on_find_applications.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-#include "application_manager/commands/hmi/update_sdl_response.h"
-#include "application_manager/commands/hmi/activate_app_request.h"
-#include "application_manager/commands/hmi/activate_app_response.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/commands/hmi/close_popup_request.h"
-#include "application_manager/commands/hmi/close_popup_response.h"
-#include "application_manager/commands/hmi/button_get_capabilities_request.h"
-#include "application_manager/commands/hmi/button_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_add_command_request.h"
-#include "application_manager/commands/hmi/ui_add_command_response.h"
-#include "application_manager/commands/hmi/ui_delete_command_request.h"
-#include "application_manager/commands/hmi/ui_delete_command_response.h"
-#include "application_manager/commands/hmi/ui_add_submenu_request.h"
-#include "application_manager/commands/hmi/ui_add_submenu_response.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
-#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/ui_get_language_request.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
-#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
-#include "application_manager/commands/hmi/ui_change_registration_request.h"
-#include "application_manager/commands/hmi/ui_change_registration_response.h"
-#include "application_manager/commands/hmi/ui_show_request.h"
-#include "application_manager/commands/hmi/ui_show_response.h"
-#include "application_manager/commands/hmi/ui_alert_request.h"
-#include "application_manager/commands/hmi/ui_alert_response.h"
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/commands/hmi/ui_slider_request.h"
-#include "application_manager/commands/hmi/ui_slider_response.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
-#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
-#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
-#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
-#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
-#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
-#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/commands/hmi/vr_add_command_request.h"
-#include "application_manager/commands/hmi/vr_add_command_response.h"
-#include "application_manager/commands/hmi/vr_delete_command_request.h"
-#include "application_manager/commands/hmi/vr_delete_command_response.h"
-#include "application_manager/commands/hmi/vr_change_registration_request.h"
-#include "application_manager/commands/hmi/vr_change_registration_response.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/vr_get_language_request.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-#include "application_manager/commands/hmi/tts_is_ready_request.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/commands/hmi/tts_change_registration_request.h"
-#include "application_manager/commands/hmi/tts_change_registration_response.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/commands/hmi/tts_get_language_request.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
-#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
-#include "application_manager/commands/hmi/tts_speak_request.h"
-#include "application_manager/commands/hmi/tts_speak_response.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
-#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
-#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-#include "application_manager/commands/hmi/vi_is_ready_response.h"
-#include "application_manager/commands/hmi/vi_read_did_request.h"
-#include "application_manager/commands/hmi/vi_read_did_response.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
-#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
-#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
-#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
-#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
-#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
-#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
-#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
-#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
-#include "application_manager/commands/hmi/navi_get_way_points_request.h"
-#include "application_manager/commands/hmi/navi_get_way_points_response.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-#include "application_manager/commands/hmi/navi_start_stream_response.h"
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_stop_stream_response.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
-#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/add_statistics_info_notification.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/basic_communication_system_request.h"
-#include "application_manager/commands/hmi/basic_communication_system_response.h"
-#include "application_manager/commands/hmi/sdl_policy_update.h"
-#include "application_manager/commands/hmi/sdl_policy_update_response.h"
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/commands/hmi/get_urls_response.h"
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/commands/hmi/navi_send_location_request.h"
-#include "application_manager/commands/hmi/navi_send_location_response.h"
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/dial_number_request.h"
-#include "application_manager/commands/hmi/dial_number_response.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "application_manager/commands/hmi/ui_set_icon_request.h"
-
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace am = application_manager;
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace dummy_hmi_commands_test {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-using commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::MockApplicationManager;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
-
-template <class Command>
-class HMICommandsTest : public components::commands_test::CommandRequestTest<
- CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- stream_retry_.first = 0;
- stream_retry_.second = 0;
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
- ON_CALL(app_mngr_settings_, start_stream_retry_amount())
- .WillByDefault(ReturnRef(stream_retry_));
- }
-
- protected:
- std::pair<uint32_t, int32_t> stream_retry_;
-};
-
-template <class Command>
-class HMICommandsTestFirst : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestSecond : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestThird : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestFourth : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class HMICommandsTestFifth : public HMICommandsTest<Command> {
- public:
- using typename HMICommandsTest<Command>::CommandType;
-};
-
-/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
- * TYPED_TEST_CASE for HMI and mobile commands
- */
-
-typedef Types<commands::OnStartDeviceDiscovery,
- commands::UpdateDeviceListResponse,
- commands::UpdateDeviceListRequest,
- commands::ActivateAppResponse,
- commands::ActivateAppRequest,
- commands::GetSystemInfoResponse,
- commands::GetSystemInfoRequest,
- commands::SDLActivateAppResponse,
- commands::SDLActivateAppRequest,
- commands::SDLPolicyUpdateResponse,
- commands::SDLPolicyUpdate,
- commands::GetUrlsResponse,
- commands::GetUrls,
- commands::OnAppPermissionChangedNotification,
- commands::SDLGetListOfPermissionsResponse,
- commands::SDLGetListOfPermissionsRequest,
- commands::SDLGetUserFriendlyMessageResponse,
- commands::SDLGetUserFriendlyMessageRequest,
- commands::SDLGetStatusUpdateResponse,
- commands::SDLGetStatusUpdateRequest,
- commands::OnStatusUpdateNotification,
- commands::OnAppPermissionConsentNotification,
- commands::MixingAudioSupportedResponse,
- commands::MixingAudioSupportedRequest,
- commands::OnExitAllApplicationsNotification,
- commands::UIAddCommandResponse,
- commands::UIAddCommandRequest,
- commands::UIDeleteCommandResponse,
- commands::UIDeleteCommandRequest,
- commands::UIAddSubmenuResponse,
- commands::UIAddSubmenuRequest,
- commands::UIDeleteSubmenuResponse,
- commands::UIDeleteSubmenuRequest,
- commands::UISetMediaClockTimerResponse,
- commands::UISetMediaClockTimerRequest,
- commands::UIPerformInteractionResponse,
- commands::UIPerformInteractionRequest,
- commands::UISetGlobalPropertiesResponse,
- commands::UISetGlobalPropertiesRequest,
- commands::UIScrollableMessageResponse,
- commands::UIScrollableMessageRequest,
- commands::UISetAppIconResponse,
- commands::UISetAppIconRequest,
- commands::UIGetSupportedLanguagesResponse,
- commands::UIGetSupportedLanguagesRequest,
- commands::UIGetLanguageResponse,
- commands::UIGetLanguageRequest,
- commands::UIGetCapabilitiesResponse,
- commands::UIGetCapabilitiesRequest,
- commands::UIChangeRegistratioResponse> HMICommandsListFirst;
-
-typedef Types<commands::UIChangeRegistrationRequest,
- commands::UIPerformAudioPassThruResponse,
- commands::UIPerformAudioPassThruRequest,
- commands::UIEndAudioPassThruResponse,
- commands::UIEndAudioPassThruRequest,
- commands::UIAlertResponse,
- commands::UIAlertRequest,
- commands::VRIsReadyResponse,
- commands::VRIsReadyRequest,
- commands::VRAddCommandResponse,
- commands::VRAddCommandRequest,
- commands::VRDeleteCommandResponse,
- commands::VRDeleteCommandRequest,
- commands::VRChangeRegistrationResponse,
- commands::VRChangeRegistrationRequest,
- commands::VRGetSupportedLanguagesResponse,
- commands::VRGetSupportedLanguagesRequest,
- commands::VRGetLanguageResponse,
- commands::VRGetLanguageRequest,
- commands::VRGetCapabilitiesResponse,
- commands::VRGetCapabilitiesRequest,
- commands::TTSIsReadyResponse,
- commands::TTSIsReadyRequest,
- commands::TTSChangeRegistratioResponse,
- commands::TTSChangeRegistrationRequest,
- commands::TTSGetSupportedLanguagesResponse,
- commands::TTSGetSupportedLanguagesRequest,
- commands::TTSStopSpeakingResponse,
- commands::TTSStopSpeakingRequest,
- commands::TTSGetLanguageResponse,
- commands::TTSGetLanguageRequest,
- commands::TTSSpeakResponse,
- commands::TTSSpeakRequest,
- commands::TTSSetGlobalPropertiesResponse,
- commands::TTSSetGlobalPropertiesRequest,
- commands::TTSGetCapabilitiesResponse,
- commands::TTSGetCapabilitiesRequest,
- commands::OnTTSStartedNotification,
- commands::OnTTSStoppedNotification,
- commands::OnAppActivatedNotification,
- commands::OnExitApplicationNotification,
- commands::UIShowResponse,
- commands::UIShowRequest,
- commands::UISliderResponse,
- commands::UISliderRequest,
- commands::ClosePopupResponse,
- commands::ClosePopupRequest,
- commands::UIIsReadyResponse,
- commands::UIIsReadyRequest,
- commands::VIIsReadyResponse> HMICommandsListSecond;
-
-typedef Types<commands::VIIsReadyRequest,
- commands::VIReadDIDResponse,
- commands::VIReadDIDRequest,
- commands::VIGetVehicleDataResponse,
- commands::VIGetVehicleDataRequest,
- commands::VIGetDTCsResponse,
- commands::VIGetDTCsRequest,
- commands::VIDiagnosticMessageResponse,
- commands::VIDiagnosticMessageRequest,
- commands::VIGetVehicleTypeResponse,
- commands::VIGetVehicleTypeRequest,
- commands::NaviIsReadyResponse,
- commands::NaviIsReadyRequest,
- commands::NaviAlertManeuverResponse,
- commands::NaviAlertManeuverRequest,
- commands::NaviGetWayPointsResponse,
- commands::NaviGetWayPointsRequest,
- commands::NaviUpdateTurnListResponse,
- commands::NaviUpdateTurnListRequest,
- commands::NaviShowConstantTBTResponse,
- commands::NaviShowConstantTBTRequest,
- commands::NaviSubscribeWayPointsResponse,
- commands::NaviSubscribeWayPointsRequest,
- commands::NaviUnsubscribeWayPointsResponse,
- commands::NaviUnSubscribeWayPointsRequest,
- commands::ButtonGetCapabilitiesResponse,
- commands::ButtonGetCapabilitiesRequest,
- commands::OnAllowSDLFunctionalityNotification,
- commands::OnSDLConsentNeededNotification,
- commands::UpdateSDLResponse,
- commands::UpdateSDLRequest,
- commands::OnIgnitionCycleOverNotification,
- commands::OnSystemInfoChangedNotification,
- commands::OnReadyNotification,
- commands::OnDeviceChosenNotification,
- commands::OnSystemContextNotification,
- commands::hmi::OnDriverDistractionNotification,
- commands::OnUpdateDeviceList,
- commands::OnAppRegisteredNotification,
- commands::OnAppUnregisteredNotification,
- commands::OnFindApplications,
- commands::UpdateAppListResponse,
- commands::UpdateAppListRequest,
- commands::OnVRStartedNotification,
- commands::OnVRStoppedNotification,
- commands::OnVRCommandNotification,
- commands::OnUICommandNotification,
- commands::OnAppDeactivatedNotification> HMICommandsListThird;
-
-typedef Types<commands::hmi::OnButtonEventNotification,
- commands::hmi::OnButtonPressNotification,
- commands::hmi::OnButtonSubscriptionNotification,
- commands::VISubscribeVehicleDataResponse,
- commands::VISubscribeVehicleDataRequest,
- commands::VIUnsubscribeVehicleDataResponse,
- commands::VIUnsubscribeVehicleDataRequest,
- commands::OnVIVehicleDataNotification,
- commands::OnNaviTBTClientStateNotification,
- commands::hmi::OnUIKeyBoardInputNotification,
- commands::hmi::OnUITouchEventNotification,
- commands::hmi::OnUIResetTimeoutNotification,
- commands::NaviStartStreamResponse,
- commands::NaviStartStreamRequest,
- commands::NaviStopStreamResponse,
- commands::NaviStopStreamRequest,
- commands::AudioStartStreamResponse,
- commands::AudioStartStreamRequest,
- commands::AudioStopStreamResponse,
- commands::AudioStopStreamRequest,
- commands::OnAudioDataStreamingNotification,
- commands::OnVideoDataStreamingNotification,
- commands::VRPerformInteractionResponse,
- commands::VRPerformInteractionRequest,
- commands::OnSystemRequestNotification,
- commands::OnPutFileNotification,
- commands::OnResumeAudioSourceNotification,
- commands::UiSetDisplayLayoutResponse,
- commands::UiSetDisplayLayoutRequest,
- commands::OnSDLCloseNotification,
- commands::OnSDLPersistenceCompleteNotification,
- commands::OnFileRemovedNotification,
- commands::OnRecordStartdNotification,
- commands::BasicCommunicationSystemResponse,
- commands::BasicCommunicationSystemRequest,
- commands::NaviSendLocationResponse,
- commands::NaviSendLocationRequest,
- commands::AddStatisticsInfoNotification,
- commands::OnSystemErrorNotification,
- commands::OnReceivedPolicyUpdate,
- commands::OnPolicyUpdate,
- commands::OnDeviceStateChangedNotification,
- commands::hmi::OnTTSResetTimeoutNotification,
- commands::hmi::DialNumberResponse,
- commands::hmi::DialNumberRequest,
- commands::OnEventChangedNotification,
- commands::OnNaviWayPointChangeNotification,
- commands::OnUILanguageChangeNotification,
- commands::OnVRLanguageChangeNotification,
- commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
-
-typedef Types<commands::OnVIGpsDataNotification,
- commands::OnVISpeedNotification,
- commands::OnVIRpmNotification,
- commands::OnVIFuelLevelNotification,
- commands::OnVIFuelLevelStateNotification,
- commands::OnVIInstantFuelConsumptionNotification,
- commands::OnVIExternalTemperatureNotification,
- commands::OnVIVinNotification,
- commands::OnVIPrndlNotification,
- commands::OnVITirePressureNotification,
- commands::OnVIOdometerNotification,
- commands::OnVIBeltStatusNotification,
- commands::OnVIBodyInformationNotification,
- commands::OnVIDeviceStatusNotification,
- commands::OnVIDriverBrakingNotification,
- commands::OnVIWiperStatusNotification,
- commands::OnVIHeadLampStatusNotification,
- commands::OnVIEngineTorqueNotification,
- commands::OnVIAccPedalPositionNotification,
- commands::OnVISteeringWheelAngleNotification,
- commands::OnVIMyKeyNotification,
- commands::AllowAllAppsRequest,
- commands::AllowAllAppsResponse,
- commands::AllowAppRequest,
- commands::AllowAppResponse> HMICommandsListFifth;
-
-TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
-TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
-TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird);
-TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
-TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
-
-TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-} // namespace dummy_hmi_commands_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
deleted file mode 100644
index e8c88256c3..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-#include "application_manager/commands/hmi/get_system_info_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_system_info_request {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestToHMI;
-using am::commands::GetSystemInfoRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-} // namespace
-
-class GetSystemInfoRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
-
- RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
-
- const uint32_t kAppId = command->application_id();
-
- EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::msg_params][strings::app_id].asUInt(),
- kAppId);
- EXPECT_EQ((*command_msg)[strings::params][strings::correlation_id].asUInt(),
- kCorrelationId);
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace get_system_info_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
deleted file mode 100644
index 0fe76ae16d..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/get_system_info_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_system_info_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::GetSystemInfoResponse;
-using am::commands::CommandImpl;
-using am::commands::SystemInfo;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string ccpu_version("4.1.3.B_EB355B");
-const std::string wers_country_code("WAEGB");
-const uint32_t lang_code = 0u;
-const std::string kLanguage = "";
-} // namespace
-
-class GetSystemInfoResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::msg_params]["ccpu_version"] = ccpu_version;
- (*command_msg)[strings::msg_params]["wersCountryCode"] = wers_country_code;
- (*command_msg)[strings::msg_params]["language"] = lang_code;
-
- return command_msg;
- }
-
- 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
deleted file mode 100644
index 5a41cae7ce..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_to_hmi.h"
-#include "application_manager/commands/hmi/get_urls_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_urls_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::ResponseToHMI;
-using am::commands::GetUrlsResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseToHMI> ResponseToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class GetUrlResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(GetUrlResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- ResponseToHMIPtr command(CreateCommand<GetUrlsResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace get_urls_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/test/commands/hmi/get_urls_test.cc
deleted file mode 100644
index 9430dc045c..0000000000
--- a/src/components/application_manager/test/commands/hmi/get_urls_test.cc
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/message.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/commands/hmi/get_urls.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "hmi/request_from_hmi.h"
-#include "policy/mock_policy_manager.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace get_urls {
-
-using namespace hmi_apis;
-using namespace policy;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-using ::testing::SetArgReferee;
-using ::test::components::application_manager_test::MockApplication;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestFromHMI;
-using am::commands::GetUrls;
-using am::commands::CommandImpl;
-using policy::PolicyHandler;
-using policy_test::MockPolicyHandlerInterface;
-
-typedef SharedPtr<RequestFromHMI> RequestFromHMIPtr;
-
-namespace {
-const uint32_t kInvalidAppId_ = 0u;
-const uint32_t kAppIdForSending = 1u;
-const uint32_t kConnectionKey = 2u;
-const uint32_t kServiceType = 0u;
-const std::string kInitialService = "0x0";
-const std::string kPolicyService = "7";
-const std::string kDefaultUrl = "URL is not found";
-const std::string kDefaultId = "default";
-const std::string kPolicyAppId = "policy_app_id";
-} // namespace
-
-class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- policy_test::MockPolicyHandlerInterface mock_policy_handler_;
- MessageSharedPtr command_msg_;
- RequestFromHMIPtr request_command_;
-
- GetUrlsTest() {
- command_msg_ =
- CreateMessage(NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
- (*command_msg_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kInitialService;
-
- request_command_ = CreateCommand<GetUrls>(command_msg_);
-
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- }
-};
-
-TEST_F(GetUrlsTest, RUN_SUCCESS) {
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- request_command_->Run();
-}
-
-TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
- EndpointUrls endpoints_;
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-#ifdef EXTENDED_POLICY
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr mock_app = CreateMockApp();
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending));
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::SUCCESS,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-
- EXPECT_EQ(kAppIdForSending,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::app_id].asInt());
- EXPECT_EQ(kDefaultUrl,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [strings::url].asString());
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kInvalidAppId_));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
-
- request_command_->Run();
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr invalid_mock_app;
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(invalid_mock_app));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-
-TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
- kPolicyService;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- data.app_id = kPolicyAppId;
- endpoints_.push_back(data);
-
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- MockAppPtr mock_app = CreateMockApp();
-
- EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
- .WillOnce(Return(kAppIdForSending));
-
- EXPECT_CALL(app_mngr_, application(kAppIdForSending))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
-
- EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
-
- EXPECT_EQ(am::MessageType::kResponse,
- (*command_msg_)[strings::params][strings::message_type].asInt());
- EXPECT_EQ(Common_Result::SUCCESS,
- (*command_msg_)[strings::params][am::hmi_response::code].asInt());
-}
-#endif
-
-TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
- kDefaultUrl;
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id] = "1";
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
-
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- data.app_id = "1";
- endpoints_.push_back(data);
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
-
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
- EXPECT_EQ(kDefaultUrl,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::strings::url].asString());
- EXPECT_EQ(endpoints_[0].app_id,
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id].asString());
-}
-
-TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
- kDefaultUrl;
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- [am::hmi_response::policy_app_id] = kDefaultId;
-
- EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
- EndpointUrls endpoints_;
- EndpointData data(kDefaultUrl);
- endpoints_.push_back(data);
- EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
- .WillOnce(SetArgReferee<1>(endpoints_));
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application_by_policy_id(_))
- .WillOnce(Return(mock_app));
- request_command_->Run();
-
- EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
- am::hmi_request::service));
- EXPECT_TRUE(
- (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
- .keyExists(am::hmi_response::policy_app_id));
-}
-
-} // namespace get_urls
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
deleted file mode 100644
index 4a9aa4a771..0000000000
--- a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
+++ /dev/null
@@ -1,1926 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-
-#include "application_manager/commands/hmi/on_button_event_notification.h"
-#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
-#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
-#include "application_manager/commands/hmi/on_ui_command_notification.h"
-#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
-#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
-#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
-#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
-#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
-#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
-#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
-#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
-#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
-#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
-#include "application_manager/commands/hmi/on_vi_speed_notification.h"
-#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
-#include "application_manager/commands/hmi/on_vi_vin_notification.h"
-#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
-#include "application_manager/commands/hmi/on_app_registered_notification.h"
-#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_button_subscription_notification.h"
-#include "application_manager/commands/hmi/on_file_removed_notification.h"
-#include "application_manager/commands/hmi/on_put_file_notification.h"
-#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
-#include "application_manager/commands/hmi/on_sdl_close_notification.h"
-#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
-#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
-#include "application_manager/commands/hmi/on_status_update_notification.h"
-#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
-#include "application_manager/commands/hmi/on_record_start_notification.h"
-#include "application_manager/commands/hmi/on_app_activated_notification.h"
-#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
-#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
-#include "application_manager/commands/hmi/on_button_press_notification.h"
-#include "application_manager/commands/hmi/on_event_changed_notification.h"
-#include "application_manager/commands/hmi/on_ready_notification.h"
-#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/on_tts_started_notification.h"
-#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
-#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
-#include "application_manager/commands/hmi/on_vr_started_notification.h"
-#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
-#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
-#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
-#include "application_manager/commands/hmi/on_policy_update.h"
-#include "application_manager/commands/hmi/on_received_policy_update.h"
-#include "application_manager/commands/hmi/on_system_error_notification.h"
-#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
-#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
-#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
-#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
-#include "application_manager/commands/hmi/on_exit_application_notification.h"
-#include "application_manager/commands/hmi/on_vr_command_notification.h"
-#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
-#include "application_manager/commands/hmi/on_start_device_discovery.h"
-#include "application_manager/commands/hmi/on_device_chosen_notification.h"
-#include "application_manager/commands/hmi/on_system_context_notification.h"
-#include "application_manager/commands/hmi/on_system_request_notification.h"
-#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
-#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
-#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
-
-#include "utils/lock.h"
-#include "utils/data_accessor.h"
-#include "utils/signals.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_state_controller.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/hmi_capabilities_impl.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "transport_manager/mock_transport_manager.h"
-#include "connection_handler/mock_connection_handler.h"
-#include "connection_handler/mock_connection_handler_settings.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "protocol_handler/mock_session_observer.h"
-
-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());
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
- .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());
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
- .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());
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
- .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());
- EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
- .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
deleted file mode 100644
index 322f7dd398..0000000000
--- a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "hmi/request_to_hmi.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace mixing_audio_supported_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::RequestToHMI;
-using am::commands::MixingAudioSupportedRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class MixingAudioSupportedRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- RequestToHMIPtr command(
- CreateCommand<MixingAudioSupportedRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace mixing_audio_supported_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
deleted file mode 100644
index 89ba6c8bdb..0000000000
--- a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace mixing_audio_supported_response {
-
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::ResponseFromHMI;
-using am::commands::MixingAudioSupportedResponse;
-using am::commands::CommandImpl;
-using am::HMICapabilities;
-namespace hmi_response = ::application_manager::hmi_response;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class MixingAudioSupportedResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- ResponseFromHMIPtr command(
- CreateCommand<MixingAudioSupportedResponse>(command_msg));
- MockHMICapabilities mock_hmi_capabilities;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
-
- const bool hmiResponse =
- (*command_msg)[strings::msg_params][hmi_response::attenuated_supported]
- .asBool();
-
- EXPECT_CALL(mock_hmi_capabilities, set_attenuated_supported(hmiResponse));
-
- command->Run();
-}
-
-} // namespace mixing_audio_supported_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
deleted file mode 100644
index e590412204..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <utility>
-
-#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_audio_start_stream_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using commands::AudioStartStreamRequest;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kHmiAppId = 13u;
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-class AudioStartStreamRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- AudioStartStreamRequestTest() {
- ON_CALL(app_mngr_, 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
deleted file mode 100644
index b08bf6e515..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::NaviIsReadyRequest;
-using am::event_engine::Event;
-
-namespace {
-const hmi_apis::FunctionID::eType kEventID =
- hmi_apis::FunctionID::Navigation_IsReady;
-} // namespace
-
-typedef SharedPtr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
-
-class NaviIsReadyRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(mock_hmi_capabilities_));
- 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
deleted file mode 100644
index 7185a5f7ed..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/commands/hmi/navi_is_ready_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_is_ready_responce {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::ReturnRef;
-using ::utils::SharedPtr;
-using commands::ResponseFromHMI;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class NaviIsReadyResponseTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>());
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
- command->Run();
-}
-
-} // namespace navi_is_ready_responce
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
deleted file mode 100644
index 8a157c9a0f..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <utility>
-
-#include "application_manager/commands/hmi/navi_start_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_start_stream_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using commands::NaviStartStreamRequest;
-using am::event_engine::Event;
-
-namespace {
-const uint32_t kHmiAppId = 13u;
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-class NaviStartStreamRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviStartStreamRequestTest() {
- ON_CALL(app_mngr_, 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
deleted file mode 100644
index 91b781c1ff..0000000000
--- a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/navi_stop_stream_request.h"
-#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace navi_stop_stream_requests {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace commands = am::commands;
-using commands::MessageSharedPtr;
-using am::event_engine::Event;
-
-namespace {
-const am::HmiInterfaces::InterfaceID kHmiInterface =
- am::HmiInterfaces::HMI_INTERFACE_Navigation;
-} // namespace
-
-template <typename Command>
-class NaviStopStreamRequestsTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- NaviStopStreamRequestsTest() {
- ON_CALL(this->app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
- msg_ = CreateMessage();
- command_ = CreateCommand<Command>(msg_);
- }
-
- MessageSharedPtr msg_;
- SharedPtr<Command> command_;
- 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
deleted file mode 100644
index 94dd1c6599..0000000000
--- a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "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
deleted file mode 100644
index 8ee86f098d..0000000000
--- a/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "hmi/response_from_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace response_from_hmi {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::SaveArg;
-using ::testing::DoAll;
-
-using ::utils::SharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-
-namespace am = ::application_manager;
-
-using am::commands::ResponseFromHMI;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-
-class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_NO_THROW(command->Run());
- EXPECT_TRUE(command->CleanUp());
-}
-
-TEST_F(ResponseFromHMITest, SendResponseToMobile_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(msg, _));
-
- command->SendResponseToMobile(msg, app_mngr_);
-
- const application_manager::MessageType received_message_tipe =
- static_cast<application_manager::MessageType>(
- (*msg)[am::strings::params][am::strings::message_type].asInt());
-
- EXPECT_EQ(application_manager::MessageType::kResponse, received_message_tipe);
-}
-
-TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr result_msg;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
-
- const hmi_apis::FunctionID::eType posted_function_id =
- hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr dummy_msg_params = CreateMessage();
- command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
-
- ASSERT_TRUE(result_msg);
-
- const application_manager::MessageType received_message_tipe =
- static_cast<application_manager::MessageType>(
- (*result_msg)[am::strings::params][am::strings::message_type]
- .asInt());
-
- EXPECT_EQ(am::MessageType::kRequest, received_message_tipe);
-
- const hmi_apis::FunctionID::eType received_function_id =
- static_cast<hmi_apis::FunctionID::eType>(
- (*result_msg)[am::strings::params][am::strings::function_id].asInt());
-
- EXPECT_EQ(posted_function_id, received_function_id);
-}
-
-TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
- ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
-
- MessageSharedPtr result_msg;
- ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
-
- const hmi_apis::FunctionID::eType posted_function_id =
- hmi_apis::FunctionID::INVALID_ENUM;
- MessageSharedPtr dummy_msg_params = CreateMessage();
- command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
-}
-
-} // namespace response_from_hmi
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
deleted file mode 100644
index eeae0422d1..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/lock.h"
-#include "utils/helpers.h"
-#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_state_controller.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_activate_app_request {
-
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::MessageSharedPtr;
-using am::commands::SDLActivateAppRequest;
-using am::ApplicationSet;
-using testing::Mock;
-using testing::Return;
-using testing::ReturnRef;
-using testing::Mock;
-using ::testing::NiceMock;
-using 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
deleted file mode 100644
index 5dff55f7c3..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_activate_app_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::SDLActivateAppResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class SDLActivateAppResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- SDLActivateAppResponsePtr command(
- CreateCommand<SDLActivateAppResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace sdl_activate_app_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
deleted file mode 100644
index 1bcdaebb35..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_get_list_of_permissions_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SDLGetListOfPermissionsRequest;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using smart_objects::SmartObject;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-const uint32_t kAppID = 2u;
-const uint32_t kConnectionKey = 0u;
-} // namespace
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-class SDLGetListOfPermissionsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- mock_app_ = CreateMockApp();
- }
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
- ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
- }
- MockAppPtr mock_app_;
-};
-
-TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- (*msg)[strings::msg_params][strings::app_id] = kAppID;
-
- EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
- .WillOnce(Return(mock_app_));
-
- SharedPtr<SDLGetListOfPermissionsRequest> command(
- CreateCommand<SDLGetListOfPermissionsRequest>(msg));
-
- MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, OnGetListOfPermissions(kAppID, kCorrelationID));
-
- command->Run();
-}
-
-TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
-
- SharedPtr<SDLGetListOfPermissionsRequest> command(
- CreateCommand<SDLGetListOfPermissionsRequest>(msg));
-
- MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler,
- OnGetListOfPermissions(kConnectionKey, kCorrelationID));
-
- command->Run();
-}
-
-} // namespace sdl_get_list_of_permissions_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
deleted file mode 100644
index 988cdd18c7..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace sdl_get_status_update_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SDLGetStatusUpdateRequest;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using testing::Return;
-using testing::ReturnRef;
-
-namespace {
-const uint32_t kCorrelationID = 1u;
-} // namespace
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-class SDLGetStatusUpdateRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
-
- SharedPtr<SDLGetStatusUpdateRequest> command(
- CreateCommand<SDLGetStatusUpdateRequest>(msg));
-
- MockPolicyHandlerInterface mock_policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_policy_handler, OnGetStatusUpdate(kCorrelationID));
-
- command->Run();
-}
-
-} // namespace sdl_get_status_update_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
deleted file mode 100644
index 5ef54f7be5..0000000000
--- a/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <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
deleted file mode 100644
index 9d7441fef7..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-
-#include "commands/commands_test.h"
-
-#include "hmi/notification_to_hmi.h"
-#include "application_manager/commands/command_notification_impl.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_notifications_test {
-
-using namespace application_manager;
-
-using ::testing::Types;
-
-template <typename Command>
-class SimpleNotificationsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::CommandNotificationImpl, commands::NotificationToHMI>
- CommandsList;
-
-TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
-
-TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_NO_THROW(command->Run());
- EXPECT_TRUE(command->CleanUp());
-}
-
-} // namespace simple_notifications_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
deleted file mode 100644
index 4f7a7a9f72..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "hmi/request_from_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_requests_from_hmi_test {
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
-using ::testing::NiceMock;
-
-using ::utils::SharedPtr;
-namespace commands = ::application_manager::commands;
-using commands::MessageSharedPtr;
-using ::application_manager::event_engine::EventObserver;
-using ::test::components::event_engine_test::MockEventDispatcher;
-
-class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- }
- NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
-};
-
-TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
- CreateCommand<commands::RequestFromHMI>());
- application_manager::event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_ActivateApp);
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_TRUE(command->CleanUp());
- EXPECT_NO_THROW(command->Run());
- EXPECT_NO_THROW(command->on_event(event));
-}
-
-TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
- CreateCommand<commands::RequestFromHMI>());
-
- const bool success = false;
- const uint32_t correlation_id = 1u;
- EXPECT_CALL(app_mngr_, ManageHMICommand(NotNull()));
-
- command->SendResponse(success,
- correlation_id,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- hmi_apis::Common_Result::SUCCESS);
-}
-
-} // namespace simple_requests_to_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
deleted file mode 100644
index f444e45a6c..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_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
deleted file mode 100644
index 7e55b8b834..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "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
deleted file mode 100644
index 3948d2bfe3..0000000000
--- a/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/commands/hmi/sdl_activate_app_response.h"
-#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
-#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
-#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
-#include "application_manager/commands/hmi/response_to_hmi.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace simple_response_to_hmi_test {
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::NotNull;
-using ::utils::SharedPtr;
-
-namespace commands = ::application_manager::commands;
-using commands::MessageSharedPtr;
-
-template <class Command>
-class ResponseToHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::SDLActivateAppResponse,
- commands::SDLGetListOfPermissionsResponse,
- commands::SDLGetStatusUpdateResponse,
- commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
-
-TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
-
-TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
- typedef typename TestFixture::CommandType CommandType;
-
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
-
- EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::ResponseToHMI> command(
- CreateCommand<commands::ResponseToHMI>());
-
- // Current implementation always return `true`
- EXPECT_TRUE(command->Init());
- EXPECT_TRUE(command->CleanUp());
-}
-
-TEST_F(ResponseToHMITest, Run_SUCCESS) {
- SharedPtr<commands::ResponseToHMI> command(
- CreateCommand<commands::ResponseToHMI>());
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(NotNull()));
-
- command->Run();
-}
-
-} // namespace simple_response_to_hmi_test
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
deleted file mode 100644
index c7b5c76b40..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_capabilities_response {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::TTSGetCapabilitiesResponse;
-using test::components::application_manager_test::MockHMICapabilities;
-using utils::SharedPtr;
-using testing::_;
-
-namespace strings = ::application_manager::strings;
-namespace hmi_response = ::application_manager::hmi_response;
-
-namespace {
-const std::string kText = "TEXT";
-}
-
-class TTSGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
-};
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
- (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
- kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_speech_capabilities(SmartObject(kText)));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_prerecorded_speech(SmartObject(kText)));
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_,
- set_speech_capabilities(SmartObject(kText)));
- EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
- kText;
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_,
- set_prerecorded_speech(SmartObject(kText)));
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
- EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
- EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
-
- SharedPtr<TTSGetCapabilitiesResponse> command(
- CreateCommand<TTSGetCapabilitiesResponse>(msg));
-
- command->Run();
-}
-
-} // namespace tts_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
deleted file mode 100644
index e0b2fad5b9..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/tts_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "commands/commands_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::TTSGetLanguageResponse;
-using test::components::application_manager_test::MockHMICapabilities;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-namespace {
-const Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class TTSGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<TTSGetLanguageResponse> command(
- CreateCommand<TTSGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_tts_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<TTSGetLanguageResponse> command(
- CreateCommand<TTSGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_tts_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace tts_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
deleted file mode 100644
index 547fc02481..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_get_supported_languages_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::TTSGetSupportedLanguagesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class TTSGetSupportedLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) {
- smart_objects::SmartObject supported_languages("EN_US");
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- ResponseFromHMIPtr command(
- CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_tts_supported_languages((
- *command_msg)[strings::msg_params][hmi_response::languages]));
-
- command->Run();
-}
-TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
- smart_objects::SmartObject supported_languages("EN_US");
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- ResponseFromHMIPtr command(
- CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_tts_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace tts_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
deleted file mode 100644
index 52c66ff877..0000000000
--- a/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/commands/hmi/tts_is_ready_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace tts_is_ready_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::ResponseFromHMI;
-using am::commands::TTSIsReadyResponse;
-using am::commands::CommandImpl;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const bool kIsAvailable = true;
-const bool kIsNotAvailable = false;
-} // namespace
-
-class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) {
- ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>());
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace tts_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
deleted file mode 100644
index 11162f9a03..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <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
deleted file mode 100644
index e45e4583e5..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/ui_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::UIGetLanguageResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class UIGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<UIGetLanguageResponse> command(
- CreateCommand<UIGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_ui_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<UIGetLanguageResponse> command(
- CreateCommand<UIGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_ui_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace ui_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
deleted file mode 100644
index 690c863ccb..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/application.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_get_supported_languages_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::UIGetSupportedLanguagesResponse;
-
-typedef SharedPtr<UIGetSupportedLanguagesResponse>
- UIGetSupportedLanguagesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const std::string kLanguage = "EN_US";
-const smart_objects::SmartObject supported_languages(kLanguage);
-} // namespace
-
-class UIGetSupportedLanguagesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- UIGetSupportedLanguagesResponsePtr command(
- CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_ui_supported_languages((supported_languages)));
-
- command->Run();
-}
-TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- UIGetSupportedLanguagesResponsePtr command(
- CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_ui_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace ui_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
deleted file mode 100644
index 2759a8a19e..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/ui_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_is_ready_request {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::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
deleted file mode 100644
index d69ec0528e..0000000000
--- a/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/ui_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace ui_is_ready_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::UIIsReadyResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<UIIsReadyResponse> UIIsReadyResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const bool kIsAvailable = true;
-const bool kIsNotAvailable = false;
-} // namespace
-
-class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) {
- UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace ui_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
deleted file mode 100644
index 99eed48f71..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/request_controller_settings.h"
-#include "application_manager/mock_application_manager_settings.h"
-#include "application_manager/commands/hmi/update_device_list_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_device_list_request {
-
-using ::utils::SharedPtr;
-using testing::_;
-using testing::ReturnRef;
-using testing::Return;
-using test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::event_engine::Event;
-using am::commands::UpdateDeviceListRequest;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class UpdateDeviceListRequestTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
-
- return command_msg;
- }
-
- MockApplicationManagerSettings settings_;
- MockEventDispatcher mock_event_dispatcher_;
-};
-
-TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
- MessageSharedPtr command_msg = CreateCommandMsg();
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(
- CreateCommand<UpdateDeviceListRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
-
- EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(false));
-
- EXPECT_CALL(app_mngr_, IsHMICooperating()).Times(0);
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(
- CreateCommand<UpdateDeviceListRequest>(command_msg));
-
- EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
-
- EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, IsHMICooperating()).WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-TEST_F(UpdateDeviceListRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
-
- command->on_event(event);
-}
-
-TEST_F(UpdateDeviceListRequestTest, OnEvent_SUCCESS) {
- Event event(Event::EventID::BasicCommunication_OnReady);
-
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher_));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_, _));
- EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
-
- UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
-
- command->on_event(event);
-}
-
-} // namespace update_device_list_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
deleted file mode 100644
index e9bf402aa7..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/commands/hmi/update_sdl_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_sdl_request {
-
-using ::utils::SharedPtr;
-using ::testing::ReturnRef;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::UpdateSDLRequest;
-
-typedef SharedPtr<UpdateSDLRequest> UpdateSDLRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
-
- UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
- policy_test::MockPolicyHandlerInterface policy_handler;
-
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, PTExchangeAtUserRequest(kCorrelationId));
-
- command->Run();
-
- EXPECT_EQ(kCorrelationId,
- (*command_msg)[strings::params][strings::correlation_id].asUInt());
-}
-
-} // namespace update_sdl_request
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
deleted file mode 100644
index e612f438cc..0000000000
--- a/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "hmi/update_sdl_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace update_sdl_response {
-
-using ::utils::SharedPtr;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-using am::commands::UpdateSDLResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<UpdateSDLResponse> UpdateSDLResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- UpdateSDLResponsePtr command(CreateCommand<UpdateSDLResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
-
- command->Run();
-
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
- CommandImpl::hmi_protocol_type_);
- EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
- CommandImpl::protocol_version_);
-}
-
-} // namespace update_sdl_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
deleted file mode 100644
index e61f90a2fa..0000000000
--- a/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "commands/commands_test.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/vi_get_vehicle_data_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vi_get_vehicle_data_response {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::MessageSharedPtr;
-using am::commands::VIGetVehicleDataResponse;
-using am::event_engine::Event;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const uint32_t kCorrelationId = 1u;
-const std::string kStrNumber = "123";
-} // namespace
-
-class VIGetVehicleDataResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::message_type] =
- hmi_apis::messageType::response;
-
- VIGetVehicleDataResponsePtr command(
- CreateCommand<VIGetVehicleDataResponse>(command_msg));
-
- am::event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- event.set_smart_object(*command_msg);
-
- policy_test::MockPolicyHandlerInterface policy_handler;
- EXPECT_CALL(app_mngr_, GetPolicyHandler())
- .WillOnce(ReturnRef(policy_handler));
- EXPECT_CALL(policy_handler, OnVehicleDataUpdated(*command_msg));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(VIGetVehicleDataResponseTest, ErrorResponse_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][strings::message_type] =
- hmi_apis::messageType::error_response;
- (*command_msg)[strings::params][strings::data][strings::slider_position] = 1;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
- (*command_msg)[am::strings::params][am::strings::error_msg] = "test_error";
- (*command_msg)[am::strings::params][am::strings::protocol_type] =
- am::commands::CommandImpl::hmi_protocol_type_;
- (*command_msg)[strings::params][strings::protocol_version] =
- am::commands::CommandImpl::protocol_version_;
-
- smart_objects::SmartObject result(smart_objects::SmartType_Map);
- result[strings::msg_params] = (*command_msg)[strings::params][strings::data];
- result[strings::params][hmi_response::code] =
- (*command_msg)[strings::params][hmi_response::code];
- result[strings::params][strings::correlation_id] =
- (*command_msg)[strings::params][strings::correlation_id];
- result[strings::params][strings::error_msg] =
- (*command_msg)[strings::params][strings::error_msg];
- result[strings::params][strings::message_type] =
- (*command_msg)[strings::params][strings::message_type];
- result[strings::params][strings::protocol_type] =
- (*command_msg)[strings::params][strings::protocol_type];
- result[strings::params][strings::protocol_version] =
- (*command_msg)[strings::params][strings::protocol_version];
-
- VIGetVehicleDataResponsePtr command(
- CreateCommand<VIGetVehicleDataResponse>(command_msg));
-
- am::event_engine::Event event(
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
- event.set_smart_object(result);
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vi_get_vehicle_data_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
deleted file mode 100644
index 48293f9a12..0000000000
--- a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vi_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vi_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-using ::testing::Return;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::VIIsReadyRequest;
-using am::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
deleted file mode 100644
index 907a013972..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_capabilities_response {
-
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = am::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRGetCapabilitiesResponse;
-using am::commands::CommandImpl;
-
-typedef SharedPtr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class VRGetCapabilitiesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MessageSharedPtr CreateCommandMsg() {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = "123";
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- return command_msg;
- }
-
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) {
- MessageSharedPtr command_msg = CreateCommandMsg();
- (*command_msg)[strings::msg_params][strings::vr_capabilities] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- (*command_msg)[strings::msg_params][strings::vr_capabilities][0] =
- "vrCapabilities";
-
- VRGetCapabilitiesResponsePtr command(
- CreateCommand<VRGetCapabilitiesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- smart_objects::SmartObject vr_capabilities_so =
- (*command_msg)[strings::msg_params][strings::vr_capabilities];
-
- EXPECT_CALL(mock_hmi_capabilities_, set_vr_capabilities(vr_capabilities_so));
-
- command->Run();
-}
-
-} // namespace vr_get_capabilities_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
deleted file mode 100644
index 7d42e39548..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/hmi/vr_get_language_response.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_event_dispatcher.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_language_response {
-
-using utils::SharedPtr;
-using application_manager::commands::VRGetLanguageResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-using testing::_;
-using testing::ReturnRef;
-using ::testing::NiceMock;
-
-namespace strings = application_manager::strings;
-namespace hmi_response = application_manager::hmi_response;
-using namespace hmi_apis;
-
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
-} // namespace
-
-class VRGetLanguageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
-
- SharedPtr<VRGetLanguageResponse> command(
- CreateCommand<VRGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities, set_active_vr_language(kLanguage));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
-
- SharedPtr<VRGetLanguageResponse> command(
- CreateCommand<VRGetLanguageResponse>(msg));
-
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
- EXPECT_CALL(mock_hmi_capabilities,
- set_active_vr_language(Common_Language::INVALID_ENUM));
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vr_get_language_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
deleted file mode 100644
index 27be9e0f0f..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/application.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_get_supported_languages_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRGetSupportedLanguagesResponse;
-
-typedef SharedPtr<VRGetSupportedLanguagesResponse>
- VRGetSupportedLanguagesResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-const std::string kStringNum = "123";
-const std::string kLanguage = "EN_US";
-const smart_objects::SmartObject supported_languages(kLanguage);
-} // namespace
-
-class VRGetSupportedLanguagesResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- MockHMICapabilities mock_hmi_capabilities_;
- SmartObject capabilities_;
-};
-
-TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
- (*command_msg)[strings::msg_params][hmi_response::languages] =
- supported_languages;
-
- VRGetSupportedLanguagesResponsePtr command(
- CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities_));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_vr_supported_languages((supported_languages)));
-
- command->Run();
-}
-TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[strings::msg_params][strings::number] = kStringNum;
- (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*command_msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::WRONG_LANGUAGE;
- (*command_msg)[strings::msg_params][hmi_response::capabilities] =
- (capabilities_);
-
- VRGetSupportedLanguagesResponsePtr command(
- CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_vr_supported_languages(supported_languages)).Times(0);
-
- command->Run();
-
- EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
- am::hmi_response::languages));
-}
-
-} // namespace vr_get_supported_languages_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
deleted file mode 100644
index 64e5c25546..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/hmi/vr_is_ready_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/hmi_interfaces.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_is_ready_request {
-
-using ::testing::_;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::VRIsReadyRequest;
-using am::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
deleted file mode 100644
index 37e945bc11..0000000000
--- a/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/commands/hmi/vr_is_ready_response.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace hmi_commands_test {
-namespace vr_is_ready_response {
-
-using ::testing::Return;
-using ::utils::SharedPtr;
-using ::testing::NiceMock;
-namespace am = ::application_manager;
-namespace strings = ::application_manager::strings;
-namespace hmi_response = am::hmi_response;
-using am::commands::VRIsReadyResponse;
-using test::components::event_engine_test::MockEventDispatcher;
-
-typedef SharedPtr<VRIsReadyResponse> VRIsReadyResponsePtr;
-
-class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) {
- VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>());
-
- MockEventDispatcher mock_event_dispatcher;
- EXPECT_CALL(app_mngr_, event_dispatcher())
- .WillOnce(ReturnRef(mock_event_dispatcher));
- EXPECT_CALL(mock_event_dispatcher, raise_event(_));
-
- command->Run();
-}
-
-} // namespace vr_is_ready_response
-} // namespace hmi_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
deleted file mode 100644
index 567c3d32f9..0000000000
--- a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/add_command_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace add_command_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using 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
deleted file mode 100644
index 95bcede5fa..0000000000
--- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <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
deleted file mode 100644
index a835239a90..0000000000
--- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "event_engine/event.h"
-#include "application_manager/commands/mobile/alert_maneuver_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace alert_maneuver_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::AlertManeuverRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-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
deleted file mode 100644
index 43151c2d98..0000000000
--- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/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
deleted file mode 100644
index 0c76a08fe9..0000000000
--- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/change_registration_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "policy/usage_statistics/mock_statistics_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace change_registration_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index a0b0dc32ff..0000000000
--- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
+++ /dev/null
@@ -1,827 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
-#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace create_interaction_choice_set_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 1e03dcaaf1..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "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
deleted file mode 100644
index 6af9a62bf0..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_file_test.cc
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-#include <string>
-#include <map>
-
-#include "mobile/delete_file_request.h"
-#include "mobile/delete_file_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_application_manager_settings.h"
-
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/policies/policy_handler.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_file {
-
-using ::testing::_;
-using ::testing::Test;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::SetArgReferee;
-using ::testing::AtLeast;
-namespace am = ::application_manager;
-using am::commands::DeleteFileRequest;
-using am::commands::DeleteFileResponse;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::MockMessageHelper;
-
-typedef SharedPtr<DeleteFileRequest> DeleteFileRequestPtr;
-typedef SharedPtr<DeleteFileResponse> DeleteFileResponsePtr;
-typedef NiceMock<
- ::test::components::application_manager_test::MockHMICapabilities>
- MockHMICapabilities;
-
-ACTION_TEMPLATE(SetArgPointer,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(vec)) {
- *std::tr1::get<k>(args) = *vec;
-}
-
-MATCHER_P(CheckMessageResultCode, result_code, "") {
- return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
- result_code;
-}
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const uint32_t kCorrelationId = 10u;
-const int32_t kMenuId = 5;
-} // namespace
-
-class DeleteFileRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- protected:
- void SetUp() OVERRIDE {
- message_ = CreateMessage();
- command_ = CreateCommand<DeleteFileRequest>(message_);
- mock_app_ = CreateMockApp();
- }
- DeleteFileRequestPtr command_;
- MessageSharedPtr message_;
- MockAppPtr mock_app_;
-};
-
-class DeleteFileResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
-};
-
-TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) {
- MockAppPtr invalid_app;
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
- EXPECT_CALL(app_mngr_, get_settings()).Times(0);
-
- command_->Run();
-}
-
-TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
-
- EXPECT_CALL(app_mngr_, get_settings())
- .WillOnce(ReturnRef(app_mngr_settings_));
- const uint32_t num = 0;
- EXPECT_CALL(app_mngr_settings_, delete_file_in_none())
- .WillOnce(ReturnRef(num));
- EXPECT_CALL(*mock_app_, delete_file_in_none_count()).WillOnce(Return(1));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
-
- command_->Run();
-}
-
-TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
- const std::string file_name = "test_file.txt";
- EXPECT_TRUE(file_system::CreateFile(file_name));
- (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
- (*message_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .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
deleted file mode 100644
index 64c2fae1d3..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <map>
-
-#include "mobile/delete_interaction_choice_set_request.h"
-#include "mobile/delete_interaction_choice_set_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_interaction_choice_set {
-
-using ::testing::_;
-using ::testing::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
deleted file mode 100644
index dd57d5f8c6..0000000000
--- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/delete_sub_menu_request.h"
-#include "application_manager/commands/mobile/delete_sub_menu_response.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace delete_sub_menu_request {
-
-using ::testing::_;
-using ::testing::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
deleted file mode 100644
index 60697446f2..0000000000
--- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <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
deleted file mode 100644
index 2f7415c98e..0000000000
--- a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/mobile/dial_number_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace dial_number_request {
-
-using ::testing::_;
-using ::testing::Return;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::DialNumberRequest;
-using am::event_engine::Event;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<DialNumberRequest> DialNumberRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class DialNumberRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_InvalidNumber_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "\t\n";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_EmptyNumber_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "NotANumber";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_DialNumber)));
-
- command->Run();
-}
-
-TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->on_event(event);
-}
-
-TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
- MessageSharedPtr 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
deleted file mode 100644
index 27a8499c09..0000000000
--- a/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "commands/command_request_test.h"
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-#include "gtest/gtest.h"
-
-#include "mobile/add_command_request.h"
-#include "mobile/add_command_response.h"
-#include "mobile/add_sub_menu_request.h"
-#include "mobile/add_sub_menu_response.h"
-#include "mobile/alert_maneuver_request.h"
-#include "mobile/alert_maneuver_response.h"
-#include "mobile/alert_request.h"
-#include "mobile/alert_response.h"
-#include "mobile/change_registration_request.h"
-#include "mobile/change_registration_response.h"
-#include "mobile/create_interaction_choice_set_request.h"
-#include "mobile/create_interaction_choice_set_response.h"
-#include "mobile/delete_command_request.h"
-#include "mobile/delete_command_response.h"
-#include "mobile/delete_file_request.h"
-#include "mobile/delete_file_response.h"
-#include "mobile/delete_interaction_choice_set_request.h"
-#include "mobile/delete_interaction_choice_set_response.h"
-#include "mobile/delete_sub_menu_request.h"
-#include "mobile/delete_sub_menu_response.h"
-#include "mobile/diagnostic_message_request.h"
-#include "mobile/diagnostic_message_response.h"
-#include "mobile/dial_number_request.h"
-#include "mobile/dial_number_response.h"
-#include "mobile/end_audio_pass_thru_request.h"
-#include "mobile/end_audio_pass_thru_response.h"
-#include "mobile/generic_response.h"
-#include "mobile/get_dtcs_request.h"
-#include "mobile/get_dtcs_response.h"
-#include "mobile/get_vehicle_data_request.h"
-#include "mobile/get_vehicle_data_response.h"
-#include "mobile/get_way_points_request.h"
-#include "mobile/get_way_points_response.h"
-#include "mobile/list_files_request.h"
-#include "mobile/list_files_response.h"
-#include "mobile/on_app_interface_unregistered_notification.h"
-#include "mobile/on_audio_pass_thru_notification.h"
-#include "mobile/on_button_event_notification.h"
-#include "mobile/on_button_press_notification.h"
-#include "mobile/on_command_notification.h"
-#include "mobile/on_driver_distraction_notification.h"
-#include "mobile/on_hash_change_notification.h"
-#include "mobile/on_hmi_status_notification.h"
-#include "mobile/on_hmi_status_notification_from_mobile.h"
-#include "mobile/on_keyboard_input_notification.h"
-#include "mobile/on_language_change_notification.h"
-#include "mobile/on_permissions_change_notification.h"
-#include "mobile/on_system_request_notification.h"
-#include "mobile/on_tbt_client_state_notification.h"
-#include "mobile/on_touch_event_notification.h"
-#include "mobile/on_vehicle_data_notification.h"
-#include "mobile/on_way_point_change_notification.h"
-#include "mobile/perform_audio_pass_thru_request.h"
-#include "mobile/perform_audio_pass_thru_response.h"
-#include "mobile/perform_interaction_request.h"
-#include "mobile/perform_interaction_response.h"
-#include "mobile/put_file_request.h"
-#include "mobile/put_file_response.h"
-#include "mobile/read_did_request.h"
-#include "mobile/read_did_response.h"
-#include "mobile/register_app_interface_request.h"
-#include "mobile/register_app_interface_response.h"
-#include "mobile/reset_global_properties_request.h"
-#include "mobile/reset_global_properties_response.h"
-#include "mobile/scrollable_message_request.h"
-#include "mobile/scrollable_message_response.h"
-#include "mobile/send_location_request.h"
-#include "mobile/send_location_response.h"
-#include "mobile/set_app_icon_request.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/set_display_layout_request.h"
-#include "mobile/set_display_layout_response.h"
-#include "mobile/set_global_properties_request.h"
-#include "mobile/set_global_properties_response.h"
-#include "mobile/set_media_clock_timer_request.h"
-#include "mobile/set_media_clock_timer_response.h"
-#include "mobile/show_constant_tbt_request.h"
-#include "mobile/show_constant_tbt_response.h"
-#include "mobile/show_request.h"
-#include "mobile/show_response.h"
-#include "mobile/slider_request.h"
-#include "mobile/slider_response.h"
-#include "mobile/speak_request.h"
-#include "mobile/speak_response.h"
-#include "mobile/subscribe_button_request.h"
-#include "mobile/subscribe_button_response.h"
-#include "mobile/subscribe_vehicle_data_request.h"
-#include "mobile/subscribe_vehicle_data_response.h"
-#include "mobile/subscribe_way_points_request.h"
-#include "mobile/subscribe_way_points_response.h"
-#include "mobile/system_response.h"
-#include "mobile/unregister_app_interface_request.h"
-#include "mobile/unregister_app_interface_response.h"
-#include "mobile/unsubscribe_button_request.h"
-#include "mobile/unsubscribe_button_response.h"
-#include "mobile/unsubscribe_vehicle_data_request.h"
-#include "mobile/unsubscribe_vehicle_data_response.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "mobile/unsubscribe_way_points_response.h"
-#include "mobile/update_turn_list_request.h"
-#include "mobile/update_turn_list_response.h"
-
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_event_dispatcher.h"
-
-namespace am = application_manager;
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace dummy_mobile_commands_test {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-using commands::MessageSharedPtr;
-using ::test::components::event_engine_test::MockEventDispatcher;
-using ::test::components::application_manager_test::MockApplicationManager;
-using ::test::components::application_manager_test::
- MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
-using ::test::components::application_manager_test::MockApplication;
-
-namespace {
-const std::string kEmptyString_ = "";
-} // namespace
-
-template <class Command>
-class MobileCommandsTest : public components::commands_test::CommandRequestTest<
- CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-
- void InitCommand(const uint32_t& timeout) OVERRIDE {
- EXPECT_CALL(app_mngr_settings_, default_timeout())
- .WillOnce(ReturnRef(timeout));
- ON_CALL(app_mngr_, event_dispatcher())
- .WillByDefault(ReturnRef(event_dispatcher_));
- ON_CALL(app_mngr_, get_settings())
- .WillByDefault(ReturnRef(app_mngr_settings_));
- ON_CALL(app_mngr_settings_, app_icons_folder())
- .WillByDefault(ReturnRef(kEmptyString_));
- }
-};
-
-template <class Command>
-class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class MobileCommandsTestSecond : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-template <class Command>
-class MobileCommandsTestThird : public MobileCommandsTest<Command> {
- public:
- using typename MobileCommandsTest<Command>::CommandType;
-};
-
-/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
- * TYPED_TEST_CASE for HMI and mobile commands
- */
-
-typedef Types<commands::AddCommandRequest,
- commands::AddCommandResponse,
- commands::AddSubMenuRequest,
- commands::AddSubMenuResponse,
- commands::AlertManeuverRequest,
- commands::AlertManeuverResponse,
- commands::AlertRequest,
- commands::AlertResponse,
- commands::ChangeRegistrationRequest,
- commands::ChangeRegistrationResponse,
- commands::CreateInteractionChoiceSetRequest,
- commands::CreateInteractionChoiceSetResponse,
- commands::DeleteCommandRequest,
- commands::DeleteCommandResponse,
- commands::DeleteFileRequest,
- commands::DeleteFileResponse,
- commands::DeleteInteractionChoiceSetRequest,
- commands::DeleteInteractionChoiceSetResponse,
- commands::DeleteSubMenuRequest,
- commands::DeleteSubMenuResponse,
- commands::DiagnosticMessageRequest,
- commands::DiagnosticMessageResponse,
- commands::DialNumberRequest,
- commands::DialNumberResponse,
- commands::EndAudioPassThruRequest,
- commands::EndAudioPassThruResponse,
- commands::GenericResponse,
- commands::GetDTCsRequest,
- commands::GetDTCsResponse,
- commands::GetVehicleDataRequest,
- commands::GetVehicleDataResponse,
- commands::GetWayPointsRequest,
- commands::GetWayPointsResponse,
- commands::ListFilesRequest,
- commands::ListFilesResponse,
- commands::OnAppInterfaceUnregisteredNotification,
- commands::OnAudioPassThruNotification,
- commands::mobile::OnButtonEventNotification,
- commands::mobile::OnButtonPressNotification,
- commands::OnCommandNotification,
- commands::mobile::OnDriverDistractionNotification,
- commands::mobile::OnHashChangeNotification,
- commands::OnHMIStatusNotification,
- commands::OnHMIStatusNotificationFromMobile,
- commands::mobile::OnKeyBoardInputNotification,
- commands::OnLanguageChangeNotification,
- commands::OnPermissionsChangeNotification,
- commands::mobile::OnSystemRequestNotification,
- commands::OnTBTClientStateNotification,
- commands::mobile::OnTouchEventNotification>
- MobileCommandsListFirst;
-
-typedef Types<commands::OnVehicleDataNotification,
- commands::OnWayPointChangeNotification,
- commands::PerformAudioPassThruRequest,
- commands::PerformAudioPassThruResponse,
- commands::PerformInteractionRequest,
- commands::PerformInteractionResponse,
- commands::PutFileRequest,
- commands::PutFileResponse,
- commands::ReadDIDRequest,
- commands::ReadDIDResponse,
- commands::RegisterAppInterfaceRequest,
- commands::RegisterAppInterfaceResponse,
- commands::ResetGlobalPropertiesRequest,
- commands::ResetGlobalPropertiesResponse,
- commands::ScrollableMessageRequest,
- commands::ScrollableMessageResponse,
- commands::SendLocationRequest,
- commands::SendLocationResponse,
- commands::SetAppIconRequest,
- commands::SetAppIconResponse,
- commands::SetDisplayLayoutRequest,
- commands::SetDisplayLayoutResponse,
- commands::SetGlobalPropertiesRequest,
- commands::SetGlobalPropertiesResponse,
- commands::SetMediaClockRequest,
- commands::SetMediaClockTimerResponse,
- commands::ShowConstantTBTRequest,
- commands::ShowConstantTBTResponse,
- commands::ShowRequest,
- commands::ShowResponse,
- commands::SliderRequest,
- commands::SliderResponse,
- commands::SpeakRequest,
- commands::SpeakResponse,
- commands::SubscribeButtonRequest,
- commands::SubscribeButtonResponse,
- commands::SubscribeVehicleDataRequest,
- commands::SubscribeVehicleDataResponse,
- commands::SubscribeWayPointsRequest,
- commands::SubscribeWayPointsResponse,
- commands::SystemResponse,
- commands::UnregisterAppInterfaceRequest,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeButtonRequest,
- commands::UnsubscribeButtonResponse,
- commands::UnsubscribeVehicleDataRequest> MobileCommandsListSecond;
-
-typedef Types<commands::UnsubscribeVehicleDataResponse,
- commands::UnSubscribeWayPointsRequest,
- commands::UnsubscribeWayPointsResponse,
- commands::UpdateTurnListRequest,
- commands::UpdateTurnListResponse> MobileCommandsListThird;
-
-TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
-TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
-TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
-
-TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- UNUSED(command);
-}
-
-} // namespace dummy_mobile_commands_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
deleted file mode 100644
index ceb5e3b916..0000000000
--- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <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
deleted file mode 100644
index 31d406d959..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <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
deleted file mode 100644
index a851a72f8e..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/mobile/get_vehicle_data_request.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace get_vehicle_data_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-namespace am = ::application_manager;
-using am::commands::MessageSharedPtr;
-using am::commands::GetVehicleDataRequest;
-using am::event_engine::Event;
-namespace mobile_result = mobile_apis::Result;
-
-typedef SharedPtr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
-
-namespace {
-const uint32_t kConnectionKey = 2u;
-} // namespace
-
-class GetVehicleDataRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- 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
deleted file mode 100644
index 1297d3cc92..0000000000
--- a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "mobile/get_way_points_request.h"
-#include "application_manager/smart_object_keys.h"
-#include "mock_message_helper.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_message_helper.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace get_way_points_request {
-
-using namespace mobile_apis::Result;
-using ::testing::Return;
-using ::testing::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:
- 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_));
- }
-
- 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
deleted file mode 100644
index 85377054ef..0000000000
--- a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/commands/mobile/list_files_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace list_files_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::ListFilesRequest;
-using am::commands::MessageSharedPtr;
-
-class ListFilesRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-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
deleted file mode 100644
index 48f4497033..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-
-#include "application_manager/include/application_manager/commands/command_impl.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/commands/mobile/on_button_event_notification.h"
-#include "application_manager/commands/mobile/on_button_press_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_button_notification {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::Return;
-
-using ::utils::SharedPtr;
-using am::commands::MessageSharedPtr;
-
-namespace {
-const uint32_t kAppId = 5u;
-const uint32_t kCustomButtonId = 3u;
-const mobile_apis::ButtonName::eType kButtonName = mobile_apis::ButtonName::OK;
-} // namespace
-
-template <class NotificationT,
- mobile_apis::FunctionID::eType kExpectedFunctionId>
-struct NotificationData {
- typedef NotificationT Notification;
- enum { kFunctionId = kExpectedFunctionId };
-};
-
-template <class NotificationDataT>
-class OnButtonNotificationCommandsTest
- : public CommandsTest<CommandsTestMocks::kNotNice>,
- public NotificationDataT {};
-
-typedef Types<NotificationData<commands::mobile::OnButtonEventNotification,
- mobile_apis::FunctionID::OnButtonEventID>,
- NotificationData<commands::mobile::OnButtonPressNotification,
- mobile_apis::FunctionID::OnButtonPressID> >
- OnButtonNotificationCommandsList;
-
-MATCHER_P(CheckNotificationMessage, function_id, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsFunctionIdCorrect =
- (*arg)[am::strings::params][am::strings::function_id].asInt() ==
- function_id;
-
- bool is_custom_button_id_correct = true;
- if ((*arg)[am::strings::msg_params].keyExists(
- am::hmi_response::custom_button_id)) {
- is_custom_button_id_correct =
- (*arg)[am::strings::msg_params][am::strings::custom_button_id] ==
- kCustomButtonId;
- }
-
- return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
- kIsNotificationCorrect && kIsFunctionIdCorrect &&
- is_custom_button_id_correct;
-}
-
-TYPED_TEST_CASE(OnButtonNotificationCommandsTest,
- OnButtonNotificationCommandsList);
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_NoAppId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_NoCustomButtonId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_AppNotRegistered_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- EXPECT_CALL(this->app_mngr_, application(kAppId))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_CustomButton_AppNotSubscribedToCustomButtonId_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
- .WillOnce(Return(false));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- mobile_apis::ButtonName::CUSTOM_BUTTON;
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params]
- [am::hmi_response::custom_button_id] = kCustomButtonId;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- ON_CALL(*mock_app, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
- EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
- .WillOnce(Return(true));
-
- EXPECT_CALL(this->app_mngr_,
- SendMessageToMobile(
- CheckNotificationMessage(TestFixture::kFunctionId), _));
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(empty_subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest,
- Run_ButtonOkOnlyForHmiLevelFull_UNSUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command->Run();
-}
-
-TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
- typedef typename TestFixture::Notification Notification;
-
- MessageSharedPtr notification_msg(
- this->CreateMessage(smart_objects::SmartType_Map));
-
- (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
- kButtonName;
-
- SharedPtr<Notification> command(
- this->template CreateCommand<Notification>(notification_msg));
-
- typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
- std::vector<ApplicationSharedPtr> subscribed_apps_list;
- subscribed_apps_list.push_back(mock_app);
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
-
- ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
-
- EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
- .WillOnce(Return(subscribed_apps_list));
-
- EXPECT_CALL(this->app_mngr_,
- SendMessageToMobile(
- CheckNotificationMessage(TestFixture::kFunctionId), _));
-
- command->Run();
-}
-
-} // namespace on_button_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
deleted file mode 100644
index def324bfb6..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/commands/mobile/on_command_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_command_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnCommandNotification;
-
-typedef ::utils::SharedPtr<OnCommandNotification> CommandPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-const uint32_t kCommandId = 5u;
-} // namespace
-
-class OnCommandNotificationTest
- : public CommandsTest<CommandsTestMocks::kNotNice> {};
-
-TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<OnCommandNotification>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->Run();
-}
-
-TEST_F(OnCommandNotificationTest, Run_NoAppsForTheCommand_UNSUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
-
- CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, FindCommand(kCommandId))
- .WillOnce(Return(static_cast<SmartObject*>(NULL)));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- command->Run();
-}
-
-MATCHER(CheckNotificationMessage, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- return kIsMobileProtocolTypeCorrect && kIsProtocolVersionCorrect &&
- kIsNotificationCorrect;
-}
-
-TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- (*command_msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
-
- CommandPtr command(CreateCommand<OnCommandNotification>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
- MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(*mock_app, FindCommand(kCommandId))
- .WillOnce(Return(dummy_msg.get()));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckNotificationMessage(), _));
-
- command->Run();
-}
-
-} // namespace on_command_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
deleted file mode 100644
index 9ef978d756..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <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
deleted file mode 100644
index 2cfed4a26a..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include <application_manager/smart_object_keys.h>
-#include "application_manager/message.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/mock_message_helper.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_hmi_status_notification_from_mobile {
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const connection_handler::DeviceHandle kHandle = 2u;
-} // namespace
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::OnHMIStatusNotificationFromMobile;
-using 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
deleted file mode 100644
index 8f2ce3d3dc..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_hmi_status_notification.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/command_impl.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_hmi_status_notification {
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-} // namespace
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::OnHMIStatusNotification;
-using 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
deleted file mode 100644
index d56cd98904..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "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
deleted file mode 100644
index 43f725012d..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_system_request_notification.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "interfaces/MOBILE_API.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_system_request_notification {
-
-namespace strings = application_manager::strings;
-
-using application_manager::commands::mobile::OnSystemRequestNotification;
-using application_manager::commands::CommandImpl;
-using application_manager::MockMessageHelper;
-using test::components::policy_test::MockPolicyHandlerInterface;
-using namespace mobile_apis;
-using testing::Mock;
-using testing::Return;
-using testing::ReturnRef;
-using testing::_;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-} // namespace
-
-class OnSystemRequestNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- 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
deleted file mode 100644
index 59cddc325f..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_tbt_client_state_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnTBTClientStateNotification;
-
-typedef ::utils::SharedPtr<OnTBTClientStateNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnTBTClientStateNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnTBTClientStateNotificationTest()
- : command_(CreateCommand<OnTBTClientStateNotification>()) {}
-
- NotificationPtr command_;
-};
-
-TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
-
- EXPECT_CALL(*mock_app, app_id()).Times(0);
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)).Times(0);
-
- command_->Run();
-}
-
-MATCHER(CheckMessageData, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect);
-}
-
-TEST_F(OnTBTClientStateNotificationTest,
- Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- std::vector<ApplicationSharedPtr> applications_with_navi;
- applications_with_navi.push_back(mock_app);
-
- EXPECT_CALL(app_mngr_, applications_with_navi())
- .WillOnce(Return(applications_with_navi));
-
- EXPECT_CALL(*mock_app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
-
- command_->Run();
-}
-
-} // namespace on_tbt_client_state_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
deleted file mode 100644
index 466facec1f..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <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
deleted file mode 100644
index d00e62bcfb..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <vector>
-#include <map>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
-#include "utils/shared_ptr.h"
-#include "utils/custom_string.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/message_helper.h"
-#include "application_manager/mock_message_helper.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_vehicle_data_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnVehicleDataNotification;
-
-typedef ::utils::SharedPtr<OnVehicleDataNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnVehicleDataNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnVehicleDataNotificationTest()
- : 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
deleted file mode 100644
index b0dd3c142c..0000000000
--- a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <set>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/on_way_point_change_notification.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_impl.h"
-#include "utils/helpers.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace on_way_point_change_notification {
-
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::MessageSharedPtr;
-using am::commands::OnWayPointChangeNotification;
-
-typedef ::utils::SharedPtr<OnWayPointChangeNotification> NotificationPtr;
-
-namespace {
-const uint32_t kAppId = 1u;
-} // namespace
-
-class OnWayPointChangeNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnWayPointChangeNotificationTest()
- : command_(CreateCommand<OnWayPointChangeNotification>()) {}
-
- NotificationPtr command_;
-};
-
-MATCHER(CheckMessageData, "") {
- const bool kIsMobileProtocolTypeCorrect =
- (*arg)[am::strings::params][am::strings::protocol_type].asInt() ==
- am::commands::CommandImpl::mobile_protocol_type_;
-
- const bool kIsProtocolVersionCorrect =
- (*arg)[am::strings::params][am::strings::protocol_version].asInt() ==
- am::commands::CommandImpl::protocol_version_;
-
- const bool kIsNotificationCorrect =
- (*arg)[am::strings::params][am::strings::message_type].asInt() ==
- am::MessageType::kNotification;
-
- const bool kIsConnectionKeyCorrect =
- (*arg)[am::strings::params][am::strings::connection_key].asUInt() ==
- kAppId;
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(true,
- kIsMobileProtocolTypeCorrect,
- kIsProtocolVersionCorrect,
- kIsNotificationCorrect,
- kIsConnectionKeyCorrect);
-}
-
-TEST_F(OnWayPointChangeNotificationTest,
- Run_NotEmptyListOfAppsSubscribedForWayPoints_SUCCESS) {
- std::set<int32_t> apps_subscribed_for_way_points;
- apps_subscribed_for_way_points.insert(kAppId);
-
- EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints())
- .WillOnce(Return(apps_subscribed_for_way_points));
-
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
-
- command_->Run();
-}
-
-} // namespace on_way_point_change_notification
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
deleted file mode 100644
index 9126e43050..0000000000
--- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ /dev/null
@@ -1,788 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace perform_audio_pass_thru_request {
-
-namespace am = application_manager;
-using am::commands::PerformAudioPassThruRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 22ce735c61..0000000000
--- a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/perform_interaction_request.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace perform_interaction_request {
-
-namespace am = application_manager;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index b48ac67501..0000000000
--- a/src/components/application_manager/test/commands/mobile/put_file_test.cc
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-
-#include "mobile/put_file_response.h"
-#include "mobile/put_file_request.h"
-
-#include "utils/make_shared.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace put_file {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::AtLeast;
-
-namespace am = ::application_manager;
-
-using am::commands::PutFileRequest;
-using am::commands::PutFileResponse;
-using am::commands::MessageSharedPtr;
-using policy_test::MockPolicyHandlerInterface;
-
-typedef SharedPtr<PutFileRequest> PutFileRequestPtr;
-typedef SharedPtr<PutFileResponse> PutFileResponsePtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const std::string kFileName = "sync_file_name.txt";
-const int64_t kOffset = 10u;
-const int64_t kZeroOffset = 0u;
-const std::string kStorageFolder = "./storage";
-const std::string kAppFolder = "app_folder";
-}
-
-class PutFileRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- PutFileRequestTest()
- : msg_(CreateMessage(::smart_objects::SmartType_Map))
- , mock_app_(CreateMockApp()) {}
-
- void SetUp() OVERRIDE {
- binary_data_.push_back(1u);
-
- (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- (*msg_)[am::strings::msg_params][am::strings::sync_file_name] = kFileName;
- (*msg_)[am::strings::msg_params][am::strings::persistent_file] = true;
- (*msg_)[am::strings::msg_params][am::strings::file_type] =
- mobile_apis::FileType::JSON;
- (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
-
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(app_mngr_, GetPolicyHandler())
- .WillByDefault(ReturnRef(mock_policy_handler_));
- ON_CALL(*mock_app_, hmi_level())
- .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
- }
-
- void ExpectReceiveMessageFromSDK() {
- EXPECT_CALL(mock_policy_handler_,
- ReceiveMessageFromSDK(kFileName, binary_data_))
- .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
- }
- void ExpectManageMobileCommandWithResultCode(
- const mobile_apis::Result::eType code) {
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(code),
- am::commands::Command::CommandOrigin::ORIGIN_SDL));
- }
-
- MessageSharedPtr msg_;
- MockAppPtr mock_app_;
- MockPolicyHandlerInterface mock_policy_handler_;
- std::vector<uint8_t> binary_data_;
-};
-
-class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- PutFileResponceTest() : message_(CreateMessage()) {}
-
- void SetUp() OVERRIDE {
- command_sptr_ = CreateCommand<PutFileResponse>(message_);
- }
-
- MessageSharedPtr message_;
- SharedPtr<PutFileResponse> command_sptr_;
-};
-
-TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
- ::smart_objects::SmartObject& message_ref = *message_;
-
- message_ref[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- utils::SharedPtr<am::Application> null_application_sptr;
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(null_application_sptr));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(
- MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
- _));
- command_sptr_->Run();
-}
-
-TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
- ::smart_objects::SmartObject& message_ref = *message_;
-
- message_ref[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- message_ref[am::strings::msg_params][am::strings::success] = true;
-
- utils::SharedPtr<am::Application> application_sptr =
- utils::MakeShared<MockApplication>();
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(application_sptr));
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
- command_sptr_->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(ApplicationSharedPtr()));
- ExpectManageMobileCommandWithResultCode(
- mobile_apis::Result::APPLICATION_NOT_REGISTERED);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
- EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
-
- const uint32_t settings_put_file_in_none = 1u;
- const uint32_t app_put_file_in_none_count = 2u;
- EXPECT_CALL(app_mngr_settings_, put_file_in_none())
- .WillOnce(ReturnRef(settings_put_file_in_none));
- EXPECT_CALL(*mock_app_, put_file_in_none_count())
- .WillOnce(Return(app_put_file_in_none_count));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_BinaryDataDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::params].erase(am::strings::binary_data);
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_SyncFileNameDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::msg_params].erase(am::strings::sync_file_name);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_FileTypeDoesNotExists_UNSUCCESS) {
- (*msg_)[am::strings::msg_params].erase(am::strings::file_type);
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_BinaryDataGreaterThanAvaliableSpace_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 0u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::OUT_OF_MEMORY);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_IvalidCreationDirectory_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
-
- const std::string storage_folder = "/storage";
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(storage_folder));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::GENERIC_ERROR);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_IvalidUpdateFile_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 2u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space))
- .WillOnce(Return(avaliable_space));
-
- const std::string file_path = kStorageFolder + "/" + kAppFolder;
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(false));
- EXPECT_CALL(*mock_app_, UpdateFile(_)).WillOnce(Return(false));
-
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_AddFile_SUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, app_storage_folder())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
-
- const uint32_t avaliable_space = 2u;
- EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
- .WillOnce(Return(avaliable_space))
- .WillOnce(Return(avaliable_space));
-
- const std::string file_path = kStorageFolder + "/" + kAppFolder;
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(true));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::BasicCommunication_OnPutFile)))
- .WillOnce(Return(true));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) {
- (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
- (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
-
- ExpectReceiveMessageFromSDK();
- EXPECT_CALL(app_mngr_settings_, system_files_path())
- .WillOnce(ReturnRef(kStorageFolder));
- EXPECT_CALL(app_mngr_,
- SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
- .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
- ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
-
- PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
- command->Run();
-}
-
-} // namespace put_file
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
deleted file mode 100644
index 334f559ae6..0000000000
--- a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/read_did_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace read_did_request {
-
-using ::testing::_;
-using ::testing::DoAll;
-using ::testing::Return;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::ReadDIDRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using ::utils::SharedPtr;
-
-class ReadDIDRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
- Event event(Event::EventID::INVALID_ENUM);
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
- command->on_event(event);
-}
-
-TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
- Event event(Event::EventID::VehicleInfo_ReadDID);
-
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
-
- const hmi_apis::Common_Result::eType hmi_response_code =
- hmi_apis::Common_Result::SUCCESS;
- const mobile_apis::Result::eType mobile_response_code =
- mobile_apis::Result::SUCCESS;
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- event.set_smart_object(*event_msg);
-
- 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
deleted file mode 100644
index fe252e38d6..0000000000
--- a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "mobile/register_app_interface_request.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "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
deleted file mode 100644
index 29c52bb0d5..0000000000
--- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-#include "mobile/reset_global_properties_request.h"
-#include "mobile/reset_global_properties_response.h"
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace reset_global_properties {
-
-using ::testing::_;
-using ::testing::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
deleted file mode 100644
index aba549eb34..0000000000
--- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/scrollable_message_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace scrollable_message_request {
-
-namespace am = application_manager;
-namespace hmi_response = am::hmi_response;
-namespace mobile_result = mobile_apis::Result;
-namespace am = ::application_manager;
-
-using am::commands::ScrollableMessageRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index df412695fd..0000000000
--- a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/send_location_request.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "utils/shared_ptr.h"
-#include "commands/command_request_test.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace send_location_request {
-
-using application_manager::commands::MessageSharedPtr;
-using application_manager::commands::SendLocationRequest;
-using application_manager::MockMessageHelper;
-using test::components::application_manager_test::MockHMICapabilities;
-using smart_objects::SmartObject;
-using utils::SharedPtr;
-using testing::_;
-using testing::Return;
-using testing::ReturnRef;
-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
deleted file mode 100644
index b51b7c83ea..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_app_icon_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_app_icon_request {
-
-namespace am = application_manager;
-using am::commands::SetAppIconRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 0518b325ea..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_display_layout_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_hmi_capabilities.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_display_layout_request {
-
-namespace am = application_manager;
-namespace mobile_result = mobile_apis::Result;
-using am::commands::SetDisplayLayoutRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 0908b54ba7..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
+++ /dev/null
@@ -1,1254 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/set_global_properties_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_global_properties_request {
-
-namespace am = application_manager;
-using am::commands::SetGlobalPropertiesRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using am::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
deleted file mode 100644
index da6f29cf5e..0000000000
--- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace set_media_clock_timer_request {
-
-namespace am = ::application_manager;
-using am::commands::SetMediaClockRequest;
-using am::commands::MessageSharedPtr;
-using am::event_engine::Event;
-using am::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
deleted file mode 100644
index 2d2e19cbf2..0000000000
--- a/src/components/application_manager/test/commands/mobile/show_test.cc
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/show_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace show_request {
-
-namespace am = application_manager;
-using am::commands::ShowRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index cbc2d702b3..0000000000
--- a/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_message_helper.h"
-#include "command_impl.h"
-#include "commands/commands_test.h"
-#include "mobile/on_app_interface_unregistered_notification.h"
-#include "mobile/on_audio_pass_thru_notification.h"
-#include "mobile/on_driver_distraction_notification.h"
-#include "mobile/on_language_change_notification.h"
-#include "mobile/on_permissions_change_notification.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace simple_notification_commands_test {
-
-namespace am = ::application_manager;
-namespace commands = am::commands;
-
-using ::testing::_;
-using ::testing::Types;
-using ::testing::Return;
-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
deleted file mode 100644
index d80a7e0551..0000000000
--- a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/helpers.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "mobile/read_did_response.h"
-#include "mobile/delete_command_response.h"
-#include "mobile/alert_maneuver_response.h"
-#include "mobile/alert_response.h"
-#include "mobile/list_files_response.h"
-#include "mobile/subscribe_button_response.h"
-#include "mobile/add_sub_menu_response.h"
-#include "mobile/diagnostic_message_response.h"
-#include "mobile/dial_number_response.h"
-#include "mobile/end_audio_pass_thru_response.h"
-#include "mobile/get_dtcs_response.h"
-#include "mobile/get_vehicle_data_response.h"
-#include "mobile/unregister_app_interface_response.h"
-#include "mobile/unsubscribe_button_response.h"
-#include "mobile/unsubscribe_way_points_response.h"
-#include "mobile/update_turn_list_response.h"
-#include "mobile/slider_response.h"
-#include "mobile/speak_response.h"
-#include "mobile/subscribe_vehicle_data_response.h"
-#include "mobile/subscribe_way_points_response.h"
-#include "mobile/system_response.h"
-#include "mobile/get_way_points_response.h"
-#include "mobile/perform_interaction_response.h"
-#include "mobile/perform_audio_pass_thru_response.h"
-#include "mobile/set_global_properties_response.h"
-#include "mobile/set_media_clock_timer_response.h"
-#include "mobile/show_constant_tbt_response.h"
-#include "mobile/show_response.h"
-#include "mobile/add_command_response.h"
-#include "mobile/send_location_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/set_display_layout_response.h"
-#include "mobile/generic_response.h"
-#include "mobile/set_app_icon_response.h"
-#include "mobile/scrollable_message_response.h"
-#include "mobile/change_registration_response.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace simple_response_commands_test {
-
-namespace commands = ::application_manager::commands;
-namespace am = ::application_manager;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-
-using commands::MessageSharedPtr;
-
-template <class Command>
-class MobileResponseCommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-typedef Types<commands::ListFilesResponse,
- commands::ReadDIDResponse,
- commands::DeleteCommandResponse,
- commands::AlertManeuverResponse,
- commands::AlertResponse,
- commands::SubscribeButtonResponse,
- commands::AddSubMenuResponse,
- commands::DiagnosticMessageResponse,
- commands::DialNumberResponse,
- commands::EndAudioPassThruResponse,
- commands::GetDTCsResponse,
- commands::GetVehicleDataResponse,
- commands::UnregisterAppInterfaceResponse,
- commands::UnsubscribeWayPointsResponse,
- commands::UpdateTurnListResponse,
- commands::UnsubscribeButtonResponse,
- commands::SliderResponse,
- commands::SpeakResponse,
- commands::SubscribeVehicleDataResponse,
- commands::SubscribeWayPointsResponse,
- commands::SystemResponse,
- commands::GetWayPointsResponse,
- commands::PerformInteractionResponse,
- commands::PerformAudioPassThruResponse,
- commands::SetGlobalPropertiesResponse,
- commands::SetMediaClockTimerResponse,
- commands::ShowConstantTBTResponse,
- commands::ShowResponse,
- commands::SystemResponse,
- commands::AddCommandResponse,
- commands::SendLocationResponse,
- commands::SetAppIconResponse,
- commands::SetDisplayLayoutResponse,
- commands::ChangeRegistrationResponse> ResponseCommandsList;
-
-TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
-
-TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
- ::utils::SharedPtr<typename TestFixture::CommandType> command =
- this->template CreateCommand<typename TestFixture::CommandType>();
- EXPECT_CALL(this->app_mngr_, SendMessageToMobile(NotNull(), _));
- command->Run();
-}
-
-class GenericResponseFromHMICommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-MATCHER_P2(CheckMessageParams, success, result, "") {
- const bool is_msg_type_correct =
- (am::MessageType::kResponse) ==
- static_cast<int32_t>(
- (*arg)[am::strings::params][am::strings::message_type].asInt());
- const bool is_success_correct =
- success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
- const bool is_result_code_correct =
- result ==
- static_cast<int32_t>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-
- using namespace helpers;
- return Compare<bool, EQ, ALL>(
- true, is_msg_type_correct, is_success_correct, is_result_code_correct);
-}
-
-TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
-
- SharedPtr<commands::GenericResponse> command(
- CreateCommand<commands::GenericResponse>(command_msg));
-
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(
- CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
-
- command->Run();
-}
-
-class ScrollableMessageResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
- MessageSharedPtr message = CreateMessage();
- (*message)[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::SUCCESS;
-
- MockAppPtr app(CreateMockApp());
-
- SharedPtr<am::commands::ScrollableMessageResponse> command(
- CreateCommand<am::commands::ScrollableMessageResponse>(message));
- EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
- EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
- command->Run();
-}
-
-} // namespace simple_response_commands_test
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc
deleted file mode 100644
index 7f260f7ddb..0000000000
--- a/src/components/application_manager/test/commands/mobile/slider_test.cc
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-#include <set>
-
-#include "application_manager/commands/mobile/slider_request.h"
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace slider_request {
-
-namespace am = application_manager;
-using am::commands::SliderRequest;
-using am::commands::CommandImpl;
-using am::commands::MessageSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 58eec42902..0000000000
--- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
-
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string>
-#include "gtest/gtest.h"
-#include "mobile/speak_request.h"
-#include "utils/shared_ptr.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "interfaces/HMI_API.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-#include "utils/make_shared.h"
-#include "smart_objects/smart_object.h"
-#include "utils/custom_string.h"
-#include "application_manager/application.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/event_engine/event.h"
-#include "application_manager/mock_hmi_interface.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace speak_request {
-
-namespace am = application_manager;
-namespace mobile_result = mobile_apis::Result;
-namespace hmi_response = ::application_manager::hmi_response;
-namespace strings = ::application_manager::strings;
-using am::commands::CommandImpl;
-using am::ApplicationManager;
-using am::commands::MessageSharedPtr;
-using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using 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
deleted file mode 100644
index 8d31b67a53..0000000000
--- a/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/include/application_manager/commands/mobile/subscribe_button_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace subscribe_button_request {
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SaveArg;
-namespace am = ::application_manager;
-using am::commands::SubscribeButtonRequest;
-using am::commands::MessageSharedPtr;
-
-typedef SharedPtr<SubscribeButtonRequest> CommandPtr;
-
-class SubscribeButtonRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- typedef TypeIf<kMocksAreNice,
- NiceMock<application_manager_test::MockHMICapabilities>,
- application_manager_test::MockHMICapabilities>::Result
- MockHMICapabilities;
-};
-
-typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
-
-TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<SubscribeButtonRequest>());
-
- ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_SubscriptionNotAllowed_UNSUCCESS) {
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] =
- mobile_apis::ButtonName::SEEKLEFT;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::REJECTED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
- CommandPtr command(CreateCommand<SubscribeButtonRequest>());
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(false));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::UNSUPPORTED_RESOURCE,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
- const mobile_apis::ButtonName::eType kButtonName =
- mobile_apis::ButtonName::SEEKLEFT;
-
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
-
- ON_CALL(hmi_capabilities, button_capabilities())
- .WillByDefault(Return(button_caps_ptr.get()));
-
- ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(true));
-
- MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
- EXPECT_EQ(mobile_apis::Result::IGNORED,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
-}
-
-TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
- const mobile_apis::ButtonName::eType kButtonName =
- mobile_apis::ButtonName::SEEKLEFT;
-
- MessageSharedPtr msg(CreateMessage());
- (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
- CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
-
- MockAppPtr app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
-
- MockHMICapabilities hmi_capabilities;
- ON_CALL(app_mngr_, hmi_capabilities())
- .WillByDefault(ReturnRef(hmi_capabilities));
- ON_CALL(hmi_capabilities, is_ui_cooperating()).WillByDefault(Return(true));
-
- MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
- (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
-
- ON_CALL(hmi_capabilities, button_capabilities())
- .WillByDefault(Return(button_caps_ptr.get()));
-
- ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
-
- MessageSharedPtr hmi_result_msg;
- EXPECT_CALL(app_mngr_, ManageHMICommand(_))
- .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
-
- MessageSharedPtr mobile_result_msg(
- CatchMobileCommandResult(CallRun(*command)));
-
- EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- static_cast<hmi_apis::FunctionID::eType>(
- (*hmi_result_msg)[am::strings::params][am::strings::function_id]
- .asInt()));
-
- EXPECT_EQ(mobile_apis::Result::SUCCESS,
- static_cast<mobile_apis::Result::eType>(
- (*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
-}
-
-} // namespace subscribe_button_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
deleted file mode 100644
index 66cd740bbe..0000000000
--- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/test/include/application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/smart_object_keys.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace subscribe_way_points_request {
-
-using ::testing::_;
-using ::testing::Return;
-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> {};
-
-TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
- CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
- MockAppPtr app(CreateMockApp());
-
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(_))
- .WillByDefault(Return(false));
- ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
- .WillByDefault(Return(true));
-
- {
- InSequence dummy;
- EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
- EXPECT_CALL(*app, UpdateHash());
- }
-
- MessageSharedPtr mobile_result_msg(
- CatchMobileCommandResult(CallRun(*command)));
-
- EXPECT_EQ(mobile_apis::Result::SUCCESS,
- static_cast<mobile_apis::Result::eType>(
- (*mobile_result_msg)[am::strings::msg_params]
- [am::strings::result_code].asInt()));
-}
-
-TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
- CommandPtr command(CreateCommand<SubscribeWayPointsRequest>());
- MockAppPtr app(CreateMockApp());
- Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- const hmi_apis::Common_Result::eType result_code =
- hmi_apis::Common_Result::SUCCESS;
- (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
- (*event_msg)[am::strings::msg_params] = 0;
-
- event.set_smart_object(*event_msg);
-
- 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
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
deleted file mode 100644
index 7cc5e59470..0000000000
--- a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/unregister_app_interface_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unregister_app_interface_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-
-using am::commands::UnregisterAppInterfaceRequest;
-using am::commands::MessageSharedPtr;
-
-typedef ::utils::SharedPtr<UnregisterAppInterfaceRequest> CommandPtr;
-
-class UnregisterAppInterfaceRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
-
-TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>());
-
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command->Run();
-}
-
-TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
- const uint32_t kConnectionKey = 1u;
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>(command_msg));
-
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .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
deleted file mode 100644
index a71f8a43c8..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/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
deleted file mode 100644
index eae368347e..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_vehicle_data_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-
-using am::commands::UnsubscribeVehicleDataRequest;
-using am::commands::MessageSharedPtr;
-
-typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
-
-namespace {
-const uint32_t kConnectionKey = 1u;
-const std::string kMsgParamKey = "test_key";
-const 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
deleted file mode 100644
index 532948e5db..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
-#include <stdint.h>
-#include <string>
-#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_vehicle_data_response {
-
-namespace commands = ::application_manager::commands;
-
-using ::testing::_;
-using ::testing::NotNull;
-using ::testing::Types;
-
-using commands::MessageSharedPtr;
-namespace am = ::application_manager;
-
-class UnsubscribeVehicleResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {};
-
-MATCHER_P(ResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<mobile_apis::Result::eType>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendFalseResponseToMobile_SendInvalidEnum) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = false;
-
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(ResultCodeIs(mobile_apis::Result::INVALID_ENUM), _));
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendSuccessfulResponseToMobile_SUCCESS) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = true;
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(ResultCodeIs(mobile_apis::Result::SUCCESS), _));
- command->Run();
-}
-
-TEST_F(UnsubscribeVehicleResponseTest,
- Run_SendResponseToMobile_SendCodeToMobile) {
- MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
- (*command_msg)[am::strings::msg_params][am::strings::success] = true;
-
- mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
- (*command_msg)[am::strings::msg_params][am::strings::result_code] =
- result_type;
- ::utils::SharedPtr<commands::UnsubscribeVehicleDataResponse> command =
- CreateCommand<commands::UnsubscribeVehicleDataResponse>(command_msg);
- EXPECT_CALL(app_mngr_, SendMessageToMobile(ResultCodeIs(result_type), _));
- command->Run();
-}
-
-} // namespace unsubscribe_vehicle_data_response
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
deleted file mode 100644
index 738cf35553..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace unsubscribe_way_points_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::UnSubscribeWayPointsRequest;
-using am::commands::MessageSharedPtr;
-
-namespace {
-const uint32_t kConnectionKey = 3u;
-const uint32_t kAppId = 5u;
-} // namespace
-
-class UnSubscribeWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UnSubscribeWayPointsRequestTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_))
- , 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,
- Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, IsAppSubscribedForWayPoints(kAppId))
- .WillOnce(Return(false));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, IsAppSubscribedForWayPoints(kAppId))
- .WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- command_->on_event(event);
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params] = 0;
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_result::SUCCESS;
- Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(kAppId));
-
- EXPECT_CALL(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 unsubscribe_way_points_request
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
deleted file mode 100644
index cab67e641c..0000000000
--- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "application_manager/commands/mobile/update_turn_list_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/mock_message_helper.h"
-#include "application_manager/mock_hmi_capabilities.h"
-#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-namespace update_turn_list_request {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
-using ::testing::Ref;
-using ::testing::Eq;
-
-using am::commands::UpdateTurnListRequest;
-using am::commands::MessageSharedPtr;
-using application_manager_test::MockHMICapabilities;
-
-namespace {
-const uint32_t kConnectionKey = 3u;
-const hmi_apis::FunctionID::eType kFunctionId =
- hmi_apis::FunctionID::Buttons_OnButtonEvent;
-const uint32_t kAppId = 5u;
-} // namespace
-
-class UpdateTurnListRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UpdateTurnListRequestTest()
- : 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 440763d4c3..de0b5afb3c 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -38,7 +38,7 @@
#include "application_manager/mock_event_observer.h"
#include "application_manager/mock_event_dispatcher.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "interfaces/HMI_API.h"
namespace test {
diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc
new file mode 100644
index 0000000000..f921eb1dde
--- /dev/null
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_resumption_data.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationKey = 2u;
+const uint32_t kAppId = 10u;
+const uint32_t kCmdId = 1u;
+const std::string kPolicyAppId = "fake_app_id";
+const uint32_t kTimeout = 10000u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+const std::string kFirstVrCommand = "first";
+const int32_t kGrammarId = 12;
+const std::string kDirectoryName = "./test_storage";
+const uint8_t expected_tread_pool_size = 2u;
+const uint8_t stop_streaming_timeout = 1u;
+const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+} // namespace
+
+using namespace application_manager;
+using namespace policy;
+using namespace test::components::commands_test;
+using namespace mobile_apis;
+
+using am::HmiStatePtr;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using testing::_;
+using testing::Mock;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
+using usage_statistics_test::MockStatisticsManager;
+
+class ApplicationImplTest : public ApplicationImpl {
+ public:
+ ApplicationImplTest(
+ uint32_t application_id,
+ const std::string& policy_app_id,
+ const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
+ const custom_str::CustomString& app_name,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
+ ApplicationManager& application_manager,
+ MockHelpPromptManager& mock_help_prompt_manager)
+ : ApplicationImpl(application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ statistics_manager,
+ application_manager)
+ , mock_help_prompt_manager_(mock_help_prompt_manager) {}
+
+ HelpPromptManager& help_prompt_manager() OVERRIDE {
+ return mock_help_prompt_manager_;
+ }
+
+ private:
+ MockHelpPromptManager& mock_help_prompt_manager_;
+};
+
+class HelpPromptManagerTest : public ::testing::Test {
+ public:
+ HelpPromptManagerTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+ void SetUp() OVERRIDE;
+ void TearDown() OVERRIDE;
+ MessageSharedPtr CreateMsgParams();
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array);
+ void CreateBasicParamsVRRequest(MessageSharedPtr msg);
+ void CreateApplication(MockHelpPromptManager& mock_help_prompt_manager);
+ HmiStatePtr CreateTestHmiState();
+
+ template <class Command>
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
+ }
+
+ protected:
+ typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager
+ MockAppManager;
+ MockAppManager app_mngr_;
+ std::shared_ptr<ApplicationImplTest> app_impl_;
+ MockHmiInterfaces mock_hmi_interfaces_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
+ sync_primitives::Lock app_lock_;
+ MockRPCService mock_rpc_service_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+ MockMessageHelper& mock_message_helper_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
+};
+
+void HelpPromptManagerTest::SetUp() {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, audio_data_stopped_timeout())
+ .WillByDefault(Return(0));
+ ON_CALL(app_mngr_settings_, video_data_stopped_timeout())
+ .WillByDefault(Return(0));
+
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+
+ std::string path = file_system::CreateDirectory("storage");
+ file_system::CreateFile(path + "/" + "certificate");
+
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
+}
+
+void HelpPromptManagerTest::TearDown() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+MessageSharedPtr HelpPromptManagerTest::CreateMsgParams() {
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+}
+
+void HelpPromptManagerTest::VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+}
+
+void HelpPromptManagerTest::CreateBasicParamsVRRequest(MessageSharedPtr msg) {
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = kFirstVrCommand;
+ msg_params[strings::type] = kPosition;
+ msg_params[strings::grammar_id] = kGrammarId;
+ msg_params[strings::info] = "VR info";
+}
+
+HmiStatePtr HelpPromptManagerTest::CreateTestHmiState() {
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+ testState->set_hmi_level(HMILevel::INVALID_ENUM);
+ testState->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ testState->set_system_context(SystemContext::SYSCTXT_MAIN);
+ return testState;
+}
+
+void HelpPromptManagerTest::CreateApplication(
+ MockHelpPromptManager& mock_help_prompt_manager) {
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ app_impl_.reset(
+ new ApplicationImplTest(kAppId,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ std::make_shared<MockStatisticsManager>(),
+ app_mngr_,
+ mock_help_prompt_manager));
+ HmiStatePtr initial_state = CreateTestHmiState();
+ app_impl_->SetInitialState(initial_state);
+}
+
+TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+}
+
+TEST_F(HelpPromptManagerTest, RemoveCommand_OnVrCommandDeleted) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+ app_impl_->RemoveCommand(kCmdId);
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_TTS_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_UI_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index 61cda5ce43..ca67d81d8c 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -1,465 +1,730 @@
{
- "UI":
- {
+ "UI": {
"language":"EN_US",
"languages":[
- "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "AR_SA",
+ "KO_KR",
+ "PT_BR",
+ "CS_CZ",
+ "DA_DK",
+ "NO_NO",
+ "NL_BE",
+ "EL_GR",
+ "HU_HU",
+ "FI_FI",
+ "SK_SK",
+ "EN_IN",
+ "TH_TH",
+ "EN_SA",
+ "HE_IL",
+ "RO_RO",
+ "UK_UA",
+ "ID_ID",
+ "VI_VN",
+ "MS_MY",
+ "HI_IN"
],
- "displayCapabilities":
+ "displayCapabilities": {
+ "displayType": "GEN2_8_DMA",
+ "displayName": "GENERIC_DISPLAY",
+ "textFields": [
{
- "displayType":"GEN2_8_DMA",
- "textFields": [{
- "name": "mainField1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField4",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "statusBar",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaClock",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaTrack",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "scrollableMessageBody",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "initialInteractionText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "ETA",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "totalDistance",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderHeader",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderFooter",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "notificationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuName",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "secondaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "tertiaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "timeToDestination",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "turnText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuTitle",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- }
- ],
- "imageFields":
- [
- {
- "name":"softButtonImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceSecondaryImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"menuIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"cmdIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"appIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"graphic",
- "imageTypeSupported":
- [
-
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"locationImage",
- "imageTypeSupported":
- [
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- }
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
+ ],
+ "imageFields": [
+ {
+ "name": "softButtonImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceSecondaryImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "menuIcon",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "cmdIcon",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "appIcon",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "graphic",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "secondaryGraphic",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "locationImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ }
- ],
- "mediaClockFormats":
- [
- "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4"
],
- "graphicSupported":true,
- "templatesAvailable":
- [
+ "mediaClockFormats": [
+ "CLOCK1",
+ "CLOCK2",
+ "CLOCK3",
+ "CLOCKTEXT1",
+ "CLOCKTEXT2",
+ "CLOCKTEXT3",
+ "CLOCKTEXT4"
+ ],
+ "graphicSupported": true,
+ "templatesAvailable": [
- "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD",
- "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY",
- "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
- "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS",
- "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS",
- "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY"
- ],
- "screenParams":
- {
- "resolution":
- {
- "resolutionWidth":800,
- "resolutionHeight":350
- },
- "touchEventAvailable":
- {
- "pressAvailable":true,
- "multiTouchAvailable":false,
- "doublePressAvailable":false
- }
- },
- "numCustomPresetsAvailable":8,
- "imageCapabilities":
- [
+ "DEFAULT",
+ "MEDIA",
+ "NON-MEDIA",
+ "ONSCREEN_PRESETS",
+ "NAV_FULLSCREEN_MAP",
+ "NAV_KEYBOARD",
+ "GRAPHIC_WITH_TEXT",
+ "TEXT_WITH_GRAPHIC",
+ "TILES_ONLY",
+ "TEXTBUTTONS_ONLY",
+ "GRAPHIC_WITH_TILES",
+ "TILES_WITH_GRAPHIC",
+ "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
+ "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC",
+ "GRAPHIC_WITH_TEXTBUTTONS",
+ "TEXTBUTTONS_WITH_GRAPHIC",
+ "LARGE_GRAPHIC_WITH_SOFTBUTTONS",
+ "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS",
+ "LARGE_GRAPHIC_ONLY"
+ ],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": false,
+ "doublePressAvailable": false
+ }
+ },
+ "numCustomPresetsAvailable": 8,
+ "imageCapabilities": [
"DYNAMIC",
"STATIC"
]
},
- "audioPassThruCapabilities":
- {
- "samplingRate" : "44KHZ",
- "bitsPerSample" : "RATE_8_BIT",
- "audioType" : "PCM"
+ "audioPassThruCapabilities": {
+ "samplingRate": "44KHZ",
+ "bitsPerSample": "RATE_8_BIT",
+ "audioType": "PCM"
},
- "pcmStreamCapabilities":
- {
- "samplingRate" : "16KHZ",
- "bitsPerSample" : "RATE_16_BIT",
- "audioType" : "PCM"
+ "pcmStreamCapabilities": {
+ "samplingRate": "16KHZ",
+ "bitsPerSample": "RATE_16_BIT",
+ "audioType": "PCM"
},
- "hmiZoneCapabilities":"FRONT",
- "softButtonCapabilities":
- [
- {
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true,
- "imageSupported" :true
- }
+ "hmiZoneCapabilities": "FRONT",
+ "softButtonCapabilities": [
+ {
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }
+ ],
+ "systemCapabilities": {
+ "navigationCapability": {
+ "sendLocationEnabled": true,
+ "getWayPointsEnabled": true
+ },
+ "phoneCapability": {
+ "dialNumberEnabled": true
+ },
+
+ "remoteControlCapability":{
+ "climateControlCapabilities": [
+ {
+ "moduleName": "primary_climate",
+ "fanSpeedAvailable": true,
+ "desiredTemperatureAvailable": true,
+ "acEnableAvailable": true,
+ "acMaxEnableAvailable": true,
+ "circulateAirEnableAvailable": true,
+ "autoModeEnableAvailable": true,
+ "dualModeEnableAvailable": true,
+ "defrostZoneAvailable": true,
+ "ventilationModeAvailable": true,
+ "defrostZone": [
+ "FRONT",
+ "REAR",
+ "ALL",
+ "NONE"
+ ],
+ "ventilationMode": [
+ "UPPER",
+ "LOWER",
+ "BOTH",
+ "NONE"
+ ]
+ }
+ ],
+ "radioControlCapabilities": [
+ {
+ "moduleName": "radio",
+ "radioEnableAvailable": true,
+ "radioBandAvailable": true,
+ "radioFrequencyAvailable": true,
+ "hdChannelAvailable": true,
+ "rdsDataAvailable": true,
+ "availableHDsAvailable": true,
+ "stateAvailable": true,
+ "signalStrengthAvailable": true,
+ "signalChangeThresholdAvailable": true
+ }
+ ],
+ "buttonCapabilities": [
+ {
+ "name": "AC_MAX",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "AC",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "RECIRCULATE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "FAN_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "FAN_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "TEMP_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "TEMP_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST_MAX",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST_REAR",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "UPPER_VENT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "LOWER_VENT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "VOLUME_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "VOLUME_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "EJECT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "SOURCE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "SHUFFLE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "REPEAT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ }
+ ]
+ },
+ "videoStreamingCapability": {
+ "preferredResolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "maxBitrate": 10000,
+ "supportedFormats": [
+ {
+ "protocol": "RAW",
+ "codec": "H264"
+ },
+ {
+ "protocol": "RTP",
+ "codec": "Theora"
+ }
+ ],
+ "hapticSpatialDataSupported": true
+ }
+ }
+ },
+ "VR": {
+ "capabilities": [
+ "TEXT"
+ ],
+ "language": "ES_MX",
+ "languages": [
+ "AR_SA",
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "KO_KR",
+ "PT_BR",
+ "CS_CZ",
+ "DA_DK",
+ "NO_NO"
]
},
- "VR":
- {
- "capabilities":["TEXT"],
- "language":"ES_MX",
- "languages":
- [
- "AR_SA", "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
- ]
-},
- "TTS":
- {
- "capabilities":["TEXT"],
- "language":"DE_DE",
- "languages":
- [
- "DA_DK","CS_CZ","KO_KR","EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","AR_SA","PT_BR","NO_NO"
+ "TTS": {
+ "capabilities": [
+ "TEXT"
+ ],
+ "language": "DE_DE",
+ "languages": [
+ "DA_DK",
+ "CS_CZ",
+ "KO_KR",
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "AR_SA",
+ "PT_BR",
+ "NO_NO"
]
},
- "Buttons":
- {
- "capabilities":
- [
+ "Buttons": {
+ "capabilities": [
+ {
+ "name": "PRESET_0",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ },
{
- "name":"PRESET_0",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_1",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_1",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_2",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_2",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_3",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_3",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_4",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_4",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_5",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_5",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_6",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_6",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_7",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_7",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_8",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_8",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_9",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_9",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "OK",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"OK",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PLAY_PAUSE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"SEEKLEFT",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "SEEKLEFT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"SEEKRIGHT",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "SEEKRIGHT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"TUNEUP",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "TUNEUP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"TUNEDOWN",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "TUNEDOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
}
],
- "presetBankCapabilities":
- {
- "onScreenPresetsAvailable":true
+ "presetBankCapabilities": {
+ "onScreenPresetsAvailable": true
}
},
- "VehicleInfo":
- {
- "make" :"Ford",
- "model" :"Fiesta",
- "modelYear" :"2013",
- "trim" :"SE"
+ "VehicleInfo": {
+ "make": "Ford",
+ "model": "Fiesta",
+ "modelYear": "2013",
+ "trim": "SE"
},
- "SyncMessageVersion":
- {
+ "SyncMessageVersion": {
"majorVersion": 3,
"minorVersion": 0
}
diff --git a/src/components/application_manager/test/hmi_capabilities_sc1.json b/src/components/application_manager/test/hmi_capabilities_sc1.json
new file mode 100644
index 0000000000..3731f8eb78
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_sc1.json
@@ -0,0 +1,9 @@
+{
+ "UI": {
+ "systemCapabilities": {
+ "phoneCapability": {
+ "dialNumberEnabled": true
+ }
+ }
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_sc2.json b/src/components/application_manager/test/hmi_capabilities_sc2.json
new file mode 100644
index 0000000000..a8578f04f5
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_sc2.json
@@ -0,0 +1,14 @@
+{
+ "UI": {
+ "systemCapabilities": {
+ "navigationCapability": {
+ "sendLocationEnabled": true,
+ "getWayPointsEnabled": false
+ },
+ "phoneCapability": {
+ },
+ "videoStreamingCapability": {
+ }
+ }
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index 4eb9f920d9..ae95fca35f 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -2,6 +2,9 @@
* Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@@ -13,7 +16,7 @@
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
- * Neither the name of the Ford Motor Company nor the names of its contributors
+ * Neither the name of the copyright holders nor the names of their contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -38,12 +41,13 @@
#include "application_manager/mock_message_helper.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API.h"
-#include "utils/make_shared.h"
+
#include "application_manager/hmi_capabilities_for_testing.h"
#include "utils/file_system.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/state_controller.h"
#include "resumption/last_state_impl.h"
#include "application_manager/resumption/resume_ctrl.h"
@@ -78,7 +82,7 @@ class HMICapabilitiesTest : public ::testing::Test {
EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
.WillOnce(Return(false));
hmi_capabilities_test =
- utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_);
+ std::make_shared<HMICapabilitiesForTesting>(app_mngr_);
hmi_capabilities_test->Init(&last_state_);
}
@@ -96,15 +100,17 @@ class HMICapabilitiesTest : public ::testing::Test {
event_engine_test::MockEventDispatcher mock_event_dispatcher;
resumption::LastStateImpl last_state_;
MockApplicationManagerSettings mock_application_manager_settings_;
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test;
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities_test;
const std::string file_name_;
+ application_manager_test::MockRPCService mock_rpc_service_;
};
const char* const cstring_values_[] = {
"EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR",
"PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "EN_AU", "ZH_CN",
"ZH_TW", "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO",
- "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK"};
+ "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK", "EN_IN", "TH_TH", "EN_SA",
+ "HE_IL", "RO_RO", "UK_UA", "ID_ID", "VI_VN", "MS_MY", "HI_IN"};
const hmi_apis::Common_Language::eType enum_values_[] = {
hmi_apis::Common_Language::EN_US, hmi_apis::Common_Language::ES_MX,
@@ -121,7 +127,12 @@ const hmi_apis::Common_Language::eType enum_values_[] = {
hmi_apis::Common_Language::DA_DK, hmi_apis::Common_Language::NO_NO,
hmi_apis::Common_Language::NL_BE, hmi_apis::Common_Language::EL_GR,
hmi_apis::Common_Language::HU_HU, hmi_apis::Common_Language::FI_FI,
- hmi_apis::Common_Language::SK_SK};
+ hmi_apis::Common_Language::SK_SK, hmi_apis::Common_Language::EN_IN,
+ hmi_apis::Common_Language::TH_TH, hmi_apis::Common_Language::EN_SA,
+ hmi_apis::Common_Language::HE_IL, hmi_apis::Common_Language::RO_RO,
+ hmi_apis::Common_Language::UK_UA, hmi_apis::Common_Language::ID_ID,
+ hmi_apis::Common_Language::VI_VN, hmi_apis::Common_Language::MS_MY,
+ hmi_apis::Common_Language::HI_IN};
struct CStringComparator {
bool operator()(const char* a, const char* b) {
@@ -177,6 +188,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
if (file_system::FileExists("./app_info_data")) {
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
+ EXPECT_CALL(app_mngr_, IsSOStructValid(_, _)).WillOnce(Return(true));
+
EXPECT_TRUE(hmi_capabilities_test->LoadCapabilitiesFromFile());
// Check active languages
@@ -242,7 +255,7 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Count of buttons in json file
const uint32_t btn_length = buttons_capabilities_so.length();
- EXPECT_EQ(15u, btn_length);
+ EXPECT_EQ(16u, btn_length);
for (uint32_t i = 0; i < btn_length; ++i) {
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists(strings::name));
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("shortPressAvailable"));
@@ -260,6 +273,9 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
static_cast<hmi_apis::Common_DisplayType::eType>(
display_capabilities_so[hmi_response::display_type].asInt()));
+ EXPECT_EQ("GENERIC_DISPLAY",
+ display_capabilities_so[hmi_response::display_name].asString());
+
EXPECT_TRUE(display_capabilities_so["graphicSupported"].asBool());
// Check text fields
@@ -351,17 +367,209 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Check vehicle type
const smart_objects::SmartObject vehicle_type_so =
*(hmi_capabilities_test->vehicle_type());
- EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool());
EXPECT_EQ("Ford", vehicle_type_so["make"].asString());
EXPECT_EQ("Fiesta", vehicle_type_so["model"].asString());
EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString());
EXPECT_EQ("SE", vehicle_type_so["trim"].asString());
+
+ // Check system capabilities
+ smart_objects::SmartObject navigation_capability_so =
+ *(hmi_capabilities_test->navigation_capability());
+
+ EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled"));
+ EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled"));
+ EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool());
+ EXPECT_TRUE(navigation_capability_so["getWayPointsEnabled"].asBool());
+
+ // since we have navigation capabilities, the feature should be supported
+ EXPECT_TRUE(hmi_capabilities_test->navigation_supported());
+
+ const smart_objects::SmartObject phone_capability_so =
+ *(hmi_capabilities_test->phone_capability());
+
+ EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled"));
+ EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool());
+
+ EXPECT_TRUE(hmi_capabilities_test->phone_call_supported());
+
+ const smart_objects::SmartObject vs_capability_so =
+ *(hmi_capabilities_test->video_streaming_capability());
+
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::preferred_resolution));
+ EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists(
+ strings::resolution_width));
+ EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists(
+ strings::resolution_height));
+ EXPECT_EQ(
+ 800,
+ vs_capability_so[strings::preferred_resolution][strings::resolution_width]
+ .asInt());
+ EXPECT_EQ(350,
+ vs_capability_so[strings::preferred_resolution]
+ [strings::resolution_height].asInt());
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::max_bitrate));
+ EXPECT_EQ(10000, vs_capability_so[strings::max_bitrate].asInt());
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::supported_formats));
+ const uint32_t supported_formats_len =
+ vs_capability_so[strings::supported_formats].length();
+ EXPECT_EQ(2u, supported_formats_len);
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists(
+ strings::protocol));
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists(
+ strings::codec));
+ EXPECT_EQ(0,
+ vs_capability_so[strings::supported_formats][0][strings::protocol]
+ .asInt());
+ EXPECT_EQ(
+ 0,
+ vs_capability_so[strings::supported_formats][0][strings::codec].asInt());
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists(
+ strings::protocol));
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists(
+ strings::codec));
+ EXPECT_EQ(1,
+ vs_capability_so[strings::supported_formats][1][strings::protocol]
+ .asInt());
+ EXPECT_EQ(
+ 2,
+ vs_capability_so[strings::supported_formats][1][strings::codec].asInt());
+
+ EXPECT_TRUE(
+ vs_capability_so.keyExists(strings::haptic_spatial_data_supported));
+ EXPECT_TRUE(
+ vs_capability_so[strings::haptic_spatial_data_supported].asBool());
+
+ EXPECT_TRUE(hmi_capabilities_test->video_streaming_supported());
+
+ // Check remote control capabilites
+ const smart_objects::SmartObject rc_capability_so =
+ *(hmi_capabilities_test->rc_capability());
+
+ EXPECT_TRUE(rc_capability_so.keyExists("climateControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("radioControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("buttonCapabilities"));
+
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"]
+ .asBool());
+ EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0]
+ ["desiredTemperatureAvailable"].asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acMaxEnableAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioBandAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioFrequencyAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["hdChannelAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["rdsDataAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(rc_capability_so["buttonCapabilities"][0]["shortPressAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["buttonCapabilities"][0]["longPressAvailable"].asBool());
+ EXPECT_FALSE(
+ rc_capability_so["buttonCapabilities"][0]["upDownAvailable"].asBool());
+}
+
+TEST_F(HMICapabilitiesTest,
+ LoadCapabilitiesFromFileAndVerifyUnsupportedSystemCapabilities) {
+ MockApplicationManager mock_app_mngr;
+ event_engine_test::MockEventDispatcher mock_dispatcher;
+ MockApplicationManagerSettings mock_application_manager_settings;
+
+ const std::string hmi_capabilities_file = "hmi_capabilities_sc1.json";
+
+ EXPECT_CALL(mock_app_mngr, event_dispatcher())
+ .WillOnce(ReturnRef(mock_dispatcher));
+ EXPECT_CALL(mock_app_mngr, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings));
+ EXPECT_CALL(mock_application_manager_settings, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(mock_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings, launch_hmi())
+ .WillOnce(Return(false));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
+ hmi_capabilities->Init(&last_state_);
+
+ // Check system capabilities; only phone capability is available
+ EXPECT_FALSE(hmi_capabilities->navigation_supported());
+ EXPECT_TRUE(hmi_capabilities->phone_call_supported());
+ EXPECT_FALSE(hmi_capabilities->video_streaming_supported());
+ EXPECT_FALSE(hmi_capabilities->rc_supported());
+
+ // verify phone capability
+ const smart_objects::SmartObject phone_capability_so =
+ *(hmi_capabilities->phone_capability());
+ EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled"));
+ EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool());
+}
+
+TEST_F(HMICapabilitiesTest,
+ LoadCapabilitiesFromFileAndVerifyEmptySystemCapabilities) {
+ MockApplicationManager mock_app_mngr;
+ event_engine_test::MockEventDispatcher mock_dispatcher;
+ MockApplicationManagerSettings mock_application_manager_settings;
+
+ const std::string hmi_capabilities_file = "hmi_capabilities_sc2.json";
+
+ EXPECT_CALL(mock_app_mngr, event_dispatcher())
+ .WillOnce(ReturnRef(mock_dispatcher));
+ EXPECT_CALL(mock_app_mngr, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings));
+ EXPECT_CALL(mock_application_manager_settings, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(mock_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings, launch_hmi())
+ .WillOnce(Return(false));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
+ hmi_capabilities->Init(&last_state_);
+
+ // Check system capabilities; only navigation capability is valid, the other
+ // two are empty
+ EXPECT_TRUE(hmi_capabilities->navigation_supported());
+ EXPECT_FALSE(hmi_capabilities->phone_call_supported());
+ EXPECT_FALSE(hmi_capabilities->video_streaming_supported());
+ EXPECT_FALSE(hmi_capabilities->rc_supported());
+
+ // verify navigation capabilities
+ smart_objects::SmartObject navigation_capability_so =
+ *(hmi_capabilities->navigation_capability());
+ EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled"));
+ EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled"));
+ EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool());
+ EXPECT_FALSE(navigation_capability_so["getWayPointsEnabled"].asBool());
}
TEST_F(HMICapabilitiesTest, VerifyImageType) {
const int32_t image_type = 1;
smart_objects::SmartObject sm_obj;
+ EXPECT_CALL(app_mngr_, IsSOStructValid(_, _)).WillOnce(Return(true));
sm_obj[hmi_response::image_capabilities][0] = image_type;
hmi_capabilities_test->set_display_capabilities(sm_obj);
@@ -375,7 +583,8 @@ void HMICapabilitiesTest::SetCooperating() {
smart_objects::SmartObjectSPtr test_so;
EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so));
- EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillRepeatedly(Return(true));
}
TEST_F(HMICapabilitiesTest, SetVRCooperating) {
diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc
index 2020da5052..ec88075212 100644
--- a/src/components/application_manager/test/hmi_language_handler_test.cc
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -42,10 +42,10 @@
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/smart_object_keys.h"
#include "test/resumption/mock_last_state.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
namespace test {
@@ -56,7 +56,6 @@ namespace am = ::application_manager;
using am::event_engine::Event;
using am::ApplicationSet;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -72,8 +71,9 @@ typedef NiceMock<
typedef NiceMock< ::test::components::event_engine_test::MockEventDispatcher>
MockEventDispatcher;
typedef NiceMock<application_manager_test::MockApplication> MockApp;
+typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
-typedef SharedPtr<MockApp> ApplicationSharedPtr;
+typedef std::shared_ptr<MockApp> ApplicationSharedPtr;
typedef am::HMILanguageHandler::Apps Apps;
namespace {
@@ -82,11 +82,12 @@ const uint32_t kDefaultAppsSize = 0u;
class HmiLanguageHandlerTest : public ::testing::Test {
public:
- HmiLanguageHandlerTest() {
+ HmiLanguageHandlerTest()
+ : app_set_lock_(std::make_shared<sync_primitives::Lock>()) {
EXPECT_CALL(app_manager_, event_dispatcher())
.WillOnce(ReturnRef(event_dispatcher_));
hmi_language_handler_ =
- ::utils::MakeShared<am::HMILanguageHandler>(app_manager_);
+ std::make_shared<am::HMILanguageHandler>(app_manager_);
}
void InitHMIActiveLanguages(hmi_apis::Common_Language::eType ui_language,
@@ -111,7 +112,7 @@ class HmiLanguageHandlerTest : public ::testing::Test {
ApplicationSharedPtr CreateMockApp(const uint32_t app_id,
bool expect_call = false) const {
- ApplicationSharedPtr app = ::utils::MakeShared<MockApp>();
+ ApplicationSharedPtr app = std::make_shared<MockApp>();
if (expect_call) {
EXPECT_CALL(*app, app_id()).WillRepeatedly(Return(app_id));
} else {
@@ -132,9 +133,10 @@ class HmiLanguageHandlerTest : public ::testing::Test {
MockApplicationManager app_manager_;
MockHMICapabilities hmi_capabilities_;
MockEventDispatcher event_dispatcher_;
- SharedPtr<am::HMILanguageHandler> hmi_language_handler_;
- ::sync_primitives::Lock app_set_lock_;
+ std::shared_ptr<am::HMILanguageHandler> hmi_language_handler_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_;
resumption_test::MockLastState last_state_;
+ MockRPCService mock_rpc_service_;
};
TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
@@ -164,7 +166,8 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
// So if they same app_manager_'s method `applications`
// will never be called.
EXPECT_CALL(app_manager_, applications()).Times(0);
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
hmi_language_handler_->on_event(tts_event);
@@ -201,7 +204,8 @@ TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_SUCCESS) {
// the `applications` will be called and
// app data will checked by `CheckApplication` method
ON_CALL(app_manager_, applications()).WillByDefault(Return(data_accessor));
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
@@ -311,12 +315,14 @@ TEST_F(HmiLanguageHandlerTest,
// Needed to call of `ManageMobileCommand` method
ON_CALL(*am::MockMessageHelper::message_helper_mock(),
GetOnAppInterfaceUnregisteredNotificationToMobile(_, _))
- .WillByDefault(Return(::utils::MakeShared<smart_objects::SmartObject>()));
+ .WillByDefault(Return(std::make_shared<smart_objects::SmartObject>()));
// Wait for `ManageMobileCommand` call twice.
// First time in `SendOnLanguageChangeToMobile`
// method, second time in `HandleWrongLanguageApp`.
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(2);
+ EXPECT_CALL(app_manager_, GetRPCService())
+ .WillRepeatedly(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(2);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(1);
hmi_language_handler_->on_event(event);
}
@@ -344,7 +350,8 @@ TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
hmi_apis::Common_Language::eType::RU_RU,
hmi_apis::Common_Language::eType::RU_RU);
- EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, GetRPCService()).Times(0);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
hmi_language_handler_->on_event(event);
}
diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
index e5a45c1549..1980ffa100 100644
--- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
@@ -36,12 +36,13 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/commands_test.h"
+#include "application_manager/test/include/application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+
#include "application_manager/event_engine/event.h"
namespace test {
@@ -94,7 +95,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
MessageSharedPtr CatchMobileCommandResult(CallableT delegate,
bool call_return = true) {
MessageSharedPtr result_msg;
- EXPECT_CALL(this->app_mngr_, ManageMobileCommand(_, _))
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
delegate();
return result_msg;
@@ -104,7 +105,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
MessageSharedPtr CatchHMICommandResult(CallableT delegate,
bool call_return = true) {
MessageSharedPtr result_msg;
- EXPECT_CALL(this->app_mngr_, ManageHMICommand(_))
+ EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return)));
delegate();
return result_msg;
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
index b6733b5818..9a961ea1a9 100644
--- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -36,15 +36,18 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "test/application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_hmi_interface.h"
-#include "application_manager/mock_application.h"
-
+#include "application_manager/test/include/application_manager/mock_hmi_interface.h"
+#include "application_manager/test/include/application_manager/mock_application.h"
+#include "application_manager/test/include/application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_rpc_service.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
@@ -54,15 +57,16 @@ namespace am = ::application_manager;
using ::testing::ReturnRef;
using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Mock;
using ::testing::_;
-using ::utils::SharedPtr;
using ::smart_objects::SmartObject;
using am::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
using ::test::components::application_manager_test::MockApplication;
// Depending on the value type will be selected
@@ -92,67 +96,140 @@ class CommandsTest : public ::testing::Test {
enum { kMocksAreNice = kIsNice };
typedef NiceMock<MockApplicationManagerSettings> MockAppManagerSettings;
+ typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
typedef typename TypeIf<kIsNice,
NiceMock<MockApplicationManager>,
MockApplicationManager>::Result MockAppManager;
typedef typename TypeIf<kIsNice,
NiceMock<MockApplication>,
MockApplication>::Result MockApp;
- typedef SharedPtr<MockApp> MockAppPtr;
+ typedef std::shared_ptr<MockApp> MockAppPtr;
- virtual ~CommandsTest() {}
+ virtual ~CommandsTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
static MessageSharedPtr CreateMessage(
const smart_objects::SmartType type = smart_objects::SmartType_Null) {
- return ::utils::MakeShared<SmartObject>(type);
+ return std::make_shared<SmartObject>(type);
}
static MockAppPtr CreateMockApp() {
- return ::utils::MakeShared<MockApp>();
+ return std::make_shared<MockApp>();
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout,
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(const uint32_t timeout,
+ MessageSharedPtr& msg) {
InitCommand(timeout);
- return ::utils::MakeShared<Command>((msg ? msg : msg = CreateMessage()),
- app_mngr_);
+ return std::make_shared<Command>((msg ? msg : msg = CreateMessage()),
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
template <class Command>
- SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
return CreateCommand<Command>(kDefaultTimeout_, msg);
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) {
+ std::shared_ptr<Command> CreateCommand(
+ const uint32_t timeout = kDefaultTimeout_) {
InitCommand(timeout);
MessageSharedPtr msg = CreateMessage();
- return ::utils::MakeShared<Command>(msg, app_mngr_);
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
enum { kDefaultTimeout_ = 100 };
MockAppManager app_mngr_;
+ MockRPCService mock_rpc_service_;
+ testing::NiceMock<application_manager_test::MockHMICapabilities>
+ mock_hmi_capabilities_;
+ testing::NiceMock<policy_test::MockPolicyHandlerInterface>
+ mock_policy_handler_;
MockAppManagerSettings app_mngr_settings_;
MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+ am::MockMessageHelper& mock_message_helper_;
protected:
virtual void InitCommand(const uint32_t& timeout) {
+ timeout_ = timeout;
ON_CALL(app_mngr_, get_settings())
.WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, default_timeout())
- .WillByDefault(ReturnRef(timeout));
+ .WillByDefault(ReturnRef(timeout_));
}
- CommandsTest() {
+ CommandsTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , timeout_(0) {
ON_CALL(app_mngr_, hmi_interfaces())
.WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ InitHMIToMobileResultConverter();
}
+
+ void InitHMIToMobileResultConverter() {
+ namespace MobileResult = mobile_apis::Result;
+ namespace HMIResult = hmi_apis::Common_Result;
+ auto link_hmi_to_mob_result =
+ [this](HMIResult::eType hmi_result, MobileResult::eType mobile_result) {
+ ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result))
+ .WillByDefault(Return(mobile_result));
+ };
+ link_hmi_to_mob_result(HMIResult::INVALID_ENUM, MobileResult::INVALID_ENUM);
+ link_hmi_to_mob_result(HMIResult::SUCCESS, MobileResult::SUCCESS);
+ link_hmi_to_mob_result(HMIResult::UNSUPPORTED_REQUEST,
+ MobileResult::UNSUPPORTED_REQUEST);
+ link_hmi_to_mob_result(HMIResult::UNSUPPORTED_RESOURCE,
+ MobileResult::UNSUPPORTED_RESOURCE);
+ link_hmi_to_mob_result(HMIResult::DISALLOWED, MobileResult::DISALLOWED);
+ link_hmi_to_mob_result(HMIResult::REJECTED, MobileResult::REJECTED);
+ link_hmi_to_mob_result(HMIResult::ABORTED, MobileResult::ABORTED);
+ link_hmi_to_mob_result(HMIResult::IGNORED, MobileResult::IGNORED);
+ link_hmi_to_mob_result(HMIResult::RETRY, MobileResult::RETRY);
+ link_hmi_to_mob_result(HMIResult::IN_USE, MobileResult::IN_USE);
+ link_hmi_to_mob_result(HMIResult::TIMED_OUT, MobileResult::TIMED_OUT);
+ link_hmi_to_mob_result(HMIResult::INVALID_DATA, MobileResult::INVALID_DATA);
+ link_hmi_to_mob_result(HMIResult::CHAR_LIMIT_EXCEEDED,
+ MobileResult::CHAR_LIMIT_EXCEEDED);
+ link_hmi_to_mob_result(HMIResult::INVALID_ID, MobileResult::INVALID_ID);
+ link_hmi_to_mob_result(HMIResult::DUPLICATE_NAME,
+ MobileResult::DUPLICATE_NAME);
+ link_hmi_to_mob_result(HMIResult::APPLICATION_NOT_REGISTERED,
+ MobileResult::APPLICATION_NOT_REGISTERED);
+ link_hmi_to_mob_result(HMIResult::WRONG_LANGUAGE,
+ MobileResult::WRONG_LANGUAGE);
+ link_hmi_to_mob_result(HMIResult::OUT_OF_MEMORY,
+ MobileResult::OUT_OF_MEMORY);
+ link_hmi_to_mob_result(HMIResult::TOO_MANY_PENDING_REQUESTS,
+ MobileResult::TOO_MANY_PENDING_REQUESTS);
+ link_hmi_to_mob_result(HMIResult::WARNINGS, MobileResult::WARNINGS);
+ link_hmi_to_mob_result(HMIResult::GENERIC_ERROR,
+ MobileResult::GENERIC_ERROR);
+ link_hmi_to_mob_result(HMIResult::USER_DISALLOWED,
+ MobileResult::USER_DISALLOWED);
+ link_hmi_to_mob_result(HMIResult::TRUNCATED_DATA,
+ MobileResult::TRUNCATED_DATA);
+ link_hmi_to_mob_result(HMIResult::SAVED, MobileResult::SAVED);
+ link_hmi_to_mob_result(HMIResult::DATA_NOT_AVAILABLE,
+ MobileResult::DATA_NOT_AVAILABLE);
+ link_hmi_to_mob_result(HMIResult::READ_ONLY, MobileResult::READ_ONLY);
+ }
+
+ private:
+ uint32_t timeout_;
};
MATCHER_P(MobileResultCodeIs, result_code, "") {
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 2617f777bb..fe16e8ce6e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -34,9 +34,11 @@
#include <string>
#include "gmock/gmock.h"
#include "application_manager/application.h"
+#include "application_manager/app_extension.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/usage_statistics.h"
+#include "utils/semantic_version.h"
namespace test {
namespace components {
@@ -49,8 +51,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(curHash, const std::string&());
MOCK_METHOD0(UpdateHash, void());
- MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag));
+ MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
+ MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool flag));
MOCK_CONST_METHOD0(is_application_data_changed, bool());
MOCK_METHOD1(set_is_application_data_changed,
void(bool state_application_data));
@@ -59,6 +61,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD0(ChangeSupportingAppHMIType, void());
MOCK_CONST_METHOD0(is_navi, bool());
MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(mobile_projection_enabled, bool());
+ MOCK_METHOD1(set_mobile_projection_enabled, void(bool allow));
MOCK_CONST_METHOD0(video_streaming_approved, bool());
MOCK_METHOD1(set_video_streaming_approved, void(bool state));
MOCK_CONST_METHOD0(audio_streaming_approved, bool());
@@ -68,6 +72,9 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
MOCK_CONST_METHOD0(is_audio, bool());
+ MOCK_METHOD2(SetVideoConfig,
+ bool(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params));
MOCK_METHOD1(StartStreaming,
void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
@@ -97,16 +104,22 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
MOCK_CONST_METHOD0(audio_streaming_state,
const mobile_apis::AudioStreamingState::eType());
+ MOCK_CONST_METHOD0(video_streaming_state,
+ const mobile_apis::VideoStreamingState::eType());
MOCK_CONST_METHOD0(app_icon_path, const std::string&());
MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ MOCK_CONST_METHOD0(secondary_device, connection_handler::DeviceHandle());
MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(IsAllowedToChangeAudioSource, bool());
MOCK_CONST_METHOD0(PostponedHmiState,
const application_manager::HmiStatePtr());
MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
MOCK_METHOD0(tts_properties_in_none, bool());
MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
MOCK_METHOD0(tts_properties_in_full, bool());
+ MOCK_METHOD1(set_keep_context, void(bool keep_context));
+ MOCK_METHOD0(keep_context, bool());
MOCK_METHOD1(set_version,
void(const ::application_manager::Version& version));
MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
@@ -117,15 +130,21 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
MOCK_METHOD1(set_app_allowed, void(const bool allowed));
MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_METHOD1(set_secondary_device,
+ void(connection_handler::DeviceHandle secondary_device));
MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
MOCK_METHOD1(
set_protocol_version,
- void(const ::application_manager::ProtocolVersion& protocol_version));
+ void(const ::protocol_handler::MajorProtocolVersion& protocol_version));
MOCK_CONST_METHOD0(protocol_version,
- ::application_manager::ProtocolVersion());
+ ::protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(set_is_resuming, void(bool));
MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(set_deferred_resumption_hmi_level,
+ void(application_manager::mobile_api::HMILevel::eType level));
+ MOCK_CONST_METHOD0(deferred_resumption_hmi_level,
+ application_manager::mobile_api::HMILevel::eType());
MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
@@ -139,14 +158,16 @@ class MockApplication : public ::application_manager::Application {
bool(mobile_apis::ButtonName::eType btn_name));
MOCK_METHOD1(UnsubscribeFromButton,
bool(mobile_apis::ButtonName::eType btn_name));
- MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
- MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
- MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
MOCK_METHOD0(ResetDataInNone, void());
MOCK_METHOD2(AreCommandLimitsExceeded,
bool(mobile_apis::FunctionID::eType cmd_id,
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD0(help_prompt_manager,
+ ::application_manager::HelpPromptManager&());
+ MOCK_CONST_METHOD0(help_prompt_manager,
+ const ::application_manager::HelpPromptManager&());
+ MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetPostponedState,
void(::application_manager::HmiStatePtr state));
@@ -160,6 +181,7 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
MOCK_CONST_METHOD0(IsAudioApplication, bool());
+ MOCK_CONST_METHOD0(IsVideoApplication, bool());
MOCK_METHOD0(LoadPersistentFiles, void());
// InitialApplicationData methods
MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
@@ -170,6 +192,7 @@ class MockApplication : public ::application_manager::Application {
const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&());
MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&());
+ MOCK_CONST_METHOD0(msg_version, const utils::SemanticVersion&());
MOCK_METHOD1(set_app_types,
void(const smart_objects::SmartObject& app_types));
MOCK_METHOD1(set_vr_synonyms,
@@ -182,6 +205,7 @@ class MockApplication : public ::application_manager::Application {
void(const mobile_apis::Language::eType& language));
MOCK_METHOD1(set_ui_language,
void(const mobile_apis::Language::eType& ui_language));
+ MOCK_METHOD1(set_msg_version, void(const utils::SemanticVersion& version));
// DynamicApplicationData methods
MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
@@ -193,12 +217,12 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(
SubscribedButtons,
DataAccessor< ::application_manager::ButtonSubscriptions>());
- MOCK_CONST_METHOD0(
- SubscribedIVI,
- DataAccessor< ::application_manager::VehicleInfoSubscriptions>());
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(day_color_scheme, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(night_color_scheme, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(display_layout, const std::string&());
MOCK_METHOD1(load_global_properties,
void(const smart_objects::SmartObject& so));
MOCK_METHOD1(set_help_prompt,
@@ -222,6 +246,11 @@ class MockApplication : public ::application_manager::Application {
void(const smart_objects::SmartObject& menu_title));
MOCK_METHOD1(set_menu_icon,
void(const smart_objects::SmartObject& menu_icon));
+ MOCK_METHOD1(set_day_color_scheme,
+ void(const smart_objects::SmartObject& color_scheme));
+ MOCK_METHOD1(set_night_color_scheme,
+ void(const smart_objects::SmartObject& color_scheme));
+ MOCK_METHOD1(set_display_layout, void(const std::string& layout));
MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t());
MOCK_METHOD1(set_audio_stream_retry_number,
void(const uint32_t& audio_stream_retry_number));
@@ -275,12 +304,44 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(bundle_id, const std::string&());
MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id));
MOCK_METHOD0(GetAvailableDiskSpace, uint32_t());
+
MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id));
MOCK_CONST_METHOD0(is_foreground, bool());
MOCK_METHOD1(set_foreground, void(bool is_foreground));
MOCK_CONST_METHOD0(IsRegistered, bool());
MOCK_CONST_METHOD0(SchemaUrl, std::string());
MOCK_CONST_METHOD0(PackageName, std::string());
+ MOCK_METHOD1(PushMobileMessage, void(smart_objects::SmartObjectSPtr message));
+ MOCK_METHOD1(
+ SwapMobileMessageQueue,
+ void(::application_manager::MobileMessageQueue& mobile_messages));
+
+ MOCK_METHOD1(
+ set_system_context,
+ void(const application_manager::mobile_api::SystemContext::eType&));
+ MOCK_METHOD1(
+ set_audio_streaming_state,
+ void(const application_manager::mobile_api::AudioStreamingState::eType&
+ state));
+ MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(SubscribeToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(
+ set_hmi_level,
+ void(const application_manager::mobile_api::HMILevel::eType& hmi_level));
+ MOCK_METHOD1(QueryInterface,
+ application_manager::AppExtensionPtr(
+ application_manager::AppExtensionUID uid));
+ MOCK_METHOD1(AddExtension,
+ bool(application_manager::AppExtensionPtr extention));
+ MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
+ MOCK_CONST_METHOD0(Extensions,
+ const std::list<application_manager::AppExtensionPtr>&());
+ MOCK_CONST_METHOD0(is_remote_control_supported, bool());
+ MOCK_METHOD1(set_remote_control_supported, void(const bool allow));
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_application_helper.h b/src/components/application_manager/test/include/application_manager/mock_application_helper.h
new file mode 100644
index 0000000000..1013af26bd
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_application_helper.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockApplicationHelper {
+ public:
+ MOCK_METHOD2(RecallApplicationData,
+ void(application_manager::ApplicationSharedPtr,
+ application_manager::ApplicationManager&));
+
+ static MockApplicationHelper& application_helper_mock();
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
new file mode 100644
index 0000000000..c49b5e7ce2
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/command_factory.h"
+#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockCommandFactory : public application_manager::CommandFactory {
+ public:
+ MOCK_METHOD2(CreateCommand,
+ application_manager::CommandSharedPtr(
+ const application_manager::commands::MessageSharedPtr&,
+ application_manager::commands::Command::CommandSource));
+ MOCK_CONST_METHOD2(
+ IsAbleToProcess,
+ bool(const int32_t,
+ const application_manager::commands::Command::CommandSource));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
new file mode 100644
index 0000000000..a415f94d56
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using namespace application_manager;
+
+class MockHelpPromptManager : public ::application_manager::HelpPromptManager {
+ public:
+ MockHelpPromptManager() {}
+ MOCK_METHOD3(OnVrCommandAdded,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool should_send_requests));
+ MOCK_METHOD2(OnVrCommandDeleted,
+ void(uint32_t cmd_id, const bool should_send_requests));
+ MOCK_METHOD2(OnSetGlobalPropertiesReceived,
+ void(const smart_objects::SmartObject& msg, bool is_response));
+ MOCK_CONST_METHOD0(GetSendingType, SendingType());
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
index a8664f5e2c..468bdbe5eb 100644
--- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
@@ -61,6 +61,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(is_ivi_cooperating, bool());
MOCK_METHOD1(set_is_ivi_cooperating, void(const bool value));
+ MOCK_CONST_METHOD0(is_rc_cooperating, bool());
+ MOCK_METHOD1(set_is_rc_cooperating, void(const bool value));
+
MOCK_CONST_METHOD0(attenuated_supported, bool());
MOCK_METHOD1(set_attenuated_supported, void(const bool state));
@@ -154,6 +157,30 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(phone_call_supported, bool());
MOCK_METHOD1(set_phone_call_supported, void(const bool supported));
+ MOCK_CONST_METHOD0(video_streaming_supported, bool());
+ MOCK_METHOD1(set_video_streaming_supported, void(const bool supported));
+
+ MOCK_CONST_METHOD0(rc_supported, bool());
+ MOCK_METHOD1(set_rc_supported, void(const bool supported));
+
+ MOCK_CONST_METHOD0(navigation_capability,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_navigation_capability,
+ void(const smart_objects::SmartObject& navigation_capability));
+
+ MOCK_CONST_METHOD0(phone_capability, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_phone_capability,
+ void(const smart_objects::SmartObject& phone_capability));
+
+ MOCK_CONST_METHOD0(video_streaming_capability,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(
+ set_video_streaming_capability,
+ void(const smart_objects::SmartObject& video_streaming_capability));
+ MOCK_CONST_METHOD0(rc_capability, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_rc_capability,
+ void(const smart_objects::SmartObject& rc_capability));
+
MOCK_METHOD1(Init, void(resumption::LastState* last_state));
MOCK_CONST_METHOD0(ccpu_version, const std::string&());
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index d0e8338d77..84a3b6bc87 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -40,11 +40,18 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager.h"
#include "smart_objects/smart_object.h"
+#include "transport_manager/common.h"
namespace application_manager {
class MockMessageHelper {
public:
+ MOCK_METHOD2(CreateNotification,
+ smart_objects::SmartObjectSPtr(mobile_apis::FunctionID::eType,
+ uint32_t));
+ MOCK_METHOD1(CreateHMINotification,
+ smart_objects::SmartObjectSPtr(hmi_apis::FunctionID::eType));
+
MOCK_METHOD1(GetHashUpdateNotification,
smart_objects::SmartObjectSPtr(const uint32_t app_id));
MOCK_METHOD2(SendHashUpdateNotification,
@@ -70,6 +77,10 @@ class MockMessageHelper {
const connection_handler::DeviceMap& devices,
const policy::PolicyHandlerInterface& policy_handler,
ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendNaviSetVideoConfig,
+ void(int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params));
MOCK_METHOD2(SendNaviStartStream,
void(int32_t connection_key, ApplicationManager& app_mngr));
MOCK_METHOD2(SendNaviStopStream,
@@ -109,7 +120,17 @@ class MockMessageHelper {
uint32_t correlation_id,
ApplicationManager& app_mngr));
MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager& app_mngr));
-
+ MOCK_METHOD4(SendActivateAppToHMI,
+ void(uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority));
+ MOCK_METHOD2(CreateMessageForHMI,
+ smart_objects::SmartObjectSPtr(hmi_apis::messageType::eType,
+ const uint32_t));
+ MOCK_METHOD2(SendHMIStatusNotification,
+ void(const Application& application_impl,
+ ApplicationManager& application_manager));
MOCK_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
const uint32_t timeout,
@@ -118,11 +139,20 @@ class MockMessageHelper {
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,
@@ -153,8 +183,10 @@ class MockMessageHelper {
MOCK_METHOD1(CreateAddVRCommandRequestFromChoiceToHMI,
smart_objects::SmartObjectList(ApplicationConstSharedPtr app));
MOCK_METHOD1(SendGlobalPropertiesToHMI, void(ApplicationConstSharedPtr app));
- MOCK_METHOD1(GetIVISubscriptionRequests,
- smart_objects::SmartObjectList(ApplicationSharedPtr app));
+ MOCK_METHOD3(VerifyTtsFiles,
+ mobile_apis::Result::eType(smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
MOCK_METHOD3(VerifyImageFiles,
mobile_apis::Result::eType(smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -163,6 +195,9 @@ class MockMessageHelper {
mobile_apis::Result::eType(smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD1(CheckChoiceSetVRCommands,
+ MessageHelper::ChoiceSetVRCommandsStatus(
+ const smart_objects::SmartObject&));
MOCK_METHOD6(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
@@ -173,7 +208,7 @@ class MockMessageHelper {
bool send_policy_priority,
ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr(
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason));
MOCK_METHOD4(ProcessSoftButtons,
@@ -204,6 +239,12 @@ class MockMessageHelper {
MOCK_METHOD2(SendUIChangeRegistrationRequestToHMI,
void(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD5(CreateDeviceInfo,
+ bool(connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output));
MOCK_METHOD5(CreateHMIApplicationStruct,
bool(ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -245,6 +286,28 @@ class MockMessageHelper {
ApplicationManager& application_manager));
MOCK_METHOD1(StringifiedHMILevel,
std::string(const mobile_apis::HMILevel::eType hmi_level));
+ MOCK_METHOD2(GetDeviceMacAddressForHandle,
+ std::string(const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteCommandRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteSubmenuRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteChoiceSetRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendResetPropertiesRequest,
+ void(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendUnsubscribeButtonNotification,
+ void(mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
static MockMessageHelper* message_helper_mock();
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
index b06b207f84..0fa7a898be 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
@@ -48,13 +48,23 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD1(RemoveApplicationFromSaved,
bool(app_mngr::ApplicationConstSharedPtr application));
MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(OnIgnitionOff, void());
MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD0(LowVoltageTime, time_t());
+ MOCK_CONST_METHOD0(WakeUpTime, time_t());
+ MOCK_METHOD0(SaveLowVoltageTime, void());
+ MOCK_METHOD0(SaveWakeUpTime, void());
+ MOCK_METHOD0(ResetLowVoltageTime, void());
+ MOCK_METHOD0(ResetWakeUpTime, void());
+ MOCK_CONST_METHOD0(is_suspended, bool());
MOCK_METHOD0(StopSavePersistentDataTimer, void());
+ MOCK_METHOD0(StartSavePersistentDataTimer, void());
MOCK_METHOD2(StartResumption,
bool(app_mngr::ApplicationSharedPtr application,
const std::string& hash));
MOCK_METHOD1(StartResumptionOnlyHMILevel,
bool(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(RetryResumption, void(const uint32_t app_id));
MOCK_METHOD1(CheckPersistenceFilesForResumption,
bool(app_mngr::ApplicationSharedPtr application));
MOCK_METHOD2(CheckApplicationHash,
@@ -93,7 +103,8 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
#ifdef BUILD_TESTS
MOCK_METHOD1(set_resumption_storage,
- void(utils::SharedPtr<resumption::ResumptionData> mock_storage));
+ void(std::shared_ptr<resumption::ResumptionData> mock_storage));
+ MOCK_CONST_METHOD0(get_resumption_active, bool());
#endif // BUILD_TESTS
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index 7b16a3bf00..38d1944dba 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -60,11 +60,17 @@ class MockResumptionData : public ::resumption::ResumptionData {
uint32_t(const std::string& policy_app_id,
const std::string& device_id));
MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(IncrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetHashId,
bool(const std::string& policy_app_id,
const std::string& device_id,
std::string& hash_id));
MOCK_METHOD0(OnAwake, void());
+ MOCK_METHOD0(IncrementGlobalIgnOnCounter, void());
+ MOCK_CONST_METHOD0(GetGlobalIgnOnCounter, uint32_t());
+ MOCK_METHOD0(ResetGlobalIgnOnCount, void());
+
+ MOCK_METHOD0(DecrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
const std::string& device_id,
diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index 436c8c165e..4e614c4d9f 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -39,6 +39,7 @@
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_app_extension.h"
#include "utils/data_accessor.h"
#include "config_profile/profile.h"
#include "application_manager/policies/policy_handler.h"
@@ -68,12 +69,17 @@ class ResumptionDataTest : public ::testing::Test {
, kCountOfSubmenues_(3u)
, kCountOfFiles_(8u)
, kCountOfVrhelptitle_(2u)
- , kMacAddress_("12345") {}
+ , kMacAddress_("12345")
+ , sublock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , comlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , setlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , btnlock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , ivilock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
// Check structure in saved application
void CheckSavedApp(sm::SmartObject& saved_data);
// Set data for resumption
virtual void PrepareData();
- utils::SharedPtr<NiceMock<application_manager_test::MockApplication> >
+ std::shared_ptr<NiceMock<application_manager_test::MockApplication> >
app_mock;
profile::Profile profile_;
@@ -119,7 +125,8 @@ class ResumptionDataTest : public ::testing::Test {
void CheckMenuIcon(sm::SmartObject& res_list);
void CheckHelpPrompt(sm::SmartObject& res_list);
void CheckTimeoutPrompt(sm::SmartObject& res_list);
- void CheckVRHelp(NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list);
+ void CheckVRHelp(
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list);
void CheckVRTitle(sm::SmartObject& res_list);
void CheckSubscriptions(sm::SmartObject& res_list);
@@ -137,16 +144,18 @@ class ResumptionDataTest : public ::testing::Test {
am::AppFilesMap app_files_map_;
am::ButtonSubscriptions btn_subscr;
- am::VehicleInfoSubscriptions ivi;
- sync_primitives::Lock sublock_;
- sync_primitives::Lock comlock_;
- sync_primitives::Lock setlock_;
- sync_primitives::Lock btnlock_;
- sync_primitives::Lock ivilock_;
+ std::shared_ptr<sync_primitives::Lock> sublock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> comlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> setlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> btnlock_ptr_;
+ std::shared_ptr<sync_primitives::Lock> ivilock_ptr_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_application_manager_;
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
+ mock_app_extension_;
+ std::list<application_manager::AppExtensionPtr> extensions_;
};
} // namespace resumption_test
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index 932f3ccb04..d115ad8b40 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -48,7 +48,7 @@ set(LIBRARIES
)
set(SOURCES
- #${COMPONENTS_DIR}/application_manager/test/message_helper/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/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index ef0cab13bf..15a09c33cc 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -35,17 +35,24 @@
#include "gmock/gmock.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
+
#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "utils/custom_string.h"
+#include "utils/lock.h"
#include "policy/mock_policy_settings.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "policy/policy_external/include/policy/policy_types.h"
+#endif
+
namespace test {
namespace components {
namespace application_manager_test {
@@ -56,14 +63,16 @@ namespace MobileResults = mobile_apis::Result;
using namespace application_manager;
-typedef utils::SharedPtr<MockApplication> MockApplicationSharedPtr;
+typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr;
typedef std::vector<std::string> StringArray;
-typedef utils::SharedPtr<application_manager::Application> ApplicationSharedPtr;
+typedef std::shared_ptr<application_manager::Application> ApplicationSharedPtr;
using testing::AtLeast;
using testing::ReturnRefOfCopy;
using testing::ReturnRef;
using testing::Return;
+using testing::SaveArg;
+using testing::_;
TEST(MessageHelperTestCreate,
CreateBlockedByPoliciesResponse_SmartObject_Equal) {
@@ -78,7 +87,7 @@ TEST(MessageHelperTestCreate,
application_manager::MessageHelper::CreateBlockedByPoliciesResponse(
function_id, result, correlation_id, connection_key);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -90,7 +99,8 @@ TEST(MessageHelperTestCreate,
obj[strings::params][strings::correlation_id].asUInt());
EXPECT_EQ(connection_key,
obj[strings::params][strings::connection_key].asUInt());
- EXPECT_EQ(kV2, obj[strings::params][strings::protocol_version].asInt());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ obj[strings::params][strings::protocol_version].asInt());
}
TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
@@ -99,7 +109,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -118,7 +128,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -133,12 +143,19 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, help_prompt()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, timeout_prompt()).Times(AtLeast(1));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -147,9 +164,9 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr objPtr =
- MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*objPtr)[0][strings::vr_help_title] = "111";
(*objPtr)[1][strings::vr_help] = "222";
@@ -182,6 +199,13 @@ TEST(MessageHelperTestCreate,
.WillRepeatedly(Return(&(*objPtr)[4]));
EXPECT_CALL(*appSharedMock, app_id()).WillRepeatedly(Return(0));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -201,10 +225,10 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
const smart_objects::SmartObject& object = *smartObjectPtr;
@@ -227,9 +251,10 @@ TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Empty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
::application_manager::CommandsMap vis;
- DataAccessor<application_manager::CommandsMap> data_accessor(vis, true);
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -242,11 +267,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
CommandsMap vis;
- DataAccessor<CommandsMap> data_accessor(vis, true);
+ DataAccessor<CommandsMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -283,9 +309,10 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
- DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -298,11 +325,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
- DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -344,11 +372,12 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
- DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -383,9 +412,10 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
- DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
+ DataAccessor< ::application_manager::SubMenuMap> data_accessor(
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor));
@@ -405,7 +435,7 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) {
smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse(
connection_key, function_id, correlation_id, result_code);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -442,7 +472,9 @@ class MessageHelperTest : public ::testing::Test {
"RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE",
"PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP",
"AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO",
- "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"}
+ "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK", "EN-IN",
+ "TH-TH", "EN-SA", "HE-IL", "RO-RO", "UK-UA", "ID-ID",
+ "VI-VN", "MS-MY", "HI-IN"}
, hmi_result_strings{"SUCCESS",
"UNSUPPORTED_REQUEST",
"UNSUPPORTED_RESOURCE",
@@ -541,10 +573,7 @@ class MessageHelperTest : public ::testing::Test {
"DiagnosticMessage",
"SystemRequest",
"SendLocation",
- "DialNumber",
- "GetWayPoints",
- "SubscribeWayPoints",
- "UnsubscribeWayPoints"}
+ "DialNumber"}
, events_id_strings{"OnHMIStatus",
"OnAppInterfaceUnregistered",
"OnButtonEvent",
@@ -565,6 +594,7 @@ class MessageHelperTest : public ::testing::Test {
protected:
application_manager_test::MockApplicationManager mock_application_manager;
+ application_manager_test::MockRPCService mock_rpc_service_;
const StringArray language_strings;
const StringArray hmi_result_strings;
const StringArray mobile_result_strings;
@@ -685,7 +715,7 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_WrongStrings_False) {
"soft_button1\\n",
"soft_button1\\t"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_FALSE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_FALSE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
@@ -696,33 +726,14 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) {
"soft_button1??....asd",
"soft_button12313fcvzxc./.,"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_TRUE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_TRUE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
TEST_F(MessageHelperTest,
- GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
- // Creating data acessor
- application_manager::VehicleInfoSubscriptions vis;
- DataAccessor<application_manager::VehicleInfoSubscriptions> data_accessor(
- vis, true);
- // Calls for ApplicationManager
- EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u));
- EXPECT_CALL(*appSharedMock, SubscribedIVI()).WillOnce(Return(data_accessor));
-
- smart_objects::SmartObjectList outList =
- MessageHelper::GetIVISubscriptionRequests(appSharedMock,
- mock_application_manager);
- // Expect not empty request
- EXPECT_FALSE(outList.empty());
-}
-
-TEST_F(MessageHelperTest,
ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
policy_handler_test::MockPolicySettings policy_settings_;
@@ -737,8 +748,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
ProcessSoftButtons_IncorectSoftButonValue_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
smart_objects::SmartObject& buttons = object[strings::soft_buttons];
@@ -755,11 +766,12 @@ TEST_F(MessageHelperTest,
}
TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ image[strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
@@ -768,8 +780,38 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
}
TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
+ // Invalid value
+ image[strings::value] = " ";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
+ image, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
+TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) {
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ image[strings::value] = "icon.png";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
+ image, appSharedMock, mock_application_manager);
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+ // EXPECT
+ EXPECT_EQ("icon.png", image[strings::value].asString());
+}
+
+TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) {
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -783,12 +825,14 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
}
TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::STATIC;
images[1][strings::image_type] = mobile_apis::ImageType::STATIC;
+ images[0][strings::value] = "static_icon";
+ images[1][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
images, appSharedMock, mock_application_manager);
@@ -798,8 +842,8 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
TEST_F(MessageHelperTest,
VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -816,14 +860,17 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
message[1][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
+
+ message[0][strings::image][strings::value] = "static_icon";
+ message[1][strings::image][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
message, appSharedMock, mock_application_manager);
@@ -833,8 +880,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
@@ -895,7 +942,7 @@ TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) {
TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
// Create application mock
- MockApplicationSharedPtr appSharedPtr = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedPtr = std::make_shared<MockApplication>();
// Prepare data for method
smart_objects::SmartObject message_params;
size_t function_id = 1;
@@ -905,6 +952,133 @@ 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;
+
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const uint32_t correlation_id = 0u;
+ MessageHelper::SendGetListOfPermissionsResponse(permissions,
+ external_consent_status,
+ correlation_id,
+ mock_application_manager);
+
+ ASSERT_TRUE(result.get());
+
+ 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;
+
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const uint32_t correlation_id = 0u;
+ MessageHelper::SendGetListOfPermissionsResponse(permissions,
+ external_consent_status,
+ correlation_id,
+ mock_application_manager);
+
+ ASSERT_TRUE(result.get());
+
+ smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
+ const std::string external_consent_status_key = "externalConsentStatus";
+ EXPECT_TRUE(msg_params.keyExists(external_consent_status_key));
+
+ smart_objects::SmartArray* status_array =
+ msg_params[external_consent_status_key].asArray();
+ EXPECT_TRUE(external_consent_status.size() == status_array->size());
+
+ const std::string entityType = "entityType";
+ const std::string entityID = "entityID";
+ const std::string status = "status";
+
+ smart_objects::SmartObject item_1_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ item_1_so[entityType] = entity_type_1;
+ item_1_so[entityID] = entity_id_1;
+ item_1_so[status] = hmi_apis::Common_EntityStatus::ON;
+
+ smart_objects::SmartObject item_2_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ item_2_so[entityType] = entity_type_2;
+ item_2_so[entityID] = entity_id_2;
+ item_2_so[status] = hmi_apis::Common_EntityStatus::OFF;
+
+ EXPECT_TRUE(status_array->end() !=
+ std::find(status_array->begin(), status_array->end(), item_1_so));
+ EXPECT_TRUE(status_array->end() !=
+ std::find(status_array->begin(), status_array->end(), item_2_so));
+}
+#endif
+
+TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
+ smart_objects::SmartObjectSPtr result;
+ ON_CALL(mock_application_manager, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ int32_t app_id = 123;
+ smart_objects::SmartObject video_params(smart_objects::SmartType_Map);
+ video_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ video_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::H264;
+ video_params[strings::width] = 640;
+ video_params[strings::height] = 480;
+
+ MessageHelper::SendNaviSetVideoConfig(
+ app_id, mock_application_manager, video_params);
+
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ (*result)[strings::params][strings::function_id].asInt());
+
+ smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
+ EXPECT_TRUE(msg_params.keyExists(strings::config));
+
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::protocol));
+ EXPECT_EQ(1, msg_params[strings::config][strings::protocol].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::codec));
+ EXPECT_EQ(0, msg_params[strings::config][strings::codec].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::width));
+ EXPECT_EQ(640, msg_params[strings::config][strings::width].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::height));
+ EXPECT_EQ(480, msg_params[strings::config][strings::height].asInt());
+}
} // namespace application_manager_test
} // namespace components
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 07b523c56e..23957b61fb 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -41,7 +41,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -53,7 +52,7 @@ using protocol_handler::ServiceType;
using protocol_handler::MessagePriority;
using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
using application_manager::MobileMessageHandler;
-using application_manager::ProtocolVersion;
+using protocol_handler::MajorProtocolVersion;
using ::testing::_;
using ::application_manager::Message;
using ::application_manager::MobileMessage;
@@ -106,12 +105,12 @@ class MobileMessageHandlerTest : public testing::Test {
size_t full_size = sizeof(uint8_t) * full_data.size();
- message_ptr_ = utils::MakeShared<RawMessage>(connection_key_,
- protocol_version,
- &full_data[0],
- full_size,
- ServiceType::kRpc,
- payload_size);
+ message_ptr_ = std::make_shared<RawMessage>(connection_key_,
+ protocol_version,
+ &full_data[0],
+ full_size,
+ ServiceType::kRpc,
+ payload_size);
return MobileMessageHandler::HandleIncomingMessageProtocol(message_ptr_);
}
@@ -169,14 +168,14 @@ class MobileMessageHandlerTest : public testing::Test {
uint32_t correlation_id,
uint32_t connection_key,
const std::string& json_msg,
- application_manager::BinaryData* data = NULL) {
- MobileMessage message = utils::MakeShared<Message>(
+ const application_manager::BinaryData* data = NULL) {
+ MobileMessage message = std::make_shared<Message>(
MessagePriority::FromServiceType(ServiceType::kRpc));
message->set_function_id(function_id);
message->set_correlation_id(correlation_id);
message->set_connection_key(connection_key);
message->set_protocol_version(
- static_cast<ProtocolVersion>(protocol_version));
+ static_cast<protocol_handler::MajorProtocolVersion>(protocol_version));
message->set_message_type(application_manager::MessageType::kNotification);
if (data) {
message->set_binary_data(data);
@@ -254,12 +253,12 @@ class MobileMessageHandlerTest : public testing::Test {
TEST(mobile_message_test, basic_test) {
// Example message
MobileMessage message =
- utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
+ std::make_shared<Message>(protocol_handler::MessagePriority::kDefault);
EXPECT_FALSE(message->has_binary_data());
- application_manager::BinaryData* binary_data =
- new application_manager::BinaryData;
- binary_data->push_back('X');
- message->set_binary_data(binary_data);
+ application_manager::BinaryData binary_data;
+ binary_data.push_back('X');
+ message->set_binary_data(
+ (const application_manager::BinaryData*)&binary_data);
EXPECT_TRUE(message->has_binary_data());
}
@@ -270,7 +269,7 @@ TEST_F(
size_t payload_size = data.size();
std::srand(time(0));
// Generate unknown random protocol version except 1-3
- uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+ uint32_t protocol_version = 5 + rand() % UINT32_MAX;
Message* message =
HandleIncomingMessage(protocol_version, data, payload_size);
@@ -288,7 +287,7 @@ TEST_F(
const uint32_t correlation_id = 92u;
const uint32_t connection_key = 1u;
// Generate unknown random protocol version except 1-3
- uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+ uint32_t protocol_version = 5 + rand() % UINT32_MAX;
MobileMessage message_to_send = CreateMessageForSending(
protocol_version, function_id, correlation_id, connection_key, data);
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 f5a6e7833d..5cbc28b20c 100644
--- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -40,7 +40,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
@@ -70,7 +69,7 @@ const unsigned char* data_v1 =
TEST(MobileMessageHandlerTestV1Test,
HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) {
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, data_json.length());
application_manager::Message* ptr =
@@ -90,7 +89,7 @@ TEST(MobileMessageHandlerTestV1Test,
const unsigned char* data_v1 =
reinterpret_cast<const unsigned char*>(full_data.c_str());
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, full_data.length());
application_manager::Message* ptr =
@@ -108,10 +107,11 @@ TEST(MobileMessageHandlerTestV1Test,
uint32_t connection_key = 1;
application_manager::MobileMessage message =
- utils::MakeShared<application_manager::Message>(
+ std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::kDefault);
- message->set_protocol_version(application_manager::ProtocolVersion::kV1);
+ message->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
message->set_json_message(data_json);
message->set_connection_key(connection_key_p1);
@@ -121,7 +121,8 @@ TEST(MobileMessageHandlerTestV1Test,
ASSERT_TRUE(ptr);
EXPECT_EQ(connection_key, ptr->connection_key());
- EXPECT_EQ(static_cast<uint32_t>(application_manager::ProtocolVersion::kV1),
+ EXPECT_EQ(static_cast<uint32_t>(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1),
ptr->protocol_version());
}
diff --git a/src/components/application_manager/test/mock_application_helper.cc b/src/components/application_manager/test/mock_application_helper.cc
new file mode 100644
index 0000000000..c64a56e53e
--- /dev/null
+++ b/src/components/application_manager/test/mock_application_helper.cc
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/mock_application_helper.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+MockApplicationHelper& MockApplicationHelper::application_helper_mock() {
+ static ::testing::NiceMock<MockApplicationHelper> application_helper_mock;
+ return application_helper_mock;
+}
+
+} // application_manager_test
+} // components
+} // test
+
+namespace application_manager {
+
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ test::components::application_manager_test::MockApplicationHelper::
+ application_helper_mock().RecallApplicationData(app, app_manager);
+}
+} // application_managers
diff --git a/src/components/application_manager/test/mock_hmi_command_factory.cc b/src/components/application_manager/test/mock_hmi_command_factory.cc
new file mode 100644
index 0000000000..375da26067
--- /dev/null
+++ b/src/components/application_manager/test/mock_hmi_command_factory.cc
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+#include "application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h"
+#include "application_manager/mock_hmi_command_factory.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+MockHMICommandFactory* MockHMICommandFactory::mock_hmi_command_factory() {
+ static MockHMICommandFactory mock_hmi_command_factory;
+ return &mock_hmi_command_factory;
+}
+
+} // application_manager_test
+} // components
+} // test
+
+namespace sdl_rpc_plugin {
+namespace app_mngr = application_manager;
+app_mngr::CommandSharedPtr HMICommandFactory::CreateCommand(
+ const app_mngr::commands::MessageSharedPtr& message,
+ app_mngr::ApplicationManager& application_manager) {
+ return test::components::application_manager_test::MockHMICommandFactory::
+ mock_hmi_command_factory()->CreateCommand(message, application_manager);
+}
+} // 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 84b672e1a5..f091e183dc 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -33,14 +33,36 @@
#include "application_manager/message_helper.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "transport_manager/common.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
namespace application_manager {
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ return MockMessageHelper::message_helper_mock()->CreateNotification(
+ function_id, app_id);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id) {
+ return MockMessageHelper::message_helper_mock()->CreateHMINotification(
+ function_id);
+}
+
void MessageHelper::SendHashUpdateNotification(uint32_t const app_id,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendHashUpdateNotification(
app_id, app_mngr);
}
+void MessageHelper::SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params) {
+ MockMessageHelper::message_helper_mock()->SendNaviSetVideoConfig(
+ app_id, app_mngr, video_params);
+}
void MessageHelper::SendNaviStartStream(int32_t connection_key,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendNaviStartStream(connection_key,
@@ -173,10 +195,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(
@@ -212,6 +242,28 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path,
file_path, timeout, retries, app_mngr);
}
+void MessageHelper::SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ MockMessageHelper::message_helper_mock()->SendActivateAppToHMI(
+ app_id, application_manager, level, send_policy_priority);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
+ return MockMessageHelper::message_helper_mock()->CreateMessageForHMI(
+ message_type, correlation_id);
+}
+
+void MessageHelper::SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager) {
+ MockMessageHelper::message_helper_mock()->SendHMIStatusNotification(
+ application_impl, application_manager);
+}
+
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
uint32_t correlation_id,
ApplicationManager& app_mngr) {
@@ -232,7 +284,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
}
MockMessageHelper* MockMessageHelper::message_helper_mock() {
- static MockMessageHelper message_helper_mock;
+ static ::testing::NiceMock<MockMessageHelper> message_helper_mock;
return &message_helper_mock;
}
void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
@@ -272,10 +324,12 @@ void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
app);
}
-smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
- ApplicationSharedPtr app, ApplicationManager& app_mngr) {
- return MockMessageHelper::message_helper_mock()->GetIVISubscriptionRequests(
- app);
+mobile_apis::Result::eType MessageHelper::VerifyTtsFiles(
+ smart_objects::SmartObject& message,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->VerifyTtsFiles(
+ message, app, app_mngr);
}
mobile_apis::Result::eType MessageHelper::VerifyImage(
@@ -286,6 +340,13 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
message, app, app_mngr);
}
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ return MockMessageHelper::message_helper_mock()->CheckChoiceSetVRCommands(
+ choice_set);
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -315,7 +376,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
app_mngr);
}
-NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason) {
@@ -381,6 +442,16 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
->SendUIChangeRegistrationRequestToHMI(app, app_mngr);
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ return MockMessageHelper::message_helper_mock()->CreateDeviceInfo(
+ device_handle, session_observer, policy_handler, app_mngr, output);
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -459,4 +530,46 @@ std::string MessageHelper::StringifiedHMILevel(
hmi_level);
}
+std::string MessageHelper::GetDeviceMacAddressForHandle(
+ const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->GetDeviceMacAddressForHandle(
+ device_handle, app_mngr);
+}
+
+void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteCommandRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteSubmenuRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteChoiceSetRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendResetPropertiesRequest(
+ application, app_mngr);
+}
+
+void MessageHelper::SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->SendUnsubscribeButtonNotification(button, application, app_mngr);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 70c2f77dfb..a1471eff36 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -36,12 +36,14 @@
#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"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_crypto_manager.h"
+#endif // ENABLE_SECURITY
#include "application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler_settings.h"
#include "transport_manager/mock_transport_manager.h"
@@ -51,13 +53,13 @@
#include "json/value.h"
#include "smart_objects/smart_object.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
+
#include "utils/custom_string.h"
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
@@ -67,6 +69,9 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_state_controller.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_rpc_service.h"
+#include "policy/mock_policy_manager.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
namespace test {
namespace components {
@@ -76,6 +81,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;
@@ -85,13 +91,14 @@ using ::testing::DoAll;
using ::testing::SetArgReferee;
using ::testing::Mock;
+typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
+
const std::string kDummyData = "some_data";
class PolicyHandlerTest : public ::testing::Test {
public:
PolicyHandlerTest()
: policy_handler_(policy_settings_, app_manager_)
- , mock_message_helper_(*MockMessageHelper::message_helper_mock())
, kPolicyAppId_("fake_app_id")
, kMacAddr_("kMacAddr_ess")
, kDeviceId_("fake_device_id")
@@ -101,10 +108,21 @@ class PolicyHandlerTest : public ::testing::Test {
, default_hmi_("fake_hmi")
, kPreloadPTFile_("sdl_preloaded_pt.json")
, kAppStorageFolder_("storage")
- , app_set(test_app, app_lock)
- , kAppId_(10u)
+ , app_lock_(std::make_shared<sync_primitives::Lock>())
+ , app_set(test_app, app_lock_)
+ , 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_);
}
@@ -116,15 +134,15 @@ class PolicyHandlerTest : public ::testing::Test {
protected:
NiceMock<MockPolicySettings> policy_settings_;
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
application_manager_test::MockStateController mock_state_controller;
+ components::usage_statistics_test::MockStatisticsManager
+ mock_statistics_manager_;
PolicyHandler policy_handler_;
- utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
- MockMessageHelper& mock_message_helper_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
const std::string kPolicyAppId_;
const std::string kMacAddr_;
const std::string kDeviceId_;
@@ -135,11 +153,22 @@ class PolicyHandlerTest : public ::testing::Test {
const std::string kPreloadPTFile_;
const std::string kAppStorageFolder_;
ApplicationSet test_app;
- sync_primitives::Lock app_lock;
+ std::shared_ptr<sync_primitives::Lock> app_lock_;
DataAccessor<ApplicationSet> app_set;
- const uint32_t 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_;
+ MockRPCService mock_rpc_service_;
virtual void SetUp() OVERRIDE {
Mock::VerifyAndClearExpectations(&mock_message_helper_);
@@ -150,18 +179,19 @@ class PolicyHandlerTest : public ::testing::Test {
std::string path = file_system::CreateDirectory("storage");
file_system::CreateFile(path + "/" + "certificate");
mock_policy_manager_ =
- utils::MakeShared<policy_manager_test::MockPolicyManager>();
- ASSERT_TRUE(mock_policy_manager_.valid());
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
ON_CALL(app_manager_, connection_handler())
.WillByDefault(ReturnRef(conn_handler));
ON_CALL(conn_handler, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer));
- mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
}
virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
}
@@ -203,8 +233,77 @@ class PolicyHandlerTest : public ::testing::Test {
#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_;
+};
+} // namespace
+
TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) {
// Check before policy enabled from ini file
EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(false));
@@ -314,7 +413,6 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) {
// Checks
EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false));
- EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return(""));
EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0);
EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _))
.Times(0);
@@ -335,33 +433,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(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
EXPECT_CALL(mock_message_helper_,
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
// Act
Permissions perms;
policy_handler_.OnPermissionsUpdated(kPolicyAppId_, perms);
}
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(_, _, _)).Times(0);
+
+ Permissions permissions;
+ policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions);
+}
+
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(mock_app_))
+ .WillOnce(Return(invalid_app));
+ 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(*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(mock_message_helper_,
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
@@ -379,17 +510,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(*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(mock_message_helper_,
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
@@ -406,17 +537,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(*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(mock_message_helper_,
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller()).Times(0);
// Act
@@ -440,12 +571,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) {
@@ -627,8 +774,8 @@ TEST_F(PolicyHandlerTest, KmsChanged) {
void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
const uint32_t correlation_id) {
- utils::SharedPtr<application_manager_test::MockApplication> application1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application1 =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, ActivateApplication(_))
.WillRepeatedly(Return(true));
EXPECT_CALL(app_manager_, application(connection_key))
@@ -644,12 +791,12 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
.WillRepeatedly(ReturnRef(conn_handler));
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(mock_session_observer));
- utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
mock_statistics_manager =
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
UsageStatistics usage_stats(
"0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
mock_statistics_manager));
EXPECT_CALL(*application1, usage_report()).WillOnce(ReturnRef(usage_stats));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
@@ -661,9 +808,15 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
EXPECT_CALL(*application1, device()).WillRepeatedly(Return(device_handle));
EXPECT_CALL(*application1, is_audio()).WillRepeatedly(Return(false));
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
- EXPECT_CALL(mock_session_observer,
- GetDataOnDeviceID(device_handle, _, _, _, _));
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(device_handle),
+ _,
+ _,
+ _,
+ _));
#endif // EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(*application1, policy_app_id()).WillOnce(Return(kPolicyAppId_));
@@ -672,7 +825,7 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _));
- ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId_));
+ ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId1_));
// Act
policy_handler_.OnActivateApp(connection_key, correlation_id);
}
@@ -680,9 +833,55 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
TEST_F(PolicyHandlerTest, OnActivateApp) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- const uint32_t connection_key = 1u;
- const uint32_t correlation_id = 2u;
- TestActivateApp(connection_key, correlation_id);
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
+}
+
+TEST_F(PolicyHandlerTest, OnActivateApp_InvalidApp_UNSUCCESS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ std::shared_ptr<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
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
+ mock_statistics_manager =
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
+ UsageStatistics usage_stats(
+ "0",
+ std::shared_ptr<usage_statistics::StatisticsManager>(
+ mock_statistics_manager));
+ EXPECT_CALL(*mock_app_, usage_report()).WillOnce(ReturnRef(usage_stats));
+ const std::string default_mac = "00:00:00:00:00:00";
+ 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) {
@@ -699,12 +898,12 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
- 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));
}
@@ -717,12 +916,12 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appPermissionsConsentNeeded = false;
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
- RemovePendingPermissionChanges(kPolicyAppId_)).Times(0);
+ RemovePendingPermissionChanges(kPolicyAppId_));
// Act
policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
}
@@ -735,7 +934,7 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInLimitedConsentNeeded) {
permissions.appPermissionsConsentNeeded = true;
// Check expectations
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
@@ -755,11 +954,12 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(mock_state_controller,
SetRegularState(_,
mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
true));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
@@ -779,7 +979,7 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInBackgroundAndRevoked) {
// Check expectations
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
@@ -797,22 +997,24 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
+ kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
- EXPECT_CALL(app_manager_,
- ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+ ON_CALL(app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
@@ -822,6 +1024,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(
@@ -829,23 +1050,25 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
// Notification won't be sent
EXPECT_CALL(mock_message_helper_,
- SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
+ kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
- EXPECT_CALL(app_manager_,
- ManageMobileCommand(_, commands::Command::ORIGIN_SDL));
+ ON_CALL(app_manager_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(_, commands::Command::SOURCE_SDL));
EXPECT_CALL(*mock_policy_manager_,
RemovePendingPermissionChanges(kPolicyAppId_));
@@ -897,11 +1120,12 @@ TEST_F(PolicyHandlerTest, OnGetUserFriendlyMessage) {
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_));
+ .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())
+ EXPECT_CALL(mock_hmi_capabilities, active_ui_language())
.WillOnce(Return(default_language));
EXPECT_CALL(
*mock_policy_manager_,
@@ -944,8 +1168,8 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
EXPECT_CALL(app_manager_, connection_handler())
@@ -955,7 +1179,15 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(session_observer));
- EXPECT_CALL(session_observer, GetDataOnDeviceID(0u, _, _, _, _));
+ const transport_manager::DeviceHandle handle = 0u;
+
+ EXPECT_CALL(session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(handle),
+ _,
+ _,
+ _,
+ _));
// Act
policy_handler_.OnCurrentDeviceIdUpdateRequired(kPolicyAppId_);
@@ -1039,8 +1271,8 @@ TEST_F(PolicyHandlerTest, GetAppName) {
// Check expectations
const CustomString app_name("my_mobile_app");
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name));
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
@@ -1077,8 +1309,8 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
// Check expectations
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
@@ -1094,7 +1326,6 @@ TEST_F(PolicyHandlerTest, OnPTExchangeNeeded) {
EnablePolicyAndPolicyManagerMock();
// Check expectations
EXPECT_CALL(*mock_policy_manager_, ForcePTExchange());
- EXPECT_CALL(mock_message_helper_, SendOnStatusUpdate(_, _));
// Act
policy_handler_.OnPTExchangeNeeded();
}
@@ -1103,10 +1334,13 @@ TEST_F(PolicyHandlerTest, AddApplication) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, AddApplication(kPolicyAppId_))
- .WillOnce(Return(utils::MakeShared<utils::CallNothing>()));
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
+ .WillOnce(Return(std::make_shared<utils::CallNothing>()));
// Act
- policy_handler_.AddApplication(kPolicyAppId_);
+ policy_handler_.AddApplication(kPolicyAppId_,
+ HmiTypes(policy_table::AHT_DEFAULT));
}
TEST_F(PolicyHandlerTest, HeartBeatTimeout) {
@@ -1131,9 +1365,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) {
@@ -1153,10 +1387,30 @@ TEST_F(PolicyHandlerTest, IsRequestTypeAllowed) {
mobile_apis::RequestType::eType type =
mobile_apis::RequestType::eType::EMERGENCY;
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypesState(kPolicyAppId_))
+ .WillOnce(Return(policy::RequestType::State::AVAILABLE));
+
EXPECT_CALL(*mock_policy_manager_, GetAppRequestTypes(kPolicyAppId_))
- .WillOnce(Return(std::vector<std::string>()));
+ .WillOnce(Return(std::vector<std::string>({"HTTP"})));
+ // Act
+ EXPECT_FALSE(policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type));
+}
+
+TEST_F(PolicyHandlerTest, IsRequestSubTypeAllowed) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ // Check expectations
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestSubTypesState(kPolicyAppId_))
+ .WillOnce(Return(policy::RequestSubType::State::AVAILABLE));
+ EXPECT_CALL(*mock_policy_manager_, GetAppRequestSubTypes(kPolicyAppId_))
+ .WillOnce(
+ Return(std::vector<std::string>({"fakeSubType", "fakeSubType2"})));
+
// Act
- policy_handler_.IsRequestTypeAllowed(kPolicyAppId_, type);
+ const std::string subtype = "fakeSubType";
+ EXPECT_TRUE(policy_handler_.IsRequestSubTypeAllowed(kPolicyAppId_, subtype));
}
TEST_F(PolicyHandlerTest, GetVehicleInfo) {
@@ -1238,39 +1492,147 @@ 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(mock_message_helper_,
- SendGetListOfPermissionsResponse(_, kCorId, _));
-
- EXPECT_CALL(app_manager_, application(kAppId_))
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(app_manager_, application(app_id))
.WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
- policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
TEST_F(PolicyHandlerTest, OnGetListOfPermissions_WithoutConnectionKey) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- const uint32_t kAppId_ = 0u;
- const uint32_t kCorId = 1u;
+ const uint32_t app_id = 0u;
+ const uint32_t corr_id = 1u;
+ const std::string default_mac = "00:00:00:00:00:00";
+ test_app.insert(mock_app_);
+
+ // Expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(default_mac, _, _));
+
+ EXPECT_CALL(app_manager_, application(app_id))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(
+ mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, corr_id, _));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
+
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
+}
+
+ACTION_P(SetGroupPermissions, permissions) {
+ arg2 = permissions;
+}
+
+TEST_F(PolicyHandlerTest, OnGetListOfPermissions_GroupPermissions_SUCCESS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ policy::FunctionalGroupPermission group_permission_disallowed1;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupDisallowed,
+ kGroupAliasDisallowed_,
+ kGroupNameDisallowed_,
+ group_permission_disallowed1);
+
+ policy::FunctionalGroupPermission group_permission_disallowed2;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupDisallowed,
+ kGroupAliasDisallowed_,
+ kGroupNameDisallowed_,
+ group_permission_disallowed2);
+
+ policy::FunctionalGroupPermission group_permission_allowed1;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed1);
+
+ policy::FunctionalGroupPermission group_permission_allowed2;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed2);
+
+ std::vector<policy::FunctionalGroupPermission> group_permissions;
+ group_permissions.push_back(group_permission_allowed1);
+ group_permissions.push_back(group_permission_allowed2);
+ group_permissions.push_back(group_permission_disallowed1);
+ group_permissions.push_back(group_permission_disallowed2);
+
+ const uint32_t app_id = 0u;
+ const uint32_t corr_id = 1u;
+ const std::string default_mac = "00:00:00:00:00:00";
test_app.insert(mock_app_);
// Expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(_, _, _))
+ .WillOnce(SetGroupPermissions(group_permissions));
+
+ EXPECT_CALL(app_manager_, application(app_id))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(
+ mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
EXPECT_CALL(mock_message_helper_,
- SendGetListOfPermissionsResponse(_, kCorId, _));
+ SendGetListOfPermissionsResponse(_, corr_id, _));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
- policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
+#ifdef ENABLE_SECURITY
TEST_F(PolicyHandlerTest, RetrieveCertificate) {
// Arrange
EnablePolicyAndPolicyManagerMock();
@@ -1279,6 +1641,7 @@ TEST_F(PolicyHandlerTest, RetrieveCertificate) {
.WillOnce(Return(test_certificate));
EXPECT_EQ(test_certificate, policy_handler_.RetrieveCertificate());
}
+#endif // ENABLE_SECURITY
TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
EnablePolicyAndPolicyManagerMock();
@@ -1289,7 +1652,7 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
#endif // PROPRIETARY_MODE || EXTERNAL_PROPRIETARY_MODE
#ifdef EXTERNAL_PROPRIETARY_MODE
std::vector<int> retry_delay_seconds;
- const uint32_t timeout_exchange = 10;
+ const uint32_t timeout_exchange = 10u;
// TODO(AKutsan): Policy move issues
EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls("0x07", _))
.WillRepeatedly(SetArgReferee<1>(test_data));
@@ -1327,18 +1690,19 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
EndpointUrls test_data;
EndpointData data("some_data");
std::vector<int> retry_delay_seconds;
- const uint32_t timeout_exchange = 10;
+ const uint32_t timeout_exchange = 10u;
test_data.push_back(data);
ExtendedPolicyExpectations();
- EXPECT_CALL(app_manager_, application(kAppId_))
+ EXPECT_CALL(app_manager_, application(kAppId1_))
.WillRepeatedly(Return(mock_app_));
policy_handler_.OnSnapshotCreated(msg, retry_delay_seconds, timeout_exchange);
}
#else // EXTERNAL_PROPRIETARY_MODE
-TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
+// 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;
@@ -1366,7 +1730,7 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
// 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 // PROPRIETARY_MODE
@@ -1383,9 +1747,7 @@ TEST_F(PolicyHandlerTest,
std::vector<std::string> device_macs;
device_macs.push_back(kPolicyAppId_);
EnablePolicyAndPolicyManagerMock();
- const uint32_t connection_key = 1u;
- const uint32_t correlation_id = 2u;
- TestActivateApp(connection_key, correlation_id);
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
// Device ID is not setted by us
EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_))
@@ -1397,6 +1759,23 @@ TEST_F(PolicyHandlerTest,
policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed, "");
}
+TEST_F(PolicyHandlerTest,
+ 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(default_mac_address);
+ EnablePolicyAndPolicyManagerMock();
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
+
+ EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_))
+ .WillOnce(SetArgReferee<0>(device_macs));
+
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForDevice(_, _)).Times(0);
+
+ const bool is_allowed = true;
+ policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed, "");
+}
+
TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_ConsentAllowed) {
const bool is_allowed = true;
// Arrange
@@ -1480,6 +1859,7 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
}
+#ifdef ENABLE_SECURITY
#ifdef EXTERNAL_PROPRIETARY_MODE
TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
const std::string app_storage = "storage";
@@ -1505,7 +1885,8 @@ TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
EXPECT_CALL(policy_handler_observer, OnCertificateUpdated(cert_data));
policy_handler_.OnCertificateUpdated(cert_data);
}
-#endif
+#endif // EXTERNAL_PROPRIETARY_MODE
+#endif // ENABLE_SECURITY
TEST_F(PolicyHandlerTest, GetAppIdForSending_WithoutApps) {
// Arrange
@@ -1526,9 +1907,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()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*mock_app_, hmi_level())
- .WillOnce(Return(mobile_api::HMILevel::HMI_FULL));
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
@@ -1540,7 +1921,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() {
@@ -1548,11 +1929,13 @@ void PolicyHandlerTest::GetAppIDForSending() {
test_app.insert(mock_app_);
// Check expectations
- EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(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(_, _, _, _, _))
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
.WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
@@ -1563,15 +1946,15 @@ 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>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_full =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_full_id = 1;
EXPECT_CALL(*mock_app_in_full, app_id())
.WillRepeatedly(Return(app_in_full_id));
@@ -1581,9 +1964,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_full);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_limited =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_limited_id = 2;
EXPECT_CALL(*mock_app_in_limited, app_id())
.WillRepeatedly(Return(app_in_limited_id));
@@ -1593,9 +1976,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_limited);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_background =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_background_id = 3;
EXPECT_CALL(*mock_app_in_background, app_id())
.WillRepeatedly(Return(app_in_background_id));
@@ -1605,8 +1988,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_background);
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_none =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id = 4;
EXPECT_CALL(*mock_app_in_none, app_id())
.WillRepeatedly(Return(app_in_none_id));
@@ -1618,7 +2001,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
// Check expectations
- EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _))
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
.WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
@@ -1632,9 +2017,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_1 = 1;
EXPECT_CALL(*mock_app_in_none_1, app_id())
.WillRepeatedly(Return(app_in_none_id_1));
@@ -1644,9 +2029,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
test_app.insert(mock_app_in_none_1);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_2 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_2 = 2;
EXPECT_CALL(*mock_app_in_none_2, app_id())
.WillRepeatedly(Return(app_in_none_id_2));
@@ -1658,7 +2043,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
// Check expectations
- EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _))
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
.WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
@@ -1671,30 +2058,484 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
EXPECT_EQ(app_in_none_id_1 || app_in_none_id_2, app_id);
}
-TEST_F(PolicyHandlerTest, SendMessageToSDK) {
- // Precondition
+TEST_F(PolicyHandlerTest,
+ SendMessageToSDK_SuitableAppPresent_ExpectedNotificationSending) {
BinaryMessage msg;
const std::string url = "test_url";
EnablePolicyAndPolicyManagerMock();
test_app.insert(mock_app_);
- // Check expectations for get app id
- GetAppIDForSending();
- // Expectations
- EXPECT_CALL(app_manager_, application(kAppId_))
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
+
+ const connection_handler::DeviceHandle test_device_id = 1u;
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id));
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
- EXPECT_CALL(mock_message_helper_,
- SendPolicySnapshotNotification(kAppId_, msg, url, _));
// Act
+ EXPECT_CALL(mock_message_helper_,
+ SendPolicySnapshotNotification(kAppId1_, msg, url, _));
EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, url));
}
+TEST_F(PolicyHandlerTest,
+ SendMessageToSDK_NoSuitableApp_ExpectedNotificationNotSent) {
+ BinaryMessage msg;
+ const std::string url = "test_url";
+ EnablePolicyAndPolicyManagerMock();
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
+
+ const connection_handler::DeviceHandle test_device_id = 1u;
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id));
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceDisallowed));
+
+ // Expected to get 0 as application id so SDL does not have valid application
+ // with such id
+ EXPECT_CALL(app_manager_, application(0))
+ .WillOnce(
+ Return(std::shared_ptr<application_manager_test::MockApplication>()));
+
+ EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url));
+}
+
TEST_F(PolicyHandlerTest, CanUpdate) {
GetAppIDForSending();
EXPECT_TRUE(policy_handler_.CanUpdate());
}
+TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ std::shared_ptr<application_manager_test::MockApplication> second_mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*second_mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(*second_mock_app, app_id()).WillRepeatedly(Return(kAppId2_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ // Check expectations
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+ test_app.insert(mock_app_);
+ test_app.insert(second_mock_app);
+
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
+ .WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+
+ EXPECT_TRUE(policy_handler_.CanUpdate());
+}
+
+ACTION_P(NotifyAsync, waiter) {
+ waiter->Notify();
+}
+
+TEST_F(PolicyHandlerTest,
+ DISABLED_OnAppPermissionConsentInternal_ValidConnectionKey_SUCCESS) {
+ ChangePolicyManagerToMock();
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(device),
+ _,
+ NULL,
+ _,
+ _)).WillOnce(Return(1u));
+
+ EXPECT_CALL(app_manager_, application(kConnectionKey_))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(device));
+
+ sync_primitives::Lock wait_hmi_lock_first;
+ sync_primitives::AutoLock auto_lock_first(wait_hmi_lock_first);
+ WaitAsync waiter_first(kCallsCount_, kTimeout_);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForApp(_, _))
+ .WillOnce(NotifyAsync(&waiter_first));
+#else
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForApp(_))
+ .WillOnce(NotifyAsync(&waiter_first));
+#endif
+ ExternalConsentStatusItem item(1u, 1u, kStatusOn);
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock_second;
+ sync_primitives::AutoLock auto_lock_second(wait_hmi_lock_second);
+ WaitAsync waiter_second(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ kConnectionKey_, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(kConnectionKey_, permissions);
+
+#endif
+ EXPECT_TRUE(waiter_first.Wait(auto_lock_first));
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_TRUE(waiter_second.Wait(auto_lock_second));
+#endif
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_NoAppsPreviouslyStored_UNUSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t invalid_connection_key = 0u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(app_manager_, application(_)).Times(0);
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_NoAppsPreviouslyStored_FAILED) {
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t invalid_connection_key = 0u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(app_manager_, application(_)).Times(0);
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ ON_CALL(*mock_policy_manager_, IsNeedToUpdateExternalConsentStatus(_))
+ .WillByDefault(Return(false));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+}
+
+ACTION_P(SetDeviceParamsMacAdress, mac_adress) {
+ *arg3 = mac_adress;
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_ExistAppsPreviouslyStored_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ test_app.insert(mock_app_);
+
+ const uint32_t invalid_connection_key = 0u;
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(1u));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, NULL, _, _))
+ .WillRepeatedly(DoAll(SetDeviceParamsMacAdress(kMacAddr_), (Return(1u))));
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillRepeatedly(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillRepeatedly(ReturnRef(mock_session_observer));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(device));
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(DoAll(NotifyAsync(&waiter), Return(true)));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ Mock::VerifyAndClearExpectations(mock_app_.get());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+#endif
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_ExistAppsPreviouslyStored_FAIL) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ test_app.insert(mock_app_);
+
+ const uint32_t invalid_connection_key = 0u;
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(1u));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, NULL, _, _))
+ .WillRepeatedly(DoAll(SetDeviceParamsMacAdress(kMacAddr_), (Return(1u))));
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillRepeatedly(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillRepeatedly(ReturnRef(mock_session_observer));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(device));
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ ON_CALL(*mock_policy_manager_, IsNeedToUpdateExternalConsentStatus(_))
+ .WillByDefault(Return(false));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ Mock::VerifyAndClearExpectations(mock_app_.get());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+#endif
+}
+
+TEST_F(PolicyHandlerTest, GetLockScreenIconUrl_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(*mock_policy_manager_, GetLockScreenIconUrl());
+
+ policy_handler_.GetLockScreenIconUrl();
+}
+
+TEST_F(PolicyHandlerTest, RemoveListener_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+ std::map<std::string, StringArray> app_hmi_types;
+ StringArray arr;
+ arr.push_back("test_hmi_type");
+ app_hmi_types["app1"] = arr;
+
+ EXPECT_CALL(policy_handler_observer, OnUpdateHMIAppType(_));
+ policy_handler_.OnUpdateHMIAppType(app_hmi_types);
+
+ policy_handler_.remove_listener(&policy_handler_observer);
+
+ EXPECT_CALL(policy_handler_observer, OnUpdateHMIAppType(_)).Times(0);
+ policy_handler_.OnUpdateHMIAppType(app_hmi_types);
+}
+
+TEST_F(PolicyHandlerTest, AddStatisticsInfo_UnknownStatistics_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ policy_handler_.AddStatisticsInfo(
+ hmi_apis::Common_StatisticsType::INVALID_ENUM);
+}
+
+TEST_F(PolicyHandlerTest, AddStatisticsInfo_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter));
+
+ policy_handler_.AddStatisticsInfo(
+ hmi_apis::Common_StatisticsType::iAPP_BUFFER_FULL);
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+}
+
+TEST_F(PolicyHandlerTest, OnSystemError_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter));
+
+ policy_handler_.OnSystemError(hmi_apis::Common_SystemError::SYNC_REBOOTED);
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+
+ WaitAsync waiter1(kCallsCount_, kTimeout_);
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter1));
+
+ policy_handler_.OnSystemError(
+ hmi_apis::Common_SystemError::SYNC_OUT_OF_MEMMORY);
+ EXPECT_TRUE(waiter1.Wait(auto_lock));
+}
+
+ACTION_P(SetEndpoint, endpoint) {
+ arg1 = endpoint;
+}
+
+TEST_F(PolicyHandlerTest, RemoteAppsUrl_EndpointsEmpty_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const std::string service_type("queryAppsUrl");
+ EndpointUrls endpoints;
+
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls(service_type, _))
+ .WillOnce(SetEndpoint(endpoints));
+
+ const std::string default_url("");
+ EXPECT_EQ(default_url, policy_handler_.RemoteAppsUrl());
+}
+
+TEST_F(PolicyHandlerTest, RemoteAppsUrl_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const std::string url("url");
+ EndpointData endpoint_data;
+ endpoint_data.url.push_back(url);
+
+ EndpointUrls endpoints;
+ endpoints.push_back(endpoint_data);
+
+ const std::string service_type("queryAppsUrl");
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls(service_type, _))
+ .WillOnce(SetEndpoint(endpoints));
+
+ EXPECT_EQ(url, policy_handler_.RemoteAppsUrl());
+}
+
} // namespace policy_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
new file mode 100644
index 0000000000..b7caf635c9
--- /dev/null
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <vector>
+#include <fstream>
+#include "gmock/gmock.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/delegates/app_permission_delegate.h"
+#include "policy/mock_cache_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "policy/policy_types.h"
+#include "policy/access_remote.h"
+#include "json/reader.h"
+#include "json/writer.h"
+#include "json/value.h"
+#include "smart_objects/smart_object.h"
+
+#include "utils/custom_string.h"
+#include "interfaces/MOBILE_API.h"
+#include "policy/mock_policy_settings.h"
+#include "application_manager/mock_application.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_observer.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "policy/mock_policy_manager.h"
+
+namespace test {
+namespace components {
+namespace rc_policy_handler_test {
+
+using namespace application_manager;
+using namespace policy;
+using namespace utils::custom_string;
+using testing::_;
+using ::testing::DoAll;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgPointee;
+
+class RCPolicyHandlerTest : public ::testing::Test {
+ public:
+ RCPolicyHandlerTest()
+ : policy_handler_(policy_settings_, app_manager_)
+ , kPolicyAppId_("fake_app_id")
+ , kMacAddr_("kMacAddr_ess")
+ , kDeviceId_("fake_device_id")
+ , kHmiLevel_("NONE")
+ , default_hmi_("fake_hmi")
+ , app_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , app_set(test_app, app_lock_ptr_)
+ , kAppId1_(10u)
+ , kAppId2_(11u)
+ , kConnectionKey_(1u)
+ , kCorrelationKey_(2u)
+ , kUrl_("test_url")
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+
+ protected:
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
+ connection_handler_test::MockConnectionHandler conn_handler;
+ protocol_handler_test::MockSessionObserver mock_session_observer;
+ components::usage_statistics_test::MockStatisticsManager
+ mock_statistics_manager_;
+ PolicyHandler policy_handler_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ application_manager_test::MockApplicationManager app_manager_;
+ const std::string kPolicyAppId_;
+ const std::string kMacAddr_;
+ const std::string kDeviceId_;
+ const std::string kHmiLevel_;
+ std::string default_hmi_;
+ ApplicationSet test_app;
+ std::shared_ptr<sync_primitives::Lock> app_lock_ptr_;
+ DataAccessor<ApplicationSet> app_set;
+ const uint32_t kAppId1_;
+ const uint32_t kAppId2_;
+ const uint32_t kConnectionKey_;
+ const uint32_t kCorrelationKey_;
+ const std::string kUrl_;
+ application_manager::MockMessageHelper& mock_message_helper_;
+
+ virtual void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ mock_policy_manager_ =
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
+
+ ON_CALL(app_manager_, connection_handler())
+ .WillByDefault(ReturnRef(conn_handler));
+ ON_CALL(conn_handler, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer));
+
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
+ }
+
+ virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void ChangePolicyManagerToMock() {
+ policy_handler_.SetPolicyManager(mock_policy_manager_);
+ }
+
+ void EnablePolicy() {
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ }
+
+ void EnablePolicyAndPolicyManagerMock() {
+ EnablePolicy();
+ ChangePolicyManagerToMock();
+ }
+};
+
+TEST_F(RCPolicyHandlerTest,
+ SendMessageToSDK_RemoteControlInvalidMobileAppId_UNSUCCESS) {
+ // Precondition
+ BinaryMessage msg;
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
+ test_app.insert(mock_app_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+ const std::string empty_mobile_app_id("");
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillOnce(Return(empty_mobile_app_id));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
+
+ EXPECT_CALL(mock_message_helper_, SendPolicySnapshotNotification(_, _, _, _))
+ .Times(0);
+ EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, kUrl_));
+}
+
+TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) {
+ BinaryMessage msg;
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
+ test_app.insert(mock_app_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
+
+ EXPECT_CALL(mock_message_helper_,
+ SendPolicySnapshotNotification(kAppId1_, _, kUrl_, _));
+ EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, kUrl_));
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0);
+
+ const std::string hmi_level("HMI_FULL");
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidHmiLevel_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelFull_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_FULL");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_, SendActivateAppToHMI(kAppId1_, _, _, _));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelChanged_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_LIMITED");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const PTString module("module");
+ EXPECT_CALL(*mock_policy_manager_, CheckModule(kPolicyAppId_, module))
+ .WillOnce(Return(true));
+
+ EXPECT_TRUE(policy_handler_.CheckModule(kPolicyAppId_, module));
+}
+
+ACTION_P(SetDeviceHandle, handle) {
+ *arg1 = handle;
+}
+
+TEST_F(RCPolicyHandlerTest,
+ OnRemoteAppPermissionsChanged_DifferentDeviceHandle_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(*mock_policy_manager_,
+ SendAppPermissionsChanged(kDeviceId_, kPolicyAppId_));
+
+ policy_handler_.OnRemoteAppPermissionsChanged(kDeviceId_, kPolicyAppId_);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+
+ const std::string hmi_level("HMI_NONE");
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_HmiLevelInvalidEnum_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidAppAndHmiLevel_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_NONE");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest,
+ OnUpdateHMIStatusFourParams_HmiLevelInvalidEnum_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidParams_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_NONE");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, GetModuleTypes_GetModuleTypes_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ std::vector<std::string> modules;
+
+ EXPECT_CALL(*mock_policy_manager_, GetModuleTypes(kPolicyAppId_, &modules))
+ .WillOnce(Return(true));
+
+ EXPECT_TRUE(policy_handler_.GetModuleTypes(kPolicyAppId_, &modules));
+}
+
+TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA;
+
+ const smart_objects::SmartObjectSPtr app_types =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Array);
+ (*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA;
+ (*app_types)[strings::app_hmi_type][1] =
+ mobile_apis::AppHMIType::BACKGROUND_PROCESS;
+
+ std::vector<int> policy_hmi_types;
+ policy_hmi_types.push_back(mobile_apis::AppHMIType::MEDIA);
+ policy_hmi_types.push_back(mobile_apis::AppHMIType::BACKGROUND_PROCESS);
+
+ EXPECT_CALL(*mock_policy_manager_, GetHMITypes(kPolicyAppId_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(policy_hmi_types), Return(true)));
+
+ EXPECT_TRUE(policy_handler_.CheckHMIType(
+ kPolicyAppId_, hmi, &(*app_types.get())[strings::app_hmi_type]));
+}
+
+} // namespace rc_policy_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
index e053d51c34..112e3c1c39 100644
--- a/src/components/application_manager/test/request_controller/request_controller_test.cc
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -36,12 +36,12 @@
#include "application_manager/request_controller.h"
#include "application_manager/request_info.h"
#include "application_manager/mock_request.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "resumption/last_state.h"
@@ -62,10 +62,11 @@ using ::application_manager::request_controller::RequestInfo;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
+using ::testing::_;
typedef NiceMock<application_manager_test::MockRequest> MRequest;
-typedef utils::SharedPtr<MRequest> RequestPtr;
-typedef utils::SharedPtr<RequestController> RequestControllerSPtr;
+typedef std::shared_ptr<MRequest> RequestPtr;
+typedef std::shared_ptr<RequestController> RequestControllerSPtr;
namespace {
const size_t kNumberOfRequests = 10u;
@@ -104,7 +105,7 @@ class RequestControllerTestClass : public ::testing::Test {
ON_CALL(mock_request_controller_settings_, thread_pool_size())
.WillByDefault(Return(kThreadPoolSize));
request_ctrl_ =
- utils::MakeShared<RequestController>(mock_request_controller_settings_);
+ std::make_shared<RequestController>(mock_request_controller_settings_);
}
RequestPtr GetMockRequest(
@@ -112,8 +113,9 @@ class RequestControllerTestClass : public ::testing::Test {
const uint32_t connection_key = kDefaultConnectionKey,
const uint32_t default_timeout = kDefaultTimeout) {
RequestPtr output =
- utils::MakeShared<MRequest>(connection_key, correlation_id);
+ std::make_shared<MRequest>(connection_key, correlation_id);
ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout));
+ ON_CALL(*output, CheckPermissions()).WillByDefault(Return(true));
return output;
}
@@ -159,6 +161,40 @@ class RequestControllerTestClass : public ::testing::Test {
};
TEST_F(RequestControllerTestClass,
+ AddMobileRequest_DuplicateCorrelationId_INVALID_ID) {
+ RequestPtr request_valid = GetMockRequest();
+ TestAsyncWaiter waiter_valid;
+ ON_CALL(*request_valid, default_timeout()).WillByDefault(Return(0));
+ EXPECT_CALL(*request_valid, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*request_valid, Run())
+ .Times(1)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter_valid));
+
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ request_valid,
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_TRUE(waiter_valid.WaitFor(1, 1000));
+
+ // The command should not be run if another command with the same
+ // correlation_id is waiting for a response
+ RequestPtr request_dup_corr_id = GetMockRequest();
+ TestAsyncWaiter waiter_dup;
+ ON_CALL(*request_dup_corr_id, default_timeout()).WillByDefault(Return(0));
+ EXPECT_CALL(*request_dup_corr_id, Init()).WillOnce(Return(true));
+ ON_CALL(*request_dup_corr_id, Run())
+ .WillByDefault(NotifyTestAsyncWaiter(&waiter_dup));
+
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ request_dup_corr_id,
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_FALSE(waiter_dup.WaitFor(1, 1000));
+}
+
+TEST_F(RequestControllerTestClass,
CheckPosibilitytoAdd_ZeroValueLimiters_SUCCESS) {
// Test case than pending_requests_amount,
// app_time_scale_max_requests_ and
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 11b2d2f259..0abef44e9a 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -36,8 +36,6 @@
#include <vector>
#include <limits>
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
namespace request_info = application_manager::request_controller;
@@ -48,11 +46,11 @@ namespace application_manager_test {
class TestRequestInfo : public request_info::RequestInfo {
public:
TestRequestInfo(request_info::RequestPtr request,
- const RequestType requst_type,
- const TimevalStruct& start_time,
+ const RequestType request_type,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
- : RequestInfo(request, requst_type, start_time, timeout_msec) {}
- void SetEndTime(const TimevalStruct& end_time) {
+ : RequestInfo(request, request_type, start_time, timeout_msec) {}
+ void SetEndTime(const date_time::TimeDuration& end_time) {
end_time_ = end_time;
}
};
@@ -76,26 +74,26 @@ class RequestInfoTest : public ::testing::Test {
uint32_t default_timeout_;
uint32_t mobile_correlation_id;
- utils::SharedPtr<TestRequestInfo> CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> CreateTestInfo(
uint32_t connection_key,
uint32_t correlation_id,
- request_info::RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ request_info::RequestInfo::RequestType request_type,
+ const date_time::TimeDuration& start_time,
uint64_t timeout_msec) {
- utils::SharedPtr<MockRequest> mock_request =
- utils::MakeShared<MockRequest>(connection_key, correlation_id);
- utils::SharedPtr<TestRequestInfo> request =
- utils::MakeShared<TestRequestInfo>(
- mock_request, requst_type, start_time, timeout_msec);
+ std::shared_ptr<MockRequest> mock_request =
+ std::make_shared<MockRequest>(connection_key, correlation_id);
+ std::shared_ptr<TestRequestInfo> request =
+ std::make_shared<TestRequestInfo>(
+ mock_request, request_type, start_time, timeout_msec);
return request;
}
};
TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
- const TimevalStruct& time = date_time::DateTime::getCurrentTime();
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
+ const date_time::TimeDuration& time = date_time::getCurrentTime();
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request = CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> request = CreateTestInfo(
i, i, request_info::RequestInfo::MobileRequest, time, default_timeout_);
request->SetEndTime(time);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -105,11 +103,11 @@ TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(request));
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
@@ -119,15 +117,15 @@ TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
}
TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
// Add hmi requests
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(request);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -135,7 +133,7 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
// Delete every request
- std::vector<utils::SharedPtr<TestRequestInfo> >::iterator req_it =
+ std::vector<std::shared_ptr<TestRequestInfo> >::iterator req_it =
requests.begin();
for (; req_it != requests.end(); ++req_it) {
@@ -155,18 +153,18 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
12345,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request1));
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
54321,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request2));
EXPECT_EQ(2u, request_info_set_.Size());
@@ -175,15 +173,15 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
const uint32_t count_of_mobile_request1 = 200;
const uint32_t count_of_mobile_request2 = 100;
for (uint32_t i = 0; i < count_of_mobile_request1; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request1);
@@ -192,11 +190,11 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
EXPECT_EQ(count_of_mobile_request1, request_info_set_.Size());
for (uint32_t i = 0; i < count_of_mobile_request2; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request2);
@@ -214,20 +212,20 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
TEST_F(RequestInfoTest, RequestInfoSetFront) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
i);
request_info_set_.Add(request);
}
for (uint32_t i = 1; i < count_of_requests_for_test_; ++i) {
request_info::RequestInfoPtr request_info = request_info_set_.Front();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
request_info = request_info_set_.FrontWithNotNullTimeout();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request_info));
}
EXPECT_EQ(1u, request_info_set_.Size());
@@ -248,27 +246,27 @@ TEST_F(RequestInfoTest, RequestInfoSetFind) {
appid_connection_id.end();
for (; req_it != end; ++req_it) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(req_it->first,
req_it->second,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set_.Add(request));
}
request_info::RequestInfoPtr request = request_info_set_.Find(
count_of_requests_for_test_, count_of_requests_for_test_);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
req_it = appid_connection_id.begin();
for (; req_it != end; ++req_it) {
request_info::RequestInfoPtr request =
request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_TRUE(request.valid());
+ EXPECT_TRUE(request.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
request = request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
}
EXPECT_EQ(0u, request_info_set_.Size());
}
@@ -277,11 +275,11 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
request_info::RequestInfoSet request_info_set;
const uint32_t connection_key = 65483;
const uint32_t corr_id = 65483;
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(connection_key,
corr_id,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
@@ -289,31 +287,33 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
EXPECT_EQ(1u, request_info_set.Size());
request_info::RequestInfoPtr found =
request_info_set.Find(connection_key, corr_id);
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
EXPECT_EQ(0u, request_info_set.Size());
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
found = request_info_set.Front();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
EXPECT_EQ(0u, request_info_set.Size());
}
TEST_F(RequestInfoTest, EndTimeisExpired) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ // get just the seconds part of the current time
+ date_time::TimeDuration not_expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ not_expired += date_time::microseconds(std::numeric_limits<time_t>::min());
- TimevalStruct not_expired = date_time::DateTime::getCurrentTime();
- not_expired.tv_usec = std::numeric_limits<time_t>::min();
+ date_time::TimeDuration expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ expired += date_time::microseconds(std::numeric_limits<time_t>::max());
- TimevalStruct expired = date_time::DateTime::getCurrentTime();
- expired.tv_usec = std::numeric_limits<time_t>::max();
-
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -328,8 +328,8 @@ TEST_F(RequestInfoTest, EndTimeisExpired) {
}
TEST_F(RequestInfoTest, UpdateEndTime) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -337,13 +337,13 @@ TEST_F(RequestInfoTest, UpdateEndTime) {
default_timeout_);
request->SetEndTime(time);
request->updateEndTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_LE(time.tv_sec, last_time.tv_sec);
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_LE(date_time::getSecs(time), date_time::getSecs(last_time));
}
TEST_F(RequestInfoTest, UpdateTimeOut) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -353,9 +353,10 @@ TEST_F(RequestInfoTest, UpdateTimeOut) {
request->updateEndTime();
request->updateTimeOut(100);
- time = date_time::DateTime::getCurrentTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_NEAR(time.tv_sec + 100, last_time.tv_sec, 500);
+ time = date_time::getCurrentTime();
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_NEAR(
+ date_time::getSecs(time) + 100, date_time::getSecs(last_time), 500);
}
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index f80842e250..1c2339096c 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -37,12 +37,15 @@
#include "application_manager/resumption/resume_ctrl_impl.h"
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_app_extension.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+#include "config_profile/profile.h"
+
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
@@ -54,14 +57,17 @@ namespace components {
namespace resumption_test {
using ::testing::_;
-using ::testing::Return;
-using ::testing::ReturnRef;
+using ::testing::A;
+using ::testing::AtLeast;
using ::testing::DoAll;
-using ::testing::SetArgReferee;
+using ::testing::Eq;
using ::testing::Mock;
using ::testing::NiceMock;
-using ::testing::AtLeast;
-using ::testing::Eq;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
+using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using namespace application_manager_test;
using namespace resumption;
@@ -79,51 +85,87 @@ class ResumeCtrlTest : public ::testing::Test {
, kTestGrammarId_(10)
, kHash_("saved_hash")
, kAppResumingTimeout_(30000u) // miliseconds
- , kTestTimeStamp_(1452074434u) {}
+ , kTestTimeStamp_(1452074434u)
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , kDefaultDeferredTestLevel_(eType::INVALID_ENUM)
+ , kNaviLowbandwidthLevel_("LIMITED")
+ , kProjectionLowbandwidthLevel_("NONE")
+ , kMediaLowbandwidthLevel_("NONE") {
+ profile::Profile profile_;
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ resumption_delay_before_ign_ = profile_.resumption_delay_before_ign();
+ }
virtual void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&app_mngr_);
- ON_CALL(app_mngr_, event_dispatcher())
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
+ ON_CALL(mock_app_mngr_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
mock_storage_ =
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
- app_mngr_);
- app_mock_ = utils::MakeShared<NiceMock<MockApplication> >();
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_);
+ mock_app_ = std::make_shared<NiceMock<MockApplication> >();
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+ mock_app_extension_ = std::make_shared<
+ NiceMock<application_manager_test::MockAppExtension> >();
const_app_ =
- static_cast<application_manager::ApplicationConstSharedPtr>(app_mock_);
- res_ctrl_ = utils::MakeShared<ResumeCtrlImpl>(app_mngr_);
+ static_cast<application_manager::ApplicationConstSharedPtr>(mock_app_);
+ res_ctrl_ = std::make_shared<ResumeCtrlImpl>(mock_app_mngr_);
res_ctrl_->set_resumption_storage(mock_storage_);
- ON_CALL(app_mngr_, state_controller())
- .WillByDefault(ReturnRef(state_controller_));
- ON_CALL(app_mngr_, get_settings())
+ ON_CALL(mock_app_mngr_, state_controller())
+ .WillByDefault(ReturnRef(mock_state_controller_));
+ ON_CALL(mock_app_mngr_, get_settings())
.WillByDefault(ReturnRef(mock_application_manager_settings_));
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(true));
ON_CALL(mock_application_manager_settings_, use_db_for_resumption())
.WillByDefault(Return(false));
ON_CALL(mock_application_manager_settings_, app_resuming_timeout())
.WillByDefault(ReturnRef(kAppResumingTimeout_));
+ // use EXPECTED_CALL().Times(AtLeast(0)) instead of ON_CALL to remove
+ // warning messages
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kNaviLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kProjectionLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kMediaLowbandwidthLevel_));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(kDefaultDeferredTestLevel_));
}
void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&app_mngr_);
+ Mock::VerifyAndClearExpectations(&mock_app_mngr_);
}
void GetInfoFromApp() {
- ON_CALL(*app_mock_, policy_app_id())
+ ON_CALL(*mock_app_, policy_app_id())
.WillByDefault(Return(kTestPolicyAppId_));
- ON_CALL(*app_mock_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
- ON_CALL(*app_mock_, device()).WillByDefault(Return(kTestDevId_));
- ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*mock_app_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
+ ON_CALL(*mock_app_, device()).WillByDefault(Return(kTestDevId_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_));
}
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
- application_manager_test::MockApplicationManager app_mngr_;
- MockStateController state_controller_;
- utils::SharedPtr<ResumeCtrl> res_ctrl_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
- utils::SharedPtr<NiceMock<MockApplication> > app_mock_;
+ NiceMock<application_manager_test::MockApplicationManager> mock_app_mngr_;
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
+ mock_app_extension_;
+ MockStateController mock_state_controller_;
+ std::shared_ptr<ResumeCtrl> res_ctrl_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
application_manager::ApplicationConstSharedPtr const_app_;
const uint32_t kTestAppId_;
const std::string kTestPolicyAppId_;
@@ -135,7 +177,13 @@ class ResumeCtrlTest : public ::testing::Test {
const std::string kHash_;
const uint32_t kAppResumingTimeout_;
const uint32_t kTestTimeStamp_;
+ uint32_t resumption_delay_before_ign_;
+ std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
sync_primitives::Lock app_set_lock_;
+ const mobile_apis::HMILevel::eType kDefaultDeferredTestLevel_;
+ const std::string kNaviLowbandwidthLevel_;
+ const std::string kProjectionLowbandwidthLevel_;
+ const std::string kMediaLowbandwidthLevel_;
};
/**
@@ -150,15 +198,15 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) {
// Check RestoreApplicationData
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -174,16 +222,16 @@ TEST_F(ResumeCtrlTest, StartResumption_WithoutGrammarId) {
saved_app[application_manager::strings::hash_id] = kHash_;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_)).Times(0);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_)).Times(0);
- bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_FALSE(res);
}
@@ -222,15 +270,15 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
test_application_files;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_files; ++i) {
- EXPECT_CALL(*app_mock_,
+ EXPECT_CALL(*mock_app_,
AddFile(CheckAppFile(
true,
true,
@@ -238,7 +286,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
static_cast<mobile_apis::FileType::eType>(file_types[i]))));
}
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -260,27 +308,27 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
test_application_submenues;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_submenues; ++i) {
- EXPECT_CALL(*app_mock_, AddSubMenu(i, test_application_submenues[i]));
+ EXPECT_CALL(*mock_app_, AddSubMenu(i, test_application_submenues[i]));
}
smart_objects::SmartObjectList requests;
- EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ EXPECT_CALL(mock_app_mngr_, GetNextHMICorrelationID())
.WillRepeatedly(Return(kCorId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
CreateAddSubMenuRequestToHMI(_, kCorId_))
.WillRepeatedly(Return(requests));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -301,17 +349,21 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
saved_app[application_manager::strings::application_commands] =
test_application_commands;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
+ ON_CALL(*mock_app_, help_prompt_manager())
+ .WillByDefault(ReturnRef(*mock_help_prompt_manager_));
for (uint32_t i = 0; i < count_of_commands; ++i) {
- EXPECT_CALL(*app_mock_, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*mock_app_, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(i, test_application_commands[i], true));
}
smart_objects::SmartObjectList requests;
@@ -319,7 +371,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
CreateAddCommandRequestToHMI(_, _))
.WillRepeatedly(Return(requests));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -353,17 +405,17 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
application_choice_sets;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, UpdateHash());
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
- EXPECT_CALL(*app_mock_, AddChoiceSet(i, application_choice_sets[i]));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(i, application_choice_sets[i]));
}
smart_objects::SmartObjectList requests;
@@ -371,7 +423,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
CreateAddVRCommandRequestFromChoiceToHMI(_))
.WillRepeatedly(Return(requests));
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -385,22 +437,22 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
test_global_properties;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendGlobalPropertiesToHMI(_));
- EXPECT_CALL(*app_mock_, load_global_properties(test_global_properties));
+ EXPECT_CALL(*mock_app_, load_global_properties(test_global_properties));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -409,7 +461,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
smart_objects::SmartObject test_subscriptions;
smart_objects::SmartObject app_buttons;
- uint32_t count_of_buttons = 17;
+ const uint32_t count_of_buttons = 17;
for (uint32_t i = 0; i < count_of_buttons; ++i) {
app_buttons[i] = i;
}
@@ -420,30 +472,37 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_buttons; ++i) {
EXPECT_CALL(
- *app_mock_,
+ *mock_app_,
SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(i)));
}
- EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*mock_app_, UpdateHash());
+
+ std::list<application_manager::AppExtensionPtr> extensions;
+ extensions.insert(extensions.begin(), mock_app_extension_);
+
+ EXPECT_CALL(*mock_app_, Extensions()).WillOnce(ReturnRef(extensions));
+
+ EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2);
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -452,9 +511,9 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject test_subscriptions;
smart_objects::SmartObject app_vi;
- int vtype = application_manager::VehicleDataType::GPS;
+ int vtype = mobile_apis::VehicleDataType::VEHICLEDATA_GPS;
uint i = 0;
- for (; vtype < application_manager::VehicleDataType::STEERINGWHEEL;
+ for (; vtype < mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL;
++i, ++vtype) {
app_vi[i] = vtype;
}
@@ -465,31 +524,30 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
-
- for (size_t i = 0; i < app_vi.length(); ++i) {
- EXPECT_CALL(
- *app_mock_,
- SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
- }
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
smart_objects::SmartObjectList requests;
- EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
- GetIVISubscriptionRequests(_)).WillRepeatedly(Return(requests));
- EXPECT_CALL(*app_mock_, UpdateHash());
- const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_CALL(*mock_app_, UpdateHash());
+ std::list<application_manager::AppExtensionPtr> extensions;
+
+ extensions.insert(extensions.begin(), mock_app_extension_);
+
+ EXPECT_CALL(*mock_app_, Extensions()).WillOnce(ReturnRef(extensions));
+
+ EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions));
+ const bool res = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(res);
}
@@ -504,41 +562,80 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToWayPoints) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
- EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(
+ mock_app_mngr_,
+ SubscribeAppForWayPoints(A<application_manager::ApplicationSharedPtr>()));
const mobile_apis::HMILevel::eType hmi_test_level =
mobile_apis::HMILevel::HMI_FULL;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(hmi_test_level));
- EXPECT_CALL(state_controller_, SetRegularState(_, hmi_test_level));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, hmi_test_level));
- const bool result = res_ctrl_->StartResumption(app_mock_, kHash_);
+ const bool result = res_ctrl_->StartResumption(mock_app_, kHash_);
EXPECT_TRUE(result);
}
TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
smart_objects::SmartObject saved_app;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_);
EXPECT_TRUE(res);
}
+TEST_F(ResumeCtrlTest, RetryResumption) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::HMI_FULL));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_TRUE(is_resumption_active);
+}
+
+TEST_F(ResumeCtrlTest, RetryResumption_NotDeferred) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::INVALID_ENUM));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_FALSE(is_resumption_active);
+}
+
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
- EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
@@ -547,9 +644,9 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
@@ -560,13 +657,145 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
- EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppHasDeferredResumption) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_NONE;
+ mobile_apis::HMILevel::eType deferred_level = eType::HMI_FULL;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ // resume into deferred level instead of restored level
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, deferred_level))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ mobile_apis::HMILevel::eType app_deferred_level = deferred_level;
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(ReturnPointee(&app_deferred_level));
+ EXPECT_CALL(*mock_app_,
+ set_deferred_resumption_hmi_level(eType::INVALID_ENUM))
+ .WillOnce(SaveArg<0>(&app_deferred_level));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ .Times(AtLeast(1));
GetInfoFromApp();
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // if resumption is deferred ...
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ // ... then RemoveApplicationFromSaved() will not be called
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable_NaviAndMedia) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ uint32_t ign_off_count = 0;
+ smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ // in this test, it is expected that the app will resume into LIMITED, which
+ // is the higher level among NONE and LIMITED
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(true));
+
+ std::string navi_lowbandwidth_level("NONE");
+ std::string projection_lowbandwidth_level("BACKGROUND");
+ std::string media_lowbandwidth_level("LIMITED");
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(navi_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(projection_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(media_lowbandwidth_level));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
/**
@@ -576,23 +805,30 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
- EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
- const bool res = res_ctrl_->RestoreAppHMIState(app_mock_);
+ const bool res = res_ctrl_->RestoreAppHMIState(mock_app_);
EXPECT_TRUE(res);
}
@@ -601,35 +837,76 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- res_ctrl_->SetupDefaultHMILevel(app_mock_);
+ res_ctrl_->SetupDefaultHMILevel(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest,
+ SetupDefaultHMILevel_HighBandwidthTransportNotAvailable) {
+ smart_objects::SmartObject saved_app;
+
+ saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // SetRegularState() should be called with kProjectionLowbandwidthLevel_
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_NONE))
+ .Times(AtLeast(1));
+
+ res_ctrl_->SetupDefaultHMILevel(mock_app_);
}
TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
- ON_CALL(app_mngr_, application(kTestAppId_)).WillByDefault(Return(app_mock_));
+ ON_CALL(mock_app_mngr_, application(kTestAppId_))
+ .WillByDefault(Return(mock_app_));
+
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
const uint32_t ign_off_count = 0u;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
MockStateController state_controller;
- EXPECT_CALL(app_mngr_, state_controller())
+ EXPECT_CALL(mock_app_mngr_, state_controller())
.WillOnce(ReturnRef(state_controller));
EXPECT_CALL(state_controller, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
@@ -638,37 +915,37 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- ON_CALL(app_mngr_, GetUserConsentForDevice(kMacAddress_))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice(kMacAddress_))
.WillByDefault(Return(policy::kDeviceAllowed));
- res_ctrl_->StartAppHmiStateResumption(app_mock_);
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
/**
* @brief group of tests which check correct SetAppHMIState
-*/
+ */
TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) {
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
const bool res =
- res_ctrl_->SetAppHMIState(app_mock_, kDefaultTestLevel_, false);
+ res_ctrl_->SetAppHMIState(mock_app_, kDefaultTestLevel_, false);
EXPECT_TRUE(res);
}
TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) {
mobile_apis::HMILevel::eType test_type = eType::HMI_LIMITED;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
EXPECT_TRUE(res);
}
@@ -676,14 +953,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
// GetDefaultHmiLevel should not be called
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(const_app_)).Times(0);
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_)).Times(0);
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, false);
EXPECT_TRUE(res);
}
@@ -691,14 +968,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
EXPECT_TRUE(res);
}
@@ -706,51 +983,51 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
.WillByDefault(Return(policy::kDeviceDisallowed));
- EXPECT_CALL(*app_mock_, set_is_resuming(true));
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ EXPECT_CALL(*mock_app_, set_is_resuming(true));
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
- EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(mock_app_, test_type, true);
EXPECT_FALSE(res);
}
TEST_F(ResumeCtrlTest, SaveAllApplications) {
- utils::SharedPtr<application_manager_test::MockApplication> test_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> test_app =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*test_app, app_id()).WillRepeatedly(Return(kTestAppId_));
application_manager::ApplicationSet app_set;
app_set.insert(test_app);
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(Eq(test_app)));
res_ctrl_->SaveAllApplications();
}
TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
res_ctrl_->SaveAllApplications();
}
TEST_F(ResumeCtrlTest, SaveApplication) {
- utils::SharedPtr<application_manager::Application> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_storage_, SaveApplication(app_sh_mock));
res_ctrl_->SaveApplication(app_sh_mock);
@@ -760,26 +1037,26 @@ TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
smart_objects::SmartObject saved_app;
GetInfoFromApp();
- ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
.WillByDefault(Return(kDefaultTestLevel_));
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_));
- const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_);
EXPECT_TRUE(res);
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_));
res_ctrl_->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
res_ctrl_->OnAppActivated(app_sh_mock);
}
@@ -837,7 +1114,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
@@ -858,7 +1135,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
VerifyImageFiles(_, _, _))
.WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
@@ -875,28 +1152,28 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(mock_app_));
}
// TODO (VVeremjova) APPLINK-16718
TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
- EXPECT_CALL(*mock_storage_, OnSuspend());
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount());
res_ctrl_->OnSuspend();
}
TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
DataAccessor<application_manager::ApplicationSet> accessor(app_set,
- app_set_lock_);
+ app_set_lock_ptr_);
- ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
- EXPECT_CALL(*mock_storage_, OnSuspend());
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount()).Times(0);
EXPECT_CALL(*mock_storage_, Persist());
res_ctrl_->OnSuspend();
}
@@ -906,7 +1183,7 @@ TEST_F(ResumeCtrlTest, OnAwake) {
EXPECT_CALL(mock_application_manager_settings_,
app_resumption_save_persistent_data_timeout())
.WillOnce(ReturnRef(timeout));
- EXPECT_CALL(*mock_storage_, OnAwake());
+ EXPECT_CALL(*mock_storage_, DecrementIgnOffCount()).Times(0);
res_ctrl_->OnAwake();
}
@@ -915,7 +1192,7 @@ TEST_F(ResumeCtrlTest, RemoveApplicationFromSaved) {
EXPECT_CALL(*mock_storage_,
RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl_->RemoveApplicationFromSaved(app_mock_));
+ EXPECT_TRUE(res_ctrl_->RemoveApplicationFromSaved(mock_app_));
}
TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
@@ -926,7 +1203,7 @@ TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
ON_CALL(*mock_storage_,
GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl_->CheckApplicationHash(app_mock_, kHash_));
+ EXPECT_TRUE(res_ctrl_->CheckApplicationHash(mock_app_, kHash_));
}
TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_NoAskedApp_INVALID_ENUM) {
@@ -952,6 +1229,194 @@ TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_AskedAppFound_INVALID_ENUM) {
res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
}
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest, ResumptionLowVoltage_AppInBackground_NotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_BACKGROUND;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_ + time_offset));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
} // namespace resumption_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index aa4db59eac..8423520b9f 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -38,7 +38,7 @@
#include "interfaces/MOBILE_API.h"
#include "utils/sqlite_wrapper/sql_database.h"
#include "utils/sqlite_wrapper/sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/resumption_data_test.h"
#include "application_manager/test_resumption_data_db.h"
@@ -52,6 +52,7 @@ namespace resumption_test {
using ::testing::NiceMock;
using ::testing::ReturnRef;
+using ::testing::_;
using application_manager_test::MockApplication;
namespace am = application_manager;
@@ -67,7 +68,7 @@ const std::string kPath =
class ResumptionDataDBTest : public ResumptionDataTest {
protected:
void SetUp() OVERRIDE {
- app_mock = utils::MakeShared<NiceMock<MockApplication> >();
+ app_mock = std::make_shared<NiceMock<MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
is_audio_ = true;
@@ -122,7 +123,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
void SetZeroIgnOffTime() {
utils::dbms::SQLQuery query(test_db());
- EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime));
+ EXPECT_TRUE(query.Prepare(kUpdateLastIgnOffTime));
query.Bind(0, 0);
EXPECT_TRUE(query.Exec());
}
@@ -165,7 +166,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; ";
private:
@@ -271,6 +272,10 @@ void ResumptionDataDBTest::CheckGlobalProportiesData() {
select_image.GetInteger(0));
EXPECT_EQ((*menu_icon_)[am::strings::value].asString(),
select_image.GetString(1));
+ if ((*menu_icon_).keyExists(am::strings::is_template)) {
+ EXPECT_EQ((*menu_icon_)[am::strings::is_template].asBool(),
+ select_image.GetBoolean(2));
+ }
}
if (!select_globalproperties.IsNull(8)) {
utils::dbms::SQLQuery select_tts_chunk(test_db());
@@ -559,6 +564,7 @@ TEST_F(ResumptionDataDBTest, Init) {
TEST_F(ResumptionDataDBTest, SaveApplication) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
}
@@ -566,6 +572,7 @@ TEST_F(ResumptionDataDBTest, SaveApplication) {
TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(
@@ -580,6 +587,7 @@ TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved) {
TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
sm::SmartObject saved_app;
@@ -591,6 +599,7 @@ TEST_F(ResumptionDataDBTest, RemoveApplicationFromSaved_AppNotSaved) {
TEST_F(ResumptionDataDBTest, SavedApplicationTwice) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_db()->SaveApplication(app_mock);
CheckSavedDB();
res_db()->SaveApplication(app_mock);
@@ -600,6 +609,7 @@ TEST_F(ResumptionDataDBTest, SavedApplicationTwice) {
TEST_F(ResumptionDataDBTest, SavedApplicationTwice_UpdateApp) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_db()->SaveApplication(app_mock);
CheckSavedDB();
(*vr_help_)[0][am::strings::position] = 2;
@@ -611,6 +621,7 @@ TEST_F(ResumptionDataDBTest, SavedApplicationTwice_UpdateApp) {
TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(0, result);
@@ -619,6 +630,7 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationSaved) {
TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
EXPECT_TRUE(
res_db()->RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
@@ -629,6 +641,7 @@ TEST_F(ResumptionDataDBTest, IsApplicationSaved_ApplicationRemoved) {
TEST_F(ResumptionDataDBTest, GetSavedApplication) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
@@ -650,6 +663,7 @@ TEST_F(ResumptionDataDBTest, GetSavedApplication_AppNotSaved) {
TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
sm::SmartObject saved_app;
@@ -668,6 +682,7 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(
@@ -679,6 +694,7 @@ TEST_F(ResumptionDataDBTest, GetDataForLoadResumeData_AppRemove) {
TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
@@ -690,6 +706,7 @@ TEST_F(ResumptionDataDBTest, UpdateHmiLevel) {
TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppIsSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_TRUE(res_db()->IsHMIApplicationIdExist(hmi_app_id_));
@@ -698,6 +715,7 @@ TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppIsSaved) {
TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
uint32_t new_hmi_app_id_ = hmi_app_id_ + 10;
@@ -707,6 +725,7 @@ TEST_F(ResumptionDataDBTest, IsHMIApplicationIdExist_AppNotSaved) {
TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_EQ(hmi_app_id_,
@@ -716,6 +735,7 @@ TEST_F(ResumptionDataDBTest, GetHMIApplicationID) {
TEST_F(ResumptionDataDBTest, GetHMIApplicationID_AppNotSaved) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
EXPECT_EQ(0u, res_db()->GetHMIApplicationID(policy_app_id_, "other_dev_id"));
@@ -725,10 +745,11 @@ TEST_F(ResumptionDataDBTest, OnSuspend) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
}
@@ -737,21 +758,22 @@ TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
@@ -762,14 +784,15 @@ TEST_F(ResumptionDataDBTest, OnSuspendOnAwake) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -779,10 +802,11 @@ TEST_F(ResumptionDataDBTest, Awake_AppNotSuspended) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -792,15 +816,16 @@ TEST_F(ResumptionDataDBTest, TwiceAwake_AppNotSuspended) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
- res_db()->OnAwake();
+ res_db()->IncrementIgnOffCount();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
CheckSavedDB();
}
@@ -808,6 +833,7 @@ TEST_F(ResumptionDataDBTest, GetHashId) {
PrepareData();
EXPECT_TRUE(res_db()->Init());
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
std::string test_hash;
@@ -821,19 +847,20 @@ TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
SetZeroIgnOffTime();
uint32_t last_ign_off_time;
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
last_ign_off_time = res_db()->GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_db()->GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
after_awake = res_db()->GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
@@ -844,6 +871,7 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(res_db()->Init());
SetZeroIgnOffTime();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_db()->SaveApplication(app_mock);
EXPECT_TRUE(res_db()->DropAppDataResumption(kMacAddress_, policy_app_id_));
@@ -863,8 +891,8 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index 834637fa62..40e61a3c53 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -52,6 +52,7 @@ namespace resumption_test {
using ::testing::_;
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::NiceMock;
namespace am = application_manager;
@@ -60,7 +61,7 @@ using namespace file_system;
using namespace resumption;
using namespace mobile_apis;
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
class ResumptionDataJsonTest : public ResumptionDataTest {
protected:
@@ -68,7 +69,8 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
: last_state_("app_storage_folder", "app_info_storage")
, res_json(last_state_, mock_application_manager_) {}
virtual void SetUp() {
- app_mock = new NiceMock<application_manager_test::MockApplication>();
+ app_mock = std::make_shared<
+ NiceMock<application_manager_test::MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
@@ -90,7 +92,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
dictionary[am::strings::resumption][am::strings::resume_app_list];
sm::SmartObject res_app_list;
for (uint32_t i = 0; i < resume_app_list.size(); i++) {
- Formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
+ formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
res_app_list);
CheckSavedApp(res_app_list);
}
@@ -109,12 +111,14 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
TEST_F(ResumptionDataJsonTest, SaveApplication) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
}
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_json.SaveApplication(app_mock);
CheckSavedJson();
res_json.SaveApplication(app_mock);
@@ -123,6 +127,7 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice) {
TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)).Times(2);
res_json.SaveApplication(app_mock);
CheckSavedJson();
(*vr_help_)[0][am::strings::position] = 2;
@@ -133,6 +138,7 @@ TEST_F(ResumptionDataJsonTest, SavedApplicationTwice_UpdateApp) {
TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
EXPECT_TRUE(
res_json.RemoveApplicationFromSaved(policy_app_id_, kMacAddress_));
@@ -150,6 +156,7 @@ TEST_F(ResumptionDataJsonTest, RemoveApplicationFromSaved_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
ssize_t result = res_json.IsApplicationSaved(policy_app_id_, kMacAddress_);
@@ -158,6 +165,7 @@ TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationSaved) {
TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(
@@ -168,6 +176,7 @@ TEST_F(ResumptionDataJsonTest, IsApplicationSaved_ApplicationRemoved) {
TEST_F(ResumptionDataJsonTest, GetSavedApplication) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
smart_objects::SmartObject saved_app;
EXPECT_TRUE(
@@ -184,6 +193,7 @@ TEST_F(ResumptionDataJsonTest, GetSavedApplication_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
smart_objects::SmartObject saved_app;
@@ -201,6 +211,7 @@ TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
smart_objects::SmartObject saved_app;
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(
@@ -211,6 +222,7 @@ TEST_F(ResumptionDataJsonTest, GetDataForLoadResumeData_AppRemove) {
TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
HMILevel::eType new_hmi_level = HMILevel::HMI_LIMITED;
@@ -222,6 +234,7 @@ TEST_F(ResumptionDataJsonTest, UpdateHmiLevel) {
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_TRUE(res_json.IsHMIApplicationIdExist(hmi_app_id_));
@@ -229,6 +242,7 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppIsSaved) {
TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -238,6 +252,7 @@ TEST_F(ResumptionDataJsonTest, IsHMIApplicationIdExist_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
EXPECT_EQ(hmi_app_id_,
@@ -246,6 +261,7 @@ TEST_F(ResumptionDataJsonTest, GetHMIApplicationID) {
TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
EXPECT_EQ(0u, res_json.GetHMIApplicationID(policy_app_id_, "other_dev_id"));
}
@@ -253,11 +269,11 @@ TEST_F(ResumptionDataJsonTest, GetHMIApplicationID_AppNotSaved) {
TEST_F(ResumptionDataJsonTest, OnSuspend) {
SetZeroIgnOff();
PrepareData();
-
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
}
@@ -265,16 +281,17 @@ TEST_F(ResumptionDataJsonTest, OnSuspend) {
TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnSuspend();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
EXPECT_TRUE(-1 != res_json.IsApplicationSaved(policy_app_id_, kMacAddress_));
}
@@ -282,14 +299,15 @@ TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -297,10 +315,11 @@ TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
SetZeroIgnOff();
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -308,20 +327,22 @@ TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
SetZeroIgnOff();
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnAwake();
+ res_json.IncrementIgnOffCount();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
CheckSavedJson();
}
TEST_F(ResumptionDataJsonTest, GetHashId) {
PrepareData();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -334,19 +355,20 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
uint32_t last_ign_off_time;
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
last_ign_off_time = res_json.GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_json.GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
after_awake = res_json.GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
@@ -355,6 +377,7 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
PrepareData();
SetZeroIgnOff();
+ EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_));
res_json.SaveApplication(app_mock);
CheckSavedJson();
@@ -375,8 +398,8 @@ TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 79397f5175..fe24ea39b6 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -50,6 +50,7 @@ namespace custom_str = utils::custom_string;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::_;
void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
EXPECT_EQ(policy_app_id_, resume_app_list[am::strings::app_id].asString());
@@ -72,7 +73,7 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
CheckGlobalProporties(
resume_app_list[am::strings::application_global_properties]);
- CheckSubscriptions(resume_app_list[am::strings::application_subscribtions]);
+ CheckSubscriptions(resume_app_list[am::strings::application_subscriptions]);
}
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
@@ -137,8 +138,6 @@ void ResumptionDataTest::CheckSubscriptions(sm::SmartObject& res_list) {
res_list[am::strings::application_buttons][0].asUInt());
EXPECT_EQ(static_cast<uint32_t>(ButtonName::eType::CUSTOM_BUTTON),
res_list[am::strings::application_buttons][1].asUInt());
- EXPECT_EQ(0u, res_list[am::strings::application_vehicle_info][0].asUInt());
- EXPECT_EQ(5u, res_list[am::strings::application_vehicle_info][1].asUInt());
}
void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
@@ -292,7 +291,7 @@ void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckTimeoutPrompt(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
for (uint i = 0; i < tts_chunks_count; ++i) {
std::string text = (*timeout_prompt_)[i][am::strings::text].asString();
SpeechCapabilities::eType speech = static_cast<SpeechCapabilities::eType>(
@@ -316,25 +315,28 @@ void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckVRTitle(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
std::string vtitle = (*vr_help_title_)[am::strings::vr_help_title].asString();
EXPECT_EQ(vtitle, res_list[am::strings::vr_help_title].asString());
}
void ResumptionDataTest::PrepareData() {
+ mock_app_extension_ =
+ std::make_shared<NiceMock<application_manager_test::MockAppExtension> >();
+ extensions_.insert(extensions_.begin(), mock_app_extension_);
+ ON_CALL(*app_mock, Extensions()).WillByDefault(ReturnRef(extensions_));
SetGlobalProporties();
SetCommands();
SetSubmenues();
SetChoiceSet();
SetAppFiles();
- DataAccessor<am::SubMenuMap> sub_menu_m(test_submenu_map, sublock_);
- DataAccessor<am::CommandsMap> commands_m(test_commands_map, comlock_);
- DataAccessor<am::ChoiceSetMap> choice_set_m(test_choiceset_map, setlock_);
+ DataAccessor<am::SubMenuMap> sub_menu_m(test_submenu_map, sublock_ptr_);
+ DataAccessor<am::CommandsMap> commands_m(test_commands_map, comlock_ptr_);
+ DataAccessor<am::ChoiceSetMap> choice_set_m(test_choiceset_map, setlock_ptr_);
SetSubscriptions();
- DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_);
- DataAccessor<am::VehicleInfoSubscriptions> ivi_access(ivi, ivilock_);
+ DataAccessor<am::ButtonSubscriptions> btn_sub(btn_subscr, btnlock_ptr_);
ON_CALL(*app_mock, is_application_data_changed()).WillByDefault(Return(true));
@@ -364,7 +366,6 @@ void ResumptionDataTest::PrepareData() {
ON_CALL(*app_mock, menu_icon()).WillByDefault(ReturnPointee(&menu_icon_));
ON_CALL(*app_mock, SubscribedButtons()).WillByDefault(Return(btn_sub));
- ON_CALL(*app_mock, SubscribedIVI()).WillByDefault(Return(ivi_access));
ON_CALL(*app_mock, getAppFiles()).WillByDefault(ReturnRef(app_files_map_));
}
@@ -381,6 +382,7 @@ void ResumptionDataTest::SetMenuTitleAndIcon() {
sm::SmartObject sm_icon;
sm_icon[am::strings::value] = "test icon";
sm_icon[am::strings::image_type] = ImageType::STATIC;
+ sm_icon[am::strings::is_template] = false;
sm::SmartObject sm_title;
sm_title = "test title";
@@ -539,8 +541,6 @@ void ResumptionDataTest::SetKeyboardProperties() {
void ResumptionDataTest::SetSubscriptions() {
btn_subscr.insert(ButtonName::eType::CUSTOM_BUTTON);
btn_subscr.insert(ButtonName::eType::OK);
- ivi.insert(0);
- ivi.insert(5);
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
index 08fa0a3eb5..0ec902085f 100644
--- a/src/components/application_manager/test/resumption_sql_queries_test.cc
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -79,7 +79,7 @@ const string kDeleteData =
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; "
"COMMIT; "
"VACUUM;";
@@ -197,8 +197,9 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
const int64_t glob_prop_key);
SQLQuery& FillImageTable(SQLQuery& query,
- const int imageType,
- const string& value);
+ const int image_type,
+ const string& value,
+ const bool is_template);
SQLQuery& FillTableLimitedCharacterListTable(
SQLQuery& query, const string& limitedCharacterList);
@@ -326,7 +327,7 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
db_schema.push_back("applicationCommandsArray");
db_schema.push_back("applicationFilesArray");
db_schema.push_back("applicationSubMenuArray");
- db_schema.push_back("applicationSubscribtionsArray");
+ db_schema.push_back("applicationSubscriptionsArray");
db_schema.push_back("_internal_data");
std::sort(db_schema.begin(), db_schema.end());
}
@@ -456,11 +457,13 @@ void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check,
}
SQLQuery& ResumptionSqlQueriesTest::FillImageTable(SQLQuery& query,
- const int imageType,
- const string& value) {
+ const int image_type,
+ const string& value,
+ const bool is_template) {
EXPECT_TRUE(query.Prepare(kInsertImage));
- query.Bind(0, imageType);
+ query.Bind(0, image_type);
query.Bind(1, value);
+ query.Bind(2, is_template);
EXPECT_TRUE(query.Exec());
return query;
}
@@ -802,7 +805,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksResumptionData_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -829,7 +835,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -854,7 +863,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -879,7 +891,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -904,7 +919,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -930,7 +948,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -956,7 +977,10 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -990,7 +1014,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectIgnOffTime_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1015,7 +1042,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1032,7 +1062,9 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) {
device_id,
key);
- key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId();
+ key = FillImageTable(
+ temp_query, 1 /* image_type */, "tst_img2", true /* is_template */)
+ .LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1056,7 +1088,10 @@ TEST_F(ResumptionSqlQueriesTest,
kSelectDataForLoadResumeData_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1084,7 +1119,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1117,7 +1155,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1148,7 +1189,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1189,7 +1233,10 @@ TEST_F(ResumptionSqlQueriesTest,
kSelectApplicationsIgnOffCount_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1229,7 +1276,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1258,7 +1308,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) {
TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1288,7 +1341,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationFilesArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1324,7 +1380,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1355,7 +1414,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationSubMenuArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key)
.LastInsertId();
@@ -1386,10 +1448,13 @@ TEST_F(ResumptionSqlQueriesTest,
}
TEST_F(ResumptionSqlQueriesTest,
- kDeleteApplicationSubscribtionsArray_ExpectDataDeleted) {
+ kDeleteApplicationSubscriptionsArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
key1 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1410,12 +1475,12 @@ TEST_F(ResumptionSqlQueriesTest,
key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId();
FillAppSubscriptionsArrayTable(temp_query, 7, 2, key1);
// Check
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
ValToPosPair p1(0, app_id2);
ValToPosPair p2(1, device_id);
- CheckDeleteQuery(select_count_applicationSubscribtionsArray,
- kDeleteApplicationSubscribtionsArray,
+ CheckDeleteQuery(select_count_applicationSubscriptionsArray,
+ kDeleteApplicationSubscriptionsArray,
p1,
p2,
1,
@@ -1426,7 +1491,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1456,7 +1524,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
key1 = FillGlobalPropertiesTable(
@@ -1490,7 +1561,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1522,7 +1596,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteApplicationCommandsArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1)
.LastInsertId();
@@ -1560,7 +1637,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillChoiceTable(temp_query,
2,
"tst_menu_name",
@@ -1595,7 +1675,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteVrCommandsFromChoiceSet_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1638,7 +1721,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 =
FillChoiceTable(
temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1)
@@ -1775,7 +1861,10 @@ TEST_F(ResumptionSqlQueriesTest,
kDeleteImageFromGlobalProperties_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1804,7 +1893,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -1834,7 +1926,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
- int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
+ int64_t key1 = FillImageTable(temp_query,
+ /*image_type=*/1,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t key2 = FillGlobalPropertiesTable(
temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1)
.LastInsertId();
@@ -2051,7 +2146,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) {
TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- FillImageTable(temp_query, 2, "tst_image");
+ FillImageTable(
+ temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true);
ValToPosPair p1(0, "tst_image");
ValToPosPair p2(1, "");
// Check
@@ -2061,7 +2157,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
ValToPosPair p1(0, "tst_image");
ValToPosPair p2(1, "");
// Check
@@ -2071,7 +2170,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kInsertImage_ExpectDataInserted) {
// Arrange
SQLQuery temp_query(db());
- FillImageTable(temp_query, 2, "tst_image");
+ FillImageTable(
+ temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true);
const std::string select_count_image = "SELECT COUNT(*) FROM image;";
// Check
CheckSelectQuery(select_count_image, 1, 0);
@@ -2211,17 +2311,17 @@ TEST_F(ResumptionSqlQueriesTest, kInsertSubscriptions_ExpectDataInserted) {
SQLQuery temp_query(db());
FillAppSubscriptionsArrayTable(temp_query, 2, 3, 4);
// Checks
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
- CheckSelectQuery(select_count_applicationSubscribtionsArray, 1, 0);
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
+ CheckSelectQuery(select_count_applicationSubscriptionsArray, 1, 0);
const std::string select_idApplication =
- "SELECT idApplication FROM applicationSubscribtionsArray;";
+ "SELECT idApplication FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_idApplication, 4, 0);
const std::string select_vehicleValue =
- "SELECT vehicleValue FROM applicationSubscribtionsArray;";
+ "SELECT vehicleValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_vehicleValue, 2, 0);
const std::string select_ButtonNameValue =
- "SELECT ButtonNameValue FROM applicationSubscribtionsArray;";
+ "SELECT ButtonNameValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_ButtonNameValue, 3, 0);
}
@@ -2616,7 +2716,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2656,7 +2759,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t choice_key =
FillChoiceTable(
@@ -2776,7 +2882,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
app_id1,
device_id,
9).LastInsertId();
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t choice_key =
FillChoiceTable(
temp_query, 1, "menu_name", "sec_text", "tert_text", image_key)
@@ -2808,7 +2917,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
// Check
ValToPosPair p1(0, IntToString(image_key));
ValToPosPair p2(1, "");
@@ -2846,7 +2958,10 @@ TEST_F(ResumptionSqlQueriesTest,
TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ test_image,
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -2883,7 +2998,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
@@ -2900,7 +3018,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) {
TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) {
// Arrange
SQLQuery temp_query(db());
- int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId();
+ int64_t image_key = FillImageTable(temp_query,
+ /*image_type=*/2,
+ "tst_image",
+ /*is_template=*/true).LastInsertId();
int64_t glob_prop_key =
FillGlobalPropertiesTable(
temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key)
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index a332f92382..23c75e8475 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1587,12 +1591,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1602,12 +1609,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1617,12 +1627,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1631,12 +1644,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1698,7 +1714,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
@@ -1708,6 +1724,7 @@
"COMMUNICATION" : 6,
"EMERGENCY" : 60,
"NAVIGATION" : 15,
+ "PROJECTION": 15,
"NONE" : 0,
"NORMAL" : 4,
"VOICECOMM" : 10
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index 3cfbf604f4..1d4cead52b 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -41,7 +41,7 @@
#include "transport_manager/mock_transport_manager.h"
#include "utils/lock.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+
#include "application_manager/message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/smart_object_keys.h"
@@ -54,6 +54,7 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_rpc_service.h"
namespace am = application_manager;
using am::HmiState;
@@ -63,6 +64,7 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::InSequence;
@@ -76,29 +78,34 @@ namespace state_controller_test {
namespace constants {
const uint32_t kCorrID = 314u;
const uint32_t kHMIAppID = 2718u;
-}
+} // namespace constants
struct HmiStatesComparator {
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
+ mobile_apis::VideoStreamingState::eType video_streaming_state_;
mobile_apis::SystemContext::eType system_context_;
HmiStatesComparator(
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ mobile_apis::VideoStreamingState::eType video_streaming_state,
mobile_apis::SystemContext::eType system_context)
: hmi_level_(hmi_level)
, audio_streaming_state_(audio_streaming_state)
+ , video_streaming_state_(video_streaming_state)
, system_context_(system_context) {}
HmiStatesComparator(am::HmiStatePtr state_ptr)
: hmi_level_(state_ptr->hmi_level())
, audio_streaming_state_(state_ptr->audio_streaming_state())
+ , video_streaming_state_(state_ptr->video_streaming_state())
, system_context_(state_ptr->system_context()) {}
bool operator()(am::HmiStatePtr state_ptr) const {
return state_ptr->hmi_level() == hmi_level_ &&
state_ptr->audio_streaming_state() == audio_streaming_state_ &&
+ state_ptr->video_streaming_state() == video_streaming_state_ &&
state_ptr->system_context() == system_context_;
}
};
@@ -132,9 +139,10 @@ class StateControllerImplTest : public ::testing::Test {
StateControllerImplTest()
: ::testing::Test()
, usage_stat("0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager))
- , applications_(application_set_, applications_lock_)
+ , applications_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , applications_(application_set_, applications_lock_ptr_)
, message_helper_mock_(
*application_manager::MockMessageHelper::message_helper_mock()) {
Mock::VerifyAndClearExpectations(&message_helper_mock_);
@@ -145,6 +153,7 @@ class StateControllerImplTest : public ::testing::Test {
}
NiceMock<application_manager_test::MockApplicationManager> app_manager_mock_;
+ NiceMock<application_manager_test::MockRPCService> mock_rpc_service_;
NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
NiceMock<connection_handler_test::MockConnectionHandler>
mock_connection_handler_;
@@ -154,9 +163,9 @@ class StateControllerImplTest : public ::testing::Test {
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
am::ApplicationSet application_set_;
- mutable sync_primitives::Lock applications_lock_;
+ mutable std::shared_ptr<sync_primitives::Lock> applications_lock_ptr_;
DataAccessor<am::ApplicationSet> applications_;
- utils::SharedPtr<am::StateControllerImpl> state_ctrl_;
+ std::shared_ptr<am::StateControllerImpl> state_ctrl_;
am::ApplicationSharedPtr simple_app_;
NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
@@ -206,16 +215,18 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr createHmiState(
mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType aidio_ss,
+ mobile_apis::AudioStreamingState::eType audio_ss,
+ mobile_apis::VideoStreamingState::eType video_ss,
mobile_apis::SystemContext::eType system_context) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::HmiStatePtr state =
- utils::MakeShared<am::HmiState>(simple_app_id_, app_manager_mock_);
+ std::make_shared<am::HmiState>(simple_app_, app_manager_mock_);
state->set_hmi_level(hmi_level);
- state->set_audio_streaming_state(aidio_ss);
+ state->set_audio_streaming_state(audio_ss);
+ state->set_video_streaming_state(video_ss);
state->set_system_context(system_context);
return state;
}
@@ -228,13 +239,15 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr CreateHmiStateByHmiStateType(
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_ss,
+ const mobile_apis::VideoStreamingState::eType video_ss,
const mobile_apis::SystemContext::eType system_context,
- const uint32_t app_id) {
+ const am::ApplicationSharedPtr app) {
am::HmiStatePtr new_state =
- utils::MakeShared<HmiStateType>(app_id, app_manager_mock_);
+ std::make_shared<HmiStateType>(app, app_manager_mock_);
new_state->set_hmi_level(hmi_level);
new_state->set_audio_streaming_state(audio_ss);
+ new_state->set_video_streaming_state(video_ss);
new_state->set_system_context(system_context);
return new_state;
@@ -248,27 +261,38 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MENU));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MENU));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_ALERT));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_BACKGROUND,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_NONE,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_ALERT));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_BACKGROUND,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
}
/**
@@ -280,20 +304,29 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
PrepareCommonStateResults(result_hmi_state);
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_LIMITED,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN));
- result_hmi_state.push_back(createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::ATTENUATED,
- SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_LIMITED,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
+ result_hmi_state.push_back(
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN));
}
/**
@@ -305,6 +338,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
@@ -313,6 +347,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -321,18 +356,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -341,18 +380,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -369,6 +412,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -376,6 +420,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -385,18 +430,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -417,6 +466,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -424,6 +474,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -432,18 +483,22 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -465,6 +520,7 @@ class StateControllerImplTest : public ::testing::Test {
std::vector<am::HmiStatePtr>& result_hmi_state, ApplicationType app_t) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
switch (app_t) {
case APP_TYPE_NON_MEDIA: {
@@ -472,6 +528,7 @@ class StateControllerImplTest : public ::testing::Test {
result_hmi_state.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
break;
}
@@ -487,7 +544,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(),
@@ -590,10 +647,9 @@ class StateControllerImplTest : public ::testing::Test {
app_id = (*it_begin)->app_id();
app_type = AppType(app_id);
app = (*it_begin);
- am::HmiStatePtr state_first =
- utils::MakeShared<T>(app_id, app_manager_mock_);
+ am::HmiStatePtr state_first = std::make_shared<T>(app, app_manager_mock_);
am::HmiStatePtr state_second =
- utils::MakeShared<Q>(app_id, app_manager_mock_);
+ std::make_shared<Q>(app, app_manager_mock_);
TestSetSeveralState(
app, state_first, state_second, app_type, call_back_result);
TestSetSeveralState(
@@ -630,146 +686,180 @@ class StateControllerImplTest : public ::testing::Test {
void FillStatesLists() {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
// Valid states for not audio app
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_ALERT));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Valid states audio app
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_VRSESSION));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MENU));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_HMI_OBSCURED));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_ALERT));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
valid_states_for_audio_app_.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Common Invalid States
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
common_invalid_states_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
common_invalid_states_.push_back(
createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::INVALID_ENUM));
// Invalid States for audio apps
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_audio_app.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Invalid States for not audio apps
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_LIMITED,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::ATTENUATED,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
invalid_states_for_not_audio_app.push_back(
createHmiState(HMILevel::HMI_FULL,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN));
// Valid state ids
@@ -864,7 +954,7 @@ class StateControllerImplTest : public ::testing::Test {
virtual void SetUp() OVERRIDE {
ON_CALL(app_manager_mock_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
- state_ctrl_ = utils::MakeShared<am::StateControllerImpl>(app_manager_mock_);
+ state_ctrl_ = std::make_shared<am::StateControllerImpl>(app_manager_mock_);
ON_CALL(app_manager_mock_, applications())
.WillByDefault(Return(applications_));
@@ -894,14 +984,15 @@ class StateControllerImplTest : public ::testing::Test {
ON_CALL(app_manager_mock_, GetPolicyHandler())
.WillByDefault(ReturnRef(policy_interface_));
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
-
- ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request))
+ ON_CALL(app_manager_mock_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request))
.WillByDefault(Return(true));
}
@@ -939,7 +1030,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSharedPtr app,
NiceMock<application_manager_test::MockApplication>* app_mock,
am::HmiStatePtr state) {
- EXPECT_CALL(*app_mock, RegularHmiState()).WillOnce(Return(state));
+ ON_CALL(*app_mock, RegularHmiState()).WillByDefault(Return(state));
EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(app)).Times(0);
EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(app->app_id(), _, _))
.Times(0);
@@ -954,46 +1045,52 @@ class StateControllerImplTest : public ::testing::Test {
am::HmiStatePtr NoneNotAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_NONE,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr FullAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr FullNotAudibleState() {
return createHmiState(mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr LimitedState() {
return createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
am::HmiStatePtr BackgroundState() {
return createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
void ApplyTempStatesForApplication(
- NiceMock<application_manager_test::MockApplication>& application,
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>& app_mock,
std::vector<am::HmiState::StateID>& state_ids) {
- using smart_objects::SmartObject;
using am::event_engine::Event;
+ using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(application, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState())
.WillRepeatedly(Return(NoneNotAudibleState()));
for (size_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application,
+ EXPECT_CALL(app_mock,
AddHMIState(Truly(HmiStatesIDComparator(state_id))));
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1029,30 +1126,31 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStarted();
+ state_ctrl_->OnVideoStreamingStarted(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
}
}
void CheckStateApplyingForApplication(
- NiceMock<application_manager_test::MockApplication>& application,
+ am::ApplicationSharedPtr app,
+ NiceMock<application_manager_test::MockApplication>& app_mock,
std::vector<am::HmiState::StateID>& state_ids) {
- using smart_objects::SmartObject;
using am::event_engine::Event;
+ using smart_objects::SmartObject;
namespace FunctionID = hmi_apis::FunctionID;
- EXPECT_CALL(application, CurrentHmiState())
+ EXPECT_CALL(app_mock, CurrentHmiState())
.WillRepeatedly(Return(NoneNotAudibleState()));
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application,
- AddHMIState(Truly(HmiStatesIDComparator(state_id)))).Times(1);
+ EXPECT_CALL(app_mock, AddHMIState(Truly(HmiStatesIDComparator(state_id))))
+ .Times(1);
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1088,23 +1186,23 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStarted();
+ state_ctrl_->OnVideoStreamingStarted(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, AddHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, AddHMIState(_)).Times(0);
}
for (uint32_t i = 0; i < state_ids.size(); ++i) {
am::HmiState::StateID state_id = state_ids[i];
- EXPECT_CALL(application, RemoveHMIState(state_id)).Times(1);
+ EXPECT_CALL(app_mock, RemoveHMIState(state_id)).Times(1);
- EXPECT_CALL(application, PostponedHmiState())
+ EXPECT_CALL(app_mock, PostponedHmiState())
.WillOnce(Return(NoneNotAudibleState()));
- EXPECT_CALL(application, RemovePostponedState());
+ EXPECT_CALL(app_mock, RemovePostponedState());
switch (state_id) {
case am::HmiState::StateID::STATE_ID_VR_SESSION: {
@@ -1140,14 +1238,14 @@ class StateControllerImplTest : public ::testing::Test {
break;
}
case am::HmiState::StateID::STATE_ID_NAVI_STREAMING: {
- state_ctrl_->OnNaviStreamingStopped();
+ state_ctrl_->OnVideoStreamingStopped(app);
break;
}
default:
break;
}
- EXPECT_CALL(application, RemoveHMIState(_)).Times(0);
+ EXPECT_CALL(app_mock, RemoveHMIState(_)).Times(0);
}
}
};
@@ -1199,10 +1297,13 @@ TEST_F(StateControllerImplTest, OnStateChangedToNone) {
HmiStatePtr none_state = createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN);
- HmiStatePtr not_none_state = createHmiState(HMILevel::HMI_FULL,
- AudioStreamingState::NOT_AUDIBLE,
- SystemContext::SYSCTXT_MAIN);
+ HmiStatePtr not_none_state =
+ createHmiState(HMILevel::HMI_FULL,
+ AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
+ SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
state_ctrl_->OnStateChanged(simple_app_, none_state, not_none_state);
@@ -1214,9 +1315,11 @@ TEST_F(StateControllerImplTest, OnStateChangedToNone) {
TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
@@ -1243,6 +1346,7 @@ TEST_F(StateControllerImplTest, MoveSimpleAppToValidStates) {
TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
@@ -1251,6 +1355,7 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
for (std::vector<HmiStatePtr>::iterator it =
@@ -1277,6 +1382,7 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) {
TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
+ namespace VideoStreamingState = mobile_apis::VideoStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr audio_app = media_navi_vc_app_;
@@ -1285,6 +1391,7 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM,
AudioStreamingState::INVALID_ENUM,
+ VideoStreamingState::INVALID_ENUM,
SystemContext::INVALID_ENUM);
// Set all valid states for audio app
@@ -1360,7 +1467,6 @@ TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) {
TEST_F(StateControllerImplTest,
SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
@@ -1389,7 +1495,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_navi_vc_app_;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock =
@@ -1415,7 +1520,6 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) {
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileAnotherTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_full = media_app_;
@@ -1442,7 +1546,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_full_mock;
am::ApplicationSharedPtr app_in_full =
@@ -1468,7 +1571,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetFullToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
@@ -1495,7 +1597,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileSameTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
NiceMock<application_manager_test::MockApplication>* app_in_limited_mock;
am::ApplicationSharedPtr app_in_limited =
@@ -1523,7 +1624,6 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInLimited) {
namespace HMILevel = mobile_apis::HMILevel;
- namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
am::ApplicationSharedPtr app_in_limited = navi_app_;
@@ -1542,11 +1642,12 @@ TEST_F(StateControllerImplTest,
LimitedState());
ExpectAppWontChangeHmiStateDueToConflictResolving(
app_in_limited, app_in_limited_mock, LimitedState());
+
state_ctrl_->SetRegularState(app_moved_to_limited, LimitedState(), false);
}
TEST_F(StateControllerImplTest,
- SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
+ DISABLED_SetLimitedToAudioAppAppWhileOtherTypeAudioAppAppIsInFull) {
namespace HMILevel = mobile_apis::HMILevel;
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
@@ -1765,8 +1866,10 @@ TEST_F(StateControllerImplTest,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- ExpectAppChangeHmiStateDueToConflictResolving(
- media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ .WillOnce(Return(LimitedState()));
+
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
@@ -1788,8 +1891,10 @@ TEST_F(StateControllerImplTest,
media_navi_vc_app_ptr_,
BackgroundState(),
FullAudibleState());
- ExpectAppChangeHmiStateDueToConflictResolving(
- media_app_, media_app_ptr_, LimitedState(), BackgroundState());
+
+ EXPECT_CALL(*media_app_ptr_, RegularHmiState())
+ .WillOnce(Return(LimitedState()));
+
ExpectAppChangeHmiStateDueToConflictResolving(
navi_app_, navi_app_ptr_, LimitedState(), BackgroundState());
ExpectAppChangeHmiStateDueToConflictResolving(
@@ -1817,23 +1922,26 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
hmi_states.push_back(
StateLevelPair(createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
+ VideoStreamingState::NOT_STREAMABLE,
SystemContext::SYSCTXT_MAIN),
Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params][am::strings::correlation_id] =
corr_id;
for (; it != hmi_states.end(); ++it) {
am::HmiStatePtr hmi_state = it->first;
- am::HmiStatePtr initial_hmi_state = it->first;
+ am::HmiStatePtr initial_hmi_state = it2->first;
Common_HMILevel::eType hmi_level = it->second;
SetBCActivateAppRequestToHMI(hmi_level, corr_id);
- ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request))
+ ON_CALL(app_manager_mock_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request))
.WillByDefault(Return(true));
EXPECT_CALL(app_manager_mock_, application_id(corr_id))
@@ -1940,49 +2048,55 @@ TEST_F(StateControllerImplTest, ActivateAppInvalidCorrelationId) {
state_ctrl_->on_event(event);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForSimpleApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForSimpleApp) {
InsertApplication(simple_app_);
- CheckStateApplyingForApplication(*simple_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ simple_app_, *simple_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForMediaApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForMediaApp) {
InsertApplication(media_app_);
- CheckStateApplyingForApplication(*media_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_app_, *media_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForNaviApp) {
InsertApplication(navi_app_);
- CheckStateApplyingForApplication(*navi_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(navi_app_, *navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForVCApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForVCApp) {
InsertApplication(vc_app_);
- CheckStateApplyingForApplication(*vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(vc_app_, *vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviApp) {
InsertApplication(media_navi_app_);
- CheckStateApplyingForApplication(*media_navi_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_navi_app_, *media_navi_app_ptr_, valid_state_ids_);
}
-TEST_F(StateControllerImplTest, ApplyTempStatesForMediaVCApp) {
+TEST_F(StateControllerImplTest, DISABLED_ApplyTempStatesForMediaVCApp) {
InsertApplication(media_vc_app_);
- CheckStateApplyingForApplication(*media_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_vc_app_, *media_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForNaviVCApp) {
InsertApplication(navi_vc_app_);
- CheckStateApplyingForApplication(*navi_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ navi_vc_app_, *navi_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) {
InsertApplication(media_navi_vc_app_);
- CheckStateApplyingForApplication(*media_navi_vc_app_ptr_, valid_state_ids_);
+ CheckStateApplyingForApplication(
+ media_navi_vc_app_, *media_navi_vc_app_ptr_, valid_state_ids_);
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- simple_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_phone_call =
+ std::make_shared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_phone_call,
APP_TYPE_NON_MEDIA,
@@ -1990,8 +2104,8 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- media_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_phone_call =
+ std::make_shared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_phone_call,
APP_TYPE_MEDIA,
@@ -1999,8 +2113,8 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- media_navi_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_phone_call = std::make_shared<am::PhoneCallHmiState>(
+ media_navi_app_, app_manager_mock_);
TestSetState(media_navi_app_,
state_phone_call,
APP_TYPE_NAVI,
@@ -2009,7 +2123,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(simple_app_id_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_vr,
APP_TYPE_NON_MEDIA,
@@ -2018,7 +2132,7 @@ TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2026,8 +2140,8 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
}
TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
- am::HmiStatePtr state_vr = utils::MakeShared<am::VRHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_vr =
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2037,7 +2151,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(simple_app_,
@@ -2049,7 +2163,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(simple_app_,
@@ -2061,7 +2175,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_app_,
@@ -2073,7 +2187,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_app_,
@@ -2084,8 +2198,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) {
- am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_tts =
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_navi_vc_app_,
@@ -2096,8 +2210,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) {
- am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_tts =
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_navi_vc_app_,
@@ -2108,7 +2222,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(simple_app_id_,
+ std::make_shared<am::VideoStreamingHmiState>(simple_app_,
app_manager_mock_);
TestSetState(simple_app_,
state_navi_streming,
@@ -2117,9 +2231,9 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
+ DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
@@ -2130,9 +2244,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
+ DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
@@ -2143,10 +2257,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
+ DISABLED_SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(vc_app_,
@@ -2156,10 +2269,9 @@ TEST_F(StateControllerImplTest,
}
TEST_F(StateControllerImplTest,
- SetNaviStreamingStateVCApplicationAttenuatedSupported) {
+ DISABLED_SetNaviStreamingStateVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(vc_app_,
@@ -2168,9 +2280,9 @@ TEST_F(StateControllerImplTest,
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
-TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
+TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(navi_app_id_,
+ std::make_shared<am::VideoStreamingHmiState>(navi_app_,
app_manager_mock_);
TestSetState(navi_app_,
state_navi_streming,
@@ -2178,9 +2290,10 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
&StateControllerImplTest::PrepareNaviStreamingHMIStateResults);
}
-TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
+TEST_F(StateControllerImplTest,
+ DISABLED_SetNaviStreamingStateMediaNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_navi_app_id_,
+ std::make_shared<am::VideoStreamingHmiState>(media_navi_app_,
app_manager_mock_);
TestSetState(media_navi_app_,
state_navi_streming,
@@ -2189,8 +2302,8 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
}
TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
- am::HmiStatePtr state_safety_mode = utils::MakeShared<am::SafetyModeHmiState>(
- simple_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_safety_mode =
+ std::make_shared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_safety_mode,
APP_TYPE_NON_MEDIA,
@@ -2199,7 +2312,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2208,8 +2321,8 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
TEST_F(StateControllerImplTest,
SetSafetyModeStateForMediaNaviVoiceApplication) {
- am::HmiStatePtr state_safety_mode = utils::MakeShared<am::VRHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_safety_mode =
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2242,7 +2355,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::PhoneCallHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PreparePhoneCallHMIStateResults);
}
@@ -2251,7 +2364,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::PhoneCallHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::PhoneCallHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PreparePhoneCallHMIStateResults);
}
@@ -2280,7 +2393,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedNotSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::VRHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2288,7 +2401,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithVRAttenuatedSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::VRHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::VRHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2302,7 +2415,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::TTSHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2310,7 +2423,7 @@ TEST_F(StateControllerImplTest, MixNaviStreamingWithTTSAttenueatedSupported) {
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::TTSHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::TTSHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareNaviStreamTTSStateResult);
}
@@ -2335,7 +2448,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
- TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::SafetyModeHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2344,7 +2457,7 @@ TEST_F(StateControllerImplTest,
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
- TestMixState<am::SafetyModeHmiState, am::NaviStreamingHmiState>(
+ TestMixState<am::SafetyModeHmiState, am::VideoStreamingHmiState>(
&StateControllerImplTest::PrepareVRTTSHMIStateResults);
}
@@ -2396,6 +2509,7 @@ TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
HmiStatePtr check_state = createHmiState(HMILevel::HMI_BACKGROUND,
AudioStreamingState::AUDIBLE,
+ VideoStreamingState::STREAMABLE,
SystemContext::SYSCTXT_MAIN);
EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
.WillRepeatedly(Return(BackgroundState()));
@@ -2406,7 +2520,9 @@ TEST_F(StateControllerImplTest, SetRegularStateWithAudioStateAudible) {
EXPECT_CALL(*simple_app_ptr_,
SetRegularState(Truly(HmiStatesComparator(check_state))));
- state_ctrl_->SetRegularState(simple_app_, AudioStreamingState::AUDIBLE);
+ state_ctrl_->SetRegularState(simple_app_,
+ AudioStreamingState::AUDIBLE,
+ VideoStreamingState::STREAMABLE);
}
TEST_F(StateControllerImplTest,
@@ -2714,6 +2830,82 @@ TEST_F(StateControllerImplTest,
state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
}
+TEST_F(StateControllerImplTest,
+ OnEventChangedAudioSource_KeepContext_AppRemainInFull) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+
+ EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(FullAudibleState()));
+ EXPECT_CALL(*simple_app_ptr_, set_keep_context(false));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
+TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(LimitedState()));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_BACKGROUND);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
smart_objects::SmartObject msg;
const uint32_t app_id = simple_app_->app_id();
@@ -2755,6 +2947,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
const HmiStatePtr state =
createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
// OnAppDeactivated
EXPECT_CALL(app_manager_mock_, application(app_id))
@@ -2783,6 +2976,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
const HmiStatePtr state =
createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN);
// OnAppDeactivated
EXPECT_CALL(app_manager_mock_, application(app_id))
@@ -2838,7 +3032,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
.WillRepeatedly(Return(true));
smart_objects::SmartObjectSPtr activate_app =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID;
SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
state_ctrl_->on_event(event);
@@ -2846,9 +3040,11 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
}
TEST_F(StateControllerImplTest, IsStateActive) {
- HmiStatePtr state = createHmiState(mobile_apis::HMILevel::HMI_FULL,
- mobile_apis::AudioStreamingState::AUDIBLE,
- mobile_apis::SystemContext::SYSCTXT_MAIN);
+ HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
state->set_state_id(HmiState::STATE_ID_CURRENT);
EXPECT_TRUE(state_ctrl_->IsStateActive(state->state_id()));
state->set_state_id(HmiState::STATE_ID_REGULAR);
@@ -2857,9 +3053,10 @@ TEST_F(StateControllerImplTest, IsStateActive) {
EXPECT_FALSE(state_ctrl_->IsStateActive(state->state_id()));
}
-TEST_F(StateControllerImplTest, IsStateActiveApplyCorrectTempStates) {
+TEST_F(StateControllerImplTest, DISABLED_IsStateActiveApplyCorrectTempStates) {
InsertApplication(simple_app_);
- ApplyTempStatesForApplication(*simple_app_ptr_, valid_state_ids_);
+ ApplyTempStatesForApplication(
+ simple_app_, *simple_app_ptr_, valid_state_ids_);
std::vector<am::HmiState::StateID>::const_iterator it =
valid_state_ids_.begin();
for (; it != valid_state_ids_.end(); ++it) {
@@ -2908,8 +3105,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
- app_id);
+ simple_app_);
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
@@ -2920,8 +3118,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
- app_id);
+ simple_app_);
EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(old_state));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
@@ -2957,8 +3156,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_FULL,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
- app_id);
+ simple_app_);
EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
@@ -2969,8 +3169,9 @@ TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
CreateHmiStateByHmiStateType<am::HmiState>(
mobile_apis::HMILevel::HMI_BACKGROUND,
mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
mobile_apis::SystemContext::SYSCTXT_MAIN,
- app_id);
+ simple_app_);
EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
.WillOnce(Return(default_state));
EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index 6efef83052..dfc694f3c5 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -36,16 +36,14 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/mock_app_stopwatch.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
namespace usage_statistics_test {
-using namespace mobile_apis; // For Language enums
-using namespace NsSmartDeviceLink::NsSmartObjects; // For EnumToCString &
- // EnumConversionHelper
+using namespace mobile_apis; // For Language enums
+using namespace ns_smart_device_link::ns_smart_objects; // For EnumToCString &
+ // EnumConversionHelper
using namespace usage_statistics;
using testing::_;
@@ -69,23 +67,22 @@ const std::string kAppId = "SPT";
class UsageStatisticsTest : public testing::Test {
public:
UsageStatisticsTest()
- : mock_statistics_manager_sptr_(
- utils::MakeShared<MockStatisticsManager>())
+ : mock_statistics_manager_sptr_(std::make_shared<MockStatisticsManager>())
, usage_statistics_test_object1_sptr_(
new application_manager::UsageStatistics(
kAppId, mock_statistics_manager_sptr_))
, language_(LanguageIdToString(kTestLanguageId)) {}
protected:
- utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_;
- std::auto_ptr<application_manager::UsageStatistics>
+ std::shared_ptr<MockStatisticsManager> mock_statistics_manager_sptr_;
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object1_sptr_;
const std::string language_;
};
TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
// Arrange
- std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(
+ std::unique_ptr<MockAppStopwatch> mock_app_stopwatch_object(
new MockAppStopwatch);
// Checks
@@ -93,7 +90,7 @@ TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
EXPECT_CALL(*mock_app_stopwatch_object, Switch(kTestAppStopwatchId));
// Act
- std::auto_ptr<application_manager::UsageStatistics>
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object2_sptr_(
new application_manager::UsageStatistics(
kAppId,
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
index cce0b2abf2..640a186e2b 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -51,7 +51,7 @@ using namespace ::profile;
using namespace application_manager::request_controller;
using namespace application_manager;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
commands::Command* RegisterApplication() {
SmartObjectSPtr resultsmart =
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 42b0d10ceb..57e925cd43 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -37,6 +37,7 @@
#include <string>
#include <vector>
#include <list>
+#include <map>
#include "utils/macro.h"
#include "protocol_handler/protocol_handler_settings.h"
#include "connection_handler/connection_handler_settings.h"
@@ -109,9 +110,25 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& app_resource_folder() const;
/**
- * @brief Returns true, if SDL 4.0 is enabled
- */
- bool enable_protocol_4() const OVERRIDE;
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGLOWVOLTAGE
+ * which is used for handling LOW Voltage functionality
+ */
+ int low_voltage_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGWAKEUP
+ * which is used for handling LOW Voltage functionality
+ */
+ int wake_up_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGIGNITIONOFF
+ * which is used for handling LOW Voltage functionality
+ */
+ int ignition_off_signal_offset() const;
/**
* @brief Returns application icons folder path
@@ -130,6 +147,26 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint32_t& app_icons_amount_to_remove() const OVERRIDE;
/**
+ * @brief Returns the maximum payload size for control services
+ */
+ size_t maximum_control_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for RPC services
+ */
+ size_t maximum_rpc_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for audio services
+ */
+ size_t maximum_audio_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for video services
+ */
+ size_t maximum_video_payload_size() const OVERRIDE;
+
+ /**
* @brief Returns the path to the config file
*/
const std::string& config_file_name() const;
@@ -155,9 +192,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint16_t video_streaming_port() const OVERRIDE;
/**
- * @brief Returns port for audio streaming
- */
- const uint16_t audio_streaming_port() const;
+ * @brief Returns port for audio streaming
+ */
+ const uint16_t audio_streaming_port() const OVERRIDE;
/**
* @brief Returns streaming timeout
@@ -191,6 +228,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& vr_commands() const;
/**
+ * @brief Returns folder containing all plugins
+ */
+ const std::string& plugins_folder() const OVERRIDE;
+
+ /**
* @brief Maximum command id available for mobile app
*/
const uint32_t& max_cmd_id() const;
@@ -209,7 +251,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/**
* @brief Returns desirable thread stack size
*/
- const uint64_t& thread_min_stack_size() const;
+ const uint64_t thread_min_stack_size() const;
/**
* @brief Returns true if audio mixing is supported
@@ -323,7 +365,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/*
* @brief Returns file name for storing applications data
*/
- const std::string& app_info_storage() const;
+ const std::string& app_info_storage() const OVERRIDE;
/*
* @brief Path to preloaded policy file
@@ -342,14 +384,35 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
bool enable_policy() const;
+ /**
+ * @brief Should core use fullAppID internally instead of appID (Default true)
+ * @return Flag
+ */
+ bool use_full_app_id() const;
+
// TransportManageSettings interface
+ /*
+ * @brief Returns true if last state singleton is used
+ */
bool use_last_state() const OVERRIDE;
+ /**
+ * @brief Timeout in transport manager before disconnect
+ */
uint32_t transport_manager_disconnect_timeout() const OVERRIDE;
+ /**
+ * @brief Returns port for TCP transport adapter
+ */
uint16_t transport_manager_tcp_adapter_port() const OVERRIDE;
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ const std::string& transport_manager_tcp_adapter_network_interface()
+ const OVERRIDE;
+
// TransportManageMMESettings interface
const std::string& event_mq_name() const OVERRIDE;
@@ -431,17 +494,39 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
size_t update_before_hours() const;
#endif // ENABLE_SECURITY
- /**
- * @brief Reads a string value from the profile
- *
- * @param value Result value
- * @param default_value Value to use key wasn't found
- * @param pSection The section to read the value in
- * @param pKey The key whose value needs to be read out
- *
- * @return FALSE if could not read the value out of the profile
- * (then the value is equal \c default_value)
- */
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ const bool multiple_transports_enabled() const OVERRIDE;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_usb() const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_wifi()
+ const OVERRIDE;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ const std::vector<std::string>& audio_service_transports() const OVERRIDE;
+ const std::vector<std::string>& video_service_transports() const OVERRIDE;
+
+ /**
+ * @brief Reads a string value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
bool ReadStringValue(std::string* value,
const char* default_value,
const char* const pSection,
@@ -485,13 +570,17 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
* @param out_result Pointer to bool value for result reading Section
* (could be NULL)
+ * @param allow_empty If true, then out_result will be true when the value
+ * contains an empty string.
+ * If false, then out_result will be false in such case.
*
* @return container of values or empty continer
* if could not read the value out of the profile
*/
std::vector<std::string> ReadStringContainer(const char* const pSection,
const char* const pKey,
- bool* out_result) const;
+ bool* out_result,
+ bool allow_empty = false) const;
/**
* @brief Reads an container of hex int values from the profile,
* which handle as "0x01, 0xA0, 0XFF"
@@ -583,6 +672,33 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t open_attempt_timeout_ms_resumption_db() const;
/**
+ * @brief Returns "transport required for resumption" map
+ *
+ * Keys of the map are AppHMIType strings, i.e. "DEFAULT", "COMMUNICATION",
+ * "MEDIA", and so on. The map may contain a special key "EMPTY_APP" for apps
+ * that does not specify any AppHMIType.
+ */
+ const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a NAVIGATION app
+ */
+ const std::string& navigation_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a PROJECTION app
+ */
+ const std::string& projection_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a media app
+ *
+ * Note: this is *not* for AppHMIType = MEDIA.
+ */
+ const std::string& media_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
* @brief Returns wait time after device connection
* before app launch request
*/
@@ -621,6 +737,18 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const bool enable_app_launch_ios() const OVERRIDE;
/**
+ * @brief Returns the millisecond count before timeout
+ * for transport change feature occures.
+ */
+ uint32_t app_transport_change_timer() const OVERRIDE;
+
+ /**
+ * @brief Returns the millisecond count used as addition
+ * value for transport change timer
+ */
+ uint32_t app_transport_change_timer_addition() const OVERRIDE;
+
+ /**
* @brief Updates all related values from ini file
*/
void UpdateValues();
@@ -640,6 +768,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const OVERRIDE;
+ const std::pair<uint32_t, int32_t>& get_interior_vehicle_data_frequency()
+ const OVERRIDE;
const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const OVERRIDE;
@@ -667,13 +797,29 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
*
* @return FALSE if could not read the value out of the profile
- * (then the value is not changed)
+ * (then the value is not changed) or the value was empty
*/
bool ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const;
/**
+ * @brief Reads a string value from the profile
+ *
+ * This is same as ReadValue(), except that this method will accept an empty
+ * string.
+ *
+ * @param value The value to return
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return TRUE if the value is read, FALSE if the value is not found
+ */
+ bool ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
* @brief Reads a boolean value from the profile
*
* @param value The value to return
@@ -759,10 +905,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string app_config_folder_;
std::string app_storage_folder_;
std::string app_resource_folder_;
- bool enable_protocol_4_;
std::string app_icons_folder_;
uint32_t app_icons_folder_max_size_;
uint32_t app_icons_amount_to_remove_;
+ size_t maximum_control_payload_size_;
+ size_t maximum_rpc_payload_size_;
+ size_t maximum_audio_payload_size_;
+ size_t maximum_video_payload_size_;
std::string config_file_name_;
std::string server_address_;
uint16_t server_port_;
@@ -804,11 +953,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string preloaded_pt_file_;
std::string policy_snapshot_file_name_;
bool enable_policy_;
+ bool use_full_app_id_;
uint32_t transport_manager_disconnect_timeout_;
bool use_last_state_;
std::vector<uint32_t> supported_diag_modes_;
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
+ std::string transport_manager_tcp_adapter_network_interface_;
std::string tts_delimiter_;
uint32_t audio_data_stopped_timeout_;
uint32_t video_data_stopped_timeout_;
@@ -845,6 +996,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
std::pair<uint32_t, int32_t> get_vehicle_data_frequency_;
+ /*
+ * first value is count of request
+ * second is time scale
+ */
+ std::pair<uint32_t, int32_t> get_interior_vehicle_data_frequency_;
+
/**
* first value is count of retries for start stream
* second for timer
@@ -856,6 +1013,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string iap_pool_protocol_mask_;
std::string iap_system_config_;
std::string iap2_system_config_;
+ std::string plugins_folder_;
int iap2_hub_connect_attempts_;
int iap_hub_connection_wait_timeout_;
uint16_t tts_global_properties_timeout_;
@@ -868,6 +1026,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool use_db_for_resumption_;
uint16_t attempts_to_open_resumption_db_;
uint16_t open_attempt_timeout_ms_resumption_db_;
+ std::map<std::string, std::vector<std::string> >
+ transport_required_for_resumption_map_;
+ std::string navigation_lowbandwidth_resumption_level_;
+ std::string projection_lowbandwidth_resumption_level_;
+ std::string media_lowbandwidth_resumption_level_;
uint16_t app_launch_wait_time_;
uint16_t app_launch_max_retry_attempt_;
uint16_t app_launch_retry_wait_time_;
@@ -875,8 +1038,19 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t max_number_of_ios_device_;
uint16_t wait_time_between_apps_;
bool enable_app_launch_ios_;
+ uint32_t app_tranport_change_timer_;
+ uint32_t app_tranport_change_timer_addition_;
+ bool multiple_transports_enabled_;
+ std::vector<std::string> secondary_transports_for_bluetooth_;
+ std::vector<std::string> secondary_transports_for_usb_;
+ std::vector<std::string> secondary_transports_for_wifi_;
+ std::vector<std::string> audio_service_transports_;
+ std::vector<std::string> video_service_transports_;
bool error_occured_;
std::string error_description_;
+ int low_voltage_signal_offset_;
+ int wake_up_signal_offset_;
+ int ignition_off_signal_offset_;
DISALLOW_COPY_AND_ASSIGN(Profile);
};
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
index 1c30c8b201..3245b096cb 100644
--- a/src/components/config_profile/src/ini_file.cc
+++ b/src/components/config_profile/src/ini_file.cc
@@ -39,6 +39,8 @@
#include <limits.h>
#include <stdint.h>
+#include "utils/logger.h"
+
#ifndef _WIN32
#include <unistd.h>
#else
@@ -53,6 +55,8 @@
namespace profile {
+CREATE_LOGGERPTR_GLOBAL(logger_, "Profile")
+
char* ini_write_inst(const char* fname, uint8_t flag) {
FILE* fp = 0;
@@ -272,9 +276,11 @@ char ini_write_value(const char* fname,
fclose(wr_fp);
fclose(rd_fp);
- remove(fname);
if (0 != rename(temp_fname, fname)) {
- remove(temp_fname);
+ if (0 != remove(temp_fname)) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Unable to remove temp file: " << std::string(temp_fname));
+ }
return FALSE;
}
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 0871a769ba..57984324aa 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -33,6 +33,7 @@
#include "config_profile/profile.h"
#include <errno.h>
+#include <numeric>
#include <string.h>
#include <stdlib.h>
#include <sstream>
@@ -85,8 +86,15 @@ const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS";
const char* kIAPSection = "IAP";
const char* kProtocolHandlerSection = "ProtocolHandler";
const char* kSDL4Section = "SDL4";
+const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
+const char* kMultipleTransportsSection = "MultipleTransports";
+const char* kServicesMapSection = "ServicesMap";
+const char* kTransportRequiredForResumptionSection =
+ "TransportRequiredForResumption";
+const char* kLowBandwidthTransportResumptionLevelSection =
+ "LowBandwidthTransportResumptionLevel";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -100,10 +108,13 @@ const char* kAppStorageFolderKey = "AppStorageFolder";
const char* kAppResourseFolderKey = "AppResourceFolder";
const char* kLogsEnabledKey = "LogsEnabled";
const char* kAppConfigFolderKey = "AppConfigFolder";
-const char* kEnableProtocol4Key = "EnableProtocol4";
const char* kAppIconsFolderKey = "AppIconsFolder";
const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize";
const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove";
+const char* kMaximumControlPayloadSizeKey = "MaximumControlPayloadSize";
+const char* kMaximumRpcPayloadSizeKey = "MaximumRpcPayloadSize";
+const char* kMaximumAudioPayloadSizeKey = "MaximumAudioPayloadSize";
+const char* kMaximumVideoPayloadSizeKey = "MaximumVideoPayloadSize";
const char* kLaunchHMIKey = "LaunchHMI";
const char* kDefaultSDLVersion = "";
#ifdef WEB_HMI
@@ -137,10 +148,12 @@ const char* kTimeoutPromptKey = "TimeOutPromt";
const char* kHelpTitleKey = "HelpTitle";
const char* kHelpCommandKey = "HelpCommand";
const char* kSystemFilesPathKey = "SystemFilesPath";
+const char* kPluginsFolderKey = "PluginFolder";
const char* kHeartBeatTimeoutKey = "HeartBeatTimeout";
const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion";
const char* kUseLastStateKey = "UseLastState";
const char* kTCPAdapterPortKey = "TCPAdapterPort";
+const char* kTCPAdapterNetworkInterfaceKey = "TCPAdapterNetworkInterface";
const char* kServerPortKey = "ServerPort";
const char* kVideoStreamingPortKey = "VideoStreamingPort";
const char* kAudioStreamingPortKey = "AudioStreamingPort";
@@ -171,11 +184,14 @@ const char* kTTSDelimiterKey = "TTSDelimiter";
const char* kRecordingFileNameKey = "RecordingFileName";
const char* kRecordingFileSourceKey = "RecordingFileSource";
const char* kEnablePolicy = "EnablePolicy";
+const char* kUseFullAppID = "UseFullAppID";
const char* kEventMQKey = "EventMQ";
const char* kAckMQKey = "AckMQ";
const char* kApplicationListUpdateTimeoutKey = "ApplicationListUpdateTimeout";
const char* kReadDIDFrequencykey = "ReadDIDRequest";
const char* kGetVehicleDataFrequencyKey = "GetVehicleDataRequest";
+const char* kGetInteriorVehicleDataFrequencyKey =
+ "GetInteriorVehicleDataRequest";
const char* kLegacyProtocolMaskKey = "LegacyProtocol";
const char* kHubProtocolMaskKey = "HubProtocol";
const char* kPoolProtocolMaskKey = "PoolProtocol";
@@ -206,6 +222,66 @@ const char* kRemoveBundleIDattemptsKey = "RemoveBundleIDattempts";
const char* kMaxNumberOfiOSDeviceKey = "MaxNumberOfiOSDevice";
const char* kWaitTimeBetweenAppsKey = "WaitTimeBetweenApps";
const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
+const char* kAppTransportChangeTimerKey = "AppTransportChangeTimer";
+const char* kAppTransportChangeTimerAdditionKey =
+ "AppTransportChangeTimerAddition";
+const char* kLowVoltageSignalOffsetKey = "LowVoltageSignal";
+const char* kWakeUpSignalOffsetKey = "WakeUpSignal";
+const char* kIgnitionOffSignalOffsetKey = "IgnitionOffSignal";
+const char* kMultipleTransportsEnabledKey = "MultipleTransportsEnabled";
+const char* kSecondaryTransportForBluetoothKey =
+ "SecondaryTransportForBluetooth";
+const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB";
+const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi";
+const char* kAudioServiceTransportsKey = "AudioServiceTransports";
+const char* kVideoServiceTransportsKey = "VideoServiceTransports";
+
+const char* kDefaultTransportRequiredForResumptionKey =
+ "DefaultTransportRequiredForResumption";
+const char* kAppHMITypeDefault = "DEFAULT";
+const char* kCommunicationTransportRequiredForResumptionKey =
+ "CommunicationTransportRequiredForResumption";
+const char* kAppHMITypeCommunication = "COMMUNICATION";
+const char* kMediaTransportRequiredForResumptionKey =
+ "MediaTransportRequiredForResumption";
+const char* kAppHMITypeMedia = "MEDIA";
+const char* kMessagingTransportRequiredForResumptionKey =
+ "MessagingTransportRequiredForResumption";
+const char* kAppHMITypeMessaging = "MESSAGING";
+const char* kNavigationTransportRequiredForResumptionKey =
+ "NavigationTransportRequiredForResumption";
+const char* kAppHMITypeNavigation = "NAVIGATION";
+const char* kInformationTransportRequiredForResumptionKey =
+ "InformationTransportRequiredForResumption";
+const char* kAppHMITypeInformation = "INFORMATION";
+const char* kSocialTransportRequiredForResumptionKey =
+ "SocialTransportRequiredForResumption";
+const char* kAppHMITypeSocial = "SOCIAL";
+const char* kBackgroundProcessTransportRequiredForResumptionKey =
+ "BackgroundProcessTransportRequiredForResumption";
+const char* kAppHMITypeBackgroundProcess = "BACKGROUND_PROCESS";
+const char* kTestingTransportRequiredForResumptionKey =
+ "TestingTransportRequiredForResumption";
+const char* kAppHMITypeTesting = "TESTING";
+const char* kSystemTransportRequiredForResumptionKey =
+ "SystemTransportRequiredForResumption";
+const char* kAppHMITypeSystem = "SYSTEM";
+const char* kProjectionTransportRequiredForResumptionKey =
+ "ProjectionTransportRequiredForResumption";
+const char* kAppHMITypeProjection = "PROJECTION";
+const char* kRemoteControlTransportRequiredForResumptionKey =
+ "RemoteControlTransportRequiredForResumption";
+const char* kAppHMITypeRemoteControl = "REMOTE_CONTROL";
+const char* kEmptyAppTransportRequiredForResumptionKey =
+ "EmptyAppTransportRequiredForResumption";
+const char* kAppHMITypeEmptyApp = "EMPTY_APP";
+const char* kNavigationLowBandwidthResumptionLevelKey =
+ "NavigationLowBandwidthResumptionLevel";
+const char* kProjectionLowBandwidthResumptionLevelKey =
+ "ProjectionLowBandwidthResumptionLevel";
+const char* kMediaLowBandwidthResumptionLevelKey =
+ "MediaLowBandwidthResumptionLevel";
+
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -215,6 +291,7 @@ const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json";
const char* kDefaultServerAddress = "127.0.0.1";
const char* kDefaultAppInfoFileName = "app_info.dat";
const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache";
+const char* kDefaultPluginsPath = "plugins";
const char* kDefaultTtsDelimiter = ",";
const uint32_t kDefaultAudioDataStoppedTimeout = 1000;
const uint32_t kDefaultVideoDataStoppedTimeout = 1000;
@@ -228,6 +305,7 @@ const char* kDefaultHubProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultPoolProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultIAPSystemConfig = "/fs/mp/etc/mm/ipod.cfg";
const char* kDefaultIAP2SystemConfig = "/fs/mp/etc/mm/iap2.cfg";
+const char* kDefaultTransportManagerTCPAdapterNetworkInterface = "";
#ifdef ENABLE_SECURITY
const char* kDefaultSecurityProtocol = "TLSv1.2";
@@ -238,7 +316,7 @@ const uint32_t kDefaultBeforeUpdateHours = 24;
const uint32_t kDefaultHubProtocolIndex = 0;
const uint32_t kDefaultHeartBeatTimeout = 0;
-const uint16_t kDefaultMaxSupportedProtocolVersion = 3;
+const uint16_t kDefaultMaxSupportedProtocolVersion = 5;
const uint16_t kDefautTransportManagerTCPPort = 12345;
const uint16_t kDefaultServerPort = 8087;
const uint16_t kDefaultVideoStreamingPort = 5050;
@@ -267,6 +345,7 @@ const uint32_t kDefaultTransportManagerDisconnectTimeout = 0;
const uint32_t kDefaultApplicationListUpdateTimeout = 1;
const std::pair<uint32_t, uint32_t> kReadDIDFrequency = {5, 1};
const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = {5, 1};
+const std::pair<uint32_t, uint32_t> kGetInteriorVehicleDataFrequency = {20, 1};
const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = {3, 1};
const uint32_t kDefaultMaxThreadPoolSize = 2;
const int kDefaultIAP2HubConnectAttempts = 0;
@@ -286,6 +365,10 @@ const uint16_t kDefaultOpenAttemptTimeoutMs = 500;
const uint32_t kDefaultAppIconsFolderMaxSize = 104857600;
const uint32_t kDefaultAppIconsAmountToRemove = 1;
const uint16_t kDefaultAttemptsToOpenResumptionDB = 5;
+const size_t kDefaultMaximumControlPayloadSize = 0;
+const size_t kDefaultMaximumRpcPayloadSize = 0;
+const size_t kDefaultMaximumAudioPayloadSize = 0;
+const size_t kDefaultMaximumVideoPayloadSize = 0;
const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500;
const uint16_t kDefaultAppLaunchWaitTime = 5000;
const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3;
@@ -294,8 +377,15 @@ const uint16_t kDefaultRemoveBundleIDattempts = 3;
const uint16_t kDefaultMaxNumberOfiOSDevice = 10;
const uint16_t kDefaultWaitTimeBetweenApps = 4000;
const bool kDefaultEnableAppLaunchIOS = true;
+const uint32_t kDefaultAppTransportChangeTimer = 500u;
+const uint32_t kDefaultAppTransportChangeTimerAddition = 0u;
+const int32_t kDefaultLowVoltageSignalOffset = 1;
+const int32_t kDefaultWakeUpSignalOffset = 2;
+const int32_t kDefaultIgnitionOffSignalOffset = 3;
const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
+const bool kDefaultMultipleTransportsEnabled = false;
+const char* kDefaultLowBandwidthResumptionLevel = "NONE";
} // namespace
namespace profile {
@@ -313,15 +403,19 @@ Profile::Profile()
app_config_folder_()
, app_storage_folder_()
, app_resource_folder_()
- , enable_protocol_4_(false)
, app_icons_folder_()
, app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize)
, app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove)
+ , maximum_control_payload_size_(kDefaultMaximumControlPayloadSize)
+ , maximum_rpc_payload_size_(kDefaultMaximumRpcPayloadSize)
+ , maximum_audio_payload_size_(kDefaultMaximumAudioPayloadSize)
+ , maximum_video_payload_size_(kDefaultMaximumVideoPayloadSize)
, config_file_name_(kDefaultConfigFileName)
, server_address_(kDefaultServerAddress)
, server_port_(kDefaultServerPort)
, video_streaming_port_(kDefaultVideoStreamingPort)
, audio_streaming_port_(kDefaultAudioStreamingPort)
+ , stop_streaming_timeout_(kDefaultStopStreamingTimeout)
, time_testing_port_(kDefaultTimeTestingPort)
, hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName)
, help_prompt_()
@@ -332,6 +426,8 @@ Profile::Profile()
, max_cmd_id_(kDefaultMaxCmdId)
, default_timeout_(kDefaultTimeout)
, app_resuming_timeout_(kDefaultAppResumingTimeout)
+ , app_resumption_save_persistent_data_timeout_(
+ kDefaultAppSavePersistentDataTimeout)
, app_dir_quota_(kDefaultDirQuota)
, app_hmi_level_none_time_scale_max_requests_(
kDefaultAppHmiLevelNoneTimeScaleMaxRequests)
@@ -349,6 +445,7 @@ Profile::Profile()
, max_supported_protocol_version_(kDefaultMaxSupportedProtocolVersion)
, policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName)
, enable_policy_(false)
+ , use_full_app_id_(true)
, transport_manager_disconnect_timeout_(
kDefaultTransportManagerDisconnectTimeout)
, use_last_state_(false)
@@ -363,6 +460,8 @@ Profile::Profile()
, recording_file_source_(kDefaultRecordingFileSourceName)
, recording_file_name_(kDefaultRecordingFileName)
, application_list_update_timeout_(kDefaultApplicationListUpdateTimeout)
+ , max_thread_pool_size_(kDefaultMaxThreadPoolSize)
+ , default_hub_protocol_index_(kDefaultHubProtocolIndex)
, iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask)
, iap_hub_protocol_mask_(kDefaultHubProtocolMask)
, iap_pool_protocol_mask_(kDefaultPoolProtocolMask)
@@ -373,11 +472,18 @@ Profile::Profile()
, tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout)
, attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB)
, open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB)
+ , resumption_delay_before_ign_(kDefaultResumptionDelayBeforeIgn)
+ , resumption_delay_after_ign_(kDefaultResumptionDelayAfterIgn)
, hash_string_size_(kDefaultHashStringSize)
, use_db_for_resumption_(false)
, attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB)
, open_attempt_timeout_ms_resumption_db_(
kDefaultOpenAttemptTimeoutMsResumptionDB)
+ , navigation_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , projection_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , media_lowbandwidth_resumption_level_(kDefaultLowBandwidthResumptionLevel)
, app_launch_wait_time_(kDefaultAppLaunchWaitTime)
, app_launch_max_retry_attempt_(kDefaultAppLaunchMaxRetryAttempt)
, app_launch_retry_wait_time_(kDefaultAppLaunchRetryWaitTime)
@@ -385,8 +491,15 @@ Profile::Profile()
, max_number_of_ios_device_(kDefaultMaxNumberOfiOSDevice)
, wait_time_between_apps_(kDefaultWaitTimeBetweenApps)
, enable_app_launch_ios_(kDefaultEnableAppLaunchIOS)
+ , app_tranport_change_timer_(kDefaultAppTransportChangeTimer)
+ , app_tranport_change_timer_addition_(
+ kDefaultAppTransportChangeTimerAddition)
+ , multiple_transports_enabled_(kDefaultMultipleTransportsEnabled)
, error_occured_(false)
- , error_description_() {
+ , error_description_()
+ , low_voltage_signal_offset_(kDefaultLowVoltageSignalOffset)
+ , wake_up_signal_offset_(kDefaultWakeUpSignalOffset)
+ , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) {
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -431,8 +544,16 @@ const std::string& Profile::app_resource_folder() const {
return app_resource_folder_;
}
-bool Profile::enable_protocol_4() const {
- return enable_protocol_4_;
+int Profile::low_voltage_signal_offset() const {
+ return low_voltage_signal_offset_;
+}
+
+int Profile::wake_up_signal_offset() const {
+ return wake_up_signal_offset_;
+}
+
+int Profile::ignition_off_signal_offset() const {
+ return ignition_off_signal_offset_;
}
const std::string& Profile::app_icons_folder() const {
@@ -447,6 +568,22 @@ const uint32_t& Profile::app_icons_amount_to_remove() const {
return app_icons_amount_to_remove_;
}
+size_t Profile::maximum_control_payload_size() const {
+ return maximum_control_payload_size_;
+}
+
+size_t Profile::maximum_rpc_payload_size() const {
+ return maximum_rpc_payload_size_;
+}
+
+size_t Profile::maximum_audio_payload_size() const {
+ return maximum_audio_payload_size_;
+}
+
+size_t Profile::maximum_video_payload_size() const {
+ return maximum_video_payload_size_;
+}
+
const std::string& Profile::hmi_capabilities_file_name() const {
return hmi_capabilities_file_name_;
}
@@ -507,7 +644,7 @@ const uint16_t& Profile::time_testing_port() const {
return time_testing_port_;
}
-const uint64_t& Profile::thread_min_stack_size() const {
+const uint64_t Profile::thread_min_stack_size() const {
return min_tread_stack_size_;
}
@@ -615,6 +752,10 @@ bool Profile::enable_policy() const {
return enable_policy_;
}
+bool Profile::use_full_app_id() const {
+ return use_full_app_id_;
+}
+
uint32_t Profile::transport_manager_disconnect_timeout() const {
return transport_manager_disconnect_timeout_;
}
@@ -627,6 +768,9 @@ const std::string& Profile::system_files_path() const {
return system_files_path_;
}
+const std::string& Profile::plugins_folder() const {
+ return plugins_folder_;
+}
const std::vector<uint32_t>& Profile::supported_diag_modes() const {
return supported_diag_modes_;
}
@@ -635,6 +779,11 @@ uint16_t Profile::transport_manager_tcp_adapter_port() const {
return transport_manager_tcp_adapter_port_;
}
+const std::string& Profile::transport_manager_tcp_adapter_network_interface()
+ const {
+ return transport_manager_tcp_adapter_network_interface_;
+}
+
const std::string& Profile::tts_delimiter() const {
return tts_delimiter_;
}
@@ -667,6 +816,11 @@ const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency()
return get_vehicle_data_frequency_;
}
+const std::pair<uint32_t, int32_t>&
+Profile::get_interior_vehicle_data_frequency() const {
+ return get_interior_vehicle_data_frequency_;
+}
+
const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
return start_stream_retry_amount_;
}
@@ -852,6 +1006,23 @@ uint16_t Profile::open_attempt_timeout_ms_resumption_db() const {
return open_attempt_timeout_ms_resumption_db_;
}
+const std::map<std::string, std::vector<std::string> >&
+Profile::transport_required_for_resumption_map() const {
+ return transport_required_for_resumption_map_;
+}
+
+const std::string& Profile::navigation_lowbandwidth_resumption_level() const {
+ return navigation_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::projection_lowbandwidth_resumption_level() const {
+ return projection_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::media_lowbandwidth_resumption_level() const {
+ return media_lowbandwidth_resumption_level_;
+}
+
const uint16_t Profile::app_launch_max_retry_attempt() const {
return app_launch_max_retry_attempt_;
}
@@ -868,6 +1039,14 @@ const bool Profile::enable_app_launch_ios() const {
return enable_app_launch_ios_;
}
+uint32_t Profile::app_transport_change_timer() const {
+ return app_tranport_change_timer_;
+}
+
+uint32_t Profile::app_transport_change_timer_addition() const {
+ return app_tranport_change_timer_addition_;
+}
+
const uint16_t Profile::max_number_of_ios_device() const {
return max_number_of_ios_device_;
}
@@ -880,6 +1059,31 @@ const uint16_t Profile::wait_time_between_apps() const {
return wait_time_between_apps_;
}
+const bool Profile::multiple_transports_enabled() const {
+ return multiple_transports_enabled_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_bluetooth()
+ const {
+ return secondary_transports_for_bluetooth_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_usb() const {
+ return secondary_transports_for_usb_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_wifi() const {
+ return secondary_transports_for_wifi_;
+}
+
+const std::vector<std::string>& Profile::audio_service_transports() const {
+ return audio_service_transports_;
+}
+
+const std::vector<std::string>& Profile::video_service_transports() const {
+ return video_service_transports_;
+}
+
const bool Profile::ErrorOccured() const {
return error_occured_;
}
@@ -1001,17 +1205,6 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(app_resource_folder_, kAppResourseFolderKey, kMainSection);
- // Enable protocol ver.4 parameter
- std::string enable_protocol_4_value;
- if (ReadValue(&enable_protocol_4_value, kSDL4Section, kEnableProtocol4Key) &&
- 0 == strcmp("true", enable_protocol_4_value.c_str())) {
- enable_protocol_4_ = true;
- } else {
- enable_protocol_4_ = false;
- }
-
- LOG_UPDATED_BOOL_VALUE(enable_protocol_4_, kEnableProtocol4Key, kSDL4Section);
-
// Application icon folder
ReadStringValue(&app_icons_folder_,
file_system::CurrentWorkingDirectory().c_str(),
@@ -1046,6 +1239,39 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(
app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section);
+ ReadUIntValue(&maximum_control_payload_size_,
+ kDefaultMaximumControlPayloadSize,
+ kSDL5Section,
+ kMaximumControlPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(maximum_control_payload_size_,
+ kMaximumControlPayloadSizeKey,
+ kSDL5Section);
+
+ ReadUIntValue(&maximum_rpc_payload_size_,
+ kDefaultMaximumRpcPayloadSize,
+ kSDL5Section,
+ kMaximumRpcPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_rpc_payload_size_, kMaximumRpcPayloadSizeKey, kSDL5Section);
+
+ ReadUIntValue(&maximum_audio_payload_size_,
+ kDefaultMaximumAudioPayloadSize,
+ kSDL5Section,
+ kMaximumAudioPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_audio_payload_size_, kMaximumAudioPayloadSizeKey, kSDL5Section);
+
+ ReadUIntValue(&maximum_video_payload_size_,
+ kDefaultMaximumVideoPayloadSize,
+ kSDL5Section,
+ kMaximumVideoPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_video_payload_size_, kMaximumVideoPayloadSizeKey, kSDL5Section);
+
// Application info file name
ReadStringValue(&app_info_storage_,
kDefaultAppInfoFileName,
@@ -1500,6 +1726,10 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(system_files_path_, kSystemFilesPathKey, kMainSection);
+ // Plugins folder
+ ReadStringValue(
+ &plugins_folder_, kDefaultPluginsPath, kMainSection, kPluginsFolderKey);
+ LOG_UPDATED_VALUE(plugins_folder_, kPluginsFolderKey, kMainSection);
// Heartbeat timeout
ReadUIntValue(&heart_beat_timeout_,
kDefaultHeartBeatTimeout,
@@ -1529,6 +1759,16 @@ void Profile::UpdateValues() {
kTCPAdapterPortKey,
kTransportManagerSection);
+ // Transport manager TCP network interface
+ ReadStringValue(&transport_manager_tcp_adapter_network_interface_,
+ kDefaultTransportManagerTCPAdapterNetworkInterface,
+ kTransportManagerSection,
+ kTCPAdapterNetworkInterfaceKey);
+
+ LOG_UPDATED_VALUE(transport_manager_tcp_adapter_network_interface_,
+ kTCPAdapterNetworkInterfaceKey,
+ kTransportManagerSection);
+
// Event MQ
ReadStringValue(
&event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey);
@@ -1620,16 +1860,26 @@ void Profile::UpdateValues() {
enable_policy_ = false;
}
+ // Use full app ID internally?
+ std::string use_full_id_string;
+ if (ReadValue(&use_full_id_string, kPolicySection, kUseFullAppID) &&
+ 0 == strcmp("true", use_full_id_string.c_str())) {
+ use_full_app_id_ = true;
+ } else {
+ use_full_app_id_ = false;
+ }
+
// Max protocol version
ReadUIntValue(&max_supported_protocol_version_,
kDefaultMaxSupportedProtocolVersion,
kProtocolHandlerSection,
kMaxSupportedProtocolVersionKey);
- // if .ini file contains protocol version less than 2 or more than 3
- // max_supported_protocol_version_ = 3
- if (max_supported_protocol_version_ < 2) {
- max_supported_protocol_version_ = 3;
+ if (max_supported_protocol_version_ < 1) {
+ max_supported_protocol_version_ = 1;
+ } else if (max_supported_protocol_version_ >
+ kDefaultMaxSupportedProtocolVersion) {
+ max_supported_protocol_version_ = kDefaultMaxSupportedProtocolVersion;
}
LOG_UPDATED_BOOL_VALUE(enable_policy_, kEnablePolicy, kPolicySection);
@@ -1653,6 +1903,11 @@ void Profile::UpdateValues() {
kMainSection,
kGetVehicleDataFrequencyKey);
+ ReadUintIntPairValue(&get_interior_vehicle_data_frequency_,
+ kGetInteriorVehicleDataFrequency,
+ kMainSection,
+ kGetInteriorVehicleDataFrequencyKey);
+
ReadUIntValue(&max_thread_pool_size_,
kDefaultMaxThreadPoolSize,
kApplicationManagerSection,
@@ -1759,6 +2014,84 @@ void Profile::UpdateValues() {
kOpenAttemptTimeoutMsResumptionDBKey,
kResumptionSection);
+ { // read parameters from TransportRequiredForResumption section
+ struct KeyPair {
+ const char* ini_key_name;
+ const char* map_key_name;
+ } keys[] = {
+ {kDefaultTransportRequiredForResumptionKey, kAppHMITypeDefault},
+ {kCommunicationTransportRequiredForResumptionKey,
+ kAppHMITypeCommunication},
+ {kMediaTransportRequiredForResumptionKey, kAppHMITypeMedia},
+ {kMessagingTransportRequiredForResumptionKey, kAppHMITypeMessaging},
+ {kNavigationTransportRequiredForResumptionKey, kAppHMITypeNavigation},
+ {kInformationTransportRequiredForResumptionKey, kAppHMITypeInformation},
+ {kSocialTransportRequiredForResumptionKey, kAppHMITypeSocial},
+ {kBackgroundProcessTransportRequiredForResumptionKey,
+ kAppHMITypeBackgroundProcess},
+ {kTestingTransportRequiredForResumptionKey, kAppHMITypeTesting},
+ {kSystemTransportRequiredForResumptionKey, kAppHMITypeSystem},
+ {kProjectionTransportRequiredForResumptionKey, kAppHMITypeProjection},
+ {kRemoteControlTransportRequiredForResumptionKey,
+ kAppHMITypeRemoteControl},
+ {kEmptyAppTransportRequiredForResumptionKey, kAppHMITypeEmptyApp},
+ {NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_key_name != NULL) {
+ bool exist = false;
+ std::vector<std::string> transport_list =
+ ReadStringContainer(kTransportRequiredForResumptionSection,
+ entry->ini_key_name,
+ &exist,
+ true);
+ if (exist) {
+ transport_required_for_resumption_map_[entry->map_key_name] =
+ transport_list;
+
+ const std::string list_with_comma = std::accumulate(
+ transport_list.begin(),
+ transport_list.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(list_with_comma,
+ entry->ini_key_name,
+ kTransportRequiredForResumptionSection);
+ }
+ entry++;
+ }
+ }
+
+ // Read parameters from LowBandwidthTransportResumptionLevel section
+ ReadStringValue(&navigation_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kNavigationLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(navigation_lowbandwidth_resumption_level_,
+ kNavigationLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&projection_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kProjectionLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(projection_lowbandwidth_resumption_level_,
+ kProjectionLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&media_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kMediaLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(media_lowbandwidth_resumption_level_,
+ kMediaLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
// Read parameters from App Launch section
ReadUIntValue(&app_launch_wait_time_,
kDefaultAppLaunchWaitTime,
@@ -1818,6 +2151,100 @@ void Profile::UpdateValues() {
LOG_UPDATED_BOOL_VALUE(
enable_app_launch_ios_, kEnableAppLaunchIOSKey, kAppLaunchSection);
+
+ ReadUIntValue(&app_tranport_change_timer_,
+ kDefaultAppTransportChangeTimer,
+ kMainSection,
+ kAppTransportChangeTimerKey);
+
+ LOG_UPDATED_VALUE(
+ app_tranport_change_timer_, kAppTransportChangeTimerKey, kMainSection);
+
+ ReadUIntValue(&app_tranport_change_timer_addition_,
+ kDefaultAppTransportChangeTimerAddition,
+ kMainSection,
+ kAppTransportChangeTimerAdditionKey);
+
+ LOG_UPDATED_VALUE(app_tranport_change_timer_addition_,
+ kAppTransportChangeTimerAdditionKey,
+ kMainSection);
+
+ ReadIntValue(&low_voltage_signal_offset_,
+ kDefaultLowVoltageSignalOffset,
+ kMainSection,
+ kLowVoltageSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ low_voltage_signal_offset_, kLowVoltageSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&wake_up_signal_offset_,
+ kDefaultWakeUpSignalOffset,
+ kMainSection,
+ kWakeUpSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ wake_up_signal_offset_, kWakeUpSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&ignition_off_signal_offset_,
+ kDefaultIgnitionOffSignalOffset,
+ kMainSection,
+ kIgnitionOffSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ ignition_off_signal_offset_, kIgnitionOffSignalOffsetKey, kMainSection);
+
+ ReadBoolValue(&multiple_transports_enabled_,
+ kDefaultMultipleTransportsEnabled,
+ kMultipleTransportsSection,
+ kMultipleTransportsEnabledKey);
+
+ LOG_UPDATED_BOOL_VALUE(multiple_transports_enabled_,
+ kMultipleTransportsEnabledKey,
+ kMultipleTransportsSection);
+
+ { // Secondary Transports and ServicesMap
+ struct KeyPair {
+ std::vector<std::string>* ini_vector;
+ const char* ini_section_name;
+ const char* ini_key_name;
+ } keys[] = {{&secondary_transports_for_bluetooth_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForBluetoothKey},
+ {&secondary_transports_for_usb_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForUSBKey},
+ {&secondary_transports_for_wifi_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForWiFiKey},
+ {&audio_service_transports_,
+ kServicesMapSection,
+ kAudioServiceTransportsKey},
+ {&video_service_transports_,
+ kServicesMapSection,
+ kVideoServiceTransportsKey},
+ {NULL, NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_vector != NULL) {
+ bool exist = false;
+ std::vector<std::string> profile_entry = ReadStringContainer(
+ entry->ini_section_name, entry->ini_key_name, &exist, true);
+ if (exist) {
+ *entry->ini_vector = profile_entry;
+
+ const std::string list_with_comma = std::accumulate(
+ profile_entry.begin(),
+ profile_entry.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(
+ list_with_comma, entry->ini_key_name, entry->ini_section_name);
+ }
+ entry++;
+ }
+ }
}
bool Profile::ReadValue(bool* value,
@@ -1845,15 +2272,22 @@ bool Profile::ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const {
DCHECK(value);
+ return ReadValueEmpty(value, pSection, pKey) && "\0" != *value;
+}
+
+bool Profile::ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
bool ret = false;
char buf[INI_LINE_LEN + 1];
*buf = '\0';
- if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) &&
- ('\0' != *buf)) {
+ if (0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) {
*value = buf;
ret = true;
}
+
return ret;
}
@@ -1915,6 +2349,18 @@ namespace {
int32_t hex_to_int(const std::string& value) {
return static_cast<int32_t>(strtol(value.c_str(), NULL, 16));
}
+
+std::string trim_string(const std::string& str) {
+ const char* delims = " \t";
+
+ size_t start = str.find_first_not_of(delims);
+ if (std::string::npos == start) {
+ return std::string();
+ }
+ size_t end = str.find_last_not_of(delims);
+
+ return str.substr(start, end - start + 1);
+}
}
std::vector<int> Profile::ReadIntContainer(const char* const pSection,
@@ -1932,9 +2378,15 @@ std::vector<int> Profile::ReadIntContainer(const char* const pSection,
std::vector<std::string> Profile::ReadStringContainer(
const char* const pSection,
const char* const pKey,
- bool* out_result) const {
+ bool* out_result,
+ bool allow_empty) const {
std::string string;
- const bool result = ReadValue(&string, pSection, pKey);
+ bool result;
+ if (allow_empty) {
+ result = ReadValueEmpty(&string, pSection, pKey);
+ } else {
+ result = ReadValue(&string, pSection, pKey);
+ }
if (out_result)
*out_result = result;
std::vector<std::string> value_container;
@@ -1944,7 +2396,7 @@ std::vector<std::string> Profile::ReadStringContainer(
while (iss) {
if (!getline(iss, temp_str, ','))
break;
- value_container.push_back(temp_str);
+ value_container.push_back(trim_string(temp_str));
}
}
return value_container;
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index e7d62f4740..64bafdd6bf 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -690,10 +690,34 @@ TEST_F(ProfileTest, CheckStringContainer) {
std::vector<std::string>::iterator element_mode = diagmodes_list.begin();
element_mode++;
element_mode++;
- diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), " 0x03");
+ diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), "0x03");
EXPECT_EQ(diag_mode, element_mode);
}
+TEST_F(ProfileTest, CheckStringContainerEmpty) {
+ // Set new config file
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
+
+ bool isread = false;
+ std::vector<std::string> output_list =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list.empty());
+
+ isread = false;
+ std::vector<std::string> output_list2 =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread, true);
+ EXPECT_TRUE(isread);
+ EXPECT_TRUE(output_list2.empty());
+
+ isread = false;
+ std::vector<std::string> output_list3 =
+ profile_.ReadStringContainer("MAIN", "DoesNotExistKey", &isread, true);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list2.empty());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
// Set new config file
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index aafc562505..4f900bb65e 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -41,6 +41,7 @@
#include "connection_handler/device.h"
#include "connection_handler/heartbeat_monitor.h"
#include "protocol/service_type.h"
+#include "protocol_handler/protocol_packet.h"
#ifdef ENABLE_SECURITY
namespace security_manager {
@@ -71,12 +72,19 @@ typedef std::map<int32_t, Connection*> ConnectionList;
*/
struct Service {
protocol_handler::ServiceType service_type;
+ transport_manager::ConnectionUID connection_id;
bool is_protected_;
Service()
: service_type(protocol_handler::kInvalidServiceType)
+ , connection_id(0)
, is_protected_(false) {}
- explicit Service(protocol_handler::ServiceType service_type)
- : service_type(service_type), is_protected_(false) {}
+
+ explicit Service(protocol_handler::ServiceType service_type,
+ transport_manager::ConnectionUID connection_id)
+ : service_type(service_type)
+ , connection_id(connection_id)
+ , is_protected_(false) {}
+
bool operator==(const protocol_handler::ServiceType service_type) const {
return this->service_type == service_type;
}
@@ -95,6 +103,7 @@ struct Session {
#endif // ENABLE_SECURITY
Session()
: service_list()
+ , protocol_version(::protocol_handler::PROTOCOL_VERSION_2)
#ifdef ENABLE_SECURITY
, ssl_context(NULL)
#endif // ENABLE_SECURITY
@@ -150,9 +159,11 @@ class Connection {
/**
* @brief Adds session to connection
+ * @param connection_handle Connection Handle for the session
* @return new session id or 0 in case of issues
*/
- uint32_t AddNewSession();
+ uint32_t AddNewSession(
+ const transport_manager::ConnectionUID connection_handle);
/**
* @brief Removes session from connection
@@ -167,11 +178,13 @@ class Connection {
* @param session_id session ID
* @param service_type Type of service
* @param is_protected protection state
+ * @param connection_id Connection ID associated with the service
* @return TRUE on success, otherwise FALSE
*/
bool AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool is_protected);
+ const bool is_protected,
+ transport_manager::ConnectionUID connection_id);
/**
* @brief Removes service from session
* @param session_id session ID
@@ -180,6 +193,18 @@ class Connection {
*/
bool RemoveService(uint8_t session_id,
protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Removes secondary service from session
+ * @param secondary_connection_handle connection identifying services to be
+ * removed
+ * @param removed_services_list Returned: List of service types removed
+ * @return the session ID associated with the services removed
+ */
+ uint8_t RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list);
+
#ifdef ENABLE_SECURITY
/**
* @brief Sets crypto context of service
@@ -207,14 +232,26 @@ class Connection {
*/
void SetProtectionFlag(const uint8_t session_id,
const protocol_handler::ServiceType& service_type);
+
#endif // ENABLE_SECURITY
- /**
- * @brief Returns map of sessions which have been opened in
- * current connection.
- */
+
+ /**
+ * @brief Returns map of sessions which have been opened in
+ * current connection.
+ */
const SessionMap session_map() const;
/**
+ * @brief Check if session contains service with specified service type
+ * @param session_id id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ bool SessionServiceExists(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type) const;
+
+ /**
* @brief Close session
* @param session_id session id
*/
@@ -268,6 +305,20 @@ class Connection {
*/
bool ProtocolVersion(uint8_t session_id, uint8_t& protocol_version);
+ /**
+ * @brief Returns the primary connection handle associated with this
+ * connection
+ * @return ConnectionHandle
+ */
+ ConnectionHandle primary_connection_handle() const;
+
+ /**
+ * @brief Sets the primary connection handle
+ * @param primary_connection_handle the primary connection handle to
+ * associate with this connection
+ */
+ void SetPrimaryConnectionHandle(ConnectionHandle primary_connection_handle);
+
private:
/**
* @brief Current connection handler.
@@ -289,7 +340,12 @@ class Connection {
*/
SessionMap session_map_;
- mutable sync_primitives::Lock session_map_lock_;
+ mutable sync_primitives::RecursiveLock session_map_lock_;
+
+ /**
+ * @brief primary connection handle for secondary connections
+ */
+ ConnectionHandle primary_connection_handle_;
/**
* @brief monitor that closes connection if there is no traffic over it
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
index cd8aec0ff3..1ab70ce702 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -49,15 +49,19 @@
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/message_queue.h"
#include "utils/lock.h"
#include "utils/stl_utils.h"
#include "utils/rwlock.h"
+const transport_manager::ConnectionUID kDisabledSecondary = 0xFFFFFFFF;
+
/**
* \namespace connection_handler
* \brief SmartDeviceLink connection_handler namespace.
*/
namespace connection_handler {
+
/**
* \class ConnectionHandlerImpl
* \brief SmartDeviceLink connection_handler main class
@@ -136,6 +140,24 @@ class ConnectionHandlerImpl
void OnDeviceRemoved(
const transport_manager::DeviceInfo& device_info) OVERRIDE;
+ /**
+ * @brief OnDeviceSwitchingStart notifies listeners on device transport
+ * switching start
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ void OnDeviceSwitchingStart(const std::string& device_uid_from,
+ const std::string& device_uid_to) FINAL;
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listeners on device transport
+ * switching completion
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ void OnDeviceSwitchingFinish(
+ const transport_manager::DeviceUID& device_uid) FINAL;
+
void OnScanDevicesFinished() OVERRIDE;
void OnScanDevicesFailed(
const transport_manager::SearchDeviceError& error) OVERRIDE;
@@ -174,20 +196,21 @@ class ConnectionHandlerImpl
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
- * \param connection_handle Connection identifier within which session has to
- * be started.
- * \param session_id Identifier of the session to be started
+ * Result must be notified through NotifySessionStartedContext().
+ * \param connection_handle Connection identifier within which session
+ * has to be started.
+ * \param sessionId Identifier of the session to be start
* \param service_type Type of service
+ * \param protocol_version Version of protocol
* \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
+ * \param params configuration parameters specified by mobile
*/
- virtual uint32_t OnSessionStartedCallback(
+ virtual void OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
const protocol_handler::ServiceType& service_type,
const bool is_protected,
- uint32_t* hash_id);
+ const BsonObject* params);
/**
* \brief Callback function used by ProtocolHandler
@@ -195,14 +218,14 @@ class ConnectionHandlerImpl
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
* \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
+ * protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
* If not equal to hash assigned to session on start then operation fails.
* \return uint32_t 0 if operation fails, session key otherwise
*/
uint32_t OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
- const uint32_t& hashCode,
+ uint32_t* hashCode,
const protocol_handler::ServiceType& service_type) OVERRIDE;
/**
@@ -220,6 +243,24 @@ class ConnectionHandlerImpl
void OnMalformedMessageCallback(const uint32_t& connection_key) OVERRIDE;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -301,6 +342,16 @@ class ConnectionHandlerImpl
#endif // ENABLE_SECURITY
/**
+ * @brief Check if session contains service with specified service type
+ * @param connection_key unique id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ bool SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const OVERRIDE;
+
+ /**
* \brief Get device handle by mac address
* \param mac_address uniq address
* \param device_handle
@@ -425,16 +476,100 @@ class ConnectionHandlerImpl
uint8_t session_id,
uint8_t& protocol_version) const OVERRIDE;
- int32_t GetDataOnSessionKey(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const OVERRIDE;
+ /**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ connection_handler::DeviceHandle* device_id) const OVERRIDE;
const ConnectionHandlerSettings& get_settings() const OVERRIDE;
const protocol_handler::SessionObserver& get_session_observer();
DevicesDiscoveryStarter& get_device_discovery_starter();
+ /**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ bool RemoveSession(uint8_t session_id) OVERRIDE;
+
+ DataAccessor<SessionConnectionMap> session_connection_map() OVERRIDE;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ const SessionTransports GetSessionTransports(
+ uint8_t session_id) const OVERRIDE;
+
+ /**
+ * \brief Invoked when observer's OnServiceStartedCallback is completed
+ * \param session_key the key of started session passed to
+ * OnServiceStartedCallback().
+ * \param result true if observer accepts starting service, false otherwise
+ * \param rejected_params list of rejected parameters' name. Only valid when
+ * result is false. Note that even if result is false, this may be empty.
+ *
+ * \note This is invoked only once but can be invoked by multiple threads.
+ * Also it can be invoked before OnServiceStartedCallback() returns.
+ **/
+ virtual void NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params);
+
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param sessionid session ID taken from Register Secondary Transport frame
+ **/
+ bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) OVERRIDE;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle)
+ OVERRIDE;
+
private:
/**
* \brief Disconnect application.
@@ -446,6 +581,9 @@ class ConnectionHandlerImpl
void OnConnectionEnded(const transport_manager::ConnectionUID connection_id);
+ const uint8_t GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const;
+
const ConnectionHandlerSettings& settings_;
/**
* \brief Pointer to observer
@@ -465,6 +603,13 @@ class ConnectionHandlerImpl
DeviceMap device_list_;
/**
+ * @brief session/connection map
+ */
+ SessionConnectionMap session_connection_map_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ session_connection_map_lock_ptr_;
+
+ /**
* \brief List of connections
*/
ConnectionList connection_list_;
@@ -480,6 +625,15 @@ class ConnectionHandlerImpl
*/
utils::StlMapDeleter<ConnectionList> connection_list_deleter_;
+ sync_primitives::Lock start_service_context_map_lock_;
+ std::map<uint32_t, protocol_handler::SessionContext>
+ start_service_context_map_;
+
+ /**
+ * @brief connection object as it's being closed
+ */
+ Connection* ending_connection_;
+
#ifdef BUILD_TESTS
// Methods for test usage
public:
@@ -488,6 +642,9 @@ class ConnectionHandlerImpl
void addDeviceConnection(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id);
+ SessionConnectionMap& getSessionConnectionMap() {
+ return session_connection_map_;
+ }
#endif
private:
DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
diff --git a/src/components/connection_handler/include/connection_handler/device.h b/src/components/connection_handler/include/connection_handler/device.h
index cee0bf8875..26376c1d8d 100644
--- a/src/components/connection_handler/include/connection_handler/device.h
+++ b/src/components/connection_handler/include/connection_handler/device.h
@@ -36,6 +36,7 @@
#include <string>
#include <map>
#include <vector>
+#include "transport_manager/common.h"
/**
* \namespace connection_handler
@@ -46,7 +47,7 @@ namespace connection_handler {
/**
* \brief Type for DeviceHandle
*/
-typedef uint32_t DeviceHandle;
+typedef transport_manager::DeviceHandle DeviceHandle;
typedef std::vector<int32_t> AppList;
/**
@@ -112,6 +113,6 @@ class Device {
/**
* \brief Type for Devices map
*/
-typedef std::map<int32_t, Device> DeviceMap;
+typedef std::map<DeviceHandle, Device> DeviceMap;
} // namespace connection_handler
#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
diff --git a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
index 4d1d07112c..cf956353dd 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -102,7 +102,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
void RefreshExpiration();
uint32_t heartbeat_timeout_mseconds_;
- TimevalStruct heartbeat_expiration_;
+ date_time::TimeDuration heartbeat_expiration_;
bool is_heartbeat_sent_;
};
@@ -111,7 +111,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
typedef std::map<uint8_t, SessionState> SessionMap;
SessionMap sessions_;
- sync_primitives::Lock sessions_list_lock_; // recurcive
+ sync_primitives::RecursiveLock sessions_list_lock_; // recurcive
sync_primitives::Lock main_thread_lock_;
mutable sync_primitives::Lock heartbeat_timeout_seconds_lock_;
sync_primitives::ConditionalVariable heartbeat_monitor_;
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 7bb54d4493..3f5b0e1901 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@
#include "protocol_handler/protocol_packet.h"
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/helpers.h"
#ifdef ENABLE_SECURITY
#include "security_manager/ssl_context.h"
@@ -80,7 +81,7 @@ Connection::Connection(ConnectionHandle connection_handle,
: connection_handler_(connection_handler)
, connection_handle_(connection_handle)
, connection_device_handle_(connection_device_handle)
- , session_map_lock_(true)
+ , primary_connection_handle_(0)
, heartbeat_timeout_(heartbeat_timeout) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(connection_handler_);
@@ -96,39 +97,62 @@ Connection::~Connection() {
heart_beat_monitor_thread_->join();
delete heartbeat_monitor_;
threads::DeleteThread(heart_beat_monitor_thread_);
- sync_primitives::AutoLock lock(session_map_lock_);
- session_map_.clear();
-}
-// Finds a key not presented in std::map<unsigned char, T>
-// Returns 0 if that key not found
-namespace {
-template <class T>
-uint32_t findGap(const std::map<unsigned char, T>& map) {
- for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
- if (map.find(i) == map.end()) {
- return i;
- }
+ // Before clearing out the session_map_, we must remove all sessions
+ // associated with this Connection from the SessionConnectionMap.
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in RemoveSession).
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.begin();
+ while (session_it != session_map_.end()) {
+ LOG4CXX_INFO(
+ logger_,
+ "Removed Session ID "
+ << static_cast<int>(session_it->first)
+ << " from Session/Connection Map in Connection Destructor");
+ connection_handler_->RemoveSession(session_it->first);
+ session_it++;
}
- return 0;
+
+ session_map_.clear();
}
-} // namespace
-uint32_t Connection::AddNewSession() {
+uint32_t Connection::AddNewSession(
+ const transport_manager::ConnectionUID connection_handle) {
LOG4CXX_AUTO_TRACE(logger_);
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in AddSession)
sync_primitives::AutoLock lock(session_map_lock_);
- const uint32_t session_id = findGap(session_map_);
+
+ // Even though we have our own SessionMap, we use the Connection Handler's
+ // SessionConnectionMap to generate a session ID. We want to make sure that
+ // session IDs are globally unique, and not only unique within a Connection.
+ const uint32_t session_id =
+ connection_handler_->AddSession(connection_handle);
if (session_id > 0) {
Session& new_session = session_map_[session_id];
new_session.protocol_version = ::protocol_handler::PROTOCOL_VERSION_2;
- new_session.service_list.push_back(Service(protocol_handler::kRpc));
- new_session.service_list.push_back(Service(protocol_handler::kBulk));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kRpc, connection_handle));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kBulk, connection_handle));
}
+
return session_id;
}
uint32_t Connection::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Again, a NESTED lock, but it follows the rules.
sync_primitives::AutoLock lock(session_map_lock_);
+
+ if (!connection_handler_->RemoveSession(session_id)) {
+ return 0;
+ }
+
SessionMap::iterator it = session_map_.find(session_id);
if (session_map_.end() == it) {
LOG4CXX_WARN(logger_, "Session not found in this connection!");
@@ -136,18 +160,26 @@ uint32_t Connection::RemoveSession(uint8_t session_id) {
}
heartbeat_monitor_->RemoveSession(session_id);
session_map_.erase(session_id);
+
return session_id;
}
bool Connection::AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool request_protection) {
+ const bool request_protection,
+ transport_manager::ConnectionUID connection_id) {
// Ignore wrong services
if (protocol_handler::kControl == service_type ||
protocol_handler::kInvalidServiceType == service_type) {
LOG4CXX_WARN(logger_, "Wrong service " << static_cast<int>(service_type));
return false;
}
+
+ LOG4CXX_DEBUG(logger_,
+ "Add service " << service_type << " for session "
+ << static_cast<uint32_t>(session_id)
+ << " using connection ID "
+ << static_cast<uint32_t>(connection_id));
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
@@ -156,6 +188,20 @@ bool Connection::AddNewService(uint8_t session_id,
return false;
}
Session& session = session_it->second;
+
+ if (session.protocol_version <= protocol_handler::PROTOCOL_VERSION_2 &&
+ helpers::Compare<protocol_handler::ServiceType,
+ helpers::EQ,
+ helpers::ONE>(
+ service_type,
+ protocol_handler::ServiceType::kAudio,
+ protocol_handler::ServiceType::kMobileNav)) {
+ LOG4CXX_WARN(logger_,
+ "Audio and video services are disallowed for protocol version "
+ "2 or lower");
+ return false;
+ }
+
Service* service = session.FindService(service_type);
// if service already exists
if (service) {
@@ -182,7 +228,7 @@ bool Connection::AddNewService(uint8_t session_id,
#endif // ENABLE_SECURITY
}
// id service is not exists
- session.service_list.push_back(Service(service_type));
+ session.service_list.push_back(Service(service_type, connection_id));
return true;
}
@@ -227,6 +273,63 @@ bool Connection::RemoveService(uint8_t session_id,
return true;
}
+uint8_t Connection::RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t found_session_id = 0;
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices looking for services on Connection ID "
+ << static_cast<int>(secondary_connection_handle));
+
+ // Walk the SessionMap in the primary connection, and for each
+ // Session, we walk its ServiceList, looking for all the services
+ // that were running on the now-closed Secondary Connection.
+ for (SessionMap::iterator session_it = session_map_.begin();
+ session_map_.end() != session_it;
+ ++session_it) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found session ID "
+ << static_cast<int>(session_it->first));
+
+ // Now, for each session, walk the its ServiceList, looking for services
+ // that were using secondary)_connection_handle. If we find such a service,
+ // set session_found and break out of the outer loop.
+ ServiceList& service_list = session_it->second.service_list;
+ ServiceList::iterator service_it = service_list.begin();
+ for (; service_it != service_list.end();) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found service ID "
+ << static_cast<int>(service_it->service_type));
+ if (service_it->connection_id == secondary_connection_handle) {
+ found_session_id = session_it->first;
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices removing Service "
+ << static_cast<int>(service_it->service_type)
+ << " in session "
+ << static_cast<int>(found_session_id));
+
+ removed_services_list.push_back(service_it->service_type);
+ service_it = service_list.erase(service_it);
+ } else {
+ service_it++;
+ }
+ }
+
+ // If we found a session that had services running on the secondary
+ // connection, we're done.
+ if (found_session_id != 0) {
+ break;
+ }
+ }
+
+ return found_session_id;
+}
+
#ifdef ENABLE_SECURITY
int Connection::SetSSLContext(uint8_t session_id,
security_manager::SSLContext* context) {
@@ -294,8 +397,25 @@ void Connection::SetProtectionFlag(
service_rpc->is_protected_ = true;
}
}
+
#endif // ENABLE_SECURITY
+bool Connection::SessionServiceExists(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ SessionMap::const_iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+
+ const Session& session = session_it->second;
+ return session.FindService(service_type);
+}
+
ConnectionHandle Connection::connection_handle() const {
return connection_handle_;
}
@@ -310,7 +430,6 @@ const SessionMap Connection::session_map() const {
}
void Connection::CloseSession(uint8_t session_id) {
- size_t size;
{
sync_primitives::AutoLock lock(session_map_lock_);
@@ -318,16 +437,10 @@ void Connection::CloseSession(uint8_t session_id) {
if (session_it == session_map_.end()) {
return;
}
- size = session_map_.size();
}
connection_handler_->CloseSession(
connection_handle_, session_id, connection_handler::kCommon);
-
- // Close connection if it is last session
- if (1 == size) {
- connection_handler_->CloseConnection(connection_handle_);
- }
}
void Connection::UpdateProtocolVersionSession(uint8_t session_id,
@@ -352,8 +465,7 @@ bool Connection::SupportHeartBeat(uint8_t session_id) {
}
Session& session = session_it->second;
return (
- (::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version ||
- ::protocol_handler::PROTOCOL_VERSION_4 == session.protocol_version) &&
+ (session.protocol_version >= ::protocol_handler::PROTOCOL_VERSION_3) &&
(0 != heartbeat_timeout_));
}
@@ -370,6 +482,15 @@ bool Connection::ProtocolVersion(uint8_t session_id,
return true;
}
+ConnectionHandle Connection::primary_connection_handle() const {
+ return primary_connection_handle_;
+}
+
+void Connection::SetPrimaryConnectionHandle(
+ ConnectionHandle primary_connection_handle) {
+ primary_connection_handle_ = primary_connection_handle;
+}
+
void Connection::StartHeartBeat(uint8_t session_id) {
heartbeat_monitor_->AddSession(session_id);
}
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 0f6720f6a1..478127c42a 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -38,6 +38,7 @@
#include "connection_handler/connection_handler_impl.h"
#include "transport_manager/info.h"
+#include "encryption/hashing.h"
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
@@ -67,9 +68,14 @@ ConnectionHandlerImpl::ConnectionHandlerImpl(
, connection_handler_observer_(NULL)
, transport_manager_(tm)
, protocol_handler_(NULL)
+ , session_connection_map_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, connection_list_lock_()
, connection_handler_observer_lock_()
- , connection_list_deleter_(&connection_list_) {}
+ , connection_list_deleter_(&connection_list_)
+ , start_service_context_map_lock_()
+ , start_service_context_map_()
+ , ending_connection_(NULL) {}
ConnectionHandlerImpl::~ConnectionHandlerImpl() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -82,6 +88,9 @@ void ConnectionHandlerImpl::Stop() {
RemoveConnection(itr->second->connection_handle());
itr = connection_list_.begin();
}
+
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ start_service_context_map_.clear();
}
void ConnectionHandlerImpl::set_connection_handler_observer(
@@ -131,15 +140,21 @@ void ConnectionHandlerImpl::OnDeviceFound(
void ConnectionHandlerImpl::OnDeviceAdded(
const transport_manager::DeviceInfo& device_info) {
LOG4CXX_AUTO_TRACE(logger_);
- device_list_.insert(
- DeviceMap::value_type(device_info.device_handle(),
- Device(device_info.device_handle(),
- device_info.name(),
- device_info.mac_address(),
- device_info.connection_type())));
- sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
- if (connection_handler_observer_) {
- connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ auto handle = device_info.device_handle();
+
+ Device device(handle,
+ device_info.name(),
+ device_info.mac_address(),
+ device_info.connection_type());
+
+ auto result = device_list_.insert(std::make_pair(handle, device));
+
+ if (!result.second) {
+ LOG4CXX_ERROR(logger_,
+ "Device with handle " << handle
+ << " is known already. "
+ "Information won't be updated.");
+ return;
}
}
@@ -169,12 +184,55 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
RemoveConnection(*it);
}
- device_list_.erase(device_info.device_handle());
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->RemoveDevice(device_info.device_handle());
connection_handler_observer_->OnDeviceListUpdated(device_list_);
}
+ device_list_.erase(device_info.device_handle());
+}
+
+void ConnectionHandlerImpl::OnDeviceSwitchingFinish(
+ const transport_manager::DeviceUID& device_uid) {
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceSwitchingFinish(
+ encryption::MakeHash(device_uid));
+ }
+}
+
+namespace {
+struct DeviceFinder {
+ explicit DeviceFinder(const std::string& device_uid)
+ : device_uid_(device_uid) {}
+ bool operator()(const DeviceMap::value_type& device) {
+ return device_uid_ == device.second.mac_address();
+ }
+
+ private:
+ const std::string& device_uid_;
+};
+} // namespace
+
+void ConnectionHandlerImpl::OnDeviceSwitchingStart(
+ const std::string& device_uid_from, const std::string& device_uid_to) {
+ auto device_from =
+ std::find_if(device_list_.begin(),
+ device_list_.end(),
+ DeviceFinder(encryption::MakeHash(device_uid_from)));
+
+ auto device_to =
+ std::find_if(device_list_.begin(),
+ device_list_.end(),
+ DeviceFinder(encryption::MakeHash(device_uid_to)));
+
+ DCHECK_OR_RETURN_VOID(device_list_.end() != device_from);
+ DCHECK_OR_RETURN_VOID(device_list_.end() != device_to);
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceSwitchingStart(device_from->second,
+ device_to->second);
+ }
}
void ConnectionHandlerImpl::OnScanDevicesFinished() {
@@ -261,6 +319,7 @@ void ConnectionHandlerImpl::RemoveConnection(
bool AllowProtection(const ConnectionHandlerSettings& settings,
const protocol_handler::ServiceType& service_type,
const bool is_protected) {
+ LOG4CXX_AUTO_TRACE(logger_);
const std::vector<int>& force_unprotected_list =
is_protected ? settings.force_unprotected_service()
: settings.force_protected_service();
@@ -279,42 +338,80 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
}
#endif // ENABLE_SECURITY
-uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
+void ConnectionHandlerImpl::OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
const protocol_handler::ServiceType& service_type,
const bool is_protected,
- uint32_t* hash_id) {
+ const BsonObject* params) {
LOG4CXX_AUTO_TRACE(logger_);
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_WRONG;
+ std::vector<std::string> rejected_params;
+
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ SessionTransports st = GetSessionTransports(session_id);
+ if (session_id != 0) {
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnSessionStartedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionStartedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
+ }
}
+
+ protocol_handler::SessionContext context(primary_connection_handle,
+ connection_handle,
+ session_id,
+ 0,
+ service_type,
+ protocol_handler::HASH_ID_WRONG,
+ is_protected);
+
#ifdef ENABLE_SECURITY
if (!AllowProtection(get_settings(), service_type, is_protected)) {
- return 0;
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
}
#endif // ENABLE_SECURITY
sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown connection!");
- return 0;
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
}
- uint32_t new_session_id = 0;
Connection* connection = it->second;
+ context.is_new_service_ =
+ !connection->SessionServiceExists(session_id, service_type);
+
if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- new_session_id = connection->AddNewSession();
- if (0 == new_session_id) {
+ context.new_session_id_ =
+ connection->AddNewSession(primary_connection_handle);
+ if (0 == context.new_session_id_) {
LOG4CXX_ERROR(logger_, "Couldn't start new session!");
- return 0;
- }
- if (hash_id) {
- *hash_id = KeyFromPair(connection_handle, new_session_id);
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
}
+ context.hash_id_ =
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
} else { // Could be create new service or protected exists one
- if (!connection->AddNewService(session_id, service_type, is_protected)) {
+ if (!connection->AddNewService(
+ session_id, service_type, is_protected, connection_handle)) {
LOG4CXX_ERROR(logger_,
"Couldn't establish "
#ifdef ENABLE_SECURITY
@@ -322,30 +419,85 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
#endif // ENABLE_SECURITY
<< " service " << static_cast<int>(service_type)
<< " for session " << static_cast<int>(session_id));
- return 0;
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
}
- new_session_id = session_id;
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED;
+ context.new_session_id_ = session_id;
+ context.hash_id_ = protocol_handler::HASH_ID_NOT_SUPPORTED;
+
+ if (st.secondary_transport == connection_handle) {
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ st.secondary_transport_services.push_back(service_type);
}
}
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
- const uint32_t session_key = KeyFromPair(connection_handle, new_session_id);
- const bool success = connection_handler_observer_->OnServiceStartedCallback(
- connection->connection_device_handle(), session_key, service_type);
- if (!success) {
- LOG4CXX_WARN(logger_,
- "Service starting forbidden by connection_handler_observer");
- if (protocol_handler::kRpc == service_type) {
- connection->RemoveSession(new_session_id);
- } else {
- connection->RemoveService(session_id, service_type);
- }
- return 0;
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
+
+ {
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ start_service_context_map_[session_key] = context;
+ }
+
+ connection_handler_observer_->OnServiceStartedCallback(
+ connection->connection_device_handle(),
+ session_key,
+ service_type,
+ params);
+ } else {
+ if (protocol_handler_) {
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
}
}
- return new_session_id;
+}
+
+void ConnectionHandlerImpl::NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ protocol_handler::SessionContext context;
+ {
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ auto it = start_service_context_map_.find(session_key);
+ if (it == start_service_context_map_.end()) {
+ LOG4CXX_ERROR(logger_, "context for start service not found!");
+ return;
+ }
+ context = it->second;
+ start_service_context_map_.erase(it);
+ }
+
+ // We need the context's primary connection so we can manage its services list
+ Connection* connection = NULL;
+ {
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it =
+ connection_list_.find(context.primary_connection_id_);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "connection not found");
+ return;
+ }
+ connection = it->second;
+ }
+
+ if (!result) {
+ LOG4CXX_WARN(logger_,
+ "Service starting forbidden by connection_handler_observer");
+ if (protocol_handler::kRpc == context.service_type_) {
+ connection->RemoveSession(context.new_session_id_);
+ } else {
+ connection->RemoveService(context.initial_session_id_,
+ context.service_type_);
+ }
+ context.new_session_id_ = 0;
+ }
+
+ if (protocol_handler_ != NULL) {
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ }
}
void ConnectionHandlerImpl::OnApplicationFloodCallBack(
@@ -356,6 +508,28 @@ void ConnectionHandlerImpl::OnApplicationFloodCallBack(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnApplicationFloodCallBack could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnApplicationFloodCallBack found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect flooding application");
if (session_id != 0) {
CloseSession(connection_handle, session_id, kFlood);
@@ -373,6 +547,28 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnMalformedMessageCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnMalformedMessageCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect malformed messaging application");
CloseConnectionSessions(connection_handle, kMalformed);
CloseConnection(connection_handle);
@@ -381,33 +577,61 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
- const uint32_t& hashCode,
+ uint32_t* hashCode,
const protocol_handler::ServiceType& service_type) {
LOG4CXX_AUTO_TRACE(logger_);
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnSessionEndedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionEndedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
+ }
+ }
+
connection_list_lock_.AcquireForReading();
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_WARN(logger_, "Unknown connection!");
+ connection_list_lock_.Release();
return 0;
}
std::pair<int32_t, Connection*> connection_item = *it;
connection_list_lock_.Release();
Connection* connection = connection_item.second;
- const uint32_t session_key = KeyFromPair(connection_handle, session_id);
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
LOG4CXX_INFO(logger_,
"Session " << static_cast<uint32_t>(session_id)
<< " to be removed");
// old version of protocol doesn't support hash
- if (protocol_handler::HASH_ID_NOT_SUPPORTED != hashCode) {
- if (protocol_handler::HASH_ID_WRONG == hashCode ||
- session_key != hashCode) {
+ if (protocol_handler::HASH_ID_NOT_SUPPORTED != *hashCode) {
+ if (protocol_handler::HASH_ID_WRONG == *hashCode ||
+ session_key != *hashCode) {
LOG4CXX_WARN(logger_,
"Wrong hash_id for session "
<< static_cast<uint32_t>(session_id));
+ *hashCode = protocol_handler::HASH_ID_WRONG;
return 0;
}
}
@@ -437,6 +661,178 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
return session_key;
}
+bool ConnectionHandlerImpl::OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (session_id == 0) {
+ LOG4CXX_WARN(logger_, "Session id for secondary transport is invalid");
+ return false;
+ }
+
+ DeviceHandle device_handle;
+ Connection* connection;
+ {
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it =
+ connection_list_.find(secondary_connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Unknown connection " << secondary_connection_handle);
+ return false;
+ }
+
+ connection = it->second;
+ device_handle = connection->connection_device_handle();
+ }
+
+ // Add the secondary transport connection ID to the SessionConnectionMap
+ SessionTransports st =
+ SetSecondaryTransportID(session_id, secondary_connection_handle);
+ primary_connection_handle = st.primary_transport;
+ if (st.secondary_transport != secondary_connection_handle) {
+ LOG4CXX_WARN(logger_,
+ "Failed setting the session's secondary transport ID");
+ return false;
+ }
+
+ connection->SetPrimaryConnectionHandle(primary_connection_handle);
+
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ LOG4CXX_TRACE(logger_,
+ "Calling Connection Handler Observer's "
+ "OnSecondaryTransportStartedCallback");
+ connection_handler_observer_->OnSecondaryTransportStartedCallback(
+ device_handle, session_key);
+ }
+
+ return true;
+}
+
+void ConnectionHandlerImpl::OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_,
+ "Secondary Transport: "
+ << static_cast<int32_t>(secondary_connection_handle)
+ << " ended. Cleaning up services from primary connection ID "
+ << static_cast<int32_t>(primary_connection_handle));
+ connection_list_lock_.AcquireForReading();
+ ConnectionList::iterator itr =
+ connection_list_.find(primary_connection_handle);
+ if (connection_list_.end() == itr) {
+ LOG4CXX_ERROR(logger_, "Primary Connection not found!");
+ connection_list_lock_.Release();
+ return;
+ }
+ Connection* connection = itr->second;
+ connection_list_lock_.Release();
+
+ if (connection != NULL) {
+ std::list<protocol_handler::ServiceType> removed_services_list;
+ uint8_t session_id = connection->RemoveSecondaryServices(
+ secondary_connection_handle, removed_services_list);
+
+ if (session_id == 0) {
+ // The secondary services have already been removed from the primary
+ // connection, so we find the session associated with this secondary
+ // transport in the SessionConnectionMap
+ session_id =
+ GetSessionIdFromSecondaryTransport(secondary_connection_handle);
+ }
+
+ if (session_id != 0) {
+ {
+ sync_primitives::AutoReadLock read_lock(
+ connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ // Walk the returned list of services and call the ServiceEnded
+ // callback for each
+ std::list<protocol_handler::ServiceType>::const_iterator it =
+ removed_services_list.begin();
+ for (; removed_services_list.end() != it; ++it) {
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, *it, CloseSessionReason::kCommon);
+ }
+
+ connection_handler_observer_->OnSecondaryTransportEndedCallback(
+ session_key);
+ }
+ }
+
+ // Clear the secondary connection from the Session/Connection map entry
+ // associated with this session
+ SetSecondaryTransportID(session_id, 0);
+ }
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::const_iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_, "Unknown connection " << connection_handle);
+ return std::string();
+ } else {
+ DeviceHandle device_handle = it->second->connection_device_handle();
+ return TransportTypeProfileStringFromDeviceHandle(device_handle);
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const {
+ std::string connection_type;
+ DeviceMap::const_iterator it = device_list_.find(device_handle);
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Device not found!");
+ } else {
+ connection_type = it->second.connection_type();
+ }
+
+ // Caution: this should be in sync with devicesType map in
+ // transport_adapter_impl.cc
+ if (connection_type == "USB_AOA") {
+ return std::string("AOA_USB");
+ } else if (connection_type == "BLUETOOTH") {
+ return std::string("SPP_BLUETOOTH");
+ } else if (connection_type == "USB_IOS") {
+ return std::string("IAP_USB");
+ } else if (connection_type == "BLUETOOTH_IOS") {
+ return std::string("IAP_BLUETOOTH");
+ } else if (connection_type == "WIFI") {
+ return std::string("TCP_WIFI");
+ } else if (connection_type == "USB_IOS_HOST_MODE") {
+ return std::string("IAP_USB_HOST_MODE");
+ } else if (connection_type == "USB_IOS_DEVICE_MODE") {
+ return std::string("IAP_USB_DEVICE_MODE");
+ } else if (connection_type == "CARPLAY_WIRELESS_IOS") {
+ return std::string("IAP_CARPLAY");
+#ifdef BUILD_TESTS
+ } else if (connection_type == "BTMAC") {
+ return std::string("BTMAC");
+#endif
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown transport type string: " << connection_type);
+ return std::string();
+ }
+}
+
uint32_t ConnectionHandlerImpl::KeyFromPair(
transport_manager::ConnectionUID connection_handle,
uint8_t session_id) const {
@@ -445,7 +841,7 @@ uint32_t ConnectionHandlerImpl::KeyFromPair(
"Key for ConnectionHandle:"
<< static_cast<uint32_t>(connection_handle)
<< " Session:" << static_cast<uint32_t>(session_id)
- << " is: " << static_cast<uint32_t>(key));
+ << " is: 0x" << std::hex << static_cast<uint32_t>(key));
if (protocol_handler::HASH_ID_WRONG == key) {
LOG4CXX_ERROR(logger_,
"Connection key is WRONG_HASH_ID "
@@ -471,7 +867,7 @@ int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
- uint32_t* device_id) const {
+ connection_handler::DeviceHandle* device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
const int32_t error_result = -1;
@@ -528,6 +924,139 @@ DevicesDiscoveryStarter& ConnectionHandlerImpl::get_device_discovery_starter() {
return *this;
}
+// Finds a key not presented in std::map<unsigned char, T>
+// Returns 0 if that key not found
+namespace {
+template <class T>
+uint32_t findGap(const std::map<unsigned char, T>& map) {
+ for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
+ if (map.find(i) == map.end()) {
+ return i;
+ }
+ }
+ return 0;
+}
+} // namespace
+
+uint32_t ConnectionHandlerImpl::AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ const uint32_t session_id = findGap(session_connection_map_);
+ if (session_id > 0) {
+ LOG4CXX_INFO(logger_,
+ "New session ID " << session_id << " and Connection Id "
+ << static_cast<int>(primary_transport_id)
+ << " added to Session/Connection Map");
+ SessionTransports st;
+ st.primary_transport = primary_transport_id;
+ st.secondary_transport = 0;
+ session_connection_map_[session_id] = st;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Session/Connection Map could not create a new session ID!!!");
+ }
+
+ return session_id;
+}
+
+bool ConnectionHandlerImpl::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator itr = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == itr) {
+ LOG4CXX_WARN(logger_, "Session not found in Session/Connection Map!");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Removed Session ID " << static_cast<int>(session_id)
+ << " from Session/Connection Map");
+ session_connection_map_.erase(session_id);
+ return true;
+}
+
+DataAccessor<SessionConnectionMap>
+ConnectionHandlerImpl::session_connection_map() {
+ return DataAccessor<SessionConnectionMap>(session_connection_map_,
+ session_connection_map_lock_ptr_);
+}
+
+SessionTransports ConnectionHandlerImpl::SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) {
+ SessionTransports st;
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator it = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " not found in Session/Connection map");
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+
+ // The only time we overwrite an existing entry in the map is if the new
+ // secondary transport ID is kDisabledSecondary, which effectively DISABLES
+ // the secondary transport feature for the session, or if the new secondary
+ // transport ID is 0, which means a secondary transport has shut down
+ if (st.secondary_transport != 0 &&
+ secondary_transport_id != kDisabledSecondary &&
+ secondary_transport_id != 0) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " already has a secondary connection "
+ << static_cast<int>(st.secondary_transport)
+ << " in the Session/Connection map");
+ } else {
+ st.secondary_transport = secondary_transport_id;
+ session_connection_map_[session_id] = st;
+ }
+ }
+
+ return st;
+}
+
+const SessionTransports ConnectionHandlerImpl::GetSessionTransports(
+ uint8_t session_id) const {
+ SessionTransports st;
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it =
+ session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+ }
+
+ return st;
+}
+
+const uint8_t ConnectionHandlerImpl::GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const {
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it = session_connection_map_.begin();
+ for (; session_connection_map_.end() != it; it++) {
+ SessionTransports st = it->second;
+ if (st.secondary_transport == secondary_transport_id) {
+ return it->first;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_,
+ "Could not find secondary transport ID "
+ << static_cast<int>(secondary_transport_id)
+ << " in the Session/Connection map");
+ return 0;
+}
+
struct CompareMAC {
explicit CompareMAC(const std::string& mac) : mac_(mac) {}
bool operator()(const DeviceMap::value_type& device) {
@@ -540,12 +1069,11 @@ struct CompareMAC {
bool ConnectionHandlerImpl::GetDeviceID(const std::string& mac_address,
DeviceHandle* device_handle) {
+ DCHECK_OR_RETURN(device_handle, false);
DeviceMap::const_iterator it = std::find_if(
device_list_.begin(), device_list_.end(), CompareMAC(mac_address));
if (it != device_list_.end()) {
- if (device_handle) {
- *device_handle = it->first;
- }
+ *device_handle = it->first;
return true;
}
return false;
@@ -562,7 +1090,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
int32_t result = -1;
DeviceMap::const_iterator it = device_list_.find(device_handle);
if (device_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Device not found!");
+ LOG4CXX_ERROR(logger_, "Device not found for handle " << device_handle);
return result;
}
@@ -669,8 +1197,27 @@ security_manager::SSLContext::HandshakeContext
ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
return connection_handler_observer_->GetHandshakeContext(key);
}
+
#endif // ENABLE_SECURITY
+bool ConnectionHandlerImpl::SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::const_iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return false;
+ }
+ const Connection& connection = *it->second;
+ return connection.SessionServiceExists(session_id, service_type);
+}
+
void ConnectionHandlerImpl::StartDevicesDiscovery() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -886,8 +1433,33 @@ void ConnectionHandlerImpl::SendEndService(uint32_t key, uint8_t service_type) {
uint32_t connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
- protocol_handler_->SendEndService(
- connection_handle, session_id, service_type);
+
+ // If the service is running on a secondary transport, we need to retrieve
+ // that transport from the SessionConnection Map
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "SendEndService could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "SendEndService found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ auto it = std::find(st.secondary_transport_services.begin(),
+ st.secondary_transport_services.end(),
+ service_type);
+ if (it != st.secondary_transport_services.end()) {
+ connection_handle = st.secondary_transport;
+ st.secondary_transport_services.erase(it);
+ }
+ protocol_handler_->SendEndService(
+ st.primary_transport, connection_handle, session_id, service_type);
+ }
}
}
@@ -945,14 +1517,19 @@ void ConnectionHandlerImpl::OnConnectionEnded(
ConnectionList::iterator itr = connection_list_.find(connection_id);
if (connection_list_.end() == itr) {
LOG4CXX_ERROR(logger_, "Connection not found!");
+ connection_list_lock_.Release();
return;
}
- std::auto_ptr<Connection> connection(itr->second);
+ std::unique_ptr<Connection> connection(itr->second);
connection_list_.erase(itr);
connection_list_lock_.Release();
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_ && connection.get() != NULL) {
+ // We have to remember the Connection object we just removed from
+ // connection_list_, because we will need to retrieve the protocol
+ // version from it inside of OnServiceEndedCallback
+ ending_connection_ = connection.get();
const SessionMap session_map = connection->session_map();
for (SessionMap::const_iterator session_it = session_map.begin();
@@ -969,6 +1546,13 @@ void ConnectionHandlerImpl::OnConnectionEnded(
session_key, service_it->service_type, CloseSessionReason::kCommon);
}
}
+ ending_connection_ = NULL;
+ }
+
+ ConnectionHandle primary_connection_handle =
+ connection->primary_connection_handle();
+ if (primary_connection_handle != 0) {
+ OnSecondaryTransportEnded(primary_connection_handle, connection_id);
}
}
@@ -1009,6 +1593,10 @@ bool ConnectionHandlerImpl::ProtocolVersionUsed(
ConnectionList::const_iterator it = connection_list_.find(connection_id);
if (connection_list_.end() != it) {
return it->second->ProtocolVersion(session_id, protocol_version);
+ } else if (ending_connection_ &&
+ static_cast<uint32_t>(ending_connection_->connection_handle()) ==
+ connection_id) {
+ return ending_connection_->ProtocolVersion(session_id, protocol_version);
}
LOG4CXX_WARN(logger_, "Connection not found !");
return false;
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index f3a2322810..4c2d5899af 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -47,7 +47,6 @@ HeartBeatMonitor::HeartBeatMonitor(uint32_t heartbeat_timeout_mseconds,
Connection* connection)
: default_heartbeat_timeout_(heartbeat_timeout_mseconds)
, connection_(connection)
- , sessions_list_lock_(true)
, run_(true) {}
void HeartBeatMonitor::Process() {
@@ -90,18 +89,20 @@ void HeartBeatMonitor::threadMain() {
}
void HeartBeatMonitor::AddSession(uint8_t session_id) {
- LOG4CXX_DEBUG(logger_,
- "Add session with id " << static_cast<int32_t>(session_id));
+ const uint32_t converted_session_id = static_cast<int32_t>(session_id);
+ UNUSED(converted_session_id);
+ LOG4CXX_DEBUG(logger_, "Add session with id " << converted_session_id);
AutoLock auto_lock(sessions_list_lock_);
if (sessions_.end() != sessions_.find(session_id)) {
LOG4CXX_WARN(logger_,
- "Session with id " << static_cast<int32_t>(session_id)
- << " already exists");
+ "Session with id: " << converted_session_id
+ << " already exists");
return;
}
sessions_.insert(
std::make_pair(session_id, SessionState(default_heartbeat_timeout_)));
- LOG4CXX_INFO(logger_, "Start heartbeat for session " << session_id);
+ LOG4CXX_INFO(logger_,
+ "Start heartbeat for session: " << converted_session_id);
}
void HeartBeatMonitor::RemoveSession(uint8_t session_id) {
@@ -164,8 +165,8 @@ HeartBeatMonitor::SessionState::SessionState(
void HeartBeatMonitor::SessionState::RefreshExpiration() {
LOG4CXX_DEBUG(logger_, "Refresh expiration: " << heartbeat_timeout_mseconds_);
using namespace date_time;
- TimevalStruct time = DateTime::getCurrentTime();
- DateTime::AddMilliseconds(time, heartbeat_timeout_mseconds_);
+ date_time::TimeDuration time = getCurrentTime();
+ AddMilliseconds(time, heartbeat_timeout_mseconds_);
heartbeat_expiration_ = time;
}
@@ -194,8 +195,8 @@ void HeartBeatMonitor::SessionState::KeepAlive() {
}
bool HeartBeatMonitor::SessionState::HasTimeoutElapsed() {
- TimevalStruct now = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::Greater(now, heartbeat_expiration_);
+ date_time::TimeDuration now = date_time::getCurrentTime();
+ return date_time::Greater(now, heartbeat_expiration_);
}
} // namespace connection_handler
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index 6b5c2c89ad..64de24b103 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -37,8 +37,10 @@
#include "connection_handler/connection_handler_impl.h"
#include "protocol/common.h"
// TODO(EZamakhov): move security test
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#include "protocol_handler/mock_protocol_handler.h"
#include "connection_handler/mock_connection_handler_observer.h"
#include "connection_handler/mock_connection_handler_settings.h"
@@ -54,10 +56,19 @@ using namespace ::connection_handler;
using ::protocol_handler::ServiceType;
using namespace ::protocol_handler;
using ::testing::_;
+using ::testing::ByRef;
+using ::testing::DoAll;
using ::testing::InSequence;
using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRefOfCopy;
+using ::testing::SaveArg;
+using ::testing::SaveArgPointee;
+
+// custom action to call a member function with 3 arguments
+ACTION_P5(InvokeMemberFuncWithArg3, ptr, memberFunc, a, b, c) {
+ (ptr->*memberFunc)(a, b, c);
+}
namespace {
const uint32_t kAsyncExpectationsTimeout = 10000u;
@@ -77,7 +88,7 @@ class ConnectionHandlerTest : public ::testing::Test {
mac_address_ = "test_address";
connection_handler_ = new ConnectionHandlerImpl(
- mock_connection_handler_settings, mock_transport_manager_);
+ mock_connection_handler_settings_, mock_transport_manager_);
uid_ = 1u;
connection_key_ = connection_handler_->KeyFromPair(0, 0u);
protected_services_.clear();
@@ -90,42 +101,79 @@ class ConnectionHandlerTest : public ::testing::Test {
void SetSpecificServices() {
#ifdef ENABLE_SECURITY
- ON_CALL(mock_connection_handler_settings, force_protected_service())
+ ON_CALL(mock_connection_handler_settings_, force_protected_service())
.WillByDefault(ReturnRefOfCopy(protected_services_));
- ON_CALL(mock_connection_handler_settings, force_unprotected_service())
+ ON_CALL(mock_connection_handler_settings_, force_unprotected_service())
.WillByDefault(ReturnRefOfCopy(unprotected_services_));
#endif // ENABLE_SECURITY
}
+
// Additional SetUp
void AddTestDeviceConnection() {
const transport_manager::DeviceInfo device_info(
device_handle_, mac_address_, device_name_, connection_type_);
// Add Device and connection
- ON_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
.WillByDefault(Return(1000u));
connection_handler_->addDeviceConnection(device_info, uid_);
connection_key_ = connection_handler_->KeyFromPair(uid_, 0u);
// Remove all specific services
}
+
+ /**
+ * @brief Adds test session
+ * @return session_id
+ */
void AddTestSession() {
- start_session_id_ = connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
- EXPECT_NE(0u, start_session_id_);
- EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_);
- connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_);
- CheckSessionExists(uid_, start_session_id_);
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ connection_handler_->set_protocol_handler(NULL);
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ connection_key_ =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
}
+
uint32_t SessionHash(const uint32_t connection, const uint32_t session) {
return connection_handler_->KeyFromPair(connection, session);
}
+
void AddTestService(ServiceType service_type) {
- EXPECT_NE(0u, start_session_id_);
- EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_);
- connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_);
- CheckSessionExists(uid_, start_session_id_);
- uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, service_type, PROTECTION_OFF, 0);
- EXPECT_EQ(session_id, start_session_id_);
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ connection_key_ =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
+
+ // Set protocol version to 3 if audio or video service should be tested
+ if (service_type == ServiceType::kAudio ||
+ service_type == ServiceType::kMobileNav) {
+ ChangeProtocol(uid_,
+ out_context_.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
+ }
+
+ SessionContext context;
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ service_type,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(0));
+ connection_handler_->set_protocol_handler(NULL);
+ EXPECT_EQ(context.new_session_id_, out_context_.new_session_id_);
}
// Check Service Wrapper
@@ -137,7 +185,7 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
SessionMap::const_iterator sess_it = session_map.find(session_id);
@@ -158,17 +206,19 @@ class ConnectionHandlerTest : public ::testing::Test {
}
// Check Service Wrapper
- void CheckServiceExists(const int connectionId,
- const int session_id,
- const ::protocol_handler::ServiceType serviceId,
- const bool exists) {
+ void CheckServiceExists(
+ const int connectionId,
+ const int session_id,
+ const ::protocol_handler::ServiceType serviceId,
+ const ::transport_manager::ConnectionUID serviceConnectionId,
+ const bool exists) {
// Check all trees to find Service and check own protected value
const ConnectionList& connection_list =
connection_handler_->getConnectionList();
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
ASSERT_FALSE(session_map.empty());
@@ -181,11 +231,14 @@ class ConnectionHandlerTest : public ::testing::Test {
std::find(service_list.begin(), service_list.end(), serviceId);
if (exists) {
ASSERT_NE(serv_it, service_list.end());
+ ASSERT_EQ(serv_it->connection_id, serviceConnectionId);
} else {
ASSERT_EQ(serv_it, service_list.end());
}
}
- // Check Service Wrapper
+
+// Check Service Wrapper
+#ifdef ENABLE_SECURITY
void CheckService(const int connectionId,
const int session_id,
const ::protocol_handler::ServiceType serviceId,
@@ -197,16 +250,14 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
ASSERT_FALSE(session_map.empty());
SessionMap::const_iterator sess_it = session_map.find(session_id);
ASSERT_NE(sess_it, session_map.end());
const Session& session = sess_it->second;
-#ifdef ENABLE_SECURITY
ASSERT_EQ(session.ssl_context, ssl_context);
-#endif // ENABLE_SECURITY
const ServiceList& service_list = session.service_list;
ASSERT_FALSE(service_list.empty());
ServiceList::const_iterator serv_it =
@@ -215,14 +266,39 @@ class ConnectionHandlerTest : public ::testing::Test {
const Service& service = *serv_it;
EXPECT_EQ(PROTECTION_OFF, service.is_protected_);
-#ifdef ENABLE_SECURITY
if (is_protected) {
// Emulate success protection - check enable service flag
const uint32_t connection_key_ =
connection_handler_->KeyFromPair(connectionId, session_id);
connection_handler_->SetProtectionFlag(connection_key_, serviceId);
}
+ }
#endif // ENABLE_SECURITY
+
+ void CheckService(const int connectionId,
+ const int session_id,
+ const ::protocol_handler::ServiceType serviceId) {
+ // Check all tree to find Service and check own protected value
+ const ConnectionList& connection_list =
+ connection_handler_->getConnectionList();
+ ASSERT_FALSE(connection_list.empty());
+ ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ const Connection& connection = *conn_it->second;
+
+ const SessionMap& session_map = connection.session_map();
+ ASSERT_FALSE(session_map.empty());
+ SessionMap::const_iterator sess_it = session_map.find(session_id);
+ ASSERT_NE(sess_it, session_map.end());
+ const Session& session = sess_it->second;
+ const ServiceList& service_list = session.service_list;
+ ASSERT_FALSE(service_list.empty());
+ ServiceList::const_iterator serv_it =
+ std::find(service_list.begin(), service_list.end(), serviceId);
+ ASSERT_NE(serv_it, service_list.end());
+
+ const Service& service = *serv_it;
+ EXPECT_EQ(PROTECTION_OFF, service.is_protected_);
}
void ChangeProtocol(const int connectionId,
@@ -241,18 +317,42 @@ class ConnectionHandlerTest : public ::testing::Test {
connection->ProtocolVersion(session_id, check_protocol_version));
EXPECT_EQ(check_protocol_version, protocol_version);
}
+ void AddSecondaryTestService(ServiceType service_type) {
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
+
+ // Set protocol version to 5
+ ChangeProtocol(uid_,
+ out_context_.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_5);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ temp_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &temp_connection_handler_observer);
+ EXPECT_CALL(temp_connection_handler_observer,
+ OnServiceStartedCallback(_, _, service_type, _)).Times(1);
+
+ connection_handler_->OnSessionStartedCallback(2u,
+ out_context_.new_session_id_,
+ service_type,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(0));
+ connection_handler_->set_connection_handler_observer(NULL);
+ }
ConnectionHandlerImpl* connection_handler_;
testing::NiceMock<transport_manager_test::MockTransportManager>
mock_transport_manager_;
testing::NiceMock<MockConnectionHandlerSettings>
- mock_connection_handler_settings;
+ mock_connection_handler_settings_;
protocol_handler_test::MockProtocolHandler mock_protocol_handler_;
transport_manager::DeviceHandle device_handle_;
transport_manager::ConnectionUID uid_;
uint32_t connection_key_;
- uint32_t start_session_id_;
- uint32_t out_hash_id_;
+ protocol_handler::SessionContext out_context_;
std::string connection_type_;
std::string device_name_;
@@ -267,11 +367,17 @@ TEST_F(ConnectionHandlerTest, StartSession_NoConnection) {
// Null sessionId for start new session
const uint8_t sessionID = 0;
// Start new session with RPC service
- const uint32_t result_fail = connection_handler_->OnSessionStartedCallback(
- uid_, sessionID, kRpc, PROTECTION_ON, &out_hash_id_);
+ protocol_handler::SessionContext context;
+
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context));
+
+ connection_handler_->OnSessionStartedCallback(
+ uid_, sessionID, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
// Unknown connection error is '0'
- EXPECT_EQ(0u, result_fail);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context.hash_id_);
ASSERT_TRUE(connection_handler_->getConnectionList().empty());
}
@@ -306,21 +412,23 @@ TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey) {
AddTestSession();
uint32_t app_id = 0;
- const uint32_t testid = SessionHash(uid_, start_session_id_);
+ const uint32_t test_id = SessionHash(uid_, out_context_.new_session_id_);
+ connection_handler::DeviceHandle* device_id = NULL;
EXPECT_EQ(0,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, NULL));
- EXPECT_EQ(testid, app_id);
+ connection_key_, &app_id, NULL, device_id));
+ EXPECT_EQ(test_id, app_id);
}
TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey_SessionNotStarted) {
AddTestDeviceConnection();
uint32_t app_id = 0;
+ connection_handler::DeviceHandle* device_id = NULL;
EXPECT_EQ(-1,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, NULL));
+ connection_key_, &app_id, NULL, device_id));
}
TEST_F(ConnectionHandlerTest, GetDeviceID) {
@@ -371,7 +479,8 @@ TEST_F(ConnectionHandlerTest, GetApplicationsOnDevice) {
0,
connection_handler_->GetDataOnDeviceID(handle, NULL, &applications_list));
- uint32_t test_id = connection_handler_->KeyFromPair(uid_, start_session_id_);
+ uint32_t test_id =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
EXPECT_EQ(1u, applications_list.size());
EXPECT_EQ(test_id, applications_list.front());
@@ -383,7 +492,7 @@ TEST_F(ConnectionHandlerTest, GetDefaultProtocolVersion) {
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_2, protocol_version);
}
@@ -391,11 +500,11 @@ TEST_F(ConnectionHandlerTest, GetDefaultProtocolVersion) {
TEST_F(ConnectionHandlerTest, GetProtocolVersion) {
AddTestDeviceConnection();
AddTestSession();
- ChangeProtocol(uid_, start_session_id_, PROTOCOL_VERSION_3);
+ ChangeProtocol(uid_, out_context_.new_session_id_, PROTOCOL_VERSION_3);
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
}
@@ -405,14 +514,14 @@ TEST_F(ConnectionHandlerTest, GetProtocolVersionAfterBinding) {
AddTestSession();
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_2, protocol_version);
connection_handler_->BindProtocolVersionWithSession(connection_key_,
PROTOCOL_VERSION_3);
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
}
@@ -424,21 +533,28 @@ TEST_F(ConnectionHandlerTest, GetPairFromKey) {
uint32_t test_uid = 0;
connection_handler_->PairFromKey(connection_key_, &test_uid, &session_id);
EXPECT_EQ(uid_, test_uid);
- EXPECT_EQ(start_session_id_, session_id);
+ EXPECT_EQ(out_context_.new_session_id_, session_id);
+}
+
+MATCHER_P(SameDevice, device, "") {
+ return arg.device_handle() == device.device_handle() &&
+ arg.user_friendly_name() == device.user_friendly_name() &&
+ arg.mac_address() == device.mac_address() &&
+ arg.connection_type() == device.connection_type();
}
TEST_F(ConnectionHandlerTest, IsHeartBeatSupported) {
AddTestDeviceConnection();
AddTestSession();
- ChangeProtocol(uid_, start_session_id_, PROTOCOL_VERSION_3);
- EXPECT_TRUE(
- connection_handler_->IsHeartBeatSupported(uid_, start_session_id_));
+ ChangeProtocol(uid_, out_context_.new_session_id_, PROTOCOL_VERSION_3);
+ EXPECT_TRUE(connection_handler_->IsHeartBeatSupported(
+ uid_, out_context_.new_session_id_));
}
TEST_F(ConnectionHandlerTest, SendEndServiceWithoutSetProtocolHandler) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc)).Times(0);
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc)).Times(0);
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -446,7 +562,7 @@ TEST_F(ConnectionHandlerTest, SendEndService) {
AddTestDeviceConnection();
AddTestSession();
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc));
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc));
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -518,8 +634,8 @@ TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack) {
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(1);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kCommon));
@@ -545,7 +661,8 @@ TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack_SessionFound) {
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_));
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_));
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kFlood));
@@ -819,7 +936,8 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithCommonReason) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
@@ -860,7 +978,8 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithFloodReason) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
@@ -901,8 +1020,8 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithMalformedMessage) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(0);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
@@ -941,8 +1060,8 @@ TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithMalformedMessage) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(0);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
@@ -981,7 +1100,8 @@ TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithCommonReason) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
@@ -1012,27 +1132,74 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) {
// Add virtual device and connection
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext audio_context, video_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&audio_context))
+ .WillOnce(SaveArg<0>(&video_context));
// Start Audio service
- const uint32_t start_audio = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
- EXPECT_EQ(start_session_id_, start_audio);
- CheckServiceExists(uid_, start_session_id_, kAudio, true);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, audio_context.new_session_id_);
+ CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, uid_, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.hash_id_);
// Start Audio service
- const uint32_t start_video = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kMobileNav, PROTECTION_OFF, &out_hash_id_);
- EXPECT_EQ(start_session_id_, start_video);
- CheckServiceExists(uid_, start_session_id_, kMobileNav, true);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, video_context.new_session_id_);
+ CheckServiceExists(
+ uid_, video_context.new_session_id_, kMobileNav, uid_, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
}
-TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
+TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) {
AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext video_context;
+
+ // create a dummy pointer
+ int dummy = 0;
+ std::vector<std::string> empty;
+ BsonObject* dummy_param = reinterpret_cast<BsonObject*>(&dummy);
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&video_context));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_param);
+ EXPECT_EQ(out_context_.new_session_id_, video_context.new_session_id_);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, uid_, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
+}
+TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
+ AddTestDeviceConnection();
+ uint32_t dummy_hash = 0u;
const uint32_t end_session_result =
- connection_handler_->OnSessionEndedCallback(uid_, 0u, 0u, kAudio);
+ connection_handler_->OnSessionEndedCallback(
+ uid_, 0u, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
CheckSessionExists(uid_, 0);
}
@@ -1040,29 +1207,42 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) {
AddTestDeviceConnection();
AddTestSession();
+ uint32_t dummy_hash = 0u;
const uint32_t end_session_result =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, 0u, kAudio);
+ uid_, out_context_.new_session_id_, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
- CheckServiceExists(uid_, start_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
TEST_F(ConnectionHandlerTest, ServiceStop) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext audio_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillRepeatedly(SaveArg<0>(&audio_context));
+
// Check ignoring hash_id on stop non-rpc service
for (uint32_t some_hash_id = 0; some_hash_id < 0xFF; ++some_hash_id) {
// Start audio service
- const uint32_t start_audio = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
- EXPECT_EQ(start_session_id_, start_audio);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, audio_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.hash_id_);
const uint32_t end_session_result =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, some_hash_id, kAudio);
+ uid_, out_context_.new_session_id_, &some_hash_id, kAudio);
EXPECT_EQ(connection_key_, end_session_result);
- CheckServiceExists(uid_, start_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
}
@@ -1071,17 +1251,18 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckHash) {
for (uint32_t session = 0; session < 0xFF; ++session) {
AddTestSession();
- const uint32_t hash = connection_key_;
- const uint32_t wrong_hash = hash + 1;
+ uint32_t hash = connection_key_;
+ uint32_t wrong_hash = hash + 1;
const uint32_t end_audio_wrong_hash =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, wrong_hash, kRpc);
+ uid_, out_context_.new_session_id_, &wrong_hash, kRpc);
EXPECT_EQ(0u, end_audio_wrong_hash);
- CheckSessionExists(uid_, start_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, hash, kRpc);
+ uid_, out_context_.new_session_id_, &hash, kRpc);
EXPECT_EQ(connection_key_, end_audio);
CheckSessionExists(uid_, 0);
}
@@ -1092,17 +1273,18 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
for (uint32_t session = 0; session < 0xFF; ++session) {
AddTestSession();
- const uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG;
- const uint32_t hash = protocol_handler::HASH_ID_NOT_SUPPORTED;
+ uint32_t hash = connection_key_;
+ uint32_t wrong_hash = hash + 1;
const uint32_t end_audio_wrong_hash =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, wrong_hash, kRpc);
+ uid_, out_context_.new_session_id_, &wrong_hash, kRpc);
EXPECT_EQ(0u, end_audio_wrong_hash);
- CheckSessionExists(uid_, start_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, hash, kRpc);
+ uid_, out_context_.new_session_id_, &hash, kRpc);
EXPECT_EQ(connection_key_, end_audio);
CheckSessionExists(uid_, 0);
}
@@ -1111,43 +1293,240 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) {
// Add virtual device and connection
AddTestDeviceConnection();
+ out_context_.initial_session_id_ = 1u;
// Expect that rpc service has started
connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
+ std::vector<std::string> empty;
uint32_t session_key =
- connection_handler_->KeyFromPair(uid_, start_session_id_);
+ connection_handler_->KeyFromPair(uid_, out_context_.initial_session_id_);
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceStartedCallback(device_handle_, session_key, kRpc))
- .WillOnce(Return(true));
+ OnServiceStartedCallback(device_handle_, _, kRpc, NULL))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ true,
+ ByRef(empty)));
+
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&out_context_));
// Start new session with RPC service
- uint32_t new_session_id = connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+
+ EXPECT_NE(0u, out_context_.new_session_id_);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ std::vector<std::string> empty;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key, kMobileNav, dummy_params))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ true,
+ ByRef(empty)));
+
+ // confirm that NotifySessionStarted() is called
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_NE(0u, out_context_.new_session_id_);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ std::vector<std::string> empty;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key, kMobileNav, dummy_params))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ false,
+ ByRef(empty)));
+
+ // confirm that NotifySessionStarted() is called
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_EQ(0u, out_context_.new_session_id_);
+}
+
+/*
+ * Simulate two OnSessionStartedCallback calls, and connection handler observer
+ * returns a positive reply for the first call with delay and a negative reply
+ * for the second call immediately.
+ */
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_Multiple) {
+ AddTestDeviceConnection();
+
+ SessionContext context_first, context_second;
+
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_first))
+ .WillOnce(SaveArg<0>(&context_second));
+
+ // add two sessions
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+
+ EXPECT_NE(0u, context_first.new_session_id_);
+ EXPECT_NE(0u, context_second.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, context_first.new_session_id_),
+ context_first.hash_id_);
+ EXPECT_EQ(SessionHash(uid_, context_second.new_session_id_),
+ context_second.hash_id_);
+ CheckSessionExists(uid_, context_first.new_session_id_);
+ CheckSessionExists(uid_, context_second.new_session_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
+
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key1 =
+ connection_handler_->KeyFromPair(uid_, context_first.new_session_id_);
+ uint32_t session_key2 =
+ connection_handler_->KeyFromPair(uid_, context_second.new_session_id_);
+
+ std::vector<std::string> empty;
+ ChangeProtocol(uid_,
+ context_first.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
+ ChangeProtocol(uid_,
+ context_second.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
- EXPECT_NE(0u, new_session_id);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key1, kMobileNav, dummy_params))
+ // don't call NotifyServiceStartedResult() with this event
+ .Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key2, kMobileNav, dummy_params))
+ // call NotifyServiceStartedResult() twice, first for the second session
+ // then for the first session
+ .WillOnce(DoAll(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key2,
+ false,
+ ByRef(empty)),
+ InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key1,
+ true,
+ ByRef(empty))));
+
+ // verify that connection handler will not mix up the two results
+ SessionContext new_context_first, new_context_second;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&new_context_second))
+ .WillOnce(SaveArg<0>(&new_context_first));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ context_first.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ context_second.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_NE(0u, new_context_first.new_session_id_); // result is positive
+ EXPECT_EQ(0u, new_context_second.new_session_id_); // result is negative
}
TEST_F(ConnectionHandlerTest,
SessionStarted_StartSession_SecureSpecific_Unprotect) {
- EXPECT_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ EXPECT_CALL(mock_connection_handler_settings_, heart_beat_timeout())
.WillOnce(Return(heartbeat_timeout));
// Add virtual device and connection
AddTestDeviceConnection();
// Forbid start kRPC without encryption
protected_services_.push_back(kRpc);
SetSpecificServices();
+
+ SessionContext fail_context;
+ SessionContext positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&fail_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with RPC service
- const uint32_t session_id_fail =
- connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_fail);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, fail_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, fail_context.hash_id_);
#else
- EXPECT_EQ(1u, session_id_fail);
- EXPECT_EQ(SessionHash(uid_, session_id_fail), out_hash_id_);
+ EXPECT_EQ(1u, fail_context.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, fail_context.new_session_id_),
+ fail_context.hash_id_);
#endif // ENABLE_SECURITY
// Allow start kRPC without encryption
@@ -1155,11 +1534,12 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(kControl);
SetSpecificServices();
// Start new session with RPC service
- const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
- EXPECT_NE(0u, session_id);
- CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF);
- EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, positive_context.new_session_id_);
+ CheckService(uid_, positive_context.new_session_id_, kRpc);
+ EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
+ positive_context.hash_id_);
}
TEST_F(ConnectionHandlerTest,
@@ -1172,14 +1552,21 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(UnnamedService::kServedService2);
unprotected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext fail_context;
+ SessionContext positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&fail_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with RPC service
- const uint32_t session_id_fail =
- connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_ON, NULL);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_fail);
+ EXPECT_EQ(0u, fail_context.new_session_id_);
#else
- EXPECT_EQ(1u, session_id_fail);
+ EXPECT_EQ(1u, fail_context.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kRPC with encryption
@@ -1187,19 +1574,23 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(kControl);
SetSpecificServices();
// Start new session with RPC service
- const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_ON, &out_hash_id_);
- EXPECT_NE(0u, session_id);
- EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_);
-
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, positive_context.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
+ positive_context.hash_id_);
+#ifdef ENABLE_SECURITY
// Protection steal FALSE because of APPlink Protocol implementation
- CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF);
+ CheckService(uid_, positive_context.new_session_id_, kRpc);
+#endif // ENABLE_SECURITY
}
TEST_F(ConnectionHandlerTest,
SessionStarted_StartService_SecureSpecific_Unprotect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
// Forbid start kAudio without encryption
protected_services_.push_back(UnnamedService::kServedService1);
@@ -1207,13 +1598,23 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(UnnamedService::kServedService2);
protected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext context_first, context_second;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_first))
+ .WillOnce(SaveArg<0>(&context_second));
+
// Start new session with Audio service
- const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id2);
+ EXPECT_EQ(0u, context_first.new_session_id_);
#else
- EXPECT_EQ(1u, session_id2);
+ EXPECT_EQ(1u, context_first.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kAudio without encryption
protected_services_.clear();
@@ -1222,16 +1623,20 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(UnnamedService::kServedService2);
protected_services_.push_back(kControl);
SetSpecificServices();
- const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
// Returned original session id
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
- CheckService(uid_, session_id3, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(out_context_.new_session_id_, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_second.hash_id_);
+ CheckService(
+ uid_, context_second.new_session_id_, kRpc, NULL, PROTECTION_OFF);
#else
- EXPECT_EQ(0u, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_second.hash_id_);
#endif // ENABLE_SECURITY
}
@@ -1239,6 +1644,8 @@ TEST_F(ConnectionHandlerTest,
SessionStarted_StartService_SecureSpecific_Protect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
// Forbid start kAudio with encryption
unprotected_services_.push_back(UnnamedService::kServedService1);
@@ -1246,69 +1653,98 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(UnnamedService::kServedService2);
unprotected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext rejected_context, positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&rejected_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with Audio service
- const uint32_t session_id_reject =
- connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, NULL);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_reject);
+ EXPECT_EQ(0u, rejected_context.new_session_id_);
#else
- EXPECT_EQ(1u, session_id_reject);
+ EXPECT_EQ(1u, rejected_context.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kAudio with encryption
unprotected_services_.clear();
SetSpecificServices();
- const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
// Returned original session id
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
- CheckService(uid_, session_id3, kAudio, NULL, PROTECTION_ON);
+ EXPECT_EQ(out_context_.new_session_id_, positive_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, positive_context.hash_id_);
+ CheckService(
+ uid_, positive_context.new_session_id_, kAudio, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
- CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+ EXPECT_EQ(0u, positive_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, positive_context.hash_id_);
#endif // ENABLE_SECURITY
}
TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext context_new, context_second, context_third;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_new))
+ .WillOnce(SaveArg<0>(&context_second))
+ .WillOnce(SaveArg<0>(&context_third));
// Start RPC protection
- const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kRpc, PROTECTION_ON, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kRpc,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id_new);
+ EXPECT_EQ(out_context_.new_session_id_, context_new.new_session_id_);
// Post protection nedd no hash
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_ON);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_new.hash_id_);
+ CheckService(uid_, context_new.new_session_id_, kRpc, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id_new);
+ EXPECT_EQ(0u, context_new.new_session_id_);
// Post protection nedd no hash
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_new.hash_id_);
#endif // ENABLE_SECURITY
// Start Audio session without protection
- const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
- EXPECT_EQ(start_session_id_, session_id2);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
- CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_second.hash_id_);
+ CheckService(uid_, context_second.new_session_id_, kAudio);
// Start Audio protection
- const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_);
- CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_ON);
+ EXPECT_EQ(out_context_.new_session_id_, context_third.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_third.hash_id_);
+ CheckService(
+ uid_, context_third.new_session_id_, kAudio, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
- CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF);
+ EXPECT_EQ(0u, context_third.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_third.hash_id_);
#endif // ENABLE_SECURITY
}
@@ -1316,14 +1752,20 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) {
AddTestDeviceConnection();
AddTestSession();
- const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kBulk, PROTECTION_ON, NULL);
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kBulk,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id_new);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_ON);
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_, new_context.new_session_id_, kRpc, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id_new);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(0u, new_context.new_session_id_);
#endif // ENABLE_SECURITY
}
@@ -1402,6 +1844,9 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) {
testing::StrictMock<security_manager_test::MockSSLContext> mock_ssl_context;
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
EXPECT_EQ(
connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
::security_manager::SecurityManager::ERROR_SUCCESS);
@@ -1412,11 +1857,24 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) {
// kAudio is not exists yet
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// Open kAudio service
- const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, NULL);
- EXPECT_EQ(session_id, start_session_id_);
- CheckService(uid_, session_id, kAudio, &mock_ssl_context, PROTECTION_ON);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(new_context.new_session_id_, out_context_.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kAudio,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kAudio is not exists yet
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
@@ -1437,11 +1895,23 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) {
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// Protect kRpc (Bulk will be protect also)
- const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kRpc, PROTECTION_ON, NULL);
- EXPECT_EQ(start_session_id_, session_id);
- CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kRpc,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kRpc,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kRpc is protected
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
@@ -1465,11 +1935,23 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) {
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// Protect Bulk (kRpc will be protected also)
- const uint32_t session_id = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kBulk, PROTECTION_ON, NULL);
- EXPECT_EQ(start_session_id_, session_id);
- CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kBulk,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kRpc,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kRpc is protected
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
@@ -1485,8 +1967,9 @@ TEST_F(ConnectionHandlerTest, SendHeartBeat) {
AddTestDeviceConnection();
AddTestSession();
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendHeartBeat(uid_, start_session_id_));
- connection_handler_->SendHeartBeat(uid_, start_session_id_);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendHeartBeat(uid_, out_context_.new_session_id_));
+ connection_handler_->SendHeartBeat(uid_, out_context_.new_session_id_);
}
TEST_F(ConnectionHandlerTest, RunAppOnDevice_NoAppOnDevice_UNSUCCESS) {
@@ -1523,6 +2006,228 @@ TEST_F(ConnectionHandlerTest, RunAppOnDevice_AppOnDevice_SUCCESS) {
connection_handler_->RunAppOnDevice(hash_of_mac_address, bundle_id);
}
+TEST_F(ConnectionHandlerTest, OnDeviceConnectionSwitching) {
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ const transport_manager::DeviceInfo device_info_1(
+ device_handle_, mac_address_, device_name_, connection_type_);
+
+ connection_handler_->OnDeviceAdded(device_info_1);
+
+ const auto second_mac_address = "second_mac_address";
+ const transport_manager::DeviceInfo device_info_2(device_handle_ + 1,
+ second_mac_address,
+ "second_device_name",
+ "second_connection_type");
+
+ connection_handler_->OnDeviceAdded(device_info_2);
+
+ connection_handler::Device d1(device_info_1.device_handle(),
+ device_info_1.name(),
+ device_info_1.mac_address(),
+ device_info_1.connection_type());
+
+ connection_handler::Device d2(device_info_2.device_handle(),
+ device_info_2.name(),
+ device_info_2.mac_address(),
+ device_info_2.connection_type());
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnDeviceSwitchingStart(SameDevice(d1), SameDevice(d2)));
+
+ connection_handler_->OnDeviceSwitchingStart(mac_address_, second_mac_address);
+}
+
+TEST_F(ConnectionHandlerTest, StartStopSecondarySession) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Start new session with RPC service
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ // Start a session on a secondary transport
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 2u;
+ // Add Device and connection
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, secondary_uid);
+
+ AddSecondaryTestService(kAudio);
+ AddSecondaryTestService(kMobileNav);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, true);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, true);
+
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kAudio, _)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kMobileNav, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ st = connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, false);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, false);
+}
+
+TEST_F(ConnectionHandlerTest, StopSecondarySession_NoService) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 123u;
+ ON_CALL(mock_connection_handler_settings_, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ // check if OnSecondaryTransportEndedCallback is triggered with correct
+ // session ID even if we don't have any services
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_));
+ EXPECT_CALL(mock_connection_handler_observer, OnServiceEndedCallback(_, _, _))
+ .Times(0);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_valid) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(uid_);
+ EXPECT_EQ(connection_type_, ret);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_invalid) {
+ AddTestDeviceConnection();
+
+ transport_manager::ConnectionUID invalid_uid = 12345;
+ ASSERT_TRUE(invalid_uid != uid_);
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(
+ invalid_uid);
+ EXPECT_EQ(std::string(), ret);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateSuccess) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is 0
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = 200;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateFailure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 300;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is already assigned
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ st = connection_handler_->SetSecondaryTransportID(session_id, 500);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is NOT updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_OverwirteSecondaryUID) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 200;
+ transport_manager::ConnectionUID secondary_uid = 500;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = kDisabledSecondary;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_Failure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ uint8_t invalid_session_id = 10;
+ secondary_uid = 300;
+ st = connection_handler_->SetSecondaryTransportID(invalid_session_id,
+ secondary_uid);
+ EXPECT_EQ(0u, st.primary_transport);
+ EXPECT_EQ(0u, st.secondary_transport);
+}
+
} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index 85f43f3785..98b83f5fc4 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -36,12 +36,15 @@
#include "protocol/common.h"
#include "connection_handler/connection.h"
+#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/connection_handler_impl.h"
#include "protocol/service_type.h"
#include "connection_handler/mock_connection_handler_settings.h"
#include "transport_manager/mock_transport_manager.h"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#define EXPECT_RETURN_TRUE true
#define EXPECT_RETURN_FALSE false
@@ -54,6 +57,8 @@ namespace connection_handler_test {
using namespace ::connection_handler;
using namespace ::protocol_handler;
+using ::testing::Return;
+
class ConnectionTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
@@ -71,7 +76,12 @@ class ConnectionTest : public ::testing::Test {
delete connection_handler_;
}
void StartSession() {
- session_id = connection_->AddNewSession();
+ StartDefaultSession();
+ connection_->UpdateProtocolVersionSession(
+ session_id, protocol_handler::PROTOCOL_VERSION_3);
+ }
+ void StartDefaultSession() {
+ session_id = connection_->AddNewSession(kDefaultConnectionHandle);
EXPECT_NE(session_id, 0u);
const SessionMap sessionMap = connection_->session_map();
EXPECT_FALSE(sessionMap.empty());
@@ -81,13 +91,14 @@ class ConnectionTest : public ::testing::Test {
std::find(serviceList.begin(), serviceList.end(), kRpc);
const bool found_result = (it != serviceList.end());
EXPECT_TRUE(found_result);
+ EXPECT_EQ(connection_->primary_connection_handle(), 0);
}
void AddNewService(const ServiceType service_type,
const bool protection,
const bool expect_add_new_service_call_result,
const bool expect_exist_service) {
- const bool result =
- connection_->AddNewService(session_id, service_type, protection);
+ const bool result = connection_->AddNewService(
+ session_id, service_type, protection, kDefaultConnectionHandle);
EXPECT_EQ(result, expect_add_new_service_call_result);
#ifdef ENABLE_SECURITY
@@ -103,12 +114,35 @@ class ConnectionTest : public ::testing::Test {
std::find(newServiceList.begin(), newServiceList.end(), service_type);
const bool found_result = it != newServiceList.end();
EXPECT_EQ(expect_exist_service, found_result);
-#ifdef ENABLE_SECURITY
if (found_result) {
const Service& service = *it;
+ transport_manager::ConnectionUID expected_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_connection_handle);
+#ifdef ENABLE_SECURITY
EXPECT_EQ(service.is_protected_, protection);
- }
#endif // ENABLE_SECURITY
+ }
+ }
+ void AddNewSecondaryService(const ServiceType service_type) {
+ const bool result = connection_->AddNewService(
+ session_id, service_type, false, kSecondaryConnectionHandle);
+ EXPECT_EQ(result, true);
+
+ const SessionMap session_map = connection_->session_map();
+ EXPECT_FALSE(session_map.empty());
+ const ServiceList newServiceList = session_map.begin()->second.service_list;
+ EXPECT_FALSE(newServiceList.empty());
+ const ServiceList::const_iterator it =
+ std::find(newServiceList.begin(), newServiceList.end(), service_type);
+ const bool found_result = it != newServiceList.end();
+ EXPECT_TRUE(found_result);
+ if (found_result) {
+ const Service& service = *it;
+ transport_manager::ConnectionUID expected_secondary_connection_handle =
+ kSecondaryConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_secondary_connection_handle);
+ }
}
void RemoveService(const ServiceType service_type,
@@ -134,6 +168,8 @@ class ConnectionTest : public ::testing::Test {
transport_manager_mock;
ConnectionHandlerImpl* connection_handler_;
uint32_t session_id;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const transport_manager::ConnectionUID kSecondaryConnectionHandle = 2;
};
TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
@@ -142,13 +178,13 @@ TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
}
TEST_F(ConnectionTest, Session_GetDefaultProtocolVersion) {
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version;
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
EXPECT_EQ(static_cast<uint8_t>(PROTOCOL_VERSION_2), protocol_version);
}
TEST_F(ConnectionTest, Session_UpdateProtocolVersion) {
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_3);
connection_->UpdateProtocolVersionSession(session_id, protocol_version);
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
@@ -157,7 +193,7 @@ TEST_F(ConnectionTest, Session_UpdateProtocolVersion) {
TEST_F(ConnectionTest, HeartBeat_NotSupported) {
// Arrange
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version;
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
EXPECT_EQ(static_cast<uint8_t>(PROTOCOL_VERSION_2), protocol_version);
@@ -201,15 +237,45 @@ TEST_F(ConnectionTest, HeartBeat_Protocol4_ZeroHeartBeat_NotSupported) {
EXPECT_FALSE(connection_->SupportHeartBeat(session_id));
}
+TEST_F(ConnectionTest, HeartBeat_Protocol5_PositiveHeartBeat_Supported) {
+ // Arrange
+ StartSession();
+ // Check execution if protocol version is 5
+ const uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_5);
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_TRUE(connection_->SupportHeartBeat(session_id));
+}
+
+TEST_F(ConnectionTest, HeartBeat_Protocol5_ZeroHeartBeat_NotSupported) {
+ // Correctc of connection (need connection with heartbeat=0)
+ delete connection_;
+ connection_ = 0;
+
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0u;
+ const uint32_t heart_beat = 0u;
+ connection_ = new Connection(
+ connectionHandle, device_handle, connection_handler_, heart_beat);
+ StartSession();
+ // Check execution if protocol version is 5
+ const uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_5);
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_FALSE(connection_->SupportHeartBeat(session_id));
+}
+
// Try to add service without session
TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) {
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
}
@@ -376,6 +442,133 @@ TEST_F(ConnectionTest, RemoveSession) {
EXPECT_EQ(0u, connection_->RemoveSession(session_id));
}
+TEST_F(ConnectionTest, AddNewSession_VerifyAddSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 2;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+ EXPECT_EQ(mock_session_id, sid);
+
+ EXPECT_CALL(mock_connection_handler, RemoveSession(mock_session_id))
+ .WillOnce(Return(true)); // invoked by destructor of connection
+ delete connection;
+}
+
+TEST_F(ConnectionTest, RemoveSession_VerifyRemoveSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 10;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+ EXPECT_CALL(mock_connection_handler,
+ RemoveSession(static_cast<uint8_t>(mock_session_id)))
+ .WillOnce(Return(true));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+
+ uint32_t ret = connection->RemoveSession(sid);
+ EXPECT_EQ(sid, ret);
+
+ delete connection;
+}
+
+TEST_F(ConnectionTest, SecondarySessionTest) {
+ StartSession();
+ AddNewService(
+ kRpc, PROTECTION_OFF, EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0u;
+ const uint32_t heart_beat = 0u;
+ Connection* secondary_connection = new Connection(
+ connectionHandle, device_handle, connection_handler_, heart_beat);
+
+ secondary_connection->SetPrimaryConnectionHandle(kDefaultConnectionHandle);
+ connection_handler::ConnectionHandle expected_primary_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(secondary_connection->primary_connection_handle(),
+ expected_primary_connection_handle);
+
+ AddNewSecondaryService(kAudio);
+ AddNewSecondaryService(kMobileNav);
+
+ delete secondary_connection;
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_SUCCESS) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+ size_t services_count = sizeof(services) / sizeof(services[0]);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(session_id, ret_session_id);
+ // check returned list
+ EXPECT_EQ(services_count, removed_services.size());
+ std::list<protocol_handler::ServiceType>::iterator it;
+ it = std::find(removed_services.begin(), removed_services.end(), services[0]);
+ EXPECT_TRUE(it != removed_services.end());
+ it = std::find(removed_services.begin(), removed_services.end(), services[1]);
+ EXPECT_TRUE(it != removed_services.end());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_NoService) {
+ StartSession();
+ /* do not call AddNewSecondaryService() */
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_InvalidConnectionHandle) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+
+ transport_manager::ConnectionUID invalid_connection_handle = 123;
+ ASSERT_TRUE(kSecondaryConnectionHandle != invalid_connection_handle);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ invalid_connection_handle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ConnectionTest, SetSSLContextWithoutSession) {
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index 4c67c97191..ccfff34116 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -43,6 +43,7 @@ namespace {
const int32_t MILLISECONDS_IN_SECOND = 1000;
const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
+const uint32_t kTime_offset = 20u;
}
namespace test {
@@ -51,27 +52,34 @@ namespace connection_handler_test {
using ::testing::DoAll;
using ::testing::_;
+using ::testing::Return;
class HeartBeatMonitorTest : public testing::Test {
public:
- HeartBeatMonitorTest() : conn(NULL) {
- kTimeout = 5000u;
- }
+ HeartBeatMonitorTest()
+ : connection_(NULL)
+ , timeout_(100u)
+ , time_allowance_multiplier_(1.5)
+ , expiration_timeout_(timeout_ * 2u) {}
protected:
- testing::NiceMock<MockConnectionHandler> connection_handler_mock;
- connection_handler::Connection* conn;
- uint32_t kTimeout;
- static const connection_handler::ConnectionHandle kConnectionHandle =
+ testing::NiceMock<MockConnectionHandler> connection_handler_mock_;
+ connection_handler::Connection* connection_;
+ const uint32_t timeout_;
+ const float_t time_allowance_multiplier_;
+ const uint32_t expiration_timeout_;
+ static const connection_handler::ConnectionHandle connection_handle_ =
0xABCDEF;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const uint32_t kDefaultSessionId = 1;
- virtual void SetUp() {
- conn = new connection_handler::Connection(
- kConnectionHandle, 0, &connection_handler_mock, kTimeout);
+ void SetUp() OVERRIDE {
+ connection_ = new connection_handler::Connection(
+ connection_handle_, 0, &connection_handler_mock_, timeout_);
}
void TearDown() OVERRIDE {
- delete conn;
+ delete connection_;
}
};
@@ -80,159 +88,191 @@ ACTION_P2(RemoveSession, conn, session_id) {
}
TEST_F(HeartBeatMonitorTest, TimerNotStarted) {
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // called by destructor of Connection
+
// Whithout StartHeartBeat nothing to be call
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
- conn->AddNewSession();
+ connection_->AddNewSession(kDefaultConnectionHandle);
}
TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
- const uint32_t session = conn->AddNewSession();
- conn->StartHeartBeat(session);
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
+ connection_->StartHeartBeat(session);
}
TEST_F(HeartBeatMonitorTest, TimerElapsed) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // invoked by RemoveSession action
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, session, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, session)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, session))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- conn->StartHeartBeat(session);
+ connection_->StartHeartBeat(session);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, KeptAlive) {
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
-
- const uint32_t session = conn->AddNewSession();
- conn->StartHeartBeat(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
+ connection_->StartHeartBeat(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
}
TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t session = connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, session))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, session, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, session)));
times++;
- conn->StartHeartBeat(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
- conn->KeepAlive(session);
- usleep(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+ connection_->StartHeartBeat(session);
+ usleep(timeout_);
+ connection_->KeepAlive(session);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
- const uint32_t kSession1 = conn->AddNewSession();
- const uint32_t kSession2 = conn->AddNewSession();
+ const uint32_t kMockSessionId1 = 1;
+ const uint32_t kMockSessionId2 = 2;
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kMockSessionId1))
+ .WillOnce(Return(kMockSessionId2));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kMockSessionId1))
+ .WillOnce(Return(true));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kMockSessionId2))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession1 =
+ connection_->AddNewSession(kDefaultConnectionHandle);
+
+ const transport_manager::ConnectionUID kAnotherConnectionHandle = 2;
+ const uint32_t kSession2 =
+ connection_->AddNewSession(kAnotherConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession1, _))
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession1, _))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
- RemoveSession(conn, kSession1)));
+ RemoveSession(connection_, kSession1)));
times++;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession2, _))
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession2, _))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
- RemoveSession(conn, kSession2)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ RemoveSession(connection_, kSession2)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession1))
+
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession1))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession2))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession2))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- conn->StartHeartBeat(kSession1);
- conn->StartHeartBeat(kSession2);
+ connection_->StartHeartBeat(kSession1);
+ connection_->StartHeartBeat(kSession2);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession =
+ connection_->AddNewSession(kDefaultConnectionHandle);
- EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
- EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, _)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, CloseConnection(_)).Times(0);
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, _)).Times(0);
- const uint32_t kNewTimeout = kTimeout + MICROSECONDS_IN_MILLISECONDS;
- conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout, kSession);
+ const uint32_t kNewTimeout = timeout_ + MICROSECONDS_IN_MILLISECONDS;
+ connection_->StartHeartBeat(kSession);
+ connection_->SetHeartBeatTimeout(kNewTimeout, kSession);
}
TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock_, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock_, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession =
+ connection_->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession, _))
- .WillOnce(
- DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, kSession)));
- times++;
- EXPECT_CALL(connection_handler_mock, CloseConnection(_))
- .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(connection_handler_mock_, CloseSession(_, kSession, _))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(connection_, kSession)));
times++;
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession))
+ EXPECT_CALL(connection_handler_mock_, SendHeartBeat(_, kSession))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
- const uint32_t kNewTimeout = kTimeout - MICROSECONDS_IN_MILLISECONDS;
- conn->StartHeartBeat(kSession);
- conn->SetHeartBeatTimeout(kNewTimeout, kSession);
+ const uint32_t new_timeout = timeout_ - kTime_offset;
+ connection_->StartHeartBeat(kSession);
+ connection_->SetHeartBeatTimeout(new_timeout, kSession);
EXPECT_TRUE(waiter.WaitFor(
times,
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
+ 2 * timeout_ * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
} // namespace connection_handler_test
diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
deleted file mode 100644
index 211310d885..0000000000
--- a/src/components/dbus/CMakeLists.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (c) 2016, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories (
- ${DBUS_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}/include/
- ${CMAKE_SOURCE_DIR}/
- ${COMPONENTS_DIR}
- ${COMPONENTS_DIR}/formatters/include/
- ${COMPONENTS_DIR}/smart_objects/include/
- ${COMPONENTS_DIR}/utils/include/
- ${CMAKE_BINARY_DIR}/src/components/
-)
-
-set(PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
- ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
-)
-collect_sources(SOURCES "${PATHS}")
-
-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}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
-)
-
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
- COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
-)
-
-add_library("DBus" ${SOURCES})
-add_dependecnies("DBus" Utils install-3rd_party_dbus)
-
-target_link_libraries("DBus" "${LIBRARIES}")
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif()
diff --git a/src/components/dbus/codegen/code_formatter.py b/src/components/dbus/codegen/code_formatter.py
deleted file mode 100644
index c3eb1b7815..0000000000
--- a/src/components/dbus/codegen/code_formatter.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file code_formatter.py
-# @brief Utility that helps to manage indents in generated code
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-class CodeBlock:
- indent = 0
- def __init__(self, out):
- self.out = out
- if type(out) == file:
- self.indent = 0
- elif type(out) == CodeBlock:
- self.indent = out.indent
- def __enter__(self):
- self.indent += 1
- return self
- def __exit__(self, exc_type, exc_value, traceback):
- if self.indent >= 1:
- self.indent -= 1
- def write(self, s):
- for string in s.splitlines(True):
- self.out.write(' ' * self.indent + string)
-
-# vim: set ts=4 sw=4 et:
-
diff --git a/src/components/dbus/codegen/ford_xml_parser.py b/src/components/dbus/codegen/ford_xml_parser.py
deleted file mode 100644
index 4f9f222d24..0000000000
--- a/src/components/dbus/codegen/ford_xml_parser.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file ford_xml_parser.py
-# @brief Parser for HMI_API.xml
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from xml.etree import ElementTree
-from collections import OrderedDict
-
-node_name = '/com/ford/hmi'
-
-class ParamDesc:
- pass
-
-class FordXmlParser:
- def __init__(self, in_el_tree, interface_path=None):
- self.interface_path = interface_path
- self.el_tree = in_el_tree
- self.find_enums()
- self.find_structs()
-
- def find_enums(self):
- self.enums = dict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for enum_el in interface_el.findall('enum'):
- enum_name = enum_el.get('name')
- self.enums[(interface_name,enum_name)] = enum_el
-
-
- def make_param_desc(self, param_el, iface=None):
- param_desc = ParamDesc()
- param_desc.name = param_el.get('name')
- param_desc.type = param_el.get('type')
- param_desc.enum = False
- param_desc.struct = False
- param_desc.fulltype = param_desc.type
- if param_el.get('mandatory') == 'false':
- param_desc.mandatory = False
- else:
- param_desc.mandatory = True
- if param_el.get('array') == 'true':
- param_desc.array = True
- else:
- param_desc.array = False
- param_desc.minValue = param_el.get('minvalue') if param_el.get('minvalue') else 0
- param_desc.maxValue = param_el.get('maxvalue')
- param_desc.minLength = param_el.get('minlength') if param_el.get('minlength') else 0
- param_desc.maxLength = param_el.get('maxlength')
- param_desc.minSize = param_el.get('minsize')
- param_desc.maxSize = param_el.get('maxsize')
-
- param_desc.restricted = param_desc.minValue != None or \
- param_desc.maxValue != None or \
- param_desc.minLength > 0 or \
- param_desc.maxLength > 0
- param_desc.restrictedArray = param_desc.array and (param_desc.minSize > 0 or param_desc.maxSize > 0)
- if iface is None:
- return param_desc
- if param_desc.type not in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param_desc.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (iface, param_type[0])
- param_desc.fulltype = param_type
- if param_type in self.enums: param_desc.enum = True
- elif param_type in self.structs: param_desc.struct = True
- return param_desc
-
-
- def find_structs(self):
- self.structs = OrderedDict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- self.structs[(interface_name, struct_name)] = []
-
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- for param_el in struct_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface_name)
- self.structs[(interface_name, struct_name)].append(param_desc)
-
-
- def convert_struct_to_dbus(self, param_type):
- ret = '('
- struct = self.structs[param_type]
- for param in struct:
- ret = ret + self.convert_to_dbus_type(param)
- ret = ret + ')'
- return ret
-
-
- def convert_to_dbus_type(self, param):
- if param.type == 'Integer': restype = 'i'
- elif param.type == 'String': restype = 's'
- elif param.type == 'Boolean': restype = 'b'
- elif param.type == 'Float': restype = 'd' # D-Bus double
- elif param.enum: restype = 'i' # D-Bus 32-bit signed int
- elif param.struct: restype = self.convert_struct_to_dbus(param.fulltype)
- else: raise RuntimeError('Unknown type: ' + param.type)
- if param.array: restype = 'a' + restype
- if not param.mandatory: restype = '(b' + restype + ')'
- return restype
-
-
- def find_notifications(self, interface_el):
- notifications = list()
- for function_el in interface_el.findall('function[@messagetype="notification"]'):
- notifications.append(function_el)
- return notifications
-
-
- def find_notifications_by_provider(self, interface_el, provider):
- notifications = list()
- condition = 'function[@messagetype="notification"][@provider="%s"]' % provider
- for function_el in interface_el.findall(condition):
- notifications.append(function_el)
- return notifications
-
-
- def find_request_response_pairs(self, interface_el):
- result = list()
- request_els = interface_el.findall('function[@messagetype="request"]')
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def find_request_response_pairs_by_provider(self, interface_el, provider):
- result = list()
- condition = 'function[@messagetype="request"][@provider="%s"]' % provider
- request_els = interface_el.findall(condition)
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def convert_to_signal(self, notification_el, interface):
- result = ElementTree.Element('signal')
- result.set('name', notification_el.get('name'))
- for param_el in notification_el.findall('param'):
- self.create_arg_element(result, param_el, interface)
- return result
-
-
- def convert_to_method(self, (request_el, response_el), interface):
- result = ElementTree.Element('method')
- result.set('name', request_el.get('name'))
- for param_el in request_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'in')
-
- arg_el = ElementTree.SubElement(result, 'arg')
- arg_el.set('name', 'retCode')
- arg_el.set('type', 'i')
- arg_el.set('direction', 'out')
-
- for param_el in response_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'out')
- return result
-
-
- def create_arg_element(self, parent, param_el, interface):
- arg_el = ElementTree.SubElement(parent, 'arg')
- arg_el.set('name', param_el.get('name'))
- arg_el.set('type', self.convert_to_dbus_type(self.make_param_desc(param_el, interface)))
- return arg_el
-
-
- def create_introspection_iface_el(self, interface_el, provider):
- interface = interface_el.get('name')
- interface_name = self.interface_path + '.' + interface
-
- notifications = self.find_notifications_by_provider(interface_el, provider)
- signals = [self.convert_to_signal(n, interface) for n in notifications]
-
- request_responses = self.find_request_response_pairs_by_provider(interface_el, provider)
- methods = [self.convert_to_method(r, interface) for r in request_responses]
-
- if signals or methods:
- el = ElementTree.Element('interface', attrib={'name':interface_name})
- for m in methods: el.append(m)
- for s in signals: el.append(s)
- return el
-
-
-
diff --git a/src/components/dbus/codegen/make_hmi_requests.py b/src/components/dbus/codegen/make_hmi_requests.py
deleted file mode 100755
index 4716d40439..0000000000
--- a/src/components/dbus/codegen/make_hmi_requests.py
+++ /dev/null
@@ -1,343 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_requests_classes_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_full_name = interface_el.get('name') + '_' +request.get('name')
- out.write('class ' + request_full_name + ': public HMIRequest {\n')
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write(' public:\n')
- with CodeBlock(out) as output:
- output.write(request_full_name + '(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name):\n')
- output.write(' HMIRequest(hmi_callback, interface, args, name) {}\n')
- out.write(' private:\n')
- with CodeBlock(out) as output:
- output.write('QJSValueList fillArgsList();\n};\n\n')
-
-
- def make_header_file(self, out):
- out.write("namespace requests {\n")
- out.write("class HMIRequest: public QObject {\n")
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write('public:\n')
- with CodeBlock(out) as output:
- output.write('HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name );\n')
- out.write('protected:\n')
- with CodeBlock(out) as output:
- output.write('virtual QJSValueList fillArgsList() = 0;\n')
- output.write('QDBusPendingCallWatcher *watcher_;\n')
- output.write('QJSValue hmi_callback_;\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(T value) {\n')
- output.write(' return QJSValue(value);\n')
- output.write('}\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(QList<T> value) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValue array = hmi_callback_.engine()->newArray();\n')
- output.write('int i = 0;\n')
- output.write('foreach (T item, value) {\n')
- output.write(' QJSValue value = CreateQJSValue(item);\n')
- output.write(' array.setProperty(i, value);\n')
- output.write(' ++i;\n')
- output.write('}\n')
- output.write('return array;\n')
- output.write('}\n')
- out.write('private:\n')
- with CodeBlock(out) as output:
- output.write('QDBusInterface *interface_;\n')
- output.write('QList<QVariant> args_;\n')
- out.write('public slots:\n')
- with CodeBlock(out) as output:
- output.write('void invokeCallback();\n')
- out.write('};\n\n')
- output.write('template<>\n')
- output.write('QJSValue HMIRequest::CreateQJSValue(QStringList value);\n')
- for (interface_name, struct_name) in self.structs:
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_name + ' value);\n\n')
- impl.make_requests_classes_header(out)
- out.write("} // namespace requests\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def make_requests_methods_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' +request.get('name')
- out.write('QJSValueList ' + request_full_name + '::fillArgsList() {\n')
- out.write(' QDBusPendingReply< ')
- count = 0
- for param_el in response.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- out.write(self.qt_param_type(param))
- count += 1
- if count < len(response.findall('param')):
- out.write(',')
- out.write(' > reply = *watcher_;\n')
-
- with CodeBlock(out) as out:
- out.write('QJSValueList qjsValueList;\n\n')
- out.write('QJSValue param;\n\n')
- count = 0
- for param_el in response.findall('param'):
- if param_el.get('mandatory') == 'false':
- out.write('if (reply.argumentAt<' + str(count) + '>().presence) {\n')
- out.write(' param = CreateQJSValue(reply.argumentAt<' + str(count) + '>().val);\n')
- out.write('} else {\n')
- out.write(' param = QJSValue();\n')
- out.write('}\n')
- out.write('qjsValueList.append(param);\n')
- else:
- out.write('param = CreateQJSValue(reply.argumentAt<' + str(count) + '>());\n')
- out.write('qjsValueList.append(param);\n')
- count += 1
- out.write('return qjsValueList;\n')
- out.write('}\n\n')
-
-
- def make_source_file(self, out):
- out.write("namespace requests {\n")
- for interface_el in self.el_tree.findall('interface'):
- for struct_el in interface_el.findall('struct'):
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_el.get('name') + ' value){\n')
- with CodeBlock(out) as output:
- output.write('QJSValue object = hmi_callback_.engine()->newObject();\n')
- for param_el in struct_el.findall('param'):
- param_name = param_el.get('name')
- if param_el.get('mandatory') == 'true':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", CreateQJSValue(value.' + param_name + '));\n')
- elif param_el.get('mandatory') == 'false':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", value.' + param_name + '.presence ? CreateQJSValue(value.' + param_name + '.val) : QJSValue());\n')
- out.write('return object;\n')
- out.write('}\n\n')
-
-
- out.write('HMIRequest::HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name) :\n')
- out.write(' hmi_callback_(hmi_callback), interface_(interface), args_(args) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusPendingCall pcall = interface->asyncCallWithArgumentList(name, args);\n')
- output.write('watcher_ = new QDBusPendingCallWatcher(pcall);\n')
- output.write('QObject::connect(watcher_, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(invokeCallback()));\n}\n\n')
- out.write('void HMIRequest::invokeCallback() {\n')
- with CodeBlock(out) as output:
- output.write('if (!hmi_callback_.isUndefined()) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValueList qjsValueList;\n')
- output.write('qjsValueList = this->fillArgsList();\n')
- output.write('hmi_callback_.call(qjsValueList);\n')
- output.write('}\n')
- output.write('watcher_->deleteLater();\n')
- output.write('this->deleteLater();\n}\n\n')
- impl.make_requests_methods_source(out)
- out.write("} // namespace requests\n")
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'hmi_requests.h'
-source_name = 'hmi_requests.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file hmi_requests.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QDBusPendingCall>\n");
-header_out.write("#include <QDBusPendingCallWatcher>\n");
-header_out.write('#include <QDBusPendingReply>\n');
-header_out.write("#include <QDBusAbstractInterface>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write("#include <QJSEngine>\n");
-
-header_out.write('#include "qml_dbus.h"\n\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file hmi_requests.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-source_out.write('#include "hmi_requests.h"\n\n')
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_introspection_c.py b/src/components/dbus/codegen/make_introspection_c.py
deleted file mode 100755
index 22a53f308d..0000000000
--- a/src/components/dbus/codegen/make_introspection_c.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_introspection_c.py
-# @brief Converts introspection.xml to C-string
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-from ford_xml_parser import FordXmlParser
-from ford_xml_parser import node_name
-from xml.etree import ElementTree
-from os import path
-from sys import argv
-
-class Impl(FordXmlParser):
- def convert_to_introspection(self, out_el_tree):
- for interface_el in self.el_tree.findall('interface'):
- el = self.create_introspection_iface_el(interface_el, 'sdl')
- if el is not None:
- out_el_tree.append(el)
-
-arg_parser = ArgumentParser(description='Converts introspection.xml to C-string')
-arg_parser.add_argument('--infile', required=True, help="Full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="Path to directory where output file introspection_xml.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-out_file = open(args.outdir + '/' + 'introspection_xml.cc', "w")
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-out_tree_root = ElementTree.Element('node', attrib={'name':node_name})
-
-impl = Impl(in_tree_root, 'com.ford.hmi.sdl')
-impl.convert_to_introspection(out_tree_root)
-
-introspection_string = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">'
-introspection_string += "\n"
-introspection_string += ElementTree.tostring(out_tree_root)
-
-out_file.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out_file.write("""/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-
-out_file.write("char introspection_xml[] = {")
-
-cnt = 0
-for char in introspection_string:
- if cnt % 12 == 0:
- out_file.write("\n ")
- else:
- out_file.write(" ")
- out_file.write("0x%02x," % ord(char))
- cnt = cnt + 1
-
-out_file.write(" 0x00\n")
-out_file.write("};")
-
diff --git a/src/components/dbus/codegen/make_message_descriptions.py b/src/components/dbus/codegen/make_message_descriptions.py
deleted file mode 100755
index 0079666392..0000000000
--- a/src/components/dbus/codegen/make_message_descriptions.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_message_descriptions.py
-# @brief Generates HMI API message descriptions for D-Bus
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-from os import path
-from sys import argv
-
-namespace_name = 'ford_message_descriptions'
-namespace = namespace_name + '::'
-
-
-class Impl(FordXmlParser):
- def write_param_definition(self, param_var_name, param, out):
- if param.array:
- tmp_param = copy(param)
- tmp_param.array = False
- tmp_param.mandatory = True
- dbus_sig = self.convert_to_dbus_type(tmp_param)
- self.write_param_definition(param_var_name + '_array', tmp_param, out)
-
- if param.array: out.write('const ' + namespace + 'ArrayDescription ')
- elif param.struct: out.write('const ' + namespace + 'StructDescription ')
- else: out.write('const ' + namespace + 'ParameterDescription ')
-
- out.write(param_var_name + " = {\n")
-
- if param.struct or param.array:
- out.write(" {\n")
- shift = ' ' * 4
- else:
- shift = ' ' * 2
-
- out.write(shift + "\"" + param.name + "\",\n")
-
- if param.array:
- out.write(shift + namespace + "Array,\n")
- elif param.struct:
- out.write(shift + namespace + "Struct,\n")
- elif param.enum:
- out.write(shift + namespace + "Enum,\n")
- else:
- out.write(shift + namespace + param.type + ",\n")
-
- if param.mandatory:
- out.write(shift + "true\n")
- else:
- out.write(shift + "false\n")
-
- if param.struct or param.array:
- out.write(" },\n")
- if param.array:
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_var_name + "_array,\n")
- out.write(" \"" + dbus_sig + "\"\n")
- elif param.struct:
- out.write(" Structs::" + param.fulltype[0] + "__" + param.fulltype[1] + "__parameters\n")
- out.write("};\n")
-
-
- def write_struct_params_declarations(self, out):
- out.write("struct Structs {\n");
- for (interface, name), params in self.structs.iteritems():
- params_var_name = interface + '__' + name + '__parameters'
- out.write(" static const " + namespace + "ParameterDescription* " + params_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_enum_entries_declarations(self, out):
- out.write("struct Enums {\n");
- for interface, name in self.enums:
- entries_var_name = interface + '__' + name + '__entries'
- out.write(" static const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_parameters(self, params, out, name):
- n = 1
- for param in params:
- param_var_name = name + str(n)
- n = n + 1
- self.write_param_definition(param_var_name, param, out)
-
-
- def write_struct_params_definitions(self, out):
- for (interface, name), params in self.structs.iteritems():
- param_var_name = interface + '__' + name + '__parameter'
- self.write_parameters(params, out, param_var_name)
- params_var_name = 'Structs::' + interface + '__' + name + '__parameters'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + name + ",\n")
- out.write( " NULL };\n\n")
-
-
- def write_enum_entries_definitions(self, out):
- for (interface, name), enum_el in self.enums.iteritems():
- n = 1
- for element_el in enum_el.findall('element'):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- value = element_el.get("value")
- if value is None:
- value = str(n)
- out.write(namespace + "EnumDescription::Entry " + entry_var_name + " = {\"" + element_el.get("name") + "\", " + value + "};\n")
- n = n + 1
-
- entries_var_name = "Enums::" + interface + '__' + name + '__entries'
- out.write("const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[] = {\n")
- for n in range(1, len(enum_el.findall('element')) + 1):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- out.write(" &" + entry_var_name + ",\n")
- out.write(" NULL };\n\n")
-
-
- def write_message_definition(self, message_el, interface, out):
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- params = list()
- for param_el in message_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface)
- params.append(param_desc)
- param_var_name = interface + '__' + name + '__' + messagetype + '__parameter'
- self.write_parameters(params, out, param_var_name)
-
- params_var_name = param_var_name + 's'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- param_name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_name + ",\n")
- out.write(" NULL };\n")
-
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write("const " + namespace + "MessageDescription " + message_desc_name + " = {\n")
- out.write(" \"" + interface + "\",\n")
- out.write(" \"" + name + "\",\n")
- out.write(" hmi_apis::messageType::" + messagetype + ",\n")
- out.write(" hmi_apis::FunctionID::" + interface + "_" + name + ",\n")
- out.write(" " + params_var_name + "\n")
- out.write("};\n\n")
-
-
- def write_message_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- self.write_message_definition(message_el, interface, out)
-
-
- def make_message_descriptions(self, out):
- self.write_struct_params_declarations(out)
- #self.write_enum_entries_declarations(out)
- self.write_struct_params_definitions(out)
- #self.write_enum_entries_definitions(out)
- self.write_message_definitions(out)
-
-
- def make_message_array(self, out):
- out.write("const MessageDescription* message_descriptions[] = {\n")
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write(" &" + message_desc_name + ",\n")
- out.write(" NULL\n")
- out.write("};\n")
-
-
-arg_parser = ArgumentParser(description="Generates HMI API message descriptions for D-Bus on SDL core side")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output file message_descriptions.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-outfile = 'message_descriptions.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-out = open(args.outdir + "/" + outfile, "w")
-
-out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out.write("""/**
- * @file message_descriptions.cc
- * @brief Generated HMI API message descriptions for D-Bus
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-
-out.write("#include \"dbus/message_descriptions.h\"\n\n");
-out.write("namespace {\n\n");
-impl.make_message_descriptions(out)
-out.write("}\n\n");
-
-out.write("namespace " + namespace_name + " {\n\n");
-impl.make_message_array(out)
-out.write("}\n\n");
-
diff --git a/src/components/dbus/codegen/make_notifications_qml.py b/src/components/dbus/codegen/make_notifications_qml.py
deleted file mode 100755
index 3c173e8b4f..0000000000
--- a/src/components/dbus/codegen/make_notifications_qml.py
+++ /dev/null
@@ -1,387 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Notifications_qml(FordXmlParser):
- #Used for qt signal names, because qt signals cannot begin with a capital letter
- def first_letter_to_lower_case(self, s):
- if len(s) == 0:
- return s
- else:
- return s[0].lower() + s[1:]
-
- def make_header(self, out):
- out.write("class SdlProxy: public Item {\n")
- with CodeBlock(out) as out:
- out.write("Q_OBJECT\n")
- out.write("Q_DISABLE_COPY(SdlProxy)\n")
- out.write("public:\n")
- out.write("explicit SdlProxy(Item* parent = 0);\n")
- out.write("private:\n")
- out.write("QDBusInterface *sdlBasicCommunicationInterface;\n")
- out.write("signals:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("QVariant %s" % param_el.get("name"))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("private slots:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void slot_%s(" % notification_el.get("name"))
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def qml_param_type(self, param):
- if not param.mandatory:
- return "QVariant"
- if param.array:
- return "QVariant"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "QVariant"
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_source(self, out):
- def qml_args(variable_name_needed):
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- if variable_name_needed:
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- else:
- out.write("%s" % self.qt_param_type(param))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write("SdlProxy::SdlProxy(Item *parent): Item(parent) {\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notification_name = notification_el.get('name')
- with CodeBlock(out) as out:
- out.write("QDBusConnection::sessionBus().connect(\n")
- with CodeBlock(out) as out:
- out.write("\"com.ford.sdl.core\", \"/\", \"com.ford.sdl.core.%s\",\n" % iface_name)
- out.write("\"%s\", this, SLOT(slot_%s(" % (notification_name, notification_el.get("name")))
- qml_args(variable_name_needed = False)
- out.write(")));\n")
- out.write("}\n\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notific_full_name = interface_el.get("name") + "_" + notification_el.get("name")
- out.write("void SdlProxy::slot_%s(" % notification_el.get("name"))
- qml_args(variable_name_needed = True)
- out.write(") {\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER\");\n\n")
- for param_el in notification_el.findall("param"):
- param = self.make_param_desc(param_el, iface_name)
- tmp_param_name = param.name + "_qvariant"
- out.write("QVariant %s;\n" % tmp_param_name)
- out.write("%s = ValueToVariant(%s);\n" % (tmp_param_name, param.name))
- self.write_param_validation(param, param.name, "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\")" % (param.name, notific_full_name), out)
- out.write("\n")
- out.write("emit %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s" % param.name + "_qvariant")
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"EXIT\");\n")
- out.write("}\n\n")
-
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
-
-#QVarian name;
-#if (ttsName.presence) {
-
-
-
-arg_parser = ArgumentParser(description="Generator of classes which Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'sdl_proxy.h'
-source_name = 'sdl_proxy.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Notifications_qml(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n\n")
-header_out.write("#include \"qml_dbus.h\"\n")
-header_out.write("#include \"qt_version.h\"\n\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtDBus/QDBusInterface>\n")
-header_out.write("#if QT_4\n")
-header_out.write("#include <QtDeclarative/QDeclarativeItem>\n")
-header_out.write("typedef QDeclarativeItem Item;\n")
-header_out.write("#elif QT_5\n")
-header_out.write("#include <QtQuick/QQuickItem>\n")
-header_out.write("typedef QQuickItem Item;\n")
-header_out.write("#endif // QT_VERSION\n")
-
-impl.make_header(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-""")
-
-source_out.write("#include \"sdl_proxy.h\"\n")
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("CREATE_LOGGERPTR_GLOBAL(logger_, \"DBusPlugin\")\n\n")
-
-impl.make_source(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_cpp.py b/src/components/dbus/codegen/make_qml_dbus_cpp.py
deleted file mode 100755
index f40bc74df8..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_cpp.py
+++ /dev/null
@@ -1,736 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_dbus_type_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_declaration(struct, out)
-
- def make_dbus_metatype_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_metatype_declaration(struct, out)
-
-
- def write_struct_declaration(self, ((iface, name), params), out):
- struct_name = "{0}_{1}".format(iface, name)
- out.write("struct {0} {{\n".format(struct_name))
- with CodeBlock(out) as out:
- for param in params:
- out.write("{0} {1};\n".format(self.qt_param_type(param), param.name))
- out.write("{0}()\n".format(struct_name))
- initializersList = map(lambda x: "{0}({1})".format(x.name, defaultValue(x)), [p for p in params if p.type != "String" and not p.struct and not p.array])
- if initializersList:
- out.write(": " + ",\n ".join(initializersList))
-
- out.write("{ }\n")
-
- out.write("};\n")
- out.write('QDBusArgument& operator << (QDBusArgument&, const ' + struct_name + "&);\n")
- out.write('const QDBusArgument& operator >> (const QDBusArgument&, ' + struct_name + "&);\n")
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const QList<' + struct_name + " >& v);\n")
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + " >& v);\n")
-
-
- def write_struct_metatype_declaration(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
- out.write('Q_DECLARE_METATYPE(' + struct_name + ")\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(QList<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<QList<' + struct_name + "> >)\n\n")
-
-
- def make_dbus_type_definitions(self, out):
- for struct in self.structs.items():
- self.write_struct_definition(struct, out)
-
- def write_struct_definition(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
-
- out.write('QDBusArgument& operator << (QDBusArgument& arg, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg << v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('const QDBusArgument& operator >> (const QDBusArgument& arg, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg >> v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap map;\n")
- for param in params:
- out.write("""PutArgToMap(map, "{0}", v.{0});\n""".format(param.name))
- out.write("return QVariant::fromValue(map);\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("QList<QVariant> ret;\n")
- out.write("for (QList<{0}>::const_iterator i = v.begin(); i != v.end(); ++i)\n".format(struct_name))
- with CodeBlock(out) as out:
- out.write("ret.append(ValueToVariant(*i));\n")
- out.write("return QVariant::fromValue(ret);\n")
- out.write("}\n\n")
-
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("map.insert(name, ValueToVariant(v));\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QVariantMap map = variant.toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(map, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::List) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a list");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QList<QVariant> list = variant.toList();\n")
- out.write("for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {\n");
- with CodeBlock(out) as out:
- out.write(struct_name + " s;\n");
- out.write("if (!VariantToValue(*i, s)) return false;\n");
- out.write("v.append(s);\n");
- out.write("}\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap::const_iterator it = map.find(name);\n")
- out.write("if (map.end() == it) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_WARN(logger_, "Argument '" << name << "' not found");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("if (it->type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Argument '" << name << "' isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("const QVariantMap& inmap = it->toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(inmap, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{ {2}; }}\n".format(param_name, param.minSize, fail_statement))
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{ {2}; }}\n".format(param_name, param.maxSize, fail_statement))
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) { %s; }\n' % (' || '.join(conditions), fail_statement))
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- with CodeBlock(out) as out:
- out.write('if (%s) { %s;\n }\n' % (' || '.join(conditions), fail_statement))
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def from_variant_func_name(self, param, interface):
- prefix = ''
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return 'opt_' + self.from_variant_func_name(param_copy, interface)
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- return 'arr_' + self.from_variant_func_name(param_copy, interface)
-
- if param.type in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param.type
- else:
- param_type = param.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (interface, param_type[0])
- if param_type in self.structs:
- param_type = param_type[0] + '_' + param_type[1]
- elif param_type in self.enums:
- param_type = 'Integer'
- return param_type + '_from_variant'
-
-
- def make_method_signature(self, request, response, interface, add_classname):
- in_params = [self.make_param_desc(x, interface) for x in request.findall('param')]
- out_params = [self.make_param_desc(x, interface) for x in response.findall('param')]
-
- signature_len = len(''.join(map(lambda x: self.convert_to_dbus_type(x), in_params + out_params)))
- if signature_len > 255:
- raise RuntimeError("Too long signature of {0} method. Maximum valid length is 255, actual is {1}", request.get('name'), signature_len)
-
- return "int {0}{1} ({2}{3}const QDBusMessage& message, QString& userMessage_out{4}{5})".format(
- interface + "Adaptor::" if add_classname else "",
- request.get('name'),
- ", ".join(map(lambda x: "const {0}& {1}_in".format(self.qt_param_type(x), x.name), in_params)),
- ", " if in_params else "",
- ", " if out_params else "",
- ", ".join(map(lambda x: "{0}& {1}_out".format(self.qt_param_type(x), x.name), out_params)))
-
-
- def make_signal_signature(self, signal, interface, add_void):
- params = signal.findall('param')
- if add_void:
- retstr = 'void '
- else:
- retstr = ''
- retstr = retstr + signal.get('name') + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- param_type = self.qt_param_type(param_desc)
- retstr = retstr + param_type + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def make_qml_signal_signature(self, signal, interface, name, short=False, add_classname=False):
- params = signal.findall('param')
- if short:
- retstr = ''
- else:
- retstr = 'void '
- if add_classname:
- retstr = retstr + interface + 'Adaptor::'
- retstr = retstr + name + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- if param_desc.struct or param_desc.array or not param_desc.mandatory: typ = 'QVariant'
- elif param_desc.type == 'Integer' or param_desc.enum: typ = 'int'
- elif param_desc.type == 'Boolean': typ = 'bool'
- elif param_desc.type == 'Float': typ = 'double'
- elif param_desc.type == 'String': typ = 'QString'
- else: typ = 'QVariant'
- retstr = retstr + typ
- if not short: retstr = retstr + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def write_adaptor_declaration(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- def glue_strings(strings):
- ret = list()
- curstr = ''
- for str in strings:
- curstr = curstr + str
- if(str[-1] == '>'):
- ret.append(curstr)
- curstr = ''
- return ret
- ifacename = interface_el.get('name')
- out.write("class " + ifacename + "Adaptor : public QDBusAbstractAdaptor {\n");
- out.write(" Q_OBJECT\n");
- out.write(" Q_CLASSINFO(\"D-Bus Interface\", \"" + self.interface_path + '.' + ifacename + "\")\n");
- out.write(" Q_CLASSINFO(\"D-Bus Introspection\",\n");
- introspection_el = self.create_introspection_iface_el(interface_el, 'hmi')
- introspection = glue_strings(ElementTree.tostringlist(introspection_el))
- for str in introspection:
- str = str.replace('"', '\\"')
- out.write('"' + str + '"' + "\n")
- out.write(" )\n")
- out.write(" public:\n")
- out.write(" explicit " + ifacename + "Adaptor(QObject *parent = 0);\n")
- out.write(" void SetApi(Q%sItem*);\n" % prefix_class_item)
- out.write(" DBusController *dbusController;\n")
- out.write(" public slots:\n")
- for (request, response) in request_responses:
- signature = self.make_method_signature(request, response, ifacename, False)
- out.write(" " + signature + ";\n")
- out.write(" signals:\n")
- for n in notifications:
- signature = self.make_signal_signature(n, ifacename, True)
- out.write(" " + signature + ";\n")
- out.write(" private slots:\n")
- for n in notifications:
- signature = self.make_qml_signal_signature(n, ifacename, n.get('name') + '_qml', False)
- out.write(" " + signature + ";\n")
- out.write(" private:\n")
- out.write(" Q%sItem* api_;\n" % prefix_class_item)
- out.write("};\n\n");
-
- def write_adaptor_definition(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- iface_name = interface_el.get('name')
- classname = iface_name + 'Adaptor'
- out.write("{0}::{0}(QObject* parent) : QDBusAbstractAdaptor(parent) {{}}\n".format(classname))
-
- out.write("void {0}::SetApi(Q{1}Item* api) {{\n".format(classname, prefix_class_item))
- with CodeBlock(out) as out:
- out.write("api_ = api;\n")
- for n in notifications:
- signame = n.get('name')
- signame = signame[:1].lower() + signame[1:]
- slotname = n.get('name') + '_qml'
- sig_signature = self.make_qml_signal_signature(n, iface_name, signame, True)
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, True)
- out.write("connect(api_, SIGNAL(" + sig_signature + "), this, SLOT(" + slot_signature + "));\n")
- out.write("LOG4CXX_TRACE(logger_, \"CONNECT SIGNALS: \" << __PRETTY_FUNCTION__ );\n")
- out.write("}\n\n")
-
- for (request,response) in request_responses:
- in_params = [ self.make_param_desc(x, iface_name) for x in request.findall('param') ]
- out_params = [ self.make_param_desc(x, iface_name) for x in response.findall('param') ]
-
- out.write("bool fill{0}{1}Reply(QDBusMessage& message, const QVariantMap& map) {{\n".format(classname, request.get('name')))
- with CodeBlock(out) as out:
- out.write("int retCode_out = 0;\n")
- out.write("GetArgFromMap(map, \"__retCode\", retCode_out);\n")
- out.write("QVariant retCode_arg = QVariant::fromValue(retCode_out);\n")
- out.write("message << retCode_arg;\n")
- out.write("QString userMessage_out;\n")
- out.write("GetArgFromMap(map, \"__message\", userMessage_out);\n")
- out.write("QVariant userMessage_arg = QVariant::fromValue(userMessage_out);\n")
- out.write("message << userMessage_arg;\n")
- for p in out_params:
- param_name = p.name
- param_type = self.qt_param_type(p)
- out.write("%s %s_out;\n" % (param_type, p.name))
- out.write("if (!GetArgFromMap(map, \"{0}\", {0}_out)) {{ return false; }}\n".format(p.name))
- self.write_param_validation(p, p.name + "_out", "return false", out)
- out.write("QVariant {0}_arg;\n".format(p.name))
- out.write("{0}_arg.setValue({0}_out);\n".format(p.name))
- out.write("message << {0}_arg;\n".format(p.name))
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(map));\n")
- out.write("LOG4CXX_TRACE(logger_, \"REPLY ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write("{0} {{\n".format(self.make_method_signature(request, response, iface_name, True)))
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER: \" << __PRETTY_FUNCTION__ );\n")
- out.write("int ret = 0;\n")
- return_statement = "return ret;\n"
- out.write("QVariantMap in_arg;\n");
- out.write("QVariant out_arg_v;\n");
- for param in in_params:
- self.write_param_validation(param, param.name + "_in", "RaiseDbusError(this, InvalidData); return ret", out)
- out.write("PutArgToMap(in_arg, \"" + param.name + "\", " + param.name + "_in);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Input arguments:\\n\" << in_arg);\n")
- method_name = request.get('name')[:1].lower() + request.get('name')[1:]
-
- out.write("dbusController->message = &message;\n")
- out.write("dbusController->fill = &fill{0}{1}Reply;\n".format(classname, request.get("name")))
-
- out.write("""if (!QMetaObject::invokeMethod(api_, "{0}", Qt::{1}Connection, Q_RETURN_ARG(QVariant, out_arg_v), Q_ARG(QVariant, QVariant(in_arg)))) {{\n""".format(method_name, invoke_type_connection))
- with CodeBlock(out) as out:
- out.write("RaiseDbusError(this, InvalidData);\n")
- out.write("LOG4CXX_ERROR(logger_, \"Can't invoke method " + method_name +"\");\n ")
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("dbusController->message = NULL;\n")
- out.write("dbusController->fill = NULL;\n")
- out.write("if (message.isDelayedReply()) {\n")
- with CodeBlock(out) as out:
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("QVariantMap out_arg;\n")
- out.write("if (out_arg_v.type() == QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("out_arg = out_arg_v.toMap();\n")
- out.write("};\n")
-
- out.write("int err;\n")
- out.write("""if (GetArgFromMap(out_arg, "__errno", err)) { RaiseDbusError(this, err); return ret; }\n""")
-
- out.write("int async_uid;\n")
- out.write("if (GetArgFromMap(out_arg, \"__async_uid\", async_uid)) {\n")
- with CodeBlock(out) as out:
- out.write("message.setDelayedReply(true);\n")
- out.write("dbusController->addMessage(message, &fill%s%sReply, async_uid);\n" % (classname, request.get('name')))
- out.write("LOG4CXX_TRACE(logger_, \"EXIT ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n");
- out.write("}\n\n")
-
- for param in out_params:
- out.write("if (!GetArgFromMap(out_arg, \"{0}\", {0}_out)) {{ RaiseDbusError(this, InvalidData); return ret; }}\n".format(param.name))
- self.write_param_validation(param, param.name + "_out", "RaiseDbusError(this, InvalidData); return ret", out)
-
- out.write("GetArgFromMap(out_arg, \"__retCode\", ret);\n")
- out.write("GetArgFromMap(out_arg, \"__message\", userMessage_out);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(out_arg));\n")
- out.write("LOG4CXX_TRACE(logger_, \"EXIT: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n")
- out.write("}\n\n")
-
- for n in notifications:
- slotname = n.get('name') + '_qml'
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, False, True)
- out.write(slot_signature + " {\n")
- params = n.findall('param')
- out.write(" LOG4CXX_TRACE(logger_, \"EMIT SIGNAL: \" << __PRETTY_FUNCTION__ );\n")
- out.write(" LOG4CXX_DEBUG(logger_, \"Arguments:\\n{\"")
- for p in params[0:-1]:
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name + " << \",\"")
- for p in params[-1:]: # last param without comma in end line
- p = params[-1]
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name)
- out.write(" << \" }\");\n")
- for p in params:
- param = self.make_param_desc(p, iface_name)
- param_type = self.qt_param_type(param)
- param_name = 'p_' + param.name
- if param.mandatory:
- if param.array or (param.type not in ['Integer', 'String', 'Float', 'Boolean'] and not param.enum):
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ")) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;}\n")
- else:
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' ' + param_name + '.presence = !' + param.name + ".isNull();\n")
- out.write(' if (' + param_name + ".presence) {\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ".val)) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;\n }\n")
- out.write(" }\n")
- out.write(' emit ' + n.get('name') + '(')
- for i in range(len(params)):
- param = self.make_param_desc(params[i], iface_name)
- basic_type = (param.type in ['Integer', 'String', 'Float', 'Boolean']) or param.enum
- if param.array or (not param.mandatory) or (not basic_type):
- param_name = 'p_' + param.name
- else:
- param_name = param.name
- out.write(param_name)
- if i != len(params) - 1: out.write(', ')
- out.write(");\n")
- out.write("}\n\n")
-
-
- def make_dbus_adaptor_declarations(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_declaration(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_adaptor_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_definition(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_register_metatypes_declaraion(self, out):
- out.write("void RegisterDbusMetatypes();\n")
-
-
- def make_dbus_register_metatypes_definition(self, out):
- out.write("void RegisterDbusMetatypes() {\n")
- for (iface, name) in self.structs:
- struct_name = iface + '_' + name
- out.write('qDBusRegisterMetaType<' + struct_name + ">();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<QList<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<QList<' + struct_name + "> > >();\n")
- out.write("}\n")
-
-
- def make_api_adaptors_class(self, out):
- global prefix_class_item
- out.write("struct ApiAdaptors {\n")
- interfaces = self.el_tree.findall('interface')
- def filt(iface):
- return self.find_notifications_by_provider(iface, "hmi") or self.find_request_response_pairs_by_provider(iface, "hmi")
- interfaces = filter(filt, interfaces)
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "* " + name + "_;\n")
- out.write(" ApiAdaptors() :\n")
- for i in range(len(interfaces)):
- name = interfaces[i].get('name') + 'Adaptor'
- out.write(" " + name + "_(NULL)")
- if i <> len(interfaces) - 1: out.write(',')
- out.write("\n")
- out.write(" {}\n")
- out.write(" void Init(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "_ = new " + name + "(p);\n")
- out.write(" }\n")
- out.write(" void SetApi(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + ("_->SetApi(p->findChild<Q%sItem*>(\"" % prefix_class_item) + chname + "\"));\n")
- out.write(" }\n")
- out.write(" void SetDBusController(DBusController* dc) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + "_->dbusController = dc;\n")
- out.write(" }\n")
- out.write("};\n\n")
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files qml_dbus.cc, qml_dbus.h will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'qml_dbus.h'
-source_name = 'qml_dbus.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file qml_dbus.h
- * @brief Generated QDbus adaptors header file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-header_out.write("#define SRC_COMPONENTS_DBUS_QML_DBUS_H_\n\n");
-header_out.write("#include <QtDBus/QDBusArgument>\n");
-header_out.write("#include <QtDBus/QDBusMessage>\n");
-header_out.write("#include <QtDBus/QDBusConnection>\n");
-header_out.write("#include <QtDBus/QDBusAbstractAdaptor>\n");
-header_out.write("#include <QtDBus/QDBusMetaType>\n");
-header_out.write("#include <Qt%s/Q%sItem>\n" % (prefix_class_item, prefix_class_item));
-header_out.write("#include \"qml_dbus_common.h\"\n\n");
-header_out.write("#include \"dbus_controller.h\"\n\n");
-impl.make_dbus_type_declarations(header_out)
-impl.make_dbus_adaptor_declarations(header_out)
-impl.make_dbus_register_metatypes_declaraion(header_out)
-impl.make_api_adaptors_class(header_out)
-impl.make_dbus_metatype_declarations(header_out)
-header_out.write("#endif // #ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file qml_dbus.cc
- * @brief Generated QDbus adaptors source file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-source_out.write("#include \"" + header_name + "\"\n\n");
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("#ifdef ENABLE_LOG\n")
-source_out.write("extern log4cxx::LoggerPtr logger_;\n")
-source_out.write("#endif // ENABLE_LOG\n\n")
-impl.make_dbus_type_definitions(source_out)
-impl.make_dbus_adaptor_definitions(source_out)
-impl.make_dbus_register_metatypes_definition(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_qml.py b/src/components/dbus/codegen/make_qml_dbus_qml.py
deleted file mode 100755
index 8d057dcda1..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_qml.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_qml.py
-# @brief Generator of QML to QDbus QML part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from os import path
-from os import makedirs
-from sys import argv
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-
-namespace = 'dbus_qml'
-qt_quick_version = '1.1'
-type_variant_name = 'variant'
-
-class Impl(FordXmlParser):
- def write_function(self, ifacename, request, response, out):
- name = request.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" function " + name + "(params) {\n")
- out.write(""" console.debug("{0}Proxy::{1}")\n""".format(ifacename, name))
- out.write(" try {\n")
- out.write(" if(\"{0}\" in sdl{1})\n".format(name, ifacename))
- out.write(" return sdl{0}.{1}(" .format(ifacename, name))
- params = request.findall('param')
- for i in range(len(params)):
- out.write('params.' + params[i].get('name'))
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- out.write(" else\n")
- out.write(""" return { "__errno": Common.Result.UNSUPPORTED_REQUEST }\n""")
- out.write(" } catch(err) {\n")
- out.write(""" return { "__errno": err }\n""")
- out.write(" }\n")
- out.write(" }\n\n")
-
-
- def write_signal_param(self, param, out):
- if param.array or param.struct or not param.mandatory: typ = type_variant_name
- elif param.type == 'Integer' or param.enum: typ = 'int'
- elif param.type == 'String': typ = 'string'
- elif param.type == 'Boolean': typ = 'bool'
- elif param.type == 'Float': typ = 'double'
- else: typ = type_variant_name
- out.write(typ + ' ' + param.name)
-
-
- def write_signal(self, ifacename, notification, out):
- name = notification.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" signal " + name + "(")
- params = notification.findall('param')
- for i in range(len(params)):
- self.write_signal_param(self.make_param_desc(params[i], ifacename), out)
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- name = notification.get('name')
- out.write(""" on{1}: console.debug("emitted {0}:{1}")\n""".format(ifacename, name))
-
-
- def write_qml(self, iface, out):
- global qt_quick_version
- name = iface.get('name')
- out.write("import QtQuick %s\n" % qt_quick_version)
- out.write("""import "Common.js" as Common\n""")
- out.write("import \"..\"\n\n")
- out.write("Item {\n")
- out.write(" " + name + " {\n")
- out.write(" id: sdl" + name + "\n")
- out.write(" }\n")
-
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- for request, response in request_responses:
- self.write_function(name, request, response, out)
- for n in notifications:
- self.write_signal(name, n, out)
- out.write("}\n")
-
-
- def write_js_enum(self, enum, out):
- out.write("var " + enum.get('name') + " = {\n")
- lastval = -1
- elements = enum.findall('element')
- for i in range(len(elements)):
- element = elements[i]
- value = element.get('value')
- if value is None:
- value = lastval + 1
- else:
- value = int(value)
- lastval = value
- name = element.get('internal_name')
- if name is None:
- name = element.get('name')
- out.write(" " + name + ': ' + str(value))
- if len(elements) - 1 != i: out.write(',')
- out.write("\n")
- out.write("}\n\n")
-
-
-def write_header(out):
- out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
- out.write("""/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-""")
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus QML part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files with pattern name <intarface name>Proxy.qml will be saved, e.g. BasicCommunicationProxy.qml, ButtonsProxy.qml VRProxy.qml")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- qt_quick_version = "1.1"
- type_variant_name = "variant"
-elif args.version == "5.1.0":
- qt_quick_version = "2.0"
- type_variant_name = "var"
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-for interface_el in in_tree_root.findall('interface'):
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- if notifications or request_responses:
- filename = interface_el.get('name')+'Proxy.qml'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- impl.write_qml(interface_el, outfile)
-
-enum_files = dict()
-for (iface, name), enum in impl.enums.items():
- if iface in enum_files:
- outfile = enum_files[iface]
- else:
- filename = iface+'.js'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- outfile.write(".pragma library\n")
- enum_files[iface] = outfile
- impl.write_js_enum(enum, outfile)
-
-
diff --git a/src/components/dbus/codegen/make_qml_requests_cpp.py b/src/components/dbus/codegen/make_qml_requests_cpp.py
deleted file mode 100644
index 6674b8f5e2..0000000000
--- a/src/components/dbus/codegen/make_qml_requests_cpp.py
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
-
-
- def args_for_function_definition(self, params, out):
- if len(params) == 0:
- out.write('QJSValue hmi_callback')
- return
- for param in params:
- out.write('QVariant ' + param.get('name') + ', ')
- out.write('QJSValue hmi_callback')
-
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOLABKE void " + interface_el.get('name') + "_" +request.get('name') + "(")
- impl.args_for_function_definition(all_params, out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *' + interface_el.get('name') + ';\n')
- out.write("};\n")
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- out.write('void RequestToSDL::' + request.get('name') + '(QString name, ')
- for param_el in request.findall('param'):
- out.write('QVariant ' + param_el.get('name') + ', ')
- out.write('QJSValue hmi_callback) {\n')
- with CodeBlock(out) as output:
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- output.write('args << ' + param_el.get('name') + ';\n')
- output.write('new ' + interface_el.get('name') + '_' + request.get('name') + '(' + interface_el.get('name') + ', name, args, hmi_callback);\n}\n')
-
-
-
- def make_source_file(self, out):
- out.write('#include "request_to_sdl.h"\n')
- out.write('\n')
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file request_to_sdl.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n\n");
-header_out.write("#include <QDBusConnection>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write('#include "hmi_requests.h"\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file request_to_sdl.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, Ford Motor Company
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided with the
-// distribution.
-//
-// Neither the name of the Ford Motor Company nor the names of its contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-""")
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_request_to_sdl.py b/src/components/dbus/codegen/make_request_to_sdl.py
deleted file mode 100755
index c8940f3eb7..0000000000
--- a/src/components/dbus/codegen/make_request_to_sdl.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Impl(FordXmlParser):
-
- def args_for_function_definition(self, params, iface_name, out):
- for param_el in params:
- param = self.make_param_desc(param_el, iface_name)
- out.write('QVariant %s,' % (param.name))
- out.write('Q%sValue hmi_callback' % prefix_class_item)
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOKABLE bool %s_%s(" % (interface_el.get('name'), request.get('name')))
- impl.args_for_function_definition(all_params, interface_el.get('name'), out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class QDBusInterface;\n")
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(' Q_OBJECT\n')
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *%s;\n' % interface_el.get('name'))
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_name = request.get('name')
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' + request_name
- out.write('bool RequestToSDL::' + request_full_name + '(')
- for param_el in request.findall('param'):
- out.write('QVariant %s, ' % (param_el.get('name')))
- out.write('Q%sValue hmi_callback) {\n' % prefix_class_item)
- with CodeBlock(out) as output:
- output.write('LOG4CXX_TRACE(logger_, "ENTER");\n')
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- output.write('%s %s;\n' % (impl.qt_param_type(param), param.name + "_tmp"))
- output.write('if (VariantToValue(%s, %s)) {\n' % (param.name, param.name + '_tmp'))
- with CodeBlock(output) as out:
- self.write_param_validation(param, param.name + "_tmp",
- "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\");\nreturn false" % (param.name, request_full_name),
- out)
- out.write('args << QVariant::fromValue(%s);\n' % (param.name + '_tmp'))
- output.write('} else {\n')
- with CodeBlock(output) as out:
- out.write('LOG4CXX_ERROR(logger_, "%s in %s is NOT valid");\n' % (param.name, request_full_name))
- out.write('return false;\n')
- out.write('}\n')
- output.write('new requests::' + request_full_name + '(hmi_callback, ' + interface_el.get('name') + ' , args, '
- + '"' + request_name + '");\n')
- output.write('LOG4CXX_TRACE(logger_, "EXIT");\n')
- output.write('return true;\n')
- out.write('}\n\n')
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
- def make_source_file(self, out):
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n\n")
-
-header_out.write("#include <QtCore/QObject>\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtCore/QStringList>\n\n")
-header_out.write('#include "qml_dbus.h"\n\n')
-if args.version == "4.8.5":
- header_out.write("#include <QtScript/QScriptValue>\n")
-elif args.version == "5.1.0":
- header_out.write("#include <QtQml/QJSValue>\n")
-
-impl.make_header_file(header_out)
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-""")
-
-source_out.write('#include "request_to_sdl.h"\n')
-source_out.write("#include <QtDBus/QDBusConnection>\n")
-source_out.write("#include <QtDBus/QDBusInterface>\n")
-source_out.write('#include "hmi_requests.h"\n')
-source_out.write('#include "utils/logger.h"\n\n')
-source_out.write('CREATE_LOGGERPTR_GLOBAL(logger_, "DBusPlugin")\n\n')
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
deleted file mode 100644
index 9c78c428ca..0000000000
--- a/src/components/dbus/include/dbus/dbus_adapter.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 2013-2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-
-#include <string>
-#include "smart_objects/smart_object.h"
-#include "dbus/schema.h"
-
-struct DBusConnection;
-struct DBusMessage;
-struct DBusMessageIter;
-
-namespace dbus {
-
-/**
- * \brief class for work with DBus
- */
-class DBusAdapter {
- public:
- /**
- * \brief constructs DBus adapter
- * \param sdlServiceName core service name
- * \param sdlObjectPath core object path
- * \param hmiServiceName hmi service name
- */
- DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * \brief destructs DBus adapter
- */
- virtual ~DBusAdapter();
-
- /**
- * \brief inits service
- * \return true if success
- */
- bool Init();
-
- /**
- * \brief return schema messages for DBus
- * \return schema
- */
- const DBusSchema& get_schema() const;
-
- protected:
- /**
- * \brief calls method on HMI
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of method for call
- * \param obj params for call
- */
- void MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends signal
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of signal for call
- * \param obj params for signal
- */
- void Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief returns result of call method to HMI
- * \param id id message
- * \param obj params for return
- */
- void MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error on message from HMI
- * \param id id message
- * \param msg message from HMI
- * \param name name of error
- * \param description description of error
- */
- void Error(uint id, const std::string& name, const std::string& description);
-
- /**
- * \brief adds a match rule
- * \param rule string rule in the DBus specification
- */
- void AddMatch(const std::string& rule);
-
- /**
- * \brief processes incoming message from DBus if queue isn't empty
- * and fill obj
- * \param obj object for send to core
- * \return true if message processed
- */
- bool Process(smart_objects::SmartObject& obj);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param ids pair correlation id and Ford message id
- */
- inline void SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids);
-
- /**
- * \brief gets Ford message id by serial
- * \param serial D-Bus message serial
- * \return pair correlation id and Ford message id
- */
- inline std::pair<uint, MessageId> GetRequestToHMI(uint32_t serial);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param request D-Bus message from HMI
- */
- inline void SaveRequestFromHMI(uint32_t serial, DBusMessage* request);
-
- /**
- * \brief gets D-Bus message id by serial
- * \param serial DBus message serial
- * \return D-Bus message from HMI
- */
- inline DBusMessage* GetRequestFromHMI(uint32_t serial);
-
- std::string sdl_service_name_;
- std::string sdl_object_path_;
- std::string hmi_service_name_;
- std::string hmi_object_path_;
- DBusConnection* conn_;
-
- private:
- /**
- * \brief schema messages and arguments for DBus
- */
- const DBusSchema* schema_;
-
- /**
- * \brief mapping serial message DBus on message id Ford protocol
- */
- std::map<uint32_t, std::pair<uint, MessageId> > requests_to_hmi_;
-
- /**
- * \brief mapping message id Ford protocol on message DBus
- */
- std::map<uint32_t, DBusMessage*> requests_from_hmi_;
-
- /**
- * \brief processes incoming call of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodCall(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming return of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodReturn(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming error and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessError(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming signal and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessSignal(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief sets arguments to message
- * \param msg DBus message
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args);
-
- /**
- * \brief Sets one argument to message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool SetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets struct value for argument
- * \param iter DBus message iter
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool SetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief gets arguments from message
- * \param iter DBus message iterator
- * \param code response code (output)
- * \param message response message (output)
- * \return true if success
- */
- bool GetHeader(DBusMessageIter* iter, int* code, std::string* message);
-
- /**
- * \brief gets arguments from message with header
- * \param iter DBus message iterator
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets one argument from message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param args map of arguments
- * \return true if success
- */
- bool GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool GetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool GetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets struct value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool GetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief processes request on introspect
- * \param msg DBus message
- */
- void Introspect(DBusMessage* msg);
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message.h b/src/components/dbus/include/dbus/dbus_message.h
deleted file mode 100644
index 23e672d0fc..0000000000
--- a/src/components/dbus/include/dbus/dbus_message.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-
-#include <stdint.h>
-#include <string>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-enum ContainerType {
- kArray = DBUS_TYPE_ARRAY,
- kStruct = DBUS_TYPE_STRUCT,
- kDictEntry = DBUS_TYPE_DICT_ENTRY
-};
-
-class MessageRefKeeper {
- public:
- MessageRefKeeper();
- MessageRefKeeper(DBusMessage* message);
- ~MessageRefKeeper();
- MessageRefKeeper(const MessageRefKeeper& other);
- MessageRefKeeper& operator=(MessageRefKeeper other);
- DBusMessage* get() const;
- DBusMessage* Pass();
- void swap(MessageRefKeeper& other);
-
- private:
- DBusMessage* raw_message_;
-};
-
-class MessageRef {
- public:
- MessageRef(DBusMessage* message);
- ~MessageRef();
- std::string GetInterface() const;
- std::string GetMember() const;
-
- protected:
- MessageRefKeeper raw_message_ref_;
- friend class MessageReader;
- friend class MessageWriter;
-};
-
-class MessageReader {
- public:
- // Main constructor
- MessageReader(const MessageRef& message);
- bool has_failed() const;
- bool IsAtLastElement() const;
- bool HasNext() const;
-
- // Type checkers
- bool NextIsInvalid() const;
- bool NextIsBool() const;
- bool NextIsByte() const;
- bool NextIsInt16() const;
- bool NextIsUint16() const;
- bool NextIsInt32() const;
- bool NextIsUint32() const;
- bool NextIsInt64() const;
- bool NextIsUint64() const;
- bool NextIsDouble() const;
- bool NextIsString() const;
- bool NextIsArray() const;
- bool NextIsStruct() const;
- bool NextIsDictEntry() const;
-
- // Readers
- bool TakeBool();
- uint8_t TakeByte();
- int16_t TakeInt16();
- uint16_t TakeUint16();
- int32_t TakeInt32();
- uint32_t TakeUint32();
- int64_t TakeInt64();
- uint64_t TakeUint64();
- double TakeDouble();
- std::string TakeString();
-
- MessageReader TakeArrayReader();
- MessageReader TakeStructReader();
- MessageReader TakeDictEntryReader();
-
- private:
- typedef int DataType;
- // Container reader constructor
- MessageReader(MessageReader* reader, DataType container_data_type);
- void MoveToNext();
- void MarkFailed();
- DataType NextValueType() const;
- void ReadNextValue(DataType type, void* value);
-
- private:
- // Fields
- MessageReader* parent_reader_;
- bool failed_;
- DBusMessageIter iterator_;
-};
-
-class MessageWriter {
- public:
- // Methods
- // Main appending constructor
- MessageWriter(const MessageRef& message);
- // Container writer constructor
- MessageWriter(MessageWriter* parent,
- ContainerType type,
- const char* array_signature);
- ~MessageWriter();
- void PutBool(bool value);
- void PutByte(uint8_t value);
- void PutInt16(int16_t value);
- void PutUint16(uint16_t value);
- void PutInt32(int32_t value);
- void PutUint32(uint32_t value);
- void PutInt64(int64_t value);
- void PutUint64(uint64_t value);
- void PutDouble(double value);
- void PutString(const std::string& value);
-
- private:
- typedef int DataType;
- // Main constructor
- void WriteAndCheck(DataType value_type, const void* value);
- void CloseWriter();
-
- private:
- // Fields
- bool has_opened_subcontainer_;
- MessageWriter* parent_writer_;
- DBusMessageIter iterator_;
-
- // Disallow copy and assign
- MessageWriter(const MessageWriter& other);
- MessageWriter& operator=(const MessageWriter& other);
-};
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method);
-MessageRef Signal(const char* path, const char* interface, const char* name);
-} // namespace dbus
-
-#include "dbus/dbus_message_inl.h"
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_controller.h b/src/components/dbus/include/dbus/dbus_message_controller.h
deleted file mode 100644
index 973cc86fae..0000000000
--- a/src/components/dbus/include/dbus/dbus_message_controller.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-
-#include <string>
-#include <map>
-#include "dbus/dbus_adapter.h"
-#include "smart_objects/smart_object.h"
-
-namespace dbus {
-
-class DBusMessageController : public DBusAdapter {
- public:
- /**
- * \brief constructs DBus message controller
- * \param sdlServiceName name of service SDL
- * \param sdlObjectPath path of object SDL
- * \param hmiServiceName name of service HMI
- * \param hmiObjectPath path of object HMI
- */
- DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * \brief destructs DBus message controller
- */
- virtual ~DBusMessageController();
-
- /**
- * \brief subscribes to the DBus signal.
- * \param interface name of interface in HMI
- * \param signal name of signal
- */
- void SubscribeTo(const std::string& interface, const std::string& signal);
-
- /**
- * \brief Method for receiving thread.
- */
- void* MethodForReceiverThread(void*);
-
- protected:
- /**
- * \brief sends message to core
- * \param obj
- */
- virtual void SendMessageToCore(const smart_objects::SmartObject& obj) = 0;
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_inl.h b/src/components/dbus/include/dbus/dbus_message_inl.h
deleted file mode 100644
index ba9bfaa78d..0000000000
--- a/src/components/dbus/include/dbus/dbus_message_inl.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-
-#include "dbus/dbus_message.h"
-
-namespace dbus {
-// MessageReader
-inline bool MessageReader::has_failed() const {
- return failed_;
-}
-
-inline bool MessageReader::IsAtLastElement() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return dbus_message_iter_has_next(iter) == 0;
-}
-
-inline bool MessageReader::HasNext() const {
- return !failed_ && NextValueType() != DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsInvalid() const {
- return NextValueType() == DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsBool() const {
- return NextValueType() == DBUS_TYPE_BOOLEAN;
-}
-
-inline bool MessageReader::NextIsByte() const {
- return NextValueType() == DBUS_TYPE_BYTE;
-}
-
-inline bool MessageReader::NextIsInt16() const {
- return NextValueType() == DBUS_TYPE_INT16;
-}
-
-inline bool MessageReader::NextIsUint16() const {
- return NextValueType() == DBUS_TYPE_UINT16;
-}
-
-inline bool MessageReader::NextIsInt32() const {
- return NextValueType() == DBUS_TYPE_INT32;
-}
-
-inline bool MessageReader::NextIsUint32() const {
- return NextValueType() == DBUS_TYPE_UINT32;
-}
-
-inline bool MessageReader::NextIsInt64() const {
- return NextValueType() == DBUS_TYPE_INT64;
-}
-
-inline bool MessageReader::NextIsUint64() const {
- return NextValueType() == DBUS_TYPE_UINT64;
-}
-
-inline bool MessageReader::NextIsDouble() const {
- return NextValueType() == DBUS_TYPE_DOUBLE;
-}
-
-inline bool MessageReader::NextIsString() const {
- return NextValueType() == DBUS_TYPE_STRING;
-}
-
-inline bool MessageReader::NextIsArray() const {
- return NextValueType() == DBUS_TYPE_ARRAY;
-}
-
-inline bool MessageReader::NextIsStruct() const {
- return NextValueType() == DBUS_TYPE_STRUCT;
-}
-
-inline bool MessageReader::TakeBool() {
- dbus_bool_t value = 0;
- ReadNextValue(DBUS_TYPE_BOOLEAN, &value);
- return value != 0;
-}
-
-inline uint8_t MessageReader::TakeByte() {
- uint8_t value = 0;
- ReadNextValue(DBUS_TYPE_BYTE, &value);
- return value;
-}
-
-inline int16_t MessageReader::TakeInt16() {
- int16_t value = 0;
- ReadNextValue(DBUS_TYPE_INT16, &value);
- return value;
-}
-
-inline uint16_t MessageReader::TakeUint16() {
- uint16_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT16, &value);
- return value;
-}
-
-inline int32_t MessageReader::TakeInt32() {
- int32_t value = 0;
- ReadNextValue(DBUS_TYPE_INT32, &value);
- return value;
-}
-
-inline uint32_t MessageReader::TakeUint32() {
- uint32_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT32, &value);
- return value;
-}
-
-inline int64_t MessageReader::TakeInt64() {
- int64_t value = 0;
- ReadNextValue(DBUS_TYPE_INT64, &value);
- return value;
-}
-
-inline uint64_t MessageReader::TakeUint64() {
- uint64_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT64, &value);
- return value;
-}
-
-inline double MessageReader::TakeDouble() {
- double value = 0.;
- ReadNextValue(DBUS_TYPE_DOUBLE, &value);
- return value;
-}
-
-inline std::string MessageReader::TakeString() {
- const char* value = "";
- ReadNextValue(DBUS_TYPE_STRING, &value);
- return value;
-}
-
-inline MessageReader::DataType MessageReader::NextValueType() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return failed_ ? DBUS_TYPE_INVALID : dbus_message_iter_get_arg_type(iter);
-}
-
-// Message writer methods
-inline void MessageWriter::PutBool(bool value) {
- dbus_bool_t dbus_value = value;
- WriteAndCheck(DBUS_TYPE_BOOLEAN, &dbus_value);
-}
-
-inline void MessageWriter::PutByte(uint8_t value) {
- WriteAndCheck(DBUS_TYPE_BYTE, &value);
-}
-
-inline void MessageWriter::PutInt16(int16_t value) {
- WriteAndCheck(DBUS_TYPE_INT16, &value);
-}
-
-inline void MessageWriter::PutUint16(uint16_t value) {
- WriteAndCheck(DBUS_TYPE_UINT16, &value);
-}
-
-inline void MessageWriter::PutInt32(int32_t value) {
- WriteAndCheck(DBUS_TYPE_INT32, &value);
-}
-
-inline void MessageWriter::PutUint32(uint32_t value) {
- WriteAndCheck(DBUS_TYPE_UINT32, &value);
-}
-
-inline void MessageWriter::PutInt64(int64_t value) {
- WriteAndCheck(DBUS_TYPE_INT64, &value);
-}
-
-inline void MessageWriter::PutUint64(uint64_t value) {
- WriteAndCheck(DBUS_TYPE_UINT64, &value);
-}
-
-inline void MessageWriter::PutDouble(double value) {
- WriteAndCheck(DBUS_TYPE_DOUBLE, &value);
-}
-
-inline void MessageWriter::PutString(const std::string& value) {
- const char* pointer = value.c_str();
- WriteAndCheck(DBUS_TYPE_STRING, &pointer);
-}
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
diff --git a/src/components/dbus/include/dbus/message_descriptions.h b/src/components/dbus/include/dbus/message_descriptions.h
deleted file mode 100644
index a9e7a5e141..0000000000
--- a/src/components/dbus/include/dbus/message_descriptions.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-
-#include <stdint.h>
-#include <stdlib.h>
-#include "interfaces/HMI_API.h"
-
-namespace ford_message_descriptions {
-
-enum ParameterType { Integer, Boolean, Float, String, Struct, Enum, Array };
-
-struct ParameterDescription {
- const char* name;
- const ParameterType type;
- const bool obligatory; // TODO (dchmerev@luxoft.com): rename to 'mandatory'
- // as in HMI API description
-};
-
-struct ArrayDescription {
- const ParameterDescription base;
- const ParameterDescription* element;
- const char* element_dbus_signature;
-};
-
-struct StructDescription {
- const ParameterDescription base;
- const ParameterDescription** parameters;
-};
-
-struct MessageDescription {
- const char* interface;
- const char* name;
- const hmi_apis::messageType::eType message_type;
- const hmi_apis::FunctionID::eType function_id;
- const ParameterDescription** parameters;
-};
-
-extern const MessageDescription* message_descriptions[];
-
-} // namespace ford_message_descriptions
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
deleted file mode 100644
index 3dfe49cc95..0000000000
--- a/src/components/dbus/include/dbus/schema.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
-
-#include <string>
-#include <vector>
-#include <utility>
-
-#include "dbus/message_descriptions.h"
-#include "interfaces/HMI_API.h"
-
-namespace dbus {
-
-using ford_message_descriptions::ParameterDescription;
-using ford_message_descriptions::MessageDescription;
-
-struct Description;
-
-typedef hmi_apis::FunctionID::eType MessageId;
-typedef hmi_apis::messageType::eType MessageType;
-typedef std::pair<std::string, std::string> MessageName; // interface, message
-typedef std::vector<const ParameterDescription*> ListArgs;
-typedef std::vector<const Description*> Messages;
-
-/**
- * \brief Wrapper class for message description
- */
-class DBusSchema {
- public:
- explicit DBusSchema(const MessageDescription** array);
-
- /**
- * \brief gets message name by message id
- * \param id id message
- * \return name message
- */
- MessageName getMessageName(MessageId id) const;
-
- /**
- * \brief gets message id by message name
- * \param name name message
- * \return id message
- */
- MessageId getMessageId(const MessageName& name) const;
-
- /**
- * \brief gets list rules for arguments
- * \param id id message
- * \param type type message
- * \return list rules
- */
- ListArgs getListArgs(MessageId id, MessageType type) const;
-
- /**
- * \brief gets list rules for arguments
- * @param name name message
- * @param type type message
- * @return list rules
- */
- ListArgs getListArgs(const MessageName& name, MessageType type) const;
-
- private:
- Messages msgs_;
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
diff --git a/src/components/dbus/src/dbus_adapter.cc b/src/components/dbus/src/dbus_adapter.cc
deleted file mode 100644
index d3f547a893..0000000000
--- a/src/components/dbus/src/dbus_adapter.cc
+++ /dev/null
@@ -1,933 +0,0 @@
-/*
- * Copyright (c) 2013-2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus/dbus_adapter.h"
-#include <dbus/dbus.h>
-#include <sstream>
-#include "formatters/CSmartFactory.hpp"
-#include "utils/logger.h"
-#include "smart_objects/smart_object.h"
-
-using ford_message_descriptions::ParameterDescription;
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-extern char introspection_xml[];
-
-namespace dbus {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusAdapter::DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : sdl_service_name_(sdlServiceName)
- , sdl_object_path_(sdlObjectPath)
- , hmi_service_name_(hmiServiceName)
- , hmi_object_path_(hmiObjectPath)
- , conn_(NULL)
- , schema_(new DBusSchema(ford_message_descriptions::message_descriptions)) {
-}
-
-DBusAdapter::~DBusAdapter() {
- dbus_shutdown();
- delete schema_;
-}
-
-bool DBusAdapter::Init() {
- DBusError err;
- int ret;
- dbus_error_init(&err);
- if (!dbus_threads_init_default()) {
- LOG4CXX_ERROR(logger_, "DBus: Can't initializes threads");
- return false;
- }
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Connection Error " << err.message);
- dbus_error_free(&err);
- return false;
- }
- ret = dbus_bus_request_name(
- conn_, sdl_service_name_.c_str(), DBUS_NAME_FLAG_DO_NOT_QUEUE, &err);
- if (ret == -1 || dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't request name " << err.name);
- dbus_error_free(&err);
- return false;
- }
- if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
- LOG4CXX_ERROR(logger_,
- "DBus: Service '" << sdl_service_name_
- << "' is already running");
- return false;
- }
-
- LOG4CXX_INFO(logger_, "DBus: Success init dbus adaptor");
- return true;
-}
-
-bool DBusAdapter::Process(smart_objects::SmartObject& obj) {
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't initialized");
- return false;
- }
- DBusMessage* msg = dbus_connection_pop_message(conn_);
- if (msg != NULL) {
- switch (dbus_message_get_type(msg)) {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- return ProcessMethodCall(msg, obj);
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- return ProcessMethodReturn(msg, obj);
- case DBUS_MESSAGE_TYPE_ERROR:
- return ProcessError(msg, obj);
- case DBUS_MESSAGE_TYPE_SIGNAL:
- return ProcessSignal(msg, obj);
- default:
- return false;
- }
- } else {
- dbus_connection_read_write(conn_, 50);
- }
- return false;
-}
-
-void DBusAdapter::MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method return " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* reply;
- reply = dbus_message_new_method_return(msg);
- if (NULL == reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::response);
- if (!SetArguments(reply, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, reply, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success return method");
-}
-
-void DBusAdapter::Error(uint id,
- const std::string& name,
- const std::string& description) {
- LOG4CXX_DEBUG(logger_, "Error " << name << ": " << description);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* error;
- error = dbus_message_new_error(msg, name.c_str(), description.c_str());
- if (NULL == error) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, error, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(error);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(error);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success error");
-}
-
-void DBusAdapter::MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method call " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_method_call(
- hmi_service_name_.c_str(),
- hmi_object_path_.c_str(),
- (hmi_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::request);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, msg, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(msg);
- return;
- }
- SaveRequestToHMI(serial, std::make_pair(id, func_id));
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success call method");
-}
-
-void DBusAdapter::Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Signal " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_signal(sdl_object_path_.c_str(),
- (sdl_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::notification);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- if (!dbus_connection_send(conn_, msg, NULL)) { // serial isn't required
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Out Of Memory)");
- dbus_message_unref(msg);
- return;
- }
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success emit signal");
-}
-
-void DBusAdapter::AddMatch(const std::string& rule) {
- LOG4CXX_INFO(logger_, "Subscription: " << rule);
- dbus_bus_add_match(conn_, rule.c_str(), NULL);
-}
-
-bool DBusAdapter::ProcessMethodCall(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of method " << interface << " " << method);
-
- if (interface == "org.freedesktop.DBus.Introspectable" &&
- method == "Introspect") {
- LOG4CXX_INFO(logger_, "DBus: INTROSPECT");
- Introspect(msg);
- return false;
- }
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method call from hmi");
- return false;
- }
-
- uint32_t serial = dbus_message_get_serial(msg);
- if (!serial) {
- LOG4CXX_ERROR(logger_, "DBus: Serial of request from HMI isn't defined");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = serial;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::request;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::request);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- if (GetArguments(&iter, args, obj[sos::S_MSG_PARAMS])) {
- SaveRequestFromHMI(serial, msg);
- return true;
- }
- return false;
-}
-
-bool DBusAdapter::ProcessMethodReturn(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- ListArgs args =
- schema_->getListArgs(ids.second, hmi_apis::messageType::response);
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- int code = 0;
- std::string message;
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- bool ret = GetHeader(&iter, &code, &message) &&
- GetArguments(&iter, args, description);
-
- if (ret) {
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::response;
- obj[sos::S_PARAMS][sos::kCode] = code;
- obj[sos::S_PARAMS][sos::kMessage] = message;
- if (code != hmi_apis::Common_Result::SUCCESS) {
- MessageName name = schema_->getMessageName(ids.second);
- description["method"] = name.first + "." + name.second;
- obj[sos::S_PARAMS]["data"] = description;
- } else {
- obj[sos::S_MSG_PARAMS] = description;
- }
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessError(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- const char* error_name;
- bool ret = false;
- if ((error_name = dbus_message_get_error_name(msg)) != NULL) {
- smart_objects::SmartObject name(smart_objects::SmartType_String);
- name = error_name;
- ford_message_descriptions::ParameterDescription rule = {
- "description", ford_message_descriptions::String, true};
- ListArgs args;
- args.push_back(&rule);
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- description[rule.name] =
- smart_objects::SmartObject(smart_objects::SmartType_String);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- ret = GetArguments(&iter, args, description);
- MessageName method = schema_->getMessageName(ids.second);
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] =
- hmi_apis::messageType::error_response;
- obj[sos::S_PARAMS][sos::kCode] = name.asInt();
- obj[sos::S_PARAMS][sos::kMessage] = description[rule.name].asString();
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS]["data"]["method"] = method.first + "." + method.second;
-
- LOG4CXX_WARN(logger_,
- "DBus: Call of method " << method.first << "." << method.second
- << " returned error " << name.asInt()
- << ": "
- << description[rule.name].asString());
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Type message isn't error");
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessSignal(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of signal " << method);
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name signal");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::notification;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::notification);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- bool ret = GetArguments(&iter, args, obj[sos::S_MSG_PARAMS]);
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args) {
- DBusMessageIter iter;
- dbus_message_iter_init_append(msg, &iter);
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- const smart_objects::SmartObject& param = args.getElement(rules[i]->name);
- if (!SetOneArgument(&iter, rules[i], param)) {
- return false;
- }
- }
- return true;
-}
-
-bool DBusAdapter::SetOneArgument(DBusMessageIter* iter,
- const ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- if (rules->obligatory) {
- if (param.isValid()) {
- return SetValue(iter, rules, param);
- } else {
- LOG4CXX_WARN(logger_,
- "DBus: Argument '" << rules->name << "' is obligatory!");
- return false;
- }
- } else {
- return SetOptionalValue(iter, rules, param);
- }
-}
-
-bool DBusAdapter::SetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- // LOG4CXX_DEBUG(logger_, "DBus: Set param " << rules->name << " = " <<
- // param.asString());
- int type = 0;
- void* value = 0;
- dbus_int32_t integerValue = 0;
- double floatValue = 0;
- dbus_bool_t booleanValue = false;
- const char* stringValue;
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- return SetArrayValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::ArrayDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Struct:
- return SetStructValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::StructDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- type = DBUS_TYPE_INT32;
- integerValue = param.asInt();
- value = &integerValue;
- break;
- case ford_message_descriptions::ParameterType::Float:
- type = DBUS_TYPE_DOUBLE;
- floatValue = param.asDouble();
- value = &floatValue;
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- type = DBUS_TYPE_BOOLEAN;
- booleanValue = param.asBool();
- value = &booleanValue;
- break;
- case ford_message_descriptions::ParameterType::String:
- type = DBUS_TYPE_STRING;
- stringValue = param.asString().c_str();
- value = &stringValue;
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return dbus_message_iter_append_basic(iter, type, value);
-}
-
-bool DBusAdapter::SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't open container type (STRUCT) for optional parameter");
- return false;
- }
-
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag(param.getType() !=
- smart_objects::SmartType_Invalid);
- if (!SetValue(&sub_iter, &flagRules, flag) ||
- !SetValue(&sub_iter, rules, param)) {
- return false;
- }
-
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't close container type (STRUCT) for optional parameter");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param) {
- smart_objects::SmartType type = param.getType();
- if (type != smart_objects::SmartType_Array &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_ARRAY, rules->element_dbus_signature, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (ARRAY)");
- return false;
- }
- size_t size = param.length();
- for (size_t i = 0; i < size; ++i) {
- if (!SetValue(&sub_iter, rules->element, param[i])) {
- return false;
- }
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (ARRAY)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& structure) {
- smart_objects::SmartType type = structure.getType();
- if (type != smart_objects::SmartType_Map &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (STRUCT)");
- return false;
- }
- const ParameterDescription** entry;
- entry = rules->parameters;
- while (*entry != NULL) {
- const smart_objects::SmartObject& param =
- structure.getElement((*entry)->name);
- if (!SetOneArgument(&sub_iter, *entry, param)) {
- return false;
- }
- entry++;
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (STRUCT)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetHeader(DBusMessageIter* iter,
- int* code,
- std::string* message) {
- // Get code of response
- dbus_int32_t intValue;
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_INT32) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- dbus_message_iter_get_basic(iter, &intValue);
- *code = intValue;
- LOG4CXX_DEBUG(logger_, "DBus: Code of response " << *code);
-
- dbus_message_iter_next(iter);
-
- // Get message of response
- type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRING) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- *message = stringValue;
- LOG4CXX_DEBUG(logger_, "DBus: message of response " << *message);
-
- dbus_message_iter_next(iter);
- return true;
-}
-
-bool DBusAdapter::GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- if (!GetOneArgument(iter, rules[i], args)) {
- return false;
- }
- dbus_message_iter_next(iter);
- }
- return true;
-}
-
-const DBusSchema& DBusAdapter::get_schema() const {
- return *schema_;
-}
-
-bool DBusAdapter::GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args) {
- if (rules->obligatory) {
- return GetValue(iter, rules, args[rules->name]);
- } else {
- return GetOptionalValue(iter, rules, args);
- }
-}
-
-bool DBusAdapter::GetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- LOG4CXX_DEBUG(logger_, "DBus: Get param " << rules->name);
- int type = dbus_message_iter_get_arg_type(iter);
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- if (type == DBUS_TYPE_ARRAY) {
- return GetArrayValue(
- iter,
- // FIXME (dchmerev@luxoft.com): not portable, danger cast.
- reinterpret_cast<
- const ford_message_descriptions::ArrayDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Struct:
- if (type == DBUS_TYPE_STRUCT) {
- return GetStructValue(
- iter,
- reinterpret_cast<
- const ford_message_descriptions::StructDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- if (type == DBUS_TYPE_INT32) {
- dbus_int32_t integerValue;
- dbus_message_iter_get_basic(iter, &integerValue);
- smart_objects::SmartObject value(integerValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << integerValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Float:
- if (type == DBUS_TYPE_DOUBLE) {
- double floatValue;
- dbus_message_iter_get_basic(iter, &floatValue);
- smart_objects::SmartObject value(floatValue);
- param = value;
- LOG4CXX_DEBUG(logger_, "DBus: " << rules->name << " = " << floatValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- if (type == DBUS_TYPE_BOOLEAN) {
- dbus_bool_t booleanValue;
- dbus_message_iter_get_basic(iter, &booleanValue);
- smart_objects::SmartObject value(static_cast<bool>(booleanValue));
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << std::boolalpha
- << booleanValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::String:
- if (type == DBUS_TYPE_STRING) {
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- std::string strValue = stringValue;
- smart_objects::SmartObject value(strValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = \"" << strValue << "\"");
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param) {
- smart_objects::SmartObject array(smart_objects::SmartType_Array);
-
- int i = 0;
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- while (dbus_message_iter_get_arg_type(&sub_iter) != DBUS_TYPE_INVALID) {
- if (!GetValue(&sub_iter, rules->element, array[i])) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- i++;
- }
- param = array;
- return true;
-}
-
-bool DBusAdapter::GetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- const ParameterDescription** entry;
- entry = rules->parameters;
- smart_objects::SmartObject structure(smart_objects::SmartType_Map);
- while (*entry != NULL) {
- if (!GetOneArgument(&sub_iter, *entry, structure)) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- entry++;
- }
- param = structure;
- return true;
-}
-
-bool DBusAdapter::GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRUCT) {
- LOG4CXX_WARN(
- logger_,
- "DBus: Not expected type of argument. It is not optional parameter.");
- return false;
- }
-
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag;
- if (!GetValue(&sub_iter, &flagRules, flag)) {
- return false;
- }
- if (flag.asBool()) {
- dbus_message_iter_next(&sub_iter);
- return GetValue(&sub_iter, rules, param[rules->name]);
- } else {
- return true;
- }
-}
-
-std::pair<uint, MessageId> DBusAdapter::GetRequestToHMI(uint32_t serial) {
- std::map<uint32_t, std::pair<uint, MessageId> >::iterator it;
- it = requests_to_hmi_.find(serial);
- if (it != requests_to_hmi_.end()) {
- std::pair<uint, MessageId> ids = it->second;
- requests_to_hmi_.erase(it);
- return ids;
- }
- return std::make_pair(0, hmi_apis::FunctionID::INVALID_ENUM);
-}
-
-void DBusAdapter::SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids) {
- requests_to_hmi_.insert(std::make_pair(serial, ids));
-}
-
-void DBusAdapter::Introspect(DBusMessage* msg) {
- DBusMessage* reply;
-
- dbus_uint32_t serial = dbus_message_get_serial(msg);
- reply = dbus_message_new_method_return(msg);
- if (!reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed return method for introspection");
- return;
- }
-
- DBusMessageIter iter;
- dbus_message_iter_init_append(reply, &iter);
- char* value = introspection_xml;
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &value);
- dbus_connection_send(conn_, reply, &serial);
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
-}
-
-void DBusAdapter::SaveRequestFromHMI(uint32_t serial, DBusMessage* request) {
- LOG4CXX_DEBUG(logger_, "Save correlation id (serial id) : " << serial);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << request);
- requests_from_hmi_.insert(std::make_pair(serial, request));
-}
-
-DBusMessage* DBusAdapter::GetRequestFromHMI(uint32_t serial) {
- LOG4CXX_DEBUG(logger_, "Get correlation id (serial id) : " << serial);
- std::map<uint32_t, DBusMessage*>::iterator it;
- it = requests_from_hmi_.find(serial);
- if (it != requests_from_hmi_.end()) {
- DBusMessage* msg = it->second;
- requests_from_hmi_.erase(it);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << msg);
- return msg;
- }
- return 0;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message.cc b/src/components/dbus/src/dbus_message.cc
deleted file mode 100644
index b8a55896ce..0000000000
--- a/src/components/dbus/src/dbus_message.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus/dbus_message.h"
-
-#include <algorithm>
-#include <cassert>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-MessageRefKeeper::MessageRefKeeper() : raw_message_(NULL) {}
-
-MessageRefKeeper::MessageRefKeeper(DBusMessage* message)
- : raw_message_(message) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper::~MessageRefKeeper() {
- if (raw_message_) {
- dbus_message_unref(raw_message_);
- }
-}
-
-MessageRefKeeper::MessageRefKeeper(const MessageRefKeeper& other)
- : raw_message_(other.raw_message_) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper& MessageRefKeeper::operator=(MessageRefKeeper other) {
- other.swap(*this);
- return *this;
-}
-
-DBusMessage* MessageRefKeeper::get() const {
- return raw_message_;
-}
-
-DBusMessage* MessageRefKeeper::Pass() {
- DBusMessage* message = raw_message_;
- raw_message_ = NULL;
- return message;
-}
-
-void MessageRefKeeper::swap(MessageRefKeeper& other) {
- std::swap(raw_message_, other.raw_message_);
-}
-
-MessageRef::MessageRef(DBusMessage* message) : raw_message_ref_(message) {}
-
-MessageRef::~MessageRef() {}
-
-std::string MessageRef::GetInterface() const {
- return dbus_message_get_interface(raw_message_ref_.get());
-}
-
-std::string MessageRef::GetMember() const {
- return dbus_message_get_member(raw_message_ref_.get());
-}
-
-// Message writer
-MessageReader::MessageReader(const MessageRef& message)
- : parent_reader_(NULL), failed_(false) {
- dbus_bool_t success =
- dbus_message_iter_init(message.raw_message_ref_.get(), &iterator_);
- if (!success) {
- MarkFailed();
- }
-}
-
-MessageReader::MessageReader(MessageReader* reader,
- DataType container_data_type)
- : parent_reader_(reader), failed_(reader->has_failed()) {
- assert(parent_reader_);
- if (!failed_) {
- if (reader->NextValueType() != container_data_type) {
- MarkFailed();
- } else {
- dbus_message_iter_recurse(&reader->iterator_, &iterator_);
- reader->MoveToNext();
- }
- }
-}
-
-bool MessageReader::NextIsDictEntry() const {
- return NextValueType() == DBUS_TYPE_DICT_ENTRY;
-}
-
-MessageReader MessageReader::TakeArrayReader() {
- return MessageReader(this, DBUS_TYPE_ARRAY);
-}
-
-MessageReader MessageReader::TakeStructReader() {
- return MessageReader(this, DBUS_TYPE_STRUCT);
-}
-
-MessageReader MessageReader::TakeDictEntryReader() {
- return MessageReader(this, DBUS_TYPE_DICT_ENTRY);
-}
-
-void MessageReader::MoveToNext() {
- if (!HasNext()) {
- MarkFailed();
- }
- dbus_message_iter_next(&iterator_);
-}
-
-void MessageReader::MarkFailed() {
- if (!failed_) {
- failed_ = true;
- if (parent_reader_) {
- parent_reader_->MarkFailed();
- }
- }
-}
-
-void MessageReader::ReadNextValue(MessageReader::DataType type, void* value) {
- assert(value);
- if (NextValueType() != type) {
- MarkFailed();
- } else if (!failed_) {
- dbus_message_iter_get_basic(&iterator_, value);
- MoveToNext();
- }
-}
-
-// DbusMessageWriter
-MessageWriter::MessageWriter(const MessageRef& message)
- : has_opened_subcontainer_(false), parent_writer_(NULL) {
- dbus_message_iter_init_append(message.raw_message_ref_.get(), &iterator_);
-}
-
-MessageWriter::MessageWriter(MessageWriter* parent,
- ContainerType container_type,
- const char* array_signature)
- : has_opened_subcontainer_(false), parent_writer_(parent) {
- assert(parent_writer_);
- // Only array writers require array_signature
- assert((container_type == kArray && array_signature != NULL) ||
- (container_type != kArray && array_signature == NULL));
- assert(!parent_writer_->has_opened_subcontainer_);
- bool enough_memory = dbus_message_iter_open_container(
- &parent_writer_->iterator_, container_type, array_signature, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = true;
-}
-
-MessageWriter::~MessageWriter() {
- assert(!has_opened_subcontainer_);
- if (parent_writer_ != NULL) {
- CloseWriter();
- }
-}
-
-void MessageWriter::WriteAndCheck(MessageWriter::DataType value_type,
- const void* value) {
- assert(!has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_append_basic(&iterator_, value_type, value);
- assert(enough_memory);
-}
-
-void MessageWriter::CloseWriter() {
- assert(parent_writer_);
- assert(parent_writer_->has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_close_container(&parent_writer_->iterator_, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = false;
-}
-
-// Construction functions
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method) {
- return MessageRef(
- dbus_message_new_method_call(bus_name, path, interface, method));
-}
-
-MessageRef Signal(const char* path, const char* interface, const char* name) {
- return MessageRef(dbus_message_new_signal(path, interface, name));
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message_controller.cc b/src/components/dbus/src/dbus_message_controller.cc
deleted file mode 100644
index 166037e900..0000000000
--- a/src/components/dbus/src/dbus_message_controller.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus/dbus_message_controller.h"
-#include "formatters/CSmartFactory.hpp"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace dbus {
-
-DBusMessageController::DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : DBusAdapter(
- sdlServiceName, sdlObjectPath, hmiServiceName, hmiObjectPath) {}
-
-void DBusMessageController::SubscribeTo(const std::string& interface,
- const std::string& signal) {
- std::string rule = "type='signal'";
- rule.append(", sender='")
- .append(hmi_service_name_)
- .append("'")
- .append(", path='")
- .append(hmi_object_path_)
- .append("'")
- .append(", interface='")
- .append(hmi_service_name_)
- .append(".")
- .append(interface)
- .append("'")
- .append(", member='")
- .append(signal)
- .append("'");
- DBusAdapter::AddMatch(rule);
-}
-
-DBusMessageController::~DBusMessageController() {}
-
-void* DBusMessageController::MethodForReceiverThread(void*) {
- while (true) {
- smart_objects::SmartObject obj(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS][sos::S_PROTOCOL_VERSION] = 2;
- obj[sos::S_PARAMS][sos::S_PROTOCOL_TYPE] = 1;
- if (DBusAdapter::Process(obj)) {
- SendMessageToCore(obj);
- }
- }
- return NULL;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/schema.cc b/src/components/dbus/src/schema.cc
deleted file mode 100644
index 3107d9ce6c..0000000000
--- a/src/components/dbus/src/schema.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "dbus/schema.h"
-
-#include <algorithm>
-#include <functional>
-
-namespace dbus {
-
-struct Description {
- MessageId id;
- MessageName name;
- MessageType type;
- ListArgs args;
-};
-
-struct IsId : public std::unary_function<const Description*, bool> {
- explicit IsId(MessageId id) : id_(id) {}
- bool operator()(const Description* desc) {
- return desc->id == id_;
- }
-
- private:
- MessageId id_;
-};
-
-struct IsName : public std::unary_function<const Description*, bool> {
- explicit IsName(const MessageName& name) : name_(name) {}
- bool operator()(const Description* desc) {
- return desc->name == name_;
- }
-
- private:
- MessageName name_;
-};
-
-struct IsIdType : public std::unary_function<const Description*, bool> {
- explicit IsIdType(const MessageId& id, const MessageType& type)
- : id_(id), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->id == id_ && desc->type == type_;
- }
-
- private:
- MessageId id_;
- MessageType type_;
-};
-
-struct IsNameType : public std::unary_function<const Description*, bool> {
- explicit IsNameType(const MessageName& name, const MessageType& type)
- : name_(name), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->name == name_ && desc->type == type_;
- }
-
- private:
- MessageName name_;
- MessageType type_;
-};
-
-DBusSchema::DBusSchema(const MessageDescription** array) {
- const MessageDescription** msg = array;
- while (*msg != NULL) {
- Description* desc = new Description();
- desc->id = (*msg)->function_id;
- desc->name = std::make_pair((*msg)->interface, (*msg)->name);
- desc->type = (*msg)->message_type;
- const ParameterDescription** param;
- param = (*msg)->parameters;
- while (*param != NULL) {
- desc->args.push_back(*param);
- param++;
- }
- msgs_.push_back(desc);
- msg++;
- }
-}
-
-MessageName DBusSchema::getMessageName(MessageId id) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsId(id));
- if (msgs_.end() != it) {
- return (*it)->name;
- }
- return MessageName();
-}
-
-MessageId DBusSchema::getMessageId(const MessageName& name) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsName(name));
- if (msgs_.end() != it) {
- return (*it)->id;
- }
- return hmi_apis::FunctionID::eType::INVALID_ENUM;
-}
-
-ListArgs DBusSchema::getListArgs(MessageId id, MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsIdType(id, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-ListArgs DBusSchema::getListArgs(const MessageName& name,
- MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsNameType(name, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-} // namespace dbus_schema
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt
deleted file mode 100644
index 1b3df2c0e7..0000000000
--- a/src/components/dbus/test/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories (
- ${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/dbus/include/
-)
-
-#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
- formatters
- SmartObjects
-)
-
-create_test(test_DBus_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/dbus/test/dbus_adapter_test.cc b/src/components/dbus/test/dbus_adapter_test.cc
deleted file mode 100644
index 74a6de1aa9..0000000000
--- a/src/components/dbus/test/dbus_adapter_test.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <gtest/gtest.h>
-#include "dbus/dbus_adapter.h"
-
-using ::dbus::DBusAdapter;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class DBusAdapterTest : public ::testing::Test {};
-
-TEST_F(DBusAdapterTest, Initialization) {
- const std::string kSdlServiceName = "test.ford.sdl.core";
- const std::string kSdlObjectPath = "/";
- const std::string kHmiServiceName = "test.ford.sdl.hmi";
- const std::string kHmiObjectPath = "/";
- ::dbus::DBusAdapter adapter(
- kSdlServiceName, kSdlObjectPath, kHmiServiceName, kHmiObjectPath);
- EXPECT_TRUE(adapter.Init());
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/dbus_message_controller_test.cc b/src/components/dbus/test/dbus_message_controller_test.cc
deleted file mode 100644
index 5c5d4e69d5..0000000000
--- a/src/components/dbus/test/dbus_message_controller_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pthread.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-#include "hmi_message_handler/mock_dbus_message_controller.h"
-#include "hmi_message_handler/mock_subscriber.h"
-
-using ::testing::_;
-
-namespace test {
-namespace components {
-namespace hmi_message_handler {
-
-ACTION_P(SignalTest, test) {
- if (test->thread_id != pthread_self()) {
- pthread_mutex_lock(&test->test_mutex);
- pthread_cond_signal(&test->test_cond);
- pthread_mutex_unlock(&test->test_mutex);
- } else {
- test->one_thread = true;
- }
-}
-
-class DBusMessageControllerTest : public ::testing::Test {
- public:
- volatile bool one_thread;
- pthread_t thread_id;
- static pthread_mutex_t test_mutex;
- static pthread_cond_t test_cond;
-
- protected:
- MockDBusMessageController* controller_;
- MockSubscriber* subscriber_;
-
- static void SetUpTestCase() {}
-
- static void TearDownTestCase() {}
-
- virtual void SetUp() {
- const std::string kService = "sdl.core.test_api";
- const std::string kPath = "/dbus_test";
- controller_ = new MockDBusMessageController(kService, kPath);
- subscriber_ = new MockSubscriber(kService, kPath);
- ASSERT_TRUE(controller_->Init());
- ASSERT_TRUE(subscriber_->Start());
- }
-
- void TearDown() OVERRIDE {
- delete controller_;
- delete subscriber_;
- }
-
- bool waitCond(int seconds) {
- if (one_thread)
- return true;
- timespec elapsed;
- clock_gettime(CLOCK_REALTIME, &elapsed);
- elapsed.tv_sec += seconds;
- return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) !=
- ETIMEDOUT;
- }
-};
-
-pthread_mutex_t DBusMessageControllerTest::test_mutex;
-pthread_cond_t DBusMessageControllerTest::test_cond;
-
-TEST_F(DBusMessageControllerTest, Receive) {
- std::string text = "Test message for call method DBus";
- EXPECT_CALL(*controller_, Recv(text)).Times(1).WillOnce(SignalTest(this));
- subscriber_->Send(text);
- EXPECT_TRUE(waitCond(1));
-}
-
-TEST_F(DBusMessageControllerTest, DISABLED_Send) {
- const std::string kText = "Test message for signal DBus";
- // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1);
- controller_->Send(kText);
-}
-
-} // namespace hmi_message_handler
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/schema_test.cc b/src/components/dbus/test/schema_test.cc
deleted file mode 100644
index 37831279b9..0000000000
--- a/src/components/dbus/test/schema_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * \file test_schema.cc
- * \brief
- *
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <gtest/gtest.h>
-#include "dbus/schema.h"
-
-using dbus::DBusSchema;
-using dbus::MessageId;
-using dbus::MessageName;
-using dbus::MessageType;
-using dbus::ListArgs;
-using ford_message_descriptions::ParameterDescription;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class DBusSchemaTest : public ::testing::Test {
- protected:
- static void SetUpTestCase() {
- schema_ = new DBusSchema(ford_message_descriptions::message_descriptions);
- }
-
- static void TearDownTestCase() {
- delete schema_;
- }
-
- static const DBusSchema* schema_;
- static const int test_negative_value = -3;
-};
-
-const DBusSchema* DBusSchemaTest::schema_ = 0;
-
-TEST_F(DBusSchemaTest, GetName) {
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- const MessageName kExpName("Buttons", "GetCapabilities");
- MessageName name = schema_->getMessageName(kId);
- EXPECT_EQ(kExpName, name);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kExpNameWrong("", "");
- name = schema_->getMessageName(kIdWrong);
- EXPECT_EQ(kExpNameWrong, name);
-}
-
-TEST_F(DBusSchemaTest, GetId) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageId kExpId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- MessageId id = schema_->getMessageId(kName);
- EXPECT_EQ(kExpId, id);
-
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageId kExpIdWrong = hmi_apis::FunctionID::INVALID_ENUM;
- id = schema_->getMessageId(kNameWrong);
- EXPECT_EQ(kExpIdWrong, id);
-}
-
-TEST_F(DBusSchemaTest, GetListArg) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageType kType = hmi_apis::messageType::response;
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- ListArgs argsName = schema_->getListArgs(kName, kType);
- const ParameterDescription** params =
- ford_message_descriptions::message_descriptions[1]->parameters;
- EXPECT_EQ(params[0], argsName[0]);
- EXPECT_EQ(params[1], argsName[1]);
-
- ListArgs argsId = schema_->getListArgs(kId, kType);
- EXPECT_EQ(params[0], argsId[0]);
- EXPECT_EQ(params[1], argsId[1]);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageType kTypeWrong =
- static_cast<const MessageType>(test_negative_value);
- const ListArgs kExpListWrong;
- argsName = schema_->getListArgs(kNameWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsName);
-
- argsId = schema_->getListArgs(kIdWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsId);
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h
index 1df706839f..66ffa0c1c5 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonBase.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h
@@ -38,9 +38,9 @@
#include "smart_objects/smart_object.h"
#include "json/json.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
namespace meta_formatter_error_code {
/**
@@ -99,7 +99,7 @@ class CFormatterJsonBase {
*/
static void jsonValueToObj(
const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief The method constructs a JSON object from the input SmartObject
@@ -109,11 +109,11 @@ class CFormatterJsonBase {
*input SmartObject.
*/
static void objToJsonValue(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
Json::Value& value);
};
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index f22b1216ab..d2fdf87957 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
@@ -40,9 +40,9 @@
#include "formatters/CSmartFactory.h"
#include "formatters/meta_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -69,7 +69,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @brief Extracts a message type from the SmartObject
*/
static const std::string getMessageType(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief Extracts a message type from the root JSON object.
@@ -117,7 +117,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
static const int32_t kMessageTypeNotFound;
static const int32_t kCorrelationIdNotFound;
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -129,7 +129,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -142,7 +142,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
template <typename FunctionId, typename MessageType>
static int32_t fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out);
+ ns_smart_device_link::ns_smart_objects::SmartObject& out);
/**
* @brief Converts to string the smart object against the given schema
@@ -154,17 +154,17 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
// ----------------------------------------------------------------------------
template <typename FunctionId, typename MessageType>
-int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
+int32_t formatters::CFormatterJsonSDLRPCv1::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
@@ -189,7 +189,7 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
MessageType messageType = MessageType::INVALID_ENUM;
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
type, &messageType)) {
// If MessageType is not found than FunctionId and CorrelationId can not
// be found either
@@ -199,14 +199,14 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::StringToEnum(
root[type][S_NAME].asString(), &functionId)) {
result = kFunctionIdNotFound;
functionId = FunctionId::INVALID_ENUM;
}
}
- namespace S = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace S = ns_smart_device_link::ns_json_handler::strings;
if (!(result & kMessageTypeNotFound)) {
jsonValueToObj(root[type][S_PARAMETERS], out[S::S_MSG_PARAMS]);
@@ -234,6 +234,6 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index 8260a35959..e248954552 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
@@ -38,9 +38,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -64,7 +64,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
CFormatterJsonSDLRPCv2(const CFormatterJsonSDLRPCv2&);
public:
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -76,7 +76,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -91,10 +91,11 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType);
/**
* @brief Creates a SmartObject from a JSON string.
@@ -113,11 +114,12 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType,
- int32_t correlationId);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType,
+ int32_t correlationId);
/**
* @brief Converts to string the smart object against the given schema
@@ -129,15 +131,15 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType) {
bool result = true;
@@ -146,7 +148,7 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
bool result = reader.parse(str, root);
if (true == result) {
@@ -167,12 +169,12 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType,
int32_t correlationId) {
bool result = fromString(str, out, functionId, messageType);
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (true == result) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] = correlationId;
@@ -182,6 +184,6 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index 9fed89253b..a48eab2a6b 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -40,8 +40,8 @@
#include <map>
#include <string>
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
/**
* @brief String constants used by SmartFactory.
*/
@@ -82,6 +82,10 @@ extern const std::string S_PROTOCOL_TYPE;
extern const std::string S_CORRELATION_ID;
/**
+ * @brief String constant for RPC_MSG_VERSION.
+ */
+extern const std::string S_RPC_MSG_VERSION;
+/**
* @brief String constant for "code" param name.
*/
extern const std::string kCode;
@@ -149,8 +153,10 @@ class CSmartFactory {
*
* @return True if operation was successful or false otherwise.
*/
- bool attachSchema(NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters);
+ bool attachSchema(
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Attach schema to the struct SmartObject.
@@ -160,8 +166,9 @@ class CSmartFactory {
*
* @return True if operation was successful of false otherwise.
*/
- bool AttachSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object);
+ bool AttachSchema(
+ const StructIdEnum struct_id,
+ ns_smart_device_link::ns_smart_objects::SmartObject& object);
/**
* @brief Create new SmartObject with attached function SmartSchema.
@@ -176,7 +183,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type);
/**
@@ -191,7 +198,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const StructIdEnum struct_id);
/**
@@ -210,7 +217,7 @@ class CSmartFactory {
*/
bool GetSchema(const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
/**
* @brief Get SmartSchema for specific struct.
@@ -227,7 +234,7 @@ class CSmartFactory {
* found or false otherwise.
*/
bool GetSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
protected:
/**
@@ -237,7 +244,7 @@ class CSmartFactory {
* functions.
*/
typedef std::map<SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
FuncionsSchemesMap;
/**
@@ -247,7 +254,7 @@ class CSmartFactory {
* structs.
*/
typedef std::map<StructIdEnum,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
StructsSchemesMap;
/**
@@ -268,8 +275,9 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CSmartFactory(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (false == object.keyExists(strings::S_PARAMS))
return false;
if (false == object[strings::S_PARAMS].keyExists(strings::S_MESSAGE_TYPE))
@@ -295,7 +303,9 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
}
object.setSchema(schemaIterator->second);
- schemaIterator->second.applySchema(object, RemoveFakeParameters);
+
+ schemaIterator->second.applySchema(
+ object, RemoveFakeParameters, MessageVersion);
return true;
}
@@ -303,7 +313,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
@@ -318,7 +328,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
@@ -328,34 +338,34 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
functions_schemes_.find(key);
if (schema_iterator != functions_schemes_.end()) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject function_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject function_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
function_object.setSchema(schema_iterator->second);
schema_iterator->second.applySchema(function_object, false);
return function_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const StructIdEnum struct_id) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject struct_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject struct_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
if (AttachSchema(struct_id, struct_object)) {
return struct_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
message_type);
@@ -373,7 +383,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 3d921ea901..842e176976 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -45,9 +45,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formatter for JSON RPC format.
@@ -108,7 +108,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*
* @return true if success, false otherwise.
*/
- static bool ToString(const NsSmartObjects::SmartObject& obj,
+ static bool ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -125,7 +125,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId, typename MessageType>
static int32_t FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
private:
/**
@@ -223,7 +223,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId>
static int32_t ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
/**
* @brief Set method.
@@ -237,7 +237,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if function id was extracted successfully and set as a
* value of "method" field.
*/
- static bool SetMethod(const NsSmartObjects::SmartObject& params,
+ static bool SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container);
/**
@@ -252,7 +252,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if request/response id was extracted successfully and set
* as a value of "id" field.
*/
- static bool SetId(const NsSmartObjects::SmartObject& params,
+ static bool SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
/**
@@ -267,18 +267,18 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if message string was extracted successfully and set
* as a value of "message" field.
*/
- static bool SetMessage(const NsSmartObjects::SmartObject& params,
+ static bool SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
};
template <typename FunctionId, typename MessageType>
int32_t FormatterJsonRpc::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (false == reader.parse(str, root)) {
result = kParsingError | kMethodNotSpecified | kUnknownMethod |
@@ -309,7 +309,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
}
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
const Json::Value& id_value = root[kId];
@@ -323,7 +323,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
id_value.asDouble();
} else if (true == id_value.isNull()) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Null);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Null);
} else {
result |= kInvalidFormat | kInvalidId;
}
@@ -332,14 +332,14 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
message_type_string = kRequest;
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
Json::Value method_container;
bool method_container_found = false;
if (true == root.isMember(kResult)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kResponse;
response_value = root[kResult];
@@ -348,7 +348,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
method_container_found = true;
} else if (true == root.isMember(kError)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kErrorResponse;
response_value = root[kError];
response_value_found = true;
@@ -382,7 +382,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
if (0 == (result & kUnknownMessageType)) {
MessageType message_type;
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
message_type_string, &message_type)) {
result |= kUnknownMessageType;
} else {
@@ -469,7 +469,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
template <typename FunctionId>
int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
if (false == method_value.isString()) {
@@ -477,11 +477,11 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
} else {
FunctionId function_id;
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::CStringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::CStringToEnum(
method_value.asCString(), &function_id)) {
result |= kUnknownMethod;
} else {
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
out[strings::S_PARAMS][strings::S_FUNCTION_ID] = function_id;
}
@@ -490,8 +490,8 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
index 2b5d95fd4a..c9b9431ee5 100644
--- a/src/components/formatters/include/formatters/generic_json_formatter.h
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -37,9 +37,9 @@
#include "CFormatterJsonBase.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
class GenericJsonFormatter : public CFormatterJsonBase {
public:
@@ -49,7 +49,7 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @param obj Input SmartObject.
* @param out_str Resulting JSON string.
*/
- static void ToString(const NsSmartObjects::SmartObject& obj,
+ static void ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -61,11 +61,11 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @return true if success, false otherwise.
*/
static bool FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
};
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index 20abb3b848..36e39301f6 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -39,9 +39,9 @@
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formats to string the smart object against given schema for given
@@ -66,13 +66,13 @@ class CMetaFormatter {
* @return true if successful, false - otherwise
*/
static bool CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object);
};
-} // namespace NsSmartDeviceLink
-} // namespace NsSmartDeviceLink::NsJSONHandler
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link
+} // namespace ns_smart_device_link::ns_json_handler
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc
index 0a85a93d21..af8668543a 100644
--- a/src/components/formatters/src/CFormatterJsonBase.cc
+++ b/src/components/formatters/src/CFormatterJsonBase.cc
@@ -35,13 +35,13 @@
#include "formatters/CFormatterJsonBase.h"
#include "utils/convert_utils.h"
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
jsonValueToObj(const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj) {
try {
if (value.type() == Json::objectValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
Json::Value::Members members = value.getMemberNames();
@@ -49,8 +49,8 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
jsonValueToObj(value[members[i]], obj[members[i]]);
}
} else if (value.type() == Json::arrayValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Array);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Array);
for (uint32_t i = 0; i < value.size(); i++) {
jsonValueToObj(value[i], obj[i]);
@@ -72,11 +72,13 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
// ----------------------------------------------------------------------------
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
- objToJsonValue(const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
- Json::Value& item) {
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
+ objToJsonValue(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
+ Json::Value& item) {
try {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == obj.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ obj.getType()) {
item = Json::arrayValue;
for (uint32_t i = 0; i < obj.length(); i++) {
@@ -86,7 +88,7 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item.append(value);
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
obj.getType()) {
item = Json::objectValue;
std::set<std::string> keys = obj.enumerate();
@@ -100,19 +102,19 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item[*key] = value;
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Boolean ==
obj.getType()) {
item = obj.asBool();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Integer ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Integer ==
obj.getType()) {
item = utils::ConvertInt64ToLongLongInt(obj.asInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_UInteger ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_UInteger ==
obj.getType()) {
item = utils::ConvertUInt64ToLongLongUInt(obj.asUInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Double ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Double ==
obj.getType()) {
item = obj.asDouble();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Null ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Null ==
obj.getType()) {
item = Json::nullValue;
} else {
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
index b776b9abd8..121fd43131 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
@@ -34,12 +34,12 @@
#include "formatters/meta_formatter.h"
#include "utils/convert_utils.h"
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
index 9e177ea4a8..ffbb644cc6 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
@@ -31,12 +31,12 @@
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/meta_formatter.h"
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CSmartFactory.cc b/src/components/formatters/src/CSmartFactory.cc
index 6b0808fbfa..c1ee9133ca 100644
--- a/src/components/formatters/src/CSmartFactory.cc
+++ b/src/components/formatters/src/CSmartFactory.cc
@@ -34,19 +34,27 @@
#include "formatters/CSmartFactory.h"
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS(
"msg_params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS("params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_PARAMS(
+ "params");
+const std::string ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID(
"function_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE(
- "message_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION(
- "protocol_version");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE(
- "protocol_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID(
- "correlation_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kCode("code");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kMessage(
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE(
+ "message_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION(
+ "protocol_version");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE(
+ "protocol_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID(
+ "correlation_id");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_RPC_MSG_VERSION(
+ "rpc_msg_version");
+const std::string ns_smart_device_link::ns_json_handler::strings::kCode("code");
+const std::string ns_smart_device_link::ns_json_handler::strings::kMessage(
"message");
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
index e349ced4d6..d50d04d0e9 100644
--- a/src/components/formatters/src/formatter_json_rpc.cc
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -35,11 +35,11 @@
#include "formatters/formatter_json_rpc.h"
#include "utils/convert_utils.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-namespace strings = NsJSONHandler::strings;
+namespace strings = ns_json_handler::strings;
const char* FormatterJsonRpc::kRequest = "request";
const char* FormatterJsonRpc::kResponse = "response";
@@ -56,7 +56,7 @@ const char* FormatterJsonRpc::kCode = "code";
const char* FormatterJsonRpc::kData = "data";
const char* FormatterJsonRpc::kMessage = "message";
-bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
+bool FormatterJsonRpc::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
bool result = true;
try {
@@ -64,17 +64,17 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
root[kJsonRpc] = kJsonRpcExpectedValue;
- NsSmartObjects::SmartObject formatted_object(obj);
+ ns_smart_objects::SmartObject formatted_object(obj);
Json::Value msg_params_json(Json::objectValue);
formatted_object.getSchema().unapplySchema(formatted_object);
bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS);
bool empty_message_params = true;
if (true == is_message_params) {
- const NsSmartObjects::SmartObject& msg_params =
+ const ns_smart_objects::SmartObject& msg_params =
formatted_object.getElement(strings::S_MSG_PARAMS);
- result = (NsSmartObjects::SmartType_Map == msg_params.getType());
+ result = (ns_smart_objects::SmartType_Map == msg_params.getType());
if (true == result) {
objToJsonValue(msg_params, msg_params_json);
}
@@ -86,15 +86,16 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == formatted_object.keyExists(strings::S_PARAMS)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& params =
+ const ns_smart_objects::SmartObject& params =
formatted_object.getElement(strings::S_PARAMS);
- if (NsSmartObjects::SmartType_Map != params.getType()) {
+ if (ns_smart_objects::SmartType_Map != params.getType()) {
result = false;
} else {
- const NsSmartObjects::SmartObject& message_type_object =
+ const ns_smart_objects::SmartObject& message_type_object =
params.getElement(strings::S_MESSAGE_TYPE);
- if (NsSmartObjects::SmartType_String != message_type_object.getType()) {
+ if (ns_smart_objects::SmartType_String !=
+ message_type_object.getType()) {
result = false;
} else {
const std::string message_type = message_type_object.asString();
@@ -113,10 +114,10 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == params.keyExists(strings::kCode)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kResult][kCode] =
@@ -131,9 +132,9 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
result = result && SetMethod(params, root[kError][kData]);
result = result && SetMessage(params, root[kError]);
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kError][kCode] =
@@ -151,15 +152,15 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
return result;
}
-bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container) {
bool result = false;
if (true == params.keyExists(strings::S_FUNCTION_ID)) {
- const NsSmartObjects::SmartObject& function_id =
+ const ns_smart_objects::SmartObject& function_id =
params.getElement(strings::S_FUNCTION_ID);
- if (NsSmartObjects::SmartType_String == function_id.getType()) {
+ if (ns_smart_objects::SmartType_String == function_id.getType()) {
method_container[kMethod] = function_id.asString();
result = true;
}
@@ -168,15 +169,15 @@ bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container) {
bool result = false;
if (true == params.keyExists(strings::S_CORRELATION_ID)) {
- const NsSmartObjects::SmartObject& id =
+ const ns_smart_objects::SmartObject& id =
params.getElement(strings::S_CORRELATION_ID);
- if (NsSmartObjects::SmartType_Integer == id.getType()) {
+ if (ns_smart_objects::SmartType_Integer == id.getType()) {
id_container[kId] = utils::ConvertUInt64ToLongLongUInt(id.asUInt());
result = true;
}
@@ -185,15 +186,15 @@ bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& message_container) {
bool result = false;
if (true == params.keyExists(strings::kMessage)) {
- const NsSmartObjects::SmartObject& message =
+ const ns_smart_objects::SmartObject& message =
params.getElement(strings::kMessage);
- if (NsSmartObjects::SmartType_String == message.getType()) {
+ if (ns_smart_objects::SmartType_String == message.getType()) {
message_container[kMessage] = message.asString();
result = true;
}
@@ -202,6 +203,6 @@ bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/generic_json_formatter.cc b/src/components/formatters/src/generic_json_formatter.cc
index 7789a915c2..07b03484d2 100644
--- a/src/components/formatters/src/generic_json_formatter.cc
+++ b/src/components/formatters/src/generic_json_formatter.cc
@@ -34,11 +34,11 @@
#include "formatters/generic_json_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
+void GenericJsonFormatter::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
Json::Value json_root;
objToJsonValue(obj, json_root);
@@ -46,7 +46,7 @@ void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
}
bool GenericJsonFormatter::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
Json::Value json_root;
Json::Reader reader;
bool result = reader.parse(str, json_root);
@@ -58,6 +58,6 @@ bool GenericJsonFormatter::FromString(const std::string& str,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/meta_formatter.cc b/src/components/formatters/src/meta_formatter.cc
index fafb84e938..82dd611498 100644
--- a/src/components/formatters/src/meta_formatter.cc
+++ b/src/components/formatters/src/meta_formatter.cc
@@ -38,15 +38,15 @@
#include "formatters/meta_formatter.h"
-namespace formatter_ns = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace formatter_ns = ns_smart_device_link::ns_json_handler::formatters;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
//---------------------------------------------------------------
bool formatter_ns::CMetaFormatter::CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object) {
if (smart_objects_ns::SmartType_Invalid == result_object.getType()) {
return false;
}
diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc
index ff1f60b8df..1cd9c55bbc 100644
--- a/src/components/formatters/test/CFormatterJsonBase_test.cc
+++ b/src/components/formatters/test/CFormatterJsonBase_test.cc
@@ -42,8 +42,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
TEST(CFormatterJsonBaseTest, JSonStringValueToSmartObj_ExpectSuccessful) {
// Arrange value
diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc
index f98af88328..3aba109e58 100644
--- a/src/components/formatters/test/CSmartFactory_test.cc
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -67,7 +67,9 @@ TEST(CSmartFactoryTest,
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -79,7 +81,9 @@ TEST(CSmartFactoryTest,
FunctionIdTest::Function1, MessageTypeTest::INVALID_ENUM);
EXPECT_FALSE(SmartType::SmartType_Map == obj.getType());
EXPECT_TRUE(SmartType::SmartType_Null == obj.getType());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -99,7 +103,9 @@ TEST(
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -120,7 +126,9 @@ TEST(
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OUT_OF_RANGE, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OUT_OF_RANGE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -141,7 +149,9 @@ TEST(
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -163,7 +173,9 @@ TEST(CSmartFactoryTest,
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -185,7 +197,9 @@ TEST(
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -221,7 +235,9 @@ TEST(
obj[S_MSG_PARAMS] = SmartObject(SmartType::SmartType_Map);
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -236,7 +252,9 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -251,7 +269,9 @@ TEST(
obj["text"] = "test";
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(1u, keys.size());
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -266,7 +286,9 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -281,10 +303,14 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -301,11 +327,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -321,11 +351,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -342,11 +376,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -363,7 +401,9 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -381,7 +421,9 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
index 91701c8aab..fe9d2ec0e1 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
@@ -42,7 +42,9 @@ namespace formatters {
TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) {
SmartObject srcObj;
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
@@ -71,7 +73,10 @@ TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
+ srcObj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
@@ -102,7 +107,9 @@ TEST(CFormatterJsonSDLRPCv1Test,
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
srcObj[S_MSG_PARAMS][""] = "";
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -333,7 +340,9 @@ TEST(CFormatterJsonSDLRPCv1Test, StringRequestToSmObj) {
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 5);
@@ -477,7 +486,9 @@ TEST(CFormatterJsonSDLRPCv1Test, StringNotificationToSmartObject) {
MessageTypeTest::eType>(
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 13);
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
index feb7dd3129..628e9956bb 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -41,7 +41,9 @@ namespace formatters {
TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) {
SmartObject srcObj;
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
@@ -64,7 +66,10 @@ TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
+ srcObj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
@@ -88,7 +93,9 @@ TEST(CFormatterJsonSDLRPCv2Test,
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
srcObj[S_MSG_PARAMS][""] = "";
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -262,7 +269,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithoutCorIdToSmObj) {
MessageTypeTest::request);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
@@ -307,7 +316,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithCorIdToSmObj) {
corId);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
@@ -372,7 +383,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringNotificationToSmartObject) {
MessageTypeTest::notification,
corId);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index fa368924c9..f397accbd4 100644
--- a/src/components/formatters/test/formatter_json_rpc_test.cc
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -49,9 +49,9 @@ namespace test {
namespace components {
namespace formatters_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
void CompactJson(std::string& str) {
Json::Value root;
@@ -149,7 +149,9 @@ TEST(FormatterJsonRPCTest, UpperBoundValuesInSystemRequest_ToString_Success) {
hmi_apis::HMI_API factory;
EXPECT_TRUE(factory.attachSchema(obj, false));
- EXPECT_EQ(Errors::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string result;
// Convert SmartObject to Json string
EXPECT_TRUE(FormatterJsonRpc::ToString(obj, result));
diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc
index 41ecfd9ee3..97840eb110 100644
--- a/src/components/formatters/test/generic_json_formatter_test.cc
+++ b/src/components/formatters/test/generic_json_formatter_test.cc
@@ -38,8 +38,8 @@ namespace components {
namespace formatters {
TEST(GenericJsonFormatter, ToString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject obj;
std::string result;
@@ -93,8 +93,8 @@ TEST(GenericJsonFormatter, ToString) {
}
TEST(GenericJsonFormatter, FromString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject result;
diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
index 8f5ee96ce5..4b1ca94b98 100644
--- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
+++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
@@ -52,9 +52,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler;
+using namespace ns_smart_device_link::ns_json_handler::strings;
using namespace hmi_apis;
namespace TestType {
@@ -107,9 +107,9 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
protected:
typedef std::map<const StructIdentifiersTest::eType,
- utils::SharedPtr<ISchemaItem> > TStructsSchemaItems;
+ std::shared_ptr<ISchemaItem> > TStructsSchemaItems;
- static utils::SharedPtr<ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static std::shared_ptr<ISchemaItem> ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id);
@@ -147,10 +147,10 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_1(
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_2();
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_2();
};
} // namespace formatters
diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h
index 4d7a217317..73ff9ba77b 100644
--- a/src/components/formatters/test/include/formatters/create_smartSchema.h
+++ b/src/components/formatters/test/include/formatters/create_smartSchema.h
@@ -40,9 +40,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace FunctionIDTest {
enum eType {
diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
index a58f69e386..0ee21d092c 100644
--- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
+++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
@@ -51,24 +51,24 @@ class CMetaFormatterTestHelper : public ::testing::Test {
virtual void TearDown();
void AnyObjectToJsonString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& result_string);
void FillObjectIdenticalToSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void CompareObjects(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& first,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& second);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& first,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& second);
void FillObjectWithDefaultValues(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectWithoutSomeMandatoryFields(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
// Members
std::set<FunctionIDTest::eType> function_id_items_;
diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc
index 293f881c4a..87f05ab50e 100644
--- a/src/components/formatters/test/meta_formatter_test.cc
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -68,20 +68,6 @@ TEST_F(CMetaFormatterTestHelper,
CMetaFormatter::CreateObjectByPattern(object2, schema, result_object2);
EXPECT_TRUE(creationresult);
- // Uncomment code to print objects in console
- // std::string formatted_string;
- // CFormatterJsonSDLRPCv1::toString(object1, formatted_string);
- // printf("object1 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(result_object1, formatted_string);
- // printf("result_object1 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(object2, formatted_string);
- // printf("object2 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(result_object2, formatted_string);
- // printf("result_object2 %s\n", formatted_string.c_str());
-
CompareObjects(object1, result_object1);
CompareObjects(object2, result_object2);
@@ -112,13 +98,6 @@ TEST_F(CMetaFormatterTestHelper, NormalSchemaWithEmptyObject) {
FillObjectWithDefaultValues(expected_object);
CompareObjects(expected_object, result_object);
-
- // Uncomment code to print objects in console
- // std::string str;
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object(default) %s", str.c_str());
- // AnyObjectToJsonString(expected_object, str);
- // printf("expected_object %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper,
@@ -140,11 +119,6 @@ TEST_F(CMetaFormatterTestHelper,
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;
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
@@ -191,11 +165,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())
<< "smartObject is not map type";
EXPECT_EQ(0u, result_object_empty_map.length()) << "non empty map";
-
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(result_object_empty_map, str);
- // printf("result_object(empty map) %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
@@ -233,11 +202,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())
<< "smartObject is not array type";
EXPECT_EQ(0u, result_object_empty_array.length()) << "non empty array";
-
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(result_object_empty_array, str);
- // printf("result_object(empty array) %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper,
@@ -325,13 +289,6 @@ TEST_F(CMetaFormatterTestHelper,
CMetaFormatter::CreateObjectByPattern(object, schema, result_object);
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(object, str);
- // printf("object %s", str.c_str());
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object %s", str.c_str());
-
// Assert
EXPECT_EQ(500, result_object[S_PARAMS][S_FUNCTION_ID].asInt());
EXPECT_EQ(-1, result_object[S_PARAMS][S_MESSAGE_TYPE].asInt());
diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
index 2dd76f85f8..d48f9f58a0 100644
--- a/src/components/formatters/test/src/SmartFactoryTestHelper.cc
+++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
@@ -148,7 +148,7 @@ CSmartFactoryTest::CSmartFactoryTest()
void CSmartFactoryTest::InitStructSchemes(
TStructsSchemaItems& struct_schema_items) {
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_1 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_1 =
InitStructSchemaItem_Common_1(struct_schema_items);
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_1,
struct_schema_item_Common_1));
@@ -156,7 +156,7 @@ void CSmartFactoryTest::InitStructSchemes(
std::make_pair(StructIdentifiersTest::Common_1,
CSmartSchema(struct_schema_item_Common_1)));
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_2 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_2 =
InitStructSchemaItem_Common_2();
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_2,
struct_schema_item_Common_2));
@@ -187,7 +187,7 @@ void CSmartFactoryTest::InitFunctionSchemes(
CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
CObjectSchemaItem::Members root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members),
true);
@@ -269,7 +269,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function1_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -333,7 +333,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function2_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -399,7 +399,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
// Function parameter available.
//
// Must be true if VR is present and ready to communicate with SDL.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -431,12 +431,12 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
-utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
+std::shared_ptr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items) {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
@@ -444,14 +444,14 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
// Struct member image.
//
// Image struct
- utils::SharedPtr<ISchemaItem> image_SchemaItem =
+ std::shared_ptr<ISchemaItem> image_SchemaItem =
ProvideObjectSchemaItemForStruct(struct_schema_items,
StructIdentifiersTest::Common_2);
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -472,19 +472,19 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::InitStructSchemaItem_Common_2() {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -497,7 +497,7 @@ CSmartFactoryTest::InitStructSchemaItem_Common_2() {
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id) {
@@ -506,5 +506,6 @@ CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
if (it != struct_schema_items.end()) {
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::
+ create();
}
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 4ae692429c..3602fc3de7 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -35,9 +35,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
template <>
const EnumConversionHelper<FunctionIDTest::eType>::EnumToCStringMap
@@ -339,7 +339,6 @@ CSmartSchema initSchemaForMetaFormatter() {
ISchemaItemPtr majorVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr minorVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr patchVersion_SchemaItem = TNumberSchemaItem<int>::create();
-
ISchemaItemPtr syncMsg_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(0),
TSchemaItemParameter<size_t>(1000),
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 a29c1bceb3..b322510f6c 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -36,8 +36,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
void CMetaFormatterTestHelper::SetUp() {
function_id_items_.insert(FunctionIDTest::RegisterAppInterface);
@@ -109,17 +109,6 @@ void CMetaFormatterTestHelper::
obj[S_MSG_PARAMS]["languageDesired"] = Language::EN_EU;
obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = Language::RU_RU;
obj[S_MSG_PARAMS]["appID"] = "APP ID";
-
- // Commented not mandatory params for check creation object without them
- // obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
- // obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
- // SpeechCapabilities::SC_TEXT;
-
- // obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
- // obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
-
- // obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM; // not mandatory
- // obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
}
void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
@@ -130,11 +119,6 @@ void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
- // Commented mandatory params for check creation object without them
- // obj[S_PARAMS][S_CORRELATION_ID] = 12;
- // obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
- // obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
-
obj[S_MSG_PARAMS]["appName"] = "APP NAME";
obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
obj[S_MSG_PARAMS]["ttsName"][0]["type"] = SpeechCapabilities::SC_TEXT;
@@ -200,17 +184,6 @@ void CMetaFormatterTestHelper::FillObjectWithDefaultValues(SmartObject& obj) {
obj[S_MSG_PARAMS]["languageDesired"] = -1;
obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = -1;
obj[S_MSG_PARAMS]["appID"] = "";
-
- // Commented params for check creation object with only default values
- // obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
- // obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
- // SpeechCapabilities::SC_TEXT;
-
- // obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
- // obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
-
- // obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM;
- // obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
}
} // namespace formatters
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index c1dfca5e67..8fafee1ac5 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -43,9 +43,11 @@ include_directories (
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/dbus/include/
${CMAKE_SOURCE_DIR}/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/hmi_message_handler/src
+ ${BOOST_INCLUDE_DIR}
)
set(PATHS
@@ -53,14 +55,6 @@ set(PATHS
${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 ()
-
list(APPEND EXCLUDE_PATHS
mqueue_adapter.cc
)
@@ -69,11 +63,15 @@ collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
Utils
- ${DBUS_ADAPTER}
${RTLIB}
)
add_library("HMIMessageHandler" ${SOURCES})
+
+if (HMIADAPTER STREQUAL "messagebroker")
+ add_dependencies("HMIMessageHandler" Boost)
+endif()
+
target_link_libraries("HMIMessageHandler" ${LIBRARIES})
if(ENABLE_LOG)
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
deleted file mode 100644
index beb7a9ad1d..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-
-#include <string>
-#include "hmi_message_handler/hmi_message_adapter_impl.h"
-#include "dbus/dbus_message_controller.h"
-#include "smart_objects/smart_object.h"
-
-namespace hmi_message_handler {
-
-/**
- * \brief adapter for DBus
- */
-class DBusMessageAdapter : public HMIMessageAdapterImpl,
- public dbus::DBusMessageController {
- public:
- typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
- explicit DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler);
- ~DBusMessageAdapter();
- void SendMessageToHMI(MessageSharedPointer message);
-
- /**
- * \brief subscribes to signals
- */
- void SubscribeTo();
-
- private:
- static const std::string SDL_SERVICE_NAME;
- static const std::string SDL_OBJECT_PATH;
- static const std::string HMI_SERVICE_NAME;
- static const std::string HMI_OBJECT_PATH;
-
- /**
- * \brief sends request to HMI
- * \param obj request
- */
- void Request(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends notification to HMI
- * \param obj notification
- */
- void Notification(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends response to HMI
- * \param obj response
- */
- void Response(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error response to HMI
- * \param obj error
- */
- void ErrorResponse(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends message to core
- * \param obj
- */
- void SendMessageToCore(const smart_objects::SmartObject& obj);
-};
-
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
index bd118032d6..f2a5ce2dd8 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
@@ -51,7 +51,7 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter {
/**
* \brief Destructor
*/
- virtual ~HMIMessageAdapterImpl();
+ ~HMIMessageAdapterImpl();
protected:
virtual HMIMessageHandler* handler() const {
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
index 8b238b4aa8..0d85c30fc2 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
@@ -89,14 +89,14 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
explicit HMIMessageHandlerImpl(const HMIMessageHandlerSettings& settings);
~HMIMessageHandlerImpl();
- void OnMessageReceived(MessageSharedPointer message);
- void SendMessageToHMI(MessageSharedPointer message);
+ void OnMessageReceived(MessageSharedPointer message) OVERRIDE;
+ void SendMessageToHMI(MessageSharedPointer message) OVERRIDE;
void set_message_observer(HMIMessageObserver* observer);
- void OnErrorSending(MessageSharedPointer message);
- void AddHMIMessageAdapter(HMIMessageAdapter* adapter);
- void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter);
+ void OnErrorSending(MessageSharedPointer message) OVERRIDE;
+ void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
+ void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
- virtual const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
+ const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
#ifdef BUILD_TESTS
std::set<HMIMessageAdapter*> message_adapters() const {
@@ -120,15 +120,16 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
// threads::MessageLoopThread<*>::Handler implementations
// CALLED ON messages_from_hmi_ THREAD!
- virtual void Handle(const impl::MessageFromHmi message) OVERRIDE;
+ void Handle(const impl::MessageFromHmi message) OVERRIDE;
// CALLED ON messages_to_hmi_ THREAD!
- virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
+ void Handle(const impl::MessageToHmi message) OVERRIDE;
private:
const HMIMessageHandlerSettings& settings_;
HMIMessageObserver* observer_;
- mutable sync_primitives::Lock observer_locker_;
std::set<HMIMessageAdapter*> message_adapters_;
+ mutable sync_primitives::Lock observer_locker_;
+ mutable sync_primitives::Lock message_adapters_locker_;
// Construct message threads when everything is already created
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
new file mode 100644
index 0000000000..0a2e3e0f99
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -0,0 +1,186 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MB_CONTROLLER_H
+#define MB_CONTROLLER_H
+
+#include <iostream>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/asio/bind_executor.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/thread/thread.hpp>
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+#include <vector>
+#include <map>
+#include "json/json.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include <atomic>
+#include "websocket_session.h"
+
+using namespace boost::beast::websocket;
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(mb_logger_, "HMIMessageHandler")
+
+enum ErrorCode {
+ CONTROLLER_EXISTS = -32000,
+ SUBSCRIBTION_EXISTS = -32001,
+ INVALID_REQUEST = -32600
+};
+
+class WebsocketSession;
+
+class CMessageBrokerController
+ : public std::enable_shared_from_this<CMessageBrokerController> {
+ public:
+ CMessageBrokerController(const std::string& address,
+ uint16_t port,
+ std::string name,
+ int num_ports);
+
+ ~CMessageBrokerController();
+
+ bool StartListener();
+
+ bool Run();
+
+ void WaitForConnection();
+
+ void StartSession(boost::system::error_code ec);
+
+ void OnAccept(
+ boost::system::error_code ec,
+ boost::asio::strand<boost::asio::io_context::executor_type>& strand,
+ stream<boost::asio::ip::tcp::socket>& ws);
+
+ void OnRead(boost::system::error_code ec, std::size_t bytes_transferred);
+
+ bool isNotification(Json::Value& message);
+
+ void sendNotification(Json::Value& message);
+
+ bool isResponse(Json::Value& message);
+
+ void sendResponse(Json::Value& message);
+
+ void sendJsonMessage(Json::Value& message);
+
+ void subscribeTo(std::string property);
+
+ void registerController(int id = 0);
+
+ void unregisterController();
+
+ void* MethodForReceiverThread(void* arg);
+
+ bool Connect();
+
+ void exitReceivingThread();
+
+ virtual void processResponse(std::string method, Json::Value& root) = 0;
+
+ virtual void processRequest(Json::Value& root) = 0;
+
+ virtual void processNotification(Json::Value& root) = 0;
+
+ std::string getMethodName(std::string& method);
+
+ std::string GetComponentName(std::string& method);
+
+ void processInternalRequest(Json::Value& message,
+ WebsocketSession* ws_session);
+
+ void pushRequest(Json::Value& message, WebsocketSession* ws_session);
+
+ // Registry
+ bool addController(WebsocketSession* ws_session, std::string name);
+
+ void deleteController(WebsocketSession* ws_session);
+
+ void deleteController(std::string name);
+
+ void removeSubscribersBySession(const WebsocketSession* ws);
+
+ bool addSubscriber(WebsocketSession* ws_session, std::string name);
+
+ void deleteSubscriber(WebsocketSession* ws, std::string name);
+
+ int getSubscribersFd(std::string name,
+ std::vector<WebsocketSession*>& result);
+
+ int getNextControllerId();
+
+ private:
+ boost::asio::io_context ioc_;
+ const std::string& address_;
+ uint16_t port_;
+ std::string name_;
+ int num_threads_;
+ std::vector<std::thread> thread_vector_;
+
+ boost::asio::ip::tcp::acceptor acceptor_;
+ boost::asio::ip::tcp::socket socket_;
+ boost::beast::multi_buffer buffer_;
+ boost::asio::ip::tcp::endpoint endpoint_;
+
+ int mControllersIdCounter;
+
+ // Registry
+ std::vector<std::shared_ptr<hmi_message_handler::WebsocketSession> >
+ mConnectionList;
+ sync_primitives::Lock mConnectionListLock;
+
+ std::map<std::string, WebsocketSession*> mControllersList;
+ sync_primitives::Lock mControllersListLock;
+
+ std::multimap<std::string, WebsocketSession*> mSubscribersList;
+ sync_primitives::Lock mSubscribersListLock;
+
+ std::map<std::string, WebsocketSession*> mRequestList;
+ sync_primitives::Lock mRequestListLock;
+
+ std::atomic_bool shutdown_;
+};
+
+} // hmi_message_handler
+
+#endif /* MB_CONTROLLER_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
index f582cb2b81..423f331297 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -35,15 +35,16 @@
#include <string>
-#include "mb_controller.hpp"
+#include "hmi_message_handler/mb_controller.h"
#include "hmi_message_handler/hmi_message_adapter_impl.h"
#include "utils/threads/thread_validator.h"
namespace hmi_message_handler {
-class MessageBrokerAdapter : public HMIMessageAdapterImpl,
- public NsMessageBroker::CMessageBrokerController,
- public threads::SingleThreadValidator {
+class MessageBrokerAdapter
+ : public HMIMessageAdapterImpl,
+ public hmi_message_handler::CMessageBrokerController,
+ public threads::SingleThreadValidator {
public:
MessageBrokerAdapter(HMIMessageHandler* handler_param,
const std::string& server_address,
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
new file mode 100644
index 0000000000..4d177d250f
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -0,0 +1,208 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef WEBSOCKET_SESSION_H
+#define WEBSOCKET_SESSION_H
+
+#include <iostream>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/asio/bind_executor.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/thread/thread.hpp>
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+#include <vector>
+#include <mutex>
+#include <queue>
+#include "json/json.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include <atomic>
+#include "utils/threads/thread.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/message_queue.h"
+
+using namespace boost::beast::websocket;
+using ::utils::MessageQueue;
+
+#ifdef DEBUG_ON
+/**
+* \def DBG_MSG
+* \brief Debug message output with file name and line number.
+* \param x formatted debug message.
+* \return printf construction.
+*/
+#define DBG_MSG(x) \
+ printf("%s:%d ", __FILE__, __LINE__); \
+ printf x
+#else
+#define DBG_MSG(x)
+#endif
+
+#define DBG_MSG_ERROR(x) \
+ printf("ERROR!!! %s:%d ", __FILE__, __LINE__); \
+ printf x
+
+typedef std::queue<std::shared_ptr<std::string> > AsyncQueue;
+typedef std::shared_ptr<std::string> Message;
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(ws_logger_, "HMIMessageHandler")
+
+class CMessageBrokerController;
+
+class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
+ boost::beast::websocket::stream<boost::asio::ip::tcp::socket> ws_;
+ boost::asio::strand<boost::asio::io_context::executor_type> strand_;
+ boost::beast::multi_buffer buffer_;
+ boost::beast::multi_buffer send_buffer_;
+ CMessageBrokerController* controller_;
+
+ public:
+ WebsocketSession(boost::asio::ip::tcp::socket socket,
+ CMessageBrokerController* controller);
+
+ ~WebsocketSession();
+
+ void Accept();
+
+ void Shutdown();
+
+ bool IsShuttingDown();
+
+ void Recv(boost::system::error_code ec);
+
+ void Send(std::string& message, Json::Value& json_message);
+
+ void SendFromQueue();
+
+ void sendJsonMessage(Json::Value& message);
+
+ void OnWrite(boost::system::error_code ec,
+ std::size_t bytes_transferred,
+ std::shared_ptr<std::string> message);
+
+ void Read(boost::system::error_code ec, std::size_t bytes_transferred);
+
+ int getNextMessageId();
+
+ void prepareMessage(Json::Value& root);
+
+ void prepareErrorMessage(int errCode,
+ std::string errMessage,
+ Json::Value& error);
+
+ std::string getDestinationComponentName(Json::Value& root);
+
+ bool isNotification(Json::Value& root);
+
+ bool isResponse(Json::Value& root);
+
+ std::string findMethodById(std::string id);
+
+ void registerController(int id = 0);
+
+ void unregisterController();
+
+ void subscribeTo(std::string property);
+
+ void unsubscribeFrom(std::string property);
+
+ bool checkMessage(Json::Value& root, Json::Value& error);
+
+ std::string getControllersName();
+
+ std::string GetComponentName(std::string& method);
+
+ protected:
+ std::atomic_bool stop;
+
+ private:
+ void onMessageReceived(Json::Value message);
+
+ std::map<std::string, std::string> mWaitResponseQueue;
+
+ std::string m_receivingBuffer;
+
+ int mControllersIdStart;
+
+ int mControllersIdCurrent;
+
+ Json::Reader m_reader;
+ Json::FastWriter m_writer;
+ Json::FastWriter m_receiverWriter;
+
+ sync_primitives::Lock queue_lock_;
+ sync_primitives::Lock message_queue_lock_;
+ std::atomic_bool shutdown_;
+
+ MessageQueue<Message, AsyncQueue> message_queue_;
+
+ class LoopThreadDelegate : public threads::ThreadDelegate {
+ public:
+ LoopThreadDelegate(MessageQueue<Message, AsyncQueue>* message_queue,
+ WebsocketSession* handler);
+
+ virtual void threadMain() OVERRIDE;
+ virtual void exitThreadMain() OVERRIDE;
+
+ void OnWrite();
+
+ void SetShutdown();
+
+ private:
+ void DrainQueue();
+ MessageQueue<Message, AsyncQueue>& message_queue_;
+ WebsocketSession& handler_;
+ sync_primitives::Lock queue_lock_;
+ sync_primitives::ConditionalVariable queue_new_items_;
+ std::atomic_bool write_pending_;
+ std::atomic_bool shutdown_;
+
+ sync_primitives::Lock write_lock_;
+ };
+
+ LoopThreadDelegate* thread_delegate_;
+ threads::Thread* thread_;
+};
+
+} // hmi_message_handler
+
+#endif /* WEBSOCKET_SESSION_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/mock_hmi_message_handler.h b/src/components/hmi_message_handler/mock_hmi_message_handler.h
index d9060088ff..f4ed601bed 100644
--- a/src/components/hmi_message_handler/mock_hmi_message_handler.h
+++ b/src/components/hmi_message_handler/mock_hmi_message_handler.h
@@ -50,9 +50,9 @@ class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler {
MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
MOCK_CONST_METHOD0(get_settings, const HMIMessageHandlerSettings&());
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
};
} // namespace hmi_message_handler_test
diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
deleted file mode 100644
index 00f5ad6be8..0000000000
--- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "hmi_message_handler/dbus_message_adapter.h"
-#include <sstream>
-#include "utils/logger.h"
-#include "formatters/CSmartFactory.h"
-#include "smart_objects/smart_object.h"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace hmi_message_handler {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-const std::string DBusMessageAdapter::SDL_SERVICE_NAME = "com.ford.sdl.core";
-const std::string DBusMessageAdapter::SDL_OBJECT_PATH = "/";
-const std::string DBusMessageAdapter::HMI_SERVICE_NAME = "com.ford.sdl.hmi";
-const std::string DBusMessageAdapter::HMI_OBJECT_PATH = "/";
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusMessageAdapter::DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler)
- : HMIMessageAdapterImpl(hmi_msg_handler)
- , DBusMessageController(SDL_SERVICE_NAME,
- SDL_OBJECT_PATH,
- HMI_SERVICE_NAME,
- HMI_OBJECT_PATH) {
- LOG4CXX_INFO(logger_, "Created DBusMessageAdapter");
-}
-
-DBusMessageAdapter::~DBusMessageAdapter() {}
-
-void DBusMessageAdapter::SendMessageToHMI(MessageSharedPointer message) {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::sendMessageToHMI");
-
- const smart_objects::SmartObject& smart = message->smart_object();
- switch (smart[sos::S_PARAMS][sos::S_MESSAGE_TYPE].asInt()) {
- case hmi_apis::messageType::request:
- Request(smart);
- break;
- case hmi_apis::messageType::notification:
- Notification(smart);
- break;
- case hmi_apis::messageType::response:
- Response(smart);
- break;
- case hmi_apis::messageType::error_response:
- ErrorResponse(smart);
- break;
- case hmi_apis::messageType::INVALID_ENUM:
- default:
- LOG4CXX_WARN(logger_, "Message type is invalid");
- }
-}
-
-void DBusMessageAdapter::SubscribeTo() {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::subscribeTo");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonEvent");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonPress");
- DBusMessageController::SubscribeTo("UI", "OnCommand");
- DBusMessageController::SubscribeTo("UI", "OnDriverDistraction");
- DBusMessageController::SubscribeTo("UI", "OnSystemContext");
- DBusMessageController::SubscribeTo("UI", "OnLanguageChange");
- DBusMessageController::SubscribeTo("UI", "OnKeyboardInput");
- DBusMessageController::SubscribeTo("UI", "OnTouchEvent");
- DBusMessageController::SubscribeTo("UI", "OnResetTimeout");
- DBusMessageController::SubscribeTo("TTS", "OnResetTimeout");
- DBusMessageController::SubscribeTo("VR", "Started");
- DBusMessageController::SubscribeTo("VR", "Stopped");
- DBusMessageController::SubscribeTo("VR", "OnCommand");
- DBusMessageController::SubscribeTo("VR", "OnLanguageChange");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnReady");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppDeactivated");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnStartDeviceDiscovery");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnUpdateDeviceList");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnFindApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppActivated");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnExitApplication");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnExitAllApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnDeviceChosen");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnIgnitionCycleOver");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemRequest");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnSystemInfoChanged");
- DBusMessageController::SubscribeTo("TTS", "Started");
- DBusMessageController::SubscribeTo("TTS", "Stopped");
- DBusMessageController::SubscribeTo("TTS", "OnLanguageChange");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnGpsData");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSpeed");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnRpm");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevel");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevelState");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnInstantFuelConsumption");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnExternalTemperature");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnVin");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnPrndl");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnTirePressure");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnOdometer");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBeltStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBodyInformation");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDeviceStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDriverBraking");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnWiperStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnHeadLampStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnEngineTorque");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnAccPedalPosition");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSteeringWheelAngle");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnMyKey");
- DBusMessageController::SubscribeTo("Navigation", "OnTBTClientState");
- DBusMessageController::SubscribeTo("Navigation", "OnWayPointChange");
- DBusMessageController::SubscribeTo("SDL", "OnAllowSDLFunctionality");
- DBusMessageController::SubscribeTo("SDL", "OnReceivedPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnAppPermissionConsent");
- DBusMessageController::SubscribeTo("SDL", "OnSystemError");
- DBusMessageController::SubscribeTo("SDL", "AddStatisticsInfo");
- DBusMessageController::SubscribeTo("SDL", "OnDeviceStateChanged");
-
- LOG4CXX_INFO(logger_, "Subscribed to notifications.");
-}
-
-void DBusMessageAdapter::SendMessageToCore(
- const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!handler()) {
- LOG4CXX_WARN(logger_, "DBusMessageAdapter hasn't handler");
- return;
- }
-
- MessageSharedPointer message = new application_manager::Message(
- protocol_handler::MessagePriority::kDefault); // todo: ykazakov constant
- // is a temp solution to
- // finish
- // merge
- // MessagePriority::FromServiceType(message.servicetype)
- // shall be used instead
- message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
- message->set_smart_object(obj);
- handler()->OnMessageReceived(message);
- LOG4CXX_INFO(logger_, "Successfully sent to observer");
-}
-
-void DBusMessageAdapter::Request(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodCall(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Notification(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- Signal(func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Response(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodReturn(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::ErrorResponse(const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Error");
- std::string error = obj[sos::S_PARAMS][sos::kCode].asString();
- std::string description = obj[sos::S_PARAMS][sos::kMessage].asString();
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- Error(id, error, description);
-}
-
-} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
index 1c774b9efe..70865f7771 100644
--- a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
+++ b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
@@ -94,6 +94,7 @@ void HMIMessageHandlerImpl::AddHMIMessageAdapter(HMIMessageAdapter* adapter) {
LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!");
return;
}
+ sync_primitives::AutoLock lock(message_adapters_locker_);
message_adapters_.insert(adapter);
}
@@ -104,6 +105,7 @@ void HMIMessageHandlerImpl::RemoveHMIMessageAdapter(
LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!");
return;
}
+ sync_primitives::AutoLock lock(message_adapters_locker_);
message_adapters_.erase(adapter);
}
@@ -123,6 +125,7 @@ void HMIMessageHandlerImpl::Handle(const impl::MessageFromHmi message) {
LOG4CXX_INFO(logger_, "Message from hmi given away.");
}
void HMIMessageHandlerImpl::Handle(const impl::MessageToHmi message) {
+ sync_primitives::AutoLock lock(message_adapters_locker_);
for (std::set<HMIMessageAdapter*>::iterator it = message_adapters_.begin();
it != message_adapters_.end();
++it) {
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
new file mode 100644
index 0000000000..4f46026039
--- /dev/null
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -0,0 +1,504 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi_message_handler/mb_controller.h"
+
+using namespace boost::beast::websocket;
+namespace hmi_message_handler {
+
+CMessageBrokerController::CMessageBrokerController(const std::string& address,
+ uint16_t port,
+ std::string name,
+ int num_threads)
+ : address_(address)
+ , acceptor_(ioc_)
+ , socket_(ioc_)
+ , mControllersIdCounter(1) {
+ port_ = port;
+ name_ = name;
+ num_threads_ = num_threads;
+ endpoint_ = {boost::asio::ip::make_address(address),
+ static_cast<unsigned short>(port)};
+ shutdown_ = false;
+}
+
+CMessageBrokerController::~CMessageBrokerController() {
+ boost::system::error_code ec;
+ socket_.close();
+ acceptor_.close(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Close: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ }
+ shutdown_ = true;
+ ioc_.stop();
+}
+
+bool CMessageBrokerController::StartListener() {
+ boost::system::error_code error;
+ acceptor_.open(endpoint_.protocol(), error);
+ if (error) {
+ std::string str_err = "ErrorOpen: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+
+ acceptor_.set_option(boost::asio::socket_base::reuse_address(true), error);
+ if (error) {
+ std::string str_err = "ErrorSetOption: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ acceptor_.bind(endpoint_, error);
+ if (error) {
+ std::string str_err = "ErrorBind: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ acceptor_.listen(boost::asio::socket_base::max_listen_connections, error);
+ if (error) {
+ std::string str_err = "ErrorListen: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ return true;
+}
+
+bool CMessageBrokerController::Run() {
+ if (acceptor_.is_open() && !shutdown_) {
+ acceptor_.async_accept(socket_,
+ std::bind(&CMessageBrokerController::StartSession,
+ this,
+ std::placeholders::_1));
+ ioc_.run();
+ return true;
+ }
+ return false;
+}
+
+void CMessageBrokerController::WaitForConnection() {
+ if (acceptor_.is_open() && !shutdown_) {
+ acceptor_.async_accept(socket_,
+ std::bind(&CMessageBrokerController::StartSession,
+ this,
+ std::placeholders::_1));
+ }
+}
+
+void CMessageBrokerController::StartSession(boost::system::error_code ec) {
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ ioc_.stop();
+ return;
+ }
+ if (shutdown_) {
+ return;
+ }
+ std::shared_ptr<WebsocketSession> ws_ptr =
+ std::make_shared<WebsocketSession>(std::move(socket_), this);
+ ws_ptr->Accept();
+
+ mConnectionListLock.Acquire();
+ mConnectionList.push_back(ws_ptr);
+ mConnectionListLock.Release();
+
+ WaitForConnection();
+}
+
+bool CMessageBrokerController::isNotification(Json::Value& message) {
+ bool ret = false;
+ if (false == message.isMember("id")) {
+ ret = true;
+ }
+ return ret;
+}
+
+void CMessageBrokerController::sendNotification(Json::Value& message) {
+ std::string methodName = message["method"].asString();
+ std::vector<WebsocketSession*> result;
+ int subscribersCount = getSubscribersFd(methodName, result);
+ if (0 < subscribersCount) {
+ std::vector<WebsocketSession*>::iterator it;
+ for (it = result.begin(); it != result.end(); it++) {
+ (*it)->sendJsonMessage(message);
+ }
+ } else {
+ LOG4CXX_ERROR(mb_logger_, ("No subscribers for this property!\n"));
+ }
+}
+
+bool CMessageBrokerController::isResponse(Json::Value& message) {
+ bool ret = false;
+ if ((true == message.isMember("result")) ||
+ (true == message.isMember("error"))) {
+ ret = true;
+ }
+ return ret;
+}
+
+void CMessageBrokerController::sendResponse(Json::Value& message) {
+ WebsocketSession* ws;
+ std::map<std::string, WebsocketSession*>::iterator it;
+ sync_primitives::AutoLock request_lock(mRequestListLock);
+
+ std::string id = message["id"].asString();
+ it = mRequestList.find(id);
+ if (it != mRequestList.end()) {
+ ws = it->second;
+ ws->sendJsonMessage(message);
+ mRequestList.erase(it);
+ }
+}
+
+void CMessageBrokerController::sendJsonMessage(Json::Value& message) {
+ if (isNotification(message)) {
+ sendNotification(message);
+ return;
+ } else if (isResponse(message)) {
+ sendResponse(message);
+ return;
+ }
+
+ // Send request
+ WebsocketSession* ws;
+ std::map<std::string, WebsocketSession*>::iterator it;
+ std::string method = message["method"].asString();
+ std::string component_name = GetComponentName(method);
+
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(component_name);
+ if (it != mControllersList.end()) {
+ ws = it->second;
+ ws->sendJsonMessage(message);
+ }
+}
+
+void CMessageBrokerController::subscribeTo(std::string property) {}
+
+void CMessageBrokerController::registerController(int id) {}
+
+void CMessageBrokerController::unregisterController() {}
+
+void* CMessageBrokerController::MethodForReceiverThread(void* arg) {
+ return NULL;
+}
+
+bool CMessageBrokerController::Connect() {
+ return true;
+}
+
+void CMessageBrokerController::exitReceivingThread() {
+ shutdown_ = true;
+ mConnectionListLock.Acquire();
+ std::vector<std::shared_ptr<hmi_message_handler::WebsocketSession> >::iterator
+ it;
+ for (it = mConnectionList.begin(); it != mConnectionList.end();) {
+ (*it)->Shutdown();
+ it = mConnectionList.erase(it);
+ }
+ mConnectionListLock.Release();
+
+ boost::system::error_code ec;
+ socket_.close();
+ acceptor_.cancel(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Cancel: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ }
+ acceptor_.close(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Close: " + ec.message();
+ }
+ ioc_.stop();
+}
+
+std::string CMessageBrokerController::getMethodName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(position + 1);
+ }
+ }
+ return return_string;
+}
+
+std::string CMessageBrokerController::GetComponentName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(0, position);
+ }
+ }
+ return return_string;
+}
+
+bool CMessageBrokerController::addController(WebsocketSession* ws_session,
+ std::string name) {
+ bool result = false;
+ std::map<std::string, WebsocketSession*>::iterator it;
+
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(name);
+ if (it == mControllersList.end()) {
+ mControllersList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(name, ws_session));
+ result = true;
+ } else {
+ LOG4CXX_ERROR(mb_logger_, ("Controller already exists!\n"));
+ }
+ return result;
+}
+
+void CMessageBrokerController::deleteController(WebsocketSession* ws_session) {
+ {
+ sync_primitives::AutoLock lock(mControllersListLock);
+ std::map<std::string, WebsocketSession*>::iterator it;
+ for (it = mControllersList.begin(); it != mControllersList.end();) {
+ if (it->second == ws_session) {
+ mControllersList.erase(it++);
+ } else {
+ it++;
+ }
+ }
+ }
+ removeSubscribersBySession(ws_session);
+}
+
+void CMessageBrokerController::deleteController(std::string name) {
+ std::map<std::string, WebsocketSession*>::iterator it;
+ WebsocketSession* ws;
+ {
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(name);
+ if (it != mControllersList.end()) {
+ ws = it->second;
+ mControllersList.erase(it);
+ } else {
+ return;
+ }
+ }
+ removeSubscribersBySession(ws);
+}
+
+void CMessageBrokerController::removeSubscribersBySession(
+ const WebsocketSession* ws) {
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::multimap<std::string, WebsocketSession*>::iterator it_s =
+ mSubscribersList.begin();
+ for (; it_s != mSubscribersList.end();) {
+ if (it_s->second == ws) {
+ mSubscribersList.erase(it_s++);
+ } else {
+ ++it_s;
+ }
+ }
+}
+
+void CMessageBrokerController::pushRequest(Json::Value& message,
+ WebsocketSession* ws_session) {
+ sync_primitives::AutoLock lock(mRequestListLock);
+ std::string id = message["id"].asString();
+ mRequestList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(id, ws_session));
+}
+
+bool CMessageBrokerController::addSubscriber(WebsocketSession* ws_session,
+ std::string name) {
+ bool result = true;
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second; itr++) {
+ if (ws_session == itr->second) {
+ result = false;
+ LOG4CXX_ERROR(mb_logger_, ("Subscriber already exists!\n"));
+ }
+ }
+ }
+ if (result) {
+ mSubscribersList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(name, ws_session));
+ }
+ return result;
+}
+
+void CMessageBrokerController::deleteSubscriber(WebsocketSession* ws,
+ std::string name) {
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second;) {
+ if (ws == itr->second) {
+ mSubscribersList.erase(itr++);
+ } else {
+ ++itr;
+ }
+ }
+ }
+}
+
+int CMessageBrokerController::getSubscribersFd(
+ std::string name, std::vector<WebsocketSession*>& result) {
+ int res = 0;
+ std::map<std::string, WebsocketSession*>::iterator it;
+
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second; itr++) {
+ result.push_back(itr->second);
+ }
+ }
+
+ res = result.size();
+ return res;
+}
+
+void CMessageBrokerController::processInternalRequest(
+ Json::Value& message, WebsocketSession* ws_session) {
+ std::string method = message["method"].asString();
+ std::string methodName = getMethodName(method);
+ if (methodName == "registerComponent") {
+ Json::Value params = message["params"];
+ if (params.isMember("componentName") &&
+ params["componentName"].isString()) {
+ std::string controllerName = params["componentName"].asString();
+ if (addController(ws_session, controllerName)) {
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = getNextControllerId();
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = CONTROLLER_EXISTS;
+ err["message"] = "Controller has been already registered.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else if (methodName == "subscribeTo") {
+ Json::Value params = message["params"];
+ if (params.isMember("propertyName") && params["propertyName"].isString()) {
+ std::string propertyName = params["propertyName"].asString();
+ if (addSubscriber(ws_session, propertyName)) {
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = CONTROLLER_EXISTS;
+ err["message"] = "Subscribe has been already registered.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+
+ } else if (methodName == "unregisterComponent") {
+ Json::Value params = message["params"];
+ if (params.isMember("componentName") &&
+ params["componentName"].isString()) {
+ std::string controllerName = params["componentName"].asString();
+ deleteController(controllerName);
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else if (methodName == "unsubscribeFrom") {
+ Json::Value params = message["params"];
+ if (params.isMember("propertyName") && params["propertyName"].isString()) {
+ std::string propertyName = params["propertyName"].asString();
+ deleteSubscriber(ws_session, propertyName);
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ }
+}
+
+int CMessageBrokerController::getNextControllerId() {
+ return 1000 * mControllersIdCounter++;
+}
+}
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 27cf9df8cd..d400cca335 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,13 +39,13 @@ namespace hmi_message_handler {
CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-typedef NsMessageBroker::CMessageBrokerController MessageBrokerController;
+typedef hmi_message_handler::CMessageBrokerController MessageBrokerController;
MessageBrokerAdapter::MessageBrokerAdapter(HMIMessageHandler* handler_param,
const std::string& server_address,
uint16_t port)
: HMIMessageAdapterImpl(handler_param)
- , MessageBrokerController(server_address, port, "SDL") {
+ , MessageBrokerController(server_address, port, "SDL", 8) {
LOG4CXX_TRACE(logger_, "Created MessageBrokerAdapter");
}
@@ -55,7 +55,7 @@ void MessageBrokerAdapter::SendMessageToHMI(
hmi_message_handler::MessageSharedPointer message) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!message.valid()) {
+ if (message.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Can`t send not valid message");
return;
}
@@ -108,6 +108,7 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("BasicCommunication.OnUpdateDeviceList");
MessageBrokerController::subscribeTo("BasicCommunication.OnFindApplications");
MessageBrokerController::subscribeTo("BasicCommunication.OnAppActivated");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnAwakeSDL");
MessageBrokerController::subscribeTo("BasicCommunication.OnExitApplication");
MessageBrokerController::subscribeTo(
"BasicCommunication.OnExitAllApplications");
@@ -135,6 +136,8 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged");
MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate");
MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged");
+ MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData");
+ MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings");
LOG4CXX_INFO(logger_, "Subscribed to notifications.");
}
@@ -150,6 +153,7 @@ void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) {
void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "MB_Adapter: " << root);
if (root.isNull()) {
// LOG
return;
@@ -171,7 +175,8 @@ void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
protocol_handler::MessagePriority::kDefault));
// message->set_message_type()
message->set_json_message(message_string);
- message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+ message->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
if (!handler()) {
LOG4CXX_WARN(logger_, "handler is NULL");
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
new file mode 100644
index 0000000000..a148f48661
--- /dev/null
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -0,0 +1,322 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi_message_handler/websocket_session.h"
+#include "hmi_message_handler/mb_controller.h"
+#include <unistd.h>
+using namespace boost::beast::websocket;
+namespace hmi_message_handler {
+
+WebsocketSession::WebsocketSession(boost::asio::ip::tcp::socket socket,
+ CMessageBrokerController* controller)
+ : ws_(std::move(socket))
+ , strand_(ws_.get_executor())
+ , controller_(controller)
+ , stop(false)
+ , m_receivingBuffer("")
+ , mControllersIdStart(-1)
+ , mControllersIdCurrent(0)
+ , shutdown_(false)
+ , thread_delegate_(new LoopThreadDelegate(&message_queue_, this))
+ , thread_(threads::CreateThread("WS Async Send", thread_delegate_)) {
+ thread_->start(threads::ThreadOptions());
+}
+
+WebsocketSession::~WebsocketSession() {}
+
+void WebsocketSession::Accept() {
+ ws_.async_accept(boost::asio::bind_executor(
+ strand_,
+ std::bind(
+ &WebsocketSession::Recv, shared_from_this(), std::placeholders::_1)));
+}
+
+void WebsocketSession::Shutdown() {
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ thread_->join();
+ delete thread_delegate_;
+ threads::DeleteThread(thread_);
+}
+
+bool WebsocketSession::IsShuttingDown() {
+ return shutdown_;
+}
+
+void WebsocketSession::Recv(boost::system::error_code ec) {
+ if (shutdown_) {
+ return;
+ }
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ controller_->deleteController(this);
+ return;
+ }
+
+ ws_.async_read(buffer_,
+ boost::asio::bind_executor(strand_,
+ std::bind(&WebsocketSession::Read,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2)));
+}
+
+void WebsocketSession::Send(std::string& message, Json::Value& json_message) {
+ if (shutdown_) {
+ return;
+ }
+ std::shared_ptr<std::string> message_ptr =
+ std::make_shared<std::string>(message);
+ message_queue_.push(message_ptr);
+}
+
+void WebsocketSession::sendJsonMessage(Json::Value& message) {
+ std::string str_msg = m_writer.write(message);
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ if (!isNotification(message) && !isResponse(message)) {
+ mWaitResponseQueue.insert(std::map<std::string, std::string>::value_type(
+ message["id"].asString(), message["method"].asString()));
+ }
+
+ Send(str_msg, message);
+}
+
+void WebsocketSession::Read(boost::system::error_code ec,
+ std::size_t bytes_transferred) {
+ boost::ignore_unused(bytes_transferred);
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ controller_->deleteController(this);
+ buffer_.consume(buffer_.size());
+ return;
+ }
+
+ std::string data = boost::beast::buffers_to_string(buffer_.data());
+ m_receivingBuffer += data;
+
+ Json::Value root;
+ if (!m_reader.parse(m_receivingBuffer, root)) {
+ std::string str_err = "Invalid JSON Message: " + data;
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ return;
+ }
+
+ std::string wmes = m_receiverWriter.write(root);
+ ssize_t beginpos = m_receivingBuffer.find(wmes);
+ if (-1 != beginpos) {
+ m_receivingBuffer.erase(0, beginpos + wmes.length());
+ } else {
+ m_receivingBuffer.clear();
+ }
+ onMessageReceived(root);
+
+ buffer_.consume(buffer_.size());
+
+ Recv(ec);
+}
+
+std::string WebsocketSession::GetComponentName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(0, position);
+ }
+ }
+ return return_string;
+}
+
+void WebsocketSession::onMessageReceived(Json::Value message) {
+ // Determine message type and process...
+ Json::Value error;
+ if (checkMessage(message, error)) {
+ if (isNotification(message)) {
+ controller_->processNotification(message);
+ } else if (isResponse(message)) {
+ std::string id = message["id"].asString();
+ std::string method = findMethodById(id);
+ if ("" != method) {
+ if ("MB.registerComponent" == method) {
+ if (message.isMember("result") && message["result"].isInt()) {
+ mControllersIdStart = message["result"].asInt();
+ } else {
+ LOG4CXX_ERROR(ws_logger_,
+ "Not possible to initialize mControllersIdStart!");
+ }
+ } else if ("MB.subscribeTo" == method ||
+ "MB.unregisterComponent" == method ||
+ "MB.unsubscribeFrom" == method) {
+ // nothing to do for now
+ } else {
+ controller_->processResponse(method, message);
+ }
+ } else {
+ LOG4CXX_ERROR(ws_logger_,
+ "Request with id: " + id + " has not been found!");
+ }
+ } else {
+ std::string method = message["method"].asString();
+ std::string component_name = GetComponentName(method);
+
+ if (component_name == "MB") {
+ controller_->processInternalRequest(message, this);
+ } else {
+ controller_->pushRequest(message, this);
+ controller_->processRequest(message);
+ }
+ }
+ } else {
+ LOG4CXX_ERROR(ws_logger_, "Message contains wrong data!\n");
+ sendJsonMessage(error);
+ }
+}
+
+bool WebsocketSession::isNotification(Json::Value& root) {
+ bool ret = false;
+ if (false == root.isMember("id")) {
+ ret = true;
+ }
+ return ret;
+}
+
+bool WebsocketSession::isResponse(Json::Value& root) {
+ bool ret = false;
+ if ((true == root.isMember("result")) || (true == root.isMember("error"))) {
+ ret = true;
+ }
+ return ret;
+}
+
+std::string WebsocketSession::findMethodById(std::string id) {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ std::string res = "";
+ std::map<std::string, std::string>::iterator it;
+ it = mWaitResponseQueue.find(id);
+ if (it != mWaitResponseQueue.end()) {
+ res = (*it).second;
+ mWaitResponseQueue.erase(it);
+ }
+ return res;
+}
+
+bool WebsocketSession::checkMessage(Json::Value& root, Json::Value& error) {
+ Json::Value err;
+ /* check the JSON-RPC version => 2.0 */
+ if (!root.isObject() || !root.isMember("jsonrpc") ||
+ root["jsonrpc"] != "2.0") {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ return false;
+ }
+
+ if (root.isMember("id") && (root["id"].isArray() || root["id"].isObject())) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ return false;
+ }
+
+ if (root.isMember("result") && root.isMember("error")) {
+ /* message can't contain simultaneously result and error*/
+ return false;
+ }
+
+ if (root.isMember("method")) {
+ if (!root["method"].isString()) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ return false;
+ }
+ /* Check the params is an object*/
+ if (root.isMember("params") && !root["params"].isObject()) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Invalid JSONRPC params.";
+ error["error"] = err;
+ return false;
+ }
+ } else if (!root.isMember("result") && !root.isMember("error")) {
+ return false;
+ }
+ return true;
+}
+
+WebsocketSession::LoopThreadDelegate::LoopThreadDelegate(
+ MessageQueue<Message, AsyncQueue>* message_queue, WebsocketSession* handler)
+ : message_queue_(*message_queue), handler_(*handler), shutdown_(false) {}
+
+void WebsocketSession::LoopThreadDelegate::threadMain() {
+ while (!message_queue_.IsShuttingDown() && !shutdown_) {
+ DrainQueue();
+ message_queue_.wait();
+ }
+ DrainQueue();
+}
+
+void WebsocketSession::LoopThreadDelegate::exitThreadMain() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+
+void WebsocketSession::LoopThreadDelegate::DrainQueue() {
+ while (!message_queue_.empty()) {
+ Message message_ptr;
+ message_queue_.pop(message_ptr);
+ if (!shutdown_) {
+ handler_.ws_.write(boost::asio::buffer(*message_ptr));
+ };
+ }
+}
+
+void WebsocketSession::LoopThreadDelegate::SetShutdown() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+}
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 0d7ccd9ee1..6d30d6ee51 100644
--- a/src/components/hmi_message_handler/test/CMakeLists.txt
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -38,14 +38,11 @@ include_directories (
)
if (HMIADAPTER STREQUAL "messagebroker")
- set (BROKER_LIBRARIES
- message_broker_client
- message_broker_server
- )
+ set(EXCLUDE_PATHS)
+else()
+ set(EXCLUDE_PATHS hmi_message_handler_impl_test.cc)
endif()
-set(EXCLUDE_PATHS)
-
set(LIBRARIES
gmock
ApplicationManager
@@ -55,13 +52,11 @@ set(LIBRARIES
ConfigProfile
)
-if(NOT HMI_DBUS_API})
- list (APPEND EXCLUDE_PATHS
- mock_subscriber.cc
- dbus_message_adapter_test.cc
- )
-endif()
-
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+if (HMIADAPTER STREQUAL "messagebroker")
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
+endif()
+
create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index b0f63c6a0c..73fe76640d 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -31,8 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "hmi_message_handler/hmi_message_handler_impl.h"
#include "hmi_message_handler/mock_hmi_message_adapter_impl.h"
@@ -42,10 +40,10 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
-typedef utils::SharedPtr<MockHMIMessageAdapterImpl>
+typedef std::shared_ptr<MockHMIMessageAdapterImpl>
MockHMIMessageAdapterImplSPtr;
TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
@@ -53,14 +51,14 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
mock_hmi_message_handler_settings;
const uint64_t stack_size = 1000u;
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
HMIMessageHandler* message_handler =
new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(message_handler, message_adapter_impl->get_handler());
@@ -71,7 +69,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
TEST(HMIMessageAdapterImplTest, Handler_NULLPointer_CorrectReturnedPointer) {
HMIMessageHandler* message_handler = NULL;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(NULL, message_adapter_impl->get_handler());
}
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index 09f20ed75d..e66f900299 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -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
@@ -43,7 +43,7 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
using ::testing::_;
class HMIMessageHandlerImplTest : public ::testing::Test {
@@ -57,18 +57,19 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
MockHMIMessageObserver* mock_hmi_message_observer_;
+
testing::NiceMock<MockHMIMessageHandlerSettings>
mock_hmi_message_handler_settings;
const uint64_t stack_size = 1000u;
virtual void SetUp() OVERRIDE {
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
ASSERT_TRUE(NULL != hmi_handler_);
mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
- hmi_handler_, "localhost", 22);
+ hmi_handler_, "127.0.0.1", 8087);
ASSERT_TRUE(NULL != mb_adapter_);
mock_hmi_message_observer_ = new MockHMIMessageObserver();
ASSERT_TRUE(NULL != mock_hmi_message_observer_);
@@ -85,7 +86,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
hmi_message_handler::MessageSharedPointer CreateMessage() {
// The ServiceType doesn't really matter
- return new application_manager::Message(
+ return std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::FromServiceType(
protocol_handler::ServiceType::kInvalidServiceType));
}
@@ -103,7 +104,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest,
OnErrorSending_NotEmptyMessage_ExpectOnErrorSendingProceeded) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(message));
// Act
@@ -112,7 +113,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest, OnErrorSending_InvalidObserver_Cancelled) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
hmi_handler_->set_message_observer(NULL);
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(_)).Times(0);
diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h
deleted file mode 100644
index 86ebf100bb..0000000000
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h
+++ /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.
-*/
-
-#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:
- MOCK_METHOD1(Recv, void(std::string&));
-
- MockDBusMessageController(const std::string& serviceName,
- const std::string& path)
- : DBusMessageController(serviceName, path), thread_() {}
-
- virtual void processResponse(std::string method, Json::Value& root) {}
- virtual void processRequest(Json::Value& root) {}
- virtual void processNotification(Json::Value& root) {}
-
- bool Init() {
- return ::hmi_message_handler::DBusMessageController::Init() &&
- pthread_create(&thread_, 0, &Run, this) == 0;
- }
-
- private:
- pthread_t thread_;
- static void* Run(void* data) {
- if (NULL != data) {
- static_cast<MockDBusMessageController*>(data)
- ->MethodForReceiverThread(nullptr);
- }
- return 0;
- }
-};
-
-} // namespace 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_subscriber.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h
deleted file mode 100644
index 9e9074e70c..0000000000
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef 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>
-
-struct DBusConnection;
-
-namespace test {
-namespace components {
-namespace hmi_message_handler_test {
-
-class MockSubscriber {
- public:
- MockSubscriber(const std::string nameService, const std::string path);
- virtual ~MockSubscriber();
- virtual void Receive();
- bool Start();
- void Send(const std::string& message);
-
- private:
- std::string nameService_;
- std::string path_;
- DBusConnection* conn_;
-};
-
-} // namespace hmi_message_handler_test
-} // namespace components
-} // namespace test
-
-#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
deleted file mode 100644
index 0fc9110a1d..0000000000
--- a/src/components/hmi_message_handler/test/mock_subscriber.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "dbus/dbus.h"
-#include "hmi_message_handler/mock_subscriber.h"
-
-namespace test {
-namespace components {
-namespace hmi_message_handler_test {
-
-MockSubscriber::MockSubscriber(const std::string& nameService,
- const std::string& path)
- : nameService_(nameService), path_(path), conn_(NULL) {}
-
-MockSubscriber::~MockSubscriber() {}
-
-void MockSubscriber::Receive() {}
-
-bool MockSubscriber::Start() {
- DBusError err;
- dbus_error_init(&err);
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
-
- std::string rule = "type='signal',interface='" + nameService_ + "'";
- dbus_bus_add_match(conn_, rule.c_str(), &err);
- dbus_connection_flush(conn_);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
- return true;
-}
-
-void MockSubscriber::Send(const std::string& message) {}
-
-} // namespace hmi_message_handler_test
-} // namespace components
-} // namespace test
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 587bd4d98d..e6e5c89f45 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -33,23 +33,24 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#include <ctime>
#include <string>
#include <vector>
#include <set>
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/application.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/commands/command.h"
+#include "application_manager/command_factory.h"
#include "connection_handler/connection_handler.h"
#include "utils/data_accessor.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_observable.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/state_controller.h"
#include "application_manager/hmi_interfaces.h"
#include "policy/policy_types.h"
-
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
namespace resumption {
class LastState;
}
@@ -80,18 +81,24 @@ namespace application_manager {
namespace event_engine {
class EventDispatcher;
}
+namespace rpc_service {
+class RPCService;
+}
+namespace rpc_handler {
+class RPCHandler;
+}
class Application;
class StateControllerImpl;
struct CommandParametersPermissions;
using policy::RPCParams;
+typedef std::vector<ApplicationSharedPtr> AppSharedPtrs;
struct ApplicationsAppIdSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) const {
return lhs->app_id() < rhs->app_id();
}
};
-
struct ApplicationsPolicyAppIdSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) {
@@ -132,8 +139,15 @@ class ApplicationManager {
virtual void set_hmi_message_handler(
hmi_message_handler::HMIMessageHandler* handler) = 0;
+
+ /**
+ * @brief set_protocol_handler
+ * @param handler
+ * set protocol handler
+ */
virtual void set_protocol_handler(
protocol_handler::ProtocolHandler* handler) = 0;
+
virtual void set_connection_handler(
connection_handler::ConnectionHandler* handler) = 0;
@@ -153,11 +167,35 @@ class ApplicationManager {
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;
+ virtual AppSharedPtrs applications_by_button(uint32_t button) = 0;
+ virtual AppSharedPtrs applications_with_navi() = 0;
/**
+ * @brief application find application by device and policy identifier
+ * @param device_id device id
+ * @param policy_app_id poilcy identifier
+ * @return pointer to application in case if application exist, in other case
+ * return empty shared pointer
+ */
+ virtual ApplicationSharedPtr application(
+ const std::string& device_id, const std::string& policy_app_id) const = 0;
+
+ virtual void ChangeAppsHMILevel(uint32_t app_id,
+ mobile_apis::HMILevel::eType level) = 0;
+
+ virtual std::vector<std::string> devices(
+ const std::string& policy_app_id) const = 0;
+
+ virtual plugin_manager::RPCPluginManager& GetPluginManager() = 0;
+
+#ifdef BUILD_TESTS
+ virtual void SetPluginManager(
+ std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager) = 0;
+#endif
+
+ virtual std::vector<ApplicationSharedPtr>
+ applications_with_mobile_projection() = 0;
+ /**
* @brief Returns media application with LIMITED HMI Level if exists
*
* @return Shared pointer to application if application does not
@@ -182,6 +220,9 @@ class ApplicationManager {
*/
virtual ApplicationSharedPtr get_limited_voice_application() const = 0;
+ virtual ApplicationSharedPtr get_limited_mobile_projection_application()
+ const = 0;
+
/**
* @brief Retrieves application id associated with correlation id
*
@@ -199,6 +240,18 @@ class ApplicationManager {
*/
virtual void set_application_id(const int32_t correlation_id,
const uint32_t app_id) = 0;
+ /**
+ * @brief get_current_audio_source
+ * @return current audio source
+ */
+ virtual uint32_t get_current_audio_source() const = 0;
+
+ /**
+ * @brief set_current_audio_source
+ * @param source
+ * set current audio source
+ */
+ virtual void set_current_audio_source(const uint32_t source) = 0;
/**
* @brief OnHMILevelChanged the callback that allows SDL to react when
@@ -220,27 +273,35 @@ class ApplicationManager {
*
**/
virtual void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) = 0;
+ const std::shared_ptr<Application> app) = 0;
+
+ /**
+ * @brief Checks if driver distraction state is valid, creates message
+ * which is sent to the application if allowed, otherwise it is added
+ * to a list of postponed messages.
+ * @param application contains registered application.
+ */
+ virtual void SendDriverDistractionState(ApplicationSharedPtr application) = 0;
/**
* @brief Checks if Application is subscribed for way points
- * @param Application AppID
+ * @param Application pointer
* @return true if Application is subscribed for way points
* otherwise false
*/
- virtual bool IsAppSubscribedForWayPoints(const uint32_t app_id) const = 0;
+ virtual bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const = 0;
/**
* @brief Subscribe Application for way points
- * @param Application AppID
+ * @param Application pointer
*/
- virtual void SubscribeAppForWayPoints(const uint32_t app_id) = 0;
+ virtual void SubscribeAppForWayPoints(ApplicationSharedPtr app) = 0;
/**
* @brief Unsubscribe Application for way points
- * @param Application AppID
+ * @param Application pointer
*/
- virtual void UnsubscribeAppFromWayPoints(const uint32_t app_id) = 0;
+ virtual void UnsubscribeAppFromWayPoints(ApplicationSharedPtr app) = 0;
/**
* @brief Is Any Application is subscribed for way points
@@ -252,18 +313,27 @@ class ApplicationManager {
* @brief Get subscribed for way points
* @return reference to set of subscribed apps for way points
*/
- virtual const std::set<int32_t> GetAppsSubscribedForWayPoints() const = 0;
+ virtual const std::set<uint32_t> GetAppsSubscribedForWayPoints() const = 0;
- virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
- bool final_message = false) = 0;
+ virtual void RemoveHMIFakeParameters(
+ application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id) = 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 Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ virtual bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const = 0;
+
/**
* @brief hmi_capabilities return capabilities of hmi
* @return capabilities of hmi
@@ -275,6 +345,17 @@ class ApplicationManager {
virtual void ProcessQueryApp(const smart_objects::SmartObject& sm_object,
const uint32_t connection_key) = 0;
+ /**
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of switched
+ * application
+ */
+ virtual void ProcessReconnection(ApplicationSharedPtr application,
+ const uint32_t connection_key) = 0;
+
virtual bool is_attenuated_supported() const = 0;
/**
@@ -296,9 +377,22 @@ class ApplicationManager {
*/
virtual void OnApplicationRegistered(ApplicationSharedPtr app) = 0;
+ /**
+ * @brief OnApplicationSwitched starts activies postponed during application
+ * transport switching
+ * @param app Application
+ */
+ virtual void OnApplicationSwitched(ApplicationSharedPtr app) = 0;
+
virtual connection_handler::ConnectionHandler& connection_handler() const = 0;
virtual protocol_handler::ProtocolHandler& protocol_handler() const = 0;
virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0;
+ virtual const policy::PolicyHandlerInterface& GetPolicyHandler() const = 0;
+
+ virtual rpc_service::RPCService& GetRPCService() const = 0;
+ virtual rpc_handler::RPCHandler& GetRPCHandler() const = 0;
+ virtual bool is_stopping() const = 0;
+ virtual bool is_audio_pass_thru_active() const = 0;
virtual uint32_t GetNextHMICorrelationID() = 0;
virtual uint32_t GenerateNewHMIAppID() = 0;
@@ -309,18 +403,25 @@ class ApplicationManager {
*/
virtual void EndNaviServices(uint32_t app_id) = 0;
- /* @brief Starts audio passthru process
- *
- * @return true on success, false if passthru is already in process
+ /**
+ * @brief returns true if low voltage state is active
*/
- virtual bool BeginAudioPassThrough() = 0;
+ virtual bool IsLowVoltage() const = 0;
- /*
- * @brief Finishes already started audio passthru process
- *
- * @return true on success, false if passthru is not active
+ /**
+ * @brief Starts AudioPassThru process by given application
+ * @param app_id ID of the application which starts the process
+ * @return true if AudioPassThru can be started, false otherwise
*/
- virtual bool EndAudioPassThrough() = 0;
+ virtual bool BeginAudioPassThru(uint32_t app_id) = 0;
+
+ /**
+ * @brief Finishes already started AudioPassThru process by given application
+ * @param app_id ID of the application which started the process
+ * @return true if AudioPassThru process has been started with given
+ * application and thus it can be stopped, false otherwise
+ */
+ virtual bool EndAudioPassThru(uint32_t app_id) = 0;
virtual void ConnectToDevice(const std::string& device_mac) = 0;
@@ -334,10 +435,10 @@ class ApplicationManager {
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- virtual std::vector<ApplicationSharedPtr> IviInfoUpdated(
- VehicleDataType vehicle_info, int value) = 0;
+ virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value) = 0;
- virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ virtual ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) = 0;
virtual void SendUpdateAppList() = 0;
@@ -372,7 +473,7 @@ class ApplicationManager {
const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset) = 0;
+ const uint64_t offset) = 0;
/*
* @brief Sets SDL access to all mobile apps
*
@@ -385,7 +486,8 @@ class ApplicationManager {
*
* @param state New state to be set
*/
- virtual void set_driver_distraction(bool is_distracting) = 0;
+ virtual void set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) = 0;
/*
* @brief Starts audio pass thru thread
@@ -477,9 +579,8 @@ class ApplicationManager {
* @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 ApplicationSharedPtr app,
+ const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions = NULL) = 0;
@@ -496,6 +597,15 @@ class ApplicationManager {
virtual bool IsApplicationForbidden(
uint32_t connection_key, const std::string& policy_app_id) const = 0;
+ /**
+ * @brief IsAppInReconnectMode check if application belongs to session
+ * affected by transport switching at the moment
+ * @param policy_app_id Application id
+ * @return True if application is registered within session being switched,
+ * otherwise - false
+ */
+ virtual bool IsAppInReconnectMode(const std::string& policy_app_id) const = 0;
+
virtual resumption::ResumeCtrl& resume_controller() = 0;
/**
@@ -507,6 +617,9 @@ class ApplicationManager {
virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
+ virtual protocol_handler::MajorProtocolVersion SupportedSDLVersion()
+ const = 0;
+
/*
* @brief Converts connection string transport type representation
* to HMI Common_TransportType
@@ -556,21 +669,19 @@ class ApplicationManager {
/**
* @brief CreateRegularState create regular HMI state for application
- * @param app_id
+ * @param app Application
* @param hmi_level of returned state
* @param audio_state of returned state
* @param system_context of returned state
* @return new regular HMI state
*/
virtual HmiStatePtr CreateRegularState(
- uint32_t app_id,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context) const = 0;
- 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)
@@ -587,9 +698,35 @@ class ApplicationManager {
*/
virtual void ForbidStreaming(uint32_t app_id) = 0;
+ /**
+ * @brief Called when application completes streaming configuration
+ * @param app_id Streaming application id
+ * @param service_type Streaming service type
+ * @param result true if configuration is successful, false otherwise
+ * @param rejected_params list of rejected parameters' name. Valid
+ * only when result is false.
+ */
+ virtual void OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) = 0;
+
virtual const ApplicationManagerSettings& get_settings() const = 0;
+ // Extract the app ID to use internally based on the UseFullAppID .ini setting
+ virtual std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const = 0;
virtual event_engine::EventDispatcher& event_dispatcher() = 0;
+
+ virtual uint32_t GetAvailableSpaceForApp(const std::string& folder_name) = 0;
+ virtual void OnTimerSendTTSGlobalProperties() = 0;
+ virtual void OnLowVoltage() = 0;
+ virtual void OnWakeUp() = 0;
+
+ virtual bool IsSOStructValid(
+ const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities) = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index fa01b34783..8fdca4125f 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -38,6 +38,8 @@
#include <stdint.h>
#include <string>
+#include <map>
+#include <vector>
namespace application_manager {
class ApplicationManagerSettings : public RequestControlerSettings,
@@ -48,6 +50,8 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::pair<uint32_t, int32_t>& read_did_frequency() const = 0;
virtual const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const = 0;
+ virtual const std::pair<uint32_t, int32_t>&
+ get_interior_vehicle_data_frequency() const = 0;
virtual uint32_t hash_string_size() const = 0;
virtual const uint32_t& app_dir_quota() const = 0;
virtual uint32_t stop_streaming_timeout() const = 0;
@@ -63,6 +67,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual bool launch_hmi() const = 0;
virtual const uint32_t& delete_file_in_none() const = 0;
virtual const std::vector<uint32_t>& supported_diag_modes() const = 0;
+ virtual const std::string& app_info_storage() const = 0;
virtual const uint32_t& list_files_in_none() const = 0;
virtual const std::string& tts_delimiter() const = 0;
virtual const uint32_t& put_file_in_none() const = 0;
@@ -79,6 +84,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::string& video_stream_file() const = 0;
virtual const std::string& audio_stream_file() const = 0;
+ virtual bool use_full_app_id() const = 0;
virtual bool use_db_for_resumption() const = 0;
virtual const uint32_t& app_resumption_save_persistent_data_timeout()
const = 0;
@@ -86,6 +92,13 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_resuming_timeout() const = 0;
virtual uint16_t attempts_to_open_resumption_db() const = 0;
virtual uint16_t open_attempt_timeout_ms_resumption_db() const = 0;
+ virtual const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const = 0;
+ virtual const std::string& navigation_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& projection_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& media_lowbandwidth_resumption_level() const = 0;
virtual void set_config_file_name(const std::string& fileName) = 0;
virtual const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const = 0;
@@ -93,6 +106,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_icons_folder_max_size() const = 0;
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
+ virtual const std::string& plugins_folder() const = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 556620b644..1283584ef8 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -90,6 +90,9 @@ class HMICapabilities {
virtual bool is_ivi_cooperating() const = 0;
virtual void set_is_ivi_cooperating(const bool value) = 0;
+ virtual bool is_rc_cooperating() const = 0;
+ virtual void set_is_rc_cooperating(const bool value) = 0;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -409,6 +412,93 @@ class HMICapabilities {
*/
virtual bool phone_call_supported() const = 0;
+ /*
+ * @brief Interface to store whether HMI supports video streaming
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ virtual void set_video_streaming_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves whether HMI supports video streaming
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool video_streaming_supported() const = 0;
+
+ /*
+ * @brief Interface to store whether HMI supports remote control
+ *
+ * @param supported Indicates whether remote control is supported by HMI
+ */
+ virtual void set_rc_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves whether HMI supports remote control
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool rc_supported() const = 0;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the navigation "System Capability"
+ *
+ * @param navigation_capability contains information related
+ * to the navigation system capability.
+ */
+ virtual void set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) = 0;
+
+ /*
+ * @brief Retrieves information regarding the navigation system capability
+ *
+ * @return NAVIGATION system capability
+ */
+ virtual const smart_objects::SmartObject* navigation_capability() const = 0;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the phone "System Capability"
+ *
+ * @param phone_capability contains information related
+ * to the phone system capability.
+ */
+ virtual void set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) = 0;
+
+ /*
+ * @brief Retrieves information regarding the phone call system capability
+ *
+ * @return PHONE_CALL system capability
+ */
+ virtual const smart_objects::SmartObject* phone_capability() const = 0;
+
+ /*
+ * @brief Sets HMI's video streaming related capability information
+ *
+ * @param video_streaming_capability the video streaming related capabilities
+ */
+ virtual void set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) = 0;
+
+ /*
+ * @brief Retrieves HMI's video streaming related capabilities
+ *
+ * @return HMI's video streaming related capability information
+ */
+ virtual const smart_objects::SmartObject* video_streaming_capability()
+ const = 0;
+
+ /**
+ * @brief Sets available RC capabilities for further usage by RC functionality
+ * @param rc_capability capabilities to set
+ */
+ virtual void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) = 0;
+
+ virtual const smart_objects::SmartObject* rc_capability() const = 0;
+
virtual void Init(resumption::LastState* last_state) = 0;
/**
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index 074a075e1f..ee9274ead7 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -39,16 +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 "utils/callable.h"
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+#include "policy/cache_manager_interface.h"
+using namespace ::rpc::policy_table_interface_base;
namespace policy {
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyHandlerInterface {
public:
@@ -81,11 +85,12 @@ class PolicyHandlerInterface {
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;
virtual DeviceConsent GetUserConsentForDevice(
@@ -101,15 +106,25 @@ class PolicyHandlerInterface {
EndpointUrls& out_end_points) = 0;
virtual std::string GetLockScreenIconUrl() const = 0;
virtual uint32_t NextRetryTimeout() = 0;
- virtual uint32_t TimeoutExchangeSec() = 0;
- virtual uint32_t TimeoutExchangeMSec() = 0;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ virtual uint32_t TimeoutExchangeSec() const = 0;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in miliseconds
+ */
+ virtual uint32_t TimeoutExchangeMSec() const = 0;
virtual void OnExceededTimeout() = 0;
virtual void OnSystemReady() = 0;
virtual void PTUpdatedAt(Counters counter, int value) = 0;
virtual void add_listener(PolicyHandlerObserver* listener) = 0;
virtual void remove_listener(PolicyHandlerObserver* listener) = 0;
- virtual utils::SharedPtr<usage_statistics::StatisticsManager>
+ virtual std::shared_ptr<usage_statistics::StatisticsManager>
GetStatisticManager() const = 0;
virtual void SendOnAppPermissionsChanged(
@@ -177,14 +192,23 @@ class PolicyHandlerInterface {
virtual void SetDeviceInfo(const std::string& device_id,
const DeviceInfo& device_info) = 0;
- /**
- * @brief Store user-changed permissions consent to DB
- * @param connection_key Connection key of application or 0, if permissions
- * should be applied to all applications
- * @param permissions User-changed group permissions consent
- */
+/**
+*@brief Processes data from OnAppPermissionConsent notification with
+*permissions changes and ExternalConsent status changes done by user
+*@param connection_key Connection key of application, 0 if no key has been
+*provided
+*@param permissions Groups permissions changes
+*@param external_consent_status Customer connectivity settings status changes
+*/
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ virtual void OnAppPermissionConsent(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status) = 0;
+#else
virtual void OnAppPermissionConsent(const uint32_t connection_key,
const PermissionConsent& permissions) = 0;
+#endif
/**
* @brief Get appropriate message parameters and send them with response
@@ -292,6 +316,9 @@ class PolicyHandlerInterface {
std::map<std::string, StringArray> app_hmi_types) = 0;
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
@@ -310,7 +337,9 @@ class PolicyHandlerInterface {
* @param application_id The policy aplication id.
* @return function that will notify update manager about new application
*/
- virtual StatusNotifier 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
@@ -340,7 +369,7 @@ class PolicyHandlerInterface {
/**
* @brief Handler on applications search completed
*/
- virtual void OnAppsSearchCompleted() = 0;
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
@@ -362,6 +391,32 @@ class PolicyHandlerInterface {
mobile_apis::RequestType::eType type) const = 0;
/**
+ * @brief Checks if certain request subtype is allowed for application
+ * @param policy_app_id Unique applicaion id
+ * @param request_subtype Request subtype
+ * @return true, if allowed, otherwise - false
+ */
+ virtual bool IsRequestSubTypeAllowed(
+ const std::string& policy_app_id,
+ const std::string& request_subtype) const = 0;
+
+ /**
+ * @brief Gets application request types state
+ * @param policy_app_id Unique application id
+ * @return request types state
+ */
+ virtual RequestType::State GetAppRequestTypeState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Gets application request subtypes state
+ * @param policy_app_id Unique application id
+ * @return request subtypes state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypeState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets application request types
* @param policy_app_id Unique application id
* @return request types
@@ -370,6 +425,14 @@ class PolicyHandlerInterface {
const std::string& policy_app_id) const = 0;
/**
+ * @brief Gets application request subtypes
+ * @param policy_app_id Unique application id
+ * @return app request subtypes
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Gets vehicle information
* @return Structure with vehicle information
*/
@@ -398,9 +461,103 @@ class PolicyHandlerInterface {
virtual const PolicySettings& get_settings() const = 0;
virtual const std::string RemoteAppsUrl() const = 0;
+ /**
+ * @brief OnDeviceSwitching Notifies policy manager on device switch event so
+ * policy permissions should be processed accordingly
+ * @param device_id_from Id of device being switched
+ * @param device_id_to Id of device on the new transport
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+ /**
+ * @brief Sets HMI default type for specified application
+ * @param application_id ID application
+ * @param app_types list of HMI types
+ */
+ virtual void SetDefaultHmiTypes(
+ const std::string& application_id,
+ const smart_objects::SmartObject* app_types) = 0;
+
+ /**
+ * Checks if application has HMI type
+ * @param application_id ID application
+ * @param hmi HMI type to check
+ * @param app_types additional list of HMI type to search in it
+ * @return true if hmi is contained in policy or app_types
+ */
+ virtual bool CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in HMI status
+ * @param device_id Device on which app is running
+ * @param policy_app_id ID of application
+ * @param hmi_level new HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
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
index 6c0ff758bb..1c32102184 100644
--- a/src/components/include/application_manager/policies/policy_handler_observer.h
+++ b/src/components/include/application_manager/policies/policy_handler_observer.h
@@ -43,9 +43,13 @@ 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
diff --git a/src/components/include/application_manager/rpc_handler.h b/src/components/include/application_manager/rpc_handler.h
new file mode 100644
index 0000000000..9b6428f32d
--- /dev/null
+++ b/src/components/include/application_manager/rpc_handler.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
+
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+#ifdef TELEMETRY_MONITOR
+#include "application_manager/telemetry_observer.h"
+#endif // TELEMETRY_MONITOR
+
+namespace application_manager {
+namespace rpc_handler {
+
+class RPCHandler
+ : public hmi_message_handler::HMIMessageObserver,
+ public protocol_handler::ProtocolObserver
+#ifdef TELEMETRY_MONITOR
+ ,
+ public telemetry_monitor::TelemetryObservable<AMTelemetryObserver>
+#endif // TELEMETRY_MONITOR
+ {
+ public:
+ virtual ~RPCHandler() {}
+};
+
+} // namespace rpc_handler
+} // namespace application_manager
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_HANDLER_H
diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h
new file mode 100644
index 0000000000..79b4007f71
--- /dev/null
+++ b/src/components/include/application_manager/rpc_service.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
+
+#include "application_manager/commands/command.h"
+#include "application_manager/message.h"
+#include "protocol_handler/protocol_handler.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace application_manager {
+namespace rpc_service {
+
+class RPCService {
+ public:
+ virtual ~RPCService() {}
+
+ /**
+ * @brief ManageMobileCommand convert message to mobile command and execute it
+ * @param message pointer to received message
+ * @param origin origin of command
+ * @return true if command is executed, otherwise return false
+ */
+ virtual bool ManageMobileCommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandSource source) = 0;
+ /**
+ * @brief ManageHMICommand convert message to HMI command and execute it
+ * @param message pointer to received message
+ * @return true if command is executed, otherwise return false
+ */
+ virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
+
+ /**
+ * @brief SendMessageToMobile Put message to the queue to be sent to mobile.
+ * @param message pointer to message to send
+ * @param final_message if true - connection to mobile will be closed
+ * after processing this message
+ */
+ virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false) = 0;
+ /**
+ * @brief SendMessageToHMI Put message to the queue to be sent to HMI.
+ * @param message pointer to message to send
+ */
+ virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
+
+ /**
+ * @brief set_protocol_handler
+ * @param handler
+ * set protocol handler
+ */
+ virtual void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) = 0;
+ virtual void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) = 0;
+};
+} // namespace rpc_service
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_H
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 2fe0492b42..8f608488e9 100644
--- a/src/components/include/application_manager/state_controller.h
+++ b/src/components/include/application_manager/state_controller.h
@@ -49,6 +49,7 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp) = 0;
virtual void SetRegularState(ApplicationSharedPtr app,
@@ -58,6 +59,7 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp) = 0;
@@ -67,7 +69,8 @@ class StateController {
virtual void SetRegularState(
ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state) = 0;
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
@@ -82,9 +85,17 @@ class StateController {
virtual int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) = 0;
+ /**
+ * @brief OnVideoStreamingStarted process video streaming started
+ * @param app projection or navigation application starting streaming
+ */
+ virtual void OnVideoStreamingStarted(ApplicationConstSharedPtr app) = 0;
- virtual void OnNaviStreamingStarted() = 0;
- virtual void OnNaviStreamingStopped() = 0;
+ /**
+ * @brief OnVideoStreamingStopped process video streaming stopped
+ * @param app projection or navigation application stopping streaming
+ */
+ virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app) = 0;
virtual void OnStateChanged(ApplicationSharedPtr app,
HmiStatePtr old_state,
HmiStatePtr new_state) = 0;
diff --git a/src/components/include/application_manager/vehicle_info_data.h b/src/components/include/application_manager/vehicle_info_data.h
deleted file mode 100644
index 693353abfe..0000000000
--- a/src/components/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_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
index e8e1af715a..a50760b547 100644
--- a/src/components/include/connection_handler/connection_handler.h
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -39,6 +39,8 @@
#include "connection_handler/device.h"
#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
+#include "utils/macro.h"
+#include "utils/data_accessor.h"
/**
* \namespace connection_handler
@@ -50,6 +52,15 @@ enum CloseSessionReason { kCommon = 0, kFlood, kMalformed, kUnauthorizedApp };
class ConnectionHandlerObserver;
+// The SessionConnectionMap keeps track of the primary and secondary transports
+// associated with a session ID
+typedef struct {
+ transport_manager::ConnectionUID primary_transport;
+ transport_manager::ConnectionUID secondary_transport;
+ std::vector<protocol_handler::ServiceType> secondary_transport_services;
+} SessionTransports;
+typedef std::map<uint8_t, SessionTransports> SessionConnectionMap;
+
/**
* \class ConnectionHandler
* \brief SmartDeviceLink ConnectionHandler interface class
@@ -175,10 +186,12 @@ class ConnectionHandler {
* \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;
+ virtual int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ connection_handler::DeviceHandle* device_id) const = 0;
+
/**
* @brief GetConnectedDevicesMAC allows to obtain MAC adresses for all
* currently connected devices.
@@ -198,6 +211,81 @@ class ConnectionHandler {
virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0;
+ /**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ virtual uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) = 0;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ virtual bool RemoveSession(uint8_t session_id) = 0;
+
+ virtual DataAccessor<SessionConnectionMap> session_connection_map() = 0;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ virtual SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) = 0;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ virtual const SessionTransports GetSessionTransports(
+ uint8_t session_id) const = 0;
+
+ /**
+ * \brief Invoked when observer's OnServiceStartedCallback is completed
+ * \param session_key the key of started session passed to
+ * OnServiceStartedCallback().
+ * \param result true if observer accepts starting service, false otherwise
+ * \param rejected_params list of rejected parameters' name. Only valid when
+ * result is false. Note that even if result is false, this may be empty.
+ *
+ * \note This is invoked only once but can be invoked by multiple threads.
+ * Also it can be invoked before OnServiceStartedCallback() returns.
+ **/
+ virtual void NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params) = 0;
+
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param session_id session ID taken from Register Secondary Transport frame
+ * \return true if successful
+ **/
+ virtual bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) = 0;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ virtual void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index e25b0aaea5..154a2a8e34 100644
--- a/src/components/include/connection_handler/connection_handler_observer.h
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+#include <string>
#include "connection_handler/device.h"
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
@@ -42,6 +43,8 @@
#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
+struct BsonObject;
+
/**
* \namespace connection_handler
* \brief SmartDeviceLink connection_handler namespace.
@@ -83,15 +86,18 @@ class ConnectionHandlerObserver {
/**
* \brief Callback function used by connection_handler
* when Mobile Application initiates start of new service.
+ * Result must be notified through NotifyServiceStartedResult().
* \param deviceHandle Device identifier within which session has to be
* started.
* \param sessionKey Key of started session.
* \param type Established service type
+ * \param params Configuration parameters for this service
*/
- virtual bool OnServiceStartedCallback(
+ virtual void OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
- const protocol_handler::ServiceType& type) = 0;
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) = 0;
/**
* \brief Callback function used by connection_handler
@@ -105,10 +111,56 @@ class ConnectionHandlerObserver {
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) = 0;
+ /**
+ * @brief OnDeviceSwitchingStart is invoked on device transport switching
+ * start (e.g. from Bluetooth to USB)
+ * @param device_from device params being switched to new transport
+ * @param device_to device params on the new transport
+ */
+ virtual void OnDeviceSwitchingStart(const Device& device_from,
+ const Device& device_to) = 0;
+
+ /**
+ * @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
+ * i.e. timeout for switching is expired
+ * @param device_uid UID of device being switched
+ */
+ virtual void OnDeviceSwitchingFinish(const std::string& device_uid) = 0;
+
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ virtual bool CheckAppIsNavi(const uint32_t app_id) const = 0;
+
#ifdef ENABLE_SECURITY
+ /**
+ * @brief Get unique handshake context by application id
+ * @param key id of application
+ * @return generated handshake context or empty context if application with
+ * provided id does not exist
+ */
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * \brief Called when secondary transport for a particular app is started.
+ * \param device_handle Device identifier on which the secondary transport is
+ * started.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) = 0;
+
+ /**
+ * \brief Called when secondary transport for a particular app is terminated.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportEndedCallback(const int32_t session_key) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/hmi_message_handler/hmi_message_adapter.h b/src/components/include/hmi_message_handler/hmi_message_adapter.h
index 10e4231528..704cc619be 100644
--- a/src/components/include/hmi_message_handler/hmi_message_adapter.h
+++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h
@@ -43,6 +43,12 @@ namespace hmi_message_handler {
* SDL with HMI has to implement this interface.
*/
class HMIMessageAdapter : public HMIMessageSender {
+ public:
+ /**
+ * \brief Destructor
+ */
+ virtual ~HMIMessageAdapter() {}
+
protected:
/**
* \brief Interface for subscriptions.
diff --git a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
index 5386869555..8b24f2cf7d 100644
--- a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
+++ b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
@@ -44,7 +44,7 @@ class HMIMessageHandlerSettings {
public:
virtual ~HMIMessageHandlerSettings() {}
- virtual const uint64_t& thread_min_stack_size() const = 0;
+ virtual const uint64_t thread_min_stack_size() const = 0;
};
} // namespace hmi_message_handler
#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_SETTINGS_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
index aef1e33379..e7ba2619ee 100644
--- a/src/components/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -33,8 +33,6 @@
#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
-#include "utils/shared_ptr.h"
-
namespace application_manager {
class Message;
}
@@ -43,10 +41,11 @@ namespace hmi_message_handler {
class HMIMessageObserver {
public:
+ virtual ~HMIMessageObserver() {}
virtual void OnMessageReceived(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
virtual void OnErrorSending(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
};
}
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
index 95ed2c63c4..3f70f78a97 100644
--- a/src/components/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -36,10 +36,11 @@
#include "application_manager/message.h"
namespace hmi_message_handler {
-typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+typedef std::shared_ptr<application_manager::Message> MessageSharedPointer;
class HMIMessageSender {
public:
+ virtual ~HMIMessageSender() {}
virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
};
}
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
index a5c5338265..c446c87d1b 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_LISTENER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
#include <queue>
@@ -61,12 +61,12 @@ class PolicyListener {
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.
- */
+ * @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;
/**
@@ -113,6 +113,58 @@ class PolicyListener {
* @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;
+
+ /**
+ * Gets devices ids by policy application id
+ * @param policy_app_id
+ * @return list devices ids
+ */
+ virtual std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * Notifies about changing HMI status
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
};
-} // namespace policy
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_LISTENER_H_
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index 74a3d36c4f..57f6d2f802 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -30,31 +30,44 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
#include <vector>
#include "utils/callable.h"
#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
#include "policy/policy_listener.h"
-#include "usage_statistics/statistics_manager.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/cache_manager_interface.h"
+#include "policy/access_remote.h"
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
+ /**
+ * @brief The NotificationMode enum defines whether application will be
+ * notified about changes done (e.g. after consents were changed) or not
+ */
+ enum NotificationMode { kSilentMode, kNotifyApplicationMode };
virtual ~PolicyManager() {}
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
virtual void set_listener(PolicyListener* listener) = 0;
/**
- * Inits Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
*/
virtual bool InitPT(const std::string& file_name,
const PolicySettings* settings) = 0;
@@ -65,24 +78,30 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* 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
+ * @return true if successfully
*/
virtual bool LoadPT(const std::string& file,
const BinaryMessage& pt_content) = 0;
/**
- * Resets Policy Table
+ * @brief Resets Policy Table
* @param file_name Path to preloaded PT file
* @return true if successfully
*/
virtual bool ResetPT(const std::string& file_name) = 0;
/**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
+ virtual std::string GetUpdateUrl(int service_type) = 0;
+
+ /**
* @brief Gets all URLs for sending PTS to from PT itself.
* @param service_type Service specifies user of URL
* @return vector of urls
*/
-
virtual void GetUpdateUrls(const uint32_t service_type,
EndpointUrls& out_end_points) = 0;
virtual void GetUpdateUrls(const std::string& service_type,
@@ -90,7 +109,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- *
* @return url which point to the resourse where lock screen icon could be
*obtained.
*/
@@ -108,6 +126,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
+ * @param rpc_params List of RPC params
* @param CheckPermissionResult containing flag if HMI Level is allowed
* and list of allowed params.
*/
@@ -130,41 +149,43 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual std::string GetPolicyTableStatus() const = 0;
/**
- * Checks is PT exceeded kilometers
+ * @brief 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
+ * @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
/**
* @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchange() = 0;
/**
- * @brief ExchangeByUserRequest
+ * @brief Exchange by user request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchangeAtUserRequest() = 0;
/**
- * Resets retry sequence
+ * @brief Resets retry sequence
*/
virtual void ResetRetrySequence() = 0;
/**
- * Gets timeout to wait before next retry updating PT
+ * @brief Gets timeout to wait before next retry updating PT
* If timeout is less or equal to zero then the retry sequence is not need.
* @return timeout in seconds
*/
virtual int NextRetryTimeout() = 0;
/**
- * Gets timeout to wait until receive response
+ * @brief Gets timeout to wait until receive response
* @return timeout in seconds
*/
virtual uint32_t TimeoutExchangeMSec() = 0;
@@ -177,7 +198,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
/**
- * Handler of exceeding timeout of exchanging policy table
+ * @brief Handler of exceeding timeout of exchanging policy table
*/
virtual void OnExceededTimeout() = 0;
@@ -216,21 +237,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
*/
virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
const bool is_device_allowed) = 0;
/**
- * Sets counter value that passed for receiving PT UPdate.
+ * @brief Sets counter value that passed for receiving PT UPdate.
*/
virtual void PTUpdatedAt(Counters counter, int value) = 0;
/**
* @brief Retrieves data from app_policies about app on its registration:
- * @param app_id - id of registered app
- * @param app_types Section on HMI where app can appear (Navigation, Phone
- * etc)
+ * @param application_id - id of registered app
* @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
*/
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -259,8 +283,10 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* The permissions is not const reference because it may contains
* valid data as well as invalid. So we will remove all invalid data
* from this structure.
+ * @param mode notification mode
*/
- virtual void SetUserConsentForApp(const PermissionConsent& permissions) = 0;
+ virtual void SetUserConsentForApp(const PermissionConsent& permissions,
+ const NotificationMode mode) = 0;
/**
* @brief Get default HMI level for application
@@ -285,6 +311,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Get user friendly messages for given RPC messages and language
* @param message_codes RPC message codes
* @param language Language
+ * @param active_hmi_language Currently active language
* @return Array of structs with appropriate message parameters
*/
virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
@@ -293,7 +320,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& active_hmi_language) = 0;
/**
- * Checks if the application is revoked
+ * @brief Checks if the application is revoked
* @param app_id application id
* @return true if application is revoked
*/
@@ -320,11 +347,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppPermissions GetAppPermissionsChanges(
const std::string& policy_app_id) = 0;
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
/**
* @brief Return device id, which hosts specific application
- * @param Application id, which is required to update device id
+ * @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
const std::string& policy_app_id) const = 0;
@@ -347,13 +378,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
- * @param application_id
+ * @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
const std::string& application_id) = 0;
/**
- * Marks device as upaired
+ * @brief Marks device as upaired
* @param device_id id device
*/
virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
@@ -361,25 +392,31 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @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
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
- virtual StatusNotifier AddApplication(const std::string& application_id) = 0;
+ 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.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
*/
virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
/**
* @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
*/
virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
@@ -391,9 +428,9 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnSystemReady() = 0;
/**
- * @brief GetNotificationNumber
- * @param priority
- * @return
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
*/
virtual uint32_t GetNotificationsNumber(
const std::string& priority) const = 0;
@@ -412,7 +449,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
/**
- * Returns heart beat timeout
+ * @brief Returns heart beat timeout
* @param app_id application id
* @return if timeout was set then value in milliseconds greater zero
* otherwise heart beat for specific application isn't set
@@ -420,7 +457,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
/**
- * @brief SaveUpdateStatusRequired alows to save update status.
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
*/
virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
@@ -431,28 +469,56 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
*/
- virtual void OnAppsSearchCompleted() = 0;
+ 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.
- *
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
* @param application_id registered application.
*/
virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
/**
* @brief Gets request types for application
* @param policy_app_id Unique application id
- * @return request_types Request types of application
+ * @return request types of application
*/
virtual const std::vector<std::string> GetAppRequestTypes(
const std::string policy_app_id) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get information about vehicle
+ * @return vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
@@ -465,7 +531,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @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;
@@ -473,7 +538,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @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;
@@ -484,6 +548,10 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
virtual const PolicySettings& get_settings() const = 0;
/**
@@ -495,6 +563,55 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
/**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ virtual bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) = 0;
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ std::shared_ptr<AccessRemote> access_remote) = 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
@@ -506,15 +623,38 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
const EndpointUrls& urls) const = 0;
+ /**
+ * @brief Checks, if SDL needs to update it's policy table section
+ "external_consent_status"
+ * @param ExternalConsent status
+ * @return true if such check is needed, false - if not.
+ */
+ virtual bool IsNeedToUpdateExternalConsentStatus(
+ const ExternalConsentStatus& status) const = 0;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status ExternalConsent status
+ * @return true if succeeded, otherwise - false
+ */
+ virtual bool SetExternalConsentStatus(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return ExternalConsent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() = 0;
+
protected:
/**
- * Checks is PT exceeded IgnitionCycles
+ * @brief Checks is PT exceeded IgnitionCycles
* @return true if exceeded
*/
virtual bool ExceededIgnitionCycles() = 0;
/**
- * Checks is PT exceeded days
+ * @brief Checks is PT exceeded days
* @return true if exceeded
*/
virtual bool ExceededDays() = 0;
@@ -532,4 +672,4 @@ class PolicyManager : public usage_statistics::StatisticsManager {
extern "C" policy::PolicyManager* CreateManager();
extern "C" void DeleteManager(policy::PolicyManager*);
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_settings.h b/src/components/include/policy/policy_external/policy/policy_settings.h
index def9fca05a..7eca5129ad 100644
--- a/src/components/include/policy/policy_external/policy/policy_settings.h
+++ b/src/components/include/policy/policy_external/policy/policy_settings.h
@@ -31,6 +31,8 @@ class PolicySettings {
*/
virtual const std::string& policies_snapshot_file_name() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
/**
* @brief Returns system files folder path
*/
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
index 45883163c4..3f01a30a62 100644
--- 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
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-#include "statistics_manager.h"
+#include "policy/usage_statistics/statistics_manager.h"
namespace usage_statistics {
@@ -47,4 +47,4 @@ class AppStopwatch {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
index a74bb0592e..7186400ff4 100644
--- 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
@@ -30,19 +30,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
#include <stdint.h>
#include <string>
namespace usage_statistics {
-enum GlobalCounterId { IAP_BUFFER_FULL, SYNC_OUT_OF_MEMORY, SYNC_REBOOTS };
+enum GlobalCounterId {
+ GLOBAL_COUNTER_NONE,
+ IAP_BUFFER_FULL,
+ SYNC_OUT_OF_MEMORY,
+ SYNC_REBOOTS
+};
-enum AppInfoId { LANGUAGE_GUI, LANGUAGE_VUI };
+enum AppInfoId { APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI };
enum AppStopwatchId {
+ STOPWATCH_NONE,
SECONDS_HMI_FULL,
SECONDS_HMI_LIMITED,
SECONDS_HMI_BACKGROUND,
@@ -50,6 +56,7 @@ enum AppStopwatchId {
};
enum AppCounterId {
+ APP_COUNTER_NONE,
USER_SELECTIONS,
REJECTIONS_SYNC_OUT_OF_MEMORY,
REJECTIONS_NICKNAME_MISMATCH,
@@ -64,11 +71,36 @@ enum AppCounterId {
class StatisticsManager {
public:
virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
virtual void Set(const std::string& app_id,
AppInfoId type,
const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
virtual void Add(const std::string& app_id,
AppStopwatchId type,
int32_t timespan_seconds) = 0;
@@ -76,4 +108,4 @@ class StatisticsManager {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
new file mode 100644
index 0000000000..3f6f555bcc
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -0,0 +1,152 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
+
+#include <queue>
+
+#include "policy/policy_types.h"
+#include "utils/custom_string.h"
+
+namespace policy {
+
+namespace custom_str = utils::custom_string;
+
+class PolicyListener {
+ public:
+ virtual ~PolicyListener() {}
+ virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions,
+ const policy::HMILevel& default_hmi) = 0;
+ virtual void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions) = 0;
+ virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
+ virtual void OnUpdateStatusChanged(const std::string&) = 0;
+ virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const std::string& policy_app_id) = 0;
+ virtual void OnSystemInfoUpdateRequired() = 0;
+ virtual custom_str::CustomString GetAppName(
+ const std::string& policy_app_id) = 0;
+ virtual void OnUpdateHMIAppType(
+ std::map<std::string, StringArray> app_hmi_types) = 0;
+
+ /**
+ * @brief CanUpdate allows to find active application
+ * and check whether related device consented.
+ *
+ * @return true if there are at least one application has been registered
+ * with consented device.
+ */
+ virtual bool CanUpdate() = 0;
+
+ /**
+ * @brief OnSnapshotCreated the notification which will be sent
+ * when snapshot for PTU has been created.
+ *
+ * @param pt_string the snapshot
+ *
+ * @param retry_seconds retry sequence timeouts.
+ *
+ * @param timeout_exceed timeout.
+ */
+ virtual void OnSnapshotCreated(const BinaryMessage& pt_string) = 0;
+
+ /**
+ * @brief Make appropriate changes for related applications permissions and
+ * notify them, if it possible
+ * @param device_id Unique device id, which consent had been changed
+ * @param device_consent Device consent, which is done by user
+ */
+ virtual void OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed) = 0;
+
+ /**
+ * @brief Sends OnAppPermissionsChanged notification to HMI
+ * @param permissions contains parameter for OnAppPermisionChanged
+ * @param policy_app_id contains policy application id
+ */
+ virtual void SendOnAppPermissionsChanged(
+ const AppPermissions& permissions,
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief GetAvailableApps allows to obtain list of registered applications.
+ */
+ virtual void GetAvailableApps(std::queue<std::string>&) = 0;
+
+ /**
+ * @brief OnCertificateUpdated the callback which signals if certificate field
+ * has been updated during PTU
+ *
+ * @param certificate_data the value of the updated field.
+ */
+ virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
+
+ /**
+ * Gets devices ids by policy application id
+ * @param policy_app_id
+ * @return list devices ids
+ */
+ virtual std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * Notifies about changing HMI status
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index cd5879ef73..ee0bae7118 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -30,31 +30,39 @@
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_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
#include <vector>
#include <cstdint>
#include "utils/callable.h"
#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
#include "policy/policy_listener.h"
#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/cache_manager_interface.h"
+#include "policy/access_remote.h"
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
virtual ~PolicyManager() {}
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
virtual void set_listener(PolicyListener* listener) = 0;
/**
- * Inits Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
*/
virtual bool InitPT(const std::string& file_name,
const PolicySettings* settings) = 0;
@@ -65,13 +73,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* 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
+ * @return true if successfully
*/
virtual bool LoadPT(const std::string& file,
const BinaryMessage& pt_content) = 0;
/**
- * Resets Policy Table
+ * @brief Resets Policy Table
* @param file_name Path to preloaded PT file
* @return true if successfully
*/
@@ -79,7 +87,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- *
* @return url which point to the resourse where lock screen icon could be
*obtained.
*/
@@ -88,7 +95,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets all URLs for sending PTS to from PT itself.
* @param service_type Service specifies user of URL
- * @return vector of urls
+ * @param out_end_points output vector of urls
*/
virtual void GetUpdateUrls(const std::string& service_type,
EndpointUrls& out_end_points) = 0;
@@ -104,19 +111,32 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Check if specified RPC for specified application
* has permission to be executed in specified HMI Level
* and also its permitted params.
+ * @param device_id Id of device of application
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
- * @param CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
*/
- virtual void CheckPermissions(const PTString& app_id,
+ virtual void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
const PTString& hmi_level,
const PTString& rpc,
const RPCParams& rpc_params,
CheckPermissionResult& result) = 0;
/**
+ * @brief Changes isConsentNeeded for app pending permissions, in case
+ * user set permissions before app activation.
+ * @param Unique app id
+ * @param Current permissions for app
+ */
+ virtual void CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions) = 0;
+
+ /**
* @brief Clear all record of user consents. Used during Factory Reset.
* @return bool Success of operation
*/
@@ -129,36 +149,38 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual std::string GetPolicyTableStatus() const = 0;
/**
- * Checks is PT exceeded kilometers
+ * @brief 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
+ * @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
/**
* @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchange() = 0;
/**
- * @brief ExchangeByUserRequest
+ * @brief Exchange by user request
+ * @return Current status of policy table
*/
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.
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
* @return timeout in seconds
*/
virtual uint32_t NextRetryTimeout() = 0;
/**
- * Gets timeout to wait until receive response
+ * @brief Gets timeout to wait until receive response
* @return timeout in seconds
*/
virtual uint32_t TimeoutExchangeMSec() = 0;
@@ -171,7 +193,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
/**
- * Handler of exceeding timeout of exchanging policy table
+ * @brief Handler of exceeding timeout of exchanging policy table
*/
virtual void OnExceededTimeout() = 0;
@@ -181,7 +203,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnUpdateStarted() = 0;
/**
- * @brief Check user consent for mobile device data connection
+ * @brief Gets user consent for mobile device data connection
* @param device_id Unique device identifier
* @return status of device consent
*/
@@ -189,7 +211,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& device_id) const = 0;
/**
- * @brief Get user consent for application
+ * @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
@@ -210,20 +232,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
*/
virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
bool is_device_allowed) = 0;
+
/**
- * Sets counter value that passed for receiving PT UPdate.
+ * @brief Sets counter value that passed for receiving PT UPdate.
*/
virtual void PTUpdatedAt(Counters counter, int value) = 0;
/**
* @brief Retrieves data from app_policies about app on its registration:
- * @param app_id - id of registered app
- * @param app_types Section on HMI where app can appear (Navigation, Phone
- * etc)
+ * @param application_id - id of registered app
* @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
*/
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -285,7 +311,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& language) = 0;
/**
- * Checks if the application is revoked
+ * @brief Checks if the application is revoked
* @param app_id application id
* @return true if application is revoked
*/
@@ -312,11 +338,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppPermissions GetAppPermissionsChanges(
const std::string& policy_app_id) = 0;
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
/**
* @brief Return device id, which hosts specific application
- * @param Application id, which is required to update device id
+ * @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
const std::string& policy_app_id) const = 0;
@@ -339,13 +369,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
- * @param application_id
+ * @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
const std::string& application_id) = 0;
/**
- * Marks device as upaired
+ * @brief Marks device as upaired
* @param device_id id device
*/
virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
@@ -353,25 +383,31 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @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
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
- virtual StatusNotifier AddApplication(const std::string& application_id) = 0;
+ 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.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
*/
virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
/**
* @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
*/
virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
@@ -383,9 +419,9 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnSystemReady() = 0;
/**
- * @brief GetNotificationNumber
- * @param priority
- * @return
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
*/
virtual uint32_t GetNotificationsNumber(
const std::string& priority) const = 0;
@@ -404,7 +440,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
/**
- * Returns heart beat timeout
+ * @brief Returns heart beat timeout
* @param app_id application id
* @return if timeout was set then value in milliseconds greater zero
* otherwise heart beat for specific application isn't set
@@ -412,7 +448,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
/**
- * @brief SaveUpdateStatusRequired alows to save update status.
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
*/
virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
@@ -423,38 +460,77 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
+
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
*/
- virtual void OnAppsSearchCompleted() = 0;
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
/**
* @brief Gets request types for application
* @param policy_app_id Unique application id
- * @return request_types Request types of application
+ * @return request types of application
*/
virtual const std::vector<std::string> GetAppRequestTypes(
const std::string policy_app_id) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ virtual const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Get information about vehicle
+ * @return vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
- * @brief OnAppRegisteredOnMobile alows to handle event when application were
+ * @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.
- *
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
* @param application_id registered application.
*/
virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
/**
* @brief RetrieveCertificate Allows to obtain certificate in order
* to start secure connection.
- *
* @return The certificate in PKCS#7 format.
*/
virtual std::string RetrieveCertificate() const = 0;
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ virtual bool HasCertificate() const = 0;
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
virtual const PolicySettings& get_settings() const = 0;
/**
@@ -466,6 +542,56 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
/**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ virtual bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) = 0;
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ std::shared_ptr<AccessRemote> access_remote) = 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
@@ -479,13 +605,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
protected:
/**
- * Checks is PT exceeded IgnitionCycles
+ * @brief Checks is PT exceeded IgnitionCycles
* @return true if exceeded
*/
virtual bool ExceededIgnitionCycles() = 0;
/**
- * Checks is PT exceeded days
+ * @brief Checks is PT exceeded days
* @return true if exceeded
*/
virtual bool ExceededDays() = 0;
@@ -503,4 +629,4 @@ class PolicyManager : public usage_statistics::StatisticsManager {
extern "C" policy::PolicyManager* CreateManager();
extern "C" void DeleteManager(policy::PolicyManager*);
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_settings.h b/src/components/include/policy/policy_regular/policy/policy_settings.h
index def9fca05a..35a2d54c3a 100644
--- a/src/components/include/policy/policy_regular/policy/policy_settings.h
+++ b/src/components/include/policy/policy_regular/policy/policy_settings.h
@@ -36,6 +36,8 @@ class PolicySettings {
*/
virtual const std::string& system_files_path() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
virtual ~PolicySettings() {}
};
} // namespace policy
diff --git a/src/components/include/policy/policy_regular/policy/policy_types.h b/src/components/include/policy/policy_regular/policy/policy_types.h
deleted file mode 100644
index dbd910d62d..0000000000
--- a/src/components/include/policy/policy_regular/policy/policy_types.h
+++ /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.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_TYPES_H_
-#define SRC_COMPONENTS_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::set<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;
- RPCParams list_of_allowed_params;
- RPCParams list_of_disallowed_params;
- RPCParams 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;
-};
-
-/**
- * @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;
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_TYPES_H_
diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
new file mode 100644
index 0000000000..0bcd585737
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+
+#include "policy/usage_statistics/statistics_manager.h"
+
+namespace usage_statistics {
+
+class AppStopwatch {
+ public:
+ virtual ~AppStopwatch() {}
+ virtual void Start(AppStopwatchId stopwatch_type) = 0;
+ virtual void Switch(AppStopwatchId stopwatch_type) = 0;
+ virtual void WriteTime() = 0;
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
index a74bb0592e..23df30510b 100644
--- 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
@@ -30,19 +30,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
#include <stdint.h>
#include <string>
namespace usage_statistics {
-enum GlobalCounterId { IAP_BUFFER_FULL, SYNC_OUT_OF_MEMORY, SYNC_REBOOTS };
+enum GlobalCounterId {
+ GLOBAL_COUNTER_NONE,
+ IAP_BUFFER_FULL,
+ SYNC_OUT_OF_MEMORY,
+ SYNC_REBOOTS
+};
-enum AppInfoId { LANGUAGE_GUI, LANGUAGE_VUI };
+enum AppInfoId { APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI };
enum AppStopwatchId {
+ STOPWATCH_NONE,
SECONDS_HMI_FULL,
SECONDS_HMI_LIMITED,
SECONDS_HMI_BACKGROUND,
@@ -50,6 +56,7 @@ enum AppStopwatchId {
};
enum AppCounterId {
+ APP_COUNTER_NONE,
USER_SELECTIONS,
REJECTIONS_SYNC_OUT_OF_MEMORY,
REJECTIONS_NICKNAME_MISMATCH,
@@ -64,11 +71,36 @@ enum AppCounterId {
class StatisticsManager {
public:
virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
virtual void Set(const std::string& app_id,
AppInfoId type,
const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
virtual void Add(const std::string& app_id,
AppStopwatchId type,
int32_t timespan_seconds) = 0;
@@ -76,4 +108,4 @@ class StatisticsManager {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h
new file mode 100644
index 0000000000..56bd5cebd6
--- /dev/null
+++ b/src/components/include/protocol/bson_object_keys.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+namespace protocol_handler {
+
+namespace strings {
+
+extern const char* hash_id;
+extern const char* protocol_version;
+extern const char* mtu;
+extern const char* rejected_params;
+extern const char* height;
+extern const char* width;
+extern const char* video_protocol;
+extern const char* video_codec;
+extern const char* secondary_transports;
+extern const char* audio_service_transports;
+extern const char* video_service_transports;
+extern const char* tcp_ip_address;
+extern const char* tcp_port;
+extern const char* reason;
+
+} // namespace strings
+
+} // namespace protocol_handler
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index ce4c4adf6f..1c95020a96 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -56,8 +56,9 @@ const uint8_t PROTOCOL_HEADER_V2_SIZE = 12;
*\brief Protocol versions constants
* First 4-bit field of AppLink protocol packet
*/
-enum {
-
+enum MajorProtocolVersion {
+ PROTOCOL_VERSION_UNKNOWN = -1,
+ PROTOCOL_VERSION_HMI = 0x00,
/**
*\brief Constant: number of protocol version (1).
*/
@@ -85,6 +86,12 @@ enum {
*/
PROTOCOL_VERSION_4 = 0x04,
/**
+ *@brief Constant: number of protocol version (5).
+ * Supports constructed payloads for protocol packets
+ * SDL4.4 feature.
+ */
+ PROTOCOL_VERSION_5 = 0x05,
+ /**
*\brief Maximum value of packet version field (size 4-bit) specified AppLink
*Protocol v.7
*/
@@ -160,6 +167,22 @@ enum {
*/
FRAME_DATA_END_SERVICE_NACK = 0x06,
/**
+ *\brief Register Secondary Transport frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT = 0x07,
+ /**
+ *\brief Register Secondary Transport acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK = 0x08,
+ /**
+ *\brief Register Secondary Transport not acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK = 0x09,
+ /**
+ *\brief Transport Event Update frame
+ */
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE = 0xFD,
+ /**
*\brief Service data ACK frame
*/
FRAME_DATA_SERVICE_DATA_ACK = 0xFE,
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
index 99cb73ce67..5171d42593 100644
--- a/src/components/include/protocol/raw_message.h
+++ b/src/components/include/protocol/raw_message.h
@@ -33,7 +33,7 @@
#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include <memory>
#include "protocol/service_type.h"
#include "protocol/message_priority.h"
@@ -114,6 +114,6 @@ class RawMessage {
bool waiting_;
DISALLOW_COPY_AND_ASSIGN(RawMessage);
};
-typedef utils::SharedPtr<RawMessage> RawMessagePtr;
+typedef std::shared_ptr<RawMessage> RawMessagePtr;
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index 183db21532..d65902030b 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -43,6 +43,8 @@ namespace protocol_handler {
class ProtocolObserver;
class SessionObserver;
+struct SessionContext;
+
/**
* \class ProtocolHandler
* \brief Interface for component parsing protocol header
@@ -98,9 +100,23 @@ class ProtocolHandler {
*/
virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
- virtual void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ virtual void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) = 0;
+
+ /**
+ * \brief Called to notify all handsheke handlers about handshake failure.
+ */
+ virtual void NotifyOnFailedHandshake() = 0;
+
/**
* \brief Protocol handler settings getter
* \return pointer to protocol handler settings class
@@ -108,6 +124,18 @@ class ProtocolHandler {
virtual const ProtocolHandlerSettings& get_settings() const = 0;
virtual SessionObserver& get_session_observer() = 0;
+ /**
+ * @brief Called by connection handler to notify the context of
+ * OnSessionStartedCallback().
+ * @param context reference to structure with started session data
+ * @param rejected_params list of parameters name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ virtual void NotifySessionStarted(
+ const SessionContext& context,
+ std::vector<std::string>& rejected_params) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h
index 987b0ac449..62a24df32c 100644
--- a/src/components/include/protocol_handler/protocol_handler_settings.h
+++ b/src/components/include/protocol_handler/protocol_handler_settings.h
@@ -15,6 +15,10 @@ class ProtocolHandlerSettings {
virtual ~ProtocolHandlerSettings() {}
virtual size_t maximum_payload_size() const = 0;
+ virtual size_t maximum_control_payload_size() const = 0;
+ virtual size_t maximum_rpc_payload_size() const = 0;
+ virtual size_t maximum_audio_payload_size() const = 0;
+ virtual size_t maximum_video_payload_size() const = 0;
virtual size_t message_frequency_count() const = 0;
virtual size_t message_frequency_time() const = 0;
virtual bool malformed_message_filtering() const = 0;
@@ -25,11 +29,10 @@ class ProtocolHandlerSettings {
*/
virtual uint32_t heart_beat_timeout() const = 0;
- virtual uint16_t max_supported_protocol_version() const = 0;
/*
* @brief Protocol version, from .ini file.
*/
- virtual bool enable_protocol_4() const = 0;
+ virtual uint16_t max_supported_protocol_version() const = 0;
virtual uint32_t multiframe_waiting_timeout() const = 0;
#ifdef ENABLE_SECURITY
@@ -42,6 +45,28 @@ class ProtocolHandlerSettings {
*/
virtual const std::vector<int>& force_unprotected_service() const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ virtual const bool multiple_transports_enabled() const = 0;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ virtual const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_usb()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_wifi()
+ const = 0;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ virtual const std::vector<std::string>& audio_service_transports() const = 0;
+ virtual const std::vector<std::string>& video_service_transports() const = 0;
};
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_SETTINGS_H_
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index 5e630c6c74..e71557fecf 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -36,13 +36,17 @@
#include <list>
#include <string>
#include "transport_manager/transport_manager.h"
+#include "utils/macro.h"
#ifdef ENABLE_SECURITY
#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
- /**
- *\namespace protocol_handlerHandler
- *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
- */
+
+struct BsonObject;
+
+/**
+ *\namespace protocol_handler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
namespace protocol_handler {
/**
* \brief HASH_ID constants.
@@ -52,6 +56,63 @@ namespace protocol_handler {
enum { HASH_ID_NOT_SUPPORTED = 0, HASH_ID_WRONG = 0xFFFF0000 };
/**
+ * @brief Struct with data containing attributes of starting session
+ **/
+struct SessionContext {
+ transport_manager::ConnectionUID primary_connection_id_;
+ transport_manager::ConnectionUID connection_id_;
+ uint8_t initial_session_id_;
+ uint8_t new_session_id_;
+ protocol_handler::ServiceType service_type_;
+ uint32_t hash_id_;
+ bool is_protected_;
+ bool is_new_service_;
+
+ /**
+ * @brief Constructor
+ */
+ SessionContext()
+ : primary_connection_id_(0)
+ , connection_id_(0)
+ , initial_session_id_(0)
+ , new_session_id_(0)
+ , service_type_(protocol_handler::kInvalidServiceType)
+ , hash_id_(0)
+ , is_protected_(false)
+ , is_new_service_(false) {}
+
+ /**
+ * @brief Constructor
+ * @param primary_connection_id Connection identifier of the primary
+ * connection in which the session is started
+ * @param connection_id_ Connection identifier within which session is
+ * started.
+ * @param session_id Session ID specified to OnSessionStartedCallback()
+ * @param new_session_id Session ID generated
+ * @param service_type Type of service
+ * @param hash_id Hash ID generated from connection_handle and
+ * new_session_id
+ * @param is_protected Whether service will be protected
+ * @param is_new_service Whether service was already established
+ **/
+ SessionContext(transport_manager::ConnectionUID primary_connection_id,
+ transport_manager::ConnectionUID connection_id,
+ uint8_t session_id,
+ uint8_t new_session_id,
+ protocol_handler::ServiceType service_type,
+ uint32_t hash_id,
+ const bool is_protected)
+ : primary_connection_id_(primary_connection_id)
+ , connection_id_(connection_id)
+ , initial_session_id_(session_id)
+ , new_session_id_(new_session_id)
+ , service_type_(service_type)
+ , hash_id_(hash_id)
+ , is_protected_(is_protected)
+ , is_new_service_(false) {}
+};
+
+/**
* \class SessionObserver
* \brief Interface for making a bridge between ProtocolHandler and
* ConnectionHandler components.
@@ -64,21 +125,21 @@ class SessionObserver {
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
+ * Result must be notified through NotifySessionStartedContext().
* \param connection_handle Connection identifier within which session
* has to be started.
* \param sessionId Identifier of the session to be start
* \param service_type Type of service
* \param protocol_version Version of protocol
* \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier, uint32_t* hash_id
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
+ * \param params configuration parameters specified by mobile
*/
- virtual uint32_t OnSessionStartedCallback(
+ virtual void OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
const protocol_handler::ServiceType& service_type,
const bool is_protected,
- uint32_t* hash_id) = 0;
+ const BsonObject* params) = 0;
/**
* \brief Callback function used by ProtocolHandler
@@ -86,7 +147,7 @@ class SessionObserver {
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
* \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
+ * protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
* If not equal to hash assigned to session on start then operation fails.
* \param service_type Type of service
* \return uint32_t 0 if operation fails, session key otherwise
@@ -94,7 +155,7 @@ class SessionObserver {
virtual uint32_t OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
- const uint32_t& hashCode,
+ uint32_t* hashCode,
const protocol_handler::ServiceType& service_type) = 0;
/**
@@ -112,6 +173,24 @@ class SessionObserver {
virtual void OnMalformedMessageCallback(const uint32_t& connection_key) = 0;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const = 0;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromDeviceHandle(
+ transport_manager::DeviceHandle device_handle) const = 0;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -142,10 +221,11 @@ class SessionObserver {
* \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;
+ virtual int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ transport_manager::DeviceHandle* device_id) const = 0;
/**
* \brief information about device
@@ -186,6 +266,16 @@ class SessionObserver {
uint8_t session_id,
uint8_t& protocol_version) const = 0;
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param connection_key unique id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ virtual bool SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const = 0;
+
#ifdef ENABLE_SECURITY
/**
* \brief Sets crypto context of connection
diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h
index a76fbce717..b2bf94de35 100644
--- a/src/components/include/protocol_handler/telemetry_observer.h
+++ b/src/components/include/protocol_handler/telemetry_observer.h
@@ -45,12 +45,12 @@ class PHTelemetryObserver {
RawMessagePtr raw_msg;
uint32_t message_id;
uint8_t connection_key;
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
};
- virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time) = 0;
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
+ virtual void StartMessageProcess(
+ uint32_t message_id, const date_time::TimeDuration& start_time) = 0;
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m) = 0;
virtual ~PHTelemetryObserver() {}
};
} // protocol_handler
diff --git a/src/components/include/rpc_base/validation_report.h b/src/components/include/rpc_base/validation_report.h
new file mode 100644
index 0000000000..82f265e594
--- /dev/null
+++ b/src/components/include/rpc_base/validation_report.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
+
+#include <string>
+#include <list>
+
+namespace rpc {
+
+class ValidationReport;
+typedef std::list<ValidationReport> ValidationReports;
+
+class ValidationReport {
+ public:
+ explicit ValidationReport(const std::string& object_name);
+ const std::string& object_name() const;
+ const std::string& validation_info() const;
+ void set_validation_info(const std::string& info);
+ const ValidationReports& subobject_reports() const;
+ ValidationReport& ReportSubobject(const std::string& object_name);
+
+ private:
+ std::string object_name_;
+ std::string validation_info_;
+ ValidationReports subobject_reports_;
+};
+
+std::string PrettyFormat(const ValidationReport& report);
+
+// Implementation
+
+namespace impl {
+inline void PrettyFormat(const ValidationReport& report,
+ const std::string& parent_path,
+ std::string* result) {
+ std::string object_path = parent_path;
+ if (!object_path.empty() && report.object_name()[0] != '[') {
+ object_path.append(".");
+ }
+ const ValidationReports& subreports = report.subobject_reports();
+ object_path.append(report.object_name());
+ if (!report.validation_info().empty()) {
+ // Insert newline between entries
+ if (!result->empty()) {
+ result->append("\n");
+ }
+ result->append(object_path);
+ result->append(": ");
+ result->append(report.validation_info());
+ }
+ for (ValidationReports::const_iterator i = subreports.begin(),
+ end = subreports.end();
+ i != end;
+ ++i) {
+ PrettyFormat(*i, object_path, result);
+ }
+}
+} // namespace impl
+
+inline ValidationReport::ValidationReport(const std::string& object_name)
+ : object_name_(object_name) {}
+
+inline const std::string& ValidationReport::object_name() const {
+ return object_name_;
+}
+
+inline const std::string& ValidationReport::validation_info() const {
+ return validation_info_;
+}
+
+inline void ValidationReport::set_validation_info(const std::string& info) {
+ validation_info_ = info;
+}
+
+inline const std::list<ValidationReport>& ValidationReport::subobject_reports()
+ const {
+ return subobject_reports_;
+}
+
+inline ValidationReport& ValidationReport::ReportSubobject(
+ const std::string& object_name) {
+ subobject_reports_.push_back(ValidationReport(object_name));
+ return subobject_reports_.back();
+}
+
+inline std::string PrettyFormat(const ValidationReport& report) {
+ std::string result;
+ impl::PrettyFormat(report, "", &result);
+ return result;
+}
+
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
index 18c06ffe06..486b6da64f 100644
--- a/src/components/include/security_manager/crypto_manager.h
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#include <time.h>
#include "application_manager/policies/policy_handler_observer.h"
#include "security_manager/security_manager_settings.h"
@@ -65,8 +66,16 @@ class CryptoManager : public policy::PolicyHandlerObserver {
virtual bool OnCertificateUpdated(const std::string& data) = 0;
virtual void ReleaseSSLContext(SSLContext* context) = 0;
virtual std::string LastError() const = 0;
-
- virtual bool IsCertificateUpdateRequired() const = 0;
+ /**
+ * @brief IsCertificateUpdateRequired checks if certificate update is needed
+ * @param system_time - time with which certificate expiration time
+ * should be compared
+ * @param certificates_time - certificate expiration time
+ * @return True if certificate expired and need to be updated
+ * otherwise False
+ */
+ virtual bool IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const = 0;
/**
* \brief Crypto manager settings getter
* \return pointer to crypto manager settings class
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
index 8ed0ff2912..61ba43c74f 100644
--- a/src/components/include/security_manager/security_manager.h
+++ b/src/components/include/security_manager/security_manager.h
@@ -41,6 +41,7 @@
#include "protocol_handler/session_observer.h"
#include "security_manager/security_manager_listener.h"
+#include "application_manager/policies/policy_handler_observer.h"
namespace security_manager {
@@ -50,7 +51,8 @@ class CryptoManager;
* protocol_handler::ProtocolObserver
* and provide interface for handling Security queries from mobile side
*/
-class SecurityManager : public protocol_handler::ProtocolObserver {
+class SecurityManager : public protocol_handler::ProtocolObserver,
+ public policy::PolicyHandlerObserver {
public:
/**
* \brief InternalErrors is 1 byte identifier of internal error
@@ -70,6 +72,10 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
ERROR_INTERNAL = 0xFF,
ERROR_UNKNOWN_INTERNAL_ERROR = 0xFE // error value for testing
};
+
+ // SSL context creation strategy
+ enum ContextCreationStrategy { kUseExisting = 0, kForceRecreation };
+
/**
* \brief Sets pointer for Connection Handler layer for managing sessions
* \param session_observer pointer to object of the class implementing
@@ -114,13 +120,15 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
}
/**
- * \brief Create new SSLContext for connection or return exists
+ * @brief Create new SSLContext for connection or return exists
* Do not notify listeners, send security error on occure
- * \param connection_key Unique key used by other components as session
+ * @param connection_key Unique key used by other components as session
* identifier
+ * @param cc_strategy - SSL context creation strategy
* @return new \c SSLContext or \c NULL on any error
*/
- virtual SSLContext* CreateSSLContext(const uint32_t& connection_key) = 0;
+ virtual SSLContext* CreateSSLContext(const uint32_t& connection_key,
+ ContextCreationStrategy cc_strategy) = 0;
/**
* \brief Start handshake as SSL client
@@ -128,10 +136,61 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
virtual void StartHandshake(uint32_t connection_key) = 0;
/**
+ * @brief PostponeHandshake allows to postpone handshake. It notifies
+ * cryptomanager that certificate should be updated and adds specified
+ * connection key to the list of the certificate awaiting connections.
+ * @param connection_key the identifier for connection to postpone handshake.
+ */
+ virtual void PostponeHandshake(const uint32_t connection_key) = 0;
+
+ /**
+ * @brief Check whether certificate should be updated
+ * @param connection_key the connection identifier to check certificate for.
+ * @return true if certificate should be updated otherwise false
+ */
+ virtual bool IsCertificateUpdateRequired(const uint32_t connection_key) = 0;
+
+ /**
+ * @brief Checks whether system time ready notification
+ * was received from hmi
+ * @return true if received otherwise false
+ */
+ virtual bool IsSystemTimeProviderReady() const = 0;
+
+ /**
+ * @brief Notify all listeners that certificate update required
+ * Allows to notify that certificate should be updated
+ */
+ virtual void NotifyOnCertificateUpdateRequired() = 0;
+
+ /**
+ * @brief Notify all listeners that handshake was failed
+ */
+ virtual void NotifyListenersOnHandshakeFailed() = 0;
+
+ /**
+ * @brief Check if policy certificate data is empty
+ * @return true if policy certificate data is empty otherwise false
+ */
+ virtual bool IsPolicyCertificateDataEmpty() = 0;
+
+ /**
* \brief Add/Remove for SecurityManagerListener
*/
virtual void AddListener(SecurityManagerListener* const listener) = 0;
virtual void RemoveListener(SecurityManagerListener* const listener) = 0;
+
+ /**
+ * @brief OnCertificateUpdated allows to obtain notification when certificate
+ * has been updated with policy table update. Pass this certificate to crypto
+ * manager for further processing. Also process postopnes handshake for the
+ * certain connection key.
+ *
+ * @param data the certificates content.
+ *
+ * @return always true.
+ */
+ virtual bool OnCertificateUpdated(const std::string& data) = 0;
};
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_H_
diff --git a/src/components/include/security_manager/security_manager_listener.h b/src/components/include/security_manager/security_manager_listener.h
index 577c7c4378..00a4c68134 100644
--- a/src/components/include/security_manager/security_manager_listener.h
+++ b/src/components/include/security_manager/security_manager_listener.h
@@ -31,6 +31,9 @@
*/
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
+
+#include <string>
+
namespace security_manager {
class SecurityManagerListener {
@@ -44,10 +47,25 @@ class SecurityManagerListener {
*/
virtual bool OnHandshakeDone(uint32_t connection_key,
SSLContext::HandshakeResult result) = 0;
+
+ /**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ virtual bool OnHandshakeFailed() = 0;
+
/**
* @brief Notify listeners that certificate update is required.
*/
virtual void OnCertificateUpdateRequired() = 0;
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ virtual bool GetPolicyCertificateData(std::string& data) const = 0;
+
virtual ~SecurityManagerListener() {}
};
} // namespace security_manager
diff --git a/src/components/include/security_manager/security_manager_settings.h b/src/components/include/security_manager/security_manager_settings.h
index c6b97f85cc..0bbe0f4f96 100644
--- a/src/components/include/security_manager/security_manager_settings.h
+++ b/src/components/include/security_manager/security_manager_settings.h
@@ -33,12 +33,16 @@
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
+#include <stddef.h>
+#include <string>
+#include <vector>
+
namespace security_manager {
enum Mode { CLIENT, SERVER };
-enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2 };
+enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2, DTLSv1 };
/**
- * \class ConnectionHandlerSettings
- * \brief Interface for connection handler component settings.
+ * \class CryptoManagerSettings
+ * \brief Interface for crypto manager component settings.
*/
class CryptoManagerSettings {
public:
@@ -50,8 +54,12 @@ class CryptoManagerSettings {
virtual const std::string& certificate_data() const = 0;
virtual const std::string& ciphers_list() const = 0;
virtual const std::string& ca_cert_path() const = 0;
+ virtual const std::string& module_cert_path() const = 0;
+ virtual const std::string& module_key_path() const = 0;
virtual size_t update_before_hours() const = 0;
virtual size_t maximum_payload_size() const = 0;
+ virtual const std::vector<int>& force_protected_service() const = 0;
+ virtual const std::vector<int>& force_unprotected_service() const = 0;
};
} // namespace security_manager
diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h
index cdad1c746c..8aa5b60853 100644
--- a/src/components/include/security_manager/security_query.h
+++ b/src/components/include/security_manager/security_query.h
@@ -37,7 +37,7 @@
#include <cstddef>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace security_manager {
/**
@@ -189,6 +189,6 @@ class SecurityQuery {
/**
*\brief SmartPointer wrapper
*/
-typedef utils::SharedPtr<SecurityQuery> SecurityQueryPtr;
+typedef std::shared_ptr<SecurityQuery> SecurityQueryPtr;
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h
index 86997edbd9..7d52c72abe 100644
--- a/src/components/include/security_manager/ssl_context.h
+++ b/src/components/include/security_manager/ssl_context.h
@@ -77,14 +77,16 @@ class SSLContext {
};
struct HandshakeContext {
- HandshakeContext() : expected_sn(""), expected_cn("") {}
+ HandshakeContext()
+ : expected_sn(""), expected_cn(""), system_time(time(NULL)) {}
HandshakeContext(const custom_str::CustomString& exp_sn,
const custom_str::CustomString& exp_cn)
- : expected_sn(exp_sn), expected_cn(exp_cn) {}
+ : expected_sn(exp_sn), expected_cn(exp_cn), system_time(time(NULL)) {}
custom_str::CustomString expected_sn;
custom_str::CustomString expected_cn;
+ time_t system_time;
};
virtual HandshakeResult StartHandshake(const uint8_t** const out_data,
@@ -103,6 +105,14 @@ class SSLContext {
size_t* out_data_size) = 0;
virtual bool IsInitCompleted() const = 0;
virtual bool IsHandshakePending() const = 0;
+ /**
+ * @brief GetCertificateDueDate gets certificate expiration date
+ * @param due_date - certificate expiration time to be received
+ * @return True if certificate expiration date received
+ * otherwise False
+ */
+ virtual bool GetCertificateDueDate(time_t& due_date) const = 0;
+ virtual bool HasCertificate() const = 0;
virtual size_t get_max_block_size(size_t mtu) const = 0;
virtual std::string LastError() const = 0;
diff --git a/src/components/include/test/application_manager/mock_app_extension.h b/src/components/include/test/application_manager/mock_app_extension.h
new file mode 100644
index 0000000000..5898bc9b72
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_app_extension.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/app_extension.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace {
+static unsigned MockAppExtensionUID = 123;
+} // namespace
+
+class MockAppExtension : public application_manager::AppExtension {
+ public:
+ MockAppExtension() : AppExtension(MockAppExtensionUID) {}
+ MOCK_METHOD1(SaveResumptionData,
+ void(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data));
+ MOCK_METHOD1(ProcessResumption,
+ void(const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_EXTENSION_H_
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index 9d51f60c4d..7f5f17a93d 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -35,6 +35,7 @@
#include <string>
#include <vector>
+#include <memory>
#include "gmock/gmock.h"
@@ -43,18 +44,21 @@
#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 "application_manager/message.h"
#include "resumption/last_state.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/app_launch/app_launch_ctrl.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/state_controller.h"
#include "smart_objects/smart_object.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+#include "application_manager/command_factory.h"
namespace test {
namespace components {
namespace application_manager_test {
+using application_manager::plugin_manager::RPCPluginManager;
class MockApplicationManager : public application_manager::ApplicationManager {
public:
@@ -74,6 +78,19 @@ class MockApplicationManager : public application_manager::ApplicationManager {
application, application_manager::ApplicationSharedPtr(uint32_t app_id));
MOCK_CONST_METHOD0(active_application,
application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD2(application,
+ application_manager::ApplicationSharedPtr(
+ const std::string& device_id,
+ const std::string& policy_app_id));
+ MOCK_METHOD2(ChangeAppsHMILevel,
+ void(uint32_t app_id, mobile_apis::HMILevel::eType level));
+ MOCK_CONST_METHOD1(
+ devices, std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_METHOD0(GetPluginManager, RPCPluginManager&());
+
+ MOCK_METHOD1(SetPluginManager,
+ void(std::unique_ptr<RPCPluginManager>& plugin_manager));
+
MOCK_CONST_METHOD1(
application_by_hmi_app,
application_manager::ApplicationSharedPtr(uint32_t hmi_app_id));
@@ -85,12 +102,16 @@ class MockApplicationManager : public application_manager::ApplicationManager {
std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
MOCK_METHOD0(applications_with_navi,
std::vector<application_manager::ApplicationSharedPtr>());
+ MOCK_METHOD0(applications_with_mobile_projection,
+ std::vector<application_manager::ApplicationSharedPtr>());
MOCK_CONST_METHOD0(get_limited_media_application,
application_manager::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_navi_application,
application_manager::ApplicationSharedPtr());
MOCK_CONST_METHOD0(get_limited_voice_application,
application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_mobile_projection_application,
+ application_manager::ApplicationSharedPtr());
MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
MOCK_METHOD2(set_application_id,
void(const int32_t correlation_id, const uint32_t app_id));
@@ -100,19 +121,12 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::HMILevel::eType to));
MOCK_METHOD1(
SendHMIStatusNotification,
- void(const utils::SharedPtr<application_manager::Application> app));
- MOCK_METHOD2(SendMessageToMobile,
- void(application_manager::commands::MessageSharedPtr, bool));
- MOCK_METHOD1(
- SendMessageToHMI,
- void(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD1(
- ManageHMICommand,
- bool(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD2(
- ManageMobileCommand,
- bool(const application_manager::commands::MessageSharedPtr message,
- application_manager::commands::Command::CommandOrigin origin));
+ void(const std::shared_ptr<application_manager::Application> app));
+ MOCK_METHOD1(SendDriverDistractionState,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD2(RemoveHMIFakeParameters,
+ void(application_manager::commands::MessageSharedPtr& message,
+ const hmi_apis::FunctionID::eType& function_id));
MOCK_CONST_METHOD1(
GetDefaultHmiLevel,
mobile_apis::HMILevel::eType(
@@ -120,32 +134,44 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
MOCK_CONST_METHOD0(hmi_capabilities,
const application_manager::HMICapabilities&());
+ MOCK_CONST_METHOD1(
+ CheckResumptionRequiredTransportAvailable,
+ bool(application_manager::ApplicationConstSharedPtr application));
MOCK_METHOD2(ProcessQueryApp,
void(const smart_objects::SmartObject& sm_object,
const uint32_t connection_key));
MOCK_CONST_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD0(IsLowVoltage, bool());
MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
bool(application_manager::ApplicationConstSharedPtr app));
MOCK_METHOD1(OnApplicationRegistered,
void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD1(OnApplicationSwitched,
+ void(application_manager::ApplicationSharedPtr app));
MOCK_CONST_METHOD0(connection_handler,
connection_handler::ConnectionHandler&());
MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&());
MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&());
+ MOCK_CONST_METHOD0(GetPolicyHandler, const policy::PolicyHandlerInterface&());
+ MOCK_CONST_METHOD0(GetRPCService,
+ application_manager::rpc_service::RPCService&());
+ MOCK_CONST_METHOD0(GetRPCHandler,
+ application_manager::rpc_handler::RPCHandler&());
+ MOCK_CONST_METHOD0(is_stopping, bool());
+ MOCK_CONST_METHOD0(is_audio_pass_thru_active, bool());
MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
- MOCK_METHOD0(BeginAudioPassThrough, bool());
- MOCK_METHOD0(EndAudioPassThrough, bool());
+ MOCK_METHOD1(BeginAudioPassThru, bool(uint32_t app_id));
+ MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
MOCK_METHOD0(OnHMIStartedCooperation, void());
MOCK_CONST_METHOD0(IsHMICooperating, bool());
MOCK_METHOD2(IviInfoUpdated,
- std::vector<application_manager::ApplicationSharedPtr>(
- application_manager::VehicleDataType vehicle_info,
- int value));
+ void(mobile_apis::VehicleDataType::eType vehicle_info,
+ int value));
MOCK_METHOD1(RegisterApplication,
- application_manager::ApplicationSharedPtr(const utils::SharedPtr<
+ application_manager::ApplicationSharedPtr(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration));
MOCK_METHOD0(SendUpdateAppList, void());
MOCK_METHOD2(MarkAppsGreyOut,
@@ -161,9 +187,11 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data,
const std::string& file_path,
const std::string& file_name,
- const int64_t offset));
+ const uint64_t offset));
MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed));
- MOCK_METHOD1(set_driver_distraction, void(bool is_distracting));
+ MOCK_METHOD1(
+ set_driver_distraction_state,
+ void(const hmi_apis::Common_DriverDistractionState::eType state));
MOCK_METHOD6(StartAudioPassThruThread,
void(int32_t session_key,
int32_t correlation_id,
@@ -191,19 +219,21 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
bool(uint32_t app_id,
protocol_handler::ServiceType service_type));
- MOCK_METHOD5(CheckPolicyPermissions,
+ MOCK_METHOD4(CheckPolicyPermissions,
mobile_apis::Result::eType(
- const std::string&,
- mobile_apis::HMILevel::eType,
- mobile_apis::FunctionID::eType,
- const application_manager::RPCParams&,
- application_manager::CommandParametersPermissions*));
+ 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_CONST_METHOD0(SupportedSDLVersion,
+ protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(
GetDeviceTransportType,
hmi_apis::Common_TransportType::eType(const std::string& transport_type));
@@ -218,12 +248,14 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(uint32_t app_id,
protocol_handler::ServiceType service_type,
bool state));
- MOCK_CONST_METHOD4(CreateRegularState,
+ MOCK_CONST_METHOD5(CreateRegularState,
application_manager::HmiStatePtr(
- uint32_t app_id,
+ application_manager::ApplicationSharedPtr app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context));
+
MOCK_METHOD2(SendAudioPassThroughNotification,
void(uint32_t session_key, std::vector<uint8_t>& binary_data));
MOCK_CONST_METHOD2(CanAppStream,
@@ -232,20 +264,53 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
MOCK_CONST_METHOD0(get_settings,
const application_manager::ApplicationManagerSettings&());
+ MOCK_CONST_METHOD1(
+ GetCorrectMobileIDFromMessage,
+ std::string(
+ const application_manager::commands::MessageSharedPtr& message));
MOCK_METHOD0(event_dispatcher,
application_manager::event_engine::EventDispatcher&());
- MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints, bool(const uint32_t));
- MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
- MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
+ MOCK_METHOD2(IsSOStructValid,
+ bool(const hmi_apis::StructIdentifiers::eType struct_id,
+ const smart_objects::SmartObject& display_capabilities));
+ MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
+ bool(application_manager::ApplicationSharedPtr));
+ MOCK_METHOD1(SubscribeAppForWayPoints,
+ void(application_manager::ApplicationSharedPtr));
+ MOCK_METHOD1(UnsubscribeAppFromWayPoints,
+ void(application_manager::ApplicationSharedPtr));
MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool());
- MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>());
+ MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<uint32_t>());
MOCK_CONST_METHOD1(
WaitingApplicationByID,
application_manager::ApplicationConstSharedPtr(const uint32_t));
MOCK_CONST_METHOD0(
AppsWaitingForRegistration,
DataAccessor<application_manager::AppsWaitRegistrationSet>());
+
+ MOCK_METHOD1(ReplaceMobileWithHMIAppId,
+ void(smart_objects::SmartObject& message));
+ MOCK_METHOD1(ReplaceHMIWithMobileAppId,
+ void(smart_objects::SmartObject& message));
+ MOCK_METHOD1(GetAvailableSpaceForApp,
+ uint32_t(const std::string& folder_name));
+ MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void());
+ MOCK_METHOD0(OnLowVoltage, void());
+ MOCK_METHOD0(OnWakeUp, void());
+ MOCK_METHOD4(OnStreamingConfigured,
+ void(uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params));
+ MOCK_METHOD2(ProcessReconnection,
+ void(application_manager::ApplicationSharedPtr application,
+ const uint32_t connection_key));
+ MOCK_CONST_METHOD1(IsAppInReconnectMode,
+ bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&());
+ MOCK_CONST_METHOD0(get_current_audio_source, uint32_t());
+ MOCK_METHOD1(set_current_audio_source, void(const uint32_t));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index fd9e2aa8a3..cfabf41b91 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -55,8 +55,11 @@ class MockApplicationManagerSettings
// typedef for the return type.
MOCK_CONST_METHOD0(get_vehicle_data_frequency,
const std::pair<uint32_t, int32_t>&());
+ MOCK_CONST_METHOD0(get_interior_vehicle_data_frequency,
+ const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(hash_string_size, uint32_t());
MOCK_CONST_METHOD0(app_storage_folder, const std::string&());
+ MOCK_CONST_METHOD0(app_info_storage, const std::string&());
MOCK_CONST_METHOD0(app_dir_quota, const uint32_t&());
MOCK_CONST_METHOD0(stop_streaming_timeout, uint32_t());
MOCK_CONST_METHOD0(application_list_update_timeout, uint32_t());
@@ -86,6 +89,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(named_audio_pipe_path, const std::string&());
MOCK_CONST_METHOD0(video_stream_file, const std::string&());
MOCK_CONST_METHOD0(audio_stream_file, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
MOCK_CONST_METHOD0(use_db_for_resumption, bool());
MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout,
const uint32_t&());
@@ -94,6 +98,13 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&());
MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t());
MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t());
+ MOCK_CONST_METHOD0(transport_required_for_resumption_map,
+ std::map<std::string, std::vector<std::string> >&());
+ MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(media_lowbandwidth_resumption_level, const std::string&());
MOCK_METHOD1(set_config_file_name, void(const std::string& fileName));
// The following line won't really compile, as the return
// type has multiple template arguments. To fix it, use a
@@ -101,6 +112,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(start_stream_retry_amount,
const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(app_icons_folder, const std::string&());
+ MOCK_CONST_METHOD0(plugins_folder, const std::string&());
MOCK_CONST_METHOD0(app_icons_folder_max_size, const uint32_t&());
MOCK_CONST_METHOD0(app_icons_amount_to_remove, const uint32_t&());
MOCK_CONST_METHOD0(list_files_response_size, const uint32_t&());
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin.h b/src/components/include/test/application_manager/mock_rpc_plugin.h
new file mode 100644
index 0000000000..1f7dd8951b
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_plugin.h
@@ -0,0 +1,30 @@
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
+
+#include "gmock/gmock.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+
+namespace application_manager {
+class CommandFactory;
+namespace plugin_manager {
+
+class MockRPCPlugin : public RPCPlugin {
+ public:
+ MOCK_METHOD4(Init,
+ bool(ApplicationManager& app_manager,
+ rpc_service::RPCService& rpc_service,
+ HMICapabilities& hmi_capabilities,
+ policy::PolicyHandlerInterface& policy_handler));
+ MOCK_METHOD2(IsAbleToProcess,
+ bool(const int32_t function_id,
+ const commands::Command::CommandSource message_source));
+ MOCK_METHOD0(PluginName, std::string());
+ MOCK_METHOD0(GetCommandFactory, CommandFactory&());
+ MOCK_METHOD1(OnPolicyEvent, void(PolicyEvent event));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+};
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_MOCK_RPC_PLUGIN_H
diff --git a/src/components/include/test/application_manager/mock_rpc_plugin_manager.h b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
new file mode 100644
index 0000000000..74763f00d6
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_plugin_manager.h
@@ -0,0 +1,24 @@
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
+#include <string>
+
+#include "gmock/gmock.h"
+#include "application_manager/plugin_manager/rpc_plugin_manager.h"
+
+namespace application_manager {
+namespace plugin_manager {
+
+class MockRPCPluginManager : public RPCPluginManager {
+ public:
+ MOCK_METHOD1(LoadPlugins, uint32_t(const std::string& plugins_path));
+ MOCK_METHOD0(GetPlugins, std::vector<RPCPluginPtr>&());
+ MOCK_METHOD2(FindPluginToProcess,
+ utils::Optional<RPCPlugin>(
+ const int32_t function_id,
+ const commands::Command::CommandSource message_source));
+ MOCK_METHOD1(ForEachPlugin, void(std::function<void(RPCPlugin&)> functor));
+};
+
+} // namespace plugin_manager
+} // namespace application_manager
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_RPC_PLUGIN_MANAGER_H_
diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h
new file mode 100644
index 0000000000..4eddbbe257
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_rpc_service.h
@@ -0,0 +1,34 @@
+#ifndef MOCK_RPC_SERVICE_H
+#define MOCK_RPC_SERVICE_H
+
+#include "gmock/gmock.h"
+#include "application_manager/rpc_service.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockRPCService : public application_manager::rpc_service::RPCService {
+ public:
+ MOCK_METHOD1(
+ ManageHMICommand,
+ bool(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD2(
+ ManageMobileCommand,
+ bool(const application_manager::commands::MessageSharedPtr message,
+ application_manager::commands::Command::CommandSource origin));
+ MOCK_METHOD2(SendMessageToMobile,
+ void(application_manager::commands::MessageSharedPtr, bool));
+ MOCK_METHOD1(
+ SendMessageToHMI,
+ void(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD1(set_protocol_handler,
+ void(protocol_handler::ProtocolHandler* handler));
+ MOCK_METHOD1(set_hmi_message_handler,
+ void(hmi_message_handler::HMIMessageHandler* handler));
+};
+}
+}
+}
+
+#endif // MOCK_RPC_SERVICE_H
diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h
index 9f8d94599b..0165180a0a 100644
--- a/src/components/include/test/application_manager/mock_state_controller.h
+++ b/src/components/include/test/application_manager/mock_state_controller.h
@@ -51,27 +51,30 @@ class MockStateController : public am::StateController {
void(am::ApplicationSharedPtr app,
am::HmiStatePtr state,
const bool SendActivateApp));
- MOCK_METHOD4(SetRegularState,
+ MOCK_METHOD5(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const bool SendActivateApp));
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const bool SendActivateApp));
- MOCK_METHOD5(SetRegularState,
+ MOCK_METHOD6(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
const bool SendActivateApp));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level));
- MOCK_METHOD2(SetRegularState,
+ MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
- const mobile_apis::AudioStreamingState::eType audio_state));
+ const mobile_apis::AudioStreamingState::eType audio_state,
+ const mobile_apis::VideoStreamingState::eType video_state));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::SystemContext::eType system_context));
@@ -84,8 +87,10 @@ class MockStateController : public am::StateController {
int64_t(am::ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));
- MOCK_METHOD0(OnNaviStreamingStarted, void());
- MOCK_METHOD0(OnNaviStreamingStopped, void());
+ MOCK_METHOD1(OnVideoStreamingStarted,
+ void(am::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(OnVideoStreamingStopped,
+ void(am::ApplicationConstSharedPtr app));
MOCK_METHOD3(OnStateChanged,
void(am::ApplicationSharedPtr app,
am::HmiStatePtr old_state,
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index 389befae6f..cb47147074 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -34,6 +34,7 @@
#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"
@@ -76,11 +77,10 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
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));
@@ -104,15 +104,15 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
MOCK_METHOD0(ResetRetrySequence, void());
MOCK_METHOD0(NextRetryTimeout, uint32_t());
- MOCK_METHOD0(TimeoutExchangeSec, uint32_t());
- MOCK_METHOD0(TimeoutExchangeMSec, uint32_t());
+ MOCK_CONST_METHOD0(TimeoutExchangeSec, uint32_t());
+ MOCK_CONST_METHOD0(TimeoutExchangeMSec, uint32_t());
MOCK_METHOD0(OnExceededTimeout, void());
MOCK_METHOD0(OnSystemReady, void());
MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_CONST_METHOD0(GetStatisticManager,
- utils::SharedPtr<usage_statistics::StatisticsManager>());
+ std::shared_ptr<usage_statistics::StatisticsManager>());
MOCK_CONST_METHOD2(CheckSystemAction,
bool(mobile_apis::SystemAction::eType system_action,
const std::string& policy_app_id));
@@ -131,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,
@@ -164,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,
@@ -173,18 +182,33 @@ 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,
- policy::StatusNotifier(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,
bool(const std::string& policy_app_id,
mobile_apis::RequestType::eType type));
+ MOCK_CONST_METHOD2(IsRequestSubTypeAllowed,
+ bool(const std::string& policy_app_id,
+ const std::string& request_subtype));
+ MOCK_CONST_METHOD1(
+ GetAppRequestTypeState,
+ policy::RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypeState,
+ policy::RequestSubType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD1(
GetAppRequestTypes,
const std::vector<std::string>(const std::string& policy_app_id));
@@ -215,10 +239,47 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
void(const std::string& service_type,
policy::EndpointUrls& end_points));
+ MOCK_METHOD3(OnUpdateHMILevel,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_METHOD3(CheckHMIType,
+ bool(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types));
+
+ MOCK_METHOD2(CheckModule,
+ bool(const policy::PTString& app_id,
+ const policy::PTString& module));
+
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const smart_objects::SmartObject* app_types));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+
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
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
index cc0f73126b..e8ed0e90e2 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
@@ -49,6 +49,7 @@ class MockPolicyHandlerObserver : public ::policy::PolicyHandlerObserver {
MOCK_METHOD1(OnUpdateHMIAppType,
void(std::map<std::string, std::vector<std::string> >));
MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&));
+ MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
};
} // namespace application_manager_test
} // namespace components
diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h
index e17224b097..2de3a0f9a7 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -51,6 +51,7 @@ using connection_handler::ConnectionHandle;
using connection_handler::DeviceHandle;
using connection_handler::CloseSessionReason;
using connection_handler::DevicesDiscoveryStarter;
+using connection_handler::SessionTransports;
class MockConnectionHandler : public connection_handler::ConnectionHandler {
public:
@@ -88,7 +89,7 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
int32_t(uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
- uint32_t* device_id));
+ connection_handler::DeviceHandle* device_id));
MOCK_CONST_METHOD0(get_settings,
const connection_handler::ConnectionHandlerSettings&());
MOCK_METHOD0(get_session_observer,
@@ -96,6 +97,31 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&());
MOCK_CONST_METHOD1(GetConnectedDevicesMAC,
void(std::vector<std::string>& macs));
+ MOCK_METHOD1(
+ AddSession,
+ uint32_t(const transport_manager::ConnectionUID primary_transport_id));
+ MOCK_METHOD1(RemoveSession, bool(uint8_t session_id));
+ MOCK_METHOD0(session_connection_map,
+ DataAccessor<connection_handler::SessionConnectionMap>());
+ MOCK_METHOD2(SetSecondaryTransportID,
+ SessionTransports(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id));
+ MOCK_CONST_METHOD1(GetSessionTransports,
+ const SessionTransports(uint8_t session_id));
+ MOCK_METHOD3(NotifyServiceStartedResult,
+ void(uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params));
+ MOCK_METHOD3(
+ OnSecondaryTransportStarted,
+ bool(transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id));
+ MOCK_METHOD2(
+ OnSecondaryTransportEnded,
+ void(const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
index 6ca4557b35..a9e4349bec 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -48,18 +48,32 @@ class MockConnectionHandlerObserver
MOCK_METHOD0(OnFindNewApplicationsRequest, void());
MOCK_METHOD1(RemoveDevice,
void(const connection_handler::DeviceHandle& device_handle));
- MOCK_METHOD3(OnServiceStartedCallback,
- bool(const connection_handler::DeviceHandle& device_handle,
+ MOCK_METHOD4(OnServiceStartedCallback,
+ void(const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
- const protocol_handler::ServiceType& type));
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params));
MOCK_METHOD3(
OnServiceEndedCallback,
void(const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason));
+#ifdef ENABLE_SECURITY
MOCK_CONST_METHOD1(
GetHandshakeContext,
security_manager::SSLContext::HandshakeContext(uint32_t key));
+#endif // ENABLE_SECURITY
+
+ MOCK_METHOD2(OnDeviceSwitchingStart,
+ void(const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to));
+ MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid));
+ MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id));
+ MOCK_METHOD2(OnSecondaryTransportStartedCallback,
+ void(const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key));
+ MOCK_METHOD1(OnSecondaryTransportEndedCallback,
+ void(const int32_t session_key));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
index fcbae93a70..a7e93ec25c 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
@@ -44,7 +44,7 @@ namespace hmi_message_handler_test {
class MockHMIMessageHandlerSettings
: public ::hmi_message_handler::HMIMessageHandlerSettings {
public:
- MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t&());
+ MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t());
};
} // namespace hmi_message_handler_test
} // namespace components
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
index 859d164231..17ec69ccf8 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
@@ -45,9 +45,9 @@ class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver,
public utils::Singleton<MockHMIMessageObserver> {
public:
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
virtual ~MockHMIMessageObserver() {}
};
diff --git a/src/components/include/test/media_manager/mock_media_manager.h b/src/components/include/test/media_manager/mock_media_manager.h
index 9cd2a05fc0..b58cfab5d7 100644
--- a/src/components/include/test/media_manager/mock_media_manager.h
+++ b/src/components/include/test/media_manager/mock_media_manager.h
@@ -56,7 +56,7 @@ class MockMediaManager : public media_manager::MediaManager {
protocol_handler::ServiceType service_type));
MOCK_METHOD2(FramesProcessed,
void(int32_t application_key, int32_t frame_number));
- MOCK_CONST_METHOD0(settings, const MediaManagerSettings&());
+ MOCK_CONST_METHOD0(settings, const media_manager::MediaManagerSettings&());
};
} // namespace media_manager_test
diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..a4d50d7cc2
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_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_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/cache_manager_interface.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+using namespace ::policy;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
+ public:
+ MOCK_CONST_METHOD2(GetConsentsPriority,
+ ConsentPriorityType(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD4(CheckPermissions,
+ void(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_CONST_METHOD1(GetPermissionsList, bool(StringArray& perm_list));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(Counters counter, int value));
+ MOCK_METHOD1(DaysBeforeExchange, int(uint16_t current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+
+ MOCK_METHOD2(SaveDeviceConsentToCache,
+ void(const std::string& device_id, const bool is_allowed));
+
+ MOCK_METHOD1(ResetCalculatedPermissionsForDevice,
+ void(const std::string& device_id));
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
+ MOCK_CONST_METHOD1(IsDeviceConsentCached, bool(const std::string& device_id));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_CONST_METHOD1(GetDeviceConsent,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD2(SetDeviceConsent,
+ void(const std::string& device_id, bool is_allowed));
+
+ MOCK_CONST_METHOD2(HasDeviceSpecifiedConsent,
+ bool(const std::string& device_id, const bool is_allowed));
+ MOCK_CONST_METHOD1(GetCachedDeviceConsent,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD3(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_METHOD1(
+ GetNotificationsNumber,
+ policy_table::NumberOfNotificationsType(const std::string& priority));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string& priority));
+ MOCK_METHOD2(Init,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
+ MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ 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, std::shared_ptr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo());
+ MOCK_CONST_METHOD0(GetCertificate, std::string());
+ MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
+ MOCK_METHOD1(set_settings, void(const PolicySettings* settings));
+ MOCK_METHOD1(GetHMITypes,
+ const policy_table::AppHMITypes*(const std::string& app_id));
+ MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id));
+
+ MOCK_METHOD1(SetExternalConsentStatus, bool(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetExternalConsentStatus, ExternalConsentStatus());
+ MOCK_METHOD0(GetExternalConsentEntities, ExternalConsentStatus());
+ MOCK_METHOD1(GetGroupsWithSameEntities,
+ GroupsByExternalConsentStatus(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetKnownLinksFromPT, std::map<std::string, std::string>());
+ MOCK_METHOD1(SetExternalConsentForApp, void(const PermissionConsent&));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+ MOCK_CONST_METHOD2(GetAppRequestSubTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
index 6186711715..1f570d8699 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
#include <string>
#include <map>
@@ -81,12 +81,29 @@ class MockPolicyListener : public ::policy::PolicyListener {
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>&));
+ MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
};
} // namespace policy_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index ac51c47a75..aeabf8fdcb 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
#include <string>
#include <vector>
@@ -61,6 +61,7 @@ class MockPolicyManager : public PolicyManager {
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,
@@ -109,8 +110,9 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(SetDeviceInfo,
void(const std::string& device_id,
const policy::DeviceInfo& device_info));
- MOCK_METHOD1(SetUserConsentForApp,
- void(const policy::PermissionConsent& permissions));
+ MOCK_METHOD2(SetUserConsentForApp,
+ void(const policy::PermissionConsent& permissions,
+ const policy::PolicyManager::NotificationMode mode));
MOCK_CONST_METHOD2(GetDefaultHmi,
bool(const std::string& policy_app_id,
std::string* default_hmi));
@@ -141,8 +143,28 @@ class MockPolicyManager : public PolicyManager {
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_METHOD2(
+ AddApplication,
+ StatusNotifier(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ MOCK_METHOD2(SendAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(std::shared_ptr<AccessRemote> access_remote));
+
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
@@ -154,7 +176,7 @@ class MockPolicyManager : public PolicyManager {
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(OnAppsSearchCompleted, void(const bool trigger_ptu));
MOCK_METHOD1(OnAppRegisteredOnMobile,
void(const std::string& application_id));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
@@ -187,9 +209,23 @@ class MockPolicyManager : public PolicyManager {
MOCK_CONST_METHOD2(RetrySequenceUrl,
AppIdURL(const struct RetrySequenceURL&,
const EndpointUrls& urls));
+ MOCK_METHOD1(SetExternalConsentStatus, bool(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetExternalConsentStatus, ExternalConsentStatus());
+ MOCK_CONST_METHOD1(IsNeedToUpdateExternalConsentStatus,
+ bool(const ExternalConsentStatus&));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_manager_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
index eafc1df4fe..fe051aaae0 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..440000dbff
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/cache_manager_interface.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+namespace policy_table = rpc::policy_table_interface_base;
+using namespace ::policy;
+
+class MockCacheManagerInterface : public CacheManagerInterface {
+ public:
+ MOCK_METHOD4(CheckPermissions,
+ void(const policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(Counters counter, int value));
+ MOCK_METHOD1(DaysBeforeExchange, int(int current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD2(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language));
+
+ MOCK_METHOD1(
+ GetNotificationsNumber,
+ policy_table::NumberOfNotificationsType(const std::string& priority));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string& priority));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_METHOD2(Init,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
+ MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ MOCK_METHOD1(SaveUpdateRequired, void(bool status));
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types));
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD1(GetFunctionalGroupings,
+ bool(policy_table::FunctionalGroupings& groups));
+ MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_CONST_METHOD2(GetDefaultHMI,
+ bool(const std::string& app_id, std::string& default_hmi));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_CONST_METHOD3(GetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(
+ GetDeviceGroupsFromPolicies,
+ bool(rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups));
+ MOCK_METHOD2(AddDevice,
+ bool(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD8(SetDeviceData,
+ bool(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type));
+ MOCK_METHOD3(SetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD1(SetUserPermissionsForApp,
+ bool(const PermissionConsent& permissions));
+ MOCK_METHOD3(SetMetaInfo,
+ bool(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_CONST_METHOD0(IsMetaInfoPresent, bool());
+ MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ void(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value));
+ MOCK_METHOD3(Add,
+ void(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds));
+ MOCK_METHOD2(CountUnconsentedGroups,
+ int(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
+ MOCK_METHOD2(GetAllAppGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids));
+ MOCK_METHOD2(GetPreConsentedGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& preconsented_groups));
+ MOCK_METHOD4(GetConsentedGroups,
+ void(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups));
+ MOCK_METHOD3(GetUnconsentedGroups,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups));
+ MOCK_METHOD2(RemoveAppConsentForGroup,
+ void(const std::string& app_id, const std::string& group_name));
+ MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD0(CleanupUnpairedDevices, bool());
+ MOCK_METHOD2(SetUnpairedDevice,
+ bool(const std::string& device_id, bool unpaired));
+ MOCK_METHOD1(UnpairedDevicesList, bool(DeviceIds& device_ids));
+ MOCK_METHOD1(ResetPT, bool(const std::string& file_name));
+ MOCK_METHOD0(LoadFromBackup, bool());
+ MOCK_METHOD2(LoadFromFile,
+ bool(const std::string& file_name, policy_table::Table&));
+ MOCK_METHOD0(Backup, void());
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
+ MOCK_CONST_METHOD2(GetAppRequestTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_types));
+ MOCK_METHOD1(GetHMIAppTypeAfterUpdate,
+ void(std::map<std::string, StringArray>& app_hmi_types));
+ MOCK_METHOD0(ResetCalculatedPermissions, void());
+ MOCK_METHOD3(AddCalculatedPermissions,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD3(IsPermissionsCalculated,
+ bool(const std::string& device_id,
+ const std::string& policy_app_id,
+ policy::Permissions& permission));
+ MOCK_CONST_METHOD0(pt, std::shared_ptr<policy_table::Table>());
+ MOCK_METHOD1(GetHMITypes,
+ const policy_table::AppHMITypes*(const std::string& app_id));
+ MOCK_CONST_METHOD0(GetCertificate, std::string());
+ MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id));
+ MOCK_CONST_METHOD2(AppHasHMIType,
+ bool(const std::string& application_id,
+ policy_table::AppHMIType hmi_type));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+ MOCK_CONST_METHOD2(GetAppRequestSubTypes,
+ void(const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
new file mode 100644
index 0000000000..3b0c1a925e
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.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.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
+
+#include <string>
+
+#include "gmock/gmock.h"
+
+#include "policy/policy_listener.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "utils/custom_string.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+namespace custom_str = utils::custom_string;
+
+class MockPolicyListener : public ::policy::PolicyListener {
+ public:
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions,
+ const policy::HMILevel& default_hmi));
+ MOCK_METHOD2(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD1(OnPendingPermissionChange,
+ void(const std::string& policy_app_id));
+ MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
+ MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
+ std::string(const std::string& policy_app_id));
+ MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
+ MOCK_METHOD1(GetAppName,
+ custom_str::CustomString(const std::string& policy_app_id));
+ MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void());
+ MOCK_METHOD2(OnDeviceConsentChanged,
+ void(const std::string& device_id, bool is_allowed));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, policy::StringArray>));
+ MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>&));
+ MOCK_METHOD1(OnSnapshotCreated, void(const policy::BinaryMessage& pt_string));
+ MOCK_METHOD0(CanUpdate, bool());
+ MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
+ MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions&, const std::string&));
+ MOCK_METHOD3(OnUpdateHMILevel,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_METHOD1(GetDevicesIds,
+ std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetRegisteredLinks,
+ void(std::map<std::string, std::string>&));
+ MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 9d940191fd..0e06e9c1a3 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
#include <string>
#include <vector>
@@ -142,8 +142,27 @@ class MockPolicyManager : public PolicyManager {
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_METHOD2(
+ AddApplication,
+ StatusNotifier(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ MOCK_METHOD2(SendAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(std::shared_ptr<AccessRemote> access_remote));
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
@@ -155,7 +174,7 @@ class MockPolicyManager : public PolicyManager {
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(OnAppsSearchCompleted, void(const bool trigger_ptu));
MOCK_METHOD1(OnAppRegisteredOnMobile,
void(const std::string& application_id));
MOCK_CONST_METHOD1(
@@ -164,7 +183,7 @@ class MockPolicyManager : public PolicyManager {
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_CONST_METHOD0(HasCertificate, bool());
MOCK_METHOD0(ExceededIgnitionCycles, bool());
MOCK_METHOD0(ExceededDays, bool());
MOCK_METHOD0(StartPTExchange, void());
@@ -189,10 +208,33 @@ class MockPolicyManager : public PolicyManager {
MOCK_CONST_METHOD2(RetrySequenceUrl,
AppIdURL(const struct RetrySequenceURL&,
const EndpointUrls& urls));
+ MOCK_METHOD6(CheckPermissions,
+ void(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result));
+ MOCK_METHOD2(
+ CheckPendingPermissionsChanges,
+ void(const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions));
+
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+
+ MOCK_CONST_METHOD1(
+ GetAppRequestSubTypes,
+ const std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestTypesState,
+ RequestType::State(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetAppRequestSubTypesState,
+ RequestSubType::State(const std::string& policy_app_id));
};
} // namespace policy_manager_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
index 438e697c51..6e0acae33c 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h
index 44287edd4d..f6db0c7097 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -55,13 +55,18 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler {
void(uint32_t connection_key, int32_t number_of_frames));
MOCK_METHOD2(SendHeartBeat, void(int32_t connection_id, uint8_t session_id));
MOCK_METHOD2(SendEndSession, void(int32_t connection_id, uint8_t session_id));
- MOCK_METHOD3(SendEndService,
- void(int32_t connection_id,
+ MOCK_METHOD4(SendEndService,
+ void(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type));
MOCK_CONST_METHOD0(get_settings,
const ::protocol_handler::ProtocolHandlerSettings&());
MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&());
+ MOCK_METHOD2(NotifySessionStarted,
+ void(const ::protocol_handler::SessionContext& context,
+ std::vector<std::string>& rejected_params));
+ MOCK_METHOD0(NotifyOnFailedHandshake, void());
};
} // namespace protocol_handler_test
} // namespace components
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
index d12e7899e0..2ed9c47e9d 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
@@ -43,6 +43,10 @@ class MockProtocolHandlerSettings
: public protocol_handler::ProtocolHandlerSettings {
public:
MOCK_CONST_METHOD0(maximum_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_control_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_rpc_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_audio_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_video_payload_size, size_t());
MOCK_CONST_METHOD0(message_frequency_count, size_t());
MOCK_CONST_METHOD0(message_frequency_time, size_t());
MOCK_CONST_METHOD0(malformed_message_filtering, bool());
@@ -56,6 +60,17 @@ class MockProtocolHandlerSettings
MOCK_CONST_METHOD0(force_protected_service, const std::vector<int>&());
MOCK_CONST_METHOD0(force_unprotected_service, const std::vector<int>&());
#endif
+ MOCK_CONST_METHOD0(multiple_transports_enabled, const bool());
+ MOCK_CONST_METHOD0(secondary_transports_for_bluetooth,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_usb,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_wifi,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(audio_service_transports,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(video_service_transports,
+ const std::vector<std::string>&());
};
} // namespace protocol_handler_test
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index c376cb85f5..0d74b15f64 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -37,6 +37,7 @@
#include <string>
#include <list>
#include "protocol_handler/session_observer.h"
+#include "transport_manager/common.h"
namespace test {
namespace components {
@@ -46,23 +47,34 @@ namespace protocol_handler_test {
*/
class MockSessionObserver : public ::protocol_handler::SessionObserver {
public:
- MOCK_METHOD5(
- OnSessionStartedCallback,
+ MOCK_METHOD5(OnSessionStartedCallback,
+ void(const transport_manager::ConnectionUID connection_handle,
+ const uint8_t sessionId,
+ const protocol_handler::ServiceType& service_type,
+ const bool is_protected,
+ const BsonObject* params));
+ MOCK_METHOD4(
+ OnSessionEndedCallback,
uint32_t(const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id));
+ const uint32_t& hashCode,
+ const protocol_handler::ServiceType& service_type));
MOCK_METHOD4(
OnSessionEndedCallback,
uint32_t(const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
- const uint32_t& hashCode,
+ uint32_t* hashCode,
const protocol_handler::ServiceType& service_type));
MOCK_METHOD1(OnApplicationFloodCallBack,
void(const uint32_t& connection_key));
MOCK_METHOD1(OnMalformedMessageCallback,
void(const uint32_t& connection_key));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromConnHandle,
+ const std::string(transport_manager::ConnectionUID connection_handle));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromDeviceHandle,
+ const std::string(transport_manager::DeviceHandle device_handle));
MOCK_CONST_METHOD2(
KeyFromPair,
uint32_t(transport_manager::ConnectionUID connection_handle,
@@ -75,13 +87,15 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
int32_t(uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
- uint32_t* device_id));
+ transport_manager::DeviceHandle* device_id));
+
MOCK_CONST_METHOD5(GetDataOnDeviceID,
- int32_t(uint32_t device_handle,
+ int32_t(transport_manager::DeviceHandle device_handle,
std::string* device_name,
std::list<uint32_t>* applications_list,
std::string* mac_address,
std::string* connection_type));
+
MOCK_CONST_METHOD2(IsHeartBeatSupported,
bool(transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
@@ -89,6 +103,9 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
bool(uint32_t connection_id,
uint8_t session_id,
uint8_t& protocol_version));
+ MOCK_CONST_METHOD2(SessionServiceExists,
+ bool(const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type));
#ifdef ENABLE_SECURITY
MOCK_METHOD2(SetSSLContext,
diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
index 1c87de4d5a..82c42775fa 100644
--- a/src/components/include/test/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
@@ -44,8 +44,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public PHTelemetryObserver {
public:
MOCK_METHOD2(StartMessageProcess,
- void(uint32_t message_id, const TimevalStruct& start_time));
- MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr<MessageMetric> m));
+ void(uint32_t message_id,
+ const date_time::TimeDuration& start_time));
+ MOCK_METHOD1(EndMessageProcess, void(std::shared_ptr<MessageMetric> m));
};
} // namespace protocol_handler_test
diff --git a/src/components/include/test/security_manager/mock_crypto_manager.h b/src/components/include/test/security_manager/mock_crypto_manager.h
index 55c364bd89..61ec5183e4 100644
--- a/src/components/include/test/security_manager/mock_crypto_manager.h
+++ b/src/components/include/test/security_manager/mock_crypto_manager.h
@@ -52,7 +52,9 @@ class MockCryptoManager : public ::security_manager::CryptoManager {
MOCK_METHOD0(CreateSSLContext, ::security_manager::SSLContext*());
MOCK_METHOD1(ReleaseSSLContext, void(::security_manager::SSLContext*));
MOCK_CONST_METHOD0(LastError, std::string());
- MOCK_CONST_METHOD0(IsCertificateUpdateRequired, bool());
+ MOCK_CONST_METHOD2(IsCertificateUpdateRequired,
+ bool(const time_t system_time,
+ const time_t certificates_time));
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h
index e3d95cd94f..b2c2e3bf17 100644
--- a/src/components/include/test/security_manager/mock_security_manager.h
+++ b/src/components/include/test/security_manager/mock_security_manager.h
@@ -54,8 +54,9 @@ class MockSecurityManager : public ::security_manager::SecurityManager {
MOCK_METHOD4(
SendInternalError,
void(const uint32_t, const uint8_t&, const std::string&, const uint32_t));
- MOCK_METHOD1(CreateSSLContext,
- ::security_manager::SSLContext*(const uint32_t&));
+ MOCK_METHOD2(CreateSSLContext,
+ ::security_manager::SSLContext*(const uint32_t&,
+ ContextCreationStrategy));
MOCK_METHOD1(StartHandshake, void(uint32_t));
MOCK_METHOD1(AddListener, void(::security_manager::SecurityManagerListener*));
MOCK_METHOD1(RemoveListener,
@@ -65,6 +66,13 @@ class MockSecurityManager : public ::security_manager::SecurityManager {
void(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(OnMobileMessageSent,
void(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD1(IsCertificateUpdateRequired, bool(const uint32_t));
+ MOCK_METHOD0(NotifyOnCertificateUpdateRequired, void());
+ MOCK_METHOD0(NotifyListenersOnHandshakeFailed, void());
+ MOCK_METHOD0(IsPolicyCertificateDataEmpty, bool());
+ MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&));
+ MOCK_METHOD1(PostponeHandshake, void(const uint32_t));
+ MOCK_CONST_METHOD0(IsSystemTimeProviderReady, bool());
};
/*
diff --git a/src/components/include/test/security_manager/mock_security_manager_listener.h b/src/components/include/test/security_manager/mock_security_manager_listener.h
index 9e5dd03698..7a7714d299 100644
--- a/src/components/include/test/security_manager/mock_security_manager_listener.h
+++ b/src/components/include/test/security_manager/mock_security_manager_listener.h
@@ -48,6 +48,8 @@ class MockSecurityManagerListener
bool(uint32_t connection_key,
::security_manager::SSLContext::HandshakeResult result));
MOCK_METHOD0(OnCertificateUpdateRequired, void());
+ MOCK_CONST_METHOD1(GetPolicyCertificateData, bool(std::string& data));
+ MOCK_METHOD0(OnHandshakeFailed, bool());
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/security_manager/mock_security_manager_settings.h b/src/components/include/test/security_manager/mock_security_manager_settings.h
index 6ac194ced4..b1c869cd1b 100644
--- a/src/components/include/test/security_manager/mock_security_manager_settings.h
+++ b/src/components/include/test/security_manager/mock_security_manager_settings.h
@@ -50,8 +50,12 @@ class MockCryptoManagerSettings
MOCK_CONST_METHOD0(certificate_data, const std::string&());
MOCK_CONST_METHOD0(ciphers_list, const std::string&());
MOCK_CONST_METHOD0(ca_cert_path, const std::string&());
+ MOCK_CONST_METHOD0(module_cert_path, const std::string&());
+ MOCK_CONST_METHOD0(module_key_path, const std::string&());
MOCK_CONST_METHOD0(update_before_hours, size_t());
MOCK_CONST_METHOD0(maximum_payload_size, size_t());
+ MOCK_CONST_METHOD0(force_protected_service, const std::vector<int>&());
+ MOCK_CONST_METHOD0(force_unprotected_service, const std::vector<int>&());
};
} // namespace security_manager_test
diff --git a/src/components/include/test/security_manager/mock_ssl_context.h b/src/components/include/test/security_manager/mock_ssl_context.h
index 6b6a26a226..02198d1d22 100644
--- a/src/components/include/test/security_manager/mock_ssl_context.h
+++ b/src/components/include/test/security_manager/mock_ssl_context.h
@@ -68,6 +68,8 @@ class MockSSLContext : public ::security_manager::SSLContext {
MOCK_CONST_METHOD0(LastError, std::string());
MOCK_METHOD0(ResetConnection, void());
MOCK_METHOD1(SetHandshakeContext, void(const HandshakeContext& hsh_ctx));
+ MOCK_CONST_METHOD0(HasCertificate, bool());
+ MOCK_CONST_METHOD1(GetCertificateDueDate, bool(time_t& due_date));
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
index dfa2cbc31d..133dabe732 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_listener.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -81,6 +81,12 @@ class MockTransportManagerListener : public TransportManagerListener {
MOCK_METHOD2(OnTMMessageSendFailed,
void(const DataSendError& error,
const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD2(OnDeviceSwitchingStart,
+ void(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to));
+ MOCK_METHOD1(OnDeviceSwitchingFinish, void(const DeviceUID& device_uid));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const std::map<std::string, std::string>& configs));
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 00da2025dd..3e7c8f36f7 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -59,6 +59,10 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(iap_system_config, const std::string&());
MOCK_CONST_METHOD0(iap2_system_config, const std::string&());
MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t());
+ MOCK_CONST_METHOD0(app_transport_change_timer, uint32_t());
+ MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t());
+ MOCK_CONST_METHOD0(transport_manager_tcp_adapter_network_interface,
+ std::string&());
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
index 16e6ddcb7a..eff0abdcd3 100644
--- a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
@@ -96,6 +96,15 @@ class MockTransportAdapter
DeviceName,
std::string(const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD1(StopDevice,
+ void(const ::transport_manager::DeviceUID& device_id));
+ MOCK_CONST_METHOD0(DoTransportSwitch, void());
+ MOCK_METHOD1(DeviceSwitched,
+ void(const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD0(GetSwitchableDevices,
+ transport_manager::SwitchableDevices());
+ MOCK_CONST_METHOD0(GetTransportConfiguration,
+ transport_manager::transport_adapter::TransportConfig());
#ifdef TELEMETRY_MONITOR
MOCK_METHOD0(GetTelemetryObserver,
::transport_manager::TMTelemetryObserver*());
diff --git a/src/components/include/test/utils/mock_system_time_handler.h b/src/components/include/test/utils/mock_system_time_handler.h
new file mode 100644
index 0000000000..7bb2a7f0a5
--- /dev/null
+++ b/src/components/include/test/utils/mock_system_time_handler.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
+#define SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
+
+#include "gmock/gmock.h"
+#include "utils/system_time_handler.h"
+
+namespace test {
+namespace components {
+namespace security_manager_test {
+
+class MockSystemTimeHandler : public ::utils::SystemTimeHandler {
+ public:
+ MockSystemTimeHandler() {}
+ MOCK_METHOD0(QuerySystemTime, void());
+ MOCK_METHOD1(SubscribeOnSystemTime,
+ void(utils::SystemTimeListener* listener));
+ MOCK_METHOD1(UnsubscribeFromSystemTime,
+ void(utils::SystemTimeListener* listener));
+ MOCK_METHOD0(GetUTCTime, time_t());
+ MOCK_CONST_METHOD0(system_time_can_be_received, bool());
+ ~MockSystemTimeHandler() {}
+
+ private:
+ void DoSubscribe(utils::SystemTimeListener*) {}
+ void DoSystemTimeQuery() {}
+ void DoUnsubscribe(utils::SystemTimeListener* listener) {}
+ bool utc_time_can_be_received() const {
+ return true;
+ }
+ time_t FetchSystemTime() {
+ return 0;
+ }
+};
+} // namespace security_manager_test
+} // namespace components
+} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_SECURITY_MANAGER_MOCK_SYSTEM_TIME_HANDLER_H
diff --git a/src/components/include/test/utils/test_async_waiter.h b/src/components/include/test/utils/test_async_waiter.h
index 2d53d5d7c8..fee7672e93 100644
--- a/src/components/include/test/utils/test_async_waiter.h
+++ b/src/components/include/test/utils/test_async_waiter.h
@@ -30,7 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#pragma once
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
#include <stdint.h>
@@ -102,3 +103,4 @@ ACTION_P(NotifyTestAsyncWaiter, test_async_waiter) {
}
} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
diff --git a/src/components/include/transport_manager/common.h b/src/components/include/transport_manager/common.h
index c1fc51dc8a..58bcf6bb17 100644
--- a/src/components/include/transport_manager/common.h
+++ b/src/components/include/transport_manager/common.h
@@ -35,6 +35,7 @@
#include <vector>
#include <string>
+#include <map>
/**
* @brief - transport_manager namespace
@@ -58,7 +59,7 @@ enum {
/**
* @brief Type definition for variable that hold handle of device.
*/
-typedef unsigned int DeviceHandle;
+typedef size_t DeviceHandle;
/**
* @brief Type definition for variable that hold connection unique identifier.
@@ -90,5 +91,12 @@ typedef int ApplicationHandle;
* @brief Type definition for vector that contain ApplicationHandle variables.
*/
typedef std::vector<ApplicationHandle> ApplicationList;
+
+/**
+ * @brief SwitchableDevices defines list of devices having transport switch id
+ * i.e. able to switch their transport. Maps unique device id (MAC, serial etc.)
+ * to transport switch id (e.g. connection UUID for iAP2 transport)
+ */
+typedef std::map<DeviceUID, std::string> SwitchableDevices;
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h
index 022ddf0e38..ba357dd54b 100644
--- a/src/components/include/transport_manager/error.h
+++ b/src/components/include/transport_manager/error.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
#include <string>
-#include <utils/shared_ptr.h>
+#include <memory>
namespace transport_manager {
@@ -79,7 +79,7 @@ class BaseError {
private:
std::string description_;
};
-typedef utils::SharedPtr<BaseError> BaseErrorPtr;
+typedef std::shared_ptr<BaseError> BaseErrorPtr;
/**
* @brief Error that originates during device search.
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 3adb6cd2e6..1ac1424477 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -35,9 +35,10 @@
#include <string>
#include <vector>
+#include <memory>
#include "transport_manager/common.h"
-#include "utils/shared_ptr.h"
+
#include "utils/macro.h"
namespace transport_manager {
@@ -58,6 +59,22 @@ class Device {
: name_(name)
, unique_device_id_(unique_device_id)
, keep_on_disconnect_(false) {}
+
+ /**
+ * Constructor for creating device supporting transport switch
+ * @brief Device constructor
+ * @param name Device name
+ * @param unique_device_id Unique device id
+ * @param transport_switch_id Id used for transport switching flow
+ */
+ Device(const std::string& name,
+ const DeviceUID& unique_device_id,
+ std::string transport_switch_id)
+ : name_(name)
+ , unique_device_id_(unique_device_id)
+ , transport_switch_id_(transport_switch_id)
+ , keep_on_disconnect_(false) {}
+
/**
* @brief Destructor.
**/
@@ -114,6 +131,14 @@ class Device {
keep_on_disconnect_ = keep_on_disconnect;
}
+ /**
+ * @brief transport_switch_id Returns id used for transport switching
+ * flow of device. Filled if applicable, otherwise - empty.
+ */
+ inline std::string transport_switch_id() const {
+ return transport_switch_id_;
+ }
+
private:
/**
* @brief Device user-friendly name.
@@ -124,6 +149,11 @@ class Device {
* @brief Unique device identifier across all devices.
**/
DeviceUID unique_device_id_;
+ /**
+ * @brief transport_switch_id_ ID used to switch device from one to another
+ * transport. Filled if applicable, otherwise - empty
+ */
+ std::string transport_switch_id_;
/**
* @brief If true, device will remain in list even if all its connections
@@ -131,7 +161,7 @@ class Device {
**/
bool keep_on_disconnect_;
};
-typedef utils::SharedPtr<Device> DeviceSptr;
+typedef std::shared_ptr<Device> DeviceSptr;
typedef std::vector<DeviceSptr> DeviceVector;
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
index ee726ff1d3..ebbf7dae28 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -41,8 +41,6 @@
#include <list>
#include <map>
-#include "utils/shared_ptr.h"
-
#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/common.h"
#include "transport_manager/error.h"
@@ -56,10 +54,21 @@ namespace transport_adapter {
class TransportAdapterListener;
-// TODO(EZamakhov): cahnge to DeviceUID
-// typedef std::string DeviceType;
-
-enum DeviceType { AOA, PASA_AOA, BLUETOOTH, PASA_BLUETOOTH, MME, TCP, UNKNOWN };
+/**
+ * @brief The DeviceType enum defines types based on available transport
+ * adapters
+ */
+enum DeviceType {
+ AOA,
+ BLUETOOTH,
+ IOS_BT,
+ IOS_USB,
+ TCP,
+ IOS_USB_HOST_MODE,
+ IOS_USB_DEVICE_MODE,
+ IOS_CARPLAY_WIRELESS, // running on iAP over Carplay wireless transport
+ UNKNOWN
+};
typedef std::map<DeviceType, std::string> DeviceTypes;
@@ -74,6 +83,18 @@ typedef std::map<DeviceUID, DeviceSptr> DeviceMap;
*/
typedef std::list<TransportAdapterListener*> TransportAdapterListenerList;
+/**
+ * @brief Type definition for transport's configuration information
+ */
+typedef std::map<std::string, std::string> TransportConfig;
+
+/**
+ * @brief TransportConfig keys
+ */
+extern const char* tc_enabled;
+extern const char* tc_tcp_port;
+extern const char* tc_tcp_ip_address;
+
class TransportAdapter {
public:
/**
@@ -278,6 +299,34 @@ class TransportAdapter {
*/
virtual std::string DeviceName(const DeviceUID& device_id) const = 0;
+ /**
+ * @brief StopDevice Stop all activity on device without removing it from
+ * devices list
+ * @param device_id unique device identifier that has to be stopped.
+ */
+ virtual void StopDevice(const DeviceUID& device_id) const = 0;
+
+ /**
+ * @brief DoTransportSwitch notifies listeners of transport adapter events
+ * that transport switching is requested by system
+ */
+ virtual void DoTransportSwitch() const = 0;
+
+ /**
+ * @brief DeviceSwitched is triggered for adapter to proceed with possible
+ * further switching steps required on device side. E.g. to notify device
+ * on end of switching so it can disconnect transport being switched from.
+ * @param device_handle Device id to notify on event
+ */
+ virtual void DeviceSwitched(const DeviceUID& device_handle) = 0;
+
+ virtual SwitchableDevices GetSwitchableDevices() const = 0;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const = 0;
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Return Time metric observer
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
index 7879a136b2..fd1d693067 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -39,6 +39,28 @@
namespace transport_manager {
+/**
+ * @enum Available types of events.
+ */
+enum class EventTypeEnum {
+ ON_SEARCH_DONE = 0,
+ ON_SEARCH_FAIL,
+ ON_DEVICE_LIST_UPDATED,
+ ON_FIND_NEW_APPLICATIONS_REQUEST,
+ ON_CONNECT_DONE,
+ ON_CONNECT_FAIL,
+ ON_DISCONNECT_DONE,
+ ON_DISCONNECT_FAIL,
+ ON_SEND_DONE,
+ ON_SEND_FAIL,
+ ON_RECEIVED_DONE,
+ ON_RECEIVED_FAIL,
+ ON_COMMUNICATION_ERROR,
+ ON_UNEXPECTED_DISCONNECT,
+ ON_TRANSPORT_SWITCH_REQUESTED,
+ ON_TRANSPORT_CONFIG_UPDATED
+};
+
class TransportAdapterEvent {
public:
TransportAdapterEvent() {}
@@ -52,7 +74,7 @@ class TransportAdapterEvent {
* @param data Smart pointer to the raw message.
* @param error Error class that contains details of this error situation.
*/
- TransportAdapterEvent(int type,
+ TransportAdapterEvent(EventTypeEnum type,
transport_adapter::TransportAdapter* adapter,
const DeviceUID& device_handle,
const ApplicationHandle& application_id,
@@ -64,10 +86,11 @@ class TransportAdapterEvent {
, transport_adapter(adapter)
, event_data(data)
, event_error(error) {}
+
/**
* @brief Value that describe event type.
*/
- int event_type;
+ EventTypeEnum event_type;
/**
* @brief Handle of application
*/
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index e9f49e3152..6c3f6e2eaa 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
+#include <map>
#include <vector>
#include "transport_manager/common.h"
#include "transport_manager/info.h"
@@ -70,6 +71,23 @@ class TransportManagerListener {
virtual void OnDeviceRemoved(const DeviceInfo& device_info) = 0;
/**
+ * @brief OnDeviceSwitchingStart allows to notify listener that device is
+ * going to switch its connection.
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ virtual void OnDeviceSwitchingStart(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to) = 0;
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listener that device reconnection
+ * fails due to some reason.
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ virtual void OnDeviceSwitchingFinish(const DeviceUID& device_uid) = 0;
+
+ /**
* @brief Reaction to the event, when scanning of devices is finished.
*/
virtual void OnScanDevicesFinished() = 0;
@@ -176,6 +194,14 @@ class TransportManagerListener {
virtual void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) = 0;
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ virtual void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
index c5eb0be37c..08b2b77c30 100644
--- a/src/components/include/transport_manager/transport_manager_listener_empty.h
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -69,6 +69,23 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnDeviceRemoved(const DeviceInfo& device_info) OVERRIDE {}
/**
+ * @brief OnDeviceSwitchingStart allows to notify listener that device is
+ * going to switch its connection. This default implementation does nothing.
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ void OnDeviceSwitchingStart(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to) OVERRIDE {}
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listener that device reconnection
+ * fails due to some reason. This default implementation does nothing.
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ void OnDeviceSwitchingFinish(const DeviceUID& device_uid) OVERRIDE {}
+
+ /**
* @brief Reaction to the event, when scanning of devices is finished.
*/
void OnScanDevicesFinished() OVERRIDE {}
@@ -170,6 +187,14 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) OVERRIDE {}
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) OVERRIDE {}
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index f33c5344e0..3912bbe747 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -51,6 +51,24 @@ class TransportManagerSettings : public TransportManagerMMESettings {
* @brief Returns port for TCP transport adapter
*/
virtual uint16_t transport_manager_tcp_adapter_port() const = 0;
+
+ /**
+ * @brief Returns the millisecond count before timeout
+ * for transport change feature occures.
+ */
+ virtual uint32_t app_transport_change_timer() const = 0;
+
+ /**
+ * @brief Returns the millisecond count as addition to
+ * the transport change timeout value.
+ */
+ virtual uint32_t app_transport_change_timer_addition() const = 0;
+
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ virtual const std::string& transport_manager_tcp_adapter_network_interface()
+ const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/atomic_object.h b/src/components/include/utils/atomic_object.h
deleted file mode 100644
index 257fcfbe3a..0000000000
--- a/src/components/include/utils/atomic_object.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
-
-#include "utils/rwlock.h"
-#include "utils/conditional_variable.h"
-#include "utils/macro.h"
-
-namespace sync_primitives {
-
-/**
- * @brief Allows to safely change stored value from different threads.
- *
- * The usage example:
- *
- * threads::Atomic<int> i;
- *
- * i = 5; // here SDL is able to guarantee that this value will be safely
- * // assigned even in multi threaded environment.
- */
-template <typename T>
-class Atomic {
- public:
- /**
- * @brief Atomic allows to construct atomic object.
- * The operation is not atomic.
- *
- * @param value the value to initialize object with.
- */
- Atomic(const T& value) : value_(value) {}
-
- /**
- * @brief operator = thread safe setter for stored value.
- *
- * @param val value to assign.
- *
- * @return mofified value.
- */
- T& operator=(const T& val) {
- sync_primitives::AutoWriteLock lock(rw_lock_);
- value_ = val;
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- operator T() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- template <typename U>
- operator U() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return static_cast<U>(value_);
- }
-
- private:
- T value_;
- mutable sync_primitives::RWLock rw_lock_;
-};
-
-typedef Atomic<int> atomic_int;
-typedef Atomic<int32_t> atomic_int32;
-typedef Atomic<uint32_t> atomic_uint32;
-typedef Atomic<int64_t> atomic_int64;
-typedef Atomic<uint64_t> atomic_uint64;
-typedef Atomic<size_t> atomic_size_t;
-typedef Atomic<bool> atomic_bool;
-
-} // namespace sync_primitives
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
diff --git a/src/components/include/utils/conditional_variable.h b/src/components/include/utils/conditional_variable.h
index f54a22e993..a29f255dbf 100644
--- a/src/components/include/utils/conditional_variable.h
+++ b/src/components/include/utils/conditional_variable.h
@@ -32,24 +32,13 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
-#if defined(OS_POSIX)
-#include <pthread.h>
-#else
-#error Please implement conditional variable for your OS
-#endif
#include <stdint.h>
+#include <boost/thread/condition_variable.hpp>
+#include "utils/lock.h"
#include "utils/macro.h"
namespace sync_primitives {
-class AutoLock;
-class Lock;
-
-namespace impl {
-#if defined(OS_POSIX)
-typedef pthread_cond_t PlatformConditionalVariable;
-#endif
-} // namespace impl
/*
* Conditional variable wrapper
@@ -82,11 +71,11 @@ class ConditionalVariable {
// Wait forever or up to milliseconds time limit
bool Wait(AutoLock& auto_lock);
- bool Wait(Lock& lock);
+ bool Wait(BaseLock& lock);
WaitStatus WaitFor(AutoLock& auto_lock, uint32_t milliseconds);
private:
- impl::PlatformConditionalVariable cond_var_;
+ boost::condition_variable_any cond_var_;
private:
DISALLOW_COPY_AND_ASSIGN(ConditionalVariable);
diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h
index 9be28a638b..1be7c3ab53 100644
--- a/src/components/include/utils/data_accessor.h
+++ b/src/components/include/utils/data_accessor.h
@@ -33,17 +33,15 @@
#define SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
-// This class is for thread-safe access to data
+// This class is for thread-safe const access to data
template <class T>
class DataAccessor {
public:
- DataAccessor(const T& data, const sync_primitives::Lock& lock)
- : data_(data)
- , lock_(const_cast<sync_primitives::Lock&>(lock))
- , counter_(new uint32_t(0)) {
- lock_.Acquire();
+ DataAccessor(const T& data,
+ const std::shared_ptr<sync_primitives::BaseLock>& lock)
+ : data_(data), lock_(lock), counter_(new uint32_t(0)) {
+ lock_->Acquire();
}
DataAccessor(const DataAccessor<T>& other)
@@ -53,7 +51,7 @@ class DataAccessor {
~DataAccessor() {
if (0 == *counter_) {
- lock_.Release();
+ lock_->Release();
} else {
--(*counter_);
}
@@ -65,8 +63,9 @@ class DataAccessor {
private:
void* operator new(size_t size);
const T& data_;
- sync_primitives::Lock& lock_;
- utils::SharedPtr<uint32_t> counter_;
+ // Require that the lock lives at least as long as the DataAccessor
+ const std::shared_ptr<sync_primitives::BaseLock> lock_;
+ std::shared_ptr<uint32_t> counter_;
};
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
diff --git a/src/components/include/utils/date_time.h b/src/components/include/utils/date_time.h
index f8f8e3d6ce..17b4fafe38 100644
--- a/src/components/include/utils/date_time.h
+++ b/src/components/include/utils/date_time.h
@@ -32,69 +32,70 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
-#if defined(OS_POSIX)
-#include <sys/time.h>
-typedef struct timeval TimevalStruct;
-#endif
#include <stdint.h>
+#include "boost/date_time/posix_time/posix_time_duration.hpp"
namespace date_time {
+// skip boost namespacing for all this
+// NOTE that it's called posix_time for its functionality, not for any
+// platform-dependence
+typedef boost::posix_time::time_duration TimeDuration;
+// Capture from boost's namespaces
+using boost::posix_time::microseconds;
+using boost::posix_time::milliseconds;
+using boost::posix_time::seconds;
+
enum TimeCompare { LESS, EQUAL, GREATER };
-class DateTime {
- public:
- static const int32_t MILLISECONDS_IN_SECOND = 1000;
- static const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
- static const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
- static const int32_t SECONDS_IN_HOUR = 3600;
- static const int32_t MICROSECONDS_IN_SECOND =
- MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
- static const int32_t NANOSECONDS_IN_MILLISECOND =
- MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+// public defines for external usage
+const int32_t MILLISECONDS_IN_SECOND = 1000;
+const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
+const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
+const int32_t SECONDS_IN_HOUR = 3600;
+const int32_t MICROSECONDS_IN_SECOND =
+ MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
+const int32_t NANOSECONDS_IN_MILLISECOND =
+ MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+
+TimeDuration getCurrentTime();
- static TimevalStruct getCurrentTime();
+// empty duration
+TimeDuration TimeDurationZero();
- // return SECONDS count
- static int64_t getSecs(const TimevalStruct& time);
+// return SECONDS count
+int64_t getSecs(const TimeDuration& t);
- // return MILLISECONDS count
- static int64_t getmSecs(const TimevalStruct& time);
- // return MICROSECONDS count
- static int64_t getuSecs(const TimevalStruct& time);
+// return MILLISECONDS count
+int64_t getmSecs(const TimeDuration& t);
+// return MICROSECONDS count
+int64_t getuSecs(const TimeDuration& t);
- // return MILLISECONDS count between sinceTime value and current time
- static int64_t calculateTimeSpan(const TimevalStruct& sinceTime);
+// get just the MILLISECONDS count (< 1000)
+int64_t get_just_mSecs(const TimeDuration& t);
- // return MILLISECONDS count between time1 and time2
- static int64_t calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// get just the MICROSECONDS count (< 1000)
+int64_t get_just_uSecs(const TimeDuration& t);
- /**
- * @brief Adds milliseconds to time struct
- * @param time contains time struct
- * @param milliseconds contains value which need to
- * add to time struct
- **/
- static void AddMilliseconds(TimevalStruct& time, uint32_t milliseconds);
+// return MILLISECONDS count between sinceTime value and current time
+int64_t calculateTimeSpan(const TimeDuration& sinceTime);
- static TimevalStruct Sub(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// return MILLISECONDS count between time1 and time2
+int64_t calculateTimeDiff(const TimeDuration& time1, const TimeDuration& time2);
- static TimeCompare compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2);
+/**
+ * @brief Adds milliseconds to time struct
+ * @param time contains time struct
+ * @param milliseconds contains value which need to
+ * add to time struct
+ **/
+void AddMilliseconds(TimeDuration& time, uint32_t milliseconds);
- static bool Greater(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Less(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Equal(const TimevalStruct& time1, const TimevalStruct& time2);
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2);
- private:
- static TimevalStruct ConvertionUsecs(const TimevalStruct& time);
-};
+bool Greater(const TimeDuration& time1, const TimeDuration& time2);
+bool Less(const TimeDuration& time1, const TimeDuration& time2);
+bool Equal(const TimeDuration& time1, const TimeDuration& time2);
} // namespace date_time
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2);
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2);
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2);
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
diff --git a/src/components/include/utils/lock.h b/src/components/include/utils/lock.h
index e615a58f9d..bfa1ef1770 100644
--- a/src/components/include/utils/lock.h
+++ b/src/components/include/utils/lock.h
@@ -32,24 +32,18 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
-#if defined(OS_POSIX)
-#include <pthread.h>
-#include <sched.h>
-#else
-#error Please implement lock for your OS
-#endif
#include <stdint.h>
-#include "utils/macro.h"
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
+#include <iostream>
+#include <memory>
#include "utils/atomic.h"
+#include "utils/macro.h"
#include "utils/memory_barrier.h"
-namespace sync_primitives {
+using boost::system::error_code;
-namespace impl {
-#if defined(OS_POSIX)
-typedef pthread_mutex_t PlatformMutex;
-#endif
-} // namespace impl
+namespace sync_primitives {
class SpinMutex {
public:
@@ -78,71 +72,98 @@ class SpinMutex {
volatile unsigned int state_;
};
-/* Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper
- Please use AutoLock to ackquire and (automatically) release it
- It eases balancing of multple lock taking/releasing and makes it
- Impossible to forget to release the lock:
- ...
- ConcurentlyAccessedData data_;
- sync_primitives::Lock data_lock_;
- ...
- {
- sync_primitives::AutoLock auto_lock(data_lock_);
- data_.ReadOrWriteData();
- } // lock is automatically released here
-*/
-class Lock {
+/* Abstract base class that allows AutoLock to handle both recursive and
+ * non-recursive locks
+ */
+class BaseLock {
public:
- Lock();
- Lock(bool is_recursive);
- ~Lock();
-
+ BaseLock() {}
+ virtual ~BaseLock() {}
// Ackquire the lock. Must be called only once on a thread.
// Please consider using AutoLock to capture it.
- void Acquire();
+ virtual void Acquire() = 0;
// Release the lock. Must be called only once on a thread after lock.
// was acquired. Please consider using AutoLock to automatically release
// the lock
- void Release();
+ virtual void Release() = 0;
// Try if lock can be captured and lock it if it was possible.
// If it captured, lock must be manually released calling to Release
// when protected resource access was finished.
// @returns wether lock was captured.
- bool Try();
+ virtual bool Try() = 0;
- private:
- impl::PlatformMutex mutex_;
+ protected:
+ // Ensures safety in locking
+ virtual void AssertTakenAndMarkFree() = 0;
+ virtual void AssertFreeAndMarkTaken() = 0;
+
+ friend class ConditionalVariable;
+};
+
+/*
+ * Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper
+ */
+class Lock : public BaseLock {
+ public:
+ Lock();
+ ~Lock();
+
+ virtual void Acquire();
+
+ virtual void Release();
-#ifndef NDEBUG
+ virtual bool Try();
+
+ private:
/**
- * @brief Basic debugging aid, a flag that signals wether this lock is
- * currently taken
- * Allows detection of abandoned and recursively captured mutexes
- */
+ * @brief Basic debugging aid, a flag that signals wether this lock is
+ * currently taken
+ * Allows detection of abandoned and recursively captured mutexes
+ */
uint32_t lock_taken_;
+ virtual void AssertTakenAndMarkFree();
+ virtual void AssertFreeAndMarkTaken();
+ boost::mutex mutex_;
+ DISALLOW_COPY_AND_ASSIGN(Lock);
+ friend class ConditionalVariable;
+};
- /**
- * @brief Describe if mutex is recurcive or not
- */
- bool is_mutex_recursive_;
+/*
+ * Platform-indepenednt RECURSIVE lock (mutex) wrapper
+ */
+class RecursiveLock : public BaseLock {
+ public:
+ RecursiveLock();
+ ~RecursiveLock();
+
+ virtual void Acquire();
- void AssertFreeAndMarkTaken();
- void AssertTakenAndMarkFree();
-#else
- void AssertFreeAndMarkTaken() {}
- void AssertTakenAndMarkFree() {}
-#endif
+ virtual void Release();
- void Init(bool is_recursive);
+ virtual bool Try();
+ private:
+ /**
+ * @brief Basic debugging aid, a flag that signals wether this lock is
+ * currently taken
+ * Allows detection of abandoned and recursively captured mutexes
+ */
+ uint32_t lock_taken_;
+ virtual void AssertTakenAndMarkFree();
+ virtual void AssertFreeAndMarkTaken();
+ boost::recursive_mutex mutex_;
+ DISALLOW_COPY_AND_ASSIGN(RecursiveLock);
friend class ConditionalVariable;
- DISALLOW_COPY_AND_ASSIGN(Lock);
};
// This class is used to automatically acquire and release the a lock
class AutoLock {
public:
- explicit AutoLock(Lock& lock) : lock_(lock) {
+ explicit AutoLock(const std::shared_ptr<BaseLock>& lock) : lock_(*lock) {
+ lock_.Acquire();
+ }
+ explicit AutoLock(BaseLock& lock) : lock_(lock) {
+ // std::cerr << "lock is at " << &lock << std::endl;
lock_.Acquire();
}
~AutoLock() {
@@ -150,21 +171,35 @@ class AutoLock {
}
private:
- Lock& GetLock() {
+ BaseLock& GetLock() {
return lock_;
}
- Lock& lock_;
+ BaseLock& lock_;
private:
friend class AutoUnlock;
friend class ConditionalVariable;
DISALLOW_COPY_AND_ASSIGN(AutoLock);
};
-
+/* Please use AutoLock to acquire and (automatically) release it
+ * It eases balancing of multple lock taking/releasing and makes it
+ * Impossible to forget to release the lock:
+ * ...
+ * ConcurentlyAccessedData data_;
+ * sync_primitives::Lock data_lock_;
+ * ...
+ * {
+ * sync_primitives::AutoLock auto_lock(data_lock_);
+ * data_.ReadOrWriteData();
+ * } // lock is automatically released here
+ */
// This class is used to temporarly unlock autolocked lock
class AutoUnlock {
public:
- explicit AutoUnlock(Lock& lock) : lock_(lock) {
+ explicit AutoUnlock(const std::shared_ptr<BaseLock>& lock) : lock_(*lock) {
+ lock_.Release();
+ }
+ explicit AutoUnlock(BaseLock& lock) : lock_(lock) {
lock_.Release();
}
explicit AutoUnlock(AutoLock& lock) : lock_(lock.GetLock()) {
@@ -175,7 +210,7 @@ class AutoUnlock {
}
private:
- Lock& lock_;
+ BaseLock& lock_;
private:
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
index 0e029e4b06..e6f3b6b3ca 100644
--- a/src/components/include/utils/macro.h
+++ b/src/components/include/utils/macro.h
@@ -113,6 +113,13 @@
return; \
}
+#define EXPORT_FUNCTION(TypeName) extern "C" TypeName* Create();
+
+#define EXPORT_FUNCTION_IMPL(TypeName) \
+ extern "C" TypeName* Create() { \
+ return new TypeName(); \
+ }
+
#define NOTREACHED() DCHECK(!"Unreachable code")
// Allows to perform static check that virtual function from base class is
@@ -134,6 +141,26 @@
#ifdef BUILD_TESTS
#define FRIEND_TEST(test_case_name, test_name) \
friend class test_case_name##_##test_name##_Test
+#else // BUILD_TESTS
+#define FRIEND_TEST(test_case_name, test_name)
+#endif // BUILD_TESTS
+
+/*
+* @brief deprecate a method declaration, a warning will be thrown by your
+* compiler if a method with this macro is used
+*/
+#if __cplusplus > 201103L
+#define DEPRECATED [[deprecated]]
+#else
+#ifdef __GNUC__
+#define DEPRECATED __attribute__((deprecated))
+#define DEPRECATED_CLASS __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define DEPRECATED __declspec(deprecated)
+#else
+#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
+#define DEPRECATED
+#endif
#endif
#endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h
deleted file mode 100644
index 9d40d646a6..0000000000
--- a/src/components/include/utils/make_shared.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
-
-#include <new>
-/**
- * @brief The functions set below allows to create shared pointer in a safe way.
- * There are up to 5 parameters could be passed as the constructor parameters.
- *
- * @example
- * struct A {
- * A(int){}
- * A(int, double) {}
- * A(int, double, std::string) {}
- * }
- * SharedPtr<A> shared1(MakeShared<A>(5);
- * SharedPtr<A> shared2(MakeShared<A>(5, 5.5);
- * SharedPtr<A> shared3(MakeShared<A>(5, 5.5, std::string("MyStr"));
- *
- * The profit in using MakeShared instead of simple allocation with operator new
- *is evident.
- * Firstly it allows us to centralize allocation place, secondly it allows us to
- *use
- * safe operator new overloading (no throwable one).
- */
-namespace utils {
-template <typename T>
-class SharedPtr;
-
-namespace {
-template <typename T>
-SharedPtr<T> Initialize(T* object) {
- return object == NULL ? SharedPtr<T>() : SharedPtr<T>(object);
-}
-}
-
-template <typename T>
-SharedPtr<T> MakeShared() {
- T* t = new (std::nothrow) T;
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(const Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5,
- const Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-} // namespace utils;
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
diff --git a/src/components/include/utils/messagemeter.h b/src/components/include/utils/messagemeter.h
index 42b658ad6b..1148a65b57 100644
--- a/src/components/include/utils/messagemeter.h
+++ b/src/components/include/utils/messagemeter.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_UTILS_MESSAGEMETER_H_
#include <cstddef>
-#include <set>
#include <map>
+#include <set>
#include "utils/date_time.h"
namespace utils {
@@ -82,20 +82,19 @@ class MessageMeter {
void ClearIdentifiers();
void set_time_range(const size_t time_range_msecs);
- void set_time_range(const TimevalStruct& time_range);
- TimevalStruct time_range() const;
+ void set_time_range(const date_time::TimeDuration& time_range);
+ date_time::TimeDuration time_range() const;
private:
- TimevalStruct time_range_;
- typedef std::multiset<TimevalStruct> Timings;
+ date_time::TimeDuration time_range_;
+ typedef std::multiset<date_time::TimeDuration> Timings;
typedef std::map<Id, Timings> TimingMap;
TimingMap timing_map_;
};
template <class Id>
-MessageMeter<Id>::MessageMeter()
- : time_range_(TimevalStruct{0, 0}) {
- time_range_.tv_sec = 1;
+MessageMeter<Id>::MessageMeter() {
+ time_range_ = date_time::seconds(1);
}
template <class Id>
@@ -106,7 +105,7 @@ size_t MessageMeter<Id>::TrackMessage(const Id& id) {
template <class Id>
size_t MessageMeter<Id>::TrackMessages(const Id& id, const size_t count) {
Timings& timings = timing_map_[id];
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
for (size_t i = 0; i < count; ++i) {
// Adding to the end is amortized constant
timings.insert(timings.end(), current_time);
@@ -124,8 +123,8 @@ size_t MessageMeter<Id>::Frequency(const Id& id) {
if (timings.empty()) {
return 0u;
}
- const TimevalStruct actual_begin_time = date_time::DateTime::Sub(
- date_time::DateTime::getCurrentTime(), time_range_);
+ const date_time::TimeDuration actual_begin_time =
+ (date_time::getCurrentTime() - time_range_);
timings.erase(timings.begin(), timings.upper_bound(actual_begin_time));
return timings.size();
}
@@ -142,21 +141,15 @@ void MessageMeter<Id>::ClearIdentifiers() {
template <class Id>
void MessageMeter<Id>::set_time_range(const size_t time_range_msecs) {
- // TODO(EZamakhov): move to date_time::DateTime
- const size_t secs =
- time_range_msecs / date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_sec = secs;
- const size_t mSecs =
- time_range_msecs % date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_usec =
- mSecs * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ time_range_ = date_time::milliseconds(time_range_msecs);
}
template <class Id>
-void MessageMeter<Id>::set_time_range(const TimevalStruct& time_range) {
+void MessageMeter<Id>::set_time_range(
+ const date_time::TimeDuration& time_range) {
time_range_ = time_range;
}
template <class Id>
-TimevalStruct MessageMeter<Id>::time_range() const {
+date_time::TimeDuration MessageMeter<Id>::time_range() const {
return time_range_;
}
} // namespace utils
diff --git a/src/components/include/utils/semantic_version.h b/src/components/include/utils/semantic_version.h
new file mode 100644
index 0000000000..244ae82177
--- /dev/null
+++ b/src/components/include/utils/semantic_version.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018, Livio
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SEMANTIC_VERSION_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_SEMANTIC_VERSION_H_
+
+#include <string>
+namespace utils {
+
+struct SemanticVersion {
+ SemanticVersion(uint16_t major = 0, uint16_t minor = 0, uint16_t patch = 0) {
+ major_version_ = major;
+ minor_version_ = minor;
+ patch_version_ = patch;
+ }
+
+ SemanticVersion(const SemanticVersion& other) {
+ major_version_ = other.major_version_;
+ minor_version_ = other.minor_version_;
+ patch_version_ = other.patch_version_;
+ }
+
+ SemanticVersion(const std::string& versionString)
+ : major_version_(0), minor_version_(0), patch_version_(0) {
+ unsigned int major_int, minor_int, patch_int;
+ int readElements = sscanf(
+ versionString.c_str(), "%u.%u.%u", &major_int, &minor_int, &patch_int);
+ if (readElements != 3) {
+ // LOG4CXX_WARN(logger_,
+ // "Error while parsing version string: " << versionString);
+ } else {
+ major_version_ = static_cast<uint8_t>(major_int);
+ minor_version_ = static_cast<uint8_t>(minor_int);
+ patch_version_ = static_cast<uint8_t>(patch_int);
+ }
+ }
+
+ static inline int16_t cmp(const SemanticVersion& version1,
+ const SemanticVersion& version2) {
+ int16_t diff =
+ static_cast<int16_t>(version1.major_version_ - version2.major_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.minor_version_ -
+ version2.minor_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.patch_version_ -
+ version2.patch_version_);
+ }
+ }
+ return diff;
+ }
+
+ bool operator==(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) == 0;
+ }
+ bool operator<(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) < 0;
+ }
+ bool operator>(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) > 0;
+ }
+ bool operator<=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) <= 0;
+ }
+ bool operator>=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) >= 0;
+ }
+ static inline SemanticVersion* min(SemanticVersion& version1,
+ SemanticVersion& version2) {
+ return (version1 < version2) ? &version1 : &version2;
+ }
+
+ const std::string toString() const {
+ std::string result = "";
+ result += std::to_string(major_version_);
+ result += ".";
+ result += std::to_string(minor_version_);
+ result += ".";
+ result += std::to_string(patch_version_);
+ return result;
+ }
+
+ bool isValid() const {
+ return major_version_ > 0 || minor_version_ > 0 || patch_version_ > 0;
+ }
+
+ uint16_t major_version_ = 0;
+ uint16_t minor_version_ = 0;
+ uint16_t patch_version_ = 0;
+};
+
+extern const SemanticVersion version_4_5;
+}
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H \ No newline at end of file
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
deleted file mode 100644
index 064bb36b4a..0000000000
--- a/src/components/include/utils/shared_ptr.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#include "utils/macro.h"
-#include "utils/atomic.h"
-
-namespace utils {
-
-/**
- * @brief Shared pointer.
- *
- * Pointer to an object with reference counting.
- * Object will be automatically deallocated when last shared
- * pointer is destroyed.
- *
- * @tparam ObjectType Type of wrapped object.
- **/
-template <typename ObjectType>
-class SharedPtr {
- static void DummyDeleter(ObjectType* object_to_delete) {
- delete object_to_delete;
- }
-
- public:
- // std smart pointer compatibility
- typedef ObjectType element_type;
- typedef void (*Deleter)(ObjectType*);
- /**
- * @brief Constructor.
- *
- * Initialize shared pointer with wrapped object.
- * Reference counter will be initialized to 1.
- *
- * @param Object Wrapped object.
- **/
- SharedPtr(ObjectType* Object);
-
- SharedPtr(ObjectType* Object, Deleter deleter)
- : mObject(Object)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(deleter) {}
-
- SharedPtr();
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @param Other Other shared pointer.
- **/
- SharedPtr(const SharedPtr<ObjectType>& Other);
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Other shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr(const SharedPtr<OtherObjectType>& Other);
-
- /**
- * @brief Destructor.
- *
- * Decrement reference counter and destroy wrapped object
- * if reference counter reaches zero.
- **/
- ~SharedPtr();
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- SharedPtr<ObjectType>& operator=(const SharedPtr<ObjectType>& Other);
-
- bool operator==(const SharedPtr<ObjectType>& Other) const;
-
- bool operator<(const SharedPtr<ObjectType>& other) const;
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr<ObjectType>& operator=(const SharedPtr<OtherObjectType>& Other);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> static_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> dynamic_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- /**
- * @brief Member access operator.
- *
- * @return Wrapped object.
- **/
- ObjectType* operator->() const;
-
- ObjectType& operator*() const;
- operator bool() const;
- void reset();
- void reset(ObjectType* other);
- ObjectType* get() const;
-
-#ifdef BUILD_TESTS
- inline const uint32_t* get_ReferenceCounter() const {
- return mReferenceCounter;
- }
-#endif // BUILD_TESTS
-
- /**
- * @return true if mObject not NULL
- */
- bool valid() const;
-
- private:
- void reset_impl(ObjectType* other);
-
- // TSharedPtr needs access to other TSharedPtr private members
- // for shared pointers type casts.
- template <typename OtherObjectType>
- friend class SharedPtr;
-
- /**
- * @brief Drop reference to wrapped object.
- *
- * If reference counter reaches zero object and its reference
- * counter will be deallocated.
- **/
- void dropReference();
-
- /**
- * @brief Wrapped object.
- **/
- ObjectType* mObject;
-
- /**
- * @brief Pointer to reference counter.
- **/
- uint32_t* mReferenceCounter;
-
- Deleter deleter_;
- void release();
-};
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(ObjectType* Object)
- : mObject(NULL)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(DummyDeleter) {
- DCHECK(Object != NULL);
- mObject = Object;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr()
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<ObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<OtherObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::~SharedPtr() {
- dropReference();
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<ObjectType>& Other) {
- return operator=<ObjectType>(Other);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator==(
- const SharedPtr<ObjectType>& Other) const {
- return (mObject == Other.mObject);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator<(
- const SharedPtr<ObjectType>& other) const {
- return (mObject < other.mObject);
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<OtherObjectType>& Other) {
- dropReference();
-
- mObject = Other.mObject;
- mReferenceCounter = Other.mReferenceCounter;
-
- if (0 != mReferenceCounter) {
- atomic_post_inc(mReferenceCounter);
- }
-
- return *this;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = static_cast<OtherObjectType*>(pointer.mObject);
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = dynamic_cast<OtherObjectType*>(pointer.mObject);
- if (NULL != casted_pointer.mObject) {
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-ObjectType* utils::SharedPtr<ObjectType>::operator->() const {
- DCHECK(mObject);
- return mObject;
-}
-
-template <typename ObjectType>
-ObjectType& utils::SharedPtr<ObjectType>::operator*() const {
- DCHECK(mObject);
- return *mObject;
-}
-
-template <typename ObjectType>
-utils::SharedPtr<ObjectType>::operator bool() const {
- return valid();
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset() {
- reset_impl(0);
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset(ObjectType* other) {
- DCHECK(other != NULL);
- reset_impl(other);
-}
-
-template <typename ObjectType>
-void SharedPtr<ObjectType>::release() {
- deleter_(mObject);
- mObject = 0;
-
- delete mReferenceCounter;
- mReferenceCounter = 0;
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) {
- dropReference();
- mObject = other;
- mReferenceCounter = new uint32_t(1);
-}
-
-template <typename ObjectType>
-inline void SharedPtr<ObjectType>::dropReference() {
- if (0 != mReferenceCounter) {
- if (1 == atomic_post_dec(mReferenceCounter)) {
- release();
- }
- }
-}
-
-template <typename ObjectType>
-ObjectType* SharedPtr<ObjectType>::get() const {
- return mObject;
-}
-
-template <typename ObjectType>
-inline bool SharedPtr<ObjectType>::valid() const {
- if (mReferenceCounter && (0 < *mReferenceCounter)) {
- return (mObject != NULL);
- }
- return false;
-}
-
-} // namespace utils
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-// vim: set ts=2 sw=2 et:
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
index 15023f02dd..add7fc38b8 100644
--- a/src/components/include/utils/threads/message_loop_thread.h
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -40,7 +40,7 @@
#include "utils/macro.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
namespace threads {
diff --git a/src/components/include/utils/typed_enum_print.h b/src/components/include/utils/typed_enum_print.h
new file mode 100644
index 0000000000..e2b903c948
--- /dev/null
+++ b/src/components/include/utils/typed_enum_print.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+
+#include <type_traits>
+#include <ostream>
+
+namespace utils {
+
+// Generic overloaded operator "<<" to be able to send enum class values to
+// std::ostream
+template <typename T>
+std::ostream& operator<<(
+ typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream,
+ const T& e) {
+ return stream << static_cast<int>(e);
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index 1ea481f11a..3cf1082e90 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -38,37 +38,14 @@ include_directories (
${CMAKE_BINARY_DIR}
)
-generate_interface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
+generate_interface("v4_protocol_v1_2_no_extra.xml" "ns_smart_device_link_rpc::V1" "sdlrpcv1")
add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1_2_no_extra_schema.cc)
generate_interface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
add_library(MOBILE_API ${CMAKE_CURRENT_BINARY_DIR}/MOBILE_API_schema.cc)
-if(HMI_JSON_API)
- generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
-
-if(HMI_DBUS_API)
- generate_interface("QT_HMI_API.xml" "hmi_apis" "jsonrpc")
-
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h")
-
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
+generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
+add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
target_link_libraries(v4_protocol_v1_2_no_extra Utils)
target_link_libraries(MOBILE_API Utils)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index c64bb5829b..97df559ef5 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="yes"?>
<!--
-* 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
@@ -34,7 +34,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="1.6.0" date="2017-04-27">
+<interface name="Common" version="2.0.0" date="2018-09-05">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -63,6 +63,7 @@
<element name="USER_DISALLOWED" value="23"/>
<element name="TRUNCATED_DATA" value="24"/>
<element name="SAVED" value="25"/>
+ <element name="READ_ONLY" value="26"/>
</enum>
<enum name="TransportType">
@@ -76,6 +77,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -92,6 +94,27 @@
<element name="PRESET_9"/>
<element name="CUSTOM_BUTTON"/>
<element name="SEARCH"/>
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" />
+ <element name="AC" />
+ <element name="RECIRCULATE" />
+ <element name="FAN_UP" />
+ <element name="FAN_DOWN" />
+ <element name="TEMP_UP" />
+ <element name="TEMP_DOWN" />
+ <element name="DEFROST_MAX" />
+ <element name="DEFROST" />
+ <element name="DEFROST_REAR" />
+ <element name="UPPER_VENT" />
+ <element name="LOWER_VENT" />
+
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" />
+ <element name="VOLUME_DOWN" />
+ <element name="EJECT" />
+ <element name="SOURCE" />
+ <element name="SHUFFLE" />
+ <element name="REPEAT" />
</enum>
<enum name="ButtonEventMode">
@@ -200,6 +223,36 @@
<element name="SK-SK" internal_name="SK_SK">
<description>Slovak - Slovakia</description>
</element>
+ <element name="EN-IN" internal_name="EN_IN">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN">
+ <description>Hindi - India</description>
+ </element>
</enum>
<enum name="SoftButtonType">
@@ -234,6 +287,8 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
+ <element name="PROJECTION" />
+ <element name="REMOTE_CONTROL" />
</enum>
<enum name="WayPointType">
@@ -278,6 +333,20 @@
<element name="CLEAR" />
<description>Clears the media clock timer (previously done through Show->mediaClock)</description>
</enum>
+<enum name="AudioStreamingIndicator">
+ <element name="PLAY_PAUSE">
+ <description>Default playback indicator.</description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button would start the playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button would pause the current playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button would stop the current playback.</description>
+ </element>
+</enum>
<enum name="SystemContext">
<description>Enumeration that describes possible contexts the application might be in on HU.</description>
@@ -314,6 +383,7 @@
<element name="LHPLUS_PHONEMES" />
<element name="PRE_RECORDED" />
<element name="SILENCE" />
+ <element name="FILE" />
</enum>
<enum name="VrCapabilities">
@@ -502,6 +572,45 @@
<element name="turnText"/>
</enum>
+<enum name="MetadataType">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+</enum>
+
<enum name="ImageFieldName">
<element name="softButtonImage">
<description>The image field for SoftButton</description>
@@ -528,7 +637,10 @@
<description>The image field for the app icon (set by setAppIcon)</description>
</element>
<element name="graphic">
- <description>The image field for Show</description>
+ <description>The primary image field for Show</description>
+ </element>
+ <element name="secondaryGraphic">
+ <description>The secondary image field for Show</description>
</element>
<element name="showConstantTBTIcon">
<description>The primary image field for ShowConstantTBT</description>
@@ -630,6 +742,63 @@
</enum>
<!--IVI part-->
+<enum name="ElectronicParkBrakeStatus">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+</enum>
+<enum name="FuelType">
+ <element name="GASOLINE" />
+ <element name="DIESEL" />
+ <element name="CNG">
+ <description>
+ For vehicles using compressed natural gas.
+ </description>
+ </element>
+ <element name="LPG">
+ <description>
+ For vehicles using liquefied petroleum gas.
+ </description>
+ </element>
+ <element name="HYDROGEN">
+ <description>For FCEV (fuel cell electric vehicle).</description>
+ </element>
+ <element name="BATTERY">
+ <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
+ </element>
+</enum>
+
+<struct name="FuelRange">
+ <param name="type" type="Common.FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+</struct>
+
<enum name="ComponentVolumeStatus">
<description>The volume status of a vehicle component.</description>
<element name="UNKNOWN" internal_name="CVS_UNKNOWN">
@@ -652,6 +821,33 @@
</element>
</enum>
+<enum name="TPMS">
+ <element name="UNKNOWN">
+ <description>If set the status of the tire is not known.</description>
+ </element>
+ <element name="SYSTEM_FAULT">
+ <description>TPMS does not function.</description>
+ </element>
+ <element name="SENSOR_FAULT">
+ <description>The sensor of the tire does not function.</description>
+ </element>
+ <element name="LOW">
+ <description>TPMS is reporting a low tire pressure for the tire.</description>
+ </element>
+ <element name="SYSTEM_ACTIVE">
+ <description>TPMS is active and the tire pressure is monitored.</description>
+ </element>
+ <element name="TRAIN">
+ <description>TPMS is reporting that the tire must be trained.</description>
+ </element>
+ <element name="TRAINING_COMPLETE">
+ <description>TPMS reports the training for the tire is completed.</description>
+ </element>
+ <element name="NOT_TRAINED">
+ <description>TPMS reports the tire is not trained.</description>
+ </element>
+</enum>
+
<enum name="PRNDL">
<description>The selected gear.</description>
<element name="PARK">
@@ -687,6 +883,8 @@
</element>
<element name="EIGHTH">
</element>
+ <element name="UNKNOWN">
+ </element>
<element name="FAULT">
</element>
</enum>
@@ -773,6 +971,8 @@
<description>Reflects the current primary audio source (if selected).</description>
<element name="NO_SOURCE_SELECTED">
</element>
+ <element name="CD">
+ </element>
<element name="USB">
</element>
<element name="USB2">
@@ -785,6 +985,14 @@
</element>
<element name="MOBILE_APP">
</element>
+ <element name="AM">
+ </element>
+ <element name="FM">
+ </element>
+ <element name="XM">
+ </element>
+ <element name="DAB">
+ </element>
</enum>
<enum name="CompassDirection">
@@ -824,6 +1032,7 @@
<element name="BEGIN"/>
<element name="MOVE"/>
<element name="END"/>
+ <element name="CANCEL"/>
</enum>
<enum name="WarningLightStatus">
@@ -881,6 +1090,10 @@
<element name="VEHICLEDATA_ENGINETORQUE" />
<element name="VEHICLEDATA_ACCPEDAL" />
<element name="VEHICLEDATA_STEERINGWHEEL" />
+ <element name="VEHICLEDATA_TURNSIGNAL" />
+ <element name="VEHICLEDATA_FUELRANGE" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
</enum>
<enum name="WiperStatus">
@@ -934,21 +1147,35 @@
<enum name="SamplingRate">
<description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
+ <element name="8KHZ" internal_name="RATE_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="RATE_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="RATE_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="RATE_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
</enum>
<enum name="BitsPerSample">
<description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
+ <element name="8_BIT" internal_name="RATE_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="RATE_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
</enum>
<enum name="AudioType">
<description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
</enum>
<enum name="KeyboardLayout">
@@ -1005,13 +1232,13 @@
</enum>
<enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP" />
- <element name="FILE_RESUME" />
- <element name="AUTH_REQUEST" />
- <element name="AUTH_CHALLENGE" />
- <element name="AUTH_ACK" />
- <element name="PROPRIETARY" />
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP" />
+ <element name="FILE_RESUME" />
+ <element name="AUTH_REQUEST" />
+ <element name="AUTH_CHALLENGE" />
+ <element name="AUTH_ACK" />
+ <element name="PROPRIETARY" />
<element name="QUERY_APPS" />
<element name="LAUNCH_APP" />
<element name="LOCK_SCREEN_ICON_URL" />
@@ -1026,6 +1253,7 @@
<element name="EMERGENCY" />
<element name="MEDIA" />
<element name="FOTA" />
+ <element name="OEM_SPECIFIC"/>
</enum>
<enum name="ECallConfirmationStatus">
@@ -1206,23 +1434,107 @@
<element name="QUEUE" />
</enum>
+<enum name="VideoStreamingProtocol">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>
+ Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
+ </description>
+ </element>
+ <element name="RTP">
+ <description>
+ RTP facilitates the transfer of real-time data. Information provided by this protocol include
+ timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
+ and the payload format which indicates the encoded format of the data.
+ </description>
+ </element>
+ <element name="RTSP">
+ <description>
+ The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
+ Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP)
+ for media stream delivery. However, some vendors implement proprietary transport protocols.
+ </description>
+ </element>
+ <element name="RTMP">
+ <description>
+ Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
+ Macromedia for streaming audio, video and data over the Internet, between a Flash player
+ and a server. Macromedia is now owned by Adobe, which has released an incomplete version
+ of the specification of the protocol for public use.
+ </description>
+ </element>
+ <element name="WEBM">
+ <description>
+ The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
+ Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
+ </description>
+ </element>
+</enum>
+
+<enum name="VideoStreamingCodec">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>
+ A block-oriented motion-compensation-based video compression standard.
+ As of 2014 it is one of the most commonly used formats for the recording, compression, and
+ distribution of video content.
+ </description>
+ </element>
+ <element name="H265">
+ <description>
+ High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
+ compression standard, one of several potential successors to the widely used AVC (H.264 or
+ MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio
+ at the same level of video quality, or substantially improved video quality at the same
+ bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
+ </description>
+ </element>
+ <element name="Theora">
+ <description>
+ Theora is derived from the formerly proprietary VP3 codec, released into the public domain
+ by On2 Technologies. It is broadly comparable in design and bitrate efficiency to
+ MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of
+ the features present in some of these other codecs. It is comparable in open standards
+ philosophy to the BBC's Dirac codec.
+ </description>
+ </element>
+ <element name="VP8">
+ <description>
+ VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
+ Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
+ successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for
+ Open Media (AOMedia) are based on VP8.
+ </description>
+ </element>
+ <element name="VP9">
+ <description>
+ Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD)
+ and also enables lossless compression.
+ </description>
+ </element>
+</enum>
+
<!-- Policies -->
-<enum name="UpdateResult">
+ <enum name="UpdateResult">
<element name="UP_TO_DATE"/>
<element name="UPDATING" />
<element name="UPDATE_NEEDED"/>
</enum>
+
<enum name="SystemError">
<element name="SYNC_REBOOTED"/>
<element name="SYNC_OUT_OF_MEMMORY" />
</enum>
+
<enum name="StatisticsType">
<element name="iAPP_BUFFER_FULL"/>
</enum>
+
<enum name="ConsentSource">
<element name="GUI"/>
<element name="VUI" />
</enum>
+
<enum name="DeviceState">
<element name="UNKNOWN"/>
<element name="UNPAIRED"/>
@@ -1235,16 +1547,17 @@
<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>
+ <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">
@@ -1254,19 +1567,856 @@
<description>ID of application that requested this RPC.</description>
</param>
</struct>
+
+ <enum name="EntityStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ </enum>
+
+ <struct name="ExternalConsentStatus">
+ <param name="entityType" type="Integer" minvalue="0" maxvalue="128" mandatory="true">
+ <description>The entityType which status is informed by "status" param.</description>
+ </param>
+ <param name="entityID" type="Integer" minvalue="0" maxvalue="128" mandatory="true">
+ <description>The corresponding ID of entityType which status is informed by "status" param</description>
+ </param>
+ <param name="status" type="Common.EntityStatus" mandatory="true">
+ <description>Status of the ExternalConsentStatus entity: "ON" or "OFF". </description>
+ </param>
+ </struct>
<!-- End of Policies -->
+<!-- Remote Control -->
+<enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ <element name="SEAT"/>
+ <element name="AUDIO"/>
+ <element name="LIGHT"/>
+ <element name="HMI_SETTINGS"/>
+</enum>
+
+ <enum name="MassageZone">
+ <description>List possible zones of a multi-contour massage seat.</description>
+ <element name="LUMBAR">
+ <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData">
+ <description>Specify the mode of a massage zone.</description>
+ <param name="massageZone" type="MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ </struct>
+
+ <enum name="MassageCushion">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness">
+ <description>The intensity or firmness of a cushion.</description>
+ <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <enum name="SeatMemoryActionType">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction">
+ <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
+ <param name="label" type="String" maxlength="100" mandatory="false"/>
+ <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ </struct>
+
+ <enum name="SupportedSeat">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <struct name="StationIDNumber">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>PDOP.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>HDOP.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>VDOP.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Common.Dimension" mandatory="false">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="SisData">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="Common.RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="Common.RdsData" mandatory="false">
+ </param>
+ <param name="hdRadioEnable" type="Boolean" mandatory="false">
+ <description> True if the hd radio is on, false is the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
+ <description>number of HD sub-channels if available</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off</description>
+ </param>
+ <param name="state" type="Common.RadioState" mandatory="false">
+ </param>
+ <param name="sisData" type="SisData" mandatory="false">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the radio control module.</description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true" >
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true" >
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
+ </param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the climate control module.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <struct name="AudioControlData">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false.
+ If it is false, the system not only changes the audio source but also brings the default application
+ or system UI associated with the audio source to foreground.
+ If it is true, the system changes the audio source, but still keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext paramter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+
+ <struct name="RGBColor">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <enum name="LightName">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front, left and right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights an trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the RGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available light names that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+ <enum name="DistanceUnit">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ </param>
+ <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
+ </param>
+ <param name="seatControlData" type="SeatControlData" mandatory="false">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false">
+ </param>
+ </struct>
+
+<enum name="RCAccessMode">
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
+</enum>
+
+<!-- End Remote Control -->
<struct name="TextField">
- <param name="name" type="Common.TextFieldName">
+ <param name="name" type="Common.TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
- <param name="characterSet" type="Common.CharacterSet">
+ <param name="characterSet" type="Common.CharacterSet" mandatory="true">
<description>The character set that is supported in this field. See CharacterSet.</description>
</param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
<description>The number of characters in one row of this field.</description>
</param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
<description>The number of rows of this field.</description>
</param>
</struct>
@@ -1289,10 +2439,10 @@
<struct name="VehicleDataResult">
<description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType">
+ <param name="dataType" type="Common.VehicleDataType" mandatory="true">
<description>Defined published data element type.</description>
</param>
- <param name="resultCode" type="Common.VehicleDataResultCode">
+ <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
<description>Published data result code.</description>
</param>
</struct>
@@ -1340,6 +2490,9 @@
<param name="imageType" type="Common.ImageType" mandatory="true">
<description>Describes, whether it is a static or dynamic image.</description>
</param>
+ <param name="isTemplate" type="Boolean" mandatory="false">
+ <description>Optional value to specify whether it's a template image. A template image can be (re)colored by the HMI as needed by using an image pattern</description>
+ </param>
</struct>
<struct name="DeviceInfo">
@@ -1380,15 +2533,31 @@
</struct>
<struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
+ <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
<param name="text" type="String" mandatory="true" maxlength="500">
- <description>The text or phonemes to be spoken.</description>
+ <description>The text or phonemes to be spoken, or the name of an audio file to play.</description>
</param>
<param name="type" type="Common.SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
+ <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities.</description>
</param>
</struct>
+
+<struct name="TemplateColorScheme">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="Common.RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="Common.RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="Common.RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+</struct>
+
<struct name="HMIApplication">
<description>Data type containing information about application needed by HMI.</description>
<param name="appName" type="String" maxlength="100" mandatory="true">
@@ -1404,6 +2573,9 @@
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
<description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
</param>
+ <param name="secondaryDeviceInfo" type="Common.DeviceInfo" mandatory="false">
+ <description>The ID, serial number, transport type that are acquired through Secondary Transport.</description>
+ </param>
<param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
<description>Policy ID(=the appID the application registers with) of registered application.</description>
</param>
@@ -1446,6 +2618,16 @@
<description>If SDL omits this parameter - none RequestType is allowed for this app</description>
<description>(either this is a pre-registered app or such is dictated by policies).</description>
</param>
+ <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ The list of SystemRequest's requestSubTypes allowed by policies for the named application.
+ If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
+ An empty array signifies that any value of requestSubType is allowed for this app.
+ If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
+ </description>
+ </param>
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</struct>
<struct name="MenuParams">
@@ -1547,11 +2729,40 @@
</param>
</struct>
+<struct name="VideoStreamingFormat">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+</struct>
+
+<struct name="VideoConfig">
+ <description>Configuration of a video stream.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="false">
+ <description>The video protocol configuration</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="false">
+ <description>The video codec configuration</description>
+ </param>
+ <param name="width" type="Integer" mandatory="false">
+ <description>Width of the video stream, in pixels.</description>
+ </param>
+ <param name="height" type="Integer" mandatory="false">
+ <description>Height of the video stream, in pixels.</description>
+ </param>
+</struct>
+
<struct name="DisplayCapabilities">
<description>Contains information about the display capabilities.</description>
<param name="displayType" type="Common.DisplayType" mandatory="true">
<description>The type of the display. See DisplayType</description>
</param>
+ <param name="displayName" type="String" mandatory="false">
+ <description>The name of the display the app is connected to.</description>
+ </param>
<param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
<description>If there are no textfields supported, the empty array must be returned</description>
@@ -1605,12 +2816,16 @@
<param name="phoneCall" type="Boolean" mandatory="false">
<description>Availability of build in phone. True: Available, False: Not Available</description>
</param>
+ <param name="videoStreaming" type="Boolean" mandatory="false">
+ <description>Availability of built-in video streaming. True: Available, False: Not Available</description>
+ </param>
</struct>
<struct name="AudioPassThruCapabilities">
<description>
Describes different audio type configurations for PerformAudioPassThru.
e.g. 8kHz,8-bit,PCM
+ The audio is recorded in monaural.
</description>
<param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
<param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
@@ -1624,6 +2839,9 @@
<param name="fieldText" type="String" maxlength="500" mandatory="true">
<description>The text itself.</description>
</param>
+ <param name="fieldTypes" type="Common.MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the field.</description>
+ </param>
</struct>
<struct name="KeyboardProperties">
@@ -1678,69 +2896,32 @@
</struct>
<!--IVI part-->
-<struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>PDOP.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>HDOP.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>VDOP.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="false">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Common.Dimension" mandatory="false">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
- <description>The speed in KPH</description>
- </param>
-</struct>
+<enum name="TurnSignal">
+ <description>Enumeration that describes the status of the turn light indicator.</description>
+ <element name="OFF">
+ <description>Turn signal is OFF</description>
+ </element>
+ <element name="LEFT">
+ <description>Left turn signal is on</description>
+ </element>
+ <element name="RIGHT">
+ <description>Right turn signal is on</description>
+ </element>
+ <element name="BOTH">
+ <description>Both signals (left and right) are on.</description>
+ </element>
+</enum>
<struct name="SingleTireStatus">
<param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
<description>The status of component volume. See ComponentVolumeStatus.</description>
-</param>
+ </param>
+ <param name="tpms" type="TPMS" mandatory="false">
+ <description>The status of TPMS according to the particular tire.</description>
+ </param>
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000">
+ <description>The pressure value of the particular tire in kilo pascal.</description>
+ </param>
</struct>
<struct name="DIDResult">
@@ -1902,73 +3083,73 @@
</struct>
<struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
</param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
</param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
+ <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus" mandatory="true">
<description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
</param>
</struct>
<struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType">
+ <param name="emergencyEventType" type="Common.EmergencyEventType" mandatory="true">
<description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
</param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
+ <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus" mandatory="true">
<description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
</param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
+ <param name="rolloverEvent" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
+ <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="multipleEvents" type="Common.VehicleDataEventStatus">
+ <param name="multipleEvents" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
<description>References signal "PowerMode_UB".</description>
</param>
- <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus">
+ <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus" mandatory="true">
<description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
</param>
- <param name="carModeStatus" type="Common.CarModeStatus">
+ <param name="carModeStatus" type="Common.CarModeStatus" mandatory="true">
<description>References signal "CarMode". See CarMode.</description>
</param>
- <param name="powerModeStatus" type="Common.PowerModeStatus">
+ <param name="powerModeStatus" type="Common.PowerModeStatus" mandatory="true">
<description>References signal "PowerMode". See PowerMode.</description>
</param>
</struct>
@@ -1982,7 +3163,7 @@
<struct name="DateTime">
<param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
+ <description>Milliseconds </description>
</param>
<param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
<description>Seconds part of time</description>
@@ -2064,9 +3245,106 @@
</param>
</struct>
+ <struct name="NavigationCapability">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the abiulity to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="Common.ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="Common.VideoStreamingFormat" array="true" mandatory="false">
+ <description>
+ Detailed information on each format supported by this system, in its preferred order
+ (i.e. the first element in the array is most preferable to the system).
+ Each object will contain a VideoStreamingFormat that describes what can be expected.
+ </description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
+ </param>
+ </struct>
+
+ <struct name="SystemCapabilities">
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports seat controls.
+ </description >
+ </param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description> If included, the platform supports audio controls. </description >
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false">
+ <description> If included, the platform supports hmi setting controls. </description >
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false">
+ <description> If included, the platform supports light controls. </description >
+ </param>
+ </struct>
+
+ <struct name="Rectangle">
+ <param name="x" type="Float" mandatory="true">
+ <description>The X-coordinate of the user control</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The Y-coordinate of the user control</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the user control's bounding rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the user control's bounding rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect">
+ <description>Defines haptic rectangle data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Common.Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
+
</interface>
-<interface name="Buttons" version="1.2.0" date="2017-04-27">
+<interface name="Buttons" version="1.3.0" date="2017-07-18">
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
</function>
@@ -2078,6 +3356,23 @@
<description>Must be returned if the platform supports custom on-screen Presets</description>
</param>
</function>
+
+ <function name="ButtonPress" messagetype="request">
+ <description>Method is invoked when the application tries to press a button</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="Common.ButtonName" mandatory="true" />
+ <param name="buttonPressMode" type="Common.ButtonPressMode" mandatory="true" >
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="ButtonPress" messagetype="response">
+ </function>
+
<function name="OnButtonEvent" messagetype="notification">
<description>HU system must notify about every UP/DOWN event for buttons</description>
<param name="name" type="Common.ButtonName" mandatory="true"/>
@@ -2133,7 +3428,18 @@
</function>
</interface>
-<interface name="BasicCommunication" version="1.2.0" date="2017-04-27">
+<interface name="BasicCommunication" version="2.0.0" date="2018-09-05">
+ <function name="GetSystemTime" messagetype="request">
+ <description>Request from SDL to HMI to obtain current UTC time.</description>
+ </function>
+ <function name="GetSystemTime" messagetype="response">
+ <param name="systemTime" type="Common.DateTime" mandatory="true">
+ <description>Current UTC system time</description>
+ </param>
+ </function>
+ <function name="OnSystemTimeReady" messagetype="notification">
+ <description>HMI must notify SDL about readiness to provide system time.</description>
+ </function>
<function name="OnReady" messagetype="notification">
<description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
</function>
@@ -2177,13 +3483,6 @@
<description>ID of the application.</description>
</param>
</function>
- <function name="AllowDeviceToConnect" messagetype="request">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
<function name="OnDeviceChosen" messagetype="notification">
<description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
@@ -2295,7 +3594,7 @@
</function>
<function name="DialNumber" messagetype="request">
<description>Request from SDL to call a specific number.</description>
- <param name="number" type="String" maxlength="40">
+ <param name="number" type="String" maxlength="40" mandatory="true">
<description>The number to dial. Only the character + and numbers are allowed.</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -2315,6 +3614,11 @@
<param name="requestType" type="Common.RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
<description>Optional array of URL(s) for HTTP requests.</description>
</param>
@@ -2341,6 +3645,11 @@
<param name="requestType" type="Common.RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
<param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
<description>The path to file.</description>
</param>
@@ -2613,16 +3922,16 @@
</function>
</interface>
-<interface name="TTS" version="1.1.0" date="2017-04-27">
+<interface name="TTS" version="2.0.0" date="2018-09-05">
<description>RPCs for communication between TTS and SDL.</description>
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
</function>
<function name="GetCapabilities" messagetype="response">
- <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
+ <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
<description>See SpeechCapabilities</description>
</param>
- <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
+ <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="true">
<description>See PrerecordedSpeech</description>
</param>
</function>
@@ -2739,7 +4048,7 @@
</function>
</interface>
-<interface name="UI" version="1.1.0" date="2017-04-27">
+<interface name="UI" version="1.3.0" date="2018-09-05">
<function name="Alert" messagetype="request">
<description>Request from SDL to show an alert message on the display.</description>
<param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
@@ -2842,6 +4151,9 @@
<param name="menuParams" type="Common.MenuParams" mandatory="true">
<description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
</param>
+ <param name="menuIcon" type="Common.Image" mandatory="false">
+ <description>The image field for AddSubMenu</description>
+ </param>
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
@@ -2912,6 +4224,9 @@
<description>The update method of the media clock.</description>
<description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
</param>
+ <param name="audioStreamingIndicator" type="Common.AudioStreamingIndicator" mandatory="false">
+ <description>Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback.</description>
+ </param>
<param name="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
@@ -2931,7 +4246,7 @@
<description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
</param>
<param name="menuIcon" type="Common.Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
</param>
<param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
<description>On-screen keybaord configuration (if available).</description>
@@ -2978,6 +4293,9 @@
<param name="hmiCapabilities" type="Common.HMICapabilities" mandatory="false">
<description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
</param>
+ <param name="systemCapabilities" type="Common.SystemCapabilities" mandatory="false">
+ <description>Specifies system capabilities. See SystemCapabilities</description>
+ </param>
</function>
<function name="ChangeRegistration" messagetype="request">
<description>Request from SmartDeviceLink to HMI to change language for app.</description>
@@ -3054,6 +4372,8 @@
<param name="appID" type="Integer" mandatory="true">
<description>ID of application related to this RPC.</description>
</param>
+ <param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</function>
<function name="SetDisplayLayout" messagetype="response">
<param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
@@ -3230,9 +4550,25 @@
<description>ID of application related to this RPC.</description>
</param>
</function>
+ <function name="SendHapticData" messagetype="request">
+ <description>Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal ID of the application that requested this RPC.</description>
+ </param>
+ <param name="hapticRectData" type="Common.HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>
+ Array of rectangle data structures that represent the locations of all user controls present on the HMI.
+ This data should be updated if/when the application presents a new screen.
+ When a request is sent, if successful, it will replace all rectangle data previously sent through RPC.
+ Avoidance of doubt, when an empty hapticRectData, it will be clear all rectangle data previously sent through RPC.
+ </description>
+ </param>
+ </function>
+ <function name="SendHapticData" messagetype="response">
+ </function>
</interface>
-<interface name="Navigation" version="1.4.0" date="2017-04-27">
+<interface name="Navigation" version="1.5.0" date="2017-08-15">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
@@ -3347,6 +4683,27 @@
<description>Current State of TBT client</description>
</param>
</function>
+ <function name="SetVideoConfig" messagetype="request">
+ <description>Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration.</description>
+ <param name="config" type="Common.VideoConfig" mandatory="true">
+ <description>Configuration of a video stream.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetVideoConfig" messagetype="response">
+ <description>
+ Response from HMI to SDL whether the configuration is accepted.
+ In a negative response, a list of rejected parameters are supplied.
+ </description>
+ <param name="rejectedParams" type="String" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>
+ List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec".
+ This param exists only when the response is negative.
+ </description>
+ </param>
+ </function>
<function name="StartStream" messagetype="request">
<description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
<param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
@@ -3437,7 +4794,7 @@
</interface>
-<interface name="VehicleInfo" version="1.1.0" date="2017-04-27">
+<interface name="VehicleInfo" version="2.0.0" date="2018-09-05">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
</function>
@@ -3542,9 +4899,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -3581,6 +4944,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -3618,9 +4987,15 @@
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -3657,6 +5032,12 @@
<param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -3700,9 +5081,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -3739,6 +5126,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -3776,9 +5169,15 @@
<param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
@@ -3815,6 +5214,12 @@
<param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -3853,9 +5258,15 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Boolean" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Boolean" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="Boolean" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -3895,6 +5306,12 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -3930,9 +5347,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.TurnSignal" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number</description>
</param>
@@ -3972,6 +5395,12 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -4008,9 +5437,15 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
+ <param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
+ <param name="turnSignal" type="Common.TurnSignal" mandatory="false">
+ <description>See TurnSignal</description>
+ </param>
<param name="vin" type="String" maxlength="17" mandatory="false">
<description>Vehicle identification number.</description>
</param>
@@ -4026,6 +5461,9 @@
<param name="beltStatus" type="Common.BeltStatus" mandatory="false">
<description>The status of the seat belts</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
<description>The body information including power modes</description>
</param>
@@ -4069,7 +5507,7 @@
</interface>
<!-- Policies -->
-<interface name="SDL" version="1.1.0" date="2017-04-27">
+<interface name="SDL" version="1.2.0" date="2018-09-05">
<function name="ActivateApp" messagetype="request">
<param name="appID" type="Integer" mandatory="true">
</param>
@@ -4145,19 +5583,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"/>
@@ -4182,6 +5623,14 @@
If SDL omits this parameter - nothing is changed for RequestType in the policies
</description>
</param>
+ <param name="requestSubType" type="String" maxlength="100" minsize="0" maxsize="100" array="true" mandatory="false">
+ <description>
+ The list of SystemRequest's requestSubTypes allowed by policies for the named application.
+ If the app sends a requestSubType which is not specified in this list, then that request should be rejected.
+ An empty array signifies that any value of requestSubType is allowed for this app.
+ If this parameter is omitted, then a request with any value of requestSubType is now allowed for this app
+ </description>
+ </param>
</function>
<function name="OnSDLConsentNeeded" messagetype="notification">
@@ -4230,4 +5679,105 @@
<param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
</function>
</interface>
+
+<interface name="RC" version="2.0.0" date="2018-09-05">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
+ <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ <description>The module type and data to set</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" messagetype="response">
+ <description>Used to set the values of one zone and one data type within that zone</description>
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ </function>
+
+<function name="GetInteriorVehicleData" messagetype="request">
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module data to retrieve from the vehicle for that type</description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false">
+ <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleData" messagetype="response">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleDataConsent" messagetype="request">
+ <description>Sender: SDL->HMI. </description>
+ <description>HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name).
+ The driver is expected to have an ability to grant or deny the permission.</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true">
+ <description>The module type that the app requests to control.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="GetInteriorVehicleDataConsent" messagetype="response">
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>"true" - if the driver grants the permission for controlling to the named app;
+ "false" - in case the driver denies the permission for controlling to the named app.</description>
+ </param>
+</function>
+
+<function name="OnInteriorVehicleData" messagetype="notification">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+</function>
+
+<function name="OnRemoteControlSettings" messagetype="notification">
+ <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
+ <param name="allowed" type="Boolean" mandatory="false" >
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
+ <description>The remote control access mode specified by the driver via HMI.</description>
+ </param>
+</function>
+
+<function name="OnRCStatus" messagetype="notification">
+ <description>Issued by SDL to notify HMI about remote control status change on SDL</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ <param name="allocatedModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+</function>
+
+</interface>
</interfaces>
diff --git a/src/components/interfaces/Json_HMI_message_specification.txt b/src/components/interfaces/Json_HMI_message_specification.txt
index 9f5b20a3c4..f464f42351 100644
--- a/src/components/interfaces/Json_HMI_message_specification.txt
+++ b/src/components/interfaces/Json_HMI_message_specification.txt
@@ -267,6 +267,13 @@ Notifications:
{
"longPressAvailable" : true,
+ "name" : "PLAY_PAUSE",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
"name" : "SEEKLEFT",
"shortPressAvailable" : true,
"upDownAvailable" : true
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 953f270741..76fc6ef2d1 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,5367 +1,7015 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="Ford Sync RAPI" version="4.4.0" date="2017-04-27">
-
- <enum name="Result" internal_scope="base">
- <element name="SUCCESS">
- <description>The request succeeded</description>
- </element>
- <element name="UNSUPPORTED_REQUEST">
- <description>The request is not supported by Sync</description>
- </element>
- <element name="UNSUPPORTED_RESOURCE">
- <description>
- A button that was requested for subscription is not supported under the current system.
- NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHICLE_DATA_NOT_AVAILABLE.
- </description>
- </element>
- <element name="DISALLOWED">
- <description>RPC is not authorized in local policy table.</description>
- </element>
- <element name="REJECTED">
- <description>
- The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
- Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
- </description>
- </element>
- <element name="ABORTED">
- <description>
- A command was aborted, for example due to user interaction (e.g. user pressed button).
- Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
- </description>
- </element>
- <element name="IGNORED">
- <description>
- A command was ignored, because the intended result is already in effect.
- For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
- NOTE: potentially replaces SUBSCRIBED_ALREADY
- </description>
- </element>
- <element name="RETRY">
- <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
- </element>
- <element name="IN_USE">
- <description>
- The data may not be changed, because it is currently in use.
- For example when trying to delete a command set that is currently involved in an interaction.
- </description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE">
- <description>The requested vehicle data is not available on this vehicle or is not published.</description>
- </element>
- <element name="TIMED_OUT">
- <description>Overlay reached the maximum timeout and closed.</description>
- </element>
- <element name="INVALID_DATA">
- <description>
- The data sent is invalid. For example:
- Invalid Json syntax
- Parameters out of bounds (number or enum range)
- Mandatory parameters not provided
- Parameter provided with wrong type
- Invalid characters
- Empty string
- </description>
- </element>
- <element name="CHAR_LIMIT_EXCEEDED"></element>
- <element name="INVALID_ID">
- <description>
- One of the provided IDs is not valid. For example
- This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
- </description>
- </element>
- <element name="DUPLICATE_NAME">
- <description>There was a conflict with an registered name (application or menu item) or vr command</description>
- </element>
- <element name="APPLICATION_NOT_REGISTERED">
- <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
- </element>
- <element name="WRONG_LANGUAGE">
- <description>
- The requested language is currently not supported.
- Might be because of a mismatch of the currently active language on Sync and the requested language
- </description>
- </element>
- <element name="OUT_OF_MEMORY">
- <description>The system could not process the request because the necessary memory couldn't be allocated</description>
- </element>
- <element name="TOO_MANY_PENDING_REQUESTS">
- <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
- <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
- </element>
- <element name="TOO_MANY_APPLICATIONS">
- <description>There are already too many registered applications</description>
- </element>
- <element name="APPLICATION_REGISTERED_ALREADY">
- <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
- </element>
- <element name="WARNINGS">
- <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
- </element>
- <element name="GENERIC_ERROR">
- <description>Provided data is valid but something went wrong in the lower layers.</description>
- </element>
- <element name="USER_DISALLOWED">
- <description>RPC is included in a functional group explicitly blocked by the user.</description>
- </element>
- <element name="TRUNCATED_DATA">
- <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
- </element>
- <element name="UNSUPPORTED_VERSION">
- <description>Sync doesn't support the protocol that is requested by the mobile application</description>
- </element>
- <element name="VEHICLE_DATA_NOT_ALLOWED">
- <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
- </element>
- <element name="FILE_NOT_FOUND">
- <description>A specified file could not be found on Sync.</description>
- </element>
- <element name="CANCEL_ROUTE">
- <description>User selected to Cancel Route.</description>
- </element>
- <element name="SAVED">
- <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
- </element>
- <element name="INVALID_CERT">
- <description>The certificate provided during authentication is invalid.</description>
- </element>
- <element name="EXPIRED_CERT">
- <description>The certificate provided during authentication is expired.</description>
- </element>
- <element name="RESUME_FAILED">
- <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
- </element>
- </enum>
-
- <enum name="ButtonPressMode">
- <element name="LONG">
- <description>
- A button was released, after it was pressed for a long time
- Actual timing is defined by Sync and may vary
- </description>
- </element>
- <element name="SHORT">
- <description>
- A button was released, after it was pressed for a short time
- Actual timing is defined by Sync and may vary
- </description>
- </element>
- </enum>
-
- <enum name="ButtonEventMode">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
-
- <enum name="Language">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO">
- <description>Norwegian - Norway</description>
- </element>
- <element name="NL-BE" internal_name="NL_BE">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK">
- <description>Slovak - Slovakia</description>
- </element>
-</enum>
-
- <enum name="UpdateMode">
- <description>Describes how the media clock timer should behave on the platform</description>
- <element name="COUNTUP" />
- <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
- <element name="COUNTDOWN" />
- <description>Starts the media clock timer counting downwards, as in time remaining.</description>
- <element name="PAUSE" />
- <description>Pauses the media clock timer</description>
- <element name="RESUME" />
- <description>Resume the media clock timer</description>
- <element name="CLEAR" />
- <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
- </enum>
-
- <enum name="TimerMode">
- <element name="UP" />
- <description>Causes the media clock timer to update from 0:00 to a specified time</description>
- <element name="DOWN" />
- <description>Causes the media clock timer to update from a specified time to 0:00</description>
- <element name="NONE" />
- <description>Indicates to not use the media clock timer</description>
- </enum>
-
- <enum name="InteractionMode">
- <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
- <element name="MANUAL_ONLY" />
- <description>
- This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display.
- Selections are made with the OK and Seek Right and Left, Tune Up and Down buttons.
- </description>
- <element name="VR_ONLY" />
- <description>
- This mode causes the interaction to only occur using V4.
- Selections are made by saying the command.
- </description>
- <element name="BOTH" />
- <description>
- This mode causes both a VR and display selection option for an interaction.
- Selections can be made either from the menu display or by speaking the command.
- </description>
- </enum>
-
- <enum name="LayoutMode">
- <description>For touchscreen interactions, the mode of how the choices are presented.</description>
- <element name="ICON_ONLY" />
- <description>
- This mode causes the interaction to display the previous set of choices as icons.
- </description>
- <element name="ICON_WITH_SEARCH" />
- <description>
- This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.
- </description>
- <element name="LIST_ONLY" />
- <description>
- This mode causes the interaction to display the previous set of choices as a list.
- </description>
- <element name="LIST_WITH_SEARCH" />
- <description>
- This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.
- </description>
- <element name="KEYBOARD" />
- <description>
- This mode causes the interaction to immediately display a keyboard entry through the HMI.
- </description>
- </enum>
-
- <enum name="HMILevel">
- <description>Enumeraction that describes current levels of HMI.</description>
- <element name="FULL" internal_name="HMI_FULL" />
- <element name="LIMITED" internal_name="HMI_LIMITED" />
- <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
- <element name="NONE" internal_name="HMI_NONE" />
- </enum>
-
- <enum name="AudioStreamingState">
- <description>Enumeraction that describes possible states of audio streaming.</description>
- <element name="AUDIBLE" />
- <element name="ATTENUATED" />
- <element name="NOT_AUDIBLE" />
- </enum>
-
- <enum name="SystemAction">
- <description>Enumeration that describes system actions that can be triggered.</description>
- <element name="DEFAULT_ACTION">
- <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
- </element>
- <element name="STEAL_FOCUS">
- <description>App is brought into HMI_FULL.</description>
- </element>
- <element name="KEEP_CONTEXT">
- <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
- </element>
- </enum>
-
- <enum name="SystemContext">
- <description>Enumeration that describes possible contexts an app's HMI might be in.</description>
- <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
- <element name="MAIN" internal_name="SYSCTXT_MAIN">
- <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
- </element>
- <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
- <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
- </element>
- <element name="MENU" internal_name="SYSCTXT_MENU">
- <description>The system is currently displaying an in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</description>
- </element>
- <element name="ALERT" internal_name="SYSCTXT_ALERT">
- <description>Broadcast only to whichever app has an alert currently being displayed.</description>
- </element>
- </enum>
-
- <enum name="SoftButtonType">
- <description>Contains information about the SoftButton capabilities.</description>
- <element name="TEXT" internal_name="SBT_TEXT"/>
- <element name="IMAGE" internal_name="SBT_IMAGE"/>
- <element name="BOTH" internal_name="SBT_BOTH"/>
- </enum>
-
- <enum name="AppInterfaceUnregisteredReason">
- <description>Error code, which comes from sync side.</description>
-<!-- Deprecate
- <element name="USER_EXIT" />
--->
- <element name="IGNITION_OFF" />
- <element name="BLUETOOTH_OFF" />
- <element name="USB_DISCONNECTED" />
- <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
- <element name="TOO_MANY_REQUESTS" />
- <element name="DRIVER_DISTRACTION_VIOLATION" />
- <element name="LANGUAGE_CHANGE" />
- <element name="MASTER_RESET" />
- <element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" />
- <element name="PROTOCOL_VIOLATION" />
- <element name="UNSUPPORTED_HMI_RESOURCE" />
- </enum>
-
- <enum name="TriggerSource">
- <description>Indicates the source from where the command was triggered.</description>
- <element name="MENU" internal_name="TS_MENU" />
- <element name="VR" internal_name="TS_VR" />
- <element name="KEYBOARD" internal_name="TS_KEYBOARD" />
- </enum>
-
- <enum name="HmiZoneCapabilities">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT" />
- <element name="BACK" />
- </enum>
-
- <enum name="SpeechCapabilities">
- <description>Contains information about the TTS capabilities.</description>
- <element name="TEXT" internal_name="SC_TEXT"/>
- <element name="SAPI_PHONEMES" />
- <element name="LHPLUS_PHONEMES" />
- <element name="PRE_RECORDED" />
- <element name="SILENCE" />
- </enum>
-
- <enum name="VrCapabilities">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
-
- <enum name="PrerecordedSpeech">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE" />
- <element name="INITIAL_JINGLE" />
- <element name="LISTEN_JINGLE" />
- <element name="POSITIVE_JINGLE" />
- <element name="NEGATIVE_JINGLE" />
- </enum>
-
- <enum name="SamplingRate">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="SamplingRate_8KHZ"/>
- <element name="16KHZ" internal_name="SamplingRate_16KHZ"/>
- <element name="22KHZ" internal_name="SamplingRate_22KHZ"/>
- <element name="44KHZ" internal_name="SamplingRate_44KHZ"/>
- </enum>
-
- <enum name="BitsPerSample">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="BitsPerSample_8_BIT"/>
- <element name="16_BIT" internal_name="BitsPerSample_16_BIT"/>
- </enum>
-
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
- </enum>
-
- <struct name="AudioPassThruCapabilities">
- <description>
- Describes different audio type configurations for PerformAudioPassThru.
- e.g. {8kHz,8-bit,PCM}
- </description>
- <param name="samplingRate" type="SamplingRate"/>
- <param name="bitsPerSample" type="BitsPerSample"/>
- <param name="audioType" type="AudioType"/>
- </struct>
-
- <enum name="VehicleDataType">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED" />
- <element name="VEHICLEDATA_RPM" />
- <element name="VEHICLEDATA_FUELLEVEL" />
- <element name="VEHICLEDATA_FUELLEVEL_STATE" />
- <element name="VEHICLEDATA_FUELCONSUMPTION" />
- <element name="VEHICLEDATA_EXTERNTEMP" />
- <element name="VEHICLEDATA_VIN" />
- <element name="VEHICLEDATA_PRNDL" />
- <element name="VEHICLEDATA_TIREPRESSURE" />
- <element name="VEHICLEDATA_ODOMETER" />
- <element name="VEHICLEDATA_BELTSTATUS" />
- <element name="VEHICLEDATA_BODYINFO" />
- <element name="VEHICLEDATA_DEVICESTATUS" />
- <element name="VEHICLEDATA_ECALLINFO" />
- <element name="VEHICLEDATA_AIRBAGSTATUS" />
- <element name="VEHICLEDATA_EMERGENCYEVENT" />
- <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
- <element name="VEHICLEDATA_MYKEY" />
- <element name="VEHICLEDATA_BRAKING" />
- <element name="VEHICLEDATA_WIPERSTATUS" />
- <element name="VEHICLEDATA_HEADLAMPSTATUS" />
- <element name="VEHICLEDATA_BATTVOLTAGE" />
- <element name="VEHICLEDATA_ENGINETORQUE" />
- <element name="VEHICLEDATA_ACCPEDAL" />
- <element name="VEHICLEDATA_STEERINGWHEEL" />
- </enum>
-
- <enum name="ButtonName">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
- <element name="OK" />
- <element name="SEEKLEFT" />
- <element name="SEEKRIGHT" />
- <element name="TUNEUP" />
- <element name="TUNEDOWN" />
- <element name="PRESET_0" />
- <element name="PRESET_1" />
- <element name="PRESET_2" />
- <element name="PRESET_3" />
- <element name="PRESET_4" />
- <element name="PRESET_5" />
- <element name="PRESET_6" />
- <element name="PRESET_7" />
- <element name="PRESET_8" />
- <element name="PRESET_9" />
- <element name="CUSTOM_BUTTON" />
- <element name="SEARCH" />
- </enum>
-
- <enum name="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- used for Type II and CID headunits
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for Type II headunit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for CID headunit
- NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]
- :|sp : colon or space
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCKTEXT4">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- </enum>
-
- <enum name="DisplayType">
- <description>See DAES for further infos regarding the displays</description>
- <element name="CID"/>
- <element name="TYPE2" />
- <element name="TYPE5" />
- <element name="NGN" />
- <element name="GEN2_8_DMA" />
- <element name="GEN2_6_DMA" />
- <element name="MFD3" />
- <element name="MFD4" />
- <element name="MFD5" />
- <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
- <element name="SDL_GENERIC" />
- </enum>
-
- <enum name="TextFieldName">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
-
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
-
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
-
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText2">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText3">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="scrollableMessageBody">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
-
- <element name="initialInteractionText">
- <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
- </element>
-
- <element name="navigationText1">
- <description> First line of navigation text</description>
- </element>
-
- <element name="navigationText2">
- <description> Second line of navigation text</description>
- </element>
-
- <element name="ETA">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
-
- <element name="totalDistance">
- <description> Total distance to destination for navigation</description>
- </element>
-
- <element name="audioPassThruDisplayText1">
- <description> First line of text for audio pass thru</description>
- </element>
-
- <element name="audioPassThruDisplayText2">
- <description> Second line of text for audio pass thru</description>
- </element>
-
- <element name="sliderHeader">
- <description> Header text for slider</description>
- </element>
-
- <element name="sliderFooter">
- <description> Footer text for slider</description>
- </element>
-
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
-
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
-
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
-
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
-
- <element name="locationName">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
-
- <element name="locationDescription">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- <element name="addressLines">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
-
- <element name="phoneNumber">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- </enum>
-
- <enum name="ImageFieldName">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
-
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
-
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
-
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
-
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
-
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
-
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
-
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
-
- <element name="graphic">
- <description>The image field for Show</description>
- </element>
-
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
-
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
-
- <element name="locationImage">
- <description>The optional image of a destination / location</description>
- </element>
-
- </enum>
-
- <enum name="CharacterSet">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
-
- <enum name="TextAlignment">
- <description>The list of possible alignments, left, right, or centered</description>
- <element name="LEFT_ALIGNED" />
- <element name="RIGHT_ALIGNED" />
- <element name="CENTERED" />
- </enum>
-
- <enum name="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST" />
- <element name="ROUTE_ACCEPTED" />
- <element name="ROUTE_REFUSED" />
- <element name="ROUTE_CANCELLED" />
- <element name="ETA_REQUEST" />
- <element name="NEXT_TURN_REQUEST" />
- <element name="ROUTE_STATUS_REQUEST" />
- <element name="ROUTE_SUMMARY_REQUEST" />
- <element name="TRIP_STATUS_REQUEST" />
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
- </enum>
-
- <enum name="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON" />
- <element name="DD_OFF" />
- </enum>
-
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC" />
- <element name="DYNAMIC" />
- </enum>
-
- <enum name="DeliveryMode">
- <description>The mode in which the SendLocation request is sent</description>
- <element name="PROMPT" />
- <element name="DESTINATION" />
- <element name="QUEUE" />
- </enum>
-
- <struct name="Image">
- <param name="value" minlength="0" maxlength="65535" type="String">
- <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
- </param>
- <param name="imageType" type="ImageType">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="SoftButton">
- <param name="type" type="SoftButtonType">
- <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
- </param>
- <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
- <description>Optional text to display (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
- <description>
- True, if highlighted
- False, if not highlighted
- </description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535">
- <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
- <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
- </param>
- </struct>
-
- <struct name="Choice">
- <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" />
- <param name="menuName" type="String" maxlength="500" />
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" />
- <param name="image" type="Image" mandatory="false"/>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
- </param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
- </param>
- <param name="secondaryImage" type="Image" mandatory="false">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
-
- <struct name="VrHelpItem">
- <param name="text" maxlength="500" type="String">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
-
- <struct name="SyncMsgVersion">
- <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
-
- <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10">
- <description>The major version indicates versions that is not-compatible to previous versions.</description>
- </param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
- <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
- </param>
- <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
- </param>
- </struct>
-
- <enum name="GlobalProperty">
- <description>The different global properties.</description>
- <element name="HELPPROMPT">
- <description>The property helpPrompt of setGlobalProperties</description>
- </element>
- <element name="TIMEOUTPROMPT">
- <description>The property timeoutPrompt of setGlobalProperties</description>
- </element>
- <element name="VRHELPTITLE">
- <description>The property vrHelpTitle of setGlobalProperties</description>
- </element>
- <element name="VRHELPITEMS">
- <description>The property array of vrHelp of setGlobalProperties</description>
- </element>
- <element name="MENUNAME">
- <description>The property in-app menu name of setGlobalProperties</description>
- </element>
- <element name="MENUICON">
- <description>The property in-app menu icon of setGlobalProperties</description>
- </element>
- <element name="KEYBOARDPROPERTIES">
- <description>The on-screen keyboard configuration of setGlobalProperties</description>
- </element>
- </enum>
-
- <enum name="CompassDirection">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
-
- <enum name="Dimension">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and lattitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and lattitude and altitude</description>
- </element>
- </enum>
-
- <enum name="PRNDL">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="UNKNOWN">
- </element>
- <element name="FAULT">
- </element>
- </enum>
-
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- </element>
- </enum>
-
- <struct name="SingleTireStatus">
- <param name="status" type="ComponentVolumeStatus">
- <description>See ComponentVolumeStatus.</description>
- </param>
- </struct>
-
- <enum name="WarningLightStatus">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
-
- <enum name="VehicleDataNotificationStatus">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
-
- <enum name="IgnitionStableStatus">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- </element>
- </enum>
-
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- </element>
- <element name="OFF" internal_name="IS_OFF">
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- </element>
- <element name="RUN" internal_name="IS_RUN">
- </element>
- <element name="START" internal_name="IS_START">
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- </element>
- </enum>
-
- <enum name="VehicleDataEventStatus">
- <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
- <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
- </element>
- <element name="NO" internal_name="VDES_NO">
- </element>
- <element name="YES" internal_name="VDES_YES">
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- </element>
- </enum>
-
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported battery status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
-
- <enum name="PrimaryAudioSource">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- </enum>
-
- <enum name="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF" />
- <element name="AUTO_OFF" />
- <element name="OFF_MOVING" />
- <element name="MAN_INT_OFF" />
- <element name="MAN_INT_ON" />
- <element name="MAN_LOW" />
- <element name="MAN_HIGH" />
- <element name="MAN_FLICK" />
- <element name="WASH" />
- <element name="AUTO_LOW" />
- <element name="AUTO_HIGH" />
- <element name="COURTESYWIPE" />
- <element name="AUTO_ADJUST" />
- <element name="STALLED" />
- <element name="NO_DATA_EXISTS" />
- </enum>
-
- <enum name="VehicleDataStatus">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
-
- <enum name="MaintenanceModeStatus">
- <description>Reflects the status of a vehicle maintenance mode.</description>
- <element name="NORMAL" internal_name="MMS_NORMAL">
- </element>
- <element name="NEAR" internal_name="MMS_NEAR">
- </element>
- <element name="ACTIVE" internal_name="MMS_ACTIVE">
- </element>
- <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
- </element>
- </enum>
-
- <enum name="VehicleDataActiveStatus">
- <description>Reflects the status of given vehicle component.</description>
- <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
- </element>
- <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
- </element>
- <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
- </element>
- <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
- </element>
- <element name="FAULT" internal_name="VDAS_FAULT">
- </element>
- </enum>
-
- <enum name="AmbientLightStatus">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT" />
- <element name="TWILIGHT_1" />
- <element name="TWILIGHT_2" />
- <element name="TWILIGHT_3" />
- <element name="TWILIGHT_4" />
- <element name="DAY" />
- <element name="UNKNOWN" internal_name="ALS_UNKNOWN" />
- <element name="INVALID" />
- </enum>
-
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus">
- <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean">
- <description>References signal "PrkBrkActv_B_Actl".</description>
- </param>
- <param name="ignitionStableStatus" type="IgnitionStableStatus">
- <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="IgnitionStatus">
- <description>References signal "Ignition_status". See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
-
- <struct name="DeviceStatus">
- <param name="voiceRecOn" type="Boolean">
- <description>References signal "CPM_VoiceRec_STAT".</description>
- </param>
- <param name="btIconOn" type="Boolean">
- <description>References signal "BT_ICON".</description>
- </param>
- <param name="callActive" type="Boolean">
- <description>References signal "CPM_Call_Active_STAT".</description>
- </param>
- <param name="phoneRoaming" type="Boolean">
- <description>References signal "CPM_Phone_Roaming_STAT".</description>
- </param>
- <param name="textMsgAvailable" type="Boolean">
- <description>References signal "CPM_TextMsg_AVAL".</description>
- </param>
- <param name="battLevelStatus" type="DeviceLevelStatus">
- <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Stereo_Audio_Output".</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean">
- <description>References signal "CPM_Mono_Audio_Output".</description>
- </param>
- <param name="signalLevelStatus" type="DeviceLevelStatus">
- <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="PrimaryAudioSource">
- <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean">
- <description>References signal "eCall_Event".</description>
- </param>
- </struct>
-
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean">
- <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
- </param>
- <param name="highBeamsOn" type="Boolean">
- <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
- </param>
- <param name="ambientLightSensorStatus" type="AmbientLightStatus" mandatory="false">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
-
- <struct name="AppInfo">
- <description>Contains detailed information about the registered application.</description>
-
- <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
- <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
- </param>
-
- <param name="appBundleID" type="String" maxlength="256" mandatory="true">
- <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
- </param>
-
- <param name="appVersion" type="String" maxlength="256" mandatory="true">
- <description>Represents the build version number of this particular mobile app.</description>
- </param>
-
- <param name="appIcon" type="String" maxlength="500" mandatory="false">
- <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="FileType">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP" />
- <element name="GRAPHIC_JPEG" />
- <element name="GRAPHIC_PNG" />
- <element name="AUDIO_WAVE" />
- <element name="AUDIO_MP3" />
- <element name="AUDIO_AAC" />
- <element name="BINARY" />
- <element name="JSON" />
- </enum>
-
- <enum name="FuelCutoffStatus" >
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
-
- <enum name="EmergencyEventType">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
-
- <enum name="ECallConfirmationStatus">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
-
- <enum name="PowerModeQualificationStatus" >
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
-
- <enum name="PowerModeStatus">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
-
- <enum name="CarModeStatus">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
-
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="ECallConfirmationStatus">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
-
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="EmergencyEventType">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="FuelCutoffStatus">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="VehicleDataEventStatus">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
-
- <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
- 0x00 No event
- 0xFE Not supported
- 0xFF Fault
- </description>
- </param>
- <param name="multipleEvents" type="VehicleDataEventStatus">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="CarModeStatus">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="PowerModeStatus">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
-
- <struct name="MyKey">
- <param name="e911Override" type="VehicleDataStatus">
- <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
- </param>
- </struct>
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- / Ford Specific Data Items -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <enum name="VehicleDataResultCode">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS">
- <description>Individual vehicle data item / DTC / DID request or subscription successful</description>
- </element>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA">
- <description>DTC / DID request successful, however, not all active DTCs or full contents of DID location available</description>
- </element>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED">
- <description>This vehicle data item is not allowed for this app by Ford.</description>
- </element>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED">
- <description>The user has not granted access to this type of vehicle data item at this time.</description>
- </element>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID">
- <description>The ECU ID referenced is not a valid ID on the bus / system.</description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE">
- <description>The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.</description>
- </element>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED">
- <description>The vehicle data item is already subscribed.</description>
- </element>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED">
- <description>The vehicle data item cannot be unsubscribed because it is not currently subscribed.</description>
- </element>
- <element name="IGNORED" internal_name="VDRC_IGNORED">
- <description>The request for this item is ignored because it is already in progress.</description>
- </element>
- </enum>
-
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
-
- <param name="pressureTelltale" type="WarningLightStatus">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="SingleTireStatus">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="SingleTireStatus">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="SingleTireStatus">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="SingleTireStatus">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="SingleTireStatus">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="SingleTireStatus">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
-
- <struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="CompassDirection">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>HDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
- <description>VDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="actual" type="Boolean">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Dimension">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500">
- <description>The speed in KPH</description>
- </param>
- </struct>
-
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="VehicleDataType">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Published data result code.</description>
- </param>
- </struct>
-
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="VehicleDataResultCode">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data from vehicle data DID</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
-
- <struct name="StartTime">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59">
- <description>
- The hour of the media clock.
- Some radios only support a max of 19 hours. If out of range, it will be rejected.
- </description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" />
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" />
- </struct>
-
- <struct name="TextField">
- <param name="name" type="TextFieldName">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="CharacterSet">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
-
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000">
- <description>The image resolution height.</description>
- </param>
- </struct>
-
- <struct name="ImageField">
- <param name="name" type="ImageFieldName">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="ImageResolution" mandatory="false">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
-
- <struct name="TouchCoord">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
-
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
-
- <struct name="TouchEvent">
- <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
- <description>
- A touch's unique identifier. The application can track the current touch events by id.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
-
- <struct name="TouchEventCapabilities">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
-
- <struct name="ScreenParams">
- <param name="resolution" type="ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
-
- <enum name="PermissionStatus">
- <description>Enumeration that describes possible permission states of a policy table entry.</description>
- <element name="ALLOWED" internal_name="PS_ALLOWED"/>
- <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
- <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
- </enum>
-
- <struct name="HMIPermissions">
- <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true">
- <description>A set of all HMI levels that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="ParameterPermissions">
- <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
- <description>A set of all parameters that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="PermissionItem">
- <param name="rpcName" type="String" maxlength="100">
- <description>Name of the individual RPC in the policy table.</description>
- </param>
- <param name="hmiPermissions" type="HMIPermissions" />
- <param name="parameterPermissions" type="ParameterPermissions" />
- </struct>
-
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
- <description>A set of all fields that support text data. See TextField</description>
- </param>
- <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="graphicSupported" type="Boolean">
- <description>The display's persistent screen supports referencing a static or dynamic image.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="ScreenParams" mandatory="false">
- <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
-
- <!-- TODO: Add pixel density? -->
- </struct>
-
- <struct name="ButtonCapabilities">
- <description>Contains information about a button's capabilities.</description>
- <param name="name" type="ButtonName">
- <description>The name of the button. See ButtonName.</description>
- </param>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- </struct>
-
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- <param name="imageSupported" type="Boolean">
- <description>The button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities.</description>
- <param name="onScreenPresetsAvailable" type="Boolean">
- <description>Onscreen custom presets are available.</description>
- </param>
- </struct>
-
- <struct name="HMICapabilities">
- <param name="navigation" type="Boolean" mandatory="false">
- <description>Availability of build in Nav. True: Available, False: Not Available</description>
- </param>
- <param name="phoneCall" type="Boolean" mandatory="false">
- <description>Availability of build in phone. True: Available, False: Not Available </description>
- </param>
- </struct>
-
- <struct name="MenuParams">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
- <description>
- unique ID of the sub menu, the command will be added to.
- If not provided, it will be provided to the top level of the in application menu.
- </description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" type="String" maxlength="500">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </struct>
-
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
- <param name="text" minlength="0" maxlength="500" type="String">
- <description>
- The text or phonemes to speak.
- May not be empty.
- </description>
- </param>
- <param name="type" type="SpeechCapabilities">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
- </param>
- </struct>
-
- <struct name="Turn">
- <param name="navigationText" type="String" maxlength="500" mandatory="false">
- <description>Individual turn text. Must provide at least text or icon for a given turn.</description>
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- <description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
- </param>
- </struct>
-
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle, e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle, e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle, e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle, e.g. SE</description>
- </param>
- </struct>
-
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY" />
- <element name="QWERTZ" />
- <element name="AZERTY" />
- </enum>
-
- <enum name="KeyboardEvent" >
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS" />
- <element name="ENTRY_SUBMITTED" />
- <element name="ENTRY_VOICE" />
- <element name="ENTRY_CANCELLED" />
- <element name="ENTRY_ABORTED" />
- </enum>
-
- <enum name="KeypressMode">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="SINGLE_KEYPRESS">
- <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
- </element>
- <element name="QUEUE_KEYPRESSES">
- <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
- </element>
- <element name="RESEND_CURRENT_ENTRY">
- <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
- </element>
- </enum>
-
- <struct name="KeyboardProperties">
- <description>Configuration of on-screen keyboard (if available).</description>
-
- <param name="language" type="Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
-
- <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
- <description>Desired keyboard layout.</description>
- </param>
-
- <param name="keypressMode" type="KeypressMode" mandatory="false" >
- <description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- </description>
- </param>
-
- <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Array of keyboard characters to enable.</description>
- <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
- <description>If omitted, the entire keyboard will be enabled.</description>
- </param>
-
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
-
- </struct>
-
- <struct name="DeviceInfo">
- <description>Various information abount connecting device.</description>
-
- <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device model</description>
- </param>
- <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device firmware revision</description>
- </param>
- <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS</description>
- </param>
- <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS version</description>
- </param>
- <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device mobile carrier (if applicable)</description>
- </param>
- <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>Omitted if connected not via BT.</description>
- </param>
-
- </struct>
-
- <enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP" />
- <element name="FILE_RESUME" />
- <element name="AUTH_REQUEST" />
- <element name="AUTH_CHALLENGE" />
- <element name="AUTH_ACK" />
- <element name="PROPRIETARY" />
- <element name="QUERY_APPS" />
- <element name="LAUNCH_APP" />
- <element name="LOCK_SCREEN_ICON_URL" />
- <element name="TRAFFIC_MESSAGE_CHANNEL" />
- <element name="DRIVER_PROFILE" />
- <element name="VOICE_SEARCH" />
- <element name="NAVIGATION" />
- <element name="PHONE" />
- <element name="CLIMATE" />
- <element name="SETTINGS" />
- <element name="VEHICLE_DIAGNOSTICS" />
- <element name="EMERGENCY" />
- <element name="MEDIA" />
- <element name="FOTA" />
- </enum>
-
- <enum name="AppHMIType">
- <description>Enumeration listing possible app types.</description>
- <element name="DEFAULT" />
- <element name="COMMUNICATION" />
- <element name="MEDIA" />
- <element name="MESSAGING" />
- <element name="NAVIGATION" />
- <element name="INFORMATION" />
- <element name="SOCIAL" />
- <element name="BACKGROUND_PROCESS" />
- <element name="TESTING" />
- <element name="SYSTEM" />
- </enum>
-
- <enum name="PredefinedLayout" platform="documentation">
- <description>Predefined screen layout.</description>
-
- <element name="DEFAULT" rootscreen="true">
- <description>
- Default media / non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="MEDIA" rootscreen="true">
- <description>
- Default Media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
- <description>
- Default Non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="ONSCREEN_PRESETS" rootscreen="true">
- <description>
- Custom root media screen containing app-defined onscreen presets.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_FULLSCREEN_MAP" rootscreen="true" >
- <description>
- Custom root template screen containing full screen map with navigation controls.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_LIST" rootscreen="true" >
- <description>
- Custom root template screen containing video represented list.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_KEYBOARD" rootscreen="true" >
- <description>
- Custom root template screen containing video represented keyboard.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with lines of text.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing lines of text with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only text SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TILES" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing tiled SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text and SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text only SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text only SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing a large graphic and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing two graphics and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only a large graphic.
- Can be set as a root screen.
- </description>
- </element>
- </enum>
-
- <enum name="FunctionID" internal_scope="base">
- <description>Enumeration linking function names with function IDs in AppLink protocol.</description>
- <description>Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="0" />
-<!--
- Base Request / Response RPCs
- Range = 0x 0000 0001 - 0x 0000 7FFF
--->
- <element name="RegisterAppInterfaceID" value="1" hexvalue="1" />
- <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" />
- <element name="SetGlobalPropertiesID" value="3" hexvalue="3" />
- <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" />
- <element name="AddCommandID" value="5" hexvalue="5" />
- <element name="DeleteCommandID" value="6" hexvalue="6" />
- <element name="AddSubMenuID" value="7" hexvalue="7" />
- <element name="DeleteSubMenuID" value="8" hexvalue="8" />
- <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" />
- <element name="PerformInteractionID" value="10" hexvalue="A" />
- <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" />
- <element name="AlertID" value="12" hexvalue="C" />
- <element name="ShowID" value="13" hexvalue="D" />
- <element name="SpeakID" value="14" hexvalue="E" />
- <element name="SetMediaClockTimerID" value="15" hexvalue="F" />
- <element name="PerformAudioPassThruID" value="16" hexvalue="10" />
- <element name="EndAudioPassThruID" value="17" hexvalue="11" />
- <element name="SubscribeButtonID" value="18" hexvalue="12" />
- <element name="UnsubscribeButtonID" value="19" hexvalue="13" />
- <element name="SubscribeVehicleDataID" value="20" hexvalue="14" />
- <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" />
- <element name="GetVehicleDataID" value="22" hexvalue="16" />
- <element name="ReadDIDID" value="23" hexvalue="17" />
- <element name="GetDTCsID" value="24" hexvalue="18" />
- <element name="ScrollableMessageID" value="25" hexvalue="19" />
- <element name="SliderID" value="26" hexvalue="1A" />
- <element name="ShowConstantTBTID" value="27" hexvalue="1B" />
- <element name="AlertManeuverID" value="28" hexvalue="1C" />
- <element name="UpdateTurnListID" value="29" hexvalue="1D" />
- <element name="ChangeRegistrationID" value="30" hexvalue="1E" />
- <element name="GenericResponseID" value="31" hexvalue="1F" />
- <element name="PutFileID" value="32" hexvalue="20" />
- <element name="DeleteFileID" value="33" hexvalue="21" />
- <element name="ListFilesID" value="34" hexvalue="22" />
- <element name="SetAppIconID" value="35" hexvalue="23" />
- <element name="SetDisplayLayoutID" value="36" hexvalue="24" />
- <element name="DiagnosticMessageID" value="37" hexvalue="25" />
- <element name="SystemRequestID" value="38" hexvalue="26" />
- <element name="SendLocationID" value="39" hexvalue="27" />
- <element name="DialNumberID" value="40" hexvalue="28" />
- <element name="GetWayPointsID" value="45" hexvalue="2D" />
- <element name="SubscribeWayPointsID" value="46" hexvalue="2E"/>
- <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F"/>
-
-<!--
- Base Notifications
- Range = 0x 0000 8000 - 0x 0000 FFFF
--->
-
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
- <element name="OnCommandID" value="32773" hexvalue="8005" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" />
- <element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
-
-<!--
- Ford Specific Request / Response RPCs
- Range = 0x 0001 0000 - 0x 0001 7FFF
--->
-
- <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" />
- <element name="SyncPDataID" value="65537" hexvalue="10001" />
-
-<!--
- Ford Specific Notifications
- Range = 0x 0001 8000 - 0x 0001 FFFF
--->
-
- <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" />
- <element name="OnSyncPDataID" value="98305" hexvalue="18001" />
-
- </enum>
-
- <enum name="messageType">
- <description>
- Enumeration linking message types with function types in WiPro protocol.
- Assumes enumeration starts at value 0.
- </description>
- <element name="request" value="0" />
- <element name="response" value="1" />
- <element name="notification" value="2" />
- </enum>
-
- <struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
- </param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
- </param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
- </struct>
-
- <enum name="WayPointType">
- <description>Describes what kind of waypoint is requested/provided.</description>
- <element name="ALL" />
- <element name="DESTINATION" />
- </enum>
-
- <struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
- <description>Latitude of the location.</description>
- </param>
- <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
- <description>Longitude of the location.</description>
- </param>
- </struct>
-
-<struct name="OASISAddress">
- <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Name of the country (localized)</description>
- </param>
- <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
- <description>Name of country (ISO 3166-2)</description>
- </param>
- <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
- <description>(PLZ, ZIP, PIN, CAP etc.)</description>
- </param>
- <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of country (e.g. state)</description>
- </param>
- <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of e.g. state (e.g. county)</description>
- </param>
- <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. city/village</description>
- </param>
- <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. district</description>
- </param>
- <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for street, road etc.</description>
- </param>
- <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of thoroughfare e.g. house number</description>
- </param>
-</struct>
-
- <struct name="LocationDetails">
- <param name="coordinate" type="Coordinate" mandatory="false">
- <description>Latitude/Longitude of the location.</description>
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>Name of location.</description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>Location address for display purposes only</description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>Description intended location / establishment (if applicable)</description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>Phone number of location / establishment.</description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>Image / icon of intended location.</description>
- </param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
- <description>Address to be used by navigation engines for search</description>
- </param>
- </struct>
- <!-- Requests/Responses -->
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
- <description>
- Establishes an interface with a mobile application.
- Before registerAppInterface no other commands will be accepted/executed.
- </description>
-
- <param name="syncMsgVersion" type="SyncMsgVersion">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="appName" type="String" maxlength="100">
- <description>
- The mobile application name, e.g. "Ford Drive Green".
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
- Needs to be unique over all applications. Applications with the same name will be rejected.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>
- Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
- If not provided, the appName is used instead (and will be truncated if too long)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="isMediaApplication" type="Boolean">
- <description>
- Indicates if the application is a media or a non-media application.
- Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.
- </description>
- </param>
- <param name="languageDesired" type="Language" mandatory="true">
- <description>
- See Language
- Current app's expected VR+TTS language
- If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
- <description>
- See Language
- Current app's expected display language
- If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
-
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- See AppHMIType
- List of all applicable app HMI types stating which HMI classifications to be given to the app.
- </description>
- </param>
-
- <param name="hashID" type="String" maxlength="100" mandatory="false">
- <description>
- ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
- This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
- If omitted, then the previous state of an app's commands, etc. will not be restored.
- When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
- </description>
- </param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false">
- <description>
- See DeviceInfo.
- </description>
- </param>
- <param name="appID" type="String" maxlength="100" mandatory="true">
- <description>ID used to validate app with policy table entries</description>
- </param>
- <param name="appInfo" type="AppInfo" mandatory="false">
- <description>
- See AppInfo.
- </description>
- </param>
- </function>
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
- <description>The response to registerAppInterface</description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="GENERIC_ERROR"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TOO_MANY_APPLICATIONS"/>
- <element name="APPLICATION_REGISTERED_ALREADY"/>
- <element name="UNSUPPORTED_VERSION"/>
- <element name="WRONG_LANGUAGE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- <element name="RESUME_FAILED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="language" type="Language" mandatory="false">
- <description>The currently active VR+TTS language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="hmiDisplayLanguage" type="Language" mandatory="false">
- <description>The currently active display language on Sync. See "Language" for options.</description>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
-
- <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <issue creator="rs">If not used yet => remove</issue>
- <description>See HmiZoneCapabilities</description>
- </param>
-
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See SpeechCapabilities</description>
- </param>
-
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See PrerecordedSpeech</description>
- </param>
-
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See VrCapabilities</description>
- </param>
-
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="vehicleType" type="VehicleType" mandatory="false">
- <description>Specifies the vehicle's type. See VehicleType.</description>
- </param>
-
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" >
- <description>
- Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
- If a mode outside this list is requested, it will be rejected.
- </description>
- </param>
-
- <param name="hmiCapabilities" type="HMICapabilities" mandatory="false">
- <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
- </param>
-
- <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
- <description>The SmartDeviceLink version.</description>
- </param>
-
- <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
- <description>The software version of the system that implements the SmartDeviceLink core.</description>
- </param>
-
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
- <description>
- Closes an interface from a mobile application.
- After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
- Will fail, if no registerAppInterface was completed successfully before.
- </description>
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
- <description>Allows setting global properties.</description>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- The help prompt.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- Help text for a wait timeout.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>
- VR Help Title text.
- If omitted on supported displays, the default SYNC help title shall be used.
- If omitted and one or more vrHelp items are provided, the request will be rejected.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- VR Help Items.
- If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
- If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
- If omitted and a vrHelpTitle is provided, the request will be rejected.
- </description>
- </param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
- <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </param>
-
- <param name="menuIcon" type="Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
-
- <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
- <description>On-screen keybaord configuration (if available).</description>
- </param>
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
- <description>Allows resetting global properties.</description>
-
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" >
- <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
- </param>
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="request">
- <description>
- Adds a command to the in application menu.
- Either menuParams or vrCommands must be provided.
- </description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>unique ID of the command to add.</description>
- </param>
-
- <param name="menuParams" type="MenuParams" mandatory="false">
- <description>Optional sub value containing menu parameters</description>
- </param>
-
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
- <description>
- An array of strings to be used as VR synonyms for this command.
- If this array is provided, it may not be empty.
- </description>
- </param>
-
- <param name="cmdIcon" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
-
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
- <description>Deletes all commands from the in-application menu with the specified command id.</description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the command(s) to delete.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
- <description>Adds a sub menu to the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>unique ID of the sub menu to add.</description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- Position of any submenu will always be located before the return and exit options
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" maxlength="500" type="String">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
- <description>Deletes a submenu from the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
- <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
- </param>
-
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
- <description>creates interaction choice set to be used later by performInteraction</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Unique ID used for this interaction choice set.</description>
- </param>
-
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" />
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
- <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
-
- <param name="initialText" type="String" maxlength="500" >
- <description>
- Text to be displayed first.
- </description>
- </param>
-
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the intial prompt spoken to the user at the start of an interaction.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="interactionMode" type="InteractionMode">
- <description>See InteractionMode.</description>
- </param>
-
- <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
- <description>List of interaction choice set IDs to use with an interaction.</description>
- </param>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Timeout text. This text is spoken when a VR interaction times out.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
- <description>
- Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.
- Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
- If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed.
- </description>
- </param>
-
- <param name="interactionLayout" type="LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
-
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TIMED_OUT"/>
- <element name="ABORTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- Only is valid if general result is "success:true".
- </description>
- </param>
-
- <param name="manualTextEntry" type="String" maxlength="500" mandatory="false">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
-
- <param name="triggerSource" type="TriggerSource" mandatory="false">
- <description>
- See TriggerSource
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
- <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
- <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>ID of the interaction choice set to delete.</description>
- </param>
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="request">
- <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
-
- <param name="alertText1" type="String" maxlength="500" mandatory="false">
- <description>The first line of the alert text field</description>
- </param>
-
- <param name="alertText2" type="String" maxlength="500" mandatory="false">
- <description>The second line of the alert text field</description>
- </param>
-
- <param name="alertText3" type="String" maxlength="500" mandatory="false">
- <description>The optional third line of the alert text field</description>
- </param>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
- <description>
- Timeout in milliseconds.
- Typical timeouts are 3-5 seconds.
- If omitted, timeout is set to 5s.
- </description>
- </param>
-
- <param name="playTone" type="Boolean" mandatory="false">
- <description>
- Defines if tone should be played. Tone is played before TTS.
- If omitted, no tone is played.
- </description>
- </param>
-
- <param name="progressIndicator" type="Boolean" mandatory="false">
- <description>
- If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
- </description>
- </param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the displayed alert shall not have any SoftButtons.
- </description>
- </param>
-
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Amount of time (in seconds) that an app must wait before resending an alert.
- If provided, another system event or overlay currently has a higher priority than this alert.
- An app must not send an alert without waiting at least the amount of time dictated.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="request">
- <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
-
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed in a single or upper display line.
- If this text is not set, the text of mainField1 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second display line.
- If this text is not set, the text of mainField2 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second "page" first display line.
- If this text is not set, the text of mainField3 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed on the second "page" second display line.
- If this text is not set, the text of mainField4 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="alignment" type="TextAlignment" mandatory="false">
- <description>
- Specifies how mainField1 and mainField2 texts should be aligned on display.
- If omitted, texts will be centered.
- </description>
- </param>
-
- <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
- </param>
-
- <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities.
- If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
- </description>
- </param>
-
- <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- The text that should be displayed in the track field.
- If this text is not set, the text of mediaTrack stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="graphic" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic image to display in app.
- If omitted on supported displays, the displayed graphic shall not change.
- </description>
- </param>
-
- <param name="secondaryGraphic" type="Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic secondary image to display in app.
- If omitted on supported displays, the displayed secondary graphic shall not change.
- </description>
- </param>
-
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
-
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
- <description>
- App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
- If omitted on supported displays, the presets will be shown as not defined.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="request">
- <description>Speaks a text.</description>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
- <description>Sets the initial media clock value and automatic update method.</description>
-
- <param name="startTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- startTime must be provided for "COUNTUP" and "COUNTDOWN".
- startTime will be ignored for "RESUME", and "CLEAR"
- startTime can be sent for "PAUSE", in which case it will update the paused startTime
- </description>
- </param>
-
- <param name="endTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "RESUME", and "CLEAR"
- endTime can be sent for "PAUSE", in which case it will update the paused endTime
- </description>
- </param>
-
- <param name="updateMode" type="UpdateMode" mandatory="true">
- <description>
- Enumeration to control the media clock.
- In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
- </description>
- </param>
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
- <description>Starts audio pass thru session </description>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- SYNC will speak this prompt before opening the audio pass thru session.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- If omitted, then no initial prompt is spoken.
- </description>
- </param>
- <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
- <description>First line of text displayed during audio capture.</description>
- </param>
- <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
- <description>Second line of text displayed during audio capture.</description>
- </param>
- <param name="samplingRate" type="SamplingRate" mandatory="true">
- <description> This value shall be allowed at 8 khz or 16 or 22 or 44 khz.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. </description>
- </param>
- <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
- <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
- </param>
- <param name="audioType" type="AudioType" mandatory="true">
- <description>Specifies the type of audio data being requested.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="false">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="RETRY"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
- <description>When this request is invoked, the audio capture stops.</description>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
- <description>
- Subscribes to built-in HMI buttons.
- The application will be notified by the OnButtonEvent and OnButtonPress.
- To unsubscribe the notifications, use unsubscribeButton.
- </description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to subscribe.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
- <description>Unsubscribes from built-in HMI buttons.</description>
-
- <param name="buttonName" type="ButtonName">
- <description>Name of the button to unsubscribe.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request">
- <description>
- Subscribes for specific published data items.
- The data will be only sent if it has changed.
- The application will be notified by the onVehicleData notification whenever new data is available.
- To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
- </description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
-
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED" />
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
- <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED" />
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false" >
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request">
- <description>Non periodic vehicle data read request.</description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="Boolean" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including ignition status and internal temp</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="VEHICLE_DATA_NOT_ALLOWED"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
- <description>Non periodic vehicle data read request</description>
-
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
- <description>Get raw data from vehicle data DID location(s)</description>
- </param>
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="didResult" type="DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>Array of requested DID results (with data if available).</description>
- </param>
-
- </function>
-
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="request">
- <description>Vehicle module diagnostic trouble code request.</description>
-
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
-
- <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
- <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
- </param>
-
- </function>
-
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
- </param>
-
- <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
- <description>
- Array of all reported DTCs on module (ecuHeader contains information if list is truncated).
- Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
- </description>
- </param>
-
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
- <description>Non periodic vehicle diagnostic request</description>
-
- <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of target ECU.</description>
- </param>
-
- <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Length of message (in bytes).</description>
- </param>
-
- <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message.
- </description>
- </param>
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message result.
- </description>
- </param>
-
- </function>
-
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
- <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
- <param name="scrollableMessageBody" type="String" maxlength="500">
- <description>Body of text that can include newlines and tabs.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
- <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
- </description>
- </param>
- </function>
-
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="CHAR_LIMIT_EXCEEDED"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="request">
- <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
- <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
- <description>Number of selectable items on a horizontal axis</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
- <description>Initial position of slider control (cannot exceed numTicks)</description>
- </param>
- <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
- <description>Text header to display</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>
- Text footer to display (meant to display min/max threshold descriptors).
- For a static text footer, only one footer string shall be provided in the array.
- For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
- For a dynamic text footer, text array string should correlate with potential slider position index.
- If omitted on supported displays, no footer text shall be displayed.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
- <description>
- App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
- If omitted, the value is set to 10000.
- </description>
- </param>
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="SAVED"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="TIMED_OUT"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>
- Current slider value returned when saved or canceled (aborted)
- This value is only returned for resultCodes "SAVED" or "ABORTED"
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
- <description>
- Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
- Used to calculate progress bar.
- </description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
- <description>
- Distance till next maneuver (starting from) from previous maneuver.
- Used to calculate progress bar.
- </description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
- <description>
- If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
- If omitted the value will be assumed as FALSE.
- </description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>
- Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
- <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
- <param name="language" type="Language" mandatory="true">
- <description>Requested voice engine (VR+TTS) language registration</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="true">
- <description>Request display language registration</description>
- </param>
- <param name="appName" type="String" maxlength="100" mandatory="false">
- <description>Request new app name registration</description>
- </param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>Request new ttsName registration</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Request new VR synonyms registration</description>
- </param>
-
-</function>
-
-
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description>
- true, if successful
- false, if failed
- </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
- <description>
- Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
- Currently, only resultCode INVALID_DATA is used.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="INVALID_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="request">
- <description>
- Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art
- Not supported on first generation SYNC vehicles.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- <param name="fileType" type="FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
-
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
-
- <param name="systemFile" type="Boolean" defvalue="false" mandatory="false" >
- <description>
- Indicates if the file is meant to be passed thru core to elsewhere on the system.
- If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core.
- If omitted, the value will be set to false.
- </description>
- </param>
-
- <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional length in bytes for resuming partial data chunks
- If offset is set to 0, then length is the total length of the file to be downloaded
- </description>
- </param>
-
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="response">
- <description>Response is sent, when the file data was copied (success case). Or when an error occured.</description>
- <description>Not supported on First generation SYNC vehicles. </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>
- Provides the total local space available in SDL Core for the registered app.
- If the transfer has systemFile enabled, then the value will be set to 0 automatically.
- </description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
- <description>
- Used to delete a file resident on the SYNC module in the app's local cache.
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="500" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
- <description>
- Response is sent, when the file data was deleted (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="request">
- <description>
- Requests the current list of resident filenames for the registered app.
- Not supported on first generation SYNC vehicles.
- </description>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="response">
- <description>
- Returns the current list of resident filenames for the registered app along with the current space available
- Not supported on First generation SYNC vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>
- An array of all filenames resident on SYNC for the given registered app.
- If omitted, then no files currently reside on the system.
- </description>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Provides the total local space available on SYNC for the registered app.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
- <description>
- Used to set existing local file on SYNC as the app's icon
- Not supported on first generation SYNC vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="500" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
- <description>
- Response is sent, when the file data was copied (success case). Or when an error occured.
- Not supported on First generation SYNC vehicles.
- </description>
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
- <description>
- Used to set an alternate display layout.
- If not sent, default screen for given platform will be shown
- </description>
-
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
-
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
-
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" >
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>
- The type of system request.
- Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
- </description>
- </param>
- <param name="fileName" type="String" maxlength="255" mandatory="false">
- <description>
- Filename of HTTP data to store in predefined system staging area.
- Mandatory if requestType is HTTP.
- PROPRIETARY requestType should ignore this parameter.
- </description>
- </param>
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_CERT"/>
- <element name="EXPIRED_CERT"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- <element name="TIMED_OUT"/>
- <element name="IGNORED"/>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="request">
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>
- Name / title of intended location
- </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>
- Description intended location / establishment (if applicable)
- </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>
- Location address (if applicable)
- </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>
- Phone number of intended location / establishment (if applicable)
- </description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>
- Image / icon of intended location (if applicable and supported)
- </description>
- </param>
-
- <param name="timeStamp" type="DateTime" mandatory="false">
- <description>
- timestamp in ISO 8601 format
- </description>
- </param>
-
- <param name="address" type="OASISAddress" mandatory="false">
- <description>Address to be used for setting destination</description>
- </param>
- <param name="deliveryMode" type="DeliveryMode" mandatory="false">
- <description>Defines the mode of prompt for user</description>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
- <description>Dials a phone number and switches to phone application.</description>
-
- <param name="number" type="String" maxlength="40">
- <description>
- Phone number is a string, which can be up to 40 chars.
- All characters shall be stripped from string except digits 0-9 and * # , ; +
- </description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description>true, if successful</description>
- <description>false, if failed</description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <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">
- <param name="hmiLevel" type="HMILevel">
- <description>See HMILevel</description>
- </param>
-
- <param name="audioStreamingState" type="AudioStreamingState">
- <description>See AudioStreamingState</description>
- </param>
-
- <param name="systemContext" type="SystemContext">
- <description>See SystemContext</description>
- </param>
- </function>
-
- <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
- <param name="reason" type="AppInterfaceUnregisteredReason">
- <description>See AppInterfaceUnregisteredReason</description>
- </param>
- </function>
-
- <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
- <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonEventMode" type="ButtonEventMode">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
- <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
- </param>
- </function>
-
- <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification">
- <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonPressMode" type="ButtonPressMode">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
- <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
- </param>
- </function>
-
- <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification">
- <description>Callback for the periodic and non periodic vehicle data read function.</description>
- <param name="gps" type="GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number.</description>
- </param>
- <param name="prndl" type="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
-
- <!-- Ford Specific Vehicle Data -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Vehicle Data -->
-
- </function>
-
- <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
- <description>Command ID, which is related to a specific menu entry</description>
- </param>
-
- <param name="triggerSource" type="TriggerSource">
- <description>See TriggerSource</description>
- </param>
- </function>
-
- <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
- <description>Provides applications with notifications specific to the current TBT client status on the module</description>
- <param name="state" type="TBTState">
- <description>Current State of TBT client</description>
- </param>
- </function>
-
- <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
- <description>Provides driver distraction state to mobile applications</description>
- <param name="state" type="DriverDistractionState">
- <description>Current State of Driver Distraction</description>
- </param>
- </function>
-
- <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
- <description>Provides update to app of which policy-table-enabled functions are available</description>
- <param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true">
- <description>Change in permissions for a given set of RPCs</description>
- </param>
- </function>
-
- <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
- <description>Binary data is in binary part of hybrid msg</description>
- </function>
-
- <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
- <param name="language" type="Language">
- <description>Current SYNC voice engine (VR+TTS) language</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language">
- <description>Current display language</description>
- </param>
- </function>
-
- <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" >
-
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
-
- <param name="event" type="KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
-
- <param name="data" type="String" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
-
- </function>
-
- <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" >
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
-
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" >
- <description>
- An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
- Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
- </description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" mandatory="false">
- <description>
- Optional URL for HTTP requests.
- If blank, the binary data shall be forwarded to the app.
- If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional timeout for HTTP requests
- Required if a URL is provided
- </description>
- </param>
- <param name="fileType" type="FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- </function>
-
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
- <description>
- Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
- Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
- </description>
- <param name="hashID" type="String" maxlength="100" mandatory="true">
- <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
- </param>
- </function>
-
- <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 -->
-<!-- ~~~~~~~~~~~~~~~~~~ -->
-
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" >
- <description>
- Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
- Legacy / v1 Protocol implementation; use SyncPData instead.
- *** DEPRECATED ***
- </description>
-
- <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>Contains base64 encoded string of SyncP packets.</description>
- <todo>What is the maxlength?</todo>
- </param>
- </function>
-
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
-<!-- Deprecating - covered by SystemRequest
- <function name="SyncPData" functionID="SyncPDataID" messagetype="request" >
- <description>
- Allows binary data in the form of SyncP packets to be sent to the SYNC module.
- Binary data is in binary part of hybrid msg.
- </description>
- </function>
-
- <function name="SyncPData" functionID="SyncPDataID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
--->
-
- <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" >
- <description>
- Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
- Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
- *** DEPRECATED ***
- </description>
- <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" mandatory="true" array="true">
- <description>Contains base64 encoded string of SyncP packets.</description>
- </param>
- <param name="URL" type="String" maxlength="1000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded to the provided URL.
- </description>
- </param>
- <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
- </description>
- </param>
- </function>
-
-
-<!-- Deprecating - covered by OnSystemRequest
- <function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
- <description>
- Callback including binary data of any SyncP packets that SYNC needs to send back to the mobile device.
- Responds to SyncPData.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="URL" type="String" maxlength="1000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded to the provided URL.
- </description>
- </param>
- <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
- </description>
- </param>
-
- </function>
--->
-</interface>
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="SmartDeviceLink RAPI" version="5.0.0" minVersion="1.0" date="2018-10-03">
+ <enum name="Result" internal_scope="base" since="1.0">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by the headunit</description>
+ </element>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>
+ A button that was requested for subscription is not supported under the current system.
+ </description>
+ </element>
+ <element name="DISALLOWED">
+ <description>RPC is not authorized in local policy table.</description>
+ </element>
+ <element name="REJECTED">
+ <description>
+ The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
+ Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
+ </description>
+ </element>
+ <element name="ABORTED">
+ <description>
+ A command was aborted, for example due to user interaction (e.g. user pressed button).
+ Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
+ </description>
+ </element>
+ <element name="IGNORED">
+ <description>
+ A command was ignored, because the intended result is already in effect.
+ For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
+ NOTE: potentially replaces SUBSCRIBED_ALREADY
+ </description>
+ </element>
+ <element name="RETRY">
+ <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
+ </element>
+ <element name="IN_USE">
+ <description>
+ The data may not be changed, because it is currently in use.
+ For example when trying to delete a command set that is currently involved in an interaction.
+ </description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" since="2.0">
+ <description>The requested vehicle data is not available on this vehicle or is not published.</description>
+ </element>
+ <element name="TIMED_OUT">
+ <description>Overlay reached the maximum timeout and closed.</description>
+ </element>
+ <element name="INVALID_DATA">
+ <description>
+ The data sent is invalid. For example:
+ Invalid Json syntax
+ Parameters out of bounds (number or enum range)
+ Mandatory parameters not provided
+ Parameter provided with wrong type
+ Invalid characters
+ Empty string
+ </description>
+ </element>
+ <element name="CHAR_LIMIT_EXCEEDED"></element>
+ <element name="INVALID_ID">
+ <description>
+ One of the provided IDs is not valid. For example
+ This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
+ </description>
+ </element>
+ <element name="DUPLICATE_NAME">
+ <description>There was a conflict with an registered name (application or menu item) or vr command</description>
+ </element>
+ <element name="APPLICATION_NOT_REGISTERED">
+ <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
+ </element>
+ <element name="WRONG_LANGUAGE">
+ <description>
+ The requested language is currently not supported.
+ Might be because of a mismatch of the currently active language on the headunit and the requested language
+ </description>
+ </element>
+ <element name="OUT_OF_MEMORY">
+ <description>The system could not process the request because the necessary memory couldn't be allocated</description>
+ </element>
+ <element name="TOO_MANY_PENDING_REQUESTS">
+ <description>There are too many requests pending (means, that the response has not been delivered, yet).There may be a maximum of 1000 pending requests at a time.</description>
+ </element>
+ <element name="TOO_MANY_APPLICATIONS">
+ <description>There are already too many registered applications</description>
+ </element>
+ <element name="APPLICATION_REGISTERED_ALREADY">
+ <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
+ </element>
+ <element name="WARNINGS">
+ <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
+ </element>
+ <element name="GENERIC_ERROR">
+ <description>Provided data is valid but something went wrong in the lower layers.</description>
+ </element>
+ <element name="USER_DISALLOWED" since="2.0">
+ <description>RPC is included in a functional group explicitly blocked by the user.</description>
+ </element>
+ <element name="TRUNCATED_DATA">
+ <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION" since="2.0">
+ <description>Sync doesn't support the protocol that is requested by the mobile application</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_ALLOWED" since="2.0">
+ <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
+ </element>
+ <element name="FILE_NOT_FOUND" since="3.0">
+ <description>A specified file could not be found on the headunit.</description>
+ </element>
+ <element name="CANCEL_ROUTE">
+ <description>User selected to Cancel Route.</description>
+ </element>
+ <element name="SAVED" since="2.0">
+ <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
+ </element>
+ <element name="INVALID_CERT" since="3.0">
+ <description>The certificate provided during authentication is invalid.</description>
+ </element>
+ <element name="EXPIRED_CERT" since="3.0">
+ <description>The certificate provided during authentication is expired.</description>
+ </element>
+ <element name="RESUME_FAILED" since="3.0">
+ <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
+ </element>
+ <element name="DATA_NOT_AVAILABLE" since="4.5">
+ <description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
+ </element>
+ <element name="READ_ONLY" since="4.5">
+ <description>The value being set is read only</description>
+ </element>
+ <element name="CORRUPTED_DATA" since="5.0">
+ <description>The data sent failed to pass CRC check in receiver end</description>
+ </element>
+ </enum>
+
+ <enum name="ButtonPressMode" since="1.0">
+ <element name="LONG">
+ <description>
+ A button was released, after it was pressed for a long time
+ Actual timing is defined by the headunit and may vary
+ </description>
+ </element>
+ <element name="SHORT">
+ <description>
+ A button was released, after it was pressed for a short time
+ Actual timing is defined by the headunit and may vary
+ </description>
+ </element>
+ </enum>
+
+ <enum name="ButtonEventMode" since="1.0">
+ <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" since="1.0">
+ <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" since="2.0">
+ <description>German - Germany</description>
+ </element>
+ <element name="ES-ES" internal_name="ES_ES" since="2.0">
+ <description>Spanish - Spain</description>
+ </element>
+ <element name="EN-GB" internal_name="EN_GB" since="2.0">
+ <description>English - GB</description>
+ </element>
+ <element name="RU-RU" internal_name="RU_RU" since="2.0">
+ <description>Russian - Russia</description>
+ </element>
+ <element name="TR-TR" internal_name="TR_TR" since="2.0">
+ <description>Turkish - Turkey</description>
+ </element>
+ <element name="PL-PL" internal_name="PL_PL" since="2.0">
+ <description>Polish - Poland</description>
+ </element>
+ <element name="FR-FR" internal_name="FR_FR" since="2.0">
+ <description>French - France</description>
+ </element>
+ <element name="IT-IT" internal_name="IT_IT" since="2.0">
+ <description>Italian - Italy</description>
+ </element>
+ <element name="SV-SE" internal_name="SV_SE" since="2.0">
+ <description>Swedish - Sweden</description>
+ </element>
+ <element name="PT-PT" internal_name="PT_PT" since="2.0">
+ <description>Portuguese - Portugal</description>
+ </element>
+ <element name="NL-NL" internal_name="NL_NL" since="2.0">
+ <description>Dutch (Standard) - Netherlands</description>
+ </element>
+ <element name="EN-AU" internal_name="EN_AU" since="2.0">
+ <description>English - Australia</description>
+ </element>
+ <element name="ZH-CN" internal_name="ZH_CN" since="2.0">
+ <description>Mandarin - China</description>
+ </element>
+ <element name="ZH-TW" internal_name="ZH_TW" since="2.0">
+ <description>Mandarin - Taiwan</description>
+ </element>
+ <element name="JA-JP" internal_name="JA_JP" since="2.0">
+ <description>Japanese - Japan</description>
+ </element>
+ <element name="AR-SA" internal_name="AR_SA" since="2.0">
+ <description>Arabic - Saudi Arabia</description>
+ </element>
+ <element name="KO-KR" internal_name="KO_KR" since="2.0">
+ <description>Korean - South Korea</description>
+ </element>
+ <element name="PT-BR" internal_name="PT_BR" since="2.0">
+ <description>Portuguese - Brazil</description>
+ </element>
+ <element name="CS-CZ" internal_name="CS_CZ" since="2.0">
+ <description>Czech - Czech Republic</description>
+ </element>
+ <element name="DA-DK" internal_name="DA_DK" since="2.0">
+ <description>Danish - Denmark</description>
+ </element>
+ <element name="NO-NO" internal_name="NO_NO" since="2.0">
+ <description>Norwegian - Norway</description>
+ </element>
+ <element name="NL-BE" internal_name="NL_BE" since="2.0">
+ <description>Dutch (Flemish) - Belgium</description>
+ </element>
+ <element name="EL-GR" internal_name="EL_GR" since="2.0">
+ <description>Greek - Greece</description>
+ </element>
+ <element name="HU-HU" internal_name="HU_HU" since="2.0">
+ <description>Hungarian - Hungary</description>
+ </element>
+ <element name="FI-FI" internal_name="FI_FI" since="2.0">
+ <description>Finnish - Finland</description>
+ </element>
+ <element name="SK-SK" internal_name="SK_SK" since="2.0">
+ <description>Slovak - Slovakia</description>
+ </element>
+ <element name="EN-IN" internal_name="EN_IN" since="4.5">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH" since="4.5">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA" since="4.5">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL" since="4.5">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO" since="4.5">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA" since="4.5">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID" since="4.5">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN" since="4.5">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY" since="4.5">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN" since="4.5">
+ <description>Hindi - India</description>
+ </element>
+ </enum>
+
+ <enum name="UpdateMode" since="1.0">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP" >
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ </element>
+ <element name="COUNTDOWN" >
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ </element>
+ <element name="PAUSE" >
+ <description>Pauses the media clock timer</description>
+ </element>
+ <element name="RESUME" >
+ <description>Resume the media clock timer</description>
+ </element>
+ <element name="CLEAR" >
+ <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
+ </element>
+ </enum>
+
+ <enum name="TimerMode" since="1.0">
+ <element name="UP" >
+ <description>Causes the media clock timer to update from 0:00 to a specified time</description>
+ </element>
+ <element name="DOWN" >
+ <description>Causes the media clock timer to update from a specified time to 0:00</description>
+ </element>
+ <element name="NONE" >
+ <description>Indicates to not use the media clock timer</description>
+ </element>
+ </enum>
+
+ <enum name="InteractionMode" since="1.0">
+ <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
+ <element name="MANUAL_ONLY" >
+ <description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction.</description>
+ </element>
+ <element name="VR_ONLY" >
+ <description>This mode causes the interaction to only occur using the headunits VR system. Selections are made by saying the command.</description>
+ </element>
+ <element name="BOTH" >
+ <description>This mode causes both a VR and display selection option for an interaction. The user will first be asked via Voice Interaction (if available). If this is unsuccessful, the system will switch to manual input.</description>
+ </element>
+ </enum>
+
+ <enum name="LayoutMode" since="3.0">
+ <description>For touchscreen interactions, the mode of how the choices are presented.</description>
+ <element name="ICON_ONLY" >
+ <description>This mode causes the interaction to display the previous set of choices as icons.</description>
+ </element>
+ <element name="ICON_WITH_SEARCH" >
+ <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
+ </element>
+ <element name="LIST_ONLY" >
+ <description>This mode causes the interaction to display the previous set of choices as a list.</description>
+ </element>
+ <element name="LIST_WITH_SEARCH" >
+ <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
+ </element>
+ <element name="KEYBOARD" >
+ <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
+ </element>
+ </enum>
+
+ <enum name="HMILevel" since="1.0">
+ <description>Enumeration that describes current levels of HMI.</description>
+ <element name="FULL" internal_name="HMI_FULL" />
+ <element name="LIMITED" internal_name="HMI_LIMITED" />
+ <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
+ <element name="NONE" internal_name="HMI_NONE" />
+ </enum>
+
+ <enum name="AudioStreamingState" since="1.0">
+ <description>Enumeration that describes possible states of audio streaming.</description>
+ <element name="AUDIBLE" />
+ <element name="ATTENUATED" />
+ <element name="NOT_AUDIBLE" />
+ </enum>
+
+ <enum name="SystemAction" since="1.0">
+ <description>Enumeration that describes system actions that can be triggered.</description>
+ <element name="DEFAULT_ACTION">
+ <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
+ </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" since="1.0">
+ <description>Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN">
+ <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
+ </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="VideoStreamingState" since="5.0">
+ <description>Enumeration that describes possible states of video streaming. </description>
+ <element name="STREAMABLE" />
+ <element name="NOT_STREAMABLE" />
+ </enum>
+
+ <enum name="SoftButtonType" since="2.0">
+ <description>Contains information about the SoftButton capabilities.</description>
+ <element name="TEXT" internal_name="SBT_TEXT"/>
+ <element name="IMAGE" internal_name="SBT_IMAGE"/>
+ <element name="BOTH" internal_name="SBT_BOTH"/>
+ </enum>
+
+ <enum name="AppInterfaceUnregisteredReason" since="1.0">
+ <description>Error code, which comes from the module side.</description>
+ <!-- Deprecate
+ <element name="USER_EXIT" />
+ -->
+ <element name="IGNITION_OFF" />
+ <element name="BLUETOOTH_OFF" />
+ <element name="USB_DISCONNECTED" />
+ <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
+ <element name="TOO_MANY_REQUESTS" />
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="LANGUAGE_CHANGE" />
+ <element name="MASTER_RESET" />
+ <element name="FACTORY_DEFAULTS" />
+ <element name="APP_UNAUTHORIZED" since="2.0" />
+ <element name="PROTOCOL_VIOLATION" since="4.0" />
+ <element name="UNSUPPORTED_HMI_RESOURCE" since="4.1" />
+ </enum>
+
+ <enum name="TriggerSource" since="1.0">
+ <description>Indicates the source from where the command was triggered.</description>
+ <element name="MENU" internal_name="TS_MENU" />
+ <element name="VR" internal_name="TS_VR" />
+ <element name="KEYBOARD" internal_name="TS_KEYBOARD" since="3.0" />
+ </enum>
+
+ <enum name="HmiZoneCapabilities" since="1.0">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT" />
+ <element name="BACK" />
+ </enum>
+
+ <enum name="SpeechCapabilities" since="1.0">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT" internal_name="SC_TEXT"/>
+ <element name="SAPI_PHONEMES" />
+ <element name="LHPLUS_PHONEMES" />
+ <element name="PRE_RECORDED" />
+ <element name="SILENCE" />
+ <element name="FILE" since="5.0" />
+ </enum>
+
+ <enum name="VrCapabilities" since="1.0">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT"/>
+ </enum>
+
+ <enum name="PrerecordedSpeech" since="1.0">
+ <description>Contains a list of prerecorded speech items present on the platform.</description>
+ <element name="HELP_JINGLE" />
+ <element name="INITIAL_JINGLE" />
+ <element name="LISTEN_JINGLE" />
+ <element name="POSITIVE_JINGLE" />
+ <element name="NEGATIVE_JINGLE" />
+ </enum>
+
+ <enum name="SamplingRate" since="2.0">
+ <description>Describes different sampling options for PerformAudioPassThru.</description>
+ <element name="8KHZ" internal_name="SamplingRate_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="SamplingRate_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="SamplingRate_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="SamplingRate_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
+ </enum>
+
+ <enum name="BitsPerSample" since="2.0">
+ <description>Describes different quality options for PerformAudioPassThru.</description>
+ <element name="8_BIT" internal_name="BitsPerSample_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="BitsPerSample_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
+ </enum>
+
+ <enum name="AudioType" since="2.0">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
+ </enum>
+
+ <struct name="AudioPassThruCapabilities" since="2.0">
+ <description>
+ Describes different audio type configurations for PerformAudioPassThru.
+ e.g. {8kHz,8-bit,PCM}
+ The audio is recorded in monaural.
+ </description>
+ <param name="samplingRate" type="SamplingRate" mandatory="true"/>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
+ <param name="audioType" type="AudioType" mandatory="true"/>
+ </struct>
+
+ <enum name="VehicleDataType" since="2.0">
+ <description>Defines the data types that can be published and subscribed to.</description>
+ <element name="VEHICLEDATA_GPS">
+ <description>Notifies GPSData may be subscribed</description>
+ </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" />
+ <element name="VEHICLEDATA_TURNSIGNAL" since="5.0" />
+ <element name="VEHICLEDATA_FUELRANGE" since="5.0" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
+ </enum>
+
+ <enum name="ButtonName" since="1.0">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
+ <element name="OK" />
+ <element name="PLAY_PAUSE" since="5.0">
+ <description>
+ The button name for the physical Play/Pause
+ toggle that can be used by media apps.
+ </description>
+ <warning>
+ Please use the physical OK button in order to
+ use a Play/Pause toggle for versions &lt; 4.5.0.
+ </warning>
+ </element>
+ <element name="SEEKLEFT" />
+ <element name="SEEKRIGHT" />
+ <element name="TUNEUP" />
+ <element name="TUNEDOWN" />
+ <element name="PRESET_0" />
+ <element name="PRESET_1" />
+ <element name="PRESET_2" />
+ <element name="PRESET_3" />
+ <element name="PRESET_4" />
+ <element name="PRESET_5" />
+ <element name="PRESET_6" />
+ <element name="PRESET_7" />
+ <element name="PRESET_8" />
+ <element name="PRESET_9" />
+ <element name="CUSTOM_BUTTON" />
+ <element name="SEARCH" />
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" since="4.5" />
+ <element name="AC" since="4.5" />
+ <element name="RECIRCULATE" since="4.5" />
+ <element name="FAN_UP" since="4.5" />
+ <element name="FAN_DOWN" since="4.5" />
+ <element name="TEMP_UP" since="4.5" />
+ <element name="TEMP_DOWN" since="4.5" />
+ <element name="DEFROST_MAX" since="4.5" />
+ <element name="DEFROST" since="4.5" />
+ <element name="DEFROST_REAR" since="4.5" />
+ <element name="UPPER_VENT" since="4.5" />
+ <element name="LOWER_VENT" since="4.5" />
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" since="4.5" />
+ <element name="VOLUME_DOWN" since="4.5" />
+ <element name="EJECT" since="4.5" />
+ <element name="SOURCE" since="4.5" />
+ <element name="SHUFFLE" since="4.5" />
+ <element name="REPEAT" since="4.5" />
+ </enum>
+
+ <enum name="MediaClockFormat" since="1.0">
+ <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" since="2.0">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ used for GEN1.1 MFD3/4/5 headunits
+ </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" since="2.0">
+ <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" deprecated="true" since="5.0">
+ <description>See DAES for further infos regarding the displays</description>
+ <element name="CID"/>
+ <element name="TYPE2" />
+ <element name="TYPE5" />
+ <element name="NGN" />
+ <element name="GEN2_8_DMA" since="3.0" />
+ <element name="GEN2_6_DMA" since="3.0" />
+ <element name="MFD3" since="2.0" />
+ <element name="MFD4" since="2.0" />
+ <element name="MFD5" since="2.0" />
+ <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" since="3.0" />
+ <element name="SDL_GENERIC" since="4.0" />
+ <history>
+ <enum name="DisplayType" since="1.0" until="5.0"/>
+ </history>
+ </enum>
+
+ <enum name="TextFieldName" since="1.0">
+ <element name="mainField1">
+ <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <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" since="2.0">
+ <description>The second line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="alertText3" since="2.0">
+ <description>The third line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="scrollableMessageBody" since="2.0">
+ <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
+ </element>
+
+ <element name="initialInteractionText" since="2.0">
+ <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
+ </element>
+
+ <element name="navigationText1" since="2.0">
+ <description> First line of navigation text</description>
+ </element>
+
+ <element name="navigationText2" since="2.0">
+ <description> Second line of navigation text</description>
+ </element>
+
+ <element name="ETA" since="2.0">
+ <description> Estimated Time of Arrival time for navigation</description>
+ </element>
+
+ <element name="totalDistance" since="2.0">
+ <description> Total distance to destination for navigation</description>
+ </element>
+
+ <element name="audioPassThruDisplayText1" since="2.0">
+ <description> First line of text for audio pass thru</description>
+ </element>
+
+ <element name="audioPassThruDisplayText2" since="2.0">
+ <description> Second line of text for audio pass thru</description>
+ </element>
+
+ <element name="sliderHeader" since="2.0">
+ <description> Header text for slider</description>
+ </element>
+
+ <element name="sliderFooter" since="2.0">
+ <description> Footer text for slider</description>
+ </element>
+
+ <element name="menuName">
+ <description> Primary text for Choice</description>
+ </element>
+
+ <element name="secondaryText">
+ <description> Secondary text for Choice</description>
+ </element>
+
+ <element name="tertiaryText">
+ <description> Tertiary text for Choice</description>
+ </element>
+
+ <element name="menuTitle">
+ <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </element>
+
+ <element name="locationName" since="4.0">
+ <description> Optional name / title of intended location for SendLocation.</description>
+ </element>
+
+ <element name="locationDescription" since="4.0">
+ <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
+ </element>
+
+ <element name="addressLines" since="4.0">
+ <description> Optional location address (if applicable) for SendLocation.</description>
+ </element>
+
+ <element name="phoneNumber" since="4.0">
+ <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
+ </element>
+
+ </enum>
+
+ <enum name="ImageFieldName" since="3.0">
+ <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 primary image field for Show</description>
+ </element>
+
+ <element name="secondaryGraphic" since="5.0">
+ <description>The secondary image field for Show</description>
+ </element>
+
+ <element name="showConstantTBTIcon">
+ <description>The primary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="showConstantTBTNextTurnIcon">
+ <description>The secondary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="locationImage" since="4.0">
+ <description>The optional image of a destination / location</description>
+ </element>
+
+ </enum>
+
+ <enum name="CharacterSet" since="1.0">
+ <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" since="1.0">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED" />
+ <element name="RIGHT_ALIGNED" />
+ <element name="CENTERED" />
+ </enum>
+
+ <enum name="TBTState" since="2.0">
+ <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
+ <element name="ROUTE_UPDATE_REQUEST" />
+ <element name="ROUTE_ACCEPTED" />
+ <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" since="2.0">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON" />
+ <element name="DD_OFF" />
+ </enum>
+
+ <enum name="ImageType" since="2.0">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC" />
+ <element name="DYNAMIC" />
+ </enum>
+
+ <enum name="DeliveryMode" since="4.1">
+ <description>The mode in which the SendLocation request is sent</description>
+ <element name="PROMPT" />
+ <element name="DESTINATION" />
+ <element name="QUEUE" />
+ </enum>
+
+ <enum name="VideoStreamingProtocol" since="4.5">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
+ </element>
+ <element name="RTP">
+ <description>RTP facilitates the transfer of real-time data. Information provided by this protocol include timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) and the payload format which indicates the encoded format of the data.</description>
+ </element>
+ <element name="RTSP">
+ <description>The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. </description>
+ </element>
+ <element name="RTMP">
+ <description> Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use.</description>
+ </element>
+ <element name="WEBM">
+ <description>The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.</description>
+ </element>
+ </enum>
+
+ <enum name="VideoStreamingCodec" since="4.5">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
+ </element>
+ <element name="H265">
+ <description>High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard, one of several potential successors to the widely used AVC (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.</description>
+ </element>
+ <element name="Theora">
+ <description>Theora is derived from the formerly proprietary VP3 codec, released into the public domain by On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of the features present in some of these other codecs. It is comparable in open standards philosophy to the BBC's Dirac codec.</description>
+ </element>
+ <element name="VP8">
+ <description>VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for Open Media (AOMedia) are based on VP8.</description>
+ </element>
+ <element name="VP9">
+ <description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
+ </element>
+ </enum>
+
+ <enum name="AudioStreamingIndicator" since="5.0">
+ <element name="PLAY_PAUSE">
+ <description>
+ Default playback indicator.
+ By default the playback indicator should be PLAY_PAUSE when:
+ - the media app is newly registered on the head unit (after RegisterAppInterface)
+ - the media app was closed by the user (App enters HMI_NONE)
+ - the app sends SetMediaClockTimer with audioStreamingIndicator not set to any value
+ </description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button starts the audio playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button pauses the current audio playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button stops the current audio playback.</description>
+ </element>
+ </enum>
+
+ <struct name="Image" since="2.0">
+ <param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
+ <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
+ </param>
+ <param name="imageType" type="ImageType" mandatory="true">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ <param name="isTemplate" type="Boolean" mandatory="false" since="5.0">
+ <description>If true, the image is a template image and can be recolored by the HMI</description>
+ </param>
+ </struct>
+
+ <struct name="SoftButton" since="2.0">
+ <param name="type" type="SoftButtonType" mandatory="true">
+ <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
+ </param>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to display (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ True, if highlighted
+ False, if not highlighted
+ </description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
+ <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
+ </param>
+ </struct>
+
+ <struct name="Choice" since="1.0">
+ <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
+ <param name="menuName" type="String" maxlength="500" mandatory="true"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false" since="5.0">
+ <history>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="image" type="Image" mandatory="false" since="2.0" />
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false" since="3.0">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false" since="3.0">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false" since="3.0">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+ </struct>
+
+ <struct name="VrHelpItem" since="2.0">
+ <param name="text" maxlength="500" type="String" mandatory="true">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+
+ <struct name="SyncMsgVersion" since="1.0">
+ <description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false" since="4.3">
+ <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
+ </param>
+ </struct>
+
+ <enum name="GlobalProperty" since="1.0">
+ <description>The different global properties.</description>
+ <element name="HELPPROMPT" since="1.0">
+ <description>The property helpPrompt of setGlobalProperties</description>
+ </element>
+ <element name="TIMEOUTPROMPT" since="1.0">
+ <description>The property timeoutPrompt of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPTITLE" since="2.0">
+ <description>The property vrHelpTitle of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPITEMS" since="2.0">
+ <description>The property array of vrHelp of setGlobalProperties</description>
+ </element>
+ <element name="MENUNAME" since="3.0">
+ <description>The property in-app menu name of setGlobalProperties</description>
+ </element>
+ <element name="MENUICON" since="3.0">
+ <description>The property in-app menu icon of setGlobalProperties</description>
+ </element>
+ <element name="KEYBOARDPROPERTIES" since="3.0">
+ <description>The on-screen keyboard configuration of setGlobalProperties</description>
+ </element>
+ </enum>
+
+ <enum name="CompassDirection" since="2.0">
+ <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" since="2.0">
+ <description>The supported dimensions of the GPS</description>
+ <element name="NO_FIX" internal_name="Dimension_NO_FIX">
+ <description>No GPS at all</description>
+ </element>
+ <element name="2D" internal_name="Dimension_2D">
+ <description>Longitude and latitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and latitude and altitude</description>
+ </element>
+ </enum>
+
+ <enum name="PRNDL" since="2.0">
+ <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" since="2.0">
+ <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>
+
+ <enum name="TPMS" since="5.0">
+ <element name="UNKNOWN">
+ <description>If set the status of the tire is not known.</description>
+ </element>
+ <element name="SYSTEM_FAULT">
+ <description>TPMS does not function.</description>
+ </element>
+ <element name="SENSOR_FAULT">
+ <description>The sensor of the tire does not function.</description>
+ </element>
+ <element name="LOW">
+ <description>TPMS is reporting a low tire pressure for the tire.</description>
+ </element>
+ <element name="SYSTEM_ACTIVE">
+ <description>TPMS is active and the tire pressure is monitored.</description>
+ </element>
+ <element name="TRAIN">
+ <description>TPMS is reporting that the tire must be trained.</description>
+ </element>
+ <element name="TRAINING_COMPLETE">
+ <description>TPMS reports the training for the tire is completed.</description>
+ </element>
+ <element name="NOT_TRAINED">
+ <description>TPMS reports the tire is not trained.</description>
+ </element>
+ </enum>
+
+ <enum name="FuelType" since="5.0">
+ <element name="GASOLINE" />
+ <element name="DIESEL" />
+ <element name="CNG">
+ <description>
+ For vehicles using compressed natural gas.
+ </description>
+ </element>
+ <element name="LPG">
+ <description>
+ For vehicles using liquefied petroleum gas.
+ </description>
+ </element>
+ <element name="HYDROGEN">
+ <description>For FCEV (fuel cell electric vehicle).</description>
+ </element>
+ <element name="BATTERY">
+ <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
+ </element>
+ </enum>
+
+ <struct name="FuelRange" since="5.0">
+ <param name="type" type="FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="ElectronicParkBrakeStatus" since="5.0">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+ </enum>
+
+ <struct name="SingleTireStatus" since="2.0">
+ <param name="status" type="ComponentVolumeStatus" mandatory="true">
+ <description>See ComponentVolumeStatus.</description>
+ </param>
+ <param name="tpms" type="TPMS" mandatory="false" since="5.0">
+ <description>
+ The status of TPMS according to the particular tire.
+ </description>
+ </param>
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000" since="5.0">
+ <description>The pressure value of the particular tire in kilo pascal.</description>
+ </param>
+ </struct>
+
+ <enum name="WarningLightStatus" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
+ <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
+ </element>
+ <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" since="2.0">
+ <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" since="2.0">
+ <description>Reflects the current primary audio source (if selected).</description>
+ <element name="NO_SOURCE_SELECTED">
+ </element>
+ <element name="CD" since="5.0">
+ </element>
+ <element name="USB">
+ </element>
+ <element name="USB2">
+ </element>
+ <element name="BLUETOOTH_STEREO_BTST">
+ </element>
+ <element name="LINE_IN">
+ </element>
+ <element name="IPOD">
+ </element>
+ <element name="MOBILE_APP">
+ </element>
+ <element name="AM" since="5.0">
+ </element>
+ <element name="FM" since="5.0">
+ </element>
+ <element name="XM" since="5.0">
+ </element>
+ <element name="DAB" since="5.0">
+ </element>
+ </enum>
+
+ <enum name="WiperStatus" since="2.0">
+ <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" since="2.0">
+ <description>Reflects the status of a binary vehicle data item.</description>
+ <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
+ </element>
+ <element name="OFF" internal_name="VDS_OFF">
+ </element>
+ <element name="ON" internal_name="VDS_ON">
+ </element>
+ </enum>
+
+ <enum name="MaintenanceModeStatus" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <description>Reflects the status of the ambient light sensor.</description>
+ <element name="NIGHT" />
+ <element name="TWILIGHT_1" />
+ <element name="TWILIGHT_2" />
+ <element name="TWILIGHT_3" />
+ <element name="TWILIGHT_4" />
+ <element name="DAY" />
+ <element name="UNKNOWN" internal_name="ALS_UNKNOWN" />
+ <element name="INVALID" />
+ </enum>
+
+ <enum name="ModuleType" since="4.5">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ <element name="SEAT" since="5.0"/>
+ <element name="AUDIO" since="5.0"/>
+ <element name="LIGHT" since="5.0"/>
+ <element name="HMI_SETTINGS" since="5.0"/>
+ </enum>
+
+ <enum name="DefrostZone" since="4.5">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode" since="4.5">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="RadioBand" since="4.5">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <enum name="RadioState" since="4.5">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <enum name="TemperatureUnit" since="4.5">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="BeltStatus" since="2.0">
+ <param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="BodyInformation" since="2.0">
+ <param name="parkBrakeActive" type="Boolean" mandatory="true">
+ <description>References signal "PrkBrkActv_B_Actl".</description>
+ </param>
+ <param name="ignitionStableStatus" type="IgnitionStableStatus" mandatory="true">
+ <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="IgnitionStatus" mandatory="true">
+ <description>References signal "Ignition_status". See IgnitionStatus.</description>
+ </param>
+ <param name="driverDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatDrv_B_Actl".</description>
+ </param>
+ <param name="passengerDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatPsngr_B_Actl".</description>
+ </param>
+ <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRl_B_Actl".</description>
+ </param>
+ <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRr_B_Actl".</description>
+ </param>
+ </struct>
+
+ <struct name="DeviceStatus" since="2.0">
+ <param name="voiceRecOn" type="Boolean" mandatory="true">
+ <description>References signal "CPM_VoiceRec_STAT".</description>
+ </param>
+ <param name="btIconOn" type="Boolean" mandatory="true">
+ <description>References signal "BT_ICON".</description>
+ </param>
+ <param name="callActive" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Call_Active_STAT".</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Phone_Roaming_STAT".</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean" mandatory="true">
+ <description>References signal "CPM_TextMsg_AVAL".</description>
+ </param>
+ <param name="battLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Stereo_Audio_Output".</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Mono_Audio_Output".</description>
+ </param>
+ <param name="signalLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="PrimaryAudioSource" mandatory="true">
+ <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean" mandatory="true">
+ <description>References signal "eCall_Event".</description>
+ </param>
+ </struct>
+
+ <struct name="HeadLampStatus" since="2.0">
+ <param name="lowBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="AmbientLightStatus" mandatory="false">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+ </struct>
+
+ <struct name="AppInfo" since="4.2">
+ <description>Contains detailed information about the registered application.</description>
+
+ <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
+ <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
+ </param>
+
+ <param name="appBundleID" type="String" maxlength="256" mandatory="true">
+ <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
+ </param>
+
+ <param name="appVersion" type="String" maxlength="256" mandatory="true">
+ <description>Represents the build version number of this particular mobile app.</description>
+ </param>
+
+ <param name="appIcon" type="String" maxlength="500" mandatory="false">
+ <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</description>
+ </param>
+ </struct>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Ford Specific Data Items -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <enum name="FileType" since="2.0">
+ <description>Enumeration listing possible file types.</description>
+ <element name="GRAPHIC_BMP" />
+ <element name="GRAPHIC_JPEG" />
+ <element name="GRAPHIC_PNG" />
+ <element name="AUDIO_WAVE" />
+ <element name="AUDIO_MP3" />
+ <element name="AUDIO_AAC" />
+ <element name="BINARY" />
+ <element name="JSON" />
+ </enum>
+
+ <enum name="FuelCutoffStatus" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <description>Reflects the status of the eCall Notification.</description>
+ <element name="NORMAL" internal_name="ECCS_NORMAL">
+ </element>
+ <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
+ </element>
+ <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
+ </element>
+ <element name="CALL_COMPLETED">
+ </element>
+ <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
+ </element>
+ <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
+ </element>
+ <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
+ </element>
+ </enum>
+
+ <enum name="PowerModeQualificationStatus" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <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" since="2.0">
+ <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="ECallConfirmationStatus" mandatory="true">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="AirbagStatus" since="2.0">
+ <param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="EmergencyEvent" since="2.0">
+ <param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="FuelCutoffStatus" mandatory="true">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+
+ <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255" mandatory="true">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
+ 0x00 No event
+ 0xFE Not supported
+ 0xFF Fault
+ </description>
+ </param>
+ <param name="multipleEvents" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="ClusterModeStatus" since="2.0">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus" mandatory="true">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="CarModeStatus" mandatory="true">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="PowerModeStatus" mandatory="true">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+
+ <struct name="MyKey" since="2.0">
+ <param name="e911Override" type="VehicleDataStatus" mandatory="true">
+ <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
+ </param>
+ </struct>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- / Ford Specific Data Items -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <enum name="VehicleDataResultCode" since="2.0">
+ <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
+ <element name="SUCCESS" internal_name="VDRC_SUCCESS">
+ <description>Individual vehicle data item / DTC / DID request or subscription successful</description>
+ </element>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA">
+ <description>DTC / DID request successful, however, not all active DTCs or full contents of DID location available</description>
+ </element>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED">
+ <description>This vehicle data item is not allowed for this app by Ford.</description>
+ </element>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED">
+ <description>The user has not granted access to this type of vehicle data item at this time.</description>
+ </element>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID">
+ <description>The ECU ID referenced is not a valid ID on the bus / system.</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE">
+ <description>The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.</description>
+ </element>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED">
+ <description>The vehicle data item is already subscribed.</description>
+ </element>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED">
+ <description>The vehicle data item cannot be unsubscribed because it is not currently subscribed.</description>
+ </element>
+ <element name="IGNORED" internal_name="VDRC_IGNORED">
+ <description>The request for this item is ignored because it is already in progress.</description>
+ </element>
+ </enum>
+
+ <struct name="TireStatus" since="2.0">
+ <description>The status and pressure of the tires.</description>
+
+ <param name="pressureTelltale" type="WarningLightStatus" mandatory="true">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the inner right rear.</description>
+ </param>
+ </struct>
+
+ <enum name="TurnSignal" since="5.0">
+ <description>Enumeration that describes the status of the turn light indicator.</description>
+ <element name="OFF">
+ <description>Turn signal is OFF</description>
+ </element>
+ <element name="LEFT">
+ <description>Left turn signal is on</description>
+ </element>
+ <element name="RIGHT">
+ <description>Right turn signal is on</description>
+ </element>
+ <element name="BOTH">
+ <description>Both signals (left and right) are on.</description>
+ </element>
+ </enum>
+
+ <struct name="GPSData" since="2.0">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false" since="5.0">
+ <description>The current UTC year.</description>
+ <history>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="5.0">
+ <description>The current UTC month.</description>
+ <history>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="5.0">
+ <description>The current UTC day.</description>
+ <history>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="5.0">
+ <description>The current UTC hour.</description>
+ <history>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
+ <description>The current UTC minute.</description>
+ <history>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
+ <description>The current UTC second.</description>
+ <history>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="compassDirection" type="CompassDirection" mandatory="false" since="5.0">
+ <description>See CompassDirection.</description>
+ <history>
+ <param name="compassDirection" type="CompassDirection" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
+ <history>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>HDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>VDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ True, if actual.
+ False, if inferred.
+ </description>
+ <history>
+ <param name="actual" type="Boolean" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false" since="5.0">
+ <description>Number of satellites in view</description>
+ <history>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="dimension" type="Dimension" mandatory="false" since="5.0">
+ <description>See Dimension</description>
+ <history>
+ <param name="dimension" type="Dimension" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false" since="5.0">
+ <description>Altitude in meters</description>
+ <history>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false" since="5.0">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ <history>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false" since="5.0">
+ <description>The speed in KPH</description>
+ <history>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ </struct>
+
+ <struct name="VehicleDataResult" since="2.0">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="VehicleDataType" mandatory="true">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+
+ <struct name="DIDResult" since="2.0">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data from vehicle data DID</description>
+ </param>
+ <param name="data" type="String" maxlength="5000" mandatory="false">
+ <description>Raw DID-based data returned for requested element.</description>
+ </param>
+ </struct>
+
+ <struct name="StartTime" since="1.0">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>
+ The hour of the media clock.
+ Some radios only support a max of 19 hours. If out of range, it will be rejected.
+ </description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ </struct>
+
+ <struct name="TextField" since="1.0">
+ <param name="name" type="TextFieldName" mandatory="true">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet" mandatory="true">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageResolution" since="3.0">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageField" since="3.0">
+ <param name="name" type="ImageFieldName" mandatory="true">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="ImageResolution" mandatory="false">
+ <description>The image resolution of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="TouchCoord" since="3.0">
+ <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" since="3.0">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+ <element name="CANCEL" since="4.5"/>
+ </enum>
+
+ <struct name="TouchEvent" since="3.0">
+ <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
+ <description>
+ A touch's unique identifier. The application can track the current touch events by id.
+ If a touch event has type begin, the id should be added to the set of touches.
+ If a touch event has type end, the id should be removed from the set of touches.
+ </description>
+ </param>
+ <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="1000">
+ <description>
+ The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
+ The timestamp is used to determined the rate of change of position of a touch.
+ The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
+ If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
+ </description>
+ </param>
+ <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+ </struct>
+
+ <struct name="TouchEventCapabilities" since="3.0">
+ <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" since="3.0">
+ <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" since="2.0">
+ <description>Enumeration that describes possible permission states of a policy table entry.</description>
+ <element name="ALLOWED" internal_name="PS_ALLOWED"/>
+ <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
+ <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
+ </enum>
+
+ <struct name="HMIPermissions" since="2.0">
+ <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all HMI levels that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all HMI levels that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="ParameterPermissions" since="2.0">
+ <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
+ <description>A set of all parameters that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
+ <description>A set of all parameters that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="PermissionItem" since="2.0">
+ <param name="rpcName" type="String" maxlength="100" mandatory="true">
+ <description>Name of the individual RPC in the policy table.</description>
+ </param>
+ <param name="hmiPermissions" type="HMIPermissions" mandatory="true"/>
+ <param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
+ </struct>
+
+ <struct name="DisplayCapabilities" since="1.0">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
+ <description>The type of the display. See DisplayType</description>
+ <history>
+ <param name="displayType" type="DisplayType" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="displayName" type="String" mandatory="false" since="5.0">
+ <description>The name of the display the app is connected to.</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="graphicSupported" type="Boolean" mandatory="true" since="2.0">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false" since="3.0">
+ <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
+ </param>
+ <param name="screenParams" type="ScreenParams" mandatory="false" since="3.0">
+ <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
+ <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
+ </param>
+
+ <!-- TODO: Add pixel density? -->
+ </struct>
+
+ <struct name="ButtonCapabilities" since="1.0">
+ <description>Contains information about a button's capabilities.</description>
+ <param name="name" type="ButtonName" mandatory="true">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="SoftButtonCapabilities" since="2.0">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ <param name="imageSupported" type="Boolean" mandatory="true">
+ <description>The button supports referencing a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="PresetBankCapabilities" since="2.0">
+ <description>Contains information about on-screen preset capabilities.</description>
+ <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
+ <description>Onscreen custom presets are available.</description>
+ </param>
+ </struct>
+
+ <struct name="HMICapabilities" since="3.0">
+ <param name="navigation" type="Boolean" mandatory="false">
+ <description>Availability of build in Nav. True: Available, False: Not Available</description>
+ </param>
+ <param name="phoneCall" type="Boolean" mandatory="false">
+ <description>Availability of build in phone. True: Available, False: Not Available </description>
+ </param>
+ <param name="videoStreaming" type="Boolean" mandatory="false" since="4.5">
+ <description>Availability of video streaming. </description>
+ </param>
+ <param name="remoteControl" type="Boolean" mandatory="false" since="4.5">
+ <description>Availability of remote control feature. True: Available, False: Not Available</description>
+ </param>
+ </struct>
+
+ <struct name="MenuParams" since="1.0">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
+ <description>
+ unique ID of the sub menu, the command will be added to.
+ If not provided, it will be provided to the top level of the in application menu.
+ </description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </struct>
+
+ <struct name="TTSChunk" since="1.0">
+ <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
+ <description>
+ The text or phonemes to speak, or the name of the audio file to play.
+ May not be empty.
+ </description>
+ </param>
+
+ <param name="type" type="SpeechCapabilities" mandatory="true">
+ <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities</description>
+ </param>
+ </struct>
+
+ <struct name="Turn" since="2.0">
+ <param name="navigationText" type="String" maxlength="500" mandatory="false">
+ <description>Individual turn text. Must provide at least text or icon for a given turn.</description>
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false">
+ <description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleType" since="2.0">
+ <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" since="3.0">
+ <description>Enumeration listing possible keyboard layouts.</description>
+ <element name="QWERTY" />
+ <element name="QWERTZ" />
+ <element name="AZERTY" />
+ </enum>
+
+ <enum name="KeyboardEvent" since="3.0">
+ <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" since="3.0">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="SINGLE_KEYPRESS">
+ <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
+ </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" since="3.0">
+ <description>Configuration of on-screen keyboard (if available).</description>
+ <param name="language" type="Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+ <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
+ <description>Desired keyboard layout.</description>
+ </param>
+ <param name="keypressMode" type="KeypressMode" mandatory="false" >
+ <description>
+ Desired keypress mode.
+ If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ </description>
+ </param>
+ <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Array of keyboard characters to enable.</description>
+ <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
+ <description>If omitted, the entire keyboard will be enabled.</description>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
+ <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ </param>
+ </struct>
+
+ <struct name="DeviceInfo" since="3.0">
+ <description>Various information about connecting device.</description>
+ <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device model</description>
+ </param>
+ <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device firmware revision</description>
+ </param>
+ <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS</description>
+ </param>
+ <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS version</description>
+ </param>
+ <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device mobile carrier (if applicable)</description>
+ </param>
+ <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Omitted if connected not via BT.</description>
+ </param>
+ </struct>
+
+ <enum name="RequestType" since="3.0">
+ <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" />
+ <element name="OEM_SPECIFIC" since="5.0" />
+ </enum>
+
+ <enum name="AppHMIType" since="2.0">
+ <description>Enumeration listing possible app types.</description>
+ <element name="DEFAULT" />
+ <element name="COMMUNICATION" />
+ <element name="MEDIA" />
+ <element name="MESSAGING" />
+ <element name="NAVIGATION" />
+ <element name="INFORMATION" />
+ <element name="SOCIAL" />
+ <element name="BACKGROUND_PROCESS" />
+ <element name="TESTING" />
+ <element name="SYSTEM" />
+ <element name="PROJECTION" since="4.5" />
+ <element name="REMOTE_CONTROL" since="4.5" />
+ </enum>
+
+ <enum name="PredefinedLayout" platform="documentation" since="3.0">
+ <description>Predefined screen layout.</description>
+ <element name="DEFAULT" rootscreen="true">
+ <description>
+ Default media / non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="MEDIA" rootscreen="true">
+ <description>
+ Default Media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
+ <description>
+ Default Non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="ONSCREEN_PRESETS" rootscreen="true">
+ <description>
+ Custom root media screen containing app-defined onscreen presets.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_FULLSCREEN_MAP" rootscreen="true" >
+ <description>
+ Custom root template screen containing full screen map with navigation controls.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_LIST" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented list.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_KEYBOARD" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented keyboard.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with lines of text.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing lines of text with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only text SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TILES" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing tiled SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text and SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text only SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text only SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing a large graphic and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing two graphics and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only a large graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="FunctionID" internal_scope="base" since="1.0">
+ <description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
+ <element name="RESERVED" value="0" since="1.0" />
+ <!--
+ Base Request / Response RPCs
+ Range = 0x 0000 0001 - 0x 0000 7FFF
+ -->
+ <element name="RegisterAppInterfaceID" value="1" hexvalue="1" since="1.0" />
+ <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" since="1.0" />
+ <element name="SetGlobalPropertiesID" value="3" hexvalue="3" since="1.0" />
+ <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" since="1.0" />
+ <element name="AddCommandID" value="5" hexvalue="5" since="1.0" />
+ <element name="DeleteCommandID" value="6" hexvalue="6" since="1.0" />
+ <element name="AddSubMenuID" value="7" hexvalue="7" since="1.0" />
+ <element name="DeleteSubMenuID" value="8" hexvalue="8" since="1.0" />
+ <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" since="1.0" />
+ <element name="PerformInteractionID" value="10" hexvalue="A" since="1.0" />
+ <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" since="1.0" />
+ <element name="AlertID" value="12" hexvalue="C" since="1.0" />
+ <element name="ShowID" value="13" hexvalue="D" since="1.0" />
+ <element name="SpeakID" value="14" hexvalue="E" since="1.0" />
+ <element name="SetMediaClockTimerID" value="15" hexvalue="F" since="1.0" />
+ <element name="PerformAudioPassThruID" value="16" hexvalue="10" since="2.0" />
+ <element name="EndAudioPassThruID" value="17" hexvalue="11" since="2.0" />
+ <element name="SubscribeButtonID" value="18" hexvalue="12" since="1.0" />
+ <element name="UnsubscribeButtonID" value="19" hexvalue="13" since="1.0" />
+ <element name="SubscribeVehicleDataID" value="20" hexvalue="14" since="2.0" />
+ <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" since="2.0" />
+ <element name="GetVehicleDataID" value="22" hexvalue="16" since="2.0" />
+ <element name="ReadDIDID" value="23" hexvalue="17" since="2.0" />
+ <element name="GetDTCsID" value="24" hexvalue="18" since="2.0" />
+ <element name="ScrollableMessageID" value="25" hexvalue="19" since="2.0" />
+ <element name="SliderID" value="26" hexvalue="1A" since="2.0" />
+ <element name="ShowConstantTBTID" value="27" hexvalue="1B" since="2.0" />
+ <element name="AlertManeuverID" value="28" hexvalue="1C" since="2.0" />
+ <element name="UpdateTurnListID" value="29" hexvalue="1D" since="2.0" />
+ <element name="ChangeRegistrationID" value="30" hexvalue="1E" since="2.0" />
+ <element name="GenericResponseID" value="31" hexvalue="1F" since="1.0" />
+ <element name="PutFileID" value="32" hexvalue="20" since="3.0" />
+ <element name="DeleteFileID" value="33" hexvalue="21" since="3.0" />
+ <element name="ListFilesID" value="34" hexvalue="22" since="3.0" />
+ <element name="SetAppIconID" value="35" hexvalue="23" since="3.0" />
+ <element name="SetDisplayLayoutID" value="36" hexvalue="24" since="3.0" />
+ <element name="DiagnosticMessageID" value="37" hexvalue="25" since="3.0" />
+ <element name="SystemRequestID" value="38" hexvalue="26" since="3.0" />
+ <element name="SendLocationID" value="39" hexvalue="27" since="3.0" />
+ <element name="DialNumberID" value="40" hexvalue="28" since="3.0" />
+ <element name="ButtonPressID" value="41" hexvalue="29" since="4.5" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" since="4.5" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" since="4.5" />
+ <element name="GetWayPointsID" value="45" hexvalue="2D" since="4.1" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E" since="4.1" />
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
+ <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
+ <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
+
+ <!--
+ Base Notifications
+ Range = 0x 0000 8000 - 0x 0000 FFFF
+ -->
+
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" since="1.0" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" since="1.0" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" since="1.0" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" since="1.0" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" since="2.0" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" since="1.0" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" since="1.0" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" since="1.0" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" since="2.0" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" since="2.0" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" since="2.0" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" since="3.0" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" since="3.0" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" since="3.0" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" since="3.0" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
+ <element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
+
+ <!--
+ Ford Specific Request / Response RPCs
+ Range = 0x 0001 0000 - 0x 0001 7FFF
+ -->
+
+ <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" since="1.0" />
+ <element name="SyncPDataID" value="65537" hexvalue="10001" since="1.0" />
+
+ <!--
+ Ford Specific Notifications
+ Range = 0x 0001 8000 - 0x 0001 FFFF
+ -->
+
+ <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" since="1.0" />
+ <element name="OnSyncPDataID" value="98305" hexvalue="18001" since="1.0" />
+ </enum>
+
+ <enum name="messageType" since="1.0">
+ <description>
+ Enumeration linking message types with function types in WiPro protocol.
+ Assumes enumeration starts at value 0.
+ </description>
+ <element name="request" value="0" />
+ <element name="response" value="1" />
+ <element name="notification" value="2" />
+ </enum>
+
+ <struct name="DateTime" since="4.1">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false" since="4.2.2">
+ <description>Milliseconds </description>
+ </param>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false" since="4.2.2">
+ <description>Seconds part of time</description>
+ <history>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="4.2.2">
+ <description>Minutes part of time</description>
+ <history>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="4.2.2">
+ <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ <history>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="4.2.2">
+ <description>Day of the month</description>
+ <history>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="4.2.2">
+ <description>Month of the year</description>
+ <history>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false" since="4.2.2">
+ <description>The year in YYYY format</description>
+ <history>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false" since="4.2.2">
+ <description>Time zone offset in Hours wrt UTC.</description>
+ <history>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false" since="4.2.2">
+ <description>Time zone offset in Min wrt UTC.</description>
+ <history>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ </struct>
+
+ <enum name="WayPointType" since="4.1">
+ <description>Describes what kind of waypoint is requested/provided.</description>
+ <element name="ALL" />
+ <element name="DESTINATION" />
+ </enum>
+
+ <struct name="Coordinate" since="4.1">
+ <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
+ <description>Latitude of the location.</description>
+ </param>
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
+ <description>Longitude of the location.</description>
+ </param>
+ </struct>
+
+ <struct name="OASISAddress" since="4.1">
+ <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Name of the country (localized)</description>
+ </param>
+ <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
+ <description>Name of country (ISO 3166-2)</description>
+ </param>
+ <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
+ <description>(PLZ, ZIP, PIN, CAP etc.)</description>
+ </param>
+ <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of country (e.g. state)</description>
+ </param>
+ <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of e.g. state (e.g. county)</description>
+ </param>
+ <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. city/village</description>
+ </param>
+ <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. district</description>
+ </param>
+ <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for street, road etc.</description>
+ </param>
+ <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of thoroughfare e.g. house number</description>
+ </param>
+ </struct>
+
+ <struct name="LocationDetails" since="4.1">
+ <param name="coordinate" type="Coordinate" mandatory="false">
+ <description>Latitude/Longitude of the location.</description>
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>Name of location.</description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>Location address for display purposes only</description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>Description intended location / establishment (if applicable)</description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>Phone number of location / establishment.</description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>Image / icon of intended location.</description>
+ </param>
+ <param name="searchAddress" type="OASISAddress" mandatory="false">
+ <description>Address to be used by navigation engines for search</description>
+ </param>
+ </struct>
+
+ <enum name="SystemCapabilityType" since="4.5">
+ <description>Enumerations of all available system capability types</description>
+ <element name="NAVIGATION"/>
+ <element name="PHONE_CALL"/>
+ <element name="VIDEO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
+ </enum>
+
+ <struct name="NavigationCapability" since="4.5">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability" since="4.5">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingFormat" since="4.5">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability" since="4.5">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="VideoStreamingFormat" array="true" mandatory="false">
+ <description>Detailed information on each format supported by this system, in its preferred order (i.e. the first element in the array is most preferable to the system). Each object will contain a VideoStreamingFormat that describes what can be expected.</description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
+ </param>
+ </struct>
+
+ <struct name="RGBColor" since="5.0">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <struct name="TemplateColorScheme" since="5.0">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+ </struct>
+
+ <!---Remote control -->
+
+ <enum name="MassageZone" since="5.0">
+ <description>List possible zones of a multi-contour massage seat.</description>
+ <element name="LUMBAR">
+ <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode" since="5.0">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData" since="5.0">
+ <description>Specify the mode of a massage zone.</description>
+ <param name="massageZone" type="MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ </struct>
+
+ <enum name="MassageCushion" since="5.0">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness" since="5.0">
+ <description>The intensity or firmness of a cushion.</description>
+ <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <enum name="SeatMemoryActionType" since="5.0">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction" since="5.0">
+ <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
+ <param name="label" type="String" maxlength="100" mandatory="false"/>
+ <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ </struct>
+
+ <enum name="SupportedSeat" since="5.0">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData" since="5.0">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="Temperature" since="4.5">
+ <param name="unit" type="TemperatureUnit" mandatory="true">
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true">
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="RdsData" since="4.5">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <struct name="StationIDNumber" since="5.0">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="SisData" since="5.0">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlData" since="4.5">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="RdsData" mandatory="false">
+ </param>
+ <param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
+ <description> True if the hd radio is on, false if the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <description>number of HD sub-channels if available</description>
+ <history>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <description>Current HD sub-channel if available</description>
+ <history>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false if the radio is off. If set to false, no other data will be included.</description>
+ </param>
+ <param name="state" type="RadioState" mandatory="false">
+ </param>
+ <param name="sisData" type="SisData" mandatory="false" since="5.0">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData" since="4.5">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="VentilationMode" mandatory="false">
+ </param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities" since="4.5">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities" since="4.5">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings" since="5.0">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>Reflects the setting, from 0%-100%.</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlData" since="5.0">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false if it is not included.
+ If it is false, the system not only changes the audio source but also brings the default application or
+ system UI associated with the audio source to foreground.
+ If it is true, the system only changes the audio source, but keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext parameter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+ <enum name="LightName" since="5.0">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front_left and front_right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights and trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus" since="5.0">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities" since="5.0">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the sRGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available LightCapabilities that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState" since="5.0">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData" since="5.0">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode" since="5.0">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+
+ <enum name="DistanceUnit" since="5.0">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData" since="5.0">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData" since="4.5">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ </param>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ <param name="seatControlData" type="SeatControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false" since="5.0">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities" since="4.5">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description>
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC button controls with the included button names.</description>
+ </param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports audio controls.</description>
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports hmi setting controls.</description>
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports light controls.</description>
+ </param>
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports seat controls.</description>
+ </param>
+ </struct>
+
+ <!-- End of RC -->
+ <struct name="SystemCapability" since="4.5">
+ <description>The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included.</description>
+ </param>
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ <description>Describes extended capabilities for onboard navigation system </description>
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ </struct>
+
+ <enum name="MetadataType" since="4.5">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+ </enum>
+
+ <struct name="MetadataTags" since="4.5">
+ <param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField1" text field.</description>
+ </param>
+ <param name="mainField2" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField2" text field.</description>
+ </param>
+ <param name="mainField3" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField3" text field.</description>
+ </param>
+ <param name="mainField4" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField4" text field.</description>
+ </param>
+ </struct>
+
+ <struct name="Rectangle" since="4.5">
+ <param name="x" type="Float" mandatory="true">
+ <description>The upper left X-coordinate of the rectangle</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The upper left Y-coordinate of the rectangle</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect" since="4.5">
+ <description>Defines haptic data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
+
+ <!-- Requests/Responses -->
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
+ <description>
+ Establishes an interface with a mobile application.
+ Before registerAppInterface no other commands will be accepted/executed.
+ </description>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true" since="1.0">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
+ <description>
+ The mobile application name, e.g. "Ford Drive Green".
+ Needs to be unique over all applications.
+ 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" since="2.0">
+ <description>
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="1.0">
+ <description>
+ Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
+ If not provided, the appName is used instead (and will be truncated if too long)
+ 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" since="1.0">
+ <description>
+ Defines an additional voice recognition command.
+ May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="isMediaApplication" type="Boolean" mandatory="true" since="1.0">
+ <description>
+ Indicates if the application is a media or a non-media application.
+ Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
+ </description>
+ </param>
+ <param name="languageDesired" type="Language" mandatory="true" since="1.0">
+ <description>
+ See Language
+ Current app's expected VR+TTS language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true" since="2.0">
+ <description>
+ See Language
+ Current app's expected display language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ See AppHMIType
+ List of all applicable app HMI types stating which HMI classifications to be given to the app.
+ </description>
+ </param>
+
+ <param name="hashID" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>
+ ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
+ This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
+ If omitted, then the previous state of an app's commands, etc. will not be restored.
+ When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
+ </description>
+ </param>
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false" since="3.0">
+ <description>
+ See DeviceInfo.
+ </description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true" since="2.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <param name="fullAppID" type="String" maxlength="100" mandatory="false" since="5.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <param name="appInfo" type="AppInfo" mandatory="false" since="2.0">
+ <description>
+ See AppInfo.
+ </description>
+ </param>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ </function>
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response" since="1.0">
+ <description>The response to registerAppInterface</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TOO_MANY_APPLICATIONS"/>
+ <element name="APPLICATION_REGISTERED_ALREADY"/>
+ <element name="UNSUPPORTED_VERSION"/>
+ <element name="WRONG_LANGUAGE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ <element name="RESUME_FAILED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The currently active VR+TTS language on the module. See "Language" for options.</description>
+ </param>
+
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
+ <description>The currently active display language on the module. See "Language" for options.</description>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See HmiZoneCapabilities</description>
+ </param>
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See SpeechCapabilities</description>
+ </param>
+
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>See PrerecordedSpeech</description>
+ </param>
+
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See VrCapabilities</description>
+ </param>
+
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false" since="4.1">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="vehicleType" type="VehicleType" mandatory="false" since="2.0">
+ <description>Specifies the vehicle's type. See VehicleType.</description>
+ </param>
+
+ <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" since="3.0">
+ <description>
+ Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
+ If a mode outside this list is requested, it will be rejected.
+ </description>
+ </param>
+
+ <param name="hmiCapabilities" type="HMICapabilities" mandatory="false" since="3.0">
+ <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
+ </param>
+
+ <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
+ <description>The SmartDeviceLink version.</description>
+ </param>
+
+ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
+ <description>The software version of the system that implements the SmartDeviceLink core.</description>
+ </param>
+
+ <param name="iconResumed" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Existence of apps icon at system. If true, apps icon
+ was resumed at system. If false, apps icon is not resumed at system
+ </description>
+ </param>
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request" since="1.0">
+ <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" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
+ <description>Allows setting global properties.</description>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>
+ The help prompt.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>
+ Help text for a wait timeout.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ VR Help Title text.
+ If omitted on supported displays, the default module help title shall be used.
+ 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" since="2.0">
+ <description>
+ VR Help Items.
+ If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
+ 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" since="3.0">
+ <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="menuIcon" type="Image" mandatory="false" since="3.0">
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
+ <description>On-screen keyboard configuration (if available).</description>
+ </param>
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request" since="1.0">
+ <description>Allows resetting global properties.</description>
+
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
+ </param>
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request" since="1.0">
+ <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" since="2.0">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request" since="1.0">
+ <description>Deletes all commands from the in-application menu with the specified command id.</description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the command(s) to delete.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request" since="1.0">
+ <description>Adds a sub menu to the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>unique ID of the sub menu to add.</description>
+ </param>
+
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ Position of any submenu will always be located before the return and exit options
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" maxlength="500" type="String" mandatory="true">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+
+ <param name="menuIcon" type="Image" mandatory="false" since="5.0">
+ <description>The image field for AddSubMenu</description>
+ </param>
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request" since="1.0">
+ <description>Deletes a submenu from the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
+ <description>creates interaction choice set to be used later by performInteraction</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request" since="1.0">
+ <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+
+ <param name="initialText" type="String" maxlength="500" mandatory="true">
+ <description>
+ Text to be displayed first.
+ </description>
+ </param>
+
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ This is the initial prompt spoken to the user at the start of an interaction.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="interactionMode" type="InteractionMode" mandatory="true">
+ <description>See InteractionMode.</description>
+ </param>
+
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="true">
+ <description>List of interaction choice set IDs to use with an interaction.</description>
+ </param>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text. This is the spoken string when a user speaks "help" when the interaction is occurring.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Timeout text. This text is spoken when a VR interaction times out.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.
+ Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
+ If omitted on supported displays, the default generated list of suggested choices shall be displayed.
+ </description>
+ </param>
+
+ <param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
+ <description>See LayoutMode.</description>
+ </param>
+
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TIMED_OUT"/>
+ <element name="ABORTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ Only is valid if general result is "success:true".
+ </description>
+ </param>
+
+ <param name="manualTextEntry" type="String" maxlength="500" mandatory="false" since="3.0">
+ <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" since="1.0">
+ <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
+ <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the interaction choice set to delete.</description>
+ </param>
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="request" since="1.0">
+ <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
+
+ <param name="alertText1" type="String" maxlength="500" mandatory="false">
+ <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" since="2.0">
+ <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" since="3.0">
+ <description>
+ If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
+ </description>
+ </param>
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false" since="2.0">
+ <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" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="2.0">
+ <description>
+ Amount of time (in seconds) that an app must wait before resending an alert.
+ If provided, another system event or overlay currently has a higher priority than this alert.
+ 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" since="1.0">
+ <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
+
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed in a single or upper display line.
+ If this text is not set, the text of mainField1 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed on the second display line.
+ If this text is not set, the text of mainField2 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ The text that should be displayed on the second "page" first display line.
+ If this text is not set, the text of mainField3 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ The text that should be displayed on the second "page" second display line.
+ If this text is not set, the text of mainField4 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="alignment" type="TextAlignment" mandatory="false" since="1.0">
+ <description>
+ Specifies how mainField1 and mainField2 texts should be aligned on display.
+ If omitted, texts will be centered.
+ </description>
+ </param>
+
+ <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
+ </param>
+
+ <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities.
+ If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
+ </description>
+ </param>
+
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed in the track field.
+ If this text is not set, the text of mediaTrack stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="graphic" type="Image" mandatory="false" since="3.0">
+ <description>
+ Image struct determining whether static or dynamic image to display in app.
+ If omitted on supported displays, the displayed graphic shall not change.
+ </description>
+ </param>
+
+ <param name="secondaryGraphic" type="Image" mandatory="false" since="3.0">
+ <description>
+ Image struct determining whether static or dynamic secondary image to display in app.
+ If omitted on supported displays, the displayed secondary graphic shall not change.
+ </description>
+ </param>
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false" since="2.0">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false" since="3.0">
+ <description>
+ App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
+ If omitted on supported displays, the presets will be shown as not defined.
+ </description>
+ </param>
+
+ <param name="metadataTags" type="MetadataTags" mandatory="false" since="4.5">
+ <description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
+ If omitted on supported displays, the currently set metadata tags will not change.
+ If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
+ </param>
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="request" since="1.0">
+ <description>Speaks a text.</description>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request" since="1.0">
+ <description>Sets the initial media clock value and automatic update method.</description>
+
+ <param name="startTime" type="StartTime" mandatory="false">
+ <description>
+ See StartTime.
+ startTime must be provided for "COUNTUP" and "COUNTDOWN".
+ startTime will be ignored for "RESUME", and "CLEAR"
+ startTime can be sent for "PAUSE", in which case it will update the paused startTime
+ </description>
+ </param>
+
+ <param name="endTime" type="StartTime" mandatory="false" since="3.0">
+ <description>
+ See StartTime.
+ endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ endTime will be ignored for "RESUME", and "CLEAR"
+ endTime can be sent for "PAUSE", in which case it will update the paused endTime
+ </description>
+ </param>
+
+ <param name="updateMode" type="UpdateMode" mandatory="true">
+ <description>
+ Enumeration to control the media clock.
+ In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
+ </description>
+ </param>
+
+ <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false" since="5.0">
+ <description>
+ Enumeration for the indicator icon on a play/pause button. see AudioStreamingIndicator.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request" since="2.0">
+ <description>Starts audio pass thru session </description>
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ The module will speak this prompt before opening the audio pass thru session.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ If omitted, then no initial prompt is spoken.
+ </description>
+ </param>
+ <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
+ <description>First line of text displayed during audio capture.</description>
+ </param>
+ <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
+ <description>Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="samplingRate" type="SamplingRate" mandatory="true">
+ <description> This value shall be allowed at 8 kHz or 16 or 22 or 44 kHz.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. </description>
+ </param>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
+ <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
+ </param>
+ <param name="audioType" type="AudioType" mandatory="true">
+ <description>Specifies the type of audio data being requested.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="false">
+ <description>
+ Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
+ If omitted, the value is set to true.
+ </description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="RETRY"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request" since="2.0">
+ <description>When this request is invoked, the audio capture stops.</description>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request" since="1.0">
+ <description>
+ Subscribes to built-in HMI buttons.
+ The application will be notified by the OnButtonEvent and OnButtonPress.
+ To unsubscribe the notifications, use unsubscribeButton.
+ </description>
+
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request" since="1.0">
+ <description>Unsubscribes from built-in HMI buttons.</description>
+
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request" since="2.0">
+ <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="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <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" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <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" since="2.0">
+ <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="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <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" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <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" since="2.0">
+ <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="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <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" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="VEHICLE_DATA_NOT_ALLOWED"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <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" since="2.0">
+ <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" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="didResult" type="DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>Array of requested DID results (with data if available).</description>
+ </param>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="request" since="2.0">
+ <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" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
+ </param>
+
+ <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
+ <description>
+ Array of all reported DTCs on module (ecuHeader contains information if list is truncated).
+ Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request" since="3.0">
+ <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" since="3.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message result.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request" since="2.0">
+ <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
+ <param name="scrollableMessageBody" type="String" maxlength="500" mandatory="true">
+ <description>Body of text that can include newlines and tabs.</description>
+ </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" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="CHAR_LIMIT_EXCEEDED"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="request" since="2.0">
+ <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
+ <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
+ <description>Number of selectable items on a horizontal axis</description>
+ </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" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="SAVED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="TIMED_OUT"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>
+ Current slider value returned when saved or canceled (aborted)
+ This value is only returned for resultCodes "SAVED" or "ABORTED"
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request" since="2.0">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false" since="3.0">
+ </param>
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false" since="2.0">
+ </param>
+ <param name="nextTurnIcon" type="Image" mandatory="false" since="3.0">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
+ <description>
+ Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
+ <description>
+ Distance till next maneuver (starting from) from previous maneuver.
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="maneuverComplete" type="Boolean" mandatory="false" since="2.0">
+ <description>
+ If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
+ If omitted the value will be assumed as FALSE.
+ </description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false" since="2.0">
+ <description>
+ Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request" since="2.0">
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ </param>
+ <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" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request" since="2.0">
+ <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
+ <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request" since="2.0">
+ <param name="language" type="Language" mandatory="true">
+ <description>Requested voice engine (VR+TTS) language registration</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <description>Request display language registration</description>
+ </param>
+ <param name="appName" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>Request new app name registration</description>
+ </param>
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>Request new ttsName registration</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>Request new VR synonyms registration</description>
+ </param>
+
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description>
+ true, if successful
+ false, if failed
+ </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response" since="1.0">
+ <description>
+ Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
+ Currently, only resultCode INVALID_DATA is used.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="INVALID_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="request" since="3.0">
+ <description>
+ Used to push a binary data onto the module from a mobile device, such as icons and album art
+ Not supported on first generation of SDL enabled modules.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="fileType" type="FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
+
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="systemFile" type="Boolean" defvalue="false" mandatory="false" >
+ <description>
+ Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional length in bytes for resuming partial data chunks
+ If offset is set to 0, then length is the total length of the file to be downloaded
+ </description>
+ </param>
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false" since="5.0">
+ <description> Additional CRC32 checksum to protect data integrity up to 512 Mbits </description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="response" since="3.0">
+ <description>Response is sent, when the file data was copied (success case). Or when an error occurred.</description>
+ <description>Not supported on first generation SDL enabled vehicles. </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="CORRUPTED_DATA"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>
+ Provides the total local space available in SDL Core for the registered app.
+ If the transfer has systemFile enabled, then the value will be set to 0 automatically.
+ </description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
+ <description>
+ Used to delete a file resident on the module in the app's local cache.
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response" since="3.0">
+ <description>
+ Response is sent, when the file data was deleted (success case). Or when an error occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request" since="3.0">
+ <description>
+ Requests the current list of resident filenames for the registered app.
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response" since="3.0">
+ <description>
+ Returns the current list of resident filenames for the registered app along with the current space available
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>
+ An array of all filenames resident on the module for the given registered app.
+ If omitted, then no files currently reside on the system.
+ </description>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request" since="3.0">
+ <description>
+ Used to set existing local file on the module as the app's icon
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response" since="3.0">
+ <description>
+ Response is sent, when the file data was copied (success case). Or when an error occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
+ <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>
+
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" since="3.0">
+ <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>
+ The type of system request.
+ Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
+ </description>
+ </param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" mandatory="false">
+ <description>
+ Filename of HTTP data to store in predefined system staging area.
+ Mandatory if requestType is HTTP.
+ PROPRIETARY requestType should ignore this parameter.
+ </description>
+ </param>
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_CERT"/>
+ <element name="EXPIRED_CERT"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ <element name="TIMED_OUT"/>
+ <element name="IGNORED"/>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request" since="3.0">
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>
+ Name / title of intended location
+ </description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>
+ Description intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>
+ Location address (if applicable)
+ </description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>
+ Phone number of intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>
+ Image / icon of intended location (if applicable and supported)
+ </description>
+ </param>
+
+ <param name="timeStamp" type="DateTime" mandatory="false" since="4.1">
+ <description>
+ timestamp in ISO 8601 format
+ </description>
+ </param>
+
+ <param name="address" type="OASISAddress" mandatory="false" since="4.1">
+ <description>Address to be used for setting destination</description>
+ </param>
+ <param name="deliveryMode" type="DeliveryMode" mandatory="false" since="4.1">
+ <description>Defines the mode of prompt for user</description>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="request" since="3.0">
+ <description>Dials a phone number and switches to phone application.</description>
+
+ <param name="number" type="String" maxlength="40" mandatory="true">
+ <description>
+ Phone number is a string, which can be up to 40 chars.
+ All characters shall be stripped from string except digits 0-9 and * # , ; +
+ </description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="request" since="4.5">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>The name of supported RC climate or radio button.</description>
+ </param>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ </function>
+
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="response" since="4.5">
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request" since="4.5">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>
+ The type of a RC module to retrieve module data from the vehicle.
+ In the future, this should be the Identification of a module.
+ </description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" since="4.5.1">
+ <description>
+ If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is not included, the subscription status of the app for the requested moduleType will remain unchanged.
+ </description>
+ <history>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false" since="4.5" until="4.5.1"/>
+ </history>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>
+ It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ <description>The module data to set for the requested RC module.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response" since="4.5">
+ <description>Used to set the values of one remote control module </description>
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="READ_ONLY"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request" since="4.1">
+ <description>To subscribe in getting changes for Waypoints/destinations</description>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request" since="4.1">
+ <description>Request for getting waypoint/destination data.</description>
+ <param name="wayPointType" type="WayPointType" mandatory="true">
+ <description>To request for either the destination only or for all waypoints including destination</description>
+ </param>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="TIMED_OUT"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="IN_USE"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request" since="4.1">
+ <description>Request to unsubscribe from WayPoints and Destination</description>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request" since="4.5">
+ <description>Request for expanded information about a supported system/HMI capability</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>The type of system capability to get more information on</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
+ <param name="systemCapability" type="SystemCapability" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>The capability does not exist on the module</description>
+ </element>
+ <element name="DATA_NOT_AVAILABLE">
+ <description>The capability should exist on the module but there was an error retrieving the data.</description>
+ </element>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request" since="4.5">
+ <description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response" since="4.5">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ </function>
+
+ <!-- Notifications -->
+
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
+ <param name="hmiLevel" type="HMILevel" mandatory="true">
+ <description>See HMILevel</description>
+ </param>
+
+ <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
+ <description>See AudioStreamingState</description>
+ </param>
+
+ <param name="systemContext" type="SystemContext" mandatory="true">
+ <description>See SystemContext</description>
+ </param>
+
+ <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE" since="5.0">
+ <description>
+ See VideoStreamingState.
+ If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).
+ </description>
+ </param>
+ </function>
+
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
+ <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
+ <description>See AppInterfaceUnregisteredReason</description>
+ </param>
+ </function>
+
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification" since="1.0">
+ <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification" since="1.0">
+ <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification" since="2.0">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </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="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
+ </param>
+ <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>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
+ <!-- Ford Specific Vehicle Data -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <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" since="1.0">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Command ID, which is related to a specific menu entry</description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="true">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" since="1.0">
+ <description>Provides applications with notifications specific to the current TBT client status on the module</description>
+ <param name="state" type="TBTState" mandatory="true">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" since="1.0">
+ <description>Provides driver distraction state to mobile applications</description>
+ <param name="state" type="DriverDistractionState" mandatory="true">
+ <description>Current State of Driver Distraction</description>
+ </param>
+ </function>
+
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
+ <description>Provides update to app of which policy-table-enabled functions are available</description>
+ <param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true" mandatory="true">
+ <description>Change in permissions for a given set of RPCs</description>
+ </param>
+ </function>
+
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification" since="2.0">
+ <description>Binary data is in binary part of hybrid msg</description>
+ </function>
+
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification" since="2.0">
+ <param name="language" type="Language" mandatory="true">
+ <description>Current SDL voice engine (VR+TTS) language</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <description>Current display language</description>
+ </param>
+ </function>
+
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" since="3.0">
+
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+
+ <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" since="3.0">
+ <description>Notifies about touch events on the screen's prescribed area</description>
+ <param name="type" type="TouchType" mandatory="true">
+ <description>The type of touch event.</description>
+ </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" since="3.0">
+ <description>
+ An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
+ Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ </description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
+ <param name="url" type="String" maxlength="1000" mandatory="false">
+ <description>
+ Optional URL for HTTP requests.
+ If blank, the binary data shall be forwarded to the app.
+ If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional timeout for HTTP requests
+ Required if a URL is provided
+ </description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ </function>
+
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification" since="3.0">
+ <description>
+ Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
+ Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
+ </description>
+ <param name="hashID" type="String" maxlength="100" mandatory="true">
+ <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
+ </param>
+ </function>
+
+ <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification" since="4.1">
+ <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
+ <param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ </function>
+
+ <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification" since="5.0">
+ <description>Issued by SDL to notify the application about remote control status change on SDL</description>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="allocatedModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+ </function>
+
+ <!-- ~~~~~~~~~~~~~~~~~~ -->
+ <!-- Ford Specific APIs -->
+ <!-- ~~~~~~~~~~~~~~~~~~ -->
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" since="1.0">
+ <description>
+ Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
+ Legacy / v1 Protocol implementation; use SyncPData instead.
+ *** DEPRECATED ***
+ </description>
+
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ <todo>What is the maxlength?</todo>
+ </param>
+ </function>
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <!-- Deprecating - covered by SystemRequest
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="request" >
+ <description>
+ Allows binary data in the form of SyncP packets to be sent to the SYNC module.
+ Binary data is in binary part of hybrid msg.
+ </description>
+ </function>
+
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ -->
+
+ <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" since="1.0">
+ <description>
+ Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
+ Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
+ *** DEPRECATED ***
+ </description>
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" mandatory="true" array="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ </param>
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+ </function>
+
+
+ <!-- Deprecating - covered by OnSystemRequest
+ <function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
+ <description>
+ Callback including binary data of any SyncP packets that SYNC needs to send back to the mobile device.
+ Responds to SyncPData.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+
+ </function>
+ -->
+</interface>
diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
deleted file mode 100644
index 2d53559ad1..0000000000
--- a/src/components/interfaces/QT_HMI_API.xml
+++ /dev/null
@@ -1,4156 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<!--
-* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE. -->
-<interfaces name="SmartDeviceLink HMI API">
- <interface name="Common" version="1.1" date="2013-10-02">
- <enum name="Result">
- <element name="SUCCESS" value="0"/>
- <element name="UNSUPPORTED_REQUEST" value="1"/>
- <element name="UNSUPPORTED_RESOURCE" value="2"/>
- <element name="DISALLOWED" value="3"/>
- <element name="REJECTED" value="4"/>
- <element name="ABORTED" value="5"/>
- <element name="IGNORED" value="6"/>
- <element name="RETRY" value="7"/>
- <element name="IN_USE" value="8"/>
- <element name="DATA_NOT_AVAILABLE" value="9"/>
- <element name="TIMED_OUT" value="10"/>
- <element name="INVALID_DATA" value="11"/>
- <element name="CHAR_LIMIT_EXCEEDED" value="12"/>
- <element name="INVALID_ID" value="13"/>
- <element name="DUPLICATE_NAME" value="14"/>
- <element name="APPLICATION_NOT_REGISTERED" value="15"/>
- <element name="WRONG_LANGUAGE" value="16"/>
- <element name="OUT_OF_MEMORY" value="17"/>
- <element name="TOO_MANY_PENDING_REQUESTS" value="18"/>
- <element name="NO_APPS_REGISTERED" value="19"/>
- <element name="NO_DEVICES_CONNECTED" value="20"/>
- <element name="WARNINGS" value="21"/>
- <element name="GENERIC_ERROR" value="22"/>
- <element name="USER_DISALLOWED" value="23"/>
- <element name="TRUNCATED_DATA" value="24"/>
- </enum>
- <enum name="TransportType">
- <description>
- Lists of the transport types used for device connection to HU.
- </description>
- <element name="BLUETOOTH"/>
- <element name="USB_IOS"/>
- <element name="USB_AOA"/>
- <element name="WIFI"/>
- </enum>
- <enum name="ButtonName">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
- <element name="OK"/>
- <element name="SEEKLEFT"/>
- <element name="SEEKRIGHT"/>
- <element name="TUNEUP"/>
- <element name="TUNEDOWN"/>
- <element name="PRESET_0"/>
- <element name="PRESET_1"/>
- <element name="PRESET_2"/>
- <element name="PRESET_3"/>
- <element name="PRESET_4"/>
- <element name="PRESET_5"/>
- <element name="PRESET_6"/>
- <element name="PRESET_7"/>
- <element name="PRESET_8"/>
- <element name="PRESET_9"/>
- <element name="CUSTOM_BUTTON"/>
- <element name="SEARCH"/>
- </enum>
- <enum name="ButtonEventMode">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
- <enum name="ButtonPressMode">
- <element name="LONG">
- <description>A button was released, after it was pressed for a long time. Actual timing is defined by head unit and may vary</description>
- </element>
- <element name="SHORT">
- <description>A button was released, after it was pressed for a short time. Actual timing is defined by head unit and may vary</description>
- </element>
- </enum>
- <enum name="Language">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO">
- <description>Norwegian - Norway</description>
- </element>
- <element name="NL-BE" internal_name="NL_BE">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK">
- <description>Slovak - Slovakia</description>
- </element>
- </enum>
- <enum name="SoftButtonType">
- <description>Contains information about the SoftButton capabilities.</description>
- <element name="TEXT" internal_name="SBT_TEXT"/>
- <element name="IMAGE" internal_name="SBT_IMAGE"/>
- <element name="BOTH" internal_name="SBT_BOTH"/>
- </enum>
- <enum name="SystemAction">
- <description>Enumeration that describes system actions that can be triggered.</description>
- <element name="DEFAULT_ACTION">
- <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
- </element>
- <element name="STEAL_FOCUS">
- <description>The calling app's dialog or related event should clear and the app should be brought into HMI_FULL.</description>
- </element>
- <element name="KEEP_CONTEXT">
- <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
- </element>
- </enum>
- <enum name="AppHMIType">
- <description>Enumeration listing possible app types.</description>
- <element name="DEFAULT"/>
- <element name="COMMUNICATION"/>
- <element name="MEDIA"/>
- <element name="MESSAGING"/>
- <element name="NAVIGATION"/>
- <element name="INFORMATION"/>
- <element name="SOCIAL"/>
- <element name="BACKGROUND_PROCESS"/>
- <element name="TESTING"/>
- <element name="SYSTEM"/>
- </enum>
- <enum name="LayoutMode">
- <description>For touchscreen interactions, the mode of how the choices are presented.</description>
- <element name="ICON_ONLY"/>
- <description>This mode causes the interaction to display the previous set of choices as icons.</description>
- <element name="ICON_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
- <element name="LIST_ONLY"/>
- <description>This mode causes the interaction to display the previous set of choices as a list.</description>
- <element name="LIST_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
- <element name="KEYBOARD"/>
- <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
- </enum>
- <enum name="DeactivateReason">
- <description>Specifies the functionality the User has switched to.</description>
- <element name="AUDIO">
- <description>Navigated to audio(radio, etc)</description>
- </element>
- <element name="PHONECALL">
- <description>Navigated to make a call.</description>
- </element>
- <element name="NAVIGATIONMAP">
- <description>Navigated to navigation screen.</description>
- </element>
- <element name="PHONEMENU">
- <description>Navigated to phone menu.</description>
- </element>
- <element name="SYNCSETTINGS">
- <description>Navigated to settings menu.</description>
- </element>
- <element name="GENERAL">
- <description>Other screens navigation apart from other mobile app.</description>
- </element>
- </enum>
- <enum name="ClockUpdateMode">
- <description>Describes how the media clock timer should behave on the platform</description>
- <element name="COUNTUP"/>
- <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
- <element name="COUNTDOWN"/>
- <description>Starts the media clock timer counting downwards, as in time remaining.</description>
- <element name="PAUSE"/>
- <description>Pauses the media clock timer</description>
- <element name="RESUME"/>
- <description>Resume the media clock timer</description>
- <element name="CLEAR"/>
- <description>Clears the media clock timer (previously done through Show-&gt;mediaClock)</description>
- </enum>
- <enum name="SystemContext">
- <description>Enumeration that describes possible contexts the application might be in on HU.</description>
- <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
- <element name="MAIN" internal_name="SYSCTXT_MAIN">
- <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
- <description> There is currently no user interaction (user-initiated or app-initiated) with the head-unit</description>
- </element>
- <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
- <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
- </element>
- <element name="MENU" internal_name="SYSCTXT_MENU">
- <description>The system is currently displaying a system or in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently obscuring with either a system or other app's overlay (except of Alert element).</description>
- </element>
- <element name="ALERT" internal_name="SYSCTXT_ALERT">
- <description>Broadcast only to whichever app has an alert currently being displayed.</description>
- </element>
- </enum>
- <enum name="HmiZoneCapabilities">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT"/>
- <element name="BACK"/>
- </enum>
- <enum name="SpeechCapabilities">
- <description>Contains information about the TTS capabilities.</description>
- <element name="TEXT" internal_name="SC_TEXT"/>
- <element name="SAPI_PHONEMES"/>
- <element name="LHPLUS_PHONEMES"/>
- <element name="PRE_RECORDED"/>
- <element name="SILENCE"/>
- </enum>
- <enum name="VrCapabilities">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
- <enum name="PrerecordedSpeech">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE"/>
- <element name="INITIAL_JINGLE"/>
- <element name="LISTEN_JINGLE"/>
- <element name="POSITIVE_JINGLE"/>
- <element name="NEGATIVE_JINGLE"/>
- </enum>
- <enum name="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST"/>
- <element name="ROUTE_ACCEPTED"/>
- <element name="ROUTE_REFUSED"/>
- <element name="ROUTE_CANCELLED"/>
- <element name="ETA_REQUEST"/>
- <element name="NEXT_TURN_REQUEST"/>
- <element name="ROUTE_STATUS_REQUEST"/>
- <element name="ROUTE_SUMMARY_REQUEST"/>
- <element name="TRIP_STATUS_REQUEST"/>
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT"/>
- </enum>
- <enum name="ApplicationsCloseReason">
- <description>Describes the reasons for exiting all of applications.</description>
- <element name="IGNITION_OFF"/>
- <element name="MASTER_RESET"/>
- <element name="FACTORY_DEFAULTS"/>
- <element name="SUSPEND" />
- </enum>
- <enum name="DisplayType">
- <description>The possible types of HU display.</description>
- <element name="CID">
- <description> A 2-line x 20 character "dot matrix" display </description>
- </element>
- <element name="TYPE2">
- <description> 1 line older radio head unit.</description>
- </element>
- <element name="TYPE5">
- <description> Old radio head unit.</description>
- </element>
- <element name="NGN">
- <description> Next Generation Navigation display.</description>
- </element>
- <element name="GEN2_8_DMA">
- <description> GEN-2, 8 inch display.</description>
- </element>
- <element name="GEN2_6_DMA">
- <description> GEN-2, 6 inch display.</description>
- </element>
- <element name="MFD3">
- <description> 3 inch GEN1.1 display </description>
- </element>
- <element name="MFD4">
- <description> 4 inch GEN1.1 display </description>
- </element>
- <element name="MFD5">
- <description> 5 inch GEN1.1 display </description>
- </element>
- <element name="GEN3_8_INCH"/>
- </enum>
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC"/>
- <element name="DYNAMIC"/>
- </enum>
- <enum name="ApplicationExitReason">
- <element name="DRIVER_DISTRACTION_VIOLATION" >
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="USER_EXIT" >
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="UNAUTHORIZED_TRANSPORT_REGISTRATION">
- <description>By getting this value, SDL unregisters the named application</description>
- </element>
- </enum>
- <enum name="TextFieldName">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText2">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText3">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="scrollableMessageBody">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
- <element name="initialInteractionText">
- <description> First line suggestion for a user response (in the case of VR enabled interaction</description>
- </element>
- <element name="navigationText1">
- <description> First line of navigation text</description>
- </element>
- <element name="navigationText2">
- <description> Second line of navigation text</description>
- </element>
- <element name="ETA">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
- <element name="totalDistance">
- <description> Total distance to destination for navigation</description>
- </element>
- <element name="audioPassThruDisplayText1">
- <description> First line of text for audio pass thru</description>
- </element>
- <element name="audioPassThruDisplayText2">
- <description> Second line of text for audio pass thru</description>
- </element>
- <element name="sliderHeader">
- <description> Header text for slider</description>
- </element>
- <element name="sliderFooter">
- <description> Footer text for slider</description>
- </element>
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
- <element name="timeToDestination"/>
- <element name="navigationText">
- <description>Navigation text for UpdateTurnList.</description>
- </element>
- <element name="notificationText">
- <description>Text of notification to be displayed on screen.</description>
- </element>
- <element name="locationName">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
- <element name="locationDescription">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <element name="addressLines">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
- <element name="phoneNumber">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <!-- TO DO to be removed -->
- <element name="turnText"/>
- </enum>
- <enum name="ImageFieldName">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
- <element name="graphic">
- <description>The image field for Show</description>
- </element>
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
- <element name="locationImage">
- <description>The optional image of a destination / location</description>
- </element>
- </enum>
- <enum name="TextAlignment">
- <description>The list of possible alignments, left, right, or centered</description>
- <element name="LEFT_ALIGNED"/>
- <element name="RIGHT_ALIGNED"/>
- <element name="CENTERED"/>
- </enum>
- <enum name="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON"/>
- <element name="DD_OFF"/>
- </enum>
- <enum name="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- Is used for Type II, NGN and CID head units.
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- Is used for Type V head units.
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- Is used for GEN1.1 (i.e. MFD3/4/5) head units.
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type II head unit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for CID and NGN head unit
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type V head unit
- </description>
- </element>
- <element name="CLOCKTEXT4">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- Is used for GEN1.1 (i.e. MFD3/4/5) head units
- </description>
- </element>
- </enum>
- <enum name="VRCommandType">
- <element name="Choice">
- <description>Type that expound that current AddCommand should be pocessed as choise for initiated PerformInteraction request for current active on HMI.</description>
- </element>
- <element name="Command">
- <description>Type that expound that current AddCommand should be pocessed as common command for current application on HMI.</description>
- </element>
- </enum>
- <!--IVI part-->
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- <description> The data is unknown.</description>
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- <description> The volume is normal.</description>
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- <description> The volume is low.</description>
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- <description> The module/sensor is currently faulted. </description>
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- <description> The component`s volume is in critical level.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- <description> The data is not supported.</description>
- </element>
- </enum>
- <enum name="PRNDL">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="FAULT">
- </element>
- </enum>
- <enum name="VehicleDataEventStatus">
- <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
- <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
- <description> The system does not have the adequate information to send valid YES or NO states.</description>
- </element>
- <element name="NO" internal_name="VDES_NO">
- <description> The requested event is in NO state.</description>
- </element>
- <element name="YES" internal_name="VDES_YES">
- <description> The requested event is in YES state.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- <description> The requested data is not supported </description>
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- <description> The module/sensor is currently faulted.</description>
- </element>
- </enum>
- <enum name="VehicleDataStatus">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
- <enum name="IgnitionStableStatus">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- <description> Either the data is not accessible or the sensor is broken.</description>
- </element>
- </enum>
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- <description> The information is not acceptable. </description>
- </element>
- <element name="OFF" internal_name="IS_OFF">
- <description> The ignition is off.</description>
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- <description> The accessories are active (power windows, audio, display, etc.).</description>
- </element>
- <element name="RUN" internal_name="IS_RUN">
- <description> Ignition is active.</description>
- </element>
- <element name="START" internal_name="IS_START">
- <description> Starter is switched.</description>
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- <description> The data is provided, but there is some sort of fault or problem.</description>
- </element>
- </enum>
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported component status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
- <enum name="PrimaryAudioSource">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- </enum>
- <enum name="CompassDirection">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
- <enum name="Dimension">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and lattitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and lattitude and altitude</description>
- </element>
- </enum>
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
- <enum name="WarningLightStatus">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
- <enum name="VehicleDataResultCode">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
- <element name="IGNORED" internal_name="VDRC_IGNORED"/>
- </enum>
- <enum name="VehicleDataType">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED"/>
- <element name="VEHICLEDATA_RPM"/>
- <element name="VEHICLEDATA_FUELLEVEL"/>
- <element name="VEHICLEDATA_FUELLEVEL_STATE"/>
- <element name="VEHICLEDATA_FUELCONSUMPTION"/>
- <element name="VEHICLEDATA_EXTERNTEMP"/>
- <element name="VEHICLEDATA_VIN"/>
- <element name="VEHICLEDATA_PRNDL"/>
- <element name="VEHICLEDATA_TIREPRESSURE"/>
- <element name="VEHICLEDATA_ODOMETER"/>
- <element name="VEHICLEDATA_BELTSTATUS"/>
- <element name="VEHICLEDATA_BODYINFO"/>
- <element name="VEHICLEDATA_DEVICESTATUS"/>
- <element name="VEHICLEDATA_ECALLINFO"/>
- <element name="VEHICLEDATA_AIRBAGSTATUS"/>
- <element name="VEHICLEDATA_EMERGENCYEVENT"/>
- <element name="VEHICLEDATA_CLUSTERMODESTATUS"/>
- <element name="VEHICLEDATA_MYKEY"/>
- <element name="VEHICLEDATA_BRAKING"/>
- <element name="VEHICLEDATA_WIPERSTATUS"/>
- <element name="VEHICLEDATA_HEADLAMPSTATUS"/>
- <element name="VEHICLEDATA_BATTVOLTAGE"/>
- <element name="VEHICLEDATA_ENGINETORQUE"/>
- <element name="VEHICLEDATA_ACCPEDAL"/>
- <element name="VEHICLEDATA_STEERINGWHEEL"/>
- </enum>
- <enum name="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF">
- <description> The wipers are off.</description>
- </element>
- <element name="AUTO_OFF">
- <description> The wipers are automatically off </description>
- </element>
- <element name="OFF_MOVING">
- <description> Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).</description>
- </element>
- <element name="MAN_INT_OFF">
- <description> The wipers are manually off after having been working.</description>
- </element>
- <element name="MAN_INT_ON">
- <description> The wipers are manually on.</description>
- </element>
- <element name="MAN_LOW">
- <description> The wipers are manually set to low speed.</description>
- </element>
- <element name="MAN_HIGH">
- <description> The wipers are manually set to high speed.</description>
- </element>
- <element name="MAN_FLICK">
- <description> The wipers are manually set for doing a flick.</description>
- </element>
- <element name="WASH">
- <description> The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.</description>
- </element>
- <element name="AUTO_LOW">
- <description> The wipers are automatically set to low speed.</description>
- </element>
- <element name="AUTO_HIGH">
- <description> The wipers are automatically set to high speed.</description>
- </element>
- <element name="COURTESYWIPE">
- <description> This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid.</description>
- </element>
- <element name="AUTO_ADJUST">
- <description> This is set as the user moves between possible automatic wiper speeds.</description>
- </element>
- <element name="STALLED">
- <description> The wiper is stalled to its place. </description>
- </element>
- <element name="NO_DATA_EXISTS">
- <description> The sensor / module cannot provide any information for wiper.</description>
- </element>
- </enum>
- <enum name="SamplingRate">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
- </enum>
- <enum name="BitsPerSample">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
- </enum>
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM"/>
- </enum>
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY"/>
- <element name="QWERTZ"/>
- <element name="AZERTY"/>
- </enum>
- <enum name="KeyboardEvent">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS"/>
- <element name="ENTRY_SUBMITTED"/>
- <element name="ENTRY_VOICE" />
- <element name="ENTRY_CANCELLED"/>
- <element name="ENTRY_ABORTED"/>
- </enum>
- <enum name="KeypressMode">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="SINGLE_KEYPRESS">
- <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
- </element>
- <element name="QUEUE_KEYPRESSES">
- <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
- </element>
- <element name="RESEND_CURRENT_ENTRY">
- <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
- </element>
- </enum>
- <enum name="AmbientLightStatus">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT"/>
- <element name="TWILIGHT_1"/>
- <element name="TWILIGHT_2"/>
- <element name="TWILIGHT_3"/>
- <element name="TWILIGHT_4"/>
- <element name="DAY"/>
- <element name="UNKNOWN"/>
- <element name="INVALID"/>
- </enum>
- <enum name="FileType">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP"/>
- <element name="GRAPHIC_JPEG"/>
- <element name="GRAPHIC_PNG"/>
- <element name="AUDIO_WAVE"/>
- <element name="AUDIO_MP3"/>
- <element name="AUDIO_AAC"/>
- <element name="BINARY"/>
- <element name="JSON"/>
- </enum>
- <enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP"/>
- <element name="FILE_RESUME"/>
- <element name="AUTH_REQUEST"/>
- <element name="AUTH_CHALLENGE"/>
- <element name="AUTH_ACK"/>
- <element name="PROPRIETARY"/>
- <element name="QUERY_APPS" />
- <element name="LAUNCH_APP" />
- <element name="LOCK_SCREEN_ICON_URL" />
- <element name="TRAFFIC_MESSAGE_CHANNEL" />
- <element name="DRIVER_PROFILE" />
- <element name="VOICE_SEARCH" />
- <element name="NAVIGATION" />
- <element name="PHONE" />
- <element name="CLIMATE" />
- <element name="SETTINGS" />
- <element name="VEHICLE_DIAGNOSTICS" />
- <element name="EMERGENCY" />
- <element name="MEDIA" />
- <element name="FOTA" />
- </enum>
- <enum name="ECallConfirmationStatus">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
- <enum name="VehicleDataNotificationStatus">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
- <enum name="EmergencyEventType">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
- <enum name="FuelCutoffStatus">
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
- <enum name="PowerModeQualificationStatus">
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
- <enum name="CarModeStatus">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
- <enum name="PowerModeStatus">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
- <enum name="CharacterSet">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
- <!-- End of IVI part-->
- <enum name="AppPriority">
- <element name="EMERGENCY"/>
- <element name="NAVIGATION"/>
- <element name="VOICE_COMMUNICATION"/>
- <element name="COMMUNICATION"/>
- <element name="NORMAL"/>
- <element name="NONE"/>
- </enum>
-<enum name="MethodName">
- <description>Defines the type of the request which causes text-to-speech prompt</description>
- <element name="ALERT" />
- <element name="SPEAK" />
- <element name="AUDIO_PASS_THRU" />
- <element name="ALERT_MANEUVER" />
-</enum>
-
-<enum name="AlertType">
-<description>Defines the type of the request which causes text-to-speech prompt</description>
-<element name="UI" />
-<element name="BOTH" />
-</enum>
-
-<enum name="HMILevel">
- <element name="FULL"/>
- <element name="LIMITED" />
- <element name="BACKGROUND"/>
- <element name="NONE"/>
-</enum>
-
- <!-- Policies -->
- <enum name="UpdateResult">
- <element name="UP_TO_DATE"/>
- <element name="UPDATING"/>
- <element name="UPDATE_NEEDED"/>
- </enum>
- <enum name="SystemError">
- <element name="SYNC_REBOOTED"/>
- <element name="SYNC_OUT_OF_MEMMORY"/>
- </enum>
- <enum name="StatisticsType">
- <element name="iAPP_BUFFER_FULL"/>
- </enum>
- <enum name="ConsentSource">
- <element name="GUI"/>
- <element name="VUI"/>
- </enum>
- <enum name="DeviceState">
- <element name="UNKNOWN"/>
- <element name="UNPAIRED"/>
- </enum>
- <struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="String" mandatory="true">
- <description>The ID of the device connected</description>
- </param>
- <param name="transportType" type="Common.TransportType" mandatory="false">
- <description>The transport type the named-app's-device is connected over HU(BlueTooth, USB or WiFi). It must be provided in OnAppRegistered and in UpdateDeviceList</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
- </param>
- </struct>
- <struct name="UserFriendlyMessage" scope="internal">
- <param name="messageCode" type="String" mandatory="true"/>
- <param name="ttsString" type="String" mandatory="false"/>
- <param name="label" type="String" mandatory="false"/>
- <param name="line1" type="String" mandatory="false"/>
- <param name="line2" type="String" mandatory="false"/>
- <param name="textBody" type="String" mandatory="false"/>
- </struct>
- <struct name="PermissionItem">
- <param name="name" type="String" mandatory="true">
- <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>Id of corresponding functional group, needed by SDL.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="false">
- <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
- </param>
- </struct>
- <struct name="ServiceInfo">
- <param name="url" type="String" mandatory="true">
- <description>Get URL based on service type.</description>
- </param>
- <param name="policyAppId" type="String" mandatory="false">
- <description>Used if URL needed are specific for application.</description>
- </param>
- </struct>
- <!-- End of Policies -->
- <struct name="TextField">
- <param name="name" type="Common.TextFieldName">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="Common.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="ButtonCapabilities">
- <description>Contains the information about capabilities of a button.</description>
- <param name="name" type="Common.ButtonName" mandatory="true">
- <description>The name of the Button from the ButtonName enum</description>
- </param>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press. Whenever the button is pressed short, onButtonPressed(SHORT) should be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press. Whenever the button is pressed long, onButtonPressed(LONG) should be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent(DOWN) should be invoked. Whenever the button is released, onButtonEvent(UP) should be invoked.</description>
- </param>
- </struct>
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="Common.VehicleDataResultCode">
- <description>Published data result code.</description>
- </param>
- </struct>
- <struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="String" mandatory="true">
- <description>The ID of the device connected: either hash of device's USB serial number(in case of USB connection) or hash of device's MAC address(in case of BlueTooth or WIFI connection).</description>
- </param>
- <param name="transportType" type="Common.TransportType" mandatory="false">
- <description>The transport type the named-app's-device is connected over HU(BlueTooth, USB or WiFi). It must be provided in OnAppRegistered and in UpdateDeviceList</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
- </param>
- </struct>
- <struct name="TouchCoord">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
- <struct name="TouchEvent">
- <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
- <description>
- A touch's unique identifier. The application can track the current touch events by id.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="Common.TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities (whether the HW preset buttons could be duplicated with onscreen buttons).</description>
- <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
- <description>Must be true if onscreen custom presets are available.</description>
- </param>
- </struct>
- <struct name="Image">
- <param name="value" maxlength="65535" type="String" mandatory="true">
- <description>The path to the dynamic image stored on HU or the static binary image itself.</description>
- </param>
- <param name="imageType" type="Common.ImageType" mandatory="true">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="SoftButton">
- <param name="type" type="Common.SoftButtonType" mandatory="true">
- <description>Describes, whether text, icon or both text and image should be displayed on the soft button. See softButtonType</description>
- </param>
- <param name="text" maxlength="500" type="String" mandatory="false">
- <description>Optional text to be displayed (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" mandatory="false">
- <description>If true, must be highlighted</description>
- <description>If false, must be not</description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Value which must be returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="Common.SystemAction" mandatory="true">
- <description>Parameter indicates whether clicking a SoftButton must call a specific system action. See SystemAction</description>
- </param>
- </struct>
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
- <param name="text" type="String" mandatory="true" maxlength="500">
- <description>The text or phonemes to be spoken.</description>
- </param>
- <param name="type" type="Common.SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
- </param>
- </struct>
- <struct name="HMIApplication">
- <description>Data type containing information about application needed by HMI.</description>
- <param name="appName" type="String" maxlength="100" mandatory="true">
- <description>The mobile application name, e.g. "Ford Drive Green".</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Provides an abbreviated version of the app name (if needed), that may be displayed on the NGN media screen.</description>
- <description>If not provided, the appName should be used instead (and may be truncated if too long)</description>
- </param>
- <param name="icon" type="String" mandatory="false">
- <description>Path to application icon stored on HU.</description>
- </param>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
- </param>
- <param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
- <description>Policy ID(=the appID the application registers with) of registered application.</description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Unique (during ignition cycle) id of the application. To be used in all RPCs sent by both HU system and SDL</description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="true">
- <description>The language the application intends to use on HU </description>
- </param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
- <description>Indicates whether it is a media or a non-media application.</description>
- </param>
- <param name="appType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>List of all applicable app types stating which classifications to be given to the app.</description>
- <description>e.g. for platforms like GEN2, this determines which "corner(s)" the app can populate.</description>
- </param>
- <param name="greyOut" type="Boolean" mandatory="false">
- <description>Indicates whether application should be dimmed on the screen.</description>
- <description>Applicable only for apps received through QueryApps and still not registered.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application</description>
- <description>(the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).</description>
- <description>If SDL sends an empty array - any RequestType is allowed for this app.</description>
- <description>If SDL omits this parameter - none RequestType is allowed for this app</description>
- <description>(either this is a pre-registered app or such is dictated by policies).</description>
- </param>
- </struct>
- <struct name="MenuParams">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>unique ID of the sub menu, the command must be added to.</description>
- <description>If not provided, the command must be added to the top level of the in application menu.</description>
- </param>
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>Position within the items that are at the top level of the in application menu.</description>
- <description>0 should insert at the front.</description>
- <description>1 should insert at the second position.</description>
- <description>if position is greater than or equal to the number of items on the top level, the the sub menu/command should be appended to the end.</description>
- <description>If this param is omitted the entry should be added at the end.</description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="true">
- <description>The name of the sub menu/command.</description>
- </param>
- </struct>
- <struct name="Choice">
- <description>A choice is an option given to the user which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description> The unique within the concerned application identifier for this choice </description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="false">
- <description> The name of the choice </description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description> The image for representing the choice </description>
- </param>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
- </param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
- <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
- </param>
- <param name="secondaryImage" type="Image" mandatory="false">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
- <struct name="VrHelpItem">
- <param name="text" maxlength="500" type="String" mandatory="true">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
- <struct name="TimeFormat">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>The hour of the media clock.</description>
- <description>Some units only support a max of 19 hours. If out of range, it should be rejected.</description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- </struct>
- <struct name="TouchEventCapabilities">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution height.</description>
- </param>
- </struct>
- <struct name="ScreenParams">
- <param name="resolution" type="Common.ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="Common.TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
- <struct name="ImageField">
- <param name="name" type="Common.ImageFieldName" mandatory="true">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="Common.FileType" maxsize="100" array="true" mandatory="false" minsize="1">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="Common.ImageResolution" mandatory="false">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="Common.DisplayType" mandatory="true">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
- <description>If there are no textfields supported, the empty array must be returned</description>
- </param>
- <param name="imageFields" type="Common.ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="Common.MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="imageCapabilities" type="Common.ImageType" array="true" minsize="0" maxsize="2" mandatory="false">
- </param>
- <param name="graphicSupported" type="Boolean" mandatory="true">
- <description>The display's persistent screen supports referencing a static or dynamic image.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="true">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="Common.ScreenParams" mandatory="false">
- <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
- </struct>
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press.</description>
- <description>Whenever the button is pressed short, onButtonPressed( SHORT) must be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press.</description>
- <description>Whenever the button is pressed long, onButtonPressed( LONG) must be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up".</description>
- <description>Whenever the button is pressed, onButtonEvent( DOWN) must be invoked.</description>
- <description>Whenever the button is released, onButtonEvent( UP) must be invoked.</description>
- </param>
- <param name="imageSupported" type="Boolean" mandatory="true">
- <description>Must be true if the button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="HMICapabilities">
- <param name="navigation" type="Boolean" mandatory="false">
- <description>Availability of build in Nav. True: Available, False: Not Available</description>
- </param>
- <param name="phoneCall" type="Boolean" mandatory="false">
- <description>Availability of build in phone. True: Available, False: Not Available</description>
- </param>
- </struct>
- <struct name="AudioPassThruCapabilities">
- <description>
- Describes different audio type configurations for PerformAudioPassThru.
- e.g. 8kHz,8-bit,PCM
- </description>
- <param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
- <param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
- <param name="audioType" type="Common.AudioType" mandatory="true"/>
- </struct>
- <struct name="TextFieldStruct">
- <param name="fieldName" type="Common.TextFieldName" mandatory="true">
- <description>The name of the field for displaying the text.</description>
- </param>
- <param name="fieldText" type="String" maxlength="500" mandatory="true">
- <description>The text itself.</description>
- </param>
- </struct>
- <struct name="KeyboardProperties">
- <description>Configuration of on-screen keyboard (if available).</description>
- <param name="language" type="Common.Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
- <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="false">
- <description>Desired keyboard layout.</description>
- </param>
- <param name="keypressMode" type="Common.KeypressMode" mandatory="false">
- <description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- </description>
- </param>
- <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Array of keyboard characters to enable.</description>
- <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
- <description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
- <struct name="Turn">
- <param name="navigationText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses navigationText from TextFieldStruct.</description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- </struct>
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle</description>
- <description>e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle</description>
- <description>e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle</description>
- <description>e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle</description>
- <description>e.g. SE</description>
- </param>
- </struct>
- <!--IVI part-->
- <struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>PDOP.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>HDOP.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>VDOP.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="false">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Common.Dimension" mandatory="false">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
- <description>The speed in KPH</description>
- </param>
- </struct>
- <struct name="SingleTireStatus">
- <param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The status of component volume. See ComponentVolumeStatus.</description>
- </param>
- </struct>
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data (the address from ReadDID request)</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the low beam lamps.</description>
- </param>
- <param name="highBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the high beam lamps.</description>
- </param>
- <param name="ambientLightSensorStatus" type="Common.AmbientLightStatus" mandatory="true">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
- <param name="pressureTelltale" type="Common.WarningLightStatus" mandatory="false">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean" mandatory="true">
- <description>Must be true if the park brake is active</description>
- </param>
- <param name="ignitionStableStatus" type="Common.IgnitionStableStatus" mandatory="true">
- <description>Information about the ignition switch. See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="Common.IgnitionStatus" mandatory="true">
- <description>The status of the ignition. See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
- <struct name="DeviceStatus">
- <param name="voiceRecOn" type="Boolean" mandatory="false">
- <description>Must be true if the voice recording is on.</description>
- </param>
- <param name="btIconOn" type="Boolean" mandatory="false">
- <description>Must be true if Bluetooth icon is displayed.</description>
- </param>
- <param name="callActive" type="Boolean" mandatory="false">
- <description>Must be true if there is an active call..</description>
- </param>
- <param name="phoneRoaming" type="Boolean" mandatory="false">
- <description>Must be true if ther is a phone roaming.</description>
- </param>
- <param name="textMsgAvailable" type="Boolean" mandatory="false">
- <description>Must be true if the text message is available.</description>
- </param>
- <param name="battLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device battery level status. See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if stereo audio output is muted.</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if mono audio output is muted.</description>
- </param>
- <param name="signalLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device signal level status. See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="Common.PrimaryAudioSource" mandatory="false">
- <description>See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean" mandatory="false">
- <description>Must be true if emergency call event is active.</description>
- </param>
- </struct>
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="multipleEvents" type="Common.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="Common.PowerModeQualificationStatus">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="Common.CarModeStatus">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="Common.PowerModeStatus">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
- <struct name="MyKey">
- <param name="e911Override" type="Common.VehicleDataStatus" mandatory="true">
- <description>Indicates whether e911 override is on. See VehicleDataStatus.</description>
- </param>
- </struct>
- <!--end of IVI part-->
- </interface>
- <interface name="Buttons" version="1.0" date="2013-04-12">
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="capabilities" type="Common.ButtonCapabilities" array="true" minsize="1" maxsize="100" mandatory="true">
- <description>Response must provide the names of available buttons and their capabilities.See ButtonCapabilities</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>Must be returned if the platform supports custom on-screen Presets</description>
- </param>
- </function>
- <function name="OnButtonEvent" messagetype="notification" provider="hmi">
- <description>HU system must notify about every UP/DOWN event for buttons</description>
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonEventMode" mandatory="true">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be provided if ButtonName is CUSTOM_BUTTON, this references the integer ID passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonPress" messagetype="notification" provider="hmi">
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonPressMode" mandatory="true">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be returned if ButtonName is CUSTOM_BUTTON, this references the string passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonSubscription" messagetype="notification">
- <description>
- Sender: SDL->HMI. Purpose: to notify about button subscription state is changed for the named application
- </description>
- <param name="name" type="Common.ButtonName" mandatory="true" />
- <param name="isSubscribed" type="Boolean" mandatory="true">
- <description>
- Defines whether the named button has status of 'subscribed' or 'unsubscribed':
- If "true" - the named button is subscribed.
- If "false" - the named button is unsubscribed.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>
- The ID of application that relates to this button-subscription status change.
- </description>
- </param>
- </function>
- </interface>
- <interface name="BasicCommunication" version="1.0" date="2013-04-12">
- <function name="OnReady" messagetype="notification" provider="hmi">
- <description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
- </function>
- <function name="OnStartDeviceDiscovery" messagetype="notification" provider="hmi">
- <description>Initiated by HMI user for getting the list of connected devices.</description>
- </function>
- <function name="OnUpdateDeviceList" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
- </function>
- <function name="OnPhoneCall" messagetype="notification">
- <description>Sender: HMI->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" provider="sdl">
- <description>This method must be invoked by SDL to update audio state.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>The ID of app to be resumed audio source.</description>
- </param>
- </function>
- <function name="OnSDLPersistenceComplete" messagetype="notification" provider="sdl">
- </function>
- <function name="UpdateAppList" messagetype="request" provider="hmi">
- <description>Issued by SDL to notify HMI about new applications registered.</description>
- <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="0" maxsize="100"/>
- </function>
- <function name="UpdateAppList" messagetype="response">
- </function>
- <function name="UpdateDeviceList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change device list.</description>
- <param name="deviceList" type="Common.DeviceInfo" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>The array of names/IDs of connected devices</description>
- </param>
- </function>
- <function name="UpdateDeviceList" messagetype="response">
- </function>
- <function name="OnFileRemoved" messagetype="notification" provider="sdl">
- <description>Notifies HMI in case some application file has been removed</description>
- <param name="fileName" type="String" minlength="1" maxlength="30" mandatory="true">
- <description>The name of the removed file</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>The file type. See FileType.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- </function>
- <function name="AllowDeviceToConnect" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
- <function name="OnDeviceChosen" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The name and ID of the device chosen</description>
- </param>
- </function>
- <function name="OnFindApplications" messagetype="notification" provider="hmi">
- <description>This method must be invoked by HMI to get list of registered apps.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="false">
- <description>The name and ID of the device the list of registered applications is required for.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to bring specified application to front on UI e.g make it HMI status 'FULL'.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="level" type="Common.HMILevel" mandatory="false">
- <description>If level for application is to be changed to something else then FULL then this parameter should be used.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- </function>
- <function name="OnAppActivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of selected application.</description>
- </param>
- </function>
- <function name="OnAppDeactivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="reason" type="Common.DeactivateReason" mandatory="true">
- <description>Specifies the functionality the user has switched to.</description>
- </param>
- </function>
- <function name="OnAppRegistered" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about new application registered.</description>
- <param name="application" type="Common.HMIApplication" mandatory="true">
- <description>The information about application registered. See HMIApplication. </description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="resumeVrGrammars" type="Boolean" mandatory="false">
- <description>The flag if VR grammars resume is required</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="OnAppUnregistered" messagetype="notification" provider="sdl">
- <description>
- Issued by SDL to notify HMI about application unregistered.
- Application then to be removed from application list; all data connected with application has to be cleared up.
- </description>
- <param name="unexpectedDisconnect" type="Boolean" mandatory="true">
- <description>
- SDL sends 'true' in case the connection is unexpectedly lost.
- SDL sends 'false' in case the mobile app is unregistered gracefully (via appropriate RPC)
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application unregistered</description>
- </param>
- </function>
- <function name="OnExitApplication" messagetype="notification" provider="hmi">
- <description>Must be sent by HMI when the User chooses to exit the application..</description>
- <param name="reason" type="Common.ApplicationExitReason" mandatory="true">
- <description>Specifies reason of moving the app to NONE</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application to be exited.</description>
- </param>
- </function>
- <function name="OnExitAllApplications" messagetype="notification" provider="hmi">
- <description>Sent by HMI to SDL to close all registered applications.</description>
- <param name="reason" type="Common.ApplicationsCloseReason" mandatory="true">
- <description>Specifies reason for exiting all apllications.</description>
- </param>
- </function>
- <function name="OnAwakeSDL" messagetype="notification">
- <description>
- Sender: HMI->SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
- </description>
- </function>
- <function name="MixingAudioSupported" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to find out if the last one supports mixing audio (i.e. recording TTS command and playing audio).</description>
- </function>
- <function name="MixingAudioSupported" messagetype="response">
- <description>If no response received SDL supposes that mixing audio is not supported</description>
- <param name="attenuatedSupported" type="Boolean" mandatory="true">
- <description>Must be true if supported</description>
- </param>
- </function>
- <function name="PlayTone" messagetype="notification" provider="sdl">
- <description>Sent by SDL to HMI to notify that the tone should be played.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application that invoked this notification</description>
- </param>
- <param name="methodName" type="Common.MethodName" mandatory="true">
- <description>Defines the name of app's request that initiates playing a tone</description>
- </param>
- </function>
- <!-- Policies -->
- <!-- SyncP RPC-->
- <function name="OnSystemRequest" messagetype="notification" provider="hmi">
- <description>
- An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
- Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
- </description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
- <description>Optional array of URL(s) for HTTP requests.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="request" provider="hmi">
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>The path to file.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="response">
- </function>
- <function name="PolicyUpdate" messagetype="request" provider="hmi">
- <description>
- From: SDL
- To: SYNCP Manager
- Asks SYNCP Manager to send given Policy Table snapshot to the backend
- </description>
- <param name="file" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>
- Location of policy table snapshot
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>
- Send attempt timeout in seconds
- </description>
- </param>
- <param name="retry" type="Integer" minvalue="0" maxvalue="65535" array="true" minsize="1" maxsize="5" mandatory="true">
- <description>
- Array of delays to wait after failed atempts
- </description>
- </param>
- </function>
- <function name="PolicyUpdate" messagetype="response">
- </function>
- <!-- End of SyncP RPC-->
- <function name="OnSDLClose" messagetype="notification" provider="sdl">
- <description>SDL must notify HMI about finish working application</description>
- </function>
- <function name="OnPutFile" messagetype="notification" provider="sdl">
- <description>
- Notification, that comes to HMI when mobile sents file with systemFile flag
- </description>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Full Size of file. sends in first OnPutFile notification if file is splited
- into many PutFiles
- </description>
- </param>
- <param name="FileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
- </function>
- <!-- Policies -->
- <function name="GetSystemInfo" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to obtain information about head unit system.</description>
- </function>
- <function name="GetSystemInfo" messagetype="response">
- <param name="ccpu_version" type="String" maxlength="500" mandatory="true">
- <description>Software version of the module</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>ISO 639-1 combined with ISO 3166 alpha-2 country code (i.e. en-us)</description>
- </param>
- <param name="wersCountryCode" type="String" maxlength="500" mandatory="true">
- <description>Country code from the Ford system WERS (i.e.WAEGB).</description>
- </param>
- </function>
- <function name="OnSystemInfoChanged" messagetype="notification" provider="hmi">
- <description>Issued by system to SDL to notify that some system param has changed. Currently applied for Sync Language.</description>
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnIgnitionCycleOver" messagetype="notification" provider="hmi">
- <description>Notification from system to SDL to let it know that ignition cycle is over.</description>
- </function>
- <function name="DecryptCertificate" messagetype="request">
- <description>Sender: SDL->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">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if VR is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has stopped.</description>
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command(string with associated id) to VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of a command (further to be used in OnCommand notification).</description>
- </param>
- <param name="vrCommands" type="String" mandatory="true" maxlength="99" minsize="1" maxsize="100" array="true">
- <description>List of strings to be used as VR commands.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>
- ID of the specific grammar, whether top-level or choice set.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Id of a command (list of strings), previously sent by AddCommand.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the specific grammar.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>
- Sets some properties for the application initiated request.
- </description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="initialPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the intial prompt spoken to the user at the start of an interaction. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeout" type="Integer" mandatory="true">
- <description>Timeout initiate timeoutPrompt</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- IDs of the specific compiled grammars for this voice interaction.
- </description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- </description>
- </param>
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notifies SDL about command trigerred via VR</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>ID of of the command (list of strings)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of VR.</description>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Request new VR synonyms registration
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language VR has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about VR supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in VR.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active VR language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Types of input recognized by VR module.</description>
- </param>
- </function>
- </interface>
- <interface name="TTS" version="1.0" date="2013-04-18">
- <description>RPCs for communication between TTS and SDL.</description>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See SpeechCapabilities</description>
- </param>
- <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See PrerecordedSpeech</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has stopped.</description>
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about presence of TTS module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if TTS is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Speak" messagetype="request" provider="hmi">
- <description>RPC from SDL to TTS for speaking the text.</description>
- <param name="ttsChunks" type="Common.TTSChunk" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of strings to be spoken.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- <param name="speakType" type="Common.MethodName" mandatory="false">
- <description>Defines the type of the request which causes text-to-speech</description>
- </param>
- </function>
- <function name="Speak" messagetype="response">
- <description>Provides information about success of operation.</description>
- </function>
- <function name="StopSpeaking" messagetype="request" provider="hmi">
- <description>Initiated by SDL to stop speaking the text.</description>
- </function>
- <function name="StopSpeaking" messagetype="response">
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
- <description>
- Request new ttsName registration
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- May not be empty.
- May not start with a new line character.
- Not unique value (SDL makes all the checks)
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language TTS has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up by SDL. Response must provide the information about TTS supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in TTS.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active TTS language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Sets some properties for the application initiated request.</description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnResetTimeout" messagetype="notification">
- <description>
- Sender: HMI->SDL. HMI must send this notification every 10 sec. in case the 'methodName'
- results long processing on HMI
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that concerns the 'methodName'.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>The name of the method, the renew of timeout is required for</description>
- </param>
- </function>
- </interface>
- <interface name="UI" version="1.0" date="2013-04-16">
- <function name="Alert" messagetype="request" provider="hmi">
- <description>Request from SDL to show an alert message on the display.</description>
- <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
- <description>Array of lines of alert text fields. See TextFieldStruct. Uses alertText1, alertText2, alertText3.</description>
- </param>
- <param name="duration" type="Integer" mandatory="true" minvalue="3000" maxvalue="10000">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" mandatory="false" minsize="0" maxsize="4" array="true">
- <description>App defined SoftButtons</description>
- </param>
- <param name="progressIndicator" type="Boolean" mandatory="false">
- <description>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</description>
- </param>
- <param name="alertType" type="Common.AlertType" mandatory="true">
- <description>Defines if only UI or BOTH portions of the Alert request are being sent to HMI Side</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="Alert" messagetype="response">
- <param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
- <description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
- </param>
- </function>
- <function name="Show" messagetype="request" provider="hmi">
- <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
- <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
- mainField1: The text that should be displayed in a single or upper display line.
- mainField2: The text that should be displayed on the second display line.
- mainField3: The text that should be displayed on the second "page" first display line.
- mainField4: The text that should be displayed on the second "page" second display line.
- statusBar: statusBar.
- mediaClock: Text value for MediaClock field.
- mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
- </description>
- </param>
- <param name="alignment" type="Common.TextAlignment" mandatory="false">
- <description>Specifies how mainField1 and mainField2 texts should be aligned on the display.</description>
- <description>If omitted, texts must be centered</description>
- </param>
- <param name="graphic" type="Common.Image" mandatory="false">
- <description>Path to optional dynamic image or the static binary image itself. See Image. If omitted, the displayed graphic should not change.</description>
- </param>
- <param name="secondaryGraphic" type="Common.Image" mandatory="false">
- <description>
- Image struct determining whether static or dynamic secondary image to display in app.
- If omitted on supported displays, the displayed secondary graphic shall not change.
- </description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted, the currently displayed SoftButton values should not change.</description>
- </param>
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
- <description>App labeled on-screen presets (i.e. GEN3 media presets or dynamic search suggestions).</description>
- <description>If omitted on supported displays, the presets will be shown as not defined.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application related to this RPC.</description>
- </param>
- </function>
- <function name="Show" messagetype="response">
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command to the application menu.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the command to be added.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="false">
- <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
- </param>
- <param name="cmdIcon" type="Common.Image" mandatory="false">
- <description>Image to be displayed for representing the command. See Image.</description>
- <description>If omitted, no (or the default if applicable) icon should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>cmdId previously sent via AddCommand request - id of the command to be deleted.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="AddSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to add a sub menu to the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>ID of the sub menu to be added. Unique for the application.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="true">
- <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddSubMenu" messagetype="response">
- </function>
- <function name="DeleteSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a submenu from the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>The "menuID" of the sub-menu to be deleted. (See addSubMenu.menuID)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteSubMenu" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
- <param name="initialText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses initialInteractionText. See TextFieldStruct.</description>
- </param>
- <param name="choiceSet" type="Common.Choice" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>The list of choices to be used for the interaction with the user</description>
- </param>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="true">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="interactionLayout" type="Common.LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>ID of the choice that was selected in response to PerformInteraction.</description>
- </param>
- <param name="manualTextEntry" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="request" provider="hmi">
- <description>Sets the initial media clock value and automatic update method.</description>
- <param name="startTime" type="Common.TimeFormat" mandatory="false">
- <description>startTime should be ignored for "PAUSE", "RESUME", and "CLEAR"</description>
- </param>
- <param name="endTime" type="Common.TimeFormat" mandatory="false">
- <description>
- See TimeFormat.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
- <param name="updateMode" type="Common.ClockUpdateMode" mandatory="true">
- <description>The update method of the media clock.</description>
- <description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="response">
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Request from SDL to set some properties for VR help.</description>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
- <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="menuIcon" type="Common.Image" mandatory="false">
- <description>&gt;Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
- <description>On-screen keybaord configuration (if available).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user choosing menu item.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Command ID, which is related to a specific menu entry (previously sent with AddCommand).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="OnSystemContext" messagetype="notification" provider="hmi">
- <description>
- Notification must be initiated by HMI when the user changes the context of application: goes to menu (in-application menu or system menu);
- switches to VR; pop-up appears on screen etc.
- </description>
- <param name="systemContext" type="Common.SystemContext" mandatory="true">
- <description>The context the application is brought into.</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
- <description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
- </param>
- <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
- <param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Must be returned if the platform supports on-screen SoftButtons.</description>
- </param>
- <param name="hmiCapabilities" type="Common.HMICapabilities" mandatory="false">
- <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language for app.</description>
- <param name="appName" type="String" maxlength="100" mandatory="false">
- <description>
- Request new app name registration
- Needs to be unique over all applications.
- May not be empty. May not start with a new line character.
- May not interfere with any name or synonym of any registered applications.
- Applications with the same name will be rejected. (SDL makes all the checks)
- </description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appHMIType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Sent when app's requested-during-registration AppHMIType is changed to different one due to Policies update. Contains the updated list of all allowed app's AppHMITypes.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language UI has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method should be invoked at system startup. Response provides information about UI supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in UI.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active UI language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnDriverDistraction" messagetype="notification" provider="hmi">
- <description>Notification must be sent from HMI to SDL when driver distraction state is changed. Driver distraction rules are defined by the platform.</description>
- <param name="state" type="Common.DriverDistractionState" mandatory="true">
- <description>See DriverDistractionState. </description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="request" provider="hmi">
- <description>Used to set existing local file on SYNC as the app's icon.</description>
- <param name="syncFileName" type="Common.Image" mandatory="true">
- <description>Either the path to the dynamic image stored on HY or the static binary image itself. See Image</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="response">
- </function>
- <function name="SetDisplayLayout" messagetype="request" provider="hmi">
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetDisplayLayout" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
- <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description>
- </param>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="request" provider="hmi">
- <description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
- <param name="customFormID" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined forms are defined.
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "KEYBOARD_SEARCH" - Custom template containing app-configured on-screen keyboard with active search updating; user also can trigger voice search.
- "NAV_FULLSCREEN_MAP" - Custom root template screen containing full screen map with navigation controls.
- "NAV_POI_MENU" - Custom template containing app-defined POI options.
- "NAV_SEARCH_RESULTS" - Custom template containing a list of app-defined search results
- "NAV_POI_INFO" - Custom template containing app-defined POI information (and potentially map data).
- </description>
- </param>
- <param name="parentFormID" type="String" maxlength="500" defvalue="DEFAULT" mandatory="false">
- <description>
- Parent screen of predefined form to display.
- Currently only predefined forms are defined.
- If not provided, then set to "DEFAULT".
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "NAV_FULLSCREEN_MAP" - Custom template containing full screen map with navigation controls.
- </description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="response">
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
- <function name="OnKeyboardInput" messagetype="notification" provider="hmi">
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
- <param name="event" type="Common.KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
- <param name="data" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
- </function>
- <function name="OnTouchEvent" messagetype="notification" provider="hmi">
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="Common.TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="Common.TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
- <function name="Slider" messagetype="request" provider="hmi">
- <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
- <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
- <description>Number of selectable items on a horizontal axis</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
- <description>Initial position of slider control (cannot exceed numTicks)</description>
- </param>
- <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
- <description>Text header to be displayed.</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>Text footer to be displayed (meant to display min/max threshold descriptors).</description>
- <description>For a static text footer, only one footer string shall be provided in the array.</description>
- <description>For a dynamic text footer, the number of footer text string in the array must match the numTicks value.</description>
- <description>For a dynamic text footer, text array string should correlate with potential slider position index.</description>
- <description>If omitted on supported displays, no footer text shall be displayed.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" mandatory="true">
- <description>Timeout. The slider should be displayed until the defined amount of time has elapsed. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="Slider" messagetype="response">
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>Current slider position. Must be returned when the user has clicked the &#x2018;Save&#x2019; or &#x2018;Canceled&#x2019; button or by the timeout </description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="request" provider="hmi">
- <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
- <param name="messageText" type="Common.TextFieldStruct" mandatory="true">
- <description>Body of text that can include newlines and tabs. Uses scrollableMessageBody.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Timeout in milliseconds. The message should be displayed until the time defined is up.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted on supported displays, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="response">
- </function>
- <function name="PerformAudioPassThru" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="audioPassThruDisplayTexts" type="Common.TextFieldStruct" mandatory="true" minsize="0" maxsize="2" array="true">
- <description>Uses
- audioPassThruDisplayText1: First line of text displayed during audio capture.
- audioPassThruDisplayText2: Second line of text displayed during audio capture.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="true">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
- <function name="PerformAudioPassThru" messagetype="response">
- </function>
- <function name="EndAudioPassThru" messagetype="request" provider="hmi">
- <description>Request is sent by SDL to stop the audio capturing.</description>
- </function>
- <function name="EndAudioPassThru" messagetype="response">
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of UI module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if UI is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="request" provider="hmi">
- <description>Initiated by SDL to close currently active pop-up on HMI.</description>
- <param name="methodName" type="String" mandatory="false">
- <description>Method to be closed</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="response">
- <description>Provides the result of operation.</description>
- </function>
- <function name="OnResetTimeout" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that invoked notifcation.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>Currently used method name on which was triggered action</description>
- </param>
- </function>
- <function name="OnRecordStart" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about capturing mic data should be started</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- </interface>
- <interface name="Navigation" version="1.0" date="2013-05-22">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if Navigation is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="SendLocation" messagetype="request">
- <description>That allows the app to send a destination to the embedded nav system.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description> Name / title of intended location </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description> Description intended location / establishment (if applicable) </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description> Location address (if applicable) </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description> Phone number of intended location / establishment (if applicable) </description>
- </param>
- <param name="locationImage" type="Common.Image" mandatory="false">
- <description> Image / icon of intended location (if applicable and supported) </description>
- </param>
- </function>
- <function name="SendLocation" messagetype="response" >
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
- <description>Dials a phone number and switches to phone application.</description>
- <param name="number" type="String" maxlength="40">
- <description>Phone number is a string, which can be up to 40 chars.</description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
- <param name="success" type="Boolean" platform="documentation">
- <description>true, if successful</description>
- <description>false, if failed</description>
- </param>
- <param name="resultCode" type="Result" platform="documentation">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to show info about navigation.</description>
- <param name="navigationTexts" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="5">
- <description>See TextFieldStruct. Uses:
- navigationText1
- navigationText2
- ETA
- totalDistance
- timeToDestination.
- </description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (from previous maneuver).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
- <description>If and when a maneuver has completed while an AlertManeuver is active, SDL will send this value set to TRUE in order to clear the AlertManeuver overlay.</description>
- <description>If omitted the value should be assumed as FALSE.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>Three dynamic SoftButtons available</description>
- <description>If omitted on supported displays, the currently displayed SoftButton values will not change.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ShowConstantTBT" messagetype="response">
- </function>
- <function name="AlertManeuver" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to announce navigation maneuver</description>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application requested this RPC.</description>
- </param>
- </function>
- <function name="AlertManeuver" messagetype="response">
- </function>
- <function name="UpdateTurnList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to update turn list.</description>
- <param name="turnList" type="Common.Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted, app-defined SoftButton should be left blank.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="UpdateTurnList" messagetype="response">
- </function>
- <function name="OnTBTClientState" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="state" type="Common.TBTState" mandatory="true">
- <description>Current State of TBT client</description>
- </param>
- </function>
- <function name="StartStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartStream" messagetype="response">
- </function>
- <function name="StopStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing video streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopStream" messagetype="response">
- </function>
- <function name="StartAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartAudioStream" messagetype="response">
- </function>
- <function name="StopAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing audio streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopAudioStream" messagetype="response">
- </function>
- <function name="OnAudioDataStreaming" messagetype="notification">
- <description>Sender: SDL->HMI. Purpose: notify about raw audio data presence over the URL provided via StartAudioStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - audio data started. If "false" - audio data stopped.</description>
- </param>
- </function>
- <function name="OnVideoDataStreaming" messagetype="notification">
- <description>Sender: SDL->HMI. Purpose: notify about raw video data presence over the URL provided via StartStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - video data started. If "false" - video data stopped.</description>
- </param>
- </function>
-
- </interface>
-
- <interface name="VehicleInfo" version="1.0" date="2013-04-21">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if vehicle data modules are present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="GetVehicleType" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to get info about the vehicle (type, model, etc.).</description>
- </function>
- <function name="GetVehicleType" messagetype="response">
- <param name="vehicleType" type="Common.VehicleType" mandatory="true"/>
- </function>
- <function name="ReadDID" messagetype="request" provider="hmi">
- <description>Request from SDL for vehicle data reading.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
- <description>Get raw data from vehicle data DID location(s).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ReadDID" messagetype="response">
- <param name="didResult" type="Common.DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>Array of requested DID results (with data if available).</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="request" provider="hmi">
- <description>Vehicle module diagnostic trouble code request.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
- <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="response">
- <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
- </param>
- <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
- <description>
- Array of all reported DTCs on module. Each DTC is represented with 4 bytes:
- 3 bytes for data
- 1 byte for status
- </description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="request" provider="hmi">
- <description>Non periodic vehicle diagnostic request</description>
- <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of target ECU.</description>
- </param>
- <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Length of message (in bytes).</description>
- </param>
- <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="response">
- <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message result.
- </description>
- </param>
- </function>
- <!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="GetVin" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of GetVehicleData-->
- <!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification" provider="hmi">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="OnSpeed" messagetype="notification" provider="hmi">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="OnRpm" messagetype="notification" provider="hmi">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="OnFuelLevel" messagetype="notification" provider="hmi">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="OnFuelLevelState" messagetype="notification" provider="hmi">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="OnInstantFuelConsumption" messagetype="notification" provider="hmi">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="OnExternalTemperature" messagetype="notification" provider="hmi">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="OnVin" messagetype="notification" provider="hmi">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
- </param>
- </function>
- <function name="OnPrndl" messagetype="notification" provider="hmi">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="OnTirePressure" messagetype="notification" provider="hmi">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="OnOdometer" messagetype="notification" provider="hmi">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="OnBeltStatus" messagetype="notification" provider="hmi">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="OnBodyInformation" messagetype="notification" provider="hmi">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="OnDeviceStatus" messagetype="notification" provider="hmi">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="OnDriverBraking" messagetype="notification" provider="hmi">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="OnWiperStatus" messagetype="notification" provider="hmi">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="OnHeadLampStatus" messagetype="notification" provider="hmi">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="OnEngineTorque" messagetype="notification" provider="hmi">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="OnAccPedalPosition" messagetype="notification" provider="hmi">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="OnSteeringWheelAngle" messagetype="notification" provider="hmi">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnECallInfo" messagetype="notification" provider="hmi">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnAirbagStatus" messagetype="notification" provider="hmi">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification" provider="hmi">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnClusterModeStatus" messagetype="notification" provider="hmi">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnMyKey" messagetype="notification" provider="hmi">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of OnVehicleData-->
- <!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="UnsubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="SubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="SubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="SubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="SubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="UnsubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="SubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="SubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="SubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="SubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="SubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- </interface>
- <!-- Policies -->
- <interface name="SDL" version="1.0" date="2014-03-12">
- <function name="ActivateApp" messagetype="request" provider="sdl">
- <param name="appID" type="Integer" mandatory="true">
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- <param name="isSDLAllowed" type="Boolean" mandatory="true" scope="internal"/>
- <param name="device" type="Common.DeviceInfo" mandatory="false" scope="internal">
- <description>If isSDLAllowed is false, consent for sending PT through specified device is required.</description>
- </param>
- <param name="isPermissionsConsentNeeded" type="Boolean" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="true"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="isAppRevoked" type="Boolean" mandatory="true"/>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="request" scope="internal" provider="sdl">
- <description>Request from HMI to SDL to get user friendly messages for UI/TTS info boxes/texts (i.e. for help/dialogs etc) from Policy Table.</description>
- <param name="messageCodes" type="String" array="true" minsize="1" maxsize="100" maxlength="500" mandatory="true">
- <description>Id of message to be received according to Policy Table i.e. StatusNeeded, Notifications, DrivingCharacteristics etc.</description>
- </param>
- <param name="language" type="Common.Language" mandatory="false">
- <description>Optional parameter if HMI wants message in some other language then its current one already known to SDL.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="response">
- <param name="messages" type="Common.UserFriendlyMessage" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If no message was found in PT for specified message code and for HMI current or specified language, this parameter will be omitted.</description>
- </param>
- </function>
- <function name="OnAllowSDLFunctionality" messagetype="notification" provider="hmi">
- <description>Initiated by HMI. Notifies about user/HMI allowing SDL functionality or disallowing access to all mobile apps. Needed if HMI has additional ways of asking user about this (i.e. Settings etc)</description>
- <param name="device" type="Common.DeviceInfo" mandatory="false">
- <description>If no device is specified permission counts for SDL functionality in general.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="true">
- <description>Must be true if allowed</description>
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <!-- SyncP RPC-->
- <function name="OnReceivedPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notification sent to SDL when SYNCP Manager receives and decrypts updated policy table
- </description>
- <param name="policyfile" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>Location of decrypted policy table Json file on target</description>
- </param>
- </function>
- <function name="OnPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notifies SDL to supply a new "PolicyUpdate" request with more recent snapshot data
- </description>
- </function>
- <!-- End of SyncP RPC-->
- <function name="GetListOfPermissions" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to get list of permissions for app. If no app specified - list of permissions for all apps.</description>
- <param name="appID" type="Integer" mandatory="false"/>
- </function>
- <function name="GetListOfPermissions" messagetype="response">
- <param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>If no permissions were specified for application the array will come empty.</description>
- </param>
- </function>
- <function name="OnAppPermissionConsent" messagetype="notification" provider="hmi">
- <description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
- <param name="appID" type="Integer" mandatory="false">
- <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
- </param>
- <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <function name="OnAppPermissionChanged" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
- <param name="appID" type="Integer" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="appRevoked" type="Boolean" mandatory="false">
- <description>If present then specified application was prohibited to used with Sync.</description>
- </param>
- <param name="appPermissionsConsentNeeded" type="Boolean" mandatory="false">
- <description>If present specifies that permissions were added to application that require User Consent, then HMI can send GetListOfPermissions request to obtain list of permissions.</description>
- </param>
- <param name="appUnauthorized" type="Boolean" mandatory="false">
- <description>When present and set to true (should be if present) then this means that application was not authorized (nickname check failed.)</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application (the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).
- If SDL sends an empty array - any RequestType is allowed for this app.
- If SDL omits this parameter - nothing is changed for RequestType in the policies
- </description>
- </param>
- </function>
- <function name="OnSDLConsentNeeded" messagetype="notification" provider="sdl">
- <description>Send from SDL to HMI to notify that data consent is needed for device either because PT update or Retry strategy.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="UpdateSDL" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to start update of Policy Table.</description>
- </function>
- <function name="UpdateSDL" messagetype="response">
- <description>Specify result: no update needed, update was successful/unsuccessful etc</description>
- <param name="result" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="GetStatusUpdate" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to find out current status of PT exchange process.</description>
- </function>
- <function name="GetStatusUpdate" messagetype="response">
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnStatusUpdate" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI when current status of PT exchange changed (i.e. it Succeded or Failed etc)</description>
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnSystemError" messagetype="notification" provider="hmi">
- <param name="error" type="Common.SystemError" mandatory="true"/>
- </function>
- <function name="AddStatisticsInfo" messagetype="notification" provider="hmi">
- <description>Sent by system to record statiscs and error counts. Increases statistics specified by statisticType by one.</description>
- <param name="statisticType" type="Common.StatisticsType" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="request" scope="internal" provider="sdl">
- <description>Sent by system to SDL to get list of URL for specified service type and optionally policy's application id.</description>
- <param name="service" type="Integer" minvalue="0" maxvalue="100" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="response" scope="internal">
- <param name="urls" type="Common.ServiceInfo" array="true" mandatory="false" minsize="1" maxsize="100"/>
- </function>
- <function name="OnDeviceStateChanged" messagetype="notification" scope="internal" provider="hmi">
- <param name="deviceState" type="Common.DeviceState" mandatory="true"/>
- <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500" />
- <param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
- </function>
- </interface>
-</interfaces>
diff --git a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
index ead8596ee6..cc522d9f1c 100644
--- a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
+++ b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
@@ -326,16 +326,16 @@
</enum>
<struct name="Choice">
<description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535"/>
- <param name="menuName" type="String" maxlength="500"/>
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true"/>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
+ <param name="menuName" type="String" maxlength="500" mandatory="true"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true"/>
</struct>
<struct name="SyncMsgVersion">
<description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
- <param name="majorVersion" type="Integer" minvalue="1" maxvalue="1">
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="1" mandatory="true">
<description>The major version indicates versions that is not-compatible to previous versions.</description>
</param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
<description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
</param>
</struct>
@@ -349,53 +349,53 @@
</element>
</enum>
<struct name="StartTime">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
<description>The hour of the media clock.</description>
<description>Some radios only support a max of 19 hours. If out of range, it will be rejected.</description>
</param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59"/>
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59"/>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
</struct>
<struct name="TextField">
- <param name="name" type="TextFieldName">
+ <param name="name" type="TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
- <param name="characterSet" type="CharacterSet">
+ <param name="characterSet" type="CharacterSet" mandatory="true">
<description>The character set that is supported in this field. See CharacterSet.</description>
</param>
- <param name="width" type="Integer" minvalue="1" maxvalue="40">
+ <param name="width" type="Integer" minvalue="1" maxvalue="40" mandatory="true">
<description>The number of characters in one row of this field.</description>
</param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="3">
+ <param name="rows" type="Integer" minvalue="1" maxvalue="3" mandatory="true">
<description>The number of rows of this field.</description>
</param>
</struct>
<struct name="DisplayCapabilities">
<description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType">
+ <param name="displayType" type="DisplayType" mandatory="true">
<description>The type of the display. See DisplayType</description>
</param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
<description>A set of all fields that support text data. See TextField</description>
</param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="1" maxsize="100" array="true">
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="1" maxsize="100" array="true" mandatory="true">
<description>A set of all supported formats of the media clock. See MediaClockFormat</description>
</param>
</struct>
<struct name="ButtonCapabilities">
<description>Contains information about a buttons capabilities.</description>
- <param name="name" type="ButtonName">
+ <param name="name" type="ButtonName" mandatory="true">
<description>The name of the button. See ButtonName.</description>
</param>
- <param name="shortPressAvailable" type="Boolean">
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
<description>The button supports a short press.</description>
<description>Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.</description>
</param>
- <param name="longPressAvailable" type="Boolean">
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
<description>The button supports a LONG press.</description>
<description>Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.</description>
</param>
- <param name="upDownAvailable" type="Boolean">
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
<description>The button supports "button down" and "button up".</description>
<description>Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.</description>
<description>Whenever the button is released, onButtonEvent( UP) will be invoked.</description>
@@ -413,17 +413,17 @@
<description>if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.</description>
<description>If this param was omitted the entry will be added at the end.</description>
</param>
- <param name="menuName" type="String" maxlength="500">
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
</struct>
<struct name="TTSChunk">
<description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
- <param name="text" maxlength="500" type="String">
+ <param name="text" maxlength="500" type="String" mandatory="true">
<description>The text or phonemes to speak.</description>
<description>May not be empty.</description>
</param>
- <param name="type" type="SpeechCapabilities">
+ <param name="type" type="SpeechCapabilities" mandatory="true">
<description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
</param>
</struct>
@@ -431,10 +431,10 @@
<function name="RegisterAppInterface" messagetype="request">
<description>Establishes an interface with a mobile application.</description>
<description>Before registerAppInterface no other commands will be accepted/executed.</description>
- <param name="syncMsgVersion" type="SyncMsgVersion">
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true">
<description>See SyncMsgVersion</description>
</param>
- <param name="appName" type="String" maxlength="100">
+ <param name="appName" type="String" maxlength="100" mandatory="true">
<description>The mobile application name, e.g. "Ford Drive Green".</description>
<description>Needs to be unique over all applications.</description>
<description>May not be empty.</description>
@@ -457,11 +457,11 @@
<description>If not provided, the default is equal to False"</description>
<description>Indicates if the mobile application wants to use vehicle data like GPS or speed.</description>
</param>
- <param name="isMediaApplication" type="Boolean">
+ <param name="isMediaApplication" type="Boolean" mandatory="true">
<description>Indicates if the application is a media or a non-media application.</description>
<description>Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.</description>
</param>
- <param name="languageDesired" type="Language">
+ <param name="languageDesired" type="Language" mandatory="true">
<description>See Language</description>
<description>If the language doesn't match the active language on Sync, it will be rejected.</description>
<description>If the language is changed, while an app is registered, it will get disconnected.</description>
@@ -475,11 +475,11 @@
</function>
<function name="RegisterAppInterface" messagetype="response">
<description>The response to registerAppInterface</description>
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -527,11 +527,11 @@
<description>Will fail, if no registerAppInterface was completed successfully before.</description>
</function>
<function name="UnregisterAppInterface" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -559,11 +559,11 @@
<issue creator="rs">Do we want to add VR threshold params?</issue>
</function>
<function name="SetGlobalProperties" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -579,16 +579,16 @@
</function>
<function name="ResetGlobalProperties" messagetype="request">
<description>Allows resetting global properties.</description>
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true">
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
<description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
</param>
</function>
<function name="ResetGlobalProperties" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -605,7 +605,7 @@
<function name="AddCommand" messagetype="request">
<description>Adds a command to the in application menu.</description>
<description>Either menuParams or vrCommands must be provided.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>unique ID of the command to add.</description>
</param>
<param name="menuParams" type="MenuParams" mandatory="false">
@@ -617,11 +617,11 @@
</param>
</function>
<function name="AddCommand" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -639,16 +639,16 @@
</function>
<function name="DeleteCommand" messagetype="request">
<description>Deletes all commands from the in-application menu with the specified command id.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>ID of the command(s) to delete.</description>
</param>
</function>
<function name="DeleteCommand" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -666,7 +666,7 @@
</function>
<function name="AddSubMenu" messagetype="request">
<description>Adds a sub menu to the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>unique ID of the sub menu to add.</description>
</param>
<param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
@@ -677,16 +677,16 @@
<description>Position of any submenu will always be located before the return and exit options</description>
<description>If this param was omitted the entry will be added at the end.</description>
</param>
- <param name="menuName" maxlength="500" type="String">
+ <param name="menuName" maxlength="500" type="String" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
</function>
<function name="AddSubMenu" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -704,16 +704,16 @@
</function>
<function name="DeleteSubMenu" messagetype="request">
<description>Deletes a submenu from the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
</param>
</function>
<function name="DeleteSubMenu" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -731,17 +731,17 @@
</function>
<function name="CreateInteractionChoiceSet" messagetype="request">
<description>creates interaction choice set to be used later by performInteraction</description>
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Unique ID used for this interaction choice set.</description>
</param>
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true"/>
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
</function>
<function name="CreateInteractionChoiceSet" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -759,18 +759,18 @@
</function>
<function name="PerformInteraction" messagetype="request">
<description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
- <param name="initialText" type="String" maxlength="500">
+ <param name="initialText" type="String" maxlength="500" mandatory="true">
<description>Text to be displayed first.</description>
</param>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
<description>This is the intial prompt spoken to the user at the start of an interaction</description>
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
<description>The array must have at least one item</description>
</param>
- <param name="interactionMode" type="InteractionMode">
+ <param name="interactionMode" type="InteractionMode" mandatory="true">
<description>See InteractionMode.</description>
</param>
- <param name="interactionChoiceSetIDList" type="Integer" minsize="1" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="1" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="true">
<description>List of interaction choice set IDs to use with an interaction.</description>
</param>
<param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
@@ -789,11 +789,11 @@
</param>
</function>
<function name="PerformInteraction" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -819,16 +819,16 @@
<function name="DeleteInteractionChoiceSet" messagetype="request">
<description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
<description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>ID of the interaction choice set to delete.</description>
</param>
</function>
<function name="DeleteInteractionChoiceSet" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -867,11 +867,11 @@
</param>
</function>
<function name="Alert" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -917,11 +917,11 @@
</param>
</function>
<function name="Show" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -937,17 +937,17 @@
</function>
<function name="Speak" messagetype="request">
<description>Speaks a text.</description>
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
<description>The array must have at least one item</description>
</param>
</function>
<function name="Speak" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -969,17 +969,17 @@
<description>startTime must be provided for "run"</description>
<description>startTime will be ignored for "pause" and "resum"</description>
</param>
- <param name="updateMode" type="UpdateMode">
+ <param name="updateMode" type="UpdateMode" mandatory="true">
<description>Enumeration to control the media clock.</description>
<description>In case of pause or resume, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
</param>
</function>
<function name="SetMediaClockTimer" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1002,11 +1002,11 @@
</param>
</function>
<function name="EncodedSyncPData" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1024,16 +1024,16 @@
<description>Subscribes to built-in HMI buttons.</description>
<description>The application will be notified by the OnButtonEvent and OnButtonPress.</description>
<description>To unsubscribe the notifications, use unsubscribeButton.</description>
- <param name="buttonName" type="ButtonName">
+ <param name="buttonName" type="ButtonName" mandatory="true">
<description>Name of the button to subscribe.</description>
</param>
</function>
<function name="SubscribeButton" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1051,16 +1051,16 @@
</function>
<function name="UnsubscribeButton" messagetype="request">
<description>Unsubscribes from built-in HMI buttons.</description>
- <param name="buttonName" type="ButtonName">
+ <param name="buttonName" type="ButtonName" mandatory="true">
<description>Name of the button to unsubscribe.</description>
</param>
</function>
<function name="UnsubscribeButton" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1079,11 +1079,11 @@
<function name="GenericResponse" messagetype="response">
<description>Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.</description>
<description>Currently, only resultCode INVALID_DATA is used.</description>
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="INVALID_DATA"/>
</param>
@@ -1093,40 +1093,40 @@
</function>
<!-- Notifications -->
<function name="OnHMIStatus" messagetype="notification">
- <param name="hmiLevel" type="HMILevel">
+ <param name="hmiLevel" type="HMILevel" mandatory="true">
<description>See HMILevel</description>
</param>
- <param name="audioStreamingState" type="AudioStreamingState">
+ <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
<description>See AudioStreamingState</description>
</param>
- <param name="systemContext" type="SystemContext">
+ <param name="systemContext" type="SystemContext" mandatory="true">
<description>See SystemContext</description>
</param>
</function>
<function name="OnAppInterfaceUnregistered" messagetype="notification">
- <param name="reason" type="AppInterfaceUnregisteredReason">
+ <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
<description>See AppInterfaceUnregisteredReason</description>
</param>
</function>
<function name="OnButtonEvent" messagetype="notification">
<description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonEventMode" type="ButtonEventMode">
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
<description>Indicates whether this is an UP or DOWN event.</description>
</param>
</function>
<function name="OnButtonPress" messagetype="notification">
<description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName"/>
- <param name="buttonPressMode" type="ButtonPressMode">
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
<description>Indicates whether this is a LONG or SHORT button press event.</description>
</param>
</function>
<function name="OnCommand" messagetype="notification">
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Command ID, which is related to a specific menu entry.</description>
</param>
- <param name="triggerSource" type="TriggerSource">
+ <param name="triggerSource" type="TriggerSource" mandatory="true">
<description>See TriggerSource</description>
</param>
</function>
@@ -1138,13 +1138,13 @@
</function>
<function name="OnTBTClientState" messagetype="notification">
<description>Provides applications with notifications specific to the current TBT client status on the module</description>
- <param name="state" type="TBTState">
+ <param name="state" type="TBTState" mandatory="true">
<description>Current State of TBT client</description>
</param>
</function>
<function name="OnDriverDistraction" messagetype="notification">
<description>Provides driver distraction state to mobile applications</description>
- <param name="state" type="DriverDistractionState">
+ <param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
</function>
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index b6af26fba3..9010d15dc0 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -32,7 +32,7 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- include
+ ${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/media_manager/include/audio/
${COMPONENTS_DIR}/media_manager/include/video/
${COMPONENTS_DIR}/utils/include/
@@ -40,6 +40,8 @@ include_directories(
${COMPONENTS_DIR}/connection_handler/include/
${COMPONENTS_DIR}/application_manager/include/
${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/policy/include/
+ ${COMPONENTS_DIR}/rpc_base/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/config_profile/include/
diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
index 3645a9cb81..a246e468b7 100644
--- a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
@@ -62,6 +62,12 @@ typedef enum {
typedef enum { AT_INVALID = -1, AT_PCM = 0 } AudioType;
+// AudioPassThru
+typedef struct {
+ std::vector<uint8_t> binary_data;
+ int32_t session_key;
+} AudioData;
+
/*
* @brief AudioStreamSenderThread class used to read binary data written from
* microphone
@@ -104,6 +110,18 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
*/
bool SendEndAudioPassThru();
+ /**
+ * @brief Creates AudioPassThru data chunk and inserts it
+ * to audio_pass_thru_messages_
+ *
+ * @param session_key Id of application for which
+ * audio pass thru should be sent
+ *
+ * @param binary_data AudioPassThru data chunk
+ */
+ void SendAudioPassThroughNotification(uint32_t session_key,
+ std::vector<uint8_t>& binary_data);
+
void sendAudioChunkToMobile();
bool getShouldBeStopped();
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
index f0c6d3c48f..ded709b1fa 100644
--- a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
@@ -74,6 +74,7 @@ class FromMicToFileRecorderThread : public threads::ThreadDelegate {
} GstTimeout;
void initArgs();
+ void deinitArgs();
void psleep(void* timeout);
diff --git a/src/components/media_manager/include/media_manager/file_streamer_adapter.h b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
index 293c6721ee..c4c91a98d8 100644
--- a/src/components/media_manager/include/media_manager/file_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
@@ -54,6 +54,8 @@ class FileStreamerAdapter : public StreamerAdapter {
const std::string& app_storage_folder);
virtual ~FileStreamer();
+ virtual void Close() {}
+
protected:
virtual bool Connect();
virtual void Disconnect();
diff --git a/src/components/media_manager/include/media_manager/media_adapter_impl.h b/src/components/media_manager/include/media_manager/media_adapter_impl.h
index 75c48c98b7..37401f9c2b 100644
--- a/src/components/media_manager/include/media_manager/media_adapter_impl.h
+++ b/src/components/media_manager/include/media_manager/media_adapter_impl.h
@@ -40,7 +40,7 @@
namespace media_manager {
-typedef utils::SharedPtr<MediaAdapterListener> MediaListenerPtr;
+typedef std::shared_ptr<MediaAdapterListener> MediaListenerPtr;
class MediaAdapterImpl : public MediaAdapter {
public:
@@ -57,7 +57,7 @@ class MediaAdapterImpl : public MediaAdapter {
DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
};
-typedef utils::SharedPtr<MediaAdapterImpl> MediaAdapterImplPtr;
+typedef std::shared_ptr<MediaAdapterImpl> MediaAdapterImplPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index c84a5a884f..749356e656 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -86,9 +86,10 @@ class MediaManagerImpl : public MediaManager,
void set_mock_mic_listener(MediaListenerPtr media_listener);
void set_mock_mic_recorder(MediaAdapterImpl* media_adapter);
void set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream);
- void set_mock_streamer_listener(protocol_handler::ServiceType stype,
- MediaAdapterListener* mock_stream);
+ std::shared_ptr<MediaAdapterImpl> mock_stream);
+ void set_mock_streamer_listener(
+ protocol_handler::ServiceType stype,
+ std::shared_ptr<MediaAdapterListener> mock_stream);
#endif // BUILD_TESTS
protected:
diff --git a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
index 1e998ef82f..c079e04954 100644
--- a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
@@ -53,6 +53,8 @@ class PipeStreamerAdapter : public StreamerAdapter {
const std::string& app_storage_folder);
virtual ~PipeStreamer();
+ virtual void Close() {}
+
protected:
virtual bool Connect();
virtual void Disconnect();
diff --git a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
index 45311b6077..3b647a0b83 100644
--- a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
@@ -55,6 +55,8 @@ class SocketStreamerAdapter : public StreamerAdapter {
const std::string& header);
virtual ~SocketStreamer();
+ virtual void Close();
+
protected:
virtual bool Connect();
virtual void Disconnect();
diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h
index 30353b8d09..56bf941f8e 100644
--- a/src/components/media_manager/include/media_manager/streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/streamer_adapter.h
@@ -37,8 +37,7 @@
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/atomic_object.h"
-#include "utils/shared_ptr.h"
+#include <atomic>
#include "protocol/raw_message.h"
namespace media_manager {
@@ -72,13 +71,15 @@ class StreamerAdapter : public MediaAdapterImpl {
virtual void threadMain();
virtual void exitThreadMain();
+ virtual void Close() = 0;
+
protected:
virtual bool Connect() = 0;
virtual void Disconnect() = 0;
virtual bool Send(protocol_handler::RawMessagePtr msg) = 0;
private:
- sync_primitives::atomic_bool stop_flag_;
+ std::atomic_bool stop_flag_;
StreamerAdapter* adapter_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
@@ -94,7 +95,7 @@ class StreamerAdapter : public MediaAdapterImpl {
DISALLOW_COPY_AND_ASSIGN(StreamerAdapter);
};
-typedef utils::SharedPtr<StreamerAdapter> StreamerAdapterPtr;
+typedef std::shared_ptr<StreamerAdapter> StreamerAdapterPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
index 5e9d6ab0ba..91e3c5465d 100644
--- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -91,19 +91,19 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
if (application_key != current_application_) {
current_application_ = application_key;
- uint32_t device_id = 0;
+ transport_manager::DeviceHandle device_id = 0;
session_observer_.GetDataOnSessionKey(application_key, 0, NULL, &device_id);
- std::string mac_adddress;
- session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_adddress);
+ std::string mac_address;
+ session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_address);
- // TODO(PK): Convert mac_adddress to the
+ // TODO(PK): Convert mac_address to the
// following format : "bluez_source.XX_XX_XX_XX_XX_XX" if needed
// before passing to the A2DPSourcePlayerThread constructor
A2DPSourcePlayerThread* delegate =
- new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress);
+ new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_address);
threads::Thread* new_activity =
- threads::CreateThread(mac_adddress.c_str(), delegate);
+ threads::CreateThread(mac_address.c_str(), delegate);
sources_[application_key] = Pair(new_activity, delegate);
new_activity->start();
}
diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
index 7c18cb400b..23181e7431 100644
--- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
+++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
@@ -38,8 +38,9 @@
#include <string>
#include <string.h>
#include "application_manager/application_manager.h"
-#include "application_manager/mobile_command_factory.h"
#include "application_manager/application_impl.h"
+#include "application_manager/rpc_service.h"
+#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
@@ -51,6 +52,7 @@
namespace media_manager {
using sync_primitives::AutoLock;
+namespace strings = application_manager::strings;
#ifdef EXTENDED_MEDIA_MODE
const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 50;
@@ -59,6 +61,15 @@ const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1000;
#endif
const uint32_t kMqueueMessageSize = 4095;
+// Size of RIFF header contained in a .wav file: 12 bytes for 'RIFF' chunk
+// descriptor, 24 bytes for 'fmt ' sub-chunk and 8 bytes for 'data' sub-chunk
+// header.
+// The correct format of audio stream for AudioPassThru feature is to include
+// only audio sample data. Since both pre-recorded file (audio.8bit.wav) and
+// GStreamer-generated file contain RIFF header, we will skip it when reading
+// the files.
+static const uint32_t kRIFFHeaderSize = 44;
+
CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
AudioStreamSenderThread::AudioStreamSenderThread(
@@ -67,6 +78,7 @@ AudioStreamSenderThread::AudioStreamSenderThread(
application_manager::ApplicationManager& app_mngr)
: session_key_(session_key)
, fileName_(fileName)
+ , offset_(kRIFFHeaderSize)
, shouldBeStoped_(false)
, shouldBeStoped_lock_()
, shouldBeStoped_cv_()
@@ -79,7 +91,7 @@ AudioStreamSenderThread::~AudioStreamSenderThread() {}
void AudioStreamSenderThread::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
while (false == getShouldBeStopped()) {
AutoLock auto_lock(shouldBeStoped_lock_);
@@ -117,15 +129,59 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() {
offset_ = offset_ + to - from;
std::vector<uint8_t> data(from, to);
- application_manager_.SendAudioPassThroughNotification(session_key_, data);
+ SendAudioPassThroughNotification(session_key_, data);
binaryData.clear();
}
#if !defined(EXTENDED_MEDIA_MODE)
// without recording stream restart reading 1-sec file
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
#endif
}
+void AudioStreamSenderThread::SendAudioPassThroughNotification(
+ uint32_t session_key, std::vector<uint8_t>& binary_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.is_audio_pass_thru_active()) {
+ LOG4CXX_ERROR(logger_,
+ "Trying to send PassThroughNotification"
+ " when PassThrough is not active");
+ return;
+ }
+
+ AudioData data;
+ data.session_key = session_key;
+ data.binary_data = binary_data;
+
+ smart_objects::SmartObjectSPtr on_audio_pass =
+ std::make_shared<smart_objects::SmartObject>();
+
+ if (!on_audio_pass) {
+ LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Fill smart object");
+
+ (*on_audio_pass)[strings::params][strings::message_type] =
+ application_manager::MessageType::kNotification;
+
+ (*on_audio_pass)[strings::params][strings::connection_key] =
+ static_cast<int32_t>(data.session_key);
+ (*on_audio_pass)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnAudioPassThruID;
+
+ LOG4CXX_DEBUG(logger_, "Fill binary data");
+ // binary data
+ (*on_audio_pass)[strings::params][strings::binary_data] =
+ smart_objects::SmartObject(data.binary_data);
+
+ LOG4CXX_DEBUG(logger_, "After fill binary data");
+ LOG4CXX_DEBUG(logger_, "Send data");
+ application_manager_.GetRPCService().ManageMobileCommand(
+ on_audio_pass, application_manager::commands::Command::SOURCE_SDL);
+}
+
bool AudioStreamSenderThread::getShouldBeStopped() {
AutoLock auto_lock(shouldBeStoped_lock_);
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
index a02ec17f90..647db1e1a3 100644
--- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
+++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
@@ -42,7 +42,10 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
FromMicRecorderListener::FromMicRecorderListener(
const std::string& file_name,
application_manager::ApplicationManager& app_mngr)
- : reader_(NULL), file_name_(file_name), application_manager_(app_mngr) {}
+ : reader_(NULL)
+ , file_name_(file_name)
+ , current_application_(0)
+ , application_manager_(app_mngr) {}
FromMicRecorderListener::~FromMicRecorderListener() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
index 0239795d75..5c12614662 100644
--- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -32,6 +32,7 @@
#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
#include <unistd.h>
+#include <cstring>
#include <sstream>
#include "utils/logger.h"
@@ -41,6 +42,9 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
GMainLoop* FromMicToFileRecorderThread::loop = NULL;
+// As per spec, AudioPassThru recording is in monaural
+static const int kNumAudioChannels = 1;
+
FromMicToFileRecorderThread::FromMicToFileRecorderThread(
const std::string& output_file, int32_t duration)
: threads::ThreadDelegate()
@@ -88,11 +92,23 @@ void FromMicToFileRecorderThread::initArgs() {
argv_[3] = new gchar[3];
argv_[4] = new gchar[durationString_.length() + 1];
- argv_[0] = const_cast<gchar*>(std::string("AudioManager").c_str());
- argv_[1] = const_cast<gchar*>(oKey_.c_str());
- argv_[2] = const_cast<gchar*>(outputFileName_.c_str());
- argv_[3] = const_cast<gchar*>(tKey_.c_str());
- argv_[4] = const_cast<gchar*>(durationString_.c_str());
+ std::strcpy(argv_[0], "AudioManager");
+ std::strcpy(argv_[1], oKey_.c_str());
+ std::strcpy(argv_[2], outputFileName_.c_str());
+ std::strcpy(argv_[3], tKey_.c_str());
+ std::strcpy(argv_[4], durationString_.c_str());
+}
+
+void FromMicToFileRecorderThread::deinitArgs() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (argv_) {
+ for (int32_t i = 0; i < argc_; i++) {
+ delete[] argv_[i];
+ }
+ delete[] argv_;
+ argv_ = NULL;
+ }
}
void FromMicToFileRecorderThread::threadMain() {
@@ -106,7 +122,8 @@ void FromMicToFileRecorderThread::threadMain() {
initArgs();
GstElement* pipeline;
- GstElement* alsasrc, *wavenc, *filesink;
+ GstElement* alsasrc, *audioconvert, *capsfilter, *wavenc, *filesink;
+ GstCaps* audiocaps;
GstBus* bus;
const gchar* device = "hw:0,0";
@@ -136,6 +153,13 @@ void FromMicToFileRecorderThread::threadMain() {
"length of time in seconds to capture",
"int32_t"},
{NULL}};
+ // g_option_context_parse() modifies params, so keep argc_ and argv_
+ int32_t argc = argc_;
+ gchar** argv = new gchar* [argc];
+ for (int32_t i = 0; i < argc; i++) {
+ argv[i] = argv_[i];
+ }
+
#ifndef GLIB_VERSION_2_32 // g_thread_init() does nothing since 2.32
if (!g_thread_supported()) {
g_thread_init(NULL);
@@ -145,7 +169,7 @@ void FromMicToFileRecorderThread::threadMain() {
context = g_option_context_new("-- M-AUDIO RAW");
g_option_context_add_main_entries(context, entries, NULL);
g_option_context_add_group(context, gst_init_get_option_group());
- if (!g_option_context_parse(context, &argc_, &argv_, &err)) {
+ if (!g_option_context_parse(context, &argc, &argv, &err)) {
g_error("%s\n", err->message);
}
@@ -159,7 +183,10 @@ void FromMicToFileRecorderThread::threadMain() {
LOG4CXX_TRACE(logger_, "Duration set to: " << duration);
// Initialize gstreamer and setup the main loop information
- gst_init(&argc_, &argv_);
+ gst_init(&argc, &argv);
+
+ delete[] argv;
+ argv = NULL;
pipeline = gst_pipeline_new("vga2usb-h264");
@@ -173,11 +200,18 @@ void FromMicToFileRecorderThread::threadMain() {
// Create all of the elements to be added to the pipeline
alsasrc = gst_element_factory_make("alsasrc", "alsasrc0");
+ audioconvert = gst_element_factory_make("audioconvert", "audioconvert0");
+ capsfilter = gst_element_factory_make("capsfilter", "filter0");
wavenc = gst_element_factory_make("wavenc", "wavenc0");
filesink = gst_element_factory_make("filesink", "filesink0");
+ // create a capability to downmix the recorded audio to monaural
+ audiocaps = gst_caps_new_simple(
+ "audio/x-raw", "channels", G_TYPE_INT, kNumAudioChannels, NULL);
+
// Assert that all the elements were created
- if (!alsasrc || !wavenc || !filesink) {
+ if (!alsasrc || !audioconvert || !capsfilter || !wavenc || !filesink ||
+ !audiocaps) {
g_error("Failed creating one or more of the pipeline elements.\n");
}
@@ -186,10 +220,21 @@ void FromMicToFileRecorderThread::threadMain() {
g_object_set(G_OBJECT(filesink), "location", outfile, NULL);
// Add the elements to the pipeline
- gst_bin_add_many(GST_BIN(pipeline), alsasrc, wavenc, filesink, NULL);
+ gst_bin_add_many(GST_BIN(pipeline),
+ alsasrc,
+ audioconvert,
+ capsfilter,
+ wavenc,
+ filesink,
+ NULL);
// Link the elements
- gst_element_link_many(alsasrc, wavenc, filesink, NULL);
+ gst_element_link_many(
+ alsasrc, audioconvert, capsfilter, wavenc, filesink, NULL);
+
+ // set the capability
+ g_object_set(G_OBJECT(capsfilter), "caps", audiocaps, NULL);
+ gst_caps_unref(audiocaps);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
@@ -207,10 +252,7 @@ void FromMicToFileRecorderThread::threadMain() {
gst_object_unref(GST_OBJECT(pipeline));
g_option_context_free(context);
- if (argv_) {
- delete[] argv_;
- argv_ = NULL;
- }
+ deinitArgs();
return;
}
}
@@ -238,10 +280,7 @@ void FromMicToFileRecorderThread::threadMain() {
g_main_loop_unref(loop);
g_option_context_free(context);
- if (argv_) {
- delete[] argv_;
- argv_ = NULL;
- }
+ deinitArgs();
loop = NULL;
}
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index b89fc4c71f..ec88e910d3 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -96,13 +96,15 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) {
#endif // EXTENDED_MEDIA_MODE
-void MediaManagerImpl::set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream) {
+void MediaManagerImpl::set_mock_streamer(
+ protocol_handler::ServiceType stype,
+ std::shared_ptr<MediaAdapterImpl> mock_stream) {
streamer_[stype] = mock_stream;
}
void MediaManagerImpl::set_mock_streamer_listener(
- protocol_handler::ServiceType stype, MediaAdapterListener* mock_stream) {
+ protocol_handler::ServiceType stype,
+ std::shared_ptr<MediaAdapterListener> mock_stream) {
streamer_listener_[stype] = mock_stream;
}
@@ -118,29 +120,36 @@ void MediaManagerImpl::Init() {
#endif
if ("socket" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter(
- settings().server_address(), settings().video_streaming_port());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<SocketVideoStreamerAdapter>(
+ settings().server_address(), settings().video_streaming_port());
} else if ("pipe" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter(
- settings().named_video_pipe_path(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<PipeVideoStreamerAdapter>(
+ settings().named_video_pipe_path(),
+ settings().app_storage_folder());
} else if ("file" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new FileVideoStreamerAdapter(
- settings().video_stream_file(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<FileVideoStreamerAdapter>(
+ settings().video_stream_file(), settings().app_storage_folder());
}
if ("socket" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new SocketAudioStreamerAdapter(
- settings().server_address(), settings().audio_streaming_port());
+ streamer_[ServiceType::kAudio] =
+ std::make_shared<SocketAudioStreamerAdapter>(
+ settings().server_address(), settings().audio_streaming_port());
} else if ("pipe" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new PipeAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<PipeAudioStreamerAdapter>(
settings().named_audio_pipe_path(), settings().app_storage_folder());
} else if ("file" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new FileAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<FileAudioStreamerAdapter>(
settings().audio_stream_file(), settings().app_storage_folder());
}
- streamer_listener_[ServiceType::kMobileNav] = new StreamerListener(*this);
- streamer_listener_[ServiceType::kAudio] = new StreamerListener(*this);
+ streamer_listener_[ServiceType::kMobileNav] =
+ std::make_shared<StreamerListener>(*this);
+ streamer_listener_[ServiceType::kAudio] =
+ std::make_shared<StreamerListener>(*this);
if (streamer_[ServiceType::kMobileNav]) {
streamer_[ServiceType::kMobileNav]->AddListener(
@@ -185,8 +194,8 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key,
std::string file_path = settings().app_storage_folder();
file_path += "/";
file_path += output_file;
- from_mic_listener_ =
- new FromMicRecorderListener(file_path, application_manager_);
+ from_mic_listener_ = std::make_shared<FromMicRecorderListener>(
+ file_path, application_manager_);
#ifdef EXTENDED_MEDIA_MODE
if (from_mic_recorder_) {
from_mic_recorder_->AddListener(from_mic_listener_);
diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc
index 2bb0fe10ec..60b01c901b 100644
--- a/src/components/media_manager/src/socket_streamer_adapter.cc
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -108,13 +108,21 @@ bool SocketStreamerAdapter::SocketStreamer::Connect() {
return true;
}
+void SocketStreamerAdapter::SocketStreamer::Close() {
+ Disconnect();
+}
+
void SocketStreamerAdapter::SocketStreamer::Disconnect() {
LOG4CXX_AUTO_TRACE(logger);
if (0 < send_socket_fd_) {
+ shutdown(send_socket_fd_, SHUT_RDWR);
close(send_socket_fd_);
+ send_socket_fd_ = 0;
}
if (0 < socket_fd_) {
+ shutdown(socket_fd_, SHUT_RDWR);
close(socket_fd_);
+ socket_fd_ = 0;
}
}
diff --git a/src/components/media_manager/src/streamer_adapter.cc b/src/components/media_manager/src/streamer_adapter.cc
index 20c067da1c..37cb1426dc 100644
--- a/src/components/media_manager/src/streamer_adapter.cc
+++ b/src/components/media_manager/src/streamer_adapter.cc
@@ -44,8 +44,11 @@ StreamerAdapter::StreamerAdapter(Streamer* const streamer)
}
StreamerAdapter::~StreamerAdapter() {
- delete streamer_;
+ if (streamer_) {
+ streamer_->Close();
+ }
thread_->join();
+ delete streamer_;
threads::DeleteThread(thread_);
}
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
index 80b2ee3377..96499d9358 100644
--- a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
@@ -44,10 +44,9 @@ using namespace media_manager;
class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl {
public:
- MOCK_METHOD1(AddListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ MOCK_METHOD1(AddListener, void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD1(RemoveListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD2(SendData,
void(int32_t application_key,
const ::protocol_handler::RawMessagePtr message));
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
index f9618c7fb8..c77c984a75 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,147 +33,377 @@
#include "gmock/gmock.h"
#include "media_manager/media_manager_impl.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_adapter_listener.h"
#include "media_manager/mock_media_manager_settings.h"
-#include "application_manager/mock_application_manager.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "resumption/last_state.h"
+#include "application_manager/state_controller.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol/common.h"
+
+#include "utils/file_system.h"
+#include "utils/scope_guard.h"
namespace test {
namespace components {
namespace media_manager_test {
+using namespace file_system;
+using namespace ::media_manager;
using ::testing::_;
+using ::testing::Return;
using ::testing::ReturnRef;
-using protocol_handler::ServiceType;
+
+using ::utils::ScopeGuard;
+using ::utils::MakeGuard;
+using ::testing::NiceMock;
+using ::protocol_handler::ServiceType;
+using ::protocol_handler::RawMessagePtr;
+using application_manager::ApplicationSharedPtr;
+using application_manager::BinaryData;
+
+namespace {
+const uint16_t kVideoStreamingPort = 8901u;
+const uint16_t kAudioStreamingPort = 8000u;
+const int32_t kApplicationKey = 1;
+const int32_t kDuration = 1000;
+const std::string kStorageFolder = "test_storage_folder";
+const std::string kOutputFile = "test_output_file";
+const std::string kResourceFolder = "test_resource_folder";
+const std::string kRecordingFileSource = "test_recording_file_source";
+const std::string kNamedVideoPipePath = "named_video_pipe_path";
+const std::string kNamedAudioPipePath = "named_audio_pipe_path";
+const std::string kVideoStreamFile = "video_stream_file";
+const std::string kAudioStreamFile = "audio_stream_file";
+const std::string kServerAddress = "server_address";
+const std::string kSocketValue = "socket";
+const std::string kPipeValue = "pipe";
+const std::string kFileValue = "file";
+const std::string kDefaultValue = "";
+const std::string kOutputFilePath = kStorageFolder + "/" + kOutputFile;
+const uint32_t kProtocolVersion = ::protocol_handler::PROTOCOL_VERSION_2;
+const uint32_t kConnectionKey = 1u;
+
+void dealloc_data(uint8_t* data) {
+ delete[] data;
+}
+
+void dealloc_file(std::ofstream* test_file) {
+ delete test_file;
+}
+} // namespace
+
+typedef NiceMock<application_manager_test::MockApplication> MockApp;
+typedef std::shared_ptr<MockApp> MockAppPtr;
+typedef std::shared_ptr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
class MediaManagerImplTest : public ::testing::Test {
+ public:
+ MediaManagerImplTest() {
+ media_adapter_listener_mock_ = std::make_shared<MockMediaAdapterListener>();
+ ON_CALL(mock_media_manager_settings_, video_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ ON_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ mock_app_ = std::make_shared<MockApp>();
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
protected:
+ void StartMicrophoneCheckHelper() {
+ EXPECT_CALL(app_mngr_, application(kApplicationKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+#ifndef EXTENDED_MEDIA_MODE
+ EXPECT_CALL(mock_media_manager_settings_, app_resource_folder())
+ .WillOnce(ReturnRef(kResourceFolder));
+ EXPECT_CALL(mock_media_manager_settings_, recording_file_source())
+ .WillOnce(ReturnRef(kRecordingFileSource));
+#endif
+ }
+
+ void InitMediaManagerPrecondition(const std::string& server_type) {
+ EXPECT_CALL(mock_media_manager_settings_, video_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ EXPECT_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ }
+
+ void InitMediaManagerSocketServerType() {
+ InitMediaManagerPrecondition(kSocketValue);
+ EXPECT_CALL(mock_media_manager_settings_, server_address())
+ .WillRepeatedly(ReturnRef(kServerAddress));
+ EXPECT_CALL(mock_media_manager_settings_, video_streaming_port())
+ .WillOnce(Return(kVideoStreamingPort));
+ EXPECT_CALL(mock_media_manager_settings_, audio_streaming_port())
+ .WillOnce(Return(kAudioStreamingPort));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerPipeServerType() {
+ InitMediaManagerPrecondition(kPipeValue);
+ EXPECT_CALL(mock_media_manager_settings_, named_video_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, named_audio_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerFileServerType() {
+ InitMediaManagerPrecondition(kFileValue);
+ EXPECT_CALL(mock_media_manager_settings_, video_stream_file())
+ .WillOnce(ReturnRef(kVideoStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, audio_stream_file())
+ .WillOnce(ReturnRef(kAudioStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void ReceivedMessage(const ServiceType service_type) {
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, service_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type));
+ MockMediaAdapterImplPtr mock_media_streamer =
+ std::make_shared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer);
+ media_manager_impl_->set_mock_streamer_listener(
+ service_type, media_adapter_listener_mock_);
+ EXPECT_CALL(*mock_media_streamer, SendData(kConnectionKey, _));
+ EmulateMobileMessage(service_type);
+ }
+
+ void EmulateMobileMessage(const ServiceType serviceType) {
+ const uint32_t data_sending_size = 3u;
+ unsigned char data_sending[data_sending_size] = {0x20, 0x07, 0x01};
+ const RawMessagePtr raw_message_ptr(
+ new ::protocol_handler::RawMessage(kConnectionKey,
+ kProtocolVersion,
+ data_sending,
+ data_sending_size,
+ serviceType));
+ media_manager_impl_->OnMessageReceived(raw_message_ptr);
+ media_manager_impl_->OnMobileMessageSent(raw_message_ptr);
+ }
+
+ application_manager_test::MockApplicationManager app_mngr_;
+ MockAppPtr mock_app_;
+ std::shared_ptr<MockMediaAdapterListener> media_adapter_listener_mock_;
const ::testing::NiceMock<MockMediaManagerSettings>
mock_media_manager_settings_;
- const std::string kDefaultValue_ = "";
+ std::shared_ptr<MediaManagerImpl> media_manager_impl_;
};
-TEST_F(MediaManagerImplTest, PlayA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithUnsupportedServiceType_Cancelled) {
+ EXPECT_CALL(app_mngr_, CanAppStream(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EmulateMobileMessage(ServiceType::kInvalidServiceType);
+}
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(audio_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(video_type);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StartActivity(application_key));
- mediaManagerImpl.PlayA2DPSource(application_key);
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(audio_type);
}
-TEST_F(MediaManagerImplTest, StopA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(video_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithAudioServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kAudio);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StopActivity(application_key));
- mediaManagerImpl.StopA2DPSource(application_key);
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithVideoServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, StopMicrophoneRecording) {
- MockMediaAdapterListener* media_adapter_listener_mock_ =
- new MockMediaAdapterListener();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectSocketValue) {
+ InitMediaManagerSocketServerType();
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectPipeValue) {
+ InitMediaManagerPipeServerType();
+}
- mediaManagerImpl.set_mock_mic_listener(media_adapter_listener_mock_);
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
+ InitMediaManagerFileServerType();
+}
+
+TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
+ // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StartActivity(kApplicationKey));
+ media_manager_impl_->PlayA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StopActivity(kApplicationKey));
+ media_manager_impl_->StopA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_SourceFileIsWritable_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
+
+ const std::string record_file_path =
+ kResourceFolder + "/" + kRecordingFileSource;
+ if (!DirectoryExists(kResourceFolder)) {
+ CreateDirectory(kResourceFolder);
+ }
+ EXPECT_FALSE(FileExists(record_file_path));
+ EXPECT_TRUE(CreateFile(record_file_path));
+ std::ofstream* test_file = Open(record_file_path);
+ ScopeGuard file_guard = MakeGuard(dealloc_file, test_file);
+ UNUSED(file_guard);
+ EXPECT_TRUE(test_file->is_open());
+ const uint32_t data_size = 4u;
+ uint8_t* data = new uint8_t[data_size];
+ ScopeGuard data_guard = MakeGuard(dealloc_data, data);
+ UNUSED(data_guard);
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ BinaryData result;
+ EXPECT_TRUE(ReadBinaryFile(record_file_path, result));
+ EXPECT_FALSE(result.empty());
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ EXPECT_TRUE(RemoveDirectory(kResourceFolder, true));
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileNotExists_ExpectFalse) {
+ StartMicrophoneCheckHelper();
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileCouldNotDeleted_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
+ chmod(kOutputFilePath.c_str(), S_IRUSR);
+ EXPECT_FALSE(DeleteFile(kOutputFilePath));
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_TRUE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ chmod(kOutputFilePath.c_str(), S_IWUSR);
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) {
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
#ifdef EXTENDED_MEDIA_MODE
MockMediaAdapterImpl* media_adapter_recorder_mock =
new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_mic_recorder(media_adapter_recorder_mock);
- EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(application_key));
+ media_manager_impl_->set_mock_mic_recorder(media_adapter_recorder_mock);
+ EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(kApplicationKey));
#endif // EXTENDED_MEDIA_MODE
- EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(application_key));
+ EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(kApplicationKey));
#ifdef EXTENDED_MEDIA_MODE
EXPECT_CALL(*media_adapter_recorder_mock, RemoveListener(_));
#endif // EXTENDED_MEDIA_MODE
- mediaManagerImpl.StopMicrophoneRecording(application_key);
+ media_manager_impl_->StopMicrophoneRecording(kApplicationKey);
}
-TEST_F(MediaManagerImplTest, StartStopStreaming) {
- application_manager_test::MockApplicationManager mock_application_manager;
-
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
-
- int32_t application_key = 1;
- MockMediaAdapterImpl* mock_audio_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kAudio,
- mock_audio_media_streamer);
- MockMediaAdapterImpl* mock_nav_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kMobileNav,
- mock_nav_media_streamer);
-
- EXPECT_CALL(*mock_audio_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
+TEST_F(MediaManagerImplTest,
+ StartStopStreaming_AudioAndVideoServiceType_SUCCESS) {
+ MockMediaAdapterImplPtr mock_audio_media_streamer =
+ std::make_shared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kAudio,
+ mock_audio_media_streamer);
+ MockMediaAdapterImplPtr mock_nav_media_streamer =
+ std::make_shared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav,
+ mock_nav_media_streamer);
- EXPECT_CALL(*mock_audio_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, CheckFramesProcessed) {
- application_manager_test::MockApplicationManager mock_application_manager;
-
+TEST_F(MediaManagerImplTest,
+ CheckFramesProcessed_WithCorrectFramesNumber_SUCCESS) {
ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
+ .WillByDefault(ReturnRef(kDefaultValue));
ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
+ .WillByDefault(ReturnRef(kDefaultValue));
protocol_handler_test::MockProtocolHandler mock_protocol_handler;
- mediaManagerImpl.SetProtocolHandler(&mock_protocol_handler);
- int32_t application_key = 1;
- int32_t frame_number = 10;
-
+ media_manager_impl_->SetProtocolHandler(&mock_protocol_handler);
+ const int32_t frame_number = 10;
EXPECT_CALL(mock_protocol_handler,
- SendFramesNumber(application_key, frame_number));
- mediaManagerImpl.FramesProcessed(application_key, frame_number);
+ SendFramesNumber(kApplicationKey, frame_number));
+ media_manager_impl_->FramesProcessed(kApplicationKey, frame_number);
}
} // namespace media_manager_test
diff --git a/src/components/policy/policy_external/.gitignore b/src/components/policy/policy_external/.gitignore
index 3e5fc41721..d6052d61da 100644
--- a/src/components/policy/policy_external/.gitignore
+++ b/src/components/policy/policy_external/.gitignore
@@ -29,8 +29,6 @@ src/appMain/hmi_link
src/appMain/smartDeviceLinkCore
test/components/application_manager/policies_manager/test_policies_table
test/components/application_manager/test_formatters_commands
-test/components/dbus/test_DBusAdapter
-test/components/dbus/test_DBusSchema
test/components/protocol_handler/test_ProtocolHandler
test/components/request_watchdog/test_RequestWatchdog
test/components/smart_objects/SchemaItem/test_SmartObject_AlwaysFalseSchemaItemTest
@@ -54,11 +52,8 @@ 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
@@ -70,9 +65,6 @@ moc_*.cpp
*_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
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index 2cbdbd7f64..c66313240f 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -55,6 +55,7 @@ set(SOURCES
${POLICY_PATH}/src/update_status_manager.cc
${POLICY_PATH}/src/status.cc
${POLICY_PATH}/src/cache_manager.cc
+ ${POLICY_PATH}/src/access_remote_impl.cc
${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
)
diff --git a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
index 6505ae6f43..2c23555902 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
@@ -1,11 +1,11 @@
/*! \page components_smartobjects_types_repr Type value representation methods for SmartObjects
-As alternative to the type casts NsSmartDeviceLink::NsSmartObjects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
+As alternative to the type casts ns_smart_device_link::ns_smart_objects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
Example:
<pre>
-NsSmartDeviceLink::NsSmartObjects::CSmartObject obj;
+ns_smart_device_link::ns_smart_objects::CSmartObject obj;
obj[0] = 1;
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
index 2e611f74b9..a031e9fd86 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
@@ -1,25 +1,25 @@
/*! \page components_smartobjects_validation_items Schema structure: Schema Items
-In order to create new Schema (new object of class NsSmartDeviceLink::NsSmartObjects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
+In order to create new Schema (new object of class ns_smart_device_link::ns_smart_objects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
-Schema Items are represented as class hierarchy. The base class for all schema items is a NsSmartDeviceLink::NsSmartObjects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
+Schema Items are represented as class hierarchy. The base class for all schema items is a ns_smart_device_link::ns_smart_objects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
-To define special elements with always successful or always failing validation there are two special Schema Items: NsSmartDeviceLink::NsSmartObjects::CAlwaysTrueSchemaItem and NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem.
+To define special elements with always successful or always failing validation there are two special Schema Items: ns_smart_device_link::ns_smart_objects::CAlwaysTrueSchemaItem and ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem.
-NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
+ns_smart_device_link::ns_smart_objects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
-NsSmartDeviceLink::NsSmartObjects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
+ns_smart_device_link::ns_smart_objects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
-NsSmartDeviceLink::NsSmartObjects::TEnumSchemaItem is used to verify any custom client-defined enum.
+ns_smart_device_link::ns_smart_objects::TEnumSchemaItem is used to verify any custom client-defined enum.
-NsSmartDeviceLink::NsSmartObjects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
+ns_smart_device_link::ns_smart_objects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
-NsSmartDeviceLink::NsSmartObjects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
+ns_smart_device_link::ns_smart_objects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
-NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
+ns_smart_device_link::ns_smart_objects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
After creation of all required Schema Items (which is actually bind in the tree) it is possible to create Schema.
-Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem::SMember class). So every root item (NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
+Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by ns_smart_device_link::ns_smart_objects::CObjectSchemaItem::SMember class). So every root item (ns_smart_device_link::ns_smart_objects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
and pass root Schema Item as initial parameter to the new Schema.
@@ -77,21 +77,21 @@ schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem, false);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
index a02f0be4bd..c651af5294 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
@@ -1,9 +1,9 @@
/*! \page components_smartobjects_validation_use Using Schema for validation
-The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
+The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
-Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
+Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
-To "unapply" modifications done by apply feature Schema has NsSmartDeviceLink::NsSmartObjects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
+To "unapply" modifications done by apply feature Schema has ns_smart_device_link::ns_smart_objects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
index 2ba273e9d4..dab3df104d 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_connection_management Connection Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * To connect remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::connectDevice(). It will initiate connections to all
+ * To connect remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::connectDevice(). It will initiate connections to all
* applications running on remove device. For TCP device this call has no effect as TCP connections are initiated by remote devices.
- * Client will be notified about each connected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationConnected().
- * To disconnect all applications running on remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::disconnectDevice().
- * Client will be notified about each disconnected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationDisconnected().
+ * Client will be notified about each connected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationConnected().
+ * To disconnect all applications running on remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::disconnectDevice().
+ * Client will be notified about each disconnected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationDisconnected().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
index 98dd7426be..831a0c7818 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_data_transfer Data Transfer
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener
- * interface and add itself as a data listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDataListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener
+ * interface and add itself as a data listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDataListener()
* in order to receive notifications.
- * To send frame to remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::sendFrame() poviding connection handle,
+ * To send frame to remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::sendFrame() poviding connection handle,
* frame data, data size and user data. User data is an integer that is assigned to a frame and will be sent back to client when sending of frame
* will be completed. Client may use this data to identify frame when send result will be reported. When sending of frame is completed
- * client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
- * device client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameReceived().
+ * client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
+ * device client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameReceived().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
index eb5f3e477e..4b5b63bf87 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_device_management Device Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * Client of TransportManager may use NsSmartDeviceLink::NsTransportManager::ITransportManager::scanForNewDevices()
+ * Client of TransportManager may use ns_smart_device_link::ns_transport_manager::ITransportManager::scanForNewDevices()
* to initiate device scan on all device adapters that support this feature. In order to get list of available
- * devices client must override NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onDeviceListUpdated().
+ * devices client must override ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onDeviceListUpdated().
* Each device adapter will perform scan independently from other device adapters and device list might be updated
* several times (after each adapter that supports scanning finishes scanning operation). Device list might also be
* updated without device scan request, e.g. if new client connects via TCP this device will be added to device list
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
index 8916dbeb55..d4d0efeb7b 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
@@ -3,12 +3,12 @@
This chapter describes details of correct use of Transport Manager on the client side. In other words this chapter can be called "How to create effective and safe client of Transport Manager".
Transport Manager defines set of asynchronous requests (means that operations are non-blocking in the calling thread) and provides two different interfaces to monitor asynchronous responses and notifications about data update.
-Clients of Transport Manager should use NsSmartDeviceLink::NsTransportManager::ITransportManager interface to initiate any request to the component.
+Clients of Transport Manager should use ns_smart_device_link::ns_transport_manager::ITransportManager interface to initiate any request to the component.
Also Transport Manager provides two different interfaces:
-1) NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
+1) ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
-2) NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
+2) ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
For more information about typical use of Transport Manager please read the following topics:
- \subpage components_transportmanager_client_device_management "Device Management"
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
index 970aeffd83..eb5de23e35 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
@@ -1,18 +1,18 @@
/** @page components_transportmanager_internal_design_transport_adapters_bluetooth_adapter Bluetooth Adapter
*
* Bluetooth adapter handles communication with external devices via bluetooth. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter.
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_discovery Device discovery
*
- * When requested by a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::scanForNewDevices() bluetooth adapter
+ * When requested by a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::scanForNewDevices() bluetooth adapter
* searches for bluetooth devices. For each found device it runs SDP query for service with SmartDeviceLink UUID
* (936DA01F-9ABD-4D9D-80C7-02AF85C822A8). Devices that support this service are added to bluetooth adapter device list.
* Bluetooth device scans are performed only when explicitly requested.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_connecting_devices Connecting devices
*
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
* and fills connection list with connections to all RFCOMM channels on remote device where SmartDeviceLink service has been discovered.
*
* @see @ref components_transportmanager_internal_design_transport_adapters_common_connecting_devices
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
index d81b70dfe8..2fbd835ec9 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_internal_design_transport_adapters_tcp_adapter TCP Adapter
*
* TCP adapter handles communication with remote devices via TCP/IP socket. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CTCPAdapter.
+ * ns_smart_device_link::ns_transport_manager::CTCPAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_listen Listening for connections
*
- * TCP adapter creates listening TCP socket (TCP port is specified in NsSmartDeviceLink::NsTransportManager::CTCPAdapter::cTCPAdapterPort)
+ * TCP adapter creates listening TCP socket (TCP port is specified in ns_smart_device_link::ns_transport_manager::CTCPAdapter::cTCPAdapterPort)
* and listens for incoming connections. Devices are identified by their IP address.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_accept Accepting connection
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
index 3a5d0f0e91..015978b773 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
@@ -4,80 +4,80 @@
*
* @section components_transportmanager_internal_design_transport_adapters_common Common logic
*
- * Logic common to all device adapters is implemented in class NsSmartDeviceLink::NsTransportManager::CTransportAdapter.
+ * Logic common to all device adapters is implemented in class ns_smart_device_link::ns_transport_manager::CTransportAdapter.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_devices_map Devices map
*
- * Devices map is a map of device handle to internal device structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SDevice.
- * Devices map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevices. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevicesMutex locked.
+ * Devices map is a map of device handle to internal device structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SDevice.
+ * Devices map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevices. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevicesMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connections_map Connections map
*
- * Connections map is a map of connection handle to internal connection structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection.
- * Connections map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnections. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnectionsMutex locked.
+ * Connections map is a map of connection handle to internal connection structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection.
+ * Connections map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnections. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnectionsMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_main_thread Device adapter main thread
*
- * Device adapter main thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::run().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mainThread()
+ * Device adapter main thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::run().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::mainThread()
* and implement its specific main thread logic there.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connection_thread Device adapter connection thread
*
- * Device adapter connection thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectionThread()
+ * Device adapter connection thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectionThread()
* and implement its specific connection thread logic there. When connection is established and socket file descriptor is set
- * in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() to handle all communication through this socket
+ * in ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() to handle all communication through this socket
* until connection is terminated.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_threads_termination Termination of device adapter threads
*
- * Specific device adapter implementation must call in its destructor NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForThreadsTermination()
+ * Specific device adapter implementation must call in its destructor ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForThreadsTermination()
* to wait for termination of all threads (main thread and connection threads). Device adapter threads must be terminated before specific
* device adapter class is destructed, so it can't be called in the destructor of base class and must be called explicitly from the inherited
* class's destructor.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_device_scan Requesting scan for new devices
*
- * Device scan is requested by setting flag NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequested
- * and signaling conditional variable NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
+ * Device scan is requested by setting flag ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequested
+ * and signaling conditional variable ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
* by specific device adapter if it supports device scanning. Specific device adaptere may call for this purpose
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
* until it's signaled or specified timeout expires.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connecting_devices Connecting devices
*
- * Device connection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectDevice().
- * This method calls virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::createConnectionsListForDevice()
+ * Device connection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectDevice().
+ * This method calls virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::createConnectionsListForDevice()
* which may be implemented by specific device adapter to create a list of connections that must be established for the device.
- * For each connection created by device adapter it calls NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection()
+ * For each connection created by device adapter it calls ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection()
* which adds connection to connections map and starts connection thread.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_disconnecting_devices Disconnecting devices
*
- * Device disconnection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::disconnectDevice().
+ * Device disconnection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::disconnectDevice().
* This method finds all connections in connections map that corresponds to specified device and calls
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::stopConnection() for each of them.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::stopConnection() for each of them.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_handling_communication Handling communication
*
- * All frames requested to be sent via NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() are stored in
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mFramesToSend. Pipe
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() to notify connection thread that data is available
- * to be sent. NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() uses poll() to wait for
+ * All frames requested to be sent via ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() are stored in
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mFramesToSend. Pipe
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() to notify connection thread that data is available
+ * to be sent. ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() uses poll() to wait for
* incoming data using connection socket file descriptor and outgoing data using file descriptor of the read end of this pipe.
* When either of them become available for reading or some error occurs (e.g. socket gets disconnected) connection thread
* wakes up and handles this event. Notification pipe is also used to notify connection thread that connection has to be
- * terminated using NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mTerminateFlag.
+ * terminated using ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mTerminateFlag.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_update_client_device_list Updating client device list.
*
- * Specific device adapter may call NsSmartDeviceLink::NsTransportManager::CTransportAdapter::updateClientDeviceList() when its internal
+ * Specific device adapter may call ns_smart_device_link::ns_transport_manager::CTransportAdapter::updateClientDeviceList() when its internal
* knowledge about available devices is updated to notify device adapter client (TransportManager) about this update.
*
* @section components_transportmanager_internal_design_transport_adapters_common_specific Specific device adapters
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
index 6c35f0962f..3d2fcb5094 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
@@ -2,8 +2,8 @@
Internally Transport Manager uses different threads for different operations. This design solution was used to provide efficient asynchronous communication with clients and underlying Device Adapters.
-Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener will be called from that thread.
+Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener will be called from that thread.
-For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
+For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
index c96fd46a22..164fad9140 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
@@ -2,13 +2,13 @@
Actually Transport Manager component is implemented as classical manager component. It manages connections and abstract devices and provides unified information for the clients.
-Connection-related information encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
+Connection-related information encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
-Frame processing encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
+Frame processing encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
Callback information between transport manager threads passed in form of special structures:
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDeviceListenerCallback.
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDataListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDeviceListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDataListenerCallback.
Client calls to TM guarded by separate mutex. This allows use component from different threads without any risk.
diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h
new file mode 100644
index 0000000000..fd185af075
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
+
+#include <vector>
+#include <ostream>
+#include <string>
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+
+enum TypeAccess { kDisallowed, kAllowed };
+inline std::ostream& operator<<(std::ostream& output, TypeAccess x) {
+ output << "Access: ";
+ switch (x) {
+ case kDisallowed:
+ output << "DISALLOWED";
+ break;
+ case kAllowed:
+ output << "ALLOWED";
+ break;
+ default:
+ output << "Error: Unknown type";
+ }
+ return output;
+}
+
+struct ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) = 0;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h
new file mode 100644
index 0000000000..cee2a8774f
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+
+#include <map>
+#include "policy/policy_table/types.h"
+#include "utils/macro.h"
+
+#include "policy/access_remote.h"
+#include "policy/cache_manager.h"
+
+using policy_table::FunctionalGroupings;
+
+namespace policy {
+
+class AccessRemoteImpl : public AccessRemote {
+ public:
+ AccessRemoteImpl();
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ inline void set_enabled(bool value);
+ inline bool country_consent() const;
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ std::shared_ptr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, KeyMapTest);
+ FRIEND_TEST(AccessRemoteImplTest, Allow);
+ FRIEND_TEST(AccessRemoteImplTest, Deny);
+ FRIEND_TEST(AccessRemoteImplTest, ChangeAccess);
+ FRIEND_TEST(AccessRemoteImplTest, ResetBySubject);
+ FRIEND_TEST(AccessRemoteImplTest, ResetByObject);
+ FRIEND_TEST(AccessRemoteImplTest, CheckAllowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckManual);
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index 13b7dd88bb..d30e7cea24 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -56,6 +55,19 @@ class CacheManager : public CacheManagerInterface {
~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.
@@ -71,6 +83,22 @@ class CacheManager : public CacheManagerInterface {
CheckPermissionResult& result);
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -203,7 +231,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -335,6 +363,21 @@ class CacheManager : public CacheManagerInterface {
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
*/
@@ -433,9 +476,12 @@ class CacheManager : public CacheManagerInterface {
/**
* @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 SetUserPermissionsForApp(const PermissionConsent& permissions,
+ bool* out_app_permissions_changed);
/**
* @brief Records information about head unit system to PT
@@ -611,8 +657,18 @@ class CacheManager : public CacheManagerInterface {
* @param policy_app_id Unique application id
* @param request_types Request types of application
*/
- void GetAppRequestTypes(const std::string& policy_app_id,
- std::vector<std::string>& request_types) const;
+ void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const OVERRIDE;
virtual const MetaInfo GetMetaInfo() const OVERRIDE;
@@ -626,14 +682,59 @@ class CacheManager : public CacheManagerInterface {
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 {
+ std::shared_ptr<policy_table::Table> GetPT() const {
return pt_;
}
#endif
const PolicySettings& get_settings() const;
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
private:
std::string currentDateTime();
struct AppHMITypeToString {
@@ -664,6 +765,13 @@ class CacheManager : public CacheManagerInterface {
*/
void ResetCalculatedPermissionsForDevice(const std::string& device_id);
+ /**
+ * @brief Transform to lower case all non default application names in
+ * applications policies section
+ * @param pt polict rable for update
+ */
+ void MakeLowerCaseAppNames(policy_table::Table& pt) const;
+
void AddCalculatedPermissions(const std::string& device_id,
const std::string& policy_app_id,
const policy::Permissions& permissions);
@@ -673,15 +781,15 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
- utils::SharedPtr<PTExtRepresentation> ex_backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
+ std::shared_ptr<PTExtRepresentation> ex_backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
@@ -699,8 +807,9 @@ class CacheManager : public CacheManagerInterface {
* JSON date is different than current database.
*
* @param file_name the preloaded policy table JSON file.
+ * @return false in case of invalid preloaded_pt
*/
- void MergePreloadPT(const std::string& file_name);
+ bool MergePreloadPT(const std::string& file_name);
bool GetPermissionsList(StringArray& perm_list) const;
@@ -811,6 +920,17 @@ class CacheManager : public CacheManagerInterface {
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;
@@ -835,6 +955,14 @@ class CacheManager : public CacheManagerInterface {
sync_primitives::Lock backuper_locker_;
BackgroundBackuper* backuper_;
const PolicySettings* settings_;
+
+ friend class AccessRemoteImpl;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
};
} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
index fa31290987..bb9ce14c7f 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -36,8 +36,10 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
-#include "usage_statistics/counter.h"
+#include "policy/policy_table/types.h"
+#include "policy/pt_representation.h"
+
+#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -45,11 +47,35 @@ namespace policy_table = rpc::policy_table_interface_base;
namespace policy {
+namespace RequestType {
+// Describes available RequestType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestType
+
+namespace RequestSubType {
+// Describes available RequestSubType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestSubType
+
class CacheManagerInterface {
public:
virtual ~CacheManagerInterface() {}
/**
+ * @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.
@@ -63,6 +89,21 @@ class CacheManagerInterface {
const PTString& hmi_level,
const PTString& rpc,
CheckPermissionResult& result) = 0;
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
/**
* @brief Returns true if Policy Table was not updated yet
@@ -196,7 +237,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -330,6 +371,14 @@ class CacheManagerInterface {
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
*/
@@ -444,10 +493,12 @@ class CacheManagerInterface {
/**
* @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) = 0;
+ virtual bool SetUserPermissionsForApp(const PermissionConsent& permissions,
+ bool* out_app_permissions_changed) = 0;
/**
* @brief Records information about head unit system to PT
@@ -680,6 +731,15 @@ class CacheManagerInterface {
std::vector<std::string>& request_types) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ virtual void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const = 0;
+
+ /**
* @brief Gets meta information
* @return meta information
*/
@@ -699,18 +759,80 @@ class CacheManagerInterface {
*/
virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status external consent status
+ * @return true if succeeded, otherwise - false
+ */
+ virtual bool SetExternalConsentStatus(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return external consent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() = 0;
+
+ /**
+ * @brief Creates externalConsentStatus data structure from policy table
+ section "externalConsentStatus"
+ * @return ExternalConsentStatus data structure
+ */
+ virtual ExternalConsentStatus GetExternalConsentEntities() = 0;
+
+ /**
+ * @brief Creates collection of ExternalConsent items known by current
+ * functional
+ * groupings and appropiate section
+ * (disallowed_by_external_consent_entities_on/off) where
+ * is item is being holded
+ * @param status Current status containing collection of ExternalConsent items
+ * @return Collection of ExternalConsent items mapped to list of groups with
+ * section
+ * marker where the item is found
+ */
+ virtual GroupsByExternalConsentStatus GetGroupsWithSameEntities(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets collection of links device-to-application from device_data
+ * section of policy table if there any application records present, i.e. if
+ * any specific user consent is present
+ * @return Collection of device-to-application links
+ */
+ virtual std::map<std::string, std::string> GetKnownLinksFromPT() = 0;
+
+ /**
+ * @brief Sets groups permissions affected by customer connectivity settings
+ * entities status, i.e. groups assigned to particular application on
+ * particular device which have same entities as current ExternalConsent status
+ * @param permissions Groups permissions which result current ExternalConsent
+ * status
+ */
+ virtual void SetExternalConsentForApp(
+ const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
#ifdef BUILD_TESTS
/**
- * @brief GetPT allows to obtain SharedPtr to PT.
+ * @brief GetPT allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GetPT() const = 0;
#endif
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
index 9f8151e29f..e3cb509c15 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -75,62 +75,166 @@ struct CompareGroupName {
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
+ * @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);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot,
+ CheckAppPolicyResults& out_results);
+
bool operator()(const AppPoliciesValueType& app_policy);
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
- };
-
+ /**
+ * @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;
+ PermissionsCheckResult result,
+ AppPermissions& permissions_diff) 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;
- void NotifySystem(const AppPoliciesValueType& app_policy) const;
- void SendPermissionsToApp(const AppPoliciesValueType& app_policy) 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;
+ /**
+ * @brief Checks whether App RequestSubTypes have been changed by
+ * udpated
+ * @param app_policy Reference to updated application policy
+ * @return True if changed, otherwise - false
+ */
+ bool IsRequestSubTypeChanged(const AppPoliciesValueType& app_policy) const;
+
+ /**
+ * @brief Helper function that inserts permissions into app_permissions_diff_
+ * map.
+ * udpated
+ * @param app_policy Reference to updated application policy
+ * @param permissions_diff Reference to app permissions to be inserted into
+ * map.
+ * @return void
+ */
+ void InsertPermission(const std::string& app_id,
+ const AppPermissions& permissions_diff);
+
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
+ CheckAppPolicyResults& out_results_;
+};
+
+/**
+ * @brief Helper struct for filling actions to be done for processed application
+ * using CheckAppPolicyResults data as a source
+ */
+struct FillActionsForAppPolicies {
+ FillActionsForAppPolicies(
+ ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies)
+ : actions_(actions), app_policies_(app_policies) {}
+
+ void operator()(const policy::CheckAppPolicyResults::value_type& value);
+
+ private:
+ ApplicationsPoliciesActions& actions_;
+ const policy_table::ApplicationPolicies& app_policies_;
};
/*
@@ -164,8 +268,26 @@ struct FillNotificationData {
const std::set<Parameter>& target);
void InitRpcKeys(const std::string& rpc_name);
bool RpcParametersEmpty(RpcPermissions& rpc);
- bool IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section);
+
+ /**
+ * @brief Checks if specific section in specified permissions is empty
+ * @param permissions reference to the permissions structure
+ * @param section reference to the section name
+ * @return true if specified section in permissions is empty otherwise returns
+ * false
+ */
+ bool IsSectionEmpty(const ParameterPermissions& permissions,
+ const std::string& section) const;
+
+ /**
+ * @brief Checks if at least one parameter is allowed for the specified
+ * permissions
+ * @param permissions reference to the permissions structure
+ * @return true if at least one parameter is allowed for the specified
+ * permissions otherwise returns false
+ */
+ bool IsSomeParameterAllowed(const ParameterPermissions& permissions) const;
+
std::string current_key_;
Permissions& data_;
const bool does_require_user_consent_;
@@ -257,6 +379,7 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
* @return true, if succeded, otherwise - false
*/
bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
-}
+
+} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index 7f8322ee05..3837dda1fa 100644
--- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
#include <list>
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -42,6 +42,8 @@
#include "policy/update_status_manager.h"
#include "policy/policy_table/functions.h"
#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -52,180 +54,716 @@ class PolicyManagerImpl : public PolicyManager {
public:
PolicyManagerImpl();
explicit PolicyManagerImpl(bool in_memory);
- virtual void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
PolicyListener* listener() const {
return listener_;
}
- 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 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
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
+ std::string GetUpdateUrl(int service_type) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ void RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ int NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
*/
virtual void RefreshRetrySequence();
- virtual DeviceConsent GetUserConsentForDevice(
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
- virtual void GetUserConsentForApp(
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
- 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);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type);
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info);
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const bool is_device_allowed) OVERRIDE;
- virtual void SetUserConsentForApp(const PermissionConsent& permissions);
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const;
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const;
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ * @param mode notification mode
+ */
+ void SetUserConsentForApp(const PermissionConsent& permissions,
+ const NotificationMode mode) OVERRIDE;
+
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
+
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
+
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param active_hmi_language Currently active language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
const std::vector<std::string>& message_code,
const std::string& language,
- const std::string& active_hmi_language);
+ const std::string& active_hmi_language) OVERRIDE;
- virtual bool IsApplicationRevoked(const std::string& app_id) const;
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
- virtual void GetPermissionsForApp(
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const;
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
- virtual void SetSystemLanguage(const std::string& language);
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
- virtual void OnSystemReady();
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const OVERRIDE;
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
- virtual void SetVINValue(const std::string& value);
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
- // 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)
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
- AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
- void RemovePendingPermissionChanges(const std::string& app_id);
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
- void SendNotificationOnPermissionsUpdated(const std::string& application_id);
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
- bool CleanupUnpairedDevices();
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
- bool CanAppKeepContext(const std::string& app_id) const;
- bool CanAppStealFocus(const std::string& app_id) const;
- void MarkUnpairedDevice(const std::string& device_id);
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
+
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
+
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
- StatusNotifier AddApplication(const std::string& application_id);
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
+
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
virtual void RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name);
- virtual uint32_t HeartBeatTimeout(const std::string& app_id) const;
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
- virtual void SaveUpdateStatusRequired(bool is_update_needed);
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
- virtual bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
void set_cache_manager(CacheManagerInterface* cache_manager);
- virtual void OnAppsSearchStarted();
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
- virtual void OnAppsSearchCompleted();
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
-#ifdef BUILD_TESTS
- inline CacheManagerInterfaceSPtr GetCache() {
- return cache_;
- }
-#endif // BUILD_TESTS
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
- virtual const std::vector<std::string> GetAppRequestTypes(
- const std::string policy_app_id) const;
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
- virtual const VehicleInfo GetVehicleInfo() const;
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
- virtual void OnAppRegisteredOnMobile(const std::string& application_id);
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
- virtual const MetaInfo GetMetaInfo() const OVERRIDE;
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
- virtual std::string RetrieveCertificate() const OVERRIDE;
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
- virtual bool HasCertificate() const OVERRIDE;
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ const MetaInfo GetMetaInfo() const OVERRIDE;
- virtual void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
+ /**
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
+ void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
const PolicySettings& get_settings() const OVERRIDE;
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
const EndpointUrls& urls) const OVERRIDE;
+ /**
+ * @brief Checks, if SDL needs to update it's policy table section
+ "external_consent_status"
+ * @param ExternalConsent status
+ * @return true if such check is needed, false - if not.
+ */
+ bool IsNeedToUpdateExternalConsentStatus(
+ const ExternalConsentStatus& status) const OVERRIDE;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status ExternalConsent status
+ * @return true if succeeded, otherwise - false
+ */
+ bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return ExternalConsent status
+ */
+ ExternalConsentStatus GetExternalConsentStatus() OVERRIDE;
+
+#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+
+ /**
+ * @brief Setter for send_on_update_sent_out and wrong_ptu_update_received
+ * @param send_on_update_sent_out new value of this flag
+ * @param wrong_ptu_update_received new value of this flag
+ */
+ inline void SetSendOnUpdateFlags(const bool send_on_update_sent_out,
+ const bool wrong_ptu_update_received) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ wrong_ptu_update_received_ = wrong_ptu_update_received;
+ }
+#endif // BUILD_TESTS
+
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
+
protected:
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
void CheckTriggers();
- /*
- * @brief Checks policy table update along with current data for any changes
- * in assigned functional group list of application
- *
- * @param Policy table update struct
+
+ /**
+ * @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 std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
+
+ /**
+ * @brief Processes results from policy table update analysis done by
+ * CheckPermissionsChanges() by filling ApplicationsPoliciesActions struct
+ * with actions which should be done for every application and passes them to
+ * ProcessActionsForAppPolicies()
+ * @param results Collection of per-application results
+ * @param app_policies Reference to updated application policies section as
+ * a data source for generating notifications data
*/
- void CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ void ProcessAppPolicyCheckResults(
+ const CheckAppPolicyResults& results,
+ const policy_table::ApplicationPolicies& app_policies);
+
+ /**
+ * @brief Processes actions filled in ProcessAppPolicyCheckResults() for every
+ * application by sending OnPermissionChange and OnAppPermissionChanged
+ * notifications and by checking consent where it needed
+ * @param actions Reference to map with actions to be done or not for every
+ * application
+ * @param app_policies Reference to updated application policies section as
+ * a data source for generating notifications data
+ */
+ void ProcessActionsForAppPolicies(
+ const ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies);
/**
* @brief Fill structure to be sent with OnPermissionsChanged notification
@@ -297,37 +835,225 @@ class PolicyManagerImpl : public PolicyManager {
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,
+ /**
+ * @brief StartPTExchange allows to start PTU. The function will check
+ * if one is required and starts the update flow in only case when previous
+ * condition is true.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+
+ /**
+ * @brief Notify application about its permissions changes by preparing and
+ * sending OnPermissionsChanged notification
+ * @param policy_app_id Application id to send notification to
+ * @param app_group_permissons Current permissions for groups assigned to
+ * application
+ */
+ void NotifyPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& app_group_permissions);
+
+ /**
+ * @brief Processes updated ExternalConsent status received via
+ * OnAppPermissionConsent
+ * notification by updating user consents and ExternalConsent consents for
+ * registered and
+ * known before by policy table (must have any user consent records)
+ * @param groups_by_status Collection of ExternalConsent entities with their
+ * statuses
+ * @param processing_policy Defines whether consents timestamps must be
+ * considered or external consents take over
+ */
+ void ProcessExternalConsentStatusUpdate(
+ const GroupsByExternalConsentStatus& groups_by_status,
+ const ConsentProcessingPolicy processing_policy);
+
+ /**
+ * @brief Processes ExternalConsent status for application registered
+ * afterward, so its
+ * user consents (if any) and ExternalConsent consents (if any) will be
+ * updated
+ * appropiately to current ExternalConsent status stored by policy table
+ * @param application_id Application id
+ * @param processing_policy Defines whether consents timestamps must be
+ * considered or external consents take over
+ */
+ void ProcessExternalConsentStatusForApp(
+ const std::string& application_id,
+ const ConsentProcessingPolicy processing_policy);
+ /**
+ * @brief Directly updates user consent and ExternalConsent consents (if any)
+ * for
+ * application if it has assigned any of group from allowed or disallowed
+ * lists
+ * @param device_id Device id which is linked to application id
+ * @param application_id Application id
+ * @param allowed_groups List of group names allowed by current
+ * ExternalConsent status
+ * @param disallowed_groups List of group names disallwed by current
+ * ExternalConsent status
+ * @param processing_policy Defines whether consents timestamps have to be
+ * considered or external consents take over
+ */
+ void UpdateAppConsentWithExternalConsent(
+ const std::string& device_id,
+ const std::string& application_id,
+ const GroupsNames& allowed_groups,
+ const GroupsNames& disallowed_groups,
+ const ConsentProcessingPolicy processing_policy);
+
+ typedef policy_table::ApplicationPolicies::value_type AppPoliciesValueType;
+
+ /**
+ * @brief Notifies system by sending OnAppPermissionChanged notification
+ * @param app_policy Reference to application policy
+ */
+ void NotifySystem(const AppPoliciesValueType& app_policy) const;
+
+ /**
+ * @brief Sends OnPermissionChange notification to application if its
+ * currently registered
+ * @param app_policy Reference to application policy
+ */
+ void SendPermissionsToApp(const AppPoliciesValueType& app_policy);
+
+ /**
+ * @brief Gets groups names from collection of groups permissions
+ * @param app_group_permissions Collection of groups permissions
+ * @return Collection of group names
+ */
+ policy_table::Strings GetGroupsNames(
+ const std::vector<FunctionalGroupPermission>& app_group_permissions)
+ const;
+
+ /**
+ * @brief Calculates consents for groups based on mapped ExternalConsent
+ * entities statuses
+ * and groups containers where entities have been found
+ * @param groups_by_external_consent ExternalConsent entities mapped to
+ * functional groups names and
+ * their containters where this entity has been found
+ * @param out_allowed_groups List of groups allowed by ExternalConsent status
+ * @param out_disallowed_groups List of groups disallowed by ExternalConsent
+ * status
+ */
+ void CalculateGroupsConsentFromExternalConsent(
+ const GroupsByExternalConsentStatus& groups_by_external_consent,
+ GroupsNames& out_allowed_groups,
+ GroupsNames& out_disallowed_groups) const;
+
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
CacheManagerInterfaceSPtr cache_;
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ std::shared_ptr<AccessRemote> access_remote_;
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
sync_primitives::Lock app_permissions_diff_lock_;
- std::map<std::string, AppPermissions> app_permissions_diff_;
/**
- * Timeout to wait response with UpdatePT
+ * @brief Collection of parameters to be reported to the system with
+ * SDL.ActivateApp response or OnAppPermissionsChanged notification
+ * Being set during policy table update processing
+ */
+ typedef std::map<std::string, AppPermissions> PendingPermissions;
+ PendingPermissions app_permissions_diff_;
+
+ /**
+ * @brief Timeout to wait response with UpdatePT
*/
- int retry_sequence_timeout_;
+ uint32_t retry_sequence_timeout_;
/**
- * Seconds between retries to update PT
+ * @brief Seconds between retries to update PT
*/
std::vector<int> retry_sequence_seconds_;
/**
- * Current index trying of retry sequence
+ * @brief Current index trying of retry sequence
*/
uint32_t retry_sequence_index_;
/**
- * Lock for guarding retry sequence
+ * @brief Lock for guarding retry sequence
*/
sync_primitives::Lock retry_sequence_lock_;
@@ -337,8 +1063,14 @@ class PolicyManagerImpl : public PolicyManager {
*/
mutable std::string last_device_id_;
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
bool ignition_check;
+ /**
+ * @brief Pointer to current policy settings structure
+ */
const PolicySettings* settings_;
friend struct CheckAppPolicy;
@@ -348,6 +1080,21 @@ class PolicyManagerImpl : public PolicyManager {
*/
RetrySequenceURL retry_sequence_url_;
friend struct ProccessAppGroups;
+
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
+ bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
+ bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
+ bool trigger_ptu_;
};
} // namespace policy
diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h
index ecbd56c2e4..fe27f1cb57 100644
--- a/src/components/policy/policy_external/include/policy/policy_table.h
+++ b/src/components/policy/policy_external/include/policy/policy_table.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
@@ -42,7 +41,7 @@ namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +49,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index 9dceeb1c4a..34864c5602 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -44,8 +44,10 @@ enum Priority {
P_VOICECOM,
P_COMMUNICATION,
P_NORMAL,
+ P_PROJECTION,
P_NONE,
};
+
bool IsValidEnum(Priority val);
const char* EnumToJsonString(Priority val);
bool EnumFromJsonString(const std::string& literal, Priority* result);
@@ -65,20 +67,24 @@ enum Parameter {
P_SPEED,
P_ENGINETORQUE,
P_EXTERNALTEMPERATURE,
+ P_TURNSIGNAL,
P_FUELLEVEL,
P_FUELLEVEL_STATE,
P_HEADLAMPSTATUS,
P_INSTANTFUELCONSUMPTION,
+ P_FUELRANGE,
P_ODOMETER,
P_TIREPRESSURE,
P_WIPERSTATUS,
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
P_STEERINGWHEELANGLE,
+ P_ENGINEOILLIFE,
P_MYKEY,
P_AIRBAGSTATUS,
P_BODYINFORMATION,
@@ -87,7 +93,6 @@ enum Parameter {
P_EMERGENCYEVENT,
P_ECALLINFO,
P_ABS_STATE,
- P_TURN_SIGNAL,
P_FUEL_RANGE,
P_TIRE_PRESSURE_VALUE,
P_TPMS,
@@ -118,20 +123,14 @@ enum AppHMIType {
AHT_SOCIAL,
AHT_BACKGROUND_PROCESS,
AHT_TESTING,
- AHT_SYSTEM
+ AHT_SYSTEM,
+ AHT_PROJECTION,
+ AHT_REMOTE_CONTROL,
};
bool IsValidEnum(AppHMIType val);
const char* EnumToJsonString(AppHMIType val);
bool EnumFromJsonString(const std::string& literal, AppHMIType* result);
-enum Input {
- I_GUI,
- I_VUI,
-};
-bool IsValidEnum(Input val);
-const char* EnumToJsonString(Input val);
-bool EnumFromJsonString(const std::string& literal, Input* result);
-
enum RequestType {
RT_HTTP,
RT_FILE_RESUME,
@@ -152,12 +151,402 @@ enum RequestType {
RT_VEHICLE_DIAGNOSTICS,
RT_EMERGENCY,
RT_MEDIA,
- RT_FOTA
+ RT_FOTA,
+ RT_OEM_SPECIFIC,
+ RT_EMPTY // Added to allow empty Request Types handling
};
+
bool IsValidEnum(RequestType val);
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,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
+};
+bool IsValidEnum(ModuleType val);
+const char* EnumToJsonString(ModuleType val);
+bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+
+/**
+ * @brief Enumeration FunctionID.
+ *
+ * Enumeration linking function names with function IDs in AppLink protocol.
+ * Assumes enumeration starts at value 0.
+ */
+enum FunctionID {
+ /**
+ * @brief RESERVED.
+ */
+ RESERVED = 0,
+
+ /**
+ * @brief RegisterAppInterfaceID.
+ */
+ RegisterAppInterfaceID = 1,
+
+ /**
+ * @brief UnregisterAppInterfaceID.
+ */
+ UnregisterAppInterfaceID = 2,
+
+ /**
+ * @brief SetGlobalPropertiesID.
+ */
+ SetGlobalPropertiesID = 3,
+
+ /**
+ * @brief ResetGlobalPropertiesID.
+ */
+ ResetGlobalPropertiesID = 4,
+
+ /**
+ * @brief AddCommandID.
+ */
+ AddCommandID = 5,
+
+ /**
+ * @brief DeleteCommandID.
+ */
+ DeleteCommandID = 6,
+
+ /**
+ * @brief AddSubMenuID.
+ */
+ AddSubMenuID = 7,
+
+ /**
+ * @brief DeleteSubMenuID.
+ */
+ DeleteSubMenuID = 8,
+
+ /**
+ * @brief CreateInteractionChoiceSetID.
+ */
+ CreateInteractionChoiceSetID = 9,
+
+ /**
+ * @brief PerformInteractionID.
+ */
+ PerformInteractionID = 10,
+
+ /**
+ * @brief DeleteInteractionChoiceSetID.
+ */
+ DeleteInteractionChoiceSetID = 11,
+
+ /**
+ * @brief AlertID.
+ */
+ AlertID = 12,
+
+ /**
+ * @brief ShowID.
+ */
+ ShowID = 13,
+
+ /**
+ * @brief SpeakID.
+ */
+ SpeakID = 14,
+
+ /**
+ * @brief SetMediaClockTimerID.
+ */
+ SetMediaClockTimerID = 15,
+
+ /**
+ * @brief PerformAudioPassThruID.
+ */
+ PerformAudioPassThruID = 16,
+
+ /**
+ * @brief EndAudioPassThruID.
+ */
+ EndAudioPassThruID = 17,
+
+ /**
+ * @brief SubscribeButtonID.
+ */
+ SubscribeButtonID = 18,
+
+ /**
+ * @brief UnsubscribeButtonID.
+ */
+ UnsubscribeButtonID = 19,
+
+ /**
+ * @brief SubscribeVehicleDataID.
+ */
+ SubscribeVehicleDataID = 20,
+
+ /**
+ * @brief UnsubscribeVehicleDataID.
+ */
+ UnsubscribeVehicleDataID = 21,
+
+ /**
+ * @brief GetVehicleDataID.
+ */
+ GetVehicleDataID = 22,
+
+ /**
+ * @brief ReadDIDID.
+ */
+ ReadDIDID = 23,
+
+ /**
+ * @brief GetDTCsID.
+ */
+ GetDTCsID = 24,
+
+ /**
+ * @brief ScrollableMessageID.
+ */
+ ScrollableMessageID = 25,
+
+ /**
+ * @brief SliderID.
+ */
+ SliderID = 26,
+
+ /**
+ * @brief ShowConstantTBTID.
+ */
+ ShowConstantTBTID = 27,
+
+ /**
+ * @brief AlertManeuverID.
+ */
+ AlertManeuverID = 28,
+
+ /**
+ * @brief UpdateTurnListID.
+ */
+ UpdateTurnListID = 29,
+
+ /**
+ * @brief ChangeRegistrationID.
+ */
+ ChangeRegistrationID = 30,
+
+ /**
+ * @brief GenericResponseID.
+ */
+ GenericResponseID = 31,
+
+ /**
+ * @brief PutFileID.
+ */
+ PutFileID = 32,
+
+ /**
+ * @brief DeleteFileID.
+ */
+ DeleteFileID = 33,
+
+ /**
+ * @brief ListFilesID.
+ */
+ ListFilesID = 34,
+
+ /**
+ * @brief SetAppIconID.
+ */
+ SetAppIconID = 35,
+
+ /**
+ * @brief SetDisplayLayoutID.
+ */
+ SetDisplayLayoutID = 36,
+
+ /**
+ * @brief DiagnosticMessageID.
+ */
+ DiagnosticMessageID = 37,
+
+ /**
+ * @brief SystemRequestID.
+ */
+ SystemRequestID = 38,
+
+ /**
+ * @brief SendLocationID.
+ */
+ SendLocationID = 39,
+
+ /**
+ * @brief DialNumberID.
+ */
+ DialNumberID = 40,
+
+ /**
+ * @brief ButtonPressID.
+ */
+ ButtonPressID = 41,
+
+ /**
+ * @brief GetInteriorVehicleDataID.
+ */
+ GetInteriorVehicleDataID = 43,
+
+ /**
+ * @brief SetInteriorVehicleDataID.
+ */
+ SetInteriorVehicleDataID = 44,
+
+ /**
+ * @brief GetWayPointsID.
+ */
+ GetWayPointsID = 45,
+
+ /**
+ * @brief SubscribeWayPointsID.
+ */
+ SubscribeWayPointsID = 46,
+
+ /**
+ * @brief UnsubscribeWayPointsID.
+ */
+ UnsubscribeWayPointsID = 47,
+
+ /**
+ * @brief GetSystemCapabilityID.
+ */
+ GetSystemCapabilityID = 48,
+
+ /**
+ * @brief SendHapticDataID.
+ */
+ SendHapticDataID = 49,
+
+ /**
+ * @brief OnHMIStatusID.
+ */
+ OnHMIStatusID = 32768,
+
+ /**
+ * @brief OnAppInterfaceUnregisteredID.
+ */
+ OnAppInterfaceUnregisteredID = 32769,
+
+ /**
+ * @brief OnButtonEventID.
+ */
+ OnButtonEventID = 32770,
+
+ /**
+ * @brief OnButtonPressID.
+ */
+ OnButtonPressID = 32771,
+
+ /**
+ * @brief OnVehicleDataID.
+ */
+ OnVehicleDataID = 32772,
+
+ /**
+ * @brief OnCommandID.
+ */
+ OnCommandID = 32773,
+
+ /**
+ * @brief OnTBTClientStateID.
+ */
+ OnTBTClientStateID = 32774,
+
+ /**
+ * @brief OnDriverDistractionID.
+ */
+ OnDriverDistractionID = 32775,
+
+ /**
+ * @brief OnPermissionsChangeID.
+ */
+ OnPermissionsChangeID = 32776,
+
+ /**
+ * @brief OnAudioPassThruID.
+ */
+ OnAudioPassThruID = 32777,
+
+ /**
+ * @brief OnLanguageChangeID.
+ */
+ OnLanguageChangeID = 32778,
+
+ /**
+ * @brief OnKeyboardInputID.
+ */
+ OnKeyboardInputID = 32779,
+
+ /**
+ * @brief OnTouchEventID.
+ */
+ OnTouchEventID = 32780,
+
+ /**
+ * @brief OnSystemRequestID.
+ */
+ OnSystemRequestID = 32781,
+
+ /**
+ * @brief OnHashChangeID.
+ */
+ OnHashChangeID = 32782,
+
+ /**
+ * @brief OnInteriorVehicleDataID.
+ */
+ OnInteriorVehicleDataID = 32783,
+
+ /**
+ * @brief OnWayPointChangeID.
+ */
+ OnWayPointChangeID = 32784,
+
+ /**
+ * @brief OnRCStatusID.
+ */
+ OnRCStatusID = 32785,
+
+ /**
+ * @brief EncodedSyncPDataID.
+ */
+ EncodedSyncPDataID = 65536,
+
+ /**
+ * @brief SyncPDataID.
+ */
+ SyncPDataID = 65537,
+
+ /**
+ * @brief OnEncodedSyncPDataID.
+ */
+ OnEncodedSyncPDataID = 98304,
+
+ /**
+ * @brief OnSyncPDataID.
+ */
+ OnSyncPDataID = 98305
+};
+bool IsValidEnum(FunctionID val);
+const char* EnumToJsonString(FunctionID val);
+bool EnumFromJsonString(const std::string& literal, FunctionID* result);
+
extern const std::string kDefaultApp;
extern const std::string kPreDataConsentApp;
extern const std::string kDeviceApp;
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
index 8ca91c310a..68e29a97ee 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -38,6 +38,7 @@
#include "policy/policy_table/enums.h"
#include "rpc_base/rpc_message.h"
+
namespace Json {
class Value;
} // namespace Json
@@ -68,19 +69,19 @@ typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
typedef Array<Enum<Parameter>, 0, 100> Parameters;
-typedef Map<RpcParameters, 0, 50> Rpc;
+typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
-typedef Array<String<10, 65535>, 1, 3> URL;
+typedef Array<String<10, 255>, 1, 3> URL;
typedef Map<URL, 1, 255> URLList;
typedef Map<URLList, 1, 255> ServiceEndpoints;
typedef uint8_t NumberOfNotificationsType;
-typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 7>
NumberOfNotificationsPerMinute;
-typedef Array<Integer<uint16_t, 1, 1000>, 0, 10> SecondsBetweenRetries;
+typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
typedef Map<MessageString, 0, 600> Languages;
@@ -101,6 +102,15 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
+typedef Strings RequestSubTypes;
+
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+
+typedef AppHMIType AppHmiType;
+typedef std::vector<AppHMIType> AppHmiTypes;
+
struct RequestTypes : public RequestsTypeArray {
RequestTypes();
explicit RequestTypes(Json::Value* value);
@@ -163,8 +173,10 @@ struct ApplicationParams : PolicyBase {
Optional<Strings> nicknames;
Optional<AppHMITypes> AppHMIType;
Optional<RequestTypes> RequestType;
+ Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
+ mutable Optional<ModuleTypes> moduleType;
public:
ApplicationParams();
@@ -184,6 +196,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
+ bool ValidateModuleTypes() const;
};
struct ApplicationPoliciesSection : CompositeType {
@@ -229,10 +242,35 @@ struct RpcParameters : CompositeType {
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();
@@ -265,6 +303,7 @@ struct ModuleConfig : CompositeType {
Optional<String<0, 10> > preloaded_date;
Optional<String<0, 65535> > certificate;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
public:
ModuleConfig();
@@ -331,7 +370,7 @@ struct MessageLanguages : CompositeType {
private:
bool Validate() const;
- static const std::string kMandatoryLanguage_;
+ static const std::string default_language_;
};
struct ConsumerFriendlyMessages : CompositeType {
@@ -453,8 +492,11 @@ struct UsageAndErrorCounts : CompositeType {
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();
diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
index 91518f8f6e..26af165506 100644
--- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
@@ -26,20 +26,24 @@
<element name="speed" />
<element name="engineTorque" />
<element name="externalTemperature" />
+ <element name="turnSignal" />
<element name="fuelLevel" />
<element name="fuelLevel_State" />
<element name="headLampStatus" />
<element name="instantFuelConsumption" />
+ <element name="fuelRange" />
<element name="odometer" />
<element name="tirePressure" />
<element name="wiperStatus" />
<element name="vin" />
<element name="accPedalPosition" />
<element name="beltStatus" />
+ <element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
<element name="prndl" />
<element name="rpm" />
<element name="steeringWheelAngle" />
+ <element name="engineOilLife" />
<element name="myKey" />
<element name="airbagStatus" />
<element name="bodyInformation" />
@@ -94,8 +98,7 @@
<typedef name="HmiLevels" type="HmiLevel" array="true"
maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
+ <typedef name="Parameters" type="Parameter" array="true"/>
<struct name="RpcParameters">
<!-- maxsizes are equal to number of currently known elements of
@@ -128,7 +131,7 @@
minsize="1" maxsize="255" />
<typedef name="NumberOfNotificationsPerMinute" type="Integer"
- map="true" maxsize="6" minvalue="0" maxvalue="255" />
+ map="true" maxsize="7" minvalue="0" maxvalue="255" />
<typedef name="SecondsBetweenRetries" type="Integer" array="true"
maxsize="10" minvalue="1" maxvalue="1000" />
@@ -136,6 +139,7 @@
<struct name="ModuleConfig">
<param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
<param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="full_app_id_supported" type="Boolean" mandatory="false" />
<param name="exchange_after_x_ignition_cycles" type="Integer"
maxvalue="255" />
<param name="exchange_after_x_kilometers" type="Integer"
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
index a0eefda555..84d9376a93 100644
--- a/src/components/policy/policy_external/include/policy/policy_types.h
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -38,8 +38,12 @@
#include <vector>
#include <map>
#include <set>
-#include "utils/shared_ptr.h"
+#include <utility>
+#include <memory>
+
#include "utils/helpers.h"
+#include "transport_manager/common.h"
+
namespace policy {
// TODO(PV): specify errors
@@ -76,7 +80,7 @@ enum PolicyTableStatus {
// Code generator uses String class name, so this typedef was renamed to PTSring
typedef std::string PTString;
typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+typedef std::shared_ptr<BinaryMessage> BinaryMessageSptr;
typedef std::string HMILevel;
typedef std::string Parameter;
@@ -189,7 +193,7 @@ struct DeviceParams {
std::string device_name;
std::string device_mac_address;
std::string device_connection_type;
- uint32_t device_handle;
+ transport_manager::DeviceHandle device_handle;
};
/**
@@ -264,7 +268,8 @@ struct AppPermissions {
, appRevoked(false)
, appPermissionsConsentNeeded(false)
, appUnauthorized(false)
- , requestTypeChanged(false) {}
+ , requestTypeChanged(false)
+ , requestSubTypeChanged(false) {}
std::string application_id;
bool isAppPermissionsRevoked;
@@ -277,6 +282,8 @@ struct AppPermissions {
DeviceParams deviceInfo;
bool requestTypeChanged;
std::vector<std::string> requestType;
+ bool requestSubTypeChanged;
+ std::vector<std::string> requestSubType;
};
/**
@@ -384,6 +391,146 @@ struct RetrySequenceURL {
*/
typedef std::pair<uint32_t, uint32_t> AppIdURL;
+enum EntityStatus { kStatusOn, kStatusOff };
+
+enum ReturnValue { kZero, kNonZero };
+
+/**
+ * @brief The ExternalConsentStatusItem struct represents customer connectivity
+ * settings
+ * item
+ */
+struct ExternalConsentStatusItem {
+ ExternalConsentStatusItem(const uint32_t type,
+ const uint32_t id,
+ const EntityStatus status)
+ : entity_type_(type), entity_id_(id), status_(status) {}
+
+ ExternalConsentStatusItem()
+ : entity_type_(0), entity_id_(0), status_(kStatusOff) {}
+
+ ExternalConsentStatusItem operator=(const ExternalConsentStatusItem& rhs) {
+ this->entity_id_ = rhs.entity_id_;
+ this->entity_type_ = rhs.entity_type_;
+ this->status_ = rhs.status_;
+ return *this; // calls copy constructor
+ }
+
+ bool operator==(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ == rhs.entity_type_) && (entity_id_ == rhs.entity_id_);
+ }
+
+ bool operator<(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ < rhs.entity_type_) || (entity_id_ < rhs.entity_id_);
+ }
+
+ uint32_t entity_type_;
+ uint32_t entity_id_;
+ EntityStatus status_;
+};
+
+struct ExternalConsentStatusItemSorter {
+ bool operator()(const ExternalConsentStatusItem& lhs,
+ const ExternalConsentStatusItem& rhs) const {
+ return (lhs.entity_type_ < rhs.entity_type_) ||
+ (lhs.entity_id_ < rhs.entity_id_);
+ }
+};
+
+/**
+ * @brief The ApplicationPolicyActions struct contains actions which should be
+ * done for some application
+ */
+struct ApplicationPolicyActions {
+ ApplicationPolicyActions()
+ : is_notify_system(false)
+ , is_send_permissions_to_app(false)
+ , is_consent_needed(false) {}
+
+ bool is_notify_system;
+ bool is_send_permissions_to_app;
+ bool is_consent_needed;
+};
+
+/**
+ * @brief ApplicationsPoliciesActions map of actions to be done for every
+ * application
+ */
+typedef std::map<std::string, ApplicationPolicyActions>
+ ApplicationsPoliciesActions;
+
+/**
+ * @brief Customer connectivity settings status
+ */
+typedef std::set<ExternalConsentStatusItem, ExternalConsentStatusItemSorter>
+ ExternalConsentStatus;
+
+/**
+ * @brief GroupsByExternalConsentStatus represents list of group names, which
+ * has mapped ExternalConsent item (entity type + entity id) in their
+ * disallowed_by_external_consent_ containers. Boolean value represents
+ * whether ExternalConsent item has been found in
+ * disallowed_by_external_consent_ON or in disallowed_by_external_consent_OFF
+ * container
+ */
+typedef std::map<ExternalConsentStatusItem,
+ std::vector<std::pair<std::string, bool> > >
+ GroupsByExternalConsentStatus;
+
+/**
+ * @brief GroupsNames represents groups names from policy table -> functional
+ * groupings groups container
+ */
+typedef std::set<std::string> GroupsNames;
+
+typedef std::string ApplicationId;
+typedef std::string DeviceId;
+
+/**
+ * @brief Link of device to application
+ */
+typedef std::pair<policy::DeviceId, policy::ApplicationId> Link;
+
+/**
+ * @brief Collection of links
+ */
+typedef std::set<Link> ApplicationsLinks;
+
+/**
+ * @brief Represents possible result codes for policy table update check
+ */
+enum PermissionsCheckResult {
+ RESULT_NO_CHANGES,
+ RESULT_APP_REVOKED,
+ RESULT_NICKNAME_MISMATCH,
+ RESULT_PERMISSIONS_REVOKED,
+ RESULT_CONSENT_NEEDED,
+ RESULT_CONSENT_NOT_REQIURED,
+ RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
+ RESULT_REQUEST_TYPE_CHANGED,
+ RESULT_REQUEST_SUBTYPE_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
index ca3d45e946..0aa284b707 100644
--- a/src/components/policy/policy_external/include/policy/pt_ext_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_ext_representation.h
@@ -327,6 +327,20 @@ class PTExtRepresentation : public virtual PTRepresentation {
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
diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h
index 66a9218771..f25fcc6cab 100644
--- a/src/components/policy/policy_external/include/policy/pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_representation.h
@@ -213,7 +213,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h
index 96406feaf1..b8f85ec7b1 100644
--- 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
@@ -51,6 +51,7 @@ 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;
@@ -60,6 +61,7 @@ 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;
@@ -90,6 +92,11 @@ 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
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
index 99fe099a59..bd2097cfe3 100644
--- 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
@@ -131,8 +131,14 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
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;
@@ -200,6 +206,11 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
*/
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
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
index a0ff71ba13..dd9e0204e7 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
@@ -58,12 +58,14 @@ 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 kSelectRequestSubTypes;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -77,6 +79,7 @@ extern const std::string kInsertAppGroup;
extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
+extern const std::string kInsertRequestSubType;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -93,9 +96,11 @@ 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 kDeleteRequestSubType;
extern const std::string kDeleteDevice;
extern const std::string kIncrementIgnitionCycles;
extern const std::string kResetIgnitionCycles;
@@ -113,6 +118,19 @@ extern const std::string kInsertApplicationFull;
extern const std::string kDeletePreconsentedGroupsByApplicationId;
extern const std::string kSelectApplicationFull;
extern const std::string kUpdatePreloaded;
+extern const std::string kUpdateRemoteControlDenied;
+extern const std::string kSelectRemoteControlDenied;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectModuleTypes;
+extern const std::string kInsertModuleType;
+extern const std::string kInsertAccessModule;
+extern const std::string kSelectAccessModules;
+extern const std::string kDeleteAccessModules;
+extern const std::string kInsertRemoteRpc;
+extern const std::string kSelectRemoteRpcs;
+extern const std::string kDeleteRemoteRpc;
+extern const std::string kDeleteModuleTypes;
+extern const std::string kDeleteAllDevices;
extern const std::string kSelectDBVersion;
extern const std::string kUpdateDBVersion;
} // namespace sql_pt
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
index a2999b4bf5..13816eb6c5 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -85,7 +85,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
@@ -98,6 +98,21 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
+ enum TypeAccess { kAllowed, kManual };
+ bool GatherModuleType(const std::string& app_id,
+ policy_table::ModuleTypes* module_types) const;
+ bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const;
+ bool GatherAccessModule(TypeAccess access,
+ policy_table::AccessModules* modules) const;
+ bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const;
+ bool SaveModuleType(const std::string& app_id,
+ const policy_table::ModuleTypes& types);
+ bool SaveRemoteControlDenied(const std::string& app_id, bool deny);
+
+ bool SaveAccessModule(TypeAccess access,
+ const policy_table::AccessModules& modules);
+ bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
+
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
virtual bool GatherUsageAndErrorCounts(
@@ -116,6 +131,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
policy_table::AppHMITypes* app_types) const;
bool GatherRequestType(const std::string& app_id,
policy_table::RequestTypes* request_types) const;
+ bool GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -151,6 +169,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::AppHMITypes& types);
bool SaveRequestType(const std::string& app_id,
const policy_table::RequestTypes& types);
+ bool SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes);
public:
virtual std::string GetLockScreenIconUrl() const;
@@ -182,7 +203,10 @@ class SQLPTRepresentation : public virtual PTRepresentation {
#ifdef BUILD_TESTS
uint32_t open_counter_;
#endif // BUILD_TESTS
-
+ enum ExternalConsentEntitiesType {
+ kExternalConsentEntitiesTypeOn,
+ kExternalConsentEntitiesTypeOff
+ };
/**
* @brief Calculates DB version from current schema
* @return version
@@ -198,6 +222,10 @@ class SQLPTRepresentation : public virtual PTRepresentation {
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
diff --git a/src/components/policy/policy_external/include/policy/status.h b/src/components/policy/policy_external/include/policy/status.h
index 6318c5fade..18789ecf99 100644
--- a/src/components/policy/policy_external/include/policy/status.h
+++ b/src/components/policy/policy_external/include/policy/status.h
@@ -53,7 +53,8 @@ enum UpdateEvent {
kOnResetPolicyTableNoUpdate,
kScheduleUpdate,
kScheduleManualUpdate,
- kOnResetRetrySequence
+ kOnResetRetrySequence,
+ kNoEvent
};
const std::string kUpToDate = "UP_TO_DATE";
@@ -132,7 +133,7 @@ class UpToDateStatus : public Status {
* @param manager Status manager pointer
* @param event Event which needs to be processed
*/
- void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) FINAL;
+ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
};
/**
@@ -151,13 +152,13 @@ class UpdateNeededStatus : public Status {
* @param manager Status manager pointer
* @param event Event which needs to be processed
*/
- void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) FINAL;
+ 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 FINAL;
+ bool IsUpdateRequired() const OVERRIDE;
};
/**
@@ -176,19 +177,19 @@ class UpdatingStatus : public Status {
* @param manager Status manager pointer
* @param event Event which needs to be processed
*/
- void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) FINAL;
+ 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 FINAL;
+ 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 FINAL;
+ bool IsUpdatePending() const OVERRIDE;
};
}
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
index b663610a5b..3a9e13b83f 100644
--- a/src/components/policy/policy_external/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -114,15 +114,15 @@ class UpdateStatusManager {
void OnResetRetrySequence();
/**
- * @brief Update status handler on new application registering
+ * @brief Update status handler on existed application registering
+ * @param is_update_required Update necessity flag
*/
- void OnNewApplicationAdded(const DeviceConsent consent);
+ void OnExistedApplicationAdded(const bool is_update_required);
/**
- * @brief Update status handler for policy initialization
- * @param is_update_required Update necessity flag
+ * @brief Update status handler on new application registering
*/
- void OnPolicyInit(bool is_update_required);
+ void OnNewApplicationAdded(const DeviceConsent consent);
/**
* @brief In case application from non-consented device has been registered
@@ -199,17 +199,17 @@ class UpdateStatusManager {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
@@ -227,7 +227,7 @@ class UpdateStatusManager {
volatile uint32_t timeout_;
volatile bool stop_flag_;
- sync_primitives::Lock state_lock_;
+ sync_primitives::RecursiveLock state_lock_;
sync_primitives::ConditionalVariable termination_condition_;
UpdateStatusManager* update_status_manager_;
};
diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
index adaef0eb28..c145bb432b 100644
--- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
~AppStopwatchImpl();
@@ -97,7 +97,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc
new file mode 100644
index 0000000000..26c8c5e38e
--- /dev/null
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "policy/access_remote_impl.h"
+
+#include <algorithm>
+#include <iterator>
+#include "policy/cache_manager.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
+
+using policy_table::DeviceData;
+using policy_table::FunctionalGroupings;
+using rpc::policy_table_interface_base::EnumFromJsonString;
+
+namespace policy {
+
+struct ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(item);
+ if (!IsValidEnum(type)) {
+ LOG4CXX_WARN(logger_, "HMI type isn't known " << item);
+ type = policy_table::AHT_DEFAULT;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "HMI type: " << item << " - " << EnumToJsonString(type));
+ return policy_table::AppHMITypes::value_type(type);
+ }
+};
+
+struct Contained {
+ private:
+ const policy_table::Strings& params_;
+
+ public:
+ explicit Contained(const policy_table::Strings& params) : params_(params) {}
+ bool operator()(const RemoteControlParams::value_type& item) const {
+ return std::find_if(params_.begin(), params_.end(), CompareString(item)) !=
+ params_.end();
+ }
+ struct CompareString {
+ private:
+ const RemoteControlParams::value_type& value_;
+
+ public:
+ explicit CompareString(const RemoteControlParams::value_type& value)
+ : value_(value) {}
+ bool operator()(const policy_table::Strings::value_type& item) const {
+ return value_ == static_cast<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
+ : cache_(cache) {}
+
+bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!cache_->IsApplicationRepresented(app_id)) {
+ return false;
+ }
+
+ const policy_table::ApplicationParams& app =
+ cache_->pt_->policy_table.app_policies_section.apps[app_id];
+ if (!app.moduleType.is_initialized()) {
+ return false;
+ }
+
+ const policy_table::ModuleTypes& modules = *app.moduleType;
+ if (modules.empty()) {
+ return true;
+ }
+
+ return std::find(modules.begin(), modules.end(), module) != modules.end();
+}
+
+bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::AccessModules::const_iterator i = modules.find(module_name);
+ if (i == modules.end()) {
+ LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found");
+ return false;
+ }
+
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ if (rpcs.empty()) {
+ return true;
+ }
+ policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name);
+ if (j != rpcs.end()) {
+ const policy_table::Strings& parameters = j->second;
+ return CompareParameters(parameters, input);
+ }
+ LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found");
+ return false;
+}
+
+bool AccessRemoteImpl::CompareParameters(
+ const policy_table::Strings& parameters, RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (parameters.empty()) {
+ return true;
+ }
+
+ if (input->empty()) {
+ LOG4CXX_DEBUG(logger_, "Input is empty");
+ return false;
+ }
+
+ input->erase(
+ std::remove_if(input->begin(), input->end(), Contained(parameters)),
+ input->end());
+ return input->empty();
+}
+
+void AccessRemoteImpl::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HMIList::mapped_type types;
+ std::transform(hmi_types.begin(),
+ hmi_types.end(),
+ std::back_inserter(types),
+ ToHMIType());
+ hmi_types_[who] = types;
+}
+
+const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(who.app_id)) {
+ return hmi_types_[who];
+ } else {
+ return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id]
+ .AppHMIType;
+ }
+}
+
+const policy_table::Strings& AccessRemoteImpl::GetGroups(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& who) {
+ const policy_table::AppHMITypes& hmi_types = HmiTypes(who);
+ return std::find(hmi_types.begin(),
+ hmi_types.end(),
+ policy_table::AHT_REMOTE_CONTROL) != hmi_types.end();
+}
+
+bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]);
+ GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]);
+ GetGroupsIds(
+ device_id, kPreDataConsentId, group_types[kTypePreDataConsented]);
+
+ cache_->GetPreConsentedGroups(app_id, group_types[kTypePreconsented]);
+
+ cache_->GetConsentedGroups(device_id,
+ app_id,
+ group_types[kTypeAllowed],
+ group_types[kTypeDisallowed]);
+
+ cache_->GetUnconsentedGroups(
+ device_id, app_id, group_types[kTypeUnconsented]);
+
+ cache_->GetAllAppGroups(kDeviceId, group_types[kTypeDevice]);
+ return true;
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const FunctionalGroupIDs& types) {
+ std::copy(types.begin(),
+ types.end(),
+ std::ostream_iterator<FunctionalGroupIDs::value_type>(output, " "));
+ return output;
+}
+
+extern std::ostream& operator<<(std::ostream& output,
+ const policy_table::Strings& groups);
+
+void AccessRemoteImpl::GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& groups_ids) {
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings& groups = GetGroups(who);
+ LOG4CXX_DEBUG(logger_, "Groups Names: " << groups);
+ groups_ids.resize(groups.size());
+ std::transform(groups.begin(),
+ groups.end(),
+ groups_ids.begin(),
+ &CacheManager::GenerateHash);
+ LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids);
+}
+
+bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id,
+ std::vector<std::string>* modules) {
+ DCHECK(modules);
+ policy_table::ApplicationPolicies& apps =
+ cache_->pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator i = apps.find(application_id);
+ if (i == apps.end()) {
+ return false;
+ }
+ rpc::Optional<policy_table::ModuleTypes> moduleTypes = i->second.moduleType;
+ if (!moduleTypes.is_initialized()) {
+ return false;
+ }
+ std::transform(moduleTypes->begin(),
+ moduleTypes->end(),
+ std::back_inserter(*modules),
+ ToModuleType());
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index 7eb74c2a53..c2c2e91257 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -36,8 +36,12 @@
#include <functional>
#include <ctime>
#include <cmath>
+#include <utility>
+#include <string>
+#include <vector>
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "json/reader.h"
#include "json/features.h"
#include "json/writer.h"
@@ -53,6 +57,173 @@
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));
+ }
+};
+
+struct DefaultPolicyUpdater {
+ DefaultPolicyUpdater(const policy_table::ApplicationParams& default_params)
+ : default_params_(default_params) {}
+
+ void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ if (policy::kDefaultId == pt_value.second.get_string()) {
+ pt_value.second = default_params_;
+ pt_value.second.set_to_string(policy::kDefaultId);
+ }
+ }
+
+ private:
+ const policy_table::ApplicationParams& default_params_;
+};
+
+} // namespace
+
namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
@@ -117,8 +288,46 @@ CacheManager::~CacheManager() {
threads::DeleteThread(backup_thread_);
}
+ConsentPriorityType CacheManager::GetConsentsPriority(
+ const std::string& device_id, const std::string& application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ConsentPriorityType prio_type = ConsentPriorityType::kExternalConsentPrio;
+ CACHE_MANAGER_CHECK(prio_type);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::DeviceData::const_iterator dev_params_iter =
+ pt_->policy_table.device_data->find(device_id);
+
+ if (pt_->policy_table.device_data->end() == dev_params_iter) {
+ LOG4CXX_DEBUG(logger_, "Device id " << device_id << " not found.");
+ return prio_type;
+ }
+
+ const policy_table::DeviceParams& dev_par = (*dev_params_iter).second;
+
+ policy_table::UserConsentRecords::const_iterator app_consent_record =
+ dev_par.user_consent_records->find(application_id);
+
+ if (dev_par.user_consent_records->end() == app_consent_record) {
+ LOG4CXX_DEBUG(logger_,
+ "Application id " << application_id << " not found.");
+ return prio_type;
+ }
+
+ const policy_table::ConsentRecords& record = app_consent_record->second;
+
+ return record.consent_last_updated > record.ext_consent_last_updated
+ ? ConsentPriorityType::kUserConsentPrio
+ : ConsentPriorityType::kExternalConsentPrio;
+}
+
+const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.app_policies_section.apps[app_id].groups;
+}
+
bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
bool result = false;
if (kDeviceId == app_id) {
result = pt_->policy_table.app_policies_section.device.keep_context;
@@ -130,6 +339,7 @@ bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
uint32_t result = 0;
if (!IsApplicationRepresented(app_id)) {
return result;
@@ -144,8 +354,39 @@ uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
return result;
}
+const policy_table::AppHMITypes* CacheManager::GetHMITypes(
+ const std::string& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& apps =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
+ if (i != apps.end()) {
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
+ }
+ return NULL;
+}
+
+int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
+ uint32_t hash = 5381U;
+ std::string::const_iterator it = str_to_hash.begin();
+ std::string::const_iterator it_end = str_to_hash.end();
+
+ for (; it != it_end; ++it) {
+ hash = ((hash << 5) + hash) + (*it);
+ }
+
+ // Reset sign bit in case it has been set.
+ // This is needed to avoid overflow for signed int.
+ const int32_t result = hash & 0x7FFFFFFF;
+ return result;
+}
+
bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
bool result = false;
if (kDeviceId == app_id) {
result = pt_->policy_table.app_policies_section.device.steal_focus;
@@ -158,6 +399,7 @@ bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
bool CacheManager::GetDefaultHMI(const std::string& app_id,
std::string& default_hmi) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
bool result = false;
default_hmi.clear();
if (kDeviceId == app_id) {
@@ -183,6 +425,7 @@ bool CacheManager::ResetUserConsent() {
for (; iter != iter_end; ++iter) {
iter->second.user_consent_records->clear();
}
+ Backup();
return true;
}
@@ -192,6 +435,7 @@ bool CacheManager::GetUserPermissionsForDevice(
StringArray& disallowed_groups) const {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::DeviceData& device_data = *pt_->policy_table.device_data;
if (device_data.end() == device_data.find(device_id)) {
LOG4CXX_ERROR(logger_,
@@ -224,6 +468,8 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
FunctionalGroupIDs& all_group_ids) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
if (kDeviceId == app_id) {
policy_table::DevicePolicy& device =
pt_->policy_table.app_policies_section.device;
@@ -261,6 +507,7 @@ void CacheManager::GetPreConsentedGroups(
const std::string& app_id, FunctionalGroupIDs& preconsented_groups) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == app_id) {
policy_table::DevicePolicy& device =
pt_->policy_table.app_policies_section.device;
@@ -300,6 +547,7 @@ void CacheManager::GetConsentedGroups(const std::string& device_id,
FunctionalGroupIDs& disallowed_groups) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::DeviceData::iterator dev_params_iter =
pt_->policy_table.device_data->find(device_id);
@@ -339,10 +587,11 @@ void CacheManager::GetUnconsentedGroups(
if (!IsApplicationRepresented(policy_app_id)) {
LOG4CXX_WARN(logger_,
"The application with app_id: " << policy_app_id
- << " is not reresented");
+ << " is not represented");
return;
}
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::Strings::iterator iter_groups;
policy_table::Strings::iterator iter_groups_end;
if (kDeviceId == policy_app_id) {
@@ -388,6 +637,7 @@ void CacheManager::GetUnconsentedGroups(
void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name) {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::DeviceData::iterator device_iter =
pt_->policy_table.device_data->begin();
policy_table::DeviceData::iterator device_iter_end =
@@ -402,18 +652,16 @@ void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
}
}
-using rpc::policy_table_interface_base::RequestTypes;
-using rpc::policy_table_interface_base::RequestType;
-
void CacheManager::ProcessUpdate(
const policy_table::ApplicationPolicies::const_iterator
initial_policy_iter) {
using namespace policy;
+ using rpc::policy_table_interface_base::RequestTypes;
const RequestTypes& new_request_types =
*(initial_policy_iter->second.RequestType);
const std::string& app_id = initial_policy_iter->first;
- RequestTypes merged_pt_request_types;
+ bool update_request_types = true;
if (app_id == kDefaultId || app_id == kPreDataConsentId) {
if (new_request_types.is_omitted()) {
@@ -421,29 +669,40 @@ void CacheManager::ProcessUpdate(
"Application " << app_id
<< " has omitted RequestTypes."
" Previous values will be kept.");
- return;
- }
- if (new_request_types.empty()) {
+ update_request_types = false;
+ } else if (new_request_types.empty()) {
if (new_request_types.is_cleaned_up()) {
LOG4CXX_INFO(logger_,
"Application " << app_id
<< " has cleaned up all values."
" Previous values will be kept.");
- return;
+ update_request_types = false;
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Application " << app_id
+ << " has empty RequestTypes."
+ " Any parameter will be allowed.");
}
- 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;
}
+
+ sync_primitives::AutoLock lock(cache_lock_);
+ const RequestTypes merged_pt_request_types =
+ update_request_types
+ ? new_request_types
+ : *(pt_->policy_table.app_policies_section.apps[app_id].RequestType);
+
pt_->policy_table.app_policies_section.apps[app_id] =
initial_policy_iter->second;
*(pt_->policy_table.app_policies_section.apps[app_id].RequestType) =
merged_pt_request_types;
+
+ if (app_id == kDefaultId) {
+ std::for_each(pt_->policy_table.app_policies_section.apps.begin(),
+ pt_->policy_table.app_policies_section.apps.end(),
+ DefaultPolicyUpdater(
+ pt_->policy_table.app_policies_section.apps[app_id]));
+ }
}
bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
@@ -465,15 +724,6 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
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);
}
@@ -502,6 +752,7 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
std::map<std::string, StringArray>& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter_begin =
pt_->policy_table.app_policies_section.apps.begin();
policy_table::ApplicationPolicies::const_iterator policy_iter_end =
@@ -525,6 +776,7 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
bool CacheManager::AppHasHMIType(const std::string& application_id,
policy_table::AppHMIType hmi_type) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::ApplicationPolicies& policies =
pt_->policy_table.app_policies_section.apps;
@@ -584,6 +836,7 @@ bool CacheManager::GetDeviceGroupsFromPolicies(
policy_table::Strings& preconsented_groups) const {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
groups = pt_->policy_table.app_policies_section.device.groups;
preconsented_groups =
*(pt_->policy_table.app_policies_section.device).preconsented_groups;
@@ -843,6 +1096,7 @@ bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
void CacheManager::GetGroupNameByHashID(const int32_t group_id,
std::string& group_name) {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::FunctionalGroupings::const_iterator fg_iter =
pt_->policy_table.functional_groupings.begin();
policy_table::FunctionalGroupings::const_iterator fg_iter_end =
@@ -857,7 +1111,7 @@ void CacheManager::GetGroupNameByHashID(const int32_t group_id,
}
bool CacheManager::SetUserPermissionsForApp(
- const PermissionConsent& permissions) {
+ const PermissionConsent& permissions, bool* out_app_permissions_changed) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock auto_lock(cache_lock_);
CACHE_MANAGER_CHECK(false);
@@ -865,6 +1119,7 @@ bool CacheManager::SetUserPermissionsForApp(
permissions.group_permissions.begin();
std::vector<FunctionalGroupPermission>::const_iterator iter_end =
permissions.group_permissions.end();
+ *out_app_permissions_changed = false;
std::string group_name;
for (; iter != iter_end; ++iter) {
@@ -876,8 +1131,21 @@ bool CacheManager::SetUserPermissionsForApp(
GetGroupNameByHashID((*iter).group_id, group_name);
- (*ucr.consent_groups)[group_name] =
- ((*iter).state == policy::kGroupAllowed);
+ 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 date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
+ ucr.consent_last_updated = current_time_msec;
+ LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
+ }
+
+ (*ucr.consent_groups)[group_name] = is_allowed;
*ucr.input = policy_table::Input::I_GUI;
*ucr.time_stamp = currentDateTime();
}
@@ -897,6 +1165,7 @@ void CacheManager::SaveUpdateRequired(bool status) {
bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (!IsApplicationRepresented(app_id)) {
return false;
}
@@ -911,6 +1180,7 @@ void CacheManager::CheckPermissions(const PTString& app_id,
CheckPermissionResult& result) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (!IsApplicationRepresented(app_id)) {
LOG4CXX_ERROR(
@@ -964,11 +1234,13 @@ void CacheManager::CheckPermissions(const PTString& app_id,
bool CacheManager::IsPTPreloaded() {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return *pt_->policy_table.module_config.preloaded_pt;
}
int CacheManager::IgnitionCyclesBeforeExchange() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const uint8_t limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_ignition_cycles),
@@ -990,6 +1262,7 @@ int CacheManager::IgnitionCyclesBeforeExchange() {
int CacheManager::KilometersBeforeExchange(int current) {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int limit =
std::max(static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_kilometers),
@@ -1010,6 +1283,7 @@ int CacheManager::KilometersBeforeExchange(int current) {
bool CacheManager::SetCountersPassedForSuccessfulUpdate(
policy::Counters counter, int value) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
switch (counter) {
case KILOMETERS:
*pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
@@ -1035,6 +1309,7 @@ bool CacheManager::SetCountersPassedForSuccessfulUpdate(
int CacheManager::DaysBeforeExchange(uint16_t current) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const rpc::Optional<rpc::Integer<uint16_t, 0, 65535> >& days_after_epoch =
(pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
@@ -1058,6 +1333,7 @@ int CacheManager::DaysBeforeExchange(uint16_t current) {
void CacheManager::IncrementIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int ign_val = static_cast<int>(
*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
@@ -1068,18 +1344,21 @@ void CacheManager::IncrementIgnitionCycles() {
void CacheManager::ResetIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
Backup();
}
int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
pt_->policy_table.module_config.seconds_between_retries.begin();
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
@@ -1096,6 +1375,7 @@ bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
CACHE_MANAGER_CHECK(VehicleInfo());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
VehicleInfo vehicle_info;
vehicle_info.vehicle_make = *module_config.vehicle_make;
@@ -1119,6 +1399,7 @@ std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
std::vector<std::string>::const_iterator it = msg_codes.begin();
std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
for (; it != it_end; ++it) {
policy_table::MessageLanguages msg_languages =
(*pt_->policy_table.consumer_friendly_messages->messages)[*it];
@@ -1182,6 +1463,7 @@ void CacheManager::GetUpdateUrls(const std::string& service_type,
LOG4CXX_DEBUG(logger_, "Search service value is: " << service_type);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ServiceEndpoints::const_iterator iter =
pt_->policy_table.module_config.endpoints.find(service_type);
@@ -1214,6 +1496,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
CACHE_MANAGER_CHECK(0);
typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const NNPM& nnpm =
pt_->policy_table.module_config.notifications_per_minute_by_priority;
@@ -1227,6 +1510,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
bool CacheManager::GetPriority(const std::string& policy_app_id,
std::string& priority) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
priority = EnumToJsonString(
pt_->policy_table.app_policies_section.device.priority);
@@ -1255,6 +1539,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ settings_->use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -1363,12 +1650,12 @@ void CacheManager::CheckSnapshotInitialization() {
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();
-
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
+ // Comma expression is used to hold the lock only during the constructor
+ // call
+ policy_table::Table copy_pt(
+ (sync_primitives::AutoLock(cache_lock_), *pt_));
backup_->Save(copy_pt);
backup_->SaveUpdateRequired(update_required);
@@ -1406,7 +1693,7 @@ void CacheManager::PersistData() {
}
// In case of extended policy the meta info should be backuped as well.
- if (ex_backup_.valid()) {
+ if (ex_backup_.use_count() != 0) {
ex_backup_->SetMetaInfo(
*(*copy_pt.policy_table.module_meta).ccpu_version,
*(*copy_pt.policy_table.module_meta).wers_country_code,
@@ -1486,10 +1773,10 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- sync_primitives::AutoLock lock(cache_lock_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
snapshot_->policy_table = pt_->policy_table;
snapshot_->SetPolicyTableType(policy_table::PT_SNAPSHOT);
@@ -1503,6 +1790,7 @@ bool CacheManager::GetInitialAppData(const std::string& app_id,
StringArray& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
@@ -1525,6 +1813,7 @@ bool CacheManager::GetFunctionalGroupings(
policy_table::FunctionalGroupings& groups) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::FunctionalGroupings& f_groupings =
pt_->policy_table.functional_groupings;
@@ -1546,6 +1835,7 @@ int CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
return 0;
}
+ sync_primitives::AutoLock lock(cache_lock_);
policy_table::FunctionalGroupings::const_iterator groups_iter_end =
pt_->policy_table.functional_groupings.end();
@@ -1636,6 +1926,8 @@ bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
*pt_->policy_table.module_meta->ccpu_version = ccpu_version;
*pt_->policy_table.module_meta->wers_country_code = wers_country_code;
*pt_->policy_table.module_meta->language = language;
@@ -1651,6 +1943,7 @@ bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
bool CacheManager::IsMetaInfoPresent() const {
CACHE_MANAGER_CHECK(false);
bool result = true;
+ sync_primitives::AutoLock lock(cache_lock_);
result = NULL != pt_->policy_table.module_meta->ccpu_version &&
NULL != pt_->policy_table.module_meta->wers_country_code &&
NULL != pt_->policy_table.module_meta->language;
@@ -1659,6 +1952,7 @@ bool CacheManager::IsMetaInfoPresent() const {
bool CacheManager::SetSystemLanguage(const std::string& language) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
*pt_->policy_table.module_meta->language = language;
Backup();
return true;
@@ -1667,6 +1961,7 @@ bool CacheManager::SetSystemLanguage(const std::string& language) {
bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
pt_->policy_table.functional_groupings.begin();
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
@@ -1844,20 +2139,19 @@ long CacheManager::ConvertSecondsToMinute(int seconds) {
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];
+ auto& apps = pt_->policy_table.app_policies_section.apps;
- SetIsDefault(app_id);
- }
+ DCHECK_OR_RETURN(IsApplicationRepresented(kDefaultId), false);
+
+ apps[app_id] = apps[kDefaultId];
+ apps[app_id].set_to_string(kDefaultId);
Backup();
return true;
}
bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result =
IsApplicationRepresented(app_id) &&
policy::kDefaultId ==
@@ -1868,7 +2162,7 @@ bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
bool CacheManager::SetIsDefault(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
-
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (IsApplicationRepresented(app_id)) {
pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
kDefaultId);
@@ -1911,6 +2205,7 @@ bool CacheManager::SetPredataPolicy(const std::string& app_id) {
}
bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (!IsApplicationRepresented(app_id)) {
return false;
}
@@ -1920,6 +2215,7 @@ bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
bool CacheManager::SetUnpairedDevice(const std::string& device_id,
bool unpaired) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result = pt_->policy_table.device_data->end() !=
pt_->policy_table.device_data->find(device_id);
if (!result) {
@@ -1943,15 +2239,17 @@ bool CacheManager::SetUnpairedDevice(const std::string& device_id,
bool CacheManager::SetVINValue(const std::string& value) {
CACHE_MANAGER_CHECK(false);
- cache_lock_.Acquire();
- *pt_->policy_table.module_meta->vin = value;
- cache_lock_.Release();
+ {
+ sync_primitives::AutoLock lock(cache_lock_);
+ *pt_->policy_table.module_meta->vin = value;
+ }
Backup();
return true;
}
bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
return pt_->policy_table.app_policies_section.apps.end() != iter;
@@ -1962,8 +2260,7 @@ bool CacheManager::Init(const std::string& file_name,
LOG4CXX_AUTO_TRACE(logger_);
settings_ = settings;
InitResult init_result = backup_->Init(settings);
- ex_backup_ = utils::SharedPtr<PTRepresentation>::dynamic_pointer_cast<
- PTExtRepresentation>(backup_);
+ ex_backup_ = std::dynamic_pointer_cast<PTExtRepresentation>(backup_);
bool result = true;
switch (init_result) {
@@ -1978,13 +2275,15 @@ bool CacheManager::Init(const std::string& file_name,
backup_->UpdateDBVersion();
Backup();
}
- MergePreloadPT(file_name);
+ 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();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
@@ -2021,6 +2320,27 @@ void CacheManager::FillDeviceSpecificData() {
}
}
+void CacheManager::MakeLowerCaseAppNames(policy_table::Table& pt) const {
+ policy_table::ApplicationPolicies& apps =
+ pt.policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::iterator iter = apps.begin();
+ iter != apps.end();) {
+ std::string key = iter->first;
+ if (key == kDefaultId || key == kPreDataConsentId || key == kDeviceId) {
+ ++iter;
+ continue;
+ }
+
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ if (key.compare(iter->first) != 0) {
+ std::swap(apps[key], iter->second);
+ iter = apps.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
bool CacheManager::LoadFromBackup() {
sync_primitives::AutoLock lock(cache_lock_);
pt_ = backup_->GenerateSnapshot();
@@ -2054,6 +2374,7 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
LOG4CXX_DEBUG(logger_,
"Start verification of policy table loaded from file.");
+ sync_primitives::AutoLock locker(cache_lock_);
table = policy_table::Table(&value);
#ifdef ENABLE_LOG
@@ -2063,6 +2384,8 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
"Policy table content loaded:" << s_writer.write(table.ToJsonValue()));
#endif // ENABLE_LOG
+ MakeLowerCaseAppNames(table);
+
if (!table.is_valid()) {
rpc::ValidationReport report("policy_table");
table.ReportErrors(&report);
@@ -2090,11 +2413,38 @@ bool CacheManager::ResetPT(const std::string& file_name) {
return result;
}
+policy::RequestType::State CacheManager::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request types for app_id " << policy_app_id);
+ return policy::RequestType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestTypes& request_types =
+ *app_policies_iter->second.RequestType;
+ if (!request_types.is_initialized()) {
+ LOG4CXX_TRACE(logger_,
+ "Request types for " << policy_app_id << " are OMITTED");
+ return RequestType::State::OMITTED;
+ }
+ if (request_types.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Request types for " << policy_app_id << " are EMPTY");
+ return policy::RequestType::State::EMPTY;
+ }
+ return policy::RequestType::State::AVAILABLE;
+}
+
void CacheManager::GetAppRequestTypes(
const std::string& policy_app_id,
std::vector<std::string>& request_types) const {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
LOG4CXX_DEBUG(logger_,
"Request types not applicable for app_id " << kDeviceId);
@@ -2108,18 +2458,67 @@ void CacheManager::GetAppRequestTypes(
return;
}
if (policy_iter->second.RequestType.is_initialized()) {
- policy_table::RequestTypes::iterator it_request_type =
- policy_iter->second.RequestType->begin();
- for (; it_request_type != policy_iter->second.RequestType->end();
- ++it_request_type) {
- request_types.push_back(EnumToJsonString(*it_request_type));
+ for (const auto& request_type : *policy_iter->second.RequestType) {
+ request_types.push_back(EnumToJsonString(request_type));
}
}
return;
}
+RequestSubType::State CacheManager::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return RequestSubType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestSubTypes& request_subtypes =
+ *app_policies_iter->second.RequestSubType;
+ if (!request_subtypes.is_initialized()) {
+ LOG4CXX_TRACE(logger_,
+ "Request subtypes for " << policy_app_id << " are OMITTED");
+ return RequestSubType::State::OMITTED;
+ }
+ if (request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Request subtypes for " << policy_app_id << " are EMPTY");
+ return RequestSubType::State::EMPTY;
+ }
+ return RequestSubType::State::AVAILABLE;
+}
+
+void CacheManager::GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes not applicable for app_id " << kDeviceId);
+ return;
+ }
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return;
+ }
+
+ for (const auto& request_subtype : *policy_iter->second.RequestSubType) {
+ request_subtypes.push_back(request_subtype);
+ }
+ return;
+}
+
const MetaInfo CacheManager::GetMetaInfo() const {
LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
MetaInfo meta_info;
meta_info.ccpu_version = *pt_->policy_table.module_meta->ccpu_version;
meta_info.wers_country_code =
@@ -2130,6 +2529,7 @@ const MetaInfo CacheManager::GetMetaInfo() const {
std::string CacheManager::GetCertificate() const {
CACHE_MANAGER_CHECK(std::string(""));
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (pt_->policy_table.module_config.certificate.is_initialized()) {
return *pt_->policy_table.module_config.certificate;
}
@@ -2144,12 +2544,149 @@ void CacheManager::SetDecryptedCertificate(const std::string& certificate) {
Backup();
}
-void CacheManager::MergePreloadPT(const std::string& file_name) {
+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 date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
+ app_consent_records.ext_consent_last_updated = current_time_msec;
+ LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
+
+ 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;
+ return false;
}
sync_primitives::AutoLock lock(cache_lock_);
@@ -2164,6 +2701,7 @@ void CacheManager::MergePreloadPT(const std::string& file_name) {
MergeCFM(new_table, current);
Backup();
}
+ return true;
}
void CacheManager::MergeMC(const policy_table::PolicyTable& new_pt,
@@ -2240,6 +2778,31 @@ const PolicySettings& CacheManager::get_settings() const {
return *settings_;
}
+void CacheManager::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ auto device_data = *(pt_->policy_table.device_data);
+
+ auto from = pt_->policy_table.device_data->find(device_id_from);
+ DCHECK_OR_RETURN_VOID(from != device_data.end());
+
+ auto to = pt_->policy_table.device_data->find(device_id_to);
+ DCHECK_OR_RETURN_VOID(to != device_data.end());
+
+ auto& consents_from = *(from->second.user_consent_records);
+ auto& consents_to = *(to->second.user_consent_records);
+
+ LOG4CXX_DEBUG(logger_,
+ "Merging user consents from device: "
+ << device_id_from << " to device: " << device_id_to);
+ for (auto f = consents_from.begin(); f != consents_from.end(); ++f) {
+ const auto app_id = f->first;
+ LOG4CXX_DEBUG(logger_, "Updating permissions for key: " << app_id);
+ consents_to[app_id] = f->second;
+ }
+}
+
CacheManager::BackgroundBackuper::BackgroundBackuper(
CacheManager* cache_manager)
: cache_manager_(cache_manager)
@@ -2267,9 +2830,10 @@ 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();
+ {
+ sync_primitives::AutoUnlock need_backup_lock(need_backup_lock_);
+ InternalBackup();
+ }
if (new_data_available_ || stop_flag_) {
continue;
}
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index a477ca55d2..c9df969bd1 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -122,9 +122,13 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot)
- : pm_(pm), update_(update), snapshot_(snapshot) {}
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<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,
@@ -262,37 +266,6 @@ bool CheckAppPolicy::IsKnownAppication(
return !(current_policies.end() == current_policies.find(application_id));
}
-void policy::CheckAppPolicy::NotifySystem(
- const policy::AppPoliciesValueType& app_policy) const {
- pm_->listener()->OnPendingPermissionChange(app_policy.first);
-}
-
-void CheckAppPolicy::SendPermissionsToApp(
- const AppPoliciesValueType& app_policy) const {
- const std::string app_id = app_policy.first;
-
- const std::string device_id = pm_->GetCurrentDeviceId(app_id);
- if (device_id.empty()) {
- LOG4CXX_WARN(logger_,
- "Couldn't find device info for application id: " << app_id);
- return;
- }
- std::vector<FunctionalGroupPermission> group_permissons;
- pm_->GetPermissionsForApp(device_id, app_id, group_permissons);
-
- Permissions notification_data;
- pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
- app_policy.second.groups,
- group_permissons,
- notification_data);
-
- LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
- pm_->listener()->OnPermissionsUpdated(
- app_id,
- notification_data,
- policy_table::EnumToJsonString(app_policy.second.default_hmi));
-}
-
bool CheckAppPolicy::IsAppRevoked(
const AppPoliciesValueType& app_policy) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -321,9 +294,25 @@ bool CheckAppPolicy::NicknamesMatch(
return true;
}
+void CheckAppPolicy::AddResult(const std::string& app_id,
+ PermissionsCheckResult result) {
+ out_results_.insert(std::make_pair(app_id, result));
+}
+
+void CheckAppPolicy::InsertPermission(const std::string& app_id,
+ const AppPermissions& permissions_diff) {
+ pm_->app_permissions_diff_lock_.Acquire();
+ auto result = pm_->app_permissions_diff_.insert(
+ std::make_pair(app_id, permissions_diff));
+ if (!result.second) {
+ LOG4CXX_ERROR(logger_, "App ID: " << app_id << " already exists in map.");
+ }
+ pm_->app_permissions_diff_lock_.Release();
+}
+
bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
const std::string app_id = app_policy.first;
-
+ AppPermissions permissions_diff(app_id);
if (!IsKnownAppication(app_id)) {
LOG4CXX_WARN(logger_,
"Application:" << app_id << " is not present in snapshot.");
@@ -331,28 +320,50 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
- NotifySystem(app_policy);
+ SetPendingPermissions(app_policy, RESULT_APP_REVOKED, permissions_diff);
+ AddResult(app_id, RESULT_APP_REVOKED);
+ InsertPermission(app_id, permissions_diff);
return true;
}
if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
- NotifySystem(app_policy);
+ SetPendingPermissions(
+ app_policy, RESULT_NICKNAME_MISMATCH, permissions_diff);
+ AddResult(app_id, RESULT_NICKNAME_MISMATCH);
+ InsertPermission(app_id, permissions_diff);
return true;
}
PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
- if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
- NotifySystem(app_policy);
+ if (!IsPredefinedApp(app_policy)) {
+ const bool is_request_type_changed = IsRequestTypeChanged(app_policy);
+ const bool is_request_subtype_changed = IsRequestSubTypeChanged(app_policy);
+ if (is_request_type_changed) {
+ LOG4CXX_TRACE(logger_,
+ "Request types were changed for application: " << app_id);
+ SetPendingPermissions(
+ app_policy, RESULT_REQUEST_TYPE_CHANGED, permissions_diff);
+ AddResult(app_id, RESULT_REQUEST_TYPE_CHANGED);
+ result =
+ (RESULT_NO_CHANGES == result) ? RESULT_REQUEST_TYPE_CHANGED : result;
+ }
+ if (is_request_subtype_changed) {
+ LOG4CXX_TRACE(
+ logger_, "Request subtypes were changed for application: " << app_id);
+ SetPendingPermissions(
+ app_policy, RESULT_REQUEST_SUBTYPE_CHANGED, permissions_diff);
+ AddResult(app_id, RESULT_REQUEST_SUBTYPE_CHANGED);
+ result = (RESULT_NO_CHANGES == result) ? RESULT_REQUEST_SUBTYPE_CHANGED
+ : result;
+ }
}
if (RESULT_NO_CHANGES == result) {
LOG4CXX_INFO(logger_,
"Permissions for application:" << app_id
<< " wasn't changed.");
+ AddResult(app_id, result);
return true;
}
@@ -360,24 +371,21 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
"Permissions for application:" << app_id
<< " have been changed.");
- if (!IsPredefinedApp(app_policy) && RESULT_CONSENT_NOT_REQIURED != result) {
- SetPendingPermissions(app_policy, result);
- NotifySystem(app_policy);
- }
-
- // Don't sent notification for predefined apps (e.g. default, device etc.)
if (!IsPredefinedApp(app_policy)) {
- SendPermissionsToApp(app_policy);
+ SetPendingPermissions(app_policy, result, permissions_diff);
+ AddResult(app_id, result);
}
+
+ InsertPermission(app_id, permissions_diff);
return true;
}
void policy::CheckAppPolicy::SetPendingPermissions(
const AppPoliciesValueType& app_policy,
- PermissionsCheckResult result) const {
+ PermissionsCheckResult result,
+ AppPermissions& permissions_diff) const {
using namespace rpc::policy_table_interface_base;
const std::string app_id = app_policy.first;
- AppPermissions permissions_diff(app_id);
const std::string priority =
policy_table::EnumToJsonString(app_policy.second.priority);
@@ -414,17 +422,18 @@ void policy::CheckAppPolicy::SetPendingPermissions(
break;
case RESULT_REQUEST_TYPE_CHANGED:
permissions_diff.requestTypeChanged = true;
- {
- // Getting RequestTypes from PTU (not from cache)
- policy_table::RequestTypes::const_iterator it_request_type =
- app_policy.second.RequestType->begin();
- for (; app_policy.second.RequestType->end() != it_request_type;
- ++it_request_type) {
- permissions_diff.requestType.push_back(
- EnumToJsonString(*it_request_type));
- }
- }
+ // Getting Request Types from PTU (not from cache)
+ for (const auto& request_type : *app_policy.second.RequestType) {
+ permissions_diff.requestType.push_back(EnumToJsonString(request_type));
+ }
+ break;
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
+ permissions_diff.requestSubTypeChanged = true;
+ // Getting Request SubTypes from PTU (not from cache)
+ for (const auto& request_subtype : *app_policy.second.RequestSubType) {
+ permissions_diff.requestSubType.push_back(request_subtype);
+ }
break;
default:
return;
@@ -433,14 +442,9 @@ void policy::CheckAppPolicy::SetPendingPermissions(
if (need_send_priority) {
permissions_diff.priority = priority;
}
-
- pm_->app_permissions_diff_lock_.Acquire();
- pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
- pm_->app_permissions_diff_lock_.Release();
}
-policy::CheckAppPolicy::PermissionsCheckResult
-policy::CheckAppPolicy::CheckPermissionsChanges(
+PermissionsCheckResult CheckAppPolicy::CheckPermissionsChanges(
const policy::AppPoliciesValueType& app_policy) const {
bool has_revoked_groups = HasRevokedGroups(app_policy);
@@ -510,6 +514,68 @@ bool CheckAppPolicy::IsRequestTypeChanged(
return diff.size();
}
+bool CheckAppPolicy::IsRequestSubTypeChanged(
+ const AppPoliciesValueType& app_policy) const {
+ policy::AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
+
+ if (it == snapshot_->policy_table.app_policies_section.apps.end()) {
+ if (!app_policy.second.RequestSubType->empty()) {
+ return true;
+ }
+ return false;
+ }
+
+ if (it->second.RequestSubType->size() !=
+ app_policy.second.RequestSubType->size()) {
+ return true;
+ }
+
+ policy_table::RequestSubTypes diff;
+ std::set_difference(it->second.RequestSubType->begin(),
+ it->second.RequestSubType->end(),
+ app_policy.second.RequestSubType->begin(),
+ app_policy.second.RequestSubType->end(),
+ std::back_inserter(diff));
+ return diff.size();
+}
+
+void FillActionsForAppPolicies::operator()(
+ const policy::CheckAppPolicyResults::value_type& value) {
+ const std::string app_id = value.first;
+ const policy_table::ApplicationPolicies::const_iterator app_policy =
+ app_policies_.find(app_id);
+
+ if (app_policies_.end() == app_policy) {
+ return;
+ }
+
+ if (IsPredefinedApp(*app_policy)) {
+ return;
+ }
+
+ switch (value.second) {
+ case RESULT_APP_REVOKED:
+ case RESULT_NICKNAME_MISMATCH:
+ actions_[app_id].is_notify_system = true;
+ return;
+ case RESULT_CONSENT_NEEDED:
+ case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED:
+ actions_[app_id].is_consent_needed = true;
+ break;
+ case RESULT_CONSENT_NOT_REQIURED:
+ case RESULT_PERMISSIONS_REVOKED:
+ case RESULT_REQUEST_TYPE_CHANGED:
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
+ break;
+ case RESULT_NO_CHANGES:
+ default:
+ return;
+ }
+ actions_[app_id].is_notify_system = true;
+ actions_[app_id].is_send_permissions_to_app = true;
+}
+
FillNotificationData::FillNotificationData(Permissions& data,
GroupConsent group_state,
GroupConsent undefined_group_consent,
@@ -571,7 +637,16 @@ void FillNotificationData::UpdateParameters(
ParametersConstItr it_parameters = in_parameters.begin();
ParametersConstItr it_parameters_end = in_parameters.end();
- // Due to APPLINK-24201 SDL must consider cases when 'parameters' section is
+ // To determine consent for a particular RPC in a particular HMI level with
+ // particular parameters (if applicable), the system shall find all of the
+ // functional groups the RPC is included in. If user consent is needed as
+ // listed within the functional group in the policy table, the system shall
+ // use a logical AND: backend permissions AND User permissions. If the RPC is
+ // listed under more than one group, the system shall perform a logical OR
+ // amongst all of the possible allowed permissions scenarios for the RPC (and
+ // parameter/or HMI level) defined by each of the functional groups.
+
+ // Due to requirements SDL must consider cases when 'parameters' section is
// not present for RPC or present, but is empty.
// If 'parameters' section is like: 'parameters' : []
@@ -586,10 +661,8 @@ void FillNotificationData::UpdateParameters(
// If 'parameters' section is omitted
if (!in_parameters.is_initialized()) {
- if (!does_require_user_consent_) {
- out_parameter.any_parameter_allowed = true;
- }
- if (does_require_user_consent_ && kAllowedKey == current_key_) {
+ if (!does_require_user_consent_ ||
+ (does_require_user_consent_ && kAllowedKey == current_key_)) {
out_parameter.any_parameter_allowed = true;
}
}
@@ -598,10 +671,16 @@ void FillNotificationData::UpdateParameters(
out_parameter[current_key_].insert(
policy_table::EnumToJsonString(*it_parameters));
}
+
+ // We should reset ALL DISALLOWED flags if at least one parameter is allowed
+ // due to a logical OR permissions check
+ if (IsSomeParameterAllowed(out_parameter)) {
+ out_parameter.any_parameter_disallowed_by_policy = false;
+ out_parameter.any_parameter_disallowed_by_user = false;
+ }
}
void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
- HMIPermissions& rpc_hmi_permissions = rpc.hmi_permissions;
HMIPermissions::const_iterator it_hmi_allowed =
rpc.hmi_permissions.find(kAllowedKey);
HMIPermissions::const_iterator it_hmi_undefined =
@@ -612,29 +691,28 @@ void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
// 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_user_disallowed) {
+ if (rpc.hmi_permissions.end() != it_hmi_allowed) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kAllowedKey],
+ rpc.hmi_permissions[kUserDisallowedKey]);
}
- if (rpc_hmi_permissions.end() != it_hmi_undefined) {
- ExcludeSameHMILevels(rpc_hmi_permissions[kUndefinedKey],
- rpc_hmi_permissions[kUserDisallowedKey]);
+ if (rpc.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]);
+ 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 =
@@ -645,34 +723,34 @@ void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
// 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_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]);
+ 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_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]);
+ 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]);
+ 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]);
}
}
}
@@ -722,16 +800,24 @@ bool FillNotificationData::RpcParametersEmpty(RpcPermissions& rpc) {
no_user_disallowed_parameters;
}
-bool FillNotificationData::IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section) {
+bool FillNotificationData::IsSectionEmpty(
+ const ParameterPermissions& permissions, const std::string& section) const {
ParameterPermissions::const_iterator it_section = permissions.find(section);
ParameterPermissions::const_iterator end = permissions.end();
if (end != it_section) {
- return permissions[section].empty();
+ return it_section->second.empty();
}
return true;
}
+bool FillNotificationData::IsSomeParameterAllowed(
+ const ParameterPermissions& permissions) const {
+ const bool are_any_consented_parameters_allowed =
+ kAllowedKey == current_key_ && !IsSectionEmpty(permissions, current_key_);
+ return permissions.any_parameter_allowed ||
+ are_any_consented_parameters_allowed;
+}
+
ProcessFunctionalGroup::ProcessFunctionalGroup(
const policy_table::FunctionalGroupings& fg,
const std::vector<FunctionalGroupPermission>& group_permissions,
@@ -790,7 +876,7 @@ void FillFunctionalGroupPermissions(
FunctionalGroupNames& names,
GroupConsent state,
std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs::const_iterator it = ids.begin();
FunctionalGroupIDs::const_iterator it_end = ids.end();
for (; it != it_end; ++it) {
@@ -810,7 +896,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) {
FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs from_copy(from);
FunctionalGroupIDs what_copy(what);
@@ -832,7 +918,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs first_copy(first);
FunctionalGroupIDs second_copy(second);
@@ -893,4 +979,5 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
return true;
}
-}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 419cb2e4ef..a603f122e2 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -36,6 +36,8 @@
#include <queue>
#include <iterator>
#include <limits>
+#include <vector>
+#include <functional>
#include "json/reader.h"
#include "json/writer.h"
#include "policy/policy_table.h"
@@ -47,7 +49,9 @@
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
-#include "utils/make_shared.h"
+
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -55,6 +59,151 @@ policy::PolicyManager* CreateManager() {
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 {
@@ -64,6 +213,8 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
@@ -73,25 +224,30 @@ PolicyManagerImpl::PolicyManagerImpl(bool in_memory)
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager(in_memory))
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
- , retry_sequence_url_(0, 0, "") {}
+ , retry_sequence_url_(0, 0, "")
+ , 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(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
@@ -111,12 +267,167 @@ void PolicyManagerImpl::CheckTriggers() {
}
}
+std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
+ return cache_->GetLockScreenIconUrl();
+}
+
+/**
+ * @brief FilterInvalidFunctions filter functions that are absent in schema
+ * @param rpcs list of functions to filter
+ */
+void FilterInvalidFunctions(policy_table::Rpc& rpcs) {
+ policy_table::Rpc valid_rpcs;
+ for (const auto& rpc : rpcs) {
+ const std::string& rpc_name = rpc.first;
+ policy_table::FunctionID function_id;
+ if (policy_table::EnumFromJsonString(rpc_name, &function_id)) {
+ valid_rpcs.insert(rpc);
+ }
+ }
+ rpcs.swap(valid_rpcs);
+}
+
+/**
+ * @brief FilterInvalidRPCParameters filter parameters that not present in
+ * schema
+ * @param rpc_parameters parameters to filter
+ */
+void FilterInvalidRPCParameters(policy_table::RpcParameters& rpc_parameters) {
+ policy_table::HmiLevels valid_hmi_levels;
+ for (const auto& hmi_level : rpc_parameters.hmi_levels) {
+ if (hmi_level.is_valid()) {
+ valid_hmi_levels.push_back(hmi_level);
+ }
+ }
+ rpc_parameters.hmi_levels.swap(valid_hmi_levels);
+
+ policy_table::Parameters valid_params;
+ const policy_table::Parameters& params = *(rpc_parameters.parameters);
+ for (const auto& param : params) {
+ if (param.is_valid()) {
+ valid_params.push_back(param);
+ }
+ }
+ rpc_parameters.parameters->swap(valid_params);
+}
+
+/**
+ * @brief FilterInvalidPriorityValues filter notification priorities that are
+ * not present in schema
+ * @param notifications priorities to filter
+ */
+void FilterInvalidPriorityValues(
+ policy_table::NumberOfNotificationsPerMinute& notifications) {
+ policy_table::NumberOfNotificationsPerMinute valid_notifications;
+ for (const auto& notification : notifications) {
+ policy_table::Priority priority;
+ if (policy_table::EnumFromJsonString(notification.first, &priority)) {
+ valid_notifications.insert(notification);
+ }
+ }
+ notifications.swap(valid_notifications);
+}
+
+/**
+ * @brief FilterInvalidApplicationParameters filter app params that are not
+ * present in schema
+ * @param app_params object of app policy params to filter
+ */
+void FilterInvalidApplicationParameters(
+ policy_table::ApplicationParams& app_params) {
+ // Filter AppHMIType array
+ policy_table::AppHMITypes valid_app_hmi_types;
+ const policy_table::AppHMITypes& app_hmi_types = *(app_params.AppHMIType);
+ for (const auto& app_hmi_type : app_hmi_types) {
+ if (app_hmi_type.is_valid()) {
+ valid_app_hmi_types.push_back(app_hmi_type);
+ }
+ }
+ app_params.AppHMIType->swap(valid_app_hmi_types);
+
+ // Filter RquestTypes array
+ policy_table::RequestTypes valid_request_types;
+ const policy_table::RequestTypes& request_types = *(app_params.RequestType);
+ for (const auto& request_type : request_types) {
+ if (request_type.is_valid()) {
+ valid_request_types.push_back(request_type);
+ }
+ }
+ if (valid_request_types.empty() && !request_types.empty()) {
+ // An empty RequestType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.RequestType) = policy_table::RequestTypes();
+ } else {
+ app_params.RequestType->swap(valid_request_types);
+ }
+
+ // Filter moduleType array
+ policy_table::ModuleTypes valid_module_types;
+ const policy_table::ModuleTypes& module_types = *(app_params.moduleType);
+ for (const auto& module_type : module_types) {
+ if (module_type.is_valid()) {
+ valid_module_types.push_back(module_type);
+ }
+ }
+ if (valid_module_types.empty() && !module_types.empty()) {
+ // An empty moduleType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.moduleType) = policy_table::ModuleTypes();
+ } else {
+ app_params.moduleType->swap(valid_module_types);
+ }
+
+ // Filter default_hmi
+ if (!app_params.default_hmi.is_valid()) {
+ app_params.default_hmi = policy_table::HmiLevel();
+ }
+
+ // Filter priority
+ if (!app_params.priority.is_valid()) {
+ app_params.priority = policy_table::Priority();
+ }
+}
+
+/**
+ * @brief FilterPolicyTable filter values that not present in schema
+ * @param pt policy table to filter
+ */
+void FilterPolicyTable(policy_table::PolicyTable& pt) {
+ policy_table::ModuleConfig& module_config = pt.module_config;
+ if (module_config.is_initialized() &&
+ module_config.notifications_per_minute_by_priority.is_initialized()) {
+ FilterInvalidPriorityValues(
+ module_config.notifications_per_minute_by_priority);
+ }
+
+ if (pt.app_policies_section.is_initialized()) {
+ policy_table::ApplicationPolicies& apps = pt.app_policies_section.apps;
+ for (auto& app_policy : apps) {
+ FilterInvalidApplicationParameters(app_policy.second);
+ }
+ }
+
+ for (auto& group : pt.functional_groupings) {
+ policy_table::Rpc& rpcs = group.second.rpcs;
+ FilterInvalidFunctions(rpcs);
+
+ for (auto& func : rpcs) {
+ FilterInvalidRPCParameters(func.second);
+ }
+ }
+}
+
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is NULL.");
update_status_manager_.OnWrongUpdateReceived();
@@ -124,8 +435,9 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
file_system::DeleteFile(file);
-
+ FilterPolicyTable(pt_update->policy_table);
if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
+ wrong_ptu_update_received_ = true;
update_status_manager_.OnWrongUpdateReceived();
return false;
}
@@ -137,10 +449,13 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to create snapshot of policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -149,14 +464,28 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// 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);
+ 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.");
+ LOG4CXX_WARN(
+ logger_,
+ "Unsuccessful save of updated policy table, trying another exchange");
+ ForcePTExchange();
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));
@@ -181,22 +510,66 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
return true;
}
-std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
- return cache_->GetLockScreenIconUrl();
-}
-
-void PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges(
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
// 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));
+ CheckAppPolicy(this, pt_update, snapshot, out_results));
+
+ return out_results;
+}
+
+void PolicyManagerImpl::ProcessAppPolicyCheckResults(
+ const CheckAppPolicyResults& results,
+ const policy_table::ApplicationPolicies& app_policies) {
+ ApplicationsPoliciesActions actions_for_apps_policies;
+ FillActionsForAppPolicies filler(actions_for_apps_policies, app_policies);
+
+ std::for_each(results.begin(), results.end(), filler);
+
+ ProcessActionsForAppPolicies(actions_for_apps_policies, app_policies);
+}
+
+void PolicyManagerImpl::ProcessActionsForAppPolicies(
+ const ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies) {
+ ApplicationsPoliciesActions::const_iterator it_actions = actions.begin();
+ for (; it_actions != actions.end(); ++it_actions) {
+ policy_table::ApplicationPolicies::const_iterator app_policy =
+ app_policies.find(it_actions->first);
+ if (app_policies.end() == app_policy) {
+ continue;
+ }
+
+ if (it_actions->second.is_consent_needed) {
+ // Post-check after ExternalConsent consent changes
+ const std::string& policy_app_id = app_policy->first;
+ if (!IsConsentNeeded(policy_app_id)) {
+ sync_primitives::AutoLock lock(app_permissions_diff_lock_);
+
+ PendingPermissions::iterator app_id_diff =
+ app_permissions_diff_.find(policy_app_id);
+
+ if (app_permissions_diff_.end() != app_id_diff) {
+ app_id_diff->second.appPermissionsConsentNeeded = false;
+ }
+ }
+ }
+ if (it_actions->second.is_notify_system) {
+ NotifySystem(*app_policy);
+ }
+ if (it_actions->second.is_send_permissions_to_app) {
+ SendPermissionsToApp(*app_policy);
+ }
+ }
}
void PolicyManagerImpl::PrepareNotificationData(
@@ -209,6 +582,27 @@ void PolicyManagerImpl::PrepareNotificationData(
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_);
@@ -222,7 +616,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
void PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -262,7 +656,9 @@ void PolicyManagerImpl::StartPTExchange() {
}
if (update_status_manager_.IsUpdatePending()) {
- update_status_manager_.ScheduleUpdate();
+ if (trigger_ptu_) {
+ update_status_manager_.ScheduleUpdate();
+ }
LOG4CXX_INFO(logger_,
"Starting exchange skipped, since another exchange "
"is in progress.");
@@ -283,9 +679,12 @@ void PolicyManagerImpl::OnAppsSearchStarted() {
update_status_manager_.OnAppsSearchStarted();
}
-void PolicyManagerImpl::OnAppsSearchCompleted() {
+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();
}
@@ -303,6 +702,25 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
return request_types;
}
+RequestType::State PolicyManagerImpl::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyManagerImpl::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestSubTypesState(policy_app_id);
+}
+
+const std::vector<std::string> PolicyManagerImpl::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ std::vector<std::string> request_subtypes;
+ cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ return request_subtypes;
+}
+
const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
@@ -334,14 +752,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
policy_table::FunctionalGroupings functional_groupings;
cache_->GetFunctionalGroupings(functional_groupings);
- std::vector<FunctionalGroupPermission>::const_iterator it =
- app_group_permissions.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- app_group_permissions.end();
- policy_table::Strings app_groups;
- for (; it != it_end; ++it) {
- app_groups.push_back((*it).group_name);
- }
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
// Undefined groups (without user consent) disallowed by default, since
// OnPermissionsChange notification has no "undefined" section
@@ -373,7 +784,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
}
const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc);
- LOG4CXX_INFO(logger_, "Is known rpc " << known_rpc);
+ LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false"));
if (!known_rpc) {
// RPC not found in list == disallowed by backend
result.hmi_level_permitted = kRpcDisallowed;
@@ -395,6 +806,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find(
hmi_level)) {
// RPC found in allowed == allowed by backend, but disallowed by user
+ LOG4CXX_DEBUG(
+ logger_,
+ "RPC found in allowed == allowed by backend, but disallowed by user");
result.hmi_level_permitted = kRpcUserDisallowed;
} else {
LOG4CXX_DEBUG(logger_,
@@ -476,10 +890,17 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
}
bool PolicyManagerImpl::ResetUserConsent() {
- bool result = true;
- result = cache_->ResetUserConsent();
+ return 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(
@@ -499,14 +920,7 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
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);
- }
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
Permissions notification_data;
PrepareNotificationData(functional_groupings,
@@ -517,6 +931,12 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
LOG4CXX_INFO(logger_,
"Send notification for application_id:" << application_id);
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+
std::string default_hmi;
GetDefaultHmi(application_id, &default_hmi);
@@ -666,7 +1086,7 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges(
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 =
+ PendingPermissions::iterator it_pending =
app_permissions_diff_.find(policy_app_id);
if (app_permissions_diff_.end() == it_pending) {
LOG4CXX_WARN(
@@ -703,49 +1123,63 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges(
return;
}
+void PolicyManagerImpl::NotifyPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& app_group_permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // 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 PermissionConsent& permissions, const NotificationMode mode) {
LOG4CXX_AUTO_TRACE(logger_);
+
cache_->ResetCalculatedPermissions();
PermissionConsent verified_permissions =
EnsureCorrectPermissionConsent(permissions);
- if (!cache_->SetUserPermissionsForApp(verified_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;
}
- // Send OnPermissionChange notification, since consents were changed
- std::vector<FunctionalGroupPermission> app_group_permissons;
- GetPermissionsForApp(verified_permissions.device_id,
- verified_permissions.policy_app_id,
- app_group_permissons);
-
- // Change pending permissions isConsentNeeded state, if no unconsented
- // groups left
- CheckPendingPermissionsChanges(permissions.policy_app_id,
- app_group_permissons);
-
- // Get current functional groups from DB with RPC permissions
- policy_table::FunctionalGroupings functional_groups;
- cache_->GetFunctionalGroupings(functional_groups);
+ if (kSilentMode == mode) {
+ LOG4CXX_WARN(logger_,
+ "Silent mode is enabled. Application won't be informed.");
+ return;
+ }
- // Get list of groups assigned to application
- policy_table::Strings app_groups;
- std::vector<FunctionalGroupPermission>::const_iterator it =
- app_group_permissons.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- app_group_permissons.end();
- for (; it != it_end; ++it) {
- app_groups.push_back((*it).group_name);
+ if (!app_permissions_changed) {
+ LOG4CXX_WARN(logger_,
+ "Application already has same consents. "
+ "Notificaton won't be sent.");
+ return;
}
- // Fill notification data according to group permissions
- Permissions notification_data;
- PrepareNotificationData(
- functional_groups, app_groups, app_group_permissons, notification_data);
+ 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);
- listener()->OnPermissionsUpdated(verified_permissions.policy_app_id,
- notification_data);
+ NotifyPermissionsChanges(verified_permissions.policy_app_id,
+ updated_app_group_permissons);
}
bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
@@ -812,10 +1246,6 @@ void PolicyManagerImpl::GetUserConsentForApp(
FunctionalGroupIDs preconsented_groups = group_types[kTypePreconsented];
FunctionalGroupIDs consent_allowed_groups = group_types[kTypeAllowed];
FunctionalGroupIDs consent_disallowed_groups = group_types[kTypeDisallowed];
- FunctionalGroupIDs default_groups = group_types[kTypeDefault];
- FunctionalGroupIDs predataconsented_groups =
- group_types[kTypePreDataConsented];
- FunctionalGroupIDs device_groups = group_types[kTypeDevice];
// Sorting groups by consent
FunctionalGroupIDs preconsented_wo_auto =
@@ -827,15 +1257,8 @@ void PolicyManagerImpl::GetUserConsentForApp(
FunctionalGroupIDs allowed_groups =
Merge(consent_allowed_groups, preconsented_wo_disallowed_auto);
- FunctionalGroupIDs merged_stage_1 =
- Merge(default_groups, predataconsented_groups);
-
- FunctionalGroupIDs merged_stage_2 = Merge(merged_stage_1, device_groups);
-
- FunctionalGroupIDs merged_stage_3 =
- Merge(merged_stage_2, auto_allowed_groups);
-
- FunctionalGroupIDs excluded_stage_1 = ExcludeSame(all_groups, merged_stage_3);
+ FunctionalGroupIDs excluded_stage_1 =
+ ExcludeSame(all_groups, auto_allowed_groups);
FunctionalGroupIDs excluded_stage_2 =
ExcludeSame(excluded_stage_1, consent_disallowed_groups);
@@ -859,6 +1282,13 @@ void PolicyManagerImpl::GetPermissionsForApp(
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;
@@ -870,7 +1300,11 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
FunctionalIdType group_types;
- if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) {
+
+ const bool ret =
+ cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+
+ if (!ret) {
LOG4CXX_WARN(logger_,
"Can't get user permissions for app " << policy_app_id);
return;
@@ -979,7 +1413,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -997,12 +1431,211 @@ const PolicySettings& PolicyManagerImpl::get_settings() const {
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
+ std::shared_ptr<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();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
DCHECK(std::numeric_limits<uint16_t>::max() >= days);
@@ -1086,7 +1719,11 @@ void PolicyManagerImpl::OnUpdateStarted() {
uint32_t update_timeout = TimeoutExchangeMSec();
LOG4CXX_DEBUG(logger_,
"Update timeout will be set to (milisec): " << update_timeout);
- update_status_manager_.OnUpdateSentOut(update_timeout);
+ send_on_update_sent_out_ = !update_status_manager_.IsUpdatePending();
+
+ if (send_on_update_sent_out_) {
+ update_status_manager_.OnUpdateSentOut(update_timeout);
+ }
cache_->SaveUpdateRequired(true);
}
@@ -1139,9 +1776,11 @@ 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);
+ 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 {
@@ -1179,6 +1818,12 @@ void PolicyManagerImpl::OnAppRegisteredOnMobile(
SendNotificationOnPermissionsUpdated(application_id);
}
+void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
const MetaInfo PolicyManagerImpl::GetMetaInfo() const {
LOG4CXX_AUTO_TRACE(logger_);
return cache_->GetMetaInfo();
@@ -1234,8 +1879,9 @@ AppIdURL PolicyManagerImpl::RetrySequenceUrl(const struct RetrySequenceURL& rs,
app_idx = 0;
}
}
+ const AppIdURL next_app_url = std::make_pair(app_idx, url_idx);
- return std::make_pair(app_idx, url_idx);
+ return next_app_url;
}
/**
@@ -1258,20 +1904,22 @@ class CallStatusChange : public utils::Callable {
};
StatusNotifier PolicyManagerImpl::AddApplication(
- const std::string& application_id) {
+ 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)) {
+ LOG4CXX_DEBUG(logger_, "Adding new application");
AddNewApplication(application_id, device_consent);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
- } else {
- PromoteExistedApplication(application_id, device_consent);
- return utils::MakeShared<utils::CallNothing>();
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
}
+ LOG4CXX_DEBUG(logger_, "Promote existed application");
+ PromoteExistedApplication(application_id, device_consent);
+ update_status_manager_.OnExistedApplicationAdded(cache_->UpdateRequired());
+ return std::make_shared<utils::CallNothing>();
}
void PolicyManagerImpl::RemoveAppConsentForGroup(
@@ -1285,6 +1933,26 @@ bool PolicyManagerImpl::IsPredataPolicy(
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_);
@@ -1303,6 +1971,9 @@ void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
<< " permissions for application id: " << application_id);
cache_->SetDefaultPolicy(application_id);
}
+
+ ProcessExternalConsentStatusForApp(
+ application_id, ConsentProcessingPolicy::kExternalConsentBased);
}
void PolicyManagerImpl::PromoteExistedApplication(
@@ -1313,14 +1984,8 @@ void PolicyManagerImpl::PromoteExistedApplication(
cache_->IsPredataPolicy(application_id)) {
cache_->SetDefaultPolicy(application_id);
}
- if (HasCertificate()) {
- LOG4CXX_DEBUG(logger_, "Certificate exits, no update required.");
- return;
- }
-
- if (cache_->AppHasHMIType(application_id, policy_table::AHT_NAVIGATION)) {
- update_status_manager_.ScheduleUpdate();
- }
+ ProcessExternalConsentStatusForApp(application_id,
+ ConsentProcessingPolicy::kTimestampBased);
}
bool PolicyManagerImpl::IsNewApplication(
@@ -1368,7 +2033,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
- update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
}
return ret;
}
@@ -1383,7 +2047,123 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const policy_table::Strings& groups) {
+ for (policy_table::Strings::const_iterator i = groups.begin();
+ i != groups.end();
+ ++i) {
+ output << static_cast<std::string>(*i) << " ";
+ }
+ return output;
+}
+
+void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice who = {device_id, application_id};
+ access_remote_->SetDefaultHmiTypes(who, hmi_types);
+}
+
+struct HMITypeToInt {
+ int operator()(const policy_table::AppHMITypes::value_type item) {
+ return policy_table::AppHMIType(item);
+ }
+};
+
+bool PolicyManagerImpl::GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(application_id)) {
+ return false;
+ }
+ const policy_table::AppHMITypes* hmi_types =
+ cache_->GetHMITypes(application_id);
+ if (hmi_types) {
+ std::transform(hmi_types->begin(),
+ hmi_types->end(),
+ std::back_inserter(*app_types),
+ HMITypeToInt());
+ }
+ return hmi_types;
+}
+
+bool PolicyManagerImpl::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleType module_type;
+ return EnumFromJsonString(module, &module_type) &&
+ access_remote_->CheckModuleType(app_id, module_type);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Couldn't get default HMI level for application "
+ << who.app_id);
+ }
+}
+
+void PolicyManagerImpl::GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(data);
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups;
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ app_group_permissions.end();
+ for (; it != it_end; ++it) {
+ app_groups.push_back((*it).group_name);
+ }
+
+ PrepareNotificationData(
+ functional_groupings, app_groups, app_group_permissions, *data);
+}
+
+void PolicyManagerImpl::SendAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ Permissions notification_data;
+ GetPermissions(device_id, application_id, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ std::shared_ptr<AccessRemote> access_remote) {
+ access_remote_ = access_remote;
}
} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_table.cc b/src/components/policy/policy_external/src/policy_table.cc
index 7a63fac50d..8ca6b698d1 100644
--- a/src/components/policy/policy_external/src/policy_table.cc
+++ b/src/components/policy/policy_external/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTExtRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index e70167c94b..27db505e3f 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -1,4 +1,3 @@
-// This file is generated, do not edit
#include "policy/policy_table/enums.h"
namespace rpc {
@@ -15,6 +14,8 @@ bool IsValidEnum(Priority val) {
return true;
case P_NORMAL:
return true;
+ case P_PROJECTION:
+ return true;
case P_NONE:
return true;
default:
@@ -33,6 +34,8 @@ const char* EnumToJsonString(Priority val) {
return "COMMUNICATION";
case P_NORMAL:
return "NORMAL";
+ case P_PROJECTION:
+ return "PROJECTION";
case P_NONE:
return "NONE";
default:
@@ -55,6 +58,9 @@ bool EnumFromJsonString(const std::string& literal, Priority* result) {
} else if ("NORMAL" == literal) {
*result = P_NORMAL;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = P_PROJECTION;
+ return true;
} else if ("NONE" == literal) {
*result = P_NONE;
return true;
@@ -119,6 +125,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_EXTERNALTEMPERATURE:
return true;
+ case P_TURNSIGNAL:
+ return true;
case P_FUELLEVEL:
return true;
case P_FUELLEVEL_STATE:
@@ -127,6 +135,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_INSTANTFUELCONSUMPTION:
return true;
+ case P_FUELRANGE:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -139,6 +149,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -147,6 +159,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_STEERINGWHEELANGLE:
return true;
+ case P_ENGINEOILLIFE:
+ return true;
case P_MYKEY:
return true;
case P_AIRBAGSTATUS:
@@ -163,8 +177,6 @@ bool IsValidEnum(Parameter val) {
return true;
case P_ABS_STATE:
return true;
- case P_TURN_SIGNAL:
- return true;
case P_FUEL_RANGE:
return true;
case P_TIRE_PRESSURE_VALUE:
@@ -208,6 +220,8 @@ const char* EnumToJsonString(Parameter val) {
return "engineTorque";
case P_EXTERNALTEMPERATURE:
return "externalTemperature";
+ case P_TURNSIGNAL:
+ return "turnSignal";
case P_FUELLEVEL:
return "fuelLevel";
case P_FUELLEVEL_STATE:
@@ -216,6 +230,8 @@ const char* EnumToJsonString(Parameter val) {
return "headLampStatus";
case P_INSTANTFUELCONSUMPTION:
return "instantFuelConsumption";
+ case P_FUELRANGE:
+ return "fuelRange";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -228,6 +244,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -236,6 +254,8 @@ const char* EnumToJsonString(Parameter val) {
return "rpm";
case P_STEERINGWHEELANGLE:
return "steeringWheelAngle";
+ case P_ENGINEOILLIFE:
+ return "engineOilLife";
case P_MYKEY:
return "myKey";
case P_AIRBAGSTATUS:
@@ -252,8 +272,6 @@ const char* EnumToJsonString(Parameter val) {
return "eCallInfo";
case P_ABS_STATE:
return "abs_State";
- case P_TURN_SIGNAL:
- return "turnSignal";
case P_FUEL_RANGE:
return "fuelRange";
case P_TIRE_PRESSURE_VALUE:
@@ -300,6 +318,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("externalTemperature" == literal) {
*result = P_EXTERNALTEMPERATURE;
return true;
+ } else if ("turnSignal" == literal) {
+ *result = P_TURNSIGNAL;
+ return true;
} else if ("fuelLevel" == literal) {
*result = P_FUELLEVEL;
return true;
@@ -312,6 +333,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("instantFuelConsumption" == literal) {
*result = P_INSTANTFUELCONSUMPTION;
return true;
+ } else if ("fuelRange" == literal) {
+ *result = P_FUELRANGE;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -330,6 +354,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -342,6 +369,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("steeringWheelAngle" == literal) {
*result = P_STEERINGWHEELANGLE;
return true;
+ } else if ("engineOilLife" == literal) {
+ *result = P_ENGINEOILLIFE;
+ return true;
} else if ("myKey" == literal) {
*result = P_MYKEY;
return true;
@@ -366,9 +396,6 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("abs_State" == literal) {
*result = P_ABS_STATE;
return true;
- } else if ("turnSignal" == literal) {
- *result = P_TURN_SIGNAL;
- return true;
} else if ("fuelRange" == literal) {
*result = P_FUEL_RANGE;
return true;
@@ -438,6 +465,10 @@ bool IsValidEnum(AppHMIType val) {
return true;
case AHT_SYSTEM:
return true;
+ case AHT_PROJECTION:
+ return true;
+ case AHT_REMOTE_CONTROL:
+ return true;
default:
return false;
}
@@ -464,6 +495,10 @@ const char* EnumToJsonString(AppHMIType val) {
return "TESTING";
case AHT_SYSTEM:
return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
+ case AHT_REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
default:
return "";
}
@@ -499,6 +534,12 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
} else if ("SYSTEM" == literal) {
*result = AHT_SYSTEM;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
+ } else if ("REMOTE_CONTROL" == literal) {
+ *result = AHT_REMOTE_CONTROL;
+ return true;
} else {
return false;
}
@@ -578,6 +619,10 @@ bool IsValidEnum(RequestType val) {
return true;
case RT_FOTA:
return true;
+ case RT_OEM_SPECIFIC:
+ return true;
+ case RT_EMPTY:
+ return true;
default:
return false;
}
@@ -625,6 +670,10 @@ const char* EnumToJsonString(RequestType val) {
return "MEDIA";
case RT_FOTA:
return "FOTA";
+ case RT_OEM_SPECIFIC:
+ return "OEM_SPECIFIC";
+ case RT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -710,11 +759,440 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
if ("FOTA" == literal) {
*result = RT_FOTA;
return true;
+ }
+ if ("OEM_SPECIFIC" == literal) {
+ *result = RT_OEM_SPECIFIC;
+ return true;
+ }
+ if ("EMPTY" == literal) {
+ *result = RT_EMPTY;
+ return true;
} else {
return false;
}
}
+bool IsValidEnum(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return true;
+ case MT_RADIO:
+ return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
+ case MT_SEAT:
+ return true;
+ case MT_EMPTY:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return "CLIMATE";
+ case MT_RADIO:
+ return "RADIO";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
+ case MT_SEAT:
+ return "SEAT";
+ case MT_EMPTY:
+ return "EMPTY";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
+ if ("CLIMATE" == literal) {
+ *result = MT_CLIMATE;
+ return true;
+ } else if ("RADIO" == literal) {
+ *result = MT_RADIO;
+ return true;
+ } else if ("SEAT" == literal) {
+ *result = MT_SEAT;
+ return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
+ if ("RegisterAppInterface" == literal) {
+ *result = RegisterAppInterfaceID;
+ return true;
+ }
+
+ if ("UnregisterAppInterface" == literal) {
+ *result = UnregisterAppInterfaceID;
+ return true;
+ }
+
+ if ("SetGlobalProperties" == literal) {
+ *result = SetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("ResetGlobalProperties" == literal) {
+ *result = ResetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("AddCommand" == literal) {
+ *result = AddCommandID;
+ return true;
+ }
+
+ if ("DeleteCommand" == literal) {
+ *result = DeleteCommandID;
+ return true;
+ }
+
+ if ("AddSubMenu" == literal) {
+ *result = AddSubMenuID;
+ return true;
+ }
+
+ if ("DeleteSubMenu" == literal) {
+ *result = DeleteSubMenuID;
+ return true;
+ }
+
+ if ("CreateInteractionChoiceSet" == literal) {
+ *result = CreateInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("PerformInteraction" == literal) {
+ *result = PerformInteractionID;
+ return true;
+ }
+
+ if ("DeleteInteractionChoiceSet" == literal) {
+ *result = DeleteInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("Alert" == literal) {
+ *result = AlertID;
+ return true;
+ }
+
+ if ("Show" == literal) {
+ *result = ShowID;
+ return true;
+ }
+
+ if ("Speak" == literal) {
+ *result = SpeakID;
+ return true;
+ }
+
+ if ("SetMediaClockTimer" == literal) {
+ *result = SetMediaClockTimerID;
+ return true;
+ }
+
+ if ("PerformAudioPassThru" == literal) {
+ *result = PerformAudioPassThruID;
+ return true;
+ }
+
+ if ("EndAudioPassThru" == literal) {
+ *result = EndAudioPassThruID;
+ return true;
+ }
+
+ if ("SubscribeButton" == literal) {
+ *result = SubscribeButtonID;
+ return true;
+ }
+
+ if ("UnsubscribeButton" == literal) {
+ *result = UnsubscribeButtonID;
+ return true;
+ }
+
+ if ("SubscribeVehicleData" == literal) {
+ *result = SubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("UnsubscribeVehicleData" == literal) {
+ *result = UnsubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("GetVehicleData" == literal) {
+ *result = GetVehicleDataID;
+ return true;
+ }
+
+ if ("ReadDID" == literal) {
+ *result = ReadDIDID;
+ return true;
+ }
+
+ if ("GetDTCs" == literal) {
+ *result = GetDTCsID;
+ return true;
+ }
+
+ if ("ScrollableMessage" == literal) {
+ *result = ScrollableMessageID;
+ return true;
+ }
+
+ if ("Slider" == literal) {
+ *result = SliderID;
+ return true;
+ }
+
+ if ("ShowConstantTBT" == literal) {
+ *result = ShowConstantTBTID;
+ return true;
+ }
+
+ if ("AlertManeuver" == literal) {
+ *result = AlertManeuverID;
+ return true;
+ }
+
+ if ("UpdateTurnList" == literal) {
+ *result = UpdateTurnListID;
+ return true;
+ }
+
+ if ("ChangeRegistration" == literal) {
+ *result = ChangeRegistrationID;
+ return true;
+ }
+
+ if ("GenericResponse" == literal) {
+ *result = GenericResponseID;
+ return true;
+ }
+
+ if ("PutFile" == literal) {
+ *result = PutFileID;
+ return true;
+ }
+
+ if ("DeleteFile" == literal) {
+ *result = DeleteFileID;
+ return true;
+ }
+
+ if ("ListFiles" == literal) {
+ *result = ListFilesID;
+ return true;
+ }
+
+ if ("SetAppIcon" == literal) {
+ *result = SetAppIconID;
+ return true;
+ }
+
+ if ("SetDisplayLayout" == literal) {
+ *result = SetDisplayLayoutID;
+ return true;
+ }
+
+ if ("DiagnosticMessage" == literal) {
+ *result = DiagnosticMessageID;
+ return true;
+ }
+
+ if ("SystemRequest" == literal) {
+ *result = SystemRequestID;
+ return true;
+ }
+
+ if ("SendLocation" == literal) {
+ *result = SendLocationID;
+ return true;
+ }
+
+ if ("DialNumber" == literal) {
+ *result = DialNumberID;
+ return true;
+ }
+
+ if ("ButtonPress" == literal) {
+ *result = ButtonPressID;
+ return true;
+ }
+
+ if ("GetInteriorVehicleData" == literal) {
+ *result = GetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("SetInteriorVehicleData" == literal) {
+ *result = SetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("GetWayPoints" == literal) {
+ *result = GetWayPointsID;
+ return true;
+ }
+
+ if ("SubscribeWayPoints" == literal) {
+ *result = SubscribeWayPointsID;
+ return true;
+ }
+
+ if ("UnsubscribeWayPoints" == literal) {
+ *result = UnsubscribeWayPointsID;
+ return true;
+ }
+
+ if ("GetSystemCapability" == literal) {
+ *result = GetSystemCapabilityID;
+ return true;
+ }
+
+ if ("SendHapticData" == literal) {
+ *result = SendHapticDataID;
+ return true;
+ }
+
+ if ("OnHMIStatus" == literal) {
+ *result = OnHMIStatusID;
+ return true;
+ }
+
+ if ("OnAppInterfaceUnregistered" == literal) {
+ *result = OnAppInterfaceUnregisteredID;
+ return true;
+ }
+
+ if ("OnButtonEvent" == literal) {
+ *result = OnButtonEventID;
+ return true;
+ }
+
+ if ("OnButtonPress" == literal) {
+ *result = OnButtonPressID;
+ return true;
+ }
+
+ if ("OnVehicleData" == literal) {
+ *result = OnVehicleDataID;
+ return true;
+ }
+
+ if ("OnCommand" == literal) {
+ *result = OnCommandID;
+ return true;
+ }
+
+ if ("OnTBTClientState" == literal) {
+ *result = OnTBTClientStateID;
+ return true;
+ }
+
+ if ("OnDriverDistraction" == literal) {
+ *result = OnDriverDistractionID;
+ return true;
+ }
+
+ if ("OnPermissionsChange" == literal) {
+ *result = OnPermissionsChangeID;
+ return true;
+ }
+
+ if ("OnAudioPassThru" == literal) {
+ *result = OnAudioPassThruID;
+ return true;
+ }
+
+ if ("OnLanguageChange" == literal) {
+ *result = OnLanguageChangeID;
+ return true;
+ }
+
+ if ("OnKeyboardInput" == literal) {
+ *result = OnKeyboardInputID;
+ return true;
+ }
+
+ if ("OnTouchEvent" == literal) {
+ *result = OnTouchEventID;
+ return true;
+ }
+
+ if ("OnSystemRequest" == literal) {
+ *result = OnSystemRequestID;
+ return true;
+ }
+
+ if ("OnHashChange" == literal) {
+ *result = OnHashChangeID;
+ return true;
+ }
+
+ if ("OnInteriorVehicleData" == literal) {
+ *result = OnInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("OnWayPointChange" == literal) {
+ *result = OnWayPointChangeID;
+ return true;
+ }
+
+ if ("OnRCStatus" == literal) {
+ *result = OnRCStatusID;
+ return true;
+ }
+
+ if ("EncodedSyncPData" == literal) {
+ *result = EncodedSyncPDataID;
+ return true;
+ }
+
+ if ("SyncPData" == literal) {
+ *result = SyncPDataID;
+ return true;
+ }
+
+ if ("OnEncodedSyncPData" == literal) {
+ *result = OnEncodedSyncPDataID;
+ return true;
+ }
+
+ if ("OnSyncPData" == literal) {
+ *result = OnSyncPDataID;
+ return true;
+ }
+ return false;
+};
+
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
const std::string kDeviceApp = "device";
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
index ade76399fc..5922a020e6 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -238,18 +238,21 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, nicknames(impl::ValueMember(value__, "nicknames"))
, AppHMIType(impl::ValueMember(value__, "AppHMIType"))
, RequestType(impl::ValueMember(value__, "RequestType"))
+ , RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
- , heart_beat_timeout_ms(
- impl::ValueMember(value__, "heart_beat_timeout_ms")) {}
+ , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
impl::WriteJsonField("nicknames", nicknames, &result__);
impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("RequestSubType", RequestSubType, &result__);
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
+ impl::WriteJsonField("moduleType", moduleType, &result__);
return result__;
}
@@ -271,7 +274,9 @@ bool ApplicationParams::is_valid() const {
if (!heart_beat_timeout_ms.is_valid()) {
return false;
}
-
+ if (!moduleType.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -292,12 +297,18 @@ bool ApplicationParams::struct_empty() const {
if (RequestType.is_initialized()) {
return false;
}
+ if (RequestSubType.is_initialized()) {
+ return false;
+ }
if (memory_kb.is_initialized()) {
return false;
}
if (heart_beat_timeout_ms.is_initialized()) {
return false;
}
+ if (moduleType.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -321,6 +332,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!RequestType.is_valid()) {
RequestType.ReportErrors(&report__->ReportSubobject("RequestType"));
}
+ if (!RequestSubType.is_valid()) {
+ RequestSubType.ReportErrors(&report__->ReportSubobject("RequestSubType"));
+ }
if (!priority.is_valid()) {
priority.ReportErrors(&report__->ReportSubobject("priority"));
}
@@ -340,14 +354,19 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
heart_beat_timeout_ms.ReportErrors(
&report__->ReportSubobject("heart_beat_timeout_ms"));
}
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
PolicyBase::SetPolicyTableType(pt_type);
AppHMIType.SetPolicyTableType(pt_type);
RequestType.SetPolicyTableType(pt_type);
+ RequestSubType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
+ moduleType.SetPolicyTableType(pt_type);
}
// RpcParameters methods
@@ -422,12 +441,22 @@ 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")) {}
+ , 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__;
}
@@ -438,6 +467,12 @@ bool Rpcs::is_valid() const {
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();
}
@@ -452,7 +487,12 @@ bool Rpcs::struct_empty() const {
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;
}
@@ -467,12 +507,24 @@ void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
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
@@ -517,7 +569,9 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
, vehicle_year(impl::ValueMember(value__, "vehicle_year"))
, preloaded_date(impl::ValueMember(value__, "preloaded_date"))
, certificate(impl::ValueMember(value__, "certificate"))
- , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {}
+ , preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , full_app_id_supported(
+ impl::ValueMember(value__, "full_app_id_supported")) {}
void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
exchange_after_x_days = from.exchange_after_x_days;
@@ -540,6 +594,8 @@ Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -570,6 +626,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -620,6 +679,9 @@ bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
}
+ if (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -655,7 +717,6 @@ bool ModuleConfig::struct_empty() const {
if (vehicle_year.is_initialized()) {
return false;
}
-
return true;
}
@@ -669,6 +730,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -705,35 +770,30 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
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()) {
- rpc::ValidationReport& vehicle_make_omitted_field_report =
- report__->ReportSubobject("vehicle_make");
- vehicle_make_omitted_field_report.set_validation_info(validation_info);
+ omitted_field_report = &report__->ReportSubobject("vehicle_make");
+ omitted_field_report->set_validation_info(validation_info);
}
if (vehicle_year.is_initialized()) {
- rpc::ValidationReport& vehicle_year_omitted_field_report =
- report__->ReportSubobject("vehicle_year");
- vehicle_year_omitted_field_report.set_validation_info(validation_info);
+ omitted_field_report = &report__->ReportSubobject("vehicle_year");
+ omitted_field_report->set_validation_info(validation_info);
}
if (vehicle_model.is_initialized()) {
- rpc::ValidationReport& vehicle_model_omitted_field_report =
- report__->ReportSubobject("vehicle_model");
- vehicle_model_omitted_field_report.set_validation_info(validation_info);
+ omitted_field_report = &report__->ReportSubobject("vehicle_model");
+ omitted_field_report->set_validation_info(validation_info);
}
-
break;
}
case PT_UPDATE: {
if (preloaded_pt.is_initialized()) {
- rpc::ValidationReport& preloaded_pt_omitted_field_report =
- report__->ReportSubobject("preloaded_pt");
- preloaded_pt_omitted_field_report.set_validation_info(validation_info);
+ 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 =
@@ -751,6 +811,7 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
@@ -864,7 +925,7 @@ void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
}
// MessageLanguages methods
-const std::string MessageLanguages::kMandatoryLanguage_("en-us");
+const std::string MessageLanguages::default_language_("en-us");
MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
@@ -888,7 +949,7 @@ bool MessageLanguages::is_valid() const {
return false;
}
// Each RPC must have message in english
- if (languages.end() == languages.find(kMandatoryLanguage_)) {
+ if (languages.end() == languages.find(default_language_)) {
return false;
}
return Validate();
@@ -921,9 +982,10 @@ void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const {
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");
+ if (languages.end() == languages.find(default_language_)) {
+ report__->set_validation_info(
+ "this message does not support the default language '" +
+ default_language_ + "'");
}
}
@@ -984,6 +1046,9 @@ void ConsumerFriendlyMessages::ReportErrors(
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 =
@@ -993,9 +1058,6 @@ void ConsumerFriendlyMessages::ReportErrors(
.set_validation_info(validation_info);
}
}
- if (!version.is_valid()) {
- version.ReportErrors(&report__->ReportSubobject("version"));
- }
if (!messages.is_valid()) {
messages.ReportErrors(&report__->ReportSubobject("messages"));
}
@@ -1557,19 +1619,29 @@ void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType pt_type) {
}
// ConsentRecords methods
-ConsentRecords::ConsentRecords() : CompositeType(kUninitialized) {}
+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")) {}
+ , 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__;
@@ -1577,11 +1649,14 @@ Json::Value ConsentRecords::ToJsonValue() const {
bool ConsentRecords::is_valid() const {
if (struct_empty()) {
- return initialization_state__ == kInitialized && Validate();
+ 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;
}
@@ -1599,6 +1674,10 @@ 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;
}
@@ -1606,6 +1685,7 @@ bool ConsentRecords::struct_empty() const {
if (time_stamp.is_initialized()) {
return false;
}
+
return true;
}
@@ -1616,6 +1696,10 @@ void ConsentRecords::ReportErrors(rpc::ValidationReport* report__) const {
if (!consent_groups.is_valid()) {
consent_groups.ReportErrors(&report__->ReportSubobject("consent_groups"));
}
+ if (!external_consent_status_groups.is_valid()) {
+ external_consent_status_groups.ReportErrors(
+ &report__->ReportSubobject("external_consent_status_groups"));
+ }
if (!input.is_valid()) {
input.ReportErrors(&report__->ReportSubobject("input"));
}
@@ -1627,6 +1711,7 @@ void ConsentRecords::ReportErrors(rpc::ValidationReport* report__) const {
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);
}
@@ -2023,5 +2108,63 @@ 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
index 8852070a91..9b227615d8 100644
--- a/src/components/policy/policy_external/src/policy_table/validation.cc
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -42,8 +42,13 @@ bool VerifyPredefinedApp(ApplicationPolicies::value_type& app_policies) {
}
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 =
@@ -84,6 +89,7 @@ bool ApplicationPoliciesSection::Validate() const {
continue;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request Types...");
RequestTypes& app_request_types = *iter->second.RequestType;
if (app_request_types.is_omitted()) {
@@ -128,8 +134,66 @@ bool ApplicationPoliciesSection::Validate() const {
++iter;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request SubTypes...");
+ iter = apps.begin();
+ while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
+ ApplicationParams& app_params = (*iter).second;
+ const bool is_request_subtype_omitted =
+ !app_params.RequestSubType.is_initialized();
+
+ if (is_request_subtype_omitted) {
+ LOG4CXX_WARN(logger_,
+ "App policy RequestSubTypes omitted."
+ " Will be replaced with default.");
+ app_params.RequestSubType = apps[kDefaultApp].RequestSubType;
+ ++iter;
+ continue;
+ }
+
+ const bool is_request_subtype_empty = app_params.RequestSubType->empty();
+ if (is_request_subtype_empty) {
+ LOG4CXX_WARN(logger_, "App policy RequestSubTypes empty.");
+ }
+ ++iter;
+ }
+
+ return true;
+}
+
+bool ApplicationParams::ValidateModuleTypes() const {
+ // moduleType is optional so see Optional<T>::is_valid()
+ bool is_initialized = moduleType->is_initialized();
+ if (!is_initialized) {
+ // valid if not initialized
+ return true;
+ }
+ bool is_valid = moduleType->is_valid();
+ if (is_valid) {
+ return true;
+ }
+
+ struct IsInvalid {
+ bool operator()(Enum<ModuleType> item) const {
+ return !item.is_valid();
+ }
+ };
+ // cut invalid items
+ moduleType->erase(
+ std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()),
+ moduleType->end());
+ bool empty = moduleType->empty();
+ if (empty) {
+ // set non initialized value
+ ModuleTypes non_initialized;
+ moduleType = Optional<ModuleTypes>(non_initialized);
+ }
return true;
}
+
bool ApplicationParams::Validate() const {
if (is_initialized()) {
if (preconsented_groups.is_initialized()) {
@@ -140,8 +204,9 @@ bool ApplicationParams::Validate() const {
}
}
}
- return true;
+ return ValidateModuleTypes();
}
+
bool RpcParameters::Validate() const {
return true;
}
@@ -172,6 +237,19 @@ bool ModuleConfig::Validate() const {
default:
break;
}
+
+ for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin();
+ it_endpoints != endpoints.end();
+ ++it_endpoints) {
+ const URLList& endpoint_list = it_endpoints->second;
+ if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) {
+ LOG4CXX_ERROR(logger_,
+ "Endpoint " << it_endpoints->first
+ << "does not contain default group");
+ return false;
+ }
+ }
+
return true;
}
@@ -209,18 +287,38 @@ bool UsageAndErrorCounts::Validate() const {
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 {
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
+ 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;
}
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
index 4a69aaf44f..afb1180692 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
@@ -85,6 +85,9 @@ 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";
@@ -133,8 +136,14 @@ const std::string kInsertDeviceData =
const std::string kInsertConsentGroups =
"INSERT OR REPLACE INTO `consent_group` "
"(`device_id`, `application_id`, `functional_group_id`, `is_consented`, "
- "`input`, `time_stamp`) "
- "VALUES (?,?,?,?,?,?)";
+ "`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 "
@@ -263,5 +272,28 @@ const std::string kHasMsgLanguageCode =
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
index dda00af168..248372beff 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
@@ -563,17 +563,26 @@ bool SQLPTExtRepresentation::GatherConsumerFriendlyMessages(
msg.message_code = query.GetString(7);
std::string language = query.GetString(6);
-
- *(*messages->messages)[msg.message_code].languages[language].tts =
- msg.tts;
- *(*messages->messages)[msg.message_code].languages[language].label =
- msg.label;
- *(*messages->messages)[msg.message_code].languages[language].line1 =
- msg.line1;
- *(*messages->messages)[msg.message_code].languages[language].line2 =
- msg.line2;
- *(*messages->messages)[msg.message_code].languages[language].textBody =
- msg.text_body;
+ 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.");
@@ -661,6 +670,11 @@ bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request subtype.");
+ return false;
+ }
+
// First, all predefined apps (e.g. default, pre_DataConsent) should be saved,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -704,18 +718,17 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SetDefaultPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
} else if (kPreDataConsentId.compare(app.second.get_string()) == 0) {
if (!SetPredataPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
}
-
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
// Stop saving other params, since predefined permissions already set
return true;
}
@@ -748,6 +761,13 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -762,6 +782,10 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
+
return true;
}
@@ -853,6 +877,17 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
@@ -862,6 +897,9 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
if (!GatherRequestType(app_id, &*params.RequestType)) {
return false;
}
+ if (!GatherRequestSubType(app_id, &*params.RequestSubType)) {
+ return false;
+ }
GatherPreconsentedGroup(app_id, &*params.preconsented_groups);
(*policies).apps[app_id] = params;
}
@@ -1009,6 +1047,33 @@ void SQLPTExtRepresentation::GatherConsentGroup(
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);
}
}
@@ -1116,6 +1181,7 @@ bool SQLPTExtRepresentation::SaveConsentGroup(
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 "
@@ -1129,6 +1195,38 @@ bool SQLPTExtRepresentation::SaveConsentGroup(
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;
@@ -1454,13 +1552,23 @@ bool SQLPTExtRepresentation::SaveMessageString(
return false;
}
- query.Bind(0, *strings.tts);
- query.Bind(1, *strings.label);
- query.Bind(2, *strings.line1);
- query.Bind(3, *strings.line2);
+ 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);
- query.Bind(6, *strings.textBody);
+ if (strings.textBody.is_initialized()) {
+ query.Bind(6, *strings.textBody);
+ }
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into message.");
@@ -1768,6 +1876,58 @@ bool SQLPTExtRepresentation::SetVINValue(const std::string& value) {
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 {
diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc
index f40b31f83a..97d75731ea 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -83,6 +83,15 @@ const std::string kCreateSchema =
" `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 "
"); "
@@ -128,7 +137,7 @@ const std::string kCreateSchema =
"CREATE INDEX `rpc.select_rpc_name_hmi_level` "
" ON `rpc`(`name`,`hmi_level_value`);"
"CREATE TABLE IF NOT EXISTS `application`( "
- " `id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `keep_context` BOOLEAN, "
" `steal_focus` BOOLEAN, "
" `default_hmi` VARCHAR(45), "
@@ -138,6 +147,7 @@ const std::string kCreateSchema =
" `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`), "
@@ -150,7 +160,7 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx` "
" ON `application`(`priority_value`); "
"CREATE TABLE IF NOT EXISTS `app_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application1` "
@@ -165,9 +175,9 @@ const std::string kCreateSchema =
" ON `app_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`app_group.fk_application_has_functional_group_application1_idx` "
- " ON `app_group`(`application_id`); "
+ " ON `app_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `preconsented_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application2` "
@@ -183,7 +193,7 @@ const std::string kCreateSchema =
" ON `preconsented_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`preconsented_group.fk_application_has_functional_group_application2_idx` "
- " ON `preconsented_group`(`application_id`); "
+ " ON `preconsented_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `seconds_between_retry`( "
" `index` INTEGER PRIMARY KEY NOT NULL, "
" `value` INTEGER NOT NULL "
@@ -210,7 +220,7 @@ const std::string kCreateSchema =
"`device_consent_group.fk_device_has_functional_group_device1_idx` "
" ON `device_consent_group`(`device_id`); "
"CREATE TABLE IF NOT EXISTS `app_level`( "
- " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `minutes_in_hmi_full` INTEGER DEFAULT 0, "
" `minutes_in_hmi_limited` INTEGER DEFAULT 0, "
" `minutes_in_hmi_background` INTEGER DEFAULT 0, "
@@ -237,46 +247,55 @@ const std::string kCreateSchema =
" REFERENCES `language`(`code`) "
"); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx` "
- " ON `app_level`(`application_id`); "
+ " ON `app_level`(`application_id` COLLATE NOCASE); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx` "
" ON `app_level`(`app_registration_language_gui`); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx` "
" ON `app_level`(`app_registration_language_vui`); "
"CREATE TABLE IF NOT EXISTS `nickname`( "
- " `name` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `name` VARCHAR(100) NOT NULL COLLATE NOCASE, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_nickname_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx` "
- " ON `nickname`(`application_id`); "
+ " ON `nickname`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `app_type`( "
" `name` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE TABLE IF NOT EXISTS `request_type`( "
- " `request_type` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `request_type` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`request_type`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `request_subtype`( "
+ " `request_subtype` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`request_subtype`,`application_id`), "
+ " CONSTRAINT `fk_request_subtype_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
- " ON `app_type`(`application_id`); "
+ " ON `app_type`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
" `device_id` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" `is_consented` BOOL NOT NULL, "
" `input` VARCHAR(45), "
" `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`) "
@@ -288,6 +307,25 @@ const std::string kCreateSchema =
" FOREIGN KEY(`functional_group_id`) "
" REFERENCES `functional_group`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `external_consent_status_group`( "
+ " `device_id` VARCHAR(100) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `functional_group_id` INTEGER NOT NULL, "
+ " `is_consented` BOOL NOT NULL, "
+ " `input` VARCHAR(45), "
+ " `time_stamp` VARCHAR(45), "
+ " `last_updated` INTEGER, "
+ " PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`), "
+ " CONSTRAINT `fk_external_consent_status_group_device1` "
+ " FOREIGN KEY(`device_id`) "
+ " REFERENCES `device`(`id`), "
+ " CONSTRAINT `fk_external_consent_status_group_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`), "
+ " CONSTRAINT `fk_external_consent_status_group_functional_group1` "
+ " FOREIGN KEY(`functional_group_id`) "
+ " REFERENCES `functional_group`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS "
"`consent_group.fk_consent_group_device1_idx` "
" ON `device_consent_group`(`device_id`); "
@@ -295,15 +333,15 @@ const std::string kCreateSchema =
"`consent_group.fk_consent_group_functional_group1_idx` "
" ON `consent_group`(`functional_group_id`); "
"CREATE TABLE IF NOT EXISTS `endpoint`( "
- " `service` INTEGER NOT NULL, "
+ " `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" CONSTRAINT `fk_endpoint_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx` "
- " ON `endpoint`(`application_id`); "
+ " ON `endpoint`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `message`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
" `tts` TEXT, "
@@ -320,6 +358,39 @@ const std::string kCreateSchema =
" FOREIGN KEY(`message_type_name`) "
" REFERENCES `message_type`(`name`) "
"); "
+
+ /* access_module */
+ "CREATE TABLE `access_module`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(45) NOT NULL, "
+ " `user_consent_needed` INTEGER NOT NULL "
+ "); "
+
+ /* remote_rpc */
+ "CREATE TABLE `remote_rpc`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(255) NOT NULL, "
+ " `parameter` VARCHAR(45), "
+ " `module_id` INTEGER NOT NULL, "
+ "CONSTRAINT `fk_remote_rpc_1` "
+ " FOREIGN KEY(`module_id`) "
+ " REFERENCES `access_module`(`id`) "
+ "); "
+ "CREATE INDEX `remote_rpc.fk_remote_rpc_1_idx` ON "
+ "`remote_rpc`(`module_id`); "
+
+ /* module type */
+ "CREATE TABLE IF NOT EXISTS `module_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_module_type_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE INDEX IF NOT EXISTS `module_type.fk_module_type_application1_idx` "
+ " ON `module_type`(`application_id` COLLATE NOCASE); "
+
"CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx` "
" ON `message`(`language_code`);"
"CREATE INDEX IF NOT EXISTS "
@@ -328,6 +399,12 @@ const std::string kCreateSchema =
"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 =
@@ -357,8 +434,47 @@ const std::string kInsertInitData =
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
"";
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kUpdateRemoteControlDenied =
+ "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?";
+
+const std::string kDeleteAccessModules = "DELETE FROM `access_module`";
+
+const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`";
+
+const std::string kInsertAccessModule =
+ "INSERT INTO `access_module` (`name`, `user_consent_needed`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectAccessModules =
+ "SELECT `id`, `name` FROM `access_module` "
+ " WHERE `user_consent_needed` = ?";
+
+const std::string kInsertRemoteRpc =
+ "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectRemoteRpcs =
+ "SELECT `name`, `parameter` FROM `remote_rpc` "
+ " WHERE `module_id` = ?";
+
+const std::string kInsertModuleType =
+ "INSERT OR IGNORE INTO `module_type` (`application_id`, `name`) VALUES (?, "
+ "?)";
+
+const std::string kSelectModuleTypes =
+ "SELECT DISTINCT `name` FROM `module_type` WHERE `application_id` = ?";
+
const std::string kDropSchema =
"BEGIN; "
+ "DROP INDEX IF EXISTS `module_type.fk_module_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `module_type`; "
"DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; "
"DROP INDEX IF EXISTS "
"`message.fk_message_consumer_friendly_messages1_idx`; "
@@ -369,9 +485,12 @@ const std::string kDropSchema =
"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 TABLE IF EXISTS `request_subtype`; "
"DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
"DROP TABLE IF EXISTS `nickname`; "
"DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
@@ -392,6 +511,8 @@ const std::string kDropSchema =
"`preconsented_group.fk_application_has_functional_group_functional_group2_"
"idx`; "
"DROP TABLE IF EXISTS `preconsented_group`; "
+ "DROP TABLE IF EXISTS `access_module`; "
+ "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; "
"DROP INDEX IF EXISTS "
"`app_group.fk_application_has_functional_group_application1_idx`; "
"DROP INDEX IF EXISTS "
@@ -414,18 +535,24 @@ const std::string kDropSchema =
"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`; "
@@ -435,6 +562,7 @@ const std::string kDeleteData =
"DELETE FROM `app_group`; "
"DELETE FROM `application`; "
"DELETE FROM `rpc`; "
+ "DELETE FROM `access_module`; "
"DELETE FROM `version`; "
"DELETE FROM `message_type`; "
"DELETE FROM `language`; "
@@ -444,6 +572,7 @@ const std::string kDeleteData =
"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`; "
@@ -454,9 +583,6 @@ const std::string kCheckDBIntegrity = "PRAGMA integrity_check";
const std::string kCheckPgNumber = "PRAGMA page_count";
-const std::string kSelectLockScreenIcon =
- "SELECT `url` FROM `endpoint` WHERE `service` = ? AND `application_id` = ?";
-
const std::string kSelectRpc =
"SELECT DISTINCT `rpc`.`parameter` FROM `rpc` "
" JOIN `app_group` AS `g` ON (`g`.`functional_group_id` = "
@@ -479,6 +605,9 @@ const std::string kSetNotFirstRun =
const std::string kSelectEndpoint =
"SELECT `url`, `application_id` FROM `endpoint` WHERE `service` = ? ";
+const std::string kSelectLockScreenIcon =
+ "SELECT `url` FROM `endpoint` WHERE `service` = ? AND `application_id` = ?";
+
const std::string kInsertFunctionalGroup =
"INSERT INTO `functional_group` (`id`, `name`, `user_consent_prompt`) "
" VALUES (?, ?, ?)";
@@ -487,6 +616,11 @@ 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`) "
@@ -511,6 +645,11 @@ const std::string kInsertRequestType =
"INSERT OR IGNORE INTO `request_type` (`application_id`, `request_type`) "
"VALUES (?, ?)";
+const std::string kInsertRequestSubType =
+ "INSERT INTO `request_subtype` (`application_id`, "
+ "`request_subtype`) "
+ "VALUES (?, ?)";
+
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
const std::string kInsertMessageType =
@@ -529,7 +668,7 @@ const std::string kUpdateModuleConfig =
" `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
" `timeout_after_x_seconds` = ?, `vehicle_make` = ?, "
" `vehicle_model` = ?, `vehicle_year` = ?, `preloaded_date` = ?, "
- "`certificate` = ?";
+ " `certificate` = ? ";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
@@ -571,6 +710,9 @@ 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 =
@@ -601,6 +743,10 @@ 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`";
@@ -608,6 +754,8 @@ 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` "
@@ -626,6 +774,11 @@ const std::string kSelectRequestTypes =
"SELECT DISTINCT `request_type` FROM `request_type` WHERE `application_id` "
"= ?";
+const std::string kSelectRequestSubTypes =
+ "SELECT DISTINCT `request_subtype` FROM `request_subtype` WHERE "
+ "`application_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -671,6 +824,8 @@ const std::string kDeleteApplication = "DELETE FROM `application`";
const std::string kDeleteRequestType = "DELETE FROM `request_type`";
+const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 1e02685805..31c69e3725 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -43,6 +43,7 @@
#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"
@@ -52,6 +53,8 @@ namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+namespace dbms = utils::dbms;
+
namespace {
template <typename T, typename K>
void InsertUnique(K value, T* array) {
@@ -69,6 +72,10 @@ 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()
@@ -217,8 +224,7 @@ int SQLPTRepresentation::DaysBeforeExchange(uint16_t current) {
return limit;
}
- if (limit < 0 || last < 0 || current < 0 || current < last ||
- limit < (current - last)) {
+ if (limit < 0 || last < 0 || current < last || limit < (current - last)) {
return 0;
}
@@ -229,10 +235,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -507,10 +513,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -553,10 +559,10 @@ void SQLPTRepresentation::GatherModuleConfig(
LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
} else {
while (endpoints.Next()) {
- std::stringstream stream;
- stream << "0x0" << endpoints.GetInteger(1);
- config->endpoints[stream.str()][endpoints.GetString(2)].push_back(
- endpoints.GetString(0));
+ 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);
}
}
@@ -617,19 +623,32 @@ bool SQLPTRepresentation::GatherFunctionalGroupings(
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);
}
- int func_id = func_group.GetInteger(0);
- rpcs.Bind(0, func_id);
+
+ const int group_id = func_group.GetInteger(0);
+
+ rpcs.Bind(0, group_id);
+
while (rpcs.Next()) {
if (!rpcs.IsNull(1)) {
policy_table::HmiLevel level;
@@ -650,10 +669,30 @@ bool SQLPTRepresentation::GatherFunctionalGroupings(
}
}
}
+
+ rpcs.Reset();
+
if (!rpcs_tbl.rpcs.is_initialized()) {
rpcs_tbl.rpcs.set_to_null();
}
- rpcs.Reset();
+
+ // 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;
@@ -667,7 +706,21 @@ bool SQLPTRepresentation::GatherConsumerFriendlyMessages(
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;
}
@@ -711,6 +764,17 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
@@ -720,6 +784,9 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherRequestType(app_id, &*params.RequestType)) {
return false;
}
+ if (!GatherRequestSubType(app_id, &*params.RequestSubType)) {
+ return false;
+ }
(*policies).apps[app_id] = params;
}
@@ -772,32 +839,38 @@ bool SQLPTRepresentation::SaveFunctionalGroupings(
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 it;
+ policy_table::FunctionalGroupings::const_iterator groups_it;
- for (it = groups.begin(); it != groups.end(); ++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(it->first));
+ 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, it->first);
- it->second.user_consent_prompt.is_initialized()
- ? query.Bind(2, *(it->second.user_consent_prompt))
+ 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()) {
@@ -805,10 +878,27 @@ bool SQLPTRepresentation::SaveFunctionalGroupings(
return false;
}
- if (!SaveRpcs(query.LastInsertId(), it->second.rpcs)) {
+ 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;
}
@@ -877,6 +967,7 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
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;
@@ -957,6 +1048,13 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -1075,15 +1173,59 @@ bool SQLPTRepresentation::SaveRequestType(
}
policy_table::RequestTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ LOG4CXX_WARN(logger_, "Request types not empty.");
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request types empty.");
query.Bind(0, app_id);
- query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::RequestType::RT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
return false;
}
}
+ return true;
+}
+bool SQLPTRepresentation::SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for request subtypes.");
+ return false;
+ }
+
+ policy_table::Strings::const_iterator it;
+ if (!request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_, "Request subtypes are not empty.");
+ for (it = request_subtypes.begin(); it != request_subtypes.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
+ } else if (request_subtypes.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request subtypes empty.");
+ query.Bind(0, app_id);
+ query.Bind(1, std::string("EMPTY"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
return true;
}
@@ -1162,11 +1304,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints(
const policy_table::URL& urls = app_it->second;
policy_table::URL::const_iterator url_it;
for (url_it = urls.begin(); url_it != urls.end(); ++url_it) {
- std::stringstream temp_stream(it->first);
- int service;
- temp_stream.seekg(3);
- temp_stream >> service;
- query.Bind(0, service);
+ query.Bind(0, it->first);
query.Bind(1, *url_it);
query.Bind(2, app_it->first);
if (!query.Exec() || !query.Reset()) {
@@ -1187,44 +1325,48 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
// 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 (!messages.messages.is_initialized()) {
+ LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty");
+ return true;
+ }
- 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.");
+ utils::dbms::SQLQuery query(db());
+ bool delete_query_exec_result = true;
+ if (!messages.messages->empty()) {
+ delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString);
+ }
+
+ if (!delete_query_exec_result) {
+ LOG4CXX_WARN(logger_, "Failed to delete messages from DB.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kUpdateVersion)) {
+ LOG4CXX_WARN(logger_, "Invalid update messages version statement.");
+ return false;
+ }
+
+ query.Bind(0, messages.version);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update messages version number in DB.");
+ return false;
+ }
+
+ policy_table::Messages::const_iterator it;
+ for (it = messages.messages->begin(); it != messages.messages->end(); ++it) {
+ if (!SaveMessageType(it->first)) {
return false;
}
-
- 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)) {
+ 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;
}
- 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;
- }
+ if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) {
+ return false;
}
}
- } else {
- LOG4CXX_INFO(logger_, "Messages list is empty");
}
return true;
@@ -1418,6 +1560,12 @@ bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id,
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));
@@ -1428,6 +1576,12 @@ bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id,
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;
}
@@ -1471,11 +1625,36 @@ bool SQLPTRepresentation::GatherRequestType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::RequestType::RT_EMPTY == type) {
+ request_types->mark_initialized();
+ continue;
+ }
request_types->push_back(type);
}
return true;
}
+bool SQLPTRepresentation::GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRequestSubTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from request subtypes.");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ const std::string request_subtype = query.GetString(0);
+ if ("EMPTY" == request_subtype) {
+ request_subtypes->mark_initialized();
+ continue;
+ }
+ request_subtypes->push_back(request_subtype);
+ }
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -1506,6 +1685,212 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
+bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
+ bool* denied) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect select remote control flag");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (query.Next()) {
+ *denied = query.GetBoolean(0);
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherModuleType(
+ const std::string& app_id, policy_table::ModuleTypes* app_types) const {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::ModuleType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id,
+ bool deny) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny);
+ query.Bind(0, deny);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update remote control flag.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveModuleType(
+ const std::string& app_id, const policy_table::ModuleTypes& types) {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertModuleType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for module type");
+ return false;
+ }
+
+ policy_table::ModuleTypes::const_iterator it;
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ query.Bind(0, app_id);
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAccessModule(
+ TypeAccess access, const policy_table::AccessModules& modules) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAccessModule)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for access module");
+ return false;
+ }
+
+ policy_table::AccessModules::const_iterator i;
+ for (i = modules.begin(); i != modules.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ query.Bind(0, name);
+ query.Bind(1, access);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into access module.");
+ return false;
+ }
+ int id = query.LastInsertId();
+ if (!query.Reset()) {
+ LOG4CXX_WARN(logger_, "Couldn't reset query access module.");
+ return false;
+ }
+ if (!SaveRemoteRpc(id, rpcs)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAccessModule(
+ TypeAccess access, policy_table::AccessModules* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAccessModules)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from access module");
+ return false;
+ }
+
+ query.Bind(0, access);
+ while (query.Next()) {
+ int id = query.GetInteger(0);
+ std::string name = query.GetString(1);
+ policy_table::RemoteRpcs rpcs;
+ if (!GatherRemoteRpc(id, &rpcs)) {
+ return false;
+ }
+ modules->insert(std::make_pair(name, rpcs));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteRpc(int module_id,
+ const policy_table::RemoteRpcs& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRemoteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc");
+ return false;
+ }
+ policy_table::RemoteRpcs::const_iterator i;
+ for (i = rpcs.begin(); i != rpcs.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::Strings& params = i->second;
+ policy_table::Strings::const_iterator j;
+ if (params.empty()) {
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ } else {
+ for (j = params.begin(); j != params.end(); ++j) {
+ const std::string& param = *j;
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2, param);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRemoteRpc(
+ int module_id, policy_table::RemoteRpcs* rpcs) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from remote rpc");
+ return false;
+ }
+
+ query.Bind(0, module_id);
+ while (query.Next()) {
+ std::string name = query.GetString(0);
+ if (!query.IsNull(1)) {
+ std::string parameter = query.GetString(1);
+ (*rpcs)[name].push_back(parameter);
+ } else {
+ rpcs->insert(std::make_pair(name, policy_table::Strings()));
+ }
+ }
+ return true;
+}
+
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
bool is_default,
@@ -1597,9 +1982,28 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
SetPreloaded(false);
+ policy_table::RequestTypes request_types;
+ if (!GatherRequestType(kDefaultId, &request_types) ||
+ !SaveRequestType(app_id, request_types)) {
+ return false;
+ }
+
+ policy_table::Strings request_subtypes;
+ if (!GatherRequestSubType(kDefaultId, &request_subtypes) ||
+ !SaveRequestSubType(app_id, request_subtypes)) {
+ return false;
+ }
+
+ policy_table::AppHMITypes app_types;
+ if (!GatherAppType(kDefaultId, &app_types) ||
+ !SaveAppType(app_id, app_types)) {
+ return false;
+ }
+
policy_table::Strings default_groups;
- if (GatherAppGroup(kDefaultId, &default_groups) &&
- SaveAppGroup(app_id, default_groups)) {
+ bool ret = (GatherAppGroup(kDefaultId, &default_groups) &&
+ SaveAppGroup(app_id, default_groups));
+ if (ret) {
return SetIsDefault(app_id, true);
}
return false;
@@ -1741,4 +2145,38 @@ 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
index 31fc7f110b..c2ee4e4bbc 100644
--- a/src/components/policy/policy_external/src/status.cc
+++ b/src/components/policy/policy_external/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {}
@@ -45,7 +44,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManager* manager,
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,14 +58,14 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManager* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
default:
break;
@@ -85,23 +84,23 @@ void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager,
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc
index 78cafa044c..b352b5ea39 100644
--- a/src/components/policy/policy_external/src/update_status_manager.cc
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,8 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
+ , last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {
update_status_thread_delegate_ = new UpdateThreadDelegate(this);
@@ -66,11 +66,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -118,24 +118,27 @@ void UpdateStatusManager::OnResetRetrySequence() {
ProcessEvent(kOnResetRetrySequence);
}
+void UpdateStatusManager::OnExistedApplicationAdded(
+ const bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
LOG4CXX_AUTO_TRACE(logger_);
if (kDeviceAllowed != consent) {
+ LOG4CXX_DEBUG(logger_, "Application registered from non-consented device");
app_registered_from_non_consented_device_ = true;
return;
}
+ LOG4CXX_DEBUG(logger_, "Application registered from consented device");
app_registered_from_non_consented_device_ = false;
ProcessEvent(kOnNewAppRegistered);
}
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_update_required) {
- current_status_.reset(new UpToDateStatus());
- ProcessEvent(kScheduleUpdate);
- }
-}
-
void UpdateStatusManager::OnDeviceConsented() {
LOG4CXX_AUTO_TRACE(logger_);
if (app_registered_from_non_consented_device_) {
@@ -209,7 +212,6 @@ UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(
UpdateStatusManager* update_status_manager)
: timeout_(0)
, stop_flag_(false)
- , state_lock_(true)
, update_status_manager_(update_status_manager) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate");
diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc
index 661ea29704..d46f6a315a 100644
--- a/src/components/policy/policy_external/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -53,7 +53,7 @@ void GlobalCounter::operator++() const {
}
AppCounter::AppCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -67,7 +67,7 @@ void AppCounter::operator++() const {
}
AppInfo::AppInfo(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -81,7 +81,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -92,7 +92,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -107,8 +107,7 @@ AppStopwatchImpl::~AppStopwatchImpl() {}
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc
index 90f247de31..22b19c878e 100644
--- a/src/components/policy/policy_external/test/counter_test.cc
+++ b/src/components/policy/policy_external/test/counter_test.cc
@@ -28,6 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "gtest/gtest.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/counter.h"
@@ -45,7 +46,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -59,7 +60,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -74,7 +75,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -88,7 +89,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -102,7 +103,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -115,7 +116,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -130,7 +131,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -145,7 +146,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -161,7 +162,7 @@ TEST(
StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_external/test/generated_code_test.cc b/src/components/policy/policy_external/test/generated_code_test.cc
index 2704f03c6a..15d14e3e3b 100644
--- a/src/components/policy/policy_external/test/generated_code_test.cc
+++ b/src/components/policy/policy_external/test/generated_code_test.cc
@@ -135,6 +135,94 @@ TEST(PolicyGeneratedCodeTest, IntegerConstructionAndAssignmentTest) {
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/mock_access_remote.h b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h
new file mode 100644
index 0000000000..486c27590d
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+
+#include "gmock/gmock.h"
+#include "policy/access_remote.h"
+
+namespace test {
+namespace components {
+namespace access_remote_test {
+
+class MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ policy::FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(CheckModuleType,
+ bool(const policy::PTString& app_id,
+ policy_table::ModuleType module));
+ MOCK_METHOD1(IsAppRemoteControl,
+ bool(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+};
+
+} // namespace access_remote_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h
new file mode 100644
index 0000000000..397201ce40
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h
@@ -0,0 +1,53 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
+
+#include "gmock/gmock.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+class MockAppStopwatch : public usage_statistics::AppStopwatch {
+ public:
+ MOCK_METHOD1(Start, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD1(Switch, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD0(WriteTime, void());
+};
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h b/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h
deleted file mode 100644
index 7d37260ef7..0000000000
--- a/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h
+++ /dev/null
@@ -1,241 +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_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_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_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_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));
-};
-
-} // 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
index 2dda69bd73..3225e79e01 100644
--- 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
@@ -137,6 +137,9 @@ class MockPTExtRepresentation : public MockPTRepresentation,
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
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
index 995c63ed20..3870e4ece1 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
@@ -78,7 +78,7 @@ class MockPTRepresentation : virtual public ::policy::PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
index a1c808d23a..662632fc59 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
@@ -33,7 +33,6 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_
#include "gmock/gmock.h"
-
#include "policy/update_status_manager.h"
namespace test {
@@ -49,8 +48,8 @@ class MockUpdateStatusManager : public ::policy::UpdateStatusManager {
MOCK_METHOD0(OnWrongUpdateReceived, void());
MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required));
MOCK_METHOD1(OnNewApplicationAdded, void(const DeviceConsent));
- MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
};
diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
index e0fc308cbc..23701e86de 100644
--- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
+++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
@@ -54,7 +54,7 @@ using ::policy::PolicyManagerImpl;
typedef std::multimap<std::string, policy_table::Rpcs&>
UserConsentPromptToRpcsConnections;
-typedef utils::SharedPtr<policy_table::Table> PolicyTableSPtr;
+typedef std::shared_ptr<policy_table::Table> PolicyTableSPtr;
namespace {
const std::string kSdlPreloadedPtJson = "json/sdl_preloaded_pt.json";
@@ -66,10 +66,12 @@ 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 {
@@ -84,6 +86,7 @@ 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) {
@@ -108,7 +111,7 @@ class PolicyManagerImplTest : public ::testing::Test {
protected:
const std::string unpaired_device_id_;
- PolicyManagerImpl* manager_;
+ PolicyManagerImpl* policy_manager_;
MockCacheManagerInterface* cache_manager_;
MockUpdateStatusManager update_manager_;
NiceMock<MockPolicyListener> listener_;
@@ -132,10 +135,10 @@ class PolicyManagerImplTest2 : public ::testing::Test {
const std::string device_id_2_;
const std::string application_id_;
const std::string app_storage_folder_;
- const std::string preloadet_pt_filename_;
+ const std::string preloaded_pt_filename_;
const bool in_memory_;
- PolicyManagerImpl* manager_;
+ PolicyManagerImpl* policy_manager_;
NiceMock<MockPolicyListener> listener_;
::policy::StringArray hmi_level_;
::policy::StringArray pt_request_types_;
@@ -188,11 +191,38 @@ class PolicyManagerImplTest2 : public ::testing::Test {
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);
+
+ std::shared_ptr<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 {
@@ -204,9 +234,9 @@ class PolicyManagerImplTest_RequestTypes : public ::testing::Test {
const std::string kAppId;
const std::string kDefaultAppId;
const std::string app_storage_folder_;
- const std::string preloadet_pt_filename_;
+ const std::string preloaded_pt_filename_;
- utils::SharedPtr<PolicyManagerImpl> policy_manager_impl_sptr_;
+ std::shared_ptr<PolicyManagerImpl> policy_manager_impl_sptr_;
NiceMock<MockPolicyListener> listener_;
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
@@ -238,6 +268,37 @@ class PolicyManagerImplTest_RequestTypes : public ::testing::Test {
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
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
index 7316c7539d..4cd71d6004 100644
--- a/src/components/policy/policy_external/test/json/PTU.json
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
index c1a6bccb68..9c9436144e 100644
--- a/src/components/policy/policy_external/test/json/PTU2.json
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
index 56939a789a..279051e7bf 100644
--- a/src/components/policy/policy_external/test/json/PTU3.json
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -472,12 +476,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -493,12 +500,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -514,12 +524,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -534,12 +547,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app.json b/src/components/policy/policy_external/test/json/PTU_default_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
index 1e5b1c46a4..49ed46f16c 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -293,7 +293,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
index 76365ee4bb..66af76309a 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
index b380fa2de5..0a7c059097 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -289,7 +289,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
index b8793b6cdc..08f12a21c8 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
index 8a183b45d5..6aeb637503 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
index 6ffc42c3e4..8c68aaeb89 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -291,7 +291,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
index 24d0871d18..0ae0761f27 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -283,7 +283,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
index b674913268..6b170089fe 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
index 7e0836a805..08027f2786 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1592,12 +1596,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1607,12 +1614,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1622,12 +1632,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1636,12 +1649,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1703,7 +1719,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
index a056c3ce9c..a88bcfbd08 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1441,6 +1441,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1453,6 +1454,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1465,6 +1467,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1477,6 +1480,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1595,12 +1599,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1610,12 +1617,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1625,12 +1635,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1639,12 +1652,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1706,7 +1722,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
index c7e0a727fe..250bfb21f2 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1592,12 +1596,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1607,12 +1614,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1622,12 +1632,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1636,12 +1649,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1703,7 +1719,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
index a96ef74bd1..85910c098c 100644
--- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1437,6 +1437,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1449,6 +1450,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1461,6 +1463,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1473,6 +1476,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1591,12 +1595,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1606,12 +1613,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1621,12 +1631,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1635,12 +1648,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1702,7 +1718,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
index 4c1bf19005..1c1b04ca2b 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
index 02801cc976..51690d7b8e 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
index a9abeea5a2..cfa6c4010c 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
index 899e58a68d..d7177f2251 100644
--- a/src/components/policy/policy_external/test/json/ptu2_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -484,12 +488,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -505,12 +512,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -526,12 +536,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -546,12 +559,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2594,7 +2610,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context" : false,
"steal_focus" : false,
"priority"
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
index a1f085ac74..6a531dd2ad 100644
--- a/src/components/policy/policy_external/test/json/ptu_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2553,7 +2569,7 @@
}
},
"app_policies": {
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
index 78c5f873d9..a4491fd449 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -2051,6 +2051,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2065,6 +2066,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2079,6 +2081,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2093,6 +2096,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2308,12 +2312,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -2327,12 +2334,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -2346,12 +2356,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2364,12 +2377,15 @@
[
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2385,11 +2401,11 @@
{
"0x04" :
{
- "default" : [ "http://ivsu.software.ford.com/api/getsoftwareupdates" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/softwareUpdate" ]
},
"0x07" :
{
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 20,
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
index 49f9a1da3a..83c4ccf15c 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -484,12 +488,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -505,12 +512,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -526,12 +536,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -546,12 +559,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index e6817da0d3..7b882c6ceb 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index d5f5f480f3..7d90275328 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
index 5047d832dd..807b0eb312 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1593,12 +1597,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1608,12 +1615,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1623,12 +1633,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1637,12 +1650,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1704,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
index 18b0a09040..3d0a004dbe 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
index 3530c01388..6a36f1f9c5 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
index e169aea24a..3303d56844 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
index df45a0be61..e7a33ba2c0 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
index c471d6ec97..08739f9d6a 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
index 29781d211c..21396b8cac 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
index 91be06a561..5aa467a23c 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -483,12 +487,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -504,12 +511,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -525,12 +535,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -545,12 +558,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 56c728f104..5827ab287a 100644
--- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1585,12 +1589,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1600,12 +1607,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1615,12 +1625,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1629,12 +1642,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1696,7 +1712,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index aa5245825b..93d4e19751 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -38,6 +38,7 @@
#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"
@@ -52,134 +53,154 @@ using ::testing::Return;
using ::testing::ReturnRef;
TEST_F(PolicyManagerImplTest,
- TiggerPTUForNaviAppInCaseNoCertificateExistsInPolicyTable) {
+ DISABLED_TiggerPTUForNaviAppInCaseNoCertificateExistsInPolicyTable) {
EXPECT_CALL(*cache_manager_, GetDeviceConsent(_))
.WillOnce(Return(kDeviceAllowed));
- EXPECT_CALL(*cache_manager_, IsPredataPolicy(_)).WillOnce(Return(false));
- EXPECT_CALL(*cache_manager_, IsApplicationRepresented(_))
+ 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_, GetCertificate()).WillOnce(Return(""));
- EXPECT_CALL(*cache_manager_, AppHasHMIType(_, policy_table::AHT_NAVIGATION))
+ EXPECT_CALL(*cache_manager_, GetFunctionalGroupNames(_))
+ .WillOnce(Return(true))
.WillOnce(Return(true));
- EXPECT_EQ(manager_->GetPolicyTableStatus(), "UP_TO_DATE");
- manager_->AddApplication(kDefaultId);
- EXPECT_EQ(manager_->GetPolicyTableStatus(), "UPDATE_NEEDED");
-}
-TEST_F(PolicyManagerImplTest,
- TiggerPTUForNaviAppInCaseCertificateExistsInPolicyTable) {
- EXPECT_CALL(*cache_manager_, GetDeviceConsent(_))
- .WillOnce(Return(kDeviceAllowed));
+ 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_CALL(*cache_manager_, GetCertificate())
- .WillOnce(Return(
- "Any non empty string is ok here, "
- "because we check that field is not empty"));
-
- EXPECT_CALL(*cache_manager_, AppHasHMIType(_, policy_table::AHT_NAVIGATION))
- .Times(0);
- manager_->AddApplication(kDefaultId);
+ 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();
- manager_->ForcePTExchange();
- manager_->OnUpdateStarted();
+ 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(manager_->LoadPT(kFilePtUpdateJson, msg));
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
- std::string priority = "emergency";
- uint32_t notif_number = manager_->GetNotificationsNumber(priority);
+ std::string priority = "EMERGENCY";
+ uint32_t notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "navigation";
- notif_number = manager_->GetNotificationsNumber(priority);
+ priority = "NAVIGATION";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(2u, notif_number);
- priority = "emergency";
- notif_number = manager_->GetNotificationsNumber(priority);
+ priority = "EMERGENCY";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "VOICECOMM";
- notif_number = manager_->GetNotificationsNumber(priority);
+ priority = "VOICECOM";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(3u, notif_number);
- priority = "normal";
- notif_number = manager_->GetNotificationsNumber(priority);
+ priority = "NORMAL";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
EXPECT_EQ(5u, notif_number);
- priority = "none";
- notif_number = manager_->GetNotificationsNumber(priority);
+ 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() && reader.parse(ifile, root, true)) {
- root["policy_table"]["app_policies"][app_id_1_] = Json::nullValue;
- json = root.toStyledString();
+ 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(manager_->LoadPT(kFilePtUpdateJson, msg));
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
- EXPECT_TRUE(manager_->IsApplicationRevoked(app_id_1_));
+ 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_));
}
-TEST_F(
- PolicyManagerImplTest2,
- IsAppRevoked_ReregisterRevokedApp_OnHmiNotificationIsSentWithProperValues) {
+// Related to manual test APPLINK-18792
+TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
-
- manager_->AddApplication(app_id_1_);
-
- // Check RPC is allowed and OnHMIStatus is sent
- CheckRpcPermissions("OnHMIStatus", ::policy::kRpcAllowed);
+ CreateLocalPT(preloaded_pt_filename_);
+ EmulatePTAppRevoked(kPtu2Json);
- std::ifstream ifile(kValidSdlPtUpdateJson);
- 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_id_1_] = Json::nullValue;
- json = root.toStyledString();
- }
- ifile.close();
+ 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);
+}
- ::policy::BinaryMessage msg(json.begin(), json.end());
- ASSERT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
- EXPECT_TRUE(manager_->IsApplicationRevoked(app_id_1_));
+// Related to manual test APPLINK-18794
+TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered_HMIDefault) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ EmulatePTAppRevoked(kPtu2Json);
- // Re-register application
- manager_->AddApplication(app_id_1_);
- EXPECT_NE(typeid(utils::CallNothing),
- typeid(manager_->AddApplication(app_id_1_)));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
- // Check RPC is disallowed and OnHMIStatus is sent
- CheckRpcPermissions("OnHMIStatus", ::policy::kRpcDisallowed);
+ 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(preloadet_pt_filename_);
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ CreateLocalPT(preloaded_pt_filename_);
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
cache->AddDevice(device_id_1_, "Bluetooth");
cache->SetDeviceData(device_id_1_,
"hardware IPX",
@@ -191,9 +212,10 @@ TEST_F(PolicyManagerImplTest2,
"Bluetooth");
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
.WillRepeatedly(Return(device_id_1_));
- manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(app_id_1_);
+ 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);
@@ -204,7 +226,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
app_id_1_, kHmiLevelFull, "Alert", input_params, output);
// Check RPC is allowed
@@ -222,10 +244,10 @@ TEST_F(PolicyManagerImplTest2,
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
- ASSERT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ ASSERT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
app_id_1_, kHmiLevelFull, "Alert", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -235,9 +257,9 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
CheckPermissions_SetAppIDwithPolicies_ExpectRPCAllowed) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddDevice(device_id_1_, "Bluetooth");
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ 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",
@@ -249,9 +271,10 @@ TEST_F(PolicyManagerImplTest2,
"Bluetooth"));
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
.WillRepeatedly(Return(device_id_1_));
- manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(application_id_);
+ 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;
@@ -289,7 +312,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::BinaryMessage msg(json.begin(), json.end());
// Load Json to cache
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
policy_table::RpcParameters rpc_parameters;
@@ -311,7 +334,7 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth");
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "Alert", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -334,7 +357,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -344,7 +367,7 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -353,11 +376,11 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ 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());
@@ -365,7 +388,7 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -392,7 +415,7 @@ TEST_F(
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
// Group which has RPC does not require user consent, so its auto-allowed for
@@ -408,7 +431,7 @@ TEST_F(
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -420,11 +443,11 @@ TEST_F(
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -436,7 +459,7 @@ TEST_F(
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -467,7 +490,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -497,7 +520,7 @@ TEST_F(PolicyManagerImplTest2,
output.list_of_undefined_params.clear();
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -516,11 +539,11 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -536,7 +559,7 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -546,6 +569,34 @@ TEST_F(PolicyManagerImplTest2,
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://x.x.x.x:3000/api/1/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
@@ -581,7 +632,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -601,7 +652,7 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -621,11 +672,11 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ 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
@@ -645,7 +696,7 @@ TEST_F(PolicyManagerImplTest2,
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -664,8 +715,8 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
- manager_->AddDevice(device_id_1_, "Bluetooth");
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ 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",
@@ -676,7 +727,8 @@ TEST_F(PolicyManagerImplTest2,
"Bluetooth"));
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(application_id_);
+ 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;
@@ -688,7 +740,7 @@ TEST_F(PolicyManagerImplTest2,
json = root.toStyledString();
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
// Will be called each time permissions are checked
@@ -702,38 +754,38 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ 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());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -750,8 +802,8 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
- manager_->AddDevice(device_id_1_, "Bluetooth");
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ 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",
@@ -762,7 +814,8 @@ TEST_F(PolicyManagerImplTest2,
"Bluetooth"));
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(application_id_);
+ 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");
@@ -775,7 +828,7 @@ TEST_F(PolicyManagerImplTest2,
json = root.toStyledString();
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
// Will be called each time permissions are checked
@@ -789,36 +842,36 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
- 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());
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ 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());
@@ -828,8 +881,8 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest, LoadPT_SetInvalidUpdatePT_PTIsNotLoaded) {
// Arrange
- manager_->ForcePTExchange();
- manager_->OnUpdateStarted();
+ policy_manager_->ForcePTExchange();
+ policy_manager_->OnUpdateStarted();
Json::Value table(Json::objectValue);
policy_table::Table update(&table);
@@ -850,102 +903,108 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetInvalidUpdatePT_PTIsNotLoaded) {
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(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_CALL(*cache_manager_, IsPTPreloaded());
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
}
TEST_F(
PolicyManagerImplTest2,
AddApplication_AddExistingApplicationFromDeviceWithoutConsent_ExpectNoUpdateRequired) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
GetPTU(kValidSdlPtUpdateJson);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Try to add existing app
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check no update required
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
uint32_t GetCurrentDaysCount() {
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const uint32_t kSecondsInDay = 60 * 60 * 24;
- return current_time.tv_sec / kSecondsInDay;
+ return date_time::getSecs(current_time) / kSecondsInDay;
}
TEST_F(PolicyManagerImplTest2,
PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
const uint32_t days = GetCurrentDaysCount();
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
GetPTU(kValidSdlPtUpdateJson);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
- manager_->AddApplication(app_id_2_);
- EXPECT_EQ("UP_TO_DATE", 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
- manager_->PTUpdatedAt(counter, days - 10);
- manager_->OnAppRegisteredOnMobile(app_id_2_);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ 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(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
const uint32_t days = GetCurrentDaysCount();
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
GetPTU(kValidSdlPtUpdateJson);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
- manager_->AddApplication(app_id_2_);
- EXPECT_EQ("UP_TO_DATE", 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)
- manager_->PTUpdatedAt(counter, days - 50);
- manager_->OnAppRegisteredOnMobile(app_id_2_);
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ 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(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
const uint32_t days = GetCurrentDaysCount();
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
GetPTU(kValidSdlPtUpdateJson);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Try to add existing app
- manager_->AddApplication(app_id_2_);
- EXPECT_EQ("UP_TO_DATE", 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
- manager_->PTUpdatedAt(counter, days - 10);
- int ign_cycles = (manager_->GetCache())->IgnitionCyclesBeforeExchange();
+ 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) {
- manager_->IncrementIgnitionCycles();
+ policy_manager_->IncrementIgnitionCycles();
}
- manager_->OnAppRegisteredOnMobile(app_id_2_);
+ policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
// Check update required
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest2,
GetUserConsentForApp_SetUserConsentForApp_ExpectReceivedConsentCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -959,13 +1018,14 @@ TEST_F(PolicyManagerImplTest2,
::policy::StringArray disallowed_groups;
consented_groups.push_back(std::string("Notifications"));
consented_groups.push_back(std::string("Notifications"));
- (manager_->GetCache())
+ (policy_manager_->GetCache())
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -983,11 +1043,12 @@ TEST_F(PolicyManagerImplTest2,
groups_permissions.push_back(group1_perm);
perm_consent.group_permissions = groups_permissions;
- manager_->SetUserConsentForApp(perm_consent);
- manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ 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;
- manager_->GetUserConsentForApp(
+ policy_manager_->GetUserConsentForApp(
device_id_2_, app_id_2_, actual_groups_permissions);
uint32_t index = 0;
for (; index < actual_groups_permissions.size(); ++index) {
@@ -1007,31 +1068,34 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ 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(manager_->CanAppKeepContext(app_id_2_));
+ EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ 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(manager_->CanAppKeepContext(app_id_2_));
+ EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
GetVehicleInfo_SetVehicleInfo_ExpectReceivedInfoCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
GetPTU(kValidSdlPtUpdateJson);
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
- ::policy::VehicleInfo vehicle_info = manager_->GetVehicleInfo();
+ ::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo();
EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_make),
vehicle_info.vehicle_make);
@@ -1045,10 +1109,11 @@ TEST_F(
PolicyManagerImplTest2,
GetPermissionsForApp_SetUserConsentForApp_ExpectReceivedPermissionsCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -1061,13 +1126,14 @@ TEST_F(
::policy::StringArray consented_groups;
::policy::StringArray disallowed_groups;
consented_groups.push_back(std::string("Notifications"));
- (manager_->GetCache())
+ (policy_manager_->GetCache())
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -1085,11 +1151,12 @@ TEST_F(
groups_permissions.push_back(group1_perm);
perm_consent.group_permissions = groups_permissions;
- manager_->SetUserConsentForApp(perm_consent);
- manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ 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;
- manager_->GetPermissionsForApp(
+ policy_manager_->GetPermissionsForApp(
device_id_2_, app_id_2_, actual_groups_permissions);
uint32_t index = 0;
for (; index < actual_groups_permissions.size(); ++index) {
@@ -1110,17 +1177,19 @@ TEST_F(
PolicyManagerImplTest2,
GetAppRequestTypes_AddApp_UpdateAppPolicies_ExpectReceivedRequestTypesCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
- manager_->AddApplication(app_id_3_);
- ::policy::StringArray app_requests = manager_->GetAppRequestTypes(app_id_3_);
+ 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 = manager_->GetAppRequestTypes(app_id_3_);
+ 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) {
@@ -1132,8 +1201,9 @@ TEST_F(
PolicyManagerImplTest2,
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ CreateLocalPT(preloaded_pt_filename_);
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
pt->SetPolicyTableType(type1);
@@ -1144,8 +1214,9 @@ TEST_F(
pt->ReportErrors(&report);
}
// Add new app
- manager_->AddApplication(app_id_2_);
- uint32_t result = manager_->HeartBeatTimeout(app_id_2_);
+ 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);
@@ -1163,16 +1234,17 @@ TEST_F(
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 = manager_->HeartBeatTimeout(app_id_2_);
+ result = policy_manager_->HeartBeatTimeout(app_id_2_);
EXPECT_EQ(heart_beat_timeout.asUInt(), result);
}
TEST_F(PolicyManagerImplTest2,
RemoveAppConsentForGroup_SetUserConsentForApp_ExpectAppConsentDeleted) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -1185,13 +1257,14 @@ TEST_F(PolicyManagerImplTest2,
::policy::StringArray consented_groups;
::policy::StringArray disallowed_groups;
consented_groups.push_back(std::string("Notifications"));
- (manager_->GetCache())
+ (policy_manager_->GetCache())
->SetUserPermissionsForDevice(
device_id_2_, consented_groups, disallowed_groups);
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
GetPTU(kValidSdlPtUpdateJson);
::policy::PermissionConsent perm_consent;
@@ -1209,11 +1282,12 @@ TEST_F(PolicyManagerImplTest2,
groups_permissions.push_back(group1_perm);
perm_consent.group_permissions = groups_permissions;
- manager_->SetUserConsentForApp(perm_consent);
- manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ 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;
- manager_->GetPermissionsForApp(
+ policy_manager_->GetPermissionsForApp(
device_id_2_, app_id_2_, actual_groups_permissions);
uint32_t index = 0;
for (; index < actual_groups_permissions.size(); ++index) {
@@ -1228,7 +1302,8 @@ TEST_F(PolicyManagerImplTest2,
actual_groups_permissions[index].group_name);
EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
uint32_t ucr_size = 0;
::policy_table::DeviceData& device_data = *pt->policy_table.device_data;
::policy_table::DeviceData::const_iterator dev_data_iter =
@@ -1244,7 +1319,7 @@ TEST_F(PolicyManagerImplTest2,
if (ucr_iter != ucr.end()) {
EXPECT_TRUE((*(ucr_iter->second.consent_groups)).find("Notifications") !=
(*(ucr_iter->second.consent_groups)).end());
- manager_->RemoveAppConsentForGroup(app_id_2_, "Notifications");
+ policy_manager_->RemoveAppConsentForGroup(app_id_2_, "Notifications");
EXPECT_TRUE((*(ucr_iter->second.consent_groups)).find("Notifications") ==
(*(ucr_iter->second.consent_groups)).end());
}
@@ -1257,17 +1332,18 @@ TEST_F(PolicyManagerImplTest2,
const std::string section_name = app_id_2_;
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ 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_));
- manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Add app
- manager_->AddApplication(section_name);
- EXPECT_CALL(listener_, OnPendingPermissionChange(section_name)).Times(2);
+ policy_manager_->AddApplication(section_name,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, OnPendingPermissionChange(section_name));
// PTU has single invalid RequestTypes, which must be dropped and replaced
// with default RT
@@ -1275,18 +1351,18 @@ TEST_F(PolicyManagerImplTest2,
// Get RequestTypes from <app_id> section of app policies after PT update
::policy::StringArray app_request_types_after =
- manager_->GetAppRequestTypes(section_name);
+ policy_manager_->GetAppRequestTypes(section_name);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(kDefaultId))
.WillOnce(Return(device_id_1_));
::policy::StringArray default_request_types_after =
- manager_->GetAppRequestTypes(kDefaultId);
+ policy_manager_->GetAppRequestTypes(kDefaultId);
// Check sizes of Request types of PT and PTU
EXPECT_EQ(4u, app_request_types_after.size());
::policy::AppPermissions permissions =
- manager_->GetAppPermissionsChanges(section_name);
+ policy_manager_->GetAppPermissionsChanges(section_name);
EXPECT_TRUE(permissions.requestTypeChanged);
policy_table::RequestType temp_res1;
@@ -1315,7 +1391,7 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
InitPT_LoadPT_ExpectIncrementedCountOfSamePrompts) {
// Initializing policy_table
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
policy_table::FunctionalGroupings functional_groupings;
GetFunctionalGroupingsFromManager(functional_groupings);
@@ -1348,7 +1424,7 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
LoadPT_UpdatePT_ChangingCountsOfDifferentUserConsentPrompts) {
// Initializing policy_table
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// First update of policy table
GetPTU("json/sdl_pt_first_update.json");
@@ -1399,7 +1475,7 @@ TEST_F(PolicyManagerImplTest_RequestTypes,
TEST_F(PolicyManagerImplTest_RequestTypes,
LoadPT_InvalidRequestTypeBetweenCorectValuesInPTU_EraseInvalidValue) {
// Refresh policy table with invalid RequestType in application
- RefreshPT(preloadet_pt_filename_, kJsonFiles[1]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[1]);
// Correct of Request Types
policy_table::RequestTypes correct_types;
correct_types.push_back(policy_table::RequestType::RT_HTTP);
@@ -1422,7 +1498,7 @@ TEST_F(
TEST_F(PolicyManagerImplTest_RequestTypes,
LoadPT_RequestTypeArrayHaveNoOneValues_AvalibleAllRequestTypes) {
// Refresh policy table with invalid RequestType in application
- RefreshPT(preloadet_pt_filename_, kJsonFiles[3]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[3]);
// Get <app_id> Request Types
policy_table::RequestTypes received_types =
@@ -1484,7 +1560,7 @@ TEST_F(PolicyManagerImplTest_RequestTypes,
policy_table::RequestTypes correct_types = CreateDefaultAppPTURequestValues();
// Load valid values for RequestType
- RefreshPT(preloadet_pt_filename_, kJsonFiles[7]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[7]);
// Get Request Types for "<default>"
policy_table::RequestTypes received_types =
@@ -1501,7 +1577,7 @@ TEST_F(
CreateDefaultAppDatabaseRequestValues();
// Load RequestType with invalid values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[8]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[8]);
// Get Request Types for "<default>"
policy_table::RequestTypes received_types =
@@ -1513,7 +1589,7 @@ TEST_F(
TEST_F(PolicyManagerImplTest_RequestTypes,
LoadPT_PTDefaultAppEmptyRequestTypeValues_RequestTypeValueEmpty) {
// Load RequestType with empty values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[9]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[9]);
// Get Request Types for "<default>"
policy_table::RequestTypes received_types =
@@ -1531,7 +1607,7 @@ TEST_F(PolicyManagerImplTest_RequestTypes,
CreateDefaultAppDatabaseRequestValues();
// Load omitted RequestType values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[10]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[10]);
// Get Request Types for "<default>"
policy_table::RequestTypes received_types =
@@ -1547,7 +1623,7 @@ TEST_F(
policy_table::RequestTypes correct_types = CreateDefaultAppPTURequestValues();
// Load RequestType with one invalid value
- RefreshPT(preloadet_pt_filename_, kJsonFiles[11]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[11]);
// Get Request Types for "<default>"
policy_table::RequestTypes received_types =
@@ -1563,7 +1639,7 @@ TEST_F(PolicyManagerImplTest_RequestTypes,
CreatePreDataConsentAppPTURequestValues();
// Load valid values for RequestType
- RefreshPT(preloadet_pt_filename_, kJsonFiles[12]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[12]);
// Get Request Types for "<pre_DataConsent>"
policy_table::RequestTypes received_types =
@@ -1580,7 +1656,7 @@ TEST_F(
correct_types.push_back(policy_table::RequestType::RT_HTTP);
// Load RequestType with invalid values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[13]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[13]);
// Get Request Types for "<pre_DataConsent>"
policy_table::RequestTypes received_types =
@@ -1592,7 +1668,7 @@ TEST_F(
TEST_F(PolicyManagerImplTest_RequestTypes,
LoadPT_PTPreDataConsentAppEmptyRequestTypeValues_RequestTypeValueEmpty) {
// Load RequestType with empty values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[14]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[14]);
// Get Request Types for "<pre_DataConsent>"
policy_table::RequestTypes received_types =
@@ -1611,7 +1687,7 @@ TEST_F(
correct_types.push_back(policy_table::RequestType::RT_HTTP);
// Load omitted RequestType values
- RefreshPT(preloadet_pt_filename_, kJsonFiles[15]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[15]);
// Get Request Types for "<pre_DataConsent>"
policy_table::RequestTypes received_types =
@@ -1628,7 +1704,7 @@ TEST_F(
CreatePreDataConsentAppPTURequestValues();
// Load RequestType with one invalid value
- RefreshPT(preloadet_pt_filename_, kJsonFiles[16]);
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[16]);
// Get Request Types for "<pre_DataConsent>"
policy_table::RequestTypes received_types =
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index 54907ef6f2..c1ff31f748 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -50,9 +50,9 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
new_data.new_field_name_ = "Notifications-";
CreateNewRandomData(new_data);
// Create Initial LocalPT from preloadedPT
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Update preloadedPT
- std::ifstream ifile(preloadet_pt_filename_);
+ std::ifstream ifile(preloaded_pt_filename_);
Json::Reader reader;
Json::Value root(Json::objectValue);
@@ -72,18 +72,19 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
ifile.close();
Json::StyledStreamWriter writer;
- std::ofstream ofile(preloadet_pt_filename_);
+ std::ofstream ofile(preloaded_pt_filename_);
writer.write(ofile, root);
ofile.flush();
ofile.close();
// Make PolicyManager to update LocalPT
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
- EXPECT_TRUE(manager_->InitPT(preloadet_pt_filename_, &policy_settings_));
+ 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();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -116,29 +117,31 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
TEST_F(PolicyManagerImplTest2,
SetSystemLanguage_ExpectSystemLanguageSetSuccessfully) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->SetSystemLanguage("it-it");
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->SetSystemLanguage("it-it");
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("it-it", static_cast<std::string>(*(ModuleMeta.language)));
}
TEST_F(PolicyManagerImplTest2, SetVINValue_ExpectVINSetSuccessfully) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
std::string vin_code("1FAPP6242VH100001");
- manager_->SetVINValue(vin_code);
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ policy_manager_->SetVINValue(vin_code);
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ(vin_code, static_cast<std::string>(*(ModuleMeta.vin)));
}
TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru");
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
- utils::SharedPtr<policy_table::Table> pt = cache->GetPT();
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ std::shared_ptr<policy_table::Table> pt = cache->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("ru-ru", static_cast<std::string>(*(ModuleMeta.language)));
EXPECT_EQ("4.1.3.B_EB355B",
@@ -149,7 +152,7 @@ TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) {
TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Add first device
::policy::DeviceInfo dev_info1;
dev_info1.hardware = "hardware IPX";
@@ -159,8 +162,8 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
dev_info1.carrier = "Life";
dev_info1.max_number_rfcom_ports = 2;
dev_info1.connection_type = "Bluetooth";
- manager_->AddDevice(device_id_1_, "Bluetooth");
- manager_->SetDeviceInfo(device_id_1_, dev_info1);
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy_manager_->SetDeviceInfo(device_id_1_, dev_info1);
// Add second device
::policy::DeviceInfo dev_info2;
@@ -171,8 +174,8 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
dev_info2.carrier = "MTS";
dev_info2.max_number_rfcom_ports = 2;
dev_info2.connection_type = "Bluetooth";
- manager_->AddDevice("ZZZ123456789YYY", "Bluetooth");
- manager_->SetDeviceInfo("ZZZ123456789YYY", dev_info2);
+ policy_manager_->AddDevice("ZZZ123456789YYY", "Bluetooth");
+ policy_manager_->SetDeviceInfo("ZZZ123456789YYY", dev_info2);
// Add third device
::policy::DeviceInfo dev_info3;
@@ -183,10 +186,11 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
dev_info3.carrier = "Kyivstar";
dev_info3.max_number_rfcom_ports = 2;
dev_info3.connection_type = "Bluetooth";
- manager_->AddDevice("AAA123456789RRR", "Bluetooth");
- manager_->SetDeviceInfo("AAA123456789RRR", dev_info3);
+ policy_manager_->AddDevice("AAA123456789RRR", "Bluetooth");
+ policy_manager_->SetDeviceInfo("AAA123456789RRR", dev_info3);
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ std::shared_ptr<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_);
@@ -203,10 +207,10 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
// Check third device successfully added to PT
ASSERT_TRUE(iter != (*(pt->policy_table.device_data)).end());
- manager_->MarkUnpairedDevice(device_id_1_);
- manager_->MarkUnpairedDevice("ZZZ123456789YYY");
- manager_->MarkUnpairedDevice("AAA123456789RRR");
- manager_->CleanupUnpairedDevices();
+ 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_);
@@ -255,19 +259,19 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(
PolicyManagerImplTest2,
AddValidRequestTypeToPT_GetNewAppWithSpecificPoliciesViaPTU_ExpectRTAdded) {
- const std::string section_name = application_id_;
+ const std::string& app_id = application_id_;
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Add app
- manager_->AddApplication(section_name);
+ policy_manager_->AddApplication(app_id, HmiTypes(policy_table::AHT_DEFAULT));
// Check app gets RequestTypes from pre_DataConsent of app_policies
// section
- pt_request_types_ = manager_->GetAppRequestTypes(section_name);
+ 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(section_name)).Times(1);
+ EXPECT_CALL(listener_, OnPendingPermissionChange(app_id)).Times(1);
// PTU has RequestTypes as [] - means 'all allowed'
Json::Value root = GetPTU("json/PTU2.json");
@@ -276,22 +280,22 @@ TEST_F(
// permissions, request type etc.
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
.WillRepeatedly(Return(device_id_1_));
- manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
// Get App Request Types from PTU
ptu_request_types_ =
- root["policy_table"]["app_policies"][section_name]["RequestType"];
+ 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_ = manager_->GetAppRequestTypes(section_name);
+ 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 =
- manager_->GetAppPermissionsChanges(section_name);
+ policy_manager_->GetAppPermissionsChanges(app_id);
EXPECT_TRUE(permissions.requestTypeChanged);
::policy::StringArray result;
@@ -310,10 +314,10 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) {
const std::string connection_type = "Bluetooth";
const bool result =
- (manager_->GetCache())->AddDevice(device_id_1_, connection_type);
+ (policy_manager_->GetCache())->AddDevice(device_id_1_, connection_type);
// Get Policy table
- const utils::SharedPtr<policy_table::Table> policy_table =
- manager_->GetCache()->GetPT();
+ const std::shared_ptr<policy_table::Table> policy_table =
+ policy_manager_->GetCache()->GetPT();
// Get preloaded_pt flag from Policy table
const bool is_preloaded_pt =
*policy_table->policy_table.module_config.preloaded_pt;
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index bc9f5ac8e6..6521db7c36 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -34,9 +34,9 @@
#include "json/reader.h"
#include "gtest/gtest.h"
+#include <utility>
#include "policy/policy_manager_impl_test_base.h"
-#include "utils/make_shared.h"
using ::testing::_;
using ::testing::Return;
@@ -62,13 +62,13 @@ TEST_F(
.WillOnce(DoAll(SetArgReferee<0>(seconds), Return(true)));
// Act
- manager_->RefreshRetrySequence();
+ policy_manager_->RefreshRetrySequence();
// Assert
- EXPECT_EQ(50, manager_->NextRetryTimeout());
- EXPECT_EQ(100, manager_->NextRetryTimeout());
- EXPECT_EQ(200, manager_->NextRetryTimeout());
- EXPECT_EQ(0, manager_->NextRetryTimeout());
+ 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) {
@@ -77,34 +77,34 @@ TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
EXPECT_CALL(*cache_manager_, GetNotificationsNumber(priority))
.WillOnce(Return(notif_number));
- EXPECT_EQ(notif_number, manager_->GetNotificationsNumber(priority));
+ EXPECT_EQ(notif_number, policy_manager_->GetNotificationsNumber(priority));
}
TEST_F(PolicyManagerImplTest, IncrementGlobalCounter) {
// Assert
EXPECT_CALL(*cache_manager_, Increment(usage_statistics::SYNC_REBOOTS));
- 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));
- 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"));
- 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));
- manager_->Add("12345", usage_statistics::SECONDS_HMI_FULL, 30);
+ policy_manager_->Add("12345", usage_statistics::SECONDS_HMI_FULL, 30);
}
TEST_F(PolicyManagerImplTest, ResetPT) {
@@ -118,17 +118,20 @@ TEST_F(PolicyManagerImplTest, ResetPT) {
EXPECT_CALL(*cache_manager_, TimeoutResponse());
EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_));
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
- EXPECT_TRUE(manager_->ResetPT("filename"));
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ EXPECT_TRUE(policy_manager_->ResetPT("filename"));
EXPECT_TRUE(cache->IsPTPreloaded());
- EXPECT_FALSE(manager_->ResetPT("filename"));
+ EXPECT_FALSE(policy_manager_->ResetPT("filename"));
EXPECT_FALSE(cache->IsPTPreloaded());
}
TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
// Arrange
- manager_->ForcePTExchange();
- manager_->OnUpdateStarted();
+ 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);
@@ -143,8 +146,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- new policy_table::Table(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).WillOnce(Return(true));
@@ -155,56 +158,57 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
EXPECT_CALL(*cache_manager_, TimeoutResponse());
EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_));
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_CALL(*cache_manager_, IsPTPreloaded());
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
}
TEST_F(PolicyManagerImplTest2,
KmsChanged_SetExceededKms_ExpectCorrectSchedule) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
::policy::Counters counter = ::policy::Counters::KILOMETERS;
- manager_->PTUpdatedAt(counter, 50000);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ policy_manager_->PTUpdatedAt(counter, 50000);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Set kms changed but not exceed limit
- manager_->KmsChanged(51500);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ policy_manager_->KmsChanged(51500);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Set kms changed and exceed limit
- manager_->KmsChanged(52500);
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ policy_manager_->KmsChanged(52500);
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest2, ForcePTExchange_ExpectUpdateNeeded) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
// Force OT Exchange
- manager_->ForcePTExchange();
+ policy_manager_->ForcePTExchange();
// Check update required
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest2, OnSystemReady) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Check
EXPECT_CALL(listener_, OnSystemInfoUpdateRequired());
- manager_->OnSystemReady();
+ policy_manager_->OnSystemReady();
}
TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->ResetRetrySequence();
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
- manager_->OnUpdateStarted();
- EXPECT_EQ("UPDATING", manager_->GetPolicyTableStatus());
+ 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(preloadet_pt_filename_);
+ std::ifstream ifile(preloaded_pt_filename_);
Json::Reader reader;
Json::Value root(Json::objectValue);
if (ifile.is_open() && reader.parse(ifile, root, true)) {
@@ -212,55 +216,56 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
seconds_between_retries =
root["policy_table"]["module_config"]["seconds_between_retries"];
uint32_t size = seconds_between_retries.size();
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
for (uint32_t i = 0; i < size; ++i) {
- EXPECT_EQ(seconds_between_retries[i], manager_->NextRetryTimeout());
+ EXPECT_EQ(seconds_between_retries[i],
+ policy_manager_->NextRetryTimeout());
}
}
}
TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Check value taken from PT
- EXPECT_EQ(70000u, manager_->TimeoutExchangeMSec());
+ 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);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>(&table);
+ ASSERT_TRUE(p_table.get());
p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
EXPECT_TRUE(IsValid(*p_table));
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _));
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
- manager_->RequestPTUpdate();
+ 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);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>();
+ ASSERT_TRUE(p_table.get());
EXPECT_FALSE(IsValid(*p_table));
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
- manager_->RequestPTUpdate();
+ policy_manager_->RequestPTUpdate();
}
TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidSnapshot_PTUpdateFail) {
- utils::SharedPtr<policy_table::Table> p_table;
+ std::shared_ptr<policy_table::Table> p_table;
EXPECT_FALSE(p_table);
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
- manager_->RequestPTUpdate();
+ policy_manager_->RequestPTUpdate();
}
TEST_F(PolicyManagerImplTest, ResetUserConsent_ResetOnlyOnce) {
@@ -268,31 +273,31 @@ TEST_F(PolicyManagerImplTest, ResetUserConsent_ResetOnlyOnce) {
.WillOnce(Return(true))
.WillOnce(Return(false));
- EXPECT_TRUE(manager_->ResetUserConsent());
- EXPECT_FALSE(manager_->ResetUserConsent());
+ EXPECT_TRUE(policy_manager_->ResetUserConsent());
+ EXPECT_FALSE(policy_manager_->ResetUserConsent());
}
TEST_F(PolicyManagerImplTest2, GetPolicyTableStatus_ExpectUpToDate) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Check
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest,
SetUpdateStarted_GetPolicyTableStatus_Expect_Updating) {
// Arrange
- manager_->ForcePTExchange();
+ policy_manager_->ForcePTExchange();
EXPECT_CALL(*cache_manager_, SaveUpdateRequired(true));
- manager_->OnUpdateStarted();
+ policy_manager_->OnUpdateStarted();
// Check
- EXPECT_EQ("UPDATING", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UPDATING", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest2,
RetrySequenceDelaysSeconds_Expect_CorrectValues) {
// Arrange
- std::ifstream ifile(preloadet_pt_filename_);
+ std::ifstream ifile(preloaded_pt_filename_);
Json::Reader reader;
Json::Value root(Json::objectValue);
if (ifile.is_open() && reader.parse(ifile, root, true)) {
@@ -300,8 +305,8 @@ TEST_F(PolicyManagerImplTest2,
seconds_between_retries =
root["policy_table"]["module_config"]["seconds_between_retries"];
uint32_t size = seconds_between_retries.size();
- CreateLocalPT(preloadet_pt_filename_);
- std::vector<int> delaySecs = manager_->RetrySequenceDelaysSeconds();
+ 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) {
@@ -313,11 +318,11 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2,
OnExceededTimeout_GetPolicyTableStatus_ExpectUpdateNeeded) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->ForcePTExchange();
- manager_->OnExceededTimeout();
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->ForcePTExchange();
+ policy_manager_->OnExceededTimeout();
// Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
TEST_F(PolicyManagerImplTest, MarkUnpairedDevice) {
@@ -331,13 +336,788 @@ TEST_F(PolicyManagerImplTest, MarkUnpairedDevice) {
EXPECT_CALL(*cache_manager_, IgnitionCyclesBeforeExchange());
EXPECT_CALL(*cache_manager_, DaysBeforeExchange(_));
// Act
- manager_->MarkUnpairedDevice(unpaired_device_id_);
+ policy_manager_->MarkUnpairedDevice(unpaired_device_id_);
}
TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
// Arrange
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_)).Times(1);
- EXPECT_EQ("", manager_->GetCurrentDeviceId(app_id_2_));
+ EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(app_id_2_));
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusWhileAppExists_ExpectUserConsentsUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ std::shared_ptr<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
+ std::shared_ptr<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
+ std::shared_ptr<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
+ std::shared_ptr<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
+ std::shared_ptr<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
+ std::shared_ptr<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));
+
+ std::shared_ptr<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));
+
+ std::shared_ptr<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
+ std::shared_ptr<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
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 63bcb30374..13efa39805 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -38,7 +38,8 @@
#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"
@@ -50,6 +51,7 @@ namespace policy_test {
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ContainerEq;
+using ::testing::_;
// Help functions
char GenRandomChar(char range_from, char range_to) {
@@ -103,12 +105,12 @@ Json::Value createPTforLoad() {
"}"
"},"
"\"notifications_per_minute_by_priority\": {"
- "\"emergency\": 1,"
- "\"navigation\": 2,"
- "\"VOICECOMM\": 3,"
- "\"communication\": 4,"
- "\"normal\": 5,"
- "\"none\": 6"
+ "\"EMERGENCY\": 1,"
+ "\"NAVIGATION\": 2,"
+ "\"VOICECOM\": 3,"
+ "\"COMMUNICATION\": 4,"
+ "\"NORMAL\": 5,"
+ "\"NONE\": 6"
"},"
"\"vehicle_make\" : \"MakeT\","
"\"vehicle_model\" : \"ModelT\","
@@ -190,21 +192,36 @@ void InsertRpcParametersInList(::policy::RPCParams& input_params) {
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")
- , manager_(NULL)
+ , policy_manager_(NULL)
, cache_manager_(NULL) {}
void PolicyManagerImplTest::SetUp() {
- manager_ = new PolicyManagerImpl();
+ policy_manager_ = new PolicyManagerImpl();
cache_manager_ = new MockCacheManagerInterface();
- manager_->set_cache_manager(cache_manager_);
- manager_->set_listener(&listener_);
+ 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 manager_;
+ delete policy_manager_;
}
::testing::AssertionResult PolicyManagerImplTest::IsValid(
@@ -221,26 +238,28 @@ void PolicyManagerImplTest::TearDown() {
// PolicyManagerImplTest2 class methods
PolicyManagerImplTest2::PolicyManagerImplTest2()
: app_id_1_("123456789")
- , app_id_2_("1766825573")
- , app_id_3_("584421907")
+ , app_id_2_("1010101010")
+ , app_id_3_("123454321")
, device_id_1_("XXX123456789ZZZ")
, device_id_2_("08-00-27-CE-76-FE")
, application_id_("1234")
- , app_storage_folder_("storage1")
- , preloadet_pt_filename_(kSdlPreloadedPtJson)
+ , app_storage_folder_("storage_PolicyManagerImplTest2")
+ , preloaded_pt_filename_(kSdlPreloadedPtJson)
, in_memory_(true)
- , manager_(NULL)
+ , 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_);
- manager_ = new PolicyManagerImpl(in_memory_);
+ policy_manager_ = new PolicyManagerImpl(in_memory_);
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(app_storage_folder_));
- manager_->set_listener(&listener_);
+ 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));
@@ -268,8 +287,8 @@ const Json::Value PolicyManagerImplTest2::GetPTU(const std::string& file_name) {
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
// Load Json to cache
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
return root;
}
@@ -277,8 +296,8 @@ 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(manager_->InitPT(file_name, &policy_settings_));
- EXPECT_TRUE(manager_->GetCache()->IsPTPreloaded());
+ ASSERT_TRUE(policy_manager_->InitPT(file_name, &policy_settings_));
+ EXPECT_TRUE(policy_manager_->GetCache()->IsPTPreloaded());
}
void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
@@ -286,9 +305,9 @@ void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
const uint32_t rt_number,
const uint32_t invalid_rt_number) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Get RequestTypes from section of preloaded_pt app_policies
- pt_request_types_ = manager_->GetAppRequestTypes(section_name);
+ 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)
@@ -297,7 +316,7 @@ void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
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);
+ 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());
@@ -309,12 +328,13 @@ void PolicyManagerImplTest2::AddRTtoAppSectionPT(
const uint32_t rt_number,
const uint32_t invalid_rt_number) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// Add app
- manager_->AddApplication(section_name);
+ policy_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);
+ 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);
@@ -326,13 +346,13 @@ void PolicyManagerImplTest2::AddRTtoAppSectionPT(
pt_request_types_.clear();
// Get RequestTypes from <app_id> section of app policies after PT update
- pt_request_types_ = manager_->GetAppRequestTypes(section_name);
+ 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 =
- manager_->GetAppPermissionsChanges(section_name);
+ policy_manager_->GetAppPermissionsChanges(section_name);
EXPECT_TRUE(permissions.requestTypeChanged);
}
@@ -392,15 +412,15 @@ void PolicyManagerImplTest2::FillMultimapFromFunctionalGroupings(
void PolicyManagerImplTest2::GetFunctionalGroupingsFromManager(
policy_table::FunctionalGroupings& input_functional_groupings) {
// Get cache
- ::policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ ::policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
void PolicyManagerImplTest2::TearDown() {
- delete manager_;
+ delete policy_manager_;
file_system::RemoveDirectory(app_storage_folder_, true);
}
@@ -418,8 +438,8 @@ void PolicyManagerImplTest2::
const std::string& update_file) {
// Arrange
CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
- manager_->AddDevice(device_id_1_, "Bluetooth");
- policy::CacheManagerInterfaceSPtr cache = manager_->GetCache();
+ 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",
@@ -430,7 +450,8 @@ void PolicyManagerImplTest2::
"Bluetooth"));
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(application_id_);
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Expect all parameters are allowed
std::ifstream ifile(update_file);
@@ -443,7 +464,7 @@ void PolicyManagerImplTest2::
json = root.toStyledString();
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
EXPECT_FALSE(cache->IsPTPreloaded());
// Will be called each time permissions are checked
@@ -457,7 +478,7 @@ void PolicyManagerImplTest2::
::policy::CheckPermissionResult output;
// Rpc in FULL level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -468,7 +489,7 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in LIMITED level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -479,11 +500,11 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in BACKGROUND level
- manager_->CheckPermissions(application_id_,
- kHmiLevelBackground,
- "SendLocation",
- input_params,
- output);
+ 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
@@ -494,7 +515,7 @@ void PolicyManagerImplTest2::
ResetOutputList(output);
// Rpc in NONE level
- manager_->CheckPermissions(
+ policy_manager_->CheckPermissions(
application_id_, kHmiLevelNone, "SendLocation", input_params, output);
// Check RPC is disallowed
EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
@@ -508,16 +529,43 @@ void PolicyManagerImplTest2::CheckRpcPermissions(
const std::string& rpc_name, const PermitResult& expected_permission) {
::policy::RPCParams input_params;
::policy::CheckPermissionResult output;
- manager_->CheckPermissions(
+ 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");
- manager_->AddDevice(device_id_1_, "Bluetooth");
- ASSERT_TRUE((manager_->GetCache())
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ ASSERT_TRUE((policy_manager_->GetCache())
->SetDeviceData(device_id_1_,
"hardware IPX",
"v.8.0.1",
@@ -528,8 +576,9 @@ void PolicyManagerImplTest2::AddSetDeviceData() {
"Bluetooth"));
// Add app from consented device. App will be assigned with default policies
- manager_->AddApplication(application_id_);
- (manager_->GetCache())->AddDevice(device_id_1_, "Bluetooth");
+ 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
@@ -546,8 +595,8 @@ void PolicyManagerImplTest2::LoadPTUFromJsonFile(
json = root.toStyledString();
ifile.close();
::policy::BinaryMessage msg(json.begin(), json.end());
- EXPECT_TRUE(manager_->LoadPT(kFilePtUpdateJson, msg));
- EXPECT_FALSE(manager_->GetCache()->IsPTPreloaded());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
}
// PolicyManagerImplTest_RequestTypes class methods
@@ -580,15 +629,17 @@ PolicyManagerImplTest_RequestTypes::PolicyManagerImplTest_RequestTypes()
"PTU_pre_data_consent_app_one_invalid_value_RequestType_"
"array."
"json"}
- , kAppId("1766825573")
+ , kAppId("1010101010")
, kDefaultAppId(policy::kDefaultId)
, app_storage_folder_("storage3")
- , preloadet_pt_filename_(kSdlPreloadedPtJson) {}
+ , 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_ = std::make_shared<PolicyManagerImpl>(in_memory);
policy_manager_impl_sptr_->set_listener(&listener_);
}
@@ -647,7 +698,7 @@ PolicyManagerImplTest_RequestTypes::GetRequestTypesForApplication(
void PolicyManagerImplTest_RequestTypes::CompareAppRequestTypesWithDefault(
const std::string& app_id, const std::string& ptu_file) {
// Refresh policy table with invalid RequestType in application
- RefreshPT(preloadet_pt_filename_, ptu_file);
+ RefreshPT(preloaded_pt_filename_, ptu_file);
// Get <app_id> RequestType array
policy_table::RequestTypes app_request_types =
@@ -705,6 +756,164 @@ 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
index be266a3a03..93cfa36277 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -47,53 +47,56 @@ TEST_F(
PolicyManagerImplTest2,
AddApplication_AddNewApplicationFromDeviceWithConsent_ExpectUpdateRequired) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillOnce(Return(device_id_1_));
+ .WillRepeatedly(Return(device_id_1_));
- manager_->SetUserConsentForDevice(device_id_1_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
- manager_->AddApplication(app_id_1_);
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
- EXPECT_EQ("UPDATE_NEEDED", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
}
TEST_F(
PolicyManagerImplTest2,
AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpToDate) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ CreateLocalPT(preloaded_pt_filename_);
// To set UP_TO_DATE before registration
GetPTU(kValidSdlPtUpdateJson);
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ const int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
- manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
- manager_->PTUpdatedAt(KILOMETERS, 1000);
+ policy_manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
+ policy_manager_->PTUpdatedAt(KILOMETERS, 1000);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
- .WillOnce(Return(device_id_1_));
+ .WillRepeatedly(Return(device_id_1_));
- manager_->SetUserConsentForDevice(device_id_1_, false);
+ policy_manager_->SetUserConsentForDevice(device_id_1_, false);
- manager_->AddApplication(app_id_1_);
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
- EXPECT_EQ("UP_TO_DATE", manager_->GetPolicyTableStatus());
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
}
TEST_F(
PolicyManagerImplTest2,
ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithoutConsent_ExpectPreDataConsent) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_1_);
- ASSERT_TRUE(manager_->IsPredataPolicy(app_id_1_));
- manager_->ReactOnUserDevConsentForApp(app_id_1_, false);
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_1_));
+ 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
@@ -101,8 +104,10 @@ TEST_F(PolicyManagerImplTest2,
CheckPreDataConsent_AppRegistered_ExpectReceivedRpcPermissionCorrect) {
// Arrange
CreateLocalPT(kSdlPreloadedPtJson2);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- manager_->AddApplication(application_id_);
+ 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
@@ -149,16 +154,17 @@ TEST_F(PolicyManagerImplTest2,
// Related to manual tests APPLINK-18763, APPLINK-18764
TEST_F(PolicyManagerImplTest2, CheckPreDataConsent_GetDefaultHmiLevel_NONE) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
// Default HMI level is NONE
- manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
EXPECT_EQ("NONE", default_hmi);
// Default priority level is NONE
std::string priority1;
- EXPECT_TRUE(manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
EXPECT_EQ("NONE", priority1);
}
@@ -167,14 +173,15 @@ TEST_F(PolicyManagerImplTest2,
CheckPreDataConsent_GetDefaultHmiLevel_BACKGROUNG) {
// Arrange
CreateLocalPT(kSdlPreloadedPtJson2);
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
// Default HMI level is BACKGROUND
- manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
EXPECT_EQ("BACKGROUND", default_hmi);
// Default priority level is EMERGENCY
std::string priority1;
- EXPECT_TRUE(manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
EXPECT_EQ("EMERGENCY", priority1);
}
@@ -184,12 +191,13 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are different
CreateLocalPT("json/ptu_requestType.json");
- manager_->AddApplication(app_id_1_);
- ASSERT_TRUE(manager_->IsPredataPolicy(app_id_1_));
- manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
- EXPECT_FALSE(manager_->IsPredataPolicy(app_id_1_));
+ 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((manager_->GetCache())->IsDefaultPolicy(app_id_1_));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_1_));
}
TEST_F(
@@ -198,22 +206,24 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are the same
CreateLocalPT(kPtu2RequestTypeJson);
- manager_->AddApplication(app_id_1_);
- ASSERT_TRUE(manager_->IsPredataPolicy(app_id_1_));
+ 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);
- manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
- EXPECT_FALSE(manager_->IsPredataPolicy(app_id_1_));
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_id_1_));
+ 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(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceHasNoConsent, consent);
}
@@ -221,10 +231,11 @@ TEST_F(
TEST_F(PolicyManagerImplTest2,
GetUserConsentForDevice_SetDeviceAllowed_ExpectReceivedConsentCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ ASSERT_TRUE((policy_manager_->GetCache())
->SetDeviceData(device_id_2_,
"hardware IPX",
"v.8.0.1",
@@ -234,9 +245,9 @@ TEST_F(PolicyManagerImplTest2,
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
}
@@ -245,9 +256,10 @@ TEST_F(
PolicyManagerImplTest2,
GetUserConsentForDevice_SetDeviceDisallowed_ExpectReceivedConsentCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -257,9 +269,9 @@ TEST_F(
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, false);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, false);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
// Check
EXPECT_EQ(::policy::DeviceConsent::kDeviceDisallowed, consent);
}
@@ -268,8 +280,9 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultHmi_SetDeviceDisallowed_ExpectReceivedHmiCorrect) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -279,16 +292,17 @@ TEST_F(PolicyManagerImplTest2,
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, false);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, false);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ 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_));
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
std::string default_hmi;
- manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
EXPECT_EQ("NONE", default_hmi);
}
@@ -296,14 +310,16 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string default_hmi1;
- manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
EXPECT_EQ("NONE", default_hmi1);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -312,17 +328,18 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ 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_));
- manager_->AddApplication(app_id_2_);
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_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;
- manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
EXPECT_EQ("LIMITED", default_hmi2);
}
@@ -330,14 +347,16 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string priority1;
- EXPECT_TRUE(manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
EXPECT_EQ("NONE", priority1);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -346,36 +365,38 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ 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_));
- manager_->AddApplication(app_id_2_);
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_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(manager_->GetPriority(app_id_2_, &priority2));
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority2));
EXPECT_EQ("EMERGENCY", priority2);
}
TEST_F(PolicyManagerImplTest2,
GetUserFirendlyMessages_ExpectReceivedCorrectMessages) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
+ 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 =
- manager_->GetUserFriendlyMessages(
+ 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 = (manager_->GetCache())->GetPT();
+ std::shared_ptr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
policy_table::ConsumerFriendlyMessages& consumer_friendly_messages =
*(pt->policy_table.consumer_friendly_messages);
@@ -435,7 +456,8 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
// Arrange
::policy::DeviceInfo dev_info;
- utils::SharedPtr<policy_table::Table> pt = (manager_->GetCache())->GetPT();
+ std::shared_ptr<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";
@@ -443,8 +465,8 @@ TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
dev_info.carrier = "Life";
dev_info.max_number_rfcom_ports = 2;
dev_info.connection_type = "Bluetooth";
- manager_->AddDevice(device_id_1_, "Bluetooth");
- manager_->SetDeviceInfo(device_id_1_, dev_info);
+ 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_);
@@ -467,12 +489,13 @@ TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
::policy::StringArray app_nicknames;
::policy::StringArray app_hmi_types;
- manager_->GetInitialAppData(app_id_2_, &app_nicknames, &app_hmi_types);
- // Expect Empty nicknames and AppHMITypes
+ 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());
@@ -488,7 +511,8 @@ TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
::policy::StringArray app_nicknames1;
::policy::StringArray app_hmi_types1;
- manager_->GetInitialAppData(app_id_2_, &app_nicknames1, &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);
@@ -499,7 +523,7 @@ TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
for (uint32_t i = 0; i < nick_names_size; ++i) {
EXPECT_EQ(app_nicknames1[i], appNicknames[i].asString());
}
- // Check AppHMITypes match
+ // Check AppHmiTypes match
for (uint32_t i = 0; i < app_hmi_types_size; ++i) {
EXPECT_EQ(app_hmi_types1[i], appHmiTypes[i].asString());
}
@@ -509,21 +533,24 @@ TEST_F(
PolicyManagerImplTest2,
CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
// Check keep context in preData policy
- EXPECT_FALSE(manager_->CanAppKeepContext(app_id_2_));
+ EXPECT_FALSE(policy_manager_->CanAppKeepContext(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
CanAppKeepContext_AddAppFromConsentedDevice_ExpectAppCannotKeepContext) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- manager_->AddApplication(app_id_2_);
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -532,36 +559,40 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- manager_->AddApplication(app_id_2_);
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_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(manager_->CanAppKeepContext(app_id_2_));
+ EXPECT_FALSE(policy_manager_->CanAppKeepContext(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_AddAppFromUnconsentedDevice_ExpectAppCannotStealFocus) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
// Check keep context in preData policy
- EXPECT_FALSE(manager_->CanAppStealFocus(app_id_2_));
+ EXPECT_FALSE(policy_manager_->CanAppStealFocus(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_AddAppFromConsentedDevice_ExpectAppCannotStealFocus) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- manager_->AddApplication(app_id_2_);
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -570,25 +601,27 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
.WillRepeatedly(Return(device_id_2_));
- manager_->AddApplication(app_id_2_);
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_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(manager_->CanAppStealFocus(app_id_2_));
+ EXPECT_FALSE(policy_manager_->CanAppStealFocus(app_id_2_));
}
TEST_F(PolicyManagerImplTest2,
IsPredataPolicy_SetAppWIthPredataPolicy_ExpectPredataPolicy) {
// Arrange
- CreateLocalPT(preloadet_pt_filename_);
- manager_->AddApplication(app_id_2_);
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
}
TEST_F(
@@ -596,20 +629,22 @@ TEST_F(
SendNotificationOnPermissionsUpdated_SetDeviceAllowed_ExpectNotificationSent) {
// Arrange
CreateLocalPT(kPtu2RequestTypeJson);
- manager_->AddApplication(app_id_2_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
- EXPECT_TRUE(manager_->IsPredataPolicy(app_id_2_));
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
std::string default_hmi1;
- manager_->GetDefaultHmi(app_id_2_, &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);
- manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
- ASSERT_TRUE((manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
- ASSERT_TRUE((manager_->GetCache())
+ 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",
@@ -618,20 +653,21 @@ TEST_F(
"Life",
2,
"Bluetooth"));
- manager_->SetUserConsentForDevice(device_id_2_, true);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
::policy::DeviceConsent consent =
- manager_->GetUserConsentForDevice(device_id_2_);
+ 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_));
- manager_->AddApplication(app_id_2_);
- EXPECT_TRUE((manager_->GetCache())->IsDefaultPolicy(app_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;
- manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
EXPECT_EQ("LIMITED", default_hmi2);
EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_2_, _, default_hmi2));
- manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
}
} // namespace policy
diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
index 231da9fcac..b87598b986 100644
--- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
@@ -44,8 +44,6 @@
#include "rpc_base/rpc_base.h"
#include "policy/policy_table/types.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using namespace ::policy;
namespace policy_table = rpc::policy_table_interface_base;
@@ -64,10 +62,10 @@ class SQLPTExtRepresentationTest : public ::testing::Test {
// Collection of pairs of group alias and corresponding group name
typedef vector<pair<string, string> > GroupsAliasNameCollection;
- SQLPTExtRepresentationTest() : reps(0) {}
+ SQLPTExtRepresentationTest() : reps_(NULL) {}
protected:
- SQLPTExtRepresentation* reps;
+ SQLPTExtRepresentation* reps_;
policy_handler_test::MockPolicySettings policy_settings_;
static const string kDatabaseName;
PermissionConsent perm_consent;
@@ -75,24 +73,24 @@ class SQLPTExtRepresentationTest : public ::testing::Test {
FunctionalGroupPermission group2_perm;
utils::dbms::SQLQuery* query_wrapper_;
static const bool in_memory_;
- const std::string kAppStorageFolder = "storage1";
+ const std::string kAppStorageFolder = "storage_SQLPTExtRepresentationTest";
void SetUp() OVERRIDE {
file_system::DeleteFile(kDatabaseName);
- reps = new SQLPTExtRepresentation(in_memory_);
- ASSERT_TRUE(reps != NULL);
+ 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_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;
+ EXPECT_TRUE(reps_->Drop());
+ EXPECT_TRUE(reps_->Close());
+ delete reps_;
}
void FillGroupPermission(
@@ -193,8 +191,76 @@ class SQLPTExtRepresentationTest : public ::testing::Test {
}
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;
@@ -322,10 +388,10 @@ TEST_F(SQLPTExtRepresentationTest,
// Assert
ASSERT_TRUE(IsValid(update));
- ASSERT_TRUE(reps->Save(update));
+ ASSERT_TRUE(reps_->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps_->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
policy_table["module_meta"] = Json::Value(Json::objectValue);
@@ -368,8 +434,8 @@ TEST_F(
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
- EXPECT_FALSE(reps->CanAppKeepContext("0"));
- EXPECT_TRUE(reps->CanAppKeepContext("12345"));
+ EXPECT_FALSE(reps_->CanAppKeepContext("0"));
+ EXPECT_TRUE(reps_->CanAppKeepContext("12345"));
// Act
const std::string query_insert_123 =
"INSERT INTO `application` (`id`, `memory_kb`,"
@@ -377,7 +443,7 @@ TEST_F(
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
- EXPECT_FALSE(reps->CanAppKeepContext("123"));
+ EXPECT_FALSE(reps_->CanAppKeepContext("123"));
}
TEST_F(SQLPTExtRepresentationTest,
@@ -393,8 +459,8 @@ TEST_F(SQLPTExtRepresentationTest,
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
- EXPECT_TRUE(reps->CanAppStealFocus("12345"));
- EXPECT_FALSE(reps->CanAppStealFocus("0"));
+ EXPECT_TRUE(reps_->CanAppStealFocus("12345"));
+ EXPECT_FALSE(reps_->CanAppStealFocus("0"));
// Act
const std::string query_insert_123 =
"INSERT INTO `application` (`id`, `memory_kb`,"
@@ -402,7 +468,7 @@ TEST_F(SQLPTExtRepresentationTest,
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
- EXPECT_FALSE(reps->CanAppStealFocus("123"));
+ EXPECT_FALSE(reps_->CanAppStealFocus("123"));
}
TEST_F(SQLPTExtRepresentationTest,
@@ -419,7 +485,7 @@ TEST_F(SQLPTExtRepresentationTest,
std::string result;
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
- EXPECT_TRUE(reps->GetDefaultHMI("12345", &result));
+ EXPECT_TRUE(reps_->GetDefaultHMI("12345", &result));
EXPECT_EQ("NONE", result);
const std::string query_insert_123 =
"INSERT INTO `application` (`id`, `memory_kb`,"
@@ -428,7 +494,7 @@ TEST_F(SQLPTExtRepresentationTest,
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
- EXPECT_TRUE(reps->GetDefaultHMI("123", &result));
+ EXPECT_TRUE(reps_->GetDefaultHMI("123", &result));
EXPECT_EQ("LIMITED", result);
}
@@ -437,7 +503,7 @@ TEST_F(SQLPTExtRepresentationTest,
// Arrange
StringArray allowed_groups;
StringArray disallowed_groups;
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
"XXX12345ZZZ", &allowed_groups, &disallowed_groups));
EXPECT_EQ(0u, allowed_groups.size());
EXPECT_EQ(0u, disallowed_groups.size());
@@ -457,7 +523,7 @@ TEST_F(SQLPTExtRepresentationTest,
"('XXX12345ZZZ', 'Navigation-1', 0,'GUI', '2015-01-01T00:00:52Z')";
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_Navigation));
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
"XXX12345ZZZ", &allowed_groups, &disallowed_groups));
EXPECT_EQ(1u, allowed_groups.size());
EXPECT_EQ(1u, disallowed_groups.size());
@@ -468,19 +534,19 @@ TEST_F(SQLPTExtRepresentationTest,
// Arrange
StringArray allowed_groups;
StringArray disallowed_groups;
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ 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(
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
"XXX12345ZZZ", allowed_groups, disallowed_groups));
allowed_groups.clear();
disallowed_groups.clear();
// Act
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
"XXX12345ZZZ", &allowed_groups, &disallowed_groups));
// Checks
EXPECT_EQ(1u, allowed_groups.size());
@@ -498,19 +564,19 @@ TEST_F(SQLPTExtRepresentationTest,
// Arrange
StringArray allowed_groups;
StringArray disallowed_groups;
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ 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(
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
"XXX12345ZZZ", allowed_groups, disallowed_groups));
allowed_groups.clear();
disallowed_groups.clear();
// Act
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
"XXX12345ZZZ", &allowed_groups, &disallowed_groups));
// Checks
EXPECT_EQ(1u, allowed_groups.size());
@@ -524,8 +590,8 @@ TEST_F(SQLPTExtRepresentationTest,
allowed_groups.clear();
disallowed_groups.clear();
// Act
- reps->ResetDeviceConsents();
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ reps_->ResetDeviceConsents();
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
"XXX12345ZZZ", &allowed_groups, &disallowed_groups));
// Checks
EXPECT_EQ(0u, allowed_groups.size());
@@ -557,7 +623,8 @@ TEST_F(SQLPTExtRepresentationTest,
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));
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
EXPECT_TRUE(
CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
}
@@ -572,10 +639,11 @@ TEST_F(SQLPTExtRepresentationTest,
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_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
FunctionalIdType group_types;
- ASSERT_TRUE(reps->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
EXPECT_TRUE(
CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
}
@@ -590,15 +658,17 @@ TEST_F(SQLPTExtRepresentationTest,
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_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
FunctionalIdType group_types;
- ASSERT_TRUE(reps->GetPermissionsForApp("XXX12345ZZZ", "12345", &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));
+ reps_->ResetAppConsents();
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
EXPECT_FALSE(
CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
}
@@ -619,10 +689,11 @@ TEST_F(SQLPTExtRepresentationTest,
perm_allowed_groups,
perm_disallowed_groups);
// Set permissions for app
- EXPECT_TRUE(reps->SetUserPermissionsForApp(perm_consent));
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
FunctionalIdType group_types;
- ASSERT_TRUE(reps->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
EXPECT_TRUE(CheckGroupTypesExist(
group_types, perm_allowed_groups, perm_disallowed_groups));
@@ -631,19 +702,20 @@ TEST_F(SQLPTExtRepresentationTest,
allowed_groups.push_back("DataConsent-2");
disallowed_groups.push_back("Navigation-1");
// Set permissions for device
- EXPECT_TRUE(reps->SetUserPermissionsForDevice(
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
"XXX12345ZZZ", allowed_groups, disallowed_groups));
allowed_groups.clear();
disallowed_groups.clear();
// Act
- reps->ResetUserConsent();
- EXPECT_TRUE(reps->GetUserPermissionsForDevice(
+ 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_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
EXPECT_FALSE(CheckGroupTypesExist(
group_types, perm_allowed_groups, perm_disallowed_groups));
}
@@ -686,7 +758,8 @@ TEST_F(SQLPTExtRepresentationTest,
policy_table::Strings groups;
policy_table::Strings preconsented_groups;
- EXPECT_TRUE(reps->GetDeviceGroupsFromPolicies(&groups, &preconsented_groups));
+ EXPECT_TRUE(
+ reps_->GetDeviceGroupsFromPolicies(&groups, &preconsented_groups));
EXPECT_EQ(2u, groups.size());
EXPECT_EQ(1u, preconsented_groups.size());
@@ -707,15 +780,15 @@ TEST_F(SQLPTExtRepresentationTest,
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");
+ 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 =
@@ -805,9 +878,9 @@ TEST_F(
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert_application));
- EXPECT_TRUE(reps->IsPredataPolicy("1234"));
- reps->ReactOnUserDevConsentForApp("1234", true);
- EXPECT_TRUE(reps->IsDefaultPolicy("1234"));
+ EXPECT_TRUE(reps_->IsPredataPolicy("1234"));
+ reps_->ReactOnUserDevConsentForApp("1234", true);
+ EXPECT_TRUE(reps_->IsDefaultPolicy("1234"));
}
TEST_F(
@@ -873,9 +946,9 @@ TEST_F(
// 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"));
+ 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);
@@ -885,13 +958,13 @@ TEST_F(
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);
+ 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"));
+ 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());
@@ -916,7 +989,7 @@ TEST_F(SQLPTExtRepresentationTest,
msg_code.push_back("AppPermissions");
// Act
std::vector<UserFriendlyMessage> result =
- reps->GetUserFriendlyMsg(msg_code, string("en-en"));
+ reps_->GetUserFriendlyMsg(msg_code, string("en-en"));
// Checks
ASSERT_EQ(1u, result.size());
EXPECT_EQ(result[0].message_code, "AppPermissions");
@@ -930,7 +1003,7 @@ TEST_F(SQLPTExtRepresentationTest,
TEST_F(SQLPTExtRepresentationTest,
IncrementGlobalCounter_IncrementThreeTimes_ExpectCountEqual3) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
+ utils::dbms::SQLQuery query(reps_->db());
const std::string query_update =
"UPDATE `usage_and_error_count` SET"
" `count_of_sync_reboots` = 0";
@@ -939,9 +1012,9 @@ TEST_F(SQLPTExtRepresentationTest,
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");
+ 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`";
@@ -955,7 +1028,7 @@ TEST_F(
SQLPTExtRepresentationTest,
IncrementAppCounter_IncrementCountOfUserSelections3Times_ExpectCountEqual3) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
+ utils::dbms::SQLQuery query(reps_->db());
const std::string query_delete =
"DELETE FROM `app_level` WHERE `application_id` = '12345'";
@@ -963,9 +1036,9 @@ TEST_F(
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");
+ 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`"
@@ -980,15 +1053,15 @@ TEST_F(
TEST_F(SQLPTExtRepresentationTest,
AppInfo_SetLanguageRuInGUIAndEnInVUI_ExpectRuInGUIAndEnInVUI) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
+ 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");
+ 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`"
@@ -1011,14 +1084,14 @@ TEST_F(SQLPTExtRepresentationTest,
TEST_F(SQLPTExtRepresentationTest,
AddAppStopwatch_Set10And60MinutesForStopwatch_Expect70Minutes) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
+ 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);
+ 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`"
@@ -1034,7 +1107,7 @@ TEST_F(
SQLPTExtRepresentationTest,
SetUnpairedDevice_SetUnpairedDeviceId12345_ExpectUnpairedDeviceIdEquals12345) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
+ utils::dbms::SQLQuery query(reps_->db());
const std::string query_delete = "DELETE FROM `device`";
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_delete));
@@ -1043,7 +1116,7 @@ TEST_F(
"INSERT INTO `device` (`id`) VALUES('12345')";
// Assert
ASSERT_TRUE(query_wrapper_->Exec(query_insert));
- ASSERT_TRUE(reps->SetUnpairedDevice("12345", true));
+ ASSERT_TRUE(reps_->SetUnpairedDevice("12345", true));
// Act
const std::string query_select =
"SELECT `id` FROM `device` WHERE `unpaired` = 1";
@@ -1074,7 +1147,7 @@ TEST_F(
// Act
std::vector<std::string> output;
// Assert
- ASSERT_TRUE(reps->UnpairedDevicesList(&output));
+ 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"));
@@ -1083,8 +1156,8 @@ TEST_F(
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());
+ 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 =
@@ -1111,14 +1184,14 @@ TEST_F(SQLPTExtRepresentationTest,
"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());
+ EXPECT_TRUE(reps_->IsMetaInfoPresent());
}
TEST_F(SQLPTExtRepresentationTest,
SetSystemLanguage_SetSystemLanguage_ExpectValueSetInParams) {
// Arrange
- utils::dbms::SQLQuery query(reps->db());
- ASSERT_TRUE(reps->SetSystemLanguage("ru-ru"));
+ utils::dbms::SQLQuery query(reps_->db());
+ ASSERT_TRUE(reps_->SetSystemLanguage("ru-ru"));
const std::string query_select_language =
"SELECT `language` FROM `module_meta`";
// Assert
@@ -1148,7 +1221,7 @@ TEST_F(
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);
+ reps_->GetFunctionalGroupNames(FunctionalGroupNames);
EXPECT_EQ(3u, FunctionalGroupNames.size());
ASSERT_TRUE(FunctionalGroupNames.end() !=
(it = FunctionalGroupNames.find(129372391)));
@@ -1208,12 +1281,12 @@ TEST_F(
FillPermissionStruct(
"XXX12345ZZZ", "1234", "VR", allowed_groups, disallowed_groups);
FunctionalIdType group_types;
- ASSERT_TRUE(reps->GetPermissionsForApp("XXX12345ZZZ", "1234", &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));
+ 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));
@@ -1222,25 +1295,25 @@ TEST_F(
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");
+ 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(
+ 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(
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
"XXX12345ZZZ", allowed_groups, disallowed_groups));
GroupsAliasNameCollection perm_allowed_groups;
@@ -1255,7 +1328,7 @@ TEST_F(SQLPTExtRepresentationTest,
perm_allowed_groups,
perm_disallowed_groups);
- EXPECT_TRUE(reps->SetUserPermissionsForApp(perm_consent));
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
const std::string query_select_device =
"SELECT COUNT(*) FROM `device` WHERE `id` = 'XXX12345ZZZ'";
@@ -1277,11 +1350,11 @@ TEST_F(SQLPTExtRepresentationTest,
query.Next();
EXPECT_EQ(2, query.GetInteger(0));
- EXPECT_TRUE(reps->SetUnpairedDevice("XXX12345ZZZ", true));
+ EXPECT_TRUE(reps_->SetUnpairedDevice("XXX12345ZZZ", true));
std::vector<std::string> DeviceIds;
DeviceIds.push_back("XXX12345ZZZ");
- EXPECT_TRUE(reps->CleanupUnpairedDevices(DeviceIds));
+ EXPECT_TRUE(reps_->CleanupUnpairedDevices(DeviceIds));
// Assert
query.Prepare(query_select_device);
@@ -1317,15 +1390,15 @@ TEST_F(
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_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
// Act
- ASSERT_TRUE(reps->SetIsPredata("12345", true));
+ ASSERT_TRUE(reps_->SetIsPredata("12345", true));
// Check
- EXPECT_TRUE(reps->IsPredataPolicy("12345"));
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
// Act
- EXPECT_TRUE(reps->SetDefaultPolicy("12345"));
+ EXPECT_TRUE(reps_->SetDefaultPolicy("12345"));
// Check
- EXPECT_TRUE(reps->IsDefaultPolicy("12345"));
+ EXPECT_TRUE(reps_->IsDefaultPolicy("12345"));
}
TEST_F(SQLPTExtRepresentationTest,
@@ -1347,16 +1420,16 @@ TEST_F(SQLPTExtRepresentationTest,
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"));
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
// Act
- ASSERT_TRUE(reps->SetIsPredata("12345", false));
+ ASSERT_TRUE(reps_->SetIsPredata("12345", false));
// Check
- EXPECT_FALSE(reps->IsPredataPolicy("12345"));
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
// Act
- ASSERT_TRUE(reps->SetIsPredata("12345", true));
+ ASSERT_TRUE(reps_->SetIsPredata("12345", true));
// Check
- EXPECT_TRUE(reps->IsPredataPolicy("12345"));
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
}
TEST_F(
@@ -1379,12 +1452,12 @@ TEST_F(
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"));
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
// Act
- ASSERT_TRUE(reps->SetPredataPolicy("12345"));
+ ASSERT_TRUE(reps_->SetPredataPolicy("12345"));
// Check
- EXPECT_TRUE(reps->IsPredataPolicy("12345"));
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
}
TEST_F(SQLPTExtRepresentationTest,
@@ -1399,7 +1472,243 @@ TEST_F(SQLPTExtRepresentationTest,
"1, 64, 10) ";
ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
// Check
- EXPECT_TRUE(reps->IsPredataPolicy("12345"));
+ 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));
+ std::shared_ptr<Table> loaded_table = reps_->GenerateSnapshot();
+
+ // GetData/GetKeyData methods do internal existence check - no need to do it
+ // separately. In case of data is missing expectations will be violated.
+ 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));
+ std::shared_ptr<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
diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
index 531b4e67b7..b0f340b0f2 100644
--- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
@@ -49,7 +49,6 @@
#include "policy/policy_table/enums.h"
#include "rpc_base/rpc_base.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
namespace policy_table = rpc::policy_table_interface_base;
using policy::SQLPTRepresentation;
@@ -62,10 +61,15 @@ 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:
@@ -76,14 +80,14 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static utils::dbms::SQLQuery* query_wrapper_;
// Gtest can show message that this object doesn't destroyed
- static std::auto_ptr<policy_handler_test::MockPolicySettings>
+ static std::unique_ptr<policy_handler_test::MockPolicySettings>
policy_settings_;
static void SetUpTestCase() {
- const std::string kAppStorageFolder = "storage1";
+ const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest";
reps = new SQLPTRepresentation(in_memory_);
ASSERT_TRUE(reps != NULL);
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
+ policy_settings_ = std::unique_ptr<policy_handler_test::MockPolicySettings>(
new policy_handler_test::MockPolicySettings());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -224,6 +228,7 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
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);
@@ -342,7 +347,7 @@ SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
utils::dbms::SQLQuery* SQLPTRepresentationTest::query_wrapper_ = 0;
const std::string SQLPTRepresentationTest::kDatabaseName = ":memory:";
const bool SQLPTRepresentationTest::in_memory_ = true;
-std::auto_ptr<policy_handler_test::MockPolicySettings>
+std::unique_ptr<policy_handler_test::MockPolicySettings>
SQLPTRepresentationTest::policy_settings_;
class SQLPTRepresentationTest2 : public ::testing::Test {
@@ -400,7 +405,10 @@ TEST_F(SQLPTRepresentationTest,
// Check PT structure destroyed and tables number is 0
query.Prepare(query_select);
query.Next();
- ASSERT_EQ(25, query.GetInteger(0));
+
+ // 33 - is current total tables number created by schema
+ const int policy_tables_number = 33;
+ ASSERT_EQ(policy_tables_number, query.GetInteger(0));
const std::string query_select_count_of_iap_buffer_full =
"SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
@@ -1576,7 +1584,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc
index 5546984ff4..bf443bb201 100644
--- a/src/components/policy/policy_external/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_external/test/update_status_manager_test.cc
@@ -34,7 +34,7 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
+
#include "utils/conditional_variable.h"
namespace test {
@@ -48,7 +48,7 @@ using testing::NiceMock;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
+ std::shared_ptr<UpdateStatusManager> manager_;
PolicyTableStatus status_;
const uint32_t k_timeout_;
NiceMock<MockPolicyListener> listener_;
@@ -58,7 +58,7 @@ class UpdateStatusManagerTest : public ::testing::Test {
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
+ : manager_(std::make_shared<UpdateStatusManager>())
, k_timeout_(1000)
, listener_()
, up_to_date_status_("UP_TO_DATE")
@@ -287,42 +287,6 @@ TEST_F(UpdateStatusManagerTest, ScheduleUpdate_ExpectStatusUpdateNeeded) {
}
TEST_F(UpdateStatusManagerTest,
- OnPolicyInit_SetUpdateRequired_ExpectStatusUpdateNeeded) {
- // Arrange
- manager_->OnPolicyInit(true);
- status_ = manager_->GetLastUpdateStatus();
- // Checks
- EXPECT_EQ(StatusUpdateRequired, status_);
- EXPECT_FALSE(manager_->IsUpdatePending());
- EXPECT_TRUE(manager_->IsUpdateRequired());
-}
-
-TEST_F(UpdateStatusManagerTest,
- OnPolicyInit_SetUpdateNotRequired_ExpectStatusUpToDate) {
- // Arrange
- manager_->OnPolicyInit(false);
- status_ = manager_->GetLastUpdateStatus();
- // Checks
- EXPECT_EQ(StatusUpToDate, status_);
- EXPECT_FALSE(manager_->IsUpdatePending());
- EXPECT_FALSE(manager_->IsUpdateRequired());
-}
-
-TEST_F(UpdateStatusManagerTest,
- StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
- // Arrange
- manager_->OnPolicyInit(false);
- // Check
- EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
- manager_->OnPolicyInit(true);
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
- manager_->OnUpdateSentOut(k_timeout_);
- // Check
- EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
-}
-
-TEST_F(UpdateStatusManagerTest,
OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
// Arrange
manager_->OnAppsSearchStarted();
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index 76e10a58b0..225e99329a 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -65,8 +65,8 @@ set(EXCLUDE_PATHS
)
set(PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include/
- ${CMAKE_CURRENT_SOURCE_DIR}/src/
+ ${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}")
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h
new file mode 100644
index 0000000000..c4de9b7e1f
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+
+#include <vector>
+#include <ostream>
+#include <string>
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+struct ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) = 0;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
new file mode 100644
index 0000000000..dbe317667a
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+
+#include <map>
+#include "policy/policy_table/types.h"
+#include "utils/macro.h"
+
+#include "policy/access_remote.h"
+#include "policy/cache_manager.h"
+
+using policy_table::FunctionalGroupings;
+
+namespace policy {
+
+class AccessRemoteImpl : public AccessRemote {
+ public:
+ AccessRemoteImpl();
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ std::shared_ptr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, KeyMapTest);
+ FRIEND_TEST(AccessRemoteImplTest, Allow);
+ FRIEND_TEST(AccessRemoteImplTest, Deny);
+ FRIEND_TEST(AccessRemoteImplTest, ChangeAccess);
+ FRIEND_TEST(AccessRemoteImplTest, ResetBySubject);
+ FRIEND_TEST(AccessRemoteImplTest, ResetByObject);
+ FRIEND_TEST(AccessRemoteImplTest, CheckAllowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckManual);
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index 47d8e69551..a28f1b3461 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -55,6 +54,8 @@ class CacheManager : public CacheManagerInterface {
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
@@ -65,12 +66,28 @@ class CacheManager : public CacheManagerInterface {
* @return CheckPermissionResult containing flag if HMI Level is allowed
* and list of allowed params.
*/
- virtual void CheckPermissions(const PTString& app_id,
+ virtual void CheckPermissions(const policy_table::Strings& groups,
const PTString& hmi_level,
const PTString& rpc,
CheckPermissionResult& result);
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -198,7 +215,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -215,6 +232,15 @@ class CacheManager : public CacheManagerInterface {
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
*/
@@ -314,6 +340,13 @@ class CacheManager : public CacheManagerInterface {
bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const;
/**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ const policy_table::AppHMITypes* GetHMITypes(const std::string& app_id);
+
+ /**
* @brief Reset user consent for device data and applications permissions
* @return
*/
@@ -579,8 +612,18 @@ class CacheManager : public CacheManagerInterface {
* @param policy_app_id Unique application id
* @param request_types Request types of application
*/
- void GetAppRequestTypes(const std::string& policy_app_id,
- std::vector<std::string>& request_types) const;
+ void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const OVERRIDE;
/**
* @brief GetCertificate allows to obtain certificate in order to
@@ -593,12 +636,13 @@ class CacheManager : public CacheManagerInterface {
/**
* @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
+ * 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
*/
- void MergePreloadPT(const std::string& file_name);
+ bool MergePreloadPT(const std::string& file_name);
/**
* @brief MergeMC allows to merge ModuleConfig section by definite rules.
@@ -678,11 +722,18 @@ class CacheManager : public CacheManagerInterface {
const PolicySettings& get_settings() const;
-#ifdef BUILD_TESTS
- utils::SharedPtr<policy_table::Table> GetPT() const {
+ std::shared_ptr<policy_table::Table> pt() const {
return pt_;
}
-#endif
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
private:
std::string currentDateTime();
@@ -705,6 +756,13 @@ class CacheManager : public CacheManagerInterface {
void PersistData();
+ /**
+ * @brief Transform to lower case all non default application names in
+ * applications policies section
+ * @param pt polict rable for update
+ */
+ void MakeLowerCaseAppNames(policy_table::Table& pt) const;
+
void ResetCalculatedPermissions();
void AddCalculatedPermissions(const std::string& device_id,
@@ -716,14 +774,14 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
@@ -755,6 +813,13 @@ class CacheManager : public CacheManagerInterface {
sync_primitives::Lock backuper_locker_;
BackgroundBackuper* backuper_;
const PolicySettings* settings_;
+
+#ifdef BUILD_TESTS
+ friend class AccessRemoteImpl;
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
};
} // namespace policy
#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
index e82787084c..10a6ea7f89 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -46,10 +45,21 @@ namespace policy_table = rpc::policy_table_interface_base;
namespace policy {
+namespace RequestType {
+// Describes available RequestType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestType
+
+namespace RequestSubType {
+// Describes available RequestSubType states in policy table
+enum class State { UNAVAILABLE = 0, AVAILABLE, EMPTY, OMITTED };
+} // namespace RequestSubType
+
class CacheManagerInterface {
public:
virtual ~CacheManagerInterface() {}
+ 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
@@ -60,12 +70,28 @@ class CacheManagerInterface {
* @return CheckPermissionResult containing flag if HMI Level is allowed
* and list of allowed params.
*/
- virtual void CheckPermissions(const PTString& app_id,
+ virtual void CheckPermissions(const policy_table::Strings& groups,
const PTString& hmi_level,
const PTString& rpc,
CheckPermissionResult& result) = 0;
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ virtual RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ virtual RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const = 0;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -195,7 +221,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -212,6 +238,15 @@ class CacheManagerInterface {
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
*/
@@ -313,6 +348,14 @@ class CacheManagerInterface {
std::string& default_hmi) const = 0;
/**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ virtual const policy_table::AppHMITypes* GetHMITypes(
+ const std::string& app_id) = 0;
+
+ /**
* @brief Reset user consent for device data and applications permissions
* @return
*/
@@ -609,6 +652,15 @@ class CacheManagerInterface {
std::vector<std::string>& request_types) const = 0;
/**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ virtual void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const = 0;
+
+ /**
* @brief GetCertificate allows to obtain certificate in order to
* make secure connection
*
@@ -616,18 +668,25 @@ class CacheManagerInterface {
*/
virtual std::string GetCertificate() const = 0;
-#ifdef BUILD_TESTS
/**
- * @brief GetPT allows to obtain SharedPtr to PT.
+ * @brief pt allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
-#endif
+ virtual std::shared_ptr<policy_table::Table> pt() const = 0;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
index 996c2917d0..3ca0f93ebd 100644
--- a/src/components/policy/policy_regular/include/policy/policy_helper.h
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -82,8 +82,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
*/
struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
bool operator()(const AppPoliciesValueType& app_policy);
private:
@@ -95,7 +95,8 @@ struct CheckAppPolicy {
RESULT_CONSENT_NEEDED,
RESULT_CONSENT_NOT_REQIURED,
RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED,
- RESULT_REQUEST_TYPE_CHANGED
+ RESULT_REQUEST_TYPE_CHANGED,
+ RESULT_REQUEST_SUBTYPE_CHANGED
};
void SetPendingPermissions(const AppPoliciesValueType& app_policy,
@@ -114,7 +115,8 @@ struct CheckAppPolicy {
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;
+ void SendPermissionsToApp(const std::string& app_id,
+ const policy_table::Strings& groups) const;
bool IsAppRevoked(const AppPoliciesValueType& app_policy) const;
bool NicknamesMatch(const AppPoliciesValueType& app_policy) const;
/**
@@ -125,11 +127,12 @@ struct CheckAppPolicy {
bool IsConsentRequired(const std::string& app_id,
const std::string& group_name) const;
bool IsRequestTypeChanged(const AppPoliciesValueType& app_policy) const;
+ bool IsRequestSubTypeChanged(const AppPoliciesValueType& app_policy) const;
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
};
/*
diff --git a/src/components/policy/policy_regular/include/policy/policy_listener.h b/src/components/policy/policy_regular/include/policy/policy_listener.h
deleted file mode 100644
index 00bf1f709f..0000000000
--- a/src/components/policy/policy_regular/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_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
- *
- */
- 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_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
index 667ea2cb71..51d4ee88aa 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -37,7 +37,6 @@
#include <list>
#include <cstdint>
-#include "utils/shared_ptr.h"
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -47,6 +46,8 @@
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/policy_helper.h"
#include "utils/timer.h"
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
namespace policy_table = rpc::policy_table_interface_base;
@@ -56,180 +57,655 @@ struct CheckAppPolicy;
class PolicyManagerImpl : public PolicyManager {
public:
PolicyManagerImpl();
- virtual void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
PolicyListener* listener() const {
return listener_;
}
- 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& 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 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
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ bool RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param device_id Id of device of application
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
+ */
+ void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence();
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ uint32_t NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
*/
virtual void RefreshRetrySequence();
- virtual DeviceConsent GetUserConsentForDevice(
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
- virtual void GetUserConsentForApp(
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
- 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);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string app_id,
+ const bool is_device_allowed) OVERRIDE;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type);
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info);
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
- virtual void SetUserConsentForApp(const PermissionConsent& permissions);
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ */
+ void SetUserConsentForApp(const PermissionConsent& permissions) OVERRIDE;
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const;
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const;
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
const std::vector<std::string>& message_code,
- const std::string& language);
+ const std::string& language) OVERRIDE;
- virtual bool IsApplicationRevoked(const std::string& app_id) const;
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
- virtual void GetPermissionsForApp(
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const;
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
- virtual void SetSystemLanguage(const std::string& language);
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
- virtual void OnSystemReady();
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const OVERRIDE;
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
- virtual void SetVINValue(const std::string& value);
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
- // 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)
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
- AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
- void RemovePendingPermissionChanges(const std::string& app_id);
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
- void SendNotificationOnPermissionsUpdated(const std::string& application_id);
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
- bool CleanupUnpairedDevices();
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
- bool CanAppKeepContext(const std::string& app_id) const;
- bool CanAppStealFocus(const std::string& app_id) const;
- void MarkUnpairedDevice(const std::string& device_id);
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
- StatusNotifier AddApplication(const std::string& application_id);
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
virtual void RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name);
- virtual uint32_t HeartBeatTimeout(const std::string& app_id) const;
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
- virtual void SaveUpdateStatusRequired(bool is_update_needed);
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
- virtual bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
void set_cache_manager(CacheManagerInterface* cache_manager);
- virtual void OnAppsSearchStarted();
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+
+ /**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @return request subtypes of application
+ */
+ const std::vector<std::string> GetAppRequestSubTypes(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
- virtual void OnAppsSearchCompleted();
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const OVERRIDE;
#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
inline CacheManagerInterfaceSPtr GetCache() {
return cache_;
}
-#endif // BUILD_TESTS
- virtual const std::vector<std::string> GetAppRequestTypes(
- const std::string policy_app_id) const;
- virtual const VehicleInfo GetVehicleInfo() const;
+ /**
+ * @brief Setter for send_on_update_sent_out
+ * @param send_on_update_sent_out new value of this flag
+ */
+ inline void SetSendOnUpdateSentOut(const bool send_on_update_sent_out) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ }
+#endif // BUILD_TESTS
- virtual void OnAppRegisteredOnMobile(
- const std::string& application_id) OVERRIDE;
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
- virtual std::string RetrieveCertificate() const OVERRIDE;
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
- AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
- AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
- const EndpointUrls& urls) const OVERRIDE;
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
protected:
#ifdef USE_HMI_PTU_DECRYPTION
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
#else
- virtual utils::SharedPtr<policy_table::Table> ParseArray(
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual std::shared_ptr<policy_table::Table> ParseArray(
const BinaryMessage& pt_content);
#endif
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
const PolicySettings& get_settings() const OVERRIDE;
private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
void CheckTriggers();
- /*
- * @brief Checks policy table update along with current data for any changes
- * in assigned functional group list of application
- *
- * @param Policy table update struct
+
+ /**
+ * @brief Compares current applications policies to the updated one and
+ * returns apporopriate result codes per application, which that are being
+ * processed by sending notification to applications registered and to the
+ * system
+ * @param update Shared pointer to policy table udpate
+ * @param snapshot Shared pointer to current copy of policy table
+ * @return Collection per-application results
*/
void CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
/**
* @brief Fill structure to be sent with OnPermissionsChanged notification
@@ -301,46 +777,138 @@ class PolicyManagerImpl : public PolicyManager {
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,
+ /**
+ * @brief StartPTExchange allows to start PTU. The function will check
+ * if one is required and starts the update flow in only case when previous
+ * condition is true.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
+ /**
+ * @brief Starts new retry sequence
+ */
void RetrySequence();
private:
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
CacheManagerInterfaceSPtr cache_;
+
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ std::shared_ptr<AccessRemote> access_remote_;
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
sync_primitives::Lock app_permissions_diff_lock_;
- std::map<std::string, AppPermissions> app_permissions_diff_;
/**
- * Timeout to wait response with UpdatePT (msec)
+ * @brief Collection of parameters to be reported to the system with
+ * SDL.ActivateApp response or OnAppPermissionsChanged notification
+ * Being set during policy table update processing
+ */
+ typedef std::map<std::string, AppPermissions> PendingPermissions;
+ PendingPermissions app_permissions_diff_;
+
+ /**
+ * @brief Timeout to wait response with UpdatePT
*/
uint32_t retry_sequence_timeout_;
/**
- * Seconds between retries to update PT
+ * @brief Seconds between retries to update PT
*/
std::vector<int> retry_sequence_seconds_;
/**
- * Current index trying of retry sequence
+ * @brief Current index trying of retry sequence
*/
uint32_t retry_sequence_index_;
/**
- * Lock for guarding retry sequence
+ * @brief Lock for guarding retry sequence
*/
sync_primitives::Lock retry_sequence_lock_;
/**
- * Timer to retry UpdatePT
- */
+ * @brief Timer to retry UpdatePT
+ */
timer::Timer timer_retry_sequence_;
/**
@@ -349,8 +917,14 @@ class PolicyManagerImpl : public PolicyManager {
*/
mutable std::string last_device_id_;
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
bool ignition_check;
+ /**
+ * @brief Pointer to current policy settings structure
+ */
const PolicySettings* settings_;
friend struct CheckAppPolicy;
friend struct ProccessAppGroups;
@@ -360,6 +934,21 @@ class PolicyManagerImpl : public PolicyManager {
* that contains all application URLs
*/
RetrySequenceURL retry_sequence_url_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
+ bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
+ bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
+ bool trigger_ptu_;
};
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h
index afee8a34e4..353cdda871 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table.h
@@ -33,7 +33,6 @@
#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"
@@ -42,7 +41,7 @@ namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +49,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index da98e7462d..1f10db9f6f 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -1,6 +1,38 @@
-// This file is generated, do not edit
+/*
+ * 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 {
@@ -12,6 +44,7 @@ enum Priority {
P_VOICECOM,
P_COMMUNICATION,
P_NORMAL,
+ P_PROJECTION,
P_NONE,
};
@@ -34,20 +67,24 @@ enum Parameter {
P_SPEED,
P_ENGINETORQUE,
P_EXTERNALTEMPERATURE,
+ P_TURNSIGNAL,
P_FUELLEVEL,
P_FUELLEVEL_STATE,
P_HEADLAMPSTATUS,
P_INSTANTFUELCONSUMPTION,
+ P_FUELRANGE,
P_ODOMETER,
P_TIREPRESSURE,
P_WIPERSTATUS,
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
P_STEERINGWHEELANGLE,
+ P_ENGINEOILLIFE,
P_MYKEY,
P_AIRBAGSTATUS,
P_BODYINFORMATION,
@@ -55,7 +92,9 @@ enum Parameter {
P_DEVICESTATUS,
P_EMERGENCYEVENT,
P_ECALLINFO,
+ P_EMPTY // Added to allow empty parameters handling
};
+
bool IsValidEnum(Parameter val);
const char* EnumToJsonString(Parameter val);
bool EnumFromJsonString(const std::string& literal, Parameter* result);
@@ -71,6 +110,8 @@ enum AppHMIType {
AHT_BACKGROUND_PROCESS,
AHT_TESTING,
AHT_SYSTEM,
+ AHT_PROJECTION,
+ AHT_REMOTE_CONTROL
};
bool IsValidEnum(AppHMIType val);
const char* EnumToJsonString(AppHMIType val);
@@ -96,13 +137,402 @@ enum RequestType {
RT_VEHICLE_DIAGNOSTICS,
RT_EMERGENCY,
RT_MEDIA,
- RT_FOTA
+ RT_FOTA,
+ RT_OEM_SPECIFIC,
+ RT_EMPTY // Added to allow empty Request Types handling
};
bool IsValidEnum(RequestType val);
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,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
+};
+bool IsValidEnum(ModuleType val);
+const char* EnumToJsonString(ModuleType val);
+bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+
+/**
+ * @brief Enumeration FunctionID.
+ *
+ * Enumeration linking function names with function IDs in AppLink protocol.
+ * Assumes enumeration starts at value 0.
+ */
+enum FunctionID {
+ /**
+ * @brief RESERVED.
+ */
+ RESERVED = 0,
+
+ /**
+ * @brief RegisterAppInterfaceID.
+ */
+ RegisterAppInterfaceID = 1,
+
+ /**
+ * @brief UnregisterAppInterfaceID.
+ */
+ UnregisterAppInterfaceID = 2,
+
+ /**
+ * @brief SetGlobalPropertiesID.
+ */
+ SetGlobalPropertiesID = 3,
+
+ /**
+ * @brief ResetGlobalPropertiesID.
+ */
+ ResetGlobalPropertiesID = 4,
+
+ /**
+ * @brief AddCommandID.
+ */
+ AddCommandID = 5,
+
+ /**
+ * @brief DeleteCommandID.
+ */
+ DeleteCommandID = 6,
+
+ /**
+ * @brief AddSubMenuID.
+ */
+ AddSubMenuID = 7,
+
+ /**
+ * @brief DeleteSubMenuID.
+ */
+ DeleteSubMenuID = 8,
+
+ /**
+ * @brief CreateInteractionChoiceSetID.
+ */
+ CreateInteractionChoiceSetID = 9,
+
+ /**
+ * @brief PerformInteractionID.
+ */
+ PerformInteractionID = 10,
+
+ /**
+ * @brief DeleteInteractionChoiceSetID.
+ */
+ DeleteInteractionChoiceSetID = 11,
+
+ /**
+ * @brief AlertID.
+ */
+ AlertID = 12,
+
+ /**
+ * @brief ShowID.
+ */
+ ShowID = 13,
+
+ /**
+ * @brief SpeakID.
+ */
+ SpeakID = 14,
+
+ /**
+ * @brief SetMediaClockTimerID.
+ */
+ SetMediaClockTimerID = 15,
+
+ /**
+ * @brief PerformAudioPassThruID.
+ */
+ PerformAudioPassThruID = 16,
+
+ /**
+ * @brief EndAudioPassThruID.
+ */
+ EndAudioPassThruID = 17,
+
+ /**
+ * @brief SubscribeButtonID.
+ */
+ SubscribeButtonID = 18,
+
+ /**
+ * @brief UnsubscribeButtonID.
+ */
+ UnsubscribeButtonID = 19,
+
+ /**
+ * @brief SubscribeVehicleDataID.
+ */
+ SubscribeVehicleDataID = 20,
+
+ /**
+ * @brief UnsubscribeVehicleDataID.
+ */
+ UnsubscribeVehicleDataID = 21,
+
+ /**
+ * @brief GetVehicleDataID.
+ */
+ GetVehicleDataID = 22,
+
+ /**
+ * @brief ReadDIDID.
+ */
+ ReadDIDID = 23,
+
+ /**
+ * @brief GetDTCsID.
+ */
+ GetDTCsID = 24,
+
+ /**
+ * @brief ScrollableMessageID.
+ */
+ ScrollableMessageID = 25,
+
+ /**
+ * @brief SliderID.
+ */
+ SliderID = 26,
+
+ /**
+ * @brief ShowConstantTBTID.
+ */
+ ShowConstantTBTID = 27,
+
+ /**
+ * @brief AlertManeuverID.
+ */
+ AlertManeuverID = 28,
+
+ /**
+ * @brief UpdateTurnListID.
+ */
+ UpdateTurnListID = 29,
+
+ /**
+ * @brief ChangeRegistrationID.
+ */
+ ChangeRegistrationID = 30,
+
+ /**
+ * @brief GenericResponseID.
+ */
+ GenericResponseID = 31,
+
+ /**
+ * @brief PutFileID.
+ */
+ PutFileID = 32,
+
+ /**
+ * @brief DeleteFileID.
+ */
+ DeleteFileID = 33,
+
+ /**
+ * @brief ListFilesID.
+ */
+ ListFilesID = 34,
+
+ /**
+ * @brief SetAppIconID.
+ */
+ SetAppIconID = 35,
+
+ /**
+ * @brief SetDisplayLayoutID.
+ */
+ SetDisplayLayoutID = 36,
+
+ /**
+ * @brief DiagnosticMessageID.
+ */
+ DiagnosticMessageID = 37,
+
+ /**
+ * @brief SystemRequestID.
+ */
+ SystemRequestID = 38,
+
+ /**
+ * @brief SendLocationID.
+ */
+ SendLocationID = 39,
+
+ /**
+ * @brief DialNumberID.
+ */
+ DialNumberID = 40,
+
+ /**
+ * @brief ButtonPressID.
+ */
+ ButtonPressID = 41,
+
+ /**
+ * @brief GetInteriorVehicleDataID.
+ */
+ GetInteriorVehicleDataID = 43,
+
+ /**
+ * @brief SetInteriorVehicleDataID.
+ */
+ SetInteriorVehicleDataID = 44,
+
+ /**
+ * @brief GetWayPointsID.
+ */
+ GetWayPointsID = 45,
+
+ /**
+ * @brief SubscribeWayPointsID.
+ */
+ SubscribeWayPointsID = 46,
+
+ /**
+ * @brief UnsubscribeWayPointsID.
+ */
+ UnsubscribeWayPointsID = 47,
+
+ /**
+ * @brief GetSystemCapabilityID.
+ */
+ GetSystemCapabilityID = 48,
+
+ /**
+ * @brief SendHapticDataID.
+ */
+ SendHapticDataID = 49,
+
+ /**
+ * @brief OnHMIStatusID.
+ */
+ OnHMIStatusID = 32768,
+
+ /**
+ * @brief OnAppInterfaceUnregisteredID.
+ */
+ OnAppInterfaceUnregisteredID = 32769,
+
+ /**
+ * @brief OnButtonEventID.
+ */
+ OnButtonEventID = 32770,
+
+ /**
+ * @brief OnButtonPressID.
+ */
+ OnButtonPressID = 32771,
+
+ /**
+ * @brief OnVehicleDataID.
+ */
+ OnVehicleDataID = 32772,
+
+ /**
+ * @brief OnCommandID.
+ */
+ OnCommandID = 32773,
+
+ /**
+ * @brief OnTBTClientStateID.
+ */
+ OnTBTClientStateID = 32774,
+
+ /**
+ * @brief OnDriverDistractionID.
+ */
+ OnDriverDistractionID = 32775,
+
+ /**
+ * @brief OnPermissionsChangeID.
+ */
+ OnPermissionsChangeID = 32776,
+
+ /**
+ * @brief OnAudioPassThruID.
+ */
+ OnAudioPassThruID = 32777,
+
+ /**
+ * @brief OnLanguageChangeID.
+ */
+ OnLanguageChangeID = 32778,
+
+ /**
+ * @brief OnKeyboardInputID.
+ */
+ OnKeyboardInputID = 32779,
+
+ /**
+ * @brief OnTouchEventID.
+ */
+ OnTouchEventID = 32780,
+
+ /**
+ * @brief OnSystemRequestID.
+ */
+ OnSystemRequestID = 32781,
+
+ /**
+ * @brief OnHashChangeID.
+ */
+ OnHashChangeID = 32782,
+
+ /**
+ * @brief OnInteriorVehicleDataID.
+ */
+ OnInteriorVehicleDataID = 32783,
+
+ /**
+ * @brief OnWayPointChangeID.
+ */
+ OnWayPointChangeID = 32784,
+
+ /**
+ * @brief OnRCStatusID.
+ */
+ OnRCStatusID = 32785,
+
+ /**
+ * @brief EncodedSyncPDataID.
+ */
+ EncodedSyncPDataID = 65536,
+
+ /**
+ * @brief SyncPDataID.
+ */
+ SyncPDataID = 65537,
+
+ /**
+ * @brief OnEncodedSyncPDataID.
+ */
+ OnEncodedSyncPDataID = 98304,
+
+ /**
+ * @brief OnSyncPDataID.
+ */
+ OnSyncPDataID = 98305
+};
+bool IsValidEnum(FunctionID val);
+const char* EnumToJsonString(FunctionID val);
+bool EnumFromJsonString(const std::string& literal, FunctionID* result);
+
extern const std::string kDefaultApp;
extern const std::string kPreDataConsentApp;
extern const std::string kDeviceApp;
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
index 5873904823..e201251745 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -1,10 +1,43 @@
-// This file is generated, do not edit
+/*
+ * 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 "./enums.h"
+#include "policy/policy_table/enums.h"
#include "rpc_base/rpc_message.h"
+
namespace Json {
class Value;
} // namespace Json
@@ -32,21 +65,21 @@ typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
-typedef Array<Enum<Parameter>, 0, 24> Parameters;
+typedef Array<Enum<Parameter>, 0, 255> Parameters;
-typedef Map<RpcParameters, 0, 50> Rpc;
+typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
-typedef Array<String<10, 255>, 1, 255> URL;
+typedef Array<String<10, 255>, 1, 3> URL;
typedef Map<URL, 1, 255> URLList;
typedef Map<URLList, 1, 255> ServiceEndpoints;
typedef uint8_t NumberOfNotificationsType;
-typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 7>
NumberOfNotificationsPerMinute;
-typedef Array<Integer<uint16_t, 1, 1000>, 0, 10> SecondsBetweenRetries;
+typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
typedef Map<MessageString, 0, 500> Languages;
@@ -63,6 +96,15 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
+typedef Strings RequestSubTypes;
+
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+
+typedef AppHMIType AppHmiType;
+typedef std::vector<AppHMIType> AppHmiTypes;
+
struct PolicyBase : CompositeType {
public:
Enum<Priority> priority;
@@ -97,9 +139,11 @@ struct ApplicationParams : PolicyBase {
Optional<Strings> nicknames;
Optional<AppHMITypes> AppHMIType;
Optional<RequestTypes> RequestType;
+ Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
Optional<String<0, 255> > certificate;
+ mutable Optional<ModuleTypes> moduleType;
public:
ApplicationParams();
@@ -115,6 +159,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
+ bool ValidateModuleTypes() const;
};
struct ApplicationPoliciesSection : CompositeType {
@@ -185,6 +230,7 @@ struct ModuleConfig : CompositeType {
public:
Optional<Map<String<0, 100>, 0, 255> > device_certificates;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
Integer<uint8_t, 0, 255> exchange_after_x_days;
@@ -262,6 +308,7 @@ struct MessageLanguages : CompositeType {
virtual void SetPolicyTableType(PolicyTableType pt_type);
private:
+ static const std::string default_language_;
bool Validate() const;
};
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..276a0a5dca
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -0,0 +1,497 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 <memory>
+
+#include "utils/helpers.h"
+#include "transport_manager/common.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 std::shared_ptr<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;
+ transport_manager::DeviceHandle 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)
+ , requestSubTypeChanged(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;
+ bool requestSubTypeChanged;
+ std::vector<std::string> requestSubType;
+};
+
+/**
+ * @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,
+ RESULT_REQUEST_SUBTYPE_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
index 6b9d0fbada..f70946d1f5 100644
--- a/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
+++ b/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
@@ -327,6 +327,9 @@ class PTExtRepresentation : public virtual PTRepresentation {
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
diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h
index 08bd6d4923..378a294532 100644
--- a/src/components/policy/policy_regular/include/policy/pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/pt_representation.h
@@ -35,9 +35,11 @@
#include <vector>
#include <string>
+#include <memory>
#include "policy/policy_types.h"
#include "policy/policy_table/types.h"
#include "policy/policy_settings.h"
+#include "utils/macro.h"
namespace policy {
namespace policy_table = rpc::policy_table_interface_base;
@@ -208,7 +210,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h
index 0d13d51ebd..727c0b165d 100644
--- 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
@@ -90,7 +90,7 @@ 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
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
index 1d29687c46..0958bad5e1 100644
--- 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
@@ -129,6 +129,8 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
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;
@@ -198,7 +200,6 @@ class SQLPTExtRepresentation : public SQLPTRepresentation,
*/
bool IsMsgLanguagePresent(const std::string& message,
const std::string& language);
-};
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
index 79a66ba41a..191873efe0 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
@@ -65,6 +65,7 @@ extern const std::string kSelectAppGroups;
extern const std::string kSelectNicknames;
extern const std::string kSelectAppTypes;
extern const std::string kSelectRequestTypes;
+extern const std::string kSelectRequestSubTypes;
extern const std::string kSelectSecondsBetweenRetries;
extern const std::string kSelectIgnitionCycles;
extern const std::string kSelectKilometers;
@@ -78,6 +79,7 @@ extern const std::string kInsertAppGroup;
extern const std::string kInsertNickname;
extern const std::string kInsertAppType;
extern const std::string kInsertRequestType;
+extern const std::string kInsertRequestSubType;
extern const std::string kInsertMessageType;
extern const std::string kInsertLanguage;
extern const std::string kInsertMessageString;
@@ -97,6 +99,7 @@ extern const std::string kDeleteRpc;
extern const std::string kDeleteAppGroup;
extern const std::string kDeleteApplication;
extern const std::string kDeleteRequestType;
+extern const std::string kDeleteRequestSubType;
extern const std::string kDeleteDevice;
extern const std::string kIncrementIgnitionCycles;
extern const std::string kResetIgnitionCycles;
@@ -114,6 +117,19 @@ extern const std::string kInsertApplicationFull;
extern const std::string kDeletePreconsentedGroupsByApplicationId;
extern const std::string kSelectApplicationFull;
extern const std::string kUpdatePreloaded;
+extern const std::string kUpdateRemoteControlDenied;
+extern const std::string kSelectRemoteControlDenied;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectModuleTypes;
+extern const std::string kInsertModuleType;
+extern const std::string kInsertAccessModule;
+extern const std::string kSelectAccessModules;
+extern const std::string kDeleteAccessModules;
+extern const std::string kInsertRemoteRpc;
+extern const std::string kSelectRemoteRpcs;
+extern const std::string kDeleteRemoteRpc;
+extern const std::string kDeleteModuleTypes;
+extern const std::string kDeleteAllDevices;
extern const std::string kSelectDBVersion;
extern const std::string kUpdateDBVersion;
extern const std::string kSaveModuleMeta;
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
index bd867389ab..0e9302dfac 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -84,7 +84,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
@@ -97,6 +97,21 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
+ enum TypeAccess { kAllowed, kManual };
+ bool GatherModuleType(const std::string& app_id,
+ policy_table::ModuleTypes* module_types) const;
+ bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const;
+ bool GatherAccessModule(TypeAccess access,
+ policy_table::AccessModules* modules) const;
+ bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const;
+ bool SaveModuleType(const std::string& app_id,
+ const policy_table::ModuleTypes& types);
+ bool SaveRemoteControlDenied(const std::string& app_id, bool deny);
+
+ bool SaveAccessModule(TypeAccess access,
+ const policy_table::AccessModules& modules);
+ bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
+
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
virtual bool GatherUsageAndErrorCounts(
@@ -115,6 +130,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
policy_table::AppHMITypes* app_types) const;
bool GatherRequestType(const std::string& app_id,
policy_table::RequestTypes* request_types) const;
+ bool GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const;
bool GatherNickName(const std::string& app_id,
policy_table::Strings* nicknames) const;
@@ -150,6 +168,9 @@ class SQLPTRepresentation : public virtual PTRepresentation {
const policy_table::AppHMITypes& types);
bool SaveRequestType(const std::string& app_id,
const policy_table::RequestTypes& types);
+ bool SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes);
public:
bool UpdateRequired() const;
diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h
index ee127d3236..c1ea2de4c1 100644
--- a/src/components/policy/policy_regular/include/policy/status.h
+++ b/src/components/policy/policy_regular/include/policy/status.h
@@ -53,7 +53,8 @@ enum UpdateEvent {
kOnResetPolicyTableNoUpdate,
kScheduleUpdate,
kScheduleManualUpdate,
- kOnResetRetrySequence
+ kOnResetRetrySequence,
+ kNoEvent
};
const std::string kUpToDate = "UP_TO_DATE";
@@ -133,7 +134,7 @@ class UpToDateStatus : public Status {
* @param event Event which needs to be processed
*/
void ProcessEvent(UpdateStatusManagerInterface* manager,
- UpdateEvent event) FINAL;
+ UpdateEvent event) OVERRIDE;
};
/**
@@ -153,13 +154,13 @@ class UpdateNeededStatus : public Status {
* @param event Event which needs to be processed
*/
void ProcessEvent(UpdateStatusManagerInterface* manager,
- UpdateEvent event) FINAL;
+ UpdateEvent event) OVERRIDE;
/**
* @brief Check whether update is required in terms of status
* @return True if update is required, otherwise - false
*/
- bool IsUpdateRequired() const FINAL;
+ bool IsUpdateRequired() const OVERRIDE;
};
/**
@@ -179,19 +180,19 @@ class UpdatingStatus : public Status {
* @param event Event which needs to be processed
*/
void ProcessEvent(UpdateStatusManagerInterface* manager,
- UpdateEvent event) FINAL;
+ UpdateEvent event) OVERRIDE;
/**
* @brief Check whether update is required in terms of status
* @return True if update is required, otherwise - false
*/
- bool IsUpdateRequired() const FINAL;
+ 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 FINAL;
+ bool IsUpdatePending() const OVERRIDE;
};
}
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h
index 89c6b7e7bb..c90acd4957 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -83,9 +83,8 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
/**
* @brief Update status hanlder for PTS sending out
- * @param update_timeout Timeout for waiting of incoming PTU (msec)
*/
- void OnUpdateSentOut(uint32_t update_timeout);
+ void OnUpdateSentOut();
/**
* @brief Update status handler for PTU waiting timeout
@@ -119,10 +118,10 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
void OnNewApplicationAdded(const DeviceConsent consent);
/**
- * @brief Update status handler for policy initialization
+ * @brief Update status handler on existed application registering
* @param is_update_required Update necessity flag
*/
- void OnPolicyInit(bool is_update_required);
+ void OnExistedApplicationAdded(const bool is_update_required);
/**
* @brief In case application from non-consented device has been registered
@@ -199,41 +198,23 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
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_;
};
}
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
index e8da7b9b69..4763ff2eb5 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
-#include "utils/shared_ptr.h"
#include "policy/policy_types.h"
#include "policy/status.h"
@@ -55,14 +54,14 @@ class UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- virtual void SetNextStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetNextStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- virtual void SetPostponedStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetPostponedStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Sets listener pointer
* @param listener Pointer to policy listener implementation
@@ -71,9 +70,8 @@ class UpdateStatusManagerInterface {
/**
* @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;
+ virtual void OnUpdateSentOut() = 0;
/**
* @brief Update status handler for PTU waiting timeout
@@ -107,13 +105,13 @@ class UpdateStatusManagerInterface {
virtual void OnNewApplicationAdded(DeviceConsent device_consent) = 0;
/**
- * @brief Update status handler for policy initialization
+ * @brief Update status handler on existed application registering
* @param is_update_required Update necessity flag
*/
- virtual void OnPolicyInit(bool is_update_required) = 0;
+ virtual void OnExistedApplicationAdded(const bool is_update_required) = 0;
};
-typedef utils::SharedPtr<UpdateStatusManagerInterface>
+typedef std::shared_ptr<UpdateStatusManagerInterface>
UpdateStatusManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h b/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h
deleted file mode 100644
index 8093c11467..0000000000
--- a/src/components/policy/policy_regular/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_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
index 1e263ec9df..72ae5fd9e0 100644
--- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
void Start(AppStopwatchId stopwatch_type) OVERRIDE;
@@ -96,7 +96,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
diff --git a/src/components/policy/policy_regular/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml
index 468eec2b0b..7a751c0ea9 100644
--- a/src/components/policy/policy_regular/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml
@@ -1,3 +1,4 @@
+
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
@@ -26,20 +27,24 @@
<element name="speed" />
<element name="engineTorque" />
<element name="externalTemperature" />
+ <element name="turnSignal" />
<element name="fuelLevel" />
<element name="fuelLevel_State" />
<element name="headLampStatus" />
<element name="instantFuelConsumption" />
+ <element name="fuelRange" />
<element name="odometer" />
<element name="tirePressure" />
<element name="wiperStatus" />
<element name="vin" />
<element name="accPedalPosition" />
<element name="beltStatus" />
+ <element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
<element name="prndl" />
<element name="rpm" />
<element name="steeringWheelAngle" />
+ <element name="engineOilLife" />
<element name="myKey" />
<element name="airbagStatus" />
<element name="bodyInformation" />
@@ -89,8 +94,7 @@
<typedef name="HmiLevels" type="HmiLevel" array="true"
maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
+ <typedef name="Parameters" type="Parameter" array="true"/>
<struct name="RpcParameters">
<!-- maxsizes are equal to number of currently known elements of
@@ -123,7 +127,7 @@
minsize="1" maxsize="255" />
<typedef name="NumberOfNotificationsPerMinute" type="Integer"
- map="true" maxsize="6" minvalue="0" maxvalue="255" />
+ map="true" maxsize="7" minvalue="0" maxvalue="255" />
<typedef name="SecondsBetweenRetries" type="Integer" array="true"
maxsize="10" minvalue="1" maxvalue="1000" />
@@ -131,6 +135,7 @@
<struct name="ModuleConfig">
<param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
<param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="full_app_id_supported" type="Boolean" mandatory="false" />
<param name="exchange_after_x_ignition_cycles" type="Integer"
maxvalue="255" />
<param name="exchange_after_x_kilometers" type="Integer"
diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
new file mode 100644
index 0000000000..f743a4d56e
--- /dev/null
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "policy/access_remote_impl.h"
+
+#include <algorithm>
+#include <iterator>
+#include "policy/cache_manager.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
+
+using policy_table::DeviceData;
+using policy_table::FunctionalGroupings;
+using rpc::policy_table_interface_base::EnumFromJsonString;
+
+namespace policy {
+
+struct ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(item);
+ if (!IsValidEnum(type)) {
+ LOG4CXX_WARN(logger_, "HMI type isn't known " << item);
+ type = policy_table::AHT_DEFAULT;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "HMI type: " << item << " - " << EnumToJsonString(type));
+ return policy_table::AppHMITypes::value_type(type);
+ }
+};
+
+struct Contained {
+ private:
+ const policy_table::Strings& params_;
+
+ public:
+ explicit Contained(const policy_table::Strings& params) : params_(params) {}
+ bool operator()(const RemoteControlParams::value_type& item) const {
+ return std::find_if(params_.begin(), params_.end(), CompareString(item)) !=
+ params_.end();
+ }
+ struct CompareString {
+ private:
+ const RemoteControlParams::value_type& value_;
+
+ public:
+ explicit CompareString(const RemoteControlParams::value_type& value)
+ : value_(value) {}
+ bool operator()(const policy_table::Strings::value_type& item) const {
+ return value_ == static_cast<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
+ : cache_(cache) {}
+
+bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!cache_->IsApplicationRepresented(app_id)) {
+ return false;
+ }
+
+ const policy_table::ApplicationParams& app =
+ cache_->pt()->policy_table.app_policies_section.apps[app_id];
+ if (!app.moduleType.is_initialized()) {
+ return false;
+ }
+
+ const policy_table::ModuleTypes& modules = *app.moduleType;
+ if (modules.empty()) {
+ return true;
+ }
+
+ return std::find(modules.begin(), modules.end(), module) != modules.end();
+}
+
+bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::AccessModules::const_iterator i = modules.find(module_name);
+ if (i == modules.end()) {
+ LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found");
+ return false;
+ }
+
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ if (rpcs.empty()) {
+ return true;
+ }
+ policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name);
+ if (j != rpcs.end()) {
+ const policy_table::Strings& parameters = j->second;
+ return CompareParameters(parameters, input);
+ }
+ LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found");
+ return false;
+}
+
+bool AccessRemoteImpl::CompareParameters(
+ const policy_table::Strings& parameters, RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (parameters.empty()) {
+ return true;
+ }
+
+ if (input->empty()) {
+ LOG4CXX_DEBUG(logger_, "Input is empty");
+ return false;
+ }
+
+ input->erase(
+ std::remove_if(input->begin(), input->end(), Contained(parameters)),
+ input->end());
+ return input->empty();
+}
+
+void AccessRemoteImpl::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HMIList::mapped_type types;
+ std::transform(hmi_types.begin(),
+ hmi_types.end(),
+ std::back_inserter(types),
+ ToHMIType());
+ hmi_types_[who] = types;
+}
+
+const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(who.app_id)) {
+ return hmi_types_[who];
+ } else {
+ return *cache_->pt()
+ ->policy_table.app_policies_section.apps[who.app_id]
+ .AppHMIType;
+ }
+}
+
+const policy_table::Strings& AccessRemoteImpl::GetGroups(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const policy_table::AppHMITypes& hmi_types = HmiTypes(who);
+ return std::find(hmi_types.begin(),
+ hmi_types.end(),
+ policy_table::AHT_REMOTE_CONTROL) != hmi_types.end();
+}
+
+bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]);
+ GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]);
+ GetGroupsIds(
+ device_id, kPreDataConsentId, group_types[kTypePreDataConsented]);
+ return true;
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const FunctionalGroupIDs& types) {
+ std::copy(types.begin(),
+ types.end(),
+ std::ostream_iterator<FunctionalGroupIDs::value_type>(output, " "));
+ return output;
+}
+
+void AccessRemoteImpl::GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& groups_ids) {
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings& groups = GetGroups(who);
+ groups_ids.resize(groups.size());
+ std::transform(groups.begin(),
+ groups.end(),
+ groups_ids.begin(),
+ &CacheManager::GenerateHash);
+ LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids);
+}
+
+bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id,
+ std::vector<std::string>* modules) {
+ DCHECK(modules);
+ policy_table::ApplicationPolicies& apps =
+ cache_->pt()->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator i = apps.find(application_id);
+ if (i == apps.end()) {
+ return false;
+ }
+ rpc::Optional<policy_table::ModuleTypes> moduleTypes = i->second.moduleType;
+ if (!moduleTypes.is_initialized()) {
+ return false;
+ }
+ std::transform(moduleTypes->begin(),
+ moduleTypes->end(),
+ std::back_inserter(*modules),
+ ToModuleType());
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index e1a6544c23..bd95fc8e7c 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -36,8 +36,10 @@
#include <functional>
#include <ctime>
#include <cmath>
+#include <sstream>
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "json/reader.h"
#include "json/features.h"
#include "json/writer.h"
@@ -82,11 +84,27 @@ struct LanguageFinder {
const std::string& language_;
};
+struct PolicyTableUpdater {
+ PolicyTableUpdater(const policy_table::ApplicationParams& default_params)
+ : default_params_(default_params) {}
+
+ void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ if (policy::kDefaultId == pt_value.second.get_string()) {
+ pt_value.second = default_params_;
+ pt_value.second.set_to_string(policy::kDefaultId);
+ }
+ }
+
+ private:
+ const policy_table::ApplicationParams& default_params_;
+};
+
CacheManager::CacheManager()
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTRepresentation())
- , update_required(false) {
+ , update_required(false)
+ , settings_(nullptr) {
LOG4CXX_AUTO_TRACE(logger_);
backuper_ = new BackgroundBackuper(this);
backup_thread_ = threads::CreateThread("Backup thread", backuper_);
@@ -101,6 +119,11 @@ CacheManager::~CacheManager() {
threads::DeleteThread(backup_thread_);
}
+const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.app_policies_section.apps[app_id].groups;
+}
+
bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
bool result = true;
@@ -109,6 +132,7 @@ bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
uint32_t result = 0;
if (!AppExists(app_id)) {
return result;
@@ -123,6 +147,21 @@ uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
return result;
}
+const policy_table::AppHMITypes* CacheManager::GetHMITypes(
+ const std::string& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& apps =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
+ if (i != apps.end()) {
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
+ }
+ return NULL;
+}
+
bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
bool result = true;
@@ -132,8 +171,8 @@ bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
bool CacheManager::GetDefaultHMI(const std::string& app_id,
std::string& default_hmi) const {
CACHE_MANAGER_CHECK(false);
- bool result = true;
- return result;
+ default_hmi = "NONE";
+ return true;
}
bool CacheManager::ResetUserConsent() {
@@ -161,6 +200,7 @@ void CacheManager::GetAllAppGroups(const std::string& app_id,
return;
}
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator app_params_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
@@ -218,21 +258,18 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
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;
- }
- pt_->policy_table.app_policies_section.apps[iter->first] =
- iter_default->second;
} else {
pt_->policy_table.app_policies_section.apps[iter->first] = iter->second;
+ if (kDefaultId == iter->first) {
+ std::for_each(pt_->policy_table.app_policies_section.apps.begin(),
+ pt_->policy_table.app_policies_section.apps.end(),
+ PolicyTableUpdater(iter->second));
+ }
}
}
@@ -254,6 +291,7 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
std::map<std::string, StringArray>& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter_begin =
pt_->policy_table.app_policies_section.apps.begin();
policy_table::ApplicationPolicies::const_iterator policy_iter_end =
@@ -275,6 +313,27 @@ void CacheManager::GetHMIAppTypeAfterUpdate(
}
}
+bool CacheManager::AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(application_id);
+
+ if (policy_iter == policies.end()) {
+ return false;
+ }
+
+ if (policy_iter->second.AppHMIType.is_initialized()) {
+ return helpers::in_range(*(policy_iter->second.AppHMIType),
+ rpc::Enum<policy_table::AppHMIType>(hmi_type));
+ }
+
+ return false;
+}
+
void CacheManager::Backup() {
sync_primitives::AutoLock lock(backuper_locker_);
DCHECK(backuper_);
@@ -368,6 +427,7 @@ bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
void CacheManager::GetGroupNameByHashID(const int32_t group_id,
std::string& group_name) {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::FunctionalGroupings::const_iterator fg_iter =
pt_->policy_table.functional_groupings.begin();
policy_table::FunctionalGroupings::const_iterator fg_iter_end =
@@ -401,6 +461,7 @@ void CacheManager::SaveUpdateRequired(bool status) {
bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
bool is_revoked = false;
if (pt_->policy_table.app_policies_section.apps.end() !=
pt_->policy_table.app_policies_section.apps.find(app_id)) {
@@ -410,25 +471,16 @@ bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
return is_revoked;
}
-void CacheManager::CheckPermissions(const PTString& app_id,
+void CacheManager::CheckPermissions(const policy_table::Strings& groups,
const PTString& hmi_level,
const PTString& rpc,
CheckPermissionResult& result) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
- 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::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;
@@ -442,6 +494,13 @@ void CacheManager::CheckPermissions(const PTString& app_id,
if (rpcs.rpcs.end() != rpc_iter) {
policy_table::RpcParameters rpc_param = rpc_iter->second;
+ if (rpc_param.parameters.is_initialized() &&
+ rpc_param.parameters->empty()) {
+ // If "parameters" field exist in PT section of incoming RPC but empty
+ // all params considered as DISALLOWED
+ result.hmi_level_permitted = kRpcDisallowed;
+ return;
+ }
policy_table::HmiLevel hmi_level_e;
policy_table::EnumFromJsonString(hmi_level, &hmi_level_e);
@@ -470,11 +529,13 @@ void CacheManager::CheckPermissions(const PTString& app_id,
bool CacheManager::IsPTPreloaded() {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return *pt_->policy_table.module_config.preloaded_pt;
}
int CacheManager::IgnitionCyclesBeforeExchange() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const uint8_t limit = std::max(
static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_ignition_cycles),
@@ -494,6 +555,7 @@ int CacheManager::IgnitionCyclesBeforeExchange() {
int CacheManager::KilometersBeforeExchange(int current) {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int limit =
std::max(static_cast<int>(
pt_->policy_table.module_config.exchange_after_x_kilometers),
@@ -514,6 +576,7 @@ int CacheManager::KilometersBeforeExchange(int current) {
bool CacheManager::SetCountersPassedForSuccessfulUpdate(
policy::Counters counter, int value) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
switch (counter) {
case KILOMETERS:
*pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
@@ -539,6 +602,7 @@ bool CacheManager::SetCountersPassedForSuccessfulUpdate(
int CacheManager::DaysBeforeExchange(int current) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const rpc::Optional<rpc::Integer<uint16_t, 0, 65535> >& days_after_epoch =
(pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
@@ -562,6 +626,7 @@ int CacheManager::DaysBeforeExchange(int current) {
void CacheManager::IncrementIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const int ign_val = static_cast<int>(
*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
@@ -572,18 +637,21 @@ void CacheManager::IncrementIgnitionCycles() {
void CacheManager::ResetIgnitionCycles() {
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
(*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
Backup();
}
int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
pt_->policy_table.module_config.seconds_between_retries.begin();
rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
@@ -600,6 +668,7 @@ bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
CACHE_MANAGER_CHECK(VehicleInfo());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
VehicleInfo vehicle_info;
vehicle_info.vehicle_make = *module_config.vehicle_make;
@@ -621,6 +690,7 @@ std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
std::vector<std::string>::const_iterator it = msg_codes.begin();
std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
for (; it != it_end; ++it) {
policy_table::MessageLanguages msg_languages =
(*pt_->policy_table.consumer_friendly_messages->messages)[*it];
@@ -680,6 +750,7 @@ void CacheManager::GetUpdateUrls(const std::string& service_type,
LOG4CXX_DEBUG(logger_, "Search service value is: " << service_type);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ServiceEndpoints::const_iterator iter =
pt_->policy_table.module_config.endpoints.find(service_type);
@@ -712,6 +783,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
CACHE_MANAGER_CHECK(0);
typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const NNPM& nnpm =
pt_->policy_table.module_config.notifications_per_minute_by_priority;
@@ -725,6 +797,7 @@ CacheManager::GetNotificationsNumber(const std::string& priority) {
bool CacheManager::GetPriority(const std::string& policy_app_id,
std::string& priority) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
priority = EnumToJsonString(
pt_->policy_table.app_policies_section.device.priority);
@@ -753,6 +826,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ get_settings().use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -861,11 +937,12 @@ void CacheManager::CheckSnapshotInitialization() {
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();
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
+ // Comma expression is used to hold the lock only during the constructor
+ // call
+ policy_table::Table copy_pt(
+ (sync_primitives::AutoLock(cache_lock_), *pt_));
backup_->Save(copy_pt);
backup_->SaveUpdateRequired(update_required);
@@ -955,14 +1032,14 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- sync_primitives::AutoLock lock(cache_lock_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
// Copy all members of policy table except messages in consumer friendly
// messages
+ sync_primitives::AutoLock auto_lock(cache_lock_);
snapshot_->policy_table.app_policies_section =
pt_->policy_table.app_policies_section;
snapshot_->policy_table.functional_groupings =
@@ -989,6 +1066,7 @@ bool CacheManager::GetInitialAppData(const std::string& app_id,
StringArray& app_hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator policy_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
@@ -1011,6 +1089,7 @@ bool CacheManager::GetFunctionalGroupings(
policy_table::FunctionalGroupings& groups) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const policy_table::FunctionalGroupings& f_groupings =
pt_->policy_table.functional_groupings;
@@ -1031,6 +1110,7 @@ bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
const std::string& wers_country_code,
const std::string& language) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
// We have to set preloaded flag as false in policy table on any response
// of GetSystemInfo (SDLAQ-CRS-2365)
@@ -1055,6 +1135,7 @@ bool CacheManager::SetSystemLanguage(const std::string& language) {
bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
pt_->policy_table.functional_groupings.begin();
rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
@@ -1188,7 +1269,7 @@ long CacheManager::ConvertSecondsToMinute(int seconds) {
bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
- sync_primitives::AutoLock lock(cache_lock_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(kDefaultId);
if (pt_->policy_table.app_policies_section.apps.end() != iter) {
@@ -1203,6 +1284,7 @@ bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result =
pt_->policy_table.app_policies_section.apps.end() !=
pt_->policy_table.app_policies_section.apps.find(app_id) &&
@@ -1214,6 +1296,7 @@ bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
bool CacheManager::SetIsDefault(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
if (pt_->policy_table.app_policies_section.apps.end() != iter) {
@@ -1225,7 +1308,7 @@ bool CacheManager::SetIsDefault(const std::string& app_id) {
bool CacheManager::SetPredataPolicy(const std::string& app_id) {
CACHE_MANAGER_CHECK(false);
- sync_primitives::AutoLock lock(cache_lock_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(kPreDataConsentId);
@@ -1249,6 +1332,7 @@ bool CacheManager::SetPredataPolicy(const std::string& app_id) {
bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
// TODO(AOleynik): Maybe change for comparison with pre_DataConsent
// permissions or check string value from get_string()
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (!IsApplicationRepresented(app_id)) {
return false;
}
@@ -1275,6 +1359,7 @@ bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
bool CacheManager::SetUnpairedDevice(const std::string& device_id,
bool unpaired) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
const bool result = pt_->policy_table.device_data->end() !=
pt_->policy_table.device_data->find(device_id);
if (!result) {
@@ -1307,6 +1392,7 @@ bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
if (kDeviceId == app_id) {
return true;
}
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::const_iterator iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
return pt_->policy_table.app_policies_section.apps.end() != iter;
@@ -1333,7 +1419,9 @@ bool CacheManager::Init(const std::string& file_name,
backup_->UpdateDBVersion();
Backup();
}
- MergePreloadPT(file_name);
+ if (!MergePreloadPT(file_name)) {
+ result = false;
+ }
}
} break;
case InitResult::SUCCESS: {
@@ -1341,7 +1429,7 @@ bool CacheManager::Init(const std::string& file_name,
result = LoadFromFile(file_name, *pt_);
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
"Check if snapshot is valid: " << std::boolalpha << result);
@@ -1366,15 +1454,39 @@ bool CacheManager::Init(const std::string& file_name,
void CacheManager::FillDeviceSpecificData() {}
bool CacheManager::LoadFromBackup() {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(cache_lock_);
pt_ = backup_->GenerateSnapshot();
update_required = backup_->UpdateRequired();
-
+ LOG4CXX_DEBUG(logger_,
+ "Update required flag from backup: " << std::boolalpha
+ << update_required);
FillDeviceSpecificData();
return true;
}
+void CacheManager::MakeLowerCaseAppNames(policy_table::Table& pt) const {
+ policy_table::ApplicationPolicies& apps =
+ pt.policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::iterator iter = apps.begin();
+ iter != apps.end();) {
+ std::string key = iter->first;
+ if (key == kDefaultId || key == kPreDataConsentId || key == kDeviceId) {
+ ++iter;
+ continue;
+ }
+
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ if (key.compare(iter->first) != 0) {
+ std::swap(apps[key], iter->second);
+ iter = apps.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
bool CacheManager::LoadFromFile(const std::string& file_name,
policy_table::Table& table) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1403,6 +1515,8 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
LOG4CXX_DEBUG(logger_, "PT out:");
LOG4CXX_DEBUG(logger_, s_writer.write(table.ToJsonValue()));
+ MakeLowerCaseAppNames(table);
+
if (!table.is_valid()) {
rpc::ValidationReport report("policy_table");
table.ReportErrors(&report);
@@ -1410,6 +1524,7 @@ bool CacheManager::LoadFromFile(const std::string& file_name,
"Parsed table is not valid " << rpc::PrettyFormat(report));
return false;
}
+
return true;
}
@@ -1421,6 +1536,7 @@ bool CacheManager::ResetPT(const std::string& file_name) {
bool CacheManager::AppExists(const std::string& app_id) const {
CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
policy_table::ApplicationPolicies::iterator policy_iter =
pt_->policy_table.app_policies_section.apps.find(app_id);
return pt_->policy_table.app_policies_section.apps.end() != policy_iter;
@@ -1441,11 +1557,38 @@ int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
return result;
}
+RequestType::State CacheManager::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request types for app_id " << policy_app_id);
+ return RequestType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestTypes& request_types =
+ *app_policies_iter->second.RequestType;
+ if (!request_types.is_initialized()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types for " << policy_app_id << " are OMITTED");
+ return RequestType::State::OMITTED;
+ }
+ if (request_types.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types for " << policy_app_id << " are EMPTY");
+ return RequestType::State::EMPTY;
+ }
+ return RequestType::State::AVAILABLE;
+}
+
void CacheManager::GetAppRequestTypes(
const std::string& policy_app_id,
std::vector<std::string>& request_types) const {
LOG4CXX_AUTO_TRACE(logger_);
CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (kDeviceId == policy_app_id) {
LOG4CXX_DEBUG(logger_,
"Request types not applicable for app_id " << kDeviceId);
@@ -1458,29 +1601,79 @@ void CacheManager::GetAppRequestTypes(
"Can't find request types for app_id " << policy_app_id);
return;
}
- policy_table::RequestTypes::iterator it_request_type =
- policy_iter->second.RequestType->begin();
- for (; it_request_type != policy_iter->second.RequestType->end();
- ++it_request_type) {
- request_types.push_back(EnumToJsonString(*it_request_type));
+
+ for (const auto& request_type : *policy_iter->second.RequestType) {
+ request_types.push_back(EnumToJsonString(request_type));
+ }
+ return;
+}
+
+RequestSubType::State CacheManager::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator app_policies_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == app_policies_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return RequestSubType::State::UNAVAILABLE;
+ }
+ const policy_table::RequestSubTypes& request_subtypes =
+ *app_policies_iter->second.RequestSubType;
+ if (!request_subtypes.is_initialized()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes for " << policy_app_id << " are OMITTED");
+ return RequestSubType::State::OMITTED;
+ }
+ if (request_subtypes.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes for " << policy_app_id << " are EMPTY");
+ return RequestSubType::State::EMPTY;
+ }
+ return RequestSubType::State::AVAILABLE;
+}
+
+void CacheManager::GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request subtypes not applicable for app_id " << kDeviceId);
+ return;
+ }
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request subtypes for app_id " << policy_app_id);
+ return;
+ }
+
+ for (const auto& request_subtype : *policy_iter->second.RequestSubType) {
+ request_types.push_back(request_subtype);
}
return;
}
std::string CacheManager::GetCertificate() const {
CACHE_MANAGER_CHECK(std::string(""));
+ sync_primitives::AutoLock auto_lock(cache_lock_);
if (pt_->policy_table.module_config.certificate.is_initialized()) {
return *pt_->policy_table.module_config.certificate;
}
return std::string("");
}
-void CacheManager::MergePreloadPT(const std::string& file_name) {
+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;
+ return false;
}
sync_primitives::AutoLock lock(cache_lock_);
@@ -1495,6 +1688,7 @@ void CacheManager::MergePreloadPT(const std::string& file_name) {
MergeCFM(new_table, current);
Backup();
}
+ return true;
}
void CacheManager::MergeMC(const policy_table::PolicyTable& new_pt,
@@ -1564,6 +1758,12 @@ const PolicySettings& CacheManager::get_settings() const {
return *settings_;
}
+void CacheManager::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Implementation does not support user consents.");
+}
+
CacheManager::BackgroundBackuper::BackgroundBackuper(
CacheManager* cache_manager)
: cache_manager_(cache_manager)
@@ -1591,9 +1791,10 @@ 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();
+ {
+ sync_primitives::AutoUnlock unlock(need_backup_lock_);
+ InternalBackup();
+ }
if (new_data_available_ || stop_flag_) {
continue;
}
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index b72a041a83..bae9fceb49 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -121,8 +121,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot)
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot)
: pm_(pm), update_(update), snapshot_(snapshot) {}
bool policy::CheckAppPolicy::HasRevokedGroups(
@@ -267,9 +267,7 @@ void policy::CheckAppPolicy::NotifySystem(
}
void CheckAppPolicy::SendPermissionsToApp(
- const AppPoliciesValueType& app_policy) const {
- const std::string app_id = app_policy.first;
-
+ const std::string& app_id, const policy_table::Strings& groups) const {
const std::string device_id = pm_->GetCurrentDeviceId(app_id);
if (device_id.empty()) {
LOG4CXX_WARN(logger_,
@@ -281,7 +279,7 @@ void CheckAppPolicy::SendPermissionsToApp(
Permissions notification_data;
pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
- app_policy.second.groups,
+ groups,
group_permissons,
notification_data);
@@ -341,9 +339,20 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
}
PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
- if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
- NotifySystem(app_policy);
+ if (!IsPredefinedApp(app_policy)) {
+ const bool is_request_type_changed = IsRequestTypeChanged(app_policy);
+ const bool is_request_subtype_changed = IsRequestSubTypeChanged(app_policy);
+
+ if (is_request_type_changed) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
+ }
+ if (is_request_subtype_changed) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_SUBTYPE_CHANGED);
+ }
+
+ if (is_request_type_changed || is_request_subtype_changed) {
+ NotifySystem(app_policy);
+ }
}
if (RESULT_NO_CHANGES == result) {
LOG4CXX_INFO(logger_,
@@ -356,6 +365,20 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
"Permissions for application:" << app_id
<< " have been changed.");
+ if (IsPredefinedApp(app_policy)) {
+ for (const policy_table::ApplicationPolicies::value_type& app :
+ snapshot_->policy_table.app_policies_section.apps) {
+ if (app_policy.first == app.second.get_string()) {
+ if (RESULT_CONSENT_NOT_REQIURED != result) {
+ SetPendingPermissions(app, result);
+ NotifySystem(app);
+ }
+ SendPermissionsToApp(app.first, app_policy.second.groups);
+ }
+ }
+ return true;
+ }
+
if (!IsPredefinedApp(app_policy) && RESULT_CONSENT_NOT_REQIURED != result) {
SetPendingPermissions(app_policy, result);
NotifySystem(app_policy);
@@ -363,7 +386,7 @@ bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
// Don't sent notification for predefined apps (e.g. default, device etc.)
if (!IsPredefinedApp(app_policy)) {
- SendPermissionsToApp(app_policy);
+ SendPermissionsToApp(app_policy.first, app_policy.second.groups);
}
return true;
}
@@ -400,17 +423,19 @@ void policy::CheckAppPolicy::SetPendingPermissions(
case RESULT_REQUEST_TYPE_CHANGED:
permissions_diff.priority.clear();
permissions_diff.requestTypeChanged = true;
- {
- // Getting RequestTypes from PTU (not from cache)
- policy_table::RequestTypes::const_iterator it_request_type =
- app_policy.second.RequestType->begin();
- for (; app_policy.second.RequestType->end() != it_request_type;
- ++it_request_type) {
- permissions_diff.requestType.push_back(
- EnumToJsonString(*it_request_type));
- }
- }
+ // Getting Request Types from PTU (not from cache)
+ for (const auto& request_type : *app_policy.second.RequestType) {
+ permissions_diff.requestType.push_back(EnumToJsonString(request_type));
+ }
+ break;
+ case RESULT_REQUEST_SUBTYPE_CHANGED:
+ permissions_diff.priority.clear();
+ permissions_diff.requestSubTypeChanged = true;
+ // Getting Request SubTypes from PTU (not from cache)
+ for (const auto& request_subtype : *app_policy.second.RequestSubType) {
+ permissions_diff.requestSubType.push_back(request_subtype);
+ }
break;
default:
return;
@@ -479,6 +504,32 @@ bool CheckAppPolicy::IsRequestTypeChanged(
return diff.size();
}
+bool CheckAppPolicy::IsRequestSubTypeChanged(
+ const AppPoliciesValueType& app_policy) const {
+ policy::AppPoliciesConstItr it =
+ snapshot_->policy_table.app_policies_section.apps.find(app_policy.first);
+
+ if (it == snapshot_->policy_table.app_policies_section.apps.end()) {
+ if (!app_policy.second.RequestSubType->empty()) {
+ return true;
+ }
+ return false;
+ }
+
+ if (it->second.RequestSubType->size() !=
+ app_policy.second.RequestSubType->size()) {
+ return true;
+ }
+
+ policy_table::RequestSubTypes diff;
+ std::set_difference(it->second.RequestSubType->begin(),
+ it->second.RequestSubType->end(),
+ app_policy.second.RequestSubType->begin(),
+ app_policy.second.RequestSubType->end(),
+ std::back_inserter(diff));
+ return diff.size();
+}
+
FillNotificationData::FillNotificationData(Permissions& data,
GroupConsent group_state,
GroupConsent undefined_group_consent)
@@ -697,7 +748,7 @@ void FillFunctionalGroupPermissions(
FunctionalGroupNames& names,
GroupConsent state,
std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs::const_iterator it = ids.begin();
FunctionalGroupIDs::const_iterator it_end = ids.end();
for (; it != it_end; ++it) {
@@ -717,7 +768,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) {
FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs from_copy(from);
FunctionalGroupIDs what_copy(what);
@@ -739,7 +790,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs first_copy(first);
FunctionalGroupIDs second_copy(second);
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index 563dfbb168..4985035629 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -44,12 +44,14 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
+
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -60,7 +62,7 @@ void DeleteManager(policy::PolicyManager* pm) {
namespace {
const uint32_t kDefaultRetryTimeoutInMSec =
- 60u * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ 60u * date_time::MILLISECONDS_IN_SECOND;
} // namespace
namespace policy {
@@ -71,13 +73,18 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, 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, "") {}
+ , 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;
@@ -86,21 +93,21 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) {
#ifdef USE_HMI_PTU_DECRYPTION
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
#else
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::ParseArray(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
@@ -109,12 +116,12 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
// For PT Update received from SDL Server.
if (value["data"].size() != 0) {
Json::Value data = value["data"];
- return new policy_table::Table(&data[0]);
+ return std::make_shared<policy_table::Table>(&data[0]);
} else {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
}
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::shared_ptr<policy_table::Table>();
}
}
@@ -136,19 +143,165 @@ void PolicyManagerImpl::CheckTriggers() {
}
}
+/**
+ * @brief FilterInvalidFunctions filter functions that are absent in schema
+ * @param rpcs list of functions to filter
+ */
+void FilterInvalidFunctions(policy_table::Rpc& rpcs) {
+ policy_table::Rpc valid_rpcs;
+ for (const auto& rpc : rpcs) {
+ const std::string& rpc_name = rpc.first;
+ policy_table::FunctionID function_id;
+ if (policy_table::EnumFromJsonString(rpc_name, &function_id)) {
+ valid_rpcs.insert(rpc);
+ }
+ }
+ rpcs.swap(valid_rpcs);
+}
+
+/**
+ * @brief FilterInvalidRPCParameters filter parameters that not present in
+ * schema
+ * @param rpc_parameters parameters to filter
+ */
+void FilterInvalidRPCParameters(policy_table::RpcParameters& rpc_parameters) {
+ policy_table::HmiLevels valid_hmi_levels;
+ for (const auto& hmi_level : rpc_parameters.hmi_levels) {
+ if (hmi_level.is_valid()) {
+ valid_hmi_levels.push_back(hmi_level);
+ }
+ }
+ rpc_parameters.hmi_levels.swap(valid_hmi_levels);
+
+ policy_table::Parameters valid_params;
+ const policy_table::Parameters& params = *(rpc_parameters.parameters);
+ for (const auto& param : params) {
+ if (param.is_valid()) {
+ valid_params.push_back(param);
+ }
+ }
+ rpc_parameters.parameters->swap(valid_params);
+}
+
+/**
+ * @brief FilterInvalidPriorityValues filter notification priorities that are
+ * not present in schema
+ * @param notifications priorities to filter
+ */
+void FilterInvalidPriorityValues(
+ policy_table::NumberOfNotificationsPerMinute& notifications) {
+ policy_table::NumberOfNotificationsPerMinute valid_notifications;
+ for (const auto& notification : notifications) {
+ policy_table::Priority priority;
+ if (policy_table::EnumFromJsonString(notification.first, &priority)) {
+ valid_notifications.insert(notification);
+ }
+ }
+ notifications.swap(valid_notifications);
+}
+
+/**
+ * @brief FilterInvalidApplicationParameters filter app params that are not
+ * present in schema
+ * @param app_params object of app policy params to filter
+ */
+void FilterInvalidApplicationParameters(
+ policy_table::ApplicationParams& app_params) {
+ // Filter AppHMIType array
+ policy_table::AppHMITypes valid_app_hmi_types;
+ const policy_table::AppHMITypes& app_hmi_types = *(app_params.AppHMIType);
+ for (const auto& app_hmi_type : app_hmi_types) {
+ if (app_hmi_type.is_valid()) {
+ valid_app_hmi_types.push_back(app_hmi_type);
+ }
+ }
+ app_params.AppHMIType->swap(valid_app_hmi_types);
+
+ // Filter RquestTypes array
+ policy_table::RequestTypes valid_request_types;
+ const policy_table::RequestTypes& request_types = *(app_params.RequestType);
+ for (const auto& request_type : request_types) {
+ if (request_type.is_valid()) {
+ valid_request_types.push_back(request_type);
+ }
+ }
+ if (valid_request_types.empty() && !request_types.empty()) {
+ // An empty RequestType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.RequestType) = policy_table::RequestTypes();
+ } else {
+ app_params.RequestType->swap(valid_request_types);
+ }
+
+ // Filter moduleType array
+ policy_table::ModuleTypes valid_module_types;
+ const policy_table::ModuleTypes& module_types = *(app_params.moduleType);
+ for (const auto& module_type : module_types) {
+ if (module_type.is_valid()) {
+ valid_module_types.push_back(module_type);
+ }
+ }
+ if (valid_module_types.empty() && !module_types.empty()) {
+ // An empty moduleType array will allow all request types. No valid
+ // parameters are in the filtered array, so assign an uninitialized value to
+ // for array to be "omitted"
+ *(app_params.moduleType) = policy_table::ModuleTypes();
+ } else {
+ app_params.moduleType->swap(valid_module_types);
+ }
+
+ // Filter priority
+ if (!app_params.priority.is_valid()) {
+ app_params.priority = policy_table::Priority();
+ }
+}
+
+/**
+ * @brief FilterPolicyTable filter values that not present in schema
+ * @param pt policy table to filter
+ */
+void FilterPolicyTable(policy_table::PolicyTable& pt) {
+ policy_table::ModuleConfig& module_config = pt.module_config;
+ if (module_config.is_initialized() &&
+ module_config.notifications_per_minute_by_priority.is_initialized()) {
+ FilterInvalidPriorityValues(
+ module_config.notifications_per_minute_by_priority);
+ }
+
+ if (pt.app_policies_section.is_initialized()) {
+ policy_table::ApplicationPolicies& apps = pt.app_policies_section.apps;
+ for (auto& app_policy : apps) {
+ FilterInvalidApplicationParameters(app_policy.second);
+ }
+ }
+
+ for (auto& group : pt.functional_groupings) {
+ policy_table::Rpc& rpcs = group.second.rpcs;
+ FilterInvalidFunctions(rpcs);
+
+ for (auto& func : rpcs) {
+ FilterInvalidRPCParameters(func.second);
+ }
+ }
+}
+
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
#ifdef USE_HMI_PTU_DECRYPTION
// Assuemes Policy Table was parsed, formatted, and/or decrypted by
// the HMI after system request before calling OnReceivedPolicyUpdate
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
#else
// Message Received from server unecnrypted with PTU in first element
// of 'data' array. No Parsing was done by HMI.
- utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = ParseArray(pt_content);
#endif
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is 0.");
@@ -158,7 +311,9 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
file_system::DeleteFile(file);
+ FilterPolicyTable(pt_update->policy_table);
if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
+ wrong_ptu_update_received_ = true;
update_status_manager_.OnWrongUpdateReceived();
return false;
}
@@ -176,10 +331,13 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to create snapshot of policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -192,14 +350,15 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// Replace current data with updated
if (!cache_->ApplyUpdate(*pt_update)) {
- LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table.");
+ LOG4CXX_WARN(
+ logger_,
+ "Unsuccessful save of updated policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
- if (pt_update->policy_table.module_config.certificate.is_initialized()) {
- listener_->OnCertificateUpdated(
- *(pt_update->policy_table.module_config.certificate));
- }
+ listener_->OnCertificateUpdated(
+ *(pt_update->policy_table.module_config.certificate));
std::map<std::string, StringArray> app_hmi_types;
cache_->GetHMIAppTypeAfterUpdate(app_hmi_types);
@@ -223,8 +382,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
void PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
@@ -259,7 +418,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
bool PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -298,7 +457,8 @@ void PolicyManagerImpl::StartPTExchange() {
}
if (update_status_manager_.IsUpdatePending() && update_required) {
- update_status_manager_.ScheduleUpdate();
+ if (trigger_ptu_)
+ update_status_manager_.ScheduleUpdate();
LOG4CXX_INFO(logger_,
"Starting exchange skipped, since another exchange "
"is in progress.");
@@ -314,10 +474,13 @@ void PolicyManagerImpl::StartPTExchange() {
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);
+ const uint32_t timeout_msec = NextRetryTimeout();
+
+ if (timeout_msec) {
+ LOG4CXX_DEBUG(logger_,
+ "Start retry sequence timeout = " << timeout_msec);
+ timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
+ }
}
}
}
@@ -328,9 +491,12 @@ void PolicyManagerImpl::OnAppsSearchStarted() {
update_status_manager_.OnAppsSearchStarted();
}
-void PolicyManagerImpl::OnAppsSearchCompleted() {
+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();
}
@@ -342,6 +508,12 @@ void PolicyManagerImpl::OnAppRegisteredOnMobile(
SendNotificationOnPermissionsUpdated(application_id);
}
+void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
const std::string policy_app_id) const {
std::vector<std::string> request_types;
@@ -349,26 +521,71 @@ const std::vector<std::string> PolicyManagerImpl::GetAppRequestTypes(
return request_types;
}
+RequestType::State PolicyManagerImpl::GetAppRequestTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestTypesState(policy_app_id);
+}
+
+RequestSubType::State PolicyManagerImpl::GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetAppRequestSubTypesState(policy_app_id);
+}
+
+const std::vector<std::string> PolicyManagerImpl::GetAppRequestSubTypes(
+ const std::string& policy_app_id) const {
+ std::vector<std::string> request_subtypes;
+ cache_->GetAppRequestSubTypes(policy_app_id, request_subtypes);
+ return request_subtypes;
+}
+
const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
return cache_->GetVehicleInfo();
}
-void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
+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.");
- cache_->CheckPermissions(app_id, hmi_level, rpc, result);
+ ApplicationOnDevice who = {device_id, app_id};
+ policy_table::Strings groups;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ groups = access_remote_->GetGroups(who);
+ LOG4CXX_INFO(logger_,
+ "CheckPermissions for " << app_id << " and rpc " << rpc
+ << " for " << hmi_level << " level.");
+ } else {
+ groups = cache_->GetGroups(app_id);
+ }
+
+ cache_->CheckPermissions(groups, hmi_level, rpc, result);
+ if (cache_->IsApplicationRevoked(app_id)) {
+ // 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;
+ return cache_->ResetUserConsent();
}
void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
@@ -409,6 +626,12 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
std::string default_hmi;
default_hmi = "NONE";
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+
listener()->OnPermissionsUpdated(
application_id, notification_data, default_hmi);
}
@@ -645,7 +868,17 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
FunctionalIdType group_types;
- if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) {
+ const ApplicationOnDevice who = {device_id, app_id_to_check};
+ bool ret = false;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ allowed_by_default = false;
+ ret = access_remote_->GetPermissionsForApp(
+ device_id, policy_app_id, group_types);
+ } else {
+ ret = cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+ }
+
+ if (!ret) {
LOG4CXX_WARN(logger_,
"Can't get user permissions for app " << policy_app_id);
return;
@@ -685,7 +918,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
std::string& PolicyManagerImpl::GetCurrentDeviceId(
const std::string& policy_app_id) const {
- LOG4CXX_INFO(logger_, "GetDeviceInfo");
+ LOG4CXX_AUTO_TRACE(logger_);
last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
return last_device_id_;
}
@@ -717,7 +950,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -738,9 +971,9 @@ const PolicySettings& PolicyManagerImpl::get_settings() const {
bool PolicyManagerImpl::ExceededDays() {
LOG4CXX_AUTO_TRACE(logger_);
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
return 0 == cache_->DaysBeforeExchange(days);
}
@@ -779,7 +1012,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() {
LOG4CXX_DEBUG(logger_, "Index: " << retry_sequence_index_);
uint32_t next = 0u;
if (retry_sequence_seconds_.empty() ||
- retry_sequence_index_ >= retry_sequence_seconds_.size()) {
+ retry_sequence_index_ > retry_sequence_seconds_.size()) {
return next;
}
@@ -790,8 +1023,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() {
}
for (uint32_t i = 0u; i < retry_sequence_index_; ++i) {
- next += retry_sequence_seconds_[i] *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next += retry_sequence_seconds_[i] * date_time::MILLISECONDS_IN_SECOND;
next += retry_sequence_timeout_;
}
++retry_sequence_index_;
@@ -827,10 +1059,7 @@ void PolicyManagerImpl::OnExceededTimeout() {
}
void PolicyManagerImpl::OnUpdateStarted() {
- uint32_t update_timeout = TimeoutExchangeMSec();
- LOG4CXX_DEBUG(logger_,
- "Update timeout will be set to (milisec): " << update_timeout);
- update_status_manager_.OnUpdateSentOut(update_timeout);
+ update_status_manager_.OnUpdateSentOut();
cache_->SaveUpdateRequired(true);
}
@@ -946,8 +1175,13 @@ AppIdURL PolicyManagerImpl::RetrySequenceUrl(const struct RetrySequenceURL& rs,
app_idx = 0;
}
}
+ const AppIdURL next_app_url = std::make_pair(app_idx, url_idx);
+
+ return next_app_url;
+}
- return std::make_pair(app_idx, url_idx);
+bool PolicyManagerImpl::HasCertificate() const {
+ return !cache_->GetCertificate().empty();
}
class CallStatusChange : public utils::Callable {
@@ -967,21 +1201,20 @@ class CallStatusChange : public utils::Callable {
};
StatusNotifier PolicyManagerImpl::AddApplication(
- const std::string& application_id) {
+ 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);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
}
+ PromoteExistedApplication(application_id, device_consent);
+ update_status_manager_.OnExistedApplicationAdded(cache_->UpdateRequired());
+ return std::make_shared<utils::CallNothing>();
}
void PolicyManagerImpl::RemoveAppConsentForGroup(
@@ -1004,6 +1237,7 @@ void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
void PolicyManagerImpl::PromoteExistedApplication(
const std::string& application_id, DeviceConsent device_consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
// If device consent changed to allowed during application being
// disconnected, app permissions should be changed also
if (kDeviceAllowed == device_consent &&
@@ -1056,7 +1290,10 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
const bool ret = cache_->Init(file_name, settings);
if (ret) {
RefreshRetrySequence();
- update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
+ const std::string certificate_data = cache_->GetCertificate();
+ if (!certificate_data.empty()) {
+ listener_->OnCertificateUpdated(certificate_data);
+ }
}
return ret;
}
@@ -1071,20 +1308,130 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
}
void PolicyManagerImpl::RetrySequence() {
LOG4CXX_INFO(logger_, "Start new retry sequence");
+ update_status_manager_.OnUpdateTimeoutOccurs();
+
+ const uint32_t timeout_msec = NextRetryTimeout();
+ LOG4CXX_DEBUG(logger_, "New retry sequence timeout = " << timeout_msec);
+ if (!timeout_msec) {
+ if (timer_retry_sequence_.is_running()) {
+ timer_retry_sequence_.Stop();
+ }
+ return;
+ }
+
RequestPTUpdate();
+ timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
+}
- uint32_t timeout = NextRetryTimeout();
+void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice who = {device_id, application_id};
+ access_remote_->SetDefaultHmiTypes(who, hmi_types);
+}
- if (!timeout && timer_retry_sequence_.is_running()) {
- timer_retry_sequence_.Stop();
- return;
+struct HMITypeToInt {
+ int operator()(const policy_table::AppHMITypes::value_type item) {
+ return policy_table::AppHMIType(item);
+ }
+};
+
+bool PolicyManagerImpl::GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(application_id)) {
+ return false;
+ }
+ const policy_table::AppHMITypes* hmi_types =
+ cache_->GetHMITypes(application_id);
+ if (hmi_types) {
+ std::transform(hmi_types->begin(),
+ hmi_types->end(),
+ std::back_inserter(*app_types),
+ HMITypeToInt());
}
- timer_retry_sequence_.Start(timeout, timer::kPeriodic);
+ return hmi_types;
+}
+
+bool PolicyManagerImpl::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleType module_type;
+ return EnumFromJsonString(module, &module_type) &&
+ access_remote_->CheckModuleType(app_id, module_type);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Couldn't get default HMI level for application "
+ << who.app_id);
+ }
+}
+
+void PolicyManagerImpl::GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(data);
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups;
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ app_group_permissions.end();
+ for (; it != it_end; ++it) {
+ app_groups.push_back((*it).group_name);
+ }
+
+ PrepareNotificationData(
+ functional_groupings, app_groups, app_group_permissions, *data);
+}
+
+void PolicyManagerImpl::SendAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ Permissions notification_data;
+ GetPermissions(device_id, application_id, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ std::shared_ptr<AccessRemote> access_remote) {
+ access_remote_ = access_remote;
}
} // namespace policy
diff --git a/src/components/policy/policy_regular/src/policy_table.cc b/src/components/policy/policy_regular/src/policy_table.cc
index c5c6e3e132..b0fa5739da 100644
--- a/src/components/policy/policy_regular/src/policy_table.cc
+++ b/src/components/policy/policy_regular/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 26c7b96b32..428e18d0bd 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -15,6 +15,8 @@ bool IsValidEnum(Priority val) {
return true;
case P_NORMAL:
return true;
+ case P_PROJECTION:
+ return true;
case P_NONE:
return true;
default:
@@ -33,6 +35,8 @@ const char* EnumToJsonString(Priority val) {
return "COMMUNICATION";
case P_NORMAL:
return "NORMAL";
+ case P_PROJECTION:
+ return "PROJECTION";
case P_NONE:
return "NONE";
default:
@@ -55,6 +59,9 @@ bool EnumFromJsonString(const std::string& literal, Priority* result) {
} else if ("NORMAL" == literal) {
*result = P_NORMAL;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = P_PROJECTION;
+ return true;
} else if ("NONE" == literal) {
*result = P_NONE;
return true;
@@ -119,6 +126,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_EXTERNALTEMPERATURE:
return true;
+ case P_TURNSIGNAL:
+ return true;
case P_FUELLEVEL:
return true;
case P_FUELLEVEL_STATE:
@@ -127,6 +136,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_INSTANTFUELCONSUMPTION:
return true;
+ case P_FUELRANGE:
+ return true;
case P_ODOMETER:
return true;
case P_TIREPRESSURE:
@@ -139,6 +150,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -147,6 +160,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_STEERINGWHEELANGLE:
return true;
+ case P_ENGINEOILLIFE:
+ return true;
case P_MYKEY:
return true;
case P_AIRBAGSTATUS:
@@ -161,6 +176,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_ECALLINFO:
return true;
+ case P_EMPTY:
+ return true;
default:
return false;
}
@@ -175,6 +192,8 @@ const char* EnumToJsonString(Parameter val) {
return "engineTorque";
case P_EXTERNALTEMPERATURE:
return "externalTemperature";
+ case P_TURNSIGNAL:
+ return "turnSignal";
case P_FUELLEVEL:
return "fuelLevel";
case P_FUELLEVEL_STATE:
@@ -183,6 +202,8 @@ const char* EnumToJsonString(Parameter val) {
return "headLampStatus";
case P_INSTANTFUELCONSUMPTION:
return "instantFuelConsumption";
+ case P_FUELRANGE:
+ return "fuelRange";
case P_ODOMETER:
return "odometer";
case P_TIREPRESSURE:
@@ -195,6 +216,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -203,6 +226,8 @@ const char* EnumToJsonString(Parameter val) {
return "rpm";
case P_STEERINGWHEELANGLE:
return "steeringWheelAngle";
+ case P_ENGINEOILLIFE:
+ return "engineOilLife";
case P_MYKEY:
return "myKey";
case P_AIRBAGSTATUS:
@@ -217,10 +242,13 @@ const char* EnumToJsonString(Parameter val) {
return "emergencyEvent";
case P_ECALLINFO:
return "eCallInfo";
+ case P_EMPTY:
+ return "EMPTY";
default:
return "";
}
}
+
bool EnumFromJsonString(const std::string& literal, Parameter* result) {
if ("gps" == literal) {
*result = P_GPS;
@@ -234,6 +262,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("externalTemperature" == literal) {
*result = P_EXTERNALTEMPERATURE;
return true;
+ } else if ("turnSignal" == literal) {
+ *result = P_TURNSIGNAL;
+ return true;
} else if ("fuelLevel" == literal) {
*result = P_FUELLEVEL;
return true;
@@ -246,6 +277,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("instantFuelConsumption" == literal) {
*result = P_INSTANTFUELCONSUMPTION;
return true;
+ } else if ("fuelRange" == literal) {
+ *result = P_FUELRANGE;
+ return true;
} else if ("odometer" == literal) {
*result = P_ODOMETER;
return true;
@@ -264,6 +298,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -276,6 +313,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("steeringWheelAngle" == literal) {
*result = P_STEERINGWHEELANGLE;
return true;
+ } else if ("engineOilLife" == literal) {
+ *result = P_ENGINEOILLIFE;
+ return true;
} else if ("myKey" == literal) {
*result = P_MYKEY;
return true;
@@ -297,6 +337,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("eCallInfo" == literal) {
*result = P_ECALLINFO;
return true;
+ } else if ("EMPTY" == literal) {
+ *result = P_EMPTY;
+ return true;
} else {
return false;
}
@@ -324,6 +367,10 @@ bool IsValidEnum(AppHMIType val) {
return true;
case AHT_SYSTEM:
return true;
+ case AHT_PROJECTION:
+ return true;
+ case AHT_REMOTE_CONTROL:
+ return true;
default:
return false;
}
@@ -350,6 +397,10 @@ const char* EnumToJsonString(AppHMIType val) {
return "TESTING";
case AHT_SYSTEM:
return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
+ case AHT_REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
default:
return "";
}
@@ -385,6 +436,12 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
} else if ("SYSTEM" == literal) {
*result = AHT_SYSTEM;
return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
+ } else if ("REMOTE_CONTROL" == literal) {
+ *result = AHT_REMOTE_CONTROL;
+ return true;
} else {
return false;
}
@@ -432,6 +489,10 @@ bool IsValidEnum(RequestType val) {
return true;
case RT_FOTA:
return true;
+ case RT_OEM_SPECIFIC:
+ return true;
+ case RT_EMPTY:
+ return true;
default:
return false;
}
@@ -479,6 +540,10 @@ const char* EnumToJsonString(RequestType val) {
return "MEDIA";
case RT_FOTA:
return "FOTA";
+ case RT_OEM_SPECIFIC:
+ return "OEM_SPECIFIC";
+ case RT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -564,11 +629,733 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
if ("FOTA" == literal) {
*result = RT_FOTA;
return true;
+ }
+ if ("OEM_SPECIFIC" == literal) {
+ *result = RT_OEM_SPECIFIC;
+ return true;
+ }
+ if ("EMPTY" == literal) {
+ *result = RT_EMPTY;
+ return true;
} else {
return false;
}
}
+bool IsValidEnum(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return true;
+ case MT_RADIO:
+ return true;
+ case MT_SEAT:
+ return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
+ case MT_EMPTY:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return "CLIMATE";
+ case MT_RADIO:
+ return "RADIO";
+ case MT_SEAT:
+ return "SEAT";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
+ case MT_EMPTY:
+ return "EMPTY";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
+ if ("CLIMATE" == literal) {
+ *result = MT_CLIMATE;
+ return true;
+ } else if ("RADIO" == literal) {
+ *result = MT_RADIO;
+ return true;
+ } else if ("SEAT" == literal) {
+ *result = MT_SEAT;
+ return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
+ }
+ return false;
+}
+
+bool IsValidEnum(FunctionID val) {
+ switch (val) {
+ case RegisterAppInterfaceID:
+ return true;
+ case UnregisterAppInterfaceID:
+ return true;
+ case SetGlobalPropertiesID:
+ return true;
+ case ResetGlobalPropertiesID:
+ return true;
+ case AddCommandID:
+ return true;
+ case DeleteCommandID:
+ return true;
+ case AddSubMenuID:
+ return true;
+ case DeleteSubMenuID:
+ return true;
+ case CreateInteractionChoiceSetID:
+ return true;
+ case PerformInteractionID:
+ return true;
+ case DeleteInteractionChoiceSetID:
+ return true;
+ case AlertID:
+ return true;
+ case ShowID:
+ return true;
+ case SpeakID:
+ return true;
+ case SetMediaClockTimerID:
+ return true;
+ case PerformAudioPassThruID:
+ return true;
+ case EndAudioPassThruID:
+ return true;
+ case SubscribeButtonID:
+ return true;
+ case UnsubscribeButtonID:
+ return true;
+ case SubscribeVehicleDataID:
+ return true;
+ case UnsubscribeVehicleDataID:
+ return true;
+ case GetVehicleDataID:
+ return true;
+ case ReadDIDID:
+ return true;
+ case GetDTCsID:
+ return true;
+ case ScrollableMessageID:
+ return true;
+ case SliderID:
+ return true;
+ case ShowConstantTBTID:
+ return true;
+ case AlertManeuverID:
+ return true;
+ case UpdateTurnListID:
+ return true;
+ case ChangeRegistrationID:
+ return true;
+ case GenericResponseID:
+ return true;
+ case PutFileID:
+ return true;
+ case DeleteFileID:
+ return true;
+ case ListFilesID:
+ return true;
+ case SetAppIconID:
+ return true;
+ case SetDisplayLayoutID:
+ return true;
+ case DiagnosticMessageID:
+ return true;
+ case SystemRequestID:
+ return true;
+ case SendLocationID:
+ return true;
+ case DialNumberID:
+ return true;
+ case ButtonPressID:
+ return true;
+ case GetInteriorVehicleDataID:
+ return true;
+ case SetInteriorVehicleDataID:
+ return true;
+ case GetWayPointsID:
+ return true;
+ case SubscribeWayPointsID:
+ return true;
+ case UnsubscribeWayPointsID:
+ return true;
+ case GetSystemCapabilityID:
+ return true;
+ case SendHapticDataID:
+ return true;
+ case OnHMIStatusID:
+ return true;
+ case OnAppInterfaceUnregisteredID:
+ return true;
+ case OnButtonEventID:
+ return true;
+ case OnButtonPressID:
+ return true;
+ case OnVehicleDataID:
+ return true;
+ case OnCommandID:
+ return true;
+ case OnTBTClientStateID:
+ return true;
+ case OnDriverDistractionID:
+ return true;
+ case OnPermissionsChangeID:
+ return true;
+ case OnAudioPassThruID:
+ return true;
+ case OnLanguageChangeID:
+ return true;
+ case OnKeyboardInputID:
+ return true;
+ case OnTouchEventID:
+ return true;
+ case OnSystemRequestID:
+ return true;
+ case OnHashChangeID:
+ return true;
+ case OnInteriorVehicleDataID:
+ return true;
+ case OnWayPointChangeID:
+ return true;
+ case OnRCStatusID:
+ return true;
+ case EncodedSyncPDataID:
+ return true;
+ case SyncPDataID:
+ return true;
+ case OnEncodedSyncPDataID:
+ return true;
+ case OnSyncPDataID:
+ return true;
+ default:
+ return false;
+ }
+};
+
+const char* EnumToJsonString(FunctionID val) {
+ switch (val) {
+ case RegisterAppInterfaceID:
+ return "RegisterAppInterface";
+ case UnregisterAppInterfaceID:
+ return "UnregisterAppInterface";
+ case SetGlobalPropertiesID:
+ return "SetGlobalProperties";
+ case ResetGlobalPropertiesID:
+ return "ResetGlobalProperties";
+ case AddCommandID:
+ return "AddCommand";
+ case DeleteCommandID:
+ return "DeleteCommand";
+ case AddSubMenuID:
+ return "AddSubMenu";
+ case DeleteSubMenuID:
+ return "DeleteSubMenu";
+ case CreateInteractionChoiceSetID:
+ return "CreateInteractionChoiceSet";
+ case PerformInteractionID:
+ return "PerformInteraction";
+ case DeleteInteractionChoiceSetID:
+ return "DeleteInteractionChoiceSet";
+ case AlertID:
+ return "Alert";
+ case ShowID:
+ return "Show";
+ case SpeakID:
+ return "Speak";
+ case SetMediaClockTimerID:
+ return "SetMediaClockTimer";
+ case PerformAudioPassThruID:
+ return "PerformAudioPassThru";
+ case EndAudioPassThruID:
+ return "EndAudioPassThru";
+ case SubscribeButtonID:
+ return "SubscribeButton";
+ case UnsubscribeButtonID:
+ return "UnsubscribeButton";
+ case SubscribeVehicleDataID:
+ return "SubscribeVehicleData";
+ case UnsubscribeVehicleDataID:
+ return "UnsubscribeVehicleData";
+ case GetVehicleDataID:
+ return "GetVehicleData";
+ case ReadDIDID:
+ return "ReadDID";
+ case GetDTCsID:
+ return "GetDTCs";
+ case ScrollableMessageID:
+ return "ScrollableMessage";
+ case SliderID:
+ return "Slider";
+ case ShowConstantTBTID:
+ return "ShowConstantTBT";
+ case AlertManeuverID:
+ return "AlertManeuver";
+ case UpdateTurnListID:
+ return "UpdateTurnList";
+ case ChangeRegistrationID:
+ return "ChangeRegistration";
+ case GenericResponseID:
+ return "GenericResponse";
+ case PutFileID:
+ return "PutFile";
+ case DeleteFileID:
+ return "DeleteFile";
+ case ListFilesID:
+ return "ListFiles";
+ case SetAppIconID:
+ return "SetAppIcon";
+ case SetDisplayLayoutID:
+ return "SetDisplayLayout";
+ case DiagnosticMessageID:
+ return "DiagnosticMessage";
+ case SystemRequestID:
+ return "SystemRequest";
+ case SendLocationID:
+ return "SendLocation";
+ case DialNumberID:
+ return "DialNumber";
+ case ButtonPressID:
+ return "ButtonPress";
+ case GetInteriorVehicleDataID:
+ return "GetInteriorVehicleData";
+ case SetInteriorVehicleDataID:
+ return "SetInteriorVehicleData";
+ case GetWayPointsID:
+ return "GetWayPoints";
+ case SubscribeWayPointsID:
+ return "SubscribeWayPoints";
+ case UnsubscribeWayPointsID:
+ return "UnsubscribeWayPoints";
+ case GetSystemCapabilityID:
+ return "GetSystemCapability";
+ case SendHapticDataID:
+ return "SendHapticData";
+ case OnHMIStatusID:
+ return "OnHMIStatus";
+ case OnAppInterfaceUnregisteredID:
+ return "OnAppInterfaceUnregistered";
+ case OnButtonEventID:
+ return "OnButtonEvent";
+ case OnButtonPressID:
+ return "OnButtonPress";
+ case OnVehicleDataID:
+ return "OnVehicleData";
+ case OnCommandID:
+ return "OnCommand";
+ case OnTBTClientStateID:
+ return "OnTBTClientState";
+ case OnDriverDistractionID:
+ return "OnDriverDistraction";
+ case OnPermissionsChangeID:
+ return "OnPermissionsChange";
+ case OnAudioPassThruID:
+ return "OnAudioPassThru";
+ case OnLanguageChangeID:
+ return "OnLanguageChange";
+ case OnKeyboardInputID:
+ return "OnKeyboardInput";
+ case OnTouchEventID:
+ return "OnTouchEvent";
+ case OnSystemRequestID:
+ return "OnSystemRequest";
+ case OnHashChangeID:
+ return "OnHashChange";
+ case OnInteriorVehicleDataID:
+ return "OnInteriorVehicleData";
+ case OnWayPointChangeID:
+ return "OnWayPointChange";
+ case OnRCStatusID:
+ return "OnRCStatus";
+ case EncodedSyncPDataID:
+ return "EncodedSyncPData";
+ case SyncPDataID:
+ return "SyncPData";
+ case OnEncodedSyncPDataID:
+ return "OnEncodedSyncPData";
+ case OnSyncPDataID:
+ return "OnSyncPData";
+ default:
+ return "";
+ }
+};
+
+bool EnumFromJsonString(const std::string& literal, FunctionID* result) {
+ if ("RegisterAppInterface" == literal) {
+ *result = RegisterAppInterfaceID;
+ return true;
+ }
+
+ if ("UnregisterAppInterface" == literal) {
+ *result = UnregisterAppInterfaceID;
+ return true;
+ }
+
+ if ("SetGlobalProperties" == literal) {
+ *result = SetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("ResetGlobalProperties" == literal) {
+ *result = ResetGlobalPropertiesID;
+ return true;
+ }
+
+ if ("AddCommand" == literal) {
+ *result = AddCommandID;
+ return true;
+ }
+
+ if ("DeleteCommand" == literal) {
+ *result = DeleteCommandID;
+ return true;
+ }
+
+ if ("AddSubMenu" == literal) {
+ *result = AddSubMenuID;
+ return true;
+ }
+
+ if ("DeleteSubMenu" == literal) {
+ *result = DeleteSubMenuID;
+ return true;
+ }
+
+ if ("CreateInteractionChoiceSet" == literal) {
+ *result = CreateInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("PerformInteraction" == literal) {
+ *result = PerformInteractionID;
+ return true;
+ }
+
+ if ("DeleteInteractionChoiceSet" == literal) {
+ *result = DeleteInteractionChoiceSetID;
+ return true;
+ }
+
+ if ("Alert" == literal) {
+ *result = AlertID;
+ return true;
+ }
+
+ if ("Show" == literal) {
+ *result = ShowID;
+ return true;
+ }
+
+ if ("Speak" == literal) {
+ *result = SpeakID;
+ return true;
+ }
+
+ if ("SetMediaClockTimer" == literal) {
+ *result = SetMediaClockTimerID;
+ return true;
+ }
+
+ if ("PerformAudioPassThru" == literal) {
+ *result = PerformAudioPassThruID;
+ return true;
+ }
+
+ if ("EndAudioPassThru" == literal) {
+ *result = EndAudioPassThruID;
+ return true;
+ }
+
+ if ("SubscribeButton" == literal) {
+ *result = SubscribeButtonID;
+ return true;
+ }
+
+ if ("UnsubscribeButton" == literal) {
+ *result = UnsubscribeButtonID;
+ return true;
+ }
+
+ if ("SubscribeVehicleData" == literal) {
+ *result = SubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("UnsubscribeVehicleData" == literal) {
+ *result = UnsubscribeVehicleDataID;
+ return true;
+ }
+
+ if ("GetVehicleData" == literal) {
+ *result = GetVehicleDataID;
+ return true;
+ }
+
+ if ("ReadDID" == literal) {
+ *result = ReadDIDID;
+ return true;
+ }
+
+ if ("GetDTCs" == literal) {
+ *result = GetDTCsID;
+ return true;
+ }
+
+ if ("ScrollableMessage" == literal) {
+ *result = ScrollableMessageID;
+ return true;
+ }
+
+ if ("Slider" == literal) {
+ *result = SliderID;
+ return true;
+ }
+
+ if ("ShowConstantTBT" == literal) {
+ *result = ShowConstantTBTID;
+ return true;
+ }
+
+ if ("AlertManeuver" == literal) {
+ *result = AlertManeuverID;
+ return true;
+ }
+
+ if ("UpdateTurnList" == literal) {
+ *result = UpdateTurnListID;
+ return true;
+ }
+
+ if ("ChangeRegistration" == literal) {
+ *result = ChangeRegistrationID;
+ return true;
+ }
+
+ if ("GenericResponse" == literal) {
+ *result = GenericResponseID;
+ return true;
+ }
+
+ if ("PutFile" == literal) {
+ *result = PutFileID;
+ return true;
+ }
+
+ if ("DeleteFile" == literal) {
+ *result = DeleteFileID;
+ return true;
+ }
+
+ if ("ListFiles" == literal) {
+ *result = ListFilesID;
+ return true;
+ }
+
+ if ("SetAppIcon" == literal) {
+ *result = SetAppIconID;
+ return true;
+ }
+
+ if ("SetDisplayLayout" == literal) {
+ *result = SetDisplayLayoutID;
+ return true;
+ }
+
+ if ("DiagnosticMessage" == literal) {
+ *result = DiagnosticMessageID;
+ return true;
+ }
+
+ if ("SystemRequest" == literal) {
+ *result = SystemRequestID;
+ return true;
+ }
+
+ if ("SendLocation" == literal) {
+ *result = SendLocationID;
+ return true;
+ }
+
+ if ("DialNumber" == literal) {
+ *result = DialNumberID;
+ return true;
+ }
+
+ if ("ButtonPress" == literal) {
+ *result = ButtonPressID;
+ return true;
+ }
+
+ if ("GetInteriorVehicleData" == literal) {
+ *result = GetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("SetInteriorVehicleData" == literal) {
+ *result = SetInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("GetWayPoints" == literal) {
+ *result = GetWayPointsID;
+ return true;
+ }
+
+ if ("SubscribeWayPoints" == literal) {
+ *result = SubscribeWayPointsID;
+ return true;
+ }
+
+ if ("UnsubscribeWayPoints" == literal) {
+ *result = UnsubscribeWayPointsID;
+ return true;
+ }
+
+ if ("GetSystemCapability" == literal) {
+ *result = GetSystemCapabilityID;
+ return true;
+ }
+
+ if ("SendHapticData" == literal) {
+ *result = SendHapticDataID;
+ return true;
+ }
+
+ if ("OnHMIStatus" == literal) {
+ *result = OnHMIStatusID;
+ return true;
+ }
+
+ if ("OnAppInterfaceUnregistered" == literal) {
+ *result = OnAppInterfaceUnregisteredID;
+ return true;
+ }
+
+ if ("OnButtonEvent" == literal) {
+ *result = OnButtonEventID;
+ return true;
+ }
+
+ if ("OnButtonPress" == literal) {
+ *result = OnButtonPressID;
+ return true;
+ }
+
+ if ("OnVehicleData" == literal) {
+ *result = OnVehicleDataID;
+ return true;
+ }
+
+ if ("OnCommand" == literal) {
+ *result = OnCommandID;
+ return true;
+ }
+
+ if ("OnTBTClientState" == literal) {
+ *result = OnTBTClientStateID;
+ return true;
+ }
+
+ if ("OnDriverDistraction" == literal) {
+ *result = OnDriverDistractionID;
+ return true;
+ }
+
+ if ("OnPermissionsChange" == literal) {
+ *result = OnPermissionsChangeID;
+ return true;
+ }
+
+ if ("OnAudioPassThru" == literal) {
+ *result = OnAudioPassThruID;
+ return true;
+ }
+
+ if ("OnLanguageChange" == literal) {
+ *result = OnLanguageChangeID;
+ return true;
+ }
+
+ if ("OnKeyboardInput" == literal) {
+ *result = OnKeyboardInputID;
+ return true;
+ }
+
+ if ("OnTouchEvent" == literal) {
+ *result = OnTouchEventID;
+ return true;
+ }
+
+ if ("OnSystemRequest" == literal) {
+ *result = OnSystemRequestID;
+ return true;
+ }
+
+ if ("OnHashChange" == literal) {
+ *result = OnHashChangeID;
+ return true;
+ }
+
+ if ("OnInteriorVehicleData" == literal) {
+ *result = OnInteriorVehicleDataID;
+ return true;
+ }
+
+ if ("OnWayPointChange" == literal) {
+ *result = OnWayPointChangeID;
+ return true;
+ }
+
+ if ("OnRCStatus" == literal) {
+ *result = OnRCStatusID;
+ return true;
+ }
+
+ if ("EncodedSyncPData" == literal) {
+ *result = EncodedSyncPDataID;
+ return true;
+ }
+
+ if ("SyncPData" == literal) {
+ *result = SyncPDataID;
+ return true;
+ }
+
+ if ("OnEncodedSyncPData" == literal) {
+ *result = OnEncodedSyncPDataID;
+ return true;
+ }
+
+ if ("OnSyncPData" == literal) {
+ *result = OnSyncPDataID;
+ return true;
+ }
+ return false;
+};
+
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
const std::string kDeviceApp = "device";
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index 7928973919..851ed1bd18 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -164,9 +164,11 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, nicknames(impl::ValueMember(value__, "nicknames"))
, AppHMIType(impl::ValueMember(value__, "AppHMIType"))
, RequestType(impl::ValueMember(value__, "RequestType"))
+ , RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
- , certificate(impl::ValueMember(value__, "certificate"), "not_specified") {}
+ , certificate(impl::ValueMember(value__, "certificate"), "not_specified")
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -174,14 +176,17 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("nicknames", nicknames, &result__);
impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("RequestSubType", RequestSubType, &result__);
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
+ impl::WriteJsonField("moduleType", moduleType, &result__);
return result__;
}
bool ApplicationParams::is_valid() const {
- // RequestType is not validated since there is high-level validation logic,
+ // RequestType and RequestSubType are not validated since there is high-level
+ // validation logic,
// which takes into account information not available here.
if (!PolicyBase::is_valid()) {
return false;
@@ -204,6 +209,9 @@ bool ApplicationParams::is_valid() const {
if (!certificate.is_valid()) {
return false;
}
+ if (!moduleType.is_valid()) {
+ return false;
+ }
return Validate();
}
@@ -227,6 +235,9 @@ bool ApplicationParams::struct_empty() const {
if (RequestType.is_initialized()) {
return false;
}
+ if (RequestSubType.is_initialized()) {
+ return false;
+ }
if (memory_kb.is_initialized()) {
return false;
}
@@ -236,6 +247,9 @@ bool ApplicationParams::struct_empty() const {
if (certificate.is_initialized()) {
return false;
}
+ if (moduleType.is_initialized()) {
+ return false;
+ }
return true;
}
@@ -255,6 +269,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!RequestType.is_valid()) {
RequestType.ReportErrors(&report__->ReportSubobject("RequestType"));
}
+ if (!RequestSubType.is_valid()) {
+ RequestSubType.ReportErrors(&report__->ReportSubobject("RequestSubType"));
+ }
if (!priority.is_valid()) {
priority.ReportErrors(&report__->ReportSubobject("priority"));
}
@@ -268,6 +285,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!certificate.is_valid()) {
certificate.ReportErrors(&report__->ReportSubobject("certificate"));
}
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -275,26 +295,33 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
groups.SetPolicyTableType(pt_type);
AppHMIType.SetPolicyTableType(pt_type);
RequestType.SetPolicyTableType(pt_type);
+ RequestSubType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
+ moduleType.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;
@@ -304,9 +331,11 @@ bool RpcParameters::is_valid() const {
}
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;
@@ -317,6 +346,7 @@ bool RpcParameters::struct_empty() const {
return true;
}
+
void RpcParameters::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -337,18 +367,23 @@ void RpcParameters::SetPolicyTableType(PolicyTableType 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;
@@ -358,9 +393,11 @@ bool Rpcs::is_valid() const {
}
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;
@@ -371,6 +408,7 @@ bool Rpcs::struct_empty() const {
return true;
}
+
void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -392,6 +430,7 @@ void Rpcs::SetPolicyTableType(PolicyTableType pt_type) {
// ModuleConfig methods
ModuleConfig::ModuleConfig() : CompositeType(kUninitialized) {}
+
ModuleConfig::ModuleConfig(
uint8_t exchange_after_x_ignition_cycles,
int64_t exchange_after_x_kilometers,
@@ -409,11 +448,14 @@ ModuleConfig::ModuleConfig(
, 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"))
+ , full_app_id_supported(impl::ValueMember(value__, "full_app_id_supported"))
, exchange_after_x_ignition_cycles(
impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
, exchange_after_x_kilometers(
@@ -453,6 +495,8 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -475,10 +519,14 @@ Json::Value ModuleConfig::ToJsonValue() const {
impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
return result__;
}
+
bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -517,13 +565,18 @@ bool ModuleConfig::is_valid() const {
}
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 (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -559,9 +612,9 @@ bool ModuleConfig::struct_empty() const {
if (vehicle_year.is_initialized()) {
return false;
}
-
return true;
}
+
void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -573,6 +626,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -631,6 +688,7 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
@@ -645,7 +703,9 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType 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"))
@@ -653,6 +713,7 @@ MessageString::MessageString(const Json::Value* value__)
, 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__);
@@ -662,6 +723,7 @@ Json::Value MessageString::ToJsonValue() const {
impl::WriteJsonField("textBody", textBody, &result__);
return result__;
}
+
bool MessageString::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -683,9 +745,11 @@ bool MessageString::is_valid() const {
}
return Validate();
}
+
bool MessageString::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool MessageString::struct_empty() const {
if (line1.is_initialized()) {
return false;
@@ -706,6 +770,7 @@ bool MessageString::struct_empty() const {
}
return true;
}
+
void MessageString::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -737,27 +802,40 @@ void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
}
// MessageLanguages methods
+const std::string MessageLanguages::default_language_("en-us");
+
MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
+
MessageLanguages::MessageLanguages(const Languages& languages)
: CompositeType(kUninitialized), languages(languages) {}
+
MessageLanguages::~MessageLanguages() {}
+
MessageLanguages::MessageLanguages(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, languages(impl::ValueMember(value__, "languages")) {}
+
Json::Value MessageLanguages::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("languages", languages, &result__);
return result__;
}
+
bool MessageLanguages::is_valid() const {
if (!languages.is_valid()) {
return false;
}
+ // Each RPC must have message in english
+ if (languages.end() == languages.find(default_language_)) {
+ return false;
+ }
return Validate();
}
+
bool MessageLanguages::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool MessageLanguages::struct_empty() const {
if (languages.is_initialized()) {
return false;
@@ -781,6 +859,11 @@ void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const {
if (!languages.is_valid()) {
languages.ReportErrors(&report__->ReportSubobject("languages"));
}
+ if (languages.end() == languages.find(default_language_)) {
+ report__->set_validation_info(
+ "this message does not support the default language '" +
+ default_language_ + "'");
+ }
}
void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) {
@@ -791,19 +874,24 @@ void MessageLanguages::SetPolicyTableType(PolicyTableType 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;
@@ -813,9 +901,11 @@ bool ConsumerFriendlyMessages::is_valid() const {
}
return Validate();
}
+
bool ConsumerFriendlyMessages::is_initialized() const {
return (initialization_state__ != kUninitialized) || (!struct_empty());
}
+
bool ConsumerFriendlyMessages::struct_empty() const {
if (version.is_initialized()) {
return false;
@@ -826,6 +916,7 @@ bool ConsumerFriendlyMessages::struct_empty() const {
return true;
}
+
void ConsumerFriendlyMessages::ReportErrors(
rpc::ValidationReport* report__) const {
if (struct_empty()) {
@@ -856,7 +947,9 @@ void ConsumerFriendlyMessages::SetPolicyTableType(PolicyTableType 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(
@@ -865,6 +958,7 @@ ModuleMeta::ModuleMeta(const Json::Value* value__)
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(
@@ -877,6 +971,7 @@ Json::Value ModuleMeta::ToJsonValue() const {
&result__);
return result__;
}
+
bool ModuleMeta::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -892,9 +987,11 @@ bool ModuleMeta::is_valid() const {
}
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;
@@ -908,6 +1005,7 @@ bool ModuleMeta::struct_empty() const {
}
return true;
}
+
void ModuleMeta::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -970,7 +1068,9 @@ AppLevel::AppLevel(uint16_t minutes_in_hmi_full,
, 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"))
@@ -1006,6 +1106,7 @@ Json::Value AppLevel::ToJsonValue() const {
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;
@@ -1054,9 +1155,11 @@ bool AppLevel::is_valid() const {
}
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;
@@ -1111,6 +1214,7 @@ bool AppLevel::struct_empty() const {
}
return true;
}
+
void AppLevel::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1135,6 +1239,7 @@ Json::Value UsageAndErrorCounts::ToJsonValue() const {
impl::WriteJsonField("app_level", app_level, &result__);
return result__;
}
+
bool UsageAndErrorCounts::is_valid() const {
if (struct_empty()) {
return initialization_state__ == kInitialized && Validate();
@@ -1144,15 +1249,18 @@ bool UsageAndErrorCounts::is_valid() const {
}
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__);
@@ -1175,25 +1283,32 @@ void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType 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__);
@@ -1202,6 +1317,7 @@ void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
// PolicyTable methods
PolicyTable::PolicyTable() : CompositeType(kUninitialized) {}
+
PolicyTable::PolicyTable(
const ApplicationPoliciesSection& app_policies_section,
const FunctionalGroupings& functional_groupings,
@@ -1212,7 +1328,9 @@ PolicyTable::PolicyTable(
, 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"))
@@ -1224,6 +1342,7 @@ PolicyTable::PolicyTable(const Json::Value* value__)
, 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__);
@@ -1237,6 +1356,7 @@ Json::Value PolicyTable::ToJsonValue() const {
impl::WriteJsonField("device_data", device_data, &result__);
return result__;
}
+
bool PolicyTable::is_valid() const {
if (!app_policies_section.is_valid()) {
return false;
@@ -1261,9 +1381,11 @@ bool PolicyTable::is_valid() const {
}
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;
@@ -1291,6 +1413,7 @@ bool PolicyTable::struct_empty() const {
}
return true;
}
+
void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
if (struct_empty()) {
rpc::CompositeType::ReportErrors(report__);
@@ -1345,32 +1468,40 @@ void PolicyTable::SetPolicyTableType(PolicyTableType 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__);
diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc
index e7a981e559..714dfaae5a 100644
--- a/src/components/policy/policy_regular/src/policy_table/validation.cc
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -40,11 +40,12 @@ bool ApplicationPoliciesSection::Validate() const {
return false;
}
- PolicyTableType pt_type = GetPolicyTableType();
+ const PolicyTableType pt_type = GetPolicyTableType();
if (PT_PRELOADED != pt_type && PT_UPDATE != pt_type) {
return true;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request Types...");
if (!it_default_policy->second.RequestType.is_valid()) {
LOG4CXX_WARN(logger_,
"Default policy RequestTypes are not valid. Will be cleaned.");
@@ -65,10 +66,15 @@ bool ApplicationPoliciesSection::Validate() const {
ApplicationPolicies::iterator end_iter = apps.end();
while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
ApplicationParams& app_params = (*iter).second;
- bool is_request_type_omitted = !app_params.RequestType.is_initialized();
- bool is_request_type_valid = app_params.RequestType.is_valid();
- bool is_request_type_empty = app_params.RequestType->empty();
+ const bool is_request_type_omitted =
+ !app_params.RequestType.is_initialized();
+ const bool is_request_type_valid = app_params.RequestType.is_valid();
+ const bool is_request_type_empty = app_params.RequestType->empty();
if (PT_PRELOADED == pt_type) {
if (!is_request_type_valid) {
@@ -111,12 +117,70 @@ bool ApplicationPoliciesSection::Validate() const {
++iter;
}
+ LOG4CXX_TRACE(logger_, "Checking app Request SubTypes...");
+ iter = apps.begin();
+ while (iter != end_iter) {
+ if (it_default_policy == iter || it_pre_data_policy == iter) {
+ ++iter;
+ continue;
+ }
+ ApplicationParams& app_params = (*iter).second;
+ const bool is_request_subtype_omitted =
+ !app_params.RequestSubType.is_initialized();
+
+ if (is_request_subtype_omitted) {
+ LOG4CXX_WARN(logger_,
+ "App policy RequestSubTypes omitted."
+ " Will be replaced with default.");
+ app_params.RequestSubType = apps[kDefaultApp].RequestSubType;
+ ++iter;
+ continue;
+ }
+
+ const bool is_request_subtype_empty = app_params.RequestSubType->empty();
+ if (is_request_subtype_empty) {
+ LOG4CXX_WARN(logger_, "App policy RequestSubTypes empty.");
+ }
+ ++iter;
+ }
+
return true;
}
-bool ApplicationParams::Validate() const {
+bool ApplicationParams::ValidateModuleTypes() const {
+ // moduleType is optional so see Optional<T>::is_valid()
+ bool is_initialized = moduleType->is_initialized();
+ if (!is_initialized) {
+ // valid if not initialized
+ return true;
+ }
+ bool is_valid = moduleType->is_valid();
+ if (is_valid) {
+ return true;
+ }
+
+ struct IsInvalid {
+ bool operator()(Enum<ModuleType> item) const {
+ return !item.is_valid();
+ }
+ };
+ // cut invalid items
+ moduleType->erase(
+ std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()),
+ moduleType->end());
+ bool empty = moduleType->empty();
+ if (empty) {
+ // set non initialized value
+ ModuleTypes non_initialized;
+ moduleType = Optional<ModuleTypes>(non_initialized);
+ }
return true;
}
+
+bool ApplicationParams::Validate() const {
+ return ValidateModuleTypes();
+}
+
bool RpcParameters::Validate() const {
return true;
}
@@ -136,6 +200,19 @@ bool ModuleConfig::Validate() const {
return false;
}
}
+
+ for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin();
+ it_endpoints != endpoints.end();
+ ++it_endpoints) {
+ const URLList& endpoint_list = it_endpoints->second;
+ if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) {
+ LOG4CXX_ERROR(logger_,
+ "Endpoint " << it_endpoints->first
+ << "does not contain default group");
+ return false;
+ }
+ }
+
return true;
}
@@ -178,20 +255,40 @@ bool UsageAndErrorCounts::Validate() const {
}
return true;
}
+
bool DeviceParams::Validate() const {
return true;
}
+
bool PolicyTable::Validate() const {
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
+ 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_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
index df4bc74cc2..f5ccffce3b 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -123,7 +123,7 @@ const std::string kCreateSchema =
"CREATE INDEX `rpc.select_rpc_name_hmi_level` "
" ON `rpc`(`name`,`hmi_level_value`);"
"CREATE TABLE IF NOT EXISTS `application`( "
- " `id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `keep_context` BOOLEAN, "
" `steal_focus` BOOLEAN, "
" `default_hmi` VARCHAR(45), "
@@ -134,6 +134,7 @@ const std::string kCreateSchema =
" `memory_kb` INTEGER NOT NULL, "
" `heart_beat_timeout_ms` INTEGER NOT NULL, "
" `certificate` VARCHAR(45), "
+ " `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, "
" CONSTRAINT `fk_application_hmi_level1` "
" FOREIGN KEY(`default_hmi`) "
" REFERENCES `hmi_level`(`value`), "
@@ -146,7 +147,7 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx` "
" ON `application`(`priority_value`); "
"CREATE TABLE IF NOT EXISTS `app_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application1` "
@@ -161,9 +162,9 @@ const std::string kCreateSchema =
" ON `app_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`app_group.fk_application_has_functional_group_application1_idx` "
- " ON `app_group`(`application_id`); "
+ " ON `app_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `preconsented_group`( "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" PRIMARY KEY(`application_id`,`functional_group_id`), "
" CONSTRAINT `fk_application_has_functional_group_application2` "
@@ -179,7 +180,7 @@ const std::string kCreateSchema =
" ON `preconsented_group`(`functional_group_id`); "
"CREATE INDEX IF NOT EXISTS "
"`preconsented_group.fk_application_has_functional_group_application2_idx` "
- " ON `preconsented_group`(`application_id`); "
+ " ON `preconsented_group`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `seconds_between_retry`( "
" `index` INTEGER PRIMARY KEY NOT NULL, "
" `value` INTEGER NOT NULL "
@@ -206,7 +207,7 @@ const std::string kCreateSchema =
"`device_consent_group.fk_device_has_functional_group_device1_idx` "
" ON `device_consent_group`(`device_id`); "
"CREATE TABLE IF NOT EXISTS `app_level`( "
- " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `application_id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE, "
" `minutes_in_hmi_full` INTEGER DEFAULT 0, "
" `minutes_in_hmi_limited` INTEGER DEFAULT 0, "
" `minutes_in_hmi_background` INTEGER DEFAULT 0, "
@@ -233,42 +234,50 @@ const std::string kCreateSchema =
" REFERENCES `language`(`code`) "
"); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx` "
- " ON `app_level`(`application_id`); "
+ " ON `app_level`(`application_id` COLLATE NOCASE); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx` "
" ON `app_level`(`app_registration_language_gui`); "
"CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx` "
" ON `app_level`(`app_registration_language_vui`); "
"CREATE TABLE IF NOT EXISTS `nickname`( "
- " `name` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `name` VARCHAR(100) NOT NULL COLLATE NOCASE, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_nickname_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx` "
- " ON `nickname`(`application_id`); "
+ " ON `nickname`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `app_type`( "
" `name` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`name`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE TABLE IF NOT EXISTS `request_type`( "
- " `request_type` VARCHAR(50) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `request_type` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" PRIMARY KEY(`request_type`,`application_id`), "
" CONSTRAINT `fk_app_type_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
+ "CREATE TABLE IF NOT EXISTS `request_subtype`( "
+ " `request_subtype` VARCHAR(50), "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`request_subtype`,`application_id`), "
+ " CONSTRAINT `fk_request_subtype_app_id` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
"CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx` "
- " ON `app_type`(`application_id`); "
+ " ON `app_type`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `consent_group`( "
" `device_id` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" `functional_group_id` INTEGER NOT NULL, "
" `is_consented` BOOL NOT NULL, "
" `input` VARCHAR(45), "
@@ -293,13 +302,13 @@ const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `endpoint`( "
" `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
- " `application_id` VARCHAR(45) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" CONSTRAINT `fk_endpoint_application1` "
" FOREIGN KEY(`application_id`) "
" REFERENCES `application`(`id`) "
"); "
"CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx` "
- " ON `endpoint`(`application_id`); "
+ " ON `endpoint`(`application_id` COLLATE NOCASE); "
"CREATE TABLE IF NOT EXISTS `message`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
" `tts` TEXT, "
@@ -316,6 +325,39 @@ const std::string kCreateSchema =
" FOREIGN KEY(`message_type_name`) "
" REFERENCES `message_type`(`name`) "
"); "
+
+ /* access_module */
+ "CREATE TABLE `access_module`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(45) NOT NULL, "
+ " `user_consent_needed` INTEGER NOT NULL "
+ "); "
+
+ /* remote_rpc */
+ "CREATE TABLE `remote_rpc`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(255) NOT NULL, "
+ " `parameter` VARCHAR(45), "
+ " `module_id` INTEGER NOT NULL, "
+ "CONSTRAINT `fk_remote_rpc_1` "
+ " FOREIGN KEY(`module_id`) "
+ " REFERENCES `access_module`(`id`) "
+ "); "
+ "CREATE INDEX `remote_rpc.fk_remote_rpc_1_idx` ON "
+ "`remote_rpc`(`module_id`); "
+
+ /* module type */
+ "CREATE TABLE IF NOT EXISTS `module_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_module_type_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE INDEX IF NOT EXISTS `module_type.fk_module_type_application1_idx` "
+ " ON `module_type`(`application_id`); "
+
"CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx` "
" ON `message`(`language_code`);"
"CREATE INDEX IF NOT EXISTS "
@@ -353,8 +395,47 @@ const std::string kInsertInitData =
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
"";
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kUpdateRemoteControlDenied =
+ "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?";
+
+const std::string kDeleteAccessModules = "DELETE FROM `access_module`";
+
+const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`";
+
+const std::string kInsertAccessModule =
+ "INSERT INTO `access_module` (`name`, `user_consent_needed`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectAccessModules =
+ "SELECT `id`, `name` FROM `access_module` "
+ " WHERE `user_consent_needed` = ?";
+
+const std::string kInsertRemoteRpc =
+ "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectRemoteRpcs =
+ "SELECT `name`, `parameter` FROM `remote_rpc` "
+ " WHERE `module_id` = ?";
+
+const std::string kInsertModuleType =
+ "INSERT OR IGNORE INTO `module_type` (`application_id`, `name`) VALUES (?, "
+ "?)";
+
+const std::string kSelectModuleTypes =
+ "SELECT DISTINCT `name` FROM `module_type` WHERE `application_id` = ?";
+
const std::string kDropSchema =
"BEGIN; "
+ "DROP INDEX IF EXISTS `module_type.fk_module_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `module_type`; "
"DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; "
"DROP INDEX IF EXISTS "
"`message.fk_message_consumer_friendly_messages1_idx`; "
@@ -367,6 +448,8 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `consent_group`; "
"DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
"DROP TABLE IF EXISTS `app_type`; "
+ "DROP TABLE IF EXISTS `request_type`; "
+ "DROP TABLE IF EXISTS `request_subtype`; "
"DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
"DROP TABLE IF EXISTS `nickname`; "
"DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
@@ -387,6 +470,8 @@ const std::string kDropSchema =
"`preconsented_group.fk_application_has_functional_group_functional_group2_"
"idx`; "
"DROP TABLE IF EXISTS `preconsented_group`; "
+ "DROP TABLE IF EXISTS `access_module`; "
+ "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; "
"DROP INDEX IF EXISTS "
"`app_group.fk_application_has_functional_group_application1_idx`; "
"DROP INDEX IF EXISTS "
@@ -409,6 +494,8 @@ const std::string kDropSchema =
"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`; "
@@ -419,6 +506,7 @@ const std::string kDropSchema =
const std::string kDeleteData =
"BEGIN; "
"DELETE FROM `message`; "
+ "DELETE FROM `module_type`; "
"DELETE FROM `endpoint`; "
"DELETE FROM `consent_group`; "
"DELETE FROM `app_type`; "
@@ -430,6 +518,7 @@ const std::string kDeleteData =
"DELETE FROM `app_group`; "
"DELETE FROM `application`; "
"DELETE FROM `rpc`; "
+ "DELETE FROM `access_module`; "
"DELETE FROM `version`; "
"DELETE FROM `message_type`; "
"DELETE FROM `language`; "
@@ -439,6 +528,7 @@ const std::string kDeleteData =
"DELETE FROM `functional_group`; "
"DELETE FROM `module_config`; "
"DELETE FROM `module_meta`; "
+ "DELETE FROM `remote_rpc`; "
"DELETE FROM `usage_and_error_count`; "
"DELETE FROM `device`; "
"COMMIT; "
@@ -502,7 +592,12 @@ const std::string kInsertAppType =
"INSERT OR IGNORE INTO `app_type` (`application_id`, `name`) VALUES (?, ?)";
const std::string kInsertRequestType =
- "INSERT OR IGNORE INTO `request_type` (`application_id`, `request_type`) "
+ "INSERT INTO `request_type` (`application_id`, `request_type`) "
+ "VALUES (?, ?)";
+
+const std::string kInsertRequestSubType =
+ "INSERT INTO `request_subtype` (`application_id`, "
+ "`request_subtype`) "
"VALUES (?, ?)";
const std::string kUpdateVersion = "UPDATE `version` SET `number`= ?";
@@ -522,7 +617,7 @@ const std::string kUpdateModuleConfig =
" `exchange_after_x_ignition_cycles` = ?,"
" `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
" `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, "
- " `vehicle_model` = ?, `vehicle_year` = ?";
+ " `vehicle_model` = ?, `vehicle_year` = ? ";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
@@ -615,6 +710,11 @@ const std::string kSelectRequestTypes =
"SELECT DISTINCT `request_type` FROM `request_type` WHERE `application_id` "
"= ?";
+const std::string kSelectRequestSubTypes =
+ "SELECT DISTINCT `request_subtype` FROM `request_subtype` WHERE "
+ "`application_id` "
+ "= ?";
+
const std::string kSelectSecondsBetweenRetries =
"SELECT `value` FROM `seconds_between_retry` ORDER BY `index`";
@@ -660,6 +760,8 @@ const std::string kDeleteApplication = "DELETE FROM `application`";
const std::string kDeleteRequestType = "DELETE FROM `request_type`";
+const std::string kDeleteRequestSubType = "DELETE FROM `request_subtype`";
+
const std::string kSelectApplicationRevoked =
"SELECT `is_revoked` FROM `application` WHERE `id` = ?";
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index e94c853414..4f5dbc4c3b 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -187,10 +187,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -483,10 +483,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -596,8 +596,8 @@ void SQLPTRepresentation::GatherDeviceData(
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)) {
+ utils::dbms::SQLQuery functional_group(db());
+ if (!functional_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
LOG4CXX_WARN(logger_, "Incorrect select from functional_groupings");
return false;
}
@@ -606,32 +606,50 @@ bool SQLPTRepresentation::GatherFunctionalGroupings(
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);
+
+ while (functional_group.Next()) {
+ policy_table::Rpcs rpcs_structure;
+
+ if (!functional_group.IsNull(2)) {
+ *rpcs_structure.user_consent_prompt = functional_group.GetString(2);
}
- int func_id = func_group.GetInteger(0);
- rpcs.Bind(0, func_id);
+
+ const int group_id = functional_group.GetInteger(0);
+
+ // Collecting RPCs with their HMI levels and parameters (if any)
+ rpcs.Bind(0, group_id);
while (rpcs.Next()) {
if (!rpcs.IsNull(1)) {
policy_table::HmiLevel level;
if (policy_table::EnumFromJsonString(rpcs.GetString(1), &level)) {
- InsertUnique(level, &rpcs_tbl.rpcs[rpcs.GetString(0)].hmi_levels);
+ InsertUnique(level,
+ &rpcs_structure.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 (EnumFromJsonString(rpcs.GetString(2), &param)) {
+ // EMPTY is a special mark to specify that 'parameters' section is
+ // present, but has no parameters. It is not valid parameter value.
+ if (policy_table::P_EMPTY == param) {
+ (*rpcs_structure.rpcs[rpcs.GetString(0)].parameters)
+ .mark_initialized();
+ continue;
+ }
+ InsertUnique(param,
+ &(*rpcs_structure.rpcs[rpcs.GetString(0)].parameters));
}
}
}
- if (!rpcs_tbl.rpcs.is_initialized()) {
- rpcs_tbl.rpcs.set_to_null();
- }
+
rpcs.Reset();
- (*groups)[func_group.GetString(1)] = rpcs_tbl;
+
+ if (!rpcs_structure.rpcs.is_initialized()) {
+ rpcs_structure.rpcs.set_to_null();
+ }
+ policy_table::Rpcs& group_rpcs_structure =
+ (*groups)[functional_group.GetString(1)];
+ group_rpcs_structure = rpcs_structure;
}
return true;
}
@@ -705,6 +723,15 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
@@ -715,6 +742,10 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
+ if (!GatherRequestSubType(app_id, &*params.RequestSubType)) {
+ return false;
+ }
+
(*policies).apps[app_id] = params;
}
return true;
@@ -808,6 +839,7 @@ bool SQLPTRepresentation::SaveFunctionalGroupings(
bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
const policy_table::Rpc& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
utils::dbms::SQLQuery query(db());
utils::dbms::SQLQuery query_parameter(db());
if (!query.Prepare(sql_pt::kInsertRpc) ||
@@ -837,6 +869,18 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
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)));
@@ -859,6 +903,10 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from module_type.");
+ return false;
+ }
if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
LOG4CXX_WARN(logger_, "Incorrect delete from application.");
return false;
@@ -869,6 +917,11 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request subtype.");
+ return false;
+ }
+
// All predefined apps (e.g. default, pre_DataConsent) should be saved first,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -941,6 +994,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -952,6 +1010,10 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
+
return true;
}
@@ -1055,15 +1117,59 @@ bool SQLPTRepresentation::SaveRequestType(
}
policy_table::RequestTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ LOG4CXX_WARN(logger_, "Request types not empty.");
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request types empty.");
query.Bind(0, app_id);
- query.Bind(1, std::string(policy_table::EnumToJsonString(*it)));
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::RequestType::RT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into request types.");
return false;
}
}
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRequestSubType(
+ const std::string& app_id,
+ const policy_table::RequestSubTypes& request_subtypes) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for request subtypes.");
+ return false;
+ }
+ policy_table::Strings::const_iterator it;
+ if (!request_subtypes.empty()) {
+ LOG4CXX_TRACE(logger_, "Request subtypes are not empty.");
+ for (it = request_subtypes.begin(); it != request_subtypes.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
+ } else if (request_subtypes.is_initialized()) {
+ LOG4CXX_WARN(logger_, "Request subtypes empty.");
+ query.Bind(0, app_id);
+ query.Bind(1, std::string("EMPTY"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into request subtypes.");
+ return false;
+ }
+ }
return true;
}
@@ -1111,7 +1217,6 @@ bool SQLPTRepresentation::SaveModuleConfig(
: 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;
@@ -1175,43 +1280,48 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
// 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 (!messages.messages.is_initialized()) {
+ LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty");
+ return true;
+ }
- 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.");
+ utils::dbms::SQLQuery query(db());
+ bool delete_query_exec_result = true;
+ if (!messages.messages->empty()) {
+ delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString);
+ }
+
+ if (!delete_query_exec_result) {
+ LOG4CXX_WARN(logger_, "Failed to delete messages from DB.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kUpdateVersion)) {
+ LOG4CXX_WARN(logger_, "Invalid update messages version statement.");
+ return false;
+ }
+
+ query.Bind(0, messages.version);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update messages version number in DB.");
+ return false;
+ }
+
+ policy_table::Messages::const_iterator it;
+ for (it = messages.messages->begin(); it != messages.messages->end(); ++it) {
+ if (!SaveMessageType(it->first)) {
return false;
}
-
- policy_table::Messages::const_iterator it;
- for (it = messages.messages->begin(); it != messages.messages->end();
- ++it) {
- if (!SaveMessageType(it->first)) {
+ 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;
}
- 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;
- }
+ if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) {
+ return false;
}
}
- } else {
- LOG4CXX_INFO(logger_, "Messages list is empty");
}
return true;
@@ -1471,11 +1581,36 @@ bool SQLPTRepresentation::GatherRequestType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::RequestType::RT_EMPTY == type) {
+ request_types->mark_initialized();
+ continue;
+ }
request_types->push_back(type);
}
return true;
}
+bool SQLPTRepresentation::GatherRequestSubType(
+ const std::string& app_id,
+ policy_table::RequestSubTypes* request_subtypes) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRequestSubTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from request subtypes.");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ const std::string request_subtype = query.GetString(0);
+ if ("EMPTY" == request_subtype) {
+ request_subtypes->mark_initialized();
+ continue;
+ }
+ request_subtypes->push_back(request_subtype);
+ }
+ return true;
+}
+
bool SQLPTRepresentation::GatherNickName(
const std::string& app_id, policy_table::Strings* nicknames) const {
utils::dbms::SQLQuery query(db());
@@ -1506,6 +1641,212 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
+bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
+ bool* denied) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect select remote control flag");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (query.Next()) {
+ *denied = query.GetBoolean(0);
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherModuleType(
+ const std::string& app_id, policy_table::ModuleTypes* app_types) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::ModuleType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id,
+ bool deny) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny);
+ query.Bind(0, deny);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update remote control flag.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveModuleType(
+ const std::string& app_id, const policy_table::ModuleTypes& types) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertModuleType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for module type");
+ return false;
+ }
+
+ policy_table::ModuleTypes::const_iterator it;
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
+ query.Bind(0, app_id);
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAccessModule(
+ TypeAccess access, const policy_table::AccessModules& modules) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAccessModule)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for access module");
+ return false;
+ }
+
+ policy_table::AccessModules::const_iterator i;
+ for (i = modules.begin(); i != modules.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ query.Bind(0, name);
+ query.Bind(1, access);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into access module.");
+ return false;
+ }
+ int id = query.LastInsertId();
+ if (!query.Reset()) {
+ LOG4CXX_WARN(logger_, "Couldn't reset query access module.");
+ return false;
+ }
+ if (!SaveRemoteRpc(id, rpcs)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAccessModule(
+ TypeAccess access, policy_table::AccessModules* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAccessModules)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from access module");
+ return false;
+ }
+
+ query.Bind(0, access);
+ while (query.Next()) {
+ int id = query.GetInteger(0);
+ std::string name = query.GetString(1);
+ policy_table::RemoteRpcs rpcs;
+ if (!GatherRemoteRpc(id, &rpcs)) {
+ return false;
+ }
+ modules->insert(std::make_pair(name, rpcs));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteRpc(int module_id,
+ const policy_table::RemoteRpcs& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRemoteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc");
+ return false;
+ }
+ policy_table::RemoteRpcs::const_iterator i;
+ for (i = rpcs.begin(); i != rpcs.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::Strings& params = i->second;
+ policy_table::Strings::const_iterator j;
+ if (params.empty()) {
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ } else {
+ for (j = params.begin(); j != params.end(); ++j) {
+ const std::string& param = *j;
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2, param);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRemoteRpc(
+ int module_id, policy_table::RemoteRpcs* rpcs) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from remote rpc");
+ return false;
+ }
+
+ query.Bind(0, module_id);
+ while (query.Next()) {
+ std::string name = query.GetString(0);
+ if (!query.IsNull(1)) {
+ std::string parameter = query.GetString(1);
+ (*rpcs)[name].push_back(parameter);
+ } else {
+ rpcs->insert(std::make_pair(name, policy_table::Strings()));
+ }
+ }
+ return true;
+}
+
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
bool is_default,
@@ -1607,11 +1948,19 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
!SaveRequestType(app_id, request_types)) {
return false;
}
+
+ policy_table::Strings request_subtypes;
+ if (!GatherRequestSubType(kDefaultId, &request_subtypes) ||
+ !SaveRequestSubType(app_id, request_subtypes)) {
+ return false;
+ }
+
policy_table::AppHMITypes app_types;
if (!GatherAppType(kDefaultId, &app_types) ||
!SaveAppType(app_id, app_types)) {
return false;
}
+
return SetIsDefault(app_id, true);
}
diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc
index 8d65c606d0..00a6a95af3 100644
--- a/src/components/policy/policy_regular/src/status.cc
+++ b/src/components/policy/policy_regular/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager_interface.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {}
@@ -44,7 +43,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManagerInterface* manager,
case kOnResetPolicyTableRequireUpdate:
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,17 +58,17 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -88,22 +87,22 @@ void policy::UpdatingStatus::ProcessEvent(
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc
index d683249718..c37f8bbadc 100644
--- a/src/components/policy/policy_regular/src/update_status_manager.cc
+++ b/src/components/policy/policy_regular/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,23 +40,12 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
+ , last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
- , app_registered_from_non_consented_device_(true) {
- update_status_thread_delegate_ = new UpdateThreadDelegate(this);
- thread_ = threads::CreateThread("UpdateStatusThread",
- update_status_thread_delegate_);
- thread_->start();
-}
+ , app_registered_from_non_consented_device_(true) {}
-UpdateStatusManager::~UpdateStatusManager() {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(update_status_thread_delegate_);
- DCHECK(thread_);
- thread_->join();
- delete update_status_thread_delegate_;
- threads::DeleteThread(thread_);
-}
+UpdateStatusManager::~UpdateStatusManager() {}
void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
sync_primitives::AutoLock lock(status_lock_);
@@ -66,11 +54,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -78,29 +66,23 @@ void UpdateStatusManager::set_listener(PolicyListener* listener) {
listener_ = listener;
}
-void UpdateStatusManager::OnUpdateSentOut(uint32_t update_timeout) {
+void UpdateStatusManager::OnUpdateSentOut() {
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);
}
@@ -118,6 +100,15 @@ void UpdateStatusManager::OnResetRetrySequence() {
ProcessEvent(kOnResetRetrySequence);
}
+void UpdateStatusManager::OnExistedApplicationAdded(
+ const bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
LOG4CXX_AUTO_TRACE(logger_);
if (kDeviceAllowed != consent) {
@@ -128,14 +119,6 @@ void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
ProcessEvent(kOnNewAppRegistered);
}
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (is_update_required) {
- current_status_.reset(new UpToDateStatus());
- ProcessEvent(kScheduleUpdate);
- }
-}
-
void UpdateStatusManager::OnDeviceConsented() {
LOG4CXX_AUTO_TRACE(logger_);
if (app_registered_from_non_consented_device_) {
@@ -204,57 +187,4 @@ void UpdateStatusManager::DoTransition() {
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
index 60e34a929d..ed16fa3e8d 100644
--- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -52,7 +52,7 @@ void GlobalCounter::operator++() const {
}
}
-AppCounter::AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppCounter::AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -65,7 +65,7 @@ void AppCounter::operator++() const {
}
}
-AppInfo::AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppInfo::AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -79,7 +79,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -90,7 +90,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -103,8 +103,7 @@ AppStopwatchImpl::AppStopwatchImpl(
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
index 997c3637e8..bd6af96867 100644
--- a/src/components/policy/policy_regular/test/CMakeLists.txt
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -39,6 +39,7 @@ include_directories(
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/include/test/policy/policy_regular/
${POLICY_PATH}/test/include/
${POLICY_MOCK_INCLUDE_PATH}/
)
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index 6d663e9a0c..2f4735dd66 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 4062e94516..806ab8bcc0 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index 78596189da..28396be29a 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -83,7 +83,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index ab4c2f8927..4592e228df 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +353,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +373,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +393,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +412,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
new file mode 100644
index 0000000000..f79bb683f8
--- /dev/null
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "policy/access_remote_impl.h"
+
+namespace policy {
+
+TEST(AccessRemoteImplTest, CheckModuleType) {
+ AccessRemoteImpl access_remote;
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
+
+ // No application
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+
+ // No modules
+ policy_table::ApplicationPolicies& apps =
+ access_remote.cache_->pt_->policy_table.app_policies_section.apps;
+ apps["1234"];
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+
+ // Empty modules
+ policy_table::ModuleTypes& modules = *apps["1234"].moduleType;
+ modules.mark_initialized();
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE));
+
+ // Specific modules
+ modules.push_back(policy_table::MT_RADIO);
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE));
+}
+
+TEST(AccessRemoteImplTest, SetDefaultHmiTypes) {
+ AccessRemoteImpl access_remote;
+
+ std::vector<int> hmi_expected;
+ hmi_expected.push_back(2);
+ hmi_expected.push_back(6);
+ ApplicationOnDevice who = {"dev1", "1234"};
+ access_remote.SetDefaultHmiTypes(who, hmi_expected);
+
+ EXPECT_NE(access_remote.hmi_types_.end(), access_remote.hmi_types_.find(who));
+ policy_table::AppHMITypes& hmi_output = access_remote.hmi_types_[who];
+ EXPECT_EQ(2u, hmi_output.size());
+ EXPECT_EQ(policy_table::AHT_MEDIA, hmi_output[0]);
+ EXPECT_EQ(policy_table::AHT_SOCIAL, hmi_output[1]);
+}
+
+TEST(AccessRemoteImplTest, GetGroups) {
+ AccessRemoteImpl access_remote;
+ ApplicationOnDevice who = {"dev1", "1234"};
+ access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL);
+
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
+ policy_table::ApplicationPolicies& apps =
+ access_remote.cache_->pt_->policy_table.app_policies_section.apps;
+ apps["1234"].groups.push_back("group_default");
+ apps["1234"].AppHMIType->push_back(policy_table::AHT_MEDIA);
+
+ // Default groups
+ const policy_table::Strings& groups1 = access_remote.GetGroups(who);
+ EXPECT_EQ(std::string("group_default"), std::string(groups1[0]));
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc
index 2c0ab73c0b..d11bcec2ac 100644
--- a/src/components/policy/policy_regular/test/counter_test.cc
+++ b/src/components/policy/policy_regular/test/counter_test.cc
@@ -53,7 +53,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -67,7 +67,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -82,7 +82,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -96,7 +96,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -110,7 +110,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -123,7 +123,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -138,7 +138,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -155,7 +155,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -171,7 +171,7 @@ TEST(
StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h
new file mode 100644
index 0000000000..0b64ff645e
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+
+#include "gmock/gmock.h"
+#include "policy/access_remote.h"
+
+namespace test {
+namespace components {
+namespace access_remote_test {
+
+class MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ policy::FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(CheckModuleType,
+ bool(const policy::PTString& app_id,
+ policy_table::ModuleType module));
+ MOCK_METHOD1(IsAppRemoteControl,
+ bool(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+};
+
+} // namespace access_remote_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h
deleted file mode 100644
index faabfe56be..0000000000
--- a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_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 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_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&));
-};
-
-} // 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
deleted file mode 100644
index 931a3c0338..0000000000
--- a/src/components/policy/policy_regular/test/include/policy/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_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&));
-};
-
-} // 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
deleted file mode 100644
index ff54807ef2..0000000000
--- a/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h
+++ /dev/null
@@ -1,183 +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_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_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(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_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
index 8a47e7ca97..72f183175c 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
@@ -76,7 +76,7 @@ class MockPTRepresentation : virtual public PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
index 981ff1ca9e..e66d2012cb 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
@@ -41,14 +41,14 @@ namespace policy {
class MockUpdateStatusManager : public UpdateStatusManager {
public:
MOCK_METHOD1(set_listener, void(PolicyListener* listener));
- MOCK_METHOD1(OnUpdateSentOut, void(uint32_t update_timeout));
+ MOCK_METHOD0(OnUpdateSentOut, void());
MOCK_METHOD0(OnUpdateTimeoutOccurs, void());
MOCK_METHOD0(OnValidUpdateReceived, void());
MOCK_METHOD0(OnWrongUpdateReceived, void());
MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD1(OnExistedApplicationAdded, void(const bool is_update_required));
MOCK_METHOD0(OnNewApplicationAdded, void());
- MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
};
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index e6d246b748..ff054b3cc4 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -51,8 +51,9 @@
#include "utils/macro.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/gen_hash.h"
+#include "policy/mock_access_remote.h"
using ::testing::ReturnRef;
using ::testing::DoAll;
@@ -129,6 +130,12 @@ struct StringsForUpdate CreateNewRandomData(StringsForUpdate& str) {
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") {}
@@ -138,12 +145,15 @@ class PolicyManagerImplTest : public ::testing::Test {
MockCacheManagerInterface* cache_manager;
NiceMock<MockPolicyListener> listener;
const std::string device_id;
+ std::shared_ptr<access_remote_test::MockAccessRemote> access_remote;
void SetUp() OVERRIDE {
manager = new PolicyManagerImpl();
manager->set_listener(&listener);
cache_manager = new MockCacheManagerInterface();
manager->set_cache_manager(cache_manager);
+ access_remote = std::shared_ptr<access_remote_test::MockAccessRemote>();
+ manager->set_access_remote(access_remote);
}
void TearDown() OVERRIDE {
@@ -165,7 +175,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
public:
PolicyManagerImplTest2()
: app_id1("123456789")
- , app_id2("1766825573")
+ , app_id2("1010101010")
, dev_id1("XXX123456789ZZZ")
, dev_id2("08-00-27-CE-76-FE")
, PTU_request_types(Json::arrayValue) {}
@@ -183,15 +193,16 @@ class PolicyManagerImplTest2 : public ::testing::Test {
const std::string dev_id2;
Json::Value PTU_request_types;
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- const std::string kAppStorageFolder = "storage1";
+ const std::string kAppStorageFolder = "storage_PolicyManagerImplTest2";
void SetUp() OVERRIDE {
- file_system::CreateDirectory("storage1");
+ file_system::CreateDirectory(kAppStorageFolder);
file_system::DeleteFile("policy.sqlite");
manager = new PolicyManagerImpl();
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
manager->set_listener(&listener);
const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
@@ -225,9 +236,10 @@ class PolicyManagerImplTest2 : public ::testing::Test {
}
void CreateLocalPT(const std::string& file_name) {
- file_system::remove_directory_content("storage1");
+ file_system::remove_directory_content(kAppStorageFolder);
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
}
@@ -260,7 +272,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
// Add app
- manager->AddApplication(section_name);
+ 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);
@@ -342,13 +354,15 @@ class PolicyManagerImplTest2 : public ::testing::Test {
// Get cache
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
void TearDown() OVERRIDE {
delete manager;
+ file_system::remove_directory_content(kAppStorageFolder);
+ file_system::RemoveDirectory(kAppStorageFolder, true);
}
};
@@ -369,12 +383,12 @@ Json::Value CreatePTforLoad() {
"}"
"},"
"\"notifications_per_minute_by_priority\": {"
- "\"emergency\": 1,"
- "\"navigation\": 2,"
- "\"VOICECOMM\": 3,"
- "\"communication\": 4,"
- "\"normal\": 5,"
- "\"none\": 6"
+ "\"EMERGENCY\": 1,"
+ "\"NAVIGATION\": 2,"
+ "\"VOICECOM\": 3,"
+ "\"COMMUNICATION\": 4,"
+ "\"NORMAL\": 5,"
+ "\"NONE\": 6"
"},"
"\"vehicle_make\" : \"MakeT\","
"\"vehicle_model\" : \"ModelT\","
@@ -454,8 +468,10 @@ TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
// Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
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);
@@ -465,32 +481,33 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
EXPECT_CALL(listener, OnUpdateStatusChanged(_));
EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
- std::string priority = "emergency";
+ std::string priority = "EMERGENCY";
uint32_t notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "navigation";
+ priority = "NAVIGATION";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(2u, notif_number);
- priority = "emergency";
+ priority = "EMERGENCY";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(1u, notif_number);
- priority = "VOICECOMM";
+ priority = "VOICECOM";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(3u, notif_number);
- priority = "normal";
+ priority = "NORMAL";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(5u, notif_number);
- priority = "none";
+ priority = "NONE";
notif_number = manager->GetNotificationsNumber(priority);
EXPECT_EQ(6u, notif_number);
}
TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
+ CreateLocalPT("sdl_preloaded_pt.json");
// Arrange
std::ifstream ifile("sdl_preloaded_pt.json");
Json::Reader reader;
@@ -525,7 +542,7 @@ TEST_F(PolicyManagerImplTest2,
.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);
+ 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);
@@ -537,7 +554,7 @@ TEST_F(PolicyManagerImplTest2,
::policy::CheckPermissionResult output;
manager->CheckPermissions(
- app_id1, std::string("FULL"), "Alert", input_params, output);
+ dev_id1, app_id1, std::string("FULL"), "Alert", input_params, output);
// Check RPC is allowed
EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
@@ -557,9 +574,9 @@ TEST_F(PolicyManagerImplTest2,
ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
manager->CheckPermissions(
- app_id1, std::string("FULL"), "Alert", input_params, output);
+ dev_id1, app_id1, std::string("FULL"), "Alert", input_params, output);
// Check RPC is disallowed
- EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
ASSERT_TRUE(output.list_of_allowed_params.empty());
}
@@ -582,7 +599,7 @@ TEST_F(PolicyManagerImplTest2,
.WillRepeatedly(Return(dev_id1));
manager->SetUserConsentForDevice(dev_id1, true);
// Add app from consented device. App will be assigned with default policies
- manager->AddApplication("1234");
+ 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;
@@ -639,8 +656,12 @@ TEST_F(PolicyManagerImplTest2,
"Life",
2,
"Bluetooth");
- manager->CheckPermissions(
- std::string("1234"), std::string("FULL"), "Alert", input_params, output);
+ 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
@@ -703,8 +724,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
const std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- utils::MakeShared<policy_table::Table>(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
@@ -765,7 +786,8 @@ TEST_F(
AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpdateRequired) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- ::policy::StatusNotifier notifyer = manager->AddApplication(app_id1);
+ ::policy::StatusNotifier notifyer =
+ manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
DCHECK(notifyer);
(*notifyer)();
EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
@@ -777,7 +799,7 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are different
CreateLocalPT("ptu_requestType.json");
- manager->AddApplication(app_id1);
+ 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));
@@ -790,7 +812,7 @@ TEST_F(
// Arrange
// RequestTypes for default & preDataConsent are the same
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id1);
+ 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);
@@ -807,7 +829,7 @@ TEST_F(
GetPTU("valid_sdl_pt_update.json");
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
// Try to add existing app
- manager->AddApplication(app_id2);
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check no update required
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
}
@@ -816,15 +838,15 @@ TEST_F(PolicyManagerImplTest2,
PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days = current_time.tv_sec / kSecondsInDay;
+ int days = date_time::getSecs(current_time) / kSecondsInDay;
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
GetPTU("valid_sdl_pt_update.json");
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- manager->AddApplication(app_id2);
+ 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)
@@ -857,6 +879,7 @@ TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
CreateLocalPT("sdl_preloaded_pt.json");
manager->ResetRetrySequence();
EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+ manager->SetSendOnUpdateSentOut(false);
manager->OnUpdateStarted();
EXPECT_EQ("UPDATING", manager->GetPolicyTableStatus());
}
@@ -875,24 +898,24 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
uint32_t timeout_after_x_seconds =
root["policy_table"]["module_config"]["timeout_after_x_seconds"]
.asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
const uint32_t first_retry = timeout_after_x_seconds;
EXPECT_EQ(first_retry, manager->NextRetryTimeout());
- uint32_t next_retry = first_retry +
- seconds_between_retries[0].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ uint32_t next_retry =
+ first_retry +
+ seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[1].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[1].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[2].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[2].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[3].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[3].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
}
}
@@ -942,7 +965,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
// Arrange
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -1036,7 +1059,7 @@ TEST_F(PolicyManagerImplTest2,
DISABLED_GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
// Arrange
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2);
+ 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;
@@ -1058,7 +1081,7 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_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);
@@ -1069,7 +1092,7 @@ TEST_F(PolicyManagerImplTest2,
GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
// Arrange
CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2);
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
// Check if app has preData policy
EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
std::string priority1;
@@ -1091,7 +1114,7 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_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));
@@ -1101,11 +1124,11 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
+ 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 Empty nicknames and AppHmiTypes
EXPECT_EQ(0u, app_nicknames.size());
EXPECT_EQ(0u, app_hmi_types.size());
@@ -1132,7 +1155,7 @@ TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
for (uint32_t i = 0; i < nick_names_size; ++i) {
EXPECT_EQ(app_nicknames1[i], appNicknames[i].asString());
}
- // Check AppHMITypes match
+ // Check AppHmiTypes match
for (uint32_t i = 0; i < app_hmi_types_size; ++i) {
EXPECT_EQ(app_hmi_types1[i], appHmiTypes[i].asString());
}
@@ -1143,7 +1166,7 @@ TEST_F(
CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
+ 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
@@ -1155,7 +1178,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2);
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((manager->GetCache())
->SetDeviceData(dev_id2,
"hardware IPX",
@@ -1170,7 +1193,7 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_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));
@@ -1180,7 +1203,7 @@ TEST_F(PolicyManagerImplTest2,
CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
+ 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));
@@ -1191,7 +1214,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2);
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
ASSERT_TRUE((manager->GetCache())
->SetDeviceData(dev_id2,
"hardware IPX",
@@ -1206,7 +1229,7 @@ TEST_F(PolicyManagerImplTest2,
EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_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));
@@ -1216,7 +1239,7 @@ TEST_F(PolicyManagerImplTest2,
CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
+ 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));
@@ -1234,7 +1257,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
GetPTU("valid_sdl_pt_update.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
@@ -1272,7 +1295,7 @@ TEST_F(
manager->SetUserConsentForDevice(dev_id2, true);
EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
.WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
GetPTU("valid_sdl_pt_update.json");
::policy::PermissionConsent perm_consent;
@@ -1315,7 +1338,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
pt->SetPolicyTableType(type1);
@@ -1326,7 +1349,7 @@ TEST_F(
pt->ReportErrors(&report);
}
// Add new app
- manager->AddApplication(app_id2);
+ 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);
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 50364397fd..2a05a94f8b 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -485,12 +489,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -506,12 +513,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -527,12 +537,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -547,12 +560,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2595,7 +2611,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 44bd8356fe..b0d9117568 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -485,12 +489,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -506,12 +513,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -527,12 +537,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -547,12 +560,15 @@
"parameters": [
"bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -2590,7 +2606,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index d6f34c12fc..59e3f947c3 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -14,12 +14,13 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
"EMERGENCY": 60,
"NAVIGATION": 15,
+ "PROJECTION": 15,
"COMMUNICATION": 6,
"NORMAL": 4,
"NONE": 0
@@ -296,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -349,12 +354,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -366,12 +374,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -383,12 +394,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
@@ -399,12 +413,15 @@
"LIMITED"],
"parameters": ["bodyInformation",
"deviceStatus",
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"]
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index e6817da0d3..7b882c6ceb 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index d5f5f480f3..7d90275328 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1609,12 +1613,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1624,12 +1631,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1639,12 +1649,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1653,12 +1666,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1720,7 +1736,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index a332f92382..909e4d5238 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1587,12 +1591,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1602,12 +1609,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1617,12 +1627,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1631,12 +1644,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1698,7 +1714,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
index a313ce6d7f..7d192515dc 100644
--- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -47,8 +47,7 @@
#include "json/writer.h"
#include "json/reader.h"
#include "rpc_base/rpc_base.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "utils/sqlite_wrapper/sql_database.h"
@@ -68,22 +67,23 @@ namespace test {
namespace components {
namespace policy_test {
+using policy_handler_test::MockPolicySettings;
+
class SQLPTRepresentationTest : public SQLPTRepresentation,
public ::testing::Test {
protected:
- static DBMS* dbms;
- static SQLPTRepresentation* reps;
+ DBMS* dbms;
+ 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_;
+ std::unique_ptr<NiceMock<MockPolicySettings> > policy_settings_;
- static void SetUpTestCase() {
- file_system::DeleteFile(kAppStorageFolder + "/policy.sqlite");
+ void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
reps = new SQLPTRepresentation;
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
- new policy_handler_test::MockPolicySettings());
+ policy_settings_ = std::unique_ptr<NiceMock<MockPolicySettings> >(
+ new NiceMock<MockPolicySettings>());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get()));
@@ -93,15 +93,13 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
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);
+ file_system::remove_directory_content(kAppStorageFolder);
+ file_system::RemoveDirectory(kAppStorageFolder, true);
policy_settings_.reset();
}
@@ -290,6 +288,7 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["default"]["default_hmi"] = Json::Value("FULL");
app_policies["default"]["keep_context"] = Json::Value(true);
app_policies["default"]["steal_focus"] = Json::Value(true);
+ app_policies["default"]["RequestType"] = Json::Value(Json::arrayValue);
app_policies["pre_DataConsent"] = Json::Value(Json::objectValue);
app_policies["pre_DataConsent"]["memory_kb"] = Json::Value(40);
@@ -301,6 +300,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["pre_DataConsent"]["is_revoked"] = Json::Value(false);
app_policies["pre_DataConsent"]["keep_context"] = Json::Value(true);
app_policies["pre_DataConsent"]["steal_focus"] = Json::Value(true);
+ app_policies["pre_DataConsent"]["RequestType"] =
+ Json::Value(Json::arrayValue);
+
app_policies["1234"] = Json::Value(Json::objectValue);
app_policies["1234"]["memory_kb"] = Json::Value(150);
app_policies["1234"]["heart_beat_timeout_ms"] = Json::Value(200);
@@ -311,6 +313,8 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
app_policies["1234"]["is_revoked"] = Json::Value(true);
app_policies["1234"]["keep_context"] = Json::Value(false);
app_policies["1234"]["steal_focus"] = Json::Value(false);
+ app_policies["1234"]["RequestType"] = Json::Value(Json::arrayValue);
+
app_policies["device"] = Json::Value(Json::objectValue);
app_policies["device"]["groups"] = Json::Value(Json::arrayValue);
app_policies["device"]["groups"][0] = Json::Value("default");
@@ -346,12 +350,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
}
};
-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_;
+const std::string SQLPTRepresentationTest::kAppStorageFolder =
+ "storage_SQLPTRepresentationTest";
class SQLPTRepresentationTest2 : public ::testing::Test {
protected:
@@ -378,7 +379,7 @@ class SQLPTRepresentationTest2 : public ::testing::Test {
}
SQLPTRepresentation* reps;
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ NiceMock<MockPolicySettings> policy_settings_;
const std::string kAppStorageFolder;
const uint16_t kOpenAttemptTimeoutMs;
const uint16_t kAttemptsToOpenPolicyDB;
@@ -399,7 +400,7 @@ class SQLPTRepresentationTest3 : public ::testing::Test {
}
SQLPTRepresentation* reps;
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ NiceMock<MockPolicySettings> policy_settings_;
const std::string kAppStorageFolder;
};
@@ -424,7 +425,10 @@ TEST_F(SQLPTRepresentationTest,
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));
+
+ // There are 29 tables in the database, now.
+ const int32_t total_tables_number = 29;
+ ASSERT_EQ(total_tables_number, dbms->FetchOneInt(query_select));
const char* query_select_count_of_iap_buffer_full =
"SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
const char* query_select_count_sync_out_of_memory =
@@ -1102,7 +1106,7 @@ TEST_F(SQLPTRepresentationTest,
GetInitialAppData_SetData_ExpectCorrectValuesReceived) {
// Arrange
const char* query_insert =
- "INSERT INTO `nickname` (`application_id`, `name`)"
+ "INSERT INTO `nickname` (`application_id`, `name`) "
"VALUES ('1111', 'first_app') , "
"('2222', 'second_app'), ('3333', 'third_app')";
ASSERT_TRUE(dbms->Exec(query_insert));
@@ -1512,7 +1516,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc
index 910494ff0d..244858554f 100644
--- a/src/components/policy/policy_regular/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc
@@ -34,7 +34,6 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -46,15 +45,13 @@ using ::testing::Return;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
- const uint32_t k_timeout_;
- utils::SharedPtr<MockPolicyListener> listener_;
+ std::shared_ptr<UpdateStatusManager> manager_;
+ std::shared_ptr<MockPolicyListener> listener_;
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
- , k_timeout_(1000)
- , listener_(utils::MakeShared<MockPolicyListener>()) {}
+ : manager_(std::make_shared<UpdateStatusManager>())
+ , listener_(std::make_shared<MockPolicyListener>()) {}
void SetUp() OVERRIDE {
manager_->set_listener(listener_.get());
@@ -65,20 +62,6 @@ class UpdateStatusManagerTest : public ::testing::Test {
};
TEST_F(UpdateStatusManagerTest,
- StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
- // Arrange
- manager_->OnPolicyInit(false);
- // Check
- EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
- manager_->OnPolicyInit(true);
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
- manager_->OnUpdateSentOut(k_timeout_);
- // Check
- EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
-}
-
-TEST_F(UpdateStatusManagerTest,
OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
// Arrange
manager_->OnAppsSearchStarted();
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 56c728f104..5827ab287a 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1585,12 +1589,15 @@
"GetVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1600,12 +1607,15 @@
"OnVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"vin",
@@ -1615,12 +1625,15 @@
"SubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1629,12 +1642,15 @@
"UnsubscribeVehicleData" : {
"hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
"parameters" : [
+ "engineOilLife",
"engineTorque",
"externalTemperature",
+ "turnSignal",
"fuelLevel",
"fuelLevel_State",
"headLampStatus",
"instantFuelConsumption",
+ "fuelRange",
"odometer",
"tirePressure",
"wiperStatus"
@@ -1696,7 +1712,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc
new file mode 100644
index 0000000000..11160d7082
--- /dev/null
+++ b/src/components/protocol/src/bson_object_keys.cc
@@ -0,0 +1,24 @@
+#include <protocol/bson_object_keys.h>
+
+namespace protocol_handler {
+
+namespace strings {
+
+const char* hash_id = "hashId";
+const char* protocol_version = "protocolVersion";
+const char* mtu = "mtu";
+const char* rejected_params = "rejectedParams";
+const char* height = "height";
+const char* width = "width";
+const char* video_protocol = "videoProtocol";
+const char* video_codec = "videoCodec";
+const char* secondary_transports = "secondaryTransports";
+const char* audio_service_transports = "audioServiceTransports";
+const char* video_service_transports = "videoServiceTransports";
+const char* tcp_ip_address = "tcpIpAddress";
+const char* tcp_port = "tcpPort";
+const char* reason = "reason";
+
+} // namespace strings
+
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index c1dd9b2769..ff8678b826 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -35,17 +35,27 @@ include_directories(
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/connection_handler/include/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BSON_INCLUDE_DIRECTORY}
)
set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-collect_sources(SOURCES "${PATHS}")
+
+if (ENABLE_SECURITY)
+ set(EXCLUDE_PATHS)
+else()
+ set(EXCLUDE_PATHS handshake_handler.cc)
+endif()
+
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
ProtocolLibrary
Utils
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
get_property(dirs DIRECTORY "" PROPERTY LIBRARIES)
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
new file mode 100644
index 0000000000..cb52c9d375
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
+
+#include <memory>
+
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/session_observer.h"
+#include "security_manager/security_manager_listener.h"
+
+#include "utils/semantic_version.h"
+
+namespace protocol_handler {
+
+class ProtocolHandlerImpl;
+
+/**
+ * @brief HandshakeHandler class for handling SSL handshake and sending
+ * Ack/Nack on its success or fail
+ */
+class HandshakeHandler : public security_manager::SecurityManagerListener {
+ public:
+ HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ utils::SemanticVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<BsonObject> payload);
+
+ ~HandshakeHandler();
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ bool GetPolicyCertificateData(std::string& data) const OVERRIDE;
+
+ /**
+ * @brief Notification about protection result
+ * @param connection_key Unique key of session which triggrs handshake
+ * @param result result of connection protection
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeDone(
+ uint32_t connection_key,
+ security_manager::SSLContext::HandshakeResult result) OVERRIDE;
+
+ /**
+ * @brief Notification about handshake failure
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeFailed() OVERRIDE;
+
+ /**
+ * @brief Notification that certificate update is required.
+ */
+ void OnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Get connection key of this handler
+ * @return connection key
+ */
+ uint32_t connection_key() const;
+
+ private:
+ /**
+ * @brief Performs related actions if handshake was successfully finished
+ * @param connection_key Unique key of session which triggrs handshake
+ * @param params set of params used in bson part of message
+ */
+ void ProcessSuccessfulHandshake(const uint32_t connection_key,
+ BsonObject& params);
+
+ /**
+ * @brief Performs related actions if handshake was failed
+ * @param params set of params used in bson part of message
+ */
+ void ProcessFailedHandshake(BsonObject& params);
+
+ ProtocolHandlerImpl& protocol_handler_;
+ SessionObserver& session_observer_;
+ SessionContext context_;
+ utils::SemanticVersion full_version_;
+ const uint8_t protocol_version_;
+ std::shared_ptr<BsonObject> payload_;
+};
+
+} // namespace protocol_handler
+
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
index bac37b508c..84ec3c9e30 100644
--- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
+++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
@@ -60,7 +60,7 @@ typedef uint32_t MessageID;
struct ProtocolFrameData {
ProtocolFramePtr frame;
- TimevalStruct append_time;
+ date_time::TimeDuration append_time;
};
/**
*\brief Map of frames with last frame data for messages received in multiple
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
index b18ee07d4d..3e7d64e9d2 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -42,8 +42,10 @@
#include "utils/prioritized_queue.h"
#include "utils/message_queue.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/messagemeter.h"
+#include "utils/custom_string.h"
+#include "utils/semantic_version.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_packet.h"
@@ -55,7 +57,9 @@
#include "transport_manager/common.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
#include "connection_handler/connection_handler.h"
+#include "application_manager/policies/policy_handler_observer.h"
#ifdef TELEMETRY_MONITOR
#include "protocol_handler/telemetry_observer.h"
@@ -64,6 +68,7 @@
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
+#include "protocol_handler/handshake_handler.h"
#endif // ENABLE_SECURITY
namespace connection_handler {
@@ -77,6 +82,7 @@ class ConnectionHandlerImpl;
namespace protocol_handler {
class ProtocolObserver;
class SessionObserver;
+class HandshakeHandler;
class MessagesFromMobileAppHandler;
class MessagesToMobileAppHandler;
@@ -84,6 +90,8 @@ class MessagesToMobileAppHandler;
using transport_manager::TransportManagerListenerEmpty;
typedef std::multimap<int32_t, RawMessagePtr> MessagesOverNaviMap;
+typedef std::map<std::pair<ConnectionID, uint8_t>, ProtocolFramePtr>
+ StartSessionFrameMap;
typedef std::set<ProtocolObserver*> ProtocolObservers;
typedef transport_manager::ConnectionUID ConnectionID;
@@ -126,6 +134,30 @@ typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+
+// Type to allow easy mapping between a device type and transport
+// characteristics
+typedef enum {
+ TT_NONE = -1,
+ TT_USB = 0,
+ TT_BLUETOOTH = 1,
+ TT_WIFI = 2
+} TransportType;
+
+struct TransportDescription {
+ TransportDescription(const TransportType transport_type,
+ const bool ios_transport,
+ const bool android_transport)
+ : transport_type_(transport_type)
+ , ios_transport_(ios_transport)
+ , android_transport_(android_transport) {}
+
+ TransportType transport_type_;
+ bool ios_transport_;
+ bool android_transport_;
+};
+
+typedef std::map<std::string, TransportDescription> TransportTypes;
} // namespace impl
/**
@@ -139,6 +171,7 @@ typedef threads::MessageLoopThread<
class ProtocolHandlerImpl
: public ProtocolHandler,
public TransportManagerListenerEmpty,
+ public policy::PolicyHandlerObserver,
public impl::FromMobileQueue::Handler,
public impl::ToMobileQueue::Handler
#ifdef TELEMETRY_MONITOR
@@ -225,10 +258,20 @@ class ProtocolHandlerImpl
*/
void SendEndSession(int32_t connection_id, uint8_t session_id);
- void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
+ void NotifyOnFailedHandshake() OVERRIDE;
+
// TODO(Ezamakhov): move Ack/Nack as interface for StartSessionHandler
/**
* \brief Sends acknowledgement of starting session to mobile application
@@ -245,11 +288,59 @@ class ProtocolHandlerImpl
*/
void SendStartSessionAck(ConnectionID connection_id,
uint8_t session_id,
- uint8_t protocol_version,
+ uint8_t input_protocol_version,
uint32_t hash_code,
uint8_t service_type,
bool protection);
+ /**
+ * \brief Sends acknowledgement of starting session to mobile application
+ * with session number and hash code for second version of protocol
+ * was started
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param hash_code For second version of protocol: identifier of session
+ * to be sent to
+ * mobile app for using when ending session
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param protection Protection flag
+ * \param full_version full protocol version (major.minor.patch) used by the
+ * mobile proxy
+ */
+ void SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_code,
+ uint8_t service_type,
+ bool protection,
+ utils::SemanticVersion& full_version);
+
+ /**
+ * \brief Sends acknowledgement of starting session to mobile application
+ * with session number and hash code for second version of protocol
+ * was started
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param hash_code For second version of protocol: identifier of session
+ * to be sent to
+ * mobile app for using when ending session
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param protection Protection flag
+ * \param full_version full protocol version (major.minor.patch) used by the
+ * mobile proxy
+ * \param params Parameters added in the payload
+ */
+ void SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_code,
+ uint8_t service_type,
+ bool protection,
+ utils::SemanticVersion& full_version,
+ BsonObject& params);
+
const ProtocolHandlerSettings& get_settings() const OVERRIDE {
return settings_;
}
@@ -267,6 +358,20 @@ class ProtocolHandlerImpl
uint8_t service_type);
/**
+ * \brief Sends fail of starting session to mobile application
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param rejected_params List of rejected params to send in payload
+ */
+ void SendStartSessionNAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams);
+
+ /**
* \brief Sends acknowledgement of end session/service to mobile application
* with session number for second version of protocol.
* \param connection_id Identifier of connection
@@ -294,9 +399,35 @@ class ProtocolHandlerImpl
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type);
+ /**
+ * \brief Sends fail of ending session to mobile application (variant for
+ * Protocol v5)
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session ment to be ended
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param rejected_params List of rejected params to send in payload
+ */
+ void SendEndSessionNAck(ConnectionID connection_id,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejected_params);
SessionObserver& get_session_observer() OVERRIDE;
+ /**
+ * @brief Called by connection handler to notify the result of
+ * OnSessionStartedCallback().
+ * @param context reference to structure with started session data
+ * @param rejected_params list of parameters name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ void NotifySessionStarted(const SessionContext& context,
+ std::vector<std::string>& rejected_params) OVERRIDE;
+
#ifdef BUILD_TESTS
const impl::FromMobileQueue& get_from_mobile_queue() const {
return raw_ford_messages_from_mobile_;
@@ -305,10 +436,19 @@ class ProtocolHandlerImpl
const impl::ToMobileQueue& get_to_mobile_queue() const {
return raw_ford_messages_to_mobile_;
}
+
+ void set_tcp_config(bool tcp_enabled,
+ std::string tcp_address,
+ std::string tcp_port) {
+ tcp_enabled_ = tcp_enabled;
+ tcp_ip_address_ = tcp_address;
+ tcp_port_ = tcp_port;
+ }
#endif
private:
- void SendEndServicePrivate(int32_t connection_id,
+ void SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
@@ -319,6 +459,28 @@ class ProtocolHandlerImpl
uint8_t session_id,
uint32_t message_id);
+ /*
+ * Prepare and send TransportUpdateEvent message
+ */
+ void SendTransportUpdateEvent(ConnectionID connection_id, uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportNAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason = NULL);
+
/**
* @brief Notifies about receiving message from TM.
*
@@ -357,6 +519,19 @@ class ProtocolHandlerImpl
void OnConnectionClosed(
const transport_manager::ConnectionUID connection_id) OVERRIDE;
+ void OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) OVERRIDE;
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ void OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs)
+ OVERRIDE;
+
/**
* @brief Notifies subscribers about message
* received from mobile device.
@@ -453,7 +628,10 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- RESULT_CODE HandleControlMessageStartSession(const ProtocolPacket& packet);
+ RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
+
+ RESULT_CODE HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet);
RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet);
@@ -483,6 +661,32 @@ class ProtocolHandlerImpl
*/
uint8_t SupportedSDLProtocolVersion() const;
+ const impl::TransportDescription GetTransportTypeFromConnectionType(
+ const std::string& device_type) const;
+
+ const bool ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const;
+
+ void GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const;
+
+ void GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const;
+
+ const std::string TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const;
+
const ProtocolHandlerSettings& settings_;
/**
@@ -566,6 +770,13 @@ class ProtocolHandlerImpl
sync_primitives::Lock protocol_observers_lock_;
+ sync_primitives::Lock start_session_frame_map_lock_;
+ StartSessionFrameMap start_session_frame_map_;
+
+ bool tcp_enabled_;
+ std::string tcp_port_;
+ std::string tcp_ip_address_;
+
#ifdef TELEMETRY_MONITOR
PHTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
index f8696c46a0..de4af84915 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -99,7 +99,19 @@ class ProtocolPacket {
* \brief Setter/getter maximum payload size of packets
*/
void set_max_payload_size(const size_t max_payload_size);
+ void set_max_control_payload_size(const size_t max_payload_size);
+ void set_max_rpc_payload_size(const size_t max_payload_size);
+ void set_max_audio_payload_size(const size_t max_payload_size);
+ void set_max_video_payload_size(const size_t max_payload_size);
+
size_t max_payload_size() const;
+ size_t max_control_payload_size() const;
+ size_t max_rpc_payload_size() const;
+ size_t max_audio_payload_size() const;
+ size_t max_video_payload_size() const;
+
+ size_t max_payload_size_by_service_type(const ServiceType type) const;
+
/**
* \brief Check ProtocolHeader according to protocol requiements
*/
@@ -107,6 +119,10 @@ class ProtocolPacket {
private:
size_t max_payload_size_;
+ size_t max_control_payload_size_;
+ size_t max_rpc_payload_size_;
+ size_t max_audio_payload_size_;
+ size_t max_video_payload_size_;
};
/**
@@ -184,6 +200,12 @@ class ProtocolPacket {
const size_t messageSize);
/**
+ * @brief Calculates FIRST_FRAME data for further handling of consecutive
+ * frames
+ */
+ void HandleRawFirstFrameData(const uint8_t* message);
+
+ /**
* \brief Getter of protocol version.
*/
uint8_t protocol_version() const;
@@ -258,6 +280,11 @@ class ProtocolPacket {
ConnectionID connection_id() const;
/**
+ * \brief Setter of Connection Identifier
+ */
+ void set_connection_id(ConnectionID connection_id);
+
+ /**
* \brief Getter for data payload size
*/
uint32_t payload_size() const;
@@ -296,7 +323,7 @@ class ProtocolPacket {
* @brief Type definition for variable that hold shared pointer to protocolol
* packet
*/
-typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
+typedef std::shared_ptr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
typedef std::list<ProtocolFramePtr> ProtocolFramePtrList;
template <typename _CharT>
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
new file mode 100644
index 0000000000..775d77db66
--- /dev/null
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol_handler/handshake_handler.h"
+
+#include <bson_object.h>
+
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol_handler/protocol_packet.h"
+#include "security_manager/security_manager.h"
+#include "protocol_handler/session_observer.h"
+
+namespace protocol_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
+
+HandshakeHandler::HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ utils::SemanticVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<BsonObject> payload)
+ : protocol_handler_(protocol_handler)
+ , session_observer_(session_observer)
+ , context_(context)
+ , full_version_(full_version)
+ , protocol_version_(protocol_version)
+ , payload_(payload) {}
+
+HandshakeHandler::~HandshakeHandler() {
+ LOG4CXX_DEBUG(logger_, "Destroying of HandshakeHandler: " << this);
+}
+
+uint32_t HandshakeHandler::connection_key() const {
+ return session_observer_.KeyFromPair(context_.connection_id_,
+ context_.new_session_id_);
+}
+
+bool HandshakeHandler::GetPolicyCertificateData(std::string& data) const {
+ return false;
+}
+
+void HandshakeHandler::OnCertificateUpdateRequired() {}
+
+bool HandshakeHandler::OnHandshakeFailed() {
+ if (payload_) {
+ ProcessFailedHandshake(*payload_);
+ } else {
+ BsonObject params;
+ bson_object_initialize_default(&params);
+ ProcessFailedHandshake(params);
+ bson_object_deinitialize(&params);
+ }
+
+ return true;
+}
+
+bool HandshakeHandler::OnHandshakeDone(
+ uint32_t connection_key,
+ security_manager::SSLContext::HandshakeResult result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (connection_key != this->connection_key()) {
+ LOG4CXX_DEBUG(logger_,
+ "Listener " << this
+ << " expects notification for connection id: "
+ << this->connection_key()
+ << ". Received notification for connection id "
+ << connection_key << " will be ignored");
+ return false;
+ }
+
+ const bool success =
+ result == security_manager::SSLContext::Handshake_Result_Success;
+
+ if (payload_) {
+ if (success) {
+ ProcessSuccessfulHandshake(connection_key, *payload_);
+ } else {
+ ProcessFailedHandshake(*payload_);
+ }
+ } else {
+ BsonObject params;
+ bson_object_initialize_default(&params);
+ if (success) {
+ ProcessSuccessfulHandshake(connection_key, params);
+ } else {
+ ProcessFailedHandshake(params);
+ }
+ bson_object_deinitialize(&params);
+ }
+
+ return true;
+}
+
+void HandshakeHandler::ProcessSuccessfulHandshake(const uint32_t connection_key,
+ BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::vector<int>& force_unprotected =
+ protocol_handler_.get_settings().force_unprotected_service();
+
+ const bool can_be_protected =
+ std::find(force_unprotected.begin(),
+ force_unprotected.end(),
+ context_.service_type_) == force_unprotected.end();
+
+ const bool is_service_already_protected =
+ session_observer_.GetSSLContext(connection_key, context_.service_type_) !=
+ NULL;
+
+ LOG4CXX_DEBUG(logger_,
+ "Service can be protected: " << can_be_protected
+ << " and service was protected: "
+ << is_service_already_protected);
+
+ if (can_be_protected && !is_service_already_protected) {
+ session_observer_.SetProtectionFlag(connection_key, context_.service_type_);
+ protocol_handler_.SendStartSessionAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.hash_id_,
+ context_.service_type_,
+ can_be_protected,
+ full_version_,
+ params);
+ } else {
+ protocol_handler_.SendStartSessionNAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.service_type_);
+ }
+}
+
+void HandshakeHandler::ProcessFailedHandshake(BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Handshake failed");
+ const std::vector<int>& force_protected =
+ protocol_handler_.get_settings().force_protected_service();
+
+ const bool can_be_unprotected =
+ std::find(force_protected.begin(),
+ force_protected.end(),
+ context_.service_type_) == force_protected.end();
+
+ LOG4CXX_DEBUG(logger_,
+ "Service can be unprotected: " << can_be_unprotected
+ << " and this is a new service: "
+ << context_.is_new_service_);
+
+ if (can_be_unprotected && context_.is_new_service_) {
+ protocol_handler_.SendStartSessionAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.hash_id_,
+ context_.service_type_,
+ PROTECTION_OFF,
+ full_version_,
+ params);
+ } else {
+ protocol_handler_.SendStartSessionNAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.service_type_);
+ }
+}
+
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc
index e1d08a6ada..4944ea9cc7 100644
--- a/src/components/protocol_handler/src/incoming_data_handler.cc
+++ b/src/components/protocol_handler/src/incoming_data_handler.cc
@@ -126,6 +126,7 @@ uint32_t IncomingDataHandler::GetPacketSize(
case PROTOCOL_VERSION_2:
case PROTOCOL_VERSION_3:
case PROTOCOL_VERSION_4:
+ case PROTOCOL_VERSION_5:
return header.dataSize + PROTOCOL_HEADER_V2_SIZE;
default:
LOG4CXX_WARN(logger_,
diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc
index 5a1fc6d205..c34e2ec640 100644
--- a/src/components/protocol_handler/src/multiframe_builder.cc
+++ b/src/components/protocol_handler/src/multiframe_builder.cc
@@ -35,7 +35,7 @@
#include <limits>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
#include "utils/date_time.h"
@@ -91,6 +91,8 @@ bool MultiFrameBuilder::RemoveConnection(const ConnectionID connection_id) {
ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Current state is: " << multiframes_map_);
+ LOG4CXX_DEBUG(logger_,
+ "Current multiframe map size is: " << multiframes_map_.size());
ProtocolFramePtrList outpute_frame_list;
for (MultiFrameMap::iterator connection_it = multiframes_map_.begin();
connection_it != multiframes_map_.end();
@@ -122,7 +124,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
if (consecutive_frame_wait_msecs_ != 0) {
LOG4CXX_TRACE(logger_, "Expiration verification");
const int64_t time_left =
- date_time::DateTime::calculateTimeSpan(frame_data.append_time);
+ date_time::calculateTimeSpan(frame_data.append_time);
LOG4CXX_DEBUG(logger_, "mSecs left: " << time_left);
if (time_left >= consecutive_frame_wait_msecs_) {
LOG4CXX_WARN(logger_, "Expired frame: " << frame);
@@ -198,7 +200,7 @@ RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) {
<< connection_id
<< ", session_id: " << static_cast<int>(session_id)
<< ", message_id: " << message_id);
- messageId_map[message_id] = {packet, date_time::DateTime::getCurrentTime()};
+ messageId_map[message_id] = {packet, date_time::getCurrentTime()};
return RESULT_OK;
}
@@ -277,7 +279,7 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame(
LOG4CXX_INFO(logger_,
"Assembled frame with payload size: "
<< assembling_frame->payload_size());
- frame_data.append_time = date_time::DateTime::getCurrentTime();
+ frame_data.append_time = date_time::getCurrentTime();
return RESULT_OK;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index aa2910722d..d03030b747 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -31,12 +31,16 @@
*/
#include "protocol_handler/protocol_handler_impl.h"
+#include <arpa/inet.h> // for INET6_ADDRSTRLEN
#include <memory.h>
#include <algorithm> // std::find
+#include <bson_object.h>
+#include <protocol/bson_object_keys.h>
#include "connection_handler/connection_handler_impl.h"
#include "protocol_handler/session_observer.h"
#include "utils/byte_order.h"
+#include "utils/helpers.h"
#include "protocol/common.h"
#ifdef ENABLE_SECURITY
@@ -55,7 +59,10 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
std::string ConvertPacketDataToString(const uint8_t* data,
const size_t data_size);
-const size_t kStackSize = 32768;
+const size_t kStackSize = 65536;
+
+utils::SemanticVersion defaultProtocolVersion(5, 1, 0);
+utils::SemanticVersion minMultipleTransportsVersion(5, 1, 0);
ProtocolHandlerImpl::ProtocolHandlerImpl(
const ProtocolHandlerSettings& settings,
@@ -77,6 +84,9 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
"PH FromMobile", this, threads::ThreadOptions(kStackSize))
, raw_ford_messages_to_mobile_(
"PH ToMobile", this, threads::ThreadOptions(kStackSize))
+ , start_session_frame_map_lock_()
+ , start_session_frame_map_()
+ , tcp_enabled_(false)
#ifdef TELEMETRY_MONITOR
, metric_observer_(NULL)
#endif // TELEMETRY_MONITOR
@@ -85,6 +95,14 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
LOG4CXX_AUTO_TRACE(logger_);
protocol_header_validator_.set_max_payload_size(
get_settings().maximum_payload_size());
+ protocol_header_validator_.set_max_control_payload_size(
+ get_settings().maximum_control_payload_size());
+ protocol_header_validator_.set_max_rpc_payload_size(
+ get_settings().maximum_rpc_payload_size());
+ protocol_header_validator_.set_max_audio_payload_size(
+ get_settings().maximum_audio_payload_size());
+ protocol_header_validator_.set_max_video_payload_size(
+ get_settings().maximum_video_payload_size());
incoming_data_handler_.set_validator(&protocol_header_validator_);
const size_t& message_frequency_count =
@@ -176,17 +194,84 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) {
void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
uint8_t session_id,
- uint8_t,
+ uint8_t input_protocol_version,
uint32_t hash_id,
uint8_t service_type,
bool protection) {
LOG4CXX_AUTO_TRACE(logger_);
+ utils::SemanticVersion fullVersion;
+ SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ service_type,
+ protection,
+ fullVersion);
+}
+
+void ProtocolHandlerImpl::SendStartSessionAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t input_protocol_version,
+ uint32_t hash_id,
+ uint8_t service_type,
+ bool protection,
+ utils::SemanticVersion& full_version) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ BsonObject empty_param;
+ bson_object_initialize_default(&empty_param);
+
+ SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ service_type,
+ protection,
+ full_version,
+ empty_param);
+
+ bson_object_deinitialize(&empty_param);
+}
+
+void ProtocolHandlerImpl::SendStartSessionAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t input_protocol_version,
+ uint32_t hash_id,
+ uint8_t service_type,
+ bool protection,
+ utils::SemanticVersion& full_version,
+ BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ bool send_transport_update_event = false;
+
+ uint8_t ack_protocol_version = SupportedSDLProtocolVersion();
- uint8_t protocolVersion = SupportedSDLProtocolVersion();
+ const bool proxy_supports_v5_protocol =
+ input_protocol_version >= PROTOCOL_VERSION_5 ||
+ (ServiceTypeFromByte(service_type) == kRpc &&
+ full_version.major_version_ >= PROTOCOL_VERSION_5);
+
+ if (kRpc != service_type) {
+ // In case if input protocol version os bigger then supported, SDL should
+ // respond with maximum supported protocol version
+ ack_protocol_version = input_protocol_version < ack_protocol_version
+ ? input_protocol_version
+ : ack_protocol_version;
+ }
+
+ // We can't send a V5+ packet if the proxy doesn't support it,
+ // so we manually set a maximum of V4 in that case
+ if (!proxy_supports_v5_protocol &&
+ ack_protocol_version >= PROTOCOL_VERSION_5) {
+ ack_protocol_version = PROTOCOL_VERSION_4;
+ }
ProtocolFramePtr ptr(
new protocol_handler::ProtocolPacket(connection_id,
- protocolVersion,
+ ack_protocol_version,
protection,
FRAME_TYPE_CONTROL,
service_type,
@@ -195,7 +280,143 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
- set_hash_id(hash_id, *ptr);
+ // Cannot include a constructed payload if either side doesn't support it
+ if (ack_protocol_version >= PROTOCOL_VERSION_5) {
+ ServiceType serviceTypeValue = ServiceTypeFromByte(service_type);
+
+ const bool mtu_written = bson_object_put_int64(
+ &params,
+ strings::mtu,
+ static_cast<int64_t>(
+ protocol_header_validator_.max_payload_size_by_service_type(
+ serviceTypeValue)));
+ UNUSED(mtu_written)
+ LOG4CXX_DEBUG(logger_,
+ "MTU parameter was written to bson params: "
+ << mtu_written << "; Value: "
+ << static_cast<int32_t>(
+ bson_object_get_int64(&params, strings::mtu)));
+
+ if (serviceTypeValue == kRpc) {
+ // Hash ID is only used in RPC case
+ const bool hash_written = bson_object_put_int32(
+ &params, strings::hash_id, static_cast<int32_t>(hash_id));
+ UNUSED(hash_written);
+ LOG4CXX_DEBUG(logger_,
+ "Hash parameter was written to bson params: "
+ << hash_written << "; Value: "
+ << static_cast<int32_t>(bson_object_get_int32(
+ &params, strings::hash_id)));
+
+ // Minimum protocol version supported by both
+ utils::SemanticVersion* minVersion =
+ (full_version.major_version_ < PROTOCOL_VERSION_5)
+ ? &defaultProtocolVersion
+ : utils::SemanticVersion::min(full_version,
+ defaultProtocolVersion);
+ char protocolVersionString[256];
+ strncpy(protocolVersionString, (*minVersion).toString().c_str(), 255);
+
+ const bool protocol_ver_written = bson_object_put_string(
+ &params, strings::protocol_version, protocolVersionString);
+ UNUSED(protocol_ver_written);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Protocol version parameter was written to bson params: "
+ << protocol_ver_written << "; Value: "
+ << bson_object_get_string(&params, strings::protocol_version));
+
+ LOG4CXX_INFO(logger_,
+ "Protocol Version String " << protocolVersionString);
+
+ std::vector<std::string> secondaryTransports;
+ std::vector<int32_t> audioServiceTransports;
+ std::vector<int32_t> videoServiceTransports;
+ if (*minVersion >= minMultipleTransportsVersion) {
+ if (ParseSecondaryTransportConfiguration(connection_id,
+ secondaryTransports,
+ audioServiceTransports,
+ videoServiceTransports)) {
+ LOG4CXX_DEBUG(logger_, "Multiple transports are enabled.");
+ BsonArray secondaryTransportsArr;
+ bson_array_initialize(&secondaryTransportsArr,
+ secondaryTransports.size());
+ for (unsigned int i = 0; i < secondaryTransports.size(); i++) {
+ char secondaryTransport[255];
+ strncpy(secondaryTransport,
+ secondaryTransports[i].c_str(),
+ sizeof(secondaryTransport));
+ secondaryTransport[sizeof(secondaryTransport) - 1] = '\0';
+ LOG4CXX_DEBUG(
+ logger_,
+ "Adding "
+ << secondaryTransport
+ << " to secondaryTransports parameter of StartSessionAck");
+ bson_array_add_string(&secondaryTransportsArr, secondaryTransport);
+ }
+ bson_object_put_array(
+ &params, strings::secondary_transports, &secondaryTransportsArr);
+
+ BsonArray audioServiceTransportsArr;
+ bson_array_initialize(&audioServiceTransportsArr,
+ audioServiceTransports.size());
+ for (unsigned int i = 0; i < audioServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << audioServiceTransports[i]
+ << " to audioServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&audioServiceTransportsArr,
+ audioServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::audio_service_transports,
+ &audioServiceTransportsArr);
+
+ BsonArray videoServiceTransportsArr;
+ bson_array_initialize(&videoServiceTransportsArr,
+ videoServiceTransports.size());
+ for (unsigned int i = 0; i < videoServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << videoServiceTransports[i]
+ << " to videoServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&videoServiceTransportsArr,
+ videoServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::video_service_transports,
+ &videoServiceTransportsArr);
+
+ if (settings_.multiple_transports_enabled()) {
+ send_transport_update_event = true;
+ } else {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Multiple transports feature is disabled by configuration");
+ // In this case, we must remember that this session will never have
+ // a secondary transport.
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to set up secondary transport and service type params");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Older protocol version. No multiple transports");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ }
+ uint8_t* payloadBytes = bson_object_to_bytes(&params);
+ ptr->set_data(payloadBytes, bson_object_size(&params));
+ free(payloadBytes);
+ } else {
+ set_hash_id(hash_id, *ptr);
+ }
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -206,12 +427,36 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
<< static_cast<int32_t>(service_type) << " session_id "
<< static_cast<int32_t>(session_id) << " protection "
<< (protection ? "ON" : "OFF"));
+
+ if (send_transport_update_event) {
+ // Wait until the StartService ACK has been processed for sending.
+ // The TransportUpdateEvent has a higher priority, being that it's
+ // a SERVICE_TYPE_CONTROL message. (The ACK is SERVICE_TYPE_RPC.)
+ LOG4CXX_DEBUG(logger_, "Waiting for the MessageToMobile queue to be empty");
+ raw_ford_messages_to_mobile_.WaitDumpQueue();
+ LOG4CXX_DEBUG(logger_, "Sending the TransportUpdate event");
+ SendTransportUpdateEvent(connection_id, session_id);
+ }
}
void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
uint8_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
+ std::vector<std::string> rejectedParams;
+ SendStartSessionNAck(connection_id,
+ session_id,
+ protocol_version,
+ service_type,
+ rejectedParams);
+}
+
+void ProtocolHandlerImpl::SendStartSessionNAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams) {
LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(
@@ -225,6 +470,27 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
+ uint8_t maxProtocolVersion = SupportedSDLProtocolVersion();
+
+ if (protocol_version >= PROTOCOL_VERSION_5 &&
+ maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) {
+ BsonObject payloadObj;
+ bson_object_initialize_default(&payloadObj);
+ BsonArray rejectedParamsArr;
+ bson_array_initialize(&rejectedParamsArr, rejectedParams.size());
+ for (std::string param : rejectedParams) {
+ char paramPtr[255];
+ strncpy(paramPtr, param.c_str(), 255);
+ bson_array_add_string(&rejectedParamsArr, paramPtr);
+ }
+ bson_object_put_array(
+ &payloadObj, strings::rejected_params, &rejectedParamsArr);
+ uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj);
+ ptr->set_data(payloadBytes, bson_object_size(&payloadObj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payloadObj);
+ }
+
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -239,6 +505,20 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
+ std::vector<std::string> rejectedParams;
+ SendEndSessionNAck(connection_id,
+ session_id,
+ protocol_version,
+ service_type,
+ rejectedParams);
+}
+
+void ProtocolHandlerImpl::SendEndSessionNAck(
+ ConnectionID connection_id,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams) {
LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(
@@ -252,6 +532,27 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
+ uint8_t maxProtocolVersion = SupportedSDLProtocolVersion();
+
+ if (protocol_version >= PROTOCOL_VERSION_5 &&
+ maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) {
+ BsonObject payloadObj;
+ bson_object_initialize_default(&payloadObj);
+ BsonArray rejectedParamsArr;
+ bson_array_initialize(&rejectedParamsArr, rejectedParams.size());
+ for (std::string param : rejectedParams) {
+ char paramPtr[255];
+ strncpy(paramPtr, param.c_str(), 255);
+ bson_array_add_string(&rejectedParamsArr, paramPtr);
+ }
+ bson_object_put_array(
+ &payloadObj, strings::rejected_params, &rejectedParamsArr);
+ uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj);
+ ptr->set_data(payloadBytes, bson_object_size(&payloadObj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payloadObj);
+ }
+
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -293,14 +594,18 @@ void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
<< static_cast<int32_t>(session_id));
}
-void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
LOG4CXX_AUTO_TRACE(logger_);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
- connection_id, session_id, protocol_version)) {
+ primary_connection_id, session_id, protocol_version)) {
+ LOG4CXX_TRACE(logger_,
+ "SendEndServicePrivate using protocol version "
+ << static_cast<int32_t>(protocol_version));
ProtocolFramePtr ptr(
new protocol_handler::ProtocolPacket(connection_id,
protocol_version,
@@ -315,25 +620,31 @@ void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
LOG4CXX_DEBUG(logger_,
- "SendEndSession() for connection "
- << connection_id << " for service_type " << service_type
+ "SendEndServicePrivate() for connection "
+ << connection_id << " for service_type "
+ << static_cast<int>(service_type)
+ << " primary connection " << primary_connection_id
<< " session_id " << static_cast<int32_t>(session_id));
} else {
LOG4CXX_WARN(
logger_,
- "SendEndSession is failed connection or session does not exist");
+ "SendEndServicePrivate is failed connection or session does not exist");
}
}
void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
uint8_t session_id) {
- SendEndServicePrivate(connection_id, session_id, SERVICE_TYPE_RPC);
+ // A session is always associated with a primary connection ID
+ SendEndServicePrivate(
+ connection_id, connection_id, session_id, SERVICE_TYPE_RPC);
}
-void ProtocolHandlerImpl::SendEndService(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
- SendEndServicePrivate(connection_id, session_id, service_type);
+ SendEndServicePrivate(
+ primary_connection_id, connection_id, session_id, service_type);
}
RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
@@ -365,6 +676,139 @@ RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
return RESULT_FAIL;
}
+void ProtocolHandlerImpl::SendTransportUpdateEvent(ConnectionID connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(
+ new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ session_id,
+ 0,
+ message_counters_[session_id]++));
+
+ BsonObject payload_obj;
+ bson_object_initialize_default(&payload_obj);
+
+ int32_t tcp_port = atoi(tcp_port_.c_str());
+ char tcp_ip_address[INET6_ADDRSTRLEN + 1];
+ if (tcp_enabled_ && (tcp_port != 0)) {
+ strncpy(tcp_ip_address, tcp_ip_address_.c_str(), INET6_ADDRSTRLEN);
+ tcp_ip_address[INET6_ADDRSTRLEN] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ bson_object_put_int32(&payload_obj, strings::tcp_port, tcp_port);
+ } else {
+ tcp_ip_address[0] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ // omit TCP port number
+ }
+ LOG4CXX_INFO(logger_,
+ "SendTransportUpdateEvent IP address: "
+ << tcp_ip_address << " Port: " << tcp_port);
+
+ uint8_t* payloadBytes = bson_object_to_bytes(&payload_obj);
+ ptr->set_data(payloadBytes, bson_object_size(&payload_obj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payload_obj);
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_DEBUG(logger_,
+ "SendTransportUpdateEvent() for connection "
+ << connection_id << " for session "
+ << static_cast<int32_t>(session_id));
+ } else {
+ LOG4CXX_WARN(logger_,
+ "SendTransportUpdateEvent is failed connection or session "
+ "does not exist");
+ }
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // acquire the protocol version from primary transport
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ session_id,
+ 0u,
+ 2));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+ }
+ LOG4CXX_WARN(logger_,
+ "RegisterSecondaryTransportAck is failed connection or session "
+ "does not exist");
+ return RESULT_FAIL;
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // If mobile sends an invalid session ID and we cannot find out the Connection
+ // ID of primary transport, then we use version 5. (The multiple-transports
+ // feature is added in 5.1.0.)
+ uint8_t protocol_version = PROTOCOL_VERSION_5;
+ if (primary_transport_connection_id > 0) {
+ // acquire the protocol version from primary transport
+ if (!session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ LOG4CXX_WARN(logger_,
+ "Failed to acquire protocol version for "
+ "RegisterSecondaryTransportNAck");
+ return RESULT_FAIL;
+ }
+ }
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ session_id,
+ 0u,
+ 2));
+
+ if (reason) {
+ uint8_t* payloadBytes = bson_object_to_bytes(reason);
+ ptr->set_data(payloadBytes, bson_object_size(reason));
+ free(payloadBytes);
+ }
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+}
+
void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
uint8_t session_id) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -394,7 +838,7 @@ void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
bool final_message) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
@@ -413,7 +857,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
metric_observer_->StartMessageProcess(message_id, start_time);
}
#endif // TELEMETRY_MONITOR
- const size_t max_frame_size = get_settings().maximum_payload_size();
+ size_t max_frame_size = get_settings().maximum_payload_size();
size_t frame_size = MAXIMUM_FRAME_DATA_V2_SIZE;
switch (message->protocol_version()) {
case PROTOCOL_VERSION_3:
@@ -422,6 +866,13 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
? max_frame_size
: MAXIMUM_FRAME_DATA_V2_SIZE;
break;
+ case PROTOCOL_VERSION_5:
+ max_frame_size =
+ protocol_header_validator_.max_payload_size_by_service_type(
+ ServiceTypeFromByte(message->service_type()));
+ frame_size = max_frame_size > MAXIMUM_FRAME_DATA_V2_SIZE
+ ? max_frame_size
+ : MAXIMUM_FRAME_DATA_V2_SIZE;
default:
break;
}
@@ -477,8 +928,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = message_id;
metric->connection_key = message->connection_key();
metric->raw_msg = message;
@@ -533,7 +983,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
it != protocol_frames.end();
++it) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
ProtocolFramePtr frame = *it;
#ifdef ENABLE_SECURITY
@@ -652,6 +1102,85 @@ void ProtocolHandlerImpl::OnConnectionClosed(
multiframe_builder_.RemoveConnection(connection_id);
}
+void ProtocolHandlerImpl::OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) {
+ OnConnectionClosed(connection_id);
+}
+
+void ProtocolHandlerImpl::NotifyOnFailedHandshake() {
+ LOG4CXX_AUTO_TRACE(logger_);
+#ifdef ENABLE_SECURITY
+ security_manager_->NotifyListenersOnHandshakeFailed();
+#endif // ENABLE_SECURITY
+}
+
+void ProtocolHandlerImpl::OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::transport_adapter::TransportConfig::const_iterator it =
+ configs.find(transport_manager::transport_adapter::tc_enabled);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No enabled field in OnTransportConfigUpdated");
+ return;
+ }
+
+ bool tcp_enabled = (0 == strcmp("true", it->second.c_str()));
+ std::string tcp_port;
+
+ if (tcp_enabled) {
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_port);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No port field in OnTransportConfigUpdated");
+ return;
+ }
+ tcp_port = it->second;
+
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_ip_address);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No IP address field in OnTransportConfigUpdated");
+ return;
+ }
+ tcp_enabled_ = true;
+ tcp_port_ = tcp_port;
+ tcp_ip_address_ = it->second;
+ } else {
+ tcp_enabled_ = false;
+ tcp_port_.clear();
+ tcp_ip_address_.clear();
+ }
+
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated: new config enabled is "
+ << tcp_enabled_ << ". Port is " << tcp_port_
+ << ". IP Address is " << tcp_ip_address_);
+
+ // Walk the SessionConnection map and find all sessions that need a
+ // TransportUpdate Event. Sessions flagged with kDisabledSecondary in their
+ // secondary transport are ineligible for secondary transport, and
+ // therefore don't get this event.
+ DataAccessor<connection_handler::SessionConnectionMap>
+ session_connection_map_accessor =
+ connection_handler_.session_connection_map();
+ const connection_handler::SessionConnectionMap& session_connection_map =
+ session_connection_map_accessor.GetData();
+ connection_handler::SessionConnectionMap::const_iterator itr =
+ session_connection_map.begin();
+ while (itr != session_connection_map.end()) {
+ const connection_handler::SessionTransports st = itr->second;
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated found session "
+ << itr->first << " with primary connection "
+ << st.primary_transport << " and secondary connection "
+ << st.secondary_transport);
+ if (st.secondary_transport != kDisabledSecondary) {
+ SendTransportUpdateEvent(st.primary_transport, itr->first);
+ }
+ itr++;
+ }
+}
+
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
if (!packet) {
@@ -836,6 +1365,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
<< packet->data_size() << "; message "
<< ConvertPacketDataToString(packet->data(), packet->data_size()));
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
const uint32_t connection_key = session_observer_.KeyFromPair(
packet->connection_id(), packet->session_id());
@@ -850,8 +1386,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = packet->message_id();
metric->connection_key = connection_key;
metric->raw_msg = rawMessage;
@@ -868,6 +1403,14 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
+
if (multiframe_builder_.AddFrame(packet) != RESULT_OK) {
LOG4CXX_WARN(logger_, "Frame assembling issue");
}
@@ -883,7 +1426,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
switch (packet->frame_data()) {
case FRAME_DATA_START_SERVICE: {
LOG4CXX_TRACE(logger_, "FrameData: StartService");
- return HandleControlMessageStartSession(*packet);
+ return HandleControlMessageStartSession(packet);
}
case FRAME_DATA_END_SERVICE: {
LOG4CXX_TRACE(logger_, "FrameData: StopService");
@@ -905,6 +1448,10 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
<< packet->connection_id());
return RESULT_OK;
}
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT: {
+ LOG4CXX_TRACE(logger_, "FrameData: RegisterSecondaryTransport");
+ return HandleControlMessageRegisterSecondaryTransport(packet);
+ }
default:
LOG4CXX_WARN(logger_,
"Control message of type "
@@ -924,10 +1471,19 @@ uint32_t get_hash_id(const ProtocolPacket& packet) {
LOG4CXX_WARN(logger_, "Packet without hash data (data size less 4)");
return HASH_ID_WRONG;
}
- const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
- const uint32_t hash_le = BE_TO_LE32(hash_be);
- // null hash is wrong hash value
- return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le;
+ if (packet.protocol_version() >= PROTOCOL_VERSION_5) {
+ BsonObject obj = bson_object_from_bytes(packet.data());
+ const uint32_t hash_id =
+ (uint32_t)bson_object_get_int32(&obj, strings::hash_id);
+ bson_object_deinitialize(&obj);
+ return hash_id;
+ } else {
+ const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
+ const uint32_t hash_le = BE_TO_LE32(hash_be);
+
+ // null hash is wrong hash value
+ return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le;
+ }
}
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
@@ -935,12 +1491,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
- const uint32_t hash_id = get_hash_id(packet);
+ uint32_t hash_id = get_hash_id(packet);
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_key = session_observer_.OnSessionEndedCallback(
- connection_id, current_session_id, hash_id, service_type);
+ connection_id, current_session_id, &hash_id, service_type);
// TODO(EZamakhov): add clean up output queue (for removed service)
if (session_key != 0) {
@@ -953,10 +1509,22 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
LOG4CXX_WARN(logger_,
"Refused to end session " << static_cast<int>(service_type)
<< " type.");
- SendEndSessionNAck(connection_id,
- current_session_id,
- packet.protocol_version(),
- service_type);
+ if (packet.protocol_version() >= PROTOCOL_VERSION_5) {
+ std::vector<std::string> rejectedParams;
+ if (hash_id == protocol_handler::HASH_ID_WRONG) {
+ rejectedParams.push_back(std::string(strings::hash_id));
+ }
+ SendEndSessionNAck(connection_id,
+ current_session_id,
+ packet.protocol_version(),
+ service_type,
+ rejectedParams);
+ } else {
+ SendEndSessionNAck(connection_id,
+ current_session_id,
+ packet.protocol_version(),
+ service_type);
+ }
}
return RESULT_OK;
}
@@ -966,12 +1534,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
- const uint32_t hash_id = get_hash_id(packet);
+ uint32_t hash_id = get_hash_id(packet);
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_key = session_observer_.OnSessionEndedCallback(
- connection_id, current_session_id, hash_id, service_type);
+ connection_id, current_session_id, &hash_id, service_type);
if (0 == session_key) {
LOG4CXX_WARN(logger_, "Refused to end service");
@@ -981,130 +1549,227 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
return RESULT_OK;
}
-#ifdef ENABLE_SECURITY
-namespace {
-/**
- * \brief SecurityManagerListener for send Ack/NAck on success or fail
- * SSL handshake
- */
-class StartSessionHandler : public security_manager::SecurityManagerListener {
- public:
- StartSessionHandler(uint32_t connection_key,
- ProtocolHandlerImpl* protocol_handler,
- SessionObserver& session_observer,
- ConnectionID connection_id,
- int32_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service)
- : connection_key_(connection_key)
- , protocol_handler_(protocol_handler)
- , session_observer_(session_observer)
- , connection_id_(connection_id)
- , session_id_(session_id)
- , protocol_version_(protocol_version)
- , hash_id_(hash_id)
- , service_type_(service_type)
- , force_protected_service_(force_protected_service) {}
-
- bool OnHandshakeDone(
- const uint32_t connection_key,
- security_manager::SSLContext::HandshakeResult result) OVERRIDE {
- if (connection_key != connection_key_) {
- return false;
- }
- const bool success =
- result == security_manager::SSLContext::Handshake_Result_Success;
- // check current service protection
- const bool was_service_protection_enabled =
- session_observer_.GetSSLContext(connection_key_, service_type_) != NULL;
- if (was_service_protection_enabled) {
- if (!success) {
- protocol_handler_->SendStartSessionNAck(
- connection_id_, session_id_, protocol_version_, service_type_);
- } else {
- // Could not be success handshake and not already protected service
- NOTREACHED();
- }
- } else {
- if (success) {
- session_observer_.SetProtectionFlag(connection_key_, service_type_);
- }
- protocol_handler_->SendStartSessionAck(connection_id_,
- session_id_,
- protocol_version_,
- hash_id_,
- service_type_,
- success);
- }
- delete this;
- return true;
- }
-
- void OnCertificateUpdateRequired() OVERRIDE {}
-
- virtual const std::vector<int>& force_protected_service() const {
- return force_protected_service_;
- }
-
- private:
- const uint32_t connection_key_;
- ProtocolHandlerImpl* protocol_handler_;
- SessionObserver& session_observer_;
-
- const ConnectionID connection_id_;
- const int32_t session_id_;
- const uint8_t protocol_version_;
- const uint32_t hash_id_;
- const ServiceType service_type_;
- const std::vector<int> force_protected_service_;
-};
-} // namespace
-#endif // ENABLE_SECURITY
-
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
- const ProtocolPacket& packet) {
+ const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(
logger_,
- "Protocol version:" << static_cast<int>(packet.protocol_version()));
- const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
- const uint8_t protocol_version = packet.protocol_version();
+ "Protocol version:" << static_cast<int>(packet->protocol_version()));
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
+ const uint8_t protocol_version = packet->protocol_version();
#ifdef ENABLE_SECURITY
const bool protection =
- // Protocolo version 1 is not support protection
- (protocol_version > PROTOCOL_VERSION_1) ? packet.protection_flag()
+ // Protocol version 1 does not support protection
+ (protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag()
: false;
#else
const bool protection = false;
#endif // ENABLE_SECURITY
- uint32_t hash_id;
- const ConnectionID connection_id = packet.connection_id();
- const uint32_t session_id = session_observer_.OnSessionStartedCallback(
- connection_id, packet.session_id(), service_type, protection, &hash_id);
+ const ConnectionID connection_id = packet->connection_id();
+ const uint8_t session_id = packet->session_id();
+ const std::string& transport =
+ session_observer_.TransportTypeProfileStringFromConnHandle(connection_id);
+
+ const auto video_transports = settings_.video_service_transports();
+ const bool is_video_allowed =
+ video_transports.empty() ||
+ std::find(video_transports.begin(), video_transports.end(), transport) !=
+ video_transports.end();
+
+ const auto audio_transports = settings_.audio_service_transports();
+ const bool is_audio_allowed =
+ audio_transports.empty() ||
+ std::find(audio_transports.begin(), audio_transports.end(), transport) !=
+ audio_transports.end();
+
+ if ((ServiceType::kMobileNav == service_type && !is_video_allowed) ||
+ (ServiceType::kAudio == service_type && !is_audio_allowed)) {
+ LOG4CXX_DEBUG(logger_,
+ "Rejecting StartService for service:"
+ << service_type << ", over transport: " << transport
+ << ", disallowed by settings.");
+ SendStartSessionNAck(
+ connection_id, session_id, protocol_version, service_type);
+ return RESULT_OK;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "StartSession ID " << static_cast<int>(session_id)
+ << " and Connection ID "
+ << static_cast<int>(connection_id));
- if (0 == session_id) {
+ {
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ start_session_frame_map_[std::make_pair(connection_id, session_id)] =
+ packet;
+ }
+
+ BsonObject bson_obj;
+ if (packet->data() != NULL) {
+ bson_obj = bson_object_from_bytes(packet->data());
+ } else {
+ bson_object_initialize_default(&bson_obj);
+ }
+
+ session_observer_.OnSessionStartedCallback(
+ connection_id, packet->session_id(), service_type, protection, &bson_obj);
+ bson_object_deinitialize(&bson_obj);
+
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint8_t session_id = packet->session_id();
+ const ConnectionID connection_id = packet->connection_id();
+ ConnectionID primary_connection_id = 0;
+
+ LOG4CXX_INFO(logger_,
+ "RegisterSecondaryTransport ID "
+ << static_cast<int>(session_id) << " and Connection ID "
+ << static_cast<int>(connection_id));
+
+ if (connection_handler_.OnSecondaryTransportStarted(
+ primary_connection_id, connection_id, session_id)) {
+ SendRegisterSecondaryTransportAck(
+ connection_id, primary_connection_id, session_id);
+ } else {
+ char reason[256];
+ BsonObject registerSecondaryTransportNackObj;
+ bson_object_initialize_default(&registerSecondaryTransportNackObj);
+ if (0 == session_id) {
+ strncpy(reason,
+ "RegisterSecondaryTransport MUST include a non-zero session ID",
+ 255);
+ } else if (primary_connection_id == 0) {
+ strncpy(reason, "RegisterSecondaryTransport session ID not found", 255);
+ } else {
+ strncpy(
+ reason,
+ "RegisterSecondaryTransport session ID has already been registered",
+ 255);
+ }
+ bson_object_put_string(
+ &registerSecondaryTransportNackObj, strings::reason, reason);
+ SendRegisterSecondaryTransportNAck(connection_id,
+ primary_connection_id,
+ session_id,
+ &registerSecondaryTransportNackObj);
+ bson_object_deinitialize(&registerSecondaryTransportNackObj);
+ }
+
+ return RESULT_OK;
+}
+
+void ProtocolHandlerImpl::NotifySessionStarted(
+ const SessionContext& context, std::vector<std::string>& rejected_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ProtocolFramePtr packet;
+ {
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ StartSessionFrameMap::iterator it = start_session_frame_map_.find(
+ std::make_pair(context.connection_id_, context.initial_session_id_));
+ if (it == start_session_frame_map_.end()) {
+ LOG4CXX_ERROR(logger_, "Cannot find Session Started packet");
+ return;
+ }
+ packet = it->second;
+ start_session_frame_map_.erase(it);
+ }
+
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
+ const uint8_t protocol_version = packet->protocol_version();
+
+ if (0 == context.new_session_id_) {
LOG4CXX_WARN(logger_,
"Refused by session_observer to create service "
<< static_cast<int32_t>(service_type) << " type.");
- SendStartSessionNAck(connection_id,
- packet.session_id(),
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
protocol_version,
- packet.service_type());
- return RESULT_OK;
+ packet->service_type(),
+ rejected_params);
+ return;
+ }
+
+ std::shared_ptr<BsonObject> start_session_ack_params(
+ new BsonObject(), [](BsonObject* obj) { bson_object_deinitialize(obj); });
+ bson_object_initialize_default(start_session_ack_params.get());
+ // when video service is successfully started, copy input parameters
+ // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet
+ if (packet->service_type() == kMobileNav && packet->data() != NULL) {
+ BsonObject req_param = bson_object_from_bytes(packet->data());
+ BsonElement* element = NULL;
+
+ if ((element = bson_object_get(&req_param, strings::height)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(start_session_ack_params.get(),
+ strings::height,
+ bson_object_get_int32(&req_param, strings::height));
+ }
+ if ((element = bson_object_get(&req_param, strings::width)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(start_session_ack_params.get(),
+ strings::width,
+ bson_object_get_int32(&req_param, strings::width));
+ }
+ char* protocol =
+ bson_object_get_string(&req_param, strings::video_protocol);
+ if (protocol != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_protocol, protocol);
+ }
+ char* codec = bson_object_get_string(&req_param, strings::video_codec);
+ if (codec != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_codec, codec);
+ }
+ bson_object_deinitialize(&req_param);
+ }
+
+ std::shared_ptr<utils::SemanticVersion> fullVersion;
+
+ // Can't check protocol_version because the first packet is v1, but there
+ // could still be a payload, in which case we can get the real protocol
+ // version
+ if (packet->service_type() == kRpc && packet->data() != NULL) {
+ BsonObject request_params = bson_object_from_bytes(packet->data());
+ char* version_param =
+ bson_object_get_string(&request_params, strings::protocol_version);
+ std::string version_string(version_param == NULL ? "" : version_param);
+ fullVersion = std::make_shared<utils::SemanticVersion>(version_string);
+ // Constructed payloads added in Protocol v5
+ if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
+ rejected_params.push_back(std::string(strings::protocol_version));
+ }
+ bson_object_deinitialize(&request_params);
+ } else {
+ fullVersion = std::make_shared<utils::SemanticVersion>();
}
#ifdef ENABLE_SECURITY
// for packet is encrypted and security plugin is enable
- if (protection && security_manager_) {
- const uint32_t connection_key =
- session_observer_.KeyFromPair(connection_id, session_id);
+ if (context.is_protected_ && security_manager_) {
+ const uint32_t connection_key = session_observer_.KeyFromPair(
+ context.connection_id_, context.new_session_id_);
+
+ std::shared_ptr<HandshakeHandler> handler =
+ std::make_shared<HandshakeHandler>(*this,
+ session_observer_,
+ *fullVersion,
+ context,
+ packet->protocol_version(),
+ start_session_ack_params);
security_manager::SSLContext* ssl_context =
- security_manager_->CreateSSLContext(connection_key);
+ security_manager_->CreateSSLContext(
+ connection_key,
+ security_manager::SecurityManager::ContextCreationStrategy::
+ kUseExisting);
if (!ssl_context) {
const std::string error("CreateSSLContext failed");
LOG4CXX_ERROR(logger_, error);
@@ -1112,55 +1777,75 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
connection_key,
security_manager::SecurityManager::ERROR_INTERNAL,
error);
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
- return RESULT_OK;
+
+ handler->OnHandshakeDone(
+ connection_key, security_manager::SSLContext::Handshake_Result_Fail);
+
+ return;
}
- if (ssl_context->IsInitCompleted()) {
+
+ if (!rejected_params.empty()) {
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ } else if (ssl_context->IsInitCompleted()) {
// mark service as protected
session_observer_.SetProtectionFlag(connection_key, service_type);
// Start service as protected with current SSLContext
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_ON);
+ SendStartSessionAck(context.connection_id_,
+ context.new_session_id_,
+ packet->protocol_version(),
+ context.hash_id_,
+ packet->service_type(),
+ PROTECTION_ON,
+ *fullVersion,
+ *start_session_ack_params);
} else {
- security_manager_->AddListener(
- new StartSessionHandler(connection_key,
- this,
- session_observer_,
- connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- service_type,
- get_settings().force_protected_service()));
+ LOG4CXX_DEBUG(logger_,
+ "Adding Handshake handler to listeners: " << handler.get());
+ security_manager::SecurityManagerListener* listener =
+ new HandshakeHandler(*handler);
+ security_manager_->AddListener(listener);
+
if (!ssl_context->IsHandshakePending()) {
// Start handshake process
security_manager_->StartHandshake(connection_key);
+
+ if (!security_manager_->IsSystemTimeProviderReady()) {
+ security_manager_->RemoveListener(listener);
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ }
}
}
+
LOG4CXX_DEBUG(logger_,
"Protection establishing for connection "
<< connection_key << " is in progress");
- return RESULT_OK;
+ return;
}
#endif // ENABLE_SECURITY
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
- return RESULT_OK;
+ if (rejected_params.empty()) {
+ SendStartSessionAck(context.connection_id_,
+ context.new_session_id_,
+ packet->protocol_version(),
+ context.hash_id_,
+ packet->service_type(),
+ PROTECTION_OFF,
+ *fullVersion,
+ *start_session_ack_params);
+ } else {
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ }
}
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
@@ -1173,8 +1858,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
if (session_observer_.ProtocolVersionUsed(
connection_id, packet.session_id(), protocol_version)) {
// TODO(EZamakhov): investigate message_id for HeartBeatAck
- if (PROTOCOL_VERSION_3 == protocol_version ||
- PROTOCOL_VERSION_4 == protocol_version) {
+ if (protocol_version >= PROTOCOL_VERSION_3 &&
+ protocol_version <= PROTOCOL_VERSION_5) {
return SendHeartBeatAck(
connection_id, packet.session_id(), packet.message_id());
} else {
@@ -1191,6 +1876,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
}
void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
+ LOG4CXX_AUTO_TRACE(logger_);
const ProtocolFramePtrList& frame_list = multiframe_builder_.PopMultiframes();
for (ProtocolFramePtrList::const_iterator it = frame_list.begin();
it != frame_list.end();
@@ -1216,8 +1902,7 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->raw_msg = rawMessage;
metric_observer_->EndMessageProcess(metric);
}
@@ -1329,6 +2014,9 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
void ProtocolHandlerImpl::Stop() {
raw_ford_messages_from_mobile_.Shutdown();
raw_ford_messages_to_mobile_.Shutdown();
+
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ start_session_frame_map_.clear();
}
#ifdef ENABLE_SECURITY
@@ -1345,7 +2033,9 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
DCHECK(packet);
// Control frames and data over control service shall be unprotected
if (packet->service_type() == kControl ||
- packet->frame_type() == FRAME_TYPE_CONTROL) {
+ // For protocol v5 control frames could be protected
+ (packet->frame_type() == FRAME_TYPE_CONTROL &&
+ packet->protocol_version() < PROTOCOL_VERSION_5)) {
return RESULT_OK;
}
if (!security_manager_) {
@@ -1369,11 +2059,11 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_ENCRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_OK;
}
LOG4CXX_DEBUG(logger_,
@@ -1388,12 +2078,30 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
DCHECK(packet);
- if (!packet->protection_flag() ||
- // Control frames and data over control service shall be unprotected
- packet->service_type() == kControl ||
- packet->frame_type() == FRAME_TYPE_CONTROL) {
+
+ bool shoud_not_decrypt;
+ if (packet->protocol_version() >= PROTOCOL_VERSION_5) {
+ // For v5 protocol control frames except StartService could be encrypted
+ shoud_not_decrypt =
+ !packet->protection_flag() || packet->service_type() == kControl ||
+ (FRAME_TYPE_CONTROL == packet->frame_type() &&
+ helpers::Compare<ServiceType, helpers::EQ, helpers::ONE>(
+ static_cast<ServiceType>(packet->service_type()),
+ kMobileNav,
+ kAudio,
+ kRpc));
+ } else {
+ // Control frames and data over control service shall be unprotected
+ shoud_not_decrypt = !packet->protection_flag() ||
+ packet->service_type() == kControl ||
+ packet->frame_type() == FRAME_TYPE_CONTROL;
+ }
+
+ if (shoud_not_decrypt) {
+ LOG4CXX_DEBUG(logger_, "Frame will not be decrypted");
return RESULT_OK;
}
+
if (!security_manager_) {
LOG4CXX_WARN(logger_, "No security_manager_ set.");
return RESULT_FAIL;
@@ -1422,11 +2130,11 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_DECRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_ENCRYPTION_FAILED;
}
LOG4CXX_DEBUG(logger_,
@@ -1434,6 +2142,11 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
<< out_data_size << " bytes");
DCHECK(out_data);
DCHECK(out_data_size);
+ // Special handling for decrypted FIRST_FRAME
+ if (packet->frame_type() == FRAME_TYPE_FIRST && packet->protection_flag()) {
+ packet->HandleRawFirstFrameData(out_data);
+ return RESULT_OK;
+ }
packet->set_data(out_data, out_data_size);
return RESULT_OK;
}
@@ -1444,33 +2157,34 @@ void ProtocolHandlerImpl::SendFramesNumber(uint32_t connection_key,
LOG4CXX_DEBUG(
logger_, "SendFramesNumber MobileNaviAck for session " << connection_key);
- // TODO(EZamakhov): add protocol version check - to avoid send for
- // PROTOCOL_VERSION_1
transport_manager::ConnectionUID connection_id = 0;
uint8_t session_id = 0;
session_observer_.PairFromKey(connection_key, &connection_id, &session_id);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
connection_id, session_id, protocol_version)) {
- ProtocolFramePtr ptr(
- new protocol_handler::ProtocolPacket(connection_id,
- protocol_version,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- SERVICE_TYPE_NAVI,
- FRAME_DATA_SERVICE_DATA_ACK,
- session_id,
- 0,
- message_counters_[session_id]++));
-
- // Flow control data shall be 4 bytes according Ford Protocol
- DCHECK(sizeof(number_of_frames) == 4);
- number_of_frames = LE_TO_BE32(number_of_frames);
- ptr->set_data(reinterpret_cast<const uint8_t*>(&number_of_frames),
- sizeof(number_of_frames));
- raw_ford_messages_to_mobile_.PostMessage(
- impl::RawFordMessageToMobile(ptr, false));
- LOG4CXX_DEBUG(logger_, "SendFramesNumber finished successfully");
+ if (protocol_version > PROTOCOL_VERSION_1 &&
+ protocol_version < PROTOCOL_VERSION_5) {
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_NAVI,
+ FRAME_DATA_SERVICE_DATA_ACK,
+ session_id,
+ 0,
+ message_counters_[session_id]++));
+
+ // Flow control data shall be 4 bytes according Ford Protocol
+ DCHECK(sizeof(number_of_frames) == 4);
+ number_of_frames = LE_TO_BE32(number_of_frames);
+ ptr->set_data(reinterpret_cast<const uint8_t*>(&number_of_frames),
+ sizeof(number_of_frames));
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ LOG4CXX_DEBUG(logger_, "SendFramesNumber finished successfully");
+ }
} else {
LOG4CXX_WARN(
logger_,
@@ -1504,17 +2218,243 @@ std::string ConvertPacketDataToString(const uint8_t* data,
uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
+ return get_settings().max_supported_protocol_version();
+}
+
+const impl::TransportTypes transportTypes = {
+ std::make_pair(
+ std::string("AOA_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, false, true)),
+ std::make_pair(std::string("SPP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, false, true)),
+ std::make_pair(std::string("IAP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, true, false)),
+ std::make_pair(
+ std::string("IAP_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("TCP_WIFI"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, true)),
+ std::make_pair(
+ std::string("IAP_USB_HOST_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_USB_DEVICE_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_CARPLAY"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, false))};
+
+const impl::TransportDescription
+ProtocolHandlerImpl::GetTransportTypeFromConnectionType(
+ const std::string& connection_type) const {
+ impl::TransportDescription result =
+ impl::TransportDescription(impl::TransportType::TT_NONE, false, false);
+ impl::TransportTypes::const_iterator it =
+ transportTypes.find(connection_type);
+ if (it != transportTypes.end()) {
+ result = it->second;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unknown connection type " << connection_type);
+ }
+
+ return result;
+}
+
+const bool ProtocolHandlerImpl::ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> secondary_transport_types;
+
+ // First discover what the connection type of the primary transport is
+ // and look up the allowed secondary transports for that primary transport
+ const std::string connection_type =
+ session_observer_.TransportTypeProfileStringFromConnHandle(connection_id);
+ const impl::TransportDescription td =
+ GetTransportTypeFromConnectionType(connection_type);
+ if (settings_.multiple_transports_enabled()) {
+ if (td.transport_type_ == impl::TransportType::TT_USB) {
+ secondary_transport_types = settings_.secondary_transports_for_usb();
+ } else if (td.transport_type_ == impl::TransportType::TT_BLUETOOTH) {
+ secondary_transport_types =
+ settings_.secondary_transports_for_bluetooth();
+ } else if (td.transport_type_ == impl::TransportType::TT_WIFI) {
+ secondary_transport_types = settings_.secondary_transports_for_wifi();
+ } else {
+ LOG4CXX_ERROR(
+ logger_,
+ "Bad or unknown device type in ParseSecondaryTransportConfiguration");
+ return false;
+ }
+ }
+ // note: even if settings_.multiple_transports_enabled() is false, we still
+ // send out an empty "secondaryTransports" parameter, along with
+ // "videoServiceTransports" and "audioServiceTransports" params which are
+ // useful without secondary transport.
+
+ // Then, generate the "secondaryTransports" array for the StartSession ACK
+ GenerateSecondaryTransportsForStartSessionAck(secondary_transport_types,
+ td.ios_transport_,
+ td.android_transport_,
+ secondaryTransports);
+
+ // Next, figure out which connections audio or video services are allowed on
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.audio_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ audioServiceTransports);
+
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.video_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ videoServiceTransports);
+
+ return true;
+}
- bool heart_beat_support = (0 != get_settings().heart_beat_timeout());
+void ProtocolHandlerImpl::GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
- bool sdl4_support = get_settings().enable_protocol_4();
+ // Parse the "secondary_transport_types" vector (which comes from
+ // smartDeviceLink.ini). For each entry in the vector, add an
+ // appropriate string to the secondaryTransports
+ std::vector<std::string>::const_iterator it =
+ secondary_transport_types.begin();
+ while (it != secondary_transport_types.end()) {
+ const utils::custom_string::CustomString transport_type(*it);
+ if (transport_type.CompareIgnoreCase("USB")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_USB");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding AOA_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("AOA_USB");
+ }
+ } else if (transport_type.CompareIgnoreCase("Bluetooth")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_BLUETOOTH");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding SPP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("SPP_BLUETOOTH");
+ }
+ }
+ if (transport_type.CompareIgnoreCase("WiFi")) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding TCP_WIFI to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("TCP_WIFI");
+ }
- if (sdl4_support) {
- return PROTOCOL_VERSION_4;
+ it++;
}
- if (heart_beat_support) {
- return PROTOCOL_VERSION_3;
+}
+
+void ProtocolHandlerImpl::GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (service_transports.size() == 0) {
+ if (secondary_enabled && !secondary_transport_types.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Empty Service Transports. Allowing service to run on both "
+ "connections");
+ serviceTransports.push_back(1);
+ serviceTransports.push_back(2);
+ } else {
+ serviceTransports.push_back(1);
+ }
+ } else {
+ bool fPrimaryAdded = false;
+ bool fSecondaryAdded = false;
+ std::vector<std::string>::const_iterator it = service_transports.begin();
+ for (; it != service_transports.end(); it++) {
+ const utils::custom_string::CustomString transport(*it);
+ LOG4CXX_TRACE(logger_,
+ "Service Allowed to run on " << transport.c_str()
+ << " transport");
+
+ if (!fPrimaryAdded &&
+ (transport.CompareIgnoreCase(primary_connection_type.c_str()) ||
+ (transport.CompareIgnoreCase("IAP_USB") &&
+ primary_transport_type == impl::TransportType::TT_USB))) {
+ LOG4CXX_TRACE(logger_, "Service allowed on primary transport");
+ serviceTransports.push_back(1);
+ fPrimaryAdded = true;
+ }
+
+ if (!fSecondaryAdded) {
+ const utils::custom_string::CustomString transport_type(
+ TransportTypeFromTransport(transport));
+ std::vector<std::string>::const_iterator found =
+ std::find_if(secondary_transport_types.begin(),
+ secondary_transport_types.end(),
+ [&](const std::string& secondary_transport_type) {
+ return transport_type.CompareIgnoreCase(
+ secondary_transport_type.c_str());
+ });
+ if (found != secondary_transport_types.end()) {
+ LOG4CXX_TRACE(logger_, "Service allowed on secondary transport");
+ serviceTransports.push_back(2);
+ fSecondaryAdded = true;
+ }
+ }
+
+ if (fPrimaryAdded && fSecondaryAdded) {
+ break;
+ }
+ }
+ }
+}
+
+const std::string ProtocolHandlerImpl::TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const {
+ std::string transport_type;
+
+ if (transport.CompareIgnoreCase("IAP_BLUETOOTH") ||
+ transport.CompareIgnoreCase("SPP_BLUETOOTH")) {
+ transport_type = "Bluetooth";
+ } else if (transport.CompareIgnoreCase("IAP_USB") ||
+ transport.CompareIgnoreCase("AOA_USB") ||
+ transport.CompareIgnoreCase("IAP_USB_HOST_MODE") ||
+ transport.CompareIgnoreCase("IAP_USB_DEVICE_MODE")) {
+ transport_type = "USB";
+ } else if (transport.CompareIgnoreCase("TCP_WIFI") ||
+ transport.CompareIgnoreCase("IAP_CARPLAY")) {
+ transport_type = "WiFi";
}
- return PROTOCOL_VERSION_2;
+
+ return transport_type;
}
+
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index d766cf18c4..d5422e11bc 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -41,6 +41,7 @@
#include "protocol_handler/protocol_packet.h"
#include "utils/macro.h"
#include "utils/byte_order.h"
+#include "utils/semantic_version.h"
namespace protocol_handler {
@@ -114,7 +115,8 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message,
switch (version) {
case PROTOCOL_VERSION_2:
case PROTOCOL_VERSION_3:
- case PROTOCOL_VERSION_4: {
+ case PROTOCOL_VERSION_4:
+ case PROTOCOL_VERSION_5: {
if (messageSize < PROTOCOL_HEADER_V2_SIZE) {
LOG4CXX_DEBUG(logger_,
"Message size less " << PROTOCOL_HEADER_V2_SIZE
@@ -131,7 +133,11 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message,
}
ProtocolPacket::ProtocolHeaderValidator::ProtocolHeaderValidator()
- : max_payload_size_(std::numeric_limits<size_t>::max()) {}
+ : max_payload_size_(std::numeric_limits<size_t>::max())
+ , max_control_payload_size_(0)
+ , max_rpc_payload_size_(0)
+ , max_audio_payload_size_(0)
+ , max_video_payload_size_(0) {}
void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size(
const size_t max_payload_size) {
@@ -139,15 +145,92 @@ void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size(
max_payload_size_ = max_payload_size;
}
+void ProtocolPacket::ProtocolHeaderValidator::set_max_control_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum Control payload size is " << max_payload_size);
+ max_control_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_rpc_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum RPC payload size is " << max_payload_size);
+ max_rpc_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_audio_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum audio payload size is " << max_payload_size);
+ max_audio_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_video_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum video payload size is " << max_payload_size);
+ max_video_payload_size_ = max_payload_size;
+}
+
size_t ProtocolPacket::ProtocolHeaderValidator::max_payload_size() const {
return max_payload_size_;
}
+size_t ProtocolPacket::ProtocolHeaderValidator::max_control_payload_size()
+ const {
+ return max_control_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_rpc_payload_size() const {
+ return max_rpc_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_audio_payload_size() const {
+ return max_audio_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_video_payload_size() const {
+ return max_video_payload_size_;
+}
+
+size_t
+ProtocolPacket::ProtocolHeaderValidator::max_payload_size_by_service_type(
+ const ServiceType type) const {
+ size_t payload_size = 0;
+ switch (type) {
+ case kControl:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_control_payload_size_ == 0 ? max_payload_size_
+ : max_control_payload_size_;
+ break;
+ case kBulk:
+ case kRpc:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_rpc_payload_size_ == 0 ? max_payload_size_
+ : max_rpc_payload_size_;
+ break;
+ case kAudio:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_audio_payload_size_ == 0 ? max_payload_size_
+ : max_audio_payload_size_;
+ break;
+ case kMobileNav:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_video_payload_size_ == 0 ? max_payload_size_
+ : max_video_payload_size_;
+ break;
+ case kInvalidServiceType:
+ LOG4CXX_WARN(logger_, "Invalid service type: " << static_cast<int>(type));
+ }
+ return payload_size;
+}
+
RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
const ProtocolHeader& header) const {
LOG4CXX_DEBUG(logger_, "Validating header - " << header);
// expected payload size will be calculated depending
- // on used protocol version
+ // on used protocol version and service type
size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
// Protocol version shall be from 1 to 4
switch (header.version) {
@@ -160,6 +243,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
? max_payload_size_
: MAXIMUM_FRAME_DATA_V2_SIZE;
break;
+ case PROTOCOL_VERSION_5:
+ payload_size = max_payload_size_by_service_type(
+ ServiceTypeFromByte(header.serviceType));
+ break;
default:
LOG4CXX_WARN(logger_,
"Unknown version:" << static_cast<int>(header.version));
@@ -176,8 +263,8 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
// Check frame info for each frame type
// Frame type shall be 0x00 (Control), 0x01 (Single), 0x02 (First), 0x03
// (Consecutive)
- // For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
- // Ack), 0xFF(HB Ack)
+ // For Control frames Frame info value shall be from 0x00 to 0x09 or
+ // 0xFD(Transport Event Update), 0xFE(Data Ack), 0xFF(HB Ack)
// For Single and First frames Frame info value shall be equal 0x00
switch (header.frameType) {
case FRAME_TYPE_CONTROL: {
@@ -189,6 +276,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
case FRAME_DATA_END_SERVICE:
case FRAME_DATA_END_SERVICE_ACK:
case FRAME_DATA_END_SERVICE_NACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK:
+ case FRAME_DATA_TRANSPORT_EVENT_UPDATE:
case FRAME_DATA_SERVICE_DATA_ACK:
case FRAME_DATA_HEART_BEAT_ACK:
break;
@@ -392,6 +483,17 @@ bool ProtocolPacket::operator==(const ProtocolPacket& other) const {
return false;
}
+void ProtocolPacket::HandleRawFirstFrameData(const uint8_t* message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ payload_size_ = 0;
+ const uint8_t* data = message;
+ uint32_t total_data_bytes = data[0] << 24;
+ total_data_bytes |= data[1] << 16;
+ total_data_bytes |= data[2] << 8;
+ total_data_bytes |= data[3];
+ set_total_data_bytes(total_data_bytes);
+}
+
RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t* message,
const size_t messageSize) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -404,18 +506,15 @@ RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t* message,
packet_data_.totalDataBytes = packet_header_.dataSize;
uint32_t dataPayloadSize = 0;
- if ((offset < messageSize) && packet_header_.frameType != FRAME_TYPE_FIRST) {
+ if ((offset < messageSize)) {
dataPayloadSize = messageSize - offset;
}
- if (packet_header_.frameType == FRAME_TYPE_FIRST) {
+ if (packet_header_.frameType == FRAME_TYPE_FIRST &&
+ !packet_header_.protection_flag) {
payload_size_ = 0;
const uint8_t* data = message + offset;
- uint32_t total_data_bytes = data[0] << 24;
- total_data_bytes |= data[1] << 16;
- total_data_bytes |= data[2] << 8;
- total_data_bytes |= data[3];
- set_total_data_bytes(total_data_bytes);
+ HandleRawFirstFrameData(data);
if (0 == packet_data_.data) {
return RESULT_FAIL;
}
@@ -474,6 +573,8 @@ uint8_t* ProtocolPacket::data() const {
}
void ProtocolPacket::set_total_data_bytes(size_t dataBytes) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Data bytes : " << dataBytes);
if (dataBytes) {
delete[] packet_data_.data;
packet_data_.data = new (std::nothrow) uint8_t[dataBytes];
@@ -504,6 +605,10 @@ ConnectionID ProtocolPacket::connection_id() const {
return connection_id_;
}
+void ProtocolPacket::set_connection_id(ConnectionID connection_id) {
+ connection_id_ = connection_id;
+}
+
uint32_t ProtocolPacket::payload_size() const {
return payload_size_;
}
diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
index a1c1f188d1..9a91a5d1f7 100644
--- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
@@ -43,8 +43,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver {
public:
- MOCK_METHOD2(StartMessageProcess, void(uint32_t, const TimevalStruct&));
- MOCK_METHOD2(EndMessageProcess, void(utils::SharedPtr<MessageMetric>));
+ MOCK_METHOD2(StartMessageProcess,
+ void(uint32_t, const date_time::TimeDuration&));
+ MOCK_METHOD2(EndMessageProcess, void(std::shared_ptr<MessageMetric>));
};
} // namespace protocol_handler_test
diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
index 66f5aea712..9abf5d69af 100644
--- a/src/components/protocol_handler/test/incoming_data_handler_test.cc
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -74,7 +74,7 @@ class IncomingDataHandlerTest : public ::testing::Test {
void AppendPacketToTMData(const ProtocolPacket& packet) {
const RawMessagePtr msg = packet.serializePacket();
- EXPECT_TRUE(msg.valid());
+ EXPECT_TRUE(msg.use_count() != 0);
EXPECT_GT(msg->data_size(), 0u);
tm_data.insert(tm_data.end(), msg->data(), msg->data() + msg->data_size());
}
@@ -192,49 +192,51 @@ TEST_F(IncomingDataHandlerTest, Heartbeat_pack) {
TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
for (FrameList::iterator it = mobile_packets.begin();
it != mobile_packets.end();
++it) {
@@ -262,22 +264,23 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) {
FrameList malformed_packets;
std::vector<uint8_t> malformed_versions;
malformed_versions.push_back(0);
- for (uint8_t version = PROTOCOL_VERSION_4 + 1;
+ for (uint8_t version = PROTOCOL_VERSION_5 + 1;
version <= PROTOCOL_VERSION_MAX;
++version) {
malformed_versions.push_back(version);
}
for (size_t i = 0; i < malformed_versions.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- malformed_versions[i],
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ malformed_versions[i],
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -316,16 +319,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) {
malformed_serv_types.push_back(0x0D);
malformed_serv_types.push_back(0x0E);
for (size_t i = 0; i < malformed_serv_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- malformed_serv_types[i],
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ malformed_serv_types[i],
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -360,16 +364,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
malformed_frame_types.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- malformed_frame_types[i],
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ malformed_frame_types[i],
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -393,27 +398,28 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) {
FrameList malformed_packets;
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -448,16 +454,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -492,16 +499,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -529,106 +537,110 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed byte
tm_data.insert(tm_data.end(), 1, 0x1);
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 2, 0x2);
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 3, 0x3);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 4, 0x4);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kRpc,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kRpc,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 5, 0x5);
// single packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 6, 0x6);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
@@ -651,29 +663,30 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 1
@@ -691,16 +704,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet1);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 2
@@ -718,16 +732,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet2);
// Audio packet
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc
index ad8a39f79a..f919ec92af 100644
--- a/src/components/protocol_handler/test/multiframe_builder_test.cc
+++ b/src/components/protocol_handler/test/multiframe_builder_test.cc
@@ -35,7 +35,7 @@
#include <algorithm>
#include <utility>
#include <limits>
-#include "utils/make_shared.h"
+
#include "protocol_handler/multiframe_builder.h"
namespace test {
@@ -149,7 +149,7 @@ class MultiFrameBuilderTest : public ::testing::Test {
const ProtocolFramePtrList::const_iterator it_last = --(multiframes.end());
while (it != it_last) {
const ProtocolFramePtr frame = *it;
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Non final CONSECUTIVE frame: " << frame;
EXPECT_EQ(ProtocolFramePtrList(), multiframe_builder_.PopMultiframes())
@@ -331,7 +331,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_NoConnections) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_FAIL, multiframe_builder_.AddFrame(first_frame))
<< "Non-existed connection " << connection_id
<< "- to be skipped first frame: " << first_frame;
@@ -365,7 +365,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_only) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
@@ -440,7 +440,7 @@ TEST_F(MultiFrameBuilderTest, Add_ConsecutiveFrames_per1) {
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr frame = multiframes.front();
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Frame: " << frame;
@@ -501,7 +501,7 @@ TEST_F(MultiFrameBuilderTest, FrameExpired_OneMSec) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 1d174c0253..51284dfcda 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -33,6 +33,7 @@
#include <string>
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol/bson_object_keys.h"
#include "protocol/common.h"
#include "protocol_handler/control_message_matcher.h"
#include "protocol_handler/mock_protocol_handler.h"
@@ -40,11 +41,26 @@
#include "protocol_handler/mock_protocol_handler_settings.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/connection_handler_impl.h"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#include "transport_manager/mock_transport_manager.h"
-#include "utils/make_shared.h"
+#include "utils/mock_system_time_handler.h"
+#include "utils/semantic_version.h"
+
#include "utils/test_async_waiter.h"
+#include <bson_object.h>
+
+namespace transport_manager {
+namespace transport_adapter {
+// taken from transport_adapter_impl.cc
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+}
+}
namespace test {
namespace components {
@@ -63,6 +79,8 @@ using protocol_handler::PROTECTION_OFF;
using protocol_handler::PROTOCOL_VERSION_1;
using protocol_handler::PROTOCOL_VERSION_2;
using protocol_handler::PROTOCOL_VERSION_3;
+using protocol_handler::PROTOCOL_VERSION_4;
+using protocol_handler::PROTOCOL_VERSION_5;
using protocol_handler::PROTOCOL_VERSION_MAX;
using protocol_handler::FRAME_TYPE_CONTROL;
using protocol_handler::FRAME_TYPE_SINGLE;
@@ -77,9 +95,14 @@ using protocol_handler::FRAME_DATA_END_SERVICE_ACK;
using protocol_handler::FRAME_DATA_END_SERVICE;
using protocol_handler::FRAME_DATA_HEART_BEAT;
using protocol_handler::FRAME_DATA_HEART_BEAT_ACK;
+using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
using protocol_handler::FRAME_DATA_SINGLE;
using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK;
+using protocol_handler::FRAME_DATA_TRANSPORT_EVENT_UPDATE;
using protocol_handler::kRpc;
using protocol_handler::kControl;
using protocol_handler::kAudio;
@@ -88,16 +111,28 @@ using protocol_handler::kBulk;
using protocol_handler::kInvalidServiceType;
// For TM states
using transport_manager::TransportManagerListener;
+using test::components::security_manager_test::MockSystemTimeHandler;
using transport_manager::E_SUCCESS;
using transport_manager::DeviceInfo;
+#ifdef ENABLE_SECURITY
+// For security
+using ContextCreationStrategy =
+ security_manager::SecurityManager::ContextCreationStrategy;
+#endif // ENABLE_SECURITY
// For CH entities
using connection_handler::DeviceHandle;
// Google Testing Framework Entities
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::ReturnRefOfCopy;
using ::testing::ReturnNull;
+using ::testing::An;
using ::testing::AnyOf;
+using ::testing::AtLeast;
+using ::testing::ByRef;
using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::Eq;
using ::testing::_;
using ::testing::Invoke;
using ::testing::SetArgReferee;
@@ -105,8 +140,15 @@ using ::testing::SetArgPointee;
typedef std::vector<uint8_t> UCharDataVector;
+// custom action to call a member function with 6 arguments
+ACTION_P4(InvokeMemberFuncWithArg2, ptr, memberFunc, a, b) {
+ (ptr->*memberFunc)(a, b);
+}
+
namespace {
const uint32_t kAsyncExpectationsTimeout = 10000u;
+const uint32_t kMicrosecondsInMillisecond = 1000u;
+const uint32_t kAddSessionWaitTimeMs = 100u;
}
class ProtocolHandlerImplTest : public ::testing::Test {
@@ -132,6 +174,13 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.WillByDefault(Return(malformd_max_messages));
ON_CALL(protocol_handler_settings_mock, multiframe_waiting_timeout())
.WillByDefault(Return(multiframe_waiting_timeout));
+#ifdef ENABLE_SECURITY
+ ON_CALL(protocol_handler_settings_mock, force_protected_service())
+ .WillByDefault(ReturnRefOfCopy(force_protected_services));
+ ON_CALL(protocol_handler_settings_mock, force_unprotected_service())
+ .WillByDefault(ReturnRefOfCopy(force_unprotected_services));
+#endif
+
protocol_handler_impl.reset(
new ProtocolHandlerImpl(protocol_handler_settings_mock,
session_observer_mock,
@@ -158,6 +207,9 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.
// Return false to avoid call KeepConnectionAlive
WillRepeatedly(Return(false));
+
+ session_connection_map_lock_ptr_ =
+ std::make_shared<sync_primitives::Lock>();
}
void TearDown() OVERRIDE {
@@ -176,8 +228,25 @@ class ProtocolHandlerImplTest : public ::testing::Test {
connection_id);
}
- void AddSession(const ::utils::SharedPtr<TestAsyncWaiter>& waiter,
+ protocol_handler::SessionContext GetSessionContext(
+ const transport_manager::ConnectionUID connection_id,
+ const uint8_t initial_session_id,
+ const uint8_t new_session_id,
+ const protocol_handler::ServiceType service_type,
+ const uint32_t hash_id,
+ const bool protection_flag) {
+ return protocol_handler::SessionContext(connection_id,
+ connection_id,
+ initial_session_id,
+ new_session_id,
+ service_type,
+ hash_id,
+ protection_flag);
+ }
+
+ void AddSession(const std::shared_ptr<TestAsyncWaiter>& waiter,
uint32_t& times) {
+ using namespace protocol_handler;
ASSERT_TRUE(NULL != waiter.get());
AddConnection();
@@ -192,16 +261,44 @@ class ProtocolHandlerImplTest : public ::testing::Test {
const bool callback_protection_flag = PROTECTION_OFF;
#endif // ENABLE_SECURITY
+ const protocol_handler::SessionContext context =
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ callback_protection_flag);
+
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
NEW_SESSION_ID,
start_service,
callback_protection_flag,
- _))
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id)));
+ WillOnce(DoAll(
+ NotifyTestAsyncWaiter(waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
times++;
// Expect send Ack with PROTECTION_OFF (on no Security Manager)
@@ -213,6 +310,8 @@ class ProtocolHandlerImplTest : public ::testing::Test {
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ usleep(kAddSessionWaitTimeMs * kMicrosecondsInMillisecond);
}
#ifdef ENABLE_SECURITY
@@ -257,10 +356,11 @@ class ProtocolHandlerImplTest : public ::testing::Test {
uint8_t service_type,
uint8_t sessionId,
uint32_t frame_data,
+ uint8_t protocol_version = PROTOCOL_VERSION_3,
uint32_t dataSize = 0u,
const uint8_t* data = NULL) {
SendTMMessage(connection_id,
- PROTOCOL_VERSION_3,
+ protocol_version,
protection,
FRAME_TYPE_CONTROL,
service_type,
@@ -271,8 +371,20 @@ class ProtocolHandlerImplTest : public ::testing::Test {
data);
}
+ void VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports);
+
testing::NiceMock<MockProtocolHandlerSettings> protocol_handler_settings_mock;
- ::utils::SharedPtr<ProtocolHandlerImpl> protocol_handler_impl;
+ std::shared_ptr<ProtocolHandlerImpl> protocol_handler_impl;
TransportManagerListener* tm_listener;
// Uniq connection
::transport_manager::ConnectionUID connection_id;
@@ -293,7 +405,14 @@ class ProtocolHandlerImplTest : public ::testing::Test {
testing::NiceMock<security_manager_test::MockSecurityManager>
security_manager_mock;
testing::NiceMock<security_manager_test::MockSSLContext> ssl_context_mock;
+ std::vector<int> force_protected_services;
+ std::vector<int> force_unprotected_services;
#endif // ENABLE_SECURITY
+ std::vector<std::string> empty_rejected_param_;
+ // Used by OnTransportConfigUpdated() tests. The lifetime of these objects
+ // should be longer than that of a test case.
+ connection_handler::SessionConnectionMap session_connection_map_;
+ std::shared_ptr<sync_primitives::Lock> session_connection_map_lock_ptr_;
};
#ifdef ENABLE_SECURITY
@@ -341,11 +460,31 @@ TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConnection) {
*/
TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverReject) {
+ using namespace protocol_handler;
const int call_times = 5;
AddConnection();
TestAsyncWaiter waiter;
uint32_t times = 0;
+ ServiceType service_type;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .Times(call_times)
+ .WillRepeatedly(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -353,12 +492,22 @@ TEST_F(ProtocolHandlerImplTest,
NEW_SESSION_ID,
AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk),
PROTECTION_OFF,
- _))
+ An<const BsonObject*>()))
.Times(call_times)
.
// Return sessions start rejection
WillRepeatedly(
- DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT)));
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ SaveArg<2>(&service_type),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ SESSION_START_REJECT,
+ service_type,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
times += call_times;
// Expect send NAck
@@ -389,6 +538,7 @@ TEST_F(ProtocolHandlerImplTest,
* OFF
*/
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
+ using namespace protocol_handler;
const int call_times = 5;
AddConnection();
#ifdef ENABLE_SECURITY
@@ -402,6 +552,25 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
TestAsyncWaiter waiter;
uint32_t times = 0;
+ ServiceType service_type;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .Times(call_times)
+ .WillRepeatedly(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(call_times)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -409,12 +578,22 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
NEW_SESSION_ID,
AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk),
callback_protection_flag,
- _))
+ An<const BsonObject*>()))
.Times(call_times)
.
// Return sessions start rejection
- WillRepeatedly(
- DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT)));
+ WillRepeatedly(DoAll(
+ NotifyTestAsyncWaiter(&waiter),
+ SaveArg<2>(&service_type),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ SESSION_START_REJECT,
+ service_type,
+ HASH_ID_WRONG,
+ callback_protection_flag),
+ ByRef(empty_rejected_param_))));
times += call_times;
// Expect send NAck with encryption OFF
@@ -444,19 +623,47 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
*/
TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverAccept) {
+ using namespace protocol_handler;
AddConnection();
const ServiceType start_service = kRpc;
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
times++;
SetProtocolVersion2();
@@ -481,31 +688,328 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
SetProtocolVersion2();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
+
+static std::vector<uint8_t> CreateVectorFromBsonObject(const BsonObject* bo) {
+ std::vector<uint8_t> output;
+ if (bo != NULL) {
+ size_t len = bson_object_size(const_cast<BsonObject*>(bo));
+ uint8_t* bytes = bson_object_to_bytes(const_cast<BsonObject*>(bo));
+ output.assign(bytes, bytes + len);
+ free(bytes);
+ }
+ return output;
+}
+
+/*
+ * Simulate two StartService messages of video service from mobile.
+ * Session observer accepts the first message with delay, while rejects the
+ * second message immediately.
+ */
+TEST_F(ProtocolHandlerImplTest,
+ StartSession_Unprotected_Multiple_SessionObserverAcceptAndReject) {
+ using namespace protocol_handler;
+
+ ON_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillByDefault(Return(PROTOCOL_VERSION_5));
+
+ const size_t maximum_payload_size = 1000;
+ InitProtocolHandlerImpl(0u, 0u, false, 0u, 0u, 0, maximum_payload_size);
+
+ const ServiceType start_service = kMobileNav;
+ const ::transport_manager::ConnectionUID connection_id1 = 0xAu;
+ const uint8_t session_id1 = 1u;
+ const ::transport_manager::ConnectionUID connection_id2 = 0xBu;
+ const uint8_t session_id2 = 2u;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id2, session_id2))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock,
+ GetSSLContext(connection_key, start_service))
+ .Times(2)
+ .WillRepeatedly(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id1, _))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id2, _))
+ .WillRepeatedly(Return(false));
+
+ // Add two connections
+ tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(1u),
+ std::string("mac"),
+ std::string("name"),
+ std::string("BTMAC")),
+ connection_id1);
+ tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(2u),
+ std::string("mac"),
+ std::string("name"),
+ std::string("BTMAC")),
+ connection_id2);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id1))
+ .WillOnce(Return("TCP_WIFI"));
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id2))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .Times(2)
+ .WillRepeatedly(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .Times(2)
+ .WillRepeatedly(ReturnRef(video_service_transports));
+
+ BsonObject bson_params1;
+ bson_object_initialize_default(&bson_params1);
+ bson_object_put_string(&bson_params1,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RAW"));
+ bson_object_put_string(&bson_params1,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H264"));
+ std::vector<uint8_t> params1 = CreateVectorFromBsonObject(&bson_params1);
+
+ uint8_t generated_session_id1 = 100;
+
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id1,
+ session_id1,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
+ // don't call NotifySessionStartedContext() immediately, instead call it
+ // after second OnSessionStartedCallback()
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
+ BsonObject bson_params2;
+ bson_object_initialize_default(&bson_params2);
+ bson_object_put_string(&bson_params2,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RTP"));
+ bson_object_put_string(&bson_params2,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H265"));
+ std::vector<uint8_t> params2 = CreateVectorFromBsonObject(&bson_params2);
+
+ std::vector<std::string> rejected_param_list;
+ rejected_param_list.push_back(protocol_handler::strings::video_codec);
+
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id2,
+ session_id2,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
+ .WillOnce(DoAll(
+ NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id2,
+ session_id2,
+ SESSION_START_REJECT,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(rejected_param_list)),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id1,
+ session_id1,
+ generated_session_id1,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times++;
+
+ BsonObject bson_ack_params;
+ bson_object_initialize_default(&bson_ack_params);
+ bson_object_put_int64(
+ &bson_ack_params, protocol_handler::strings::mtu, maximum_payload_size);
+ bson_object_put_string(&bson_ack_params,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RAW"));
+ bson_object_put_string(&bson_ack_params,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H264"));
+ std::vector<uint8_t> ack_params =
+ CreateVectorFromBsonObject(&bson_ack_params);
+ bson_object_deinitialize(&bson_ack_params);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id1,
+ Eq(ack_params))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ BsonArray bson_arr;
+ bson_array_initialize(&bson_arr, rejected_param_list.size());
+ for (unsigned int i = 0; i < rejected_param_list.size(); i++) {
+ bson_array_add_string(&bson_arr,
+ const_cast<char*>(rejected_param_list[i].c_str()));
+ }
+ BsonObject bson_nack_params;
+ bson_object_initialize_default(&bson_nack_params);
+ bson_object_put_array(
+ &bson_nack_params, protocol_handler::strings::rejected_params, &bson_arr);
+ std::vector<uint8_t> nack_params =
+ CreateVectorFromBsonObject(&bson_nack_params);
+ bson_object_deinitialize(&bson_nack_params);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF,
+ connection_id2,
+ Eq(nack_params))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendTMMessage(connection_id1,
+ PROTOCOL_VERSION_5,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ start_service,
+ FRAME_DATA_START_SERVICE,
+ session_id1,
+ params1.size(),
+ message_id,
+ params1.size() > 0 ? &params1[0] : NULL);
+
+ SendTMMessage(connection_id2,
+ PROTOCOL_VERSION_5,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ start_service,
+ FRAME_DATA_START_SERVICE,
+ session_id2,
+ params2.size(),
+ message_id,
+ params2.size() > 0 ? &params2[0] : NULL);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ bson_object_deinitialize(&bson_params1);
+ bson_object_deinitialize(&bson_params2);
+}
+
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Check protection flag OFF for all services from kControl to kBulk
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Audio_RejectByTransportType) {
+ using namespace protocol_handler;
+ AddConnection();
+ const ServiceType start_service = kAudio;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("AOA_USB");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
+ // Expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(
+ PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+/*
+ * ProtocolHandler shall send NAck on session_observer rejection
+ * Check protection flag OFF for all services from kControl to kBulk
+ */
+TEST_F(ProtocolHandlerImplTest, StartSession_Video_RejectByTransportType) {
+ using namespace protocol_handler;
+ AddConnection();
+ const ServiceType start_service = kMobileNav;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("AOA_USB");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
+ // Expect send Ack
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(
+ PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
// TODO(EZamakhov): add test for get_hash_id/set_hash_id from
// protocol_handler_impl.cc
/*
* ProtocolHandler shall send NAck on session_observer rejection
*/
TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
-
const ServiceType service = kRpc;
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, _, service))
+ OnSessionEndedCallback(
+ connection_id, session_id, An<uint32_t*>(), service))
.
// reject session start
WillOnce(
@@ -529,8 +1033,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
* ProtocolHandler shall send NAck on wrong hash code
*/
TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -539,7 +1042,8 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, _, service))
+ OnSessionEndedCallback(
+ connection_id, session_id, An<uint32_t*>(), service))
.
// return sessions start success
WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(connection_key)));
@@ -560,13 +1064,9 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
}
#ifdef ENABLE_SECURITY
-/*
- * ProtocolHandler shall not call Security logics with Protocol version 1
- * Check session_observer with PROTECTION_OFF and Ack with PROTECTION_OFF
- */
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ using namespace protocol_handler;
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -574,14 +1074,41 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
// Add security manager
AddSecurityManager();
const ServiceType start_service = kRpc;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
times++;
SetProtocolVersion2();
@@ -610,6 +1137,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
* PROTECTION_OFF
*/
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
+ using namespace protocol_handler;
AddConnection();
// Add security manager
AddSecurityManager();
@@ -617,14 +1145,41 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
times++;
SetProtocolVersion2();
@@ -644,25 +1199,60 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
* ProtocolHandler shall send Ack with PROTECTION_OFF on fail SLL creation
*/
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
TestAsyncWaiter waiter;
uint32_t times = 0;
+
+ protocol_handler::SessionContext context = GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON);
+ context.is_new_service_ = true;
+
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
times++;
SetProtocolVersion2();
// Expect start protection for unprotected session
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key,
+ security_manager::SecurityManager::
+ ContextCreationStrategy::kUseExisting))
.
// Return fail protection
WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
@@ -686,25 +1276,53 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_SSLInitialized) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
times++;
SetProtocolVersion2();
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -741,31 +1359,62 @@ TEST_F(ProtocolHandlerImplTest,
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeFail) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
TestAsyncWaiter waiter;
uint32_t times = 0;
+ protocol_handler::SessionContext context = GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON);
+ context.is_new_service_ = true;
+
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
times++;
std::vector<int> services;
// TODO(AKutsan) : APPLINK-21398 use named constants instead of magic numbers
services.push_back(0x0A);
services.push_back(0x0B);
- ON_CALL(protocol_handler_settings_mock, force_protected_service())
- .WillByDefault(ReturnRefOfCopy(services));
+ EXPECT_CALL(protocol_handler_settings_mock, force_protected_service())
+ .WillOnce(ReturnRefOfCopy(services));
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(Return(&ssl_context_mock));
@@ -791,13 +1440,6 @@ TEST_F(ProtocolHandlerImplTest,
connection_key,
security_manager::SSLContext::Handshake_Result_Fail)));
- // Listener check SSLContext
- EXPECT_CALL(session_observer_mock,
- GetSSLContext(connection_key, start_service))
- .
- // Emulate protection for service is not enabled
- WillOnce(ReturnNull());
-
// Expect send Ack with PROTECTION_OFF (on fail handshake)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
@@ -816,6 +1458,7 @@ TEST_F(ProtocolHandlerImplTest,
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -827,18 +1470,45 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -902,6 +1572,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(
ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess_ServiceProtectedBefore) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -912,18 +1583,45 @@ TEST_F(
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key, _))
.
// Return new SSLContext
WillOnce(
@@ -985,6 +1683,7 @@ TEST_F(
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess_SSLIsNotPending) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -995,18 +1694,48 @@ TEST_F(ProtocolHandlerImplTest,
TestAsyncWaiter waiter;
uint32_t times = 0;
+ // Expect verification of allowed transport
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillOnce(Return("TCP_WIFI"));
+
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(video_service_transports));
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id)));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
times++;
// call new SSLContext creation
- EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
+ EXPECT_CALL(security_manager_mock,
+ CreateSSLContext(connection_key,
+ security_manager::SecurityManager::
+ ContextCreationStrategy::kUseExisting))
.
// Return new SSLContext
WillOnce(
@@ -1034,27 +1763,37 @@ TEST_F(ProtocolHandlerImplTest,
// Expect add listener for handshake result
EXPECT_CALL(security_manager_mock, AddListener(_))
- // Emulate handshake fail
- .WillOnce(Invoke(OnHandshakeDoneFunctor(
- connection_key,
- security_manager::SSLContext::Handshake_Result_Success)));
+ // Emulate handshake
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ Invoke(OnHandshakeDoneFunctor(
+ connection_key,
+ security_manager::SSLContext::Handshake_Result_Success))));
+ times++;
// Listener check SSLContext
EXPECT_CALL(session_observer_mock,
GetSSLContext(connection_key, start_service))
.
// Emulate protection for service is not enabled
- WillOnce(ReturnNull());
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
+
+ EXPECT_CALL(security_manager_mock, IsSystemTimeProviderReady())
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
- // Expect service protection enable
EXPECT_CALL(session_observer_mock,
- SetProtectionFlag(connection_key, start_service));
+ SetProtectionFlag(connection_key, start_service))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
- // Expect send Ack with PROTECTION_OFF (on fail handshake)
+ // Expect send Ack with PROTECTION_ON (on successfull handshake)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+
times++;
SendControlMessage(
@@ -1064,14 +1803,1138 @@ TEST_F(ProtocolHandlerImplTest,
}
#endif // ENABLE_SECURITY
+void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports) {
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+ char full_version_string[] = "5.1.0";
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(config_multiple_transports_enabled));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // Prepare expected BSON parameters. When we add another param in Start
+ // Service ACK frame in future, it should be also added here.
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+ // secondaryTransports
+ BsonArray secondary_transports;
+ bson_array_initialize(&secondary_transports,
+ expected_transport_strings.size());
+ for (std::vector<std::string>::const_iterator it =
+ expected_transport_strings.begin();
+ it != expected_transport_strings.end();
+ ++it) {
+ // note: if there is no transport allowed, we can either make the array
+ // empty, or completely omit the array. (The spec allows both cases.) In
+ // this test case we make the array empty.
+ bson_array_add_string(&secondary_transports,
+ const_cast<char*>(it->c_str()));
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::secondary_transports,
+ &secondary_transports);
+ // audioServiceTransports
+ BsonArray audio_service_transports;
+ if (expected_audio_service_transports.size() > 0) {
+ bson_array_initialize(&audio_service_transports,
+ expected_audio_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_audio_service_transports.begin();
+ it != expected_audio_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&audio_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::audio_service_transports,
+ &audio_service_transports);
+ }
+ // videoServiceTransports
+ BsonArray video_service_transports;
+ if (expected_video_service_transports.size() > 0) {
+ bson_array_initialize(&video_service_transports,
+ expected_video_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_video_service_transports.begin();
+ it != expected_video_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&video_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::video_service_transports,
+ &video_service_transports);
+ }
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_Enabled) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through Bluetooth SPP
+ std::string connection_type_string("SPP_BLUETOOTH");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // and audio services only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_NoSecondaryTransport) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over USB
+ std::string connection_type_string("IAP_USB");
+
+ // Core should not offer any secondary transport. It will allow both video
+ // and audio services on primary transport.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_MultipleSecondaryTransports) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi and USB
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should offer both Wi-Fi and USB for secondary transport. Since the
+ // device is iOS, Core should specify "IAP_USB".
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ expected_transport_strings.push_back("IAP_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServiceAllowedOnBothTransports) {
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video service to run on Wi-Fi transports only, and audio
+ // service to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through AOA
+ std::string connection_type_string("AOA_USB");
+
+ // Core should offer Wi-Fi for secondary transport. It should allow audio
+ // service to run on both primary and secondary, while video service to run
+ // on secondary only. Since the list specifies AOA_USB then TCP_WIFI, the
+ // priority is primary > secondary.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1); // primary preferred
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_BLUETOOTH");
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("SPP_BLUETOOTH");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi;
+ secondary_transports_for_wifi.push_back("USB");
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ // assume the device is connected through Wi-Fi (so not sure if it's iOS or
+ // Android)
+ std::string connection_type_string("TCP_WIFI");
+
+ // Core should offer USB transport for secondary transport. (Since the OS type
+ // is unknown, it will offer both IAP_USB and AOA_USB.) Also, it should allow
+ // video/audio services on all transports.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("IAP_USB");
+ expected_transport_strings.push_back("AOA_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+// Secondary transport param should not be included for apps with v5.0.0
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_Unprotected_NoSecondaryTransportParamsForV5) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 0, 0);
+ char full_version_string[] = "5.0.0";
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // configuration
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> config_secondary_transports_for_wifi;
+ config_secondary_transports_for_wifi.push_back("USB");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // BSON params should not include any of "secondaryTransports",
+ // "audioServiceTransports" and "videoServiceTransports" since v5.0.0 app
+ // does not understand them
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ // Since the protocol version is less than 5.1.0, Core should not issue
+ // TransportEventUpdate frame. Enable ProtocolVersionUsed() call and verify
+ // that transport_manager_mock will NOT receive another SendMessageToDevice()
+ // call.
+ ON_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillByDefault(Return(true));
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, StartSessionAck_PrimaryTransportUSBHostMode) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is IOS and is connected through USB Host Mode
+ std::string connection_type_string("IAP_USB_HOST_MODE");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // services on both transports, and audio only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPEnabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = true;
+ char tcp_address[] = "192.168.1.1";
+ int32_t tcp_port = 12345;
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ // configuration setup
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPDisabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = false;
+ char tcp_address[] = "192.168.2.3";
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPEnabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ int32_t tcp_port = 23456;
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device2_secondary_connection_id = 150;
+
+ SessionTransports st1 = {device1_primary_connection_id, kDisabledSecondary};
+ SessionTransports st2 = {device2_primary_connection_id,
+ device2_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // since device 1 doesn't support secondary transport feature,
+ // TransportEvetUpdate should be delivered only to device 2
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device2_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPDisabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("false");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device1_secondary_connection_id = 150;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device3_primary_connection_id = 102;
+ transport_manager::ConnectionUID device3_secondary_connection_id = 151;
+
+ SessionTransports st1 = {device1_primary_connection_id,
+ device1_secondary_connection_id};
+ SessionTransports st2 = {device2_primary_connection_id, kDisabledSecondary};
+ SessionTransports st3 = {device3_primary_connection_id,
+ device3_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+ session_connection_map_[0x33] = st3;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // both device 1 and device 3 should receive TransportEventUpdate frames
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device1_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device3_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_SUCCESS) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(true)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_FAILURE) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ // check the behavior when OnSecondaryTransportStarted() returns false
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(false)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1108,8 +2971,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1145,8 +3007,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1174,8 +3035,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1203,8 +3063,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1232,8 +3091,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1259,14 +3117,13 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
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();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1306,14 +3163,14 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification) {
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();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1384,8 +3241,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1445,8 +3301,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1479,8 +3334,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1520,10 +3374,10 @@ TEST_F(ProtocolHandlerImplTest,
protocol_handler_impl->SendEndSession(connection_id, session_id);
}
-TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_EndSession_MessageSent) {
+TEST_F(ProtocolHandlerImplTest,
+ DISABLED_SendEndServicePrivate_EndSession_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1547,8 +3401,7 @@ TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_EndSession_MessageSent) {
TEST_F(ProtocolHandlerImplTest,
SendEndServicePrivate_ServiceTypeControl_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1567,7 +3420,8 @@ TEST_F(ProtocolHandlerImplTest,
times++;
// Act
- protocol_handler_impl->SendEndService(connection_id, session_id, kControl);
+ protocol_handler_impl->SendEndService(
+ connection_id, connection_id, session_id, kControl);
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
@@ -1586,8 +3440,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1601,7 +3454,8 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_CONTROL, FRAME_DATA_HEART_BEAT, PROTECTION_OFF, kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
// Act
protocol_handler_impl->SendHeartBeat(connection_id, session_id);
@@ -1611,8 +3465,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1638,10 +3491,10 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
-TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_WrongProtocolVersion_NotSent) {
+TEST_F(ProtocolHandlerImplTest,
+ DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1670,8 +3523,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_WrongProtocolVersion_NotSent) {
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1679,7 +3531,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kControl);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -1697,7 +3549,8 @@ TEST_F(ProtocolHandlerImplTest,
transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_SINGLE, FRAME_DATA_SINGLE, PROTECTION_OFF, kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
// Act
protocol_handler_impl->SendMessageToMobileApp(message, is_final);
@@ -1708,8 +3561,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleNonControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1717,7 +3569,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kRpc);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -1751,8 +3603,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1761,7 +3612,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
const uint32_t total_data_size = MAXIMUM_FRAME_DATA_V2_SIZE * 2;
UCharDataVector data(total_data_size);
const uint8_t first_consecutive_frame = 0x01;
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kBulk);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -1805,6 +3656,57 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
+TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
+ EXPECT_CALL(session_observer_mock, PairFromKey(connection_key, _, _))
+ .WillOnce(
+ DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_4), Return(true)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
+ FRAME_DATA_SERVICE_DATA_ACK,
+ PROTECTION_OFF,
+ kMobileNav)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
+ protocol_handler_impl->SendFramesNumber(connection_key, 0);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) {
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
+ EXPECT_CALL(session_observer_mock, PairFromKey(connection_key, _, _))
+ .WillOnce(
+ DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ // It is expected that Service Data ACK is NOT sent for version 5+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
+ FRAME_DATA_SERVICE_DATA_ACK,
+ PROTECTION_OFF,
+ kMobileNav))).Times(0);
+
+ protocol_handler_impl->SendFramesNumber(connection_key, 0);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+}
+
} // namespace protocol_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc
index 40b0f34846..5554bfd280 100644
--- a/src/components/protocol_handler/test/protocol_header_validator_test.cc
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -57,7 +57,7 @@ class ProtocolHeaderValidatorTest : public ::testing::Test {
uint32_t some_session_id;
};
-// Protocol version shall be from 1 to 3
+// Protocol version shall be from 1 to 5
TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) {
EXPECT_EQ(std::numeric_limits<size_t>::max(),
header_validator.max_payload_size());
@@ -67,11 +67,96 @@ TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) {
}
}
-// Protocol version shall be from 1 to 4
+TEST_F(ProtocolHeaderValidatorTest, MaxControlPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_control_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_control_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_control_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxRpcPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_rpc_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_rpc_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_rpc_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxAudioPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_audio_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_audio_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_audio_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxVideoPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_video_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_video_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_video_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Control) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kControl));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_control_payload_size(value);
+ EXPECT_EQ(value,
+ header_validator.max_payload_size_by_service_type(kControl));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Rpc) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kRpc));
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kBulk));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_rpc_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kRpc));
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kBulk));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Audio) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kAudio));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_audio_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kAudio));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Video) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kMobileNav));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_video_payload_size(value);
+ EXPECT_EQ(value,
+ header_validator.max_payload_size_by_service_type(kMobileNav));
+ }
+}
+
+// Protocol version shall be from 1 to 5
TEST_F(ProtocolHeaderValidatorTest, Malformed_Version) {
std::vector<uint8_t> malformed_versions;
malformed_versions.push_back(0);
- for (uint8_t version = PROTOCOL_VERSION_4 + 1;
+ for (uint8_t version = PROTOCOL_VERSION_5 + 1;
version <= PROTOCOL_VERSION_MAX;
++version) {
malformed_versions.push_back(version);
@@ -145,12 +230,12 @@ TEST_F(ProtocolHeaderValidatorTest, Malformed_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(ProtocolHeaderValidatorTest, Malformed_ControlFrame) {
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc
index 7819c4b5b0..71c7726243 100644
--- a/src/components/protocol_handler/test/protocol_packet_test.cc
+++ b/src/components/protocol_handler/test/protocol_packet_test.cc
@@ -125,7 +125,9 @@ TEST_F(ProtocolPacketTest, SerializePacketWithDiffServiceType) {
for (size_t i = 0; i < serv_types.size(); ++i) {
RawMessagePtr res =
GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(serv_types[i], res->service_type());
EXPECT_EQ(PROTOCOL_HEADER_V2_SIZE, res->data_size());
}
@@ -146,7 +148,9 @@ TEST_F(ProtocolPacketTest, SerializePacketWithWrongServiceType) {
for (size_t i = 0; i < serv_types.size(); ++i) {
RawMessagePtr res =
GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kInvalidServiceType, res->service_type());
}
}
@@ -156,7 +160,9 @@ TEST_F(ProtocolPacketTest, SetPacketWithDiffFrameType) {
for (frame_type = FRAME_TYPE_CONTROL + 1; frame_type <= FRAME_TYPE_MAX_VALUE;
++frame_type) {
RawMessagePtr res = GetRawMessage(PROTOCOL_VERSION_3, frame_type, kControl);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kControl, res->service_type());
}
}
diff --git a/src/components/qt_hmi/CMakeLists.txt b/src/components/qt_hmi/CMakeLists.txt
deleted file mode 100644
index ee30f2b468..0000000000
--- a/src/components/qt_hmi/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-add_subdirectory(./qml_plugins)
-
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- add_subdirectory(./qml_model_qt4)
-else ()
- add_subdirectory(./qml_model_qt5)
-endif ()
-
-if(HMI STREQUAL "qt" AND BUILD_TESTS)
- add_subdirectory(test)
-endif() \ No newline at end of file
diff --git a/src/components/qt_hmi/Readme.txt b/src/components/qt_hmi/Readme.txt
deleted file mode 100644
index 55e85db8ec..0000000000
--- a/src/components/qt_hmi/Readme.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-How to view QML HMI.
-
-1) Run setup_env.sh from root folder of SDL project (this will install right version of Qt and CMake)
-2) Run CMake with option HMI2=ON “cmake -DHMI2=ON <root_SDL_folder>” (this will build core+dbus adapter and QML HMI+ dbus adapter)
-3) Run “<QT510_INSTALL_PATH>/qmlscene <root_SDL_folder>/src/components/qt_hmi/qml_model_qt5/MainWindow.qml”
-4) Run SDL
-
diff --git a/src/components/qt_hmi/References/Look/.DS_Store b/src/components/qt_hmi/References/Look/.DS_Store
deleted file mode 100644
index c84f3ca965..0000000000
--- a/src/components/qt_hmi/References/Look/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
deleted file mode 100644
index 4ae24370af..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
deleted file mode 100644
index 2186efad6c..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
deleted file mode 100644
index c0232d069d..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
deleted file mode 100644
index 8b82f0ae0c..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
deleted file mode 100644
index 3595f70135..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
deleted file mode 100644
index 7be067d905..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/ImageHardkey.qml b/src/components/qt_hmi/References/Look/ImageHardkey.qml
deleted file mode 100644
index e39bb41605..0000000000
--- a/src/components/qt_hmi/References/Look/ImageHardkey.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FHardwareKey {
- width: 50
- height: 50
-
- property alias image : theImage.source
-
- Rectangle {
- anchors.fill: parent
- border.color: "black"
- border.width: 1
- radius: 10
- smooth: true
-
- gradient: Gradient {
- GradientStop {
- id: s1
- color: "#FF646464"
- position: 0.0
- }
- GradientStop {
- id: s2
- color: "#FF484848"
- position: 0.8
- }
- GradientStop {
- id: s3
- color: "#FF323232"
- position: 1.0
- }
- }
- }
-
- FWdgtImage {
- id: theImage
- //anchors.fill: parent
- anchors.centerIn: parent
- //fillMode: Image.PreserveAspectFit
- smooth: true
- }
-
-
- FViewUseCaseSimple {
- condition: pressed === true
- PropertyChanges { target: s1; position: 1.0 }
- PropertyChanges { target: s2; position: 0.2}
- PropertyChanges { target: s3; position: 0.0 }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml b/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
deleted file mode 100644
index 3ee2761be9..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
+++ /dev/null
@@ -1,378 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
-
-
- property alias a: aBtn.touchBtn
- property alias b: bBtn.touchBtn
- property alias c: cBtn.touchBtn
- property alias d: dBtn.touchBtn
- property alias e: eBtn.touchBtn
- property alias f: fBtn.touchBtn
- property alias g: gBtn.touchBtn
- property alias h: hBtn.touchBtn
- property alias i: iBtn.touchBtn
- property alias j: jBtn.touchBtn
- property alias k: kBtn.touchBtn
- property alias l: lBtn.touchBtn
- property alias m: mBtn.touchBtn
- property alias n: nBtn.touchBtn
- property alias o: oBtn.touchBtn
- property alias p: pBtn.touchBtn
- property alias q: qBtn.touchBtn
- property alias r: rBtn.touchBtn
- property alias s: sBtn.touchBtn
- property alias t: tBtn.touchBtn
- property alias u: uBtn.touchBtn
- property alias v: vBtn.touchBtn
- property alias w: wBtn.touchBtn
- property alias xB: xBtn.touchBtn
- property alias yB: yBtn.touchBtn
- property alias zB: zBtn.touchBtn
- property alias num: numBtn.touchBtn
- property alias close: closeTouch
-
- property string phonEntry: ""
-
-// BaseText{
-// id: phoneEntry
-// x:25
-// y:115
-// text: phonEntry
-// theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
-// pxSize: 45
-// horAlignment: Text.AlignLeft
-// vertAlignment: Text.AlignTop
-// }
-
- TouchButtonClimatePCA{
- id: aBtn
- x:48
- y:131
- text: "A"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: jBtn
- x:48
- y:212
- text: "J"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: sBtn
- x:48
- y:293
- text: "S"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: bBtn
- x:129
- y:131
- text: "B"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: kBtn
- x:129
- y:212
- text: "K"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: tBtn
- x:129
- y:293
- text: "T"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: cBtn
- x:210
- y:131
- text: "C"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: lBtn
- x:210
- y:212
- text: "L"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: uBtn
- x:210
- y:293
- text: "U"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: dBtn
- x:291
- y:131
- text: "D"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: mBtn
- x:291
- y:212
- text: "M"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: vBtn
- x:291
- y:293
- text: "V"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: eBtn
- x:372
- y:131
- text: "E"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: nBtn
- x:372
- y:212
- text: "N"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: wBtn
- x:372
- y:293
- text: "W"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: fBtn
- x:453
- y:131
- text: "F"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: oBtn
- x:453
- y:212
- text: "O"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: xBtn
- x:453
- y:293
- text: "X"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: gBtn
- x:534
- y:131
- text: "G"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: pBtn
- x:534
- y:212
- text: "P"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: yBtn
- x:534
- y:293
- text: "Y"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: hBtn
- x:615
- y:131
- text: "H"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: qBtn
- x:615
- y:212
- text: "Q"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: zBtn
- x:615
- y:293
- text: "Z"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: iBtn
- x:696
- y:131
- text: "I"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: rBtn
- x:696
- y:212
- text: "R"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: numBtn
- x:696
- y:293
- text: "123"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml b/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
deleted file mode 100644
index 2a1b2aa5f1..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FLayout {
- width: 800
- height: 480
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
deleted file mode 100644
index 14daa544b7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: chromelayout
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
-
-
-
- FWdgtTouchArea {
- id: blockClockTouch
- anchors.top: chromelayout.top
- anchors.horizontalCenter: chromelayout.horizontalCenter
- height: 60
- width: 160
- }
-
- Rectangle{
- id: clockBackground
- anchors.fill: blockClockTouch
- color: "red"
- }
-
- BaseText{
- id: clock
- anchors.centerIn: blockClockTouch
- text: "clock"
- horAlignment: Text.AlignHCenter
- }
-
- TouchButton{
- id: button1
- anchors.top: blockClockTouch.top
- anchors.right: blockClockTouch.left
- anchors.rightMargin: -5
- height: blockClockTouch.height
- width: 75
- text: "Button 1"
- unpressedColor: "darkRed"
- }
-
- TouchButton{
- id: button2
- anchors.top: blockClockTouch.top
- anchors.left: blockClockTouch.right
- anchors.leftMargin: -5
- height:blockClockTouch.height
- width: 75
- text: "Button 2"
- unpressedColor:"darkRed"
- }
-
- TouchButton{
- id: button3
- anchors.bottom: chromelayout.bottom
- anchors.horizontalCenter: chromelayout.horizontalCenter
- height:blockClockTouch.height
- width: 225
- text: "Button 3"
- unpressedColor: "red"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml b/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
deleted file mode 100644
index 6b6a2761c5..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: climateLayout
- width: 800
- height: 480
-
- property alias dualBtn: dualBtn.touchBtn
- property alias drvHeatSeat: drvHeatSeat.touchBtn
- property alias drvCoolSeat: drvCoolSeat.touchBtn
- property alias passCoolSeat: passCoolSeat.touchBtn
- property alias passHeatSeat: passHeatSeat.touchBtn
- property alias heatWheel: heatWheel.touchBtn
- property alias heatWinSheild: heatWinSheild.touchBtn
- property alias defrost: defrost.touchBtn
- property alias pannel: pannel.touchBtn
- property alias floor: floor.touchBtn
-
- property alias dualBtnSt: dualBtn.selected
- property alias drvHeatSeatSt: drvHeatSeat.selected
- property alias drvCoolSeatSt: drvCoolSeat.selected
- property alias passCoolSeatSt: passCoolSeat.selected
- property alias passHeatSeatSt: passHeatSeat.selected
- property alias heatWheelSt: heatWheel.selected
- property alias heatWinSheildSt: heatWinSheild.selected
- property alias defrostSt: defrost.selected
- property alias pannelSt: pannel.selected
- property alias floorSt: floor.selected
-
-
-
- TouchButtonClimatePCA{
- id: drvHeatSeat
- x:105
- y:178
- bitmap: "climate/heated seat icon.png"
- bitmap2: "climate/heated seat iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: drvCoolSeat
- x:105
- y:273
- bitmap: "climate/A_C icon.png"
- bitmap2: "climate/A_C iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: heatWheel
- x:200
- y:178
- bitmap: "climate/wheel icon.png"
- bitmap2: "climate/wheel iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: heatWinSheild
- x:200
- y:273
- bitmap: "climate/headed dashBlue.png"
- bitmap2: "climate/headed dash.png"
- }
-
- TouchButtonClimatePCA{
- id: defrost
- x:360
- y:130
- bitmap: "climate/defrost iconBlue.png"
- bitmap2: "climate/defrost icon.png"
- }
-
- TouchButtonClimatePCA{
- id: pannel
- x:360
- y:226
- bitmap: "climate/face icon.png"
- bitmap2: "climate/face iconBlack.png"
- }
-
- TouchButtonClimatePCA{
- id: floor
- x:360
- y:322
- bitmap: "climate/feet icon.png"
- bitmap2: "climate/feet iconBlack.png"
- }
-
-
- TouchButtonClimatePCA{
- id: dualBtn
- y:225
- x:528
- text: "Dual"
- }
-
- TouchButtonClimatePCA{
- id: passHeatSeat
- x:615
- y:178
- bitmap: "climate/heated seat icon.png"
- bitmap2: "climate/heated seat iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: passCoolSeat
- x:615
- y:273
- bitmap: "climate/A_C icon.png"
- bitmap2: "climate/A_C iconBlack.png"
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
deleted file mode 100644
index 0abc7db4b7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
- x:0
- y:0
-
- FWdgtTouchArea{
- id: blockTouch
- x:0
- y:0
- height: 480
- width: 800
- }
-
- Rectangle{
- anchors.fill: blockTouch
- color: "black"
- opacity: 0.8
- }
-
- FWdgtImage{
- id: popupBg
- anchors.centerIn: blockTouch
- bitmap: "climate/ring.png"
- }
-
- BaseText{
- id:curTemp
- anchors.centerIn: popupBg
- text: dataPool.drvTemp + "\xBA"
- pxSize: 96
- }
-
- BaseText{
- id:drvPass
- anchors.horizontalCenter: popupBg.horizontalCenter
- anchors.bottom: curTemp.top
- horAlignment: Text.AlignHCenter
- text: "Driver"
- pxSize: 28
- }
-
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
deleted file mode 100644
index 8057ff2e7e..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
+++ /dev/null
@@ -1,217 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias albumInfoImg: stationLogoImg
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias alertBtn: alertBtn
- property alias preset1Btn: preset1Btn
- property alias preset2Btn: preset2Btn
- property alias preset3Btn: preset3Btn
- property alias preset4Btn: preset4Btn
- property alias preset5Btn: preset5Btn
- property alias preset6Btn: preset6Btn
- property alias replayBtn: replayBtn
- property alias tuneBtn: tuneBtn
- property alias presetsBtn: presetsBtn
- property bool artShown: true
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 180
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- vis: false
-
- }
-
- FWdgtImage{
- id: stationLogoImg
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:70
- width: 130
- bitmap: ""
- }
-
- TouchButton{
- id: alertBtn
- anchors.top: albumInfoImg.bottom
- anchors.topMargin: 20
- anchors.left: albumInfoImg.left
- height:25
- width: 90
- text: "Alert"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: preset1Btn
- anchors.top: fmLayout.top
- anchors.topMargin: 280
- anchors.left: browseBtn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset2Btn
- anchors.top: preset1Btn.bottom
- anchors.left: preset1Btn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset3Btn
- anchors.top: preset1Btn.top
- anchors.left: preset1Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset4Btn
- anchors.top: preset2Btn.top
- anchors.left: preset2Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset5Btn
- anchors.top: preset3Btn.top
- anchors.left: preset3Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset6Btn
- anchors.top: preset4Btn.top
- anchors.left: preset4Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: replayBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: fmLayout.left
- anchors.leftMargin: 725
- height:40
- width: 55
- text: "rply"
- }
-
- TouchButton{
- id: tuneBtn
- anchors.top: preset1Btn.top
- anchors.right: replayBtn.right
- height:40
- width: 120
- text: "tune"
- }
-
- TouchButton{
- id: presetsBtn
- anchors.bottom: preset6Btn.bottom
- anchors.right: replayBtn.right
- height:60
- width: 120
- text: "presets"
- }
-
- FViewUseCaseGroup{
- FViewUseCase{
- condition: dataPool.hasArt === 0
- PropertyChanges { target: albumInfoBtn; vis: false;}
- PropertyChanges { target: albumInfoImg; visible: false;}
- PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
- PropertyChanges { target: alertBtn; vis: false;}
- }
- FViewUseCase{
- condition: dataPool.hasArt === 1
- PropertyChanges { target: albumInfoBtn; vis: false;}
- PropertyChanges { target: albumInfoImg; visible: false;}
- PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
- PropertyChanges { target: alertBtn; vis: false;}
- }
- FViewUseCase{
- condition: dataPool.hasArt === 2
- PropertyChanges { target: albumInfoImg; visible: true;}
- PropertyChanges { target: albumInfoBtn; vis: true;}
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
deleted file mode 100644
index fd211b3c97..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
+++ /dev/null
@@ -1,152 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias tuneBtn: tuneBtn
- property alias hdBtn: hdBtn
- property alias stationTxt: stationTxt.text
- property alias freqId: freqId.text
- property alias listModel: thePresets.listModel
- property alias artist: artistTxt.text
- property alias curHD: hdBtn.curHD
- property alias totHD: hdBtn.totHD
- property alias curPreset: thePresets.currPreset
- property alias moving: thePresets.moving
- property alias direction: thePresets.direction
- property bool page1: true
-
-
-
-
-
- FWdgtImage{
- bitmap: "Radio/Ford-HMI-PCA-audio_fm_sirius.png"
- visible: false
- }
-
- TouchButton_PCA{
- id: sourceBtn
- x:25
- y:80
- textWidth: 100
- text: "FM Radio"
-
- }
-
- TouchButton_PCA{
- id: tuneBtn
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- y:80
- textWidth: 55
- text: "Tune"
-
- }
-
- BaseText{
- id: stationTxt
- x:25
- y:155
- pxSize: 45
- text: "96.3"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: freqId
- anchors.left: stationTxt.right
- anchors.leftMargin: 5
- anchors.bottom: stationTxt.bottom
- anchors.bottomMargin: 4
- text: "FM"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: trackTxt
- x:25
- y:212
- text: "So Far Around The Bend"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
-
-
- }
-
- BaseText{
- id: artistTxt
- x:25
- y:240
- text: "The National"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
- }
-
- TouchButtonSpecial_PCA{
- id: hdBtn
- x:25
- y:288
- textWidth: 120
- bitmap: "Radio/HD Logo.png"
- bitmap2: "Radio/HD Logo1.png"
- imageShift: -9
- spacing: 0
- text: " 1 "
- text1: "2"
- text2: " 3 4"
-
- }
-
- Rectangle{
- x:25
- y: 365
- height:1
- width: 750
- color: "#1d81d5"
- }
-
-
- PresetsGridPCA{
- id: thePresets
- x:0
- y:365
-
- }
-
- FWdgtImage{
- id: swipeIcon1
- bitmap: "Radio/whiteBall.png"
- x: 389
- y: 381
- }
-
- FWdgtImage{
- id: swipeIcon2
- bitmap: "Radio/blueBall.png"
- x: 404
- y: 381
- }
-
- FViewUseCaseSimple{condition: fmLayout.page1===false
- PropertyChanges{
- target: swipeIcon2; bitmap: "Radio/whiteBall.png"
- }
- PropertyChanges{
- target: swipeIcon1; bitmap: "Radio/blueBall.png"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
deleted file mode 100644
index 375f96894a..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: home
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
- property alias button4: button4
-
-
-
-
- TouchButton{
- id: button1
- anchors.top: home.top
- anchors.left: home.left
- height:235
- width: 395
- text: "Button 1"
- }
-
- TouchButton{
- id: button2
- anchors.top: home.top
- anchors.right: home.right
- height:235
- width: 395
- text: "Button 2"
- }
-
- TouchButton{
- id: button3
- anchors.bottom: home.bottom
- anchors.left: home.left
- height:235
- width: 395
- text: "Button 3"
- }
-
- TouchButton{
- id: button4
- anchors.bottom: home.bottom
- anchors.right: home.right
- height:235
- width: 395
- text: "Button 4"
- }
-
- BaseText{
- id: title
- anchors.centerIn: home
- text: "Home"
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
deleted file mode 100644
index 326d4feb0b..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-
-FLayout {
-
- id: theLayout
- width: 800
- height: 480
- x:10
- y:10
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
- Rectangle{
- anchors.fill:parent
- color:"white"
-
- }
-
-
- FWdgtListView {
-
- id: theListView
- anchors.fill: parent
- clip: true
-
- }
- FWdgtListView {
- x:400
- id: filteredListView
- clip: true
- data:filtermodel
- itemWidget:list_itemWidget
- width:100
- height:400
- }
- TextInput{
- text:"HelloWorld"
- x:200
- y:20
- onTextChanged: {
-
- if(text.length > 0 ) {
- dataPool.filter = text
- console.log(dataPool.filter)
-
- sortList.fillFilterModel(theListView.data)//Just backup original
- sortList.updateFilterModel(text)
-
- } else {
- sortList.fillFilterModel(theListView.data)
- }
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
deleted file mode 100644
index d0f240f4b9..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: mapLayout
- width: 800
- height: 480
-
- property alias zoomIn: zoomIn.touchBtn
- property alias zoomOut: zoomOut.touchBtn
- property alias compass: compass.touchBtn
- property alias cancel: cancel.touchBtn
- property alias mute: mute.touchBtn
- property alias muteSt: mute.selected
- property alias options: options.touchBtn
-
-
-
- FWdgtImage{
- id: mapImg
- bitmap: "Nav/Map.png"
- anchors.fill: mapLayout
- }
-
- TouchButtonClimatePCA{
- id: zoomIn
- text: "+"
- x:25
- y:103
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
-
- }
- TouchButtonClimatePCA{
- id: zoomOut
- text: "-"
- x:25
- y:223
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- }
- TouchButtonClimatePCA{
- id: options
- x:659
- y:80
- image: "Nav/Options_9_9.png"
- imageActive: "Nav/OptionsInActive.png"
- imagePressed: "Nav/OptionsPressed_9_9.png"
- }
- TouchButtonClimatePCA{
- id: compass
- x:34
- y:352
- image: "Nav/compass.png"
- imageActive: "Nav/compass.png"
- imagePressed: "Nav/compass.png"
- }
- TouchButtonClimatePCA{
- id: mute
- x:25
- y:419
- image: "buttons/mute_9_9.png"
- imageActive: "buttons/muteActive.png"
- imagePressed: "buttons/mutePressed_9_9.png"
- imageInActive: "buttons/muteInActive.png"
- }
- FWdgtImage{
- bitmap: "Nav/turnArrow.png"
- x:97
- y:428
- }
- BaseText{
- text: "0.2 mi on Cherry Hill Rd."
- pxSize: 22
- x:144
- y:434
- color: "white"
- }
-
- BaseText{
- text: "2 hrs 27 min"
- pxSize: 22
- anchors.right: cancel.left
- anchors.rightMargin: 26
- horAlignment: Text.AlignRight
- y:434
- color: "white"
- }
-
- TouchButtonSpecial_PCA{
- id: cancel
- x:621
- y:419
- textWidth: 110
- bitmap: "Nav/destIcon.png"
- bitmap2: "Nav/destIconBlack.png"
- imageShift: -9
- spacing: 0
- text: " Cancel"
- text1: ""
- text2: ""
- totHD: -1
-
- }
- FWdgtImage{
- id: currStBkgrnd
- bitmap: "Nav/current street.png"
- x:265
- y:349
- }
-
- BaseText{
- id: currentStreet
- x:312
- y:360
- text: "East Capital St. NE"
- pxSize: 18
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
deleted file mode 100644
index 6c7a031175..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
+++ /dev/null
@@ -1,547 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
-
- property alias a: aBtn.touchBtn
- property alias b: bBtn.touchBtn
- property alias c: cBtn.touchBtn
- property alias d: dBtn.touchBtn
- property alias e: eBtn.touchBtn
- property alias f: fBtn.touchBtn
- property alias g: gBtn.touchBtn
- property alias h: hBtn.touchBtn
- property alias i: iBtn.touchBtn
- property alias j: jBtn.touchBtn
- property alias k: kBtn.touchBtn
- property alias l: lBtn.touchBtn
- property alias m: mBtn.touchBtn
- property alias n: nBtn.touchBtn
- property alias o: oBtn.touchBtn
- property alias p: pBtn.touchBtn
- property alias q: qBtn.touchBtn
- property alias r: rBtn.touchBtn
- property alias s: sBtn.touchBtn
- property alias t: tBtn.touchBtn
- property alias u: uBtn.touchBtn
- property alias v: vBtn.touchBtn
- property alias w: wBtn.touchBtn
- property alias xB: xBtn.touchBtn
- property alias yB: yBtn.touchBtn
- property alias zB: zBtn.touchBtn
- property alias num: numBtn.touchBtn
- property alias sym: symBtn.touchBtn
- property alias del: delBtn.touchBtn
- property alias clr: clrBtn.touchBtn
- property alias space: spaceBtn.touchBtn
- property alias close: closeTouch
- property string entry: ""
- property alias go: goBtn.touchBtn
- property alias listOpen: listOpen
-
- FWdgtListView {
- id: theListView
- anchors.fill: parent
- clip: true
- visible:false
- }
-
- FWdgtListView {
- x:400
- id: filteredListView
- clip: true
- data:filtermodel
- itemWidget:list_itemWidget
- width:100
- height:400
- visible: true
- }
- TextInput{ //Little Trick for Update on List
- text:dataPool.navEnrty
- x:200
- y:20
- onTextChanged: {
-
- if(text.length > 0 ) {
- dataPool.filter = text
- console.log(dataPool.filter)
- sortList.fillFilterModel(theListView.data)//Just backup original
- sortList.updateFilterModel(text)
-
- } else {
- sortList.fillFilterModel(theListView.data)
- dataPool.navList1stItem=""
-
- }
-
-
- }
-
- }
- BaseText{
- id: navEntry
- x:25
- y:65
- text: entry
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 45
- color: "#1d81d5"
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
- BaseText{
- id: listFiltEntry
- x:25
- y:130
- color:"#1d81d5"
- text:dataPool.navList1stItem
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 45
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
- Rectangle{
- id:rect
- x:20
- y:120
- height: 60
- radius:10
- width:650
- color:"transparent"
- border.color: "#1d81d5"
- border.width: 1
- visible: false
- }
-
- FWdgtTouchArea{
- id: listOpen
- anchors.fill: rect
- enabled: rect.visible
- }
-
- TouchButton_PCA{
- id: goBtn
- x:690
- y:115
- textWidth: 40
- text: "Go"
-
- }
-
-
- TouchButtonClimatePCA{
- id: qBtn
- x:61
- y:211
- text: "Q"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: wBtn
- x:130
- y:211
- text: "W"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: eBtn
- x:199
- y:211
- text: "E"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: rBtn
- x:268
- y:211
- text: "R"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: tBtn
- x:337
- y:211
- text: "T"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: yBtn
- x:406
- y:211
- text: "Y"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: uBtn
- x:475
- y:211
- text: "U"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: iBtn
- x:544
- y:211
- text: "I"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: oBtn
- x:613
- y:211
- text: "O"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: pBtn
- x:682
- y:211
- text: "P"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: numBtn
- x:27
- y:272
- text: "123"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 22
- }
-
- TouchButtonClimatePCA{
- id: aBtn
- x:96
- y:272
- text: "A"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: sBtn
- x:165
- y:272
- text: "S"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: dBtn
- x:234
- y:272
- text: "D"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: fBtn
- x:303
- y:272
- text: "F"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: gBtn
- x:372
- y:272
- text: "G"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: hBtn
- x:441
- y:272
- text: "H"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: jBtn
- x:510
- y:272
- text: "J"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: kBtn
- x:579
- y:272
- text: "K"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: lBtn
- x:648
- y:272
- text: "L"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: delBtn
- x:717
- y:272
- bitmap: "Nav/deleteIcon.png"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: symBtn
- x:61
- y:333
- text: "!@#"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 22
- }
-
- TouchButtonClimatePCA{
- id: zBtn
- x:130
- y:333
- text: "Z"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: xBtn
- x:199
- y:333
- text: "X"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: cBtn
- x:268
- y:333
- text: "C"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: vBtn
- x:337
- y:333
- text: "V"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: bBtn
- x:406
- y:333
- text: "B"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: nBtn
- x:475
- y:333
- text: "N"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: mBtn
- x:544
- y:333
- text: "M"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: clrBtn
- x:613
- y:333
- text: "Clear"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- txtSize: 16
- }
-
- TouchButtonClimatePCA{
- id: spaceBtn
- x:682
- y:333
- text: "Space"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- txtSize: 16
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-
- FViewUseCaseSimple{condition: listFiltEntry.text !== ""
- PropertyChanges {
- target: rect; visible: true
- }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
deleted file mode 100644
index 7c65e911a7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: mapLayout
- width: 800
- height: 480
-
- property alias zoomIn: zoomIn.touchBtn
- property alias zoomOut: zoomOut.touchBtn
- property alias compass: compass.touchBtn
- property alias destSearch: destSearch.touchBtn
- property alias options: options.touchBtn
-
-
-
- FWdgtImage{
- id: mapImg
- bitmap: "Nav/Map.png"
- anchors.fill: mapLayout
- }
-
- TouchButtonClimatePCA{
- id: zoomIn
- text: "+"
- x:25
- y:103
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
-
- }
- TouchButtonClimatePCA{
- id: zoomOut
- text: "-"
- x:25
- y:223
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- }
- TouchButtonClimatePCA{
- id: options
- x:659
- y:80
- image: "Nav/Options_9_9.png"
- imageActive: "Nav/OptionsInActive.png"
- imagePressed: "Nav/OptionsPressed_9_9.png"
- }
- TouchButtonClimatePCA{
- id: compass
- x:34
- y:352
- image: "Nav/compass.png"
- imageActive: "Nav/compass.png"
- imagePressed: "Nav/compass.png"
- }
- TouchButtonSpecial_PCA{
- id: destSearch
- x:601
- y:419
- textWidth: 130
- bitmap: "Nav/destIcon.png"
- bitmap2: "Nav/destIconBlack.png"
- imageShift: -9
- spacing: 0
- text: " Destination"
- text1: ""
- text2: ""
- totHD: -1
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml b/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
deleted file mode 100644
index f5cc5d57a6..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FLayout {
- width: 800
- height: 480
-
- property alias offTouch: offTouch
-
- Rectangle {
- id: bk
- anchors.fill: parent
- color: "black"
- }
-
- FWdgtTouchArea{
- id: offTouch
- anchors.fill: bk
- }
-
-/* RectangularGlow {
- id: effect
- anchors.fill: rect
- glowRadius: 4
- spread: 0.7
- color: "#1d81d5"
- cornerRadius: rect.radius //+ glowRadius
- }
-
- Rectangle {
- id: rect
- color: "black"
- x:40
- y:40
- width: 160
- height: 45
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- }
-
- FWdgtImage{
- id: img
- x:40
- y:90
- bitmap: "OButton.png"
- }
-
- FWdgtImage{
- id: img
- x:40
- y:40
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width:2
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }*/
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
deleted file mode 100644
index 1236ea4201..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
+++ /dev/null
@@ -1,123 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: statusLayout
- width: 800
- height: 480
-
- property alias menuTouch: menuTouch
-
- Rectangle{
- id: ln1
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:15
- height:1
- width: 14
- color: "#1d81d5"
- }
- Rectangle{
- id: ln2
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:19
- height:1
- width: 14
- color: "#1d81d5"
- }
- Rectangle{
- id: ln3
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:23
- height:1
- width: 14
- color: "#1d81d5"
- }
-
-
-
- BaseText{
- id: menuTxt
- anchors.horizontalCenter: statusLayout.horizontalCenter
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignBottom
- text: "MENU"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- BaseText{
- id: tempTxt
- x:25
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignBottom
- text: "75" + "\xBA"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 28
-
-
- }
-
- BaseText{
- id: clockTxt
- anchors.right: statusLayout.right
- anchors.rightMargin: 25
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignRight
- vertAlignment: Text.AlignBottom
- text: "12:45"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 28
- }
-
- FWdgtTouchArea{
- id: menuTouch
- height: 75
- width: 80
- y:0
- anchors.horizontalCenter: statusLayout.horizontalCenter
- }
-
- FViewUseCase{condition: menuTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: ln1; color: "white"
- }
- PropertyChanges {
- target: ln2; color: "white"
- }
- PropertyChanges {
- target: ln3; color: "white"
- }
- PropertyChanges {
- target: menuTxt; color: "white"
- }
- }
-
- FViewUseCase{
- condition: dataPool.mainPCAmenuShown ===true
- PropertyChanges {
- target: ln1; visible: false
- }
- PropertyChanges {
- target: ln2; visible: false
- }
- PropertyChanges {
- target: ln3; visible: false
- }
- PropertyChanges {
- target: menuTxt; visible: false
- }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
deleted file mode 100644
index 9e119d9900..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-
-FLayout {
-
- id: theLayout
- width: 800
- height: 480
-
- property alias list : theListPhoneView
- property alias list_itemWidget: theListPhoneView.itemWidget
- property alias list_data: theListPhoneView.data
- property alias back: back.touchBtn
- TouchButtonClimatePCA{
- id: back
- text: "+"
- x:25
- y:80
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- visible: false
-
- }
- FWdgtListView {
-
- width:600
- height:400
- id: theListPhoneView
- x:150
- y:80
- clip: true
- visible:true
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml b/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
deleted file mode 100644
index e275c055a7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
+++ /dev/null
@@ -1,195 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias albumInfoImg: stationLogoImg
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias alertBtn: alertBtn
- property alias preset1Btn: preset1Btn
- property alias preset2Btn: preset2Btn
- property alias preset3Btn: preset3Btn
- property alias preset4Btn: preset4Btn
- property alias preset5Btn: preset5Btn
- property alias preset6Btn: preset6Btn
- property alias replayBtn: replayBtn
- property alias tuneBtn: tuneBtn
- property alias presetsBtn: presetsBtn
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 180
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- vis: false
-
- }
-
- FWdgtImage{
- id: stationLogoImg
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:70
- width: 130
- bitmap: ""
- }
-
- TouchButton{
- id: alertBtn
- anchors.top: albumInfoImg.bottom
- anchors.topMargin: 20
- anchors.left: albumInfoImg.left
- height:25
- width: 90
- text: "Alert"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: preset1Btn
- anchors.top: fmLayout.top
- anchors.topMargin: 280
- anchors.left: browseBtn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset2Btn
- anchors.top: preset1Btn.bottom
- anchors.left: preset1Btn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset3Btn
- anchors.top: preset1Btn.top
- anchors.left: preset1Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset4Btn
- anchors.top: preset2Btn.top
- anchors.left: preset2Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset5Btn
- anchors.top: preset3Btn.top
- anchors.left: preset3Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset6Btn
- anchors.top: preset4Btn.top
- anchors.left: preset4Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: replayBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: fmLayout.left
- anchors.leftMargin: 725
- height:40
- width: 55
- text: "rply"
- }
-
- TouchButton{
- id: tuneBtn
- anchors.top: preset1Btn.top
- anchors.right: replayBtn.right
- height:40
- width: 120
- text: "tune"
- }
-
- TouchButton{
- id: presetsBtn
- anchors.bottom: preset6Btn.bottom
- anchors.right: replayBtn.right
- height:60
- width: 120
- text: "presets"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml b/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
deleted file mode 100644
index 3968438447..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: chrome
- width: 800
- height: 480
-
- //property alias bg: _bg
- //property alias btnIndicatorState: button1.indicatorState
- property alias button1: button1
-
-
-
-
- BaseText{
- id: title
- anchors.centerIn: chrome
- text: "Chrome"
- }
-
- TouchButton{
- id: button1
- anchors.top: title.bottom
- anchors.horizontalCenter: title.horizontalCenter
- text: "Button 1"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml b/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
deleted file mode 100644
index d898a0c07f..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
- GridViewWidget {
- id: listView
- x: 135; y: 170
- width: 530; height: 200
- gridItemHeight: 100; gridItemWidth: 180
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
deleted file mode 100644
index a1a0d32538..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
+++ /dev/null
@@ -1,76 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: layout
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias theX: listView.x
- property alias theY: listView.y
- property alias theWidth: listView.width
- property alias theHeight: listView.height
- property alias itemWidth: listView.gridItemWidth
- property alias itemHeight: listView.gridItemHeight
- property alias close: closeTouch
- property bool useClose: false
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
-
- GridViewWidget {
- id: listView
- x: 0; y: 75
- width: 800; height: 356
- gridItemHeight: 178; gridItemWidth: 200
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
- }
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: layout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- visible: useClose
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: layout.horizontalCenter
- visible: useClose
- enabled: useClose
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
deleted file mode 100644
index 0aed708e35..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
+++ /dev/null
@@ -1,107 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: tileLayout
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
- property alias button4: button4
- property alias button5: button5
- property alias button6: button6
- property alias button7: button7
- property alias button8: button8
- property alias backBtn: backBtn
-
-
-
- Grid {
- id: theGrid
- flow: Grid.TopToBottom
- anchors.top: tileLayout.top
- anchors.topMargin: 130
- anchors.horizontalCenter: tileLayout.horizontalCenter
- anchors.leftMargin: 100
- columns: 4
- spacing: 20
- TouchButton{
- id: button1
- height:125
- width: 135
- text: "Button 1"
- }
-
- TouchButton{
- id: button2
- height:125
- width: 135
- text: "Button 2"
- }
-
- TouchButton{
- id: button3
- height:125
- width: 135
- text: "Button 3"
- }
-
- TouchButton{
- id: button4
- height:125
- width: 135
- text: "Button 4"
- }
-
- TouchButton{
- id: button5
- height:125
- width: 135
- text: "Button 5"
- }
-
- TouchButton{
- id: button6
- height:125
- width: 135
- text: "Button 6"
- }
-
- TouchButton{
- id: button7
- height:125
- width: 135
- text: "Button 7"
- }
-
- TouchButton{
- id: button8
- height:125
- width: 135
- text: "Button 8"
- }
- }
-
-
-
- BaseText{
- id: title
- anchors.top: tileLayout.top
- anchors.topMargin: 80
- anchors.horizontalCenter: tileLayout.horizontalCenter
- text: "Select a Source"
- }
-
- TouchButton{
- id: backBtn
- anchors.verticalCenter: title.verticalCenter
- anchors.left: tileLayout.left
- anchors.leftMargin: 20
- height:40
- width: 60
- text: "<"
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
deleted file mode 100644
index bc7545b6fd..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: layout
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias theX: listView.x
- property alias theY: listView.y
- property alias theWidth: listView.width
- property alias theHeight: listView.height
- property alias itemWidth: listView.gridItemWidth
- property alias itemHeight: listView.gridItemHeight
- property alias close: closeTouch
- property bool useClose: true
-
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
- GridViewWidget {
- id: listView
- x: 130; y: 170
- width: 540; height: 200
- gridItemHeight: 100; gridItemWidth: 180
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
-
-
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: layout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- visible: useClose
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: layout.horizontalCenter
- visible: useClose
- enabled: useClose
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
deleted file mode 100644
index 178fe6fc1a..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
+++ /dev/null
@@ -1,132 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias seekBkBtn: seekBkBtn
- property alias playBtn: playBtn
- property alias seekFdBtn: seekFdBtn
- property alias repeatBtn: repeatBtn
- property alias shuffleBtn: shuffleBtn
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 290
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: seekBkBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: playBtn.horizontalCenter
- anchors.horizontalCenterOffset: -150
- height:100
- width: 100
- text: "<<"
- }
-
- TouchButton{
- id: playBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: fmLayout.horizontalCenter
- height:120
- width: 120
- text: "||"
- }
-
- TouchButton{
- id: seekFdBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: playBtn.horizontalCenter
- anchors.horizontalCenterOffset: 150
- height:100
- width: 100
- text: ">>"
- }
-
- TouchButton{
- id: repeatBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: -35
- anchors.left: fmLayout.left
- anchors.leftMargin: 670
- height:40
- width: 55
- text: "rpt"
- }
-
- TouchButton{
- id: shuffleBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: repeatBtn.left
- height:40
- width: 55
- text: "sfl"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
deleted file mode 100644
index d82077b555..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
+++ /dev/null
@@ -1,155 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias trackNumTxt: trackNumTxt.text
- property alias artist: artistTxt.text
- property alias play: play.touchBtn
- property alias pause: pause.touchBtn
- property bool playing: true
-
-
-
-
- FWdgtImage{
- id: albumArt
- x:25
- y:176
- bitmap: "USB/albumArt.png"
- }
-
- TouchButton_PCA{
- id: sourceBtn
- x:25
- y:80
- textWidth: 100
- text: "FM Radio"
-
- }
-
- TouchButton_PCA{
- id: browseBtn
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- y:80
- textWidth: 75
- text: "Browse"
-
- }
-
- BaseText{
- id: trackNumTxt
- x:181
- y:188
- pxSize: 22
- text: "Track 13/ 16"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: trackTxt
- x:181
- y:225
- text: "The Dog Days Are Over"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 45
-
-
- }
-
- BaseText{
- id: artistTxt
- x:181
- y:280
- text: "Florence and the Machine"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
- }
-
-
- TouchButtonClimatePCA{
- id: play
- x:367
- y:390
- image: "USB/play_9_9.png"
- imagePressed: "USB/playPressed_9_9.png"
- visible: playing
- enabled: playing
- }
-
- TouchButtonClimatePCA{
- id: pause
- x:367
- y:390
- image: "USB/pause_9_9.png"
- imagePressed: "USB/pausePressed_9_9.png"
- visible: !playing
- enabled: !playing
- }
-
- TouchButtonClimatePCA{
- id: seekBack
- x:287
- y:399
- image: "USB/Prev_9_9.png"
- imagePressed: "USB/PrevPressed_9_9.png"
- }
-
- TouchButtonClimatePCA{
- id: seekNext
- x:463
- y:399
- image: "USB/Next_9_9.png"
- imagePressed: "USB/NextPressed_9_9.png"
- }
-
- Rectangle{
- x:92
- y: 365
- height:1
- width: 616
- color: "#1d81d5"
- }
-
- Rectangle{
- x:92
- y: 365
- height:1
- width: 138
- color: "white"
- }
-
- BaseText{
- id: elapsedTime
- x:25
- y:358
- text: "02:36"
- color: "white"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 18
- }
-
- BaseText{
- id: totTime
- y:358
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- horAlignment: Text.AlignRight
- text: "04:23"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 18
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
deleted file mode 100644
index 22e408c716..0000000000
--- a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
+++ /dev/null
@@ -1,373 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "Models"
-import "Widgets"
-import "Styles"
-
-Rectangle {
- width: 1360
- height: 768
- color: "black"
-
- // global events
- FEvent { id: cornerClicked }
- FEvent { id: closeNormalScreens }
-
- //global timers
- FTimer {id: testTimer; interval: 5000; repeat: false}
-
- // global datapools
- FDataPool {
- id: dataPool
-
- property string version: "V1.0.0"
- property string currSource: "FM"
- property string currStation: "91.9"
- property string currStatText: "WUOM"
- property string currSong: "Fresh Air"
- property string currAlbumArt: "album artRazorFish.png"
- property int layout: 2 //AM/FM:0, AMhd:1, FMhd:2, Sirius:3, USB:4, BT:5
- property int currFMpreset: 2
- property int currAMpreset: 1
- property int currSATpreset: 3
- property string curStationDT: ""
- property int statusBarChange: 0
- property int curFanSpeed: 1
- property int drvTemp: 70
- property int passTemp: 70
-
- property bool mainPCAmenuShown: false
-
-
- property string fm1pre1: "101.1"
- property string fm1pre2: "97.1"
- property string fm1pre3: "94.7"
- property string fm1pre4: "91.7"
- property string fm1pre5: "101.9"
- property string fm1pre6: "88.7"
-
- property string fm1stat1: "WRIF"
- property string fm1stat2: "WXYT"
- property string fm1stat3: "WCSX"
- property string fm1stat4: "WUOM"
- property string fm1stat5: "WDET"
- property string fm1stat6: "CIMX"
-
- property string fm1song1: "Ace of Spades"
- property string fm1song2: "Sports Talk"
- property string fm1song3: "Born to Run"
- property string fm1song4: "Fresh Air"
- property string fm1song5: "The Craig Fahle Show"
- property string fm1song6: "State of Love and Trust"
-
- property string fm2pre1: "101.1"
- property string fm2pre2: "97.1"
- property string fm2pre3: "94.7"
- property string fm2pre4: "91.7"
- property string fm2pre5: "101.9"
- property string fm2pre6: "88.7"
-
- property string fm2stat1: "WRIF"
- property string fm2stat2: "WXYT"
- property string fm2stat3: "WCSX"
- property string fm2stat4: "WUOM"
- property string fm2stat5: "WDET"
- property string fm2stat6: "CIMX"
-
- property string fm2song1: "Ace of Spades"
- property string fm2song2: "Sports Talk"
- property string fm2song3: "Born to Run"
- property string fm2song4: "Fresh Air"
- property string fm2song5: "The Craig Fahle Show"
- property string fm2song6: "State of Love and Trust"
-
- property string fm3pre1: "101.1"
- property string fm3pre2: "97.1"
- property string fm3pre3: "94.7"
- property string fm3pre4: "91.7"
- property string fm3pre5: "101.9"
- property string fm3pre6: "88.7"
-
- property string fm3stat1: "WRIF"
- property string fm3stat2: "WXYT"
- property string fm3stat3: "WCSX"
- property string fm3stat4: "WUOM"
- property string fm3stat5: "WDET"
- property string fm3stat6: "CIMX"
-
- property string fm3song1: "Ace of Spades"
- property string fm3song2: "Sports Talk"
- property string fm3song3: "Born to Run"
- property string fm3song4: "Fresh Air"
- property string fm3song5: "The Craig Fahle Show"
- property string fm3song6: "State of Love and Trust"
-
-
- /*List Filtered Variables*/
- property string navEnrty:""
- property string filter: ""
- property variant uniqueChars: undefined
- property string navList1stItem:""
- property string filterPhone:""
- }
-
- // global conditions
- FConditionPool {
- id: condPool
-
- property bool amfmActiveSource: true
- property bool settingsOpen: false
- property bool dualBtnSt: true
- property bool drvHeatSeatSt: false
- property bool drvCoolSeatSt: false
- property bool passCoolSeatSt: false
- property bool passHeatSeatSt: false
- property bool heatWheelSt: false
- property bool heatWinSheildSt: true
- property bool defrostSt: true
- property bool pannelSt: false
- property bool floorSt: false
-
- property bool showMenu: true
-
- }
-
-
- Component.onCompleted: {
- FThemeProvider.resourcePath = Qt.resolvedUrl("Resources");
- FThemeProvider.theme = "Theme1";
-
-
- }
- property QtObject filtermodel: ListModel {
- ListElement { staticItem: "Five Guys" }
- ListElement { staticItem: "Archers Of Loaf" }
- ListElement { staticItem: "Bob Mould" }
- ListElement { staticItem: "Cat Power" }
- ListElement { staticItem: "Cloud Nothings"}
- ListElement { staticItem: "Dentist"}
- ListElement { staticItem: "Dirty Frank's" }
- ListElement { staticItem: "Grouplove" }
- ListElement { staticItem: "Hudson Bell"}
- ListElement { staticItem: "Japandroids" }
- ListElement { staticItem: "Macklemore & Ryan Lewis"}
- ListElement { staticItem: "The National"}
- ListElement { staticItem: "Titus Andronicus" }
- ListElement { staticItem: "Tito" }
- ListElement { staticItem: "Tamal" }
- ListElement { staticItem: "Taco" }
- }
-
- QtObject{
- id:sortList
-
- //Check if char exist on Phone DataModel
- function existChar(model, character){
- //console.log(model.get(3).staticItem.charAt(0).toLowerCase())
- for (var i = 0; i < model.count; i++) {
- var u =model.get(i).staticItem.charAt(0).toLowerCase()
- if (character=== u){
- console.log(i)
- return i;
- }
-
- }
-
- }
-
- // Check whether given character exists in array
- function exist(array, character) {
- console.log(array[0]);
- for (var i = 0; i < array.length; i++) {
-
- if (array[i] == character) return true;
- }
- return false;
- }
-
- // Check whether given filter matches the string (e.g. "ce" would match "Cecilia")
- // The check is case-insensitive
- function checkFilter(filter, string) {
- if (filter.length > string.length) return false;
-
- var filterlower = filter.toLowerCase();
- var stringlower = string.toLowerCase();
-
- for (var i = 0; i < filter.length; i++) {
- if (filterlower[i] != stringlower[i])
- return false;
- }
-
- return true;
- }
-
- // Updates the filtermodel based on the current filter
- function updateFilterModel(name) {
- if (dataPool.filter.length > 0) {
- for (var i = filtermodel.count-1; i >= 0; i--) {
- if (!checkFilter(dataPool.filter, filtermodel.get(i).staticItem))
- filtermodel.remove(i)
- }
- }
-
- updateUniqueChars()
- }
-
- // Updates the array of unique first letters in the current index of the model
- function updateUniqueChars() {
-
- if (filtermodel.get(0) === undefined)
- {
- dataPool.navList1stItem=""
- return;
-
- }
-
- var characters = new Array();
-
- // If filter model has at most 1 item in it, no point in going
- // any further with filtering
- dataPool.navList1stItem=filtermodel.get(0).staticItem
- if (filtermodel.count > 1) {
-
- for (var i = 0; i < filtermodel.count; i++) {
- var name = filtermodel.get(i).staticItem;
-
- if (!exist(characters, name[dataPool.filter.length])) {
- characters.push(name[dataPool.filter.length])
- }
- }
-
- characters.sort()
-
-
- }
-
-
- dataPool.uniqueChars = characters
-
- }
-
-
- // Fills the filtermodel with contents from the source list's model
- function fillFilterModel(fullModel) {
- if (fullModel === undefined) return;
- filtermodel.clear();
- for (var i = 0; i < fullModel.count; i++) {
- filtermodel.append(fullModel.get(i))
- }
-
- }
-
- }
-
- FDisplay {
-
- /* modelPath:Qt.resolvedUrl(".")
- id: display
- //activeVariant: "ClassicTop"
- //activeVariant: "ClassicBottom"
- //activeVariant: "Tangier"
- viewCacheSize:0
-
- //width: 800
- //height: 480
-// xPixel: 800
-// yPixel: 480
- anchors.fill: parent
-// anchors { left: parent.left; top: parent.top;}
-
- priorityLayerCount: 9
- //initialView: "AutocompleteList"
- initialView: "Off"*/
-
-
-
- modelPath:Qt.resolvedUrl(".")
- id: display
- //activeVariant: "ClassicTop"
- //activeVariant: "ClassicBottom"
- //activeVariant: "Tangier"
- viewCacheSize:0
-
-
- width: 800
- height: 480
-
- xPixel: 800
- yPixel: 480
-
- anchors {
- horizontalCenter: parent.horizontalCenter;
- verticalCenter: parent.verticalCenter;
- verticalCenterOffset: 55
- }
-
- priorityLayerCount: 9
- initialView: "Off"
- //initialView: "NavTilesView"
- }
-
- Item
- {
- id: fHardwareKeybezel1
- width: 800
- height: 375
- x:10
- y:500
-
- // function keys
- TextHardkey {
- id: hk_OnOff
- width: 100
- height: 50
- anchors.left: parent.left
- anchors.leftMargin: 0
- anchors.top: parent.top
- anchors.topMargin: 0
- label: "On/Off"
- }
-
- BaseText {
- id: info
- text: dataPool.version
- color: "black"
- anchors.top: hk_OnOff.top
- anchors.left: hk_OnOff.right
- anchors.leftMargin: 20
- }
-
-
- FHardwareKey {
- id: buttonUp
- hardwareControlID: "buttonUp"
- //commName: "buttonBack"
-
- x:0
- y:0
- width: 60
- height:25
-
-
- keyboardKey: Qt.Key_Up
- visible: false
- }
-
- FHardwareKey {
- id: buttonDown
- hardwareControlID: "buttonDown"
- //commName: "buttonBack"
-
- x:0
- y:0
- width: 60
- height:25
-
-
- keyboardKey: Qt.Key_Down
- visible: false
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
deleted file mode 100644
index e9402cbac7..0000000000
--- a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.6.1 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "PCA_HMI_v1_0.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "plugins" ]
-}
diff --git a/src/components/qt_hmi/References/Look/Resources/CButton.png b/src/components/qt_hmi/References/Look/Resources/CButton.png
deleted file mode 100644
index aeebdb64ca..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/CButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd b/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
deleted file mode 100644
index 982bd5882c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png b/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
deleted file mode 100644
index 805236eaf6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Map.png b/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
deleted file mode 100644
index 4b39af9b22..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
deleted file mode 100644
index 601b242bbe..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
deleted file mode 100644
index 42c352a7e8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
deleted file mode 100644
index 46887f1061..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/compass.png b/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
deleted file mode 100644
index b78041307b..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
deleted file mode 100644
index 826b5faacf..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
deleted file mode 100644
index 56e35c759b..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
deleted file mode 100644
index dadcfe25cf..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
deleted file mode 100644
index 75c99bc4aa..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png b/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
deleted file mode 100644
index f37731f5af..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/OButton.png b/src/components/qt_hmi/References/Look/Resources/OButton.png
deleted file mode 100644
index 2811770953..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/OButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
deleted file mode 100644
index 9933dbcc72..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
deleted file mode 100644
index 672e57bf39..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
deleted file mode 100644
index cc9cb83ede..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png b/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
deleted file mode 100644
index efe0b7b586..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
deleted file mode 100644
index 6ed0293aab..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
deleted file mode 100644
index 375195bec3..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
deleted file mode 100644
index 99f5e90c3d..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
deleted file mode 100644
index d4db3f96ae..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png b/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
deleted file mode 100644
index 1422e00b42..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png b/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
deleted file mode 100644
index 3c1cad7c33..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
deleted file mode 100644
index 952714ebe6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
deleted file mode 100644
index aab3df8914..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
deleted file mode 100644
index c432068d4a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
deleted file mode 100644
index c6eefc09c9..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
deleted file mode 100644
index acc2a71de3..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png b/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
deleted file mode 100644
index 9000680276..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause.png b/src/components/qt_hmi/References/Look/Resources/USB/pause.png
deleted file mode 100644
index 71a7574d25..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pause.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
deleted file mode 100644
index a26cf2e4ea..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
deleted file mode 100644
index 417bdbf248..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
deleted file mode 100644
index ecbb4f2ef0..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
deleted file mode 100644
index f185e94461..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
deleted file mode 100644
index 94d5d44b5a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
deleted file mode 100644
index c5985043df..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
deleted file mode 100644
index a8e5d9d66c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
deleted file mode 100644
index 6424d9d210..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
deleted file mode 100644
index b0f8863423..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
deleted file mode 100644
index d264e201ad..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
deleted file mode 100644
index 3add8dd21c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
deleted file mode 100644
index e14b9fb751..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
deleted file mode 100644
index a2c1cb831a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
deleted file mode 100644
index 9a9ae59346..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
deleted file mode 100644
index f7306d96ae..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
deleted file mode 100644
index fd7606fbd6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
deleted file mode 100644
index 2b567e237e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
deleted file mode 100644
index 58c296a4e4..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
deleted file mode 100644
index c67d2c7c55..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
deleted file mode 100644
index 36bba93d8c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
deleted file mode 100644
index 0df4d25109..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
deleted file mode 100644
index 55e2cac50a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
deleted file mode 100644
index 9f84a139e6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
deleted file mode 100644
index 691f6e3bf8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
deleted file mode 100644
index 411f003938..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ring.png b/src/components/qt_hmi/References/Look/Resources/climate/ring.png
deleted file mode 100644
index 9908bf71be..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ring.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/dn-arrow.png b/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
deleted file mode 100644
index bb1322277d..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g136p.png b/src/components/qt_hmi/References/Look/Resources/g136p.png
deleted file mode 100644
index 1d49f184a1..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/g136p.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g137p.png b/src/components/qt_hmi/References/Look/Resources/g137p.png
deleted file mode 100644
index 8e674d75b7..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/g137p.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/arrow.png b/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
deleted file mode 100644
index 4c215b2bf7..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/car.png b/src/components/qt_hmi/References/Look/Resources/menu/car.png
deleted file mode 100644
index 18a21656d0..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/gear.png b/src/components/qt_hmi/References/Look/Resources/menu/gear.png
deleted file mode 100644
index b1eeba091c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/gear.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/notes.png b/src/components/qt_hmi/References/Look/Resources/menu/notes.png
deleted file mode 100644
index 8b4a92fffc..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/notes.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/phone.png b/src/components/qt_hmi/References/Look/Resources/menu/phone.png
deleted file mode 100644
index 346f36cc33..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/snow.png b/src/components/qt_hmi/References/Look/Resources/menu/snow.png
deleted file mode 100644
index 54756bb2f6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/snow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
deleted file mode 100644
index 04bb2476c1..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
deleted file mode 100644
index 56b9fe7065..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/contacts.png b/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
deleted file mode 100644
index a16d518ba8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/keypad.png b/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
deleted file mode 100644
index 1792c8fac8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/messages.png b/src/components/qt_hmi/References/Look/Resources/phone/messages.png
deleted file mode 100644
index b5cbb8e8af..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/messages.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/more.png b/src/components/qt_hmi/References/Look/Resources/phone/more.png
deleted file mode 100644
index 908ebf654e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/more.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/recent.png b/src/components/qt_hmi/References/Look/Resources/phone/recent.png
deleted file mode 100644
index db54c2f16e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/recent.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/texts.png b/src/components/qt_hmi/References/Look/Resources/phone/texts.png
deleted file mode 100644
index 31c024b1df..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/texts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/scrollbar.png b/src/components/qt_hmi/References/Look/Resources/scrollbar.png
deleted file mode 100644
index c849382ae2..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/scrollbar.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/slider.png b/src/components/qt_hmi/References/Look/Resources/slider.png
deleted file mode 100644
index 83c54f854a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/slider.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/up-arrow.png b/src/components/qt_hmi/References/Look/Resources/up-arrow.png
deleted file mode 100644
index b0e710a409..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/up-arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/TextHardkey.qml b/src/components/qt_hmi/References/Look/TextHardkey.qml
deleted file mode 100644
index b73b991164..0000000000
--- a/src/components/qt_hmi/References/Look/TextHardkey.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "Widgets"
-
-FHardwareKey {
- width: 50
- height: 50
-
- property alias label : theText.text
-
- Rectangle {
- anchors.fill: parent
- border.color: "black"
- border.width: 1
- radius: 10
- smooth: true
-
- gradient: Gradient {
- GradientStop {
- id: s1
- color: "#FF646464"
- position: 0.0
- }
- GradientStop {
- id: s2
- color: "#FF484848"
- position: 0.8
- }
- GradientStop {
- id: s3
- color: "#FF323232"
- position: 1.0
- }
- }
- }
-
- CondText {
- id: theText
- anchors.fill: parent
- horizontalAlignment: Text.AlignHCenter
-
- }
-
-
- FViewUseCaseSimple {
- condition: pressed === true
- PropertyChanges { target: s1; position: 1.0 }
- PropertyChanges { target: s2; position: 0.2}
- PropertyChanges { target: s3; position: 0.0 }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AM.qml b/src/components/qt_hmi/References/Look/Views/AM.qml
deleted file mode 100644
index 2ed7d8085d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AM.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayout {
- id:home
- albumInfoBtn.vis: false
- albumInfoImg.visible: false
- alertBtn.vis: false
- browseBtn.vis: false
- replayBtn.vis: false
- preset1Btn.text: "WJR"
- preset2Btn.text: "1130"
- preset3Btn.text: "950"
- preset4Btn.text: "WWJ"
- preset5Btn.text: "WXYZ"
- preset6Btn.text: "1330"
- artistTxt.text: ""
- stationTxt.text: ""
- trackTxt.text: "950"
-
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AMPCA.qml b/src/components/qt_hmi/References/Look/Views/AMPCA.qml
deleted file mode 100644
index 9a0a99f832..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AMPCA.qml
+++ /dev/null
@@ -1,122 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "AM Radio"
- freqId: "AM"
- sourceBtn.textWidth: 100
- curPreset: dataPool.currAMpreset
- hdBtn.visible: false
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "1130"; menuData: false; }
- FMenuElement { id: preset2; menuText: "950"; menuData: false }
- FMenuElement { id: preset3; menuText: "760"; menuData: true }
- FMenuElement { id: preset4; menuText: "1270"; menuData: false }
- FMenuElement { id: preset5; menuText: "1310"; menuData: false }
- FMenuElement { id: preset6; menuText: "800"; menuData: false }
- FMenuElement { id: preset7; menuText: "610"; menuData: false }
- FMenuElement { id: preset8; menuText: "820"; menuData: false}
- }
- }
-
-
-
- triggers: [
-
-
-
- FTrgEntry{
- FGrdCondition{condition: dataPool.currAMpreset === 1
- FActScriptCall { onScript: home.stationTxt = "1130" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 2
- FActScriptCall { onScript: home.stationTxt = "950" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 3
- FActScriptCall { onScript: home.stationTxt = "760" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 4
- FActScriptCall { onScript: home.stationTxt = "1270" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 5
- FActScriptCall { onScript: home.stationTxt = "1310" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 6
- FActScriptCall { onScript: home.stationTxt = "800" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 7
- FActScriptCall { onScript: home.stationTxt = "610" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 8
- FActScriptCall { onScript: home.stationTxt = "820" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "1130" }
- FActScriptCall { onScript: dataPool.currAMpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "950" }
- FActScriptCall { onScript: dataPool.currAMpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "760" }
- FActScriptCall { onScript: dataPool.currAMpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "1270" }
- FActScriptCall { onScript: dataPool.currAMpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "1310" }
- FActScriptCall { onScript: dataPool.currAMpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "800" }
- FActScriptCall { onScript: dataPool.currAMpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "610" }
- FActScriptCall { onScript: dataPool.currAMpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "820" }
- FActScriptCall { onScript: dataPool.currAMpreset = 8 }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml b/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
deleted file mode 100644
index 0158451113..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
-
-
- view: FView {
- id: v
-
- layout: AlphaSortLayout {
- id:home
- phonEntry: dataPool.filterPhone
-
- }
-
-
- }
-
- triggers: [
-
- FTrgEntry{
- FActScriptCall { onScript: dataPool.filterPhone= ""}
- },
- FTrgTouchArea { touchArea:home.a; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "a"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.b; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "b"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.c; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "c"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.d; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "d"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.e; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "e"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.f; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "f"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.g; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "g"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.h; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "h"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.i; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "i"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.j; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "j"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.k; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "k"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.l; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "l"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.m; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "m"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.n; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "n"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.o; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "o"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.p; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "p"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.q; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "q"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.r; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "r"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.s; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "s"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.t; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "t"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.u; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "u"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.v; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "v"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.w; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "w"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.xB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "x"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.yB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "y"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.zB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "z"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.num; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "a"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.close; touchAction: TA.Out
-
- FActViewShow { view: "PhonePCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AuxPCA.qml b/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
deleted file mode 100644
index 478d1e55d9..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "Line In"
- sourceBtn.textWidth: 90
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml b/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
deleted file mode 100644
index 83a83147f0..0000000000
--- a/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "BT Audio"
- sourceBtn.textWidth: 100
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/CDPCA.qml b/src/components/qt_hmi/References/Look/Views/CDPCA.qml
deleted file mode 100644
index bc6e6ab2fd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/CDPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "CD"
- sourceBtn.textWidth: 40
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Chrome.qml b/src/components/qt_hmi/References/Look/Views/Chrome.qml
deleted file mode 100644
index e8029fb10a..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Chrome.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 8
-
-
-
- view: FView {
- id: v
-
- layout: ChromeLayout {
- id:chrome
- button2.indicatorState: condPool.settingsOpen
-
- }
-
-
- }
-
- /*FViewUseCaseSimple{condition:condPool.settingsOpen
- PropertyChanges {
- target: chrome.button2; indicatorState: true
- }
- }*/
-
- triggers: [
- FTrgEntry {
-
- },
-
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },
- FTrgTouchArea { touchArea:chrome.button1; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:chrome.button2; touchAction: TA.Out
- FActViewShow { view: "List" }
- },
- FTrgTouchArea { touchArea:chrome.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml b/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
deleted file mode 100644
index 812e6afac3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: ClimatePCALayout {
- id:climate
- dualBtnSt: condPool.dualBtnSt
- drvHeatSeatSt: condPool.drvHeatSeatSt
- drvCoolSeatSt: condPool.drvCoolSeatSt
- passCoolSeatSt: condPool.passCoolSeatSt
- passHeatSeatSt: condPool.passHeatSeatSt
- heatWheelSt: condPool.heatWheelSt
- heatWinSheildSt: condPool.heatWinSheildSt
- defrostSt: condPool.defrostSt
- pannelSt: condPool.pannelSt
- floorSt: condPool.floorSt
-
- }
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:climate.dualBtn; touchAction: TA.Out
- FActScriptCall { onScript: condPool.dualBtnSt = !condPool.dualBtnSt }
- },
- FTrgTouchArea { touchArea:climate.drvHeatSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.drvHeatSeatSt = !condPool.drvHeatSeatSt }
- },
- FTrgTouchArea { touchArea:climate.drvCoolSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.drvCoolSeatSt = !condPool.drvCoolSeatSt }
- },
- FTrgTouchArea { touchArea:climate.passCoolSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.passCoolSeatSt = !condPool.passCoolSeatSt }
- },
- FTrgTouchArea { touchArea:climate.passHeatSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.passHeatSeatSt = !condPool.passHeatSeatSt }
- },
- FTrgTouchArea { touchArea:climate.heatWheel; touchAction: TA.Out
- FActScriptCall { onScript: condPool.heatWheelSt = !condPool.heatWheelSt }
- },
- FTrgTouchArea { touchArea:climate.heatWinSheild; touchAction: TA.Out
- FActScriptCall { onScript: condPool.heatWinSheildSt = !condPool.heatWinSheildSt }
- },
- FTrgTouchArea { touchArea:climate.defrost; touchAction: TA.Out
- FActScriptCall { onScript: condPool.defrostSt = !condPool.defrostSt }
- },
- FTrgTouchArea { touchArea:climate.pannel; touchAction: TA.Out
- FActScriptCall { onScript: condPool.pannelSt = !condPool.pannelSt }
- },
- FTrgTouchArea { touchArea:climate.floor; touchAction: TA.Out
- FActScriptCall { onScript: condPool.floorSt = !condPool.floorSt }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/ControlMirror.qml b/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
deleted file mode 100644
index 4cd1472c0d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 5
- property string dirTuneEntry: ""
-
-
- FTimer { id: popupEnd; interval: 2500; repeat: false }
-
- view: FView {
- id: v
-
- layout: ControlMirrorLayout {
- id:home
- }
-
-
- }
-
-
-
-
- triggers: [
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },
- FTrgEntry{
- FActTimer { timer: popupEnd; action: TM.Start }
- },
- FTrgTimer{timer: popupEnd
- FActTimer { timer: popupEnd; action: TM.Stop }
- FActViewHide { }
- },
- FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
- FActTimer { timer: popupEnd; action: TM.Restart }
- // FActScriptCall { onScript: condPool.climateOnOff = true }
- FGrdCondition { condition: dataPool.drvTemp !== 80
- FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp+1) }
- }
- },
- FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
- FActTimer { timer: popupEnd; action: TM.Restart }
- // FActScriptCall { onScript: condPool.climateOnOff = true }
- FGrdCondition { condition: dataPool.drvTemp !== 65
- FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp-1) }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/FM.qml b/src/components/qt_hmi/References/Look/Views/FM.qml
deleted file mode 100644
index 6aa98303bd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/FM.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayout {
- id:home
- preset1Btn.text: dataPool.fm1pre1
- preset2Btn.text: dataPool.fm1pre2
- preset3Btn.text: dataPool.fm1pre3
- preset4Btn.text: dataPool.fm1pre4
- preset5Btn.text: dataPool.fm1pre5
- preset6Btn.text: dataPool.fm1pre6
- trackTxt.text: dataPool.currStation
- stationTxt.text: dataPool.currStatText
- artistTxt.text: dataPool.currSong
- albumInfoBtn.bitmap: dataPool.currAlbumArt
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/FMPCA.qml b/src/components/qt_hmi/References/Look/Views/FMPCA.qml
deleted file mode 100644
index 1e9a46a0b3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/FMPCA.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
- property int currHD: 1
- property int totalHD: 4
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "FM Radio"
- sourceBtn.textWidth: 100
- freqId: "FM"
- curHD: currHD
- totHD: totalHD
- curPreset: dataPool.currFMpreset
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
- FMenuElement { id: preset2; menuText: "107.9"; menuData: false }
- FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
- FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
- FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
- FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
- FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
- FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
- }
- }
-
-
- triggers: [
-
- FTrgCondition{ condition: home.moving === true
- FActScriptCall { onScript: home.page1=!home.page1 }
- },
- FTrgEntry{
- FGrdCondition{condition: dataPool.currFMpreset === 1
- FActScriptCall { onScript: home.stationTxt = "96.3" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 2
- FActScriptCall { onScript: home.stationTxt = "107.9" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 3
- FActScriptCall { onScript: home.stationTxt = "104.3" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 4
- FActScriptCall { onScript: home.stationTxt = "101.9" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 5
- FActScriptCall { onScript: home.stationTxt = "97.1" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 6
- FActScriptCall { onScript: home.stationTxt = "91.7" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 7
- FActScriptCall { onScript: home.stationTxt = "101.1" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 8
- FActScriptCall { onScript: home.stationTxt = "91.9" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.hdBtn.touchBtn; touchAction: TA.Out
- FGrdCondition { condition: currHD === totalHD
- FActScriptCall { onScript: currHD = 1 }
- }
- FGrdCondition { condition: currHD !== totalHD
- FActScriptCall { onScript: currHD ++}
- }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "96.3" }
- FActScriptCall { onScript: dataPool.currFMpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "107.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "104.3" }
- FActScriptCall { onScript: dataPool.currFMpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "101.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "97.1" }
- FActScriptCall { onScript: dataPool.currFMpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "91.7" }
- FActScriptCall { onScript: dataPool.currFMpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "101.1" }
- FActScriptCall { onScript: dataPool.currFMpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "91.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 8 }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- /*FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
-
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },*/
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/GenListHandling.qml b/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
deleted file mode 100644
index 9abdb899fc..0000000000
--- a/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FState {
-
-
- triggers: [
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml b/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
deleted file mode 100644
index fd43775f0d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
- itemWidth: 266
-
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
- width: 266
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: climate; menuIcon: "menu/snow.png"}
- FMenuElement { id: phone; menuIcon: "menu/phone.png" }
- FMenuElement { id: navigation; menuIcon: "menu/arrow.png" }
- FMenuElement { id: myVeh; menuIcon: "menu/car.png" }
- FMenuElement { id: entertainment; menuIcon: "menu/notes.png" }
- FMenuElement { id: settings; menuIcon: "menu/gear.png" }
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: climate
- FActViewShow { view: "ClimatePCA" }
- },
- FTrgMenuElement { menuElement: phone
- FActViewShow { view: "PhonePCA" }
- },
- FTrgMenuElement { menuElement: navigation
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgMenuElement { menuElement: myVeh
- FActViewShow { view: "MyVehiclePCA" }
- },
- FTrgMenuElement { menuElement: entertainment
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: settings
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: dataPool.mainPCAmenuShown = true }
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: dataPool.mainPCAmenuShown = false }
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Home.qml b/src/components/qt_hmi/References/Look/Views/Home.qml
deleted file mode 100644
index 3a7edc353d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Home.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: HomeLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:home.button1; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.button2; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:home.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.button4; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/List.qml b/src/components/qt_hmi/References/Look/Views/List.qml
deleted file mode 100644
index 5f63b77461..0000000000
--- a/src/components/qt_hmi/References/Look/Views/List.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
-
- view: FView {
- id: v
-
- layout: ListLayout {
- id:list
-
-
- listWrap: true
- list_data: menuItemData
- list_itemWidget: MenuListItemWidget { }
-
- }
-
-
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: menuAudio; menuText: "Audio Settings"; menuType: FMenuElement.Submenu
- FMenuElement { id: menuAudio1; menuText: "Audio 1"; menuType: FMenuElement.Submenu
- FMenuElement { id: menuAudio11; menuText: "Audio 11"; menuType: FMenuElement.Popup }
- FMenuElement { id: menuAudio12; menuText: "Audio 12"; menuType: FMenuElement.Popup }
- }
- FMenuElement { id: menuAudio2; menuText: "Audio 2"; menuType: FMenuElement.Popup }
- FMenuElement { id: menuAudio3; menuText: "Audio 3"; menuType: FMenuElement.Popup }
- }
- FMenuElement { id: menuVehicle; menuText: "Vehicle Settings"; menuType: FMenuElement.Submenu; isVisible: false }
- FMenuElement { id: menuClock; menuText: "Clock Settings"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuDisplay; menuText: "Display Settings"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuMC; menuText: "Message Centre"; menuType: FMenuElement.Popup }
- }
-
- triggers: [
- FTrgEntry {
- FActScriptCall {onScript: condPool.settingsOpen=true}
-
- },
- FTrgExit {
- FActScriptCall {onScript: condPool.settingsOpen=false}
- },
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },
-
-
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: menuAudio
- FActScriptCall { onScript: menuAudio.isOpened = !menuAudio.isOpened }
- },
- // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml b/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
deleted file mode 100644
index ce477a12a7..0000000000
--- a/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TC1_B1_Grid {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: menuAudio; menuText: "AM"; menuType: FMenuElement.Submenu}
- FMenuElement { id: menuVehicle; menuText: "FM"; menuType: FMenuElement.Submenu; isVisible: false}
- FMenuElement { id: menuClock; menuText: "Sirius"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuDisplay; menuText: "CD"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuMC; menuText: "BT Audio"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "USB"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 2"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 3"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 4"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 5"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 6"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 7"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 8"; menuType: FMenuElement.Popup }
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: menuAudio
- FGrdCondition { condition: menuAudio.isEnabled
- FActViewShow { view: "MenuAudioSettings"; animation: "AnimWiperRight" }
- }
- },
- FTrgMenuElement { menuElement: menuClock
- FActViewShow { view: "MenuTopLevelMenu" }
- },
- FTrgMenuElement { menuElement: menuVehicle
- FActViewShow { view: "MenuTopLevelMenu"; animation: "AnimWiperRight" }
- },
- // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml b/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
deleted file mode 100644
index 6ecc512b60..0000000000
--- a/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
-
-
- //useClose: true
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: ev; menuIcon: "Vehicle/EV Icon.png"}
- FMenuElement { id: aLight; menuIcon: "Vehicle/Ambient Lighti Icon.png" }
- FMenuElement { id: mcs; menuIcon: "Vehicle/MCS Icon.png" }
- FMenuElement { id: weather; menuIcon: "Vehicle/sun.png" }
- FMenuElement { id: kepad; menuIcon: "Vehicle/key_car.png" }
- FMenuElement { id: calendar; menuIcon: "Vehicle/cal.png" }
- FMenuElement { id: browse; menuIcon: "Vehicle/folders.png" }
- FMenuElement { id: syncServices; menuIcon: "Vehicle/SYNC Services.png"}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: ev
- },
- FTrgMenuElement { menuElement: aLight
- },
- FTrgMenuElement { menuElement: mcs
- },
- FTrgMenuElement { menuElement: weather
- },
- FTrgMenuElement { menuElement: kepad
- },
- FTrgMenuElement { menuElement: calendar
- },
- FTrgMenuElement { menuElement: browse
- },
- FTrgMenuElement { menuElement: syncServices
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavInRoute.qml b/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
deleted file mode 100644
index e21d60a3cd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: NavInRouteLayout {
- id:map
-
-
- }
-
- }
-
-
-
- triggers: [
- FTrgTouchArea { touchArea:map.cancel; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgTouchArea { touchArea:map.mute; touchAction: TA.Out
- FActScriptCall { onScript: { map.muteSt = !map.muteSt} }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml b/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
deleted file mode 100644
index a3499f89d3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
+++ /dev/null
@@ -1,159 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
- view: FView {
- id: v
-
- layout: NavKeyboardLayout {
- id:nav
- entry:dataPool.navEnrty
- list_data:sItemData
- list_itemWidget: VerySimpleListItemWidget {
- vis: false
-
- }
- }
-
- }
- ListModel
- {
-
- id:sItemData
- ListElement { staticItem: "Five Guys" }
- ListElement { staticItem: "Archers Of Loaf" }
- ListElement { staticItem: "Bob Mould" }
- ListElement { staticItem: "Cat Power" }
- ListElement { staticItem: "Cloud Nothings"}
- ListElement { staticItem: "Dentist"}
- ListElement { staticItem: "Dirty Frank's" }
- ListElement { staticItem: "Grouplove" }
- ListElement { staticItem: "Hudson Bell"}
- ListElement { staticItem: "Japandroids" }
- ListElement { staticItem: "Macklemore & Ryan Lewis"}
- ListElement { staticItem: "The National"}
- ListElement { staticItem: "Titus Andronicus" }
- ListElement { staticItem: "Tito" }
- ListElement { staticItem: "Tamal" }
- ListElement { staticItem: "Taco" }
-
- }
-
- triggers: [
-
- FTrgTouchArea { touchArea:nav.listOpen; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= ""}
- FActViewShow { view: "NavInRoute" }
- },
- FTrgTouchArea { touchArea:nav.a; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"a"}
- },
- FTrgTouchArea { touchArea:nav.b; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"b"}
- },
- FTrgTouchArea { touchArea:nav.c; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"c"}
- },
- FTrgTouchArea { touchArea:nav.d; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"d"}
- },
- FTrgTouchArea { touchArea:nav.e; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"e"}
- },
- FTrgTouchArea { touchArea:nav.f; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"f"}
- },
- FTrgTouchArea { touchArea:nav.g; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"g"}
- },
- FTrgTouchArea { touchArea:nav.h; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"h"}
- },
- FTrgTouchArea { touchArea:nav.i; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"i"}
- },
- FTrgTouchArea { touchArea:nav.j; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"j"}
- },
- FTrgTouchArea { touchArea:nav.k; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"k"}
- },
- FTrgTouchArea { touchArea:nav.l; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"l"}
- },
- FTrgTouchArea { touchArea:nav.m; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"m"}
- },
- FTrgTouchArea { touchArea:nav.n; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"n"}
- },
- FTrgTouchArea { touchArea:nav.o; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"o"}
- },
- FTrgTouchArea { touchArea:nav.p; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"p"}
- },
- FTrgTouchArea { touchArea:nav.q; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"q"}
- },
- FTrgTouchArea { touchArea:nav.r; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"r"}
- },
- FTrgTouchArea { touchArea:nav.s; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"s"}
- },
- FTrgTouchArea { touchArea:nav.t; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"t"}
- },
- FTrgTouchArea { touchArea:nav.u; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"u"}
- },
- FTrgTouchArea { touchArea:nav.v; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"v"}
- },
- FTrgTouchArea { touchArea:nav.w; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"w"}
- },
- FTrgTouchArea { touchArea:nav.xB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"x"}
- },
- FTrgTouchArea { touchArea:nav.yB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"y"}
- },
- FTrgTouchArea { touchArea:nav.zB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"z"}
- },
- FTrgTouchArea { touchArea:nav.num; touchAction: TA.Out
- },
- FTrgTouchArea { touchArea:nav.clr; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= ""}
- },
- FTrgTouchArea { touchArea:nav.space; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+" "}
- },
- FTrgTouchArea { touchArea:nav.del; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty.substring(0,dataPool.navEnrty.length-1)}
- },
- FTrgTouchArea { touchArea:nav.sym; touchAction: TA.Out
- },
- FTrgTouchArea { touchArea:nav.go; touchAction: TA.Out
- FActViewShow { view: "NavInRoute" }
- },
- FTrgTouchArea { touchArea:nav.close; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavMenu.qml b/src/components/qt_hmi/References/Look/Views/NavMenu.qml
deleted file mode 100644
index 8d22aa77ea..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavMenu.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: sourceAM; menuText: "Home"; }
- FMenuElement { id: sourceFM; menuText: "Work"; }
- FMenuElement { id: sourceCD; menuText: "Keyboard"; }
- FMenuElement { id: sourceSat; menuText: "Recent"; }
- FMenuElement { id: sourceBt; menuText: "Favorites"; }
- FMenuElement { id: sourceIpod; menuText: "POI"; }
- FMenuElement { id: sourceUSB; menuText: "Scout"; }
- FMenuElement { id: sourceLineIn; menuText: "Waze";}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: sourceAM
- },
- FTrgMenuElement { menuElement: sourceFM
- },
- FTrgMenuElement { menuElement: sourceSat
- },
- FTrgMenuElement { menuElement: sourceCD
- FActViewShow { view: "NavKeyboardPCA" }
- },
- FTrgMenuElement { menuElement: sourceBt
- },
- FTrgMenuElement { menuElement: sourceIpod
- },
- FTrgMenuElement { menuElement: sourceUSB
- },
- FTrgMenuElement { menuElement: sourceLineIn
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml b/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
deleted file mode 100644
index 0299c182e8..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: NavNoRouteLayout {
- id:map
-
-
- }
-
- }
-
-
-
- triggers: [
- FTrgTouchArea { touchArea:map.destSearch; touchAction: TA.Out
- FActViewShow { view: "NavMenu" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Off.qml b/src/components/qt_hmi/References/Look/Views/Off.qml
deleted file mode 100644
index 3e75999c66..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Off.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 1
-
- view: FView {
- layout: OffLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActViewShow { view: "On" }
- },
- FTrgTouchArea { touchArea:l.offTouch; touchAction: TA.Out
- FActViewShow { view: "On" }
- },
- /*FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },*/
- FTrgEntry {
- //FActScriptCall { onScript: dataPool.phoneCrnIcons = false}
- //FActScriptCall { onScript: dataPool.phonePaired = false}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/On.qml b/src/components/qt_hmi/References/Look/Views/On.qml
deleted file mode 100644
index 6e09534309..0000000000
--- a/src/components/qt_hmi/References/Look/Views/On.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 1
-
- view: FView {
- layout: OffLayout {
- id:l
- offTouch.enabled: false
- }
- }
-
- triggers: [
- FTrgEntry {
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewShow { view: "Off" }
- },
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- //FActViewShow { view: "Off" }
- FActEventFire{ event: closeNormalScreens }
- },
- FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
- FActViewShow { view: "ControlMirror" }
- },
- FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
- FActViewShow { view: "ControlMirror" }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml b/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
deleted file mode 100644
index e235f9c159..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 8
-
-
- view: FView {
- id: v
-
- layout: PCAstatusBarLayout {
- id:statusBar
-
- }
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:statusBar.menuTouch; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml b/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
deleted file mode 100644
index f64062f3ab..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-
-FStateView {
- priority: 2
- view: FView {
- layout: PhoneContactsLayout {
- id:l
- list_data:phoneItemData
- list_itemWidget: PhoneContactListItemWdgt {
- itemClicked: childClicked
-
- }
- }
- }
-
- FEvent {id: browseSelected}
-
- ListModel
- {
-
- id:phoneItemData
- ListElement { staticItem: "Aaron" ; staticNumber:"(614)555-2444";type:"Mobile"}
- ListElement { staticItem: "Adrian" ; staticNumber:"(740)245-3434";type:"Mobile" }
- ListElement { staticItem: "Albert" ; staticNumber:"(614)245-5584";type:"Mobile" }
- ListElement { staticItem: "Alice" ; staticNumber:"(313)878-3566";type:"Office"}
- ListElement { staticItem: "Alec" ; staticNumber:"(917)608-2418";type:"Mobile"}
- ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Home"}
- ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Mobile"}
- ListElement { staticItem: "Amber" ; staticNumber:"(614)608-2111";type:"Mobile"}
- ListElement { staticItem: "Amy" ; staticNumber:"(440)245-3434";type:"Mobile" }
- ListElement { staticItem: "Andy" ; staticNumber:"(313)245-3434";type:"Mobile" }
- ListElement { staticItem: "Antje" ; staticNumber:"(567)245-3434";type:"Home" }
- ListElement { staticItem: "Barry" ; staticNumber:"(313)555-2211";type:"Mobile" }
- ListElement { staticItem: "Bea" ; staticNumber:"(614)455-3434";type:"Mobile" }
- ListElement { staticItem: "Ben" ; staticNumber:"(614)882-1843";type:"Office" }
- ListElement { staticItem: "Blake" ; staticNumber:"(330)149-7778";type:"Mobile" }
- ListElement { staticItem: "Bob Mould" ; staticNumber:"(313)245-3434";type:"Mobile" }
- ListElement { staticItem: "Brian" ; staticNumber:"(614)332-7499";type:"Mobile" }
- ListElement { staticItem: "Calvin" ; staticNumber:"(614)442-9974";type:"Mobile" }
- ListElement { staticItem: "Carl" ; staticNumber:"(567)773-3434";type:"Home" }
- ListElement { staticItem: "Cat Power" ; staticNumber:"(313)608-3434";type:"Home"}
- ListElement { staticItem: "Cathy" ; staticNumber:"(313)444-456";type:"Home"}
- ListElement { staticItem: "Chris" ; staticNumber:"(734)997-6514";type:"Home" }
- ListElement { staticItem: "Cloud Nothings"; staticNumber:"(444)608-543";type:"Mobile"}
- ListElement { staticItem: "Cody" ; staticNumber:"(567)365-8413";type:"Home" }
- ListElement { staticItem: "Curtis" ; staticNumber:"(614)245-1547";type:"Office" }
- ListElement { staticItem: "Dakota" ; staticNumber:"(567)555-4444";type:"Home" }
- ListElement { staticItem: "Dale" ; staticNumber:"(567)723-1974";type:"Mobile" }
- ListElement { staticItem: "Dallas"; staticNumber:"(614)556-879";type:"Home"}
- ListElement { staticItem: "Damian" ; staticNumber:"(614)245-3434";type:"Office" }
- ListElement { staticItem: "Daniel"; staticNumber:"(614)556-879";type:"Home"}
- ListElement { staticItem: "Darina"; staticNumber:"(313)895-888";type:"Mobile"}
- ListElement { staticItem: "Dee "; staticNumber:"(313)432-3434";type:"Home"}
- ListElement { staticItem: "Edward" ; staticNumber:"(917)608-975";type:"Office"}
- ListElement { staticItem: "Ferdinand" ; staticNumber:"(917)879-795";type:"Mobile"}
- ListElement { staticItem: "Gomez" ; staticNumber:"(313)455-543";type:"Mobile"}
- ListElement { staticItem: "Harry Potter"; staticNumber:"(313)888-432";type:"Home"}
- ListElement { staticItem: "Ivan"; staticNumber:"(313)996-225";type:"Home"}
- ListElement { staticItem: "James" ; staticNumber:"(917)608-3434";type:"Mobile"}
- ListElement { staticItem: "Karen"; staticNumber:"(313)998-332";type:"Home"}
- ListElement { staticItem: "Luis Torres"; staticNumber:"(313)779-111";type:"Home"}
- ListElement { staticItem: "Mary"; staticNumber:"(313)234-098";type:"Mobile"}
- ListElement { staticItem: "Neil"; staticNumber:"(313)444-112";type:"Mobile"}
- ListElement { staticItem: "Oswald"; staticNumber:"(313)456-921";type:"Mobile"}
- ListElement { staticItem: "Oscar"; staticNumber:"(313)332-778";type:"Home"}
- ListElement { staticItem: "Patrice"; staticNumber:"(313)789-111";type:"Mobile"}
- ListElement { staticItem: "Queen Elizabeth"; staticNumber:"(313)897-666";type:"Mobile"}
- ListElement { staticItem: "Rose"; staticNumber:"(313)111-211";type:"Mobile"}
- ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
- ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
- ListElement { staticItem: "Thomas"; staticNumber:"(917)608-342";type:"Mobile"}
- ListElement { staticItem: "Titus Andronicus" ; staticNumber:"(917)608-321";type:"Office"}
- ListElement { staticItem: "Toretto" ; staticNumber:"(917)608-3434";type:"Home"}
- ListElement { staticItem: "Uhl" ; staticNumber:"(313)444-654";type:"Office"}
- ListElement { staticItem: "Zara" ; staticNumber:"(313)231-009";type:"Mobile"}
-
- }
- FEvent { id: childClicked }
-
- triggers:[
- FTrgEntry {
- FActScriptCall{onScript: l.list.positionViewAtIndex(sortList.existChar(phoneItemData,dataPool.filterPhone),l.list.Beginning)}
- },
- FTrgTouchArea { touchArea:l.back; touchAction: TA.Out
- FActViewShow { view: "AlphaSortPCA" }
- },
- FTrgEvent { id: trig2; event: childClicked
- FActScriptCall { onScript:console.log(trig2.data) }
- }
-
-
-
- ]
-
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PhonePCA.qml b/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
deleted file mode 100644
index 40969a3a64..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
-
- //useClose: true
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: phone; menuIcon: "menu/phone.png"}
- FMenuElement { id: dnd; menuIcon: "phone/DNDoff.png" }
- FMenuElement { id: phoneBook; menuIcon: "phone/contacts.png" }
- FMenuElement { id: recent; menuIcon: "phone/recent.png" }
- FMenuElement { id: messages; menuIcon: "phone/messages.png" }
- FMenuElement { id: keyPad; menuIcon: "phone/keypad.png" }
- FMenuElement { id: textMsg; menuIcon: "phone/texts.png" }
- FMenuElement { id: more; menuIcon: "phone/more.png"}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: phone
- },
- FTrgMenuElement { menuElement: dnd
- },
- FTrgMenuElement { menuElement: phoneBook
- FActViewShow { view: "AlphaSortPCA" }
- },
- FTrgMenuElement { menuElement: recent
- },
- FTrgMenuElement { menuElement: more
- },
- FTrgMenuElement { menuElement: messages
- },
- FTrgMenuElement { menuElement: keyPad
- },
- FTrgMenuElement { menuElement: textMsg
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
deleted file mode 100644
index ef693d924c..0000000000
--- a/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 0
-
- view: FView {
- layout: BlankLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgEntry {
- FGrdCondition{ condition: dataPool.currSource==="FM"
- FActViewShow{ view: "FMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="USB"
- FActViewShow{ view: "USB"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="AM"
- FActViewShow{ view: "AM"}
- FActViewHide{}
- }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
deleted file mode 100644
index 90bf0a801a..0000000000
--- a/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 0
-
- view: FView {
- layout: BlankLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgEntry {
- FGrdCondition{ condition: dataPool.currSource==="FM"
- FActViewShow{ view: "FMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="USB"
- FActViewShow{ view: "USBPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="AM"
- FActViewShow{ view: "AMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="Sirius"
- FActViewShow{ view: "SiriusPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="CD"
- FActViewShow{ view: "CDPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="BT_Audio"
- FActViewShow{ view: "BT_AudioPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="iPod"
- FActViewShow{ view: "iPodPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="LineIn"
- FActViewShow{ view: "AuxPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="SDL_Music"
- FActViewShow{ view: "SDL_MusicPCA"}
- FActViewHide{}
- }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml b/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
deleted file mode 100644
index a68956518b..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "SDL Music"
- sourceBtn.textWidth: 100
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Sirius.qml b/src/components/qt_hmi/References/Look/Views/Sirius.qml
deleted file mode 100644
index bf16b810a5..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Sirius.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: SiriusLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml b/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
deleted file mode 100644
index afb5c42fc7..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "Sirius"
- sourceBtn.textWidth: 70
- freqId: ""
- curPreset: dataPool.currSATpreset
- hdBtn.visible: false
-
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "Lithium"; menuData: true; }
- FMenuElement { id: preset2; menuText: "Spectrum"; menuData: false }
- FMenuElement { id: preset3; menuText: "ESPN"; menuData: false }
- FMenuElement { id: preset4; menuText: "Alt Nation"; menuData: false }
- FMenuElement { id: preset5; menuText: "NHL"; menuData: false }
- FMenuElement { id: preset6; menuText: "the Highway"; menuData: false }
- FMenuElement { id: preset7; menuText: "SiriusXMU"; menuData: false }
- FMenuElement { id: preset8; menuText: "First Wave"; menuData: false}
- }
- }
-
- triggers: [
-
- FTrgEntry{
- FGrdCondition{condition: dataPool.currSATpreset === 1
- FActScriptCall { onScript: home.stationTxt = "Lithium" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 2
- FActScriptCall { onScript: home.stationTxt = "Spectrum" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 3
- FActScriptCall { onScript: home.stationTxt = "ESPN" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 4
- FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 5
- FActScriptCall { onScript: home.stationTxt = "NHL" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 6
- FActScriptCall { onScript: home.stationTxt = "the Highway" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 7
- FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 8
- FActScriptCall { onScript: home.stationTxt = "First Wave" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "Lithium" }
- FActScriptCall { onScript: dataPool.currSATpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "Spectrum" }
- FActScriptCall { onScript: dataPool.currSATpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "ESPN" }
- FActScriptCall { onScript: dataPool.currSATpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
- FActScriptCall { onScript: dataPool.currSATpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "NHL" }
- FActScriptCall { onScript: dataPool.currSATpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "the Highway" }
- FActScriptCall { onScript: dataPool.currSATpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
- FActScriptCall { onScript: dataPool.currSATpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "First Wave" }
- FActScriptCall { onScript: dataPool.currSATpreset = 8 }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChange.qml b/src/components/qt_hmi/References/Look/Views/SourceChange.qml
deleted file mode 100644
index 42680f9e80..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SourceChange.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: TileBackLayout {
- id:source
- button1.text: "AM"
- button2.text: "FM"
- button3.text: "Sirius"
- button4.text: "USB"
- button5.text: "BT Audio"
- button6.text: "Line In"
- button7.vis: false
- button8.vis: false
- }
-
-
- }
-
- triggers: [
-
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:source.button1; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currSource = "AM" }
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:source.button2; touchAction: TA.Out
- FActViewShow { view: "FM" }
- },
- FTrgTouchArea { touchArea:source.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button4; touchAction: TA.Out
- FActViewShow { view: "USB" }
- },
- FTrgTouchArea { touchArea:source.button5; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button6; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:source.button7; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button8; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.backBtn; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml b/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
deleted file mode 100644
index bb87d41c2c..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: sourceAM; menuText: "AM"; }
- FMenuElement { id: sourceFM; menuText: "FM"; }
- FMenuElement { id: sourceSat; menuText: "Sirius"; }
- FMenuElement { id: sourceCD; menuText: "CD"; }
- FMenuElement { id: sourceBt; menuText: "BT Audio"; }
- FMenuElement { id: sourceIpod; menuText: "iPod"; }
- FMenuElement { id: sourceUSB; menuText: "USB"; }
- FMenuElement { id: sourceLineIn; menuText: "Line In";}
- FMenuElement { id: sourceSDL; menuText: "SDL Music";}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: sourceAM
- FActScriptCall { onScript: dataPool.currSource = "AM" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceFM
- FActScriptCall { onScript: dataPool.currSource = "FM" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceSat
- FActScriptCall { onScript: dataPool.currSource = "Sirius" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceCD
- FActScriptCall { onScript: dataPool.currSource = "CD" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceBt
- FActScriptCall { onScript: dataPool.currSource = "BT_Audio" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceIpod
- FActScriptCall { onScript: dataPool.currSource = "iPod" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceUSB
- FActScriptCall { onScript: dataPool.currSource = "USB" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceLineIn
- FActScriptCall { onScript: dataPool.currSource = "LineIn" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceSDL
- FActScriptCall { onScript: dataPool.currSource = "SDL_Music" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Start.qml b/src/components/qt_hmi/References/Look/Views/Start.qml
deleted file mode 100644
index 4858474011..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Start.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: StartLayout {
- id:corner
-
- }
-
-
- }
-
- triggers: [
- FTrgEntry {
-
- },
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:corner.button1; touchAction: TA.Out
- FActViewShow { view: "Home" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/USB.qml b/src/components/qt_hmi/References/Look/Views/USB.qml
deleted file mode 100644
index 8931d61ff8..0000000000
--- a/src/components/qt_hmi/References/Look/Views/USB.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.seekBkBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.seekFdBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.playBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.shuffleBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.repeatBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/USBPCA.qml b/src/components/qt_hmi/References/Look/Views/USBPCA.qml
deleted file mode 100644
index 0b1b47270e..0000000000
--- a/src/components/qt_hmi/References/Look/Views/USBPCA.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "USB"
- sourceBtn.textWidth: 50
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/iPodPCA.qml b/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
deleted file mode 100644
index f4d3f68b78..0000000000
--- a/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "iPod"
- sourceBtn.textWidth: 50
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
deleted file mode 100644
index 2e89924a20..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
- property bool listWrap: false
-
- FWdgtListView {
- id: theListView
- anchors.fill: theLayout
- clip: true
- //interactive: false
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- highlightMoveVelocity: -1
- keyNavigationWraps: listWrap
- highlight:
- Rectangle {
- id: focus
- height: 51
- width: theLayout.width
- radius: 10
- color: "transparent"
- border { color: "white"; width: 2 }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
deleted file mode 100644
index cbe1737984..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
- width: 200
- height: 178
-
- property alias bitmap : _img.bitmap
- property alias touch: _touch
-
-
- FWdgtImage{
- id: _img
- anchors.centerIn: theItem
- }
-
- FWdgtTouchArea{
- id: _touch
- anchors.fill: theItem
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
deleted file mode 100644
index 2e7712a65e..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
-
- property alias cx_text : _btn.text
- property int indentLevel: 0
- property alias touch: _btn.touchBtn
- property alias pressed: _btn.pressed
-
-
- TouchButton_PCA{
- id: _btn
- anchors.left: theItem.left
- anchors.leftMargin: 10
- anchors.top: theItem.top
- anchors.topMargin: 10
- textWidth: 100
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
deleted file mode 100644
index d5fb962461..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theGridView
- property alias list_itemWidget: theGridView.itemWidget
- property alias list_data: theGridView.data
- property bool listWrap: false
- property alias gridItemHeight: theGridView.cellHeight
- property alias gridItemWidth: theGridView.cellWidth
-
- FWdgtGridView {
- id: theGridView
- anchors.fill: theLayout
- clip: true
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- keyNavigationWraps: listWrap
- flow: GridView.TopToBottom
- snapMode: GridView.SnapOneRow
-
-
-
-
- populate: Transition {
- id: populateTransition
- SequentialAnimation {
- PropertyAction { property: "opacity"; value: 0 }
- PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
- }
- }
-
- add: Transition {
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
- }
-
- addDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- remove: Transition {
- NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
- }
-
- removeDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
deleted file mode 100644
index 9b28e961f9..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
+++ /dev/null
@@ -1,22 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
-
- property alias presetName : _preset.presetName
- property alias presetNumber: _preset.presetNumber
- property alias pressed: _preset.active
- property alias touchBtn: _preset.touchBtn
-
-
- PresetPCA{
- id: _preset
- anchors.horizontalCenter: theItem.horizontalCenter
- anchors.horizontalCenterOffset: 0
- y:20
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
deleted file mode 100644
index 82068b5560..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theGridView
- property alias list_itemWidget: theGridView.itemWidget
- property alias list_data: theGridView.data
- property bool listWrap: false
- property alias gridItemHeight: theGridView.cellHeight
- property alias gridItemWidth: theGridView.cellWidth
- property alias curItem: theGridView.currentIndex
- property alias moving: theGridView.moving
- property alias direction: theGridView.flickDeceleration
-
-
- FWdgtGridView {
- id: theGridView
- anchors.fill: theLayout
- clip: true
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- keyNavigationWraps: listWrap
- flow: GridView.TopToBottom
- snapMode: GridView.SnapToRow
-
-
-
-
-
- /* populate: Transition {
- id: populateTransition
- SequentialAnimation {
- PropertyAction { property: "opacity"; value: 0 }
- PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
- }
- }
-
- add: Transition {
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
- }
-
- addDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- remove: Transition {
- NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
- }
-
- removeDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }*/
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
deleted file mode 100644
index ee2c0369f0..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
-
- id: theItem
- height: 50; width: 50
-
- property alias cx_text: cx.text
- property alias cn_text: cn.text
- property alias ct_text: ct.text
- property alias touch:_touch
-
- FWdgtTouchArea {
- id: touch
- anchors.fill: theItem
- }
-
- Item{
-
-
- BaseText{
- color:"#9deaec"
- id: cx
- width: 100; height: 50
-
- }
- BaseText{
- color:"#9deaec"
- id: cn
- width: 302; height: 50
- x:300
- }
-
- BaseText{
- color:"#9deaec"
- id: ct
- width: 302; height: 50
- x:500
- }
-
- }
- FWdgtTouchArea {
- id: _touch
- height: 50; width: 600
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
deleted file mode 100644
index c927433f16..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- width: 800
- height: 115
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias gridCurItem: listView.gridCurItem
- property alias moving: listView.moving
- property alias direction: listView.direction
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 115
-
- GridViewPresetWidget {
- id: listView
- x: 0; y: 0
- width: 800; height: 115
- gridItemHeight: 115; gridItemWidth: 200
-
- }
-
- FWdgtContainer {
- id: m1
- width: 676; height: 115
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
deleted file mode 100644
index 2b832f4878..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property alias active: presetBtn.selected
- property alias text: presetBtn.text
- property alias touchBtn: presetBtn
- property alias presetText: presetTxt.text
-
-
- TouchButtonClimatePCA{
- id: presetBtn
- text: "X"
- image: "buttons/preset_9_9.png"
- imageActive: "buttons/presetSelected.png"
- imagePressed: "buttons/presetPressed_9_9.png"
- }
-
- BaseText{
- id: presetTxt
- anchors.horizontalCenter: presetBtn.horizontalCenter
- anchors.horizontalCenterOffset: -16
- y:59
- horAlignment: Text.AlignHCenter
- text: "104.3"
- color: "#1d81d5"
- }
-
- FViewUseCaseSimple{
- condition: presetBtn.active === true
- PropertyChanges {
- target: presetTxt; color: "white"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
deleted file mode 100644
index d2dc8092bd..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
-
- id: theItem
- height: 50; width: 50
- property bool vis: true
-
- property alias cx_text : cx.text
-
- Item{
-
- FWdgtText{
- color:"White"
- id: cx
- width: 302; height: 45
- visible: vis
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
deleted file mode 100644
index 7708d3ca56..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theItem
- height: 50; width: parent.width
-
- property alias cx_text : cx.text
- property alias cx_width : cx.width
- property alias ax_width : ax.width
- property alias ax_bitmap : ax.bitmap
- property alias activeMarker_visible: activeMarker.visible
- property alias touch: _touch
- property int indentLevel: 0
-
- Rectangle {
- id: activeMarker
- anchors.fill: theItem
- height: 50
- radius: 10
- color: "lightgray"
- }
-
- Item {
- x: 1; y: 0
- width: 502; height: 45
-
- BaseText {
- id: cx
- anchors.fill: parent
- anchors.leftMargin: 20*indentLevel+5
- vertAlignment: Text.AlignVCenter
- }
- }
-
- FWdgtImage {
- id: ax
- x: 549; y: 3
- width: 37; height: 45
- }
-
- FWdgtTouchArea {
- id: _touch
- width: 400
- height: 50
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
deleted file mode 100644
index ff6671cef6..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property bool selected: false
- property string text: ""
- property alias touchBtn: myButton
- property string image: "climate/Button_9_9.png"
- property string imageActive: "climate/ButtonActive_0_0.png"
- property string imagePressed: "climate/ButtonPressed_9_9.png"
- property string imageInActive: "climate/ButtonInActive_0_0.png"
- property bool active: true
-
-
- FWdgtImage{
- id: img
- x:-9
- y:-9
- bitmap: "Radio/PresetBtnNotSelected_9_9.png"
- }
-
- FWdgtImage{
- id: imgSelected
- x:-9
- y:-9
- bitmap: "Radio/PresetBtn_9_9.png"
- visible: false
- }
-
- FWdgtTouchArea {
- id: myButton
- anchors.fill: img
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.centerIn: myButton
- height: 46
- width: 46
- radius: 23
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.centerIn: myButton
- text: button.text
- color: "#1d81d5"
- }
-
-
- FViewUseCaseSimple{
- condition: button.selected === true
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "white"
- }
- PropertyChanges {
- target: btnFill; color: "white"
- }
- }
-
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- }
- FViewUseCase{condition: myButton.indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
deleted file mode 100644
index c03f89c184..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property string bitmap2: ""
- property bool selected: false
- property alias touchBtn: myButton
- property string text: ""
- property string image: "climate/Button_9_9.png"
- property string imageActive: "climate/ButtonActive_0_0.png"
- property string imagePressed: "climate/ButtonPressed_9_9.png"
- property string imageInActive: "climate/ButtonInActive_0_0.png"
- property bool active: true
- property string newFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- property int txtSize: 24
- property string txtColor: "#1d81d5"
-
-
- FWdgtImage{
- id: img
- x:-9
- y:-9
- bitmap: image
- }
-
- FWdgtImage{
- id: imgSelected
- x:0
- y:0
- bitmap: imageActive
- visible: false
- }
-
- FWdgtImage{
- id: imgInBtn
- anchors.centerIn: imgSelected
- bitmap: button.bitmap
- visible: false
- //height: 10
- //width: 10
- }
-
- BaseText {
- id: btnTxt
- anchors.horizontalCenter: imgSelected.horizontalCenter
- anchors.verticalCenter: imgSelected.verticalCenter
- //anchors.verticalCenterOffset: -1
- vertAlignment: Text.AlignVCenter
- horAlignment: Text.AlignHCenter
- text: button.text
- color: button.txtColor
- visible: false
- theFont: button.newFont
- pxSize: button.txtSize
-
- }
-
- FWdgtTouchArea {
- id: myButton
- anchors.fill: imgSelected
- }
-
-
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: imgInBtn; visible: true
- }
- }
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: img; bitmap: imagePressed
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{
- condition: button.active === false
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true; bitmap: imageInActive
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: myButton; enabled: false
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{
- condition: button.selected === true
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: img; bitmap: image
- }
- PropertyChanges {
- target: btnTxt; color: button.txtColor
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
deleted file mode 100644
index db963dc752..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
+++ /dev/null
@@ -1,95 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string text: ""
- property int centerWidth: 2
- property alias touchBtn: myButton
- property alias pressed: myButton.pressed
-
- FWdgtImage{
- id: img
- x:-8
- y:-8
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width: centerWidth
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }
-
- FWdgtTouchArea {
- id: myButton
- width:img1.width+44
- height: 46
- anchors.left: img1.left
- anchors.leftMargin: -22
- anchors.top: img1.top
- anchors.topMargin: 8
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.fill: myButton
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.centerIn: btnFill
- text: button.text
- color: "#1d81d5"
- visible: false
- }
-
-
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- }
- FViewUseCase{condition: indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
deleted file mode 100644
index 35b27c056f..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
+++ /dev/null
@@ -1,325 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property string bitmap2: ""
- property bool vis: true
- property string text: ""
- property string text1: ""
- property string text2: ""
- property int centerWidth: 2
- property alias touchBtn: myButton
- property int imageShift: 0
- property alias spacing: btnArea.spacing
- property alias pressed: myButton.pressed
- property int curHD: 4
- property int totHD: 4
-
- FWdgtImage{
- id: img
- x:-8
- y:-8
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width: centerWidth
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }
-
- FWdgtTouchArea {
- id: myButton
- width:img1.width+44
- height: 46
- anchors.left: img1.left
- anchors.leftMargin: -22
- anchors.top: img1.top
- anchors.topMargin: 8
-
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.fill: myButton
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- visible: false
- }
-
-
- Row {
- id: btnArea
- anchors.fill: img1
- anchors.left: img1.left
- anchors.leftMargin: imageShift
- spacing: 2
-
-
- FWdgtImage{
- id: btnImg
- anchors.verticalCenter: btnArea.verticalCenter
- bitmap: button.bitmap
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text
- color: "#1d81d5"
- visible: false
- }
-
- BaseText {
- id: btnTxt1
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text1
- color: "white"
- visible: false
- theFont: "../Fonts/HelveticaNeueLTStd-Bold.ttf"
- //boldTx: true
- }
-
- BaseText {
- id: btnTxt2
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text2
- color: "#1d81d5"
- visible: false
- }
-
-
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: btnImg; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text1 !== ""
- PropertyChanges {
- target: btnTxt1; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text2 !== ""
- PropertyChanges {
- target: btnTxt2; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: btnTxt2; color: "black"
- }
- PropertyChanges {
- target: btnImg; bitmap: button.bitmap2
- }
- }
- FViewUseCase{condition: indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: totHD === -1
- PropertyChanges {
- target: button; visible: true
- }
- }
- FViewUseCase{condition: totHD === 0
- PropertyChanges {
- target: button; visible: false
- }
- }
- FViewUseCase{condition: totHD === 1
- PropertyChanges {
- target: myButton; enabled: false
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: ""
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- PropertyChanges {
- target: img1; width: 4
- }
- }
- FViewUseCase{condition: totHD === 2 && curHD === 1
- PropertyChanges {
- target: img1; width: 50
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2"
- }
- }
- FViewUseCase{condition: totHD === 2 && curHD === 2
- PropertyChanges {
- target: img1; width: 50
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 1
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2 3"
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 2
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: " 3"
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 3
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 "
- }
- PropertyChanges {
- target: btnTxt1; text: "3"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 1
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2 3 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 2
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: " 3 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 3
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 "
- }
- PropertyChanges {
- target: btnTxt1; text: "3"
- }
- PropertyChanges {
- target: btnTxt2; text: " 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 4
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 3 "
- }
- PropertyChanges {
- target: btnTxt1; text: "4"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/BaseText.qml b/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
deleted file mode 100644
index b9bc380bd2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FWdgtText {
- id: myText
-
- property bool enabled: true
- property bool secondary: false
- property double secondaryOpacity: 0.7
- property alias horAlignment: myText.horizontalAlignment
- property alias vertAlignment: myText.verticalAlignment
- property int pxSize: 24
- property bool boldTx: false
- property alias theFont: testFont.source
-
- color: "white"
- smooth: true
-
- property alias style: _styler.style
-
- FontLoader {
- id: testFont; source: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- }
-
- font.family: testFont.name
- font.pixelSize: pxSize
- font.bold: boldTx
- //horizontalAlignment: Text.AlignLeft
- //verticalAlignment: Text.AlignTop
-
- states: [
- State {
- name: "disabled"
- when: enabled === false
- PropertyChanges { target:myText; opacity: secondaryOpacity }
- },
-
- State {
- name: "secondary"
- when: secondary === true
- PropertyChanges { target:myText; opacity: secondaryOpacity }
- }
- ]
-
- FStyler {
- id: _styler
- styleTarget: myText
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/CondText.qml b/src/components/qt_hmi/References/Look/Widgets/CondText.qml
deleted file mode 100644
index 7b8ae4ada6..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/CondText.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-BaseText {
- FontLoader {
- id: testFont; source: "../Fonts/HelveticaNeueLTCom-LtCn.ttf"
- }
-
- font.family: testFont.name
- font.pixelSize: 30
-
- height: 51
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
deleted file mode 100644
index 082ebdf881..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
- property alias focusNext: _focusNext
- property alias focusPrevious: _focusPrevious
- property alias selectElement: _selectElement
-
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
-
- FEvent { id: _focusNext; }
- FEvent { id: _focusPrevious; }
- FEvent { id: _selectElement; }
-
- layout: FocusListViewLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _focusPrevious
- FActScriptCall { onScript: {
- l.list.decrementCurrentIndex();
- }
- }
- },
- FTrgEvent { event: _focusNext
- FActScriptCall { onScript: {
- l.list.incrementCurrentIndex();
- }
- }
- },
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
deleted file mode 100644
index f76057722a..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 178
- width: 200
-
-
-
- layout: GridViewImgItemLayout {
- id: l
- bitmap: menuIcon
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
deleted file mode 100644
index 5b81d7e1bc..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 55
- width: 200
-
-
-
- layout: GridViewItemLayout {
- id: l
- cx_text: menuText
- indentLevel: 0
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
deleted file mode 100644
index fa2cb44918..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 115
- width: 169
-
- property int currPreset: 0
- property bool pressed: false
-
-
-
- layout: GridViewPresetItemLayout {
- id: l
- presetName: menuText
- pressed: w.pressed
- presetNumber: index + 1
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- FViewUseCaseSimple {
- condition: w.currPreset===index+1
- PropertyChanges { target: w; pressed: true}
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touchBtn.touchBtn; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
deleted file mode 100644
index f232bf2c68..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
-
- property alias selectElement: _selectElement
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
- property alias gridItemHeight: l.gridItemHeight
- property alias gridItemWidth: l.gridItemWidth
- property alias gridCurItem: l.curItem
- property alias moving: l.moving
- property alias direction: l.direction
-
-
- FEvent { id: _selectElement; }
-
- layout: GridViewPresetLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
deleted file mode 100644
index cfbba62530..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
-
- property alias selectElement: _selectElement
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
- property alias gridItemHeight: l.gridItemHeight
- property alias gridItemWidth: l.gridItemWidth
-
- FEvent { id: _selectElement; }
-
- layout: GridViewLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
deleted file mode 100644
index 48b3bff4a6..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 50
-
- layout: TGListItemLayout {
- id: l
- anchors.fill: parent
- ax_bitmap: ""
- cx_text: menuText
- activeMarker_visible: false
- indentLevel: level
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- FViewUseCaseGroup {
- FViewUseCase {
- condition: menuType == FMenuElement.Popup
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g137p.png"
- }
- }
-
- FViewUseCase {
- condition: menuType == FMenuElement.Submenu
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g136p.png"
- }
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.In
- FActScriptCall { onScript: w.ListView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
deleted file mode 100644
index df96329060..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- height: 50
-
- layout: TGListItemLayout {
- id: l
- anchors.fill: parent
- ax_bitmap: ""
- cx_text: menuItem
- activeMarker_visible: false
- }
-
- FViewUseCaseGroup {
- FViewUseCase {
- condition: type === "popup"
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g137p.png"
- }
-
- }
-
- FViewUseCase {
- condition: type === "arrow"
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g136p.png"
- }
- }
-
- FViewUseCase {
- condition: type === "tickboxChecked"
- PropertyChanges { target: l
- gx_bitmap: "../Resources/g134p.png"
- cx_width: ++ax_width
- }
- }
-
- FViewUseCase {
- condition: type === "tickboxUnchecked"
- PropertyChanges { target: l
- gx_bitmap: "../Resources/g135p.png"
- cx_width: ++ax_width
- }
- }
-
-
- FViewUseCase {
- condition: type === ""
- PropertyChanges { target: l
- visible: true
- ax_bitmap: ""
- cx_width: ++(ax_width+gx_width)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml b/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
deleted file mode 100644
index d357c50dc2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
+++ /dev/null
@@ -1,28 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-FWidget {
- id: w
- height: 50
-
- property FEvent itemClicked
-
- layout: PhoneListWdgtLayout {
- anchors.fill: parent
- id: l
- cx_text: staticItem
- cn_text: staticNumber
- ct_text: type
- }
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActEventFire{ event: itemClicked; data: index }
- FActScriptCall { onScript: console.log(staticItem) }
- }
- ]
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
deleted file mode 100644
index a575ff91eb..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias active: button.active
- property alias presetNumber: button.text
- property alias presetName: button.presetText
- property alias touchBtn: button.touchBtn
-
-
- clip: false
-
-
-
- layout: PresetPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
deleted file mode 100644
index b23375f886..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-
-FWidget {
- id:sv
- property int currPreset: 2
- property alias listModel: l.list_data
- property alias gridCurItem: l.gridCurItem
- property alias moving: l.moving
- property alias direction: l.direction
-
-
- layout: PresetGridLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewPresetItemWidget {
- currPreset: sv.currPreset
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
- FMenuElement { id: preset2; menuText: "107.9"; menuData: true }
- FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
- FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
- FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
- FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
- FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
- FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml b/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
deleted file mode 100644
index b1f67d043c..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Item {
- id: scrollbar
- property variant target
-
- clip: true
-
- //anchors {top: target.top; bottom: target.bottom; right: target.right }
- visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
-
- Timer {
- property int scrollAmount
-
- id: timer
- repeat: true
- interval: 20
- onTriggered: {
- target.contentY = Math.max(
- 0, Math.min(
- target.contentY + scrollAmount,
- target.contentHeight - target.height));
- }
- }
-
- MouseArea {
- anchors.fill: scrollbar
- onPressed: {
- timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
-
- Rectangle {
- id: track
-
- color: "red"
- opacity: 0.3
- radius: 2
- smooth: true
-
- anchors.top: scrollbar.top
- anchors.bottom: scrollbar.bottom
- anchors.horizontalCenter: scrollbar.horizontalCenter
- width: 3
- }
-
- Rectangle {
- id:slider
-
- width: scrollbar.width
- color: "red"
- opacity: 0.7
- radius: 4
- smooth: true
-
- height: Math.min(target.height / target.contentHeight * track.height, track.height)
- y: target.visibleArea.yPosition * track.height
-
- MouseArea {
- anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.YAxis
- drag.minimumY: 0
- drag.maximumY: track.height - height
-
- onPositionChanged: {
- if (pressedButtons == Qt.LeftButton) {
- target.contentY = slider.y * target.contentHeight / track.height
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
deleted file mode 100644
index c05e1ab525..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FWdgtTouchArea {
- id: button
-
- property string text: "Text"
- property string bitmap: ""
- property int wrapText: Text.NoWrap
- property bool indicatorState: false
- property string unpressedColor: "gray"
- property string pressEventColor: "lightGray"
- property string pressedColor: "darkGray"
- property bool vis: true
-
-
- width: 120
- height: 40
- enabled: button.vis
-
-
-
- Rectangle {
- id: buttonArea
- radius: 10
- anchors.centerIn: parent
- width: button.width
- height: button.height
- color: "gray"
- visible: button.vis
-
- BaseText {
- id: st
- anchors.centerIn: parent
- text: button.text
- wrapMode: wrapText
- visible: button.vis
- }
-
- FWdgtImage{
- id: img
- anchors.fill: buttonArea
- bitmap: button.bitmap
- visible: false
- }
-
-
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: img; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: pressed === true
- PropertyChanges {
- target: buttonArea; color: pressEventColor
- }
- }
- FViewUseCase{condition: indicatorState === true
- PropertyChanges {
- target: buttonArea; color: pressedColor
- }
- }
- FViewUseCase{condition: pressed === false
- PropertyChanges {
- target: buttonArea; color: unpressedColor
- }
- }
- }
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
deleted file mode 100644
index 2f3ca939a2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import QtGraphicalEffects 1.0
-import "../Widgets"
-
-
-
-Item {
- width: 160
- height: 45
-
- RectangularGlow {
- id: effect
- anchors.fill: rect
- glowRadius: 10
- spread: 0.2
- color: "#1d81d5"
- cornerRadius: rect.radius + glowRadius
- }
-
- Rectangle {
- id: rect
- color: "black"
- anchors.centerIn: parent
- width: 160
- height: 45
- radius: 25
- border.color: "#1d81d5"
- }
-}
-
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
deleted file mode 100644
index 6dbd6b125b..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap:button.bitmap
- property alias active: button.selected
- property alias text: button.text
- property alias touchBtn: button.touchBtn
-
-
- clip: false
-
-
-
- layout: TouchButtonBackGroundPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
deleted file mode 100644
index 401e538201..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap: button.bitmap
- property alias bitmap2: button.bitmap2
- property alias selected: button.selected
- property alias touchBtn: button.touchBtn
- property alias text: button.text
- property alias image: button.image
- property alias imageActive: button.imageActive
- property alias imagePressed: button.imagePressed
- property alias imageInActive: button.imageInActive
- property alias active: button.active
- property alias newFont: button.newFont
- property alias txtSize: button.txtSize
- property alias txtColor: button.txtColor
-
-
- height: 80
- width: 80
- clip: false
-
-
-
- layout: TouchButtonClimatePCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
deleted file mode 100644
index e48c5f2762..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap:button.bitmap
- property alias bitmap2: button.bitmap2
- property alias text: button.text
- property alias text1: button.text1
- property alias text2:button.text2
- property alias textWidth: button.centerWidth
- property alias touchBtn: button.touchBtn
- property alias imageShift: button.imageShift
- property alias spacing: button.spacing
- property alias pressed: button.pressed
- property alias curHD: button.curHD
- property alias totHD: button.totHD
- width: 164
- clip: false
-
-
-
- layout: TouchButtonPCASpecialLayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
deleted file mode 100644
index e46dbf28c5..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
-
- property alias text: button.text
- property alias textWidth: button.centerWidth
- property alias touchBtn: button.touchBtn
- property alias pressed: button.pressed
- width: textWidth+44
- clip: false
-
-
-
- layout: TouchButtonPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
deleted file mode 100644
index 42049240fd..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
+++ /dev/null
@@ -1,18 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-FWidget {
- id: w
- height: 50
- property alias vis: l.vis
-
- layout: SimpleItemWdgLayout {
- anchors.fill: parent
- id: l
- cx_text: staticItem
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll
deleted file mode 100644
index 52506bb139..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll
deleted file mode 100644
index 4d811bed1e..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
deleted file mode 100644
index b6a4d31838..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
deleted file mode 100644
index b03753aa5c..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
+++ /dev/null
@@ -1,682 +0,0 @@
-import QtQuick.tooling 1.1
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated with the command 'C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\qmlplugindump.exe -notrelocatable com.ford.hmiframework 1.0 C:\HMIRepository\trunk\Framework\QtHMIFramework\output'.
-
-Module {
- Component {
- name: "FAbstractListElement"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FAbstractListElement 1.0"]
- Signal {
- name: "elementSelected"
- Parameter { name: "element"; type: "FAbstractListElement"; isPointer: true }
- }
- Method { name: "selectElement" }
- }
- Component {
- name: "FAbstractListModel"
- prototype: "QAbstractListModel"
- exports: ["com.ford.hmiframework/FAbstractListModel 1.0"]
- Signal {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- }
- Component {
- name: "FActAnimControl"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActAnimControl 1.0"]
- Property { name: "animation"; type: "FAnimation"; isPointer: true }
- Property { name: "animAction"; type: "int" }
- }
- Component {
- name: "FActEventFire"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActEventFire 1.0"]
- Property { name: "event"; type: "FEvent"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActFunction"
- defaultProperty: "actions"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActFunction 1.0"]
- Property { name: "data"; type: "QVariant" }
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- }
- Component {
- name: "FActFunctionCall"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActFunctionCall 1.0"]
- Property { name: "func"; type: "FActFunction"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActHistoryClear"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryClear 1.0"]
- Property { name: "queue"; type: "string" }
- }
- Component {
- name: "FActHistoryPop"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryPop 1.0"]
- Property { name: "queue"; type: "string" }
- }
- Component {
- name: "FActHistoryPush"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryPush 1.0"]
- Property { name: "queue"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActHistoryShow"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryShow 1.0"]
- Property { name: "queue"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "skipMe"; type: "bool" }
- }
- Component {
- name: "FActViewHide"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActViewHide 1.0"]
- Property { name: "view"; type: "string" }
- Property { name: "animation"; type: "string" }
- }
- Component {
- name: "FActViewShow"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActViewShow 1.0"]
- Property { name: "view"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FAction"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FAction 1.0"]
- Property { name: "passed"; type: "bool" }
- Signal { name: "execute" }
- Method { name: "getDisplay"; type: "FDisplay*" }
- Method { name: "getStateView"; type: "FStateView*" }
- }
- Component {
- name: "FAnimView"
- defaultProperty: "data"
- prototype: "FAnimation"
- exports: ["com.ford.hmiframework/FAnimView 1.0"]
- Property { name: "inView"; type: "FStateView"; isPointer: true }
- Property { name: "outView"; type: "FStateView"; isPointer: true }
- Property { name: "ingoing"; type: "FLayout"; isReadonly: true; isPointer: true }
- Property { name: "outgoing"; type: "FLayout"; isReadonly: true; isPointer: true }
- }
- Component {
- name: "FAnimation"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FAnimation 1.0"]
- Property { name: "isRunning"; type: "bool"; isReadonly: true }
- Signal {
- name: "animationComplete"
- Parameter { name: "anim"; type: "FAnimation"; isPointer: true }
- }
- }
- Component {
- name: "FAnimationCoordinator"
- defaultProperty: "defaultAnims"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FAnimationCoordinator 1.0"]
- Property { name: "defaultAnims"; type: "FDefaultAnimation"; isList: true; isReadonly: true }
- }
- Component {
- name: "FDefaultAnimation"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FDefaultAnimation 1.0"]
- Property { name: "from"; type: "FViewClass"; isPointer: true }
- Property { name: "to"; type: "FViewClass"; isPointer: true }
- Property { name: "animation"; type: "string" }
- }
- Component {
- name: "FDisplay"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FDisplay 1.0"]
- Property { name: "xPixel"; type: "int" }
- Property { name: "yPixel"; type: "int" }
- Property { name: "initialView"; type: "string" }
- Property { name: "initialAnim"; type: "string" }
- Property { name: "modelPath"; type: "QUrl" }
- Property { name: "activeVariant"; type: "string" }
- Property { name: "priorityLayerCount"; type: "int" }
- Property { name: "minPriority"; type: "int" }
- Property { name: "priorityLayerDebug"; type: "QStringList"; isReadonly: true }
- Property { name: "viewCacheSize"; type: "int" }
- Signal { name: "preStartInit" }
- Method {
- name: "animationCompleted"
- Parameter { type: "FAnimation"; isPointer: true }
- }
- Method { name: "updateDebugInformation" }
- }
- Component {
- name: "FEvent"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FEvent 1.0"]
- Signal {
- name: "fire"
- Parameter { name: "data"; type: "QVariant" }
- }
- Method {
- name: "doFire"
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FGrdCondition"
- defaultProperty: "actions"
- prototype: "FGuard"
- exports: ["com.ford.hmiframework/FGrdCondition 1.0"]
- Property { name: "condition"; type: "bool" }
- }
- Component {
- name: "FGuard"
- defaultProperty: "actions"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FGuard 1.0"]
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- }
- Component {
- name: "FHardwareControl"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FHardwareControl 1.0"]
- Property { name: "hardwareControlID"; type: "string" }
- Signal {
- name: "checkKeyPressed"
- Parameter { name: "key"; type: "int" }
- }
- Signal {
- name: "checkKeyReleased"
- Parameter { name: "key"; type: "int" }
- }
- Method {
- name: "sendHardwareControlEvent"
- Parameter { name: "data"; type: "int" }
- }
- }
- Component {
- name: "FHardwareKey"
- defaultProperty: "data"
- prototype: "FHardwareControl"
- exports: ["com.ford.hmiframework/FHardwareKey 1.0"]
- Property { name: "pressed"; type: "bool" }
- Property { name: "keyboardKey"; type: "int" }
- Property { name: "longPressMSec"; type: "int" }
- Property { name: "repeatDelayMSec"; type: "int" }
- Property { name: "repeatIntervalMSec"; type: "int" }
- }
- Component {
- name: "FHardwareRotary"
- defaultProperty: "knob"
- prototype: "FHardwareControl"
- exports: ["com.ford.hmiframework/FHardwareRotary 1.0"]
- Property { name: "knob"; type: "QQuickItem"; isPointer: true }
- Property { name: "stepsPerRotation"; type: "int" }
- Property { name: "currentAbsPosition"; type: "int" }
- Property { name: "currentRelPosition"; type: "int" }
- Property { name: "generateEvents"; type: "bool" }
- Property { name: "updateInterval"; type: "int" }
- }
- Component {
- name: "FLayer"
- defaultProperty: "data"
- prototype: "FWidgetBase"
- exports: ["com.ford.hmiframework/FLayer 1.0"]
- Property { name: "layerID"; type: "int" }
- Property { name: "initialView"; type: "string" }
- Property { name: "activeViewName"; type: "string" }
- }
- Component {
- name: "FLayout"
- defaultProperty: "data"
- prototype: "FMetaInfoItem"
- exports: ["com.ford.hmiframework/FLayout 1.0"]
- Property { name: "viewX"; type: "double" }
- Property { name: "viewY"; type: "double" }
- Property { name: "viewZ"; type: "double" }
- }
- Component {
- name: "FLogHandlerItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FLogHandlerItem 1.0"]
- Signal {
- name: "newEntry"
- Parameter { name: "s"; type: "string" }
- }
- }
- Component {
- name: "FLogger"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLogger 1.0"]
- Property { name: "perfStamp"; type: "bool" }
- Method {
- name: "debug"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "warning"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "error"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "info"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "perf"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- }
- Component {
- name: "FLoggerConsole"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLoggerConsole 1.0"]
- }
- Component {
- name: "FLoggerFile"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLoggerFile 1.0"]
- Property { name: "file"; type: "string" }
- }
- Component {
- name: "FMenuElement"
- defaultProperty: "children"
- prototype: "FTreeElement"
- exports: ["com.ford.hmiframework/FMenuElement 1.0"]
- Enum {
- name: "MenuElementType"
- values: {
- "Undefined": 0,
- "Submenu": 1,
- "Popup": 2,
- "Hyperlink": 3,
- "Checkbox": 4,
- "Radiobutton": 5,
- "Multistate": 6
- }
- }
- Property { name: "isVisible"; type: "bool" }
- Property { name: "isEnabled"; type: "bool" }
- Property { name: "menuType"; type: "int" }
- Property { name: "menuText"; type: "string" }
- Property { name: "menuIcon"; type: "string" }
- Property { name: "menuStatus"; type: "int" }
- Property { name: "menuData"; type: "QVariant" }
- }
- Component {
- name: "FMenuModel"
- defaultProperty: "children"
- prototype: "FTreeModel"
- exports: ["com.ford.hmiframework/FMenuModel 1.0"]
- }
- Component {
- name: "FMetaInfoItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FMetaInfoItem 1.0"]
- Property { name: "metaInfo"; type: "string" }
- Property { name: "metaID"; type: "string" }
- Property { name: "metaVersion"; type: "string" }
- }
- Component {
- name: "FMetaInfoObject"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FMetaInfoObject 1.0"]
- Property { name: "metaInfo"; type: "string" }
- Property { name: "metaID"; type: "string" }
- Property { name: "metaVersion"; type: "string" }
- }
- Component {
- name: "FProxyListModel"
- prototype: "QIdentityProxyModel"
- exports: ["com.ford.hmiframework/FProxyListModel 1.0"]
- Property { name: "sourceModel"; type: "FAbstractListModel"; isPointer: true }
- Property { name: "isFrozen"; type: "bool" }
- Signal {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- Method {
- name: "selectElement"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "FReactiveElementBase"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FReactiveElementBase 1.0"]
- Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
- }
- Component {
- name: "FState"
- prototype: "FStateBase"
- exports: ["com.ford.hmiframework/FState 1.0"]
- Property { name: "baseBehavior"; type: "FStateBase"; isPointer: true }
- }
- Component {
- name: "FStateBase"
- prototype: "FReactiveElementBase"
- exports: ["com.ford.hmiframework/FStateBase 1.0"]
- }
- Component {
- name: "FStateView"
- defaultProperty: "childObjects"
- prototype: "FState"
- exports: ["com.ford.hmiframework/FStateView 1.0"]
- Property { name: "priority"; type: "int" }
- Property { name: "visualPriority"; type: "int" }
- Property { name: "view"; type: "FView"; isPointer: true }
- Property { name: "preload"; type: "QVariant" }
- Property { name: "attachedViews"; type: "QStringList" }
- Property { name: "childObjects"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "isInEntry"; type: "bool"; isReadonly: true }
- Property { name: "isInExit"; type: "bool"; isReadonly: true }
- Signal {
- name: "entry"
- Parameter { name: "previousView"; type: "string" }
- Parameter { name: "data"; type: "QVariant" }
- }
- Signal { name: "entryComplete" }
- Signal { name: "exit" }
- Signal { name: "exitComplete" }
- }
- Component {
- name: "FThemeProvider"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FThemeProvider 1.0"]
- Property { name: "theme"; type: "string" }
- Property { name: "resourcePath"; type: "QUrl" }
- Method {
- name: "getFileSubPath"
- type: "string"
- Parameter { type: "string" }
- }
- Method {
- name: "getStyle"
- type: "FStyle*"
- Parameter { type: "string" }
- }
- Method {
- name: "applyStyle"
- Parameter { name: "target"; type: "QObject"; isPointer: true }
- Parameter { name: "styleName"; type: "string" }
- }
- }
- Component {
- name: "FTreeElement"
- defaultProperty: "children"
- prototype: "FAbstractListElement"
- exports: ["com.ford.hmiframework/FTreeElement 1.0"]
- Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
- Property { name: "level"; type: "int"; isReadonly: true }
- Property { name: "isOpened"; type: "bool" }
- }
- Component {
- name: "FTreeModel"
- defaultProperty: "children"
- prototype: "FAbstractListModel"
- exports: ["com.ford.hmiframework/FTreeModel 1.0"]
- Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
- Property { name: "root"; type: "FTreeElement"; isPointer: true }
- Property { name: "rootRoot"; type: "FTreeElement"; isReadonly: true; isPointer: true }
- Method {
- name: "openElement"
- Parameter { name: "numIndex"; type: "int" }
- }
- Method {
- name: "closeElement"
- Parameter { name: "numIndex"; type: "int" }
- }
- Method {
- name: "selectElement"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "FTrgAnimCompleted"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgAnimCompleted 1.0"]
- Property { name: "animation"; type: "FAnimation"; isPointer: true }
- Method {
- name: "animCompleted"
- Parameter { type: "FAnimation"; isPointer: true }
- }
- }
- Component {
- name: "FTrgCondition"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgCondition 1.0"]
- Property { name: "condition"; type: "bool" }
- Property { name: "checkOnEntry"; type: "bool" }
- }
- Component {
- name: "FTrgEntry"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEntry 1.0"]
- Property { name: "previousView"; type: "string"; isReadonly: true }
- Property { name: "data"; type: "QVariant"; isReadonly: true }
- Method {
- name: "entry"
- Parameter { name: "previousView"; type: "string" }
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FTrgEntryComplete"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEntryComplete 1.0"]
- }
- Component {
- name: "FTrgEvent"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEvent 1.0"]
- Property { name: "event"; type: "FEvent"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- Method {
- name: "eventTrigger"
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FTrgExit"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgExit 1.0"]
- }
- Component {
- name: "FTrgExitComplete"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgExitComplete 1.0"]
- }
- Component {
- name: "FTrgHardwareControl"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgHardwareControl 1.0"]
- Property { name: "hardControls"; type: "QVariant" }
- Signal {
- name: "handleHardwareControlEvent"
- Parameter { name: "action"; type: "int" }
- }
- }
- Component {
- name: "FTrgHardwareKey"
- defaultProperty: "actions"
- prototype: "FTrgHardwareControl"
- exports: ["com.ford.hmiframework/FTrgHardwareKey 1.0"]
- Property { name: "keyAction"; type: "int" }
- Property { name: "hardkeys"; type: "QVariant" }
- }
- Component {
- name: "FTrgHardwareRotary"
- defaultProperty: "actions"
- prototype: "FTrgHardwareControl"
- exports: ["com.ford.hmiframework/FTrgHardwareRotary 1.0"]
- Property { name: "valueChange"; type: "int" }
- Property { name: "rotary"; type: "QVariant" }
- }
- Component {
- name: "FTrgListModel"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgListModel 1.0"]
- Property { name: "model"; type: "FAbstractListModel"; isPointer: true }
- Property { name: "element"; type: "FAbstractListElement"; isReadonly: true; isPointer: true }
- Property { name: "index"; type: "int"; isReadonly: true }
- Method {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- }
- Component {
- name: "FTrgMenuElement"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgMenuElement 1.0"]
- Property { name: "menuElement"; type: "FMenuElement"; isPointer: true }
- Method {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- }
- }
- Component {
- name: "FTrgTouchArea"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgTouchArea 1.0"]
- Property { name: "touchArea"; type: "FWdgtTouchArea"; isPointer: true }
- Property { name: "touchAction"; type: "int" }
- Property { name: "xPos"; type: "int" }
- Property { name: "yPos"; type: "int" }
- Method {
- name: "touchEvent"
- Parameter { name: "action"; type: "int" }
- Parameter { name: "x"; type: "int" }
- Parameter { name: "y"; type: "int" }
- }
- }
- Component {
- name: "FTrigger"
- defaultProperty: "actions"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FTrigger 1.0"]
- Property { name: "initialized"; type: "bool" }
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- Signal {
- name: "init"
- Parameter { type: "FStateView"; isPointer: true }
- }
- Signal {
- name: "cleanup"
- Parameter { type: "FStateView"; isPointer: true }
- }
- Signal { name: "intializedChanged" }
- }
- Component {
- name: "FView"
- defaultProperty: "data"
- prototype: "FWidget"
- exports: ["com.ford.hmiframework/FView 1.0"]
- Property { name: "viewClass"; type: "FViewClass"; isPointer: true }
- }
- Component {
- name: "FViewClass"
- defaultProperty: "derivedClass"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FViewClass 1.0"]
- Property { name: "derivedClass"; type: "FViewClass"; isList: true; isReadonly: true }
- }
- Component {
- name: "FWdgtTouchArea"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FWdgtTouchArea 1.0"]
- Property { name: "pressed"; type: "bool" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "longPressMSec"; type: "int" }
- Property { name: "repeatDelayMSec"; type: "int" }
- Property { name: "repeatIntervalMSec"; type: "int" }
- Signal {
- name: "touchEvent"
- Parameter { name: "event"; type: "int" }
- Parameter { name: "x"; type: "int" }
- Parameter { name: "y"; type: "int" }
- }
- }
- Component {
- name: "FWidget"
- defaultProperty: "data"
- prototype: "FWidgetBase"
- exports: ["com.ford.hmiframework/FWidget 1.0"]
- Property { name: "layout"; type: "FLayout"; isPointer: true }
- Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
- }
- Component { name: "FWidgetBase"; defaultProperty: "data"; prototype: "FMetaInfoItem" }
- Component {
- name: "QAbstractProxyModel"
- prototype: "QAbstractItemModel"
- Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
- }
- Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
- Component {
- name: "QSortFilterProxyModel"
- prototype: "QAbstractProxyModel"
- exports: ["com.ford.hmiframework/FSortFilterProxyListModel 1.0"]
- Property { name: "filterRegExp"; type: "QRegExp" }
- Property { name: "filterKeyColumn"; type: "int" }
- Property { name: "dynamicSortFilter"; type: "bool" }
- Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
- Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
- Property { name: "isSortLocaleAware"; type: "bool" }
- Property { name: "sortRole"; type: "int" }
- Property { name: "filterRole"; type: "int" }
- Method {
- name: "setFilterRegExp"
- Parameter { name: "pattern"; type: "string" }
- }
- Method {
- name: "setFilterWildcard"
- Parameter { name: "pattern"; type: "string" }
- }
- Method {
- name: "setFilterFixedString"
- Parameter { name: "pattern"; type: "string" }
- }
- Method { name: "clear" }
- Method { name: "invalidate" }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
deleted file mode 100644
index c95ebd3191..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-BorderImage {
- property string bitmap: ""
- property bool themed: false
-
- onBitmapChanged: {
- applyThemedImage();
- }
-
- function applyThemedImage() {
- if (bitmap !== "") {
- if (themed) {
- source = FThemeProvider.resourcePath + "/" + FThemeProvider.theme + "/" + bitmap;
- }
- else {
- source = FThemeProvider.resourcePath + "/" + bitmap;
- }
- }
- else {
- source = "";
- }
- }
-
- Component.onCompleted: {
- if (themed)
- {
- FThemeProvider.themeChanged.connect(applyThemedImage);
- }
- }
-
- Component.onDestruction: {
- if (themed)
- {
- FThemeProvider.themeChanged.disconnect(applyThemedImage);
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
deleted file mode 100644
index f0e4720cce..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
+++ /dev/null
@@ -1,8 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Item {
- id: container
-
- property alias widget: container.children
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
deleted file mode 100644
index 61d1832db4..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-GridView {
- id: theGrid
-
- property alias data : theGrid.model
- property alias itemWidget : theGrid.delegate
-
- /*
- Setting rows/columns fundamentally changes how children fit into the GridView.
- -Normal behaviour: Children have a fixed size (cellWidth/cellHeight) and the NUMBER of them
- that will fit into the GridView varies with the GridView's size.
- -Modified behaviour(setting rows and/or columns triggers this mode): A fixed number of children
- will fit into the GridView (determined by number of rows/columns) and their SIZE
- (cellWidth/cellHeight) will vary with the GridView's size
- -rows/columns determines the size of VISIBLE children and simply sets cellWidth/cellHeight at runtime.
- If the number of children is different than rows * columns, it will either scroll or not
- fill the GridView completely, same as normal.
- -the item_Widget component must be designed for fluid layout using anchors, not fixed sizes,
- for this to have any effect besides spacing
- */
- property int rows
- property int columns
-
- Component.onCompleted: {
- if (rows) {
- theGrid.cellHeight = theGrid.height/rows
- }
- if (columns) {
- theGrid.cellWidth = theGrid.width/columns
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
deleted file mode 100644
index 89e57bbf0e..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-Image {
- property string bitmap: ""
- property bool themed: false
-
- fillMode: Image.PreserveAspectFit
- asynchronous: true
-
- onBitmapChanged: {
- applyThemedImage();
- }
-
- function applyThemedImage() {
- if (bitmap !== "") {
- if (themed) {
- source = FThemeProvider.resourcePath + "/" + FThemeProvider.getFileSubPath(bitmap) + bitmap;
- }
- else {
- source = FThemeProvider.resourcePath + "/" + bitmap;
- }
- }
- else {
- source = "";
- }
- }
-
- Component.onCompleted: {
- if (themed)
- {
- FThemeProvider.themeChanged.connect(applyThemedImage);
- }
- }
-
- Component.onDestruction: {
- if (themed)
- {
- FThemeProvider.themeChanged.disconnect(applyThemedImage);
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
deleted file mode 100644
index 7e1ccd10a3..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-ListView {
- id: theList
-
- property alias data : theList.model
- property alias itemWidget : theList.delegate
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
deleted file mode 100644
index 08762015a9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-PathView {
- id: thePathView
-
- property alias data : thePathView.model
- property alias itemWidget : thePathView.delegate
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
deleted file mode 100644
index 74c1e27e9b..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-BorderImage {
- property variant target
-
- source: "../Resources/scrollbar.png"
- border {left: 0; top: 3; right: 0; bottom: 3}
- width: 17
-
- //anchors {top: target.top; bottom: target.bottom; right: target.right }
- visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
-
- Item {
- anchors {fill: parent; margins: 1; rightMargin: 2; bottomMargin: 2}
-
- Image {
- id: upArrow
- source: "../Resources/up-arrow.png"
- anchors.top: parent.top
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = -10
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
- }
-
- Timer {
- property int scrollAmount
-
- id: timer
- repeat: true
- interval: 20
- onTriggered: {
- target.contentY = Math.max(
- 0, Math.min(
- target.contentY + scrollAmount,
- target.contentHeight - target.height));
- }
- }
-
- Item {
- id: track
- anchors {top: upArrow.bottom; topMargin: 1; bottom: dnArrow.top;}
- width: parent.width
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
-
- BorderImage {
- id:slider
-
- source: "../Resources/slider.png"
- border {left: 0; top: 3; right: 0; bottom: 3}
- width: parent.width
-
- height: Math.min(target.height / target.contentHeight * track.height, track.height)
- y: target.visibleArea.yPosition * track.height
-
- MouseArea {
- anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.YAxis
- drag.minimumY: 0
- drag.maximumY: track.height - height
-
- onPositionChanged: {
- if (pressedButtons == Qt.LeftButton) {
- target.contentY = slider.y * target.contentHeight / track.height
- }
- }
- }
- }
- }
- Image {
- id: dnArrow
- source: "../Resources/dn-arrow.png"
- anchors.bottom: parent.bottom
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = 10
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
deleted file mode 100644
index a42f74c9fe..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Flickable {
- id: theScrollView
- clip: true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
deleted file mode 100644
index 9e7a93773f..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Text {
- id: myText
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
deleted file mode 100644
index f21a454065..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
+++ /dev/null
@@ -1,12 +0,0 @@
-.pragma library
-
-var In = 1
-var Out = 2
-var Short = 4
-var Long = 8
-var Repeat = 16
-var InRepeat = 17
-var All = 31
-var Cancel = 32
-var DragOut = 64
-var DragIn = 128
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
deleted file mode 100644
index 39862d6f22..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal script
-
- onExecute: {
- script();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
deleted file mode 100644
index 5783286ccf..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-
-FAction {
- id: theAction
-
- signal call
-
- onExecute: {
- call();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
deleted file mode 100644
index e31937a2b9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- property variant timer
- property int action: 1
-
- onExecute: {
- switch(action)
- {
- case TM.Start:
- timer.start();
- break;
- case TM.Restart:
- timer.restart();
- break;
- case TM.Stop:
- timer.stop();
- break;
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
deleted file mode 100644
index 6e7048fe9a..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal call
-
- onExecute: {
- call();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
deleted file mode 100644
index 040695d298..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal change
-
- onExecute: {
- change();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
deleted file mode 100644
index 4eef062bea..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-FAnimView {
- supportOutgoing: true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
deleted file mode 100644
index 117cb99267..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var Start = 1
-var Restart = 2
-var Pause = 3
-var Resume = 4
-var Stop = 0
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
deleted file mode 100644
index 97c502e517..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
deleted file mode 100644
index 97c502e517..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
deleted file mode 100644
index add0413172..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-QtObject {
- id: theEventPool
- default property alias events: theEventPool._events
- property list<FEvent> _events
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
deleted file mode 100644
index 1886d54af7..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-// The FGauge allows to transform an input value range into an output value rang using a smooth transition
-// it can be e.g. used to transfrom the speed of a vehicle into an angle of the pointer needle
-// The borders of the input and output ranges are mapped to each other and a linear transformation is executed
-
-Item {
- id: theGauge
-
- // the time required to move through the full range from e.g. min to max
- property int fullSweepTime: 1000
-
- // minimum border, the input value can reach
- property double minInput: 0.0
- // maximum value, the input can reach
- property double maxInput: 100.0
- // the current input value. Each change will trigger an animated change of the output
- property double currentInput: 50.0
-
- // minimum border, the output value can reach
- property double minOutput: 0.0
- // maximum value, the output can reach
- property double maxOutput: 100.0
- //
- property double currentOutput: 50.0
-
- // this is the targetted output. Changing this, will trigger the animation to be executed
- property double targetOutput
- // this is the time required to move to the target value
- property int targetTime
-
- PropertyAnimation { id: anim; target: theGauge; properties: "currentOutput"; to: theGauge.targetOutput; duration: theGauge.targetTime }
-
- onCurrentInputChanged: {
- // we need to calculate the target and the required time to reach it
- var target = (currentInput - minInput) * (maxOutput - minOutput) / (maxInput - minInput) + minOutput;
- if(target < minOutput) {
- target = minOutput;
- }
- else if (target > maxOutput) {
- target = maxOutput;
- }
-
- targetTime = Math.abs((target - currentOutput) / (maxOutput - minOutput)) * fullSweepTime;
- if(targetTime > 0) {
- targetOutput = target;
- anim.restart();
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
deleted file mode 100644
index ee1db632a7..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
+++ /dev/null
@@ -1,9 +0,0 @@
-.pragma library
-
-var In = 1
-var Out = 2
-var Short = 4
-var Long = 8
-var Repeat = 16
-var InRepeat = 17
-var All = 31
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
deleted file mode 100644
index 1a1d2af589..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
+++ /dev/null
@@ -1,132 +0,0 @@
-var leadSection = ""
-var trailSection = ""
-var varName = ""
-var formatSection = ""
-
-var digits = 0
-var digitZeros = 0
-var decimals = 0
-var decimalsZeros = 0
-var decimalSymbol = "."
-
-function splitFormatString(format) {
- // we need to analyze the structure of the string first
- // a typical notation is like this: "{distance:#00.0#} km", where
- // "{" "}" variable limiters
- // "distance" variable name, this will be discarded and has not effect
- // "#" non-leading/-trailing zero character
- // "0" leading/trailing zero character
- // " km" additional text which will remain unchanged
- leadSection = ""
- trailSection = ""
- varName = ""
- formatSection = ""
-
- var startPos = 0;
- var searchStep = 0;
- for(var i = 0; i < format.length; ++i)
- {
- // search for the opening "{"
- if(searchStep === 0) {
- if(format.charAt(i)==='{') {
- leadSection = format.slice(startPos, i);
- startPos = i + 1;
- searchStep++;
- }
- }
- // search for the ":" or the closing "}"
- else if(searchStep === 1) {
- if(format.charAt(i) === '}') {
- formatSection = format.slice(startPos, i);
- startPos = i + 1;
- trailSection = format.slice(startPos)
- break;
- }
- else if(format.charAt(i) === ':') {
- varName = format.slice(startPos, i);
- startPos = i + 1;
- searchStep++;
- }
- }
- else if(searchStep === 2) {
- if(format.charAt(i) === '}') {
- formatSection = format.slice(startPos, i);
- startPos = i + 1;
- trailSection = format.slice(startPos)
- break;
- }
- }
- }
-
- // finally we need to create the formatting string for sprintf out of the formatSection
- digits = 0;
- digitZeros = 0;
- decimals = 0;
- decimalsZeros = 0;
- searchStep = 0;
- for(var i = 0; i < formatSection.length; ++i) {
- if(searchStep === 0) {
- if(formatSection.charAt(i) === '#') {
- digits++;
- }
- else if(formatSection.charAt(i) === '0') {
- digits++;
- digitZeros++;
- }
- else if(formatSection.charAt(i) === '.' || formatSection.charAt(i) === ',') {
- decimalSymbol = formatSection.charAt(i);
- searchStep++;
- }
- }
- else if(searchStep === 1) {
- if(formatSection.charAt(i) === '#') {
- decimals++;
- }
- else if(formatSection.charAt(i) === '0') {
- decimals++;
- decimalsZeros++;
- }
- }
- }
-}
-
-function formatOutput(data)
-{
- // format the output, first the digits
- var digitString = Math.floor(data).toString();
- if(digitString.length < digitZeros) {
- // zero pad the string
- var temp = "";
- for(var i = 0; i < digitZeros - digitString.length; ++i) {
- temp += '0';
- }
- digitString = temp + digitString;
- }
- else {
- digitString = digitString.slice(-digits);
- }
-
- var decimalString = (data - Math.floor(data)).toFixed(decimals).slice(2);
- if (decimalString.length > decimalsZeros) {
- for (var i = decimalString.length - 1; i >= decimalsZeros; i--)
- {
- if(decimalString.charAt(i) === '0')
- {
- decimalString = decimalString.slice(0, -1);
- }
- }
- }
- else {
- for (var i = decimalString.length; i < decimalsZeros; i++)
- {
- decimalString += '0';
- }
- }
-
- if (decimalString.length > 0) {
- return leadSection + digitString + decimalSymbol + decimalString + trailSection;
- }
- else {
- return leadSection + digitString + trailSection;
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
deleted file mode 100644
index c3be3832fa..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
+++ /dev/null
@@ -1,28 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import "FStringFormat.js" as CB
-
-QtObject {
- // output string for which is used as output
- property string output
-
- // this string defines the format of the output
- property string format
-
- // this is the data to be formatted into the output
- property variant data
-
-
- onFormatChanged: {
- CB.splitFormatString(format);
- }
-
- onDataChanged: {
- doFormat();
- }
-
- function doFormat()
- {
- output = CB.formatOutput(data);
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
deleted file mode 100644
index 5f9106f9af..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-QtObject {
- id: _style
-
- Component.onCompleted: {
- FThemeProvider.themeChanged.connect(themeChanged);
- }
-
- // This property is used to assign a "style" filename to the style. This file loads the style data and updates the properties of the style
- property string styleFile: ""
-
- property bool themed: false
-
- onStyleFileChanged: {
- loadStyle(_style);
- }
-
- function themeChanged() {
- if (themed)
- {
- loadStyle(_style);
- }
- }
-
- // indicate, that the style has been updated to the attached widgets
- signal styleUpdated
-
- function loadStyle(style)
- {
- if(styleFile.length > 0) {
- console.log( "Loading style: " + styleFile + " (" + FThemeProvider.theme + ")")
- var xhr = new XMLHttpRequest();
- xhr.open("GET", FThemeProvider.resourcePath + FThemeProvider.getFileSubPath(styleFile + ".qmlstyle") + "/" + styleFile + ".qmlstyle");
- xhr.onreadystatechange = function() {
- if (xhr.readyState === XMLHttpRequest.DONE) {
- try {
- var a = JSON.parse(xhr.responseText);
- for (var b in a) {
- if (style.hasOwnProperty(b)) {
- style[b] = a[b];
- }
- }
- styleUpdated();
- }
- catch (ex) {
- console.log("Style exception (" + styleFile + "): " + ex);
- }
- }
- }
- xhr.send();
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
deleted file mode 100644
index 3fb89882da..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
- // this property can be FStyle, but only if the instance is created in place and not assigned. Otherwise we need to use variant
- //property FStyle style
- property variant style
- property variant styleTarget
-
- onStyleChanged: {
- if(style !== undefined && style !== null) {
- style.styleUpdated.connect(applyStyle);
- applyStyle();
- }
- }
-
- onStyleTargetChanged: {
- applyStyle();
- }
-
- function applyStyle()
- {
- if(style !== undefined && style !== null && styleTarget !== undefined && styleTarget !== null) {
- setStyledProperties(style, styleTarget)
- }
- }
-
- function setStyledProperties(style, target)
- {
- for(var prop in style) {
- // first filter unwanted properties
- if(prop !== "objectName" && prop.slice(-7) !== "Changed" ) {
- // process only properties owned by style & target
- if (target.hasOwnProperty(prop)) {
- // assign the value
- target[prop] = style[prop];
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
deleted file mode 100644
index bc148998b9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Timer {
- triggeredOnStart: false
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
deleted file mode 100644
index d657de1f0c..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
+++ /dev/null
@@ -1,5 +0,0 @@
-.pragma library
-
-var Stop = 0
-var Start = 1
-var Restart = 2
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
deleted file mode 100644
index b3ac5f8a15..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
+++ /dev/null
@@ -1,19 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FTrigger {
- property QtObject timer
-
- onInit: {
- timer.triggered.connect(timerTrigger);
- }
-
- onCleanup: {
- timer.triggered.disconnect(timerTrigger);
- }
-
- function timerTrigger() {
- executeActions();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
deleted file mode 100644
index 258a1da623..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-State {
- default property alias propertyChange: myState.changes
- property alias condition: myState.when
- id: myState
- when: true === true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
deleted file mode 100644
index 7b1fa6ba51..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-StateGroup {
- id: myUseCaseGroup
- default property alias useCases: myUseCaseGroup.states
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
deleted file mode 100644
index 44da5a5a79..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-StateGroup {
- default property alias propertyChange: theState.changes
- property alias condition: theState.when
-
- states: [
- State {
- id: theState
- name: "*"
- when: true == true
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
deleted file mode 100644
index 24f6acfa4f..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Transition {
- to: "*"
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
deleted file mode 100644
index 3ccd0e58e8..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
+++ /dev/null
@@ -1,35 +0,0 @@
-module com.ford.hmiframework
-plugin QtHMIFramework
-typeinfo plugin.qmltypes
-FActScriptCall 1.0 qml/Framework/FActScriptCall.qml
-FActSystemModelCall 1.0 qml/Framework/FActSystemModelCall.qml
-FActTimer 1.0 qml/Framework/FActTimer.qml
-FActWidgetCall 1.0 qml/Framework/FActWidgetCall.qml
-FActWidgetProperty 1.0 qml/Framework/FActWidgetProperty.qml
-FConditionPool 1.0 qml/Framework/FConditionPool.qml
-FDataPool 1.0 qml/Framework/FDataPool.qml
-FEventPool 1.0 qml/Framework/FEventPool.qml
-FGaugeValue 1.0 qml/Framework/FGaugeValue.qml
-FStringFormat 1.0 qml/Framework/FStringFormat.qml
-FStyle 1.0 qml/Framework/FStyle.qml
-FStyler 1.0 qml/Framework/FStyler.qml
-FTimer 1.0 qml/Framework/FTimer.qml
-FTrgTimer 1.0 qml/Framework/FTrgTimer.qml
-FViewUseCase 1.0 qml/Framework/FViewUseCase.qml
-FViewUseCaseGroup 1.0 qml/Framework/FViewUseCaseGroup.qml
-FViewUseCaseSimple 1.0 qml/Framework/FViewUseCaseSimple.qml
-FViewUseCaseTransition 1.0 qml/Framework/FViewUseCaseTransition.qml
-FWdgtBorderImage 1.0 qml/BaseWidgets/FWdgtBorderImage.qml
-FWdgtContainer 1.0 qml/BaseWidgets/FWdgtContainer.qml
-FWdgtImage 1.0 qml/BaseWidgets/FWdgtImage.qml
-FWdgtListView 1.0 qml/BaseWidgets/FWdgtListView.qml
-FWdgtPathView 1.0 qml/BaseWidgets/FWdgtPathView.qml
-FWdgtGridView 1.0 qml/BaseWidgets/FWdgtGridView.qml
-FWdgtScrollbar 1.0 qml/BaseWidgets/FWdgtScrollbar.qml
-FWdgtScrollview 1.0 qml/BaseWidgets/FWdgtScrollview.qml
-FWdgtScrollText 1.0 qml/BaseWidgets/FWdgtScrollText.qml
-FWdgtText 1.0 qml/BaseWidgets/FWdgtText.qml
-HK 1.0 qml/Framework/FHardwareKeyEnums.js
-TA 1.0 qml/BaseWidgets/FWdgtTouchAreaEnums.js
-ANIM 1.0 qml/Framework/FAnimationEnums.js
-TM 1.0 qml/Framework/FTimerEnums.js
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro b/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
deleted file mode 100644
index c20d41ede5..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add more folders to ship with the application, here
-folder_01.source = qml/Bananas
-folder_01.target = qml
-
-folder_02.source = plugins/com
-folder_02.target = plugins
-DEPLOYMENTFOLDERS = folder_01 folder_02
-
-SOURCES += main.cpp
-
-linux-g++* {
- QMAKE_CXXFLAGS += -m32
- QMAKE_LFLAGS += -m32 -L/usr/lib/i386-linux-gnu/mesa
-}
-
-# Please do not modify the following two lines. Required for deployment.
-include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
-qtcAddDeployment()
-
-OTHER_FILES += \
- qml/Bananas/Layouts/TitledLayout.qml
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
deleted file mode 100644
index a7bfa0111f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=Bananas
-Exec=/opt/Bananas/bin/Bananas
-Icon=Bananas64
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
deleted file mode 100644
index 707d5c4e85..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
deleted file mode 100644
index 6ad8096c45..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
deleted file mode 100644
index 5ced151d06..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=Bananas
-Exec=/usr/bin/single-instance /opt/Bananas/bin/Bananas
-Icon=/usr/share/icons/hicolor/80x80/apps/Bananas80.png
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/README.md b/src/components/qt_hmi/References/Work/bananasnacks/README.md
deleted file mode 100644
index 993a4bf59d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-#### sudo vi /etc/apt/apt.conf
-
-``ruby
-Acquire::http::proxy "http://proxyvipecc.nb.ford.com:83";
-Acquire::https::proxy "https://proxyvipecc.nb.ford.com:83";
-``
-
-``bash
-sudo apt-get update
-sudo apt-get install git vim build-essential mesa-common-dev libgl1-mesa-dev # for 64bit: libc6-dev-i386 lib32stdc++6 lib32stdc++6-4.7-dev libgl1-mesa-dev:i386
-
-ssh-keygen
-<enter x3>
-cat ~/.ssh/id_rsa.pub # Save this as a public ssh key on your Gitlab account
-
-git clone git@devbox.pd8.ford.com:zchurch/bananasnacks.git # Type 'yes' to trust the remote host
-
-wget http://releases.qt-project.org/qt5/5.0.1/qt-linux-opensource-5.0.1-x86-offline.run
-chmod +x qt-linux-opensource-5.0.1-x86-offline.run
-./qt-linux-opensource-5.0.1-x86-offline.run # Press next, accept, etc... Do install the Tools. This includes Creator.
-
-echo "export PATH=\$PATH:~/Qt5.0.1/5.0.1/gcc/bin" >> ~/.bashrc
-
-cd ~/bananasnacks
-./fetch_plugins.sh
-qmake
-make
-./Bananas
-
-``
-
-
-### Troubleshooting
-
-#### bash: ./qt-linux-opensource-5.0.1-x86-offline.run: No such file or directory
-You didn't install all your apt-get things. You're missing ia32-libs. Or the file isn't there.
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject b/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
deleted file mode 100644
index f9502d2a90..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
+++ /dev/null
@@ -1,19 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "qml/Bananas/main.qml"
-
- QmlFiles {
- directory: "."
- }
-
- JavaScriptFiles {
- directory: "."
- }
-
- ImageFiles {
- directory: "."
- }
-
- importPaths: [ "plugins" ]
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh b/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
deleted file mode 100755
index 0f90baeb58..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-wget http://19.7.95.92/uploads/note/attachment/12/libFordMediaCore.so
-chmod 775 libFordMediaCore.so
-mv libFordMediaCore.so plugins/com/ford/mediacore
-
-wget http://19.7.95.92/uploads/note/attachment/11/libFordPhoneCore.so
-chmod 775 libFordPhoneCore.so
-mv libFordPhoneCore.so plugins/com/ford/phonecore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh b/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
deleted file mode 100755
index 0f094b5275..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
+++ /dev/null
@@ -1 +0,0 @@
-# source ./load_env.sh
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/main.cpp b/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
deleted file mode 100644
index bb40110e13..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <QtGui/QGuiApplication>
-#include <QQmlContext>
-#include "qtquick2applicationviewer.h"
-
-int main(int argc, char* argv[]) {
- QGuiApplication app(argc, argv);
-
- QtQuick2ApplicationViewer viewer;
-
- viewer.addImportPath(QStringLiteral("plugins"));
-
- viewer.setMainQmlFile(QStringLiteral("qml/Bananas/main.qml"));
- viewer.showExpanded();
-
- return app.exec();
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
deleted file mode 100644
index bb93f40934..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module com.ford.mediacore
-plugin FordMediaCore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
deleted file mode 100644
index aaacfe020e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.navcore
-plugin FordNavCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
deleted file mode 100644
index 861f2e2232..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.phonecore
-plugin FordPhoneCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
deleted file mode 100644
index da1a7b7f96..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdlcore
-plugin FordSdlCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
deleted file mode 100644
index 7111c7c932..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
deleted file mode 100644
index d8e6079685..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
deleted file mode 100644
index 1a65f07518..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
deleted file mode 100644
index cfb6d6d59e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
deleted file mode 100644
index 91ed3ef6e2..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
deleted file mode 100644
index d7ba38ab8c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
deleted file mode 100644
index 4555d71dfb..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
deleted file mode 100644
index c21373f220..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
deleted file mode 100644
index 251db8a7a5..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
deleted file mode 100644
index 2f8dc5130c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
deleted file mode 100644
index 49a01feeaf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
deleted file mode 100644
index 52430d8c56..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
deleted file mode 100644
index f47954968c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
deleted file mode 100644
index caa6489154..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
deleted file mode 100644
index 6c58389891..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
deleted file mode 100644
index 0871c51503..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
deleted file mode 100644
index 02548e946d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
deleted file mode 100644
index 2bdd652e0a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
deleted file mode 100644
index c6797a440b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
deleted file mode 100644
index b9ca08ad02..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
deleted file mode 100644
index a70ee397fe..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
deleted file mode 100644
index 3847da93c8..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
deleted file mode 100644
index 4405a629ce..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
deleted file mode 100644
index 482b6821e2..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
deleted file mode 100644
index 5e86d80c76..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
deleted file mode 100644
index 525e4b9158..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
deleted file mode 100644
index 4bce721385..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
deleted file mode 100644
index 55498b9134..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
deleted file mode 100644
index bbede19900..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
deleted file mode 100644
index 281e20a1f4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
deleted file mode 100644
index e4071e0932..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
deleted file mode 100644
index 9b36907b33..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
deleted file mode 100644
index 6af9c10463..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
deleted file mode 100644
index 1b665e3633..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
deleted file mode 100644
index b7b532db7b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
deleted file mode 100644
index f660610202..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
deleted file mode 100644
index 16a31b29ba..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
deleted file mode 100644
index 4351243d4b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
deleted file mode 100644
index 798f754801..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
deleted file mode 100644
index b1d03d24ae..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
deleted file mode 100644
index 2c8e7cb2da..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
deleted file mode 100644
index 571d06c97b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
deleted file mode 100644
index caff60c58b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
deleted file mode 100644
index 63a5a6a9db..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
deleted file mode 100644
index 4b3fc65c61..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
deleted file mode 100644
index 0ea1209925..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
deleted file mode 100644
index f871a96543..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
deleted file mode 100644
index 8f0c759edf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
deleted file mode 100644
index 79a277b185..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
deleted file mode 100644
index b6fb90276f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
deleted file mode 100644
index c27ac4a874..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
deleted file mode 100644
index c3f91de709..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
deleted file mode 100644
index e3277af0ac..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
deleted file mode 100644
index 97ce15688d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
deleted file mode 100644
index 69e50caa39..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
deleted file mode 100644
index 61f0311815..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-
-ImageButton {
- icon: "../Assets/BackIcon.png"
- height: 42
- width: 60
- anchors.top: parent.top
- anchors.left: parent.left
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
deleted file mode 100644
index 7f3c30126b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- property alias textAnchors: clickable.textAnchors
- property alias clickable: clickable
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: clickable.pressed ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: container.press()
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
deleted file mode 100644
index 713d00d1b3..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
+++ /dev/null
@@ -1,36 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
-
- states: [
- State {
- name: 'pressed'
- }
- ]
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: (state === 'pressed' || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: (state === 'pressed' || clickable.pressed) ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: { container.press(); container.state = (container.state === '') ? 'pressed' : '' }
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
deleted file mode 100644
index 2fdc97d7cd..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: text.text
- property alias pressed: mousearea.pressed
- property alias textAnchors: text.anchors
- signal press
-
- id: container
-
- Text {
- id: text
- color: "white"
- font.pixelSize: 16
- }
-
- MouseArea {
- id: mousearea
- width: parent.width
- height: parent.height
-
- onClicked: container.press()
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
deleted file mode 100644
index 2e670682ee..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- property alias image: image.source
-
- id: container
- border.color: "#333"
- border.width: 1
- height: 110
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: clickable.pressed ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: container.press()
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.bottom: bottom
- textAnchors.bottomMargin: 10
-
- Image {
- id: image
- anchors.top: parent.top
- anchors.topMargin: 10
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
deleted file mode 100644
index b68c7f0f1b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Text {
- color: "#fff"
- font.pixelSize: 32
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
deleted file mode 100644
index 775838be06..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-
-Text {
- color: "#fff"
- font.pixelSize: 24
- anchors.margins: 20
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
deleted file mode 100644
index 81c18a4311..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-
-Button {
- property alias icon: icon.source
-
- width: icon.width + 30
-
- Image {
- id: icon
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
deleted file mode 100644
index 7fe5dbab83..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Button {
- width: 60
-
- onPress: keyboard.letterClicked(text)
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
deleted file mode 100644
index fc5d26aa88..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
+++ /dev/null
@@ -1,129 +0,0 @@
-import QtQuick 2.0
-
-Item {
- signal letterClicked(string letter)
- signal go()
- id: keyboard
-
- states: [
- State {
- name: 'numpad'
- PropertyChanges {
- target: qwerty
- visible: false
- }
- PropertyChanges {
- target: numpad
- visible: true
- }
- }
-
- ]
-
- Column {
- id: qwerty
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "Q" }
- Key { text: "W" }
- Key { text: "E" }
- Key { text: "R" }
- Key { text: "T" }
- Key { text: "Y" }
- Key { text: "U" }
- Key { text: "I" }
- Key { text: "O" }
- Key { text: "P" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "A" }
- Key { text: "S" }
- Key { text: "D" }
- Key { text: "F" }
- Key { text: "G" }
- Key { text: "H" }
- Key { text: "J" }
- Key { text: "K" }
- Key { text: "L" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "Z" }
- Key { text: "X" }
- Key { text: "C" }
- Key { text: "V" }
- Key { text: "B" }
- Key { text: "N" }
- Key { text: "M" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- Button { text: "123"; width: 60
- onPress: keyboard.state = 'numpad'
- }
- Button { text: "!@#"; width: 60 }
- Key { text: " "; width: 300 }
- Key { text: "." }
- Key { text: "&" }
- }
- }
-
- Column {
- id: numpad
- visible: false
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "1" }
- Key { text: "2" }
- Key { text: "3" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "4" }
- Key { text: "5" }
- Key { text: "6" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "7" }
- Key { text: "8" }
- Key { text: "9" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Button {
- text: "ABC"
- width: 60
- onPress: keyboard.state = ''
- }
- Key { text: "*" }
- Key { text: "0" }
- Key { text: "#" }
- Button {
- text: "Go"
- width: 60
- onPress: keyboard.go()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
deleted file mode 100644
index 0dc0115acf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-import QtQuick 2.0
-
-Item {
- signal letterClicked(string letter)
- id: keyboard
-
- Column {
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "1" }
- Key { text: "2" }
- Key { text: "3" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "4" }
- Key { text: "5" }
- Key { text: "6" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "7" }
- Key { text: "8" }
- Key { text: "9" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "*" }
- Key { text: "0" }
- Key { text: "#" }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
deleted file mode 100644
index f0ef3ed2ae..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-
-ListView {
- id: listView
- anchors.fill: parent
- anchors.topMargin: 120
- spacing: 10
- clip: true
- model: MediaModel
-
- delegate: Button {
- width: 500
- anchors.horizontalCenter: parent.horizontalCenter
- OverflowableText {
- text: name
- fontColor: "#fff"
- font.pixelSize: 20
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- width: parent.width - 40
- }
- Text {
- text: (model.count === 0) ? "" : model.count
- anchors.right: parent.right
- anchors.rightMargin: 20
- anchors.verticalCenter: parent.verticalCenter
- color: "#fff"
- }
-
- onPress: {
- if (model.is_file) {
- MediaPlayer.setPlaylist(model.pid, model.index);
- usb.state = '';
- } else {
- MediaModel.browseToChild(model.id)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
deleted file mode 100644
index 3149943613..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-import QtQuick 2.0
-import QtGraphicalEffects 1.0
-
-Rectangle {
- id: oflow_text
- property alias text: text.text
- property alias font: text.font
- property alias fontColor: text.color
- property string textAlign
- color: Qt.rgba(0,0,0,0)
- height: text.font.pixelSize * 1.2
- clip: true
- Text {
- id: text
- Component.onCompleted: {
- if (oflow_text.width < width) {
- anchors.left = parent.left
- }
- else if (oflow_text.textAlign == 'center') {
- anchors.horizontalCenter = parent.horizontalCenter
- }
- }
-
- NumberAnimation on anchors.leftMargin {
- id: scroll_animation
- to: oflow_text.width - text.width
- duration: ((oflow_text.width - text.width) < 0) ? (text.width - oflow_text.width) * 15 : 0
- running: false
- onStopped: {
- restart_timer.start()
- }
- }
- }
-
- Timer {
- id: scroll_timer
- running: true
- interval: 3000
- onTriggered: { if (oflow_text.width < text.width) scroll_animation.start();}
- }
- Timer {
- id: restart_timer
- interval: 3000
- onTriggered: text.anchors.leftMargin = 0
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
deleted file mode 100644
index 676d65be39..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: (container.focus || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: (container.focus || clickable.pressed) ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: { container.forceActiveFocus(); container.press(); }
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
deleted file mode 100644
index d4266d149b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-import QtQuick 2.0
-
-FocusScope {
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
deleted file mode 100644
index 18b5c22f7d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Loader {
- anchors.fill: parent
- asynchronous: true
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
deleted file mode 100644
index 4c52e05b2a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- property alias text: text.text
- property alias icon: icon.source
-
- border.width: 2
- color: 'black'
- height: 42
- radius: 3
-
- Image {
- id: icon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
-
- TextInput {
- id: text
- color: "white"
- font.pixelSize: 24
- anchors.left: icon.right
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.rightMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
deleted file mode 100644
index 774894c137..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-import QtQuick 2.0
-
-Item {
- id: textentry
- property alias input_border: search_text_box.border
- property alias autocompleteModel: autocomplete.model
- property alias text: search_text_box.text
- signal selected
- anchors.fill: parent
-
- TextBox {
- id: search_text_box
- icon: "../Assets/SearchIcon.png"
- anchors.top: parent.top
- width: parent.width - 160
- anchors.horizontalCenter: parent.horizontalCenter
-
- onTextChanged: if (autocomplete.model) autocomplete.model.setSearchString(text)
- }
-
- BackButton {
- anchors.top: search_text_box.top
- anchors.topMargin: 1
- anchors.right: search_text_box.left
- anchors.rightMargin: 10
- onPress: section.state = 'menu'
- }
-
- ImageButton {
- anchors.top: search_text_box.top
- anchors.topMargin: 1
- icon: "../Assets/DeleteIcon.png"
- anchors.left: search_text_box.right
- anchors.leftMargin: 10
- height: 42
-
- onPress: search_text_box.text = search_text_box.text.replace(/.$/, '')
- }
-
- Keyboard {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.topMargin: 40
- anchors.top: search_text_box.bottom
-
- onLetterClicked: search_text_box.text += letter
- onGo: textentry.selected()
- }
-
- ListView {
- id: autocomplete
- anchors.top: search_text_box.bottom
- anchors.bottom: parent.bottom
- anchors.right: search_text_box.right
- anchors.left: search_text_box.left
- clip: true
- visible: (count > 0 && count <= 5)
-
- delegate: Button {
- text: model.text
- width: parent.width
- textAnchors.horizontalCenter: undefined
- textAnchors.left: clickable.left
- textAnchors.leftMargin: 70
-
- onPress: {
- autocomplete.model.selected = model.text;
- textentry.selected()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
deleted file mode 100644
index 0bcaf77205..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: text.text
- property alias temp: temp.text
- property alias image: image.source
-
- width: 150
- height: 75
-
- Text {
- id: text
- text: "Today"
- anchors.top: parent.top
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Text {
- id: temp
- text: "72"
- font.pixelSize: 36
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- color: "#ffffff"
- }
-
- Image {
- id: image
- source: "../Assets/Cloud.png"
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
deleted file mode 100644
index 8fe6fcfd7c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-Item {
- anchors.fill: parent
- anchors.topMargin: 70
- anchors.leftMargin: 20
- anchors.rightMargin: 20
- anchors.bottomMargin: 70
- property bool back_button: false
-
- BackButton {
- onPress: section.state = ''
- visible: parent.back_button
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
deleted file mode 100644
index b0a7c2f6af..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-FocusScope {
- anchors.fill: parent
- property alias header: header.text
-
- Text {
- id: header
- font.pixelSize: 24
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 70
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
deleted file mode 100644
index 767184de36..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-FocusScope {
- anchors.fill: parent
- property alias header: header.text
- property alias artwork: artwork.source
- property alias title: title.text
- property alias artist: artist.text
-
- Text {
- id: title
- text: ""
- color: "#ffffff"
- anchors.top: source_select.bottom
- anchors.topMargin: 20
- font.pixelSize: 28
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
- Text {
- id: artist
- text: ""
- color: "#ffffff"
- anchors.top: title.bottom
- anchors.topMargin: 10
- font.pixelSize: 18
- anchors.left: title.left
- }
-
- Text {
- id: header
- font.pixelSize: 24
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: parent.height / 20 + 60
- }
-
- Button {
- id: source_select
- text: "Select source"
- x: 20
- y: 75
- onPress: section.state = 'menu'
- }
-
- Image {
- id: artwork
- anchors.right: parent.right
- anchors.rightMargin: 40
- anchors.top: parent.top
- width: 230
- height: 230
- anchors.topMargin: 140
- source: ""
- }
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
deleted file mode 100644
index 797815d058..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-MediaLayout {
-
- Row {
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 100
- anchors.left: parent.left
- anchors.leftMargin: 20
- spacing: 10
-
- ImageButton {
- icon: "../Assets/Rewind.png"
- onPress: MediaPlayer.previous()
- }
-
- ImageButton {
- icon: "../Assets/Pause.png"
- visible: MediaPlayer.playing
- onPress: MediaPlayer.pause()
- }
- ImageButton {
- icon: "../Assets/Play.png"
- visible: ! MediaPlayer.playing
- onPress: MediaPlayer.play()
- }
- ImageButton {
- icon: "../Assets/Forward.png"
- onPress: MediaPlayer.next()
- }
-
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
deleted file mode 100644
index 2ef47fa101..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-EmptyLayout {
- property alias title: title.text
- anchors.topMargin: 120
-
- H1 {
- id: title
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.top
- anchors.bottomMargin: 10
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
deleted file mode 100644
index a88c240c3a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
deleted file mode 100644
index af5804e72e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- width: 100
- height: 62
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
deleted file mode 100644
index 4f9d281964..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import QtQuick 2.0
-import com.ford.sdlcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-MediaPlayerLayout {
- header: "AppLink"
- id: applink
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
-
- Text {
- id: title
- text: AppLink.show1
- color: "#ffffff"
- font.pixelSize: 28
- anchors.leftMargin: 20
- }
- Text {
- id: artist
- text: AppLink.show2
- color: "#ffffff"
- font.pixelSize: 18
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
deleted file mode 100644
index 397b844698..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "Bluetooth"
-
- Image {
- source: "../../Assets/Content/SiriusArtwork.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
deleted file mode 100644
index b5f3ad1c8c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "FM"
-
- Flickable {
- width: 700
- height: 50
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 80
- contentHeight: height
- contentWidth: row.width
- clip: true
-
- RadioButtonGroup {
- width: row.width
- height: row.height
- Row {
- id: row
- spacing: 8
-
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
deleted file mode 100644
index d9d951ef3b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-import QtQuick 2.0
-import com.ford.sdlcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- header: "Select a source"
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Radio"
- image: "../../Assets/RadioIcon.png"
- onPress: section.state = 'fm'
- }
-
- GraphicalButton {
- text: "Pandora"
- image: "../../Assets/PandoraIcon.png"
- onPress: section.state = 'fm'
- }
-
- GraphicalButton {
- text: "Sirius"
- image: "../../Assets/SiriusIcon.png"
- onPress: section.state = 'sirius'
- }
-
- GraphicalButton {
- text: "Bluetooth"
- image: "../../Assets/BluetoothIcon.png"
- onPress: section.state = 'bluetooth'
- }
-
- GraphicalButton {
- text: "USB"
- image: "../../Assets/UsbIcon.png"
- onPress: section.state = 'usb'
- }
-
- Repeater {
- model: MediaApps
-
- delegate: GraphicalButton {
- text: modelData
- image: "../../Assets/UsbIcon.png"
- onPress: section.state = 'applink'
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
deleted file mode 100644
index dfe9fc4d53..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "Sirius"
-
- Image {
- source: "../../Assets/Content/SiriusArtwork.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
deleted file mode 100644
index 7236e98cbe..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaPlayerLayout {
- header: "USB"
- id: usb
-
- Button {
- text: "Browse Media"
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.rightMargin: 40
- anchors.topMargin: 75
-
- onPress: parent.state = 'browse'
- }
-
- states: [
- State {
- name: 'browse'
- PropertyChanges { target: browse_interface; visible: true; opacity: 0.9 }
- }
-
- ]
-
- Rectangle {
- color: "#000000"
- opacity: 0
- anchors.fill: parent
- radius: 10
- visible: false
- id: browse_interface
-
- BackButton {
- id: back_button
- anchors.topMargin: 80
- anchors.leftMargin: 20
- }
-
-
- H2 {
- id: header
- text: "Browse Media"
- anchors.topMargin: 80
- }
-
- Item {
- anchors.fill: parent
- id: browse_container
- }
-
- Button {
- anchors.top: back_button.bottom
- anchors.left: parent.left
- text: "Jump"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
deleted file mode 100644
index 183438e037..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
deleted file mode 100644
index db16b994b4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- BackButton { onPress: section.state = 'menu' }
- NavController {
- id: navController
- }
-
- Flickable {
- height: 300
- width: 400
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Barry Church's home"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
- section.state = 'map';
- }
- }
- Button {
- text: "Subway"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
- section.state = 'map';
- }
- }
- Button {
- text: "Ford World Headquarters"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
- section.state = 'map';
- }
- }
- Button {
- text: "Qdoba"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
- section.state = 'map';
- }
- }
- Button {
- text: "Levagood Park"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
- section.state = 'map';
- }
- }
-
- }
- }
-}
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
deleted file mode 100644
index 011c761646..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- anchors.fill: parent
- id: keyboard_search
-
- states: [
- State {
- name: 'city'
- PropertyChanges {target: text_entry; autocompleteModel: citySuggestions}
- },
- State {
- name: 'street'
- PropertyChanges {target: text_entry; autocompleteModel: streetSuggestions}
- },
- State {
- name: 'door'
- PropertyChanges {target: text_entry; autocompleteModel: undefined}
- },
- State {
- name: 'review'
- PropertyChanges {target: text_entry; visible: false}
- PropertyChanges {target: review; visible: true}
- }
- ]
-
- Column {
- id: review
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- width: 500
-
- visible: false
- Button {
- text: stateSuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = ""
- }
- Button {
- text: citySuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = "city"
- }
- Button {
- text: streetSuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = "city"
- }
- Button {
- id: doornumber
- width: parent.width
- onPress: keyboard_search.state = "door"
- }
- Button {
- text: "Begin navigation"
- anchors.horizontalCenter: parent.horizontalCenter
- onPress: {
- section.state = 'map';
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
deleted file mode 100644
index 8b48efe780..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-
-Item {
- Column {
- anchors.left: parent.left;
- anchors.verticalCenter: parent.verticalCenter
- spacing: 10
-
- Button {
- text: "Zoom in"
- }
-
- Button {
- text: "Zoom out"
- }
-
- Button {
- text: "3D"
- }
-
- Button {
- text: "2D"
- }
-
- Button {
- text: "North up"
- }
- }
-
- Rectangle {
- width: next_turn.width + 20
- height: 30
- anchors.top: parent.top
- anchors.topMargin: 65
- anchors.horizontalCenter: parent.horizontalCenter
- color: "black"
- opacity: 0.6
-
- }
-
- Rectangle {
- width: current_street.width + 20
- height: 30
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 65
- anchors.horizontalCenter: parent.horizontalCenter
- color: "black"
- opacity: 0.6
- visible: navController.current_street.length > 0
-
- }
-
-
- Button {
- text: "Go"
- anchors.top: parent.top
- anchors.topMargin: 3
- anchors.right: parent.right
- anchors.rightMargin: 20
- onPress: section.state = 'menu'
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
deleted file mode 100644
index fdcae3f58e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-EmptyLayout {
- back_button: true
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Home"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- section.state = 'map';
- }
- }
- GraphicalButton {
- text: "Work"
- image: "../../Assets/WorkIcon.png"
- onPress: {
- section.state = 'map';
- }
- }
- GraphicalButton {
- text: "Recent Destination"
- image: "../../Assets/RecentDestinationsIcon.png"
- onPress: section.state = 'recent_destinations'
- }
- GraphicalButton {
- text: "Keyboard"
- image: "../../Assets/KeyboardIcon.png"
- onPress: section.state = 'keyboard_search'
- }
- GraphicalButton {
- text: "Favorites"
- image: "../../Assets/FavoritesIcon.png"
- onPress: section.state = 'favorites'
- }
- GraphicalButton {
- text: "Point of Interest"
- image: "../../Assets/PoiIcon.png"
- onPress: section.state = 'poi'
- }
- GraphicalButton {
- text: "Scout"
- image: "../../Assets/ScoutIcon.png"
- }
- GraphicalButton {
- text: "SYNC Services"
- image: "../../Assets/ServicesIcon.png"
- onPress: section.state = "video_moving_map"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
deleted file mode 100644
index 0ecea8a113..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-EmptyLayout {
- anchors.fill: parent
- back_button: true
- id: poi_search
-
- Component.onCompleted: state = "search_type"
-
- states: [
- State {
- name: 'search_type'
- PropertyChanges {
- target: search_type
- visible: true
- }
- },
- State {
- name: 'categories'
- PropertyChanges {
- target: category_select
- visible: true
- }
- },
- State {
- name: 'select_state'
- PropertyChanges {
- target: text_entry
- visible: true
- }
- },
- State {
- name: 'results'
- PropertyChanges {
- target: results
- visible: true
- }
- },
- State {
- name: 'result'
- PropertyChanges {
- target: result
- visible: true
- }
- }
- ]
-
- NavController {
- id: navController
- }
-
- Grid {
- id: search_type
- property string type
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- visible: false
-
- GraphicalButton {
- text: "Near me"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "nearby"
- poi_search.state = "categories"
- }
- }
-
- GraphicalButton {
- text: "Along route"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "route"
- poi_search.state = "categories"
- }
- }
-
- GraphicalButton {
- text: "In city"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "city"
- poi_search.state = "select_state"
- }
- }
- }
-
- ListView {
- id: category_select
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height - 120
- width: parent.width
- spacing: 10
- clip: true
-
- GraphicalButton {
- text: "Search by name"
- image: "../../Assets/HomeIcon.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
-
- visible: false
- model: NavPoiCategoryListModel { id: poi_categories }
-
- delegate: Button {
- property int category_id: id
- text: name
- width: 400
- anchors.horizontalCenter: parent.horizontalCenter
- onPress: {
- navController.poiSearch(search_type.type, category_id, "USA", state_suggestions.getSelected(), city_suggestions.getSelected());
- poi_search.state = "results"
- }
- }
- }
-
- ListView {
- id: results
- visible: false
- anchors.topMargin: 80
- anchors.top: parent.top
- anchors.bottomMargin: 80
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- width: 400
- height: parent.height - 120
- spacing: 10
- clip: true
-
- model: NavPoiSuggestionListModel {
- id: poi_suggestions
- }
-
- delegate: Button {
- text: name
- width: parent.width
- onPress: {
- results.currentIndex = index
- poi_search.state = "result"
- }
- }
- }
-
- Item {
- anchors.fill: parent
- anchors.topMargin: 80
- anchors.bottomMargin: 80
- id: result
- visible: false
-
- H1 {
- id: poi_name
- anchors.horizontalCenter: parent.horizontalCenter
- text: (results.currentItem ? results.currentItem.text : "")
- }
-
- Button {
- text: "Begin navigation"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: poi_name.bottom
- onPress: {
- poi_suggestions.navigateToResult(results.currentIndex);
- section.state = 'map'
- }
- }
- }
-
- TextEntry {
- id: text_entry
- anchors.topMargin: 80
- input_border.color: "#3C7855"
-
- states: [
- State {
- name: "city_select"
- PropertyChanges {
- target: text_entry
- autocompleteModel: city_suggestions
- }
- }
-
- ]
-
- NavStateSuggestionListModel { id: state_suggestions }
- NavCitySuggestionListModel { id: city_suggestions; stateListModel: state_suggestions }
- autocompleteModel: state_suggestions
- visible: false
-
- onSelected: {
- if (text_entry.state === '') {
- text = "";
- text_entry.state = 'city_select';
- }
- else {
- poi_search.state = 'categories'
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
deleted file mode 100644
index db16b994b4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- BackButton { onPress: section.state = 'menu' }
- NavController {
- id: navController
- }
-
- Flickable {
- height: 300
- width: 400
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Barry Church's home"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
- section.state = 'map';
- }
- }
- Button {
- text: "Subway"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
- section.state = 'map';
- }
- }
- Button {
- text: "Ford World Headquarters"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
- section.state = 'map';
- }
- }
- Button {
- text: "Qdoba"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
- section.state = 'map';
- }
- }
- Button {
- text: "Levagood Park"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
- section.state = 'map';
- }
- }
-
- }
- }
-}
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
deleted file mode 100644
index 2f6b798d18..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
+++ /dev/null
@@ -1,20 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import QtMultimedia 5.0
-
-Item {
- Video {
- anchors.fill: parent
- source: "rtsp://172.20.10.7:8086"
- autoPlay: true
- }
-
- Button {
- text: "Go"
- anchors.top: parent.top
- anchors.topMargin: 3
- anchors.right: parent.right
- anchors.rightMargin: 20
- onPress: section.state = 'menu'
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
deleted file mode 100644
index 1f409f58e6..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
+++ /dev/null
@@ -1,21 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import com.ford.phonecore 1.0
-
-Item {
- anchors.fill: parent
-
- H2 {
- id: h2
- text: PhoneCore.device_name
-
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Button {
- text: "Forget device"
- onPress: PhoneCore.unpairDevice()
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: h2.bottom
- anchors.topMargin: 20
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
deleted file mode 100644
index 5d7c51be6c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
+++ /dev/null
@@ -1,23 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-
-Item {
- ListView {
- anchors.horizontalCenter: parent.horizontalCenter
- width: 300
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- spacing: 10
-
- delegate: Button {
- text: name
- width: parent.width
- onPress: bluetooth_devices.createPairedDevice(mac)
- }
-
- model: BluetoothDiscoveredDevices {
- id: bluetooth_devices
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
deleted file mode 100644
index fd5ed4ff09..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- anchors.top: parent.top
- anchors.topMargin: 80
-
- TextBox {
- id: phone_number
- border.color: Qt.rgba(0.454901961,0.37254902,0.203921569,1)
- anchors.top: parent.top
- width: parent.width - 160
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- BackButton {
- anchors.top: phone_number.top
- anchors.topMargin: 1
- anchors.right: phone_number.left
- anchors.rightMargin: 10
- onPress: section.state = ''
- }
-
- ImageButton {
- anchors.top: phone_number.top
- anchors.topMargin: 1
- icon: "../../Assets/DeleteIcon.png"
- anchors.left: phone_number.right
- anchors.leftMargin: 10
- height: 42
-
- onPress: phone_number.text = phone_number.text.replace(/.$/, '')
- }
-
- Keypad {
- anchors.topMargin: 40
- anchors.top: phone_number.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- onLetterClicked: phone_number.text += letter
- }
-
- Button {
- text: "Call"
- onPress: PhoneCore.dial(phone_number.text);
- y: 100
- }
- Button {
- text: "End call"
- onPress: PhoneCore.hangup();
- y: 160
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
deleted file mode 100644
index cf62a9c287..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-TitledLayout {
- title: "Manage Bluetooth devices"
- back_button: true
-
- Loader {
- id: view
-
- anchors.fill: parent
- source: (PhoneCore.device_name === "") ? "discovery.qml" : "device_info.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
deleted file mode 100644
index 2d53656ba0..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Do Not Disturb"
- image: "../../Assets/DndIcon.png"
- }
-
- GraphicalButton {
- text: "Phonebook"
- image: "../../Assets/PhonebookIcon.png"
- }
-
- GraphicalButton {
- text: "Voicemail"
- image: "../../Assets/VoicemailIcon.png"
- }
-
- GraphicalButton {
- text: "Messages"
- image: "../../Assets/MessagesIcon.png"
- }
-
- GraphicalButton {
- text: "Recent Calls"
- image: "../../Assets/RecentCallsIcon.png"
- onPress: section.state = 'recent_calls'
- }
-
- GraphicalButton {
- text: "Keypad"
- image: "../../Assets/KeypadIcon.png"
- onPress: section.state = 'keypad'
- }
-
- GraphicalButton {
- text: "Speed Dial"
- image: "../../Assets/SpeedDialIcon.png"
- }
-
- GraphicalButton {
- text: "Devices"
- image: "../../Assets/SpeedDialIcon.png"
- onPress: section.state = 'manage_devices'
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
deleted file mode 100644
index 1873ed4382..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-TitledLayout {
- title: "Recent calls"
- Component.onCompleted: PhoneCore.hangup()
- back_button: true
-
- Flickable {
- height: 300
- width: 400
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Chris Church: Mobile"
- onPress: PhoneCore.dial("8106567195")
- width: parent.width
- }
- Button {
- text: "Barry Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Barry Church: Work"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
deleted file mode 100644
index b95bc52da8..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- MultiPointTouchArea {
- anchors.fill: parent
- }
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "HEV"
- image: "../../Assets/EvIcon.png"
- }
-
- GraphicalButton {
- text: "Ambient Lighting"
- image: "../../Assets/LightingIcon.png"
- }
-
- GraphicalButton {
- text: "Wallpaper"
- image: "../../Assets/WallpaperIcon.png"
- }
-
- GraphicalButton {
- text: "Wi-Fi"
- image: "../../Assets/WifiIcon.png"
- }
-
- GraphicalButton {
- text: "Health Report"
- image: "../../Assets/VhrIcon.png"
- }
-
- GraphicalButton {
- text: "Seats"
- image: "../../Assets/SeatsIcon.png"
- }
-
- GraphicalButton {
- text: "Keypad Entry"
- image: "../../Assets/KeypadEntryIcon.png"
- }
-
- GraphicalButton {
- text: "Sync Services"
- image: "../../Assets/ServicesIcon.png"
- }
-
- GraphicalButton {
- text: "Add Shortcut"
- image: "../../Assets/AddIcon.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
deleted file mode 100644
index f19539b9be..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: alert_text.text
- id: alert_item
- opacity: 0
-
- transitions: Transition {
- NumberAnimation {
- properties: "opacity"
- }
- }
-
- function alert(message) {
- text = message;
- state = 'alerting';
- alert_timer.start();
- }
-
- states: [
- State {
- name: 'alerting'
- PropertyChanges {
- target: alert_item
- opacity: 1
- }
- }
- ]
-
- Timer {
- id: alert_timer
- running: false
- interval: 4000
- onTriggered: alert_item.state = '';
- }
-
-
- Rectangle {
- id: background
- anchors.fill: parent
- color: "#000"
- opacity: 0.8
- }
-
- Rectangle {
- color: "#111"
- width: 500
- height: alert_text.height + 40
- radius: 8
- border.color: "#666"
- border.width: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- id: alert_text
- text: "This is a really really long long really really long longreally really long longreally really long longreally really long long alert"
- color: "#fff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: 24
- width: parent.width
- wrapMode: Text.WordWrap
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
deleted file mode 100644
index b8f4f09d56..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
+++ /dev/null
@@ -1,144 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-Item {
- id: container
- anchors.fill: parent
-
- property int horizontalLabelMargin: 20
-
- Image {
- id: phonetab
- source: "../Assets/PhoneTab.png"
- anchors.top: parent.top
- anchors.topMargin: (root.state === "phone") ? -height : 0
- Behavior on anchors.topMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Phone"
- onPress: go("phone")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.leftMargin: horizontalLabelMargin
- textAnchors.left: left
- }
- }
- Row {
- anchors.right: phonetab.right
- anchors.rightMargin: phonetab.width / 4
- anchors.top: parent.top
- height: phonetab.height
- spacing: 10
-
- Image {
- source: "../Assets/PhoneCornerIcons.png"
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
-
- Image {
- source: "../Assets/NavigationTab.png"
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: (root.state === "navigation") ? -height : 0
- Behavior on anchors.topMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Navigation"
- onPress: go("navigation")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.rightMargin: horizontalLabelMargin
- textAnchors.right: right
- }
- }
-
- Image {
- id: test1
- source: "../Assets/MediaTab.png"
- anchors.bottom: parent.bottom
- anchors.bottomMargin: (root.state === "media") ? -height : 0
- anchors.left: parent.left
- Behavior on anchors.bottomMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Media"
- onPress: go("media")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.leftMargin: horizontalLabelMargin
- textAnchors.left: left
- }
- }
-
- Image {
- source: "../Assets/VehicleTab.png"
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.bottomMargin: (root.state === "vehicle") ? -height : 0
- Behavior on anchors.bottomMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Vehicle"
- onPress: go("vehicle")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.rightMargin: horizontalLabelMargin
- textAnchors.right: right
- }
- }
-
- Image {
- id: chrometop
- source: "../Assets/ChromeTop.png"
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height / 18 + 35
- width: parent.width / 2 + 40
- fillMode: Image.PreserveAspectFit
- Clickable {
- onPress: go((root.state === 'home_corners') ? 'home' : 'home_corners')
- width: parent.width / 5
- height: parent.height
- anchors.left: parent.left
- anchors.leftMargin: (parent.width - parent.paintedWidth)/2 + 20
- }
-
- Text {
- id: clock
- text: "12:00"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 10
- color: "#ffffff"
- font.pixelSize: 28
- }
- }
- Image {
- source: "../Assets/ChromeBottom.png"
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height / 18 + 35
- width: parent.width / 2
- fillMode: Image.PreserveAspectFit
-
- Text {
- id: exterior_temp
- text: "72F Outside"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- color: "#ffffff"
- anchors.bottomMargin: 15
- font.pixelSize: 18
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
deleted file mode 100644
index c45f66782f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-import com.ford.phonecore 1.0
-
-LeftThirdSection {
- header: "Good Morning, Jen"
-
- Column {
- anchors.left: parent.left
- anchors.leftMargin: 60
- spacing: 40
- anchors.verticalCenter: parent.verticalCenter
-
- Weather {}
- Weather {
- text: "Tonight"
- temp: "55"
- image: "../Assets/CloudNight.png"
- }
- }
-
-
- Image {
- id: schedule
- source: "../Assets/CMaxCal.png"
- anchors.right: parent.right
- anchors.rightMargin: 70
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Column {
- anchors.right: schedule.left
- anchors.rightMargin: 20
- anchors.top: schedule.top
- anchors.topMargin: 5
- spacing: 40
-
- Button {
- text: "Dial"
- }
- Button {
- text: "Navigate"
- }
- Button {
- text: "Siri"
- onPress: PhoneCore.siriEyesFree()
- visible: PhoneCore.device_state === "connected" || PhoneCore.device_state === "playing"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
deleted file mode 100644
index 432e978b87..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
+++ /dev/null
@@ -1,133 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../Components"
-import "../Layouts"
-
-Item {
-
- Image {
- source: "../Assets/Crosshairs.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
-
- Image {
- id: phone_corner_icon
- visible: (PhoneCore.device_state === "connected")
- source: "../Assets/PhoneIcons.png"
- anchors.top: parent.top
- anchors.topMargin: 80
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- OverflowableText {
- id: phone_name
- text: PhoneCore.device_name
- anchors.top: phone_corner_icon.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- textAlign: 'center'
- anchors.topMargin: 10
- width: 350
- fontColor: (PhoneCore.device_state === "connected") ? "#ffffff" : "#333"
- font.pixelSize: 24
- }
-
- Text {
- text: "Connecting..."
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- color: "#333"
- visible: (PhoneCore.device_state === "connecting")
- font.pixelSize: 24
- }
-
- CheckButton {
- text: "Do Not Disturb"
- visible: (PhoneCore.device_state === "connected")
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- }
-
-
-
- Row {
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- visible: (PhoneCore.device_state === "disconnected")
- spacing: 10
-
- Button {
- text: "Connect"
- onPress: {
- PhoneCore.initializeDevice()
- }
- }
-
- Button {
- text: "Manage Phones"
- onPress: {
- go("phone");
- }
- }
- }
-
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.right: parent.right
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.right: parent.right
- anchors.bottom: parent.bottom
-
- Image {
- source: "../Assets/VehicleCornerIcon.png"
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.bottom: parent.bottom
-
- Image {
- id: media_corner_icon
- source: "../Assets/UsbIcon.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 40
- }
-
- Text {
- id: media_artist
- text: ""
- font.pixelSize: 18
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: media_corner_icon.bottom
- color: "#ffffff"
- anchors.topMargin: 10
- }
-
- Text {
- id: media_title
- text: ""
- font.pixelSize: 24
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: media_artist.bottom
- color: "#ffffff"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
deleted file mode 100644
index af33ddaffd..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- anchors.fill: parent
- id: section
-
- gradient: Gradient {
- GradientStop { position: 0.8; color: "#000000" }
- GradientStop { position: 1.0; color: "#7C3232" }
- }
-
- states: [
- State {
- name: 'menu'
- PropertyChanges { target: page; source: "Media/menu.qml" }
- },
- State {
- name: 'fm'
- PropertyChanges { target: page; source: "Media/fm.qml" }
- },
- State {
- name: 'sirius'
- PropertyChanges { target: page; source: "Media/sirius.qml" }
- },
- State {
- name: 'usb'
- PropertyChanges { target: page; source: "Media/usb.qml" }
- },
- State {
- name: 'bluetooth'
- PropertyChanges { target: page; source: "Media/bluetooth.qml" }
- },
- State {
- name: 'applink'
- PropertyChanges { target: page; source: "Media/applink.qml" }
- }
- ]
-
- transitions: [
- Transition {
- to: "bluetooth"
- },
- Transition {
- to: "usb"
- }
-
- ]
-
- Section {
- id: page
- source: "Media/usb.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
deleted file mode 100644
index e26326b458..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- id: section
- anchors.fill: parent
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#3C7855" }
- GradientStop { position: 0.4; color: "#000000" }
- }
-
- Section {
- id: page
- source: "Navigation/map.qml"
- }
-
- states: [
- State {
- name: ''
- PropertyChanges { target: page; source: "Navigation/map.qml" }
- },
- State {
- name: 'menu'
- PropertyChanges { target: page; source: "Navigation/menu.qml" }
- },
- State {
- name: 'keyboard_search'
- PropertyChanges { target: page; source: "Navigation/keyboard_search.qml" }
- },
- State {
- name: 'favorites'
- PropertyChanges { target: page; source: "Navigation/favorites.qml" }
- },
- State {
- name: 'recent_destinations'
- PropertyChanges { target: page; source: "Navigation/recent_destinations.qml" }
- },
- State {
- name: 'poi'
- PropertyChanges { target: page; source: "Navigation/poi.qml" }
- },
- State {
- name: 'video_moving_map'
- PropertyChanges { target: page; source: "Navigation/video_moving_map.qml" }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
deleted file mode 100644
index 8c2987f2f9..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- id: section
- anchors.fill: parent
-
- states: [
- State {
- name: ''
- PropertyChanges { target: page; source: "Phone/menu.qml" }
- },
- State {
- name: 'recent_calls'
- PropertyChanges { target: page; source: "Phone/recent_calls.qml" }
- },
- State {
- name: 'keypad'
- PropertyChanges { target: page; source: "Phone/keypad.qml" }
- },
- State {
- name: 'manage_devices'
- PropertyChanges { target: page; source: "Phone/manage_devices.qml" }
- }
- ]
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: Qt.rgba(0.454901961,0.37254902,0.203921569,1) }
- GradientStop { position: 0.4; color: "#000000" }
- }
-
- Section {
- id: page
- source: "Phone/menu.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
deleted file mode 100644
index 9687e7c463..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
+++ /dev/null
@@ -1,17 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- anchors.fill: parent
-
- gradient: Gradient {
- GradientStop { position: 0.4; color: "#000000" }
- GradientStop { position: 1.0; color: "#104369" }
- }
-
- Section {
- id: section
- source: "Vehicle/menu.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
deleted file mode 100644
index c6f0b0e769..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-import QtQuick 2.0
-import "Components"
-import com.ford.sdlcore 1.0
-import com.ford.phonecore 1.0
-
-Rectangle {
- id: root
- width: 800
- height: 470
- color: "#000"
-
- states: [
- State {
- name: "home"
- PropertyChanges { target: maincontent; source: "Sections/home.qml" }
- },
- State {
- name: "home_corners"
- PropertyChanges { target: maincontent; source: "Sections/home_corners.qml" }
- },
- State {
- name: "phone"
- PropertyChanges { target: maincontent; source: "Sections/phone.qml" }
- },
- State {
- name: "navigation"
- PropertyChanges { target: maincontent; source: "Sections/navigation.qml" }
- },
- State {
- name: "media"
- PropertyChanges { target: maincontent; source: "Sections/media.qml" }
- },
- State {
- name: "vehicle"
- PropertyChanges { target: maincontent; source: "Sections/vehicle.qml" }
- }
- ]
-
- transitions: [
- Transition {
- to: '*'
- PropertyAnimation { target: maincontent; property: 'opacity'; from: 0; to: 1}
- }
- ]
-
- function go(string) {
- state = string
- }
-
- Connections {
- target: AppLink
- onAlert: root.alert(message);
- }
-
- Connections {
- target: PhoneCore
- onCallAdded: root.alert("Incoming call: \n" + name + "\n" + number)
- onCallRemoved: root.alert("Call ended")
- }
-
- function alert(message) {
- alert_loader.item.alert(message)
- }
-
- Section {
- id: maincontent
- source: "Sections/home.qml"
- }
-
- Section {
- id: alert_loader
- source: "Sections/alert.qml"
- }
-
- Section {
- id: chrome
- source: "Sections/chrome.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
deleted file mode 100644
index 8fcc4a6d38..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// checksum 0x56a9 version 0x80001
-/*
- This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
- QtQuick2ApplicationViewer is a convenience class containing mobile device
- specific
- code such as screen orientation handling. Also QML paths and debugging are
- handled here.
- It is recommended not to modify this file, since newer versions of Qt Creator
- may offer an updated version of it.
-*/
-
-#include "qtquick2applicationviewer.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-#include <QtQml/QQmlEngine>
-
-class QtQuick2ApplicationViewerPrivate {
- QString mainQmlFile;
- friend class QtQuick2ApplicationViewer;
- static QString adjustPath(const QString& path);
-};
-
-QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString& path) {
-#if defined(Q_OS_MAC)
- if (!QDir::isAbsolutePath(path))
- return QString::fromLatin1("%1/../Resources/%2")
- .arg(QCoreApplication::applicationDirPath(), path);
-#elif defined(Q_OS_UNIX)
- const QString pathInInstallDir =
- QString::fromLatin1("%1/../%2")
- .arg(QCoreApplication::applicationDirPath(), path);
- if (QFileInfo(pathInInstallDir).exists())
- return pathInInstallDir;
-#endif
- return path;
-}
-
-QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow* parent)
- : QQuickView(parent), d(new QtQuick2ApplicationViewerPrivate()) {
- connect(engine(), SIGNAL(quit()), SLOT(close()));
- setResizeMode(QQuickView::SizeRootObjectToView);
-}
-
-QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() {
- delete d;
-}
-
-void QtQuick2ApplicationViewer::setMainQmlFile(const QString& file) {
- d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file);
- setSource(QUrl::fromLocalFile(d->mainQmlFile));
-}
-
-void QtQuick2ApplicationViewer::addImportPath(const QString& path) {
- engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path));
-}
-
-void QtQuick2ApplicationViewer::showExpanded() {
-#if defined(Q_WS_SIMULATOR)
- showFullScreen();
-#else
- show();
-#endif
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
deleted file mode 100644
index 42287e8d79..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// checksum 0xfde6 version 0x80001
-/*
- This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
- QtQuick2ApplicationViewer is a convenience class containing mobile device
- specific
- code such as screen orientation handling. Also QML paths and debugging are
- handled here.
- It is recommended not to modify this file, since newer versions of Qt Creator
- may offer an updated version of it.
- */
-
-#ifndef QTQUICK2APPLICATIONVIEWER_H
-#define QTQUICK2APPLICATIONVIEWER_H
-
-#include <QtQuick/QQuickView>
-
-class QtQuick2ApplicationViewer : public QQuickView {
- Q_OBJECT
-
- public:
- explicit QtQuick2ApplicationViewer(QWindow* parent = 0);
- virtual ~QtQuick2ApplicationViewer();
-
- void setMainQmlFile(const QString& file);
- void addImportPath(const QString& path);
-
- void showExpanded();
-
- private:
- class QtQuick2ApplicationViewerPrivate* d;
-};
-
-#endif // QTQUICK2APPLICATIONVIEWER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro b/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
deleted file mode 100644
index ea541b24ce..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
+++ /dev/null
@@ -1,48 +0,0 @@
-TEMPLATE = lib
-TARGET = FordSdlCore
-QT += qml quick
-CONFIG += qt plugin
-
-TARGET = $$qtLibraryTarget($$TARGET)
-uri = com.ford.sdlcore
-
-# Input
-SOURCES += \
- fordsdlcore_plugin.cpp \
- smartdevicelink.cpp \
- sdlalert.cpp \
- QtWebsocket/QWsSocket.cpp \
- QtWebsocket/QWsServer.cpp \
- sdlappslistmodel.cpp
-
-HEADERS += \
- fordsdlcore_plugin.h \
- smartdevicelink.h \
- sdlalert.h \
- QtWebsocket/QWsSocket.h \
- QtWebsocket/QWsServer.h \
- sdlappslistmodel.h
-
-OTHER_FILES = qmldir
-
-!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
- copy_qmldir.target = $$OUT_PWD/qmldir
- copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
- copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
- QMAKE_EXTRA_TARGETS += copy_qmldir
- PRE_TARGETDEPS += $$copy_qmldir.target
-}
-
-qmldir.files = qmldir
-unix {
- installPath = ../BananaSnacks/plugins/com/ford/sdlcore
- qmldir.path = $$installPath
- target.path = $$installPath
- INSTALLS += target qmldir
-}
-
-linux-g++* {
- QMAKE_CXXFLAGS += -m32
- QMAKE_LFLAGS += -m32
-}
-QMAKE_LIBDIR += /usr/lib/i386-linux-gnu/mesa
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
deleted file mode 100644
index 9c4eed8cc1..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
+++ /dev/null
@@ -1,456 +0,0 @@
-#include "QWsServer.h"
-
-#include <QRegExp>
-#include <QStringList>
-#include <QByteArray>
-#include <QCryptographicHash>
-#include <QDateTime>
-
-const QString QWsServer::regExpResourceNameStr(
- QLatin1String("^GET\\s(.*)\\sHTTP/1.1\r\n"));
-const QString QWsServer::regExpHostStr(
- QLatin1String("\r\nHost:\\s(.+(:\\d+)?)\r\n"));
-const QString QWsServer::regExpKeyStr(
- QLatin1String("\r\nSec-WebSocket-Key:\\s(.{24})\r\n"));
-const QString QWsServer::regExpKey1Str(
- QLatin1String("\r\nSec-WebSocket-Key1:\\s(.+)\r\n"));
-const QString QWsServer::regExpKey2Str(
- QLatin1String("\r\nSec-WebSocket-Key2:\\s(.+)\r\n"));
-const QString QWsServer::regExpKey3Str(QLatin1String("\r\n(.{8})$"));
-const QString QWsServer::regExpVersionStr(
- QLatin1String("\r\nSec-WebSocket-Version:\\s(\\d+)\r\n"));
-const QString QWsServer::regExpOriginStr(
- QLatin1String("\r\nSec-WebSocket-Origin:\\s(.+)\r\n"));
-const QString QWsServer::regExpOrigin2Str(
- QLatin1String("\r\nOrigin:\\s(.+)\r\n"));
-const QString QWsServer::regExpProtocolStr(
- QLatin1String("\r\nSec-WebSocket-Protocol:\\s(.+)\r\n"));
-const QString QWsServer::regExpExtensionsStr(
- QLatin1String("\r\nSec-WebSocket-Extensions:\\s(.+)\r\n"));
-
-QWsServer::QWsServer(QObject* parent) : QObject(parent) {
- tcpServer = new QTcpServer(this);
- connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newTcpConnection()));
- qsrand(QDateTime::currentMSecsSinceEpoch());
-}
-
-QWsServer::~QWsServer() {
- tcpServer->deleteLater();
-}
-
-bool QWsServer::listen(const QHostAddress& address, quint16 port) {
- return tcpServer->listen(address, port);
-}
-
-void QWsServer::close() {
- tcpServer->close();
-}
-
-QAbstractSocket::SocketError QWsServer::serverError() {
- return tcpServer->serverError();
-}
-
-QString QWsServer::errorString() {
- return tcpServer->errorString();
-}
-
-void QWsServer::newTcpConnection() {
- QTcpSocket* tcpSocket = tcpServer->nextPendingConnection();
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()));
- headerBuffer.insert(tcpSocket, QStringList());
-}
-
-void QWsServer::closeTcpConnection() {
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- tcpSocket->close();
-}
-
-void QWsServer::dataReceived() {
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- bool allHeadersFetched = false;
-
- const QLatin1String emptyLine("\r\n");
-
- while (tcpSocket->canReadLine()) {
- QString line = tcpSocket->readLine();
-
- if (line == emptyLine) {
- allHeadersFetched = true;
- break;
- }
-
- headerBuffer[tcpSocket].append(line);
- }
-
- if (!allHeadersFetched)
- return;
-
- QString request(headerBuffer[tcpSocket].join(""));
-
- QRegExp regExp;
- regExp.setMinimal(true);
-
- // Extract mandatory datas
- // Version
- regExp.setPattern(QWsServer::regExpVersionStr);
- regExp.indexIn(request);
- QString versionStr = regExp.cap(1);
- EWebsocketVersion version;
- if (!versionStr.isEmpty()) {
- version = (EWebsocketVersion)versionStr.toInt();
- } else if (tcpSocket->bytesAvailable() >= 8) {
- version = WS_V0;
- request.append(tcpSocket->read(8));
- } else {
- version = WS_VUnknow;
- }
-
- // Resource name
- regExp.setPattern(QWsServer::regExpResourceNameStr);
- regExp.indexIn(request);
- QString resourceName = regExp.cap(1);
-
- // Host (address & port)
- regExp.setPattern(QWsServer::regExpHostStr);
- regExp.indexIn(request);
- QString host = regExp.cap(1);
- QStringList hostTmp = host.split(':');
- QString hostAddress = hostTmp[0];
- QString hostPort;
- if (hostTmp.size() > 1)
- hostPort = hostTmp.last(); // fix for IPv6
-
- // Key
- QString key, key1, key2, key3;
- if (version >= WS_V4) {
- regExp.setPattern(QWsServer::regExpKeyStr);
- regExp.indexIn(request);
- key = regExp.cap(1);
- } else {
- regExp.setPattern(QWsServer::regExpKey1Str);
- regExp.indexIn(request);
- key1 = regExp.cap(1);
- regExp.setPattern(QWsServer::regExpKey2Str);
- regExp.indexIn(request);
- key2 = regExp.cap(1);
- regExp.setPattern(QWsServer::regExpKey3Str);
- regExp.indexIn(request);
- key3 = regExp.cap(1);
- }
-
- ////////////////////////////////////////////////////////////////////
-
- // If the mandatory fields are not specified, we abord the connection to the
- // Websocket server
- if (version == WS_VUnknow || resourceName.isEmpty() ||
- hostAddress.isEmpty() ||
- (key.isEmpty() && (key1.isEmpty() || key2.isEmpty() || key3.isEmpty()))) {
- // Send bad request response
- QString response = QWsServer::composeBadRequestResponse(
- QList<EWebsocketVersion>() << WS_V6 << WS_V7 << WS_V8 << WS_V13);
- tcpSocket->write(response.toUtf8());
- tcpSocket->flush();
- return;
- }
-
- ////////////////////////////////////////////////////////////////////
-
- // Extract optional datas
-
- // Origin
- regExp.setPattern(QWsServer::regExpOriginStr);
- if (regExp.indexIn(request) == -1) {
- regExp.setPattern(QWsServer::regExpOrigin2Str);
- regExp.indexIn(request);
- }
- QString origin = regExp.cap(1);
-
- // Protocol
- regExp.setPattern(QWsServer::regExpProtocolStr);
- regExp.indexIn(request);
- QString protocol = regExp.cap(1);
-
- // Extensions
- regExp.setPattern(QWsServer::regExpExtensionsStr);
- regExp.indexIn(request);
- QString extensions = regExp.cap(1);
-
- ////////////////////////////////////////////////////////////////////
-
- // Compose opening handshake response
- QString response;
-
- if (version >= WS_V6) {
- QString accept = computeAcceptV4(key);
- response = QWsServer::composeOpeningHandshakeResponseV6(accept, protocol);
- } else if (version >= WS_V4) {
- QString accept = computeAcceptV4(key);
- QString nonce = generateNonce();
- response =
- QWsServer::composeOpeningHandshakeResponseV4(accept, nonce, protocol);
- } else {
- QString accept = computeAcceptV0(key1, key2, key3);
- response = QWsServer::composeOpeningHandshakeResponseV0(
- accept, origin, hostAddress, hostPort, resourceName, protocol);
- }
-
- // Handshake OK, disconnect readyRead
- disconnect(tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()));
-
- // Send opening handshake response
- if (version == WS_V0)
- tcpSocket->write(response.toLatin1());
- else
- tcpSocket->write(response.toUtf8());
- tcpSocket->flush();
-
- QWsSocket* wsSocket = new QWsSocket(this, tcpSocket, version);
- wsSocket->setResourceName(resourceName);
- wsSocket->setHost(host);
- wsSocket->setHostAddress(hostAddress);
- wsSocket->setHostPort(hostPort.toInt());
- wsSocket->setOrigin(origin);
- wsSocket->setProtocol(protocol);
- wsSocket->setExtensions(extensions);
- wsSocket->serverSideSocket = true;
-
- // ORIGINAL CODE
- // int socketDescriptor = tcpSocket->socketDescriptor();
- // incomingConnection( socketDescriptor );
-
- // CHANGED CODE FOR LINUX COMPATIBILITY
- addPendingConnection(wsSocket);
- emit newConnection();
-}
-
-void QWsServer::incomingConnection(int socketDescriptor) {
- QTcpSocket* tcpSocket = new QTcpSocket(tcpServer);
- tcpSocket->setSocketDescriptor(socketDescriptor,
- QAbstractSocket::ConnectedState);
- QWsSocket* wsSocket = new QWsSocket(this, tcpSocket);
-
- addPendingConnection(wsSocket);
- emit newConnection();
-}
-
-void QWsServer::addPendingConnection(QWsSocket* socket) {
- if (pendingConnections.size() < maxPendingConnections())
- pendingConnections.enqueue(socket);
-}
-
-QWsSocket* QWsServer::nextPendingConnection() {
- return pendingConnections.dequeue();
-}
-
-bool QWsServer::hasPendingConnections() {
- if (pendingConnections.size() > 0)
- return true;
- return false;
-}
-
-int QWsServer::maxPendingConnections() {
- return tcpServer->maxPendingConnections();
-}
-
-bool QWsServer::isListening() {
- return tcpServer->isListening();
-}
-
-QNetworkProxy QWsServer::proxy() {
- return tcpServer->proxy();
-}
-
-QHostAddress QWsServer::serverAddress() {
- return tcpServer->serverAddress();
-}
-
-quint16 QWsServer::serverPort() {
- return tcpServer->serverPort();
-}
-
-void QWsServer::setMaxPendingConnections(int numConnections) {
- tcpServer->setMaxPendingConnections(numConnections);
-}
-
-void QWsServer::setProxy(const QNetworkProxy& networkProxy) {
- tcpServer->setProxy(networkProxy);
-}
-
-bool QWsServer::setSocketDescriptor(int socketDescriptor) {
- return tcpServer->setSocketDescriptor(socketDescriptor);
-}
-
-int QWsServer::socketDescriptor() {
- return tcpServer->socketDescriptor();
-}
-
-bool QWsServer::waitForNewConnection(int msec, bool* timedOut) {
- return tcpServer->waitForNewConnection(msec, timedOut);
-}
-
-QString QWsServer::computeAcceptV0(QString key1, QString key2, QString key3) {
- QString numStr1;
- QString numStr2;
-
- QChar carac;
- for (int i = 0; i < key1.size(); i++) {
- carac = key1[i];
- if (carac.isDigit())
- numStr1.append(carac);
- }
- for (int i = 0; i < key2.size(); i++) {
- carac = key2[i];
- if (carac.isDigit())
- numStr2.append(carac);
- }
-
- quint32 num1 = numStr1.toUInt();
- quint32 num2 = numStr2.toUInt();
-
- int numSpaces1 = key1.count(' ');
- int numSpaces2 = key2.count(' ');
-
- num1 /= numSpaces1;
- num2 /= numSpaces2;
-
- QString concat = serializeInt(num1) + serializeInt(num2) + key3;
-
- QByteArray md5 =
- QCryptographicHash::hash(concat.toLatin1(), QCryptographicHash::Md5);
-
- return QString(md5);
-}
-
-QString QWsServer::computeAcceptV4(QString key) {
- key += QLatin1String("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
- QByteArray hash =
- QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1);
- return hash.toBase64();
-}
-
-QString QWsServer::generateNonce() {
- qsrand(QDateTime::currentDateTime().toTime_t());
-
- QByteArray nonce;
- int i = 16;
-
- while (i--) {
- nonce.append(qrand() % 0x100);
- }
-
- return QString(nonce.toBase64());
-}
-
-QByteArray QWsServer::serializeInt(quint32 number, quint8 nbBytes) {
- QByteArray ba;
- quint8 currentNbBytes = 0;
- while (number > 0 && currentNbBytes < nbBytes) {
- char car = static_cast<char>(number & 0xFF);
- ba.prepend(car);
- number = number >> 8;
- currentNbBytes++;
- }
- char car = 0x00;
- while (currentNbBytes < nbBytes) {
- ba.prepend(car);
- currentNbBytes++;
- }
- return ba;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV0(QString accept,
- QString origin,
- QString hostAddress,
- QString hostPort,
- QString resourceName,
- QString protocol) {
- QString response;
-
- response.append(
- QLatin1String("HTTP/1.1 101 WebSocket Protocol Handshake\r\n"));
- response.append(QLatin1String("Upgrade: Websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Origin: ") + origin +
- QLatin1String("\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Location: ws://") + hostAddress);
- if (!hostPort.isEmpty())
- response.append(QLatin1String(":") + hostPort);
- response.append(resourceName + QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
- response.append(accept);
-
- return response;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV4(QString accept,
- QString nonce,
- QString protocol,
- QString extensions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 101 Switching Protocols\r\n"));
- response.append(QLatin1String("Upgrade: websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Accept: ") + accept +
- QLatin1String("\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Nonce: ") + nonce +
- QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- if (!extensions.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
-
- return response;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV6(QString accept,
- QString protocol,
- QString extensions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 101 Switching Protocols\r\n"));
- response.append(QLatin1String("Upgrade: websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Accept: ") + accept +
- QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- if (!extensions.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
-
- return response;
-}
-
-QString QWsServer::composeBadRequestResponse(
- QList<EWebsocketVersion> versions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 400 Bad Request\r\n"));
- if (!versions.isEmpty()) {
- QString versionsStr = QString::number((int)versions.takeLast());
- int i = versions.size();
- while (i--) {
- versionsStr.append(QLatin1String(", ") +
- QString::number((int)versions.takeLast()));
- }
- response.append(QLatin1String("Sec-WebSocket-Version: ") + versionsStr +
- QLatin1String("\r\n"));
- }
-
- return response;
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
deleted file mode 100644
index f37dd4b5b2..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef QWSSERVER_H
-#define QWSSERVER_H
-
-#include <QTcpServer>
-#include <QTcpSocket>
-#include <QNetworkProxy>
-#include <QString>
-#include <QStringList>
-#include <QMap>
-#include <QQueue>
-
-#include "QWsSocket.h"
-
-class QWsServer : public QObject {
- Q_OBJECT
-
- public:
- // ctor
- QWsServer(QObject* parent = 0);
- // dtor
- virtual ~QWsServer();
-
- // public functions
- void close();
- QString errorString();
- bool hasPendingConnections();
- bool isListening();
- bool listen(const QHostAddress& address = QHostAddress::Any,
- quint16 port = 0);
- int maxPendingConnections();
- virtual QWsSocket* nextPendingConnection();
- QNetworkProxy proxy();
- QHostAddress serverAddress();
- QAbstractSocket::SocketError serverError();
- quint16 serverPort();
- void setMaxPendingConnections(int numConnections);
- void setProxy(const QNetworkProxy& networkProxy);
- bool setSocketDescriptor(int socketDescriptor);
- int socketDescriptor();
- bool waitForNewConnection(int msec = 0, bool* timedOut = 0);
-
-signals:
- void newConnection();
-
- protected:
- // protected functions
- void addPendingConnection(QWsSocket* socket);
- virtual void incomingConnection(int socketDescriptor);
-
- private slots:
- // private slots
- void newTcpConnection();
- void closeTcpConnection();
- void dataReceived();
-
- private:
- // private attributes
- QTcpServer* tcpServer;
- QQueue<QWsSocket*> pendingConnections;
- QMap<const QTcpSocket*, QStringList> headerBuffer;
-
- public:
- // public static functions
- static QByteArray serializeInt(quint32 number, quint8 nbBytes = 4);
- static QString computeAcceptV0(QString key1, QString key2, QString thirdPart);
- static QString computeAcceptV4(QString key);
- static QString generateNonce();
- static QString composeOpeningHandshakeResponseV0(QString accept,
- QString origin,
- QString hostAddress,
- QString hostPort,
- QString resourceName,
- QString protocol = "");
- static QString composeOpeningHandshakeResponseV4(QString accept,
- QString nonce,
- QString protocol = "",
- QString extensions = "");
- static QString composeOpeningHandshakeResponseV6(QString accept,
- QString protocol = "",
- QString extensions = "");
- static QString composeBadRequestResponse(
- QList<EWebsocketVersion> versions = QList<EWebsocketVersion>());
-
- // public static vars
- static const QString regExpResourceNameStr;
- static const QString regExpHostStr;
- static const QString regExpKeyStr;
- static const QString regExpKey1Str;
- static const QString regExpKey2Str;
- static const QString regExpKey3Str;
- static const QString regExpVersionStr;
- static const QString regExpOriginStr;
- static const QString regExpOrigin2Str;
- static const QString regExpProtocolStr;
- static const QString regExpExtensionsStr;
-};
-
-#endif // QWSSERVER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
deleted file mode 100644
index 428f559517..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
+++ /dev/null
@@ -1,749 +0,0 @@
-#include "QWsSocket.h"
-
-#include <QCryptographicHash>
-#include <QtEndian>
-
-#include "QWsServer.h"
-
-int QWsSocket::maxBytesPerFrame = 1400;
-const QString QWsSocket::regExpAcceptStr(
- QLatin1String("Sec-WebSocket-Accept:\\s(.{28})\r\n"));
-const QString QWsSocket::regExpUpgradeStr(QLatin1String("Upgrade:\\s(.+)\r\n"));
-const QString QWsSocket::regExpConnectionStr(
- QLatin1String("Connection:\\s(.+)\r\n"));
-
-QWsSocket::QWsSocket(QObject* parent,
- QTcpSocket* socket,
- EWebsocketVersion ws_v)
- : QAbstractSocket(QAbstractSocket::UnknownSocketType, parent)
- , tcpSocket(socket ? socket : new QTcpSocket(this))
- , _version(ws_v)
- , _hostPort(-1)
- , closingHandshakeSent(false)
- , closingHandshakeReceived(false)
- , readingState(HeaderPending)
- , isFinalFragment(false)
- , hasMask(false)
- , payloadLength(0)
- , maskingKey(4, 0)
- , serverSideSocket(false) {
- tcpSocket->setParent(this);
-
- QAbstractSocket::setSocketState(tcpSocket->state());
- QAbstractSocket::setPeerAddress(tcpSocket->peerAddress());
- QAbstractSocket::setPeerPort(tcpSocket->peerPort());
-
- if (_version == WS_V0)
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV0()));
- else if (_version >= WS_V4)
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV4()));
- connect(tcpSocket,
- SIGNAL(error(QAbstractSocket::SocketError)),
- this,
- SIGNAL(error(QAbstractSocket::SocketError)));
- connect(tcpSocket,
- SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&,
- QAuthenticator*)),
- this,
- SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&,
- QAuthenticator*)));
- connect(tcpSocket,
- SIGNAL(stateChanged(QAbstractSocket::SocketState)),
- this,
- SLOT(processTcpStateChanged(QAbstractSocket::SocketState)));
- connect(tcpSocket,
- SIGNAL(readChannelFinished()),
- this,
- SIGNAL(readChannelFinished()));
- connect(tcpSocket, SIGNAL(hostFound()), this, SIGNAL(hostFound()));
-}
-
-QWsSocket::~QWsSocket() {
- QAbstractSocket::SocketState state = QAbstractSocket::state();
- if (state != QAbstractSocket::UnconnectedState) {
- qDebug() << "CloseAway, socket destroyed in server";
- close(CloseGoingAway, QLatin1String("The server destroyed the socket."));
- tcpSocket->abort();
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- QAbstractSocket::stateChanged(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::disconnected();
- }
-}
-
-void QWsSocket::connectToHost(const QString& hostName,
- quint16 port,
- OpenMode mode) {
- QWsSocket::connectToHost(QHostAddress(hostName), port, mode);
-}
-
-void QWsSocket::connectToHost(const QHostAddress& address,
- quint16 port,
- OpenMode mode) {
- handshakeResponse.clear();
- setPeerAddress(address);
- setPeerPort(port);
- setOpenMode(mode);
- tcpSocket->connectToHost(address, port, mode);
-}
-
-void QWsSocket::disconnectFromHost() {
- QWsSocket::close();
-}
-
-void QWsSocket::abort(QString reason) {
- QWsSocket::close(CloseAbnormalDisconnection, reason);
- tcpSocket->abort();
-}
-
-void QWsSocket::close(ECloseStatusCode closeStatusCode, QString reason) {
- if (QAbstractSocket::state() == QAbstractSocket::UnconnectedState)
- return;
-
- if (!closingHandshakeSent) {
- switch (_version) {
- case WS_V4:
- case WS_V5:
- case WS_V6:
- case WS_V7:
- case WS_V8:
- case WS_V13: {
- // Compose and send close frame
- QByteArray BA;
-
- // Body
- if (closeStatusCode == NoCloseStatusCode) {
- // Header
- BA.append(QWsSocket::composeHeader(true, OpClose, 0));
- } else {
- // Header
- QByteArray maskingKey;
- if (!serverSideSocket)
- maskingKey = QWsSocket::generateMaskingKey();
- BA.append(QWsSocket::composeHeader(
- true, OpClose, reason.size() + 2, maskingKey));
-
- QByteArray body;
-
- // Close status code (optional)
- body.append(QWsServer::serializeInt((int)closeStatusCode, 2));
-
- // Reason (optional)
- if (reason.size()) {
- QByteArray reason_ba = reason.toUtf8();
- if (!serverSideSocket) {
- reason_ba = QWsSocket::mask(reason_ba, maskingKey);
- }
- body.append(reason_ba);
- }
-
- BA.append(body);
- }
-
- // Send closing handshake
- tcpSocket->write(BA);
-
- break;
- }
- case WS_V0: {
- QByteArray closeFrame;
- closeFrame.append((char)0xFF);
- closeFrame.append((char)0x00);
- tcpSocket->write(closeFrame);
- break;
- }
- default: { break; }
- }
-
- closingHandshakeSent = true;
- }
-
- if (QAbstractSocket::state() != QAbstractSocket::ClosingState) {
- QAbstractSocket::setSocketState(QAbstractSocket::ClosingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ClosingState);
- emit QAbstractSocket::aboutToClose();
- }
-
- if (closingHandshakeSent && closingHandshakeReceived) {
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- emit stateChanged(QAbstractSocket::UnconnectedState);
- emit disconnected();
- tcpSocket->disconnectFromHost();
- }
-}
-
-qint64 QWsSocket::write(const QString& string) {
- if (_version == WS_V0) {
- return QWsSocket::write(string.toUtf8());
- }
-
- const QList<QByteArray>& framesList =
- QWsSocket::composeFrames(string.toUtf8(), false, maxBytesPerFrame);
- return writeFrames(framesList);
-}
-
-qint64 QWsSocket::write(const QByteArray& byteArray) {
- if (_version == WS_V0) {
- QByteArray BA;
- BA.append((char)0x00);
- BA.append(byteArray);
- BA.append((char)0xFF);
- return writeFrame(BA);
- }
-
- const QList<QByteArray>& framesList =
- QWsSocket::composeFrames(byteArray, true, maxBytesPerFrame);
-
- qint64 nbBytesWritten = writeFrames(framesList);
- emit bytesWritten(nbBytesWritten);
-
- return nbBytesWritten;
-}
-
-void QWsSocket::processHandshake() {
- // copy from QWsServer::dataReceived();
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- bool allHeadersFetched = false;
-
- const QLatin1String emptyLine("\r\n");
-
- while (tcpSocket->canReadLine()) {
- QString line = tcpSocket->readLine();
-
- if (line == emptyLine) {
- allHeadersFetched = true;
- break;
- }
-
- handshakeResponse.append(line);
- }
-
- if (!allHeadersFetched)
- return;
-
- QRegExp regExp;
- regExp.setMinimal(true);
-
- // check accept field
- regExp.setPattern(regExpAcceptStr);
- regExp.indexIn(handshakeResponse);
- QString acceptFromServer = regExp.cap(1);
-
- // check upgrade field
- regExp.setPattern(regExpUpgradeStr);
- regExp.indexIn(handshakeResponse);
- QString upgrade = regExp.cap(1);
-
- // check connection field
- regExp.setPattern(regExpConnectionStr);
- regExp.indexIn(handshakeResponse);
- QString connection = regExp.cap(1);
-
- // check extensions field
- regExp.setPattern(QWsServer::regExpExtensionsStr);
- regExp.indexIn(handshakeResponse);
- QString extensions = regExp.cap(1);
-
- // TODO: check extensions field
- // If the mandatory params are not setted, we abord the connection to the
- // Websocket server
- if ((acceptFromServer.isEmpty()) ||
- (!upgrade.contains(QLatin1String("websocket"), Qt::CaseInsensitive)) ||
- (!connection.contains(QLatin1String("Upgrade"), Qt::CaseInsensitive))) {
- // emit error(QAbstractSocket::ConnectionRefusedError);
- // return;
- }
-
- // TODO: check HTTP code
-
- // TODO: check protocol field
-
- QString accept = QWsServer::computeAcceptV4(key);
- if (accept != acceptFromServer) {
- // emit error(QAbstractSocket::ConnectionRefusedError);
- // return;
- }
-
- // handshake procedure succeeded
- QAbstractSocket::setSocketState(QAbstractSocket::ConnectedState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ConnectedState);
- emit QAbstractSocket::connected();
-}
-
-void QWsSocket::processDataV0() {
- if (state() == QAbstractSocket::ConnectingState) {
- processHandshake();
- return;
- }
-
- QByteArray BA, buffer;
- quint8 type, b = 0x00;
-
- BA = tcpSocket->read(1); // TODO: refactor like processDataV4
- type = BA[0];
-
- if ((type & 0x80) == 0x00) // MSB of type not set
- {
- if (type != 0x00) {
- // ABORT CONNEXION
- tcpSocket->readAll();
- return;
- }
-
- // read data
- do {
- BA = tcpSocket->read(1);
- b = BA[0];
- if (b != 0xFF)
- buffer.append(b);
- } while (b != 0xFF);
-
- currentFrame.append(buffer);
- } else // MSB of type set
- {
- if (type != 0xFF) {
- // ERROR, ABORT CONNEXION
- close();
- return;
- }
-
- quint8 length = 0x00;
-
- bool bIsNotZero = true;
- do {
- BA = tcpSocket->read(1);
- b = BA[0];
- bIsNotZero = (b != 0x00 ? true : false);
- if (bIsNotZero) // b must be != 0
- {
- quint8 b_v = b & 0x7F;
- length *= 128;
- length += b_v;
- }
- } while (((b & 0x80) == 0x80) && bIsNotZero);
-
- BA = tcpSocket->read(length); // discard this bytes
- }
-
- if (currentFrame.size() > 0) {
- emit frameReceived(QString::fromUtf8(currentFrame));
- currentFrame.clear();
- }
-
- if (tcpSocket->bytesAvailable())
- processDataV0();
-}
-
-void QWsSocket::processDataV4() {
- if (state() == QAbstractSocket::ConnectingState) {
- processHandshake();
- } else
- while (true)
- switch (readingState) {
- case HeaderPending: {
- if (tcpSocket->bytesAvailable() < 2)
- return;
-
- // END, RSV1-3, Opcode
- char header[2];
- tcpSocket->read(header, 2); // XXX: Handle return value
- isFinalFragment = (header[0] & 0x80) != 0;
- opcode = static_cast<EOpcode>(header[0] & 0x0F);
-
- // Mask, PayloadLength
- hasMask = (header[1] & 0x80) != 0;
- quint8 length = (header[1] & 0x7F);
-
- switch (length) {
- case 126:
- readingState = PayloadLengthPending;
- break;
- case 127:
- readingState = BigPayloadLenghPending;
- break;
- default:
- payloadLength = length;
- readingState = MaskPending;
- break;
- }
- }; break;
- case PayloadLengthPending: {
- if (tcpSocket->bytesAvailable() < 2)
- return;
-
- uchar length[2];
- tcpSocket->read(reinterpret_cast<char*>(length),
- 2); // XXX: Handle return value
- payloadLength =
- qFromBigEndian<quint16>(reinterpret_cast<const uchar*>(length));
- readingState = MaskPending;
- }; break;
- case BigPayloadLenghPending: {
- if (tcpSocket->bytesAvailable() < 8)
- return;
-
- uchar length[8];
- tcpSocket->read(reinterpret_cast<char*>(length),
- 8); // XXX: Handle return value
- // Most significant bit must be set to 0 as per
- // http://tools.ietf.org/html/rfc6455#section-5.2
- // XXX: Check for that?
- payloadLength = qFromBigEndian<quint64>(length) & ~(1LL << 63);
- readingState = MaskPending;
- }; break;
- case MaskPending: {
- if (!hasMask) {
- readingState = PayloadBodyPending;
- break;
- }
-
- if (tcpSocket->bytesAvailable() < 4)
- return;
-
- tcpSocket->read(maskingKey.data(), 4); // XXX: Handle return value
-
- if (opcode == OpClose) {
- readingState = CloseDataPending;
- } else {
- readingState = PayloadBodyPending;
- }
- }; /* Intentional fall-through */
- case PayloadBodyPending: {
- // TODO: Handle large payloads
- if (tcpSocket->bytesAvailable() < static_cast<qint32>(payloadLength))
- return;
-
- if (opcode == OpClose) {
- if (payloadLength >= 2 && tcpSocket->bytesAvailable() >= 2) {
- uchar bytes[2];
- tcpSocket->read(reinterpret_cast<char*>(bytes), 2);
- closeStatusCode = (ECloseStatusCode)qFromBigEndian<quint16>(
- reinterpret_cast<const uchar*>(bytes));
- } else {
- closeStatusCode = NoCloseStatusCode;
- }
- }
-
- QByteArray ApplicationData = tcpSocket->read(payloadLength);
- if (hasMask)
- ApplicationData = QWsSocket::mask(ApplicationData, maskingKey);
- currentFrame.append(ApplicationData);
-
- readingState = HeaderPending;
-
- if (!isFinalFragment)
- break;
-
- switch (opcode) {
- case OpBinary:
- emit frameReceived(currentFrame);
- break;
- case OpText:
- emit frameReceived(QString::fromUtf8(currentFrame));
- break;
- case OpPing:
- write(QWsSocket::composeHeader(true, OpPong, 0));
- break;
- case OpPong:
- emit pong(pingTimer.elapsed());
- break;
- case OpClose:
- closingHandshakeReceived = true;
- close(closeStatusCode);
- break;
- default:
- // DO NOTHING
- break;
- }
-
- currentFrame.clear();
- }; break;
- case CloseDataPending:
- default:
- break;
- } /* while (true) switch */
-}
-
-qint64 QWsSocket::writeFrame(const QByteArray& byteArray) {
- return tcpSocket->write(byteArray);
-}
-
-qint64 QWsSocket::writeFrames(const QList<QByteArray>& framesList) {
- qint64 nbBytesWritten = 0;
- for (int i = 0; i < framesList.size(); i++) {
- nbBytesWritten += writeFrame(framesList[i]);
- }
- return nbBytesWritten;
-}
-
-void QWsSocket::processTcpStateChanged(
- QAbstractSocket::SocketState tcpSocketState) {
- QAbstractSocket::SocketState wsSocketState = QAbstractSocket::state();
- switch (tcpSocketState) {
- case QAbstractSocket::HostLookupState: {
- QAbstractSocket::setSocketState(QAbstractSocket::HostLookupState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::HostLookupState);
- break;
- }
- case QAbstractSocket::ConnectingState: {
- QAbstractSocket::setSocketState(QAbstractSocket::ConnectingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ConnectingState);
- break;
- }
- case QAbstractSocket::ConnectedState: {
- if (wsSocketState == QAbstractSocket::ConnectingState) {
- key = QWsServer::generateNonce();
- QString handshake =
- composeOpeningHandShake(QLatin1String("/"),
- QLatin1String("example.com"),
- QString(),
- QString(),
- key);
- tcpSocket->write(handshake.toUtf8());
- }
- break;
- }
- case QAbstractSocket::ClosingState: {
- if (wsSocketState == QAbstractSocket::ConnectedState) {
- QWsSocket::close(CloseGoingAway);
- QAbstractSocket::setSocketState(QAbstractSocket::ClosingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ClosingState);
- emit QAbstractSocket::aboutToClose();
- }
- break;
- }
- case QAbstractSocket::UnconnectedState: {
- if (wsSocketState != QAbstractSocket::UnconnectedState) {
- QAbstractSocket::setSocketError(QAbstractSocket::NetworkError);
- emit QAbstractSocket::error(QAbstractSocket::NetworkError);
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::disconnected();
- }
- closingHandshakeSent = false;
- closingHandshakeReceived = false;
- break;
- }
- default:
- break;
- }
-}
-
-QByteArray QWsSocket::generateMaskingKey() {
- QByteArray key;
- for (int i = 0; i < 4; i++) {
- key.append(qrand() % 0x100);
- }
- return key;
-}
-
-QByteArray QWsSocket::generateMaskingKeyV4(QString key, QString nonce) {
- QString concat =
- key + nonce + QLatin1String("61AC5F19-FBBA-4540-B96F-6561F1AB40A8");
- QByteArray hash =
- QCryptographicHash::hash(concat.toUtf8(), QCryptographicHash::Sha1);
- return hash;
-}
-
-QByteArray QWsSocket::mask(QByteArray& data, QByteArray& maskingKey) {
- QByteArray result;
- result.reserve(data.size());
-
- for (int i = 0; i < data.size(); i++) {
- result[i] = (data[i] ^ maskingKey[i % 4]);
- }
-
- return result;
-}
-
-QList<QByteArray> QWsSocket::composeFrames(QByteArray byteArray,
- bool asBinary,
- int maxFrameBytes) {
- if (maxFrameBytes == 0)
- maxFrameBytes = maxBytesPerFrame;
-
- QList<QByteArray> framesList;
-
- QByteArray maskingKey;
-
- int nbFrames = byteArray.size() / maxFrameBytes + 1;
-
- for (int i = 0; i < nbFrames; i++) {
- QByteArray BA;
-
- // end, size
- bool end = false;
- quint64 size = maxFrameBytes;
- EOpcode opcode = OpContinue;
- if (i == nbFrames - 1) // for multi-frames
- {
- end = true;
- size = byteArray.size();
- }
- if (i == 0) {
- if (asBinary)
- opcode = OpBinary;
- else
- opcode = OpText;
- }
-
- // Header
- BA.append(QWsSocket::composeHeader(end, opcode, size, maskingKey));
-
- // Application Data
- QByteArray dataForThisFrame = byteArray.left(size);
- byteArray.remove(0, size);
-
- // dataForThisFrame = QWsSocket::mask( dataForThisFrame, maskingKey );
- BA.append(dataForThisFrame);
-
- framesList << BA;
- }
-
- return framesList;
-}
-
-QByteArray QWsSocket::composeHeader(bool end,
- EOpcode opcode,
- quint64 payloadLength,
- QByteArray maskingKey) {
- QByteArray BA;
- quint8 byte;
-
- // end, RSV1-3, Opcode
- byte = 0x00;
- // end
- if (end)
- byte = (byte | 0x80);
- // Opcode
- byte = (byte | opcode);
- BA.append(byte);
-
- // Mask, PayloadLength
- byte = 0x00;
- QByteArray BAsize;
- // Mask
- if (maskingKey.size() == 4)
- byte = (byte | 0x80);
- // PayloadLength
- if (payloadLength <= 125) {
- byte = (byte | payloadLength);
- }
- // Extended payloadLength
- else {
- // 2 bytes
- if (payloadLength <= 0xFFFF) {
- byte = (byte | 126);
- BAsize.append((payloadLength >> 1 * 8) & 0xFF);
- BAsize.append((payloadLength >> 0 * 8) & 0xFF);
- }
- // 8 bytes
- else if (payloadLength <= 0x7FFFFFFF) {
- byte = (byte | 127);
- BAsize.append((payloadLength >> 7 * 8) & 0xFF);
- BAsize.append((payloadLength >> 6 * 8) & 0xFF);
- BAsize.append((payloadLength >> 5 * 8) & 0xFF);
- BAsize.append((payloadLength >> 4 * 8) & 0xFF);
- BAsize.append((payloadLength >> 3 * 8) & 0xFF);
- BAsize.append((payloadLength >> 2 * 8) & 0xFF);
- BAsize.append((payloadLength >> 1 * 8) & 0xFF);
- BAsize.append((payloadLength >> 0 * 8) & 0xFF);
- }
- }
- BA.append(byte);
- BA.append(BAsize);
-
- // Masking
- if (maskingKey.size() == 4)
- BA.append(maskingKey);
-
- return BA;
-}
-
-void QWsSocket::ping() {
- pingTimer.restart();
- QByteArray pingFrame = QWsSocket::composeHeader(true, OpPing, 0);
- writeFrame(pingFrame);
-}
-
-void QWsSocket::setResourceName(QString rn) {
- _resourceName = rn;
-}
-
-void QWsSocket::setHost(QString h) {
- _host = h;
-}
-
-void QWsSocket::setHostAddress(QString ha) {
- _hostAddress = ha;
-}
-
-void QWsSocket::setHostPort(int hp) {
- _hostPort = hp;
-}
-
-void QWsSocket::setOrigin(QString o) {
- _origin = o;
-}
-
-void QWsSocket::setProtocol(QString p) {
- _protocol = p;
-}
-
-void QWsSocket::setExtensions(QString e) {
- _extensions = e;
-}
-
-EWebsocketVersion QWsSocket::version() {
- return _version;
-}
-
-QString QWsSocket::resourceName() {
- return _resourceName;
-}
-
-QString QWsSocket::host() {
- return _host;
-}
-
-QString QWsSocket::hostAddress() {
- return _hostAddress;
-}
-
-int QWsSocket::hostPort() {
- return _hostPort;
-}
-
-QString QWsSocket::origin() {
- return _origin;
-}
-
-QString QWsSocket::protocol() {
- return _protocol;
-}
-
-QString QWsSocket::extensions() {
- return _extensions;
-}
-
-QString QWsSocket::composeOpeningHandShake(QString resourceName,
- QString host,
- QString origin,
- QString extensions,
- QString key) {
- QString hs;
- hs.append(QLatin1String("GET ") + resourceName +
- QLatin1String(" HTTP/1.1\r\n"));
- hs.append(QLatin1String("Host: ") + host + "\r\n");
- hs.append(QLatin1String("Upgrade: websocket\r\n"));
- hs.append(QLatin1String("Connection: Upgrade\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Key: ") + key + QLatin1String("\r\n"));
- hs.append(QLatin1String("Origin: ") + origin + QLatin1String("\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Version: 13\r\n"));
- hs.append(QLatin1String("\r\n"));
- return hs;
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
deleted file mode 100644
index cdd19db38a..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
+++ /dev/null
@@ -1,181 +0,0 @@
-#ifndef QWSSOCKET_H
-#define QWSSOCKET_H
-
-#include <QTcpSocket>
-#include <QHostAddress>
-#include <QTime>
-
-enum EWebsocketVersion {
- WS_VUnknow = -1,
- WS_V0 = 0,
- WS_V4 = 4,
- WS_V5 = 5,
- WS_V6 = 6,
- WS_V7 = 7,
- WS_V8 = 8,
- WS_V13 = 13
-};
-
-class QWsSocket : public QAbstractSocket {
- Q_OBJECT
-
- friend class QWsServer;
-
- public:
- enum EOpcode {
- OpContinue = 0x0,
- OpText = 0x1,
- OpBinary = 0x2,
- OpReserved3 = 0x3,
- OpReserved4 = 0x4,
- OpReserved5 = 0x5,
- OpReserved6 = 0x6,
- OpReserved7 = 0x7,
- OpClose = 0x8,
- OpPing = 0x9,
- OpPong = 0xA,
- OpReservedB = 0xB,
- OpReservedV = 0xC,
- OpReservedD = 0xD,
- OpReservedE = 0xE,
- OpReservedF = 0xF
- };
- enum ECloseStatusCode {
- NoCloseStatusCode = 0,
- CloseNormal = 1000,
- CloseGoingAway = 1001,
- CloseProtocolError = 1002,
- CloseDataTypeNotSupported = 1003,
- CloseReserved1004 = 1004,
- CloseMissingStatusCode = 1005,
- CloseAbnormalDisconnection = 1006,
- CloseWrongDataType = 1007,
- ClosePolicyViolated = 1008,
- CloseTooMuchData = 1009,
- CloseMissingExtension = 1010,
- CloseBadOperation = 1011,
- CloseTLSHandshakeFailed = 1015
- };
-
- public:
- // ctor
- QWsSocket(QObject* parent = 0,
- QTcpSocket* socket = 0,
- EWebsocketVersion ws_v = WS_V13);
- // dtor
- virtual ~QWsSocket();
-
- // Public methods
- EWebsocketVersion version();
- QString resourceName();
- QString host();
- QString hostAddress();
- int hostPort();
- QString origin();
- QString protocol();
- QString extensions();
-
- void setResourceName(QString rn);
- void setHost(QString h);
- void setHostAddress(QString ha);
- void setHostPort(int hp);
- void setOrigin(QString o);
- void setProtocol(QString p);
- void setExtensions(QString e);
-
- qint64 write(const QString& string); // write data as text
- qint64 write(const QByteArray& byteArray); // write data as binary
-
- public slots:
- void connectToHost(const QString& hostName,
- quint16 port,
- OpenMode mode = ReadWrite);
- void connectToHost(const QHostAddress& address,
- quint16 port,
- OpenMode mode = ReadWrite);
- void disconnectFromHost();
- void abort(QString reason = QString());
- void ping();
-
-signals:
- void frameReceived(QString frame);
- void frameReceived(QByteArray frame);
- void pong(quint64 elapsedTime);
-
- protected:
- qint64 writeFrames(const QList<QByteArray>& framesList);
- qint64 writeFrame(const QByteArray& byteArray);
-
- protected slots:
- virtual void close(ECloseStatusCode closeStatusCode = NoCloseStatusCode,
- QString reason = QString());
- void processDataV0();
- void processDataV4();
- void processHandshake();
- void processTcpStateChanged(QAbstractSocket::SocketState socketState);
-
- private:
- enum EReadingState {
- HeaderPending,
- PayloadLengthPending,
- BigPayloadLenghPending,
- MaskPending,
- PayloadBodyPending,
- CloseDataPending
- };
-
- // private vars
- QTcpSocket* tcpSocket;
- QByteArray currentFrame;
- QTime pingTimer;
-
- EWebsocketVersion _version;
- QString _resourceName;
- QString _host;
- QString _hostAddress;
- int _hostPort;
- QString _origin;
- QString _protocol;
- QString _extensions;
- bool serverSideSocket;
-
- bool closingHandshakeSent;
- bool closingHandshakeReceived;
-
- EReadingState readingState;
- EOpcode opcode;
- bool isFinalFragment;
- bool hasMask;
- quint64 payloadLength;
- QByteArray maskingKey;
- ECloseStatusCode closeStatusCode;
-
- static const QString regExpAcceptStr;
- static const QString regExpUpgradeStr;
- static const QString regExpConnectionStr;
- QString handshakeResponse;
- QString key;
-
- public:
- // Static functions
- static QByteArray generateMaskingKey();
- static QByteArray generateMaskingKeyV4(QString key, QString nonce);
- static QByteArray mask(QByteArray& data, QByteArray& maskingKey);
- static QList<QByteArray> composeFrames(QByteArray byteArray,
- bool asBinary = false,
- int maxFrameBytes = 0);
- static QByteArray composeHeader(bool end,
- EOpcode opcode,
- quint64 payloadLength,
- QByteArray maskingKey = QByteArray());
- static QString composeOpeningHandShake(QString resourceName,
- QString host,
- QString origin,
- QString extensions,
- QString key);
-
- // static vars
- static int maxBytesPerFrame;
-};
-
-#endif // QWSSOCKET_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
deleted file mode 100644
index f52bda256e..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2012-03-05T10:38:43
-#
-#-------------------------------------------------
-
-QT += network
-
-QT -= gui
-
-TARGET = QtWebsocket
-TEMPLATE = lib
-CONFIG += staticlib
-
-SOURCES += \
- QWsServer.cpp \
- QWsSocket.cpp
-
-HEADERS += \
- QWsServer.h \
- QWsSocket.h
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
deleted file mode 100644
index 306dcada09..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
+++ /dev/null
@@ -1,328 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="QtWebsocket"
- ProjectGUID="{7E3A920C-4257-41A1-B9B9-BFA138C1C8A2}"
- Keyword="Qt4VSv1.0"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
- PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_NO_DEBUG,NDEBUG;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="false"
- DebugInformationFormat="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)\$(ProjectName).lib"
- AdditionalLibraryDirectories="$(QTDIR)\lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
- PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="false"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)\$(ProjectName).lib"
- AdditionalLibraryDirectories="$(QTDIR)\lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;c;def"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\QWsServer.cpp"
- >
- </File>
- <File
- RelativePath=".\QWsSocket.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\QWsServer.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsServer.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsServer.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\QWsSocket.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsSocket.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsSocket.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Form Files"
- Filter="ui"
- UniqueIdentifier="{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="qrc;*"
- UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"
- ParseFiles="false"
- >
- </Filter>
- <Filter
- Name="Generated Files"
- Filter="moc;h;cpp"
- UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"
- SourceControlFiles="false"
- >
- <Filter
- Name="Release"
- Filter="cpp;moc"
- SourceControlFiles="false"
- >
- <File
- RelativePath=".\GeneratedFiles\Release\moc_QWsServer.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\GeneratedFiles\Release\moc_QWsSocket.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Debug"
- Filter="cpp;moc"
- SourceControlFiles="false"
- >
- <File
- RelativePath=".\GeneratedFiles\Debug\moc_QWsServer.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\GeneratedFiles\Debug\moc_QWsSocket.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- <Global
- Name="lreleaseOptions"
- Value=""
- />
- <Global
- Name="lupdateOnBuild"
- Value="0"
- />
- <Global
- Name="lupdateOptions"
- Value=""
- />
- <Global
- Name="MocDir"
- Value=".\GeneratedFiles\$(ConfigurationName)"
- />
- <Global
- Name="MocOptions"
- Value=""
- />
- <Global
- Name="QtVersion Win32"
- Value="4.8.2"
- />
- <Global
- Name="RccDir"
- Value=".\GeneratedFiles"
- />
- <Global
- Name="UicDir"
- Value=".\GeneratedFiles"
- />
- </Globals>
-</VisualStudioProject>
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
deleted file mode 100644
index 003b098d47..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "fordsdlcore_plugin.h"
-#include "smartdevicelink.h"
-#include <QDebug>
-#include <qqml.h>
-#include "sdlalert.h"
-#include <QQmlEngine>
-#include <QQmlContext>
-
-QObject* sdlSingleton(QQmlEngine* engine, QJSEngine* js) {
- Q_UNUSED(engine)
- Q_UNUSED(js)
-
- engine->rootContext()->setContextProperty(
- "MediaApps", SmartDeviceLink::getInstance().getMediaApps());
-
- return (QObject*)&SmartDeviceLink::getInstance();
-}
-
-QObject* mediaAppsSingleton(QQmlEngine* engine, QJSEngine* js) {
- Q_UNUSED(engine)
- Q_UNUSED(js)
-
- return (QObject*)SmartDeviceLink::getInstance().getMediaApps();
-}
-
-void FordSdlCorePlugin::registerTypes(const char* uri) {
- qmlRegisterSingletonType<SdlAppsListModel>(
- uri, 1, 0, "MediaApps", mediaAppsSingleton);
- qmlRegisterSingletonType<SmartDeviceLink>(uri, 1, 0, "AppLink", sdlSingleton);
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
deleted file mode 100644
index 2c8bf39d28..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef FORDSDLCORE_PLUGIN_H
-#define FORDSDLCORE_PLUGIN_H
-
-#include <QQmlExtensionPlugin>
-
-class FordSdlCorePlugin : public QQmlExtensionPlugin {
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // FORDSDLCORE_PLUGIN_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/qmldir b/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
deleted file mode 100644
index da1a7b7f96..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdlcore
-plugin FordSdlCore
-
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
deleted file mode 100644
index ec4350df77..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "sdlalert.h"
-
-SdlAlert::SdlAlert(QObject* parent) : QQuickItem() {}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
deleted file mode 100644
index 9c32718c56..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SDLALERT_H
-#define SDLALERT_H
-
-#include <QQuickItem>
-
-class SdlAlert : public QQuickItem {
- Q_OBJECT
- public:
- explicit SdlAlert(QObject* parent = 0);
-
-signals:
-
- public slots:
-};
-
-#endif // SDLALERT_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
deleted file mode 100644
index 419908339e..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "sdlappslistmodel.h"
-
-SdlAppsListModel::SdlAppsListModel(QObject* parent)
- : QAbstractListModel(parent) {}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
deleted file mode 100644
index b78aeeec01..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef SDLAPPSLISTMODEL_H
-#define SDLAPPSLISTMODEL_H
-
-#include <QAbstractListModel>
-#include <QStringList>
-
-class SdlAppsListModel : public QAbstractListModel {
- Q_OBJECT
- public:
- explicit SdlAppsListModel(QObject* parent = 0);
-
- int rowCount(const QModelIndex& parent) const {
- return m_data.size();
- }
-
- QVariant data(const QModelIndex& index, int role) const {
- return m_data.values().at(index.row());
- }
-
- virtual QHash<int, QByteArray> roleNames() const {
- QHash<int, QByteArray> roles;
- roles['t'] = "text";
- return roles;
- }
-
- void append(int id, QString string) {
- beginResetModel();
- m_data.clear();
- m_data[id] = string;
- endResetModel();
- }
-
- void clear() {
- beginResetModel();
- m_data.clear();
- endResetModel();
- }
-
-signals:
-
- public slots:
-
- private:
- QHash<int, QString> m_data;
-};
-
-#endif // SDLAPPSLISTMODEL_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
deleted file mode 100644
index 5ee8c455e9..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-#include "smartdevicelink.h"
-#include <QDebug>
-#include "QtWebsocket/QWsSocket.h"
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <unistd.h>
-
-SmartDeviceLink::SmartDeviceLink(QQuickItem* parent) : QObject(parent) {
- connect(&m_ws_basic, SIGNAL(connected()), this, SLOT(basic_connected()));
- connect(&m_ws_basic,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(basic_receive(QString)));
- connect(&m_ws_basic, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_buttons, SIGNAL(connected()), this, SLOT(buttons_connected()));
- connect(&m_ws_buttons,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(buttons_receive(QString)));
- connect(&m_ws_buttons, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_tts, SIGNAL(connected()), this, SLOT(tts_connected()));
- connect(&m_ws_tts,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(tts_receive(QString)));
- connect(&m_ws_tts, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_vehicle, SIGNAL(connected()), this, SLOT(vehicle_connected()));
- connect(&m_ws_vehicle,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(vehicle_receive(QString)));
- connect(&m_ws_vehicle, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_ui, SIGNAL(connected()), this, SLOT(ui_connected()));
- connect(&m_ws_ui,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(ui_receive(QString)));
- connect(&m_ws_ui, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_vr, SIGNAL(connected()), this, SLOT(vr_connected()));
- connect(&m_ws_vr,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(vr_receive(QString)));
- connect(&m_ws_vr, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(this,
- SIGNAL(newAppAvailable(int, QString)),
- this,
- SLOT(registerApp(int, QString)));
-
- m_ws_buttons.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_tts.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_vr.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_basic.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_vehicle.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_ui.connectToHost(QLatin1String("127.0.0.1"), 8087);
-}
-
-SmartDeviceLink::~SmartDeviceLink() {
- qDebug() << "SmartDeviceLink destroyed";
-}
-
-void SmartDeviceLink::basic_connected() {
- basic_send(
- "{\"jsonrpc\":\"2.0\",\"id\":600,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"BasicCommunicationClient\"}}");
-}
-
-void SmartDeviceLink::buttons_connected() {
- buttons_send(
- "{\"jsonrpc\":\"2.0\",\"id\":200,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"Buttons\"}}");
-}
-
-void SmartDeviceLink::tts_connected() {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":300,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"TTS\"}}");
-}
-
-void SmartDeviceLink::vehicle_connected() {
- vehicle_send(
- "{\"jsonrpc\":\"2.0\",\"id\":700,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"VehicleInfo\"}}");
-}
-
-void SmartDeviceLink::ui_connected() {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":400,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"UI\"}}");
-}
-
-void SmartDeviceLink::vr_connected() {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":500,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"VR\"}}");
-}
-
-void SmartDeviceLink::basic_send(QString message) {
- qDebug() << "Sending (basic):" << message;
- m_ws_basic.write(message.append('\n'));
-}
-
-void SmartDeviceLink::buttons_send(QString message) {
- qDebug() << "Sending (buttons):" << message;
- m_ws_buttons.write(message.append('\n'));
-}
-
-void SmartDeviceLink::tts_send(QString message) {
- qDebug() << "Sending (tts):" << message;
- m_ws_tts.write(message.append('\n'));
-}
-
-void SmartDeviceLink::vehicle_send(QString message) {
- qDebug() << "Sending (vehicle):" << message;
- m_ws_vehicle.write(message.append('\n'));
-}
-
-void SmartDeviceLink::ui_send(QString message) {
- qDebug() << "Sending (ui):" << message;
- m_ws_ui.write(message.append('\n'));
-}
-
-void SmartDeviceLink::vr_send(QString message) {
- qDebug() << "Sending (vr):" << message;
- m_ws_vr.write(message.append('\n'));
-}
-
-void SmartDeviceLink::basic_receive(QString message) {
- qDebug() << "Receiving(basic):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- int result = root.value("result").toDouble();
- QString method = root.value("method").toString();
-
- if (id == 600) {
- char* reg, *unreg, *update;
-
- asprintf(&reg,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnAppRegistered\"}}",
- result + 1);
- basic_send(reg);
- free(reg);
-
- asprintf(&unreg,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnAppUnregistered\"}}",
- result + 2);
- basic_send(unreg);
- free(unreg);
-
- asprintf(&update,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnDeviceListUpdated\"}} ",
- result + 3);
- basic_send(update);
- free(update);
- } else if (method.compare("BasicCommunication.OnAppRegistered") == 0) {
- QJsonObject params = root.value("params").toObject();
- QJsonObject application = params.value("application").toObject();
- QString appName = application.value("appName").toString();
- int appId = application.value("appId").toDouble();
-
- char* update;
- asprintf(&update,
- "{\"jsonrpc\":\"2.0\",\"id\":3000,\"method\":\"BasicCommunication."
- "ActivateApp\",\"params\":{\"appName\":\"%s\",\"appId\":%i}}",
- appName.toLocal8Bit().data(),
- appId);
- basic_send(update);
- free(update);
- emit newAppAvailable(appId, appName);
- } else if (method.compare("BasicCommunication.OnAppUnregistered") == 0) {
- m_media_apps.clear();
- }
-}
-
-void SmartDeviceLink::buttons_receive(QString message) {
- qDebug() << "Receiving(buttons):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("Buttons.GetCapabilities") == 0) {
- buttons_send(
- "{\"jsonrpc\":\"2.0\",\"id\":19,\"result\":{\"capabilities\":[{"
- "\"name\":\"PRESET_0\",\"shortPressAvailable\":true,"
- "\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":"
- "\"PRESET_1\",\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_2\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_3\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_4\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_5\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_6\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_7\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_8\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_9\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"OK\",\"shortPressAvailable\":"
- "true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":"
- "\"SEEKLEFT\",\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"SEEKRIGHT\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"TUNEUP\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"TUNEDOWN\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true}],\"presetBankCapabilities\":{"
- "\"onScreenPresetsAvailable\":true},\"method\":\"Buttons."
- "GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}}");
- }
-}
-
-void SmartDeviceLink::tts_receive(QString message) {
- qDebug() << "Receiving(tts):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("TTS.GetCapabilities") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":18,\"result\":{\"capabilities\":[\"TEXT\"]"
- ",\"resultCode\":\"SUCCESS\",\"method\":\"TTS."
- "GetCapabilitiesResponse\"}}");
- } else if (method.compare("TTS.GetLanguage") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":26,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"TTS.GetLanguageResponse\",\"language\":\"EN-US\"}}");
- } else if (method.compare("TTS.GetSupportedLanguages") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":22,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"TTS.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- }
-}
-
-void SmartDeviceLink::vehicle_receive(QString message) {
- qDebug() << "Receiving(vehicle):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("VehicleInfo.GetVehicleType") == 0) {
- vehicle_send(
- "{\"jsonrpc\":\"2.0\",\"id\":20,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VehicleInfo.GetVehicleTypeResponse\",\"vehicleType\":{"
- "\"make\":\"Ford\",\"model\":\"Fiesta\",\"modelYear\":\"2013\","
- "\"trim\":\"SE\"}}}");
- }
-}
-
-void SmartDeviceLink::ui_receive(QString message) {
- qDebug() << "Receiving(ui):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- int result = root.value("result").toDouble();
- QString method = root.value("method").toString();
-
- if (id == 400) {
- char* onchoise;
- asprintf(&onchoise,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"VR.OnChoise\"}}",
- result + 1);
- ui_send(onchoise);
- free(onchoise);
-
- ui_send("{\"jsonrpc\":\"2.0\",\"method\":\"UI.OnReady\"}");
- } else if (method.compare("UI.GetCapabilities") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":16,\"result\":{\"displayCapabilities\":{"
- "\"displayType\":\"GEN2_8_DMA\",\"textFields\":[{\"name\":"
- "\"mainField1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{"
- "\"name\":\"mainField2\",\"characterSet\":\"TYPE2SET\",\"width\":1,"
- "\"rows\":1},{\"name\":\"statusBar\",\"characterSet\":\"TYPE2SET\","
- "\"width\":1,\"rows\":1},{\"name\":\"mediaClock\",\"characterSet\":"
- "\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"mediaTrack\","
- "\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":"
- "\"alertText1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{"
- "\"name\":\"alertText2\",\"characterSet\":\"TYPE2SET\",\"width\":1,"
- "\"rows\":1}],\"mediaClockFormats\":[\"CLOCK1\",\"CLOCK2\","
- "\"CLOCKTEXT1\",\"CLOCKTEXT2\",\"CLOCKTEXT3\"]},"
- "\"hmiZoneCapabilities\":[\"FRONT\",\"BACK\"],"
- "\"softButtonCapabilities\":[{\"shortPressAvailable\":true,"
- "\"longPressAvailable\":true,\"upDownAvailable\":true,"
- "\"imageSupported\":true}],\"method\":\"UI.GetCapabilitiesResponse\","
- "\"resultCode\":\"SUCCESS\"}}");
- } else if (method.compare("UI.GetSupportedLanguages") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":21,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"UI.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- } else if (method.compare("UI.GetLanguage") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":24,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"UI.GetLanguageResponse\",\"hmiDisplayLanguage\":\"EN-"
- "US\"}}");
- } else if (method.compare("UI.Show") == 0) {
- QJsonObject params = root.value("params").toObject();
- setShow1(params.value("mainField1").toString());
- setShow2(params.value("mainField2").toString());
- char* response;
- asprintf(&response,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":"
- "\"SUCCESS\",\"method\":\"UI.ShowResponse\"}}",
- id);
- ui_send(response);
- free(response);
- } else if (method.compare("UI.Alert") == 0) {
- QJsonObject params = root.value("params").toObject();
- QString message(params.value("AlertText1").toString());
- message.append("\n").append(params.value("AlertText2").toString());
- char* response;
- asprintf(&response,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":"
- "\"SUCCESS\",\"method\":\"UI.AlertResponse\"}}",
- id);
- ui_send(response);
- free(response);
- emit alert(message);
- }
-}
-
-void SmartDeviceLink::vr_receive(QString message) {
- qDebug() << "Receiving(vr):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("VR.GetCapabilities") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":17,\"result\":{\"capabilities\":[\"TEXT\"]"
- ",\"method\":\"VR.GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}"
- "}");
- } else if (method.compare("VR.GetSupportedLanguages") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":23,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VR.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- } else if (method.compare("VR.GetLanguage") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":25,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VR.GetLanguageResponse\",\"language\":\"EN-US\"}}");
- }
-}
-
-void SmartDeviceLink::registerApp(int appId, QString appName) {
- qDebug() << "New app registered:" << appName;
- m_media_apps.append(appId, appName);
-}
-
-void SmartDeviceLink::setShow1(QString show) {
- m_show1 = show;
- emit show1Changed(show);
-}
-
-void SmartDeviceLink::setShow2(QString show) {
- m_show2 = show;
- emit show2Changed(show);
-}
-
-void SmartDeviceLink::disconnected() {
- qDebug() << "Websocket disconnected";
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
deleted file mode 100644
index 18ad605f40..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef SMARTDEVICELINK_H
-#define SMARTDEVICELINK_H
-
-#include <QQuickItem>
-#include <QStringListModel>
-#include "QtWebsocket/QWsSocket.h"
-#include "sdlappslistmodel.h"
-
-class SmartDeviceLink : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString show1 READ getShow1 NOTIFY show1Changed)
- Q_PROPERTY(QString show2 READ getShow2 NOTIFY show2Changed)
-
- public:
- SmartDeviceLink(QQuickItem* parent = 0);
- ~SmartDeviceLink();
-
- static SmartDeviceLink& getInstance() {
- static SmartDeviceLink instance;
- return instance;
- }
-
- SdlAppsListModel* getMediaApps() {
- return &m_media_apps;
- }
- QString getShow1() {
- return m_show1;
- }
- QString getShow2() {
- return m_show2;
- }
-
- private:
- QWsSocket m_ws_basic;
- QWsSocket m_ws_tts;
- QWsSocket m_ws_buttons;
- QWsSocket m_ws_vehicle;
- QWsSocket m_ws_ui;
- QWsSocket m_ws_vr;
-
- SdlAppsListModel m_media_apps;
-
- QString m_show1;
- QString m_show2;
-
- void basic_send(QString message);
- void tts_send(QString message);
- void buttons_send(QString message);
- void vehicle_send(QString message);
- void ui_send(QString message);
- void vr_send(QString message);
- void setShow1(QString);
- void setShow2(QString);
-
- public slots:
- void basic_connected();
- void tts_connected();
- void buttons_connected();
- void vehicle_connected();
- void ui_connected();
- void vr_connected();
-
- void basic_receive(QString);
- void tts_receive(QString);
- void buttons_receive(QString);
- void vehicle_receive(QString);
- void ui_receive(QString);
- void vr_receive(QString);
- void registerApp(int, QString);
-
- void disconnected();
-
-signals:
- void show1Changed(QString);
- void show2Changed(QString);
- void newAppAvailable(int, QString);
- void alert(QString message);
-};
-
-#endif // SMARTDEVICELINK_H
diff --git a/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
deleted file mode 100644
index e6eeb9e525..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
-set(qml_dirs hmi_api controls models popups views)
-set(qml_files MainWindow.qml)
-
-add_custom_target(qml_auto ALL
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${proxy_dir}/BasicCommunicationProxy.qml
- ${proxy_dir}/ButtonsProxy.qml
- ${proxy_dir}/NavigationProxy.qml
- ${proxy_dir}/TTSProxy.qml
- ${proxy_dir}/UIProxy.qml
- ${proxy_dir}/VehicleInfoProxy.qml
- ${proxy_dir}/VRProxy.qml
- from:
- ${api_xml} ..."
-)
-
-add_custom_target(qml_copy_resources ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
- COMMENT "Copying resources")
-
-if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- foreach(qml_dir ${qml_dirs})
- add_custom_target(qml_copy_${qml_dir} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
- COMMENT "Copying directory ${qml_dir}")
- endforeach(qml_dir)
-
- add_dependencies(qml_auto qml_copy_hmi_api)
-
- foreach(qml_file ${qml_files})
- add_custom_target(qml_copy_${qml_file} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
- COMMENT "Copying file ${qml_file}")
- endforeach(qml_file)
-endif()
-
-install(DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/controls
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
- ${CMAKE_CURRENT_BINARY_DIR}/models
- ${CMAKE_CURRENT_BINARY_DIR}/popups
- ${CMAKE_CURRENT_BINARY_DIR}/res
- ${CMAKE_CURRENT_BINARY_DIR}/views
- DESTINATION bin/hmi)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt4/MainWindow.qml b/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
deleted file mode 100644
index 1a3b06fd41..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
+++ /dev/null
@@ -1,356 +0,0 @@
-/**
- * @file MainWindow.qml
- * @brief Implementation of main window.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "./controls"
-import "./views"
-import "./hmi_api" as HmiApi
-import "./models"
-import "./popups"
-import "hmi_api/Common.js" as Common
-import "./models/Constants.js" as Constants
-import "models/Internal.js" as Internal
-
-Rectangle {
- width: 1280
- height: 768
- property string startQml: "./views/ApplicationListView.qml"
- property int minWidth: Constants.mainScreenMinWidth
- property int minHeight: Constants.mainScreenMiHeight
- color: Constants.secondaryColor
-
- DataStorage {
- id: dataContainer
-
- onSystemContextChanged: {
- sdlUI.onSystemContext(systemContext)
- }
-
- // Please note that applicationContext is changed only after setting currentApplication
- onApplicationContextChanged: {
- if (applicationContext) {
- sdlBasicCommunication.onAppActivated(currentApplication.appId)
- } else {
- sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
- }
- }
- }
-
-// TODO(KKolodiy): find way for play sound
-// Audio {
-// id: beep
-// source: "res/initial.wav"
-// }
-
- SettingsStorage {
- id: settingsContainer
- }
-
- Item {
- id: mainScreen
- anchors.top: parent. top
- anchors.left: parent.left
- width: (parent.width - simulationScreen.width < minWidth) ?
- minWidth : parent.width - simulationScreen.width
- height: (parent.height - hardwareScreen.height < minHeight) ?
- minHeight : parent.height - hardwareScreen.height
- clip: true
- visible: false
-
- Item {
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height * 0.10
- width: parent.width
- HeaderMenu {}
- }
-
- Item {
- height: parent.height * 0.90
- width: parent.width
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- Loader {
- id: contentLoader
- height: parent.height - Constants.margin
- width: parent.width - 2 * Constants.margin
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.leftMargin: Constants.margin
- anchors.rightMargin: Constants.margin
- anchors.bottomMargin: Constants.margin
-
-
- source:startQml
- property variant viewTransitionStack : []
-
- function reset() {
- viewTransitionStack = []
- }
-
- property string currentLocation
- function go(path, appId) {
- console.debug("enter:", path, ", appId:", appId)
- if (path) {
- if (currentLocation !== path) {
- viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
- if (appId) {
- dataContainer.setCurrentApplication(appId)
- }
- currentLocation = path
- source = path
- }
- }
- console.debug("exit")
- }
-
- function back() {
- if (viewTransitionStack.length) {
- source = viewTransitionStack.pop().uri
- }
- currentLocation = ""
- }
-
- onStatusChanged: {
- if (status == Component.Ready) {
- if (!dataContainer.activeAlert) {
- dataContainer.applicationContext = item.applicationContext
- }
- else {
- dataContainer.applicationSavedContext = item.applicationContext
- }
- if (viewTransitionStack && viewTransitionStack.length) {
- viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
- }
- dataContainer.setSystemContext()
- }
- }
- }
- }
-
- WarningInfo { id: warningInfo }
-
- InteractionPopup {
- id: interactionPopup
- popUpName: "UI.PerformInteraction"
- anchors.centerIn: parent
- visible: false
- }
-
- SliderPopup {
- id: sliderPopup
- popUpName: "UI.Slider"
- anchors.centerIn: parent
- visible: false
- }
-
- PerformAudioPassThruPopup {
- id: performAudioPassThruPopup
- popUpName: "UI.PerformAudioPassThru"
- anchors.centerIn: parent
- visible: false
- }
-
- VRHelpPopup {
- id: vrHelpPopup
- popUpName: "UI.VrHelp"
- anchors.centerIn: parent
- visible: false
- }
-
- AlertWindow {
- id: alertWindow
- popUpName: "UI.Alert"
- objectName: "AlertWindow"
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: simulationScreen
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: mainScreen.right
- width: simulationPanel.width
- clip: true
- SimulationView {
- id: simulationPanel
-
- VRPopUp {
- id: vrPopUp
- visible: false
- anchors.fill: parent
- }
-
- TTSPopUp {
- id: ttsPopUp
- anchors.top: parent.top
- anchors.right: parent.right
- visible: false
- }
- }
- }
-
- Item {
- id: hardwareScreen
- anchors.top: mainScreen.bottom
- anchors.left: parent.left
- anchors.right: simulationScreen.left
- height: hardwarePanel.height
- clip: true
- HardwareButtonsView { id: hardwarePanel }
- }
-
- HMIProxy {
- HmiApi.ButtonsProxy {
- id: sdlButtons
- objectName: "Buttons"
- }
- HmiApi.BasicCommunicationProxy {
- id: sdlBasicCommunication
- objectName: "BasicCommunication"
- }
- HmiApi.VRProxy {
- id: sdlVR
- objectName: "VR"
- }
- HmiApi.TTSProxy {
- id: sdlTTS
- objectName: "TTS"
- }
- HmiApi.NavigationProxy {
- id: sdlNavigation
- objectName: "Navigation"
- }
- HmiApi.VehicleInfoProxy {
- id: sdlVehicleInfo
- objectName: "VehicleInfo"
- }
- HmiApi.UIProxy {
- id: sdlUI
- objectName: "UI"
- }
- }
-
- SDLProxy {
- id: sdlProxy
-
- onAppRegistered: {
- dataContainer.addApplication(
- {
- appName: application.appName,
- ngnMediaScreenAppName: application.ngnMediaScreenAppName,
- icon: application.icon,
- deviceName: application.deviceName,
- appId: application.appId,
- hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
- isMediaApplication: application.isMediaApplication,
- appType: application.appType,
- hmiUIText: { },
- mediaClock: {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "startTime": -1,
- "endTime": -1,
- "startTimeForProgress": -1
- }
- });
- }
-
- onAppUnregistered: {
- console.debug("enter")
- dataContainer.removeApplication(appId);
- if ((dataContainer.currentApplication.appId === appId)) {
- if (dataContainer.applicationContext) {
- contentLoader.go("views/ApplicationListView.qml");
- }
- if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
- contentLoader.reset();
- }
- dataContainer.currentApplication.reset()
- }
- console.debug("exit")
- }
-
- onPlayTone: {
- beep.play()
- }
-
- }
-
- Component.onCompleted: {
- dataContainer.hmiVRAvailable = true
- dataContainer.hmiTTSAvailable = true
- dataContainer.hmiNavigationAvailable = true
- dataContainer.hmiVehicleInfoAvailable = true
- dataContainer.hmiUIAvailable = true
-
- sdlBasicCommunication.onReady()
- }
-
- /*
- * Test Support Section
- *
- */
- function getSlider(){
- return sliderPopup
- }
-
- function getDataStorage(){
- return dataContainer
- }
-
- function getUIProxy(){
- return sdlUI
- }
-
- function getMainScreen(){
- return mainScreen
- }
-
- function getContentLoader(){
- return contentLoader
- }
-
- function getWarningInfo(){
- return warningInfo
- }
- /*
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
deleted file mode 100644
index 4f33960127..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @file ArrowKeys.qml
- * @brief Keys with arrow for cursor movement.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- width: buttonOk.width
- height: buttonOk.height
-
- HardwareButton {
- id: arrowUp
- buttonId: Common.ButtonName.TUNEUP
- name: "Up"
- }
- HardwareButton {
- id: arrowDown
- buttonId: Common.ButtonName.TUNEDOWN
- name: "Down"
- }
- HardwareButton {
- id: arrowLeft
- buttonId: Common.ButtonName.SEEKLEFT
- name: "Left"
- }
- HardwareButton {
- id: arrowRight
- buttonId: Common.ButtonName.SEEKRIGHT
- name: "Right"
- }
- HardwareButton {
- id: buttonOk
- buttonId: Common.ButtonName.OK
- name: "Ok"
- longPressAvailable: false
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
deleted file mode 100644
index 906b3098ba..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file BackButton.qml
- * @brief Button "Back" that return to previous menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-OvalButton {
- text: "Back"
- onClicked: { contentLoader.back() }
- fontSize: Constants.fontSize
- opacity: 0
-
- NumberAnimation on opacity {
- to: 1;
- duration: Constants.animationDuration
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
deleted file mode 100644
index 39d693b971..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CheckBox.qml
- * @brief Check box
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- property alias text: text.text
- property alias color: text.color
- property bool checked: false
-
- signal clicked
-
- onCheckedChanged: {
- selector.color = checked ? Constants.primaryColorPressed : Constants.transparentColor
- }
-
- height: checkbox.height + Constants.generalSpacing / 2
- width: checkbox.width + text.width + 1.5 * Constants.generalSpacing
-
- MouseArea {
- anchors.fill: parent
- onClicked: { checked = !checked; parent.clicked() }
- }
- Rectangle {
- id: checkbox
- width: text.font.pixelSize + Constants.generalSpacing / 2
- height: width
- anchors.left: parent.left
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- color: Constants.panelTextColor
- radius: Constants.controlsRadius
- Rectangle {
- id: selector
- anchors.fill: parent
- anchors.margins: checkbox.width / 8
- color: Constants.transparentColor
- }
- }
- Text {
- id: text
- anchors.left: checkbox.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: checkbox.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
deleted file mode 100644
index 818f07ffc5..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file CircleButton.qml
- * @brief Parent class for circle button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Image {
- id: circleBtn
- source: imgOff
- property alias text: btnText.text
- property alias pixelSize: btnText.font.pixelSize
- property string dest: ""
- property bool isPressed: false
- property string imgOff: "../res/buttons/round_btn.png"
- property string imgOn: "../res/buttons/round_pressed_btn.png"
- property string textColorOnPressed: Constants.secondaryColor
- property string textColorDefault: Constants.primaryColor
-
- signal clicked()
- function wasClicked()
- {
- clicked()
- }
-
- Text {
- anchors.centerIn: parent
- id: btnText
- color: textColorDefault
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- console.log("CircleButton onPressed enter");
- source = imgOn
- btnText.color = textColorOnPressed
- isPressed = true
- console.log("CircleButton onPressed exit");
- }
- onReleased: {
- console.log("CircleButton onReleased enter");
- source = imgOff
- btnText.color = textColorDefault
- isPressed = false
- console.log("CircleButton onReleased exit");
- }
- onClicked: {
- console.log("CircleButton onClicked enter");
- if(dest !== ""){
- contentLoader.go(dest)
- }
- circleBtn.wasClicked()
- console.log("CircleButton onClicked enter");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
deleted file mode 100644
index f35f7c3020..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file ClickableImage.qml
- * @brief Clickable image item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Image {
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked()
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- parent.scale = Constants.pressedIconScale
- parent.pressed()
- }
-
- onReleased: {
- parent.scale = 1
- parent.released()
- }
-
- onCanceled: {
- parent.scale = 1
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
deleted file mode 100644
index e6b9fbf246..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file ClickableText.qml
- * @brief Clickable text item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Text {
- property string defaultColor
- property string pressedColor
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked ()
-
- color: defaultColor
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- press()
- parent.pressed()
- }
-
- onReleased: {
- release()
- parent.released()
- }
-
- onCanceled: {
- release()
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-
- function press () {
- color = pressedColor
- }
-
- function release () {
- color = defaultColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
deleted file mode 100644
index abd344272c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file ClimateControlBtn.qml
- * @brief Round button, which is used at climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item
-{
- id: climateControlBtn
- width: climateBtnImg.width
- height: climateBtnImg.height
- property string name: ""
- property string txt: ""
- state: "off"
-
- Image {
- id: climateBtnImg
- source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
-
- Image {
- id: hoverImg
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- property string st: climateControlBtn.state === "off" ? "_off" : "_on"
- source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
- }
-
- Text {
- id: hoverText
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: climateControlBtn.txt
- font.pixelSize: Constants.fontSize
- color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if(climateControlBtn.state === "on") {
- climateControlBtn.state = "off"
- climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.primaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
- }
- } else {
- climateControlBtn.state = "on"
- climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.secondaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
deleted file mode 100644
index d5129a2a10..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * @file ComboBox.qml
- * @brief Combo box
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: container
- width: Constants.defaultComboboxWidth
- height: main.height
-
- property alias model: listView.model
- property alias currentIndex: listView.currentIndex
- property alias currentText: textMain.text
- property string textRole
-
- function choose(name) {
- var count = listView.count
- for (var i = 0; i < count; ++i) {
- if (name === listView.model.get(i).name) {
- listView.currentIndex = i
- break
- }
- }
-
- textMain.text = name
- }
-
- Rectangle {
- id: main
-
- anchors.left: parent.left
- anchors.right: parent.right
- height: label.font.pixelSize + Constants.generalSpacing
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- radius: Constants.controlsRadius
-
- Text {
- id: textMain
- anchors.left: parent.left
- anchors.right: arrow.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.secondaryColor
- verticalAlignment: Text.AlignVCenter
- anchors.leftMargin: Constants.generalSpacing
- anchors.rightMargin: Constants.generalSpacing
- elide: Text.ElideRight
- }
-
- Rectangle {
- id: arrow
- anchors.right: parent.right
- height: parent.height; width: height
-
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- radius: Constants.controlsRadius
-
- Text {
- anchors.fill: parent
- text: "v"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: Constants.secondaryColor
- }
- }
-
- MouseArea {
- anchors.fill: parent
- hoverEnabled: true
- onClicked: listView.visible = !listView.visible
- }
- }
-
- ScrollableListView {
- id: listView
- anchors.top: main.bottom
- anchors.left: main.left
- anchors.right: main.right
- height: 150
- visible: false
- delegate: Rectangle {
- anchors.left: parent.left
- anchors.right: parent.right
- height: label.font.pixelSize + Constants.generalSpacing
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- Text {
- id: label
- anchors.fill: parent
- anchors.leftMargin: Constants.generalSpacing
- anchors.rightMargin: Constants.generalSpacing
- verticalAlignment: Text.AlignVCenter
- text: model.name
- color: Constants.secondaryColor
- elide: Text.ElideRight
- }
- MouseArea {
- anchors.fill: parent
- hoverEnabled: true
- onClicked: { choose(model.name); listView.visible = false }
- onEntered: { parent.color = Constants.primaryColorPressed }
- onExited: { parent.color = Constants.panelTextColor }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
deleted file mode 100644
index 7b21bb4567..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file GradientRectangle.qml
- * @brief Rectangle with gradient.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-Rectangle {
- property string firstColor: "grey"
- property string secondColor: "#2E2E2E"
- property alias fontSize: text.font.pixelSize
- property alias text: text.text
- property int customButtonID
- property bool isCustomButton: false
- property bool clickProcessed
- signal pressed()
- signal released()
-
- radius: 5
- border.color: "#D3D3D3"
-
- Text {
- id: text
- anchors.fill: parent
- font.pixelSize: Constants.titleFontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- firstColor = "#2E2E2E"
- secondColor = "grey"
- parent.pressed()
- }
- onReleased: {
- firstColor = "grey"
- secondColor = "#2E2E2E"
- parent.released()
- }
- }
-
- Timer {
- id: timer
- interval: Constants.customButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPressed: {
- if (isCustomButton) {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
- }
- }
-
- onReleased: {
- if (isCustomButton) {
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
- }
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if (isCustomButton) {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
- clickProcessed = true
- }
- }
- }
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.1
- color: firstColor
- }
- GradientStop {
- position: 0.5
- color: secondColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
deleted file mode 100644
index 84528ab800..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file GridItem.qml
- * @brief Item with animation for GridMenu
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: item
- opacity: 0
- SequentialAnimation {
- id: animation
- PauseAnimation {duration: index * 100 }
- NumberAnimation {
- target: item
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
- Component.onCompleted: {
- animation.start()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
deleted file mode 100644
index ea8e406c6e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file HardwareButton.qml
- * @brief Parent class for hardware button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../hmi_api/Common.js" as Common
-
-MaskedContainer {
- property string name
- property int buttonId: Common.ButtonName.CUSTOM_BUTTON
- property bool upDownAvailable: true
- property bool shortPressAvailable: true
- property bool longPressAvailable: true
-
- signal hold
-
- Image {
- source: "../res/controlButtons/" + name + "Button.png"
- }
- Image {
- id: pressedImg
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- visible: false
- Behavior on opacity {
- NumberAnimation { duration: 80 }
- }
- }
- Timer {
- id: timer
- interval: 2000
- repeat: false
- triggeredOnStart: false
- }
- property bool clickProcessed
- onPressed: {
- clickProcessed = false
- pressedImg.visible = true
- timer.start()
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- }
-
- onReleased: {
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
- }
- timer.stop()
- if (!clickProcessed && shortPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
- }
- pressedImg.visible = false
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed && longPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- hold()
- }
- }
- }
-
- Component.onCompleted: {
- if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
- settingsContainer.buttonCapabilities.push(
- {
- name: buttonId,
- upDownAvailable: upDownAvailable,
- shortPressAvailable: shortPressAvailable,
- longPressAvailable: longPressAvailable
- });
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
deleted file mode 100644
index 2b0b418c54..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * @file HeaderMenu.qml
- * @brief Header menu view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: headerMenu
- anchors.fill: parent
-
- Text {
- anchors.leftMargin: Constants.margin
- anchors.topMargin: Constants.margin
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: "75°"
- }
-
- Item {
- width: menuText.width
- height: parent.height
- anchors.topMargin: Constants.margin
- anchors.horizontalCenter: headerMenu.horizontalCenter
- signal clicked ()
-
- ClickableText {
- id: menuLogo
- anchors.horizontalCenter: menuText.horizontalCenter
- anchors.bottom: parent.verticalCenter
- text: "≡"
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuLogo.press()
- onReleased: menuLogo.release()
- onCanceled: menuLogo.release()
- }
-
- ClickableText {
- id: menuText
- anchors.top: parent.verticalCenter
- text: "MENU";
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuText.press()
- onReleased: menuText.release()
- onCanceled: menuText.release()
- }
-
- onClicked: {
- contentLoader.go("./views/MainMenuView.qml")
- }
- }
-
- Row {
- id: clock
- height: childrenRect.height
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: Constants.margin
- anchors.topMargin: Constants.margin
- property date date: new Date()
-
- Timer {
- running: true
- repeat: true
- interval: 1000
- onTriggered: {
- clock.date = new Date();
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "hh");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
-
- Item {
- width: 10
- height: parent.height
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: clock.date.getSeconds() % 2 ? ":" : ""
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "mm");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
deleted file mode 100644
index d0bfdba78b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Icon.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- property variant source
-
- Image {
- anchors.fill: parent
- source: url(parent.source)
-
- function image(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
-
- function url(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
- }
-
- function reset () {
- source = undefined
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
deleted file mode 100644
index c87c24de4d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file Entry.qml
- * @brief Entry with icon and text for list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: main
- color: Constants.transparentColor
-
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
-
- Icon {
- id: image
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- anchors.left: parent.left
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- height: image.height
- width: parent.width - image.width
- z: 50
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- text: "Name Entry"
- anchors.left: image.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenterOffset: 0
- visible: text !== ""
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
deleted file mode 100644
index d8a95d1a00..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @file MaskedButton.qml
- * @brief Masked button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-
-MaskedContainer {
- property string name
-
- Image {
- id: icon
- source: "../res/controlButtons/" + name + "Button.png"
- }
-
- onPressed: {
- state = "pressed";
- }
-
- onReleased: {
- state = "";
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: icon
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
deleted file mode 100644
index e86dcedc8f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file MultiTouchArea.qml
- * @brief Area for multitouch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-MultiPointTouchArea {
- readonly property int created: Date.now()
-
- signal pressed(var touchPoints)
- signal released(var touchPoints)
- signal canceled(var touchPoints)
- signal updated(var touchPoints)
-
- function fillEvent(touchPoints) {
- var event = []
- for (var i = 0; i < touchPoints.length; ++i) {
- event.push({
- id: touchPoints[i].pointId,
- ts: [Date.now() - created],
- c: [{ x: touchPoints.x, y: touchPoints.y }] // TODO(KKolodiy): need cast to int
- })
- }
- return event
- }
-
- minimumTouchPoints: 1
- maximumTouchPoints: 10
-
- onPressed: {
- sdlUI.onTouchEvent(Common.BEGIN, fillEvent(touchPoints))
- parent.pressed(touchPoints)
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
- parent.released(touchPoints)
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
- parent.canceled(touchPoints)
- }
- onUpdated: {
- sdlUI.onTouchEvent(Common.MOVE, fillEvent(touchPoints))
- parent.updated(touchPoints)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
deleted file mode 100644
index 59458499a7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * @file OvalButton.qml
- * @brief Oval button with flexible width.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../models/Constants.js" as Constants
-
-// Don't change constants. It break button
-// TODO (dchmerev@luxoft.com): make this comment more clear
-// todo (ykazakov): eliminate this problem and remove all such comments
-
-Item {
- id: main
- width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
- height: Constants.ovalButtonHeight
-
- signal clicked;
- signal pressed;
- signal released;
- signal pressAndHold;
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
- property bool highlighted: false
- property bool dynamic: false
- property bool disabled: false
- property color colorizeColor
- property real colorizeStrength
-
- onDisabledChanged: colorize()
- onHighlightedChanged: colorize()
- Component.onCompleted: colorize()
-
- function colorize() {
- if (disabled) {
- colorizeColor = "gray";
- colorizeStrength = 1;
- } else if (highlighted) {
- colorizeColor = "cyan";
- colorizeStrength = 1;
- } else {
- colorizeStrength = 0;
- }
- }
-
- Item {
- id: buttonBorderImage
- visible: true
- anchors.fill: parent
- Image {
- id: left
- width: 31
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.top: parent.top
- source: "../res/buttons/oval_btn_left.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: right
- width: 31
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- source: "../res/buttons/oval_btn_right.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: top
- height: 10
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.top: parent.top
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_top.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: bottom
- height: 11
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.bottom: parent.bottom
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_bottom.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
- }
-
- Rectangle {
- id: background
- color: Constants.transparentColor
- anchors.fill: parent
- anchors.rightMargin: 31
- anchors.leftMargin: 31
- anchors.bottomMargin: 10
- anchors.topMargin: 10
- visible: true
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- MouseArea {
- id: mousearea
- anchors.rightMargin: 15
- anchors.leftMargin: 15
- anchors.bottomMargin: 11
- anchors.topMargin: 10
- anchors.fill: parent
- enabled: !parent.disabled
- onPressed: {
- parent.state = "pressed";
- parent.pressed();
- }
- onReleased: {
- parent.state = "";
- parent.released();
- }
- onClicked: {
- parent.clicked();
- }
- onPressAndHold: {
- parent.pressAndHold();
- }
- onCanceled: {
- parent.state = "";
- }
- }
-
- Item {
- id: field
- anchors.fill: background
-
- Icon {
- id: image
- width: Constants.iconButtonSize
- height: Constants.iconButtonSize
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- width: image.visible ? parent.width - image.width : parent.width
- color: Constants.primaryColor
- anchors.centerIn: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: Constants.ovalButtonFontSize
- visible: true
- elide: Text.ElideRight
- effect: Colorize {
- id: colorizeLabel
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: left
- source: "../res/buttons/oval_btn_pressed_left.png"
- }
-
- PropertyChanges {
- target: right
- source: "../res/buttons/oval_btn_pressed_right.png"
- }
-
- PropertyChanges {
- target: background
- color: Constants.primaryColor
- }
-
- PropertyChanges {
- target: label
- color: Constants.secondaryColor
- }
-
- PropertyChanges {
- target: colorizeLabel
- strength: 0
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
deleted file mode 100644
index 6d40ad6478..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file PagedFlickable.qml
- * @brief Animated row.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Item
-{
- id: flickablePage
- height: container.height + pager.height
- default property alias content: containerRow.children
- property alias spacing: containerRow.spacing
- property int elementWidth
- property int snapTo
- property int count: 0
-
- Flickable {
- id: container
- anchors.bottom: parent.bottom
- maximumFlickVelocity: 1500
- contentWidth: containerRow.width
- height: containerRow.height
- width: parent.width
- interactive: contentWidth > width
-
- onMovementEnded: {
- var rest = contentX % snapTo
- var t = 0.25
- if (rest > parent.snapTo / 2) {
- rest = rest - parent.snapTo
- }
- var vel = 2 * rest / t
- flickDeceleration = Math.abs(vel) / t
- flick(vel, 0)
- flickDeceleration = 1500
- }
- Row {
- id: containerRow
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Pager {
- id: pager
- space: 7
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-
- pages: {
- if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentWidth / container.width)
- }
- else {
- return Math.floor(container.contentWidth / container.width)
- }
- }
-
- activePage: {
- if (container.contentX <= 0) {
- return 0
- }
- else if ( (container.contentWidth - container.contentX) < container.width) {
- return pages -1
- }
- else {
- if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentX / container.width)
- }
- else if ( (container.contentX % container.width) > 0) {
- return Math.floor(container.contentX / container.width)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
deleted file mode 100644
index 471d932113..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file Pager.qml
- * @brief Bubbles that indicate about page switch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Row {
- id: pager
- property int pages
- property int activePage: 0
- property int space
- property int itemsInRowOnScreen: 3
-
- spacing: space
- visible: pages !== 1
-
- Repeater {
- model: pages
- Image {
- source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
deleted file mode 100644
index 825884cc1e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file PlayPauseButton.qml
- * @brief Behavior of Play/Pause button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Image {
- id: playPauseButton
- property string sourceOnPressed: ""
- property string sourceOnReleased: ""
-
- signal clicked
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- playPauseButton.source = playPauseButton.sourceOnPressed
- }
- onReleased: {
- playPauseButton.source = playPauseButton.sourceOnReleased
- }
- onClicked: {
- playPauseButton.clicked()
- }
- }
- states: [
- State {
- name: "Play"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_play_btn.png"
- sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_pause_btn.png"
- }
- },
-
- State {
- name: "Pause"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_pause_btn.png"
- sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_play_btn.png"
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
deleted file mode 100644
index 2027e1f592..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file PowerSwitchBtn.qml
- * @brief On/Off button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: powerSwitchBtn
- state: "Turn ON"
- width: 120
- height: 80
- radius: 5
- property bool pressed;
-
- gradient: Gradient {
- GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
- GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.pressed = true
- }
- onReleased: {
- parent.pressed = false
- parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
- btnText.text = parent.state
- if (parent.state === "Turn OFF") {
- contentLoader.reset()
- mainScreen.visible = true
- warningInfo.showOkButton()
- }
- }
- }
-
- Text {
- id: btnText
- color: "red"
- text: parent.state
- anchors.centerIn: parent
- font.pixelSize: Constants.powerButtonFornSize
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
deleted file mode 100644
index 1454ed812d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @file PresetRow.qml
- * @brief Animated row with radio stations.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: presetRow
- height: childrenRect.height
- property variant presets: []
- property int selectedIndex: 0
- signal presetSelected
- signal presetButtonPressed()
- signal presetButtonReleased()
- signal presetButtonClicked()
- signal presetButtonHold()
-
- Image {
- id: circleButton
- source: "../res/buttons/preset_pressed_btn.png"
- visible: false
- enabled: false
- }
-
- PagedFlickable {
- width: parent.width
- spacing: (width - (circleButton.width * 4)) / 3
- snapTo: spacing + circleButton.width
- elementWidth: circleButton.width
-
- Repeater {
- model: presetRow.presets.length
- delegate:
- Column {
- width: circleButton.width
- Image {
- anchors.horizontalCenter: parent.horizontalCenter
- source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- presetRow.selectedIndex = index;
- presetButtonPressed()
- }
- onReleased: {
- presetRow.selectedIndex = index;
- presetButtonReleased()
- }
- onClicked: {
- presetRow.selectedIndex = index
- presetButtonClicked()
- }
- onPressAndHold: {
- presetRow.selectedIndex = index;
- presetButtonHold()
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: index + 1
- font.pixelSize: Constants.fontSize
- color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: presetRow.presets[index]
- font.pixelSize: Constants.fontSize
- color: "white"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
deleted file mode 100644
index 36ee9bbb3f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * @file PushButton.qml
- * @brief Simple button
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Rectangle {
- id: toggleButton
- width: 160
- height: 40
- radius: 2
- border.width: 2
- border.color: "#000000"
- gradient: grUnpressed
-
- property alias label : label.text
-
- signal pressed()
- signal unpressed()
- signal clicked()
-
- property bool toggleMode: false
-
- state: "unpressed"
- onStateChanged: {
- if (state == "pressed") {
- pressed();
- } else {
- unpressed();
- }
- }
-
- Text {
- id: label
- color: "white"
- text: "PushButton"
- font.pixelSize: 18
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.fill: parent
- }
- MouseArea {
- id: mouseArea
-
- anchors.fill: parent
- onPressed: {
- if (toggleMode) {
- if (parent.state == "unpressed") {
- parent.state = "pressed"
- } else {
- parent.state = "unpressed"
- }
- } else {
- parent.state = "pressed"
- }
- }
- onReleased: {
- if (!toggleMode) {
- parent.state = "unpressed"
- if (mouse.isClick) {
- parent.clicked()
- }
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: toggleButton
- gradient: grPressed
- }
- },
- State {
- name: "unpressed"
- PropertyChanges {
- target: toggleButton
- gradient: grUnpressed
- }
- }
- ]
-
- Gradient {
- id: grUnpressed
-
- GradientStop { position: 0.0; color: "#2c2c2c" }
- GradientStop { position: 1.0; color: "#0c0c0c" }
- }
-
- Gradient {
- id: grPressed
-
- GradientStop { position: 0.0; color: "black" }
- GradientStop { position: 1.0; color: "black" }
- }
-
- transitions: [
- Transition {
- from: "unpressed"
- to: "pressed"
- reversible: true
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
deleted file mode 100644
index cc26c87271..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @file ScrollableListView.qml
- * @brief ListView with scrollbar on the right
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-ListView {
- clip: true
-
- Rectangle {
- visible: parent.height < parent.contentHeight
- anchors.right: parent.right
- y: parent.visibleArea.yPosition * parent.height
- width: Constants.scrollBarWidth
- height: parent.visibleArea.heightRatio * parent.height
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
deleted file mode 100644
index 82f568414b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file ScrollableText.qml
- * @brief Text with scrollers if text more than zone
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- property alias text: text.text
- clip: true
-
- Flickable {
- id: flickable
- anchors.fill: parent
- contentWidth: text.width
- contentHeight: text.height
-
- Text {
- id: text
- color: Constants.popUpBorderColor
- font.pixelSize: Constants.ttsFontSize
- }
- }
- Rectangle {
- visible: flickable.height < flickable.contentHeight
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- color: Constants.popUpBorderColor
- }
- Rectangle {
- visible: flickable.width < flickable.contentWidth
- anchors.bottom: flickable.bottom
- x: flickable.visibleArea.xPosition * flickable.width
- height: Constants.scrollBarWidth
- width: flickable.visibleArea.widthRatio * flickable.width
- color: Constants.popUpBorderColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
deleted file mode 100644
index 227f638366..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file SoftButton.js
- * @brief Soft button view constants
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-var Action = {
- doOnClicked: 0,
- doOnReleased: 1
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
deleted file mode 100644
index b92cd51263..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * @file SoftButton.qml
- * @brief Soft button view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "SoftButton.js" as SoftButton
-
-OvalButton {
- property variant button
- property int appId
- visible: !!button
-
- signal defaultAction;
- signal stealFocus;
- signal keepContext;
-
- property int actionOrder: SoftButton.Action.doOnClicked
-
- highlighted: button ? button.isHighlighted : false
- onPressed: {
- actionOrder = SoftButton.Action.doOnClicked
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID)
- }
-
- onReleased: {
- if (actionOrder === SoftButton.Action.doOnReleased) {
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- if (dataContainer.currentApplication.isMediaApplication) {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- } else {
- contentLoader.go("views/SDLNonMediaView.qml", appId);
- }
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID)
- }
-
- onClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID);
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- if (dataContainer.currentApplication.isMediaApplication) { contentLoader.go("views/SDLPlayerView.qml", appId); }
- else { contentLoader.go("views/SDLNonMediaView.qml", appId); }
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- onPressAndHold: {
- actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID);
- }
-
- onButtonChanged: {
- icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
- text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
deleted file mode 100644
index a6d7640f36..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file StatusBar.qml
- * @brief Status bar that contains text string.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Text {
- text: dataContainer.currentApplication.hmiUIText.statusBar
- color: Constants.primaryColor
- font.pixelSize: Constants.statusBarFontSize
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
deleted file mode 100644
index ebc5bfa3ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var async_uid = 1;
-
-function AsyncCall() {
- this.__async_uid = async_uid++;
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
deleted file mode 100644
index 9d7e0432f2..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file BasicCommunication.qml
- * @brief Implement of interface Basic Communication.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Item {
- function updateDeviceList (deviceList) {
- dataContainer.deviceList.clear();
- for(var i = 0; i < deviceList.length; i++) {
- dataContainer.deviceList.append({ name: deviceList[i].name, devid: deviceList[i].id })
- }
- }
-
- function updateAppList (applications) {
- dataContainer.applicationList.clear();
- for(var i = 0; i < applications.length; i++) {
- dataContainer.applicationList.append({
- appName: applications[i].appName,
- ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
- icon: applications[i].icon,
- deviceName: applications[i].deviceName,
- appId: applications[i].appID,
- hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
- isMediaApplication: applications[i].isMediaApplication,
- appType: applications[i].appType
- });
- }
- }
-
- function allowDeviceToConnect (device) {
- return {
- allow: true
- }
- }
-
- function mixingAudioSupported() {
- return {
- attenuatedSupport: true
- }
- }
-
- function allowAllApps() {
- return {
- allowed: true
- }
- }
-
- function allowApp(app, appPermissions) {
- return {
- allowed: true
- }
- }
-
- function activateApp() {
- contentLoader.go("views/SDLPlayerView.qml", appID);
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
deleted file mode 100644
index 83ea933eda..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file Buttons.qml
- * @brief Implement of interface Buttons.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-Item
-{
- function getCapabilities()
- {
- return {
- capabilities: settingsContainer.buttonCapabilities,
- presetBankCapabilities: {
- onScreenPresetsAvailable: true
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
deleted file mode 100644
index 3ec131c8c1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady () {
- return {
- available: dataContainer.hmiNavigationAvailable
- }
- }
-
- function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
- distanceToManeuverScale, maneuverComplete,
- softButtons, appID) {
- console.debug("enter")
- navigationTexts.forEach(fillTexts);
- dataContainer.navigationModel.turnIcon = turnIcon ? turnIcon.value : ""
- dataContainer.navigationModel.nextTurnIcon = nextTurnIcon ? nextTurnIcon.value : ""
- dataContainer.navigationModel.distanceToManeuver = distanceToManeuver;
- dataContainer.navigationModel.distanceToManeuverScale = distanceToManeuverScale;
- if (maneuverComplete !== undefined) {
- dataContainer.navigationModel.maneuverComplete = maneuverComplete;
- }
- if (softButtons !== undefined) {
- dataContainer.navigationModel.softButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.softButtons);
- }
- dataContainer.navigationModel.appId = appID;
- contentLoader.go("./views/TurnByTurnView.qml");
- console.debug("exit")
- }
-
- function alertManeuver(softButtons) {
- console.debug("enter")
- if (softButtons !== undefined) {
- dataContainer.navigationModel.alertManeuverSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.alertManeuverSoftButtons);
- }
- console.debug("exit")
- }
-
- function updateTurnList(turnList, softButtons, appID) {
- console.debug("enter")
- if (turnList !== undefined) {
- dataContainer.getApplication(appID).turnList.clear();
- turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
- }
- if (softButtons !== undefined) {
- dataContainer.getApplication(appID).turnListSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
- }
- dataContainer.navigationModel.appId = appID;
- console.debug("exit")
- }
-
- function fillTexts(element, index, array) {
- switch (element.fieldName) {
- case Common.TextFieldName.navigationText1:
- dataContainer.navigationModel.text1 = element.fieldText;
- break;
- case Common.TextFieldName.navigationText2:
- dataContainer.navigationModel.text2 = element.fieldText;
- break;
- case Common.TextFieldName.ETA:
- dataContainer.navigationModel.eta = element.fieldText;
- break;
- case Common.TextFieldName.totalDistance:
- dataContainer.navigationModel.totalDistance = element.fieldText;
- break;
- case Common.TextFieldName.timeToDestination:
- dataContainer.navigationModel.timeToDestination = element.fieldText;
- break;
- }
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- buttonId: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
- function fillTurnList(element, index, array) {
- this.append({
- navigationText: element.navigationText,
- turnIcon: element.turnIcon
- });
- console.debug(element.navigationText)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
deleted file mode 100644
index 96aa9b2c29..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
- function isReady() {
- return {
- available: dataContainer.hmiTTSAvailable
- }
- }
-
- function speak(ttsChunks, appID) {
- // appID unused
- console.debug('enter:', ttsChunks, appID);
- if (ttsPopUp.async) {
- console.log('speak send abort');
- throw Common.Result.ABORTED;
- }
-
- var message = ttsChunks.map(function(str) { return str.text }).join('\n');
- ttsPopUp.activate(message);
- ttsPopUp.async = new Async.AsyncCall();
- console.debug('exit');
- return ttsPopUp.async;
- }
-
- function stopSpeaking() {
- console.debug("enter");
- ttsPopUp.deactivate();
- console.debug("exit");
- }
-
- function getLanguage() {
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- return {
- capabilities: Common.SpeechCapabilities.SC_TEXT
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-
- function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
- console.debug("enter: " + helpPrompt + ", " + timeoutPrompt + ", " + appID)
-
- var newHelpPropmt = helpPrompt ?
- helpPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.helpPrompt
-
- var newTimeoutPrompt = timeoutPrompt ?
- timeoutPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.timeoutPrompt
-
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- helpPrompt: newHelpPropmt,
- timeoutPrompt: newTimeoutPrompt
- })
- console.debug("exit")
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
deleted file mode 100644
index 648cd1397f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
+++ /dev/null
@@ -1,449 +0,0 @@
-/**
- * @file UI.qml
- * @brief UI interface implementation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-import "Async.js" as Async
-import "../models/Internal.js" as Internal
-
-Item {
- function filter (strings, fields) {
- console.debug("enter")
-// substrings for each allowed field
- var fieldSubstrings = {}
-// this cycle concatenates allowed lines sorting them by field
- for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
- for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
- var fieldName = strings[stringIndex].fieldName
- if (fieldName === fields[fieldIndex]) {
- if (fieldSubstrings[fieldName] !== undefined) {
- fieldSubstrings[fieldName] += "\n";
- fieldSubstrings[fieldName] += strings[stringIndex].fieldText
- }
- else {
- fieldSubstrings[fieldName] = strings[stringIndex].fieldText
- }
- }
- }
- }
- console.debug("exit")
- return fieldSubstrings
- }
-
- function alert (alertStrings, duration, softButtons, progressIndicator, appID) {
- var fieldSubstrings = alertStrings
- .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
- .map(function(val) { return val.fieldText }); // mapping to array of strings
-
- var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, progressIndicator, softButtons, appID)
- if (tryAgainTime === undefined) {
- alertWindow.async = new Async.AsyncCall();
- return alertWindow.async;
- }
- else {
- return {
- "__retCode": Common.Result.REJECTED,
- "tryAgainTime": tryAgainTime
- }
- }
- }
-
- function show (showStrings, alignment, graphic, softButtons, customPresets, appID) {
- console.debug("enter: " + showStrings + ", " + alignment + ", " + graphic + ", "+ softButtons + ", " + customPresets + ", " + appID)
- var app = dataContainer.getApplication(appID);
-
- if (softButtons) {
- app.softButtons.clear()
- softButtons.forEach(function(x) { app.softButtons.append(x); });
- }
-
- if (customPresets) {
- app.customPresets.clear()
- customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
- }
-
- var textAlignment
- switch (alignment) {
- case Common.TextAlignment.LEFT_ALIGNED:
- textAlignment = Text.AlignLeft
- break;
- case Common.TextAlignment.RIGHT_ALIGNED:
- textAlignment = Text.AlignRight
- break;
- case Common.TextAlignment.CENTERED:
- textAlignment = Text.AlignHCenter
- break;
- default:
- textAlignment = Text.AlignHCenter
- break;
- }
-
- // with this array we grab only the lines we need
- var showFields = [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack
- ]
- var fieldSubstrings = filter(showStrings, showFields)
- var showData = { hmiUIText: {} }
- if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
- if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
- if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
- if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
- if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
- if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
- if (graphic) { showData.hmiUIText.image = graphic.value; }
- if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
- if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
- showData.mediaClock = {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
- "total": 0
- }
- }
-
- dataContainer.setApplicationProperties(appID, showData);
- console.debug("exit")
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
- }
-
- function deleteCommand (cmdID, appID) {
- dataContainer.deleteCommand(cmdID, appID)
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- dataContainer.addSubMenu(menuID, menuParams, appID)
- }
-
- function deleteSubMenu (menuID, appID) {
- dataContainer.deleteSubMenu(menuID, appID)
- }
-
- function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
- console.debug("enter")
- var async = dataContainer.interactionModel.performInteraction(initialText, choiceSet, vrHelp, timeout, appID)
- console.debug("exit")
- return async
- }
-
- function setMediaClockTimer (startTime, endTime, updateMode, appID) {
- console.debug("enter: {", startTime, ", ", endTime, ", ", updateMode, ", ", appID, "}")
-
- var app = dataContainer.getApplication(appID)
- var newStartTime
- var newEndTime
- var newUpdateMode
- var newRunningMode
- var newStartTimeForProgress
- var resultCode
- var sendErrorResponce = false
-
- switch (updateMode) {
- case Common.ClockUpdateMode.COUNTUP:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.COUNTDOWN:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.PAUSE:
- // Already paused or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = app.mediaClock.startTime
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.RESUME:
- // Already resumed or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = app.mediaClock.startTime
- newUpdateMode = app.mediaClock.updateMode
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.CLEAR:
- newStartTime = -1
- newEndTime = -1
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = -1
- resultCode = Common.Result.SUCCESS
- break
- }
-
- if (sendErrorResponce) {
- console.debug("exit with result code: ", resultCode)
- return { __retCode: resultCode }
- }
-
- dataContainer.setApplicationProperties(appID, {
- "mediaClock": {
- "updateMode": newUpdateMode,
- "runningMode": newRunningMode,
- "startTime": newStartTime,
- "endTime": newEndTime,
- "startTimeForProgress": newStartTimeForProgress
- }
- })
-
- console.debug("exit")
- return { __retCode: resultCode }
- }
-
- function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
- console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + menuTitle + ", " + menuIcon + ", " + keyboardProperties + ", " + appID)
- if (vrHelpTitle) {
- vrHelpPopup.title = vrHelpTitle
- }
- dataContainer.setVrHelp(vrHelp)
- console.debug("exit")
- }
-
- function showVrHelp (vrHelpTitle, vrHelp, appID) {
- console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + appID)
- if (vrHelpTitle) {
- vrHelpPopup.title = vrHelpTitle
- }
- dataContainer.setVrHelp(vrHelp)
- vrHelpPopup.show()
- console.debug("exit")
- }
-
- function isReady () {
- return {
- available: dataContainer.hmiUIAvailable
- }
- }
-
- function getLanguage () {
- return {
- language: dataContainer.hmiUILanguage
- }
- }
-
- function getSupportedLanguages () {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function changeRegistration (language, appID) {
- dataContainer.changeRegistrationUI(language, appID)
- }
-
- function setAppIcon (syncFileName, appID) {
- dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
- }
-
- function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
- console.debug("enter", numTicks, position, sliderHeader, sliderFooter, timeout, appID)
- if (dataContainer.uiSlider.running) {
- console.debug("aborted")
- return {__retCode: Common.Result.ABORTED, sliderPosition: position}
- }
-
- dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiSlider.header = sliderHeader
- dataContainer.uiSlider.footer = sliderFooter
- dataContainer.uiSlider.numTicks = numTicks
- dataContainer.uiSlider.position = position
- dataContainer.uiSlider.timeout = timeout
-
- if (timeout !== 0) {
- sliderPopup.showSlider()
- sliderPopup.async = new Async.AsyncCall();
- console.debug("exit")
- return sliderPopup.async;
- } else {
- return { sliderPosition: position }
- }
- }
-
- function scrollableMessage (messageText, timeout, softButtons, appID) {
- console.debug("scrollableMessage ", messageText, timeout, softButtons, appID)
- if(dataContainer.scrollableMessageModel.running){
- //send error response if long message already running
- console.debug("scrollableMessage throw")
- throw Common.Result.ABORTED
- }
-
- dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
- dataContainer.scrollableMessageModel.softButtons.clear();
- if (softButtons !== undefined) {
- softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
- }
- dataContainer.scrollableMessageModel.timeout = timeout
- dataContainer.scrollableMessageModel.appId = appID
- dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
- contentLoader.go("./views/ScrollableMessageView.qml")
- console.debug("scrollableMessage exit")
- return dataContainer.scrollableMessageModel.async
- }
-
- function getCapabilities() {
- return {
- "audioPassThruCapabilities": {
- "samplingRate": Common.SamplingRate.RATE_44KHZ,
- "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
- "audioType": Common.AudioType.PCM
- },
- "displayCapabilities": settingsContainer.displayCapabilities,
- "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
- "softButtonCapabilities": settingsContainer.softButtonCapabilities
- }
- }
-
- function performAudioPassThru (audioPassThruDisplayTexts, timeout, appID) {
- console.debug("enter", audioPassThruDisplayTexts, timeout)
-
- if (dataContainer.uiAudioPassThru.running) {
- console.debug("aborted")
- throw Common.Result.ABORTED
- }
-
- dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiAudioPassThru.timeout = timeout
- if (audioPassThruDisplayTexts.length === 2) {
- dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
- dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
- }
- performAudioPassThruPopup.async = new Async.AsyncCall();
- performAudioPassThruPopup.showAudioPassThru()
- console.debug("exit")
- return performAudioPassThruPopup.async;
- }
-
- function endAudioPassThru () {
- console.debug("enter")
- if (!dataContainer.uiAudioPassThru.running) {
- console.debug("rejected")
- throw Common.Result.REJECTED
- }
- DBus.sendReply({__retCode: Common.Result.SUCCESS})
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- console.debug("exit")
- }
-
- function closePopUp (methodName) {
- console.debug("enter")
- var popUpToClose
-
- if (dataContainer.activePopup.length === 0) {
- return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
- }
-
- if (methodName !== undefined) {
- popUpToClose = methodName
- } else {
- popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
- }
-
- switch (popUpToClose) {
- case "UI.PerformInteraction":
- interactionPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Slider":
- sliderPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.PerformAudioPassThru":
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Alert":
- alertWindow.complete(Common.Result.SUCCESS)
- break
- case "UI.VrHelp":
- vrHelpPopup.complete(Common.Result.SUCCESS)
- break
- }
- console.debug("exit")
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- softButtonID: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
deleted file mode 100644
index 37d19f6a46..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file VR.qml
- * @brief Implement of interface VR.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady() {
- return {
- available: dataContainer.hmiVRAvailable
- }
- }
-
- function addCommand(cmdID, vrCommands, appID) {
- console.log("VR.AddCommand: cmd ", cmdID, ", app ", appID);
- for (var i = 0; i < vrCommands.length; ++i) {
- dataContainer.vrCommands.append({
- cmdID: cmdID,
- command: vrCommands[i],
- appID: appID === undefined ? 0 : appID,
- });
- }
- console.log("exit")
- }
-
- function deleteCommand(cmdID, appID) {
- console.log("VR.DeleteCommand: cmd ", cmdID, ", app ", appID);
- for (var i = 0; i < dataContainer.vrCommands.count; ) {
- if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
- ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
- dataContainer.vrCommands.remove(i);
- continue;
- }
- ++i;
- }
- console.log("exit")
- }
-
- function getLanguage() {
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- return {
- vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
deleted file mode 100644
index 18f3a1ce9e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
+++ /dev/null
@@ -1,749 +0,0 @@
-/**
- * @file VehicleInfo.qml
- * @brief Vehicle information interface realisation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady () {
- return {
- available: dataContainer.hmiVehicleInfoAvailable
- }
- }
-
- function getVehicleType() {
- return {
- "vehicleType": {
- "make": "Ford",
- "model": "Fiesta",
- "modelYear": "2013",
- "trim": "SE"
- }
- }
- }
-
- function getGpsData(appID) {
- console.debug("enter")
- console.debug("exit")
- return { gps: dataContainer.vehicleInfoModel.gps }
- }
-
- function getSpeed(appID) {
- console.debug("enter")
- console.debug("exit")
- return { speed: dataContainer.vehicleInfoModel.speed }
- }
-
- function getRpm(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- rpm: dataContainer.vehicleInfoModel.rpm,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getFuelLevel(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
- }
-
- function getFuelLevelState(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
- }
-
- function getInstantFuelConsumption(appID) {
- console.debug("enter")
- console.debug("exit")
- return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
- }
-
- function getExternalTemperature(appID) {
- console.debug("enter")
- console.debug("exit")
- return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
- }
-
- function getVin(appID) {
- console.debug("enter")
- console.debug("exit")
- return { vin: dataContainer.vehicleInfoModel.vin }
- }
-
- function getPrndl(appID) {
- console.debug("enter")
- if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
- console.debug("exit")
- return {
- prndl: dataContainer.vehicleInfoModel.prndl,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
- console.debug("exit")
- return { prndl: dataContainer.vehicleInfoModel.prndl }
- }
-
- function getTirePressure(appID) {
- console.debug("enter")
- console.debug("exit")
- return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
- }
-
- function getOdometer(appID) {
- console.debug("enter")
- console.debug("exit")
- return { odometer: dataContainer.vehicleInfoModel.odometer }
- }
-
- function getBeltStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
- }
-
- function getBodyInformation(appID) {
- console.debug("enter")
- console.debug("exit")
- return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
- }
-
- function getDeviceStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
- }
-
- function getDriverBraking(appID) {
- console.debug("enter")
- console.debug("exit")
- return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
- }
-
- function getWiperStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
- }
-
- function getHeadLampStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
- }
-
- function getEngineTorque(appID) {
- console.debug("enter")
- console.debug("exit")
- return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
- }
-
- function getAccPedalPosition(appID) {
- console.debug("enter")
- console.debug("exit")
- return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
- }
-
- function getSteeringWheelAngle(appID) {
- console.debug("enter")
- console.debug("exit")
- return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
- }
-
- function getECallInfo(appID) {
- console.debug("enter")
- console.debug("exit")
- return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
- }
-
- function getAirbagStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
- }
-
- function getEmergencyEvent(appID) {
- console.debug("enter")
- console.debug("exit")
- return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
- }
-
- function getClusterModeStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
- }
-
- function getMyKey(appID) {
- console.debug("enter")
- console.debug("exit")
- return { myKey: dataContainer.vehicleInfoModel.myKey }
- }
-
- function getDTCs(ecuName, dtcMask, appID) {
- var ecuHeader = 2
- var dtc = []
-
- for (var i = 0; i < 3; i++) {
- dtc.push("line" + i)
- }
- return {ecuHeader: ecuHeader, dtc: dtc}
- }
-
- function readDID(ecuName, didLocation, appID) {
- console.debug("Enter")
- //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
- var didResult = []
-
- for (var i = 0; i < didLocation.length; i++) {
- if (i < 10) {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- else {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- }
- console.debug("Exit")
- return {didResult: didResult}
- }
-
- function subscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- model.onGpsChanged.connect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
- }
- function unsubscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
-
- }
-
- function subscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- model.onSpeedChanged.connect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- model.onRpmChanged.connect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- model.onPrndlChanged.connect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- model.onVinChanged.connect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- model.onTirePressureChanged.connect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- model.onOdometerChanged.connect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- model.onECallInfoChanged.connect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- model.onMyKeyChanged.connect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/log4cxx.properties b/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
deleted file mode 100644
index 0bc5ac8fdf..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-# Socket logger
-log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
-log4j.appender.SocketHub.port=4555
-log4j.appender.SocketHub.locationInfo=true
-
-# Only ERROR and FATAL messages are logged to console
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.ImmediateFlush=true
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %m%n
-log4j.appender.Console.Threshold=ERROR
-
-# Log for all DBus plugin messages
-log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
-log4j.appender.DBusPluginLogFile.append=false
-log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.DBusPluginLogFile.ImmediateFlush=true
-log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all HMI Framework plugin
-log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
-log4j.appender.HmiFrameworkPluginLogFile.append=false
-log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
-log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all Qt HMI
-log4j.rootLogger=ALL, Console
-
-# Log for DBus plugin QtHMI
-log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
-
-# Log for HMI Framework plugin
-log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
-
-# Log by log4cxx plugin
-log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
deleted file mode 100644
index a50113095c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * @file ApplicationData.qml
- * @brief Model for Application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-QtObject {
- property string mainField1
- property string mainField2
- property string mainField3
- property string mainField4
- property string statusBar
- property string mediaTrack
- property string image
-
- function reset () {
- console.debug("enter")
- mainField1 = ""
- mainField2 = ""
- mainField3 = ""
- mainField4 = ""
- statusBar = ""
- mediaTrack = ""
- image = ""
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
deleted file mode 100644
index 206eaa9185..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * @file ApplicationModel.qml
- * @brief Own fields for each application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-
-QtObject {
- property int appId
- property string appName
- property string ngnMediaScreenAppName
- property Icon appIcon: Icon { }
- property string deviceName
- property int hmiDisplayLanguageDesired
- property bool isMediaApplication
- property variant appType
- property int hmiUITextAlignment
-
- // media player
- property string playPauseState
- property ApplicationData hmiUIText: ApplicationData { }
- property MediaClockModel mediaClock: MediaClockModel { }
-
- property string helpPrompt
- property string timeoutPrompt
- property ListModel options: ListModel { }
-
- property ListModel currentSubMenu: options
- property ListModel turnList
- property ListModel softButtons
- property ListModel turnListSoftButtons
- property ListModel customPresets
- property int languageTTSVR
- // This place is for adding new properties
-
- function reset () {
- console.debug("enter")
- appId = -1
- appName = ""
- ngnMediaScreenAppName = ""
- appIcon.reset()
- deviceName = ""
- hmiDisplayLanguageDesired = -1
- isMediaApplication = false
- appType = undefined
- playPauseState = ""
- hmiUIText.reset()
-// no need to reset mediaClock
- helpPrompt = ""
- timeoutPrompt = ""
- options.clear()
- currentSubMenu = options
- turnList = null
- softButtons = null
- turnListSoftButtons = null
- customPresets = null
- languageTTSVR = -1
- hmiUITextAlignment = null
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
deleted file mode 100644
index f636d1e794..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CarMenuModel.qml
- * @brief Car menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "ambient"
- icon: "../res/vehicle/Ambient Lighti Icon.png"
- qml: ""
- }
- ListElement {
- name: "cal"
- icon: "../res/vehicle/cal.png"
- qml: ""
- }
- ListElement {
- name: "ev"
- icon: "../res/vehicle/EV Icon.png"
- qml: ""
- }
- ListElement {
- name: "folders"
- icon: "../res/vehicle/folders.png"
- qml: ""
- }
- ListElement {
- name: "key"
- icon: "../res/vehicle/key_car.png"
- qml: ""
- }
- ListElement {
- name: "mcs"
- icon: "../res/vehicle/MCS Icon.png"
- qml: ""
- }
- ListElement {
- name: "sun"
- icon: "../res/vehicle/sun.png"
- qml: ""
- }
- ListElement {
- name: "sync"
- icon: "../res/vehicle/SYNC Services.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Constants.js b/src/components/qt_hmi/qml_model_qt4/models/Constants.js
deleted file mode 100644
index 1bc5c558ba..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/Constants.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/**
- * @file Constants.js
- * @brief Namespace of constants.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-// Colors
-
-// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
-var primaryColor = "#1d81d5"
-
-// Color of pressed buttons, text, icons etc.
-var primaryColorPressed = "#8ec0ea"
-
-// Secondary color of HMI model, backgroud of this color.
-var secondaryColor = "black"
-
-// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColor = "grey"
-
-// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColorPressed = "lightgrey"
-
-// Color of text at contact list screen view (Name, number and number type).
-var contactTextColor = "lightblue"
-
-// Color of text at buttons, when they are pressed.
-var pressedButtonTextColor = "black"
-
-// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
-var releasedButtonTextColor = "white"
-
-// Transparent background.
-var transparentColor = "#00000000"
-
-// "Warning" word color
-var warningColor = "red"
-
-// Color for PopUp
-var popUpBorderColor = "white"
-
-// Color for hardware and simulation panels
-var panelColor = "#003"
-
-// Color for text in hardware and simulation panels
-var panelTextColor = "white"
-
-// Audio pass thru PopUp text color
-var audioPassThruTextColor = "white"
-
-// Color for border of controls
-var controlsBorderColor = "#ababab"
-
-//--------------------------------------------------------------------------------------
-
-// Font sizes of different elements
-
-// Font size for most of text in HMI model.
-var fontSize = 20
-
-// Font size for text inside oval buttons.
-var ovalButtonFontSize = 15
-
-// Title font size
-var titleFontSize = 35
-
-// Power on/off button font size
-var powerButtonFornSize = 25
-
-// Font size of status bar
-var statusBarFontSize = 15
-
-// Size icon for buttons
-var iconButtonSize = 30
-
-// Size icon for item list
-var iconItemListSize = 40
-
-// font size fo TTS popup
-var ttsFontSize = 12
-
-// Font size for list of applications
-var appListFontSize = 40
-
-// Size of contact list fields
-var contactListNameFieldSize = 0.4
-var contactListPhoneFieldSize = 0.3
-var contactListDescriptionFieldSize = 0.3
-
-//--------------------------------------------------------------------------------------
-
-// Sizes of buttons, menus, screen, etc
-
-// Minimal width and height of screen (screen wont resize, if height and width are lower).
-var mainScreenMinWidth = 800
-var mainScreenMiHeight = 600
-
-// Width for long oval button
-var ovalButtonWidth = 163
-
-// Height for oval button
-var ovalButtonHeight = 65
-
-// Height item list
-var itemListHeight = 60
-
-// Width for TTS popup
-var ttsPopUpWidth = 250
-
-// Height for TTS popup
-var ttsPopUpHeight = 100
-
-// Width for popup view
-var popupWidth = 700
-
-// Width for alert window
-var alertWidth = 360
-
-// Height for popup view
-var popupHeigth = 500
-
-// Width for combobox
-var defaultComboboxWidth = 150
-
-// Size icon for list of applications
-var appListIconSize = 100
-
-// DistanceBar height
-var distanceBarHeight = 1
-
-
-//---------------------------------------------------------------------------------------
-
-// Other
-
-// Offset from the edges of the screen.
-var margin = 20
-
-// Offset from the edges of the popup
-var popupMargin = 15
-
-// Spacing between contacts at contact screen view.
-var contactListSpacing = 30
-
-// Duration of appearance of icon/button at icon/button menus.
-var animationDuration = 500
-
-// Duration of appearence of "OK" button at warning screen view, when HMI starts.
-var warningScreenDuration = 1000
-
-// Timer to check how long preset button is pressed.
-var presetButtonTimer = 800
-
-// Spacing between icon and item in list
-var iconItemListSpacing = 20
-
-// Spacing between item on views
-var generalSpacing = 10
-
-// Width of scrollBar
-var scrollBarWidth = 5
-
-// Speak text for a given time
-var ttsSpeakTime = 2000
-
-// Maximal number of submenus
-var maximumSubmenus = 1000
-
-// Maximal number of commands in submenu or root menu
-var maximumCommandsPerSubmenu = 1000
-
-// padding for popup view
-var popUpPadding = 20
-
-// Padding for TTS popup
-var ttsPopUpPadding = 10
-
-// -------------------------
-var sliderBarWidth = 400
-var sliderBarHeight = 50
-var sliderBarRadius = 3
-var sliderBarBorderWidth = 1
-var sliderTextColor = "white"
-var sliderBarBorderColor = "white"
-var sliderBarFillColor = "white"
-
-// -------------------------
-var scrollableMessageTextColor = "white"
-var scrollableMessageScrollBarColor = "gray"
-var scrollableMessageScrollBarWidth = 10
-
-// Padding for hardware and simulation panels
-var panelPadding = 20
-
-// Scale for pressed icon in menu
-var pressedIconScale = 1.1
-
-// Values of color effect for highlighted button
-var highlightedButtonHue = 0.9
-var highlightedButtonSaturation = 0.0
-var highlightedButtonLightness = 0.1
-
-// Values of color effect for disabled button
-var disabledButtonHue = 0.0
-var disabledButtonSaturation = -1.0
-var disabledButtonLightness = 0.1
-
-// Count of rows for grid menu
-var menuRowCount = 2
-
-// Count of columns for grid menu
-var menuColumnCount = 3
-
-// Radius of controls
-var controlsRadius = 2
-
-// Width of border of controls
-var controlsBorderWidth = 1
-// Position for element that came without position value (should be always at the end)
-var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
deleted file mode 100644
index 348d30156c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file ContactsListModel.qml
- * @brief List of contacts.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-ListModel
-{
- // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
- // when it will be filled dynamically.
- ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
- ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
- ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
- ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
- ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
- ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
- ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
- ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
- ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
- ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
- ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
- ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
- ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
- ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
- ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
- ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
- ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
- ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
- ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
- ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
- ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
- ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
- ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
- ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
- ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
- ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
- ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
- ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
- ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
-// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
- ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
- ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
- ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
- ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
-// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
- ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
- ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
- ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
- ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
- ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
- ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
- ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
- ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
- ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
- ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
- ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
- ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
- ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
- ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
- ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
- ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
- ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
deleted file mode 100644
index cc5f6fc215..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
+++ /dev/null
@@ -1,510 +0,0 @@
-/**
- * @file DataStorage.qml
- * @brief Container for data.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "Internal.js" as Internal
-import "Constants.js" as Constants
-
-QtObject {
-
- property string contactsFirstLetter // first letter of contact's name that need to find at contact list
- property ApplicationModel currentApplication: ApplicationModel { }
- property SliderModel uiSlider: SliderModel { }
- property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
-
- function getApplication(appId) {
- console.log("dataContainer getApplication enter");
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- console.log("Application found", applicationList.get(i));
- return applicationList.get(i);
- }
- }
- console.log("dataContainer getApplication exit");
- }
-
- onApplicationListChanged: {
- console.log("onApplicationListChanged()");
- setCurrentApplication(appId);
- }
-
- function setCurrentApplication(appId) {
- console.log("Enter setCurrentApplication function");
- var oldApplicationContext = applicationContext;
- if (currentApplication.appId !== appId) {
- applicationContext = false;
- }
-
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- currentApplication.appId = appId
- var application = applicationList.get(i)
- currentApplication.appName = application.appName
- currentApplication.appType = application.appType
- currentApplication.appIcon.source = application.icon
- currentApplication.playPauseState = application.playPauseState
- currentApplication.options = application.options
- currentApplication.softButtons = application.softButtons
- currentApplication.customPresets = application.customPresets
-
- if (application.hmiUIText.mainField1 !== undefined) {
- currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
- }
- if (application.hmiUIText.mainField2 !== undefined) {
- currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
- }
- if (application.hmiUIText.mainField3 !== undefined) {
- currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
- }
- if (application.hmiUIText.mainField4 !== undefined) {
- currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
- }
- if (application.hmiUIText.statusBar !== undefined) {
- currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
- }
- if (application.hmiUIText.mediaTrack !== undefined) {
- currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
- }
- if (application.hmiUIText.image !== undefined) {
- currentApplication.hmiUIText.image = application.hmiUIText.image
- }
- if (application.hmiUITextAlignment !== undefined) {
- currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
- }
- if (application.helpPrompt !== undefined) {
- currentApplication.helpPrompt = application.helpPrompt
- }
- if (application.timeoutPrompt !== undefined) {
- currentApplication.timeoutPrompt = application.timeoutPrompt
- }
- // Check fields with mandatory = false
-
- currentApplication.deviceName = application.deviceName
- currentApplication.isMediaApplication = application.isMediaApplication
- currentApplication.turnList = application.turnList
- currentApplication.turnListSoftButtons = application.turnListSoftButtons
- currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
- currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
- currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
- if (application.mediaClock.startTime !== undefined) {
- currentApplication.mediaClock.startTime = application.mediaClock.startTime
- }
- if (application.mediaClock.endTime !== undefined) {
- currentApplication.mediaClock.endTime = application.mediaClock.endTime
- }
- currentApplication.languageTTSVR = application.languageTTSVR
- currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
- // This place is for adding new properties
- }
- }
- applicationContext = oldApplicationContext;
- currentApplicationChanged()
- console.log("Exit setCurrentApplication function")
- }
-
- function addApplication(app) {
- console.log("enter")
- applicationList.append({
- appName: app.appName,
- ngnMediaScreenAppName: app.ngnMediaScreenAppName,
- icon: app.icon,
- deviceName: app.deviceName,
- appId: app.appId,
- hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
- isMediaApplication: app.isMediaApplication,
- appType: app.appType,
- helpPrompt: "",
- timeoutPrompt: "",
- customPresets: app.customPresets ? app.customPresets : [],
- playPauseState: 'Pause',
- hmiUIText: app.hmiUIText,
- hmiUITextAlignment: app.hmiUITextAlignment,
- options: [],
- turnList: [],
- turnListSoftButtons: [],
- mediaClock: app.mediaClock,
- languageTTSVR: Common.Language.EN_US,
- softButtons: []
- // This place is for adding new properties
- })
-
- if (app.isMediaApplication) {
- musicSourceModel.insert(0, {
- "title": app.appName,
- "qml": "views/SDLPlayerView.qml",
- "appId": app.appId
- })
- }
-
- console.log("exit")
- }
-
- function setApplicationProperties(appId, props) {
- console.log("Enter setApplicationProperties function");
- var app = getApplication(appId)
- for (var p in props) {
- if (props[p] !== undefined) {
- app[p] = props[p]
- }
- }
- if (currentApplication.appId === appId) {
- setCurrentApplication(appId); // copy new values to current application
- }
- console.log("Exit setApplicationProperties function");
- }
-
- function removeApplication(appId) {
- console.log("enter");
- for (var j = 0; j < musicSourceModel.count; ++j) {
- if (musicSourceModel.get(j).appId === appId) {
- musicSourceModel.remove(j);
- break;
- }
- }
- for (var i = 0; i < applicationList.count; i++) {
- if (applicationList.get(i).appId === appId) {
- applicationList.remove(i);
- break;
- }
- }
- console.log("exit");
- }
-
- property int systemContext
- property int hmiContext
- property bool applicationContext: false
- property bool applicationSavedContext
- property string routeText: ""
- property PlayerState cdPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState ipodPlayerState: PlayerState {
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- playPauseState: 'Pause'
- }
- property PlayerState usbPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState linePlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState btPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState amPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
- }
- property PlayerState fmPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
- }
- property PlayerState siriusPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
- }
-
- property bool hmiVRAvailable: false
- property bool hmiTTSAvailable: false
- property bool hmiNavigationAvailable: false
- property bool hmiVehicleInfoAvailable: false
- property bool hmiUIAvailable: false
-
- property int hmiUILanguage: Common.Language.EN_US
- property int hmiTTSVRLanguage: Common.Language.EN_US
-
- property ListModel deviceList: ListModel { }
- property ListModel applicationList: ListModel { }
-
- property ListModel vrCommands: ListModel {}
-
- property ListModel vrHelp: ListModel {}
-
- function reset () {
- console.log("dataContainer reset enter");
- routeText = ""
- console.log("dataContainer reset exit");
- }
-
- function changeRegistrationUI (language, appID) {
- console.log("dataContainer changeRegistrarionUI enter");
- setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
- console.log("dataContainer changeRegistrarionUI exit");
- }
-
- function changeRegistrationTTSVR(language, appID) {
- console.log("dataContainer changeRegistrationTTSVR enter");
- setApplicationProperties(appID, { languageTTSVR: language });
- console.log("dataContainer changeRegistrationTTSVR exit");
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- console.debug("enter: " +
- cmdID +
- ", " +
- (menuParams ?
- "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
- ", " +
- (cmdIcon ?
- "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
- ", " +
- appID
- )
- var commandToAddPosition
- var app = getApplication(appID)
- var currentMenu = app.options
- var maximumCommands = Constants.maximumCommandsPerSubmenu
- var index = 0
-
- if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
- var parentNotFound = true
- for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
- if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
- currentMenu = app.options.get(optionIndex).subMenu
- parentNotFound = false
- maximumCommands += 1
- }
- }
- if (parentNotFound) {
- console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
- }
- }
-
- if (currentMenu.count < maximumCommands) {
- if (menuParams && (menuParams.position !== undefined)) {
- commandToAddPosition = menuParams.position
- } else {
- commandToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < currentMenu.count; i++) {
- if (commandToAddPosition >= currentMenu.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- currentMenu.insert( index,
- { id: cmdID,
- name: menuParams.menuName,
- type: Internal.MenuItemType.MI_NODE,
- position: commandToAddPosition,
- icon: cmdIcon ? cmdIcon : {},
- subMenu: []
- })
- } else {
- console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteCommand (cmdID, appID) {
- console.debug("enter: " + cmdID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if (option.type === Internal.MenuItemType.MI_NODE) {
- if (option.id === cmdID) {
- getApplication(appID).options.remove(optionIndex)
- break
- }
- }
- if (option.type === Internal.MenuItemType.MI_SUBMENU) {
- var subMenu = option.subMenu
- var idMatchFound = false
- for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
- if (subMenu.get(subOptionIndex).id === cmdID) {
- idMatchFound = true
- if (subMenu !== currentApplication.currentSubMenu) {
- subMenu.remove(subOptionIndex)
- }
- else {
- console.log("UI::deleteCommand(): cannot remove item from current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- if (idMatchFound) {
- break
- }
- }
- }
- console.debug("exit")
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
- var app = getApplication(appID)
- var index = 0
- var count = app.options.count
- var subMenuToAddPosition
-
- if (count < Constants.maximumSubmenus) {
- if (menuParams.position !== undefined) {
- subMenuToAddPosition = menuParams.position
- } else {
- subMenuToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < count; i++) {
- if (subMenuToAddPosition >= app.options.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- app.options.insert(index, {
- "id": menuID,
- "name": menuParams.menuName,
- "position": subMenuToAddPosition,
- "type": Internal.MenuItemType.MI_SUBMENU,
- "icon": undefined,
- "subMenu": [{
- "id": -1,
- "name": menuParams.menuName,
- "position": -1,
- "type": Internal.MenuItemType.MI_PARENT,
- "icon": {
- "imageType": Common.ImageType.DYNAMIC,
- "value": "../res/nav/turnArrow.png"
- },
- "subMenu": getApplication(appID).options
- }]
- })
- }
- else {
- console.log("addSubMenu(): too many submenus, rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteSubMenu (menuID, appID) {
- console.debug("enter: " + menuID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
- if (option.subMenu !== currentApplication.currentSubMenu) {
- getApplication(appID).options.remove(optionIndex)
- }
- else {
- console.log("UI::deleteSubMenu(): cannot remove current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- console.debug("exit")
- }
-
- function setVrHelp (vrHelp) {
- this.vrHelp.clear()
- var index
- for (var i = 0; i < vrHelp.length; ++i) {
- index = 0
-// sort by simple inserts
- while ((index < this.vrHelp.count) && (this.vrHelp.get(index).position < vrHelp[i].position)) {
- ++index
- }
- this.vrHelp.insert(index, {
- "text": vrHelp[i].text,
- "icon": vrHelp[i].image ? vrHelp[i].image : {},
- "position": vrHelp[i].position
- })
- }
- }
-
- property NavigationModel navigationModel: NavigationModel { }
- property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
- property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
- property bool activeVR: false
-
- property InteractionModel interactionModel: InteractionModel {
- }
-
- property int driverDistractionState: Common.DriverDistractionState.DD_OFF
- onDriverDistractionStateChanged: {
- sdlUI.onDriverDistraction(driverDistractionState);
- }
- property bool activeTTS: false
- property variant activePopup
- property int popups: 0
-
- property bool activeAlert: false
-
- onActiveVRChanged: setSystemContext()
- onActiveAlertChanged: setSystemContext()
- onPopupsChanged: setSystemContext()
-
- function setSystemContext () {
- console.debug("enter")
- if (popups > 0) {
- systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
- }
- else if (activeAlert) {
- systemContext = Common.SystemContext.SYSCTXT_ALERT
- }
- else if (activeVR) {
- systemContext = Common.SystemContext.SYSCTXT_VRSESSION
- }
- else if (contentLoader.item !== null) {
- systemContext = contentLoader.item.systemContext
- }
- console.debug("exit")
- }
- property MusicSourceModel musicSourceModel: MusicSourceModel {
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml b/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
deleted file mode 100644
index 8da8a035db..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file InteractionModel.qml
- * @brief Interaction model.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Async.js" as Async
-
-QtObject {
- property string initialText
- property ListModel choice: ListModel {
- }
- property int timeout
- property variant async
-
- function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
- console.debug("enter")
- this.initialText = initialText.fieldText
- choice.clear()
- for (var i = 0; i < choiceSet.length; ++i) {
- choice.append({"id": choiceSet[i].choiceID, "name": choiceSet[i].menuName ? choiceSet[i].menuName : "choiceID = " + choiceSet[i].choiceID, image: choiceSet[i].image})
- }
- this.timeout = timeout
- interactionPopup.activate()
- async = new Async.AsyncCall()
- console.debug("exit")
- return async
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Internal.js b/src/components/qt_hmi/qml_model_qt4/models/Internal.js
deleted file mode 100644
index 4a1ebc625a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/Internal.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-var MenuItemType = {
- MI_NODE: 0,
- MI_SUBMENU: 1,
- MI_PARENT: 2
-}
-
-function activePageChoose(flickElement, pages) {
- if (flickElement.contentX <= 0) {
- return 0
- }
- else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
- return pages -1
- }
- else {
- if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
- return Math.ceil(flickElement.contentX / flickElement.width)
- }
- else if ( (flickElement.contentX % flickElement.width) > 0) {
- return Math.floor(flickElement.contentX / flickElement.width)
- }
- }
-}
-
-var MediaClockUpdateMode = {
- MCU_COUNTUP: 0,
- MCU_COUNTDOWN: 1,
-}
-
-var MediaClockRunningMode = {
- MCR_RUNNING: 0,
- MCR_STOPPED: 1
-}
-
-function appendVrHelpItem (arrayElement, index, array) {
- this.append({
- text: arrayElement.text,
- image: arrayElement.image ? arrayElement.image : "",
- position: arrayElement.position
- })
-}
-
-function checkBit(value, bitPosition) {
- return (value & (1 << bitPosition))
-}
-
-function getArrayForPresetRow() {
- var array = []
- for (var i = 0; i < dataContainer.currentApplication.customPresets.count; i++) {
- array.push(dataContainer.currentApplication.customPresets.get(i).text)
- }
- return array
-}
-
-function pad (string, length, lead) {
- if (!lead) {
- lead = '0'
- }
- var paddedString = "" + string
- while (paddedString.length < length) {
- paddedString = lead + paddedString
- }
- return paddedString
-}
-
-function hmsTime (hours, minutes, seconds) {
- return 60 * (60 * hours + minutes) + seconds
-}
-
-function hmsTimeToString (hmsTime) {
- if (hmsTime === -1) {
- return "0:00:00"
- }
-
- var _time = hmsTime
- var seconds = _time % 60
- _time -= seconds
- _time /= 60
- var minutes = _time % 60
- _time -= minutes
- _time /= 60
- var hours = _time
- var string = ""
- string += hours
- string += ":"
- string += pad(minutes, 2)
- string += ":"
- string += pad(seconds, 2)
- return string
-}
-
-function stringToHmsTime (hmsString) {
- console.debug("enter: \"" + hmsString + "\"")
- var substrings = hmsString.split(":")
- var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (seconds >= 60) {
- console.log("incorrect field \"seconds\": " + seconds)
- console.debug("exit")
- return 0
- }
- var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (minutes >= 60) {
- console.log("incorrect field \"minutes\": " + minutes)
- console.debug("exit")
- return 0
- }
- var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- console.debug("exit")
- return hmsTime(hours, minutes, seconds)
-}
-
-function mediaClockUpdateModeToString (mediaClockUpdateMode) {
- switch (mediaClockUpdateMode) {
- case MediaClockUpdateMode.MCU_COUNTUP:
- return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
- case MediaClockUpdateMode.MCU_COUNTDOWN:
- return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
- default:
- return ""
- }
-}
-
-function mediaClockRunningModeToString (mediaClockRunningMode) {
- switch (mediaClockRunningMode) {
- case MediaClockRunningMode.MCR_RUNNING:
- return "Internal.MediaClockRunningMode.MCR_RUNNING"
- case MediaClockRunningMode.MCR_STOPPED:
- return "Internal.MediaClockRunningMode.MCR_STOPPED"
- default:
- return ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
deleted file mode 100644
index 49b4e7fb9a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file MainMenuListModel.qml
- * @brief Main menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "Climate"
- icon: "../res/snow.png"
- qml: "./views/ClimateControlView.qml"
- }
-
- ListElement {
- name: "Navigation"
- icon: "../res/arrow.png"
- qml: "./views/NavigationNoRouteGridView.qml"
- }
-
- ListElement {
- name: "Media"
- icon: "../res/notes.png"
- qml: "./views/MusicSourceView.qml"
- }
-
- ListElement {
- name: "Preferences"
- icon: "../res/gear.png"
- qml: ""
- }
-
- ListElement {
- name: "Apps"
- icon: "../res/apps.png"
- qml: "./views/ApplicationListView.qml"
- }
-
- ListElement {
- name: "Phone"
- icon: "../res/phone/phone.png"
- qml: "./views/PhoneMenuGridView.qml"
- }
-
- ListElement {
- name: "Car"
- icon: "../res/car.png"
- qml: "./views/CarMenuGridView.qml"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
deleted file mode 100644
index 8f062008a4..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file MediaClockModel.qml
- * @brief Media clock model
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Internal.js" as Internal
-
-QtObject {
- property int updateMode
- property int runningMode
- property int startTime
- property int endTime
- property int upperTimeLimit: 60 * 60 * 60 - 1
- property int startTimeForProgress
- property real progress
-
- property Timer timer: Timer {
- id: timer
- interval: 1000
- repeat: true
- onTriggered: onTimer()
- }
- onRunningModeChanged: {
- if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
- timer.stop()
- } else {
- timer.start()
- }
- }
-
- onStartTimeChanged: {
- if (startTime === -1) {
- progress = 0
- } else {
- if (updateMode === Internal.MediaClockUpdateMode.MCU_COUNTUP) {
- progress = (endTime !== -1) ? (startTime / endTime) : (startTime / upperTimeLimit)
- } else {
- progress = (endTime !== -1) ? ( (startTime - endTime) / (startTimeForProgress - endTime) )
- : (startTime / startTimeForProgress)
- }
- }
- }
-
- function onTimer () {
- switch (updateMode) {
- case Internal.MediaClockUpdateMode.MCU_COUNTUP:
- if (endTime !== -1) {
- if (startTime < endTime) {
- startTime++
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Up timer stopped")
- }
- } else {
- if (startTime < upperTimeLimit) {
- startTime++
- } else {
- startTime = 0
- }
- }
- break
- case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
- console.debug("count down")
- if (--startTime === 0) {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- startTime = endTime = -1
- console.debug("count Down timer stopped")
- }
- break
- }
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- "mediaClock": {startTime: startTime,
- endTime: endTime,
- updateMode: updateMode,
- runningMode: runningMode,
- startTimeForProgress: startTimeForProgress
- }
- })
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
deleted file mode 100644
index b01c4cf834..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file MusicSourceModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-ListModel
-{
- ListElement {
- title: "FM"
- qml: "./views/FMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "AM"
- qml: "./views/AMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "BT Audio"
- qml: "./views/BTPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "Sirius"
- qml: "./views/SiriusPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "CD"
- qml: "./views/CDPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "iPod"
- qml: "./views/IPodPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "USB"
- qml: "./views/UsbPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "LineIn"
- qml: "./views/LineInPlayerView.qml"
- appId: 0
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
deleted file mode 100644
index 963225719e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file NavigationMenuModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-ListModel
-{
- ListElement {
- title: "Home"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Keyboard"
- icon: "../res/buttons/long_oval_btn.png"
- qml: "./views/NavigationKeyboardView.qml"
- }
- ListElement {
- title: "Favorites"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Work"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Recent"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "POI"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Scout"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Waze"
- icon: "../res/buttons/long_oval_btn.png"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
deleted file mode 100644
index f9203875d3..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * @file NavigationModel.qml
- * @brief Model for Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-QtObject {
- property string text1: ""
- property string text2: ""
- property string totalDistance: ""
- property string eta: ""
- property string timeToDestination: ""
- property variant turnIcon
- property variant nextTurnIcon
-
- property real distanceToManeuver: 0
- property real distanceToManeuverScale: 0
- property bool maneuverComplete
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property ListModel alertManeuverSoftButtons: ListModel {}
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
deleted file mode 100644
index 8b861d37a2..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * @file PerformAudioPassThruModel.qml
- * @brief Data model audio pass thru.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-QtObject {
- property string appName: ""
- property string firstLine: ""
- property string secondLine: ""
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
deleted file mode 100644
index a191f46e46..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file PhoneMenuModel.qml
- * @brief Phone menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "phone"
- icon: "../res/phone/phone.png"
- qml: ""
- }
- ListElement {
- name: "contacts"
- icon: "../res/phone/contacts.png"
- qml: "./views/PhoneKeyboardView.qml"
- }
- ListElement {
- name: "messages"
- icon: "../res/phone/messages.png"
- qml: ""
- }
- ListElement {
- name: "DND"
- icon: "../res/phone/dnd_off.png"
- qml: ""
- }
- ListElement {
- name: "texts"
- icon: "../res/phone/texts.png"
- qml: ""
- }
- ListElement {
- name: "recent"
- icon: "../res/phone/recent.png"
- qml: ""
- }
- ListElement {
- name: "keyboard"
- icon: "../res/phone/keypad.png"
- qml: ""
- }
- ListElement {
- name: "more"
- icon: "../res/phone/more.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
deleted file mode 100644
index bbacd49f8c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * @file PlayerState.qml
- * @brief List of parameters for each player.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-
-// Player state for all players except SDL media player
-Item {
- // Media players
- property string playPauseState
- property string albumImage
- property string trackNumber
- property int songPosition
- property string trackName
-
- // Radio Players
- property variant presets: []
-
- // Both players
- property string songName
- property string albumName
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
deleted file mode 100644
index 6fd441ac3d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file ScrollableMessageModel.qml
- * @brief Model for Scrollable Message.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property int timeout: 0
- property variant async
- property bool running: false
-
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
deleted file mode 100644
index 7fb6cfcdd6..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file SettingsStorage.qml
- * @brief Storage for keeping settings.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item
-{
- property variant sdlLanguagesList: [
- Common.Language.EN_US,
- Common.Language.ES_MX,
- Common.Language.FR_CA,
- Common.Language.DE_DE,
- Common.Language.ES_ES,
- Common.Language.EN_GB,
- Common.Language.RU_RU,
- Common.Language.TR_TR,
- Common.Language.PL_PL,
- Common.Language.FR_FR,
- Common.Language.IT_IT,
- Common.Language.SV_SE,
- Common.Language.PT_PT,
- Common.Language.NL_NL,
- Common.Language.ZH_TW,
- Common.Language.JA_JP,
- Common.Language.AR_SA,
- Common.Language.KO_KR,
- Common.Language.PT_BR,
- Common.Language.CS_CZ,
- Common.Language.DA_DK,
- Common.Language.NO_NO
- ]
-
- property variant displayCapabilities: {
- "displayType": Common.DisplayType.GEN2_8_DMA,
- "textFields": [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack,
- Common.TextFieldName.alertText1,
- Common.TextFieldName.alertText2,
- Common.TextFieldName.alertText3,
- Common.TextFieldName.scrollableMessageBody,
- Common.TextFieldName.initialInteractionText,
- Common.TextFieldName.navigationText1,
- Common.TextFieldName.navigationText2,
- Common.TextFieldName.ETA,
- Common.TextFieldName.totalDistance,
- Common.TextFieldName.navigationText,
- Common.TextFieldName.audioPassThruDisplayText1,
- Common.TextFieldName.audioPassThruDisplayText2,
- Common.TextFieldName.sliderHeader,
- Common.TextFieldName.sliderFooter,
- Common.TextFieldName.notificationText
- ],
- "mediaClockFormats": [
- Common.MediaClockFormat.CLOCK1,
- Common.MediaClockFormat.CLOCK2,
- Common.MediaClockFormat.CLOCK3,
- Common.MediaClockFormat.CLOCKTEXT1,
- Common.MediaClockFormat.CLOCKTEXT2,
- Common.MediaClockFormat.CLOCKTEXT3,
- Common.MediaClockFormat.CLOCKTEXT4
- ],
- "graphicSupported": true,
- "imageCapabilities": [ Common.ImageType.DYNAMIC ],
- "templatesAvailable": [ "" ],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": true
- }
- },
- "numCustomPresetsAvailable": 6
- }
-
- property variant softButtonCapabilities: {
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- }
-
- property variant buttonCapabilities: []
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
deleted file mode 100644
index d335c9eb2a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file SliderModel.qml
- * @brief Data model for slider.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-QtObject {
- property string appName: ""
- property string header: ""
- property variant footer: []
- property int numTicks: 0
- property int position: 0
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
deleted file mode 100644
index f5c309880c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * @file VehicleInfoModel.qml
- * @brief Data model for vehicle info.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- id: vehicleInfo
- property real speed: 80.1
- property int rpm: 5000
- property real fuelLevel: 0.2
- property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
- property real instantFuelConsumption: 2.2
- property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
- property int wiperStatus: Common.WiperStatus.OFF
- property real engineTorque: 2.5
- property real accPedalPosition: 0.5
- property real steeringWheelAngle: 1.2
- property real externalTemperature: 40.0
- property string vin: '52-452-52-752'
- property int odometer: 2
- property int prndl: Common.PRNDL.FIFTH
-
- property variant headLampStatus: {
- "lowBeamsOn": false,
- "highBeamsOn": false,
- "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
- }
- property variant deviceStatus: {
- 'voiceRecOn': false,
- 'btIconOn': false,
- 'callActive': false,
- 'phoneRoaming': false,
- 'textMsgAvailable': false,
- 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'stereoAudioOutputMuted': false,
- 'monoAudioOutputMuted': false,
- 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
- 'eCallEventActive': false
- }
- property variant bodyInformation: {
- 'parkBrakeActive': false,
- 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
- 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
- }
- property variant beltStatus: {
- 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- }
- property variant tirePressure: {
- 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
- 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
- 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
- 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
- }
- property variant gps: {
- 'longitudeDegrees': 42.3293,
- 'latitudeDegrees': -83.0464,
- 'utcYear': 2013,
- 'utcMonth': 2,
- 'utcDay': 14,
- 'utcHours': 13,
- 'utcMinutes': 16,
- 'utcSeconds': 54,
- 'compassDirection': Common.CompassDirection.SOUTHWEST,
- 'pdop': 4,
- 'hdop': 5,
- 'vdop': 6,
- 'actual': false,
- 'satellites': 8,
- 'dimension': Common.Dimension.Dimension_2D,
- 'altitude': 7,
- 'heading': 173,
- 'speed': 2
- }
- property variant ecuDIDData: {
- 'data1': 'ECU 1 Test Data',
- 'data2': 'ECU 2 Test Data'
- }
- property variant eCallInfo: {
- "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
- "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
- "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
- }
- property variant airbagStatus: {
- "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
- "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
- "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
- "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
- }
- property variant emergencyEvent: {
- "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
- "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
- "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
- "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
- "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
- }
- property variant clusterModeStatus: {
- "powerModeActive" : true,
- "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
- "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
- "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
- }
- property variant myKey: {
- "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
- }
-
-
- function sendGpsChange(){
- sdlVehicleInfo.onGps(vehicleInfo.gps)
- }
- function sendSpeedChange(){
- sdlVehicleInfo.onSpeed(vehicleInfo.speed)
- }
- function sendRpmChange(){
- sdlVehicleInfo.onRpm(vehicleInfo.rpm)
- }
- function sendFuelLevelChange(){
- sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
- }
- function sendFuelLevel_StateChange(){
- sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
- }
- function sendInstantFuelConsumptionChange(){
- sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
- }
- function sendExternalTemperatureChange(){
- sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
- }
- function sendPrndlChange() {
- if (dataContainer.vehicleInfoModel.prndl !== -1)
- {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
- }
- function sendTirePressureChange(){
- sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
- }
- function sendOdometerChange(){
- sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
- }
- function sendBeltStatusChange(){
- sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
- }
- function sendBodyInformationChange(){
- sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
- }
- function sendDeviceStatusChange(){
- sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
- }
- function sendDriverBrakingChange(){
- sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
- }
- function sendWiperStatusChange(){
- sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
- }
- function sendHeadLampStatusChange(){
- sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
- }
- function sendEngineTorqueChange(){
- sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
- }
- function sendAccPedalPositionChange(){
- sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
- }
- function sendSteeringWheelAngleChange(){
- sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
- }
- function sendECallInfoChange(){
- sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
- }
- function sendAirbagStatusChange(){
- sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
- }
- function sendEmergencyEventChange(){
- sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
- }
- function sendClusterModeStatusChange(){
- sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
- }
- function sendMyKeyChange(){
- sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
deleted file mode 100644
index 70e7ba29ef..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
+++ /dev/null
@@ -1,285 +0,0 @@
-/**
- * @file AlertWindow.qml
- * @brief Alert popup window
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: alertWindow
- property date lastAlertTime
- property variant softButtons
- property int appId
- property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
-
- color: "transparent"
-
- property variant async
-
- Rectangle {
- id: rectangle
-
- anchors.centerIn: parent
- color: "black"
- border.color: "white"
-
- width: alertContent.width + 60
- height: alertContent.height + 60
-
- property alias alertString: alert.text
- property alias appNameString: appName.text
- property int duration
-
- Column {
- id: alertContent
- anchors.centerIn: parent
- spacing: 20
-
- Text {
- id: appName
- anchors.horizontalCenter: parent.horizontalCenter
- color: "white"
- font.pointSize: 16
- }
-
- Row {
- width: Constants.alertWidth
- spacing: 20
-
- Image {
- id: alertLogo
- source: "../res/warning.png"
- }
-
- Text {
- id: alert
- width: parent.width - alertLogo.width - parent.spacing
- clip: true
- color: "white"
- font.pointSize: 16
- }
- }
-
- Rectangle {
- id: progressIndicator
- color: "white"
- height: 10
- }
-
- Column {
- Item {
- width: Constants.alertWidth
- height: alertButton1.visible ? alertButton1.height : 0
-
- SoftButton {
- id: alertButton1
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
- anchors.left: parent.left
- anchors.right: alertButton2.visible ? alertButton2.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- SoftButton {
- id: alertButton2
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- }
- Item {
- width: Constants.alertWidth
- height: alertButton3.visible ? childrenRect.height : 0
- SoftButton {
- id: alertButton3
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
- anchors.left: parent.left
- anchors.right: alertButton4.visible ? alertButton4.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- SoftButton {
- id: alertButton4
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- }
- }
- }
-
- SequentialAnimation {
- id: animation
- PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
- PropertyAnimation {
- id: shrinkProgressAnimation
- target: progressIndicator
- property: "width"
- to: 0
- duration: rectangle.duration
- }
- }
- }
-
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- function alert (alertStrings, duration, showIndicator, sButtons, applicationId) {
- if (timer.running) { // we have alert already
- var currentTime = new Date()
- var timeFromLastAlert = currentTime - lastAlertTime
- var timeLeft = timer.interval - timeFromLastAlert
- var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
- var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
- return timeLeftRounded
- }
- else {
- lastAlertTime = new Date();
- appId = applicationId
- rectangle.appNameString = dataContainer.getApplication(appId).appName;
- softButtons = sButtons;
- rectangle.alertString = alertStrings.join('\n');
- timer.interval = duration;
- rectangle.duration = duration;
- timer.start();
- show();
-
- progressIndicator.visible = !!showIndicator
- progressIndicator.width = alertContent.width
- console.log("ProgressIndicator.width:", progressIndicator.width)
- animation.start()
- }
- }
-
- function show () {
- dataContainer.activeAlert = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- visible = true
- }
-
- function complete (reason, data) {
- if (!keep) {
- hide()
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
- break
- // For other cases
- }
- }
- timer.stop()
- }
-
- function hide() {
- console.debug(popUpName, "HIDE")
- dataContainer.activeAlert = false
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- visible = false
- }
-
- function restart() {
- animation.restart();
- timer.restart();
- }
-
- property bool keep: false
-
- onKeepChanged: {
- if (visible && !keep && !timer.running) {
- hide()
- }
- }
-
- onVisibleChanged: {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
deleted file mode 100644
index a1ef64144d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file ContextPopup.qml
- * @brief Popup view with system context.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-
-PopUp {
- function show() {
- console.debug("enter")
- if (!visible) { // must not increment counter if show() called for visible popup
- visible = true;
- dataContainer.popups++
- }
- console.debug("exit")
- }
-
- function hide() {
- console.debug("enter")
- console.debug(popUpName, "HIDE")
- if (visible) { // must not decrement counter if hide() called for invisible popup
- visible = false;
- dataContainer.popups--
- }
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
deleted file mode 100644
index 17e5de50b7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- function complete(reason){
- hide()
- }
-
- Item {
- ListModel {
- id: reasonExit
-
- Component.onCompleted: {
- for (var name in Common.ApplicationsCloseReason) {
- append({name: name});
- }
- }
- }
- }
-
- Column
- {
- anchors.centerIn: parent
- Row {
- Text {
- text: "Select reason: "
- color: "white"
- }
-
- ComboBox {
- id: reasonComboBox
- model: reasonExit
- }
- z: 1000
- }
- OvalButton {
- text: "Exit"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
- hide()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
deleted file mode 100644
index 7a5c53501e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file InteractionPopup.qml
- * @brief Interaction popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-ContextPopup {
- Text {
- id: initialText
- text: dataContainer.interactionModel.initialText
- anchors.top: parent.top
- anchors.topMargin: Constants.popupMargin
- anchors.left: parent.left
- anchors.leftMargin: Constants.popupMargin
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- ListView {
- anchors.top: initialText.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- model: dataContainer.interactionModel.choice
- delegate: OvalButton {
- width: parent.width
- text: name
- icon: image
- onClicked: {
- complete(Common.Result.SUCCESS, {"choiceID": id})
- }
- }
- }
-
- Item {
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.TIMED_OUT)
- }
- }
- }
-
- function activate () {
- console.debug("enter")
- timer.interval = dataContainer.interactionModel.timeout
- timer.start()
- show()
- console.debug("exit")
- }
-
- function complete (reason, data) {
- console.debug("enter")
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(dataContainer.interactionModel.async, data)
- break
- case Common.Result.ABORTED:
- DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.ABORTED })
- break
- case Common.Result.TIMED_OUT:
- DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.TIMED_OUT })
- break
- }
- timer.stop()
- hide()
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
deleted file mode 100644
index e65519d363..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * @file PerformAudioPassThruPopup.qml
- * @brief Popup for audio pass thru
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property variant async
-
- function showAudioPassThru(){
- console.debug("entered")
- dataContainer.uiAudioPassThru.running = true
- show()
- if (dataContainer.uiAudioPassThru.timeout) {
- timer.start()
- }
- console.debug("exited")
- }
-
- function complete(reason){
- console.debug("enter", reason)
- timer.stop()
- dataContainer.uiAudioPassThru.timeout = 0
- dataContainer.uiAudioPassThru.running = false
- switch (reason) {
- case Common.Result.ABORTED:
- console.debug("exit with abort")
- DBus.sendError(async, Common.Result.ABORTED)
- break;
- case Common.Result.SUCCESS:
- console.debug("exit with success")
- DBus.sendReply(async, {})
- break;
- case Common.Result.RETRY:
- console.debug("exit with retry")
- DBus.sendError(async, Common.Result.RETRY)
- break;
- }
- hide()
- }
-
-
- Column {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiAudioPassThru.timeout
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Row {
- spacing: Constants.generalSpacing
- Image {
- source: "../res/controlButtons/vrImage.png"
- }
-
- Column {
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.firstLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.secondLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: Constants.generalSpacing
-
- OvalButton {
- text: "Retry"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.RETRY)
- }
- }
-
- OvalButton {
- text: "Done"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.SUCCESS)
- }
- }
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
deleted file mode 100644
index 07f8c98011..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- default property alias content: content.children
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width - padding / 2
- height: parent.height - padding / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
- }
-
- onVisibleChanged: {
- if (popUpName) {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
- }
-
- function show() {
- console.debug("enter");
- visible = true;
- console.debug("exit");
- }
-
- function hide() {
- console.debug("enter");
- visible = false;
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
deleted file mode 100644
index 6dcd222ed3..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property variant async
- property int position: 1
- /**
- * Test Support Section
- */
- property int resultCode: -1
- signal onReady
- /**
- * Test Support Section End
- */
-
- function showSlider(){
- console.debug("enter")
-
- dataContainer.uiSlider.running = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- if(dataContainer.uiSlider.footer.length === 0 || dataContainer.uiSlider.position === 0 ) {
- footerText.text = ""
- } else {
- footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
- }
- position = dataContainer.uiSlider.position
- show()
- timer.start()
- onReady()
- console.debug("exit")
- }
-
- function complete(reason){
- console.debug("enter reason = ", reason)
- timer.stop()
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- dataContainer.uiSlider.running = false
- switch(reason) {
- case Common.Result.ABORTED:
- console.debug("aborted position is", position)
- resultCode = Common.Result.ABORTED
- DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
- break
- case Common.Result.SUCCESS:
- console.debug("send position", position)
- resultCode = Common.Result.SUCCESS
- dataContainer.uiSlider.position = position
- DBus.sendReply(async, {sliderPosition:position})
- break
- default:
- break
- }
- hide()
- position = 1
- console.debug("exit")
- }
-
-
- Column
- {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiSlider.timeout
- onTriggered: {
- console.debug("triggered")
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Text {
- id: headerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.header
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Rectangle {
- id: borderRectangle
- width: Constants.sliderBarWidth
- height: Constants.sliderBarHeight
- anchors.horizontalCenter: parent.horizontalCenter
- border.color: Constants.sliderBarBorderColor
- border.width: Constants.sliderBarBorderWidth
- radius: Constants.sliderBarRadius
- color: "black"
-
- Rectangle {
- id: rectangle
- color: Constants.sliderBarFillColor
- height: parent.height
- border.color: parent.border.color
- border.width: parent.border.width
- radius: parent.radius
-
- onVisibleChanged: {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- rectangle.width = dataContainer.uiSlider.position * tickWidth
- }
- }
-
- MouseArea{
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- onPositionChanged(mouse)
- }
-
- onPositionChanged: {
- if(mouseX <= 0){
- rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = 1
- }
-
- if(mouseX > borderRectangle.width) {
- rectangle.width = borderRectangle.width
- position = dataContainer.uiSlider.numTicks
- }
-
- if(mouseX > 0 && mouseX < borderRectangle.width) {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = Math.ceil(mouseX / tickWidth)
- rectangle.width = position * tickWidth
- }
-
- if(dataContainer.uiSlider.footer.length > 1){
- footerText.text = dataContainer.uiSlider.footer[position - 1]
- }
- }
- }
- }
-
- Text {
- id:footerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: ""
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-
- function getTimer() {
- return timer
- }
- function getBackButton() {
- return backButton
- }
- function getFooterText() {
- return footerText
- }
- function getBorderRectangle() {
- return borderRectangle
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
deleted file mode 100644
index 9a833b19e7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @file TBTClientStatePopUp.qml
- * @brief Popup view for TBT interface (list of states).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-PopUp {
- Item {
- ListModel {
- id: tbtState
-
- Component.onCompleted: {
- for (var name in Common.TBTState) {
- append({name: name});
- }
- }
- }
- }
- Text {
- text: "TBT Client State"
- verticalAlignment: Text.AlignVCenter
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.top: parent.top
- color: Constants.primaryColor
- }
- ComboBox {
- id: comboBox
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- model: tbtState
- onCurrentTextChanged: {
- console.log("Send signal onTBTClientState:", currentText);
- sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
deleted file mode 100644
index ce64a6be89..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file TTSPopUp.qml
- * @brief Popup view for TTS
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-PopUp {
- height: Constants.ttsPopUpHeight
- width: Constants.ttsPopUpWidth
- padding: Constants.ttsPopUpPadding
- property variant async
-
- ScrollableText {
- id: text
- anchors.fill: parent
- }
-
- resources: [
- Timer {
- id: timer
- interval: Constants.ttsSpeakTime
- onTriggered: deactivate()
- }
- ]
-
- function activate(message) {
- console.debug("Activate TTS popup:", message);
- dataContainer.activeTTS = true;
- text.text = message;
- show();
- timer.restart();
- console.debug("Exit");
- }
-
- function deactivate() {
- console.debug("Deactivate TTS popup");
- dataContainer.activeTTS = false;
- text.text = '';
- timer.stop();
- hide();
- DBus.sendReply(async, {});
- async = null;
- console.debug("Exit");
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
deleted file mode 100644
index 8718c8cd69..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file VRHelpPopup.qml
- * @brief Popup view for VR help
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-PopUp {
- Text {
- id: title
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- text: "VR HELP" // default title
- font.pixelSize: Constants.titleFontSize
- color: Constants.primaryColor
- }
-
- ScrollableListView {
- anchors.top: title.bottom
- anchors.bottom: closeButton.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
-
- model: dataContainer.vrHelp
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- }
-
- Text {
- text: model.text
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- OvalButton {
- id: closeButton
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: Constants.popupMargin
- width: Constants.ovalButtonWidth
- text: "Close"
- onClicked: complete()
- }
-
- property alias title: title.text
-
- function complete(reason, data) {
- hide()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
deleted file mode 100644
index 8a8be54be7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file VRPopUp.qml
- * @brief Popup view for VR interface (list commands).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../controls"
-
-PopUp {
- Text {
- id: title
- anchors.left: parent.left
- anchors.top: parent.top
- height: voice.height
- width: parent.width - voice.width
- text: "Speak the command"
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Image {
- id: voice
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/controlButtons/vrImage.png"
- }
-
- ScrollableListView {
- anchors.bottomMargin: Constants.popupMargin
- anchors.rightMargin: Constants.popupMargin
- anchors.leftMargin: Constants.popupMargin
- anchors.top: voice.bottom
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.left: parent.left
-
- model: dataContainer.vrCommands
-
- delegate: OvalButton {
- width: parent.width
- text: command
- onClicked: {
- sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
- }
- }
- }
-
- function activate() {
- dataContainer.activeVR = true;
- sdlVR.started();
- show();
- }
-
- function complete(reason) {
- dataContainer.activeVR = false;
- sdlVR.stopped();
- hide();
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
deleted file mode 100644
index f4582c28ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file VIPopUp.qml
- * @brief Pop up window with information about vehicle.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
- Column {
- anchors.fill: parent
- Text {
- id: viText
- width: parent.width
- height: 1/5 * parent.height
- text: "Vehicle Information"
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- }
-
- Row {
- height: 1/5 * parent.height
- width: parent.width
-
- Text {
- width: 1/4 * parent.width
- height: 1/5 * parent.height
- anchors.verticalCenter: parent.verticalCenter
- text: "PRNDL: "
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- ComboBox {
- anchors.verticalCenter: parent.verticalCenter
- id: comboBox
- model: prndlList
-
- onCurrentIndexChanged: {
- console.debug("PRNDL:", currentIndex)
- dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
- }
-
- textRole: "name"
- ListModel {
- id: prndlList
- Component.onCompleted: {
- append({ id: -1, name: "<NO DATA (prndl)>" })
- for (var name in Common.PRNDL) {
- append({ id: Common.PRNDL[name], name: name });
- }
- }
- }
- }
- z: 1000
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
deleted file mode 100644
index ea820e8019..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.7.0 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "MainWindow.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "../res"
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "." ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
deleted file mode 100644
index 4a29168881..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file AMPlayerView.qml
- * @brief AM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: amRadioPlayer
- anchors.fill: parent
- radioType: "AM"
- radioName: "AM Radio"
-
- playerState: dataContainer.amPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
deleted file mode 100644
index 19ecf4ca47..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * @file ApplicationListView.qml
- * @brief Application list view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Column {
- anchors.fill: parent
- Item {
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- OvalButton {
- text: "Find New Apps"
- }
-
- OvalButton {
- text: "Change device"
- onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
- }
-
- OvalButton {
- text: "911 Assist"
- }
-
- OvalButton {
- text: "Vehicle Health Report"
- }
-
- OvalButton {
- text: "Install applications/Up"
- }
- }
- }
-
- Item {
- height: parent.height / 2
- width: parent.width
-
- ScrollableListView {
- id: applicationListView
- anchors.fill: parent
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- dataContainer.setCurrentApplication(appId)
- dataContainer.currentApplication.isMediaApplication ? contentLoader.go("./views/SDLPlayerView.qml", dataContainer.currentApplication.appId)
- : contentLoader.go("./views/SDLNonMediaView.qml", dataContainer.currentApplication.appId)
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
deleted file mode 100644
index 0a5390e920..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * @file BTPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: btPlayer
- playerName: "BT Audio"
- anchors.fill: parent
-
- playerState: dataContainer.btPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: btPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
deleted file mode 100644
index f582ff2f7e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file CDPlayerView.qml
- * @brief CD player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: cdPlayer
- playerName: "CD"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.cdPlayerState
-
- buttons: [
- OvalButton {
- text: cdPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
deleted file mode 100644
index 9b04b1bad7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file CarMenuGridView.qml
- * @brief Car menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: CarMenuModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
deleted file mode 100644
index 643b074506..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @file ChangeDeviceView.qml
- * @brief Screen view with list of available devices.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Text {
- id: searchDeviceText
- anchors.left: parent.left
- anchors.top: parent.top
- height: 1/4 * parent.height
- width: parent.width
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- text: "Devices available:"
- verticalAlignment: Text.AlignVCenter
- }
-
- ListView {
- id: changeDeviceListView
- anchors.left: parent.left
- anchors.top: searchDeviceText.bottom
- model: dataContainer.deviceList
- width:parent.width
- height:parent.height - searchDeviceText.height
-
- delegate: Text {
- MouseArea {
- anchors.fill: parent
- onClicked: {
- sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
- sdlBasicCommunication.onFindApplications({ name: name, id: devid })
- contentLoader.go("./views/ApplicationListView.qml")
- }
- }
- text: name
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- }
- }
- }
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-
- Component.onCompleted: {
- console.log("ChangeDeviceView Component.onCompleted enter");
- sdlBasicCommunication.onStartDeviceDiscovery();
- console.log("ChangeDeviceView Component.onCompleted exit");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
deleted file mode 100644
index 01c289b139..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file ClimateControlView.qml
- * @brief Screen view of climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-
-GeneralView {
- Item {
- id: climatMenu
- anchors.fill: parent
-
- Item {
- height: parent.height
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Column {
- id: leftItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- Row {
- ClimateControlBtn {name: "heated_seat"}
- ClimateControlBtn {name: "heated_wheel"}
- }
- Row {
- ClimateControlBtn {name: "AC"}
- ClimateControlBtn {name: "headed_dash"}
- }
- }
-
- Column {
- id: centralItem
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
- ClimateControlBtn {name: "face"; state: "on"}
- ClimateControlBtn {name: "feet"}
- }
-
- Row {
- id: rightItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- ClimateControlBtn {
- anchors.verticalCenter: parent.verticalCenter
- txt: "Dual"
- state: "on"
- }
-
- Column {
- ClimateControlBtn { name: "heated_seat" }
- ClimateControlBtn { name: "AC" }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
deleted file mode 100644
index a2b2be590b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * @file ContactsListView.qml
- * @brief Contact list screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- function setCurrent(firstLetter){
- for(var i = 0; i < contactsListView.count; i ++) {
- if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
- contactsListView.positionViewAtIndex(i, ListView.Beginning)
- break;
- }
- }
- }
- Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- ScrollableListView {
- id: contactsListView
- anchors.fill: parent
- clip: true
- spacing: 1/2 * Constants.fontSize
- model: ContactsListModel { }
-
- section.property: "name"
- section.criteria: ViewSection.FirstCharacter
- section.delegate: Text {
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: section.toUpperCase()
- }
-
- delegate: Item {
- anchors.left: parent.left
- width: parent.width - Constants.scrollBarWidth
- height: typeText.height
-
- Text {
- id: contactName
- anchors.left: parent.left
- text: name
- width: Constants.contactListNameFieldSize * parent.width
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- elide: Text.ElideRight
- }
- Text {
- id: phoneText
- anchors.left: contactName.right
- width: Constants.contactListPhoneFieldSize * parent.width
- text: phone
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- Text {
- id: typeText
- anchors.right: parent.right
- width: Constants.contactListDescriptionFieldSize * parent.width
- text: type
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
deleted file mode 100644
index 5c3ca6a5a9..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file FMPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: fmRadioPlayer
- anchors.fill: parent
- radioType: "FM"
- radioName: "FM Radio"
-
- playerState: dataContainer.fmPlayerState
-
- property int hdButtonValue: 1
-
- buttonHD: [
- Image {
- id: hdButton
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- source: "../res/buttons/long_oval_btn.png"
- property string textColor: Constants.primaryColor
-
- Row {
- anchors.centerIn: parent
- spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
-
- Image {
- id: hdLogo
- anchors.verticalCenter: parent.verticalCenter
- source:"../res/hd_logo_on.png"
- }
-
- Text {
- id: one
- anchors.verticalCenter: parent.verticalCenter
- text: "1"
- color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: two
- anchors.verticalCenter: parent.verticalCenter
- text: "2"
- color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: three
- anchors.verticalCenter: parent.verticalCenter
- text: "3"
- color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: four
- anchors.verticalCenter: parent.verticalCenter
- text: "4"
- color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- hdLogo.source = "../res/hd_logo_off.png"
- hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
- hdButton.textColor = Constants.secondaryColor
-
- }
- onReleased: {
- hdLogo.source = "../res/hd_logo_on.png"
- hdButton.source = "../res/buttons/long_oval_btn.png"
- hdButton.textColor = Constants.primaryColor
- fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
- }
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
deleted file mode 100644
index 40f809299d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file GeneralView.qml
- * @brief Base view class. Defines properties and behavior common for all views
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- /// HMI context view is related to
- property int systemContext: Common.SystemContext.SYSCTXT_MAIN
- /// True if view is in application context
- property bool applicationContext: false
- /// View category for AppDeactivated notification (reason)
- property int category: Common.DeactivateReason.GENERAL
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
deleted file mode 100644
index 4cc2f4f615..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file GridMenu.qml
- * @brief Parent class for main menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- id: main
- property alias model: repeater.model
- property alias delegate: repeater.delegate
- property alias rows: grid.rows
- property int columnsOnPage: Constants.menuColumnCount
-
- Flickable {
- id: flicker
- anchors.fill: parent
- contentWidth: grid.width
- flickableDirection: Flickable.HorizontalFlick
-
- Grid {
- id: grid
- anchors.centerIn: parent
- rows: Constants.menuRowCount
- columns: Math.ceil(model.count / rows)
- flow: Grid.TopToBottom
- Repeater {
- id: repeater
- }
- }
-
- property int snapTo: width / parent.columnsOnPage
- onMovementEnded: {
- var rest = flicker.contentX % snapTo
- var time = 0.25
- if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
- var vel = 2 * rest / time
- flickDeceleration = Math.abs(vel) / time
- flick(vel, 0)
- flickDeceleration = 1500
- }
- }
-
- Pager {
- id: pager
- space: 10
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: Constants.margin
-
- pages: Math.ceil(grid.columns / parent.columnsOnPage)
- activePage: Internal.activePageChoose(flicker, pager.pages)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
deleted file mode 100644
index 83f1ffcd01..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * @file HardwareButtonsView.qml
- * @brief Area of screen responsible for hardware buttons
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- height: row.height + row.anchors.margins
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.panelColor
-
- signal buttonDown(string name)
- signal buttonUp(string name)
-
- function pressButton(name) {
- buttonDown(name)
- }
-
- function longPressButton(name) {
- console.log("long press " + name)
- }
-
- function releaseButton(name) {
- buttonUp(name)
- }
-
- Row {
- id: row
- spacing: Constants.panelPadding
- anchors.centerIn: parent
- anchors.margins: Constants.panelPadding
-
- PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
-
- MaskedButton {
- name: "vr"
- anchors.verticalCenter: parent.verticalCenter
- onReleased: {
- console.debug("Clicked VR button");
- if (!dataContainer.activeVR) {
- vrPopUp.activate();
- } else {
- vrPopUp.complete();
- }
- }
- }
-
- ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
-
- Grid {
- columns: 5
- rows: 2
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- Repeater {
- model: 10
- delegate : Rectangle {
- width: 40
- height: 40
- radius: 5
- gradient: Gradient {
- GradientStop
- {
- position: 0.0;
- color: "#2c2c2c"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
-
- GradientStop
- {
- position: 1.0;
- color: "black"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
- }
-
- Text {
- text: (1 + index) % 10
- font.pixelSize: 30
- color: Constants.panelTextColor
- anchors.centerIn: parent
- }
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- property bool clickProcessed
- onPressed: {
- parent.gradient.stops[0].position = 1.0
- parent.gradient.stops[1].position = 0.0
- clickProcessed = false
- timer.start()
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- onReleased: {
- parent.gradient.stops[0].position = 0.0
- parent.gradient.stops[1].position = 1.0
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- Connections {
- target: timer
- onTriggered: {
- if(!mouseArea.clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
- mouseArea.clickProcessed = true
- }
- }
- }
- }
-
- Component.onCompleted: {
- settingsContainer.buttonCapabilities.push(
- {
- name: Common.ButtonName.PRESET_0 + index,
- upDownAvailable: true,
- shortPressAvailable: true,
- longPressAvailable: true
- });
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
deleted file mode 100644
index 4d9b8091d7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file IPodPlayerView.qml
- * @brief IPod player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: ipodPlayer
- playerName: "iPod"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.ipodPlayerState
-
- buttons: [
- OvalButton {
- text: ipodPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
deleted file mode 100644
index eca575d6b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file LineInPlayerView.qml
- * @brief LineIn player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: lineInPlayer
- playerName: "LineIn"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.linePlayerState
-
- buttons: [
- OvalButton {
- text: lineInPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
deleted file mode 100644
index 321a67831c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file MainMenuView.qml
- * @brief Main menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: MainMenuListModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
deleted file mode 100644
index 183798eb49..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file MediaClockView.qml
- * @brief Media clock view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- property alias time: timeText.text
- Text {
- id: timeText
- anchors.left: parent.left
- width: 1/10 * parent.width
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignRight
- color: "white"
- text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
- : "02:36" //TODO {Aleshin}: get track time for all players except SDL
- font.pixelSize: 18
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- height: parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: dataContainer.currentApplication.mediaClock.progress * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
deleted file mode 100644
index 866f5399cb..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
+++ /dev/null
@@ -1,325 +0,0 @@
-/**
- * @file MediaPlayerView.qml
- * @brief Parent for BT, IPod, CD players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- id: mediaPlayerView
-
- property string playerName: ""
- property string playerType: ""
-
- signal rewind
- signal forward
- signal play
- signal pause
-
- // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
- property PlayerState playerState;
-
- property alias buttons: buttonsRow.content
- property alias buttonsSpacing: buttonsRow.spacing
- property alias image: image.source
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- width: parent.width
- height: 1/5 * parent.height
- anchors.left: parent.left
- anchors.top: parent.top
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
- : (width - 2 * elementWidth)
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- }
- }
-
- Item {
- id: spacingBetweenItems
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 2/5 * parent.height
- anchors.left: parent.left
- anchors.top: spacingBetweenItems.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - titleText.height - 3 * text.height) / 3
-
- Text {
- id: titleText
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
- : playerState.trackName
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- }
-
- Text {
- id: text
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
- : playerState.albumName
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
- : playerState.trackNumber
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- horizontalAlignment: dataContainer.hmiUITextAlignment
- visible: mediaPlayerView.playerType === "SDL" && dataContainer.navigationModel.timeToDestination
- }
- }
- }
-
- MediaClockView {
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- id: spacingBetweenItems2
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: mediaContent.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Row {
- // Rewind, play, pause, forward buttons
- id: playPauseRewindForward
- width: parent.width
- height: 1/5 * parent.height - statusBar.height
- anchors.left: parent.left
- anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
- anchors.top: spacingBetweenItems2.bottom
-
- Image {
- id: prevButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_prev_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
- }
- onReleased: {
- prevButton.source = "../res/buttons/player_prev_btn.png"
- }
- }
- }
-
- PlayPauseButton {
- id: playPauseButton
- anchors.verticalCenter: parent.verticalCenter
- state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
- onClicked: {
- (state == 'Play') ? play() : pause();
- var newState = state === "Play" ? "Pause" : "Play";
- (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
- : playerState.playPauseState = newState
- }
- }
-
- Image {
- id: nextButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_next_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- nextButton.source = "../res/buttons/player_next_pressed_btn.png"
- }
- onReleased: {
- nextButton.source = "../res/buttons/player_next_btn.png"
- }
- }
- }
- }
-
- Item {
- id: presetButtons
- width: parent.width
- height: 1/5 * parent.height
- anchors.top: playPauseRewindForward.bottom
- anchors.left: parent.left
-
- PresetRow {
- id: presetsRow
- anchors.top: parent.top
- anchors.left: parent.left
- presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow() : []
- width: parent.width
- property bool clickProcessed
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- onTriggered: {
- console.log("preset button hold")
- presetsRow.clickProcessed = true
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + presetsRow.selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
-
- onPresetButtonPressed: {
- console.log("preset button pressed")
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- console.log("preset button released")
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- }
- }
-
- StatusBar {
- id: statusBar
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-
- states: [
- State {
- name: 'presetButtonsON'
- when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1
- }
- PropertyChanges {
- target: presetButtons
- visible: true
- enabled: true
- }
- },
-
- State {
- name: 'presetButtonsOFF'
- when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: presetButtons
- visible: false
- enabled: false
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
deleted file mode 100644
index c9c30e200c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file MusicSourceView.qml
- * @brief Music source screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: dataContainer.musicSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml, appId)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
deleted file mode 100644
index 6d5ad5027f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file NavigationInRouteGridView.qml
- * @brief Navigation in route screen veiw.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-
-GeneralView {
- Item {
- id: navInRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: Constants.releasedButtonTextColor
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- Image {
- id: muteBtnImg
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * muteBtnImg.width
- source: "../res/nav/mute_off.png"
- MouseArea {
- anchors.fill: parent
- onClicked: if (muteBtnImg.state === "off") {
- muteBtnImg.state = "on"
- muteBtnImg.source = "../res/nav/mute_off.png"
- }
- else {
- muteBtnImg.source = "../res/nav/mute_on.png"
- muteBtnImg.state = "off"
- }
- }
- }
-
- Image {
- id: turnArrow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: muteBtnImg.right
- anchors.leftMargin: 1/20 * contentLoader.width
- source: "../res/nav/turnArrow.png"
- }
-
- Text {
- id: street
- anchors.verticalCenter: cancel.verticalCenter
- anchors.left: turnArrow.right
- anchors.leftMargin: 1/20 * contentLoader.width
- text: "0.2 mi on Cherry Hill Rd."
- color: "White"
- font.pixelSize: 20
- }
-
- Text {
- id: timeToDest
- anchors.verticalCenter: cancel.verticalCenter
- anchors.right: cancel.left
- anchors.rightMargin: 1/20 * contentLoader.width
- text: "2 hrs 27 min"
- color: "White"
- font.pixelSize: 20
- }
-
- Image {
- id: cancel
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- source: "../res/buttons/long_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: cancel.left
- anchors.leftMargin: Constants.fontSize
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: cancelText
- anchors.centerIn: parent
- text: "Cancel"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- cancel.source = "../res/buttons/long_oval_pressed_btn.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- cancelText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- cancel.source = "../res/buttons/long_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- cancelText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationNoRouteGridView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
deleted file mode 100644
index 3ef73ee67d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file NavigationKeyboardView.qml
- * @brief Navigation keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navKeyboard
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- // Text line with input text
- TextInput {
- id: inputText
- anchors.top:parent.top
- anchors.left:parent.left
- maximumLength: 30
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: dataContainer.routeText
- }
-
- // Keyboard
- Column {
- anchors.centerIn: parent
- Row {
- id: upperRow
- property string qWERTY : "QWERTYUIOP"
- anchors.horizontalCenter: parent.horizontalCenter
-
- Repeater {
- model: 10
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: upperRow.qWERTY.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += upperRow.qWERTY.charAt(index)
- }
- }
- }
- }
- Row {
- id: middleRow
- property string aSDFGH : "ASDFGHJKL"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 15
- }
- //--------------
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: middleRow.aSDFGH.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += middleRow.aSDFGH.charAt(index)
- }
- }
- }
- //--------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- onIsPressedChanged: {
- hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
- }
- Image {
- id: hoverImg
- anchors.centerIn: parent
- source: "../res/nav/delete_icon.png"
- }
-
- onClicked: {
- dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
- }
- }
- }
- Row {
- id: lowerRow
- property string zXCVBN : "ZXCVBNM"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "!@#"
- pixelSize: 15
- }
- //-----------------
- Repeater {
- model: 7
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: lowerRow.zXCVBN.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
- }
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Clear"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText = ""
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Space"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText += " "
- }
- }
- }
-
- } // column
-
- Image {
- id: goBtn
- anchors.right: parent.right
- anchors.top: parent.top
- source: "../res/buttons/short_oval_btn.png"
-
- Text {
- id: goText
- anchors.centerIn: parent
- text: "Go"
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
- goText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- goBtn.source = "../res/buttons/short_oval_btn.png"
- goText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationInRouteGridView.qml")
- }
- }
- }
- } // 3/4 top screen
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
deleted file mode 100644
index 5ceffe0526..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file NavigationMenuView.qml
- * @brief Navigation menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: NavigationMenuModel {}
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
deleted file mode 100644
index 312f076394..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * @file NavigationNoRouteGridView.qml
- * @brief Navigation no route screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navNoRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- id: bottomPart
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Destination search button
- Image {
- id: destSearch
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- source: "../res/buttons/longest_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 15
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: destText
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: destIcon.right
- anchors.leftMargin: 5
- text: "Destination"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- destText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- destSearch.source = "../res/buttons/longest_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- destText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationMenuView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
deleted file mode 100644
index b328406d68..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * @file PhoneKeyboardView.qml
- * @brief Phone keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView{
- Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
-
- Item {
- function changeColorOfActiveButtons() {
- for (var i = 0; i < contactsListModel.count; i++) {
- activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
- }
- }
-
- id: phoneKeyboard
- anchors.fill: parent
-
- property variant activeButtons: {
- "A": false, "B": false, "C": false, "D": false, "E": false,
- "F": false, "G": false, "H": false, "I": false, "J": false,
- "K": false, "L": false, "M": false, "N": false, "O": false,
- "P": false, "Q": false, "R": false, "S": false, "T": false,
- "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
- }
-
- ContactsListModel {
- id: contactsListModel
- }
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- Column {
- anchors.centerIn: parent
-
- Row {
- id: upperRow
- property string contentLoader : "ABCDEFGHI"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: upperRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: middleRow
- property string contentLoader : "JKLMNOPQR"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: middleRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: lowerRow
- property string contentLoader : "STUVWXYZ"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 8
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: lowerRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 20
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent}
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
deleted file mode 100644
index 7d52b1223a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @file PhoneMenuGridView.qml
- * @brief View for phone menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: PhoneMenuModel {}
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
deleted file mode 100644
index 1df65d4235..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * @file RadioPlayerView.qml
- * @brief Parent for AM, FM, Sirius players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-Item {
- id: radioPlayerView
-
- property string radioType: ""
- property string radioName: ""
- property alias buttonHD: bot.children
-
- property PlayerState playerState
-
- Item {
- // top 3/4 screen
- id: upperContent
- anchors.top: parent.top
- anchors.left: parent.left
- height: parent.height * 3/4
- width: parent.width
-
- Item {
- // top part for buttons
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- OvalButton {
- text: radioName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- }
-
- OvalButton {
- anchors.right: parent.right
- anchors.top: parent.top
- text: "Tune"
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- // mid part for information about song
- id: mid
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- width: parent.width
- height: parent.height / 2
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
-
- Row {
- Text {
- id: radioChannelNameText
- color: Constants.primaryColor
- text: playerState.presets[0]
- font.pixelSize: 45
- }
- Text {
- anchors.bottom: radioChannelNameText.bottom
- color: Constants.primaryColor
- text: " " + radioType
- font.pixelSize: 25
- }
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.songName
- font.pixelSize: 25
- font.bold: true
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.albumName
- font.pixelSize: 25
- }
- }
- }
-
- Item {
- // bottom part for HD button (for FM radio)
- id: bot
- anchors.left: parent.left
- anchors.bottom: parent. bottom
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Line that divide screen in two parts
- Rectangle {
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 2
- color: Constants.primaryColor
- }
-
- PresetRow {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: playerState.presets
- width: parent.width
- onSelectedIndexChanged: {
- radioChannelNameText.text = presets[selectedIndex];
- }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
deleted file mode 100644
index 620b0434c6..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * @file SDLNavi.qml
- * @brief SDL navigation screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.fill: parent
- id: wholeWindow
-
- Row {
- // Top items
- id: topItems
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField1
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- anchors.top: parent.top
- width: 3/5 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField2
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- id: rightRectOfTopItems
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Column {
- // "+", "-" button at left
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- width: 1/12 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "+"
- isCustomButton: true
- customButtonID: 3
- }
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "-"
- isCustomButton: true
- customButtonID: 4
- }
- }
-
- Column {
- anchors.right: parent.right
- anchors.top: topItems.bottom
- width: 1/6 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: ""
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Row {
- // bottom items
- id: bottomItems
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Menu"
- isCustomButton: true
- customButtonID: 1
- }
- Rectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: "mainField5"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Custom Button"
- isCustomButton: true
- customButtonID: 2
- }
- }
-
- GradientRectangle {
- anchors.right: parent.right
- anchors.bottom: bottomItems.top
- anchors.bottomMargin: Constants.sdlNaviSpacing
- width: 1/6 * parent.width
- height: 1/10 * parent.height
- text: "Options"
- fontSize: Constants.fontSize
- onReleased: {
- contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
- }
-
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
deleted file mode 100644
index bebfe9585d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * @file SDLNonMediaView.qml
- * @brief SDL non media screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-import QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: upperContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Item {
- id: topButtonRow
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- spacing: (width - 4 * elementWidth) / 3
- snapTo: elementWidth + spacing
-
- OvalButton {
- text: "Options"
- onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- }
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- id: midContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: topButtonRow.bottom
- anchors.left: parent.left
-
- Text {
- id: deviceName
- width: parent.width
- height: 1/5 * parent.height
- text: "Device: " + dataContainer.currentApplication.deviceName
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Row {
- width: parent.width
- height: 4/5 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.hmiUIText.image
- }
-
- Column {
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: Constants.margin
-
- Text {
- id: text1
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField1
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField2
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- PresetRow {
- id: presetsRow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: Internal.getArrayForPresetRow()
- width: parent.width
- property bool clickProcessed
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPresetButtonPressed: {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- }
- }
- }
- }
- }
-
- StatusBar {
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
deleted file mode 100644
index 076851b29a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * @file SDLPlayerOptionsListView.qml
- * @brief SDL player options screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_MENU
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- ListView {
- id: sdlPlayerOptionsListView
- anchors.horizontalCenter: parent.horizontalCenter
- width:parent.width
- height:parent.height
-
- model: dataContainer.currentApplication.currentSubMenu
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
-
- MouseArea {
- anchors.fill: parent
- enabled: model.icon.value !== undefined
-
- onPressed: text.press()
- onReleased: text.release()
- onCanceled: text.release()
- onClicked: text.click()
- }
- }
-
- ClickableText {
- id: text
- text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
- width: sdlPlayerOptionsListView.width - x
- elide: Text.ElideRight
- defaultColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColor :
- Constants.primaryColor
- pressedColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColorPressed :
- Constants.primaryColorPressed
- font.pixelSize: Constants.titleFontSize
-
- function click() {
- console.debug("enter")
- switch (type) {
- case Internal.MenuItemType.MI_NODE:
- sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
- contentLoader.back()
- break;
- case Internal.MenuItemType.MI_SUBMENU:
- case Internal.MenuItemType.MI_PARENT:
- dataContainer.currentApplication.currentSubMenu = subMenu
- break;
- }
- console.debug("exit")
- }
- onClicked: click()
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
deleted file mode 100644
index 0c1bd5b7e9..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file SDLPlayerView.qml
- * @brief SDL player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- applicationContext: true
- MediaPlayer {
- id: mediaPlayer
- onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- playerName: "SDL music"
- playerType: "SDL"
- image: dataContainer.currentApplication.hmiUIText.image
- anchors.fill: parent
-
- buttons: [
- OvalButton {
- text: dataContainer.currentApplication.appName
- onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
- },
-
- OvalButton {
- text: "SDL Menu"
- onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
- },
-
- OvalButton {
- text: "Options"
- onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- },
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
deleted file mode 100644
index f7111906de..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
+++ /dev/null
@@ -1,216 +0,0 @@
-/**
- * @file ScrollableMessageView.qml
- * @brief Scrollable Message View .
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-import "../popups"
-
-GeneralView {
- applicationContext: true
- id: scrollableMessageView
-
- function complete(abort){
- console.debug("enter")
- timer.stop()
- dataContainer.scrollableMessageModel.running = false
-
- dataContainer.popups--
- dataContainer.applicationContext = dataContainer.applicationSavedContext
-
- if(abort) {
- console.debug("send error")
- DBus.sendError(dataContainer.scrollableMessageModel.async, Common.Result.ABORTED)
- } else {
- console.debug("send ok")
- DBus.sendReply(dataContainer.scrollableMessageModel.async, {})
- }
-
- contentLoader.back()
- console.debug("exit")
- }
-
-
- Connections {
- target: contentLoader
- onStatusChanged: {
- if (status == Component.Ready) {
- console.debug("enter")
- console.debug("timeout in timer", timer.interval)
- dataContainer.popups++
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- dataContainer.scrollableMessageModel.running = true
- timer.start()
- console.debug("exit")
- }
- }
- }
-
- Rectangle {
- anchors.fill: parent
- color: Constants.secondaryColor
-
- Timer {
- id: timer
- interval: dataContainer.scrollableMessageModel.timeout
- onTriggered: {
- complete(false)
- }
- }
-
- Item {
- // top 1/6 of screen
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/6 : 1
-
- OvalButton {
- //this button is used only to get item size for PagedFlickable
- id: fakeButton
- text: "defaultBtnSize"//remove this line when default size for btn will be introduced
- visible:false
- }
-
- PagedFlickable {
- id: flickRow
- width: top.width
- spacing: (width - fakeButton.width * 4) / 3
- snapTo: fakeButton.width + spacing
- elementWidth: fakeButton.width
-
-
- ListView {
- id: softButtons
- width: model.count * fakeButton.width + (model.count - 1) * flickRow.spacing
- height: fakeButton.height
- spacing: flickRow.spacing
-
- orientation: ListView.Horizontal
- interactive: false
- model: dataContainer.scrollableMessageModel.softButtons
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: model
- onKeepContext: timer.restart()
- onDefaultAction: scrollableMessageView.complete(true)
- }
- }
- }
- }
-
- Item {
- id: middle
- anchors.top: top.bottom
- anchors.left: parent.left
- anchors.bottom: bottom.top
- width: parent.width
-
- Flickable {
- id:flickable
- anchors.fill: middle
- flickableDirection: Flickable.VerticalFlick
- contentWidth: longMessageText.width
- contentHeight: longMessageText.height
- clip: true
-
-
- Text {
- id: longMessageText
- wrapMode: Text.Wrap
- width: middle.width
- text: dataContainer.scrollableMessageModel.longMessageText
- color: Constants.scrollableMessageTextColor
- font.pixelSize: Constants.fontSize
-
- }
- }
- Rectangle {
- id: scrollbar
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollableMessageScrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- visible: !(flickable.visibleArea.heightRatio > 1)
- color: Constants.scrollableMessageScrollBarColor
- }
-
- }
-
- Item {
- // 1/4 bottom screen
- id: bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton {
- id:backButton
- anchors.centerIn: parent
- onClicked: {
- console.debug("enter")
- complete(true)
- console.debug("exit")
- }
- }
- }
- }
- /**
- * Test Support Section
- *
- */
- function getTimer(){
- return timer
- }
- function getSoftButtonsListView(){
- return softButtons
- }
- function getScrollbar(){
- return scrollbar
- }
- function getTextArea(){
- return middle
- }
- function getBackButton(){
- return backButton
- }
- /**
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
deleted file mode 100644
index c30d83f019..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
+++ /dev/null
@@ -1,284 +0,0 @@
-/**
- * @file SimulationView.qml
- * @brief Area of screen responsible for simulation actions
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../popups"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- width: controlArea.width + controlArea.anchors.margins
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.panelColor
-
- Item {
- id: showArea
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
-
- ExitAllApplicationsPopup {
- id: exitAllApplicationsPopup
- anchors.fill: parent
- visible: false
- }
-
- VehicleInfoPopUp {
- id: viPopUp
- anchors.fill: parent
- }
-
- TBTClientStatePopUp {
- id: tbtClientStatePopUp
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: controlArea
- anchors.bottom: parent.bottom
- anchors.margins: Constants.panelPadding
- anchors.horizontalCenter: parent.horizontalCenter
- width: table.width
-
- ListModel {
- id: languagesList
-
- Component.onCompleted: {
- for (var name in Common.Language) {
- if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
- append({name: name.replace('_', '-')});
- }
- }
- }
- }
-
- Text {
- id: label
- text: "Languages"
- color: Constants.panelTextColor
- anchors.bottom: table.top
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Grid {
- id: table
- spacing: 5
- columns: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: globalProperties.top
-
- Text {
- text: "HMI UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "HMI TTS + VR"
- color: Constants.panelTextColor
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
- }
- z: 1000
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- }
- z: 1000
- }
-
- Text {
- text: "Application UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "Application TTS + VR"
- color: Constants.panelTextColor
- }
-
- Text {
- id: uiLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
- uiLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- Text {
- id: ttsLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
- ttsLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- PushButton {
- id: vehicleInfo
- label: "Vehicle info"
- toggleMode: true
- onPressed: {
- viPopUp.show();
- }
- onUnpressed: {
- viPopUp.hide();
- }
- }
-
- PushButton {
- id: tbtClientState
- label: "TBT Client state"
- toggleMode: true
- onPressed: {
- tbtClientStatePopUp.show();
- }
- onUnpressed: {
- tbtClientStatePopUp.hide();
- }
- }
-
- PushButton {
- label: "Exit application"
- onClicked: {
- if (dataContainer.applicationContext) {
- sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
- }
- }
- }
-
- PushButton {
- id: exitAllAppsButton
- label: "Exit all apps"
- toggleMode: true
- onPressed: {
- exitAllApplicationsPopup.show()
-
- }
- onUnpressed: {
- exitAllApplicationsPopup.hide()
- }
- Connections {
- target: exitAllApplicationsPopup
- onVisibleChanged: {
- if (!exitAllApplicationsPopup.visible) {
- exitAllAppsButton.state = "unpressed"
- }
- }
- }
- }
-
- CheckBox {
- color: Constants.panelTextColor
- text: "Use URL"
- }
-
- CheckBox {
- color: Constants.panelTextColor
- text: "DD"
-
- onClicked: {
- if (checked) {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_ON;
- } else {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_OFF;
- }
- }
- }
- }
-
- Rectangle {
- id: globalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- height: listGlobalProperties.height + Constants.panelPadding
- border.color: Constants.panelTextColor
- border.width: 1
- color: Constants.panelColor
- Column {
- id: listGlobalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.panelPadding / 4
- Text {
- text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
- color: Constants.panelTextColor
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
deleted file mode 100644
index 14dd211303..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file SiriusPlayerView.qml
- * @brief Sirius player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../controls"
-
-GeneralView {
- RadioPlayer {
- id: siriusRadioPlayer
- anchors.fill: parent
- radioType: ""
- radioName: "Sirius"
-
- playerState: dataContainer.siriusPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
deleted file mode 100644
index 630113334e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * @file TurnByTurnView.qml
- * @brief View for TurnByTurn.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: turnByTurnView
- anchors.fill: parent
-
- Item {
- // top 3/4 of screen
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 3/4
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (width - 4 * elementWidth) / 3
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
-
- OvalButton {
- id: turnListButton
- text: "TurnList"
- onClicked: {
- console.log("Go to TurnListView");
- contentLoader.go("./views/TurnListView.qml");
- }
- }
-
- Repeater {
- model: dataContainer.navigationModel.softButtons ?
- dataContainer.navigationModel.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.navigationModel.appId
- button: dataContainer.navigationModel.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 3/4 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.navigationModel.turnIcon
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - 5 * navText1.height) / 4
-
- Text {
- id: navText1
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.navigationModel.text1
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.text1
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.navigationModel.text2
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.text2
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Total distance: " + dataContainer.navigationModel.totalDistance
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.totalDistance
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.timeToDestination
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "ETA: " + dataContainer.navigationModel.eta
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.eta
- }
- }
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- height: 1/4 * parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- id: coveredDistance
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: dataContainer.navigationModel.distanceToManeuver / dataContainer.navigationModel.distanceToManeuverScale * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: parent.width - coveredDistance.width
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
deleted file mode 100644
index 91ff02ea02..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file TurnListView.qml
- * @brief View for TurnByTurn list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.left: parent.left
- anchors.top: parent.top
- width: parent.width
- height: 3/4 * parent.height
-
- Item {
- id: sotfButtons
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- Repeater {
- model: dataContainer.currentApplication.turnListSoftButtons ?
- dataContainer.currentApplication.turnListSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.turnListSoftButtons.get(index)
- }
- }
- }
- }
-
- ScrollableListView {
- id: scrollableList
- anchors.top: sotfButtons.bottom
- anchors.left: parent.left
- width: parent.width
- height: 3/4 * parent.height
-
- model: dataContainer.currentApplication.turnList
-
- delegate:
- ListItem {
- width: scrollableList.width
- height: Constants.iconItemListSize
- text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
- fontSize: Constants.fontSize
- icon: dataContainer.currentApplication.turnList.get(index).turnIcon
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- id: back
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
deleted file mode 100644
index 4b17b55c10..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file UsbPlayerView.qml
- * @brief USB player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: usbPlayer
- playerName: "USB"
- anchors.fill: parent
- playerState: dataContainer.usbPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: usbPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
deleted file mode 100644
index e096cb80d1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * @file WarningInfo.qml
- * @brief Screen with warning information.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: warningInfo
- anchors.fill: parent
- color: Constants.secondaryColor
- Text {
- anchors.top: parent.top
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- text: "WARNING!"
- color: Constants.warningColor
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- style: Text.Raised
- styleColor: "gray"
- }
-
- Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.margin
- height: 1/2 * parent.height
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.WordWrap
-
- text: "This application is intended to be used as a demonstrative aid only, "
- + "while the vehicle is parked. Don't use it while driving. <br /><br />"
- + "Use extreme caution when using any device that takes your attention off the road. "
- + "Ford recommends against the use of any hand-held device while driving and that you comply "
- + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
- color: "white"
- font.pixelSize: 25
- font.bold: true
- }
-
- function showOkButton() {
- okButtonAnimation.start()
- }
-
- Item {
- id: ok
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- opacity: 0
-
- SequentialAnimation
- {
- id: okButtonAnimation
- // Decrease this value while debugging
- PauseAnimation { duration: Constants.warningScreenDuration }
- NumberAnimation {
- target: ok
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
-
- Image {
- id: okButton
- anchors.centerIn: parent
- source: "../res/buttons/longest_oval_btn.png"
-
- Text {
- id: text
- anchors.centerIn: parent
- text: "OK"
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/longest_oval_btn_pressed.png"
- text.color = Constants.secondaryColor
- }
- onReleased: {
- parent.source = "../res/buttons/longest_oval_btn.png"
- text.color = Constants.primaryColor
- }
- onClicked: {
- console.log("WarningInfo OkButton - on clicked enter");
- warningInfo.visible = false
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
deleted file mode 100644
index e6eeb9e525..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
-set(qml_dirs hmi_api controls models popups views)
-set(qml_files MainWindow.qml)
-
-add_custom_target(qml_auto ALL
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${proxy_dir}/BasicCommunicationProxy.qml
- ${proxy_dir}/ButtonsProxy.qml
- ${proxy_dir}/NavigationProxy.qml
- ${proxy_dir}/TTSProxy.qml
- ${proxy_dir}/UIProxy.qml
- ${proxy_dir}/VehicleInfoProxy.qml
- ${proxy_dir}/VRProxy.qml
- from:
- ${api_xml} ..."
-)
-
-add_custom_target(qml_copy_resources ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
- COMMENT "Copying resources")
-
-if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- foreach(qml_dir ${qml_dirs})
- add_custom_target(qml_copy_${qml_dir} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
- COMMENT "Copying directory ${qml_dir}")
- endforeach(qml_dir)
-
- add_dependencies(qml_auto qml_copy_hmi_api)
-
- foreach(qml_file ${qml_files})
- add_custom_target(qml_copy_${qml_file} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
- COMMENT "Copying file ${qml_file}")
- endforeach(qml_file)
-endif()
-
-install(DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/controls
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
- ${CMAKE_CURRENT_BINARY_DIR}/models
- ${CMAKE_CURRENT_BINARY_DIR}/popups
- ${CMAKE_CURRENT_BINARY_DIR}/res
- ${CMAKE_CURRENT_BINARY_DIR}/views
- DESTINATION bin/hmi)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt5/MainWindow.qml b/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
deleted file mode 100644
index 59fed45707..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
+++ /dev/null
@@ -1,462 +0,0 @@
-/**
- * @file MainWindow.qml
- * @brief Implementation of main window.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import com.ford.sdl.hmi.named_pipe_notifier 1.0
-import "./controls"
-import "./views"
-import "./hmi_api" as HmiApi
-import "./models"
-import "./popups"
-import "hmi_api/Common.js" as Common
-import "./models/Constants.js" as Constants
-import "models/Internal.js" as Internal
-
-Rectangle {
- width: 1280
- height: 768
- property string startQml: "./views/ApplicationListView.qml"
- property int minWidth: Constants.mainScreenMinWidth
- property int minHeight: Constants.mainScreenMiHeight
- color: Constants.secondaryColor
-
- DataStorage {
- id: dataContainer
-
- onSystemContextChanged: {
- sdlUI.onSystemContext(systemContext, currentApplication.appId)
- }
-
- // Please note that applicationContext is changed only after setting currentApplication
- onApplicationContextChanged: {
- if (applicationContext) {
- sdlBasicCommunication.onAppActivated(currentApplication.appId)
- } else {
- sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
- }
- }
- }
-
- Audio {
- id: beep
- source: "res/initial.wav"
- }
-
- Audio {
- id: stream
-
- property real bufferProgress: 0.0
- }
-
- SettingsStorage {
- id: settingsContainer
- }
-
- Item {
- id: mainScreen
- anchors.top: parent. top
- anchors.left: parent.left
- width: (parent.width - simulationScreen.width < minWidth) ?
- minWidth : parent.width - simulationScreen.width
- height: (parent.height - hardwareScreen.height < minHeight) ?
- minHeight : parent.height - hardwareScreen.height
- clip: true
- visible: false
-
- Item {
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height * 0.10
- width: parent.width
- HeaderMenu {}
- }
-
- Item {
- height: parent.height * 0.90
- width: parent.width
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- Video {
- id: player
- anchors.fill: parent
- visible: {
- var naviString = new RegExp("SDLNavi\.qml")
- return naviString.test(contentLoader.source);
- }
-
- NamedPipeNotifier {
- id: notifier
- onReadyRead: {
- player.source = name
- player.play()
- }
- }
-
- Component.onCompleted: {
- notifier.start()
- }
- onStopped: {
- notifier.start()
-
- }
- function startStream(url) {
- notifier.name = url
- notifier.start()
- }
- }
-
- Loader {
- id: contentLoader
- height: parent.height - Constants.margin
- width: parent.width - 2 * Constants.margin
- asynchronous: true
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.leftMargin: Constants.margin
- anchors.rightMargin: Constants.margin
- anchors.bottomMargin: Constants.margin
-
-
- source:startQml
- property var viewTransitionStack : []
-
- function reset() {
- viewTransitionStack = []
- }
-
- property string currentLocation
- function go(path, appId) {
- console.debug("enter:", path, ", appId:", appId)
- if (path) {
- if (currentLocation !== path) {
- viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
- if (appId) {
- dataContainer.setCurrentApplication(appId)
- }
- item.leaveScreen()
- currentLocation = path
- source = path
- }
- }
- console.debug("exit")
- }
-
- function back() {
- if (viewTransitionStack.length) {
- item.leaveScreen()
- source = viewTransitionStack.pop().uri
- }
- currentLocation = ""
- }
-
- onStatusChanged: {
- if (status == Component.Ready) {
- if (!dataContainer.activeAlert) {
- dataContainer.applicationContext = item.applicationContext
- }
- else {
- dataContainer.applicationSavedContext = item.applicationContext
- }
- if (viewTransitionStack && viewTransitionStack.length) {
- viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
- }
- dataContainer.setSystemContext()
- }
- }
- }
- }
-
- WarningInfo { id: warningInfo }
-
- VRHelpPopup {
- id: vrHelpPopup
- popUpName: "UI.VrHelp"
- anchors.centerIn: parent
- visible: false
- }
-
- InteractionPopup {
- id: interactionPopup
- popUpName: "UI.PerformInteraction"
- anchors.centerIn: parent
- visible: false
- }
-
- SliderPopup {
- id: sliderPopup
- popUpName: "UI.Slider"
- anchors.centerIn: parent
- visible: false
- }
-
- PerformAudioPassThruPopup {
- id: performAudioPassThruPopup
- popUpName: "UI.PerformAudioPassThru"
- anchors.centerIn: parent
- visible: false
- }
-
- AlertWindow {
- id: alertWindow
- popUpName: "UI.Alert"
- objectName: "AlertWindow"
- anchors.fill: parent
- visible: false
- }
-
- UserActionPopUp {
- id: userActionPopUp
- popUpName: "ActionPopUp"
- objectName: "ActionPopUp"
- anchors.fill: parent
- visible: false
- }
-
- OnAppPermissionConsentPopUp {
- id: onAppPermissionConsentPopUp
- popUpName: "onAppPermissionConsent"
- objectName: "onAppPermissionConsent"
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: simulationScreen
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: mainScreen.right
- width: simulationPanel.width
- clip: true
- SimulationView {
- id: simulationPanel
-
- VRPopUp {
- id: vrPopUp
- visible: false
- anchors.fill: parent
- }
-
- TTSPopUp {
- id: ttsPopUp
- anchors.top: parent.top
- anchors.right: parent.right
- visible: false
- }
- }
- }
-
- Item {
- id: hardwareScreen
- anchors.top: mainScreen.bottom
- anchors.left: parent.left
- anchors.right: simulationScreen.left
- height: hardwarePanel.height
- clip: true
- HardwareButtonsView { id: hardwarePanel }
- }
-
- HMIAdapter {
- HmiApi.ButtonsProxy {
- id: sdlButtons
- objectName: "Buttons"
- }
- HmiApi.BasicCommunicationProxy {
- id: sdlBasicCommunication
- objectName: "BasicCommunication"
- }
- HmiApi.VRProxy {
- id: sdlVR
- objectName: "VR"
- }
- HmiApi.TTSProxy {
- id: sdlTTS
- objectName: "TTS"
- }
- HmiApi.NavigationProxy {
- id: sdlNavigation
- objectName: "Navigation"
- }
- HmiApi.VehicleInfoProxy {
- id: sdlVehicleInfo
- objectName: "VehicleInfo"
- }
- HmiApi.UIProxy {
- id: sdlUI
- objectName: "UI"
- }
-
- HmiApi.SDLProxy {
- id: sdlSDL
- objectName: "SDL"
- }
- }
-
- SDLAdapter {
- id: sdlProxy
-
- onOnResumeAudioSource: {
-
- }
-
- onOnFileRemoved: {
-
- }
-
- onOnAppRegistered: {
- console.debug("enter onAppRegistered")
- var appTypeToAdd = 0
- if (application.appType !== undefined) {
- for (var index in application.appType) {
- if (application.appType[index] > 31) {
- return { __retCode: Common.Result.GENERIC_ERROR, __message: "Apptype value > 31" }
- }
- appTypeToAdd |= 1 << application.appType[index]
- }
- }
-
- dataContainer.addApplication(
- {
- appName: application.appName,
- ngnMediaScreenAppName: application.ngnMediaScreenAppName,
- icon: application.icon,
- deviceName: application.deviceName,
- appId: application.appID,
- hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
- isMediaApplication: application.isMediaApplication,
- appType: appTypeToAdd,
- hmiUIText: { },
- mediaClock: {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "startTime": -1,
- "endTime": -1,
- "startTimeForProgress": -1
- }
- });
- console.debug("exit onAppRegistered")
- }
-
- onOnAppUnregistered: {
- console.debug("enter onAppUnregistered")
- if ((dataContainer.currentApplication.appId === appID)) {
- if (dataContainer.applicationContext) {
- contentLoader.go("views/ApplicationListView.qml");
- }
- if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
- contentLoader.reset();
- }
- dataContainer.currentApplication.reset()
- }
- dataContainer.removeApplication(appID);
- console.debug("exit onAppUnregistered")
- }
-
- onPlayTone: {
- beep.play()
- }
-
- onOnSDLClose: {
-
- }
-
- onOnPutFile: {
- console.log("OnPutFile: ", offset, length, fileSize, FileName,
- syncFileName, fileType, persistentFile);
- }
-
- onOnRecordStart: {
-
- }
-
- onOnAppPermissionChanged: {
-
- }
-
-
- onOnSDLConsentNeeded: {
-
- }
-
- onOnStatusUpdate: {
- console.log("enter onStatusUpdate")
- settingsContainer.updateStatus(status);
- }
- }
-
- Component.onCompleted: {
- dataContainer.hmiVRAvailable = true
- dataContainer.hmiTTSAvailable = true
- dataContainer.hmiNavigationAvailable = true
- dataContainer.hmiVehicleInfoAvailable = true
- dataContainer.hmiUIAvailable = true
-
- sdlBasicCommunication.onReady()
- }
-
- /*
- * Test Support Section
- *
- */
- function getSlider(){
- return sliderPopup
- }
-
- function getDataStorage(){
- return dataContainer
- }
-
- function getUIProxy(){
- return sdlUI
- }
-
- function getMainScreen(){
- return mainScreen
- }
-
- function getContentLoader(){
- return contentLoader
- }
-
- function getWarningInfo(){
- return warningInfo
- }
- /*
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
deleted file mode 100644
index 58cba17707..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @file ArrowKeys.qml
- * @brief Keys with arrow for cursor movement.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- width: buttonOk.width
- height: buttonOk.height
-
- HardwareButton {
- id: arrowUp
- buttonId: Common.ButtonName.TUNEUP
- name: "Up"
- }
- HardwareButton {
- id: arrowDown
- buttonId: Common.ButtonName.TUNEDOWN
- name: "Down"
- }
- HardwareButton {
- id: arrowLeft
- buttonId: Common.ButtonName.SEEKLEFT
- name: "Left"
- }
- HardwareButton {
- id: arrowRight
- buttonId: Common.ButtonName.SEEKRIGHT
- name: "Right"
- }
- HardwareButton {
- id: buttonOk
- buttonId: Common.ButtonName.OK
- name: "Ok"
- longPressAvailable: false
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
deleted file mode 100644
index 5d82f15592..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file BackButton.qml
- * @brief Button "Back" that return to previous menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-OvalButton {
- text: "Back"
- onClicked: { contentLoader.back() }
- fontSize: Constants.fontSize
- opacity: 0
-
- NumberAnimation on opacity {
- to: 1;
- duration: Constants.animationDuration
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
deleted file mode 100644
index f0755b3980..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file CircleButton.qml
- * @brief Parent class for circle button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Image {
- id: circleBtn
- source: imgOff
- property alias text: btnText.text
- property alias pixelSize: btnText.font.pixelSize
- property string dest: ""
- property bool isPressed: false
- property string imgOff: "../res/buttons/round_btn.png"
- property string imgOn: "../res/buttons/round_pressed_btn.png"
- property string textColorOnPressed: Constants.secondaryColor
- property string textColorDefault: Constants.primaryColor
-
- signal clicked()
- function wasClicked()
- {
- clicked()
- }
-
- Text {
- anchors.centerIn: parent
- id: btnText
- color: textColorDefault
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- console.log("CircleButton onPressed enter");
- source = imgOn
- btnText.color = textColorOnPressed
- isPressed = true
- console.log("CircleButton onPressed exit");
- }
- onReleased: {
- console.log("CircleButton onReleased enter");
- source = imgOff
- btnText.color = textColorDefault
- isPressed = false
- console.log("CircleButton onReleased exit");
- }
- onClicked: {
- console.log("CircleButton onClicked enter");
- if(dest !== ""){
- contentLoader.go(dest)
- }
- circleBtn.wasClicked()
- console.log("CircleButton onClicked enter");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
deleted file mode 100644
index dc1231570a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file ClickableImage.qml
- * @brief Clickable image item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Image {
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked()
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- parent.scale = Constants.pressedIconScale
- parent.pressed()
- }
-
- onReleased: {
- parent.scale = 1
- parent.released()
- }
-
- onCanceled: {
- parent.scale = 1
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
deleted file mode 100644
index c56e3dc13d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file ClickableText.qml
- * @brief Clickable text item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Text {
- property string defaultColor
- property string pressedColor
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked ()
-
- color: defaultColor
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- press()
- parent.pressed()
- }
-
- onReleased: {
- release()
- parent.released()
- }
-
- onCanceled: {
- release()
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-
- function press () {
- color = pressedColor
- }
-
- function release () {
- color = defaultColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
deleted file mode 100644
index 9211ac1baf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file ClimateControlBtn.qml
- * @brief Round button, which is used at climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item
-{
- id: climateControlBtn
- width: climateBtnImg.width
- height: climateBtnImg.height
- property string name: ""
- property string txt: ""
- state: "off"
-
- Image {
- id: climateBtnImg
- source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
-
- Image {
- id: hoverImg
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- property string st: climateControlBtn.state === "off" ? "_off" : "_on"
- source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
- }
-
- Text {
- id: hoverText
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: climateControlBtn.txt
- font.pixelSize: Constants.fontSize
- color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if(climateControlBtn.state === "on") {
- climateControlBtn.state = "off"
- climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.primaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
- }
- } else {
- climateControlBtn.state = "on"
- climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.secondaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
deleted file mode 100644
index 3695070dfd..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file GradientRectangle.qml
- * @brief Rectangle with gradient.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-Rectangle {
- property string firstColor: "grey"
- property string secondColor: "#2E2E2E"
- property alias fontSize: text.font.pixelSize
- property alias text: text.text
- property int customButtonID
- property bool isCustomButton: false
- property bool clickProcessed
- signal pressed()
- signal released()
-
- radius: 5
- border.color: "#D3D3D3"
-
- Text {
- id: text
- anchors.fill: parent
- font.pixelSize: Constants.titleFontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- firstColor = "#2E2E2E"
- secondColor = "grey"
- parent.pressed()
- }
- onReleased: {
- firstColor = "grey"
- secondColor = "#2E2E2E"
- parent.released()
- }
- }
-
- Timer {
- id: timer
- interval: Constants.customButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPressed: {
- if (isCustomButton) {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
- }
- }
-
- onReleased: {
- if (isCustomButton) {
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
- }
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if (isCustomButton) {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
- clickProcessed = true
- }
- }
- }
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.1
- color: firstColor
- }
- GradientStop {
- position: 0.5
- color: secondColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
deleted file mode 100644
index 39e1f0d7c4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file GridItem.qml
- * @brief Item with animation for GridMenu
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: item
- opacity: 0
- SequentialAnimation {
- id: animation
- PauseAnimation {duration: index * 100 }
- NumberAnimation {
- target: item
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
- Component.onCompleted: {
- animation.start()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
deleted file mode 100644
index 47f034082e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file HardwareButton.qml
- * @brief Parent class for hardware button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../hmi_api/Common.js" as Common
-
-MaskedContainer {
- property string name
- property int buttonId: Common.ButtonName.CUSTOM_BUTTON
- property bool upDownAvailable: true
- property bool shortPressAvailable: true
- property bool longPressAvailable: true
-
- signal hold
-
- Image {
- source: "../res/controlButtons/" + name + "Button.png"
- }
- Image {
- id: pressedImg
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- visible: false
- Behavior on opacity {
- NumberAnimation { duration: 80 }
- }
- }
- Timer {
- id: timer
- interval: 2000
- repeat: false
- triggeredOnStart: false
- }
- property bool clickProcessed
- onPressed: {
- clickProcessed = false
- pressedImg.visible = true
- timer.start()
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- }
-
- onReleased: {
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
- }
- timer.stop()
- if (!clickProcessed && shortPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
- }
- pressedImg.visible = false
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed && longPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- hold()
- }
- }
- }
-
- Component.onCompleted: {
- if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
- settingsContainer.buttonCapabilities.push(
- {
- name: buttonId,
- upDownAvailable: upDownAvailable,
- shortPressAvailable: shortPressAvailable,
- longPressAvailable: longPressAvailable
- });
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
deleted file mode 100644
index 26cfe9abe0..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * @file HeaderMenu.qml
- * @brief Header menu view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: headerMenu
- anchors.fill: parent
- Text {
- anchors.leftMargin: Constants.margin
- anchors.topMargin: Constants.margin
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: "75°"
- }
-
- Item {
- width: menuText.width
- height: parent.height
- anchors.topMargin: Constants.margin
- anchors.horizontalCenter: headerMenu.horizontalCenter
- signal clicked ()
-
- ClickableText {
- id: menuLogo
- anchors.horizontalCenter: menuText.horizontalCenter
- anchors.bottom: parent.verticalCenter
- text: "≡"
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuText.press()
- onReleased: menuText.release()
- onCanceled: menuText.release()
- }
-
- ClickableText {
- id: menuText
- anchors.top: parent.verticalCenter
- text: "MENU";
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuLogo.press()
- onReleased: menuLogo.release()
- onCanceled: menuLogo.release()
- }
-
- onClicked: {
- contentLoader.go("./views/MainMenuView.qml")
- }
- }
-
- Row {
- id: clock
- height: childrenRect.height
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: Constants.margin
- anchors.topMargin: Constants.margin
- property date date: new Date()
-
- Timer {
- running: true
- repeat: true
- interval: 1000
- onTriggered: {
- clock.date = new Date();
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "hh");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
-
- Item {
- width: 10
- height: parent.height
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: clock.date.getSeconds() % 2 ? ":" : ""
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "mm");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
deleted file mode 100644
index 2aa7019428..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Icon.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- property var source
-
- Image {
- anchors.fill: parent
- source: url(parent.source)
-
- function image(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
-
- function url(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
- }
-
- function reset () {
- source = undefined
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
deleted file mode 100644
index 6373237241..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file Entry.qml
- * @brief Entry with icon and text for list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: main
- color: Constants.transparentColor
-
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
-
- Icon {
- id: image
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- anchors.left: parent.left
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- height: image.height
- width: parent.width - image.width
- z: 50
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- text: "Name Entry"
- anchors.left: image.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenterOffset: 0
- visible: text !== ""
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
deleted file mode 100644
index a7f91dd397..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @file MaskedButton.qml
- * @brief Masked button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-
-MaskedContainer {
- property string name
-
- Image {
- id: icon
- source: "../res/controlButtons/" + name + "Button.png"
- }
-
- onPressed: {
- state = "pressed";
- }
-
- onReleased: {
- state = "";
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: icon
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
deleted file mode 100644
index 32626d292d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-MultiPointTouchArea {
- property date created
-
- minimumTouchPoints: 1
- maximumTouchPoints: 10
-
- MouseArea {
- anchors.fill: parent
-
- function mouseTouchEvent() {
- var now = new Date()
- var touchEvents = [
- {
- id: 0,
- ts: [now.valueOf() - created.valueOf()],
- c: [{x: mouseX, y: mouseY}]
- }
- ]
- return touchEvents
- }
-
- onPressed: {
- sdlUI.onTouchEvent(Common.TouchType.BEGIN, mouseTouchEvent())
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
- }
- onPositionChanged: {
- sdlUI.onTouchEvent(Common.TouchType.MOVE, mouseTouchEvent())
- }
- }
-
- function touchEvents() {
- var now = new Date()
- var touchEvents = []
- for (var i = 0; i < touchPoints.length; ++i) {
- touchEvents.push(
- {
-// pointId is guaranteed to be unique but is not guaranteed to fit in range
-// perhaps we will have to edit protocol xml
- id: touchPoints[i].pointId,
- ts: [now.valueOf() - created.valueOf()],
- c: [{x: touchPoints[i].x, y: touchPoints[i].y}]
- }
- )
- }
- return touchEvents
- }
-
- onPressed: {
- sdlUI.onTouchEvent(Common.TouchType.BEGIN, touchEvents())
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
- }
- onUpdated: {
- sdlUI.onTouchEvent(Common.TouchType.MOVE, touchEvents())
- }
- Component.onCompleted: {
- created = new Date()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
deleted file mode 100644
index 6d68a9096b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * @file OvalButton.qml
- * @brief Oval button with flexible width.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtGraphicalEffects 1.0
-import "../models/Constants.js" as Constants
-
-// Don't change constants. It break button
-// TODO (dchmerev@luxoft.com): make this comment more clear
-// todo (ykazakov): eliminate this problem and remove all such comments
-
-Item {
- id: main
- width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
- height: Constants.ovalButtonHeight
-
- signal clicked;
- signal pressed;
- signal released;
- signal pressAndHold;
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
- property bool highlighted: false
- property bool dynamic: false
- property bool disabled: false
-
- function hue() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonHue;
- } else if (highlighted) {
- ret = Constants.highlightedButtonHue;
- }
- return ret;
- }
-
- function saturation() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonSaturation;
- } else if (highlighted) {
- ret = Constants.highlightedButtonSaturation;
- }
- return ret;
- }
-
- function lightness() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonLightness;
- } else if (highlighted) {
- ret = Constants.highlightedButtonLightness;
- }
- return ret;
- }
-
- Item {
- id: buttonBorderImage
- visible: false
- anchors.fill: parent
- Image {
- id: left
- width: 31
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.top: parent.top
- source: "../res/buttons/oval_btn_left.png"
- }
-
- Image {
- id: right
- width: 31
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- source: "../res/buttons/oval_btn_right.png"
- }
-
- Image {
- id: top
- height: 10
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.top: parent.top
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_top.png"
- }
-
- Image {
- id: bottom
- height: 11
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.bottom: parent.bottom
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_bottom.png"
- }
- }
-
- HueSaturation {
- anchors.fill: buttonBorderImage
- source: buttonBorderImage
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- }
-
- Rectangle {
- id: background
- color: Constants.transparentColor
- anchors.fill: parent
- anchors.rightMargin: 31
- anchors.leftMargin: 31
- anchors.bottomMargin: 10
- anchors.topMargin: 10
- visible: false
- }
-
- HueSaturation {
- anchors.fill: background
- source: background
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- }
-
- MouseArea {
- id: mousearea
- anchors.rightMargin: 15
- anchors.leftMargin: 15
- anchors.bottomMargin: 11
- anchors.topMargin: 10
- anchors.fill: parent
- enabled: !parent.disabled
- onPressed: {
- parent.state = "pressed";
- parent.pressed();
- }
- onReleased: {
- parent.state = "";
- parent.released();
- }
- onClicked: {
- parent.clicked();
- }
- onPressAndHold: {
- parent.pressAndHold();
- }
- onCanceled: {
- parent.state = "";
- }
- }
-
- Item {
- id: field
- anchors.fill: background
-
- Icon {
- id: image
- width: Constants.iconButtonSize
- height: Constants.iconButtonSize
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- width: image.visible ? parent.width - image.width : parent.width
- color: Constants.primaryColor
- anchors.centerIn: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: Constants.ovalButtonFontSize
- visible: false
- elide: Text.ElideRight
- }
- HueSaturation {
- anchors.fill: label
- source: label
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- visible: label.text !== ""
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: left
- source: "../res/buttons/oval_btn_pressed_left.png"
- }
-
- PropertyChanges {
- target: right
- source: "../res/buttons/oval_btn_pressed_right.png"
- }
-
- PropertyChanges {
- target: background
- color: Constants.primaryColor
- }
-
- PropertyChanges {
- target: label
- color: Constants.secondaryColor
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
deleted file mode 100644
index 5b150d560d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file PagedFlickable.qml
- * @brief Animated row.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Item
-{
- id: flickablePage
- height: container.height + pager.height
- default property alias content: containerRow.children
- property alias spacing: containerRow.spacing
- property int elementWidth
- property int snapTo
- property int count: 0
-
- Flickable {
- id: container
- anchors.bottom: parent.bottom
- maximumFlickVelocity: 1500
- contentWidth: containerRow.width
- height: containerRow.height
- width: parent.width
- interactive: contentWidth > width
-
- onMovementEnded: {
- var rest = contentX % snapTo
- var t = 0.25
- if (rest > parent.snapTo / 2) {
- rest = rest - parent.snapTo
- }
- var vel = 2 * rest / t
- flickDeceleration = Math.abs(vel) / t
- flick(vel, 0)
- flickDeceleration = 1500
- }
- Row {
- id: containerRow
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Pager {
- id: pager
- space: 7
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-
- pages: {
- if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentWidth / container.width)
- }
- else {
- return Math.floor(container.contentWidth / container.width)
- }
- }
-
- activePage: {
- if (container.contentX <= 0) {
- return 0
- }
- else if ( (container.contentWidth - container.contentX) < container.width) {
- return pages -1
- }
- else {
- if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentX / container.width)
- }
- else if ( (container.contentX % container.width) > 0) {
- return Math.floor(container.contentX / container.width)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
deleted file mode 100644
index 53d99436ce..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file Pager.qml
- * @brief Bubbles that indicate about page switch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Row {
- id: pager
- property int pages
- property int activePage: 0
- property int space
- property int itemsInRowOnScreen: 3
-
- spacing: space
- visible: pages !== 1
-
- Repeater {
- model: pages
- Image {
- source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
deleted file mode 100644
index bb1cb38388..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file PlayPauseButton.qml
- * @brief Behavior of Play/Pause button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Image {
- id: playPauseButton
- property string sourceOnPressed: ""
- property string sourceOnReleased: ""
-
- signal clicked
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- playPauseButton.source = playPauseButton.sourceOnPressed
- }
- onReleased: {
- playPauseButton.source = playPauseButton.sourceOnReleased
- }
- onClicked: {
- playPauseButton.clicked()
- }
- }
- states: [
- State {
- name: "Play"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_play_btn.png"
- sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_pause_btn.png"
- }
- },
-
- State {
- name: "Pause"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_pause_btn.png"
- sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_play_btn.png"
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
deleted file mode 100644
index 95a751c39b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file PowerSwitchBtn.qml
- * @brief On/Off button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: powerSwitchBtn
- state: "Turn ON"
- width: 120
- height: 80
- radius: 5
- property bool pressed;
-
- gradient: Gradient {
- GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
- GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.pressed = true
- }
- onReleased: {
- parent.pressed = false
- parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
- btnText.text = parent.state
- if (parent.state === "Turn OFF") {
- contentLoader.reset()
- mainScreen.visible = true
- warningInfo.showOkButton()
- }
- }
- }
-
- Text {
- id: btnText
- color: "red"
- text: parent.state
- anchors.centerIn: parent
- font.pixelSize: Constants.powerButtonFornSize
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
deleted file mode 100644
index 32e74d71bb..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @file PresetRow.qml
- * @brief Animated row with radio stations.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: presetRow
- height: childrenRect.height
- property variant presets: []
- property int selectedIndex: 0
- signal presetSelected
- signal presetButtonPressed()
- signal presetButtonReleased()
- signal presetButtonClicked()
- signal presetButtonHold()
-
- Image {
- id: circleButton
- source: "../res/buttons/preset_pressed_btn.png"
- visible: false
- enabled: false
- }
-
- PagedFlickable {
- width: parent.width
- spacing: (width - (circleButton.width * 4)) / 3
- snapTo: spacing + circleButton.width
- elementWidth: circleButton.width
-
- Repeater {
- model: presetRow.presets.length
- delegate:
- Column {
- width: circleButton.width
- Image {
- anchors.horizontalCenter: parent.horizontalCenter
- source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- presetRow.selectedIndex = index;
- presetButtonPressed()
- }
- onReleased: {
- presetRow.selectedIndex = index;
- presetButtonReleased()
- }
- onClicked: {
- presetRow.selectedIndex = index
- presetButtonClicked()
- }
- onPressAndHold: {
- presetRow.selectedIndex = index;
- presetButtonHold()
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: index + 1
- font.pixelSize: Constants.fontSize
- color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: presetRow.presets[index]
- font.pixelSize: Constants.fontSize
- color: "white"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
deleted file mode 100644
index f83370a207..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * @file PushButton.qml
- * @brief Simple button
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Rectangle {
- id: toggleButton
- width: 160
- height: 40
- radius: 2
- border.width: 2
- border.color: "#000000"
- gradient: grUnpressed
-
- property alias label : label.text
-
- signal pressed()
- signal unpressed()
- signal clicked()
-
- property bool toggleMode: false
-
- state: "unpressed"
- onStateChanged: {
- if (state == "pressed") {
- pressed();
- } else {
- unpressed();
- }
- }
-
- Text {
- id: label
- color: "white"
- text: "PushButton"
- font.pixelSize: 18
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.fill: parent
- }
- MouseArea {
- id: mouseArea
-
- anchors.fill: parent
- onPressed: {
- if (toggleMode) {
- if (parent.state == "unpressed") {
- parent.state = "pressed"
- } else {
- parent.state = "unpressed"
- }
- } else {
- parent.state = "pressed"
- }
- }
- onReleased: {
- if (!toggleMode) {
- parent.state = "unpressed"
- if (mouse.isClick) {
- parent.clicked()
- }
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: toggleButton
- gradient: grPressed
- }
- },
- State {
- name: "unpressed"
- PropertyChanges {
- target: toggleButton
- gradient: grUnpressed
- }
- }
- ]
-
- Gradient {
- id: grUnpressed
-
- GradientStop { position: 0.0; color: "#2c2c2c" }
- GradientStop { position: 1.0; color: "#0c0c0c" }
- }
-
- Gradient {
- id: grPressed
-
- GradientStop { position: 0.0; color: "black" }
- GradientStop { position: 1.0; color: "black" }
- }
-
- transitions: [
- Transition {
- from: "unpressed"
- to: "pressed"
- reversible: true
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
deleted file mode 100644
index a63960d16d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @file ScrollableListView.qml
- * @brief ListView with scrollbar on the right
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-ListView {
- clip: true
-
- Rectangle {
- visible: parent.height < parent.contentHeight
- anchors.right: parent.right
- y: parent.visibleArea.yPosition * parent.height
- width: Constants.scrollBarWidth
- height: parent.visibleArea.heightRatio * parent.height
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
deleted file mode 100644
index 227f638366..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file SoftButton.js
- * @brief Soft button view constants
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-var Action = {
- doOnClicked: 0,
- doOnReleased: 1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
deleted file mode 100644
index b1b7f71799..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * @file SoftButton.qml
- * @brief Soft button view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "SoftButton.js" as SoftButton
-
-OvalButton {
- property var button
- property int appId
- visible: !!button
-
- signal defaultAction;
- signal stealFocus;
- signal keepContext;
-
- property int actionOrder: SoftButton.Action.doOnClicked
-
- highlighted: button ? button.isHighlighted : false
- onPressed: {
- actionOrder = SoftButton.Action.doOnClicked
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID, appId)
- }
-
- onReleased: {
- if (actionOrder === SoftButton.Action.doOnReleased) {
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID, appId)
- }
-
- onClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID, appId);
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- onPressAndHold: {
- actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID, appId);
- }
-
- onButtonChanged: {
- icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
- text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
deleted file mode 100644
index c06ebc45e4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file StatusBar.qml
- * @brief Status bar that contains text string.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Text {
- text: dataContainer.currentApplication.hmiUIText.statusBar
- color: Constants.primaryColor
- font.pixelSize: Constants.statusBarFontSize
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
deleted file mode 100644
index ebc5bfa3ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var async_uid = 1;
-
-function AsyncCall() {
- this.__async_uid = async_uid++;
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
deleted file mode 100644
index ba066e628b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * @file BasicCommunication.qml
- * @brief Implement of interface Basic Communication.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- function updateDeviceList (deviceList) {
- var deviceListLog = "";
- deviceList.forEach(function (device) {
- deviceListLog += "{name: '" + device.name + "', " +
- "id: '" + device.id + "'},";
- });
- console.log("Message Received - {method: 'BasicCommunication.UpdateDeviceList', params:{ " +
- "deviceList: [" + deviceListLog + "]" +
- "}}")
-
- deviceList.forEach(function (device) {
- var exist = false;
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- exist = device.id === dataContainer.deviceList[i].devid;
- }
- if (!exist) {
- dataContainer.deviceList.append({ name: device.name,
- devid: device.id,
- allowed: false})
- }
- });
-
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- deviceList.forEach(function (device) {
- var exist = dataContainer.deviceList[i].id === device.id;
- if (!exist) {
- dataContainer.deviceList.remove(i);
- }
- });
- }
- }
-
- function updateAppList (applications) {
- var applicationsLog = "",
- appTypeLog = "";
- if (applications) {
- for (var i = 0; i < applications.length; i++) {
- appTypeLog = "";
-
- for (var j = 0; j < applications[i].appType.length; i++) {
- appTypeLog += "'" + applications[i].appType + "', "
- }
-
- applicationsLog += "{name: '" + applications[i].name + "', " +
- "appName: '" + applications[i].appName + "', " +
- "ngnMediaScreenAppName: '" + applications[i].ngnMediaScreenAppName + "', " +
- "icon: '" + applications[i].icon + "', " +
- "deviceName: '" + applications[i].deviceName + "', " +
- "appID: " + applications[i].appID + ", " +
- "hmiDisplayLanguageDesired: '" + applications[i].hmiDisplayLanguageDesired + "', " +
- "isMediaApplication: " + applications[i].isMediaApplication + ", " +
- "appType: [" + applications[i].deviceName + "]" +
- "},";
- }
- }
- console.log("Message Received - {method: 'BasicCommunication.UpdateAppList', params:{ " +
- "applications: [" + applicationsLog + "]" +
- "}}")
-
-
- dataContainer.applicationList.clear();
- for(var i = 0; i < applications.length; i++) {
- dataContainer.applicationList.append({
- appName: applications[i].appName,
- ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
- icon: applications[i].icon,
- deviceName: applications[i].deviceName,
- appId: applications[i].appID,
- hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
- isMediaApplication: applications[i].isMediaApplication,
- appType: applications[i].appType
- });
- }
- }
-
- function getResumeResult (appID) {
- return dataContainer.getResumeResult(appID)
- }
-
- function allowDeviceToConnect (device) {
- console.log("Message Received - {method: 'BasicCommunication.AllowDeviceToConnect', params:{ " +
- "device: {name: '" + device.name + "', " +
- "id: '" + device.id + "'}," +
- "}}")
- return {
- allow: true
- }
- }
-
- function mixingAudioSupported() {
- console.log("Message Received - {method: 'BasicCommunication.MixingAudioSupported'}")
- return {
- attenuatedSupport: true
- }
- }
-
- function allowAllApps() {
- console.log("Message Received - {method: 'BasicCommunication.AllowAllApps'}")
- return {
- allowed: true
- }
- }
-
- function allowApp(app, appPermissions) {
- console.log("Message Received - {method: 'BasicCommunication.AllowApp'}")
- return {
- allowed: true
- }
- }
-
- function activateApp(appID, priority, level) {
- console.log("Message Received - {method: 'BasicCommunication.ActivateApp', params:{ " +
- "appID: " + appID +
- "}}")
- contentLoader.go("views/SDLPlayerView.qml", appID);
- }
-
- function policyUpdate(file, timeout, retry) {
- console.log("enter policyUpdate");
- settingsContainer.filePTSnapshot = file;
- settingsContainer.timeoutPTExchange = timeout;
- settingsContainer.retriesPTExchange = retry;
- var service = 7; // service type for Ford specific policy
- RequestToSDL.SDL_GetURLS(service, settingsContainer.startPTExchange);
- console.log("exit policyUpdate");
- }
-
- function systemRequest(requestType, fileName, appID) {
- console.log("enter systemRequest", requestType, fileName, appID);
-
- console.log(requestType, Common.RequestType.PROPRIETARY, Common.RequestType.HTTP);
-
- switch (requestType) {
- case Common.RequestType.PROPRIETARY: {
- settingsContainer.stopPTExchange(fileName);
- break;
- }
- case Common.RequestType.HTTP: {
- if (fileName === "IVSU") {
- settingsContainer.updateIVSU(appID);
- } else {
- settingsContainer.decrypt(fileName, appID);
- }
- break;
- }
- }
- console.log("exit systemRequest");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
deleted file mode 100644
index b8b3da5932..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file Buttons.qml
- * @brief Implement of interface Buttons.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-Item
-{
- function getCapabilities() {
- console.log("Message Received - {method: 'Buttons.GetCapabilities'}")
- return {
- capabilities: settingsContainer.buttonCapabilities,
- presetBankCapabilities: {
- onScreenPresetsAvailable: true
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
deleted file mode 100644
index bab54220b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-
-Item {
- function isReady () {
- console.log("Message Received - {method: 'Navigation.IsReady'}")
- return {
- available: dataContainer.hmiNavigationAvailable
- }
- }
-
- function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
- distanceToManeuverScale, maneuverComplete,
- softButtons, appID) {
- console.debug("enter")
- var navigationTextsLog = "",
- softButtonsLog = "",
- turnIconLogs = "",
- nextTurnIconLogs = "";
- if (navigationTexts) {
- for (var i = 0; i < navigationTexts.length; i++) {
- navigationTextsLog += "{fieldName: '" + navigationTexts[i].fieldName + "', " +
- "fieldText: '" + navigationTexts[i].fieldText + "'},";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (turnIcon) {
- turnIconLogs = "{value: '" + turnIcon.value + "', imageType: " + turnIcon.imageType + "}";
- }
- if (nextTurnIcon) {
- nextTurnIconLogs = "{value: '" + nextTurnIcon.value + "', imageType: " + nextTurnIcon.imageType + "}";
- }
- console.log("Message Received - {method: 'Navigation.ShowConstantTBT', params:{ " +
- "navigationTexts: [" + navigationTextsLog + "], " +
- "turnIcon: " + turnIconLogs + ", " +
- "nextTurnIcon: " + nextTurnIconLogs + ", " +
- "distanceToManeuver: " + distanceToManeuver + ", " +
- "distanceToManeuverScale: " + distanceToManeuverScale + ", " +
- "maneuverComplete: " + maneuverComplete + ", " +
- "softButtons: [" + softButtonsLog + "], " +
- "appID: " + appID +
- "}}")
-
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- navigationTexts.forEach(fillTexts, dataToUpdate)
- if (turnIcon !== undefined) { dataToUpdate.turnIcon = turnIcon }
- if (nextTurnIcon !== undefined) { dataToUpdate.nextTurnIcon = nextTurnIcon }
- if (distanceToManeuver !== undefined) {
- dataToUpdate.distanceToManeuver = distanceToManeuver
- } else {
- DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuver absence"} )
- }
- if (distanceToManeuverScale !== undefined) {
- dataToUpdate.distanceToManeuverScale = distanceToManeuverScale
- } else {
- DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuverScale absence"} )
- }
- if (maneuverComplete !== undefined) {
- dataToUpdate.maneuverComplete = maneuverComplete
- }
- if (softButtons !== undefined) {
- app.navigationSoftButtons.clear()
- softButtons.forEach(function(x) { app.navigationSoftButtons.append(x); });
- }
- if (appID !== undefined) {
- dataToUpdate.appID = appID
- } else {
- dBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "appID absence"} )
- }
-
- dataContainer.setApplicationProperties(appID, { navigationModel : dataToUpdate } )
- contentLoader.go("./views/TurnByTurnView.qml", appID)
- }
-
- function alertManeuver(softButtons) {
- console.debug("enter")
- var softButtonsLog = "";
-
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- console.log("Message Received - {method: 'Navigation.AlertManeuver', params:{ " +
- "softButtons: [" + softButtonsLog + "]" +
- "}}")
-
- console.debug("exit")
- return { __retCode: Common.Result.SUCCESS }
- }
-
- function updateTurnList(turnList, softButtons, appID) {
- console.debug("enter")
- var turnListLog = "",
- softButtonsLog = "";
- if (turnList) {
- for (var i = 0; i < turnList.length; i++) {
- turnList[i].navigationText ? turnListLog += "{navigationText: {fieldName: '" + turnList[i].navigationText.fieldName + "', fieldText: '" + turnList[i].navigationText.fieldText + "'}," : turnListLog += "{";
- turnList[i].turnIcon ? turnListLog += "turnIcon: " + "{value: '" + turnList[i].turnIcon.value + "', imageType: " + turnList[i].turnIcon.imageType + "}}, " : turnListLog += "},";
- }
- }
- if (softButtons) {
- softButtonsLog += "{type: '" + softButtons[0].type + "', " +
- "text: '" + softButtons[0].text + "', ";
- softButtons[0].image ? softButtonsLog += "image: " + "{value: '" + softButtons[0].image.value + "', imageType: " + softButtons[0].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[0].isHighlighted + "', " +
- "softButtonID: " + softButtons[0].softButtonID + "', " +
- "systemAction: " + softButtons[0].systemAction +
- "},";
- }
- console.log("Message Received - {method: 'Navigation.UpdateTurnList', params:{ " +
- "softButtons: [" + softButtonsLog + "], " +
- "turnList: [" + turnListLog + "], " +
- "appID: " + appID +
- "}}")
- if (turnList !== undefined) {
- dataContainer.getApplication(appID).turnList.clear();
- turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
- }
- if (softButtons !== undefined) {
- dataContainer.getApplication(appID).turnListSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
- }
- dataContainer.navigationModel.appId = appID;
- console.debug("exit")
- }
-
- function fillTexts(element, index, array) {
- switch (element.fieldName) {
- case Common.TextFieldName.navigationText1:
- this.text1 = element.fieldText;
- break;
- case Common.TextFieldName.navigationText2:
- this.text2 = element.fieldText;
- break;
- case Common.TextFieldName.ETA:
- this.eta = element.fieldText;
- break;
- case Common.TextFieldName.totalDistance:
- this.totalDistance = element.fieldText;
- break;
- case Common.TextFieldName.timeToDestination:
- this.timeToDestination = element.fieldText;
- break;
- }
- }
-
- function startStream(url, appID) {
- console.debug("enter")
- player.startStream(url)
- console.debug("exit")
- }
-
- function stopStream(appID) {
- console.debug("enter")
- player.stop()
- console.debug("exit")
- }
-
- function startAudioStream(url, appID) {
- console.log("Message Received - {method: 'Navigation.StartAudioStream', params:{ " +
- "url: '" + url + "'" +
- "appID: " + appID +
- "}}")
- stream.source = url;
- stream.play();
- }
-
- function stopAudioStream(appID) {
- console.log("Message Received - {method: 'Navigation.StopAudioStream', params:{ " +
- "appID: " + appID +
- "}}")
- stream.stop();
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- buttonId: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
- function fillTurnList(element, index, array) {
- this.append({
- navigationText: element.navigationText,
- turnIcon: element.turnIcon
- });
- console.debug(element.navigationText)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
deleted file mode 100644
index c16e1d7750..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
deleted file mode 100644
index 7884b31097..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
- function ttsChunksToString(ttsChunks){
- return ttsChunks.map(function(str) { return str.text }).join('\n')
- }
-
- function isReady() {
- console.log("Message Received - {method: 'TTS.IsReady'}")
- return {
- available: dataContainer.hmiTTSAvailable
- }
- }
-
- function speak(ttsChunks, appID) {
- // appID unused
- console.debug('enter:', ttsChunks, appID);
- var ttsChunksLog = "";
- if (ttsChunks) {
- for (var i = 0; i < ttsChunks.length; i++) {
- ttsChunksLog += "{type: " + ttsChunks[i].type + ", " +
- "text: '" + ttsChunks[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.Speak', params:{ " +
- "ttsChunks: [" + ttsChunksLog + "], " +
- "appID: " + appID + "', " +
- "}}")
- if (ttsPopUp.async) {
- console.log('speak send abort');
- throw Common.Result.ABORTED;
- }
- var message = ttsChunksToString(ttsChunks);
- ttsPopUp.activate(message);
- ttsPopUp.async = new Async.AsyncCall();
- console.debug('exit');
- return ttsPopUp.async;
- }
-
- function stopSpeaking() {
- console.debug("enter");
- console.log("Message Received - {method: 'TTS.StopSpeaking'}")
- ttsPopUp.deactivate();
- console.debug("exit");
- }
-
- function getLanguage() {
- console.log("Message Received - {method: 'TTS.GetLanguage'}")
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- console.log("Message Received - {method: 'TTS.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'TTS.GetCapabilities'}")
- return {
- speechCapabilities: [
- Common.SpeechCapabilities.SC_TEXT,
- Common.SpeechCapabilities.PRE_RECORDED
- ],
- prerecordedSpeechCapabilities: [
- Common.PrerecordedSpeech.HELP_JINGLE,
- Common.PrerecordedSpeech.INITIAL_JINGLE,
- Common.PrerecordedSpeech.LISTEN_JINGLE,
- Common.PrerecordedSpeech.POSITIVE_JINGLE,
- Common.PrerecordedSpeech.NEGATIVE_JINGLE
- ]
- }
- }
-
- function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
- console.debug("enter");
- var helpttsChunksLog = "",
- initialttsChunkLog = "",
- timeoutttsChunkLog = "";
-
- if (helpPrompt) {
- for (var i = 0; i < helpPrompt.length; i++) {
- helpttsChunksLog += "{type: " + helpPrompt[i].type + ", " +
- "text: '" + helpPrompt[i].text + "'}, ";
- }
- }
- if (initialPrompt) {
- for (var i = 0; i < initialPrompt.length; i++) {
- initialttsChunkLog += "{type: " + initialPrompt[i].type + ", " +
- "text: '" + initialPrompt[i].text + "'}, ";
- }
- }
- if (timeoutPrompt) {
- for (var i = 0; i < timeoutPrompt.length; i++) {
- timeoutttsChunkLog += "{type: " + timeoutPrompt[i].type + ", " +
- "text: '" + timeoutPrompt[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.PerformInteraction', params:{ " +
- "helpPrompt: [" + helpttsChunksLog + "], " +
- "initialPrompt: [" + initialttsChunkLog + "], " +
- "timeoutPrompt: [" + timeoutttsChunkLog + "], " +
- "timeout: " + timeout +
- "}}")
- ttsPopUp.performInteraction(ttsChunksToString(helpPrompt),
- ttsChunksToString(initialPrompt),
- ttsChunksToString(timeoutPrompt),
- timeout)
- console.debug("exit");
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- console.log("Message Received - {method: 'TTS.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-
- function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
- var helpPromptLog = "",
- timeoutPromptLog = "";
- if (helpPrompt) {
- for (var i = 0; i < helpPrompt.length; i++) {
- helpPromptLog += "{type: " + helpPrompt[i].type + ", " +
- "text: '" + helpPrompt[i].text + "'}, ";
- }
- }
- if (timeoutPrompt) {
- for (var i = 0; i < timeoutPrompt.length; i++) {
- timeoutPromptLog += "{type: " + timeoutPrompt[i].type + ", " +
- "text: '" + timeoutPrompt[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.SetGlobalProperties', params:{ " +
- "appID:" + appID + ", " +
- "helpPrompt: [" + helpPromptLog + "], " +
- "timeoutPrompt: [" + timeoutPromptLog + "]" +
- "}}")
-
- var newHelpPropmt = helpPrompt ?
- helpPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.helpPrompt
-
- var newTimeoutPrompt = timeoutPrompt ?
- timeoutPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.timeoutPrompt
-
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- helpPrompt: newHelpPropmt,
- timeoutPrompt: newTimeoutPrompt
- })
- console.debug("exit")
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
deleted file mode 100644
index 659b7842c6..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
+++ /dev/null
@@ -1,730 +0,0 @@
-/**
- * @file UI.qml
- * @brief UI interface implementation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-import "../models/Internal.js" as Internal
-
-Item {
- function filter (strings, fields) {
- console.debug("enter")
-// substrings for each allowed field
- var fieldSubstrings = {}
-// this cycle concatenates allowed lines sorting them by field
- for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
- for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
- var fieldName = strings[stringIndex].fieldName
- if (fieldName === fields[fieldIndex]) {
- if (fieldSubstrings[fieldName] !== undefined) {
- fieldSubstrings[fieldName] += "\n";
- fieldSubstrings[fieldName] += strings[stringIndex].fieldText
- }
- else {
- fieldSubstrings[fieldName] = strings[stringIndex].fieldText
- }
- }
- }
- }
- console.debug("exit")
- return fieldSubstrings
- }
-
- function alert (alertStrings, duration, softButtons, progressIndicator, alertType, appID) {
- var softButtonsLog = "",
- alertStringsLog = "";
- if (alertStrings) {
- for (var i = 0; i < alertStrings.length; i++) {
- alertStringsLog += "{fieldName: '" + alertStrings[i].fieldName + "', " +
- "fieldText: '" + alertStrings[i].fieldText + "'},";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- console.log("Message Received - {method: 'UI.Alert', params:{ " +
- "alertStrings: [" + alertStringsLog + "]," +
- "duration: " + duration + "', " +
- "softButtons: [" + softButtonsLog + "]," +
- "progressIndicator: " + progressIndicator + "', " +
- "appID: " + appID + "', " +
- "}}")
- var fieldSubstrings = alertStrings
- .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
- .map(function(val) { return val.fieldText }); // mapping to array of strings
-
- var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, softButtons, progressIndicator, alertType, appID)
- if (tryAgainTime === undefined) {
- alertWindow.async = new Async.AsyncCall();
- return alertWindow.async;
- }
- else {
- return {
- "__retCode": Common.Result.REJECTED,
- "tryAgainTime": tryAgainTime
- }
- }
- }
-
- function show (showStrings, alignment, graphic, secondaryGraphic, softButtons, customPresets, appID) {
- var softButtonsLog = "",
- showStringsLog = "",
- customPresetsLog = "",
- graphiLog = "",
- secondaryGraphicLog = "";
- if (showStrings) {
- for (var i = 0; i < showStrings.length; i++) {
- showStringsLog += "{fieldName: '" + showStrings[i].fieldName + "', " +
- "fieldText: '" + showStrings[i].fieldText + "'},";
- }
- }
- if (customPresets) {
- for (var i = 0; i < customPresets.length; i++) {
- customPresetsLog += "'" + customPresets[i] + "', ";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (graphic) {
- graphiLog = "{value: '" + graphic.value + "', imageType: " + graphic.imageType + "}";
- }
- if (secondaryGraphic) {
- secondaryGraphicLog = "{value: '" + secondaryGraphic.value + "', imageType: " + secondaryGraphic.imageType + "}";
- }
-
- console.log("Message Received - {method: 'UI.Show', params:{ " +
- "showStrings: [" + showStringsLog + "], " +
- "alignment: " + alignment + "', " +
- "graphic: " + graphiLog + ", " +
- "secondaryGraphic: " + secondaryGraphicLog+ ", " +
- "softButtons: [" + softButtonsLog + "], " +
- "customPresets: [" + customPresetsLog + "], " +
- "appID: " + appID +
- "}}")
- var app = dataContainer.getApplication(appID);
-
- app.softButtons.clear()
- if (softButtons) {
- softButtons.forEach(function(x) { app.softButtons.append(x); });
- }
-
- app.customPresets.clear()
- if (customPresets) {
- customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
- }
-
- var textAlignment
- switch (alignment) {
- case Common.TextAlignment.LEFT_ALIGNED:
- textAlignment = Text.AlignLeft
- break;
- case Common.TextAlignment.RIGHT_ALIGNED:
- textAlignment = Text.AlignRight
- break;
- case Common.TextAlignment.CENTERED:
- textAlignment = Text.AlignHCenter
- break;
- default:
- textAlignment = Text.AlignHCenter
- break;
- }
-
- // with this array we grab only the lines we need
- var showFields = [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack
- ]
- var fieldSubstrings = filter(showStrings, showFields)
- var showData = { hmiUIText: {} }
- if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
- if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
- if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
- if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
- if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
- if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
- if (graphic) { showData.hmiUIText.image = graphic.value; }
- if (secondaryGraphic) { showData.hmiUIText.secondaryImage = secondaryGraphic.value; }
- if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
- if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
- showData.mediaClock = {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
- "startTime": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
- "startTimeForProgress": -1
- }
- }
-
- dataContainer.setApplicationProperties(appID, showData);
- console.debug("exit")
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- var cmdIconLogs = "",
- menuParamsLogs = "";
-
- if (cmdIcon) {
- cmdIconLogs = "{value: '" + cmdIcon.value + "', imageType: " + cmdIcon.imageType + "}";
- }
- if (menuParams) {
- menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
- }
- console.log("Message Received - {method: 'UI.AddCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID + ", " +
- "cmdIcon: " + cmdIconLogs + ", " +
- "menuParams: " + menuParamsLogs +
- "}}")
- dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
- }
-
- function deleteCommand (cmdID, appID) {
- console.log("Message Received - {method: 'UI.DeleteCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID +
- "}}")
- dataContainer.deleteCommand(cmdID, appID)
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- var menuParamsLogs = "";
-
- if (menuParams) {
- menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
- }
- console.log("Message Received - {method: 'UI.AddSubMenu', params:{ " +
- "appID: " + appID + ", " +
- "menuID: " + menuID + ", " +
- "menuParams: " + menuParamsLogs +
- "}}")
- dataContainer.addSubMenu(menuID, menuParams, appID)
- }
-
- function deleteSubMenu (menuID, appID) {
- console.log("Message Received - {method: 'UI.DeleteSubMenu', params:{ " +
- "appID:" + appID + ", " +
- "menuID: " + menuID +
- "}}")
- dataContainer.deleteSubMenu(menuID, appID)
- }
-
- function performInteraction (initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
- console.debug("enter")
- var choiseLog = "",
- vrHelpLog = "",
- initialTextLog = "";
- if (choiceSet) {
- for (var i = 0; i < choiceSet.length; i++) {
- choiseLog += "{choiceID: " + choiceSet[i].choiceID + ", " +
- "menuName: '" + choiceSet[i].menuName + "', " +
- "image: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}, " +
- "secondaryText: '" + choiceSet[i].secondaryText + "', " +
- "tertiaryText: '" + choiceSet[i].tertiaryText + "', " +
- "secondaryImage: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}},";
- }
- }
- if (vrHelp) {
- for (var i = 0; i < vrHelp.length; i++) {
- var vrHelpImageLog = "";
- if (vrHelp[i].image) {
- vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
- }
-
- vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
- "image: " + vrHelpImageLog + ", " +
- "position: " + vrHelp[i].position +
- "},";
- }
- }
- if (initialText) {
- initialTextLog = "{fieldName: " + initialText.fieldName + ", fieldText: '" + initialText.fieldText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.PerformInteraction', params:{ " +
- "appID:" + appID + ", " +
- "initialText: " + initialTextLog + ", " +
- "choiceSet: [" + choiseLog + "], " +
- "vrHelpTitle: '" + vrHelpTitle + "', " +
- "vrHelp: [" + vrHelpLog + "], " +
- "timeout: " + timeout + ", " +
- "interactionLayout: " + interactionLayout +
- "}}")
- var async = interactionPopup.performInteraction(initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID)
- console.debug("exit")
- return async
- }
-
- function setMediaClockTimer (startTime, endTime, updateMode, appID) {
- var startTimeLog = "",
- endTimeLog = "";
- if (startTime) {
- startTimeLog = "hours: " + startTime.hours + ", minutes: " + startTime.minutes + ", seconds: " + startTime.seconds;
- }
- if (endTime) {
- endTimeLog = "hours: " + endTime.hours + ", minutes: " + endTime.minutes + ", seconds: " + endTime.seconds;
- }
-
- console.log("Message Received - {method: 'UI.SetMediaClockTimer', params:{ " +
- "startTime: {" + startTimeLog + "}, " +
- "endTime: {" + endTimeLog + "}, " +
- "updateMode: " + updateMode + ", " +
- "appID: " + appID +
- "}}")
- var app = dataContainer.getApplication(appID)
- var newStartTime
- var newEndTime
- var newUpdateMode
- var newRunningMode
- var newStartTimeForProgress
- var resultCode
- var sendErrorResponce = false
-
- switch (updateMode) {
- case Common.ClockUpdateMode.COUNTUP:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours,
- endTime.minutes,
- endTime.seconds)
- : dataContainer.currentApplication.mediaClock.upperTimeLimit
-
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.COUNTDOWN:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : 0
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.PAUSE:
- // Already paused or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = app.mediaClock.startTimeForProgress
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.RESUME:
- // Already resumed or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
- || (app.mediaClock.startTime === app.mediaClock.endTime)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = app.mediaClock.startTimeForProgress
- newUpdateMode = app.mediaClock.updateMode
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.CLEAR:
- newStartTime = -1
- newEndTime = -1
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = -1
- resultCode = Common.Result.SUCCESS
- break
- }
-
- if (sendErrorResponce) {
- console.debug("exit with result code: ", resultCode)
- return { __retCode: resultCode }
- }
-
- dataContainer.setApplicationProperties(appID, {
- "mediaClock": {
- "updateMode": newUpdateMode,
- "runningMode": newRunningMode,
- "startTime": newStartTime,
- "endTime": newEndTime,
- "startTimeForProgress": newStartTimeForProgress
- }
- })
-
- console.debug("exit")
- return { __retCode: resultCode }
- }
-
- function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
- console.debug("enter")
- var vrHelpLog = "",
- menuIconLog = "",
- keyboardPropertiesLog = "";
- if (vrHelp) {
- for (var i = 0; i < vrHelp.length; i++) {
- var vrHelpImageLog = "";
- if (vrHelp[i].image) {
- vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
- }
- vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
- "image: " + vrHelpImageLog + ", " +
- "position: " + vrHelp[i].position +
- "},";
- }
- }
- if (menuIcon) {
- menuIconLog = "{value: '" + menuIcon.value + "', imageType: " + menuIcon.imageType + "}";
- }
- if (keyboardProperties) {
- keyboardPropertiesLog = "{language: '" + keyboardProperties.language + "', keyboardLayout: '" + keyboardProperties.language +
- "', sendDynamicEntry: '" + keyboardProperties.sendDynamicEntry + "', keypressMode: '" + keyboardProperties.keypressMode +
- "', limitedCharacterList: '" + keyboardProperties.limitedCharacterList + "', autoCompleteText: '" + keyboardProperties.autoCompleteText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.SetGlobalProperties', params:{ " +
- "appID:" + appID + ", " +
- "vrHelpTitle: '" + vrHelpTitle + "', " +
- "vrHelp: [" + vrHelpLog + "], " +
- "menuTitle: '" + menuTitle + "', " +
- "menuIcon: " + menuIconLog + ", " +
- "keyboardProperties: " + keyboardPropertiesLog +
- "}}")
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- if (vrHelpTitle !== undefined) {
- dataToUpdate.vrHelpTitle = vrHelpTitle
- } else if ( (vrHelp !== undefined) && (vrHelp.length >= 1) ) {
- return { __retCode: Common.Result.REJECTED, __message: "vrHelpTitle - undefined, vrHelpItem - provided" }
- }
-
- if (vrHelp !== undefined) {
- var checkSequentialPosition = vrHelp[0].position
- for (var index = 0; index < vrHelp.length; index++) {
- if (vrHelp[index].position !== checkSequentialPosition) {
- return { __retCode: Common.Result.REJECTED, __message: "Nonsequential positions of VrHelpItems" }
- }
- checkSequentialPosition++
- }
-
- if (app.vrHelpItems.count !== 0) {
- app.vrHelpItems.clear()
- }
- vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItems )
- } else {
- if (vrHelpTitle !== undefined) {
- return { __retCode: Common.Result.REJECTED, __message: "vrHelpItems - undefined, vrHelpTitle - provided" }
- }
- }
- if (menuTitle !== undefined) {
- dataToUpdate.menuTitle = menuTitle
- }
- if (menuIcon !== undefined) {
- dataToUpdate.menuIcon = menuIcon
- }
- dataContainer.setApplicationProperties(appID, dataToUpdate)
- console.debug("exit")
- }
-
- function isReady () {
- console.log("Message Received - {method: 'UI.IsReady'}")
- return {
- available: dataContainer.hmiUIAvailable
- }
- }
-
- function getLanguage () {
- console.log("Message Received - {method: 'UI.GetLanguage'}")
- return {
- language: dataContainer.hmiUILanguage
- }
- }
-
- function getSupportedLanguages () {
- console.log("Message Received - {method: 'UI.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function changeRegistration (language, appID) {
- console.log("Message Received - {method: 'UI.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.changeRegistrationUI(language, appID)
- }
-
- function setAppIcon (syncFileName, appID) {
- var syncFileNameLog = "";
- if (syncFileName) {
- syncFileNameLog = "{value: '" + syncFileName.value + "', imageType: " + syncFileName.imageType + "}";
- }
-
- console.log("Message Received - {method: 'UI.SetAppIcon', params:{ " +
- "syncFileName: " + syncFileNameLog + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
- }
-
- function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
- console.log("Message Received - {method: 'UI.Slider', params:{ " +
- "numTicks: " + numTicks + "', " +
- "position: " + position + "', " +
- "sliderHeader: '" + sliderHeader + "', " +
- "sliderFooter: [" + sliderFooter + "], " +
- "timeout: " + timeout + ", " +
- "appID: " + appID +
- "}}")
- if (dataContainer.uiSlider.running) {
- console.debug("aborted")
- return {__retCode: Common.Result.ABORTED, sliderPosition: position}
- }
-
- dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiSlider.header = sliderHeader
- dataContainer.uiSlider.footer = sliderFooter
- dataContainer.uiSlider.numTicks = numTicks
- dataContainer.uiSlider.position = position
- dataContainer.uiSlider.timeout = timeout
-
- if (timeout !== 0) {
- sliderPopup.showSlider()
- sliderPopup.async = new Async.AsyncCall();
- console.debug("exit")
- return sliderPopup.async;
- } else {
- console.debug("exit")
- return { sliderPosition: position }
- }
- }
-
- function scrollableMessage (messageText, timeout, softButtons, appID) {
- var softButtonsLog = "",
- messageTextLog = "";
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (messageText) {
- messageTextLog = "{fieldName: " + messageText.fieldName + ", fieldText: '" + messageText.fieldText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.ScrollableMessage', params:{ " +
- "messageText: " + messageTextLog + ", " +
- "timeout: " + timeout + "', " +
- "softButtons: [" + softButtonsLog + "]," +
- "appID: " + appID + "', " +
- "}}")
- // TODO{ALeshin}: Also check HMILevel, when it will be available. It should be FULL otherwise - REJECTED
- if (contentLoader.item.systemContext !== Common.SystemContext.SYSCTXT_MAIN) {
- return { __retCode: Common.Result.REJECTED, __message: "System Context isn't MAIN" }
- }
- if(dataContainer.scrollableMessageModel.running){
- //send error response if scrollable message already running
- return { __retCode: Common.Result.ABORTED, __message: "ScrollableMessage already running" }
- }
-
- dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
- if (timeout === 0) {
- return { __retCode: Common.Result.SUCCESS, __message: "Timeout = 0" }
- } else {
- dataContainer.scrollableMessageModel.timeout = timeout
- }
-
- dataContainer.scrollableMessageModel.softButtons.clear();
- if (softButtons !== undefined) {
- softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
- }
- dataContainer.scrollableMessageModel.appId = appID
- dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
- contentLoader.go("./views/ScrollableMessageView.qml")
- console.debug("exit")
- return dataContainer.scrollableMessageModel.async
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'UI.GetCapabilities'}")
- return {
- "audioPassThruCapabilities": {
- "samplingRate": Common.SamplingRate.RATE_44KHZ,
- "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
- "audioType": Common.AudioType.PCM
- },
- "displayCapabilities": settingsContainer.displayCapabilities,
- "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
- "softButtonCapabilities": settingsContainer.softButtonCapabilities
- }
- }
-
- function performAudioPassThru (appID, audioPassThruDisplayTexts, timeout) {
- var displayTextsLog = "";
- if (audioPassThruDisplayTexts) {
- for (var i = 0; i < audioPassThruDisplayTexts.length; i++) {
- displayTextsLog += "{fieldName: '" + audioPassThruDisplayTexts[i].fieldName + "', " +
- "fieldText: " + audioPassThruDisplayTexts[i].fieldText + "'},";
- }
- }
- console.log("Message Received - {method: 'UI.PerformAudioPassThru', params:{ " +
- "audioPassThruDisplayTexts: [" + displayTextsLog + "], " +
- "maxDuration: " + timeout +
- "}}")
-
- if (dataContainer.uiAudioPassThru.running) {
- console.debug("aborted")
- throw Common.Result.ABORTED
- }
-
- dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiAudioPassThru.timeout = timeout
- if (audioPassThruDisplayTexts.length === 2) {
- dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
- dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
- }
- performAudioPassThruPopup.async = new Async.AsyncCall();
- performAudioPassThruPopup.showAudioPassThru()
- console.debug("exit")
- return performAudioPassThruPopup.async;
- }
-
- function endAudioPassThru () {
- console.debug("enter")
- console.log("Message Received - {method: 'UI.EndAudioPassThru'}")
-
- if (!dataContainer.uiAudioPassThru.running) {
- console.debug("rejected")
- throw Common.Result.REJECTED
- }
- DBus.sendReply({__retCode: Common.Result.SUCCESS})
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- console.debug("exit")
- }
-
- function closePopUp (methodName) {
- console.debug("enter")
- console.log("Message Received - {method: 'UI.ClosePopUp', params:{ " +
- "methodName: " + methodName +
- "}}")
- var popUpToClose
-
- if (dataContainer.activePopup.length === 0) {
- return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
- }
-
- if (methodName !== undefined) {
- popUpToClose = methodName
- } else {
- popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
- }
-
- switch (popUpToClose) {
- case "UI.PerformInteraction":
- interactionPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Slider":
- sliderPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.PerformAudioPassThru":
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Alert":
- alertWindow.complete(Common.Result.SUCCESS)
- break
- case "UI.VrHelp":
- vrHelpPopup.complete(Common.Result.SUCCESS)
- break
- }
- console.debug("exit")
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- softButtonID: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
deleted file mode 100644
index 8158b3271e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * @file VR.qml
- * @brief Implement of interface VR.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-Item {
- function isReady() {
- console.log("Message Received - {method: 'VR.IsReady'}")
- return {
- available: dataContainer.hmiVRAvailable
- }
- }
-
- function addCommand(cmdID, vrCommands, type, grammarID, appID) {
- var vrCommandsLog = "";
- if (vrCommands) {
- for (var i = 0; i < vrCommands.length; i++) {
- vrCommandsLog += "'" + vrCommands[i] + "', ";
- }
- }
- console.log("Message Received - {method: 'VR.AddCommand', params:{ " +
- "vrCommands: [" + vrCommandsLog + "], " +
- "cmdID: " + cmdID + ", " +
- "appID: " + appID + ", " +
- "type: " + type + ", " +
- "grammarID: " + grammarID +
- "}}")
- for (var i = 0; i < vrCommands.length; ++i) {
- if (type === Common.VRCommandType.Command) {
- dataContainer.vrCommands.append({
- cmdID: cmdID,
- command: vrCommands[i],
- appID: appID === undefined ? 0 : appID,
- type: type,
- grammarID: grammarID,
- });
- }
- else {
- dataContainer.choicesVrCommands.append({
- cmdID: cmdID,
- command: vrCommands[i],
- appID: appID === undefined ? 0 : appID,
- type: type,
- grammarID: grammarID,
- });
- }
- }
- console.log("exit")
- }
-
- function deleteCommand(cmdID, appID) {
- console.log("Message Received - {method: 'VR.DeleteCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID +
- "}}")
- for (var i = 0; i < dataContainer.vrCommands.count; ) {
- if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
- ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
- dataContainer.vrCommands.remove(i);
- continue;
- }
- ++i;
- }
- console.log("exit")
- }
-
- function getLanguage() {
- console.log("Message Received - {method: 'VR.GetLanguage'}")
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- console.log("Message Received - {method: 'VR.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'UI.GetCapabilities'}")
- return {
- vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter");
- console.log("Message Received - {method: 'VR.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
- function ttsChunksToString(ttsChunks){
- return ttsChunks.map(function(str) { return str.text }).join('\n')
- }
- function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout, grammarID) {
- console.debug("enter");
- var helpttsChunksLog = "",
- initialttsChunkLog = "",
- timeoutttsChunkLog = "",
- grammarIDLog ="";
-
- if (helpPrompt) {
- for (var i = 0; i < helpPrompt.length; i++) {
- helpttsChunksLog += "{type: " + helpPrompt[i].type + ", " +
- "text: '" + helpPrompt[i].text + "'}, ";
- }
- }
- if (initialPrompt) {
- for (var i = 0; i < initialPrompt.length; i++) {
- initialttsChunkLog += "{type: " + initialPrompt[i].type + ", " +
- "text: '" + initialPrompt[i].text + "'}, ";
- }
- }
- if (timeoutPrompt) {
- for (var i = 0; i < timeoutPrompt.length; i++) {
- timeoutttsChunkLog += "{type: " + timeoutPrompt[i].type + ", " +
- "text: '" + timeoutPrompt[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.PerformInteraction', params:{ " +
- "helpPrompt: [" + helpttsChunksLog + "], " +
- "initialPrompt: [" + initialttsChunkLog + "], " +
- "timeoutPrompt: [" + timeoutttsChunkLog + "], " +
- "timeout: " + timeout +
- "}}")
-
- ttsPopUp.performInteraction(ttsChunksToString(helpPrompt),
- ttsChunksToString(initialPrompt),
- ttsChunksToString(timeoutPrompt),
- timeout)
- interactionPopup.grammarID = grammarID
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
deleted file mode 100644
index e564860517..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
+++ /dev/null
@@ -1,764 +0,0 @@
-/**
- * @file VehicleInfo.qml
- * @brief Vehicle information interface realisation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-
-Item {
- function isReady () {
- console.log("Message Received - {method: 'VehicleInfo.IsReady'}")
- return {
- available: dataContainer.hmiVehicleInfoAvailable
- }
- }
-
- function getVehicleType() {
- console.log("Message Received - {method: 'VehicleInfo.GetVehicleType'}")
- return {
- "vehicleType": {
- "make": "Ford",
- "model": "Fiesta",
- "modelYear": "2013",
- "trim": "SE"
- }
- }
- }
-
- function getGpsData(appID) {
- console.debug("enter")
- console.debug("exit")
- return { gps: dataContainer.vehicleInfoModel.gps }
- }
-
- function getSpeed(appID) {
- console.debug("enter")
- console.debug("exit")
- return { speed: dataContainer.vehicleInfoModel.speed }
- }
-
- function getRpm(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- rpm: dataContainer.vehicleInfoModel.rpm,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getFuelLevel(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
- }
-
- function getFuelLevelState(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
- }
-
- function getInstantFuelConsumption(appID) {
- console.debug("enter")
- console.debug("exit")
- return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
- }
-
- function getExternalTemperature(appID) {
- console.debug("enter")
- console.debug("exit")
- return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
- }
-
- function getVin(appID) {
- console.debug("enter")
- console.debug("exit")
- return { vin: dataContainer.vehicleInfoModel.vin }
- }
-
- function getPrndl(appID) {
- console.debug("enter")
- if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
- console.debug("exit")
- return {
- prndl: dataContainer.vehicleInfoModel.prndl,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
- console.debug("exit")
- return { prndl: dataContainer.vehicleInfoModel.prndl }
- }
-
- function getTirePressure(appID) {
- console.debug("enter")
- console.debug("exit")
- return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
- }
-
- function getOdometer(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- odometer: dataContainer.vehicleInfoModel.odometer,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getBeltStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
- }
-
- function getBodyInformation(appID) {
- console.debug("enter")
- console.debug("exit")
- return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
- }
-
- function getDeviceStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
- }
-
- function getDriverBraking(appID) {
- console.debug("enter")
- console.debug("exit")
- return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
- }
-
- function getWiperStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
- }
-
- function getHeadLampStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
- }
-
- function getEngineTorque(appID) {
- console.debug("enter")
- console.debug("exit")
- return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
- }
-
- function getAccPedalPosition(appID) {
- console.debug("enter")
- console.debug("exit")
- return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
- }
-
- function getSteeringWheelAngle(appID) {
- console.debug("enter")
- console.debug("exit")
- return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
- }
-
- function getECallInfo(appID) {
- console.debug("enter")
- console.debug("exit")
- return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
- }
-
- function getAirbagStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
- }
-
- function getEmergencyEvent(appID) {
- console.debug("enter")
- console.debug("exit")
- return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
- }
-
- function getClusterModeStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
- }
-
- function getMyKey(appID) {
- console.debug("enter")
- console.debug("exit")
- return { myKey: dataContainer.vehicleInfoModel.myKey }
- }
-
- function getDTCs(ecuName, dtcMask, appID) {
- console.log("Message Received - {method: 'VehicleInfo.GetDTCs', params:{ " +
- "ecuName: " + ecuName + ", " +
- "dtcMask: " + dtcMask + ", " +
- "appID: " + appID +
- "}}")
- var ecuHeader = 2
- var dtc = []
-
- for (var i = 0; i < 3; i++) {
- dtc.push("line" + i)
- }
- return {ecuHeader: ecuHeader, dtc: dtc}
- }
-
- function readDID(ecuName, didLocation, appID) {
- console.debug("Enter")
- console.log("Message Received - {method: 'VehicleInfo.ReadDID', params:{ " +
- "ecuName: " + ecuName + ", " +
- "didLocation: " + didLocation + ", " +
- "appID: " + appID +
- "}}")
- //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
- var didResult = []
-
- for (var i = 0; i < didLocation.length; i++) {
- if (i < 10) {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- else {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- }
- console.debug("Exit")
- return {didResult: didResult}
- }
-
- function subscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- model.onGpsChanged.connect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
- }
- function unsubscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
-
- }
-
- function subscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- model.onSpeedChanged.connect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- model.onRpmChanged.connect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- model.onPrndlChanged.connect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- model.onVinChanged.connect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- model.onTirePressureChanged.connect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- model.onOdometerChanged.connect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- model.onECallInfoChanged.connect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- model.onMyKeyChanged.connect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/log4cxx.properties b/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
deleted file mode 100644
index 0bc5ac8fdf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-# Socket logger
-log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
-log4j.appender.SocketHub.port=4555
-log4j.appender.SocketHub.locationInfo=true
-
-# Only ERROR and FATAL messages are logged to console
-log4j.appender.Console=org.apache.log4j.ConsoleAppender
-log4j.appender.Console.ImmediateFlush=true
-log4j.appender.Console.layout=org.apache.log4j.PatternLayout
-log4j.appender.Console.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %m%n
-log4j.appender.Console.Threshold=ERROR
-
-# Log for all DBus plugin messages
-log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
-log4j.appender.DBusPluginLogFile.append=false
-log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.DBusPluginLogFile.ImmediateFlush=true
-log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all HMI Framework plugin
-log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
-log4j.appender.HmiFrameworkPluginLogFile.append=false
-log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
-log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all Qt HMI
-log4j.rootLogger=ALL, Console
-
-# Log for DBus plugin QtHMI
-log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
-
-# Log for HMI Framework plugin
-log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
-
-# Log by log4cxx plugin
-log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
deleted file mode 100644
index ec40819040..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file ApplicationData.qml
- * @brief Model for Application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-QtObject {
- property string mainField1
- property string mainField2
- property string mainField3
- property string mainField4
- property string statusBar
- property string mediaTrack
- property string image: ""
- property string secondaryImage: ""
-
- function reset () {
- console.debug("enter")
- mainField1 = ""
- mainField2 = ""
- mainField3 = ""
- mainField4 = ""
- statusBar = ""
- mediaTrack = ""
- image = ""
- secondaryImage = ""
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
deleted file mode 100644
index 5181e04a5b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file ApplicationModel.qml
- * @brief Own fields for each application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-
-QtObject {
- property int appId
- property string appName
- property string ngnMediaScreenAppName
- property Icon appIcon: Icon { }
- property string deviceName
- property int hmiDisplayLanguageDesired
- property bool isMediaApplication
- property int appType
- property int hmiUITextAlignment
- property string vrHelpTitle
- property string vrHelpTitleDefault: "VR HELP"
- property string vrHelpTitlePerformInteraction
- property string menuTitle
- property Icon menuIcon: Icon { }
-
- // media player
- property string playPauseState
- property ApplicationData hmiUIText: ApplicationData { }
- property MediaClockModel mediaClock: MediaClockModel { }
- property NavigationModel navigationModel: NavigationModel { }
-
- property string helpPrompt
- property string timeoutPrompt
- property ListModel vrHelpItems: ListModel { }
- property ListModel vrHelpItemsDefault: VrHelpItemsDefault { }
- property ListModel vrHelpItemsPerformInteraction: ListModel { }
- property ListModel options: ListModel { }
- property ListModel currentSubMenu: options
- property ListModel turnList
- property ListModel softButtons
- property ListModel turnListSoftButtons
- property ListModel navigationSoftButtons
- property ListModel alertManeuverSoftButtons
- property ListModel customPresets
- property int languageTTSVR
- property var allowedFunctions: []
- // This place is for adding new properties
-
- function reset () {
- console.debug("enter")
- appId = -1
- appName = ""
- ngnMediaScreenAppName = ""
- appIcon.reset()
- deviceName = ""
- hmiDisplayLanguageDesired = -1
- isMediaApplication = false
- playPauseState = ""
- hmiUIText.reset()
-// no need to reset mediaClock
- helpPrompt = ""
- timeoutPrompt = ""
- options.clear()
- currentSubMenu = options
- turnList.clear()
- softButtons.clear()
- navigationSoftButtons.clear()
- alertManeuverSoftButtons.clear()
- turnListSoftButtons.clear()
- customPresets.clear()
- languageTTSVR = -1
- hmiUITextAlignment = -1
- appType = 0
- allowedFunctions = []
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
deleted file mode 100644
index c715ae091f..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CarMenuModel.qml
- * @brief Car menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "ambient"
- icon: "../res/vehicle/Ambient Lighti Icon.png"
- qml: ""
- }
- ListElement {
- name: "cal"
- icon: "../res/vehicle/cal.png"
- qml: ""
- }
- ListElement {
- name: "ev"
- icon: "../res/vehicle/EV Icon.png"
- qml: ""
- }
- ListElement {
- name: "folders"
- icon: "../res/vehicle/folders.png"
- qml: ""
- }
- ListElement {
- name: "key"
- icon: "../res/vehicle/key_car.png"
- qml: ""
- }
- ListElement {
- name: "mcs"
- icon: "../res/vehicle/MCS Icon.png"
- qml: ""
- }
- ListElement {
- name: "sun"
- icon: "../res/vehicle/sun.png"
- qml: ""
- }
- ListElement {
- name: "sync"
- icon: "../res/vehicle/SYNC Services.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Constants.js b/src/components/qt_hmi/qml_model_qt5/models/Constants.js
deleted file mode 100644
index 0b4a3191d7..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/Constants.js
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file Constants.js
- * @brief Namespace of constants.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-// Colors
-
-// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
-var primaryColor = "#1d81d5"
-
-// Color of pressed buttons, text, icons etc.
-var primaryColorPressed = "#8ec0ea"
-
-// Secondary color of HMI model, backgroud of this color.
-var secondaryColor = "black"
-
-// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColor = "grey"
-
-// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColorPressed = "lightgrey"
-
-// Color of text at contact list screen view (Name, number and number type).
-var contactTextColor = "lightblue"
-
-// Color of text at buttons, when they are pressed.
-var pressedButtonTextColor = "black"
-
-// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
-var releasedButtonTextColor = "white"
-
-// Transparent background.
-var transparentColor = "#00000000"
-
-// "Warning" word color
-var warningColor = "red"
-
-// Color for PopUp
-var popUpBorderColor = "white"
-
-// Color for hardware and simulation panels
-var panelColor = "#003"
-
-// Color for text in hardware and simulation panels
-var panelTextColor = "white"
-
-// Audio pass thru PopUp text color
-var audioPassThruTextColor = "white"
-
-// Semi transparent color of item in SDL Navi menu
-var sdlNaviTransparentItemColor = "#30C0C0C0"
-
-//--------------------------------------------------------------------------------------
-
-// Font sizes of different elements
-
-// Font size for most of text in HMI model.
-var fontSize = 20
-
-// Font size for text inside oval buttons.
-var ovalButtonFontSize = 15
-
-// Title font size
-var titleFontSize = 35
-
-// Power on/off button font size
-var powerButtonFornSize = 25
-
-// Font size of status bar
-var statusBarFontSize = 15
-
-// Size icon for buttons
-var iconButtonSize = 30
-
-// Size icon for item list
-var iconItemListSize = 40
-
-// font size fo TTS popup
-var ttsFontSize = 12
-
-// Font size for list of applications
-var appListFontSize = 40
-
-// Size of contact list fields
-var contactListNameFieldSize = 0.4
-var contactListPhoneFieldSize = 0.3
-var contactListDescriptionFieldSize = 0.3
-
-//--------------------------------------------------------------------------------------
-
-// Sizes of buttons, menus, screen, etc
-
-// Minimal width and height of screen (screen wont resize, if height and width are lower).
-var mainScreenMinWidth = 800
-var mainScreenMiHeight = 600
-
-// Width for long oval button
-var ovalButtonWidth = 163
-
-// Height for oval button
-var ovalButtonHeight = 65
-
-// Height item list
-var itemListHeight = 60
-
-// Width for TTS popup
-var ttsPopUpWidth = 250
-
-// Height for TTS popup
-var ttsPopUpHeight = 100
-
-// Width for popup view
-var popupWidth = 700
-
-// Width for alert window
-var alertWidth = 360
-
-// Height for popup view
-var popupHeigth = 500
-
-// Width for combobox
-var defaultComboboxWidth = 150
-
-// Size icon for list of applications
-var appListIconSize = 100
-
-// DistanceBar height
-var distanceBarHeight = 1
-
-
-//---------------------------------------------------------------------------------------
-
-// Other
-
-// Offset from the edges of the screen.
-var margin = 20
-
-// Offset from the edges of the popup
-var popupMargin = 15
-
-// Spacing between items in SDLNavi view
-var sdlNaviSpacing = 5
-
-// Spacing between contacts at contact screen view.
-var contactListSpacing = 30
-
-// Duration of appearance of icon/button at icon/button menus.
-var animationDuration = 500
-
-// Duration of appearence of "OK" button at warning screen view, when HMI starts.
-var warningScreenDuration = 1000
-
-// Timer to check how long preset button is pressed.
-var presetButtonTimer = 800
-
-// Timer to check got long custom button is pressed.
-var customButtonTimer = 2000
-
-// Spacing between icon and item in list
-var iconItemListSpacing = 20
-
-// Spacing between item on views
-var generalSpacing = 10
-
-// Width of scrollBar
-var scrollBarWidth = 5
-
-// Speak text for a given time
-var ttsSpeakTime = 2000
-
-// Maximal number of submenus
-var maximumSubmenus = 1000
-
-// Maximal number of commands in submenu or root menu
-var maximumCommandsPerSubmenu = 1000
-
-// padding for popup view
-var popUpPadding = 20
-
-// Padding for TTS popup
-var ttsPopUpPadding = 10
-
-// -------------------------
-var sliderBarWidth = 400
-var sliderBarHeight = 50
-var sliderBarRadius = 3
-var sliderBarBorderWidth = 1
-var sliderTextColor = "white"
-var sliderBarBorderColor = "white"
-var sliderBarFillColor = "white"
-
-// -------------------------
-var scrollableMessageTextColor = "white"
-var scrollableMessageScrollBarColor = "gray"
-var scrollableMessageScrollBarWidth = 10
-
-// Padding for hardware and simulation panels
-var panelPadding = 20
-
-// Scale for pressed icon in menu
-var pressedIconScale = 1.1
-
-// Values of color effect for highlighted button
-var highlightedButtonHue = 0.9
-var highlightedButtonSaturation = 0.0
-var highlightedButtonLightness = 0.1
-
-// Values of color effect for disabled button
-var disabledButtonHue = 0.0
-var disabledButtonSaturation = -1.0
-var disabledButtonLightness = 0.1
-
-// Count of rows for grid menu
-var menuRowCount = 2
-
-// Count of columns for grid menu
-var menuColumnCount = 3
-
-// Position for element that came without position value (should be always at the end)
-var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
deleted file mode 100644
index 7e9326e9d8..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file ContactsListModel.qml
- * @brief List of contacts.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
- // when it will be filled dynamically.
- ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
- ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
- ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
- ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
- ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
- ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
- ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
- ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
- ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
- ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
- ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
- ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
- ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
- ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
- ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
- ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
- ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
- ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
- ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
- ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
- ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
- ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
- ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
- ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
- ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
- ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
- ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
- ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
- ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
-// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
- ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
- ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
- ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
- ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
-// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
- ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
- ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
- ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
- ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
- ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
- ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
- ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
- ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
- ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
- ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
- ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
- ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
- ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
- ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
- ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
- ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
- ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
deleted file mode 100644
index e3785bdf19..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
+++ /dev/null
@@ -1,660 +0,0 @@
-/**
- * @file DataStorage.qml
- * @brief Container for data.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "Internal.js" as Internal
-import "Constants.js" as Constants
-
-QtObject {
- property string contactsFirstLetter // first letter of contact's name that need to find at contact list
- property ApplicationModel currentApplication: ApplicationModel { }
- property SliderModel uiSlider: SliderModel { }
- property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
- property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
-
- function getApplication(appId) {
- console.log("enter");
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- console.log("Application found", applicationList.get(i));
- return applicationList.get(i);
- }
- }
- console.log("exit");
- }
-
- function getStashedApplication(appId) {
- console.log("enter getStashedApplication function");
- for(var i = 0; i < stashedApplicationsList.count; i++) {
- if(stashedApplicationsList.get(i).appId === appId) {
- console.log("Application found", stashedApplicationsList.get(i));
- return stashedApplicationsList.get(i);
- }
- }
- console.log("exit getStashedApplication: application was not found");
- }
-
- onApplicationListChanged: {
- console.log("onApplicationListChanged()");
- setCurrentApplication(appId);
- }
-
- function setCurrentApplication(appId) {
- console.log("Enter setCurrentApplication function");
- var oldApplicationContext = applicationContext;
- if (currentApplication.appId !== appId) {
- applicationContext = false;
- }
-
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- currentApplication.appId = appId
- var application = applicationList.get(i)
-
- currentApplication.appName = application.appName
- currentApplication.appType = application.appType
- currentApplication.appIcon.source = application.icon
- currentApplication.playPauseState = application.playPauseState
- currentApplication.options = application.options
- currentApplication.softButtons = application.softButtons
- currentApplication.navigationSoftButtons = application.navigationSoftButtons
- currentApplication.alertManeuverSoftButtons = application.alertManeuverSoftButtons
- currentApplication.customPresets = application.customPresets
-
- if (application.navigationModel.text1 !== undefined) {
- currentApplication.navigationModel.text1 = application.navigationModel.text1
- }
- if (application.navigationModel.text2 !== undefined) {
- currentApplication.navigationModel.text2 = application.navigationModel.text2
- }
- if (application.navigationModel.totalDistance !== undefined) {
- currentApplication.navigationModel.totalDistance = application.navigationModel.totalDistance
- }
- if (application.navigationModel.eta !== undefined) {
- currentApplication.navigationModel.eta = application.navigationModel.eta
- }
- if (application.navigationModel.timeToDestination !== undefined) {
- currentApplication.navigationModel.timeToDestination = application.navigationModel.timeToDestination
- }
- if (application.navigationModel.turnIcon !== undefined) {
- currentApplication.navigationModel.turnIcon = application.navigationModel.turnIcon
- }
- if (application.navigationModel.nextTurnIcon !== undefined) {
- currentApplication.navigationModel.nextTurnIcon = application.navigationModel.nextTurnIcon
- }
- if (application.navigationModel.distanceToManeuver !== undefined) {
- currentApplication.navigationModel.distanceToManeuver = application.navigationModel.distanceToManeuver
- }
- if (application.navigationModel.distanceToManeuverScale !== undefined) {
- currentApplication.navigationModel.distanceToManeuverScale = application.navigationModel.distanceToManeuverScale
- }
- if (application.navigationModel.maneuverComplete !== undefined) {
- currentApplication.navigationModel.maneuverComplete = application.navigationModel.maneuverComplete
- }
- if (application.navigationModel.appID !== undefined) {
- currentApplication.navigationModel.appID = application.navigationModel.appID
- }
- if (application.hmiUIText.mainField1 !== undefined) {
- currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
- }
- if (application.hmiUIText.mainField2 !== undefined) {
- currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
- }
- if (application.hmiUIText.mainField3 !== undefined) {
- currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
- }
- if (application.hmiUIText.mainField4 !== undefined) {
- currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
- }
- if (application.hmiUIText.statusBar !== undefined) {
- currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
- }
- if (application.hmiUIText.mediaTrack !== undefined) {
- currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
- }
- if (application.hmiUIText.image !== undefined) {
- currentApplication.hmiUIText.image = application.hmiUIText.image
- }
- if (application.hmiUIText.secondaryImage!== undefined) {
- currentApplication.hmiUIText.secondaryImage= application.hmiUIText.secondaryImage
- }
- if (application.hmiUITextAlignment !== undefined) {
- currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
- }
- if (application.helpPrompt !== undefined) {
- currentApplication.helpPrompt = application.helpPrompt
- }
- if (application.timeoutPrompt !== undefined) {
- currentApplication.timeoutPrompt = application.timeoutPrompt
- }
- if (application.mediaClock.startTime !== undefined) {
- currentApplication.mediaClock.startTime = application.mediaClock.startTime
- }
- if (application.mediaClock.endTime !== undefined) {
- currentApplication.mediaClock.endTime = application.mediaClock.endTime
- }
- // Check fields with mandatory = false
-
- if (application.menuIcon !== undefined) {
- currentApplication.menuIcon.source = application.menuIcon
- }
- currentApplication.vrHelpTitle = application.vrHelpTitle
- currentApplication.vrHelpTitleDefault = application.vrHelpTitleDefault
- currentApplication.vrHelpTitlePerformInteraction = application.vrHelpTitlePerformInteraction
- currentApplication.menuTitle = application.menuTitle
- currentApplication.vrHelpItems = application.vrHelpItems
- currentApplication.vrHelpItemsPerformInteraction = application.vrHelpItemsPerformInteraction
- currentApplication.deviceName = application.deviceName
- currentApplication.isMediaApplication = application.isMediaApplication
- currentApplication.turnList = application.turnList
- currentApplication.turnListSoftButtons = application.turnListSoftButtons
- currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
- currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
- if (application.mediaClock.startTimeForProgress !== undefined) {
- currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
- }
- currentApplication.languageTTSVR = application.languageTTSVR
- currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
- currentApplication.allowedFunctions = application.allowedFunctions
- // This place is for adding new properties
- }
- }
- applicationContext = oldApplicationContext;
- currentApplicationChanged()
- console.log("Exit setCurrentApplication function")
- }
-
- function addApplication(app) {
- console.log("enter")
- applicationList.append({
- appName: app.appName,
- ngnMediaScreenAppName: app.ngnMediaScreenAppName,
- icon: app.icon,
- menuIcon: {
- value: "",
- imageType: 1
- },
- deviceName: app.deviceName,
- appId: app.appId,
- hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
- isMediaApplication: app.isMediaApplication,
- appType: app.appType,
- helpPrompt: "",
- timeoutPrompt: "",
- customPresets: app.customPresets ? app.customPresets : [],
- playPauseState: 'Pause',
- hmiUIText: app.hmiUIText,
- hmiUITextAlignment: app.hmiUITextAlignment,
- options: [],
- turnList: [],
- turnListSoftButtons: [],
- mediaClock: app.mediaClock,
- languageTTSVR: Common.Language.EN_US,
- softButtons: [],
- vrHelpTitle: "",
- vrHelpTitlePerformInteraction: "",
- vrHelpTitleDefault: "VR HELP",
- menuTitle: "",
- keyboardProperties: [],
- vrHelpItems: [],
- vrHelpItemsPerformInteraction: [],
- vrHelpItemsDefault: {
- text: "VrHelpItems - defaultText1",
- image: "",
- position: 1
- },
- navigationSoftButtons: [],
- alertManeuverSoftButtons: [],
- navigationModel: {
- appID: -1,
- text1: "",
- text2: "",
- totalDistance: "",
- eta: "",
- timeToDestination: "",
- turnIcon: {
- value: "",
- imageType: -1
- },
- nextTurnIcon: {
- value: "",
- imageType: -1
- },
- distanceToManeuver: 0,
- distanceToManeuverScale: 0,
- maneuverComplete: false
- },
- allowedFunctions: []
- // This place is for adding new properties
- })
- if (app.isMediaApplication) {
- musicSourceModel.insert(0, {
- "title": app.appName,
- "qml": "views/SDLPlayerView.qml",
- "appId": app.appId
- })
- }
-
- console.log("exit")
- }
-
- function setApplicationProperties(appId, props) {
- console.log("Enter setApplicationProperties function");
-
- var app = getApplication(appId)
- for (var p in props) {
- console.debug(p)
- if (props[p] !== undefined) {
- app[p] = props[p]
- }
- }
- if (currentApplication.appId === appId) {
- setCurrentApplication(appId); // copy new values to current application
- }
- console.log("Exit setApplicationProperties function");
- }
-
- function removeApplication(appId) {
- console.log("enter removeApplication");
- for (var j = 0; j < musicSourceModel.count; ++j) {
- if (musicSourceModel.get(j).appId === appId) {
- musicSourceModel.remove(j);
- break;
- }
- }
- for (var i = 0; i < applicationList.count; i++) {
- if (applicationList.get(i).appId === appId) {
- applicationList.remove(i);
- break;
- }
- }
- console.log("exit removeApplication");
- }
-
- function stashApplication(appId) {
- console.log("stashApplication enter");
- stashedApplicationsList.append(getApplication(appId))
- console.log("stashApplication exit");
- }
-
- function getResumeResult (appID) {
-
- if (getStashedApplication(appId) && getApplication(appID)) {
- var stashedApp = getStashedApplication(appId),
- app = getApplication(appID);
- if (stashedApp.options.count == app.options.count) {
- for (var optionIndex = 0; optionIndex < stashedApp.options.count; ++optionIndex) {
- if (app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) {
- //comparison subMenu compare
-
- if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
- (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
- (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
- (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon))) {
- return {
- result: false
- }
- }
-
- var stashedAppSubMenu = stashedApp.options.get(optionIndex).subMenu,
- appSubMenuArray = app.options.get(optionIndex).subMenu;
-
- if (stashedAppSubMenu.length != appSubMenuArray.length) {
- return {
- result: false
- }
- }
-
- for (var subMenuIndex = 0; subMenuIndex < stashedAppSubMenu.length; subMenuIndex++) {
- if ( !((appSubMenuArray[subMenuIndex].id === stashedAppSubMenu[subMenuIndex].id) &&
- (appSubMenuArray[subMenuIndex].name === stashedAppSubMenu[subMenuIndex].name) &&
- (appSubMenuArray[subMenuIndex].position === stashedAppSubMenu[subMenuIndex].position) &&
- (appSubMenuArray[subMenuIndex].icon === stashedAppSubMenu[subMenuIndex].icon)
- )) {
- return {
- result: false
- }
- }
- }
- } else {
- //comparison Command compare
- if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
- (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
- (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
- (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon)
- )) {
- return {
- result: false
- }
- }
- }
- }
- // if all commands and subMenus were same
- // rerturn SUCCESS result
- return {
- result: true
- }
- }
- }
-
- return {
- result: false
- }
- }
-
- property int systemContext
- property int hmiContext
- property bool applicationContext: false
- property bool applicationSavedContext
- property string routeText: ""
- property PlayerState cdPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState ipodPlayerState: PlayerState {
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- playPauseState: 'Pause'
- }
- property PlayerState usbPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState linePlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState btPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState amPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
- }
- property PlayerState fmPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
- }
- property PlayerState siriusPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
- }
-
- property bool hmiVRAvailable: false
- property bool hmiTTSAvailable: false
- property bool hmiNavigationAvailable: false
- property bool hmiVehicleInfoAvailable: false
- property bool hmiUIAvailable: false
-
- property int hmiUILanguage: Common.Language.EN_US
- property int hmiTTSVRLanguage: Common.Language.EN_US
-
- property ListModel deviceList: ListModel { }
- property ListModel applicationList: ListModel { }
- property ListModel stashedApplicationsList: ListModel { }
- property ListModel vrCommands: ListModel { }
- property ListModel choicesVrCommands: ListModel { }
-
- function reset () {
- console.log("dataContainer reset enter");
- routeText = ""
- console.log("dataContainer reset exit");
- }
-
- function changeRegistrationUI (language, appID) {
- console.log("dataContainer changeRegistrarionUI enter");
- setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
- console.log("dataContainer changeRegistrarionUI exit");
- }
-
- function changeRegistrationTTSVR(language, appID) {
- console.log("dataContainer changeRegistrationTTSVR enter");
- setApplicationProperties(appID, { languageTTSVR: language });
- console.log("dataContainer changeRegistrationTTSVR exit");
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- console.debug("enter: " +
- cmdID +
- ", " +
- (menuParams ?
- "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
- ", " +
- (cmdIcon ?
- "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
- ", " +
- appID
- )
- var commandToAddPosition
- var app = getApplication(appID)
- var currentMenu = app.options
- var maximumCommands = Constants.maximumCommandsPerSubmenu
- var index = 0
-
- if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
- var parentNotFound = true
- for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
- if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
- currentMenu = app.options.get(optionIndex).subMenu
- parentNotFound = false
- maximumCommands += 1
- }
- }
- if (parentNotFound) {
- console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
- }
- }
-
- if (currentMenu.count < maximumCommands) {
- if (menuParams && (menuParams.position !== undefined)) {
- commandToAddPosition = menuParams.position
- } else {
- commandToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < currentMenu.count; i++) {
- if (commandToAddPosition >= currentMenu.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- currentMenu.insert( index,
- { id: cmdID,
- name: menuParams.menuName,
- type: Internal.MenuItemType.MI_NODE,
- position: commandToAddPosition,
- icon: cmdIcon ? cmdIcon : {},
- subMenu: []
- })
- } else {
- console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteCommand (cmdID, appID) {
- console.debug("enter: " + cmdID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if (option.type === Internal.MenuItemType.MI_NODE) {
- if (option.id === cmdID) {
- getApplication(appID).options.remove(optionIndex)
- break
- }
- }
- if (option.type === Internal.MenuItemType.MI_SUBMENU) {
- var subMenu = option.subMenu
- var idMatchFound = false
- for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
- if (subMenu.get(subOptionIndex).id === cmdID) {
- idMatchFound = true
- if (subMenu !== currentApplication.currentSubMenu) {
- subMenu.remove(subOptionIndex)
- }
- else {
- console.log("UI::deleteCommand(): cannot remove item from current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- if (idMatchFound) {
- break
- }
- }
- }
- console.debug("exit")
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
- var app = getApplication(appID)
- var index = 0
- var count = app.options.count
- var subMenuToAddPosition
-
- if (count < Constants.maximumSubmenus) {
- if (menuParams.position !== undefined) {
- subMenuToAddPosition = menuParams.position
- } else {
- subMenuToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < count; i++) {
- if (subMenuToAddPosition >= app.options.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- app.options.insert(index, {
- "id": menuID,
- "name": menuParams.menuName,
- "position": subMenuToAddPosition,
- "type": Internal.MenuItemType.MI_SUBMENU,
- "icon": undefined,
- "subMenu": [{
- "id": -1,
- "name": menuParams.menuName,
- "position": -1,
- "type": Internal.MenuItemType.MI_PARENT,
- "icon": {
- "imageType": Common.ImageType.DYNAMIC,
- "value": "../res/nav/turnArrow.png"
- },
- "subMenu": getApplication(appID).options
- }]
- })
- }
- else {
- console.log("addSubMenu(): too many submenus, rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteSubMenu (menuID, appID) {
- console.debug("enter: " + menuID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
- if (option.subMenu !== currentApplication.currentSubMenu) {
- getApplication(appID).options.remove(optionIndex)
- }
- else {
- console.log("UI::deleteSubMenu(): cannot remove current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- console.debug("exit")
- }
- property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
- property bool activeVR: false
- property int driverDistractionState: Common.DriverDistractionState.DD_OFF
- onDriverDistractionStateChanged: {
- sdlUI.onDriverDistraction(driverDistractionState);
- }
- property bool activeTTS: false
- property var activePopup: [] // Stack of names of active pop ups
- property int popups: 0
-
- property bool activeAlert: false
-
- onActiveVRChanged: setSystemContext()
- onActiveAlertChanged: setSystemContext()
- onPopupsChanged: setSystemContext()
-
- function setSystemContext () {
- console.debug("enter")
- if (popups > 0) {
- systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
- }
- else if (activeAlert) {
- systemContext = Common.SystemContext.SYSCTXT_ALERT
- }
- else if (activeVR) {
- systemContext = Common.SystemContext.SYSCTXT_VRSESSION
- }
- else if (contentLoader.item !== null) {
- systemContext = contentLoader.item.systemContext
- }
- console.debug("exit")
- }
- property MusicSourceModel musicSourceModel: MusicSourceModel {
- }
-
- property SettingsSourceModel settingsSourceModel: SettingsSourceModel {
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Internal.js b/src/components/qt_hmi/qml_model_qt5/models/Internal.js
deleted file mode 100644
index 53d7640136..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/Internal.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-.pragma library
-.import "../hmi_api/Common.js" as Common
-
-var MenuItemType = {
- MI_NODE: 0,
- MI_SUBMENU: 1,
- MI_PARENT: 2
-}
-
-function activePageChoose(flickElement, pages) {
- if (flickElement.contentX <= 0) {
- return 0
- }
- else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
- return pages -1
- }
- else {
- if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
- return Math.ceil(flickElement.contentX / flickElement.width)
- }
- else if ( (flickElement.contentX % flickElement.width) > 0) {
- return Math.floor(flickElement.contentX / flickElement.width)
- }
- }
-}
-
-var MediaClockUpdateMode = {
- MCU_COUNTUP: 0,
- MCU_COUNTDOWN: 1,
-}
-
-var MediaClockRunningMode = {
- MCR_RUNNING: 0,
- MCR_STOPPED: 1
-}
-
-function chooseAppStartScreen(appType, isMediaApplication) {
- if (checkBit(appType, Common.AppHMIType.NAVIGATION)) {
- return "./views/SDLNavi.qml"
- } else if (isMediaApplication) {
- return "./views/SDLPlayerView.qml"
- } else {
- return "./views/SDLNonMediaView.qml"
- }
-}
-
-function appendVrHelpItem (arrayElement, index, array) {
- this.append({
- text: arrayElement.text,
- image: arrayElement.image ? arrayElement.image : "",
- position: arrayElement.position
- })
-}
-
-function checkBit(value, bitPosition) {
- return (value & (1 << bitPosition))
-}
-
-function getArrayForPresetRow(app) {
- var array = []
- for (var i = 0; i < app.customPresets.count; i++) {
- array.push(app.customPresets.get(i).text)
- }
- return array
-}
-
-function pad (string, length, lead) {
- if (!lead) {
- lead = '0'
- }
- var paddedString = "" + string
- while (paddedString.length < length) {
- paddedString = lead + paddedString
- }
- return paddedString
-}
-
-function hmsTime (hours, minutes, seconds) {
- return 60 * (60 * hours + minutes) + seconds
-}
-
-function hmsTimeToString (hmsTime) {
- if (hmsTime === -1) {
- return "0:00:00"
- }
-
- var _time = hmsTime
- var seconds = _time % 60
- _time -= seconds
- _time /= 60
- var minutes = _time % 60
- _time -= minutes
- _time /= 60
- var hours = _time
- var string = ""
- string += hours
- string += ":"
- string += pad(minutes, 2)
- string += ":"
- string += pad(seconds, 2)
- return string
-}
-
-function stringToHmsTime (hmsString) {
- console.debug("enter: \"" + hmsString + "\"")
- var substrings = hmsString.split(":")
- var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (seconds >= 60) {
- console.log("incorrect field \"seconds\": " + seconds)
- console.debug("exit")
- return 0
- }
- var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (minutes >= 60) {
- console.log("incorrect field \"minutes\": " + minutes)
- console.debug("exit")
- return 0
- }
- var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- console.debug("exit")
- return hmsTime(hours, minutes, seconds)
-}
-
-function mediaClockUpdateModeToString (mediaClockUpdateMode) {
- switch (mediaClockUpdateMode) {
- case MediaClockUpdateMode.MCU_COUNTUP:
- return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
- case MediaClockUpdateMode.MCU_COUNTDOWN:
- return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
- default:
- return ""
- }
-}
-
-function mediaClockRunningModeToString (mediaClockRunningMode) {
- switch (mediaClockRunningMode) {
- case MediaClockRunningMode.MCR_RUNNING:
- return "Internal.MediaClockRunningMode.MCR_RUNNING"
- case MediaClockRunningMode.MCR_STOPPED:
- return "Internal.MediaClockRunningMode.MCR_STOPPED"
- default:
- return ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
deleted file mode 100644
index a2f659c393..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file MainMenuListModel.qml
- * @brief Main menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "Climate"
- icon: "../res/snow.png"
- qml: "./views/ClimateControlView.qml"
- }
-
- ListElement {
- name: "Navigation"
- icon: "../res/arrow.png"
- qml: "./views/NavigationNoRouteGridView.qml"
- }
-
- ListElement {
- name: "Media"
- icon: "../res/notes.png"
- qml: "./views/MusicSourceView.qml"
- }
-
- ListElement {
- name: "Settings"
- icon: "../res/gear.png"
- qml: "./views/SettingsSourceView.qml"
- }
-
- ListElement {
- name: "Apps"
- icon: "../res/apps.png"
- qml: "./views/ApplicationListView.qml"
- }
-
- ListElement {
- name: "Phone"
- icon: "../res/phone/phone.png"
- qml: "./views/PhoneMenuGridView.qml"
- }
-
- ListElement {
- name: "Car"
- icon: "../res/car.png"
- qml: "./views/CarMenuGridView.qml"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
deleted file mode 100644
index 3712ca4c31..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * @file MediaClockModel.qml
- * @brief Media clock model
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Internal.js" as Internal
-
-QtObject {
- property int updateMode
- property int runningMode
- property int startTime
- property int endTime
- property int upperTimeLimit: 60 * 60 * 60 - 1
- property int startTimeForProgress
- property real progress
-
- property Timer timer: Timer {
- id: timer
- interval: 1000
- repeat: true
- onTriggered: onTimer()
- }
- onRunningModeChanged: {
- if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
- timer.stop()
- } else {
- timer.start()
- }
- }
-
- onStartTimeChanged: {
- onProgress()
- }
-
- onEndTimeChanged: {
- onProgress()
- }
-
- onStartTimeForProgressChanged: {
- onProgress()
- }
-
- function onTimer () {
- switch (updateMode) {
- case Internal.MediaClockUpdateMode.MCU_COUNTUP:
- console.debug("count up")
- if (startTime < endTime) {
- startTime++
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Up timer stopped")
- }
- break
- case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
- console.debug("count down")
- if (startTime > endTime) {
- startTime--
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Down timer stopped")
- }
- break
- }
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- "mediaClock": {startTime: startTime,
- endTime: endTime,
- updateMode: updateMode,
- runningMode: runningMode,
- startTimeForProgress: startTimeForProgress
- }
- })
- }
-
- function onProgress () {
- if (startTime === -1) {
- progress = 0
- }
- else if (endTime != -1 && endTime === startTimeForProgress) {
- progress = 1
- }
- else {
- progress = (startTime - startTimeForProgress) / (endTime - startTimeForProgress)
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
deleted file mode 100644
index 7497d987d4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file MusicSourceModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "FM"
- qml: "./views/FMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "AM"
- qml: "./views/AMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "BT Audio"
- qml: "./views/BTPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "Sirius"
- qml: "./views/SiriusPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "CD"
- qml: "./views/CDPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "iPod"
- qml: "./views/IPodPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "USB"
- qml: "./views/UsbPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "LineIn"
- qml: "./views/LineInPlayerView.qml"
- appId: 0
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
deleted file mode 100644
index 6e434495a6..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file NavigationMenuModel.qml
- * @brief Model for navigation menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "Home"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Keyboard"
- icon: "../res/buttons/long_oval_btn.png"
- qml: "./views/NavigationKeyboardView.qml"
- }
- ListElement {
- title: "Favorites"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Work"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Recent"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "POI"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Scout"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Waze"
- icon: "../res/buttons/long_oval_btn.png"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
deleted file mode 100644
index 0abbe6b309..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * @file NavigationModel.qml
- * @brief Model for Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-QtObject {
- property string text1: ""
- property string text2: ""
- property string totalDistance: ""
- property string eta: ""
- property string timeToDestination: ""
- property var turnIcon
- property var nextTurnIcon
-
- property real distanceToManeuver: 0
- property real distanceToManeuverScale: 0
- property bool maneuverComplete: false
- property int appID: -1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
deleted file mode 100644
index 0952b7d8ad..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * @file PerformAudioPassThruModel.qml
- * @brief Data model audio pass thru.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-QtObject {
- property string appName: ""
- property string firstLine: ""
- property string secondLine: ""
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
deleted file mode 100644
index 519f48a809..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file PhoneMenuModel.qml
- * @brief Phone menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "phone"
- icon: "../res/phone/phone.png"
- qml: ""
- }
- ListElement {
- name: "contacts"
- icon: "../res/phone/contacts.png"
- qml: "./views/PhoneKeyboardView.qml"
- }
- ListElement {
- name: "messages"
- icon: "../res/phone/messages.png"
- qml: ""
- }
- ListElement {
- name: "DND"
- icon: "../res/phone/dnd_off.png"
- qml: ""
- }
- ListElement {
- name: "texts"
- icon: "../res/phone/texts.png"
- qml: ""
- }
- ListElement {
- name: "recent"
- icon: "../res/phone/recent.png"
- qml: ""
- }
- ListElement {
- name: "keyboard"
- icon: "../res/phone/keypad.png"
- qml: ""
- }
- ListElement {
- name: "more"
- icon: "../res/phone/more.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
deleted file mode 100644
index 9707f35193..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * @file PlayerState.qml
- * @brief List of parameters for each player.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-// Player state for all players except SDL media player
-Item {
- // Media players
- property string playPauseState
- property string albumImage
- property string trackNumber
- property int songPosition
- property string trackName
-
- // Radio Players
- property var presets: []
-
- // Both players
- property string songName
- property string albumName
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
deleted file mode 100644
index 9f45a5d06d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file ScrollableMessageModel.qml
- * @brief Model for Scrollable Message.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property int timeout: 0
- property var async
- property bool running: false
- property int result: -1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
deleted file mode 100644
index fed6d499d9..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file SettingsSourceModel.qml
- * @brief Settings source menu list of elements.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "Allow SDL Functionality"
- qml: "./views/SDLFunctionalityView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "Update SDL"
- qml: ""
- appId: 0
- action: "update_sdl"
- }
- ListElement {
- title: "Policy table update status"
- qml: ""
- appId: 0
- action: "get_status_update"
- }
- ListElement {
- title: "Send request GetURLS"
- qml: ""
- appId: 0
- action: "get_urls"
- }
- ListElement {
- title: "Statistics info settings"
- qml: "./views/StatisticsInfoView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "App permissions"
- qml: "./views/PolicyAppListView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "Device state change"
- qml: "./views/DeviceStateChangedView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "System Error"
- qml: "./views/SystemErrorView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "System Request"
- qml: "./views/SystemRequestView.qml"
- appId: 0
- action: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
deleted file mode 100644
index a102b4ee27..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
+++ /dev/null
@@ -1,401 +0,0 @@
-/**
- * @file SettingsStorage.qml
- * @brief Storage for keeping settings.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Internal.js" as Internal
-
-Item
-{
- property var sdlLanguagesList: [
- Common.Language.EN_US,
- Common.Language.ES_MX,
- Common.Language.FR_CA,
- Common.Language.DE_DE,
- Common.Language.ES_ES,
- Common.Language.EN_GB,
- Common.Language.RU_RU,
- Common.Language.TR_TR,
- Common.Language.PL_PL,
- Common.Language.FR_FR,
- Common.Language.IT_IT,
- Common.Language.SV_SE,
- Common.Language.PT_PT,
- Common.Language.NL_NL,
- Common.Language.ZH_TW,
- Common.Language.JA_JP,
- Common.Language.AR_SA,
- Common.Language.KO_KR,
- Common.Language.PT_BR,
- Common.Language.CS_CZ,
- Common.Language.DA_DK,
- Common.Language.NO_NO
- ]
-
- property var displayCapabilities: {
- "displayType": Common.DisplayType.GEN2_8_DMA,
- "textFields": [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack,
- Common.TextFieldName.alertText1,
- Common.TextFieldName.alertText2,
- Common.TextFieldName.alertText3,
- Common.TextFieldName.scrollableMessageBody,
- Common.TextFieldName.initialInteractionText,
- Common.TextFieldName.navigationText1,
- Common.TextFieldName.navigationText2,
- Common.TextFieldName.ETA,
- Common.TextFieldName.totalDistance,
- Common.TextFieldName.navigationText,
- Common.TextFieldName.audioPassThruDisplayText1,
- Common.TextFieldName.audioPassThruDisplayText2,
- Common.TextFieldName.sliderHeader,
- Common.TextFieldName.sliderFooter,
- Common.TextFieldName.notificationText
- ],
- "mediaClockFormats": [
- Common.MediaClockFormat.CLOCK1,
- Common.MediaClockFormat.CLOCK2,
- Common.MediaClockFormat.CLOCK3,
- Common.MediaClockFormat.CLOCKTEXT1,
- Common.MediaClockFormat.CLOCKTEXT2,
- Common.MediaClockFormat.CLOCKTEXT3,
- Common.MediaClockFormat.CLOCKTEXT4
- ],
- "graphicSupported": true,
- "imageCapabilities": [ Common.ImageType.DYNAMIC ],
- "templatesAvailable": [ "" ],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": true
- }
- },
- "numCustomPresetsAvailable": 6
- }
-
- property var softButtonCapabilities: {
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- }
-
- property var buttonCapabilities: []
-
- readonly property string fileIVSU: "hmi/res/IVSU/PROPRIETARY_REQUEST"
-
- property string filePTSnapshot: ""
-
- property int timeoutPTExchange: 500
-
- property var retriesPTExchange: []
-
- property var urlsPTExchange: []
-
- property int currentRetry: 0
-
- property int currentUrl: 0
-
- property string appIdIVSU: ""
-
- property var urlsIVSU: []
-
- function updateStatus(result) {
- console.debug("Result update SDL:", result);
- var text = {}
- text[Common.UpdateResult.UP_TO_DATE] = "UP_TO_DATE";
- text[Common.UpdateResult.UPDATING] = "UPDATING";
- text[Common.UpdateResult.UPDATE_NEEDED] = "UPDATE_NEEDED";
- ttsPopUp.activate(text[result])
- }
-
- function startPTExchange(urls) {
- console.log("enter startPTExchange");
- urlsPTExchange = urls;
- currentRetry = 0;
- currentUrl = 0;
- tryUpdatePolicy();
- console.log("exit startPTExchange");
- }
-
- function startIVSU(urls) {
- urlsIVSU = urls;
- sendSystemRequest(Common.RequestType.PROPRIETARY, urlsIVSU[0].url,
- fileIVSU, appIdIVSU);
- }
-
- function getUrl() {
- console.log("enter getUrl");
- if (currentUrl >= 0 && currentUrl < urlsPTExchange.length) {
- var url = urlsPTExchange[currentUrl];
- currentUrl = (currentUrl + 1) / urlsPTExchange.length;
- console.log("exit getUrl");
- return url;
- } else {
- console.log("exit getUrl (empty)");
- return {url: ""}
- }
- }
-
- function getInterval() {
- if (currentRetry >= 0 && currentRetry < retriesPTExchange.length) {
- var interval = (timeoutPTExchange + retriesPTExchange[currentRetry]) * 1000;
- currentRetry++;
- return interval;
- } else {
- return 0;
- }
- }
-
- function sendSystemRequest(type, url, fileName, applicationId) {
- console.log("enter sendSystemRequest");
- var offset = 1000;
- var length = 10000;
- var appId = applicationId ? applicationId : "default";
- var file = fileName ? fileName : fileIVSU;
-
- sdlBasicCommunication.onSystemRequest(type, url, Common.FileType.JSON,
- offset, length, timeoutPTExchange,
- file, appId);
- console.log("enter sendSystemRequest");
- }
-
- function tryUpdatePolicy() {
- console.log("enter tryUpdatePolicy");
- if (urlsPTExchange.length) {
- var url = getUrl();
- sendSystemRequest(Common.RequestType.PROPRIETARY, url.url, filePTSnapshot, url.policyAppId);
- } else {
- sendSystemRequest(Common.RequestType.PROPRIETARY);
- }
-
- retriesTimer.interval = getInterval();
- if (retriesTimer.interval > 0) {
- console.log("start retry strategy");
- retriesTimer.start();
- }
- console.log("exit tryUpdatePolicy");
- }
-
- function systemRequest(type) {
- if (urlsPTExchange.length) {
- sendSystemRequest(type, urlsPTExchange[0].url, null, urlsPTExchange[0].policyAppId);
- } else {
- sendSystemRequest(type);
- }
- }
-
- function stopPTExchange(fileName) {
- console.log("enter stopPTExchange");
- retriesTimer.stop();
- sdlSDL.onReceivedPolicyUpdate(fileName);
- console.log("exit stopPTExchange");
- }
-
- Timer {
- id: retriesTimer
- interval: timeoutPTExchange; running: false; repeat: false
- onTriggered: sendSystemRequest()
- }
-
- function activateApp (appId) {
-
- console.debug("SDL.ActivateApp Request enter", appId);
-
- RequestToSDL.SDL_ActivateApp(appId, function(isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority){
- settingsContainer.activateApp_Response(appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority)
- })
-
- console.debug("SDL.ActivateApp Request exit");
- }
-
- function activateApp_Response (appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority) {
-
- console.debug("activateApp_Response enter", appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority);
-
- if (!isSDLAllowed) {
-
- userActionPopUp.activate("Allow SDL Functionality request",
- "Would you like to allow SDL functionality for device '" + device.name + "'?",
- function(result){
- allowSDLFunctionality(result, device)
- },
- true
- )
- }
-
- if (isPermissionsConsentNeeded) {
- RequestToSDL.SDL_GetListOfPermissions(appId, function(allowedFunctions){
- settingsContainer.getListOfPermissions_Response(appId, allowedFunctions)
- })
- }
-
- if (isAppPermissionsRevoked) {
-
- appPermissionsRevoked(appId, appRevokedPermissions, "AppPermissionsRevoked")
- }
-
- if (isAppRevoked) {
-
- RequestToSDL.SDL_GetUserFriendlyMessage(["AppUnsupported"], dataContainer.hmiUILanguage, function(messages){
- settingsContainer.getUserFriendlyMessageAppPermissionsRevoked("AppUnsupported", messages)
- });
- } else if (isSDLAllowed && !isPermissionsConsentNeeded) {
-
- dataContainer.setCurrentApplication(appId)
- contentLoader.go(
- Internal.chooseAppStartScreen(
- dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication
- ),
- appId
- )
- }
- }
-
- function allowSDLFunctionality (result, device) {
- console.log("allowSDLFunctionality enter", result, device);
-
- sdlSDL.onAllowSDLFunctionality(device, result, Common.ConsentSource.GUI)
-
- console.log("allowSDLFunctionality exit");
- }
-
- function getListOfPermissions_Response (appId, allowedFunctions) {
- console.log("getListOfPermissions_Response enter");
-
- var app = dataContainer.getApplication(appId);
- var messageCodes = [];
-
- app.allowedFunctions = allowedFunctions;
-
- allowedFunctions.forEach(function (x) {
- messageCodes.push(x.name);
- });
-
- RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
- settingsContainer.onAppPermissionConsent_Notification(appId, messages)
- });
-
- console.log("getListOfPermissions_Response exit");
- }
-
- function appPermissionsRevoked (appId, permissions, title) {
-
- var messageCodes = [];
-
- permissions.forEach(function (x) {
- messageCodes.push(x.name);
- });
-
- messageCodes.push("AppPermissionsRevoked");
-
- RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
- settingsContainer.getUserFriendlyMessageAppPermissionsRevoked(title, messages)
- });
- }
-
- function getUserFriendlyMessageAppPermissionsRevoked (title, messages) {
- var tts = "",
- text = "";
-
- messages.forEach(function (x) {
- if (x.tts) {
- tts += x.tts;
- }
- if (x.textBody) {
- text += x.textBody;
- }
- });
-
- if (tts) {
- ttsPopUp.activate(tts)
- }
-
- userActionPopUp.activate(title, text, null, false)
-
- }
-
- function onAppPermissionConsent_Notification (appId, messages) {
- console.log("onAppPermissionConsent_Notification enter");
-
- onAppPermissionConsentPopUp.permissionItems.clear()
-
- var tts = "";
-
- for (var i = 0; i < messages.length; i++) {
- onAppPermissionConsentPopUp.permissionItems.append({
- "messageCode": messages[i].messageCode,
- "label": messages[i].label,
- "textBody": messages[i].textBody,
- "allowed": false,
- "id": messages[i].id
- });
-
- if (messages[i].tts) {
- tts += x.tts;
- }
- }
-
- if (tts) {
- ttsPopUp.activate(tts)
- }
-
- onAppPermissionConsentPopUp.activate(appId)
-
- console.log("onAppPermissionConsent_Notification enter");
- }
-
- function decrypt(file, appId) {
- sendSystemRequest(Common.RequestType.FILE_RESUME, urlsIVSU[0].url, file,
- appId);
- }
-
- function updateIVSU(appId) {
- appIdIVSU = appId;
- var service = 4; // service type for IVSU
- RequestToSDL.SDL_GetURLS(service, startIVSU);
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
deleted file mode 100644
index 359eb5d59c..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file SliderModel.qml
- * @brief Data model for slider.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-QtObject {
- property string appName: ""
- property string header: ""
- property var footer: []
- property int numTicks: 0
- property int position: 0
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
deleted file mode 100644
index 997ce1ee0a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * @file VehicleInfoModel.qml
- * @brief Data model for vehicle info.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- id: vehicleInfo
- property real speed: 80.1
- property int rpm: 5000
- property real fuelLevel: 0.2
- property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
- property real instantFuelConsumption: 2.2
- property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
- property int wiperStatus: Common.WiperStatus.OFF
- property real engineTorque: 2.5
- property real accPedalPosition: 0.5
- property real steeringWheelAngle: 1.2
- property real externalTemperature: 40.0
- property string vin: '52-452-52-752'
- property int odometer: 2
- property int prndl: Common.PRNDL.FIFTH
-
- property var headLampStatus: {
- "lowBeamsOn": false,
- "highBeamsOn": false,
- "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
- }
- property var deviceStatus: {
- 'voiceRecOn': false,
- 'btIconOn': false,
- 'callActive': false,
- 'phoneRoaming': false,
- 'textMsgAvailable': false,
- 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'stereoAudioOutputMuted': false,
- 'monoAudioOutputMuted': false,
- 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
- 'eCallEventActive': false
- }
- property var bodyInformation: {
- 'parkBrakeActive': false,
- 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
- 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
- }
- property var beltStatus: {
- 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- }
- property var tirePressure: {
- 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
- 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
- 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
- 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
- }
- property var gps: {
- 'longitudeDegrees': 42.3293,
- 'latitudeDegrees': -83.0464,
- 'utcYear': 2013,
- 'utcMonth': 2,
- 'utcDay': 14,
- 'utcHours': 13,
- 'utcMinutes': 16,
- 'utcSeconds': 54,
- 'compassDirection': Common.CompassDirection.SOUTHWEST,
- 'pdop': 4,
- 'hdop': 5,
- 'vdop': 6,
- 'actual': false,
- 'satellites': 8,
- 'dimension': Common.Dimension.Dimension_2D,
- 'altitude': 7,
- 'heading': 173,
- 'speed': 2
- }
- property var ecuDIDData: {
- 'data1': 'ECU 1 Test Data',
- 'data2': 'ECU 2 Test Data'
- }
- property var eCallInfo: {
- "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
- "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
- "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
- }
- property var airbagStatus: {
- "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
- "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
- "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
- "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
- }
- property var emergencyEvent: {
- "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
- "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
- "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
- "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
- "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
- }
- property var clusterModeStatus: {
- "powerModeActive" : true,
- "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
- "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
- "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
- }
- property var myKey: {
- "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
- }
-
-
- function sendGpsChange(){
- sdlVehicleInfo.onGps(vehicleInfo.gps)
- }
- function sendSpeedChange(){
- sdlVehicleInfo.onSpeed(vehicleInfo.speed)
- }
- function sendRpmChange(){
- sdlVehicleInfo.onRpm(vehicleInfo.rpm)
- }
- function sendFuelLevelChange(){
- sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
- }
- function sendFuelLevel_StateChange(){
- sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
- }
- function sendInstantFuelConsumptionChange(){
- sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
- }
- function sendExternalTemperatureChange(){
- sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
- }
- function sendPrndlChange() {
- if (dataContainer.vehicleInfoModel.prndl !== -1)
- {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
- }
- function sendTirePressureChange(){
- sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
- }
- function sendOdometerChange(){
- sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
- }
- function sendBeltStatusChange(){
- sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
- }
- function sendBodyInformationChange(){
- sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
- }
- function sendDeviceStatusChange(){
- sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
- }
- function sendDriverBrakingChange(){
- sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
- }
- function sendWiperStatusChange(){
- sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
- }
- function sendHeadLampStatusChange(){
- sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
- }
- function sendEngineTorqueChange(){
- sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
- }
- function sendAccPedalPositionChange(){
- sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
- }
- function sendSteeringWheelAngleChange(){
- sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
- }
- function sendECallInfoChange(){
- sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
- }
- function sendAirbagStatusChange(){
- sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
- }
- function sendEmergencyEventChange(){
- sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
- }
- function sendClusterModeStatusChange(){
- sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
- }
- function sendMyKeyChange(){
- sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml b/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
deleted file mode 100644
index 3dc6ad563d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file VrHelpItemsDefault.qml
- * @brief Default voice recognition help items.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-
-ListModel {
- id: vrHelpItemsDefault
-
- Component.onCompleted: {
- vrHelpItemsDefault.append({
- text: "Default VR Help Text1",
- image: {
- value: "",
- imageType: 1
- },
- position: 1
- });
- vrHelpItemsDefault.append({
- text: "Default VR Help Text2",
- image: {
- value: "",
- imageType: 1
- },
- position: 2
- });
- vrHelpItemsDefault.append({
- text: "Default VR Help Text3",
- image: {
- value: "",
- imageType: 1
- },
- position: 3
- });
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
deleted file mode 100644
index 2d0c4119b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
+++ /dev/null
@@ -1,290 +0,0 @@
-/**
- * @file AlertWindow.qml
- * @brief Alert popup window
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Rectangle {
- id: alertWindow
- property date lastAlertTime
- property var softButtons
- property int appId
- property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
-
- color: "transparent"
-
- property var async
-
- Rectangle {
- id: rectangle
-
- anchors.centerIn: parent
- color: "black"
- border.color: "white"
-
- width: alertContent.width + 60
- height: alertContent.height + 60
-
- property alias alertString: alert.text
- property alias appNameString: appName.text
- property int duration
-
- Column {
- id: alertContent
- anchors.centerIn: parent
- spacing: 20
-
- Text {
- id: appName
- anchors.horizontalCenter: parent.horizontalCenter
- color: "white"
- font.pointSize: 16
- }
-
- Row {
- width: Constants.alertWidth
- spacing: 20
-
- Image {
- id: alertLogo
- source: "../res/warning.png"
- }
-
- Text {
- id: alert
- width: parent.width - alertLogo.width - parent.spacing
- clip: true
- color: "white"
- font.pointSize: 16
- }
- }
-
- Rectangle {
- id: progressIndicator
- color: "white"
- height: 10
- }
-
- Column {
- Item {
- width: Constants.alertWidth
- height: alertButton1.visible ? alertButton1.height : 0
-
- SoftButton {
- id: alertButton1
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
- anchors.left: parent.left
- anchors.right: alertButton2.visible ? alertButton2.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- SoftButton {
- id: alertButton2
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- Item {
- width: Constants.alertWidth
- height: alertButton3.visible ? childrenRect.height : 0
- SoftButton {
- id: alertButton3
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
- anchors.left: parent.left
- anchors.right: alertButton4.visible ? alertButton4.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- SoftButton {
- id: alertButton4
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- }
- }
-
- SequentialAnimation {
- id: animation
- PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
- PropertyAnimation {
- id: shrinkProgressAnimation
- target: progressIndicator
- property: "width"
- to: 0
- duration: rectangle.duration
- }
- }
- }
-
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- function alert (alertStrings, duration, sButtons, showIndicator, alertType, applicationId) {
- if (timer.running) { // we have alert already
- var currentTime = new Date()
- var timeFromLastAlert = currentTime - lastAlertTime
- var timeLeft = timer.interval - timeFromLastAlert
- var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
- var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
- return timeLeftRounded
- }
- else {
- lastAlertTime = new Date();
- appId = applicationId
- rectangle.appNameString = dataContainer.getApplication(appId).appName;
- softButtons = sButtons;
- rectangle.alertString = alertStrings.join('\n');
- timer.interval = duration;
- rectangle.duration = duration;
- timer.start();
- show();
-
- progressIndicator.visible = !!showIndicator
- progressIndicator.width = alertContent.width
- console.log("ProgressIndicator.width:", progressIndicator.width)
- animation.start()
- }
- }
-
- function show () {
- dataContainer.activeAlert = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- visible = true
- }
-
- function complete (reason, data) {
- if (!keep) {
- hide()
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
- break
- // For other cases
- }
- }
- timer.stop()
- }
-
- function hide() {
- console.debug(popUpName, "HIDE")
- dataContainer.activeAlert = false
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- visible = false
- }
-
- function restart() {
- animation.restart();
- timer.restart();
- }
-
- property bool keep: false
-
- onKeepChanged: {
- if (visible && !keep && !timer.running) {
- hide()
- }
- }
-
- onVisibleChanged: {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
deleted file mode 100644
index 92e9d7442b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file ContextPopup.qml
- * @brief Popup view with system context.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-
-PopUp {
- function show() {
- console.debug("enter")
- if (!visible) { // must not increment counter if show() called for visible popup
- visible = true;
- dataContainer.popups++
- }
- console.debug("exit")
- }
-
- function hide() {
- console.debug("enter")
- console.debug(popUpName, "HIDE")
- if (visible) { // must not decrement counter if hide() called for invisible popup
- visible = false;
- dataContainer.popups--
- }
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
deleted file mode 100644
index bf88366eae..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- function complete(reason){
- hide()
- }
-
- Item {
- ListModel {
- id: reasonExit
-
- Component.onCompleted: {
- for (var name in Common.ApplicationsCloseReason) {
- append({name: name});
- }
- }
- }
- }
-
- Column
- {
- anchors.centerIn: parent
- Row {
- Text {
- text: "Select reason: "
- color: "white"
- }
-
- ComboBox {
- id: reasonComboBox
- model: reasonExit
- }
- z: 1000
- }
- OvalButton {
- text: "Exit"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
- hide()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
deleted file mode 100644
index a6fc4d7107..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file InteractionPopup.qml
- * @brief Interaction popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../hmi_api/Async.js" as Async
-import "../models/Internal.js" as Internal
-
-ContextPopup {
- id: piPopUp
- property ListModel choiceSet: ListModel { }
- property int timeout
- property int appID
- property int interactionLayout
- property var async
- property var grammarID
- property bool performInteractionIsActiveNow
-
- Text {
- id: initialText
- anchors.top: parent.top
- anchors.topMargin: Constants.popupMargin
- anchors.left: parent.left
- anchors.leftMargin: Constants.popupMargin
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- ListView {
- anchors.top: initialText.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- model: choiceSet
- delegate: OvalButton {
- width: parent.width
- text: menuName
- icon: image
- onClicked: {
- complete(Common.Result.SUCCESS, {"choiceID": model.choiceID})
- }
- }
- }
-
- Item {
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.TIMED_OUT)
- }
- }
- }
-
- function performInteraction(initialTextArg, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
- console.debug("enter")
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- performInteractionIsActiveNow = true
- if (initialTextArg !== undefined){
- initialText.text = initialTextArg.fieldText
- }
- this.timeout = timeout
- this.appID = appID
-
- this.choiceSet.clear()
- if (choiceSet !== undefined) {
- choiceSet.forEach( function(arrayElement) {
- piPopUp.choiceSet.append({
- choiceID: arrayElement.choiceID,
- menuName: arrayElement.menuName ? arrayElement.menuName : "",
- image: arrayElement.image ? arrayElement.image : "",
- secondaryText: arrayElement.secondaryText ? arrayElement.secondaryText : "",
- tertiaryText: arrayElement.tertiaryText ? arrayElement.tertiaryText: "",
- secondaryImage: arrayElement.secondaryImage ? arrayElement.secondaryImage : ""
- })
- })
- }
- if (vrHelpTitle !== undefined) {
- dataToUpdate.vrHelpTitlePerformInteraction = vrHelpTitle
- }
-
- app.vrHelpItemsPerformInteraction.clear()
-
- if (vrHelp !== undefined) {
- vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItemsPerformInteraction )
- }
- if (interactionLayout !== undefined) {
- this.interactionLayout = interactionLayout
- }
- dataContainer.setApplicationProperties(appID, dataToUpdate)
- async = new Async.AsyncCall()
- if (piPopUp.choiceSet.count !== 0) {
- activate()
- }else if (grammarID) {
- vrActivate()
- }
- console.debug("exit")
- return async
- }
-
- function activate () {
- console.debug("enter")
- timer.interval = timeout
- timer.start()
- if (grammarID) {
- vrPopUp.sortModelforPerformInteraction()
- }
- show()
- console.debug("exit")
- }
- function vrActivate () {
- console.debug("enter")
- timer.interval = timeout
- timer.start()
- vrPopUp.sortModelforPerformInteraction()
- vrPopUp.show()
- vrHelpPopup.show()
- console.debug("exit")
- }
-
- function complete (reason, data) {
- console.debug("enter")
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, data)
- break
- case Common.Result.ABORTED:
- DBus.sendReply(async, { __retCode: Common.Result.ABORTED })
- break
- case Common.Result.TIMED_OUT:
- DBus.sendReply(async, { __retCode: Common.Result.TIMED_OUT })
- break
- }
- timer.stop()
- grammarID = ""
- hide()
- performInteractionIsActiveNow = false
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
deleted file mode 100644
index 2c4fe8bd3d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * @file OnAppPermissionConsent.qml
- * @brief Settings source screen view.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
-
- width: Constants.popupWidth - 200
- height: Constants.popupHeigth - 200
-
- property int appID
- property ListModel permissionItems: ListModel{}
-
- function activate(appId) {
- console.debug("onAppPermissionConsentPopUp activate enter");
- appID = appId
- show()
- console.debug("onAppPermissionConsentPopUp activate exit");
- }
-
- function getFunctionalID(messageCode) {
-
- console.debug(appID);
-
- var app = dataContainer.getApplication(appID);
-
- for (var i = 0; i < app.allowedFunctions.length; i++) {
- if (messageCode == app.allowedFunctions[i].name) {
-
- return app.allowedFunctions[i].id;
- }
- }
- }
-
- function deactivate() {
- console.debug("onAppPermissionConsentPopUp deactivate enter");
- hide()
-
- var consentedFunctions = [];
-
- for (var i = 0; i < permissionItems.count; i++) {
- consentedFunctions.push({
- "name": permissionItems.get(i).messageCode,
- "id": getFunctionalID(permissionItems.get(i).messageCode),
- "allowed": permissionItems.get(i).allowed
- })
-
- console.debug("consentedFunctions.push", consentedFunctions[i].name,consentedFunctions[i].id,consentedFunctions[i].allowed);
- }
-
- sdlSDL.onAppPermissionConsent(appID, consentedFunctions, Common.ConsentSource.GUI);
- console.debug("onAppPermissionConsentPopUp deactivate exit");
- }
-
- Column {
- anchors.fill: parent
-
- Component {
- id: listDelegate
-
- Item {
- height: 70
- width: parent.width
-
- CheckBox {
- id: checkBox
- height: 20
-
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: permissionItems.get(index).label
- }
- }
- onClicked: {
- permissionItems.setProperty(index, "allowed", !allowed)
- }
- }
-
- Text {
- id: label
- color: Constants.primaryColor
- font.pixelSize: 0
- text: textBody
- wrapMode: TextEdit.Wrap
- width: parent.width
- anchors.top: checkBox.bottom
- }
- }
- }
-
- ScrollableListView {
- id: onAppPermissonList
- anchors.fill: parent;
- anchors.margins: 5
- anchors.bottomMargin: 100
- model: permissionItems
- delegate: listDelegate
- }
-
- Item {
- id: bottomPanel
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 100
- width: parent.width
-
- OvalButton {
- anchors.centerIn: parent
- text: "Done"
- onClicked: {
- deactivate()
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
deleted file mode 100644
index 2cb0212a34..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * @file PerformAudioPassThruPopup.qml
- * @brief Popup for audio pass thru
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property var async
-
- function showAudioPassThru(){
- console.debug("entered")
- dataContainer.uiAudioPassThru.running = true
- show()
- if (dataContainer.uiAudioPassThru.timeout) {
- timer.start()
- }
- console.debug("exited")
- }
-
- function complete(reason){
- console.debug("enter", reason)
- timer.stop()
- dataContainer.uiAudioPassThru.timeout = 0
- dataContainer.uiAudioPassThru.running = false
- switch (reason) {
- case Common.Result.ABORTED:
- console.debug("exit with abort")
- DBus.sendError(async, Common.Result.ABORTED)
- break;
- case Common.Result.SUCCESS:
- console.debug("exit with success")
- DBus.sendReply(async, {})
- break;
- case Common.Result.RETRY:
- console.debug("exit with retry")
- DBus.sendError(async, Common.Result.RETRY)
- break;
- }
- hide()
- }
-
-
- Column {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiAudioPassThru.timeout
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Row {
- spacing: Constants.generalSpacing
- Image {
- source: "../res/controlButtons/vrImage.png"
- }
-
- Column {
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.firstLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.secondLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: Constants.generalSpacing
-
- OvalButton {
- text: "Retry"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.RETRY)
- }
- }
-
- OvalButton {
- text: "Done"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.SUCCESS)
- }
- }
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
deleted file mode 100644
index 544852638d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- default property alias content: content.children
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width - padding / 2
- height: parent.height - padding / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
- }
-
- onVisibleChanged: {
- if (popUpName) {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
- }
-
- function show() {
- console.debug("enter");
- visible = true;
- console.debug("exit");
- }
-
- function hide() {
- console.debug("enter");
- visible = false;
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
deleted file mode 100644
index 38f866797d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property var async
- property int position: 1
- /**
- * Test Support Section
- */
- property int resultCode: -1
- signal onReady
- /**
- * Test Support Section End
- */
-
- function showSlider(){
- console.debug("enter")
-
- dataContainer.uiSlider.running = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- if(dataContainer.uiSlider.footer === undefined ||
- dataContainer.uiSlider.footer.length === 0 ||
- dataContainer.uiSlider.position === 0 ) {
- footerText.text = ""
- } else {
- footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
- }
- position = dataContainer.uiSlider.position
- show()
- timer.start()
- onReady()
- console.debug("exit")
- }
-
- function complete(reason){
- console.debug("enter reason = ", reason)
- timer.stop()
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- dataContainer.uiSlider.running = false
- switch(reason) {
- case Common.Result.ABORTED:
- console.debug("aborted position is", position)
- resultCode = Common.Result.ABORTED
- DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
- break
- case Common.Result.SUCCESS:
- console.debug("send position", position)
- resultCode = Common.Result.SUCCESS
- dataContainer.uiSlider.position = position
- DBus.sendReply(async, {sliderPosition:position})
- break
- default:
- break
- }
- hide()
- position = 1
- console.debug("exit")
- }
-
-
- Column
- {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiSlider.timeout
- onTriggered: {
- console.debug("triggered")
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Text {
- id: headerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.header
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Rectangle {
- id: borderRectangle
- width: Constants.sliderBarWidth
- height: Constants.sliderBarHeight
- anchors.horizontalCenter: parent.horizontalCenter
- border.color: Constants.sliderBarBorderColor
- border.width: Constants.sliderBarBorderWidth
- radius: Constants.sliderBarRadius
- color: "black"
-
- Rectangle {
- id: rectangle
- color: Constants.sliderBarFillColor
- height: parent.height
- border.color: parent.border.color
- border.width: parent.border.width
- radius: parent.radius
-
- onVisibleChanged: {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- rectangle.width = dataContainer.uiSlider.position * tickWidth
- }
- }
-
- MouseArea{
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- onPositionChanged(mouse)
- }
-
- onPositionChanged: {
- if(mouseX <= 0){
- rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = 1
- }
-
- if(mouseX > borderRectangle.width) {
- rectangle.width = borderRectangle.width
- position = dataContainer.uiSlider.numTicks
- }
-
- if(mouseX > 0 && mouseX < borderRectangle.width) {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = Math.ceil(mouseX / tickWidth)
- rectangle.width = position * tickWidth
- }
-
- if(dataContainer.uiSlider.footer.length > 1){
- footerText.text = dataContainer.uiSlider.footer[position - 1]
- }
- }
- }
- }
-
- Text {
- id:footerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: ""
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-
- function getTimer() {
- return timer
- }
- function getBackButton() {
- return backButton
- }
- function getFooterText() {
- return footerText
- }
- function getBorderRectangle() {
- return borderRectangle
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
deleted file mode 100644
index 5cd49bdd51..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @file TBTClientStatePopUp.qml
- * @brief Popup view for TBT interface (list of states).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
- Item {
- ListModel {
- id: tbtState
-
- Component.onCompleted: {
- for (var name in Common.TBTState) {
- append({name: name});
- }
- }
- }
- }
- Text {
- text: "TBT Client State"
- verticalAlignment: Text.AlignVCenter
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.top: parent.top
- color: Constants.primaryColor
- }
- ComboBox {
- id: comboBox
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- model: tbtState
- onCurrentTextChanged: {
- console.log("Send signal onTBTClientState:", currentText);
- sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
deleted file mode 100644
index d16015ec56..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * @file TTSPopUp.qml
- * @brief Popup view for TTS
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
- height: Constants.ttsPopUpHeight
- width: Constants.ttsPopUpWidth
- padding: Constants.ttsPopUpPadding
- property var async
- property string helpPromptstr
-
- ScrollView {
- anchors.fill: parent
- Text {
- id: text
- anchors.fill: parent
- color: Constants.popUpBorderColor
- font.pixelSize: Constants.ttsFontSize
- text:""
- }
- }
-
- resources: [
- Timer {
- id: timer
- interval: Constants.ttsSpeakTime
- onTriggered: deactivate()
- },
-
- Timer {
- id: ttsPerformInteractionTimer
- interval: Constants.ttsSpeakTime
- onTriggered:
- if(interactionPopup.performInteractionIsActiveNow)
- activate(message)
- property var message: undefined
- }
- ]
-
- function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
- console.debug("Activate TTS popup:", "message");
- helpPromptstr = helpPrompt
- activate(initialPrompt);
- if (timeout * 2 - Constants.ttsSpeakTime > 0) {
- ttsPerformInteractionTimer.message = timeoutPrompt;
- ttsPerformInteractionTimer.interval = timeout - Constants.ttsSpeakTime;
- ttsPerformInteractionTimer.restart()
- }
- }
-
- function activate(message) {
- console.debug("Activate TTS popup:", message);
- dataContainer.activeTTS = true;
- sdlTTS.started();
- console.debug("TTS started");
- text.text = message;
- show();
- timer.restart();
- console.debug("Exit");
- }
-
- function deactivate() {
- console.debug("Deactivate TTS popup");
- dataContainer.activeTTS = false;
- sdlTTS.stopped();
- console.debug("TTS stopped");
- text.text = '';
- timer.stop();
- hide();
- DBus.sendReply(async, {});
- async = null;
- console.debug("Exit");
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
deleted file mode 100644
index d49c212297..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../controls"
-
-Item {
- default property alias content: content.children
- property var callbackFunc: null
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width / 2
- height: parent.height / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
-
- Text {
- id: title
- text: "adsadad"
- anchors.top: parent.top
- anchors.topMargin: 5
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- width: parent.width - padding
- height: 20
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- wrapMode: TextEdit.Wrap
- }
-
- Text {
- id: message
- text: "adsadad"
- anchors.top: parent.top
- anchors.topMargin: 30
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- width: parent.width - padding
- height: 100
- font.pixelSize: 0
- color: Constants.primaryColor
- wrapMode: TextEdit.Wrap
- }
-
- OvalButton {
- id: okButton
- text: "Ok"
- fontSize: Constants.fontSize
- property bool result: true
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: parent.width / 2 - 20
- onClicked: {
- deactivate(result)
- }
- visible: false
- }
-
- OvalButton {
- id: cancelButton
- text: "Cancel"
- fontSize: Constants.fontSize
- property bool result: false
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.rightMargin: 15
- width: parent.width / 2 - 20
- onClicked: {
- deactivate(result)
- }
- visible: false
- }
-
- OvalButton {
- id: closeButton
- text: "Close"
- fontSize: Constants.fontSize
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: parent.width - 20
- onClicked: {
- deactivate()
- }
- visible: false
- }
-
- }
-
- function activate(titleText, textBoxText, callback, buttons) {
- console.log("userActionPopUp activate enter");
- title.text = titleText;
- message.text = textBoxText;
-
- if (buttons) {
- callbackFunc = callback;
- okButton.visible = true
- cancelButton.visible = true
- } else {
- closeButton.visible = true
- }
-
- visible = true;
- console.debug("userActionPopUp activate exit");
- }
-
- function deactivate(result) {
- console.log("userActionPopUp deactivate enter");
- visible = false;
- title.text = "";
- message.text = "";
- if (callbackFunc) {
- callbackFunc(result);
- callbackFunc = null;
- }
- okButton.visible = false
- cancelButton.visible = false
- closeButton.visible = false
- console.debug("userActionPopUp deactivate exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
deleted file mode 100644
index c699f0f51d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * @file VRHelpPopup.qml
- * @brief Popup view for VR help
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-PopUp {
- property alias title: title.text
- Text {
- id: title
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- text: {
- // not in application
- if (!dataContainer.applicationContext) {
- return dataContainer.currentApplication.vrHelpTitleDefault
- // in application
- } else {
- if (interactionPopup.performInteractionIsActiveNow) {
- return dataContainer.currentApplication.vrHelpTitlePerformInteraction
- } else if (dataContainer.currentApplication.vrHelpTitle) {
- return dataContainer.currentApplication.vrHelpTitle
- } else {
- return dataContainer.currentApplication.vrHelpTitleDefault
- }
- }
- }
- font.pixelSize: Constants.titleFontSize
- color: Constants.primaryColor
- }
-
- ScrollableListView {
- anchors.top: title.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
-
- model: {
- // not in application
- if (!dataContainer.applicationContext) {
- return dataContainer.currentApplication.vrHelpItemsDefault
- // in application
- } else {
- if (interactionPopup.performInteractionIsActiveNow) {
- return dataContainer.currentApplication.vrHelpItemsPerformInteraction
- } else if (dataContainer.currentApplication.vrHelpItems.count > 0) {
- return dataContainer.currentApplication.vrHelpItems
- } else {
- return dataContainer.currentApplication.vrHelpItemsDefault
- }
- }
- }
-
- delegate:
- Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.image
- anchors.verticalCenter: parent.verticalCenter
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- }
-
- Text {
- id: text
- anchors.verticalCenter: parent.verticalCenter
- text: model.text
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- function complete(reason, data) {
- hide()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
deleted file mode 100644
index ed33e5ca8d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * @file VRPopUp.qml
- * @brief Popup view for VR interface (list commands).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../controls"
-
-PopUp {
- Text {
- id: title
- anchors.left: parent.left
- anchors.top: parent.top
- height: voice.height
- width: parent.width - voice.width
- text: "Speak the command"
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Image {
- id: voice
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/controlButtons/vrImage.png"
- }
- OvalButton{
- id:helpButton
- anchors.rightMargin: Constants.popupMargin
- anchors.leftMargin: Constants.popupMargin
- anchors.top: voice.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- text: "Help"
- onClicked:{
- if (interactionPopup.performInteractionIsActiveNow)
- ttsPopUp.activate(ttsPopUp.helpPromptstr)
- if (dataContainer.activeVR) {
- vrPopUp.complete();
- vrHelpPopup.hide()
- }
- }
- }
-
- ScrollableListView {
- anchors.bottomMargin: Constants.popupMargin
- anchors.rightMargin: Constants.popupMargin
- anchors.leftMargin: Constants.popupMargin
- anchors.top: helpButton.bottom
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.left: parent.left
-
- model: if (interactionPopup.grammarID) {
- dataContainer.choicesVrCommands
- }
- else {
- dataContainer.vrCommands
- }
-
- delegate: OvalButton {
- width: parent.width
- text: command
- visible: visibleButtons(grammarID,type)
- onClicked: {
- if (interactionPopup.performInteractionIsActiveNow && type === Common.VRCommandType.Choice)
- interactionPopup.complete(Common.Result.SUCCESS, {"choiceID": cmdID})
- sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
- if (dataContainer.activeVR) {
- vrPopUp.complete();
- vrHelpPopup.hide()
- }
- }
- }
- }
-
- function activate() {
- dataContainer.activeVR = true;
- sdlVR.started();
- show();
- }
-
- function complete(reason) {
- dataContainer.activeVR = false;
- sdlVR.stopped();
- hide();
- }
-
- function sortModelforPerformInteraction() {
- var n,
- i,
- j;
- for (n = 0; n < dataContainer.choicesVrCommands.count; n++) {
- for (i = n + 1; i < dataContainer.choicesVrCommands.count; i++) {
- if (dataContainer.choicesVrCommands.get(n).type === Common.VRCommandType.Command &&
- dataContainer.choicesVrCommands.get(i).type === Common.VRCommandType.Choice) {
- dataContainer.choicesVrCommands.move(i, n, 1);
- n = 0;
- }
- }
- }
- for (j = interactionPopup.grammarID.length; j > 0; j--) {
- for (n = 0; n < dataContainer.choicesVrCommands.count &&
- dataContainer.choicesVrCommands.get(n).type === Common.VRCommandType.Choice; n++) {
- for (i = n + 1; i < dataContainer.choicesVrCommands.count &&
- dataContainer.choicesVrCommands.get(i).type === Common.VRCommandType.Choice; i++) {
- if (dataContainer.choicesVrCommands.get(n).grammarID !== interactionPopup.grammarID[j-1]
- && dataContainer.choicesVrCommands.get(i).grammarID === interactionPopup.grammarID[j-1]) {
- dataContainer.choicesVrCommands.move(i, n, 1);
- n = 0;
- }
- }
- }
- }
- }
-
- function visibleButtons(grammarID, type) {
- if (interactionPopup.grammarID) {
- return interactionPopup.grammarID.indexOf(grammarID) !== -1
- }
- else {
- return type === Common.VRCommandType.Command
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
deleted file mode 100644
index a97f346719..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file VIPopUp.qml
- * @brief Pop up window with information about vehicle.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-import QtQuick.Controls 1.0
-
-PopUp {
- //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
- Column {
- anchors.fill: parent
- Text {
- id: viText
- width: parent.width
- height: 1/5 * parent.height
- text: "Vehicle Information"
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- }
-
- Row {
- height: 1/5 * parent.height
- width: parent.width
-
- Text {
- width: 1/4 * parent.width
- height: 1/5 * parent.height
- anchors.verticalCenter: parent.verticalCenter
- text: "PRNDL: "
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- ComboBox {
- anchors.verticalCenter: parent.verticalCenter
- id: comboBox
- model: prndlList
-
- onCurrentIndexChanged: {
- console.debug("PRNDL:", currentIndex)
- dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
- }
-
- textRole: "name"
- ListModel {
- id: prndlList
- Component.onCompleted: {
- append({ id: -1, name: "<NO DATA (prndl)>" })
- for (var name in Common.PRNDL) {
- append({ id: Common.PRNDL[name], name: name });
- }
- }
- }
- }
- z: 1000
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
deleted file mode 100644
index ea820e8019..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.7.0 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "MainWindow.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "../res"
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "." ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
deleted file mode 100644
index ad0c9d1907..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file AMPlayerView.qml
- * @brief AM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: amRadioPlayer
- anchors.fill: parent
- radioType: "AM"
- radioName: "AM Radio"
-
- playerState: dataContainer.amPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
deleted file mode 100644
index 38c5ab067e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * @file ApplicationListView.qml
- * @brief Application list view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- Column {
- anchors.fill: parent
- Item {
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- OvalButton {
- text: "Find New Apps"
- }
-
- OvalButton {
- text: "Change device"
- onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
- }
-
- OvalButton {
- text: "911 Assist"
- }
-
- OvalButton {
- text: "Vehicle Health Report"
- }
-
- OvalButton {
- text: "Install applications/Up"
- }
- }
- }
-
- Item {
- height: parent.height / 2
- width: parent.width
-
- ScrollableListView {
- id: applicationListView
- anchors.fill: parent
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- settingsContainer.activateApp(appId)
-// dataContainer.setCurrentApplication(appId)
-// contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
-// dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
deleted file mode 100644
index a1d8c43a39..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * @file BTPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: btPlayer
- playerName: "BT Audio"
- anchors.fill: parent
-
- playerState: dataContainer.btPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: btPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
deleted file mode 100644
index 8cf1c3f728..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file CDPlayerView.qml
- * @brief CD player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: cdPlayer
- playerName: "CD"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.cdPlayerState
-
- buttons: [
- OvalButton {
- text: cdPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
deleted file mode 100644
index e61bac1d08..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file CarMenuGridView.qml
- * @brief Car menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: CarMenuModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
deleted file mode 100644
index 84a751efec..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @file ChangeDeviceView.qml
- * @brief Screen view with list of available devices.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Text {
- id: searchDeviceText
- anchors.left: parent.left
- anchors.top: parent.top
- height: 1/4 * parent.height
- width: parent.width
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- text: "Devices available:"
- verticalAlignment: Text.AlignVCenter
- }
-
- ListView {
- id: changeDeviceListView
- anchors.left: parent.left
- anchors.top: searchDeviceText.bottom
- model: dataContainer.deviceList
- width:parent.width
- height:parent.height - searchDeviceText.height
-
- delegate: Text {
- MouseArea {
- anchors.fill: parent
- onClicked: {
- sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
- sdlBasicCommunication.onFindApplications({ name: name, id: devid })
- contentLoader.go("./views/ApplicationListView.qml")
- }
- }
- text: name
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- }
- }
- }
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-
- Component.onCompleted: {
- console.log("ChangeDeviceView Component.onCompleted enter");
- sdlBasicCommunication.onStartDeviceDiscovery();
- console.log("ChangeDeviceView Component.onCompleted exit");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
deleted file mode 100644
index 41b0c32efa..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file ClimateControlView.qml
- * @brief Screen view of climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-
-GeneralView {
- Item {
- id: climatMenu
- anchors.fill: parent
-
- Item {
- height: parent.height
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Column {
- id: leftItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- Row {
- ClimateControlBtn {name: "heated_seat"}
- ClimateControlBtn {name: "heated_wheel"}
- }
- Row {
- ClimateControlBtn {name: "AC"}
- ClimateControlBtn {name: "headed_dash"}
- }
- }
-
- Column {
- id: centralItem
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
- ClimateControlBtn {name: "face"; state: "on"}
- ClimateControlBtn {name: "feet"}
- }
-
- Row {
- id: rightItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- ClimateControlBtn {
- anchors.verticalCenter: parent.verticalCenter
- txt: "Dual"
- state: "on"
- }
-
- Column {
- ClimateControlBtn { name: "heated_seat" }
- ClimateControlBtn { name: "AC" }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
deleted file mode 100644
index 90f817036d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * @file ContactsListView.qml
- * @brief Contact list screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- function setCurrent(firstLetter){
- for(var i = 0; i < contactsListView.count; i ++) {
- if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
- contactsListView.positionViewAtIndex(i, ListView.Beginning)
- break;
- }
- }
- }
- Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- ScrollableListView {
- id: contactsListView
- anchors.fill: parent
- clip: true
- spacing: 1/2 * Constants.fontSize
- model: ContactsListModel { }
-
- section.property: "name"
- section.criteria: ViewSection.FirstCharacter
- section.delegate: Text {
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: section.toUpperCase()
- }
-
- delegate: Item {
- anchors.left: parent.left
- width: parent.width - Constants.scrollBarWidth
- height: typeText.height
-
- Text {
- id: contactName
- anchors.left: parent.left
- text: name
- width: Constants.contactListNameFieldSize * parent.width
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- elide: Text.ElideRight
- }
- Text {
- id: phoneText
- anchors.left: contactName.right
- width: Constants.contactListPhoneFieldSize * parent.width
- text: phone
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- Text {
- id: typeText
- anchors.right: parent.right
- width: Constants.contactListDescriptionFieldSize * parent.width
- text: type
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
deleted file mode 100644
index 5a0b5b7754..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Choose devices to be Unpaired:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: dataContainer.deviceList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: {
- sdlSDL.onDeviceStateChanged(Common.DeviceState.UNPAIRED,
- "", {id: devid, name: name});
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
deleted file mode 100644
index ae117ccd05..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file FMPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: fmRadioPlayer
- anchors.fill: parent
- radioType: "FM"
- radioName: "FM Radio"
-
- playerState: dataContainer.fmPlayerState
-
- property int hdButtonValue: 1
-
- buttonHD: [
- Image {
- id: hdButton
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- source: "../res/buttons/long_oval_btn.png"
- property string textColor: Constants.primaryColor
-
- Row {
- anchors.centerIn: parent
- spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
-
- Image {
- id: hdLogo
- anchors.verticalCenter: parent.verticalCenter
- source:"../res/hd_logo_on.png"
- }
-
- Text {
- id: one
- anchors.verticalCenter: parent.verticalCenter
- text: "1"
- color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: two
- anchors.verticalCenter: parent.verticalCenter
- text: "2"
- color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: three
- anchors.verticalCenter: parent.verticalCenter
- text: "3"
- color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: four
- anchors.verticalCenter: parent.verticalCenter
- text: "4"
- color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- hdLogo.source = "../res/hd_logo_off.png"
- hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
- hdButton.textColor = Constants.secondaryColor
-
- }
- onReleased: {
- hdLogo.source = "../res/hd_logo_on.png"
- hdButton.source = "../res/buttons/long_oval_btn.png"
- hdButton.textColor = Constants.primaryColor
- fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
- }
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
deleted file mode 100644
index ca6eb12e8f..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file GeneralView.qml
- * @brief Base view class. Defines properties and behavior common for all views
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- /// HMI context view is related to
- property int systemContext: Common.SystemContext.SYSCTXT_MAIN
- /// True if view is in application context
- property bool applicationContext: false
- /// View category for AppDeactivated notification (reason)
- property int category: Common.DeactivateReason.GENERAL
-
- signal enterScreen
- signal leaveScreen
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
deleted file mode 100644
index f935b030c4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file GridMenu.qml
- * @brief Parent class for main menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- id: main
- property alias model: repeater.model
- property alias delegate: repeater.delegate
- property alias rows: grid.rows
- property int columnsOnPage: Constants.menuColumnCount
-
- Flickable {
- id: flicker
- anchors.fill: parent
- contentWidth: grid.width
- flickableDirection: Flickable.HorizontalFlick
-
- Grid {
- id: grid
- anchors.centerIn: parent
- rows: Constants.menuRowCount
- columns: Math.ceil(model.count / rows)
- flow: Grid.TopToBottom
- Repeater {
- id: repeater
- }
- }
-
- property int snapTo: width / parent.columnsOnPage
- onMovementEnded: {
- var rest = flicker.contentX % snapTo
- var time = 0.25
- if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
- var vel = 2 * rest / time
- flickDeceleration = Math.abs(vel) / time
- flick(vel, 0)
- flickDeceleration = 1500
- }
- }
-
- Pager {
- id: pager
- space: 10
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: Constants.margin
-
- pages: Math.ceil(grid.columns / parent.columnsOnPage)
- activePage: Internal.activePageChoose(flicker, pager.pages)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
deleted file mode 100644
index 1a162f2caa..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file HardwareButtonsView.qml
- * @brief Area of screen responsible for hardware buttons
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- height: row.height + row.anchors.margins
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.panelColor
-
- signal buttonDown(string name)
- signal buttonUp(string name)
-
- function pressButton(name) {
- buttonDown(name)
- }
-
- function longPressButton(name) {
- console.log("long press " + name)
- }
-
- function releaseButton(name) {
- buttonUp(name)
- }
-
- Row {
- id: row
- spacing: Constants.panelPadding
- anchors.centerIn: parent
- anchors.margins: Constants.panelPadding
-
- PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
-
- MaskedButton {
- name: "vr"
- anchors.verticalCenter: parent.verticalCenter
- onReleased: {
- console.debug("Clicked VR button");
- if (!dataContainer.activeVR) {
- vrPopUp.activate();
- vrHelpPopup.show();
- } else {
- vrPopUp.complete();
- vrHelpPopup.hide()
- }
- }
- }
-
- ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
-
- Grid {
- columns: 5
- rows: 2
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- Repeater {
- model: 10
- delegate : Rectangle {
- width: 40
- height: 40
- radius: 5
- gradient: Gradient {
- GradientStop
- {
- position: 0.0;
- color: "#2c2c2c"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
-
- GradientStop
- {
- position: 1.0;
- color: "black"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
- }
-
- Text {
- text: (1 + index) % 10
- font.pixelSize: 30
- color: Constants.panelTextColor
- anchors.centerIn: parent
- }
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- property bool clickProcessed
- onPressed: {
- parent.gradient.stops[0].position = 1.0
- parent.gradient.stops[1].position = 0.0
- clickProcessed = false
- timer.start()
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- onReleased: {
- parent.gradient.stops[0].position = 0.0
- parent.gradient.stops[1].position = 1.0
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- Connections {
- target: timer
- onTriggered: {
- if(!mouseArea.clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
- mouseArea.clickProcessed = true
- }
- }
- }
- }
-
- Component.onCompleted: {
- settingsContainer.buttonCapabilities.push(
- {
- name: Common.ButtonName.PRESET_0 + index,
- upDownAvailable: true,
- shortPressAvailable: true,
- longPressAvailable: true
- });
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
deleted file mode 100644
index 65a667702b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file IPodPlayerView.qml
- * @brief IPod player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: ipodPlayer
- playerName: "iPod"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.ipodPlayerState
-
- buttons: [
- OvalButton {
- text: ipodPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
deleted file mode 100644
index 70f3e04772..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file LineInPlayerView.qml
- * @brief LineIn player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: lineInPlayer
- playerName: "LineIn"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.linePlayerState
-
- buttons: [
- OvalButton {
- text: lineInPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
deleted file mode 100644
index 7ed435b137..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file MainMenuView.qml
- * @brief Main menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: MainMenuListModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
deleted file mode 100644
index 5178d979cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file MediaClockView.qml
- * @brief Media clock view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- property alias time: timeText.text
- Text {
- id: timeText
- anchors.left: parent.left
- width: 1/10 * parent.width
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignRight
- color: "white"
- text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
- : "02:36" //TODO {Aleshin}: get track time for all players except SDL
- font.pixelSize: 18
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- height: parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: dataContainer.currentApplication.mediaClock.progress * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
deleted file mode 100644
index ed4eda014e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
+++ /dev/null
@@ -1,302 +0,0 @@
-/**
- * @file MediaPlayerView.qml
- * @brief Parent for BT, IPod, CD players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- id: mediaPlayerView
-
- property string playerName: ""
- property string playerType: ""
-
- signal rewind
- signal forward
- signal play
- signal pause
-
- // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
- property PlayerState playerState;
-
- property alias buttons: buttonsRow.content
- property alias buttonsSpacing: buttonsRow.spacing
- property alias image: image.source
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- width: parent.width
- height: 1/5 * parent.height
- anchors.left: parent.left
- anchors.top: parent.top
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
- : (width - 2 * elementWidth)
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- }
- }
-
- Item {
- id: spacingBetweenItems
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 2/5 * parent.height
- anchors.left: parent.left
- anchors.top: spacingBetweenItems.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - titleText.height - 3 * text.height) / 3
-
- Text {
- id: titleText
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
- : playerState.trackName
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- }
-
- Text {
- id: text
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
- : playerState.albumName
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
- : playerState.trackNumber
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- MediaClockView {
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- id: spacingBetweenItems2
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: mediaContent.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Row {
- // Rewind, play, pause, forward buttons
- id: playPauseRewindForward
- width: parent.width
- height: 1/5 * parent.height - statusBar.height
- anchors.left: parent.left
- anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
- anchors.top: spacingBetweenItems2.bottom
-
- Image {
- id: prevButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_prev_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
- }
- onReleased: {
- prevButton.source = "../res/buttons/player_prev_btn.png"
- }
- }
- }
-
- PlayPauseButton {
- id: playPauseButton
- anchors.verticalCenter: parent.verticalCenter
- state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
- onClicked: {
- (state == 'Play') ? play() : pause();
- var newState = state === "Play" ? "Pause" : "Play";
- (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
- : playerState.playPauseState = newState
- }
- }
-
- Image {
- id: nextButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_next_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- nextButton.source = "../res/buttons/player_next_pressed_btn.png"
- }
- onReleased: {
- nextButton.source = "../res/buttons/player_next_btn.png"
- }
- }
- }
- }
-
- Item {
- id: presetButtons
- width: parent.width
- height: 1/5 * parent.height
- anchors.top: playPauseRewindForward.bottom
- anchors.left: parent.left
-
- PresetRow {
- id: presetsRow
- anchors.top: parent.top
- anchors.left: parent.left
- presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow(dataContainer.currentApplication) : []
- width: parent.width
-
- onPresetButtonPressed: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- }
-
- onPresetButtonClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
-
- onPresetButtonHold: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
- }
-
- StatusBar {
- id: statusBar
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-
- states: [
- State {
- name: 'presetButtonsON'
- when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1
- }
- PropertyChanges {
- target: presetButtons
- visible: true
- enabled: true
- }
- },
-
- State {
- name: 'presetButtonsOFF'
- when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: presetButtons
- visible: false
- enabled: false
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
deleted file mode 100644
index 08f1d76b60..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file MusicSourceView.qml
- * @brief Music source screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: dataContainer.musicSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml, appId)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
deleted file mode 100644
index 99f1877a51..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file NavigationInRouteGridView.qml
- * @brief Navigation in route screen veiw.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-
-GeneralView {
- Item {
- id: navInRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: Constants.releasedButtonTextColor
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- Image {
- id: muteBtnImg
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * muteBtnImg.width
- source: "../res/nav/mute_off.png"
- MouseArea {
- anchors.fill: parent
- onClicked: if (muteBtnImg.state === "off") {
- muteBtnImg.state = "on"
- muteBtnImg.source = "../res/nav/mute_off.png"
- }
- else {
- muteBtnImg.source = "../res/nav/mute_on.png"
- muteBtnImg.state = "off"
- }
- }
- }
-
- Image {
- id: turnArrow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: muteBtnImg.right
- anchors.leftMargin: 1/20 * contentLoader.width
- source: "../res/nav/turnArrow.png"
- }
-
- Text {
- id: street
- anchors.verticalCenter: cancel.verticalCenter
- anchors.left: turnArrow.right
- anchors.leftMargin: 1/20 * contentLoader.width
- text: "0.2 mi on Cherry Hill Rd."
- color: "White"
- font.pixelSize: 20
- }
-
- Text {
- id: timeToDest
- anchors.verticalCenter: cancel.verticalCenter
- anchors.right: cancel.left
- anchors.rightMargin: 1/20 * contentLoader.width
- text: "2 hrs 27 min"
- color: "White"
- font.pixelSize: 20
- }
-
- Image {
- id: cancel
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- source: "../res/buttons/long_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: cancel.left
- anchors.leftMargin: Constants.fontSize
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: cancelText
- anchors.centerIn: parent
- text: "Cancel"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- cancel.source = "../res/buttons/long_oval_pressed_btn.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- cancelText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- cancel.source = "../res/buttons/long_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- cancelText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationNoRouteGridView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
deleted file mode 100644
index f5d19e7626..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file NavigationKeyboardView.qml
- * @brief Navigation keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navKeyboard
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- // Text line with input text
- TextInput {
- id: inputText
- anchors.top:parent.top
- anchors.left:parent.left
- maximumLength: 30
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: dataContainer.routeText
- }
-
- // Keyboard
- Column {
- anchors.centerIn: parent
- Row {
- id: upperRow
- property string qWERTY : "QWERTYUIOP"
- anchors.horizontalCenter: parent.horizontalCenter
-
- Repeater {
- model: 10
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: upperRow.qWERTY.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += upperRow.qWERTY.charAt(index)
- }
- }
- }
- }
- Row {
- id: middleRow
- property string aSDFGH : "ASDFGHJKL"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 15
- }
- //--------------
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: middleRow.aSDFGH.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += middleRow.aSDFGH.charAt(index)
- }
- }
- }
- //--------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- onIsPressedChanged: {
- hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
- }
- Image {
- id: hoverImg
- anchors.centerIn: parent
- source: "../res/nav/delete_icon.png"
- }
-
- onClicked: {
- dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
- }
- }
- }
- Row {
- id: lowerRow
- property string zXCVBN : "ZXCVBNM"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "!@#"
- pixelSize: 15
- }
- //-----------------
- Repeater {
- model: 7
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: lowerRow.zXCVBN.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
- }
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Clear"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText = ""
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Space"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText += " "
- }
- }
- }
-
- } // column
-
- Image {
- id: goBtn
- anchors.right: parent.right
- anchors.top: parent.top
- source: "../res/buttons/short_oval_btn.png"
-
- Text {
- id: goText
- anchors.centerIn: parent
- text: "Go"
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
- goText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- goBtn.source = "../res/buttons/short_oval_btn.png"
- goText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationInRouteGridView.qml")
- }
- }
- }
- } // 3/4 top screen
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
deleted file mode 100644
index 8b8b7ef261..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file NavigationMenuView.qml
- * @brief Navigation menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: NavigationMenuModel {}
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
deleted file mode 100644
index d4fbb9f4ef..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * @file NavigationNoRouteGridView.qml
- * @brief Navigation no route screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navNoRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- id: bottomPart
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Destination search button
- Image {
- id: destSearch
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- source: "../res/buttons/longest_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 15
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: destText
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: destIcon.right
- anchors.leftMargin: 5
- text: "Destination"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- destText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- destSearch.source = "../res/buttons/longest_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- destText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationMenuView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
deleted file mode 100644
index 4b217cf9f5..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * @file PhoneKeyboardView.qml
- * @brief Phone keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView{
- Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
-
- Item {
- function changeColorOfActiveButtons() {
- for (var i = 0; i < contactsListModel.count; i++) {
- activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
- }
- }
-
- id: phoneKeyboard
- anchors.fill: parent
-
- property var activeButtons: {
- "A": false, "B": false, "C": false, "D": false, "E": false,
- "F": false, "G": false, "H": false, "I": false, "J": false,
- "K": false, "L": false, "M": false, "N": false, "O": false,
- "P": false, "Q": false, "R": false, "S": false, "T": false,
- "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
- }
-
- ContactsListModel {
- id: contactsListModel
- }
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- Column {
- anchors.centerIn: parent
-
- Row {
- id: upperRow
- property string contentLoader : "ABCDEFGHI"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: upperRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: middleRow
- property string contentLoader : "JKLMNOPQR"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: middleRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: lowerRow
- property string contentLoader : "STUVWXYZ"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 8
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: lowerRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 20
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent}
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
deleted file mode 100644
index 5cfdc5a309..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @file PhoneMenuGridView.qml
- * @brief View for phone menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: PhoneMenuModel {}
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
deleted file mode 100644
index 83a223a18a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file SettingsSourceView.qml
- * @brief Settings source screen view.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Permissions (choose application):"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
- ScrollableListView {
- id: applicationList
- anchors.top: title.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- RequestToSDL.SDL_GetListOfPermissions(appId, function(params){
- settingsContainer.getListOfPermissions_Response(appId, params)
- });
- }
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
deleted file mode 100644
index f673327c68..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * @file RadioPlayerView.qml
- * @brief Parent for AM, FM, Sirius players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-Item {
- id: radioPlayerView
-
- property string radioType: ""
- property string radioName: ""
- property alias buttonHD: bot.children
-
- property PlayerState playerState
-
- Item {
- // top 3/4 screen
- id: upperContent
- anchors.top: parent.top
- anchors.left: parent.left
- height: parent.height * 3/4
- width: parent.width
-
- Item {
- // top part for buttons
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- OvalButton {
- text: radioName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- }
-
- OvalButton {
- anchors.right: parent.right
- anchors.top: parent.top
- text: "Tune"
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- // mid part for information about song
- id: mid
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- width: parent.width
- height: parent.height / 2
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
-
- Row {
- Text {
- id: radioChannelNameText
- color: Constants.primaryColor
- text: playerState.presets[0]
- font.pixelSize: 45
- }
- Text {
- anchors.bottom: radioChannelNameText.bottom
- color: Constants.primaryColor
- text: " " + radioType
- font.pixelSize: 25
- }
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.songName
- font.pixelSize: 25
- font.bold: true
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.albumName
- font.pixelSize: 25
- }
- }
- }
-
- Item {
- // bottom part for HD button (for FM radio)
- id: bot
- anchors.left: parent.left
- anchors.bottom: parent. bottom
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Line that divide screen in two parts
- Rectangle {
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 2
- color: Constants.primaryColor
- }
-
- PresetRow {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: playerState.presets
- width: parent.width
- onSelectedIndexChanged: {
- radioChannelNameText.text = presets[selectedIndex];
- }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
deleted file mode 100644
index 8ac6e6d9b8..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: deviceList
- property bool allowed: false
-
- function setAllowed(allowed) {
- console.debug("Set allowed", allowed, deviceList.allowed);
- deviceList.allowed = allowed;
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- menu.model.get(i).allowed = allowed;
- }
- }
-
- anchors.fill: parent
- Text {
- id: title
- text: "Choose devices to be allowed for SDL functionality:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- OvalButton {
- id: allDevice
- text: "All devices Not Allowed"
- onClicked: {
- if (parent.allowed) {
- parent.setAllowed(false);
- text = "All devices Not Allowed";
- } else {
- parent.setAllowed(true);
- text = "All devices Allowed";
- }
- settingsContainer.allowSDLFunctionality(parent.allowed, undefined);
- }
- anchors.top: title.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
-
- ScrollableListView {
- id: menu
- model: dataContainer.deviceList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: allDevice.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: (allowed) ? name + " - Allowed" :
- name + " - Not allowed"
- onClicked: {
- var item = menu.model.get(index);
- allDevice.text = "All devices manual Configuration";
- item.allowed = !item.allowed;
- settingsContainer.allowSDLFunctionality(item.allowed,
- {id: item.devid,
- name: item.name});
- deviceList.allowed = null;
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
deleted file mode 100644
index ef98ffb10d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * @file SDLNavi.qml
- * @brief SDL navigation screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtMultimedia 5.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- MultiTouchArea {
- anchors.fill: parent
- id: wholeWindow
-
- Row {
- // Top items
- id: topItems
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField1
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- anchors.top: parent.top
- width: 3/5 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField2
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- id: rightRectOfTopItems
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Column {
- // "+", "-" button at left
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- width: 1/12 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "+"
- isCustomButton: true
- customButtonID: 3
- }
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "-"
- isCustomButton: true
- customButtonID: 4
- }
- }
-
- Column {
- anchors.right: parent.right
- anchors.top: topItems.bottom
- width: 1/6 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: ""
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Row {
- // bottom items
- id: bottomItems
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Menu"
- isCustomButton: true
- customButtonID: 1
- }
- Rectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: "mainField5"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Custom Button"
- isCustomButton: true
- customButtonID: 2
- }
- }
-
- GradientRectangle {
- anchors.right: parent.right
- anchors.bottom: bottomItems.top
- anchors.bottomMargin: Constants.sdlNaviSpacing
- width: 1/6 * parent.width
- height: 1/10 * parent.height
- text: "Options"
- fontSize: Constants.fontSize
- onReleased: {
- contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
deleted file mode 100644
index 231ab03135..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * @file SDLNonMediaView.qml
- * @brief SDL non media screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: upperContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Item {
- id: topButtonRow
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- spacing: (width - 4 * elementWidth) / 3
- snapTo: elementWidth + spacing
-
- OvalButton {
- text: "Options"
- onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- }
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- id: midContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: topButtonRow.bottom
- anchors.left: parent.left
-
- Text {
- id: deviceName
- width: parent.width
- height: 1/5 * parent.height
- text: "Device: " + dataContainer.currentApplication.deviceName
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Row {
- width: parent.width
- height: 4/5 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.hmiUIText.image
- }
-
- Column {
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: Constants.margin
-
- Text {
- id: text1
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField1
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField2
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- PresetRow {
- id: presetsRow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: Internal.getArrayForPresetRow(dataContainer.currentApplication)
- width: parent.width
- property bool clickProcessed
-
- onPresetButtonPressed: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- }
-
- onPresetButtonClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
-
- onPresetButtonHold: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
- }
-
- StatusBar {
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
deleted file mode 100644
index e249a5eb76..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file SDLPlayerOptionsListView.qml
- * @brief SDL player options screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_MENU
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- ListView {
- id: sdlPlayerOptionsListView
- anchors.horizontalCenter: parent.horizontalCenter
- width:parent.width
- height:parent.height
-
- model: dataContainer.currentApplication.currentSubMenu
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
-
- MouseArea {
- anchors.fill: parent
- enabled: model.icon.value !== undefined
-
- onPressed: text.press()
- onReleased: text.release()
- onCanceled: text.release()
- onClicked: text.click()
- }
- }
-
- ClickableText {
- id: text
- text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
- width: sdlPlayerOptionsListView.width - x
- elide: Text.ElideRight
- defaultColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColor :
- Constants.primaryColor
- pressedColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColorPressed :
- Constants.primaryColorPressed
- font.pixelSize: Constants.titleFontSize
-
- function click() {
- console.debug("enter")
- switch (type) {
- case Internal.MenuItemType.MI_NODE:
- sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
- contentLoader.back()
- dataContainer.currentApplication.currentSubMenu = dataContainer.currentApplication.options
- break;
- case Internal.MenuItemType.MI_SUBMENU:
- case Internal.MenuItemType.MI_PARENT:
- dataContainer.currentApplication.currentSubMenu = subMenu
- break;
- }
- console.debug("exit")
- }
- onClicked: click()
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
deleted file mode 100644
index 4fff5aa826..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file SDLPlayerView.qml
- * @brief SDL player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- applicationContext: true
- MediaPlayer {
- id: mediaPlayer
- onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- playerName: "SDL music"
- playerType: "SDL"
- image: dataContainer.currentApplication.hmiUIText.image
- anchors.fill: parent
-
- buttons: [
- OvalButton {
- text: dataContainer.currentApplication.appName
- onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
- },
-
- OvalButton {
- text: "SDL Menu"
- onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
- },
-
- OvalButton {
- text: "Options"
- onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- },
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
deleted file mode 100644
index 0dcb7a3b32..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * @file ScrollableMessageView.qml
- * @brief Scrollable Message View.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../hmi_api/Async.js" as Async
-import "../models/Constants.js" as Constants
-import "../models"
-import "../popups"
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_HMI_OBSCURED
- onLeaveScreen: {
- timer.stop()
- dataContainer.scrollableMessageModel.running = false
- DBus.sendReply(dataContainer.scrollableMessageModel.async, { __retCode: dataContainer.scrollableMessageModel.result })
- }
- Component.onCompleted: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- dataContainer.scrollableMessageModel.running = true
- timer.start()
- }
-
- Timer {
- id: timer
- interval: dataContainer.scrollableMessageModel.timeout
- onTriggered: {
- dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
- contentLoader.back()
- }
- }
-
- Rectangle {
- anchors.fill: parent
- color: Constants.secondaryColor
-
- Item {
- // top 1/5 of screen
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/5 : 1
-
- PagedFlickable {
- id: flickRow
- width: top.width
- spacing: (width - elementWidth * 4) / 3
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- Repeater {
- model: dataContainer.scrollableMessageModel.softButtons ?
- dataContainer.scrollableMessageModel.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.scrollableMessageModel.appId
- button: dataContainer.scrollableMessageModel.softButtons.get(index)
- onKeepContext: { timer.restart() }
- onDefaultAction: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- contentLoader.back()
- }
- onStealFocus: {
- dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
- contentLoader.back()
- }
- }
- }
- }
- }
-
- Item {
- id: middle
- anchors.top: top.bottom
- anchors.left: parent.left
- anchors.bottom: bottom.top
- width: parent.width
- clip: true
-
- Flickable {
- id:flickable
- anchors.fill: middle
- flickableDirection: Flickable.VerticalFlick
- contentWidth: longMessageText.width
- contentHeight: longMessageText.height
- clip: true
-
- Text {
- id: longMessageText
- wrapMode: Text.Wrap
- width: middle.width
- text: dataContainer.scrollableMessageModel.longMessageText
- color: Constants.scrollableMessageTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- Rectangle {
- id: scrollbar
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollableMessageScrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- visible: !(flickable.visibleArea.heightRatio > 1)
- color: Constants.scrollableMessageScrollBarColor
- }
- }
- Item {
- // 1/5 bottom screen
- id: bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/5 * parent.height
- OvalButton {
- anchors.centerIn: parent
- text: "Close"
- onClicked: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- contentLoader.back()
- }
- }
- }
- }
- /**
- * Test Support Section
- *
- */
- function getTimer(){
- return timer
- }
- function getSoftButtonsListView(){
- return softButtons
- }
- function getScrollbar(){
- return scrollbar
- }
- function getTextArea(){
- return middle
- }
- function getBackButton(){
- return backButton
- }
-
- /**
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
deleted file mode 100644
index fa0bfbc821..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file SettingsSourceView.qml
- * @brief Settings source screen view.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- signal itemActivated(string item)
-
- onItemActivated: {
- switch (item) {
- case "update_sdl": RequestToSDL.SDL_UpdateSDL(settingsContainer.updateStatus); break;
- case "get_status_update": RequestToSDL.SDL_GetStatusUpdate(settingsContainer.updateStatus); break;
- case "get_urls": RequestToSDL.SDL_GetURLS(0, settingsContainer.startPTExchange); break;
- }
- }
-
- Item {
- anchors.fill: parent
- ScrollableListView {
- id: menu
- model: dataContainer.settingsSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: title
- onReleased: {
- if (qml) {
- contentLoader.go(qml, appId);
- } else {
- itemActivated(action);
- }
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
deleted file mode 100644
index b79cddf8cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
+++ /dev/null
@@ -1,293 +0,0 @@
-/**
- * @file SimulationView.qml
- * @brief Area of screen responsible for simulation actions
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../popups"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- width: controlArea.width + controlArea.anchors.margins
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.panelColor
-
- Item {
- id: showArea
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
-
- ExitAllApplicationsPopup {
- id: exitAllApplicationsPopup
- anchors.fill: parent
- visible: false
- }
-
- VehicleInfoPopUp {
- id: viPopUp
- anchors.fill: parent
- }
-
- TBTClientStatePopUp {
- id: tbtClientStatePopUp
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: controlArea
- anchors.bottom: parent.bottom
- anchors.margins: Constants.panelPadding
- anchors.horizontalCenter: parent.horizontalCenter
- width: table.width
-
- ListModel {
- id: languagesList
-
- Component.onCompleted: {
- for (var name in Common.Language) {
- if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
- append({name: name.replace('_', '-')});
- }
- }
- }
- }
-
- Text {
- id: label
- text: "Languages"
- color: Constants.panelTextColor
- anchors.bottom: table.top
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Grid {
- id: table
- spacing: 5
- columns: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: globalProperties.top
-
- Text {
- text: "HMI UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "HMI TTS + VR"
- color: Constants.panelTextColor
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
- }
- z: 1000
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- }
- z: 1000
- }
-
- Text {
- text: "Application UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "Application TTS + VR"
- color: Constants.panelTextColor
- }
-
- Text {
- id: uiLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
- uiLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- Text {
- id: ttsLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
- ttsLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- PushButton {
- id: vehicleInfo
- label: "Vehicle info"
- toggleMode: true
- onPressed: {
- viPopUp.show();
- }
- onUnpressed: {
- viPopUp.hide();
- }
- }
-
- PushButton {
- id: tbtClientState
- label: "TBT Client state"
- toggleMode: true
- onPressed: {
- tbtClientStatePopUp.show();
- }
- onUnpressed: {
- tbtClientStatePopUp.hide();
- }
- }
-
- PushButton {
- label: "Exit application"
- onClicked: {
- if (dataContainer.applicationContext) {
- sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
- }
- }
- }
-
- PushButton {
- id: exitAllAppsButton
- label: "Exit all apps"
- toggleMode: true
- onPressed: {
- exitAllApplicationsPopup.show()
-
- }
- onUnpressed: {
- exitAllApplicationsPopup.hide()
- }
- Connections {
- target: exitAllApplicationsPopup
- onVisibleChanged: {
- if (!exitAllApplicationsPopup.visible) {
- exitAllAppsButton.state = "unpressed"
- }
- }
- }
- }
-
- CheckBox {
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: "Use URL"
- }
- }
- }
-
- CheckBox {
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: "DD"
- }
- }
- onClicked: {
- if (checked) {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_ON;
- } else {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_OFF;
- }
- }
- }
- }
-
- Rectangle {
- id: globalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- height: listGlobalProperties.height + Constants.panelPadding
- border.color: Constants.panelTextColor
- border.width: 1
- color: Constants.panelColor
- Column {
- id: listGlobalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.panelPadding / 4
- Text {
- text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
- color: Constants.panelTextColor
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
deleted file mode 100644
index e5d2149542..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file SiriusPlayerView.qml
- * @brief Sirius player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../controls"
-
-GeneralView {
- RadioPlayer {
- id: siriusRadioPlayer
- anchors.fill: parent
- radioType: ""
- radioName: "Sirius"
-
- playerState: dataContainer.siriusPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
deleted file mode 100644
index 75f76249d5..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Statistics Info:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: statisticsTypeList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: sdlSDL.addStatisticsInfo(Common.StatisticsType[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: statisticsTypeList
-
- Component.onCompleted: {
- for (var name in Common.StatisticsType) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
deleted file mode 100644
index 058282ae00..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "System Error:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: systemErrorList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: sdlSDL.onSystemError(Common.SystemError[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: systemErrorList
-
- Component.onCompleted: {
- for (var name in Common.SystemError) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
deleted file mode 100644
index 32a3987e74..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "System Request:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: requestTypeList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: settingsContainer.systemRequest(Common.RequestType[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: requestTypeList
-
- Component.onCompleted: {
- for (var name in Common.RequestType) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
deleted file mode 100644
index a69a86a40a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * @file TurnByTurnView.qml
- * @brief View for TurnByTurn.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: turnByTurnView
- anchors.fill: parent
-
- Item {
- // top 3/4 of screen
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 3/4
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (width - 4 * elementWidth) / 3
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
-
- OvalButton {
- id: turnListButton
- text: "TurnList"
- onClicked: {
- console.log("Go to TurnListView");
- contentLoader.go("./views/TurnListView.qml");
- }
- }
-
- Repeater {
- model: dataContainer.currentApplication.navigationSoftButtons ?
- dataContainer.currentApplication.navigationSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.navigationSoftButtons.get(index)
- }
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 3/4 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Icon {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.navigationModel.turnIcon
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - 5 * navText1.height) / 4
-
- Text {
- id: navText1
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.currentApplication.navigationModel.text1
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.text1
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.currentApplication.navigationModel.text2
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.text2
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Total distance: " + dataContainer.currentApplication.navigationModel.totalDistance
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.totalDistance
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.currentApplication.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.timeToDestination
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "ETA: " + dataContainer.currentApplication.navigationModel.eta
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.eta
- }
- }
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- height: 1/4 * parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- id: coveredDistance
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: dataContainer.currentApplication.navigationModel.distanceToManeuver /
- dataContainer.currentApplication.navigationModel.distanceToManeuverScale * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: parent.width - coveredDistance.width
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
deleted file mode 100644
index bdd0b3d6cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file TurnListView.qml
- * @brief View for TurnByTurn list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.left: parent.left
- anchors.top: parent.top
- width: parent.width
- height: 3/4 * parent.height
-
- Item {
- id: sotfButtons
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- Repeater {
- model: dataContainer.currentApplication.turnListSoftButtons ?
- dataContainer.currentApplication.turnListSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.turnListSoftButtons.get(index)
- }
- }
- }
- }
-
- ScrollableListView {
- id: scrollableList
- anchors.top: sotfButtons.bottom
- anchors.left: parent.left
- width: parent.width
- height: 3/4 * parent.height
-
- model: dataContainer.currentApplication.turnList
-
- delegate:
- ListItem {
- width: scrollableList.width
- height: Constants.iconItemListSize
- text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
- fontSize: Constants.fontSize
- icon: dataContainer.currentApplication.turnList.get(index).turnIcon
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- id: back
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
deleted file mode 100644
index f8a2d39806..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file UsbPlayerView.qml
- * @brief USB player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: usbPlayer
- playerName: "USB"
- anchors.fill: parent
- playerState: dataContainer.usbPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: usbPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
deleted file mode 100644
index 6228b63c79..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * @file WarningInfo.qml
- * @brief Screen with warning information.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: warningInfo
- anchors.fill: parent
- color: Constants.secondaryColor
- Text {
- anchors.top: parent.top
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- text: "WARNING!"
- color: Constants.warningColor
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- style: Text.Raised
- styleColor: "gray"
- }
-
- Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.margin
- height: 1/2 * parent.height
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.WordWrap
-
- text: "This application is intended to be used as a demonstrative aid only, "
- + "while the vehicle is parked. Don't use it while driving. <br /><br />"
- + "Use extreme caution when using any device that takes your attention off the road. "
- + "Ford recommends against the use of any hand-held device while driving and that you comply "
- + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
- color: "white"
- font.pixelSize: 25
- font.bold: true
- }
-
- function showOkButton() {
- okButtonAnimation.start()
- }
-
- Item {
- id: ok
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- opacity: 0
-
- SequentialAnimation
- {
- id: okButtonAnimation
- // Decrease this value while debugging
- PauseAnimation { duration: Constants.warningScreenDuration }
- NumberAnimation {
- target: ok
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
-
- Image {
- id: okButton
- anchors.centerIn: parent
- source: "../res/buttons/longest_oval_btn.png"
-
- Text {
- id: text
- anchors.centerIn: parent
- text: "OK"
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/longest_oval_btn_pressed.png"
- text.color = Constants.secondaryColor
- }
- onReleased: {
- parent.source = "../res/buttons/longest_oval_btn.png"
- text.color = Constants.primaryColor
- }
- onClicked: {
- console.log("WarningInfo OkButton - on clicked enter");
- warningInfo.visible = false
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_plugins/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/CMakeLists.txt
deleted file mode 100644
index 6ff595315c..0000000000
--- a/src/components/qt_hmi/qml_plugins/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-# --- DBus plugin
-add_subdirectory(./dbus_adapter)
-
-# --- Hmi Framework plugin
-add_subdirectory(./hw_buttons)
-
-# --- Log4cxx plugin
-add_subdirectory(./log4cxx)
-
-# --- NamedPipeNotifier plugin
-add_subdirectory(./named_pipe_notifier)
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
deleted file mode 100644
index 53d1144356..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_cpp.py)
-set(codegen_request_to_sdl ${codegen_dir}/make_request_to_sdl.py)
-set(codegen_hmi_requests ${codegen_dir}/make_hmi_requests.py)
-set(codegen_notification_qml ${codegen_dir}/make_notifications_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
- COMMAND python ${codegen_request_to_sdl} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_request_to_sdl} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc
- ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
- COMMAND python ${codegen_hmi_requests} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_hmi_requests} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
- COMMAND python ${codegen_notification_qml} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_notification_qml} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
- from:
- ${api_xml} ..."
-)
-
-set(target DbusAdapter)
-set(destination com/ford/sdl/hmi/dbus_adapter)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- dbus_plugin.cc
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
- moc_qml_dbus.cpp
- sdl_proxy.cc
- moc_sdl_proxy.cpp
- hmi_proxy.cc
- stream_qvariant.cc
- moc_qml_dbus.cpp
- dbus_controller.cc
- request_to_sdl.cc
- moc_request_to_sdl.cpp
- hmi_requests.cc
- moc_hmi_requests.cpp
-)
-include_directories(
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}/src/components
- ${CMAKE_SOURCE_DIR}/src/components/utils/include/
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
- qt4_use_modules(${target} Core DBus Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
- qt5_use_modules(${target} Core DBus Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-target_link_libraries(${target} Utils)
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.dbus_adapter 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null || true
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
deleted file mode 100644
index 60f07783a9..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * \file dbus_controller.cpp
- * \brief DbusController class.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus_controller.h"
-#include "interfaces/QT_HMI_API.h"
-#include <QtDBus/QDBusConnection>
-
-DBusController::DBusController(QObject* parent)
- : QObject(parent), message(NULL) {}
-
-void DBusController::addMessage(const QDBusMessage& message,
- fillRoutine fill,
- int async_uid) {
- delayedReply reply;
- reply.message = message;
- reply.fill = fill;
- replies_[async_uid] = reply;
-}
-
-void DBusController::sendReply(QVariant asyncObject, QVariant data) {
- int uid = asyncObject.toMap()["__async_uid"].toInt();
- std::map<int, delayedReply>::iterator it = replies_.find(uid);
- if (it != replies_.end()) {
- QDBusMessage msg = it->second.message.createReply();
- if (!it->second.fill(msg, data.toMap())) {
- QDBusConnection::sessionBus().send(it->second.message.createErrorReply(
- QDBusError::InternalError,
- QString::number(hmi_apis::Common_Result::INVALID_DATA)));
- } else {
- QDBusConnection::sessionBus().send(msg);
- }
- replies_.erase(it);
- }
-}
-
-void DBusController::sendReply(QVariant data) {
- if (!message)
- return;
- QDBusMessage msg = message->createReply();
- if (!fill(msg, data.toMap())) {
- QDBusConnection::sessionBus().send(message->createErrorReply(
- QDBusError::InternalError,
- QString::number(hmi_apis::Common_Result::INVALID_DATA)));
- } else {
- QDBusConnection::sessionBus().send(msg);
- }
-}
-
-void DBusController::sendError(QVariant asyncObject,
- QVariant code,
- QVariant message) {
- int uid = asyncObject.toMap()["__async_uid"].toInt();
- std::map<int, delayedReply>::iterator it = replies_.find(uid);
- if (it != replies_.end()) {
- QDBusMessage msg = it->second.message.createErrorReply(code.toString(),
- message.toString());
- QDBusConnection::sessionBus().send(msg);
- replies_.erase(it);
- }
-}
-
-void DBusController::sendError(QVariant asyncObject, QVariant code) {
- sendError(asyncObject, code, QVariant(""));
-}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
deleted file mode 100644
index 937bab5f90..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * \file dbus_controller.h
- * \brief DbusController class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
-
-#include <QtDBus/QDBusMessage>
-#include <QtCore/QObject>
-#include <map>
-
-typedef bool (*fillRoutine)(QDBusMessage&, const QVariantMap&);
-
-class DBusController : public QObject {
- struct delayedReply {
- QDBusMessage message;
- fillRoutine fill;
- };
- Q_OBJECT
-
- public:
- explicit DBusController(QObject* parent = 0);
- void addMessage(const QDBusMessage& message, fillRoutine fill, int async_uid);
- Q_INVOKABLE void sendReply(QVariant asyncObject, QVariant data);
- Q_INVOKABLE void sendReply(QVariant data);
- Q_INVOKABLE void sendError(QVariant asyncObject, QVariant code);
- Q_INVOKABLE void sendError(QVariant asyncObject,
- QVariant code,
- QVariant message);
- const QDBusMessage* message;
- fillRoutine fill;
-
- private:
- std::map<int, delayedReply> replies_;
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
deleted file mode 100644
index 5cc4dadb1e..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * \file dbus_plugin.cpp
- * \brief DbusPlugin class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dbus_plugin.h"
-
-#include "hmi_proxy.h"
-#include "sdl_proxy.h"
-#include "optional_argument.h"
-#include "qml_dbus.h"
-#include "dbus_controller.h"
-#include "request_to_sdl.h"
-
-#include <log4cxx/logger.h>
-#include <log4cxx/propertyconfigurator.h>
-
-#include <QtCore/QString>
-#include <QtDBus/QDBusConnection>
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeListReference>
-#include <QtDeclarative/QDeclarativeEngine>
-#elif QT_5
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlListReference>
-#include <QtQml/QQmlEngine>
-#endif // QT_VERSION
-log4cxx::LoggerPtr logger_ =
- log4cxx::LoggerPtr(log4cxx::Logger::getLogger("DBusPlugin"));
-
-void DbusPlugin::registerTypes(const char* uri) {
- log4cxx::PropertyConfigurator::configure("log4cxx.properties");
-
- // @uri sdl.core.api
- qmlRegisterType<HmiProxy>(uri, 1, 0, "HMIAdapter");
- qmlRegisterType<SdlProxy>(uri, 1, 0, "SDLAdapter");
-
- RegisterDbusMetatypes();
- qDBusRegisterMetaType<OptionalArgument<int> >();
- qDBusRegisterMetaType<OptionalArgument<QList<int> > >();
- qDBusRegisterMetaType<OptionalArgument<QString> >();
- qDBusRegisterMetaType<OptionalArgument<QStringList> >();
- qDBusRegisterMetaType<OptionalArgument<bool> >();
- qDBusRegisterMetaType<OptionalArgument<QList<bool> > >();
- qDBusRegisterMetaType<OptionalArgument<double> >();
- qDBusRegisterMetaType<OptionalArgument<QList<double> > >();
-
- HmiProxy::api_adaptors_.Init(this);
-
- QDBusConnection::sessionBus().registerObject("/", this);
- QDBusConnection::sessionBus().registerService("com.ford.sdl.hmi");
-
- dbusController_ = new DBusController();
- requestToSDL_ = new RequestToSDL();
-
- HmiProxy::api_adaptors_.SetDBusController(dbusController_);
-}
-
-void DbusPlugin::initializeEngine(Engine* engine, const char* uri) {
- engine->rootContext()->setContextProperty("DBus", dbusController_);
- engine->rootContext()->setContextProperty("RequestToSDL", requestToSDL_);
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(DbusAdapter, DbusPlugin)
-#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
deleted file mode 100644
index 2b5bba6235..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * \file dbus_plugin.h
- * \brief DbusPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-typedef QDeclarativeEngine Engine;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-typedef QQmlEngine Engine;
-#endif // QT_VERSION
-#include <QtDBus/QDBusContext>
-
-class DBusController;
-class RequestToSDL;
-
-class DbusPlugin : public ExtensionPlugin, public QDBusContext {
- Q_OBJECT
-
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- DBusController* dbusController_;
- RequestToSDL* requestToSDL_;
-
- public:
- void registerTypes(const char* uri);
- void initializeEngine(Engine* engine, const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
deleted file mode 100644
index e196e5c5de..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * \file hmiproxy.cpp
- * \brief HmiProxy class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "hmi_proxy.h"
-#include <QtDBus/QDBusConnection>
-
-ApiAdaptors HmiProxy::api_adaptors_;
-
-HmiProxy::HmiProxy(Item* parent) : Item(parent) {}
-
-void HmiProxy::componentComplete() {
- Item::componentComplete();
- api_adaptors_.SetApi(this);
-}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
deleted file mode 100644
index d7277d017b..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * \file hmiproxy.h
- * \brief HmiProxy class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
-
-#include "qt_version.h"
-#include "qml_dbus.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-#endif // QT_VERSION
-
-class HmiProxy : public Item {
- Q_OBJECT
- Q_DISABLE_COPY(HmiProxy)
-
- public:
- explicit HmiProxy(Item* parent = 0);
- static ApiAdaptors api_adaptors_;
-
- protected:
- virtual void componentComplete();
-};
-
-QML_DECLARE_TYPE(HmiProxy)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
deleted file mode 100644
index b127cea1a8..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
-
-#include <QMetaType>
-
-template <typename T>
-QMetaType::Type metatype();
-
-template <>
-inline QMetaType::Type metatype<int>() {
- return QMetaType::Int;
-}
-
-template <>
-inline QMetaType::Type metatype<QString>() {
- return QMetaType::QString;
-}
-
-template <>
-inline QMetaType::Type metatype<bool>() {
- return QMetaType::Bool;
-}
-
-template <>
-inline QMetaType::Type metatype<double>() {
- return QMetaType::Double;
-}
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
deleted file mode 100644
index ea6f68bb31..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * \file optional_argument.h
- * \brief OptionalArgument struct header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
-
-#include "qt_version.h"
-#include <QtDBus/QDBusArgument>
-
-template <class T>
-struct OptionalArgument {
- T val;
- bool presence;
- explicit OptionalArgument(const T& value) : val(value), presence(true) {}
- OptionalArgument() : presence(false) {}
-};
-
-template <class T>
-inline QDBusArgument& operator<<(QDBusArgument& arg,
- const OptionalArgument<T>& o) {
- arg.beginStructure();
- arg << o.presence << o.val;
- arg.endStructure();
- return arg;
-}
-
-template <class T>
-inline const QDBusArgument& operator>>(const QDBusArgument& arg,
- OptionalArgument<T>& o) {
- arg.beginStructure();
- arg >> o.presence >> o.val;
- arg.endStructure();
- return arg;
-}
-
-template <class T>
-inline bool VariantToValue(const QVariant& variant, OptionalArgument<T>& o) {
- if (variant.isNull()) {
- o.presence = false;
- return true;
- }
- o.presence = true;
- return VariantToValue(variant, o.val);
-}
-
-#if QT_4
-Q_DECLARE_METATYPE(QList<int>)
-#endif // QT_4
-
-Q_DECLARE_METATYPE(OptionalArgument<int>)
-Q_DECLARE_METATYPE(OptionalArgument<QString>)
-Q_DECLARE_METATYPE(OptionalArgument<bool>)
-Q_DECLARE_METATYPE(OptionalArgument<double>)
-
-Q_DECLARE_METATYPE(OptionalArgument<QList<int> >)
-Q_DECLARE_METATYPE(OptionalArgument<QStringList>)
-Q_DECLARE_METATYPE(OptionalArgument<QList<bool> >)
-Q_DECLARE_METATYPE(OptionalArgument<QList<double> >)
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
deleted file mode 100644
index fa9692f9d9..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * \file qml_dbus_common.h
- * \brief Contain utilities for DBus plugin.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
-
-#include <QtDBus/QDBusContext>
-#include "optional_argument.h"
-#include "stream_qvariant.h"
-#include "metatype.h"
-
-enum ErrorCode {
- Success = 0,
- UnsupportedRequest,
- UnsupportedResource,
- Disallowed,
- Rejected,
- Aborted,
- Ignored,
- Retry,
- InUse,
- DataNotAvailable,
- TimedOut,
- InvalidData,
- CharLimitExceeded,
- InvalidId,
- DuplicateName,
- ApplicationNotRegistered,
- WrongLanguage,
- OutOfMemory,
- TooManyPendingRequests,
- NoAppsRegistered,
- NoDevicesConnected,
- Warnings,
- GenericError,
- UserDisallowed
-};
-
-inline void RaiseDbusError(QObject* adaptor, int code, const QString& message) {
- QDBusContext* context = dynamic_cast<QDBusContext*>(adaptor->parent());
- if (context) {
- context->sendErrorReply(QString::number(static_cast<int>(code)), message);
- }
-}
-
-inline void RaiseDbusError(QObject* adaptor, int code) {
- RaiseDbusError(adaptor, code, "");
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map, const char* name, const T& v) {
- map.insert(name, QVariant::fromValue(v));
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, int& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::Int)
- return false;
- v = it->toInt();
- return true;
-}
-
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- QString& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::String)
- return false;
- v = it->toString();
- return true;
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, bool& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::Bool)
- return false;
- v = it->toBool();
- return true;
-}
-
-inline bool isNumber(QVariant v) {
- QVariant::Type t = v.type();
- return (t == QVariant::Double) || (t == QVariant::Int) ||
- (t == QVariant::UInt) || (t == QVariant::LongLong) ||
- (t == QVariant::ULongLong);
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, double& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (!isNumber(*it))
- return false;
- v = it->toDouble();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, int& v) {
- if (variant.type() != QVariant::Int)
- return false;
- v = variant.toInt();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, QString& v) {
- if (variant.type() != QVariant::String)
- return false;
- v = variant.toString();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, bool& v) {
- if (variant.type() != QVariant::Bool)
- return false;
- v = variant.toBool();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, double& v) {
- if (variant.type() != QVariant::Double)
- return false;
- v = variant.toDouble();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, QStringList& v) {
- if (variant.type() != QVariant::List)
- return false;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- if (i->type() != QVariant::String)
- return false;
- v.append(i->toString());
- }
- return true;
-}
-
-template <typename T>
-bool VariantToValue(const QVariant& variant, QList<T>& v) {
- if (variant.type() != QVariant::List)
- return false;
- QList<T> spare;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- QVariant::Type type = i->type();
- // Although this function is declared as returning QVariant::Type(obsolete),
- // the return value should be interpreted as QMetaType::Type.
- // (http://qt-project.org/doc/qt-5.0/qtcore/qvariant.html#type)
- QMetaType::Type type_casted = static_cast<QMetaType::Type>(type);
- if (type_casted != metatype<T>()) {
- return false;
- }
- spare.append(i->value<T>());
- }
- v.swap(spare);
- return true;
-}
-
-template <typename T>
-inline QVariant ValueToVariant(const T& v) {
- return QVariant::fromValue(v);
-}
-
-template <typename T>
-inline QVariant ValueToVariant(const QList<T>& v) {
- QList<QVariant> list;
- for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
- list.append(ValueToVariant(*i));
- return QVariant::fromValue(list);
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map, const char* name, const QList<T>& v) {
- QList<QVariant> list;
- for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
- list.append(ValueToVariant(*i));
- map.insert(name, QVariant::fromValue(list));
-}
-
-template <typename T>
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- QList<T>& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- const QVariant& variant = *it;
- if (variant.type() != QVariant::List)
- return false;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- T t;
- bool ok = VariantToValue(*i, t);
- if (!ok)
- return false;
- v.append(t);
- }
- return true;
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map,
- const char* name,
- const OptionalArgument<T>& v) {
- if (v.presence)
- map.insert(name, ValueToVariant(v.val));
-}
-
-template <typename T>
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- OptionalArgument<T>& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it || !it->isValid()) {
- v.presence = false;
- return true;
- }
- v.presence = true;
- return GetArgFromMap(map, name, v.val);
-}
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir b/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
deleted file mode 100644
index 5f426d357d..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.dbus_adapter
-plugin DbusAdapter
-
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
deleted file mode 100644
index c41eea7403..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
deleted file mode 100644
index ec049b9533..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "stream_qvariant.h"
-
-std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
- const QVariant& value) {
- switch (value.type()) {
- case QVariant::Map: {
- os << "{ ";
- QVariantMap structure = value.toMap();
- QMapIterator<QString, QVariant> i(structure);
- while (i.hasNext()) {
- i.next();
- os << i.key() << ":" << i.value();
- if (i.hasNext()) {
- os << ", ";
- }
- }
- os << " }";
- } break;
- case QVariant::List: {
- os << "[ ";
- QVariantList array = value.toList();
- QListIterator<QVariant> i(array);
- while (i.hasNext()) {
- os << i.next();
- if (i.hasNext()) {
- os << ", ";
- }
- }
- os << " ]";
- } break;
- default:
- os << value.toString().toLatin1().data();
- }
-
- return os;
-}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
deleted file mode 100644
index 0d0e279b87..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
-
-#include <QtCore/QVariant>
-#include <sstream>
-
-std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
- const QVariant& value);
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
deleted file mode 100644
index 56a64b48b3..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target HWButtons)
-set(destination com/ford/sdl/hmi/hw_buttons)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- attributed_mouse_event.cc
- hmi_hwbuttons.cc
- masked_container.cc
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Gui Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml Quick)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.hw_buttons 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
deleted file mode 100644
index 899fc5b615..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * \file attributed_mouse_event.cpp
- * \brief AttributedMouseEvent class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "attributed_mouse_event.h"
-
-Item* AttributedMouseEvent::item() const {
- return item_;
-}
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
deleted file mode 100644
index 0486397058..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * \file attributed_mouse_event.h
- * \brief AttributedMouseEvent class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
-
-#include "qt_version.h"
-
-#include <QtCore/QObject>
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-#endif // QT_VERSION
-
-class AttributedMouseEvent : public QObject {
- Q_OBJECT
- Q_PROPERTY(Item* item READ item)
-
- public:
- explicit AttributedMouseEvent(Item* item) : item_(item) {}
-
- Item* item() const;
-
- private:
- Item* item_;
- Q_DISABLE_COPY(AttributedMouseEvent)
-};
-
-QML_DECLARE_TYPE(AttributedMouseEvent)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
deleted file mode 100644
index 62a090a509..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * \file hmi_hwbuttons.cpp
- * \brief HmiHWButtons class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "hmi_hwbuttons.h"
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#include <QtGui/QGraphicsColorizeEffect>
-#elif QT_5
-#include <QtQml>
-#endif // QT_VERSION
-
-#include "masked_container.h"
-#include "attributed_mouse_event.h"
-
-void HmiHWButtons::registerTypes(const char* uri) {
- // @uri com.ford.hmi_framework
- qmlRegisterType<MaskedContainer>(uri, 1, 0, "MaskedContainer");
- qmlRegisterType<AttributedMouseEvent>();
-#if QT_4
- qmlRegisterType<QGraphicsColorizeEffect>(uri, 1, 0, "Colorize");
-#endif // QT_4
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(HWButtons, HmiHWButtons)
-#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
deleted file mode 100644
index 0cf71807c4..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * \file hmi_hwbuttons.h
- * \brief HmiHWButtons class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_VERSION
-
-class HmiHWButtons : public ExtensionPlugin {
- Q_OBJECT
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
deleted file mode 100644
index f80e80907e..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * \file masked_container.cpp
- * \brief MaskedContainer class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "masked_container.h"
-
-#if QT_4
-#include <QtCore/QPointF>
-#include <QtGui/QGraphicsSceneMouseEvent>
-#define IMAGE "QDeclarativeImage"
-#elif QT_5
-#include <QtGui/QImage>
-#include <QtCore/QEvent>
-#define IMAGE "QQuickImage"
-#endif // QT_VERSION
-
-MaskedContainer::MaskedContainer(Item* parent) : Item(parent), mask_(NULL) {
- setAcceptedMouseButtons(Qt::LeftButton);
-}
-
-void MaskedContainer::componentComplete() {
- Item::componentComplete();
-
- for (QObjectList::ConstIterator it = children().begin();
- it != children().end();
- ++it) {
- Item* item = qobject_cast<Item*>(*it);
- if (item && item->inherits(IMAGE) && item->isVisible()) {
- images_.push_back(item);
- }
- }
-
- int height = this->height();
- int width = this->width();
-
- for (size_t i = 0; i < images_.size(); ++i) {
- Item* item = images_[i];
- int itemWidth = item->width();
- int itemHeight = item->height();
- int itemX = item->x();
- int itemY = item->y();
- if (height < itemHeight + itemY)
- height = itemHeight + itemY;
- if (width < itemWidth + itemX)
- width = itemWidth + itemX;
- }
-
- setHeight(height);
- setWidth(width);
-
- mask_ = new int[height * width];
- std::fill(mask_, mask_ + height * width, -1);
-
- for (size_t i = 0; i < images_.size(); ++i) {
- Item* item = images_[i];
- int itemWidth = item->width();
- int itemHeight = item->height();
- int itemX = item->x();
- int itemY = item->y();
-
- QUrl url = item->property("source").toUrl();
- QImage img(url.path());
- const QRgb* bits = reinterpret_cast<const QRgb*>(img.constBits());
- for (int x = 0; x < itemWidth; ++x) {
- for (int y = 0; y < itemHeight; ++y) {
- if (qAlpha(bits[y * itemWidth + x]) > 128) {
- mask_[(itemY + y) * width + (x + itemX)] = i;
- }
- }
- }
- }
-}
-
-void MaskedContainer::mousePressEvent(MouseEvent* mouse) {
-#if QT_4
- qreal x = mouse->pos().x();
- qreal y = mouse->pos().y();
-#elif QT_5
- int x = mouse->x();
- int y = mouse->y();
-#endif // QT_VERSION
-
- if (width() * y + x > width() * height()) {
- mouse->ignore();
- } else {
- int idx = mask_[indexOfMask(x, y)];
- if (idx >= 0) {
- AttributedMouseEvent ev(images_[idx]);
- emit pressed(&ev);
- grabMouse();
- mouse->accept();
- } else {
- mouse->ignore();
- }
- }
-}
-
-void MaskedContainer::mouseReleaseEvent(MouseEvent* mouse) {
-#if QT_4
- qreal x = mouse->pos().x();
- qreal y = mouse->pos().y();
-#elif QT_5
- int x = mouse->x();
- int y = mouse->y();
-#endif // QT_VERSION
-
- if (width() * y + x > width() * height()) {
- return;
- } else {
- int idx = mask_[indexOfMask(x, y)];
- if (idx >= 0) {
- AttributedMouseEvent ev(images_[idx]);
- emit released(&ev);
- } else {
- emit released(NULL);
- }
- }
- ungrabMouse();
-}
-
-MaskedContainer::~MaskedContainer() {
- delete[] mask_;
-}
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
deleted file mode 100644
index ae5303a693..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * \file masked_container.h
- * \brief MaskedContainer class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
-
-#include <vector>
-#include <QtCore/QString>
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-typedef QGraphicsSceneMouseEvent MouseEvent;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-typedef QMouseEvent MouseEvent;
-#endif
-
-#include "attributed_mouse_event.h"
-
-class MaskedContainer : public Item {
- Q_OBJECT
- Q_DISABLE_COPY(MaskedContainer)
-
- public:
- explicit MaskedContainer(Item* parent = 0);
- ~MaskedContainer();
-
-signals:
- void pressed(AttributedMouseEvent* attr);
- void released(AttributedMouseEvent* attr);
-
- protected:
- virtual void componentComplete();
- virtual void mousePressEvent(MouseEvent* event);
- virtual void mouseReleaseEvent(MouseEvent* event);
-
- private:
- std::vector<Item*> images_;
- int* mask_;
-
-#if QT_4
- int indexOfMask(qreal x, qreal y) const {
- return static_cast<int>(y * width() + x);
- }
-#elif QT_5
- int indexOfMask(int x, int y) const {
- return y * static_cast<int>(width()) + x;
- }
-#endif // QT_VERSION
-};
-
-QML_DECLARE_TYPE(MaskedContainer)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir b/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
deleted file mode 100644
index a4bae8144b..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.hw_buttons
-plugin HWButtons
-
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h b/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
deleted file mode 100644
index a700a87919..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
deleted file mode 100644
index 1a5baadaa9..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target QmlLog4cxx)
-set(destination com/ford/sdl/hmi/log4cxx)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-include_directories(
- ${LOG4CXX_INCLUDE_DIRECTORY}
-)
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES log4cxx_plugin.cc)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND LD_LIBRARY_PATH=${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.log4cxx 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
deleted file mode 100644
index 8b7efe23d7..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * @file log4cxx_plugin.cpp
- * @brief Log4cxxPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "log4cxx_plugin.h"
-
-#include <log4cxx/log4cxx.h>
-#include <log4cxx/propertyconfigurator.h>
-
-log4cxx::LoggerPtr logger_ =
- log4cxx::LoggerPtr(log4cxx::Logger::getLogger("Log4cxxPlugin"));
-
-#if QT_4
-void smartLogger(QtMsgType type, const char* msg) {
- log4cxx::spi::LocationInfo location("", "", -1);
-
- switch (type) {
- case QtDebugMsg:
- (*logger_).debug(msg, location);
- break;
- case QtWarningMsg:
- (*logger_).warn(msg, location);
- break;
- case QtCriticalMsg:
- (*logger_).error(msg, location);
- break;
- case QtFatalMsg:
- (*logger_).fatal(msg, location);
- break;
- default:
- (*logger_).info(msg, location);
- break;
- }
-}
-#elif QT_5
-void smartLogger(QtMsgType type,
- const QMessageLogContext& context,
- const QString& msg) {
- log4cxx::spi::LocationInfo location(
- context.file, context.function ? context.function : "", context.line);
- switch (type) {
- case QtDebugMsg:
- (*logger_).debug(msg.toStdString(), location);
- break;
- case QtWarningMsg:
- (*logger_).warn(msg.toStdString(), location);
- break;
- case QtCriticalMsg:
- (*logger_).error(msg.toStdString(), location);
- break;
- case QtFatalMsg:
- (*logger_).fatal(msg.toStdString(), location);
- break;
- default:
- (*logger_).info(msg.toStdString(), location);
- break;
- }
-}
-#endif // QT_VERSION
-
-void Log4cxxPlugin::registerTypes(const char* uri) {
- log4cxx::PropertyConfigurator::configure("log4cxx.properties");
-
-#if QT_4
- qInstallMsgHandler(smartLogger);
-#elif QT_5
- qInstallMessageHandler(smartLogger);
-#endif // QT_VERSION
-
- // @uri com.ford.sdl.hmi.log4cxx
- qmlRegisterType<Logger>(uri, 1, 0, "Logger");
- // Use standart console API Javascript
- // See Debugging QML Applications in Qt documentation
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(QmlLog4cxx, Log4cxxPlugin)
-#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
deleted file mode 100644
index e8d1ff3347..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * @file log4cxx_plugin.h
- * @brief Log4cxxPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/qqml.h>
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_VERSION
-
-class Logger : public QObject {
- Q_OBJECT
- Q_DISABLE_COPY(Logger)
-
- public:
- explicit Logger(QObject* parent = 0) : QObject(parent) {}
-};
-
-class Log4cxxPlugin : public ExtensionPlugin {
- Q_OBJECT
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-QML_DECLARE_TYPE(Logger)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/qmldir b/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
deleted file mode 100644
index ddd7bc99a5..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.log4cxx
-plugin QmlLog4cxx
-
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
deleted file mode 100644
index e777e95263..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target NamedPipeNotifier)
-set(destination com/ford/sdl/hmi/named_pipe_notifier)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- named_pipe_notifier.cc
- named_pipe_notifier_plugin.cc
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.named_pipe_notifier 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
deleted file mode 100644
index 46b057dcca..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * @file named_pipe_notifier.cc
- * @brief NamedPipeNotifier class implementation file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-#include "named_pipe_notifier.h"
-
-void NamedPipeNotifier::run() {
- int fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY);
- if (-1 == fd) { // if open() fails
- if ((errno != ENOENT) // we can only manage lack of pipe
- ||
- (-1 == ::mkfifo(name_.toLocal8Bit().constData(), 0666)) ||
- (-1 == (fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY)))) {
- emit openFailed();
- return;
- }
- }
- ::fd_set readfds;
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
- // this select() is supposed to block till pipe is empty
- if (::select(fd + 1, &readfds, 0, 0, 0) > 0) {
- emit readyRead();
- }
-}
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
deleted file mode 100644
index cdca06466f..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * \file named_pipe_notifier.h
- * \brief NamedPipeNotifier class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
-
-#include <QThread>
-
-class NamedPipeNotifier : public QThread {
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE set_name NOTIFY nameChanged)
- QString name_;
-
- public:
- explicit NamedPipeNotifier(QObject* parent = 0) : QThread(parent) {}
-
- const QString& name() const {
- return name_;
- }
- void set_name(const QString& name) {
- if (name_ != name) {
- name_ = name;
- emit nameChanged();
- }
- }
-
- protected:
- virtual void run();
-
-signals:
- void nameChanged();
- void readyRead();
- void openFailed();
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
deleted file mode 100644
index dacb11ad93..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * \file named_pipe_notifier_plugin.cc
- * \brief NamedPipeNotifierPlugin class implementation file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "named_pipe_notifier_plugin.h"
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#elif QT_5
-#include <QtQml/qqml.h>
-#endif // QT_VERSION
-
-#include "named_pipe_notifier.h"
-
-void NamedPipeNotifierPlugin::registerTypes(const char* uri) {
- // @uri com.ford.sdl.hmi.named_pipe_notifier
- qmlRegisterType<NamedPipeNotifier>(uri, 1, 0, "NamedPipeNotifier");
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(NamedPipeNotifier, NamedPipeNotifierPlugin)
-#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
deleted file mode 100644
index 426df483a2..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * \file named_pipe_notifier_plugin.h
- * \brief NamedPipeNotifierPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_5
-
-class NamedPipeNotifierPlugin : public ExtensionPlugin {
- Q_OBJECT
-
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
deleted file mode 100644
index 86ede716ee..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module com.ford.sdl.hmi.named_pipe_notifier
-plugin NamedPipeNotifier
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
deleted file mode 100644
index 0e2456d732..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
diff --git a/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST b/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
deleted file mode 100644
index ab0a27b552..0000000000
--- a/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
+++ /dev/null
@@ -1,2 +0,0 @@
-4Ezay^ק<yi'*';(*'-N)z:nx:Rǂi^^笴ǭO9$ySgږ爞ZDžYhږǜzۭקoj[nruZL
-w>^7k͆
diff --git a/src/components/qt_hmi/res/SPT.png b/src/components/qt_hmi/res/SPT.png
deleted file mode 100644
index efe0b43dc2..0000000000
--- a/src/components/qt_hmi/res/SPT.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/album_art.png b/src/components/qt_hmi/res/album_art.png
deleted file mode 100644
index 9000680276..0000000000
--- a/src/components/qt_hmi/res/album_art.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/app_911_assist.png b/src/components/qt_hmi/res/app_911_assist.png
deleted file mode 100644
index dc7d3c6630..0000000000
--- a/src/components/qt_hmi/res/app_911_assist.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/app_vehicle_info.png b/src/components/qt_hmi/res/app_vehicle_info.png
deleted file mode 100644
index 1542c787db..0000000000
--- a/src/components/qt_hmi/res/app_vehicle_info.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/apps.png b/src/components/qt_hmi/res/apps.png
deleted file mode 100644
index 48d8284b2a..0000000000
--- a/src/components/qt_hmi/res/apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/arrow.png b/src/components/qt_hmi/res/arrow.png
deleted file mode 100644
index 4c215b2bf7..0000000000
--- a/src/components/qt_hmi/res/arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/blue_ball.png b/src/components/qt_hmi/res/blue_ball.png
deleted file mode 100644
index d4db3f96ae..0000000000
--- a/src/components/qt_hmi/res/blue_ball.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_btn.png b/src/components/qt_hmi/res/buttons/long_oval_btn.png
deleted file mode 100644
index 375195bec3..0000000000
--- a/src/components/qt_hmi/res/buttons/long_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png b/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
deleted file mode 100644
index bd4ba813d5..0000000000
--- a/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn.png b/src/components/qt_hmi/res/buttons/longest_oval_btn.png
deleted file mode 100644
index 6ed0293aab..0000000000
--- a/src/components/qt_hmi/res/buttons/longest_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
deleted file mode 100644
index 73ee397da6..0000000000
--- a/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_bottom.png b/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
deleted file mode 100644
index 4964b4787a..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_left.png b/src/components/qt_hmi/res/buttons/oval_btn_left.png
deleted file mode 100644
index 4818162a19..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_left.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
deleted file mode 100644
index 29c47e189f..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
deleted file mode 100644
index c7d7d53ab6..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_right.png b/src/components/qt_hmi/res/buttons/oval_btn_right.png
deleted file mode 100644
index d566ac8ca5..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_right.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_top.png b/src/components/qt_hmi/res/buttons/oval_btn_top.png
deleted file mode 100644
index 787e0990e2..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_top.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_btn.png b/src/components/qt_hmi/res/buttons/player_next_btn.png
deleted file mode 100644
index c432068d4a..0000000000
--- a/src/components/qt_hmi/res/buttons/player_next_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
deleted file mode 100644
index aab3df8914..0000000000
--- a/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_btn.png b/src/components/qt_hmi/res/buttons/player_pause_btn.png
deleted file mode 100644
index a9443feb8b..0000000000
--- a/src/components/qt_hmi/res/buttons/player_pause_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
deleted file mode 100644
index 9c409c8f17..0000000000
--- a/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_btn.png b/src/components/qt_hmi/res/buttons/player_play_btn.png
deleted file mode 100644
index f185e94461..0000000000
--- a/src/components/qt_hmi/res/buttons/player_play_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
deleted file mode 100644
index ecbb4f2ef0..0000000000
--- a/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_btn.png b/src/components/qt_hmi/res/buttons/player_prev_btn.png
deleted file mode 100644
index acc2a71de3..0000000000
--- a/src/components/qt_hmi/res/buttons/player_prev_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
deleted file mode 100644
index c6eefc09c9..0000000000
--- a/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_btn.png b/src/components/qt_hmi/res/buttons/preset_btn.png
deleted file mode 100644
index 58c296a4e4..0000000000
--- a/src/components/qt_hmi/res/buttons/preset_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_pressed_btn.png b/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
deleted file mode 100644
index fd7606fbd6..0000000000
--- a/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_btn.png b/src/components/qt_hmi/res/buttons/round_btn.png
deleted file mode 100644
index 3add8dd21c..0000000000
--- a/src/components/qt_hmi/res/buttons/round_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_pressed_btn.png b/src/components/qt_hmi/res/buttons/round_pressed_btn.png
deleted file mode 100644
index b0f8863423..0000000000
--- a/src/components/qt_hmi/res/buttons/round_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn.png b/src/components/qt_hmi/res/buttons/short_oval_btn.png
deleted file mode 100644
index 99f5e90c3d..0000000000
--- a/src/components/qt_hmi/res/buttons/short_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
deleted file mode 100644
index 6b8bc61d80..0000000000
--- a/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom.png b/src/components/qt_hmi/res/buttons/zoom.png
deleted file mode 100644
index 0df4d25109..0000000000
--- a/src/components/qt_hmi/res/buttons/zoom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom_pressed.png b/src/components/qt_hmi/res/buttons/zoom_pressed.png
deleted file mode 100644
index c67d2c7c55..0000000000
--- a/src/components/qt_hmi/res/buttons/zoom_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/car.png b/src/components/qt_hmi/res/car.png
deleted file mode 100644
index 18a21656d0..0000000000
--- a/src/components/qt_hmi/res/car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/change_devices.png b/src/components/qt_hmi/res/change_devices.png
deleted file mode 100644
index 24a43a0d32..0000000000
--- a/src/components/qt_hmi/res/change_devices.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_off.png b/src/components/qt_hmi/res/climate/AC_off.png
deleted file mode 100644
index 8554ddfb4c..0000000000
--- a/src/components/qt_hmi/res/climate/AC_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_on.png b/src/components/qt_hmi/res/climate/AC_on.png
deleted file mode 100644
index c549010d6b..0000000000
--- a/src/components/qt_hmi/res/climate/AC_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_off_btn.png b/src/components/qt_hmi/res/climate/climate_round_off_btn.png
deleted file mode 100644
index 411f003938..0000000000
--- a/src/components/qt_hmi/res/climate/climate_round_off_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_on_btn.png b/src/components/qt_hmi/res/climate/climate_round_on_btn.png
deleted file mode 100644
index 691f6e3bf8..0000000000
--- a/src/components/qt_hmi/res/climate/climate_round_on_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_off.png b/src/components/qt_hmi/res/climate/defrost_off.png
deleted file mode 100644
index 22e384dbc0..0000000000
--- a/src/components/qt_hmi/res/climate/defrost_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_on.png b/src/components/qt_hmi/res/climate/defrost_on.png
deleted file mode 100644
index 9b0fc7aa43..0000000000
--- a/src/components/qt_hmi/res/climate/defrost_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_off.png b/src/components/qt_hmi/res/climate/face_off.png
deleted file mode 100644
index 72448d6aaf..0000000000
--- a/src/components/qt_hmi/res/climate/face_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_on.png b/src/components/qt_hmi/res/climate/face_on.png
deleted file mode 100644
index 4ed6089800..0000000000
--- a/src/components/qt_hmi/res/climate/face_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_off.png b/src/components/qt_hmi/res/climate/feet_off.png
deleted file mode 100644
index bac7bc9cfb..0000000000
--- a/src/components/qt_hmi/res/climate/feet_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_on.png b/src/components/qt_hmi/res/climate/feet_on.png
deleted file mode 100644
index 6d7a3b7a14..0000000000
--- a/src/components/qt_hmi/res/climate/feet_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_off.png b/src/components/qt_hmi/res/climate/headed_dash_off.png
deleted file mode 100644
index cf5168b559..0000000000
--- a/src/components/qt_hmi/res/climate/headed_dash_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_on.png b/src/components/qt_hmi/res/climate/headed_dash_on.png
deleted file mode 100644
index c46b690f7f..0000000000
--- a/src/components/qt_hmi/res/climate/headed_dash_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_off.png b/src/components/qt_hmi/res/climate/heated_seat_off.png
deleted file mode 100644
index 11a32048c9..0000000000
--- a/src/components/qt_hmi/res/climate/heated_seat_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_on.png b/src/components/qt_hmi/res/climate/heated_seat_on.png
deleted file mode 100644
index 8211eb79e5..0000000000
--- a/src/components/qt_hmi/res/climate/heated_seat_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_off.png b/src/components/qt_hmi/res/climate/heated_wheel_off.png
deleted file mode 100644
index 5956f5a3dc..0000000000
--- a/src/components/qt_hmi/res/climate/heated_wheel_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_on.png b/src/components/qt_hmi/res/climate/heated_wheel_on.png
deleted file mode 100644
index af3c2598da..0000000000
--- a/src/components/qt_hmi/res/climate/heated_wheel_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton.png b/src/components/qt_hmi/res/controlButtons/DownButton.png
deleted file mode 100644
index fd44c5438c..0000000000
--- a/src/components/qt_hmi/res/controlButtons/DownButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png b/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
deleted file mode 100644
index 013672bbf9..0000000000
--- a/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton.png b/src/components/qt_hmi/res/controlButtons/LeftButton.png
deleted file mode 100644
index e65dd5ce04..0000000000
--- a/src/components/qt_hmi/res/controlButtons/LeftButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png b/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
deleted file mode 100644
index 8df2e136ef..0000000000
--- a/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton.png b/src/components/qt_hmi/res/controlButtons/OkButton.png
deleted file mode 100644
index 9e82fe298b..0000000000
--- a/src/components/qt_hmi/res/controlButtons/OkButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png b/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
deleted file mode 100644
index 478d9ef7e5..0000000000
--- a/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton.png b/src/components/qt_hmi/res/controlButtons/RightButton.png
deleted file mode 100644
index 24e0f50a88..0000000000
--- a/src/components/qt_hmi/res/controlButtons/RightButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png b/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
deleted file mode 100644
index 9e70d8d729..0000000000
--- a/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton.png b/src/components/qt_hmi/res/controlButtons/UpButton.png
deleted file mode 100644
index 3547a7fc70..0000000000
--- a/src/components/qt_hmi/res/controlButtons/UpButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png b/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
deleted file mode 100644
index 2cbcfbe679..0000000000
--- a/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png b/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
deleted file mode 100644
index 041d49e7e9..0000000000
--- a/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton.png b/src/components/qt_hmi/res/controlButtons/vrButton.png
deleted file mode 100644
index af09282dff..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png b/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
deleted file mode 100644
index 9206e42a95..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrImage.png b/src/components/qt_hmi/res/controlButtons/vrImage.png
deleted file mode 100644
index 2f6bac2d9f..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrImage.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/find_apps.png b/src/components/qt_hmi/res/find_apps.png
deleted file mode 100644
index 55a9a28676..0000000000
--- a/src/components/qt_hmi/res/find_apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/gear.png b/src/components/qt_hmi/res/gear.png
deleted file mode 100644
index b1eeba091c..0000000000
--- a/src/components/qt_hmi/res/gear.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_off.png b/src/components/qt_hmi/res/hd_logo_off.png
deleted file mode 100644
index 80c9d58b46..0000000000
--- a/src/components/qt_hmi/res/hd_logo_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_on.png b/src/components/qt_hmi/res/hd_logo_on.png
deleted file mode 100644
index dfc3d4ccf1..0000000000
--- a/src/components/qt_hmi/res/hd_logo_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/initial.wav b/src/components/qt_hmi/res/initial.wav
deleted file mode 100644
index 61a549fbc6..0000000000
--- a/src/components/qt_hmi/res/initial.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/install_apps.png b/src/components/qt_hmi/res/install_apps.png
deleted file mode 100644
index dc33c0965c..0000000000
--- a/src/components/qt_hmi/res/install_apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/compass.png b/src/components/qt_hmi/res/nav/compass.png
deleted file mode 100644
index 15c73ee878..0000000000
--- a/src/components/qt_hmi/res/nav/compass.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/current_street.png b/src/components/qt_hmi/res/nav/current_street.png
deleted file mode 100644
index e289c054ff..0000000000
--- a/src/components/qt_hmi/res/nav/current_street.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon.png b/src/components/qt_hmi/res/nav/delete_icon.png
deleted file mode 100644
index 826b5faacf..0000000000
--- a/src/components/qt_hmi/res/nav/delete_icon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon_black.png b/src/components/qt_hmi/res/nav/delete_icon_black.png
deleted file mode 100644
index 56e35c759b..0000000000
--- a/src/components/qt_hmi/res/nav/delete_icon_black.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon.png b/src/components/qt_hmi/res/nav/dest_icon.png
deleted file mode 100644
index dadcfe25cf..0000000000
--- a/src/components/qt_hmi/res/nav/dest_icon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon_black.png b/src/components/qt_hmi/res/nav/dest_icon_black.png
deleted file mode 100644
index 75c99bc4aa..0000000000
--- a/src/components/qt_hmi/res/nav/dest_icon_black.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/map.png b/src/components/qt_hmi/res/nav/map.png
deleted file mode 100644
index 328bca44cf..0000000000
--- a/src/components/qt_hmi/res/nav/map.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_off.png b/src/components/qt_hmi/res/nav/mute_off.png
deleted file mode 100644
index f7306d96ae..0000000000
--- a/src/components/qt_hmi/res/nav/mute_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_on.png b/src/components/qt_hmi/res/nav/mute_on.png
deleted file mode 100644
index de2a2bb5bc..0000000000
--- a/src/components/qt_hmi/res/nav/mute_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options.png b/src/components/qt_hmi/res/nav/options.png
deleted file mode 100644
index 46887f1061..0000000000
--- a/src/components/qt_hmi/res/nav/options.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_in_active.png b/src/components/qt_hmi/res/nav/options_in_active.png
deleted file mode 100644
index 601b242bbe..0000000000
--- a/src/components/qt_hmi/res/nav/options_in_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_pressed.png b/src/components/qt_hmi/res/nav/options_pressed.png
deleted file mode 100644
index 42c352a7e8..0000000000
--- a/src/components/qt_hmi/res/nav/options_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/turnArrow.png b/src/components/qt_hmi/res/nav/turnArrow.png
deleted file mode 100644
index f37731f5af..0000000000
--- a/src/components/qt_hmi/res/nav/turnArrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/notes.png b/src/components/qt_hmi/res/notes.png
deleted file mode 100644
index 8b4a92fffc..0000000000
--- a/src/components/qt_hmi/res/notes.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/contacts.png b/src/components/qt_hmi/res/phone/contacts.png
deleted file mode 100644
index a16d518ba8..0000000000
--- a/src/components/qt_hmi/res/phone/contacts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_off.png b/src/components/qt_hmi/res/phone/dnd_off.png
deleted file mode 100644
index 04bb2476c1..0000000000
--- a/src/components/qt_hmi/res/phone/dnd_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_on.png b/src/components/qt_hmi/res/phone/dnd_on.png
deleted file mode 100644
index 56b9fe7065..0000000000
--- a/src/components/qt_hmi/res/phone/dnd_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/keypad.png b/src/components/qt_hmi/res/phone/keypad.png
deleted file mode 100644
index 1792c8fac8..0000000000
--- a/src/components/qt_hmi/res/phone/keypad.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/messages.png b/src/components/qt_hmi/res/phone/messages.png
deleted file mode 100644
index b5cbb8e8af..0000000000
--- a/src/components/qt_hmi/res/phone/messages.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/more.png b/src/components/qt_hmi/res/phone/more.png
deleted file mode 100644
index 908ebf654e..0000000000
--- a/src/components/qt_hmi/res/phone/more.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/phone.png b/src/components/qt_hmi/res/phone/phone.png
deleted file mode 100644
index 346f36cc33..0000000000
--- a/src/components/qt_hmi/res/phone/phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/recent.png b/src/components/qt_hmi/res/phone/recent.png
deleted file mode 100644
index db54c2f16e..0000000000
--- a/src/components/qt_hmi/res/phone/recent.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/texts.png b/src/components/qt_hmi/res/phone/texts.png
deleted file mode 100644
index 31c024b1df..0000000000
--- a/src/components/qt_hmi/res/phone/texts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/snow.png b/src/components/qt_hmi/res/snow.png
deleted file mode 100644
index 54756bb2f6..0000000000
--- a/src/components/qt_hmi/res/snow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/cal.png b/src/components/qt_hmi/res/vehicle/cal.png
deleted file mode 100644
index 94d5d44b5a..0000000000
--- a/src/components/qt_hmi/res/vehicle/cal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/folders.png b/src/components/qt_hmi/res/vehicle/folders.png
deleted file mode 100644
index c5985043df..0000000000
--- a/src/components/qt_hmi/res/vehicle/folders.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/key_car.png b/src/components/qt_hmi/res/vehicle/key_car.png
deleted file mode 100644
index a8e5d9d66c..0000000000
--- a/src/components/qt_hmi/res/vehicle/key_car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/sun.png b/src/components/qt_hmi/res/vehicle/sun.png
deleted file mode 100644
index 6424d9d210..0000000000
--- a/src/components/qt_hmi/res/vehicle/sun.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/warning.png b/src/components/qt_hmi/res/warning.png
deleted file mode 100644
index c91cd31d34..0000000000
--- a/src/components/qt_hmi/res/warning.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/white_ball.png b/src/components/qt_hmi/res/white_ball.png
deleted file mode 100644
index 952714ebe6..0000000000
--- a/src/components/qt_hmi/res/white_ball.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/test/CMakeLists.txt b/src/components/qt_hmi/test/CMakeLists.txt
deleted file mode 100644
index 91ec2cd20c..0000000000
--- a/src/components/qt_hmi/test/CMakeLists.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(QT_HMI_TESTS_LIST
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_AddCommand.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_AddSubMenu.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_DeleteCommand.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_ScrollableMessage.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_SetMediaClockTimer.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_Show.qml
- ${COMPONENTS_DIR}/qt_hmi/test/src/tst_Slider.qml
- ${COMPONENTS_DIR}/qt_hmi/test/readme.txt
-)
-
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-set(CONFIG
- warn_on
- qmltestcase
-)
-
-set(SOURCES
- qt_hmi_test.cc
-)
-
-set(target qt_hmi_test)
-
-create_test("qt_hmi_test" "${SOURCES}" "")
-qt5_use_modules(${target} Core Qml Quick QuickTest)
-
-foreach( file_i ${QT_HMI_TESTS_LIST})
- file(COPY ${file_i} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-endforeach( file_i )
-
diff --git a/src/components/qt_hmi/test/qt_hmi_test.cc b/src/components/qt_hmi/test/qt_hmi_test.cc
deleted file mode 100644
index 0241549ca5..0000000000
--- a/src/components/qt_hmi/test/qt_hmi_test.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <QtQuickTest/quicktest.h>
-QUICK_TEST_MAIN(QtHMI)
diff --git a/src/components/qt_hmi/test/readme.txt b/src/components/qt_hmi/test/readme.txt
deleted file mode 100644
index e169a4eb87..0000000000
--- a/src/components/qt_hmi/test/readme.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-A few comments on test writting for QML Unit Testing
-
-- set TestCase inside Item - this allows to send Mouse and keyboard events to controls
-- content of QML is reachable directly from tests. It is necessary to add getters into
- source QML file to handle internal items
-- test execution order is alfabetical. If you need manage this order use numbers in test function names
-- all functions that starts with "test_" prefix is treated as test case
-- all files that starts with "tst_" prefix will be executed as test set
-- for async testing use timer
-- each system's entity that changes during RPC must be tested
-- test incoming arguments is not necessary as it will be verified by Qt abstraction layer
-- run test with following command:
- "./qt_hmi_test -import ../git push qml_model_qt5/"
-
diff --git a/src/components/qt_hmi/test/src/tst_AddCommand.qml b/src/components/qt_hmi/test/src/tst_AddCommand.qml
deleted file mode 100644
index e71fb66b11..0000000000
--- a/src/components/qt_hmi/test/src/tst_AddCommand.qml
+++ /dev/null
@@ -1,320 +0,0 @@
-/**
- * @file tst_AddSubMenu.qml
- * @brief Test Case for OptionsView.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- width : mainWindowLoader.width
- height: mainWindowLoader.height
-
- Loader {
- id: mainWindowLoader
- asynchronous : false
- }
-
- TestCase {
- name: "AddCommand"
- when: windowShown
- property var dataContainer
- property var sdlUIProxy
- property var contentLoader
- property var messageModel
-
- function createView(appID) {
- mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
- var mainWindowObject = mainWindowLoader.item
- sdlUIProxy = mainWindowObject.getUIProxy()
- dataContainer = mainWindowObject.getDataStorage()
- dataContainer.addApplication({appName:"TestAppName", appId:appID})
- }
-
- function destroyView() {
- mainWindowLoader.source = ""
- }
-
- /*
- * Test Cases
- */
-
- function test_01_addCommand_Command_Positive() {
- console.debug("enter")
-
- var initData = {
- cmdID: 1,
- cmdIcon: {
- value: "123.jpg",
- imageType: "DYNAMIC"
- },
- menuParams: {
- position: 500,
- menuName: "Command positive"
- },
- appID: 1
- }
-
- createView(initData.appID)
- sdlUIProxy.addCommand(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.cmdID, "Command id")
- compare(app.options.get(0).position, initData.menuParams.position, "Command position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
- compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
-
- destroyView()
- console.debug("exit")
- }
-
- function test_02_addCommand_Without_Position() {
- console.debug("enter")
- var initData = {
- appID: 1,
- Commands: []
- }
- initData.Commands.push({
- cmdID:1,
- comIcon: {
- value: "123.jpg",
- imageType: "DYNAMIC"
- },
- menuParams: {
- menuName: "Command 1"
- },
- appID: 1
- })
- initData.Commands.push({
- cmdID:2,
- cmdIcon: {
- value: "345.jpg",
- imageType: "DYNAMIC"
- },
- menuParams: {
- position: 500,
- menuName: "Command 1"
- },
- appID: 1
- })
- createView(initData.appID)
- sdlUIProxy.addCommand(initData.Commands[0])
- sdlUIProxy.addCommand(initData.Commands[1])
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(1).id, initData.Commands[0].cmdID, "Command id")
- compare(app.options.get(1).name, initData.Commands[0].menuParams.menuName, "Command name")
- compare(app.options.get(0).id, initData.Commands[1].cmdID, "Command id")
- compare(app.options.get(0).name, initData.Commands[1].menuParams.menuName, "Command name")
-
- destroyView()
- console.debug("exit")
- }
-
- function test_03_1010_addCommands() {
- console.debug("enter")
- var initData = {
- appID: 1,
- Commands: []
- }
-
- for (var i = 0; i < 1010; i++) {
- initData.Commands.push({
- cmdID: i,
- cmdIcon: {
- value: "",
- imageType: ""
- },
- menuParams: {
- position: i,
- menuName: "Command " + i
- },
- appID: 1
- })
- }
-
- createView(initData.appID)
- for (var i = 0; i < initData.Commands.length; i++) {
- sdlUIProxy.addCommand(initData.Commands[i])
- }
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, 1000, "Command count")
-
- for (var i = 0; i < 1000; i++) {
- compare(app.options.get(i).id, initData.Commands[i].cmdID, "Command id")
- compare(app.options.get(i).position, initData.Commands[i].menuParams.position, "Command position")
- compare(app.options.get(i).name, initData.Commands[i].menuParams.menuName, "Command name")
- }
-
- destroyView()
- console.debug("exit")
- }
-
- function test_04_Command_Upper_Bound() {
- console.debug("enter")
- var initData = {
- cmdID: 2000000000,
- cmdIcon: {
- value: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa",
- imageType: ""
- },
- menuParams: {
- position: 100000,
- menuName: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa"
- },
- appID: 1
- }
-
- createView(initData.appID)
- sdlUIProxy.addCommand(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.cmdID, "Command id")
- compare(app.options.get(0).position, initData.menuParams.position, "Command position")
- compare(app.options.get(0).name.length, initData.menuParams.menuName.length, "Command name")
- compare(app.options.get(0).icon.value.length, initData.cmdIcon.value.length, "Image path")
-
- destroyView()
- console.debug("exit")
- }
-
- function test_05_addCommand_Lower_Bound() {
- console.debug("enter")
- var initData = {
- cmdID: 0,
- cmdIcon: {
- value: "",
- imageType: ""
- },
- menuParams: {
- position: 0,
- menuName: "0",
- parentID: 0
- },
- appID: 0
- }
-
- createView(initData.appID)
- sdlUIProxy.addCommand(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.cmdID, "Command id")
- compare(app.options.get(0).position, initData.menuParams.position, "Command position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
- compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
-
- destroyView()
- console.debug("exit")
- }
-
- function test_06_addCommand_With_Fake_Parameter() {
- console.debug("enter")
- var initData = {
- cmdID: 1,
- cmdIcon: {
- value: "345.jpg",
- imageType: "DYNAMIC"
- },
- menuParams: {
- menuName: "Command fake param",
- position: 1,
- fakeParam: "fakeParam"
- },
- appID: 1
- }
-
- createView(initData.appID)
- sdlUIProxy.addCommand(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.cmdID, "Command id")
- compare(app.options.get(0).position, initData.menuParams.position, "Command position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "Command name")
- compare(app.options.get(0).icon.value, initData.cmdIcon.value, "Image path")
-
- destroyView()
- console.debug("exit")
- }
-
- function test_07_addCommand_No_Menu_Params() {
- console.debug("enter")
-
- var initData = {
- appID: 1,
- Commands:[]
- }
-
- var n = 10;
- initData.Commands.push({
- cmdID: 123,
- menuParams: {},
- appID: 1
- })
- for (var i = 0; i < n; i++) {
- initData.Commands.push({
- cmdID: i,
- menuParams: {
- position: i,
- menuName: "Command " + i
- },
- appID: 1
- })
- }
-
- createView(initData.appID)
- for (var i = 0; i < initData.Commands.length; i++) {
- sdlUIProxy.addCommand(initData.Commands[i])
- }
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, initData.Commands.length, "Command count")
- compare(app.options.get(n).id, initData.Commands[0].cmdID, "Command 11 id")
- compare(app.options.get(0).id, initData.Commands[1].cmdID, "Command 12 id")
-
- destroyView()
- console.debug("exit")
- }
- }
-}
diff --git a/src/components/qt_hmi/test/src/tst_AddSubMenu.qml b/src/components/qt_hmi/test/src/tst_AddSubMenu.qml
deleted file mode 100644
index 7f9477cab1..0000000000
--- a/src/components/qt_hmi/test/src/tst_AddSubMenu.qml
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * @file tst_AddSubMenu.qml
- * @brief Test Case for OptionsView.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- width : mainWindowLoader.width
- height: mainWindowLoader.height
-
- Loader {
- id: mainWindowLoader
- asynchronous : false
- }
-
- TestCase {
- name: "AddSubMenu"
- when: windowShown
- property var dataContainer
- property var sdlUIProxy
- property var contentLoader
- property var messageModel
-
- //initialization for each test
- function createMessageView(appID) {
- mainWindowLoader.source = ""
- mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
- var mainWindowObject = mainWindowLoader.item
- if(!mainWindowObject)
- qtest_fail("mainWindowObject is undefined");
- var mainScreen = mainWindowObject.getMainScreen()
- mainScreen.visible = true
- var warningInfo = mainWindowObject.getWarningInfo()
- warningInfo.visible = false
- contentLoader = mainWindowObject.getContentLoader()
- contentLoader.asynchronous = false
- sdlUIProxy = mainWindowObject.getUIProxy()
- dataContainer = mainWindowObject.getDataStorage()
- dataContainer.addApplication({appName:"TestAppName", appId:appID})
- }
-
- //cleanup for each test
- function destroyView() {
- //Clear Loader with MainWindow, which delete own models and views
- mainWindowLoader.source = ""
- }
-
- /*
- * Test Cases
- */
-
- //Positive case and in boundary conditions
- function test_01_addSubMenu() {
- console.debug("enter")
- var initData = {
- menuID: 1000,
- menuParams: {
- position: 500,
- menuName: "SubMenu positive"
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.menuID, "SubMenu id")
- compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
-
- destroyView()
- console.debug("exit")
- }
-
- // Only mandatory - without Position
- function test_02_addSubMenu_WithoutPosition() {
- console.debug("enter")
- var initData = {
- menuID: 1001,
- menuParams: {
- menuName: "SubMenu mandatory only"
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.menuID, "SubMenu id")
- //How to verify if value was not set?
- //compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
-
- destroyView()
- console.debug("exit")
- }
-
- //Create AddSubMenu and check data
- function test_03_1000_SubMenu() {
- console.debug("enter")
- var initData = {
- appID: 1,
- subMenus: []
- }
-
- for (var i = 0; i < 1010; i++) {
-
- initData.subMenus.push({
- menuID: i,
- menuParams: {
- position: i,
- menuName: "Submenu" + i
- },
- appID: 1
- })
- }
-
- createMessageView(initData.appID)
- for (var i = 0; i < initData.subMenus.length; i++) {
- sdlUIProxy.addSubMenu(initData.subMenus[i])
- }
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, 1000, "SubMenus count")
-
- for (var i = 0; i < 1000; i++) {
- compare(app.options.get(i).id, initData.subMenus[i].menuID, "SubMenu id")
- compare(app.options.get(i).position, initData.subMenus[i].menuParams.position, "SubMenu position")
- compare(app.options.get(i).name, initData.subMenus[i].menuParams.menuName, "SubMenu name")
- }
-
- destroyView()
- console.debug("exit")
- }
-
- //Create AddSubMenu and check data
- function test_04_addSubMenu_UpperBound() {
- console.debug("enter")
- var initData = {
- menuID: 2000000000,
- menuParams: {
- position: 1000,
- menuName: "00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012å/678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHI=JKL+MNO|PQR~STU{}WXY[]Z,01234567890aAaaaaaaaaaaaaaa"
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.menuID, "SubMenu id")
- compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
- compare(app.options.get(0).name.length, 500, "SubMenu name")
-
- destroyView()
- console.debug("exit")
- }
-
- //Create AddSubMenu and check data
- function test_05_addSubMenu_LowerBound() {
- console.debug("enter")
- var initData = {
- menuID: 0,
- menuParams: {
- position: 0,
- menuName: "0"
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.menuID, "SubMenu id")
- compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
- compare(app.options.get(0).name.length, 1, "SubMenu name")
-
- destroyView()
- console.debug("exit")
- }
-
- // With fake parameter
- function test_06_addSubMenu_With_Fake_Parameter() {
- console.debug("enter")
- var initData = {
- menuID: 1001,
- menuParams: {
- menuName: "SubMenu fake param",
- position: 1,
- fakeParam: "fakeParam"
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.get(0).id, initData.menuID, "SubMenu id")
- compare(app.options.get(0).position, initData.menuParams.position, "SubMenu position")
- compare(app.options.get(0).name, initData.menuParams.menuName, "SubMenu name")
-
- destroyView()
- console.debug("exit")
- }
-
- // With fake parameter
- function test_07_addSubMenu_menuIDOutLowerBound() {
- console.debug("enter")
- var initData = {
- menuID: -1,
- menuParams: {
- menuName: "100",
- position: 1,
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, 0, "SubMenus count")
-
- compare(app.options.get(1), !undefined, "SubMenu duplicated")
-
- destroyView()
- console.debug("exit")
- }
-
- // With fake parameter
- function test_08_addSubMenu_menuIDOutUpperBound() {
- console.debug("enter")
- var initData = {
- menuID: 2000000001,
- menuParams: {
- menuName: "100",
- position: 1,
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, 0, "SubMenus count")
-
- compare(app.options.get(1), !undefined, "SubMenu duplicated")
-
- destroyView()
- console.debug("exit")
- }
-
- // With fake parameter
- function test_09_addSubMenu_duplicatedSubMenus() {
- console.debug("enter")
- var initData = {
- menuID: 2000000001,
- menuParams: {
- menuName: "100",
- position: 1,
- },
- appID: 1
- }
-
- createMessageView(initData.appID)
- sdlUIProxy.addSubMenu(initData)
- sdlUIProxy.addSubMenu(initData)
- var app = dataContainer.getApplication(initData.appID)
-
- compare(app.options.count, 1, "SubMenus count")
-
- compare(app.options.get(1), undefined, "SubMenu duplicated")
-
- destroyView()
- console.debug("exit")
- }
- }
-}
diff --git a/src/components/qt_hmi/test/src/tst_DeleteCommand.qml b/src/components/qt_hmi/test/src/tst_DeleteCommand.qml
deleted file mode 100644
index bf28be0282..0000000000
--- a/src/components/qt_hmi/test/src/tst_DeleteCommand.qml
+++ /dev/null
@@ -1,210 +0,0 @@
-/**
- * @file tst_ScrollableMessage.qml
- * @brief Test Case for ScrollableMessageView.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item
-{
- width : mainWindowLoader.width
- height: mainWindowLoader.height
-
- Loader
- {
- id: mainWindowLoader
- asynchronous : false
- }
-
- TestCase
- {
- name: "DeleteCommand"
- when: windowShown
- property var dataContainer
- property var sdlUIProxy
- property var contentLoader
- property var messageModel
-
-
- //initialization for each test
- function createMessageView(appID)
- {
- mainWindowLoader.source = ""
- mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
- var mainWindowObject = mainWindowLoader.item
- if(!mainWindowObject)
- qtest_fail("mainWindowObject is undefined");
- var mainScreen = mainWindowObject.getMainScreen()
- mainScreen.visible = true
- var warningInfo = mainWindowObject.getWarningInfo()
- warningInfo.visible = false
- contentLoader = mainWindowObject.getContentLoader()
- contentLoader.asynchronous = false
- sdlUIProxy = mainWindowObject.getUIProxy()
- dataContainer = mainWindowObject.getDataStorage()
- dataContainer.addApplication({appName:"TestAppName", appId:appID})
- }
-
- //cleanup for each test
- function destroyView()
- {
- //Clear Loader with MainWindow, which delete own models and views
- mainWindowLoader.source = ""
- }
-
- /*
- * Test Cases
- */
-
- function test_01_deleteCommand()
- {
- console.debug("enter")
- var initData = {
- cmdID: 1,
- menuParams:
- {
- menuName:"",
- },
- cmdIcon:"",
- appID: 1
- }
- var initData2 = {
- cmdID: 2,
- menuParams:
- {
- menuName:"",
- },
- cmdIcon:"",
- appID: 1
- }
-
- createMessageView(initData.appID)
- var app = dataContainer.getApplication(initData.appID)
- var MenuCount = app.options.count
- app.options.append(
- { id: initData.cmdID,
- name: initData.menuParams.menuName,
- type: Internal.MenuItemType.MI_NODE,
- position: Constants.positionOfElementWithoutPosition,
- icon: initData.cmdIcon ? cmdIcon : {},
- subMenu: []
- }
- )
-
- compare(app.options.count, MenuCount+1, "Command into menu not added")
- sdlUIProxy.deleteCommand(initData2)
-
- var a = 0
- for(var i = 0;((a === 0) && ( i < app.options.count)); i++)
- {
- if (app.options.get(i).id===initData2.menuID)
- {
- a = 1
- }
- }
- compare (a, 0, "Command in menu isn't removed")
-
-
- destroyView()
- console.debug("exit")
- }
-
- function test_02_deleteCommand() {
- console.debug("enter")
- var initData = {
- menuID: 1000,
- menuParams: {
- position: 1,
- menuName: "SubMenu"
- },
- appID: 1
- }
-
- var initData2 = {
- cmdID: 1,
- menuParams: {
- menuName:"",
- },
- cmdIcon:"",
- appID: 1
- }
-
- createMessageView(initData.appID)
- var app = dataContainer.getApplication(initData.appID)
- var MenuCount = app.options.count
- app.options.append ({
- "id": initData.menuID,
- "name": initData.menuParams.menuName,
- "position": initData.menuParams.position,
- "type": Internal.MenuItemType.MI_SUBMENU,
- "icon": undefined,
- "subMenu":[{
- "id":initData2.cmdID,
- "name": initData2.menuParams.menuName,
- "position": Constants.positionOfElementWithoutPosition,
- "type": Internal.MenuItemType.MI_PARENT,
- "icon": {
- "imageType": Common.ImageType.DYNAMIC,
- "value": "../res/nav/turnArrow.png"
- },
-
- "subMenu": []
- }]
- })
-
- compare(app.options.count, MenuCount+1, "SubMenu into added")
- var SubMenuCount = app.options.get(0).subMenu.count
- compare( SubMenuCount, 1, "Command is not added into SubMenu")
-
- sdlUIProxy.deleteCommand(initData2)
-
- compare(app.options.count , MenuCount+1, "Menu is changed")
- compare(app.options.get(0).subMenu.count, SubMenuCount-1, "Command into SubMenu is not removed")
-
- destroyView()
- console.debug("exit")
- }
- }
-}
diff --git a/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml b/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml
deleted file mode 100644
index abf3105b1a..0000000000
--- a/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * @file tst_ScrollableMessage.qml
- * @brief Test Case for ScrollableMessageView.
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- width : mainWindowLoader.width
- height: mainWindowLoader.height
-
- Loader {
- id: mainWindowLoader
- asynchronous : false
- }
-
- TestCase {
- name: "ScrollableMessageView"
- when: windowShown
- property var dataContainer
- property var sdlUIProxy
- property var contentLoader
- property var messageModel
- property var messageView
- property var timer
-
- property var softButtonsListExample : [
- {softButtonID:0, isHighlighted:true, systemAction:Common.SystemAction.DEFAULT_ACTION,
- type:Common.SoftButtonType.SBT_TEXT, text:"Default Action"},
- {softButtonID:1, isHighlighted:false, systemAction:Common.SystemAction.STEAL_FOCUS,
- type:Common.SoftButtonType.SBT_IMAGE, text:"Steal Focus"},
- {softButtonID:2, isHighlighted:false, systemAction:Common.SystemAction.KEEP_CONTEXT,
- type:Common.SoftButtonType.SBT_BOTH, text:"Keep context"}]
-
- //initialization for each test
- function createMessageView(appID) {
- mainWindowLoader.source = ""
- mainWindowLoader.source = "../qml_model_qt5/MainWindow.qml"
- var mainWindowObject = mainWindowLoader.item
- if(!mainWindowObject)
- qtest_fail("mainWindowObject is undefined");
- var mainScreen = mainWindowObject.getMainScreen()
- mainScreen.visible = true
- var warningInfo = mainWindowObject.getWarningInfo()
- warningInfo.visible = false
- contentLoader = mainWindowObject.getContentLoader()
- contentLoader.asynchronous = false
- sdlUIProxy = mainWindowObject.getUIProxy()
- dataContainer = mainWindowObject.getDataStorage()
- dataContainer.addApplication({appName:"TestAppName", appId:appID})
- }
-
- //get messageModel and messageView after call @scrollableMessage
- function getMessageViewModel() {
- messageModel = dataContainer.scrollableMessageModel
- if(!messageModel)
- qtest_fail("messageModel is undefined");
- messageView = contentLoader.item
- if(!messageView)
- qtest_fail("messageView is undefined");
- }
-
- //cleanup for each test
- function destroyView() {
- //Clear Loader with MainWindow, which delete own models and views
- mainWindowLoader.source = ""
- }
-
- //return button from messageView by ommon.SystemAction
- function findButtonByAction(systemAction){
- var listViewItems = messageView.getSoftButtonsListView()
- for (var i = 0, len = listViewItems.count; i < len; i++) {
- //get SoftButton by setting current item (ListView has no getter)
- listViewItems.currentIndex = i
- var buttonItem = listViewItems.currentItem
- if (buttonItem.button.systemAction === systemAction) {
- return buttonItem
- }
- }
- }
-
- /*
- * Test Cases
- */
-
- //Create ScrollableMessageView and check data
- function test_01_create() {
- console.debug("enter")
- var initData = {appID:1, timeout:2000,
- messageText:{fieldText:"Simple ScrollableMessage text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- timer = messageView.getTimer()
- if(!timer)
- qtest_fail("timer is undefined");
- //check button equals to init data
- compare(messageModel.softButtons.count, initData.softButtons.length, "wrong buttons count created")
- for (var i = 0, len = messageModel.softButtons.count; i < len; i++) {
- var act = messageModel.softButtons.get(i)
- var exp = initData.softButtons[i]
- compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
- compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
- compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
- compare(act.text, exp.text, "wrong text in button")
- }
- //check model data equals to init data
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
- compare(messageModel.appId, initData.appID, "wrong application ID")
- compare(messageModel.timeout, initData.timeout, "wrong timeout")
- verify(messageModel.async !== undefined, "async in undefined")
- destroyView()
- console.debug("exit")
- }
-
- //Create ScrollableMessageView with empty data
- function test_02_emptyInit() {
- console.debug("enter")
- var initData = {appID:1, timeout:0, messageText:{fieldText:""}, softButtons:[]}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- //NOTE: don't check timer - it has been triggered immediately (timeout is 0)
- //MessageView call @complete immediately
- compare(messageModel.running, false, "ScrollableMessage didn't stop")
- compare(messageModel.softButtons.count, initData.softButtons.length, "wrong buttons count")
- compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
- compare(messageModel.timeout, initData.timeout, "wrong timeout")
- destroyView()
- console.debug("exit")
- }
-
- //call @scrollableMessage twice (after first view has closed)
- function test_03_doubleCreate() {
- console.debug("enter")
- var initData = {appID:1, timeout:0, messageText:{fieldText:"Simple text"},
- softButtons:softButtonsListExample}
- var initData2 = {appID:1, timeout:10000, messageText:{fieldText:"Simple text 2"},
- softButtons:[]}
- createMessageView(initData.appID)
-
- //create view
- var actualResult = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- //create new view
- var actualResult2 = sdlUIProxy.scrollableMessage(initData2)
- getMessageViewModel()
-
- verify(actualResult.__errno === undefined, "ScrollableMessage return error state")
- verify(actualResult2.__errno === undefined, "ScrollableMessage return error state")
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- compare(messageModel.longMessageText, initData2.messageText.fieldText, "wrong messageText")
- compare(messageModel.timeout, initData2.timeout, "wrong timeout")
- compare(messageModel.appId, initData2.appID, "wrong application ID")
- verify(messageModel.async !== undefined, "async in undefined")
- destroyView()
- console.debug("exit")
- }
-
- //call @scrollableMessage twice (before first view is closed)
- function test_04_doubleCreateError() {
- console.debug("enter")
- var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple text"},
- softButtons:softButtonsListExample}
- var initData2 = {appID:1, timeout:10000, messageText:{fieldText:"Simple text 2"},
- softButtons:[]}
- createMessageView(initData.appID)
-
- //create view
- var actualResult = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
- var firstView = messageView;
-
- //create new view
- var actualResult2 = sdlUIProxy.scrollableMessage(initData2)
- getMessageViewModel()
- verify(actualResult.__errno === undefined, "ScrollableMessage return error state")
- verify(actualResult2.__errno !== undefined, "ScrollableMessage don't return error state")
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- compare(messageView, firstView, "creating new view insteed stay first")
- compare(messageModel.longMessageText, initData.messageText.fieldText, "wrong messageText")
- compare(messageModel.timeout, initData.timeout, "wrong timeout")
- compare(messageModel.appId, initData.appID, "wrong application ID")
- verify(messageModel.async !== undefined, "async in undefined")
- destroyView()
- console.debug("exit")
- }
-
- //call @scrollableMessage and check close
- function test_05_ClickBackButton() {
- console.debug("enter")
- var initData = {appID:1, timeout:20000,
- messageText:{fieldText:"Simple ScrollableMessage text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- //look for back button
- var backButton = messageView.getBackButton()
- verify(backButton !== undefined, "Not created back button")
- //wait rendering for correct click position
- waitForRendering(mainWindowLoader)
- //Press back button
- mouseClick(backButton, backButton.width/2, backButton.height/2,
- Qt.LeftButton, Qt.NoModifier, 0)
- //check that MessageView (in contentLoader) is unloaded and deleted
- var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
- verify(!isLoaded, "MessageView should be unloaded")
- //wait for delete messageView by GC
- wait(0);
- verify(messageView === null, "MessageView should be deleted")
- destroyView()
- console.debug("exit")
- }
- //call @scrollableMessage and check close
- function test_06_ClickDefaultAction() {
- console.debug("enter")
- var initData = {appID:1, timeout:20000,
- messageText:{fieldText:"Simple ScrollableMessage text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- //look for DEFAULT_ACTION button
- var defaultActionButton = findButtonByAction(Common.SystemAction.DEFAULT_ACTION)
- verify(defaultActionButton !== undefined, "Not created button with DEFAULT_ACTION")
- //wait rendering for correct click position
- waitForRendering(mainWindowLoader)
- //Press default button
- mouseClick(defaultActionButton, defaultActionButton.width/2, defaultActionButton.height/2,
- Qt.LeftButton, Qt.NoModifier, 0)
- //check that MessageView (in contentLoader) is unloaded and deleted
- var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
- verify(!isLoaded, "MessageView should be unloaded")
- //wait for delete messageView by GC
- wait(0);
- verify(messageView === null, "MessageView should be deleted")
- destroyView()
- console.debug("exit")
- }
-
- //call @scrollableMessage and check restart timer
- function test_07_ClickStealFocus() {
- console.debug("enter")
- var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple ScrollableMessage text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- //check
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- //look for STEAL_FOCUS button
- var stealFocusButton = findButtonByAction(Common.SystemAction.STEAL_FOCUS)
- verify(stealFocusButton !== undefined, "Not created button with STEAL_FOCUS")
- //wait rendering for correct buttons size for correct click position
- waitForRendering(mainWindowLoader)
- mouseClick(stealFocusButton, stealFocusButton.width/2, stealFocusButton.height/2,
- Qt.LeftButton, Qt.NoModifier, 0)
- //check that MediaView loaded in loade
- var viewQMlFileName = dataContainer.currentApplication.isMediaApplication ?
- "SDLPlayerView.qml" : "SDLNonMediaView.qml"
- var isLoaded = (contentLoader.source.toString().indexOf(viewQMlFileName) > 0)
- verify(isLoaded, "SDLPlayerView/SDLNonMediaView should be loaded")
- destroyView()
- console.debug("exit")
- }
-
- //call @scrollableMessage and check restart timer
- function test_08_ClickKeepContex() {
- console.debug("enter")
- var initData = {appID:1, timeout:20000, messageText:{fieldText:"Simple ScrollableMessage text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- //check
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
- //look for KEEP_CONTEXT button
- var keepContexButton = findButtonByAction(Common.SystemAction.KEEP_CONTEXT)
- verify(keepContexButton !== undefined, "Not created button with KEEP_CONTEXT")
- //wait rendering for correct click position
- waitForRendering(mainWindowLoader)
- //Press button
- mouseClick(keepContexButton, keepContexButton.width/2, keepContexButton.height/2,
- Qt.LeftButton, Qt.NoModifier, 0)
- //check that MessageView is still unloaded loaded
- var isLoaded = (contentLoader.source.toString().indexOf("ScrollableMessageView.qml") > 0)
- verify(isLoaded, "MessageView should be loaded")
- //verify restarted timer
- timer = messageView.getTimer()
- verify(timer.running === true, "Timer is not restarted by KEEP_CONTEXT button")
- destroyView()
- console.debug("exit")
- }
-
- //add long text to model and check scrollBar visibility
- function test_09_ScrollBarShown() {
- console.debug("enter")
- //generate string with (10!) lines
- var longText = "It is very long text!\n"
- for(var i = 1; i < 10; ++i)
- longText += longText
- var initData = {appID:1, timeout:20000, messageText:{fieldText:longText}, softButtons:[]}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- //check
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
-
- //wait rendering
- waitForRendering(mainWindowLoader)
- var scrollBar = messageView.getScrollbar()
- verify(scrollBar.visible === true, "ScrollBar is not shown for long text")
-
- destroyView()
- console.debug("exit")
- }
-
- //compare text width with and without buttons at top of SrollableMessage
- function test_10_MessageTextHeight() {
- console.debug("enter")
- var initData = {appID:1, timeout:500, messageText:{fieldText:"Simple text"}, softButtons:[]}
- createMessageView(initData.appID)
-
- var result = sdlUIProxy.scrollableMessage(initData)
- getMessageViewModel()
-
- //check
- compare(messageModel.running, true, "ScrollableMessage didn't start")
- verify(result.__errno === undefined, "ScrollableMessage return error state")
-
- var textAreaHeight = messageView.getTextArea().height
- wait(initData.timeout)
-
- var initData2 = {appID:1, timeout:20000, messageText:{fieldText:"Simple text"},
- softButtons:softButtonsListExample}
- createMessageView(initData.appID)
-
- var result2 = sdlUIProxy.scrollableMessage(initData2)
- getMessageViewModel()
-
- //wait rendering
- waitForRendering(mainWindowLoader)
- var textAreaHeight2 = messageView.getTextArea().height
- console.debug("messageTextH", textAreaHeight, textAreaHeight2)
- verify(textAreaHeight2 <= textAreaHeight, "Height of text area shoud be less with buttons")
-
- destroyView()
- console.debug("exit")
- }
- }
-}
diff --git a/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml b/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml
deleted file mode 100644
index 212cdfc143..0000000000
--- a/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * @file tst_Slider.qml
- * @brief Test Case for Slider.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- id:item123
- TestCase {
- name: "time"
- property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
- property var mainObject
- property var sdlUI
- property var dataContainer
-
- function createTime() {
- mainObject = mainWindowComponent.createObject(parent)
- sdlUI = mainObject.getUIProxy()
- dataContainer = mainObject.getDataStorage()
- }
-
- function destroyTime() {
- mainObject.destroy()
- }
-
- //No end time, works like a timer
- function test_01_noEndTimeInCountUp() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:undefined , updateMode: 0, appID: 1}
-
- var expectedResult = {endTimeResult:-1, resultCode : Common.Result.SUCCESS}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(dataContainer.getApplication(initData.appID).mediaClock.endTime, expectedResult.endTimeResult, "time position")
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- //No start time. Function process error
- function test_02_noStartTime() {
- console.debug("enter")
-
- var initData = {startTime:undefined, endTime:{hours: 4, minutes: 0, seconds: 0} , updateMode: 1, appID: 1}
- var expectedResult = {resultCode : Common.Result.INVALID_DATA}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- //Receive "pause", when onready paused
- function test_03_pauseAfterPause() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
- var expectedResult = {resultCode : Common.Result.IGNORED}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sdlUI.setMediaClockTimer(initData)
-
- initData.updateMode=2
- sdlUI.setMediaClockTimer(initData)
-
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- //Receive "RESUME" after "CLEAR"
- function test_04_resumeAfterClear() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 10, minutes: 0, seconds: 0},endTime:{ }, updateMode:0, appID:1}
-
- var expectedResult = {resultCode : Common.Result.IGNORED}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sdlUI.setMediaClockTimer(initData)
-
- initData.updateMode=4
- sdlUI.setMediaClockTimer(initData)
-
- initData.updateMode=3
- sdlUI.setMediaClockTimer(initData)
-
- var actualResult = sdlUI.setMediaClockTimer(initData)
- try {
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- function test_05_resumeAfterEnd() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 0, minutes: 12, seconds: 33},endTime:{hours: 0, minutes: 12, seconds: 33}, updateMode:0, appID:1}
-
- var expectedResult = {resultCode : Common.Result.IGNORED}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sdlUI.setMediaClockTimer(initData)
-
- dataContainer.setApplicationProperties(initData.appID, {
- "mediaClock": {
- "updateMode": 0,
- "runningMode": 1,
- "startTime": initData.StartTime,
- "endTime": initData.EndTime,
- "startTimeForProgress": 753
- }
- })
- initData.updateMode=3
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- //Launch "COUNTUP" twice
- function test_06_twoCountUp() {
- console.debug("enter")
-
- var initData1 = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
- var initData2 = {startTime:{hours: 5, minutes: 0, seconds: 0}, endTime:{hours: 18, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
- var expectedResult = {startTime:18000, endTime: 64800, updateMode: 0, resultCode : Common.Result.SUCCESS}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData1.appID})
-
- sdlUI.setMediaClockTimer(initData1)
-
- var actualResult = sdlUI.setMediaClockTimer(initData2)
-
- try {
- compare(dataContainer.getApplication(initData1.appID).mediaClock.startTime, expectedResult.startTime, "startTime")
- compare(dataContainer.getApplication(initData1.appID).mediaClock.endTime, expectedResult.endTime, "endTime")
- compare(dataContainer.getApplication(initData1.appID).mediaClock.updateMode, expectedResult.updateMode, "updateMode")
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- //Get "RESUME", when clock is paused
- function test_07_resumeAfterResume() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
- var expectedResult = {resultCode : Common.Result.IGNORED}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sdlUI.setMediaClockTimer(initData)
-
- initData.updateMode=3
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
-
- function test_08_countDownAfterCountUp() {
- console.debug("enter")
-
- var initData1 = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:{hours: 12, minutes: 00, seconds: 00}, updateMode: 0, appID: 1}
- var initData2 = {startTime:{hours: 18, minutes: 0, seconds: 0}, endTime:{hours: 5, minutes: 00, seconds: 00}, updateMode: 1, appID: 1}
- var expectedResult = {startTime:64800, endTime: 18000, updateMode: 1, resultCode : Common.Result.SUCCESS}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData1.appID})
-
- sdlUI.setMediaClockTimer(initData1)
-
- var actualResult = sdlUI.setMediaClockTimer(initData2)
-
- try {
- compare(dataContainer.getApplication(initData1.appID).mediaClock.startTime, expectedResult.startTime, "startTime")
- compare(dataContainer.getApplication(initData1.appID).mediaClock.endTime, expectedResult.endTime, "endTime")
- compare(dataContainer.getApplication(initData1.appID).mediaClock.updateMode, expectedResult.updateMode, "updateMode")
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
-
- function test_09_noEndTimeInCountDown() {
- console.debug("enter")
-
- var initData = {startTime:{hours: 4, minutes: 0, seconds: 0}, endTime:undefined, updateMode: 0, appID: 1}
-
- var expectedResult = {startTimeForProgress:14400, resultCode : Common.Result.SUCCESS}
-
- createTime()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- var actualResult = sdlUI.setMediaClockTimer(initData)
-
- try {
- compare(dataContainer.getApplication(initData.appID).mediaClock.startTimeForProgress, expectedResult.startTimeForProgress, "time position")
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
-
- destroyTime()
- console.debug("exit")
- }
- }
-}
diff --git a/src/components/qt_hmi/test/src/tst_Show.qml b/src/components/qt_hmi/test/src/tst_Show.qml
deleted file mode 100644
index cce2e7de49..0000000000
--- a/src/components/qt_hmi/test/src/tst_Show.qml
+++ /dev/null
@@ -1,363 +0,0 @@
-/**
- * @file tst_Slider.qml
- * @brief Test Case for Slider.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- width : mainWindowLoader.width
- height: mainWindowLoader.height
- Loader {
- id: mainWindowLoader
- asynchronous : false
- }
-
- TestCase {
- name: "Show"
- when: windowShown
- property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
- property var mainObject
- property var sldUI
- property var dataContainer
- property var contentLoader
-
- property var softButtonsListExample : [
- {softButtonID:0, isHighlighted:true, systemAction:Common.SystemAction.DEFAULT_ACTION,
- type:Common.SoftButtonType.SBT_TEXT, text:"Default Action"},
- {softButtonID:1, isHighlighted:false, systemAction:Common.SystemAction.STEAL_FOCUS,
- type:Common.SoftButtonType.SBT_IMAGE, text:"Steal Focus"},
- {softButtonID:2, isHighlighted:false, systemAction:Common.SystemAction.KEEP_CONTEXT,
- type:Common.SoftButtonType.SBT_BOTH, text:"Keep context"}]
-
-
- //initialization for each test
- function createShow(appID) {
- mainWindowLoader.source = ""
- mainWindowLoader.source = "../../../../src/components/qt_hmi/qml_model_qt5/MainWindow.qml"
- var mainWindowObject = mainWindowLoader.item
- if(!mainWindowObject)
- qtest_fail("mainWindowObject is undefined");
- var mainScreen = mainWindowObject.getMainScreen()
- mainScreen.visible = true
- var warningInfo = mainWindowObject.getWarningInfo()
- warningInfo.visible = false
- contentLoader = mainWindowObject.getContentLoader()
- contentLoader.asynchronous = false
- sldUI = mainWindowObject.getUIProxy()
- dataContainer = mainWindowObject.getDataStorage()
- dataContainer.addApplication({appName:"TestAppName", appId:appID})
- }
-
-
-
- //cleanup for each test
- function destroyShow() {
- //Clear Loader with MainWindow, which delete own models and views
- mainWindowLoader.source = ""
- }
-
-
- //Fill up all fields, check save process to dataContainer
- function test_01_create() {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[
- {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
- {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
- {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
- {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
- {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
- {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar"},
- {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
- ],
- softButtons:softButtonsListExample,
- alignment:2,
- graphic:{value:"/home/user/applink/bin/SPTAlice9675308/action.png",imageType: "DYNAMIC"},
- secondaryGraphic:{value:"/home/user/applink/bin/SPTAlice9675308/action.png",imageType: "DYNAMIC"},
- customPresets:["GEN0","GEN1","GEN2","GEN3"]
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
-
- compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
- compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
- compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
- compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
- compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
- compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
- compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
- var a;
- if(app.hmiUITextAlignment === 1) a=0;
- if(app.hmiUITextAlignment === 2) a=1;
- if(app.hmiUITextAlignment === 4) a=2;
- compare(initData.alignment, a, "Alignment")
- compare(app.hmiUIText.image, initData.graphic.value, "image")
- compare(app.hmiUIText.secondaryImage, initData.secondaryGraphic.value, "secdondImage")
- compare(app.softButtons.count, initData.softButtons.length, "wrong buttons count created")
- for (var i = 0, len = app.softButtons.count; i < len; i++)
- {
- var act = app.softButtons.get(i)
- var exp = initData.softButtons[i]
- compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
- compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
- compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
- compare(act.text, exp.text, "wrong text in button")
- }
- compare(app.customPresets.count, initData.customPresets.length, "wrong buttons count created")
- for (var j = 0, len2 = app.customPresets.count; j < len; j++)
- {
- var act2 = app.customPresets.get(j)
- var exp2 = initData.customPresets[j]
- compare(act2.text, exp2, "wrong text in button")
- }
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
- //All fields are empty
- function test_02_emptyInit()
- {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[
- {fieldName:Common.TextFieldName.mainField1 ,fieldText:""},
- {fieldName:Common.TextFieldName.mainField2,fieldText:""},
- {fieldName:Common.TextFieldName.mainField3,fieldText:""},
- {fieldName:Common.TextFieldName.mainField4,fieldText:""},
- {fieldName:Common.TextFieldName.mediaTrack,fieldText:""},
- {fieldName:Common.TextFieldName.statusBar,fieldText:""},
- {fieldName:Common.TextFieldName.mediaClock,fieldText:""}
- ],
- softButtons:[],
- alignment:0,
- graphic:{value:"",imageType: "DYNAMIC"},
- secondaryGraphic:{value:"",imageType: "DYNAMIC"},
- customPresets:[]
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
-
- compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
- compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
- compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
- compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
- compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
- compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
- compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
- var a;
- if(app.hmiUITextAlignment === 1) a=0;
- if(app.hmiUITextAlignment === 2) a=1;
- if(app.hmiUITextAlignment === 4) a=2;
- compare(initData.alignment, a, "Alignment")
- compare(app.hmiUIText.image, initData.graphic.value, "image")
- compare(app.hmiUIText.secondaryImage, initData.secondaryGraphic.value, "secdondImage")
- compare(app.softButtons.count, initData.softButtons.length, "wrong buttons count created")
- for (var i = 0, len = app.softButtons.count; i < len; i++)
- {
- var act = app.softButtons.get(i)
- var exp = initData.softButtons[i]
- compare(act.softButtonID, exp.softButtonID, "wrong softButtonID in button")
- compare(act.isHighlighted, exp.isHighlighted, "wrong isHighlighted in button")
- compare(act.systemAction, exp.systemAction, "wrong systemAction in button")
- compare(act.text, exp.text, "wrong text in button")
- }
- compare(app.customPresets.count, initData.customPresets.length, "wrong buttons count created")
- for (var j = 0, len2 = app.customPresets.count; j < len; j++)
- {
- var act2 = app.customPresets.get(j)
- var exp2 = initData.customPresets[j]
- compare(act2.text, exp2, "wrong text in button")
- }
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
-
- //Mandatory fields only
- function test_03_create_mandatory_only() {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[
- {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
- {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
- {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
- {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
- {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
- {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar"},
- {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
- ]
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
-
- compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
- compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
- compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
- compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
- compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
- compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
- compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
-
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
- //Field with extra param
- function test_04_fake_param() {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[
- {fieldName:Common.TextFieldName.mainField1 ,fieldText:"showString1"},
- {fieldName:Common.TextFieldName.mainField2,fieldText:"showString2"},
- {fieldName:Common.TextFieldName.mainField3,fieldText:"showString3"},
- {fieldName:Common.TextFieldName.mainField4,fieldText:"showString4"},
- {fieldName:Common.TextFieldName.mediaTrack,fieldText:"mediaTrack"},
- {fieldName:Common.TextFieldName.statusBar,fieldText:"StatusBar",fakeParam:"FakeParam"},
- {fieldName:Common.TextFieldName.mediaClock,fieldText:"12:34"}
- ]
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
-
- compare(app.hmiUIText.mainField1 , initData.showStrings[0].fieldText, "mainField1")
- compare(app.hmiUIText.mainField2 , initData.showStrings[1].fieldText, "mainField2")
- compare(app.hmiUIText.mainField3 , initData.showStrings[2].fieldText, "mainField3")
- compare(app.hmiUIText.mainField4 , initData.showStrings[3].fieldText, "mainField4")
- compare(app.hmiUIText.mediaTrack , initData.showStrings[4].fieldText, "mediaTrack")
- compare(app.hmiUIText.statusBar , initData.showStrings[5].fieldText, "StatusBar" )
- compare(app.hmiUIText.mediaClock , initData.showStrings[6].fieldText, "mediaClock")
-
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
- //aligment of mainField1, mainField2
- function test_05_alignment() {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[],
- alignment:0,
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
- //Magic with digits - because enum of text.Alighnment enum and sdl alignment doesn't match
- var a;
- if(app.hmiUITextAlignment === 1) a=0;
- if(app.hmiUITextAlignment === 2) a=1;
- if(app.hmiUITextAlignment === 4) a=2;
- compare(initData.alignment, a, "Alignment")
- initData.alignment=1
- sldUI.show (initData)
- var b;
- if(app.hmiUITextAlignment === 1) b=0;
- if(app.hmiUITextAlignment === 2) b=1;
- if(app.hmiUITextAlignment === 4) b=2;
- compare(initData.alignment, b, "Alignment")
- initData.alignment=2
- sldUI.show (initData)
- var c;
- if(app.hmiUITextAlignment === 1) c=0;
- if(app.hmiUITextAlignment === 2) c=1;
- if(app.hmiUITextAlignment === 4) c=2;
- compare(initData.alignment, c, "Alignment")
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
- //pole bez parametra
- function test_06_no_param() {
- console.debug("enter")
- var initData = {
- appID:1,
- showStrings:[],
- graphic:{imageType: "DYNAMIC"},
- }
-
- createShow(1)
- var app = dataContainer.getApplication(initData.appID)
- sldUI.show (initData)
-
- try {
-
- compare(app.hmiUIText.image, undefined, "image")
-
- }
- catch (e) {}
- destroyShow()
- console.debug("exit")
- }
-}
-}
diff --git a/src/components/qt_hmi/test/src/tst_Slider.qml b/src/components/qt_hmi/test/src/tst_Slider.qml
deleted file mode 100644
index 0e6acef078..0000000000
--- a/src/components/qt_hmi/test/src/tst_Slider.qml
+++ /dev/null
@@ -1,204 +0,0 @@
-/**
- * @file tst_Slider.qml
- * @brief Test Case for Slider.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtTest 1.0
-import QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "../qml_model_qt5/controls"
-import "../qml_model_qt5/views"
-import "../qml_model_qt5/hmi_api" as HmiApi
-import "../qml_model_qt5/models"
-import "../qml_model_qt5/popups"
-import "../qml_model_qt5/hmi_api/Common.js" as Common
-import "../qml_model_qt5/models/Constants.js" as Constants
-import "../qml_model_qt5/models/Internal.js" as Internal
-
-Item {
- TestCase {
- name: "Slider"
- when: windowShown
- property var mainWindowComponent : Qt.createComponent("../qml_model_qt5/MainWindow.qml")
- property var mainObject
- property var sldUI
- property var dataContainer
- property var sliderPopup
- property var timer
-
- function createSlider() {
- mainObject = mainWindowComponent.createObject(parent)
- var mainScreen = mainObject.getMainScreen()
- mainScreen.visible = true
- sldUI = mainObject.getUIProxy()
- dataContainer = mainObject.getDataStorage()
- sliderPopup = mainObject.getSlider()
- timer = sliderPopup.getTimer()
- }
-
-
- function destroySlider() {
- mainObject.destroy()
- }
-
- function test_01_timeoutZero() {
- console.debug("enter")
- var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:0, appID:1}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
- var actualResult = sldUI.slider(initData)
- try {
- compare(actualResult.sliderPosition, initData.position, "slider position")
- } catch(e){}
- destroySlider()
- console.debug("exit")
- }
-
- function test_02_changePosition() {
- console.debug("enter")
- var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
- var expectedResult = {position : 2, resultCode : Common.Result.SUCCESS}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
- sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
-
- sldUI.slider(initData)
-
- timer.onTriggered()
- try {
- compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
- compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
- function test_03_unChangedPosition() {
- console.debug("enter")
- var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
- var expectedResult = {position : 4, resultCode : Common.Result.SUCCESS}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sldUI.slider(initData)
-
- timer.onTriggered()
- try {
- compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
- compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
-
- function test_04_changePositionBackPressed() {
- console.debug("enter")
- var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
- var expectedResult = {position : 4, resultCode : Common.Result.ABORTED}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
- sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
-
- sldUI.slider(initData)
- sliderPopup.getBackButton().clicked()
-
- try {
- compare(dataContainer.uiSlider.position, expectedResult.position, "slider position")
- compare(sliderPopup.resultCode, expectedResult.resultCode, "result code")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
- function test_05_secondCall() {
- console.debug("enter")
- var initData = {numTicks:9, position:4, sliderHeader:"header", sliderFooter:["footer"], timeout:1, appID:1}
- var expectedResult = {position : 5, resultCode : Common.Result.ABORTED}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
- sliderPopup.onReady.connect(function simulateUserAction(){sliderPopup.position = expectedResult.position})
-
- sldUI.slider(initData)
- initData.position = 5
- var actualResult = sldUI.slider(initData)
-
- try {
- compare(actualResult.sliderPosition, expectedResult.position, "slider position")
- compare(actualResult.__retCode, expectedResult.resultCode, "result code")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
- function test_06_footerValueNoChange() {
- console.debug("enter")
- var initData = {numTicks:4, position:3, sliderHeader:"header", sliderFooter:["footer1", "footer2", "footer3", "footer4"], timeout:1, appID:1}
- var expectedResult = {position: 3, footers:["footer1", "footer2", "footer3", "footer4"]}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
-
- sldUI.slider(initData)
-
- try {
- compare(sliderPopup.getFooterText().text, expectedResult.footers[expectedResult.position - 1], "current footer")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
- function test_07_footerValueChange() {
- console.debug("enter")
- var initData = {numTicks:4, position:2, sliderHeader:"header", sliderFooter:["footer1", "footer2", "footer3", "footer4"], timeout:1, appID:1}
- var expectedResult = {position: 3, footers:["footer1", "footer2", "footer3", "footer4"]}
- createSlider()
- dataContainer.addApplication({appName:"TestAppName", appId:initData.appID})
- sliderPopup.onReady.connect(function simulateUserAction(){
- var rect = sliderPopup.getBorderRectangle()
- console.debug("visible", sliderPopup.visible)
- mouseClick(rect, rect.width / initData.numTicks * expectedResult.position, 1)
- })
-
- sldUI.slider(initData)
-
- try {
- compare(sliderPopup.getFooterText().text, expectedResult.footers[expectedResult.position - 1], "current footer")
- } catch (e) {}
- destroySlider()
- console.debug("exit")
- }
-
- }
-}
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h
index 6792f47732..10b494465c 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -42,11 +42,6 @@ namespace Json {
class Value;
} // namespace Json
-namespace dbus {
-class MessageReader;
-class MessageWriter;
-} // namespace dbus
-
namespace rpc {
class ValidationReport;
@@ -173,12 +168,10 @@ class Boolean : public PrimitiveType {
Boolean();
explicit Boolean(bool value);
explicit Boolean(const Json::Value* value);
- explicit Boolean(dbus::MessageReader* reader);
Boolean(const Json::Value* value, bool def_value);
Boolean& operator=(bool new_val);
operator bool() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -197,7 +190,6 @@ class Integer : public PrimitiveType {
explicit Integer(IntType value);
Integer(const Integer& value);
explicit Integer(const Json::Value* value);
- explicit Integer(dbus::MessageReader* reader);
Integer(const Json::Value* value, IntType def_value);
Integer& operator=(IntType new_val);
Integer& operator=(const Integer& new_val);
@@ -205,7 +197,6 @@ class Integer : public PrimitiveType {
Integer& operator+=(int value);
operator IntType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
IntType value_;
@@ -219,12 +210,10 @@ class Float : public PrimitiveType {
Float();
explicit Float(double value);
explicit Float(const Json::Value* value);
- explicit Float(dbus::MessageReader* reader);
Float(const Json::Value* value, double def_value);
Float& operator=(double new_val);
operator double() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
double value_;
@@ -239,7 +228,6 @@ class String : public PrimitiveType {
explicit String(const std::string& value);
explicit String(const char* value);
explicit String(const Json::Value* value);
- explicit String(dbus::MessageReader* reader);
String(const Json::Value* value, const std::string& def_value);
bool operator<(const String& new_val) const;
String& operator=(const std::string& new_val);
@@ -247,7 +235,6 @@ class String : public PrimitiveType {
bool operator==(const String& rhs) const;
operator const std::string&() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
std::string value_;
@@ -265,12 +252,10 @@ class Enum : public PrimitiveType {
Enum();
explicit Enum(EnumType value);
explicit Enum(const Json::Value* value);
- explicit Enum(dbus::MessageReader* reader);
Enum(const Json::Value* value, EnumType def_value);
Enum& operator=(const EnumType& new_val);
operator EnumType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -289,7 +274,6 @@ class Array : public std::vector<T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Array(Json::Value* value);
explicit Array(const Json::Value* value);
- explicit Array(dbus::MessageReader* reader);
template <typename U>
explicit Array(const U& value);
template <typename U>
@@ -298,7 +282,6 @@ class Array : public std::vector<T>, public CompositeType {
template <typename U>
void push_back(const U& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
virtual bool is_valid() const;
bool is_initialized() const;
@@ -320,7 +303,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Map(Json::Value* value);
explicit Map(const Json::Value* value);
- explicit Map(dbus::MessageReader* reader);
template <typename U>
explicit Map(const U& value);
template <typename U>
@@ -329,7 +311,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
template <typename U>
void insert(const std::pair<std::string, U>& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
bool is_valid() const;
bool is_initialized() const;
@@ -343,7 +324,6 @@ class Nullable : public T {
public:
// Methods
Nullable();
- explicit Nullable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Nullable(Json::Value* value);
explicit Nullable(const Json::Value* value);
@@ -370,7 +350,6 @@ class Stringifyable : public T {
public:
// Methods
Stringifyable();
- explicit Stringifyable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Stringifyable(Json::Value* value);
explicit Stringifyable(const Json::Value* value);
@@ -398,15 +377,12 @@ class Optional {
public:
// Methods
Optional();
- explicit Optional(dbus::MessageReader* reader);
template <typename U>
explicit Optional(const U& value);
template <typename U>
Optional(const Json::Value* value, const U& def_value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
-
// Pointer semantics
T& operator*();
const T& operator*() const;
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
deleted file mode 100644
index aae1a34ac2..0000000000
--- a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-
-#include "dbus/dbus_message.h"
-#include "json/value.h"
-#include "rpc_base/rpc_base.h"
-
-namespace rpc {
-
-// static
-inline PrimitiveType::ValueState PrimitiveType::InitHelper(bool is_next) {
- return is_next ? kValid : kInvalid;
-}
-
-// static
-inline CompositeType::InitializationState CompositeType::InitHelper(
- bool is_next) {
- return is_next ? kInitialized : kUninitialized;
-}
-
-namespace impl {
-
-// Helper functions to statically map int types to appropriate
-// MessageReader functions
-
-// Non-specialized versions doesn't have implementation
-
-// Tells if next element of reader is of type T
-template <typename T>
-inline bool NextIs(const dbus::MessageReader& reader);
-// Takes next element of type T from reader
-template <typename T>
-inline T Take(dbus::MessageReader* reader);
-
-template <>
-inline bool NextIs<int8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline int8_t Take<int8_t>(dbus::MessageReader* reader) {
- return static_cast<int8_t>(reader->TakeByte());
-}
-
-inline void Put(int8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(static_cast<uint8_t>(val));
-}
-
-template <>
-inline bool NextIs<uint8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline uint8_t Take<uint8_t>(dbus::MessageReader* reader) {
- return reader->TakeByte();
-}
-
-inline void Put(uint8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(val);
-}
-
-template <>
-inline bool NextIs<int16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt16();
-}
-
-template <>
-inline int16_t Take<int16_t>(dbus::MessageReader* reader) {
- return reader->TakeInt16();
-}
-
-inline void Put(int16_t val, dbus::MessageWriter* writer) {
- writer->PutInt16(val);
-}
-
-template <>
-inline bool NextIs<uint16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint16();
-}
-
-template <>
-inline uint16_t Take<uint16_t>(dbus::MessageReader* reader) {
- return reader->TakeUint16();
-}
-
-inline void Put(uint16_t val, dbus::MessageWriter* writer) {
- writer->PutUint16(val);
-}
-
-template <>
-inline bool NextIs<int32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt32();
-}
-
-template <>
-inline int32_t Take<int32_t>(dbus::MessageReader* reader) {
- return reader->TakeInt32();
-}
-
-inline void Put(int32_t val, dbus::MessageWriter* writer) {
- writer->PutInt32(val);
-}
-
-template <>
-inline bool NextIs<uint32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint32();
-}
-
-template <>
-inline uint32_t Take<uint32_t>(dbus::MessageReader* reader) {
- return reader->TakeUint32();
-}
-
-inline void Put(uint32_t val, dbus::MessageWriter* writer) {
- writer->PutUint32(val);
-}
-
-template <>
-inline bool NextIs<int64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt64();
-}
-
-template <>
-inline int64_t Take<int64_t>(dbus::MessageReader* reader) {
- return reader->TakeInt64();
-}
-
-inline void Put(int64_t val, dbus::MessageWriter* writer) {
- writer->PutInt64(val);
-}
-
-template <>
-inline bool NextIs<uint64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint64();
-}
-
-template <>
-inline uint64_t Take<uint64_t>(dbus::MessageReader* reader) {
- return reader->TakeUint64();
-}
-
-inline void Put(uint64_t val, dbus::MessageWriter* writer) {
- writer->PutUint64(val);
-}
-
-template <>
-inline std::string Take<std::string>(dbus::MessageReader* reader) {
- return reader->TakeString();
-}
-
-inline void Put(const std::string val, dbus::MessageWriter* writer) {
- writer->PutString(val);
-}
-
-// Type to DBus type id mappers
-template <typename T>
-char DbusTypeCode();
-template <>
-inline char DbusTypeCode<bool>() {
- return DBUS_TYPE_BOOLEAN;
-}
-// There is no dbus type for signed byte, map to unsigned
-template <>
-inline char DbusTypeCode<int8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<uint8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<int16_t>() {
- return DBUS_TYPE_INT16;
-}
-template <>
-inline char DbusTypeCode<uint16_t>() {
- return DBUS_TYPE_UINT16;
-}
-template <>
-inline char DbusTypeCode<int32_t>() {
- return DBUS_TYPE_INT32;
-}
-template <>
-inline char DbusTypeCode<uint32_t>() {
- return DBUS_TYPE_UINT32;
-}
-template <>
-inline char DbusTypeCode<int64_t>() {
- return DBUS_TYPE_INT64;
-}
-template <>
-inline char DbusTypeCode<uint64_t>() {
- return DBUS_TYPE_UINT64;
-}
-template <>
-inline char DbusTypeCode<double>() {
- return DBUS_TYPE_DOUBLE;
-}
-template <>
-inline char DbusTypeCode<std::string>() {
- return DBUS_TYPE_STRING;
-}
-template <>
-inline char DbusTypeCode<const std::string>() {
- return DBUS_TYPE_STRING;
-}
-
-// Non-specialized template supposes there is static
-// void GetDbusSignature(std::string*) method in T
-template <typename T>
-struct DbusSignatureHelper {
- static void DbusSignature(std::string* signature) {
- T::GetDbusSignature(signature);
- }
-};
-
-template <>
-struct DbusSignatureHelper<Boolean> {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- }
-};
-
-template <typename T, T minval, T maxval>
-struct DbusSignatureHelper<Integer<T, minval, maxval> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<T>();
- }
-};
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-struct DbusSignatureHelper<Float<minnum, maxnum, minden, maxden> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<double>();
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Enum<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<int32_t>();
- }
-};
-
-template <size_t minlen, size_t maxlen>
-struct DbusSignatureHelper<String<minlen, maxlen> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<std::string>();
- }
-};
-
-template <typename K, typename V>
-struct DbusSignatureHelper<std::pair<K, V> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_DICT_ENTRY_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<K>();
- rpc::impl::DbusSignatureHelper<V>::DbusSignature(signature);
- (*signature) += DBUS_DICT_ENTRY_END_CHAR;
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Array<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Map<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<typename Map<T, minsize, maxsize>::
- value_type>::DbusSignature(signature);
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Optional<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Nullable<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-// Helper Optional type initialization functipon
-template <typename T>
-T TakeOptional(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool available = struct_reader.TakeBool();
- T value(&struct_reader);
- return available ? value : T();
-}
-
-// Helper Nullable type initialization functipon
-template <typename T>
-bool TakeNullable(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool is_null = struct_reader.TakeBool();
- return is_null;
-}
-
-} // namespace impl
-
-// Helper function that outputs dbus signature for type T
-template <typename T>
-void DbusSignature(std::string* signature) {
- impl::DbusSignatureHelper<T>::DbusSignature(signature);
-}
-
-// Type constructors
-inline Boolean::Boolean(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsBool()))
- , value_(reader->TakeBool()) {}
-
-template <typename T, T minval, T maxval>
-inline Integer<T, minval, maxval>::Integer(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(impl::NextIs<IntType>(*reader)))
- , value_(impl::Take<IntType>(reader)) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline Float<minnum, maxnum, minden, maxden>::Float(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsDouble()))
- , value_(reader->TakeDouble()) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <size_t minlen, size_t maxlen>
-inline String<minlen, maxlen>::String(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsString()))
- , value_(reader->TakeString()) {
- if (is_valid()) {
- value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
- }
-}
-
-template <typename T>
-inline Enum<T>::Enum(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsInt32()))
- , value_(EnumType(reader->TakeInt32())) {
- if (is_valid()) {
- value_state_ = IsValidEnum(value_) ? kValid : kInvalid;
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Array<T, minsize, maxsize>::Array(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsArray())) {
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- push_back(T());
- } else {
- while (array_reader.HasNext()) {
- push_back(T(&array_reader));
- }
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Map<T, minsize, maxsize>::Map(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsStruct())) {
- // Map key-value pairs are serialized into array
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- this->insert(typename MapType::value_type("", T()));
- } else {
- while (array_reader.HasNext()) {
- dbus::MessageReader dictvalue_reader = array_reader.TakeDictEntryReader();
- typename MapType::key_type key =
- impl::Take<typename MapType::key_type>(&dictvalue_reader);
- this->insert(typename MapType::value_type(key, T(&dictvalue_reader)));
- }
- }
-}
-
-template <typename T>
-inline Nullable<T>::Nullable(dbus::MessageReader* reader)
- : T(reader), marked_null_(impl::TakeNullable<T>(reader)) {}
-
-template <typename T>
-inline Optional<T>::Optional(dbus::MessageReader* reader)
- : value_(impl::TakeOptional<T>(reader)) {}
-
-// MessageWriter serializers
-inline void Boolean::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutBool(value_);
-}
-
-template <typename T, T minval, T maxval>
-inline void Integer<T, minval, maxval>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- impl::Put(value_, writer);
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline void Float<minnum, maxnum, minden, maxden>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutDouble(value_);
-}
-
-template <size_t minlen, size_t maxlen>
-inline void String<minlen, maxlen>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutString(value_);
-}
-
-template <typename T>
-inline void Enum<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutInt32(static_cast<int32_t>(value_));
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Array<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename ArrayType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename ArrayType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- i->ToDbusWriter(&array_writer);
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Map<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename MapType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename MapType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- dbus::MessageWriter dictentry_writer(&array_writer, dbus::kDictEntry, NULL);
- impl::Put(i->first, &dictentry_writer);
- i->second.ToDbusWriter(&dictentry_writer);
- }
-}
-
-template <typename T>
-inline void Optional<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- dbus::MessageWriter struct_writer(writer, dbus::kStruct, NULL);
- struct_writer.PutBool(value_.is_initialized());
- value_.ToDbusWriter(&struct_writer);
-}
-
-} // namespace rpc
-
-#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
index 6070f5d757..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
@@ -547,12 +547,14 @@ void Nullable<T>::ReportErrors(ValidationReport* report) const {
* Optional class
*/
template <typename T>
-Optional<T>::Optional() {}
+Optional<T>::Optional()
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE) {}
template <typename T>
template <typename U>
Optional<T>::Optional(const U& value)
- : value_(value) {}
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE)
+ , value_(value) {}
template <typename T>
T& Optional<T>::operator*() {
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 05e9406317..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
@@ -350,7 +350,8 @@ inline Json::Value Nullable<T>::ToJsonValue() const {
template <typename T>
template <typename U>
Optional<T>::Optional(const Json::Value* value, const U& def_value)
- : value_(value, def_value) {}
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE)
+ , value_(value, def_value) {}
template <typename T>
inline Json::Value Optional<T>::ToJsonValue() const {
diff --git a/src/components/rpc_base/include/rpc_base/validation_report.h b/src/components/rpc_base/include/rpc_base/validation_report.h
deleted file mode 100644
index 4397112d54..0000000000
--- a/src/components/rpc_base/include/rpc_base/validation_report.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
-#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
-
-#include <string>
-#include <list>
-
-namespace rpc {
-
-class ValidationReport;
-typedef std::list<ValidationReport> ValidationReports;
-
-class ValidationReport {
- public:
- explicit ValidationReport(const std::string& object_name);
- const std::string& object_name() const;
- const std::string& validation_info() const;
- void set_validation_info(const std::string& info);
- const ValidationReports& subobject_reports() const;
- ValidationReport& ReportSubobject(const std::string& object_name);
-
- private:
- std::string object_name_;
- std::string validation_info_;
- ValidationReports subobject_reports_;
-};
-
-std::string PrettyFormat(const ValidationReport& report);
-
-// Implementation
-
-namespace impl {
-inline void PrettyFormat(const ValidationReport& report,
- const std::string& parent_path,
- std::string* result) {
- std::string object_path = parent_path;
- if (!object_path.empty() && report.object_name()[0] != '[') {
- object_path.append(".");
- }
- object_path.append(report.object_name());
- if (!report.validation_info().empty()) {
- result->append(object_path);
- result->append(": ");
- result->append(report.validation_info());
- result->append("\n");
- }
- const ValidationReports& subreports = report.subobject_reports();
- for (ValidationReports::const_iterator i = subreports.begin(),
- end = subreports.end();
- i != end;
- ++i) {
- PrettyFormat(*i, object_path, result);
- }
-}
-} // namespace impl
-
-inline ValidationReport::ValidationReport(const std::string& object_name)
- : object_name_(object_name) {}
-
-inline const std::string& ValidationReport::object_name() const {
- return object_name_;
-}
-
-inline const std::string& ValidationReport::validation_info() const {
- return validation_info_;
-}
-
-inline void ValidationReport::set_validation_info(const std::string& info) {
- validation_info_ = info;
-}
-
-inline const std::list<ValidationReport>& ValidationReport::subobject_reports()
- const {
- return subobject_reports_;
-}
-
-inline ValidationReport& ValidationReport::ReportSubobject(
- const std::string& object_name) {
- subobject_reports_.push_back(ValidationReport(object_name));
- return subobject_reports_.back();
-}
-
-inline std::string PrettyFormat(const ValidationReport& report) {
- std::string result;
- impl::PrettyFormat(report, "", &result);
- return result;
-}
-
-} // namespace rpc
-
-#endif // 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 566f0ddcde..ae87bb71b7 100644
--- a/src/components/rpc_base/test/CMakeLists.txt
+++ b/src/components/rpc_base/test/CMakeLists.txt
@@ -31,10 +31,7 @@
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- ${COMPONENTS_DIR}/dbus/include
- ${COMPONENTS_DIR}/dbus/src
${COMPONENTS_DIR}/rpc_base/include
- ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8
${GMOCK_INCLUDE_DIRECTORY}
${JSONCPP_INCLUDE_DIRECTORY}
)
@@ -44,16 +41,5 @@ set(LIBRARIES
jsoncpp
)
-if(${HMI_DBUS_API})
- include_directories(${DBUS_INCLUDE_DIRS})
- list(APPEND LIBRARIES
- DBus
- )
-else()
- set(EXCLUDE_PATHS
- rpc_base_dbus_test.cc
- )
-endif()
-
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
create_test(rpc_base_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc
deleted file mode 100644
index 4a22e111a3..0000000000
--- a/src/components/rpc_base/test/rpc_base_dbus_test.cc
+++ /dev/null
@@ -1,682 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "dbus/dbus_message.h"
-#include "rpc_base/rpc_base.h"
-#include "rpc_base/rpc_base_dbus_inl.h"
-
-namespace test {
-namespace components {
-namespace rpc_base_test {
-
-using namespace rpc;
-using namespace dbus;
-
-enum TestEnum { kValue0, kValue1, kInvalidValue };
-
-bool IsValidEnum(TestEnum val) {
- return val == kValue0 || val == kValue1;
-}
-
-bool EnumFromJsonString(const std::string& value, TestEnum* enm) {
- if (value == "kValue0") {
- *enm = kValue0;
- return true;
- } else if (value == "kValue1") {
- *enm = kValue1;
- return true;
- } else {
- return false;
- }
-}
-
-const char* EnumToJsonString(TestEnum enm) {
- switch (enm) {
- case kValue0:
- return "kValue0";
- case kValue1:
- return "kValue1";
- default:
- return "UNKNOWN";
- }
-}
-
-struct DbusDeserialization : public testing::Test {
- dbus::MessageRef msgref;
- DbusDeserialization()
- : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusDeserialization, DeserializeBool) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean booln(&reader);
- ASSERT_TRUE(booln);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeByte) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutByte(200);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<uint8_t, 1, 220> byte(&reader);
- ASSERT_TRUE(byte.is_initialized());
- ASSERT_TRUE(byte.is_valid());
- ASSERT_EQ(byte, 200);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeInt64) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt64(-1);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, -5, 220> int64(&reader);
- ASSERT_TRUE(int64.is_initialized());
- ASSERT_TRUE(int64.is_valid());
- ASSERT_EQ(int64, -1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeFloat) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<3, 4> pi(&reader);
- ASSERT_TRUE(pi.is_initialized());
- ASSERT_TRUE(pi.is_valid());
- ASSERT_DOUBLE_EQ(pi, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeString) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- String<3, 10> hello(&reader);
- ASSERT_TRUE(hello.is_initialized());
- ASSERT_TRUE(hello.is_valid());
- ASSERT_EQ(std::string(hello), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeEnum) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(kValue1);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> enm(&reader);
- ASSERT_TRUE(enm.is_initialized());
- ASSERT_TRUE(enm.is_valid());
- ASSERT_EQ(enm, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArray) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- array_writer.PutInt32(5);
- array_writer.PutInt32(33);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 50>, 1, 100> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0], 5);
- ASSERT_EQ(array[1], 33);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArrayOfArrays) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Array<Integer<int32_t, 1, 50>, 1, 5> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- int val = 5;
- for (int i = 0; i < 2; ++i) {
- std::string subarray_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&subarray_signature);
- dbus::MessageWriter subarray_wirter(
- &array_writer, dbus::kArray, subarray_signature.c_str());
-
- subarray_wirter.PutInt32(val++);
- subarray_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Array<Integer<int32_t, 1, 50>, 1, 5>, 1, 5> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0].size(), 2u);
- ASSERT_EQ(array[1].size(), 2u);
- ASSERT_EQ(array[0][0], 5);
- ASSERT_EQ(array[0][1], 6);
- ASSERT_EQ(array[1][0], 7);
- ASSERT_EQ(array[1][1], 8);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeMap) {
- {
- dbus::MessageWriter writer(msgref);
- std::string dict_signature;
- rpc::DbusSignature<Map<Enum<TestEnum>, 1, 5>::value_type>(&dict_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, dict_signature.c_str());
- const char* keys[] = {"Hello", "World"};
- int val = 0;
- for (int i = 0; i < 2; ++i) {
- dbus::MessageWriter dictval_wirter(&array_writer, dbus::kDictEntry, NULL);
- dictval_wirter.PutString(keys[val]);
- dictval_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Enum<TestEnum>, 1, 5> amap(&reader);
- ASSERT_TRUE(amap.is_initialized());
- ASSERT_TRUE(amap.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(amap.size(), 2u);
- ASSERT_EQ(amap["Hello"], kValue0);
- ASSERT_EQ(amap["World"], kValue1);
- }
-}
-
-TEST_F(DbusDeserialization, InconsistentTypesTest) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean badbool(&reader);
- ASSERT_TRUE(badbool.is_initialized());
- ASSERT_FALSE(badbool.is_valid());
- ASSERT_TRUE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalString) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(true);
- optwriter.PutString("Hello dear");
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<String<1, 100> > readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(*readback), "Hello dear");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalInt) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(false);
- optwriter.PutInt32(42);
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<Integer<int32_t, 1, 90> > readback(&reader);
- ASSERT_FALSE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeBool) {
- {
- Boolean true_bool(true);
- dbus::MessageWriter writer(msgref);
- true_bool.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, true);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 100> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 100> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 42);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, BadSerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 12> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_FALSE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt64t) {
- {
- Integer<int64_t, 1, 0xFFFFFFFFFF> int64(0xFFFFFFFFF1);
- dbus::MessageWriter writer(msgref);
- int64.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, 1, 0xFFFFFFFFFF> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 0xFFFFFFFFF1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeDouble) {
- {
- Float<1, 5> flt(3.14);
- dbus::MessageWriter writer(msgref);
- flt.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<1, 5> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_DOUBLE_EQ(readback, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeString) {
- {
- String<1, 12> hello("Hello");
- dbus::MessageWriter writer(msgref);
- hello.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- String<1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(readback), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeEnum) {
- {
- Enum<TestEnum> te(kValue1);
- dbus::MessageWriter writer(msgref);
- te.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeArray) {
- {
- Array<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints.push_back(42);
- ints.push_back(17);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback[0], 42);
- ASSERT_EQ(readback[1], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMap) {
- {
- Map<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints["first"] = 42;
- ints["second"] = 17;
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback["first"], 42);
- ASSERT_EQ(readback["second"], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMapOfArrays) {
- {
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> ints;
- ints["first"].push_back(1);
- ints["first"].push_back(42);
- ints["second"].push_back(17);
- ints["second"].push_back(3);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback.size(), 2u);
- ASSERT_EQ(readback["first"].size(), 2u);
- ASSERT_EQ(readback["second"].size(), 2u);
- ASSERT_EQ(readback["first"][0], 1);
- ASSERT_EQ(readback["first"][1], 42);
- ASSERT_EQ(readback["second"][0], 17);
- ASSERT_EQ(readback["second"][1], 3);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST(ValidatedTypes, TestBooleanDbusSignature) {
- std::string sign;
- DbusSignature<Boolean>(&sign);
- ASSERT_EQ(sign, "b");
-}
-
-TEST(ValidatedTypes, TestIntDbusSignature) {
- std::string sign;
- DbusSignature<Integer<int32_t, 1, 2> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestFloatDbusSignature) {
- std::string sign;
- DbusSignature<Float<1, 2> >(&sign);
- ASSERT_EQ(sign, "d");
-}
-
-TEST(ValidatedTypes, TestStringDbusSignature) {
- std::string sign;
- DbusSignature<String<1, 2> >(&sign);
- ASSERT_EQ(sign, "s");
-}
-
-TEST(ValidatedTypes, TestEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestIntArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Integer<int32_t, 1, 2>, 1, 3> >(&sign);
- ASSERT_EQ(sign, "ai");
-}
-
-TEST(ValidatedTypes, TestIntArrayArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Array<Integer<int32_t, 1, 2>, 1, 3>, 4, 5> >(&sign);
- ASSERT_EQ(sign, "aai");
-}
-
-TEST(ValidatedTypes, TestMapDbusSignature) {
- std::string sign;
- DbusSignature<Map<Integer<int32_t, 1, 2>, 3, 4> >(&sign);
- ASSERT_EQ(sign, "a{si}");
-}
-
-TEST(ValidatedTypes, TestMandatoryEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestOptionalEnumDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Enum<TestEnum> > >(&sign);
- ASSERT_EQ(sign, "(bi)");
-}
-
-TEST(ValidatedTypes, TestOptionalFloatArrayDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Array<Float<1, 2>, 3, 4> > >(&sign);
- ASSERT_EQ(sign, "(bad)");
-}
-
-TEST(DbusMessageConstructionTest, DbusMessageConstruction) {
- DBusMessage* rawmsg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
- dbus::MessageRef msgref(rawmsg);
-}
-
-class DbusTest : public testing::Test {
- public:
- dbus::MessageRef msgref;
- DbusTest() : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusTest, DbusWriterConstructionTest) {
- dbus::MessageWriter writer(msgref);
-}
-
-TEST_F(DbusTest, DbusEmptyMessageReaderTest) {
- dbus::MessageReader reader(msgref);
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusTest, DbusMessageWriterBoolWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- dbus::MessageReader reader(msgref);
- bool redback_value = reader.TakeBool();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_TRUE(redback_value);
-}
-
-TEST_F(DbusTest, DbusMessageWriterInt32WriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(42);
- dbus::MessageReader reader(msgref);
- int32_t readback_value = reader.TakeInt32();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, 42);
-}
-
-TEST_F(DbusTest, DbusMessageWriterStringWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- dbus::MessageReader reader(msgref);
- std::string readback_value = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, "Hello DBus!");
-}
-
-TEST_F(DbusTest, DbusMultipleParamsReadWrite) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- writer.PutInt16(42);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- std::string readback_string = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_string, "Hello DBus!");
- int16_t readback_int = reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_int, 42);
- double readback_double = reader.TakeDouble();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_DOUBLE_EQ(readback_double, 3.14);
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusTest, DbusArrayTest) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, DBUS_TYPE_INT16_AS_STRING);
- array_writer.PutInt16(3);
- array_writer.PutInt16(4);
- array_writer.PutInt16(5);
- }
- {
- dbus::MessageReader reader(msgref);
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- int16_t readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 3);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 4);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 5);
- ASSERT_FALSE(array_reader.HasNext());
- }
-}
-
-class DbusFailuresTest : public testing::Test {
- public:
- dbus::MessageRef int_msg;
- DbusFailuresTest()
- : int_msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {
- dbus::MessageWriter writer(int_msg);
- writer.PutInt64(42);
- }
-};
-
-TEST_F(DbusFailuresTest, DbusInconsistentTypeReadFailureTest) {
- dbus::MessageReader reader(int_msg);
- std::string str = reader.TakeString();
- ASSERT_EQ(str, std::string(""));
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusFailuresTest, DbusNonExistentArrayReadTest) {
- dbus::MessageReader reader(int_msg);
- ASSERT_FALSE(reader.has_failed());
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_TRUE(reader.has_failed());
- int64_t val = array_reader.TakeInt64();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_EQ(val, 0);
-}
-
-} // namespace rpc_base_test
-} // namespace components
-} // namespace test
diff --git a/src/components/rpc_base/test/rpc_base_test.cc b/src/components/rpc_base/test/rpc_base_test.cc
index c4ffbc321e..d81e01db6c 100644
--- a/src/components/rpc_base/test/rpc_base_test.cc
+++ b/src/components/rpc_base/test/rpc_base_test.cc
@@ -320,7 +320,7 @@ TEST(ValidatedTypes, ReportUninitializedIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("val: value is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectInitializedIntType) {
@@ -328,7 +328,7 @@ TEST(ValidatedTypes, ReportIncorrectInitializedIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("val: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportUninitializedOptionalType) {
@@ -344,7 +344,7 @@ TEST(ValidatedTypes, ReportIncorrectInitializedOptionalType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("val: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportUninitializedNullableIntType) {
@@ -352,7 +352,7 @@ TEST(ValidatedTypes, ReportUninitializedNullableIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("val: value is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportNullInitializedNullableIntType) {
@@ -369,7 +369,7 @@ TEST(ValidatedTypes, ReportNoninitializedIntArray) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array: object is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("array: object is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray1) {
@@ -378,7 +378,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray1) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array[0]: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("array[0]: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray2) {
@@ -390,7 +390,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray2) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array: array has invalid size\n", PrettyFormat(report));
+ ASSERT_EQ("array: array has invalid size", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedArray3) {
@@ -403,7 +403,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedArray3) {
array.ReportErrors(&report);
ASSERT_EQ(
"array: array has invalid size\n"
- "array[2]: value initialized incorrectly\n",
+ "array[2]: value initialized incorrectly",
PrettyFormat(report));
}
@@ -411,7 +411,7 @@ TEST(ValidatedTypes, ReportUninitializedMap) {
Map<Integer<int8_t, 1, 10>, 1, 3> map;
ValidationReport report("map");
map.ReportErrors(&report);
- ASSERT_EQ("map: object is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("map: object is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedMap1) {
@@ -419,7 +419,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap1) {
map["aha"] = 42;
ValidationReport report("map");
map.ReportErrors(&report);
- ASSERT_EQ("map[\"aha\"]: value initialized incorrectly\n",
+ ASSERT_EQ("map[\"aha\"]: value initialized incorrectly",
PrettyFormat(report));
}
@@ -433,7 +433,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap2) {
map.ReportErrors(&report);
ASSERT_EQ(
"map[\"haha\"]: value initialized incorrectly\n"
- "map[\"muhahaha\"]: value initialized incorrectly\n",
+ "map[\"muhahaha\"]: value initialized incorrectly",
PrettyFormat(report));
}
diff --git a/src/components/rpc_base/test/validation_report_test.cc b/src/components/rpc_base/test/validation_report_test.cc
index 596bfdb20d..10effe7dd2 100644
--- a/src/components/rpc_base/test/validation_report_test.cc
+++ b/src/components/rpc_base/test/validation_report_test.cc
@@ -75,7 +75,7 @@ class ValidationReportTest : public testing::Test {
} else {
temp = "";
}
- result = parent_name + temp + obj_name + ":" + " " + val_info + "\n";
+ result = parent_name + temp + obj_name + ":" + " " + val_info;
}
void ClearValidationInfo() {
diff --git a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox b/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
deleted file mode 100644
index 42da2364d3..0000000000
--- a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
-\page security_manager Security Manager Detailed Design
-## Table of contents
-- \subpage security_manager_intoduction
- + \ref security_manager_rationale "1.1 Rationale"
- + \ref security_manager_scope "1.2 Scope"
- + \ref security_manager_abbreviations "1.3 Abbreviations"
-- \subpage security_manager_detail_design
- + \ref security_manager_design_solutions "2.1 Design solutions"
- + \ref security_manager_class_structure "2.2 Class Structure"
- + \ref security_manager_sequence_diagram "2.3 Sequence diagram"
- + \ref security_manager_state_chart "2.4 State chart diagram"
-- \subpage security_manager_interfaces
- + \ref security_manager_public_interfaces "3.1 Public interfaces description"
- + \ref security_manager_internal_interfaces "3.2 Internal interfaces description"
- + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies"
-- \subpage security_manager_data_structure_resources
- + \ref security_manager_data_structure "4.1 Element Data Structure"
- + \ref security_manager_resources "4.2 Resource usage"
-- \subpage security_manager_references_and_history
- + \ref security_manager_references "5.1 References"
- + \ref security_manager_history "5.2 Document history change and approve"
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_intoduction 1 Introduction
-The document is intended to support software developers,
-maintenance and integration engineers with sufficient,
-detailed information concerning the design, development and
-deployment concepts, to accomplish their respective tasks without reliance on the authors.
-
-\anchor security_manager_rationale
-## 1.1 Rationale
-Security Manager implements SDL Architectural Solution according to:
-- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#security-manager
-
-\anchor security_manager_scope
-## 1.2 Scope
-Security Manager component extracted as a separate module for
-Ford channel data protection.
-This components is used to:
-- Provide security communications
-- Protect income and outcome business layer data from interception
-- Verify the relation between a mobile application certificate and its owner
-
-\anchor security_manager_abbreviations
-## 1.3 Abbreviations
-Abbreviations used in this document please find in the table below.
-| Abbreviation | Expansion |
-|------------------|----------------------------------|
-| SSL | Secure Sockets Layer cryptographic protocol |
-| TLS | Transport Layer Security cryptographic protocol |
-| DTLS | Datagram TLS cryptographic protocol |
-
-Definitions used in this document are in the table below.
-
-| Definition | Description |
-|---------------------------|-----------------------------------|
-| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network |
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_detail_design 2 Component detail design
-\anchor security_manager_design_solutions
-### 2.1 Design solutions
-The following design approaches and pattern was used for Security Manager:
-- Protection, creation and business logic is spitted to separates interfaces
- + SecurityManager for handling Security queries from mobile side
- + SSLContext provides for SSL connection establishing, encryption and decryption
- + CryptoManager provides a factory for SSLContext
-- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory)
- used for SSLContext objects creation
- + It also guaranty correctness of SSLContext destruction by the
- same Compiled SecurityManager object
-
-#### Design description
-security_manager::SSLContext is an interface for TLS connection establishing, data encryption and
-decryption within this connection.
-security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure,
-encryption and decryption, contains handshake procedure error handling.
-_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl,
-which implements protocol_handler::SessionObserver interface.
-
-security_manager::CryptoManager is an interface for SSLContext creation and destruction,
-CA certificate update and last SSL error providing.
-security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides
-all OpenSSL initialization logics and SSL internal structures creation.
-
-security_manager::SecurityManager is a Facade of security_manager component and provides
-external interface for security_manager::SSLContext creation and sending security error
-via control service.
-security_manager::SecurityManagerImpl implements security_manager::SecurityManager and
-encapsulates control service data (security internal errors, handshake data) handling.
-
-security_manager::SecurityManagerListener is an interface for protection result notification
-to other components.
-security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending
-protocol layer response on handshake procedure finish.
-
-
-\anchor security_manager_class_structure
-### 2.2 Class Structure
-The following UML class digram shows the component structure.
-![Security Manager class diagram](sm_class_digram.png)
-For more information about class digram follow:
-- http://www.uml-diagrams.org/class-diagrams-overview.htqml
-- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
-
-\anchor security_manager_sequence_diagram
-### 2.3 Sequence diagram
-The following UML sequence digram shows the component dynamic behavior.
-For more information about sequence digram follow:
-- http://www.uml-diagrams.org/sequence-diagrams.html
-- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
-
-Security first initialization on session:
-![Start encryption](sm_sequence_digram_init.png)
-
-Security initialization for service on session with already initialized security:
-![Initialization](sm_sequence_digram_verify.png)
-
-Decryption procedure:
-![Decryption](sm_sequence_digram_decryption.png)
-
-Encryption procedure:
-![Encryption](sm_sequence_digram_encryption.png)
-
-\anchor security_manager_state_chart
-### 2.4 State chart diagram
-Not applicable for Security Manager.
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_interfaces 3 Component Interfaces
-\anchor security_manager_public_interfaces
-### 3.1 Public interfaces description
-Security Manager provides functionality with following interfaces:
-- security_manager::SecurityManager
-- security_manager::SecurityManagerListener
-- security_manager::SSLContext
-
-\anchor security_manager_internal_interfaces
-### 3.2 Internal interfaces description
-The following interfaces are provided by component for internal usage only:
- - security_manager::CryptoManager
- - security_manager::CryptoManagerSettings
-
-\anchor security_manager_derived_interfaces
-### 3.3 Derived interfaces and dependencies
-Security Manager required following 3d-party libraries:
- - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
-
-The following interfaces are required by component:
-- \ref src/components/include/utils Utils
-- protocol_handler::ProtocolObserver for getting Protocol notifications
-- implements protocol_handler::SessionObserver for providing SSLContext object managing
-- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
- + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html)
- - registers the available SSL/TLS ciphers and digests.
- + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html)
- - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX.
- + [(D)TLSv1(_1/2)_(server/client)_method, ]
- (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
- - TLS/SSL connections established with these methods will understand the TLSv1 protocol.
- - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages.
- + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
- - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.
- + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html)
- - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0.
- + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key]
- (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html)
- - load certificate and key data
- + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html)
- - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite)
- + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html)
- - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings.
- + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html)
- - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used.
- + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html)
- - specifies the locations for ctx, at which CA certificates for verification purposes are located.
- + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html)
- - get or set certificate verification status information
- + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html)
- - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started.
- - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state.
- + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html)
- - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer.
- + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html)
- - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl
- - frees up the allocated memory if the reference count has reached 0.
- +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html)
- - BIO allocation and freeing functions
- + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html)
- - BIO I/O functions
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_data_structure_resources 4 Component data and resources
-\anchor security_manager_data_structure
-### 4.1 Element Data Structure
-The following data types are used by the Component:
- - security_manager::SecurityQuery
- - protocol_handler::ProtocolPacket
-
-The format of certificate data exchange is:
- - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512)
-
-\anchor security_manager_resources
-### 4.2 Resource usage
-Security Manager get an assess to certificate and private key
-data using OpenSSl API.
-*/
-//-----------------------------------------------------------
-/**
-\page security_manager_references_and_history 5 References and history
-\anchor security_manager_references
-### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
-- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
-- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
-- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
-- [DTLS RFC](https://tools.ietf.org/html/rfc4347)
-
-\anchor security_manager_history
-### 5.2 Document history
-Document change history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|----------------------------------------|---------------------|
-| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) |
-
-Document approve history
-
-| Version | Data | Author/Editor | Change description |
-|-------------|------------|-----------------------------|---------------------|
-| | | | |
-
-For more precise document change history follow github history -
-- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/security_manager_software_detailed_design.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/security_manager_software_detailed_design.dox
-*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/SDL.SDD.Security.dox b/src/components/security_manager/docs/SDL.SDD.Security.dox
new file mode 100644
index 0000000000..ba35bc116e
--- /dev/null
+++ b/src/components/security_manager/docs/SDL.SDD.Security.dox
@@ -0,0 +1,241 @@
+/**
+\page security_manager Security Manager Detailed Design
+## Table of contents
+- \subpage security_manager_intoduction
+ + \ref security_manager_rationale "1.1 Rationale"
+ + \ref security_manager_scope "1.2 Scope"
+ + \ref security_manager_abbreviations "1.3 Abbreviations"
+- \subpage security_manager_detail_design
+ + \ref security_manager_design_solutions "2.1 Design solutions"
+ + \ref security_manager_class_structure "2.2 Class Structure"
+ + \ref security_manager_sequence_diagram "2.3 Sequence diagram"
+ + \ref security_manager_state_chart "2.4 State chart diagram"
+- \subpage security_manager_interfaces
+ + \ref security_manager_public_interfaces "3.1 Public interfaces description"
+ + \ref security_manager_internal_interfaces "3.2 Internal interfaces description"
+ + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage security_manager_data_structure_resources
+ + \ref security_manager_data_structure "4.1 Element Data Structure"
+ + \ref security_manager_resources "4.2 Resource usage"
+- \subpage security_manager_references_and_history
+ + \ref security_manager_references "5.1 References"
+ + \ref security_manager_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_intoduction 1 Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor security_manager_rationale
+## 1.1 Rationale
+Security Manager implements SDL Architectural Solution according to:
+- https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/#security-manager
+
+\anchor security_manager_scope
+## 1.2 Scope
+Security Manager component extracted as a separate module for
+SDL channel data protection.
+This components is used to:
+- Provide security communications
+- Protect income and outcome business layer data from interception
+- Verify the relation between a mobile application certificate and its owner
+
+\anchor security_manager_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| SSL | Secure Sockets Layer cryptographic protocol |
+| TLS | Transport Layer Security cryptographic protocol |
+| DTLS | Datagram TLS cryptographic protocol |
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|---------------------------|-----------------------------------|
+| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network |
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_detail_design 2 Component detail design
+\anchor security_manager_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for Security Manager:
+- Protection, creation and business logic is spitted to separates interfaces
+ + SecurityManager for handling Security queries from mobile side
+ + SSLContext provides for SSL connection establishing, encryption and decryption
+ + CryptoManager provides a factory for SSLContext
+- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory)
+ used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManager object
+
+#### Design description
+security_manager::SSLContext is an interface for TLS connection establishing, data encryption and
+decryption within this connection.
+security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure,
+encryption and decryption, contains handshake procedure error handling.
+_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl,
+which implements protocol_handler::SessionObserver interface.
+
+security_manager::CryptoManager is an interface for SSLContext creation and destruction,
+CA certificate update and last SSL error providing.
+security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides
+all OpenSSL initialization logics and SSL internal structures creation.
+
+security_manager::SecurityManager is a Facade of security_manager component and provides
+external interface for security_manager::SSLContext creation and sending security error
+via control service.
+security_manager::SecurityManagerImpl implements security_manager::SecurityManager and
+encapsulates control service data (security internal errors, handshake data) handling.
+
+security_manager::SecurityManagerListener is an interface for protection result notification
+to other components.
+security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending
+protocol layer response on handshake procedure finish.
+
+
+\anchor security_manager_class_structure
+### 2.2 Class Structure
+The following UML class diagram shows the component structure.
+![Security Manager class diagram](sm_class_diagram.png)
+For more information about class diagram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.htqml
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor security_manager_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence diagram shows the component dynamic behavior.
+For more information about sequence diagram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+Security first initialization on session:
+![Start encryption](sm_sequence_diagram_init.png)
+
+Security initialization for service on session with already initialized security:
+![Initialization](sm_sequence_diagram_verify.png)
+
+Decryption procedure:
+![Decryption](sm_sequence_diagram_decryption.png)
+
+Encryption procedure:
+![Encryption](sm_sequence_diagram_encryption.png)
+
+\anchor security_manager_state_chart
+### 2.4 State chart diagram
+Not applicable for Security Manager.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_interfaces 3 Component Interfaces
+\anchor security_manager_public_interfaces
+### 3.1 Public interfaces description
+Security Manager provides functionality with following interfaces:
+- security_manager::SecurityManager
+- security_manager::SecurityManagerListener
+- security_manager::SSLContext
+
+\anchor security_manager_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+
+\anchor security_manager_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+Security Manager required following 3d-party libraries:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+- protocol_handler::ProtocolObserver for getting Protocol notifications
+- implements protocol_handler::SessionObserver for providing SSLContext object managing
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html)
+ - registers the available SSL/TLS ciphers and digests.
+ + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html)
+ - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX.
+ + [(D)TLSv1(_1/2)_(server/client)_method, ]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - TLS/SSL connections established with these methods will understand the TLSv1 protocol.
+ - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages.
+ + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.
+ + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html)
+ - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0.
+ + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html)
+ - load certificate and key data
+ + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html)
+ - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite)
+ + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html)
+ - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings.
+ + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html)
+ - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used.
+ + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html)
+ - specifies the locations for ctx, at which CA certificates for verification purposes are located.
+ + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html)
+ - get or set certificate verification status information
+ + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html)
+ - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started.
+ - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state.
+ + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html)
+ - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer.
+ + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html)
+ - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl
+ - frees up the allocated memory if the reference count has reached 0.
+ +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html)
+ - BIO allocation and freeing functions
+ + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html)
+ - BIO I/O functions
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_data_structure_resources 4 Component data and resources
+\anchor security_manager_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+
+The format of certificate data exchange is:
+ - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512)
+
+\anchor security_manager_resources
+### 4.2 Resource usage
+Security Manager get an assess to certificate and private key
+data using OpenSSl API.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_references_and_history 5 References and history
+\anchor security_manager_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
+- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
+- [DTLS RFC](https://tools.ietf.org/html/rfc4347)
+
+\anchor security_manager_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|----------------------------------------|---------------------|
+| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) |
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+| | | | |
+
+For more precise document change history follow github history -
+- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/SDL.SDD.Security.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/SDL.SDD.Security.dox
+*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/assets/sm_class_digram.png b/src/components/security_manager/docs/assets/sm_class_diagram.png
index 61e300f4e7..61e300f4e7 100644
--- a/src/components/security_manager/docs/assets/sm_class_digram.png
+++ b/src/components/security_manager/docs/assets/sm_class_diagram.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
index 849fe45b88..849fe45b88 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
index 66dffd265e..66dffd265e 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
index 334b42b258..334b42b258 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
index cb040c918b..cb040c918b 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
Binary files differ
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
index 6aea2e28b1..5fd7a95155 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -46,7 +46,6 @@
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
namespace security_manager {
class CryptoManagerImpl : public CryptoManager {
@@ -71,6 +70,8 @@ class CryptoManagerImpl : public CryptoManager {
size_t* out_data_size) OVERRIDE;
bool IsInitCompleted() const OVERRIDE;
bool IsHandshakePending() const OVERRIDE;
+ bool GetCertificateDueDate(time_t& due_date) const OVERRIDE;
+ bool HasCertificate() const OVERRIDE;
size_t get_max_block_size(size_t mtu) const OVERRIDE;
std::string LastError() const OVERRIDE;
void ResetConnection() OVERRIDE;
@@ -80,6 +81,15 @@ class CryptoManagerImpl : public CryptoManager {
private:
void PrintCertInfo();
+
+ /**
+ * @brief Removes disallowed for printing certificate information from input
+ * data
+ * @param in_data input data with certificate information
+ * @return filtered string with allowed for printing information
+ */
+ const std::string RemoveDisallowedInfo(X509_NAME* in_data) const;
+
HandshakeResult CheckCertContext();
bool ReadHandshakeData(const uint8_t** const out_data,
size_t* out_data_size);
@@ -92,6 +102,22 @@ class CryptoManagerImpl : public CryptoManager {
std::string GetTextBy(X509_NAME* name, int object) const;
+ /**
+ * @brief Pulls number stored in buffer of chars
+ * and returns it as integer
+ * @param buf where symbols stored
+ * @param idx index of required char to be converted
+ * @return number in integer representation
+ */
+ int get_number_from_char_buf(char* buf, int* idx) const;
+ /**
+ * @brief Converts time from ASN1 format (used in OpenSSL)
+ * to time_t data type
+ * @param time_to_convert time to be converted
+ * @return time in time_t format
+ */
+ time_t convert_asn1_time_to_time_t(ASN1_TIME* time_to_convert) const;
+
SSL* connection_;
BIO* bioIn_;
BIO* bioOut_;
@@ -111,7 +137,7 @@ class CryptoManagerImpl : public CryptoManager {
public:
explicit CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set);
+ const std::shared_ptr<const CryptoManagerSettings> set);
~CryptoManagerImpl();
bool Init() OVERRIDE;
@@ -119,18 +145,65 @@ class CryptoManagerImpl : public CryptoManager {
SSLContext* CreateSSLContext() OVERRIDE;
void ReleaseSSLContext(SSLContext* context) OVERRIDE;
std::string LastError() const OVERRIDE;
- virtual bool IsCertificateUpdateRequired() const OVERRIDE;
+ bool IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const OVERRIDE;
virtual const CryptoManagerSettings& get_settings() const OVERRIDE;
private:
+ bool AreForceProtectionSettingsCorrect() const;
bool set_certificate(const std::string& cert_data);
- int pull_number_from_buf(char* buf, int* idx);
- void asn1_time_to_tm(ASN1_TIME* time);
+ /**
+ * @brief Saves new certificate data on the file system
+ * @param cert_data certificate data in PEM format
+ * @return true if new certificate data was successfully saved on the file
+ * system, otherwise returns false
+ */
+ bool SaveCertificateData(const std::string& cert_data) const;
+
+ /**
+ * @brief Updates certificate and private key for the current SSL context
+ * @param certificate new certificate to update
+ * @param key new private key to update
+ * @return true if certificate and private key were updated successfully,
+ * otherwise returns false
+ */
+ bool UpdateModuleCertificateData(X509* certificate, EVP_PKEY* key);
+
+ /**
+ * @brief Loads X509 certificate from file specified in CryptoManagerSettings
+ * @return returns pointer to the loaded X509 certificate in case of success
+ * otherwise returns NULL
+ */
+ X509* LoadModuleCertificateFromFile();
+
+ /**
+ * @brief Loads private key from file specified in CryptoManagerSettings
+ * @return returns pointer to the loaded private key in case of success
+ * otherwise returns NULL
+ */
+ EVP_PKEY* LoadModulePrivateKeyFromFile();
+
+ /**
+ * @brief Saves new X509 certificate data to file specified in
+ * CryptoManagerSettings
+ * @param certificate new X509 certificate data
+ * @return true if certificate data was saved to the file system otherwise
+ * returns false
+ */
+ bool SaveModuleCertificateToFile(X509* certificate) const;
+
+ /**
+ * @brief Saves new private key data to file specified in
+ * CryptoManagerSettings
+ * @param key new private key data
+ * @return true if private key data was saved to the file system otherwise
+ * returns false
+ */
+ bool SaveModuleKeyToFile(EVP_PKEY* key) const;
- const utils::SharedPtr<const CryptoManagerSettings> settings_;
+ const std::shared_ptr<const CryptoManagerSettings> settings_;
SSL_CTX* context_;
- mutable struct tm expiration_time_;
static uint32_t instance_count_;
static sync_primitives::Lock instance_lock_;
DISALLOW_COPY_AND_ASSIGN(CryptoManagerImpl);
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
index 1e4699b77a..f20d3e4034 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h
@@ -17,6 +17,7 @@ class CryptoManagerSettingsImpl : public CryptoManagerSettings {
return profile_.ssl_mode() == "SERVER" ? security_manager::SERVER
: security_manager::CLIENT;
}
+
Protocol security_manager_protocol_name() const OVERRIDE {
CREATE_LOGGERPTR_LOCAL(logger_, "SecurityManager")
@@ -33,33 +34,59 @@ class CryptoManagerSettingsImpl : public CryptoManagerSettings {
if (protocol_str == "SSLv3") {
return security_manager::SSLv3;
}
+ if (protocol_str == "DTLSv1.0") {
+ return security_manager::DTLSv1;
+ }
+
LOG4CXX_ERROR(
logger_,
"Unknown protocol: " << profile_.security_manager_protocol_name());
return static_cast<security_manager::Protocol>(-1);
}
+
bool verify_peer() const OVERRIDE {
return profile_.verify_peer();
}
+
const std::string& certificate_data() const OVERRIDE {
return certificate_data_;
}
+
const std::string& ciphers_list() const OVERRIDE {
return profile_.ciphers_list();
}
+
const std::string& ca_cert_path() const OVERRIDE {
return profile_.ca_cert_path();
}
+
+ const std::string& module_cert_path() const OVERRIDE {
+ return profile_.cert_path();
+ }
+
+ const std::string& module_key_path() const OVERRIDE {
+ return profile_.key_path();
+ }
+
size_t update_before_hours() const OVERRIDE {
return profile_.update_before_hours();
}
+
size_t maximum_payload_size() const OVERRIDE {
return profile_.maximum_payload_size();
}
+ const std::vector<int>& force_protected_service() const {
+ return profile_.force_protected_service();
+ }
+
+ const std::vector<int>& force_unprotected_service() const {
+ return profile_.force_unprotected_service();
+ }
+
private:
const profile::Profile& profile_;
const std::string certificate_data_;
};
-}
+} // namespace security_manager
#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_SETTINGS_IMPL_H_
diff --git a/src/components/security_manager/include/security_manager/security_manager_impl.h b/src/components/security_manager/include/security_manager/security_manager_impl.h
index d4231ffaa0..c53d39ba87 100644
--- a/src/components/security_manager/include/security_manager/security_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/security_manager_impl.h
@@ -35,6 +35,8 @@
#include <list>
#include <string>
+#include <set>
+#include <memory>
#include "utils/macro.h"
#include "utils/message_queue.h"
@@ -44,6 +46,7 @@
#include "security_manager/security_query.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol/common.h"
+#include "utils/system_time_handler.h"
namespace security_manager {
/**
@@ -67,12 +70,21 @@ typedef threads::MessageLoopThread<SecurityMessageQueue> SecurityMessageLoop;
* \brief SecurityManagerImpl class implements SecurityManager interface
*/
class SecurityManagerImpl : public SecurityManager,
- public SecurityMessageLoop::Handler {
+ public SecurityMessageLoop::Handler,
+ public utils::SystemTimeListener {
public:
/**
* \brief Constructor
+ * \param system_time_handler allows to work with system time.
*/
- SecurityManagerImpl();
+ explicit SecurityManagerImpl(
+ std::unique_ptr<utils::SystemTimeHandler>&& system_time_handler);
+
+ /**
+ * \brief Destructor
+ */
+ ~SecurityManagerImpl();
+
/**
* \brief Add received from Mobile Application message
* Overriden ProtocolObserver::OnMessageReceived method
@@ -131,9 +143,11 @@ class SecurityManagerImpl : public SecurityManager,
* Do not notify listeners, send security error on occure
* \param connection_key Unique key used by other components as session
* identifier
+ * @param cc_strategy - SSL context creation strategy
* @return new \c SSLContext or \c NULL on any error
*/
- SSLContext* CreateSSLContext(const uint32_t& connection_key) OVERRIDE;
+ SSLContext* CreateSSLContext(const uint32_t& connection_key,
+ ContextCreationStrategy cc_strategy) OVERRIDE;
/**
* \brief Start handshake as SSL client
@@ -141,10 +155,33 @@ class SecurityManagerImpl : public SecurityManager,
void StartHandshake(uint32_t connection_key) OVERRIDE;
/**
+ * @brief PostponeHandshake allows to postpone handshake. It notifies
+ * cryptomanager that certificate should be updated and adds specified
+ * connection key to the list of the certificate awaiting connections.
+ * @param connection_key the identifier for connection to postpone handshake.
+ */
+ void PostponeHandshake(const uint32_t connection_key) OVERRIDE;
+
+ /**
+ * @brief Checks whether certificate should be updated
+ * @param connection_key the connection identifier to check certificate for.
+ * @return true if certificate should be updated otherwise false
+ */
+ bool IsCertificateUpdateRequired(const uint32_t connection_key) OVERRIDE;
+
+ /**
+ * @brief Checks whether system time ready notification
+ * was received from hmi
+ * @return true if received otherwise false
+ */
+ bool IsSystemTimeProviderReady() const OVERRIDE;
+
+ /**
* \brief Add/Remove for SecurityManagerListener
*/
void AddListener(SecurityManagerListener* const listener) OVERRIDE;
void RemoveListener(SecurityManagerListener* const listener) OVERRIDE;
+
/**
* \brief Notifiers for listeners
* \param connection_key Unique key used by other components as session
@@ -158,7 +195,18 @@ class SecurityManagerImpl : public SecurityManager,
* @brief Notifiers for listeners.
* Allows to notify that certificate should be updated
*/
- void NotifyOnCertififcateUpdateRequired();
+ void NotifyOnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Notify all listeners that handshake was failed
+ */
+ void NotifyListenersOnHandshakeFailed() OVERRIDE;
+
+ /**
+ * @brief Check is policy certificate data is empty
+ * @return true if policy certificate data is not empty otherwise false
+ */
+ bool IsPolicyCertificateDataEmpty() OVERRIDE;
/**
* @brief SecurityConfigSection
@@ -199,6 +247,39 @@ class SecurityManagerImpl : public SecurityManager,
*/
void SendQuery(const SecurityQuery& query, const uint32_t connection_key);
+ /**
+ * @brief OnCertificateUpdated allows to obtain notification when certificate
+ * has been updated with policy table update. Pass this certificate to crypto
+ * manager for further processing. Also process postopnes handshake for the
+ * certain connection key.
+ *
+ * @param data the certificates content.
+ * @return always true.
+ */
+ bool OnCertificateUpdated(const std::string& data) OVERRIDE;
+
+ /**
+ * @brief ResumeHandshake allows to resume handshake after certificate has
+ * been updated.
+ * @param connection_key the connection identifier to start handshake.
+ */
+ void ResumeHandshake(uint32_t connection_key);
+
+ /**
+ * @brief ProceedHandshake starts the handshake process.
+ * @param ssl_context ssl context for the handshake. COntains certificate,
+ * keys, etc.
+ * @param connection_key the connection identifier to process handshake.
+ */
+ void ProceedHandshake(SSLContext* ssl_context, uint32_t connection_key);
+
+ /**
+ * @brief OnSystemTimeArrived method which notifies
+ * crypto manager with updated time in order to check certificate validity
+ * @param utc_time the current system time.
+ */
+ void OnSystemTimeArrived(const time_t utc_time) OVERRIDE;
+
// Thread that pumps handshake data
SecurityMessageLoop security_messages_;
@@ -217,7 +298,17 @@ class SecurityManagerImpl : public SecurityManager,
/**
*\brief List of listeners for notify handshake done result
*/
+
std::list<SecurityManagerListener*> listeners_;
+
+ std::unique_ptr<utils::SystemTimeHandler> system_time_handler_;
+ sync_primitives::Lock connections_lock_;
+ std::set<uint32_t> awaiting_certificate_connections_;
+ std::set<uint32_t> awaiting_time_connections_;
+
+ mutable sync_primitives::Lock waiters_lock_;
+ volatile bool waiting_for_certificate_;
+ volatile bool waiting_for_time_;
DISALLOW_COPY_AND_ASSIGN(SecurityManagerImpl);
};
} // namespace security_manager
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index f44198953b..90ae0177ec 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -41,6 +41,7 @@
#include <iostream>
#include <stdio.h>
#include <ctime>
+#include <algorithm>
#include "security_manager/security_manager.h"
#include "utils/logger.h"
@@ -63,7 +64,12 @@ namespace {
int debug_callback(int preverify_ok, X509_STORE_CTX* ctx) {
if (!preverify_ok) {
const int error = X509_STORE_CTX_get_error(ctx);
- UNUSED(error);
+ if (error == X509_V_ERR_CERT_NOT_YET_VALID ||
+ error == X509_V_ERR_CERT_HAS_EXPIRED) {
+ // return success result code instead of error because start
+ // and expiration cert dates will be checked by SDL
+ return 1;
+ }
LOG4CXX_WARN(logger_,
"Certificate verification failed with error "
<< error << " \"" << X509_verify_cert_error_string(error)
@@ -81,7 +87,7 @@ void free_ctx(SSL_CTX** ctx) {
}
CryptoManagerImpl::CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set)
+ const std::shared_ptr<const CryptoManagerSettings> set)
: settings_(set), context_(NULL) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(instance_lock_);
@@ -112,10 +118,35 @@ CryptoManagerImpl::~CryptoManagerImpl() {
}
}
+bool CryptoManagerImpl::AreForceProtectionSettingsCorrect() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::vector<int>& forced_unprotected_services =
+ get_settings().force_unprotected_service();
+ const std::vector<int>& forced_protected_services =
+ get_settings().force_protected_service();
+
+ for (auto& item : forced_protected_services) {
+ if (0 == item) {
+ continue;
+ }
+
+ if (std::find(forced_unprotected_services.begin(),
+ forced_unprotected_services.end(),
+ item) != forced_unprotected_services.end()) {
+ return false;
+ }
+ }
+ return true;
+}
+
bool CryptoManagerImpl::Init() {
LOG4CXX_AUTO_TRACE(logger_);
const Mode mode = get_settings().security_manager_mode();
+ if (!AreForceProtectionSettingsCorrect()) {
+ LOG4CXX_DEBUG(logger_, "Force protection settings of ini file are wrong!");
+ return false;
+ }
const bool is_server = (mode == SERVER);
if (is_server) {
LOG4CXX_DEBUG(logger_, "Server mode");
@@ -132,16 +163,24 @@ bool CryptoManagerImpl::Init() {
#if OPENSSL_VERSION_NUMBER < CONST_SSL_METHOD_MINIMAL_VERSION
SSL_METHOD* method;
#else
- const SSL_METHOD* method;
+ const SSL_METHOD* method = NULL;
#endif
switch (get_settings().security_manager_protocol_name()) {
case SSLv3:
+#ifdef OPENSSL_NO_SSL3
+ LOG4CXX_WARN(logger_, "OpenSSL does not support SSL3 protocol");
+ return false;
+#else
+ LOG4CXX_DEBUG(logger_, "SSLv3 is used");
method = is_server ? SSLv3_server_method() : SSLv3_client_method();
break;
+#endif
case TLSv1:
+ LOG4CXX_DEBUG(logger_, "TLSv1 is used");
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
break;
case TLSv1_1:
+ LOG4CXX_DEBUG(logger_, "TLSv1_1 is used");
#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
LOG4CXX_WARN(
logger_,
@@ -152,6 +191,7 @@ bool CryptoManagerImpl::Init() {
#endif
break;
case TLSv1_2:
+ LOG4CXX_DEBUG(logger_, "TLSv1_2 is used");
#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
LOG4CXX_WARN(
logger_,
@@ -161,6 +201,10 @@ bool CryptoManagerImpl::Init() {
method = is_server ? TLSv1_2_server_method() : TLSv1_2_client_method();
#endif
break;
+ case DTLSv1:
+ LOG4CXX_DEBUG(logger_, "DTLSv1 is used");
+ method = is_server ? DTLSv1_server_method() : DTLSv1_client_method();
+ break;
default:
LOG4CXX_ERROR(logger_,
"Unknown protocol: "
@@ -177,7 +221,7 @@ bool CryptoManagerImpl::Init() {
// Disable SSL2 as deprecated
SSL_CTX_set_options(context_, SSL_OP_NO_SSLv2);
- set_certificate(get_settings().certificate_data());
+ SaveCertificateData(get_settings().certificate_data());
if (get_settings().ciphers_list().empty()) {
LOG4CXX_WARN(logger_, "Empty ciphers list");
@@ -210,6 +254,21 @@ bool CryptoManagerImpl::Init() {
<< '"');
}
+ LOG4CXX_DEBUG(logger_, "Setting up module certificate and private key");
+
+ X509* module_certificate = LoadModuleCertificateFromFile();
+ utils::ScopeGuard certificate_guard =
+ utils::MakeGuard(X509_free, module_certificate);
+ UNUSED(certificate_guard);
+
+ EVP_PKEY* module_key = LoadModulePrivateKeyFromFile();
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, module_key);
+ UNUSED(key_guard);
+
+ if (!UpdateModuleCertificateData(module_certificate, module_key)) {
+ LOG4CXX_WARN(logger_, "Failed to update module key and certificate");
+ }
+
guard.Dismiss();
const int verify_mode =
@@ -229,17 +288,33 @@ bool CryptoManagerImpl::OnCertificateUpdated(const std::string& data) {
return false;
}
- return set_certificate(data);
+ if (!SaveCertificateData(data)) {
+ LOG4CXX_ERROR(logger_, "Failed to save certificate data");
+ return false;
+ }
+
+ X509* module_certificate = LoadModuleCertificateFromFile();
+ EVP_PKEY* module_key = LoadModulePrivateKeyFromFile();
+
+ utils::ScopeGuard certificate_guard =
+ utils::MakeGuard(X509_free, module_certificate);
+ UNUSED(certificate_guard);
+
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, module_key);
+ UNUSED(key_guard);
+
+ return UpdateModuleCertificateData(module_certificate, module_key);
}
SSLContext* CryptoManagerImpl::CreateSSLContext() {
- if (context_ == NULL) {
+ if (NULL == context_) {
return NULL;
}
SSL* conn = SSL_new(context_);
- if (conn == NULL)
+ if (NULL == conn) {
return NULL;
+ }
if (get_settings().security_manager_mode() == SERVER) {
SSL_set_accept_state(conn);
@@ -263,138 +338,202 @@ std::string CryptoManagerImpl::LastError() const {
return std::string(reason ? reason : "");
}
-bool CryptoManagerImpl::IsCertificateUpdateRequired() const {
+bool CryptoManagerImpl::IsCertificateUpdateRequired(
+ const time_t system_time, const time_t certificates_time) const {
LOG4CXX_AUTO_TRACE(logger_);
- const time_t cert_date = mktime(&expiration_time_);
+ const double seconds = difftime(certificates_time, system_time);
- if (cert_date == -1) {
- LOG4CXX_WARN(logger_,
- "The certifiacte expiration time cannot be represented.");
- return false;
- }
- const time_t now = time(NULL);
- const double seconds = difftime(cert_date, now);
+ LOG4CXX_DEBUG(
+ logger_, "Certificate UTC time: " << asctime(gmtime(&certificates_time)));
- LOG4CXX_DEBUG(logger_,
- "Certificate expiration time: " << asctime(&expiration_time_));
- LOG4CXX_DEBUG(logger_,
- "Host time: " << asctime(localtime(&now))
- << ". Seconds before expiration: " << seconds);
+ LOG4CXX_DEBUG(logger_, "Host UTC time: " << asctime(gmtime(&system_time)));
+ LOG4CXX_DEBUG(logger_, "Seconds before expiration: " << seconds);
if (seconds < 0) {
LOG4CXX_WARN(logger_, "Certificate is already expired.");
return true;
}
- return seconds <= (get_settings().update_before_hours() *
- date_time::DateTime::SECONDS_IN_HOUR);
+ return seconds <=
+ (get_settings().update_before_hours() * date_time::SECONDS_IN_HOUR);
}
const CryptoManagerSettings& CryptoManagerImpl::get_settings() const {
return *settings_;
}
-bool CryptoManagerImpl::set_certificate(const std::string& cert_data) {
+bool CryptoManagerImpl::SaveCertificateData(
+ const std::string& cert_data) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
if (cert_data.empty()) {
LOG4CXX_WARN(logger_, "Empty certificate");
return false;
}
- BIO* bio = BIO_new(BIO_f_base64());
- BIO* bmem = BIO_new_mem_buf((char*)cert_data.c_str(), cert_data.length());
- bmem = BIO_push(bio, bmem);
+ BIO* bio_cert =
+ BIO_new_mem_buf(const_cast<char*>(cert_data.c_str()), cert_data.length());
- char* buf = new char[cert_data.length()];
- int len = BIO_read(bmem, buf, cert_data.length());
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
+ UNUSED(bio_guard)
- BIO* bio_cert = BIO_new(BIO_s_mem());
- if (NULL == bio_cert) {
- LOG4CXX_WARN(logger_, "Unable to update certificate. BIO not created");
+ X509* cert = NULL;
+ if (!PEM_read_bio_X509(bio_cert, &cert, 0, 0)) {
+ LOG4CXX_WARN(logger_, "Could not read certificate data: " << LastError());
return false;
}
- utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
- UNUSED(bio_guard)
- int k = 0;
- if ((k = BIO_write(bio_cert, buf, len)) <= 0) {
- LOG4CXX_WARN(logger_, "Unable to write into BIO");
- return false;
+ utils::ScopeGuard cert_guard = utils::MakeGuard(X509_free, cert);
+ UNUSED(cert_guard);
+
+ if (1 != BIO_reset(bio_cert)) {
+ LOG4CXX_WARN(logger_,
+ "Unabled to reset BIO in order to read private key, "
+ << LastError());
}
- PKCS12* p12 = d2i_PKCS12_bio(bio_cert, NULL);
- if (NULL == p12) {
- LOG4CXX_ERROR(logger_, "Unable to parse certificate");
+ EVP_PKEY* pkey = NULL;
+ if (!PEM_read_bio_PrivateKey(bio_cert, &pkey, 0, 0)) {
+ LOG4CXX_WARN(logger_, "Could not read private key data: " << LastError());
return false;
}
- EVP_PKEY* pkey = NULL;
- X509* cert = NULL;
- PKCS12_parse(p12, NULL, &pkey, &cert, NULL);
+ utils::ScopeGuard key_guard = utils::MakeGuard(EVP_PKEY_free, pkey);
+ UNUSED(key_guard);
- if (NULL == cert || NULL == pkey) {
- LOG4CXX_WARN(logger_, "Either certificate or key not valid.");
- return false;
+ return SaveModuleCertificateToFile(cert) && SaveModuleKeyToFile(pkey);
+}
+
+bool CryptoManagerImpl::UpdateModuleCertificateData(X509* certificate,
+ EVP_PKEY* key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (certificate) {
+ if (!SSL_CTX_use_certificate(context_, certificate)) {
+ LOG4CXX_WARN(logger_, "Could not use certificate: " << LastError());
+ return false;
+ }
}
- if (!SSL_CTX_use_certificate(context_, cert)) {
- LOG4CXX_WARN(logger_, "Could not use certificate");
- return false;
+ if (key) {
+ if (!SSL_CTX_use_PrivateKey(context_, key)) {
+ LOG4CXX_ERROR(logger_, "Could not use key: " << LastError());
+ return false;
+ }
+
+ if (!SSL_CTX_check_private_key(context_)) {
+ LOG4CXX_ERROR(logger_, "Private key is invalid: " << LastError());
+ return false;
+ }
}
- asn1_time_to_tm(X509_get_notAfter(cert));
+ LOG4CXX_DEBUG(logger_, "Certificate and key are successfully updated");
+ return true;
+}
+
+X509* CryptoManagerImpl::LoadModuleCertificateFromFile() {
+ LOG4CXX_AUTO_TRACE(logger_);
- if (!SSL_CTX_use_PrivateKey(context_, pkey)) {
- LOG4CXX_ERROR(logger_, "Could not use key");
- return false;
+ const std::string cert_path = get_settings().module_cert_path();
+ BIO* bio_cert = BIO_new_file(cert_path.c_str(), "r");
+ if (!bio_cert) {
+ LOG4CXX_WARN(logger_,
+ "Failed to open " << cert_path << " file: " << LastError());
+ return NULL;
}
- if (!SSL_CTX_check_private_key(context_)) {
- LOG4CXX_ERROR(logger_, "Could not use certificate ");
- return false;
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
+ UNUSED(bio_guard);
+
+ X509* module_certificate = NULL;
+ if (!PEM_read_bio_X509(bio_cert, &module_certificate, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to read certificate data from file: " << LastError());
+ return NULL;
}
- return true;
+ LOG4CXX_DEBUG(logger_,
+ "Module certificate was loaded: " << module_certificate);
+
+ return module_certificate;
}
-int CryptoManagerImpl::pull_number_from_buf(char* buf, int* idx) {
- if (!idx) {
- return 0;
+EVP_PKEY* CryptoManagerImpl::LoadModulePrivateKeyFromFile() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const std::string key_path = get_settings().module_key_path();
+ BIO* bio_key = BIO_new_file(key_path.c_str(), "r");
+ if (!bio_key) {
+ LOG4CXX_WARN(logger_,
+ "Failed to open " << key_path << " file: " << LastError());
+ return NULL;
+ }
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_key);
+ UNUSED(bio_guard);
+
+ EVP_PKEY* module_key = NULL;
+ if (!PEM_read_bio_PrivateKey(bio_key, &module_key, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to read private key data from file: " << LastError());
+ return NULL;
}
- const int val = ((buf[*idx] - '0') * 10) + buf[(*idx) + 1] - '0';
- *idx = *idx + 2;
- return val;
+ LOG4CXX_DEBUG(logger_, "Module private key was loaded: " << module_key);
+
+ return module_key;
}
-void CryptoManagerImpl::asn1_time_to_tm(ASN1_TIME* time) {
- char* buf = (char*)time->data;
- int index = 0;
- const int year = pull_number_from_buf(buf, &index);
- if (V_ASN1_GENERALIZEDTIME == time->type) {
- expiration_time_.tm_year =
- (year * 100 - 1900) + pull_number_from_buf(buf, &index);
- } else {
- expiration_time_.tm_year = year < 50 ? year + 100 : year;
+bool CryptoManagerImpl::SaveModuleCertificateToFile(X509* certificate) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!certificate) {
+ LOG4CXX_WARN(logger_, "Empty certificate. Saving will be skipped");
+ return false;
}
- const int mon = pull_number_from_buf(buf, &index);
- const int day = pull_number_from_buf(buf, &index);
- const int hour = pull_number_from_buf(buf, &index);
- const int mn = pull_number_from_buf(buf, &index);
+ const std::string cert_path = get_settings().module_cert_path();
+ BIO* bio_cert = BIO_new_file(cert_path.c_str(), "w");
+ if (!bio_cert) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open " << cert_path << " file: " << LastError());
+ return false;
+ }
- expiration_time_.tm_mon = mon - 1;
- expiration_time_.tm_mday = day;
- expiration_time_.tm_hour = hour;
- expiration_time_.tm_min = mn;
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
+ UNUSED(bio_guard);
- if (buf[index] == 'Z') {
- expiration_time_.tm_sec = 0;
+ if (!PEM_write_bio_X509(bio_cert, certificate)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to write certificate to file: " << LastError());
+ return false;
}
- if ((buf[index] == '+') || (buf[index] == '-')) {
- const int mn = pull_number_from_buf(buf, &index);
- const int mn1 = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = (mn * 3600) + (mn1 * 60);
- } else {
- const int sec = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = sec;
+
+ return true;
+}
+
+bool CryptoManagerImpl::SaveModuleKeyToFile(EVP_PKEY* key) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!key) {
+ LOG4CXX_WARN(logger_, "Empty private key. Saving will be skipped");
+ return false;
+ }
+
+ const std::string key_path = get_settings().module_key_path();
+ BIO* bio_key = BIO_new_file(key_path.c_str(), "w");
+ if (!bio_key) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open " << key_path << " file: " << LastError());
+ return false;
}
+
+ utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_key);
+ UNUSED(bio_guard);
+
+ if (!PEM_write_bio_PrivateKey(bio_key, key, NULL, NULL, 0, NULL, NULL)) {
+ LOG4CXX_ERROR(logger_, "Failed to write key to file: " << LastError());
+ return false;
+ }
+
+ return true;
}
} // namespace security_manager
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 556cc291d1..70f835fb93 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,11 +31,13 @@
*/
#include "security_manager/security_manager_impl.h"
+#include <functional>
#include "security_manager/crypto_manager_impl.h"
#include "protocol_handler/protocol_packet.h"
#include "utils/logger.h"
#include "utils/byte_order.h"
#include "json/json.h"
+#include "utils/helpers.h"
namespace security_manager {
@@ -44,11 +46,22 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "SecurityManager")
static const char* kErrId = "id";
static const char* kErrText = "text";
-SecurityManagerImpl::SecurityManagerImpl()
+SecurityManagerImpl::SecurityManagerImpl(
+ std::unique_ptr<utils::SystemTimeHandler>&& system_time_handler)
: security_messages_("SecurityManager", this)
, session_observer_(NULL)
, crypto_manager_(NULL)
- , protocol_handler_(NULL) {}
+ , protocol_handler_(NULL)
+ , system_time_handler_(std::move(system_time_handler))
+ , waiting_for_certificate_(false)
+ , waiting_for_time_(false) {
+ DCHECK(system_time_handler_);
+ system_time_handler_->SubscribeOnSystemTime(this);
+}
+
+SecurityManagerImpl::~SecurityManagerImpl() {
+ system_time_handler_->UnsubscribeFromSystemTime(this);
+}
void SecurityManagerImpl::OnMessageReceived(
const ::protocol_handler::RawMessagePtr message) {
@@ -56,7 +69,7 @@ void SecurityManagerImpl::OnMessageReceived(
return;
}
- SecurityMessage securityMessagePtr(new SecurityQuery());
+ SecurityMessage securityMessagePtr(std::make_shared<SecurityQuery>());
const bool result =
securityMessagePtr->SerializeQuery(message->data(), message->data_size());
if (!result) {
@@ -136,19 +149,23 @@ void SecurityManagerImpl::Handle(const SecurityMessage message) {
}
security_manager::SSLContext* SecurityManagerImpl::CreateSSLContext(
- const uint32_t& connection_key) {
+ const uint32_t& connection_key, ContextCreationStrategy cc_strategy) {
LOG4CXX_INFO(logger_, "ProtectService processing");
DCHECK(session_observer_);
DCHECK(crypto_manager_);
- security_manager::SSLContext* ssl_context = session_observer_->GetSSLContext(
- connection_key, protocol_handler::kControl);
- // return exists SSLCOntext for current connection/session
- if (ssl_context) {
- return ssl_context;
+ if (kUseExisting == cc_strategy) {
+ security_manager::SSLContext* ssl_context =
+ session_observer_->GetSSLContext(connection_key,
+ protocol_handler::kControl);
+ // If SSLContext for current connection/session exists - return it
+ if (ssl_context) {
+ return ssl_context;
+ }
}
- ssl_context = crypto_manager_->CreateSSLContext();
+ security_manager::SSLContext* ssl_context =
+ crypto_manager_->CreateSSLContext();
if (!ssl_context) {
const std::string error_text("CryptoManager could not create SSL context.");
LOG4CXX_ERROR(logger_, error_text);
@@ -172,6 +189,40 @@ security_manager::SSLContext* SecurityManagerImpl::CreateSSLContext(
return ssl_context;
}
+void SecurityManagerImpl::PostponeHandshake(const uint32_t connection_key) {
+ LOG4CXX_TRACE(logger_, "Handshake postponed");
+ sync_primitives::AutoLock lock(connections_lock_);
+ if (waiting_for_certificate_) {
+ awaiting_certificate_connections_.insert(connection_key);
+ }
+ if (waiting_for_time_) {
+ awaiting_time_connections_.insert(connection_key);
+ }
+}
+
+void SecurityManagerImpl::ResumeHandshake(uint32_t connection_key) {
+ LOG4CXX_TRACE(logger_, "Handshake resumed");
+
+ security_manager::SSLContext* ssl_context =
+ CreateSSLContext(connection_key, kForceRecreation);
+
+ if (!ssl_context) {
+ LOG4CXX_WARN(logger_,
+ "Unable to resume handshake. No SSL context for key "
+ << connection_key);
+ return;
+ }
+
+ ssl_context->ResetConnection();
+ if (!waiting_for_certificate_ && !ssl_context->HasCertificate()) {
+ NotifyListenersOnHandshakeDone(connection_key,
+ SSLContext::Handshake_Result_Fail);
+ return;
+ }
+
+ ProceedHandshake(ssl_context, connection_key);
+}
+
void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
DCHECK(session_observer_);
LOG4CXX_INFO(logger_, "StartHandshake: connection_key " << connection_key);
@@ -187,9 +238,34 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
SSLContext::Handshake_Result_Fail);
return;
}
+ if (!ssl_context->HasCertificate()) {
+ LOG4CXX_ERROR(logger_, "Security certificate is absent");
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = true;
+ NotifyOnCertificateUpdateRequired();
+ }
- if (crypto_manager_->IsCertificateUpdateRequired()) {
- NotifyOnCertififcateUpdateRequired();
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_time_ = true;
+ }
+
+ PostponeHandshake(connection_key);
+ system_time_handler_->QuerySystemTime();
+}
+
+bool SecurityManagerImpl::IsSystemTimeProviderReady() const {
+ return system_time_handler_->system_time_can_be_received();
+}
+
+void SecurityManagerImpl::ProceedHandshake(
+ security_manager::SSLContext* ssl_context, uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!ssl_context) {
+ LOG4CXX_WARN(logger_,
+ "Unable to process handshake. No SSL context for key "
+ << connection_key);
+ return;
}
if (ssl_context->IsInitCompleted()) {
@@ -198,8 +274,33 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
return;
}
- ssl_context->SetHandshakeContext(
- session_observer_->GetHandshakeContext(connection_key));
+ time_t cert_due_date;
+ if (!ssl_context->GetCertificateDueDate(cert_due_date)) {
+ LOG4CXX_ERROR(logger_, "Failed to get certificate due date!");
+ return;
+ }
+
+ if (crypto_manager_->IsCertificateUpdateRequired(
+ system_time_handler_->GetUTCTime(), cert_due_date)) {
+ LOG4CXX_DEBUG(logger_, "Host certificate update required");
+ if (helpers::in_range(awaiting_certificate_connections_, connection_key)) {
+ NotifyListenersOnHandshakeDone(connection_key,
+ SSLContext::Handshake_Result_CertExpired);
+ return;
+ }
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = true;
+ }
+ PostponeHandshake(connection_key);
+ NotifyOnCertificateUpdateRequired();
+ return;
+ }
+
+ SSLContext::HandshakeContext handshake_context =
+ session_observer_->GetHandshakeContext(connection_key);
+ handshake_context.system_time = system_time_handler_->GetUTCTime();
+ ssl_context->SetHandshakeContext(handshake_context);
size_t data_size = 0;
const uint8_t* data = NULL;
@@ -219,6 +320,24 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
SendHandshakeBinData(connection_key, data, data_size);
}
}
+
+bool SecurityManagerImpl::IsCertificateUpdateRequired(
+ const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ security_manager::SSLContext* ssl_context =
+ CreateSSLContext(connection_key, kUseExisting);
+ DCHECK_OR_RETURN(ssl_context, true);
+ LOG4CXX_DEBUG(logger_,
+ "Set SSL context to connection_key " << connection_key);
+ time_t cert_due_date;
+ if (!ssl_context->GetCertificateDueDate(cert_due_date)) {
+ LOG4CXX_ERROR(logger_, "Failed to get certificate due date!");
+ return true;
+ }
+ return crypto_manager_->IsCertificateUpdateRequired(
+ system_time_handler_->GetUTCTime(), cert_due_date);
+}
+
void SecurityManagerImpl::AddListener(SecurityManagerListener* const listener) {
if (!listener) {
LOG4CXX_ERROR(logger_,
@@ -227,6 +346,7 @@ void SecurityManagerImpl::AddListener(SecurityManagerListener* const listener) {
}
listeners_.push_back(listener);
}
+
void SecurityManagerImpl::RemoveListener(
SecurityManagerListener* const listener) {
if (!listener) {
@@ -236,13 +356,46 @@ void SecurityManagerImpl::RemoveListener(
}
listeners_.remove(listener);
}
+
+bool SecurityManagerImpl::OnCertificateUpdated(const std::string& data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_certificate_ = false;
+ }
+ crypto_manager_->OnCertificateUpdated(data);
+ std::for_each(
+ awaiting_certificate_connections_.begin(),
+ awaiting_certificate_connections_.end(),
+ std::bind1st(std::mem_fun(&SecurityManagerImpl::ResumeHandshake), this));
+
+ awaiting_certificate_connections_.clear();
+ return true;
+}
+
+void SecurityManagerImpl::OnSystemTimeArrived(const time_t utc_time) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(waiters_lock_);
+ waiting_for_time_ = false;
+ }
+
+ std::for_each(
+ awaiting_time_connections_.begin(),
+ awaiting_time_connections_.end(),
+ std::bind1st(std::mem_fun(&SecurityManagerImpl::ResumeHandshake), this));
+
+ awaiting_time_connections_.clear();
+}
+
void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
const uint32_t& connection_key, SSLContext::HandshakeResult error) {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
while (it != listeners_.end()) {
if ((*it)->OnHandshakeDone(connection_key, error)) {
- // On get notification remove listener
+ LOG4CXX_DEBUG(logger_, "Destroying listener: " << *it);
+ delete (*it);
it = listeners_.erase(it);
} else {
++it;
@@ -250,7 +403,7 @@ void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
}
}
-void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
+void SecurityManagerImpl::NotifyOnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
while (it != listeners_.end()) {
@@ -259,6 +412,33 @@ void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
}
}
+void SecurityManagerImpl::NotifyListenersOnHandshakeFailed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
+ while (it != listeners_.end()) {
+ if ((*it)->OnHandshakeFailed()) {
+ LOG4CXX_DEBUG(logger_, "Destroying listener: " << *it);
+ delete (*it);
+ it = listeners_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
+bool SecurityManagerImpl::IsPolicyCertificateDataEmpty() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string certificate_data;
+ for (auto it = listeners_.begin(); it != listeners_.end(); ++it) {
+ if ((*it)->GetPolicyCertificateData(certificate_data)) {
+ LOG4CXX_DEBUG(logger_, "Certificate data received from listener");
+ return certificate_data.empty();
+ }
+ }
+ return false;
+}
+
bool SecurityManagerImpl::ProccessHandshakeData(
const SecurityMessage& inMessage) {
LOG4CXX_INFO(logger_, "SendHandshakeData processing");
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 6f53234867..67be17db63 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -32,12 +32,15 @@
#include "security_manager/crypto_manager_impl.h"
#include <assert.h>
-#include <openssl/bio.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
#include <memory.h>
#include <map>
#include <algorithm>
+#include <vector>
+#include <time.h>
+
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
#include "utils/macro.h"
@@ -55,7 +58,8 @@ CryptoManagerImpl::SSLContextImpl::SSLContextImpl(SSL* conn,
, buffer_size_(maximum_payload_size)
, buffer_(new uint8_t[buffer_size_])
, is_handshake_pending_(false)
- , mode_(mode) {
+ , mode_(mode)
+ , max_block_size_(0) {
SSL_set_bio(connection_, bioIn_, bioOut_);
}
@@ -74,6 +78,7 @@ bool CryptoManagerImpl::SSLContextImpl::IsInitCompleted() const {
SSLContext::HandshakeResult CryptoManagerImpl::SSLContextImpl::StartHandshake(
const uint8_t** const out_data, size_t* out_data_size) {
+ LOG4CXX_AUTO_TRACE(logger_);
is_handshake_pending_ = true;
return DoHandshakeStep(NULL, 0, out_data, out_data_size);
}
@@ -109,6 +114,12 @@ size_t des_cbc3_sha_max_block_size(size_t mtu) {
return 0;
return ((mtu - 29) & 0xfffffff8) - 5;
}
+time_t get_time_zone_offset(time_t in_time) {
+ tm gmt_cert_tm = *gmtime(&in_time);
+ tm local_cert_tm = *localtime(&in_time);
+
+ return mktime(&local_cert_tm) - mktime(&gmt_cert_tm);
+}
} // namespace
std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
@@ -136,36 +147,75 @@ std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
CryptoManagerImpl::SSLContextImpl::max_block_sizes =
CryptoManagerImpl::SSLContextImpl::create_max_block_sizes();
+const std::string CryptoManagerImpl::SSLContextImpl::RemoveDisallowedInfo(
+ X509_NAME* in_data) const {
+ if (!in_data) {
+ return std::string();
+ }
+
+ char* tmp_char_str = X509_NAME_oneline(in_data, NULL, 0);
+ std::string out_str(tmp_char_str);
+ OPENSSL_free(tmp_char_str);
+
+ typedef std::vector<std::string> StringVector;
+ StringVector disallowed_params;
+ disallowed_params.push_back("CN");
+ disallowed_params.push_back("serialNumber");
+
+ const char str_delimiter = '/', param_delimiter = '=';
+ for (StringVector::const_iterator it = disallowed_params.begin();
+ it != disallowed_params.end();
+ ++it) {
+ const std::string search_str = str_delimiter + (*it) + param_delimiter;
+ const size_t occurence_start = out_str.find(search_str);
+ if (std::string::npos == occurence_start) {
+ continue;
+ }
+
+ const size_t occurence_end =
+ out_str.find(str_delimiter, occurence_start + 1);
+ out_str.erase(occurence_start, occurence_end - occurence_start);
+ }
+
+ return out_str;
+}
+
void CryptoManagerImpl::SSLContextImpl::PrintCertData(
X509* cert, const std::string& cert_owner) {
- if (cert) {
- X509_NAME* subj_name = X509_get_subject_name(cert);
- char* subj = X509_NAME_oneline(subj_name, NULL, 0);
- if (subj) {
- std::replace(subj, subj + strlen(subj), '/', ' ');
- LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj);
- OPENSSL_free(subj);
- }
- char* issuer = X509_NAME_oneline(X509_get_issuer_name(cert), NULL, 0);
- if (issuer) {
- std::replace(issuer, issuer + strlen(issuer), '/', ' ');
- LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer);
- OPENSSL_free(issuer);
- }
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!cert) {
+ LOG4CXX_DEBUG(logger_, "Empty certificate data");
+ return;
+ }
+
+ std::string subj = RemoveDisallowedInfo(X509_get_subject_name(cert));
+ if (!subj.empty()) {
+ std::replace(subj.begin(), subj.end(), '/', ' ');
+ LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj);
+ }
- ASN1_TIME* notBefore = X509_get_notBefore(cert);
- ASN1_TIME* notAfter = X509_get_notAfter(cert);
+ std::string issuer = RemoveDisallowedInfo(X509_get_issuer_name(cert));
+ if (!issuer.empty()) {
+ std::replace(issuer.begin(), issuer.end(), '/', ' ');
+ LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer);
+ }
- if (notBefore) {
- LOG4CXX_DEBUG(logger_, " Start date: " << (char*)notBefore->data);
- }
- if (notAfter) {
- LOG4CXX_DEBUG(logger_, " End date: " << (char*)notAfter->data);
- }
+ ASN1_TIME* not_before = X509_get_notBefore(cert);
+ if (not_before) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Start date: " << static_cast<unsigned char*>(not_before->data));
+ }
+
+ ASN1_TIME* not_after = X509_get_notAfter(cert);
+ if (not_after) {
+ LOG4CXX_DEBUG(logger_,
+ "End date: " << static_cast<unsigned char*>(not_after->data));
}
}
void CryptoManagerImpl::SSLContextImpl::PrintCertInfo() {
+ LOG4CXX_AUTO_TRACE(logger_);
PrintCertData(SSL_get_certificate(connection_), "HU's");
STACK_OF(X509)* peer_certs = SSL_get_peer_cert_chain(connection_);
@@ -177,26 +227,47 @@ void CryptoManagerImpl::SSLContextImpl::PrintCertInfo() {
SSLContext::HandshakeResult
CryptoManagerImpl::SSLContextImpl::CheckCertContext() {
+ LOG4CXX_AUTO_TRACE(logger_);
X509* cert = SSL_get_peer_certificate(connection_);
if (!cert) {
// According to the openssl documentation the peer certificate
// might be ommitted for the SERVER but required for the cient.
return CLIENT == mode_ ? Handshake_Result_Fail : Handshake_Result_Success;
}
+ ASN1_TIME* notBefore = X509_get_notBefore(cert);
+ ASN1_TIME* notAfter = X509_get_notAfter(cert);
- X509_NAME* subj_name = X509_get_subject_name(cert);
+ time_t start = convert_asn1_time_to_time_t(notBefore);
+ time_t end = convert_asn1_time_to_time_t(notAfter);
- const std::string& cn = GetTextBy(subj_name, NID_commonName);
- const std::string& sn = GetTextBy(subj_name, NID_serialNumber);
+ const double start_seconds = difftime(hsh_context_.system_time, start);
+ const double end_seconds = difftime(end, hsh_context_.system_time);
+
+ if (start_seconds < 0) {
+ LOG4CXX_ERROR(logger_,
+ "Certificate is not yet valid. Time before validity "
+ << start_seconds << " seconds");
+ return Handshake_Result_NotYetValid;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Time since certificate validity " << start_seconds
+ << "seconds");
+ }
- if (!(hsh_context_.expected_cn.CompareIgnoreCase(cn.c_str()))) {
+ if (end_seconds < 0) {
LOG4CXX_ERROR(logger_,
- "Trying to run handshake with wrong app name: "
- << cn << ". Expected app name: "
- << hsh_context_.expected_cn.AsMBString());
- return Handshake_Result_AppNameMismatch;
+ "Certificate already expired. Time after expiration "
+ << end_seconds << " seconds");
+ return Handshake_Result_CertExpired;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Time until expiration " << end_seconds << "seconds");
}
+ X509_NAME* subj_name = X509_get_subject_name(cert);
+
+ const std::string& sn = GetTextBy(subj_name, NID_serialNumber);
+
if (!(hsh_context_.expected_sn.CompareIgnoreCase(sn.c_str()))) {
LOG4CXX_ERROR(logger_,
"Trying to run handshake with wrong app id: "
@@ -207,6 +278,60 @@ CryptoManagerImpl::SSLContextImpl::CheckCertContext() {
return Handshake_Result_Success;
}
+int CryptoManagerImpl::SSLContextImpl::get_number_from_char_buf(
+ char* buf, int* idx) const {
+ if (!idx) {
+ return 0;
+ }
+ const int val = ((buf[*idx] - '0') * 10) + buf[(*idx) + 1] - '0';
+ *idx = *idx + 2;
+ return val;
+}
+
+time_t CryptoManagerImpl::SSLContextImpl::convert_asn1_time_to_time_t(
+ ASN1_TIME* time_to_convert) const {
+ struct tm cert_time;
+ memset(&cert_time, 0, sizeof(struct tm));
+ // the minimum value for day of month is 1, otherwise exception will be thrown
+ cert_time.tm_mday = 1;
+ char* buf = reinterpret_cast<char*>(time_to_convert->data);
+ int index = 0;
+ const int year = get_number_from_char_buf(buf, &index);
+ if (V_ASN1_GENERALIZEDTIME == time_to_convert->type) {
+ cert_time.tm_year =
+ (year * 100 - 1900) + get_number_from_char_buf(buf, &index);
+ } else {
+ cert_time.tm_year = year < 50 ? year + 100 : year;
+ }
+
+ const int mon = get_number_from_char_buf(buf, &index);
+ const int day = get_number_from_char_buf(buf, &index);
+ const int hour = get_number_from_char_buf(buf, &index);
+ const int mn = get_number_from_char_buf(buf, &index);
+
+ cert_time.tm_mon = mon - 1;
+ cert_time.tm_mday = day;
+ cert_time.tm_hour = hour;
+ cert_time.tm_min = mn;
+
+ if (buf[index] == 'Z') {
+ cert_time.tm_sec = 0;
+ }
+ if ((buf[index] == '+') || (buf[index] == '-')) {
+ const int mn = get_number_from_char_buf(buf, &index);
+ const int mn1 = get_number_from_char_buf(buf, &index);
+ cert_time.tm_sec = (mn * 3600) + (mn1 * 60);
+ } else {
+ const int sec = get_number_from_char_buf(buf, &index);
+ cert_time.tm_sec = sec;
+ }
+
+ const time_t local_cert_time = mktime(&cert_time);
+ const time_t time_offset = get_time_zone_offset(local_cert_time);
+
+ return local_cert_time + time_offset;
+}
+
bool CryptoManagerImpl::SSLContextImpl::ReadHandshakeData(
const uint8_t** const out_data, size_t* out_data_size) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -240,7 +365,7 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData(
if (ret <= 0) {
is_handshake_pending_ = false;
ResetConnection();
- return Handshake_Result_AbnormalFail;
+ return false;
}
}
return true;
@@ -248,7 +373,9 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData(
SSLContext::HandshakeResult
CryptoManagerImpl::SSLContextImpl::PerformHandshake() {
+ LOG4CXX_AUTO_TRACE(logger_);
const int handshake_result = SSL_do_handshake(connection_);
+ LOG4CXX_TRACE(logger_, "Handshake result: " << handshake_result);
if (handshake_result == 1) {
const HandshakeResult result = CheckCertContext();
if (result != Handshake_Result_Success) {
@@ -267,6 +394,7 @@ CryptoManagerImpl::SSLContextImpl::PerformHandshake() {
is_handshake_pending_ = false;
} else if (handshake_result == 0) {
+ LOG4CXX_DEBUG(logger_, "SSL handshake failed");
SSL_clear(connection_);
is_handshake_pending_ = false;
return Handshake_Result_Fail;
@@ -363,25 +491,32 @@ bool CryptoManagerImpl::SSLContextImpl::Decrypt(const uint8_t* const in_data,
size_t in_data_size,
const uint8_t** const out_data,
size_t* out_data_size) {
+ LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock locker(bio_locker);
if (!SSL_is_init_finished(connection_)) {
+ LOG4CXX_ERROR(logger_, "SSL initilization is not finished");
return false;
}
- if (!in_data || !in_data_size) {
+ if (!in_data || (0 == in_data_size)) {
+ LOG4CXX_ERROR(logger_, "IN data ptr or IN data size is 0");
return false;
}
+
BIO_write(bioIn_, in_data, in_data_size);
int len = BIO_ctrl_pending(bioFilter_);
+
ptrdiff_t offset = 0;
*out_data_size = 0;
- while (len) {
+ *out_data = NULL;
+ while (len > 0) {
EnsureBufferSizeEnough(len + offset);
len = BIO_read(bioFilter_, buffer_ + offset, len);
// TODO(EZamakhov): investigate BIO_read return 0, -1 and -2 meanings
if (len <= 0) {
// Reset filter and connection deinitilization instead
+ LOG4CXX_ERROR(logger_, "Read error occured. Read data lenght : " << len);
BIO_ctrl(bioFilter_, BIO_CTRL_RESET, 0, NULL);
return false;
}
@@ -407,6 +542,25 @@ bool CryptoManagerImpl::SSLContextImpl::IsHandshakePending() const {
return is_handshake_pending_;
}
+bool CryptoManagerImpl::SSLContextImpl::GetCertificateDueDate(
+ time_t& due_date) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ X509* cert = SSL_get_certificate(connection_);
+ if (!cert) {
+ LOG4CXX_DEBUG(logger_, "Get certificate failed.");
+ return false;
+ }
+
+ due_date = convert_asn1_time_to_time_t(X509_get_notAfter(cert));
+
+ return true;
+}
+
+bool CryptoManagerImpl::SSLContextImpl::HasCertificate() const {
+ return SSL_get_certificate(connection_) != NULL;
+}
+
CryptoManagerImpl::SSLContextImpl::~SSLContextImpl() {
SSL_shutdown(connection_);
SSL_free(connection_);
diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc
index 7fef33f1df..5e096194f3 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -51,6 +51,10 @@ namespace {
const size_t kUpdatesBeforeHour = 24;
const std::string kAllCiphers = "ALL";
const std::string kCaCertPath = "";
+const uint32_t kServiceNumber = 2u;
+const size_t kMaxSizeVector = 1u;
+const std::string kCertPath = "certificate.crt";
+const std::string kPrivateKeyPath = "private.key";
#ifdef __QNXNTO__
const std::string kFordCipher = SSL3_TXT_RSA_DES_192_CBC3_SHA;
@@ -64,10 +68,14 @@ namespace test {
namespace components {
namespace crypto_manager_test {
+using security_manager::CryptoManagerImpl;
+
class CryptoManagerTest : public testing::Test {
protected:
+ typedef NiceMock<security_manager_test::MockCryptoManagerSettings>
+ MockCryptoManagerSettings;
static void SetUpTestCase() {
- std::ifstream certificate_file("server/spt_credential.p12.enc");
+ std::ifstream certificate_file("server/spt_credential.pem");
ASSERT_TRUE(certificate_file.is_open())
<< "Could not open certificate data file";
@@ -81,16 +89,11 @@ class CryptoManagerTest : public testing::Test {
void SetUp() OVERRIDE {
ASSERT_FALSE(certificate_data_base64_.empty());
mock_security_manager_settings_ =
- new NiceMock<security_manager_test::MockCryptoManagerSettings>();
- utils::SharedPtr<security_manager::CryptoManagerSettings> scrypto =
- utils::SharedPtr<security_manager::CryptoManagerSettings>::
- static_pointer_cast<security_manager::CryptoManagerSettings>(
- mock_security_manager_settings_);
- crypto_manager_ = new security_manager::CryptoManagerImpl(scrypto);
- }
-
- void TearDown() OVERRIDE {
- delete mock_security_manager_settings_;
+ std::make_shared<MockCryptoManagerSettings>();
+ crypto_manager_ =
+ std::make_shared<CryptoManagerImpl>(mock_security_manager_settings_);
+ forced_protected_services_.reserve(kMaxSizeVector);
+ forced_unprotected_services_.reserve(kMaxSizeVector);
}
void InitSecurityManager() {
@@ -103,6 +106,10 @@ class CryptoManagerTest : public testing::Test {
void SetInitialValues(security_manager::Mode mode,
security_manager::Protocol protocol,
const std::string& cipher) {
+ ON_CALL(*mock_security_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_services_));
+ ON_CALL(*mock_security_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_services_));
ON_CALL(*mock_security_manager_settings_, security_manager_mode())
.WillByDefault(Return(mode));
ON_CALL(*mock_security_manager_settings_, security_manager_protocol_name())
@@ -113,16 +120,21 @@ class CryptoManagerTest : public testing::Test {
.WillByDefault(ReturnRef(cipher));
ON_CALL(*mock_security_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(kCaCertPath));
+ ON_CALL(*mock_security_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kCertPath));
+ ON_CALL(*mock_security_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kPrivateKeyPath));
ON_CALL(*mock_security_manager_settings_, verify_peer())
.WillByDefault(Return(false));
}
- security_manager::CryptoManager* crypto_manager_;
+ std::shared_ptr<CryptoManagerImpl> crypto_manager_;
+ std::shared_ptr<MockCryptoManagerSettings> mock_security_manager_settings_;
static std::string certificate_data_base64_;
-
- NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_security_manager_settings_;
+ std::vector<int> forced_protected_services_;
+ std::vector<int> forced_unprotected_services_;
};
+
std::string CryptoManagerTest::certificate_data_base64_;
TEST_F(CryptoManagerTest, UsingBeforeInit) {
@@ -137,16 +149,15 @@ TEST_F(CryptoManagerTest, WrongInit) {
// Unknown protocol version
security_manager::Protocol UNKNOWN =
static_cast<security_manager::Protocol>(-1);
+ // Unexistent cipher value
+ const std::string invalid_cipher = "INVALID_UNKNOWN_CIPHER";
+ const security_manager::Mode mode = security_manager::SERVER;
- EXPECT_CALL(*mock_security_manager_settings_, security_manager_mode())
- .WillRepeatedly(Return(security_manager::SERVER));
- EXPECT_CALL(*mock_security_manager_settings_,
- security_manager_protocol_name()).WillOnce(Return(UNKNOWN));
- EXPECT_FALSE(crypto_manager_->Init());
+ SetInitialValues(mode, UNKNOWN, invalid_cipher);
+ EXPECT_FALSE(crypto_manager_->Init());
EXPECT_NE(std::string(), crypto_manager_->LastError());
- // Unexistent cipher value
- const std::string invalid_cipher = "INVALID_UNKNOWN_CIPHER";
+
EXPECT_CALL(*mock_security_manager_settings_,
security_manager_protocol_name())
.WillOnce(Return(security_manager::TLSv1_2));
@@ -155,7 +166,6 @@ TEST_F(CryptoManagerTest, WrongInit) {
EXPECT_CALL(*mock_security_manager_settings_, ciphers_list())
.WillRepeatedly(ReturnRef(invalid_cipher));
EXPECT_FALSE(crypto_manager_->Init());
-
EXPECT_NE(std::string(), crypto_manager_->LastError());
}
@@ -180,10 +190,18 @@ TEST_F(CryptoManagerTest, CorrectInit) {
security_manager::CLIENT, security_manager::TLSv1_1, kFordCipher);
EXPECT_TRUE(crypto_manager_->Init());
+ SetInitialValues(
+ security_manager::CLIENT, security_manager::DTLSv1, kFordCipher);
+ EXPECT_TRUE(crypto_manager_->Init());
+
// Cipher value
SetInitialValues(
security_manager::SERVER, security_manager::TLSv1_2, kAllCiphers);
EXPECT_TRUE(crypto_manager_->Init());
+
+ SetInitialValues(
+ security_manager::SERVER, security_manager::DTLSv1, kAllCiphers);
+ EXPECT_TRUE(crypto_manager_->Init());
}
// #endif // __QNX__
@@ -202,7 +220,6 @@ TEST_F(CryptoManagerTest, CreateReleaseSSLContext) {
EXPECT_CALL(*mock_security_manager_settings_, maximum_payload_size())
.Times(1)
.WillRepeatedly(Return(max_payload_size));
-
security_manager::SSLContext* context = crypto_manager_->CreateSSLContext();
EXPECT_TRUE(context);
EXPECT_NO_THROW(crypto_manager_->ReleaseSSLContext(context));
@@ -214,7 +231,10 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated) {
}
TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
+ time_t system_time = 0;
+ time_t certificates_time = 1;
size_t updates_before = 0;
+
SetInitialValues(
security_manager::CLIENT, security_manager::TLSv1_2, kAllCiphers);
ASSERT_TRUE(crypto_manager_->Init());
@@ -222,7 +242,8 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
EXPECT_CALL(*mock_security_manager_settings_, update_before_hours())
.WillOnce(Return(updates_before));
- EXPECT_FALSE(crypto_manager_->IsCertificateUpdateRequired());
+ EXPECT_FALSE(crypto_manager_->IsCertificateUpdateRequired(system_time,
+ certificates_time));
size_t max_updates_ = std::numeric_limits<size_t>::max();
SetInitialValues(
@@ -231,7 +252,8 @@ TEST_F(CryptoManagerTest, OnCertificateUpdated_UpdateNotRequired) {
.WillOnce(Return(max_updates_));
ASSERT_TRUE(crypto_manager_->Init());
- EXPECT_TRUE(crypto_manager_->IsCertificateUpdateRequired());
+ EXPECT_TRUE(crypto_manager_->IsCertificateUpdateRequired(system_time,
+ certificates_time));
}
TEST_F(CryptoManagerTest, OnCertificateUpdated_NotInitialized) {
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index 7c1958ad9c..aff7cbca2d 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -31,6 +31,7 @@
*/
#include <string>
+#include <memory>
#include "gtest/gtest.h"
#include "utils/byte_order.h"
@@ -43,7 +44,8 @@
#include "security_manager/mock_ssl_context.h"
#include "security_manager/mock_crypto_manager.h"
#include "security_manager/mock_security_manager_listener.h"
-#include "utils/make_shared.h"
+#include "utils/mock_system_time_handler.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -75,11 +77,11 @@ using ::testing::_;
namespace {
// Sample data for handshake data emulation
-const int32_t key = 0x1;
-const int32_t seq_number = 0x2;
-const ServiceType secureServiceType = kControl;
-const uint32_t protocolVersion = PROTOCOL_VERSION_2;
-const bool is_final = false;
+const int32_t kKey = 0x1;
+const int32_t kSeqNumber = 0x2;
+const ServiceType kSecureServiceType = kControl;
+const uint32_t kProtocolVersion = PROTOCOL_VERSION_2;
+const bool kIsFinal = false;
const uint8_t handshake_data[] = {0x1, 0x2, 0x3, 0x4, 0x5};
const size_t handshake_data_size =
@@ -94,15 +96,21 @@ const uint32_t kAsyncExpectationsTimeout = 10000u;
class SecurityManagerTest : public ::testing::Test {
protected:
+ SecurityManagerTest()
+ : mock_system_time_handler(
+ std::unique_ptr<MockSystemTimeHandler>(new MockSystemTimeHandler()))
+ , security_manager_(
+ new SecurityManagerImpl(std::move(mock_system_time_handler))) {}
void SetUp() OVERRIDE {
- security_manager_.reset(new SecurityManagerImpl());
security_manager_->set_session_observer(&mock_session_observer);
security_manager_->set_protocol_handler(&mock_protocol_handler);
- security_manager_->AddListener(&mock_sm_listener);
+ mock_sm_listener.reset(new testing::StrictMock<
+ security_manager_test::MockSecurityManagerListener>());
+ security_manager_->AddListener(mock_sm_listener.get());
}
void SetMockCryptoManager() {
- EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired())
+ EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired(_, _))
.WillRepeatedly(Return(false));
security_manager_->set_crypto_manager(&mock_crypto_manager);
}
@@ -112,8 +120,8 @@ class SecurityManagerTest : public ::testing::Test {
void call_OnMessageReceived(const uint8_t* const data,
uint32_t dataSize,
const ServiceType serviceType) {
- const RawMessagePtr rawMessagePtr(utils::MakeShared<RawMessage>(
- key, protocolVersion, data, dataSize, serviceType));
+ const RawMessagePtr rawMessagePtr(std::make_shared<RawMessage>(
+ kKey, kProtocolVersion, data, dataSize, serviceType));
security_manager_->OnMessageReceived(rawMessagePtr);
}
/*
@@ -144,13 +152,14 @@ class SecurityManagerTest : public ::testing::Test {
const int repeat_count = 1) {
const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
SecurityQuery::SEND_HANDSHAKE_DATA,
- seq_number);
+ kSeqNumber);
for (int c = 0; c < repeat_count; ++c) {
EmulateMobileMessage(header, data, data_size);
}
}
- ::utils::SharedPtr<SecurityManagerImpl> security_manager_;
+
// Strict mocks (same as all methods EXPECT_CALL().Times(0))
+
testing::StrictMock<protocol_handler_test::MockSessionObserver>
mock_session_observer;
testing::StrictMock<protocol_handler_test::MockProtocolHandler>
@@ -161,8 +170,10 @@ class SecurityManagerTest : public ::testing::Test {
mock_ssl_context_new;
testing::StrictMock<security_manager_test::MockSSLContext>
mock_ssl_context_exists;
- testing::StrictMock<security_manager_test::MockSecurityManagerListener>
- mock_sm_listener;
+ std::unique_ptr<testing::StrictMock<
+ security_manager_test::MockSecurityManagerListener> > mock_sm_listener;
+ std::unique_ptr<MockSystemTimeHandler> mock_system_time_handler;
+ std::shared_ptr<SecurityManagerImpl> security_manager_;
};
// Test Bodies
@@ -171,7 +182,6 @@ class SecurityManagerTest : public ::testing::Test {
* and shall not call any methodes
*/
TEST_F(SecurityManagerTest, SetNULL_Intefaces) {
- security_manager_.reset(new SecurityManagerImpl());
security_manager_->set_session_observer(NULL);
security_manager_->set_protocol_handler(NULL);
security_manager_->set_crypto_manager(NULL);
@@ -190,15 +200,15 @@ TEST_F(SecurityManagerTest, Listeners_NULL) {
* Twice remove listener
*/
TEST_F(SecurityManagerTest, Listeners_TwiceRemoveListeners) {
- security_manager_->RemoveListener(&mock_sm_listener);
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
+ security_manager_->RemoveListener(mock_sm_listener.get());
}
/*
* Add and remove listeners
*/
TEST_F(SecurityManagerTest, Listeners_NoListeners) {
// Check correct removing listener
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
// Expect no calls
testing::StrictMock<MockSecurityManagerListener> mock_listener2;
@@ -206,58 +216,60 @@ TEST_F(SecurityManagerTest, Listeners_NoListeners) {
security_manager_->RemoveListener(&mock_listener2);
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Success);
+ kKey, SSLContext::Handshake_Result_Success);
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Fail);
+ kKey, SSLContext::Handshake_Result_Fail);
}
/*
* Notifying two listeners
*/
TEST_F(SecurityManagerTest, Listeners_Notifying) {
// Check correct removing listener
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
- testing::StrictMock<MockSecurityManagerListener> mock_listener1;
- testing::StrictMock<MockSecurityManagerListener> mock_listener2;
+ testing::StrictMock<MockSecurityManagerListener>* mock_listener1 =
+ new testing::StrictMock<MockSecurityManagerListener>();
+ testing::StrictMock<MockSecurityManagerListener>* mock_listener2 =
+ new testing::StrictMock<MockSecurityManagerListener>();
const SSLContext::HandshakeResult first_call_value =
SSLContext::Handshake_Result_Success;
// Expect call both listeners on 1st call
- EXPECT_CALL(mock_listener1, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(kKey, first_call_value))
.
// Emulate false (reject) result
WillOnce(Return(false));
- EXPECT_CALL(mock_listener2, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener2, OnHandshakeDone(kKey, first_call_value))
.
// Emulate true (accept) result
WillOnce(Return(true));
// First listener was not removed from listener list
// So this callback wil lbe either call.
- EXPECT_CALL(mock_listener1, OnCertificateUpdateRequired());
+ EXPECT_CALL(*mock_listener1, OnCertificateUpdateRequired());
const SSLContext::HandshakeResult second_call_value =
SSLContext::Handshake_Result_Fail;
// Expect call last listener on 2d call
- EXPECT_CALL(mock_listener1, OnHandshakeDone(key, second_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(kKey, second_call_value))
.
// Emulate false (reject) result
WillOnce(Return(true));
// Expect no call 3d call
- security_manager_->AddListener(&mock_listener1);
- security_manager_->AddListener(&mock_listener2);
+ security_manager_->AddListener(mock_listener1);
+ security_manager_->AddListener(mock_listener2);
// 1st call
- security_manager_->NotifyListenersOnHandshakeDone(key, first_call_value);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyListenersOnHandshakeDone(kKey, first_call_value);
+ security_manager_->NotifyOnCertificateUpdateRequired();
// 2nd call
- security_manager_->NotifyListenersOnHandshakeDone(key, second_call_value);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyListenersOnHandshakeDone(kKey, second_call_value);
+ security_manager_->NotifyOnCertificateUpdateRequired();
// 3nd call
security_manager_->NotifyListenersOnHandshakeDone(
- key, SSLContext::Handshake_Result_Fail);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ kKey, SSLContext::Handshake_Result_Fail);
+ security_manager_->NotifyOnCertificateUpdateRequired();
}
/*
@@ -270,7 +282,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
uint8_t session_id = 0;
TestAsyncWaiter waiter;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -278,7 +290,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
EXPECT_CALL(mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_NOT_SUPPORTED),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
// It could be any query id
SecurityQuery::INVALID_QUERY_ID);
@@ -293,7 +305,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
TEST_F(SecurityManagerTest, OnMobileMessageSent) {
const uint8_t* data_param = NULL;
const RawMessagePtr rawMessagePtr(
- utils::MakeShared<RawMessage>(key, protocolVersion, data_param, 0));
+ std::make_shared<RawMessage>(kKey, kProtocolVersion, data_param, 0));
security_manager_->OnMobileMessageSent(rawMessagePtr);
}
/*
@@ -314,7 +326,7 @@ TEST_F(SecurityManagerTest, GetEmptyQuery) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -323,9 +335,9 @@ TEST_F(SecurityManagerTest, GetEmptyQuery) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final));
+ kIsFinal));
// Call with NULL data
- call_OnMessageReceived(NULL, 0, secureServiceType);
+ call_OnMessageReceived(NULL, 0, kSecureServiceType);
}
/*
* Shall send InternallError on null data recieved
@@ -335,7 +347,7 @@ TEST_F(SecurityManagerTest, GetWrongJSONSize) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -344,7 +356,7 @@ TEST_F(SecurityManagerTest, GetWrongJSONSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final));
+ kIsFinal));
SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
header.json_size = 0x0FFFFFFF;
@@ -360,7 +372,7 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
EXPECT_CALL(mock_session_observer,
@@ -373,7 +385,7 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_ID),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
@@ -390,10 +402,12 @@ TEST_F(SecurityManagerTest, CreateSSLContext_ServiceAlreadyProtected) {
SetMockCryptoManager();
// Return mock SSLContext
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(Return(&mock_ssl_context_new));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(&mock_ssl_context_new, result);
}
/*
@@ -405,21 +419,23 @@ TEST_F(SecurityManagerTest, CreateSSLContext_ErrorCreateSSL) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
EXPECT_CALL(mock_crypto_manager, CreateSSLContext()).WillOnce(ReturnNull());
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(NULL, result);
}
/*
@@ -432,7 +448,7 @@ TEST_F(SecurityManagerTest, CreateSSLContext_SetSSLContextError) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -441,18 +457,20 @@ TEST_F(SecurityManagerTest, CreateSSLContext_SetSSLContextError) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_UNKNOWN_INTERNAL_ERROR),
- is_final));
+ kIsFinal));
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
EXPECT_CALL(mock_crypto_manager, CreateSSLContext())
.WillOnce(Return(&mock_ssl_context_new));
EXPECT_CALL(mock_crypto_manager, ReleaseSSLContext(&mock_ssl_context_new));
- EXPECT_CALL(mock_session_observer, SetSSLContext(key, &mock_ssl_context_new))
+ EXPECT_CALL(mock_session_observer, SetSSLContext(kKey, &mock_ssl_context_new))
.WillOnce(Return(SecurityManager::ERROR_UNKNOWN_INTERNAL_ERROR));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::kUseExisting);
EXPECT_EQ(NULL, result);
}
/*
@@ -464,17 +482,17 @@ TEST_F(SecurityManagerTest, CreateSSLContext_Success) {
// Expect no notifying listeners - it will be done after handshake
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(ReturnNull())
- .
- // additional check for debug code
- WillOnce(Return(&mock_ssl_context_exists));
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
+ .WillOnce(Return(&mock_ssl_context_exists));
EXPECT_CALL(mock_crypto_manager, CreateSSLContext())
.WillOnce(Return(&mock_ssl_context_new));
- EXPECT_CALL(mock_session_observer, SetSSLContext(key, &mock_ssl_context_new))
+ EXPECT_CALL(mock_session_observer, SetSSLContext(kKey, &mock_ssl_context_new))
.WillOnce(Return(SecurityManager::ERROR_SUCCESS));
- const SSLContext* result = security_manager_->CreateSSLContext(key);
+ const SSLContext* result = security_manager_->CreateSSLContext(
+ kKey,
+ security_manager::SecurityManager::ContextCreationStrategy::
+ kForceRecreation);
EXPECT_EQ(&mock_ssl_context_new, result);
}
/*
@@ -485,7 +503,7 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -493,17 +511,20 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(Return(true));
// Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(ReturnNull());
- security_manager_->StartHandshake(key);
+ security_manager_->StartHandshake(kKey);
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send InternallError on SSL error and notify listeners
@@ -513,105 +534,27 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInternalError) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
- EXPECT_CALL(mock_session_observer, GetHandshakeContext(key))
- .WillOnce(Return(SSLContext::HandshakeContext()));
+
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
-
+ // Expect notifying listeners (unsuccess)
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
+ .WillOnce(ReturnNull());
// Expect InternalError with ERROR_ID
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
- InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
- // Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
- .WillOnce(Return(true));
-
- // Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(Return(&mock_ssl_context_exists));
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .WillOnce(Return(false));
- EXPECT_CALL(mock_ssl_context_exists, SetHandshakeContext(_));
- EXPECT_CALL(mock_ssl_context_exists, StartHandshake(_, _))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Fail)));
+ InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), kIsFinal));
- security_manager_->StartHandshake(key);
+ security_manager_->StartHandshake(kKey);
+ mock_sm_listener.release();
}
-/*
- * Shall send data on call StartHandshake
- */
-TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsNotComplete) {
- SetMockCryptoManager();
- uint32_t connection_id = 0;
- uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
- EXPECT_CALL(mock_session_observer, GetHandshakeContext(key))
- .Times(3)
- .WillRepeatedly(Return(SSLContext::HandshakeContext()));
- EXPECT_CALL(mock_session_observer,
- ProtocolVersionUsed(connection_id, session_id, _))
- .WillOnce(Return(true));
-
- // Expect send one message (with correct pointer and size data)
- EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, is_final));
-
- // Return mock SSLContext
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .Times(3)
- .WillRepeatedly(Return(&mock_ssl_context_exists));
- // Expect initialization check on each call StartHandshake
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .Times(3)
- .WillRepeatedly(Return(false));
- EXPECT_CALL(mock_ssl_context_exists, SetHandshakeContext(_)).Times(3);
-
- // Emulate SSLContext::StartHandshake with different parameters
- // Only on both correct - data and size shall be send message to mobile app
- EXPECT_CALL(mock_ssl_context_exists, StartHandshake(_, _))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(0),
- Return(SSLContext::Handshake_Result_Success)))
- .WillOnce(DoAll(SetArgPointee<0>((uint8_t*)NULL),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Success)))
- .WillOnce(DoAll(SetArgPointee<0>(handshake_data_out_pointer),
- SetArgPointee<1>(handshake_data_out_size),
- Return(SSLContext::Handshake_Result_Success)));
- security_manager_->StartHandshake(key);
- security_manager_->StartHandshake(key);
- security_manager_->StartHandshake(key);
-}
-/*
- * Shall notify listeners on call StartHandshake after SSLContext initialization
- * complete
- */
-TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsComplete) {
- SetMockCryptoManager();
- // Expect no message send
- // Expect notifying listeners (success)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
- .WillOnce(Return(true));
-
- // Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(Return(&mock_ssl_context_exists));
- EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
- .WillOnce(Return(true));
- EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired())
- .WillOnce(Return(false));
-
- security_manager_->StartHandshake(key);
-}
/*
* Shall send InternallError on
* getting SEND_HANDSHAKE_DATA with NULL data
@@ -622,7 +565,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
uint8_t session_id = 0;
TestAsyncWaiter waiter;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.WillOnce(Return(true));
@@ -632,7 +575,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
EmulateMobileMessageHandshake(NULL, 0);
@@ -643,7 +586,8 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
* 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;
@@ -651,7 +595,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_ServiceNotProtected) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
EXPECT_CALL(mock_session_observer,
@@ -662,17 +606,17 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_ServiceNotProtected) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SERVICE_NOT_PROTECTED),
- is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ kIsFinal)).WillOnce(NotifyTestAsyncWaiter(&waiter));
times++;
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
times++;
@@ -680,6 +624,9 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_ServiceNotProtected) {
EmulateMobileMessageHandshake(data, sizeof(data) / sizeof(data[0]));
EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send InternallError on getting
@@ -697,7 +644,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
@@ -712,18 +659,18 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SSL_INVALID_DATA),
- is_final))
+ kIsFinal))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(Return(&mock_ssl_context_exists));
@@ -760,6 +707,9 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
handshake_data, handshake_data_size, handshake_emulates);
EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
@@ -775,7 +725,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
TestAsyncWaiter waiter;
uint32_t times = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
@@ -789,14 +739,14 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
const size_t raw_message_size = 15;
EXPECT_CALL(
mock_protocol_handler,
- SendMessageToMobileApp(RawMessageEqSize(raw_message_size), is_final))
+ SendMessageToMobileApp(RawMessageEqSize(raw_message_size), kIsFinal))
.Times(handshake_emulates)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += handshake_emulates;
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Fail))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
@@ -805,7 +755,7 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
times += handshake_emulates;
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
Return(&mock_ssl_context_exists)));
@@ -832,6 +782,9 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
handshake_data, handshake_data_size, handshake_emulates);
EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall call all listeners on success end handshake
@@ -847,13 +800,13 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
uint32_t times = 0;
// Expect no errors
// Expect notifying listeners (success)
- EXPECT_CALL(mock_sm_listener,
- OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
+ EXPECT_CALL(*mock_sm_listener,
+ OnHandshakeDone(kKey, SSLContext::Handshake_Result_Success))
.WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times++;
// Emulate SessionObserver and CryptoManager result
- EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
+ EXPECT_CALL(mock_session_observer, GetSSLContext(kKey, kControl))
.Times(handshake_emulates)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
Return(&mock_ssl_context_exists)));
@@ -906,14 +859,14 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
// uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _)).Times(2);
+ EXPECT_CALL(mock_session_observer, PairFromKey(kKey, _, _)).Times(2);
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.Times(2)
.WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
times += 2; // matches to the number above
- EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, is_final))
+ EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, kIsFinal))
.Times(2)
.WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
times += 2; // matches to the number above
@@ -923,6 +876,9 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
handshake_data, handshake_data_size, handshake_emulates);
EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall not any query on getting empty SEND_INTERNAL_ERROR
diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
index 3d62dd5d6a..1034bb3c83 100644
--- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc
+++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
@@ -56,46 +56,56 @@ namespace custom_str = utils::custom_string;
namespace {
const std::string server_ca_cert_filename = "server";
const std::string client_ca_cert_filename = "client";
-const std::string client_certificate = "client/client_credential.p12.enc";
-const std::string server_certificate = "server/spt_credential.p12.enc";
+const std::string client_cert_filename = "client.crt";
+const std::string server_cert_filename = "server.crt";
+const std::string client_key_filename = "client_private.key";
+const std::string server_key_filename = "server_private.key";
+const std::string client_certificate = "client/client_credential.pem";
+const std::string server_certificate = "server/spt_credential.pem";
const std::string server_unsigned_cert_file =
- "server/spt_credential_unsigned.p12.enc";
+ "server/spt_credential_unsigned.pem";
const std::string server_expired_cert_file =
- "server/spt_credential_expired.p12.enc";
+ "server/spt_credential_expired.pem";
const bool verify_peer = true;
const bool skip_peer_verification = false;
-const size_t updates_before_hour = 24;
-
} // namespace
+struct Protocol {
+ security_manager::Protocol server_protocol;
+ security_manager::Protocol client_protocol;
+
+ Protocol(security_manager::Protocol s_protocol,
+ security_manager::Protocol c_protocol)
+ : server_protocol(s_protocol), client_protocol(c_protocol) {}
+};
-class SSLHandshakeTest : public testing::Test {
+class SSLHandshakeTest : public testing::TestWithParam<Protocol> {
protected:
void SetUp() OVERRIDE {
- mock_server_manager_settings = new testing::NiceMock<
+ mock_server_manager_settings_ = new testing::NiceMock<
security_manager_test::MockCryptoManagerSettings>();
- server_manager = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
- mock_server_manager_settings));
- ASSERT_TRUE(server_manager);
- mock_client_manager_settings = new testing::NiceMock<
+ server_manager_ = new security_manager::CryptoManagerImpl(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
+ mock_server_manager_settings_));
+ ASSERT_TRUE(server_manager_);
+ mock_client_manager_settings_ = new testing::NiceMock<
security_manager_test::MockCryptoManagerSettings>();
- client_manager = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
- mock_client_manager_settings));
- ASSERT_TRUE(client_manager);
- server_ctx = NULL;
- client_ctx = NULL;
+ client_manager_ = new security_manager::CryptoManagerImpl(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
+ mock_client_manager_settings_));
+ ASSERT_TRUE(client_manager_);
+ server_ctx_ = NULL;
+ client_ctx_ = NULL;
}
void TearDown() OVERRIDE {
- server_manager->ReleaseSSLContext(server_ctx);
- delete server_manager;
- client_manager->ReleaseSSLContext(client_ctx);
- delete client_manager;
+ server_manager_->ReleaseSSLContext(server_ctx_);
+ delete server_manager_;
+ client_manager_->ReleaseSSLContext(client_ctx_);
+ delete client_manager_;
}
void SetServerInitialValues(const security_manager::Protocol protocol,
@@ -106,18 +116,25 @@ class SSLHandshakeTest : public testing::Test {
server_certificate_ = cert;
server_ciphers_list_ = server_ciphers_list;
server_ca_certificate_path_ = ca_certificate_path;
-
- ON_CALL(*mock_server_manager_settings, security_manager_mode())
+ ON_CALL(*mock_server_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_server_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_server_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::SERVER));
- ON_CALL(*mock_server_manager_settings, security_manager_protocol_name())
+ ON_CALL(*mock_server_manager_settings_, security_manager_protocol_name())
.WillByDefault(Return(protocol));
- ON_CALL(*mock_server_manager_settings, certificate_data())
+ ON_CALL(*mock_server_manager_settings_, certificate_data())
.WillByDefault(ReturnRef(server_certificate_));
- ON_CALL(*mock_server_manager_settings, ciphers_list())
+ ON_CALL(*mock_server_manager_settings_, ciphers_list())
.WillByDefault(ReturnRef(server_ciphers_list_));
- ON_CALL(*mock_server_manager_settings, ca_cert_path())
+ ON_CALL(*mock_server_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(server_ca_certificate_path_));
- ON_CALL(*mock_server_manager_settings, verify_peer())
+ ON_CALL(*mock_server_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(server_cert_filename));
+ ON_CALL(*mock_server_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(server_key_filename));
+ ON_CALL(*mock_server_manager_settings_, verify_peer())
.WillByDefault(Return(verify_peer));
}
void SetClientInitialValues(const security_manager::Protocol protocol,
@@ -129,17 +146,25 @@ class SSLHandshakeTest : public testing::Test {
client_ciphers_list_ = client_ciphers_list;
client_ca_certificate_path_ = ca_certificate_path;
- ON_CALL(*mock_client_manager_settings, security_manager_mode())
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_client_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::CLIENT));
- ON_CALL(*mock_client_manager_settings, security_manager_protocol_name())
+ ON_CALL(*mock_client_manager_settings_, security_manager_protocol_name())
.WillByDefault(Return(protocol));
- ON_CALL(*mock_client_manager_settings, certificate_data())
+ ON_CALL(*mock_client_manager_settings_, certificate_data())
.WillByDefault(ReturnRef(client_certificate_));
- ON_CALL(*mock_client_manager_settings, ciphers_list())
+ ON_CALL(*mock_client_manager_settings_, ciphers_list())
.WillByDefault(ReturnRef(client_ciphers_list_));
- ON_CALL(*mock_client_manager_settings, ca_cert_path())
+ ON_CALL(*mock_client_manager_settings_, ca_cert_path())
.WillByDefault(ReturnRef(client_ca_certificate_path_));
- ON_CALL(*mock_client_manager_settings, verify_peer())
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(client_cert_filename));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(client_key_filename));
+ ON_CALL(*mock_client_manager_settings_, verify_peer())
.WillByDefault(Return(verify_peer));
}
@@ -156,19 +181,19 @@ class SSLHandshakeTest : public testing::Test {
cert.close();
SetServerInitialValues(
protocol, ss.str(), ciphers_list, verify_peer, ca_certificate_path);
- const bool initialized = server_manager->Init();
+ const bool initialized = server_manager_->Init();
if (!initialized) {
return false;
}
- server_ctx = server_manager->CreateSSLContext();
+ server_ctx_ = server_manager_->CreateSSLContext();
- if (!server_ctx) {
+ if (!server_ctx_) {
return false;
}
- server_ctx->SetHandshakeContext(
+ server_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("SPT"),
custom_str::CustomString("client")));
@@ -192,17 +217,17 @@ class SSLHandshakeTest : public testing::Test {
ciphers_list,
verify_peer,
ca_certificate_path);
- const bool initialized = client_manager->Init();
+ const bool initialized = client_manager_->Init();
if (!initialized) {
return false;
}
- client_ctx = client_manager->CreateSSLContext();
- if (!client_ctx) {
+ client_ctx_ = client_manager_->CreateSSLContext();
+ if (!client_ctx_) {
return false;
}
- client_ctx->SetHandshakeContext(
+ client_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("SPT"),
custom_str::CustomString("server")));
@@ -211,17 +236,17 @@ class SSLHandshakeTest : public testing::Test {
}
void ResetConnections() {
- ASSERT_NO_THROW(server_ctx->ResetConnection());
- ASSERT_NO_THROW(client_ctx->ResetConnection());
+ ASSERT_NO_THROW(server_ctx_->ResetConnection());
+ ASSERT_NO_THROW(client_ctx_->ResetConnection());
}
void StartHandshake() {
using security_manager::SSLContext;
ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&client_buf, &client_buf_len));
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ client_ctx_->StartHandshake(&client_buf_, &client_buf_len_));
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
void HandshakeProcedure_Success() {
@@ -229,23 +254,25 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- if (server_ctx->IsInitCompleted()) {
+ if (server_ctx_->IsInitCompleted()) {
break;
}
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
}
@@ -255,9 +282,9 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- const SSLContext::HandshakeResult result = server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len);
- ASSERT_FALSE(server_ctx->IsInitCompleted())
+ const SSLContext::HandshakeResult result = server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_);
+ ASSERT_FALSE(server_ctx_->IsInitCompleted())
<< "Expected server side handshake fail";
// First few handshake will be successful
@@ -265,18 +292,19 @@ class SSLHandshakeTest : public testing::Test {
// Test successfully passed with handshake fail
return;
}
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(client_ctx->IsInitCompleted())
+ ASSERT_FALSE(client_ctx_->IsInitCompleted())
<< "Expected server side handshake fail";
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
FAIL() << "Expected server side handshake fail";
}
@@ -288,17 +316,18 @@ class SSLHandshakeTest : public testing::Test {
StartHandshake();
while (true) {
- ASSERT_EQ(SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
- client_buf, client_buf_len, &server_buf, &server_buf_len))
+ ASSERT_EQ(
+ SSLContext::Handshake_Result_Success,
+ server_ctx_->DoHandshakeStep(
+ client_buf_, client_buf_len_, &server_buf_, &server_buf_len_))
<< ERR_reason_error_string(ERR_get_error());
- ASSERT_FALSE(server_buf == NULL);
- ASSERT_GT(server_buf_len, 0u);
+ ASSERT_FALSE(server_buf_ == NULL);
+ ASSERT_GT(server_buf_len_, 0u);
- const SSLContext::HandshakeResult result = client_ctx->DoHandshakeStep(
- server_buf, server_buf_len, &client_buf, &client_buf_len);
- ASSERT_FALSE(client_ctx->IsInitCompleted())
+ const SSLContext::HandshakeResult result = client_ctx_->DoHandshakeStep(
+ server_buf_, server_buf_len_, &client_buf_, &client_buf_len_);
+ ASSERT_FALSE(client_ctx_->IsInitCompleted())
<< "Expected client side handshake fail";
// First few handsahke will be successful
@@ -308,25 +337,25 @@ class SSLHandshakeTest : public testing::Test {
return;
}
- ASSERT_FALSE(client_buf == NULL);
- ASSERT_GT(client_buf_len, 0u);
+ ASSERT_FALSE(client_buf_ == NULL);
+ ASSERT_GT(client_buf_len_, 0u);
}
FAIL() << "Expected client side handshake fail";
}
- security_manager::CryptoManager* server_manager;
- security_manager::CryptoManager* client_manager;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::CryptoManager* server_manager_;
+ security_manager::CryptoManager* client_manager_;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_server_manager_settings;
+ mock_server_manager_settings_;
testing::NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_client_manager_settings;
+ mock_client_manager_settings_;
- const uint8_t* server_buf;
- const uint8_t* client_buf;
- size_t server_buf_len;
- size_t client_buf_len;
+ const uint8_t* server_buf_;
+ const uint8_t* client_buf_;
+ size_t server_buf_len_;
+ size_t client_buf_len_;
std::string server_certificate_;
std::string server_ciphers_list_;
@@ -335,191 +364,175 @@ class SSLHandshakeTest : public testing::Test {
std::string client_certificate_;
std::string client_ciphers_list_;
std::string client_ca_certificate_path_;
+
+ const std::vector<int> forced_protected_service_;
+ const std::vector<int> forced_unprotected_service_;
};
-TEST_F(SSLHandshakeTest, NoVerification) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+INSTANTIATE_TEST_CASE_P(
+ CorrectProtocol,
+ SSLHandshakeTest,
+ ::testing::Values(
+ Protocol(security_manager::TLSv1, security_manager::TLSv1),
+ Protocol(security_manager::TLSv1_1, security_manager::TLSv1_1),
+ Protocol(security_manager::TLSv1_2, security_manager::TLSv1_2),
+ Protocol(security_manager::DTLSv1, security_manager::DTLSv1)));
+
+TEST_P(SSLHandshakeTest, NoVerification) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ServerSide) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_ServerSide) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
- server_certificate,
- "ALL",
- verify_peer,
- "unex"))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
+ ASSERT_TRUE(InitServerManagers(
+ GetParam().server_protocol, "", "ALL", verify_peer, "unex"))
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ServerSideFail());
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
+ << server_manager_->LastError();
GTEST_TRACE(ResetConnections());
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_ClientSide) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
- server_certificate,
- "ALL",
- verify_peer,
- client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
- client_certificate,
- "ALL",
- verify_peer,
- server_ca_cert_filename))
- << client_manager->LastError();
-
- GTEST_TRACE(HandshakeProcedure_Success());
-}
-
-TEST_F(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
- client_certificate,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
+ "",
"ALL",
verify_peer,
"client_ca_cert_filename"))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_Fail));
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(ResetConnections());
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, CAVerification_BothSides) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_BothSides) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_Success());
}
-TEST_F(SSLHandshakeTest, UnsignedCert) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, UnsignedCert) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_unsigned_cert_file,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_CertNotSigned));
}
-TEST_F(SSLHandshakeTest, ExpiredCert) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, ExpiredCert) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_expired_cert_file,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
GTEST_TRACE(HandshakeProcedure_ClientSideFail(
security_manager::SSLContext::Handshake_Result_CertExpired));
}
-TEST_F(SSLHandshakeTest, AppNameAndAppIDInvalid) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, AppNameAndAppIDInvalid) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
verify_peer,
server_ca_cert_filename))
- << client_manager->LastError();
-
- client_ctx->SetHandshakeContext(
- security_manager::SSLContext::HandshakeContext(
- custom_str::CustomString("server"),
- custom_str::CustomString("Wrong")));
+ << client_manager_->LastError();
- GTEST_TRACE(HandshakeProcedure_ClientSideFail(
- security_manager::SSLContext::Handshake_Result_AppNameMismatch));
-
- ResetConnections();
- client_ctx->SetHandshakeContext(
+ client_ctx_->SetHandshakeContext(
security_manager::SSLContext::HandshakeContext(
custom_str::CustomString("Wrong"),
custom_str::CustomString("server")));
@@ -528,19 +541,19 @@ TEST_F(SSLHandshakeTest, AppNameAndAppIDInvalid) {
security_manager::SSLContext::Handshake_Result_AppIDMismatch));
}
-TEST_F(SSLHandshakeTest, NoVerification_ResetConnection) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, NoVerification_ResetConnection) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
skip_peer_verification,
""))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
""))
- << client_manager->LastError();
+ << client_manager_->LastError();
const int times = 100;
for (int i = 0; i < times; ++i) {
@@ -552,19 +565,19 @@ TEST_F(SSLHandshakeTest, NoVerification_ResetConnection) {
}
}
-TEST_F(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
+TEST_P(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
+ ASSERT_TRUE(InitServerManagers(GetParam().server_protocol,
server_certificate,
"ALL",
verify_peer,
client_ca_cert_filename))
- << server_manager->LastError();
- ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
+ << server_manager_->LastError();
+ ASSERT_TRUE(InitClientManagers(GetParam().client_protocol,
client_certificate,
"ALL",
skip_peer_verification,
server_ca_cert_filename))
- << client_manager->LastError();
+ << client_manager_->LastError();
const int times = 100;
for (int i = 0; i < times; ++i) {
@@ -575,7 +588,6 @@ TEST_F(SSLHandshakeTest, CAVerification_BothSides_ResetConnection) {
GTEST_TRACE(ResetConnections());
}
}
-
// TODO(EZamakhov): add fail tests -broken or not full ca certificate chain
} // namespace ssl_handshake_test
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 9223a74505..05eeb802ad 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -41,16 +41,17 @@
#include "security_manager/ssl_context.h"
#include "utils/custom_string.h"
#include "security_manager/mock_security_manager_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
namespace {
-const size_t kUpdatesBeforeHour = 24;
const std::string kCaPath = "";
+const std::string kClientCertPath = "client_certificate.crt";
+const std::string kClientPrivateKeyPath = "client_private.key";
+const std::string kServerCertPath = "server_certificate.crt";
+const std::string kServerPrivateKeyPath = "server_private.key";
const uint8_t* kServerBuf;
const uint8_t* kClientBuf;
const std::string kAllCiphers = "ALL";
@@ -70,27 +71,27 @@ namespace ssl_context_test {
namespace custom_str = utils::custom_string;
struct ProtocolAndCipher {
- security_manager::Protocol server_protocol;
- security_manager::Protocol client_protocol;
- std::string server_ciphers_list;
- std::string client_ciphers_list;
+ security_manager::Protocol server_protocol_;
+ security_manager::Protocol client_protocol_;
+ std::string server_ciphers_list_;
+ std::string client_ciphers_list_;
ProtocolAndCipher(security_manager::Protocol s_protocol,
security_manager::Protocol c_protocol,
std::string s_ciphers_list,
std::string c_ciphers_list)
- : server_protocol(s_protocol)
- , client_protocol(c_protocol)
- , server_ciphers_list(s_ciphers_list)
- , client_ciphers_list(c_ciphers_list) {}
+ : server_protocol_(s_protocol)
+ , client_protocol_(c_protocol)
+ , server_ciphers_list_(s_ciphers_list)
+ , client_ciphers_list_(c_ciphers_list) {}
};
class SSLTest : public testing::Test {
protected:
static void SetUpTestCase() {
- SetCertificate("server/spt_credential_unsigned.p12.enc",
+ SetCertificate("server/spt_credential_unsigned.pem",
server_certificate_data_base64_);
- SetCertificate("client/client_credential_unsigned.p12.enc",
+ SetCertificate("client/client_credential_unsigned.pem",
client_certificate_data_base64_);
}
@@ -108,9 +109,9 @@ class SSLTest : public testing::Test {
}
virtual void SetUp() OVERRIDE {
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> crypto_set(
+ std::shared_ptr<security_manager::CryptoManagerSettings> crypto_set(
mock_crypto_manager_settings_);
crypto_manager_ = new security_manager::CryptoManagerImpl(crypto_set);
@@ -127,12 +128,22 @@ class SSLTest : public testing::Test {
.WillRepeatedly(ReturnRef(kCaPath));
EXPECT_CALL(*mock_crypto_manager_settings_, verify_peer())
.WillOnce(Return(false));
+
+ ON_CALL(*mock_crypto_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kServerCertPath));
+ ON_CALL(*mock_crypto_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kServerPrivateKeyPath));
+
const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
@@ -150,6 +161,16 @@ class SSLTest : public testing::Test {
.WillRepeatedly(ReturnRef(kCaPath));
EXPECT_CALL(*mock_client_manager_settings_, verify_peer())
.WillOnce(Return(false));
+
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kClientCertPath));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kClientPrivateKeyPath));
+
const bool client_manager_initialization = client_manager_->Init();
EXPECT_TRUE(client_manager_initialization);
@@ -159,19 +180,19 @@ class SSLTest : public testing::Test {
.WillByDefault(Return(kMaximumPayloadSize));
EXPECT_CALL(*mock_crypto_manager_settings_, security_manager_mode())
.WillRepeatedly(Return(security_manager::SERVER));
- server_ctx = crypto_manager_->CreateSSLContext();
+ server_ctx_ = crypto_manager_->CreateSSLContext();
EXPECT_CALL(*mock_client_manager_settings_, security_manager_mode())
.Times(2)
.WillRepeatedly(Return(security_manager::CLIENT));
- client_ctx = client_manager_->CreateSSLContext();
+ client_ctx_ = client_manager_->CreateSSLContext();
using custom_str::CustomString;
security_manager::SSLContext::HandshakeContext ctx(CustomString("SPT"),
CustomString("client"));
- server_ctx->SetHandshakeContext(ctx);
+ server_ctx_->SetHandshakeContext(ctx);
ctx.expected_cn = "server";
- client_ctx->SetHandshakeContext(ctx);
+ client_ctx_->SetHandshakeContext(ctx);
kServerBuf = NULL;
kClientBuf = NULL;
@@ -180,8 +201,8 @@ class SSLTest : public testing::Test {
}
void TearDown() OVERRIDE {
- crypto_manager_->ReleaseSSLContext(server_ctx);
- client_manager_->ReleaseSSLContext(client_ctx);
+ crypto_manager_->ReleaseSSLContext(server_ctx_);
+ client_manager_->ReleaseSSLContext(client_ctx_);
delete crypto_manager_;
delete client_manager_;
@@ -190,15 +211,18 @@ class SSLTest : public testing::Test {
const size_t kMaximumPayloadSize = 1000u;
security_manager::CryptoManager* crypto_manager_;
security_manager::CryptoManager* client_manager_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
static std::string client_certificate_data_base64_;
static std::string server_certificate_data_base64_;
+
+ const std::vector<int> forced_unprotected_service_;
+ const std::vector<int> forced_protected_service_;
};
std::string SSLTest::client_certificate_data_base64_;
std::string SSLTest::server_certificate_data_base64_;
@@ -218,41 +242,42 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
ASSERT_FALSE(certificate.empty()) << "Certificate data file is empty";
certificate_data_base64_ = certificate;
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> server_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> server_crypto(
mock_crypto_manager_settings_);
- crypto_manager = new security_manager::CryptoManagerImpl(server_crypto);
+ crypto_manager_ = new security_manager::CryptoManagerImpl(server_crypto);
- SetServerInitialValues(GetParam().server_protocol,
- GetParam().server_ciphers_list);
+ SetServerInitialValues(GetParam().server_protocol_,
+ GetParam().server_ciphers_list_);
- const bool crypto_manager_initialization = crypto_manager->Init();
+ const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
- client_manager = new security_manager::CryptoManagerImpl(client_crypto);
+ client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
- SetClientInitialValues(GetParam().client_protocol,
- GetParam().client_ciphers_list);
+ SetClientInitialValues(GetParam().client_protocol_,
+ GetParam().client_ciphers_list_);
- const bool client_manager_initialization = client_manager->Init();
+ const bool client_manager_initialization = client_manager_->Init();
EXPECT_TRUE(client_manager_initialization);
- server_ctx = crypto_manager->CreateSSLContext();
- client_ctx = client_manager->CreateSSLContext();
+ server_ctx_ = crypto_manager_->CreateSSLContext();
+ client_ctx_ = client_manager_->CreateSSLContext();
using custom_str::CustomString;
- security_manager::SSLContext::HandshakeContext ctx(CustomString("SPT"),
- CustomString("client"));
- server_ctx->SetHandshakeContext(ctx);
- ctx.expected_cn = "server";
- client_ctx->SetHandshakeContext(ctx);
+ server_ctx_->SetHandshakeContext(
+ security_manager::SSLContext::HandshakeContext(CustomString("SPT"),
+ CustomString("client")));
+ client_ctx_->SetHandshakeContext(
+ security_manager::SSLContext::HandshakeContext(CustomString("SPT"),
+ CustomString("server")));
kServerBuf = NULL;
kClientBuf = NULL;
@@ -261,15 +286,19 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
}
void TearDown() OVERRIDE {
- crypto_manager->ReleaseSSLContext(server_ctx);
- client_manager->ReleaseSSLContext(client_ctx);
+ crypto_manager_->ReleaseSSLContext(server_ctx_);
+ client_manager_->ReleaseSSLContext(client_ctx_);
- delete crypto_manager;
- delete client_manager;
+ delete crypto_manager_;
+ delete client_manager_;
}
void SetServerInitialValues(security_manager::Protocol protocol,
const std::string& server_ciphers_list) {
+ ON_CALL(*mock_crypto_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_crypto_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
ON_CALL(*mock_crypto_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::SERVER));
ON_CALL(*mock_crypto_manager_settings_, security_manager_protocol_name())
@@ -282,9 +311,18 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(ReturnRef(kCaPath));
ON_CALL(*mock_crypto_manager_settings_, verify_peer())
.WillByDefault(Return(false));
+ ON_CALL(*mock_crypto_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kServerCertPath));
+ ON_CALL(*mock_crypto_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kServerPrivateKeyPath));
}
+
void SetClientInitialValues(security_manager::Protocol protocol,
const std::string& client_ciphers_list) {
+ ON_CALL(*mock_client_manager_settings_, force_unprotected_service())
+ .WillByDefault(ReturnRef(forced_unprotected_service_));
+ ON_CALL(*mock_client_manager_settings_, force_protected_service())
+ .WillByDefault(ReturnRef(forced_protected_service_));
ON_CALL(*mock_client_manager_settings_, security_manager_mode())
.WillByDefault(Return(security_manager::CLIENT));
ON_CALL(*mock_client_manager_settings_, security_manager_protocol_name())
@@ -297,17 +335,23 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(ReturnRef(kCaPath));
ON_CALL(*mock_client_manager_settings_, verify_peer())
.WillByDefault(Return(false));
+ ON_CALL(*mock_client_manager_settings_, module_cert_path())
+ .WillByDefault(ReturnRef(kClientCertPath));
+ ON_CALL(*mock_client_manager_settings_, module_key_path())
+ .WillByDefault(ReturnRef(kClientPrivateKeyPath));
}
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
- security_manager::CryptoManager* crypto_manager;
- security_manager::CryptoManager* client_manager;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::CryptoManager* crypto_manager_;
+ security_manager::CryptoManager* client_manager_;
+ security_manager::SSLContext* server_ctx_;
+ security_manager::SSLContext* client_ctx_;
std::string certificate_data_base64_;
+ const std::vector<int> forced_unprotected_service_;
+ const std::vector<int> forced_protected_service_;
};
class SSLTestForTLS1_2 : public SSLTestParam {};
@@ -316,17 +360,25 @@ class SSLTestForTLS1_2 : public SSLTestParam {};
INSTANTIATE_TEST_CASE_P(
CorrectProtocolAndCiphers,
SSLTestParam,
- ::testing::Values(ProtocolAndCipher(security_manager::TLSv1,
+ ::testing::Values(ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1,
kFordCipher,
kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::SSLv3,
kFordCipher,
+ kFordCipher)
+#endif
+ ,
+ ProtocolAndCipher(security_manager::DTLSv1,
+ security_manager::DTLSv1,
+ kFordCipher,
kFordCipher)));
INSTANTIATE_TEST_CASE_P(
@@ -336,27 +388,45 @@ INSTANTIATE_TEST_CASE_P(
security_manager::TLSv1_1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1,
- security_manager::SSLv3,
+ ProtocolAndCipher(security_manager::TLSv1_1,
+ security_manager::TLSv1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_1,
+ ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::TLSv1,
kFordCipher,
kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_2,
+ security_manager::TLSv1_1,
+ kFordCipher,
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
+ ProtocolAndCipher(security_manager::TLSv1,
+ security_manager::SSLv3,
+ kFordCipher,
+ kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::SSLv3,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_2,
- security_manager::TLSv1,
+ ProtocolAndCipher(security_manager::TLSv1,
+ security_manager::DTLSv1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_2,
+ ProtocolAndCipher(security_manager::DTLSv1,
security_manager::TLSv1_1,
kFordCipher,
kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_2,
+ security_manager::DTLSv1,
+ kFordCipher,
+ kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_1,
+ security_manager::DTLSv1,
+ kFordCipher,
+ kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::SSLv3,
kFordCipher,
kFordCipher),
@@ -367,11 +437,14 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
+
ASSERT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
// Broke 3 bytes for get abnormal fail of handshake
@@ -379,26 +452,26 @@ TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
const_cast<uint8_t*>(kClientBuf)[client_buf_len / 2] ^= 0xFF;
const_cast<uint8_t*>(kClientBuf)[client_buf_len - 1] ^= 0xFF;
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
- EXPECT_EQ("Initialization is not completed", server_ctx->LastError());
- EXPECT_EQ("Initialization is not completed", client_ctx->LastError());
+ EXPECT_EQ("Initialization is not completed", server_ctx_->LastError());
+ EXPECT_EQ("Initialization is not completed", client_ctx_->LastError());
}
// TODO {AKozoriz} : Unexpected uncomplited init of SSL component.
// In this and next tests.
// Must be fixed after merge to develop.
TEST_F(SSLTest, OnTSL2Protocol_Positive) {
- ASSERT_EQ(client_ctx->StartHandshake(&kClientBuf, &client_buf_len),
+ ASSERT_EQ(client_ctx_->StartHandshake(&kClientBuf, &client_buf_len),
security_manager::SSLContext::Handshake_Result_Success);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
while (true) {
ASSERT_TRUE(NULL != kClientBuf);
ASSERT_LT(0u, client_buf_len);
const security_manager::SSLContext::HandshakeResult server_result =
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
server_result);
@@ -406,11 +479,11 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
ASSERT_LT(0u, server_buf_len);
const security_manager::SSLContext::HandshakeResult client_result =
- client_ctx->DoHandshakeStep(
+ client_ctx_->DoHandshakeStep(
kServerBuf, server_buf_len, &kClientBuf, &client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
client_result);
- if (server_ctx->IsInitCompleted()) {
+ if (server_ctx_->IsInitCompleted()) {
break;
}
@@ -421,22 +494,22 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
ASSERT_TRUE(NULL == kClientBuf);
ASSERT_EQ(0u, client_buf_len);
// expect both side initialization complete
- EXPECT_TRUE(client_ctx->IsInitCompleted());
- EXPECT_TRUE(server_ctx->IsInitCompleted());
+ EXPECT_TRUE(client_ctx_->IsInitCompleted());
+ EXPECT_TRUE(server_ctx_->IsInitCompleted());
// Encrypt text on client side
const uint8_t* text = reinterpret_cast<const uint8_t*>("abra");
const uint8_t* encrypted_text = 0;
size_t text_len = 4;
size_t encrypted_text_len;
- EXPECT_TRUE(client_ctx->Encrypt(
+ EXPECT_TRUE(client_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), encrypted_text);
ASSERT_LT(0u, encrypted_text_len);
// Decrypt text on server side
- EXPECT_TRUE(server_ctx->Decrypt(
+ EXPECT_TRUE(server_ctx_->Decrypt(
encrypted_text, encrypted_text_len, &text, &text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), text);
ASSERT_LT(0u, text_len);
@@ -446,34 +519,34 @@ TEST_F(SSLTest, OnTSL2Protocol_Positive) {
TEST_F(SSLTest, OnTSL2Protocol_EcncryptionFail) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
- while (!server_ctx->IsInitCompleted()) {
+ while (!server_ctx_->IsInitCompleted()) {
ASSERT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
ASSERT_FALSE(NULL == kServerBuf);
ASSERT_LT(0u, server_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->DoHandshakeStep(
+ client_ctx_->DoHandshakeStep(
kServerBuf, server_buf_len, &kClientBuf, &client_buf_len));
}
// Expect empty buffers after init complete
ASSERT_TRUE(NULL == kClientBuf);
ASSERT_EQ(0u, client_buf_len);
// Expect both side initialization complete
- EXPECT_TRUE(client_ctx->IsInitCompleted());
- EXPECT_TRUE(server_ctx->IsInitCompleted());
+ EXPECT_TRUE(client_ctx_->IsInitCompleted());
+ EXPECT_TRUE(server_ctx_->IsInitCompleted());
// Encrypt text on client side
const uint8_t* text = reinterpret_cast<const uint8_t*>("abra");
const uint8_t* encrypted_text = 0;
size_t text_len = 4;
size_t encrypted_text_len;
- EXPECT_TRUE(client_ctx->Encrypt(
+ EXPECT_TRUE(client_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
ASSERT_NE(reinterpret_cast<void*>(NULL), encrypted_text);
ASSERT_LT(0u, encrypted_text_len);
@@ -486,29 +559,30 @@ TEST_F(SSLTest, OnTSL2Protocol_EcncryptionFail) {
const uint8_t* out_text;
size_t out_text_size;
// Decrypt broken text on server side
- EXPECT_FALSE(server_ctx->Decrypt(
+ EXPECT_FALSE(server_ctx_->Decrypt(
&broken[0], broken.size(), &out_text, &out_text_size));
// Check after broken message that server encryption and decryption fail
// Encrypte message on server side
- EXPECT_FALSE(server_ctx->Decrypt(
+ EXPECT_FALSE(server_ctx_->Decrypt(
encrypted_text, encrypted_text_len, &out_text, &out_text_size));
- EXPECT_FALSE(server_ctx->Encrypt(
+ EXPECT_FALSE(server_ctx_->Encrypt(
text, text_len, &encrypted_text, &encrypted_text_len));
}
TEST_P(SSLTestParam, ClientAndServerNotTLSv1_2_HandshakeFailed) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
+
EXPECT_TRUE(NULL == kClientBuf);
EXPECT_EQ(0u, client_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- server_ctx->DoHandshakeStep(
+ server_ctx_->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
EXPECT_TRUE(NULL == kServerBuf);
EXPECT_EQ(0u, server_buf_len);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
}
INSTANTIATE_TEST_CASE_P(
@@ -521,24 +595,31 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_P(SSLTestForTLS1_2, HandshakeFailed) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
- client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
+ client_ctx_->StartHandshake(&kClientBuf, &client_buf_len));
EXPECT_FALSE(NULL == kClientBuf);
ASSERT_LT(0u, client_buf_len);
+
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_AbnormalFail,
- server_ctx->DoHandshakeStep(
- kClientBuf, client_buf_len, &kServerBuf, &server_buf_len));
+ server_ctx_->DoHandshakeStep(
+ kClientBuf, client_buf_len, &kServerBuf, &server_buf_len))
+ << ERR_reason_error_string(ERR_get_error());
+
EXPECT_TRUE(NULL == kServerBuf);
EXPECT_EQ(0u, server_buf_len);
- EXPECT_FALSE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx_->IsInitCompleted());
}
} // namespace ssl_context_test
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
index dfbf4ba43e..bfa39af10a 100644
--- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always false schema item.
**/
@@ -47,18 +46,24 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysFalseSchemaItem> create();
+ static std::shared_ptr<CAlwaysFalseSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return Errors::ERROR
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysFalseSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysFalseSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
index 3dd598d7bd..4750c280e5 100644
--- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always true schema item.
**/
@@ -47,18 +46,24 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysTrueSchemaItem> create();
+ static std::shared_ptr<CAlwaysTrueSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysTrueSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysTrueSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
index 0d3a651d56..a81fdd637e 100644
--- a/src/components/smart_objects/include/smart_objects/array_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -34,13 +34,14 @@
#include <stddef.h>
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Array schema item.
**/
@@ -55,7 +56,7 @@ class CArraySchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CArraySchemaItem> create(
+ static std::shared_ptr<CArraySchemaItem> create(
const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(),
const TSchemaItemParameter<size_t>& MinSize =
TSchemaItemParameter<size_t>(),
@@ -64,12 +65,15 @@ class CArraySchemaItem : public ISchemaItem {
/**
* @brief Validate smart object.
- *
* @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
@@ -80,7 +84,9 @@ class CArraySchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
@@ -124,7 +130,7 @@ class CArraySchemaItem : public ISchemaItem {
const TSchemaItemParameter<size_t> mMaxSize;
DISALLOW_COPY_AND_ASSIGN(CArraySchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
index eca5a0e063..3a9f6c929d 100644
--- a/src/components/smart_objects/include/smart_objects/bool_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
@@ -33,12 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Bool schema item.
**/
@@ -49,7 +47,7 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
* @param DefaultValue Default value of a parameter.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CBoolSchemaItem> create(
+ static std::shared_ptr<CBoolSchemaItem> create(
const TSchemaItemParameter<bool>& DefaultValue =
TSchemaItemParameter<bool>());
@@ -61,6 +59,6 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
private:
DISALLOW_COPY_AND_ASSIGN(CBoolSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
index 857354a4e6..5978fcb282 100644
--- a/src/components/smart_objects/include/smart_objects/default_shema_item.h
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -33,14 +33,13 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Default schema item.
@@ -52,9 +51,14 @@ class CDefaultSchemaItem : public ISchemaItem {
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Set default value to an object.
@@ -98,9 +102,20 @@ CDefaultSchemaItem<Type>::CDefaultSchemaItem(const ParameterType& DefaultValue)
: mDefaultValue(DefaultValue) {}
template <typename Type>
-Errors::eType CDefaultSchemaItem<Type>::validate(const SmartObject& Object) {
- return (getSmartType() == Object.getType()) ? Errors::OK
- : Errors::INVALID_VALUE;
+errors::eType CDefaultSchemaItem<Type>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ if (getSmartType() != Object.getType()) {
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(getSmartType()) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ } else {
+ return errors::OK;
+ }
}
template <typename Type>
@@ -125,6 +140,6 @@ void CDefaultSchemaItem<Type>::BuildObjectBySchema(
}
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index a0d6d94017..cbba5bd7cd 100644
--- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -39,11 +39,36 @@
#include <set>
#include <string>
-#include "utils/shared_ptr.h"
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+
+struct ElementSignature {
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mRemoved;
+
+ ElementSignature(std::string since = "",
+ std::string until = "",
+ bool removed = false) {
+ utils::SemanticVersion since_struct(since);
+ utils::SemanticVersion until_struct(until);
+
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+
+ mRemoved = removed;
+ }
+};
template <typename EnumType>
class EnumConversionHelper;
@@ -60,16 +85,44 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TEnumSchemaItem> create(
+ static std::shared_ptr<TEnumSchemaItem> create(
const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue =
TSchemaItemParameter<EnumType>());
+
+ /**
+ * @brief Create a new schema item.
+ * @param AllowedElements Set of allowed enumeration elements.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
+ **/
+ static std::shared_ptr<TEnumSchemaItem> createWithSignatures(
+ const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures,
+ const TSchemaItemParameter<EnumType>& DefaultValue =
+ TSchemaItemParameter<EnumType>());
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
+ **/
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
+ /**
+ * @brief Return the correct history signature based on message version.
+ * @param signatures Vector reference of enums history items.
+ * @param MessageVersion RPC Version of mobile app.
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ const ElementSignature getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion);
+
/**
* @brief Apply schema.
* This implementation checks if enumeration is represented as string
@@ -80,7 +133,9 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -95,12 +150,18 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
**/
TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue);
+
+ TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures);
SmartType getSmartType() const OVERRIDE;
EnumType getDefaultValue() const OVERRIDE;
/**
* @brief Set of allowed enumeration elements.
**/
const std::set<EnumType> mAllowedElements;
+ std::map<EnumType, std::vector<ElementSignature> > mElementSignatures;
/**
* @brief Default value.
**/
@@ -199,27 +260,114 @@ class EnumConversionHelper {
};
template <typename EnumType>
-utils::SharedPtr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
+std::shared_ptr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue) {
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue));
+}
+
+template <typename EnumType>
+std::shared_ptr<TEnumSchemaItem<EnumType> >
+TEnumSchemaItem<EnumType>::createWithSignatures(
const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures,
const TSchemaItemParameter<EnumType>& DefaultValue) {
- return new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue);
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(
+ AllowedElements, DefaultValue, ElementSignatures));
+}
+
+template <typename EnumType>
+const ElementSignature TEnumSchemaItem<EnumType>::getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion) {
+ for (uint i = 0; i < signatures.size(); i++) {
+ ElementSignature signature = signatures[i];
+ // Check if signature matches message version
+ if (signature.mSince != boost::none &&
+ MessageVersion < signature.mSince.get()) {
+ // Msg version predates 'since' field, check next entry
+ continue;
+ }
+ if (signature.mUntil != boost::none &&
+ (MessageVersion >= signature.mUntil.get())) {
+ continue; // Msg version newer than `until` field, check next entry
+ }
+ // Found correct signature
+ return signature;
+ }
+
+ // Could not match msg version to element siganture
+ ElementSignature ret;
+ return ret;
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
+errors::eType TEnumSchemaItem<EnumType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Integer != Object.getType()) {
- return Errors::INVALID_VALUE;
+ std::string validation_info;
+ if (SmartType_String == Object.getType()) {
+ validation_info = "Invalid enum value: " + Object.asString();
+ } else {
+ validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Integer) +
+ " (enum), got: " +
+ SmartObject::typeToString(Object.getType());
+ }
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ }
+
+ auto elements_it =
+ mAllowedElements.find(static_cast<EnumType>(Object.asInt()));
+
+ if (elements_it == mAllowedElements.end()) {
+ std::stringstream stream;
+ stream << "Invalid enum value: " << Object.asInt();
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
- if (mAllowedElements.find(static_cast<EnumType>(Object.asInt())) ==
- mAllowedElements.end()) {
- return Errors::OUT_OF_RANGE;
+
+ // Element exists in schema. Check if version is also valid.
+ if (MessageVersion.isValid()) {
+ EnumType value = *elements_it;
+ auto signatures_it = mElementSignatures.find(value);
+ if (signatures_it != mElementSignatures.end()) {
+ if (!signatures_it->second.empty()) {
+ ElementSignature signature =
+ getSignature(signatures_it->second, MessageVersion);
+ if (signature.mRemoved) {
+ // Element was removed for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " removed for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ } else if (signature.mSince == boost::none &&
+ signature.mUntil == boost::none) {
+ // Element does not exist for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " does not exist for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ }
+ }
+ }
}
- return Errors::OK;
+ return errors::OK;
}
template <typename EnumType>
-void TEnumSchemaItem<EnumType>::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void TEnumSchemaItem<EnumType>::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String == Object.getType()) {
EnumType enum_val = static_cast<EnumType>(-1);
if (ConversionHelper::StringToEnum(Object.asString(), &enum_val)) {
@@ -255,6 +403,15 @@ TEnumSchemaItem<EnumType>::TEnumSchemaItem(
: CDefaultSchemaItem<EnumType>(DefaultValue)
, mAllowedElements(AllowedElements) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+template <typename EnumType>
+TEnumSchemaItem<EnumType>::TEnumSchemaItem(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures)
+ : CDefaultSchemaItem<EnumType>(DefaultValue)
+ , mAllowedElements(AllowedElements)
+ , mElementSignatures(ElementSignatures) {}
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/errors.h b/src/components/smart_objects/include/smart_objects/errors.h
index 5d22d2386e..8fc73be049 100644
--- a/src/components/smart_objects/include/smart_objects/errors.h
+++ b/src/components/smart_objects/include/smart_objects/errors.h
@@ -31,9 +31,9 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-namespace Errors {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+namespace errors {
/**
* @brief Enumeration that provides information about SmartObject validation
*errors
@@ -64,8 +64,8 @@ enum eType {
**/
ERROR
};
-} // namespace Errors
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace errors
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h
index 01d6c08daa..6481605daf 100644
--- a/src/components/smart_objects/include/smart_objects/number_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h
@@ -35,13 +35,14 @@
#include <typeinfo>
#include <limits>
-#include "utils/shared_ptr.h"
+
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "utils/convert_utils.h"
+#include "utils/helpers.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Number schema item.
* @tparam NumberType Number type.
@@ -56,7 +57,7 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TNumberSchemaItem> create(
+ static std::shared_ptr<TNumberSchemaItem> create(
const TSchemaItemParameter<NumberType>& MinValue =
TSchemaItemParameter<NumberType>(),
const TSchemaItemParameter<NumberType>& MaxValue =
@@ -67,9 +68,14 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -102,11 +108,12 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
};
template <typename NumberType>
-utils::SharedPtr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
+std::shared_ptr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
NumberType>::create(const TSchemaItemParameter<NumberType>& MinValue,
const TSchemaItemParameter<NumberType>& MaxValue,
const TSchemaItemParameter<NumberType>& DefaultValue) {
- return new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue);
+ return std::shared_ptr<TNumberSchemaItem<NumberType> >(
+ new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue));
}
template <typename NumberType>
@@ -114,22 +121,32 @@ bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) {
NumberType value(0);
if ((SmartType_Double == type) && (typeid(double) == typeid(value))) {
return true;
- } else if ((SmartType_Integer == type) &&
- (typeid(int32_t) == typeid(value) ||
- typeid(uint32_t) == typeid(value) ||
- typeid(int64_t) == typeid(value) ||
- typeid(double) == typeid(value))) {
+ } else if (((SmartType_Integer == type) || (SmartType_UInteger == type)) &&
+ helpers::Compare<const std::type_info&, helpers::EQ, helpers::ONE>(
+ typeid(value),
+ typeid(int32_t),
+ typeid(uint32_t),
+ typeid(int64_t),
+ typeid(double))) {
return true;
- } else {
- return false;
}
+ return false;
}
template <typename NumberType>
-Errors::eType TNumberSchemaItem<NumberType>::validate(
- const SmartObject& Object) {
+errors::eType TNumberSchemaItem<NumberType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (!isValidNumberType(Object.getType())) {
- return Errors::INVALID_VALUE;
+ SmartType expectedType = (typeid(double) == typeid(Object.getType()))
+ ? SmartType_Double
+ : SmartType_Integer;
+ std::string validation_info =
+ "Incorrect type, expected: " + SmartObject::typeToString(expectedType) +
+ ", got: " + SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
}
NumberType value(0);
if (typeid(int32_t) == typeid(value)) {
@@ -148,13 +165,23 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
NumberType rangeLimit;
if (mMinValue.getValue(rangeLimit) && (value < rangeLimit)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Value too small, got: " << value
+ << ", minimum allowed: " << rangeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
if (mMaxValue.getValue(rangeLimit) && (value > rangeLimit)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Value too large, got: " << value
+ << ", maximum allowed: " << rangeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
template <typename NumberType>
@@ -192,6 +219,6 @@ SmartType TNumberSchemaItem<int64_t>::getSmartType() const;
template <>
SmartType TNumberSchemaItem<double>::getSmartType() const;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index 549166e723..45d161320b 100644
--- a/src/components/smart_objects/include/smart_objects/object_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -37,13 +37,14 @@
#include <set>
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Object schema item.
**/
@@ -63,7 +64,21 @@ class CObjectSchemaItem : public ISchemaItem {
* @param IsMandatory true if member is mandatory, false
* otherwise. Defaults to true.
**/
- SMember(const ISchemaItemPtr SchemaItem, const bool IsMandatory = true);
+
+ SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory = true,
+ const std::string& Since = "",
+ const std::string& Until = "",
+ const bool IsDeprecated = false,
+ const bool IsRemoved = false,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector = {});
+ /**
+ * @brief Checks the version a parameter was removed (until)
+ * If the mobile's msg version is greater than or
+ **/
+ bool CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const;
+
/**
* @brief Member schema item.
**/
@@ -72,6 +87,11 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief true if member is mandatory, false otherwise.
**/
bool mIsMandatory;
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mIsDeprecated;
+ bool mIsRemoved;
+ std::vector<CObjectSchemaItem::SMember> mHistoryVector;
};
typedef std::map<std::string, SMember> Members;
/**
@@ -82,13 +102,19 @@ class CObjectSchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CObjectSchemaItem> create(const Members& Members);
+ static std::shared_ptr<CObjectSchemaItem> create(const Members& Members);
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
* @param Object Object to apply schema.
@@ -96,7 +122,9 @@ class CObjectSchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -128,7 +156,16 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief Removes fake parameters from object.
* @param Object Object to remove fake parameters.
**/
- void RemoveFakeParams(SmartObject& Object);
+ void RemoveFakeParams(SmartObject& Object,
+ const utils::SemanticVersion& MessageVersion);
+
+ /**
+ * @brief Returns the correct schema item based on message version.
+ * @param member Schema member
+ * @param MmessageVersion Semantic Version of mobile message.
+ **/
+ const CObjectSchemaItem::SMember& GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion);
/**
* @brief Map of member name to SMember structure describing the object
@@ -137,6 +174,6 @@ class CObjectSchemaItem : public ISchemaItem {
const Members mMembers;
DISALLOW_COPY_AND_ASSIGN(CObjectSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
index 08610f244e..24c642c0ba 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -33,12 +33,18 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
#include <stdlib.h>
-#include "utils/shared_ptr.h"
+
+#include "rpc_base/validation_report.h"
#include "smart_objects/errors.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include <memory>
+#include <vector>
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -47,13 +53,18 @@ class SmartObject;
class ISchemaItem {
public:
/**
- * @brief Validate object.
+ * @brief Validate smart object.
*
* @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * message if an error occurs
+ * @param MessageVersion to check mobile RPC version against RPC Spec Histor
+ * @return ns_smart_objects::errors::eType
**/
- virtual Errors::eType validate(const SmartObject& Object);
+ virtual errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Set default value to an object.
@@ -81,8 +92,9 @@ class ISchemaItem {
* from smart object otherwise contains false.
**/
virtual void applySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object,
- const bool RemoveFakeParameters);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Unapply schema.
@@ -90,7 +102,7 @@ class ISchemaItem {
* @param Object Object to unapply schema.
**/
virtual void unapplySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object);
/**
* @brief Build smart object by smart schema having copied matched
@@ -111,7 +123,7 @@ class ISchemaItem {
virtual ~ISchemaItem() {}
};
-typedef utils::SharedPtr<ISchemaItem> ISchemaItemPtr;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+typedef std::shared_ptr<ISchemaItem> ISchemaItemPtr;
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
index 49fdb9541b..f747b0ae89 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
@@ -34,8 +34,8 @@
#include "utils/macro.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief SchemaItem parameter.
* Container for schema item parameter such as min/max value, size,
@@ -95,6 +95,6 @@ bool TSchemaItemParameter<ParameterType>::getValue(ParameterType& Value) const {
}
return mIsSpecified;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index 98e58fffd1..2abc221972 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -35,14 +35,16 @@
#include <set>
#include <string>
+#include <sstream>
#include <vector>
#include <map>
#include "smart_objects/smart_schema.h"
#include "utils/custom_string.h"
+#include "rpc_base/validation_report.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
@@ -125,7 +127,7 @@ typedef std::map<std::string, SmartObject> SmartMap;
**/
typedef std::vector<uint8_t> SmartBinary;
-typedef utils::SharedPtr<SmartObject> SmartObjectSPtr;
+typedef std::shared_ptr<SmartObject> SmartObjectSPtr;
/**
* @brief List of SmartObjects
@@ -672,9 +674,13 @@ class SmartObject FINAL {
/**
* @brief Validates object according to attached schema.
*
+ * @param report__ object for reporting errors during validation
+ * @param messageVersion of the mobile app to check against RPC Spec Schema
* @return Result of validation.
*/
- Errors::eType validate();
+ errors::eType validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Sets new schema
@@ -694,7 +700,7 @@ class SmartObject FINAL {
/**
* @brief Returns current object type
*
- * @return NsSmartObjects::SmartType
+ * @return ns_smart_objects::SmartType
**/
SmartType getType() const;
@@ -727,6 +733,35 @@ class SmartObject FINAL {
return !(*this == Other);
}
+ static std::string typeToString(SmartType type) {
+ switch (type) {
+ case SmartType_Null:
+ return "Null";
+ case SmartType_Boolean:
+ return "Boolean";
+ case SmartType_Integer:
+ return "Integer";
+ case SmartType_Character:
+ return "Character";
+ case SmartType_String:
+ return "String";
+ case SmartType_Double:
+ return "Double";
+ case SmartType_Map:
+ return "Object";
+ case SmartType_Array:
+ return "Array";
+ case SmartType_Binary:
+ return "Binary_Data";
+ case SmartType_UInteger:
+ return "Unsigned_Integer";
+ case SmartType_Invalid:
+ return "Invalid_Type";
+ default:
+ return "Unknown_Type";
+ }
+ }
+
protected:
static std::string OperatorToTransform(const SmartMap::value_type& pair);
/**
@@ -1014,9 +1049,9 @@ static SmartObject invalid_object_value(SmartType_Invalid);
* @brief Value that is used as invalid value for object type
**/
static const SmartBinary invalid_binary_value;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace smart_objects = ns_smart_device_link::ns_smart_objects;
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index 52dfa12004..5e1497fdde 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -35,8 +35,8 @@
#include "utils/macro.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -63,11 +63,15 @@ class CSmartSchema FINAL {
/**
* @brief Validate smart object.
*
- * @param Object SmartObject to validate.
- *
- * @return Result of validation.
- */
- Errors::eType validate(const SmartObject& Object) const;
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
+ **/
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& messageVersion =
+ utils::SemanticVersion()) const;
/**
* @brief Set new root schema item.
@@ -84,7 +88,10 @@ class CSmartSchema FINAL {
* @param RemoveFakeParameters contains true if need to remove fake parameters
* from smart object otherwise contains false.
**/
- void applySchema(SmartObject& Object, const bool RemoveFakeParameters);
+ void applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief The reverse SmartObject conversion using schema.
@@ -111,6 +118,6 @@ class CSmartSchema FINAL {
*/
ISchemaItemPtr mSchemaItem;
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
index 7fad8491a5..5b37db584d 100644
--- a/src/components/smart_objects/include/smart_objects/string_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -36,13 +36,11 @@
#include <stddef.h>
#include <string>
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief String schema item.
**/
@@ -54,19 +52,25 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CStringSchemaItem> create(
+ static std::shared_ptr<CStringSchemaItem> create(
const TSchemaItemParameter<size_t>& MinLength =
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<size_t>& MaxLength =
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<std::string>& DefaultValue =
TSchemaItemParameter<std::string>());
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @param report__ object for reporting errors during validation
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -86,6 +90,6 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
const TSchemaItemParameter<size_t> mMaxLength;
DISALLOW_COPY_AND_ASSIGN(CStringSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
index 59e50e10c2..ca247eed09 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -32,17 +32,22 @@
#include "smart_objects/always_false_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysFalseSchemaItem::CAlwaysFalseSchemaItem() {}
-utils::SharedPtr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
- return new CAlwaysFalseSchemaItem();
+std::shared_ptr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
+ return std::shared_ptr<CAlwaysFalseSchemaItem>(new CAlwaysFalseSchemaItem());
}
-Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) {
- return Errors::ERROR;
+errors::eType CAlwaysFalseSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ report__->set_validation_info("Generic error");
+ return errors::ERROR;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
index a474b0e157..983733165c 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -30,18 +30,21 @@
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysTrueSchemaItem::CAlwaysTrueSchemaItem() {}
-utils::SharedPtr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
- return new CAlwaysTrueSchemaItem();
+std::shared_ptr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
+ return std::shared_ptr<CAlwaysTrueSchemaItem>(new CAlwaysTrueSchemaItem());
}
-Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) {
- return Errors::OK;
+errors::eType CAlwaysTrueSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::OK;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 105cacb25c..7d5f8bcf84 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -31,45 +31,71 @@
#include "smart_objects/array_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CArraySchemaItem> CArraySchemaItem::create(
+std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
const ISchemaItemPtr ElementSchemaItem,
const TSchemaItemParameter<size_t>& MinSize,
const TSchemaItemParameter<size_t>& MaxSize) {
- return new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize);
+ return std::shared_ptr<CArraySchemaItem>(
+ new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize));
}
-Errors::eType CArraySchemaItem::validate(const SmartObject& Object) {
+errors::eType CArraySchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array != Object.getType()) {
- return Errors::INVALID_VALUE;
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Array) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
}
size_t sizeLimit;
const size_t array_len = Object.length();
if (mMinSize.getValue(sizeLimit) && (array_len < sizeLimit)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Got array of size: " << array_len
+ << ", minimum allowed: " << sizeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
if (mMaxSize.getValue(sizeLimit) && (array_len > sizeLimit)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Got array of size: " << array_len
+ << ", maximum allowed: " << sizeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
for (size_t i = 0u; i < array_len; ++i) {
- const Errors::eType result =
- mElementSchemaItem->validate(Object.getElement(i));
- if (Errors::OK != result) {
+ std::stringstream strVal;
+ strVal << i;
+ const errors::eType result =
+ mElementSchemaItem->validate(Object.getElement(i),
+ &report__->ReportSubobject(strVal.str()),
+ MessageVersion);
+ if (errors::OK != result) {
return result;
}
}
- return Errors::OK;
+ return errors::OK;
}
-void CArraySchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CArraySchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array == Object.getType()) {
for (size_t i = 0U; i < Object.length(); ++i) {
- mElementSchemaItem->applySchema(Object[i], RemoveFakeParameters);
+ mElementSchemaItem->applySchema(
+ Object[i], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -105,5 +131,5 @@ CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
, mMinSize(MinSize)
, mMaxSize(MaxSize) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/bool_schema_item.cc b/src/components/smart_objects/src/bool_schema_item.cc
index c1da95528a..a4875a1b24 100644
--- a/src/components/smart_objects/src/bool_schema_item.cc
+++ b/src/components/smart_objects/src/bool_schema_item.cc
@@ -32,12 +32,12 @@
#include "smart_objects/bool_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CBoolSchemaItem> CBoolSchemaItem::create(
+std::shared_ptr<CBoolSchemaItem> CBoolSchemaItem::create(
const TSchemaItemParameter<bool>& DefaultValue) {
- return new CBoolSchemaItem(DefaultValue);
+ return std::shared_ptr<CBoolSchemaItem>(new CBoolSchemaItem(DefaultValue));
}
CBoolSchemaItem::CBoolSchemaItem(const TSchemaItemParameter<bool>& DefaultValue)
@@ -51,5 +51,5 @@ bool CBoolSchemaItem::getDefaultValue() const {
return false;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc
index 78be9fe85d..c383f6ecca 100644
--- a/src/components/smart_objects/src/number_schema_item.cc
+++ b/src/components/smart_objects/src/number_schema_item.cc
@@ -31,8 +31,8 @@
*/
#include "smart_objects/number_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
@@ -41,7 +41,7 @@ SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
template <>
SmartType TNumberSchemaItem<uint32_t>::getSmartType() const {
- return SmartType_Integer;
+ return SmartType_UInteger;
}
template <>
@@ -54,5 +54,5 @@ SmartType TNumberSchemaItem<double>::getSmartType() const {
return SmartType_Double;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index f0c17faaea..742c2ec353 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -41,24 +41,83 @@ const char connection_key[] = "connection_key";
const char binary_data[] = "binary_data";
const char app_id[] = "appID";
}
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CObjectSchemaItem::SMember::SMember()
- : mSchemaItem(CAlwaysFalseSchemaItem::create()), mIsMandatory(true) {}
+ : mSchemaItem(CAlwaysFalseSchemaItem::create())
+ , mIsMandatory(true)
+ , mIsDeprecated(false)
+ , mIsRemoved(false) {}
-CObjectSchemaItem::SMember::SMember(const ISchemaItemPtr SchemaItem,
- const bool IsMandatory)
- : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {}
+CObjectSchemaItem::SMember::SMember(
+ const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory,
+ const std::string& Since,
+ const std::string& Until,
+ const bool IsDeprecated,
+ const bool IsRemoved,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector)
+ : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {
+ if (Since.size() > 0) {
+ utils::SemanticVersion since_struct(Since);
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+ }
+ if (Until.size() > 0) {
+ utils::SemanticVersion until_struct(Until);
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+ }
+ mIsDeprecated = IsDeprecated;
+ mIsRemoved = IsRemoved;
+ mHistoryVector = history_vector;
+}
-utils::SharedPtr<CObjectSchemaItem> CObjectSchemaItem::create(
+bool CObjectSchemaItem::SMember::CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const {
+ if (MessageVersion.isValid()) {
+ if (mSince != boost::none) {
+ if (MessageVersion < mSince.get()) {
+ return false; // Msg version predates `since` field
+ } else {
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version
+ // range
+ }
+ }
+ }
+
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version range
+ }
+ }
+
+ return true; // Not enough version information. Default true.
+}
+
+std::shared_ptr<CObjectSchemaItem> CObjectSchemaItem::create(
const Members& members) {
- return new CObjectSchemaItem(members);
+ return std::shared_ptr<CObjectSchemaItem>(new CObjectSchemaItem(members));
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
+errors::eType CObjectSchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != object.getType()) {
- return Errors::INVALID_VALUE;
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Map) +
+ ", got: " +
+ SmartObject::typeToString(object.getType());
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
}
std::set<std::string> object_keys = object.enumerate();
@@ -67,32 +126,42 @@ Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
++it) {
const std::string& key = it->first;
const SMember& member = it->second;
+ const SMember& correct_member = GetCorrectMember(member, MessageVersion);
std::set<std::string>::const_iterator key_it = object_keys.find(key);
if (object_keys.end() == key_it) {
- if (member.mIsMandatory) {
- return Errors::MISSING_MANDATORY_PARAMETER;
+ if (correct_member.mIsMandatory == true &&
+ correct_member.mIsRemoved == false) {
+ std::string validation_info = "Missing mandatory parameter: " + key;
+ report__->set_validation_info(validation_info);
+ return errors::MISSING_MANDATORY_PARAMETER;
}
continue;
}
const SmartObject& field = object.getElement(key);
- const Errors::eType result = member.mSchemaItem->validate(field);
- if (Errors::OK != result) {
+
+ errors::eType result = errors::OK;
+ // Check if MessageVersion matches schema version
+ result = correct_member.mSchemaItem->validate(
+ field, &report__->ReportSubobject(key), MessageVersion);
+ if (errors::OK != result) {
return result;
}
object_keys.erase(key_it);
}
- return Errors::OK;
+ return errors::OK;
}
-void CObjectSchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CObjectSchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != Object.getType()) {
return;
}
if (RemoveFakeParameters) {
- RemoveFakeParams(Object);
+ RemoveFakeParams(Object, MessageVersion);
}
SmartObject default_value;
@@ -103,10 +172,12 @@ void CObjectSchemaItem::applySchema(SmartObject& Object,
if (!Object.keyExists(key)) {
if (member.mSchemaItem->setDefaultValue(default_value)) {
Object[key] = default_value;
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
} else {
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -159,22 +230,49 @@ size_t CObjectSchemaItem::GetMemberSize() {
CObjectSchemaItem::CObjectSchemaItem(const Members& members)
: mMembers(members) {}
-void CObjectSchemaItem::RemoveFakeParams(SmartObject& Object) {
+void CObjectSchemaItem::RemoveFakeParams(
+ SmartObject& Object, const utils::SemanticVersion& MessageVersion) {
for (SmartMap::const_iterator it = Object.map_begin();
it != Object.map_end();) {
const std::string& key = it->first;
- if (mMembers.end() == mMembers.find(key)
+ std::map<std::string, SMember>::const_iterator members_it =
+ mMembers.find(key);
+ if (mMembers.end() == members_it
// FIXME(EZamakhov): Remove illegal usage of filed in AM
&&
key.compare(connection_key) != 0 && key.compare(binary_data) != 0 &&
key.compare(app_id) != 0) {
++it;
Object.erase(key);
+
+ } else if (mMembers.end() != members_it &&
+ GetCorrectMember(members_it->second, MessageVersion)
+ .mIsRemoved) {
+ ++it;
+ Object.erase(key);
} else {
- it++;
+ ++it;
+ }
+ }
+}
+
+const CObjectSchemaItem::SMember& CObjectSchemaItem::GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion) {
+ // Check if member is the correct version
+ if (member.CheckHistoryFieldVersion(messageVersion)) {
+ return member;
+ }
+ // Check for history tag items
+ if (!member.mHistoryVector.empty()) {
+ for (uint i = 0; i < member.mHistoryVector.size(); i++) {
+ if (member.mHistoryVector[i].CheckHistoryFieldVersion(messageVersion)) {
+ return member.mHistoryVector[i];
+ }
}
}
+ // Return member as default
+ return member;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 8c0bc0edb3..5e9358092a 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -32,11 +32,14 @@
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-Errors::eType ISchemaItem::validate(const SmartObject& object) {
- return Errors::ERROR;
+errors::eType ISchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::ERROR;
}
bool ISchemaItem::setDefaultValue(SmartObject& Object) {
@@ -48,7 +51,8 @@ bool ISchemaItem::hasDefaultValue(SmartObject& Object) {
}
void ISchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {}
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {}
void ISchemaItem::unapplySchema(SmartObject& Object) {}
@@ -59,5 +63,5 @@ size_t ISchemaItem::GetMemberSize() {
return 0;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index 5c90de5671..1322757ab1 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -42,8 +42,8 @@
#include <iterator>
#include <limits>
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Value that is used as invalid value for string type
@@ -491,7 +491,7 @@ std::string SmartObject::convert_string() const {
default:
break;
}
- return NsSmartDeviceLink::NsSmartObjects::invalid_cstr_value;
+ return ns_smart_device_link::ns_smart_objects::invalid_cstr_value;
}
custom_str::CustomString SmartObject::convert_custom_string() const {
@@ -869,11 +869,14 @@ bool SmartObject::erase(const std::string& Key) {
}
bool SmartObject::isValid() const {
- return (Errors::OK == m_schema.validate(*this));
+ rpc::ValidationReport report("RPC");
+ return (errors::OK == m_schema.validate(*this, &report));
}
-Errors::eType SmartObject::validate() {
- return m_schema.validate(*this);
+errors::eType SmartObject::validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return m_schema.validate(*this, report__, MessageVersion);
}
void SmartObject::setSchema(const CSmartSchema& schema) {
@@ -884,5 +887,5 @@ CSmartSchema SmartObject::getSchema() {
return m_schema;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index be24ceb076..f7cd22c4bc 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -32,16 +32,19 @@
#include "smart_objects/smart_schema.h"
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CSmartSchema::CSmartSchema() : mSchemaItem(CAlwaysTrueSchemaItem::create()) {}
CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
: mSchemaItem(SchemaItem) {}
-Errors::eType CSmartSchema::validate(const SmartObject& object) const {
- return mSchemaItem->validate(object);
+errors::eType CSmartSchema::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) const {
+ return mSchemaItem->validate(object, report__, MessageVersion);
}
void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
@@ -49,8 +52,9 @@ void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
}
void CSmartSchema::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
- mSchemaItem->applySchema(Object, RemoveFakeParameters);
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
+ mSchemaItem->applySchema(Object, RemoveFakeParameters, MessageVersion);
}
void CSmartSchema::unapplySchema(SmartObject& Object) {
@@ -62,5 +66,5 @@ void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object,
mSchemaItem->BuildObjectBySchema(pattern_object, result_object);
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index 3fac3a6cde..0288ad85e8 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -33,33 +33,52 @@
#include "smart_objects/string_schema_item.h"
#include "utils/custom_string.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
-utils::SharedPtr<CStringSchemaItem> CStringSchemaItem::create(
+std::shared_ptr<CStringSchemaItem> CStringSchemaItem::create(
const TSchemaItemParameter<size_t>& MinLength,
const TSchemaItemParameter<size_t>& MaxLength,
const TSchemaItemParameter<std::string>& DefaultValue) {
- return new CStringSchemaItem(MinLength, MaxLength, DefaultValue);
+ return std::shared_ptr<CStringSchemaItem>(
+ new CStringSchemaItem(MinLength, MaxLength, DefaultValue));
}
-Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
+errors::eType CStringSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String != Object.getType()) {
- return Errors::INVALID_VALUE;
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_String) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
}
const custom_str::CustomString value = Object.asCustomString();
size_t length;
if (mMinLength.getValue(length) && (value.size() < length)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Got string of size: " << value.size()
+ << ", minimum allowed: " << length;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
if (mMaxLength.getValue(length) && (value.size() > length)) {
- return Errors::OUT_OF_RANGE;
+ std::stringstream stream;
+ stream << "Got string of size: " << value.size()
+ << ", maximum allowed: " << length;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
SmartType CStringSchemaItem::getSmartType() const {
@@ -78,5 +97,5 @@ CStringSchemaItem::CStringSchemaItem(
, mMinLength(MinLength)
, mMaxLength(MaxLength) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index 85615d4911..1f514672fd 100644
--- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysFalseSchemaItem
@@ -52,39 +52,40 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
ISchemaItemPtr item = CAlwaysFalseSchemaItem::create();
obj = 5;
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::ERROR, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
- resultType = item->validate(obj["First"]);
- EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj["Second"]);
- EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj["First"], &report);
+ EXPECT_EQ(errors::ERROR, resultType);
+ resultType = item->validate(obj["Second"], &report);
+ EXPECT_EQ(errors::ERROR, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::ERROR, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::ERROR, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::ERROR, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
index 7a87108cb0..7f26a4968a 100644
--- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysTrueSchemaItem
@@ -52,39 +52,40 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
ISchemaItemPtr item = CAlwaysTrueSchemaItem::create();
obj = 5;
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
- resultType = item->validate(obj["First"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["Second"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["First"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj["Second"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
index fa42813f8d..28f435ee43 100644
--- a/src/components/smart_objects/test/ArraySchemaItem_test.cc
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -46,7 +46,7 @@ namespace smart_object_test {
* Test ArraySchemaItem no schema item, no min and max size
**/
TEST(test_no_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -66,29 +66,30 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
EXPECT_FALSE(obj[3][1].asBool());
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::OK, resultType);
item->applySchema(obj, false);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(38, obj[0].asInt());
EXPECT_TRUE(obj[1].asBool());
@@ -101,20 +102,20 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Obj - bool
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
@@ -124,7 +125,7 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
* only if all array elements are valid schema item objects
**/
TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(); // No min and max size
@@ -137,25 +138,26 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("true"), obj[1].asString());
EXPECT_EQ(std::string("New String"), obj[2].asString());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
item->applySchema(obj, false);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -169,22 +171,22 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("false"), obj[3][1].asString());
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[3][3] = "Another very very loooooong String";
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -193,18 +195,19 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -215,7 +218,7 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -226,23 +229,24 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -254,7 +258,7 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min and max size
**/
TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -265,28 +269,29 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
obj[4] = "Out of array";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -296,7 +301,7 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
}
TEST(test_map_validate, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -307,30 +312,31 @@ TEST(test_map_validate, test_ArraySchemaItemTest) {
obj["array"][0] = "Some String";
- int resultType = item->validate(obj["array"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["array"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj["array"][1] = "true";
- resultType = item->validate(obj["array"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["array"], &report);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][2] = "New String";
- resultType = item->validate(obj["array"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["array"], &report);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][3] = "Another String";
- resultType = item->validate(obj["array"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["array"], &report);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][4] = "Out of array";
- resultType = item->validate(obj["array"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj["array"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj["array"][0].asString());
EXPECT_EQ(std::string("true"), obj["array"][1].asString());
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index 8e39af8e08..ed0043925b 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -34,8 +34,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/bool_schema_item.h"
@@ -43,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test BoolSchemaItem no default value
@@ -53,25 +51,26 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(); // No
- // default
- // value
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(); // No
+ // default
+ // value
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -79,13 +78,13 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -99,25 +98,26 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
*value.
**/
TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
@@ -125,33 +125,34 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
EXPECT_FALSE(obj.asBool());
}
TEST(test_map_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj["aa"] = true;
ASSERT_TRUE(obj["aa"].asBool());
- int resultType = item->validate(obj["aa"]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["aa"], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -162,19 +163,19 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
obj["ind"] = true;
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_array_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create();
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create();
obj[0] = true;
obj[1] = false;
@@ -182,14 +183,15 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
ASSERT_TRUE(obj[0].asBool());
ASSERT_FALSE(obj[1].asBool());
- int resultType = item->validate(obj[0]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -200,14 +202,14 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(resDefault);
EXPECT_FALSE(obj[1].asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = false;
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
index 7dd63ae6eb..646e60bf61 100644
--- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -44,12 +44,13 @@
#include "smart_objects/object_schema_item.h"
#include "formatters/generic_json_formatter.h"
#include "formatters/CSmartFactory.h"
+#include "utils/semantic_version.h"
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace smartobj = ns_smart_device_link::ns_smart_objects;
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
namespace test {
namespace components {
@@ -136,6 +137,36 @@ class ObjectSchemaItemTest : public ::testing::Test {
schemaMembersMap[Keys::SUCCESS] =
CObjectSchemaItem::SMember(CBoolSchemaItem::create(), false);
+ // Create fake param that has breaking history changes
+ std::vector<CObjectSchemaItem::SMember> fake_param_history_vector;
+
+ std::shared_ptr<ISchemaItem> fake_param_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ std::shared_ptr<ISchemaItem> fake_param_history_v1_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ fake_param_history_vector.push_back(CObjectSchemaItem::SMember(
+ fake_param_history_v1_SchemaItem, true, "", "4.5.0", false, false));
+ schemaMembersMap["fakeParam"] =
+ CObjectSchemaItem::SMember(fake_param_SchemaItem,
+ false,
+ "4.5.0",
+ "",
+ false,
+ false,
+ fake_param_history_vector);
+
CObjectSchemaItem::Members rootMembersMap;
rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
CObjectSchemaItem::create(paramsMembersMap), true);
@@ -155,7 +186,39 @@ TEST_F(ObjectSchemaItemTest, validation_correct) {
obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_correct_with_new_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(4, 5, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report, messageVersion));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_invalid_data_with_old_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(3, 0, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report, messageVersion));
}
TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
@@ -167,7 +230,9 @@ TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
// skip non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
@@ -175,7 +240,9 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_PARAMS] = "some parameters";
obj[S_MSG_PARAMS] = "some message parameters";
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = "some function";
obj[S_PARAMS][S_CORRELATION_ID] = "some correlation id";
@@ -183,23 +250,35 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_MSG_PARAMS][Keys::RESULT_CODE] = "some result";
obj[S_MSG_PARAMS][Keys::SUCCESS] = 0xABC;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
SmartObject obj;
@@ -211,18 +290,26 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = 0x10;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = true;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = SmartObject();
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::INFO] = "info";
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
@@ -234,18 +321,29 @@ TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
obj[S_MSG_PARAMS][Keys::INFO] = "123";
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 2;
// S_CORRELATION_ID and S_PROTOCOL_VERSION is still missed
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = 0XFF2;
// S_PROTOCOL_VERSION is still missed
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
@@ -263,15 +361,21 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
obj[fake1] = SmartObject(static_cast<int64_t>(0));
// any fake parameter is OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][fake2] = SmartObject("123");
// any fake parameters are OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][fake3] = true;
// any fake parameters are OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
@@ -297,7 +401,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj.keyExists(fake1));
EXPECT_TRUE(obj[S_PARAMS].keyExists(fake2));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(fake3));
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// Check apply schema, remove fake parameter
schema_item->applySchema(obj, true);
@@ -310,7 +416,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::RESULT_CODE));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::INFO));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::SUCCESS));
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[fake1] = SmartObject(static_cast<int64_t>(0));
obj[S_PARAMS][fake2] = SmartObject("123");
@@ -324,7 +432,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_FALSE(obj[S_PARAMS].keyExists(fake2));
EXPECT_FALSE(obj[S_MSG_PARAMS].keyExists(fake3));
// Invalide state after enum convertion
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_empty_params) {
@@ -338,14 +448,20 @@ TEST_F(ObjectSchemaItemTest, validation_empty_params) {
obj[S_MSG_PARAMS]["FAKE_PARAM2"] = SmartObject(0x1);
obj[S_MSG_PARAMS]["FAKE_PARAM3"] = SmartObject("2");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(obj, false);
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->unapplySchema(obj);
// Invalide state after enum convertion
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
@@ -380,10 +496,14 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
object[S_MSG_PARAMS][Keys::RESULT_CODE] = result_type_str;
// S_FUNCTION_ID and RESULT_CODE are not converted to int
- EXPECT_NE(Errors::OK, schema_item->validate(object));
+ rpc::ValidationReport report("RPC");
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(object, false);
- EXPECT_EQ(Errors::OK, schema_item->validate(object));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(object, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// check conversion result
EXPECT_EQ(function_type, object[S_PARAMS][S_FUNCTION_ID].asInt());
@@ -391,7 +511,9 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
schema_item->unapplySchema(object);
// S_FUNCTION_ID and RESULT_CODE are string
- EXPECT_NE(Errors::OK, schema_item->validate(object));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// check conversion result
EXPECT_EQ(function_str, object[S_PARAMS][S_FUNCTION_ID].asString());
@@ -405,8 +527,8 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace FunctionID = test::components::smart_object_test::FunctionID;
typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor;
@@ -480,5 +602,5 @@ const ResultType::eType ResultTypeConvertor::enum_values_[] = {
ResultType::USER_DISALLOWED,
ResultType::GENERIC_ERROR,
ResultType::DISALLOWED};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
index e5ac013f86..edfa563336 100644
--- a/src/components/smart_objects/test/EnumSchemaItem_test.cc
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -42,7 +42,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
INVALID_ENUM = -1,
@@ -92,8 +92,9 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -101,8 +102,8 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -110,8 +111,8 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -119,8 +120,8 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - string
obj = "Some string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -142,8 +143,9 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(TestType::BLUETOOTH_OFF, obj.asInt());
@@ -151,8 +153,8 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -160,8 +162,8 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -169,8 +171,8 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - string
obj = "Some string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -178,13 +180,13 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - int in range of enum
obj = 6;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object - int out of enum range
obj = 15;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
@@ -199,32 +201,33 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
item->unapplySchema(obj);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("FACTORY_DEFAULTS"), obj.asString());
item->applySchema(obj, false);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
obj = "TOO_MANY_REQUESTS";
item->applySchema(obj, false);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::TOO_MANY_REQUESTS, obj.asInt());
obj = "ENOUGH_REQUESTS";
item->applySchema(obj, false);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString());
}
@@ -232,8 +235,8 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::SchemaItem::
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
index c9e183ca4a..eb227e4e9b 100644
--- a/src/components/smart_objects/test/NumberSchemaItem_test.cc
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test NumberSchemaItem as INT with no default value
@@ -50,7 +50,7 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -61,40 +61,41 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min value
**/
TEST(test_int_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -105,29 +106,30 @@ TEST(test_int_min_value, test_NumberSchemaItemTest) {
obj = 15;
ASSERT_EQ(15, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 9;
ASSERT_EQ(9, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 10;
ASSERT_EQ(10, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted max value
**/
TEST(test_int_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -139,29 +141,30 @@ TEST(test_int_max_value, test_NumberSchemaItemTest) {
obj = 749;
ASSERT_EQ(749, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -750;
ASSERT_EQ(-750, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min and max value
**/
TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -173,36 +176,37 @@ TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
obj = 749;
ASSERT_EQ(749, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -949;
ASSERT_EQ(-949, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -950;
ASSERT_EQ(-950, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as INT with correct default value
**/
TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -215,45 +219,46 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
obj = -12000;
ASSERT_EQ(-12000, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -12001;
ASSERT_EQ(-12001, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
// Object string
obj = "string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
}
@@ -261,7 +266,7 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as INT with default value out of range
**/
TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -274,50 +279,51 @@ TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
obj = 90;
ASSERT_EQ(90, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 89;
ASSERT_EQ(89, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
// Object string
obj = "string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
}
TEST(test_int_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -331,16 +337,17 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
obj["max"] = 100;
obj["out_of_max"] = 101;
- int resultType = item->validate(obj["min"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["max"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["out_of_min"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["out_of_max"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["min"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj["max"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj["out_of_min"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["out_of_max"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -351,18 +358,18 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj["min"]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj["min"], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_int_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -376,22 +383,23 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
obj[2] = 100;
obj[3] = 101;
- int resultType = item->validate(obj[0]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -402,15 +410,15 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -422,7 +430,7 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
* and leave SmartObject in previous state.
**/
TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -433,42 +441,43 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
obj = 5.79;
ASSERT_EQ(5.79, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min value
**/
TEST(test_double_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -479,29 +488,30 @@ TEST(test_double_min_value, test_NumberSchemaItemTest) {
obj = 10.000001;
ASSERT_EQ(10.000001, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 9.999999;
ASSERT_EQ(9.999999, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
/*
//Object int
obj = 10;
ASSERT_EQ(10, obj.asInt());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);*/
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);*/
}
/**
* Test NumberSchemaItem as DOUBLE with setted max value
**/
TEST(test_double_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -513,29 +523,30 @@ TEST(test_double_max_value, test_NumberSchemaItemTest) {
obj = 749.0;
ASSERT_EQ(749.0, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.0001;
ASSERT_EQ(749.0001, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -750.0;
ASSERT_EQ(-750.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min and max value
**/
TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -547,36 +558,37 @@ TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
obj = 749.0;
ASSERT_EQ(749.0, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.001;
ASSERT_EQ(749.001, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -949.0;
ASSERT_EQ(-949.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -949.00001;
ASSERT_EQ(-949.00001, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with correct default value
**/
TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -589,45 +601,46 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
obj = -12000.0;
ASSERT_EQ(-12000.0, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -12000.01;
ASSERT_EQ(-12000.01, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
// Object string
obj = "string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
}
@@ -635,7 +648,7 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as DOUBLE with default value out of range
**/
TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -648,50 +661,51 @@ TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
obj = 90.0;
ASSERT_EQ(90.0, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 89.999;
ASSERT_EQ(89.999, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
// Object string
obj = "string";
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
}
TEST(test_double_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -705,16 +719,17 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
obj["max"] = 100.0;
obj["out_of_max"] = 100.001;
- int resultType = item->validate(obj["min"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["max"]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["out_of_min"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["out_of_max"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["min"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj["max"], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj["out_of_min"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["out_of_max"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
EXPECT_TRUE(resDefault);
@@ -724,18 +739,18 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj["min"]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj["min"], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -749,22 +764,23 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
obj[2] = 100.0;
obj[3] = 100.000001;
- int resultType = item->validate(obj[0]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -775,20 +791,20 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38.0, obj.asDouble());
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
- resultType = item->validate(obj[0]);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_int_double_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<int>::create(
TSchemaItemParameter<int>(10),
@@ -799,12 +815,13 @@ TEST(test_int_double_value, test_NumberSchemaItemTest) {
obj = value;
ASSERT_EQ(value, obj.asDouble());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_int_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<double>::create(
TSchemaItemParameter<double>(10.0),
@@ -815,8 +832,9 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) {
obj = value;
ASSERT_EQ(value, obj.asInt());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
index b11560914e..7d95a40b26 100644
--- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -36,8 +36,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
#include "smart_objects/schema_item.h"
@@ -58,8 +56,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
@@ -98,7 +96,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -116,7 +114,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(
jsonString,
dstObj,
@@ -138,7 +136,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -155,7 +153,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(jsonString,
dstObj);
@@ -255,17 +253,18 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
messageType_allowedEnumSubsetValues);
CObjectSchemaItem::Members paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(functionId_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(functionId_SchemaItem, true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(messageType_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
@@ -331,35 +330,37 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
CObjectSchemaItem::SMember(tryAgainTime_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(
- TEnumSchemaItem<FunctionIdTest::eType>::create(
- functionId_allowedEnumSubsetValues),
- true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(
+ functionId_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(
TEnumSchemaItem<MessageTypeTest::eType>::create(
messageType_allowedEnumSubsetValues),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] =
CObjectSchemaItem::SMember(
TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
TSchemaItemParameter<int>(2)),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] =
- CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap),
- true);
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] =
+ CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
@@ -640,8 +641,8 @@ TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
index de8103771c..cfb6785db7 100644
--- a/src/components/smart_objects/test/SmartObjectDraft_test.cc
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -44,8 +44,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::SmartObject;
-using NsSmartDeviceLink::NsSmartObjects::SmartType;
+using ns_smart_device_link::ns_smart_objects::SmartObject;
+using ns_smart_device_link::ns_smart_objects::SmartType;
TEST(SmartObjectsDraftTest, primitive_types) {
SmartObject obj;
@@ -126,7 +126,7 @@ TEST(SmartObjectsDraftTest, test_public_interface) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
@@ -203,7 +203,7 @@ TEST(SmartObjectsDraftTest, test_helper_methods) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
index 68afbb6237..ff5949df6a 100644
--- a/src/components/smart_objects/test/SmartObjectInvalid_test.cc
+++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) {
SmartObject objMap(SmartType_Map);
@@ -116,7 +116,7 @@ TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) {
ASSERT_EQ(invalid_string_value, obj.asString());
// ---- BINARY ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc
index 698bd0415a..4c0234589f 100644
--- a/src/components/smart_objects/test/SmartObjectStress_test.cc
+++ b/src/components/smart_objects/test/SmartObjectStress_test.cc
@@ -40,7 +40,7 @@
namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class StressTestHelper : public ::testing::Test {
private:
@@ -184,8 +184,8 @@ class StressTestHelper : public ::testing::Test {
std::string strVal("c:");
strVal += strDataVal;
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryVal(dataSize,
- randomChar);
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryVal(
+ dataSize, randomChar);
obj = binaryVal; // string with binary data filled with random chars
mVerifyMap[key_path] = strVal;
@@ -259,10 +259,10 @@ TEST_F(StressTestHelper, StressTest) {
if (!value.compare(0, 2, "c:")) {
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
@@ -270,10 +270,10 @@ TEST_F(StressTestHelper, StressTest) {
{
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc
index 0a67b7e922..2c03d8a329 100644
--- a/src/components/smart_objects/test/SmartObjectUnit_test.cc
+++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc
@@ -37,7 +37,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class TestHelper : public ::testing::Test {
protected:
diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc
index d19d8518fe..7bf0d0ed89 100644
--- a/src/components/smart_objects/test/StringSchemaItem_test.cc
+++ b/src/components/smart_objects/test/StringSchemaItem_test.cc
@@ -49,7 +49,7 @@ namespace smart_object_test {
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -59,8 +59,9 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(std::string("New valid string"), obj.asString());
@@ -68,8 +69,8 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -77,13 +78,13 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(3.1415926, obj.asDouble());
}
@@ -97,7 +98,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
*default value.
**/
TEST(test_item_with_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -110,8 +111,9 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -119,8 +121,8 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -128,13 +130,13 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Default string"), obj.asString());
}
@@ -142,7 +144,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
* Test StringSchemaItem with max length
**/
TEST(test_item_with_max_length, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -154,8 +156,9 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -164,18 +167,18 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
obj = "New very very loooooong string";
ASSERT_EQ(std::string("New very very loooooong string"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_map_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -188,20 +191,21 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
obj["bool"] = true;
obj["num"] = 3.14;
- int resultType = item->validate(obj["str"]);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["str"], &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj["long"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["long"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["bool"]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj["bool"], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj["num"]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj["num"], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["str"]);
EXPECT_TRUE(resDefault);
@@ -215,28 +219,28 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj["num"].asString());
- resultType = item->validate(obj["str"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["str"], &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj["long"]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj["long"], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["bool"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["bool"], &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj["num"]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj["num"], &report);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_array_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -250,23 +254,24 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
obj[3] = 3.14;
obj[4] = "New valid string";
- int resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::OK, resultType);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[4]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[4], &report);
+ EXPECT_EQ(errors::OK, resultType);
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj[0]);
EXPECT_TRUE(resDefault);
@@ -284,25 +289,25 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj[4].asString());
EXPECT_EQ(std::string("Default string"), obj[5].asString());
- resultType = item->validate(obj[0]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[1]);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj[2]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[3]);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[4]);
- EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[5]);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj[0], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[1], &report);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
+ resultType = item->validate(obj[2], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[3], &report);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
+ resultType = item->validate(obj[4], &report);
+ EXPECT_EQ(errors::OK, resultType);
+ resultType = item->validate(obj[5], &report);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
- resultType = item->validate(obj);
- EXPECT_EQ(Errors::OK, resultType);
+ resultType = item->validate(obj, &report);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
index 503652dcda..11273e332f 100644
--- a/src/components/smart_objects/test/smart_object_performance_test.cc
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -37,7 +37,7 @@
#include "smart_objects/smart_object.h"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt
index 69b8371929..bb33857ecd 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -41,6 +41,7 @@ include_directories (
${COMPONENTS_DIR}/application_manager/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/
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
index 3c3de20e0e..eabaf0a5e4 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
@@ -44,7 +44,7 @@ class ApplicationManagerObserver;
class ApplicationManagerMetricWrapper : public MetricWrapper {
public:
- utils::SharedPtr<application_manager::AMTelemetryObserver::MessageMetric>
+ std::shared_ptr<application_manager::AMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
index ecb9c8002a..31a3ceea12 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
@@ -45,7 +45,7 @@ class ApplicationManagerObserver
: public application_manager::AMTelemetryObserver {
public:
explicit ApplicationManagerObserver(TelemetryMonitor* telemetry_monitor);
- virtual void OnMessage(utils::SharedPtr<MessageMetric> metric);
+ virtual void OnMessage(std::shared_ptr<MessageMetric> metric);
private:
TelemetryMonitor* telemetry_monitor_;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
index daf602e9ca..dfe7f4b964 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
#include <string>
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/metric_wrapper.h"
#include "protocol_handler_observer.h"
@@ -42,7 +42,7 @@ namespace telemetry_monitor {
class ProtocolHandlerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<protocol_handler::PHTelemetryObserver::MessageMetric>
+ std::shared_ptr<protocol_handler::PHTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
index 69e5658382..27a4fda868 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
@@ -45,13 +45,13 @@ class ProtocolHandlerObserver : public protocol_handler::PHTelemetryObserver {
explicit ProtocolHandlerObserver(TelemetryMonitor* telemetry_monitor);
virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time);
+ const date_time::TimeDuration& start_time);
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m);
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m);
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<uint32_t, TimevalStruct> time_starts;
+ std::map<uint32_t, date_time::TimeDuration> time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
index ba8cbceb23..ff7b9da9d6 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -35,7 +35,6 @@
#include <string>
-#include "utils/shared_ptr.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
@@ -58,7 +57,7 @@ class Streamer : public threads::ThreadDelegate {
void threadMain() OVERRIDE;
void exitThreadMain() OVERRIDE;
- virtual void PushMessage(utils::SharedPtr<MetricWrapper> metric);
+ virtual void PushMessage(std::shared_ptr<MetricWrapper> metric);
volatile bool is_client_connected_;
private:
@@ -71,7 +70,7 @@ class Streamer : public threads::ThreadDelegate {
int32_t server_socket_fd_;
int32_t client_socket_fd_;
volatile bool stop_flag_;
- MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
+ MessageQueue<std::shared_ptr<MetricWrapper> > messages_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
};
@@ -87,17 +86,16 @@ class TelemetryMonitor {
transport_manager);
virtual void Stop();
virtual void Start();
- virtual void SendMetric(utils::SharedPtr<MetricWrapper> metric);
- void set_streamer(Streamer* streamer);
+ virtual void SendMetric(std::shared_ptr<MetricWrapper> metric);
+ void set_streamer(std::shared_ptr<Streamer> streamer);
const std::string& ip() const;
int16_t port() const;
private:
std::string server_address_;
int16_t port_;
- bool is_ready_;
threads::Thread* thread_;
- Streamer* streamer_;
+ std::shared_ptr<Streamer> streamer_;
ApplicationManagerObserver app_observer;
TransportManagerObserver tm_observer;
ProtocolHandlerObserver ph_observer;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
index b601e89b18..d1239c9d1b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
@@ -41,7 +41,7 @@ namespace telemetry_monitor {
class TransportManagerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<transport_manager::TMTelemetryObserver::MessageMetric>
+ std::shared_ptr<transport_manager::TMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
index bff5834586..d0bf4ba5bb 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
@@ -49,7 +49,8 @@ class TransportManagerObserver : public transport_manager::TMTelemetryObserver {
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<const protocol_handler::RawMessage*, TimevalStruct> time_starts;
+ std::map<const protocol_handler::RawMessage*, date_time::TimeDuration>
+ time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
index b693d9df22..006aac196f 100644
--- a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
@@ -41,10 +41,9 @@ Json::Value ApplicationManagerMetricWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ApplicationManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& params =
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
+ const ns_smart_device_link::ns_smart_objects::SmartObject& params =
message_metric->message->getElement(application_manager::strings::params);
result[strings::correlation_id] = utils::ConvertInt64ToLongLongInt(
params[application_manager::strings::correlation_id].asInt());
diff --git a/src/components/telemetry_monitor/src/application_manager_observer.cc b/src/components/telemetry_monitor/src/application_manager_observer.cc
index cb390eddeb..1e621c8a6e 100644
--- a/src/components/telemetry_monitor/src/application_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/application_manager_observer.cc
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
@@ -41,8 +41,8 @@ ApplicationManagerObserver::ApplicationManagerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ApplicationManagerObserver::OnMessage(
- utils::SharedPtr<MessageMetric> metric) {
- ApplicationManagerMetricWrapper* m = new ApplicationManagerMetricWrapper();
+ std::shared_ptr<MessageMetric> metric) {
+ auto m = std::make_shared<ApplicationManagerMetricWrapper>();
m->message_metric = metric;
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/src/metric_wrapper.cc b/src/components/telemetry_monitor/src/metric_wrapper.cc
index 937a705ef7..10b694c5e6 100644
--- a/src/components/telemetry_monitor/src/metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/metric_wrapper.cc
@@ -45,7 +45,6 @@ bool MetricWrapper::grabResources() {
} else {
return false;
}
- flush(std::cout);
}
std::string MetricWrapper::GetStyledString() {
diff --git a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
index 335f0dbb29..1591e00af8 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
@@ -40,9 +40,8 @@ Json::Value ProtocolHandlerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ProtocolHandler";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::message_id] = message_metric->message_id;
result[strings::connection_key] = message_metric->connection_key;
return result;
diff --git a/src/components/telemetry_monitor/src/protocol_handler_observer.cc b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
index 2244cb2259..19b04da392 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_observer.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
@@ -44,7 +44,7 @@ ProtocolHandlerObserver::ProtocolHandlerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ProtocolHandlerObserver::StartMessageProcess(
- uint32_t message_id, const TimevalStruct& start_time) {
+ uint32_t message_id, const date_time::TimeDuration& start_time) {
if (message_id == 0) {
return;
}
@@ -58,17 +58,17 @@ void ProtocolHandlerObserver::StartMessageProcess(
}
void ProtocolHandlerObserver::EndMessageProcess(
- utils::SharedPtr<MessageMetric> m) {
+ std::shared_ptr<MessageMetric> m) {
uint32_t message_id = m->message_id;
- std::map<uint32_t, TimevalStruct>::const_iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::const_iterator it =
time_starts.find(message_id);
if (it == time_starts.end()) {
LOG4CXX_WARN(logger_, "Cant find start time for message" << message_id);
return;
}
m->begin = time_starts[message_id];
- m->end = date_time::DateTime::getCurrentTime();
- ProtocolHandlerMecticWrapper* metric = new ProtocolHandlerMecticWrapper();
+ m->end = date_time::getCurrentTime();
+ auto metric = std::make_shared<ProtocolHandlerMecticWrapper>();
metric->message_metric = m;
metric->grabResources();
telemetry_monitor_->SendMetric(metric);
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index 759b843961..d62724a479 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -42,6 +42,7 @@
#include "transport_manager/transport_manager_default.h"
#include "utils/resource_usage.h"
+
#include "telemetry_monitor/telemetry_observable.h"
namespace telemetry_monitor {
@@ -53,24 +54,20 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address,
: server_address_(server_address)
, port_(port)
, thread_(NULL)
- , streamer_(NULL)
, app_observer(this)
, tm_observer(this)
, ph_observer(this) {}
void TelemetryMonitor::Start() {
- streamer_ = new Streamer(this);
- thread_ = threads::CreateThread("TelemetryMonitor", streamer_);
+ streamer_ = streamer_ ? streamer_ : std::make_shared<Streamer>(this);
+ thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get());
}
-void TelemetryMonitor::set_streamer(Streamer* streamer) {
+void TelemetryMonitor::set_streamer(std::shared_ptr<Streamer> streamer) {
LOG4CXX_AUTO_TRACE(logger_);
if (thread_ && !thread_->is_running()) {
- thread_->set_delegate(streamer);
- if (streamer_) {
- delete streamer_;
- }
streamer_ = streamer;
+ thread_->set_delegate(streamer_.get());
} else {
LOG4CXX_ERROR(logger_, "Unable to replace streamer if it is active");
}
@@ -115,8 +112,8 @@ void TelemetryMonitor::Stop() {
thread_ = NULL;
}
-void TelemetryMonitor::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
- if ((NULL != streamer_) && streamer_->is_client_connected_) {
+void TelemetryMonitor::SendMetric(std::shared_ptr<MetricWrapper> metric) {
+ if (streamer_ && streamer_->is_client_connected_) {
streamer_->PushMessage(metric);
}
}
@@ -149,7 +146,7 @@ void Streamer::threadMain() {
is_client_connected_ = true;
while (is_client_connected_) {
while (!messages_.empty()) {
- utils::SharedPtr<MetricWrapper> metric;
+ std::shared_ptr<MetricWrapper> metric;
if (!messages_.pop(metric)) {
continue;
}
@@ -170,6 +167,7 @@ void Streamer::exitThreadMain() {
LOG4CXX_AUTO_TRACE(logger_);
Stop();
messages_.Shutdown();
+ ThreadDelegate::exitThreadMain();
}
void Streamer::Start() {
@@ -250,8 +248,9 @@ bool Streamer::IsReady() const {
fd_set fds;
FD_ZERO(&fds);
FD_SET(client_socket_fd_, &fds);
- TimevalStruct tv = {0, 0};
- tv.tv_sec = 5; // set a 5 second timeout
+ // need to construct a timeval for the duration, can't use duration
+ struct timeval tv;
+ tv.tv_sec = 5;
tv.tv_usec = 0;
const int retval = select(client_socket_fd_ + 1, 0, &fds, 0, &tv);
@@ -281,7 +280,7 @@ bool Streamer::Send(const std::string& msg) {
return true;
}
-void Streamer::PushMessage(utils::SharedPtr<MetricWrapper> metric) {
+void Streamer::PushMessage(std::shared_ptr<MetricWrapper> metric) {
messages_.push(metric);
}
} // namespace telemetry_monitor
diff --git a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
index a891aa1118..789da92eaf 100644
--- a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
@@ -41,9 +41,8 @@ Json::Value TransportManagerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "TransportManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::data_size] = static_cast<uint32_t>(message_metric->data_size);
return result;
}
diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc
index b3e57ac22a..25817d6c73 100644
--- a/src/components/telemetry_monitor/src/transport_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc
@@ -44,20 +44,20 @@ TransportManagerObserver::TransportManagerObserver(
void TransportManagerObserver::StartRawMsg(
const protocol_handler::RawMessage* ptr) {
- time_starts[ptr] = date_time::DateTime::getCurrentTime();
+ time_starts[ptr] = date_time::getCurrentTime();
}
void TransportManagerObserver::StopRawMsg(
const protocol_handler::RawMessage* ptr) {
- std::map<const protocol_handler::RawMessage*, TimevalStruct>::const_iterator
- it;
+ std::map<const protocol_handler::RawMessage*,
+ date_time::TimeDuration>::const_iterator it;
it = time_starts.find(ptr);
if (it != time_starts.end()) {
- TransportManagerMecticWrapper* m = new TransportManagerMecticWrapper();
- m->message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ auto m = std::make_shared<TransportManagerMecticWrapper>();
+ m->message_metric = std::make_shared<
+ transport_manager::TMTelemetryObserver::MessageMetric>();
m->message_metric->begin = it->second;
- m->message_metric->end = date_time::DateTime::getCurrentTime();
+ m->message_metric->end = date_time::getCurrentTime();
m->message_metric->data_size = ptr->data_size();
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/test/CMakeLists.txt b/src/components/telemetry_monitor/test/CMakeLists.txt
index d72b89f0e1..960985e45c 100644
--- a/src/components/telemetry_monitor/test/CMakeLists.txt
+++ b/src/components/telemetry_monitor/test/CMakeLists.txt
@@ -65,7 +65,7 @@ set(LIBRARIES
)
if (BUILD_USB_SUPPORT)
- list(APPEND LIBRARIES Libusb-1.0.16)
+ list(APPEND LIBRARIES libusb-1.0.so)
endif()
if (BUILD_BT_SUPPORT)
diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
index 9029c41bc4..2e6eaad9d8 100644
--- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
@@ -50,22 +50,20 @@ TEST(ApplicationManagerMetricWrapper, grabResources) {
TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
ApplicationManagerMetricWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
-
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
+
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("null\n",
@@ -75,9 +73,9 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n",
jvalue[telemetry_monitor::strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
@@ -90,37 +88,34 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) {
utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::connection_key].asInt(),
jvalue[telemetry_monitor::strings::connection_key].asInt());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_NEAR(
diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
index 5b7a551247..deecfa57b7 100644
--- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
@@ -35,7 +35,7 @@
#include "application_manager/telemetry_observer.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
namespace test {
@@ -49,7 +49,7 @@ TEST(ApplicationManagerObserver, CallOnMessage) {
MockTelemetryMonitor mock_telemetry_monitor;
ApplicationManagerObserver app_observer(&mock_telemetry_monitor);
typedef application_manager::AMTelemetryObserver::MessageMetric AMMetric;
- utils::SharedPtr<AMMetric> ptr =
+ std::shared_ptr<AMMetric> ptr =
application_manager::AMTelemetryObserver::MessageMetricSharedPtr();
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
app_observer.OnMessage(ptr);
diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
index fdda58bd08..c2aebe72b3 100644
--- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
+++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
@@ -37,7 +37,6 @@
#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/metric_wrapper.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
@@ -50,7 +49,7 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor {
MOCK_METHOD0(Stop, void());
MOCK_METHOD0(Start, void());
MOCK_METHOD1(SendMetric,
- void(utils::SharedPtr<telemetry_monitor::MetricWrapper> metric));
+ void(std::shared_ptr<telemetry_monitor::MetricWrapper> metric));
};
} // namespace transport_manager_test
} // namespace components
diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
index 8253cf2553..c9130411e7 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
@@ -51,15 +51,12 @@ TEST(ProtocolHandlerMetricTest, grabResources) {
TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
ProtocolHandlerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -71,10 +68,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
}
@@ -85,15 +80,12 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -107,10 +99,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_NE("null/n", jvalue[strings::utime].toStyledString());
EXPECT_NE("null/n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
diff --git a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
index 784e809da6..587bf21ce6 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
@@ -47,13 +47,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcess) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 1;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 1;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
pr_handler.EndMessageProcess(message_metric);
@@ -64,13 +63,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcessWithZeroMessageId) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 0;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 0;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)).Times(0);
pr_handler.EndMessageProcess(message_metric);
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index 5043524a06..b8d3f9063f 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -55,7 +55,7 @@ class StreamerMock : public Streamer {
StreamerMock(TelemetryMonitor* const server) : Streamer(server) {
is_client_connected_ = true;
}
- MOCK_METHOD1(PushMessage, void(utils::SharedPtr<MetricWrapper> metric));
+ MOCK_METHOD1(PushMessage, void(std::shared_ptr<MetricWrapper> metric));
};
TEST(TelemetryMonitorTest, MessageProcess) {
@@ -90,14 +90,15 @@ TEST(TelemetryMonitorTest, MessageProcess) {
EXPECT_CALL(am_observeble, SetTelemetryObserver(_));
EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_));
telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port);
- StreamerMock streamer_mock(&telemetry_monitor);
+ std::shared_ptr<StreamerMock> streamer_mock =
+ std::make_shared<StreamerMock>(&telemetry_monitor);
+ // streamer_mock will be freed by telemetry_monitor on destruction
telemetry_monitor.Start();
-
- telemetry_monitor.set_streamer(&streamer_mock);
+ telemetry_monitor.set_streamer(streamer_mock);
telemetry_monitor.Init(
&protocol_handler_mock, &am_observeble, &transport_manager_mock);
- utils::SharedPtr<telemetry_monitor::MetricWrapper> test_metric;
- EXPECT_CALL(streamer_mock, PushMessage(test_metric));
+ std::shared_ptr<telemetry_monitor::MetricWrapper> test_metric;
+ EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
telemetry_monitor.SendMetric(test_metric);
}
diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
index 6eb479387a..40caa6e0d6 100644
--- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
@@ -51,15 +51,11 @@ TEST(TransportManagerMetricWrapper, grabResources) {
TEST(TransportManagerMetricWrapper, GetJsonMetric) {
TransportManagerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->data_size = 1000;
@@ -69,10 +65,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
}
@@ -82,15 +76,11 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
@@ -98,10 +88,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("\"TransportManager\"\n", jvalue[strings::logger].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(), 1);
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 72c90acb5c..61606756fe 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -1,12 +1,16 @@
#include "gmock/gmock.h"
#include "utils/logger.h"
#include "utils/custom_string.h"
+#include <iostream>
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
int main(int argc, char** argv) {
namespace custom_str = utils::custom_string;
testing::InitGoogleMock(&argc, argv);
::testing::DefaultValue<custom_str::CustomString>::Set(
custom_str::CustomString(""));
const int result = RUN_ALL_TESTS();
+
DEINIT_LOGGER();
return result;
}
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 8c7980a96a..2f734b3a05 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -40,10 +40,15 @@ include_directories (
${COMPONENTS_DIR}/resumption/include
${POLICY_GLOBAL_INCLUDE_PATH}/
${JSONCPP_INCLUDE_DIRECTORY}
- ${LIBUSB_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/linux")
+endif ()
+
set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
@@ -73,9 +78,7 @@ if(BUILD_USB_SUPPORT)
${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")
set(EXCLUDE_PATHS
${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb/libusb
@@ -92,8 +95,30 @@ else()
)
endif()
+if(NOT BUILD_TESTS)
+ list (APPEND EXCLUDE_PATH
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/iap2_emulation/iap2_transport_adapter.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/iap2_emulation/iap2_transport_adapter.cc
+ )
+endif()
+
+# exclude platform-dependent files before running collect_sources
+list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/tcp/platform_specific
+ ${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific
+)
+
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+# then add platform-dependent files later
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/linux")
+endif ()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
add_library("TransportManager" ${SOURCES})
target_link_libraries("TransportManager" ${LIBRARIES})
diff --git a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
new file mode 100644
index 0000000000..e53a472bcb
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
+
+#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include "transport_manager/transport_manager_settings.h"
+#include "resumption/last_state.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace threads {
+class Thread;
+}
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief The IAP2BluetoothEmulationTransportAdapter class implements iAP2
+ * Bluetooth transport over TCP
+ */
+class IAP2BluetoothEmulationTransportAdapter : public TcpTransportAdapter {
+ public:
+ /**
+ * @brief IAP2BluetoothEmulationTransportAdapter constructor
+ * @param port TCP port to listen on
+ * @param last_state LastState instance reference
+ * @param settings Settings reference
+ */
+ IAP2BluetoothEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings);
+
+ /**
+ * @brief DeviceSwitched is called during switching from iAP2 Bluetooth to
+ * iAP2 USB transport.
+ * Currently there is no logic to switch back from iAP2 USB to iAP2 Bluetooth
+ * due to Bluetooth reconnection takes much time and this violates some Apple
+ * restrictions for iAP2 protocol, so if this method will be called - assert
+ * will be called
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ /**
+ * @brief Notification that transport's configuration is updated. This
+ * override is needed so that a OnTransportConfigUpdated is not sent to the
+ * mobile device for the emulated transport.
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ protected:
+ /**
+ * @brief GetDeviceType Provides SDL device type for transport adapter
+ * @return Device type
+ */
+ DeviceType GetDeviceType() const OVERRIDE;
+};
+
+/**
+ * @brief The IAP2USBEmulationTransportAdapter class implements emulation of
+ * iAP2 USB transport over TCP
+ */
+class IAP2USBEmulationTransportAdapter : public TcpTransportAdapter {
+ public:
+ /**
+ * @brief IAP2USBEmulationTransportAdapter constructor
+ * @param port TCP port to listen on
+ * @param last_state LastState instance reference
+ * @param settings Settings reference
+ */
+ IAP2USBEmulationTransportAdapter(const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings);
+
+ /**
+ * Destructor
+ */
+ ~IAP2USBEmulationTransportAdapter();
+
+ /**
+ * @brief DeviceSwitched is called during switching from iAP2 Bluetooth to
+ * iAP2 USB transport. Sends ACK signal for switching request.
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ /**
+ * @brief Notification that transport's configuration is updated. This
+ * override is needed so that a OnTransportConfigUpdated is not sent to the
+ * mobile device for the emulated transport.
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ protected:
+ /**
+ * @brief GetDeviceType Provides SDL device type for transport adapter
+ * @return Device type
+ */
+ DeviceType GetDeviceType() const OVERRIDE;
+
+ private:
+ /**
+ * @brief The IAPSignalHandlerDelegate class handles signals from the system
+ * to start transport switching flow
+ */
+ class IAPSignalHandlerDelegate : public threads::ThreadDelegate {
+ public:
+ /**
+ * @brief IAPSignalHandlerDelegate Constructor
+ * @param adapter Pointer to iAP2 USB adapter
+ */
+ IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter);
+
+ /**
+ * @brief threadMain Main loop to track incoming signals
+ */
+ void threadMain() OVERRIDE;
+
+ /**
+ * @brief exitThreadMain Stops main loop
+ */
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ /**
+ * @brief adapter_ Reference to owning adapter
+ */
+ IAP2USBEmulationTransportAdapter& adapter_;
+
+ /**
+ * @brief run_flag_ Flag defines whether main loop is active
+ */
+ bool run_flag_;
+
+ /**
+ * @brief in_ Input signals channel descriptor
+ */
+ int in_;
+ };
+
+ threads::Thread* signal_handler_;
+ int out_;
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
new file mode 100644
index 0000000000..8154503077
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
@@ -0,0 +1,41 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListener() {}
+
+ /**
+ * @brief Initialize this listener
+ */
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ virtual void Deinit() = 0;
+
+ /**
+ * @brief Start this listener
+ */
+ virtual bool Start() = 0;
+
+ /**
+ * @brief Stop this listener
+ */
+ virtual bool Stop() = 0;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
new file mode 100644
index 0000000000..159b5ff21d
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
@@ -0,0 +1,63 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+
+#include <string>
+#include <memory>
+
+#include "utils/macro.h"
+#include "transport_manager/tcp/network_interface_listener.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListenerImpl : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ NetworkInterfaceListenerImpl(TcpClientListener* tcp_client_listener,
+ const std::string designated_interface);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListenerImpl();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+ std::unique_ptr<NetworkInterfaceListener> platform_specific_impl_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..bb60b09a9d
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,201 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Struct to keep network interface's status flags and IP addresses
+ */
+class InterfaceStatus {
+ public:
+ InterfaceStatus()
+ : flags_(0)
+ , has_ipv4_(false)
+ , has_ipv6_(false)
+ , ipv4_address_()
+ , ipv6_address_() {}
+ ~InterfaceStatus() {}
+
+ bool IsAvailable() const;
+ bool IsLoopback() const;
+ // only for debugging output
+ unsigned int GetFlags() const {
+ return flags_;
+ }
+
+ bool HasIPAddress() const;
+ std::string GetIPv4Address() const;
+ std::string GetIPv6Address() const;
+
+ void SetFlags(unsigned int flags) {
+ flags_ = flags;
+ }
+
+ // specify NULL to remove existing address
+ void SetIPv4Address(struct in_addr* addr);
+ void SetIPv6Address(struct in6_addr* addr);
+
+ private:
+ unsigned int flags_;
+ bool has_ipv4_;
+ bool has_ipv6_;
+ struct in_addr ipv4_address_;
+ struct in6_addr ipv6_address_;
+};
+
+typedef std::map<std::string, InterfaceStatus> InterfaceStatusTable;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+#ifdef BUILD_TESTS
+ void SetTesting(bool enabled) {
+ testing_ = enabled;
+ }
+
+ int GetSocket() const {
+ return socket_;
+ }
+
+ threads::Thread* GetThread() const {
+ return thread_;
+ }
+
+ void OverwriteStatusTable(const InterfaceStatusTable dummy_table) {
+ status_table_ = dummy_table;
+ }
+
+ void testCallNotifyIPAddresses() {
+ NotifyIPAddresses();
+ }
+
+ const std::string& GetSelectedInterfaceName() const {
+ return selected_interface_;
+ }
+#endif // BUILD_TESTS
+
+ private:
+ // Struct to hold an event on a network interface.
+ // The event can be either an update on flags or an update on IP address.
+ struct EventParam {
+ unsigned int if_index;
+ unsigned int flags;
+ struct sockaddr_storage address;
+
+ EventParam(int interface_index, unsigned int interface_flags = 0)
+ : if_index(interface_index), flags(interface_flags), address() {}
+ };
+
+ // parent class which we will notify the events to
+ TcpClientListener* tcp_client_listener_;
+ // if configured, NetworkInterfaceListener will always look into the IP
+ // addresses of this interface
+ const std::string designated_interface_;
+
+ // a map to store status of each interface
+ InterfaceStatusTable status_table_;
+ // this is the name of the interface we are currently focusing on
+ std::string selected_interface_;
+ // previous IP addresses that we have notified
+ std::string notified_ipv4_addr_;
+ std::string notified_ipv6_addr_;
+
+ int socket_;
+ int pipe_fds_[2];
+ threads::Thread* thread_;
+
+#ifdef BUILD_TESTS
+ bool testing_;
+#endif
+
+ void Loop();
+ bool StopLoop();
+
+ // reset status_table_ by fetching current status of each interface
+ bool InitializeStatus();
+ // update status_table_ by applying the events
+ bool UpdateStatus(uint16_t type, std::vector<EventParam>& params);
+ // update notified_ipv4_addr_ and notified_ipv6_addr_ then notify the parent
+ // class of the change if necessary
+ void NotifyIPAddresses();
+ // Select an appropriate network interface that we will get IP addresses. Also
+ // update selected_interface_.
+ const std::string SelectInterface();
+ // convert ifaddrmsg to a list of EventParam structs
+ std::vector<EventParam> ParseIFAddrMessage(struct ifaddrmsg* message,
+ unsigned int size);
+ // for debugging
+ void DumpTable() const;
+
+ class ListenerThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit ListenerThreadDelegate(
+ PlatformSpecificNetworkInterfaceListener* parent);
+ virtual void threadMain();
+ void exitThreadMain();
+
+ private:
+ PlatformSpecificNetworkInterfaceListener* parent_;
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(PlatformSpecificNetworkInterfaceListener);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..2cb5eb47a7
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,70 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+class Thread;
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
index 2640049ecc..0f9529d8d8 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
@@ -36,15 +36,18 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+#include "utils/lock.h"
#include "utils/threads/thread_delegate.h"
#include "transport_manager/transport_adapter/client_connection_listener.h"
class Thread;
+struct in_addr;
namespace transport_manager {
namespace transport_adapter {
class TransportAdapterController;
+class NetworkInterfaceListener;
/**
* @brief Listener of device adapter that use TCP transport.
@@ -57,11 +60,15 @@ class TcpClientListener : public ClientConnectionListener {
* @param controller Pointer to the device adapter controller.
* @param port Port No.
* @param enable_keepalive If true enables TCP keepalive on accepted
+ * @param designated_interface Specify the name of the network interface to
+ *listen on. If empty, then this process will listen on all network
+ *interfaces.
*connections
*/
TcpClientListener(TransportAdapterController* controller,
uint16_t port,
- bool enable_keepalive);
+ bool enable_keepalive,
+ const std::string designated_interface = "");
/**
* @brief Destructor.
@@ -101,7 +108,18 @@ class TcpClientListener : public ClientConnectionListener {
*/
virtual TransportAdapter::Error StopListening();
+ /**
+ * @brief Called from NetworkInterfaceListener when IP address of the network
+ * interface is changed.
+ */
+ virtual void OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr);
+
#ifdef BUILD_TESTS
+ void set_network_interface_listener(NetworkInterfaceListener* listener) {
+ interface_listener_ = listener;
+ }
+
uint16_t port() const {
return port_;
}
@@ -113,19 +131,47 @@ class TcpClientListener : public ClientConnectionListener {
threads::Thread* thread() const {
return thread_;
}
+
+ static void set_testing(bool enabled) {
+ testing_ = enabled;
+ }
#endif // BUILD_TESTS
private:
const uint16_t port_;
const bool enable_keepalive_;
TransportAdapterController* controller_;
+ bool initialized_;
+ bool started_;
threads::Thread* thread_;
int socket_;
bool thread_stop_requested_;
+ int pipe_fds_[2];
+ NetworkInterfaceListener* interface_listener_;
+ const std::string designated_interface_;
+ std::string current_ip_address_;
+ sync_primitives::Lock start_stop_lock_;
+
+#ifdef BUILD_TESTS
+ static bool testing_;
+#endif // BUILD_TESTS
void Loop();
void StopLoop();
+ TransportAdapter::Error StartListeningThread();
+ TransportAdapter::Error StopListeningThread();
+
+ bool StartOnNetworkInterface();
+ bool StopOnNetworkInterface();
+ bool IsListeningOnSpecificInterface() const;
+
+ static int CreateIPv4ServerSocket(uint16_t port,
+ const std::string interface_name = "");
+ static void DestroyServerSocket(int sock);
+ static bool GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address);
+
class ListeningThreadDelegate : public threads::ThreadDelegate {
public:
explicit ListeningThreadDelegate(TcpClientListener* parent);
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
index 981ba9f6ee..7aa0b72687 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
@@ -66,6 +66,18 @@ class TcpDevice : public Device {
**/
TcpDevice(const in_addr_t& in_addr, const std::string& name);
+#if defined(BUILD_TESTS)
+ /**
+ * @brief TcpDevice
+ * @param in_addr IP address of device
+ * @param device_uid Unique device id
+ * @param transport_switch_id Id used for transport switching
+ */
+ TcpDevice(const in_addr_t& in_addr,
+ const std::string& device_uid,
+ const std::string& transport_switch_id);
+#endif
+
virtual ~TcpDevice();
/**
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
index 5431b4455d..37f5a7fe49 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
@@ -58,6 +58,18 @@ class TcpTransportAdapter : public TransportAdapterImpl {
*/
virtual ~TcpTransportAdapter();
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE;
+
protected:
/**
* @brief Return type of device.
@@ -77,6 +89,19 @@ class TcpTransportAdapter : public TransportAdapterImpl {
* @return True on success false otherwise
*/
virtual bool Restore();
+
+ private:
+ /**
+ * @brief Keeps transport specific configuration
+ *
+ * TCP transport uses following information:
+ * - "enabled": whether the transport is currently enabled or not. Value can
+ * be "true" or "false".
+ * - "tcp_ip_address": string representation of IP address (either IPv4 or
+ * IPv6)
+ * - "tcp_port": string representation of TCP port number (e.g. "12345")
+ */
+ TransportConfig transport_config_;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/telemetry_observer.h b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
index 5e42289a03..a38255966b 100644
--- a/src/components/transport_manager/include/transport_manager/telemetry_observer.h
+++ b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
@@ -42,8 +42,8 @@ namespace transport_manager {
class TMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
size_t data_size;
};
virtual void StartRawMsg(const protocol_handler::RawMessage* ptr) = 0;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
index 537e94b055..2374d8a126 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
@@ -35,7 +35,6 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
-#include "utils/shared_ptr.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
namespace transport_manager {
@@ -67,7 +66,7 @@ class Connection {
virtual TransportAdapter::Error Disconnect() = 0;
};
-typedef utils::SharedPtr<Connection> ConnectionSPtr;
+typedef std::shared_ptr<Connection> ConnectionSPtr;
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
index 3792b94d7c..f1c679c123 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
@@ -40,7 +40,7 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/threads/thread_delegate.h"
#include "utils/lock.h"
@@ -201,7 +201,7 @@ class ThreadedSocketConnection : public Connection {
FrameQueue frames_to_send_;
mutable sync_primitives::Lock frames_to_send_mutex_;
- sync_primitives::atomic_int socket_;
+ std::atomic_int socket_;
bool terminate_flag_;
bool unexpected_disconnect_;
const DeviceUID device_uid_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
index 0b38f82637..69d76b4b2b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
@@ -204,6 +204,13 @@ class TransportAdapterController {
const ApplicationHandle& app_handle,
::protocol_handler::RawMessagePtr message,
const DataSendError&) = 0;
+
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ virtual void TransportConfigUpdated(const TransportConfig& new_config) = 0;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index d4c97d5233..078f93b32f 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -400,6 +400,41 @@ class TransportAdapterImpl : public TransportAdapter,
const DataSendError& error) OVERRIDE;
/**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
+ * @brief DoTransportSwitch notifies listeners of transport adapter events
+ * that transport switching is requested by system
+ */
+ void DoTransportSwitch() const OVERRIDE;
+
+ /**
+ * @brief DeviceSwitched Notifies system on successful transport switch for
+ * particular device
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ /**
+ * @brief GetSwitchableDevices Provides list of devices able to switch their
+ * transport (e.g. iAP2 Bluetooth to iAP2 USB).
+ * @return
+ */
+ SwitchableDevices GetSwitchableDevices() const OVERRIDE;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE {
+ // default is empty
+ return TransportConfig();
+ }
+
+ /**
* @brief Return name of device.
*
* @param device_id Device unique identifier.
@@ -409,6 +444,13 @@ class TransportAdapterImpl : public TransportAdapter,
std::string DeviceName(const DeviceUID& device_id) const OVERRIDE;
/**
+ * @brief StopDevice looks for specific device in devices list and calls
+ * Stop() interface of that device
+ * @param device_id unique device identifier that has to be stopped.
+ */
+ void StopDevice(const DeviceUID& device_id) const OVERRIDE;
+
+ /**
* @brief Allows to obtain connection type used by device.
* @return connection type.
*/
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
index 0a1eeb6b4a..4606bac2d4 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -146,6 +146,7 @@ class TransportAdapterListener {
const DeviceUID& device_handle,
const ApplicationHandle& app_handle,
const CommunicationError& error) = 0;
+
/**
* @brief Search specified device adapter in the container of shared pointers
*to device adapters to be sure it is available,
@@ -269,6 +270,22 @@ class TransportAdapterListener {
virtual void OnCommunicationError(const TransportAdapter* transport_adapter,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle) = 0;
+ /**
+ * @brief OnTransportSwitchRequested notifies on received signal to start
+ * transport switching flow (at the moment Bluetooth to USB only)
+ * @param transport_adapter Transport adapter who received the signal
+ */
+ virtual void OnTransportSwitchRequested(
+ const TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ virtual void OnTransportConfigUpdated(
+ const TransportAdapter* transport_adapter) = 0;
};
} // transport_adapter namespace
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
index a7cd544563..a744400279 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -49,26 +49,6 @@ class TransportAdapterListenerImpl
: public transport_adapter::TransportAdapterListener {
public:
/**
- * @enum Available types of events.
- */
- enum EventTypeEnum {
- ON_SEARCH_DONE = 0,
- ON_SEARCH_FAIL,
- ON_DEVICE_LIST_UPDATED,
- ON_FIND_NEW_APPLICATIONS_REQUEST,
- ON_CONNECT_DONE,
- ON_CONNECT_FAIL,
- ON_DISCONNECT_DONE,
- ON_DISCONNECT_FAIL,
- ON_SEND_DONE,
- ON_SEND_FAIL,
- ON_RECEIVED_DONE,
- ON_RECEIVED_FAIL,
- ON_COMMUNICATION_ERROR,
- ON_UNEXPECTED_DISCONNECT
- };
-
- /**
* @brief Constructor.
*
* @param manager Pointer to the transport manager class.
@@ -283,7 +263,23 @@ class TransportAdapterListenerImpl
*/
virtual void OnCommunicationError(const TransportAdapter* adapter,
const DeviceUID& device,
- const ApplicationHandle& app_id);
+ const ApplicationHandle& app_id) OVERRIDE;
+
+ /**
+ * @brief OnTransportSwitchRequested notifies on received signal to start
+ * transport switching flow (at the moment Bluetooth to USB only)
+ * @param transport_adapter Transport adapter who received the signal
+ */
+ void OnTransportSwitchRequested(const TransportAdapter* adapter) OVERRIDE;
+
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ void OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) OVERRIDE;
private:
TransportManager* transport_manager_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index 4dd74086be..c1df49f91b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -39,6 +39,8 @@
#include <vector>
#include <utility>
#include <algorithm>
+#include <tuple>
+#include <functional>
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
@@ -62,7 +64,8 @@ typedef threads::MessageLoopThread<std::queue<protocol_handler::RawMessagePtr> >
RawMessageLoopThread;
typedef threads::MessageLoopThread<std::queue<TransportAdapterEvent> >
TransportAdapterEventLoopThread;
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
+typedef std::map<DeviceUID, TransportAdapter*> DeviceToAdapterMap;
/**
* @brief Implementation of transport manager.s
@@ -94,6 +97,7 @@ class TransportManagerImpl
bool shutdown_;
DeviceHandle device_handle_;
int messages_count;
+ bool active_;
ConnectionInternal(TransportManagerImpl* transport_manager,
TransportAdapter* transport_adapter,
@@ -241,10 +245,11 @@ class TransportManagerImpl
int Visibility(const bool& on_off) const OVERRIDE;
/**
- * @brief Updates total device list with info from specific transport adapter.
- * @param ta Transport adapter
+ * @brief OnDeviceListUpdated updates device list and sends appropriate
+ * notifications to listeners in case of something is changed
+ * @param ta Transport adapter to check for updated devices state
*/
- void UpdateDeviceList(TransportAdapter* ta);
+ void OnDeviceListUpdated(TransportAdapter* ta);
#ifdef TELEMETRY_MONITOR
/**
@@ -307,44 +312,53 @@ class TransportManagerImpl
private:
/**
- * @brief Structure that contains conversion functions (Device ID -> Device
- * Handle; Device Handle -> Device ID)
- */
+ * @brief Structure that contains conversion functions (Device ID -> Device
+ * Handle; Device Handle -> Device ID)
+ */
struct Handle2GUIDConverter {
- typedef std::vector<DeviceUID> ConversionTable;
-
- DeviceHandle UidToHandle(const DeviceUID& dev_uid) {
- bool is_new = true;
- return UidToHandle(dev_uid, is_new);
- }
-
- DeviceHandle UidToHandle(const DeviceUID& dev_uid, bool& is_new) {
- {
- sync_primitives::AutoReadLock lock(conversion_table_lock);
- ConversionTable::iterator it = std::find(
- conversion_table_.begin(), conversion_table_.end(), dev_uid);
- if (it != conversion_table_.end()) {
- is_new = false;
- return std::distance(conversion_table_.begin(), it) +
- 1; // handle begin since 1 (one)
- }
- }
- is_new = true;
- sync_primitives::AutoWriteLock lock(conversion_table_lock);
- conversion_table_.push_back(dev_uid);
- return conversion_table_.size(); // handle begin since 1 (one)
- }
-
- DeviceUID HandleToUid(const DeviceHandle handle) {
- sync_primitives::AutoReadLock lock(conversion_table_lock);
- if (handle == 0 || handle > conversion_table_.size()) {
- return DeviceUID();
+ /**
+ * @brief ConversionTable Records uid/connection type/handle
+ */
+ typedef std::vector<std::tuple<DeviceUID, std::string, DeviceHandle> >
+ ConversionTable;
+
+ /**
+ * @brief The HandleFinder struct helper to search for hanlde in coversion
+ * table
+ */
+ struct HandleFinder {
+ explicit HandleFinder(const DeviceHandle& look_for)
+ : look_for_(look_for) {}
+
+ bool operator()(const ConversionTable::value_type value) const {
+ return look_for_ == std::get<2>(value);
}
- return conversion_table_[handle - 1]; // handle begin since 1 (one)
- }
+ const DeviceHandle look_for_;
+ };
+
+ /**
+ * @brief UidToHandle Converts UID to handle considering connection type as
+ * UID may be the same in case device is connected over Bluetooth/USB (e.g.
+ * for IAP2)
+ * @param dev_uid Device UID
+ * @param connection_type Connection type
+ * @return Device handle
+ */
+ DeviceHandle UidToHandle(const DeviceUID& dev_uid,
+ const std::string& connection_type);
+
+ /**
+ * @brief HandleToUid Converts handle to device UID
+ * @param handle Device handle
+ * @return Device UID
+ */
+ DeviceUID HandleToUid(const DeviceHandle handle);
+
+ private:
ConversionTable conversion_table_;
- sync_primitives::RWLock conversion_table_lock;
+ std::hash<std::string> hash_function_;
+ sync_primitives::RWLock conversion_table_lock_;
};
/**
@@ -353,6 +367,15 @@ class TransportManagerImpl
*/
Handle2GUIDConverter converter_;
+#ifdef BUILD_TESTS
+ public:
+ Handle2GUIDConverter& get_converter() {
+ return converter_;
+ }
+
+ private:
+#endif // BUILD_TESTS
+
explicit TransportManagerImpl(const TransportManagerImpl&);
int connection_id_counter_;
sync_primitives::RWLock connections_lock_;
@@ -372,13 +395,70 @@ class TransportManagerImpl
sync_primitives::RWLock device_list_lock_;
DeviceInfoList device_list_;
+ timer::Timer device_switch_timer_;
+ sync_primitives::Lock device_lock_;
+ DeviceUID device_to_reconnect_;
+
+ /**
+ * @brief Adds new incoming connection to connections list
+ * @param c New connection
+ */
void AddConnection(const ConnectionInternal& c);
+
+ /**
+ * @brief Removes connection from connections list
+ * @param id Identifier of connection to be removed
+ * @param transport_adapter Pointer to transport adapter
+ * that holds connection
+ */
void RemoveConnection(const uint32_t id,
transport_adapter::TransportAdapter* transport_adapter);
+
+ /**
+ * @brief Deactivates all connections related to certain device
+ * @param device_uid Device unique identifier
+ */
+ void DeactivateDeviceConnections(const DeviceUID& device_uid);
+ /**
+ * @brief Returns connection from connections list by connection identifier
+ * @param id Connection identifier
+ * @return Pointer to connection or NULL if connection could not be found
+ */
ConnectionInternal* GetConnection(const ConnectionUID id);
+
+ /**
+ * @brief Returns connection from connections list by device unique id
+ * and application handle
+ * @param device Device unique identifier
+ * @param application Application handle
+ * @return Pointer to connection or NULL if connection could not be found
+ */
ConnectionInternal* GetConnection(const DeviceUID& device,
const ApplicationHandle& application);
+ /**
+ * @brief Returns active connection from connections list by device unique
+ * id
+ * and application handle
+ * (this method returns only active connections as opposed to previous one)
+ * @param device Device unique identifier
+ * @param application Application handle
+ * @return Pointer to connection or NULL if connection could not be found
+ */
+ ConnectionInternal* GetActiveConnection(const DeviceUID& device,
+ const ApplicationHandle& application);
+
+ /**
+ * @brief TryDeviceSwitch in case USB device is connected and there is
+ * appropriate Bluetooth device with same UUID stops Bluetooth device and
+ * initiates switching sequence for upper layers. Also starts timer to wait
+ * for sequence to complete.
+ * @param ta Transport adapter having device to try switching sequence
+ * At the moment implementation implies only IAP2-Bluetooth to IAP2-USB
+ * switching
+ */
+ void TryDeviceSwitch(TransportAdapter* ta);
+
void AddDataToContainer(
ConnectionUID id,
std::map<ConnectionUID, std::pair<unsigned int, unsigned char*> >&
@@ -394,11 +474,31 @@ class TransportManagerImpl
unsigned int frame_size,
unsigned char** frame);
- void OnDeviceListUpdated(TransportAdapter* ta);
void DisconnectAllDevices();
void TerminateAllAdapters();
int InitAllAdapters();
static Connection convert(const ConnectionInternal& p);
+
+ /**
+ * @brief ReconnectionTimeout notifies upper layers on switching sequence
+ * timeout expiration
+ */
+ void ReconnectionTimeout();
+
+ /**
+ * @brief UpdateDeviceMapping handles internal device-to-adapter mapping,
+ * performs its update on adding/removal of devices. Also used by IAP2
+ * switching flow to substitute BT with USB transport
+ * @param ta Pointer to transport adapter
+ * @return True if mapping has been updated, otherwise - false
+ */
+ bool UpdateDeviceMapping(TransportAdapter* ta);
+
+ /**
+ * @brief Updates total device list with info from specific transport adapter.
+ * @param ta Transport adapter
+ */
+ void UpdateDeviceList(TransportAdapter* ta);
}; // class TransportManagerImpl
} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h
index 1c6011dbb2..1db1a83a3a 100644
--- a/src/components/transport_manager/include/transport_manager/usb/common.h
+++ b/src/components/transport_manager/include/transport_manager/usb/common.h
@@ -35,8 +35,6 @@
#include <stdint.h>
-#include "utils/shared_ptr.h"
-
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_handler.h"
#else
@@ -64,7 +62,7 @@ static const uint16_t kApplePid8 = 0x12a8; // iPhone 5
static const int kUsbConfiguration = 1;
-typedef utils::SharedPtr<UsbHandler> UsbHandlerSptr;
+typedef std::shared_ptr<UsbHandler> UsbHandlerSptr;
class UsbDeviceListener {
public:
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
index 1aa6881b38..baec1938b1 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
@@ -37,7 +37,7 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
#include <string>
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
index bad1cd7117..5f6bd40957 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
@@ -80,6 +80,7 @@ class UsbConnection : public Connection {
uint8_t out_endpoint_;
uint16_t out_endpoint_max_packet_size_;
unsigned char* in_buffer_;
+ uint16_t in_buffer_size_;
libusb_transfer* in_transfer_;
libusb_transfer* out_transfer_;
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
index b2ebd3a977..bed631ea2e 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
@@ -36,7 +36,7 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/usb/usb_control_transfer.h"
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
index 8ca1a32a28..ea31bb0376 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
@@ -54,9 +54,9 @@ class UsbDevice : public Device {
return usb_device_;
}
- protected:
virtual ~UsbDevice() {}
+ protected:
virtual bool IsSameAs(const Device* other_device) const {
return unique_device_id() == other_device->unique_device_id();
}
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index 0d8a77c88f..62615cb30f 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -37,7 +37,6 @@
#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -55,8 +54,8 @@ TransportAdapter::Error BluetoothConnectionFactory::Init() {
TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<BluetoothSocketConnection> connection =
- utils::MakeShared<BluetoothSocketConnection>(
+ std::shared_ptr<BluetoothSocketConnection> connection =
+ std::make_shared<BluetoothSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
index 038515170d..e7cc3d4f34 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
@@ -45,6 +45,7 @@
#include <sys/socket.h>
#include <algorithm>
+#include <iostream>
#include <limits>
#include "utils/logger.h"
@@ -56,7 +57,8 @@ bool BluetoothDevice::GetRfcommChannel(const ApplicationHandle app_handle,
uint8_t* channel_out) {
LOG4CXX_TRACE(logger_,
"enter. app_handle: " << app_handle
- << ", channel_out: " << channel_out);
+ << ", channel_out: " << std::hex
+ << reinterpret_cast<void*>(channel_out));
if (app_handle < 0 || app_handle > std::numeric_limits<uint8_t>::max()) {
LOG4CXX_TRACE(logger_,
"exit with FALSE. Condition: app_handle < 0 || app_handle > "
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
index 85e6dc3f96..75ea799ce8 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -255,13 +255,15 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
if (hci_read_remote_name_ret != 0) {
LOG4CXX_ERROR_WITH_ERRNO(logger_, "hci_read_remote_name failed");
+ int name_len = sizeof(deviceName) / sizeof(deviceName[0]);
strncpy(deviceName,
BluetoothDevice::GetUniqueDeviceId(bd_address).c_str(),
- sizeof(deviceName) / sizeof(deviceName[0]));
+ name_len - 1);
+ deviceName[name_len - 1] = '\0';
}
- Device* bluetooth_device =
- new BluetoothDevice(bd_address, deviceName, sdl_rfcomm_channels[i]);
+ auto bluetooth_device = std::make_shared<BluetoothDevice>(
+ bd_address, deviceName, sdl_rfcomm_channels[i]);
if (bluetooth_device) {
LOG4CXX_INFO(logger_, "Bluetooth device created successfully");
discovered_devices->push_back(bluetooth_device);
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
index 16960aa1d4..b4370e4b12 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -106,14 +106,12 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) {
if (0 == connect_status) {
LOG4CXX_DEBUG(logger_, "rfcomm Connect ok");
break;
- }
- if (errno != 111 && errno != 104) {
- LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
- break;
- }
- if (errno) {
- LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
- close(rfcomm_socket);
+ } else { // If connect_status is not 0, an errno is returned
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "rfcomm Connect failed");
+ close(rfcomm_socket); // Always close the socket upon error
+ if (errno != ECONNREFUSED && errno != ECONNRESET) {
+ break;
+ }
}
sleep(2);
} while (--attempts > 0);
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
index 0f83f32c60..b373744f79 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -80,8 +80,8 @@ void BluetoothTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<BluetoothDevice> bluetooth_device =
- DeviceSptr::static_pointer_cast<BluetoothDevice>(device);
+ std::shared_ptr<BluetoothDevice> bluetooth_device =
+ std::static_pointer_cast<BluetoothDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = bluetooth_device->name();
char address[18];
diff --git a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
new file mode 100644
index 0000000000..31e997f3ba
--- /dev/null
+++ b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "utils/threads/thread.h"
+#include "utils/file_system.h"
+
+namespace {
+static const mode_t mode = 0666;
+static const auto in_signals_channel = "iap_signals_in";
+static const auto out_signals_channel = "iap_signals_out";
+} // namespace
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "IAP2Emulation");
+
+IAP2BluetoothEmulationTransportAdapter::IAP2BluetoothEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings)
+ : TcpTransportAdapter(port, last_state, settings) {}
+
+void IAP2BluetoothEmulationTransportAdapter::DeviceSwitched(
+ const DeviceUID& device_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_handle);
+ DCHECK(!"Switching for iAP2 Bluetooth is not supported.");
+}
+
+DeviceType IAP2BluetoothEmulationTransportAdapter::GetDeviceType() const {
+ return IOS_BT;
+}
+
+void IAP2BluetoothEmulationTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ return;
+}
+
+IAP2USBEmulationTransportAdapter::IAP2USBEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings)
+ : TcpTransportAdapter(port, last_state, settings), out_(0) {
+ auto delegate = new IAPSignalHandlerDelegate(*this);
+ signal_handler_ = threads::CreateThread("iAP signal handler", delegate);
+ signal_handler_->start();
+ const auto result = mkfifo(out_signals_channel, mode);
+ UNUSED(result);
+ LOG4CXX_DEBUG(logger_, "Out signals channel creation result: " << result);
+}
+
+IAP2USBEmulationTransportAdapter::~IAP2USBEmulationTransportAdapter() {
+ signal_handler_->join();
+ auto delegate = signal_handler_->delegate();
+ signal_handler_->set_delegate(NULL);
+ delete delegate;
+ threads::DeleteThread(signal_handler_);
+ LOG4CXX_DEBUG(logger_, "Out close result: " << close(out_));
+ LOG4CXX_DEBUG(logger_, "Out unlink result: " << unlink(out_signals_channel));
+}
+
+void IAP2USBEmulationTransportAdapter::DeviceSwitched(
+ const DeviceUID& device_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_handle);
+ const auto switch_signal_ack = std::string("SDL_TRANSPORT_SWITCH_ACK\n");
+
+ auto out_ = open(out_signals_channel, O_WRONLY);
+ LOG4CXX_DEBUG(logger_, "Out channel descriptor: " << out_);
+
+ if (out_ < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to open out signals channel");
+ return;
+ }
+
+ const auto bytes =
+ write(out_, switch_signal_ack.c_str(), switch_signal_ack.size());
+ UNUSED(bytes);
+ LOG4CXX_DEBUG(logger_, "Written bytes to out: " << bytes);
+
+ LOG4CXX_DEBUG(logger_, "Switching signal ACK is sent");
+ LOG4CXX_DEBUG(logger_, "iAP2 USB device is switched with iAP2 Bluetooth");
+ close(out_);
+}
+
+DeviceType IAP2USBEmulationTransportAdapter::GetDeviceType() const {
+ return IOS_USB;
+}
+
+void IAP2USBEmulationTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ return;
+}
+
+IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
+ IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter)
+ : adapter_(adapter), run_flag_(true), in_(0) {
+ const auto result = mkfifo(in_signals_channel, mode);
+ UNUSED(result);
+ LOG4CXX_DEBUG(logger_, "In signals channel creation result: " << result);
+}
+
+void IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Signal handling is started");
+ const auto switch_signal = "SDL_TRANSPORT_SWITCH";
+ LOG4CXX_DEBUG(logger_, "Waiting for signal: " << switch_signal);
+
+ in_ = open(in_signals_channel, O_RDONLY);
+ LOG4CXX_DEBUG(logger_, "In channel descriptor: " << in_);
+ if (in_ < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to open in signals channel");
+ return;
+ }
+
+ const auto size = 32;
+ while (run_flag_) {
+ char buffer[size];
+ auto bytes = read(in_, &buffer, size - 1);
+ if (0 == bytes) {
+ continue;
+ }
+ if (-1 == bytes) {
+ LOG4CXX_DEBUG(logger_, "Error during input pipe read");
+ break;
+ }
+ LOG4CXX_DEBUG(logger_, "Read in bytes: " << bytes);
+ buffer[bytes] = '\0';
+ std::string str(buffer);
+ if (std::string::npos != str.find(switch_signal)) {
+ LOG4CXX_DEBUG(logger_, "Switch signal received.");
+ adapter_.DoTransportSwitch();
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "In close result: " << close(in_));
+ LOG4CXX_DEBUG(logger_, "In unlink result: " << unlink(in_signals_channel));
+}
+
+void IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
+ exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Stopping signal handling.");
+ run_flag_ = false;
+ ThreadDelegate::exitThreadMain();
+}
+}
+} // namespace transport_manager::transport_adapter
diff --git a/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
new file mode 100644
index 0000000000..85c479134d
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
@@ -0,0 +1,42 @@
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+NetworkInterfaceListenerImpl::NetworkInterfaceListenerImpl(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : platform_specific_impl_(new PlatformSpecificNetworkInterfaceListener(
+ tcp_client_listener, designated_interface)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+NetworkInterfaceListenerImpl::~NetworkInterfaceListenerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool NetworkInterfaceListenerImpl::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Init();
+}
+
+void NetworkInterfaceListenerImpl::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ platform_specific_impl_->Deinit();
+}
+
+bool NetworkInterfaceListenerImpl::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Start();
+}
+
+bool NetworkInterfaceListenerImpl::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Stop();
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
new file mode 100644
index 0000000000..047d43b7bf
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
@@ -0,0 +1,673 @@
+#include "transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h"
+
+#include <arpa/inet.h>
+#include <asm/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ifaddrs.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include "transport_manager/tcp/tcp_client_listener.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+static std::string GetInterfaceName(unsigned int if_index);
+static bool SetNonblocking(int s);
+
+bool InterfaceStatus::IsAvailable() const {
+ // check if the interface is UP and RUNNING
+ return ((flags_ & IFF_UP) > 0) && ((flags_ & IFF_RUNNING) > 0);
+}
+
+bool InterfaceStatus::IsLoopback() const {
+ return flags_ & IFF_LOOPBACK;
+}
+
+bool InterfaceStatus::HasIPAddress() const {
+ return has_ipv4_ || has_ipv6_;
+}
+
+std::string InterfaceStatus::GetIPv4Address() const {
+ char buf[INET_ADDRSTRLEN] = "";
+ if (has_ipv4_ && IsAvailable()) {
+ inet_ntop(AF_INET, &ipv4_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+std::string InterfaceStatus::GetIPv6Address() const {
+ char buf[INET6_ADDRSTRLEN] = "";
+ if (has_ipv6_ && IsAvailable()) {
+ inet_ntop(AF_INET6, &ipv6_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+void InterfaceStatus::SetIPv4Address(struct in_addr* addr) {
+ if (addr == NULL) {
+ has_ipv4_ = false;
+ } else {
+ ipv4_address_ = *addr;
+ has_ipv4_ = true;
+ }
+}
+
+void InterfaceStatus::SetIPv6Address(struct in6_addr* addr) {
+ if (addr == NULL) {
+ has_ipv6_ = false;
+ } else {
+ ipv6_address_ = *addr;
+ has_ipv6_ = true;
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : tcp_client_listener_(tcp_client_listener)
+ , designated_interface_(designated_interface)
+ , selected_interface_("")
+ , notified_ipv4_addr_("")
+ , notified_ipv6_addr_("")
+ , socket_(-1)
+#ifdef BUILD_TESTS
+ , testing_(false)
+#endif // BUILD_TESTS
+{
+ pipe_fds_[0] = pipe_fds_[1] = -1;
+ thread_ = threads::CreateThread("PlatformSpecificNetworkInterfaceListener",
+ new ListenerThreadDelegate(this));
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Stop();
+ Deinit();
+
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ LOG4CXX_WARN(logger_, "Network interface listener is already initialized");
+ return false;
+ }
+
+ socket_ = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (socket_ == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create netlink socket");
+ return false;
+ }
+
+ if (!SetNonblocking(socket_)) {
+ LOG4CXX_WARN(logger_, "Failed to configure netlink socket to non-blocking");
+ }
+
+ struct sockaddr_nl addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.nl_family = AF_NETLINK;
+ addr.nl_pad = 0;
+ addr.nl_pid = 0;
+ addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR;
+
+ if (bind(socket_, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to bind netlink socket");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
+ if (pipe_fds_[1] >= 0) {
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ }
+ if (pipe_fds_[0] >= 0) {
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ < 0) {
+ LOG4CXX_WARN(logger_, "Interface listener is not initialized");
+ return false;
+ }
+
+ if (thread_->is_running()) {
+ LOG4CXX_WARN(logger_, "Interface listener is already started");
+ return false;
+ }
+
+ if (!thread_->start()) {
+ LOG4CXX_ERROR(logger_, "Failed to start interface listener");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Network interface listener started");
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!thread_->is_running()) {
+ LOG4CXX_DEBUG(logger_, "interface listener is not running");
+ return false;
+ }
+
+ thread_->join();
+
+ LOG4CXX_INFO(logger_, "Network interface listener stopped");
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Loop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Initialize status_table_ by acquiring a list of interfaces and their
+ // current statuses. Also we will notify an event to the listener if IP
+ // address is already available.
+ InitializeStatus();
+ NotifyIPAddresses();
+
+ // I am not sure required buffer size for netlink data structures. Most of
+ // implementation I found online uses 4096 so I followed them.
+ char buf[4096];
+ fd_set rfds;
+
+ while (1) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ // wait for some data from netlink socket (socket_) and our internal pipe
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "select failed for netlink. Aborting interface listener.");
+ break;
+ }
+ }
+
+ // Received data from internal pipe, indicating StopLoop() is called.
+ // We'll break the while() loop and eventually exit this thread.
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], buf, sizeof(buf));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe. Aborting interface listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected. Aborting interface listener.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_, "received terminating event through pipe");
+ break;
+ }
+ }
+
+#ifdef BUILD_TESTS
+ if (testing_) { // don't enable events from network interface while testing
+ continue;
+ }
+#endif // BUILD_TESTS
+
+ // received data from netlink socket
+ if (FD_ISSET(socket_, &rfds)) {
+ ret = recv(socket_, buf, sizeof(buf), 0);
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(logger_,
+ "Failed to read from netlink socket. Aborting interface "
+ "listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(
+ logger_,
+ "Netlink socket disconnected. Aborting interface listener.");
+ break;
+ } else {
+ struct nlmsghdr* header = reinterpret_cast<struct nlmsghdr*>(buf);
+ int len = ret;
+
+ // Parse the stream. We may receive multiple (header + data) pairs at a
+ // time so we use for-loop to go through.
+ for (; NLMSG_OK(header, len); header = NLMSG_NEXT(header, len)) {
+ if (header->nlmsg_type == NLMSG_ERROR) {
+ LOG4CXX_WARN(logger_, "received error event from netlink");
+ break;
+ }
+
+ std::vector<EventParam> params;
+
+ if (header->nlmsg_type == RTM_NEWLINK ||
+ header->nlmsg_type == RTM_DELLINK) {
+ // For these events, data part contains an ifinfomsg struct and a
+ // series of rtattr structures. See rtnetlink(7).
+ // We are only interested in interface index and flags.
+ struct ifinfomsg* ifinfo_msg =
+ reinterpret_cast<struct ifinfomsg*>(NLMSG_DATA(header));
+ EventParam param(ifinfo_msg->ifi_index, ifinfo_msg->ifi_flags);
+ params.push_back(param);
+
+ } else if (header->nlmsg_type == RTM_NEWADDR ||
+ header->nlmsg_type == RTM_DELADDR) {
+ // For these events, data part contains an ifaddrmsg struct and
+ // optionally some rtattr structures. We'll extract IP address(es)
+ // from them.
+ struct ifaddrmsg* ifaddr_msg =
+ reinterpret_cast<struct ifaddrmsg*>(NLMSG_DATA(header));
+ unsigned int size = IFA_PAYLOAD(header);
+ params = ParseIFAddrMessage(ifaddr_msg, size);
+
+ } else {
+ continue;
+ }
+
+ // update status_table_ based on received data
+ UpdateStatus(header->nlmsg_type, params);
+ }
+ }
+
+ // notify the listener if necessary
+ NotifyIPAddresses();
+ }
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::StopLoop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_, "Stopping network interface listener");
+
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return false;
+ }
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to interface listener");
+ return false;
+ }
+
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::InitializeStatus() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs()
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list, *interface;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_,
+ "getifaddr failed, interface status won't be available until "
+ "a change occurs");
+ return false;
+ }
+
+ // clear existing table
+ status_table_.clear();
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL || interface->ifa_name[0] == '\0') {
+ continue;
+ }
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+
+ std::string ifname(interface->ifa_name);
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ status.SetIPv4Address(&addr->sin_addr);
+ break;
+ }
+ case AF_INET6: {
+ struct sockaddr_in6* addr =
+ reinterpret_cast<struct sockaddr_in6*>(interface->ifa_addr);
+ status.SetIPv6Address(&addr->sin6_addr);
+ break;
+ }
+ default:
+ continue;
+ }
+ status.SetFlags(interface->ifa_flags);
+ }
+
+ freeifaddrs(if_list);
+
+ LOG4CXX_DEBUG(logger_, "Successfully acquired network interface status");
+ DumpTable();
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::UpdateStatus(
+ uint16_t type, std::vector<EventParam>& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ for (std::vector<EventParam>::iterator it = params.begin();
+ it != params.end();
+ ++it) {
+ std::string ifname = GetInterfaceName(it->if_index);
+ if (ifname.empty()) {
+ continue;
+ }
+
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (type) {
+ case RTM_NEWLINK: {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname
+ << " created or updated");
+ status.SetFlags(it->flags);
+ break;
+ }
+ case RTM_DELLINK:
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname << " removed");
+ status_table_.erase(ifname);
+ break;
+ case RTM_NEWADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ sockaddr_in* addr_in = reinterpret_cast<sockaddr_in*>(addr);
+ status.SetIPv4Address(&addr_in->sin_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv4Address());
+ } else if (addr->sa_family == AF_INET6) {
+ sockaddr_in6* addr_in6 = reinterpret_cast<sockaddr_in6*>(addr);
+ status.SetIPv6Address(&addr_in6->sin6_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv6Address());
+ }
+ break;
+ }
+ case RTM_DELADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " removed");
+ status.SetIPv4Address(NULL);
+ } else if (addr->sa_family == AF_INET6) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " removed");
+ status.SetIPv6Address(NULL);
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported netlink event (" << type << ")");
+ break;
+ }
+ }
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::NotifyIPAddresses() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string ipv4_addr;
+ std::string ipv6_addr;
+ const std::string interface_name = SelectInterface();
+
+ // note that if interface_name is empty (i.e. no interface is selected),
+ // the IP addresses will be empty
+ if (!interface_name.empty()) {
+ InterfaceStatusTable::iterator it = status_table_.find(interface_name);
+ if (status_table_.end() != it) {
+ InterfaceStatus& status = it->second;
+ ipv4_addr = status.GetIPv4Address();
+ ipv6_addr = status.GetIPv6Address();
+ }
+ }
+
+ if (notified_ipv4_addr_ != ipv4_addr || notified_ipv6_addr_ != ipv6_addr) {
+ LOG4CXX_INFO(logger_,
+ "IP address updated: \"" << notified_ipv4_addr_ << "\" -> \""
+ << ipv4_addr << "\", \""
+ << notified_ipv6_addr_ << "\" -> \""
+ << ipv6_addr << "\"");
+
+ notified_ipv4_addr_ = ipv4_addr;
+ notified_ipv6_addr_ = ipv6_addr;
+
+ tcp_client_listener_->OnIPAddressUpdated(notified_ipv4_addr_,
+ notified_ipv6_addr_);
+ }
+}
+
+const std::string PlatformSpecificNetworkInterfaceListener::SelectInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!designated_interface_.empty()) {
+ return designated_interface_;
+ }
+
+ InterfaceStatusTable::iterator it;
+
+ if (!selected_interface_.empty()) {
+ // if current network interface is still available and has IP address, then
+ // we use it
+ it = status_table_.find(selected_interface_);
+ if (it != status_table_.end()) {
+ InterfaceStatus& status = it->second;
+ if (status.IsAvailable() && status.HasIPAddress()) {
+ return selected_interface_;
+ }
+ }
+ }
+
+ // pick a network interface that has IP address
+ for (it = status_table_.begin(); it != status_table_.end(); ++it) {
+ InterfaceStatus& status = it->second;
+ // ignore loopback interfaces
+ if (status.IsLoopback()) {
+ continue;
+ }
+ // if the interface has to be UP and RUNNING, and must have an IP address
+ if (!(status.IsAvailable() && status.HasIPAddress())) {
+ continue;
+ }
+
+ selected_interface_ = it->first;
+ LOG4CXX_DEBUG(logger_,
+ "selecting network interface: " << selected_interface_);
+ return selected_interface_;
+ }
+
+ selected_interface_ = "";
+ return selected_interface_;
+}
+
+std::vector<PlatformSpecificNetworkInterfaceListener::EventParam>
+PlatformSpecificNetworkInterfaceListener::ParseIFAddrMessage(
+ struct ifaddrmsg* message, unsigned int size) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<EventParam> params;
+
+ // Iterate through rtattr structs. (The first one can be acquired through
+ // IFA_RTA() macro)
+ for (struct rtattr* attr = IFA_RTA(message); RTA_OK(attr, size);
+ attr = RTA_NEXT(attr, size)) {
+ if (!(attr->rta_type == IFA_LOCAL || attr->rta_type == IFA_ADDRESS)) {
+ continue;
+ }
+
+ EventParam param(message->ifa_index);
+
+ if (message->ifa_family == AF_INET) {
+ // make sure the size of data is >= 4 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv4 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv4 address. Copy it to param.address
+ struct in_addr* ipv4_addr =
+ reinterpret_cast<struct in_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in* sockaddr =
+ reinterpret_cast<struct sockaddr_in*>(&param.address);
+ sockaddr->sin_family = AF_INET;
+ sockaddr->sin_addr = *ipv4_addr;
+
+ } else if (message->ifa_family == AF_INET6) {
+ // make sure the size of data is >= 16 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in6_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv6 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv6 address. Copy it to param.address
+ struct in6_addr* ipv6_addr =
+ reinterpret_cast<struct in6_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in6* sockaddr =
+ reinterpret_cast<struct sockaddr_in6*>(&param.address);
+ sockaddr->sin6_family = AF_INET6;
+ sockaddr->sin6_addr = *ipv6_addr;
+
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Unsupported family (" << message->ifa_family << ")");
+ continue;
+ }
+
+ params.push_back(param);
+ }
+
+ return params;
+}
+
+void PlatformSpecificNetworkInterfaceListener::DumpTable() const {
+ LOG4CXX_DEBUG(logger_,
+ "Number of network interfaces: " << status_table_.size());
+
+ for (auto it = status_table_.begin(); it != status_table_.end(); ++it) {
+ const std::string ifname = it->first;
+ const InterfaceStatus& status = it->second;
+ UNUSED(status);
+
+ LOG4CXX_DEBUG(
+ logger_,
+ " " << ifname << " : flags=" << status.GetFlags()
+ << " : available: " << (status.IsAvailable() ? "yes" : "no")
+ << " IPv4: " << status.GetIPv4Address()
+ << " IPv6: " << status.GetIPv6Address()
+ << (status.IsLoopback() ? " (loopback)" : ""));
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ ListenerThreadDelegate(PlatformSpecificNetworkInterfaceListener* parent)
+ : parent_(parent) {}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ threadMain() {
+ parent_->Loop();
+}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ exitThreadMain() {
+ parent_->StopLoop();
+}
+
+static std::string GetInterfaceName(unsigned int if_index) {
+ char buf[IFNAMSIZ + 1] = "";
+ if_indextoname(if_index, buf);
+ return std::string(buf);
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
new file mode 100644
index 0000000000..15b3814999
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
@@ -0,0 +1,38 @@
+#include "transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface) {}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
index 48f5dbd613..9f2597f0a7 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -36,11 +36,14 @@
#include <memory.h>
#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
+#include <ifaddrs.h>
#ifdef __linux__
#include <linux/tcp.h>
#else // __linux__
@@ -53,9 +56,10 @@
#include <sstream>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
@@ -64,69 +68,88 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+static bool SetNonblocking(int s);
+
+#ifdef BUILD_TESTS
+bool TcpClientListener::testing_ = false;
+#endif // BUILD_TESTS
+
TcpClientListener::TcpClientListener(TransportAdapterController* controller,
const uint16_t port,
- const bool enable_keepalive)
+ const bool enable_keepalive,
+ const std::string designated_interface)
: port_(port)
, enable_keepalive_(enable_keepalive)
, controller_(controller)
+ , initialized_(false)
+ , started_(false)
, thread_(0)
, socket_(-1)
- , thread_stop_requested_(false) {
+ , thread_stop_requested_(false)
+ , designated_interface_(designated_interface) {
+ pipe_fds_[0] = pipe_fds_[1] = -1;
thread_ = threads::CreateThread("TcpClientListener",
new ListeningThreadDelegate(this));
+ interface_listener_ =
+ new NetworkInterfaceListenerImpl(this, designated_interface);
}
TransportAdapter::Error TcpClientListener::Init() {
LOG4CXX_AUTO_TRACE(logger_);
thread_stop_requested_ = false;
- socket_ = socket(AF_INET, SOCK_STREAM, 0);
- if (-1 == socket_) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
- return TransportAdapter::FAIL;
+ if (!IsListeningOnSpecificInterface()) {
+ // Network interface is not specified. We will listen on all interfaces
+ // using INADDR_ANY. If socket creation fails, we will treat it an error.
+ socket_ = CreateIPv4ServerSocket(port_);
+ if (-1 == socket_) {
+ LOG4CXX_ERROR(logger_, "Failed to create TCP socket");
+ return TransportAdapter::FAIL;
+ }
+ } else {
+ // Network interface is specified and we wiill listen only on the interface.
+ // In this case, the server socket will be created once
+ // NetworkInterfaceListener notifies the interface's IP address.
+ LOG4CXX_INFO(logger_,
+ "TCP server socket will listen on "
+ << designated_interface_
+ << " once it has an IPv4 address.");
}
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
-
- int optval = 1;
- setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
-
- if (bind(socket_,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address)) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ if (!interface_listener_->Init()) {
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
return TransportAdapter::FAIL;
}
- const int kBacklog = 128;
- if (0 != listen(socket_, kBacklog)) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
- return TransportAdapter::FAIL;
- }
+ initialized_ = true;
return TransportAdapter::OK;
}
void TcpClientListener::Terminate() {
LOG4CXX_AUTO_TRACE(logger_);
- if (socket_ == -1) {
- LOG4CXX_WARN(logger_, "Socket has been closed");
+
+ if (!initialized_) {
return;
}
- if (shutdown(socket_, SHUT_RDWR) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
- }
- if (close(socket_) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+
+ if (!IsListeningOnSpecificInterface()) {
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ } else {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
}
- socket_ = -1;
+
+ interface_listener_->Deinit();
+ initialized_ = false;
}
bool TcpClientListener::IsInitialised() const {
- return thread_;
+ return initialized_;
}
TcpClientListener::~TcpClientListener() {
@@ -135,6 +158,7 @@ TcpClientListener::~TcpClientListener() {
delete thread_->delegate();
threads::DeleteThread(thread_);
Terminate();
+ delete interface_listener_;
}
void SetKeepaliveOptions(const int fd) {
@@ -146,12 +170,28 @@ void SetKeepaliveOptions(const int fd) {
int keepintvl = 1;
#ifdef __linux__
int user_timeout = 7000; // milliseconds
- setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
- setsockopt(
- fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(user_timeout));
+ if (0 != setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_KEEPALIVE failed");
+ }
+ if (0 !=
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPIDLE failed");
+ }
+ if (0 !=
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPCNT failed");
+ }
+ if (0 != setsockopt(
+ fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPINTVL failed");
+ }
+ if (0 != setsockopt(fd,
+ IPPROTO_TCP,
+ TCP_USER_TIMEOUT,
+ &user_timeout,
+ sizeof(user_timeout))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_USER_TIMEOUT failed");
+ }
#elif defined(__QNX__) // __linux__
// TODO(KKolodiy): Out of order!
const int kMidLength = 4;
@@ -184,88 +224,152 @@ void SetKeepaliveOptions(const int fd) {
void TcpClientListener::Loop() {
LOG4CXX_AUTO_TRACE(logger_);
- while (!thread_stop_requested_) {
- sockaddr_in client_address;
- socklen_t client_address_size = sizeof(client_address);
- const int connection_fd = accept(
- socket_, (struct sockaddr*)&client_address, &client_address_size);
- if (thread_stop_requested_) {
- LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
- close(connection_fd);
- break;
- }
+ fd_set rfds;
+ char dummy[16];
- if (connection_fd < 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
- continue;
- }
-
- if (AF_INET != client_address.sin_family) {
- LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
- close(connection_fd);
- continue;
+ while (!thread_stop_requested_) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_, "select failed for TCP server socket");
+ break;
+ }
}
- char device_name[32];
- strncpy(device_name,
- inet_ntoa(client_address.sin_addr),
- sizeof(device_name) / sizeof(device_name[0]));
- LOG4CXX_INFO(logger_, "Connected client " << device_name);
-
- if (enable_keepalive_) {
- SetKeepaliveOptions(connection_fd);
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], dummy, sizeof(dummy));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe, aborting TCP server socket loop.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected, aborting TCP server socket loop.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "received stop command of TCP server socket loop");
+ break;
+ }
}
- TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_name);
- DeviceSptr device = controller_->AddDevice(tcp_device);
- tcp_device = static_cast<TcpDevice*>(device.get());
- const ApplicationHandle app_handle =
- tcp_device->AddIncomingApplication(connection_fd);
-
- utils::SharedPtr<TcpSocketConnection> connection =
- utils::MakeShared<TcpSocketConnection>(
- device->unique_device_id(), app_handle, controller_);
- controller_->ConnectionCreated(
- connection, device->unique_device_id(), app_handle);
- connection->set_socket(connection_fd);
- const TransportAdapter::Error error = connection->Start();
- if (TransportAdapter::OK != error) {
- LOG4CXX_ERROR(logger_,
- "TCP connection::Start() failed with error: " << error);
+ if (FD_ISSET(socket_, &rfds)) {
+ sockaddr_in client_address;
+ socklen_t client_address_size = sizeof(client_address);
+ const int connection_fd = accept(
+ socket_, (struct sockaddr*)&client_address, &client_address_size);
+ if (thread_stop_requested_) {
+ LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
+ close(connection_fd);
+ break;
+ }
+
+ if (connection_fd < 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
+ continue;
+ }
+
+ if (AF_INET != client_address.sin_family) {
+ LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
+ close(connection_fd);
+ continue;
+ }
+
+ char device_name[32];
+ size_t size = sizeof(device_name) / sizeof(device_name[0]);
+ strncpy(device_name, inet_ntoa(client_address.sin_addr), size);
+
+ device_name[size - 1] = '\0';
+ LOG4CXX_INFO(logger_, "Connected client " << device_name);
+ LOG4CXX_INFO(logger_, "Port is: " << port_);
+
+ if (enable_keepalive_) {
+ SetKeepaliveOptions(connection_fd);
+ }
+
+ const auto device_uid =
+ device_name + std::string(":") + std::to_string(port_);
+
+#if defined(BUILD_TESTS)
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid, device_name);
+#else
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid);
+#endif // BUILD_TESTS
+
+ DeviceSptr device = controller_->AddDevice(tcp_device);
+ auto tcp_device_raw = static_cast<TcpDevice*>(device.get());
+ const ApplicationHandle app_handle =
+ tcp_device_raw->AddIncomingApplication(connection_fd);
+
+ std::shared_ptr<TcpSocketConnection> connection =
+ std::make_shared<TcpSocketConnection>(
+ device->unique_device_id(), app_handle, controller_);
+ controller_->ConnectionCreated(
+ connection, device->unique_device_id(), app_handle);
+ connection->set_socket(connection_fd);
+ const TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_,
+ "TCP connection::Start() failed with error: " << error);
+ }
}
}
+
+ LOG4CXX_INFO(logger_, "TCP server socket loop is terminated.");
}
void TcpClientListener::StopLoop() {
LOG4CXX_AUTO_TRACE(logger_);
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return;
+ }
+
thread_stop_requested_ = true;
- // We need to connect to the listening socket to unblock accept() call
- int byesocket = socket(AF_INET, SOCK_STREAM, 0);
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
- connect(byesocket,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address));
- shutdown(byesocket, SHUT_RDWR);
- close(byesocket);
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to TCP server socket loop");
+ }
}
TransportAdapter::Error TcpClientListener::StartListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (thread_->is_running()) {
+ if (started_) {
LOG4CXX_WARN(
logger_,
"TransportAdapter::BAD_STATE. Listener has already been started");
return TransportAdapter::BAD_STATE;
}
- if (!thread_->start()) {
- LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ if (!interface_listener_->Start()) {
return TransportAdapter::FAIL;
}
+
+ if (!IsListeningOnSpecificInterface()) {
+ TransportAdapter::Error ret = StartListeningThread();
+ if (TransportAdapter::OK != ret) {
+ LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ interface_listener_->Stop();
+ return ret;
+ }
+ }
+
+ started_ = true;
LOG4CXX_INFO(logger_, "Tcp client listener has started successfully");
return TransportAdapter::OK;
}
@@ -284,16 +388,286 @@ TcpClientListener::ListeningThreadDelegate::ListeningThreadDelegate(
TransportAdapter::Error TcpClientListener::StopListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (!thread_->is_running()) {
+ if (!started_) {
LOG4CXX_DEBUG(logger_, "TcpClientListener is not running now");
return TransportAdapter::BAD_STATE;
}
- thread_->join();
+ interface_listener_->Stop();
+
+ StopListeningThread();
+ started_ = false;
LOG4CXX_INFO(logger_, "Tcp client listener has stopped successfully");
return TransportAdapter::OK;
}
+TransportAdapter::Error TcpClientListener::StartListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StartListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ if (pipe_fds_[0] < 0 || pipe_fds_[1] < 0) {
+ // recreate the pipe every time, so that the thread loop will not get
+ // leftover
+ // data inside pipe after it is started
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ return TransportAdapter::FAIL;
+ }
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+ }
+
+ thread_stop_requested_ = false;
+
+ if (!thread_->start()) {
+ return TransportAdapter::FAIL;
+ }
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error TcpClientListener::StopListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StopListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ thread_->join();
+
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+
+ return TransportAdapter::OK;
+}
+
+void TcpClientListener::OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Since we only create a TCP socket with IPv4 option (AF_INET), currently we
+ // do not use IPv6 address.
+ if (ipv4_addr != current_ip_address_) {
+ if (IsListeningOnSpecificInterface()) {
+ if (!current_ip_address_.empty()) {
+ // the server socket is running, terminate it
+ LOG4CXX_DEBUG(logger_,
+ "Stopping current TCP server socket on "
+ << designated_interface_);
+ StopOnNetworkInterface();
+ }
+ if (!ipv4_addr.empty()) {
+ // start (or restart) server socket with the new IP address
+ LOG4CXX_DEBUG(
+ logger_, "Starting TCP server socket on " << designated_interface_);
+ StartOnNetworkInterface();
+ }
+ }
+
+ current_ip_address_ = ipv4_addr;
+
+ std::string enabled = !current_ip_address_.empty() ? "true" : "false";
+ std::ostringstream oss;
+ oss << port_;
+
+ TransportConfig config;
+ config.insert(std::make_pair(tc_enabled, enabled));
+ config.insert(std::make_pair(tc_tcp_ip_address, current_ip_address_));
+ config.insert(std::make_pair(tc_tcp_port, oss.str()));
+
+ controller_->TransportConfigUpdated(config);
+ }
+}
+
+bool TcpClientListener::StartOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // this method is only for the case that network interface is specified
+ if (IsListeningOnSpecificInterface()) {
+ {
+ // make sure that two threads will not update socket_ at the same time
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ if (socket_ < 0) {
+ socket_ = CreateIPv4ServerSocket(port_, designated_interface_);
+ if (-1 == socket_) {
+ LOG4CXX_WARN(logger_, "Failed to create TCP socket");
+ return false;
+ }
+ }
+ }
+
+ if (TransportAdapter::OK != StartListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to start TCP client listener");
+ return false;
+ }
+ LOG4CXX_INFO(logger_,
+ "TCP server socket started on " << designated_interface_);
+ }
+ return true;
+}
+
+bool TcpClientListener::StopOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (IsListeningOnSpecificInterface()) {
+ if (TransportAdapter::OK != StopListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to stop TCP client listener");
+ return false;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "TCP server socket on " << designated_interface_
+ << " stopped");
+ }
+ return true;
+}
+
+bool TcpClientListener::IsListeningOnSpecificInterface() const {
+ return !designated_interface_.empty();
+}
+
+int TcpClientListener::CreateIPv4ServerSocket(
+ uint16_t port, const std::string interface_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ struct in_addr ipv4_address;
+ memset(&ipv4_address, 0, sizeof(ipv4_address));
+ if (interface_name.empty()) {
+ ipv4_address.s_addr = htonl(INADDR_ANY);
+ } else if (!GetIPv4Address(interface_name, &ipv4_address)) {
+ return -1;
+ }
+
+ int sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (-1 == sock) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
+ return -1;
+ }
+
+ sockaddr_in server_address = {0};
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = htons(port);
+ server_address.sin_addr = ipv4_address;
+
+ int optval = 1;
+ if (0 !=
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ }
+
+ if (bind(sock,
+ reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ close(sock);
+ return -1;
+ }
+
+ const int kBacklog = 128;
+ if (0 != listen(sock, kBacklog)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
+ close(sock);
+ return -1;
+ }
+
+ return sock;
+}
+
+void TcpClientListener::DestroyServerSocket(int sock) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (sock >= 0) {
+ if (shutdown(sock, SHUT_RDWR) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
+ }
+ if (close(sock) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+ }
+ }
+}
+
+bool TcpClientListener::GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs(), instead return a dummy address of
+ // INADDR_LOOPBACK
+ struct in_addr dummy_addr;
+ dummy_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (ip_address != NULL) {
+ *ip_address = dummy_addr;
+ }
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_, "getifaddrs failed");
+ return false;
+ }
+
+ struct ifaddrs* interface;
+ bool found = false;
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL) {
+ continue;
+ }
+ if (interface_name == interface->ifa_name) {
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ if (ip_address != NULL) {
+ *ip_address = addr->sin_addr;
+ }
+ found = true;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+
+ freeifaddrs(if_list);
+
+ return found;
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
index 114425076a..e202554f8f 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -35,7 +35,6 @@
#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -56,8 +55,8 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection(
LOG4CXX_DEBUG(logger_,
"DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
- utils::SharedPtr<TcpServerOriginatedSocketConnection> connection =
- utils::MakeShared<TcpServerOriginatedSocketConnection>(
+ std::shared_ptr<TcpServerOriginatedSocketConnection> connection =
+ std::make_shared<TcpServerOriginatedSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
const TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/tcp/tcp_device.cc b/src/components/transport_manager/src/tcp/tcp_device.cc
index d3f132759a..dbcb5d38cb 100644
--- a/src/components/transport_manager/src/tcp/tcp_device.cc
+++ b/src/components/transport_manager/src/tcp/tcp_device.cc
@@ -46,6 +46,23 @@ TcpDevice::TcpDevice(const in_addr_t& in_addr, const std::string& name)
LOG4CXX_AUTO_TRACE(logger_);
}
+#if defined(BUILD_TESTS)
+TcpDevice::TcpDevice(const in_addr_t& in_addr,
+ const std::string& device_uid,
+ const std::string& transport_switch_id)
+ : Device(device_uid, device_uid, transport_switch_id)
+ , applications_mutex_()
+ , in_addr_(in_addr)
+ , last_handle_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Device created with transport switch emulation support.");
+ LOG4CXX_DEBUG(logger_,
+ "Device parameters: " << device_uid << " / "
+ << transport_switch_id);
+}
+#endif // BUILD_TESTS
+
bool TcpDevice::IsSameAs(const Device* other) const {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Device: " << other);
diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
index 516f2d3ec4..2f10bd9454 100644
--- a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
@@ -56,7 +56,7 @@ bool TcpServerOriginatedSocketConnection::Establish(ConnectError** error) {
DCHECK(error);
LOG4CXX_DEBUG(logger_, "error " << error);
DeviceSptr device = controller()->FindDevice(device_handle());
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found");
*error = new ConnectError();
return false;
diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
index 0e9e63263b..b3dbf49628 100644
--- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -55,14 +55,35 @@ TcpTransportAdapter::TcpTransportAdapter(
const uint16_t port,
resumption::LastState& last_state,
const TransportManagerSettings& settings)
- : TransportAdapterImpl(NULL,
- new TcpConnectionFactory(this),
- new TcpClientListener(this, port, true),
- last_state,
- settings) {}
+ : TransportAdapterImpl(
+ NULL,
+ new TcpConnectionFactory(this),
+ new TcpClientListener(
+ this,
+ port,
+ true,
+ settings.transport_manager_tcp_adapter_network_interface()),
+ last_state,
+ settings) {}
TcpTransportAdapter::~TcpTransportAdapter() {}
+void TcpTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_config_ = new_config;
+
+ // call the method of parent class to trigger OnTransportConfigUpdated() for
+ // the listeners
+ TransportAdapterImpl::TransportConfigUpdated(new_config);
+}
+
+TransportConfig TcpTransportAdapter::GetTransportConfiguration() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return transport_config_;
+}
+
DeviceType TcpTransportAdapter::GetDeviceType() const {
return TCP;
}
@@ -79,8 +100,8 @@ void TcpTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<TcpDevice> tcp_device =
- DeviceSptr::static_pointer_cast<TcpDevice>(device);
+ std::shared_ptr<TcpDevice> tcp_device =
+ std::static_pointer_cast<TcpDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = tcp_device->name();
struct in_addr address;
diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
index 081caec50a..9d594affe4 100644
--- a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
+++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
@@ -173,6 +173,7 @@ void ThreadedSocketConnection::threadMain() {
if (!Establish(&connect_error)) {
LOG4CXX_ERROR(logger_, "Connection Establish failed");
delete connect_error;
+ Abort();
}
LOG4CXX_DEBUG(logger_, "Connection established");
controller_->ConnectDone(device_handle(), application_handle());
@@ -267,7 +268,7 @@ void ThreadedSocketConnection::Transmit() {
const bool is_queue_empty = IsFramesToSendQueueEmpty();
// Send data if possible
- if (!is_queue_empty && (poll_fds[0].revents | POLLOUT)) {
+ if (!is_queue_empty && (poll_fds[0].revents & POLLOUT)) {
LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() ");
// send data
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index 026e53670b..346139cbd2 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -43,15 +43,24 @@
namespace transport_manager {
namespace transport_adapter {
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
namespace {
DeviceTypes devicesType = {
- std::make_pair(AOA, std::string("USB_AOA")),
- std::make_pair(PASA_AOA, std::string("USB_AOA")),
- std::make_pair(MME, std::string("USB_IOS")),
- std::make_pair(BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(PASA_BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(TCP, std::string("WIFI"))};
+ std::make_pair(DeviceType::AOA, std::string("USB_AOA")),
+ std::make_pair(DeviceType::BLUETOOTH, std::string("BLUETOOTH")),
+ std::make_pair(DeviceType::IOS_BT, std::string("BLUETOOTH_IOS")),
+ std::make_pair(DeviceType::IOS_USB, std::string("USB_IOS")),
+ std::make_pair(DeviceType::TCP, std::string("WIFI")),
+ std::make_pair(DeviceType::IOS_USB_HOST_MODE,
+ std::string("USB_IOS_HOST_MODE")),
+ std::make_pair(DeviceType::IOS_USB_DEVICE_MODE,
+ std::string("USB_IOS_DEVICE_MODE")),
+ std::make_pair(DeviceType::IOS_CARPLAY_WIRELESS,
+ std::string("CARPLAY_WIRELESS_IOS"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -79,6 +88,7 @@ TransportAdapterImpl::TransportAdapterImpl(
}
TransportAdapterImpl::~TransportAdapterImpl() {
+ listeners_.clear();
Terminate();
if (device_scanner_) {
@@ -155,10 +165,9 @@ TransportAdapter::Error TransportAdapterImpl::Init() {
initialised_ = (error == OK);
- if (get_settings().use_last_state()) {
+ if (get_settings().use_last_state() && initialised_) {
if (!Restore()) {
LOG4CXX_WARN(logger_, "could not restore transport adapter state");
- error = FAIL;
}
}
LOG4CXX_TRACE(logger_, "exit with error: " << error);
@@ -502,15 +511,13 @@ void TransportAdapterImpl::SearchDeviceFailed(const SearchDeviceError& error) {
}
bool TransportAdapterImpl::IsSearchDevicesSupported() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
return device_scanner_ != 0;
- LOG4CXX_TRACE(logger_, "exit");
}
bool TransportAdapterImpl::IsServerOriginatedConnectSupported() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
return server_connection_factory_ != 0;
- LOG4CXX_TRACE(logger_, "exit");
}
bool TransportAdapterImpl::IsClientOriginatedConnectSupported() const {
@@ -694,6 +701,33 @@ void TransportAdapterImpl::DataSendFailed(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterImpl::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnTransportConfigUpdated(this);
+ }
+}
+
+void TransportAdapterImpl::DoTransportSwitch() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(
+ std::mem_fun(&TransportAdapterListener::OnTransportSwitchRequested),
+ this));
+}
+
+void TransportAdapterImpl::DeviceSwitched(const DeviceUID& device_handle) {
+ LOG4CXX_DEBUG(logger_,
+ "Switching is not implemented for that adapter type "
+ << GetConnectionType().c_str());
+ UNUSED(device_handle);
+}
+
DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr ret;
@@ -785,16 +819,16 @@ ApplicationList TransportAdapterImpl::GetApplicationList(
const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
ApplicationList lst = device->GetApplicationList();
LOG4CXX_TRACE(logger_,
"exit with ApplicationList. It's size = "
- << lst.size() << " Condition: device.valid()");
+ << lst.size() << " Condition: device.use_count() != 0");
return lst;
}
- LOG4CXX_TRACE(
- logger_,
- "exit with empty ApplicationList. Condition: NOT device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with empty ApplicationList. Condition: NOT "
+ "device.use_count() != 0");
return ApplicationList();
}
@@ -857,17 +891,47 @@ bool TransportAdapterImpl::IsInitialised() const {
std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
return device->name();
} else {
return "";
}
}
+void TransportAdapterImpl::StopDevice(const DeviceUID& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DeviceSptr device = FindDevice(device_id);
+ if (device) {
+ device->Stop();
+ }
+}
+
std::string TransportAdapterImpl::GetConnectionType() const {
return devicesType[GetDeviceType()];
}
+SwitchableDevices TransportAdapterImpl::GetSwitchableDevices() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SwitchableDevices devices;
+ sync_primitives::AutoLock locker(devices_mutex_);
+ for (DeviceMap::const_iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ const auto device_uid = it->first;
+ const auto device = it->second;
+ const auto transport_switch_id = device->transport_switch_id();
+ if (transport_switch_id.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Device is not suitable for switching: " << device_uid);
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_, "Device is suitable for switching: " << device_uid);
+ devices.insert(std::make_pair(device_uid, transport_switch_id));
+ }
+ LOG4CXX_INFO(logger_,
+ "Found number of switchable devices: " << devices.size());
+ return devices;
+}
+
#ifdef TELEMETRY_MONITOR
void TransportAdapterImpl::SetTelemetryObserver(TMTelemetryObserver* observer) {
metric_observer_ = observer;
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
index 2ab19ade86..544cdde999 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -48,13 +48,12 @@ TransportAdapterListenerImpl::TransportAdapterListenerImpl(
void TransportAdapterListenerImpl::OnSearchDeviceDone(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr());
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEARCH_DONE,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -68,13 +67,12 @@ void TransportAdapterListenerImpl::OnSearchDeviceFailed(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", error: " << &error);
SearchDeviceError* err = new SearchDeviceError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEARCH_FAIL,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -86,13 +84,12 @@ void TransportAdapterListenerImpl::OnSearchDeviceFailed(
void TransportAdapterListenerImpl::OnDeviceListUpdated(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr());
+ const TransportAdapterEvent event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -105,7 +102,7 @@ void TransportAdapterListenerImpl::OnFindNewApplicationsRequest(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
const TransportAdapterEvent event(
- TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST,
+ EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
transport_adapter_,
"",
0,
@@ -126,13 +123,12 @@ void TransportAdapterListenerImpl::OnConnectDone(
LOG4CXX_TRACE(logger_,
"enter adapter*: " << adapter << ", device: " << &device
<< ", application_id: " << &application_id);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE,
- transport_adapter_,
- device,
- application_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECT_DONE,
+ transport_adapter_,
+ device,
+ application_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -151,13 +147,12 @@ void TransportAdapterListenerImpl::OnConnectFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
ConnectError* err = new ConnectError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECT_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -173,13 +168,12 @@ void TransportAdapterListenerImpl::OnDisconnectDone(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_DISCONNECT_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -198,13 +192,12 @@ void TransportAdapterListenerImpl::OnDisconnectFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
DisconnectError* err = new DisconnectError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_DISCONNECT_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -230,13 +223,12 @@ void TransportAdapterListenerImpl::OnDataReceiveDone(
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id
<< ", data_container: " << data_container);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE,
- transport_adapter_,
- device,
- app_id,
- data_container,
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_RECEIVED_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -255,13 +247,12 @@ void TransportAdapterListenerImpl::OnDataReceiveFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
DataReceiveError* err = new DataReceiveError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_RECEIVED_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -279,13 +270,12 @@ void TransportAdapterListenerImpl::OnDataSendDone(
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id
<< ", data_container: " << data_container);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE,
- transport_adapter_,
- device,
- app_id,
- data_container,
- new BaseError());
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEND_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ std::make_shared<BaseError>());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -306,13 +296,12 @@ void TransportAdapterListenerImpl::OnDataSendFailed(
<< ", data_container: " << data_container
<< ", error: " << &error);
DataSendError* err = new DataSendError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL,
- transport_adapter_,
- device,
- app_id,
- data_container,
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEND_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -336,13 +325,12 @@ void TransportAdapterListenerImpl::OnUnexpectedDisconnect(
<< ", application: " << &application
<< ", error: " << &error);
CommunicationError* err = new CommunicationError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
- transport_adapter_,
- device,
- application,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ transport_adapter_,
+ device,
+ application,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -358,18 +346,53 @@ void TransportAdapterListenerImpl::OnCommunicationError(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id);
+ const TransportAdapterEvent event(EventTypeEnum::ON_COMMUNICATION_ERROR,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnTransportSwitchRequested(
+ const transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR,
+ EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
transport_adapter_,
- device,
- app_id,
+ "",
+ 0,
::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
LOG4CXX_WARN(logger_, "Failed to receive event from device");
}
- LOG4CXX_TRACE(logger_, "exit");
}
+
+void TransportAdapterListenerImpl::OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const TransportAdapterEvent event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
+
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+}
+
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
index 31f398233b..196ad09af4 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -44,6 +44,10 @@
#include "transport_manager/usb/usb_aoa_adapter.h"
#endif // USB_SUPPORT
+#if defined(BUILD_TESTS)
+#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
+#endif // BUILD_TEST
+
namespace transport_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
@@ -97,6 +101,23 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) {
ta_usb = NULL;
#endif // USB_SUPPORT
+#if defined BUILD_TESTS
+ const uint16_t iap2_bt_emu_port = 23456;
+ transport_adapter::IAP2BluetoothEmulationTransportAdapter*
+ iap2_bt_emu_adapter =
+ new transport_adapter::IAP2BluetoothEmulationTransportAdapter(
+ iap2_bt_emu_port, last_state, get_settings());
+
+ AddTransportAdapter(iap2_bt_emu_adapter);
+
+ const uint16_t iap2_usb_emu_port = 34567;
+ transport_adapter::IAP2USBEmulationTransportAdapter* iap2_usb_emu_adapter =
+ new transport_adapter::IAP2USBEmulationTransportAdapter(
+ iap2_usb_emu_port, last_state, get_settings());
+
+ AddTransportAdapter(iap2_usb_emu_adapter);
+#endif // BUILD_TEST
+
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
return E_SUCCESS;
}
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 433885a606..2b0296debb 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -44,7 +44,7 @@
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_manager_listener.h"
@@ -55,6 +55,17 @@
using ::transport_manager::transport_adapter::TransportAdapter;
+namespace {
+struct ConnectionFinder {
+ const uint32_t id_;
+ explicit ConnectionFinder(const uint32_t id) : id_(id) {}
+ bool operator()(const transport_manager::TransportManagerImpl::Connection&
+ connection) const {
+ return id_ == connection.id;
+ }
+};
+} // namespace
+
namespace transport_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
@@ -82,7 +93,11 @@ TransportManagerImpl::TransportManagerImpl(
, connection_id_counter_(0)
, message_queue_("TM MessageQueue", this)
, event_queue_("TM EventQueue", this)
- , settings_(settings) {
+ , settings_(settings)
+ , device_switch_timer_(
+ "Device reconection timer",
+ new timer::TimerTaskImpl<TransportManagerImpl>(
+ this, &TransportManagerImpl::ReconnectionTimeout)) {
LOG4CXX_TRACE(logger_, "TransportManager has created");
}
@@ -108,6 +123,12 @@ TransportManagerImpl::~TransportManagerImpl() {
LOG4CXX_INFO(logger_, "TransportManager object destroyed");
}
+void TransportManagerImpl::ReconnectionTimeout() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RaiseEvent(&TransportManagerListener::OnDeviceSwitchingFinish,
+ device_to_reconnect_);
+}
+
int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) {
LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
if (!this->is_initialized_) {
@@ -414,15 +435,16 @@ int TransportManagerImpl::AddTransportAdapter(
return E_ADAPTER_EXISTS;
}
+ auto listener = new TransportAdapterListenerImpl(this, transport_adapter);
+
+ transport_adapter->AddListener(listener);
+
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_adapter_listeners_[transport_adapter] = listener;
transport_adapters_.push_back(transport_adapter);
} else {
+ delete listener;
delete transport_adapter;
}
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
@@ -507,6 +529,8 @@ int TransportManagerImpl::Reinit() {
LOG4CXX_AUTO_TRACE(logger_);
DisconnectAllDevices();
TerminateAllAdapters();
+ device_to_adapter_map_.clear();
+ connection_id_counter_ = 0;
int ret = InitAllAdapters();
return ret;
}
@@ -562,7 +586,8 @@ void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) {
const DeviceList dev_list = ta->GetDeviceList();
for (DeviceList::const_iterator it = dev_list.begin(); it != dev_list.end();
++it) {
- DeviceHandle device_handle = converter_.UidToHandle(*it);
+ DeviceHandle device_handle =
+ converter_.UidToHandle(*it, ta->GetConnectionType());
DeviceInfo info(
device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
device_list_.push_back(std::make_pair(ta, info));
@@ -621,22 +646,12 @@ 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_);
+ LOG4CXX_DEBUG(logger_, "Removing connection with id: " << id);
const std::vector<ConnectionInternal>::iterator it = std::find_if(
connections_.begin(), connections_.end(), ConnectionFinder(id));
if (connections_.end() != it) {
@@ -647,10 +662,33 @@ void TransportManagerImpl::RemoveConnection(
}
}
+void TransportManagerImpl::DeactivateDeviceConnections(
+ const DeviceUID& device_uid) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoWriteLock lock(connections_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "Deactivating connections for device with UID: " << device_uid);
+
+ size_t counter = 0;
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end();
+ ++it) {
+ if (it->device == device_uid) {
+ it->active_ = false;
+ ++counter;
+ }
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Deactivated "
+ << counter
+ << " connections for device with UID: " << device_uid);
+}
+
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const ConnectionUID id) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "ConnectionUID: " << &id);
+ LOG4CXX_DEBUG(logger_, "ConnectionUID: " << id);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
@@ -665,9 +703,8 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const DeviceUID& device, const ApplicationHandle& application) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "DeviceUID: " << &device
- << "ApplicationHandle: " << &application);
+ LOG4CXX_DEBUG(
+ logger_, "DeviceUID: " << device << "ApplicationHandle: " << application);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
@@ -679,21 +716,201 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
return NULL;
}
-void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
- LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
- const DeviceList device_list = ta->GetDeviceList();
- LOG4CXX_DEBUG(logger_, "DEVICE_LIST_UPDATED " << device_list.size());
- for (DeviceList::const_iterator it = device_list.begin();
- it != device_list.end();
+TransportManagerImpl::ConnectionInternal*
+TransportManagerImpl::GetActiveConnection(
+ const DeviceUID& device, const ApplicationHandle& application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "DeviceUID: " << device
+ << " ApplicationHandle: " << application);
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end();
+ ++it) {
+ if (it->device == device && it->application == application && it->active_) {
+ LOG4CXX_DEBUG(logger_, "ConnectionInternal. It's address: " << &*it);
+ return &*it;
+ }
+ }
+ return NULL;
+}
+
+namespace {
+
+struct IOSBTAdapterFinder {
+ bool operator()(const std::vector<TransportAdapter*>::value_type& i) const {
+ return i->GetDeviceType() == transport_adapter::DeviceType::IOS_BT;
+ }
+};
+
+struct SwitchableFinder {
+ explicit SwitchableFinder(SwitchableDevices::const_iterator what)
+ : what_(what) {}
+ bool operator()(const SwitchableDevices::value_type& i) const {
+ return what_->second == i.second;
+ }
+
+ private:
+ SwitchableDevices::const_iterator what_;
+};
+
+} // namespace
+
+void TransportManagerImpl::TryDeviceSwitch(
+ transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (adapter->GetDeviceType() != transport_adapter::DeviceType::IOS_USB) {
+ LOG4CXX_ERROR(logger_, "Switching requested not from iAP-USB transport.");
+ return;
+ }
+
+ const auto ios_bt_adapter = std::find_if(transport_adapters_.begin(),
+ transport_adapters_.end(),
+ IOSBTAdapterFinder());
+
+ if (transport_adapters_.end() == ios_bt_adapter) {
+ LOG4CXX_WARN(
+ logger_,
+ "There is no iAP2 Bluetooth adapter found. Switching is not possible.");
+ return;
+ }
+
+ const SwitchableDevices usb_switchable_devices =
+ adapter->GetSwitchableDevices();
+ const auto bt_switchable_devices = (*ios_bt_adapter)->GetSwitchableDevices();
+ auto bt = bt_switchable_devices.end();
+ auto usb = usb_switchable_devices.begin();
+ for (; usb != usb_switchable_devices.end(); ++usb) {
+ SwitchableFinder finder(usb);
+ bt = std::find_if(
+ bt_switchable_devices.begin(), bt_switchable_devices.end(), finder);
+
+ if (bt != bt_switchable_devices.end()) {
+ break;
+ }
+ }
+
+ if (bt_switchable_devices.end() == bt) {
+ LOG4CXX_WARN(logger_,
+ "No suitable for switching iAP2 Bluetooth device found.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Found UUID suitable for transport switching: " << bt->second);
+ LOG4CXX_DEBUG(
+ logger_, "Device to switch from: " << bt->first << " to: " << usb->first);
+
+ sync_primitives::AutoWriteLock lock(device_to_adapter_map_lock_);
+
+ const auto bt_device_uid = bt->first;
+ const auto device_to_switch = device_to_adapter_map_.find(bt_device_uid);
+ if (device_to_adapter_map_.end() == device_to_switch) {
+ LOG4CXX_ERROR(logger_,
+ "There is no known device found with UID "
+ << bt_device_uid
+ << " . Transport switching is not possible.");
+ DCHECK_OR_RETURN_VOID(false);
+ return;
+ }
+
+ const auto usb_uid = usb->first;
+ const auto bt_uid = device_to_switch->first;
+ const auto bt_adapter = device_to_switch->second;
+
+ LOG4CXX_DEBUG(logger_,
+ "Known device with UID "
+ << bt_uid << " is appropriate for transport switching.");
+
+ RaiseEvent(
+ &TransportManagerListener::OnDeviceSwitchingStart, bt_uid, usb_uid);
+
+ bt_adapter->StopDevice(bt_uid);
+ adapter->DeviceSwitched(usb_uid);
+
+ DeactivateDeviceConnections(bt_uid);
+
+ device_to_reconnect_ = bt_uid;
+
+ const uint32_t timeout = get_settings().app_transport_change_timer() +
+ get_settings().app_transport_change_timer_addition();
+ device_switch_timer_.Start(timeout, timer::kSingleShot);
+
+ LOG4CXX_DEBUG(logger_,
+ "Device switch for device id " << bt_uid << " is done.");
+ return;
+}
+
+bool TransportManagerImpl::UpdateDeviceMapping(
+ transport_adapter::TransportAdapter* ta) {
+ const DeviceList adapter_device_list = ta->GetDeviceList();
+ LOG4CXX_DEBUG(logger_, "DEVICE_LIST_UPDATED " << adapter_device_list.size());
+
+ sync_primitives::AutoWriteLock lock(device_to_adapter_map_lock_);
+
+ LOG4CXX_DEBUG(logger_,
+ "Before cleanup and update. Device map size is "
+ << device_to_adapter_map_.size());
+
+ for (auto item = device_to_adapter_map_.begin();
+ device_to_adapter_map_.end() != item;) {
+ const auto adapter = item->second;
+ if (adapter != ta) {
+ ++item;
+ continue;
+ }
+
+ const auto device_uid = item->first;
+ if (adapter_device_list.end() != std::find(adapter_device_list.begin(),
+ adapter_device_list.end(),
+ device_uid)) {
+ ++item;
+ continue;
+ }
+
+ device_to_adapter_map_.erase(item);
+ item = device_to_adapter_map_.begin();
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "After cleanup. Device map size is "
+ << device_to_adapter_map_.size());
+
+ for (DeviceList::const_iterator it = adapter_device_list.begin();
+ it != adapter_device_list.end();
++it) {
- device_to_adapter_map_lock_.AcquireForWriting();
- device_to_adapter_map_.insert(std::make_pair(*it, ta));
- device_to_adapter_map_lock_.Release();
- DeviceHandle device_handle = converter_.UidToHandle(*it);
- DeviceInfo info(
- device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
+ const auto device_uid = *it;
+ const auto result =
+ device_to_adapter_map_.insert(std::make_pair(device_uid, ta));
+ if (!result.second) {
+ LOG4CXX_WARN(logger_,
+ "Device UID "
+ << device_uid
+ << " is known already. Processing skipped."
+ "Connection type is: " << ta->GetConnectionType());
+ continue;
+ }
+ DeviceHandle device_handle =
+ converter_.UidToHandle(device_uid, ta->GetConnectionType());
+ DeviceInfo info(device_handle,
+ device_uid,
+ ta->DeviceName(device_uid),
+ ta->GetConnectionType());
RaiseEvent(&TransportManagerListener::OnDeviceFound, info);
}
+
+ LOG4CXX_DEBUG(logger_,
+ "After update. Device map size is "
+ << device_to_adapter_map_.size());
+
+ return true;
+}
+
+void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
+ if (!UpdateDeviceMapping(ta)) {
+ LOG4CXX_ERROR(logger_, "Device list update failed.");
+ return;
+ }
UpdateDeviceList(ta);
std::vector<DeviceInfo> device_infos;
device_list_lock_.AcquireForReading();
@@ -703,37 +920,43 @@ void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
device_infos.push_back(it->second);
}
device_list_lock_.Release();
+ RaiseEvent(&TransportManagerListener::OnDeviceListUpdated, device_infos);
LOG4CXX_TRACE(logger_, "exit");
}
void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_TRACE(logger_, "enter");
switch (event.event_type) {
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE: {
+ case EventTypeEnum::ON_SEARCH_DONE: {
RaiseEvent(&TransportManagerListener::OnScanDevicesFinished);
LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL: {
+ case EventTypeEnum::ON_SEARCH_FAIL: {
// error happened in real search process (external error)
RaiseEvent(&TransportManagerListener::OnScanDevicesFailed,
*static_cast<SearchDeviceError*>(event.event_error.get()));
LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED: {
+ case EventTypeEnum::ON_DEVICE_LIST_UPDATED: {
OnDeviceListUpdated(event.transport_adapter);
LOG4CXX_DEBUG(logger_, "event_type = ON_DEVICE_LIST_UPDATED");
break;
}
- case TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST: {
+ case EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED: {
+ TryDeviceSwitch(event.transport_adapter);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_SWITCH_REQUESTED");
+ break;
+ }
+ case EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST: {
RaiseEvent(&TransportManagerListener::OnFindNewApplicationsRequest);
LOG4CXX_DEBUG(logger_, "event_type = ON_FIND_NEW_APPLICATIONS_REQUEST");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE: {
- const DeviceHandle device_handle =
- converter_.UidToHandle(event.device_uid);
+ case EventTypeEnum::ON_CONNECT_DONE: {
+ const DeviceHandle device_handle = converter_.UidToHandle(
+ event.device_uid, event.transport_adapter->GetConnectionType());
AddConnection(ConnectionInternal(this,
event.transport_adapter,
++connection_id_counter_,
@@ -750,10 +973,12 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL: {
+ case EventTypeEnum::ON_CONNECT_FAIL: {
RaiseEvent(
&TransportManagerListener::OnConnectionFailed,
- DeviceInfo(converter_.UidToHandle(event.device_uid),
+ DeviceInfo(converter_.UidToHandle(
+ event.device_uid,
+ event.transport_adapter->GetConnectionType()),
event.device_uid,
event.transport_adapter->DeviceName(event.device_uid),
event.transport_adapter->GetConnectionType()),
@@ -761,7 +986,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE: {
+ case EventTypeEnum::ON_DISCONNECT_DONE: {
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
GetConnection(event.device_uid, event.application_id);
@@ -780,16 +1005,16 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL: {
- const DeviceHandle device_handle =
- converter_.UidToHandle(event.device_uid);
+ case EventTypeEnum::ON_DISCONNECT_FAIL: {
+ const DeviceHandle device_handle = converter_.UidToHandle(
+ event.device_uid, event.transport_adapter->GetConnectionType());
RaiseEvent(&TransportManagerListener::OnDisconnectFailed,
device_handle,
DisconnectDeviceError());
LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE: {
+ case EventTypeEnum::ON_SEND_DONE: {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
metric_observer_->StopRawMsg(event.event_data.get());
@@ -816,7 +1041,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL: {
+ case EventTypeEnum::ON_SEND_FAIL: {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
metric_observer_->StopRawMsg(event.event_data.get());
@@ -843,7 +1068,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_ERROR(logger_, "Transport adapter failed to send data");
// TODO(YK): potential error case -> thread unsafe
// update of message content
- if (event.event_data.valid()) {
+ if (event.event_data.use_count() != 0) {
event.event_data->set_waiting(true);
} else {
LOG4CXX_DEBUG(logger_, "Data is invalid");
@@ -851,11 +1076,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "eevent_type = ON_SEND_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE: {
+ case EventTypeEnum::ON_RECEIVED_DONE: {
{
sync_primitives::AutoReadLock lock(connections_lock_);
ConnectionInternal* connection =
- GetConnection(event.device_uid, event.application_id);
+ GetActiveConnection(event.device_uid, event.application_id);
if (connection == NULL) {
LOG4CXX_ERROR(logger_,
"Connection ('" << event.device_uid << ", "
@@ -878,11 +1103,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL: {
+ case EventTypeEnum::ON_RECEIVED_FAIL: {
LOG4CXX_DEBUG(logger_, "Event ON_RECEIVED_FAIL");
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
- GetConnection(event.device_uid, event.application_id);
+ GetActiveConnection(event.device_uid, event.application_id);
if (connection == NULL) {
LOG4CXX_ERROR(logger_,
"Connection ('" << event.device_uid << ", "
@@ -897,12 +1122,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR: {
+ case EventTypeEnum::ON_COMMUNICATION_ERROR: {
LOG4CXX_DEBUG(logger_, "event_type = ON_COMMUNICATION_ERROR");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::
- ON_UNEXPECTED_DISCONNECT: {
+ case EventTypeEnum::ON_UNEXPECTED_DISCONNECT: {
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
GetConnection(event.device_uid, event.application_id);
@@ -922,6 +1146,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT");
break;
}
+ case EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED: {
+ LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_CONFIG_UPDATED");
+ transport_adapter::TransportConfig config =
+ event.transport_adapter->GetTransportConfiguration();
+ RaiseEvent(&TransportManagerListener::OnTransportConfigUpdated, config);
+ break;
+ }
} // switch
LOG4CXX_TRACE(logger_, "exit");
}
@@ -981,15 +1212,16 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal(
const DeviceHandle device_handle)
: transport_manager(transport_manager)
, transport_adapter(transport_adapter)
- , timer(utils::MakeShared<timer::Timer,
- const char*,
- ::timer::TimerTaskImpl<ConnectionInternal>*>(
+ , timer(std::make_shared<timer::Timer,
+ const char*,
+ ::timer::TimerTaskImpl<ConnectionInternal>*>(
"TM DiscRoutine",
new ::timer::TimerTaskImpl<ConnectionInternal>(
this, &ConnectionInternal::DisconnectFailedRoutine)))
, shutdown_(false)
, device_handle_(device_handle)
- , messages_count(0) {
+ , messages_count(0)
+ , active_(true) {
Connection::id = id;
Connection::device = dev_id;
Connection::application = app_id;
@@ -1005,4 +1237,55 @@ void TransportManagerImpl::ConnectionInternal::DisconnectFailedRoutine() {
LOG4CXX_TRACE(logger_, "exit");
}
+DeviceHandle TransportManagerImpl::Handle2GUIDConverter::UidToHandle(
+ const DeviceUID& dev_uid, const std::string& connection_type) {
+ DeviceHandle handle = hash_function_(dev_uid + connection_type);
+
+ {
+ sync_primitives::AutoReadLock lock(conversion_table_lock_);
+
+ auto it = std::find_if(conversion_table_.begin(),
+ conversion_table_.end(),
+ HandleFinder(handle));
+
+ if (it != conversion_table_.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Handle for UID is found: " << std::get<0>(*it) << "/"
+ << std::get<1>(*it) << "/"
+ << std::get<2>(*it));
+ return std::get<2>(*it);
+ }
+ }
+
+ sync_primitives::AutoWriteLock lock(conversion_table_lock_);
+
+ auto t = std::make_tuple(dev_uid, connection_type, handle);
+ conversion_table_.push_back(
+ std::make_tuple(dev_uid, connection_type, handle));
+ LOG4CXX_DEBUG(logger_,
+ "Handle for UID is added: " << std::get<0>(t) << "/"
+ << std::get<1>(t) << "/"
+ << std::get<2>(t));
+ return handle;
+}
+
+DeviceUID TransportManagerImpl::Handle2GUIDConverter::HandleToUid(
+ const DeviceHandle handle) {
+ sync_primitives::AutoReadLock lock(conversion_table_lock_);
+
+ auto it = std::find_if(
+ conversion_table_.begin(), conversion_table_.end(), HandleFinder(handle));
+
+ if (it != conversion_table_.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Handle is found: " << std::get<0>(*it) << "/"
+ << std::get<1>(*it) << "/"
+ << std::get<2>(*it));
+ return std::get<0>(*it);
+ }
+
+ LOG4CXX_DEBUG(logger_, "Handle is not found: " << handle);
+ return DeviceUID("uknown_uid");
+}
+
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index 409209b2b2..212e6e0ec3 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -34,7 +34,7 @@
#include <unistd.h>
#include <iomanip>
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
#include <sstream>
@@ -43,6 +43,10 @@
#include "utils/logger.h"
+// Define the buffer size, because the Android accessory protocol packet support
+// packet buffers up to 16Kbytes
+#define TRANSPORT_USB_BUFFER_MAX_SIZE (16 * 1024)
+
namespace transport_manager {
namespace transport_adapter {
@@ -64,6 +68,7 @@ UsbConnection::UsbConnection(const DeviceUID& device_uid,
, out_endpoint_(0)
, out_endpoint_max_packet_size_(0)
, in_buffer_(NULL)
+ , in_buffer_size_(0)
, in_transfer_(NULL)
, out_transfer_(0)
, out_messages_()
@@ -96,7 +101,7 @@ bool UsbConnection::PostInTransfer() {
device_handle_,
in_endpoint_,
in_buffer_,
- in_endpoint_max_packet_size_,
+ in_buffer_size_,
InTransferCallback,
this,
0);
@@ -219,7 +224,7 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
device_uid_, app_handle_, current_out_message_, DataSendError());
PopOutMessage();
}
- if (!current_out_message_.valid()) {
+ if (current_out_message_.use_count() == 0) {
libusb_free_transfer(transfer);
out_transfer_ = NULL;
waiting_out_transfer_cancel_ = false;
@@ -237,7 +242,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
@@ -307,7 +312,14 @@ bool UsbConnection::Init() {
LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !FindEndpoints()");
return false;
}
- in_buffer_ = new unsigned char[in_endpoint_max_packet_size_];
+
+ if (in_endpoint_max_packet_size_ < TRANSPORT_USB_BUFFER_MAX_SIZE) {
+ in_buffer_size_ = TRANSPORT_USB_BUFFER_MAX_SIZE;
+ } else {
+ in_buffer_size_ = in_endpoint_max_packet_size_;
+ }
+
+ in_buffer_ = new unsigned char[in_buffer_size_];
in_transfer_ = libusb_alloc_transfer(0);
if (NULL == in_transfer_) {
LOG4CXX_ERROR(logger_, "libusb_alloc_transfer failed");
diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
index 516a367ebc..b9386c5d9f 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -230,7 +230,7 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) {
}
}
- if ((!disconnecting_) && current_out_message_.valid()) {
+ if ((!disconnecting_) && (current_out_message_.use_count() != 0)) {
PostOutTransfer();
} else {
pending_out_transfer_ = false;
@@ -243,7 +243,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
index 3462b557ce..b7faf1ef6b 100644
--- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -60,7 +60,7 @@ UsbAoaAdapter::UsbAoaAdapter(resumption::LastState& last_state,
UsbAoaAdapter::~UsbAoaAdapter() {}
DeviceType UsbAoaAdapter::GetDeviceType() const {
- return PASA_AOA;
+ return AOA;
}
bool UsbAoaAdapter::IsInitialised() const {
diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc
index 1136dfad21..528855cd50 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -34,7 +34,6 @@
#include "transport_manager/usb/usb_device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_connection.h"
@@ -65,21 +64,21 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection(
"enter DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
DeviceSptr device = controller_->FindDevice(device_uid);
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "device " << device_uid << " not found");
- LOG4CXX_TRACE(
- logger_,
- "exit with TransportAdapter::BAD_PARAM. Condition: !device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_PARAM. Condition: "
+ "device.use_count() == 0");
return TransportAdapter::BAD_PARAM;
}
UsbDevice* usb_device = static_cast<UsbDevice*>(device.get());
- utils::SharedPtr<UsbConnection> connection =
- utils::MakeShared<UsbConnection>(device_uid,
- app_handle,
- controller_,
- usb_handler_,
- usb_device->usb_device());
+ std::shared_ptr<UsbConnection> connection =
+ std::make_shared<UsbConnection>(device_uid,
+ app_handle,
+ controller_,
+ usb_handler_,
+ usb_device->usb_device());
controller_->ConnectionCreated(connection, device_uid, app_handle);
if (connection->Init()) {
LOG4CXX_INFO(logger_, "USB connection initialised");
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
index 184d546f15..240784436b 100644
--- a/src/components/transport_manager/test/CMakeLists.txt
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -42,11 +42,18 @@ include_directories(
)
set(EXCLUDE_PATHS
+ platform_specific
raw_message_matcher.cc
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES platform_specific/linux)
+endif()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
set(LIBRARIES
gmock
ConfigProfile
@@ -59,7 +66,7 @@ set(LIBRARIES
)
if (BUILD_USB_SUPPORT)
- list(APPEND LIBRARIES Libusb-1.0.16)
+ list(APPEND LIBRARIES libusb-1.0.so)
endif()
if (BUILD_BT_SUPPORT)
diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
index bb15c19d3b..9c7327e6fb 100644
--- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
+++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
@@ -57,8 +57,8 @@ class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
virtual bool MatchAndExplain(const RawMessagePtr ptr,
MatchResultListener* listener) const;
- virtual void DescribeTo(::std::ostream* os) const;
- virtual void DescribeNegationTo(::std::ostream* os) const;
+ virtual void DescribeTo(std::ostream* os) const;
+ virtual void DescribeNegationTo(std::ostream* os) const;
private:
const RawMessagePtr ptr_;
diff --git a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
new file mode 100644
index 0000000000..d18500b02d
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
@@ -0,0 +1,34 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager::transport_adapter;
+
+class MockTcpClientListener : public TcpClientListener {
+ public:
+ MockTcpClientListener(TransportAdapterController* controller,
+ uint16_t port,
+ bool enable_keepalive,
+ const std::string designated_interface = "")
+ : TcpClientListener(
+ controller, port, enable_keepalive, designated_interface) {}
+ MOCK_METHOD0(Init, TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD0(StartListening, TransportAdapter::Error());
+ MOCK_METHOD0(StopListening, TransportAdapter::Error());
+ MOCK_METHOD2(OnIPAddressUpdated,
+ void(const std::string ipv4_addr, const std::string ipv6_addr));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
index 0636448e58..384f55605a 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
@@ -68,7 +68,7 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
const ApplicationHandle& app_handle) {
return this->FindEstablishedConnection(device_handle, app_handle);
}
- virtual ~MockTransportAdapterImpl(){};
+ virtual ~MockTransportAdapterImpl() {}
virtual DeviceType GetDeviceType() const {
return DeviceType::UNKNOWN;
@@ -76,6 +76,9 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
MOCK_CONST_METHOD0(Store, void());
MOCK_METHOD0(Restore, bool());
+ MOCK_CONST_METHOD1(FindDevice,
+ transport_manager::transport_adapter::DeviceSptr(
+ const DeviceUID& device_id));
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
index 8302a63beb..dce23189c8 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -120,6 +120,10 @@ class MockTransportAdapterListener : public TransportAdapterListener {
void(const TransportAdapter*,
const DeviceUID&,
const ApplicationHandle&));
+ MOCK_METHOD1(OnTransportSwitchRequested,
+ void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const TransportAdapter* transport_adapter));
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/network_interface_listener_test.cc b/src/components/transport_manager/test/network_interface_listener_test.cc
new file mode 100644
index 0000000000..55a35fb4ea
--- /dev/null
+++ b/src/components/transport_manager/test/network_interface_listener_test.cc
@@ -0,0 +1,57 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ NetworkInterfaceListenerImpl* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
new file mode 100644
index 0000000000..da58466c29
--- /dev/null
+++ b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
@@ -0,0 +1,567 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "platform_specific_network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Init(const std::string interface_name) {
+ interface_listener_impl_ = new PlatformSpecificNetworkInterfaceListener(
+ &mock_tcp_client_listener_, interface_name);
+ // disable events from actual network interfaces
+ interface_listener_impl_->SetTesting(true);
+ }
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SetDummyInterfaceTable(struct InterfaceEntry* entries) {
+ InterfaceStatusTable dummy_table;
+
+ while (entries->name != NULL) {
+ InterfaceStatus status;
+ if (entries->ipv4_address != NULL) {
+ struct in_addr addr;
+ ASSERT_EQ(1, inet_pton(AF_INET, entries->ipv4_address, &addr));
+ status.SetIPv4Address(&addr);
+ }
+ if (entries->ipv6_address != NULL) {
+ struct in6_addr addr6;
+ ASSERT_EQ(1, inet_pton(AF_INET6, entries->ipv6_address, &addr6));
+ status.SetIPv6Address(&addr6);
+ }
+ status.SetFlags(entries->flags);
+
+ dummy_table.insert(std::make_pair(entries->name, status));
+ entries++;
+ }
+
+ interface_listener_impl_->OverwriteStatusTable(dummy_table);
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ PlatformSpecificNetworkInterfaceListener* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+TEST_F(NetworkInterfaceListenerTest, Init) {
+ Init("");
+
+ EXPECT_TRUE(interface_listener_impl_->Init());
+ EXPECT_TRUE(0 <= interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Deinit) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ interface_listener_impl_->Deinit();
+
+ EXPECT_EQ(-1, interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ SetDummyInterfaceTable(entries);
+
+ // after stated, it is expected that the listener notifies current IP address
+ // (if it's available)
+ TestAsyncWaiter waiter;
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address, ""))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->GetThread()->is_running());
+
+ EXPECT_TRUE(waiter.WaitFor(1, kStartNotificationTimeoutMsec));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->Start());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->GetThread()->is_running());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_without_Start) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "5.6.7.8", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ // this test case doesn't call Start() - we only check the behavior of
+ // NotifyIPAddresses()
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressNotChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "172.16.23.30", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ // OnIPAddressUpdated() shouldn't be notified
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(0);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_GoesUnavailable) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Removed) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Added) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[1].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SelectInterface) {
+ // automatically select network interface
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ std::string output_ipv4_address;
+ std::string output_ipv6_address;
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&output_ipv4_address),
+ SaveArg<1>(&output_ipv6_address)));
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+
+ // the interface listener should pick one of the interfaces
+ EXPECT_TRUE((selected_interface == entries[0].name &&
+ output_ipv4_address == entries[0].ipv4_address &&
+ output_ipv6_address == "") ||
+ (selected_interface == entries[1].name &&
+ output_ipv4_address == entries[1].ipv4_address &&
+ output_ipv6_address == entries[1].ipv6_address));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipUnavailableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SkipEmptyInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", NULL, NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // net_dummy2 should not be selected
+ struct InterfaceEntry* expected = &entries[0];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipLoopbackInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING | IFF_LOOPBACK},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_DisableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ("", interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_EnableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make it running again
+ entries[0].flags |= IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address,
+ entries[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(entries[0].name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SwitchInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1",
+ "10.10.10.12",
+ "fd53:ba79:241d:30c1::78",
+ IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ const std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+ struct InterfaceEntry* selected = &entries[0];
+ while (selected->name != NULL) {
+ if (selected->name == selected_interface) {
+ break;
+ }
+ selected++;
+ }
+ ASSERT_TRUE(selected->name != NULL);
+
+ // make the interface "not running"
+ selected->flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ struct InterfaceEntry* switched;
+ if (selected == &entries[0]) {
+ switched = &entries[1];
+ } else {
+ switched = &entries[0];
+ }
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(switched->ipv4_address,
+ switched->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(switched->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
index b179f63ece..5205d6ae3c 100644
--- a/src/components/transport_manager/test/tcp_client_listener_test.cc
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -30,21 +30,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+
#include "gtest/gtest.h"
#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/tcp/tcp_client_listener.h"
+#include "transport_manager/tcp/network_interface_listener.h"
#include "transport_manager/mock_transport_manager.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
-#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
namespace test {
namespace components {
namespace transport_manager_test {
+using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using namespace ::transport_manager;
using namespace ::transport_manager::transport_adapter;
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kConnectionCreatedTimeoutMsec = 200;
+}
+
class MockTransportAdapterController : public TransportAdapterController {
public:
MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device));
@@ -95,37 +112,491 @@ class MockTransportAdapterController : public TransportAdapterController {
MOCK_METHOD2(DeviceDisconnected,
void(const DeviceUID& device_handle,
const DisconnectDeviceError& error));
+ MOCK_METHOD1(TransportConfigUpdated,
+ void(const transport_manager::transport_adapter::TransportConfig&
+ new_config));
};
-class TcpClientListenerTest : public ::testing::Test {
+class MockNetworkInterfaceListener : public NetworkInterfaceListener {
+ public:
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Deinit, void());
+ MOCK_METHOD0(Start, bool());
+ MOCK_METHOD0(Stop, bool());
+};
+
+class TcpClientListenerTest : public ::testing::TestWithParam<std::string> {
public:
TcpClientListenerTest()
- : port_(0)
+ : port_(0) /* On Linux, binding to port 0 lets the system choose an
+ available port */
, enable_keep_alive_(false)
- , tcp_client_listener_(
- &adapter_controller_mock_, port_, enable_keep_alive_) {}
+ , interface_listener_mock_(NULL)
+ , tcp_client_listener_(NULL) {}
+ virtual ~TcpClientListenerTest() {
+ delete tcp_client_listener_;
+ }
protected:
+ void SetUp() OVERRIDE {
+ tcp_client_listener_ = new TcpClientListener(
+ &adapter_controller_mock_, port_, enable_keep_alive_, GetParam());
+ interface_listener_mock_ = new MockNetworkInterfaceListener();
+ tcp_client_listener_->set_testing(true);
+ tcp_client_listener_->set_network_interface_listener(
+ interface_listener_mock_);
+ }
+
+ bool InterfaceNameSpecified() const {
+ return "" != GetParam();
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
uint16_t port_;
bool enable_keep_alive_;
MockTransportAdapterController adapter_controller_mock_;
- TcpClientListener tcp_client_listener_;
+ MockNetworkInterfaceListener* interface_listener_mock_;
+ TcpClientListener* tcp_client_listener_;
};
-TEST_F(TcpClientListenerTest, Ctor_test) {
- EXPECT_EQ(0, tcp_client_listener_.port());
- EXPECT_TRUE(NULL != tcp_client_listener_.thread());
- EXPECT_EQ(-1, tcp_client_listener_.get_socket());
+TEST_P(TcpClientListenerTest, Ctor_test) {
+ EXPECT_EQ(0, tcp_client_listener_->port());
+ EXPECT_TRUE(NULL != tcp_client_listener_->thread());
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, IsInitialised) {
+ // should return false until Init() is called
+ EXPECT_FALSE(tcp_client_listener_->IsInitialised());
+}
+
+TEST_P(TcpClientListenerTest, Init) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ if (InterfaceNameSpecified()) {
+ // TcpClientListener will create socket once IP address of the network is
+ // notified.
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+ } else {
+ // Interface name is not designated. In this case, TcpClientListener will
+ // create socket with Init().
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+ }
+
+ EXPECT_TRUE(tcp_client_listener_->IsInitialised());
+
+ // Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, Terminate) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+
+ tcp_client_listener_->Terminate();
+
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, StartListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ } else {
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StartListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE,
+ tcp_client_listener_->StartListening());
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE, tcp_client_listener_->StopListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, IsInitialised) {
- EXPECT_TRUE(tcp_client_listener_.IsInitialised());
+TEST_P(TcpClientListenerTest, ClientConnection) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ if (InterfaceNameSpecified()) {
+ // set up a server socket by notifying a dummy IP address
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(1);
+ tcp_client_listener_->OnIPAddressUpdated(std::string("192.168.1.1"),
+ std::string(""));
+ }
+
+ // get the port number (assigned by system) that the socket is listening on
+ struct sockaddr_in server_addr;
+ socklen_t server_addr_len = sizeof(server_addr);
+ EXPECT_EQ(0,
+ getsockname(tcp_client_listener_->get_socket(),
+ reinterpret_cast<struct sockaddr*>(&server_addr),
+ &server_addr_len));
+
+ // try connecting to the socket
+ struct sockaddr_in client_addr;
+ client_addr.sin_family = AF_INET;
+ client_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ client_addr.sin_port = server_addr.sin_port;
+ socklen_t client_addr_len = sizeof(client_addr);
+
+ int s = socket(AF_INET, SOCK_STREAM, 0);
+ EXPECT_TRUE(0 <= s);
+
+ TestAsyncWaiter waiter;
+
+ // controller should be notified of AddDevice event
+ DeviceSptr mock_device = std::make_shared<MockTCPDevice>(
+ htonl(INADDR_LOOPBACK), "dummy_tcp_device");
+ EXPECT_CALL(adapter_controller_mock_, AddDevice(_))
+ .WillOnce(Return(mock_device));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionCreated(_, _, _))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ // adapter_controller_mock_ may also receive ConnectDone() and
+ // ConnectionFinished() from ThreadedSocketConnection. Ignore them as hey are
+ // not part ly client listener's tests.
+ EXPECT_CALL(adapter_controller_mock_, ConnectDone(_, _)).Times(AtLeast(0));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionFinished(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_EQ(0,
+ connect(s,
+ reinterpret_cast<struct sockaddr*>(&client_addr),
+ client_addr_len));
+
+ // since the connection is handled on another thread, wait for some time
+ EXPECT_TRUE(waiter.WaitFor(1, kConnectionCreatedTimeoutMsec));
+
+ close(s);
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, Init) {
- EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_.Init());
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_ValidIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config;
+ expected_config.insert(std::make_pair(tc_enabled, "true"));
+ expected_config.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr));
+ expected_config.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(expected_config))
+ .Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ // when the client listener runs with designated interface name, it should
+ // start the thread here
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_changed) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "172.16.2.3";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_same) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "192.168.1.1"; // same as before
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ // client listener should not generate TransportConfigUpdated event
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_disabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_3 = "192.168.1.1";
+ TransportConfig expected_config_3;
+ expected_config_3.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_3.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_3));
+ expected_config_3.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_3)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_3, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_EmptyIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ // if the client listener receives an empty IP address after started, it
+ // should ignore it
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+INSTANTIATE_TEST_CASE_P(NetworkInterfaceName,
+ TcpClientListenerTest,
+ ::testing::Values(std::string(""),
+ std::string("dummy_interface0")));
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
index dd587569d3..959180948a 100644
--- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -41,13 +41,12 @@
#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace transport_manager_test {
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::_;
using namespace ::protocol_handler;
@@ -61,6 +60,13 @@ class TcpAdapterTest : public ::testing::Test {
resumption::LastStateImpl last_state_;
const uint32_t port = 12345;
const std::string string_port = "12345";
+ std::string network_interface = "";
+
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
+ }
};
TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
@@ -68,7 +74,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -79,7 +86,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -107,13 +114,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -125,7 +132,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -162,13 +169,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -182,7 +189,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
std::vector<int> intList = {app_handle[0], app_handle[1], app_handle[2]};
const std::string ports[connection_count] = {"11111", "67890", "98765"};
const int int_port[connection_count] = {11111, 67890, 98765};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -220,7 +227,7 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ auto mockdev = std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -257,7 +264,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -268,7 +276,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -292,13 +300,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -310,7 +318,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -339,6 +347,37 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
}
}
+TEST_F(TcpAdapterTest, NotifyTransportConfigUpdated) {
+ MockTransportAdapterListener mock_adapter_listener;
+
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+ transport_adapter.AddListener(&mock_adapter_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_adapter_listener, OnTransportConfigUpdated(_)).Times(1);
+
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TcpAdapterTest, GetTransportConfiguration) {
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ transport_adapter.TransportConfigUpdated(config);
+
+ EXPECT_EQ(config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc
index c8e9af7d63..a5d08035ae 100644
--- a/src/components/transport_manager/test/transport_adapter_listener_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -45,16 +45,16 @@ using namespace ::transport_manager;
class TransportAdapterListenerTest : public ::testing::Test {
public:
TransportAdapterListenerTest()
- : app_handle(1)
- , dev_id("device_id")
- , transport_listener(&tr_mock, &adapter_mock) {}
+ : dev_id("device_id")
+ , transport_listener(&tr_mock, &adapter_mock)
+ , app_handle(1) {}
protected:
- const int app_handle;
const std::string dev_id;
MockTransportManager tr_mock;
MockTransportAdapter adapter_mock;
TransportAdapterListenerImpl transport_listener;
+ const int app_handle;
};
MATCHER_P4(IsEvent, eventType, adapter, dev_id, app_id, "") {
@@ -73,33 +73,30 @@ MATCHER_P5(IsEvent, eventType, adapter, dev_id, app_id, data, "") {
TEST_F(TransportAdapterListenerTest, OnCommunicationError) {
EXPECT_CALL(
tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_COMMUNICATION_ERROR,
+ &adapter_mock,
+ dev_id,
+ app_handle))).WillOnce(Return(E_SUCCESS));
transport_listener.OnCommunicationError(&adapter_mock, dev_id, app_handle);
}
TEST_F(TransportAdapterListenerTest, OnConnectDone) {
- EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_CONNECT_DONE, &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnConnectDone(&adapter_mock, dev_id, app_handle);
}
TEST_F(TransportAdapterListenerTest, OnConnectFailed) {
ConnectError er;
- EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_CONNECT_FAIL, &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnConnectFailed(&adapter_mock, dev_id, app_handle, er);
}
@@ -107,12 +104,12 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveDone) {
::protocol_handler::RawMessagePtr data_container;
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE,
- &adapter_mock,
- dev_id,
- app_handle,
- data_container))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_RECEIVED_DONE,
+ &adapter_mock,
+ dev_id,
+ app_handle,
+ data_container)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDataReceiveDone(
&adapter_mock, dev_id, app_handle, data_container);
}
@@ -120,12 +117,11 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveDone) {
TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) {
DataReceiveError err;
- EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_RECEIVED_FAIL, &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDataReceiveFailed(
&adapter_mock, dev_id, app_handle, err);
}
@@ -133,15 +129,15 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) {
TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE,
- &adapter_mock,
- dev_id,
- app_handle,
- data_container))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_DONE,
+ &adapter_mock,
+ dev_id,
+ app_handle,
+ data_container)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDataSendDone(
&adapter_mock, dev_id, app_handle, data_container);
}
@@ -149,60 +145,54 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
TEST_F(TransportAdapterListenerTest, OnDataSendFailed) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
DataSendError err;
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL,
- &adapter_mock,
- dev_id,
- app_handle,
- data_container))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_FAIL,
+ &adapter_mock,
+ dev_id,
+ app_handle,
+ data_container)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDataSendFailed(
&adapter_mock, dev_id, app_handle, data_container, err);
}
TEST_F(TransportAdapterListenerTest, OnDeviceListUpdated) {
- EXPECT_CALL(
- tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED,
- &adapter_mock,
- "",
- 0))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_DEVICE_LIST_UPDATED, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDeviceListUpdated(&adapter_mock);
}
TEST_F(TransportAdapterListenerTest, OnDisconnectDeviceDone) {
- EXPECT_CALL(
- tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_DISCONNECT_DONE,
+ &adapter_mock,
+ dev_id,
+ app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDisconnectDone(&adapter_mock, dev_id, app_handle);
}
TEST_F(TransportAdapterListenerTest, OnDisconnectFailed) {
DisconnectError err;
- EXPECT_CALL(
- tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_DISCONNECT_FAIL,
+ &adapter_mock,
+ dev_id,
+ app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDisconnectFailed(&adapter_mock, dev_id, app_handle, err);
}
TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) {
EXPECT_CALL(tr_mock,
ReceiveEventFromDevice(
- IsEvent(TransportAdapterListenerImpl::EventTypeEnum::
- ON_FIND_NEW_APPLICATIONS_REQUEST,
+ IsEvent(EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
&adapter_mock,
"",
0))).WillOnce(Return(E_SUCCESS));
@@ -211,11 +201,9 @@ TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) {
TEST_F(TransportAdapterListenerTest, OnSearchDeviceDone) {
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
- &adapter_mock,
- "",
- 0))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(
+ IsEvent(EventTypeEnum::ON_SEARCH_DONE, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnSearchDeviceDone(&adapter_mock);
}
@@ -223,11 +211,9 @@ TEST_F(TransportAdapterListenerTest, OnSearchDeviceFailed) {
SearchDeviceError er;
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
- &adapter_mock,
- "",
- 0))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(
+ IsEvent(EventTypeEnum::ON_SEARCH_FAIL, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnSearchDeviceFailed(&adapter_mock, er);
}
@@ -236,15 +222,23 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
EXPECT_CALL(
tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ &adapter_mock,
+ dev_id,
+ app_handle))).WillOnce(Return(E_SUCCESS));
transport_listener.OnUnexpectedDisconnect(
&adapter_mock, dev_id, app_handle, err);
}
+TEST_F(TransportAdapterListenerTest, OnTransportConfigUpdated) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnTransportConfigUpdated(&adapter_mock);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 0c59e912ba..9e602332c6 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -45,7 +45,7 @@
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
+
#include "resumption/last_state_impl.h"
#include "config_profile/profile.h"
@@ -156,10 +156,10 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev = new MockDevice(dev_id, uniq_id);
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
- std::vector<utils::SharedPtr<Device> > devList;
+ std::vector<std::shared_ptr<Device> > devList;
devList.push_back(mockdev);
EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true));
@@ -189,9 +189,10 @@ TEST_F(TransportAdapterTest, AddDevice) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
- EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
}
@@ -276,7 +277,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -286,6 +288,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
int app_handle = 1;
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::FAIL, res);
@@ -303,6 +306,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).Times(0);
EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
@@ -318,7 +323,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -332,6 +338,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
@@ -347,7 +354,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -361,6 +369,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
@@ -370,6 +379,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error newres = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, newres);
@@ -391,7 +401,7 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -415,7 +425,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -428,10 +439,11 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
EXPECT_CALL(*mock_connection, Disconnect())
@@ -455,8 +467,9 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
- EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -465,23 +478,25 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
-
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ std::shared_ptr<MockConnection> mock_connection =
+ std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
EXPECT_CALL(
mock_listener,
OnUnexpectedDisconnect(&transport_adapter, uniq_id, app_handle, _));
EXPECT_CALL(mock_listener,
OnDisconnectDeviceDone(&transport_adapter, uniq_id));
- EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
DisconnectDeviceError error;
transport_adapter.DeviceDisconnected(uniq_id, error);
@@ -530,7 +545,7 @@ TEST_F(TransportAdapterTest, SendData) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -538,7 +553,8 @@ TEST_F(TransportAdapterTest, SendData) {
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage))
.WillOnce(Return(TransportAdapter::OK));
@@ -571,12 +587,13 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0);
res = transport_adapter.SendData(dev_id, app_handle, kMessage);
@@ -697,7 +714,8 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -707,6 +725,7 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
int app_handle = 1;
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
std::vector<int> res = transport_adapter.GetApplicationList(uniq_id);
ASSERT_EQ(1u, res.size());
EXPECT_EQ(intList[0], res[0]);
@@ -727,7 +746,7 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -746,12 +765,14 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", "test_device_uid0");
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", "test_device_uid0");
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice("test_device_uid1"))
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id);
}
@@ -763,16 +784,62 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", device_uid);
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", device_uid);
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id));
+ EXPECT_CALL(transport_adapter, FindDevice(device_uid))
+ .WillOnce(Return(mock_device));
transport_adapter.RunAppOnDevice(device_uid, bundle_id);
}
+TEST_F(TransportAdapterTest, StopDevice) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(*mockdev, Stop());
+
+ transport_adapter.StopDevice(uniq_id);
+}
+
+TEST_F(TransportAdapterTest, TransportConfigUpdated) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ MockTransportAdapterListener mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_listener, OnTransportConfigUpdated(_));
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TransportAdapterTest, GetTransportConfigration) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportConfig empty_config;
+
+ EXPECT_EQ(empty_config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc
index 0d8e574317..8e8a964228 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -51,6 +51,8 @@ const std::string kDeviceAddress = "address";
const std::string kDeviceApplications = "applications";
const std::string kApplicationPort = "port";
const std::string kApplicationPortValue = "12345";
+const std::string kApplicationRfcomm = "rfcomm_channel";
+const std::string kApplicationRfcommValue = "7";
const std::string kTransportManager = "TransportManager";
const std::string kTcpAdapter = "TcpAdapter";
const std::string kBluetoothAdapter = "BluetoothAdapter";
@@ -71,7 +73,11 @@ TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
EXPECT_CALL(transport_manager_settings, use_last_state())
.WillRepeatedly(Return(false));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
- .WillRepeatedly(Return(1u));
+ .WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
@@ -86,13 +92,13 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed) {
Json::Value custom_dictionary;
Json::Value tcp_device;
tcp_device[kDeviceName] = "unique_tcp_device_name";
- tcp_device[kDeviceAddress] = "57.48.0.1";
+ tcp_device[kDeviceAddress] = "127.0.0.1";
tcp_device[kDeviceApplications][0][kApplicationPort] = kApplicationPortValue;
Json::Value bluetooth_device;
bluetooth_device[kDeviceName] = "unique_bluetooth_device_name";
- bluetooth_device[kDeviceAddress] = "57.48.0.2";
- bluetooth_device[kDeviceApplications][0][kApplicationPort] =
- kApplicationPortValue;
+ bluetooth_device[kDeviceAddress] = "AB:CD:EF:GH:IJ:KL";
+ bluetooth_device[kDeviceApplications][0][kApplicationRfcomm] =
+ kApplicationRfcommValue;
custom_dictionary[kTransportManager][kTcpAdapter][kDevices][0] = tcp_device;
custom_dictionary[kTransportManager][kBluetoothAdapter][kDevices][0] =
bluetooth_device;
@@ -103,8 +109,46 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed) {
EXPECT_CALL(transport_manager_settings, use_last_state())
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
- .WillRepeatedly(Return(1u));
+ .WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
+ transport_manager.Init(mock_last_state);
+ transport_manager.Stop();
+}
+
+TEST(TestTransportManagerDefault, Init_LastStateUsed_InvalidPort) {
+ MockTransportManagerSettings transport_manager_settings;
+ transport_manager::TransportManagerDefault transport_manager(
+ transport_manager_settings);
+
+ NiceMock<MockLastState> mock_last_state;
+ Json::Value custom_dictionary;
+ Json::Value tcp_device;
+ tcp_device[kDeviceName] = "unique_tcp_device_name";
+ tcp_device[kDeviceAddress] = "127.0.0.1";
+ tcp_device[kDeviceApplications][0][kApplicationPort] = "1";
+ Json::Value bluetooth_device;
+ bluetooth_device[kDeviceName] = "unique_bluetooth_device_name";
+ bluetooth_device[kDeviceAddress] = "AB:CD:EF:GH:IJ:KL";
+ bluetooth_device[kDeviceApplications][0][kApplicationRfcomm] =
+ kApplicationRfcommValue;
+ custom_dictionary[kTransportManager][kTcpAdapter][kDevices][0] = tcp_device;
+ custom_dictionary[kTransportManager][kBluetoothAdapter][kDevices][0] =
+ bluetooth_device;
+ 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));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index 14362050a2..5f13adcd44 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -42,8 +42,7 @@
#include "transport_manager/mock_transport_manager_impl.h"
#include "transport_manager/mock_transport_manager_settings.h"
#include "resumption/last_state_impl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
using ::testing::_;
@@ -55,7 +54,7 @@ using ::testing::DoAll;
using ::protocol_handler::RawMessage;
using ::protocol_handler::RawMessagePtr;
-using utils::MakeShared;
+using std::make_shared;
namespace test {
namespace components {
@@ -70,17 +69,22 @@ const uint32_t kAsyncExpectationsTimeout = 10000u;
class TransportManagerImplTest : public ::testing::Test {
protected:
TransportManagerImplTest()
- : tm_(settings)
- , device_handle_(1)
+ : mock_adapter_(NULL)
+ , tm_(mock_transport_manager_settings_)
, mac_address_("MA:CA:DR:ES:S")
- , dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC") {}
+ , connection_type_("BTMAC")
+ , device_name_("TestDeviceName")
+ , device_handle_(
+ tm_.get_converter().UidToHandle(mac_address_, connection_type_))
+ , dev_info_(
+ device_handle_, mac_address_, device_name_, connection_type_) {}
void SetUp() OVERRIDE {
resumption::LastStateImpl last_state_("app_storage_folder",
"app_info_storage");
tm_.Init(last_state_);
mock_adapter_ = new MockTransportAdapter();
- tm_listener_ = MakeShared<MockTransportManagerListener>();
+ tm_listener_ = std::make_shared<MockTransportManagerListener>();
#ifdef TELEMETRY_MONITOR
tm_.SetTelemetryObserver(&mock_metric_observer_);
@@ -91,21 +95,56 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(mock_adapter_));
connection_key_ = 1;
- error_ = MakeShared<BaseError>();
+ error_ = std::make_shared<BaseError>();
const unsigned int version_protocol_ = 1;
const unsigned int kSize = 12;
unsigned char data[kSize] = {
0x20, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- test_message_ =
- MakeShared<RawMessage>(connection_key_, version_protocol_, data, kSize);
+ test_message_ = std::make_shared<RawMessage>(
+ connection_key_, version_protocol_, data, kSize);
}
- void HandleDeviceListUpdated() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
+ DeviceInfo ConstructDeviceInfo(const std::string& mac_address,
+ const std::string& connection_type,
+ const std::string& device_name) {
+ const auto device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ return DeviceInfo(device_handle, mac_address, device_name, connection_type);
+ }
+
+ void SetOnDeviceExpectations(const DeviceInfo& device_info) {
+ EXPECT_CALL(*tm_listener_, OnDeviceAdded(device_info));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ }
+
+ void SetDeviceExpectations(MockTransportAdapter* mock_adapter,
+ const DeviceList& device_list,
+ const DeviceInfo& device_info) {
+ EXPECT_CALL(*mock_adapter, GetDeviceList())
+ .WillRepeatedly(Return(device_list));
- TransportAdapterEvent test_event(type,
+ EXPECT_CALL(*mock_adapter, DeviceName(device_info.mac_address()))
+ .WillRepeatedly(Return(device_info.name()));
+
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillRepeatedly(Return(device_info.connection_type()));
+ }
+
+ void SetAddDeviceExpectations(MockTransportAdapter* mock_adapter,
+ transport_adapter::DeviceType type,
+ const DeviceList& device_list,
+ const DeviceInfo& device_info) {
+ SetDeviceExpectations(mock_adapter, device_list, device_info);
+
+ EXPECT_CALL(*mock_adapter, GetDeviceType()).WillRepeatedly(Return(type));
+
+ SetOnDeviceExpectations(device_info);
+ }
+
+ void HandleDeviceListUpdated() {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -125,18 +164,15 @@ class TransportManagerImplTest : public ::testing::Test {
.Times(AtLeast(1))
.WillRepeatedly(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
tm_.TestHandle(test_event);
device_list_.pop_back();
}
void HandleConnection() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_DONE,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -146,7 +182,7 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
.WillOnce(Return(dev_info_.name()));
EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
+ .WillRepeatedly(Return(dev_info_.connection_type()));
EXPECT_CALL(*tm_listener_,
OnConnectionEstablished(dev_info_, connection_key_));
@@ -155,10 +191,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleConnectionFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_FAIL,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -168,7 +201,7 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
.WillOnce(Return(dev_info_.name()));
EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
+ .WillRepeatedly(Return(dev_info_.connection_type()));
EXPECT_CALL(*tm_listener_, OnConnectionFailed(dev_info_, _));
@@ -176,9 +209,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSendDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -193,9 +224,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleReceiveDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -210,10 +239,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSendFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -226,10 +252,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSearchDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -242,10 +265,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSearchFail() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -258,16 +278,13 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleFindNewApplicationsRequest() {
- const int type =
- static_cast<int>(TransportAdapterListenerImpl::EventTypeEnum::
- ON_FIND_NEW_APPLICATIONS_REQUEST);
-
- TransportAdapterEvent test_event(type,
- mock_adapter_,
- mac_address_,
- application_id_,
- test_message_,
- error_);
+ TransportAdapterEvent test_event(
+ EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_);
EXPECT_CALL(*tm_listener_, OnFindNewApplicationsRequest());
@@ -275,10 +292,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleConnectionClosed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -293,10 +307,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleDisconnectionFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -312,19 +323,22 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_CALL(*mock_adapter_, Terminate());
ASSERT_EQ(E_SUCCESS, tm_.Stop());
}
- MockTransportManagerSettings settings;
- MockTransportManagerImpl tm_;
+
+ MockTransportManagerSettings mock_transport_manager_settings_;
#ifdef TELEMETRY_MONITOR
MockTMTelemetryObserver mock_metric_observer_;
#endif // TELEMETRY_MONITOR
MockTransportAdapter* mock_adapter_;
- utils::SharedPtr<MockTransportManagerListener> tm_listener_;
+ std::shared_ptr<MockTransportManagerListener> tm_listener_;
+ MockTransportManagerImpl tm_;
const ApplicationHandle application_id_ = 1;
ConnectionUID connection_key_;
RawMessagePtr test_message_;
- DeviceHandle device_handle_;
std::string mac_address_;
+ std::string connection_type_;
+ std::string device_name_;
+ DeviceHandle device_handle_;
const DeviceInfo dev_info_;
DeviceList device_list_;
@@ -642,45 +656,39 @@ TEST_F(TransportManagerImplTest, Reinit_InitAdapterFailed) {
TEST_F(TransportManagerImplTest, UpdateDeviceList_AddNewDevice) {
device_list_.push_back(dev_info_.mac_address());
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
-
- tm_.UpdateDeviceList(mock_adapter_);
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
device_list_.pop_back();
}
TEST_F(TransportManagerImplTest, UpdateDeviceList_RemoveDevice) {
device_list_.push_back(dev_info_.mac_address());
-
- ::testing::InSequence seq;
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
+ {
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ ::testing::InSequence s;
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+ }
device_list_.pop_back();
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+
// Device list is empty now
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
+ ::testing::InSequence s;
EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(mock_adapter_);
}
/*
* Tests which check correct handling and receiving events
*/
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
-
TestAsyncWaiter waiter;
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -696,11 +704,8 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
-
TestAsyncWaiter waiter;
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -716,10 +721,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -772,10 +774,7 @@ TEST_F(TransportManagerImplTest, CheckReceiveEvent) {
TEST_F(TransportManagerImplTest, CheckReceiveFailedEvent) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -790,10 +789,7 @@ TEST_F(TransportManagerImplTest, CheckReceiveFailedEvent) {
TEST_F(TransportManagerImplTest, CheckUnexpectedDisconnect) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
mock_adapter_,
mac_address_,
application_id_,
@@ -875,10 +871,12 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_TMIsNotInitialized) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
- TransportAdapterEvent test_event(
- type, NULL, mac_address_, application_id_, test_message_, error_);
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
+ NULL,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_);
// Check before Act
UninitializeTM();
// Act and Assert
@@ -938,84 +936,10 @@ TEST_F(TransportManagerImplTest,
}
TEST_F(TransportManagerImplTest,
- UpdateDeviceList_AddDevices_TwoTransportAdapters) {
- // Arrange
- MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
- device_list_.push_back(dev_info_.mac_address());
- // Check before Act
- EXPECT_CALL(*second_mock_adapter, AddListener(_));
- EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
- EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
-
- // Act and Assert
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*second_mock_adapter, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*second_mock_adapter, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
-
- device_list_.pop_back();
-}
-
-TEST_F(TransportManagerImplTest,
- UpdateDeviceList_RemoveDevices_TwoTransportAdapters) {
- // Arrange
- MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
- device_list_.push_back(dev_info_.mac_address());
- // Check before Act
- EXPECT_CALL(*second_mock_adapter, AddListener(_));
- EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
- EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
-
- // Act and Assert
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*second_mock_adapter, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*second_mock_adapter, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*mock_adapter_, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*mock_adapter_, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
-
- device_list_.pop_back();
-
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
-}
-
-TEST_F(TransportManagerImplTest,
CheckEventOnDisconnectDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1031,10 +955,7 @@ TEST_F(TransportManagerImplTest,
TEST_F(TransportManagerImplTest, CheckEventOnSendDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1052,9 +973,7 @@ TEST_F(TransportManagerImplTest, CheckEventOnSendDone_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, CheckEventOnReceivedDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1071,9 +990,7 @@ TEST_F(TransportManagerImplTest, CheckEventOnReceivedDone_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, CheckEventOnReceivedFail_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -1088,9 +1005,7 @@ TEST_F(TransportManagerImplTest,
CheckEventOnUnexpectedDisconnect_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
mock_adapter_,
mac_address_,
application_id_,
@@ -1108,6 +1023,328 @@ TEST_F(TransportManagerImplTest, RunAppOnDevice_TransportAdapterFound_SUCCESS) {
tm_.RunAppOnDevice(device_handle_, bundle_id);
}
+TEST_F(TransportManagerImplTest,
+ UpdateDeviceList_AddDevices_TwoTransportAdapters_ExpectSuccess) {
+ // Arrange
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ device_list_.push_back(dev_info_.mac_address());
+ // Check before Act
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ // Act and Assert
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ const std::string mac_address("NE:WA:DR:ES:SS");
+ const std::string connection_type("TCP");
+ const std::string device_name("TestName");
+ const transport_manager::DeviceHandle device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ DeviceInfo second_device(
+ device_handle, mac_address, device_name, connection_type);
+ DeviceList device_list_2;
+ device_list_2.push_back(second_device.mac_address());
+
+ SetDeviceExpectations(second_mock_adapter, device_list_2, second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ SetOnDeviceExpectations(second_device);
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ device_list_.pop_back();
+}
+
+TEST_F(
+ TransportManagerImplTest,
+ UpdateDeviceList_AddSameUUIDNonSwitchableDevices_TwoTransportAdapters_ExpectNoSwitch) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::TCP,
+ device_list_,
+ dev_info_);
+
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ // Adapter will be removed by TM on destruction
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ const auto usb_serial = "USB_serial";
+ DeviceInfo second_device =
+ ConstructDeviceInfo(usb_serial, "USB_IOS", "SecondDeviceName");
+
+ DeviceList second_adapter_device_list;
+ second_adapter_device_list.push_back(usb_serial);
+
+ SetAddDeviceExpectations(second_mock_adapter,
+ transport_adapter::DeviceType::IOS_USB,
+ second_adapter_device_list,
+ second_device);
+
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ // Act
+ EXPECT_CALL(*second_mock_adapter, StopDevice(_)).Times(0);
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(_)).Times(0);
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ second_mock_adapter,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest, OnlyOneDeviceShouldNotTriggerSwitch) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ SetOnDeviceExpectations(dev_info_);
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(_)).Times(0);
+ EXPECT_CALL(*mock_adapter_, DeviceSwitched(_)).Times(0);
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(_, _)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ TwoTransportAdapterAddSameSwitchableDevice_ExpectSuccess) {
+ device_list_.push_back(dev_info_.mac_address());
+ const uint32_t timeout = 0;
+
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_BT,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
+
+ const auto usb_serial = "USB_serial";
+ DeviceInfo second_device =
+ ConstructDeviceInfo(usb_serial, "USB_IOS", "SecondDeviceName");
+
+ DeviceList second_adapter_devices;
+ second_adapter_devices.push_back(second_device.mac_address());
+
+ SetAddDeviceExpectations(second_mock_adapter.get(),
+ transport_adapter::DeviceType::IOS_USB,
+ second_adapter_devices,
+ second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(_)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ // Act
+ const auto uuid = "ABC-DEF-GHJ-KLM";
+ SwitchableDevices bt_switchables;
+ bt_switchables.insert(std::make_pair(dev_info_.mac_address(), uuid));
+ EXPECT_CALL(*mock_adapter_, GetSwitchableDevices())
+ .WillOnce(Return(bt_switchables));
+
+ SwitchableDevices usb_switchables;
+ usb_switchables.insert(std::make_pair(second_device.mac_address(), uuid));
+ EXPECT_CALL(*second_mock_adapter, GetSwitchableDevices())
+ .WillOnce(Return(usb_switchables));
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(mac_address_));
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(usb_serial));
+ EXPECT_CALL(mock_transport_manager_settings_, app_transport_change_timer())
+ .WillOnce(Return(timeout));
+ EXPECT_CALL(mock_transport_manager_settings_,
+ app_transport_change_timer_addition()).WillOnce(Return(0));
+
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(mac_address_, usb_serial));
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ // There is internal timer started on switching. Need to wait for timeout.
+ sleep(1);
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ TwoTransportAdapterAddSameDeviceSecondSkipped) {
+ device_list_.push_back(dev_info_.mac_address());
+
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_BT,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
+
+ DeviceInfo second_device =
+ ConstructDeviceInfo("MA:CA:DR:ES:S", "USB_IOS", "SecondDeviceName");
+
+ SetAddDeviceExpectations(second_mock_adapter.get(),
+ transport_adapter::DeviceType::IOS_USB,
+ device_list_,
+ second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest, NoDeviceTransportSwitchRequest_Fail) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_USB,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(mac_address_)).Times(0);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(mac_address_, mac_address_))
+ .Times(0);
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ UpdateDeviceList_RemoveDevices_TwoTransportAdapters_ExpectSuccess) {
+ // Arrange
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ device_list_.push_back(dev_info_.mac_address());
+ // Check before Act
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ // Act and Assert
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ const std::string mac_address("NE:WA:DR:ES:SS");
+ const std::string connection_type("TCP");
+ const std::string device_name("TestName");
+ const transport_manager::DeviceHandle device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ DeviceInfo second_device(
+ device_handle, mac_address, device_name, connection_type);
+ DeviceList device_list_2;
+ device_list_2.push_back(second_device.mac_address());
+ SetDeviceExpectations(second_mock_adapter, device_list_2, second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ SetOnDeviceExpectations(second_device);
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ device_list_.pop_back();
+ device_list_2.pop_back();
+
+ EXPECT_CALL(*second_mock_adapter, GetDeviceList())
+ .WillRepeatedly(Return(device_list_2));
+ EXPECT_CALL(*tm_listener_, OnDeviceRemoved(second_device));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ EXPECT_CALL(*mock_adapter_, GetDeviceList())
+ .WillRepeatedly(Return(device_list_));
+ EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(mock_adapter_);
+}
+
+TEST_F(TransportManagerImplTest, OnTransportConfigUpdated) {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ mock_adapter_,
+ "",
+ 0,
+ test_message_,
+ error_);
+
+ transport_adapter::TransportConfig config;
+ config[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ config[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string("192.168.1.1");
+ config[transport_manager::transport_adapter::tc_tcp_port] =
+ std::string("12345");
+
+ EXPECT_CALL(*mock_adapter_, GetTransportConfiguration())
+ .WillOnce(Return(config));
+
+ EXPECT_CALL(*tm_listener_, OnTransportConfigUpdated(config));
+ tm_.TestHandle(test_event);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index 51835c125a..98da4cf2ab 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -38,7 +38,9 @@ include_directories (
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/media_manager/include
${COMPONENTS_DIR}/protocol_handler/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src
)
# dbms
@@ -101,7 +103,7 @@ set(PATHS
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- # --- QDB Wrapper
+ # --- QDB Wrapper
add_subdirectory(./src/qdb_wrapper)
else ()
# --- SQLite Wrapper
@@ -109,14 +111,21 @@ else ()
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- list(APPEND LIBRARIES dl pthread ${RTLIB})
+ list(APPEND LIBRARIES dl pthread ${RTLIB})
endif()
add_library("Utils" ${SOURCES})
+GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_thread -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_date_time -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_filesystem -L${BOOST_LIBS_DIRECTORY})
target_link_libraries("Utils" ${LIBRARIES})
+add_dependencies("Utils" Boost)
+
if(ENABLE_LOG)
- add_dependencies("Utils" install-3rd_party_logger)
+ add_dependencies("Utils" install-3rd_party_logger Boost)
endif()
if(BUILD_TESTS)
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index 5862241c9c..e26fef34bb 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -33,16 +33,19 @@
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
-#include <string.h>
#include <stdint.h>
+#include <string.h>
+#include <fstream>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
+#include <time.h>
namespace file_system {
/**
- * @brief Get available disc space.
+ * @brief Get available disc space of directory. Returns 0 if the directory does
+ * not exist.
*
* @param path to directory
* @return free disc space.
@@ -50,22 +53,23 @@ namespace file_system {
uint64_t GetAvailableDiskSpace(const std::string& path);
/*
- * @brief Get size of current directory
+ * @brief Get size of given directory
*
* @param path to directory
+ * @return size of directory, return 0 if dir not exist
*/
size_t DirectorySize(const std::string& path);
/*
- * @brief Get size of current file
+ * @brief Get size of given file
*
* @param path to file
* @return size of file, return 0 if file not exist
*/
-int64_t FileSize(const std::string& path);
+uint64_t FileSize(const std::string& path);
/**
- * @brief Creates directory
+ * @brief Creates directory with owner_all permissions
* @param name path to directory
* @return path to created directory.
*/
@@ -79,129 +83,144 @@ std::string CreateDirectory(const std::string& name);
bool CreateDirectoryRecursively(const std::string& path);
/**
- * @brief Checks the file to see whether the file is a directory
- * @param name path to file
- * @return returns true if file is directory.
- */
+ * @brief Checks the file to see whether the file is a directory
+ * @param name path to file
+ * @return returns true if file is directory.
+ */
bool IsDirectory(const std::string& name);
/**
- * @brief Is directory exist
- * @param name path to directory
- * @return returns true if directory is exists.
- */
+ * @brief Does directory exist
+ * @param name path to directory
+ * @return returns true if the file exists and is a directory.
+ */
bool DirectoryExists(const std::string& name);
/**
- * @brief Is file exist
- * @param name path to file
- * @return returns true if file is exists.
- */
+ * @brief Does file exist
+ * @param name path to file
+ * @return returns true if the file exists.
+ */
bool FileExists(const std::string& name);
/**
- * @brief Writes to file
- *
- * @remark - create file if it doesn't exist
- * @param name path to file
- * @param data data to write
- * @return returns true if the operation is successfully.
- */
+ * @brief Writes to file
+ *
+ * @remark - create file if it doesn't exist
+ * @param name path to file
+ * @param data data to write
+ * @return returns true if the operation is successful.
+ */
bool Write(const std::string& file_name,
const std::vector<uint8_t>& data,
std::ios_base::openmode mode = std::ios_base::out);
/**
- * @brief Opens file stream for writing
- * @param file_name path to file to write data to
- * @return returns pointer to opened stream in case of success;
- * otherwise returns NULL
- */
+ * @brief Opens file stream for writing
+ * @param file_name path to file to write data to
+ * @return returns pointer to opened stream in case of success;
+ * otherwise returns NULL
+ */
std::ofstream* Open(const std::string& file_name,
std::ios_base::openmode mode = std::ios_base::out);
/**
- * @brief Writes to file stream
- * @param file_stream file stream to be written to
- * @param data data to be written to file
- * @param data_size size of data to be written to file
- * @return returns true if the operation is successfully.
- */
+ * @brief Writes to file stream
+ * @param file_stream file stream to be written to
+ * @param data data to be written to file
+ * @param data_size size of data to be written to file
+ * @return returns true if the operation is successful.
+ */
bool Write(std::ofstream* const file_stream,
const uint8_t* data,
uint32_t data_size);
/**
- * @brief Closes file stream
- * @param file_stream file stream to be closed
- */
+ * @brief Closes file stream
+ * @param file_stream file stream to be closed
+ */
void Close(std::ofstream* file_stream);
/**
- * @brief Returns current working directory path
- * If filename begins with "/", return unchanged filename
- * @param name file name
- * @return returns full file path.
- */
+ * @brief Returns current working directory path
+ * @return returns full file path.
+ */
std::string CurrentWorkingDirectory();
/**
- * @brief Allows to obtaine absolute path for certain path.
- * @param path the file name for which absolute path have to be calculated.
- * @return absolute path for certain path.
+ * @brief Convert a path to its absolute form.
+ * @param path the file name to convert.
+ * @return corresponding absolute path for a valid path, otherwise an empty
+ * string.
*/
std::string GetAbsolutePath(const std::string& path);
/**
- * @brief Removes file
- *
- * @param name path to file
- * @return returns true if the file is successfully deleted.
- */
+ * @brief Checks if file name contains invalid symbols e.g. '/'
+ * @param file_name file name to check
+ * @return true if file name does not contain any invalid symbol otherwise
+ * returns false
+ */
+bool IsFileNameValid(const std::string& file_name);
+
+/**
+ * @brief Removes file
+ *
+ * @param name path to file
+ * @return returns true if the file is successfully deleted.
+ */
bool DeleteFile(const std::string& name);
/**
+ * @brief Removes contents of directory but not directory itself
+ *
+ * @param directory_name path to directory.
+ */
+void remove_directory_content(const std::string& directory_name);
+
+/**
* @brief Removes directory.
*
- * @param name path to directory.
+ * @param directory_name path to directory.
* @param is_recursively true if you need delete directory recursively,
- *otherwise false.
+ * otherwise false. A non-empty directory with is_recursively == false will
+ * return false.
* @return returns true if the directory is successfully deleted.
*/
bool RemoveDirectory(const std::string& directory_name,
bool is_recursively = true);
/**
- * @brief Check access rights
- *
- * @param name path to file.
- * @param how Read/write attribute.
- * @return returns true if file has the given mode.
- */
+ * @brief Check access rights
+ *
+ * @param name path to file.
+ * @param how Read/write attribute.
+ * @return returns true if file has the given mode.
+ */
bool IsAccessible(const std::string& name, int32_t how);
/**
- * @brief Check access rights for writing
- *
- * @param name path to file or folder
- * @return returns true if has access rights.
- */
+ * @brief Check access rights for writing
+ *
+ * @param name path to file or folder
+ * @return returns true if has access rights.
+ */
bool IsWritingAllowed(const std::string& name);
/**
- * @brief Check access rights for reading
- *
- * @param name path to file.
- * @return returns true if file has access rights.
- */
+ * @brief Check access rights for reading
+ *
+ * @param name path to file.
+ * @return returns true if file has access rights.
+ */
bool IsReadingAllowed(const std::string& name);
/**
- * @brief Lists all files in given directory
- *
- * @param name path to directory.
- * @return returns list of files.
- */
+ * @brief Lists all files in given directory
+ *
+ * @param name path to directory.
+ * @return returns list of files.
+ */
std::vector<std::string> ListFiles(const std::string& directory_name);
/**
@@ -214,30 +233,30 @@ bool WriteBinaryFile(const std::string& name,
const std::vector<uint8_t>& contents);
/**
- * @brief Reads from file
- *
- * @param name path to file
- * @param result read data
- * @return returns true if the operation is successfully.
- */
+ * @brief Reads from file
+ *
+ * @param name path to file
+ * @param result read data
+ * @return returns true if the operation is successfully.
+ */
bool ReadBinaryFile(const std::string& name, std::vector<uint8_t>& result);
bool ReadFile(const std::string& name, std::string& result);
/**
- * @brief Convert special symbols in system path to percent-encoded
- *
- * @param name path to file
- * @return returns converted path.
-*/
+ * @brief Convert special symbols in system path to percent-encoded
+ *
+ * @param name path to file
+ * @return returns converted path.
+ */
const std::string ConvertPathForURL(const std::string& path);
/**
- * @brief Create empty file
- *
- * @param name path to file
- * @return if result success return true
-*/
+ * @brief Create empty file
+ *
+ * @param name path to file
+ * @return if result success return true
+ */
bool CreateFile(const std::string& path);
/**
@@ -245,28 +264,26 @@ bool CreateFile(const std::string& path);
* @param path Path to file
* @return Modification time in nanoseconds
*/
-uint64_t GetFileModificationTime(const std::string& path);
+time_t GetFileModificationTime(const std::string& path);
/**
- * @brief Copy file from source to destination
- *
- * @param src Source file path
- * @param dst Destination file path
- * @return if result success return true
-*/
+ * @brief Copy file from source to destination
+ *
+ * @param src Source file path
+ * @param dst Destination file path
+ * @return if result success return true
+ */
bool CopyFile(const std::string& src, const std::string& dst);
/**
- * @brief Move file from source to destination
- *
- * @param src Source file path
- * @param dst Destination file path
- * @return if result success return true
-*/
+ * @brief Move file from source to destination
+ *
+ * @param src Source file path
+ * @param dst Destination file path
+ * @return if result success return true
+ */
bool MoveFile(const std::string& src, const std::string& dst);
-void remove_directory_content(const std::string& directory_name);
-
} // namespace file_system
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index deea1a07c0..b20b43c251 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -56,16 +56,14 @@ typedef std::queue<LogMessage> LogMessageQueue;
typedef threads::MessageLoopThread<LogMessageQueue>
LogMessageLoopThreadTemplate;
-class LogMessageHandler : public LogMessageLoopThreadTemplate::Handler {
- public:
- virtual void Handle(const LogMessage message) OVERRIDE;
-};
-
-class LogMessageLoopThread : public LogMessageLoopThreadTemplate {
+class LogMessageLoopThread : public LogMessageLoopThreadTemplate,
+ public LogMessageLoopThreadTemplate::Handler {
public:
LogMessageLoopThread();
~LogMessageLoopThread();
+ void Handle(const LogMessage message) OVERRIDE;
+ private:
DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
};
diff --git a/src/components/utils/include/utils/optional.h b/src/components/utils/include/utils/optional.h
new file mode 100644
index 0000000000..0395945de0
--- /dev/null
+++ b/src/components/utils/include/utils/optional.h
@@ -0,0 +1,83 @@
+#ifndef ERROR_OR_H
+#define ERROR_OR_H
+#include <string>
+#include "utils/macro.h"
+
+namespace utils {
+
+/**
+ * @brief The Optional class is able to keep value, manage it it is empty and
+ * specify error code.
+ * Can be used as return value of function that is not guarantee that vaue will
+ * be returned
+ *
+ */
+template <typename ObjectType, typename ErrorType = std::string>
+class Optional {
+ public:
+ /**
+ * @brief The OptionalEmpty enum enum with one value to specify that Optional
+ * is not initialized
+ */
+ enum OptionalEmpty { EMPTY };
+
+ /**
+ * @brief Optional constructor with object initialization
+ * @param object object to initialize Optional
+ */
+ Optional(ObjectType& object)
+ : object_(&object), error_(), is_initialized_(true) {}
+
+ /**
+ * @brief Optional constructor with object and error initialization
+ * @param object object to initialize Optional
+ * @param error error code initialization
+ */
+ Optional(ObjectType& object, ErrorType error)
+ : object_(&object), error_(error), is_initialized_(true) {}
+
+ /**
+ * @brief Optional constructir without object initialization
+ * @param empty manadatory parameter for explicit specifying that Optional is
+ * empty
+ * @param error error code initialization
+ */
+ Optional(OptionalEmpty empty, ErrorType error)
+ : object_(nullptr), error_(error), is_initialized_(false) {}
+
+ /**
+ * @brief Optional empty optional initialization without specifying error code
+ * @param empty manadatory parameter for explicit specifying that Optional is
+ * empty
+ */
+ Optional(OptionalEmpty empty)
+ : object_(nullptr), error_(), is_initialized_(false) {}
+
+ /**
+ * @brief operator bool operator for checking if optional is initialized
+ */
+ operator bool() const {
+ return is_initialized_;
+ }
+
+ /**
+ * @brief operator * access to object
+ * @return
+ */
+ ObjectType& operator*() const {
+ DCHECK(is_initialized_);
+ return *object_;
+ }
+
+ ErrorType error() const {
+ return error_;
+ }
+
+ private:
+ ObjectType* object_;
+ ErrorType error_;
+ bool is_initialized_;
+};
+
+} // utils utils
+#endif // ERROR_OR_H
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 72d29a9e28..bda83f315f 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -38,11 +38,61 @@ typedef void (*sighandler_t)(int);
#else
#include <signal.h>
#endif
+#include "appMain/low_voltage_signals_handler.h"
namespace utils {
-bool UnsibscribeFromTermination();
-bool WaitTerminationSignals(sighandler_t sig_handler);
+class Signals {
+ public:
+ /**
+ * @brief Unsubscribe thread from termination signals SIGINT and SIGTERM
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromTermination();
+
+ /**
+ * @brief Triggers thread to wait for termination signals SIGINT and SIGTERM
+ * @param sig_handler - handler to work with signals specidied above
+ * @return True if handler handles signals successfuly, otherwise false
+ */
+ static bool WaitTerminationSignals(sighandler_t sig_handler);
+
+ /**
+ * @brief Unsubscribe thread from low voltage signals
+ * SIGLOWVOLTAGE, SIGWAKEUP and SIGIGNOFF
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data);
+
+ /**
+ * @brief Sends signal to specified process
+ * @param signal to send
+ * @param destination process signal to be sent to
+ */
+ static void SendSignal(const int signo, const pid_t pid);
+
+ /**
+ * @brief Creates child process
+ * @return created process id or -1 in case of error
+ */
+ static pid_t Fork();
+
+ /**
+ * @brief Wait for child process to be terminated
+ * @param cpid - process to wait for termination
+ * @param status store status information in the int to which it points
+ * @param options - options for exit form function
+ * detailed options can be found here: https://linux.die.net/man/2/waitpid
+ */
+ static void WaitPid(pid_t cpid, int* status, int options);
+
+ /**
+ * @brief Exits for process
+ * @param status - exit status code
+ */
+ static void ExitProcess(const int status);
+};
} // namespace utils
diff --git a/src/components/utils/include/utils/system_time_handler.h b/src/components/utils/include/utils/system_time_handler.h
new file mode 100644
index 0000000000..15b2dd0cca
--- /dev/null
+++ b/src/components/utils/include/utils/system_time_handler.h
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
+
+#include <time.h>
+
+namespace utils {
+
+/**
+ * @brief The SystemTimeListener interface.
+ * This interface allows to get notifications whenever
+ * system time appears or fails to appear.
+ */
+class SystemTimeListener {
+ public:
+ /**
+ * @brief OnSystemTimeArrived Notify about system time
+ * in utc format
+ * @param utc_time current system time.
+ */
+ virtual void OnSystemTimeArrived(const time_t utc_time) = 0;
+};
+
+/**
+ * @brief SystemTimeHandler the interface which provides the necessary
+ * public API to work with system time. The class does not implement
+ * any logic it's public api forwards call to the private virtual
+ * methods which are suppose to be defined within specific implementation.
+ */
+class SystemTimeHandler {
+ public:
+ /**
+ * @brief SystemTimeHandler creates an instance
+ * for this class.
+ */
+ SystemTimeHandler();
+
+ /**
+ * @brief QuerySystemTime provides the public interface
+ * to retrieve the system time. Interface uses private implementation
+ * hence the logic will be defined within descendant class.
+ */
+ void QuerySystemTime();
+
+ /**
+ * @brief SubscribeOnSystemTime allows to subscribe listener
+ * to the certain event. This class does not provide such storage.
+ * It rather uses private pure virtual function. So the final behaviour
+ * should be defined within the descendant class
+ */
+ void SubscribeOnSystemTime(SystemTimeListener* listener);
+
+ /**
+ * @brief UnsubscribeFromSystemTime allows to unsubscribe listener
+ * from the certain event. This class does not manipulate with storage.
+ * It rather uses private pure virtual function. So the final behaviour
+ * should be defined within the descendant class
+ */
+ void UnsubscribeFromSystemTime(SystemTimeListener* listener);
+
+ /**
+ * @brief GetUTCTime allows to obtain cached result for the
+ * GetSystemTime request
+ * @return utc time.
+ */
+ time_t GetUTCTime();
+
+ /**
+ * @brief Checks if system time is ready
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ bool system_time_can_be_received() const;
+
+ /**
+ * @brief ~SystemTimeHandler destroys the object
+ */
+ virtual ~SystemTimeHandler();
+
+ private:
+ /**
+ * @brief DoSystemTimeQuery responsible for the system time querying.
+ * It is up to implementator how exactly system is going to receive this time.
+ */
+ virtual void DoSystemTimeQuery() = 0;
+
+ /**
+ * @brief DoSubscribe implements the logic which allows to handle
+ * subscription process. The handling logic should be defined within
+ * descendant class.
+ */
+ virtual void DoSubscribe(SystemTimeListener* listener) = 0;
+
+ /**
+ * @brief DoUnsubscribe implements the logic which allows to handle
+ * unsubscription process. The handling logic should be defined within
+ * descendant class.
+ */
+ virtual void DoUnsubscribe(SystemTimeListener* listener) = 0;
+
+ /**
+ * @brief FetchSystemTime allows to obtain the cached result
+ * for the GetSystemTime request.
+ * @return utc time.
+ */
+ virtual time_t FetchSystemTime() = 0;
+
+ /**
+ * @brief Checks if UTC time is ready to provided by HMI
+ * and can be requested by GetSystemTime request
+ * @return True if HMI is ready to provide UTC time
+ * otherwise False
+ */
+ virtual bool utc_time_can_be_received() const = 0;
+};
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_TIME_HANDLER_H_
diff --git a/src/components/utils/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index ab3d48ef6f..e391db992c 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -218,7 +218,7 @@ class Timer {
mutable sync_primitives::Lock state_lock_;
- mutable std::auto_ptr<TimerDelegate> delegate_;
+ mutable std::unique_ptr<TimerDelegate> delegate_;
threads::Thread* thread_;
/**
diff --git a/src/components/utils/src/conditional_variable_boost.cc b/src/components/utils/src/conditional_variable_boost.cc
new file mode 100644
index 0000000000..a74aa3eaa6
--- /dev/null
+++ b/src/components/utils/src/conditional_variable_boost.cc
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/conditional_variable.h"
+
+#include <errno.h>
+#include <time.h>
+
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include <boost/exception/diagnostic_information.hpp>
+
+namespace {
+const long kNanosecondsPerSecond = 1000000000;
+const long kMillisecondsPerSecond = 1000;
+const long kNanosecondsPerMillisecond = 1000000;
+} // namespace
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+ConditionalVariable::ConditionalVariable() {}
+
+ConditionalVariable::~ConditionalVariable() {}
+
+void ConditionalVariable::NotifyOne() {
+ cond_var_.notify_one();
+}
+
+void ConditionalVariable::Broadcast() {
+ cond_var_.notify_all();
+}
+
+bool ConditionalVariable::Wait(BaseLock& lock) {
+ // NOTE this grossness is due to boost mutex and recursive mutex not sharing a
+ // superclass
+ try {
+ lock.AssertTakenAndMarkFree();
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ } else {
+ // unknown, give up the lock
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+ lock.AssertFreeAndMarkTaken();
+ } catch (const boost::exception& error) {
+ std::string error_string = boost::diagnostic_information(error);
+ LOG4CXX_FATAL(logger_, error_string);
+ NOTREACHED();
+ }
+ return true;
+}
+
+bool ConditionalVariable::Wait(AutoLock& auto_lock) {
+ BaseLock& lock = auto_lock.GetLock();
+ return Wait(lock);
+}
+
+ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
+ AutoLock& auto_lock, uint32_t milliseconds) {
+ BaseLock& lock = auto_lock.GetLock();
+
+ WaitStatus wait_status = kNoTimeout;
+ try {
+ lock.AssertTakenAndMarkFree();
+ bool timeout = true;
+
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ // cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::mutex>(
+ test_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ // cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::recursive_mutex>(
+ test_rec_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else {
+ // this is an unknown lock, we have an issue
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+
+ if (!timeout) {
+ wait_status = kTimeout;
+ }
+ lock.AssertFreeAndMarkTaken();
+ } catch (const boost::exception& error) {
+ std::string error_string = boost::diagnostic_information(error);
+ LOG4CXX_FATAL(logger_, error_string);
+ NOTREACHED();
+ }
+
+ return wait_status;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/conditional_variable_posix.cc b/src/components/utils/src/conditional_variable_posix.cc
deleted file mode 100644
index 50ebc74556..0000000000
--- a/src/components/utils/src/conditional_variable_posix.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#include "utils/conditional_variable.h"
-
-#include <errno.h>
-#include <time.h>
-
-#include "utils/lock.h"
-#include "utils/logger.h"
-
-namespace {
-const long kNanosecondsPerSecond = 1000000000;
-const long kMillisecondsPerSecond = 1000;
-const long kNanosecondsPerMillisecond = 1000000;
-}
-
-namespace sync_primitives {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-
-ConditionalVariable::ConditionalVariable() {
- pthread_condattr_t attrs;
- int initialized = pthread_condattr_init(&attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable attributes");
- pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC);
- initialized = pthread_cond_init(&cond_var_, &attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable");
- int rv = pthread_condattr_destroy(&attrs);
- if (rv != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to destroy "
- "conditional variable attributes");
-}
-
-ConditionalVariable::~ConditionalVariable() {
- pthread_cond_destroy(&cond_var_);
-}
-
-void ConditionalVariable::NotifyOne() {
- int signaled = pthread_cond_signal(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to signal conditional variable");
-}
-
-void ConditionalVariable::Broadcast() {
- int signaled = pthread_cond_broadcast(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to broadcast conditional variable");
-}
-
-bool ConditionalVariable::Wait(Lock& lock) {
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-bool ConditionalVariable::Wait(AutoLock& auto_lock) {
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
- AutoLock& auto_lock, uint32_t milliseconds) {
- struct timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
- timespec wait_interval;
- wait_interval.tv_sec = now.tv_sec + (milliseconds / kMillisecondsPerSecond);
- wait_interval.tv_nsec =
- now.tv_nsec +
- (milliseconds % kMillisecondsPerSecond) * kNanosecondsPerMillisecond;
- wait_interval.tv_sec += wait_interval.tv_nsec / kNanosecondsPerSecond;
- wait_interval.tv_nsec %= kNanosecondsPerSecond;
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int timedwait_status =
- pthread_cond_timedwait(&cond_var_, &lock.mutex_, &wait_interval);
- lock.AssertFreeAndMarkTaken();
- WaitStatus wait_status = kNoTimeout;
- switch (timedwait_status) {
- case 0: {
- wait_status = kNoTimeout;
- break;
- }
- case EINTR: {
- wait_status = kNoTimeout;
- break;
- }
- case ETIMEDOUT: {
- wait_status = kTimeout;
- break;
- }
- default: {
- LOG4CXX_ERROR(
- logger_,
- "Failed to timewait for conditional variable timedwait_status: "
- << timedwait_status);
- }
- }
- return wait_status;
-}
-
-} // namespace sync_primitives
diff --git a/src/components/utils/src/date_time.cc b/src/components/utils/src/date_time.cc
index fdf0926eb2..3ca6050b3f 100644
--- a/src/components/utils/src/date_time.cc
+++ b/src/components/utils/src/date_time.cc
@@ -30,94 +30,71 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/time.h>
-#include <stdint.h>
#include "utils/date_time.h"
-namespace date_time {
+#include <stdint.h>
+#include <sys/time.h>
+#include "boost/date_time/posix_time/posix_time.hpp"
-TimevalStruct DateTime::getCurrentTime() {
- TimevalStruct currentTime;
- timezone timeZone;
+namespace bpt = boost::posix_time;
+using namespace boost::date_time;
+namespace date_time {
- gettimeofday(&currentTime, &timeZone);
+/* Set of helper functions for the TimeDuration struct
+ */
- return currentTime;
+TimeDuration getCurrentTime() {
+ return bpt::microsec_clock::local_time() - bpt::from_time_t(0);
+}
+TimeDuration TimeDurationZero() {
+ return TimeDuration(0, 0, 0, 0);
+}
+int64_t getSecs(const TimeDuration& t) {
+ return t.total_seconds();
}
-int64_t date_time::DateTime::getSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec);
+int64_t getmSecs(const TimeDuration& t) {
+ return t.total_milliseconds();
}
-int64_t DateTime::getmSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND +
- times.tv_usec / MICROSECONDS_IN_MILLISECOND;
+int64_t getuSecs(const TimeDuration& t) {
+ return t.total_microseconds();
}
-int64_t DateTime::getuSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND *
- MICROSECONDS_IN_MILLISECOND +
- times.tv_usec;
+int64_t get_just_mSecs(const TimeDuration& t) {
+ return t.total_milliseconds() % MILLISECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeSpan(const TimevalStruct& sinceTime) {
- return calculateTimeDiff(getCurrentTime(), sinceTime);
+int64_t get_just_uSecs(const TimeDuration& t) {
+ return t.total_microseconds() % MICROSECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- if (Greater(times1, times2)) {
- ret = Sub(times1, times2);
- } else {
- ret = Sub(times2, times1);
- }
- return getmSecs(ret);
+int64_t calculateTimeSpan(const TimeDuration& sinceTime) {
+ return calculateTimeDiff(getCurrentTime(), sinceTime);
}
-void DateTime::AddMilliseconds(TimevalStruct& time, uint32_t milliseconds) {
- const uint32_t sec = milliseconds / MILLISECONDS_IN_SECOND;
- const uint32_t usec =
- (milliseconds % MILLISECONDS_IN_SECOND) * MICROSECONDS_IN_MILLISECOND;
- time.tv_sec += sec;
- time.tv_usec += usec;
- time = ConvertionUsecs(time);
+int64_t calculateTimeDiff(const TimeDuration& time1,
+ const TimeDuration& time2) {
+ return std::abs((time1 + -time2).total_milliseconds());
}
-TimevalStruct DateTime::Sub(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- timersub(&times1, &times2, &ret);
- return ret;
+void AddMilliseconds(TimeDuration& t, uint32_t milliseconds) {
+ t += bpt::milliseconds(milliseconds);
}
-bool DateTime::Greater(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, > );
+bool Greater(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 > time2;
}
-bool DateTime::Less(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, < );
+bool Less(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 < time2;
}
-bool DateTime::Equal(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return !timercmp(&times1, &times2, != );
+bool Equal(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 == time2;
}
-TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2) {
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2) {
if (Greater(time1, time2))
return GREATER;
if (Less(time1, time2))
@@ -125,28 +102,4 @@ TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
return EQUAL;
}
-TimevalStruct date_time::DateTime::ConvertionUsecs(const TimevalStruct& time) {
- if (time.tv_usec >= MICROSECONDS_IN_SECOND) {
- TimevalStruct time1;
- time1.tv_sec = static_cast<int64_t>(time.tv_sec) +
- (time.tv_usec / MICROSECONDS_IN_SECOND);
- time1.tv_usec = static_cast<int64_t>(time.tv_usec) % MICROSECONDS_IN_SECOND;
- return time1;
- }
- return time;
-}
-
} // namespace date_time
-
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Less(time1, time2);
-}
-
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Equal(time1, time2);
-}
-
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- return date_time::DateTime::Sub(time1, time2);
-}
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 91ff0c3b07..f98aeda056 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -33,130 +33,114 @@
#include "utils/file_system.h"
#include "utils/logger.h"
-#include <sys/statvfs.h>
#include <sys/stat.h>
+#include <sys/statvfs.h>
#include <sys/types.h>
#include <sstream>
#include <dirent.h>
#include <unistd.h>
// TODO(VS): lint error: Streams are highly discouraged.
-#include <fstream>
+#include <algorithm>
+#include <boost/filesystem.hpp>
#include <cstddef>
#include <cstdio>
-#include <algorithm>
+#include <fstream>
CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+// Easier reference
+namespace fs = boost::filesystem;
+using boost::system::error_code;
+
uint64_t file_system::GetAvailableDiskSpace(const std::string& path) {
- struct statvfs fsInfo = {0};
- if (statvfs(path.c_str(), &fsInfo) == 0) {
- return fsInfo.f_bsize * fsInfo.f_bfree;
- } else {
+ error_code ec;
+ fs::space_info si = fs::space(path, ec);
+
+ if (ec) {
+ // If something went wrong, assume no free space
return 0;
+ } else {
+ return si.free;
}
}
-int64_t file_system::FileSize(const std::string& path) {
- if (file_system::FileExists(path)) {
- struct stat file_info = {0};
- stat(path.c_str(), &file_info);
- return file_info.st_size;
+uint64_t file_system::FileSize(const std::string& path) {
+ error_code ec;
+ // Boost returns sizes as unsigned
+ uint64_t fsize = (uint64_t)fs::file_size(path, ec);
+
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file size: " << path);
+ return 0;
}
- return 0;
+ return fsize;
}
size_t file_system::DirectorySize(const std::string& path) {
- size_t size = 0;
- int32_t return_code = 0;
- DIR* directory = NULL;
-
-#ifndef __QNXNTO__
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer = new char[offsetof(struct dirent, d_name) +
- pathconf(path.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
- struct dirent* result = NULL;
- struct stat file_info = {0};
- directory = opendir(path.c_str());
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
- std::string full_element_path = path + "/" + result->d_name;
- if (file_system::IsDirectory(full_element_path)) {
- size += DirectorySize(full_element_path);
- } else {
- stat(full_element_path.c_str(), &file_info);
- size += file_info.st_size;
- }
+ size_t dir_size = 0;
+ error_code ec;
+ // Recursively iterate through directory to accumulate file sizes
+ fs::recursive_directory_iterator iter(path, ec);
+ // Directory does not exist
+ if (ec) {
+ return 0;
+ }
+ // default constructor gives end iterator
+ fs::recursive_directory_iterator end;
+ while (iter != end) {
+ size_t fsize = fs::file_size(iter->path(), ec);
+ // No error means we can add the file
+ if (!ec) {
+ dir_size += fsize;
}
+ iter++; // next entry
}
- closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
- return size;
+ return dir_size;
}
+// NOTE that boost makes 0777 permissions by default
std::string file_system::CreateDirectory(const std::string& name) {
- if (!DirectoryExists(name)) {
- mkdir(name.c_str(), S_IRWXU);
+ error_code ec;
+ bool success = fs::create_directory(name, ec);
+ if (!success || ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to create directory: " << name);
+ } else {
+ // Set 0700 permissions to maintain previous API
+ fs::permissions(name, fs::perms::owner_all, ec);
}
-
return name;
}
bool file_system::CreateDirectoryRecursively(const std::string& path) {
- size_t pos = 0;
- bool ret_val = true;
-
- while (ret_val == true && pos <= path.length()) {
- pos = path.find('/', pos + 1);
- if (!DirectoryExists(path.substr(0, pos))) {
- if (0 != mkdir(path.substr(0, pos).c_str(), S_IRWXU)) {
- ret_val = false;
- }
- }
- }
-
- return ret_val;
-}
+ error_code ec;
+ // Create directory and all parents
+ fs::create_directories(path, ec);
-bool file_system::IsDirectory(const std::string& name) {
- struct stat status = {0};
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_,
+ "Unable to create directory recursively: "
+ << path << " reason: " << ec.message());
- if (-1 == stat(name.c_str(), &status)) {
return false;
}
-
- return S_ISDIR(status.st_mode);
+ // return true if we made something or if it already existed
+ return true;
}
+bool file_system::IsDirectory(const std::string& name) {
+ error_code ec;
+ return fs::is_directory(name, ec);
+}
+// NOTE this may be a duplicate of IsDirectory since it already checks
+// existence
bool file_system::DirectoryExists(const std::string& name) {
- struct stat status = {0};
-
- if (-1 == stat(name.c_str(), &status) || !S_ISDIR(status.st_mode)) {
- return false;
- }
-
- return true;
+ return FileExists(name) && IsDirectory(name);
}
bool file_system::FileExists(const std::string& name) {
- struct stat status = {0};
-
- if (-1 == stat(name.c_str(), &status)) {
- return false;
- }
- return true;
+ error_code ec;
+ return fs::exists(name, ec);
}
bool file_system::Write(const std::string& file_name,
@@ -205,83 +189,75 @@ void file_system::Close(std::ofstream* file_stream) {
}
std::string file_system::CurrentWorkingDirectory() {
- const size_t filename_max_length = 1024;
- char path[filename_max_length];
- if (0 == getcwd(path, filename_max_length)) {
+ error_code ec;
+ fs::path currpath = fs::current_path(ec);
+ if (ec) {
LOG4CXX_WARN(logger_, "Could not get CWD");
}
- return std::string(path);
+ return currpath.string();
}
std::string file_system::GetAbsolutePath(const std::string& path) {
- char abs_path[PATH_MAX];
- if (NULL == realpath(path.c_str(), abs_path)) {
- return std::string();
+ error_code ec;
+ fs::path absolute = fs::canonical(path, ec);
+ if (ec) {
+ return std::string(); // invalid path
}
+ return absolute.string();
+}
- return std::string(abs_path);
+bool file_system::IsFileNameValid(const std::string& file_name) {
+ return file_name.end() == std::find(file_name.begin(), file_name.end(), '/');
}
+// Does not remove if file is write-protected
bool file_system::DeleteFile(const std::string& name) {
if (FileExists(name) && IsAccessible(name, W_OK)) {
- return !remove(name.c_str());
+ error_code ec;
+ bool success = fs::remove(name.c_str(), ec);
+ return success && !ec;
}
return false;
}
void file_system::remove_directory_content(const std::string& directory_name) {
- int32_t return_code = 0;
- DIR* directory = NULL;
-#ifndef __QNXNTO__
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
- struct dirent* result = NULL;
-
- directory = opendir(directory_name.c_str());
-
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
-
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
-
- std::string full_element_path = directory_name + "/" + result->d_name;
-
- if (file_system::IsDirectory(full_element_path)) {
- remove_directory_content(full_element_path);
- rmdir(full_element_path.c_str());
- } else {
- remove(full_element_path.c_str());
- }
- }
+ error_code ec;
+ fs::directory_iterator dir_iter(directory_name, ec);
+
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_,
+ "Unable to empty directory: " << directory_name);
}
- closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
+ // According to Boost's documentation, removing shouldn't invalidate the
+ // iterator, although it may cause the removed entry to appear again,
+ // duplicating the warning message. See here:
+ // https://www.boost.org/doc/libs/1_67_0/libs/filesystem/doc/reference.html#Class-directory_iterator
+ for (auto& dirent : dir_iter) {
+ fs::remove_all(dirent, ec);
+ if (ec) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Unable to remove file: " << dirent.path().string());
+ }
+ }
}
bool file_system::RemoveDirectory(const std::string& directory_name,
bool is_recursively) {
- if (DirectoryExists(directory_name) && IsAccessible(directory_name, W_OK)) {
- if (is_recursively) {
- remove_directory_content(directory_name);
- }
-
- return !rmdir(directory_name.c_str());
+ // Make sure the directory exists
+ if (!DirectoryExists(directory_name) && IsAccessible(directory_name, W_OK)) {
+ return false;
}
- return false;
+ error_code ec;
+ bool success;
+ // If recursive, just force full remove
+ if (is_recursively) {
+ success = (fs::remove_all(directory_name, ec) != 0);
+ } else {
+ // Otherwise try to remove
+ success = fs::remove(directory_name, ec);
+ }
+ return success && !ec;
}
bool file_system::IsAccessible(const std::string& name, int32_t how) {
@@ -298,45 +274,20 @@ bool file_system::IsReadingAllowed(const std::string& name) {
std::vector<std::string> file_system::ListFiles(
const std::string& directory_name) {
+ error_code ec;
+
+ fs::directory_iterator dir_iter(directory_name, ec);
std::vector<std::string> listFiles;
- if (!DirectoryExists(directory_name)) {
+
+ // In case the directory doesn't exist / can't be read, second check may be
+ // redundant
+ if (ec || !DirectoryExists(directory_name)) {
return listFiles;
}
- int32_t return_code = 0;
- DIR* directory = NULL;
-#ifndef __QNXNTO__
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
- struct dirent* result = NULL;
-
- directory = opendir(directory_name.c_str());
- if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
-
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
- if (0 == strcmp(result->d_name, "..") ||
- 0 == strcmp(result->d_name, ".")) {
- continue;
- }
-
- listFiles.push_back(std::string(result->d_name));
- }
-
- closedir(directory);
+ for (auto& dirent : dir_iter) {
+ listFiles.push_back(dirent.path().filename().string());
}
-
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
-
return listFiles;
}
@@ -409,49 +360,42 @@ bool file_system::CreateFile(const std::string& path) {
}
}
-uint64_t file_system::GetFileModificationTime(const std::string& path) {
- struct stat info;
- stat(path.c_str(), &info);
-#ifndef __QNXNTO__
- return static_cast<uint64_t>(info.st_mtim.tv_nsec);
-#else
- return static_cast<uint64_t>(info.st_mtime);
-#endif
+time_t file_system::GetFileModificationTime(const std::string& path) {
+ error_code ec;
+ std::time_t time = fs::last_write_time(path, ec);
+ if (ec) {
+ return 0;
+ }
+ return time;
}
bool file_system::CopyFile(const std::string& src, const std::string& dst) {
if (!FileExists(src) || FileExists(dst) || !CreateFile(dst)) {
return false;
}
- std::vector<uint8_t> data;
- if (!ReadBinaryFile(src, data) || !WriteBinaryFile(dst, data)) {
- DeleteFile(dst);
+ error_code ec;
+ fs::copy_file(src, dst, ec);
+ if (ec) {
+ // something failed
return false;
}
return true;
}
bool file_system::MoveFile(const std::string& src, const std::string& dst) {
+ error_code ec;
+
if (std::rename(src.c_str(), dst.c_str()) == 0) {
return true;
- } else {
- // In case of src and dst on different file systems std::rename returns
- // an error (at least on QNX).
- // Seems, streams are not recommended for use, so have
- // to find another way to do this.
- std::ifstream s_src(src, std::ios::binary);
- if (!s_src.good()) {
- return false;
- }
- std::ofstream s_dst(dst, std::ios::binary);
- if (!s_dst.good()) {
- return false;
- }
- s_dst << s_src.rdbuf();
- s_dst.close();
- s_src.close();
- DeleteFile(src);
- return true;
}
- return false;
+ // In case of src and dst on different file systems std::rename returns
+ // an error (at least on QNX).
+ // Instead, copy the file over and delete the old one
+ bool success = CopyFile(src, dst);
+ if (!success) {
+ return false;
+ }
+ DeleteFile(src);
+
+ return true;
}
diff --git a/src/components/utils/src/lock_boost.cc b/src/components/utils/src/lock_boost.cc
new file mode 100644
index 0000000000..2299bcf77d
--- /dev/null
+++ b/src/components/utils/src/lock_boost.cc
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <cstring>
+#include "utils/lock.h"
+#include "utils/logger.h"
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+Lock::Lock() : lock_taken_(0) {}
+
+Lock::~Lock() {
+ if (lock_taken_ > 0) {
+ LOG4CXX_FATAL(logger_, "Destroying non-released regular mutex " << &mutex_);
+ }
+}
+
+void Lock::Acquire() {
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
+}
+
+void Lock::Release() {
+ AssertTakenAndMarkFree();
+ mutex_.unlock();
+}
+
+bool Lock::Try() {
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
+ }
+ return status;
+}
+
+void Lock::AssertFreeAndMarkTaken() {
+ if (lock_taken_ != 0) {
+ LOG4CXX_FATAL(logger_, "Locking already taken not recursive mutex");
+ NOTREACHED();
+ }
+ lock_taken_++;
+}
+
+void Lock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_FATAL(logger_, "Unlocking a mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
+}
+
+// Recursive lock looks the same on the surface, some code duplication is
+// necessary since they don't have a shared parent superclass
+RecursiveLock::RecursiveLock() : lock_taken_(0) {}
+
+RecursiveLock::~RecursiveLock() {
+ if (lock_taken_ > 0) {
+ LOG4CXX_FATAL(logger_,
+ "Destroying non-released recursive mutex " << &mutex_);
+ }
+}
+
+void RecursiveLock::Acquire() {
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
+}
+
+void RecursiveLock::Release() {
+ AssertTakenAndMarkFree();
+ mutex_.unlock();
+}
+
+bool RecursiveLock::Try() {
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
+ }
+ return status;
+}
+
+void RecursiveLock::AssertFreeAndMarkTaken() {
+ lock_taken_++;
+}
+
+void RecursiveLock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_FATAL(logger_, "Unlocking a recursive mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc
deleted file mode 100644
index 9b90ad20b9..0000000000
--- a/src/components/utils/src/lock_posix.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "utils/lock.h"
-#include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <cstring>
-#include "utils/logger.h"
-
-namespace sync_primitives {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-
-Lock::Lock()
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(false)
-#endif // NDEBUG
-{
- Init(false);
-}
-
-Lock::Lock(bool is_recursive)
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(is_recursive)
-#endif // NDEBUG
-{
- Init(is_recursive);
-}
-
-Lock::~Lock() {
-#ifndef NDEBUG
- if (lock_taken_ > 0) {
- LOG4CXX_ERROR(logger_, "Destroying non-released mutex " << &mutex_);
- }
-#endif
- int32_t status = pthread_mutex_destroy(&mutex_);
- if (status != 0) {
- LOG4CXX_ERROR(logger_,
- "Failed to destroy mutex " << &mutex_ << ": "
- << strerror(status));
- }
-}
-
-void Lock::Acquire() {
- const int32_t status = pthread_mutex_lock(&mutex_);
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to acquire mutex " << &mutex_ << ": "
- << strerror(status));
- NOTREACHED();
- } else {
- AssertFreeAndMarkTaken();
- }
-}
-
-void Lock::Release() {
- AssertTakenAndMarkFree();
- const int32_t status = pthread_mutex_unlock(&mutex_);
- if (status != 0) {
- LOG4CXX_ERROR(logger_,
- "Failed to unlock mutex" << &mutex_ << ": "
- << strerror(status));
- }
-}
-
-bool Lock::Try() {
- const int32_t status = pthread_mutex_trylock(&mutex_);
- if (status == 0) {
-#ifndef NDEBUG
- lock_taken_++;
-#endif
- return true;
- }
- return false;
-}
-
-#ifndef NDEBUG
-void Lock::AssertFreeAndMarkTaken() {
- if ((lock_taken_ > 0) && !is_mutex_recursive_) {
- LOG4CXX_ERROR(logger_, "Locking already taken not recursive mutex");
- NOTREACHED();
- }
- lock_taken_++;
-}
-void Lock::AssertTakenAndMarkFree() {
- if (lock_taken_ == 0) {
- LOG4CXX_ERROR(logger_, "Unlocking a mutex that is not taken");
- NOTREACHED();
- }
- lock_taken_--;
-}
-#endif
-
-void Lock::Init(bool is_recursive) {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
-
- const int32_t mutex_type =
- is_recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_ERRORCHECK;
-
- pthread_mutexattr_settype(&attr, mutex_type);
- const int32_t status = pthread_mutex_init(&mutex_, &attr);
-
- pthread_mutexattr_destroy(&attr);
-
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to initialize mutex. " << std::strerror(status));
- DCHECK(status != 0);
- }
-}
-
-} // namespace sync_primitives
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
index 77bc8107eb..182eb64534 100644
--- a/src/components/utils/src/log_message_loop_thread.cc
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -35,7 +35,7 @@
namespace logger {
-void LogMessageHandler::Handle(const LogMessage message) {
+void LogMessageLoopThread::Handle(const LogMessage message) {
message.logger->forcedLog(message.level,
message.entry,
message.timeStamp,
@@ -44,12 +44,13 @@ void LogMessageHandler::Handle(const LogMessage message) {
}
LogMessageLoopThread::LogMessageLoopThread()
- : LogMessageLoopThreadTemplate("Logger", new LogMessageHandler()) {}
+ : LogMessageLoopThreadTemplate("Logger", this) {}
LogMessageLoopThread::~LogMessageLoopThread() {
// we'll have to drop messages
// while deleting logger thread
logger_status = DeletingLoggerThread;
+ LogMessageLoopThreadTemplate::Shutdown();
}
} // namespace logger
diff --git a/src/components/utils/src/logger.cc b/src/components/utils/src/logger.cc
index 4e93ca3d14..af21aeac77 100644
--- a/src/components/utils/src/logger.cc
+++ b/src/components/utils/src/logger.cc
@@ -39,6 +39,9 @@ void deinit_logger() {
CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
LOG4CXX_DEBUG(logger_, "Logger deinitialization");
logger::set_logs_enabled(false);
+ if (logger::logger_status == logger::LoggerThreadCreated) {
+ logger::flush_logger();
+ }
logger::delete_log_message_loop_thread();
log4cxx::LoggerPtr rootLogger = log4cxx::Logger::getRootLogger();
log4cxx::spi::LoggerRepositoryPtr repository =
diff --git a/src/components/utils/src/semantic_version.cc b/src/components/utils/src/semantic_version.cc
new file mode 100644
index 0000000000..4b8d37b913
--- /dev/null
+++ b/src/components/utils/src/semantic_version.cc
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018, Livio
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/semantic_version.h"
+
+namespace utils {
+
+const SemanticVersion version_4_5(4, 5, 0);
+
+} // namespace utils \ No newline at end of file
diff --git a/src/components/utils/src/signals_posix.cc b/src/components/utils/src/signals_posix.cc
index 274c254716..e13dc04f40 100644
--- a/src/components/utils/src/signals_posix.cc
+++ b/src/components/utils/src/signals_posix.cc
@@ -29,13 +29,16 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/wait.h>
#include <csignal>
#include <cstdlib>
#include <stdint.h>
+#include <iostream>
#include "utils/signals.h"
-bool utils::UnsibscribeFromTermination() {
+namespace utils {
+bool Signals::UnsubscribeFromTermination() {
// Disable some system signals receiving in thread
// by blocking those signals
// (system signals processes only in the main thread)
@@ -51,6 +54,42 @@ bool utils::UnsibscribeFromTermination() {
return !pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
}
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ // Disable Low Voltage signals in main thread
+ // due to all further threads will inherit signals mask
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ const int SIGLOWVOLTAGE = SIGRTMIN + offset_data.low_voltage_signal_offset;
+ const int SIGWAKEUP = SIGRTMIN + offset_data.wake_up_signal_offset;
+ const int SIGIGNOFF = SIGRTMIN + offset_data.ignition_off_signal_offset;
+ sigaddset(&signal_set, SIGLOWVOLTAGE);
+ sigaddset(&signal_set, SIGWAKEUP);
+ sigaddset(&signal_set, SIGIGNOFF);
+
+ // Set signals mask to be blocked by thread
+ return !pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ if (kill(pid, signo) == -1) {
+ std::cerr << "Error sending signal: " << strsignal(signo) << " to " << pid
+ << " .Error: " << strerror(errno) << std::endl;
+ }
+}
+
+pid_t Signals::Fork() {
+ return fork();
+}
+
+void Signals::ExitProcess(const int status) {
+ exit(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ waitpid(cpid, status, options);
+}
+
namespace {
bool CatchSIGSEGV(sighandler_t handler) {
struct sigaction act;
@@ -63,7 +102,7 @@ bool CatchSIGSEGV(sighandler_t handler) {
}
} // namespace
-bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
sigset_t signal_set;
int sig = -1;
@@ -81,3 +120,4 @@ bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
}
return false;
}
+} // namespace utils
diff --git a/src/components/utils/src/system_time_handler.cc b/src/components/utils/src/system_time_handler.cc
new file mode 100644
index 0000000000..0c3c62cc53
--- /dev/null
+++ b/src/components/utils/src/system_time_handler.cc
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/system_time_handler.h"
+
+namespace utils {
+
+SystemTimeHandler::SystemTimeHandler() {}
+
+SystemTimeHandler::~SystemTimeHandler() {}
+
+void SystemTimeHandler::QuerySystemTime() {
+ DoSystemTimeQuery();
+}
+
+void SystemTimeHandler::SubscribeOnSystemTime(SystemTimeListener* listener) {
+ DoSubscribe(listener);
+}
+
+void SystemTimeHandler::UnsubscribeFromSystemTime(
+ SystemTimeListener* listener) {
+ DoUnsubscribe(listener);
+}
+
+time_t SystemTimeHandler::GetUTCTime() {
+ return FetchSystemTime();
+}
+
+bool SystemTimeHandler::system_time_can_be_received() const {
+ return utc_time_can_be_received();
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/threads/thread_delegate.cc b/src/components/utils/src/threads/thread_delegate.cc
index 7bdce000da..917603f92c 100644
--- a/src/components/utils/src/threads/thread_delegate.cc
+++ b/src/components/utils/src/threads/thread_delegate.cc
@@ -52,6 +52,7 @@ void ThreadDelegate::exitThreadMain() {
} else {
pthread_cancel(thread_->thread_handle());
}
+ thread_ = NULL;
}
}
diff --git a/src/components/utils/src/timer.cc b/src/components/utils/src/timer.cc
index 642f16e574..b819b56f54 100644
--- a/src/components/utils/src/timer.cc
+++ b/src/components/utils/src/timer.cc
@@ -64,7 +64,7 @@ timer::Timer::~Timer() {
StopDelegate();
single_shot_ = true;
- delegate_.release();
+ delegate_.reset();
DeleteThread(thread_);
DCHECK(task_);
delete task_;
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index 3dd6383588..f01dad8d58 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -30,57 +30,70 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <ctime>
#include <stdlib.h>
-
-#include "gtest/gtest.h"
-
+#include <ctime>
+#include <memory>
#include "utils/lock.h"
-#include "utils/conditional_variable.h"
#include "utils/threads/async_runner.h"
+#include "utils/conditional_variable.h"
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
-namespace utils_test {
+namespace utils {
-using namespace sync_primitives;
using namespace threads;
namespace {
-uint32_t check_value = 0;
+size_t kCheckValue = 0u;
+const size_t kDelegatesAmount = 4u;
}
// ThreadDelegate successor
class TestThreadDelegate : public ThreadDelegate {
public:
+ TestThreadDelegate(sync_primitives::ConditionalVariable& cond_var,
+ sync_primitives::Lock& test_lock)
+ : cond_var_(cond_var), test_lock_(test_lock) {}
+
void threadMain() {
- ++check_value;
+ sync_primitives::AutoLock lock(test_lock_);
+ ++kCheckValue;
+ cond_var_.NotifyOne();
}
+
+ protected:
+ sync_primitives::ConditionalVariable& cond_var_;
+ sync_primitives::Lock& test_lock_;
+};
+
+class MockThreadDelegate : public ThreadDelegate {
+ public:
+ MOCK_METHOD0(threadMain, void());
+ MOCK_METHOD0(exitThreadMain, void());
};
class AsyncRunnerTest : public ::testing::Test {
public:
- AsyncRunnerTest() : kDelegatesNum_(1), asr_pt_(NULL) {
+ AsyncRunnerTest() {
+ // Clear global value before test execution
+ kCheckValue = 0;
CreateAsyncRunner();
CreateThreadsArray();
}
~AsyncRunnerTest() {
- DeleteAsyncRunner();
DeleteThreadsArray();
}
protected:
- Lock test_lock_;
- uint32_t kDelegatesNum_;
- ConditionalVariable cond_var_;
- TestThreadDelegate** delegates_;
- AsyncRunner* asr_pt_;
+ ThreadDelegate** delegates_;
+ std::shared_ptr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
- srand(std::time(NULL));
- kDelegatesNum_ = (rand() % 20 + 1);
- delegates_ = new TestThreadDelegate* [kDelegatesNum_];
+ delegates_ = new ThreadDelegate* [kDelegatesAmount];
}
void DeleteThreadsArray() {
@@ -88,53 +101,38 @@ class AsyncRunnerTest : public ::testing::Test {
}
void CreateAsyncRunner() {
- asr_pt_ = new AsyncRunner("test");
- }
- void DeleteAsyncRunner() {
- delete asr_pt_;
+ async_runner_ = std::make_shared<AsyncRunner>("test");
}
};
TEST_F(AsyncRunnerTest, ASyncRunManyDelegates_ExpectSuccessfulAllDelegatesRun) {
- AutoLock lock(test_lock_);
- // Clear global value before test
- check_value = 0;
// Create Delegates and run
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- delegates_[i] = new TestThreadDelegate();
- asr_pt_->AsyncRun(delegates_[i]);
+ sync_primitives::ConditionalVariable cond_var;
+ sync_primitives::Lock test_lock;
+ for (size_t i = 0; i < kDelegatesAmount; ++i) {
+ sync_primitives::AutoLock lock(test_lock);
+ delegates_[i] = new TestThreadDelegate(cond_var, test_lock);
+ async_runner_->AsyncRun(delegates_[i]);
+ // Wait for delegate to be run
+ cond_var.WaitFor(lock, 1500);
}
- // Wait for 2 secs. Give this time to delegates to be run
- cond_var_.WaitFor(lock, 2000);
- // Expect all delegates run successfully
- EXPECT_EQ(kDelegatesNum_, check_value);
+ // Expect all delegates started successfully
+ EXPECT_EQ(kDelegatesAmount, kCheckValue);
}
-// TODO(VVeremjova) APPLINK-12834 Sometimes delegates do not run
-TEST_F(AsyncRunnerTest,
- DISABLED_RunManyDelegatesAndStop_ExpectSuccessfulDelegatesStop) {
- AutoLock lock(test_lock_);
- // Clear global value before test
- check_value = 0;
- // Create Delegates
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- delegates_[i] = new TestThreadDelegate();
- }
- // Wait for 2 secs
- cond_var_.WaitFor(lock, 2000);
- // Run created delegates
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- if (kDelegatesNum_ > 1) {
- if (i == kDelegatesNum_ / 2) {
- asr_pt_->Stop();
- }
- }
- asr_pt_->AsyncRun(delegates_[i]);
+TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) {
+ // Create Delegate mock
+ MockThreadDelegate mock_thread_delegate;
+ // Check that delegate was not started due to Stop() called before AsyncRun()
+ EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0);
+ {
+ std::shared_ptr<AsyncRunner> async_runner =
+ std::make_shared<AsyncRunner>("test");
+ async_runner->Stop();
+ async_runner->AsyncRun(&mock_thread_delegate);
}
- // Expect 3 delegates run successlully. The other stopped.
- EXPECT_EQ(kDelegatesNum_ / 2, check_value);
}
-} // namespace utils_test
+} // namespace utils
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/atomic_object_test.cc b/src/components/utils/test/atomic_object_test.cc
deleted file mode 100644
index 44975fd004..0000000000
--- a/src/components/utils/test/atomic_object_test.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "utils/atomic_object.h"
-#include "gtest/gtest.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-TEST(AtomicObjectTest, Construct) {
- sync_primitives::atomic_int var(5);
- EXPECT_EQ(5, var);
-
- var = 8;
- EXPECT_EQ(8, var);
-
- sync_primitives::atomic_bool flag = true;
-
- EXPECT_TRUE(flag == true);
-
- flag = false;
- EXPECT_FALSE(flag == true);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
index 86c9dfa2e0..1ef29685e6 100644
--- a/src/components/utils/test/conditional_variable_test.cc
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <iostream>
#include <pthread.h>
+#include <iostream>
#include "gtest/gtest.h"
+#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/macro.h"
-#include "utils/conditional_variable.h"
namespace test {
namespace components {
@@ -61,8 +61,8 @@ class ConditionalVariableTest : public ::testing::Test {
protected:
std::string test_value_;
- sync_primitives::ConditionalVariable cond_var_;
sync_primitives::Lock test_mutex_;
+ sync_primitives::ConditionalVariable cond_var_;
unsigned counter_;
};
@@ -102,6 +102,7 @@ TEST_F(ConditionalVariableTest,
cond_var_.WaitFor(test_lock, 2000);
std::string last_value("changed again by thread 1");
EXPECT_EQ(last_value, test_value_);
+ pthread_join(thread1, NULL);
}
TEST_F(ConditionalVariableTest,
@@ -116,6 +117,8 @@ TEST_F(ConditionalVariableTest,
ASSERT_FALSE(thread_created) << "thread2 is not created!";
check_counter();
EXPECT_EQ(2u, counter_);
+ pthread_join(thread1, NULL);
+ pthread_join(thread2, NULL);
}
TEST_F(
@@ -123,7 +126,7 @@ TEST_F(
CheckWaitForWithTimeout1sec_ThreadBlockedForTimeout_ExpectSuccessfulWakeUp) {
sync_primitives::AutoLock test_lock(test_mutex_);
sync_primitives::ConditionalVariable::WaitStatus wait_st =
- cond_var_.WaitFor(test_lock, 1000);
+ cond_var_.WaitFor(test_lock, 10);
EXPECT_EQ(sync_primitives::ConditionalVariable::kTimeout, wait_st);
}
diff --git a/src/components/utils/test/data_accessor_test.cc b/src/components/utils/test/data_accessor_test.cc
index c7c728b676..24b7bab282 100644
--- a/src/components/utils/test/data_accessor_test.cc
+++ b/src/components/utils/test/data_accessor_test.cc
@@ -41,7 +41,8 @@ namespace utils_test {
TEST(DataAccessorTest, CreateDataAccessor) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
int data_from_testdata = testdata.GetData();
@@ -52,17 +53,19 @@ TEST(DataAccessorTest, CreateDataAccessor) {
TEST(DataAccessorTest, CreateDataAccessor_MutexIsLocked_CannotLockItAgain) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
TEST(DataAccessorTest, CopyDataAccessor_GetDataFromDataAccessors) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
DataAccessor<int> testdata_copy(testdata);
@@ -72,14 +75,15 @@ TEST(DataAccessorTest, CopyDataAccessor_GetDataFromDataAccessors) {
// assert
EXPECT_EQ(data_from_testdata, data_from_testdata_copy);
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
TEST(DataAccessorTest,
ChangedDataInDataAccessor_ChangeData_DataInDataAccessorIsChanged) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
DataAccessor<int> testdata(test_value, testSet_lock_);
test_value = 0;
@@ -93,40 +97,42 @@ TEST(DataAccessorTest,
DeleteDataAccessor_CreatedOneDeleteOneThread_MutexIsUnlocked) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
{
DataAccessor<int> testdata(test_value, testSet_lock_);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_TRUE(testSet_lock_.Try());
+ EXPECT_TRUE(testSet_lock_->Try());
- testSet_lock_.Release();
+ testSet_lock_->Release();
}
TEST(DataAccessorTest,
DeleteDataAccessor_CreatedThreadAndCopyDeleteBothThreads_MutexIsUnlocked) {
// arrange
int test_value = 10;
- sync_primitives::Lock testSet_lock_;
+ std::shared_ptr<sync_primitives::Lock> testSet_lock_ =
+ std::make_shared<sync_primitives::Lock>();
{
DataAccessor<int> testdata(test_value, testSet_lock_);
{
DataAccessor<int> testdata_copy(testdata);
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_FALSE(testSet_lock_.Try());
+ EXPECT_FALSE(testSet_lock_->Try());
}
// assert
- EXPECT_TRUE(testSet_lock_.Try());
- testSet_lock_.Release();
+ EXPECT_TRUE(testSet_lock_->Try());
+ testSet_lock_->Release();
}
} // namespace utils_test
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
index a209ab4d43..00085813aa 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <boost/thread/thread.hpp>
#include "gtest/gtest.h"
#include "utils/date_time.h"
@@ -38,364 +39,270 @@ namespace components {
namespace utils_test {
using namespace date_time;
+
+namespace bpt = boost::posix_time;
TEST(DateTimeTest, GetCurrentTime) {
// arrange
- const TimevalStruct time1 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
// assert
- ASSERT_NE(0, time1.tv_sec);
- ASSERT_GE(time1.tv_usec, 0);
+ ASSERT_NE(0, time1.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
// act
- const TimevalStruct time2 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time2 = getCurrentTime();
// assert
- ASSERT_NE(0, time2.tv_sec);
- ASSERT_GE(time2.tv_usec, 0);
- ASSERT_GE(time2.tv_sec, time1.tv_sec);
+ ASSERT_NE(0, time2.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
+ ASSERT_GE(time2.total_seconds(), time1.total_seconds());
}
TEST(DateTimeTest, GetSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, GetmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
+ int expected = 1 * MILLISECONDS_IN_SECOND + 2;
- int64_t expect_value =
- time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expected, getmSecs(time1));
}
TEST(DateTimeTest, GetuSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 3;
- time.tv_usec = 4;
-
- int64_t expect_value = time.tv_sec *
- date_time::DateTime::MILLISECONDS_IN_SECOND *
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND +
- time.tv_usec;
+ date_time::TimeDuration time1 = bpt::seconds(3) + bpt::microseconds(4);
+ int expect_value =
+ 3 * MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND + 4;
+
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getuSecs(time));
+ ASSERT_EQ(expect_value, getuSecs(time1));
}
TEST(DateTimeTest, GetuSecsmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 5;
- time.tv_usec = 6;
+ date_time::TimeDuration time1 = bpt::seconds(5) + bpt::microseconds(6);
- int64_t expect_value = date_time::DateTime::getuSecs(time) /
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ int64_t expect_value = getuSecs(time1) / MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expect_value, getmSecs(time1));
}
TEST(DateTimeTest, CalculateTimeSpan) {
// arrange
- const TimevalStruct time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
const uint32_t sleep_time_mSec = 10;
- usleep(sleep_time_mSec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND);
+ // sleep current thread
+ boost::this_thread::sleep(boost::posix_time::milliseconds(sleep_time_mSec));
// assert
- ASSERT_GE(date_time::DateTime::calculateTimeSpan(time), sleep_time_mSec);
+ ASSERT_GE(calculateTimeSpan(time1), sleep_time_mSec);
}
TEST(DateTimeTest, CalculateTimeDiff) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(2) + bpt::milliseconds(2);
+ date_time::TimeDuration time2 = bpt::seconds(3) + bpt::milliseconds(4);
// time2 to time1
- TimevalStruct diff1;
- diff1.tv_sec = time2.tv_sec - time1.tv_sec;
- diff1.tv_usec = time2.tv_usec - time1.tv_usec;
-
- const int64_t mSecDiff =
- static_cast<int64_t>(diff1.tv_sec) * 1000 + diff1.tv_usec / 1000;
+ date_time::TimeDuration diff1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(mSecDiff, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(diff1.total_milliseconds(), calculateTimeDiff(time2, time1));
- // time1 to time2
- TimevalStruct diff2;
- diff2.tv_sec = time1.tv_sec - time2.tv_sec;
- diff2.tv_usec = time1.tv_usec - time2.tv_usec;
-
- const int64_t mSecDiff2 =
- -(static_cast<int64_t>(diff2.tv_sec) * 1000 + diff2.tv_usec / 1000);
+ // time1 to time2, but calculateTimeDiff returns an absolute value
+ date_time::TimeDuration diff2 = -diff1.invert_sign();
// assert
- ASSERT_EQ(mSecDiff2, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(diff2.total_milliseconds(), calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff) {
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 1;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(1) + bpt::milliseconds(2);
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, compareTime) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(2) + bpt::milliseconds(4);
// assert
- ASSERT_EQ(LESS, date_time::DateTime::compareTime(time1, time2));
- ASSERT_EQ(GREATER, date_time::DateTime::compareTime(time2, time1));
- ASSERT_NE(EQUAL, date_time::DateTime::compareTime(time2, time1));
+ ASSERT_EQ(LESS, compareTime(time1, time2));
+ ASSERT_EQ(GREATER, compareTime(time2, time1));
+ ASSERT_NE(EQUAL, compareTime(time2, time1));
// act
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, GetSecs_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 0;
- time1.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, compareTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
- ASSERT_EQ(1, date_time::DateTime::getSecs(time2));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time2));
-}
-
-TEST(DateTimeTest, compareEqualTime_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
-
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- // assert
- ASSERT_TRUE(date_time::DateTime::Equal(time1, time2));
+ ASSERT_EQ(1, getSecs(time1));
+ ASSERT_EQ(1, getSecs(time2));
+ ASSERT_EQ(EQUAL, compareTime(time1, time2));
+ ASSERT_TRUE(Equal(time1, time2));
}
TEST(DateTimeTest, compareLessTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Less(time1, time2));
+ ASSERT_TRUE(Less(time1, time2));
}
TEST(DateTimeTest, compareGreaterTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::milliseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Greater(time2, time1));
+ ASSERT_TRUE(Greater(time2, time1));
}
TEST(DateTimeTest, CalculateTimeSub_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, CalculateTimeDiff_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 5 * date_time::DateTime::MICROSECONDS_IN_SECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(5 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(3000, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(3000, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
-}
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
-TEST(DateTimeTest, CalculateEqualTimeSub_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time3 = time2 - time1;
+ date_time::TimeDuration time4 = time1 - time2;
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time_expected(0, 0, 0, 0);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
- TimevalStruct time4 = date_time::DateTime::Sub(time1, time2);
-
- TimevalStruct time_expected;
- time_expected.tv_sec = 0;
- time_expected.tv_usec = 0;
- // assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time3));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time4));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time3));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time4));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondNotMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, time1.total_seconds());
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMilliSecondLessThenSeconds_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondEqualNull_ExpectNotChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 0;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest, AddMilliseconds_SetOverlowMicrosecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7600;
- time1.tv_sec = 3;
- time1.tv_usec = 500000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(11, time1.tv_sec);
- ASSERT_EQ(100000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(600000, get_just_uSecs(time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_positive) {
- TimevalStruct time1;
- TimevalStruct time2;
- TimevalStruct time3;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 3;
- time2.tv_usec = 0;
- time3.tv_sec = 2;
- time3.tv_usec = 9000000;
- ASSERT_EQ(0, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_EQ(8000000, date_time::DateTime::getuSecs(time3 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_positive) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 = bpt::seconds(3);
+ date_time::TimeDuration time3 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration diff1 = time1 - time2;
+ ASSERT_EQ(0, getSecs(diff1));
+ ASSERT_EQ(8000000, getuSecs(time3 - time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_negative) {
- TimevalStruct time1;
- TimevalStruct time2;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 2;
- time2.tv_usec = 9000000;
- ASSERT_NE(1, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_NE(-8000000, date_time::DateTime::getSecs(time2 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_negative) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+
+ ASSERT_NE(1, getSecs(time1 - time2));
+ ASSERT_NE(-8000000, getSecs(time2 - time1));
}
} // namespace utils_test
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
index 95469766f8..eb35773fc9 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -990,13 +990,13 @@ TEST(FileSystemTest,
TEST(FileSystemTest, WriteFileGetSize) {
ASSERT_FALSE(FileExists("./test file"));
EXPECT_TRUE(CreateFile("./test file"));
- EXPECT_EQ(0, FileSize("./test file"));
+ EXPECT_EQ(0u, FileSize("./test file"));
unsigned char tmp[] = {'t', 'e', 's', 't'};
std::vector<unsigned char> data(tmp, tmp + 4);
EXPECT_TRUE(Write("./test file", data));
- EXPECT_NE(0, FileSize("./test file"));
+ EXPECT_NE(0u, FileSize("./test file"));
EXPECT_TRUE(DeleteFile("./test file"));
EXPECT_FALSE(FileExists("./test file"));
@@ -1022,13 +1022,14 @@ TEST(FileSystemTest, GetFileModificationTime) {
EXPECT_TRUE(CreateFile("./test file"));
- uint64_t modif_time = GetFileModificationTime("./test file");
- EXPECT_LE(0ul, modif_time);
+ time_t modif_time = GetFileModificationTime("./test file");
+ EXPECT_LE(0ul, static_cast<unsigned long>(modif_time));
std::vector<uint8_t> data(1, 1);
EXPECT_TRUE(WriteBinaryFile("./test file", data));
- EXPECT_LE(0ul, GetFileModificationTime("./test file"));
+ EXPECT_LE(0ul,
+ static_cast<unsigned long>(GetFileModificationTime("./test file")));
EXPECT_LE(modif_time, GetFileModificationTime("./test file"));
EXPECT_TRUE(DeleteFile("./test file"));
diff --git a/src/components/utils/test/generated_code_with_sqlite_test.cc b/src/components/utils/test/generated_code_with_sqlite_test.cc
index d37b46f801..1c829c838c 100644
--- a/src/components/utils/test/generated_code_with_sqlite_test.cc
+++ b/src/components/utils/test/generated_code_with_sqlite_test.cc
@@ -66,7 +66,7 @@ const std::string GeneratedCodeTest::kEndpointsCreation =
"CREATE TABLE Endpoints ("
"endpoint_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
"service_id VARCHAR(45) NOT NULL,"
- "application_id VARCHAR(45),"
+ "application_id VARCHAR(45) COLLATE NOCASE,"
"url VARCHAR(45) NOT NULL,"
"is_default INTEGER NOT NULL CHECK(is_default>=0))";
@@ -77,14 +77,14 @@ const std::string GeneratedCodeTest::kEndpointsContent =
const std::string GeneratedCodeTest::kAppPoliciesCreation =
"CREATE TABLE AppPolicies ("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "application_id VARCHAR(45),"
+ "application_id VARCHAR(45) COLLATE NOCASE,"
"priority VARCHAR(45),"
"is_default INTEGER NOT NULL CHECK(is_default>=0))";
const std::string GeneratedCodeTest::kGroupsCreation =
"CREATE TABLE Groups ("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "application_id VARCHAR(45) NOT NULL,"
+ "application_id VARCHAR(45) NOT NULL COLLATE NOCASE,"
"group_name VARCHAR(45) NOT NULL )";
TEST_F(GeneratedCodeTest,
diff --git a/src/components/utils/test/include/utils/mock_signals_posix.h b/src/components/utils/test/include/utils/mock_signals_posix.h
new file mode 100644
index 0000000000..1aad2d5873
--- /dev/null
+++ b/src/components/utils/test/include/utils/mock_signals_posix.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+#define SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+
+#include "gmock/gmock.h"
+#include "utils/signals.h"
+#include <signal.h>
+#include "appMain/low_voltage_signals_handler.h"
+
+namespace utils {
+
+class MockSignalsPosix {
+ public:
+ MOCK_METHOD0(UnsubscribeFromTermination, bool());
+ MOCK_METHOD1(WaitTerminationSignals, bool(sighandler_t sig_handler));
+ MOCK_METHOD1(
+ UnsubscribeFromLowVoltageSignals,
+ bool(const main_namespace::LowVoltageSignalsOffset& offset_data));
+ MOCK_METHOD2(SendSignal, void(const int signo, const pid_t pid));
+ MOCK_METHOD0(Fork, pid_t());
+ MOCK_METHOD1(ExitProcess, void(const int status));
+ MOCK_METHOD3(WaitPid, void(pid_t cpid, int* status, int options));
+
+ static MockSignalsPosix* signals_posix_mock();
+};
+
+} // namespace utils
+#endif // SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
diff --git a/src/components/utils/test/lock_boost_test.cc b/src/components/utils/test/lock_boost_test.cc
new file mode 100644
index 0000000000..0da735a990
--- /dev/null
+++ b/src/components/utils/test/lock_boost_test.cc
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/lock.h"
+
+namespace test {
+namespace components {
+namespace utils_test {
+
+using sync_primitives::Lock;
+using sync_primitives::RecursiveLock;
+
+TEST(LockBoostTest, TestNonRecursive) {
+ // Create Lock object
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Check if created mutex is non-recursive
+ EXPECT_FALSE(test_mutex.Try());
+ // Release mutex before destroy
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TestRecursive) {
+ // Create Lock object
+ RecursiveLock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Check if created mutex is recursive
+ EXPECT_TRUE(test_mutex.Try());
+ // Release mutex before destroy
+ test_mutex.Release();
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, ReleaseMutex_ExpectMutexReleased) {
+ // Create Lock object (non-recursive mutex)
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Acquire();
+ // Release mutex
+ test_mutex.Release();
+ // Try to lock it again. If released expect true
+ EXPECT_TRUE(test_mutex.Try());
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
+ // Create Lock object (non-recursive mutex)
+ Lock test_mutex;
+ // Lock mutex
+ test_mutex.Try();
+ // Try to lock it again. If locked expect false
+ EXPECT_FALSE(test_mutex.Try());
+ test_mutex.Release();
+}
+
+TEST(LockBoostTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
+ // Create Lock object (recursive mutex)
+ RecursiveLock test_mutex;
+ // Lock mutex
+ test_mutex.Try();
+ // Try to lock it again. Expect true and internal counter increase
+ EXPECT_TRUE(test_mutex.Try());
+ // Release mutex twice as was locked twice.
+ // Every Release() will decrement internal counter
+ test_mutex.Release();
+ test_mutex.Release();
+}
+
+} // namespace utils_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/lock_posix_test.cc b/src/components/utils/test/lock_posix_test.cc
deleted file mode 100644
index a78659ab31..0000000000
--- a/src/components/utils/test/lock_posix_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "utils/lock.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-using sync_primitives::Lock;
-
-TEST(LockPosixTest, DefaultCtorTest_ExpectNonRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is non-recursive
- EXPECT_FALSE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, CtorTestWithFalseArgument_ExpectNonRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex(false);
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is non-recursive
- EXPECT_FALSE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, CtorTestWithTrueArgument_ExpectRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex(true);
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is recursive
- EXPECT_TRUE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, AcquireMutex_ExpectMutexLocked) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Try to lock it again. If locked expect false
- EXPECT_FALSE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, ReleaseMutex_ExpectMutexReleased) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Release mutex
- test_mutex.Release();
- // Try to lock it again. If released expect true
- EXPECT_TRUE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Try();
- // Try to lock it again. If locked expect false
- EXPECT_FALSE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
- // Create Lock object (recursive mutex)
- Lock test_mutex(true);
- // Lock mutex
- test_mutex.Try();
- // Try to lock it again. Expect true and internal counter increase
- EXPECT_TRUE(test_mutex.Try());
- // Release mutex twice as was locked twice.
- // Every Release() will decrement internal counter
- test_mutex.Release();
- test_mutex.Release();
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
index 032c7ecae1..92287fb45b 100644
--- a/src/components/utils/test/log_message_loop_thread_test.cc
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -57,7 +57,7 @@ TEST(LogMessageLoopThread, DestroyLogMessage_loggerStatusDeletingLogger) {
logger::logger_status = LoggerThreadNotCreated;
}
-class MockLogMessageTest : public LogMessageHandler {
+class MockLogMessageTest : public LogMessageLoopThread {
public:
MOCK_CONST_METHOD1(Handle, void(const LogMessage message));
};
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
index ddc1aa1d81..9aa70933d6 100644
--- a/src/components/utils/test/message_queue_test.cc
+++ b/src/components/utils/test/message_queue_test.cc
@@ -158,6 +158,8 @@ TEST_F(MessageQueueTest,
ASSERT_EQ(test_val_1, test_line);
// Check the size of queue after 1 element was removed
ASSERT_EQ(0u, test_queue.size());
+ pthread_join(thread1, NULL);
+ pthread_join(thread2, NULL);
}
TEST_F(MessageQueueTest,
@@ -169,6 +171,7 @@ TEST_F(MessageQueueTest,
test_queue.wait();
check_value = true;
ASSERT_TRUE(check_value);
+ pthread_join(thread1, NULL);
}
} // namespace utils_test
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index efaaa41252..d45e600034 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -57,25 +57,25 @@ const TimePair testing_time_pairs[] = {TimePair(0, 50),
class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
protected:
void SetUp() OVERRIDE {
- usecs = date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ usecs = date_time::MICROSECONDS_IN_MILLISECOND;
id1 = 0x0;
id2 = 0xABCDEF;
id3 = 0xFEBCDA;
const TimePair time_pair = GetParam();
EXPECT_GT(usecs, time_pair.second) << "Wrong time (msecs) value";
+ time_range = date_time::seconds(time_pair.first) +
+ date_time::microseconds(time_pair.second * usecs);
- time_range.tv_sec = time_pair.first;
- time_range.tv_usec = time_pair.second * usecs;
- EXPECT_LT(0, date_time::DateTime::getuSecs(time_range))
+ EXPECT_LT(0, date_time::getuSecs(time_range))
<< "Wrong test case with null range value";
meter.set_time_range(time_range);
- time_range_msecs = date_time::DateTime::getmSecs(time_range);
+ time_range_msecs = date_time::getmSecs(time_range);
}
void TearDown() OVERRIDE {}
::utils::MessageMeter<int> meter;
- TimevalStruct time_range = {0, 0};
+ date_time::TimeDuration time_range = date_time::TimeDurationZero();
int64_t time_range_msecs;
int usecs;
int id1, id2, id3;
@@ -83,27 +83,25 @@ class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
TEST(MessageMeterTest, DefaultTimeRange) {
const ::utils::MessageMeter<int> default_meter;
- const TimevalStruct time_second{1, 0};
+ const date_time::TimeDuration time_second = date_time::seconds(1);
EXPECT_EQ(time_second, default_meter.time_range());
}
TEST(MessageMeterTest, TimeRangeSetter) {
::utils::MessageMeter<int> meter;
- TimevalStruct time_range{0, 0};
+ date_time::TimeDuration time_range;
const int test_count_secs = 1000;
- // Skip 1000th msec value as wrong for TimevalStruct
+ // Skip 1000th msec value as wrong for date_time::TimeDuration
const int test_count_msecs = 999;
for (int sec = test_count_secs; sec >= 0; --sec) {
for (int msec = test_count_msecs; msec >= 0; --msec) {
- time_range.tv_sec = sec;
- time_range.tv_usec =
- msec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- // Setter TimevalStruct
+ time_range = date_time::seconds(sec) + date_time::milliseconds(msec);
+
+ // Setter date_time::TimeDuration
meter.set_time_range(time_range);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
// Setter mSecs
- meter.set_time_range(sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- msec);
+ meter.set_time_range(sec * date_time::MILLISECONDS_IN_SECOND + msec);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
}
}
@@ -113,7 +111,7 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
::utils::MessageMeter<int> meter;
const int id1 = 1;
const int id2 = 2;
- const TimevalStruct null_time_range{0, 0};
+ const date_time::TimeDuration null_time_range = date_time::TimeDurationZero();
meter.set_time_range(null_time_range);
for (int i = 0; i < 10000; ++i) {
// 1st Connection
@@ -126,12 +124,13 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
}
}
-TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -150,12 +149,12 @@ TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
}
TEST_P(MessageMeterTest,
- TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
+ DISABLED_TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -184,16 +183,17 @@ TEST_P(MessageMeterTest,
}
}
-TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_Frequency_CountingOverPeriod_CorrectCountOfMessages) {
const size_t one_message = 1;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
EXPECT_EQ(one_message, meter.TrackMessage(id3));
// Check messages count over period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
usleep(time_range_msecs);
@@ -206,7 +206,7 @@ TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
}
}
-TEST_P(MessageMeterTest, CountingOutOfPeriod) {
+TEST_P(MessageMeterTest, DISABLED_CountingOutOfPeriod) {
const size_t one_message = 1;
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
diff --git a/src/components/utils/test/mock_signals_posix.cc b/src/components/utils/test/mock_signals_posix.cc
new file mode 100644
index 0000000000..47531b4a9f
--- /dev/null
+++ b/src/components/utils/test/mock_signals_posix.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "utils/mock_signals_posix.h"
+#include "utils/signals.h"
+
+namespace utils {
+
+bool Signals::UnsubscribeFromTermination() {
+ return MockSignalsPosix::signals_posix_mock()->UnsubscribeFromTermination();
+}
+
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
+ return MockSignalsPosix::signals_posix_mock()->WaitTerminationSignals(
+ sig_handler);
+}
+
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ return MockSignalsPosix::signals_posix_mock()
+ ->UnsubscribeFromLowVoltageSignals(offset_data);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ MockSignalsPosix::signals_posix_mock()->SendSignal(signo, pid);
+}
+
+void Signals::ExitProcess(const int status) {
+ MockSignalsPosix::signals_posix_mock()->ExitProcess(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ MockSignalsPosix::signals_posix_mock()->WaitPid(cpid, status, options);
+}
+
+pid_t Signals::Fork() {
+ return MockSignalsPosix::signals_posix_mock()->Fork();
+}
+
+MockSignalsPosix* MockSignalsPosix::signals_posix_mock() {
+ static ::testing::NiceMock<MockSignalsPosix> signals_posix_mock;
+ return &signals_posix_mock;
+}
+
+} // namespace utils
diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql
index 406579f6b7..d588d695a6 100644
--- a/src/components/utils/test/policy.sql
+++ b/src/components/utils/test/policy.sql
@@ -108,7 +108,7 @@ BEGIN TRANSACTION;
CREATE INDEX `rpc.select_rpc_name_hmi_level`
ON `rpc`(`name`,`hmi_level_value`);
CREATE TABLE IF NOT EXISTS `application`(
- `id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE,
`keep_context` BOOLEAN,
`steal_focus` BOOLEAN,
`default_hmi` VARCHAR(45),
@@ -131,7 +131,7 @@ BEGIN TRANSACTION;
CREATE INDEX IF NOT EXISTS `application.fk_application_priorities1_idx`
ON `application`(`priority_value`);
CREATE TABLE IF NOT EXISTS `app_group`(
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
PRIMARY KEY(`application_id`,`functional_group_id`),
CONSTRAINT `fk_application_has_functional_group_application1`
@@ -144,9 +144,9 @@ BEGIN TRANSACTION;
CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_functional_group1_idx`
ON `app_group`(`functional_group_id`);
CREATE INDEX IF NOT EXISTS `app_group.fk_application_has_functional_group_application1_idx`
- ON `app_group`(`application_id`);
+ ON `app_group`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `preconsented_group`(
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
PRIMARY KEY(`application_id`,`functional_group_id`),
CONSTRAINT `fk_application_has_functional_group_application2`
@@ -161,7 +161,7 @@ BEGIN TRANSACTION;
ON `preconsented_group`(`functional_group_id`);
CREATE INDEX IF NOT EXISTS
`preconsented_group.fk_application_has_functional_group_application2_idx`
- ON `preconsented_group`(`application_id`);
+ ON `preconsented_group`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `seconds_between_retry`(
`index` INTEGER PRIMARY KEY NOT NULL,
`value` INTEGER NOT NULL
@@ -187,7 +187,7 @@ BEGIN TRANSACTION;
`device_consent_group.fk_device_has_functional_group_device1_idx`
ON `device_consent_group`(`device_id`);
CREATE TABLE IF NOT EXISTS `app_level`(
- `application_id` VARCHAR(45) PRIMARY KEY NOT NULL,
+ `application_id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE,
`minutes_in_hmi_full` INTEGER DEFAULT 0,
`minutes_in_hmi_limited` INTEGER DEFAULT 0,
`minutes_in_hmi_background` INTEGER DEFAULT 0,
@@ -214,34 +214,34 @@ BEGIN TRANSACTION;
REFERENCES `language`(`code`)
);
CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx`
- ON `app_level`(`application_id`);
+ ON `app_level`(`application_id` COLLATE NOCASE);
CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language1_idx`
ON `app_level`(`app_registration_language_gui`);
CREATE INDEX IF NOT EXISTS `app_level.fk_app_level_language2_idx`
ON `app_level`(`app_registration_language_vui`);
CREATE TABLE IF NOT EXISTS `nickname`(
- `name` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `name` VARCHAR(100) NOT NULL COLLATE NOCASE,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
PRIMARY KEY(`name`,`application_id`),
CONSTRAINT `fk_nickname_application1`
FOREIGN KEY(`application_id`)
REFERENCES `application`(`id`)
);
CREATE INDEX IF NOT EXISTS `nickname.fk_nickname_application1_idx`
- ON `nickname`(`application_id`);
+ ON `nickname`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `app_type`(
`name` VARCHAR(50) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
PRIMARY KEY(`name`,`application_id`),
CONSTRAINT `fk_app_type_application1`
FOREIGN KEY(`application_id`)
REFERENCES `application`(`id`)
);
CREATE INDEX IF NOT EXISTS `app_type.fk_app_type_application1_idx`
- ON `app_type`(`application_id`);
+ ON `app_type`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `consent_group`(
`device_id` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
`is_consented` BOOL NOT NULL,
`input` VARCHAR(45),
@@ -263,15 +263,15 @@ BEGIN TRANSACTION;
CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
ON `consent_group`(`functional_group_id`);
CREATE TABLE IF NOT EXISTS `endpoint`(
- `service` INTEGER NOT NULL,
+ `service` VARCHAR(100) NOT NULL,
`url` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
CONSTRAINT `fk_endpoint_application1`
FOREIGN KEY(`application_id`)
REFERENCES `application`(`id`)
);
CREATE INDEX IF NOT EXISTS `endpoint.fk_endpoint_application1_idx`
- ON `endpoint`(`application_id`);
+ ON `endpoint`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `message`(
`id` INTEGER PRIMARY KEY NOT NULL,
`tts` TEXT,
diff --git a/src/components/utils/test/scope_guard_test.cc b/src/components/utils/test/scope_guard_test.cc
index 85abbd90de..5e685d6aba 100644
--- a/src/components/utils/test/scope_guard_test.cc
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -43,7 +43,7 @@ using ::utils::MakeGuard;
using ::utils::MakeObjGuard;
using ::testing::Mock;
-class TestObject {
+class TestCalleeObject {
public:
MOCK_METHOD0(function_to_call, void());
MOCK_METHOD1(function_to_call_with_param, void(void*));
@@ -68,21 +68,21 @@ TEST(ScopeGuardTest, CallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, CallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
Mock::AllowLeak(&obj); // Google tests bug
EXPECT_CALL(obj, function_to_call()).Times(1);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
UNUSED(guard);
}
}
TEST(ScopeGuardTest, CallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(1);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
UNUSED(guard);
}
}
@@ -98,20 +98,20 @@ TEST(ScopeGuardTest, DismissCallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, DismissCallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call()).Times(0);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
guard.Dismiss();
}
}
TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(0);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
guard.Dismiss();
}
}
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
deleted file mode 100644
index a30f2f66eb..0000000000
--- a/src/components/utils/test/shared_ptr_test.cc
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-#include <vector>
-#include <iostream>
-#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-class CMockObject {
- public:
- CMockObject(int id);
- virtual ~CMockObject();
- virtual int getId() const;
-
- MOCK_METHOD0(destructor, void());
-
- private:
- int mId_;
-};
-
-class CExtendedMockObject : public CMockObject {
- public:
- CExtendedMockObject(int id);
-};
-
-using ::testing::NiceMock;
-
-CMockObject::CMockObject(int id) : mId_(id) {}
-
-CMockObject::~CMockObject() {
- destructor();
-}
-
-int CMockObject::getId() const {
- return mId_;
-}
-
-CExtendedMockObject::CExtendedMockObject(int id) : CMockObject(id) {}
-
-typedef utils::SharedPtr<CMockObject> tMockObjectPtr;
-typedef utils::SharedPtr<CExtendedMockObject> tExtendedMockObjectPtr;
-
-TEST(SharedPtrTest, DefaultConstructorTest) {
- // Constructor checks
- tMockObjectPtr p0;
- ASSERT_EQ(0, p0.get());
- ASSERT_FALSE(p0.valid());
-}
-
-TEST(SharedPtrTest, ConstructorWithOneParameterTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, CopyConstructorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(1, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- tMockObjectPtr p3 = p2;
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
- {
- tMockObjectPtr p4 = p3;
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(4u, *(p3.get_ReferenceCounter()));
- }
- // Check reference counter decreased
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, SecondConstructorWithOneParameterTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(2);
- EXPECT_CALL(*object1, destructor()).Times(0);
-
- // Constructors checks
- tExtendedMockObjectPtr p1(object1);
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, AssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
-
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, SecondAssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Use assignment operator
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, EqualOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Checks
- ASSERT_TRUE(p1 == p3);
- ASSERT_TRUE(p1 == p4);
- ASSERT_TRUE(p4 == p3);
- ASSERT_FALSE(p1 == p2);
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, LessThanOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- // Checks
- if (object1 < object2) {
- ASSERT_TRUE(p1 < p2);
- } else {
- ASSERT_FALSE(p1 < p2);
- }
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::static_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_BaseToDerived_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 = utils::SharedPtr<CMockObject>::static_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(1, ep1->getId());
- ASSERT_EQ(2u, *(ep1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::dynamic_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_BaseToDerived_ExpectNullPtr) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 =
- utils::SharedPtr<CMockObject>::dynamic_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(NULL, ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ArrowOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, ep1->getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, p1->getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, ep2->getId());
-}
-
-TEST(SharedPtrTest, DereferenceOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, (*ep1).getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, (*p1).getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, (*ep2).getId());
-}
-
-TEST(SharedPtrTest, BoolOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
-
- // Checks
- ASSERT_TRUE(p1);
- ASSERT_FALSE(p2);
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ResetWithoutArgsTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p2.reset();
- // Check
- EXPECT_EQ(NULL, p2.get());
- EXPECT_EQ(1u, *(p2.get_ReferenceCounter()));
- p4.reset();
- // Check
- EXPECT_EQ(NULL, p4.get());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, ResetWithArgumentTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(27);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p4.reset(object2);
- // Check
- EXPECT_EQ(27, (*p4).getId());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, GetMethodTest_ExpectObjPointer) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
- tMockObjectPtr p1(object1);
- // Check
- ASSERT_EQ(object1, p1.get());
-}
-
-TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
- // Check
- ASSERT_TRUE(p1.valid());
- ASSERT_FALSE(p2.valid());
-}
-
-TEST(SharedPtrTest, StressTest) {
- // Arrange
- const size_t kNumIterations = 1024U * 1024U;
-
- size_t objectCreated = 0U;
- size_t pointersCopied = 0U;
- std::vector<tMockObjectPtr> objects;
-
- for (size_t i = 0U; i < kNumIterations; ++i) {
- if ((true == objects.empty()) || (0 == rand() % 256)) {
- CMockObject* object = new CMockObject(0);
- EXPECT_CALL(*object, destructor());
- objects.push_back(object);
- ++objectCreated;
- } else {
- size_t objectIndex = static_cast<size_t>(rand()) % objects.size();
-
- if (rand() % 2) {
- objects.push_back(objects[objectIndex]);
- ++pointersCopied;
- } else {
- objects.erase(objects.begin() + objectIndex);
- }
- }
- }
- printf("%zu objects created, %zu pointers copied\n",
- objectCreated,
- pointersCopied);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
index b481e45fd3..c10c26a2c7 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
@@ -97,7 +97,9 @@ class SQLQueryTest : public ::testing::Test {
};
sqlite3* SQLQueryTest::conn = 0;
-const std::string SQLQueryTest::kDatabaseName = "test-query";
+
+// mounting /tmp as tmpfs will descrease utils unit tests runing time
+const std::string SQLQueryTest::kDatabaseName = "/tmp/test-query";
TEST_F(SQLQueryTest, Query_CreateQuery_QueryInDBEqualCreated) {
// arrange
diff --git a/third_party.md b/third_party.md
new file mode 100644
index 0000000000..249d58fade
--- /dev/null
+++ b/third_party.md
@@ -0,0 +1,104 @@
+### SDL CORE
+
+Copyright (C) 2018 SmartDeviceLink Consortium, Inc.
+
+#### License
+Copyright (c) 2017 - 2018, SmartDeviceLink Consortium, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#### Third Party Licenses
+
+Both the source and binary distributions of this software contain
+some third party software. All the third party software included
+or linked is redistributed under the terms and conditions of their
+original licenses.
+
+The third party software included and used by this project is:
+
+**googlemock 1.7.0**
+
+* Copyright 2008, Google Inc
+* Licensed under BSD 3-clause
+* The library is included in Google C++ Mocking Framework
+* See [https://github.com/google/googletest/tree/master/googlemock](https://github.com/google/googletest/tree/master/googlemock)
+
+**googlemock 1.7.0**
+
+* Copyright [2007] Neal Norwitz
+* Portions Copyright [2007] Google Inc
+* Licensed under the Apache License, Version 2.0
+* The library is included in the Google Mock class generator
+* See [https://github.com/google/googletest/tree/master/googlemock](https://github.com/google/googletest/tree/master/googlemock)
+
+**json-cpp 0.6.0 rc2**
+
+* Copyright (c) 2007-2010 Baptiste Lepilleur
+* Licensed under MIT License
+* The library is included in jsoncpp 3rd party static src folder
+* See [https://github.com/open-source-parsers/jsoncpp/releases/tag/svn-release-0.6.0-rc2](https://github.com/open-source-parsers/jsoncpp/releases/tag/svn-release-0.6.0-rc2)
+
+**Apache log4cxx 0.10.0**
+
+* Copyright 2004-2007 The Apache Software Foundation
+* Licensed under the Apache License, Version 2.0
+* The library is included in apache-log4cxx-0.10.0 3rd party src folder
+* See [https://github.com/apache/logging-log4cxx/releases](https://github.com/apache/logging-log4cxx/releases)
+
+**Apache Portable Runtime 1.5**
+
+* Copyright (c) 2000-2013 The Apache Software Foundation.
+* Licensed under the Apache License, Version 2.0.
+* The library is included in apr-1.5.0 3rd party src folder.
+* See [https://github.com/apache/apr/releases/tag/1.5.0](https://github.com/apache/apr/releases/tag/1.5.0)
+
+**Apache Portable Runtime Utility 1.5.3**
+
+* Copyright (c) 2000-2013 The Apache Software Foundation
+* Licensed under the Apache License, Version 2.0
+* The library is included in apr-util-1.5.3 3rd party src folder
+* See [https://github.com/apache/apr-util/releases/tag/1.5.3](https://github.com/apache/apr-util/releases/tag/1.5.3)
+
+**Apache Portable Runtime 1.5**
+
+* Copyright (c) 1987, 1992, 1993, 1994, The Regents of the University of California
+* Licensed under BSD 4-clause
+* The library is included in apr-1.5.0 3rd party src folder
+* See [https://github.com/apache/apr/releases/tag/1.5.0](https://github.com/apache/apr/releases/tag/1.5.0)
+
+**inetlib**
+
+* Copyright (c) 1996 by Internet Software Consortium
+* Licensed under ISC License
+* The library is included in the unix folder of network_io, under the apr-1.5.0 3rd party src folder
+
+**Expat 2.1.0**
+
+* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper
+* Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers
+* Licensed under MIT License
+* The library is included in expat-2.1.0 3rd party src folder
+* See [https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat](https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat)
+
+**Expat 2.1.0**
+
+* Licensed under GNU Free Documentation License v1.1
+* The library is included in the doc folder, under the expat-2.1.0 3rd party src folder
+* See [https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat/doc](https://github.com/libexpat/libexpat/tree/defusedexpat-2.1.0/expat/doc)
+
+**Pugixml 1.2**
+
+* Copyright (C) 2006-2012, by Arseny Kapoulkine
+* Licensed under MIT License
+* The library is used as an XML processing library, located in the tools folder
+* See [https://github.com/zeux/pugixml/releases/tag/v1.2](https://github.com/zeux/pugixml/releases/tag/v1.2) \ No newline at end of file
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index cf3e2c692c..58a2cf5873 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -5,7 +5,8 @@ include(ExternalProject)
set(intergen_SOURCES "${CMAKE_CURRENT_LIST_DIR}/intergen")
set(intergen_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/intergen")
set(intergen_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/intergen")
-set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR})
+set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR} -DCMAKE_CXX_FLAGS="-std=gnu++0x")
+
ExternalProject_Add(intergen
SOURCE_DIR ${intergen_SOURCES}
diff --git a/tools/InterfaceGenerator/MsgVersionGenerate.py b/tools/InterfaceGenerator/MsgVersionGenerate.py
index 86251cd419..4a24a3239f 100644
--- a/tools/InterfaceGenerator/MsgVersionGenerate.py
+++ b/tools/InterfaceGenerator/MsgVersionGenerate.py
@@ -12,14 +12,25 @@ def generate_msg_version(file_name, path_to_storage):
"""
tree = xml.etree.ElementTree.parse(file_name)
root = tree.getroot()
- if (root.tag == "interface" and "version" in root.attrib):
+ if (root.tag == "interface" and "version" and "minVersion" in root.attrib):
check_version_format(root.attrib["version"])
array = (root.attrib["version"]).split(".")
major_version = array[0]
minor_version = array[1]
patch_version = array[2]
- if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit):
- data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version)
+
+ check_minimum_version_format(root.attrib["minVersion"])
+ minimum_version_array = (root.attrib["minVersion"]).split(".")
+ if (len(minimum_version_array) == 2):
+ minimum_version_array.append("0")
+ minimum_major_version = minimum_version_array[0]
+ minimum_minor_version = minimum_version_array[1]
+ minimum_patch_version = minimum_version_array[2]
+
+ if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit() and
+ minimum_major_version.isdigit() and minimum_minor_version.isdigit() and minimum_patch_version.isdigit()):
+ data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version,
+ minimum_major_version, minimum_minor_version, minimum_patch_version)
store_data_to_file(path_to_storage, data_for_storage)
else:
raise RPCBase.ParseError("Attribute version has incorect value in MOBILE_API.xml")
@@ -45,7 +56,16 @@ def check_version_format(version):
raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
"Need format of version major_version.minor_version.patch_version")
-def prepare_data_for_storage(major_version, minor_version, patch_version):
+
+def check_minimum_version_format(version):
+ """Checks correctness of format of version
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of minVersion major_version.minor_version or major_version.minor_version.patch_version")
+def prepare_data_for_storage(major_version, minor_version, patch_version, minimum_major_version, minimum_minor_version, minimum_patch_version):
"""Prepares data to store to file.
"""
temp = Template(
@@ -80,8 +100,12 @@ def prepare_data_for_storage(major_version, minor_version, patch_version):
u'''const uint16_t major_version = $m_version;\n'''
u'''const uint16_t minor_version = $min_version;\n'''
u'''const uint16_t patch_version = $p_version;\n'''
+ u'''const uint16_t minimum_major_version = $min_major_version;\n'''
+ u'''const uint16_t minimum_minor_version = $min_minor_version;\n'''
+ u'''const uint16_t minimum_patch_version = $min_patch_version;\n'''
u'''} // namespace application_manager\n'''
u'''#endif // GENERATED_MSG_VERSION_H''')
- data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version)
+ data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version,
+ min_major_version = minimum_major_version, min_minor_version = minimum_minor_version, min_patch_version = minimum_patch_version)
return data_to_file
diff --git a/tools/InterfaceGenerator/generator/Model.py b/tools/InterfaceGenerator/generator/Model.py
index ee458d934a..e7cce732ed 100755
--- a/tools/InterfaceGenerator/generator/Model.py
+++ b/tools/InterfaceGenerator/generator/Model.py
@@ -124,7 +124,8 @@ class InterfaceItemBase(object):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, default_value=None, scope=None):
+ issues=None, todos=None, platform=None, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
self.name = name
self.description = description if description is not None else []
self.design_description = \
@@ -134,6 +135,11 @@ class InterfaceItemBase(object):
self.platform = platform
self.default_value = default_value
self.scope = scope
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+ self.history = history
class EnumElement(InterfaceItemBase):
@@ -149,13 +155,18 @@ class EnumElement(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_name=None,
- value=None):
+ value=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumElement, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.internal_name = internal_name
self.value = value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+
@property
def primary_name(self):
@@ -180,15 +191,19 @@ class Enum(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_scope=None,
- elements=None, scope=None):
+ elements=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Enum, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, history=history)
self.internal_scope = internal_scope
self.elements = \
elements if elements is not None else collections.OrderedDict()
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class EnumSubset(InterfaceItemBase):
@@ -204,15 +219,19 @@ class EnumSubset(InterfaceItemBase):
def __init__(self, name, enum, description=None, design_description=None,
issues=None, todos=None, platform=None,
- allowed_elements=None):
+ allowed_elements=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumSubset, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.enum = enum
self.allowed_elements = \
allowed_elements if allowed_elements is not None else {}
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class Param(InterfaceItemBase):
@@ -229,15 +248,20 @@ class Param(InterfaceItemBase):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Param, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, default_value=default_value, scope=scope)
+ platform=platform, default_value=default_value, scope=scope, history=history)
self.is_mandatory = is_mandatory
self.param_type = param_type
self.default_value = default_value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed=removed
class FunctionParam(Param):
@@ -251,11 +275,13 @@ class FunctionParam(Param):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(FunctionParam, self).__init__(
name, param_type=param_type, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, is_mandatory=is_mandatory, default_value=default_value, scope=scope)
+ platform=platform, is_mandatory=is_mandatory, default_value=default_value,
+ scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.default_value = default_value
@@ -270,11 +296,13 @@ class Struct(InterfaceItemBase):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, members=None, scope=None):
+ issues=None, todos=None, platform=None, members=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Struct, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until,
+ deprecated=deprecated, removed=removed, history=history)
self.members = \
members if members is not None else collections.OrderedDict()
@@ -293,11 +321,11 @@ class Function(InterfaceItemBase):
def __init__(self, name, function_id, message_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, params=None, scope=None):
+ platform=None, params=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Function, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.function_id = function_id
self.message_type = message_type
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
index d13ac29c9b..c6a0145ac6 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
@@ -505,7 +505,6 @@ class CodeGenerator(object):
String with structs implementation source code.
"""
-
processed_enums = []
return self._struct_impl_template.substitute(
namespace=namespace,
@@ -518,9 +517,46 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
struct.members.values()),
schema_item_fill=self._gen_schema_items_fill(
- struct.members.values())),
+ struct.members.values(), struct.since, struct.until, struct.deprecated, struct.removed)),
1))
+
+ def _enum_has_history_present(self, enum):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in enum.param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _element_has_history_present(self, element):
+ '''
+ Check if a specific element has a history signature
+ '''
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _enum_param_type_has_history_present(self, param_type):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+
def _gen_schema_loc_decls(self, members, processed_enums):
"""Generate local declarations of variables for schema.
@@ -540,6 +576,7 @@ class CodeGenerator(object):
for member in members:
if type(member.param_type) is Model.Enum and \
member.param_type.name not in processed_enums:
+ has_history = self._enum_has_history_present(member)
local_var = self._gen_schema_loc_emum_var_name(
member.param_type)
result = u"\n".join(
@@ -555,6 +592,46 @@ class CodeGenerator(object):
enum=member.param_type.name,
value=x.primary_name)
for x in member.param_type.elements.values()])])
+
+ if has_history == True:
+ history_result = u"\n"
+ history_result += self._impl_code_loc_decl_enum_history_set_template.substitute(
+ type=member.param_type.name)
+ history_result += u"\n"
+ history_result += u"\n".join(
+ [self._impl_code_loc_decl_enum_history_set_value_init_template.substitute(
+ enum=member.param_type.name,
+ value=x.primary_name)
+ for x in member.param_type.elements.values() if self._element_has_history_present(x)])
+ history_result += u"\n"
+ history_map_result = []
+
+ for x in member.param_type.elements.values():
+ if self._element_has_history_present(x):
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=x.since if x.since is not None else "",
+ until=x.until if x.until is not None else "",
+ removed=x.removed if x.removed is not None else u"false"))
+ if(x.history is not None) :
+ history_list = x.history
+ for item in history_list:
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=item.since if item.since is not None else "",
+ until=item.until if item.until is not None else "",
+ removed=item.removed if item.removed is not None else u"false"))
+
+ history_result += u"\n".join(history_map_result)
+ result += "\n"
+ result += history_result
+
processed_enums.append(member.param_type.name)
result = u"".join([result, u"\n\n"]) if result else u""
elif type(member.param_type) is Model.EnumSubset:
@@ -599,10 +676,40 @@ class CodeGenerator(object):
"""
- result = u"\n\n".join(
- [self._gen_schema_item_decl(x) for x in members])
+ result_array = []
+ for x in members:
+ result_array.append(self._gen_schema_item_decl(x))
+ count = 0
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ item.name += "_history_v" + str(len(history_list)-count)
+ result_array.append(self._gen_schema_item_decl(item))
+ count += 1
+ result_array.append(self._gen_history_vector_decl(history_list, x.name))
+
+ result = u"\n\n".join(result_array)
+ return result
+
+ def _gen_history_vector_decl(self, history_list, name):
+ """Generate History Vector Declaration.
+
+ Generates the declaration and initialization
+ of a vector of schema items
+
+ Arguments:
+ history_list -> list of history items
+ name -> name of parent parameter name
+
+ Returns:
+ String with history array code.
+ """
+ result_array = []
+ result_array.append(self._impl_code_shared_ptr_vector_template.substitute(var_name = name))
+ result = u"\n".join(result_array)
+ return result
+
- return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_item_decl(self, member):
"""Generate schema item declaration.
@@ -696,16 +803,30 @@ class CodeGenerator(object):
code = self._impl_code_struct_item_template.substitute(
name=param.name)
elif type(param) is Model.Enum:
- code = self._impl_code_enum_item_template.substitute(
- type=param.name,
- params=u"".join(
- [self._gen_schema_loc_emum_var_name(param),
- u", ",
- self._gen_schema_item_param_values(
- [[u"".join([param.name, u"::eType"]),
- u"".join([param.name, u"::",
- default_value.primary_name]) if
- default_value is not None else None]])]))
+ if self._enum_param_type_has_history_present(param):
+ code = self._impl_code_enum_item_with_history_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._impl_gen_schema_enum_history_map_template.substitute(name=param.name),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
+ else:
+ code = self._impl_code_enum_item_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
elif type(param) is Model.EnumSubset:
code = self._impl_code_enum_item_template.substitute(
type=param.enum.name,
@@ -746,7 +867,7 @@ class CodeGenerator(object):
return result
- def _gen_schema_items_fill(self, members):
+ def _gen_schema_items_fill(self, members=None, since=None, until=None, deprecated=None, removed=None):
"""Generate schema items fill code.
Generates source code that fills new schema with items.
@@ -758,10 +879,16 @@ class CodeGenerator(object):
String with function schema items fill code.
"""
-
- result = u"\n".join(
- [self._gen_schema_item_fill(x) for x in members])
-
+ result_array = []
+ for x in members:
+ #If history, create Smember History vector first
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ result_array.append(self._gen_history_vector_item_fill(item, x.name))
+ result_array.append(self._gen_schema_item_fill(x, since, until, deprecated, removed))
+
+ result = u"\n".join(result_array)
return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_params_fill(self, message_type_name):
@@ -781,7 +908,34 @@ class CodeGenerator(object):
raise GenerateError("Unexpected call to the unimplemented function.")
- def _gen_schema_item_fill(self, member):
+ def _check_member_history(self, member):
+ """
+ Checks set of rules that history items are valid
+ Raises error if rules are violated
+ """
+ if (member.since is None and
+ member.until is None and
+ member.deprecated is None and
+ member.removed is None and
+ member.history is None):
+ return
+ if (member.history is not None and member.since is None):
+ raise GenerateError("Error: Missing since version parameter for " + member.name)
+ if (member.until is not None):
+ raise GenerateError("Error: Until should only exist in history tag for " + member.name)
+ if (member.history is None):
+ if(member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ raise GenerateError("Error: No history present for " + member.name)
+ if (member.deprecated is not None and member.removed is not None):
+ raise GenerateError("Error: Deprecated and removed should not be present together for " + member.name)
+ if(member.history is not None):
+ for item in member.history:
+ if item.since is None or item.until is None:
+ raise GenerateError("Error: History items require since and until parameters for " + member.name)
+
+ def _gen_schema_item_fill(self, member, since, until, deprecated, removed):
"""Generate schema item fill code.
Generates source code that fills new schema with item.
@@ -793,11 +947,62 @@ class CodeGenerator(object):
String with schema item fill code.
"""
+ self._check_member_history(member)
+
+ if (since is not None or
+ member.since is not None):
+ if member.history is not None:
+ return self._impl_code_item_fill_template_with_version_and_history_vector.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false",
+ vector_name=member.name)
+ else:
+ return self._impl_code_item_fill_template_with_version.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false")
+ else:
+ return self._impl_code_item_fill_template.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false")
- return self._impl_code_item_fill_template.substitute(
- name=member.name,
- var_name=self._gen_schema_item_var_name(member),
- is_mandatory=u"true" if member.is_mandatory is True else u"false")
+ def _gen_history_vector_item_fill(self, member, vector_name):
+ """Generate schema item fill code.
+
+ Generates source code that fills history vector with item.
+
+ Keyword arguments:
+ member -- struct member/function parameter to process.
+
+ Returns:
+ String with schema item fill code.
+
+ """
+
+ if (member.since is not None or
+ member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ return self._impl_code_append_history_vector_template.substitute(
+ vector_name=vector_name,
+ name=member.name,
+ mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else "",
+ until=member.until if member.until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else u"false")
+ else:
+ print "Warning! History item does not have any version history. Omitting %s" % member.name
@staticmethod
def _gen_schema_item_var_name(member):
@@ -899,7 +1104,7 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
function.params.values()),
schema_item_fill=self._gen_schema_items_fill(
- function.params.values()),
+ function.params.values(), function.since, function.until, function.deprecated, function.removed),
schema_params_fill=self._gen_schema_params_fill(
function.message_type.name)),
1))
@@ -1283,7 +1488,6 @@ class CodeGenerator(object):
u'''#include "formatters/CSmartFactory.h"\n'''
u'''#include "smart_objects/smart_schema.h"\n'''
u'''#include "smart_objects/schema_item.h"\n'''
- u'''#include "utils/shared_ptr.h"\n'''
u'''#include "$header_file_name"\n'''
u'''\n'''
u'''$namespace_open'''
@@ -1368,10 +1572,10 @@ class CodeGenerator(object):
u'''#include "smart_objects/number_schema_item.h"\n'''
u'''#include "smart_objects/schema_item_parameter.h"\n'''
u'''\n'''
- u'''using namespace NsSmartDeviceLink::NsSmartObjects;\n'''
+ u'''using namespace ns_smart_device_link::ns_smart_objects;\n'''
u'''\n'''
u'''$namespace::$class_name::$class_name()\n'''
- u''' : NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, '''
+ u''' : ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, '''
u'''messageType::eType, StructIdentifiers::eType>() {\n'''
u''' TStructsSchemaItems struct_schema_items;\n'''
u''' InitStructSchemes(struct_schema_items);\n'''
@@ -1386,7 +1590,7 @@ class CodeGenerator(object):
u'''message_type_items);\n'''
u'''}\n'''
u'''\n'''
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id) {\n'''
@@ -1396,7 +1600,7 @@ class CodeGenerator(object):
u''' return it->second;\n'''
u''' }\n'''
u'''\n'''
- u''' return NsSmartDeviceLink::NsSmartObjects::'''
+ u''' return ns_smart_device_link::ns_smart_objects::'''
u'''CAlwaysFalseSchemaItem::create();\n'''
u'''}\n'''
u'''\n'''
@@ -1423,13 +1627,13 @@ class CodeGenerator(object):
u'''\n'''
u'''//-------------- String to value enum mapping ----------------\n'''
u'''\n'''
- u'''namespace NsSmartDeviceLink {\n'''
- u'''namespace NsSmartObjects {\n'''
+ u'''namespace ns_smart_device_link {\n'''
+ u'''namespace ns_smart_objects {\n'''
u'''\n'''
u'''$enum_string_coversions'''
u'''\n'''
- u'''} // NsSmartObjects\n'''
- u'''} // NsSmartDeviceLink\n'''
+ u'''} // ns_smart_objects\n'''
+ u'''} // ns_smart_device_link\n'''
u'''\n''')
_enum_to_str_converter_template = string.Template(
@@ -1465,7 +1669,7 @@ class CodeGenerator(object):
u'''\n''')
_struct_schema_item_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> struct_schema_item_${name} = '''
+ u'''std::shared_ptr<ISchemaItem> struct_schema_item_${name} = '''
u'''InitStructSchemaItem_${name}(struct_schema_items);\n'''
u'''struct_schema_items.insert(std::make_pair('''
u'''StructIdentifiers::${name}, struct_schema_item_${name}));\n'''
@@ -1474,15 +1678,15 @@ class CodeGenerator(object):
u'''struct_schema_item_${name})));''')
_function_schema_template = string.Template(
- u'''functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::'''
- u'''NsJSONHandler::'''
+ u'''functions_schemes_.insert(std::make_pair(ns_smart_device_link::'''
+ u'''ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>'''
u'''(FunctionID::$function_id, messageType::$message_type), '''
u'''InitFunction_${function_id}_${message_type}('''
u'''struct_schema_items, function_id_items, message_type_items)));''')
_struct_impl_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items) {\n'''
u'''$code'''
@@ -1499,12 +1703,31 @@ class CodeGenerator(object):
_impl_code_loc_decl_enum_template = string.Template(
u'''std::set<${type}::eType> ${var_name};''')
+ _impl_code_loc_decl_enum_history_set_template = string.Template(
+ u'''std::map<${type}::eType, std::vector<ElementSignature>> ${type}_element_signatures;''')
+
_impl_code_loc_decl_enum_insert_template = string.Template(
u'''${var_name}.insert(${enum}::${value});''')
+ _impl_code_loc_decl_enum_history_set_value_init_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}] = std::vector<ElementSignature>();'''
+ )
+
+ _impl_code_loc_decl_enum_history_set_insert_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}].push_back(ElementSignature("${since}", "${until}", ${removed}));''')
+
+ _impl_gen_schema_enum_history_map_template = string.Template(
+ u'''${name}_element_signatures''')
+
_impl_code_item_decl_temlate = string.Template(
u'''${comment}'''
- u'''utils::SharedPtr<ISchemaItem> ${var_name} = ${item_decl};''')
+ u'''std::shared_ptr<ISchemaItem> ${var_name} = ${item_decl};''')
+
+ _impl_code_shared_ptr_vector_template = string.Template(
+ u'''std::vector<CObjectSchemaItem::SMember> ${var_name}_history_vector;''')
+
+ _impl_code_append_history_vector_template = string.Template(
+ u'''${vector_name}_history_vector.push_back(CObjectSchemaItem::SMember(${name}_SchemaItem, ${mandatory}, "${since}", "${until}", ${deprecated}, ${removed}));''')
_impl_code_integer_item_template = string.Template(
u'''TNumberSchemaItem<${type}>::create(${params})''')
@@ -1525,6 +1748,9 @@ class CodeGenerator(object):
_impl_code_enum_item_template = string.Template(
u'''TEnumSchemaItem<${type}::eType>::create(${params})''')
+ _impl_code_enum_item_with_history_template = string.Template(
+ u'''TEnumSchemaItem<${type}::eType>::createWithSignatures(${params})''')
+
_impl_code_item_param_value_template = string.Template(
u'''TSchemaItemParameter<$type>($value)''')
@@ -1532,6 +1758,14 @@ class CodeGenerator(object):
u'''schema_members["${name}"] = CObjectSchemaItem::'''
u'''SMember(${var_name}, ${is_mandatory});''')
+ _impl_code_item_fill_template_with_version = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed});''')
+
+ _impl_code_item_fill_template_with_version_and_history_vector = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed}, ${vector_name}_history_vector);''')
+
_function_impl_template = string.Template(
u'''CSmartSchema $namespace::$class_name::'''
u'''InitFunction_${function_id}_${message_type}(\n'''
@@ -1553,11 +1787,11 @@ class CodeGenerator(object):
u'''\n'''
u'''CObjectSchemaItem::Members '''
u'''root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MSG_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(schema_members), true);\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(params_members), true);\n\n'''
@@ -1566,7 +1800,7 @@ class CodeGenerator(object):
_class_h_template = string.Template(
u'''$comment\n'''
- u'''class $class_name : public NsSmartDeviceLink::NsJSONHandler::'''
+ u'''class $class_name : public ns_smart_device_link::ns_json_handler::'''
u'''CSmartFactory<FunctionID::eType, messageType::eType, '''
u'''StructIdentifiers::eType> {\n'''
u''' public:\n'''
@@ -1580,7 +1814,7 @@ class CodeGenerator(object):
u''' * @brief Type that maps of struct IDs to schema items.\n'''
u''' */\n'''
u''' typedef std::map<const StructIdentifiers::eType, '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::'''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::'''
u'''ISchemaItem> > TStructsSchemaItems;\n'''
u'''\n'''
u''' /**\n'''
@@ -1589,10 +1823,10 @@ class CodeGenerator(object):
u''' * @param struct_schema_items Struct schema items.\n'''
u''' * @param struct_id ID of structure to provide.\n'''
u''' *\n'''
- u''' * @return utils::SharedPtr of strucute\n'''
+ u''' * @return std::shared_ptr of strucute\n'''
u''' */\n'''
u''' static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id);\n'''
@@ -1623,12 +1857,12 @@ class CodeGenerator(object):
u'''$init_struct_decls'''
u'''};''')
- _function_return_comment = u''' * @return NsSmartDeviceLink::''' \
- u'''NsSmartObjects::CSmartSchema\n'''
+ _function_return_comment = u''' * @return ns_smart_device_link::''' \
+ u'''ns_smart_objects::CSmartSchema\n'''
_function_decl_template = string.Template(
u'''$comment\n'''
- u'''static NsSmartDeviceLink::NsSmartObjects::CSmartSchema '''
+ u'''static ns_smart_device_link::ns_smart_objects::CSmartSchema '''
u'''InitFunction_${function_id}_${message_type}(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
@@ -1637,7 +1871,7 @@ class CodeGenerator(object):
_struct_decl_template = string.Template(
u'''$comment\n'''
u'''static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items);''')
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
index cf9887d39d..6924ec67aa 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
@@ -94,7 +94,7 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_insert_template = string.Template(
u'''functions_schemes_.insert(std::make_pair('''
- u'''NsSmartDeviceLink::NsJSONHandler::'''
+ u'''ns_smart_device_link::ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>('''
u'''FunctionID::${function_id}, messageType::error_response), '''
u'''error_response_schema));\n''')
@@ -102,32 +102,32 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_schema_template = (
u'''CObjectSchemaItem::Members '''
u'''params_members;\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<FunctionID::eType>::create('''
u'''function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<messageType::eType>::create('''
u'''message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kMessage] = CObjectSchemaItem::SMember('''
u'''CStringSchemaItem::create(), true);\n'''
u'''\n'''
u'''CObjectSchemaItem::Members root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = CObjectSchemaItem::SMember('''
u'''CObjectSchemaItem::create(params_members), true);\n'''
u'''\n'''
@@ -136,30 +136,30 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
u'''\n''')
_base_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<FunctionID::eType>::'''
u'''create(function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<messageType::eType>::'''
u'''create(message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_correlation_id_param = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_additional_response_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
index b3fb61f4a9..c3244f7e95 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
@@ -67,23 +67,23 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
"""
base_params = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<FunctionID::eType>::''' \
u'''create(function_id_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<messageType::eType>::''' \
u'''create(message_type_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
correlation_id_param = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
index 22f3fd2c2d..21f07e6ac5 100755
--- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py
+++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
@@ -6,7 +6,7 @@ Contains base parser for SDLRPC v1/v2 and JSON RPC XML format.
import collections
import xml.etree.ElementTree
-
+import re
from generator import Model
@@ -203,16 +203,35 @@ class Parser(object):
internal_scope = None
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_scope":
internal_scope = attributes[attribute]
elif attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in enum '" + params["name"] + "'")
params["internal_scope"] = internal_scope
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
elements = collections.OrderedDict()
for subelement in subelements:
@@ -236,13 +255,32 @@ class Parser(object):
params, subelements, attrib = self._parse_base_item(element, prefix)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attrib:
if attribute == "scope":
scope = attrib[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attrib[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attrib[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attrib[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in struct '" + params["name"] + "'")
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
members = collections.OrderedDict()
for subelement in subelements:
@@ -271,13 +309,32 @@ class Parser(object):
attributes)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["function_id"] = function_id
params["message_type"] = message_type
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
function_params = collections.OrderedDict()
for subelement in subelements:
@@ -359,6 +416,8 @@ class Parser(object):
issues = []
todos = []
subelements = []
+ history = None
+ warnings = []
if "name" not in element.attrib:
raise ParseError("Name is not specified for " + element.tag)
@@ -379,6 +438,12 @@ class Parser(object):
todos.append(self._parse_simple_element(subelement))
elif subelement.tag == "issue":
issues.append(self._parse_issue(subelement))
+ elif subelement.tag == "history":
+ if history is not None:
+ raise ParseError("Elements can only have one history tag: " + element.tag)
+ history = self._parse_history(subelement, prefix, element)
+ elif subelement.tag == "warning":
+ warnings.append(self._parse_simple_element(subelement))
else:
subelements.append(subelement)
@@ -386,6 +451,7 @@ class Parser(object):
params["design_description"] = design_description
params["issues"] = issues
params["todos"] = todos
+ params["history"] = history
return params, subelements, attrib
@@ -443,6 +509,11 @@ class Parser(object):
internal_name = None
value = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_name":
internal_name = attributes[attribute]
@@ -452,9 +523,22 @@ class Parser(object):
except:
raise ParseError("Invalid value for enum element: '" +
attributes[attribute] + "'")
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["internal_name"] = internal_name
params["value"] = value
-
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
# Magic usage is correct
# pylint: disable=W0142
return Model.EnumElement(**params)
@@ -548,8 +632,31 @@ class Parser(object):
"""
params, subelements, attrib = self._parse_base_item(element, "")
- params["is_mandatory"] = self._extract_optional_bool_attrib(
- attrib, "mandatory", True)
+ since_version = self._extract_attrib(attrib, "since")
+ if since_version is not None:
+ result = self._parse_version(since_version)
+ params["since"] = result
+
+ until_version = self._extract_attrib(attrib, "until")
+ if until_version is not None:
+ result = self._parse_version(until_version)
+ params["until"] = result
+
+ deprecated = self._extract_attrib(attrib, "deprecated")
+ if deprecated is not None:
+ params["deprecated"] = deprecated
+
+ removed = self._extract_attrib(attrib, "removed")
+ if removed is not None:
+ params["removed"] = removed
+
+
+ is_mandatory = self._extract_attrib(attrib, "mandatory")
+ if is_mandatory is None:
+ raise ParseError("'mandatory' is not specified for parameter '" +
+ params["name"] + "'")
+
+ params["is_mandatory"] = self._get_bool_from_string(is_mandatory)
scope = self._extract_attrib(attrib, "scope")
if scope is not None:
@@ -651,7 +758,11 @@ class Parser(object):
raise ParseError("Unexpected attributes for element '" +
element_name + "' of parameter '" +
params["name"])
- if len(subelement.getchildren()) != 0:
+ children = subelement.getchildren()
+ for child in children:
+ if child.tag == "description":
+ children.remove(child)
+ if len(children) != 0:
raise ParseError("Unexpected subelements for element '" +
element_name + "' of parameter '" +
params["name"])
@@ -757,3 +868,48 @@ class Parser(object):
print ("Ignoring attribute '" +
name + "'")
return True
+
+ def _parse_version(self, version):
+ """
+ Validates if a version supplied is in the correct
+ format of Major.Minor.Patch. If Major.Minor format
+ is supplied, a patch version of 0 will be added to
+ the end.
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of major_version.minor_version or major_version.minor_version.patch_version")
+
+ version_array = version.split(".")
+ if (len(version_array) == 2):
+ version_array.append("0")
+ dot_str = "."
+ return dot_str.join(version_array)
+
+ def _parse_history(self, history, prefix, parent):
+ if history.tag != "history":
+ raise ParseError("Invalid history tag: " + interface.tag)
+
+ items = []
+
+ for subelement in history:
+ if subelement.tag == "enum" and parent.tag == "enum":
+ items.append(self._parse_enum(subelement, prefix))
+ elif subelement.tag == "element" and parent.tag == "element":
+ items.append(self._parse_enum_element(subelement))
+ elif subelement.tag == "description" and parent.tag == "description":
+ items.append(self._parse_simple_element(subelement))
+ elif subelement.tag == "struct" and parent.tag == "struct":
+ items.append(self._parse_struct(subelement, prefix))
+ elif subelement.tag == "param" and parent.tag == "param":
+ items.append(self._parse_function_param(subelement, prefix))
+ elif subelement.tag == "function" and parent.tag == "function":
+ items.append(self.__parse_function(subelement, prefix))
+ else:
+ raise ParseError("A history tag must be nested within the element it notes the history for. Fix item: '" +
+ parent.attrib["name"] + "'")
+
+ return items
+
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
index b21e320038..c4813d00a8 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
@@ -17,61 +17,61 @@ from generator import Model
EXPECTED_RESULT_REQUEST = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_RESPONSE = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_NOTIFICATION = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
@@ -79,33 +79,33 @@ EXPECTED_RESULT_NOTIFICATION = (
EXPECTED_PRE_FUNCTION_CODE = (
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""params_members;\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler"""
+ u""" params_members[ns_smart_device_link::ns_json_handler"""
u"""::strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kMessage] = CObjectSchemaItem::SMember("""
u"""CStringSchemaItem::create(), true);\n"""
u"""\n"""
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""root_members_map;\n"""
- u""" root_members_map[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" root_members_map[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PARAMS] = CObjectSchemaItem::SMember("""
u"""CObjectSchemaItem::create(params_members), true);\n"""
u"""\n"""
@@ -113,7 +113,7 @@ EXPECTED_PRE_FUNCTION_CODE = (
u"""root_members_map));\n"""
u"""\n"""
u""" functions_schemes_.insert(std::make_pair("""
- u"""NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<"""
+ u"""ns_smart_device_link::ns_json_handler::SmartSchemaKey<"""
u"""FunctionID::eType, messageType::eType>("""
u"""FunctionID::request, messageType::error_response)"""
u""", error_response_schema));\n"""
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
index 111ffb3cbc..35e4aeb6ce 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
@@ -17,23 +17,23 @@ from generator import Model
EXPECTED_NOTIFICATION_RESULT = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")
EXPECTED_REQ_RESP_RESULT = "".join([EXPECTED_NOTIFICATION_RESULT, (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")])
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
index 458c27543b..49369d2559 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -77,7 +77,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -96,24 +96,24 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
CSmartSchema error_response_schema(CObjectSchemaItem::create(root_members_map));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -153,15 +153,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -173,16 +173,16 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -194,14 +194,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -298,8 +298,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -380,6 +380,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
index b265603480..d7310e4d0f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
@@ -223,7 +223,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -234,7 +234,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -244,7 +244,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -268,9 +268,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -278,9 +278,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -288,9 +288,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -304,7 +304,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -314,7 +314,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
index 53e5b7f78a..a62f485eb9 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -76,7 +76,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -94,9 +94,9 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -136,15 +136,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -156,15 +156,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -176,14 +176,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -280,8 +280,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -361,6 +361,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
index 826ea55ce1..cf22f0711f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
@@ -218,7 +218,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -229,7 +229,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -239,7 +239,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -263,9 +263,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -273,9 +273,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -283,9 +283,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -299,7 +299,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -309,7 +309,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/Utils/generate_test_certificates.py b/tools/Utils/generate_test_certificates.py
index 73b6f53cc8..2c1d2cddbf 100755
--- a/tools/Utils/generate_test_certificates.py
+++ b/tools/Utils/generate_test_certificates.py
@@ -118,12 +118,13 @@ def gen_pkcs12(out, key_file, cert_file, verification_certificate) :
"-name 'SPT key and certificates'", "-CAfile ", verification_certificate, \
" -passout pass:")
- """
- Encode certificate $out to base 64
- """
- with open(out, "rb") as cert:
- with open(out + ".enc", "wb") as enc_cert:
- enc_cert.write(cert.read().encode("base64"))
+def gen_pem_file(out, key_file, cert_file, verification_certificate) :
+ """Join $key_file, $cert_file, $verification_certificate in pem file named $out"""
+ files = [key_file, cert_file, verification_certificate]
+ with open(out, "wb") as cert:
+ for fl in files:
+ with open(fl) as infile:
+ cert.write(infile.read())
def answers(name, app_id, country, state, locality, organization, unit, email) :
"""Answer string generator
@@ -228,47 +229,53 @@ def main():
server_key_file = os.path.join(server_dir, "server.key")
server_cert_file = os.path.join(server_dir, "server.crt")
server_pkcs12_file = os.path.join(server_dir, "spt_credential.p12")
+ server_pem_file = os.path.join(server_dir, "spt_credential.pem")
gen_rsa_key(server_key_file, 2048)
gen_cert(server_cert_file, server_key_file, ford_server_cert_file, ford_server_key_file, days, server_answer)
gen_pkcs12(server_pkcs12_file, server_key_file, server_cert_file, client_verification_ca_cert_file)
+ gen_pem_file(server_pem_file, server_key_file, server_cert_file, client_verification_ca_cert_file)
print
print " --== Server unsigned certificate generating ==-- "
server_unsigned_cert_file = os.path.join(server_dir, "server_unsigned.crt")
server_pkcs12_unsigned_file = os.path.join(server_dir, "spt_credential_unsigned.p12")
+ server_pem_unsigned_file = os.path.join(server_dir, "spt_credential_unsigned.pem")
gen_root_cert(server_unsigned_cert_file, server_key_file, days, server_unsigned_answer)
gen_pkcs12(server_pkcs12_unsigned_file, server_key_file, server_unsigned_cert_file, client_verification_ca_cert_file)
+ gen_pem_file(server_pem_unsigned_file, server_key_file, server_unsigned_cert_file, client_verification_ca_cert_file)
print
print " --== Server expired certificate generating ==-- "
server_expired_cert_file = os.path.join(server_dir, "server_expired.crt")
server_pkcs12_expired_file = os.path.join(server_dir, "spt_credential_expired.p12")
+ server_pem_expired_file = os.path.join(server_dir, "spt_credential_expired.pem")
gen_expire_cert(server_expired_cert_file, server_key_file, ford_server_cert_file, ford_server_key_file, days, server_expired_answer)
gen_pkcs12(server_pkcs12_expired_file, server_key_file, server_expired_cert_file, client_verification_ca_cert_file)
+ gen_pem_file(server_pem_expired_file, server_key_file, server_expired_cert_file, client_verification_ca_cert_file)
print
print " --== Client pkcs12 certificate generating ==-- "
client_key_file = os.path.join(client_dir, "client.key")
client_cert_file = os.path.join(client_dir, "client.crt")
- client_pkcs12_file = os.path.join(client_dir, "client_credential.p12")
+ client_pkcs12_file = os.path.join(client_dir, "client_credential.pem")
gen_rsa_key(client_key_file, 2048)
gen_cert(client_cert_file, client_key_file, ford_client_cert_file, ford_client_key_file, days, client_answer)
- gen_pkcs12(client_pkcs12_file, client_key_file, client_cert_file, server_verification_ca_cert_file)
+ gen_pem_file(client_pkcs12_file, client_key_file, client_cert_file, server_verification_ca_cert_file)
print
print " --== Client pkcs12 unsigned certificate generating ==-- "
client_unsigned_cert_file = os.path.join(client_dir, "client_unsigned.crt")
- client_pkcs12_unsigned_file = os.path.join(client_dir, "client_credential_unsigned.p12")
+ client_pkcs12_unsigned_file = os.path.join(client_dir, "client_credential_unsigned.pem")
gen_root_cert(client_unsigned_cert_file, client_key_file, days, client_unsigned_answer)
- gen_pkcs12(client_pkcs12_unsigned_file, client_key_file, client_unsigned_cert_file, server_verification_ca_cert_file)
+ gen_pem_file(client_pkcs12_unsigned_file, client_key_file, client_unsigned_cert_file, server_verification_ca_cert_file)
print
print " --== Client pkcs12 expired certificate generating ==-- "
client_expired_cert_file = os.path.join(client_dir, "client_expired.crt")
- client_pkcs12_expired_file = os.path.join(client_dir, "client_credential_expired.p12")
+ client_pkcs12_expired_file = os.path.join(client_dir, "client_credential_expired.pem")
gen_expire_cert(client_expired_cert_file, client_key_file, ford_client_cert_file, ford_client_key_file, days, client_expired_answer)
- gen_pkcs12(client_pkcs12_expired_file, client_key_file, client_expired_cert_file, server_verification_ca_cert_file)
+ gen_pem_file(client_pkcs12_expired_file, client_key_file, client_expired_cert_file, server_verification_ca_cert_file)
subprocess.call(["c_rehash", server_dir])
subprocess.call(["c_rehash", client_dir])
diff --git a/tools/cmake/modules/FindQt5DBus.cmake b/tools/cmake/modules/FindQt5DBus.cmake
deleted file mode 100644
index d850010e97..0000000000
--- a/tools/cmake/modules/FindQt5DBus.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-execute_process(
- COMMAND ${CMAKE_SOURCE_DIR}/FindQt.sh -v ${qt_version} Qt5DBusConfig.cmake
- OUTPUT_VARIABLE config_file
-)
-
-if(config_file STREQUAL "")
- message(FATAL_ERROR "Qt5 DBus module not found")
-endif(config_file STREQUAL "")
-
-include(${config_file})
diff --git a/tools/infrastructure/check_style.sh b/tools/infrastructure/check_style.sh
index 647427e793..08ae1b9860 100755
--- a/tools/infrastructure/check_style.sh
+++ b/tools/infrastructure/check_style.sh
@@ -58,6 +58,19 @@ if [ "$1" = "--fix" ]
then
for FILE_NAME in $FILE_NAMES; do fix_style $FILE_NAME; done
else
- for FILE_NAME in $FILE_NAMES; do check_style $FILE_NAME; done
+ PASSED=0
+ for FILE_NAME in $FILE_NAMES; do
+ check_style $FILE_NAME
+ if [ $? != 0 ]
+ then
+ echo "in " $FILE_NAME
+ PASSED=1
+ fi
+ done
+ if [ $PASSED = 1 ]
+ then
+ exit 1
+ fi
fi
+
diff --git a/tools/intergen/GenerateInterfaceLibrary.cmake b/tools/intergen/GenerateInterfaceLibrary.cmake
index bec35e1e3a..31b06880c6 100644
--- a/tools/intergen/GenerateInterfaceLibrary.cmake
+++ b/tools/intergen/GenerateInterfaceLibrary.cmake
@@ -11,20 +11,14 @@ set(GENERATED_LIB_HEADER_DEPENDENCIES
# |generated_interface_names| should contain list of generated interfaces
# if |AUTO_FUNC_IDS| is added to argument list, intergen is called with "-a"
# flag telling intergen to generate function ids automatically
-# if |DBUS_SUPPORT| is added to argument list, intergen is called with "-d"
-# flag that enables DBus serialization code generation
# from xml_file (intergen creates separate directory for every interface).
# Their names are written lowercase_underscored_style.
function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
- set(options AUTO_FUNC_IDS DBUS_SUPPORT)
+ set(options AUTO_FUNC_IDS)
cmake_parse_arguments(GenerateInterfaceLibrary "${options}" "" "" ${ARGN})
if (GenerateInterfaceLibrary_AUTO_FUNC_IDS)
set(AUTOID "-a")
endif()
- if (GenerateInterfaceLibrary_DBUS_SUPPORT)
- set(NEED_DBUS "-d")
- list(APPEND GENERATED_LIB_HEADER_DEPENDENCIES ${DBUS_INCLUDE_DIRS})
- endif()
foreach(interface_name ${generated_interface_names})
set(HEADERS
@@ -41,7 +35,7 @@ function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
${interface_name}/interface.cc
)
add_custom_command( OUTPUT ${HEADERS} ${SOURCES}
- COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} ${NEED_DBUS} -i ${interface_name}
+ COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} -i ${interface_name}
DEPENDS ${INTERGEN_CMD} ${xml_file_name}
COMMENT "Generating interface ${interface_name} from ${xml_file_name}"
VERBATIM
diff --git a/tools/intergen/cppgen/CMakeLists.txt b/tools/intergen/cppgen/CMakeLists.txt
index c6e052a2ae..d20f3d9ab3 100644
--- a/tools/intergen/cppgen/CMakeLists.txt
+++ b/tools/intergen/cppgen/CMakeLists.txt
@@ -27,7 +27,6 @@ set (SOURCES
src/cppgen/namespace.cc
src/cppgen/naming_convention.cc
src/cppgen/struct_type_constructor.cc
- src/cppgen/struct_type_dbus_serializer.cc
src/cppgen/struct_type_from_json_method.cc
src/cppgen/struct_type_is_initialized_method.cc
src/cppgen/struct_type_is_valid_method.cc
@@ -58,7 +57,6 @@ set (HEADERS
include/cppgen/namespace.h
include/cppgen/naming_convention.h
include/cppgen/struct_type_constructor.h
- include/cppgen/struct_type_dbus_serializer.h
include/cppgen/struct_type_from_json_method.h
include/cppgen/struct_type_is_initialized_method.h
include/cppgen/struct_type_is_valid_method.h
diff --git a/tools/intergen/cppgen/include/cppgen/generator_preferences.h b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
index 5278a24417..d0a58950e2 100644
--- a/tools/intergen/cppgen/include/cppgen/generator_preferences.h
+++ b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
@@ -43,18 +43,15 @@ struct TypePreferences {
int minimum_interger_size;
bool avoid_unsigned;
bool generate_json;
- bool generate_dbus;
TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus);
+ bool generate_json);
};
struct Preferences {
Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces);
TypePreferences type_preferences;
std::set<std::string> requested_interfaces;
diff --git a/tools/intergen/cppgen/include/cppgen/message_factory_function.h b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
index da63b4453a..aa8a0ab6c4 100644
--- a/tools/intergen/cppgen/include/cppgen/message_factory_function.h
+++ b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
@@ -46,8 +46,7 @@ class Interface;
class MessageFactoryFunction: public CppFunction {
public:
enum SerializationType {
- kJson,
- kDbus
+ kJson
};
// Methods
diff --git a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h b/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
deleted file mode 100644
index 64872f3265..0000000000
--- a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-#define CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-
-#include "cppgen/cpp_function.h"
-
-namespace codegen {
-class Interface;
-class Struct;
-class TypePreferences;
-
-class StructTypeDbusMessageSignatureMethod: public CppFunction {
- public:
- StructTypeDbusMessageSignatureMethod(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure);
- ~StructTypeDbusMessageSignatureMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeFromDbusReaderConstructor : public CppStructConstructor {
- public:
- StructTypeFromDbusReaderConstructor(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name);
- ~StructTypeFromDbusReaderConstructor();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeToDbusWriterMethod : public CppFunction {
- public:
- StructTypeToDbusWriterMethod(const Struct* strct,
- bool substructure);
- ~StructTypeToDbusWriterMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- bool substructure_;
- const Struct* strct_;
-};
-
-} // namespace codegen
-
-#endif // CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
diff --git a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
index 49bd758b6e..519e6a06e2 100644
--- a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
@@ -183,9 +183,6 @@ void CppInterfaceCodeGenerator::GenerateMessageFactories() {
if (preferences_->generate_json) {
ser_types[ser_types_count++] = MessageFactoryFunction::kJson;
}
- if (preferences_->generate_dbus) {
- ser_types[ser_types_count++] = MessageFactoryFunction::kDbus;
- }
for (size_t i = 0; i < ser_types_count; ++i) {
MessageFactoryFunction request_factory(interface_,
diff --git a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
index 46e459198e..649ffd8c68 100644
--- a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
@@ -47,7 +47,6 @@
#include "cppgen/module_manager.h"
#include "cppgen/naming_convention.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -98,14 +97,6 @@ void DeclareExternalTypes(const TypePreferences& prefs, Namespace* ns) {
Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kClass, "Value"));
}
- if (prefs.generate_dbus) {
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageReader"));
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageWriter"));
- }
}
}
@@ -172,13 +163,6 @@ void DeclarationGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(strct).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(
- preferences_, strct, true, base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(strct, true).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Declare(&o, true);
- }
StructTypeIsValidMethod(strct).Declare(&o, true);
StructTypeIsInitializedMethod(strct).Declare(&o, true);
StructTypeStructEmptyMethod(strct).Declare(&o, true);
@@ -284,13 +268,6 @@ void DeclarationGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&request).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&request, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&request).Declare(&o, true);
StructTypeIsInitializedMethod(&request).Declare(&o, true);
StructTypeStructEmptyMethod(&request).Declare(&o, true);
@@ -336,14 +313,6 @@ void DeclarationGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeToJsonMethod(&response).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&response, false).Declare(&o , true);
-
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&response).Declare(&o, true);
StructTypeIsInitializedMethod(&response).Declare(&o, true);
StructTypeStructEmptyMethod(&response).Declare(&o, true);
@@ -389,13 +358,6 @@ void DeclarationGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&notification).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Declare(&o , true);
- StructTypeToDbusWriterMethod(&notification, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&notification).Declare(&o, true);
StructTypeIsInitializedMethod(&notification).Declare(&o, true);
StructTypeStructEmptyMethod(&notification).Declare(&o, true);
diff --git a/tools/intergen/cppgen/src/cppgen/definition_generator.cc b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
index e2ad0ded04..b5e404fa71 100644
--- a/tools/intergen/cppgen/src/cppgen/definition_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
@@ -40,7 +40,6 @@
#include "cppgen/message_handle_with_method.h"
#include "cppgen/module_manager.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -97,13 +96,6 @@ void DefinitionGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Define(&o , false);
StructTypeToJsonMethod(strct).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, strct, true,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(strct, true).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Define(&o, false);
- }
StructTypeIsValidMethod(strct).Define(&o, false);
StructTypeIsInitializedMethod(strct).Define(&o, false);
StructTypeStructEmptyMethod(strct).Define(&o, false);
@@ -137,13 +129,6 @@ void DefinitionGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeFromJsonConstructor(&response, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&response).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&response, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Define(&o, false);
- }
MessageHandleWithMethod(response.name()).Define(&o, false);
StructTypeIsValidMethod(&response).Define(&o, false);
StructTypeIsInitializedMethod(&response).Define(&o, false);
@@ -173,13 +158,6 @@ void DefinitionGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&notification).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Define(&o, false);
- StructTypeToDbusWriterMethod(&notification, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Define(&o, false);
- }
MessageHandleWithMethod(notification.name()).Define(&o, false);
StructTypeIsValidMethod(&notification).Define(&o, false);
StructTypeIsInitializedMethod(&notification).Define(&o, false);
@@ -209,13 +187,6 @@ void DefinitionGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&request).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&request, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Define(&o, false);
- }
StructTypeIsValidMethod(&request).Define(&o, false);
StructTypeIsInitializedMethod(&request).Define(&o, false);
StructTypeStructEmptyMethod(&request).Define(&o, false);
diff --git a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
index ca5b12e2d9..cc3bbe0819 100644
--- a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
+++ b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
@@ -44,21 +44,18 @@ namespace codegen {
TypePreferences::TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus)
+ bool generate_json)
: minimum_interger_size(minimum_interger_size),
avoid_unsigned(avoid_unsigned),
- generate_json(generate_json),
- generate_dbus(generate_dbus) {
+ generate_json(generate_json) {
}
Preferences::Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces)
: type_preferences(minimum_interger_size, avoid_unsigned,
- generate_json, generate_dbus),
+ generate_json),
requested_interfaces(requested_interfaces) {
}
diff --git a/tools/intergen/cppgen/src/cppgen/handler_interface.cc b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
index 57b41523fd..a078b7af9a 100644
--- a/tools/intergen/cppgen/src/cppgen/handler_interface.cc
+++ b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
@@ -76,7 +76,7 @@ void HandlerInterface::CollectMethods() {
assert(!"Unexpected function message type");
}
}
- std::auto_ptr<CppClass::Method> destructor(
+ std::unique_ptr<CppClass::Method> destructor(
new CppClass::Method(this, CppClass::kPublic,
"~"+name(), "",
CppFunction::kVirtual));
@@ -93,7 +93,7 @@ void HandlerInterface::AddFunctionMessageHandlers(
message_ns.ForwardDeclare(Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kStruct,
func_msg->name()));
- std::auto_ptr<CppClass::Method> method(
+ std::unique_ptr<CppClass::Method> method(
new CppClass::Method(
this, CppClass::kPublic, "Handle" + func_msg->name(),
"void", CppFunction::kVirtual | CppFunction::kAbstract));
diff --git a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
index 2cfc3ea0cd..bce7ef50b2 100644
--- a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
+++ b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
@@ -47,15 +47,15 @@ MessageFactoryFunction::MessageFactoryFunction(
SerializationType serialization_type,
FunctionMessage::MessageType factory_type)
: CppFunction("",
- serialization_type == kJson ? "NewFromJson" : "NewFromDbus",
+ "NewFromJson",
Capitalize(
FunctionMessage::MessageTypeToString(
factory_type)) + "*"),
interface_(interface),
factory_type_(factory_type) {
Add(MessageFactoryFunction::Parameter(
- serialization_type == kJson ? "json" : "reader",
- serialization_type == kJson ? "const Json::Value*": "dbus::MessageReader*"));
+ "json",
+ "const Json::Value*"));
Add(MessageFactoryFunction::Parameter("function_id", "FunctionID"));
}
diff --git a/tools/intergen/cppgen/src/cppgen/module_manager.cc b/tools/intergen/cppgen/src/cppgen/module_manager.cc
index 494e279e5c..104e3fa856 100644
--- a/tools/intergen/cppgen/src/cppgen/module_manager.cc
+++ b/tools/intergen/cppgen/src/cppgen/module_manager.cc
@@ -105,12 +105,6 @@ ModuleManager::ModuleManager(const std::string& name,
functions_source_.Include(
CppFile::Header("rpc_base/rpc_base_json_inl.h", true));
}
- if (prefs.generate_dbus) {
- structs_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- functions_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- }
}
ModuleManager::~ModuleManager() {
diff --git a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc b/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
deleted file mode 100644
index 5040652e43..0000000000
--- a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "cppgen/struct_type_dbus_serializer.h"
-
-#include "cppgen/naming_convention.h"
-#include "cppgen/type_name_code_generator.h"
-#include "model/composite_type.h"
-#include "utils/safeformat.h"
-
-using typesafe_format::strmfmt;
-
-namespace codegen {
-
-StructTypeDbusMessageSignatureMethod::StructTypeDbusMessageSignatureMethod(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "GetDbusSignature", "void", kStatic),
- preferences_(preferences),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("signature", "std::string*"));
-}
-
-StructTypeDbusMessageSignatureMethod::~StructTypeDbusMessageSignatureMethod() {
-}
-
-void StructTypeDbusMessageSignatureMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_BEGIN_CHAR;\n";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(),
- end = fields.end(); i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "rpc::DbusSignature< {0} >({1});\n",
- field_type, parameters_[0].name);
-
- }
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_END_CHAR;\n";
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::StructTypeFromDbusReaderConstructor(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name)
- : CppStructConstructor(strct->name()),
- preferences_(preferences),
- strct_(strct),
- substructure_(substructure) {
- Add(Parameter("reader__", "dbus::MessageReader*"));
- std::string base_initializer = "reader__";
- if (!strct->frankenstruct()) {
- base_initializer = "InitHelper(true)";
- }
- Add(Initializer(base_class_name, base_initializer));
- // In case of non-substructure use initializer list to initialize fields
- // From MessageReader passed in
- if (!substructure_) {
- const Struct::FieldsList& fields = strct->fields();
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- Add(Initializer(AvoidKeywords(i->name()),
- "reader__"));
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::~StructTypeFromDbusReaderConstructor() {
-}
-
-void StructTypeFromDbusReaderConstructor::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- // If initializing substructure (a structure that is used as
- // a field of other structure) additional structure reading iterator
- // should be created
- if (substructure_ && !fields.empty()) {
- *os << "dbus::MessageReader subreader__ = reader__->TakeStructReader();\n";
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "{0} = {1}(&subreader__);\n", i->name(), field_type);
- }
- }
-}
-
-StructTypeToDbusWriterMethod::StructTypeToDbusWriterMethod(
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "ToDbusWriter", "void", kConst),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("writer__", "dbus::MessageWriter*"));
-}
-
-StructTypeToDbusWriterMethod::~StructTypeToDbusWriterMethod() {
-
-}
-
-void StructTypeToDbusWriterMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- std::string writer_ptr_name = parameters_[0].name;
- if (substructure_) {
- strmfmt(*os, "dbus::MessageWriter subwriter__({0}, dbus::kStruct, NULL);\n",
- writer_ptr_name);
- writer_ptr_name = "&subwriter__";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- strmfmt(*os, "{0}.ToDbusWriter({1});\n",
- i->name(),
- writer_ptr_name);
- }
- }
-}
-
-
-} // namespace codegen
diff --git a/tools/intergen/model/src/model/composite_type.cc b/tools/intergen/model/src/model/composite_type.cc
index 57e89cce54..d4b0687c5a 100644
--- a/tools/intergen/model/src/model/composite_type.cc
+++ b/tools/intergen/model/src/model/composite_type.cc
@@ -332,6 +332,7 @@ bool NullableType::operator<(const NullableType& that) const {
if (type_ != that.type_) {
return type_ < that.type_;
}
+ return false;
}
TypeCodeGenerator* NullableType::Apply(
diff --git a/tools/intergen/test/CMakeLists.txt b/tools/intergen/test/CMakeLists.txt
index 27d506443e..7695ec419c 100644
--- a/tools/intergen/test/CMakeLists.txt
+++ b/tools/intergen/test/CMakeLists.txt
@@ -30,11 +30,7 @@
if(BUILD_TESTS)
include(${CMAKE_SOURCE_DIR}/tools/intergen/GenerateInterfaceLibrary.cmake)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
-endif()
+GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
set (TEST_HMI_INTERFACES
common
@@ -45,11 +41,7 @@ set (TEST_HMI_INTERFACES
ui
)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
-endif()
+GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
include_directories (
${CMAKE_SOURCE_DIR}/src/components/rpc_base/include
@@ -70,16 +62,5 @@ set (SOURCES
generated_interface_json_tests.cc
)
-if (${HMI_DBUS_API})
- # Build dbus tests
- include_directories(
- ${CMAKE_SOURCE_DIR}/src/components/dbus/include
- ${DBUS_INCLUDE_DIRS}
- )
- set (LIBRARIES ${LIBRARIES} dbus)
- set (SOURCES ${SOURCES} generated_interface_dbus_tests.cc)
-endif ()
-
-
create_test(test_generated_interface "${SOURCES}" "${LIBRARIES}")
endif()
diff --git a/tools/intergen/test/generated_interface_dbus_tests.cc b/tools/intergen/test/generated_interface_dbus_tests.cc
deleted file mode 100644
index a510ccd77a..0000000000
--- a/tools/intergen/test/generated_interface_dbus_tests.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gmock/gmock.h"
-
-#include <test_rpc_interface/interface.h>
-#include <test_rpc_interface/functions.h>
-
-#include "dbus/dbus_message.h"
-
-namespace test {
-using namespace rpc::test_rpc_interface;
-
-TEST(GeneratedInterfaceDbusTests, TestFailedDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_TRUE(reader.has_failed());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_FALSE(dm.is_valid());
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- writer.PutUint16(22);
- writer.PutUint16(42);
- dbus::MessageWriter array_writer(&writer, dbus::kArray, DBUS_TYPE_BYTE_AS_STRING);
- array_writer.PutByte(11);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 22);
- ASSERT_EQ(dm.messageLength, 42);
- ASSERT_EQ(dm.messageData.size(), 1u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusSerializationDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- request::DiagnosticMessage dm;
- dm.targetID = 70;
- dm.messageLength = 1;
- dm.messageData.push_back(42);
- dm.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 70);
- ASSERT_EQ(dm.messageLength, 1);
- ASSERT_EQ(dm.messageData.size(), 1u);
- ASSERT_EQ(dm.messageData[0], 42u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusAddSubMenuSerializatioDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- notification::DummyNotification dn;
- TdStruct tds;
- tds.resArrMap["Hello"].push_back(R_SUCCESS);
- (*tds.optionalResArrMap)["World"].push_back(R_INVALID_DATA);
- dn.tds.push_back(tds);
- ASSERT_TRUE(dn.is_valid());
- dn.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- notification::DummyNotification dn(&reader);
- ASSERT_TRUE(dn.is_initialized());
- ASSERT_TRUE(dn.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(dn.tds[0].resArrMap["Hello"][0], R_SUCCESS);
- ASSERT_EQ((*dn.tds[0].optionalResArrMap)["World"][0], R_INVALID_DATA);
- }
-}
-
-} // namespace test
diff --git a/tools/intergen/test/generated_interface_json_tests.cc b/tools/intergen/test/generated_interface_json_tests.cc
index 995ff17e8b..ee1db2167b 100644
--- a/tools/intergen/test/generated_interface_json_tests.cc
+++ b/tools/intergen/test/generated_interface_json_tests.cc
@@ -545,7 +545,7 @@ TEST_F(GeneratedInterfaceTests, ReportIncorrectlyInitializedMap1) {
ASSERT_FALSE(smim.is_valid());
rpc::ValidationReport report("smim");
smim.ReportErrors(&report);
- ASSERT_EQ("smim.mandatoryIntMap: object is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("smim.mandatoryIntMap: object is not initialized", PrettyFormat(report));
}
TEST_F(GeneratedInterfaceTests, ReportIncorrectlyInitializedMap2) {
@@ -556,7 +556,7 @@ TEST_F(GeneratedInterfaceTests, ReportIncorrectlyInitializedMap2) {
ASSERT_EQ("c: object is not initialized\n"
"c.choiceID: value is not initialized\n"
"c.menuName: value is not initialized\n"
- "c.vrCommands: object is not initialized\n", PrettyFormat(report));
+ "c.vrCommands: object is not initialized", PrettyFormat(report));
}
TEST_F(GeneratedInterfaceTests, TestFrankenstructCreation) {
@@ -621,7 +621,7 @@ TEST_F(GeneratedInterfaceTests, FrankenstructFromInvalidJson) {
ASSERT_EQ(2, fbmi.mandatoryInt);
rpc::ValidationReport report("fbmi");
fbmi.ReportErrors(&report);
- ASSERT_EQ("fbmi[\"hello\"]: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("fbmi[\"hello\"]: value initialized incorrectly", PrettyFormat(report));
}
} // namespace test
diff --git a/tools/intergen/test/test_hmi_interface.xml b/tools/intergen/test/test_hmi_interface.xml
index e091909833..7573d35ef9 100644
--- a/tools/intergen/test/test_hmi_interface.xml
+++ b/tools/intergen/test/test_hmi_interface.xml
@@ -66,6 +66,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -175,6 +176,51 @@
<element name="NO-NO" internal_name="NO_NO">
<description>Norwegian - Norway</description>
</element>
+ <element name="NL-BE" internal_name="NL_BE">
+ <description>Dutch (Flemish) - Belgium</description>
+ </element>
+ <element name="EL-GR" internal_name="EL_GR">
+ <description>Greek - Greece</description>
+ </element>
+ <element name="HU-HU" internal_name="HU_HU">
+ <description>Hungarian - Hungary</description>
+ </element>
+ <element name="FI-FI" internal_name="FI_FI">
+ <description>Finnish - Finland</description>
+ </element>
+ <element name="SK-SK" internal_name="SK_SK">
+ <description>Slovak - Slovakia</description>
+ </element>
+ <element name="EN-IN" internal_name="EN_IN">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN">
+ <description>Hindi - India</description>
+ </element>
</enum>
<enum name="SoftButtonType">
@@ -2732,938 +2778,573 @@
</description>
</param>
</function>
-
-<!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="GetSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Boolean" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="GetRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Boolean" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="GetFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Boolean" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="GetFuelLevelState" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="GetInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="GetExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
+ <param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="GetVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
-
- <function name="GetPrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="GetTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="GetOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
+ <param name="odometer" type="Boolean" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="GetBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Boolean" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="GetBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Boolean" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="GetDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Boolean" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="GetDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Boolean" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="GetWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Boolean" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="GetHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="GetEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Boolean" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="GetAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="GetSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="GetECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
-
- <function name="GetAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
+ <param name="airbagStatus" type="Boolean" mandatory="false">
<description>The status of the air bags</description>
</param>
- </function>
-
- <function name="GetEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
<description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="GetClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
<description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="GetMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="myKey" type="Boolean" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of GetVehicleData-->
-
-<!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="OnSpeed" messagetype="notification">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="OnRpm" messagetype="notification">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="OnFuelLevel" messagetype="notification">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="OnFuelLevelState" messagetype="notification">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="OnInstantFuelConsumption" messagetype="notification">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="OnExternalTemperature" messagetype="notification">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
-
- <function name="OnVin" messagetype="notification">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="OnPrndl" messagetype="notification">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="OnTirePressure" messagetype="notification">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="OnOdometer" messagetype="notification">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="2000000" mandatory="true">
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="OnBeltStatus" messagetype="notification">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="OnBodyInformation" messagetype="notification">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="OnDeviceStatus" messagetype="notification">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="OnDriverBraking" messagetype="notification">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="OnWiperStatus" messagetype="notification">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="OnHeadLampStatus" messagetype="notification">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="OnEngineTorque" messagetype="notification">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="OnAccPedalPosition" messagetype="notification">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="OnSteeringWheelAngle" messagetype="notification">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="OnMyKey" messagetype="notification">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of OnVehicleData-->
-
-<!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request">
+ <function name="UnsubscribeVehicleData" messagetype="request">
+ <description>
+ This function is used to unsubscribe the notifications from the subscribeVehicleData function.
+ </description>
<param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <description>ID of application that requested this RPC.</description>
</param>
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="SubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="UnsubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="UnsubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="SubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
-
- <function name="SubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="SubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
-
- <function name="SubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="SubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <function name="GetVehicleData" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="SubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
</param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
-
- <function name="SubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="SubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="SubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
-
- <function name="SubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <function name="GetVehicleData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
-
- <function name="SubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="OnVehicleData" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="SubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
-
- <function name="SubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
</function>
-<!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
</interface>
</interfaces>
diff --git a/tools/intergen/tool/intergen.cc b/tools/intergen/tool/intergen.cc
index bad87b178b..8fc8302dcc 100644
--- a/tools/intergen/tool/intergen.cc
+++ b/tools/intergen/tool/intergen.cc
@@ -54,7 +54,6 @@ struct Options {
char* interface_xml;
bool auto_generate_function_ids;
bool generate_json_code;
- bool generate_dbus_code;
std::set<std::string> requested_interfaces;
std::set<std::string> excluded_scopes;
bool avoid_unsigned;
@@ -63,7 +62,6 @@ struct Options {
: interface_xml(NULL),
auto_generate_function_ids(false),
generate_json_code(false),
- generate_dbus_code(false),
avoid_unsigned(false),
minimum_word_size(8) {
}
@@ -138,10 +136,6 @@ int main(int argc, char* argv[]) {
options.generate_json_code = true;
break;
}
- case 'd': {
- options.generate_dbus_code = true;
- break;
- }
default: {
cerr << "Invalid option: '" << opt << "'" << '\n';
return EXIT_FAILURE;
@@ -165,7 +159,6 @@ int main(int argc, char* argv[]) {
codegen::Preferences(options.minimum_word_size,
options.avoid_unsigned,
options.generate_json_code,
- options.generate_dbus_code,
options.requested_interfaces));
if (bad.empty()) {
return EXIT_SUCCESS;